From: support Date: Thu, 19 Jan 2023 16:25:15 +0000 (+0000) Subject: Built motion from commit 8271bb6f.|2.6.28 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22angular-material.layout.css/%22?a=commitdiff_plain;h=c01d4847f6d1ebc8e03d0f3f7ea950f1cfd1709e;p=motion2.git Built motion from commit 8271bb6f.|2.6.28 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index afe0569..b473114 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1,6 +1,6 @@ define({ "name": "xCALLY Motion API", - "version": "2.6.29", + "version": "2.6.28", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-01-19T14:06:17.276Z", + "time": "2023-01-19T16:17:14.316Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 65fed61..3c188a4 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1,6 +1,6 @@ { "name": "xCALLY Motion API", - "version": "2.6.29", + "version": "2.6.28", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-01-19T14:06:17.276Z", + "time": "2023-01-19T16:17:14.316Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index bec345e..1b847b4 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.6.29", + "version": "2.6.28", "dependencies": { "@babel/code-frame": { "version": "7.18.6", diff --git a/package.json b/package.json index c430d50..5371a30 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.6.29", + "version": "2.6.28", "description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.", "main": "server/app.js", "engines": { diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 8602b2b..7ff55fd 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 _0x07b5=['exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','urlForward','browser','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[body]','sequelize'];(function(_0x8bca3f,_0x158cf8){var _0x448ab5=function(_0x5b5537){while(--_0x5b5537){_0x8bca3f['push'](_0x8bca3f['shift']());}};_0x448ab5(++_0x158cf8);}(_0x07b5,0x10f));var _0x507b=function(_0x52684f,_0xff73fc){_0x52684f=_0x52684f-0x0;var _0x4a55f0=_0x07b5[_0x52684f];return _0x4a55f0;};'use strict';var Sequelize=require(_0x507b('0x0'));module[_0x507b('0x1')]={'name':{'type':Sequelize[_0x507b('0x2')],'get':function(_0x5a16a9){return this['getDataValue'](_0x507b('0x3'));}},'action':{'type':Sequelize[_0x507b('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x507b('0x5'),_0x507b('0x6'),_0x507b('0x7'),'jscripty',_0x507b('0x8'),_0x507b('0x9'),_0x507b('0xa'),_0x507b('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x507b('0xc')},'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[_0x507b('0x4')](0x1000),'comment':_0x507b('0xd')},'data3':{'type':Sequelize[_0x507b('0x4')](0x1000),'comment':_0x507b('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x507b('0xf')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x507b('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x507b('0x10')}}; \ No newline at end of file +var _0x87fa=['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]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','getDataValue','action','STRING','contactManager','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x2f8c05,_0x551e3d){var _0x14cfde=function(_0x282d66){while(--_0x282d66){_0x2f8c05['push'](_0x2f8c05['shift']());}};_0x14cfde(++_0x551e3d);}(_0x87fa,0xf6));var _0xa87f=function(_0x505e73,_0x533864){_0x505e73=_0x505e73-0x0;var _0x2ac5b6=_0x87fa[_0x505e73];return _0x2ac5b6;};'use strict';var Sequelize=require(_0xa87f('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1a3085){return this[_0xa87f('0x1')](_0xa87f('0x2'));}},'action':{'type':Sequelize[_0xa87f('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xa87f('0x4'),'integration','motionbar','jscripty','urlForward',_0xa87f('0x5'),_0xa87f('0x6'),_0xa87f('0x7')]],'msg':_0xa87f('0x8')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xa87f('0x3')](0x1000),'comment':_0xa87f('0x9')},'data2':{'type':Sequelize[_0xa87f('0x3')](0x1000),'comment':_0xa87f('0xa')},'data3':{'type':Sequelize[_0xa87f('0x3')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xa87f('0x3')](0x1000),'comments':_0xa87f('0xb')},'data6':{'type':Sequelize[_0xa87f('0x3')],'comments':_0xa87f('0xc')},'data7':{'type':Sequelize[_0xa87f('0xd')],'comments':_0xa87f('0xe')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index b5d0155..4893755 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 _0x7e02=['error','stack','name','send','update','body','Action','params','catch','destroy','find','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','json','apply','reject','save','then'];(function(_0x45ff84,_0x18736f){var _0x5b0a0c=function(_0x45d32f){while(--_0x45d32f){_0x45ff84['push'](_0x45ff84['shift']());}};_0x5b0a0c(++_0x18736f);}(_0x7e02,0x15b));var _0x27e0=function(_0x31ed82,_0x519b1b){_0x31ed82=_0x31ed82-0x0;var _0x43a4b1=_0x7e02[_0x31ed82];return _0x43a4b1;};'use strict';var emlformat=require(_0x27e0('0x0'));var rimraf=require(_0x27e0('0x1'));var zipdir=require(_0x27e0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x27e0('0x3'));var BPromise=require(_0x27e0('0x4'));var Mustache=require('mustache');var util=require(_0x27e0('0x5'));var path=require(_0x27e0('0x6'));var sox=require(_0x27e0('0x7'));var csv=require(_0x27e0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27e0('0x9'));var _=require(_0x27e0('0xa'));var squel=require(_0x27e0('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x27e0('0xc'));var toCsv=require(_0x27e0('0x8'));var querystring=require(_0x27e0('0xd'));var Papa=require(_0x27e0('0xe'));var Redis=require(_0x27e0('0xf'));var authService=require(_0x27e0('0x10'));var qs=require(_0x27e0('0x11'));var as=require(_0x27e0('0x12'));var hardwareService=require(_0x27e0('0x13'));var logger=require(_0x27e0('0x14'))(_0x27e0('0x15'));var utils=require(_0x27e0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x27e0('0x17'));var db=require(_0x27e0('0x18'))['db'];function respondWithStatusCode(_0x5dc42c,_0x1655b3){_0x1655b3=_0x1655b3||0xcc;return function(_0x2d1fe6){if(_0x2d1fe6){return _0x5dc42c[_0x27e0('0x19')](_0x1655b3);}return _0x5dc42c[_0x27e0('0x1a')](_0x1655b3)[_0x27e0('0x1b')]();};}function respondWithResult(_0x51142d,_0x237ce3){_0x237ce3=_0x237ce3||0xc8;return function(_0x26a8b5){if(_0x26a8b5){return _0x51142d[_0x27e0('0x1a')](_0x237ce3)['json'](_0x26a8b5);}};}function respondWithFilteredResult(_0xfda651,_0x1bfc12){return function(_0x17de00){if(_0x17de00){var _0x444515=typeof _0x1bfc12[_0x27e0('0x1c')]==='undefined'&&typeof _0x1bfc12[_0x27e0('0x1d')]==='undefined';var _0x167a0f=_0x17de00[_0x27e0('0x1e')];var _0x453718=_0x444515?0x0:_0x1bfc12[_0x27e0('0x1c')];var _0x1aef3b=_0x444515?_0x17de00['count']:_0x1bfc12[_0x27e0('0x1c')]+_0x1bfc12[_0x27e0('0x1d')];var _0x1e24c5;if(_0x1aef3b>=_0x167a0f){_0x1aef3b=_0x167a0f;_0x1e24c5=0xc8;}else{_0x1e24c5=0xce;}_0xfda651[_0x27e0('0x1a')](_0x1e24c5);return _0xfda651[_0x27e0('0x1f')]('Content-Range',_0x453718+'-'+_0x1aef3b+'/'+_0x167a0f)[_0x27e0('0x20')](_0x17de00);}return null;};}function patchUpdates(_0x5b872b){return function(_0x42ee4a){try{jsonpatch[_0x27e0('0x21')](_0x42ee4a,_0x5b872b,!![]);}catch(_0x4dcc74){return BPromise[_0x27e0('0x22')](_0x4dcc74);}return _0x42ee4a[_0x27e0('0x23')]();};}function saveUpdates(_0x1a239c,_0x4e8e44){return function(_0x29348c){if(_0x29348c){return _0x29348c['update'](_0x1a239c)['then'](function(_0x194827){return _0x194827;});}return null;};}function removeEntity(_0x25b7ae,_0x2f67b8){return function(_0x143580){if(_0x143580){return _0x143580['destroy']()[_0x27e0('0x24')](function(){_0x25b7ae[_0x27e0('0x1a')](0xcc)[_0x27e0('0x1b')]();});}};}function handleEntityNotFound(_0x63e17f,_0x13ca09){return function(_0x3a551f){if(!_0x3a551f){_0x63e17f[_0x27e0('0x19')](0x194);}return _0x3a551f;};}function handleError(_0x269010,_0x208721){_0x208721=_0x208721||0x1f4;return function(_0x8a27bb){logger[_0x27e0('0x25')](_0x8a27bb[_0x27e0('0x26')]);if(_0x8a27bb[_0x27e0('0x27')]){delete _0x8a27bb[_0x27e0('0x27')];}_0x269010[_0x27e0('0x1a')](_0x208721)[_0x27e0('0x28')](_0x8a27bb);};}exports[_0x27e0('0x29')]=function(_0x464505,_0x2cf3e6){if(_0x464505[_0x27e0('0x2a')]['id']){delete _0x464505['body']['id'];}return db[_0x27e0('0x2b')]['find']({'where':{'id':_0x464505[_0x27e0('0x2c')]['id']}})[_0x27e0('0x24')](handleEntityNotFound(_0x2cf3e6,null))['then'](saveUpdates(_0x464505[_0x27e0('0x2a')],null))['then'](respondWithResult(_0x2cf3e6,null))[_0x27e0('0x2d')](handleError(_0x2cf3e6,null));};exports[_0x27e0('0x2e')]=function(_0x4942ea,_0xe36af7){return db[_0x27e0('0x2b')][_0x27e0('0x2f')]({'where':{'id':_0x4942ea[_0x27e0('0x2c')]['id']}})[_0x27e0('0x24')](handleEntityNotFound(_0xe36af7,null))[_0x27e0('0x24')](removeEntity(_0xe36af7,null))[_0x27e0('0x2d')](handleError(_0xe36af7,null));}; \ No newline at end of file +var _0xfda9=['json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','eml-format','zip-dir','mustache','util','path','sox','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'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xfda9,0x15d));var _0x9fda=function(_0x29be5a,_0x33a386){_0x29be5a=_0x29be5a-0x0;var _0x4fe55e=_0xfda9[_0x29be5a];return _0x4fe55e;};'use strict';var emlformat=require(_0x9fda('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9fda('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9fda('0x2'));var util=require(_0x9fda('0x3'));var path=require(_0x9fda('0x4'));var sox=require(_0x9fda('0x5'));var csv=require('to-csv');var ejs=require(_0x9fda('0x6'));var fs=require('fs');var fs_extra=require(_0x9fda('0x7'));var _=require(_0x9fda('0x8'));var squel=require(_0x9fda('0x9'));var crypto=require(_0x9fda('0xa'));var jsforce=require(_0x9fda('0xb'));var deskjs=require(_0x9fda('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9fda('0xd'));var Redis=require(_0x9fda('0xe'));var authService=require(_0x9fda('0xf'));var qs=require(_0x9fda('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9fda('0x11'));var logger=require(_0x9fda('0x12'))(_0x9fda('0x13'));var utils=require(_0x9fda('0x14'));var config=require(_0x9fda('0x15'));var licenseUtil=require(_0x9fda('0x16'));var db=require(_0x9fda('0x17'))['db'];function respondWithStatusCode(_0x20837b,_0x16cd68){_0x16cd68=_0x16cd68||0xcc;return function(_0x42c318){if(_0x42c318){return _0x20837b[_0x9fda('0x18')](_0x16cd68);}return _0x20837b['status'](_0x16cd68)[_0x9fda('0x19')]();};}function respondWithResult(_0x54d804,_0x18c6b6){_0x18c6b6=_0x18c6b6||0xc8;return function(_0x14fbb4){if(_0x14fbb4){return _0x54d804[_0x9fda('0x1a')](_0x18c6b6)[_0x9fda('0x1b')](_0x14fbb4);}};}function respondWithFilteredResult(_0x129af5,_0x10f337){return function(_0x5d7cbc){if(_0x5d7cbc){var _0x3d8221=typeof _0x10f337[_0x9fda('0x1c')]===_0x9fda('0x1d')&&typeof _0x10f337[_0x9fda('0x1e')]===_0x9fda('0x1d');var _0x2b29b6=_0x5d7cbc['count'];var _0x317290=_0x3d8221?0x0:_0x10f337[_0x9fda('0x1c')];var _0x13e933=_0x3d8221?_0x5d7cbc[_0x9fda('0x1f')]:_0x10f337['offset']+_0x10f337['limit'];var _0x2e0f7c;if(_0x13e933>=_0x2b29b6){_0x13e933=_0x2b29b6;_0x2e0f7c=0xc8;}else{_0x2e0f7c=0xce;}_0x129af5[_0x9fda('0x1a')](_0x2e0f7c);return _0x129af5['set']('Content-Range',_0x317290+'-'+_0x13e933+'/'+_0x2b29b6)['json'](_0x5d7cbc);}return null;};}function patchUpdates(_0x2c5771){return function(_0x164f63){try{jsonpatch[_0x9fda('0x20')](_0x164f63,_0x2c5771,!![]);}catch(_0xd5fa0c){return BPromise[_0x9fda('0x21')](_0xd5fa0c);}return _0x164f63[_0x9fda('0x22')]();};}function saveUpdates(_0x59da93,_0x4d8bad){return function(_0x10cc3c){if(_0x10cc3c){return _0x10cc3c[_0x9fda('0x23')](_0x59da93)[_0x9fda('0x24')](function(_0x338fd7){return _0x338fd7;});}return null;};}function removeEntity(_0x3159ad,_0x1f8c24){return function(_0x4342e7){if(_0x4342e7){return _0x4342e7[_0x9fda('0x25')]()['then'](function(){_0x3159ad[_0x9fda('0x1a')](0xcc)[_0x9fda('0x19')]();});}};}function handleEntityNotFound(_0xc2efd3,_0x5ba132){return function(_0x1d4f51){if(!_0x1d4f51){_0xc2efd3['sendStatus'](0x194);}return _0x1d4f51;};}function handleError(_0x1cfd7a,_0x2750dc){_0x2750dc=_0x2750dc||0x1f4;return function(_0x2f26b1){logger[_0x9fda('0x26')](_0x2f26b1[_0x9fda('0x27')]);if(_0x2f26b1[_0x9fda('0x28')]){delete _0x2f26b1['name'];}_0x1cfd7a[_0x9fda('0x1a')](_0x2750dc)[_0x9fda('0x29')](_0x2f26b1);};}exports['update']=function(_0xfd1789,_0x1fc7e5){if(_0xfd1789[_0x9fda('0x2a')]['id']){delete _0xfd1789['body']['id'];}return db[_0x9fda('0x2b')][_0x9fda('0x2c')]({'where':{'id':_0xfd1789[_0x9fda('0x2d')]['id']}})[_0x9fda('0x24')](handleEntityNotFound(_0x1fc7e5,null))['then'](saveUpdates(_0xfd1789[_0x9fda('0x2a')],null))['then'](respondWithResult(_0x1fc7e5,null))['catch'](handleError(_0x1fc7e5,null));};exports[_0x9fda('0x25')]=function(_0x12cf18,_0x518933){return db[_0x9fda('0x2b')][_0x9fda('0x2c')]({'where':{'id':_0x12cf18[_0x9fda('0x2d')]['id']}})[_0x9fda('0x24')](handleEntityNotFound(_0x518933,null))[_0x9fda('0x24')](removeEntity(_0x518933,null))[_0x9fda('0x2e')](handleError(_0x518933,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index ada8e4e..d845b43 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 _0x2250=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./action.attributes','exports','define','Action','lodash'];(function(_0x5a5011,_0x3778b9){var _0x2e6ee1=function(_0x5db251){while(--_0x5db251){_0x5a5011['push'](_0x5a5011['shift']());}};_0x2e6ee1(++_0x3778b9);}(_0x2250,0x178));var _0x0225=function(_0x263e17,_0x244755){_0x263e17=_0x263e17-0x0;var _0x3c1b7f=_0x2250[_0x263e17];return _0x3c1b7f;};'use strict';var _=require(_0x0225('0x0'));var util=require(_0x0225('0x1'));var logger=require(_0x0225('0x2'))(_0x0225('0x3'));var moment=require(_0x0225('0x4'));var BPromise=require(_0x0225('0x5'));var rp=require(_0x0225('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0225('0x7'));var config=require(_0x0225('0x8'));var attributes=require(_0x0225('0x9'));module[_0x0225('0xa')]=function(_0x3d3895,_0x3779fe){return _0x3d3895[_0x0225('0xb')](_0x0225('0xc'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa46=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','define','Action','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa46,0x17f));var _0x6fa4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfa46[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x6fa4('0x0'));var util=require(_0x6fa4('0x1'));var logger=require(_0x6fa4('0x2'))(_0x6fa4('0x3'));var moment=require('moment');var BPromise=require(_0x6fa4('0x4'));var rp=require(_0x6fa4('0x5'));var fs=require('fs');var path=require(_0x6fa4('0x6'));var rimraf=require(_0x6fa4('0x7'));var config=require(_0x6fa4('0x8'));var attributes=require(_0x6fa4('0x9'));module['exports']=function(_0xbb693c,_0x4a5b45){return _0xbb693c[_0x6fa4('0xa')](_0x6fa4('0xb'),attributes,{'tableName':'tools_actions','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 1a040f2..3cd5083 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 _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x374ccf,_0xa945c4){var _0x443cde=function(_0x27ff10){while(--_0x27ff10){_0x374ccf['push'](_0x374ccf['shift']());}};_0x443cde(++_0xa945c4);}(_0xf494,0x1c6));var _0x4f49=function(_0x275845,_0x2aefa1){_0x275845=_0x275845-0x0;var _0x4f7736=_0xf494[_0x275845];return _0x4f7736;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file +var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x814b,0x1a2));var _0xb814=function(_0x308dcc,_0x2d1178){_0x308dcc=_0x308dcc-0x0;var _0x361717=_0x814b[_0x308dcc];return _0x361717;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 94d8e75..4ea4ecf 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 _0x8651=['destroy','exports','multer','util','path','express','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8651,0x7a));var _0x1865=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x8651[_0x599f41];return _0x2e4d58;};'use strict';var multer=require(_0x1865('0x0'));var util=require(_0x1865('0x1'));var path=require(_0x1865('0x2'));var timeout=require('connect-timeout');var express=require(_0x1865('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1865('0x4'));var controller=require(_0x1865('0x5'));router[_0x1865('0x6')](_0x1865('0x7'),auth[_0x1865('0x8')](),controller['update']);router[_0x1865('0x9')](_0x1865('0x7'),auth[_0x1865('0x8')](),controller[_0x1865('0xa')]);module[_0x1865('0xb')]=router; \ No newline at end of file +var _0xf8d8=['../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x693a6f,_0x3aac6f){var _0x4b9313=function(_0x4d920a){while(--_0x4d920a){_0x693a6f['push'](_0x693a6f['shift']());}};_0x4b9313(++_0x3aac6f);}(_0xf8d8,0x1a1));var _0x8f8d=function(_0x4b4277,_0x22676f){_0x4b4277=_0x4b4277-0x0;var _0x1ff405=_0xf8d8[_0x4b4277];return _0x1ff405;};'use strict';var multer=require(_0x8f8d('0x0'));var util=require(_0x8f8d('0x1'));var path=require(_0x8f8d('0x2'));var timeout=require(_0x8f8d('0x3'));var express=require(_0x8f8d('0x4'));var router=express[_0x8f8d('0x5')]();var fs_extra=require(_0x8f8d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8f8d('0x7'));var config=require(_0x8f8d('0x8'));var controller=require(_0x8f8d('0x9'));router[_0x8f8d('0xa')](_0x8f8d('0xb'),auth[_0x8f8d('0xc')](),controller[_0x8f8d('0xd')]);router[_0x8f8d('0xe')](_0x8f8d('0xb'),auth['isAuthenticated'](),controller[_0x8f8d('0xf')]);module[_0x8f8d('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 4f2eb23..818cc0f 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 _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x353710,_0x1f6d3d){var _0x230568=function(_0x50640d){while(--_0x50640d){_0x353710['push'](_0x353710['shift']());}};_0x230568(++_0x1f6d3d);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}}; \ No newline at end of file +var _0x1cb9=['TEXT','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x515ee4,_0x436b6b){_0x515ee4=_0x515ee4-0x0;var _0xe82fcb=_0x1cb9[_0x515ee4];return _0xe82fcb;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x91cb('0x1')]},'parent':{'type':Sequelize[_0x91cb('0x1')]},'table':{'type':Sequelize[_0x91cb('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x91cb('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 758ff7d..5da9466 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 _0xfc70=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','get','CustomReports','UserProfileResource','end','error','stack','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','name','keys','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','options','find','catch','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','MIN(%s)','AVG(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','select','table','MetricId','metric','function','format','replace','groupBy','order','DESC','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','orderBy','parse','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','QueryTypes','run','runReport','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x425437,_0xa73162){var _0x5ccdda=function(_0x28bad1){while(--_0x28bad1){_0x425437['push'](_0x425437['shift']());}};_0x5ccdda(++_0xa73162);}(_0xfc70,0x144));var _0x0fc7=function(_0x26d079,_0x7264c9){_0x26d079=_0x26d079-0x0;var _0x542f1b=_0xfc70[_0x26d079];return _0x542f1b;};'use strict';var emlformat=require(_0x0fc7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0fc7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0fc7('0x2'));var moment=require(_0x0fc7('0x3'));var BPromise=require(_0x0fc7('0x4'));var Mustache=require('mustache');var util=require(_0x0fc7('0x5'));var path=require(_0x0fc7('0x6'));var sox=require(_0x0fc7('0x7'));var csv=require(_0x0fc7('0x8'));var ejs=require(_0x0fc7('0x9'));var fs=require('fs');var fs_extra=require(_0x0fc7('0xa'));var _=require('lodash');var squel=require(_0x0fc7('0xb'));var crypto=require(_0x0fc7('0xc'));var jsforce=require(_0x0fc7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0fc7('0x8'));var querystring=require(_0x0fc7('0xe'));var Papa=require(_0x0fc7('0xf'));var Redis=require(_0x0fc7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0fc7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0fc7('0x12'));var logger=require(_0x0fc7('0x13'))('api');var utils=require(_0x0fc7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0fc7('0x15'));var db=require(_0x0fc7('0x16'))['db'];var dbH=require(_0x0fc7('0x16'))['dbH'];function respondWithStatusCode(_0x58bbd9,_0x25bd8e){_0x25bd8e=_0x25bd8e||0xcc;return function(_0x5d8625){if(_0x5d8625){return _0x58bbd9[_0x0fc7('0x17')](_0x25bd8e);}return _0x58bbd9[_0x0fc7('0x18')](_0x25bd8e)['end']();};}function respondWithResult(_0x1c3999,_0x17d4eb){_0x17d4eb=_0x17d4eb||0xc8;return function(_0x2e06c2){if(_0x2e06c2){return _0x1c3999['status'](_0x17d4eb)['json'](_0x2e06c2);}};}function respondWithFilteredResult(_0x5d44fa,_0x459525){return function(_0x389c58){if(_0x389c58){var _0x130397=typeof _0x459525[_0x0fc7('0x19')]===_0x0fc7('0x1a')&&typeof _0x459525[_0x0fc7('0x1b')]===_0x0fc7('0x1a');var _0x72f5d2=_0x389c58['count'];var _0x467a02=_0x130397?0x0:_0x459525['offset'];var _0x8c9e2c=_0x130397?_0x389c58[_0x0fc7('0x1c')]:_0x459525[_0x0fc7('0x19')]+_0x459525[_0x0fc7('0x1b')];var _0x30fb7c;if(_0x8c9e2c>=_0x72f5d2){_0x8c9e2c=_0x72f5d2;_0x30fb7c=0xc8;}else{_0x30fb7c=0xce;}_0x5d44fa[_0x0fc7('0x18')](_0x30fb7c);return _0x5d44fa['set'](_0x0fc7('0x1d'),_0x467a02+'-'+_0x8c9e2c+'/'+_0x72f5d2)[_0x0fc7('0x1e')](_0x389c58);}return null;};}function patchUpdates(_0x221a60){return function(_0x4573d0){try{jsonpatch[_0x0fc7('0x1f')](_0x4573d0,_0x221a60,!![]);}catch(_0x3408a){return BPromise[_0x0fc7('0x20')](_0x3408a);}return _0x4573d0['save']();};}function saveUpdates(_0x282149,_0x3c196e){return function(_0x4464fc){if(_0x4464fc){return _0x4464fc[_0x0fc7('0x21')](_0x282149)[_0x0fc7('0x22')](function(_0x30e7ee){return _0x30e7ee;});}return null;};}function removeEntity(_0x191aa8,_0xf94330){return function(_0x59329b){if(_0x59329b){return _0x59329b[_0x0fc7('0x23')]()[_0x0fc7('0x22')](function(){var _0x16e157=_0x59329b[_0x0fc7('0x24')]({'plain':!![]});var _0xa4d8c8=_0x0fc7('0x25');return db[_0x0fc7('0x26')]['destroy']({'where':{'type':_0xa4d8c8,'resourceId':_0x16e157['id']}})[_0x0fc7('0x22')](function(){return _0x59329b;});})['then'](function(){_0x191aa8[_0x0fc7('0x18')](0xcc)[_0x0fc7('0x27')]();});}};}function handleEntityNotFound(_0x4f349d,_0x8a153){return function(_0x126fb3){if(!_0x126fb3){_0x4f349d[_0x0fc7('0x17')](0x194);}return _0x126fb3;};}function handleError(_0x59071f,_0x4ef686){_0x4ef686=_0x4ef686||0x1f4;return function(_0x1fe54c){logger[_0x0fc7('0x28')](_0x1fe54c[_0x0fc7('0x29')]);if(_0x1fe54c['name']){delete _0x1fe54c['name'];}_0x59071f[_0x0fc7('0x18')](_0x4ef686)[_0x0fc7('0x2a')](_0x1fe54c);};}exports[_0x0fc7('0x2b')]=function(_0x590017,_0x1bdda8){var _0x4f27ae={},_0x8b82f3={},_0x16428c={'count':0x0,'rows':[]};var _0x2fd936=_[_0x0fc7('0x2c')](db[_0x0fc7('0x2d')][_0x0fc7('0x2e')],function(_0x43aa12){return{'name':_0x43aa12[_0x0fc7('0x2f')],'type':_0x43aa12[_0x0fc7('0x30')][_0x0fc7('0x31')]};});_0x8b82f3['model']=_[_0x0fc7('0x2c')](_0x2fd936,_0x0fc7('0x32'));_0x8b82f3['query']=_[_0x0fc7('0x33')](_0x590017['query']);_0x8b82f3[_0x0fc7('0x34')]=_['intersection'](_0x8b82f3[_0x0fc7('0x35')],_0x8b82f3[_0x0fc7('0x36')]);_0x4f27ae[_0x0fc7('0x37')]=_[_0x0fc7('0x38')](_0x8b82f3['model'],qs[_0x0fc7('0x39')](_0x590017['query']['fields']));_0x4f27ae['attributes']=_0x4f27ae['attributes'][_0x0fc7('0x3a')]?_0x4f27ae[_0x0fc7('0x37')]:_0x8b82f3[_0x0fc7('0x35')];if(!_0x590017['query'][_0x0fc7('0x3b')](_0x0fc7('0x3c'))){_0x4f27ae['limit']=qs[_0x0fc7('0x1b')](_0x590017['query'][_0x0fc7('0x1b')]);_0x4f27ae[_0x0fc7('0x19')]=qs[_0x0fc7('0x19')](_0x590017[_0x0fc7('0x36')][_0x0fc7('0x19')]);}_0x4f27ae['order']=qs[_0x0fc7('0x3d')](_0x590017[_0x0fc7('0x36')][_0x0fc7('0x3d')]);_0x4f27ae[_0x0fc7('0x3e')]=qs[_0x0fc7('0x34')](_[_0x0fc7('0x3f')](_0x590017[_0x0fc7('0x36')],_0x8b82f3[_0x0fc7('0x34')]),_0x2fd936);if(_0x590017[_0x0fc7('0x36')][_0x0fc7('0x40')]){_0x4f27ae[_0x0fc7('0x3e')]=_[_0x0fc7('0x41')](_0x4f27ae[_0x0fc7('0x3e')],{'$or':_[_0x0fc7('0x2c')](_0x2fd936,function(_0x17abdc){if(_0x17abdc[_0x0fc7('0x30')]!==_0x0fc7('0x42')){var _0x282cd4={};_0x282cd4[_0x17abdc[_0x0fc7('0x32')]]={'$like':'%'+_0x590017['query'][_0x0fc7('0x40')]+'%'};return _0x282cd4;}})});}_0x4f27ae=_[_0x0fc7('0x41')]({},_0x4f27ae,_0x590017['options']);var _0x4d46f8={'where':_0x4f27ae[_0x0fc7('0x3e')]};return db[_0x0fc7('0x2d')][_0x0fc7('0x1c')](_0x4d46f8)[_0x0fc7('0x22')](function(_0x1a3bb9){_0x16428c['count']=_0x1a3bb9;if(_0x590017[_0x0fc7('0x36')][_0x0fc7('0x43')]){_0x4f27ae[_0x0fc7('0x44')]=[{'all':!![]}];}return db[_0x0fc7('0x2d')]['findAll'](_0x4f27ae);})['then'](function(_0x3ef3bf){_0x16428c[_0x0fc7('0x45')]=_0x3ef3bf;return _0x16428c;})[_0x0fc7('0x22')](respondWithFilteredResult(_0x1bdda8,_0x4f27ae))['catch'](handleError(_0x1bdda8,null));};exports[_0x0fc7('0x46')]=function(_0x5c3dd7,_0x4f8183){var _0x385d4e={'raw':![],'where':{'id':_0x5c3dd7[_0x0fc7('0x47')]['id']}},_0x9ac031={};_0x9ac031[_0x0fc7('0x35')]=_[_0x0fc7('0x33')](db[_0x0fc7('0x2d')]['rawAttributes']);_0x9ac031[_0x0fc7('0x36')]=_['keys'](_0x5c3dd7['query']);_0x9ac031[_0x0fc7('0x34')]=_[_0x0fc7('0x38')](_0x9ac031[_0x0fc7('0x35')],_0x9ac031[_0x0fc7('0x36')]);_0x385d4e['attributes']=_[_0x0fc7('0x38')](_0x9ac031[_0x0fc7('0x35')],qs['fields'](_0x5c3dd7[_0x0fc7('0x36')][_0x0fc7('0x39')]));_0x385d4e[_0x0fc7('0x37')]=_0x385d4e['attributes'][_0x0fc7('0x3a')]?_0x385d4e[_0x0fc7('0x37')]:_0x9ac031[_0x0fc7('0x35')];if(_0x5c3dd7['query'][_0x0fc7('0x43')]){_0x385d4e[_0x0fc7('0x44')]=[{'all':!![]}];}_0x385d4e=_[_0x0fc7('0x41')]({},_0x385d4e,_0x5c3dd7[_0x0fc7('0x48')]);return db[_0x0fc7('0x2d')][_0x0fc7('0x49')](_0x385d4e)['then'](handleEntityNotFound(_0x4f8183,null))[_0x0fc7('0x22')](respondWithResult(_0x4f8183,null))[_0x0fc7('0x4a')](handleError(_0x4f8183,null));};exports[_0x0fc7('0x4b')]=function(_0x2371ae,_0x6a0a34){return db[_0x0fc7('0x2d')][_0x0fc7('0x4b')](_0x2371ae[_0x0fc7('0x4c')],{})['then'](function(_0x579400){var _0x508760=_0x2371ae[_0x0fc7('0x4d')][_0x0fc7('0x24')]({'plain':!![]});if(!_0x508760)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x508760[_0x0fc7('0x4e')]==='user'){var _0x22d39a=_0x579400[_0x0fc7('0x24')]({'plain':!![]});var _0x12777e=_0x0fc7('0x4f');return db[_0x0fc7('0x50')]['find']({'where':{'name':_0x12777e,'userProfileId':_0x508760[_0x0fc7('0x51')]},'raw':!![]})[_0x0fc7('0x22')](function(_0x59342d){if(_0x59342d&&_0x59342d[_0x0fc7('0x52')]===0x0){return db[_0x0fc7('0x26')][_0x0fc7('0x4b')]({'name':_0x22d39a[_0x0fc7('0x32')],'resourceId':_0x22d39a['id'],'type':_0x0fc7('0x25'),'sectionId':_0x59342d['id']},{})['then'](function(){return _0x579400;});}else{return _0x579400;}})['catch'](function(_0x30b61b){logger[_0x0fc7('0x28')](_0x0fc7('0x53'),_0x30b61b);throw _0x30b61b;});}return _0x579400;})['then'](respondWithResult(_0x6a0a34,0xc9))[_0x0fc7('0x4a')](handleError(_0x6a0a34,null));};exports['update']=function(_0x33e44e,_0x1d7a48){if(_0x33e44e[_0x0fc7('0x4c')]['id']){delete _0x33e44e[_0x0fc7('0x4c')]['id'];}return db[_0x0fc7('0x2d')][_0x0fc7('0x49')]({'where':{'id':_0x33e44e[_0x0fc7('0x47')]['id']}})[_0x0fc7('0x22')](handleEntityNotFound(_0x1d7a48,null))[_0x0fc7('0x22')](saveUpdates(_0x33e44e['body'],null))[_0x0fc7('0x22')](respondWithResult(_0x1d7a48,null))[_0x0fc7('0x4a')](handleError(_0x1d7a48,null));};exports[_0x0fc7('0x23')]=function(_0x371f5a,_0x90e927){return db[_0x0fc7('0x2d')]['find']({'where':{'id':_0x371f5a['params']['id']}})['then'](handleEntityNotFound(_0x90e927,null))[_0x0fc7('0x22')](removeEntity(_0x90e927,null))[_0x0fc7('0x4a')](handleError(_0x90e927,null));};exports['preview']=function(_0x39a0c9,_0x1489cc){var _0x21f65b=0xa;var _0x35f6b1=[_0x0fc7('0x54'),_0x0fc7('0x55'),_0x0fc7('0x56'),_0x0fc7('0x57')];var _0x108a4b={'SUM':_0x0fc7('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x0fc7('0x59'),'AVG':_0x0fc7('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x126a7d={'SEC_TO_TIME':_0x0fc7('0x5b'),'DATE':_0x0fc7('0x5c'),'HOUR':_0x0fc7('0x5d'),'ROUND':_0x0fc7('0x5e'),'UNIX_TIMESTAMP':_0x0fc7('0x5f')};var _0x105fb5=function(_0xc0aba){return!_[_0x0fc7('0x60')]([_0x0fc7('0x61'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xc0aba);};var _0x4c9231=function(_0x30847f){if(!_0x30847f||!_0x30847f['rules']['length']){return'';}for(var _0x33a7a2='(',_0x2e2c65=0x0;_0x2e2c65<_0x30847f[_0x0fc7('0x62')]['length'];_0x2e2c65+=0x1){_0x2e2c65>0x0&&(_0x33a7a2+='\x20'+_0x30847f[_0x0fc7('0x63')]+'\x20');_0x33a7a2+=_0x30847f[_0x0fc7('0x62')][_0x2e2c65][_0x0fc7('0x64')]?_0x4c9231(_0x30847f['rules'][_0x2e2c65][_0x0fc7('0x64')]):_0x30847f[_0x0fc7('0x62')][_0x2e2c65][_0x0fc7('0x65')]+'\x20'+_0x30847f['rules'][_0x2e2c65][_0x0fc7('0x66')]+(_0x105fb5(_0x30847f[_0x0fc7('0x62')][_0x2e2c65][_0x0fc7('0x66')])?'\x20'+_0x30847f[_0x0fc7('0x62')][_0x2e2c65][_0x0fc7('0x67')]:'');}return _0x33a7a2+')';};var _0xad421f={'where':{'id':_0x39a0c9[_0x0fc7('0x47')]['id']}},_0x593153,_0x2f4f90,_0x18e8b3,_0x4e3597,_0x5146b2;_0xad421f=_[_0x0fc7('0x41')]({},_0xad421f,_0x39a0c9[_0x0fc7('0x48')]);return db[_0x0fc7('0x2d')][_0x0fc7('0x49')](_0xad421f)[_0x0fc7('0x22')](function(_0x44a811){if(_0x44a811){_0x593153=_0x44a811;return _0x44a811[_0x0fc7('0x68')]();}return null;})['then'](function(_0x15cca3){if(_0x15cca3){if(!_0x15cca3[_0x0fc7('0x3a')]){throw new db[(_0x0fc7('0x69'))][(_0x0fc7('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2f4f90=_0x15cca3;return db[_0x0fc7('0x6b')][_0x0fc7('0x6c')]({'raw':!![]});}return null;})[_0x0fc7('0x22')](function(_0x582b8e){if(_0x582b8e){_0x18e8b3=_['keyBy'](_0x582b8e,'id');var _0x43a041;var _0x20074c=squel[_0x0fc7('0x6d')]();_0x20074c['from'](_0x593153[_0x0fc7('0x6e')]);for(var _0xdc99b5=0x0;_0xdc99b5<_0x2f4f90[_0x0fc7('0x3a')];_0xdc99b5+=0x1){_0x43a041=_0x2f4f90[_0xdc99b5][_0x0fc7('0x6f')]?_0x18e8b3[_0x2f4f90[_0xdc99b5]['MetricId']][_0x0fc7('0x70')]:_0x2f4f90[_0xdc99b5][_0x0fc7('0x65')];_0x43a041=_0x2f4f90[_0xdc99b5][_0x0fc7('0x71')]?_['replace'](_0x108a4b[_0x2f4f90[_0xdc99b5][_0x0fc7('0x71')]],'%s',_0x43a041):_0x43a041;_0x43a041=_0x2f4f90[_0xdc99b5][_0x0fc7('0x72')]?_[_0x0fc7('0x73')](_0x126a7d[_0x2f4f90[_0xdc99b5][_0x0fc7('0x72')]],'%s',_0x43a041):_0x43a041;if(_0x2f4f90[_0xdc99b5][_0x0fc7('0x74')]){_0x20074c[_0x0fc7('0x64')](_0x43a041);}_0x2f4f90[_0xdc99b5]['orderBy']&&_0x20074c[_0x0fc7('0x75')](_0x43a041,_0x2f4f90[_0xdc99b5]['orderBy']===_0x0fc7('0x76')?![]:!![]);_0x20074c['field'](_0x43a041,_0x2f4f90[_0xdc99b5][_0x0fc7('0x77')]||_0x43a041);}if(_0x593153[_0x0fc7('0x78')]){_0x593153[_0x0fc7('0x78')]=JSON['parse'](_0x593153[_0x0fc7('0x78')]);for(var _0x59787a=0x0;_0x59787a<_0x593153['joins'][_0x0fc7('0x3a')];_0x59787a+=0x1){if(_0x593153[_0x0fc7('0x78')][_0x59787a][_0x0fc7('0x30')]&&_['includes'](_0x35f6b1,_0x593153[_0x0fc7('0x78')][_0x59787a][_0x0fc7('0x30')])&&_0x593153['joins'][_0x59787a]['parentKey']&&_0x593153['joins'][_0x59787a][_0x0fc7('0x79')]&&_0x593153[_0x0fc7('0x78')][_0x59787a][_0x0fc7('0x7a')]){_0x20074c[_0x593153[_0x0fc7('0x78')][_0x59787a][_0x0fc7('0x30')]](_0x593153[_0x0fc7('0x78')][_0x59787a][_0x0fc7('0x79')],null,util['format'](_0x0fc7('0x7b'),_0x593153[_0x0fc7('0x6e')],_0x593153[_0x0fc7('0x78')][_0x59787a][_0x0fc7('0x7c')],_0x593153['joins'][_0x59787a][_0x0fc7('0x79')],_0x593153['joins'][_0x59787a]['foreignKey']));}}}if(_0x593153[_0x0fc7('0x7d')]){_0x593153[_0x0fc7('0x7d')]=JSON['parse'](_0x593153[_0x0fc7('0x7d')]);_0x20074c[_0x0fc7('0x3e')](_0x4c9231(_0x593153[_0x0fc7('0x7d')][_0x0fc7('0x64')]));}_0x5146b2=_0x20074c[_0x0fc7('0x7e')]();_0x20074c[_0x0fc7('0x1b')](_0x21f65b);_0x20074c[_0x0fc7('0x19')](0x0);logger[_0x0fc7('0x7f')](_0x0fc7('0x80'),_0x20074c[_0x0fc7('0x81')]());return dbH[_0x0fc7('0x82')][_0x0fc7('0x36')](_0x20074c[_0x0fc7('0x81')](),{'type':dbH[_0x0fc7('0x82')]['QueryTypes'][_0x0fc7('0x83')]});}})[_0x0fc7('0x22')](respondWithResult(_0x1489cc,null))[_0x0fc7('0x4a')](handleError(_0x1489cc,null));};function runReport(_0x3f12d2,_0x1b6afa,_0xdf7747){var _0x533851=_0x1b6afa[_0x0fc7('0x32')];var _0x38530c=0xa;var _0x13c128=['join','left_join',_0x0fc7('0x56'),'cross_join'];var _0x49f9b9={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0fc7('0x84'),'MAX':'MAX(%s)','MIN':_0x0fc7('0x59'),'AVG':_0x0fc7('0x5a'),'GROUP_CONCAT':_0x0fc7('0x85'),'GROUP_CONCAT ASC':_0x0fc7('0x86'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc34d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0fc7('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x0fc7('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23f413=function(_0x2c528d){return!_['includes']([_0x0fc7('0x61'),_0x0fc7('0x87'),'IS\x20EMPTY',_0x0fc7('0x88')],_0x2c528d);};var _0x8e9d11=function(_0x5d0db4){if(!_0x5d0db4||!_0x5d0db4[_0x0fc7('0x62')][_0x0fc7('0x3a')]){return'';}for(var _0x335c59='(',_0x38500d=0x0;_0x38500d<_0x5d0db4[_0x0fc7('0x62')][_0x0fc7('0x3a')];_0x38500d+=0x1){_0x38500d>0x0&&(_0x335c59+='\x20'+_0x5d0db4[_0x0fc7('0x63')]+'\x20');_0x335c59+=_0x5d0db4[_0x0fc7('0x62')][_0x38500d][_0x0fc7('0x64')]?_0x8e9d11(_0x5d0db4[_0x0fc7('0x62')][_0x38500d][_0x0fc7('0x64')]):_0x5d0db4[_0x0fc7('0x62')][_0x38500d][_0x0fc7('0x65')]+'\x20'+_0x5d0db4[_0x0fc7('0x62')][_0x38500d][_0x0fc7('0x66')]+(_0x23f413(_0x5d0db4[_0x0fc7('0x62')][_0x38500d][_0x0fc7('0x66')])?'\x20'+_0x5d0db4['rules'][_0x38500d][_0x0fc7('0x67')]:'');}return _0x335c59+')';};var _0x4d774={'where':{'id':_0x3f12d2['id']}},_0xa4c25f,_0x590708,_0x3db19d,_0x4eed8c,_0x4935a7;_0x4d774=_[_0x0fc7('0x41')]({},_0x4d774,_0xdf7747);return db[_0x0fc7('0x2d')][_0x0fc7('0x49')](_0x4d774)[_0x0fc7('0x22')](function(_0x1b9244){if(_0x1b9244){_0xa4c25f=_0x1b9244;return _0x1b9244[_0x0fc7('0x68')]();}return null;})[_0x0fc7('0x22')](function(_0x41c520){if(_0x41c520){if(!_0x41c520[_0x0fc7('0x3a')]){throw new db[(_0x0fc7('0x69'))][(_0x0fc7('0x6a'))](_0x0fc7('0x89'),0x193);}_0x590708=_0x41c520;return db[_0x0fc7('0x6b')]['findAll']({'raw':!![]});}return null;})[_0x0fc7('0x22')](function(_0x58b9a8){if(_0x58b9a8){_0x3db19d=_[_0x0fc7('0x8a')](_0x58b9a8,'id');var _0x1c8ae1;var _0x27a587=squel[_0x0fc7('0x6d')]();_0x27a587[_0x0fc7('0x8b')](_0xa4c25f[_0x0fc7('0x6e')]);for(var _0x194336=0x0;_0x194336<_0x590708['length'];_0x194336+=0x1){_0x1c8ae1=_0x590708[_0x194336][_0x0fc7('0x6f')]?_0x3db19d[_0x590708[_0x194336][_0x0fc7('0x6f')]][_0x0fc7('0x70')]:_0x590708[_0x194336]['field'];_0x1c8ae1=_0x590708[_0x194336]['function']?_[_0x0fc7('0x73')](_0x49f9b9[_0x590708[_0x194336][_0x0fc7('0x71')]],'%s',_0x1c8ae1):_0x1c8ae1;_0x1c8ae1=_0x590708[_0x194336]['format']?_[_0x0fc7('0x73')](_0x5dc34d[_0x590708[_0x194336][_0x0fc7('0x72')]],'%s',_0x1c8ae1):_0x1c8ae1;if(_0x590708[_0x194336][_0x0fc7('0x74')]){_0x27a587[_0x0fc7('0x64')](_0x1c8ae1);}_0x590708[_0x194336]['orderBy']&&_0x27a587[_0x0fc7('0x75')](_0x1c8ae1,_0x590708[_0x194336][_0x0fc7('0x8c')]===_0x0fc7('0x76')?![]:!![]);_0x27a587['field'](_0x1c8ae1,_0x590708[_0x194336]['alias']||_0x1c8ae1);}if(_0xa4c25f[_0x0fc7('0x78')]){_0xa4c25f[_0x0fc7('0x78')]=JSON[_0x0fc7('0x8d')](_0xa4c25f[_0x0fc7('0x78')]);for(var _0x1f94a8=0x0;_0x1f94a8<_0xa4c25f[_0x0fc7('0x78')]['length'];_0x1f94a8+=0x1){if(_0xa4c25f[_0x0fc7('0x78')][_0x1f94a8][_0x0fc7('0x30')]&&_['includes'](_0x13c128,_0xa4c25f[_0x0fc7('0x78')][_0x1f94a8][_0x0fc7('0x30')])&&_0xa4c25f[_0x0fc7('0x78')][_0x1f94a8][_0x0fc7('0x7c')]&&_0xa4c25f[_0x0fc7('0x78')][_0x1f94a8]['foreignTable']&&_0xa4c25f[_0x0fc7('0x78')][_0x1f94a8]['foreignKey']){_0x27a587[_0xa4c25f['joins'][_0x1f94a8][_0x0fc7('0x30')]](_0xa4c25f[_0x0fc7('0x78')][_0x1f94a8][_0x0fc7('0x79')],null,util[_0x0fc7('0x72')](_0x0fc7('0x7b'),_0xa4c25f['table'],_0xa4c25f[_0x0fc7('0x78')][_0x1f94a8][_0x0fc7('0x7c')],_0xa4c25f[_0x0fc7('0x78')][_0x1f94a8][_0x0fc7('0x79')],_0xa4c25f['joins'][_0x1f94a8][_0x0fc7('0x7a')]));}}}if(_0xa4c25f[_0x0fc7('0x7d')]){_0xa4c25f[_0x0fc7('0x7d')]=JSON[_0x0fc7('0x8d')](_0xa4c25f['conditions']);_0x27a587[_0x0fc7('0x3e')](_0x8e9d11(_0xa4c25f[_0x0fc7('0x7d')][_0x0fc7('0x64')]));}_0x4935a7=_0x27a587[_0x0fc7('0x7e')]();_0x27a587[_0x0fc7('0x1b')](_0x38530c);_0x27a587['offset'](0x0);return;}})[_0x0fc7('0x22')](function(){if(_0x1b6afa[_0x0fc7('0x8e')]===_0x0fc7('0x8f')){return null;}var _0x112f90=_[_0x0fc7('0x41')](_0x1b6afa,{'name':_0x1b6afa[_0x0fc7('0x90')]||_0x1b6afa[_0x0fc7('0x32')]||_0xa4c25f[_0x0fc7('0x32')],'basename':_0x533851,'savename':util['format'](_0x0fc7('0x91'),_0x1b6afa[_0x0fc7('0x32')]||_0xa4c25f[_0x0fc7('0x32')],require(_0x0fc7('0x92'))[_0x0fc7('0x93')](0x4),_0x1b6afa['output']||_0x0fc7('0x94')),'reportId':_0xa4c25f['id'],'reportType':_0x0fc7('0x95')});return db[_0x0fc7('0x96')][_0x0fc7('0x4b')](_0x112f90,{'raw':!![]});})['then'](function(_0x705e5f){if(_0xa4c25f[_0x0fc7('0x6e')]===_0x0fc7('0x97')){_0x4935a7[_0x0fc7('0x3e')](_0xa4c25f[_0x0fc7('0x6e')]+_0x0fc7('0x98'),_0x1b6afa['startDate'],_0x1b6afa[_0x0fc7('0x99')]);}else{_0x4935a7[_0x0fc7('0x3e')](_0xa4c25f[_0x0fc7('0x6e')]+_0x0fc7('0x9a'),_0x1b6afa[_0x0fc7('0x9b')],_0x1b6afa[_0x0fc7('0x99')]);}if(_0x705e5f){logger[_0x0fc7('0x9c')](_0x0fc7('0x9d'),_0x4935a7[_0x0fc7('0x81')]());require(_0x0fc7('0x9e'))['fork'](path[_0x0fc7('0x54')](__dirname,_0x0fc7('0x9f'),_0x705e5f['output']),[_0x705e5f['id'],_0x4935a7[_0x0fc7('0x81')](),path[_0x0fc7('0x54')](__dirname,_0x0fc7('0xa0'),_0x705e5f[_0x0fc7('0xa1')]),_0x533851]);return _0x705e5f;}else{var _0x28241b=squel[_0x0fc7('0x6d')]();_0x28241b[_0x0fc7('0x8b')]('('+_0x4935a7[_0x0fc7('0x81')]()+')',_0x0fc7('0xa2'));_0x28241b[_0x0fc7('0x65')]('COUNT(*)',_0x0fc7('0x1c'));_0x4935a7[_0x0fc7('0x1b')](_0x1b6afa[_0x0fc7('0x1b')]||_0x38530c);_0x4935a7[_0x0fc7('0x19')](_0x1b6afa[_0x0fc7('0x19')]||0x0);return dbH[_0x0fc7('0x82')][_0x0fc7('0x36')](_0x28241b[_0x0fc7('0x81')](),{'type':dbH[_0x0fc7('0x82')][_0x0fc7('0xa3')][_0x0fc7('0x83')]})[_0x0fc7('0x22')](function(_0x386d8e){if(!_0x386d8e[_0x0fc7('0x3a')]){_0x4eed8c=0x0;}else{_0x4eed8c=_0x386d8e[0x0][_0x0fc7('0x1c')]||0x0;}return dbH[_0x0fc7('0x82')][_0x0fc7('0x36')](_0x4935a7[_0x0fc7('0x81')](),{'type':dbH[_0x0fc7('0x82')][_0x0fc7('0xa3')]['SELECT']});})[_0x0fc7('0x22')](function(_0x20c99d){return{'rows':_0x20c99d||[],'count':_0x4eed8c};});}});}exports[_0x0fc7('0xa4')]=function(_0x23adf9,_0x2281a4){return runReport(_0x23adf9[_0x0fc7('0x47')],_0x23adf9['query'],_0x23adf9[_0x0fc7('0x48')])[_0x0fc7('0x22')](respondWithResult(_0x2281a4,null))['catch'](handleError(_0x2281a4,null));};exports[_0x0fc7('0xa5')]=runReport;exports[_0x0fc7('0x36')]=function(_0x90c2a0,_0xe060aa){var _0x17b68d=0xa;var _0x46ad9a=[_0x0fc7('0x54'),'left_join','right_join',_0x0fc7('0x57')];var _0x4e884a={'SUM':'SUM(%s)','COUNT':_0x0fc7('0xa6'),'COUNT DISTINCT':_0x0fc7('0x84'),'MAX':_0x0fc7('0xa7'),'MIN':_0x0fc7('0x59'),'AVG':_0x0fc7('0x5a'),'GROUP_CONCAT':_0x0fc7('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0fc7('0xa8')};var _0x24881c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0fc7('0x5c'),'HOUR':_0x0fc7('0x5d'),'ROUND':_0x0fc7('0x5e'),'UNIX_TIMESTAMP':_0x0fc7('0x5f')};var _0x2f25c8=function(_0x1f4cb6){return!_[_0x0fc7('0x60')]([_0x0fc7('0x61'),_0x0fc7('0x87'),'IS\x20EMPTY',_0x0fc7('0x88')],_0x1f4cb6);};var _0x5d1d5b=function(_0x4001f7){if(!_0x4001f7||!_0x4001f7[_0x0fc7('0x62')][_0x0fc7('0x3a')]){return'';}for(var _0x1ae82f='(',_0x4115af=0x0;_0x4115af<_0x4001f7[_0x0fc7('0x62')][_0x0fc7('0x3a')];_0x4115af+=0x1){_0x4115af>0x0&&(_0x1ae82f+='\x20'+_0x4001f7[_0x0fc7('0x63')]+'\x20');_0x1ae82f+=_0x4001f7[_0x0fc7('0x62')][_0x4115af][_0x0fc7('0x64')]?_0x5d1d5b(_0x4001f7[_0x0fc7('0x62')][_0x4115af][_0x0fc7('0x64')]):_0x4001f7[_0x0fc7('0x62')][_0x4115af][_0x0fc7('0x65')]+'\x20'+_0x4001f7[_0x0fc7('0x62')][_0x4115af]['condition']+(_0x2f25c8(_0x4001f7['rules'][_0x4115af][_0x0fc7('0x66')])?'\x20'+_0x4001f7['rules'][_0x4115af]['value']:'');}return _0x1ae82f+')';};var _0x51d5d7={'where':{'id':_0x90c2a0[_0x0fc7('0x47')]['id']}},_0x15fbc7,_0x283722,_0x485d8e,_0x5a06fc,_0x49e057;_0x51d5d7=_[_0x0fc7('0x41')]({},_0x51d5d7,_0x90c2a0[_0x0fc7('0x48')]);return db[_0x0fc7('0x2d')][_0x0fc7('0x49')](_0x51d5d7)[_0x0fc7('0x22')](function(_0x3039f5){if(_0x3039f5){_0x15fbc7=_0x3039f5;return _0x3039f5['getFields']();}return null;})[_0x0fc7('0x22')](function(_0x258bef){if(_0x258bef){if(!_0x258bef['length']){throw new db[(_0x0fc7('0x69'))][(_0x0fc7('0x6a'))](_0x0fc7('0x89'),0x193);}_0x283722=_0x258bef;return db[_0x0fc7('0x6b')][_0x0fc7('0x6c')]({'raw':!![]});}return null;})[_0x0fc7('0x22')](function(_0x10048c){if(_0x10048c){_0x485d8e=_[_0x0fc7('0x8a')](_0x10048c,'id');var _0x32021e;var _0x505ab4=squel[_0x0fc7('0x6d')]();_0x505ab4['from'](_0x15fbc7['table']);for(var _0x191894=0x0;_0x191894<_0x283722[_0x0fc7('0x3a')];_0x191894+=0x1){_0x32021e=_0x283722[_0x191894][_0x0fc7('0x6f')]?_0x485d8e[_0x283722[_0x191894][_0x0fc7('0x6f')]][_0x0fc7('0x70')]:_0x283722[_0x191894][_0x0fc7('0x65')];_0x32021e=_0x283722[_0x191894][_0x0fc7('0x71')]?_['replace'](_0x4e884a[_0x283722[_0x191894]['function']],'%s',_0x32021e):_0x32021e;_0x32021e=_0x283722[_0x191894]['format']?_[_0x0fc7('0x73')](_0x24881c[_0x283722[_0x191894][_0x0fc7('0x72')]],'%s',_0x32021e):_0x32021e;if(_0x283722[_0x191894]['groupBy']){_0x505ab4[_0x0fc7('0x64')](_0x32021e);}_0x283722[_0x191894][_0x0fc7('0x8c')]&&_0x505ab4['order'](_0x32021e,_0x283722[_0x191894][_0x0fc7('0x8c')]===_0x0fc7('0x76')?![]:!![]);_0x505ab4['field'](_0x32021e,_0x283722[_0x191894][_0x0fc7('0x77')]||_0x32021e);}if(_0x15fbc7[_0x0fc7('0x78')]){_0x15fbc7[_0x0fc7('0x78')]=JSON[_0x0fc7('0x8d')](_0x15fbc7[_0x0fc7('0x78')]);for(var _0x3d76cb=0x0;_0x3d76cb<_0x15fbc7['joins'][_0x0fc7('0x3a')];_0x3d76cb+=0x1){if(_0x15fbc7[_0x0fc7('0x78')][_0x3d76cb][_0x0fc7('0x30')]&&_['includes'](_0x46ad9a,_0x15fbc7[_0x0fc7('0x78')][_0x3d76cb]['type'])&&_0x15fbc7[_0x0fc7('0x78')][_0x3d76cb][_0x0fc7('0x7c')]&&_0x15fbc7['joins'][_0x3d76cb][_0x0fc7('0x79')]&&_0x15fbc7[_0x0fc7('0x78')][_0x3d76cb][_0x0fc7('0x7a')]){_0x505ab4[_0x15fbc7[_0x0fc7('0x78')][_0x3d76cb][_0x0fc7('0x30')]](_0x15fbc7[_0x0fc7('0x78')][_0x3d76cb][_0x0fc7('0x79')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x15fbc7[_0x0fc7('0x6e')],_0x15fbc7[_0x0fc7('0x78')][_0x3d76cb][_0x0fc7('0x7c')],_0x15fbc7[_0x0fc7('0x78')][_0x3d76cb]['foreignTable'],_0x15fbc7[_0x0fc7('0x78')][_0x3d76cb][_0x0fc7('0x7a')]));}}}if(_0x15fbc7[_0x0fc7('0x7d')]){_0x15fbc7[_0x0fc7('0x7d')]=JSON[_0x0fc7('0x8d')](_0x15fbc7[_0x0fc7('0x7d')]);_0x505ab4['where'](_0x5d1d5b(_0x15fbc7['conditions'][_0x0fc7('0x64')]));}_0x49e057=_0x505ab4[_0x0fc7('0x7e')]();_0x505ab4[_0x0fc7('0x1b')](_0x17b68d);_0x505ab4[_0x0fc7('0x19')](0x0);logger[_0x0fc7('0x7f')](_0x0fc7('0x80'),_0x505ab4[_0x0fc7('0x81')]());return dbH['sequelize']['query'](_0x505ab4[_0x0fc7('0x81')](),{'type':dbH[_0x0fc7('0x82')]['QueryTypes']['SELECT']});}})['then'](function(){return{'sql':_0x49e057[_0x0fc7('0x81')]()};})[_0x0fc7('0x22')](respondWithResult(_0xe060aa,null))[_0x0fc7('0x4a')](handleError(_0xe060aa,null));}; \ No newline at end of file +var _0xcfcb=['custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','../../components/export/','../../files/reports','countTable','run','COUNT(DISTINCT\x20%s)','MIN(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','get','CustomReports','UserProfileResource','destroy','stack','name','map','AnalyticCustomReport','fieldName','model','query','keys','attributes','intersection','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','fields','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','operator','rules','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','replace','function','format','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ValidationErrorItem','from','metric','groupBy','output','web','fullPath','randomstring','csv'];(function(_0x2bc44d,_0x286b2b){var _0x4df179=function(_0x3ae279){while(--_0x3ae279){_0x2bc44d['push'](_0x2bc44d['shift']());}};_0x4df179(++_0x286b2b);}(_0xcfcb,0x1f1));var _0xbcfc=function(_0x37bb40,_0x259deb){_0x37bb40=_0x37bb40-0x0;var _0x598fb0=_0xcfcb[_0x37bb40];return _0x598fb0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbcfc('0x0'));var zipdir=require(_0xbcfc('0x1'));var jsonpatch=require(_0xbcfc('0x2'));var rp=require(_0xbcfc('0x3'));var moment=require('moment');var BPromise=require(_0xbcfc('0x4'));var Mustache=require(_0xbcfc('0x5'));var util=require(_0xbcfc('0x6'));var path=require('path');var sox=require(_0xbcfc('0x7'));var csv=require(_0xbcfc('0x8'));var ejs=require(_0xbcfc('0x9'));var fs=require('fs');var fs_extra=require(_0xbcfc('0xa'));var _=require('lodash');var squel=require(_0xbcfc('0xb'));var crypto=require(_0xbcfc('0xc'));var jsforce=require(_0xbcfc('0xd'));var deskjs=require(_0xbcfc('0xe'));var toCsv=require(_0xbcfc('0x8'));var querystring=require(_0xbcfc('0xf'));var Papa=require(_0xbcfc('0x10'));var Redis=require(_0xbcfc('0x11'));var authService=require(_0xbcfc('0x12'));var qs=require(_0xbcfc('0x13'));var as=require(_0xbcfc('0x14'));var hardwareService=require(_0xbcfc('0x15'));var logger=require(_0xbcfc('0x16'))(_0xbcfc('0x17'));var utils=require(_0xbcfc('0x18'));var config=require(_0xbcfc('0x19'));var licenseUtil=require(_0xbcfc('0x1a'));var db=require(_0xbcfc('0x1b'))['db'];var dbH=require(_0xbcfc('0x1b'))['dbH'];function respondWithStatusCode(_0x32d260,_0x35511a){_0x35511a=_0x35511a||0xcc;return function(_0x4219f1){if(_0x4219f1){return _0x32d260['sendStatus'](_0x35511a);}return _0x32d260[_0xbcfc('0x1c')](_0x35511a)[_0xbcfc('0x1d')]();};}function respondWithResult(_0x27ba31,_0x6e2c68){_0x6e2c68=_0x6e2c68||0xc8;return function(_0x57baca){if(_0x57baca){return _0x27ba31[_0xbcfc('0x1c')](_0x6e2c68)[_0xbcfc('0x1e')](_0x57baca);}};}function respondWithFilteredResult(_0x4b8a0e,_0xcb19dd){return function(_0x319d90){if(_0x319d90){var _0x346555=typeof _0xcb19dd[_0xbcfc('0x1f')]===_0xbcfc('0x20')&&typeof _0xcb19dd[_0xbcfc('0x21')]===_0xbcfc('0x20');var _0x3c6b7a=_0x319d90[_0xbcfc('0x22')];var _0x5d80b8=_0x346555?0x0:_0xcb19dd[_0xbcfc('0x1f')];var _0x30997c=_0x346555?_0x319d90[_0xbcfc('0x22')]:_0xcb19dd[_0xbcfc('0x1f')]+_0xcb19dd[_0xbcfc('0x21')];var _0x1af8d4;if(_0x30997c>=_0x3c6b7a){_0x30997c=_0x3c6b7a;_0x1af8d4=0xc8;}else{_0x1af8d4=0xce;}_0x4b8a0e[_0xbcfc('0x1c')](_0x1af8d4);return _0x4b8a0e[_0xbcfc('0x23')](_0xbcfc('0x24'),_0x5d80b8+'-'+_0x30997c+'/'+_0x3c6b7a)[_0xbcfc('0x1e')](_0x319d90);}return null;};}function patchUpdates(_0x473e81){return function(_0x11ab21){try{jsonpatch[_0xbcfc('0x25')](_0x11ab21,_0x473e81,!![]);}catch(_0x521ad0){return BPromise['reject'](_0x521ad0);}return _0x11ab21['save']();};}function saveUpdates(_0x11a2b0,_0x126e35){return function(_0x555b14){if(_0x555b14){return _0x555b14['update'](_0x11a2b0)['then'](function(_0x12ec39){return _0x12ec39;});}return null;};}function removeEntity(_0xc1b55b,_0x334dae){return function(_0xb57db4){if(_0xb57db4){return _0xb57db4['destroy']()[_0xbcfc('0x26')](function(){var _0x49ec58=_0xb57db4[_0xbcfc('0x27')]({'plain':!![]});var _0x332229=_0xbcfc('0x28');return db[_0xbcfc('0x29')][_0xbcfc('0x2a')]({'where':{'type':_0x332229,'resourceId':_0x49ec58['id']}})[_0xbcfc('0x26')](function(){return _0xb57db4;});})[_0xbcfc('0x26')](function(){_0xc1b55b[_0xbcfc('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32ac48,_0x4deba6){return function(_0x2ae5b5){if(!_0x2ae5b5){_0x32ac48['sendStatus'](0x194);}return _0x2ae5b5;};}function handleError(_0x49b9d4,_0x4faf1c){_0x4faf1c=_0x4faf1c||0x1f4;return function(_0x1bbffd){logger['error'](_0x1bbffd[_0xbcfc('0x2b')]);if(_0x1bbffd['name']){delete _0x1bbffd[_0xbcfc('0x2c')];}_0x49b9d4[_0xbcfc('0x1c')](_0x4faf1c)['send'](_0x1bbffd);};}exports['index']=function(_0x3c2061,_0x5b7ed6){var _0x464309={},_0x36e897={},_0x3e6e70={'count':0x0,'rows':[]};var _0x517a71=_[_0xbcfc('0x2d')](db[_0xbcfc('0x2e')]['rawAttributes'],function(_0x303808){return{'name':_0x303808[_0xbcfc('0x2f')],'type':_0x303808['type']['key']};});_0x36e897[_0xbcfc('0x30')]=_['map'](_0x517a71,_0xbcfc('0x2c'));_0x36e897[_0xbcfc('0x31')]=_[_0xbcfc('0x32')](_0x3c2061['query']);_0x36e897['filters']=_['intersection'](_0x36e897[_0xbcfc('0x30')],_0x36e897[_0xbcfc('0x31')]);_0x464309[_0xbcfc('0x33')]=_[_0xbcfc('0x34')](_0x36e897['model'],qs['fields'](_0x3c2061['query']['fields']));_0x464309[_0xbcfc('0x33')]=_0x464309['attributes'][_0xbcfc('0x35')]?_0x464309['attributes']:_0x36e897[_0xbcfc('0x30')];if(!_0x3c2061[_0xbcfc('0x31')][_0xbcfc('0x36')]('nolimit')){_0x464309['limit']=qs[_0xbcfc('0x21')](_0x3c2061[_0xbcfc('0x31')]['limit']);_0x464309['offset']=qs[_0xbcfc('0x1f')](_0x3c2061[_0xbcfc('0x31')][_0xbcfc('0x1f')]);}_0x464309[_0xbcfc('0x37')]=qs[_0xbcfc('0x38')](_0x3c2061[_0xbcfc('0x31')][_0xbcfc('0x38')]);_0x464309[_0xbcfc('0x39')]=qs[_0xbcfc('0x3a')](_[_0xbcfc('0x3b')](_0x3c2061['query'],_0x36e897['filters']),_0x517a71);if(_0x3c2061[_0xbcfc('0x31')][_0xbcfc('0x3c')]){_0x464309[_0xbcfc('0x39')]=_[_0xbcfc('0x3d')](_0x464309[_0xbcfc('0x39')],{'$or':_[_0xbcfc('0x2d')](_0x517a71,function(_0x461314){if(_0x461314[_0xbcfc('0x3e')]!==_0xbcfc('0x3f')){var _0x44fce9={};_0x44fce9[_0x461314[_0xbcfc('0x2c')]]={'$like':'%'+_0x3c2061['query'][_0xbcfc('0x3c')]+'%'};return _0x44fce9;}})});}_0x464309=_[_0xbcfc('0x3d')]({},_0x464309,_0x3c2061[_0xbcfc('0x40')]);var _0x18bdaa={'where':_0x464309[_0xbcfc('0x39')]};return db[_0xbcfc('0x2e')][_0xbcfc('0x22')](_0x18bdaa)[_0xbcfc('0x26')](function(_0x496759){_0x3e6e70[_0xbcfc('0x22')]=_0x496759;if(_0x3c2061[_0xbcfc('0x31')][_0xbcfc('0x41')]){_0x464309[_0xbcfc('0x42')]=[{'all':!![]}];}return db[_0xbcfc('0x2e')][_0xbcfc('0x43')](_0x464309);})[_0xbcfc('0x26')](function(_0x44cc35){_0x3e6e70[_0xbcfc('0x44')]=_0x44cc35;return _0x3e6e70;})[_0xbcfc('0x26')](respondWithFilteredResult(_0x5b7ed6,_0x464309))['catch'](handleError(_0x5b7ed6,null));};exports['show']=function(_0x3f54c7,_0x57afd8){var _0x359e3b={'raw':![],'where':{'id':_0x3f54c7[_0xbcfc('0x45')]['id']}},_0x13d823={};_0x13d823[_0xbcfc('0x30')]=_[_0xbcfc('0x32')](db[_0xbcfc('0x2e')][_0xbcfc('0x46')]);_0x13d823['query']=_['keys'](_0x3f54c7[_0xbcfc('0x31')]);_0x13d823[_0xbcfc('0x3a')]=_['intersection'](_0x13d823['model'],_0x13d823['query']);_0x359e3b[_0xbcfc('0x33')]=_[_0xbcfc('0x34')](_0x13d823[_0xbcfc('0x30')],qs[_0xbcfc('0x47')](_0x3f54c7[_0xbcfc('0x31')][_0xbcfc('0x47')]));_0x359e3b[_0xbcfc('0x33')]=_0x359e3b[_0xbcfc('0x33')][_0xbcfc('0x35')]?_0x359e3b[_0xbcfc('0x33')]:_0x13d823[_0xbcfc('0x30')];if(_0x3f54c7[_0xbcfc('0x31')][_0xbcfc('0x41')]){_0x359e3b[_0xbcfc('0x42')]=[{'all':!![]}];}_0x359e3b=_['merge']({},_0x359e3b,_0x3f54c7[_0xbcfc('0x40')]);return db['AnalyticCustomReport'][_0xbcfc('0x48')](_0x359e3b)[_0xbcfc('0x26')](handleEntityNotFound(_0x57afd8,null))['then'](respondWithResult(_0x57afd8,null))['catch'](handleError(_0x57afd8,null));};exports[_0xbcfc('0x49')]=function(_0x2a5d1d,_0x296cc8){return db[_0xbcfc('0x2e')][_0xbcfc('0x49')](_0x2a5d1d['body'],{})['then'](function(_0x458def){var _0x4093c1=_0x2a5d1d['user'][_0xbcfc('0x27')]({'plain':!![]});if(!_0x4093c1)throw new Error(_0xbcfc('0x4a'));if(_0x4093c1[_0xbcfc('0x4b')]===_0xbcfc('0x4c')){var _0x56dfa2=_0x458def['get']({'plain':!![]});var _0x37902b='Reports';return db[_0xbcfc('0x4d')][_0xbcfc('0x48')]({'where':{'name':_0x37902b,'userProfileId':_0x4093c1['userProfileId']},'raw':!![]})[_0xbcfc('0x26')](function(_0x35987f){if(_0x35987f&&_0x35987f['autoAssociation']===0x0){return db[_0xbcfc('0x29')][_0xbcfc('0x49')]({'name':_0x56dfa2[_0xbcfc('0x2c')],'resourceId':_0x56dfa2['id'],'type':_0xbcfc('0x28'),'sectionId':_0x35987f['id']},{})['then'](function(){return _0x458def;});}else{return _0x458def;}})[_0xbcfc('0x4e')](function(_0x211c9f){logger['error'](_0xbcfc('0x4f'),_0x211c9f);throw _0x211c9f;});}return _0x458def;})[_0xbcfc('0x26')](respondWithResult(_0x296cc8,0xc9))['catch'](handleError(_0x296cc8,null));};exports[_0xbcfc('0x50')]=function(_0x3a816c,_0x151a4b){if(_0x3a816c[_0xbcfc('0x51')]['id']){delete _0x3a816c[_0xbcfc('0x51')]['id'];}return db[_0xbcfc('0x2e')][_0xbcfc('0x48')]({'where':{'id':_0x3a816c['params']['id']}})[_0xbcfc('0x26')](handleEntityNotFound(_0x151a4b,null))[_0xbcfc('0x26')](saveUpdates(_0x3a816c['body'],null))[_0xbcfc('0x26')](respondWithResult(_0x151a4b,null))[_0xbcfc('0x4e')](handleError(_0x151a4b,null));};exports[_0xbcfc('0x2a')]=function(_0x413483,_0xbe3ee3){return db[_0xbcfc('0x2e')][_0xbcfc('0x48')]({'where':{'id':_0x413483[_0xbcfc('0x45')]['id']}})[_0xbcfc('0x26')](handleEntityNotFound(_0xbe3ee3,null))[_0xbcfc('0x26')](removeEntity(_0xbe3ee3,null))[_0xbcfc('0x4e')](handleError(_0xbe3ee3,null));};exports[_0xbcfc('0x52')]=function(_0x48fb8f,_0x412dc0){var _0xfab25d=0xa;var _0x364036=[_0xbcfc('0x53'),_0xbcfc('0x54'),'right_join',_0xbcfc('0x55')];var _0x5d89c9={'SUM':_0xbcfc('0x56'),'COUNT':_0xbcfc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xbcfc('0x58'),'GROUP_CONCAT':_0xbcfc('0x59'),'GROUP_CONCAT ASC':_0xbcfc('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x213576={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xbcfc('0x5b'),'HOUR':_0xbcfc('0x5c'),'ROUND':_0xbcfc('0x5d'),'UNIX_TIMESTAMP':_0xbcfc('0x5e')};var _0xeeb5eb=function(_0x4b6d11){return!_['includes']([_0xbcfc('0x5f'),_0xbcfc('0x60'),_0xbcfc('0x61'),'IS\x20NOT\x20EMPTY'],_0x4b6d11);};var _0x51ea89=function(_0x282460){if(!_0x282460||!_0x282460['rules']['length']){return'';}for(var _0x5bb98c='(',_0x5f08ab=0x0;_0x5f08ab<_0x282460['rules'][_0xbcfc('0x35')];_0x5f08ab+=0x1){_0x5f08ab>0x0&&(_0x5bb98c+='\x20'+_0x282460[_0xbcfc('0x62')]+'\x20');_0x5bb98c+=_0x282460[_0xbcfc('0x63')][_0x5f08ab][_0xbcfc('0x64')]?_0x51ea89(_0x282460[_0xbcfc('0x63')][_0x5f08ab][_0xbcfc('0x64')]):_0x282460[_0xbcfc('0x63')][_0x5f08ab][_0xbcfc('0x65')]+'\x20'+_0x282460['rules'][_0x5f08ab]['condition']+(_0xeeb5eb(_0x282460[_0xbcfc('0x63')][_0x5f08ab][_0xbcfc('0x66')])?'\x20'+_0x282460[_0xbcfc('0x63')][_0x5f08ab][_0xbcfc('0x67')]:'');}return _0x5bb98c+')';};var _0xe2d6b={'where':{'id':_0x48fb8f[_0xbcfc('0x45')]['id']}},_0x28e5fc,_0x56ad92,_0x4cb7dc,_0x31633e,_0x35863a;_0xe2d6b=_[_0xbcfc('0x3d')]({},_0xe2d6b,_0x48fb8f[_0xbcfc('0x40')]);return db[_0xbcfc('0x2e')][_0xbcfc('0x48')](_0xe2d6b)[_0xbcfc('0x26')](function(_0x2c754c){if(_0x2c754c){_0x28e5fc=_0x2c754c;return _0x2c754c[_0xbcfc('0x68')]();}return null;})[_0xbcfc('0x26')](function(_0x4f64d9){if(_0x4f64d9){if(!_0x4f64d9[_0xbcfc('0x35')]){throw new db[(_0xbcfc('0x69'))]['ValidationErrorItem'](_0xbcfc('0x6a'),0x193);}_0x56ad92=_0x4f64d9;return db[_0xbcfc('0x6b')][_0xbcfc('0x43')]({'raw':!![]});}return null;})[_0xbcfc('0x26')](function(_0x1b5eca){if(_0x1b5eca){_0x4cb7dc=_[_0xbcfc('0x6c')](_0x1b5eca,'id');var _0x580c43;var _0x564ebc=squel[_0xbcfc('0x6d')]();_0x564ebc['from'](_0x28e5fc[_0xbcfc('0x6e')]);for(var _0xf41b2e=0x0;_0xf41b2e<_0x56ad92[_0xbcfc('0x35')];_0xf41b2e+=0x1){_0x580c43=_0x56ad92[_0xf41b2e][_0xbcfc('0x6f')]?_0x4cb7dc[_0x56ad92[_0xf41b2e][_0xbcfc('0x6f')]]['metric']:_0x56ad92[_0xf41b2e][_0xbcfc('0x65')];_0x580c43=_0x56ad92[_0xf41b2e]['function']?_[_0xbcfc('0x70')](_0x5d89c9[_0x56ad92[_0xf41b2e][_0xbcfc('0x71')]],'%s',_0x580c43):_0x580c43;_0x580c43=_0x56ad92[_0xf41b2e][_0xbcfc('0x72')]?_[_0xbcfc('0x70')](_0x213576[_0x56ad92[_0xf41b2e]['format']],'%s',_0x580c43):_0x580c43;if(_0x56ad92[_0xf41b2e]['groupBy']){_0x564ebc[_0xbcfc('0x64')](_0x580c43);}_0x56ad92[_0xf41b2e][_0xbcfc('0x73')]&&_0x564ebc[_0xbcfc('0x37')](_0x580c43,_0x56ad92[_0xf41b2e]['orderBy']===_0xbcfc('0x74')?![]:!![]);_0x564ebc[_0xbcfc('0x65')](_0x580c43,_0x56ad92[_0xf41b2e][_0xbcfc('0x75')]||_0x580c43);}if(_0x28e5fc[_0xbcfc('0x76')]){_0x28e5fc['joins']=JSON[_0xbcfc('0x77')](_0x28e5fc[_0xbcfc('0x76')]);for(var _0x16b1de=0x0;_0x16b1de<_0x28e5fc['joins'][_0xbcfc('0x35')];_0x16b1de+=0x1){if(_0x28e5fc[_0xbcfc('0x76')][_0x16b1de][_0xbcfc('0x3e')]&&_[_0xbcfc('0x78')](_0x364036,_0x28e5fc[_0xbcfc('0x76')][_0x16b1de][_0xbcfc('0x3e')])&&_0x28e5fc['joins'][_0x16b1de][_0xbcfc('0x79')]&&_0x28e5fc[_0xbcfc('0x76')][_0x16b1de][_0xbcfc('0x7a')]&&_0x28e5fc[_0xbcfc('0x76')][_0x16b1de]['foreignKey']){_0x564ebc[_0x28e5fc[_0xbcfc('0x76')][_0x16b1de]['type']](_0x28e5fc[_0xbcfc('0x76')][_0x16b1de]['foreignTable'],null,util[_0xbcfc('0x72')](_0xbcfc('0x7b'),_0x28e5fc[_0xbcfc('0x6e')],_0x28e5fc[_0xbcfc('0x76')][_0x16b1de][_0xbcfc('0x79')],_0x28e5fc[_0xbcfc('0x76')][_0x16b1de][_0xbcfc('0x7a')],_0x28e5fc['joins'][_0x16b1de][_0xbcfc('0x7c')]));}}}if(_0x28e5fc[_0xbcfc('0x7d')]){_0x28e5fc[_0xbcfc('0x7d')]=JSON[_0xbcfc('0x77')](_0x28e5fc['conditions']);_0x564ebc[_0xbcfc('0x39')](_0x51ea89(_0x28e5fc[_0xbcfc('0x7d')][_0xbcfc('0x64')]));}_0x35863a=_0x564ebc[_0xbcfc('0x7e')]();_0x564ebc['limit'](_0xfab25d);_0x564ebc['offset'](0x0);logger[_0xbcfc('0x7f')]('Limited\x20Query:',_0x564ebc[_0xbcfc('0x80')]());return dbH['sequelize'][_0xbcfc('0x31')](_0x564ebc[_0xbcfc('0x80')](),{'type':dbH[_0xbcfc('0x81')][_0xbcfc('0x82')][_0xbcfc('0x83')]});}})[_0xbcfc('0x26')](respondWithResult(_0x412dc0,null))[_0xbcfc('0x4e')](handleError(_0x412dc0,null));};function runReport(_0x2632f3,_0x210aa6,_0xbf0c8c){var _0x1060b2=_0x210aa6['name'];var _0x53a7d7=0xa;var _0xa3c639=[_0xbcfc('0x53'),_0xbcfc('0x54'),_0xbcfc('0x84'),'cross_join'];var _0x301de5={'SUM':_0xbcfc('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xbcfc('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbcfc('0x5a'),'GROUP_CONCAT DESC':_0xbcfc('0x85')};var _0xd0787f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xbcfc('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xbcfc('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1acc69=function(_0x3a685f){return!_[_0xbcfc('0x78')]([_0xbcfc('0x5f'),_0xbcfc('0x60'),_0xbcfc('0x61'),'IS\x20NOT\x20EMPTY'],_0x3a685f);};var _0x19e8ef=function(_0x24fa11){if(!_0x24fa11||!_0x24fa11['rules'][_0xbcfc('0x35')]){return'';}for(var _0x4fcd6d='(',_0x40644a=0x0;_0x40644a<_0x24fa11[_0xbcfc('0x63')][_0xbcfc('0x35')];_0x40644a+=0x1){_0x40644a>0x0&&(_0x4fcd6d+='\x20'+_0x24fa11[_0xbcfc('0x62')]+'\x20');_0x4fcd6d+=_0x24fa11['rules'][_0x40644a]['group']?_0x19e8ef(_0x24fa11[_0xbcfc('0x63')][_0x40644a][_0xbcfc('0x64')]):_0x24fa11[_0xbcfc('0x63')][_0x40644a][_0xbcfc('0x65')]+'\x20'+_0x24fa11['rules'][_0x40644a][_0xbcfc('0x66')]+(_0x1acc69(_0x24fa11['rules'][_0x40644a][_0xbcfc('0x66')])?'\x20'+_0x24fa11[_0xbcfc('0x63')][_0x40644a][_0xbcfc('0x67')]:'');}return _0x4fcd6d+')';};var _0x14cb47={'where':{'id':_0x2632f3['id']}},_0x1a86e7,_0xb744f1,_0x44be96,_0x4255c4,_0x33521f;_0x14cb47=_[_0xbcfc('0x3d')]({},_0x14cb47,_0xbf0c8c);return db[_0xbcfc('0x2e')]['find'](_0x14cb47)[_0xbcfc('0x26')](function(_0x38ea37){if(_0x38ea37){_0x1a86e7=_0x38ea37;return _0x38ea37['getFields']();}return null;})[_0xbcfc('0x26')](function(_0x517aaa){if(_0x517aaa){if(!_0x517aaa[_0xbcfc('0x35')]){throw new db[(_0xbcfc('0x69'))][(_0xbcfc('0x86'))](_0xbcfc('0x6a'),0x193);}_0xb744f1=_0x517aaa;return db[_0xbcfc('0x6b')][_0xbcfc('0x43')]({'raw':!![]});}return null;})[_0xbcfc('0x26')](function(_0x39d47c){if(_0x39d47c){_0x44be96=_[_0xbcfc('0x6c')](_0x39d47c,'id');var _0x51cc13;var _0x46a37e=squel[_0xbcfc('0x6d')]();_0x46a37e[_0xbcfc('0x87')](_0x1a86e7['table']);for(var _0x18472d=0x0;_0x18472d<_0xb744f1[_0xbcfc('0x35')];_0x18472d+=0x1){_0x51cc13=_0xb744f1[_0x18472d][_0xbcfc('0x6f')]?_0x44be96[_0xb744f1[_0x18472d][_0xbcfc('0x6f')]][_0xbcfc('0x88')]:_0xb744f1[_0x18472d][_0xbcfc('0x65')];_0x51cc13=_0xb744f1[_0x18472d][_0xbcfc('0x71')]?_[_0xbcfc('0x70')](_0x301de5[_0xb744f1[_0x18472d][_0xbcfc('0x71')]],'%s',_0x51cc13):_0x51cc13;_0x51cc13=_0xb744f1[_0x18472d][_0xbcfc('0x72')]?_[_0xbcfc('0x70')](_0xd0787f[_0xb744f1[_0x18472d][_0xbcfc('0x72')]],'%s',_0x51cc13):_0x51cc13;if(_0xb744f1[_0x18472d][_0xbcfc('0x89')]){_0x46a37e[_0xbcfc('0x64')](_0x51cc13);}_0xb744f1[_0x18472d][_0xbcfc('0x73')]&&_0x46a37e[_0xbcfc('0x37')](_0x51cc13,_0xb744f1[_0x18472d][_0xbcfc('0x73')]===_0xbcfc('0x74')?![]:!![]);_0x46a37e['field'](_0x51cc13,_0xb744f1[_0x18472d][_0xbcfc('0x75')]||_0x51cc13);}if(_0x1a86e7[_0xbcfc('0x76')]){_0x1a86e7[_0xbcfc('0x76')]=JSON[_0xbcfc('0x77')](_0x1a86e7['joins']);for(var _0x2786e9=0x0;_0x2786e9<_0x1a86e7[_0xbcfc('0x76')][_0xbcfc('0x35')];_0x2786e9+=0x1){if(_0x1a86e7['joins'][_0x2786e9][_0xbcfc('0x3e')]&&_[_0xbcfc('0x78')](_0xa3c639,_0x1a86e7[_0xbcfc('0x76')][_0x2786e9][_0xbcfc('0x3e')])&&_0x1a86e7['joins'][_0x2786e9]['parentKey']&&_0x1a86e7[_0xbcfc('0x76')][_0x2786e9][_0xbcfc('0x7a')]&&_0x1a86e7['joins'][_0x2786e9][_0xbcfc('0x7c')]){_0x46a37e[_0x1a86e7[_0xbcfc('0x76')][_0x2786e9][_0xbcfc('0x3e')]](_0x1a86e7[_0xbcfc('0x76')][_0x2786e9][_0xbcfc('0x7a')],null,util[_0xbcfc('0x72')](_0xbcfc('0x7b'),_0x1a86e7[_0xbcfc('0x6e')],_0x1a86e7['joins'][_0x2786e9][_0xbcfc('0x79')],_0x1a86e7[_0xbcfc('0x76')][_0x2786e9][_0xbcfc('0x7a')],_0x1a86e7[_0xbcfc('0x76')][_0x2786e9][_0xbcfc('0x7c')]));}}}if(_0x1a86e7[_0xbcfc('0x7d')]){_0x1a86e7[_0xbcfc('0x7d')]=JSON[_0xbcfc('0x77')](_0x1a86e7[_0xbcfc('0x7d')]);_0x46a37e[_0xbcfc('0x39')](_0x19e8ef(_0x1a86e7['conditions']['group']));}_0x33521f=_0x46a37e[_0xbcfc('0x7e')]();_0x46a37e[_0xbcfc('0x21')](_0x53a7d7);_0x46a37e[_0xbcfc('0x1f')](0x0);return;}})[_0xbcfc('0x26')](function(){if(_0x210aa6[_0xbcfc('0x8a')]===_0xbcfc('0x8b')){return null;}var _0x33bf35=_['merge'](_0x210aa6,{'name':_0x210aa6[_0xbcfc('0x8c')]||_0x210aa6[_0xbcfc('0x2c')]||_0x1a86e7[_0xbcfc('0x2c')],'basename':_0x1060b2,'savename':util[_0xbcfc('0x72')]('%s-%s.%s',_0x210aa6[_0xbcfc('0x2c')]||_0x1a86e7[_0xbcfc('0x2c')],require(_0xbcfc('0x8d'))['generate'](0x4),_0x210aa6[_0xbcfc('0x8a')]||_0xbcfc('0x8e')),'reportId':_0x1a86e7['id'],'reportType':_0xbcfc('0x8f')});return db[_0xbcfc('0x90')]['create'](_0x33bf35,{'raw':!![]});})[_0xbcfc('0x26')](function(_0x28a1dd){if(_0x1a86e7[_0xbcfc('0x6e')]===_0xbcfc('0x91')){_0x33521f[_0xbcfc('0x39')](_0x1a86e7[_0xbcfc('0x6e')]+_0xbcfc('0x92'),_0x210aa6[_0xbcfc('0x93')],_0x210aa6['endDate']);}else{_0x33521f[_0xbcfc('0x39')](_0x1a86e7[_0xbcfc('0x6e')]+_0xbcfc('0x94'),_0x210aa6['startDate'],_0x210aa6['endDate']);}if(_0x28a1dd){logger['info'](_0xbcfc('0x95'),_0x33521f['toString']());require(_0xbcfc('0x96'))['fork'](path[_0xbcfc('0x53')](__dirname,_0xbcfc('0x97'),_0x28a1dd['output']),[_0x28a1dd['id'],_0x33521f[_0xbcfc('0x80')](),path[_0xbcfc('0x53')](__dirname,_0xbcfc('0x98'),_0x28a1dd['savename']),_0x1060b2]);return _0x28a1dd;}else{var _0x4bd85a=squel[_0xbcfc('0x6d')]();_0x4bd85a['from']('('+_0x33521f[_0xbcfc('0x80')]()+')',_0xbcfc('0x99'));_0x4bd85a[_0xbcfc('0x65')]('COUNT(*)',_0xbcfc('0x22'));_0x33521f[_0xbcfc('0x21')](_0x210aa6['limit']||_0x53a7d7);_0x33521f[_0xbcfc('0x1f')](_0x210aa6[_0xbcfc('0x1f')]||0x0);return dbH['sequelize'][_0xbcfc('0x31')](_0x4bd85a[_0xbcfc('0x80')](),{'type':dbH['sequelize'][_0xbcfc('0x82')][_0xbcfc('0x83')]})[_0xbcfc('0x26')](function(_0x297669){if(!_0x297669[_0xbcfc('0x35')]){_0x4255c4=0x0;}else{_0x4255c4=_0x297669[0x0][_0xbcfc('0x22')]||0x0;}return dbH[_0xbcfc('0x81')][_0xbcfc('0x31')](_0x33521f[_0xbcfc('0x80')](),{'type':dbH[_0xbcfc('0x81')][_0xbcfc('0x82')][_0xbcfc('0x83')]});})[_0xbcfc('0x26')](function(_0x587fcb){return{'rows':_0x587fcb||[],'count':_0x4255c4};});}});}exports[_0xbcfc('0x9a')]=function(_0x5658ff,_0xd92d37){return runReport(_0x5658ff['params'],_0x5658ff[_0xbcfc('0x31')],_0x5658ff[_0xbcfc('0x40')])[_0xbcfc('0x26')](respondWithResult(_0xd92d37,null))[_0xbcfc('0x4e')](handleError(_0xd92d37,null));};exports['runReport']=runReport;exports[_0xbcfc('0x31')]=function(_0x347606,_0x2eabe4){var _0x5ddd60=0xa;var _0x3e7d8f=[_0xbcfc('0x53'),_0xbcfc('0x54'),'right_join','cross_join'];var _0x5a89ea={'SUM':_0xbcfc('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xbcfc('0x9b'),'MAX':'MAX(%s)','MIN':_0xbcfc('0x9c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xbcfc('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5edba5={'SEC_TO_TIME':_0xbcfc('0x9d'),'DATE':'DATE(%s)','HOUR':_0xbcfc('0x5c'),'ROUND':_0xbcfc('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4fc773=function(_0x3de9a0){return!_[_0xbcfc('0x78')](['IS\x20NULL',_0xbcfc('0x60'),_0xbcfc('0x61'),_0xbcfc('0x9e')],_0x3de9a0);};var _0x1ddda5=function(_0x304f67){if(!_0x304f67||!_0x304f67[_0xbcfc('0x63')][_0xbcfc('0x35')]){return'';}for(var _0x1348f3='(',_0x85641d=0x0;_0x85641d<_0x304f67[_0xbcfc('0x63')][_0xbcfc('0x35')];_0x85641d+=0x1){_0x85641d>0x0&&(_0x1348f3+='\x20'+_0x304f67[_0xbcfc('0x62')]+'\x20');_0x1348f3+=_0x304f67[_0xbcfc('0x63')][_0x85641d][_0xbcfc('0x64')]?_0x1ddda5(_0x304f67[_0xbcfc('0x63')][_0x85641d]['group']):_0x304f67[_0xbcfc('0x63')][_0x85641d][_0xbcfc('0x65')]+'\x20'+_0x304f67[_0xbcfc('0x63')][_0x85641d][_0xbcfc('0x66')]+(_0x4fc773(_0x304f67['rules'][_0x85641d][_0xbcfc('0x66')])?'\x20'+_0x304f67['rules'][_0x85641d]['value']:'');}return _0x1348f3+')';};var _0x1e3636={'where':{'id':_0x347606[_0xbcfc('0x45')]['id']}},_0xe2f605,_0x2ba7ad,_0x3c2517,_0x250b4c,_0x3cdef1;_0x1e3636=_[_0xbcfc('0x3d')]({},_0x1e3636,_0x347606[_0xbcfc('0x40')]);return db[_0xbcfc('0x2e')][_0xbcfc('0x48')](_0x1e3636)[_0xbcfc('0x26')](function(_0x4c91d6){if(_0x4c91d6){_0xe2f605=_0x4c91d6;return _0x4c91d6[_0xbcfc('0x68')]();}return null;})['then'](function(_0x4fda2d){if(_0x4fda2d){if(!_0x4fda2d['length']){throw new db[(_0xbcfc('0x69'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2ba7ad=_0x4fda2d;return db[_0xbcfc('0x6b')][_0xbcfc('0x43')]({'raw':!![]});}return null;})[_0xbcfc('0x26')](function(_0x586ee3){if(_0x586ee3){_0x3c2517=_[_0xbcfc('0x6c')](_0x586ee3,'id');var _0x1a46a3;var _0x3336fe=squel[_0xbcfc('0x6d')]();_0x3336fe[_0xbcfc('0x87')](_0xe2f605['table']);for(var _0x6d53e7=0x0;_0x6d53e7<_0x2ba7ad['length'];_0x6d53e7+=0x1){_0x1a46a3=_0x2ba7ad[_0x6d53e7]['MetricId']?_0x3c2517[_0x2ba7ad[_0x6d53e7][_0xbcfc('0x6f')]][_0xbcfc('0x88')]:_0x2ba7ad[_0x6d53e7][_0xbcfc('0x65')];_0x1a46a3=_0x2ba7ad[_0x6d53e7][_0xbcfc('0x71')]?_['replace'](_0x5a89ea[_0x2ba7ad[_0x6d53e7]['function']],'%s',_0x1a46a3):_0x1a46a3;_0x1a46a3=_0x2ba7ad[_0x6d53e7][_0xbcfc('0x72')]?_[_0xbcfc('0x70')](_0x5edba5[_0x2ba7ad[_0x6d53e7][_0xbcfc('0x72')]],'%s',_0x1a46a3):_0x1a46a3;if(_0x2ba7ad[_0x6d53e7]['groupBy']){_0x3336fe[_0xbcfc('0x64')](_0x1a46a3);}_0x2ba7ad[_0x6d53e7][_0xbcfc('0x73')]&&_0x3336fe[_0xbcfc('0x37')](_0x1a46a3,_0x2ba7ad[_0x6d53e7][_0xbcfc('0x73')]===_0xbcfc('0x74')?![]:!![]);_0x3336fe[_0xbcfc('0x65')](_0x1a46a3,_0x2ba7ad[_0x6d53e7]['alias']||_0x1a46a3);}if(_0xe2f605[_0xbcfc('0x76')]){_0xe2f605[_0xbcfc('0x76')]=JSON[_0xbcfc('0x77')](_0xe2f605[_0xbcfc('0x76')]);for(var _0x2b9b32=0x0;_0x2b9b32<_0xe2f605[_0xbcfc('0x76')]['length'];_0x2b9b32+=0x1){if(_0xe2f605[_0xbcfc('0x76')][_0x2b9b32]['type']&&_[_0xbcfc('0x78')](_0x3e7d8f,_0xe2f605[_0xbcfc('0x76')][_0x2b9b32][_0xbcfc('0x3e')])&&_0xe2f605[_0xbcfc('0x76')][_0x2b9b32][_0xbcfc('0x79')]&&_0xe2f605[_0xbcfc('0x76')][_0x2b9b32][_0xbcfc('0x7a')]&&_0xe2f605[_0xbcfc('0x76')][_0x2b9b32][_0xbcfc('0x7c')]){_0x3336fe[_0xe2f605[_0xbcfc('0x76')][_0x2b9b32][_0xbcfc('0x3e')]](_0xe2f605[_0xbcfc('0x76')][_0x2b9b32][_0xbcfc('0x7a')],null,util[_0xbcfc('0x72')](_0xbcfc('0x7b'),_0xe2f605['table'],_0xe2f605[_0xbcfc('0x76')][_0x2b9b32][_0xbcfc('0x79')],_0xe2f605[_0xbcfc('0x76')][_0x2b9b32]['foreignTable'],_0xe2f605[_0xbcfc('0x76')][_0x2b9b32][_0xbcfc('0x7c')]));}}}if(_0xe2f605[_0xbcfc('0x7d')]){_0xe2f605['conditions']=JSON[_0xbcfc('0x77')](_0xe2f605['conditions']);_0x3336fe[_0xbcfc('0x39')](_0x1ddda5(_0xe2f605[_0xbcfc('0x7d')]['group']));}_0x3cdef1=_0x3336fe['clone']();_0x3336fe[_0xbcfc('0x21')](_0x5ddd60);_0x3336fe['offset'](0x0);logger[_0xbcfc('0x7f')](_0xbcfc('0x9f'),_0x3336fe[_0xbcfc('0x80')]());return dbH[_0xbcfc('0x81')][_0xbcfc('0x31')](_0x3336fe['toString'](),{'type':dbH[_0xbcfc('0x81')][_0xbcfc('0x82')]['SELECT']});}})[_0xbcfc('0x26')](function(){return{'sql':_0x3cdef1[_0xbcfc('0x80')]()};})[_0xbcfc('0x26')](respondWithResult(_0x2eabe4,null))[_0xbcfc('0x4e')](handleError(_0x2eabe4,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 5c43752..fe9d1f1 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 _0xca99=['api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x5b7b91,_0x1832f9){var _0x19dbe5=function(_0x4deb9f){while(--_0x4deb9f){_0x5b7b91['push'](_0x5b7b91['shift']());}};_0x19dbe5(++_0x1832f9);}(_0xca99,0x1aa));var _0x9ca9=function(_0x247ca3,_0x157f4c){_0x247ca3=_0x247ca3-0x0;var _0x3359c2=_0xca99[_0x247ca3];return _0x3359c2;};'use strict';var _=require(_0x9ca9('0x0'));var util=require(_0x9ca9('0x1'));var logger=require(_0x9ca9('0x2'))(_0x9ca9('0x3'));var moment=require('moment');var BPromise=require(_0x9ca9('0x4'));var rp=require(_0x9ca9('0x5'));var fs=require('fs');var path=require(_0x9ca9('0x6'));var rimraf=require(_0x9ca9('0x7'));var config=require(_0x9ca9('0x8'));var attributes=require(_0x9ca9('0x9'));module['exports']=function(_0x16ce6a,_0x13172f){return _0x16ce6a[_0x9ca9('0xa')](_0x9ca9('0xb'),attributes,{'tableName':_0x9ca9('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff74=['AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x158fd8,_0x21b479){var _0x1ef75c=function(_0x1a3633){while(--_0x1a3633){_0x158fd8['push'](_0x158fd8['shift']());}};_0x1ef75c(++_0x21b479);}(_0xff74,0x178));var _0x4ff7=function(_0x8f82df,_0x4ad0e9){_0x8f82df=_0x8f82df-0x0;var _0x19212a=_0xff74[_0x8f82df];return _0x19212a;};'use strict';var _=require('lodash');var util=require(_0x4ff7('0x0'));var logger=require(_0x4ff7('0x1'))(_0x4ff7('0x2'));var moment=require(_0x4ff7('0x3'));var BPromise=require(_0x4ff7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ff7('0x5'));var rimraf=require(_0x4ff7('0x6'));var config=require(_0x4ff7('0x7'));var attributes=require(_0x4ff7('0x8'));module['exports']=function(_0x321750,_0x2483b8){return _0x321750['define'](_0x4ff7('0x9'),attributes,{'tableName':_0x4ff7('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 75e48f7..dacdcc2 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 _0x28b8=['info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xc2a4e1,_0x30743e){var _0x129c50=function(_0x87d960){while(--_0x87d960){_0xc2a4e1['push'](_0xc2a4e1['shift']());}};_0x129c50(++_0x30743e);}(_0x28b8,0xb3));var _0x828b=function(_0x4f706b,_0x195773){_0x4f706b=_0x4f706b-0x0;var _0x3872b4=_0x28b8[_0x4f706b];return _0x3872b4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x828b('0x0'));var BPromise=require(_0x828b('0x1'));var rs=require(_0x828b('0x2'));var fs=require('fs');var Redis=require(_0x828b('0x3'));var db=require(_0x828b('0x4'))['db'];var utils=require(_0x828b('0x5'));var logger=require(_0x828b('0x6'))(_0x828b('0x7'));var config=require(_0x828b('0x8'));var jayson=require(_0x828b('0x9'));var client=jayson[_0x828b('0xa')][_0x828b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2be1a6,_0x413491,_0x56186a){return new BPromise(function(_0x2a16b5,_0x2d5cc9){return client[_0x828b('0xc')](_0x2be1a6,_0x56186a)['then'](function(_0x4ed0e9){logger[_0x828b('0xd')](_0x828b('0xe'),_0x413491,_0x828b('0xf'));logger[_0x828b('0x10')](_0x828b('0x11'),_0x413491,'request\x20sent',JSON[_0x828b('0x12')](_0x4ed0e9));if(_0x4ed0e9[_0x828b('0x13')]){if(_0x4ed0e9[_0x828b('0x13')][_0x828b('0x14')]===0x1f4){logger[_0x828b('0x13')](_0x828b('0xe'),_0x413491,_0x4ed0e9[_0x828b('0x13')][_0x828b('0x15')]);return _0x2d5cc9(_0x4ed0e9[_0x828b('0x13')][_0x828b('0x15')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x413491,_0x4ed0e9[_0x828b('0x13')][_0x828b('0x15')]);return _0x2a16b5(_0x4ed0e9['error'][_0x828b('0x15')]);}else{logger[_0x828b('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x413491,'request\x20sent');_0x2a16b5(_0x4ed0e9[_0x828b('0x16')][_0x828b('0x15')]);}})[_0x828b('0x17')](function(_0x341168){logger['error'](_0x828b('0xe'),_0x413491,_0x341168);_0x2d5cc9(_0x341168);});});} \ No newline at end of file +var _0x3649=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3649,0xf5));var _0x9364=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3649[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x9364('0x0'));var util=require(_0x9364('0x1'));var moment=require(_0x9364('0x2'));var BPromise=require(_0x9364('0x3'));var rs=require(_0x9364('0x4'));var fs=require('fs');var Redis=require(_0x9364('0x5'));var db=require(_0x9364('0x6'))['db'];var utils=require(_0x9364('0x7'));var logger=require(_0x9364('0x8'))('rpc');var config=require(_0x9364('0x9'));var jayson=require(_0x9364('0xa'));var client=jayson[_0x9364('0xb')][_0x9364('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b5165,_0x53ae8d,_0x586a29){return new BPromise(function(_0x37ef35,_0xba43d7){return client[_0x9364('0xd')](_0x1b5165,_0x586a29)[_0x9364('0xe')](function(_0x9dda0e){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x53ae8d,_0x9364('0xf'));logger[_0x9364('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x53ae8d,_0x9364('0xf'),JSON['stringify'](_0x9dda0e));if(_0x9dda0e[_0x9364('0x11')]){if(_0x9dda0e['error'][_0x9364('0x12')]===0x1f4){logger[_0x9364('0x11')](_0x9364('0x13'),_0x53ae8d,_0x9dda0e[_0x9364('0x11')][_0x9364('0x14')]);return _0xba43d7(_0x9dda0e['error']['message']);}logger[_0x9364('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x53ae8d,_0x9dda0e[_0x9364('0x11')][_0x9364('0x14')]);return _0x37ef35(_0x9dda0e[_0x9364('0x11')]['message']);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x53ae8d,_0x9364('0xf'));_0x37ef35(_0x9dda0e[_0x9364('0x15')]['message']);}})[_0x9364('0x16')](function(_0x4b496d){logger[_0x9364('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x53ae8d,_0x4b496d);_0xba43d7(_0x4b496d);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index b214703..00efdad 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 _0xd42e=['get','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','/:id','show'];(function(_0x2126dd,_0x3ce975){var _0x5ace39=function(_0x683530){while(--_0x683530){_0x2126dd['push'](_0x2126dd['shift']());}};_0x5ace39(++_0x3ce975);}(_0xd42e,0xfb));var _0xed42=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0xd42e[_0x2d8d69];return _0x39ae22;};'use strict';var multer=require(_0xed42('0x0'));var util=require('util');var path=require(_0xed42('0x1'));var timeout=require('connect-timeout');var express=require(_0xed42('0x2'));var router=express[_0xed42('0x3')]();var fs_extra=require(_0xed42('0x4'));var auth=require(_0xed42('0x5'));var interaction=require(_0xed42('0x6'));var config=require(_0xed42('0x7'));var controller=require(_0xed42('0x8'));router['get']('/',auth[_0xed42('0x9')](),controller[_0xed42('0xa')]);router['get'](_0xed42('0xb'),auth['isAuthenticated'](),controller[_0xed42('0xc')]);router[_0xed42('0xd')](_0xed42('0xe'),auth[_0xed42('0x9')](),controller[_0xed42('0xf')]);router[_0xed42('0xd')](_0xed42('0x10'),auth[_0xed42('0x9')](),controller[_0xed42('0x11')]);router[_0xed42('0xd')](_0xed42('0x12'),auth[_0xed42('0x9')](),controller[_0xed42('0x13')]);router[_0xed42('0x14')]('/',auth[_0xed42('0x9')](),controller['create']);router[_0xed42('0x15')](_0xed42('0xb'),auth[_0xed42('0x9')](),controller['update']);router[_0xed42('0x16')](_0xed42('0xb'),auth[_0xed42('0x9')](),controller[_0xed42('0x17')]);module['exports']=router; \ No newline at end of file +var _0x5eb3=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','preview','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer'];(function(_0xc4a42e,_0x116839){var _0x1c456b=function(_0xd3f9c){while(--_0xd3f9c){_0xc4a42e['push'](_0xc4a42e['shift']());}};_0x1c456b(++_0x116839);}(_0x5eb3,0x113));var _0x35eb=function(_0x286bfb,_0x46ac3c){_0x286bfb=_0x286bfb-0x0;var _0x52b683=_0x5eb3[_0x286bfb];return _0x52b683;};'use strict';var multer=require(_0x35eb('0x0'));var util=require(_0x35eb('0x1'));var path=require(_0x35eb('0x2'));var timeout=require(_0x35eb('0x3'));var express=require(_0x35eb('0x4'));var router=express['Router']();var fs_extra=require(_0x35eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x35eb('0x6'));var config=require(_0x35eb('0x7'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x35eb('0x8')](),controller[_0x35eb('0x9')]);router[_0x35eb('0xa')](_0x35eb('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x35eb('0xa')]('/:id/preview',auth[_0x35eb('0x8')](),controller[_0x35eb('0xc')]);router[_0x35eb('0xa')]('/:id/run',auth[_0x35eb('0x8')](),controller[_0x35eb('0xd')]);router[_0x35eb('0xa')](_0x35eb('0xe'),auth[_0x35eb('0x8')](),controller[_0x35eb('0xf')]);router[_0x35eb('0x10')]('/',auth['isAuthenticated'](),controller[_0x35eb('0x11')]);router[_0x35eb('0x12')](_0x35eb('0xb'),auth[_0x35eb('0x8')](),controller[_0x35eb('0x13')]);router[_0x35eb('0x14')]('/:id',auth[_0x35eb('0x8')](),controller[_0x35eb('0x15')]);module[_0x35eb('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index dbece7d..9a4e542 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 _0x207c=['STRING','TEXT','exports'];(function(_0x46af03,_0x5bf95f){var _0xb3a167=function(_0x3c5d90){while(--_0x3c5d90){_0x46af03['push'](_0x46af03['shift']());}};_0xb3a167(++_0x5bf95f);}(_0x207c,0x1e8));var _0xc207=function(_0x1e0d54,_0x46fbec){_0x1e0d54=_0x1e0d54-0x0;var _0x244204=_0x207c[_0x1e0d54];return _0x244204;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'name':{'type':Sequelize[_0xc207('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc207('0x1')]},'parent':{'type':Sequelize[_0xc207('0x1')]},'table':{'type':Sequelize[_0xc207('0x1')]},'conditions':{'type':Sequelize[_0xc207('0x2')]},'joins':{'type':Sequelize[_0xc207('0x2')]}}; \ No newline at end of file +var _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x5eaefa,_0x24341a){var _0x11b447=function(_0x584abd){while(--_0x584abd){_0x5eaefa['push'](_0x5eaefa['shift']());}};_0x11b447(++_0x24341a);}(_0x98a8,0x12c));var _0x898a=function(_0x5a65a1,_0x3ff9bf){_0x5a65a1=_0x5a65a1-0x0;var _0x48f47e=_0x98a8[_0x5a65a1];return _0x48f47e;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index e3d4bea..838f9bf 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 _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%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\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x32a1d2,_0xa69477){var _0x4dc9ed=function(_0x1017f4){while(--_0x1017f4){_0x32a1d2['push'](_0x32a1d2['shift']());}};_0x4dc9ed(++_0xa69477);}(_0x1967,0x173));var _0x7196=function(_0x496c2b,_0x14e73d){_0x496c2b=_0x496c2b-0x0;var _0x3d962f=_0x1967[_0x496c2b];return _0x3d962f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));}; \ No newline at end of file +var _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x17457c,_0x5c874d){var _0x18a702=function(_0x2be3e4){while(--_0x2be3e4){_0x17457c['push'](_0x17457c['shift']());}};_0x18a702(++_0x5c874d);}(_0xf494,0x1c6));var _0x4f49=function(_0x4603a3,_0x260168){_0x4603a3=_0x4603a3-0x0;var _0x532cbe=_0xf494[_0x4603a3];return _0x532cbe;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 8822d26..f1243ee 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 _0xe1ef=['../../config/environment','./analyticDefaultReport.attributes','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x233923,_0x2494a3){var _0x4b53d9=function(_0x2998f3){while(--_0x2998f3){_0x233923['push'](_0x233923['shift']());}};_0x4b53d9(++_0x2494a3);}(_0xe1ef,0x178));var _0xfe1e=function(_0x36e9fc,_0x5b8f92){_0x36e9fc=_0x36e9fc-0x0;var _0x5bb728=_0xe1ef[_0x36e9fc];return _0x5bb728;};'use strict';var _=require(_0xfe1e('0x0'));var util=require('util');var logger=require(_0xfe1e('0x1'))(_0xfe1e('0x2'));var moment=require(_0xfe1e('0x3'));var BPromise=require(_0xfe1e('0x4'));var rp=require(_0xfe1e('0x5'));var fs=require('fs');var path=require(_0xfe1e('0x6'));var rimraf=require(_0xfe1e('0x7'));var config=require(_0xfe1e('0x8'));var attributes=require(_0xfe1e('0x9'));module['exports']=function(_0x238e86,_0x29cdbb){return _0x238e86['define'](_0xfe1e('0xa'),attributes,{'tableName':_0xfe1e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x231c=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x1ebfa0,_0x5c4047){var _0x4fd00c=function(_0x574d19){while(--_0x574d19){_0x1ebfa0['push'](_0x1ebfa0['shift']());}};_0x4fd00c(++_0x5c4047);}(_0x231c,0x197));var _0xc231=function(_0x4683ba,_0x2e8b9e){_0x4683ba=_0x4683ba-0x0;var _0x1e060e=_0x231c[_0x4683ba];return _0x1e060e;};'use strict';var _=require(_0xc231('0x0'));var util=require('util');var logger=require(_0xc231('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc231('0x2'));var rp=require(_0xc231('0x3'));var fs=require('fs');var path=require(_0xc231('0x4'));var rimraf=require(_0xc231('0x5'));var config=require(_0xc231('0x6'));var attributes=require(_0xc231('0x7'));module[_0xc231('0x8')]=function(_0x2b6060,_0x22129a){return _0x2b6060[_0xc231('0x9')](_0xc231('0xa'),attributes,{'tableName':_0xc231('0xb'),'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 e066a39..d420789 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 _0xebf4=['info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x389f2e,_0x5556a8){var _0x382f1f=function(_0x2c798c){while(--_0x2c798c){_0x389f2e['push'](_0x389f2e['shift']());}};_0x382f1f(++_0x5556a8);}(_0xebf4,0x15a));var _0x4ebf=function(_0x1c1430,_0x9e6855){_0x1c1430=_0x1c1430-0x0;var _0x466af0=_0xebf4[_0x1c1430];return _0x466af0;};'use strict';var _=require('lodash');var util=require(_0x4ebf('0x0'));var moment=require(_0x4ebf('0x1'));var BPromise=require('bluebird');var rs=require(_0x4ebf('0x2'));var fs=require('fs');var Redis=require(_0x4ebf('0x3'));var db=require(_0x4ebf('0x4'))['db'];var utils=require(_0x4ebf('0x5'));var logger=require(_0x4ebf('0x6'))(_0x4ebf('0x7'));var config=require(_0x4ebf('0x8'));var jayson=require(_0x4ebf('0x9'));var client=jayson[_0x4ebf('0xa')][_0x4ebf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x64f8db,_0x3723a7,_0x1eafc4){return new BPromise(function(_0x109df6,_0x5d82db){return client[_0x4ebf('0xc')](_0x64f8db,_0x1eafc4)[_0x4ebf('0xd')](function(_0x55dc67){logger[_0x4ebf('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3723a7,_0x4ebf('0xf'));logger[_0x4ebf('0x10')](_0x4ebf('0x11'),_0x3723a7,'request\x20sent',JSON[_0x4ebf('0x12')](_0x55dc67));if(_0x55dc67[_0x4ebf('0x13')]){if(_0x55dc67[_0x4ebf('0x13')][_0x4ebf('0x14')]===0x1f4){logger[_0x4ebf('0x13')](_0x4ebf('0x15'),_0x3723a7,_0x55dc67[_0x4ebf('0x13')][_0x4ebf('0x16')]);return _0x5d82db(_0x55dc67['error'][_0x4ebf('0x16')]);}logger['error'](_0x4ebf('0x15'),_0x3723a7,_0x55dc67[_0x4ebf('0x13')][_0x4ebf('0x16')]);return _0x109df6(_0x55dc67[_0x4ebf('0x13')][_0x4ebf('0x16')]);}else{logger[_0x4ebf('0xe')](_0x4ebf('0x15'),_0x3723a7,_0x4ebf('0xf'));_0x109df6(_0x55dc67[_0x4ebf('0x17')][_0x4ebf('0x16')]);}})['catch'](function(_0x470244){logger[_0x4ebf('0x13')](_0x4ebf('0x15'),_0x3723a7,_0x470244);_0x5d82db(_0x470244);});});} \ No newline at end of file +var _0x7c0f=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils'];(function(_0x1e9810,_0x31acc9){var _0x52a26d=function(_0x92b7e3){while(--_0x92b7e3){_0x1e9810['push'](_0x1e9810['shift']());}};_0x52a26d(++_0x31acc9);}(_0x7c0f,0x187));var _0xf7c0=function(_0x4bde24,_0x91cda4){_0x4bde24=_0x4bde24-0x0;var _0x2efb95=_0x7c0f[_0x4bde24];return _0x2efb95;};'use strict';var _=require(_0xf7c0('0x0'));var util=require('util');var moment=require(_0xf7c0('0x1'));var BPromise=require(_0xf7c0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf7c0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf7c0('0x4'));var logger=require(_0xf7c0('0x5'))(_0xf7c0('0x6'));var config=require(_0xf7c0('0x7'));var jayson=require(_0xf7c0('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d90d9,_0x3ea663,_0x360cfb){return new BPromise(function(_0x109574,_0x587c22){return client[_0xf7c0('0x9')](_0x4d90d9,_0x360cfb)[_0xf7c0('0xa')](function(_0x141550){logger[_0xf7c0('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3ea663,_0xf7c0('0xc'));logger[_0xf7c0('0xd')](_0xf7c0('0xe'),_0x3ea663,_0xf7c0('0xc'),JSON[_0xf7c0('0xf')](_0x141550));if(_0x141550['error']){if(_0x141550[_0xf7c0('0x10')][_0xf7c0('0x11')]===0x1f4){logger[_0xf7c0('0x10')](_0xf7c0('0x12'),_0x3ea663,_0x141550[_0xf7c0('0x10')][_0xf7c0('0x13')]);return _0x587c22(_0x141550[_0xf7c0('0x10')]['message']);}logger[_0xf7c0('0x10')](_0xf7c0('0x12'),_0x3ea663,_0x141550[_0xf7c0('0x10')][_0xf7c0('0x13')]);return _0x109574(_0x141550[_0xf7c0('0x10')][_0xf7c0('0x13')]);}else{logger[_0xf7c0('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3ea663,_0xf7c0('0xc'));_0x109574(_0x141550[_0xf7c0('0x14')]['message']);}})[_0xf7c0('0x15')](function(_0x4989dc){logger[_0xf7c0('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3ea663,_0x4989dc);_0x587c22(_0x4989dc);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 3b6daf1..4a07ba7 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 _0x9a3d=['../../config/environment','./analyticDefaultReport.controller','isAuthenticated','/:id','show','get','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x11fedc,_0x22d67c){var _0x28e604=function(_0x5de935){while(--_0x5de935){_0x11fedc['push'](_0x11fedc['shift']());}};_0x28e604(++_0x22d67c);}(_0x9a3d,0x10c));var _0xd9a3=function(_0x280118,_0x58b9a2){_0x280118=_0x280118-0x0;var _0xd0b02=_0x9a3d[_0x280118];return _0xd0b02;};'use strict';var multer=require(_0xd9a3('0x0'));var util=require('util');var path=require(_0xd9a3('0x1'));var timeout=require(_0xd9a3('0x2'));var express=require(_0xd9a3('0x3'));var router=express[_0xd9a3('0x4')]();var fs_extra=require(_0xd9a3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd9a3('0x6'));var config=require(_0xd9a3('0x7'));var controller=require(_0xd9a3('0x8'));router['get']('/',auth[_0xd9a3('0x9')](),controller['index']);router['get'](_0xd9a3('0xa'),auth[_0xd9a3('0x9')](),controller[_0xd9a3('0xb')]);router[_0xd9a3('0xc')](_0xd9a3('0xd'),auth[_0xd9a3('0x9')](),controller[_0xd9a3('0xe')]);router['get'](_0xd9a3('0xf'),auth[_0xd9a3('0x9')](),controller[_0xd9a3('0x10')]);router['get'](_0xd9a3('0x11'),auth[_0xd9a3('0x9')](),controller[_0xd9a3('0x12')]);router[_0xd9a3('0x13')]('/',auth['isAuthenticated'](),controller[_0xd9a3('0x14')]);router[_0xd9a3('0x15')](_0xd9a3('0xa'),auth[_0xd9a3('0x9')](),controller['update']);router[_0xd9a3('0x16')](_0xd9a3('0xa'),auth[_0xd9a3('0x9')](),controller[_0xd9a3('0x17')]);module[_0xd9a3('0x18')]=router; \ No newline at end of file +var _0xf8ae=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','query','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xf8ae,0x168));var _0xef8a=function(_0x2b719f,_0x532745){_0x2b719f=_0x2b719f-0x0;var _0x37c8e8=_0xf8ae[_0x2b719f];return _0x37c8e8;};'use strict';var multer=require(_0xef8a('0x0'));var util=require(_0xef8a('0x1'));var path=require('path');var timeout=require(_0xef8a('0x2'));var express=require(_0xef8a('0x3'));var router=express[_0xef8a('0x4')]();var fs_extra=require(_0xef8a('0x5'));var auth=require(_0xef8a('0x6'));var interaction=require(_0xef8a('0x7'));var config=require(_0xef8a('0x8'));var controller=require(_0xef8a('0x9'));router[_0xef8a('0xa')]('/',auth[_0xef8a('0xb')](),controller[_0xef8a('0xc')]);router[_0xef8a('0xa')](_0xef8a('0xd'),auth[_0xef8a('0xb')](),controller['show']);router['get'](_0xef8a('0xe'),auth[_0xef8a('0xb')](),controller[_0xef8a('0xf')]);router['get'](_0xef8a('0x10'),auth[_0xef8a('0xb')](),controller[_0xef8a('0x11')]);router['get']('/:id/query',auth[_0xef8a('0xb')](),controller[_0xef8a('0x12')]);router[_0xef8a('0x13')]('/',auth[_0xef8a('0xb')](),controller[_0xef8a('0x14')]);router[_0xef8a('0x15')]('/:id',auth[_0xef8a('0xb')](),controller[_0xef8a('0x16')]);router[_0xef8a('0x17')](_0xef8a('0xd'),auth['isAuthenticated'](),controller[_0xef8a('0x18')]);module[_0xef8a('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index db43f24..0871923 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 _0x029d=['moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','scheduled','INTEGER','sequelize'];(function(_0x3f1861,_0x7b4285){var _0x7ca70a=function(_0x119b09){while(--_0x119b09){_0x3f1861['push'](_0x3f1861['shift']());}};_0x7ca70a(++_0x7b4285);}(_0x029d,0x16a));var _0xd029=function(_0x594cd6,_0x24f16e){_0x594cd6=_0x594cd6-0x0;var _0x4cf17b=_0x029d[_0x594cd6];return _0x4cf17b;};'use strict';var Sequelize=require(_0xd029('0x0'));var moment=require(_0xd029('0x1'));module[_0xd029('0x2')]={'name':{'type':Sequelize[_0xd029('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xd029('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xd029('0x4')](_0xd029('0x5'),_0xd029('0x6'),_0xd029('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xd029('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd029('0x8')]},'endDate':{'type':Sequelize[_0xd029('0x8')]},'status':{'type':Sequelize[_0xd029('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xd029('0x4')]('manual',_0xd029('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xd029('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xd029('0x3')]}}; \ No newline at end of file +var _0xd526=['csv','pdf','xlsx','DATE','Loading','manual','scheduled','UNSIGNED','moment','STRING','ENUM'];(function(_0x222df7,_0x3e073f){var _0x2cceae=function(_0x5e69ef){while(--_0x5e69ef){_0x222df7['push'](_0x222df7['shift']());}};_0x2cceae(++_0x3e073f);}(_0xd526,0xce));var _0x6d52=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xd526[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6d52('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x6d52('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x6d52('0x2')](_0x6d52('0x3'),_0x6d52('0x4'),_0x6d52('0x5')),'allowNull':![],'defaultValue':_0x6d52('0x3')},'savename':{'type':Sequelize[_0x6d52('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x6d52('0x6')]},'endDate':{'type':Sequelize[_0x6d52('0x6')]},'status':{'type':Sequelize[_0x6d52('0x1')],'defaultValue':_0x6d52('0x7')},'type':{'type':Sequelize[_0x6d52('0x2')](_0x6d52('0x8'),_0x6d52('0x9')),'allowNull':![],'defaultValue':_0x6d52('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x6d52('0xa')]},'reportType':{'type':Sequelize[_0x6d52('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 75d47c3..fc0764b 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 _0x2805=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','Content-Range','reject','save','then','destroy','get','ExtractedReports','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','basename','output','existsSync','server/files/reports','savename','ValidationError','exists','download','root','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0xf8deed,_0x18f231){var _0x2c9f3c=function(_0x32b547){while(--_0x32b547){_0xf8deed['push'](_0xf8deed['shift']());}};_0x2c9f3c(++_0x18f231);}(_0x2805,0x177));var _0x5280=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x2805[_0x397cfb];return _0x15fed9;};'use strict';var emlformat=require(_0x5280('0x0'));var rimraf=require(_0x5280('0x1'));var zipdir=require(_0x5280('0x2'));var jsonpatch=require(_0x5280('0x3'));var rp=require(_0x5280('0x4'));var moment=require(_0x5280('0x5'));var BPromise=require(_0x5280('0x6'));var Mustache=require(_0x5280('0x7'));var util=require(_0x5280('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x5280('0x9'));var ejs=require(_0x5280('0xa'));var fs=require('fs');var fs_extra=require(_0x5280('0xb'));var _=require(_0x5280('0xc'));var squel=require(_0x5280('0xd'));var crypto=require(_0x5280('0xe'));var jsforce=require(_0x5280('0xf'));var deskjs=require(_0x5280('0x10'));var toCsv=require(_0x5280('0x9'));var querystring=require(_0x5280('0x11'));var Papa=require(_0x5280('0x12'));var Redis=require(_0x5280('0x13'));var authService=require(_0x5280('0x14'));var qs=require(_0x5280('0x15'));var as=require(_0x5280('0x16'));var hardwareService=require(_0x5280('0x17'));var logger=require(_0x5280('0x18'))(_0x5280('0x19'));var utils=require(_0x5280('0x1a'));var config=require(_0x5280('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x5280('0x1c'))['db'];function respondWithStatusCode(_0x5252a1,_0x367f75){_0x367f75=_0x367f75||0xcc;return function(_0x575c46){if(_0x575c46){return _0x5252a1[_0x5280('0x1d')](_0x367f75);}return _0x5252a1['status'](_0x367f75)[_0x5280('0x1e')]();};}function respondWithResult(_0x3fa688,_0x171f55){_0x171f55=_0x171f55||0xc8;return function(_0x1f94f5){if(_0x1f94f5){return _0x3fa688[_0x5280('0x1f')](_0x171f55)[_0x5280('0x20')](_0x1f94f5);}};}function respondWithFilteredResult(_0x2a6b1c,_0x17900c){return function(_0x3e94bb){if(_0x3e94bb){var _0x20e41d=typeof _0x17900c[_0x5280('0x21')]===_0x5280('0x22')&&typeof _0x17900c['limit']===_0x5280('0x22');var _0x5ec975=_0x3e94bb[_0x5280('0x23')];var _0x33adaf=_0x20e41d?0x0:_0x17900c[_0x5280('0x21')];var _0x3176fc=_0x20e41d?_0x3e94bb[_0x5280('0x23')]:_0x17900c['offset']+_0x17900c['limit'];var _0x17ee90;if(_0x3176fc>=_0x5ec975){_0x3176fc=_0x5ec975;_0x17ee90=0xc8;}else{_0x17ee90=0xce;}_0x2a6b1c['status'](_0x17ee90);return _0x2a6b1c['set'](_0x5280('0x24'),_0x33adaf+'-'+_0x3176fc+'/'+_0x5ec975)['json'](_0x3e94bb);}return null;};}function patchUpdates(_0x5cbeb8){return function(_0x5735ea){try{jsonpatch['apply'](_0x5735ea,_0x5cbeb8,!![]);}catch(_0x40e25c){return BPromise[_0x5280('0x25')](_0x40e25c);}return _0x5735ea[_0x5280('0x26')]();};}function saveUpdates(_0x366cf6,_0x2f1541){return function(_0x74ac75){if(_0x74ac75){return _0x74ac75['update'](_0x366cf6)[_0x5280('0x27')](function(_0x59da1f){return _0x59da1f;});}return null;};}function removeEntity(_0x15386c,_0x1cc78f){return function(_0x519504){if(_0x519504){return _0x519504[_0x5280('0x28')]()[_0x5280('0x27')](function(){var _0x123c92=_0x519504[_0x5280('0x29')]({'plain':!![]});var _0x1e344b=_0x5280('0x2a');return db['UserProfileResource'][_0x5280('0x28')]({'where':{'type':_0x1e344b,'resourceId':_0x123c92['id']}})[_0x5280('0x27')](function(){return _0x519504;});})[_0x5280('0x27')](function(){_0x15386c[_0x5280('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe429f8,_0xc33c18){return function(_0x9ab8d3){if(!_0x9ab8d3){_0xe429f8[_0x5280('0x1d')](0x194);}return _0x9ab8d3;};}function handleError(_0x443c3b,_0x4bcdc5){_0x4bcdc5=_0x4bcdc5||0x1f4;return function(_0x49d05d){logger[_0x5280('0x2b')](_0x49d05d[_0x5280('0x2c')]);if(_0x49d05d['name']){delete _0x49d05d[_0x5280('0x2d')];}_0x443c3b[_0x5280('0x1f')](_0x4bcdc5)[_0x5280('0x2e')](_0x49d05d);};}exports[_0x5280('0x2f')]=function(_0x266cec,_0x851022){var _0x258fbf={},_0x313a7f={},_0x93c4f2={'count':0x0,'rows':[]};var _0x7b366f=_[_0x5280('0x30')](db['AnalyticExtractedReport'][_0x5280('0x31')],function(_0x80996e){return{'name':_0x80996e[_0x5280('0x32')],'type':_0x80996e[_0x5280('0x33')][_0x5280('0x34')]};});_0x313a7f['model']=_[_0x5280('0x30')](_0x7b366f,'name');_0x313a7f['query']=_[_0x5280('0x35')](_0x266cec[_0x5280('0x36')]);_0x313a7f[_0x5280('0x37')]=_['intersection'](_0x313a7f[_0x5280('0x38')],_0x313a7f['query']);_0x258fbf['attributes']=_[_0x5280('0x39')](_0x313a7f['model'],qs[_0x5280('0x3a')](_0x266cec[_0x5280('0x36')][_0x5280('0x3a')]));_0x258fbf[_0x5280('0x3b')]=_0x258fbf['attributes'][_0x5280('0x3c')]?_0x258fbf['attributes']:_0x313a7f['model'];if(!_0x266cec['query'][_0x5280('0x3d')](_0x5280('0x3e'))){_0x258fbf[_0x5280('0x3f')]=qs[_0x5280('0x3f')](_0x266cec['query']['limit']);_0x258fbf['offset']=qs[_0x5280('0x21')](_0x266cec[_0x5280('0x36')][_0x5280('0x21')]);}_0x258fbf[_0x5280('0x40')]=qs[_0x5280('0x41')](_0x266cec[_0x5280('0x36')][_0x5280('0x41')]);_0x258fbf[_0x5280('0x42')]=qs[_0x5280('0x37')](_[_0x5280('0x43')](_0x266cec[_0x5280('0x36')],_0x313a7f[_0x5280('0x37')]),_0x7b366f);if(_0x266cec[_0x5280('0x36')][_0x5280('0x44')]){_0x258fbf['where']=_[_0x5280('0x45')](_0x258fbf[_0x5280('0x42')],{'$or':_[_0x5280('0x30')](_0x7b366f,function(_0x313a0f){if(_0x313a0f[_0x5280('0x33')]!==_0x5280('0x46')){var _0x2af0da={};_0x2af0da[_0x313a0f['name']]={'$like':'%'+_0x266cec[_0x5280('0x36')][_0x5280('0x44')]+'%'};return _0x2af0da;}})});}_0x258fbf=_[_0x5280('0x45')]({},_0x258fbf,_0x266cec[_0x5280('0x47')]);var _0x34e435={'where':_0x258fbf['where']};return db[_0x5280('0x48')]['count'](_0x34e435)['then'](function(_0x52f722){_0x93c4f2[_0x5280('0x23')]=_0x52f722;if(_0x266cec['query'][_0x5280('0x49')]){_0x258fbf[_0x5280('0x4a')]=[{'all':!![]}];}return db[_0x5280('0x48')]['findAll'](_0x258fbf);})[_0x5280('0x27')](function(_0x45835d){_0x93c4f2[_0x5280('0x4b')]=_0x45835d;return _0x93c4f2;})[_0x5280('0x27')](respondWithFilteredResult(_0x851022,_0x258fbf))[_0x5280('0x4c')](handleError(_0x851022,null));};exports[_0x5280('0x4d')]=function(_0x5d9e29,_0x3ce0ce){var _0x535019={'raw':!![],'where':{'id':_0x5d9e29[_0x5280('0x4e')]['id']}},_0x280a90={};_0x280a90[_0x5280('0x38')]=_[_0x5280('0x35')](db[_0x5280('0x48')][_0x5280('0x31')]);_0x280a90[_0x5280('0x36')]=_['keys'](_0x5d9e29[_0x5280('0x36')]);_0x280a90[_0x5280('0x37')]=_[_0x5280('0x39')](_0x280a90[_0x5280('0x38')],_0x280a90[_0x5280('0x36')]);_0x535019[_0x5280('0x3b')]=_[_0x5280('0x39')](_0x280a90[_0x5280('0x38')],qs[_0x5280('0x3a')](_0x5d9e29[_0x5280('0x36')]['fields']));_0x535019[_0x5280('0x3b')]=_0x535019[_0x5280('0x3b')][_0x5280('0x3c')]?_0x535019[_0x5280('0x3b')]:_0x280a90['model'];if(_0x5d9e29['query'][_0x5280('0x49')]){_0x535019[_0x5280('0x4a')]=[{'all':!![]}];}_0x535019=_[_0x5280('0x45')]({},_0x535019,_0x5d9e29[_0x5280('0x47')]);return db['AnalyticExtractedReport'][_0x5280('0x4f')](_0x535019)['then'](handleEntityNotFound(_0x3ce0ce,null))[_0x5280('0x27')](respondWithResult(_0x3ce0ce,null))['catch'](handleError(_0x3ce0ce,null));};exports[_0x5280('0x50')]=function(_0x35ae94,_0x17e842){return db[_0x5280('0x48')][_0x5280('0x50')](_0x35ae94[_0x5280('0x51')],{})[_0x5280('0x27')](function(_0x1fbe65){var _0xc80d67=_0x35ae94[_0x5280('0x52')][_0x5280('0x29')]({'plain':!![]});if(!_0xc80d67)throw new Error(_0x5280('0x53'));if(_0xc80d67['role']===_0x5280('0x52')){var _0x403742=_0x1fbe65['get']({'plain':!![]});var _0x563c18=_0x5280('0x2a');return db['UserProfileSection'][_0x5280('0x4f')]({'where':{'name':_0x563c18,'userProfileId':_0xc80d67[_0x5280('0x54')]},'raw':!![]})[_0x5280('0x27')](function(_0x5174ae){if(_0x5174ae&&_0x5174ae[_0x5280('0x55')]===0x0){return db[_0x5280('0x56')][_0x5280('0x50')]({'name':_0x403742[_0x5280('0x2d')],'resourceId':_0x403742['id'],'type':_0x5174ae[_0x5280('0x2d')],'sectionId':_0x5174ae['id']},{})[_0x5280('0x27')](function(){return _0x1fbe65;});}else{return _0x1fbe65;}})[_0x5280('0x4c')](function(_0x4b787f){logger[_0x5280('0x2b')](_0x5280('0x57'),_0x4b787f);throw _0x4b787f;});}return _0x1fbe65;})['then'](respondWithResult(_0x17e842,0xc9))['catch'](handleError(_0x17e842,null));};exports[_0x5280('0x58')]=function(_0xf712fe,_0x38d1bc){if(_0xf712fe[_0x5280('0x51')]['id']){delete _0xf712fe[_0x5280('0x51')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0xf712fe['params']['id']}})[_0x5280('0x27')](handleEntityNotFound(_0x38d1bc,null))[_0x5280('0x27')](saveUpdates(_0xf712fe[_0x5280('0x51')],null))[_0x5280('0x27')](respondWithResult(_0x38d1bc,null))[_0x5280('0x4c')](handleError(_0x38d1bc,null));};exports[_0x5280('0x28')]=function(_0x353633,_0x4c9fef){return db[_0x5280('0x48')][_0x5280('0x4f')]({'where':{'id':_0x353633[_0x5280('0x4e')]['id']}})[_0x5280('0x27')](handleEntityNotFound(_0x4c9fef,null))['then'](removeEntity(_0x4c9fef,null))[_0x5280('0x4c')](handleError(_0x4c9fef,null));};exports['download']=function(_0x563206,_0x2d5ab2,_0x2dc8f7){return db[_0x5280('0x48')][_0x5280('0x4f')]({'where':{'id':_0x563206[_0x5280('0x4e')]['id']},'attributes':[_0x5280('0x2d'),_0x5280('0x59'),'savename',_0x5280('0x5a')],'raw':!![]})[_0x5280('0x27')](handleEntityNotFound(_0x2d5ab2,null))[_0x5280('0x27')](function(_0x484c67){if(_0x484c67){if(!fs[_0x5280('0x5b')](path['join'](config['root'],_0x5280('0x5c'),_0x484c67[_0x5280('0x5d')]))){throw new db['Sequelize'][(_0x5280('0x5e'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x563206[_0x5280('0x36')][_0x5280('0x5f')]){return _0x2d5ab2[_0x5280('0x1d')](0xc8);}return _0x2d5ab2[_0x5280('0x60')](path['join'](config[_0x5280('0x61')],_0x5280('0x5c'),_0x484c67[_0x5280('0x5d')]),util['format'](_0x5280('0x62'),_0x484c67[_0x5280('0x59')]||_0x484c67['name'],_0x484c67[_0x5280('0x5a')][_0x5280('0x63')]()));}})[_0x5280('0x4c')](handleError(_0x2d5ab2,null));}; \ No newline at end of file +var _0xa6ea=['savename','output','join','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','params','destroy','download','basename'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xa6ea,0xc1));var _0xaa6e=function(_0x43bd81,_0x141189){_0x43bd81=_0x43bd81-0x0;var _0x5f0148=_0xa6ea[_0x43bd81];return _0x5f0148;};'use strict';var emlformat=require(_0xaa6e('0x0'));var rimraf=require(_0xaa6e('0x1'));var zipdir=require(_0xaa6e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaa6e('0x3'));var BPromise=require(_0xaa6e('0x4'));var Mustache=require(_0xaa6e('0x5'));var util=require(_0xaa6e('0x6'));var path=require(_0xaa6e('0x7'));var sox=require(_0xaa6e('0x8'));var csv=require(_0xaa6e('0x9'));var ejs=require(_0xaa6e('0xa'));var fs=require('fs');var fs_extra=require(_0xaa6e('0xb'));var _=require(_0xaa6e('0xc'));var squel=require(_0xaa6e('0xd'));var crypto=require('crypto');var jsforce=require(_0xaa6e('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaa6e('0xf'));var Papa=require(_0xaa6e('0x10'));var Redis=require('ioredis');var authService=require(_0xaa6e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaa6e('0x12'));var hardwareService=require(_0xaa6e('0x13'));var logger=require('../../config/logger')(_0xaa6e('0x14'));var utils=require('../../config/utils');var config=require(_0xaa6e('0x15'));var licenseUtil=require(_0xaa6e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7881c2,_0x48625c){_0x48625c=_0x48625c||0xcc;return function(_0x409830){if(_0x409830){return _0x7881c2[_0xaa6e('0x17')](_0x48625c);}return _0x7881c2[_0xaa6e('0x18')](_0x48625c)['end']();};}function respondWithResult(_0x13fd6f,_0x59a129){_0x59a129=_0x59a129||0xc8;return function(_0x25f44f){if(_0x25f44f){return _0x13fd6f[_0xaa6e('0x18')](_0x59a129)[_0xaa6e('0x19')](_0x25f44f);}};}function respondWithFilteredResult(_0x109c76,_0x5f4762){return function(_0x4ae8eb){if(_0x4ae8eb){var _0x533029=typeof _0x5f4762[_0xaa6e('0x1a')]===_0xaa6e('0x1b')&&typeof _0x5f4762[_0xaa6e('0x1c')]===_0xaa6e('0x1b');var _0x265908=_0x4ae8eb[_0xaa6e('0x1d')];var _0x48f044=_0x533029?0x0:_0x5f4762[_0xaa6e('0x1a')];var _0x579510=_0x533029?_0x4ae8eb[_0xaa6e('0x1d')]:_0x5f4762['offset']+_0x5f4762['limit'];var _0x3f8f4b;if(_0x579510>=_0x265908){_0x579510=_0x265908;_0x3f8f4b=0xc8;}else{_0x3f8f4b=0xce;}_0x109c76[_0xaa6e('0x18')](_0x3f8f4b);return _0x109c76[_0xaa6e('0x1e')](_0xaa6e('0x1f'),_0x48f044+'-'+_0x579510+'/'+_0x265908)['json'](_0x4ae8eb);}return null;};}function patchUpdates(_0x392413){return function(_0x3c41b1){try{jsonpatch[_0xaa6e('0x20')](_0x3c41b1,_0x392413,!![]);}catch(_0x3644f7){return BPromise[_0xaa6e('0x21')](_0x3644f7);}return _0x3c41b1[_0xaa6e('0x22')]();};}function saveUpdates(_0x52c89f,_0x49b465){return function(_0x46e6b7){if(_0x46e6b7){return _0x46e6b7[_0xaa6e('0x23')](_0x52c89f)[_0xaa6e('0x24')](function(_0x1d5c59){return _0x1d5c59;});}return null;};}function removeEntity(_0xa25acb,_0x5b0bca){return function(_0x5b2140){if(_0x5b2140){return _0x5b2140['destroy']()[_0xaa6e('0x24')](function(){var _0x3e8e35=_0x5b2140[_0xaa6e('0x25')]({'plain':!![]});var _0x49bc47='ExtractedReports';return db[_0xaa6e('0x26')]['destroy']({'where':{'type':_0x49bc47,'resourceId':_0x3e8e35['id']}})['then'](function(){return _0x5b2140;});})[_0xaa6e('0x24')](function(){_0xa25acb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c6eee,_0x2ce130){return function(_0x491f18){if(!_0x491f18){_0x5c6eee[_0xaa6e('0x17')](0x194);}return _0x491f18;};}function handleError(_0x2ec4fa,_0x4209e5){_0x4209e5=_0x4209e5||0x1f4;return function(_0x121ecf){logger['error'](_0x121ecf['stack']);if(_0x121ecf[_0xaa6e('0x27')]){delete _0x121ecf['name'];}_0x2ec4fa[_0xaa6e('0x18')](_0x4209e5)[_0xaa6e('0x28')](_0x121ecf);};}exports[_0xaa6e('0x29')]=function(_0x3accd9,_0x5d8db1){var _0x745b80={},_0x293d0e={},_0x442f45={'count':0x0,'rows':[]};var _0x405556=_['map'](db[_0xaa6e('0x2a')][_0xaa6e('0x2b')],function(_0x4dce89){return{'name':_0x4dce89[_0xaa6e('0x2c')],'type':_0x4dce89[_0xaa6e('0x2d')]['key']};});_0x293d0e[_0xaa6e('0x2e')]=_[_0xaa6e('0x2f')](_0x405556,_0xaa6e('0x27'));_0x293d0e['query']=_[_0xaa6e('0x30')](_0x3accd9[_0xaa6e('0x31')]);_0x293d0e[_0xaa6e('0x32')]=_[_0xaa6e('0x33')](_0x293d0e[_0xaa6e('0x2e')],_0x293d0e[_0xaa6e('0x31')]);_0x745b80[_0xaa6e('0x34')]=_[_0xaa6e('0x33')](_0x293d0e[_0xaa6e('0x2e')],qs[_0xaa6e('0x35')](_0x3accd9[_0xaa6e('0x31')][_0xaa6e('0x35')]));_0x745b80[_0xaa6e('0x34')]=_0x745b80[_0xaa6e('0x34')][_0xaa6e('0x36')]?_0x745b80[_0xaa6e('0x34')]:_0x293d0e[_0xaa6e('0x2e')];if(!_0x3accd9[_0xaa6e('0x31')][_0xaa6e('0x37')]('nolimit')){_0x745b80['limit']=qs['limit'](_0x3accd9[_0xaa6e('0x31')][_0xaa6e('0x1c')]);_0x745b80['offset']=qs['offset'](_0x3accd9['query'][_0xaa6e('0x1a')]);}_0x745b80[_0xaa6e('0x38')]=qs[_0xaa6e('0x39')](_0x3accd9[_0xaa6e('0x31')][_0xaa6e('0x39')]);_0x745b80[_0xaa6e('0x3a')]=qs[_0xaa6e('0x32')](_['pick'](_0x3accd9[_0xaa6e('0x31')],_0x293d0e['filters']),_0x405556);if(_0x3accd9[_0xaa6e('0x31')][_0xaa6e('0x3b')]){_0x745b80[_0xaa6e('0x3a')]=_[_0xaa6e('0x3c')](_0x745b80[_0xaa6e('0x3a')],{'$or':_[_0xaa6e('0x2f')](_0x405556,function(_0x6bd6b6){if(_0x6bd6b6[_0xaa6e('0x2d')]!==_0xaa6e('0x3d')){var _0xf13f28={};_0xf13f28[_0x6bd6b6[_0xaa6e('0x27')]]={'$like':'%'+_0x3accd9[_0xaa6e('0x31')][_0xaa6e('0x3b')]+'%'};return _0xf13f28;}})});}_0x745b80=_[_0xaa6e('0x3c')]({},_0x745b80,_0x3accd9[_0xaa6e('0x3e')]);var _0x4866a5={'where':_0x745b80['where']};return db[_0xaa6e('0x2a')][_0xaa6e('0x1d')](_0x4866a5)[_0xaa6e('0x24')](function(_0x25ac16){_0x442f45[_0xaa6e('0x1d')]=_0x25ac16;if(_0x3accd9['query'][_0xaa6e('0x3f')]){_0x745b80[_0xaa6e('0x40')]=[{'all':!![]}];}return db[_0xaa6e('0x2a')][_0xaa6e('0x41')](_0x745b80);})[_0xaa6e('0x24')](function(_0x185411){_0x442f45[_0xaa6e('0x42')]=_0x185411;return _0x442f45;})[_0xaa6e('0x24')](respondWithFilteredResult(_0x5d8db1,_0x745b80))[_0xaa6e('0x43')](handleError(_0x5d8db1,null));};exports[_0xaa6e('0x44')]=function(_0x499ca5,_0x4e9633){var _0x21d716={'raw':!![],'where':{'id':_0x499ca5['params']['id']}},_0x23703c={};_0x23703c[_0xaa6e('0x2e')]=_[_0xaa6e('0x30')](db[_0xaa6e('0x2a')]['rawAttributes']);_0x23703c['query']=_['keys'](_0x499ca5[_0xaa6e('0x31')]);_0x23703c['filters']=_[_0xaa6e('0x33')](_0x23703c[_0xaa6e('0x2e')],_0x23703c[_0xaa6e('0x31')]);_0x21d716['attributes']=_[_0xaa6e('0x33')](_0x23703c[_0xaa6e('0x2e')],qs[_0xaa6e('0x35')](_0x499ca5[_0xaa6e('0x31')]['fields']));_0x21d716[_0xaa6e('0x34')]=_0x21d716[_0xaa6e('0x34')][_0xaa6e('0x36')]?_0x21d716[_0xaa6e('0x34')]:_0x23703c['model'];if(_0x499ca5[_0xaa6e('0x31')]['includeAll']){_0x21d716[_0xaa6e('0x40')]=[{'all':!![]}];}_0x21d716=_[_0xaa6e('0x3c')]({},_0x21d716,_0x499ca5[_0xaa6e('0x3e')]);return db[_0xaa6e('0x2a')][_0xaa6e('0x45')](_0x21d716)[_0xaa6e('0x24')](handleEntityNotFound(_0x4e9633,null))['then'](respondWithResult(_0x4e9633,null))['catch'](handleError(_0x4e9633,null));};exports[_0xaa6e('0x46')]=function(_0x5ed2e5,_0x35d7f0){return db[_0xaa6e('0x2a')][_0xaa6e('0x46')](_0x5ed2e5[_0xaa6e('0x47')],{})['then'](function(_0x59c79f){var _0x572b3a=_0x5ed2e5[_0xaa6e('0x48')][_0xaa6e('0x25')]({'plain':!![]});if(!_0x572b3a)throw new Error(_0xaa6e('0x49'));if(_0x572b3a[_0xaa6e('0x4a')]===_0xaa6e('0x48')){var _0x17427f=_0x59c79f[_0xaa6e('0x25')]({'plain':!![]});var _0x20aafe=_0xaa6e('0x4b');return db[_0xaa6e('0x4c')]['find']({'where':{'name':_0x20aafe,'userProfileId':_0x572b3a[_0xaa6e('0x4d')]},'raw':!![]})[_0xaa6e('0x24')](function(_0x5ec41b){if(_0x5ec41b&&_0x5ec41b[_0xaa6e('0x4e')]===0x0){return db[_0xaa6e('0x26')][_0xaa6e('0x46')]({'name':_0x17427f[_0xaa6e('0x27')],'resourceId':_0x17427f['id'],'type':_0x5ec41b[_0xaa6e('0x27')],'sectionId':_0x5ec41b['id']},{})['then'](function(){return _0x59c79f;});}else{return _0x59c79f;}})[_0xaa6e('0x43')](function(_0xf046ed){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf046ed);throw _0xf046ed;});}return _0x59c79f;})['then'](respondWithResult(_0x35d7f0,0xc9))['catch'](handleError(_0x35d7f0,null));};exports[_0xaa6e('0x23')]=function(_0x6013e5,_0x241fb5){if(_0x6013e5['body']['id']){delete _0x6013e5[_0xaa6e('0x47')]['id'];}return db[_0xaa6e('0x2a')][_0xaa6e('0x45')]({'where':{'id':_0x6013e5[_0xaa6e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x241fb5,null))['then'](saveUpdates(_0x6013e5['body'],null))[_0xaa6e('0x24')](respondWithResult(_0x241fb5,null))['catch'](handleError(_0x241fb5,null));};exports[_0xaa6e('0x50')]=function(_0x85ca37,_0x1be362){return db[_0xaa6e('0x2a')][_0xaa6e('0x45')]({'where':{'id':_0x85ca37['params']['id']}})[_0xaa6e('0x24')](handleEntityNotFound(_0x1be362,null))[_0xaa6e('0x24')](removeEntity(_0x1be362,null))[_0xaa6e('0x43')](handleError(_0x1be362,null));};exports[_0xaa6e('0x51')]=function(_0x4f38ab,_0x217f94,_0x2629f8){return db[_0xaa6e('0x2a')][_0xaa6e('0x45')]({'where':{'id':_0x4f38ab[_0xaa6e('0x4f')]['id']},'attributes':['name',_0xaa6e('0x52'),_0xaa6e('0x53'),_0xaa6e('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x217f94,null))['then'](function(_0x22ac28){if(_0x22ac28){if(!fs['existsSync'](path[_0xaa6e('0x55')](config['root'],'server/files/reports',_0x22ac28['savename']))){throw new db[(_0xaa6e('0x56'))][(_0xaa6e('0x57'))](_0xaa6e('0x58'));}if(_0x4f38ab[_0xaa6e('0x31')][_0xaa6e('0x59')]){return _0x217f94[_0xaa6e('0x17')](0xc8);}return _0x217f94[_0xaa6e('0x51')](path[_0xaa6e('0x55')](config['root'],'server/files/reports',_0x22ac28[_0xaa6e('0x53')]),util[_0xaa6e('0x5a')](_0xaa6e('0x5b'),_0x22ac28['basename']||_0x22ac28[_0xaa6e('0x27')],_0x22ac28[_0xaa6e('0x54')]['toLowerCase']()));}})['catch'](handleError(_0x217f94,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index d982ab8..796e56e 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 _0x449f=['exports','analytics_extracted_reports','lodash','util','moment','bluebird','request-promise','path','./analyticExtractedReport.attributes'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x449f,0xad));var _0xf449=function(_0x1f5a63,_0x511504){_0x1f5a63=_0x1f5a63-0x0;var _0x30bb7a=_0x449f[_0x1f5a63];return _0x30bb7a;};'use strict';var _=require(_0xf449('0x0'));var util=require(_0xf449('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf449('0x2'));var BPromise=require(_0xf449('0x3'));var rp=require(_0xf449('0x4'));var fs=require('fs');var path=require(_0xf449('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf449('0x6'));module[_0xf449('0x7')]=function(_0x5de9a9,_0x3d0c3c){return _0x5de9a9['define']('AnalyticExtractedReport',attributes,{'tableName':_0xf449('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x882b=['analytics_extracted_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes','exports'];(function(_0x1d18f8,_0x2ba9d2){var _0x29865b=function(_0x10ab45){while(--_0x10ab45){_0x1d18f8['push'](_0x1d18f8['shift']());}};_0x29865b(++_0x2ba9d2);}(_0x882b,0x64));var _0xb882=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x882b[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xb882('0x0'));var util=require('util');var logger=require(_0xb882('0x1'))(_0xb882('0x2'));var moment=require(_0xb882('0x3'));var BPromise=require(_0xb882('0x4'));var rp=require(_0xb882('0x5'));var fs=require('fs');var path=require(_0xb882('0x6'));var rimraf=require(_0xb882('0x7'));var config=require('../../config/environment');var attributes=require(_0xb882('0x8'));module[_0xb882('0x9')]=function(_0x27073d,_0x2a97d5){return _0x27073d['define']('AnalyticExtractedReport',attributes,{'tableName':_0xb882('0xa'),'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 8da1465..24c573d 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 _0x7a02=['result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5e0e17,_0xa13ec9){var _0x8c5ed7=function(_0x76a23f){while(--_0x76a23f){_0x5e0e17['push'](_0x5e0e17['shift']());}};_0x8c5ed7(++_0xa13ec9);}(_0x7a02,0x1ba));var _0x27a0=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x7a02[_0x20ef64];return _0x3707d8;};'use strict';var _=require('lodash');var util=require(_0x27a0('0x0'));var moment=require(_0x27a0('0x1'));var BPromise=require(_0x27a0('0x2'));var rs=require(_0x27a0('0x3'));var fs=require('fs');var Redis=require(_0x27a0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x27a0('0x5'));var logger=require(_0x27a0('0x6'))(_0x27a0('0x7'));var config=require(_0x27a0('0x8'));var jayson=require(_0x27a0('0x9'));var client=jayson[_0x27a0('0xa')][_0x27a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3eb307,_0x6c29f9,_0x4362){return new BPromise(function(_0x372490,_0x41fd6d){return client[_0x27a0('0xc')](_0x3eb307,_0x4362)['then'](function(_0x2fee39){logger[_0x27a0('0xd')](_0x27a0('0xe'),_0x6c29f9,_0x27a0('0xf'));logger['debug'](_0x27a0('0x10'),_0x6c29f9,_0x27a0('0xf'),JSON['stringify'](_0x2fee39));if(_0x2fee39['error']){if(_0x2fee39[_0x27a0('0x11')][_0x27a0('0x12')]===0x1f4){logger[_0x27a0('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x6c29f9,_0x2fee39[_0x27a0('0x11')][_0x27a0('0x13')]);return _0x41fd6d(_0x2fee39[_0x27a0('0x11')][_0x27a0('0x13')]);}logger[_0x27a0('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x6c29f9,_0x2fee39['error'][_0x27a0('0x13')]);return _0x372490(_0x2fee39[_0x27a0('0x11')]['message']);}else{logger[_0x27a0('0xd')](_0x27a0('0xe'),_0x6c29f9,'request\x20sent');_0x372490(_0x2fee39[_0x27a0('0x14')]['message']);}})[_0x27a0('0x15')](function(_0x6641dc){logger[_0x27a0('0x11')](_0x27a0('0xe'),_0x6c29f9,_0x6641dc);_0x41fd6d(_0x6641dc);});});} \ No newline at end of file +var _0xe097=['request','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0xd13a88,_0x3c5269){var _0x1c993c=function(_0x245af5){while(--_0x245af5){_0xd13a88['push'](_0xd13a88['shift']());}};_0x1c993c(++_0x3c5269);}(_0xe097,0x186));var _0x7e09=function(_0x28ded1,_0x6c21ef){_0x28ded1=_0x28ded1-0x0;var _0x3ea86e=_0xe097[_0x28ded1];return _0x3ea86e;};'use strict';var _=require(_0x7e09('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7e09('0x1'));var rs=require(_0x7e09('0x2'));var fs=require('fs');var Redis=require(_0x7e09('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e09('0x4'));var logger=require(_0x7e09('0x5'))(_0x7e09('0x6'));var config=require('../../config/environment');var jayson=require(_0x7e09('0x7'));var client=jayson[_0x7e09('0x8')][_0x7e09('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x216fc0,_0x2f2698,_0x11bd93){return new BPromise(function(_0x49cac2,_0x50c0da){return client[_0x7e09('0xa')](_0x216fc0,_0x11bd93)['then'](function(_0x35c1af){logger['info'](_0x7e09('0xb'),_0x2f2698,'request\x20sent');logger['debug'](_0x7e09('0xc'),_0x2f2698,_0x7e09('0xd'),JSON[_0x7e09('0xe')](_0x35c1af));if(_0x35c1af[_0x7e09('0xf')]){if(_0x35c1af[_0x7e09('0xf')][_0x7e09('0x10')]===0x1f4){logger[_0x7e09('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2f2698,_0x35c1af[_0x7e09('0xf')][_0x7e09('0x11')]);return _0x50c0da(_0x35c1af[_0x7e09('0xf')]['message']);}logger[_0x7e09('0xf')](_0x7e09('0xb'),_0x2f2698,_0x35c1af[_0x7e09('0xf')][_0x7e09('0x11')]);return _0x49cac2(_0x35c1af[_0x7e09('0xf')][_0x7e09('0x11')]);}else{logger[_0x7e09('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2f2698,'request\x20sent');_0x49cac2(_0x35c1af[_0x7e09('0x13')][_0x7e09('0x11')]);}})['catch'](function(_0x51737a){logger['error'](_0x7e09('0xb'),_0x2f2698,_0x51737a);_0x50c0da(_0x51737a);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index e17d1c3..c69289b 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 _0xb95f=['show','/:id/download','post','put','update','delete','destroy','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0xb95f,0x1f4));var _0xfb95=function(_0x9df708,_0x1ee261){_0x9df708=_0x9df708-0x0;var _0x4cb479=_0xb95f[_0x9df708];return _0x4cb479;};'use strict';var multer=require('multer');var util=require(_0xfb95('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfb95('0x1')]();var fs_extra=require(_0xfb95('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfb95('0x3'));var config=require(_0xfb95('0x4'));var controller=require(_0xfb95('0x5'));router[_0xfb95('0x6')]('/',auth[_0xfb95('0x7')](),controller[_0xfb95('0x8')]);router['get'](_0xfb95('0x9'),auth[_0xfb95('0x7')](),controller[_0xfb95('0xa')]);router[_0xfb95('0x6')](_0xfb95('0xb'),auth[_0xfb95('0x7')](),controller['download']);router[_0xfb95('0xc')]('/',auth[_0xfb95('0x7')](),controller['create']);router[_0xfb95('0xd')](_0xfb95('0x9'),auth[_0xfb95('0x7')](),controller[_0xfb95('0xe')]);router[_0xfb95('0xf')]('/:id',auth[_0xfb95('0x7')](),controller[_0xfb95('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6e20=['index','isAuthenticated','show','/:id/download','download','post','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x5098f3,_0x32a027){var _0x28557e=function(_0x43aeca){while(--_0x43aeca){_0x5098f3['push'](_0x5098f3['shift']());}};_0x28557e(++_0x32a027);}(_0x6e20,0xac));var _0x06e2=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x6e20[_0x2b7764];return _0x848dcb;};'use strict';var multer=require(_0x06e2('0x0'));var util=require(_0x06e2('0x1'));var path=require(_0x06e2('0x2'));var timeout=require(_0x06e2('0x3'));var express=require(_0x06e2('0x4'));var router=express[_0x06e2('0x5')]();var fs_extra=require(_0x06e2('0x6'));var auth=require(_0x06e2('0x7'));var interaction=require(_0x06e2('0x8'));var config=require(_0x06e2('0x9'));var controller=require(_0x06e2('0xa'));router[_0x06e2('0xb')]('/',auth['isAuthenticated'](),controller[_0x06e2('0xc')]);router['get']('/:id',auth[_0x06e2('0xd')](),controller[_0x06e2('0xe')]);router[_0x06e2('0xb')](_0x06e2('0xf'),auth['isAuthenticated'](),controller[_0x06e2('0x10')]);router[_0x06e2('0x11')]('/',auth[_0x06e2('0xd')](),controller[_0x06e2('0x12')]);router['put'](_0x06e2('0x13'),auth['isAuthenticated'](),controller[_0x06e2('0x14')]);router[_0x06e2('0x15')]('/:id',auth[_0x06e2('0xd')](),controller['destroy']);module[_0x06e2('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 812eb27..edc622e 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 _0xbe59=['TEXT','STRING','BOOLEAN','exports'];(function(_0x2ef8ba,_0x18404d){var _0x2c0a03=function(_0x2d835f){while(--_0x2d835f){_0x2ef8ba['push'](_0x2ef8ba['shift']());}};_0x2c0a03(++_0x18404d);}(_0xbe59,0x137));var _0x9be5=function(_0x2d2921,_0x1b8154){_0x2d2921=_0x2d2921-0x0;var _0x1b876d=_0xbe59[_0x2d2921];return _0x1b876d;};'use strict';var Sequelize=require('sequelize');module[_0x9be5('0x0')]={'field':{'type':Sequelize[_0x9be5('0x1')]},'alias':{'type':Sequelize[_0x9be5('0x2')]},'function':{'type':Sequelize[_0x9be5('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x9be5('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x9be5('0x2')]},'custom':{'type':Sequelize[_0x9be5('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xcf71=['TEXT','STRING','BOOLEAN'];(function(_0x5b7cb5,_0x2dc0bd){var _0x34985b=function(_0x489e3d){while(--_0x489e3d){_0x5b7cb5['push'](_0x5b7cb5['shift']());}};_0x34985b(++_0x2dc0bd);}(_0xcf71,0x7e));var _0x1cf7=function(_0xdbbb14,_0x140263){_0xdbbb14=_0xdbbb14-0x0;var _0x3c3585=_0xcf71[_0xdbbb14];return _0x3c3585;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize[_0x1cf7('0x0')]},'alias':{'type':Sequelize[_0x1cf7('0x1')]},'function':{'type':Sequelize[_0x1cf7('0x1')]},'format':{'type':Sequelize[_0x1cf7('0x1')]},'groupBy':{'type':Sequelize[_0x1cf7('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1cf7('0x1')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index c126161..491bf94 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 _0x2c8a=['keys','create','body','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','count','offset','set','Content-Range','apply','save','then','destroy','sendStatus','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','pick','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x2a3c0a,_0x163f5c){var _0x1703a2=function(_0x471dfe){while(--_0x471dfe){_0x2a3c0a['push'](_0x2a3c0a['shift']());}};_0x1703a2(++_0x163f5c);}(_0x2c8a,0xb7));var _0xa2c8=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x2c8a[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0xa2c8('0x0'));var rimraf=require(_0xa2c8('0x1'));var zipdir=require(_0xa2c8('0x2'));var jsonpatch=require(_0xa2c8('0x3'));var rp=require(_0xa2c8('0x4'));var moment=require(_0xa2c8('0x5'));var BPromise=require(_0xa2c8('0x6'));var Mustache=require(_0xa2c8('0x7'));var util=require(_0xa2c8('0x8'));var path=require(_0xa2c8('0x9'));var sox=require(_0xa2c8('0xa'));var csv=require(_0xa2c8('0xb'));var ejs=require(_0xa2c8('0xc'));var fs=require('fs');var fs_extra=require(_0xa2c8('0xd'));var _=require('lodash');var squel=require(_0xa2c8('0xe'));var crypto=require('crypto');var jsforce=require(_0xa2c8('0xf'));var deskjs=require(_0xa2c8('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa2c8('0x11'));var Papa=require(_0xa2c8('0x12'));var Redis=require(_0xa2c8('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa2c8('0x14'));var hardwareService=require(_0xa2c8('0x15'));var logger=require('../../config/logger')(_0xa2c8('0x16'));var utils=require(_0xa2c8('0x17'));var config=require(_0xa2c8('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa2c8('0x19'))['db'];function respondWithStatusCode(_0x3d92a6,_0x62c887){_0x62c887=_0x62c887||0xcc;return function(_0x591961){if(_0x591961){return _0x3d92a6['sendStatus'](_0x62c887);}return _0x3d92a6[_0xa2c8('0x1a')](_0x62c887)[_0xa2c8('0x1b')]();};}function respondWithResult(_0x3a12eb,_0x4b96e3){_0x4b96e3=_0x4b96e3||0xc8;return function(_0x445159){if(_0x445159){return _0x3a12eb[_0xa2c8('0x1a')](_0x4b96e3)[_0xa2c8('0x1c')](_0x445159);}};}function respondWithFilteredResult(_0x197ae8,_0x1dcee5){return function(_0x6c5d0e){if(_0x6c5d0e){var _0x1dbff7=typeof _0x1dcee5['offset']===_0xa2c8('0x1d')&&typeof _0x1dcee5['limit']==='undefined';var _0x372744=_0x6c5d0e[_0xa2c8('0x1e')];var _0x2e55db=_0x1dbff7?0x0:_0x1dcee5[_0xa2c8('0x1f')];var _0xffde35=_0x1dbff7?_0x6c5d0e[_0xa2c8('0x1e')]:_0x1dcee5[_0xa2c8('0x1f')]+_0x1dcee5['limit'];var _0x4d2d21;if(_0xffde35>=_0x372744){_0xffde35=_0x372744;_0x4d2d21=0xc8;}else{_0x4d2d21=0xce;}_0x197ae8['status'](_0x4d2d21);return _0x197ae8[_0xa2c8('0x20')](_0xa2c8('0x21'),_0x2e55db+'-'+_0xffde35+'/'+_0x372744)[_0xa2c8('0x1c')](_0x6c5d0e);}return null;};}function patchUpdates(_0x3c5611){return function(_0x546b22){try{jsonpatch[_0xa2c8('0x22')](_0x546b22,_0x3c5611,!![]);}catch(_0x51281f){return BPromise['reject'](_0x51281f);}return _0x546b22[_0xa2c8('0x23')]();};}function saveUpdates(_0x3e80ae,_0xd074f5){return function(_0x4d02e3){if(_0x4d02e3){return _0x4d02e3['update'](_0x3e80ae)[_0xa2c8('0x24')](function(_0x4f26cc){return _0x4f26cc;});}return null;};}function removeEntity(_0x271722,_0x37eabd){return function(_0x3eeee4){if(_0x3eeee4){return _0x3eeee4[_0xa2c8('0x25')]()[_0xa2c8('0x24')](function(){_0x271722[_0xa2c8('0x1a')](0xcc)[_0xa2c8('0x1b')]();});}};}function handleEntityNotFound(_0x49a737,_0xae9c){return function(_0x4e53f5){if(!_0x4e53f5){_0x49a737[_0xa2c8('0x26')](0x194);}return _0x4e53f5;};}function handleError(_0x240fd9,_0x2c60f1){_0x2c60f1=_0x2c60f1||0x1f4;return function(_0x24983a){logger[_0xa2c8('0x27')](_0x24983a['stack']);if(_0x24983a[_0xa2c8('0x28')]){delete _0x24983a[_0xa2c8('0x28')];}_0x240fd9[_0xa2c8('0x1a')](_0x2c60f1)[_0xa2c8('0x29')](_0x24983a);};}exports[_0xa2c8('0x2a')]=function(_0x14af14,_0x5b2485){var _0x9f55de={},_0x30132e={},_0x2ce217={'count':0x0,'rows':[]};var _0x4a76dc=_[_0xa2c8('0x2b')](db[_0xa2c8('0x2c')][_0xa2c8('0x2d')],function(_0x1bd49b){return{'name':_0x1bd49b[_0xa2c8('0x2e')],'type':_0x1bd49b[_0xa2c8('0x2f')][_0xa2c8('0x30')]};});_0x30132e[_0xa2c8('0x31')]=_[_0xa2c8('0x2b')](_0x4a76dc,'name');_0x30132e[_0xa2c8('0x32')]=_['keys'](_0x14af14[_0xa2c8('0x32')]);_0x30132e[_0xa2c8('0x33')]=_['intersection'](_0x30132e[_0xa2c8('0x31')],_0x30132e[_0xa2c8('0x32')]);_0x9f55de[_0xa2c8('0x34')]=_[_0xa2c8('0x35')](_0x30132e[_0xa2c8('0x31')],qs['fields'](_0x14af14[_0xa2c8('0x32')][_0xa2c8('0x36')]));_0x9f55de[_0xa2c8('0x34')]=_0x9f55de[_0xa2c8('0x34')][_0xa2c8('0x37')]?_0x9f55de[_0xa2c8('0x34')]:_0x30132e[_0xa2c8('0x31')];if(!_0x14af14[_0xa2c8('0x32')][_0xa2c8('0x38')]('nolimit')){_0x9f55de[_0xa2c8('0x39')]=qs[_0xa2c8('0x39')](_0x14af14[_0xa2c8('0x32')]['limit']);_0x9f55de[_0xa2c8('0x1f')]=qs['offset'](_0x14af14[_0xa2c8('0x32')][_0xa2c8('0x1f')]);}_0x9f55de[_0xa2c8('0x3a')]=qs[_0xa2c8('0x3b')](_0x14af14[_0xa2c8('0x32')][_0xa2c8('0x3b')]);_0x9f55de['where']=qs['filters'](_[_0xa2c8('0x3c')](_0x14af14[_0xa2c8('0x32')],_0x30132e[_0xa2c8('0x33')]),_0x4a76dc);if(_0x14af14[_0xa2c8('0x32')]['filter']){_0x9f55de['where']=_[_0xa2c8('0x3d')](_0x9f55de[_0xa2c8('0x3e')],{'$or':_[_0xa2c8('0x2b')](_0x4a76dc,function(_0x40b7ad){if(_0x40b7ad[_0xa2c8('0x2f')]!==_0xa2c8('0x3f')){var _0x1513f2={};_0x1513f2[_0x40b7ad[_0xa2c8('0x28')]]={'$like':'%'+_0x14af14[_0xa2c8('0x32')]['filter']+'%'};return _0x1513f2;}})});}_0x9f55de=_['merge']({},_0x9f55de,_0x14af14[_0xa2c8('0x40')]);var _0x3c46ca={'where':_0x9f55de['where']};return db[_0xa2c8('0x2c')][_0xa2c8('0x1e')](_0x3c46ca)[_0xa2c8('0x24')](function(_0x473596){_0x2ce217[_0xa2c8('0x1e')]=_0x473596;if(_0x14af14['query'][_0xa2c8('0x41')]){_0x9f55de[_0xa2c8('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xa2c8('0x43')](_0x9f55de);})[_0xa2c8('0x24')](function(_0x57cef4){_0x2ce217[_0xa2c8('0x44')]=_0x57cef4;return _0x2ce217;})['then'](respondWithFilteredResult(_0x5b2485,_0x9f55de))[_0xa2c8('0x45')](handleError(_0x5b2485,null));};exports[_0xa2c8('0x46')]=function(_0x3c7266,_0x16b217){var _0x284d83={'raw':![],'where':{'id':_0x3c7266[_0xa2c8('0x47')]['id']}},_0xf5f8a={};_0xf5f8a[_0xa2c8('0x31')]=_[_0xa2c8('0x48')](db[_0xa2c8('0x2c')][_0xa2c8('0x2d')]);_0xf5f8a[_0xa2c8('0x32')]=_[_0xa2c8('0x48')](_0x3c7266[_0xa2c8('0x32')]);_0xf5f8a[_0xa2c8('0x33')]=_[_0xa2c8('0x35')](_0xf5f8a['model'],_0xf5f8a['query']);_0x284d83[_0xa2c8('0x34')]=_[_0xa2c8('0x35')](_0xf5f8a[_0xa2c8('0x31')],qs[_0xa2c8('0x36')](_0x3c7266[_0xa2c8('0x32')][_0xa2c8('0x36')]));_0x284d83[_0xa2c8('0x34')]=_0x284d83[_0xa2c8('0x34')]['length']?_0x284d83[_0xa2c8('0x34')]:_0xf5f8a[_0xa2c8('0x31')];if(_0x3c7266['query'][_0xa2c8('0x41')]){_0x284d83[_0xa2c8('0x42')]=[{'all':!![]}];}_0x284d83=_['merge']({},_0x284d83,_0x3c7266['options']);return db[_0xa2c8('0x2c')]['find'](_0x284d83)[_0xa2c8('0x24')](handleEntityNotFound(_0x16b217,null))[_0xa2c8('0x24')](respondWithResult(_0x16b217,null))[_0xa2c8('0x45')](handleError(_0x16b217,null));};exports[_0xa2c8('0x49')]=function(_0x5b39f3,_0x47d1bb){return db[_0xa2c8('0x2c')]['create'](_0x5b39f3['body'],{})[_0xa2c8('0x24')](respondWithResult(_0x47d1bb,0xc9))[_0xa2c8('0x45')](handleError(_0x47d1bb,null));};exports['bulkCreate']=function(_0x36017a,_0x472706){return db['AnalyticFieldReport']['bulkCreate'](_0x36017a[_0xa2c8('0x4a')],{'raw':![],'individualHooks':!![]})[_0xa2c8('0x24')](respondWithResult(_0x472706,0xc9))[_0xa2c8('0x45')](handleError(_0x472706,null));};exports[_0xa2c8('0x4b')]=function(_0x5da84c,_0x32167b){if(_0x5da84c[_0xa2c8('0x4a')]['id']){delete _0x5da84c[_0xa2c8('0x4a')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x5da84c[_0xa2c8('0x47')]['id']}})[_0xa2c8('0x24')](handleEntityNotFound(_0x32167b,null))[_0xa2c8('0x24')](saveUpdates(_0x5da84c[_0xa2c8('0x4a')],null))['then'](respondWithResult(_0x32167b,null))[_0xa2c8('0x45')](handleError(_0x32167b,null));};exports[_0xa2c8('0x25')]=function(_0x17e7b5,_0x25d9ad){return db['AnalyticFieldReport']['find']({'where':{'id':_0x17e7b5[_0xa2c8('0x47')]['id']}})[_0xa2c8('0x24')](handleEntityNotFound(_0x25d9ad,null))[_0xa2c8('0x24')](removeEntity(_0x25d9ad,null))['catch'](handleError(_0x25d9ad,null));};exports[_0xa2c8('0x4c')]=function(_0x2df1c1,_0x58d048){return db[_0xa2c8('0x2c')]['destroy']({'where':{'id':_0x2df1c1[_0xa2c8('0x32')][_0xa2c8('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0xa2c8('0x24')](respondWithResult(_0x58d048,0xcc))[_0xa2c8('0x45')](handleError(_0x58d048,null));};exports[_0xa2c8('0x4e')]=function(_0x2266cf,_0x5575a7,_0x1b37bf){return db[_0xa2c8('0x4f')][_0xa2c8('0x50')]({'where':{'id':_0x2266cf[_0xa2c8('0x47')]['id']}})[_0xa2c8('0x24')](handleEntityNotFound(_0x5575a7,null))[_0xa2c8('0x24')](function(_0x245b68){if(_0x245b68){return db[_0xa2c8('0x51')][_0xa2c8('0x52')](function(_0x2f331e){return db[_0xa2c8('0x2c')][_0xa2c8('0x25')]({'where':{'CustomReportId':_0x2266cf[_0xa2c8('0x47')]['id']},'transaction':_0x2f331e})[_0xa2c8('0x24')](function(_0x4a9f6a){var _0x2c9105=_[_0xa2c8('0x2b')](_0x2266cf['body'],function(_0x221674){delete _0x221674['id'];_0x221674[_0xa2c8('0x53')]=_0x2266cf[_0xa2c8('0x47')]['id'];return _0x221674;});return db[_0xa2c8('0x2c')][_0xa2c8('0x54')](_0x2c9105,{'transaction':_0x2f331e});});})['then'](function(){return db[_0xa2c8('0x2c')][_0xa2c8('0x43')]({'where':{'CustomReportId':_0x2266cf['params']['id']}});});}})[_0xa2c8('0x24')](respondWithResult(_0x5575a7,null))[_0xa2c8('0x45')](handleError(_0x5575a7,null));}; \ No newline at end of file +var _0x87de=['length','options','create','body','bulkCreate','find','bulkDestroy','ids','addFields','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','name','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys'];(function(_0x3a72a3,_0x5679ee){var _0x5588bb=function(_0x4eb76d){while(--_0x4eb76d){_0x3a72a3['push'](_0x3a72a3['shift']());}};_0x5588bb(++_0x5679ee);}(_0x87de,0xf9));var _0xe87d=function(_0x10c358,_0x76c981){_0x10c358=_0x10c358-0x0;var _0x40c343=_0x87de[_0x10c358];return _0x40c343;};'use strict';var emlformat=require(_0xe87d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe87d('0x1'));var jsonpatch=require(_0xe87d('0x2'));var rp=require(_0xe87d('0x3'));var moment=require(_0xe87d('0x4'));var BPromise=require(_0xe87d('0x5'));var Mustache=require(_0xe87d('0x6'));var util=require(_0xe87d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe87d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe87d('0x9'));var _=require(_0xe87d('0xa'));var squel=require(_0xe87d('0xb'));var crypto=require('crypto');var jsforce=require(_0xe87d('0xc'));var deskjs=require(_0xe87d('0xd'));var toCsv=require(_0xe87d('0x8'));var querystring=require(_0xe87d('0xe'));var Papa=require(_0xe87d('0xf'));var Redis=require(_0xe87d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe87d('0x11'));var logger=require(_0xe87d('0x12'))(_0xe87d('0x13'));var utils=require('../../config/utils');var config=require(_0xe87d('0x14'));var licenseUtil=require(_0xe87d('0x15'));var db=require(_0xe87d('0x16'))['db'];function respondWithStatusCode(_0x4b3b87,_0x175f81){_0x175f81=_0x175f81||0xcc;return function(_0x428a14){if(_0x428a14){return _0x4b3b87[_0xe87d('0x17')](_0x175f81);}return _0x4b3b87['status'](_0x175f81)['end']();};}function respondWithResult(_0x576e2e,_0x2dfb50){_0x2dfb50=_0x2dfb50||0xc8;return function(_0x226447){if(_0x226447){return _0x576e2e[_0xe87d('0x18')](_0x2dfb50)['json'](_0x226447);}};}function respondWithFilteredResult(_0x4fc9a2,_0x21802d){return function(_0x36fa7a){if(_0x36fa7a){var _0x31a813=typeof _0x21802d[_0xe87d('0x19')]==='undefined'&&typeof _0x21802d[_0xe87d('0x1a')]===_0xe87d('0x1b');var _0x516b9d=_0x36fa7a[_0xe87d('0x1c')];var _0x1ed3a=_0x31a813?0x0:_0x21802d['offset'];var _0x5833cf=_0x31a813?_0x36fa7a['count']:_0x21802d[_0xe87d('0x19')]+_0x21802d[_0xe87d('0x1a')];var _0x54bd8a;if(_0x5833cf>=_0x516b9d){_0x5833cf=_0x516b9d;_0x54bd8a=0xc8;}else{_0x54bd8a=0xce;}_0x4fc9a2[_0xe87d('0x18')](_0x54bd8a);return _0x4fc9a2[_0xe87d('0x1d')](_0xe87d('0x1e'),_0x1ed3a+'-'+_0x5833cf+'/'+_0x516b9d)[_0xe87d('0x1f')](_0x36fa7a);}return null;};}function patchUpdates(_0xbf99bd){return function(_0x183e4d){try{jsonpatch[_0xe87d('0x20')](_0x183e4d,_0xbf99bd,!![]);}catch(_0x10259a){return BPromise['reject'](_0x10259a);}return _0x183e4d[_0xe87d('0x21')]();};}function saveUpdates(_0x1fc19b,_0x23c4c8){return function(_0x175031){if(_0x175031){return _0x175031[_0xe87d('0x22')](_0x1fc19b)[_0xe87d('0x23')](function(_0x2ff5bf){return _0x2ff5bf;});}return null;};}function removeEntity(_0x39edc0,_0x2b7449){return function(_0x298662){if(_0x298662){return _0x298662[_0xe87d('0x24')]()[_0xe87d('0x23')](function(){_0x39edc0[_0xe87d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8c3228,_0x5cbccd){return function(_0x223f41){if(!_0x223f41){_0x8c3228[_0xe87d('0x17')](0x194);}return _0x223f41;};}function handleError(_0x3e0c3c,_0x229048){_0x229048=_0x229048||0x1f4;return function(_0x541110){logger['error'](_0x541110['stack']);if(_0x541110['name']){delete _0x541110[_0xe87d('0x25')];}_0x3e0c3c['status'](_0x229048)['send'](_0x541110);};}exports['index']=function(_0x201fa3,_0x16462c){var _0x36d252={},_0x43c748={},_0x15d418={'count':0x0,'rows':[]};var _0x3b9c36=_[_0xe87d('0x26')](db[_0xe87d('0x27')][_0xe87d('0x28')],function(_0x4e5acf){return{'name':_0x4e5acf[_0xe87d('0x29')],'type':_0x4e5acf[_0xe87d('0x2a')][_0xe87d('0x2b')]};});_0x43c748[_0xe87d('0x2c')]=_[_0xe87d('0x26')](_0x3b9c36,'name');_0x43c748['query']=_['keys'](_0x201fa3[_0xe87d('0x2d')]);_0x43c748[_0xe87d('0x2e')]=_[_0xe87d('0x2f')](_0x43c748['model'],_0x43c748['query']);_0x36d252[_0xe87d('0x30')]=_[_0xe87d('0x2f')](_0x43c748[_0xe87d('0x2c')],qs['fields'](_0x201fa3[_0xe87d('0x2d')][_0xe87d('0x31')]));_0x36d252['attributes']=_0x36d252[_0xe87d('0x30')]['length']?_0x36d252[_0xe87d('0x30')]:_0x43c748[_0xe87d('0x2c')];if(!_0x201fa3[_0xe87d('0x2d')][_0xe87d('0x32')](_0xe87d('0x33'))){_0x36d252[_0xe87d('0x1a')]=qs[_0xe87d('0x1a')](_0x201fa3[_0xe87d('0x2d')]['limit']);_0x36d252[_0xe87d('0x19')]=qs[_0xe87d('0x19')](_0x201fa3[_0xe87d('0x2d')][_0xe87d('0x19')]);}_0x36d252[_0xe87d('0x34')]=qs[_0xe87d('0x35')](_0x201fa3[_0xe87d('0x2d')][_0xe87d('0x35')]);_0x36d252[_0xe87d('0x36')]=qs['filters'](_[_0xe87d('0x37')](_0x201fa3[_0xe87d('0x2d')],_0x43c748[_0xe87d('0x2e')]),_0x3b9c36);if(_0x201fa3[_0xe87d('0x2d')][_0xe87d('0x38')]){_0x36d252[_0xe87d('0x36')]=_[_0xe87d('0x39')](_0x36d252[_0xe87d('0x36')],{'$or':_[_0xe87d('0x26')](_0x3b9c36,function(_0x109bf0){if(_0x109bf0['type']!==_0xe87d('0x3a')){var _0x9c4ed3={};_0x9c4ed3[_0x109bf0[_0xe87d('0x25')]]={'$like':'%'+_0x201fa3[_0xe87d('0x2d')][_0xe87d('0x38')]+'%'};return _0x9c4ed3;}})});}_0x36d252=_['merge']({},_0x36d252,_0x201fa3['options']);var _0x1b763b={'where':_0x36d252[_0xe87d('0x36')]};return db[_0xe87d('0x27')][_0xe87d('0x1c')](_0x1b763b)['then'](function(_0xf108ae){_0x15d418[_0xe87d('0x1c')]=_0xf108ae;if(_0x201fa3[_0xe87d('0x2d')][_0xe87d('0x3b')]){_0x36d252[_0xe87d('0x3c')]=[{'all':!![]}];}return db[_0xe87d('0x27')][_0xe87d('0x3d')](_0x36d252);})[_0xe87d('0x23')](function(_0x254d87){_0x15d418[_0xe87d('0x3e')]=_0x254d87;return _0x15d418;})['then'](respondWithFilteredResult(_0x16462c,_0x36d252))[_0xe87d('0x3f')](handleError(_0x16462c,null));};exports[_0xe87d('0x40')]=function(_0x41086e,_0x3424a4){var _0x26ab89={'raw':![],'where':{'id':_0x41086e[_0xe87d('0x41')]['id']}},_0x4bbbba={};_0x4bbbba[_0xe87d('0x2c')]=_[_0xe87d('0x42')](db[_0xe87d('0x27')][_0xe87d('0x28')]);_0x4bbbba[_0xe87d('0x2d')]=_['keys'](_0x41086e['query']);_0x4bbbba[_0xe87d('0x2e')]=_[_0xe87d('0x2f')](_0x4bbbba['model'],_0x4bbbba[_0xe87d('0x2d')]);_0x26ab89[_0xe87d('0x30')]=_[_0xe87d('0x2f')](_0x4bbbba[_0xe87d('0x2c')],qs[_0xe87d('0x31')](_0x41086e['query'][_0xe87d('0x31')]));_0x26ab89['attributes']=_0x26ab89['attributes'][_0xe87d('0x43')]?_0x26ab89[_0xe87d('0x30')]:_0x4bbbba['model'];if(_0x41086e['query']['includeAll']){_0x26ab89[_0xe87d('0x3c')]=[{'all':!![]}];}_0x26ab89=_[_0xe87d('0x39')]({},_0x26ab89,_0x41086e[_0xe87d('0x44')]);return db[_0xe87d('0x27')]['find'](_0x26ab89)[_0xe87d('0x23')](handleEntityNotFound(_0x3424a4,null))[_0xe87d('0x23')](respondWithResult(_0x3424a4,null))[_0xe87d('0x3f')](handleError(_0x3424a4,null));};exports[_0xe87d('0x45')]=function(_0x1dca58,_0x4d3299){return db['AnalyticFieldReport'][_0xe87d('0x45')](_0x1dca58[_0xe87d('0x46')],{})['then'](respondWithResult(_0x4d3299,0xc9))[_0xe87d('0x3f')](handleError(_0x4d3299,null));};exports[_0xe87d('0x47')]=function(_0xaf587,_0x350108){return db[_0xe87d('0x27')][_0xe87d('0x47')](_0xaf587[_0xe87d('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x350108,0xc9))[_0xe87d('0x3f')](handleError(_0x350108,null));};exports['update']=function(_0x592eaf,_0x4629d8){if(_0x592eaf[_0xe87d('0x46')]['id']){delete _0x592eaf['body']['id'];}return db[_0xe87d('0x27')][_0xe87d('0x48')]({'where':{'id':_0x592eaf[_0xe87d('0x41')]['id']}})[_0xe87d('0x23')](handleEntityNotFound(_0x4629d8,null))['then'](saveUpdates(_0x592eaf['body'],null))[_0xe87d('0x23')](respondWithResult(_0x4629d8,null))['catch'](handleError(_0x4629d8,null));};exports[_0xe87d('0x24')]=function(_0x2ce2c8,_0x1d9d0b){return db[_0xe87d('0x27')][_0xe87d('0x48')]({'where':{'id':_0x2ce2c8[_0xe87d('0x41')]['id']}})[_0xe87d('0x23')](handleEntityNotFound(_0x1d9d0b,null))[_0xe87d('0x23')](removeEntity(_0x1d9d0b,null))['catch'](handleError(_0x1d9d0b,null));};exports[_0xe87d('0x49')]=function(_0x8bdfc6,_0x383de7){return db['AnalyticFieldReport'][_0xe87d('0x24')]({'where':{'id':_0x8bdfc6[_0xe87d('0x2d')][_0xe87d('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xe87d('0x23')](respondWithResult(_0x383de7,0xcc))['catch'](handleError(_0x383de7,null));};exports[_0xe87d('0x4b')]=function(_0x2bf5ad,_0x16ab9e,_0x5c101f){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x2bf5ad[_0xe87d('0x41')]['id']}})[_0xe87d('0x23')](handleEntityNotFound(_0x16ab9e,null))[_0xe87d('0x23')](function(_0x4e2a9e){if(_0x4e2a9e){return db[_0xe87d('0x4c')][_0xe87d('0x4d')](function(_0x31fde0){return db['AnalyticFieldReport'][_0xe87d('0x24')]({'where':{'CustomReportId':_0x2bf5ad[_0xe87d('0x41')]['id']},'transaction':_0x31fde0})[_0xe87d('0x23')](function(_0x4079b9){var _0x2eb7f1=_['map'](_0x2bf5ad[_0xe87d('0x46')],function(_0x555445){delete _0x555445['id'];_0x555445[_0xe87d('0x4e')]=_0x2bf5ad['params']['id'];return _0x555445;});return db[_0xe87d('0x27')][_0xe87d('0x47')](_0x2eb7f1,{'transaction':_0x31fde0});});})[_0xe87d('0x23')](function(){return db['AnalyticFieldReport'][_0xe87d('0x3d')]({'where':{'CustomReportId':_0x2bf5ad['params']['id']}});});}})['then'](respondWithResult(_0x16ab9e,null))['catch'](handleError(_0x16ab9e,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index bd36ab9..66ac96a 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 _0x4fb0=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x5c525d,_0xb12158){var _0x4dbccf=function(_0x5d20ef){while(--_0x5d20ef){_0x5c525d['push'](_0x5c525d['shift']());}};_0x4dbccf(++_0xb12158);}(_0x4fb0,0x145));var _0x04fb=function(_0x35d8f,_0x22baca){_0x35d8f=_0x35d8f-0x0;var _0x25f81a=_0x4fb0[_0x35d8f];return _0x25f81a;};'use strict';var _=require(_0x04fb('0x0'));var util=require(_0x04fb('0x1'));var logger=require(_0x04fb('0x2'))('api');var moment=require(_0x04fb('0x3'));var BPromise=require(_0x04fb('0x4'));var rp=require(_0x04fb('0x5'));var fs=require('fs');var path=require(_0x04fb('0x6'));var rimraf=require(_0x04fb('0x7'));var config=require(_0x04fb('0x8'));var attributes=require(_0x04fb('0x9'));module['exports']=function(_0x4af8da,_0x14dd0c){return _0x4af8da[_0x04fb('0xa')](_0x04fb('0xb'),attributes,{'tableName':_0x04fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8aa6=['path','rimraf','../../config/environment','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment','request-promise'];(function(_0x46ddd3,_0x2f4887){var _0x3f7c8c=function(_0x44bec2){while(--_0x44bec2){_0x46ddd3['push'](_0x46ddd3['shift']());}};_0x3f7c8c(++_0x2f4887);}(_0x8aa6,0xe2));var _0x68aa=function(_0x47df54,_0x1aeb61){_0x47df54=_0x47df54-0x0;var _0x261b87=_0x8aa6[_0x47df54];return _0x261b87;};'use strict';var _=require(_0x68aa('0x0'));var util=require(_0x68aa('0x1'));var logger=require('../../config/logger')(_0x68aa('0x2'));var moment=require(_0x68aa('0x3'));var BPromise=require('bluebird');var rp=require(_0x68aa('0x4'));var fs=require('fs');var path=require(_0x68aa('0x5'));var rimraf=require(_0x68aa('0x6'));var config=require(_0x68aa('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0x68aa('0x8')]=function(_0x538992,_0x5b60fd){return _0x538992['define'](_0x68aa('0x9'),attributes,{'tableName':_0x68aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 611a014..bae1418 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 _0xa97b=['client','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa97b,0x69));var _0xba97=function(_0x59b24d,_0x1efd6a){_0x59b24d=_0x59b24d-0x0;var _0x92ca52=_0xa97b[_0x59b24d];return _0x92ca52;};'use strict';var _=require('lodash');var util=require(_0xba97('0x0'));var moment=require('moment');var BPromise=require(_0xba97('0x1'));var rs=require(_0xba97('0x2'));var fs=require('fs');var Redis=require(_0xba97('0x3'));var db=require(_0xba97('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xba97('0x5'))(_0xba97('0x6'));var config=require(_0xba97('0x7'));var jayson=require(_0xba97('0x8'));var client=jayson[_0xba97('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x109d6d,_0x57718d,_0x429949){return new BPromise(function(_0x2bf6a2,_0x4d6cf5){return client['request'](_0x109d6d,_0x429949)[_0xba97('0xa')](function(_0x3971b0){logger[_0xba97('0xb')](_0xba97('0xc'),_0x57718d,_0xba97('0xd'));logger[_0xba97('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x57718d,_0xba97('0xd'),JSON[_0xba97('0xf')](_0x3971b0));if(_0x3971b0['error']){if(_0x3971b0[_0xba97('0x10')][_0xba97('0x11')]===0x1f4){logger[_0xba97('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x57718d,_0x3971b0[_0xba97('0x10')][_0xba97('0x12')]);return _0x4d6cf5(_0x3971b0[_0xba97('0x10')][_0xba97('0x12')]);}logger[_0xba97('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x57718d,_0x3971b0[_0xba97('0x10')][_0xba97('0x12')]);return _0x2bf6a2(_0x3971b0[_0xba97('0x10')][_0xba97('0x12')]);}else{logger[_0xba97('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x57718d,_0xba97('0xd'));_0x2bf6a2(_0x3971b0['result'][_0xba97('0x12')]);}})['catch'](function(_0x318bb0){logger[_0xba97('0x10')](_0xba97('0xc'),_0x57718d,_0x318bb0);_0x4d6cf5(_0x318bb0);});});} \ No newline at end of file +var _0x6404=['code','message','result','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x389971,_0x3c6bf8){var _0x347a60=function(_0xbf68eb){while(--_0xbf68eb){_0x389971['push'](_0x389971['shift']());}};_0x347a60(++_0x3c6bf8);}(_0x6404,0x1a7));var _0x4640=function(_0x3ec323,_0x5aa147){_0x3ec323=_0x3ec323-0x0;var _0x3261c6=_0x6404[_0x3ec323];return _0x3261c6;};'use strict';var _=require('lodash');var util=require(_0x4640('0x0'));var moment=require(_0x4640('0x1'));var BPromise=require(_0x4640('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4640('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4640('0x4'));var logger=require('../../config/logger')(_0x4640('0x5'));var config=require(_0x4640('0x6'));var jayson=require(_0x4640('0x7'));var client=jayson[_0x4640('0x8')][_0x4640('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48e1b6,_0x5cfd18,_0x583454){return new BPromise(function(_0xb9524e,_0x4ed004){return client[_0x4640('0xa')](_0x48e1b6,_0x583454)[_0x4640('0xb')](function(_0x4411eb){logger[_0x4640('0xc')](_0x4640('0xd'),_0x5cfd18,_0x4640('0xe'));logger[_0x4640('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5cfd18,_0x4640('0xe'),JSON[_0x4640('0x10')](_0x4411eb));if(_0x4411eb['error']){if(_0x4411eb[_0x4640('0x11')][_0x4640('0x12')]===0x1f4){logger[_0x4640('0x11')](_0x4640('0xd'),_0x5cfd18,_0x4411eb[_0x4640('0x11')][_0x4640('0x13')]);return _0x4ed004(_0x4411eb[_0x4640('0x11')]['message']);}logger[_0x4640('0x11')](_0x4640('0xd'),_0x5cfd18,_0x4411eb[_0x4640('0x11')][_0x4640('0x13')]);return _0xb9524e(_0x4411eb[_0x4640('0x11')][_0x4640('0x13')]);}else{logger[_0x4640('0xc')](_0x4640('0xd'),_0x5cfd18,_0x4640('0xe'));_0xb9524e(_0x4411eb[_0x4640('0x14')]['message']);}})['catch'](function(_0xa0804){logger[_0x4640('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5cfd18,_0xa0804);_0x4ed004(_0xa0804);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 94f11c0..88bae48 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(_0x3431fb,_0x8bf9e1){var _0x9c6a02=function(_0xf096d0){while(--_0xf096d0){_0x3431fb['push'](_0x3431fb['shift']());}};_0x9c6a02(++_0x8bf9e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0xf62d77,_0x21dbc9){var _0x5f28c5=function(_0x509777){while(--_0x509777){_0xf62d77['push'](_0xf62d77['shift']());}};_0x5f28c5(++_0x21dbc9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 cc950ff..7c1be9f 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 _0x0f88=['STRING','name','TEXT','sequelize','exports'];(function(_0x4e8286,_0x4eaeb4){var _0x44a440=function(_0x5e0907){while(--_0x5e0907){_0x4e8286['push'](_0x4e8286['shift']());}};_0x44a440(++_0x4eaeb4);}(_0x0f88,0x1d9));var _0x80f8=function(_0x573773,_0x36caa2){_0x573773=_0x573773-0x0;var _0x2b56af=_0x0f88[_0x573773];return _0x2b56af;};'use strict';var Sequelize=require(_0x80f8('0x0'));module[_0x80f8('0x1')]={'name':{'type':Sequelize[_0x80f8('0x2')],'allowNull':![],'unique':_0x80f8('0x3')},'table':{'type':Sequelize[_0x80f8('0x2')]},'metric':{'type':Sequelize[_0x80f8('0x4')]},'description':{'type':Sequelize[_0x80f8('0x2')]}}; \ No newline at end of file +var _0x1bd1=['sequelize','exports','STRING'];(function(_0x5c2050,_0x5bbe89){var _0x13a867=function(_0x21c4d8){while(--_0x21c4d8){_0x5c2050['push'](_0x5c2050['shift']());}};_0x13a867(++_0x5bbe89);}(_0x1bd1,0x123));var _0x11bd=function(_0x558222,_0x105cdb){_0x558222=_0x558222-0x0;var _0x4e1044=_0x1bd1[_0x558222];return _0x4e1044;};'use strict';var Sequelize=require(_0x11bd('0x0'));module[_0x11bd('0x1')]={'name':{'type':Sequelize[_0x11bd('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x11bd('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index e2e513b..fd20dd1 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 _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(_0x2cdbed,_0x157c65){var _0x1dc77d=function(_0x5387ce){while(--_0x5387ce){_0x2cdbed['push'](_0x2cdbed['shift']());}};_0x1dc77d(++_0x157c65);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x310a1b,_0x4c9129){_0x310a1b=_0x310a1b-0x0;var _0xdea206=_0xf2ca[_0x310a1b];return _0xdea206;};'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 +var _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x25b9e7,_0x63bd23){var _0x3aa8a2=function(_0x57ee77){while(--_0x57ee77){_0x25b9e7['push'](_0x25b9e7['shift']());}};_0x3aa8a2(++_0x63bd23);}(_0xdc97,0x13b));var _0x7dc9=function(_0x418ffa,_0x23a8b0){_0x418ffa=_0x418ffa-0x0;var _0x4064d8=_0xdc97[_0x418ffa];return _0x4064d8;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 30036f3..3ab4192 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 _0x6c7b=['path','rimraf','./analyticMetric.attributes','exports','define','analytics_metrics','lodash','moment','request-promise'];(function(_0x200492,_0x3a281f){var _0x156b76=function(_0x3dac87){while(--_0x3dac87){_0x200492['push'](_0x200492['shift']());}};_0x156b76(++_0x3a281f);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x1465a5,_0x43c4ac){_0x1465a5=_0x1465a5-0x0;var _0x4b6bbc=_0x6c7b[_0x1465a5];return _0x4b6bbc;};'use strict';var _=require(_0xb6c7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb6c7('0x1'));var BPromise=require('bluebird');var rp=require(_0xb6c7('0x2'));var fs=require('fs');var path=require(_0xb6c7('0x3'));var rimraf=require(_0xb6c7('0x4'));var config=require('../../config/environment');var attributes=require(_0xb6c7('0x5'));module[_0xb6c7('0x6')]=function(_0xfe3eb9,_0x219abc){return _0xfe3eb9[_0xb6c7('0x7')]('AnalyticMetric',attributes,{'tableName':_0xb6c7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5398=['request-promise','path','./analyticMetric.attributes','exports','define','AnalyticMetric','util','../../config/logger','api','moment','bluebird'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x5398,0xe2));var _0x8539=function(_0x121027,_0x37547f){_0x121027=_0x121027-0x0;var _0x4eaded=_0x5398[_0x121027];return _0x4eaded;};'use strict';var _=require('lodash');var util=require(_0x8539('0x0'));var logger=require(_0x8539('0x1'))(_0x8539('0x2'));var moment=require(_0x8539('0x3'));var BPromise=require(_0x8539('0x4'));var rp=require(_0x8539('0x5'));var fs=require('fs');var path=require(_0x8539('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8539('0x7'));module[_0x8539('0x8')]=function(_0x14ddc9,_0xcca1c0){return _0x14ddc9[_0x8539('0x9')](_0x8539('0xa'),attributes,{'tableName':'analytics_metrics','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 0c43996..4808d80 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 _0xbc15=['../../config/logger','rpc','../../config/environment','jayson/promise','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0xbc15,0xa2));var _0x5bc1=function(_0x329d27,_0x2bf065){_0x329d27=_0x329d27-0x0;var _0x5bb7ae=_0xbc15[_0x329d27];return _0x5bb7ae;};'use strict';var _=require(_0x5bc1('0x0'));var util=require(_0x5bc1('0x1'));var moment=require(_0x5bc1('0x2'));var BPromise=require('bluebird');var rs=require(_0x5bc1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5bc1('0x4'))['db'];var utils=require(_0x5bc1('0x5'));var logger=require(_0x5bc1('0x6'))(_0x5bc1('0x7'));var config=require(_0x5bc1('0x8'));var jayson=require(_0x5bc1('0x9'));var client=jayson['client'][_0x5bc1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f9bcf,_0x20c553,_0x452073){return new BPromise(function(_0x38908a,_0x2e8ca7){return client['request'](_0x3f9bcf,_0x452073)['then'](function(_0x7303df){logger[_0x5bc1('0xb')](_0x5bc1('0xc'),_0x20c553,_0x5bc1('0xd'));logger[_0x5bc1('0xe')](_0x5bc1('0xf'),_0x20c553,'request\x20sent',JSON[_0x5bc1('0x10')](_0x7303df));if(_0x7303df['error']){if(_0x7303df[_0x5bc1('0x11')][_0x5bc1('0x12')]===0x1f4){logger['error'](_0x5bc1('0xc'),_0x20c553,_0x7303df[_0x5bc1('0x11')][_0x5bc1('0x13')]);return _0x2e8ca7(_0x7303df['error'][_0x5bc1('0x13')]);}logger[_0x5bc1('0x11')](_0x5bc1('0xc'),_0x20c553,_0x7303df['error'][_0x5bc1('0x13')]);return _0x38908a(_0x7303df[_0x5bc1('0x11')][_0x5bc1('0x13')]);}else{logger[_0x5bc1('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x20c553,'request\x20sent');_0x38908a(_0x7303df['result'][_0x5bc1('0x13')]);}})[_0x5bc1('0x14')](function(_0x4c40b4){logger[_0x5bc1('0x11')](_0x5bc1('0xc'),_0x20c553,_0x4c40b4);_0x2e8ca7(_0x4c40b4);});});} \ No newline at end of file +var _0x5785=['error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x3d94cb,_0x41d809){var _0x1e093d=function(_0x14fd5b){while(--_0x14fd5b){_0x3d94cb['push'](_0x3d94cb['shift']());}};_0x1e093d(++_0x41d809);}(_0x5785,0x124));var _0x5578=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x5785[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x5578('0x0'));var util=require(_0x5578('0x1'));var moment=require(_0x5578('0x2'));var BPromise=require(_0x5578('0x3'));var rs=require(_0x5578('0x4'));var fs=require('fs');var Redis=require(_0x5578('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5578('0x6'))('rpc');var config=require(_0x5578('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5578('0x8')][_0x5578('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x405c04,_0x4906d6,_0xd994f){return new BPromise(function(_0x5b2e9a,_0x36d5b1){return client[_0x5578('0xa')](_0x405c04,_0xd994f)[_0x5578('0xb')](function(_0x3bb7dd){logger[_0x5578('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x4906d6,_0x5578('0xd'));logger[_0x5578('0xe')](_0x5578('0xf'),_0x4906d6,_0x5578('0xd'),JSON['stringify'](_0x3bb7dd));if(_0x3bb7dd['error']){if(_0x3bb7dd[_0x5578('0x10')][_0x5578('0x11')]===0x1f4){logger[_0x5578('0x10')](_0x5578('0x12'),_0x4906d6,_0x3bb7dd[_0x5578('0x10')][_0x5578('0x13')]);return _0x36d5b1(_0x3bb7dd[_0x5578('0x10')][_0x5578('0x13')]);}logger[_0x5578('0x10')](_0x5578('0x12'),_0x4906d6,_0x3bb7dd[_0x5578('0x10')][_0x5578('0x13')]);return _0x5b2e9a(_0x3bb7dd[_0x5578('0x10')]['message']);}else{logger[_0x5578('0xc')](_0x5578('0x12'),_0x4906d6,'request\x20sent');_0x5b2e9a(_0x3bb7dd[_0x5578('0x14')][_0x5578('0x13')]);}})[_0x5578('0x15')](function(_0x2a1030){logger[_0x5578('0x10')](_0x5578('0x12'),_0x4906d6,_0x2a1030);_0x36d5b1(_0x2a1030);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 47c7558..2fb3e09 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 _0x5eb8=['fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','destroy','util','path','Router'];(function(_0x50e425,_0x3ca8d7){var _0x4b985d=function(_0x58d7c0){while(--_0x58d7c0){_0x50e425['push'](_0x50e425['shift']());}};_0x4b985d(++_0x3ca8d7);}(_0x5eb8,0x1d1));var _0x85eb=function(_0x4239bd,_0x1f310b){_0x4239bd=_0x4239bd-0x0;var _0x21f061=_0x5eb8[_0x4239bd];return _0x21f061;};'use strict';var multer=require('multer');var util=require(_0x85eb('0x0'));var path=require(_0x85eb('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85eb('0x2')]();var fs_extra=require(_0x85eb('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x85eb('0x4'));var config=require(_0x85eb('0x5'));var controller=require(_0x85eb('0x6'));router[_0x85eb('0x7')]('/',auth['isAuthenticated'](),controller[_0x85eb('0x8')]);router[_0x85eb('0x7')](_0x85eb('0x9'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router['put'](_0x85eb('0x9'),auth[_0x85eb('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x85eb('0xc')]);module['exports']=router; \ No newline at end of file +var _0x6bb4=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','create','put','update','delete','destroy','multer','util'];(function(_0x115b39,_0x2dfdbe){var _0x32e700=function(_0x4c0dd0){while(--_0x4c0dd0){_0x115b39['push'](_0x115b39['shift']());}};_0x32e700(++_0x2dfdbe);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x17ef56,_0x374f14){_0x17ef56=_0x17ef56-0x0;var _0xf75b6f=_0x6bb4[_0x17ef56];return _0xf75b6f;};'use strict';var multer=require(_0x46bb('0x0'));var util=require(_0x46bb('0x1'));var path=require(_0x46bb('0x2'));var timeout=require('connect-timeout');var express=require(_0x46bb('0x3'));var router=express[_0x46bb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x46bb('0x5'));var interaction=require(_0x46bb('0x6'));var config=require(_0x46bb('0x7'));var controller=require(_0x46bb('0x8'));router[_0x46bb('0x9')]('/',auth[_0x46bb('0xa')](),controller['index']);router['get'](_0x46bb('0xb'),auth[_0x46bb('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x46bb('0xc')]);router[_0x46bb('0xd')]('/:id',auth[_0x46bb('0xa')](),controller[_0x46bb('0xe')]);router[_0x46bb('0xf')]('/:id',auth[_0x46bb('0xa')](),controller[_0x46bb('0x10')]);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 dadcce6..4dd3ad5 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 _0xadc4=['sequelize'];(function(_0x50ede0,_0x7e6410){var _0x5cbe32=function(_0x954b2a){while(--_0x954b2a){_0x50ede0['push'](_0x50ede0['shift']());}};_0x5cbe32(++_0x7e6410);}(_0xadc4,0x76));var _0x4adc=function(_0xd2e0e6,_0x4dab30){_0xd2e0e6=_0xd2e0e6-0x0;var _0x485ed7=_0xadc4[_0xd2e0e6];return _0x485ed7;};'use strict';var Sequelize=require(_0x4adc('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0xc1df=['exports','TEXT','sequelize'];(function(_0x2185fd,_0x123181){var _0x1eec9b=function(_0x4d0bd4){while(--_0x4d0bd4){_0x2185fd['push'](_0x2185fd['shift']());}};_0x1eec9b(++_0x123181);}(_0xc1df,0x15b));var _0xfc1d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc1df[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xfc1d('0x0'));module[_0xfc1d('0x1')]={'tree':{'type':Sequelize[_0xfc1d('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 04aaf02..d69e77c 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 _0x16f6=['offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','type','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','rows','catch','show','params','keys','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x50af9c,_0xf03b1e){var _0x5b5e5a=function(_0x309a92){while(--_0x309a92){_0x50af9c['push'](_0x50af9c['shift']());}};_0x5b5e5a(++_0xf03b1e);}(_0x16f6,0x1ef));var _0x616f=function(_0x48f180,_0x113fe4){_0x48f180=_0x48f180-0x0;var _0x5bc645=_0x16f6[_0x48f180];return _0x5bc645;};'use strict';var emlformat=require(_0x616f('0x0'));var rimraf=require(_0x616f('0x1'));var zipdir=require(_0x616f('0x2'));var jsonpatch=require(_0x616f('0x3'));var rp=require(_0x616f('0x4'));var moment=require(_0x616f('0x5'));var BPromise=require(_0x616f('0x6'));var Mustache=require(_0x616f('0x7'));var util=require(_0x616f('0x8'));var path=require(_0x616f('0x9'));var sox=require(_0x616f('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x616f('0xb'));var _=require(_0x616f('0xc'));var squel=require(_0x616f('0xd'));var crypto=require(_0x616f('0xe'));var jsforce=require(_0x616f('0xf'));var deskjs=require(_0x616f('0x10'));var toCsv=require(_0x616f('0x11'));var querystring=require('querystring');var Papa=require(_0x616f('0x12'));var Redis=require('ioredis');var authService=require(_0x616f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x616f('0x14'));var hardwareService=require(_0x616f('0x15'));var logger=require('../../config/logger')(_0x616f('0x16'));var utils=require('../../config/utils');var config=require(_0x616f('0x17'));var licenseUtil=require(_0x616f('0x18'));var db=require(_0x616f('0x19'))['db'];function respondWithStatusCode(_0x136b75,_0x3d87b7){_0x3d87b7=_0x3d87b7||0xcc;return function(_0x3d9ac9){if(_0x3d9ac9){return _0x136b75[_0x616f('0x1a')](_0x3d87b7);}return _0x136b75[_0x616f('0x1b')](_0x3d87b7)[_0x616f('0x1c')]();};}function respondWithResult(_0x4a6473,_0x175175){_0x175175=_0x175175||0xc8;return function(_0x3788e7){if(_0x3788e7){return _0x4a6473['status'](_0x175175)[_0x616f('0x1d')](_0x3788e7);}};}function respondWithFilteredResult(_0xc9ab63,_0x3cb809){return function(_0x8a91b0){if(_0x8a91b0){var _0x308e39=typeof _0x3cb809[_0x616f('0x1e')]==='undefined'&&typeof _0x3cb809[_0x616f('0x1f')]===_0x616f('0x20');var _0x2f6236=_0x8a91b0['count'];var _0x3a2a58=_0x308e39?0x0:_0x3cb809[_0x616f('0x1e')];var _0x4ebc02=_0x308e39?_0x8a91b0[_0x616f('0x21')]:_0x3cb809[_0x616f('0x1e')]+_0x3cb809[_0x616f('0x1f')];var _0xb18d4;if(_0x4ebc02>=_0x2f6236){_0x4ebc02=_0x2f6236;_0xb18d4=0xc8;}else{_0xb18d4=0xce;}_0xc9ab63[_0x616f('0x1b')](_0xb18d4);return _0xc9ab63[_0x616f('0x22')](_0x616f('0x23'),_0x3a2a58+'-'+_0x4ebc02+'/'+_0x2f6236)['json'](_0x8a91b0);}return null;};}function patchUpdates(_0x3cc2fe){return function(_0x4c39a8){try{jsonpatch['apply'](_0x4c39a8,_0x3cc2fe,!![]);}catch(_0x481902){return BPromise[_0x616f('0x24')](_0x481902);}return _0x4c39a8[_0x616f('0x25')]();};}function saveUpdates(_0x14ea7e,_0x47d605){return function(_0x559f2f){if(_0x559f2f){return _0x559f2f[_0x616f('0x26')](_0x14ea7e)['then'](function(_0x47ddf4){return _0x47ddf4;});}return null;};}function removeEntity(_0x3cd253,_0x185680){return function(_0x59ffea){if(_0x59ffea){return _0x59ffea[_0x616f('0x27')]()[_0x616f('0x28')](function(){_0x3cd253[_0x616f('0x1b')](0xcc)[_0x616f('0x1c')]();});}};}function handleEntityNotFound(_0x4d708d,_0x3bd7ea){return function(_0x22a9a5){if(!_0x22a9a5){_0x4d708d[_0x616f('0x1a')](0x194);}return _0x22a9a5;};}function handleError(_0x483317,_0x2d485b){_0x2d485b=_0x2d485b||0x1f4;return function(_0x1a0ddc){logger[_0x616f('0x29')](_0x1a0ddc[_0x616f('0x2a')]);if(_0x1a0ddc[_0x616f('0x2b')]){delete _0x1a0ddc[_0x616f('0x2b')];}_0x483317[_0x616f('0x1b')](_0x2d485b)[_0x616f('0x2c')](_0x1a0ddc);};}exports[_0x616f('0x2d')]=function(_0x5ad292,_0x5c1b30){var _0x404346={},_0x317d8a={},_0x230698={'count':0x0,'rows':[]};var _0x45f5da=_[_0x616f('0x2e')](db[_0x616f('0x2f')][_0x616f('0x30')],function(_0x5642f7){return{'name':_0x5642f7['fieldName'],'type':_0x5642f7[_0x616f('0x31')]['key']};});_0x317d8a['model']=_[_0x616f('0x2e')](_0x45f5da,_0x616f('0x2b'));_0x317d8a['query']=_['keys'](_0x5ad292[_0x616f('0x32')]);_0x317d8a['filters']=_[_0x616f('0x33')](_0x317d8a[_0x616f('0x34')],_0x317d8a[_0x616f('0x32')]);_0x404346[_0x616f('0x35')]=_[_0x616f('0x33')](_0x317d8a[_0x616f('0x34')],qs[_0x616f('0x36')](_0x5ad292[_0x616f('0x32')][_0x616f('0x36')]));_0x404346[_0x616f('0x35')]=_0x404346[_0x616f('0x35')]['length']?_0x404346[_0x616f('0x35')]:_0x317d8a[_0x616f('0x34')];if(!_0x5ad292[_0x616f('0x32')][_0x616f('0x37')](_0x616f('0x38'))){_0x404346[_0x616f('0x1f')]=qs['limit'](_0x5ad292['query'][_0x616f('0x1f')]);_0x404346['offset']=qs[_0x616f('0x1e')](_0x5ad292[_0x616f('0x32')][_0x616f('0x1e')]);}_0x404346[_0x616f('0x39')]=qs[_0x616f('0x3a')](_0x5ad292[_0x616f('0x32')][_0x616f('0x3a')]);_0x404346[_0x616f('0x3b')]=qs[_0x616f('0x3c')](_['pick'](_0x5ad292[_0x616f('0x32')],_0x317d8a[_0x616f('0x3c')]),_0x45f5da);if(_0x5ad292[_0x616f('0x32')][_0x616f('0x3d')]){_0x404346['where']=_[_0x616f('0x3e')](_0x404346['where'],{'$or':_[_0x616f('0x2e')](_0x45f5da,function(_0x5ebd06){if(_0x5ebd06['type']!==_0x616f('0x3f')){var _0x4a5e93={};_0x4a5e93[_0x5ebd06[_0x616f('0x2b')]]={'$like':'%'+_0x5ad292[_0x616f('0x32')][_0x616f('0x3d')]+'%'};return _0x4a5e93;}})});}_0x404346=_[_0x616f('0x3e')]({},_0x404346,_0x5ad292[_0x616f('0x40')]);var _0x427b6d={'where':_0x404346[_0x616f('0x3b')]};return db[_0x616f('0x2f')][_0x616f('0x21')](_0x427b6d)['then'](function(_0x393f68){_0x230698[_0x616f('0x21')]=_0x393f68;if(_0x5ad292[_0x616f('0x32')]['includeAll']){_0x404346['include']=[{'all':!![]}];}return db[_0x616f('0x2f')]['findAll'](_0x404346);})[_0x616f('0x28')](function(_0x578e87){_0x230698[_0x616f('0x41')]=_0x578e87;return _0x230698;})[_0x616f('0x28')](respondWithFilteredResult(_0x5c1b30,_0x404346))[_0x616f('0x42')](handleError(_0x5c1b30,null));};exports[_0x616f('0x43')]=function(_0x260b6b,_0x6973db){var _0x3529bf={'raw':!![],'where':{'id':_0x260b6b[_0x616f('0x44')]['id']}},_0x1d3c07={};_0x1d3c07[_0x616f('0x34')]=_[_0x616f('0x45')](db[_0x616f('0x2f')][_0x616f('0x30')]);_0x1d3c07[_0x616f('0x32')]=_[_0x616f('0x45')](_0x260b6b[_0x616f('0x32')]);_0x1d3c07[_0x616f('0x3c')]=_['intersection'](_0x1d3c07[_0x616f('0x34')],_0x1d3c07[_0x616f('0x32')]);_0x3529bf['attributes']=_['intersection'](_0x1d3c07[_0x616f('0x34')],qs['fields'](_0x260b6b[_0x616f('0x32')][_0x616f('0x36')]));_0x3529bf[_0x616f('0x35')]=_0x3529bf[_0x616f('0x35')]['length']?_0x3529bf[_0x616f('0x35')]:_0x1d3c07[_0x616f('0x34')];if(_0x260b6b[_0x616f('0x32')][_0x616f('0x46')]){_0x3529bf[_0x616f('0x47')]=[{'all':!![]}];}_0x3529bf=_[_0x616f('0x3e')]({},_0x3529bf,_0x260b6b[_0x616f('0x40')]);return db[_0x616f('0x2f')][_0x616f('0x48')](_0x3529bf)[_0x616f('0x28')](handleEntityNotFound(_0x6973db,null))[_0x616f('0x28')](respondWithResult(_0x6973db,null))[_0x616f('0x42')](handleError(_0x6973db,null));};exports[_0x616f('0x49')]=function(_0x2f4dba,_0x416373){return db[_0x616f('0x2f')][_0x616f('0x49')](_0x2f4dba['body'],{})[_0x616f('0x28')](respondWithResult(_0x416373,0xc9))[_0x616f('0x42')](handleError(_0x416373,null));};exports[_0x616f('0x26')]=function(_0x1b9fcd,_0x3e4b22){if(_0x1b9fcd[_0x616f('0x4a')]['id']){delete _0x1b9fcd[_0x616f('0x4a')]['id'];}return db[_0x616f('0x2f')][_0x616f('0x48')]({'where':{'id':_0x1b9fcd['params']['id']}})[_0x616f('0x28')](handleEntityNotFound(_0x3e4b22,null))[_0x616f('0x28')](saveUpdates(_0x1b9fcd[_0x616f('0x4a')],null))[_0x616f('0x28')](respondWithResult(_0x3e4b22,null))['catch'](handleError(_0x3e4b22,null));};exports[_0x616f('0x27')]=function(_0xbd69e5,_0x2cd54d){return db[_0x616f('0x2f')][_0x616f('0x48')]({'where':{'id':_0xbd69e5[_0x616f('0x44')]['id']}})['then'](handleEntityNotFound(_0x2cd54d,null))[_0x616f('0x28')](removeEntity(_0x2cd54d,null))[_0x616f('0x42')](handleError(_0x2cd54d,null));}; \ No newline at end of file +var _0x5354=['fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','save','update','then','error','stack','name','index','AnalyticTreeReport'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5354,0xb0));var _0x4535=function(_0x396457,_0xaaf513){_0x396457=_0x396457-0x0;var _0x130a1c=_0x5354[_0x396457];return _0x130a1c;};'use strict';var emlformat=require(_0x4535('0x0'));var rimraf=require(_0x4535('0x1'));var zipdir=require(_0x4535('0x2'));var jsonpatch=require(_0x4535('0x3'));var rp=require(_0x4535('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4535('0x5'));var util=require('util');var path=require(_0x4535('0x6'));var sox=require('sox');var csv=require(_0x4535('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4535('0x8'));var _=require(_0x4535('0x9'));var squel=require('squel');var crypto=require(_0x4535('0xa'));var jsforce=require(_0x4535('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4535('0x7'));var querystring=require(_0x4535('0xc'));var Papa=require(_0x4535('0xd'));var Redis=require(_0x4535('0xe'));var authService=require(_0x4535('0xf'));var qs=require(_0x4535('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4535('0x11'));var logger=require(_0x4535('0x12'))(_0x4535('0x13'));var utils=require('../../config/utils');var config=require(_0x4535('0x14'));var licenseUtil=require(_0x4535('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x491859,_0x3d885b){_0x3d885b=_0x3d885b||0xcc;return function(_0x26fca6){if(_0x26fca6){return _0x491859[_0x4535('0x16')](_0x3d885b);}return _0x491859[_0x4535('0x17')](_0x3d885b)[_0x4535('0x18')]();};}function respondWithResult(_0x2bb086,_0x546c58){_0x546c58=_0x546c58||0xc8;return function(_0x79fd2c){if(_0x79fd2c){return _0x2bb086['status'](_0x546c58)[_0x4535('0x19')](_0x79fd2c);}};}function respondWithFilteredResult(_0x24b691,_0x440276){return function(_0x5f2765){if(_0x5f2765){var _0x21e612=typeof _0x440276['offset']===_0x4535('0x1a')&&typeof _0x440276[_0x4535('0x1b')]==='undefined';var _0x14030b=_0x5f2765['count'];var _0x2642cb=_0x21e612?0x0:_0x440276[_0x4535('0x1c')];var _0x51ab8c=_0x21e612?_0x5f2765[_0x4535('0x1d')]:_0x440276[_0x4535('0x1c')]+_0x440276[_0x4535('0x1b')];var _0x1d11a0;if(_0x51ab8c>=_0x14030b){_0x51ab8c=_0x14030b;_0x1d11a0=0xc8;}else{_0x1d11a0=0xce;}_0x24b691[_0x4535('0x17')](_0x1d11a0);return _0x24b691['set'](_0x4535('0x1e'),_0x2642cb+'-'+_0x51ab8c+'/'+_0x14030b)[_0x4535('0x19')](_0x5f2765);}return null;};}function patchUpdates(_0x560f9e){return function(_0x353e13){try{jsonpatch[_0x4535('0x1f')](_0x353e13,_0x560f9e,!![]);}catch(_0x9c9729){return BPromise['reject'](_0x9c9729);}return _0x353e13[_0x4535('0x20')]();};}function saveUpdates(_0x3b44d8,_0x290e23){return function(_0x339c79){if(_0x339c79){return _0x339c79[_0x4535('0x21')](_0x3b44d8)[_0x4535('0x22')](function(_0x3aa816){return _0x3aa816;});}return null;};}function removeEntity(_0x25c45b,_0x10836b){return function(_0x473e6f){if(_0x473e6f){return _0x473e6f['destroy']()[_0x4535('0x22')](function(){_0x25c45b[_0x4535('0x17')](0xcc)[_0x4535('0x18')]();});}};}function handleEntityNotFound(_0x5ef96a,_0x40be67){return function(_0x315532){if(!_0x315532){_0x5ef96a[_0x4535('0x16')](0x194);}return _0x315532;};}function handleError(_0x5b8157,_0x39f759){_0x39f759=_0x39f759||0x1f4;return function(_0x369c79){logger[_0x4535('0x23')](_0x369c79[_0x4535('0x24')]);if(_0x369c79[_0x4535('0x25')]){delete _0x369c79[_0x4535('0x25')];}_0x5b8157['status'](_0x39f759)['send'](_0x369c79);};}exports[_0x4535('0x26')]=function(_0x1d02cb,_0x5afbb5){var _0x3204a2={},_0x277e79={},_0x1255b9={'count':0x0,'rows':[]};var _0x427926=_['map'](db[_0x4535('0x27')]['rawAttributes'],function(_0x4331d6){return{'name':_0x4331d6[_0x4535('0x28')],'type':_0x4331d6['type'][_0x4535('0x29')]};});_0x277e79[_0x4535('0x2a')]=_[_0x4535('0x2b')](_0x427926,_0x4535('0x25'));_0x277e79[_0x4535('0x2c')]=_[_0x4535('0x2d')](_0x1d02cb[_0x4535('0x2c')]);_0x277e79[_0x4535('0x2e')]=_['intersection'](_0x277e79[_0x4535('0x2a')],_0x277e79[_0x4535('0x2c')]);_0x3204a2[_0x4535('0x2f')]=_[_0x4535('0x30')](_0x277e79[_0x4535('0x2a')],qs[_0x4535('0x31')](_0x1d02cb['query']['fields']));_0x3204a2[_0x4535('0x2f')]=_0x3204a2[_0x4535('0x2f')][_0x4535('0x32')]?_0x3204a2[_0x4535('0x2f')]:_0x277e79[_0x4535('0x2a')];if(!_0x1d02cb[_0x4535('0x2c')][_0x4535('0x33')](_0x4535('0x34'))){_0x3204a2[_0x4535('0x1b')]=qs[_0x4535('0x1b')](_0x1d02cb[_0x4535('0x2c')][_0x4535('0x1b')]);_0x3204a2[_0x4535('0x1c')]=qs[_0x4535('0x1c')](_0x1d02cb[_0x4535('0x2c')][_0x4535('0x1c')]);}_0x3204a2[_0x4535('0x35')]=qs[_0x4535('0x36')](_0x1d02cb[_0x4535('0x2c')][_0x4535('0x36')]);_0x3204a2['where']=qs[_0x4535('0x2e')](_['pick'](_0x1d02cb[_0x4535('0x2c')],_0x277e79[_0x4535('0x2e')]),_0x427926);if(_0x1d02cb['query']['filter']){_0x3204a2[_0x4535('0x37')]=_[_0x4535('0x38')](_0x3204a2[_0x4535('0x37')],{'$or':_[_0x4535('0x2b')](_0x427926,function(_0x4b884b){if(_0x4b884b[_0x4535('0x39')]!==_0x4535('0x3a')){var _0xcb0e7f={};_0xcb0e7f[_0x4b884b[_0x4535('0x25')]]={'$like':'%'+_0x1d02cb[_0x4535('0x2c')]['filter']+'%'};return _0xcb0e7f;}})});}_0x3204a2=_[_0x4535('0x38')]({},_0x3204a2,_0x1d02cb[_0x4535('0x3b')]);var _0xe28605={'where':_0x3204a2['where']};return db[_0x4535('0x27')][_0x4535('0x1d')](_0xe28605)['then'](function(_0x3ac05c){_0x1255b9[_0x4535('0x1d')]=_0x3ac05c;if(_0x1d02cb[_0x4535('0x2c')][_0x4535('0x3c')]){_0x3204a2[_0x4535('0x3d')]=[{'all':!![]}];}return db[_0x4535('0x27')][_0x4535('0x3e')](_0x3204a2);})[_0x4535('0x22')](function(_0x554ab4){_0x1255b9[_0x4535('0x3f')]=_0x554ab4;return _0x1255b9;})['then'](respondWithFilteredResult(_0x5afbb5,_0x3204a2))[_0x4535('0x40')](handleError(_0x5afbb5,null));};exports[_0x4535('0x41')]=function(_0x10256c,_0x893ddf){var _0x13c4e1={'raw':!![],'where':{'id':_0x10256c[_0x4535('0x42')]['id']}},_0xf9e814={};_0xf9e814[_0x4535('0x2a')]=_[_0x4535('0x2d')](db['AnalyticTreeReport'][_0x4535('0x43')]);_0xf9e814[_0x4535('0x2c')]=_[_0x4535('0x2d')](_0x10256c[_0x4535('0x2c')]);_0xf9e814['filters']=_[_0x4535('0x30')](_0xf9e814[_0x4535('0x2a')],_0xf9e814[_0x4535('0x2c')]);_0x13c4e1[_0x4535('0x2f')]=_['intersection'](_0xf9e814['model'],qs[_0x4535('0x31')](_0x10256c[_0x4535('0x2c')][_0x4535('0x31')]));_0x13c4e1[_0x4535('0x2f')]=_0x13c4e1['attributes'][_0x4535('0x32')]?_0x13c4e1['attributes']:_0xf9e814[_0x4535('0x2a')];if(_0x10256c['query'][_0x4535('0x3c')]){_0x13c4e1[_0x4535('0x3d')]=[{'all':!![]}];}_0x13c4e1=_['merge']({},_0x13c4e1,_0x10256c[_0x4535('0x3b')]);return db[_0x4535('0x27')][_0x4535('0x44')](_0x13c4e1)[_0x4535('0x22')](handleEntityNotFound(_0x893ddf,null))['then'](respondWithResult(_0x893ddf,null))['catch'](handleError(_0x893ddf,null));};exports[_0x4535('0x45')]=function(_0x3458aa,_0x3bcfbb){return db[_0x4535('0x27')][_0x4535('0x45')](_0x3458aa[_0x4535('0x46')],{})[_0x4535('0x22')](respondWithResult(_0x3bcfbb,0xc9))[_0x4535('0x40')](handleError(_0x3bcfbb,null));};exports[_0x4535('0x21')]=function(_0x5580db,_0x3c2543){if(_0x5580db[_0x4535('0x46')]['id']){delete _0x5580db['body']['id'];}return db[_0x4535('0x27')][_0x4535('0x44')]({'where':{'id':_0x5580db[_0x4535('0x42')]['id']}})[_0x4535('0x22')](handleEntityNotFound(_0x3c2543,null))['then'](saveUpdates(_0x5580db[_0x4535('0x46')],null))[_0x4535('0x22')](respondWithResult(_0x3c2543,null))['catch'](handleError(_0x3c2543,null));};exports[_0x4535('0x47')]=function(_0x599698,_0x4cd3ee){return db['AnalyticTreeReport'][_0x4535('0x44')]({'where':{'id':_0x599698[_0x4535('0x42')]['id']}})[_0x4535('0x22')](handleEntityNotFound(_0x4cd3ee,null))[_0x4535('0x22')](removeEntity(_0x4cd3ee,null))[_0x4535('0x40')](handleError(_0x4cd3ee,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index bceb920..67e30c2 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 _0x789a=['request-promise','path','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x789a,0x1c8));var _0xa789=function(_0x3b85db,_0x131509){_0x3b85db=_0x3b85db-0x0;var _0x19c7db=_0x789a[_0x3b85db];return _0x19c7db;};'use strict';var _=require(_0xa789('0x0'));var util=require(_0xa789('0x1'));var logger=require(_0xa789('0x2'))(_0xa789('0x3'));var moment=require(_0xa789('0x4'));var BPromise=require(_0xa789('0x5'));var rp=require(_0xa789('0x6'));var fs=require('fs');var path=require(_0xa789('0x7'));var rimraf=require('rimraf');var config=require(_0xa789('0x8'));var attributes=require(_0xa789('0x9'));module[_0xa789('0xa')]=function(_0x4e4a14,_0x572f14){return _0x4e4a14[_0xa789('0xb')](_0xa789('0xc'),attributes,{'tableName':_0xa789('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x894f=['exports','analytics_report_trees','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x8e1290,_0x4afa81){var _0x17e43b=function(_0x16bacf){while(--_0x16bacf){_0x8e1290['push'](_0x8e1290['shift']());}};_0x17e43b(++_0x4afa81);}(_0x894f,0xf4));var _0xf894=function(_0xf9e9af,_0x385820){_0xf9e9af=_0xf9e9af-0x0;var _0x527419=_0x894f[_0xf9e9af];return _0x527419;};'use strict';var _=require(_0xf894('0x0'));var util=require(_0xf894('0x1'));var logger=require(_0xf894('0x2'))(_0xf894('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf894('0x4'));var fs=require('fs');var path=require(_0xf894('0x5'));var rimraf=require(_0xf894('0x6'));var config=require(_0xf894('0x7'));var attributes=require(_0xf894('0x8'));module[_0xf894('0x9')]=function(_0x1b6732,_0x22f3d7){return _0x1b6732['define']('AnalyticTreeReport',attributes,{'tableName':_0xf894('0xa'),'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 300e9ae..e371eca 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x3935ff,_0x41bbca){var _0x16c423=function(_0x49d1e9){while(--_0x49d1e9){_0x3935ff['push'](_0x3935ff['shift']());}};_0x16c423(++_0x41bbca);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x5f3a24,_0x3ec2fa){var _0x24ac1d=function(_0xa56db2){while(--_0xa56db2){_0x5f3a24['push'](_0x5f3a24['shift']());}};_0x24ac1d(++_0x3ec2fa);}(_0x5f2f,0x73));var _0xf5f2=function(_0x32c037,_0x7bda34){_0x32c037=_0x32c037-0x0;var _0x3e1f71=_0x5f2f[_0x32c037];return _0x3e1f71;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 18f9674..b13de24 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 _0x2291=['fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','index','/:id','post','create','delete','exports','multer','util','connect-timeout','express'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x2291,0x155));var _0x1229=function(_0x463bc7,_0x47ba46){_0x463bc7=_0x463bc7-0x0;var _0x208fb0=_0x2291[_0x463bc7];return _0x208fb0;};'use strict';var multer=require(_0x1229('0x0'));var util=require(_0x1229('0x1'));var path=require('path');var timeout=require(_0x1229('0x2'));var express=require(_0x1229('0x3'));var router=express['Router']();var fs_extra=require(_0x1229('0x4'));var auth=require(_0x1229('0x5'));var interaction=require(_0x1229('0x6'));var config=require('../../config/environment');var controller=require(_0x1229('0x7'));router['get']('/',auth[_0x1229('0x8')](),controller[_0x1229('0x9')]);router['get'](_0x1229('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x1229('0xb')]('/',auth[_0x1229('0x8')](),controller[_0x1229('0xc')]);router['put'](_0x1229('0xa'),auth[_0x1229('0x8')](),controller['update']);router[_0x1229('0xd')](_0x1229('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1229('0xe')]=router; \ No newline at end of file +var _0xac9b=['show','post','create','put','/:id','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated'];(function(_0x7782d7,_0xce2d0e){var _0x881ef7=function(_0x14cb6d){while(--_0x14cb6d){_0x7782d7['push'](_0x7782d7['shift']());}};_0x881ef7(++_0xce2d0e);}(_0xac9b,0xc1));var _0xbac9=function(_0x4704dc,_0x575a5f){_0x4704dc=_0x4704dc-0x0;var _0x254d81=_0xac9b[_0x4704dc];return _0x254d81;};'use strict';var multer=require(_0xbac9('0x0'));var util=require(_0xbac9('0x1'));var path=require(_0xbac9('0x2'));var timeout=require('connect-timeout');var express=require(_0xbac9('0x3'));var router=express[_0xbac9('0x4')]();var fs_extra=require(_0xbac9('0x5'));var auth=require(_0xbac9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbac9('0x7'));var controller=require(_0xbac9('0x8'));router[_0xbac9('0x9')]('/',auth[_0xbac9('0xa')](),controller['index']);router[_0xbac9('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xbac9('0xb')]);router[_0xbac9('0xc')]('/',auth[_0xbac9('0xa')](),controller[_0xbac9('0xd')]);router[_0xbac9('0xe')](_0xbac9('0xf'),auth[_0xbac9('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xbac9('0x10')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index efefa15..2d2a020 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 _0x6921=['STRING','exports'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0x6921,0x1d1));var _0x1692=function(_0x26e780,_0x5465ba){_0x26e780=_0x26e780-0x0;var _0x2e9594=_0x6921[_0x26e780];return _0x2e9594;};'use strict';var Sequelize=require('sequelize');module[_0x1692('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x1692('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1280=['sequelize','exports','STRING'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0x1280,0xba));var _0x0128=function(_0x3cbe3a,_0x78bfce){_0x3cbe3a=_0x3cbe3a-0x0;var _0x24ffc1=_0x1280[_0x3cbe3a];return _0x24ffc1;};'use strict';var Sequelize=require(_0x0128('0x0'));module[_0x0128('0x1')]={'name':{'type':Sequelize[_0x0128('0x2')]},'basename':{'type':Sequelize[_0x0128('0x2')]},'type':{'type':Sequelize[_0x0128('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 3511eea..e6bacdd 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 _0x3b6c=['body','createdAt','create','destroy','file','filename','mimetype','download','findOne','join','root','server/files/attachments/','basename','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../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','stack','name','send','index','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','clone','find','get','omit','updatedAt'];(function(_0xe0ab0c,_0x3dbb36){var _0x428fd6=function(_0xf78d69){while(--_0xf78d69){_0xe0ab0c['push'](_0xe0ab0c['shift']());}};_0x428fd6(++_0x3dbb36);}(_0x3b6c,0x171));var _0xc3b6=function(_0x21e067,_0x1efa07){_0x21e067=_0x21e067-0x0;var _0x5daf81=_0x3b6c[_0x21e067];return _0x5daf81;};'use strict';var emlformat=require(_0xc3b6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc3b6('0x1'));var jsonpatch=require(_0xc3b6('0x2'));var rp=require(_0xc3b6('0x3'));var moment=require('moment');var BPromise=require(_0xc3b6('0x4'));var Mustache=require(_0xc3b6('0x5'));var util=require('util');var path=require(_0xc3b6('0x6'));var sox=require('sox');var csv=require(_0xc3b6('0x7'));var ejs=require(_0xc3b6('0x8'));var fs=require('fs');var fs_extra=require(_0xc3b6('0x9'));var _=require(_0xc3b6('0xa'));var squel=require(_0xc3b6('0xb'));var crypto=require(_0xc3b6('0xc'));var jsforce=require(_0xc3b6('0xd'));var deskjs=require(_0xc3b6('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc3b6('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc3b6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3b6('0x11'));var logger=require('../../config/logger')(_0xc3b6('0x12'));var utils=require(_0xc3b6('0x13'));var config=require(_0xc3b6('0x14'));var licenseUtil=require(_0xc3b6('0x15'));var db=require(_0xc3b6('0x16'))['db'];function respondWithStatusCode(_0xe44cb2,_0x1f1a33){_0x1f1a33=_0x1f1a33||0xcc;return function(_0x4d1a00){if(_0x4d1a00){return _0xe44cb2[_0xc3b6('0x17')](_0x1f1a33);}return _0xe44cb2[_0xc3b6('0x18')](_0x1f1a33)[_0xc3b6('0x19')]();};}function respondWithResult(_0x4ba31c,_0x325224){_0x325224=_0x325224||0xc8;return function(_0x4cc03e){if(_0x4cc03e){return _0x4ba31c[_0xc3b6('0x18')](_0x325224)[_0xc3b6('0x1a')](_0x4cc03e);}};}function respondWithFilteredResult(_0x39b6d0,_0x346faf){return function(_0x5aafdd){if(_0x5aafdd){var _0x51329f=typeof _0x346faf[_0xc3b6('0x1b')]==='undefined'&&typeof _0x346faf[_0xc3b6('0x1c')]===_0xc3b6('0x1d');var _0x4aa3dd=_0x5aafdd[_0xc3b6('0x1e')];var _0x36c320=_0x51329f?0x0:_0x346faf['offset'];var _0x183484=_0x51329f?_0x5aafdd[_0xc3b6('0x1e')]:_0x346faf[_0xc3b6('0x1b')]+_0x346faf['limit'];var _0x3e1daa;if(_0x183484>=_0x4aa3dd){_0x183484=_0x4aa3dd;_0x3e1daa=0xc8;}else{_0x3e1daa=0xce;}_0x39b6d0[_0xc3b6('0x18')](_0x3e1daa);return _0x39b6d0[_0xc3b6('0x1f')](_0xc3b6('0x20'),_0x36c320+'-'+_0x183484+'/'+_0x4aa3dd)[_0xc3b6('0x1a')](_0x5aafdd);}return null;};}function patchUpdates(_0x3f38ec){return function(_0x1b7086){try{jsonpatch[_0xc3b6('0x21')](_0x1b7086,_0x3f38ec,!![]);}catch(_0xa2f2c8){return BPromise[_0xc3b6('0x22')](_0xa2f2c8);}return _0x1b7086[_0xc3b6('0x23')]();};}function saveUpdates(_0x64b547,_0x45d834){return function(_0x13ae74){if(_0x13ae74){return _0x13ae74[_0xc3b6('0x24')](_0x64b547)[_0xc3b6('0x25')](function(_0x54cbca){return _0x54cbca;});}return null;};}function removeEntity(_0x142b29,_0x58f783){return function(_0x26d1a8){if(_0x26d1a8){return _0x26d1a8['destroy']()[_0xc3b6('0x25')](function(){_0x142b29[_0xc3b6('0x18')](0xcc)[_0xc3b6('0x19')]();});}};}function handleEntityNotFound(_0x5da21d,_0x1f3e6a){return function(_0x4e4499){if(!_0x4e4499){_0x5da21d[_0xc3b6('0x17')](0x194);}return _0x4e4499;};}function handleError(_0x53816d,_0x27a057){_0x27a057=_0x27a057||0x1f4;return function(_0x2e5f4b){logger['error'](_0x2e5f4b[_0xc3b6('0x26')]);if(_0x2e5f4b[_0xc3b6('0x27')]){delete _0x2e5f4b[_0xc3b6('0x27')];}_0x53816d[_0xc3b6('0x18')](_0x27a057)[_0xc3b6('0x28')](_0x2e5f4b);};}exports[_0xc3b6('0x29')]=function(_0x339c25,_0x11c3f4){var _0x442191={},_0x54cc82={},_0x180290={'count':0x0,'rows':[]};var _0x488c90=_['map'](db[_0xc3b6('0x2a')][_0xc3b6('0x2b')],function(_0x551937){return{'name':_0x551937[_0xc3b6('0x2c')],'type':_0x551937[_0xc3b6('0x2d')][_0xc3b6('0x2e')]};});_0x54cc82[_0xc3b6('0x2f')]=_['map'](_0x488c90,_0xc3b6('0x27'));_0x54cc82[_0xc3b6('0x30')]=_[_0xc3b6('0x31')](_0x339c25[_0xc3b6('0x30')]);_0x54cc82[_0xc3b6('0x32')]=_[_0xc3b6('0x33')](_0x54cc82[_0xc3b6('0x2f')],_0x54cc82[_0xc3b6('0x30')]);_0x442191[_0xc3b6('0x34')]=_[_0xc3b6('0x33')](_0x54cc82[_0xc3b6('0x2f')],qs[_0xc3b6('0x35')](_0x339c25[_0xc3b6('0x30')][_0xc3b6('0x35')]));_0x442191[_0xc3b6('0x34')]=_0x442191[_0xc3b6('0x34')][_0xc3b6('0x36')]?_0x442191['attributes']:_0x54cc82[_0xc3b6('0x2f')];if(!_0x339c25['query'][_0xc3b6('0x37')](_0xc3b6('0x38'))){_0x442191[_0xc3b6('0x1c')]=qs[_0xc3b6('0x1c')](_0x339c25['query']['limit']);_0x442191['offset']=qs['offset'](_0x339c25[_0xc3b6('0x30')][_0xc3b6('0x1b')]);}_0x442191['order']=qs[_0xc3b6('0x39')](_0x339c25[_0xc3b6('0x30')][_0xc3b6('0x39')]);_0x442191[_0xc3b6('0x3a')]=qs['filters'](_['pick'](_0x339c25[_0xc3b6('0x30')],_0x54cc82[_0xc3b6('0x32')]),_0x488c90);if(_0x339c25['query'][_0xc3b6('0x3b')]){_0x442191[_0xc3b6('0x3a')]=_[_0xc3b6('0x3c')](_0x442191[_0xc3b6('0x3a')],{'$or':_[_0xc3b6('0x3d')](_0x488c90,function(_0x378d40){if(_0x378d40['type']!==_0xc3b6('0x3e')){var _0x1560ad={};_0x1560ad[_0x378d40[_0xc3b6('0x27')]]={'$like':'%'+_0x339c25['query'][_0xc3b6('0x3b')]+'%'};return _0x1560ad;}})});}_0x442191=_[_0xc3b6('0x3c')]({},_0x442191,_0x339c25[_0xc3b6('0x3f')]);var _0x4655fa={'where':_0x442191[_0xc3b6('0x3a')]};return db[_0xc3b6('0x2a')]['count'](_0x4655fa)[_0xc3b6('0x25')](function(_0x57de3d){_0x180290[_0xc3b6('0x1e')]=_0x57de3d;if(_0x339c25[_0xc3b6('0x30')][_0xc3b6('0x40')]){_0x442191['include']=[{'all':!![]}];}return db['Attachment'][_0xc3b6('0x41')](_0x442191);})['then'](function(_0x34696c){_0x180290[_0xc3b6('0x42')]=_0x34696c;return _0x180290;})[_0xc3b6('0x25')](respondWithFilteredResult(_0x11c3f4,_0x442191))[_0xc3b6('0x43')](handleError(_0x11c3f4,null));};exports[_0xc3b6('0x44')]=function(_0x3167b5,_0x5a9c45){var _0x2ee048={'raw':!![],'where':{'id':_0x3167b5[_0xc3b6('0x45')]['id']}},_0x4b45ed={};_0x4b45ed[_0xc3b6('0x2f')]=_[_0xc3b6('0x31')](db[_0xc3b6('0x2a')]['rawAttributes']);_0x4b45ed['query']=_[_0xc3b6('0x31')](_0x3167b5['query']);_0x4b45ed['filters']=_['intersection'](_0x4b45ed[_0xc3b6('0x2f')],_0x4b45ed[_0xc3b6('0x30')]);_0x2ee048[_0xc3b6('0x34')]=_[_0xc3b6('0x33')](_0x4b45ed[_0xc3b6('0x2f')],qs['fields'](_0x3167b5[_0xc3b6('0x30')][_0xc3b6('0x35')]));_0x2ee048[_0xc3b6('0x34')]=_0x2ee048['attributes'][_0xc3b6('0x36')]?_0x2ee048[_0xc3b6('0x34')]:_0x4b45ed['model'];if(_0x3167b5[_0xc3b6('0x30')][_0xc3b6('0x40')]){_0x2ee048[_0xc3b6('0x46')]=[{'all':!![]}];}_0x2ee048=_['merge']({},_0x2ee048,_0x3167b5[_0xc3b6('0x3f')]);return db[_0xc3b6('0x2a')]['find'](_0x2ee048)[_0xc3b6('0x25')](handleEntityNotFound(_0x5a9c45,null))[_0xc3b6('0x25')](respondWithResult(_0x5a9c45,null))[_0xc3b6('0x43')](handleError(_0x5a9c45,null));};exports[_0xc3b6('0x47')]=function(_0x2786fa,_0x3e9664){var _0x118fe1={'where':{'id':_0x2786fa[_0xc3b6('0x45')]['id']}},_0x273aa0={};_0x273aa0[_0xc3b6('0x2f')]=_[_0xc3b6('0x31')](db['Attachment']['rawAttributes']);_0x118fe1[_0xc3b6('0x34')]=_[_0xc3b6('0x33')](_0x273aa0[_0xc3b6('0x2f')],qs[_0xc3b6('0x35')](_0x2786fa[_0xc3b6('0x30')]['fields']));_0x118fe1['attributes']=_0x118fe1[_0xc3b6('0x34')][_0xc3b6('0x36')]?_0x118fe1[_0xc3b6('0x34')]:_0x273aa0[_0xc3b6('0x2f')];if(_0x2786fa[_0xc3b6('0x30')][_0xc3b6('0x40')]){_0x118fe1[_0xc3b6('0x46')]=[{'all':!![]}];}_0x118fe1=_[_0xc3b6('0x3c')]({},_0x118fe1,_0x2786fa[_0xc3b6('0x3f')]);return db[_0xc3b6('0x2a')][_0xc3b6('0x48')](_0x118fe1)[_0xc3b6('0x25')](handleEntityNotFound(_0x3e9664,null))[_0xc3b6('0x25')](function(_0xb98da5){if(_0xb98da5){var _0x4ec568=_0xb98da5[_0xc3b6('0x49')]({'plain':!![]});_0x4ec568=qs[_0xc3b6('0x4a')](_0x4ec568,['id','createdAt',_0xc3b6('0x4b')]);_0x2786fa[_0xc3b6('0x4c')]=_[_0xc3b6('0x4a')](_0x2786fa['body'],['id',_0xc3b6('0x4d'),'updatedAt']);return db[_0xc3b6('0x2a')][_0xc3b6('0x4e')](_[_0xc3b6('0x3c')](_0x4ec568,_0x2786fa[_0xc3b6('0x4c')]),{'include':_0x2786fa[_0xc3b6('0x30')][_0xc3b6('0x40')]?[{'all':!![]}]:undefined});}})[_0xc3b6('0x25')](respondWithResult(_0x3e9664,0xc9))[_0xc3b6('0x43')](handleError(_0x3e9664,null));};exports[_0xc3b6('0x24')]=function(_0x5a7dd8,_0x19b145){if(_0x5a7dd8[_0xc3b6('0x4c')]['id']){delete _0x5a7dd8['body']['id'];}return db['Attachment'][_0xc3b6('0x48')]({'where':{'id':_0x5a7dd8[_0xc3b6('0x45')]['id']}})[_0xc3b6('0x25')](handleEntityNotFound(_0x19b145,null))[_0xc3b6('0x25')](saveUpdates(_0x5a7dd8[_0xc3b6('0x4c')],null))['then'](respondWithResult(_0x19b145,null))[_0xc3b6('0x43')](handleError(_0x19b145,null));};exports[_0xc3b6('0x4f')]=function(_0x285094,_0x3cfef1){return db[_0xc3b6('0x2a')][_0xc3b6('0x48')]({'where':{'id':_0x285094[_0xc3b6('0x45')]['id']}})[_0xc3b6('0x25')](handleEntityNotFound(_0x3cfef1,null))[_0xc3b6('0x25')](removeEntity(_0x3cfef1,null))[_0xc3b6('0x43')](handleError(_0x3cfef1,null));};exports[_0xc3b6('0x4e')]=function(_0xd4e7e7,_0x5256b4,_0x4a5cbb){_0xd4e7e7['body'][_0xc3b6('0x27')]=_0xd4e7e7[_0xc3b6('0x50')]['originalname'];_0xd4e7e7['body']['basename']=_0xd4e7e7['file'][_0xc3b6('0x51')];_0xd4e7e7['body'][_0xc3b6('0x2d')]=_0xd4e7e7['file'][_0xc3b6('0x52')];return db[_0xc3b6('0x2a')][_0xc3b6('0x4e')](_0xd4e7e7[_0xc3b6('0x4c')])[_0xc3b6('0x25')](respondWithResult(_0x5256b4,0xc9))[_0xc3b6('0x43')](handleError(_0x5256b4,null));};exports[_0xc3b6('0x53')]=function(_0x31bbed,_0xa7be5e,_0x2d2898){return db['Attachment'][_0xc3b6('0x54')]({'where':{'id':_0x31bbed[_0xc3b6('0x45')]['id']},'raw':!![]})[_0xc3b6('0x25')](handleEntityNotFound(_0xa7be5e,null))[_0xc3b6('0x25')](function(_0x4dba87){if(_0x4dba87){var _0xc69cc=_0x4dba87['ChatOfflineMessageId']!==null;var _0x13d7a3=path[_0xc3b6('0x55')](config[_0xc3b6('0x56')],_0xc3b6('0x57'));if(_0xc69cc){_0x13d7a3=path[_0xc3b6('0x55')](_0x13d7a3,'offline-chat/');}var _0x5cd8f0=path['join'](_0x13d7a3,_0x4dba87[_0xc3b6('0x58')]);return _0xa7be5e['download'](_0x5cd8f0);}})[_0xc3b6('0x43')](handleError(_0xa7be5e,null));}; \ No newline at end of file +var _0x84f9=['attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','clone','get','omit','updatedAt','body','createdAt','create','find','destroy','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','Attachment','key','model','query','keys','filters','intersection'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x84f9,0xde));var _0x984f=function(_0xf67f9a,_0x164ef4){_0xf67f9a=_0xf67f9a-0x0;var _0xdd0dc3=_0x84f9[_0xf67f9a];return _0xdd0dc3;};'use strict';var emlformat=require(_0x984f('0x0'));var rimraf=require(_0x984f('0x1'));var zipdir=require(_0x984f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x984f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x984f('0x4'));var util=require(_0x984f('0x5'));var path=require(_0x984f('0x6'));var sox=require('sox');var csv=require(_0x984f('0x7'));var ejs=require(_0x984f('0x8'));var fs=require('fs');var fs_extra=require(_0x984f('0x9'));var _=require(_0x984f('0xa'));var squel=require(_0x984f('0xb'));var crypto=require(_0x984f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x984f('0xd'));var toCsv=require(_0x984f('0x7'));var querystring=require(_0x984f('0xe'));var Papa=require(_0x984f('0xf'));var Redis=require(_0x984f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x984f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x984f('0x12'));var licenseUtil=require(_0x984f('0x13'));var db=require(_0x984f('0x14'))['db'];function respondWithStatusCode(_0x40e63a,_0x3de318){_0x3de318=_0x3de318||0xcc;return function(_0x14e90c){if(_0x14e90c){return _0x40e63a[_0x984f('0x15')](_0x3de318);}return _0x40e63a[_0x984f('0x16')](_0x3de318)[_0x984f('0x17')]();};}function respondWithResult(_0x2dd5de,_0x32f9eb){_0x32f9eb=_0x32f9eb||0xc8;return function(_0xdafeb7){if(_0xdafeb7){return _0x2dd5de['status'](_0x32f9eb)[_0x984f('0x18')](_0xdafeb7);}};}function respondWithFilteredResult(_0x5092df,_0x2e7caa){return function(_0x19685f){if(_0x19685f){var _0x40b887=typeof _0x2e7caa[_0x984f('0x19')]==='undefined'&&typeof _0x2e7caa[_0x984f('0x1a')]===_0x984f('0x1b');var _0x443638=_0x19685f['count'];var _0xe0f4b7=_0x40b887?0x0:_0x2e7caa[_0x984f('0x19')];var _0x533887=_0x40b887?_0x19685f[_0x984f('0x1c')]:_0x2e7caa[_0x984f('0x19')]+_0x2e7caa[_0x984f('0x1a')];var _0x779125;if(_0x533887>=_0x443638){_0x533887=_0x443638;_0x779125=0xc8;}else{_0x779125=0xce;}_0x5092df[_0x984f('0x16')](_0x779125);return _0x5092df[_0x984f('0x1d')](_0x984f('0x1e'),_0xe0f4b7+'-'+_0x533887+'/'+_0x443638)[_0x984f('0x18')](_0x19685f);}return null;};}function patchUpdates(_0x443727){return function(_0xc8610f){try{jsonpatch[_0x984f('0x1f')](_0xc8610f,_0x443727,!![]);}catch(_0x1a0db0){return BPromise[_0x984f('0x20')](_0x1a0db0);}return _0xc8610f['save']();};}function saveUpdates(_0x113cc9,_0x2c5a0d){return function(_0x11b865){if(_0x11b865){return _0x11b865[_0x984f('0x21')](_0x113cc9)[_0x984f('0x22')](function(_0x67d58c){return _0x67d58c;});}return null;};}function removeEntity(_0x224b51,_0x31dcaa){return function(_0x46647a){if(_0x46647a){return _0x46647a['destroy']()[_0x984f('0x22')](function(){_0x224b51[_0x984f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbacc9b,_0x7f7349){return function(_0x2fdbb3){if(!_0x2fdbb3){_0xbacc9b[_0x984f('0x15')](0x194);}return _0x2fdbb3;};}function handleError(_0x4a6691,_0x28332d){_0x28332d=_0x28332d||0x1f4;return function(_0x33439d){logger[_0x984f('0x23')](_0x33439d[_0x984f('0x24')]);if(_0x33439d[_0x984f('0x25')]){delete _0x33439d[_0x984f('0x25')];}_0x4a6691[_0x984f('0x16')](_0x28332d)[_0x984f('0x26')](_0x33439d);};}exports[_0x984f('0x27')]=function(_0x313d0c,_0x56d71d){var _0x53d93f={},_0x1bf5dd={},_0x41d740={'count':0x0,'rows':[]};var _0x425e35=_[_0x984f('0x28')](db[_0x984f('0x29')]['rawAttributes'],function(_0x48c906){return{'name':_0x48c906['fieldName'],'type':_0x48c906['type'][_0x984f('0x2a')]};});_0x1bf5dd[_0x984f('0x2b')]=_[_0x984f('0x28')](_0x425e35,_0x984f('0x25'));_0x1bf5dd[_0x984f('0x2c')]=_[_0x984f('0x2d')](_0x313d0c[_0x984f('0x2c')]);_0x1bf5dd[_0x984f('0x2e')]=_[_0x984f('0x2f')](_0x1bf5dd[_0x984f('0x2b')],_0x1bf5dd[_0x984f('0x2c')]);_0x53d93f[_0x984f('0x30')]=_[_0x984f('0x2f')](_0x1bf5dd[_0x984f('0x2b')],qs[_0x984f('0x31')](_0x313d0c[_0x984f('0x2c')]['fields']));_0x53d93f['attributes']=_0x53d93f[_0x984f('0x30')]['length']?_0x53d93f['attributes']:_0x1bf5dd[_0x984f('0x2b')];if(!_0x313d0c[_0x984f('0x2c')]['hasOwnProperty'](_0x984f('0x32'))){_0x53d93f[_0x984f('0x1a')]=qs[_0x984f('0x1a')](_0x313d0c[_0x984f('0x2c')][_0x984f('0x1a')]);_0x53d93f[_0x984f('0x19')]=qs[_0x984f('0x19')](_0x313d0c[_0x984f('0x2c')][_0x984f('0x19')]);}_0x53d93f[_0x984f('0x33')]=qs[_0x984f('0x34')](_0x313d0c[_0x984f('0x2c')][_0x984f('0x34')]);_0x53d93f[_0x984f('0x35')]=qs[_0x984f('0x2e')](_[_0x984f('0x36')](_0x313d0c['query'],_0x1bf5dd['filters']),_0x425e35);if(_0x313d0c[_0x984f('0x2c')][_0x984f('0x37')]){_0x53d93f[_0x984f('0x35')]=_[_0x984f('0x38')](_0x53d93f[_0x984f('0x35')],{'$or':_[_0x984f('0x28')](_0x425e35,function(_0x557287){if(_0x557287[_0x984f('0x39')]!==_0x984f('0x3a')){var _0x5ca913={};_0x5ca913[_0x557287[_0x984f('0x25')]]={'$like':'%'+_0x313d0c[_0x984f('0x2c')][_0x984f('0x37')]+'%'};return _0x5ca913;}})});}_0x53d93f=_[_0x984f('0x38')]({},_0x53d93f,_0x313d0c[_0x984f('0x3b')]);var _0x3f2111={'where':_0x53d93f['where']};return db['Attachment'][_0x984f('0x1c')](_0x3f2111)[_0x984f('0x22')](function(_0xb1a230){_0x41d740['count']=_0xb1a230;if(_0x313d0c[_0x984f('0x2c')][_0x984f('0x3c')]){_0x53d93f[_0x984f('0x3d')]=[{'all':!![]}];}return db[_0x984f('0x29')][_0x984f('0x3e')](_0x53d93f);})[_0x984f('0x22')](function(_0x1e6d19){_0x41d740[_0x984f('0x3f')]=_0x1e6d19;return _0x41d740;})[_0x984f('0x22')](respondWithFilteredResult(_0x56d71d,_0x53d93f))[_0x984f('0x40')](handleError(_0x56d71d,null));};exports[_0x984f('0x41')]=function(_0x1c76ef,_0x4a92aa){var _0x45321b={'raw':!![],'where':{'id':_0x1c76ef[_0x984f('0x42')]['id']}},_0x9e082b={};_0x9e082b[_0x984f('0x2b')]=_[_0x984f('0x2d')](db[_0x984f('0x29')][_0x984f('0x43')]);_0x9e082b[_0x984f('0x2c')]=_['keys'](_0x1c76ef[_0x984f('0x2c')]);_0x9e082b[_0x984f('0x2e')]=_[_0x984f('0x2f')](_0x9e082b['model'],_0x9e082b['query']);_0x45321b[_0x984f('0x30')]=_[_0x984f('0x2f')](_0x9e082b[_0x984f('0x2b')],qs['fields'](_0x1c76ef[_0x984f('0x2c')][_0x984f('0x31')]));_0x45321b[_0x984f('0x30')]=_0x45321b[_0x984f('0x30')][_0x984f('0x44')]?_0x45321b[_0x984f('0x30')]:_0x9e082b[_0x984f('0x2b')];if(_0x1c76ef['query']['includeAll']){_0x45321b[_0x984f('0x3d')]=[{'all':!![]}];}_0x45321b=_[_0x984f('0x38')]({},_0x45321b,_0x1c76ef['options']);return db[_0x984f('0x29')]['find'](_0x45321b)[_0x984f('0x22')](handleEntityNotFound(_0x4a92aa,null))[_0x984f('0x22')](respondWithResult(_0x4a92aa,null))[_0x984f('0x40')](handleError(_0x4a92aa,null));};exports[_0x984f('0x45')]=function(_0x4fe305,_0x3f0215){var _0x20a3bc={'where':{'id':_0x4fe305[_0x984f('0x42')]['id']}},_0x33ed43={};_0x33ed43[_0x984f('0x2b')]=_[_0x984f('0x2d')](db[_0x984f('0x29')][_0x984f('0x43')]);_0x20a3bc[_0x984f('0x30')]=_[_0x984f('0x2f')](_0x33ed43[_0x984f('0x2b')],qs[_0x984f('0x31')](_0x4fe305['query']['fields']));_0x20a3bc[_0x984f('0x30')]=_0x20a3bc[_0x984f('0x30')][_0x984f('0x44')]?_0x20a3bc[_0x984f('0x30')]:_0x33ed43[_0x984f('0x2b')];if(_0x4fe305['query']['includeAll']){_0x20a3bc[_0x984f('0x3d')]=[{'all':!![]}];}_0x20a3bc=_[_0x984f('0x38')]({},_0x20a3bc,_0x4fe305[_0x984f('0x3b')]);return db[_0x984f('0x29')]['find'](_0x20a3bc)[_0x984f('0x22')](handleEntityNotFound(_0x3f0215,null))['then'](function(_0x117557){if(_0x117557){var _0x1131d1=_0x117557[_0x984f('0x46')]({'plain':!![]});_0x1131d1=qs[_0x984f('0x47')](_0x1131d1,['id','createdAt',_0x984f('0x48')]);_0x4fe305[_0x984f('0x49')]=_['omit'](_0x4fe305['body'],['id',_0x984f('0x4a'),'updatedAt']);return db[_0x984f('0x29')][_0x984f('0x4b')](_['merge'](_0x1131d1,_0x4fe305[_0x984f('0x49')]),{'include':_0x4fe305[_0x984f('0x2c')][_0x984f('0x3c')]?[{'all':!![]}]:undefined});}})[_0x984f('0x22')](respondWithResult(_0x3f0215,0xc9))[_0x984f('0x40')](handleError(_0x3f0215,null));};exports[_0x984f('0x21')]=function(_0x113584,_0x5c6c87){if(_0x113584[_0x984f('0x49')]['id']){delete _0x113584[_0x984f('0x49')]['id'];}return db[_0x984f('0x29')][_0x984f('0x4c')]({'where':{'id':_0x113584['params']['id']}})[_0x984f('0x22')](handleEntityNotFound(_0x5c6c87,null))['then'](saveUpdates(_0x113584[_0x984f('0x49')],null))[_0x984f('0x22')](respondWithResult(_0x5c6c87,null))[_0x984f('0x40')](handleError(_0x5c6c87,null));};exports[_0x984f('0x4d')]=function(_0x363814,_0x57de31){return db[_0x984f('0x29')][_0x984f('0x4c')]({'where':{'id':_0x363814[_0x984f('0x42')]['id']}})['then'](handleEntityNotFound(_0x57de31,null))['then'](removeEntity(_0x57de31,null))['catch'](handleError(_0x57de31,null));};exports[_0x984f('0x4b')]=function(_0x42363f,_0xba30dd,_0x26a1c9){_0x42363f[_0x984f('0x49')][_0x984f('0x25')]=_0x42363f[_0x984f('0x4e')][_0x984f('0x4f')];_0x42363f['body'][_0x984f('0x50')]=_0x42363f[_0x984f('0x4e')][_0x984f('0x51')];_0x42363f[_0x984f('0x49')][_0x984f('0x39')]=_0x42363f[_0x984f('0x4e')][_0x984f('0x52')];return db[_0x984f('0x29')][_0x984f('0x4b')](_0x42363f[_0x984f('0x49')])[_0x984f('0x22')](respondWithResult(_0xba30dd,0xc9))[_0x984f('0x40')](handleError(_0xba30dd,null));};exports[_0x984f('0x53')]=function(_0x3bc29f,_0x5b12c9,_0x2be444){return db[_0x984f('0x29')][_0x984f('0x54')]({'where':{'id':_0x3bc29f['params']['id']},'raw':!![]})[_0x984f('0x22')](handleEntityNotFound(_0x5b12c9,null))[_0x984f('0x22')](function(_0x52f460){if(_0x52f460){var _0x530010=_0x52f460[_0x984f('0x55')]!==null;var _0x52ecf3=path[_0x984f('0x56')](config[_0x984f('0x57')],_0x984f('0x58'));if(_0x530010){_0x52ecf3=path[_0x984f('0x56')](_0x52ecf3,_0x984f('0x59'));}var _0x4d33f7=path[_0x984f('0x56')](_0x52ecf3,_0x52f460[_0x984f('0x50')]);return _0x5b12c9[_0x984f('0x53')](_0x4d33f7);}})[_0x984f('0x40')](handleError(_0x5b12c9,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index d88cfa2..a72196c 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 _0xc55c=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments'];(function(_0x2882e6,_0x3911c0){var _0x57e9a7=function(_0x15dafb){while(--_0x15dafb){_0x2882e6['push'](_0x2882e6['shift']());}};_0x57e9a7(++_0x3911c0);}(_0xc55c,0x13f));var _0xcc55=function(_0x29efb5,_0x24d85b){_0x29efb5=_0x29efb5-0x0;var _0x30ff45=_0xc55c[_0x29efb5];return _0x30ff45;};'use strict';var _=require(_0xcc55('0x0'));var util=require(_0xcc55('0x1'));var logger=require(_0xcc55('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcc55('0x3'));var fs=require('fs');var path=require(_0xcc55('0x4'));var rimraf=require(_0xcc55('0x5'));var config=require(_0xcc55('0x6'));var attributes=require(_0xcc55('0x7'));module[_0xcc55('0x8')]=function(_0x52f157,_0x14bc07){return _0x52f157[_0xcc55('0x9')]('Attachment',attributes,{'tableName':_0xcc55('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6d3=['request-promise','path','rimraf','exports','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1e24b1,_0x14ab30){var _0x212baf=function(_0x2bd3e9){while(--_0x2bd3e9){_0x1e24b1['push'](_0x1e24b1['shift']());}};_0x212baf(++_0x14ab30);}(_0xe6d3,0xf6));var _0x3e6d=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xe6d3[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x3e6d('0x0'));var util=require(_0x3e6d('0x1'));var logger=require(_0x3e6d('0x2'))(_0x3e6d('0x3'));var moment=require(_0x3e6d('0x4'));var BPromise=require(_0x3e6d('0x5'));var rp=require(_0x3e6d('0x6'));var fs=require('fs');var path=require(_0x3e6d('0x7'));var rimraf=require(_0x3e6d('0x8'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x3e6d('0x9')]=function(_0x42cadc,_0x527676){return _0x42cadc['define'](_0x3e6d('0xa'),attributes,{'tableName':_0x3e6d('0xb'),'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 fd114c8..f5ca6a8 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 _0xb49a=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','body','options','raw','lodash'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xb49a,0xfb));var _0xab49=function(_0x45ea78,_0x31678e){_0x45ea78=_0x45ea78-0x0;var _0xd722b7=_0xb49a[_0x45ea78];return _0xd722b7;};'use strict';var _=require(_0xab49('0x0'));var util=require(_0xab49('0x1'));var moment=require(_0xab49('0x2'));var BPromise=require(_0xab49('0x3'));var rs=require(_0xab49('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab49('0x5'))['db'];var utils=require(_0xab49('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xab49('0x7'));var jayson=require(_0xab49('0x8'));var client=jayson[_0xab49('0x9')][_0xab49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ea72,_0x26a98a,_0xd86a5){return new BPromise(function(_0x4d4d00,_0x15f259){return client[_0xab49('0xb')](_0x57ea72,_0xd86a5)[_0xab49('0xc')](function(_0x79f764){logger[_0xab49('0xd')]('Attachment,\x20%s,\x20%s',_0x26a98a,'request\x20sent');logger[_0xab49('0xe')](_0xab49('0xf'),_0x26a98a,_0xab49('0x10'),JSON[_0xab49('0x11')](_0x79f764));if(_0x79f764[_0xab49('0x12')]){if(_0x79f764['error'][_0xab49('0x13')]===0x1f4){logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);return _0x15f259(_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);}logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);return _0x4d4d00(_0x79f764['error'][_0xab49('0x15')]);}else{logger[_0xab49('0xd')](_0xab49('0x14'),_0x26a98a,_0xab49('0x10'));_0x4d4d00(_0x79f764[_0xab49('0x16')]['message']);}})[_0xab49('0x17')](function(_0x2cbcff){logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x2cbcff);_0x15f259(_0x2cbcff);});});}exports[_0xab49('0x18')]=function(_0x47f977){var _0x167a2a=this;return new Promise(function(_0x24cb8f,_0x28449b){return db['Attachment']['create'](_0x47f977[_0xab49('0x19')],{'raw':_0x47f977[_0xab49('0x1a')]?_0x47f977['options'][_0xab49('0x1b')]===undefined?!![]:![]:!![]})[_0xab49('0xc')](function(_0x49b716){logger[_0xab49('0xd')]('CreateAttachment',_0x47f977);logger[_0xab49('0xe')](_0xab49('0x18'),_0x47f977,JSON['stringify'](_0x49b716));_0x24cb8f(_0x49b716);})['catch'](function(_0x333506){logger['error'](_0xab49('0x18'),_0x333506['message'],_0x47f977);_0x28449b(_0x167a2a[_0xab49('0x12')](0x1f4,_0x333506[_0xab49('0x15')]));});});}; \ No newline at end of file +var _0x402f=['../../config/utils','rpc','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','message','error','CreateAttachment','Attachment','create','options','raw','catch','lodash','moment','ioredis','../../mysqldb'];(function(_0x56b9f0,_0x42676e){var _0x5a00f3=function(_0x4ac9b5){while(--_0x4ac9b5){_0x56b9f0['push'](_0x56b9f0['shift']());}};_0x5a00f3(++_0x42676e);}(_0x402f,0x6f));var _0xf402=function(_0x4af3e7,_0x526823){_0x4af3e7=_0x4af3e7-0x0;var _0x544823=_0x402f[_0x4af3e7];return _0x544823;};'use strict';var _=require(_0xf402('0x0'));var util=require('util');var moment=require(_0xf402('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf402('0x2'));var db=require(_0xf402('0x3'))['db'];var utils=require(_0xf402('0x4'));var logger=require('../../config/logger')(_0xf402('0x5'));var config=require('../../config/environment');var jayson=require(_0xf402('0x6'));var client=jayson[_0xf402('0x7')][_0xf402('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a8774,_0xa1b27d,_0x55c515){return new BPromise(function(_0x4d1771,_0x2f0ffe){return client[_0xf402('0x9')](_0x2a8774,_0x55c515)[_0xf402('0xa')](function(_0xdc18e0){logger[_0xf402('0xb')](_0xf402('0xc'),_0xa1b27d,_0xf402('0xd'));logger[_0xf402('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0xa1b27d,_0xf402('0xd'),JSON['stringify'](_0xdc18e0));if(_0xdc18e0['error']){if(_0xdc18e0['error']['code']===0x1f4){logger['error'](_0xf402('0xc'),_0xa1b27d,_0xdc18e0['error']['message']);return _0x2f0ffe(_0xdc18e0['error'][_0xf402('0xf')]);}logger['error'](_0xf402('0xc'),_0xa1b27d,_0xdc18e0[_0xf402('0x10')][_0xf402('0xf')]);return _0x4d1771(_0xdc18e0[_0xf402('0x10')]['message']);}else{logger[_0xf402('0xb')]('Attachment,\x20%s,\x20%s',_0xa1b27d,_0xf402('0xd'));_0x4d1771(_0xdc18e0['result']['message']);}})['catch'](function(_0xb45d00){logger[_0xf402('0x10')](_0xf402('0xc'),_0xa1b27d,_0xb45d00);_0x2f0ffe(_0xb45d00);});});}exports[_0xf402('0x11')]=function(_0x2fbe36){var _0x5d7236=this;return new Promise(function(_0x3ed3eb,_0x151166){return db[_0xf402('0x12')][_0xf402('0x13')](_0x2fbe36['body'],{'raw':_0x2fbe36[_0xf402('0x14')]?_0x2fbe36[_0xf402('0x14')][_0xf402('0x15')]===undefined?!![]:![]:!![]})[_0xf402('0xa')](function(_0x3d3ed4){logger[_0xf402('0xb')](_0xf402('0x11'),_0x2fbe36);logger[_0xf402('0xe')](_0xf402('0x11'),_0x2fbe36,JSON['stringify'](_0x3d3ed4));_0x3ed3eb(_0x3d3ed4);})[_0xf402('0x16')](function(_0x4ffe46){logger[_0xf402('0x10')](_0xf402('0x11'),_0x4ffe46[_0xf402('0xf')],_0x2fbe36);_0x151166(_0x5d7236[_0xf402('0x10')](0x1f4,_0x4ffe46[_0xf402('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index b43e636..f0a3203 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x27159f,_0x58a856){var _0x4e4c4b=function(_0x4e50ac){while(--_0x4e50ac){_0x27159f['push'](_0x27159f['shift']());}};_0x4e4c4b(++_0x58a856);}(_0x5f2f,0x73));var _0xf5f2=function(_0x385d7f,_0x2e88e0){_0x385d7f=_0x385d7f-0x0;var _0x181a30=_0x5f2f[_0x385d7f];return _0x181a30;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x12be71,_0x35b2e9){var _0xdb495c=function(_0x1a52b6){while(--_0x1a52b6){_0x12be71['push'](_0x12be71['shift']());}};_0xdb495c(++_0x35b2e9);}(_0xb10b,0x12a));var _0xbb10=function(_0x9a138c,_0x2607f8){_0x9a138c=_0x9a138c-0x0;var _0x3771a3=_0xb10b[_0x9a138c];return _0x3771a3;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 49b1c50..89350d4 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 _0xdb8d=['passport-local','Strategy','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','api','activedirectory','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','salt','role','blocked','blockedAt','online','admin','user','agent','then','disabled','blockDuration','minutes','clearBlockUser','getLicense','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','password','passport'];(function(_0x184759,_0x1cc38a){var _0xf26d5f=function(_0x1010c8){while(--_0x1010c8){_0x184759['push'](_0x184759['shift']());}};_0xf26d5f(++_0x1cc38a);}(_0xdb8d,0xe5));var _0xddb8=function(_0x3bc9c9,_0xcaf226){_0x3bc9c9=_0x3bc9c9-0x0;var _0x5414b1=_0xdb8d[_0x3bc9c9];return _0x5414b1;};'use strict';var passport=require(_0xddb8('0x0'));var LocalStrategy=require(_0xddb8('0x1'))[_0xddb8('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xddb8('0x3'));var util=require(_0xddb8('0x4'));var db=require(_0xddb8('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xddb8('0x6'));var config=require(_0xddb8('0x7'));var logger=require('../../config/logger')(_0xddb8('0x8'));function isActiveDirectoryConfigured(_0x3ceefd){var _0x137d0d=![];if(typeof _0x3ceefd['activedirectory']!=='undefined'){_0x137d0d=_0x3ceefd['activedirectory']['baseDN']&&_0x3ceefd[_0xddb8('0x9')][_0xddb8('0xa')]&&_0x3ceefd[_0xddb8('0x9')][_0xddb8('0xb')];}return _0x137d0d;}function adAuthenticate(_0x2724e7,_0x525e11,_0xd370ea){return new BPromise(function(_0x1a668b,_0x4039a5){try{var _0x346b55=new ActiveDirectory(_0x2724e7);_0x346b55[_0xddb8('0xc')](_0x525e11,_0xd370ea,function(_0x365a64,_0x5c6106){if(_0x365a64){logger[_0xddb8('0xd')](_0xddb8('0xe'),_0x525e11,util[_0xddb8('0xf')](_0x365a64,{'showHidden':![],'depth':null}));_0x4039a5(_0xddb8('0x10'));}else if(!_0x5c6106){logger['error'](_0xddb8('0x11'),_0x525e11);_0x4039a5(_0xddb8('0x10'));}else{_0x1a668b(_0x5c6106);}});}catch(_0x34f1f6){_0x4039a5(_0x34f1f6);}});}function ActiveDirectoryAuthenticate(_0x5182f1,_0x44a9c8,_0x209c8c,_0x68c0){var _0x4218b4,_0x17a626;if(!isActiveDirectoryConfigured(config)){logger[_0xddb8('0xd')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x44a9c8);return _0x68c0(null,![],{'message':_0xddb8('0x10')});}return db[_0xddb8('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0xddb8('0x13'),'blockDuration'],'raw':!![]})['then'](function(_0x27b341){_0x4218b4=_0x27b341;if(!_0x4218b4[_0xddb8('0x13')]){logger['error'](_0xddb8('0x14'),_0x44a9c8);throw new Error(_0xddb8('0x10'));}return _0x5182f1[_0xddb8('0x15')]({'attributes':['id',_0xddb8('0x16'),'password',_0xddb8('0x17'),_0xddb8('0x18'),'disabled',_0xddb8('0x19'),_0xddb8('0x1a'),_0xddb8('0x1b')],'where':{'name':_0x44a9c8,'role':{'$or':[_0xddb8('0x1c'),_0xddb8('0x1d'),_0xddb8('0x1e')]},'adSsoEnabled':!![]}});})[_0xddb8('0x1f')](function(_0x106444){if(!_0x106444||_0x106444&&_0x106444[_0xddb8('0x16')]!==_0x44a9c8){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x17a626=_0x106444;var _0xb9dcfe=_0x17a626[_0xddb8('0x16')]+'@'+config[_0xddb8('0x9')][_0xddb8('0xb')];return adAuthenticate(config[_0xddb8('0x9')],_0xb9dcfe,_0x209c8c);})[_0xddb8('0x1f')](function(_0x4c1d0d){if(_0x17a626[_0xddb8('0x20')]){throw new Error(_0xddb8('0x10'));}if(_0x4218b4[_0xddb8('0x21')]>0x0){if(_0x17a626[_0xddb8('0x19')]){if(moment(_0x17a626['blockedAt'])['add'](_0x4218b4[_0xddb8('0x21')],_0xddb8('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xddb8('0x23')](_0x17a626,0x0,![],null)['then'](function(){return utils[_0xddb8('0x24')](_0x17a626);})[_0xddb8('0x1f')](function(){return _0x68c0(null,_0x17a626);});}else{return utils['getLicense'](_0x17a626)['then'](function(){return _0x68c0(null,_0x17a626);});}}else{return utils['getLicense'](_0x17a626)[_0xddb8('0x1f')](function(){return _0x68c0(null,_0x17a626);});}})[_0xddb8('0x25')](function(_0xf8e26a){return _0x68c0(null,![],_0xf8e26a);});}function handleError(_0x2bcd87,_0x334c58,_0x3aaac4){return _0x2bcd87['status'](_0x334c58||0x1f4)[_0xddb8('0x26')]({'message':_0x3aaac4?_0x3aaac4[_0xddb8('0x27')]||_0x3aaac4:''});}exports[_0xddb8('0x28')]=function(_0x5b41d1,_0x2f60e5,_0xe4fc3a){passport[_0xddb8('0xc')](_0xddb8('0x29'),function(_0x48eac2,_0x18d952,_0xbc09fd){var _0x35e2a9=_0x48eac2||_0xbc09fd;if(_0x35e2a9){return handleError(_0x2f60e5,0x191,_0x35e2a9);}if(!_0x18d952){return handleError(_0x2f60e5,0x194,{'message':_0xddb8('0x2a')});}else{var _0x5bff6d={'payload':{'id':_0x18d952['id'],'role':_0x18d952[_0xddb8('0x18')]},'options':{'expiresIn':0x15180}};return authService[_0xddb8('0x2b')](_0x5bff6d)['then'](function(_0x283cda){_0x2f60e5['json']({'id':_0x18d952['id'],'token':_0x283cda,'statusCall':'','isAlreadyLogged':_0x18d952['online']});});}})(_0x5b41d1,_0x2f60e5,_0xe4fc3a);};passport[_0xddb8('0x2c')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0xddb8('0x2d')},function(_0x524b39,_0x37df6f,_0x21b167){return ActiveDirectoryAuthenticate(db['User'],_0x524b39,_0x37df6f,_0x21b167);})); \ No newline at end of file +var _0x5bc9=['../../config/environment','../../config/logger','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','blocked','blockedAt','online','admin','user','agent','name','disabled','add','minutes','clearBlockUser','getLicense','catch','status','send','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x5bc9,0x93));var _0x95bc=function(_0x15d9d0,_0x7c0dc){_0x15d9d0=_0x15d9d0-0x0;var _0x4fb06a=_0x5bc9[_0x15d9d0];return _0x4fb06a;};'use strict';var passport=require(_0x95bc('0x0'));var LocalStrategy=require(_0x95bc('0x1'))[_0x95bc('0x2')];var moment=require(_0x95bc('0x3'));var ActiveDirectory=require(_0x95bc('0x4'));var BPromise=require(_0x95bc('0x5'));var util=require(_0x95bc('0x6'));var db=require(_0x95bc('0x7'))['db'];var authService=require(_0x95bc('0x8'));var utils=require('../../config/utils');var config=require(_0x95bc('0x9'));var logger=require(_0x95bc('0xa'))('api');function isActiveDirectoryConfigured(_0x3bb544){var _0xdd8fa9=![];if(typeof _0x3bb544[_0x95bc('0xb')]!=='undefined'){_0xdd8fa9=_0x3bb544[_0x95bc('0xb')][_0x95bc('0xc')]&&_0x3bb544[_0x95bc('0xb')][_0x95bc('0xd')]&&_0x3bb544[_0x95bc('0xb')][_0x95bc('0xe')];}return _0xdd8fa9;}function adAuthenticate(_0x516301,_0x17c9b4,_0x6a902){return new BPromise(function(_0x112751,_0x264df2){try{var _0x143110=new ActiveDirectory(_0x516301);_0x143110[_0x95bc('0xf')](_0x17c9b4,_0x6a902,function(_0x4f6463,_0x1e1d01){if(_0x4f6463){logger[_0x95bc('0x10')](_0x95bc('0x11'),_0x17c9b4,util[_0x95bc('0x12')](_0x4f6463,{'showHidden':![],'depth':null}));_0x264df2(_0x95bc('0x13'));}else if(!_0x1e1d01){logger['error'](_0x95bc('0x14'),_0x17c9b4);_0x264df2(_0x95bc('0x13'));}else{_0x112751(_0x1e1d01);}});}catch(_0x43719b){_0x264df2(_0x43719b);}});}function ActiveDirectoryAuthenticate(_0x42ccd8,_0x5b27d9,_0x5462d2,_0x1f92fb){var _0x37d120,_0x3cbbff;if(!isActiveDirectoryConfigured(config)){logger[_0x95bc('0x10')](_0x95bc('0x15'),_0x5b27d9);return _0x1f92fb(null,![],{'message':_0x95bc('0x13')});}return db[_0x95bc('0x16')][_0x95bc('0x17')]({'where':{'id':0x1},'attributes':[_0x95bc('0x18'),_0x95bc('0x19')],'raw':!![]})[_0x95bc('0x1a')](function(_0x5069ba){_0x37d120=_0x5069ba;if(!_0x37d120['adSsoEnabled']){logger['error'](_0x95bc('0x1b'),_0x5b27d9);throw new Error(_0x95bc('0x13'));}return _0x42ccd8[_0x95bc('0x17')]({'attributes':['id','name',_0x95bc('0x1c'),_0x95bc('0x1d'),'role','disabled',_0x95bc('0x1e'),_0x95bc('0x1f'),_0x95bc('0x20')],'where':{'name':_0x5b27d9,'role':{'$or':[_0x95bc('0x21'),_0x95bc('0x22'),_0x95bc('0x23')]},'adSsoEnabled':!![]}});})['then'](function(_0x1125d7){if(!_0x1125d7||_0x1125d7&&_0x1125d7[_0x95bc('0x24')]!==_0x5b27d9){throw new Error(_0x95bc('0x13'));}_0x3cbbff=_0x1125d7;var _0x145993=_0x3cbbff[_0x95bc('0x24')]+'@'+config[_0x95bc('0xb')][_0x95bc('0xe')];return adAuthenticate(config['activedirectory'],_0x145993,_0x5462d2);})[_0x95bc('0x1a')](function(_0x8387a0){if(_0x3cbbff[_0x95bc('0x25')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x37d120[_0x95bc('0x19')]>0x0){if(_0x3cbbff[_0x95bc('0x1e')]){if(moment(_0x3cbbff[_0x95bc('0x1f')])[_0x95bc('0x26')](_0x37d120['blockDuration'],_0x95bc('0x27'))>moment()){throw new Error(_0x95bc('0x13'));}return utils[_0x95bc('0x28')](_0x3cbbff,0x0,![],null)[_0x95bc('0x1a')](function(){return utils[_0x95bc('0x29')](_0x3cbbff);})[_0x95bc('0x1a')](function(){return _0x1f92fb(null,_0x3cbbff);});}else{return utils[_0x95bc('0x29')](_0x3cbbff)[_0x95bc('0x1a')](function(){return _0x1f92fb(null,_0x3cbbff);});}}else{return utils[_0x95bc('0x29')](_0x3cbbff)[_0x95bc('0x1a')](function(){return _0x1f92fb(null,_0x3cbbff);});}})[_0x95bc('0x2a')](function(_0x25c9d4){return _0x1f92fb(null,![],_0x25c9d4);});}function handleError(_0x57385a,_0x525596,_0x5d7ac5){return _0x57385a[_0x95bc('0x2b')](_0x525596||0x1f4)[_0x95bc('0x2c')]({'message':_0x5d7ac5?_0x5d7ac5['message']||_0x5d7ac5:''});}exports['login']=function(_0x51c584,_0x21278f,_0x513b54){passport[_0x95bc('0xf')](_0x95bc('0x2d'),function(_0x36448a,_0x5420b7,_0x2a1ec0){var _0x1f7c37=_0x36448a||_0x2a1ec0;if(_0x1f7c37){return handleError(_0x21278f,0x191,_0x1f7c37);}if(!_0x5420b7){return handleError(_0x21278f,0x194,{'message':_0x95bc('0x2e')});}else{var _0x56ee3d={'payload':{'id':_0x5420b7['id'],'role':_0x5420b7[_0x95bc('0x2f')]},'options':{'expiresIn':0x15180}};return authService[_0x95bc('0x30')](_0x56ee3d)[_0x95bc('0x1a')](function(_0x547f9e){_0x21278f[_0x95bc('0x31')]({'id':_0x5420b7['id'],'token':_0x547f9e,'statusCall':'','isAlreadyLogged':_0x5420b7[_0x95bc('0x20')]});});}})(_0x51c584,_0x21278f,_0x513b54);};passport[_0x95bc('0x32')](_0x95bc('0x2d'),new LocalStrategy({'usernameField':'name','passwordField':_0x95bc('0x1c')},function(_0x3da76a,_0x3b67a3,_0x8a96b4){return ActiveDirectoryAuthenticate(db[_0x95bc('0x33')],_0x3da76a,_0x3b67a3,_0x8a96b4);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index e2b15c5..fe8e676 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 _0xadf1=['exports','express','Router','./authActiveDirectory.controller','post'];(function(_0xa82402,_0x2c45f4){var _0x5b7792=function(_0x3bf1ec){while(--_0x3bf1ec){_0xa82402['push'](_0xa82402['shift']());}};_0x5b7792(++_0x2c45f4);}(_0xadf1,0x173));var _0x1adf=function(_0x58ab45,_0x39b818){_0x58ab45=_0x58ab45-0x0;var _0x1f1e5b=_0xadf1[_0x58ab45];return _0x1f1e5b;};'use strict';var express=require(_0x1adf('0x0'));var router=express[_0x1adf('0x1')]();var controller=require(_0x1adf('0x2'));router[_0x1adf('0x3')]('/',controller['login']);module[_0x1adf('0x4')]=router; \ No newline at end of file +var _0x7ba3=['login','exports','express','./authActiveDirectory.controller','post'];(function(_0x370d3d,_0x2b1c24){var _0x15e2a5=function(_0x434903){while(--_0x434903){_0x370d3d['push'](_0x370d3d['shift']());}};_0x15e2a5(++_0x2b1c24);}(_0x7ba3,0x133));var _0x37ba=function(_0x267484,_0x3eb131){_0x267484=_0x267484-0x0;var _0x14a356=_0x7ba3[_0x267484];return _0x14a356;};'use strict';var express=require(_0x37ba('0x0'));var router=express['Router']();var controller=require(_0x37ba('0x1'));router[_0x37ba('0x2')]('/',controller[_0x37ba('0x3')]);module[_0x37ba('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 e4eca0b..6e00210 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(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x7a54,0x106));var _0x47a5=function(_0x2782b5,_0x7476e4){_0x2782b5=_0x2782b5-0x0;var _0x46704a=_0x7a54[_0x2782b5];return _0x46704a;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x436fb2,_0x5cba16){var _0x3cb885=function(_0x1ba810){while(--_0x1ba810){_0x436fb2['push'](_0x436fb2['shift']());}};_0x3cb885(++_0x5cba16);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index b8d0931..a7cfbe4 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 _0x4d9e=['express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','setTokenCookie'];(function(_0x3ed0ab,_0x346f6a){var _0x22756b=function(_0x5c0b77){while(--_0x5c0b77){_0x3ed0ab['push'](_0x3ed0ab['shift']());}};_0x22756b(++_0x346f6a);}(_0x4d9e,0x17c));var _0xe4d9=function(_0x3a59a2,_0x57a4af){_0x3a59a2=_0x3a59a2-0x0;var _0x2923d8=_0x4d9e[_0x3a59a2];return _0x2923d8;};'use strict';var express=require(_0xe4d9('0x0'));var passport=require(_0xe4d9('0x1'));var router=express['Router']();var controller=require(_0xe4d9('0x2'));var userController=require(_0xe4d9('0x3'));var authService=require(_0xe4d9('0x4'));router[_0xe4d9('0x5')]('/',controller[_0xe4d9('0x6')]);router[_0xe4d9('0x5')](_0xe4d9('0x7'),controller[_0xe4d9('0x8')],authService['isMiddleware'],userController['login'],authService[_0xe4d9('0x9')]);module['exports']=router; \ No newline at end of file +var _0xa2ad=['get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x20b7f9,_0x4fcb64){var _0x4df976=function(_0x3b7694){while(--_0x3b7694){_0x20b7f9['push'](_0x20b7f9['shift']());}};_0x4df976(++_0x4fcb64);}(_0xa2ad,0xa3));var _0xda2a=function(_0x232cf2,_0x4ffb79){_0x232cf2=_0x232cf2-0x0;var _0x463cec=_0xa2ad[_0x232cf2];return _0x463cec;};'use strict';var express=require(_0xda2a('0x0'));var passport=require(_0xda2a('0x1'));var router=express[_0xda2a('0x2')]();var controller=require(_0xda2a('0x3'));var userController=require(_0xda2a('0x4'));var authService=require(_0xda2a('0x5'));router[_0xda2a('0x6')]('/',controller[_0xda2a('0x7')]);router[_0xda2a('0x6')](_0xda2a('0x8'),controller[_0xda2a('0x9')],authService[_0xda2a('0xa')],userController[_0xda2a('0x7')],authService[_0xda2a('0xb')]);module[_0xda2a('0xc')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 49dcc6d..de8d5f9 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 _0xf046=['Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','Setting','securePassword','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','validatePasswordHistory','util','passport','passport-local','Strategy','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','blocked','blockedAt','add','clearBlockUser','minutes','getLicense','catch','MailAccount','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','\x22%s\x22\x20<%s>','email','request','SendMail','error','format','stringify','send','login','authenticate','local-login','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','disabled','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'];(function(_0x191dcc,_0x400b2d){var _0x5ccf3e=function(_0x30aa8d){while(--_0x30aa8d){_0x191dcc['push'](_0x191dcc['shift']());}};_0x5ccf3e(++_0x400b2d);}(_0xf046,0x10d));var _0x6f04=function(_0xac8e9c,_0x2570bd){_0xac8e9c=_0xac8e9c-0x0;var _0x4eab81=_0xf046[_0xac8e9c];return _0x4eab81;};'use strict';var util=require(_0x6f04('0x0'));var passport=require(_0x6f04('0x1'));var LocalStrategy=require(_0x6f04('0x2'))[_0x6f04('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x6f04('0x4'));var moment=require('moment');var db=require(_0x6f04('0x5'))['db'];var authService=require(_0x6f04('0x6'));var utils=require(_0x6f04('0x7'));var client=jayson[_0x6f04('0x8')][_0x6f04('0x9')]({'port':0x232b});function localAuthenticate(_0x56092e,_0x3eba7c,_0x7fdc44,_0x5de7b3){var _0x167b44,_0x347a88;return db['Setting'][_0x6f04('0xa')]({'where':{'id':0x1},'attributes':[_0x6f04('0xb'),_0x6f04('0xc')],'raw':!![]})[_0x6f04('0xd')](function(_0x55cbb4){_0x167b44=_0x55cbb4;return _0x56092e[_0x6f04('0xa')]({'attributes':['id',_0x6f04('0xe'),_0x6f04('0xf'),_0x6f04('0x10'),_0x6f04('0x11'),'disabled','blocked','blockedAt','loginAttempts'],'where':{'name':_0x3eba7c,'role':{'$or':[_0x6f04('0x12'),'user',_0x6f04('0x13')]}}});})['then'](function(_0x2283fa){if(!_0x2283fa||_0x2283fa&&_0x2283fa[_0x6f04('0xe')]!==_0x3eba7c){throw new Error(_0x6f04('0x14'));}else{_0x347a88=_0x2283fa;return _0x347a88;}})[_0x6f04('0xd')](function(){_0x347a88['authenticate'](_0x7fdc44,function(_0x58ef27,_0x575bf1){var _0x2a7e40=_0x347a88[_0x6f04('0x15')]+0x1;if(_0x58ef27){return _0x5de7b3(_0x58ef27);}else if(!_0x575bf1){if(_0x347a88['disabled']){return _0x5de7b3(null,![],{'message':_0x6f04('0x14')});}else if(_0x167b44[_0x6f04('0xb')]>0x0){if(_0x347a88[_0x6f04('0x16')]){if(_0x167b44[_0x6f04('0xc')]>0x0){if(moment(_0x347a88[_0x6f04('0x17')])[_0x6f04('0x18')](_0x167b44[_0x6f04('0xc')],'minutes')>moment()){return _0x5de7b3(null,![],{'message':_0x6f04('0x14')});}else{return utils['clearBlockUser'](_0x347a88,_0x2a7e40,![],null)[_0x6f04('0xd')](function(){return _0x5de7b3(null,![],{'message':_0x6f04('0x14')});});}}else{return _0x5de7b3(null,![],{'message':_0x6f04('0x14')});}}else{if(_0x2a7e40>=_0x167b44[_0x6f04('0xb')]){return utils[_0x6f04('0x19')](_0x347a88,0x0,!![],moment())[_0x6f04('0xd')](function(){return _0x5de7b3(null,![],{'message':_0x6f04('0x14')});});}else{return utils[_0x6f04('0x19')](_0x347a88,_0x2a7e40,![],null)[_0x6f04('0xd')](function(){return _0x5de7b3(null,![],{'message':_0x6f04('0x14')});});}}}else{return _0x5de7b3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x347a88['disabled']){return _0x5de7b3(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x167b44['allowedLoginAttempts']>0x0){if(_0x347a88[_0x6f04('0x16')]){if(_0x167b44[_0x6f04('0xc')]>0x0){if(moment(_0x347a88['blockedAt'])['add'](_0x167b44[_0x6f04('0xc')],_0x6f04('0x1a'))>moment()){return _0x5de7b3(null,![],{'message':_0x6f04('0x14')});}else{return utils[_0x6f04('0x19')](_0x347a88,0x0,![],null)['then'](function(){return utils[_0x6f04('0x1b')](_0x347a88);})[_0x6f04('0xd')](function(){return _0x5de7b3(null,_0x347a88);});}}else{return _0x5de7b3(null,![],{'message':_0x6f04('0x14')});}}else{return utils[_0x6f04('0x19')](_0x347a88,0x0,![],null)[_0x6f04('0xd')](function(){return utils[_0x6f04('0x1b')](_0x347a88);})[_0x6f04('0xd')](function(){return _0x5de7b3(null,_0x347a88);})['catch'](function(_0x265313){return _0x5de7b3(null,![],_0x265313);});}}else{if(_0x347a88['blocked']){return _0x5de7b3(null,![],{'message':_0x6f04('0x14')});}else{return utils[_0x6f04('0x1b')](_0x347a88)[_0x6f04('0xd')](function(){return _0x5de7b3(null,_0x347a88);});}}}});})[_0x6f04('0x1c')](function(_0x4c09c4){return _0x5de7b3(null,![],_0x4c09c4);});}function sendServiceMail(_0x184ca4){return db[_0x6f04('0x1d')]['find']({'where':{'service':!![]},'attributes':['id',_0x6f04('0xe'),'email'],'include':[{'model':db[_0x6f04('0x1e')],'as':_0x6f04('0x1f'),'include':[{'model':db[_0x6f04('0x20')],'as':_0x6f04('0x20')}]}]})[_0x6f04('0xd')](function(_0x49f70f){if(!_0x49f70f){throw new Error(_0x6f04('0x21'));}var _0x557334=_0x49f70f['getSmtpOptions']();var _0x1249cb={'account':_0x557334,'message':_[_0x6f04('0x22')]({'from':util['format'](_0x6f04('0x23'),_0x49f70f[_0x6f04('0xe')],_0x49f70f[_0x6f04('0x24')]||_0x49f70f[_0x6f04('0x1f')]['user'])},_0x184ca4)};return client[_0x6f04('0x25')](_0x6f04('0x26'),_0x1249cb);})[_0x6f04('0xd')](function(_0x5e6d95){if(_0x5e6d95[_0x6f04('0x27')]){throw new Error(util[_0x6f04('0x28')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x5e6d95[_0x6f04('0x27')]['message']||JSON[_0x6f04('0x29')](_0x5e6d95['error'])));}return!![];});}function handleError(_0x54f92b,_0x37a01a,_0x126073){return _0x54f92b['status'](_0x37a01a||0x1f4)[_0x6f04('0x2a')]({'message':_0x126073?_0x126073['message']||_0x126073:''});}exports[_0x6f04('0x2b')]=function(_0x5103c6,_0x3f186a,_0x588481){passport[_0x6f04('0x2c')](_0x6f04('0x2d'),function(_0x4eb94c,_0x325219,_0x559b89){var _0x65f89f=_0x4eb94c||_0x559b89;if(_0x65f89f){return handleError(_0x3f186a,0x191,_0x65f89f);}if(!_0x325219){return handleError(_0x3f186a,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x27cfdf={'payload':{'id':_0x325219['id'],'role':_0x325219['role']},'options':{'expiresIn':0x15180}};return authService[_0x6f04('0x2e')](_0x27cfdf)['then'](function(_0x22a12e){_0x3f186a[_0x6f04('0x2f')]({'id':_0x325219['id'],'token':_0x22a12e,'statusCall':'','isAlreadyLogged':_0x325219[_0x6f04('0x30')]});});}})(_0x5103c6,_0x3f186a,_0x588481);};exports[_0x6f04('0x31')]=function(_0x3425a6,_0x41eedd){if(!_0x3425a6[_0x6f04('0x32')][_0x6f04('0x24')]){return handleError(_0x41eedd,0x1f4,{'message':_0x6f04('0x33')});}var _0x39a0c2=rs[_0x6f04('0x34')]();_0x3425a6['body'][_0x6f04('0x24')]=_0x3425a6[_0x6f04('0x32')]['email'][_0x6f04('0x35')]()[_0x6f04('0x36')]();var _0x4ebd;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x6f04('0xc')],'raw':!![]})[_0x6f04('0xd')](function(_0x4310a8){_0x4ebd=_0x4310a8;return db[_0x6f04('0x37')][_0x6f04('0x38')]({'where':{'email':_0x3425a6['body'][_0x6f04('0x24')]}});})[_0x6f04('0xd')](function(_0x4fef35){if(!_0x4fef35){throw new Error(_0x6f04('0x39'));}if(_0x4fef35[_0x6f04('0x3a')]){throw new Error(_0x6f04('0x3b'));}if(_0x4fef35['blocked']){if(moment(_0x4fef35[_0x6f04('0x17')])['add'](_0x4ebd['blockDuration'],'minutes')>moment()){throw new Error(_0x6f04('0x3c'));}else{_0x4fef35[_0x6f04('0x16')]=![];_0x4fef35[_0x6f04('0x17')]=null;}}_0x4fef35[_0x6f04('0x3d')]=_0x39a0c2;_0x4fef35[_0x6f04('0x3e')]=Date[_0x6f04('0x3f')]()+0x36ee80;return _0x4fef35[_0x6f04('0x40')]();})[_0x6f04('0xd')](function(){return sendServiceMail({'to':_0x3425a6[_0x6f04('0x32')][_0x6f04('0x24')],'subject':_0x6f04('0x41'),'text':_0x6f04('0x42')+_0x6f04('0x43')+_0x6f04('0x44')+_0x3425a6[_0x6f04('0x45')]['host']+_0x6f04('0x46')+_0x39a0c2+'\x0a\x0a'+_0x6f04('0x47')});})[_0x6f04('0xd')](function(){_0x41eedd[_0x6f04('0x48')](0xc8)['send']({'message':_0x6f04('0x49')});})[_0x6f04('0x1c')](function(_0x195d27){return handleError(_0x41eedd,0x1f4,_0x195d27);});};exports[_0x6f04('0x4a')]=function(_0x3f63c1,_0x17c2f9){return db['User'][_0x6f04('0x38')]({'where':{'resetPasswordToken':_0x3f63c1[_0x6f04('0x4b')][_0x6f04('0x4c')],'resetPasswordExpires':{'$gt':Date[_0x6f04('0x3f')]()}}})[_0x6f04('0xd')](function(_0x14fd3e){if(!_0x14fd3e){throw new Error(_0x6f04('0x4d'));}return db[_0x6f04('0x4e')][_0x6f04('0xa')]({'attributes':['id',_0x6f04('0x4f'),'enforcePasswordHistory',_0x6f04('0x50')]})[_0x6f04('0xd')](function(_0x11c06b){if(_0x11c06b[_0x6f04('0x4f')])authService['validatePasswordPattern'](_0x3f63c1['body'][_0x6f04('0xf')]);if(!_0x11c06b[_0x6f04('0x51')]||!_0x14fd3e[_0x6f04('0x52')])return _0x14fd3e;authService[_0x6f04('0x53')](_0x3f63c1[_0x6f04('0x32')][_0x6f04('0xf')],_0x14fd3e[_0x6f04('0x52')],_0x11c06b[_0x6f04('0x50')]);return _0x14fd3e;})[_0x6f04('0xd')](function(){_0x14fd3e[_0x6f04('0xf')]=_0x3f63c1[_0x6f04('0x32')][_0x6f04('0xf')];_0x14fd3e[_0x6f04('0x3d')]=null;_0x14fd3e['resetPasswordExpires']=null;return _0x14fd3e[_0x6f04('0x40')]();});})[_0x6f04('0xd')](function(){_0x17c2f9[_0x6f04('0x48')](0xc8)[_0x6f04('0x2a')]({'message':'Password\x20reset!'});})[_0x6f04('0x1c')](function(_0x4a84b1){return handleError(_0x17c2f9,0x1f4,_0x4a84b1);});};passport['use'](_0x6f04('0x2d'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x6a29ff,_0x4c5369,_0x30beb0){return localAuthenticate(db[_0x6f04('0x37')],_0x6a29ff,_0x4c5369,_0x30beb0);})); \ No newline at end of file +var _0x48e4=['add','clearBlockUser','minutes','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','Reset\x20Email\x20sent!','reset','params','token','now','securePassword','enforcePasswordHistory','previousPasswords','resetPasswordToken','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','client','http','allowedLoginAttempts','blockDuration','then','findOne','password','role','disabled','blocked','blockedAt','admin','user','agent','name','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x4bea82,_0x3e54a6){var _0x39dd76=function(_0x331d00){while(--_0x331d00){_0x4bea82['push'](_0x4bea82['shift']());}};_0x39dd76(++_0x3e54a6);}(_0x48e4,0x126));var _0x448e=function(_0x5f53d5,_0x317b0f){_0x5f53d5=_0x5f53d5-0x0;var _0x5749cc=_0x48e4[_0x5f53d5];return _0x5749cc;};'use strict';var util=require(_0x448e('0x0'));var passport=require(_0x448e('0x1'));var LocalStrategy=require(_0x448e('0x2'))[_0x448e('0x3')];var jayson=require(_0x448e('0x4'));var _=require(_0x448e('0x5'));var rs=require(_0x448e('0x6'));var moment=require('moment');var db=require(_0x448e('0x7'))['db'];var authService=require(_0x448e('0x8'));var utils=require('../../config/utils');var client=jayson[_0x448e('0x9')][_0x448e('0xa')]({'port':0x232b});function localAuthenticate(_0xbd24d4,_0x374c23,_0x372df5,_0x43d96f){var _0x45ac8e,_0x1a3538;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x448e('0xb'),_0x448e('0xc')],'raw':!![]})[_0x448e('0xd')](function(_0x138e65){_0x45ac8e=_0x138e65;return _0xbd24d4[_0x448e('0xe')]({'attributes':['id','name',_0x448e('0xf'),'salt',_0x448e('0x10'),_0x448e('0x11'),_0x448e('0x12'),_0x448e('0x13'),'loginAttempts'],'where':{'name':_0x374c23,'role':{'$or':[_0x448e('0x14'),_0x448e('0x15'),_0x448e('0x16')]}}});})[_0x448e('0xd')](function(_0x576225){if(!_0x576225||_0x576225&&_0x576225[_0x448e('0x17')]!==_0x374c23){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1a3538=_0x576225;return _0x1a3538;}})[_0x448e('0xd')](function(){_0x1a3538[_0x448e('0x18')](_0x372df5,function(_0x46f14b,_0x40e7ef){var _0x5a3039=_0x1a3538['loginAttempts']+0x1;if(_0x46f14b){return _0x43d96f(_0x46f14b);}else if(!_0x40e7ef){if(_0x1a3538[_0x448e('0x11')]){return _0x43d96f(null,![],{'message':_0x448e('0x19')});}else if(_0x45ac8e[_0x448e('0xb')]>0x0){if(_0x1a3538[_0x448e('0x12')]){if(_0x45ac8e[_0x448e('0xc')]>0x0){if(moment(_0x1a3538[_0x448e('0x13')])[_0x448e('0x1a')](_0x45ac8e['blockDuration'],'minutes')>moment()){return _0x43d96f(null,![],{'message':_0x448e('0x19')});}else{return utils[_0x448e('0x1b')](_0x1a3538,_0x5a3039,![],null)[_0x448e('0xd')](function(){return _0x43d96f(null,![],{'message':_0x448e('0x19')});});}}else{return _0x43d96f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x5a3039>=_0x45ac8e[_0x448e('0xb')]){return utils[_0x448e('0x1b')](_0x1a3538,0x0,!![],moment())[_0x448e('0xd')](function(){return _0x43d96f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x448e('0x1b')](_0x1a3538,_0x5a3039,![],null)[_0x448e('0xd')](function(){return _0x43d96f(null,![],{'message':_0x448e('0x19')});});}}}else{return _0x43d96f(null,![],{'message':_0x448e('0x19')});}}else{if(_0x1a3538[_0x448e('0x11')]){return _0x43d96f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x45ac8e[_0x448e('0xb')]>0x0){if(_0x1a3538[_0x448e('0x12')]){if(_0x45ac8e[_0x448e('0xc')]>0x0){if(moment(_0x1a3538[_0x448e('0x13')])[_0x448e('0x1a')](_0x45ac8e['blockDuration'],_0x448e('0x1c'))>moment()){return _0x43d96f(null,![],{'message':_0x448e('0x19')});}else{return utils[_0x448e('0x1b')](_0x1a3538,0x0,![],null)['then'](function(){return utils[_0x448e('0x1d')](_0x1a3538);})['then'](function(){return _0x43d96f(null,_0x1a3538);});}}else{return _0x43d96f(null,![],{'message':_0x448e('0x19')});}}else{return utils[_0x448e('0x1b')](_0x1a3538,0x0,![],null)[_0x448e('0xd')](function(){return utils[_0x448e('0x1d')](_0x1a3538);})[_0x448e('0xd')](function(){return _0x43d96f(null,_0x1a3538);})[_0x448e('0x1e')](function(_0xb83ea0){return _0x43d96f(null,![],_0xb83ea0);});}}else{if(_0x1a3538[_0x448e('0x12')]){return _0x43d96f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x448e('0x1d')](_0x1a3538)['then'](function(){return _0x43d96f(null,_0x1a3538);});}}}});})[_0x448e('0x1e')](function(_0x9ea4d){return _0x43d96f(null,![],_0x9ea4d);});}function sendServiceMail(_0x84ce48){return db['MailAccount'][_0x448e('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0x448e('0x20')],'include':[{'model':db[_0x448e('0x21')],'as':_0x448e('0x22'),'include':[{'model':db[_0x448e('0x23')],'as':_0x448e('0x23')}]}]})['then'](function(_0x1fbfd8){if(!_0x1fbfd8){throw new Error(_0x448e('0x24'));}var _0x31a5ae=_0x1fbfd8[_0x448e('0x25')]();var _0x266255={'account':_0x31a5ae,'message':_[_0x448e('0x26')]({'from':util[_0x448e('0x27')](_0x448e('0x28'),_0x1fbfd8[_0x448e('0x17')],_0x1fbfd8[_0x448e('0x20')]||_0x1fbfd8[_0x448e('0x22')][_0x448e('0x15')])},_0x84ce48)};return client[_0x448e('0x29')]('SendMail',_0x266255);})[_0x448e('0xd')](function(_0x53114e){if(_0x53114e[_0x448e('0x2a')]){throw new Error(util[_0x448e('0x27')](_0x448e('0x2b'),_0x53114e[_0x448e('0x2a')][_0x448e('0x2c')]||JSON[_0x448e('0x2d')](_0x53114e[_0x448e('0x2a')])));}return!![];});}function handleError(_0x6aaaa6,_0x48f3ed,_0x475c98){return _0x6aaaa6['status'](_0x48f3ed||0x1f4)[_0x448e('0x2e')]({'message':_0x475c98?_0x475c98['message']||_0x475c98:''});}exports['login']=function(_0x17170f,_0x51c489,_0x48342b){passport[_0x448e('0x18')](_0x448e('0x2f'),function(_0x5ba985,_0xd5afd1,_0x4a4372){var _0x2052a4=_0x5ba985||_0x4a4372;if(_0x2052a4){return handleError(_0x51c489,0x191,_0x2052a4);}if(!_0xd5afd1){return handleError(_0x51c489,0x194,{'message':_0x448e('0x30')});}else{var _0xc91447={'payload':{'id':_0xd5afd1['id'],'role':_0xd5afd1[_0x448e('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x448e('0x31')](_0xc91447)[_0x448e('0xd')](function(_0x48b063){_0x51c489['json']({'id':_0xd5afd1['id'],'token':_0x48b063,'statusCall':'','isAlreadyLogged':_0xd5afd1[_0x448e('0x32')]});});}})(_0x17170f,_0x51c489,_0x48342b);};exports[_0x448e('0x33')]=function(_0x250988,_0x3fa6ed){if(!_0x250988['body'][_0x448e('0x20')]){return handleError(_0x3fa6ed,0x1f4,{'message':_0x448e('0x34')});}var _0x5333f9=rs[_0x448e('0x35')]();_0x250988[_0x448e('0x36')][_0x448e('0x20')]=_0x250988[_0x448e('0x36')][_0x448e('0x20')][_0x448e('0x37')]()[_0x448e('0x38')]();var _0x6ada55;return db[_0x448e('0x39')]['findOne']({'where':{'id':0x1},'attributes':[_0x448e('0xb'),_0x448e('0xc')],'raw':!![]})['then'](function(_0x2fc8f2){_0x6ada55=_0x2fc8f2;return db[_0x448e('0x3a')][_0x448e('0x1f')]({'where':{'email':_0x250988[_0x448e('0x36')][_0x448e('0x20')]}});})[_0x448e('0xd')](function(_0x366bd4){if(!_0x366bd4){throw new Error(_0x448e('0x3b'));}if(_0x366bd4['disabled']){throw new Error(_0x448e('0x3c'));}if(_0x366bd4[_0x448e('0x12')]){if(moment(_0x366bd4[_0x448e('0x13')])[_0x448e('0x1a')](_0x6ada55[_0x448e('0xc')],_0x448e('0x1c'))>moment()){throw new Error(_0x448e('0x3d'));}else{_0x366bd4[_0x448e('0x12')]=![];_0x366bd4['blockedAt']=null;}}_0x366bd4['resetPasswordToken']=_0x5333f9;_0x366bd4['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x366bd4[_0x448e('0x3e')]();})[_0x448e('0xd')](function(){return sendServiceMail({'to':_0x250988[_0x448e('0x36')][_0x448e('0x20')],'subject':_0x448e('0x3f'),'text':_0x448e('0x40')+_0x448e('0x41')+'https://'+_0x250988[_0x448e('0x42')]['host']+_0x448e('0x43')+_0x5333f9+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x448e('0xd')](function(){_0x3fa6ed['status'](0xc8)['send']({'message':_0x448e('0x44')});})[_0x448e('0x1e')](function(_0x418140){return handleError(_0x3fa6ed,0x1f4,_0x418140);});};exports[_0x448e('0x45')]=function(_0x46ad64,_0x5df23e){return db[_0x448e('0x3a')][_0x448e('0x1f')]({'where':{'resetPasswordToken':_0x46ad64[_0x448e('0x46')][_0x448e('0x47')],'resetPasswordExpires':{'$gt':Date[_0x448e('0x48')]()}}})[_0x448e('0xd')](function(_0x509648){if(!_0x509648){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x448e('0x39')][_0x448e('0xe')]({'attributes':['id',_0x448e('0x49'),_0x448e('0x4a'),'passwordHistoryLimit']})[_0x448e('0xd')](function(_0x13d493){if(_0x13d493[_0x448e('0x49')])authService['validatePasswordPattern'](_0x46ad64[_0x448e('0x36')][_0x448e('0xf')]);if(!_0x13d493[_0x448e('0x4a')]||!_0x509648[_0x448e('0x4b')])return _0x509648;authService['validatePasswordHistory'](_0x46ad64[_0x448e('0x36')][_0x448e('0xf')],_0x509648[_0x448e('0x4b')],_0x13d493['passwordHistoryLimit']);return _0x509648;})[_0x448e('0xd')](function(){_0x509648['password']=_0x46ad64['body'][_0x448e('0xf')];_0x509648[_0x448e('0x4c')]=null;_0x509648[_0x448e('0x4d')]=null;return _0x509648['save']();});})[_0x448e('0xd')](function(){_0x5df23e['status'](0xc8)[_0x448e('0x2e')]({'message':_0x448e('0x4e')});})[_0x448e('0x1e')](function(_0x2d0a7c){return handleError(_0x5df23e,0x1f4,_0x2d0a7c);});};passport[_0x448e('0x4f')](_0x448e('0x2f'),new LocalStrategy({'usernameField':_0x448e('0x17'),'passwordField':_0x448e('0xf')},function(_0x278657,_0x261b00,_0x109338){return localAuthenticate(db['User'],_0x278657,_0x261b00,_0x109338);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 332b106..4e600fb 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 _0x60f7=['post','express','Router','./authLocal.controller','login'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x60f7,0x123));var _0x760f=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x60f7[_0x164eca];return _0x2ce562;};'use strict';var express=require(_0x760f('0x0'));var router=express[_0x760f('0x1')]();var controller=require(_0x760f('0x2'));router['post']('/',controller[_0x760f('0x3')]);router[_0x760f('0x4')]('/forgot',controller['forgot']);router['post']('/reset/:token',controller['reset']);module['exports']=router; \ No newline at end of file +var _0x35ac=['./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports','Router'];(function(_0x2febd4,_0x28a82d){var _0x3c9b77=function(_0x1412c8){while(--_0x1412c8){_0x2febd4['push'](_0x2febd4['shift']());}};_0x3c9b77(++_0x28a82d);}(_0x35ac,0x167));var _0xc35a=function(_0x30deed,_0x1825f0){_0x30deed=_0x30deed-0x0;var _0x217863=_0x35ac[_0x30deed];return _0x217863;};'use strict';var express=require('express');var router=express[_0xc35a('0x0')]();var controller=require(_0xc35a('0x1'));router[_0xc35a('0x2')]('/',controller[_0xc35a('0x3')]);router['post'](_0xc35a('0x4'),controller[_0xc35a('0x5')]);router[_0xc35a('0x2')](_0xc35a('0x6'),controller[_0xc35a('0x7')]);module[_0xc35a('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 44c2926..456d260 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 _0x3fcf=['sequelize','STRING'];(function(_0x259f0c,_0x389f24){var _0x4147db=function(_0xeba8db){while(--_0xeba8db){_0x259f0c['push'](_0x259f0c['shift']());}};_0x4147db(++_0x389f24);}(_0x3fcf,0x1f0));var _0xf3fc=function(_0xc645b8,_0x2ca923){_0xc645b8=_0xc645b8-0x0;var _0x1dab25=_0x3fcf[_0xc645b8];return _0x1dab25;};'use strict';var Sequelize=require(_0xf3fc('0x0'));module['exports']={'name':{'type':Sequelize[_0xf3fc('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xf3fc('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0xc7b7=['STRING','BOOLEAN','sequelize','exports'];(function(_0xc36fe1,_0x4e8695){var _0x48ce2a=function(_0x59d307){while(--_0x59d307){_0xc36fe1['push'](_0xc36fe1['shift']());}};_0x48ce2a(++_0x4e8695);}(_0xc7b7,0x6a));var _0x7c7b=function(_0x28111f,_0x254934){_0x28111f=_0x28111f-0x0;var _0x5203e6=_0xc7b7[_0x28111f];return _0x5203e6;};'use strict';var Sequelize=require(_0x7c7b('0x0'));module[_0x7c7b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x7c7b('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x7c7b('0x3')],'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 23bc8dd..be5941f 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 _0x2150=['fields','find','catch','create','update','body','destroy','addConditions','Condition','omit','ids','getConditions','length','nolimit','addActions','Action','getActions','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Automation','include','findAll','params','keys'];(function(_0x5ac0f0,_0xee4d98){var _0x4aceec=function(_0x3a9044){while(--_0x3a9044){_0x5ac0f0['push'](_0x5ac0f0['shift']());}};_0x4aceec(++_0xee4d98);}(_0x2150,0x67));var _0x0215=function(_0x8e8ca7,_0x5a5e07){_0x8e8ca7=_0x8e8ca7-0x0;var _0x561381=_0x2150[_0x8e8ca7];return _0x561381;};'use strict';var emlformat=require(_0x0215('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0215('0x1'));var jsonpatch=require(_0x0215('0x2'));var rp=require(_0x0215('0x3'));var moment=require(_0x0215('0x4'));var BPromise=require(_0x0215('0x5'));var Mustache=require(_0x0215('0x6'));var util=require(_0x0215('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x0215('0x8'));var ejs=require(_0x0215('0x9'));var fs=require('fs');var fs_extra=require(_0x0215('0xa'));var _=require(_0x0215('0xb'));var squel=require(_0x0215('0xc'));var crypto=require('crypto');var jsforce=require(_0x0215('0xd'));var deskjs=require(_0x0215('0xe'));var toCsv=require(_0x0215('0x8'));var querystring=require(_0x0215('0xf'));var Papa=require(_0x0215('0x10'));var Redis=require(_0x0215('0x11'));var authService=require(_0x0215('0x12'));var qs=require(_0x0215('0x13'));var as=require(_0x0215('0x14'));var hardwareService=require(_0x0215('0x15'));var logger=require(_0x0215('0x16'))('api');var utils=require(_0x0215('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0215('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5467c4,_0x4593d9){_0x4593d9=_0x4593d9||0xcc;return function(_0x4e37e8){if(_0x4e37e8){return _0x5467c4[_0x0215('0x19')](_0x4593d9);}return _0x5467c4[_0x0215('0x1a')](_0x4593d9)[_0x0215('0x1b')]();};}function respondWithResult(_0x2e8aba,_0x2e6bbb){_0x2e6bbb=_0x2e6bbb||0xc8;return function(_0x494c3f){if(_0x494c3f){return _0x2e8aba[_0x0215('0x1a')](_0x2e6bbb)[_0x0215('0x1c')](_0x494c3f);}};}function respondWithFilteredResult(_0x187335,_0x19e0f6){return function(_0x35671a){if(_0x35671a){var _0x26eac4=typeof _0x19e0f6[_0x0215('0x1d')]===_0x0215('0x1e')&&typeof _0x19e0f6[_0x0215('0x1f')]===_0x0215('0x1e');var _0x590f0f=_0x35671a['count'];var _0x3b4526=_0x26eac4?0x0:_0x19e0f6[_0x0215('0x1d')];var _0x4d7209=_0x26eac4?_0x35671a[_0x0215('0x20')]:_0x19e0f6[_0x0215('0x1d')]+_0x19e0f6[_0x0215('0x1f')];var _0x24fd4a;if(_0x4d7209>=_0x590f0f){_0x4d7209=_0x590f0f;_0x24fd4a=0xc8;}else{_0x24fd4a=0xce;}_0x187335['status'](_0x24fd4a);return _0x187335[_0x0215('0x21')](_0x0215('0x22'),_0x3b4526+'-'+_0x4d7209+'/'+_0x590f0f)['json'](_0x35671a);}return null;};}function patchUpdates(_0x4b8699){return function(_0x2d1f6e){try{jsonpatch[_0x0215('0x23')](_0x2d1f6e,_0x4b8699,!![]);}catch(_0x572a51){return BPromise[_0x0215('0x24')](_0x572a51);}return _0x2d1f6e[_0x0215('0x25')]();};}function saveUpdates(_0x54597f,_0x16a02d){return function(_0x2d188a){if(_0x2d188a){return _0x2d188a['update'](_0x54597f)[_0x0215('0x26')](function(_0x508991){return _0x508991;});}return null;};}function removeEntity(_0x3314b5,_0x51f837){return function(_0x8407a9){if(_0x8407a9){return _0x8407a9['destroy']()[_0x0215('0x26')](function(){_0x3314b5['status'](0xcc)[_0x0215('0x1b')]();});}};}function handleEntityNotFound(_0x139ee4,_0x121f9f){return function(_0x85a1ae){if(!_0x85a1ae){_0x139ee4['sendStatus'](0x194);}return _0x85a1ae;};}function handleError(_0x1bc945,_0x439321){_0x439321=_0x439321||0x1f4;return function(_0x1a7358){logger['error'](_0x1a7358[_0x0215('0x27')]);if(_0x1a7358[_0x0215('0x28')]){delete _0x1a7358[_0x0215('0x28')];}_0x1bc945[_0x0215('0x1a')](_0x439321)[_0x0215('0x29')](_0x1a7358);};}exports[_0x0215('0x2a')]=function(_0x2fa84a,_0x44ed4f){var _0x3184dd={},_0x5f292d={},_0x28ad76={'count':0x0,'rows':[]};var _0x48644f=_[_0x0215('0x2b')](db['Automation'][_0x0215('0x2c')],function(_0x5d5001){return{'name':_0x5d5001[_0x0215('0x2d')],'type':_0x5d5001['type'][_0x0215('0x2e')]};});_0x5f292d[_0x0215('0x2f')]=_[_0x0215('0x2b')](_0x48644f,_0x0215('0x28'));_0x5f292d[_0x0215('0x30')]=_['keys'](_0x2fa84a['query']);_0x5f292d[_0x0215('0x31')]=_['intersection'](_0x5f292d[_0x0215('0x2f')],_0x5f292d[_0x0215('0x30')]);_0x3184dd[_0x0215('0x32')]=_[_0x0215('0x33')](_0x5f292d[_0x0215('0x2f')],qs['fields'](_0x2fa84a[_0x0215('0x30')]['fields']));_0x3184dd['attributes']=_0x3184dd[_0x0215('0x32')]['length']?_0x3184dd[_0x0215('0x32')]:_0x5f292d[_0x0215('0x2f')];if(!_0x2fa84a[_0x0215('0x30')][_0x0215('0x34')]('nolimit')){_0x3184dd[_0x0215('0x1f')]=qs[_0x0215('0x1f')](_0x2fa84a[_0x0215('0x30')][_0x0215('0x1f')]);_0x3184dd['offset']=qs[_0x0215('0x1d')](_0x2fa84a[_0x0215('0x30')][_0x0215('0x1d')]);}_0x3184dd[_0x0215('0x35')]=qs[_0x0215('0x36')](_0x2fa84a['query'][_0x0215('0x36')]);_0x3184dd[_0x0215('0x37')]=qs[_0x0215('0x31')](_[_0x0215('0x38')](_0x2fa84a['query'],_0x5f292d[_0x0215('0x31')]),_0x48644f);if(_0x2fa84a[_0x0215('0x30')][_0x0215('0x39')]){_0x3184dd[_0x0215('0x37')]=_[_0x0215('0x3a')](_0x3184dd[_0x0215('0x37')],{'$or':_[_0x0215('0x2b')](_0x48644f,function(_0x250ba9){if(_0x250ba9[_0x0215('0x3b')]!==_0x0215('0x3c')){var _0x3c6837={};_0x3c6837[_0x250ba9['name']]={'$like':'%'+_0x2fa84a[_0x0215('0x30')][_0x0215('0x39')]+'%'};return _0x3c6837;}})});}_0x3184dd=_[_0x0215('0x3a')]({},_0x3184dd,_0x2fa84a[_0x0215('0x3d')]);var _0x1e0f36={'where':_0x3184dd[_0x0215('0x37')]};return db[_0x0215('0x3e')][_0x0215('0x20')](_0x1e0f36)[_0x0215('0x26')](function(_0x160b53){_0x28ad76[_0x0215('0x20')]=_0x160b53;if(_0x2fa84a[_0x0215('0x30')]['includeAll']){_0x3184dd[_0x0215('0x3f')]=[{'all':!![]}];}return db['Automation'][_0x0215('0x40')](_0x3184dd);})[_0x0215('0x26')](function(_0x2b404d){_0x28ad76['rows']=_0x2b404d;return _0x28ad76;})[_0x0215('0x26')](respondWithFilteredResult(_0x44ed4f,_0x3184dd))['catch'](handleError(_0x44ed4f,null));};exports['show']=function(_0x1ccd29,_0xb43c3a){var _0x4769f7={'raw':![],'where':{'id':_0x1ccd29[_0x0215('0x41')]['id']}},_0xd6c18e={};_0xd6c18e[_0x0215('0x2f')]=_['keys'](db[_0x0215('0x3e')][_0x0215('0x2c')]);_0xd6c18e[_0x0215('0x30')]=_[_0x0215('0x42')](_0x1ccd29[_0x0215('0x30')]);_0xd6c18e['filters']=_[_0x0215('0x33')](_0xd6c18e[_0x0215('0x2f')],_0xd6c18e['query']);_0x4769f7[_0x0215('0x32')]=_[_0x0215('0x33')](_0xd6c18e['model'],qs[_0x0215('0x43')](_0x1ccd29[_0x0215('0x30')][_0x0215('0x43')]));_0x4769f7[_0x0215('0x32')]=_0x4769f7['attributes']['length']?_0x4769f7['attributes']:_0xd6c18e[_0x0215('0x2f')];if(_0x1ccd29[_0x0215('0x30')]['includeAll']){_0x4769f7[_0x0215('0x3f')]=[{'all':!![]}];}_0x4769f7=_[_0x0215('0x3a')]({},_0x4769f7,_0x1ccd29['options']);return db[_0x0215('0x3e')][_0x0215('0x44')](_0x4769f7)['then'](handleEntityNotFound(_0xb43c3a,null))[_0x0215('0x26')](respondWithResult(_0xb43c3a,null))[_0x0215('0x45')](handleError(_0xb43c3a,null));};exports['create']=function(_0x25b8d2,_0x29769f){return db[_0x0215('0x3e')][_0x0215('0x46')](_0x25b8d2['body'],{})[_0x0215('0x26')](respondWithResult(_0x29769f,0xc9))['catch'](handleError(_0x29769f,null));};exports[_0x0215('0x47')]=function(_0x478805,_0x116b8d){if(_0x478805['body']['id']){delete _0x478805['body']['id'];}return db[_0x0215('0x3e')][_0x0215('0x44')]({'where':{'id':_0x478805[_0x0215('0x41')]['id']}})[_0x0215('0x26')](handleEntityNotFound(_0x116b8d,null))[_0x0215('0x26')](saveUpdates(_0x478805[_0x0215('0x48')],null))[_0x0215('0x26')](respondWithResult(_0x116b8d,null))[_0x0215('0x45')](handleError(_0x116b8d,null));};exports[_0x0215('0x49')]=function(_0x5e2850,_0x287a84){return db[_0x0215('0x3e')][_0x0215('0x44')]({'where':{'id':_0x5e2850[_0x0215('0x41')]['id']}})[_0x0215('0x26')](handleEntityNotFound(_0x287a84,null))[_0x0215('0x26')](removeEntity(_0x287a84,null))['catch'](handleError(_0x287a84,null));};exports[_0x0215('0x4a')]=function(_0x1d8cf6,_0x4f04dd,_0x335f2d){return db[_0x0215('0x4b')][_0x0215('0x44')]({'where':{'id':_0x1d8cf6[_0x0215('0x41')]['id']}})['then'](handleEntityNotFound(_0x4f04dd,null))[_0x0215('0x26')](function(_0xb57404){if(_0xb57404){return _0xb57404[_0x0215('0x4a')](_0x1d8cf6[_0x0215('0x48')]['ids'],_[_0x0215('0x4c')](_0x1d8cf6[_0x0215('0x48')],[_0x0215('0x4d'),'id'])||{});}})[_0x0215('0x26')](respondWithResult(_0x4f04dd,null))[_0x0215('0x45')](handleError(_0x4f04dd,null));};exports[_0x0215('0x4e')]=function(_0x462a10,_0x5a623e,_0x29d6eb){var _0x23bec5={};var _0x2039a0={};var _0xe170eb;var _0x5ef48;return db[_0x0215('0x3e')]['findOne']({'where':{'id':_0x462a10['params']['id']}})[_0x0215('0x26')](handleEntityNotFound(_0x5a623e,null))[_0x0215('0x26')](function(_0x4f929f){if(_0x4f929f){_0xe170eb=_0x4f929f;_0x2039a0[_0x0215('0x2f')]=_['keys'](db['Condition'][_0x0215('0x2c')]);_0x2039a0[_0x0215('0x30')]=_[_0x0215('0x42')](_0x462a10[_0x0215('0x30')]);_0x2039a0[_0x0215('0x31')]=_[_0x0215('0x33')](_0x2039a0['model'],_0x2039a0[_0x0215('0x30')]);_0x23bec5['attributes']=_['intersection'](_0x2039a0[_0x0215('0x2f')],qs['fields'](_0x462a10['query'][_0x0215('0x43')]));_0x23bec5[_0x0215('0x32')]=_0x23bec5[_0x0215('0x32')]['length']?_0x23bec5[_0x0215('0x32')]:_0x2039a0['model'];_0x23bec5['order']=qs[_0x0215('0x36')](_0x462a10[_0x0215('0x30')][_0x0215('0x36')]);_0x23bec5[_0x0215('0x37')]=qs[_0x0215('0x31')](_[_0x0215('0x38')](_0x462a10[_0x0215('0x30')],_0x2039a0[_0x0215('0x31')]));if(_0x462a10[_0x0215('0x30')][_0x0215('0x39')]){_0x23bec5['where']=_[_0x0215('0x3a')](_0x23bec5['where'],{'$or':_[_0x0215('0x2b')](_0x23bec5[_0x0215('0x32')],function(_0x5cb338){var _0x5ecb30={};_0x5ecb30[_0x5cb338]={'$like':'%'+_0x462a10[_0x0215('0x30')][_0x0215('0x39')]+'%'};return _0x5ecb30;})});}_0x23bec5=_[_0x0215('0x3a')]({},_0x23bec5,_0x462a10[_0x0215('0x3d')]);return _0xe170eb['getConditions'](_0x23bec5);}})['then'](function(_0x397a66){if(_0x397a66){_0x5ef48=_0x397a66[_0x0215('0x4f')];if(!_0x462a10[_0x0215('0x30')][_0x0215('0x34')](_0x0215('0x50'))){_0x23bec5[_0x0215('0x1f')]=qs[_0x0215('0x1f')](_0x462a10[_0x0215('0x30')]['limit']);_0x23bec5['offset']=qs[_0x0215('0x1d')](_0x462a10[_0x0215('0x30')][_0x0215('0x1d')]);}return _0xe170eb['getConditions'](_0x23bec5);}})[_0x0215('0x26')](function(_0xa2e800){if(_0xa2e800){return _0xa2e800?{'count':_0x5ef48,'rows':_0xa2e800}:null;}})[_0x0215('0x26')](respondWithResult(_0x5a623e,null))['catch'](handleError(_0x5a623e,null));};exports[_0x0215('0x51')]=function(_0x2557e9,_0x411f0e,_0x5afd7c){return db[_0x0215('0x52')][_0x0215('0x44')]({'where':{'id':_0x2557e9['params']['id']}})[_0x0215('0x26')](handleEntityNotFound(_0x411f0e,null))['then'](function(_0x401b94){if(_0x401b94){return _0x401b94[_0x0215('0x51')](_0x2557e9[_0x0215('0x48')][_0x0215('0x4d')],_['omit'](_0x2557e9[_0x0215('0x48')],[_0x0215('0x4d'),'id'])||{});}})[_0x0215('0x26')](respondWithResult(_0x411f0e,null))[_0x0215('0x45')](handleError(_0x411f0e,null));};exports[_0x0215('0x53')]=function(_0x129741,_0x19af1f,_0x27233c){var _0x5ad417={};var _0x33a228={};var _0x58907c;var _0x7cad08;return db[_0x0215('0x3e')][_0x0215('0x54')]({'where':{'id':_0x129741[_0x0215('0x41')]['id']}})[_0x0215('0x26')](handleEntityNotFound(_0x19af1f,null))[_0x0215('0x26')](function(_0x27bf92){if(_0x27bf92){_0x58907c=_0x27bf92;_0x33a228[_0x0215('0x2f')]=_[_0x0215('0x42')](db[_0x0215('0x52')][_0x0215('0x2c')]);_0x33a228[_0x0215('0x30')]=_[_0x0215('0x42')](_0x129741[_0x0215('0x30')]);_0x33a228[_0x0215('0x31')]=_[_0x0215('0x33')](_0x33a228[_0x0215('0x2f')],_0x33a228[_0x0215('0x30')]);_0x5ad417[_0x0215('0x32')]=_[_0x0215('0x33')](_0x33a228['model'],qs['fields'](_0x129741[_0x0215('0x30')]['fields']));_0x5ad417['attributes']=_0x5ad417['attributes'][_0x0215('0x4f')]?_0x5ad417[_0x0215('0x32')]:_0x33a228[_0x0215('0x2f')];_0x5ad417['order']=qs[_0x0215('0x36')](_0x129741[_0x0215('0x30')][_0x0215('0x36')]);_0x5ad417[_0x0215('0x37')]=qs[_0x0215('0x31')](_[_0x0215('0x38')](_0x129741[_0x0215('0x30')],_0x33a228[_0x0215('0x31')]));if(_0x129741[_0x0215('0x30')][_0x0215('0x39')]){_0x5ad417[_0x0215('0x37')]=_['merge'](_0x5ad417['where'],{'$or':_[_0x0215('0x2b')](_0x5ad417[_0x0215('0x32')],function(_0xe63f0c){var _0x34e526={};_0x34e526[_0xe63f0c]={'$like':'%'+_0x129741[_0x0215('0x30')]['filter']+'%'};return _0x34e526;})});}_0x5ad417=_[_0x0215('0x3a')]({},_0x5ad417,_0x129741[_0x0215('0x3d')]);return _0x58907c['getActions'](_0x5ad417);}})[_0x0215('0x26')](function(_0x560a30){if(_0x560a30){_0x7cad08=_0x560a30[_0x0215('0x4f')];if(!_0x129741[_0x0215('0x30')]['hasOwnProperty']('nolimit')){_0x5ad417[_0x0215('0x1f')]=qs[_0x0215('0x1f')](_0x129741['query'][_0x0215('0x1f')]);_0x5ad417['offset']=qs[_0x0215('0x1d')](_0x129741[_0x0215('0x30')][_0x0215('0x1d')]);}return _0x58907c[_0x0215('0x53')](_0x5ad417);}})['then'](function(_0x27f78d){if(_0x27f78d){return _0x27f78d?{'count':_0x7cad08,'rows':_0x27f78d}:null;}})['then'](respondWithResult(_0x19af1f,null))['catch'](handleError(_0x19af1f,null));}; \ No newline at end of file +var _0x9e6e=['set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','Automation','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','catch','create','body','params','addConditions','Condition','ids','getConditions','sort','hasOwnProperty','Action','omit','getActions','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset'];(function(_0x5de214,_0x107e9d){var _0x4df627=function(_0x4199e1){while(--_0x4199e1){_0x5de214['push'](_0x5de214['shift']());}};_0x4df627(++_0x107e9d);}(_0x9e6e,0x12e));var _0xe9e6=function(_0x479dfd,_0x47ff77){_0x479dfd=_0x479dfd-0x0;var _0x5b82b4=_0x9e6e[_0x479dfd];return _0x5b82b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9e6('0x0'));var zipdir=require(_0xe9e6('0x1'));var jsonpatch=require(_0xe9e6('0x2'));var rp=require(_0xe9e6('0x3'));var moment=require(_0xe9e6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe9e6('0x5'));var util=require(_0xe9e6('0x6'));var path=require(_0xe9e6('0x7'));var sox=require(_0xe9e6('0x8'));var csv=require(_0xe9e6('0x9'));var ejs=require(_0xe9e6('0xa'));var fs=require('fs');var fs_extra=require(_0xe9e6('0xb'));var _=require('lodash');var squel=require(_0xe9e6('0xc'));var crypto=require(_0xe9e6('0xd'));var jsforce=require(_0xe9e6('0xe'));var deskjs=require(_0xe9e6('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe9e6('0x10'));var Papa=require('papaparse');var Redis=require(_0xe9e6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe9e6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9e6('0x13'))(_0xe9e6('0x14'));var utils=require('../../config/utils');var config=require(_0xe9e6('0x15'));var licenseUtil=require(_0xe9e6('0x16'));var db=require(_0xe9e6('0x17'))['db'];function respondWithStatusCode(_0x4c4671,_0x3a2af7){_0x3a2af7=_0x3a2af7||0xcc;return function(_0x52bfaf){if(_0x52bfaf){return _0x4c4671['sendStatus'](_0x3a2af7);}return _0x4c4671[_0xe9e6('0x18')](_0x3a2af7)['end']();};}function respondWithResult(_0x5bfe18,_0x2d34ea){_0x2d34ea=_0x2d34ea||0xc8;return function(_0x116967){if(_0x116967){return _0x5bfe18[_0xe9e6('0x18')](_0x2d34ea)[_0xe9e6('0x19')](_0x116967);}};}function respondWithFilteredResult(_0x2ca322,_0x28cea7){return function(_0x491e56){if(_0x491e56){var _0x14a56d=typeof _0x28cea7['offset']===_0xe9e6('0x1a')&&typeof _0x28cea7[_0xe9e6('0x1b')]==='undefined';var _0x104d7c=_0x491e56[_0xe9e6('0x1c')];var _0x34bfc4=_0x14a56d?0x0:_0x28cea7[_0xe9e6('0x1d')];var _0x5874c1=_0x14a56d?_0x491e56[_0xe9e6('0x1c')]:_0x28cea7[_0xe9e6('0x1d')]+_0x28cea7[_0xe9e6('0x1b')];var _0x173c26;if(_0x5874c1>=_0x104d7c){_0x5874c1=_0x104d7c;_0x173c26=0xc8;}else{_0x173c26=0xce;}_0x2ca322[_0xe9e6('0x18')](_0x173c26);return _0x2ca322[_0xe9e6('0x1e')]('Content-Range',_0x34bfc4+'-'+_0x5874c1+'/'+_0x104d7c)['json'](_0x491e56);}return null;};}function patchUpdates(_0xd69fa6){return function(_0x1e7160){try{jsonpatch[_0xe9e6('0x1f')](_0x1e7160,_0xd69fa6,!![]);}catch(_0x176b2c){return BPromise['reject'](_0x176b2c);}return _0x1e7160[_0xe9e6('0x20')]();};}function saveUpdates(_0x45dd61,_0x2b5ea5){return function(_0x19a179){if(_0x19a179){return _0x19a179[_0xe9e6('0x21')](_0x45dd61)[_0xe9e6('0x22')](function(_0x59a29d){return _0x59a29d;});}return null;};}function removeEntity(_0x26a47f,_0x494639){return function(_0x3b5e36){if(_0x3b5e36){return _0x3b5e36[_0xe9e6('0x23')]()[_0xe9e6('0x22')](function(){_0x26a47f[_0xe9e6('0x18')](0xcc)[_0xe9e6('0x24')]();});}};}function handleEntityNotFound(_0x207b43,_0x565e63){return function(_0x274cc5){if(!_0x274cc5){_0x207b43[_0xe9e6('0x25')](0x194);}return _0x274cc5;};}function handleError(_0x97217,_0x223e84){_0x223e84=_0x223e84||0x1f4;return function(_0x22e7f3){logger[_0xe9e6('0x26')](_0x22e7f3[_0xe9e6('0x27')]);if(_0x22e7f3[_0xe9e6('0x28')]){delete _0x22e7f3[_0xe9e6('0x28')];}_0x97217['status'](_0x223e84)[_0xe9e6('0x29')](_0x22e7f3);};}exports['index']=function(_0x35cffd,_0x2ae056){var _0x5ac634={},_0x45848c={},_0x1ce18b={'count':0x0,'rows':[]};var _0x1e6560=_[_0xe9e6('0x2a')](db[_0xe9e6('0x2b')][_0xe9e6('0x2c')],function(_0x4f150b){return{'name':_0x4f150b[_0xe9e6('0x2d')],'type':_0x4f150b[_0xe9e6('0x2e')][_0xe9e6('0x2f')]};});_0x45848c[_0xe9e6('0x30')]=_['map'](_0x1e6560,_0xe9e6('0x28'));_0x45848c['query']=_[_0xe9e6('0x31')](_0x35cffd[_0xe9e6('0x32')]);_0x45848c[_0xe9e6('0x33')]=_[_0xe9e6('0x34')](_0x45848c[_0xe9e6('0x30')],_0x45848c[_0xe9e6('0x32')]);_0x5ac634[_0xe9e6('0x35')]=_['intersection'](_0x45848c[_0xe9e6('0x30')],qs[_0xe9e6('0x36')](_0x35cffd[_0xe9e6('0x32')]['fields']));_0x5ac634[_0xe9e6('0x35')]=_0x5ac634[_0xe9e6('0x35')][_0xe9e6('0x37')]?_0x5ac634[_0xe9e6('0x35')]:_0x45848c[_0xe9e6('0x30')];if(!_0x35cffd[_0xe9e6('0x32')]['hasOwnProperty'](_0xe9e6('0x38'))){_0x5ac634[_0xe9e6('0x1b')]=qs[_0xe9e6('0x1b')](_0x35cffd[_0xe9e6('0x32')][_0xe9e6('0x1b')]);_0x5ac634[_0xe9e6('0x1d')]=qs[_0xe9e6('0x1d')](_0x35cffd[_0xe9e6('0x32')][_0xe9e6('0x1d')]);}_0x5ac634[_0xe9e6('0x39')]=qs['sort'](_0x35cffd[_0xe9e6('0x32')]['sort']);_0x5ac634[_0xe9e6('0x3a')]=qs[_0xe9e6('0x33')](_[_0xe9e6('0x3b')](_0x35cffd[_0xe9e6('0x32')],_0x45848c[_0xe9e6('0x33')]),_0x1e6560);if(_0x35cffd[_0xe9e6('0x32')][_0xe9e6('0x3c')]){_0x5ac634[_0xe9e6('0x3a')]=_[_0xe9e6('0x3d')](_0x5ac634['where'],{'$or':_[_0xe9e6('0x2a')](_0x1e6560,function(_0x29eb40){if(_0x29eb40[_0xe9e6('0x2e')]!==_0xe9e6('0x3e')){var _0x5b2bbf={};_0x5b2bbf[_0x29eb40[_0xe9e6('0x28')]]={'$like':'%'+_0x35cffd['query']['filter']+'%'};return _0x5b2bbf;}})});}_0x5ac634=_[_0xe9e6('0x3d')]({},_0x5ac634,_0x35cffd[_0xe9e6('0x3f')]);var _0xcff5bd={'where':_0x5ac634[_0xe9e6('0x3a')]};return db[_0xe9e6('0x2b')]['count'](_0xcff5bd)['then'](function(_0x3d13fb){_0x1ce18b[_0xe9e6('0x1c')]=_0x3d13fb;if(_0x35cffd[_0xe9e6('0x32')][_0xe9e6('0x40')]){_0x5ac634[_0xe9e6('0x41')]=[{'all':!![]}];}return db[_0xe9e6('0x2b')][_0xe9e6('0x42')](_0x5ac634);})[_0xe9e6('0x22')](function(_0x1ecbe0){_0x1ce18b[_0xe9e6('0x43')]=_0x1ecbe0;return _0x1ce18b;})['then'](respondWithFilteredResult(_0x2ae056,_0x5ac634))['catch'](handleError(_0x2ae056,null));};exports['show']=function(_0x2a66d6,_0x30457f){var _0x52796c={'raw':![],'where':{'id':_0x2a66d6['params']['id']}},_0x242323={};_0x242323[_0xe9e6('0x30')]=_[_0xe9e6('0x31')](db[_0xe9e6('0x2b')]['rawAttributes']);_0x242323[_0xe9e6('0x32')]=_[_0xe9e6('0x31')](_0x2a66d6['query']);_0x242323[_0xe9e6('0x33')]=_['intersection'](_0x242323[_0xe9e6('0x30')],_0x242323[_0xe9e6('0x32')]);_0x52796c[_0xe9e6('0x35')]=_[_0xe9e6('0x34')](_0x242323[_0xe9e6('0x30')],qs[_0xe9e6('0x36')](_0x2a66d6[_0xe9e6('0x32')][_0xe9e6('0x36')]));_0x52796c[_0xe9e6('0x35')]=_0x52796c[_0xe9e6('0x35')][_0xe9e6('0x37')]?_0x52796c[_0xe9e6('0x35')]:_0x242323[_0xe9e6('0x30')];if(_0x2a66d6['query'][_0xe9e6('0x40')]){_0x52796c['include']=[{'all':!![]}];}_0x52796c=_['merge']({},_0x52796c,_0x2a66d6['options']);return db[_0xe9e6('0x2b')][_0xe9e6('0x44')](_0x52796c)[_0xe9e6('0x22')](handleEntityNotFound(_0x30457f,null))[_0xe9e6('0x22')](respondWithResult(_0x30457f,null))[_0xe9e6('0x45')](handleError(_0x30457f,null));};exports[_0xe9e6('0x46')]=function(_0x465c79,_0x3e8c7d){return db[_0xe9e6('0x2b')][_0xe9e6('0x46')](_0x465c79[_0xe9e6('0x47')],{})[_0xe9e6('0x22')](respondWithResult(_0x3e8c7d,0xc9))[_0xe9e6('0x45')](handleError(_0x3e8c7d,null));};exports[_0xe9e6('0x21')]=function(_0x4cae64,_0x309cca){if(_0x4cae64[_0xe9e6('0x47')]['id']){delete _0x4cae64['body']['id'];}return db['Automation']['find']({'where':{'id':_0x4cae64['params']['id']}})[_0xe9e6('0x22')](handleEntityNotFound(_0x309cca,null))[_0xe9e6('0x22')](saveUpdates(_0x4cae64[_0xe9e6('0x47')],null))[_0xe9e6('0x22')](respondWithResult(_0x309cca,null))[_0xe9e6('0x45')](handleError(_0x309cca,null));};exports[_0xe9e6('0x23')]=function(_0x165b43,_0x197fdc){return db[_0xe9e6('0x2b')][_0xe9e6('0x44')]({'where':{'id':_0x165b43[_0xe9e6('0x48')]['id']}})['then'](handleEntityNotFound(_0x197fdc,null))['then'](removeEntity(_0x197fdc,null))[_0xe9e6('0x45')](handleError(_0x197fdc,null));};exports[_0xe9e6('0x49')]=function(_0x271075,_0x2741e0,_0x3a4b6f){return db[_0xe9e6('0x4a')][_0xe9e6('0x44')]({'where':{'id':_0x271075[_0xe9e6('0x48')]['id']}})[_0xe9e6('0x22')](handleEntityNotFound(_0x2741e0,null))[_0xe9e6('0x22')](function(_0x3d6197){if(_0x3d6197){return _0x3d6197[_0xe9e6('0x49')](_0x271075[_0xe9e6('0x47')][_0xe9e6('0x4b')],_['omit'](_0x271075['body'],[_0xe9e6('0x4b'),'id'])||{});}})[_0xe9e6('0x22')](respondWithResult(_0x2741e0,null))['catch'](handleError(_0x2741e0,null));};exports[_0xe9e6('0x4c')]=function(_0x511309,_0x183af5,_0x2a9fc2){var _0x59e49f={};var _0x50d9ca={};var _0x547d9e;var _0x4d8da6;return db[_0xe9e6('0x2b')]['findOne']({'where':{'id':_0x511309[_0xe9e6('0x48')]['id']}})[_0xe9e6('0x22')](handleEntityNotFound(_0x183af5,null))['then'](function(_0x305ecc){if(_0x305ecc){_0x547d9e=_0x305ecc;_0x50d9ca[_0xe9e6('0x30')]=_[_0xe9e6('0x31')](db[_0xe9e6('0x4a')][_0xe9e6('0x2c')]);_0x50d9ca[_0xe9e6('0x32')]=_[_0xe9e6('0x31')](_0x511309[_0xe9e6('0x32')]);_0x50d9ca['filters']=_[_0xe9e6('0x34')](_0x50d9ca[_0xe9e6('0x30')],_0x50d9ca[_0xe9e6('0x32')]);_0x59e49f[_0xe9e6('0x35')]=_['intersection'](_0x50d9ca[_0xe9e6('0x30')],qs['fields'](_0x511309[_0xe9e6('0x32')][_0xe9e6('0x36')]));_0x59e49f[_0xe9e6('0x35')]=_0x59e49f['attributes']['length']?_0x59e49f[_0xe9e6('0x35')]:_0x50d9ca['model'];_0x59e49f['order']=qs[_0xe9e6('0x4d')](_0x511309[_0xe9e6('0x32')][_0xe9e6('0x4d')]);_0x59e49f[_0xe9e6('0x3a')]=qs[_0xe9e6('0x33')](_[_0xe9e6('0x3b')](_0x511309[_0xe9e6('0x32')],_0x50d9ca[_0xe9e6('0x33')]));if(_0x511309[_0xe9e6('0x32')]['filter']){_0x59e49f[_0xe9e6('0x3a')]=_[_0xe9e6('0x3d')](_0x59e49f[_0xe9e6('0x3a')],{'$or':_[_0xe9e6('0x2a')](_0x59e49f[_0xe9e6('0x35')],function(_0x19f827){var _0x25b205={};_0x25b205[_0x19f827]={'$like':'%'+_0x511309[_0xe9e6('0x32')][_0xe9e6('0x3c')]+'%'};return _0x25b205;})});}_0x59e49f=_[_0xe9e6('0x3d')]({},_0x59e49f,_0x511309['options']);return _0x547d9e['getConditions'](_0x59e49f);}})[_0xe9e6('0x22')](function(_0x306a07){if(_0x306a07){_0x4d8da6=_0x306a07[_0xe9e6('0x37')];if(!_0x511309[_0xe9e6('0x32')][_0xe9e6('0x4e')]('nolimit')){_0x59e49f[_0xe9e6('0x1b')]=qs['limit'](_0x511309[_0xe9e6('0x32')]['limit']);_0x59e49f[_0xe9e6('0x1d')]=qs[_0xe9e6('0x1d')](_0x511309[_0xe9e6('0x32')]['offset']);}return _0x547d9e[_0xe9e6('0x4c')](_0x59e49f);}})[_0xe9e6('0x22')](function(_0x2bc01d){if(_0x2bc01d){return _0x2bc01d?{'count':_0x4d8da6,'rows':_0x2bc01d}:null;}})[_0xe9e6('0x22')](respondWithResult(_0x183af5,null))[_0xe9e6('0x45')](handleError(_0x183af5,null));};exports['addActions']=function(_0x36b547,_0x228453,_0x1c0e1b){return db[_0xe9e6('0x4f')]['find']({'where':{'id':_0x36b547[_0xe9e6('0x48')]['id']}})[_0xe9e6('0x22')](handleEntityNotFound(_0x228453,null))[_0xe9e6('0x22')](function(_0xdf54e2){if(_0xdf54e2){return _0xdf54e2['addActions'](_0x36b547[_0xe9e6('0x47')]['ids'],_[_0xe9e6('0x50')](_0x36b547['body'],[_0xe9e6('0x4b'),'id'])||{});}})[_0xe9e6('0x22')](respondWithResult(_0x228453,null))[_0xe9e6('0x45')](handleError(_0x228453,null));};exports[_0xe9e6('0x51')]=function(_0x3de6a1,_0x3bfee2,_0x322a64){var _0x1be6bb={};var _0x560299={};var _0x3a7abf;var _0x417b76;return db[_0xe9e6('0x2b')][_0xe9e6('0x52')]({'where':{'id':_0x3de6a1[_0xe9e6('0x48')]['id']}})[_0xe9e6('0x22')](handleEntityNotFound(_0x3bfee2,null))[_0xe9e6('0x22')](function(_0x56f782){if(_0x56f782){_0x3a7abf=_0x56f782;_0x560299['model']=_[_0xe9e6('0x31')](db[_0xe9e6('0x4f')][_0xe9e6('0x2c')]);_0x560299[_0xe9e6('0x32')]=_['keys'](_0x3de6a1[_0xe9e6('0x32')]);_0x560299[_0xe9e6('0x33')]=_[_0xe9e6('0x34')](_0x560299[_0xe9e6('0x30')],_0x560299['query']);_0x1be6bb[_0xe9e6('0x35')]=_[_0xe9e6('0x34')](_0x560299[_0xe9e6('0x30')],qs['fields'](_0x3de6a1[_0xe9e6('0x32')][_0xe9e6('0x36')]));_0x1be6bb[_0xe9e6('0x35')]=_0x1be6bb[_0xe9e6('0x35')]['length']?_0x1be6bb[_0xe9e6('0x35')]:_0x560299['model'];_0x1be6bb[_0xe9e6('0x39')]=qs['sort'](_0x3de6a1[_0xe9e6('0x32')][_0xe9e6('0x4d')]);_0x1be6bb[_0xe9e6('0x3a')]=qs['filters'](_[_0xe9e6('0x3b')](_0x3de6a1[_0xe9e6('0x32')],_0x560299[_0xe9e6('0x33')]));if(_0x3de6a1[_0xe9e6('0x32')][_0xe9e6('0x3c')]){_0x1be6bb[_0xe9e6('0x3a')]=_[_0xe9e6('0x3d')](_0x1be6bb['where'],{'$or':_['map'](_0x1be6bb[_0xe9e6('0x35')],function(_0x1e64e1){var _0xf2b8a7={};_0xf2b8a7[_0x1e64e1]={'$like':'%'+_0x3de6a1[_0xe9e6('0x32')][_0xe9e6('0x3c')]+'%'};return _0xf2b8a7;})});}_0x1be6bb=_['merge']({},_0x1be6bb,_0x3de6a1[_0xe9e6('0x3f')]);return _0x3a7abf[_0xe9e6('0x51')](_0x1be6bb);}})['then'](function(_0x32460b){if(_0x32460b){_0x417b76=_0x32460b[_0xe9e6('0x37')];if(!_0x3de6a1[_0xe9e6('0x32')][_0xe9e6('0x4e')](_0xe9e6('0x38'))){_0x1be6bb['limit']=qs[_0xe9e6('0x1b')](_0x3de6a1['query']['limit']);_0x1be6bb[_0xe9e6('0x1d')]=qs[_0xe9e6('0x1d')](_0x3de6a1[_0xe9e6('0x32')]['offset']);}return _0x3a7abf[_0xe9e6('0x51')](_0x1be6bb);}})['then'](function(_0x479ef0){if(_0x479ef0){return _0x479ef0?{'count':_0x417b76,'rows':_0x479ef0}:null;}})[_0xe9e6('0x22')](respondWithResult(_0x3bfee2,null))[_0xe9e6('0x45')](handleError(_0x3bfee2,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 5df4337..fcf3f17 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 _0xbf25=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','define','tools_automations','lodash','util'];(function(_0x3fa4ce,_0x4a6cd0){var _0x1a6a54=function(_0x3e74df){while(--_0x3e74df){_0x3fa4ce['push'](_0x3fa4ce['shift']());}};_0x1a6a54(++_0x4a6cd0);}(_0xbf25,0x196));var _0x5bf2=function(_0x487091,_0x2e22f7){_0x487091=_0x487091-0x0;var _0x2918d8=_0xbf25[_0x487091];return _0x2918d8;};'use strict';var _=require(_0x5bf2('0x0'));var util=require(_0x5bf2('0x1'));var logger=require(_0x5bf2('0x2'))(_0x5bf2('0x3'));var moment=require(_0x5bf2('0x4'));var BPromise=require(_0x5bf2('0x5'));var rp=require(_0x5bf2('0x6'));var fs=require('fs');var path=require(_0x5bf2('0x7'));var rimraf=require('rimraf');var config=require(_0x5bf2('0x8'));var attributes=require(_0x5bf2('0x9'));module['exports']=function(_0x12f34c,_0x1aeccf){return _0x12f34c[_0x5bf2('0xa')]('Automation',attributes,{'tableName':_0x5bf2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77dd=['../../config/logger','api','moment','request-promise','path','rimraf','./automation.attributes','tools_automations','lodash','util'];(function(_0xc92336,_0x23849f){var _0x57b44d=function(_0xf99d63){while(--_0xf99d63){_0xc92336['push'](_0xc92336['shift']());}};_0x57b44d(++_0x23849f);}(_0x77dd,0x15c));var _0xd77d=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0x77dd[_0x14a0a0];return _0x56b651;};'use strict';var _=require(_0xd77d('0x0'));var util=require(_0xd77d('0x1'));var logger=require(_0xd77d('0x2'))(_0xd77d('0x3'));var moment=require(_0xd77d('0x4'));var BPromise=require('bluebird');var rp=require(_0xd77d('0x5'));var fs=require('fs');var path=require(_0xd77d('0x6'));var rimraf=require(_0xd77d('0x7'));var config=require('../../config/environment');var attributes=require(_0xd77d('0x8'));module['exports']=function(_0x2ce7a5,_0x232a6b){return _0x2ce7a5['define']('Automation',attributes,{'tableName':_0xd77d('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 a0afff4..7cd85a7 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 _0x8f59=['request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Automation,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f59,0x11d));var _0x98f5=function(_0x3ecee2,_0x1b289b){_0x3ecee2=_0x3ecee2-0x0;var _0x4f6236=_0x8f59[_0x3ecee2];return _0x4f6236;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var moment=require(_0x98f5('0x2'));var BPromise=require(_0x98f5('0x3'));var rs=require(_0x98f5('0x4'));var fs=require('fs');var Redis=require(_0x98f5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x98f5('0x6'));var logger=require(_0x98f5('0x7'))(_0x98f5('0x8'));var config=require(_0x98f5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x98f5('0xa')][_0x98f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e2acf,_0x5869ee,_0x5e91b3){return new BPromise(function(_0x109417,_0x1cd8a8){return client[_0x98f5('0xc')](_0x2e2acf,_0x5e91b3)['then'](function(_0x456329){logger[_0x98f5('0xd')](_0x98f5('0xe'),_0x5869ee,_0x98f5('0xf'));logger['debug'](_0x98f5('0x10'),_0x5869ee,'request\x20sent',JSON['stringify'](_0x456329));if(_0x456329[_0x98f5('0x11')]){if(_0x456329[_0x98f5('0x11')]['code']===0x1f4){logger[_0x98f5('0x11')](_0x98f5('0xe'),_0x5869ee,_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);return _0x1cd8a8(_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);}logger['error'](_0x98f5('0xe'),_0x5869ee,_0x456329[_0x98f5('0x11')]['message']);return _0x109417(_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);}else{logger[_0x98f5('0xd')]('Automation,\x20%s,\x20%s',_0x5869ee,_0x98f5('0xf'));_0x109417(_0x456329[_0x98f5('0x13')][_0x98f5('0x12')]);}})['catch'](function(_0x440cfa){logger[_0x98f5('0x11')]('Automation,\x20%s,\x20%s',_0x5869ee,_0x440cfa);_0x1cd8a8(_0x440cfa);});});} \ No newline at end of file +var _0x404d=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','Automation,\x20%s,\x20%s','request\x20sent'];(function(_0x28b7f1,_0x4c6a8e){var _0x4f79d4=function(_0x337526){while(--_0x337526){_0x28b7f1['push'](_0x28b7f1['shift']());}};_0x4f79d4(++_0x4c6a8e);}(_0x404d,0x1e9));var _0xd404=function(_0x24558f,_0x5f2233){_0x24558f=_0x24558f-0x0;var _0x514db8=_0x404d[_0x24558f];return _0x514db8;};'use strict';var _=require(_0xd404('0x0'));var util=require(_0xd404('0x1'));var moment=require(_0xd404('0x2'));var BPromise=require(_0xd404('0x3'));var rs=require(_0xd404('0x4'));var fs=require('fs');var Redis=require(_0xd404('0x5'));var db=require(_0xd404('0x6'))['db'];var utils=require(_0xd404('0x7'));var logger=require(_0xd404('0x8'))('rpc');var config=require(_0xd404('0x9'));var jayson=require(_0xd404('0xa'));var client=jayson['client'][_0xd404('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7faf39,_0x5da99f,_0x5c335f){return new BPromise(function(_0x10021a,_0x3d7e8a){return client['request'](_0x7faf39,_0x5c335f)['then'](function(_0x3096f0){logger[_0xd404('0xc')](_0xd404('0xd'),_0x5da99f,_0xd404('0xe'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x5da99f,_0xd404('0xe'),JSON[_0xd404('0xf')](_0x3096f0));if(_0x3096f0['error']){if(_0x3096f0[_0xd404('0x10')][_0xd404('0x11')]===0x1f4){logger[_0xd404('0x10')](_0xd404('0xd'),_0x5da99f,_0x3096f0[_0xd404('0x10')][_0xd404('0x12')]);return _0x3d7e8a(_0x3096f0[_0xd404('0x10')][_0xd404('0x12')]);}logger[_0xd404('0x10')](_0xd404('0xd'),_0x5da99f,_0x3096f0[_0xd404('0x10')][_0xd404('0x12')]);return _0x10021a(_0x3096f0[_0xd404('0x10')][_0xd404('0x12')]);}else{logger[_0xd404('0xc')](_0xd404('0xd'),_0x5da99f,_0xd404('0xe'));_0x10021a(_0x3096f0[_0xd404('0x13')][_0xd404('0x12')]);}})[_0xd404('0x14')](function(_0x155186){logger['error'](_0xd404('0xd'),_0x5da99f,_0x155186);_0x3d7e8a(_0x155186);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 8868e9d..ce117a7 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 _0xaf9b=['isAuthenticated','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','/:id','update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','index','show','/:id/conditions'];(function(_0x3f314a,_0x2b980d){var _0x502c16=function(_0x32191a){while(--_0x32191a){_0x3f314a['push'](_0x3f314a['shift']());}};_0x502c16(++_0x2b980d);}(_0xaf9b,0x1d7));var _0xbaf9=function(_0x128b11,_0x210160){_0x128b11=_0x128b11-0x0;var _0x50ccd9=_0xaf9b[_0x128b11];return _0x50ccd9;};'use strict';var multer=require(_0xbaf9('0x0'));var util=require('util');var path=require(_0xbaf9('0x1'));var timeout=require('connect-timeout');var express=require(_0xbaf9('0x2'));var router=express[_0xbaf9('0x3')]();var fs_extra=require(_0xbaf9('0x4'));var auth=require(_0xbaf9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbaf9('0x6'));var controller=require(_0xbaf9('0x7'));router[_0xbaf9('0x8')]('/',auth['isAuthenticated'](),controller[_0xbaf9('0x9')]);router[_0xbaf9('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbaf9('0xa')]);router[_0xbaf9('0x8')](_0xbaf9('0xb'),auth[_0xbaf9('0xc')](),controller[_0xbaf9('0xd')]);router[_0xbaf9('0x8')](_0xbaf9('0xe'),auth[_0xbaf9('0xc')](),controller[_0xbaf9('0xf')]);router[_0xbaf9('0x10')]('/',auth[_0xbaf9('0xc')](),controller[_0xbaf9('0x11')]);router['post'](_0xbaf9('0xb'),auth[_0xbaf9('0xc')](),controller[_0xbaf9('0x12')]);router[_0xbaf9('0x10')]('/:id/actions',auth[_0xbaf9('0xc')](),controller[_0xbaf9('0x13')]);router['put'](_0xbaf9('0x14'),auth[_0xbaf9('0xc')](),controller[_0xbaf9('0x15')]);router['delete']('/:id',auth[_0xbaf9('0xc')](),controller['destroy']);module[_0xbaf9('0x16')]=router; \ No newline at end of file +var _0x57cf=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id/conditions','/:id/actions','getActions','create','post','addActions','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x28236f,_0x313b4a){var _0x578bdf=function(_0xd18fc2){while(--_0xd18fc2){_0x28236f['push'](_0x28236f['shift']());}};_0x578bdf(++_0x313b4a);}(_0x57cf,0x11b));var _0xf57c=function(_0x3d11be,_0x1b9a8c){_0x3d11be=_0x3d11be-0x0;var _0x4b657b=_0x57cf[_0x3d11be];return _0x4b657b;};'use strict';var multer=require(_0xf57c('0x0'));var util=require(_0xf57c('0x1'));var path=require(_0xf57c('0x2'));var timeout=require(_0xf57c('0x3'));var express=require(_0xf57c('0x4'));var router=express[_0xf57c('0x5')]();var fs_extra=require(_0xf57c('0x6'));var auth=require(_0xf57c('0x7'));var interaction=require(_0xf57c('0x8'));var config=require(_0xf57c('0x9'));var controller=require('./automation.controller');router[_0xf57c('0xa')]('/',auth['isAuthenticated'](),controller[_0xf57c('0xb')]);router['get']('/:id',auth[_0xf57c('0xc')](),controller['show']);router[_0xf57c('0xa')](_0xf57c('0xd'),auth['isAuthenticated'](),controller['getConditions']);router[_0xf57c('0xa')](_0xf57c('0xe'),auth[_0xf57c('0xc')](),controller[_0xf57c('0xf')]);router['post']('/',auth[_0xf57c('0xc')](),controller[_0xf57c('0x10')]);router[_0xf57c('0x11')]('/:id/conditions',auth[_0xf57c('0xc')](),controller['addConditions']);router[_0xf57c('0x11')](_0xf57c('0xe'),auth['isAuthenticated'](),controller[_0xf57c('0x12')]);router['put'](_0xf57c('0x13'),auth['isAuthenticated'](),controller[_0xf57c('0x14')]);router[_0xf57c('0x15')](_0xf57c('0x13'),auth[_0xf57c('0xc')](),controller[_0xf57c('0x16')]);module[_0xf57c('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 7981652..cd09c90 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 _0x32d7=['NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','BOOLEAN','#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)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x599f32,_0x32b34f){var _0x47b552=function(_0x5237f8){while(--_0x5237f8){_0x599f32['push'](_0x599f32['shift']());}};_0x47b552(++_0x32b34f);}(_0x32d7,0xd0));var _0x732d=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x32d7[_0x4e9628];return _0x27bc8c;};'use strict';var Sequelize=require(_0x732d('0x0'));module['exports']={'name':{'type':Sequelize[_0x732d('0x1')],'unique':_0x732d('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x732d('0x3')](_0x732d('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x732d('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x732d('0x5')](0x4)[_0x732d('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x732d('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x732d('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x732d('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x732d('0x5')](0x3)[_0x732d('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x732d('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x732d('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x732d('0x5')](0x5)[_0x732d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x732d('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x732d('0x5')](0x3)[_0x732d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x732d('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x732d('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x732d('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x732d('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x732d('0x5')](0x5)[_0x732d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x732d('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x732d('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x732d('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x732d('0x1')],'defaultValue':_0x732d('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x732d('0x3')](_0x732d('0x10'),_0x732d('0x11'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x732d('0x12')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x732d('0x5')](0x9)[_0x732d('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x732d('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x732d('0x5')](0x9)[_0x732d('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x732d('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x732d('0x5')](0x9)[_0x732d('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x732d('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x732d('0x5')](0x9)[_0x732d('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x732d('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x732d('0x5')](0x9)[_0x732d('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x732d('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x732d('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x732d('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x732d('0x5')](0x9)[_0x732d('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x732d('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x732d('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x732d('0x1b'),_0x732d('0x1c')),'defaultValue':_0x732d('0x1b')},'dialPrefix':{'type':Sequelize[_0x732d('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x732d('0x5')](0x3)[_0x732d('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x732d('0x1d')},'dialCutDigit':{'type':Sequelize[_0x732d('0x5')](0x3)[_0x732d('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x732d('0x5')](0x3)[_0x732d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x732d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x732d('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x732d('0x5')](0x3)[_0x732d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x732d('0x1f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x732d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x732d('0x5')](0x3)[_0x732d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x732d('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x732d('0x5')](0x3)[_0x732d('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x732d('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x732d('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x732d('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x732d('0x5')](0x5)[_0x732d('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x732d('0x21')}}; \ No newline at end of file +var _0x0055=['Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','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\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.','STRING','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','INTEGER','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)'];(function(_0x34a9d4,_0x8839c8){var _0x35f05c=function(_0x534b30){while(--_0x534b30){_0x34a9d4['push'](_0x34a9d4['shift']());}};_0x35f05c(++_0x8839c8);}(_0x0055,0x1ed));var _0x5005=function(_0x2656e0,_0x2d9a12){_0x2656e0=_0x2656e0-0x0;var _0x10fe8c=_0x0055[_0x2656e0];return _0x10fe8c;};'use strict';var Sequelize=require(_0x5005('0x0'));module[_0x5005('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5005('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5005('0x3')](_0x5005('0x4')),'allowNull':![],'defaultValue':_0x5005('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x5005('0x5')],'defaultValue':0x0,'comment':_0x5005('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5005('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5005('0x8')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5005('0x8')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x5005('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5005('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5005('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5005('0xb')](0x5)[_0x5005('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5005('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x5005('0xb')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5005('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5005('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5005('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x5005('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5005('0xb')](0x5)[_0x5005('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5005('0x10')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5005('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5005('0x11')},'dialTimezone':{'type':Sequelize[_0x5005('0x8')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5005('0x8')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x5005('0x12'),_0x5005('0x13'),'onlyIfOpen'),'defaultValue':_0x5005('0x12')},'dialAMDActive':{'type':Sequelize[_0x5005('0x5')],'defaultValue':0x0,'comment':_0x5005('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x5005('0xb')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5005('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x5005('0xb')](0x9)[_0x5005('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5005('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5005('0xb')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5005('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x5005('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5005('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x5005('0xb')](0x9)[_0x5005('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5005('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5005('0xb')](0x9)[_0x5005('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5005('0xb')](0x9)[_0x5005('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5005('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5005('0xb')](0x5)[_0x5005('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5005('0xb')](0x9)[_0x5005('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5005('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5005('0x3')]('DESC',_0x5005('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x5005('0x8')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5005('0xb')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5005('0x1d')},'dialCutDigit':{'type':Sequelize[_0x5005('0xb')](0x3)[_0x5005('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5005('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5005('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5005('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5005('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5005('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5005('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5005('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5005('0xb')](0x3)[_0x5005('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5005('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5005('0xb')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5005('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x5005('0xb')](0x3)[_0x5005('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5005('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5005('0xb')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5005('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5005('0xb')](0x3)[_0x5005('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5005('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5005('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5005('0x26')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index bf83a23..c13372b 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 _0x5a68=['removeBlackLists','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','Campaign','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','UserProfileSection','getHoppers','findOne','CmHopper','CampaignId','findAll','getHopperHistories','CmHopperFinal','rows','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','scheduledAt','field','NOW()','toString','ListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','phone','ContactId','CmListId','cm_contacts','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black'];(function(_0x14de95,_0x213f90){var _0x9f81c4=function(_0x56e6a3){while(--_0x56e6a3){_0x14de95['push'](_0x14de95['shift']());}};_0x9f81c4(++_0x213f90);}(_0x5a68,0x1ae));var _0x85a6=function(_0x4de4d5,_0x38787c){_0x4de4d5=_0x4de4d5-0x0;var _0xff00b2=_0x5a68[_0x4de4d5];return _0xff00b2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85a6('0x0'));var jsonpatch=require(_0x85a6('0x1'));var rp=require(_0x85a6('0x2'));var moment=require(_0x85a6('0x3'));var BPromise=require(_0x85a6('0x4'));var Mustache=require(_0x85a6('0x5'));var util=require(_0x85a6('0x6'));var path=require(_0x85a6('0x7'));var sox=require(_0x85a6('0x8'));var csv=require('to-csv');var ejs=require(_0x85a6('0x9'));var fs=require('fs');var fs_extra=require(_0x85a6('0xa'));var _=require(_0x85a6('0xb'));var squel=require('squel');var crypto=require(_0x85a6('0xc'));var jsforce=require(_0x85a6('0xd'));var deskjs=require(_0x85a6('0xe'));var toCsv=require(_0x85a6('0xf'));var querystring=require(_0x85a6('0x10'));var Papa=require(_0x85a6('0x11'));var Redis=require(_0x85a6('0x12'));var authService=require(_0x85a6('0x13'));var qs=require(_0x85a6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x85a6('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x85a6('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5800b9,_0x4c16e0){_0x4c16e0=_0x4c16e0||0xcc;return function(_0x3eb357){if(_0x3eb357){return _0x5800b9[_0x85a6('0x17')](_0x4c16e0);}return _0x5800b9[_0x85a6('0x18')](_0x4c16e0)['end']();};}function respondWithResult(_0x332483,_0x26e8d4){_0x26e8d4=_0x26e8d4||0xc8;return function(_0x1b9fad){if(_0x1b9fad){return _0x332483[_0x85a6('0x18')](_0x26e8d4)[_0x85a6('0x19')](_0x1b9fad);}};}function respondWithFilteredResult(_0x1920a6,_0x398b7f){return function(_0x543042){if(_0x543042){var _0x12b85c=typeof _0x398b7f[_0x85a6('0x1a')]==='undefined'&&typeof _0x398b7f[_0x85a6('0x1b')]===_0x85a6('0x1c');var _0x11a788=_0x543042[_0x85a6('0x1d')];var _0x5f2720=_0x12b85c?0x0:_0x398b7f[_0x85a6('0x1a')];var _0x3df643=_0x12b85c?_0x543042['count']:_0x398b7f[_0x85a6('0x1a')]+_0x398b7f[_0x85a6('0x1b')];var _0x28a57b;if(_0x3df643>=_0x11a788){_0x3df643=_0x11a788;_0x28a57b=0xc8;}else{_0x28a57b=0xce;}_0x1920a6['status'](_0x28a57b);return _0x1920a6[_0x85a6('0x1e')](_0x85a6('0x1f'),_0x5f2720+'-'+_0x3df643+'/'+_0x11a788)['json'](_0x543042);}return null;};}function patchUpdates(_0x21b7df){return function(_0x1c6a6c){try{jsonpatch[_0x85a6('0x20')](_0x1c6a6c,_0x21b7df,!![]);}catch(_0x450762){return BPromise[_0x85a6('0x21')](_0x450762);}return _0x1c6a6c[_0x85a6('0x22')]();};}function saveUpdates(_0x345b73,_0x5c6da7){return function(_0x4d4d05){if(_0x4d4d05){return _0x4d4d05[_0x85a6('0x23')](_0x345b73)[_0x85a6('0x24')](function(_0x22e415){return _0x22e415;});}return null;};}function removeEntity(_0x1dd310,_0x35de87){return function(_0x122a48){if(_0x122a48){return _0x122a48[_0x85a6('0x25')]()[_0x85a6('0x24')](function(){var _0x296ec7=_0x122a48[_0x85a6('0x26')]({'plain':!![]});var _0x150c0f='IvrCampaigns';return db[_0x85a6('0x27')][_0x85a6('0x25')]({'where':{'type':_0x150c0f,'resourceId':_0x296ec7['id']}})[_0x85a6('0x24')](function(){return _0x122a48;});})[_0x85a6('0x24')](function(){_0x1dd310[_0x85a6('0x18')](0xcc)[_0x85a6('0x28')]();});}};}function handleEntityNotFound(_0x3a79bf,_0x598940){return function(_0x2d709e){if(!_0x2d709e){_0x3a79bf[_0x85a6('0x17')](0x194);}return _0x2d709e;};}function handleError(_0x271ff1,_0x343801){_0x343801=_0x343801||0x1f4;return function(_0x32d866){logger[_0x85a6('0x29')](_0x32d866[_0x85a6('0x2a')]);if(_0x32d866['name']){delete _0x32d866[_0x85a6('0x2b')];}_0x271ff1[_0x85a6('0x18')](_0x343801)[_0x85a6('0x2c')](_0x32d866);};}exports[_0x85a6('0x2d')]=function(_0x2ced3c,_0xa4e4ef){var _0x512030={},_0x1cae89={},_0x259afb={'count':0x0,'rows':[]};var _0x386219=_['map'](db[_0x85a6('0x2e')]['rawAttributes'],function(_0x5a055e){return{'name':_0x5a055e['fieldName'],'type':_0x5a055e[_0x85a6('0x2f')][_0x85a6('0x30')]};});_0x1cae89[_0x85a6('0x31')]=_[_0x85a6('0x32')](_0x386219,_0x85a6('0x2b'));_0x1cae89[_0x85a6('0x33')]=_[_0x85a6('0x34')](_0x2ced3c['query']);_0x1cae89[_0x85a6('0x35')]=_[_0x85a6('0x36')](_0x1cae89[_0x85a6('0x31')],_0x1cae89[_0x85a6('0x33')]);_0x512030[_0x85a6('0x37')]=_[_0x85a6('0x36')](_0x1cae89[_0x85a6('0x31')],qs[_0x85a6('0x38')](_0x2ced3c[_0x85a6('0x33')]['fields']));_0x512030[_0x85a6('0x37')]=_0x512030[_0x85a6('0x37')]['length']?_0x512030[_0x85a6('0x37')]:_0x1cae89['model'];if(!_0x2ced3c[_0x85a6('0x33')][_0x85a6('0x39')](_0x85a6('0x3a'))){_0x512030[_0x85a6('0x1b')]=qs[_0x85a6('0x1b')](_0x2ced3c[_0x85a6('0x33')]['limit']);_0x512030[_0x85a6('0x1a')]=qs[_0x85a6('0x1a')](_0x2ced3c[_0x85a6('0x33')][_0x85a6('0x1a')]);}_0x512030[_0x85a6('0x3b')]=qs['sort'](_0x2ced3c['query'][_0x85a6('0x3c')]);_0x512030[_0x85a6('0x3d')]=qs[_0x85a6('0x35')](_[_0x85a6('0x3e')](_0x2ced3c[_0x85a6('0x33')],_0x1cae89['filters']),_0x386219);if(_0x2ced3c[_0x85a6('0x33')][_0x85a6('0x3f')]){_0x512030['where']=_[_0x85a6('0x40')](_0x512030[_0x85a6('0x3d')],{'$or':_[_0x85a6('0x32')](_0x386219,function(_0x4048f2){if(_0x4048f2[_0x85a6('0x2f')]!==_0x85a6('0x41')){var _0x4ff8cf={};_0x4ff8cf[_0x4048f2[_0x85a6('0x2b')]]={'$like':'%'+_0x2ced3c[_0x85a6('0x33')][_0x85a6('0x3f')]+'%'};return _0x4ff8cf;}})});}_0x512030=_[_0x85a6('0x40')]({},_0x512030,_0x2ced3c[_0x85a6('0x42')]);var _0x1bc09f={'where':_0x512030[_0x85a6('0x3d')]};return db['Campaign'][_0x85a6('0x1d')](_0x1bc09f)[_0x85a6('0x24')](function(_0x4b9ba6){_0x259afb[_0x85a6('0x1d')]=_0x4b9ba6;if(_0x2ced3c[_0x85a6('0x33')][_0x85a6('0x43')]){_0x512030[_0x85a6('0x44')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x512030);})[_0x85a6('0x24')](function(_0x38ef7d){_0x259afb['rows']=_0x38ef7d;return _0x259afb;})[_0x85a6('0x24')](respondWithFilteredResult(_0xa4e4ef,_0x512030))[_0x85a6('0x45')](handleError(_0xa4e4ef,null));};exports[_0x85a6('0x46')]=function(_0x37e7c7,_0x449673){var _0x20340b={'raw':![],'where':{'id':_0x37e7c7['params']['id']}},_0x19f383={};_0x19f383[_0x85a6('0x31')]=_[_0x85a6('0x34')](db['Campaign'][_0x85a6('0x47')]);_0x19f383[_0x85a6('0x33')]=_[_0x85a6('0x34')](_0x37e7c7[_0x85a6('0x33')]);_0x19f383['filters']=_[_0x85a6('0x36')](_0x19f383['model'],_0x19f383[_0x85a6('0x33')]);_0x20340b[_0x85a6('0x37')]=_[_0x85a6('0x36')](_0x19f383[_0x85a6('0x31')],qs[_0x85a6('0x38')](_0x37e7c7[_0x85a6('0x33')]['fields']));_0x20340b[_0x85a6('0x37')]=_0x20340b[_0x85a6('0x37')][_0x85a6('0x48')]?_0x20340b['attributes']:_0x19f383[_0x85a6('0x31')];if(_0x37e7c7[_0x85a6('0x33')][_0x85a6('0x43')]){_0x20340b[_0x85a6('0x44')]=[{'all':!![]}];}_0x20340b=_['merge']({},_0x20340b,_0x37e7c7[_0x85a6('0x42')]);return db[_0x85a6('0x2e')][_0x85a6('0x49')](_0x20340b)['then'](handleEntityNotFound(_0x449673,null))['then'](respondWithResult(_0x449673,null))['catch'](handleError(_0x449673,null));};exports[_0x85a6('0x4a')]=function(_0x5cff93,_0x594388){return db['Campaign'][_0x85a6('0x4a')](_0x5cff93[_0x85a6('0x4b')],{})[_0x85a6('0x24')](function(_0x15b982){var _0x167b15=_0x5cff93[_0x85a6('0x4c')][_0x85a6('0x26')]({'plain':!![]});if(!_0x167b15)throw new Error(_0x85a6('0x4d'));if(_0x167b15['role']===_0x85a6('0x4c')){var _0x19893e=_0x15b982['get']({'plain':!![]});var _0x46394=_0x85a6('0x4e');return db['UserProfileSection'][_0x85a6('0x49')]({'where':{'name':_0x46394,'userProfileId':_0x167b15[_0x85a6('0x4f')]},'raw':!![]})[_0x85a6('0x24')](function(_0x331efa){if(_0x331efa&&_0x331efa[_0x85a6('0x50')]===0x0){return db[_0x85a6('0x27')][_0x85a6('0x4a')]({'name':_0x19893e[_0x85a6('0x2b')],'resourceId':_0x19893e['id'],'type':_0x331efa[_0x85a6('0x2b')],'sectionId':_0x331efa['id']},{})[_0x85a6('0x24')](function(){return _0x15b982;});}else{return _0x15b982;}})[_0x85a6('0x45')](function(_0x50a147){logger[_0x85a6('0x29')](_0x85a6('0x51'),_0x50a147);throw _0x50a147;});}return _0x15b982;})[_0x85a6('0x24')](respondWithResult(_0x594388,0xc9))[_0x85a6('0x45')](handleError(_0x594388,null));};exports[_0x85a6('0x52')]=function(_0x6343e7,_0x2b279a){var _0x211120={'where':{'id':_0x6343e7[_0x85a6('0x53')]['id']}},_0x2c83e8={};_0x2c83e8[_0x85a6('0x31')]=_[_0x85a6('0x34')](db[_0x85a6('0x2e')][_0x85a6('0x47')]);_0x211120[_0x85a6('0x37')]=_[_0x85a6('0x36')](_0x2c83e8['model'],qs[_0x85a6('0x38')](_0x6343e7[_0x85a6('0x33')][_0x85a6('0x38')]));_0x211120['attributes']=_0x211120[_0x85a6('0x37')][_0x85a6('0x48')]?_0x211120[_0x85a6('0x37')]:_0x2c83e8[_0x85a6('0x31')];if(_0x6343e7['query'][_0x85a6('0x43')]){_0x211120[_0x85a6('0x44')]=[{'all':!![]}];}_0x211120=_[_0x85a6('0x40')]({},_0x211120,_0x6343e7[_0x85a6('0x42')]);return db['Campaign'][_0x85a6('0x49')](_0x211120)['then'](handleEntityNotFound(_0x2b279a,null))[_0x85a6('0x24')](function(_0x4ff1b3){if(_0x4ff1b3){var _0x5e06cb=_0x4ff1b3[_0x85a6('0x26')]({'plain':!![]});_0x5e06cb=qs[_0x85a6('0x54')](_0x5e06cb,['id',_0x85a6('0x55'),_0x85a6('0x56')]);_0x6343e7[_0x85a6('0x4b')]=_[_0x85a6('0x54')](_0x6343e7[_0x85a6('0x4b')],['id',_0x85a6('0x55'),_0x85a6('0x56')]);return db['Campaign'][_0x85a6('0x4a')](_['merge'](_0x5e06cb,_0x6343e7['body']),{'include':_0x6343e7[_0x85a6('0x33')][_0x85a6('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x5e125c){var _0x3f5ee8=_0x6343e7[_0x85a6('0x4c')][_0x85a6('0x26')]({'plain':!![]});if(!_0x3f5ee8)throw new Error(_0x85a6('0x4d'));if(_0x3f5ee8['role']===_0x85a6('0x4c')){var _0x261086=_0x5e125c[_0x85a6('0x26')]({'plain':!![]});var _0x1f7030=_0x85a6('0x4e');return db[_0x85a6('0x57')][_0x85a6('0x49')]({'where':{'name':_0x1f7030,'userProfileId':_0x3f5ee8[_0x85a6('0x4f')]},'raw':!![]})[_0x85a6('0x24')](function(_0x4b991c){if(_0x4b991c&&_0x4b991c[_0x85a6('0x50')]===0x0){return db[_0x85a6('0x27')][_0x85a6('0x4a')]({'name':_0x261086[_0x85a6('0x2b')],'resourceId':_0x261086['id'],'type':_0x4b991c[_0x85a6('0x2b')],'sectionId':_0x4b991c['id']},{})[_0x85a6('0x24')](function(){return _0x5e125c;});}else{return _0x5e125c;}})[_0x85a6('0x45')](function(_0x3f4c1f){logger[_0x85a6('0x29')](_0x85a6('0x51'),_0x3f4c1f);throw _0x3f4c1f;});}return _0x5e125c;});}})[_0x85a6('0x24')](respondWithResult(_0x2b279a,0xc9))[_0x85a6('0x45')](handleError(_0x2b279a,null));};exports[_0x85a6('0x23')]=function(_0x814dd9,_0x34ed51){if(_0x814dd9[_0x85a6('0x4b')]['id']){delete _0x814dd9['body']['id'];}return db[_0x85a6('0x2e')][_0x85a6('0x49')]({'where':{'id':_0x814dd9[_0x85a6('0x53')]['id']}})[_0x85a6('0x24')](handleEntityNotFound(_0x34ed51,null))[_0x85a6('0x24')](saveUpdates(_0x814dd9[_0x85a6('0x4b')],null))[_0x85a6('0x24')](respondWithResult(_0x34ed51,null))[_0x85a6('0x45')](handleError(_0x34ed51,null));};exports[_0x85a6('0x25')]=function(_0x5c2dd2,_0x48c53e){return db[_0x85a6('0x2e')][_0x85a6('0x49')]({'where':{'id':_0x5c2dd2['params']['id']}})[_0x85a6('0x24')](handleEntityNotFound(_0x48c53e,null))[_0x85a6('0x24')](removeEntity(_0x48c53e,null))[_0x85a6('0x45')](handleError(_0x48c53e,null));};exports[_0x85a6('0x58')]=function(_0xd5a410,_0x405411,_0x4bbd9d){var _0x1156da={'raw':!![],'where':{}};var _0xeb41a2={};var _0x1fadf8={'count':0x0,'rows':[]};return db[_0x85a6('0x2e')][_0x85a6('0x59')]({'where':{'id':_0xd5a410[_0x85a6('0x53')]['id']}})['then'](handleEntityNotFound(_0x405411,null))[_0x85a6('0x24')](function(_0x501bd1){if(_0x501bd1){_0xeb41a2[_0x85a6('0x31')]=_[_0x85a6('0x34')](db[_0x85a6('0x5a')]['rawAttributes']);_0xeb41a2[_0x85a6('0x33')]=_[_0x85a6('0x34')](_0xd5a410[_0x85a6('0x33')]);_0xeb41a2[_0x85a6('0x35')]=_[_0x85a6('0x36')](_0xeb41a2[_0x85a6('0x31')],_0xeb41a2[_0x85a6('0x33')]);_0x1156da[_0x85a6('0x37')]=_[_0x85a6('0x36')](_0xeb41a2[_0x85a6('0x31')],qs[_0x85a6('0x38')](_0xd5a410['query'][_0x85a6('0x38')]));_0x1156da[_0x85a6('0x37')]=_0x1156da[_0x85a6('0x37')][_0x85a6('0x48')]?_0x1156da[_0x85a6('0x37')]:_0xeb41a2[_0x85a6('0x31')];if(!_0xd5a410[_0x85a6('0x33')][_0x85a6('0x39')](_0x85a6('0x3a'))){_0x1156da[_0x85a6('0x1b')]=qs[_0x85a6('0x1b')](_0xd5a410[_0x85a6('0x33')][_0x85a6('0x1b')]);_0x1156da[_0x85a6('0x1a')]=qs['offset'](_0xd5a410['query']['offset']);}_0x1156da[_0x85a6('0x3b')]=qs[_0x85a6('0x3c')](_0xd5a410['query'][_0x85a6('0x3c')]);_0x1156da[_0x85a6('0x3d')]=qs[_0x85a6('0x35')](_[_0x85a6('0x3e')](_0xd5a410[_0x85a6('0x33')],_0xeb41a2[_0x85a6('0x35')]));_0x1156da[_0x85a6('0x3d')][_0x85a6('0x5b')]=_0x501bd1['id'];if(_0xd5a410[_0x85a6('0x33')]['filter']){_0x1156da['where']=_[_0x85a6('0x40')](_0x1156da[_0x85a6('0x3d')],{'$or':_[_0x85a6('0x32')](_0x1156da[_0x85a6('0x37')],function(_0x5446f1){var _0x5bcd39={};_0x5bcd39[_0x5446f1]={'$like':'%'+_0xd5a410[_0x85a6('0x33')]['filter']+'%'};return _0x5bcd39;})});}_0x1156da=_['merge']({},_0x1156da,_0xd5a410[_0x85a6('0x42')]);return db['CmHopper'][_0x85a6('0x1d')]({'where':_0x1156da['where']})['then'](function(_0x169cf8){_0x1fadf8[_0x85a6('0x1d')]=_0x169cf8;if(_0xd5a410[_0x85a6('0x33')][_0x85a6('0x43')]){_0x1156da[_0x85a6('0x44')]=[{'all':!![]}];}return db[_0x85a6('0x5a')][_0x85a6('0x5c')](_0x1156da);})[_0x85a6('0x24')](function(_0xe0b56e){_0x1fadf8['rows']=_0xe0b56e;return _0x1fadf8;});}})['then'](respondWithFilteredResult(_0x405411,_0x1156da))['catch'](handleError(_0x405411,null));};exports[_0x85a6('0x5d')]=function(_0x905875,_0x1bc51e,_0x550fbe){var _0x1d2475={'raw':!![],'where':{}};var _0x37b696={};var _0x52f7fd={'count':0x0,'rows':[]};return db[_0x85a6('0x2e')][_0x85a6('0x59')]({'where':{'id':_0x905875[_0x85a6('0x53')]['id']}})[_0x85a6('0x24')](handleEntityNotFound(_0x1bc51e,null))[_0x85a6('0x24')](function(_0x1b0691){if(_0x1b0691){_0x37b696['model']=_[_0x85a6('0x34')](db['CmHopperHistory'][_0x85a6('0x47')]);_0x37b696[_0x85a6('0x33')]=_[_0x85a6('0x34')](_0x905875[_0x85a6('0x33')]);_0x37b696[_0x85a6('0x35')]=_[_0x85a6('0x36')](_0x37b696[_0x85a6('0x31')],_0x37b696[_0x85a6('0x33')]);_0x1d2475[_0x85a6('0x37')]=_[_0x85a6('0x36')](_0x37b696[_0x85a6('0x31')],qs[_0x85a6('0x38')](_0x905875[_0x85a6('0x33')][_0x85a6('0x38')]));_0x1d2475[_0x85a6('0x37')]=_0x1d2475['attributes'][_0x85a6('0x48')]?_0x1d2475[_0x85a6('0x37')]:_0x37b696[_0x85a6('0x31')];if(!_0x905875[_0x85a6('0x33')][_0x85a6('0x39')]('nolimit')){_0x1d2475['limit']=qs['limit'](_0x905875['query']['limit']);_0x1d2475[_0x85a6('0x1a')]=qs['offset'](_0x905875[_0x85a6('0x33')]['offset']);}_0x1d2475[_0x85a6('0x3b')]=qs[_0x85a6('0x3c')](_0x905875[_0x85a6('0x33')][_0x85a6('0x3c')]);_0x1d2475[_0x85a6('0x3d')]=qs[_0x85a6('0x35')](_[_0x85a6('0x3e')](_0x905875[_0x85a6('0x33')],_0x37b696[_0x85a6('0x35')]));_0x1d2475[_0x85a6('0x3d')][_0x85a6('0x5b')]=_0x1b0691['id'];if(_0x905875[_0x85a6('0x33')][_0x85a6('0x3f')]){_0x1d2475[_0x85a6('0x3d')]=_[_0x85a6('0x40')](_0x1d2475[_0x85a6('0x3d')],{'$or':_['map'](_0x1d2475[_0x85a6('0x37')],function(_0x75d4e2){var _0x2f0e19={};_0x2f0e19[_0x75d4e2]={'$like':'%'+_0x905875[_0x85a6('0x33')]['filter']+'%'};return _0x2f0e19;})});}_0x1d2475=_[_0x85a6('0x40')]({},_0x1d2475,_0x905875['options']);return db['CmHopperHistory']['count']({'where':_0x1d2475['where']})[_0x85a6('0x24')](function(_0x1e3ea5){_0x52f7fd[_0x85a6('0x1d')]=_0x1e3ea5;if(_0x905875['query'][_0x85a6('0x43')]){_0x1d2475[_0x85a6('0x44')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x1d2475);})[_0x85a6('0x24')](function(_0x1f4e13){_0x52f7fd['rows']=_0x1f4e13;return _0x52f7fd;});}})['then'](respondWithFilteredResult(_0x1bc51e,_0x1d2475))[_0x85a6('0x45')](handleError(_0x1bc51e,null));};exports['getHopperFinals']=function(_0x306210,_0x5be0e3,_0x27a8e8){var _0x5c9a74={'raw':!![],'where':{}};var _0xb9e068={};var _0x393fca={'count':0x0,'rows':[]};return db[_0x85a6('0x2e')]['findOne']({'where':{'id':_0x306210[_0x85a6('0x53')]['id']}})[_0x85a6('0x24')](handleEntityNotFound(_0x5be0e3,null))[_0x85a6('0x24')](function(_0x1351e3){if(_0x1351e3){_0xb9e068['model']=_['keys'](db[_0x85a6('0x5e')]['rawAttributes']);_0xb9e068[_0x85a6('0x33')]=_['keys'](_0x306210[_0x85a6('0x33')]);_0xb9e068[_0x85a6('0x35')]=_[_0x85a6('0x36')](_0xb9e068[_0x85a6('0x31')],_0xb9e068[_0x85a6('0x33')]);_0x5c9a74['attributes']=_[_0x85a6('0x36')](_0xb9e068[_0x85a6('0x31')],qs['fields'](_0x306210[_0x85a6('0x33')][_0x85a6('0x38')]));_0x5c9a74[_0x85a6('0x37')]=_0x5c9a74[_0x85a6('0x37')]['length']?_0x5c9a74[_0x85a6('0x37')]:_0xb9e068[_0x85a6('0x31')];if(!_0x306210[_0x85a6('0x33')][_0x85a6('0x39')](_0x85a6('0x3a'))){_0x5c9a74['limit']=qs[_0x85a6('0x1b')](_0x306210[_0x85a6('0x33')][_0x85a6('0x1b')]);_0x5c9a74[_0x85a6('0x1a')]=qs[_0x85a6('0x1a')](_0x306210[_0x85a6('0x33')][_0x85a6('0x1a')]);}_0x5c9a74[_0x85a6('0x3b')]=qs[_0x85a6('0x3c')](_0x306210['query'][_0x85a6('0x3c')]);_0x5c9a74[_0x85a6('0x3d')]=qs[_0x85a6('0x35')](_[_0x85a6('0x3e')](_0x306210['query'],_0xb9e068[_0x85a6('0x35')]));_0x5c9a74['where'][_0x85a6('0x5b')]=_0x1351e3['id'];if(_0x306210[_0x85a6('0x33')][_0x85a6('0x3f')]){_0x5c9a74[_0x85a6('0x3d')]=_['merge'](_0x5c9a74[_0x85a6('0x3d')],{'$or':_[_0x85a6('0x32')](_0x5c9a74[_0x85a6('0x37')],function(_0x415f27){var _0x383034={};_0x383034[_0x415f27]={'$like':'%'+_0x306210[_0x85a6('0x33')]['filter']+'%'};return _0x383034;})});}_0x5c9a74=_[_0x85a6('0x40')]({},_0x5c9a74,_0x306210[_0x85a6('0x42')]);return db['CmHopperFinal'][_0x85a6('0x1d')]({'where':_0x5c9a74['where']})['then'](function(_0x27f67c){_0x393fca[_0x85a6('0x1d')]=_0x27f67c;if(_0x306210['query'][_0x85a6('0x43')]){_0x5c9a74[_0x85a6('0x44')]=[{'all':!![]}];}return db[_0x85a6('0x5e')][_0x85a6('0x5c')](_0x5c9a74);})[_0x85a6('0x24')](function(_0x19360c){_0x393fca[_0x85a6('0x5f')]=_0x19360c;return _0x393fca;});}})[_0x85a6('0x24')](respondWithFilteredResult(_0x5be0e3,_0x5c9a74))['catch'](handleError(_0x5be0e3,null));};exports['getHopperBlacks']=function(_0x43aeb0,_0x26e42e,_0x4a398d){var _0x5d4f5c={'raw':!![],'where':{}};var _0x32cccf={};var _0x2429d5={'count':0x0,'rows':[]};return db[_0x85a6('0x2e')][_0x85a6('0x59')]({'where':{'id':_0x43aeb0[_0x85a6('0x53')]['id']}})[_0x85a6('0x24')](handleEntityNotFound(_0x26e42e,null))[_0x85a6('0x24')](function(_0x45f57c){if(_0x45f57c){_0x32cccf[_0x85a6('0x31')]=_[_0x85a6('0x34')](db[_0x85a6('0x60')]['rawAttributes']);_0x32cccf[_0x85a6('0x33')]=_['keys'](_0x43aeb0['query']);_0x32cccf[_0x85a6('0x35')]=_[_0x85a6('0x36')](_0x32cccf[_0x85a6('0x31')],_0x32cccf[_0x85a6('0x33')]);_0x5d4f5c['attributes']=_[_0x85a6('0x36')](_0x32cccf[_0x85a6('0x31')],qs[_0x85a6('0x38')](_0x43aeb0[_0x85a6('0x33')][_0x85a6('0x38')]));_0x5d4f5c[_0x85a6('0x37')]=_0x5d4f5c['attributes'][_0x85a6('0x48')]?_0x5d4f5c[_0x85a6('0x37')]:_0x32cccf[_0x85a6('0x31')];if(!_0x43aeb0[_0x85a6('0x33')]['hasOwnProperty'](_0x85a6('0x3a'))){_0x5d4f5c[_0x85a6('0x1b')]=qs['limit'](_0x43aeb0[_0x85a6('0x33')][_0x85a6('0x1b')]);_0x5d4f5c[_0x85a6('0x1a')]=qs[_0x85a6('0x1a')](_0x43aeb0['query'][_0x85a6('0x1a')]);}_0x5d4f5c[_0x85a6('0x3b')]=qs[_0x85a6('0x3c')](_0x43aeb0[_0x85a6('0x33')]['sort']);_0x5d4f5c[_0x85a6('0x3d')]=qs[_0x85a6('0x35')](_['pick'](_0x43aeb0['query'],_0x32cccf[_0x85a6('0x35')]));_0x5d4f5c['where'][_0x85a6('0x5b')]=_0x45f57c['id'];if(_0x43aeb0[_0x85a6('0x33')][_0x85a6('0x3f')]){_0x5d4f5c['where']=_[_0x85a6('0x40')](_0x5d4f5c[_0x85a6('0x3d')],{'$or':_['map'](_0x5d4f5c[_0x85a6('0x37')],function(_0x5785d8){var _0x37c60b={};_0x37c60b[_0x5785d8]={'$like':'%'+_0x43aeb0['query'][_0x85a6('0x3f')]+'%'};return _0x37c60b;})});}_0x5d4f5c=_[_0x85a6('0x40')]({},_0x5d4f5c,_0x43aeb0[_0x85a6('0x42')]);return db[_0x85a6('0x60')]['count']({'where':_0x5d4f5c['where']})[_0x85a6('0x24')](function(_0x5d0235){_0x2429d5[_0x85a6('0x1d')]=_0x5d0235;if(_0x43aeb0['query'][_0x85a6('0x43')]){_0x5d4f5c[_0x85a6('0x44')]=[{'all':!![]}];}return db[_0x85a6('0x60')]['findAll'](_0x5d4f5c);})['then'](function(_0x567d05){_0x2429d5[_0x85a6('0x5f')]=_0x567d05;return _0x2429d5;});}})[_0x85a6('0x24')](respondWithFilteredResult(_0x26e42e,_0x5d4f5c))[_0x85a6('0x45')](handleError(_0x26e42e,null));};exports[_0x85a6('0x61')]=function(_0x1e12cc,_0x4eb868,_0x5bf8e1){var _0x1e2310={};var _0x2e0250={};var _0xb5b43c;var _0x5436e3;return db[_0x85a6('0x2e')][_0x85a6('0x59')]({'where':{'id':_0x1e12cc[_0x85a6('0x53')]['id']}})[_0x85a6('0x24')](handleEntityNotFound(_0x4eb868,null))['then'](function(_0x33d115){if(_0x33d115){_0xb5b43c=_0x33d115;_0x2e0250[_0x85a6('0x31')]=_['keys'](db['CmList'][_0x85a6('0x47')]);_0x2e0250['query']=_[_0x85a6('0x34')](_0x1e12cc[_0x85a6('0x33')]);_0x2e0250[_0x85a6('0x35')]=_[_0x85a6('0x36')](_0x2e0250[_0x85a6('0x31')],_0x2e0250['query']);_0x1e2310[_0x85a6('0x37')]=_['intersection'](_0x2e0250[_0x85a6('0x31')],qs['fields'](_0x1e12cc[_0x85a6('0x33')][_0x85a6('0x38')]));_0x1e2310[_0x85a6('0x37')]=_0x1e2310[_0x85a6('0x37')][_0x85a6('0x48')]?_0x1e2310[_0x85a6('0x37')]:_0x2e0250[_0x85a6('0x31')];_0x1e2310[_0x85a6('0x3b')]=qs['sort'](_0x1e12cc['query']['sort']);_0x1e2310[_0x85a6('0x3d')]=qs[_0x85a6('0x35')](_[_0x85a6('0x3e')](_0x1e12cc[_0x85a6('0x33')],_0x2e0250[_0x85a6('0x35')]));if(_0x1e12cc[_0x85a6('0x33')][_0x85a6('0x3f')]){_0x1e2310[_0x85a6('0x3d')]=_[_0x85a6('0x40')](_0x1e2310[_0x85a6('0x3d')],{'$or':_[_0x85a6('0x32')](_0x1e2310[_0x85a6('0x37')],function(_0x12108b){var _0x13d899={};_0x13d899[_0x12108b]={'$like':'%'+_0x1e12cc[_0x85a6('0x33')][_0x85a6('0x3f')]+'%'};return _0x13d899;})});}_0x1e2310=_[_0x85a6('0x40')]({},_0x1e2310,_0x1e12cc[_0x85a6('0x42')]);return _0xb5b43c[_0x85a6('0x61')](_0x1e2310);}})['then'](function(_0x4c60a2){if(_0x4c60a2){_0x5436e3=_0x4c60a2[_0x85a6('0x48')];if(!_0x1e12cc[_0x85a6('0x33')][_0x85a6('0x39')](_0x85a6('0x3a'))){_0x1e2310[_0x85a6('0x1b')]=qs[_0x85a6('0x1b')](_0x1e12cc[_0x85a6('0x33')][_0x85a6('0x1b')]);_0x1e2310[_0x85a6('0x1a')]=qs[_0x85a6('0x1a')](_0x1e12cc['query'][_0x85a6('0x1a')]);}return _0xb5b43c['getLists'](_0x1e2310);}})[_0x85a6('0x24')](function(_0x30869c){if(_0x30869c){return _0x30869c?{'count':_0x5436e3,'rows':_0x30869c}:null;}})['then'](respondWithResult(_0x4eb868,null))[_0x85a6('0x45')](handleError(_0x4eb868,null));};exports[_0x85a6('0x62')]=function(_0x5e34f8,_0x450e31,_0x440edf){var _0x14b1e,_0x12e725;var _0x5c86aa=[];var _0x537c71=moment()[_0x85a6('0x63')](_0x85a6('0x64'));return db[_0x85a6('0x2e')][_0x85a6('0x49')]({'where':{'id':_0x5e34f8['params']['id']}})[_0x85a6('0x24')](handleEntityNotFound(_0x450e31,null))[_0x85a6('0x24')](function(_0x1baba8){if(_0x1baba8){_0x12e725=_0x1baba8;return _0x1baba8['addLists'](_0x5e34f8[_0x85a6('0x4b')]['ids'],_['omit'](_0x5e34f8[_0x85a6('0x4b')],[_0x85a6('0x65'),'id'])||{});}return null;})[_0x85a6('0x66')](function(_0x30a9ed){var _0xaab4c5;var _0x1910f4;_0x14b1e=_0x30a9ed||[];var _0x53eae0=[];if(_0x30a9ed){for(var _0x4996dc=0x0;_0x4996dc<_0x30a9ed[_0x85a6('0x48')];_0x4996dc+=0x1){var _0x15d10f=_0x30a9ed[_0x4996dc]['get']({'plain':!![]});_0x12e725[_0x85a6('0x67')]=_0x5e34f8[_0x85a6('0x4b')]['dialCheckDuplicateType']?_0x5e34f8[_0x85a6('0x4b')]['dialCheckDuplicateType']:_0x12e725['dialCheckDuplicateType'];switch(_0x12e725['dialCheckDuplicateType']){case _0x85a6('0x68'):_0xaab4c5=squel['insert']()[_0x85a6('0x69')](_0x85a6('0x6a'))[_0x85a6('0x6b')](['phone',_0x85a6('0x6c'),'ContactId','ListId',_0x85a6('0x5b'),_0x85a6('0x55'),_0x85a6('0x56')],squel['select']()[_0x85a6('0x6d')]('phone','phone')[_0x85a6('0x6d')](_0x85a6('0x6e'),_0x85a6('0x6c'))[_0x85a6('0x6d')]('id','ContactId')[_0x85a6('0x6d')](_0x15d10f['CmListId'][_0x85a6('0x6f')](),_0x85a6('0x70'))[_0x85a6('0x6d')](_0x5e34f8[_0x85a6('0x53')]['id'][_0x85a6('0x6f')](),_0x85a6('0x5b'))[_0x85a6('0x6d')]('\x27'+_0x537c71+'\x27','createdAt')[_0x85a6('0x6d')]('\x27'+_0x537c71+'\x27',_0x85a6('0x56'))[_0x85a6('0x71')]('cm_contacts')[_0x85a6('0x3d')](_0x85a6('0x72'))[_0x85a6('0x3d')](_0x85a6('0x73'),_0x15d10f['CmListId'][_0x85a6('0x6f')]())[_0x85a6('0x3d')](_0x85a6('0x74'))[_0x85a6('0x3d')](_0x85a6('0x75'),squel[_0x85a6('0x76')]()['field'](_0x85a6('0x77'))[_0x85a6('0x71')]('cm_hopper_final')[_0x85a6('0x3d')](_0x85a6('0x78'),_0x5e34f8['params']['id'][_0x85a6('0x6f')]()))[_0x85a6('0x3d')](_0x85a6('0x75'),squel['select']()[_0x85a6('0x6d')](_0x85a6('0x79'))['from'](_0x85a6('0x6a'))[_0x85a6('0x3d')](_0x85a6('0x78'),_0x5e34f8[_0x85a6('0x53')]['id'][_0x85a6('0x6f')]())))['toString']();break;case'onlyIfOpen':_0xaab4c5=squel[_0x85a6('0x7a')]()['into'](_0x85a6('0x6a'))[_0x85a6('0x6b')]([_0x85a6('0x7b'),_0x85a6('0x6c'),'ContactId',_0x85a6('0x70'),_0x85a6('0x5b'),_0x85a6('0x55'),_0x85a6('0x56')],squel[_0x85a6('0x76')]()[_0x85a6('0x6d')](_0x85a6('0x7b'),_0x85a6('0x7b'))[_0x85a6('0x6d')](_0x85a6('0x6e'),_0x85a6('0x6c'))[_0x85a6('0x6d')]('id',_0x85a6('0x7c'))[_0x85a6('0x6d')](_0x15d10f[_0x85a6('0x7d')][_0x85a6('0x6f')](),_0x85a6('0x70'))['field'](_0x5e34f8[_0x85a6('0x53')]['id'][_0x85a6('0x6f')](),'CampaignId')[_0x85a6('0x6d')]('\x27'+_0x537c71+'\x27',_0x85a6('0x55'))['field']('\x27'+_0x537c71+'\x27','updatedAt')[_0x85a6('0x71')]('cm_contacts')['where'](_0x85a6('0x72'))[_0x85a6('0x3d')](_0x85a6('0x73'),_0x15d10f[_0x85a6('0x7d')][_0x85a6('0x6f')]())[_0x85a6('0x3d')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x85a6('0x75'),squel['select']()[_0x85a6('0x6d')](_0x85a6('0x79'))['from'](_0x85a6('0x6a'))['where'](_0x85a6('0x78'),_0x5e34f8[_0x85a6('0x53')]['id'][_0x85a6('0x6f')]())))[_0x85a6('0x6f')]();break;default:_0xaab4c5=squel['insert']()[_0x85a6('0x69')](_0x85a6('0x6a'))['fromQuery'](['phone',_0x85a6('0x6c'),_0x85a6('0x7c'),_0x85a6('0x70'),_0x85a6('0x5b'),_0x85a6('0x55'),_0x85a6('0x56')],squel['select']()[_0x85a6('0x6d')](_0x85a6('0x7b'),_0x85a6('0x7b'))[_0x85a6('0x6d')](_0x85a6('0x6e'),_0x85a6('0x6c'))['field']('id','ContactId')['field'](_0x15d10f[_0x85a6('0x7d')]['toString'](),_0x85a6('0x70'))[_0x85a6('0x6d')](_0x5e34f8[_0x85a6('0x53')]['id'][_0x85a6('0x6f')](),_0x85a6('0x5b'))[_0x85a6('0x6d')]('\x27'+_0x537c71+'\x27',_0x85a6('0x55'))[_0x85a6('0x6d')]('\x27'+_0x537c71+'\x27',_0x85a6('0x56'))['from'](_0x85a6('0x7e'))[_0x85a6('0x3d')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x15d10f[_0x85a6('0x7d')][_0x85a6('0x6f')]())[_0x85a6('0x3d')]('phone\x20IS\x20NOT\x20NULL'))[_0x85a6('0x6f')]();}_0x1910f4=squel[_0x85a6('0x7a')]()['into']('cm_hopper_additional_phones')[_0x85a6('0x6b')](['cmHopperId',_0x85a6('0x6c'),_0x85a6('0x7b'),_0x85a6('0x7f'),_0x85a6('0x55'),'updatedAt'],squel[_0x85a6('0x76')]()[_0x85a6('0x6d')](_0x85a6('0x80'),'id')[_0x85a6('0x6d')](_0x85a6('0x6e'),_0x85a6('0x6c'))[_0x85a6('0x6d')](_0x85a6('0x81'),'phone')[_0x85a6('0x6d')](_0x85a6('0x82'),_0x85a6('0x7f'))[_0x85a6('0x6d')]('\x27'+_0x537c71+'\x27',_0x85a6('0x55'))[_0x85a6('0x6d')]('\x27'+_0x537c71+'\x27',_0x85a6('0x56'))[_0x85a6('0x71')](_0x85a6('0x83'),'ci')[_0x85a6('0x84')](_0x85a6('0x6a'),'h',_0x85a6('0x85'))[_0x85a6('0x3d')](_0x85a6('0x86'),_0x15d10f[_0x85a6('0x7d')]['toString']())['where']('h.CampaignId=?',_0x5e34f8['params']['id'][_0x85a6('0x6f')]())[_0x85a6('0x3d')]('h.createdAt\x20=\x20?',_0x537c71))[_0x85a6('0x6f')]();_0x53eae0['push'](db[_0x85a6('0x87')]['query'](_0xaab4c5));_0x5c86aa[_0x85a6('0x88')](db[_0x85a6('0x87')][_0x85a6('0x33')](_0x1910f4));}return BPromise[_0x85a6('0x89')](_0x53eae0);}})['then'](function(){return BPromise[_0x85a6('0x89')](_0x5c86aa);})[_0x85a6('0x24')](function(){return _0x14b1e;})[_0x85a6('0x24')](respondWithResult(_0x450e31,null))[_0x85a6('0x45')](handleError(_0x450e31,null));};exports[_0x85a6('0x8a')]=function(_0x18e72c,_0x4a36b9,_0x2b005c){return db[_0x85a6('0x2e')][_0x85a6('0x49')]({'where':{'id':_0x18e72c[_0x85a6('0x53')]['id']}})['then'](handleEntityNotFound(_0x4a36b9,null))['then'](function(_0x492d62){if(_0x492d62){return _0x492d62[_0x85a6('0x8a')](_0x18e72c['query'][_0x85a6('0x65')]);}})[_0x85a6('0x24')](function(_0x358eda){if(_0x358eda){return db[_0x85a6('0x5a')][_0x85a6('0x25')]({'where':{'ListId':_0x18e72c[_0x85a6('0x33')][_0x85a6('0x65')],'CampaignId':_0x18e72c[_0x85a6('0x53')]['id']}})['then'](function(){return _0x358eda;});}})[_0x85a6('0x24')](respondWithStatusCode(_0x4a36b9,null))['catch'](handleError(_0x4a36b9,null));};exports[_0x85a6('0x8b')]=function(_0x5c00cd,_0x4cf781,_0x375706){var _0x384b6c={};var _0x3e9d5a={};var _0x5bcdaf;var _0x428720;return db[_0x85a6('0x2e')]['findOne']({'where':{'id':_0x5c00cd[_0x85a6('0x53')]['id']}})[_0x85a6('0x24')](handleEntityNotFound(_0x4cf781,null))[_0x85a6('0x24')](function(_0x495612){if(_0x495612){_0x5bcdaf=_0x495612;_0x3e9d5a['model']=_[_0x85a6('0x34')](db['CmList'][_0x85a6('0x47')]);_0x3e9d5a[_0x85a6('0x33')]=_[_0x85a6('0x34')](_0x5c00cd[_0x85a6('0x33')]);_0x3e9d5a[_0x85a6('0x35')]=_[_0x85a6('0x36')](_0x3e9d5a[_0x85a6('0x31')],_0x3e9d5a[_0x85a6('0x33')]);_0x384b6c[_0x85a6('0x37')]=_[_0x85a6('0x36')](_0x3e9d5a[_0x85a6('0x31')],qs['fields'](_0x5c00cd[_0x85a6('0x33')][_0x85a6('0x38')]));_0x384b6c['attributes']=_0x384b6c['attributes'][_0x85a6('0x48')]?_0x384b6c[_0x85a6('0x37')]:_0x3e9d5a['model'];_0x384b6c['order']=qs[_0x85a6('0x3c')](_0x5c00cd[_0x85a6('0x33')][_0x85a6('0x3c')]);_0x384b6c[_0x85a6('0x3d')]=qs[_0x85a6('0x35')](_[_0x85a6('0x3e')](_0x5c00cd[_0x85a6('0x33')],_0x3e9d5a[_0x85a6('0x35')]));if(_0x5c00cd[_0x85a6('0x33')][_0x85a6('0x3f')]){_0x384b6c[_0x85a6('0x3d')]=_['merge'](_0x384b6c[_0x85a6('0x3d')],{'$or':_['map'](_0x384b6c[_0x85a6('0x37')],function(_0x4b19e8){var _0x1c3491={};_0x1c3491[_0x4b19e8]={'$like':'%'+_0x5c00cd[_0x85a6('0x33')][_0x85a6('0x3f')]+'%'};return _0x1c3491;})});}_0x384b6c=_[_0x85a6('0x40')]({},_0x384b6c,_0x5c00cd['options']);return _0x5bcdaf['getBlackLists'](_0x384b6c);}})[_0x85a6('0x24')](function(_0x29e2a4){if(_0x29e2a4){_0x428720=_0x29e2a4[_0x85a6('0x48')];if(!_0x5c00cd[_0x85a6('0x33')][_0x85a6('0x39')](_0x85a6('0x3a'))){_0x384b6c[_0x85a6('0x1b')]=qs[_0x85a6('0x1b')](_0x5c00cd['query'][_0x85a6('0x1b')]);_0x384b6c[_0x85a6('0x1a')]=qs['offset'](_0x5c00cd[_0x85a6('0x33')][_0x85a6('0x1a')]);}return _0x5bcdaf[_0x85a6('0x8b')](_0x384b6c);}})[_0x85a6('0x24')](function(_0xadbf2f){if(_0xadbf2f){return _0xadbf2f?{'count':_0x428720,'rows':_0xadbf2f}:null;}})[_0x85a6('0x24')](respondWithResult(_0x4cf781,null))[_0x85a6('0x45')](handleError(_0x4cf781,null));};exports['addBlackLists']=function(_0x2ccf16,_0xb930d9,_0x4cff87){var _0x516038,_0x394f65;var _0x2c5079=[];var _0x2c296d=moment()[_0x85a6('0x63')](_0x85a6('0x64'));return db[_0x85a6('0x2e')][_0x85a6('0x49')]({'where':{'id':_0x2ccf16[_0x85a6('0x53')]['id']}})[_0x85a6('0x24')](handleEntityNotFound(_0xb930d9,null))[_0x85a6('0x24')](function(_0x36787b){if(_0x36787b){_0x394f65=_0x36787b;return _0x36787b[_0x85a6('0x8c')](_0x2ccf16['body'][_0x85a6('0x65')],_['omit'](_0x2ccf16[_0x85a6('0x4b')],[_0x85a6('0x65'),'id'])||{});}return null;})[_0x85a6('0x66')](function(_0x22bae7){var _0x1f95bc;var _0x1a2feb;_0x516038=_0x22bae7||[];var _0x295e82=[];if(_0x22bae7){for(var _0x313d35=0x0;_0x313d35<_0x22bae7[_0x85a6('0x48')];_0x313d35+=0x1){var _0x53fa3f=_0x22bae7[_0x313d35][_0x85a6('0x26')]({'plain':!![]});_0x1f95bc=squel['insert']()[_0x85a6('0x69')](_0x85a6('0x8d'))[_0x85a6('0x6b')]([_0x85a6('0x7b'),_0x85a6('0x7c'),_0x85a6('0x70'),_0x85a6('0x5b'),_0x85a6('0x55'),'updatedAt'],squel[_0x85a6('0x76')]()[_0x85a6('0x6d')](_0x85a6('0x7b'),'phone')[_0x85a6('0x6d')]('id',_0x85a6('0x7c'))['field'](_0x53fa3f['CmListId'][_0x85a6('0x6f')](),_0x85a6('0x70'))[_0x85a6('0x6d')](_0x2ccf16['params']['id'][_0x85a6('0x6f')](),_0x85a6('0x5b'))[_0x85a6('0x6d')](_0x85a6('0x6e'),_0x85a6('0x55'))[_0x85a6('0x6d')](_0x85a6('0x6e'),'updatedAt')[_0x85a6('0x71')](_0x85a6('0x7e'))[_0x85a6('0x3d')](_0x85a6('0x72'))[_0x85a6('0x3d')](_0x85a6('0x73'),_0x53fa3f['CmListId'][_0x85a6('0x6f')]())[_0x85a6('0x3d')](_0x85a6('0x74')))[_0x85a6('0x6f')]();_0x295e82[_0x85a6('0x88')](db['sequelize']['query'](_0x1f95bc));}return BPromise['all'](_0x295e82);}})['then'](function(){return _0x516038;})[_0x85a6('0x24')](respondWithResult(_0xb930d9,null))[_0x85a6('0x45')](handleError(_0xb930d9,null));};exports[_0x85a6('0x8e')]=function(_0x316894,_0x335dc9,_0x428122){return db['Campaign'][_0x85a6('0x49')]({'where':{'id':_0x316894[_0x85a6('0x53')]['id']}})[_0x85a6('0x24')](handleEntityNotFound(_0x335dc9,null))[_0x85a6('0x24')](function(_0x2d92a7){if(_0x2d92a7){return _0x2d92a7[_0x85a6('0x8e')](_0x316894['query'][_0x85a6('0x65')]);}})['then'](function(_0x58de0c){if(_0x58de0c){return db[_0x85a6('0x60')][_0x85a6('0x25')]({'where':{'ListId':_0x316894[_0x85a6('0x33')][_0x85a6('0x65')],'CampaignId':_0x316894[_0x85a6('0x53')]['id']}})[_0x85a6('0x24')](function(){return _0x58de0c;});}})['then'](respondWithStatusCode(_0x335dc9,null))[_0x85a6('0x45')](handleError(_0x335dc9,null));}; \ No newline at end of file +var _0x8978=['h.createdAt\x20=\x20?','push','sequelize','all','removeLists','ids','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','zip-dir','request-promise','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','stack','name','send','index','map','Campaign','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','updatedAt','error','getHoppers','CmHopper','pick','CampaignId','filter','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','hasOwnProperty','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','into','fromQuery','phone','ContactId','ListId','field','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','cm_hopper','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?'];(function(_0x13da85,_0x1fd5b5){var _0x54be2c=function(_0x31faaa){while(--_0x31faaa){_0x13da85['push'](_0x13da85['shift']());}};_0x54be2c(++_0x1fd5b5);}(_0x8978,0x1cc));var _0x8897=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x8978[_0x5c351c];return _0x26f3b3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8897('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8897('0x1'));var moment=require('moment');var BPromise=require(_0x8897('0x2'));var Mustache=require(_0x8897('0x3'));var util=require(_0x8897('0x4'));var path=require(_0x8897('0x5'));var sox=require(_0x8897('0x6'));var csv=require('to-csv');var ejs=require(_0x8897('0x7'));var fs=require('fs');var fs_extra=require(_0x8897('0x8'));var _=require('lodash');var squel=require(_0x8897('0x9'));var crypto=require(_0x8897('0xa'));var jsforce=require(_0x8897('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8897('0xc'));var querystring=require('querystring');var Papa=require(_0x8897('0xd'));var Redis=require('ioredis');var authService=require(_0x8897('0xe'));var qs=require(_0x8897('0xf'));var as=require(_0x8897('0x10'));var hardwareService=require(_0x8897('0x11'));var logger=require('../../config/logger')(_0x8897('0x12'));var utils=require(_0x8897('0x13'));var config=require(_0x8897('0x14'));var licenseUtil=require(_0x8897('0x15'));var db=require(_0x8897('0x16'))['db'];function respondWithStatusCode(_0xd9bb97,_0x294348){_0x294348=_0x294348||0xcc;return function(_0x487eae){if(_0x487eae){return _0xd9bb97[_0x8897('0x17')](_0x294348);}return _0xd9bb97['status'](_0x294348)['end']();};}function respondWithResult(_0x550559,_0x4a5070){_0x4a5070=_0x4a5070||0xc8;return function(_0x490a9a){if(_0x490a9a){return _0x550559[_0x8897('0x18')](_0x4a5070)[_0x8897('0x19')](_0x490a9a);}};}function respondWithFilteredResult(_0x3cc0e9,_0x14383b){return function(_0x2528e3){if(_0x2528e3){var _0x28e689=typeof _0x14383b[_0x8897('0x1a')]===_0x8897('0x1b')&&typeof _0x14383b[_0x8897('0x1c')]==='undefined';var _0x5044dc=_0x2528e3['count'];var _0x3603a8=_0x28e689?0x0:_0x14383b['offset'];var _0x44fa9f=_0x28e689?_0x2528e3['count']:_0x14383b['offset']+_0x14383b[_0x8897('0x1c')];var _0x5d0353;if(_0x44fa9f>=_0x5044dc){_0x44fa9f=_0x5044dc;_0x5d0353=0xc8;}else{_0x5d0353=0xce;}_0x3cc0e9[_0x8897('0x18')](_0x5d0353);return _0x3cc0e9[_0x8897('0x1d')](_0x8897('0x1e'),_0x3603a8+'-'+_0x44fa9f+'/'+_0x5044dc)['json'](_0x2528e3);}return null;};}function patchUpdates(_0x72b5b3){return function(_0x9139a7){try{jsonpatch[_0x8897('0x1f')](_0x9139a7,_0x72b5b3,!![]);}catch(_0x27ba89){return BPromise[_0x8897('0x20')](_0x27ba89);}return _0x9139a7[_0x8897('0x21')]();};}function saveUpdates(_0x5d81c1,_0x2bf87d){return function(_0x70b9f9){if(_0x70b9f9){return _0x70b9f9[_0x8897('0x22')](_0x5d81c1)[_0x8897('0x23')](function(_0x4d329c){return _0x4d329c;});}return null;};}function removeEntity(_0x42f426,_0x3aa1d1){return function(_0x328c88){if(_0x328c88){return _0x328c88[_0x8897('0x24')]()['then'](function(){var _0x2bd4c3=_0x328c88[_0x8897('0x25')]({'plain':!![]});var _0x2816f2=_0x8897('0x26');return db[_0x8897('0x27')]['destroy']({'where':{'type':_0x2816f2,'resourceId':_0x2bd4c3['id']}})[_0x8897('0x23')](function(){return _0x328c88;});})[_0x8897('0x23')](function(){_0x42f426[_0x8897('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55bfa4,_0x190e5c){return function(_0x52fb49){if(!_0x52fb49){_0x55bfa4[_0x8897('0x17')](0x194);}return _0x52fb49;};}function handleError(_0xdc1a23,_0x1773a3){_0x1773a3=_0x1773a3||0x1f4;return function(_0x37e290){logger['error'](_0x37e290[_0x8897('0x28')]);if(_0x37e290[_0x8897('0x29')]){delete _0x37e290[_0x8897('0x29')];}_0xdc1a23[_0x8897('0x18')](_0x1773a3)[_0x8897('0x2a')](_0x37e290);};}exports[_0x8897('0x2b')]=function(_0x2190b6,_0x1915ec){var _0x5a3f6e={},_0xbf004c={},_0x548896={'count':0x0,'rows':[]};var _0x216b0c=_[_0x8897('0x2c')](db[_0x8897('0x2d')]['rawAttributes'],function(_0x3bb20e){return{'name':_0x3bb20e[_0x8897('0x2e')],'type':_0x3bb20e[_0x8897('0x2f')][_0x8897('0x30')]};});_0xbf004c[_0x8897('0x31')]=_[_0x8897('0x2c')](_0x216b0c,_0x8897('0x29'));_0xbf004c[_0x8897('0x32')]=_[_0x8897('0x33')](_0x2190b6[_0x8897('0x32')]);_0xbf004c['filters']=_[_0x8897('0x34')](_0xbf004c[_0x8897('0x31')],_0xbf004c[_0x8897('0x32')]);_0x5a3f6e[_0x8897('0x35')]=_[_0x8897('0x34')](_0xbf004c[_0x8897('0x31')],qs['fields'](_0x2190b6[_0x8897('0x32')][_0x8897('0x36')]));_0x5a3f6e[_0x8897('0x35')]=_0x5a3f6e[_0x8897('0x35')][_0x8897('0x37')]?_0x5a3f6e['attributes']:_0xbf004c[_0x8897('0x31')];if(!_0x2190b6['query']['hasOwnProperty'](_0x8897('0x38'))){_0x5a3f6e[_0x8897('0x1c')]=qs['limit'](_0x2190b6[_0x8897('0x32')][_0x8897('0x1c')]);_0x5a3f6e[_0x8897('0x1a')]=qs['offset'](_0x2190b6[_0x8897('0x32')][_0x8897('0x1a')]);}_0x5a3f6e[_0x8897('0x39')]=qs[_0x8897('0x3a')](_0x2190b6[_0x8897('0x32')]['sort']);_0x5a3f6e[_0x8897('0x3b')]=qs[_0x8897('0x3c')](_['pick'](_0x2190b6['query'],_0xbf004c['filters']),_0x216b0c);if(_0x2190b6['query']['filter']){_0x5a3f6e[_0x8897('0x3b')]=_[_0x8897('0x3d')](_0x5a3f6e['where'],{'$or':_[_0x8897('0x2c')](_0x216b0c,function(_0x8e6377){if(_0x8e6377['type']!==_0x8897('0x3e')){var _0x48eb00={};_0x48eb00[_0x8e6377[_0x8897('0x29')]]={'$like':'%'+_0x2190b6[_0x8897('0x32')]['filter']+'%'};return _0x48eb00;}})});}_0x5a3f6e=_[_0x8897('0x3d')]({},_0x5a3f6e,_0x2190b6['options']);var _0xe763a3={'where':_0x5a3f6e[_0x8897('0x3b')]};return db[_0x8897('0x2d')]['count'](_0xe763a3)[_0x8897('0x23')](function(_0x5028dc){_0x548896[_0x8897('0x3f')]=_0x5028dc;if(_0x2190b6[_0x8897('0x32')][_0x8897('0x40')]){_0x5a3f6e[_0x8897('0x41')]=[{'all':!![]}];}return db[_0x8897('0x2d')][_0x8897('0x42')](_0x5a3f6e);})['then'](function(_0x24a72b){_0x548896[_0x8897('0x43')]=_0x24a72b;return _0x548896;})[_0x8897('0x23')](respondWithFilteredResult(_0x1915ec,_0x5a3f6e))[_0x8897('0x44')](handleError(_0x1915ec,null));};exports[_0x8897('0x45')]=function(_0x14ac70,_0x5478e0){var _0x2c35d5={'raw':![],'where':{'id':_0x14ac70[_0x8897('0x46')]['id']}},_0x335f6b={};_0x335f6b[_0x8897('0x31')]=_[_0x8897('0x33')](db[_0x8897('0x2d')][_0x8897('0x47')]);_0x335f6b[_0x8897('0x32')]=_[_0x8897('0x33')](_0x14ac70[_0x8897('0x32')]);_0x335f6b[_0x8897('0x3c')]=_[_0x8897('0x34')](_0x335f6b[_0x8897('0x31')],_0x335f6b['query']);_0x2c35d5[_0x8897('0x35')]=_[_0x8897('0x34')](_0x335f6b[_0x8897('0x31')],qs[_0x8897('0x36')](_0x14ac70['query'][_0x8897('0x36')]));_0x2c35d5[_0x8897('0x35')]=_0x2c35d5[_0x8897('0x35')][_0x8897('0x37')]?_0x2c35d5[_0x8897('0x35')]:_0x335f6b['model'];if(_0x14ac70[_0x8897('0x32')]['includeAll']){_0x2c35d5[_0x8897('0x41')]=[{'all':!![]}];}_0x2c35d5=_[_0x8897('0x3d')]({},_0x2c35d5,_0x14ac70[_0x8897('0x48')]);return db[_0x8897('0x2d')][_0x8897('0x49')](_0x2c35d5)[_0x8897('0x23')](handleEntityNotFound(_0x5478e0,null))[_0x8897('0x23')](respondWithResult(_0x5478e0,null))[_0x8897('0x44')](handleError(_0x5478e0,null));};exports[_0x8897('0x4a')]=function(_0x1d753f,_0x1daa1d){return db[_0x8897('0x2d')][_0x8897('0x4a')](_0x1d753f['body'],{})['then'](function(_0xba406c){var _0x2ee5cc=_0x1d753f[_0x8897('0x4b')]['get']({'plain':!![]});if(!_0x2ee5cc)throw new Error(_0x8897('0x4c'));if(_0x2ee5cc[_0x8897('0x4d')]===_0x8897('0x4b')){var _0x3e8001=_0xba406c['get']({'plain':!![]});var _0x4312aa=_0x8897('0x26');return db[_0x8897('0x4e')][_0x8897('0x49')]({'where':{'name':_0x4312aa,'userProfileId':_0x2ee5cc[_0x8897('0x4f')]},'raw':!![]})[_0x8897('0x23')](function(_0x22f3e2){if(_0x22f3e2&&_0x22f3e2[_0x8897('0x50')]===0x0){return db[_0x8897('0x27')][_0x8897('0x4a')]({'name':_0x3e8001[_0x8897('0x29')],'resourceId':_0x3e8001['id'],'type':_0x22f3e2[_0x8897('0x29')],'sectionId':_0x22f3e2['id']},{})[_0x8897('0x23')](function(){return _0xba406c;});}else{return _0xba406c;}})[_0x8897('0x44')](function(_0x47487a){logger['error'](_0x8897('0x51'),_0x47487a);throw _0x47487a;});}return _0xba406c;})[_0x8897('0x23')](respondWithResult(_0x1daa1d,0xc9))[_0x8897('0x44')](handleError(_0x1daa1d,null));};exports[_0x8897('0x52')]=function(_0x47b8dc,_0xf63a2b){var _0x1f3ea8={'where':{'id':_0x47b8dc[_0x8897('0x46')]['id']}},_0x3cc500={};_0x3cc500[_0x8897('0x31')]=_[_0x8897('0x33')](db[_0x8897('0x2d')]['rawAttributes']);_0x1f3ea8['attributes']=_[_0x8897('0x34')](_0x3cc500[_0x8897('0x31')],qs[_0x8897('0x36')](_0x47b8dc[_0x8897('0x32')][_0x8897('0x36')]));_0x1f3ea8[_0x8897('0x35')]=_0x1f3ea8[_0x8897('0x35')][_0x8897('0x37')]?_0x1f3ea8['attributes']:_0x3cc500[_0x8897('0x31')];if(_0x47b8dc[_0x8897('0x32')]['includeAll']){_0x1f3ea8['include']=[{'all':!![]}];}_0x1f3ea8=_['merge']({},_0x1f3ea8,_0x47b8dc['options']);return db['Campaign'][_0x8897('0x49')](_0x1f3ea8)[_0x8897('0x23')](handleEntityNotFound(_0xf63a2b,null))[_0x8897('0x23')](function(_0x7066da){if(_0x7066da){var _0x29400e=_0x7066da['get']({'plain':!![]});_0x29400e=qs[_0x8897('0x53')](_0x29400e,['id',_0x8897('0x54'),'updatedAt']);_0x47b8dc[_0x8897('0x55')]=_['omit'](_0x47b8dc[_0x8897('0x55')],['id',_0x8897('0x54'),_0x8897('0x56')]);return db['Campaign'][_0x8897('0x4a')](_[_0x8897('0x3d')](_0x29400e,_0x47b8dc[_0x8897('0x55')]),{'include':_0x47b8dc[_0x8897('0x32')][_0x8897('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x3b5dbd){var _0x541260=_0x47b8dc[_0x8897('0x4b')][_0x8897('0x25')]({'plain':!![]});if(!_0x541260)throw new Error(_0x8897('0x4c'));if(_0x541260[_0x8897('0x4d')]===_0x8897('0x4b')){var _0x3af18a=_0x3b5dbd[_0x8897('0x25')]({'plain':!![]});var _0x45cf0d=_0x8897('0x26');return db[_0x8897('0x4e')]['find']({'where':{'name':_0x45cf0d,'userProfileId':_0x541260[_0x8897('0x4f')]},'raw':!![]})[_0x8897('0x23')](function(_0xa46650){if(_0xa46650&&_0xa46650['autoAssociation']===0x0){return db[_0x8897('0x27')][_0x8897('0x4a')]({'name':_0x3af18a[_0x8897('0x29')],'resourceId':_0x3af18a['id'],'type':_0xa46650[_0x8897('0x29')],'sectionId':_0xa46650['id']},{})[_0x8897('0x23')](function(){return _0x3b5dbd;});}else{return _0x3b5dbd;}})[_0x8897('0x44')](function(_0x10c7e2){logger[_0x8897('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10c7e2);throw _0x10c7e2;});}return _0x3b5dbd;});}})[_0x8897('0x23')](respondWithResult(_0xf63a2b,0xc9))[_0x8897('0x44')](handleError(_0xf63a2b,null));};exports[_0x8897('0x22')]=function(_0x544d2a,_0x29a02c){if(_0x544d2a[_0x8897('0x55')]['id']){delete _0x544d2a[_0x8897('0x55')]['id'];}return db['Campaign'][_0x8897('0x49')]({'where':{'id':_0x544d2a[_0x8897('0x46')]['id']}})['then'](handleEntityNotFound(_0x29a02c,null))['then'](saveUpdates(_0x544d2a[_0x8897('0x55')],null))[_0x8897('0x23')](respondWithResult(_0x29a02c,null))[_0x8897('0x44')](handleError(_0x29a02c,null));};exports[_0x8897('0x24')]=function(_0x8b2e6,_0xcc0bd3){return db[_0x8897('0x2d')][_0x8897('0x49')]({'where':{'id':_0x8b2e6[_0x8897('0x46')]['id']}})[_0x8897('0x23')](handleEntityNotFound(_0xcc0bd3,null))[_0x8897('0x23')](removeEntity(_0xcc0bd3,null))['catch'](handleError(_0xcc0bd3,null));};exports[_0x8897('0x58')]=function(_0x57fca5,_0x52141a,_0x4218e3){var _0xd0c2b7={'raw':!![],'where':{}};var _0x352fcb={};var _0x2a051c={'count':0x0,'rows':[]};return db[_0x8897('0x2d')]['findOne']({'where':{'id':_0x57fca5[_0x8897('0x46')]['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x52141a,null))[_0x8897('0x23')](function(_0x4554b9){if(_0x4554b9){_0x352fcb[_0x8897('0x31')]=_[_0x8897('0x33')](db[_0x8897('0x59')][_0x8897('0x47')]);_0x352fcb['query']=_[_0x8897('0x33')](_0x57fca5['query']);_0x352fcb['filters']=_['intersection'](_0x352fcb[_0x8897('0x31')],_0x352fcb[_0x8897('0x32')]);_0xd0c2b7[_0x8897('0x35')]=_['intersection'](_0x352fcb['model'],qs[_0x8897('0x36')](_0x57fca5[_0x8897('0x32')][_0x8897('0x36')]));_0xd0c2b7['attributes']=_0xd0c2b7[_0x8897('0x35')]['length']?_0xd0c2b7[_0x8897('0x35')]:_0x352fcb['model'];if(!_0x57fca5[_0x8897('0x32')]['hasOwnProperty'](_0x8897('0x38'))){_0xd0c2b7['limit']=qs[_0x8897('0x1c')](_0x57fca5[_0x8897('0x32')][_0x8897('0x1c')]);_0xd0c2b7[_0x8897('0x1a')]=qs[_0x8897('0x1a')](_0x57fca5[_0x8897('0x32')]['offset']);}_0xd0c2b7[_0x8897('0x39')]=qs[_0x8897('0x3a')](_0x57fca5[_0x8897('0x32')][_0x8897('0x3a')]);_0xd0c2b7[_0x8897('0x3b')]=qs[_0x8897('0x3c')](_[_0x8897('0x5a')](_0x57fca5[_0x8897('0x32')],_0x352fcb[_0x8897('0x3c')]));_0xd0c2b7[_0x8897('0x3b')][_0x8897('0x5b')]=_0x4554b9['id'];if(_0x57fca5[_0x8897('0x32')]['filter']){_0xd0c2b7[_0x8897('0x3b')]=_['merge'](_0xd0c2b7['where'],{'$or':_[_0x8897('0x2c')](_0xd0c2b7['attributes'],function(_0x4ac2cf){var _0x3a3cc2={};_0x3a3cc2[_0x4ac2cf]={'$like':'%'+_0x57fca5['query'][_0x8897('0x5c')]+'%'};return _0x3a3cc2;})});}_0xd0c2b7=_['merge']({},_0xd0c2b7,_0x57fca5['options']);return db[_0x8897('0x59')]['count']({'where':_0xd0c2b7[_0x8897('0x3b')]})[_0x8897('0x23')](function(_0x10ab07){_0x2a051c['count']=_0x10ab07;if(_0x57fca5[_0x8897('0x32')][_0x8897('0x40')]){_0xd0c2b7['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0xd0c2b7);})[_0x8897('0x23')](function(_0x475e82){_0x2a051c[_0x8897('0x43')]=_0x475e82;return _0x2a051c;});}})['then'](respondWithFilteredResult(_0x52141a,_0xd0c2b7))['catch'](handleError(_0x52141a,null));};exports[_0x8897('0x5d')]=function(_0x163045,_0x154ed6,_0x546821){var _0x129cbe={'raw':!![],'where':{}};var _0x273030={};var _0x5e8fc4={'count':0x0,'rows':[]};return db[_0x8897('0x2d')][_0x8897('0x5e')]({'where':{'id':_0x163045[_0x8897('0x46')]['id']}})['then'](handleEntityNotFound(_0x154ed6,null))[_0x8897('0x23')](function(_0x3bebf0){if(_0x3bebf0){_0x273030[_0x8897('0x31')]=_[_0x8897('0x33')](db['CmHopperHistory'][_0x8897('0x47')]);_0x273030['query']=_['keys'](_0x163045['query']);_0x273030['filters']=_['intersection'](_0x273030[_0x8897('0x31')],_0x273030['query']);_0x129cbe[_0x8897('0x35')]=_[_0x8897('0x34')](_0x273030[_0x8897('0x31')],qs[_0x8897('0x36')](_0x163045['query']['fields']));_0x129cbe[_0x8897('0x35')]=_0x129cbe['attributes'][_0x8897('0x37')]?_0x129cbe[_0x8897('0x35')]:_0x273030[_0x8897('0x31')];if(!_0x163045[_0x8897('0x32')]['hasOwnProperty'](_0x8897('0x38'))){_0x129cbe[_0x8897('0x1c')]=qs[_0x8897('0x1c')](_0x163045[_0x8897('0x32')]['limit']);_0x129cbe[_0x8897('0x1a')]=qs[_0x8897('0x1a')](_0x163045[_0x8897('0x32')]['offset']);}_0x129cbe['order']=qs[_0x8897('0x3a')](_0x163045[_0x8897('0x32')][_0x8897('0x3a')]);_0x129cbe[_0x8897('0x3b')]=qs[_0x8897('0x3c')](_[_0x8897('0x5a')](_0x163045[_0x8897('0x32')],_0x273030['filters']));_0x129cbe[_0x8897('0x3b')]['CampaignId']=_0x3bebf0['id'];if(_0x163045[_0x8897('0x32')][_0x8897('0x5c')]){_0x129cbe[_0x8897('0x3b')]=_[_0x8897('0x3d')](_0x129cbe['where'],{'$or':_[_0x8897('0x2c')](_0x129cbe[_0x8897('0x35')],function(_0x4c7e21){var _0x1e08d7={};_0x1e08d7[_0x4c7e21]={'$like':'%'+_0x163045[_0x8897('0x32')][_0x8897('0x5c')]+'%'};return _0x1e08d7;})});}_0x129cbe=_[_0x8897('0x3d')]({},_0x129cbe,_0x163045[_0x8897('0x48')]);return db[_0x8897('0x5f')][_0x8897('0x3f')]({'where':_0x129cbe[_0x8897('0x3b')]})[_0x8897('0x23')](function(_0x4cc314){_0x5e8fc4[_0x8897('0x3f')]=_0x4cc314;if(_0x163045[_0x8897('0x32')]['includeAll']){_0x129cbe[_0x8897('0x41')]=[{'all':!![]}];}return db[_0x8897('0x5f')][_0x8897('0x42')](_0x129cbe);})[_0x8897('0x23')](function(_0x2b095b){_0x5e8fc4[_0x8897('0x43')]=_0x2b095b;return _0x5e8fc4;});}})['then'](respondWithFilteredResult(_0x154ed6,_0x129cbe))[_0x8897('0x44')](handleError(_0x154ed6,null));};exports[_0x8897('0x60')]=function(_0x3f52af,_0x3a46b5,_0x58ae92){var _0x77577e={'raw':!![],'where':{}};var _0x430e52={};var _0x2d153e={'count':0x0,'rows':[]};return db[_0x8897('0x2d')]['findOne']({'where':{'id':_0x3f52af[_0x8897('0x46')]['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x3a46b5,null))[_0x8897('0x23')](function(_0x8a2b5c){if(_0x8a2b5c){_0x430e52[_0x8897('0x31')]=_[_0x8897('0x33')](db[_0x8897('0x61')][_0x8897('0x47')]);_0x430e52[_0x8897('0x32')]=_[_0x8897('0x33')](_0x3f52af[_0x8897('0x32')]);_0x430e52[_0x8897('0x3c')]=_['intersection'](_0x430e52[_0x8897('0x31')],_0x430e52[_0x8897('0x32')]);_0x77577e['attributes']=_[_0x8897('0x34')](_0x430e52['model'],qs[_0x8897('0x36')](_0x3f52af['query'][_0x8897('0x36')]));_0x77577e[_0x8897('0x35')]=_0x77577e[_0x8897('0x35')][_0x8897('0x37')]?_0x77577e[_0x8897('0x35')]:_0x430e52[_0x8897('0x31')];if(!_0x3f52af[_0x8897('0x32')][_0x8897('0x62')](_0x8897('0x38'))){_0x77577e[_0x8897('0x1c')]=qs[_0x8897('0x1c')](_0x3f52af[_0x8897('0x32')][_0x8897('0x1c')]);_0x77577e[_0x8897('0x1a')]=qs[_0x8897('0x1a')](_0x3f52af[_0x8897('0x32')][_0x8897('0x1a')]);}_0x77577e[_0x8897('0x39')]=qs['sort'](_0x3f52af[_0x8897('0x32')]['sort']);_0x77577e[_0x8897('0x3b')]=qs[_0x8897('0x3c')](_[_0x8897('0x5a')](_0x3f52af['query'],_0x430e52[_0x8897('0x3c')]));_0x77577e[_0x8897('0x3b')]['CampaignId']=_0x8a2b5c['id'];if(_0x3f52af[_0x8897('0x32')][_0x8897('0x5c')]){_0x77577e[_0x8897('0x3b')]=_[_0x8897('0x3d')](_0x77577e['where'],{'$or':_['map'](_0x77577e[_0x8897('0x35')],function(_0x6ad77f){var _0x29eca1={};_0x29eca1[_0x6ad77f]={'$like':'%'+_0x3f52af[_0x8897('0x32')][_0x8897('0x5c')]+'%'};return _0x29eca1;})});}_0x77577e=_['merge']({},_0x77577e,_0x3f52af[_0x8897('0x48')]);return db[_0x8897('0x61')][_0x8897('0x3f')]({'where':_0x77577e[_0x8897('0x3b')]})[_0x8897('0x23')](function(_0x2cabf0){_0x2d153e[_0x8897('0x3f')]=_0x2cabf0;if(_0x3f52af[_0x8897('0x32')]['includeAll']){_0x77577e[_0x8897('0x41')]=[{'all':!![]}];}return db[_0x8897('0x61')][_0x8897('0x42')](_0x77577e);})[_0x8897('0x23')](function(_0x427de2){_0x2d153e['rows']=_0x427de2;return _0x2d153e;});}})[_0x8897('0x23')](respondWithFilteredResult(_0x3a46b5,_0x77577e))[_0x8897('0x44')](handleError(_0x3a46b5,null));};exports['getHopperBlacks']=function(_0x36479e,_0x465cd2,_0x489b9d){var _0x4e4de3={'raw':!![],'where':{}};var _0x5b3f22={};var _0x5707ab={'count':0x0,'rows':[]};return db[_0x8897('0x2d')]['findOne']({'where':{'id':_0x36479e[_0x8897('0x46')]['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x465cd2,null))[_0x8897('0x23')](function(_0x29ef59){if(_0x29ef59){_0x5b3f22['model']=_[_0x8897('0x33')](db['CmHopperBlack']['rawAttributes']);_0x5b3f22[_0x8897('0x32')]=_[_0x8897('0x33')](_0x36479e[_0x8897('0x32')]);_0x5b3f22[_0x8897('0x3c')]=_[_0x8897('0x34')](_0x5b3f22['model'],_0x5b3f22['query']);_0x4e4de3[_0x8897('0x35')]=_['intersection'](_0x5b3f22[_0x8897('0x31')],qs[_0x8897('0x36')](_0x36479e[_0x8897('0x32')][_0x8897('0x36')]));_0x4e4de3[_0x8897('0x35')]=_0x4e4de3[_0x8897('0x35')][_0x8897('0x37')]?_0x4e4de3[_0x8897('0x35')]:_0x5b3f22[_0x8897('0x31')];if(!_0x36479e['query'][_0x8897('0x62')](_0x8897('0x38'))){_0x4e4de3[_0x8897('0x1c')]=qs[_0x8897('0x1c')](_0x36479e[_0x8897('0x32')][_0x8897('0x1c')]);_0x4e4de3[_0x8897('0x1a')]=qs[_0x8897('0x1a')](_0x36479e[_0x8897('0x32')][_0x8897('0x1a')]);}_0x4e4de3[_0x8897('0x39')]=qs[_0x8897('0x3a')](_0x36479e['query']['sort']);_0x4e4de3[_0x8897('0x3b')]=qs[_0x8897('0x3c')](_[_0x8897('0x5a')](_0x36479e[_0x8897('0x32')],_0x5b3f22[_0x8897('0x3c')]));_0x4e4de3[_0x8897('0x3b')][_0x8897('0x5b')]=_0x29ef59['id'];if(_0x36479e[_0x8897('0x32')][_0x8897('0x5c')]){_0x4e4de3[_0x8897('0x3b')]=_[_0x8897('0x3d')](_0x4e4de3[_0x8897('0x3b')],{'$or':_[_0x8897('0x2c')](_0x4e4de3[_0x8897('0x35')],function(_0x148da3){var _0x3a93b1={};_0x3a93b1[_0x148da3]={'$like':'%'+_0x36479e[_0x8897('0x32')][_0x8897('0x5c')]+'%'};return _0x3a93b1;})});}_0x4e4de3=_[_0x8897('0x3d')]({},_0x4e4de3,_0x36479e['options']);return db[_0x8897('0x63')][_0x8897('0x3f')]({'where':_0x4e4de3[_0x8897('0x3b')]})[_0x8897('0x23')](function(_0x4dd361){_0x5707ab[_0x8897('0x3f')]=_0x4dd361;if(_0x36479e[_0x8897('0x32')][_0x8897('0x40')]){_0x4e4de3[_0x8897('0x41')]=[{'all':!![]}];}return db[_0x8897('0x63')][_0x8897('0x42')](_0x4e4de3);})[_0x8897('0x23')](function(_0x3e84ef){_0x5707ab['rows']=_0x3e84ef;return _0x5707ab;});}})['then'](respondWithFilteredResult(_0x465cd2,_0x4e4de3))[_0x8897('0x44')](handleError(_0x465cd2,null));};exports[_0x8897('0x64')]=function(_0x5b3b3c,_0x7cf32f,_0x525591){var _0x138a2c={};var _0x1bf8f4={};var _0x543dfc;var _0x3ed31e;return db[_0x8897('0x2d')][_0x8897('0x5e')]({'where':{'id':_0x5b3b3c[_0x8897('0x46')]['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x7cf32f,null))[_0x8897('0x23')](function(_0x1b4c25){if(_0x1b4c25){_0x543dfc=_0x1b4c25;_0x1bf8f4['model']=_[_0x8897('0x33')](db[_0x8897('0x65')]['rawAttributes']);_0x1bf8f4[_0x8897('0x32')]=_[_0x8897('0x33')](_0x5b3b3c[_0x8897('0x32')]);_0x1bf8f4[_0x8897('0x3c')]=_[_0x8897('0x34')](_0x1bf8f4[_0x8897('0x31')],_0x1bf8f4['query']);_0x138a2c[_0x8897('0x35')]=_[_0x8897('0x34')](_0x1bf8f4[_0x8897('0x31')],qs['fields'](_0x5b3b3c[_0x8897('0x32')][_0x8897('0x36')]));_0x138a2c[_0x8897('0x35')]=_0x138a2c[_0x8897('0x35')]['length']?_0x138a2c['attributes']:_0x1bf8f4[_0x8897('0x31')];_0x138a2c[_0x8897('0x39')]=qs[_0x8897('0x3a')](_0x5b3b3c['query']['sort']);_0x138a2c[_0x8897('0x3b')]=qs['filters'](_['pick'](_0x5b3b3c[_0x8897('0x32')],_0x1bf8f4[_0x8897('0x3c')]));if(_0x5b3b3c[_0x8897('0x32')]['filter']){_0x138a2c[_0x8897('0x3b')]=_[_0x8897('0x3d')](_0x138a2c[_0x8897('0x3b')],{'$or':_[_0x8897('0x2c')](_0x138a2c[_0x8897('0x35')],function(_0x2d4008){var _0x55b014={};_0x55b014[_0x2d4008]={'$like':'%'+_0x5b3b3c[_0x8897('0x32')]['filter']+'%'};return _0x55b014;})});}_0x138a2c=_[_0x8897('0x3d')]({},_0x138a2c,_0x5b3b3c[_0x8897('0x48')]);return _0x543dfc[_0x8897('0x64')](_0x138a2c);}})[_0x8897('0x23')](function(_0x499d83){if(_0x499d83){_0x3ed31e=_0x499d83[_0x8897('0x37')];if(!_0x5b3b3c[_0x8897('0x32')]['hasOwnProperty'](_0x8897('0x38'))){_0x138a2c[_0x8897('0x1c')]=qs[_0x8897('0x1c')](_0x5b3b3c['query']['limit']);_0x138a2c[_0x8897('0x1a')]=qs[_0x8897('0x1a')](_0x5b3b3c[_0x8897('0x32')][_0x8897('0x1a')]);}return _0x543dfc[_0x8897('0x64')](_0x138a2c);}})[_0x8897('0x23')](function(_0x441d9e){if(_0x441d9e){return _0x441d9e?{'count':_0x3ed31e,'rows':_0x441d9e}:null;}})[_0x8897('0x23')](respondWithResult(_0x7cf32f,null))['catch'](handleError(_0x7cf32f,null));};exports['addLists']=function(_0x40b13f,_0x4d9c0b,_0x1027b6){var _0x277c68,_0x2db80f;var _0x2f708f=[];var _0x1b7c82=moment()[_0x8897('0x66')](_0x8897('0x67'));return db['Campaign']['find']({'where':{'id':_0x40b13f[_0x8897('0x46')]['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x4d9c0b,null))[_0x8897('0x23')](function(_0x2866f9){if(_0x2866f9){_0x2db80f=_0x2866f9;return _0x2866f9['addLists'](_0x40b13f[_0x8897('0x55')]['ids'],_[_0x8897('0x53')](_0x40b13f[_0x8897('0x55')],['ids','id'])||{});}return null;})[_0x8897('0x68')](function(_0x903564){var _0x23c25b;var _0xed6491;_0x277c68=_0x903564||[];var _0x87f7aa=[];if(_0x903564){for(var _0x31eae5=0x0;_0x31eae5<_0x903564[_0x8897('0x37')];_0x31eae5+=0x1){var _0x49b892=_0x903564[_0x31eae5][_0x8897('0x25')]({'plain':!![]});_0x2db80f['dialCheckDuplicateType']=_0x40b13f[_0x8897('0x55')][_0x8897('0x69')]?_0x40b13f['body'][_0x8897('0x69')]:_0x2db80f[_0x8897('0x69')];switch(_0x2db80f[_0x8897('0x69')]){case _0x8897('0x6a'):_0x23c25b=squel['insert']()[_0x8897('0x6b')]('cm_hopper')[_0x8897('0x6c')]([_0x8897('0x6d'),'scheduledAt',_0x8897('0x6e'),_0x8897('0x6f'),_0x8897('0x5b'),_0x8897('0x54'),_0x8897('0x56')],squel['select']()[_0x8897('0x70')](_0x8897('0x6d'),_0x8897('0x6d'))[_0x8897('0x70')](_0x8897('0x71'),_0x8897('0x72'))[_0x8897('0x70')]('id',_0x8897('0x6e'))[_0x8897('0x70')](_0x49b892[_0x8897('0x73')][_0x8897('0x74')](),_0x8897('0x6f'))['field'](_0x40b13f[_0x8897('0x46')]['id'][_0x8897('0x74')](),_0x8897('0x5b'))['field']('\x27'+_0x1b7c82+'\x27',_0x8897('0x54'))[_0x8897('0x70')]('\x27'+_0x1b7c82+'\x27',_0x8897('0x56'))[_0x8897('0x75')](_0x8897('0x76'))[_0x8897('0x3b')](_0x8897('0x77'))[_0x8897('0x3b')]('ListId\x20=\x20?',_0x49b892[_0x8897('0x73')][_0x8897('0x74')]())[_0x8897('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0x8897('0x3b')](_0x8897('0x78'),squel[_0x8897('0x79')]()[_0x8897('0x70')](_0x8897('0x7a'))[_0x8897('0x75')](_0x8897('0x7b'))[_0x8897('0x3b')](_0x8897('0x7c'),_0x40b13f[_0x8897('0x46')]['id'][_0x8897('0x74')]()))[_0x8897('0x3b')](_0x8897('0x78'),squel[_0x8897('0x79')]()[_0x8897('0x70')](_0x8897('0x7d'))['from']('cm_hopper')[_0x8897('0x3b')](_0x8897('0x7c'),_0x40b13f['params']['id'][_0x8897('0x74')]())))['toString']();break;case _0x8897('0x7e'):_0x23c25b=squel[_0x8897('0x7f')]()[_0x8897('0x6b')](_0x8897('0x80'))[_0x8897('0x6c')]([_0x8897('0x6d'),'scheduledAt','ContactId','ListId',_0x8897('0x5b'),_0x8897('0x54'),'updatedAt'],squel[_0x8897('0x79')]()[_0x8897('0x70')]('phone',_0x8897('0x6d'))[_0x8897('0x70')](_0x8897('0x71'),'scheduledAt')['field']('id',_0x8897('0x6e'))['field'](_0x49b892[_0x8897('0x73')]['toString'](),'ListId')['field'](_0x40b13f['params']['id'][_0x8897('0x74')](),_0x8897('0x5b'))[_0x8897('0x70')]('\x27'+_0x1b7c82+'\x27',_0x8897('0x54'))[_0x8897('0x70')]('\x27'+_0x1b7c82+'\x27','updatedAt')[_0x8897('0x75')](_0x8897('0x76'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x8897('0x81'),_0x49b892[_0x8897('0x73')][_0x8897('0x74')]())['where'](_0x8897('0x82'))[_0x8897('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x8897('0x79')]()[_0x8897('0x70')]('COALESCE(phone,\x27\x27)')[_0x8897('0x75')](_0x8897('0x80'))[_0x8897('0x3b')](_0x8897('0x7c'),_0x40b13f[_0x8897('0x46')]['id'][_0x8897('0x74')]())))[_0x8897('0x74')]();break;default:_0x23c25b=squel[_0x8897('0x7f')]()[_0x8897('0x6b')]('cm_hopper')[_0x8897('0x6c')](['phone',_0x8897('0x72'),_0x8897('0x6e'),'ListId',_0x8897('0x5b'),'createdAt',_0x8897('0x56')],squel[_0x8897('0x79')]()[_0x8897('0x70')](_0x8897('0x6d'),_0x8897('0x6d'))[_0x8897('0x70')]('NOW()',_0x8897('0x72'))['field']('id',_0x8897('0x6e'))['field'](_0x49b892['CmListId']['toString'](),'ListId')[_0x8897('0x70')](_0x40b13f[_0x8897('0x46')]['id']['toString'](),_0x8897('0x5b'))[_0x8897('0x70')]('\x27'+_0x1b7c82+'\x27',_0x8897('0x54'))[_0x8897('0x70')]('\x27'+_0x1b7c82+'\x27',_0x8897('0x56'))[_0x8897('0x75')](_0x8897('0x76'))[_0x8897('0x3b')](_0x8897('0x77'))[_0x8897('0x3b')](_0x8897('0x81'),_0x49b892[_0x8897('0x73')]['toString']())[_0x8897('0x3b')](_0x8897('0x82')))['toString']();}_0xed6491=squel[_0x8897('0x7f')]()['into'](_0x8897('0x83'))[_0x8897('0x6c')](['cmHopperId',_0x8897('0x72'),'phone','OrderBy',_0x8897('0x54'),_0x8897('0x56')],squel['select']()[_0x8897('0x70')](_0x8897('0x84'),'id')[_0x8897('0x70')](_0x8897('0x71'),_0x8897('0x72'))['field'](_0x8897('0x85'),_0x8897('0x6d'))['field'](_0x8897('0x86'),_0x8897('0x87'))[_0x8897('0x70')]('\x27'+_0x1b7c82+'\x27',_0x8897('0x54'))[_0x8897('0x70')]('\x27'+_0x1b7c82+'\x27',_0x8897('0x56'))[_0x8897('0x75')](_0x8897('0x88'),'ci')[_0x8897('0x89')](_0x8897('0x80'),'h',_0x8897('0x8a'))[_0x8897('0x3b')]('h.ListId\x20=\x20?',_0x49b892['CmListId']['toString']())[_0x8897('0x3b')](_0x8897('0x8b'),_0x40b13f[_0x8897('0x46')]['id'][_0x8897('0x74')]())[_0x8897('0x3b')](_0x8897('0x8c'),_0x1b7c82))[_0x8897('0x74')]();_0x87f7aa[_0x8897('0x8d')](db[_0x8897('0x8e')][_0x8897('0x32')](_0x23c25b));_0x2f708f[_0x8897('0x8d')](db[_0x8897('0x8e')][_0x8897('0x32')](_0xed6491));}return BPromise['all'](_0x87f7aa);}})['then'](function(){return BPromise[_0x8897('0x8f')](_0x2f708f);})[_0x8897('0x23')](function(){return _0x277c68;})['then'](respondWithResult(_0x4d9c0b,null))[_0x8897('0x44')](handleError(_0x4d9c0b,null));};exports[_0x8897('0x90')]=function(_0x29bff6,_0x1783fa,_0x3ce812){return db[_0x8897('0x2d')][_0x8897('0x49')]({'where':{'id':_0x29bff6['params']['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x1783fa,null))['then'](function(_0x6076b8){if(_0x6076b8){return _0x6076b8[_0x8897('0x90')](_0x29bff6[_0x8897('0x32')][_0x8897('0x91')]);}})[_0x8897('0x23')](function(_0x14524c){if(_0x14524c){return db[_0x8897('0x59')]['destroy']({'where':{'ListId':_0x29bff6[_0x8897('0x32')]['ids'],'CampaignId':_0x29bff6[_0x8897('0x46')]['id']}})[_0x8897('0x23')](function(){return _0x14524c;});}})[_0x8897('0x23')](respondWithStatusCode(_0x1783fa,null))[_0x8897('0x44')](handleError(_0x1783fa,null));};exports[_0x8897('0x92')]=function(_0x55437c,_0x459d1a,_0xab977e){var _0x357b06={};var _0x4256ee={};var _0x55b845;var _0x22a5e9;return db[_0x8897('0x2d')]['findOne']({'where':{'id':_0x55437c[_0x8897('0x46')]['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x459d1a,null))[_0x8897('0x23')](function(_0x87634){if(_0x87634){_0x55b845=_0x87634;_0x4256ee[_0x8897('0x31')]=_[_0x8897('0x33')](db['CmList'][_0x8897('0x47')]);_0x4256ee[_0x8897('0x32')]=_[_0x8897('0x33')](_0x55437c[_0x8897('0x32')]);_0x4256ee[_0x8897('0x3c')]=_[_0x8897('0x34')](_0x4256ee[_0x8897('0x31')],_0x4256ee['query']);_0x357b06[_0x8897('0x35')]=_['intersection'](_0x4256ee[_0x8897('0x31')],qs['fields'](_0x55437c[_0x8897('0x32')][_0x8897('0x36')]));_0x357b06[_0x8897('0x35')]=_0x357b06['attributes'][_0x8897('0x37')]?_0x357b06['attributes']:_0x4256ee['model'];_0x357b06[_0x8897('0x39')]=qs[_0x8897('0x3a')](_0x55437c['query'][_0x8897('0x3a')]);_0x357b06[_0x8897('0x3b')]=qs[_0x8897('0x3c')](_['pick'](_0x55437c[_0x8897('0x32')],_0x4256ee[_0x8897('0x3c')]));if(_0x55437c[_0x8897('0x32')][_0x8897('0x5c')]){_0x357b06[_0x8897('0x3b')]=_[_0x8897('0x3d')](_0x357b06[_0x8897('0x3b')],{'$or':_[_0x8897('0x2c')](_0x357b06['attributes'],function(_0x51bd6d){var _0xccef7f={};_0xccef7f[_0x51bd6d]={'$like':'%'+_0x55437c[_0x8897('0x32')][_0x8897('0x5c')]+'%'};return _0xccef7f;})});}_0x357b06=_[_0x8897('0x3d')]({},_0x357b06,_0x55437c[_0x8897('0x48')]);return _0x55b845[_0x8897('0x92')](_0x357b06);}})['then'](function(_0x586c72){if(_0x586c72){_0x22a5e9=_0x586c72[_0x8897('0x37')];if(!_0x55437c[_0x8897('0x32')]['hasOwnProperty'](_0x8897('0x38'))){_0x357b06['limit']=qs[_0x8897('0x1c')](_0x55437c[_0x8897('0x32')][_0x8897('0x1c')]);_0x357b06[_0x8897('0x1a')]=qs['offset'](_0x55437c[_0x8897('0x32')]['offset']);}return _0x55b845[_0x8897('0x92')](_0x357b06);}})[_0x8897('0x23')](function(_0x12d801){if(_0x12d801){return _0x12d801?{'count':_0x22a5e9,'rows':_0x12d801}:null;}})[_0x8897('0x23')](respondWithResult(_0x459d1a,null))['catch'](handleError(_0x459d1a,null));};exports[_0x8897('0x93')]=function(_0x35ac01,_0x84b127,_0x5e2c9a){var _0x1020d4,_0x20cc7d;var _0x581507=[];var _0x55aef4=moment()['format'](_0x8897('0x67'));return db[_0x8897('0x2d')][_0x8897('0x49')]({'where':{'id':_0x35ac01['params']['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x84b127,null))[_0x8897('0x23')](function(_0x4a3e8d){if(_0x4a3e8d){_0x20cc7d=_0x4a3e8d;return _0x4a3e8d[_0x8897('0x93')](_0x35ac01[_0x8897('0x55')][_0x8897('0x91')],_[_0x8897('0x53')](_0x35ac01[_0x8897('0x55')],[_0x8897('0x91'),'id'])||{});}return null;})[_0x8897('0x68')](function(_0x5126f0){var _0x1e67f4;var _0x5ecabc;_0x1020d4=_0x5126f0||[];var _0x429f7f=[];if(_0x5126f0){for(var _0x21d0bc=0x0;_0x21d0bc<_0x5126f0['length'];_0x21d0bc+=0x1){var _0x269f6a=_0x5126f0[_0x21d0bc][_0x8897('0x25')]({'plain':!![]});_0x1e67f4=squel[_0x8897('0x7f')]()[_0x8897('0x6b')](_0x8897('0x94'))['fromQuery']([_0x8897('0x6d'),_0x8897('0x6e'),_0x8897('0x6f'),_0x8897('0x5b'),'createdAt',_0x8897('0x56')],squel[_0x8897('0x79')]()['field'](_0x8897('0x6d'),_0x8897('0x6d'))[_0x8897('0x70')]('id',_0x8897('0x6e'))['field'](_0x269f6a[_0x8897('0x73')][_0x8897('0x74')](),_0x8897('0x6f'))[_0x8897('0x70')](_0x35ac01[_0x8897('0x46')]['id'][_0x8897('0x74')](),'CampaignId')['field'](_0x8897('0x71'),_0x8897('0x54'))[_0x8897('0x70')]('NOW()',_0x8897('0x56'))[_0x8897('0x75')](_0x8897('0x76'))[_0x8897('0x3b')](_0x8897('0x77'))[_0x8897('0x3b')]('ListId\x20=\x20?',_0x269f6a['CmListId'][_0x8897('0x74')]())[_0x8897('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0x8897('0x74')]();_0x429f7f[_0x8897('0x8d')](db[_0x8897('0x8e')][_0x8897('0x32')](_0x1e67f4));}return BPromise['all'](_0x429f7f);}})[_0x8897('0x23')](function(){return _0x1020d4;})['then'](respondWithResult(_0x84b127,null))[_0x8897('0x44')](handleError(_0x84b127,null));};exports[_0x8897('0x95')]=function(_0xa56a56,_0x108364,_0x3bf4f7){return db[_0x8897('0x2d')][_0x8897('0x49')]({'where':{'id':_0xa56a56['params']['id']}})[_0x8897('0x23')](handleEntityNotFound(_0x108364,null))[_0x8897('0x23')](function(_0x47e67b){if(_0x47e67b){return _0x47e67b[_0x8897('0x95')](_0xa56a56[_0x8897('0x32')][_0x8897('0x91')]);}})['then'](function(_0xdf5b91){if(_0xdf5b91){return db[_0x8897('0x63')][_0x8897('0x24')]({'where':{'ListId':_0xa56a56[_0x8897('0x32')][_0x8897('0x91')],'CampaignId':_0xa56a56[_0x8897('0x46')]['id']}})['then'](function(){return _0xdf5b91;});}})['then'](respondWithStatusCode(_0x108364,null))[_0x8897('0x44')](handleError(_0x108364,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index e1113f5..f4df359 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(_0x32060c,_0x391258){var _0x360b95=function(_0x22ec5d){while(--_0x22ec5d){_0x32060c['push'](_0x32060c['shift']());}};_0x360b95(++_0x391258);}(_0x7a54,0x106));var _0x47a5=function(_0x57e824,_0x3106ef){_0x57e824=_0x57e824-0x0;var _0x153dd9=_0x7a54[_0x57e824];return _0x153dd9;};'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(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 44dbda4..3d977be 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 _0xdeb7=['message','result','catch','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','GetCampaign','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s'];(function(_0x4f3ba7,_0x35a3f9){var _0x51d980=function(_0x2a51ed){while(--_0x2a51ed){_0x4f3ba7['push'](_0x4f3ba7['shift']());}};_0x51d980(++_0x35a3f9);}(_0xdeb7,0x77));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x7deb('0x0'));var util=require(_0x7deb('0x1'));var moment=require(_0x7deb('0x2'));var BPromise=require('bluebird');var rs=require(_0x7deb('0x3'));var fs=require('fs');var Redis=require(_0x7deb('0x4'));var db=require(_0x7deb('0x5'))['db'];var utils=require(_0x7deb('0x6'));var logger=require(_0x7deb('0x7'))('rpc');var config=require(_0x7deb('0x8'));var jayson=require(_0x7deb('0x9'));var client=jayson[_0x7deb('0xa')][_0x7deb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d4de9,_0x1a5058,_0x4e3d14){return new BPromise(function(_0xfa72b7,_0x366e44){return client[_0x7deb('0xc')](_0x1d4de9,_0x4e3d14)[_0x7deb('0xd')](function(_0x5bdde4){logger[_0x7deb('0xe')]('Campaign,\x20%s,\x20%s',_0x1a5058,'request\x20sent');logger[_0x7deb('0xf')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1a5058,_0x7deb('0x10'),JSON[_0x7deb('0x11')](_0x5bdde4));if(_0x5bdde4[_0x7deb('0x12')]){if(_0x5bdde4['error'][_0x7deb('0x13')]===0x1f4){logger[_0x7deb('0x12')](_0x7deb('0x14'),_0x1a5058,_0x5bdde4[_0x7deb('0x12')]['message']);return _0x366e44(_0x5bdde4[_0x7deb('0x12')][_0x7deb('0x15')]);}logger[_0x7deb('0x12')](_0x7deb('0x14'),_0x1a5058,_0x5bdde4[_0x7deb('0x12')][_0x7deb('0x15')]);return _0xfa72b7(_0x5bdde4[_0x7deb('0x12')][_0x7deb('0x15')]);}else{logger[_0x7deb('0xe')](_0x7deb('0x14'),_0x1a5058,_0x7deb('0x10'));_0xfa72b7(_0x5bdde4[_0x7deb('0x16')][_0x7deb('0x15')]);}})[_0x7deb('0x17')](function(_0xbe8e2a){logger['error'](_0x7deb('0x14'),_0x1a5058,_0xbe8e2a);_0x366e44(_0xbe8e2a);});});}exports['GetCampaign']=function(_0x2241a3){var _0xbd6ea8=this;return new Promise(function(_0x5439ac,_0x2ad65a){return db[_0x7deb('0x18')][_0x7deb('0x19')]({'raw':_0x2241a3[_0x7deb('0x1a')]?_0x2241a3[_0x7deb('0x1a')][_0x7deb('0x1b')]===undefined?!![]:![]:!![],'where':_0x2241a3[_0x7deb('0x1a')]?_0x2241a3[_0x7deb('0x1a')][_0x7deb('0x1c')]||null:null,'attributes':_0x2241a3['options']?_0x2241a3[_0x7deb('0x1a')][_0x7deb('0x1d')]||null:null,'limit':_0x2241a3[_0x7deb('0x1a')]?_0x2241a3[_0x7deb('0x1a')][_0x7deb('0x1e')]||null:null,'include':_0x2241a3[_0x7deb('0x1a')]?_0x2241a3[_0x7deb('0x1a')][_0x7deb('0x1f')]?_['map'](_0x2241a3[_0x7deb('0x1a')][_0x7deb('0x1f')],function(_0x2cb976){return{'model':db[_0x2cb976['model']],'as':_0x2cb976['as'],'attributes':_0x2cb976[_0x7deb('0x1d')],'include':_0x2cb976[_0x7deb('0x1f')]?_[_0x7deb('0x20')](_0x2cb976[_0x7deb('0x1f')],function(_0x5e2258){return{'model':db[_0x5e2258[_0x7deb('0x21')]],'as':_0x5e2258['as'],'attributes':_0x5e2258[_0x7deb('0x1d')],'include':_0x5e2258[_0x7deb('0x1f')]?_[_0x7deb('0x20')](_0x5e2258[_0x7deb('0x1f')],function(_0x1e9806){return{'model':db[_0x1e9806[_0x7deb('0x21')]],'as':_0x1e9806['as'],'attributes':_0x1e9806[_0x7deb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7deb('0xd')](function(_0x28f884){logger[_0x7deb('0xe')](_0x7deb('0x22'),_0x2241a3);logger[_0x7deb('0xf')](_0x7deb('0x22'),_0x2241a3,JSON['stringify'](_0x28f884));_0x5439ac(_0x28f884);})[_0x7deb('0x17')](function(_0x50ce4b){logger[_0x7deb('0x12')]('GetCampaign',_0x50ce4b[_0x7deb('0x15')],_0x2241a3);_0x2ad65a(_0xbd6ea8[_0x7deb('0x12')](0x1f4,_0x50ce4b['message']));});});}; \ No newline at end of file +var _0x136c=['include','map','model','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCampaign','Campaign','options','raw','where','attributes','limit'];(function(_0x54f609,_0x50b70d){var _0x13522e=function(_0x27546c){while(--_0x27546c){_0x54f609['push'](_0x54f609['shift']());}};_0x13522e(++_0x50b70d);}(_0x136c,0x1d2));var _0xc136=function(_0x7b203c,_0x4db126){_0x7b203c=_0x7b203c-0x0;var _0x26098b=_0x136c[_0x7b203c];return _0x26098b;};'use strict';var _=require(_0xc136('0x0'));var util=require(_0xc136('0x1'));var moment=require('moment');var BPromise=require(_0xc136('0x2'));var rs=require(_0xc136('0x3'));var fs=require('fs');var Redis=require(_0xc136('0x4'));var db=require(_0xc136('0x5'))['db'];var utils=require(_0xc136('0x6'));var logger=require(_0xc136('0x7'))(_0xc136('0x8'));var config=require(_0xc136('0x9'));var jayson=require(_0xc136('0xa'));var client=jayson['client'][_0xc136('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x594112,_0x361a52,_0x3993f2){return new BPromise(function(_0x1804c1,_0x500376){return client[_0xc136('0xc')](_0x594112,_0x3993f2)['then'](function(_0x1ea07d){logger[_0xc136('0xd')](_0xc136('0xe'),_0x361a52,_0xc136('0xf'));logger[_0xc136('0x10')](_0xc136('0x11'),_0x361a52,_0xc136('0xf'),JSON[_0xc136('0x12')](_0x1ea07d));if(_0x1ea07d[_0xc136('0x13')]){if(_0x1ea07d['error']['code']===0x1f4){logger[_0xc136('0x13')]('Campaign,\x20%s,\x20%s',_0x361a52,_0x1ea07d[_0xc136('0x13')][_0xc136('0x14')]);return _0x500376(_0x1ea07d[_0xc136('0x13')]['message']);}logger['error'](_0xc136('0xe'),_0x361a52,_0x1ea07d[_0xc136('0x13')][_0xc136('0x14')]);return _0x1804c1(_0x1ea07d['error']['message']);}else{logger[_0xc136('0xd')](_0xc136('0xe'),_0x361a52,'request\x20sent');_0x1804c1(_0x1ea07d['result']['message']);}})[_0xc136('0x15')](function(_0x3daf55){logger[_0xc136('0x13')](_0xc136('0xe'),_0x361a52,_0x3daf55);_0x500376(_0x3daf55);});});}exports[_0xc136('0x16')]=function(_0x1ccf5f){var _0x59503b=this;return new Promise(function(_0x5df9b7,_0x4d56cb){return db[_0xc136('0x17')]['findAll']({'raw':_0x1ccf5f[_0xc136('0x18')]?_0x1ccf5f[_0xc136('0x18')][_0xc136('0x19')]===undefined?!![]:![]:!![],'where':_0x1ccf5f[_0xc136('0x18')]?_0x1ccf5f['options'][_0xc136('0x1a')]||null:null,'attributes':_0x1ccf5f[_0xc136('0x18')]?_0x1ccf5f['options'][_0xc136('0x1b')]||null:null,'limit':_0x1ccf5f['options']?_0x1ccf5f['options'][_0xc136('0x1c')]||null:null,'include':_0x1ccf5f[_0xc136('0x18')]?_0x1ccf5f['options'][_0xc136('0x1d')]?_[_0xc136('0x1e')](_0x1ccf5f[_0xc136('0x18')][_0xc136('0x1d')],function(_0x5d8300){return{'model':db[_0x5d8300[_0xc136('0x1f')]],'as':_0x5d8300['as'],'attributes':_0x5d8300[_0xc136('0x1b')],'include':_0x5d8300['include']?_[_0xc136('0x1e')](_0x5d8300['include'],function(_0x21a163){return{'model':db[_0x21a163[_0xc136('0x1f')]],'as':_0x21a163['as'],'attributes':_0x21a163['attributes'],'include':_0x21a163['include']?_[_0xc136('0x1e')](_0x21a163[_0xc136('0x1d')],function(_0x549a60){return{'model':db[_0x549a60[_0xc136('0x1f')]],'as':_0x549a60['as'],'attributes':_0x549a60[_0xc136('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc136('0x20')](function(_0x2608b8){logger[_0xc136('0xd')](_0xc136('0x16'),_0x1ccf5f);logger[_0xc136('0x10')]('GetCampaign',_0x1ccf5f,JSON[_0xc136('0x12')](_0x2608b8));_0x5df9b7(_0x2608b8);})[_0xc136('0x15')](function(_0x1ad50f){logger[_0xc136('0x13')](_0xc136('0x16'),_0x1ad50f[_0xc136('0x14')],_0x1ccf5f);_0x4d56cb(_0x59503b[_0xc136('0x13')](0x1f4,_0x1ad50f[_0xc136('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index d4025b1..90f8e08 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 _0x7434=['/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','/:id/lists','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers'];(function(_0x20478c,_0x48c77d){var _0x3aa85b=function(_0x21a2fd){while(--_0x21a2fd){_0x20478c['push'](_0x20478c['shift']());}};_0x3aa85b(++_0x48c77d);}(_0x7434,0x195));var _0x4743=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7434[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x4743('0x0'));var util=require('util');var path=require(_0x4743('0x1'));var timeout=require(_0x4743('0x2'));var express=require(_0x4743('0x3'));var router=express['Router']();var fs_extra=require(_0x4743('0x4'));var auth=require(_0x4743('0x5'));var interaction=require(_0x4743('0x6'));var config=require(_0x4743('0x7'));var controller=require(_0x4743('0x8'));router['get']('/',auth[_0x4743('0x9')](),controller[_0x4743('0xa')]);router[_0x4743('0xb')](_0x4743('0xc'),auth[_0x4743('0x9')](),controller[_0x4743('0xd')]);router[_0x4743('0xb')](_0x4743('0xe'),auth[_0x4743('0x9')](),controller['getHoppers']);router[_0x4743('0xb')](_0x4743('0xf'),auth[_0x4743('0x9')](),controller[_0x4743('0x10')]);router[_0x4743('0xb')](_0x4743('0x11'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x4743('0xb')](_0x4743('0x12'),auth['isAuthenticated'](),controller[_0x4743('0x13')]);router['get']('/:id/lists',auth[_0x4743('0x9')](),controller[_0x4743('0x14')]);router[_0x4743('0xb')](_0x4743('0x15'),auth[_0x4743('0x9')](),controller[_0x4743('0x16')]);router[_0x4743('0x17')]('/',auth[_0x4743('0x9')](),controller[_0x4743('0x18')]);router[_0x4743('0x17')](_0x4743('0x19'),auth[_0x4743('0x9')](),controller['clone']);router[_0x4743('0x17')](_0x4743('0x1a'),auth['isAuthenticated'](),controller[_0x4743('0x1b')]);router[_0x4743('0x17')]('/:id/blacklists',auth[_0x4743('0x9')](),controller[_0x4743('0x1c')]);router[_0x4743('0x1d')]('/:id',auth[_0x4743('0x9')](),controller['update']);router[_0x4743('0x1e')](_0x4743('0xc'),auth[_0x4743('0x9')](),controller[_0x4743('0x1f')]);router[_0x4743('0x1e')](_0x4743('0x1a'),auth[_0x4743('0x9')](),controller[_0x4743('0x20')]);router[_0x4743('0x1e')](_0x4743('0x15'),auth[_0x4743('0x9')](),controller[_0x4743('0x21')]);module[_0x4743('0x22')]=router; \ No newline at end of file +var _0xa884=['/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','create','post','clone','addLists','addBlackLists','put','update','/:id/lists','removeLists','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show'];(function(_0x33d8a9,_0x4d0f1a){var _0x19894c=function(_0x591b78){while(--_0x591b78){_0x33d8a9['push'](_0x33d8a9['shift']());}};_0x19894c(++_0x4d0f1a);}(_0xa884,0x15a));var _0x4a88=function(_0x32c012,_0xe3c576){_0x32c012=_0x32c012-0x0;var _0x48562e=_0xa884[_0x32c012];return _0x48562e;};'use strict';var multer=require(_0x4a88('0x0'));var util=require(_0x4a88('0x1'));var path=require(_0x4a88('0x2'));var timeout=require('connect-timeout');var express=require(_0x4a88('0x3'));var router=express[_0x4a88('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4a88('0x5'));var interaction=require(_0x4a88('0x6'));var config=require(_0x4a88('0x7'));var controller=require(_0x4a88('0x8'));router[_0x4a88('0x9')]('/',auth['isAuthenticated'](),controller[_0x4a88('0xa')]);router['get'](_0x4a88('0xb'),auth[_0x4a88('0xc')](),controller[_0x4a88('0xd')]);router[_0x4a88('0x9')](_0x4a88('0xe'),auth['isAuthenticated'](),controller[_0x4a88('0xf')]);router['get'](_0x4a88('0x10'),auth[_0x4a88('0xc')](),controller[_0x4a88('0x11')]);router[_0x4a88('0x9')](_0x4a88('0x12'),auth['isAuthenticated'](),controller[_0x4a88('0x13')]);router[_0x4a88('0x9')](_0x4a88('0x14'),auth[_0x4a88('0xc')](),controller[_0x4a88('0x15')]);router[_0x4a88('0x9')]('/:id/lists',auth[_0x4a88('0xc')](),controller[_0x4a88('0x16')]);router[_0x4a88('0x9')](_0x4a88('0x17'),auth[_0x4a88('0xc')](),controller[_0x4a88('0x18')]);router['post']('/',auth[_0x4a88('0xc')](),controller[_0x4a88('0x19')]);router[_0x4a88('0x1a')]('/:id/clone',auth[_0x4a88('0xc')](),controller[_0x4a88('0x1b')]);router[_0x4a88('0x1a')]('/:id/lists',auth['isAuthenticated'](),controller[_0x4a88('0x1c')]);router[_0x4a88('0x1a')]('/:id/blacklists',auth[_0x4a88('0xc')](),controller[_0x4a88('0x1d')]);router[_0x4a88('0x1e')]('/:id',auth[_0x4a88('0xc')](),controller[_0x4a88('0x1f')]);router['delete']('/:id',auth[_0x4a88('0xc')](),controller['destroy']);router['delete'](_0x4a88('0x20'),auth[_0x4a88('0xc')](),controller[_0x4a88('0x21')]);router[_0x4a88('0x22')](_0x4a88('0x17'),auth[_0x4a88('0xc')](),controller['removeBlackLists']);module[_0x4a88('0x23')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 6a1a731..f0c8327 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 _0x4e17=['getDataValue','key','sequelize','exports','STRING','medium'];(function(_0x42a73a,_0x144528){var _0x185267=function(_0x1eaaa1){while(--_0x1eaaa1){_0x42a73a['push'](_0x42a73a['shift']());}};_0x185267(++_0x144528);}(_0x4e17,0xe6));var _0x74e1=function(_0x480453,_0x26d53a){_0x480453=_0x480453-0x0;var _0xa86a34=_0x4e17[_0x480453];return _0xa86a34;};'use strict';var Sequelize=require(_0x74e1('0x0'));module[_0x74e1('0x1')]={'key':{'type':Sequelize[_0x74e1('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0x74e1('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x74e1('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x74e1('0x4')](_0x74e1('0x5'));}}}; \ No newline at end of file +var _0xb9f7=['key','sequelize','STRING','TEXT','medium','VIRTUAL','getDataValue'];(function(_0x3909ae,_0x3183c7){var _0x15000b=function(_0x591ff5){while(--_0x591ff5){_0x3909ae['push'](_0x3909ae['shift']());}};_0x15000b(++_0x3183c7);}(_0xb9f7,0xf6));var _0x7b9f=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xb9f7[_0x125ff8];return _0x2d9ef;};'use strict';var Sequelize=require(_0x7b9f('0x0'));module['exports']={'key':{'type':Sequelize[_0x7b9f('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x7b9f('0x2')],'length':_0x7b9f('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x7b9f('0x1')]},'name':{'type':Sequelize[_0x7b9f('0x4')],'get':function(){return this[_0x7b9f('0x5')](_0x7b9f('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 1c2df00..291896a 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 _0x46d9=['The\x20inserted\x20key\x20already\x20exists.','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','reject','update','then','destroy','get','UserProfileResource','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','sort','where','filter','merge','options','CannedAnswer','includeAll','catch','params','keys','include','body','find','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize'];(function(_0x19b643,_0x37f62a){var _0x283773=function(_0x156050){while(--_0x156050){_0x19b643['push'](_0x19b643['shift']());}};_0x283773(++_0x37f62a);}(_0x46d9,0xfb));var _0x946d=function(_0x184c73,_0x4ba3db){_0x184c73=_0x184c73-0x0;var _0x1f4597=_0x46d9[_0x184c73];return _0x1f4597;};'use strict';var emlformat=require(_0x946d('0x0'));var rimraf=require(_0x946d('0x1'));var zipdir=require(_0x946d('0x2'));var jsonpatch=require(_0x946d('0x3'));var rp=require(_0x946d('0x4'));var moment=require(_0x946d('0x5'));var BPromise=require(_0x946d('0x6'));var Mustache=require(_0x946d('0x7'));var util=require(_0x946d('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x946d('0x9'));var fs=require('fs');var fs_extra=require(_0x946d('0xa'));var _=require(_0x946d('0xb'));var squel=require(_0x946d('0xc'));var crypto=require(_0x946d('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x946d('0xe'));var Papa=require(_0x946d('0xf'));var Redis=require(_0x946d('0x10'));var authService=require(_0x946d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x946d('0x12'));var logger=require(_0x946d('0x13'))(_0x946d('0x14'));var utils=require(_0x946d('0x15'));var config=require(_0x946d('0x16'));var licenseUtil=require(_0x946d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e03ff,_0x127251){_0x127251=_0x127251||0xcc;return function(_0x3eb5f0){if(_0x3eb5f0){return _0x2e03ff[_0x946d('0x18')](_0x127251);}return _0x2e03ff['status'](_0x127251)[_0x946d('0x19')]();};}function respondWithResult(_0x12f7f9,_0x173347){_0x173347=_0x173347||0xc8;return function(_0x4155e1){if(_0x4155e1){return _0x12f7f9[_0x946d('0x1a')](_0x173347)['json'](_0x4155e1);}};}function respondWithFilteredResult(_0x100906,_0x3c50d0){return function(_0x21842d){if(_0x21842d){var _0x5dd0fd=typeof _0x3c50d0['offset']===_0x946d('0x1b')&&typeof _0x3c50d0[_0x946d('0x1c')]==='undefined';var _0x35c699=_0x21842d[_0x946d('0x1d')];var _0x3b96f8=_0x5dd0fd?0x0:_0x3c50d0['offset'];var _0x3d272b=_0x5dd0fd?_0x21842d[_0x946d('0x1d')]:_0x3c50d0[_0x946d('0x1e')]+_0x3c50d0[_0x946d('0x1c')];var _0xe2acf0;if(_0x3d272b>=_0x35c699){_0x3d272b=_0x35c699;_0xe2acf0=0xc8;}else{_0xe2acf0=0xce;}_0x100906['status'](_0xe2acf0);return _0x100906[_0x946d('0x1f')](_0x946d('0x20'),_0x3b96f8+'-'+_0x3d272b+'/'+_0x35c699)[_0x946d('0x21')](_0x21842d);}return null;};}function patchUpdates(_0xae4fb1){return function(_0xf63a9d){try{jsonpatch['apply'](_0xf63a9d,_0xae4fb1,!![]);}catch(_0x369a83){return BPromise[_0x946d('0x22')](_0x369a83);}return _0xf63a9d['save']();};}function saveUpdates(_0x2077d5,_0x169185){return function(_0x5855de){if(_0x5855de){return _0x5855de[_0x946d('0x23')](_0x2077d5)[_0x946d('0x24')](function(_0x2ea353){return _0x2ea353;});}return null;};}function removeEntity(_0x39b57b,_0x5481b){return function(_0x249c40){if(_0x249c40){return _0x249c40[_0x946d('0x25')]()[_0x946d('0x24')](function(){var _0x448c58=_0x249c40[_0x946d('0x26')]({'plain':!![]});var _0x10458b='CannedAnswers';return db[_0x946d('0x27')]['destroy']({'where':{'type':_0x10458b,'resourceId':_0x448c58['id']}})[_0x946d('0x24')](function(){return _0x249c40;});})[_0x946d('0x24')](function(){_0x39b57b[_0x946d('0x1a')](0xcc)[_0x946d('0x19')]();});}};}function handleEntityNotFound(_0x28b927,_0x55698a){return function(_0x373c3f){if(!_0x373c3f){_0x28b927[_0x946d('0x18')](0x194);}return _0x373c3f;};}function handleError(_0x42c1c3,_0x507f93){_0x507f93=_0x507f93||0x1f4;return function(_0x2c7ba6){logger['error'](_0x2c7ba6['stack']);if(_0x2c7ba6[_0x946d('0x28')]){delete _0x2c7ba6[_0x946d('0x28')];}_0x42c1c3[_0x946d('0x1a')](_0x507f93)[_0x946d('0x29')](_0x2c7ba6);};}exports[_0x946d('0x2a')]=function(_0x200224,_0x4405c8){var _0x38ad44={},_0x211ed2={},_0x2f0289={'count':0x0,'rows':[]};var _0x4a32cf=_[_0x946d('0x2b')](db['CannedAnswer'][_0x946d('0x2c')],function(_0x40533f){return{'name':_0x40533f[_0x946d('0x2d')],'type':_0x40533f[_0x946d('0x2e')][_0x946d('0x2f')]};});_0x211ed2['model']=_[_0x946d('0x2b')](_0x4a32cf,_0x946d('0x28'));_0x211ed2[_0x946d('0x30')]=_['keys'](_0x200224[_0x946d('0x30')]);_0x211ed2[_0x946d('0x31')]=_[_0x946d('0x32')](_0x211ed2['model'],_0x211ed2[_0x946d('0x30')]);_0x38ad44['attributes']=_[_0x946d('0x32')](_0x211ed2[_0x946d('0x33')],qs[_0x946d('0x34')](_0x200224[_0x946d('0x30')]['fields']));_0x38ad44[_0x946d('0x35')]=_0x38ad44[_0x946d('0x35')][_0x946d('0x36')]?_0x38ad44['attributes']:_0x211ed2[_0x946d('0x33')];if(!_0x200224[_0x946d('0x30')]['hasOwnProperty']('nolimit')){_0x38ad44[_0x946d('0x1c')]=qs[_0x946d('0x1c')](_0x200224[_0x946d('0x30')][_0x946d('0x1c')]);_0x38ad44[_0x946d('0x1e')]=qs[_0x946d('0x1e')](_0x200224[_0x946d('0x30')]['offset']);}_0x38ad44['order']=qs[_0x946d('0x37')](_0x200224['query'][_0x946d('0x37')]);_0x38ad44[_0x946d('0x38')]=qs[_0x946d('0x31')](_['pick'](_0x200224[_0x946d('0x30')],_0x211ed2['filters']),_0x4a32cf);if(_0x200224[_0x946d('0x30')][_0x946d('0x39')]){_0x38ad44[_0x946d('0x38')]=_[_0x946d('0x3a')](_0x38ad44['where'],{'$or':[{'key':{'$like':'%'+_0x200224[_0x946d('0x30')][_0x946d('0x39')]+'%'}},{'value':{'$like':'%'+_0x200224[_0x946d('0x30')][_0x946d('0x39')]+'%'}}]});}_0x38ad44=_[_0x946d('0x3a')]({},_0x38ad44,_0x200224[_0x946d('0x3b')]);var _0x363095={'where':_0x38ad44['where']};return db[_0x946d('0x3c')]['count'](_0x363095)[_0x946d('0x24')](function(_0x156f91){_0x2f0289[_0x946d('0x1d')]=_0x156f91;if(_0x200224[_0x946d('0x30')][_0x946d('0x3d')]){_0x38ad44['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x38ad44);})['then'](function(_0x43ed11){_0x2f0289['rows']=_0x43ed11;return _0x2f0289;})['then'](respondWithFilteredResult(_0x4405c8,_0x38ad44))[_0x946d('0x3e')](handleError(_0x4405c8,null));};exports['show']=function(_0xee0f54,_0x597532){var _0x280d4b={'raw':!![],'where':{'id':_0xee0f54[_0x946d('0x3f')]['id']}},_0x3be266={};_0x3be266[_0x946d('0x33')]=_['keys'](db[_0x946d('0x3c')][_0x946d('0x2c')]);_0x3be266[_0x946d('0x30')]=_[_0x946d('0x40')](_0xee0f54['query']);_0x3be266[_0x946d('0x31')]=_[_0x946d('0x32')](_0x3be266[_0x946d('0x33')],_0x3be266[_0x946d('0x30')]);_0x280d4b['attributes']=_[_0x946d('0x32')](_0x3be266[_0x946d('0x33')],qs['fields'](_0xee0f54[_0x946d('0x30')][_0x946d('0x34')]));_0x280d4b[_0x946d('0x35')]=_0x280d4b[_0x946d('0x35')][_0x946d('0x36')]?_0x280d4b[_0x946d('0x35')]:_0x3be266[_0x946d('0x33')];if(_0xee0f54[_0x946d('0x30')]['includeAll']){_0x280d4b[_0x946d('0x41')]=[{'all':!![]}];}_0x280d4b=_['merge']({},_0x280d4b,_0xee0f54['options']);return db[_0x946d('0x3c')]['find'](_0x280d4b)[_0x946d('0x24')](handleEntityNotFound(_0x597532,null))[_0x946d('0x24')](respondWithResult(_0x597532,null))[_0x946d('0x3e')](handleError(_0x597532,null));};exports[_0x946d('0x23')]=function(_0x46406d,_0xfa0334){if(_0x46406d[_0x946d('0x42')]['id']){delete _0x46406d[_0x946d('0x42')]['id'];}return db[_0x946d('0x3c')]['find']({'where':{'id':_0x46406d['params']['id']}})[_0x946d('0x24')](handleEntityNotFound(_0xfa0334,null))['then'](saveUpdates(_0x46406d[_0x946d('0x42')],null))[_0x946d('0x24')](respondWithResult(_0xfa0334,null))[_0x946d('0x3e')](handleError(_0xfa0334,null));};exports[_0x946d('0x25')]=function(_0x5bfc86,_0x51593f){return db[_0x946d('0x3c')][_0x946d('0x43')]({'where':{'id':_0x5bfc86[_0x946d('0x3f')]['id']}})[_0x946d('0x24')](handleEntityNotFound(_0x51593f,null))[_0x946d('0x24')](removeEntity(_0x51593f,null))['catch'](handleError(_0x51593f,null));};exports['create']=function(_0x2c11f3,_0x4a9465){var _0x4c5fa2={'key':_0x2c11f3[_0x946d('0x42')][_0x946d('0x2f')]};if(_0x2c11f3[_0x946d('0x42')][_0x946d('0x44')]){_0x4c5fa2[_0x946d('0x44')]=_0x2c11f3['body'][_0x946d('0x44')];}else if(_0x2c11f3[_0x946d('0x42')][_0x946d('0x45')]){_0x4c5fa2[_0x946d('0x45')]=_0x2c11f3[_0x946d('0x42')]['SmsAccountId'];}else if(_0x2c11f3['body'][_0x946d('0x46')]){_0x4c5fa2['OpenchannelAccountId']=_0x2c11f3[_0x946d('0x42')][_0x946d('0x46')];}else if(_0x2c11f3[_0x946d('0x42')][_0x946d('0x47')]){_0x4c5fa2[_0x946d('0x47')]=_0x2c11f3['body'][_0x946d('0x47')];}return db['CannedAnswer'][_0x946d('0x43')]({'where':_0x4c5fa2})[_0x946d('0x24')](function(_0x52d88e){if(_0x52d88e){throw new db[(_0x946d('0x48'))]['ValidationError'](_0x946d('0x49'));}return db[_0x946d('0x3c')][_0x946d('0x4a')](_0x2c11f3[_0x946d('0x42')]);})[_0x946d('0x24')](function(_0x20208e){var _0x2365be=_0x2c11f3['user'][_0x946d('0x26')]({'plain':!![]});if(!_0x2365be)throw new Error(_0x946d('0x4b'));if(_0x2365be[_0x946d('0x4c')]===_0x946d('0x4d')){var _0x29369a=_0x20208e['get']({'plain':!![]});return db[_0x946d('0x4e')][_0x946d('0x43')]({'where':{'name':'CannedAnswers','userProfileId':_0x2365be['userProfileId']},'raw':!![]})[_0x946d('0x24')](function(_0x23a5c5){if(_0x23a5c5&&_0x23a5c5[_0x946d('0x4f')]===0x0){return db[_0x946d('0x27')]['create']({'name':_0x29369a['name'],'resourceId':_0x29369a['id'],'type':_0x23a5c5[_0x946d('0x28')],'sectionId':_0x23a5c5['id']},{})[_0x946d('0x24')](function(){return _0x20208e;});}else{return _0x20208e;}})[_0x946d('0x3e')](function(_0x5665ce){logger['error'](_0x946d('0x50'),_0x5665ce);throw _0x5665ce;});}return _0x20208e;})[_0x946d('0x24')](respondWithResult(_0x4a9465,0xc9))[_0x946d('0x3e')](handleError(_0x4a9465,null));}; \ No newline at end of file +var _0x86bf=['includeAll','include','findAll','rows','catch','show','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','moment','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge'];(function(_0x54a3ed,_0x18d540){var _0xb20ccc=function(_0x3475af){while(--_0x3475af){_0x54a3ed['push'](_0x54a3ed['shift']());}};_0xb20ccc(++_0x18d540);}(_0x86bf,0xc4));var _0xf86b=function(_0x426086,_0x4cf84c){_0x426086=_0x426086-0x0;var _0xaecb04=_0x86bf[_0x426086];return _0xaecb04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf86b('0x0'));var zipdir=require(_0xf86b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf86b('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf86b('0x3'));var path=require('path');var sox=require(_0xf86b('0x4'));var csv=require('to-csv');var ejs=require(_0xf86b('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf86b('0x6'));var squel=require(_0xf86b('0x7'));var crypto=require(_0xf86b('0x8'));var jsforce=require(_0xf86b('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xf86b('0xa'));var querystring=require(_0xf86b('0xb'));var Papa=require(_0xf86b('0xc'));var Redis=require(_0xf86b('0xd'));var authService=require(_0xf86b('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf86b('0xf'));var hardwareService=require(_0xf86b('0x10'));var logger=require(_0xf86b('0x11'))('api');var utils=require(_0xf86b('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf86b('0x13'))['db'];function respondWithStatusCode(_0x5f05db,_0x30f340){_0x30f340=_0x30f340||0xcc;return function(_0x16bc10){if(_0x16bc10){return _0x5f05db[_0xf86b('0x14')](_0x30f340);}return _0x5f05db[_0xf86b('0x15')](_0x30f340)[_0xf86b('0x16')]();};}function respondWithResult(_0xb01d48,_0xf371ea){_0xf371ea=_0xf371ea||0xc8;return function(_0x3190b6){if(_0x3190b6){return _0xb01d48[_0xf86b('0x15')](_0xf371ea)[_0xf86b('0x17')](_0x3190b6);}};}function respondWithFilteredResult(_0x223453,_0x559a84){return function(_0x581044){if(_0x581044){var _0x30ff01=typeof _0x559a84[_0xf86b('0x18')]===_0xf86b('0x19')&&typeof _0x559a84[_0xf86b('0x1a')]==='undefined';var _0x10b060=_0x581044['count'];var _0x4e2223=_0x30ff01?0x0:_0x559a84[_0xf86b('0x18')];var _0x45e92c=_0x30ff01?_0x581044[_0xf86b('0x1b')]:_0x559a84[_0xf86b('0x18')]+_0x559a84[_0xf86b('0x1a')];var _0x35e079;if(_0x45e92c>=_0x10b060){_0x45e92c=_0x10b060;_0x35e079=0xc8;}else{_0x35e079=0xce;}_0x223453[_0xf86b('0x15')](_0x35e079);return _0x223453[_0xf86b('0x1c')](_0xf86b('0x1d'),_0x4e2223+'-'+_0x45e92c+'/'+_0x10b060)[_0xf86b('0x17')](_0x581044);}return null;};}function patchUpdates(_0x111f68){return function(_0x31026d){try{jsonpatch[_0xf86b('0x1e')](_0x31026d,_0x111f68,!![]);}catch(_0x46024e){return BPromise[_0xf86b('0x1f')](_0x46024e);}return _0x31026d['save']();};}function saveUpdates(_0x492439,_0x16782e){return function(_0x198460){if(_0x198460){return _0x198460[_0xf86b('0x20')](_0x492439)[_0xf86b('0x21')](function(_0xf1cdfc){return _0xf1cdfc;});}return null;};}function removeEntity(_0x72749e,_0x31bb05){return function(_0xd9bdba){if(_0xd9bdba){return _0xd9bdba[_0xf86b('0x22')]()[_0xf86b('0x21')](function(){var _0x39a8bc=_0xd9bdba[_0xf86b('0x23')]({'plain':!![]});var _0x4a8e75=_0xf86b('0x24');return db[_0xf86b('0x25')]['destroy']({'where':{'type':_0x4a8e75,'resourceId':_0x39a8bc['id']}})['then'](function(){return _0xd9bdba;});})[_0xf86b('0x21')](function(){_0x72749e['status'](0xcc)[_0xf86b('0x16')]();});}};}function handleEntityNotFound(_0x5b19c5,_0x286118){return function(_0x5730d4){if(!_0x5730d4){_0x5b19c5[_0xf86b('0x14')](0x194);}return _0x5730d4;};}function handleError(_0x20b615,_0x212c28){_0x212c28=_0x212c28||0x1f4;return function(_0x26247d){logger['error'](_0x26247d['stack']);if(_0x26247d['name']){delete _0x26247d[_0xf86b('0x26')];}_0x20b615['status'](_0x212c28)[_0xf86b('0x27')](_0x26247d);};}exports[_0xf86b('0x28')]=function(_0x1733be,_0x470459){var _0xc5da82={},_0x44b40a={},_0x5c01b7={'count':0x0,'rows':[]};var _0x196855=_[_0xf86b('0x29')](db[_0xf86b('0x2a')][_0xf86b('0x2b')],function(_0x206e33){return{'name':_0x206e33[_0xf86b('0x2c')],'type':_0x206e33[_0xf86b('0x2d')][_0xf86b('0x2e')]};});_0x44b40a[_0xf86b('0x2f')]=_[_0xf86b('0x29')](_0x196855,_0xf86b('0x26'));_0x44b40a[_0xf86b('0x30')]=_[_0xf86b('0x31')](_0x1733be['query']);_0x44b40a[_0xf86b('0x32')]=_[_0xf86b('0x33')](_0x44b40a[_0xf86b('0x2f')],_0x44b40a[_0xf86b('0x30')]);_0xc5da82[_0xf86b('0x34')]=_['intersection'](_0x44b40a[_0xf86b('0x2f')],qs['fields'](_0x1733be['query'][_0xf86b('0x35')]));_0xc5da82['attributes']=_0xc5da82[_0xf86b('0x34')][_0xf86b('0x36')]?_0xc5da82[_0xf86b('0x34')]:_0x44b40a[_0xf86b('0x2f')];if(!_0x1733be[_0xf86b('0x30')]['hasOwnProperty'](_0xf86b('0x37'))){_0xc5da82[_0xf86b('0x1a')]=qs[_0xf86b('0x1a')](_0x1733be['query'][_0xf86b('0x1a')]);_0xc5da82[_0xf86b('0x18')]=qs[_0xf86b('0x18')](_0x1733be[_0xf86b('0x30')][_0xf86b('0x18')]);}_0xc5da82[_0xf86b('0x38')]=qs[_0xf86b('0x39')](_0x1733be[_0xf86b('0x30')][_0xf86b('0x39')]);_0xc5da82[_0xf86b('0x3a')]=qs[_0xf86b('0x32')](_[_0xf86b('0x3b')](_0x1733be['query'],_0x44b40a[_0xf86b('0x32')]),_0x196855);if(_0x1733be[_0xf86b('0x30')][_0xf86b('0x3c')]){_0xc5da82['where']=_[_0xf86b('0x3d')](_0xc5da82[_0xf86b('0x3a')],{'$or':[{'key':{'$like':'%'+_0x1733be[_0xf86b('0x30')][_0xf86b('0x3c')]+'%'}},{'value':{'$like':'%'+_0x1733be['query'][_0xf86b('0x3c')]+'%'}}]});}_0xc5da82=_[_0xf86b('0x3d')]({},_0xc5da82,_0x1733be['options']);var _0x48c41b={'where':_0xc5da82['where']};return db[_0xf86b('0x2a')][_0xf86b('0x1b')](_0x48c41b)[_0xf86b('0x21')](function(_0x9b89e){_0x5c01b7[_0xf86b('0x1b')]=_0x9b89e;if(_0x1733be['query'][_0xf86b('0x3e')]){_0xc5da82[_0xf86b('0x3f')]=[{'all':!![]}];}return db[_0xf86b('0x2a')][_0xf86b('0x40')](_0xc5da82);})[_0xf86b('0x21')](function(_0xd04210){_0x5c01b7[_0xf86b('0x41')]=_0xd04210;return _0x5c01b7;})['then'](respondWithFilteredResult(_0x470459,_0xc5da82))[_0xf86b('0x42')](handleError(_0x470459,null));};exports[_0xf86b('0x43')]=function(_0x4a2cc1,_0x58e9dc){var _0x549d43={'raw':!![],'where':{'id':_0x4a2cc1[_0xf86b('0x44')]['id']}},_0x3ee9ff={};_0x3ee9ff[_0xf86b('0x2f')]=_['keys'](db[_0xf86b('0x2a')]['rawAttributes']);_0x3ee9ff[_0xf86b('0x30')]=_['keys'](_0x4a2cc1[_0xf86b('0x30')]);_0x3ee9ff[_0xf86b('0x32')]=_[_0xf86b('0x33')](_0x3ee9ff[_0xf86b('0x2f')],_0x3ee9ff['query']);_0x549d43[_0xf86b('0x34')]=_['intersection'](_0x3ee9ff['model'],qs['fields'](_0x4a2cc1[_0xf86b('0x30')][_0xf86b('0x35')]));_0x549d43[_0xf86b('0x34')]=_0x549d43[_0xf86b('0x34')]['length']?_0x549d43[_0xf86b('0x34')]:_0x3ee9ff['model'];if(_0x4a2cc1[_0xf86b('0x30')][_0xf86b('0x3e')]){_0x549d43['include']=[{'all':!![]}];}_0x549d43=_['merge']({},_0x549d43,_0x4a2cc1['options']);return db[_0xf86b('0x2a')][_0xf86b('0x45')](_0x549d43)[_0xf86b('0x21')](handleEntityNotFound(_0x58e9dc,null))['then'](respondWithResult(_0x58e9dc,null))[_0xf86b('0x42')](handleError(_0x58e9dc,null));};exports[_0xf86b('0x20')]=function(_0x30275b,_0x34cdc7){if(_0x30275b[_0xf86b('0x46')]['id']){delete _0x30275b[_0xf86b('0x46')]['id'];}return db[_0xf86b('0x2a')][_0xf86b('0x45')]({'where':{'id':_0x30275b['params']['id']}})[_0xf86b('0x21')](handleEntityNotFound(_0x34cdc7,null))[_0xf86b('0x21')](saveUpdates(_0x30275b[_0xf86b('0x46')],null))[_0xf86b('0x21')](respondWithResult(_0x34cdc7,null))['catch'](handleError(_0x34cdc7,null));};exports[_0xf86b('0x22')]=function(_0x3b6c63,_0x3fe320){return db[_0xf86b('0x2a')][_0xf86b('0x45')]({'where':{'id':_0x3b6c63['params']['id']}})[_0xf86b('0x21')](handleEntityNotFound(_0x3fe320,null))[_0xf86b('0x21')](removeEntity(_0x3fe320,null))['catch'](handleError(_0x3fe320,null));};exports[_0xf86b('0x47')]=function(_0x76a847,_0x3a8a0d){var _0xb93a4c={'key':_0x76a847[_0xf86b('0x46')][_0xf86b('0x2e')]};if(_0x76a847[_0xf86b('0x46')][_0xf86b('0x48')]){_0xb93a4c['MailAccountId']=_0x76a847[_0xf86b('0x46')][_0xf86b('0x48')];}else if(_0x76a847[_0xf86b('0x46')][_0xf86b('0x49')]){_0xb93a4c[_0xf86b('0x49')]=_0x76a847['body'][_0xf86b('0x49')];}else if(_0x76a847[_0xf86b('0x46')][_0xf86b('0x4a')]){_0xb93a4c[_0xf86b('0x4a')]=_0x76a847[_0xf86b('0x46')]['OpenchannelAccountId'];}else if(_0x76a847[_0xf86b('0x46')][_0xf86b('0x4b')]){_0xb93a4c[_0xf86b('0x4b')]=_0x76a847[_0xf86b('0x46')][_0xf86b('0x4b')];}return db[_0xf86b('0x2a')][_0xf86b('0x45')]({'where':_0xb93a4c})[_0xf86b('0x21')](function(_0x2968ba){if(_0x2968ba){throw new db[(_0xf86b('0x4c'))][(_0xf86b('0x4d'))](_0xf86b('0x4e'));}return db[_0xf86b('0x2a')][_0xf86b('0x47')](_0x76a847[_0xf86b('0x46')]);})[_0xf86b('0x21')](function(_0x5d534f){var _0x45f478=_0x76a847[_0xf86b('0x4f')][_0xf86b('0x23')]({'plain':!![]});if(!_0x45f478)throw new Error(_0xf86b('0x50'));if(_0x45f478[_0xf86b('0x51')]===_0xf86b('0x4f')){var _0x4003e7=_0x5d534f[_0xf86b('0x23')]({'plain':!![]});return db[_0xf86b('0x52')]['find']({'where':{'name':_0xf86b('0x24'),'userProfileId':_0x45f478[_0xf86b('0x53')]},'raw':!![]})[_0xf86b('0x21')](function(_0x597745){if(_0x597745&&_0x597745['autoAssociation']===0x0){return db[_0xf86b('0x25')][_0xf86b('0x47')]({'name':_0x4003e7['name'],'resourceId':_0x4003e7['id'],'type':_0x597745[_0xf86b('0x26')],'sectionId':_0x597745['id']},{})[_0xf86b('0x21')](function(){return _0x5d534f;});}else{return _0x5d534f;}})[_0xf86b('0x42')](function(_0x5be4ac){logger[_0xf86b('0x54')](_0xf86b('0x55'),_0x5be4ac);throw _0x5be4ac;});}return _0x5d534f;})['then'](respondWithResult(_0x3a8a0d,0xc9))['catch'](handleError(_0x3a8a0d,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 84f3b85..235e8e4 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 _0x3a46=['moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x3a46,0x137));var _0x63a4=function(_0x11fb5b,_0x800f1b){_0x11fb5b=_0x11fb5b-0x0;var _0x5dd1af=_0x3a46[_0x11fb5b];return _0x5dd1af;};'use strict';var _=require(_0x63a4('0x0'));var util=require(_0x63a4('0x1'));var logger=require(_0x63a4('0x2'))(_0x63a4('0x3'));var moment=require(_0x63a4('0x4'));var BPromise=require(_0x63a4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x63a4('0x6'));var rimraf=require(_0x63a4('0x7'));var config=require(_0x63a4('0x8'));var attributes=require(_0x63a4('0x9'));module[_0x63a4('0xa')]=function(_0x5171a2,_0x2fdf94){return _0x5171a2['define'](_0x63a4('0xb'),attributes,{'tableName':_0x63a4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x63a4('0xd'),'collate':_0x63a4('0xe')});}; \ No newline at end of file +var _0xf44f=['define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes'];(function(_0x5c2e64,_0x4f9d84){var _0x1ed606=function(_0x1e478b){while(--_0x1e478b){_0x5c2e64['push'](_0x5c2e64['shift']());}};_0x1ed606(++_0x4f9d84);}(_0xf44f,0x138));var _0xff44=function(_0x11dfc1,_0x20d24b){_0x11dfc1=_0x11dfc1-0x0;var _0x2f056e=_0xf44f[_0x11dfc1];return _0x2f056e;};'use strict';var _=require(_0xff44('0x0'));var util=require(_0xff44('0x1'));var logger=require(_0xff44('0x2'))(_0xff44('0x3'));var moment=require(_0xff44('0x4'));var BPromise=require(_0xff44('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xff44('0x6'));var rimraf=require(_0xff44('0x7'));var config=require(_0xff44('0x8'));var attributes=require(_0xff44('0x9'));module['exports']=function(_0x20411d,_0x19ef4d){return _0x20411d[_0xff44('0xa')]('CannedAnswer',attributes,{'tableName':_0xff44('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xff44('0xc'),'collate':_0xff44('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 58dcca2..82d87e9 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(_0x304d77,_0x3d5e06){var _0x3743aa=function(_0x16f100){while(--_0x16f100){_0x304d77['push'](_0x304d77['shift']());}};_0x3743aa(++_0x3d5e06);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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(_0x21f4b4,_0x236672){var _0x4f945c=function(_0xe3676a){while(--_0xe3676a){_0x21f4b4['push'](_0x21f4b4['shift']());}};_0x4f945c(++_0x236672);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 7ea5b46..94e3dc8 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 _0xe3e4=['show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated'];(function(_0x5bdf8e,_0x45d970){var _0x3e0750=function(_0x41298b){while(--_0x41298b){_0x5bdf8e['push'](_0x5bdf8e['shift']());}};_0x3e0750(++_0x45d970);}(_0xe3e4,0x182));var _0x4e3e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe3e4[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x4e3e('0x0'));var util=require(_0x4e3e('0x1'));var path=require(_0x4e3e('0x2'));var timeout=require('connect-timeout');var express=require(_0x4e3e('0x3'));var router=express[_0x4e3e('0x4')]();var fs_extra=require(_0x4e3e('0x5'));var auth=require(_0x4e3e('0x6'));var interaction=require(_0x4e3e('0x7'));var config=require(_0x4e3e('0x8'));var controller=require(_0x4e3e('0x9'));router[_0x4e3e('0xa')]('/',auth['isAuthenticated'](),controller[_0x4e3e('0xb')]);router[_0x4e3e('0xa')](_0x4e3e('0xc'),auth[_0x4e3e('0xd')](),controller[_0x4e3e('0xe')]);router[_0x4e3e('0xf')]('/',auth[_0x4e3e('0xd')](),controller[_0x4e3e('0x10')]);router[_0x4e3e('0x11')]('/:id',auth[_0x4e3e('0xd')](),controller['update']);router['delete'](_0x4e3e('0xc'),auth[_0x4e3e('0xd')](),controller[_0x4e3e('0x12')]);module[_0x4e3e('0x13')]=router; \ No newline at end of file +var _0x304f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x346044,_0x522b93){var _0x2d8d01=function(_0x436ed0){while(--_0x436ed0){_0x346044['push'](_0x346044['shift']());}};_0x2d8d01(++_0x522b93);}(_0x304f,0x177));var _0xf304=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x304f[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xf304('0x0'));var util=require(_0xf304('0x1'));var path=require('path');var timeout=require(_0xf304('0x2'));var express=require(_0xf304('0x3'));var router=express[_0xf304('0x4')]();var fs_extra=require(_0xf304('0x5'));var auth=require(_0xf304('0x6'));var interaction=require(_0xf304('0x7'));var config=require(_0xf304('0x8'));var controller=require(_0xf304('0x9'));router[_0xf304('0xa')]('/',auth[_0xf304('0xb')](),controller['index']);router['get'](_0xf304('0xc'),auth[_0xf304('0xb')](),controller[_0xf304('0xd')]);router['post']('/',auth[_0xf304('0xb')](),controller[_0xf304('0xe')]);router[_0xf304('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf304('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xf304('0x11')]);module[_0xf304('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index e165441..42348a5 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 _0xa7b5=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x4ba499,_0x1cdf4e){var _0x58c08a=function(_0x133099){while(--_0x133099){_0x4ba499['push'](_0x4ba499['shift']());}};_0x58c08a(++_0x1cdf4e);}(_0xa7b5,0x162));var _0x5a7b=function(_0x452ad9,_0x5753d2){_0x452ad9=_0x452ad9-0x0;var _0x5ef71b=_0xa7b5[_0x452ad9];return _0x5ef71b;};'use strict';var Sequelize=require(_0x5a7b('0x0'));module[_0x5a7b('0x1')]={'calldate':{'type':Sequelize[_0x5a7b('0x2')],'allowNull':![],'defaultValue':_0x5a7b('0x3')},'clid':{'type':Sequelize[_0x5a7b('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x5a7b('0x4')]},'dcontext':{'type':Sequelize[_0x5a7b('0x4')]},'channel':{'type':Sequelize[_0x5a7b('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x5a7b('0x4')]},'duration':{'type':Sequelize[_0x5a7b('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5a7b('0x4')]},'amaflags':{'type':Sequelize[_0x5a7b('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5a7b('0x4')]},'userfield':{'type':Sequelize[_0x5a7b('0x4')]},'uniqueid':{'type':Sequelize[_0x5a7b('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x5a7b('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5a7b('0x4')]},'tag':{'type':Sequelize[_0x5a7b('0x4')]}}; \ No newline at end of file +var _0x7008=['DATE','STRING','INTEGER'];(function(_0x3c5432,_0x4e13dc){var _0x20c67d=function(_0xd828fd){while(--_0xd828fd){_0x3c5432['push'](_0x3c5432['shift']());}};_0x20c67d(++_0x4e13dc);}(_0x7008,0x1ec));var _0x8700=function(_0x3e06bd,_0x421610){_0x3e06bd=_0x3e06bd-0x0;var _0x1f7f2b=_0x7008[_0x3e06bd];return _0x1f7f2b;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x8700('0x0')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x8700('0x1')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x8700('0x1')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8700('0x1')]},'dstchannel':{'type':Sequelize[_0x8700('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x8700('0x1')]},'duration':{'type':Sequelize[_0x8700('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8700('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8700('0x1')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8700('0x1')]},'userfield':{'type':Sequelize[_0x8700('0x1')]},'uniqueid':{'type':Sequelize[_0x8700('0x1')]},'linkedid':{'type':Sequelize[_0x8700('0x1')]},'sequence':{'type':Sequelize[_0x8700('0x1')]},'peeraccount':{'type':Sequelize[_0x8700('0x1')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 551af06..a8f6f21 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 _0x60c2=['squel','crypto','jsforce','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','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','filters','filter','merge','where','VIRTUAL','options','includeAll','include','Cdr','findAll','rows','params','find','create','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x2f1732,_0x19313d){var _0x4c498d=function(_0x42ab84){while(--_0x42ab84){_0x2f1732['push'](_0x2f1732['shift']());}};_0x4c498d(++_0x19313d);}(_0x60c2,0x8f));var _0x260c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x60c2[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x260c('0x0'));var zipdir=require(_0x260c('0x1'));var jsonpatch=require(_0x260c('0x2'));var rp=require(_0x260c('0x3'));var moment=require(_0x260c('0x4'));var BPromise=require(_0x260c('0x5'));var Mustache=require(_0x260c('0x6'));var util=require(_0x260c('0x7'));var path=require(_0x260c('0x8'));var sox=require(_0x260c('0x9'));var csv=require(_0x260c('0xa'));var ejs=require(_0x260c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x260c('0xc'));var squel=require(_0x260c('0xd'));var crypto=require(_0x260c('0xe'));var jsforce=require(_0x260c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x260c('0xa'));var querystring=require(_0x260c('0x10'));var Papa=require(_0x260c('0x11'));var Redis=require(_0x260c('0x12'));var authService=require(_0x260c('0x13'));var qs=require(_0x260c('0x14'));var as=require(_0x260c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x260c('0x16'))(_0x260c('0x17'));var utils=require(_0x260c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x260c('0x19'));var db=require(_0x260c('0x1a'))['db'];function respondWithStatusCode(_0x191490,_0x5aed37){_0x5aed37=_0x5aed37||0xcc;return function(_0xc44e8d){if(_0xc44e8d){return _0x191490[_0x260c('0x1b')](_0x5aed37);}return _0x191490[_0x260c('0x1c')](_0x5aed37)[_0x260c('0x1d')]();};}function respondWithResult(_0x1d3775,_0x53df53){_0x53df53=_0x53df53||0xc8;return function(_0x3930b6){if(_0x3930b6){return _0x1d3775['status'](_0x53df53)[_0x260c('0x1e')](_0x3930b6);}};}function respondWithFilteredResult(_0x5a021c,_0x47edc1){return function(_0xd8b310){if(_0xd8b310){var _0x5299a4=typeof _0x47edc1[_0x260c('0x1f')]===_0x260c('0x20')&&typeof _0x47edc1[_0x260c('0x21')]===_0x260c('0x20');var _0x2bf3b8=_0xd8b310[_0x260c('0x22')];var _0x11e634=_0x5299a4?0x0:_0x47edc1[_0x260c('0x1f')];var _0x201e59=_0x5299a4?_0xd8b310[_0x260c('0x22')]:_0x47edc1[_0x260c('0x1f')]+_0x47edc1['limit'];var _0xd977b;if(_0x201e59>=_0x2bf3b8){_0x201e59=_0x2bf3b8;_0xd977b=0xc8;}else{_0xd977b=0xce;}_0x5a021c['status'](_0xd977b);return _0x5a021c[_0x260c('0x23')](_0x260c('0x24'),_0x11e634+'-'+_0x201e59+'/'+_0x2bf3b8)['json'](_0xd8b310);}return null;};}function patchUpdates(_0x1ccf81){return function(_0xe824db){try{jsonpatch[_0x260c('0x25')](_0xe824db,_0x1ccf81,!![]);}catch(_0x1c53e1){return BPromise[_0x260c('0x26')](_0x1c53e1);}return _0xe824db[_0x260c('0x27')]();};}function saveUpdates(_0x4b5b7a,_0xd5b7d8){return function(_0x158bc6){if(_0x158bc6){return _0x158bc6[_0x260c('0x28')](_0x4b5b7a)[_0x260c('0x29')](function(_0x58688c){return _0x58688c;});}return null;};}function removeEntity(_0x3f299f,_0x304961){return function(_0x461c8a){if(_0x461c8a){return _0x461c8a[_0x260c('0x2a')]()['then'](function(){_0x3f299f[_0x260c('0x1c')](0xcc)[_0x260c('0x1d')]();});}};}function handleEntityNotFound(_0x3bdfce,_0x29e10e){return function(_0x4cf0f9){if(!_0x4cf0f9){_0x3bdfce[_0x260c('0x1b')](0x194);}return _0x4cf0f9;};}function handleError(_0x2957e5,_0x480179){_0x480179=_0x480179||0x1f4;return function(_0x5def72){logger[_0x260c('0x2b')](_0x5def72[_0x260c('0x2c')]);if(_0x5def72[_0x260c('0x2d')]){delete _0x5def72[_0x260c('0x2d')];}_0x2957e5[_0x260c('0x1c')](_0x480179)[_0x260c('0x2e')](_0x5def72);};}exports['index']=function(_0xf1ad3e,_0x2e49dd){var _0x16b663={},_0x233a61={},_0x5993fd={'count':0x0,'rows':[]};var _0xc6868a=_[_0x260c('0x2f')](db['Cdr'][_0x260c('0x30')],function(_0xcb8c28){return{'name':_0xcb8c28[_0x260c('0x31')],'type':_0xcb8c28[_0x260c('0x32')][_0x260c('0x33')]};});_0x233a61[_0x260c('0x34')]=_[_0x260c('0x2f')](_0xc6868a,_0x260c('0x2d'));_0x233a61['query']=_[_0x260c('0x35')](_0xf1ad3e[_0x260c('0x36')]);_0x233a61['filters']=_[_0x260c('0x37')](_0x233a61['model'],_0x233a61['query']);_0x16b663['attributes']=_[_0x260c('0x37')](_0x233a61[_0x260c('0x34')],qs['fields'](_0xf1ad3e[_0x260c('0x36')][_0x260c('0x38')]));_0x16b663[_0x260c('0x39')]=_0x16b663[_0x260c('0x39')][_0x260c('0x3a')]?_0x16b663[_0x260c('0x39')]:_0x233a61['model'];if(!_0xf1ad3e[_0x260c('0x36')][_0x260c('0x3b')](_0x260c('0x3c'))){_0x16b663[_0x260c('0x21')]=qs[_0x260c('0x21')](_0xf1ad3e[_0x260c('0x36')][_0x260c('0x21')]);_0x16b663[_0x260c('0x1f')]=qs[_0x260c('0x1f')](_0xf1ad3e['query'][_0x260c('0x1f')]);}_0x16b663['order']=qs['sort'](_0xf1ad3e['query']['sort']);_0x16b663['where']=qs['filters'](_['pick'](_0xf1ad3e[_0x260c('0x36')],_0x233a61[_0x260c('0x3d')]),_0xc6868a);if(_0xf1ad3e[_0x260c('0x36')][_0x260c('0x3e')]){_0x16b663['where']=_[_0x260c('0x3f')](_0x16b663[_0x260c('0x40')],{'$or':_['map'](_0xc6868a,function(_0x35afd6){if(_0x35afd6[_0x260c('0x32')]!==_0x260c('0x41')){var _0x1dbc8a={};_0x1dbc8a[_0x35afd6[_0x260c('0x2d')]]={'$like':'%'+_0xf1ad3e['query']['filter']+'%'};return _0x1dbc8a;}})});}_0x16b663=_[_0x260c('0x3f')]({},_0x16b663,_0xf1ad3e[_0x260c('0x42')]);var _0x1de711={'where':_0x16b663[_0x260c('0x40')]};return db['Cdr'][_0x260c('0x22')](_0x1de711)[_0x260c('0x29')](function(_0x265bd8){_0x5993fd[_0x260c('0x22')]=_0x265bd8;if(_0xf1ad3e[_0x260c('0x36')][_0x260c('0x43')]){_0x16b663[_0x260c('0x44')]=[{'all':!![]}];}return db[_0x260c('0x45')][_0x260c('0x46')](_0x16b663);})[_0x260c('0x29')](function(_0x3392df){_0x5993fd[_0x260c('0x47')]=_0x3392df;return _0x5993fd;})[_0x260c('0x29')](respondWithFilteredResult(_0x2e49dd,_0x16b663))['catch'](handleError(_0x2e49dd,null));};exports['show']=function(_0x19ab59,_0x30b3f9){var _0xccd9c1={'raw':!![],'where':{'id':_0x19ab59[_0x260c('0x48')]['id']}},_0x50ed87={};_0x50ed87['model']=_['keys'](db[_0x260c('0x45')]['rawAttributes']);_0x50ed87[_0x260c('0x36')]=_[_0x260c('0x35')](_0x19ab59[_0x260c('0x36')]);_0x50ed87[_0x260c('0x3d')]=_['intersection'](_0x50ed87[_0x260c('0x34')],_0x50ed87[_0x260c('0x36')]);_0xccd9c1['attributes']=_[_0x260c('0x37')](_0x50ed87['model'],qs[_0x260c('0x38')](_0x19ab59[_0x260c('0x36')][_0x260c('0x38')]));_0xccd9c1['attributes']=_0xccd9c1[_0x260c('0x39')][_0x260c('0x3a')]?_0xccd9c1[_0x260c('0x39')]:_0x50ed87[_0x260c('0x34')];if(_0x19ab59[_0x260c('0x36')][_0x260c('0x43')]){_0xccd9c1[_0x260c('0x44')]=[{'all':!![]}];}_0xccd9c1=_[_0x260c('0x3f')]({},_0xccd9c1,_0x19ab59[_0x260c('0x42')]);return db[_0x260c('0x45')][_0x260c('0x49')](_0xccd9c1)[_0x260c('0x29')](handleEntityNotFound(_0x30b3f9,null))['then'](respondWithResult(_0x30b3f9,null))['catch'](handleError(_0x30b3f9,null));};exports[_0x260c('0x4a')]=function(_0x4517be,_0x18321f){return db[_0x260c('0x45')]['create'](_0x4517be[_0x260c('0x4b')],{})[_0x260c('0x29')](respondWithResult(_0x18321f,0xc9))[_0x260c('0x4c')](handleError(_0x18321f,null));};exports[_0x260c('0x28')]=function(_0x45175a,_0x1d0890){if(_0x45175a[_0x260c('0x4b')]['id']){delete _0x45175a[_0x260c('0x4b')]['id'];}return db[_0x260c('0x45')]['find']({'where':{'id':_0x45175a[_0x260c('0x48')]['id']}})[_0x260c('0x29')](handleEntityNotFound(_0x1d0890,null))['then'](saveUpdates(_0x45175a[_0x260c('0x4b')],null))['then'](respondWithResult(_0x1d0890,null))[_0x260c('0x4c')](handleError(_0x1d0890,null));};exports['destroy']=function(_0x4dcdca,_0x1e34fe){return db[_0x260c('0x45')][_0x260c('0x49')]({'where':{'id':_0x4dcdca[_0x260c('0x48')]['id']}})[_0x260c('0x29')](handleEntityNotFound(_0x1e34fe,null))[_0x260c('0x29')](removeEntity(_0x1e34fe,null))[_0x260c('0x4c')](handleError(_0x1e34fe,null));};exports['describe']=function(_0x12fbe5,_0x49b350){return db[_0x260c('0x45')][_0x260c('0x4d')]()[_0x260c('0x29')](respondWithResult(_0x49b350,null))[_0x260c('0x4c')](handleError(_0x49b350,null));}; \ No newline at end of file +var _0x3c17=['apply','reject','save','update','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','options','then','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json'];(function(_0x5f57b1,_0x546449){var _0xf31a3=function(_0x3acd0c){while(--_0x3acd0c){_0x5f57b1['push'](_0x5f57b1['shift']());}};_0xf31a3(++_0x546449);}(_0x3c17,0x1a1));var _0x73c1=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x3c17[_0x5b561d];return _0x431060;};'use strict';var emlformat=require(_0x73c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x73c1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x73c1('0x2'));var moment=require(_0x73c1('0x3'));var BPromise=require(_0x73c1('0x4'));var Mustache=require('mustache');var util=require(_0x73c1('0x5'));var path=require(_0x73c1('0x6'));var sox=require(_0x73c1('0x7'));var csv=require(_0x73c1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73c1('0x9'));var _=require('lodash');var squel=require(_0x73c1('0xa'));var crypto=require(_0x73c1('0xb'));var jsforce=require(_0x73c1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x73c1('0xd'));var Papa=require(_0x73c1('0xe'));var Redis=require(_0x73c1('0xf'));var authService=require(_0x73c1('0x10'));var qs=require(_0x73c1('0x11'));var as=require(_0x73c1('0x12'));var hardwareService=require(_0x73c1('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x73c1('0x14'));var config=require(_0x73c1('0x15'));var licenseUtil=require(_0x73c1('0x16'));var db=require(_0x73c1('0x17'))['db'];function respondWithStatusCode(_0x592a6a,_0x2b77bc){_0x2b77bc=_0x2b77bc||0xcc;return function(_0x5e6b55){if(_0x5e6b55){return _0x592a6a[_0x73c1('0x18')](_0x2b77bc);}return _0x592a6a['status'](_0x2b77bc)[_0x73c1('0x19')]();};}function respondWithResult(_0x3ecf5a,_0x57cb11){_0x57cb11=_0x57cb11||0xc8;return function(_0x537965){if(_0x537965){return _0x3ecf5a[_0x73c1('0x1a')](_0x57cb11)['json'](_0x537965);}};}function respondWithFilteredResult(_0x72a36,_0x52d0ff){return function(_0xe5d5c8){if(_0xe5d5c8){var _0x47d81e=typeof _0x52d0ff[_0x73c1('0x1b')]===_0x73c1('0x1c')&&typeof _0x52d0ff[_0x73c1('0x1d')]===_0x73c1('0x1c');var _0x8c0803=_0xe5d5c8[_0x73c1('0x1e')];var _0x16deb6=_0x47d81e?0x0:_0x52d0ff[_0x73c1('0x1b')];var _0x1ce19e=_0x47d81e?_0xe5d5c8['count']:_0x52d0ff[_0x73c1('0x1b')]+_0x52d0ff[_0x73c1('0x1d')];var _0x28df60;if(_0x1ce19e>=_0x8c0803){_0x1ce19e=_0x8c0803;_0x28df60=0xc8;}else{_0x28df60=0xce;}_0x72a36[_0x73c1('0x1a')](_0x28df60);return _0x72a36['set'](_0x73c1('0x1f'),_0x16deb6+'-'+_0x1ce19e+'/'+_0x8c0803)[_0x73c1('0x20')](_0xe5d5c8);}return null;};}function patchUpdates(_0x344fb5){return function(_0x2e17e5){try{jsonpatch[_0x73c1('0x21')](_0x2e17e5,_0x344fb5,!![]);}catch(_0x2aa7df){return BPromise[_0x73c1('0x22')](_0x2aa7df);}return _0x2e17e5[_0x73c1('0x23')]();};}function saveUpdates(_0x49b817,_0x2eba51){return function(_0x32b379){if(_0x32b379){return _0x32b379[_0x73c1('0x24')](_0x49b817)['then'](function(_0x10254c){return _0x10254c;});}return null;};}function removeEntity(_0x2ebfda,_0x1125ff){return function(_0x3abaab){if(_0x3abaab){return _0x3abaab[_0x73c1('0x25')]()['then'](function(){_0x2ebfda[_0x73c1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54feeb,_0x2301b7){return function(_0x1c567d){if(!_0x1c567d){_0x54feeb[_0x73c1('0x18')](0x194);}return _0x1c567d;};}function handleError(_0x1c54aa,_0x123cc0){_0x123cc0=_0x123cc0||0x1f4;return function(_0x30ec73){logger[_0x73c1('0x26')](_0x30ec73[_0x73c1('0x27')]);if(_0x30ec73[_0x73c1('0x28')]){delete _0x30ec73[_0x73c1('0x28')];}_0x1c54aa[_0x73c1('0x1a')](_0x123cc0)[_0x73c1('0x29')](_0x30ec73);};}exports[_0x73c1('0x2a')]=function(_0x240137,_0x5bf2b1){var _0x2b2996={},_0x9050fd={},_0x33b5bc={'count':0x0,'rows':[]};var _0x153141=_[_0x73c1('0x2b')](db[_0x73c1('0x2c')][_0x73c1('0x2d')],function(_0x45c411){return{'name':_0x45c411[_0x73c1('0x2e')],'type':_0x45c411['type']['key']};});_0x9050fd[_0x73c1('0x2f')]=_[_0x73c1('0x2b')](_0x153141,_0x73c1('0x28'));_0x9050fd[_0x73c1('0x30')]=_['keys'](_0x240137[_0x73c1('0x30')]);_0x9050fd[_0x73c1('0x31')]=_[_0x73c1('0x32')](_0x9050fd['model'],_0x9050fd[_0x73c1('0x30')]);_0x2b2996[_0x73c1('0x33')]=_[_0x73c1('0x32')](_0x9050fd[_0x73c1('0x2f')],qs[_0x73c1('0x34')](_0x240137[_0x73c1('0x30')]['fields']));_0x2b2996[_0x73c1('0x33')]=_0x2b2996[_0x73c1('0x33')][_0x73c1('0x35')]?_0x2b2996[_0x73c1('0x33')]:_0x9050fd[_0x73c1('0x2f')];if(!_0x240137[_0x73c1('0x30')][_0x73c1('0x36')](_0x73c1('0x37'))){_0x2b2996[_0x73c1('0x1d')]=qs[_0x73c1('0x1d')](_0x240137['query'][_0x73c1('0x1d')]);_0x2b2996['offset']=qs[_0x73c1('0x1b')](_0x240137[_0x73c1('0x30')][_0x73c1('0x1b')]);}_0x2b2996[_0x73c1('0x38')]=qs['sort'](_0x240137['query']['sort']);_0x2b2996[_0x73c1('0x39')]=qs['filters'](_[_0x73c1('0x3a')](_0x240137[_0x73c1('0x30')],_0x9050fd[_0x73c1('0x31')]),_0x153141);if(_0x240137[_0x73c1('0x30')][_0x73c1('0x3b')]){_0x2b2996[_0x73c1('0x39')]=_[_0x73c1('0x3c')](_0x2b2996[_0x73c1('0x39')],{'$or':_[_0x73c1('0x2b')](_0x153141,function(_0x304c2b){if(_0x304c2b[_0x73c1('0x3d')]!=='VIRTUAL'){var _0x2bb535={};_0x2bb535[_0x304c2b[_0x73c1('0x28')]]={'$like':'%'+_0x240137[_0x73c1('0x30')][_0x73c1('0x3b')]+'%'};return _0x2bb535;}})});}_0x2b2996=_[_0x73c1('0x3c')]({},_0x2b2996,_0x240137[_0x73c1('0x3e')]);var _0x5a8c11={'where':_0x2b2996[_0x73c1('0x39')]};return db[_0x73c1('0x2c')][_0x73c1('0x1e')](_0x5a8c11)[_0x73c1('0x3f')](function(_0x21feb9){_0x33b5bc[_0x73c1('0x1e')]=_0x21feb9;if(_0x240137['query'][_0x73c1('0x40')]){_0x2b2996['include']=[{'all':!![]}];}return db[_0x73c1('0x2c')][_0x73c1('0x41')](_0x2b2996);})['then'](function(_0x57d843){_0x33b5bc[_0x73c1('0x42')]=_0x57d843;return _0x33b5bc;})[_0x73c1('0x3f')](respondWithFilteredResult(_0x5bf2b1,_0x2b2996))[_0x73c1('0x43')](handleError(_0x5bf2b1,null));};exports[_0x73c1('0x44')]=function(_0x689ca5,_0x282b73){var _0x515a52={'raw':!![],'where':{'id':_0x689ca5[_0x73c1('0x45')]['id']}},_0x5c70b9={};_0x5c70b9[_0x73c1('0x2f')]=_['keys'](db['Cdr'][_0x73c1('0x2d')]);_0x5c70b9['query']=_[_0x73c1('0x46')](_0x689ca5[_0x73c1('0x30')]);_0x5c70b9[_0x73c1('0x31')]=_[_0x73c1('0x32')](_0x5c70b9[_0x73c1('0x2f')],_0x5c70b9[_0x73c1('0x30')]);_0x515a52[_0x73c1('0x33')]=_[_0x73c1('0x32')](_0x5c70b9['model'],qs['fields'](_0x689ca5[_0x73c1('0x30')][_0x73c1('0x34')]));_0x515a52[_0x73c1('0x33')]=_0x515a52['attributes'][_0x73c1('0x35')]?_0x515a52[_0x73c1('0x33')]:_0x5c70b9[_0x73c1('0x2f')];if(_0x689ca5[_0x73c1('0x30')][_0x73c1('0x40')]){_0x515a52[_0x73c1('0x47')]=[{'all':!![]}];}_0x515a52=_[_0x73c1('0x3c')]({},_0x515a52,_0x689ca5[_0x73c1('0x3e')]);return db[_0x73c1('0x2c')][_0x73c1('0x48')](_0x515a52)[_0x73c1('0x3f')](handleEntityNotFound(_0x282b73,null))[_0x73c1('0x3f')](respondWithResult(_0x282b73,null))['catch'](handleError(_0x282b73,null));};exports[_0x73c1('0x49')]=function(_0x512295,_0x1a681c){return db[_0x73c1('0x2c')][_0x73c1('0x49')](_0x512295[_0x73c1('0x4a')],{})[_0x73c1('0x3f')](respondWithResult(_0x1a681c,0xc9))[_0x73c1('0x43')](handleError(_0x1a681c,null));};exports['update']=function(_0x34093c,_0x2ccd11){if(_0x34093c[_0x73c1('0x4a')]['id']){delete _0x34093c['body']['id'];}return db[_0x73c1('0x2c')][_0x73c1('0x48')]({'where':{'id':_0x34093c[_0x73c1('0x45')]['id']}})[_0x73c1('0x3f')](handleEntityNotFound(_0x2ccd11,null))[_0x73c1('0x3f')](saveUpdates(_0x34093c[_0x73c1('0x4a')],null))[_0x73c1('0x3f')](respondWithResult(_0x2ccd11,null))[_0x73c1('0x43')](handleError(_0x2ccd11,null));};exports[_0x73c1('0x25')]=function(_0x53d491,_0x3291db){return db['Cdr']['find']({'where':{'id':_0x53d491['params']['id']}})['then'](handleEntityNotFound(_0x3291db,null))['then'](removeEntity(_0x3291db,null))[_0x73c1('0x43')](handleError(_0x3291db,null));};exports['describe']=function(_0x3c31e8,_0x47e3ca){return db['Cdr']['describe']()[_0x73c1('0x3f')](respondWithResult(_0x47e3ca,null))['catch'](handleError(_0x47e3ca,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 8e790cc..8452ca4 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(_0x14a2de,_0xb6f4fa){var _0x5f2d6c=function(_0x34d62d){while(--_0x34d62d){_0x14a2de['push'](_0x14a2de['shift']());}};_0x5f2d6c(++_0xb6f4fa);}(_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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x52a750,_0x7f9968){var _0x56eeab=function(_0x27fe53){while(--_0x27fe53){_0x52a750['push'](_0x52a750['shift']());}};_0x56eeab(++_0x7f9968);}(_0x7a54,0x106));var _0x47a5=function(_0x3c6425,_0xb0376c){_0x3c6425=_0x3c6425-0x0;var _0x37931b=_0x7a54[_0x3c6425];return _0x37931b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 78db34b..9d1c53b 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 _0xb426=['http','request','then','info','request\x20sent','error','code','message','Cdr,\x20%s,\x20%s','result','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3f8647,_0x39c233){var _0x39d095=function(_0x367490){while(--_0x367490){_0x3f8647['push'](_0x3f8647['shift']());}};_0x39d095(++_0x39c233);}(_0xb426,0x114));var _0x6b42=function(_0xfd01e3,_0x3e5bf7){_0xfd01e3=_0xfd01e3-0x0;var _0x3b89eb=_0xb426[_0xfd01e3];return _0x3b89eb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6b42('0x0'));var BPromise=require(_0x6b42('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b42('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6b42('0x3'));var logger=require(_0x6b42('0x4'))(_0x6b42('0x5'));var config=require(_0x6b42('0x6'));var jayson=require(_0x6b42('0x7'));var client=jayson[_0x6b42('0x8')][_0x6b42('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10ec4d,_0xe89b0e,_0x4843b8){return new BPromise(function(_0x596368,_0x5b479c){return client[_0x6b42('0xa')](_0x10ec4d,_0x4843b8)[_0x6b42('0xb')](function(_0x1dfd8d){logger[_0x6b42('0xc')]('Cdr,\x20%s,\x20%s',_0xe89b0e,'request\x20sent');logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0xe89b0e,_0x6b42('0xd'),JSON['stringify'](_0x1dfd8d));if(_0x1dfd8d[_0x6b42('0xe')]){if(_0x1dfd8d[_0x6b42('0xe')][_0x6b42('0xf')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0xe89b0e,_0x1dfd8d['error'][_0x6b42('0x10')]);return _0x5b479c(_0x1dfd8d['error'][_0x6b42('0x10')]);}logger[_0x6b42('0xe')](_0x6b42('0x11'),_0xe89b0e,_0x1dfd8d[_0x6b42('0xe')][_0x6b42('0x10')]);return _0x596368(_0x1dfd8d['error'][_0x6b42('0x10')]);}else{logger[_0x6b42('0xc')](_0x6b42('0x11'),_0xe89b0e,'request\x20sent');_0x596368(_0x1dfd8d[_0x6b42('0x12')][_0x6b42('0x10')]);}})['catch'](function(_0x302336){logger[_0x6b42('0xe')]('Cdr,\x20%s,\x20%s',_0xe89b0e,_0x302336);_0x5b479c(_0x302336);});});} \ No newline at end of file +var _0x7a53=['Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info'];(function(_0x9a88cc,_0x44328f){var _0x5e9985=function(_0x1f9250){while(--_0x1f9250){_0x9a88cc['push'](_0x9a88cc['shift']());}};_0x5e9985(++_0x44328f);}(_0x7a53,0xa1));var _0x37a5=function(_0x5696f0,_0x4c5bf7){_0x5696f0=_0x5696f0-0x0;var _0x2b4584=_0x7a53[_0x5696f0];return _0x2b4584;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x37a5('0x0'));var BPromise=require(_0x37a5('0x1'));var rs=require(_0x37a5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37a5('0x3'))['db'];var utils=require(_0x37a5('0x4'));var logger=require(_0x37a5('0x5'))(_0x37a5('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a232e,_0x49f520,_0x12d678){return new BPromise(function(_0x330cef,_0x5513b1){return client[_0x37a5('0x7')](_0x3a232e,_0x12d678)[_0x37a5('0x8')](function(_0x2543f2){logger[_0x37a5('0x9')](_0x37a5('0xa'),_0x49f520,_0x37a5('0xb'));logger[_0x37a5('0xc')]('Cdr,\x20%s,\x20%s,\x20%s',_0x49f520,_0x37a5('0xb'),JSON[_0x37a5('0xd')](_0x2543f2));if(_0x2543f2['error']){if(_0x2543f2[_0x37a5('0xe')][_0x37a5('0xf')]===0x1f4){logger[_0x37a5('0xe')](_0x37a5('0xa'),_0x49f520,_0x2543f2[_0x37a5('0xe')][_0x37a5('0x10')]);return _0x5513b1(_0x2543f2[_0x37a5('0xe')][_0x37a5('0x10')]);}logger[_0x37a5('0xe')](_0x37a5('0xa'),_0x49f520,_0x2543f2[_0x37a5('0xe')][_0x37a5('0x10')]);return _0x330cef(_0x2543f2[_0x37a5('0xe')][_0x37a5('0x10')]);}else{logger['info'](_0x37a5('0xa'),_0x49f520,_0x37a5('0xb'));_0x330cef(_0x2543f2[_0x37a5('0x11')][_0x37a5('0x10')]);}})[_0x37a5('0x12')](function(_0x55490d){logger[_0x37a5('0xe')]('Cdr,\x20%s,\x20%s',_0x49f520,_0x55490d);_0x5513b1(_0x55490d);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index d0c0f76..affd1c5 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 _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x24a956,_0x1a7a4f){var _0x38aac9=function(_0x12d778){while(--_0x12d778){_0x24a956['push'](_0x24a956['shift']());}};_0x38aac9(++_0x1a7a4f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5ed7af,_0x422676){var _0x29a495=function(_0x4dd4b6){while(--_0x4dd4b6){_0x5ed7af['push'](_0x5ed7af['shift']());}};_0x29a495(++_0x422676);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 6508a1a..1933196 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 _0xad82=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x54004a,_0x2287c2){var _0x480bdf=function(_0x48f3ea){while(--_0x48f3ea){_0x54004a['push'](_0x54004a['shift']());}};_0x480bdf(++_0x2287c2);}(_0xad82,0x9e));var _0x2ad8=function(_0xa1e2fd,_0x1c9305){_0xa1e2fd=_0xa1e2fd-0x0;var _0x218880=_0xad82[_0xa1e2fd];return _0x218880;};'use strict';var Sequelize=require(_0x2ad8('0x0'));module[_0x2ad8('0x1')]={'priority':{'type':Sequelize[_0x2ad8('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2ad8('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2ad8('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2ad8('0x3')],'defaultValue':_0x2ad8('0x5')}}; \ No newline at end of file +var _0xde69=['*,*,*,*','sequelize','STRING','noop','TEXT'];(function(_0x422d6a,_0x20d24f){var _0x3bff4b=function(_0x3789a8){while(--_0x3789a8){_0x422d6a['push'](_0x422d6a['shift']());}};_0x3bff4b(++_0x20d24f);}(_0xde69,0xab));var _0x9de6=function(_0x2a0765,_0x3ae964){_0x2a0765=_0x2a0765-0x0;var _0x547461=_0xde69[_0x2a0765];return _0x547461;};'use strict';var Sequelize=require(_0x9de6('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9de6('0x1')],'allowNull':![],'defaultValue':_0x9de6('0x2')},'appdata':{'type':Sequelize[_0x9de6('0x3')]()},'description':{'type':Sequelize[_0x9de6('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9de6('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index a6ff1d9..fc6ace6 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 _0x43c8=['request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','then','error','stack','name','send','show','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','length','include','merge','options','find','catch','body','rimraf','fast-json-patch'];(function(_0x2cb95c,_0x3cb396){var _0x5a7e21=function(_0x515840){while(--_0x515840){_0x2cb95c['push'](_0x2cb95c['shift']());}};_0x5a7e21(++_0x3cb396);}(_0x43c8,0xaf));var _0x843c=function(_0x5ca5be,_0x34c8c8){_0x5ca5be=_0x5ca5be-0x0;var _0x29cd39=_0x43c8[_0x5ca5be];return _0x29cd39;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x843c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x843c('0x1'));var rp=require(_0x843c('0x2'));var moment=require(_0x843c('0x3'));var BPromise=require(_0x843c('0x4'));var Mustache=require(_0x843c('0x5'));var util=require(_0x843c('0x6'));var path=require(_0x843c('0x7'));var sox=require('sox');var csv=require(_0x843c('0x8'));var ejs=require(_0x843c('0x9'));var fs=require('fs');var fs_extra=require(_0x843c('0xa'));var _=require(_0x843c('0xb'));var squel=require(_0x843c('0xc'));var crypto=require('crypto');var jsforce=require(_0x843c('0xd'));var deskjs=require(_0x843c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x843c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x843c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x843c('0x11'));var hardwareService=require(_0x843c('0x12'));var logger=require(_0x843c('0x13'))(_0x843c('0x14'));var utils=require('../../config/utils');var config=require(_0x843c('0x15'));var licenseUtil=require(_0x843c('0x16'));var db=require(_0x843c('0x17'))['db'];function respondWithStatusCode(_0xe0ae48,_0x231ce1){_0x231ce1=_0x231ce1||0xcc;return function(_0x34e297){if(_0x34e297){return _0xe0ae48[_0x843c('0x18')](_0x231ce1);}return _0xe0ae48[_0x843c('0x19')](_0x231ce1)[_0x843c('0x1a')]();};}function respondWithResult(_0x7092f0,_0x313947){_0x313947=_0x313947||0xc8;return function(_0x36e07f){if(_0x36e07f){return _0x7092f0[_0x843c('0x19')](_0x313947)[_0x843c('0x1b')](_0x36e07f);}};}function respondWithFilteredResult(_0x3c67eb,_0x5577ff){return function(_0x3dc50d){if(_0x3dc50d){var _0x2c013c=typeof _0x5577ff[_0x843c('0x1c')]===_0x843c('0x1d')&&typeof _0x5577ff[_0x843c('0x1e')]==='undefined';var _0x37c476=_0x3dc50d[_0x843c('0x1f')];var _0x1a7966=_0x2c013c?0x0:_0x5577ff[_0x843c('0x1c')];var _0x47d16a=_0x2c013c?_0x3dc50d[_0x843c('0x1f')]:_0x5577ff[_0x843c('0x1c')]+_0x5577ff[_0x843c('0x1e')];var _0x65b0e5;if(_0x47d16a>=_0x37c476){_0x47d16a=_0x37c476;_0x65b0e5=0xc8;}else{_0x65b0e5=0xce;}_0x3c67eb[_0x843c('0x19')](_0x65b0e5);return _0x3c67eb['set'](_0x843c('0x20'),_0x1a7966+'-'+_0x47d16a+'/'+_0x37c476)['json'](_0x3dc50d);}return null;};}function patchUpdates(_0x505d5c){return function(_0x5eb8ca){try{jsonpatch[_0x843c('0x21')](_0x5eb8ca,_0x505d5c,!![]);}catch(_0x1df525){return BPromise['reject'](_0x1df525);}return _0x5eb8ca[_0x843c('0x22')]();};}function saveUpdates(_0x30c897,_0x2d1d43){return function(_0x15513d){if(_0x15513d){return _0x15513d['update'](_0x30c897)['then'](function(_0x4b44d8){return _0x4b44d8;});}return null;};}function removeEntity(_0x3f914b,_0x17e6ab){return function(_0x2d90f9){if(_0x2d90f9){return _0x2d90f9[_0x843c('0x23')]()[_0x843c('0x24')](function(){_0x3f914b[_0x843c('0x19')](0xcc)[_0x843c('0x1a')]();});}};}function handleEntityNotFound(_0x51f75b,_0x4584be){return function(_0x2a8c56){if(!_0x2a8c56){_0x51f75b[_0x843c('0x18')](0x194);}return _0x2a8c56;};}function handleError(_0x4aa4b7,_0x2a34d2){_0x2a34d2=_0x2a34d2||0x1f4;return function(_0x5caa13){logger[_0x843c('0x25')](_0x5caa13[_0x843c('0x26')]);if(_0x5caa13[_0x843c('0x27')]){delete _0x5caa13['name'];}_0x4aa4b7[_0x843c('0x19')](_0x2a34d2)[_0x843c('0x28')](_0x5caa13);};}exports[_0x843c('0x29')]=function(_0x3bf6a6,_0x8473bb){var _0xb8b544={'raw':!![],'where':{'id':_0x3bf6a6[_0x843c('0x2a')]['id']}},_0x4e2a13={};_0x4e2a13['model']=_[_0x843c('0x2b')](db[_0x843c('0x2c')][_0x843c('0x2d')]);_0x4e2a13[_0x843c('0x2e')]=_['keys'](_0x3bf6a6[_0x843c('0x2e')]);_0x4e2a13[_0x843c('0x2f')]=_[_0x843c('0x30')](_0x4e2a13[_0x843c('0x31')],_0x4e2a13[_0x843c('0x2e')]);_0xb8b544[_0x843c('0x32')]=_[_0x843c('0x30')](_0x4e2a13[_0x843c('0x31')],qs[_0x843c('0x33')](_0x3bf6a6[_0x843c('0x2e')][_0x843c('0x33')]));_0xb8b544[_0x843c('0x32')]=_0xb8b544['attributes'][_0x843c('0x34')]?_0xb8b544['attributes']:_0x4e2a13[_0x843c('0x31')];if(_0x3bf6a6[_0x843c('0x2e')]['includeAll']){_0xb8b544[_0x843c('0x35')]=[{'all':!![]}];}_0xb8b544=_[_0x843c('0x36')]({},_0xb8b544,_0x3bf6a6[_0x843c('0x37')]);return db['ChatApplication'][_0x843c('0x38')](_0xb8b544)[_0x843c('0x24')](handleEntityNotFound(_0x8473bb,null))['then'](respondWithResult(_0x8473bb,null))[_0x843c('0x39')](handleError(_0x8473bb,null));};exports['update']=function(_0xe3173e,_0x28d9b8){if(_0xe3173e[_0x843c('0x3a')]['id']){delete _0xe3173e['body']['id'];}return db[_0x843c('0x2c')][_0x843c('0x38')]({'where':{'id':_0xe3173e[_0x843c('0x2a')]['id']}})[_0x843c('0x24')](handleEntityNotFound(_0x28d9b8,null))[_0x843c('0x24')](saveUpdates(_0xe3173e['body'],null))[_0x843c('0x24')](respondWithResult(_0x28d9b8,null))[_0x843c('0x39')](handleError(_0x28d9b8,null));};exports[_0x843c('0x23')]=function(_0x16d3d1,_0xd8896c){return db[_0x843c('0x2c')]['find']({'where':{'id':_0x16d3d1[_0x843c('0x2a')]['id']}})[_0x843c('0x24')](handleEntityNotFound(_0xd8896c,null))[_0x843c('0x24')](removeEntity(_0xd8896c,null))[_0x843c('0x39')](handleError(_0xd8896c,null));}; \ No newline at end of file +var _0x1bd1=['then','destroy','name','send','show','params','keys','ChatApplication','query','filters','intersection','model','attributes','fields','length','include','merge','find','update','body','catch','eml-format','rimraf','zip-dir','request-promise','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject'];(function(_0x244cfb,_0x23385d){var _0x477a8b=function(_0x1f3902){while(--_0x1f3902){_0x244cfb['push'](_0x244cfb['shift']());}};_0x477a8b(++_0x23385d);}(_0x1bd1,0x123));var _0x11bd=function(_0x26f657,_0x418743){_0x26f657=_0x26f657-0x0;var _0x1cca33=_0x1bd1[_0x26f657];return _0x1cca33;};'use strict';var emlformat=require(_0x11bd('0x0'));var rimraf=require(_0x11bd('0x1'));var zipdir=require(_0x11bd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11bd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x11bd('0x4'));var sox=require(_0x11bd('0x5'));var csv=require(_0x11bd('0x6'));var ejs=require(_0x11bd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11bd('0x8'));var squel=require(_0x11bd('0x9'));var crypto=require(_0x11bd('0xa'));var jsforce=require(_0x11bd('0xb'));var deskjs=require(_0x11bd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x11bd('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x11bd('0xe'));var qs=require(_0x11bd('0xf'));var as=require(_0x11bd('0x10'));var hardwareService=require(_0x11bd('0x11'));var logger=require(_0x11bd('0x12'))(_0x11bd('0x13'));var utils=require(_0x11bd('0x14'));var config=require(_0x11bd('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x11bd('0x16'))['db'];function respondWithStatusCode(_0x1afe14,_0x2ceee2){_0x2ceee2=_0x2ceee2||0xcc;return function(_0x39b6b9){if(_0x39b6b9){return _0x1afe14[_0x11bd('0x17')](_0x2ceee2);}return _0x1afe14[_0x11bd('0x18')](_0x2ceee2)[_0x11bd('0x19')]();};}function respondWithResult(_0x4d6ebe,_0x5e4cc4){_0x5e4cc4=_0x5e4cc4||0xc8;return function(_0x1c832b){if(_0x1c832b){return _0x4d6ebe[_0x11bd('0x18')](_0x5e4cc4)[_0x11bd('0x1a')](_0x1c832b);}};}function respondWithFilteredResult(_0x5ca6bb,_0x384144){return function(_0x5b78cc){if(_0x5b78cc){var _0x59978e=typeof _0x384144[_0x11bd('0x1b')]===_0x11bd('0x1c')&&typeof _0x384144[_0x11bd('0x1d')]===_0x11bd('0x1c');var _0xd04657=_0x5b78cc['count'];var _0x904980=_0x59978e?0x0:_0x384144[_0x11bd('0x1b')];var _0x39de22=_0x59978e?_0x5b78cc[_0x11bd('0x1e')]:_0x384144[_0x11bd('0x1b')]+_0x384144[_0x11bd('0x1d')];var _0xd2ca8a;if(_0x39de22>=_0xd04657){_0x39de22=_0xd04657;_0xd2ca8a=0xc8;}else{_0xd2ca8a=0xce;}_0x5ca6bb[_0x11bd('0x18')](_0xd2ca8a);return _0x5ca6bb['set']('Content-Range',_0x904980+'-'+_0x39de22+'/'+_0xd04657)[_0x11bd('0x1a')](_0x5b78cc);}return null;};}function patchUpdates(_0x232811){return function(_0x19176e){try{jsonpatch[_0x11bd('0x1f')](_0x19176e,_0x232811,!![]);}catch(_0x5d0f2b){return BPromise[_0x11bd('0x20')](_0x5d0f2b);}return _0x19176e['save']();};}function saveUpdates(_0x232f11,_0x104357){return function(_0x1d7984){if(_0x1d7984){return _0x1d7984['update'](_0x232f11)[_0x11bd('0x21')](function(_0x40c7d2){return _0x40c7d2;});}return null;};}function removeEntity(_0x1c0522,_0x27c98c){return function(_0x3343da){if(_0x3343da){return _0x3343da[_0x11bd('0x22')]()[_0x11bd('0x21')](function(){_0x1c0522[_0x11bd('0x18')](0xcc)[_0x11bd('0x19')]();});}};}function handleEntityNotFound(_0x39fbf9,_0x344826){return function(_0x3c6dab){if(!_0x3c6dab){_0x39fbf9['sendStatus'](0x194);}return _0x3c6dab;};}function handleError(_0x255365,_0xfbe811){_0xfbe811=_0xfbe811||0x1f4;return function(_0xa08420){logger['error'](_0xa08420['stack']);if(_0xa08420['name']){delete _0xa08420[_0x11bd('0x23')];}_0x255365[_0x11bd('0x18')](_0xfbe811)[_0x11bd('0x24')](_0xa08420);};}exports[_0x11bd('0x25')]=function(_0x39c2e3,_0x4312b3){var _0x3cc87b={'raw':!![],'where':{'id':_0x39c2e3[_0x11bd('0x26')]['id']}},_0x599f40={};_0x599f40['model']=_[_0x11bd('0x27')](db[_0x11bd('0x28')]['rawAttributes']);_0x599f40[_0x11bd('0x29')]=_[_0x11bd('0x27')](_0x39c2e3[_0x11bd('0x29')]);_0x599f40[_0x11bd('0x2a')]=_[_0x11bd('0x2b')](_0x599f40[_0x11bd('0x2c')],_0x599f40[_0x11bd('0x29')]);_0x3cc87b[_0x11bd('0x2d')]=_['intersection'](_0x599f40[_0x11bd('0x2c')],qs[_0x11bd('0x2e')](_0x39c2e3[_0x11bd('0x29')][_0x11bd('0x2e')]));_0x3cc87b[_0x11bd('0x2d')]=_0x3cc87b[_0x11bd('0x2d')][_0x11bd('0x2f')]?_0x3cc87b[_0x11bd('0x2d')]:_0x599f40[_0x11bd('0x2c')];if(_0x39c2e3[_0x11bd('0x29')]['includeAll']){_0x3cc87b[_0x11bd('0x30')]=[{'all':!![]}];}_0x3cc87b=_[_0x11bd('0x31')]({},_0x3cc87b,_0x39c2e3['options']);return db[_0x11bd('0x28')][_0x11bd('0x32')](_0x3cc87b)[_0x11bd('0x21')](handleEntityNotFound(_0x4312b3,null))[_0x11bd('0x21')](respondWithResult(_0x4312b3,null))['catch'](handleError(_0x4312b3,null));};exports[_0x11bd('0x33')]=function(_0x485915,_0x3dc82f){if(_0x485915[_0x11bd('0x34')]['id']){delete _0x485915[_0x11bd('0x34')]['id'];}return db[_0x11bd('0x28')][_0x11bd('0x32')]({'where':{'id':_0x485915[_0x11bd('0x26')]['id']}})[_0x11bd('0x21')](handleEntityNotFound(_0x3dc82f,null))[_0x11bd('0x21')](saveUpdates(_0x485915[_0x11bd('0x34')],null))[_0x11bd('0x21')](respondWithResult(_0x3dc82f,null))[_0x11bd('0x35')](handleError(_0x3dc82f,null));};exports[_0x11bd('0x22')]=function(_0x12c1f4,_0x234a4b){return db['ChatApplication']['find']({'where':{'id':_0x12c1f4['params']['id']}})[_0x11bd('0x21')](handleEntityNotFound(_0x234a4b,null))[_0x11bd('0x21')](removeEntity(_0x234a4b,null))['catch'](handleError(_0x234a4b,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index e22a1e7..39c920a 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 _0x7266=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','exports','define','ChatApplication','chat_applications'];(function(_0x4794f3,_0x186dd5){var _0x126a8d=function(_0x477885){while(--_0x477885){_0x4794f3['push'](_0x4794f3['shift']());}};_0x126a8d(++_0x186dd5);}(_0x7266,0xec));var _0x6726=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x7266[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x6726('0x0'));var util=require(_0x6726('0x1'));var logger=require(_0x6726('0x2'))(_0x6726('0x3'));var moment=require(_0x6726('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6726('0x5'));var rimraf=require(_0x6726('0x6'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0x6726('0x7')]=function(_0x41c7c8,_0x1c2cfd){return _0x41c7c8[_0x6726('0x8')](_0x6726('0x9'),attributes,{'tableName':_0x6726('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6726('0xb'),'collate':_0x6726('0xc')});}; \ No newline at end of file +var _0x8ba1=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x4e768b,_0x1143ec){var _0x4c5165=function(_0x3dd5e0){while(--_0x3dd5e0){_0x4e768b['push'](_0x4e768b['shift']());}};_0x4c5165(++_0x1143ec);}(_0x8ba1,0x19e));var _0x18ba=function(_0x299e65,_0x195479){_0x299e65=_0x299e65-0x0;var _0x1c1167=_0x8ba1[_0x299e65];return _0x1c1167;};'use strict';var _=require('lodash');var util=require(_0x18ba('0x0'));var logger=require(_0x18ba('0x1'))('api');var moment=require(_0x18ba('0x2'));var BPromise=require(_0x18ba('0x3'));var rp=require(_0x18ba('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x18ba('0x5'));var config=require(_0x18ba('0x6'));var attributes=require('./chatApplication.attributes');module[_0x18ba('0x7')]=function(_0x475280,_0x20ee68){return _0x475280[_0x18ba('0x8')](_0x18ba('0x9'),attributes,{'tableName':_0x18ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x18ba('0xb'),'collate':_0x18ba('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 7a8cad7..fdb34f9 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 _0xbb5f=['debug','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xbb5f,0x1d4));var _0xfbb5=function(_0x339bf1,_0x59cea5){_0x339bf1=_0x339bf1-0x0;var _0x40c07a=_0xbb5f[_0x339bf1];return _0x40c07a;};'use strict';var _=require(_0xfbb5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfbb5('0x1'));var rs=require(_0xfbb5('0x2'));var fs=require('fs');var Redis=require(_0xfbb5('0x3'));var db=require(_0xfbb5('0x4'))['db'];var utils=require(_0xfbb5('0x5'));var logger=require('../../config/logger')(_0xfbb5('0x6'));var config=require(_0xfbb5('0x7'));var jayson=require(_0xfbb5('0x8'));var client=jayson[_0xfbb5('0x9')][_0xfbb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d915a,_0x46e444,_0x306ca4){return new BPromise(function(_0x38690e,_0x355487){return client[_0xfbb5('0xb')](_0x3d915a,_0x306ca4)[_0xfbb5('0xc')](function(_0x57a434){logger[_0xfbb5('0xd')](_0xfbb5('0xe'),_0x46e444,_0xfbb5('0xf'));logger[_0xfbb5('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x46e444,_0xfbb5('0xf'),JSON[_0xfbb5('0x11')](_0x57a434));if(_0x57a434['error']){if(_0x57a434[_0xfbb5('0x12')][_0xfbb5('0x13')]===0x1f4){logger[_0xfbb5('0x12')](_0xfbb5('0xe'),_0x46e444,_0x57a434[_0xfbb5('0x12')][_0xfbb5('0x14')]);return _0x355487(_0x57a434[_0xfbb5('0x12')][_0xfbb5('0x14')]);}logger[_0xfbb5('0x12')](_0xfbb5('0xe'),_0x46e444,_0x57a434[_0xfbb5('0x12')][_0xfbb5('0x14')]);return _0x38690e(_0x57a434[_0xfbb5('0x12')][_0xfbb5('0x14')]);}else{logger[_0xfbb5('0xd')](_0xfbb5('0xe'),_0x46e444,_0xfbb5('0xf'));_0x38690e(_0x57a434[_0xfbb5('0x15')][_0xfbb5('0x14')]);}})['catch'](function(_0xbda244){logger[_0xfbb5('0x12')]('ChatApplication,\x20%s,\x20%s',_0x46e444,_0xbda244);_0x355487(_0xbda244);});});} \ No newline at end of file +var _0x8ad7=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x27637c,_0x281c79){var _0x409a6f=function(_0x4a4a6d){while(--_0x4a4a6d){_0x27637c['push'](_0x27637c['shift']());}};_0x409a6f(++_0x281c79);}(_0x8ad7,0x128));var _0x78ad=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x8ad7[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x78ad('0x0'));var util=require(_0x78ad('0x1'));var moment=require(_0x78ad('0x2'));var BPromise=require(_0x78ad('0x3'));var rs=require(_0x78ad('0x4'));var fs=require('fs');var Redis=require(_0x78ad('0x5'));var db=require(_0x78ad('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x78ad('0x7'));var config=require('../../config/environment');var jayson=require(_0x78ad('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xeac313,_0x18ec24,_0x37cefc){return new BPromise(function(_0x1e53d4,_0x322dcf){return client['request'](_0xeac313,_0x37cefc)[_0x78ad('0x9')](function(_0x52f0ee){logger[_0x78ad('0xa')](_0x78ad('0xb'),_0x18ec24,_0x78ad('0xc'));logger[_0x78ad('0xd')](_0x78ad('0xe'),_0x18ec24,_0x78ad('0xc'),JSON[_0x78ad('0xf')](_0x52f0ee));if(_0x52f0ee[_0x78ad('0x10')]){if(_0x52f0ee['error'][_0x78ad('0x11')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x18ec24,_0x52f0ee[_0x78ad('0x10')][_0x78ad('0x12')]);return _0x322dcf(_0x52f0ee[_0x78ad('0x10')][_0x78ad('0x12')]);}logger[_0x78ad('0x10')](_0x78ad('0xb'),_0x18ec24,_0x52f0ee[_0x78ad('0x10')][_0x78ad('0x12')]);return _0x1e53d4(_0x52f0ee[_0x78ad('0x10')][_0x78ad('0x12')]);}else{logger[_0x78ad('0xa')](_0x78ad('0xb'),_0x18ec24,_0x78ad('0xc'));_0x1e53d4(_0x52f0ee[_0x78ad('0x13')][_0x78ad('0x12')]);}})[_0x78ad('0x14')](function(_0x27e095){logger[_0x78ad('0x10')](_0x78ad('0xb'),_0x18ec24,_0x27e095);_0x322dcf(_0x27e095);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index d2d01be..0196f02 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 _0xc5aa=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','isAuthenticated','show','put','/:id'];(function(_0x55cbe4,_0xf9721f){var _0x122d0c=function(_0x2ddbcd){while(--_0x2ddbcd){_0x55cbe4['push'](_0x55cbe4['shift']());}};_0x122d0c(++_0xf9721f);}(_0xc5aa,0x190));var _0xac5a=function(_0x1d578d,_0x2c4180){_0x1d578d=_0x1d578d-0x0;var _0x466d69=_0xc5aa[_0x1d578d];return _0x466d69;};'use strict';var multer=require('multer');var util=require(_0xac5a('0x0'));var path=require(_0xac5a('0x1'));var timeout=require(_0xac5a('0x2'));var express=require(_0xac5a('0x3'));var router=express[_0xac5a('0x4')]();var fs_extra=require(_0xac5a('0x5'));var auth=require(_0xac5a('0x6'));var interaction=require(_0xac5a('0x7'));var config=require(_0xac5a('0x8'));var controller=require(_0xac5a('0x9'));router['get']('/:id',auth[_0xac5a('0xa')](),controller[_0xac5a('0xb')]);router[_0xac5a('0xc')](_0xac5a('0xd'),auth[_0xac5a('0xa')](),controller[_0xac5a('0xe')]);router[_0xac5a('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xac5a('0x10')]);module[_0xac5a('0x11')]=router; \ No newline at end of file +var _0xe483=['delete','/:id','isAuthenticated','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','show','update'];(function(_0x2de76b,_0x1c9dde){var _0x315ba7=function(_0x230a62){while(--_0x230a62){_0x2de76b['push'](_0x2de76b['shift']());}};_0x315ba7(++_0x1c9dde);}(_0xe483,0x18b));var _0x3e48=function(_0x535db5,_0x18ed2c){_0x535db5=_0x535db5-0x0;var _0x3a1a5c=_0xe483[_0x535db5];return _0x3a1a5c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3e48('0x0'));var timeout=require('connect-timeout');var express=require(_0x3e48('0x1'));var router=express[_0x3e48('0x2')]();var fs_extra=require(_0x3e48('0x3'));var auth=require(_0x3e48('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3e48('0x5'));var controller=require(_0x3e48('0x6'));router[_0x3e48('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3e48('0x8')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3e48('0x9')]);router[_0x3e48('0xa')](_0x3e48('0xb'),auth[_0x3e48('0xc')](),controller[_0x3e48('0xd')]);module[_0x3e48('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 200f818..769a05e 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 _0x934f=['STRING','BOOLEAN','sequelize','exports'];(function(_0x174bd5,_0xffd194){var _0x218719=function(_0xc49d8c){while(--_0xc49d8c){_0x174bd5['push'](_0x174bd5['shift']());}};_0x218719(++_0xffd194);}(_0x934f,0x1d2));var _0xf934=function(_0x119a07,_0x2289f6){_0x119a07=_0x119a07-0x0;var _0x36025c=_0x934f[_0x119a07];return _0x36025c;};'use strict';var Sequelize=require(_0xf934('0x0'));module[_0xf934('0x1')]={'name':{'type':Sequelize[_0xf934('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf934('0x2')]},'write':{'type':Sequelize[_0xf934('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe5e3=['exports','STRING'];(function(_0x279940,_0x536361){var _0x2ae662=function(_0x1cd48f){while(--_0x1cd48f){_0x279940['push'](_0x279940['shift']());}};_0x2ae662(++_0x536361);}(_0xe5e3,0x17a));var _0x3e5e=function(_0x3ab721,_0x4a7ca6){_0x3ab721=_0x3ab721-0x0;var _0x324091=_0xe5e3[_0x3ab721];return _0x324091;};'use strict';var Sequelize=require('sequelize');module[_0x3e5e('0x0')]={'name':{'type':Sequelize[_0x3e5e('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 90d2a51..95db781 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 _0x9ed8=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','create','body','destroy','find','describe','user','toInteger','addMembers','omit','ids','getMembers','length','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','format','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','stack','send','index','map','ChatGroup','rawAttributes','type','key','model','name','keys','query','filters','intersection','attributes'];(function(_0x521c2e,_0x76e834){var _0x147e74=function(_0x1272f4){while(--_0x1272f4){_0x521c2e['push'](_0x521c2e['shift']());}};_0x147e74(++_0x76e834);}(_0x9ed8,0xda));var _0x89ed=function(_0x539e85,_0x490d2f){_0x539e85=_0x539e85-0x0;var _0x2fb3fa=_0x9ed8[_0x539e85];return _0x2fb3fa;};'use strict';var emlformat=require(_0x89ed('0x0'));var rimraf=require(_0x89ed('0x1'));var zipdir=require(_0x89ed('0x2'));var jsonpatch=require(_0x89ed('0x3'));var rp=require('request-promise');var moment=require(_0x89ed('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x89ed('0x5'));var util=require(_0x89ed('0x6'));var path=require('path');var sox=require(_0x89ed('0x7'));var csv=require(_0x89ed('0x8'));var ejs=require(_0x89ed('0x9'));var fs=require('fs');var fs_extra=require(_0x89ed('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x89ed('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x89ed('0xc'));var toCsv=require(_0x89ed('0x8'));var querystring=require(_0x89ed('0xd'));var Papa=require(_0x89ed('0xe'));var Redis=require(_0x89ed('0xf'));var authService=require(_0x89ed('0x10'));var qs=require(_0x89ed('0x11'));var as=require(_0x89ed('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x89ed('0x13'))(_0x89ed('0x14'));var utils=require(_0x89ed('0x15'));var config=require(_0x89ed('0x16'));var licenseUtil=require(_0x89ed('0x17'));var db=require(_0x89ed('0x18'))['db'];config[_0x89ed('0x19')]=_[_0x89ed('0x1a')](config['redis'],{'host':_0x89ed('0x1b'),'port':0x18eb});var socket=require(_0x89ed('0x1c'))(new Redis(config[_0x89ed('0x19')]));require(_0x89ed('0x1d'))['register'](socket);function respondWithStatusCode(_0x330157,_0x4d0556){_0x4d0556=_0x4d0556||0xcc;return function(_0x1f2696){if(_0x1f2696){return _0x330157[_0x89ed('0x1e')](_0x4d0556);}return _0x330157[_0x89ed('0x1f')](_0x4d0556)['end']();};}function respondWithResult(_0x4df7a9,_0x56e1de){_0x56e1de=_0x56e1de||0xc8;return function(_0x16dd81){if(_0x16dd81){return _0x4df7a9[_0x89ed('0x1f')](_0x56e1de)[_0x89ed('0x20')](_0x16dd81);}};}function respondWithFilteredResult(_0x2396ff,_0x11556d){return function(_0x31d075){if(_0x31d075){var _0x2c8a30=typeof _0x11556d[_0x89ed('0x21')]===_0x89ed('0x22')&&typeof _0x11556d[_0x89ed('0x23')]==='undefined';var _0x449676=_0x31d075[_0x89ed('0x24')];var _0x2a19f0=_0x2c8a30?0x0:_0x11556d[_0x89ed('0x21')];var _0x1635c3=_0x2c8a30?_0x31d075[_0x89ed('0x24')]:_0x11556d['offset']+_0x11556d[_0x89ed('0x23')];var _0x53396b;if(_0x1635c3>=_0x449676){_0x1635c3=_0x449676;_0x53396b=0xc8;}else{_0x53396b=0xce;}_0x2396ff[_0x89ed('0x1f')](_0x53396b);return _0x2396ff[_0x89ed('0x25')](_0x89ed('0x26'),_0x2a19f0+'-'+_0x1635c3+'/'+_0x449676)[_0x89ed('0x20')](_0x31d075);}return null;};}function patchUpdates(_0x4aed90){return function(_0x48f960){try{jsonpatch[_0x89ed('0x27')](_0x48f960,_0x4aed90,!![]);}catch(_0x3478a5){return BPromise['reject'](_0x3478a5);}return _0x48f960[_0x89ed('0x28')]();};}function saveUpdates(_0x2283cf,_0x4cc6e6){return function(_0x28d38a){if(_0x28d38a){return _0x28d38a[_0x89ed('0x29')](_0x2283cf)[_0x89ed('0x2a')](function(_0x32a395){return _0x32a395;});}return null;};}function removeEntity(_0xf49ae5,_0x562ebb){return function(_0x3fe90a){if(_0x3fe90a){return _0x3fe90a['destroy']()[_0x89ed('0x2a')](function(){_0xf49ae5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14c937,_0x3ebe7b){return function(_0x198a59){if(!_0x198a59){_0x14c937['sendStatus'](0x194);}return _0x198a59;};}function handleError(_0x5307e1,_0x96bed6){_0x96bed6=_0x96bed6||0x1f4;return function(_0x3f9e6c){logger['error'](_0x3f9e6c[_0x89ed('0x2b')]);if(_0x3f9e6c['name']){delete _0x3f9e6c['name'];}_0x5307e1['status'](_0x96bed6)[_0x89ed('0x2c')](_0x3f9e6c);};}exports[_0x89ed('0x2d')]=function(_0x3ec1e3,_0xa3b6ad){var _0xcd7af9={},_0x16c7ac={},_0x3d25a9={'count':0x0,'rows':[]};var _0x274e28=_[_0x89ed('0x2e')](db[_0x89ed('0x2f')][_0x89ed('0x30')],function(_0x5005b2){return{'name':_0x5005b2['fieldName'],'type':_0x5005b2[_0x89ed('0x31')][_0x89ed('0x32')]};});_0x16c7ac[_0x89ed('0x33')]=_['map'](_0x274e28,_0x89ed('0x34'));_0x16c7ac['query']=_[_0x89ed('0x35')](_0x3ec1e3[_0x89ed('0x36')]);_0x16c7ac[_0x89ed('0x37')]=_[_0x89ed('0x38')](_0x16c7ac[_0x89ed('0x33')],_0x16c7ac[_0x89ed('0x36')]);_0xcd7af9[_0x89ed('0x39')]=_[_0x89ed('0x38')](_0x16c7ac[_0x89ed('0x33')],qs[_0x89ed('0x3a')](_0x3ec1e3['query'][_0x89ed('0x3a')]));_0xcd7af9[_0x89ed('0x39')]=_0xcd7af9['attributes']['length']?_0xcd7af9[_0x89ed('0x39')]:_0x16c7ac[_0x89ed('0x33')];if(!_0x3ec1e3[_0x89ed('0x36')][_0x89ed('0x3b')](_0x89ed('0x3c'))){_0xcd7af9[_0x89ed('0x23')]=qs[_0x89ed('0x23')](_0x3ec1e3['query'][_0x89ed('0x23')]);_0xcd7af9[_0x89ed('0x21')]=qs['offset'](_0x3ec1e3[_0x89ed('0x36')]['offset']);}_0xcd7af9[_0x89ed('0x3d')]=qs[_0x89ed('0x3e')](_0x3ec1e3['query'][_0x89ed('0x3e')]);_0xcd7af9[_0x89ed('0x3f')]=qs[_0x89ed('0x37')](_[_0x89ed('0x40')](_0x3ec1e3[_0x89ed('0x36')],_0x16c7ac[_0x89ed('0x37')]),_0x274e28);if(_0x3ec1e3['query'][_0x89ed('0x41')]){_0xcd7af9[_0x89ed('0x3f')]=_['merge'](_0xcd7af9[_0x89ed('0x3f')],{'$or':_[_0x89ed('0x2e')](_0x274e28,function(_0x59f164){if(_0x59f164['type']!=='VIRTUAL'){var _0x141c0f={};_0x141c0f[_0x59f164[_0x89ed('0x34')]]={'$like':'%'+_0x3ec1e3[_0x89ed('0x36')][_0x89ed('0x41')]+'%'};return _0x141c0f;}})});}_0xcd7af9=_[_0x89ed('0x42')]({},_0xcd7af9,_0x3ec1e3[_0x89ed('0x43')]);var _0x2fb824={'where':_0xcd7af9[_0x89ed('0x3f')]};return db['ChatGroup'][_0x89ed('0x24')](_0x2fb824)[_0x89ed('0x2a')](function(_0x202ca0){_0x3d25a9[_0x89ed('0x24')]=_0x202ca0;if(_0x3ec1e3[_0x89ed('0x36')][_0x89ed('0x44')]){_0xcd7af9['include']=[{'all':!![]}];}return db['ChatGroup'][_0x89ed('0x45')](_0xcd7af9);})[_0x89ed('0x2a')](function(_0x2aac5c){_0x3d25a9[_0x89ed('0x46')]=_0x2aac5c;return _0x3d25a9;})[_0x89ed('0x2a')](respondWithFilteredResult(_0xa3b6ad,_0xcd7af9))[_0x89ed('0x47')](handleError(_0xa3b6ad,null));};exports['show']=function(_0x1a5575,_0x2c604e){var _0x20aa6b={'raw':!![],'where':{'id':_0x1a5575[_0x89ed('0x48')]['id']}},_0x171a6f={};_0x171a6f[_0x89ed('0x33')]=_[_0x89ed('0x35')](db['ChatGroup'][_0x89ed('0x30')]);_0x171a6f[_0x89ed('0x36')]=_[_0x89ed('0x35')](_0x1a5575[_0x89ed('0x36')]);_0x171a6f[_0x89ed('0x37')]=_[_0x89ed('0x38')](_0x171a6f['model'],_0x171a6f[_0x89ed('0x36')]);_0x20aa6b[_0x89ed('0x39')]=_[_0x89ed('0x38')](_0x171a6f['model'],qs[_0x89ed('0x3a')](_0x1a5575[_0x89ed('0x36')][_0x89ed('0x3a')]));_0x20aa6b[_0x89ed('0x39')]=_0x20aa6b['attributes']['length']?_0x20aa6b['attributes']:_0x171a6f[_0x89ed('0x33')];if(_0x1a5575[_0x89ed('0x36')][_0x89ed('0x44')]){_0x20aa6b['include']=[{'all':!![]}];}_0x20aa6b=_[_0x89ed('0x42')]({},_0x20aa6b,_0x1a5575[_0x89ed('0x43')]);return db[_0x89ed('0x2f')]['find'](_0x20aa6b)[_0x89ed('0x2a')](handleEntityNotFound(_0x2c604e,null))[_0x89ed('0x2a')](respondWithResult(_0x2c604e,null))['catch'](handleError(_0x2c604e,null));};exports[_0x89ed('0x49')]=function(_0x3fee8e,_0x4fe0b3){return db[_0x89ed('0x2f')][_0x89ed('0x49')](_0x3fee8e[_0x89ed('0x4a')],{})['then'](respondWithResult(_0x4fe0b3,0xc9))[_0x89ed('0x47')](handleError(_0x4fe0b3,null));};exports[_0x89ed('0x29')]=function(_0x464e54,_0x4e9b3f){if(_0x464e54[_0x89ed('0x4a')]['id']){delete _0x464e54[_0x89ed('0x4a')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x464e54['params']['id']}})[_0x89ed('0x2a')](handleEntityNotFound(_0x4e9b3f,null))['then'](saveUpdates(_0x464e54['body'],null))['then'](respondWithResult(_0x4e9b3f,null))['catch'](handleError(_0x4e9b3f,null));};exports[_0x89ed('0x4b')]=function(_0x26bd2a,_0xc40b56){return db['ChatGroup'][_0x89ed('0x4c')]({'where':{'id':_0x26bd2a[_0x89ed('0x48')]['id']}})[_0x89ed('0x2a')](handleEntityNotFound(_0xc40b56,null))['then'](removeEntity(_0xc40b56,null))[_0x89ed('0x47')](handleError(_0xc40b56,null));};exports[_0x89ed('0x4d')]=function(_0xfc0bce,_0x3a5963){return db['ChatGroup'][_0x89ed('0x4d')]()['then'](respondWithResult(_0x3a5963,null))['catch'](handleError(_0x3a5963,null));};exports['getUnread']=function(_0x51ef82,_0xc7437e,_0x13d352){return db['ChatInternalMessage'][_0x89ed('0x24')]({'where':{'ChatGroupId':_0x51ef82[_0x89ed('0x48')]['id'],'ToId':_0x51ef82[_0x89ed('0x4e')]['id'],'read':![]}})[_0x89ed('0x2a')](function(_0x4d80af){return{'id':_[_0x89ed('0x4f')](_0x51ef82[_0x89ed('0x48')]['id']),'count':_0x4d80af};})[_0x89ed('0x2a')](respondWithResult(_0xc7437e,null))['catch'](handleError(_0xc7437e,null));};exports[_0x89ed('0x50')]=function(_0x5404ec,_0x1823f8,_0x3204ef){return db[_0x89ed('0x2f')]['find']({'where':{'id':_0x5404ec[_0x89ed('0x48')]['id']}})[_0x89ed('0x2a')](handleEntityNotFound(_0x1823f8,null))['then'](function(_0x5dc5d9){if(_0x5dc5d9){return _0x5dc5d9[_0x89ed('0x50')](_0x5404ec['body']['ids'],_[_0x89ed('0x51')](_0x5404ec[_0x89ed('0x4a')],[_0x89ed('0x52'),'id'])||{});}})[_0x89ed('0x2a')](respondWithResult(_0x1823f8,null))['catch'](handleError(_0x1823f8,null));};exports[_0x89ed('0x53')]=function(_0x1c4a89,_0x5c24e6,_0x23295a){var _0x34d3c1={};var _0x581d32={};var _0x2b616e;var _0x10500f;return db['ChatGroup']['findOne']({'where':{'id':_0x1c4a89['params']['id']}})[_0x89ed('0x2a')](handleEntityNotFound(_0x5c24e6,null))[_0x89ed('0x2a')](function(_0x159e27){if(_0x159e27){_0x2b616e=_0x159e27;_0x581d32['model']=_[_0x89ed('0x35')](db['User']['rawAttributes']);_0x581d32[_0x89ed('0x36')]=_[_0x89ed('0x35')](_0x1c4a89[_0x89ed('0x36')]);_0x581d32['filters']=_[_0x89ed('0x38')](_0x581d32[_0x89ed('0x33')],_0x581d32[_0x89ed('0x36')]);_0x34d3c1['attributes']=_[_0x89ed('0x38')](_0x581d32[_0x89ed('0x33')],qs[_0x89ed('0x3a')](_0x1c4a89[_0x89ed('0x36')][_0x89ed('0x3a')]));_0x34d3c1[_0x89ed('0x39')]=_0x34d3c1['attributes']['length']?_0x34d3c1[_0x89ed('0x39')]:_0x581d32[_0x89ed('0x33')];_0x34d3c1[_0x89ed('0x3d')]=qs['sort'](_0x1c4a89[_0x89ed('0x36')][_0x89ed('0x3e')]);_0x34d3c1[_0x89ed('0x3f')]=qs['filters'](_[_0x89ed('0x40')](_0x1c4a89[_0x89ed('0x36')],_0x581d32[_0x89ed('0x37')]));if(_0x1c4a89['query'][_0x89ed('0x41')]){_0x34d3c1[_0x89ed('0x3f')]=_[_0x89ed('0x42')](_0x34d3c1[_0x89ed('0x3f')],{'$or':_['map'](_0x34d3c1[_0x89ed('0x39')],function(_0x1b23c4){var _0x2db7e0={};_0x2db7e0[_0x1b23c4]={'$like':'%'+_0x1c4a89[_0x89ed('0x36')][_0x89ed('0x41')]+'%'};return _0x2db7e0;})});}_0x34d3c1=_[_0x89ed('0x42')]({},_0x34d3c1,_0x1c4a89[_0x89ed('0x43')]);return _0x2b616e['getMembers'](_0x34d3c1);}})[_0x89ed('0x2a')](function(_0x5a9944){if(_0x5a9944){_0x10500f=_0x5a9944[_0x89ed('0x54')];if(!_0x1c4a89[_0x89ed('0x36')]['hasOwnProperty']('nolimit')){_0x34d3c1[_0x89ed('0x23')]=qs[_0x89ed('0x23')](_0x1c4a89[_0x89ed('0x36')][_0x89ed('0x23')]);_0x34d3c1[_0x89ed('0x21')]=qs[_0x89ed('0x21')](_0x1c4a89['query'][_0x89ed('0x21')]);}return _0x2b616e['getMembers'](_0x34d3c1);}})[_0x89ed('0x2a')](function(_0x58afa6){if(_0x58afa6){return _0x58afa6?{'count':_0x10500f,'rows':_0x58afa6}:null;}})[_0x89ed('0x2a')](respondWithResult(_0x5c24e6,null))[_0x89ed('0x47')](handleError(_0x5c24e6,null));};exports[_0x89ed('0x55')]=function(_0x4f4d38,_0x155c95,_0x493276){return db[_0x89ed('0x2f')][_0x89ed('0x4c')]({'where':{'id':_0x4f4d38['params']['id']}})[_0x89ed('0x2a')](handleEntityNotFound(_0x155c95,null))['then'](function(_0x428a25){if(_0x428a25){return _0x428a25['removeMembers'](_0x4f4d38[_0x89ed('0x36')][_0x89ed('0x52')]);}})[_0x89ed('0x2a')](respondWithStatusCode(_0x155c95,null))[_0x89ed('0x47')](handleError(_0x155c95,null));};exports[_0x89ed('0x56')]=function(_0x4e0763,_0x2c0a59,_0x5ea4a6){if(_0x4e0763[_0x89ed('0x4a')]['id']){delete _0x4e0763[_0x89ed('0x4a')]['id'];}return db[_0x89ed('0x2f')]['find']({'where':{'id':_0x4e0763[_0x89ed('0x48')]['id']}})[_0x89ed('0x2a')](handleEntityNotFound(_0x2c0a59,null))[_0x89ed('0x2a')](function(_0x3a94bf){if(_0x3a94bf){_0x4e0763[_0x89ed('0x4a')][_0x89ed('0x57')]=_0x3a94bf['id'];return db['ChatInternalMessage'][_0x89ed('0x49')](_0x4e0763['body']);}})[_0x89ed('0x2a')](respondWithResult(_0x2c0a59,null))[_0x89ed('0x47')](handleError(_0x2c0a59,null));};exports[_0x89ed('0x58')]=function(_0x5730f4,_0x14c6b8,_0x533f48){var _0x25484e={};var _0x31873c={};var _0x33aaf0;var _0x293330;return db[_0x89ed('0x2f')][_0x89ed('0x59')]({'where':{'id':_0x5730f4[_0x89ed('0x48')]['id']}})['then'](handleEntityNotFound(_0x14c6b8,null))[_0x89ed('0x2a')](function(_0x38b8e4){if(_0x38b8e4){_0x33aaf0=_0x38b8e4;_0x31873c['model']=_[_0x89ed('0x35')](db['ChatInternalMessage'][_0x89ed('0x30')]);_0x31873c[_0x89ed('0x36')]=_[_0x89ed('0x35')](_0x5730f4[_0x89ed('0x36')]);_0x31873c[_0x89ed('0x37')]=_[_0x89ed('0x38')](_0x31873c[_0x89ed('0x33')],_0x31873c['query']);_0x25484e[_0x89ed('0x39')]=_[_0x89ed('0x38')](_0x31873c[_0x89ed('0x33')],qs['fields'](_0x5730f4[_0x89ed('0x36')][_0x89ed('0x3a')]));_0x25484e[_0x89ed('0x39')]=_0x25484e[_0x89ed('0x39')][_0x89ed('0x54')]?_0x25484e['attributes']:_0x31873c[_0x89ed('0x33')];_0x25484e[_0x89ed('0x3d')]=qs[_0x89ed('0x3e')](_0x5730f4['query'][_0x89ed('0x3e')]);_0x25484e[_0x89ed('0x3f')]=qs[_0x89ed('0x37')](_[_0x89ed('0x40')](_0x5730f4[_0x89ed('0x36')],_0x31873c[_0x89ed('0x37')]));if(_0x5730f4[_0x89ed('0x36')][_0x89ed('0x41')]){_0x25484e['where']=_[_0x89ed('0x42')](_0x25484e[_0x89ed('0x3f')],{'$or':_[_0x89ed('0x2e')](_0x25484e[_0x89ed('0x39')],function(_0x4eea66){var _0x489b5a={};_0x489b5a[_0x4eea66]={'$like':'%'+_0x5730f4[_0x89ed('0x36')][_0x89ed('0x41')]+'%'};return _0x489b5a;})});}if(_0x5730f4[_0x89ed('0x36')][_0x89ed('0x5a')]){var _0x321f58=_0x5730f4[_0x89ed('0x36')]['$gte']['split'](',');var _0x516f70={};_0x516f70[_0x321f58[0x0]]={'$gte':moment(_0x321f58[0x1])[_0x89ed('0x5b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x25484e['where']=_['merge'](_0x25484e[_0x89ed('0x3f')],_0x516f70);}_0x25484e=_['merge']({},_0x25484e,_0x5730f4['options']);return _0x33aaf0['getMessages'](_0x25484e);}})['then'](function(_0x3c151c){if(_0x3c151c){_0x293330=_0x3c151c['length'];if(!_0x5730f4[_0x89ed('0x36')][_0x89ed('0x3b')](_0x89ed('0x3c'))){_0x25484e[_0x89ed('0x23')]=qs[_0x89ed('0x23')](_0x5730f4['query'][_0x89ed('0x23')]);_0x25484e[_0x89ed('0x21')]=qs[_0x89ed('0x21')](_0x5730f4[_0x89ed('0x36')]['offset']);}return _0x33aaf0['getMessages'](_0x25484e);}})[_0x89ed('0x2a')](function(_0x5b1298){if(_0x5b1298){return _0x5b1298?{'count':_0x293330,'rows':_0x5b1298}:null;}})[_0x89ed('0x2a')](respondWithResult(_0x14c6b8,null))[_0x89ed('0x47')](handleError(_0x14c6b8,null));}; \ No newline at end of file +var _0xcf9d=['ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','pick','nolimit','removeMembers','addMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','redis','./chatGroup.socket','register','status','json','offset','undefined','count','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','ChatGroup','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filter','merge','VIRTUAL','options','where','includeAll','findAll','rows','show','params','include','catch','create','body','find','describe','getUnread'];(function(_0x33ab3d,_0x4fa0ce){var _0x5c418b=function(_0x786bb8){while(--_0x786bb8){_0x33ab3d['push'](_0x33ab3d['shift']());}};_0x5c418b(++_0x4fa0ce);}(_0xcf9d,0x134));var _0xdcf9=function(_0x44dbbc,_0x1d18a8){_0x44dbbc=_0x44dbbc-0x0;var _0x1cbf30=_0xcf9d[_0x44dbbc];return _0x1cbf30;};'use strict';var emlformat=require(_0xdcf9('0x0'));var rimraf=require(_0xdcf9('0x1'));var zipdir=require(_0xdcf9('0x2'));var jsonpatch=require(_0xdcf9('0x3'));var rp=require(_0xdcf9('0x4'));var moment=require(_0xdcf9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdcf9('0x6'));var util=require('util');var path=require(_0xdcf9('0x7'));var sox=require(_0xdcf9('0x8'));var csv=require(_0xdcf9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdcf9('0xa'));var squel=require('squel');var crypto=require(_0xdcf9('0xb'));var jsforce=require(_0xdcf9('0xc'));var deskjs=require(_0xdcf9('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdcf9('0xe'));var Papa=require('papaparse');var Redis=require(_0xdcf9('0xf'));var authService=require(_0xdcf9('0x10'));var qs=require(_0xdcf9('0x11'));var as=require(_0xdcf9('0x12'));var hardwareService=require(_0xdcf9('0x13'));var logger=require(_0xdcf9('0x14'))(_0xdcf9('0x15'));var utils=require(_0xdcf9('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdcf9('0x17'))['db'];config['redis']=_[_0xdcf9('0x18')](config['redis'],{'host':_0xdcf9('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdcf9('0x1a')]));require(_0xdcf9('0x1b'))[_0xdcf9('0x1c')](socket);function respondWithStatusCode(_0x583e93,_0x198f1a){_0x198f1a=_0x198f1a||0xcc;return function(_0x5885f1){if(_0x5885f1){return _0x583e93['sendStatus'](_0x198f1a);}return _0x583e93[_0xdcf9('0x1d')](_0x198f1a)['end']();};}function respondWithResult(_0x4e5537,_0x97d28e){_0x97d28e=_0x97d28e||0xc8;return function(_0x513d52){if(_0x513d52){return _0x4e5537[_0xdcf9('0x1d')](_0x97d28e)[_0xdcf9('0x1e')](_0x513d52);}};}function respondWithFilteredResult(_0x24cb91,_0x3d6064){return function(_0x3067ea){if(_0x3067ea){var _0x2a39ae=typeof _0x3d6064[_0xdcf9('0x1f')]===_0xdcf9('0x20')&&typeof _0x3d6064['limit']===_0xdcf9('0x20');var _0x57f822=_0x3067ea[_0xdcf9('0x21')];var _0x5ee72d=_0x2a39ae?0x0:_0x3d6064[_0xdcf9('0x1f')];var _0x4605e5=_0x2a39ae?_0x3067ea[_0xdcf9('0x21')]:_0x3d6064['offset']+_0x3d6064['limit'];var _0x23d13f;if(_0x4605e5>=_0x57f822){_0x4605e5=_0x57f822;_0x23d13f=0xc8;}else{_0x23d13f=0xce;}_0x24cb91[_0xdcf9('0x1d')](_0x23d13f);return _0x24cb91['set'](_0xdcf9('0x22'),_0x5ee72d+'-'+_0x4605e5+'/'+_0x57f822)[_0xdcf9('0x1e')](_0x3067ea);}return null;};}function patchUpdates(_0x33c6ed){return function(_0x6ae050){try{jsonpatch[_0xdcf9('0x23')](_0x6ae050,_0x33c6ed,!![]);}catch(_0x46d55f){return BPromise['reject'](_0x46d55f);}return _0x6ae050[_0xdcf9('0x24')]();};}function saveUpdates(_0x56e3dd,_0x148062){return function(_0x4e8da6){if(_0x4e8da6){return _0x4e8da6[_0xdcf9('0x25')](_0x56e3dd)[_0xdcf9('0x26')](function(_0x55532e){return _0x55532e;});}return null;};}function removeEntity(_0xfe08b2,_0x310363){return function(_0x345a2c){if(_0x345a2c){return _0x345a2c[_0xdcf9('0x27')]()[_0xdcf9('0x26')](function(){_0xfe08b2[_0xdcf9('0x1d')](0xcc)[_0xdcf9('0x28')]();});}};}function handleEntityNotFound(_0x2fa1f3,_0x420602){return function(_0x2a3421){if(!_0x2a3421){_0x2fa1f3[_0xdcf9('0x29')](0x194);}return _0x2a3421;};}function handleError(_0x492673,_0x463bf4){_0x463bf4=_0x463bf4||0x1f4;return function(_0x31a9b4){logger[_0xdcf9('0x2a')](_0x31a9b4[_0xdcf9('0x2b')]);if(_0x31a9b4[_0xdcf9('0x2c')]){delete _0x31a9b4[_0xdcf9('0x2c')];}_0x492673['status'](_0x463bf4)['send'](_0x31a9b4);};}exports[_0xdcf9('0x2d')]=function(_0x513365,_0x3236a9){var _0x1165a6={},_0x17e682={},_0x211684={'count':0x0,'rows':[]};var _0xe521b8=_[_0xdcf9('0x2e')](db[_0xdcf9('0x2f')]['rawAttributes'],function(_0x2d3c9a){return{'name':_0x2d3c9a[_0xdcf9('0x30')],'type':_0x2d3c9a[_0xdcf9('0x31')][_0xdcf9('0x32')]};});_0x17e682[_0xdcf9('0x33')]=_['map'](_0xe521b8,_0xdcf9('0x2c'));_0x17e682['query']=_[_0xdcf9('0x34')](_0x513365[_0xdcf9('0x35')]);_0x17e682[_0xdcf9('0x36')]=_[_0xdcf9('0x37')](_0x17e682[_0xdcf9('0x33')],_0x17e682[_0xdcf9('0x35')]);_0x1165a6[_0xdcf9('0x38')]=_['intersection'](_0x17e682[_0xdcf9('0x33')],qs['fields'](_0x513365[_0xdcf9('0x35')][_0xdcf9('0x39')]));_0x1165a6[_0xdcf9('0x38')]=_0x1165a6[_0xdcf9('0x38')][_0xdcf9('0x3a')]?_0x1165a6[_0xdcf9('0x38')]:_0x17e682[_0xdcf9('0x33')];if(!_0x513365[_0xdcf9('0x35')][_0xdcf9('0x3b')]('nolimit')){_0x1165a6['limit']=qs[_0xdcf9('0x3c')](_0x513365[_0xdcf9('0x35')][_0xdcf9('0x3c')]);_0x1165a6[_0xdcf9('0x1f')]=qs['offset'](_0x513365[_0xdcf9('0x35')][_0xdcf9('0x1f')]);}_0x1165a6[_0xdcf9('0x3d')]=qs[_0xdcf9('0x3e')](_0x513365[_0xdcf9('0x35')][_0xdcf9('0x3e')]);_0x1165a6['where']=qs[_0xdcf9('0x36')](_['pick'](_0x513365[_0xdcf9('0x35')],_0x17e682['filters']),_0xe521b8);if(_0x513365[_0xdcf9('0x35')][_0xdcf9('0x3f')]){_0x1165a6['where']=_[_0xdcf9('0x40')](_0x1165a6['where'],{'$or':_['map'](_0xe521b8,function(_0xcf9d9a){if(_0xcf9d9a[_0xdcf9('0x31')]!==_0xdcf9('0x41')){var _0x85d4b6={};_0x85d4b6[_0xcf9d9a[_0xdcf9('0x2c')]]={'$like':'%'+_0x513365['query'][_0xdcf9('0x3f')]+'%'};return _0x85d4b6;}})});}_0x1165a6=_[_0xdcf9('0x40')]({},_0x1165a6,_0x513365[_0xdcf9('0x42')]);var _0x1d977f={'where':_0x1165a6[_0xdcf9('0x43')]};return db[_0xdcf9('0x2f')][_0xdcf9('0x21')](_0x1d977f)[_0xdcf9('0x26')](function(_0x14b87e){_0x211684[_0xdcf9('0x21')]=_0x14b87e;if(_0x513365[_0xdcf9('0x35')][_0xdcf9('0x44')]){_0x1165a6['include']=[{'all':!![]}];}return db[_0xdcf9('0x2f')][_0xdcf9('0x45')](_0x1165a6);})['then'](function(_0x34cb9d){_0x211684[_0xdcf9('0x46')]=_0x34cb9d;return _0x211684;})[_0xdcf9('0x26')](respondWithFilteredResult(_0x3236a9,_0x1165a6))['catch'](handleError(_0x3236a9,null));};exports[_0xdcf9('0x47')]=function(_0x5677fc,_0x1e3afb){var _0x808df9={'raw':!![],'where':{'id':_0x5677fc[_0xdcf9('0x48')]['id']}},_0x103b25={};_0x103b25[_0xdcf9('0x33')]=_[_0xdcf9('0x34')](db['ChatGroup']['rawAttributes']);_0x103b25[_0xdcf9('0x35')]=_[_0xdcf9('0x34')](_0x5677fc[_0xdcf9('0x35')]);_0x103b25[_0xdcf9('0x36')]=_['intersection'](_0x103b25[_0xdcf9('0x33')],_0x103b25[_0xdcf9('0x35')]);_0x808df9['attributes']=_[_0xdcf9('0x37')](_0x103b25[_0xdcf9('0x33')],qs['fields'](_0x5677fc[_0xdcf9('0x35')]['fields']));_0x808df9[_0xdcf9('0x38')]=_0x808df9[_0xdcf9('0x38')][_0xdcf9('0x3a')]?_0x808df9[_0xdcf9('0x38')]:_0x103b25['model'];if(_0x5677fc['query'][_0xdcf9('0x44')]){_0x808df9[_0xdcf9('0x49')]=[{'all':!![]}];}_0x808df9=_[_0xdcf9('0x40')]({},_0x808df9,_0x5677fc[_0xdcf9('0x42')]);return db[_0xdcf9('0x2f')]['find'](_0x808df9)[_0xdcf9('0x26')](handleEntityNotFound(_0x1e3afb,null))[_0xdcf9('0x26')](respondWithResult(_0x1e3afb,null))[_0xdcf9('0x4a')](handleError(_0x1e3afb,null));};exports['create']=function(_0xc36e57,_0x173348){return db[_0xdcf9('0x2f')][_0xdcf9('0x4b')](_0xc36e57['body'],{})[_0xdcf9('0x26')](respondWithResult(_0x173348,0xc9))[_0xdcf9('0x4a')](handleError(_0x173348,null));};exports[_0xdcf9('0x25')]=function(_0x47b5db,_0x45c18e){if(_0x47b5db[_0xdcf9('0x4c')]['id']){delete _0x47b5db[_0xdcf9('0x4c')]['id'];}return db['ChatGroup'][_0xdcf9('0x4d')]({'where':{'id':_0x47b5db['params']['id']}})[_0xdcf9('0x26')](handleEntityNotFound(_0x45c18e,null))[_0xdcf9('0x26')](saveUpdates(_0x47b5db[_0xdcf9('0x4c')],null))['then'](respondWithResult(_0x45c18e,null))['catch'](handleError(_0x45c18e,null));};exports[_0xdcf9('0x27')]=function(_0x16ab18,_0x116be4){return db[_0xdcf9('0x2f')]['find']({'where':{'id':_0x16ab18[_0xdcf9('0x48')]['id']}})[_0xdcf9('0x26')](handleEntityNotFound(_0x116be4,null))['then'](removeEntity(_0x116be4,null))[_0xdcf9('0x4a')](handleError(_0x116be4,null));};exports[_0xdcf9('0x4e')]=function(_0x1053fb,_0x3851c2){return db[_0xdcf9('0x2f')][_0xdcf9('0x4e')]()[_0xdcf9('0x26')](respondWithResult(_0x3851c2,null))['catch'](handleError(_0x3851c2,null));};exports[_0xdcf9('0x4f')]=function(_0x4f3fba,_0x3f0a1e,_0x3c91cc){return db[_0xdcf9('0x50')]['count']({'where':{'ChatGroupId':_0x4f3fba[_0xdcf9('0x48')]['id'],'ToId':_0x4f3fba[_0xdcf9('0x51')]['id'],'read':![]}})[_0xdcf9('0x26')](function(_0x503226){return{'id':_['toInteger'](_0x4f3fba[_0xdcf9('0x48')]['id']),'count':_0x503226};})[_0xdcf9('0x26')](respondWithResult(_0x3f0a1e,null))[_0xdcf9('0x4a')](handleError(_0x3f0a1e,null));};exports[_0xdcf9('0x52')]=function(_0x43391c,_0x1f0af2,_0x3e5c32){return db[_0xdcf9('0x2f')][_0xdcf9('0x4d')]({'where':{'id':_0x43391c['params']['id']}})[_0xdcf9('0x26')](handleEntityNotFound(_0x1f0af2,null))[_0xdcf9('0x26')](function(_0x192466){if(_0x192466){return _0x192466[_0xdcf9('0x52')](_0x43391c['body'][_0xdcf9('0x53')],_[_0xdcf9('0x54')](_0x43391c[_0xdcf9('0x4c')],['ids','id'])||{});}})[_0xdcf9('0x26')](respondWithResult(_0x1f0af2,null))[_0xdcf9('0x4a')](handleError(_0x1f0af2,null));};exports[_0xdcf9('0x55')]=function(_0x4043e2,_0x37790c,_0x202c57){var _0x1a202f={};var _0x53455a={};var _0x3bf079;var _0x344b7c;return db[_0xdcf9('0x2f')][_0xdcf9('0x56')]({'where':{'id':_0x4043e2['params']['id']}})[_0xdcf9('0x26')](handleEntityNotFound(_0x37790c,null))['then'](function(_0x113317){if(_0x113317){_0x3bf079=_0x113317;_0x53455a[_0xdcf9('0x33')]=_[_0xdcf9('0x34')](db[_0xdcf9('0x57')]['rawAttributes']);_0x53455a['query']=_['keys'](_0x4043e2[_0xdcf9('0x35')]);_0x53455a[_0xdcf9('0x36')]=_['intersection'](_0x53455a[_0xdcf9('0x33')],_0x53455a[_0xdcf9('0x35')]);_0x1a202f['attributes']=_['intersection'](_0x53455a[_0xdcf9('0x33')],qs['fields'](_0x4043e2[_0xdcf9('0x35')]['fields']));_0x1a202f['attributes']=_0x1a202f[_0xdcf9('0x38')][_0xdcf9('0x3a')]?_0x1a202f[_0xdcf9('0x38')]:_0x53455a[_0xdcf9('0x33')];_0x1a202f[_0xdcf9('0x3d')]=qs[_0xdcf9('0x3e')](_0x4043e2['query']['sort']);_0x1a202f[_0xdcf9('0x43')]=qs['filters'](_[_0xdcf9('0x58')](_0x4043e2['query'],_0x53455a[_0xdcf9('0x36')]));if(_0x4043e2[_0xdcf9('0x35')][_0xdcf9('0x3f')]){_0x1a202f[_0xdcf9('0x43')]=_[_0xdcf9('0x40')](_0x1a202f[_0xdcf9('0x43')],{'$or':_[_0xdcf9('0x2e')](_0x1a202f['attributes'],function(_0x371750){var _0x25d5ef={};_0x25d5ef[_0x371750]={'$like':'%'+_0x4043e2['query']['filter']+'%'};return _0x25d5ef;})});}_0x1a202f=_[_0xdcf9('0x40')]({},_0x1a202f,_0x4043e2['options']);return _0x3bf079[_0xdcf9('0x55')](_0x1a202f);}})[_0xdcf9('0x26')](function(_0x28d3d5){if(_0x28d3d5){_0x344b7c=_0x28d3d5[_0xdcf9('0x3a')];if(!_0x4043e2[_0xdcf9('0x35')][_0xdcf9('0x3b')](_0xdcf9('0x59'))){_0x1a202f['limit']=qs['limit'](_0x4043e2['query'][_0xdcf9('0x3c')]);_0x1a202f['offset']=qs[_0xdcf9('0x1f')](_0x4043e2[_0xdcf9('0x35')][_0xdcf9('0x1f')]);}return _0x3bf079['getMembers'](_0x1a202f);}})[_0xdcf9('0x26')](function(_0x4f77eb){if(_0x4f77eb){return _0x4f77eb?{'count':_0x344b7c,'rows':_0x4f77eb}:null;}})[_0xdcf9('0x26')](respondWithResult(_0x37790c,null))[_0xdcf9('0x4a')](handleError(_0x37790c,null));};exports[_0xdcf9('0x5a')]=function(_0x5df34f,_0x1ba8fe,_0x1b69f3){return db[_0xdcf9('0x2f')][_0xdcf9('0x4d')]({'where':{'id':_0x5df34f['params']['id']}})[_0xdcf9('0x26')](handleEntityNotFound(_0x1ba8fe,null))[_0xdcf9('0x26')](function(_0x678fce){if(_0x678fce){return _0x678fce[_0xdcf9('0x5a')](_0x5df34f[_0xdcf9('0x35')]['ids']);}})[_0xdcf9('0x26')](respondWithStatusCode(_0x1ba8fe,null))[_0xdcf9('0x4a')](handleError(_0x1ba8fe,null));};exports[_0xdcf9('0x5b')]=function(_0x212238,_0x385289,_0x4b83d0){if(_0x212238[_0xdcf9('0x4c')]['id']){delete _0x212238['body']['id'];}return db[_0xdcf9('0x2f')][_0xdcf9('0x4d')]({'where':{'id':_0x212238[_0xdcf9('0x48')]['id']}})['then'](handleEntityNotFound(_0x385289,null))['then'](function(_0xba9080){if(_0xba9080){_0x212238[_0xdcf9('0x4c')]['ChatGroupId']=_0xba9080['id'];return db['ChatInternalMessage']['create'](_0x212238['body']);}})[_0xdcf9('0x26')](respondWithResult(_0x385289,null))['catch'](handleError(_0x385289,null));};exports['getMessages']=function(_0x163315,_0x4263b5,_0x20f879){var _0x1bf8ee={};var _0x1016e5={};var _0x582b4b;var _0x2f38b6;return db[_0xdcf9('0x2f')]['findOne']({'where':{'id':_0x163315[_0xdcf9('0x48')]['id']}})[_0xdcf9('0x26')](handleEntityNotFound(_0x4263b5,null))[_0xdcf9('0x26')](function(_0x4031b7){if(_0x4031b7){_0x582b4b=_0x4031b7;_0x1016e5[_0xdcf9('0x33')]=_[_0xdcf9('0x34')](db[_0xdcf9('0x50')]['rawAttributes']);_0x1016e5[_0xdcf9('0x35')]=_[_0xdcf9('0x34')](_0x163315[_0xdcf9('0x35')]);_0x1016e5['filters']=_[_0xdcf9('0x37')](_0x1016e5[_0xdcf9('0x33')],_0x1016e5[_0xdcf9('0x35')]);_0x1bf8ee[_0xdcf9('0x38')]=_['intersection'](_0x1016e5['model'],qs[_0xdcf9('0x39')](_0x163315[_0xdcf9('0x35')][_0xdcf9('0x39')]));_0x1bf8ee[_0xdcf9('0x38')]=_0x1bf8ee['attributes'][_0xdcf9('0x3a')]?_0x1bf8ee[_0xdcf9('0x38')]:_0x1016e5[_0xdcf9('0x33')];_0x1bf8ee['order']=qs[_0xdcf9('0x3e')](_0x163315['query']['sort']);_0x1bf8ee['where']=qs[_0xdcf9('0x36')](_['pick'](_0x163315[_0xdcf9('0x35')],_0x1016e5[_0xdcf9('0x36')]));if(_0x163315['query']['filter']){_0x1bf8ee[_0xdcf9('0x43')]=_[_0xdcf9('0x40')](_0x1bf8ee[_0xdcf9('0x43')],{'$or':_[_0xdcf9('0x2e')](_0x1bf8ee[_0xdcf9('0x38')],function(_0x1b666b){var _0x141756={};_0x141756[_0x1b666b]={'$like':'%'+_0x163315[_0xdcf9('0x35')][_0xdcf9('0x3f')]+'%'};return _0x141756;})});}if(_0x163315[_0xdcf9('0x35')][_0xdcf9('0x5c')]){var _0x3024e9=_0x163315[_0xdcf9('0x35')][_0xdcf9('0x5c')][_0xdcf9('0x5d')](',');var _0x46ceb1={};_0x46ceb1[_0x3024e9[0x0]]={'$gte':moment(_0x3024e9[0x1])[_0xdcf9('0x5e')](_0xdcf9('0x5f'))};_0x1bf8ee[_0xdcf9('0x43')]=_['merge'](_0x1bf8ee[_0xdcf9('0x43')],_0x46ceb1);}_0x1bf8ee=_[_0xdcf9('0x40')]({},_0x1bf8ee,_0x163315[_0xdcf9('0x42')]);return _0x582b4b['getMessages'](_0x1bf8ee);}})[_0xdcf9('0x26')](function(_0x411ce5){if(_0x411ce5){_0x2f38b6=_0x411ce5[_0xdcf9('0x3a')];if(!_0x163315[_0xdcf9('0x35')][_0xdcf9('0x3b')](_0xdcf9('0x59'))){_0x1bf8ee[_0xdcf9('0x3c')]=qs['limit'](_0x163315[_0xdcf9('0x35')][_0xdcf9('0x3c')]);_0x1bf8ee[_0xdcf9('0x1f')]=qs[_0xdcf9('0x1f')](_0x163315[_0xdcf9('0x35')][_0xdcf9('0x1f')]);}return _0x582b4b[_0xdcf9('0x60')](_0x1bf8ee);}})[_0xdcf9('0x26')](function(_0x2ff0a3){if(_0x2ff0a3){return _0x2ff0a3?{'count':_0x2f38b6,'rows':_0x2ff0a3}:null;}})[_0xdcf9('0x26')](respondWithResult(_0x4263b5,null))[_0xdcf9('0x4a')](handleError(_0x4263b5,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index b21c8e7..fcf2c7f 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 _0xc7bd=['events','../../mysqldb','ChatGroup','setMaxListeners','remove','emit','hook','exports'];(function(_0x5c8827,_0x5bc5d7){var _0x50ffd5=function(_0x4121bc){while(--_0x4121bc){_0x5c8827['push'](_0x5c8827['shift']());}};_0x50ffd5(++_0x5bc5d7);}(_0xc7bd,0x170));var _0xdc7b=function(_0x2e0b54,_0x315f86){_0x2e0b54=_0x2e0b54-0x0;var _0x254dde=_0xc7bd[_0x2e0b54];return _0x254dde;};'use strict';var EventEmitter=require(_0xdc7b('0x0'));var ChatGroup=require(_0xdc7b('0x1'))['db'][_0xdc7b('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xdc7b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xdc7b('0x4')};function emitEvent(_0x3154bb){return function(_0x107be3,_0x5e1219,_0x30d4a7){ChatGroupEvents['emit'](_0x3154bb+':'+_0x107be3['id'],_0x107be3);ChatGroupEvents[_0xdc7b('0x5')](_0x3154bb,_0x107be3);_0x30d4a7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xdc7b('0x6')](e,emitEvent(event));}}module[_0xdc7b('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0xcaf1=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x3fe2be,_0x24cfba){var _0x16b3ca=function(_0x266d1e){while(--_0x266d1e){_0x3fe2be['push'](_0x3fe2be['shift']());}};_0x16b3ca(++_0x24cfba);}(_0xcaf1,0x82));var _0x1caf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaf1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x1caf('0x0'))['db'][_0x1caf('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x1caf('0x2')](0x0);var events={'afterCreate':_0x1caf('0x3'),'afterUpdate':_0x1caf('0x4'),'afterDestroy':'remove'};function emitEvent(_0x56a487){return function(_0x238dc4,_0xb5de2b,_0x249f41){ChatGroupEvents[_0x1caf('0x5')](_0x56a487+':'+_0x238dc4['id'],_0x238dc4);ChatGroupEvents[_0x1caf('0x5')](_0x56a487,_0x238dc4);_0x249f41(null);};}for(var e in events){if(events[_0x1caf('0x6')](e)){var event=events[e];ChatGroup[_0x1caf('0x7')](e,emitEvent(event));}}module[_0x1caf('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 2f91585..44569cb 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 _0x5d3c=['ChatGroup','lodash','util','../../config/logger','api','moment','bluebird','rimraf','exports','define'];(function(_0x402688,_0x140e65){var _0x1789ff=function(_0x3febc7){while(--_0x3febc7){_0x402688['push'](_0x402688['shift']());}};_0x1789ff(++_0x140e65);}(_0x5d3c,0x155));var _0xc5d3=function(_0x3d0a1a,_0xe0a634){_0x3d0a1a=_0x3d0a1a-0x0;var _0x54aa5b=_0x5d3c[_0x3d0a1a];return _0x54aa5b;};'use strict';var _=require(_0xc5d3('0x0'));var util=require(_0xc5d3('0x1'));var logger=require(_0xc5d3('0x2'))(_0xc5d3('0x3'));var moment=require(_0xc5d3('0x4'));var BPromise=require(_0xc5d3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc5d3('0x6'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0xc5d3('0x7')]=function(_0x2cbca2,_0x480a7e){return _0x2cbca2[_0xc5d3('0x8')](_0xc5d3('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84fb=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4fc7fc,_0x5d6d06){var _0x5e945e=function(_0x1bb78d){while(--_0x1bb78d){_0x4fc7fc['push'](_0x4fc7fc['shift']());}};_0x5e945e(++_0x5d6d06);}(_0x84fb,0x156));var _0xb84f=function(_0x5cedd4,_0xa8a678){_0x5cedd4=_0x5cedd4-0x0;var _0x2867e4=_0x84fb[_0x5cedd4];return _0x2867e4;};'use strict';var _=require(_0xb84f('0x0'));var util=require('util');var logger=require(_0xb84f('0x1'))(_0xb84f('0x2'));var moment=require(_0xb84f('0x3'));var BPromise=require(_0xb84f('0x4'));var rp=require(_0xb84f('0x5'));var fs=require('fs');var path=require(_0xb84f('0x6'));var rimraf=require(_0xb84f('0x7'));var config=require(_0xb84f('0x8'));var attributes=require(_0xb84f('0x9'));module[_0xb84f('0xa')]=function(_0x45230d,_0x117ff4){return _0x45230d[_0xb84f('0xb')](_0xb84f('0xc'),attributes,{'tableName':_0xb84f('0xd'),'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 c00fb8e..560b83a 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 _0x6510=['code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6510,0x77));var _0x0651=function(_0x4b0718,_0x4c92fe){_0x4b0718=_0x4b0718-0x0;var _0x2cccf7=_0x6510[_0x4b0718];return _0x2cccf7;};'use strict';var _=require(_0x0651('0x0'));var util=require(_0x0651('0x1'));var moment=require(_0x0651('0x2'));var BPromise=require(_0x0651('0x3'));var rs=require(_0x0651('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0651('0x5'))['db'];var utils=require(_0x0651('0x6'));var logger=require(_0x0651('0x7'))(_0x0651('0x8'));var config=require(_0x0651('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0651('0xa')][_0x0651('0xb')]({'port':0x232a});config[_0x0651('0xc')]=_[_0x0651('0xd')](config[_0x0651('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0651('0xe'))(new Redis(config[_0x0651('0xc')]));require(_0x0651('0xf'))[_0x0651('0x10')](socket);function respondWithRpcPromise(_0x33ef26,_0x53b31b,_0x3d424c){return new BPromise(function(_0x3eca05,_0x3d82b2){return client[_0x0651('0x11')](_0x33ef26,_0x3d424c)[_0x0651('0x12')](function(_0x1ab65d){logger[_0x0651('0x13')](_0x0651('0x14'),_0x53b31b,_0x0651('0x15'));logger[_0x0651('0x16')](_0x0651('0x17'),_0x53b31b,_0x0651('0x15'),JSON[_0x0651('0x18')](_0x1ab65d));if(_0x1ab65d[_0x0651('0x19')]){if(_0x1ab65d['error'][_0x0651('0x1a')]===0x1f4){logger[_0x0651('0x19')](_0x0651('0x14'),_0x53b31b,_0x1ab65d[_0x0651('0x19')]['message']);return _0x3d82b2(_0x1ab65d[_0x0651('0x19')][_0x0651('0x1b')]);}logger[_0x0651('0x19')](_0x0651('0x14'),_0x53b31b,_0x1ab65d[_0x0651('0x19')][_0x0651('0x1b')]);return _0x3eca05(_0x1ab65d[_0x0651('0x19')][_0x0651('0x1b')]);}else{logger[_0x0651('0x13')](_0x0651('0x14'),_0x53b31b,_0x0651('0x15'));_0x3eca05(_0x1ab65d[_0x0651('0x1c')][_0x0651('0x1b')]);}})['catch'](function(_0x15b072){logger['error'](_0x0651('0x14'),_0x53b31b,_0x15b072);_0x3d82b2(_0x15b072);});});} \ No newline at end of file +var _0x7d86=['./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x125358,_0xdcae13){var _0x55fe56=function(_0x3db609){while(--_0x3db609){_0x125358['push'](_0x125358['shift']());}};_0x55fe56(++_0xdcae13);}(_0x7d86,0x86));var _0x67d8=function(_0x28b720,_0x501c54){_0x28b720=_0x28b720-0x0;var _0x1e5657=_0x7d86[_0x28b720];return _0x1e5657;};'use strict';var _=require(_0x67d8('0x0'));var util=require('util');var moment=require(_0x67d8('0x1'));var BPromise=require(_0x67d8('0x2'));var rs=require(_0x67d8('0x3'));var fs=require('fs');var Redis=require(_0x67d8('0x4'));var db=require(_0x67d8('0x5'))['db'];var utils=require(_0x67d8('0x6'));var logger=require(_0x67d8('0x7'))('rpc');var config=require(_0x67d8('0x8'));var jayson=require(_0x67d8('0x9'));var client=jayson[_0x67d8('0xa')][_0x67d8('0xb')]({'port':0x232a});config[_0x67d8('0xc')]=_[_0x67d8('0xd')](config[_0x67d8('0xc')],{'host':_0x67d8('0xe'),'port':0x18eb});var socket=require(_0x67d8('0xf'))(new Redis(config[_0x67d8('0xc')]));require(_0x67d8('0x10'))[_0x67d8('0x11')](socket);function respondWithRpcPromise(_0x243de2,_0x265552,_0x2b1fe6){return new BPromise(function(_0x47382c,_0x2e5a0f){return client[_0x67d8('0x12')](_0x243de2,_0x2b1fe6)[_0x67d8('0x13')](function(_0x46b7f8){logger[_0x67d8('0x14')]('ChatGroup,\x20%s,\x20%s',_0x265552,_0x67d8('0x15'));logger[_0x67d8('0x16')](_0x67d8('0x17'),_0x265552,'request\x20sent',JSON[_0x67d8('0x18')](_0x46b7f8));if(_0x46b7f8[_0x67d8('0x19')]){if(_0x46b7f8[_0x67d8('0x19')][_0x67d8('0x1a')]===0x1f4){logger[_0x67d8('0x19')](_0x67d8('0x1b'),_0x265552,_0x46b7f8[_0x67d8('0x19')]['message']);return _0x2e5a0f(_0x46b7f8[_0x67d8('0x19')][_0x67d8('0x1c')]);}logger[_0x67d8('0x19')]('ChatGroup,\x20%s,\x20%s',_0x265552,_0x46b7f8[_0x67d8('0x19')][_0x67d8('0x1c')]);return _0x47382c(_0x46b7f8['error'][_0x67d8('0x1c')]);}else{logger[_0x67d8('0x14')](_0x67d8('0x1b'),_0x265552,_0x67d8('0x15'));_0x47382c(_0x46b7f8[_0x67d8('0x1d')][_0x67d8('0x1c')]);}})['catch'](function(_0x3de8d1){logger[_0x67d8('0x19')](_0x67d8('0x1b'),_0x265552,_0x3de8d1);_0x2e5a0f(_0x3de8d1);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 3779906..bfbe3e4 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 _0x6d1c=['emit','removeListener','register','length','chatGroup:','save','remove'];(function(_0x6cbd74,_0x1cba6a){var _0x392ab6=function(_0x303546){while(--_0x303546){_0x6cbd74['push'](_0x6cbd74['shift']());}};_0x392ab6(++_0x1cba6a);}(_0x6d1c,0x75));var _0xc6d1=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0x6d1c[_0x1b70e3];return _0x1452ab;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xc6d1('0x0'),_0xc6d1('0x1'),'update'];function createListener(_0x3a16cd,_0x133b5e){return function(_0x4d9d1f){_0x133b5e[_0xc6d1('0x2')](_0x3a16cd,_0x4d9d1f);};}function removeListener(_0x5e49c1,_0x50e480){return function(){ChatGroupEvents[_0xc6d1('0x3')](_0x5e49c1,_0x50e480);};}exports[_0xc6d1('0x4')]=function(_0x3eb1f5){for(var _0x1848d1=0x0,_0x4e1ab9=events[_0xc6d1('0x5')];_0x1848d1<_0x4e1ab9;_0x1848d1++){var _0x4de325=events[_0x1848d1];var _0x1d906b=createListener(_0xc6d1('0x6')+_0x4de325,_0x3eb1f5);ChatGroupEvents['on'](_0x4de325,_0x1d906b);}}; \ No newline at end of file +var _0x271c=['removeListener','length','chatGroup:','./chatGroup.events','save','remove','emit'];(function(_0x244a18,_0x48c537){var _0x56975a=function(_0x19f7f5){while(--_0x19f7f5){_0x244a18['push'](_0x244a18['shift']());}};_0x56975a(++_0x48c537);}(_0x271c,0x6c));var _0xc271=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x271c[_0x21a9d9];return _0x46adce;};'use strict';var ChatGroupEvents=require(_0xc271('0x0'));var events=[_0xc271('0x1'),_0xc271('0x2'),'update'];function createListener(_0x21c1e3,_0x14de30){return function(_0x3004b1){_0x14de30[_0xc271('0x3')](_0x21c1e3,_0x3004b1);};}function removeListener(_0x91c3f1,_0x1a7e71){return function(){ChatGroupEvents[_0xc271('0x4')](_0x91c3f1,_0x1a7e71);};}exports['register']=function(_0x13612f){for(var _0x4eb96a=0x0,_0x1ac247=events[_0xc271('0x5')];_0x4eb96a<_0x1ac247;_0x4eb96a++){var _0x280a1c=events[_0x4eb96a];var _0x3fec59=createListener(_0xc271('0x6')+_0x280a1c,_0x13612f);ChatGroupEvents['on'](_0x280a1c,_0x3fec59);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 309251d..034937e 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 _0x2633=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','update','delete','destroy','removeMembers','exports','multer','util'];(function(_0x2ede2e,_0x50ef64){var _0x55d876=function(_0x5be098){while(--_0x5be098){_0x2ede2e['push'](_0x2ede2e['shift']());}};_0x55d876(++_0x50ef64);}(_0x2633,0x191));var _0x3263=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x2633[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x3263('0x0'));var util=require(_0x3263('0x1'));var path=require('path');var timeout=require(_0x3263('0x2'));var express=require(_0x3263('0x3'));var router=express[_0x3263('0x4')]();var fs_extra=require(_0x3263('0x5'));var auth=require(_0x3263('0x6'));var interaction=require(_0x3263('0x7'));var config=require(_0x3263('0x8'));var controller=require(_0x3263('0x9'));router[_0x3263('0xa')]('/',auth[_0x3263('0xb')](),controller[_0x3263('0xc')]);router[_0x3263('0xa')]('/describe',auth[_0x3263('0xb')](),controller[_0x3263('0xd')]);router['get'](_0x3263('0xe'),auth[_0x3263('0xb')](),controller[_0x3263('0xf')]);router[_0x3263('0xa')](_0x3263('0x10'),auth['isAuthenticated'](),controller[_0x3263('0x11')]);router[_0x3263('0xa')](_0x3263('0x12'),auth[_0x3263('0xb')](),controller[_0x3263('0x13')]);router['get'](_0x3263('0x14'),auth[_0x3263('0xb')](),controller[_0x3263('0x15')]);router[_0x3263('0x16')]('/',auth['isAuthenticated'](),controller[_0x3263('0x17')]);router['post'](_0x3263('0x12'),auth[_0x3263('0xb')](),controller[_0x3263('0x18')]);router[_0x3263('0x16')](_0x3263('0x14'),auth['isAuthenticated'](),controller['addMessage']);router[_0x3263('0x19')](_0x3263('0xe'),auth[_0x3263('0xb')](),controller[_0x3263('0x1a')]);router[_0x3263('0x1b')]('/:id',auth[_0x3263('0xb')](),controller[_0x3263('0x1c')]);router[_0x3263('0x1b')](_0x3263('0x12'),auth[_0x3263('0xb')](),controller[_0x3263('0x1d')]);module[_0x3263('0x1e')]=router; \ No newline at end of file +var _0x691a=['index','isAuthenticated','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0xe45e25,_0x34c0de){var _0x117a58=function(_0x3d6237){while(--_0x3d6237){_0xe45e25['push'](_0xe45e25['shift']());}};_0x117a58(++_0x34c0de);}(_0x691a,0x1c2));var _0xa691=function(_0x512842,_0x1ca79c){_0x512842=_0x512842-0x0;var _0x471291=_0x691a[_0x512842];return _0x471291;};'use strict';var multer=require(_0xa691('0x0'));var util=require('util');var path=require(_0xa691('0x1'));var timeout=require(_0xa691('0x2'));var express=require(_0xa691('0x3'));var router=express[_0xa691('0x4')]();var fs_extra=require(_0xa691('0x5'));var auth=require(_0xa691('0x6'));var interaction=require(_0xa691('0x7'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0xa691('0x8')]('/',auth['isAuthenticated'](),controller[_0xa691('0x9')]);router['get']('/describe',auth[_0xa691('0xa')](),controller['describe']);router[_0xa691('0x8')](_0xa691('0xb'),auth[_0xa691('0xa')](),controller['show']);router[_0xa691('0x8')](_0xa691('0xc'),auth[_0xa691('0xa')](),controller[_0xa691('0xd')]);router[_0xa691('0x8')](_0xa691('0xe'),auth[_0xa691('0xa')](),controller[_0xa691('0xf')]);router['get'](_0xa691('0x10'),auth[_0xa691('0xa')](),controller[_0xa691('0x11')]);router[_0xa691('0x12')]('/',auth[_0xa691('0xa')](),controller[_0xa691('0x13')]);router[_0xa691('0x12')](_0xa691('0xe'),auth['isAuthenticated'](),controller[_0xa691('0x14')]);router[_0xa691('0x12')](_0xa691('0x10'),auth[_0xa691('0xa')](),controller[_0xa691('0x15')]);router[_0xa691('0x16')](_0xa691('0xb'),auth['isAuthenticated'](),controller[_0xa691('0x17')]);router[_0xa691('0x18')]('/:id',auth[_0xa691('0xa')](),controller[_0xa691('0x19')]);router[_0xa691('0x18')](_0xa691('0xe'),auth[_0xa691('0xa')](),controller['removeMembers']);module[_0xa691('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 2baa1eb..1fba060 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 _0xd649=['exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','DATE','STRING','long','out','sequelize'];(function(_0x3ab14c,_0x4093a1){var _0x423753=function(_0x278031){while(--_0x278031){_0x3ab14c['push'](_0x3ab14c['shift']());}};_0x423753(++_0x4093a1);}(_0xd649,0x8f));var _0x9d64=function(_0x7bff0e,_0x316abc){_0x7bff0e=_0x7bff0e-0x0;var _0x5ac7d8=_0xd649[_0x7bff0e];return _0x5ac7d8;};'use strict';var Sequelize=require(_0x9d64('0x0'));module[_0x9d64('0x1')]={'closed':{'type':Sequelize[_0x9d64('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x9d64('0x3')]},'ratingType':{'type':Sequelize[_0x9d64('0x4')](_0x9d64('0x5'),_0x9d64('0x6')),'defaultValue':_0x9d64('0x5')},'ratingMessage':{'type':Sequelize[_0x9d64('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x9d64('0x8')]},'disposition':{'type':Sequelize[_0x9d64('0x9')]},'secondDisposition':{'type':Sequelize[_0x9d64('0x9')]},'thirdDisposition':{'type':Sequelize[_0x9d64('0x9')]},'note':{'type':Sequelize[_0x9d64('0x9')]},'browserName':{'type':Sequelize[_0x9d64('0x9')]},'browserVersion':{'type':Sequelize[_0x9d64('0x9')]},'osName':{'type':Sequelize[_0x9d64('0x9')]},'osVersion':{'type':Sequelize[_0x9d64('0x9')]},'deviceModel':{'type':Sequelize[_0x9d64('0x9')]},'deviceVendor':{'type':Sequelize[_0x9d64('0x9')]},'deviceType':{'type':Sequelize[_0x9d64('0x9')]},'referer':{'type':Sequelize[_0x9d64('0x7')]},'customerIp':{'type':Sequelize[_0x9d64('0x9')]},'formData':{'type':Sequelize[_0x9d64('0x7')](_0x9d64('0xa'))},'read1stAt':{'type':Sequelize[_0x9d64('0x8')]},'lastMsgAt':{'type':Sequelize[_0x9d64('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x9d64('0x4')]('in',_0x9d64('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x9d64('0x9')]},'customerPort':{'type':Sequelize[_0x9d64('0x9')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x9d64('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xdf8b=['INTEGER','sequelize','exports','BOOLEAN','ENUM','star','TEXT','STRING','DATE','long'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0xdf8b,0x1af));var _0xbdf8=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0xdf8b[_0x209ec9];return _0x129b1b;};'use strict';var Sequelize=require(_0xbdf8('0x0'));module[_0xbdf8('0x1')]={'closed':{'type':Sequelize[_0xbdf8('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xbdf8('0x3')]('star','thumb'),'defaultValue':_0xbdf8('0x4')},'ratingMessage':{'type':Sequelize[_0xbdf8('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xbdf8('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xbdf8('0x7')]},'disposition':{'type':Sequelize[_0xbdf8('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xbdf8('0x6')]},'note':{'type':Sequelize[_0xbdf8('0x6')]},'browserName':{'type':Sequelize[_0xbdf8('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xbdf8('0x5')]},'customerIp':{'type':Sequelize[_0xbdf8('0x6')]},'formData':{'type':Sequelize['TEXT'](_0xbdf8('0x8'))},'read1stAt':{'type':Sequelize[_0xbdf8('0x7')]},'lastMsgAt':{'type':Sequelize[_0xbdf8('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xbdf8('0x6')]},'customerPort':{'type':Sequelize[_0xbdf8('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xbdf8('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xbdf8('0x9')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index a3ac773..a1b36d2 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 _0x61dd=['server/files/chat/upload/','format','now','pathTranscript','ChatMessage','Messages','User','ContactId','%s%d','agentAlias','System','customer','agentIdentifier','alias','agent_fullname','fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','addMessage','ids','fields','hasOwnProperty','nolimit','order','sort','pick','ChatInteractionId','filter','merge','map','$gte','split','where','includeAll','rows','getMyMessages','secret','includeAgent','push','addTags','setTags','spread','Tag','chatInteractionTags:save','removeTags','files','server','transcript-%d-%s.zip','firstName','Account','get','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','toString','closedAt','disposition','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','read','value','renderFile','views','downloadInteraction.ejs','transcript-','Chat','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','count','limit','Content-Range','json','destroy','end','stack','name','send','render','body','contact','agent','index','ChatInteraction','rawAttributes','fieldName','type','getOptions','findAll','chat','query','show','params','keys','filters','intersection','model','attributes','length','include','options','find','create','update','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','user','account','POST','email','follow','isNull','vidaooMetadata','parse','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','abandon','attachmentUpload','originalname','file','filename','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript'];(function(_0x1fd793,_0x38bcf8){var _0x3dcf69=function(_0x4eacd0){while(--_0x4eacd0){_0x1fd793['push'](_0x1fd793['shift']());}};_0x3dcf69(++_0x38bcf8);}(_0x61dd,0x1f2));var _0xd61d=function(_0x314fa9,_0x14d5df){_0x314fa9=_0x314fa9-0x0;var _0x38d6c=_0x61dd[_0x314fa9];return _0x38d6c;};'use strict';var rimraf=require(_0xd61d('0x0'));var zipdir=require(_0xd61d('0x1'));var rp=require('request-promise');var moment=require(_0xd61d('0x2'));var BPromise=require(_0xd61d('0x3'));var Mustache=require(_0xd61d('0x4'));var util=require(_0xd61d('0x5'));var path=require('path');var ejs=require(_0xd61d('0x6'));var fs=require('fs');var _=require(_0xd61d('0x7'));var Redis=require(_0xd61d('0x8'));var interaction=require(_0xd61d('0x9'));var qs=require(_0xd61d('0xa'));var pdf=require(_0xd61d('0xb'));var logger=require(_0xd61d('0xc'))(_0xd61d('0xd'));var config=require(_0xd61d('0xe'));var db=require(_0xd61d('0xf'))['db'];config[_0xd61d('0x10')]=_[_0xd61d('0x11')](config[_0xd61d('0x10')],{'host':_0xd61d('0x12'),'port':0x18eb});var socket=require(_0xd61d('0x13'))(new Redis(config[_0xd61d('0x10')]));require(_0xd61d('0x14'))[_0xd61d('0x15')](socket);var jayson=require(_0xd61d('0x16'));var client=jayson[_0xd61d('0x17')][_0xd61d('0x18')]({'port':0x232b});var client9004=jayson[_0xd61d('0x17')][_0xd61d('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x53f6df,_0x4e6e52,_0x389194,_0x25d777){return new BPromise(function(_0x1e1806,_0x3bc8b1){var _0x4cef43=_0x25d777||client;return _0x4cef43['request'](_0x53f6df,_0x389194)[_0xd61d('0x19')](function(_0x5766dc){logger[_0xd61d('0x1a')](_0xd61d('0x1b'),_0x4e6e52,_0xd61d('0x1c'));logger[_0xd61d('0x1d')](_0xd61d('0x1e'),_0x4e6e52,_0xd61d('0x1c'),JSON[_0xd61d('0x1f')](_0x5766dc));if(_0x5766dc[_0xd61d('0x20')]){if(_0x5766dc[_0xd61d('0x20')][_0xd61d('0x21')]===0x1f4){logger[_0xd61d('0x20')](_0xd61d('0x1b'),_0x4e6e52,_0x5766dc[_0xd61d('0x20')][_0xd61d('0x22')]);return _0x3bc8b1(_0x5766dc[_0xd61d('0x20')]['message']);}logger[_0xd61d('0x20')](_0xd61d('0x1b'),_0x4e6e52,_0x5766dc[_0xd61d('0x20')]['message']);return _0x1e1806(_0x5766dc[_0xd61d('0x20')][_0xd61d('0x22')]);}else{logger[_0xd61d('0x1a')](_0xd61d('0x1b'),_0x4e6e52,'request\x20sent');_0x1e1806(_0x5766dc[_0xd61d('0x23')][_0xd61d('0x22')]);}})[_0xd61d('0x24')](function(_0x216ad0){logger[_0xd61d('0x20')]('ChatInteraction,\x20%s,\x20%s',_0x4e6e52,_0x216ad0);_0x3bc8b1(_0x216ad0);});});}function respondWithStatusCode(_0x4687f6,_0x45d892){_0x45d892=_0x45d892||0xcc;return function(_0x212aaf){if(_0x212aaf){return _0x4687f6[_0xd61d('0x25')](_0x45d892);}return _0x4687f6[_0xd61d('0x26')](_0x45d892)['end']();};}function respondWithResult(_0x5d3d16,_0x4c249f){_0x4c249f=_0x4c249f||0xc8;return function(_0x5530a9){if(_0x5530a9){return _0x5d3d16[_0xd61d('0x26')](_0x4c249f)['json'](_0x5530a9);}};}function respondWithFilteredResult(_0x45b24d,_0x16c01c){return function(_0x16ae8f){if(_0x16ae8f){var _0x4ea954=typeof _0x16c01c[_0xd61d('0x27')]===_0xd61d('0x28')&&typeof _0x16c01c['limit']===_0xd61d('0x28');var _0xf2b9fb=_0x16ae8f[_0xd61d('0x29')];var _0x2e0643=_0x4ea954?0x0:_0x16c01c['offset'];var _0x161484=_0x4ea954?_0x16ae8f['count']:_0x16c01c[_0xd61d('0x27')]+_0x16c01c[_0xd61d('0x2a')];var _0x1ae810;if(_0x161484>=_0xf2b9fb){_0x161484=_0xf2b9fb;_0x1ae810=0xc8;}else{_0x1ae810=0xce;}_0x45b24d[_0xd61d('0x26')](_0x1ae810);return _0x45b24d['set'](_0xd61d('0x2b'),_0x2e0643+'-'+_0x161484+'/'+_0xf2b9fb)[_0xd61d('0x2c')](_0x16ae8f);}return null;};}function saveUpdates(_0x42d848){return function(_0x88aa4b){if(_0x88aa4b){return _0x88aa4b['update'](_0x42d848)[_0xd61d('0x19')](function(_0x2ae851){return _0x2ae851;});}return null;};}function removeEntity(_0x1c2e64){return function(_0x2919e6){if(_0x2919e6){return _0x2919e6[_0xd61d('0x2d')]()[_0xd61d('0x19')](function(){_0x1c2e64[_0xd61d('0x26')](0xcc)[_0xd61d('0x2e')]();});}};}function handleEntityNotFound(_0x397412){return function(_0x10f19c){if(!_0x10f19c){_0x397412[_0xd61d('0x25')](0x194);}return _0x10f19c;};}function handleError(_0x42e186,_0x42cc16){_0x42cc16=_0x42cc16||0x1f4;return function(_0x4ad7c8){logger[_0xd61d('0x20')](_0x4ad7c8[_0xd61d('0x2f')]);if(_0x4ad7c8[_0xd61d('0x30')]){delete _0x4ad7c8[_0xd61d('0x30')];}_0x42e186[_0xd61d('0x26')](_0x42cc16)[_0xd61d('0x31')](_0x4ad7c8);};}function getMustacheRender(_0x2b593c,_0x363cc7){return Mustache[_0xd61d('0x32')](_0x2b593c,_['merge'](_0x363cc7[_0xd61d('0x33')],{'contact':_0x363cc7[_0xd61d('0x34')],'message':_0x363cc7[_0xd61d('0x22')],'agent':_0x363cc7[_0xd61d('0x35')],'interaction':_0x363cc7['interaction'],'account':_0x363cc7['account']}))||'';}exports[_0xd61d('0x36')]=function(_0x3671d9,_0x4b5b11){var _0x4ed370={};var _0x5317dc=_['map'](db[_0xd61d('0x37')][_0xd61d('0x38')],function(_0x19f25e){return{'name':_0x19f25e[_0xd61d('0x39')],'type':_0x19f25e[_0xd61d('0x3a')]['key']};});_0x4ed370=qs[_0xd61d('0x3b')](_0x5317dc,_0x3671d9);return interaction[_0xd61d('0x3c')](_0xd61d('0x3d'),_0x3671d9[_0xd61d('0x3e')],_0x3671d9['user'],_0x4ed370,_0x5317dc)['then'](respondWithFilteredResult(_0x4b5b11,_0x4ed370))[_0xd61d('0x24')](handleError(_0x4b5b11,null));};exports[_0xd61d('0x3f')]=function(_0x12d43c,_0x1689b9){var _0x18445e={'raw':![],'where':{'id':_0x12d43c[_0xd61d('0x40')]['id']}},_0x39fa1c={};_0x39fa1c['model']=_[_0xd61d('0x41')](db[_0xd61d('0x37')]['rawAttributes']);_0x39fa1c[_0xd61d('0x3e')]=_[_0xd61d('0x41')](_0x12d43c[_0xd61d('0x3e')]);_0x39fa1c[_0xd61d('0x42')]=_[_0xd61d('0x43')](_0x39fa1c[_0xd61d('0x44')],_0x39fa1c[_0xd61d('0x3e')]);_0x18445e[_0xd61d('0x45')]=_[_0xd61d('0x43')](_0x39fa1c[_0xd61d('0x44')],qs['fields'](_0x12d43c[_0xd61d('0x3e')]['fields']));_0x18445e[_0xd61d('0x45')]=_0x18445e[_0xd61d('0x45')][_0xd61d('0x46')]?_0x18445e['attributes']:_0x39fa1c[_0xd61d('0x44')];if(_0x12d43c[_0xd61d('0x3e')]['includeAll']){_0x18445e[_0xd61d('0x47')]=[{'all':!![]}];}_0x18445e=_['merge']({},_0x18445e,_0x12d43c[_0xd61d('0x48')]);return db[_0xd61d('0x37')][_0xd61d('0x49')](_0x18445e)['then'](handleEntityNotFound(_0x1689b9,null))[_0xd61d('0x19')](respondWithResult(_0x1689b9,null))[_0xd61d('0x24')](handleError(_0x1689b9,null));};exports['create']=function(_0x36f3b1,_0x44624a){return db[_0xd61d('0x37')][_0xd61d('0x4a')](_0x36f3b1[_0xd61d('0x33')],{})[_0xd61d('0x19')](respondWithResult(_0x44624a,0xc9))[_0xd61d('0x24')](handleError(_0x44624a,null));};exports[_0xd61d('0x4b')]=function(_0x5048c2,_0x1df258){if(_0x5048c2['body']['id']){delete _0x5048c2['body']['id'];}return db['ChatInteraction'][_0xd61d('0x49')]({'where':{'id':_0x5048c2[_0xd61d('0x40')]['id']}})[_0xd61d('0x19')](handleEntityNotFound(_0x1df258,null))[_0xd61d('0x19')](saveUpdates(_0x5048c2[_0xd61d('0x33')],null))[_0xd61d('0x19')](respondWithResult(_0x1df258,null))[_0xd61d('0x24')](handleError(_0x1df258,null));};exports[_0xd61d('0x2d')]=function(_0xe6f3e0,_0xfa82ba){return db[_0xd61d('0x37')]['find']({'where':{'id':_0xe6f3e0[_0xd61d('0x40')]['id']}})[_0xd61d('0x19')](handleEntityNotFound(_0xfa82ba,null))[_0xd61d('0x19')](removeEntity(_0xfa82ba,null))[_0xd61d('0x24')](handleError(_0xfa82ba,null));};exports[_0xd61d('0x4c')]=function(_0x4391b6,_0x16c7fa){return db[_0xd61d('0x37')][_0xd61d('0x4c')]()['then'](respondWithResult(_0x16c7fa,null))[_0xd61d('0x24')](handleError(_0x16c7fa,null));};exports['createVidaooSession']=function(_0x91bbd2,_0x4157ed){var _0x236e0a=_0x91bbd2[_0xd61d('0x40')]['id'];var _0x391a6e;var _0x13e841;var _0x3711f5;return db[_0xd61d('0x37')][_0xd61d('0x4d')]({'where':{'id':_0x236e0a}})[_0xd61d('0x19')](function(_0x151ffa){_0x391a6e=_0x151ffa;return db[_0xd61d('0x4e')][_0xd61d('0x4d')]({'where':{'id':_0x151ffa[_0xd61d('0x4f')]},'attributes':['id',_0xd61d('0x50'),_0xd61d('0x51'),'vidaooTopic',_0xd61d('0x52'),'vidaooMetadata'],'raw':!![]});})[_0xd61d('0x19')](function(_0x29a718){if(_0x29a718&&_0x29a718[_0xd61d('0x50')]&&_0x29a718[_0xd61d('0x51')]){_0x13e841=_0x29a718;var _0x4fe695={'interaction':{'id':_0x236e0a},'agent':{'id':_0x91bbd2[_0xd61d('0x53')]['id'],'name':_0x91bbd2[_0xd61d('0x53')][_0xd61d('0x30')],'fullname':_0x91bbd2['user']['fullname'],'email':_0x91bbd2['user']['email']},'contact':_0x91bbd2[_0xd61d('0x33')][_0xd61d('0x34')],'account':_0x91bbd2[_0xd61d('0x33')][_0xd61d('0x54')]};var _0x3f2f85={'rejectUnauthorized':![],'method':_0xd61d('0x55'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x29a718[_0xd61d('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x91bbd2[_0xd61d('0x53')][_0xd61d('0x56')]],'buttons':null,'topic':_0x13e841['vidaooTopic'],'note':_['isNull'](_0x13e841[_0xd61d('0x52')])?null:getMustacheRender(_0x13e841[_0xd61d('0x52')],_0x4fe695),'metadata':null},'redirect':_0xd61d('0x57'),'json':!![]};try{if(!_[_0xd61d('0x58')](_0x13e841[_0xd61d('0x59')])){var _0x2ec164=getMustacheRender(_0x13e841[_0xd61d('0x59')],_0x4fe695);var _0x263f8b=JSON[_0xd61d('0x5a')](_0x2ec164);_0x3f2f85[_0xd61d('0x33')]['metadata']=_0x263f8b;}}catch(_0x14d126){throw new db[(_0xd61d('0x5b'))]['ValidationError'](_0xd61d('0x5c'));}return rp(_0x3f2f85);}else{throw new db[(_0xd61d('0x5b'))][(_0xd61d('0x5d'))](_0xd61d('0x5e'));}})['then'](function(_0x4b8e5b){_0x3711f5=_0x4b8e5b;if(_0x3711f5['id']){var _0xdde9a0={'body':_0x3711f5['join_url'],'ChatWebsiteId':_0x13e841['id'],'ChatInteractionId':_0x391a6e['id'],'direction':'out','UserId':_0x91bbd2[_0xd61d('0x53')]['id']};return db['ChatMessage'][_0xd61d('0x4a')](_0xdde9a0,{});}else{throw new db['Sequelize'][(_0xd61d('0x5d'))](_0xd61d('0x5f'));}})[_0xd61d('0x19')](function(){return _0x391a6e[_0xd61d('0x60')]({'vidaooSessionId':_0x3711f5['id']});})[_0xd61d('0x19')](respondWithResult(_0x4157ed,null))[_0xd61d('0x24')](handleError(_0x4157ed,null));};exports[_0xd61d('0x61')]=function(_0x192c61,_0x4b3cb8){if(_0x192c61['body']['id']){delete _0x192c61['body']['id'];}return db[_0xd61d('0x37')][_0xd61d('0x49')]({'where':{'id':_0x192c61['params']['id']},'include':[{'model':db[_0xd61d('0x62')],'as':_0xd61d('0x63')}]})['then'](handleEntityNotFound(_0x4b3cb8,null))[_0xd61d('0x19')](saveUpdates(_0x192c61[_0xd61d('0x33')],null))[_0xd61d('0x19')](respondWithResult(_0x4b3cb8,null))[_0xd61d('0x24')](handleError(_0x4b3cb8,null));};exports['abandon']=function(_0x539704,_0xbeb4e){if(_0x539704[_0xd61d('0x33')]['id']){delete _0x539704['body']['id'];}return db['ChatInteraction'][_0xd61d('0x49')]({'where':{'id':_0x539704[_0xd61d('0x40')]['id']}})[_0xd61d('0x19')](function(_0x1385c0){if(!_0x1385c0){logger[_0xd61d('0x20')](_0xd61d('0x64'),'abandon',0x194,_0xd61d('0x65'));_0xbeb4e[_0xd61d('0x25')](0x194);}else{if(_0x1385c0[_0xd61d('0x66')]){throw new db[(_0xd61d('0x5b'))]['ValidationError'](_0xd61d('0x67'));}}return _0x1385c0;})[_0xd61d('0x19')](function(_0x5653e5){if(_0x5653e5){return _0x5653e5[_0xd61d('0x4b')]({'closed':_0x539704['body'][_0xd61d('0x68')],'disposition':_0x539704[_0xd61d('0x33')]['disposition']})[_0xd61d('0x19')](function(_0x2e175b){return _0x2e175b;});}})[_0xd61d('0x19')](function(){return respondWithRpcPromise(_0xd61d('0x69'),_0xd61d('0x6a'),_0x539704[_0xd61d('0x33')],client9004);})[_0xd61d('0x19')](respondWithResult(_0xbeb4e,null))[_0xd61d('0x24')](handleError(_0xbeb4e,null));};exports[_0xd61d('0x6b')]=function(_0x5bf53e,_0x4a6d25){_0x5bf53e['body']['name']=_0x5bf53e['file'][_0xd61d('0x6c')];_0x5bf53e[_0xd61d('0x33')]['basename']=_0x5bf53e[_0xd61d('0x6d')][_0xd61d('0x6e')];_0x5bf53e['body'][_0xd61d('0x3a')]=_0x5bf53e[_0xd61d('0x6d')]['mimetype'];return db[_0xd61d('0x6f')][_0xd61d('0x4a')](_0x5bf53e['body'])[_0xd61d('0x19')](respondWithResult(_0x4a6d25,0xc9))['catch'](handleError(_0x4a6d25,null));};exports[_0xd61d('0x70')]=function(_0x4bfd11,_0x380b00){return db['ChatInteraction']['findOne']({'where':{'id':_0x4bfd11[_0xd61d('0x40')]['id']},'raw':!![]})[_0xd61d('0x19')](handleEntityNotFound(_0x380b00,null))['then'](function(_0x31c8c9){if(_0x31c8c9){if(_0x31c8c9[_0xd61d('0x68')]){return _0x380b00['status'](0x193)[_0xd61d('0x2c')]({'status':0x193,'message':_0xd61d('0x71')});}return db[_0xd61d('0x6f')][_0xd61d('0x4d')]({'where':{'id':_0x4bfd11[_0xd61d('0x3e')]['attachId']},'raw':!![]})[_0xd61d('0x19')](handleEntityNotFound(_0x380b00,null));}})[_0xd61d('0x19')](function(_0x4e7d21){if(_0x4e7d21){var _0x5c7d42=_0x4e7d21[_0xd61d('0x72')]!==null;var _0x125ccd=path[_0xd61d('0x73')](config[_0xd61d('0x74')],_0xd61d('0x75'));if(_0x5c7d42){_0x125ccd=path[_0xd61d('0x73')](_0x125ccd,_0xd61d('0x76'));}var _0x53a853=path['join'](_0x125ccd,_0x4e7d21[_0xd61d('0x77')]);return _0x380b00[_0xd61d('0x78')](_0x53a853);}})[_0xd61d('0x24')](handleError(_0x380b00,null));};exports[_0xd61d('0x79')]=function(_0x2b9fc7,_0xd1d80a){var _0x51b207=null;var _0x2623ea=null;var _0x14a6bf=null;if(_0x2b9fc7['body']['id']){delete _0x2b9fc7['body']['id'];}if(_0x2b9fc7[_0xd61d('0x33')][_0xd61d('0x7a')]){_0x14a6bf=path['join'](config['root'],_0xd61d('0x7b'),util[_0xd61d('0x7c')]('transcript-%s.txt',Date[_0xd61d('0x7d')]()));_0x2b9fc7[_0xd61d('0x33')][_0xd61d('0x7e')]=_0x14a6bf;}return db[_0xd61d('0x37')][_0xd61d('0x49')]({'where':{'id':_0x2b9fc7['params']['id']},'include':[{'model':db[_0xd61d('0x7f')],'as':_0xd61d('0x80'),'include':[{'model':db['User'],'as':_0xd61d('0x81')}]}]})[_0xd61d('0x19')](handleEntityNotFound(_0xd1d80a,null))[_0xd61d('0x19')](saveUpdates(_0x2b9fc7[_0xd61d('0x33')],null))[_0xd61d('0x19')](function(_0x2619e7){if(_0x2619e7){_0x51b207=_0x2619e7;return db[_0xd61d('0x4e')][_0xd61d('0x49')]({'where':{'id':_0x51b207[_0xd61d('0x4f')]}});}})[_0xd61d('0x19')](function(_0x281cb2){if(_0x281cb2){_0x2623ea=_0x281cb2;return db[_0xd61d('0x62')][_0xd61d('0x49')]({'where':{'id':_0x51b207[_0xd61d('0x82')]}});}})[_0xd61d('0x19')](function(_0x4cceac){if(_0x4cceac){if(_0x14a6bf){var _0x3950ed=null;for(var _0x4e8a86=0x1;_0x4e8a86<_0x51b207[_0xd61d('0x80')][_0xd61d('0x46')];++_0x4e8a86){_0x3950ed=_0x51b207[_0xd61d('0x80')][_0x4e8a86];var _0x2755bf=_0x3950ed[_0xd61d('0x66')]?util[_0xd61d('0x7c')](_0xd61d('0x83'),_0x2623ea[_0xd61d('0x84')],_0x3950ed[_0xd61d('0x66')]):_0xd61d('0x85');var _0x455086=_0x2b9fc7[_0xd61d('0x33')][_0xd61d('0x86')]||util[_0xd61d('0x7c')](_0xd61d('0x83'),'Visitor',_0x3950ed[_0xd61d('0x82')]);switch(_0x2623ea[_0xd61d('0x87')]){case'website_alias':_0x2755bf=_0x3950ed[_0xd61d('0x66')]?util[_0xd61d('0x7c')](_0xd61d('0x83'),_0x2623ea['agentAlias'],_0x3950ed[_0xd61d('0x66')]):_0xd61d('0x85');break;case'agent_alias':_0x2755bf=_0x3950ed[_0xd61d('0x66')]?_0x3950ed[_0xd61d('0x81')][_0xd61d('0x88')]||_0x3950ed[_0xd61d('0x81')]['fullname']:'System';break;case _0xd61d('0x89'):_0x2755bf=_0x3950ed[_0xd61d('0x66')]?_0x3950ed['User'][_0xd61d('0x8a')]:_0xd61d('0x85');break;default:_0x2755bf=_0x3950ed[_0xd61d('0x66')]?util[_0xd61d('0x7c')](_0xd61d('0x83'),_0x2623ea[_0xd61d('0x84')],_0x3950ed[_0xd61d('0x66')]):'System';}var _0x511235=util[_0xd61d('0x7c')]('[%s]\x20%s:\x20%s\x0a',moment(_0x3950ed[_0xd61d('0x8b')])['format'](_0xd61d('0x8c')),_0x3950ed[_0xd61d('0x8d')]==='in'?_0x455086:_0x2755bf,_0x3950ed[_0xd61d('0x33')]);if(!_0x3950ed['secret']){fs['appendFileSync'](_0x14a6bf,_0x511235);}}return db[_0xd61d('0x8e')][_0xd61d('0x4d')]({'where':{'service':!![]},'include':[{'model':db[_0xd61d('0x8f')],'as':_0xd61d('0x90'),'raw':!![],'include':[{'model':db[_0xd61d('0x91')],'as':_0xd61d('0x91'),'raw':!![]}]}]});}}})[_0xd61d('0x19')](function(_0x5bb754){if(!_0x5bb754||!_0x5bb754[_0xd61d('0x90')]||!_0x2b9fc7[_0xd61d('0x33')])return _0x51b207;var _0x2499af=_0x5bb754[_0xd61d('0x92')]();return respondWithRpcPromise(_0xd61d('0x93'),_0xd61d('0x94'),{'account':_0x2499af,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x5bb754[_0xd61d('0x30')],_0x5bb754[_0xd61d('0x56')]||_0x5bb754[_0xd61d('0x90')][_0xd61d('0x53')]),'to':_0x2b9fc7[_0xd61d('0x33')][_0xd61d('0x7a')],'subject':'Mail\x20Transcript','text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x2b9fc7['body'][_0xd61d('0x7a')]),'attachments':[{'path':_0x14a6bf}]}})[_0xd61d('0x19')](function(){return _0x51b207;})[_0xd61d('0x24')](function(_0x19eb67){logger[_0xd61d('0x20')](_0x19eb67);});})[_0xd61d('0x19')](respondWithStatusCode(_0xd1d80a,0xc8))[_0xd61d('0x24')](handleError(_0xd1d80a,null));};exports[_0xd61d('0x95')]=function(_0x565184,_0x1dac71){return db[_0xd61d('0x7f')][_0xd61d('0x49')]({'where':{'id':_0x565184['params']['id']}})[_0xd61d('0x19')](handleEntityNotFound(_0x1dac71,null))[_0xd61d('0x19')](function(_0xa235){if(_0xa235){return _0xa235[_0xd61d('0x95')](_0x565184[_0xd61d('0x33')][_0xd61d('0x96')],_['omit'](_0x565184['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x1dac71,null))['catch'](handleError(_0x1dac71,null));};exports['getMessages']=function(_0x7a2085,_0x26d52e){var _0x296ab3={'raw':![],'where':{}};var _0x53badf={};var _0x2b0ea4={'count':0x0,'rows':[]};return db[_0xd61d('0x37')]['findOne']({'where':{'id':_0x7a2085[_0xd61d('0x40')]['id']}})[_0xd61d('0x19')](handleEntityNotFound(_0x26d52e,null))['then'](function(_0xb68e5e){if(_0xb68e5e){_0x53badf[_0xd61d('0x44')]=_[_0xd61d('0x41')](db[_0xd61d('0x7f')]['rawAttributes']);_0x53badf[_0xd61d('0x3e')]=_[_0xd61d('0x41')](_0x7a2085[_0xd61d('0x3e')]);_0x53badf[_0xd61d('0x42')]=_['intersection'](_0x53badf['model'],_0x53badf['query']);_0x296ab3[_0xd61d('0x45')]=_[_0xd61d('0x43')](_0x53badf[_0xd61d('0x44')],qs[_0xd61d('0x97')](_0x7a2085['query'][_0xd61d('0x97')]));_0x296ab3['attributes']=_0x296ab3[_0xd61d('0x45')][_0xd61d('0x46')]?_0x296ab3[_0xd61d('0x45')]:_0x53badf[_0xd61d('0x44')];if(!_0x7a2085[_0xd61d('0x3e')][_0xd61d('0x98')](_0xd61d('0x99'))){_0x296ab3[_0xd61d('0x2a')]=qs[_0xd61d('0x2a')](_0x7a2085[_0xd61d('0x3e')][_0xd61d('0x2a')]);_0x296ab3[_0xd61d('0x27')]=qs[_0xd61d('0x27')](_0x7a2085['query'][_0xd61d('0x27')]);}_0x296ab3[_0xd61d('0x9a')]=qs[_0xd61d('0x9b')](_0x7a2085['query'][_0xd61d('0x9b')]);_0x296ab3['where']=qs[_0xd61d('0x42')](_[_0xd61d('0x9c')](_0x7a2085['query'],_0x53badf[_0xd61d('0x42')]));_0x296ab3['where'][_0xd61d('0x9d')]=_0xb68e5e['id'];if(_0x7a2085[_0xd61d('0x3e')][_0xd61d('0x9e')]){_0x296ab3['where']=_[_0xd61d('0x9f')](_0x296ab3['where'],{'$or':_[_0xd61d('0xa0')](_0x296ab3[_0xd61d('0x45')],function(_0x5d7c34){var _0x327924={};_0x327924[_0x5d7c34]={'$like':'%'+_0x7a2085['query'][_0xd61d('0x9e')]+'%'};return _0x327924;})});}if(_0x7a2085[_0xd61d('0x3e')][_0xd61d('0xa1')]){var _0x268a3b=_0x7a2085[_0xd61d('0x3e')][_0xd61d('0xa1')][_0xd61d('0xa2')](',');var _0x388780={};_0x388780[_0x268a3b[0x0]]={'$gte':moment(_0x268a3b[0x1])[_0xd61d('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x296ab3[_0xd61d('0xa3')]=_['merge'](_0x296ab3[_0xd61d('0xa3')],_0x388780);}_0x296ab3=_['merge']({},_0x296ab3,_0x7a2085[_0xd61d('0x48')]);return db[_0xd61d('0x7f')]['count']({'where':_0x296ab3[_0xd61d('0xa3')]})[_0xd61d('0x19')](function(_0x2fc0c1){_0x2b0ea4[_0xd61d('0x29')]=_0x2fc0c1;if(_0x7a2085[_0xd61d('0x3e')][_0xd61d('0xa4')]){_0x296ab3[_0xd61d('0x47')]=[{'all':!![]}];}return db['ChatMessage'][_0xd61d('0x3c')](_0x296ab3);})[_0xd61d('0x19')](function(_0x18fbab){_0x2b0ea4[_0xd61d('0xa5')]=_0x18fbab;return _0x2b0ea4;});}})['then'](respondWithFilteredResult(_0x26d52e,_0x296ab3))[_0xd61d('0x24')](handleError(_0x26d52e,null));};exports[_0xd61d('0xa6')]=function(_0x306ab4,_0x23a459){var _0x4ac4cb={'where':{}},_0xb894cb={},_0x3ff9e0={'count':0x0,'rows':[]};return db[_0xd61d('0x37')][_0xd61d('0x4d')]({'where':{'id':_0x306ab4[_0xd61d('0x40')]['id']}})[_0xd61d('0x19')](handleEntityNotFound(_0x23a459,null))[_0xd61d('0x19')](function(_0xfa561f){if(_0xfa561f){_0xb894cb[_0xd61d('0x44')]=_['keys'](db['ChatMessage']['rawAttributes']);_0xb894cb['query']=_[_0xd61d('0x41')](_0x306ab4[_0xd61d('0x3e')]);_0xb894cb['filters']=_[_0xd61d('0x43')](_0xb894cb['model'],_0xb894cb[_0xd61d('0x3e')]);_0x4ac4cb[_0xd61d('0x45')]=_[_0xd61d('0x43')](_0xb894cb[_0xd61d('0x44')],qs[_0xd61d('0x97')](_0x306ab4[_0xd61d('0x3e')][_0xd61d('0x97')]));_0x4ac4cb[_0xd61d('0x45')]=_0x4ac4cb['attributes']['length']?_0x4ac4cb[_0xd61d('0x45')]:_0xb894cb[_0xd61d('0x44')];if(!_0x306ab4[_0xd61d('0x3e')][_0xd61d('0x98')](_0xd61d('0x99'))){_0x4ac4cb[_0xd61d('0x2a')]=qs[_0xd61d('0x2a')](_0x306ab4[_0xd61d('0x3e')][_0xd61d('0x2a')]);_0x4ac4cb[_0xd61d('0x27')]=qs[_0xd61d('0x27')](_0x306ab4['query'][_0xd61d('0x27')]);}_0x4ac4cb[_0xd61d('0x9a')]=qs['sort'](_0x306ab4[_0xd61d('0x3e')][_0xd61d('0x9b')]);_0x4ac4cb[_0xd61d('0xa3')]=qs[_0xd61d('0x42')](_[_0xd61d('0x9c')](_0x306ab4[_0xd61d('0x3e')],_0xb894cb[_0xd61d('0x42')]));_0x4ac4cb[_0xd61d('0xa3')]['ChatInteractionId']=_0xfa561f['id'];if(_0x306ab4['query']['filter']){_0x4ac4cb[_0xd61d('0xa3')]=_[_0xd61d('0x9f')](_0x4ac4cb[_0xd61d('0xa3')],{'$or':_[_0xd61d('0xa0')](_0x4ac4cb[_0xd61d('0x45')],function(_0x10417a){var _0x5e2679={};_0x5e2679[_0x10417a]={'$like':'%'+_0x306ab4['query']['filter']+'%'};return _0x5e2679;})});}_0x4ac4cb[_0xd61d('0xa3')][_0xd61d('0xa7')]=![];if(_0x306ab4[_0xd61d('0x3e')]['id']){_0x4ac4cb[_0xd61d('0xa3')]['id']={'$gt':_0x306ab4['query']['id']};}_0x4ac4cb=_[_0xd61d('0x9f')]({},_0x4ac4cb,_0x306ab4[_0xd61d('0x48')]);return db[_0xd61d('0x7f')][_0xd61d('0x29')]({'where':_0x4ac4cb[_0xd61d('0xa3')]})[_0xd61d('0x19')](function(_0x49258a){_0x3ff9e0[_0xd61d('0x29')]=_0x49258a;_0x4ac4cb[_0xd61d('0x47')]=[];if(_0x306ab4[_0xd61d('0x3e')][_0xd61d('0xa8')]){_0x4ac4cb[_0xd61d('0x47')][_0xd61d('0xa9')]({'model':db[_0xd61d('0x81')],'as':'User','attributes':['id',_0xd61d('0x8a'),'alias']});}if(_0x306ab4[_0xd61d('0x3e')][_0xd61d('0xa4')]){_0x4ac4cb['include']=[{'all':!![]}];}return db[_0xd61d('0x7f')][_0xd61d('0x3c')](_0x4ac4cb);})[_0xd61d('0x19')](function(_0x25c080){_0x3ff9e0['rows']=_0x25c080;return _0x3ff9e0;});}})[_0xd61d('0x19')](respondWithFilteredResult(_0x23a459,_0x4ac4cb))[_0xd61d('0x24')](handleError(_0x23a459,null));};exports[_0xd61d('0xaa')]=function(_0x35dbd9,_0x4b5819){return db[_0xd61d('0x37')][_0xd61d('0x49')]({'where':{'id':_0x35dbd9[_0xd61d('0x40')]['id']}})['then'](handleEntityNotFound(_0x4b5819,null))[_0xd61d('0x19')](function(_0x325fb2){if(_0x325fb2){return _0x325fb2[_0xd61d('0xab')](_0x35dbd9[_0xd61d('0x33')][_0xd61d('0x96')],_['omit'](_0x35dbd9[_0xd61d('0x33')],[_0xd61d('0x96'),'id'])||{})[_0xd61d('0xac')](function(){return db[_0xd61d('0xad')][_0xd61d('0x3c')]({'attributes':['id',_0xd61d('0x30'),'color'],'where':{'id':_0x35dbd9[_0xd61d('0x33')][_0xd61d('0x96')]}});})[_0xd61d('0x19')](function(_0x443dfb){socket['emit'](_0xd61d('0xae'),{'id':Number(_0x35dbd9[_0xd61d('0x40')]['id']),'tags':_0x443dfb||[]});return{'id':Number(_0x35dbd9['params']['id']),'tags':_0x443dfb||[]};});}})[_0xd61d('0x19')](respondWithResult(_0x4b5819,null))[_0xd61d('0x24')](handleError(_0x4b5819,null));};exports[_0xd61d('0xaf')]=function(_0x194d83,_0x4c0935){return db[_0xd61d('0x37')]['find']({'where':{'id':_0x194d83['params']['id']}})[_0xd61d('0x19')](handleEntityNotFound(_0x4c0935,null))[_0xd61d('0x19')](function(_0x39fe90){if(_0x39fe90){return _0x39fe90[_0xd61d('0xaf')](_0x194d83['query'][_0xd61d('0x96')]);}})[_0xd61d('0x19')](respondWithStatusCode(_0x4c0935,null))['catch'](handleError(_0x4c0935,null));};exports[_0xd61d('0x78')]=function(_0x7fe37e,_0x47c357){var _0x4529c1=moment()['unix']()['toString']();var _0x49fd02=path['join'](config[_0xd61d('0x74')],'server',_0xd61d('0xb0'),'tmp');var _0x20ba73=path[_0xd61d('0x73')](config[_0xd61d('0x74')],_0xd61d('0xb1'),_0xd61d('0xb0'),'attachments');var _0x4ffaa8=path[_0xd61d('0x73')](_0x49fd02,_0x4529c1);var _0x42d924=util[_0xd61d('0x7c')](_0xd61d('0xb2'),_0x7fe37e[_0xd61d('0x40')]['id'],_0x4529c1);var _0x142740=path[_0xd61d('0x73')](_0x49fd02,_0x42d924);var _0x16fe3a=[];_0x16fe3a[_0xd61d('0xa9')]({'model':db[_0xd61d('0x81')],'as':_0xd61d('0x81'),'attributes':['id',_0xd61d('0x8a')],'raw':!![]});_0x16fe3a[_0xd61d('0xa9')]({'model':db[_0xd61d('0x62')],'as':_0xd61d('0x63'),'attributes':['id',_0xd61d('0xb3'),'lastName'],'raw':!![]});if(_0x7fe37e[_0xd61d('0x3e')]['attachments']){_0x16fe3a[_0xd61d('0xa9')]({'model':db[_0xd61d('0x6f')],'as':'Attachment','raw':!![]});}var _0x5b78d4=[{'model':db['ChatMessage'],'as':_0xd61d('0x80'),'attributes':['id',_0xd61d('0x33'),_0xd61d('0x8b'),'direction',_0xd61d('0xa7'),'read'],'include':_0x16fe3a}];_0x5b78d4[_0xd61d('0xa9')]({'model':db['ChatWebsite'],'as':_0xd61d('0xb4'),'attributes':['id',_0xd61d('0x30')]});_0x5b78d4[_0xd61d('0xa9')]({'model':db['User'],'as':'Owner','attributes':['id',_0xd61d('0x8a')]});return db[_0xd61d('0x37')][_0xd61d('0x49')]({'where':{'id':_0x7fe37e[_0xd61d('0x40')]['id']},'include':_0x5b78d4})[_0xd61d('0x19')](handleEntityNotFound(_0x47c357,null))[_0xd61d('0x19')](function(_0x4f3e93){if(_0x4f3e93){var _0x5bb667=_0x4f3e93[_0xd61d('0xb5')]({'plain':!![]});fs['mkdirSync'](_0x4ffaa8);var _0x56eabe={'channel':'Chat','account':_0x5bb667[_0xd61d('0xb4')][_0xd61d('0x30')],'agent':_0x5bb667[_0xd61d('0xb6')]?_0x5bb667[_0xd61d('0xb6')]['fullname']:_0xd61d('0xb7'),'createdAt':moment(_0x5bb667[_0xd61d('0x8b')])[_0xd61d('0x7c')](_0xd61d('0xb8'))[_0xd61d('0xb9')](),'closedAt':_0x5bb667['closed']?moment(_0x5bb667[_0xd61d('0xba')])[_0xd61d('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd61d('0xb9')]():'','disposition':_0x5bb667[_0xd61d('0xbb')],'chatInfo':{'browser':_0x5bb667[_0xd61d('0xbc')],'os':_0x5bb667[_0xd61d('0xbd')],'referer':_0x5bb667['referer'],'customerIp':_0x5bb667[_0xd61d('0xbe')],'customerPort':_0x5bb667[_0xd61d('0xbf')]?_0x5bb667[_0xd61d('0xbf')]:_0xd61d('0xb7')},'messages':_(_0x5bb667[_0xd61d('0x80')])[_0xd61d('0xc0')]()['filter']({'secret':![]})[_0xd61d('0xa0')](function(_0x3679e8){if(_0x3679e8[_0xd61d('0x6f')]){var _0x5bf04d=path['join'](_0x20ba73,_0x3679e8[_0xd61d('0x6f')][_0xd61d('0x77')]);if(fs[_0xd61d('0xc1')](_0x5bf04d)){fs[_0xd61d('0xc2')](_0x5bf04d)[_0xd61d('0xc3')](fs[_0xd61d('0xc4')](path[_0xd61d('0x73')](_0x4ffaa8,_0x3679e8['Attachment'][_0xd61d('0x77')])));}}return{'date':moment(_0x3679e8['createdAt'])['format'](_0xd61d('0xb8'))[_0xd61d('0xb9')](),'sender':_0x3679e8[_0xd61d('0x8d')]==='out'?_0x3679e8[_0xd61d('0x81')]?_0x3679e8['User'][_0xd61d('0x8a')]:_0xd61d('0x85'):_0x3679e8[_0xd61d('0x63')]['firstName']+(_0x3679e8[_0xd61d('0x63')]['lastName']?'\x20'+_0x3679e8[_0xd61d('0x63')][_0xd61d('0xc5')]:''),'body':_0x3679e8[_0xd61d('0x6f')]?_0x3679e8['Attachment'][_0xd61d('0x77')]:_0x3679e8[_0xd61d('0x33')],'direction':_0x3679e8[_0xd61d('0x8d')]==='out'?'A':'C','secret':_0x3679e8[_0xd61d('0xa7')],'read':_0x3679e8[_0xd61d('0xc6')],'attachment':_0x3679e8[_0xd61d('0x6f')]};})[_0xd61d('0xc7')]()};return ejs[_0xd61d('0xc8')](path[_0xd61d('0x73')](config[_0xd61d('0x74')],_0xd61d('0xb1'),_0xd61d('0xc9'),_0xd61d('0xca')),{'interaction':_0x56eabe})['then'](function(_0x35f3a0){var _0x350643=path['join'](_0x4ffaa8,_0xd61d('0xcb')+_0x5bb667['id']+'-'+_0x4529c1+'.pdf');var _0x133d88={'path':_0x350643,'channel':_0xd61d('0xcc'),'interactionId':_0x5bb667['id']};return pdf['createPdfFromHTML'](_0x35f3a0,_0x133d88);})[_0xd61d('0x19')](function(){return new Promise(function(_0x342176,_0x18ac1d){zipdir(_0x4ffaa8,{'saveTo':_0x142740},function(_0x28d1d4,_0x515c55){if(_0x28d1d4)return _0x18ac1d(_0x28d1d4);return _0x342176(_0x515c55);});})[_0xd61d('0x19')](function(){return new BPromise(function(_0x3887bd,_0x15e8b5){rimraf(_0x4ffaa8,function(_0x3ba416){if(_0x3ba416)_0x15e8b5(_0x3ba416);return _0x3887bd();});});})['then'](function(){return _0x47c357['download'](_0x142740,_0x42d924,function(_0x2d92b1){if(_0x2d92b1){logger[_0xd61d('0x20')](_0xd61d('0xcd'),_0x2d92b1);}else{fs[_0xd61d('0xce')](_0x142740);}});});});}else{return _0x47c357[_0xd61d('0x25')](0xc8);}})[_0xd61d('0x24')](handleError(_0x47c357,null));}; \ No newline at end of file +var _0xa567=['file','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','basename','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','Messages','User','ContactId','%s%d','System','Visitor','agentIdentifier','agentAlias','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','push','rows','addTags','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','files','server','transcript-%d-%s.zip','Contact','lastName','attachments','read','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','firstName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','ChatInteraction,\x20%s,\x20%s','result','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','stack','name','merge','body','agent','interaction','index','map','ChatInteraction','rawAttributes','fieldName','type','key','user','catch','show','params','model','keys','filters','intersection','attributes','fields','query','includeAll','include','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','contact','account','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','sendStatus','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload'];(function(_0x116549,_0x210e8b){var _0x1321e5=function(_0x413542){while(--_0x413542){_0x116549['push'](_0x116549['shift']());}};_0x1321e5(++_0x210e8b);}(_0xa567,0x6b));var _0x7a56=function(_0x26601b,_0x154b3a){_0x26601b=_0x26601b-0x0;var _0x518c0c=_0xa567[_0x26601b];return _0x518c0c;};'use strict';var rimraf=require(_0x7a56('0x0'));var zipdir=require('zip-dir');var rp=require(_0x7a56('0x1'));var moment=require(_0x7a56('0x2'));var BPromise=require(_0x7a56('0x3'));var Mustache=require(_0x7a56('0x4'));var util=require(_0x7a56('0x5'));var path=require(_0x7a56('0x6'));var ejs=require(_0x7a56('0x7'));var fs=require('fs');var _=require(_0x7a56('0x8'));var Redis=require(_0x7a56('0x9'));var interaction=require(_0x7a56('0xa'));var qs=require(_0x7a56('0xb'));var pdf=require(_0x7a56('0xc'));var logger=require('../../config/logger')(_0x7a56('0xd'));var config=require(_0x7a56('0xe'));var db=require(_0x7a56('0xf'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7a56('0x10'))[_0x7a56('0x11')](socket);var jayson=require(_0x7a56('0x12'));var client=jayson[_0x7a56('0x13')][_0x7a56('0x14')]({'port':0x232b});var client9004=jayson[_0x7a56('0x13')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2406ed,_0x1c98cd,_0x26de36,_0x5bf243){return new BPromise(function(_0x544242,_0x415989){var _0x39f953=_0x5bf243||client;return _0x39f953[_0x7a56('0x15')](_0x2406ed,_0x26de36)[_0x7a56('0x16')](function(_0x41c8d3){logger[_0x7a56('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x1c98cd,'request\x20sent');logger[_0x7a56('0x18')](_0x7a56('0x19'),_0x1c98cd,_0x7a56('0x1a'),JSON[_0x7a56('0x1b')](_0x41c8d3));if(_0x41c8d3['error']){if(_0x41c8d3['error'][_0x7a56('0x1c')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x1c98cd,_0x41c8d3['error'][_0x7a56('0x1d')]);return _0x415989(_0x41c8d3[_0x7a56('0x1e')][_0x7a56('0x1d')]);}logger[_0x7a56('0x1e')](_0x7a56('0x1f'),_0x1c98cd,_0x41c8d3[_0x7a56('0x1e')][_0x7a56('0x1d')]);return _0x544242(_0x41c8d3['error'][_0x7a56('0x1d')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x1c98cd,_0x7a56('0x1a'));_0x544242(_0x41c8d3[_0x7a56('0x20')][_0x7a56('0x1d')]);}})['catch'](function(_0x500b02){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x1c98cd,_0x500b02);_0x415989(_0x500b02);});});}function respondWithStatusCode(_0x4b6ab7,_0x16ac83){_0x16ac83=_0x16ac83||0xcc;return function(_0x547848){if(_0x547848){return _0x4b6ab7['sendStatus'](_0x16ac83);}return _0x4b6ab7[_0x7a56('0x21')](_0x16ac83)[_0x7a56('0x22')]();};}function respondWithResult(_0x15fe58,_0x44f2a9){_0x44f2a9=_0x44f2a9||0xc8;return function(_0x5bdac5){if(_0x5bdac5){return _0x15fe58[_0x7a56('0x21')](_0x44f2a9)[_0x7a56('0x23')](_0x5bdac5);}};}function respondWithFilteredResult(_0x488d4a,_0x13bdbe){return function(_0x54b8b4){if(_0x54b8b4){var _0x59e173=typeof _0x13bdbe[_0x7a56('0x24')]===_0x7a56('0x25')&&typeof _0x13bdbe['limit']===_0x7a56('0x25');var _0x446e89=_0x54b8b4[_0x7a56('0x26')];var _0xe4b56=_0x59e173?0x0:_0x13bdbe[_0x7a56('0x24')];var _0x5a92b8=_0x59e173?_0x54b8b4[_0x7a56('0x26')]:_0x13bdbe['offset']+_0x13bdbe['limit'];var _0x5acb05;if(_0x5a92b8>=_0x446e89){_0x5a92b8=_0x446e89;_0x5acb05=0xc8;}else{_0x5acb05=0xce;}_0x488d4a['status'](_0x5acb05);return _0x488d4a[_0x7a56('0x27')](_0x7a56('0x28'),_0xe4b56+'-'+_0x5a92b8+'/'+_0x446e89)[_0x7a56('0x23')](_0x54b8b4);}return null;};}function saveUpdates(_0x2a3630){return function(_0xd9a257){if(_0xd9a257){return _0xd9a257[_0x7a56('0x29')](_0x2a3630)['then'](function(_0x27b99a){return _0x27b99a;});}return null;};}function removeEntity(_0x4e7828){return function(_0x5182f8){if(_0x5182f8){return _0x5182f8[_0x7a56('0x2a')]()[_0x7a56('0x16')](function(){_0x4e7828['status'](0xcc)[_0x7a56('0x22')]();});}};}function handleEntityNotFound(_0x5a6719){return function(_0x244455){if(!_0x244455){_0x5a6719['sendStatus'](0x194);}return _0x244455;};}function handleError(_0x21e22d,_0x4a9f40){_0x4a9f40=_0x4a9f40||0x1f4;return function(_0x301c53){logger[_0x7a56('0x1e')](_0x301c53[_0x7a56('0x2b')]);if(_0x301c53[_0x7a56('0x2c')]){delete _0x301c53[_0x7a56('0x2c')];}_0x21e22d['status'](_0x4a9f40)['send'](_0x301c53);};}function getMustacheRender(_0x3c336d,_0x5e1baf){return Mustache['render'](_0x3c336d,_[_0x7a56('0x2d')](_0x5e1baf[_0x7a56('0x2e')],{'contact':_0x5e1baf['contact'],'message':_0x5e1baf[_0x7a56('0x1d')],'agent':_0x5e1baf[_0x7a56('0x2f')],'interaction':_0x5e1baf[_0x7a56('0x30')],'account':_0x5e1baf['account']}))||'';}exports[_0x7a56('0x31')]=function(_0x4cb8b4,_0x31e5e5){var _0x5245b9={};var _0x25b0c8=_[_0x7a56('0x32')](db[_0x7a56('0x33')][_0x7a56('0x34')],function(_0x3bd6e2){return{'name':_0x3bd6e2[_0x7a56('0x35')],'type':_0x3bd6e2[_0x7a56('0x36')][_0x7a56('0x37')]};});_0x5245b9=qs['getOptions'](_0x25b0c8,_0x4cb8b4);return interaction['findAll']('chat',_0x4cb8b4['query'],_0x4cb8b4[_0x7a56('0x38')],_0x5245b9,_0x25b0c8)[_0x7a56('0x16')](respondWithFilteredResult(_0x31e5e5,_0x5245b9))[_0x7a56('0x39')](handleError(_0x31e5e5,null));};exports[_0x7a56('0x3a')]=function(_0x1962d5,_0x258bc6){var _0xc43a1b={'raw':![],'where':{'id':_0x1962d5[_0x7a56('0x3b')]['id']}},_0x223e00={};_0x223e00[_0x7a56('0x3c')]=_[_0x7a56('0x3d')](db[_0x7a56('0x33')][_0x7a56('0x34')]);_0x223e00['query']=_['keys'](_0x1962d5['query']);_0x223e00[_0x7a56('0x3e')]=_[_0x7a56('0x3f')](_0x223e00[_0x7a56('0x3c')],_0x223e00['query']);_0xc43a1b[_0x7a56('0x40')]=_[_0x7a56('0x3f')](_0x223e00[_0x7a56('0x3c')],qs[_0x7a56('0x41')](_0x1962d5[_0x7a56('0x42')][_0x7a56('0x41')]));_0xc43a1b['attributes']=_0xc43a1b['attributes']['length']?_0xc43a1b[_0x7a56('0x40')]:_0x223e00['model'];if(_0x1962d5['query'][_0x7a56('0x43')]){_0xc43a1b[_0x7a56('0x44')]=[{'all':!![]}];}_0xc43a1b=_[_0x7a56('0x2d')]({},_0xc43a1b,_0x1962d5[_0x7a56('0x45')]);return db[_0x7a56('0x33')][_0x7a56('0x46')](_0xc43a1b)[_0x7a56('0x16')](handleEntityNotFound(_0x258bc6,null))[_0x7a56('0x16')](respondWithResult(_0x258bc6,null))[_0x7a56('0x39')](handleError(_0x258bc6,null));};exports[_0x7a56('0x47')]=function(_0x2ab914,_0x6b2e49){return db[_0x7a56('0x33')][_0x7a56('0x47')](_0x2ab914[_0x7a56('0x2e')],{})[_0x7a56('0x16')](respondWithResult(_0x6b2e49,0xc9))[_0x7a56('0x39')](handleError(_0x6b2e49,null));};exports[_0x7a56('0x29')]=function(_0x469178,_0x1dab28){if(_0x469178[_0x7a56('0x2e')]['id']){delete _0x469178[_0x7a56('0x2e')]['id'];}return db[_0x7a56('0x33')][_0x7a56('0x46')]({'where':{'id':_0x469178['params']['id']}})['then'](handleEntityNotFound(_0x1dab28,null))[_0x7a56('0x16')](saveUpdates(_0x469178['body'],null))['then'](respondWithResult(_0x1dab28,null))['catch'](handleError(_0x1dab28,null));};exports[_0x7a56('0x2a')]=function(_0x5e4379,_0x504330){return db[_0x7a56('0x33')]['find']({'where':{'id':_0x5e4379['params']['id']}})[_0x7a56('0x16')](handleEntityNotFound(_0x504330,null))[_0x7a56('0x16')](removeEntity(_0x504330,null))[_0x7a56('0x39')](handleError(_0x504330,null));};exports['describe']=function(_0x13f388,_0x1a6ecf){return db['ChatInteraction'][_0x7a56('0x48')]()[_0x7a56('0x16')](respondWithResult(_0x1a6ecf,null))[_0x7a56('0x39')](handleError(_0x1a6ecf,null));};exports[_0x7a56('0x49')]=function(_0x17081f,_0x5e7316){var _0x55f47b=_0x17081f[_0x7a56('0x3b')]['id'];var _0x120b8a;var _0x37fe97;var _0x29a536;return db[_0x7a56('0x33')][_0x7a56('0x4a')]({'where':{'id':_0x55f47b}})[_0x7a56('0x16')](function(_0x3bfc05){_0x120b8a=_0x3bfc05;return db[_0x7a56('0x4b')][_0x7a56('0x4a')]({'where':{'id':_0x3bfc05[_0x7a56('0x4c')]},'attributes':['id',_0x7a56('0x4d'),_0x7a56('0x4e'),_0x7a56('0x4f'),_0x7a56('0x50'),_0x7a56('0x51')],'raw':!![]});})['then'](function(_0x3e025d){if(_0x3e025d&&_0x3e025d['vidaooApiKey']&&_0x3e025d['vidaooEscalation']){_0x37fe97=_0x3e025d;var _0x35f8aa={'interaction':{'id':_0x55f47b},'agent':{'id':_0x17081f[_0x7a56('0x38')]['id'],'name':_0x17081f[_0x7a56('0x38')]['name'],'fullname':_0x17081f['user']['fullname'],'email':_0x17081f[_0x7a56('0x38')]['email']},'contact':_0x17081f[_0x7a56('0x2e')][_0x7a56('0x52')],'account':_0x17081f[_0x7a56('0x2e')][_0x7a56('0x53')]};var _0x1f1688={'rejectUnauthorized':![],'method':'POST','url':_0x7a56('0x54'),'headers':{'X-APIKEY':_0x3e025d[_0x7a56('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x17081f['user']['email']],'buttons':null,'topic':_0x37fe97[_0x7a56('0x4f')],'note':_['isNull'](_0x37fe97['vidaooNote'])?null:getMustacheRender(_0x37fe97['vidaooNote'],_0x35f8aa),'metadata':null},'redirect':_0x7a56('0x55'),'json':!![]};try{if(!_[_0x7a56('0x56')](_0x37fe97[_0x7a56('0x51')])){var _0x9b37dd=getMustacheRender(_0x37fe97[_0x7a56('0x51')],_0x35f8aa);var _0x184454=JSON['parse'](_0x9b37dd);_0x1f1688['body'][_0x7a56('0x57')]=_0x184454;}}catch(_0x4489fc){throw new db[(_0x7a56('0x58'))][(_0x7a56('0x59'))](_0x7a56('0x5a'));}return rp(_0x1f1688);}else{throw new db[(_0x7a56('0x58'))]['ValidationError'](_0x7a56('0x5b'));}})[_0x7a56('0x16')](function(_0x104a7e){_0x29a536=_0x104a7e;if(_0x29a536['id']){var _0x15d6a7={'body':_0x29a536[_0x7a56('0x5c')],'ChatWebsiteId':_0x37fe97['id'],'ChatInteractionId':_0x120b8a['id'],'direction':_0x7a56('0x5d'),'UserId':_0x17081f[_0x7a56('0x38')]['id']};return db[_0x7a56('0x5e')][_0x7a56('0x47')](_0x15d6a7,{});}else{throw new db['Sequelize'][(_0x7a56('0x59'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x7a56('0x16')](function(){return _0x120b8a['updateAttributes']({'vidaooSessionId':_0x29a536['id']});})[_0x7a56('0x16')](respondWithResult(_0x5e7316,null))[_0x7a56('0x39')](handleError(_0x5e7316,null));};exports['customUpdate']=function(_0x9923ad,_0x9aaf05){if(_0x9923ad[_0x7a56('0x2e')]['id']){delete _0x9923ad[_0x7a56('0x2e')]['id'];}return db[_0x7a56('0x33')][_0x7a56('0x46')]({'where':{'id':_0x9923ad[_0x7a56('0x3b')]['id']},'include':[{'model':db[_0x7a56('0x5f')],'as':'Contact'}]})[_0x7a56('0x16')](handleEntityNotFound(_0x9aaf05,null))[_0x7a56('0x16')](saveUpdates(_0x9923ad[_0x7a56('0x2e')],null))[_0x7a56('0x16')](respondWithResult(_0x9aaf05,null))[_0x7a56('0x39')](handleError(_0x9aaf05,null));};exports[_0x7a56('0x60')]=function(_0x26d991,_0x1cf277){if(_0x26d991[_0x7a56('0x2e')]['id']){delete _0x26d991[_0x7a56('0x2e')]['id'];}return db[_0x7a56('0x33')]['find']({'where':{'id':_0x26d991[_0x7a56('0x3b')]['id']}})[_0x7a56('0x16')](function(_0x153fd3){if(!_0x153fd3){logger[_0x7a56('0x1e')](_0x7a56('0x61'),'abandon',0x194,'entity\x20not\x20found');_0x1cf277[_0x7a56('0x62')](0x194);}else{if(_0x153fd3[_0x7a56('0x63')]){throw new db[(_0x7a56('0x58'))][(_0x7a56('0x59'))](_0x7a56('0x64'));}}return _0x153fd3;})[_0x7a56('0x16')](function(_0x30d3b6){if(_0x30d3b6){return _0x30d3b6[_0x7a56('0x29')]({'closed':_0x26d991[_0x7a56('0x2e')][_0x7a56('0x65')],'disposition':_0x26d991[_0x7a56('0x2e')][_0x7a56('0x66')]})[_0x7a56('0x16')](function(_0x1f1bd0){return _0x1f1bd0;});}})['then'](function(){return respondWithRpcPromise(_0x7a56('0x67'),_0x7a56('0x60'),_0x26d991[_0x7a56('0x2e')],client9004);})[_0x7a56('0x16')](respondWithResult(_0x1cf277,null))[_0x7a56('0x39')](handleError(_0x1cf277,null));};exports[_0x7a56('0x68')]=function(_0x4e8045,_0x1f673c){_0x4e8045[_0x7a56('0x2e')]['name']=_0x4e8045['file']['originalname'];_0x4e8045[_0x7a56('0x2e')]['basename']=_0x4e8045['file']['filename'];_0x4e8045[_0x7a56('0x2e')][_0x7a56('0x36')]=_0x4e8045[_0x7a56('0x69')][_0x7a56('0x6a')];return db[_0x7a56('0x6b')][_0x7a56('0x47')](_0x4e8045[_0x7a56('0x2e')])[_0x7a56('0x16')](respondWithResult(_0x1f673c,0xc9))[_0x7a56('0x39')](handleError(_0x1f673c,null));};exports[_0x7a56('0x6c')]=function(_0x342e93,_0x28a508){return db[_0x7a56('0x33')]['findOne']({'where':{'id':_0x342e93[_0x7a56('0x3b')]['id']},'raw':!![]})[_0x7a56('0x16')](handleEntityNotFound(_0x28a508,null))[_0x7a56('0x16')](function(_0x4ee802){if(_0x4ee802){if(_0x4ee802[_0x7a56('0x65')]){return _0x28a508[_0x7a56('0x21')](0x193)[_0x7a56('0x23')]({'status':0x193,'message':_0x7a56('0x6d')});}return db['Attachment'][_0x7a56('0x4a')]({'where':{'id':_0x342e93[_0x7a56('0x42')][_0x7a56('0x6e')]},'raw':!![]})['then'](handleEntityNotFound(_0x28a508,null));}})[_0x7a56('0x16')](function(_0x5cfb44){if(_0x5cfb44){var _0x7f6b29=_0x5cfb44['ChatOfflineMessageId']!==null;var _0x4dca5b=path[_0x7a56('0x6f')](config[_0x7a56('0x70')],_0x7a56('0x71'));if(_0x7f6b29){_0x4dca5b=path[_0x7a56('0x6f')](_0x4dca5b,'offline-chat/');}var _0x11cc9a=path[_0x7a56('0x6f')](_0x4dca5b,_0x5cfb44[_0x7a56('0x72')]);return _0x28a508['download'](_0x11cc9a);}})[_0x7a56('0x39')](handleError(_0x28a508,null));};exports[_0x7a56('0x73')]=function(_0x1494cf,_0x5a841a){var _0x3c9621=null;var _0x1ad117=null;var _0x5392e3=null;if(_0x1494cf[_0x7a56('0x2e')]['id']){delete _0x1494cf[_0x7a56('0x2e')]['id'];}if(_0x1494cf[_0x7a56('0x2e')][_0x7a56('0x74')]){_0x5392e3=path[_0x7a56('0x6f')](config['root'],_0x7a56('0x75'),util[_0x7a56('0x76')](_0x7a56('0x77'),Date['now']()));_0x1494cf['body']['pathTranscript']=_0x5392e3;}return db[_0x7a56('0x33')][_0x7a56('0x46')]({'where':{'id':_0x1494cf[_0x7a56('0x3b')]['id']},'include':[{'model':db[_0x7a56('0x5e')],'as':_0x7a56('0x78'),'include':[{'model':db[_0x7a56('0x79')],'as':_0x7a56('0x79')}]}]})['then'](handleEntityNotFound(_0x5a841a,null))['then'](saveUpdates(_0x1494cf['body'],null))[_0x7a56('0x16')](function(_0x2b10d4){if(_0x2b10d4){_0x3c9621=_0x2b10d4;return db['ChatWebsite'][_0x7a56('0x46')]({'where':{'id':_0x3c9621[_0x7a56('0x4c')]}});}})[_0x7a56('0x16')](function(_0xc3e0f){if(_0xc3e0f){_0x1ad117=_0xc3e0f;return db[_0x7a56('0x5f')][_0x7a56('0x46')]({'where':{'id':_0x3c9621[_0x7a56('0x7a')]}});}})['then'](function(_0x1abdf8){if(_0x1abdf8){if(_0x5392e3){var _0x2bdefb=null;for(var _0x3dcb91=0x1;_0x3dcb91<_0x3c9621[_0x7a56('0x78')]['length'];++_0x3dcb91){_0x2bdefb=_0x3c9621['Messages'][_0x3dcb91];var _0x11aa1e=_0x2bdefb[_0x7a56('0x63')]?util['format'](_0x7a56('0x7b'),_0x1ad117['agentAlias'],_0x2bdefb['UserId']):_0x7a56('0x7c');var _0x4b4c34=_0x1494cf[_0x7a56('0x2e')]['customer']||util['format'](_0x7a56('0x7b'),_0x7a56('0x7d'),_0x2bdefb[_0x7a56('0x7a')]);switch(_0x1ad117[_0x7a56('0x7e')]){case'website_alias':_0x11aa1e=_0x2bdefb[_0x7a56('0x63')]?util[_0x7a56('0x76')](_0x7a56('0x7b'),_0x1ad117[_0x7a56('0x7f')],_0x2bdefb[_0x7a56('0x63')]):'System';break;case _0x7a56('0x80'):_0x11aa1e=_0x2bdefb[_0x7a56('0x63')]?_0x2bdefb['User']['alias']||_0x2bdefb[_0x7a56('0x79')][_0x7a56('0x81')]:_0x7a56('0x7c');break;case _0x7a56('0x82'):_0x11aa1e=_0x2bdefb[_0x7a56('0x63')]?_0x2bdefb[_0x7a56('0x79')][_0x7a56('0x81')]:'System';break;default:_0x11aa1e=_0x2bdefb[_0x7a56('0x63')]?util['format'](_0x7a56('0x7b'),_0x1ad117['agentAlias'],_0x2bdefb['UserId']):_0x7a56('0x7c');}var _0x204349=util[_0x7a56('0x76')](_0x7a56('0x83'),moment(_0x2bdefb[_0x7a56('0x84')])[_0x7a56('0x76')](_0x7a56('0x85')),_0x2bdefb[_0x7a56('0x86')]==='in'?_0x4b4c34:_0x11aa1e,_0x2bdefb[_0x7a56('0x2e')]);if(!_0x2bdefb[_0x7a56('0x87')]){fs[_0x7a56('0x88')](_0x5392e3,_0x204349);}}return db[_0x7a56('0x89')][_0x7a56('0x4a')]({'where':{'service':!![]},'include':[{'model':db[_0x7a56('0x8a')],'as':_0x7a56('0x8b'),'raw':!![],'include':[{'model':db[_0x7a56('0x8c')],'as':_0x7a56('0x8c'),'raw':!![]}]}]});}}})[_0x7a56('0x16')](function(_0x34688a){if(!_0x34688a||!_0x34688a[_0x7a56('0x8b')]||!_0x1494cf[_0x7a56('0x2e')])return _0x3c9621;var _0x194cd9=_0x34688a[_0x7a56('0x8d')]();return respondWithRpcPromise(_0x7a56('0x8e'),_0x7a56('0x8f'),{'account':_0x194cd9,'message':{'from':util[_0x7a56('0x76')](_0x7a56('0x90'),_0x34688a['name'],_0x34688a[_0x7a56('0x91')]||_0x34688a[_0x7a56('0x8b')]['user']),'to':_0x1494cf['body'][_0x7a56('0x74')],'subject':_0x7a56('0x92'),'text':util[_0x7a56('0x76')](_0x7a56('0x93'),_0x1494cf[_0x7a56('0x2e')][_0x7a56('0x74')]),'attachments':[{'path':_0x5392e3}]}})[_0x7a56('0x16')](function(){return _0x3c9621;})['catch'](function(_0x44f1a7){logger[_0x7a56('0x1e')](_0x44f1a7);});})['then'](respondWithStatusCode(_0x5a841a,0xc8))[_0x7a56('0x39')](handleError(_0x5a841a,null));};exports[_0x7a56('0x94')]=function(_0x43f585,_0x2408b9){return db['ChatMessage'][_0x7a56('0x46')]({'where':{'id':_0x43f585[_0x7a56('0x3b')]['id']}})[_0x7a56('0x16')](handleEntityNotFound(_0x2408b9,null))[_0x7a56('0x16')](function(_0x20468a){if(_0x20468a){return _0x20468a[_0x7a56('0x94')](_0x43f585[_0x7a56('0x2e')][_0x7a56('0x95')],_[_0x7a56('0x96')](_0x43f585[_0x7a56('0x2e')],[_0x7a56('0x95'),'id'])||{});}})[_0x7a56('0x16')](respondWithResult(_0x2408b9,null))[_0x7a56('0x39')](handleError(_0x2408b9,null));};exports[_0x7a56('0x97')]=function(_0x5b08fc,_0x2ca99c){var _0x46d401={'raw':![],'where':{}};var _0x3e9380={};var _0x13af8a={'count':0x0,'rows':[]};return db[_0x7a56('0x33')][_0x7a56('0x4a')]({'where':{'id':_0x5b08fc[_0x7a56('0x3b')]['id']}})[_0x7a56('0x16')](handleEntityNotFound(_0x2ca99c,null))['then'](function(_0x10e30c){if(_0x10e30c){_0x3e9380['model']=_[_0x7a56('0x3d')](db[_0x7a56('0x5e')][_0x7a56('0x34')]);_0x3e9380[_0x7a56('0x42')]=_[_0x7a56('0x3d')](_0x5b08fc[_0x7a56('0x42')]);_0x3e9380[_0x7a56('0x3e')]=_[_0x7a56('0x3f')](_0x3e9380[_0x7a56('0x3c')],_0x3e9380[_0x7a56('0x42')]);_0x46d401[_0x7a56('0x40')]=_[_0x7a56('0x3f')](_0x3e9380[_0x7a56('0x3c')],qs[_0x7a56('0x41')](_0x5b08fc[_0x7a56('0x42')][_0x7a56('0x41')]));_0x46d401[_0x7a56('0x40')]=_0x46d401['attributes'][_0x7a56('0x98')]?_0x46d401[_0x7a56('0x40')]:_0x3e9380[_0x7a56('0x3c')];if(!_0x5b08fc['query'][_0x7a56('0x99')](_0x7a56('0x9a'))){_0x46d401[_0x7a56('0x9b')]=qs['limit'](_0x5b08fc['query']['limit']);_0x46d401[_0x7a56('0x24')]=qs['offset'](_0x5b08fc[_0x7a56('0x42')][_0x7a56('0x24')]);}_0x46d401[_0x7a56('0x9c')]=qs[_0x7a56('0x9d')](_0x5b08fc[_0x7a56('0x42')]['sort']);_0x46d401[_0x7a56('0x9e')]=qs[_0x7a56('0x3e')](_[_0x7a56('0x9f')](_0x5b08fc['query'],_0x3e9380[_0x7a56('0x3e')]));_0x46d401[_0x7a56('0x9e')][_0x7a56('0xa0')]=_0x10e30c['id'];if(_0x5b08fc['query']['filter']){_0x46d401['where']=_['merge'](_0x46d401[_0x7a56('0x9e')],{'$or':_[_0x7a56('0x32')](_0x46d401[_0x7a56('0x40')],function(_0x5697db){var _0x14536e={};_0x14536e[_0x5697db]={'$like':'%'+_0x5b08fc[_0x7a56('0x42')][_0x7a56('0xa1')]+'%'};return _0x14536e;})});}if(_0x5b08fc[_0x7a56('0x42')][_0x7a56('0xa2')]){var _0x3a4f2e=_0x5b08fc[_0x7a56('0x42')][_0x7a56('0xa2')][_0x7a56('0xa3')](',');var _0x36616d={};_0x36616d[_0x3a4f2e[0x0]]={'$gte':moment(_0x3a4f2e[0x1])[_0x7a56('0x76')](_0x7a56('0xa4'))};_0x46d401['where']=_['merge'](_0x46d401[_0x7a56('0x9e')],_0x36616d);}_0x46d401=_[_0x7a56('0x2d')]({},_0x46d401,_0x5b08fc[_0x7a56('0x45')]);return db[_0x7a56('0x5e')][_0x7a56('0x26')]({'where':_0x46d401[_0x7a56('0x9e')]})[_0x7a56('0x16')](function(_0x291bb3){_0x13af8a[_0x7a56('0x26')]=_0x291bb3;if(_0x5b08fc['query'][_0x7a56('0x43')]){_0x46d401[_0x7a56('0x44')]=[{'all':!![]}];}return db[_0x7a56('0x5e')][_0x7a56('0xa5')](_0x46d401);})[_0x7a56('0x16')](function(_0x232a3b){_0x13af8a['rows']=_0x232a3b;return _0x13af8a;});}})[_0x7a56('0x16')](respondWithFilteredResult(_0x2ca99c,_0x46d401))[_0x7a56('0x39')](handleError(_0x2ca99c,null));};exports[_0x7a56('0xa6')]=function(_0x326e3f,_0xa1e0e9){var _0x1c2e4d={'where':{}},_0x168ec9={},_0x2b350f={'count':0x0,'rows':[]};return db[_0x7a56('0x33')][_0x7a56('0x4a')]({'where':{'id':_0x326e3f[_0x7a56('0x3b')]['id']}})['then'](handleEntityNotFound(_0xa1e0e9,null))[_0x7a56('0x16')](function(_0x3ae504){if(_0x3ae504){_0x168ec9[_0x7a56('0x3c')]=_['keys'](db[_0x7a56('0x5e')][_0x7a56('0x34')]);_0x168ec9[_0x7a56('0x42')]=_[_0x7a56('0x3d')](_0x326e3f[_0x7a56('0x42')]);_0x168ec9['filters']=_['intersection'](_0x168ec9[_0x7a56('0x3c')],_0x168ec9[_0x7a56('0x42')]);_0x1c2e4d['attributes']=_[_0x7a56('0x3f')](_0x168ec9[_0x7a56('0x3c')],qs[_0x7a56('0x41')](_0x326e3f['query'][_0x7a56('0x41')]));_0x1c2e4d[_0x7a56('0x40')]=_0x1c2e4d[_0x7a56('0x40')]['length']?_0x1c2e4d[_0x7a56('0x40')]:_0x168ec9[_0x7a56('0x3c')];if(!_0x326e3f['query'][_0x7a56('0x99')](_0x7a56('0x9a'))){_0x1c2e4d[_0x7a56('0x9b')]=qs[_0x7a56('0x9b')](_0x326e3f[_0x7a56('0x42')][_0x7a56('0x9b')]);_0x1c2e4d[_0x7a56('0x24')]=qs[_0x7a56('0x24')](_0x326e3f[_0x7a56('0x42')]['offset']);}_0x1c2e4d[_0x7a56('0x9c')]=qs[_0x7a56('0x9d')](_0x326e3f[_0x7a56('0x42')]['sort']);_0x1c2e4d[_0x7a56('0x9e')]=qs[_0x7a56('0x3e')](_[_0x7a56('0x9f')](_0x326e3f[_0x7a56('0x42')],_0x168ec9['filters']));_0x1c2e4d[_0x7a56('0x9e')][_0x7a56('0xa0')]=_0x3ae504['id'];if(_0x326e3f[_0x7a56('0x42')][_0x7a56('0xa1')]){_0x1c2e4d[_0x7a56('0x9e')]=_['merge'](_0x1c2e4d[_0x7a56('0x9e')],{'$or':_[_0x7a56('0x32')](_0x1c2e4d['attributes'],function(_0x3e7f3c){var _0x48c7b1={};_0x48c7b1[_0x3e7f3c]={'$like':'%'+_0x326e3f[_0x7a56('0x42')][_0x7a56('0xa1')]+'%'};return _0x48c7b1;})});}_0x1c2e4d[_0x7a56('0x9e')][_0x7a56('0x87')]=![];if(_0x326e3f[_0x7a56('0x42')]['id']){_0x1c2e4d[_0x7a56('0x9e')]['id']={'$gt':_0x326e3f['query']['id']};}_0x1c2e4d=_[_0x7a56('0x2d')]({},_0x1c2e4d,_0x326e3f[_0x7a56('0x45')]);return db[_0x7a56('0x5e')][_0x7a56('0x26')]({'where':_0x1c2e4d[_0x7a56('0x9e')]})['then'](function(_0x2c6e29){_0x2b350f[_0x7a56('0x26')]=_0x2c6e29;_0x1c2e4d[_0x7a56('0x44')]=[];if(_0x326e3f[_0x7a56('0x42')]['includeAgent']){_0x1c2e4d[_0x7a56('0x44')][_0x7a56('0xa7')]({'model':db[_0x7a56('0x79')],'as':_0x7a56('0x79'),'attributes':['id','fullname','alias']});}if(_0x326e3f[_0x7a56('0x42')][_0x7a56('0x43')]){_0x1c2e4d['include']=[{'all':!![]}];}return db[_0x7a56('0x5e')][_0x7a56('0xa5')](_0x1c2e4d);})['then'](function(_0x18cb7f){_0x2b350f[_0x7a56('0xa8')]=_0x18cb7f;return _0x2b350f;});}})['then'](respondWithFilteredResult(_0xa1e0e9,_0x1c2e4d))['catch'](handleError(_0xa1e0e9,null));};exports[_0x7a56('0xa9')]=function(_0x58bd9d,_0x19cf9d){return db[_0x7a56('0x33')][_0x7a56('0x46')]({'where':{'id':_0x58bd9d['params']['id']}})['then'](handleEntityNotFound(_0x19cf9d,null))['then'](function(_0x500187){if(_0x500187){return _0x500187[_0x7a56('0xaa')](_0x58bd9d['body'][_0x7a56('0x95')],_[_0x7a56('0x96')](_0x58bd9d['body'],[_0x7a56('0x95'),'id'])||{})[_0x7a56('0xab')](function(){return db[_0x7a56('0xac')]['findAll']({'attributes':['id','name',_0x7a56('0xad')],'where':{'id':_0x58bd9d[_0x7a56('0x2e')]['ids']}});})['then'](function(_0x5aaaa0){socket[_0x7a56('0xae')]('chatInteractionTags:save',{'id':Number(_0x58bd9d['params']['id']),'tags':_0x5aaaa0||[]});return{'id':Number(_0x58bd9d['params']['id']),'tags':_0x5aaaa0||[]};});}})[_0x7a56('0x16')](respondWithResult(_0x19cf9d,null))['catch'](handleError(_0x19cf9d,null));};exports['removeTags']=function(_0x164b00,_0x419cda){return db['ChatInteraction']['find']({'where':{'id':_0x164b00[_0x7a56('0x3b')]['id']}})[_0x7a56('0x16')](handleEntityNotFound(_0x419cda,null))[_0x7a56('0x16')](function(_0x210e28){if(_0x210e28){return _0x210e28[_0x7a56('0xaf')](_0x164b00['query'][_0x7a56('0x95')]);}})[_0x7a56('0x16')](respondWithStatusCode(_0x419cda,null))[_0x7a56('0x39')](handleError(_0x419cda,null));};exports[_0x7a56('0xb0')]=function(_0x4d74bb,_0x2636f9){var _0x1921d8=moment()[_0x7a56('0xb1')]()[_0x7a56('0xb2')]();var _0x51f4e8=path['join'](config[_0x7a56('0x70')],'server',_0x7a56('0xb3'),'tmp');var _0x221974=path['join'](config[_0x7a56('0x70')],_0x7a56('0xb4'),_0x7a56('0xb3'),'attachments');var _0x273a64=path[_0x7a56('0x6f')](_0x51f4e8,_0x1921d8);var _0x8de210=util[_0x7a56('0x76')](_0x7a56('0xb5'),_0x4d74bb[_0x7a56('0x3b')]['id'],_0x1921d8);var _0x43b1ea=path[_0x7a56('0x6f')](_0x51f4e8,_0x8de210);var _0x2fb364=[];_0x2fb364[_0x7a56('0xa7')]({'model':db[_0x7a56('0x79')],'as':_0x7a56('0x79'),'attributes':['id','fullname'],'raw':!![]});_0x2fb364[_0x7a56('0xa7')]({'model':db[_0x7a56('0x5f')],'as':_0x7a56('0xb6'),'attributes':['id','firstName',_0x7a56('0xb7')],'raw':!![]});if(_0x4d74bb[_0x7a56('0x42')][_0x7a56('0xb8')]){_0x2fb364[_0x7a56('0xa7')]({'model':db['Attachment'],'as':_0x7a56('0x6b'),'raw':!![]});}var _0x1d319e=[{'model':db[_0x7a56('0x5e')],'as':_0x7a56('0x78'),'attributes':['id',_0x7a56('0x2e'),'createdAt',_0x7a56('0x86'),'secret',_0x7a56('0xb9')],'include':_0x2fb364}];_0x1d319e['push']({'model':db[_0x7a56('0x4b')],'as':_0x7a56('0xba'),'attributes':['id','name']});_0x1d319e[_0x7a56('0xa7')]({'model':db['User'],'as':_0x7a56('0xbb'),'attributes':['id','fullname']});return db['ChatInteraction'][_0x7a56('0x46')]({'where':{'id':_0x4d74bb[_0x7a56('0x3b')]['id']},'include':_0x1d319e})['then'](handleEntityNotFound(_0x2636f9,null))['then'](function(_0x46f700){if(_0x46f700){var _0x43de21=_0x46f700[_0x7a56('0xbc')]({'plain':!![]});fs[_0x7a56('0xbd')](_0x273a64);var _0xa1cc28={'channel':_0x7a56('0xbe'),'account':_0x43de21['Account'][_0x7a56('0x2c')],'agent':_0x43de21['Owner']?_0x43de21[_0x7a56('0xbb')]['fullname']:_0x7a56('0xbf'),'createdAt':moment(_0x43de21[_0x7a56('0x84')])[_0x7a56('0x76')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7a56('0xb2')](),'closedAt':_0x43de21[_0x7a56('0x65')]?moment(_0x43de21[_0x7a56('0xc0')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x7a56('0xb2')]():'','disposition':_0x43de21[_0x7a56('0x66')],'chatInfo':{'browser':_0x43de21[_0x7a56('0xc1')],'os':_0x43de21[_0x7a56('0xc2')],'referer':_0x43de21[_0x7a56('0xc3')],'customerIp':_0x43de21[_0x7a56('0xc4')],'customerPort':_0x43de21['customerPort']?_0x43de21[_0x7a56('0xc5')]:_0x7a56('0xbf')},'messages':_(_0x43de21['Messages'])['tail']()[_0x7a56('0xa1')]({'secret':![]})[_0x7a56('0x32')](function(_0x20e369){if(_0x20e369[_0x7a56('0x6b')]){var _0x1ae8b1=path[_0x7a56('0x6f')](_0x221974,_0x20e369[_0x7a56('0x6b')][_0x7a56('0x72')]);if(fs[_0x7a56('0xc6')](_0x1ae8b1)){fs[_0x7a56('0xc7')](_0x1ae8b1)[_0x7a56('0xc8')](fs[_0x7a56('0xc9')](path[_0x7a56('0x6f')](_0x273a64,_0x20e369['Attachment'][_0x7a56('0x72')])));}}return{'date':moment(_0x20e369[_0x7a56('0x84')])[_0x7a56('0x76')](_0x7a56('0xa4'))['toString'](),'sender':_0x20e369[_0x7a56('0x86')]===_0x7a56('0x5d')?_0x20e369[_0x7a56('0x79')]?_0x20e369[_0x7a56('0x79')]['fullname']:_0x7a56('0x7c'):_0x20e369[_0x7a56('0xb6')][_0x7a56('0xca')]+(_0x20e369[_0x7a56('0xb6')]['lastName']?'\x20'+_0x20e369[_0x7a56('0xb6')]['lastName']:''),'body':_0x20e369[_0x7a56('0x6b')]?_0x20e369['Attachment'][_0x7a56('0x72')]:_0x20e369['body'],'direction':_0x20e369['direction']===_0x7a56('0x5d')?'A':'C','secret':_0x20e369[_0x7a56('0x87')],'read':_0x20e369[_0x7a56('0xb9')],'attachment':_0x20e369[_0x7a56('0x6b')]};})[_0x7a56('0xcb')]()};return ejs[_0x7a56('0xcc')](path['join'](config['root'],_0x7a56('0xb4'),_0x7a56('0xcd'),_0x7a56('0xce')),{'interaction':_0xa1cc28})['then'](function(_0x3f659a){var _0x11eccb=path[_0x7a56('0x6f')](_0x273a64,_0x7a56('0xcf')+_0x43de21['id']+'-'+_0x1921d8+_0x7a56('0xd0'));var _0x2dc08c={'path':_0x11eccb,'channel':'Chat','interactionId':_0x43de21['id']};return pdf[_0x7a56('0xd1')](_0x3f659a,_0x2dc08c);})['then'](function(){return new Promise(function(_0x4908b7,_0x1e537e){zipdir(_0x273a64,{'saveTo':_0x43b1ea},function(_0x41d606,_0x757ec){if(_0x41d606)return _0x1e537e(_0x41d606);return _0x4908b7(_0x757ec);});})[_0x7a56('0x16')](function(){return new BPromise(function(_0x484345,_0x26f445){rimraf(_0x273a64,function(_0x4fccfe){if(_0x4fccfe)_0x26f445(_0x4fccfe);return _0x484345();});});})[_0x7a56('0x16')](function(){return _0x2636f9[_0x7a56('0xb0')](_0x43b1ea,_0x8de210,function(_0x3d04a9){if(_0x3d04a9){logger['error'](_0x7a56('0xd2'),_0x3d04a9);}else{fs[_0x7a56('0xd3')](_0x43b1ea);}});});});}else{return _0x2636f9[_0x7a56('0x62')](0xc8);}})[_0x7a56('0x39')](handleError(_0x2636f9,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 6b06943..a7a272b 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 _0x8f11=['exports','../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x5d5e8f,_0x18e75a){var _0x4d6e26=function(_0x344e3){while(--_0x344e3){_0x5d5e8f['push'](_0x5d5e8f['shift']());}};_0x4d6e26(++_0x18e75a);}(_0x8f11,0x1e7));var _0x18f1=function(_0x20e9b3,_0x3add58){_0x20e9b3=_0x20e9b3-0x0;var _0x48de81=_0x8f11[_0x20e9b3];return _0x48de81;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x18f1('0x0'))['db'][_0x18f1('0x1')];var ChatMessage=require(_0x18f1('0x0'))['db'][_0x18f1('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x18f1('0x3'),'afterUpdate':_0x18f1('0x4'),'afterDestroy':_0x18f1('0x5')};function emitEvent(_0x24c95b){return function(_0x442064,_0x30fe78,_0x47a294){_0x442064[_0x18f1('0x6')]({'attributes':['id'],'raw':!![]})[_0x18f1('0x7')](function(_0x4944d7){_0x442064[_0x18f1('0x8')](_0x18f1('0x9'),_0x4944d7[_0x18f1('0xa')](function(_0x5762c0){return{'id':_0x5762c0['id']};}));return ChatMessage[_0x18f1('0xb')]({'where':{'ChatInteractionId':_0x442064['id'],'direction':'in','read':![]},'raw':!![]});})[_0x18f1('0x7')](function(_0x3abdbf){_0x442064['setDataValue'](_0x18f1('0xc'),_0x3abdbf[_0x18f1('0xd')]);ChatInteractionEvents[_0x18f1('0xe')](_0x24c95b+':'+_0x442064['id'],_0x442064);ChatInteractionEvents[_0x18f1('0xe')](_0x24c95b,_0x442064);_0x47a294(null);})[_0x18f1('0xf')](_0x47a294(null));};}for(var e in events){if(events[_0x18f1('0x10')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x18f1('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x7872=['save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage'];(function(_0x5403f5,_0x5b5030){var _0xfd371c=function(_0x49fdaa){while(--_0x49fdaa){_0x5403f5['push'](_0x5403f5['shift']());}};_0xfd371c(++_0x5b5030);}(_0x7872,0x11d));var _0x2787=function(_0x20065b,_0x74d1ad){_0x20065b=_0x20065b-0x0;var _0x513277=_0x7872[_0x20065b];return _0x513277;};'use strict';var EventEmitter=require(_0x2787('0x0'));var ChatInteraction=require(_0x2787('0x1'))['db'][_0x2787('0x2')];var ChatMessage=require(_0x2787('0x1'))['db'][_0x2787('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2787('0x4'),'afterUpdate':_0x2787('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2dc006){return function(_0x525c99,_0x535b51,_0x257eaf){_0x525c99[_0x2787('0x6')]({'attributes':['id'],'raw':!![]})[_0x2787('0x7')](function(_0x575e01){_0x525c99[_0x2787('0x8')](_0x2787('0x9'),_0x575e01[_0x2787('0xa')](function(_0x5bbbfb){return{'id':_0x5bbbfb['id']};}));return ChatMessage[_0x2787('0xb')]({'where':{'ChatInteractionId':_0x525c99['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2787('0x7')](function(_0x31de16){_0x525c99[_0x2787('0x8')](_0x2787('0xc'),_0x31de16[_0x2787('0xd')]);ChatInteractionEvents['emit'](_0x2dc006+':'+_0x525c99['id'],_0x525c99);ChatInteractionEvents['emit'](_0x2dc006,_0x525c99);_0x257eaf(null);})['catch'](_0x257eaf(null));};}for(var e in events){if(events[_0x2787('0xe')](e)){var event=events[e];ChatInteraction[_0x2787('0xf')](e,emitEvent(event));}}module[_0x2787('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 16f7923..53d8a48 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 _0x0605=['chat_interactions','changed','closed','closedAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction'];(function(_0x3bf24b,_0x2557da){var _0x298567=function(_0x43581c){while(--_0x43581c){_0x3bf24b['push'](_0x3bf24b['shift']());}};_0x298567(++_0x2557da);}(_0x0605,0x1f4));var _0x5060=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0605[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x5060('0x0'));var util=require(_0x5060('0x1'));var logger=require('../../config/logger')(_0x5060('0x2'));var moment=require(_0x5060('0x3'));var BPromise=require(_0x5060('0x4'));var rp=require(_0x5060('0x5'));var fs=require('fs');var path=require(_0x5060('0x6'));var rimraf=require(_0x5060('0x7'));var config=require(_0x5060('0x8'));var attributes=require(_0x5060('0x9'));module[_0x5060('0xa')]=function(_0x1b3c12,_0x10b089){return _0x1b3c12[_0x5060('0xb')](_0x5060('0xc'),attributes,{'tableName':_0x5060('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f6dfe,_0x468056,_0x4f2f24){if(_0x2f6dfe[_0x5060('0xe')](_0x5060('0xf'))){_0x2f6dfe[_0x5060('0x10')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4f2f24(null,_0x2f6dfe);}},'charset':_0x5060('0x11'),'collate':_0x5060('0x12')});}; \ No newline at end of file +var _0x6fd5=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','define','chat_interactions','changed'];(function(_0x1b4ef6,_0x5a5199){var _0x39539e=function(_0x3a0b95){while(--_0x3a0b95){_0x1b4ef6['push'](_0x1b4ef6['shift']());}};_0x39539e(++_0x5a5199);}(_0x6fd5,0x19d));var _0x56fd=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x6fd5[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x56fd('0x0'));var util=require(_0x56fd('0x1'));var logger=require(_0x56fd('0x2'))('api');var moment=require(_0x56fd('0x3'));var BPromise=require(_0x56fd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x56fd('0x5'));var rimraf=require(_0x56fd('0x6'));var config=require(_0x56fd('0x7'));var attributes=require(_0x56fd('0x8'));module['exports']=function(_0x26a3aa,_0x1404e0){return _0x26a3aa[_0x56fd('0x9')]('ChatInteraction',attributes,{'tableName':_0x56fd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x28a2f6,_0x397a9d,_0x28538e){if(_0x28a2f6[_0x56fd('0xb')](_0x56fd('0xc'))){_0x28a2f6[_0x56fd('0xd')]=moment()[_0x56fd('0xe')](_0x56fd('0xf'));}_0x28538e(null,_0x28a2f6);}},'charset':_0x56fd('0x10'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index f565d77..6cf6164 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 _0x2905=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','UpdateChatInteraction','ChatInteraction','body','options','where','limit','catch','AddTagsToChatInteraction','find','ids','omit','AddTags','lodash','moment','randomstring','ioredis','../../config/utils'];(function(_0x486c0f,_0x24588c){var _0xf17737=function(_0x80a6f2){while(--_0x80a6f2){_0x486c0f['push'](_0x486c0f['shift']());}};_0xf17737(++_0x24588c);}(_0x2905,0xdf));var _0x5290=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2905[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x5290('0x0'));var util=require('util');var moment=require(_0x5290('0x1'));var BPromise=require('bluebird');var rs=require(_0x5290('0x2'));var fs=require('fs');var Redis=require(_0x5290('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5290('0x4'));var logger=require(_0x5290('0x5'))(_0x5290('0x6'));var config=require('../../config/environment');var jayson=require(_0x5290('0x7'));var client=jayson[_0x5290('0x8')][_0x5290('0x9')]({'port':0x232a});config[_0x5290('0xa')]=_[_0x5290('0xb')](config[_0x5290('0xa')],{'host':_0x5290('0xc'),'port':0x18eb});var socket=require(_0x5290('0xd'))(new Redis(config['redis']));require(_0x5290('0xe'))['register'](socket);function respondWithRpcPromise(_0x5c6ac3,_0x27d82b,_0x342712){return new BPromise(function(_0x20e61c,_0x1d5bec){return client[_0x5290('0xf')](_0x5c6ac3,_0x342712)['then'](function(_0x50067c){logger[_0x5290('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x27d82b,_0x5290('0x11'));logger[_0x5290('0x12')](_0x5290('0x13'),_0x27d82b,_0x5290('0x11'),JSON[_0x5290('0x14')](_0x50067c));if(_0x50067c[_0x5290('0x15')]){if(_0x50067c['error'][_0x5290('0x16')]===0x1f4){logger[_0x5290('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x27d82b,_0x50067c['error']['message']);return _0x1d5bec(_0x50067c[_0x5290('0x15')]['message']);}logger['error'](_0x5290('0x17'),_0x27d82b,_0x50067c[_0x5290('0x15')][_0x5290('0x18')]);return _0x20e61c(_0x50067c[_0x5290('0x15')][_0x5290('0x18')]);}else{logger['info'](_0x5290('0x17'),_0x27d82b,_0x5290('0x11'));_0x20e61c(_0x50067c[_0x5290('0x19')][_0x5290('0x18')]);}})['catch'](function(_0x575bf8){logger[_0x5290('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x27d82b,_0x575bf8);_0x1d5bec(_0x575bf8);});});}exports[_0x5290('0x1a')]=function(_0x5ec0b5){var _0x4207ce=this;return new Promise(function(_0x261ca7,_0x3bb3e0){return db[_0x5290('0x1b')]['update'](_0x5ec0b5[_0x5290('0x1c')],{'raw':_0x5ec0b5[_0x5290('0x1d')]?_0x5ec0b5['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ec0b5[_0x5290('0x1d')]?_0x5ec0b5['options'][_0x5290('0x1e')]||null:null,'attributes':_0x5ec0b5[_0x5290('0x1d')]?_0x5ec0b5[_0x5290('0x1d')]['attributes']||null:null,'limit':_0x5ec0b5['options']?_0x5ec0b5[_0x5290('0x1d')][_0x5290('0x1f')]||null:null})['then'](function(_0x1d8e8){logger['info'](_0x5290('0x1a'),_0x5ec0b5);logger['debug'](_0x5290('0x1a'),_0x5ec0b5,JSON[_0x5290('0x14')](_0x1d8e8));_0x261ca7(_0x1d8e8);})[_0x5290('0x20')](function(_0x1fe4b8){logger[_0x5290('0x15')](_0x5290('0x1a'),_0x1fe4b8[_0x5290('0x18')],_0x5ec0b5);_0x3bb3e0(_0x4207ce[_0x5290('0x15')](0x1f4,_0x1fe4b8[_0x5290('0x18')]));});});};exports[_0x5290('0x21')]=function(_0x13424b){return new Promise(function(_0x42906e,_0x4418a7){return db[_0x5290('0x1b')][_0x5290('0x22')]({'where':_0x13424b[_0x5290('0x1d')]?_0x13424b['options'][_0x5290('0x1e')]||null:null})['then'](function(_0xf29b59){if(_0xf29b59){return _0xf29b59['addTags'](_0x13424b[_0x5290('0x1c')][_0x5290('0x23')],_[_0x5290('0x24')](_0x13424b['body'],[_0x5290('0x23'),'id'])||{});}})['spread'](function(_0x16d9dd){logger[_0x5290('0x10')](_0x5290('0x25'),_0x13424b);logger[_0x5290('0x12')](_0x5290('0x25'),_0x13424b,JSON[_0x5290('0x14')](_0x16d9dd));_0x42906e(_0x16d9dd);})['catch'](function(_0x1582c4){logger['error'](_0x5290('0x25'),_0x1582c4[_0x5290('0x18')],_0x13424b);_0x4418a7(_this[_0x5290('0x15')](0x1f4,_0x1582c4[_0x5290('0x18')]));});});}; \ No newline at end of file +var _0x5eaa=['ChatInteraction','find','where','addTags','ids','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','UpdateChatInteraction','body','options','raw','attributes','limit','info','AddTagsToChatInteraction'];(function(_0x460423,_0x46c773){var _0x3c65f3=function(_0x11dbf7){while(--_0x11dbf7){_0x460423['push'](_0x460423['shift']());}};_0x3c65f3(++_0x46c773);}(_0x5eaa,0x13f));var _0xa5ea=function(_0x1f1de6,_0x257813){_0x1f1de6=_0x1f1de6-0x0;var _0x1a74cd=_0x5eaa[_0x1f1de6];return _0x1a74cd;};'use strict';var _=require(_0xa5ea('0x0'));var util=require(_0xa5ea('0x1'));var moment=require('moment');var BPromise=require(_0xa5ea('0x2'));var rs=require(_0xa5ea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa5ea('0x4'))['db'];var utils=require(_0xa5ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa5ea('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa5ea('0x7')]({'port':0x232a});config[_0xa5ea('0x8')]=_[_0xa5ea('0x9')](config[_0xa5ea('0x8')],{'host':_0xa5ea('0xa'),'port':0x18eb});var socket=require(_0xa5ea('0xb'))(new Redis(config['redis']));require(_0xa5ea('0xc'))[_0xa5ea('0xd')](socket);function respondWithRpcPromise(_0x58d20d,_0x29972b,_0x332f0a){return new BPromise(function(_0x39a801,_0x3baf6d){return client[_0xa5ea('0xe')](_0x58d20d,_0x332f0a)[_0xa5ea('0xf')](function(_0x4629cd){logger['info'](_0xa5ea('0x10'),_0x29972b,'request\x20sent');logger[_0xa5ea('0x11')](_0xa5ea('0x12'),_0x29972b,'request\x20sent',JSON[_0xa5ea('0x13')](_0x4629cd));if(_0x4629cd[_0xa5ea('0x14')]){if(_0x4629cd['error']['code']===0x1f4){logger[_0xa5ea('0x14')](_0xa5ea('0x10'),_0x29972b,_0x4629cd['error'][_0xa5ea('0x15')]);return _0x3baf6d(_0x4629cd[_0xa5ea('0x14')]['message']);}logger[_0xa5ea('0x14')](_0xa5ea('0x10'),_0x29972b,_0x4629cd[_0xa5ea('0x14')][_0xa5ea('0x15')]);return _0x39a801(_0x4629cd[_0xa5ea('0x14')]['message']);}else{logger['info'](_0xa5ea('0x10'),_0x29972b,_0xa5ea('0x16'));_0x39a801(_0x4629cd['result'][_0xa5ea('0x15')]);}})[_0xa5ea('0x17')](function(_0x18b586){logger[_0xa5ea('0x14')](_0xa5ea('0x10'),_0x29972b,_0x18b586);_0x3baf6d(_0x18b586);});});}exports[_0xa5ea('0x18')]=function(_0x2f95d8){var _0x32cb84=this;return new Promise(function(_0x5e7e49,_0xde5196){return db['ChatInteraction']['update'](_0x2f95d8[_0xa5ea('0x19')],{'raw':_0x2f95d8[_0xa5ea('0x1a')]?_0x2f95d8[_0xa5ea('0x1a')][_0xa5ea('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f95d8[_0xa5ea('0x1a')]?_0x2f95d8[_0xa5ea('0x1a')]['where']||null:null,'attributes':_0x2f95d8['options']?_0x2f95d8['options'][_0xa5ea('0x1c')]||null:null,'limit':_0x2f95d8['options']?_0x2f95d8['options'][_0xa5ea('0x1d')]||null:null})[_0xa5ea('0xf')](function(_0x2b51eb){logger[_0xa5ea('0x1e')](_0xa5ea('0x18'),_0x2f95d8);logger[_0xa5ea('0x11')](_0xa5ea('0x18'),_0x2f95d8,JSON[_0xa5ea('0x13')](_0x2b51eb));_0x5e7e49(_0x2b51eb);})[_0xa5ea('0x17')](function(_0x203971){logger[_0xa5ea('0x14')](_0xa5ea('0x18'),_0x203971[_0xa5ea('0x15')],_0x2f95d8);_0xde5196(_0x32cb84[_0xa5ea('0x14')](0x1f4,_0x203971[_0xa5ea('0x15')]));});});};exports[_0xa5ea('0x1f')]=function(_0xc18f90){return new Promise(function(_0x2c1155,_0x5d958b){return db[_0xa5ea('0x20')][_0xa5ea('0x21')]({'where':_0xc18f90[_0xa5ea('0x1a')]?_0xc18f90[_0xa5ea('0x1a')][_0xa5ea('0x22')]||null:null})[_0xa5ea('0xf')](function(_0x188b63){if(_0x188b63){return _0x188b63[_0xa5ea('0x23')](_0xc18f90[_0xa5ea('0x19')]['ids'],_['omit'](_0xc18f90['body'],[_0xa5ea('0x24'),'id'])||{});}})[_0xa5ea('0x25')](function(_0x47cc66){logger['info'](_0xa5ea('0x26'),_0xc18f90);logger[_0xa5ea('0x11')](_0xa5ea('0x26'),_0xc18f90,JSON['stringify'](_0x47cc66));_0x2c1155(_0x47cc66);})[_0xa5ea('0x17')](function(_0x1de26e){logger[_0xa5ea('0x14')](_0xa5ea('0x26'),_0x1de26e[_0xa5ea('0x15')],_0xc18f90);_0x5d958b(_this[_0xa5ea('0x14')](0x1f4,_0x1de26e[_0xa5ea('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index a6840a8..f0d67d7 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 _0x672d=['update','removeListener','chatInteraction:','./chatInteraction.events','remove'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x672d,0x166));var _0xd672=function(_0x55a78f,_0x172f15){_0x55a78f=_0x55a78f-0x0;var _0x57e9fb=_0x672d[_0x55a78f];return _0x57e9fb;};'use strict';var ChatInteractionEvents=require(_0xd672('0x0'));var events=['save',_0xd672('0x1'),_0xd672('0x2')];function createListener(_0x3eb494,_0x49acc0){return function(_0x3880c8){_0x49acc0['emit'](_0x3eb494,_0x3880c8);};}function removeListener(_0x1c93de,_0x2c10ee){return function(){ChatInteractionEvents[_0xd672('0x3')](_0x1c93de,_0x2c10ee);};}exports['register']=function(_0x1a7527){for(var _0x4d06a3=0x0,_0x239fba=events['length'];_0x4d06a3<_0x239fba;_0x4d06a3++){var _0x76440f=events[_0x4d06a3];var _0x338c0c=createListener(_0xd672('0x4')+_0x76440f,_0x1a7527);ChatInteractionEvents['on'](_0x76440f,_0x338c0c);}}; \ No newline at end of file +var _0x0b35=['chatInteraction:','update','emit','removeListener','length'];(function(_0x40a4c2,_0x5a72c6){var _0x4d0d44=function(_0xf66afe){while(--_0xf66afe){_0x40a4c2['push'](_0x40a4c2['shift']());}};_0x4d0d44(++_0x5a72c6);}(_0x0b35,0xbf));var _0x50b3=function(_0x3d66f0,_0x3f4e63){_0x3d66f0=_0x3d66f0-0x0;var _0x4164f3=_0x0b35[_0x3d66f0];return _0x4164f3;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save','remove',_0x50b3('0x0')];function createListener(_0x58e7d4,_0x4cd749){return function(_0x56066b){_0x4cd749[_0x50b3('0x1')](_0x58e7d4,_0x56066b);};}function removeListener(_0xf7bdd8,_0x5da979){return function(){ChatInteractionEvents[_0x50b3('0x2')](_0xf7bdd8,_0x5da979);};}exports['register']=function(_0x3b0056){for(var _0x226ea7=0x0,_0x11d586=events[_0x50b3('0x3')];_0x226ea7<_0x11d586;_0x226ea7++){var _0x2cb610=events[_0x226ea7];var _0x578326=createListener(_0x50b3('0x4')+_0x2cb610,_0x3b0056);ChatInteractionEvents['on'](_0x2cb610,_0x578326);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index afecab7..dc2e428 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 _0x6347=['isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','update','customUpdate','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x797219,_0x28c28b){var _0x76bb98=function(_0x1ec30e){while(--_0x1ec30e){_0x797219['push'](_0x797219['shift']());}};_0x76bb98(++_0x28c28b);}(_0x6347,0x1c5));var _0x7634=function(_0x5a4f80,_0x1a34d1){_0x5a4f80=_0x5a4f80-0x0;var _0x310db7=_0x6347[_0x5a4f80];return _0x310db7;};'use strict';var multer=require('multer');var util=require(_0x7634('0x0'));var path=require(_0x7634('0x1'));var timeout=require(_0x7634('0x2'));var express=require(_0x7634('0x3'));var router=express[_0x7634('0x4')]();var fs_extra=require(_0x7634('0x5'));var auth=require(_0x7634('0x6'));var interaction=require(_0x7634('0x7'));var config=require(_0x7634('0x8'));var controller=require(_0x7634('0x9'));router[_0x7634('0xa')]('/',auth[_0x7634('0xb')](),controller['index']);router[_0x7634('0xa')](_0x7634('0xc'),auth[_0x7634('0xb')](),controller[_0x7634('0xd')]);router[_0x7634('0xa')](_0x7634('0xe'),auth[_0x7634('0xf')](),controller[_0x7634('0x10')]);router[_0x7634('0xa')](_0x7634('0x11'),auth[_0x7634('0xf')](),controller[_0x7634('0x12')]);router[_0x7634('0xa')](_0x7634('0x13'),auth[_0x7634('0xb')](),controller['getMessages']);router[_0x7634('0xa')]('/:id/my_messages',auth[_0x7634('0xf')](),controller['getMyMessages']);router[_0x7634('0xa')]('/:id/download',auth[_0x7634('0xb')](),controller['download']);router[_0x7634('0x14')]('/',auth[_0x7634('0xb')](),controller[_0x7634('0x15')]);router[_0x7634('0x14')](_0x7634('0x16'),auth[_0x7634('0xb')](),controller[_0x7634('0x17')]);var upload=multer({'storage':multer[_0x7634('0x18')]({'destination':function(_0x46d98b,_0x4b02b2,_0x581372){_0x581372(null,path[_0x7634('0x19')](config[_0x7634('0x1a')],_0x7634('0x1b')));},'filename':function(_0x822443,_0x1eb200,_0x3fc5b1){_0x3fc5b1(null,util[_0x7634('0x1c')]('%s-%s',Date[_0x7634('0x1d')](),_0x1eb200[_0x7634('0x1e')][_0x7634('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x7634('0x20'),upload[_0x7634('0x21')](_0x7634('0x22')),controller[_0x7634('0x23')]);router['post'](_0x7634('0x13'),auth[_0x7634('0xf')](),controller[_0x7634('0x24')]);router[_0x7634('0x14')](_0x7634('0x25'),auth[_0x7634('0xb')](),interaction[_0x7634('0x26')](_0x7634('0x27'),_0x7634('0x28')),controller[_0x7634('0x29')]);router[_0x7634('0x2a')](_0x7634('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0x7634('0x27'),'chatinteraction:update'),controller[_0x7634('0x2b')]);router[_0x7634('0x2a')]('/:id/custom_update',controller[_0x7634('0x2c')]);router[_0x7634('0x2a')]('/:id/abandon',auth[_0x7634('0xf')](),controller[_0x7634('0x2d')]);router[_0x7634('0x2a')](_0x7634('0x2e'),controller['close']);router[_0x7634('0x2f')](_0x7634('0xe'),auth[_0x7634('0xb')](),interaction['tracked'](_0x7634('0x27'),_0x7634('0x30')),controller[_0x7634('0x31')]);router[_0x7634('0x2f')](_0x7634('0x25'),auth[_0x7634('0xb')](),controller[_0x7634('0x32')]);module[_0x7634('0x33')]=router; \ No newline at end of file +var _0x7788=['format','now','originalname','replace','single','file','attachmentUpload','/:id/tags','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','tracked','chatinteraction:destroy','destroy','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','/:id/my_messages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','server/files/attachments/'];(function(_0x10f32d,_0x1235af){var _0x5684a9=function(_0x48167b){while(--_0x48167b){_0x10f32d['push'](_0x10f32d['shift']());}};_0x5684a9(++_0x1235af);}(_0x7788,0x1da));var _0x8778=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0x7788[_0x5c2a2b];return _0x19921f;};'use strict';var multer=require(_0x8778('0x0'));var util=require(_0x8778('0x1'));var path=require(_0x8778('0x2'));var timeout=require(_0x8778('0x3'));var express=require(_0x8778('0x4'));var router=express[_0x8778('0x5')]();var fs_extra=require(_0x8778('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8778('0x7'));var config=require(_0x8778('0x8'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x8778('0x9')](),controller['index']);router[_0x8778('0xa')](_0x8778('0xb'),auth[_0x8778('0x9')](),controller[_0x8778('0xc')]);router[_0x8778('0xa')](_0x8778('0xd'),auth[_0x8778('0xe')](),controller['show']);router['get'](_0x8778('0xf'),auth[_0x8778('0xe')](),controller['attachmentDownload']);router['get'](_0x8778('0x10'),auth[_0x8778('0x9')](),controller['getMessages']);router[_0x8778('0xa')](_0x8778('0x11'),auth[_0x8778('0xe')](),controller['getMyMessages']);router[_0x8778('0xa')](_0x8778('0x12'),auth[_0x8778('0x9')](),controller[_0x8778('0x13')]);router[_0x8778('0x14')]('/',auth['isAuthenticated'](),controller[_0x8778('0x15')]);router['post'](_0x8778('0x16'),auth['isAuthenticated'](),controller[_0x8778('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x12d567,_0x567042,_0x4b5d79){_0x4b5d79(null,path[_0x8778('0x18')](config['root'],_0x8778('0x19')));},'filename':function(_0x5923e7,_0x3b8fb0,_0x1391e9){_0x1391e9(null,util[_0x8778('0x1a')]('%s-%s',Date[_0x8778('0x1b')](),_0x3b8fb0[_0x8778('0x1c')][_0x8778('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8778('0x14')]('/:id/attachment_upload',upload[_0x8778('0x1e')](_0x8778('0x1f')),controller[_0x8778('0x20')]);router[_0x8778('0x14')](_0x8778('0x10'),auth[_0x8778('0xe')](),controller['addMessage']);router[_0x8778('0x14')](_0x8778('0x21'),auth[_0x8778('0x9')](),interaction['tracked']('chat',_0x8778('0x22')),controller[_0x8778('0x23')]);router[_0x8778('0x24')](_0x8778('0xd'),auth[_0x8778('0x9')](),interaction['tracked'](_0x8778('0x25'),_0x8778('0x26')),controller[_0x8778('0x27')]);router[_0x8778('0x24')](_0x8778('0x28'),controller[_0x8778('0x29')]);router[_0x8778('0x24')](_0x8778('0x2a'),auth[_0x8778('0xe')](),controller[_0x8778('0x2b')]);router[_0x8778('0x24')]('/:id/close',controller[_0x8778('0x2c')]);router['delete'](_0x8778('0xd'),auth[_0x8778('0x9')](),interaction[_0x8778('0x2d')](_0x8778('0x25'),_0x8778('0x2e')),controller[_0x8778('0x2f')]);router[_0x8778('0x30')](_0x8778('0x21'),auth[_0x8778('0x9')](),controller['removeTags']);module[_0x8778('0x31')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 0d5b050..4d0f122 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 _0x4a4a=['BOOLEAN','sequelize','exports','TEXT'];(function(_0x1a7890,_0x202c2a){var _0xd6c3b5=function(_0x3f396b){while(--_0x3f396b){_0x1a7890['push'](_0x1a7890['shift']());}};_0xd6c3b5(++_0x202c2a);}(_0x4a4a,0x8d));var _0xa4a4=function(_0x19ef11,_0xedf51d){_0x19ef11=_0x19ef11-0x0;var _0x134656=_0x4a4a[_0x19ef11];return _0x134656;};'use strict';var Sequelize=require(_0xa4a4('0x0'));module[_0xa4a4('0x1')]={'body':{'type':Sequelize[_0xa4a4('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa4a4('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x907e=['medium','BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0xc500e9,_0x3f8a77){var _0x45facb=function(_0x3f33b6){while(--_0x3f33b6){_0xc500e9['push'](_0xc500e9['shift']());}};_0x45facb(++_0x3f8a77);}(_0x907e,0x1a7));var _0xe907=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0x907e[_0x53bcc3];return _0x47c959;};'use strict';var Sequelize=require(_0xe907('0x0'));module[_0xe907('0x1')]={'body':{'type':Sequelize[_0xe907('0x2')](_0xe907('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe907('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe907('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 1be9f9b..96f8757 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 _0x78cf=['rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','get','messages','createdAt','lastMessageAt','format','agent','admin','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','sort','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','role','resourceId','push','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','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','./chatInternalMessage.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','save','destroy','error','name','index','map','ChatInternalMessage'];(function(_0x12ec8a,_0x3174d8){var _0x326d69=function(_0x2e09bb){while(--_0x2e09bb){_0x12ec8a['push'](_0x12ec8a['shift']());}};_0x326d69(++_0x3174d8);}(_0x78cf,0x122));var _0xf78c=function(_0x5a46eb,_0x2260ae){_0x5a46eb=_0x5a46eb-0x0;var _0x53e750=_0x78cf[_0x5a46eb];return _0x53e750;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf78c('0x0'));var zipdir=require(_0xf78c('0x1'));var jsonpatch=require(_0xf78c('0x2'));var rp=require(_0xf78c('0x3'));var moment=require(_0xf78c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf78c('0x5'));var path=require(_0xf78c('0x6'));var sox=require(_0xf78c('0x7'));var csv=require(_0xf78c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf78c('0x9'));var _=require('lodash');var squel=require(_0xf78c('0xa'));var crypto=require(_0xf78c('0xb'));var jsforce=require(_0xf78c('0xc'));var deskjs=require(_0xf78c('0xd'));var toCsv=require(_0xf78c('0x8'));var querystring=require(_0xf78c('0xe'));var Papa=require('papaparse');var Redis=require(_0xf78c('0xf'));var authService=require(_0xf78c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf78c('0x11'));var hardwareService=require(_0xf78c('0x12'));var logger=require('../../config/logger')(_0xf78c('0x13'));var utils=require(_0xf78c('0x14'));var config=require(_0xf78c('0x15'));var licenseUtil=require(_0xf78c('0x16'));var db=require(_0xf78c('0x17'))['db'];config[_0xf78c('0x18')]=_[_0xf78c('0x19')](config[_0xf78c('0x18')],{'host':_0xf78c('0x1a'),'port':0x18eb});var socket=require(_0xf78c('0x1b'))(new Redis(config[_0xf78c('0x18')]));require(_0xf78c('0x1c'))[_0xf78c('0x1d')](socket);function respondWithStatusCode(_0x33c788,_0x5bab12){_0x5bab12=_0x5bab12||0xcc;return function(_0x16f609){if(_0x16f609){return _0x33c788[_0xf78c('0x1e')](_0x5bab12);}return _0x33c788[_0xf78c('0x1f')](_0x5bab12)[_0xf78c('0x20')]();};}function respondWithResult(_0x221b8f,_0x2199d5){_0x2199d5=_0x2199d5||0xc8;return function(_0xa4ca88){if(_0xa4ca88){return _0x221b8f[_0xf78c('0x1f')](_0x2199d5)['json'](_0xa4ca88);}};}function respondWithFilteredResult(_0x47336c,_0x1dfb4b){return function(_0x171edb){if(_0x171edb){var _0x24b23e=typeof _0x1dfb4b[_0xf78c('0x21')]==='undefined'&&typeof _0x1dfb4b[_0xf78c('0x22')]===_0xf78c('0x23');var _0x4c5316=_0x171edb['count'];var _0x2d2ed8=_0x24b23e?0x0:_0x1dfb4b[_0xf78c('0x21')];var _0x3aeb4d=_0x24b23e?_0x171edb[_0xf78c('0x24')]:_0x1dfb4b[_0xf78c('0x21')]+_0x1dfb4b[_0xf78c('0x22')];var _0x5c618c;if(_0x3aeb4d>=_0x4c5316){_0x3aeb4d=_0x4c5316;_0x5c618c=0xc8;}else{_0x5c618c=0xce;}_0x47336c[_0xf78c('0x1f')](_0x5c618c);return _0x47336c[_0xf78c('0x25')](_0xf78c('0x26'),_0x2d2ed8+'-'+_0x3aeb4d+'/'+_0x4c5316)['json'](_0x171edb);}return null;};}function patchUpdates(_0x58a0be){return function(_0x1f3956){try{jsonpatch['apply'](_0x1f3956,_0x58a0be,!![]);}catch(_0x28c7ab){return BPromise['reject'](_0x28c7ab);}return _0x1f3956[_0xf78c('0x27')]();};}function saveUpdates(_0x276a08,_0xc2022e){return function(_0x280111){if(_0x280111){return _0x280111['update'](_0x276a08)['then'](function(_0x3bac39){return _0x3bac39;});}return null;};}function removeEntity(_0x910a6e,_0x4ac43c){return function(_0x111a95){if(_0x111a95){return _0x111a95[_0xf78c('0x28')]()['then'](function(){_0x910a6e[_0xf78c('0x1f')](0xcc)[_0xf78c('0x20')]();});}};}function handleEntityNotFound(_0x10a93a,_0x372b86){return function(_0x3e4e19){if(!_0x3e4e19){_0x10a93a[_0xf78c('0x1e')](0x194);}return _0x3e4e19;};}function handleError(_0x57d400,_0x5d4c1e){_0x5d4c1e=_0x5d4c1e||0x1f4;return function(_0x44919e){logger[_0xf78c('0x29')](_0x44919e['stack']);if(_0x44919e[_0xf78c('0x2a')]){delete _0x44919e['name'];}_0x57d400['status'](_0x5d4c1e)['send'](_0x44919e);};}exports[_0xf78c('0x2b')]=function(_0x12472c,_0xfbb33e){var _0x23d691={},_0x3e81c3={},_0x47daed={'count':0x0,'rows':[]};var _0x32adeb=_[_0xf78c('0x2c')](db[_0xf78c('0x2d')][_0xf78c('0x2e')],function(_0x83e92e){return{'name':_0x83e92e[_0xf78c('0x2f')],'type':_0x83e92e[_0xf78c('0x30')][_0xf78c('0x31')]};});_0x3e81c3[_0xf78c('0x32')]=_[_0xf78c('0x2c')](_0x32adeb,_0xf78c('0x2a'));_0x3e81c3[_0xf78c('0x33')]=_[_0xf78c('0x34')](_0x12472c[_0xf78c('0x33')]);_0x3e81c3['filters']=_[_0xf78c('0x35')](_0x3e81c3[_0xf78c('0x32')],_0x3e81c3[_0xf78c('0x33')]);_0x23d691['attributes']=_[_0xf78c('0x35')](_0x3e81c3[_0xf78c('0x32')],qs[_0xf78c('0x36')](_0x12472c['query'][_0xf78c('0x36')]));_0x23d691['attributes']=_0x23d691['attributes'][_0xf78c('0x37')]?_0x23d691[_0xf78c('0x38')]:_0x3e81c3[_0xf78c('0x32')];if(!_0x12472c[_0xf78c('0x33')][_0xf78c('0x39')](_0xf78c('0x3a'))){_0x23d691[_0xf78c('0x22')]=qs[_0xf78c('0x22')](_0x12472c[_0xf78c('0x33')][_0xf78c('0x22')]);_0x23d691[_0xf78c('0x21')]=qs[_0xf78c('0x21')](_0x12472c['query'][_0xf78c('0x21')]);}_0x23d691[_0xf78c('0x3b')]=qs['sort'](_0x12472c[_0xf78c('0x33')]['sort']);_0x23d691[_0xf78c('0x3c')]=qs[_0xf78c('0x3d')](_[_0xf78c('0x3e')](_0x12472c[_0xf78c('0x33')],_0x3e81c3[_0xf78c('0x3d')]),_0x32adeb);if(_0x12472c[_0xf78c('0x33')][_0xf78c('0x3f')]){_0x23d691[_0xf78c('0x3c')]=_[_0xf78c('0x40')](_0x23d691[_0xf78c('0x3c')],{'$or':_[_0xf78c('0x2c')](_0x32adeb,function(_0x3975f9){if(_0x3975f9[_0xf78c('0x30')]!==_0xf78c('0x41')){var _0x540280={};_0x540280[_0x3975f9[_0xf78c('0x2a')]]={'$like':'%'+_0x12472c[_0xf78c('0x33')]['filter']+'%'};return _0x540280;}})});}_0x23d691=_[_0xf78c('0x40')]({},_0x23d691,_0x12472c[_0xf78c('0x42')]);var _0x31275d={'where':_0x23d691[_0xf78c('0x3c')]};return db[_0xf78c('0x2d')]['count'](_0x31275d)[_0xf78c('0x43')](function(_0x3b07f5){_0x47daed['count']=_0x3b07f5;if(_0x12472c['query'][_0xf78c('0x44')]){_0x23d691[_0xf78c('0x45')]=[{'all':!![]}];}return db[_0xf78c('0x2d')][_0xf78c('0x46')](_0x23d691);})['then'](function(_0x545149){_0x47daed[_0xf78c('0x47')]=_0x545149;return _0x47daed;})['then'](respondWithFilteredResult(_0xfbb33e,_0x23d691))[_0xf78c('0x48')](handleError(_0xfbb33e,null));};exports[_0xf78c('0x49')]=function(_0xaa5283,_0x1b5866){var _0x7ffc9={'raw':!![],'where':{'id':_0xaa5283[_0xf78c('0x4a')]['id']}},_0x398ac4={};_0x398ac4[_0xf78c('0x32')]=_[_0xf78c('0x34')](db[_0xf78c('0x2d')][_0xf78c('0x2e')]);_0x398ac4[_0xf78c('0x33')]=_['keys'](_0xaa5283[_0xf78c('0x33')]);_0x398ac4[_0xf78c('0x3d')]=_['intersection'](_0x398ac4[_0xf78c('0x32')],_0x398ac4[_0xf78c('0x33')]);_0x7ffc9[_0xf78c('0x38')]=_[_0xf78c('0x35')](_0x398ac4[_0xf78c('0x32')],qs[_0xf78c('0x36')](_0xaa5283[_0xf78c('0x33')][_0xf78c('0x36')]));_0x7ffc9[_0xf78c('0x38')]=_0x7ffc9['attributes']['length']?_0x7ffc9[_0xf78c('0x38')]:_0x398ac4[_0xf78c('0x32')];if(_0xaa5283[_0xf78c('0x33')][_0xf78c('0x44')]){_0x7ffc9[_0xf78c('0x45')]=[{'all':!![]}];}_0x7ffc9=_[_0xf78c('0x40')]({},_0x7ffc9,_0xaa5283['options']);return db[_0xf78c('0x2d')][_0xf78c('0x4b')](_0x7ffc9)[_0xf78c('0x43')](handleEntityNotFound(_0x1b5866,null))[_0xf78c('0x43')](respondWithResult(_0x1b5866,null))[_0xf78c('0x48')](handleError(_0x1b5866,null));};exports['create']=function(_0xdd893,_0x57888e){return db[_0xf78c('0x2d')][_0xf78c('0x4c')](_0xdd893[_0xf78c('0x4d')],{})['then'](respondWithResult(_0x57888e,0xc9))[_0xf78c('0x48')](handleError(_0x57888e,null));};exports['update']=function(_0x3231b9,_0xee1c42){if(_0x3231b9[_0xf78c('0x4d')]['id']){delete _0x3231b9[_0xf78c('0x4d')]['id'];}return db[_0xf78c('0x2d')][_0xf78c('0x4b')]({'where':{'id':_0x3231b9[_0xf78c('0x4a')]['id']}})[_0xf78c('0x43')](handleEntityNotFound(_0xee1c42,null))[_0xf78c('0x43')](saveUpdates(_0x3231b9[_0xf78c('0x4d')],null))[_0xf78c('0x43')](respondWithResult(_0xee1c42,null))['catch'](handleError(_0xee1c42,null));};exports[_0xf78c('0x28')]=function(_0x19d179,_0x9478b){return db[_0xf78c('0x2d')][_0xf78c('0x4b')]({'where':{'id':_0x19d179[_0xf78c('0x4a')]['id']}})[_0xf78c('0x43')](handleEntityNotFound(_0x9478b,null))[_0xf78c('0x43')](removeEntity(_0x9478b,null))[_0xf78c('0x48')](handleError(_0x9478b,null));};exports['describe']=function(_0x55148f,_0x3cb737){return db[_0xf78c('0x2d')][_0xf78c('0x4e')]()[_0xf78c('0x43')](respondWithResult(_0x3cb737,null))[_0xf78c('0x48')](handleError(_0x3cb737,null));};function wrapUser(_0x3b2246){return function(_0x5166d7){var _0x38375d=_0x3b2246[_0xf78c('0x4f')]({'plain':!![]});_0x38375d[_0xf78c('0x50')]=[];if(_0x5166d7){_0x38375d['lastMessageAt']=_0x5166d7[_0xf78c('0x51')];_0x38375d['lastMessage']=_0x5166d7;}else{_0x38375d[_0xf78c('0x52')]=moment(0x0)[_0xf78c('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x38375d['lastMessage']={};}return _0x38375d;};}exports['getUsers']=function(_0x56385c,_0x4d2a1f,_0x29f50a){var _0x52d7c8=[];return db['User'][_0xf78c('0x46')]({'where':{'role':[_0xf78c('0x54'),_0xf78c('0x55'),_0xf78c('0x56')]},'attributes':['id',_0xf78c('0x57'),_0xf78c('0x2a'),'role',_0xf78c('0x58'),_0xf78c('0x59'),_0xf78c('0x5a'),_0xf78c('0x5b'),_0xf78c('0x5c'),_0xf78c('0x5d')],'order':qs[_0xf78c('0x5e')](_0xf78c('0x5f')),'include':[{'model':db[_0xf78c('0x60')],'as':_0xf78c('0x61'),'attributes':['id',_0xf78c('0x2a'),_0xf78c('0x30')],'through':{'attributes':[]}}]})[_0xf78c('0x43')](function(_0x2fc077){if(_0x2fc077){var _0x48f582=_0x56385c[_0xf78c('0x56')][_0xf78c('0x4f')]({'plain':!![]});if(!_0x48f582)throw new Error(_0xf78c('0x62'));if(_0x48f582['role']===_0xf78c('0x56')){return db[_0xf78c('0x63')][_0xf78c('0x4b')]({'where':{'name':_0xf78c('0x64'),'userProfileId':_0x48f582[_0xf78c('0x65')]},'raw':!![]})['then'](function(_0xb9b017){if(_0xb9b017){if(_0xb9b017[_0xf78c('0x66')]===0x0){return db[_0xf78c('0x67')][_0xf78c('0x46')]({'where':{'sectionId':_0xb9b017['id']},'raw':!![]})[_0xf78c('0x43')](function(_0x175cd9){var _0x3a387c=[];if(_[_0xf78c('0x68')](_0x175cd9)){_0x3a387c=_[_0xf78c('0x3f')](_0x2fc077,function(_0x1232cb){if(_0x1232cb[_0xf78c('0x69')]!==_0xf78c('0x54')){return _0x1232cb;}});return _0x3a387c;}else{for(var _0x44b849=0x0;_0x44b849<_0x2fc077[_0xf78c('0x37')];_0x44b849++){var _0x593280=_0x2fc077[_0x44b849];if(_0x593280[_0xf78c('0x69')]===_0xf78c('0x54')){var _0x2b0dad=_[_0xf78c('0x4b')](_0x175cd9,function(_0x255500){return _0x255500[_0xf78c('0x6a')]===_0x593280['id'];});if(_0x2b0dad)_0x3a387c[_0xf78c('0x6b')](_0x593280);}else{_0x3a387c[_0xf78c('0x6b')](_0x593280);}}return _0x3a387c;}});}else{return _0x2fc077;}}else{var _0x1a54c4=_['filter'](_0x2fc077,function(_0x54a945){if(_0x54a945[_0xf78c('0x69')]!==_0xf78c('0x54')){return _0x54a945;}});return _0x1a54c4;}});}else{return _0x2fc077;}}})[_0xf78c('0x43')](function(_0x32d155){var _0x12f487=[];if(_0x32d155){_0x52d7c8=_0x32d155;for(var _0x1b3795=0x0;_0x1b3795<_0x32d155[_0xf78c('0x37')];_0x1b3795+=0x1){_0x52d7c8[_0x1b3795]['messages']=[];_0x12f487[_0xf78c('0x6b')](db['ChatInternalMessage'][_0xf78c('0x4b')]({'where':{'FromId':[_0x56385c['user']['id'],_0x32d155[_0x1b3795]['id']],'ToId':[_0x56385c[_0xf78c('0x56')]['id'],_0x32d155[_0x1b3795]['id']],'ChatGroupId':null},'attributes':['id',_0xf78c('0x51'),'FromId',_0xf78c('0x6c'),_0xf78c('0x6d'),_0xf78c('0x4d')],'order':qs['sort'](_0xf78c('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x32d155[_0x1b3795])));}return BPromise[_0xf78c('0x6f')](_0x12f487);}return[];})[_0xf78c('0x43')](function(_0xfb0b1f){return{'rows':_0xfb0b1f,'count':_0xfb0b1f[_0xf78c('0x37')]};})[_0xf78c('0x43')](respondWithResult(_0x4d2a1f,null))['catch'](handleError(_0x4d2a1f,null));}; \ No newline at end of file +var _0x2559=['register','sendStatus','status','limit','undefined','count','offset','Content-Range','json','reject','save','update','destroy','then','end','error','stack','send','index','map','ChatInternalMessage','rawAttributes','fieldName','key','model','name','query','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','attributes','find','body','describe','get','messages','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','findAll','agent','admin','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','type','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','createdAt','ToId','read','all','eml-format','rimraf','fast-json-patch','moment','mustache','sox','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket'];(function(_0x5ba749,_0x1e29f3){var _0x47732e=function(_0x3b6717){while(--_0x3b6717){_0x5ba749['push'](_0x5ba749['shift']());}};_0x47732e(++_0x1e29f3);}(_0x2559,0x127));var _0x9255=function(_0x18ff90,_0x3bc7ce){_0x18ff90=_0x18ff90-0x0;var _0x1986c3=_0x2559[_0x18ff90];return _0x1986c3;};'use strict';var emlformat=require(_0x9255('0x0'));var rimraf=require(_0x9255('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9255('0x2'));var rp=require('request-promise');var moment=require(_0x9255('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9255('0x4'));var util=require('util');var path=require('path');var sox=require(_0x9255('0x5'));var csv=require('to-csv');var ejs=require(_0x9255('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9255('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9255('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9255('0x9'));var Papa=require(_0x9255('0xa'));var Redis=require(_0x9255('0xb'));var authService=require(_0x9255('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x9255('0xd'));var hardwareService=require(_0x9255('0xe'));var logger=require(_0x9255('0xf'))(_0x9255('0x10'));var utils=require(_0x9255('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9255('0x12'))['db'];config['redis']=_['defaults'](config[_0x9255('0x13')],{'host':_0x9255('0x14'),'port':0x18eb});var socket=require(_0x9255('0x15'))(new Redis(config[_0x9255('0x13')]));require(_0x9255('0x16'))[_0x9255('0x17')](socket);function respondWithStatusCode(_0x197504,_0xca9cf0){_0xca9cf0=_0xca9cf0||0xcc;return function(_0x15b04b){if(_0x15b04b){return _0x197504[_0x9255('0x18')](_0xca9cf0);}return _0x197504[_0x9255('0x19')](_0xca9cf0)['end']();};}function respondWithResult(_0xb9d0d4,_0x33e5b4){_0x33e5b4=_0x33e5b4||0xc8;return function(_0x2484ed){if(_0x2484ed){return _0xb9d0d4[_0x9255('0x19')](_0x33e5b4)['json'](_0x2484ed);}};}function respondWithFilteredResult(_0x311885,_0x4abaf6){return function(_0x1919f3){if(_0x1919f3){var _0x10293f=typeof _0x4abaf6['offset']==='undefined'&&typeof _0x4abaf6[_0x9255('0x1a')]===_0x9255('0x1b');var _0x4629e5=_0x1919f3[_0x9255('0x1c')];var _0x3ef25f=_0x10293f?0x0:_0x4abaf6[_0x9255('0x1d')];var _0x414aba=_0x10293f?_0x1919f3[_0x9255('0x1c')]:_0x4abaf6['offset']+_0x4abaf6[_0x9255('0x1a')];var _0x884643;if(_0x414aba>=_0x4629e5){_0x414aba=_0x4629e5;_0x884643=0xc8;}else{_0x884643=0xce;}_0x311885[_0x9255('0x19')](_0x884643);return _0x311885['set'](_0x9255('0x1e'),_0x3ef25f+'-'+_0x414aba+'/'+_0x4629e5)[_0x9255('0x1f')](_0x1919f3);}return null;};}function patchUpdates(_0x465599){return function(_0x145085){try{jsonpatch['apply'](_0x145085,_0x465599,!![]);}catch(_0x4bf2c9){return BPromise[_0x9255('0x20')](_0x4bf2c9);}return _0x145085[_0x9255('0x21')]();};}function saveUpdates(_0x4a19b7,_0xbad82f){return function(_0x17aee8){if(_0x17aee8){return _0x17aee8[_0x9255('0x22')](_0x4a19b7)['then'](function(_0x215a62){return _0x215a62;});}return null;};}function removeEntity(_0x1fdff0,_0x3bfed6){return function(_0x24b8ea){if(_0x24b8ea){return _0x24b8ea[_0x9255('0x23')]()[_0x9255('0x24')](function(){_0x1fdff0[_0x9255('0x19')](0xcc)[_0x9255('0x25')]();});}};}function handleEntityNotFound(_0x1b93b8,_0xb0f0e3){return function(_0x5358d4){if(!_0x5358d4){_0x1b93b8[_0x9255('0x18')](0x194);}return _0x5358d4;};}function handleError(_0x32d983,_0xd4e6bd){_0xd4e6bd=_0xd4e6bd||0x1f4;return function(_0x6fd3fe){logger[_0x9255('0x26')](_0x6fd3fe[_0x9255('0x27')]);if(_0x6fd3fe['name']){delete _0x6fd3fe['name'];}_0x32d983['status'](_0xd4e6bd)[_0x9255('0x28')](_0x6fd3fe);};}exports[_0x9255('0x29')]=function(_0x3f7fab,_0x294914){var _0x483112={},_0x3711cd={},_0xfce45e={'count':0x0,'rows':[]};var _0xa7de56=_[_0x9255('0x2a')](db[_0x9255('0x2b')][_0x9255('0x2c')],function(_0x5c9dad){return{'name':_0x5c9dad[_0x9255('0x2d')],'type':_0x5c9dad['type'][_0x9255('0x2e')]};});_0x3711cd[_0x9255('0x2f')]=_['map'](_0xa7de56,_0x9255('0x30'));_0x3711cd['query']=_['keys'](_0x3f7fab[_0x9255('0x31')]);_0x3711cd['filters']=_['intersection'](_0x3711cd['model'],_0x3711cd[_0x9255('0x31')]);_0x483112['attributes']=_[_0x9255('0x32')](_0x3711cd['model'],qs[_0x9255('0x33')](_0x3f7fab[_0x9255('0x31')][_0x9255('0x33')]));_0x483112['attributes']=_0x483112['attributes'][_0x9255('0x34')]?_0x483112['attributes']:_0x3711cd[_0x9255('0x2f')];if(!_0x3f7fab[_0x9255('0x31')][_0x9255('0x35')](_0x9255('0x36'))){_0x483112[_0x9255('0x1a')]=qs['limit'](_0x3f7fab[_0x9255('0x31')][_0x9255('0x1a')]);_0x483112[_0x9255('0x1d')]=qs['offset'](_0x3f7fab['query'][_0x9255('0x1d')]);}_0x483112['order']=qs[_0x9255('0x37')](_0x3f7fab[_0x9255('0x31')]['sort']);_0x483112[_0x9255('0x38')]=qs[_0x9255('0x39')](_[_0x9255('0x3a')](_0x3f7fab[_0x9255('0x31')],_0x3711cd[_0x9255('0x39')]),_0xa7de56);if(_0x3f7fab[_0x9255('0x31')][_0x9255('0x3b')]){_0x483112[_0x9255('0x38')]=_['merge'](_0x483112[_0x9255('0x38')],{'$or':_[_0x9255('0x2a')](_0xa7de56,function(_0x2ead26){if(_0x2ead26['type']!==_0x9255('0x3c')){var _0x4b87e2={};_0x4b87e2[_0x2ead26[_0x9255('0x30')]]={'$like':'%'+_0x3f7fab[_0x9255('0x31')][_0x9255('0x3b')]+'%'};return _0x4b87e2;}})});}_0x483112=_[_0x9255('0x3d')]({},_0x483112,_0x3f7fab[_0x9255('0x3e')]);var _0x19b220={'where':_0x483112[_0x9255('0x38')]};return db[_0x9255('0x2b')][_0x9255('0x1c')](_0x19b220)[_0x9255('0x24')](function(_0x41efd9){_0xfce45e[_0x9255('0x1c')]=_0x41efd9;if(_0x3f7fab[_0x9255('0x31')][_0x9255('0x3f')]){_0x483112[_0x9255('0x40')]=[{'all':!![]}];}return db[_0x9255('0x2b')]['findAll'](_0x483112);})[_0x9255('0x24')](function(_0xa46275){_0xfce45e[_0x9255('0x41')]=_0xa46275;return _0xfce45e;})[_0x9255('0x24')](respondWithFilteredResult(_0x294914,_0x483112))[_0x9255('0x42')](handleError(_0x294914,null));};exports[_0x9255('0x43')]=function(_0x28852d,_0xdf52eb){var _0xf53eba={'raw':!![],'where':{'id':_0x28852d[_0x9255('0x44')]['id']}},_0x5f4ddf={};_0x5f4ddf[_0x9255('0x2f')]=_[_0x9255('0x45')](db[_0x9255('0x2b')][_0x9255('0x2c')]);_0x5f4ddf[_0x9255('0x31')]=_[_0x9255('0x45')](_0x28852d[_0x9255('0x31')]);_0x5f4ddf[_0x9255('0x39')]=_[_0x9255('0x32')](_0x5f4ddf[_0x9255('0x2f')],_0x5f4ddf[_0x9255('0x31')]);_0xf53eba[_0x9255('0x46')]=_[_0x9255('0x32')](_0x5f4ddf[_0x9255('0x2f')],qs[_0x9255('0x33')](_0x28852d[_0x9255('0x31')][_0x9255('0x33')]));_0xf53eba[_0x9255('0x46')]=_0xf53eba[_0x9255('0x46')][_0x9255('0x34')]?_0xf53eba[_0x9255('0x46')]:_0x5f4ddf['model'];if(_0x28852d[_0x9255('0x31')][_0x9255('0x3f')]){_0xf53eba[_0x9255('0x40')]=[{'all':!![]}];}_0xf53eba=_[_0x9255('0x3d')]({},_0xf53eba,_0x28852d[_0x9255('0x3e')]);return db[_0x9255('0x2b')][_0x9255('0x47')](_0xf53eba)['then'](handleEntityNotFound(_0xdf52eb,null))[_0x9255('0x24')](respondWithResult(_0xdf52eb,null))['catch'](handleError(_0xdf52eb,null));};exports['create']=function(_0x2a8da8,_0x3e2898){return db[_0x9255('0x2b')]['create'](_0x2a8da8[_0x9255('0x48')],{})[_0x9255('0x24')](respondWithResult(_0x3e2898,0xc9))[_0x9255('0x42')](handleError(_0x3e2898,null));};exports[_0x9255('0x22')]=function(_0x54a06d,_0x386e7c){if(_0x54a06d[_0x9255('0x48')]['id']){delete _0x54a06d[_0x9255('0x48')]['id'];}return db[_0x9255('0x2b')][_0x9255('0x47')]({'where':{'id':_0x54a06d[_0x9255('0x44')]['id']}})[_0x9255('0x24')](handleEntityNotFound(_0x386e7c,null))[_0x9255('0x24')](saveUpdates(_0x54a06d[_0x9255('0x48')],null))[_0x9255('0x24')](respondWithResult(_0x386e7c,null))[_0x9255('0x42')](handleError(_0x386e7c,null));};exports[_0x9255('0x23')]=function(_0x4719be,_0x284757){return db[_0x9255('0x2b')][_0x9255('0x47')]({'where':{'id':_0x4719be[_0x9255('0x44')]['id']}})['then'](handleEntityNotFound(_0x284757,null))[_0x9255('0x24')](removeEntity(_0x284757,null))[_0x9255('0x42')](handleError(_0x284757,null));};exports[_0x9255('0x49')]=function(_0x1d0286,_0x27ea11){return db[_0x9255('0x2b')]['describe']()[_0x9255('0x24')](respondWithResult(_0x27ea11,null))[_0x9255('0x42')](handleError(_0x27ea11,null));};function wrapUser(_0x5be20e){return function(_0x133eeb){var _0x1ce8f1=_0x5be20e[_0x9255('0x4a')]({'plain':!![]});_0x1ce8f1[_0x9255('0x4b')]=[];if(_0x133eeb){_0x1ce8f1[_0x9255('0x4c')]=_0x133eeb['createdAt'];_0x1ce8f1['lastMessage']=_0x133eeb;}else{_0x1ce8f1['lastMessageAt']=moment(0x0)['format'](_0x9255('0x4d'));_0x1ce8f1[_0x9255('0x4e')]={};}return _0x1ce8f1;};}exports['getUsers']=function(_0x544a34,_0x51bf0c,_0x3802e6){var _0x48a974=[];return db[_0x9255('0x4f')][_0x9255('0x50')]({'where':{'role':[_0x9255('0x51'),_0x9255('0x52'),_0x9255('0x53')]},'attributes':['id',_0x9255('0x54'),_0x9255('0x30'),_0x9255('0x55'),_0x9255('0x56'),'internal',_0x9255('0x57'),_0x9255('0x58'),_0x9255('0x59'),_0x9255('0x5a')],'order':qs[_0x9255('0x37')]('-online'),'include':[{'model':db[_0x9255('0x5b')],'as':_0x9255('0x5c'),'attributes':['id','name',_0x9255('0x5d')],'through':{'attributes':[]}}]})[_0x9255('0x24')](function(_0xf3193a){if(_0xf3193a){var _0xb4383e=_0x544a34[_0x9255('0x53')][_0x9255('0x4a')]({'plain':!![]});if(!_0xb4383e)throw new Error(_0x9255('0x5e'));if(_0xb4383e[_0x9255('0x55')]===_0x9255('0x53')){return db[_0x9255('0x5f')]['find']({'where':{'name':_0x9255('0x60'),'userProfileId':_0xb4383e[_0x9255('0x61')]},'raw':!![]})[_0x9255('0x24')](function(_0x522ab1){if(_0x522ab1){if(_0x522ab1[_0x9255('0x62')]===0x0){return db[_0x9255('0x63')][_0x9255('0x50')]({'where':{'sectionId':_0x522ab1['id']},'raw':!![]})[_0x9255('0x24')](function(_0x4bb576){var _0x478690=[];if(_['isEmpty'](_0x4bb576)){_0x478690=_[_0x9255('0x3b')](_0xf3193a,function(_0x474df9){if(_0x474df9[_0x9255('0x55')]!==_0x9255('0x51')){return _0x474df9;}});return _0x478690;}else{for(var _0x7d00bf=0x0;_0x7d00bf<_0xf3193a[_0x9255('0x34')];_0x7d00bf++){var _0x101a25=_0xf3193a[_0x7d00bf];if(_0x101a25[_0x9255('0x55')]===_0x9255('0x51')){var _0xfa766a=_[_0x9255('0x47')](_0x4bb576,function(_0x1b475e){return _0x1b475e[_0x9255('0x64')]===_0x101a25['id'];});if(_0xfa766a)_0x478690[_0x9255('0x65')](_0x101a25);}else{_0x478690['push'](_0x101a25);}}return _0x478690;}});}else{return _0xf3193a;}}else{var _0x500319=_[_0x9255('0x3b')](_0xf3193a,function(_0x35bb2c){if(_0x35bb2c[_0x9255('0x55')]!==_0x9255('0x51')){return _0x35bb2c;}});return _0x500319;}});}else{return _0xf3193a;}}})[_0x9255('0x24')](function(_0x429ad2){var _0x5c7343=[];if(_0x429ad2){_0x48a974=_0x429ad2;for(var _0x6d3811=0x0;_0x6d3811<_0x429ad2['length'];_0x6d3811+=0x1){_0x48a974[_0x6d3811][_0x9255('0x4b')]=[];_0x5c7343[_0x9255('0x65')](db[_0x9255('0x2b')][_0x9255('0x47')]({'where':{'FromId':[_0x544a34[_0x9255('0x53')]['id'],_0x429ad2[_0x6d3811]['id']],'ToId':[_0x544a34[_0x9255('0x53')]['id'],_0x429ad2[_0x6d3811]['id']],'ChatGroupId':null},'attributes':['id',_0x9255('0x66'),'FromId',_0x9255('0x67'),_0x9255('0x68'),_0x9255('0x48')],'order':qs[_0x9255('0x37')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9255('0x24')](wrapUser(_0x429ad2[_0x6d3811])));}return BPromise[_0x9255('0x69')](_0x5c7343);}return[];})[_0x9255('0x24')](function(_0x1a1855){return{'rows':_0x1a1855,'count':_0x1a1855[_0x9255('0x34')]};})[_0x9255('0x24')](respondWithResult(_0x51bf0c,null))[_0x9255('0x42')](handleError(_0x51bf0c,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 9576f67..23a774c 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 _0xa86b=['save','remove','emit','hook','ChatInternalMessage','setMaxListeners'];(function(_0x8fe9d5,_0x5dc26d){var _0x12ebbc=function(_0x107b14){while(--_0x107b14){_0x8fe9d5['push'](_0x8fe9d5['shift']());}};_0x12ebbc(++_0x5dc26d);}(_0xa86b,0x172));var _0xba86=function(_0x38a11b,_0x2d2c62){_0x38a11b=_0x38a11b-0x0;var _0x2ba840=_0xa86b[_0x38a11b];return _0x2ba840;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0xba86('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xba86('0x1')](0x0);var events={'afterCreate':_0xba86('0x2'),'afterUpdate':'update','afterDestroy':_0xba86('0x3')};function emitEvent(_0x37030b){return function(_0x495bd1,_0x2cf99e,_0x6aa542){ChatInternalMessageEvents[_0xba86('0x4')](_0x37030b+':'+_0x495bd1['id'],_0x495bd1);ChatInternalMessageEvents[_0xba86('0x4')](_0x37030b,_0x495bd1);_0x6aa542(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xba86('0x5')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x2e02=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0x2e02,0x80));var _0x22e0=function(_0x1dfebf,_0x1d6791){_0x1dfebf=_0x1dfebf-0x0;var _0x5ec3fe=_0x2e02[_0x1dfebf];return _0x5ec3fe;};'use strict';var EventEmitter=require(_0x22e0('0x0'));var ChatInternalMessage=require(_0x22e0('0x1'))['db'][_0x22e0('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x22e0('0x3')](0x0);var events={'afterCreate':_0x22e0('0x4'),'afterUpdate':_0x22e0('0x5'),'afterDestroy':_0x22e0('0x6')};function emitEvent(_0x55a73c){return function(_0x55307a,_0x31163b,_0x4aee8f){ChatInternalMessageEvents[_0x22e0('0x7')](_0x55a73c+':'+_0x55307a['id'],_0x55307a);ChatInternalMessageEvents[_0x22e0('0x7')](_0x55a73c,_0x55307a);_0x4aee8f(null);};}for(var e in events){if(events[_0x22e0('0x8')](e)){var event=events[e];ChatInternalMessage[_0x22e0('0x9')](e,emitEvent(event));}}module[_0x22e0('0xa')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 058c305..85eb0b7 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 _0xedef=['ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xedef,0x8f));var _0xfede=function(_0x27223c,_0x5e8e4f){_0x27223c=_0x27223c-0x0;var _0xe925dd=_0xedef[_0x27223c];return _0xe925dd;};'use strict';var _=require('lodash');var util=require(_0xfede('0x0'));var logger=require(_0xfede('0x1'))(_0xfede('0x2'));var moment=require(_0xfede('0x3'));var BPromise=require('bluebird');var rp=require(_0xfede('0x4'));var fs=require('fs');var path=require(_0xfede('0x5'));var rimraf=require(_0xfede('0x6'));var config=require(_0xfede('0x7'));var attributes=require(_0xfede('0x8'));module[_0xfede('0x9')]=function(_0x382be3,_0x3a5101){return _0x382be3[_0xfede('0xa')](_0xfede('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfede('0xc'),'collate':_0xfede('0xd')});}; \ No newline at end of file +var _0x533a=['chat_internal_messages','lodash','bluebird','request-promise','exports','define','ChatInternalMessage'];(function(_0x3cb09b,_0x31c2a5){var _0x242048=function(_0x464aba){while(--_0x464aba){_0x3cb09b['push'](_0x3cb09b['shift']());}};_0x242048(++_0x31c2a5);}(_0x533a,0x158));var _0xa533=function(_0x4b366e,_0x479e1f){_0x4b366e=_0x4b366e-0x0;var _0x464dff=_0x533a[_0x4b366e];return _0x464dff;};'use strict';var _=require(_0xa533('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa533('0x1'));var rp=require(_0xa533('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xa533('0x3')]=function(_0x1ce5f9,_0x5735c0){return _0x1ce5f9[_0xa533('0x4')](_0xa533('0x5'),attributes,{'tableName':_0xa533('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index e8e8715..e9c64a5 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 _0x7301=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x99c2dd,_0x1d32eb){var _0x173349=function(_0x211a30){while(--_0x211a30){_0x99c2dd['push'](_0x99c2dd['shift']());}};_0x173349(++_0x1d32eb);}(_0x7301,0xc3));var _0x1730=function(_0x34a982,_0x829d3d){_0x34a982=_0x34a982-0x0;var _0x4dc748=_0x7301[_0x34a982];return _0x4dc748;};'use strict';var _=require(_0x1730('0x0'));var util=require(_0x1730('0x1'));var moment=require(_0x1730('0x2'));var BPromise=require(_0x1730('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1730('0x4'));var db=require(_0x1730('0x5'))['db'];var utils=require(_0x1730('0x6'));var logger=require(_0x1730('0x7'))('rpc');var config=require(_0x1730('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1730('0x9')][_0x1730('0xa')]({'port':0x232a});config[_0x1730('0xb')]=_[_0x1730('0xc')](config[_0x1730('0xb')],{'host':_0x1730('0xd'),'port':0x18eb});var socket=require(_0x1730('0xe'))(new Redis(config['redis']));require(_0x1730('0xf'))[_0x1730('0x10')](socket);function respondWithRpcPromise(_0x5afbf7,_0x4bfb88,_0x38eaeb){return new BPromise(function(_0x5fe565,_0x5db634){return client[_0x1730('0x11')](_0x5afbf7,_0x38eaeb)[_0x1730('0x12')](function(_0x181e85){logger['info'](_0x1730('0x13'),_0x4bfb88,_0x1730('0x14'));logger['debug'](_0x1730('0x15'),_0x4bfb88,_0x1730('0x14'),JSON[_0x1730('0x16')](_0x181e85));if(_0x181e85[_0x1730('0x17')]){if(_0x181e85[_0x1730('0x17')][_0x1730('0x18')]===0x1f4){logger[_0x1730('0x17')](_0x1730('0x13'),_0x4bfb88,_0x181e85['error'][_0x1730('0x19')]);return _0x5db634(_0x181e85[_0x1730('0x17')][_0x1730('0x19')]);}logger[_0x1730('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x4bfb88,_0x181e85[_0x1730('0x17')][_0x1730('0x19')]);return _0x5fe565(_0x181e85[_0x1730('0x17')]['message']);}else{logger['info'](_0x1730('0x13'),_0x4bfb88,_0x1730('0x14'));_0x5fe565(_0x181e85[_0x1730('0x1a')][_0x1730('0x19')]);}})[_0x1730('0x1b')](function(_0x1efda9){logger['error'](_0x1730('0x13'),_0x4bfb88,_0x1efda9);_0x5db634(_0x1efda9);});});} \ No newline at end of file +var _0x4286=['defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4286,0xbd));var _0x6428=function(_0xcd4829,_0x356874){_0xcd4829=_0xcd4829-0x0;var _0x5ae938=_0x4286[_0xcd4829];return _0x5ae938;};'use strict';var _=require(_0x6428('0x0'));var util=require(_0x6428('0x1'));var moment=require(_0x6428('0x2'));var BPromise=require(_0x6428('0x3'));var rs=require(_0x6428('0x4'));var fs=require('fs');var Redis=require(_0x6428('0x5'));var db=require(_0x6428('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6428('0x7'))(_0x6428('0x8'));var config=require(_0x6428('0x9'));var jayson=require(_0x6428('0xa'));var client=jayson[_0x6428('0xb')][_0x6428('0xc')]({'port':0x232a});config[_0x6428('0xd')]=_[_0x6428('0xe')](config[_0x6428('0xd')],{'host':_0x6428('0xf'),'port':0x18eb});var socket=require(_0x6428('0x10'))(new Redis(config['redis']));require(_0x6428('0x11'))[_0x6428('0x12')](socket);function respondWithRpcPromise(_0x132401,_0x58b02f,_0x12111b){return new BPromise(function(_0x548c2b,_0x19cc1c){return client['request'](_0x132401,_0x12111b)[_0x6428('0x13')](function(_0x180e21){logger[_0x6428('0x14')](_0x6428('0x15'),_0x58b02f,_0x6428('0x16'));logger[_0x6428('0x17')](_0x6428('0x18'),_0x58b02f,'request\x20sent',JSON['stringify'](_0x180e21));if(_0x180e21[_0x6428('0x19')]){if(_0x180e21[_0x6428('0x19')]['code']===0x1f4){logger[_0x6428('0x19')](_0x6428('0x15'),_0x58b02f,_0x180e21[_0x6428('0x19')][_0x6428('0x1a')]);return _0x19cc1c(_0x180e21[_0x6428('0x19')][_0x6428('0x1a')]);}logger[_0x6428('0x19')](_0x6428('0x15'),_0x58b02f,_0x180e21[_0x6428('0x19')][_0x6428('0x1a')]);return _0x548c2b(_0x180e21[_0x6428('0x19')][_0x6428('0x1a')]);}else{logger['info'](_0x6428('0x15'),_0x58b02f,_0x6428('0x16'));_0x548c2b(_0x180e21[_0x6428('0x1b')][_0x6428('0x1a')]);}})[_0x6428('0x1c')](function(_0x36eead){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x58b02f,_0x36eead);_0x19cc1c(_0x36eead);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 7304709..eb87fad 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 _0xcde8=['update','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x3d7513,_0x1056b4){var _0xeb6252=function(_0x6bf9fc){while(--_0x6bf9fc){_0x3d7513['push'](_0x3d7513['shift']());}};_0xeb6252(++_0x1056b4);}(_0xcde8,0x95));var _0x8cde=function(_0x5358e7,_0x430b60){_0x5358e7=_0x5358e7-0x0;var _0x48dc5e=_0xcde8[_0x5358e7];return _0x48dc5e;};'use strict';var ChatInternalMessageEvents=require(_0x8cde('0x0'));var events=[_0x8cde('0x1'),_0x8cde('0x2'),_0x8cde('0x3')];function createListener(_0x411a51,_0x230b4f){return function(_0x2699e4){_0x230b4f['emit'](_0x411a51,_0x2699e4);};}function removeListener(_0x451c09,_0x16cbea){return function(){ChatInternalMessageEvents[_0x8cde('0x4')](_0x451c09,_0x16cbea);};}exports[_0x8cde('0x5')]=function(_0x1d4eda){for(var _0x207f0c=0x0,_0x46f063=events[_0x8cde('0x6')];_0x207f0c<_0x46f063;_0x207f0c++){var _0x53811b=events[_0x207f0c];var _0x1e0bc8=createListener(_0x8cde('0x7')+_0x53811b,_0x1d4eda);ChatInternalMessageEvents['on'](_0x53811b,_0x1e0bc8);}}; \ No newline at end of file +var _0xb1bd=['update','emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','remove'];(function(_0x110d73,_0x440105){var _0x8b4b26=function(_0x413104){while(--_0x413104){_0x110d73['push'](_0x110d73['shift']());}};_0x8b4b26(++_0x440105);}(_0xb1bd,0x1d3));var _0xdb1b=function(_0x4df10c,_0x17c4d8){_0x4df10c=_0x4df10c-0x0;var _0xf1e479=_0xb1bd[_0x4df10c];return _0xf1e479;};'use strict';var ChatInternalMessageEvents=require(_0xdb1b('0x0'));var events=['save',_0xdb1b('0x1'),_0xdb1b('0x2')];function createListener(_0x16bacf,_0xcf33a7){return function(_0x3ee9bf){_0xcf33a7[_0xdb1b('0x3')](_0x16bacf,_0x3ee9bf);};}function removeListener(_0x54375c,_0x4afeea){return function(){ChatInternalMessageEvents[_0xdb1b('0x4')](_0x54375c,_0x4afeea);};}exports[_0xdb1b('0x5')]=function(_0x2aee1e){for(var _0x5d19ff=0x0,_0x21717f=events['length'];_0x5d19ff<_0x21717f;_0x5d19ff++){var _0x6b5435=events[_0x5d19ff];var _0x26cba1=createListener(_0xdb1b('0x6')+_0x6b5435,_0x2aee1e);ChatInternalMessageEvents['on'](_0x6b5435,_0x26cba1);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index e698788..53671a1 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 _0x92ef=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','describe','/users','getUsers','/:id','create'];(function(_0xb134f6,_0x2034e1){var _0x35b39a=function(_0xf17af3){while(--_0xf17af3){_0xb134f6['push'](_0xb134f6['shift']());}};_0x35b39a(++_0x2034e1);}(_0x92ef,0x1e7));var _0xf92e=function(_0x290098,_0x305ba5){_0x290098=_0x290098-0x0;var _0x32db2a=_0x92ef[_0x290098];return _0x32db2a;};'use strict';var multer=require(_0xf92e('0x0'));var util=require('util');var path=require(_0xf92e('0x1'));var timeout=require(_0xf92e('0x2'));var express=require(_0xf92e('0x3'));var router=express[_0xf92e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf92e('0x5'));var interaction=require(_0xf92e('0x6'));var config=require(_0xf92e('0x7'));var controller=require(_0xf92e('0x8'));router['get']('/',auth[_0xf92e('0x9')](),controller[_0xf92e('0xa')]);router[_0xf92e('0xb')]('/describe',auth[_0xf92e('0x9')](),controller[_0xf92e('0xc')]);router[_0xf92e('0xb')](_0xf92e('0xd'),auth[_0xf92e('0x9')](),controller[_0xf92e('0xe')]);router[_0xf92e('0xb')](_0xf92e('0xf'),auth[_0xf92e('0x9')](),controller['show']);router['post']('/',auth[_0xf92e('0x9')](),controller[_0xf92e('0x10')]);router['put']('/:id',controller[_0xf92e('0x11')]);router[_0xf92e('0x12')](_0xf92e('0xf'),auth[_0xf92e('0x9')](),controller[_0xf92e('0x13')]);module[_0xf92e('0x14')]=router; \ No newline at end of file +var _0x8c54=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/users','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x5ca81d,_0x498baf){var _0x4b0a59=function(_0x107dc9){while(--_0x107dc9){_0x5ca81d['push'](_0x5ca81d['shift']());}};_0x4b0a59(++_0x498baf);}(_0x8c54,0xb8));var _0x48c5=function(_0x189ce7,_0x279721){_0x189ce7=_0x189ce7-0x0;var _0x2c5622=_0x8c54[_0x189ce7];return _0x2c5622;};'use strict';var multer=require(_0x48c5('0x0'));var util=require(_0x48c5('0x1'));var path=require(_0x48c5('0x2'));var timeout=require(_0x48c5('0x3'));var express=require('express');var router=express[_0x48c5('0x4')]();var fs_extra=require(_0x48c5('0x5'));var auth=require(_0x48c5('0x6'));var interaction=require(_0x48c5('0x7'));var config=require(_0x48c5('0x8'));var controller=require('./chatInternalMessage.controller');router[_0x48c5('0x9')]('/',auth[_0x48c5('0xa')](),controller[_0x48c5('0xb')]);router[_0x48c5('0x9')](_0x48c5('0xc'),auth[_0x48c5('0xa')](),controller[_0x48c5('0xd')]);router[_0x48c5('0x9')](_0x48c5('0xe'),auth[_0x48c5('0xa')](),controller['getUsers']);router[_0x48c5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x48c5('0xf')]('/',auth[_0x48c5('0xa')](),controller[_0x48c5('0x10')]);router[_0x48c5('0x11')]('/:id',controller[_0x48c5('0x12')]);router[_0x48c5('0x13')](_0x48c5('0x14'),auth['isAuthenticated'](),controller[_0x48c5('0x15')]);module[_0x48c5('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 5c9ad90..f26d9ec 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 _0x9f4d=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x33c24c,_0x23b7a4){var _0xd4ed69=function(_0x1c4f1a){while(--_0x1c4f1a){_0x33c24c['push'](_0x33c24c['shift']());}};_0xd4ed69(++_0x23b7a4);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x380af2,_0x36cf66){_0x380af2=_0x380af2-0x0;var _0x1789dc=_0x9f4d[_0x380af2];return _0x1789dc;};'use strict';var Sequelize=require(_0xd9f4('0x0'));module[_0xd9f4('0x1')]={'body':{'type':Sequelize[_0xd9f4('0x2')](_0xd9f4('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd9f4('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd9f4('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9f4('0x5')]('in',_0xd9f4('0x6')),'defaultValue':_0xd9f4('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xd9f4('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x0c71=['medium','BOOLEAN','out','STRING','TEXT','exports'];(function(_0x233cb1,_0x8ca9a2){var _0x29ee7e=function(_0x20e277){while(--_0x20e277){_0x233cb1['push'](_0x233cb1['shift']());}};_0x29ee7e(++_0x8ca9a2);}(_0x0c71,0xfb));var _0x10c7=function(_0x4c87fd,_0x5863a6){_0x4c87fd=_0x4c87fd-0x0;var _0x1d4178=_0x0c71[_0x4c87fd];return _0x1d4178;};'use strict';var Sequelize=require('sequelize');module[_0x10c7('0x0')]={'body':{'type':Sequelize['TEXT'](_0x10c7('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x10c7('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x10c7('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x10c7('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x10c7('0x4')]},'providerResponse':{'type':Sequelize[_0x10c7('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 4ce1196..8cc4939 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 _0xdaa7=['mustache','util','path','sox','ejs','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','save','update','stack','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','length','find','create','body','params','destroy','describe','../../config/logger','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteractionId','isNil','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','agent','internal','manual','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','reject','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','User','fullname','email','interface','SIP/%s','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x2c085d,_0x2b0695){var _0x36ab91=function(_0x5a4a2f){while(--_0x5a4a2f){_0x2c085d['push'](_0x2c085d['shift']());}};_0x36ab91(++_0x2b0695);}(_0xdaa7,0x199));var _0x7daa=function(_0x39106e,_0x586f3d){_0x39106e=_0x39106e-0x0;var _0x892aec=_0xdaa7[_0x39106e];return _0x892aec;};'use strict';var emlformat=require(_0x7daa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7daa('0x1'));var jsonpatch=require(_0x7daa('0x2'));var rp=require(_0x7daa('0x3'));var moment=require('moment');var BPromise=require(_0x7daa('0x4'));var Mustache=require(_0x7daa('0x5'));var util=require(_0x7daa('0x6'));var path=require(_0x7daa('0x7'));var sox=require(_0x7daa('0x8'));var csv=require('to-csv');var ejs=require(_0x7daa('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7daa('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7daa('0xb'));var toCsv=require(_0x7daa('0xc'));var querystring=require(_0x7daa('0xd'));var Papa=require(_0x7daa('0xe'));var Redis=require(_0x7daa('0xf'));var authService=require(_0x7daa('0x10'));var qs=require(_0x7daa('0x11'));var as=require(_0x7daa('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7daa('0x13'));var utils=require(_0x7daa('0x14'));var config=require(_0x7daa('0x15'));var licenseUtil=require(_0x7daa('0x16'));var db=require(_0x7daa('0x17'))['db'];config[_0x7daa('0x18')]=_[_0x7daa('0x19')](config[_0x7daa('0x18')],{'host':_0x7daa('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7daa('0x18')]));require('./chatMessage.socket')[_0x7daa('0x1b')](socket);var jayson=require(_0x7daa('0x1c'));var client=jayson[_0x7daa('0x1d')][_0x7daa('0x1e')]({'port':0x232c});var client9002=jayson[_0x7daa('0x1d')][_0x7daa('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x49f844,_0x36070c,_0xd2d589,_0x44c760){return new BPromise(function(_0x52c5cc,_0x205e62){var _0x1b5ab5=_0x44c760||client;return _0x1b5ab5[_0x7daa('0x1f')](_0x49f844,_0xd2d589)[_0x7daa('0x20')](function(_0x15cf70){logger[_0x7daa('0x21')](_0x7daa('0x22'),_0x36070c,_0x7daa('0x23'));logger['debug'](_0x7daa('0x24'),_0x36070c,'request\x20sent',JSON[_0x7daa('0x25')](_0x15cf70));if(_0x15cf70[_0x7daa('0x26')]){if(_0x15cf70[_0x7daa('0x26')][_0x7daa('0x27')]===0x1f4){logger[_0x7daa('0x26')](_0x7daa('0x22'),_0x36070c,_0x15cf70[_0x7daa('0x26')][_0x7daa('0x28')]);return _0x205e62(_0x15cf70[_0x7daa('0x26')]['message']);}logger['error'](_0x7daa('0x22'),_0x36070c,_0x15cf70[_0x7daa('0x26')][_0x7daa('0x28')]);return _0x52c5cc(_0x15cf70['error'][_0x7daa('0x28')]);}else{logger[_0x7daa('0x21')](_0x7daa('0x22'),_0x36070c,_0x7daa('0x23'));_0x52c5cc(_0x15cf70[_0x7daa('0x29')][_0x7daa('0x28')]);}})[_0x7daa('0x2a')](function(_0x3cba4a){logger[_0x7daa('0x26')](_0x7daa('0x22'),_0x36070c,_0x3cba4a);_0x205e62(_0x3cba4a);});});}function respondWithStatusCode(_0x1f1124,_0x3c638b){_0x3c638b=_0x3c638b||0xcc;return function(_0x5ae3a9){if(_0x5ae3a9){return _0x1f1124[_0x7daa('0x2b')](_0x3c638b);}return _0x1f1124['status'](_0x3c638b)[_0x7daa('0x2c')]();};}function respondWithResult(_0xd0ed48,_0x888313){_0x888313=_0x888313||0xc8;return function(_0x582728){if(_0x582728){return _0xd0ed48['status'](_0x888313)[_0x7daa('0x2d')](_0x582728);}};}function respondWithFilteredResult(_0x590690,_0x5ebb35){return function(_0x413320){if(_0x413320){var _0x54ee8d=typeof _0x5ebb35[_0x7daa('0x2e')]===_0x7daa('0x2f')&&typeof _0x5ebb35['limit']===_0x7daa('0x2f');var _0x3e161f=_0x413320[_0x7daa('0x30')];var _0x288d92=_0x54ee8d?0x0:_0x5ebb35[_0x7daa('0x2e')];var _0x116574=_0x54ee8d?_0x413320[_0x7daa('0x30')]:_0x5ebb35[_0x7daa('0x2e')]+_0x5ebb35[_0x7daa('0x31')];var _0x2d04c5;if(_0x116574>=_0x3e161f){_0x116574=_0x3e161f;_0x2d04c5=0xc8;}else{_0x2d04c5=0xce;}_0x590690[_0x7daa('0x32')](_0x2d04c5);return _0x590690[_0x7daa('0x33')](_0x7daa('0x34'),_0x288d92+'-'+_0x116574+'/'+_0x3e161f)[_0x7daa('0x2d')](_0x413320);}return null;};}function patchUpdates(_0x443908){return function(_0x28b8aa){try{jsonpatch[_0x7daa('0x35')](_0x28b8aa,_0x443908,!![]);}catch(_0x5911dd){return BPromise['reject'](_0x5911dd);}return _0x28b8aa[_0x7daa('0x36')]();};}function saveUpdates(_0x56748a,_0x3e6c69){return function(_0x3705c9){if(_0x3705c9){return _0x3705c9[_0x7daa('0x37')](_0x56748a)[_0x7daa('0x20')](function(_0x4017bb){return _0x4017bb;});}return null;};}function removeEntity(_0x175765,_0x3722d0){return function(_0x48079d){if(_0x48079d){return _0x48079d['destroy']()[_0x7daa('0x20')](function(){_0x175765[_0x7daa('0x32')](0xcc)[_0x7daa('0x2c')]();});}};}function handleEntityNotFound(_0x169103,_0x461e9d){return function(_0x3e4827){if(!_0x3e4827){_0x169103[_0x7daa('0x2b')](0x194);}return _0x3e4827;};}function handleError(_0x1c30c0,_0xfb5157){_0xfb5157=_0xfb5157||0x1f4;return function(_0x28771c){logger[_0x7daa('0x26')](_0x28771c[_0x7daa('0x38')]);if(_0x28771c[_0x7daa('0x39')]){delete _0x28771c['name'];}_0x1c30c0[_0x7daa('0x32')](_0xfb5157)[_0x7daa('0x3a')](_0x28771c);};}exports['index']=function(_0x3f3952,_0x229fdb){var _0x415c4d={},_0x31a165={},_0x503a30={'count':0x0,'rows':[]};var _0x42477e=_[_0x7daa('0x3b')](db[_0x7daa('0x3c')][_0x7daa('0x3d')],function(_0x82d879){return{'name':_0x82d879[_0x7daa('0x3e')],'type':_0x82d879[_0x7daa('0x3f')][_0x7daa('0x40')]};});_0x31a165[_0x7daa('0x41')]=_[_0x7daa('0x3b')](_0x42477e,_0x7daa('0x39'));_0x31a165[_0x7daa('0x42')]=_[_0x7daa('0x43')](_0x3f3952[_0x7daa('0x42')]);_0x31a165[_0x7daa('0x44')]=_['intersection'](_0x31a165[_0x7daa('0x41')],_0x31a165[_0x7daa('0x42')]);_0x415c4d[_0x7daa('0x45')]=_[_0x7daa('0x46')](_0x31a165[_0x7daa('0x41')],qs[_0x7daa('0x47')](_0x3f3952[_0x7daa('0x42')][_0x7daa('0x47')]));_0x415c4d[_0x7daa('0x45')]=_0x415c4d['attributes']['length']?_0x415c4d[_0x7daa('0x45')]:_0x31a165[_0x7daa('0x41')];if(!_0x3f3952[_0x7daa('0x42')][_0x7daa('0x48')](_0x7daa('0x49'))){_0x415c4d['limit']=qs[_0x7daa('0x31')](_0x3f3952[_0x7daa('0x42')][_0x7daa('0x31')]);_0x415c4d[_0x7daa('0x2e')]=qs[_0x7daa('0x2e')](_0x3f3952[_0x7daa('0x42')][_0x7daa('0x2e')]);}_0x415c4d[_0x7daa('0x4a')]=qs[_0x7daa('0x4b')](_0x3f3952[_0x7daa('0x42')][_0x7daa('0x4b')]);_0x415c4d[_0x7daa('0x4c')]=qs[_0x7daa('0x44')](_[_0x7daa('0x4d')](_0x3f3952[_0x7daa('0x42')],_0x31a165[_0x7daa('0x44')]),_0x42477e);if(_0x3f3952[_0x7daa('0x42')]['filter']){_0x415c4d[_0x7daa('0x4c')]=_['merge'](_0x415c4d[_0x7daa('0x4c')],{'$or':_[_0x7daa('0x3b')](_0x42477e,function(_0x5a36b7){if(_0x5a36b7[_0x7daa('0x3f')]!==_0x7daa('0x4e')){var _0x802a2e={};_0x802a2e[_0x5a36b7[_0x7daa('0x39')]]={'$like':'%'+_0x3f3952[_0x7daa('0x42')][_0x7daa('0x4f')]+'%'};return _0x802a2e;}})});}_0x415c4d=_[_0x7daa('0x50')]({},_0x415c4d,_0x3f3952[_0x7daa('0x51')]);var _0x419487={'where':_0x415c4d['where']};return db[_0x7daa('0x3c')][_0x7daa('0x30')](_0x419487)[_0x7daa('0x20')](function(_0x2372e3){_0x503a30[_0x7daa('0x30')]=_0x2372e3;if(_0x3f3952['query'][_0x7daa('0x52')]){_0x415c4d[_0x7daa('0x53')]=[{'all':!![]}];}return db[_0x7daa('0x3c')][_0x7daa('0x54')](_0x415c4d);})[_0x7daa('0x20')](function(_0x152c6b){_0x503a30[_0x7daa('0x55')]=_0x152c6b;return _0x503a30;})[_0x7daa('0x20')](respondWithFilteredResult(_0x229fdb,_0x415c4d))[_0x7daa('0x2a')](handleError(_0x229fdb,null));};exports['show']=function(_0x19697f,_0x45ce5f){var _0x3e4a1c={'raw':!![],'where':{'id':_0x19697f['params']['id']}},_0x5853ba={};_0x5853ba['model']=_['keys'](db[_0x7daa('0x3c')][_0x7daa('0x3d')]);_0x5853ba[_0x7daa('0x42')]=_[_0x7daa('0x43')](_0x19697f[_0x7daa('0x42')]);_0x5853ba[_0x7daa('0x44')]=_[_0x7daa('0x46')](_0x5853ba[_0x7daa('0x41')],_0x5853ba[_0x7daa('0x42')]);_0x3e4a1c[_0x7daa('0x45')]=_[_0x7daa('0x46')](_0x5853ba[_0x7daa('0x41')],qs['fields'](_0x19697f[_0x7daa('0x42')][_0x7daa('0x47')]));_0x3e4a1c['attributes']=_0x3e4a1c[_0x7daa('0x45')][_0x7daa('0x56')]?_0x3e4a1c[_0x7daa('0x45')]:_0x5853ba[_0x7daa('0x41')];if(_0x19697f[_0x7daa('0x42')][_0x7daa('0x52')]){_0x3e4a1c[_0x7daa('0x53')]=[{'all':!![]}];}_0x3e4a1c=_['merge']({},_0x3e4a1c,_0x19697f[_0x7daa('0x51')]);return db['ChatMessage'][_0x7daa('0x57')](_0x3e4a1c)[_0x7daa('0x20')](handleEntityNotFound(_0x45ce5f,null))['then'](respondWithResult(_0x45ce5f,null))[_0x7daa('0x2a')](handleError(_0x45ce5f,null));};exports[_0x7daa('0x58')]=function(_0x412471,_0x399a6b){return db[_0x7daa('0x3c')][_0x7daa('0x58')](_0x412471[_0x7daa('0x59')],{})['then'](respondWithResult(_0x399a6b,0xc9))['catch'](handleError(_0x399a6b,null));};exports[_0x7daa('0x37')]=function(_0x4f700b,_0x4198de){if(_0x4f700b['body']['id']){delete _0x4f700b[_0x7daa('0x59')]['id'];}return db[_0x7daa('0x3c')][_0x7daa('0x57')]({'where':{'id':_0x4f700b[_0x7daa('0x5a')]['id']}})[_0x7daa('0x20')](handleEntityNotFound(_0x4198de,null))[_0x7daa('0x20')](saveUpdates(_0x4f700b[_0x7daa('0x59')],null))['then'](respondWithResult(_0x4198de,null))[_0x7daa('0x2a')](handleError(_0x4198de,null));};exports[_0x7daa('0x5b')]=function(_0x2e5d25,_0x6560a){return db[_0x7daa('0x3c')][_0x7daa('0x57')]({'where':{'id':_0x2e5d25['params']['id']}})['then'](handleEntityNotFound(_0x6560a,null))[_0x7daa('0x20')](removeEntity(_0x6560a,null))[_0x7daa('0x2a')](handleError(_0x6560a,null));};exports[_0x7daa('0x5c')]=function(_0x2906f2,_0x4939bb){return db[_0x7daa('0x3c')][_0x7daa('0x5c')]()[_0x7daa('0x20')](respondWithResult(_0x4939bb,null))[_0x7daa('0x2a')](handleError(_0x4939bb,null));};var interaction_log=require(_0x7daa('0x5d'))(_0x7daa('0x5e'));exports[_0x7daa('0x5f')]=function(_0x29b67f,_0x34e5c4,_0x56d0df){var _0x510cf0={'agent':{},'channel':_0x7daa('0x60')};if(_0x29b67f[_0x7daa('0x59')]['id']){delete _0x29b67f[_0x7daa('0x59')]['id'];}_0x29b67f[_0x7daa('0x59')][_0x7daa('0x61')]=!![];_0x29b67f[_0x7daa('0x59')]['readAt']=moment()[_0x7daa('0x62')](_0x7daa('0x63'));_0x29b67f['body'][_0x7daa('0x64')]=_0x29b67f[_0x7daa('0x59')]['UserId']||_0x29b67f[_0x7daa('0x65')]['id'];_0x510cf0['agent']['id']=_0x29b67f['body'][_0x7daa('0x64')];return db[_0x7daa('0x3c')][_0x7daa('0x57')]({'where':{'id':_0x29b67f[_0x7daa('0x5a')]['id'],'UserId':null}})[_0x7daa('0x20')](handleEntityNotFound(_0x34e5c4,null))[_0x7daa('0x20')](saveUpdates(_0x29b67f[_0x7daa('0x59')],null))[_0x7daa('0x20')](function(_0x13d026){if(_0x13d026){_0x510cf0[_0x7daa('0x28')]=_0x13d026[_0x7daa('0x66')]({'plain':!![]});return db['ChatInteraction'][_0x7daa('0x57')]({'where':{'id':_0x13d026[_0x7daa('0x67')]}});}return null;})[_0x7daa('0x20')](handleEntityNotFound(_0x34e5c4,null))['then'](function(_0x367085){if(_0x367085){return _0x367085[_0x7daa('0x37')]({'UserId':_0x29b67f[_0x7daa('0x59')][_0x7daa('0x64')],'read1stAt':_[_0x7daa('0x68')](_0x367085['read1stAt'])?moment()[_0x7daa('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1adbf7){if(_0x1adbf7){_0x510cf0[_0x7daa('0x69')]=_0x1adbf7[_0x7daa('0x66')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x29b67f['user']['id'],_0x29b67f[_0x7daa('0x65')][_0x7daa('0x39')],_0x29b67f[_0x7daa('0x65')][_0x7daa('0x6a')],_0x510cf0[_0x7daa('0x69')]['id'],_0x29b67f[_0x7daa('0x59')]?JSON[_0x7daa('0x25')](_0x29b67f[_0x7daa('0x59')]):_0x7daa('0x6b'));return respondWithRpcPromise(_0x7daa('0x6c'),_0x7daa('0x6d'),_0x510cf0);}return null;})[_0x7daa('0x20')](function(_0x1f22ea){var _0x266a75=_0x7daa('0x6e')+_0x1f22ea[_0x7daa('0x28')][_0x7daa('0x6f')];return db[_0x7daa('0x70')][_0x7daa('0x42')](_0x266a75,{'type':db[_0x7daa('0x71')]['QueryTypes'][_0x7daa('0x72')],'raw':!![]})[_0x7daa('0x20')](function(_0x52663f){return _0x52663f;});})[_0x7daa('0x20')](function(_0x1ddc3c){if(_0x1ddc3c){_0x510cf0[_0x7daa('0x28')][_0x7daa('0x73')]=_0x1ddc3c[0x0];if(!_0x29b67f[_0x7daa('0x59')][_0x7daa('0x64')])return;return db['User'][_0x7daa('0x57')]({'where':{'id':_0x29b67f['body']['UserId'],'role':_0x7daa('0x74')},'attributes':['id','name','fullname','email',_0x7daa('0x75')],'raw':!![]});}return null;})[_0x7daa('0x20')](function(_0x303c3f){if(!_0x303c3f)return null;_0x510cf0['message'][_0x7daa('0x74')]=_0x303c3f;return _0x510cf0;})[_0x7daa('0x20')](function(_0x5656b2){if(_0x5656b2){if(_0x29b67f['body'][_0x7daa('0x76')]){_0x510cf0[_0x7daa('0x28')]['interface']=util[_0x7daa('0x62')]('SIP/%s',_0x29b67f[_0x7daa('0x65')]['name']);_0x510cf0[_0x7daa('0x28')][_0x7daa('0x77')]=_0x510cf0['channel'];_0x510cf0['message'][_0x7daa('0x78')]=_0x510cf0['channel'];_0x510cf0[_0x7daa('0x28')][_0x7daa('0x79')]=_0x7daa('0x5f');return respondWithRpcPromise(_0x7daa('0x7a'),_0x7daa('0x7a'),{'event':_0x7daa('0x7b'),'message':_[_0x7daa('0x50')](_0x510cf0[_0x7daa('0x28')],JSON[_0x7daa('0x7c')](_0x510cf0['interaction'][_0x7daa('0x7d')]))},client9002)[_0x7daa('0x20')](function(){return _0x510cf0;});}return _0x510cf0;}return null;})[_0x7daa('0x20')](respondWithResult(_0x34e5c4,null))[_0x7daa('0x2a')](handleError(_0x34e5c4,null));};var interaction_log=require('../../config/logger')(_0x7daa('0x5e'));exports[_0x7daa('0x7e')]=function(_0x5b24ad,_0x652d9f,_0x9ded8b){var _0x139e1f={'agent':{},'channel':_0x7daa('0x60')};if(_0x5b24ad[_0x7daa('0x59')]['id']){delete _0x5b24ad[_0x7daa('0x59')]['id'];}_0x5b24ad[_0x7daa('0x59')][_0x7daa('0x64')]=_0x5b24ad[_0x7daa('0x59')][_0x7daa('0x64')]||_0x5b24ad[_0x7daa('0x65')]['id'];_0x139e1f[_0x7daa('0x74')]['id']=_0x5b24ad[_0x7daa('0x59')][_0x7daa('0x64')];return db[_0x7daa('0x3c')][_0x7daa('0x57')]({'where':{'id':_0x5b24ad[_0x7daa('0x5a')]['id'],'UserId':null}})[_0x7daa('0x20')](handleEntityNotFound(_0x652d9f,null))[_0x7daa('0x20')](function(_0x29cce9){if(_0x29cce9){_0x139e1f[_0x7daa('0x28')]=_0x29cce9['get']({'plain':!![]});return db[_0x7daa('0x7f')][_0x7daa('0x57')]({'where':{'id':_0x29cce9[_0x7daa('0x67')]}});}return null;})[_0x7daa('0x20')](handleEntityNotFound(_0x652d9f,null))[_0x7daa('0x20')](function(_0x55ff16){if(_0x55ff16){_0x139e1f[_0x7daa('0x69')]=_0x55ff16[_0x7daa('0x66')]({'plain':!![]});interaction_log[_0x7daa('0x21')](_0x7daa('0x80'),_0x5b24ad[_0x7daa('0x65')]['id'],_0x5b24ad['user'][_0x7daa('0x39')],_0x5b24ad[_0x7daa('0x65')]['role'],_0x139e1f[_0x7daa('0x69')]['id'],_0x5b24ad['body']?JSON[_0x7daa('0x25')](_0x5b24ad[_0x7daa('0x59')]):_0x7daa('0x6b'));return respondWithRpcPromise(_0x7daa('0x81'),_0x7daa('0x82'),_0x139e1f);}return null;})[_0x7daa('0x20')](function(_0xe71947){var _0x397aaa=_0x7daa('0x6e')+_0xe71947[_0x7daa('0x28')][_0x7daa('0x6f')];return db[_0x7daa('0x70')][_0x7daa('0x42')](_0x397aaa,{'type':db[_0x7daa('0x71')][_0x7daa('0x83')][_0x7daa('0x72')],'raw':!![]})[_0x7daa('0x20')](function(_0x1793b8){return _0x1793b8;});})['then'](function(_0x4c3007){if(_0x4c3007){_0x139e1f['message'][_0x7daa('0x73')]=_0x4c3007[0x0];if(!_0x5b24ad[_0x7daa('0x59')][_0x7daa('0x64')])return;return db[_0x7daa('0x84')]['find']({'where':{'id':_0x5b24ad[_0x7daa('0x59')][_0x7daa('0x64')],'role':_0x7daa('0x74')},'attributes':['id',_0x7daa('0x39'),_0x7daa('0x85'),_0x7daa('0x86'),_0x7daa('0x75')],'raw':!![]});}return null;})['then'](function(_0x1b6ced){if(!_0x1b6ced)return null;_0x139e1f['message']['agent']=_0x1b6ced;return _0x139e1f;})[_0x7daa('0x20')](function(_0x5e9094){if(_0x5e9094){_0x5e9094[_0x7daa('0x28')][_0x7daa('0x87')]=util['format'](_0x7daa('0x88'),_0x5b24ad[_0x7daa('0x65')][_0x7daa('0x39')]);_0x5e9094[_0x7daa('0x28')][_0x7daa('0x77')]=_0x139e1f[_0x7daa('0x77')];_0x5e9094[_0x7daa('0x28')][_0x7daa('0x78')]=_0x139e1f[_0x7daa('0x77')];_0x5e9094[_0x7daa('0x28')]['event']=_0x7daa('0x7e');respondWithRpcPromise('EventManager',_0x7daa('0x7a'),{'event':_0x7daa('0x89'),'message':_[_0x7daa('0x50')](_0x139e1f[_0x7daa('0x28')],JSON[_0x7daa('0x7c')](_0x139e1f[_0x7daa('0x69')]['formData']))},client9002);return _0x139e1f;}return null;})[_0x7daa('0x20')](respondWithResult(_0x652d9f,null))[_0x7daa('0x2a')](handleError(_0x652d9f,null));}; \ No newline at end of file +var _0xb598=['status','end','json','undefined','limit','count','offset','set','apply','save','update','then','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','describe','chat-interactions','chat','read','readAt','format','UserId','agent','get','ChatInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','channel','event','accept','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','SIP/%s','motionChannel','reject','rejectmessage','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus'];(function(_0x5aeedc,_0x4a43ec){var _0x2645b2=function(_0x1e01af){while(--_0x1e01af){_0x5aeedc['push'](_0x5aeedc['shift']());}};_0x2645b2(++_0x4a43ec);}(_0xb598,0x168));var _0x8b59=function(_0x357930,_0x29c90d){_0x357930=_0x357930-0x0;var _0x7abbce=_0xb598[_0x357930];return _0x7abbce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8b59('0x0'));var jsonpatch=require(_0x8b59('0x1'));var rp=require(_0x8b59('0x2'));var moment=require(_0x8b59('0x3'));var BPromise=require(_0x8b59('0x4'));var Mustache=require(_0x8b59('0x5'));var util=require(_0x8b59('0x6'));var path=require(_0x8b59('0x7'));var sox=require(_0x8b59('0x8'));var csv=require(_0x8b59('0x9'));var ejs=require(_0x8b59('0xa'));var fs=require('fs');var fs_extra=require(_0x8b59('0xb'));var _=require(_0x8b59('0xc'));var squel=require('squel');var crypto=require(_0x8b59('0xd'));var jsforce=require(_0x8b59('0xe'));var deskjs=require(_0x8b59('0xf'));var toCsv=require(_0x8b59('0x9'));var querystring=require(_0x8b59('0x10'));var Papa=require('papaparse');var Redis=require(_0x8b59('0x11'));var authService=require(_0x8b59('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8b59('0x13'));var hardwareService=require(_0x8b59('0x14'));var logger=require(_0x8b59('0x15'))(_0x8b59('0x16'));var utils=require(_0x8b59('0x17'));var config=require(_0x8b59('0x18'));var licenseUtil=require(_0x8b59('0x19'));var db=require(_0x8b59('0x1a'))['db'];config[_0x8b59('0x1b')]=_['defaults'](config['redis'],{'host':_0x8b59('0x1c'),'port':0x18eb});var socket=require(_0x8b59('0x1d'))(new Redis(config[_0x8b59('0x1b')]));require(_0x8b59('0x1e'))[_0x8b59('0x1f')](socket);var jayson=require(_0x8b59('0x20'));var client=jayson[_0x8b59('0x21')][_0x8b59('0x22')]({'port':0x232c});var client9002=jayson[_0x8b59('0x21')][_0x8b59('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x5a3b73,_0x219c3f,_0x4888f2,_0x2147e0){return new BPromise(function(_0x473a8f,_0x49f196){var _0x5defdf=_0x2147e0||client;return _0x5defdf[_0x8b59('0x23')](_0x5a3b73,_0x4888f2)['then'](function(_0x2a1bb8){logger[_0x8b59('0x24')]('ChatMessage,\x20%s,\x20%s',_0x219c3f,_0x8b59('0x25'));logger[_0x8b59('0x26')](_0x8b59('0x27'),_0x219c3f,_0x8b59('0x25'),JSON[_0x8b59('0x28')](_0x2a1bb8));if(_0x2a1bb8['error']){if(_0x2a1bb8[_0x8b59('0x29')][_0x8b59('0x2a')]===0x1f4){logger[_0x8b59('0x29')](_0x8b59('0x2b'),_0x219c3f,_0x2a1bb8['error'][_0x8b59('0x2c')]);return _0x49f196(_0x2a1bb8[_0x8b59('0x29')][_0x8b59('0x2c')]);}logger[_0x8b59('0x29')]('ChatMessage,\x20%s,\x20%s',_0x219c3f,_0x2a1bb8[_0x8b59('0x29')][_0x8b59('0x2c')]);return _0x473a8f(_0x2a1bb8['error'][_0x8b59('0x2c')]);}else{logger[_0x8b59('0x24')](_0x8b59('0x2b'),_0x219c3f,_0x8b59('0x25'));_0x473a8f(_0x2a1bb8[_0x8b59('0x2d')][_0x8b59('0x2c')]);}})[_0x8b59('0x2e')](function(_0x1c1bc3){logger['error'](_0x8b59('0x2b'),_0x219c3f,_0x1c1bc3);_0x49f196(_0x1c1bc3);});});}function respondWithStatusCode(_0x186272,_0x93e5b3){_0x93e5b3=_0x93e5b3||0xcc;return function(_0x488cec){if(_0x488cec){return _0x186272[_0x8b59('0x2f')](_0x93e5b3);}return _0x186272[_0x8b59('0x30')](_0x93e5b3)[_0x8b59('0x31')]();};}function respondWithResult(_0x2bf48f,_0x94730f){_0x94730f=_0x94730f||0xc8;return function(_0x549fbf){if(_0x549fbf){return _0x2bf48f[_0x8b59('0x30')](_0x94730f)[_0x8b59('0x32')](_0x549fbf);}};}function respondWithFilteredResult(_0x211bc7,_0x16f7bf){return function(_0x4a4d88){if(_0x4a4d88){var _0x23f175=typeof _0x16f7bf['offset']===_0x8b59('0x33')&&typeof _0x16f7bf[_0x8b59('0x34')]===_0x8b59('0x33');var _0x5cd87c=_0x4a4d88[_0x8b59('0x35')];var _0xfbb542=_0x23f175?0x0:_0x16f7bf[_0x8b59('0x36')];var _0x290f85=_0x23f175?_0x4a4d88['count']:_0x16f7bf[_0x8b59('0x36')]+_0x16f7bf[_0x8b59('0x34')];var _0x2bb12a;if(_0x290f85>=_0x5cd87c){_0x290f85=_0x5cd87c;_0x2bb12a=0xc8;}else{_0x2bb12a=0xce;}_0x211bc7[_0x8b59('0x30')](_0x2bb12a);return _0x211bc7[_0x8b59('0x37')]('Content-Range',_0xfbb542+'-'+_0x290f85+'/'+_0x5cd87c)[_0x8b59('0x32')](_0x4a4d88);}return null;};}function patchUpdates(_0x38e1f8){return function(_0x481700){try{jsonpatch[_0x8b59('0x38')](_0x481700,_0x38e1f8,!![]);}catch(_0x32c0a4){return BPromise['reject'](_0x32c0a4);}return _0x481700[_0x8b59('0x39')]();};}function saveUpdates(_0x1fd3e1,_0x5e019e){return function(_0x3bea9e){if(_0x3bea9e){return _0x3bea9e[_0x8b59('0x3a')](_0x1fd3e1)['then'](function(_0x215420){return _0x215420;});}return null;};}function removeEntity(_0x1ed92b,_0x1c7652){return function(_0x11a2f6){if(_0x11a2f6){return _0x11a2f6['destroy']()[_0x8b59('0x3b')](function(){_0x1ed92b[_0x8b59('0x30')](0xcc)[_0x8b59('0x31')]();});}};}function handleEntityNotFound(_0x595057,_0x38b7b8){return function(_0x51fbf1){if(!_0x51fbf1){_0x595057[_0x8b59('0x2f')](0x194);}return _0x51fbf1;};}function handleError(_0x37c772,_0x90f0b7){_0x90f0b7=_0x90f0b7||0x1f4;return function(_0x48d7f7){logger[_0x8b59('0x29')](_0x48d7f7['stack']);if(_0x48d7f7[_0x8b59('0x3c')]){delete _0x48d7f7[_0x8b59('0x3c')];}_0x37c772['status'](_0x90f0b7)[_0x8b59('0x3d')](_0x48d7f7);};}exports[_0x8b59('0x3e')]=function(_0x3fbbb0,_0x20662b){var _0x38cb38={},_0x385e6e={},_0x5c4e3a={'count':0x0,'rows':[]};var _0x5237e9=_[_0x8b59('0x3f')](db[_0x8b59('0x40')][_0x8b59('0x41')],function(_0xf42b1e){return{'name':_0xf42b1e[_0x8b59('0x42')],'type':_0xf42b1e[_0x8b59('0x43')][_0x8b59('0x44')]};});_0x385e6e[_0x8b59('0x45')]=_[_0x8b59('0x3f')](_0x5237e9,_0x8b59('0x3c'));_0x385e6e[_0x8b59('0x46')]=_['keys'](_0x3fbbb0['query']);_0x385e6e[_0x8b59('0x47')]=_[_0x8b59('0x48')](_0x385e6e[_0x8b59('0x45')],_0x385e6e[_0x8b59('0x46')]);_0x38cb38[_0x8b59('0x49')]=_['intersection'](_0x385e6e['model'],qs[_0x8b59('0x4a')](_0x3fbbb0[_0x8b59('0x46')]['fields']));_0x38cb38['attributes']=_0x38cb38[_0x8b59('0x49')]['length']?_0x38cb38['attributes']:_0x385e6e[_0x8b59('0x45')];if(!_0x3fbbb0['query'][_0x8b59('0x4b')]('nolimit')){_0x38cb38[_0x8b59('0x34')]=qs[_0x8b59('0x34')](_0x3fbbb0['query'][_0x8b59('0x34')]);_0x38cb38[_0x8b59('0x36')]=qs[_0x8b59('0x36')](_0x3fbbb0['query']['offset']);}_0x38cb38['order']=qs[_0x8b59('0x4c')](_0x3fbbb0[_0x8b59('0x46')][_0x8b59('0x4c')]);_0x38cb38[_0x8b59('0x4d')]=qs[_0x8b59('0x47')](_[_0x8b59('0x4e')](_0x3fbbb0[_0x8b59('0x46')],_0x385e6e['filters']),_0x5237e9);if(_0x3fbbb0[_0x8b59('0x46')][_0x8b59('0x4f')]){_0x38cb38[_0x8b59('0x4d')]=_[_0x8b59('0x50')](_0x38cb38[_0x8b59('0x4d')],{'$or':_[_0x8b59('0x3f')](_0x5237e9,function(_0x33b3c7){if(_0x33b3c7[_0x8b59('0x43')]!=='VIRTUAL'){var _0x1a71cb={};_0x1a71cb[_0x33b3c7[_0x8b59('0x3c')]]={'$like':'%'+_0x3fbbb0['query'][_0x8b59('0x4f')]+'%'};return _0x1a71cb;}})});}_0x38cb38=_[_0x8b59('0x50')]({},_0x38cb38,_0x3fbbb0[_0x8b59('0x51')]);var _0x5d634d={'where':_0x38cb38['where']};return db['ChatMessage']['count'](_0x5d634d)[_0x8b59('0x3b')](function(_0x492e18){_0x5c4e3a[_0x8b59('0x35')]=_0x492e18;if(_0x3fbbb0[_0x8b59('0x46')][_0x8b59('0x52')]){_0x38cb38[_0x8b59('0x53')]=[{'all':!![]}];}return db['ChatMessage'][_0x8b59('0x54')](_0x38cb38);})[_0x8b59('0x3b')](function(_0x5ac391){_0x5c4e3a[_0x8b59('0x55')]=_0x5ac391;return _0x5c4e3a;})[_0x8b59('0x3b')](respondWithFilteredResult(_0x20662b,_0x38cb38))[_0x8b59('0x2e')](handleError(_0x20662b,null));};exports[_0x8b59('0x56')]=function(_0x1fe64b,_0x3d04ec){var _0xc74b00={'raw':!![],'where':{'id':_0x1fe64b[_0x8b59('0x57')]['id']}},_0x201de7={};_0x201de7[_0x8b59('0x45')]=_[_0x8b59('0x58')](db['ChatMessage'][_0x8b59('0x41')]);_0x201de7['query']=_['keys'](_0x1fe64b[_0x8b59('0x46')]);_0x201de7[_0x8b59('0x47')]=_[_0x8b59('0x48')](_0x201de7[_0x8b59('0x45')],_0x201de7[_0x8b59('0x46')]);_0xc74b00[_0x8b59('0x49')]=_[_0x8b59('0x48')](_0x201de7[_0x8b59('0x45')],qs[_0x8b59('0x4a')](_0x1fe64b['query']['fields']));_0xc74b00[_0x8b59('0x49')]=_0xc74b00[_0x8b59('0x49')]['length']?_0xc74b00[_0x8b59('0x49')]:_0x201de7[_0x8b59('0x45')];if(_0x1fe64b['query'][_0x8b59('0x52')]){_0xc74b00[_0x8b59('0x53')]=[{'all':!![]}];}_0xc74b00=_['merge']({},_0xc74b00,_0x1fe64b['options']);return db[_0x8b59('0x40')][_0x8b59('0x59')](_0xc74b00)[_0x8b59('0x3b')](handleEntityNotFound(_0x3d04ec,null))['then'](respondWithResult(_0x3d04ec,null))['catch'](handleError(_0x3d04ec,null));};exports[_0x8b59('0x5a')]=function(_0x1a7074,_0x3b8513){return db[_0x8b59('0x40')]['create'](_0x1a7074[_0x8b59('0x5b')],{})[_0x8b59('0x3b')](respondWithResult(_0x3b8513,0xc9))[_0x8b59('0x2e')](handleError(_0x3b8513,null));};exports['update']=function(_0xfcff6e,_0x3533c2){if(_0xfcff6e[_0x8b59('0x5b')]['id']){delete _0xfcff6e[_0x8b59('0x5b')]['id'];}return db[_0x8b59('0x40')][_0x8b59('0x59')]({'where':{'id':_0xfcff6e[_0x8b59('0x57')]['id']}})[_0x8b59('0x3b')](handleEntityNotFound(_0x3533c2,null))[_0x8b59('0x3b')](saveUpdates(_0xfcff6e[_0x8b59('0x5b')],null))[_0x8b59('0x3b')](respondWithResult(_0x3533c2,null))['catch'](handleError(_0x3533c2,null));};exports['destroy']=function(_0x53c490,_0x543008){return db[_0x8b59('0x40')]['find']({'where':{'id':_0x53c490['params']['id']}})[_0x8b59('0x3b')](handleEntityNotFound(_0x543008,null))[_0x8b59('0x3b')](removeEntity(_0x543008,null))[_0x8b59('0x2e')](handleError(_0x543008,null));};exports[_0x8b59('0x5c')]=function(_0x3f6730,_0x5dc468){return db['ChatMessage'][_0x8b59('0x5c')]()[_0x8b59('0x3b')](respondWithResult(_0x5dc468,null))['catch'](handleError(_0x5dc468,null));};var interaction_log=require(_0x8b59('0x15'))(_0x8b59('0x5d'));exports['accept']=function(_0x3dc0a7,_0x4ebeba,_0x57304e){var _0x269a9c={'agent':{},'channel':_0x8b59('0x5e')};if(_0x3dc0a7[_0x8b59('0x5b')]['id']){delete _0x3dc0a7[_0x8b59('0x5b')]['id'];}_0x3dc0a7[_0x8b59('0x5b')][_0x8b59('0x5f')]=!![];_0x3dc0a7[_0x8b59('0x5b')][_0x8b59('0x60')]=moment()[_0x8b59('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x3dc0a7[_0x8b59('0x5b')][_0x8b59('0x62')]=_0x3dc0a7[_0x8b59('0x5b')][_0x8b59('0x62')]||_0x3dc0a7['user']['id'];_0x269a9c[_0x8b59('0x63')]['id']=_0x3dc0a7[_0x8b59('0x5b')][_0x8b59('0x62')];return db['ChatMessage'][_0x8b59('0x59')]({'where':{'id':_0x3dc0a7[_0x8b59('0x57')]['id'],'UserId':null}})[_0x8b59('0x3b')](handleEntityNotFound(_0x4ebeba,null))[_0x8b59('0x3b')](saveUpdates(_0x3dc0a7[_0x8b59('0x5b')],null))[_0x8b59('0x3b')](function(_0x586da6){if(_0x586da6){_0x269a9c[_0x8b59('0x2c')]=_0x586da6[_0x8b59('0x64')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x586da6[_0x8b59('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x4ebeba,null))[_0x8b59('0x3b')](function(_0x5f706b){if(_0x5f706b){return _0x5f706b['update']({'UserId':_0x3dc0a7['body'][_0x8b59('0x62')],'read1stAt':_[_0x8b59('0x66')](_0x5f706b['read1stAt'])?moment()[_0x8b59('0x61')](_0x8b59('0x67')):undefined});}return null;})[_0x8b59('0x3b')](function(_0x7651af){if(_0x7651af){_0x269a9c[_0x8b59('0x68')]=_0x7651af[_0x8b59('0x64')]({'plain':!![]});interaction_log[_0x8b59('0x24')](_0x8b59('0x69'),_0x3dc0a7[_0x8b59('0x6a')]['id'],_0x3dc0a7[_0x8b59('0x6a')][_0x8b59('0x3c')],_0x3dc0a7[_0x8b59('0x6a')]['role'],_0x269a9c[_0x8b59('0x68')]['id'],_0x3dc0a7[_0x8b59('0x5b')]?JSON[_0x8b59('0x28')](_0x3dc0a7[_0x8b59('0x5b')]):_0x8b59('0x6b'));return respondWithRpcPromise(_0x8b59('0x6c'),_0x8b59('0x6d'),_0x269a9c);}return null;})[_0x8b59('0x3b')](function(_0x41ba75){var _0x34df3f=_0x8b59('0x6e')+_0x41ba75[_0x8b59('0x2c')][_0x8b59('0x6f')];return db['sequelize']['query'](_0x34df3f,{'type':db[_0x8b59('0x70')][_0x8b59('0x71')][_0x8b59('0x72')],'raw':!![]})[_0x8b59('0x3b')](function(_0x3dda1b){return _0x3dda1b;});})[_0x8b59('0x3b')](function(_0x18cd0f){if(_0x18cd0f){_0x269a9c['message']['contact']=_0x18cd0f[0x0];if(!_0x3dc0a7[_0x8b59('0x5b')][_0x8b59('0x62')])return;return db[_0x8b59('0x73')][_0x8b59('0x59')]({'where':{'id':_0x3dc0a7[_0x8b59('0x5b')][_0x8b59('0x62')],'role':_0x8b59('0x63')},'attributes':['id',_0x8b59('0x3c'),_0x8b59('0x74'),_0x8b59('0x75'),_0x8b59('0x76')],'raw':!![]});}return null;})[_0x8b59('0x3b')](function(_0x23df88){if(!_0x23df88)return null;_0x269a9c['message'][_0x8b59('0x63')]=_0x23df88;return _0x269a9c;})[_0x8b59('0x3b')](function(_0x5571b3){if(_0x5571b3){if(_0x3dc0a7[_0x8b59('0x5b')][_0x8b59('0x77')]){_0x269a9c[_0x8b59('0x2c')][_0x8b59('0x78')]=util[_0x8b59('0x61')]('SIP/%s',_0x3dc0a7['user'][_0x8b59('0x3c')]);_0x269a9c[_0x8b59('0x2c')][_0x8b59('0x79')]=_0x269a9c[_0x8b59('0x79')];_0x269a9c['message']['motionChannel']=_0x269a9c['channel'];_0x269a9c[_0x8b59('0x2c')][_0x8b59('0x7a')]=_0x8b59('0x7b');return respondWithRpcPromise(_0x8b59('0x7c'),_0x8b59('0x7c'),{'event':_0x8b59('0x7d'),'message':_['merge'](_0x269a9c[_0x8b59('0x2c')],JSON[_0x8b59('0x7e')](_0x269a9c[_0x8b59('0x68')][_0x8b59('0x7f')]))},client9002)[_0x8b59('0x3b')](function(){return _0x269a9c;});}return _0x269a9c;}return null;})[_0x8b59('0x3b')](respondWithResult(_0x4ebeba,null))[_0x8b59('0x2e')](handleError(_0x4ebeba,null));};var interaction_log=require(_0x8b59('0x15'))(_0x8b59('0x5d'));exports['reject']=function(_0x34a3c2,_0x8f76fd,_0x1eff05){var _0x56d0da={'agent':{},'channel':_0x8b59('0x5e')};if(_0x34a3c2['body']['id']){delete _0x34a3c2[_0x8b59('0x5b')]['id'];}_0x34a3c2['body'][_0x8b59('0x62')]=_0x34a3c2[_0x8b59('0x5b')][_0x8b59('0x62')]||_0x34a3c2[_0x8b59('0x6a')]['id'];_0x56d0da[_0x8b59('0x63')]['id']=_0x34a3c2[_0x8b59('0x5b')][_0x8b59('0x62')];return db[_0x8b59('0x40')][_0x8b59('0x59')]({'where':{'id':_0x34a3c2['params']['id'],'UserId':null}})[_0x8b59('0x3b')](handleEntityNotFound(_0x8f76fd,null))['then'](function(_0x193c31){if(_0x193c31){_0x56d0da['message']=_0x193c31['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x193c31[_0x8b59('0x65')]}});}return null;})[_0x8b59('0x3b')](handleEntityNotFound(_0x8f76fd,null))[_0x8b59('0x3b')](function(_0x317c5a){if(_0x317c5a){_0x56d0da[_0x8b59('0x68')]=_0x317c5a['get']({'plain':!![]});interaction_log['info'](_0x8b59('0x80'),_0x34a3c2[_0x8b59('0x6a')]['id'],_0x34a3c2[_0x8b59('0x6a')][_0x8b59('0x3c')],_0x34a3c2[_0x8b59('0x6a')]['role'],_0x56d0da[_0x8b59('0x68')]['id'],_0x34a3c2[_0x8b59('0x5b')]?JSON[_0x8b59('0x28')](_0x34a3c2[_0x8b59('0x5b')]):_0x8b59('0x6b'));return respondWithRpcPromise(_0x8b59('0x81'),_0x8b59('0x82'),_0x56d0da);}return null;})[_0x8b59('0x3b')](function(_0x25af11){var _0x329eb3=_0x8b59('0x6e')+_0x25af11[_0x8b59('0x2c')][_0x8b59('0x6f')];return db['sequelize'][_0x8b59('0x46')](_0x329eb3,{'type':db[_0x8b59('0x70')][_0x8b59('0x71')][_0x8b59('0x72')],'raw':!![]})['then'](function(_0x574924){return _0x574924;});})[_0x8b59('0x3b')](function(_0x555a45){if(_0x555a45){_0x56d0da[_0x8b59('0x2c')][_0x8b59('0x83')]=_0x555a45[0x0];if(!_0x34a3c2[_0x8b59('0x5b')][_0x8b59('0x62')])return;return db['User'][_0x8b59('0x59')]({'where':{'id':_0x34a3c2[_0x8b59('0x5b')][_0x8b59('0x62')],'role':_0x8b59('0x63')},'attributes':['id','name',_0x8b59('0x74'),'email','internal'],'raw':!![]});}return null;})[_0x8b59('0x3b')](function(_0x48dd24){if(!_0x48dd24)return null;_0x56d0da[_0x8b59('0x2c')][_0x8b59('0x63')]=_0x48dd24;return _0x56d0da;})[_0x8b59('0x3b')](function(_0x5480a0){if(_0x5480a0){_0x5480a0[_0x8b59('0x2c')]['interface']=util[_0x8b59('0x61')](_0x8b59('0x84'),_0x34a3c2['user']['name']);_0x5480a0['message'][_0x8b59('0x79')]=_0x56d0da[_0x8b59('0x79')];_0x5480a0['message'][_0x8b59('0x85')]=_0x56d0da[_0x8b59('0x79')];_0x5480a0[_0x8b59('0x2c')]['event']=_0x8b59('0x86');respondWithRpcPromise(_0x8b59('0x7c'),'EventManager',{'event':_0x8b59('0x87'),'message':_['merge'](_0x56d0da[_0x8b59('0x2c')],JSON[_0x8b59('0x7e')](_0x56d0da[_0x8b59('0x68')][_0x8b59('0x7f')]))},client9002);return _0x56d0da;}return null;})[_0x8b59('0x3b')](respondWithResult(_0x8f76fd,null))[_0x8b59('0x2e')](handleError(_0x8f76fd,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 340752b..d6351d7 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 _0x0401=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x200a91,_0x29e8c7){var _0x20cb86=function(_0x49a01a){while(--_0x49a01a){_0x200a91['push'](_0x200a91['shift']());}};_0x20cb86(++_0x29e8c7);}(_0x0401,0x15f));var _0x1040=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x0401[_0x263a74];return _0x2aa86c;};'use strict';var EventEmitter=require(_0x1040('0x0'));var ChatMessage=require(_0x1040('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1040('0x2')](0x0);var events={'afterCreate':_0x1040('0x3'),'afterUpdate':'update','afterDestroy':_0x1040('0x4')};function emitEvent(_0x158177){return function(_0x44ab0f,_0x28fbf2,_0x2d71f7){ChatMessageEvents[_0x1040('0x5')](_0x158177+':'+_0x44ab0f['id'],_0x44ab0f);ChatMessageEvents[_0x1040('0x5')](_0x158177,_0x44ab0f);_0x2d71f7(null);};}for(var e in events){if(events[_0x1040('0x6')](e)){var event=events[e];ChatMessage[_0x1040('0x7')](e,emitEvent(event));}}module[_0x1040('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x26e2=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x507c81,_0x3e1b56){var _0x368a25=function(_0x1e7519){while(--_0x1e7519){_0x507c81['push'](_0x507c81['shift']());}};_0x368a25(++_0x3e1b56);}(_0x26e2,0xe5));var _0x226e=function(_0x31cd5a,_0x453c74){_0x31cd5a=_0x31cd5a-0x0;var _0x354584=_0x26e2[_0x31cd5a];return _0x354584;};'use strict';var EventEmitter=require(_0x226e('0x0'));var ChatMessage=require(_0x226e('0x1'))['db'][_0x226e('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x226e('0x3')](0x0);var events={'afterCreate':_0x226e('0x4'),'afterUpdate':_0x226e('0x5'),'afterDestroy':_0x226e('0x6')};function emitEvent(_0x52387c){return function(_0x142e6c,_0xa46b28,_0x627b7b){ChatMessageEvents[_0x226e('0x7')](_0x52387c+':'+_0x142e6c['id'],_0x142e6c);ChatMessageEvents[_0x226e('0x7')](_0x52387c,_0x142e6c);_0x627b7b(null);};}for(var e in events){if(events[_0x226e('0x8')](e)){var event=events[e];ChatMessage[_0x226e('0x9')](e,emitEvent(event));}}module[_0x226e('0xa')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 17129f6..20a1b1e 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 _0x7003=['request-promise','path','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4_unicode_ci','api','moment','bluebird'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x7003,0x1ad));var _0x3700=function(_0x59b2a1,_0x1f631f){_0x59b2a1=_0x59b2a1-0x0;var _0x4908d1=_0x7003[_0x59b2a1];return _0x4908d1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3700('0x0'));var moment=require(_0x3700('0x1'));var BPromise=require(_0x3700('0x2'));var rp=require(_0x3700('0x3'));var fs=require('fs');var path=require(_0x3700('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0x3700('0x5')]=function(_0x39aa10,_0x4acb64){return _0x39aa10[_0x3700('0x6')](_0x3700('0x7'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x3700('0x8'),'fields':[_0x3700('0x9')],'type':_0x3700('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x6add31,_0xf7e17f,_0x44f6e6){var _0x1da79a=_0x39aa10[_0x3700('0xb')];var _0x352131=_0x6add31[_0x3700('0xc')]({'plain':!![]});if(_0x352131[_0x3700('0xd')][_0x3700('0xe')]()==='in'||_0x352131[_0x3700('0xd')][_0x3700('0xe')]()===_0x3700('0xf')&&!_0x352131[_0x3700('0x10')]&&!_[_0x3700('0x11')](_0x352131[_0x3700('0x12')])){_0x1da79a[_0x3700('0x13')][_0x3700('0x14')]({'where':{'id':_0x352131[_0x3700('0x15')]}})[_0x3700('0x16')](function(_0x293c1d){if(_0x293c1d){_0x293c1d[_0x3700('0x17')]({'lastMsgAt':_0x352131[_0x3700('0x18')],'lastMsgDirection':_0x352131[_0x3700('0xd')][_0x3700('0xe')]()});}})[_0x3700('0x19')](function(_0x1a5a5f){console['error'](_0x1a5a5f);});}_0x44f6e6();}},'charset':'utf8mb4','collate':_0x3700('0x1a')});}; \ No newline at end of file +var _0x057f=['moment','request-promise','path','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','util','../../config/logger'];(function(_0x31b5cd,_0x196e6a){var _0x242d1e=function(_0x30d929){while(--_0x30d929){_0x31b5cd['push'](_0x31b5cd['shift']());}};_0x242d1e(++_0x196e6a);}(_0x057f,0x85));var _0xf057=function(_0x405461,_0x17d34b){_0x405461=_0x405461-0x0;var _0x116438=_0x057f[_0x405461];return _0x116438;};'use strict';var _=require('lodash');var util=require(_0xf057('0x0'));var logger=require(_0xf057('0x1'))('api');var moment=require(_0xf057('0x2'));var BPromise=require('bluebird');var rp=require(_0xf057('0x3'));var fs=require('fs');var path=require(_0xf057('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf057('0x5'));module['exports']=function(_0x4f8620,_0x36cf9c){return _0x4f8620[_0xf057('0x6')](_0xf057('0x7'),attributes,{'tableName':_0xf057('0x8'),'paranoid':![],'indexes':[{'name':_0xf057('0x9'),'fields':[_0xf057('0xa')],'type':_0xf057('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x354a8d,_0x2d97e6,_0x2300ed){var _0x57aed1=_0x4f8620[_0xf057('0xc')];var _0x1cfe39=_0x354a8d[_0xf057('0xd')]({'plain':!![]});if(_0x1cfe39[_0xf057('0xe')][_0xf057('0xf')]()==='in'||_0x1cfe39[_0xf057('0xe')][_0xf057('0xf')]()===_0xf057('0x10')&&!_0x1cfe39[_0xf057('0x11')]&&!_[_0xf057('0x12')](_0x1cfe39['UserId'])){_0x57aed1[_0xf057('0x13')][_0xf057('0x14')]({'where':{'id':_0x1cfe39[_0xf057('0x15')]}})[_0xf057('0x16')](function(_0x149e73){if(_0x149e73){_0x149e73['update']({'lastMsgAt':_0x1cfe39[_0xf057('0x17')],'lastMsgDirection':_0x1cfe39[_0xf057('0xe')]['toLowerCase']()});}})[_0xf057('0x18')](function(_0xa183de){console[_0xf057('0x19')](_0xa183de);});}_0x2300ed();}},'charset':_0xf057('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 94d1d03..1e1230f 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 _0xdfbe=['stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','debug'];(function(_0x2c9868,_0x585fed){var _0x434eed=function(_0x487dd5){while(--_0x487dd5){_0x2c9868['push'](_0x2c9868['shift']());}};_0x434eed(++_0x585fed);}(_0xdfbe,0xb0));var _0xedfb=function(_0x28153b,_0x339a99){_0x28153b=_0x28153b-0x0;var _0x46a630=_0xdfbe[_0x28153b];return _0x46a630;};'use strict';var _=require(_0xedfb('0x0'));var util=require(_0xedfb('0x1'));var moment=require(_0xedfb('0x2'));var BPromise=require(_0xedfb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xedfb('0x4'));var db=require(_0xedfb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xedfb('0x6'))(_0xedfb('0x7'));var config=require(_0xedfb('0x8'));var jayson=require(_0xedfb('0x9'));var client=jayson['client'][_0xedfb('0xa')]({'port':0x232a});config['redis']=_[_0xedfb('0xb')](config[_0xedfb('0xc')],{'host':_0xedfb('0xd'),'port':0x18eb});var socket=require(_0xedfb('0xe'))(new Redis(config['redis']));require(_0xedfb('0xf'))[_0xedfb('0x10')](socket);function respondWithRpcPromise(_0x3173e3,_0x5de11a,_0x351323){return new BPromise(function(_0x25553a,_0x47d1f7){return client[_0xedfb('0x11')](_0x3173e3,_0x351323)['then'](function(_0x2be0a3){logger['info'](_0xedfb('0x12'),_0x5de11a,_0xedfb('0x13'));logger['debug'](_0xedfb('0x14'),_0x5de11a,_0xedfb('0x13'),JSON['stringify'](_0x2be0a3));if(_0x2be0a3[_0xedfb('0x15')]){if(_0x2be0a3[_0xedfb('0x15')][_0xedfb('0x16')]===0x1f4){logger[_0xedfb('0x15')](_0xedfb('0x12'),_0x5de11a,_0x2be0a3[_0xedfb('0x15')][_0xedfb('0x17')]);return _0x47d1f7(_0x2be0a3[_0xedfb('0x15')][_0xedfb('0x17')]);}logger[_0xedfb('0x15')]('ChatMessage,\x20%s,\x20%s',_0x5de11a,_0x2be0a3[_0xedfb('0x15')][_0xedfb('0x17')]);return _0x25553a(_0x2be0a3['error'][_0xedfb('0x17')]);}else{logger[_0xedfb('0x18')]('ChatMessage,\x20%s,\x20%s',_0x5de11a,_0xedfb('0x13'));_0x25553a(_0x2be0a3[_0xedfb('0x19')][_0xedfb('0x17')]);}})[_0xedfb('0x1a')](function(_0x46c123){logger[_0xedfb('0x15')]('ChatMessage,\x20%s,\x20%s',_0x5de11a,_0x46c123);_0x47d1f7(_0x46c123);});});}exports['CreateChatMessage']=function(_0x3f40df){var _0x5080e3=this;return new Promise(function(_0xaee951,_0x1ee091){return db[_0xedfb('0x1b')][_0xedfb('0x1c')](_0x3f40df[_0xedfb('0x1d')],{'raw':_0x3f40df['options']?_0x3f40df[_0xedfb('0x1e')][_0xedfb('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x3e2a84){logger[_0xedfb('0x18')](_0xedfb('0x20'),_0x3f40df);logger[_0xedfb('0x21')](_0xedfb('0x20'),_0x3f40df,JSON[_0xedfb('0x22')](_0x3e2a84));_0xaee951(_0x3e2a84);})[_0xedfb('0x1a')](function(_0x58cc36){logger[_0xedfb('0x15')](_0xedfb('0x20'),_0x58cc36['message'],_0x3f40df);_0x1ee091(_0x5080e3['error'](0x1f4,_0x58cc36[_0xedfb('0x17')]));});});}; \ No newline at end of file +var _0x238f=['ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','ChatMessage','body','options','raw','CreateChatMessage','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x238f,0xad));var _0xf238=function(_0x580d0e,_0x108e68){_0x580d0e=_0x580d0e-0x0;var _0x18ac4b=_0x238f[_0x580d0e];return _0x18ac4b;};'use strict';var _=require('lodash');var util=require(_0xf238('0x0'));var moment=require(_0xf238('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf238('0x2'));var db=require(_0xf238('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf238('0x4'))(_0xf238('0x5'));var config=require(_0xf238('0x6'));var jayson=require(_0xf238('0x7'));var client=jayson[_0xf238('0x8')][_0xf238('0x9')]({'port':0x232a});config[_0xf238('0xa')]=_[_0xf238('0xb')](config[_0xf238('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf238('0xc'))(new Redis(config[_0xf238('0xa')]));require('./chatMessage.socket')[_0xf238('0xd')](socket);function respondWithRpcPromise(_0x57b078,_0x1ff7c8,_0x1db8a9){return new BPromise(function(_0x33a1b6,_0x4e1c21){return client[_0xf238('0xe')](_0x57b078,_0x1db8a9)[_0xf238('0xf')](function(_0x21092d){logger[_0xf238('0x10')](_0xf238('0x11'),_0x1ff7c8,'request\x20sent');logger[_0xf238('0x12')](_0xf238('0x13'),_0x1ff7c8,'request\x20sent',JSON[_0xf238('0x14')](_0x21092d));if(_0x21092d[_0xf238('0x15')]){if(_0x21092d[_0xf238('0x15')][_0xf238('0x16')]===0x1f4){logger['error'](_0xf238('0x11'),_0x1ff7c8,_0x21092d[_0xf238('0x15')]['message']);return _0x4e1c21(_0x21092d[_0xf238('0x15')][_0xf238('0x17')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x1ff7c8,_0x21092d['error'][_0xf238('0x17')]);return _0x33a1b6(_0x21092d[_0xf238('0x15')][_0xf238('0x17')]);}else{logger[_0xf238('0x10')](_0xf238('0x11'),_0x1ff7c8,_0xf238('0x18'));_0x33a1b6(_0x21092d[_0xf238('0x19')][_0xf238('0x17')]);}})[_0xf238('0x1a')](function(_0x5413ed){logger[_0xf238('0x15')](_0xf238('0x11'),_0x1ff7c8,_0x5413ed);_0x4e1c21(_0x5413ed);});});}exports['CreateChatMessage']=function(_0x1020e8){var _0x52a48b=this;return new Promise(function(_0x27a7c9,_0x224992){return db[_0xf238('0x1b')]['create'](_0x1020e8[_0xf238('0x1c')],{'raw':_0x1020e8[_0xf238('0x1d')]?_0x1020e8[_0xf238('0x1d')][_0xf238('0x1e')]===undefined?!![]:![]:!![]})[_0xf238('0xf')](function(_0x64476e){logger[_0xf238('0x10')](_0xf238('0x1f'),_0x1020e8);logger[_0xf238('0x12')](_0xf238('0x1f'),_0x1020e8,JSON[_0xf238('0x14')](_0x64476e));_0x27a7c9(_0x64476e);})[_0xf238('0x1a')](function(_0x68a9bf){logger[_0xf238('0x15')](_0xf238('0x1f'),_0x68a9bf[_0xf238('0x17')],_0x1020e8);_0x224992(_0x52a48b[_0xf238('0x15')](0x1f4,_0x68a9bf[_0xf238('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 26139b3..58a523a 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 _0x06f4=['register','chatMessage:','./chatMessage.events','save','update','emit','removeListener'];(function(_0x5919f2,_0x50d598){var _0x43ca2c=function(_0x5c3a90){while(--_0x5c3a90){_0x5919f2['push'](_0x5919f2['shift']());}};_0x43ca2c(++_0x50d598);}(_0x06f4,0x136));var _0x406f=function(_0x20fc55,_0x2ce9c6){_0x20fc55=_0x20fc55-0x0;var _0x3af523=_0x06f4[_0x20fc55];return _0x3af523;};'use strict';var ChatMessageEvents=require(_0x406f('0x0'));var events=[_0x406f('0x1'),'remove',_0x406f('0x2')];function createListener(_0x276a15,_0x58cd7d){return function(_0x5cab5e){_0x58cd7d[_0x406f('0x3')](_0x276a15,_0x5cab5e);};}function removeListener(_0x5ed32f,_0x32abfd){return function(){ChatMessageEvents[_0x406f('0x4')](_0x5ed32f,_0x32abfd);};}exports[_0x406f('0x5')]=function(_0x32b2bd){for(var _0x59821c=0x0,_0x1d2886=events['length'];_0x59821c<_0x1d2886;_0x59821c++){var _0x1afec4=events[_0x59821c];var _0x1c39ce=createListener(_0x406f('0x6')+_0x1afec4,_0x32b2bd);ChatMessageEvents['on'](_0x1afec4,_0x1c39ce);}}; \ No newline at end of file +var _0x448b=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x33beba,_0x39ceff){var _0x35ab5a=function(_0x4e1fcb){while(--_0x4e1fcb){_0x33beba['push'](_0x33beba['shift']());}};_0x35ab5a(++_0x39ceff);}(_0x448b,0x125));var _0xb448=function(_0x9a9f76,_0x33ed7f){_0x9a9f76=_0x9a9f76-0x0;var _0x1fb5b2=_0x448b[_0x9a9f76];return _0x1fb5b2;};'use strict';var ChatMessageEvents=require(_0xb448('0x0'));var events=[_0xb448('0x1'),_0xb448('0x2'),_0xb448('0x3')];function createListener(_0x422fa2,_0x51583a){return function(_0x5bf7db){_0x51583a[_0xb448('0x4')](_0x422fa2,_0x5bf7db);};}function removeListener(_0x32bcae,_0x172a89){return function(){ChatMessageEvents[_0xb448('0x5')](_0x32bcae,_0x172a89);};}exports[_0xb448('0x6')]=function(_0x276466){for(var _0x3670cb=0x0,_0x5993ad=events[_0xb448('0x7')];_0x3670cb<_0x5993ad;_0x3670cb++){var _0x2f6f82=events[_0x3670cb];var _0x2c2bdd=createListener(_0xb448('0x8')+_0x2f6f82,_0x276466);ChatMessageEvents['on'](_0x2f6f82,_0x2c2bdd);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index d74f729..ec4e384 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 _0xc539=['../../config/environment','isAuthenticated','index','/describe','/:id','post','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2ad131,_0x19dbdc){var _0x5415ae=function(_0x8b33fc){while(--_0x8b33fc){_0x2ad131['push'](_0x2ad131['shift']());}};_0x5415ae(++_0x19dbdc);}(_0xc539,0x119));var _0x9c53=function(_0x5c1960,_0x46ff03){_0x5c1960=_0x5c1960-0x0;var _0x5f55eb=_0xc539[_0x5c1960];return _0x5f55eb;};'use strict';var multer=require(_0x9c53('0x0'));var util=require(_0x9c53('0x1'));var path=require(_0x9c53('0x2'));var timeout=require('connect-timeout');var express=require(_0x9c53('0x3'));var router=express['Router']();var fs_extra=require(_0x9c53('0x4'));var auth=require(_0x9c53('0x5'));var interaction=require(_0x9c53('0x6'));var config=require(_0x9c53('0x7'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0x9c53('0x8')](),controller[_0x9c53('0x9')]);router['get'](_0x9c53('0xa'),auth[_0x9c53('0x8')](),controller['describe']);router['get'](_0x9c53('0xb'),auth[_0x9c53('0x8')](),controller['show']);router[_0x9c53('0xc')]('/',auth[_0x9c53('0x8')](),interaction['tracked']('chat',_0x9c53('0xd')),controller[_0x9c53('0xe')]);router[_0x9c53('0xf')]('/:id',controller[_0x9c53('0x10')]);router[_0x9c53('0xf')](_0x9c53('0x11'),auth[_0x9c53('0x8')](),controller[_0x9c53('0x12')]);router['put'](_0x9c53('0x13'),auth[_0x9c53('0x8')](),controller[_0x9c53('0x14')]);router[_0x9c53('0x15')](_0x9c53('0xb'),auth[_0x9c53('0x8')](),controller[_0x9c53('0x16')]);module[_0x9c53('0x17')]=router; \ No newline at end of file +var _0x0278=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','/describe','describe','show','post','tracked','chatmessage:create','put','/:id','accept','/:id/reject','delete','exports','multer'];(function(_0x120c37,_0x183682){var _0x19dd4b=function(_0x2a3905){while(--_0x2a3905){_0x120c37['push'](_0x120c37['shift']());}};_0x19dd4b(++_0x183682);}(_0x0278,0x110));var _0x8027=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x0278[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0x8027('0x0'));var util=require('util');var path=require(_0x8027('0x1'));var timeout=require(_0x8027('0x2'));var express=require('express');var router=express[_0x8027('0x3')]();var fs_extra=require(_0x8027('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8027('0x5'));var config=require('../../config/environment');var controller=require(_0x8027('0x6'));router[_0x8027('0x7')]('/',auth[_0x8027('0x8')](),controller['index']);router['get'](_0x8027('0x9'),auth[_0x8027('0x8')](),controller[_0x8027('0xa')]);router['get']('/:id',auth[_0x8027('0x8')](),controller[_0x8027('0xb')]);router[_0x8027('0xc')]('/',auth['isAuthenticated'](),interaction[_0x8027('0xd')]('chat',_0x8027('0xe')),controller['create']);router[_0x8027('0xf')](_0x8027('0x10'),controller['update']);router[_0x8027('0xf')]('/:id/accept',auth[_0x8027('0x8')](),controller[_0x8027('0x11')]);router['put'](_0x8027('0x12'),auth[_0x8027('0x8')](),controller['reject']);router[_0x8027('0x13')](_0x8027('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x8027('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 6d0de69..ea5dc7d 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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0b0e,0x187));var _0xe0b0=function(_0x11fc8b,_0x4ee51d){_0x11fc8b=_0x11fc8b-0x0;var _0x4ea86e=_0x0b0e[_0x11fc8b];return _0x4ea86e;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x59b48b,_0x584733){_0x59b48b=_0x59b48b-0x0;var _0x4c3f79=_0x0b0e[_0x59b48b];return _0x4c3f79;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('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 b1fd1c4..b40f1d1 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(_0x120ad2,_0xfac60a){var _0x102ee1=function(_0x190bde){while(--_0x190bde){_0x120ad2['push'](_0x120ad2['shift']());}};_0x102ee1(++_0xfac60a);}(_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){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 _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(_0x527c5e,_0x36da9e){var _0x1ac69d=function(_0x23b137){while(--_0x23b137){_0x527c5e['push'](_0x527c5e['shift']());}};_0x1ac69d(++_0x36da9e);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 7e20abd..05ca2ff 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 _0x8adb=['save','update','remove','emit','hook','events','../../mysqldb','setMaxListeners'];(function(_0x3636e5,_0x2f714b){var _0x18205f=function(_0x10d3bf){while(--_0x10d3bf){_0x3636e5['push'](_0x3636e5['shift']());}};_0x18205f(++_0x2f714b);}(_0x8adb,0x105));var _0xb8ad=function(_0x1ad19e,_0x39940f){_0x1ad19e=_0x1ad19e-0x0;var _0xdaa322=_0x8adb[_0x1ad19e];return _0xdaa322;};'use strict';var EventEmitter=require(_0xb8ad('0x0'));var ChatOfflineMessage=require(_0xb8ad('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xb8ad('0x2')](0x0);var events={'afterCreate':_0xb8ad('0x3'),'afterUpdate':_0xb8ad('0x4'),'afterDestroy':_0xb8ad('0x5')};function emitEvent(_0x4d67e7){return function(_0x1e8101,_0x661777,_0x562034){ChatOfflineMessageEvents['emit'](_0x4d67e7+':'+_0x1e8101['id'],_0x1e8101);ChatOfflineMessageEvents[_0xb8ad('0x6')](_0x4d67e7,_0x1e8101);_0x562034(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xb8ad('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0x1509=['ChatOfflineMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1509,0x15c));var _0x9150=function(_0x1b3812,_0x4f9418){_0x1b3812=_0x1b3812-0x0;var _0x450c01=_0x1509[_0x1b3812];return _0x450c01;};'use strict';var EventEmitter=require(_0x9150('0x0'));var ChatOfflineMessage=require(_0x9150('0x1'))['db'][_0x9150('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9150('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9150('0x4'),'afterDestroy':_0x9150('0x5')};function emitEvent(_0x601dd5){return function(_0x13d2ec,_0x39c42d,_0x3d1a63){ChatOfflineMessageEvents['emit'](_0x601dd5+':'+_0x13d2ec['id'],_0x13d2ec);ChatOfflineMessageEvents[_0x9150('0x6')](_0x601dd5,_0x13d2ec);_0x3d1a63(null);};}for(var e in events){if(events[_0x9150('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x9150('0x8')](e,emitEvent(event));}}module[_0x9150('0x9')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 9374aa6..591d358 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 _0x01e7=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x4da80b,_0x210718){var _0x2e561a=function(_0x4458d9){while(--_0x4458d9){_0x4da80b['push'](_0x4da80b['shift']());}};_0x2e561a(++_0x210718);}(_0x01e7,0x6f));var _0x701e=function(_0x4a7586,_0x49cf38){_0x4a7586=_0x4a7586-0x0;var _0x3262cf=_0x01e7[_0x4a7586];return _0x3262cf;};'use strict';var attributes=require(_0x701e('0x0'));module[_0x701e('0x1')]=function(_0x496698){return _0x496698[_0x701e('0x2')](_0x701e('0x3'),attributes,{'tableName':_0x701e('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x701e('0x5'),'collate':_0x701e('0x6')});}; \ No newline at end of file +var _0xdc1e=['chat_offline_messages','utf8mb4','exports','define'];(function(_0xb875ee,_0x583042){var _0x4c7f3a=function(_0x1f6661){while(--_0x1f6661){_0xb875ee['push'](_0xb875ee['shift']());}};_0x4c7f3a(++_0x583042);}(_0xdc1e,0xa6));var _0xedc1=function(_0x571e79,_0x58e770){_0x571e79=_0x571e79-0x0;var _0x36b13b=_0xdc1e[_0x571e79];return _0x36b13b;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xedc1('0x0')]=function(_0x25f89d){return _0x25f89d[_0xedc1('0x1')]('ChatOfflineMessage',attributes,{'tableName':_0xedc1('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xedc1('0x3'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 978e376..bc278cb 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 _0x9b08=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug'];(function(_0x54b69a,_0x5bba3b){var _0x544b6a=function(_0x126afc){while(--_0x126afc){_0x54b69a['push'](_0x54b69a['shift']());}};_0x544b6a(++_0x5bba3b);}(_0x9b08,0x1ea));var _0x89b0=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x9b08[_0x3ea913];return _0x2b4f28;};'use strict';var _=require(_0x89b0('0x0'));var util=require(_0x89b0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x89b0('0x2'));var fs=require('fs');var Redis=require(_0x89b0('0x3'));var db=require(_0x89b0('0x4'))['db'];var utils=require(_0x89b0('0x5'));var logger=require(_0x89b0('0x6'))(_0x89b0('0x7'));var config=require(_0x89b0('0x8'));var jayson=require(_0x89b0('0x9'));var client=jayson['client'][_0x89b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c4816,_0xb4c04c,_0x446d26){return new BPromise(function(_0x50ec21,_0x45d9a0){return client[_0x89b0('0xb')](_0x2c4816,_0x446d26)[_0x89b0('0xc')](function(_0x915f22){logger[_0x89b0('0xd')](_0x89b0('0xe'),_0xb4c04c,'request\x20sent');logger[_0x89b0('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0xb4c04c,_0x89b0('0x10'),JSON[_0x89b0('0x11')](_0x915f22));if(_0x915f22[_0x89b0('0x12')]){if(_0x915f22[_0x89b0('0x12')][_0x89b0('0x13')]===0x1f4){logger[_0x89b0('0x12')](_0x89b0('0xe'),_0xb4c04c,_0x915f22[_0x89b0('0x12')][_0x89b0('0x14')]);return _0x45d9a0(_0x915f22[_0x89b0('0x12')][_0x89b0('0x14')]);}logger[_0x89b0('0x12')](_0x89b0('0xe'),_0xb4c04c,_0x915f22[_0x89b0('0x12')][_0x89b0('0x14')]);return _0x50ec21(_0x915f22[_0x89b0('0x12')][_0x89b0('0x14')]);}else{logger[_0x89b0('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0xb4c04c,_0x89b0('0x10'));_0x50ec21(_0x915f22[_0x89b0('0x15')][_0x89b0('0x14')]);}})[_0x89b0('0x16')](function(_0x47d52e){logger[_0x89b0('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0xb4c04c,_0x47d52e);_0x45d9a0(_0x47d52e);});});} \ No newline at end of file +var _0x76e4=['message','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x20ae15,_0x1828f5){var _0xc19495=function(_0x4d102a){while(--_0x4d102a){_0x20ae15['push'](_0x20ae15['shift']());}};_0xc19495(++_0x1828f5);}(_0x76e4,0x12d));var _0x476e=function(_0x70381f,_0x3ce152){_0x70381f=_0x70381f-0x0;var _0xc650ea=_0x76e4[_0x70381f];return _0xc650ea;};'use strict';var _=require(_0x476e('0x0'));var util=require('util');var moment=require(_0x476e('0x1'));var BPromise=require(_0x476e('0x2'));var rs=require(_0x476e('0x3'));var fs=require('fs');var Redis=require(_0x476e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x476e('0x5'));var logger=require(_0x476e('0x6'))('rpc');var config=require(_0x476e('0x7'));var jayson=require(_0x476e('0x8'));var client=jayson[_0x476e('0x9')][_0x476e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe6a8bc,_0x182cfc,_0x2a0f81){return new BPromise(function(_0x3f26eb,_0x18f94c){return client[_0x476e('0xb')](_0xe6a8bc,_0x2a0f81)[_0x476e('0xc')](function(_0x31e8e5){logger[_0x476e('0xd')](_0x476e('0xe'),_0x182cfc,_0x476e('0xf'));logger['debug'](_0x476e('0x10'),_0x182cfc,_0x476e('0xf'),JSON['stringify'](_0x31e8e5));if(_0x31e8e5['error']){if(_0x31e8e5[_0x476e('0x11')][_0x476e('0x12')]===0x1f4){logger[_0x476e('0x11')](_0x476e('0xe'),_0x182cfc,_0x31e8e5[_0x476e('0x11')][_0x476e('0x13')]);return _0x18f94c(_0x31e8e5[_0x476e('0x11')][_0x476e('0x13')]);}logger[_0x476e('0x11')](_0x476e('0xe'),_0x182cfc,_0x31e8e5['error'][_0x476e('0x13')]);return _0x3f26eb(_0x31e8e5[_0x476e('0x11')]['message']);}else{logger['info'](_0x476e('0xe'),_0x182cfc,_0x476e('0xf'));_0x3f26eb(_0x31e8e5['result'][_0x476e('0x13')]);}})['catch'](function(_0x2e8237){logger['error'](_0x476e('0xe'),_0x182cfc,_0x2e8237);_0x18f94c(_0x2e8237);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index b7c19cf..abb6b78 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 _0x77df=['delete','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','/describe','describe','get','/:id','show','create','put','update'];(function(_0x154eb2,_0x24adc1){var _0x3e92cd=function(_0x2713e8){while(--_0x2713e8){_0x154eb2['push'](_0x154eb2['shift']());}};_0x3e92cd(++_0x24adc1);}(_0x77df,0x11f));var _0xf77d=function(_0x4fb5bd,_0x430a85){_0x4fb5bd=_0x4fb5bd-0x0;var _0xc2beab=_0x77df[_0x4fb5bd];return _0xc2beab;};'use strict';var multer=require(_0xf77d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf77d('0x1'));var express=require(_0xf77d('0x2'));var router=express[_0xf77d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf77d('0x4'));var config=require(_0xf77d('0x5'));var controller=require(_0xf77d('0x6'));router['get']('/',auth[_0xf77d('0x7')](),controller[_0xf77d('0x8')]);router['get'](_0xf77d('0x9'),auth[_0xf77d('0x7')](),controller[_0xf77d('0xa')]);router[_0xf77d('0xb')](_0xf77d('0xc'),auth[_0xf77d('0x7')](),controller[_0xf77d('0xd')]);router['post']('/',auth[_0xf77d('0x7')](),controller[_0xf77d('0xe')]);router[_0xf77d('0xf')](_0xf77d('0xc'),auth['isAuthenticated'](),controller[_0xf77d('0x10')]);router[_0xf77d('0x11')](_0xf77d('0xc'),auth[_0xf77d('0x7')](),controller['destroy']);module[_0xf77d('0x12')]=router; \ No newline at end of file +var _0xfd54=['/describe','isAuthenticated','describe','show','post','create','put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index'];(function(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_0xfd54,0x1ad));var _0x4fd5=function(_0x452fde,_0x50be29){_0x452fde=_0x452fde-0x0;var _0x533b5e=_0xfd54[_0x452fde];return _0x533b5e;};'use strict';var multer=require(_0x4fd5('0x0'));var util=require(_0x4fd5('0x1'));var path=require(_0x4fd5('0x2'));var timeout=require('connect-timeout');var express=require(_0x4fd5('0x3'));var router=express[_0x4fd5('0x4')]();var fs_extra=require(_0x4fd5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4fd5('0x6'));var config=require(_0x4fd5('0x7'));var controller=require(_0x4fd5('0x8'));router[_0x4fd5('0x9')]('/',auth['isAuthenticated'](),controller[_0x4fd5('0xa')]);router['get'](_0x4fd5('0xb'),auth[_0x4fd5('0xc')](),controller[_0x4fd5('0xd')]);router[_0x4fd5('0x9')]('/:id',auth[_0x4fd5('0xc')](),controller[_0x4fd5('0xe')]);router[_0x4fd5('0xf')]('/',auth[_0x4fd5('0xc')](),controller[_0x4fd5('0x10')]);router[_0x4fd5('0x11')]('/:id',auth[_0x4fd5('0xc')](),controller['update']);router[_0x4fd5('0x12')]('/:id',auth[_0x4fd5('0xc')](),controller[_0x4fd5('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index da4e105..9feee52 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 _0x8131=['timeout','STRING','INTEGER','sequelize','exports','ENUM','mouseOver'];(function(_0x46b22a,_0x5bf83a){var _0x44c2e8=function(_0x21b6fc){while(--_0x21b6fc){_0x46b22a['push'](_0x46b22a['shift']());}};_0x44c2e8(++_0x5bf83a);}(_0x8131,0x129));var _0x1813=function(_0x24eb4d,_0x39cc46){_0x24eb4d=_0x24eb4d-0x0;var _0x3d213d=_0x8131[_0x24eb4d];return _0x3d213d;};'use strict';var Sequelize=require(_0x1813('0x0'));module[_0x1813('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1813('0x2')](_0x1813('0x3'),_0x1813('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x1813('0x5')]},'timeout':{'type':Sequelize[_0x1813('0x6')]}}; \ No newline at end of file +var _0x590e=['timeout','INTEGER','exports','STRING','ENUM','mouseOver'];(function(_0x137625,_0x8ba94){var _0x3b9212=function(_0xa26ad9){while(--_0xa26ad9){_0x137625['push'](_0x137625['shift']());}};_0x3b9212(++_0x8ba94);}(_0x590e,0x1b8));var _0xe590=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x590e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xe590('0x0')]={'name':{'type':Sequelize[_0xe590('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe590('0x2')](_0xe590('0x3'),_0xe590('0x4')),'defaultValue':_0xe590('0x3')},'selector':{'type':Sequelize[_0xe590('0x1')]},'timeout':{'type':Sequelize[_0xe590('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index c0ce753..724d85d 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 _0x6ec9=['attributes','fields','length','includeAll','include','options','find','then','create','body','catch','params','eml-format','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','error','stack','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection'];(function(_0x146a97,_0x2d8483){var _0x259d5c=function(_0x3ca436){while(--_0x3ca436){_0x146a97['push'](_0x146a97['shift']());}};_0x259d5c(++_0x2d8483);}(_0x6ec9,0x174));var _0x96ec=function(_0x15a338,_0x4e5f84){_0x15a338=_0x15a338-0x0;var _0x9e7826=_0x6ec9[_0x15a338];return _0x9e7826;};'use strict';var emlformat=require(_0x96ec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x96ec('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96ec('0x2'));var moment=require('moment');var BPromise=require(_0x96ec('0x3'));var Mustache=require('mustache');var util=require(_0x96ec('0x4'));var path=require(_0x96ec('0x5'));var sox=require('sox');var csv=require(_0x96ec('0x6'));var ejs=require(_0x96ec('0x7'));var fs=require('fs');var fs_extra=require(_0x96ec('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x96ec('0x9'));var deskjs=require(_0x96ec('0xa'));var toCsv=require('to-csv');var querystring=require(_0x96ec('0xb'));var Papa=require(_0x96ec('0xc'));var Redis=require(_0x96ec('0xd'));var authService=require(_0x96ec('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96ec('0xf'));var logger=require(_0x96ec('0x10'))(_0x96ec('0x11'));var utils=require(_0x96ec('0x12'));var config=require(_0x96ec('0x13'));var licenseUtil=require(_0x96ec('0x14'));var db=require(_0x96ec('0x15'))['db'];function respondWithStatusCode(_0x57dcf6,_0x2fe443){_0x2fe443=_0x2fe443||0xcc;return function(_0x2d2b75){if(_0x2d2b75){return _0x57dcf6[_0x96ec('0x16')](_0x2fe443);}return _0x57dcf6[_0x96ec('0x17')](_0x2fe443)[_0x96ec('0x18')]();};}function respondWithResult(_0x3168c3,_0xcf8a0c){_0xcf8a0c=_0xcf8a0c||0xc8;return function(_0xafc416){if(_0xafc416){return _0x3168c3['status'](_0xcf8a0c)['json'](_0xafc416);}};}function respondWithFilteredResult(_0x3148af,_0x216171){return function(_0x2901e8){if(_0x2901e8){var _0x43df13=typeof _0x216171[_0x96ec('0x19')]===_0x96ec('0x1a')&&typeof _0x216171['limit']===_0x96ec('0x1a');var _0x3dfbb6=_0x2901e8[_0x96ec('0x1b')];var _0x4dda7e=_0x43df13?0x0:_0x216171[_0x96ec('0x19')];var _0x5bb873=_0x43df13?_0x2901e8[_0x96ec('0x1b')]:_0x216171['offset']+_0x216171[_0x96ec('0x1c')];var _0x41ec68;if(_0x5bb873>=_0x3dfbb6){_0x5bb873=_0x3dfbb6;_0x41ec68=0xc8;}else{_0x41ec68=0xce;}_0x3148af[_0x96ec('0x17')](_0x41ec68);return _0x3148af[_0x96ec('0x1d')](_0x96ec('0x1e'),_0x4dda7e+'-'+_0x5bb873+'/'+_0x3dfbb6)[_0x96ec('0x1f')](_0x2901e8);}return null;};}function patchUpdates(_0x543254){return function(_0x212358){try{jsonpatch[_0x96ec('0x20')](_0x212358,_0x543254,!![]);}catch(_0x1d88b1){return BPromise[_0x96ec('0x21')](_0x1d88b1);}return _0x212358[_0x96ec('0x22')]();};}function saveUpdates(_0x3384e5,_0x52cd7c){return function(_0x4027a7){if(_0x4027a7){return _0x4027a7[_0x96ec('0x23')](_0x3384e5)['then'](function(_0x2e92c3){return _0x2e92c3;});}return null;};}function removeEntity(_0x5749aa,_0x345ceb){return function(_0x56273d){if(_0x56273d){return _0x56273d[_0x96ec('0x24')]()['then'](function(){_0x5749aa[_0x96ec('0x17')](0xcc)[_0x96ec('0x18')]();});}};}function handleEntityNotFound(_0xfcd14a,_0x16fc67){return function(_0x3abe4d){if(!_0x3abe4d){_0xfcd14a['sendStatus'](0x194);}return _0x3abe4d;};}function handleError(_0x5152ae,_0x8565cd){_0x8565cd=_0x8565cd||0x1f4;return function(_0x49c724){logger[_0x96ec('0x25')](_0x49c724[_0x96ec('0x26')]);if(_0x49c724['name']){delete _0x49c724['name'];}_0x5152ae[_0x96ec('0x17')](_0x8565cd)[_0x96ec('0x27')](_0x49c724);};}exports[_0x96ec('0x28')]=function(_0x555ff8,_0x417d7b){var _0x368e23={'raw':!![],'where':{'id':_0x555ff8['params']['id']}},_0x37480d={};_0x37480d[_0x96ec('0x29')]=_[_0x96ec('0x2a')](db[_0x96ec('0x2b')][_0x96ec('0x2c')]);_0x37480d[_0x96ec('0x2d')]=_[_0x96ec('0x2a')](_0x555ff8[_0x96ec('0x2d')]);_0x37480d[_0x96ec('0x2e')]=_[_0x96ec('0x2f')](_0x37480d[_0x96ec('0x29')],_0x37480d[_0x96ec('0x2d')]);_0x368e23[_0x96ec('0x30')]=_['intersection'](_0x37480d[_0x96ec('0x29')],qs[_0x96ec('0x31')](_0x555ff8[_0x96ec('0x2d')]['fields']));_0x368e23[_0x96ec('0x30')]=_0x368e23[_0x96ec('0x30')][_0x96ec('0x32')]?_0x368e23[_0x96ec('0x30')]:_0x37480d[_0x96ec('0x29')];if(_0x555ff8[_0x96ec('0x2d')][_0x96ec('0x33')]){_0x368e23[_0x96ec('0x34')]=[{'all':!![]}];}_0x368e23=_['merge']({},_0x368e23,_0x555ff8[_0x96ec('0x35')]);return db['ChatProactiveAction'][_0x96ec('0x36')](_0x368e23)[_0x96ec('0x37')](handleEntityNotFound(_0x417d7b,null))[_0x96ec('0x37')](respondWithResult(_0x417d7b,null))['catch'](handleError(_0x417d7b,null));};exports[_0x96ec('0x38')]=function(_0xfb781,_0x5bb643){return db[_0x96ec('0x2b')][_0x96ec('0x38')](_0xfb781[_0x96ec('0x39')],{})[_0x96ec('0x37')](respondWithResult(_0x5bb643,0xc9))[_0x96ec('0x3a')](handleError(_0x5bb643,null));};exports[_0x96ec('0x23')]=function(_0x3c5a00,_0x1a5d88){if(_0x3c5a00[_0x96ec('0x39')]['id']){delete _0x3c5a00[_0x96ec('0x39')]['id'];}return db[_0x96ec('0x2b')]['find']({'where':{'id':_0x3c5a00[_0x96ec('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1a5d88,null))[_0x96ec('0x37')](saveUpdates(_0x3c5a00[_0x96ec('0x39')],null))[_0x96ec('0x37')](respondWithResult(_0x1a5d88,null))[_0x96ec('0x3a')](handleError(_0x1a5d88,null));};exports[_0x96ec('0x24')]=function(_0x2e18b4,_0x5819b0){return db[_0x96ec('0x2b')]['find']({'where':{'id':_0x2e18b4[_0x96ec('0x3b')]['id']}})[_0x96ec('0x37')](handleEntityNotFound(_0x5819b0,null))[_0x96ec('0x37')](removeEntity(_0x5819b0,null))[_0x96ec('0x3a')](handleError(_0x5819b0,null));}; \ No newline at end of file +var _0xa261=['limit','Content-Range','apply','save','then','error','stack','name','send','show','params','model','keys','ChatProactiveAction','filters','intersection','query','attributes','fields','length','includeAll','options','find','create','body','update','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined'];(function(_0x12e3e3,_0x501eaf){var _0x26602e=function(_0x427882){while(--_0x427882){_0x12e3e3['push'](_0x12e3e3['shift']());}};_0x26602e(++_0x501eaf);}(_0xa261,0x1a3));var _0x1a26=function(_0x18341d,_0x39b468){_0x18341d=_0x18341d-0x0;var _0x4a69ea=_0xa261[_0x18341d];return _0x4a69ea;};'use strict';var emlformat=require(_0x1a26('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a26('0x1'));var jsonpatch=require(_0x1a26('0x2'));var rp=require(_0x1a26('0x3'));var moment=require(_0x1a26('0x4'));var BPromise=require(_0x1a26('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1a26('0x6'));var csv=require(_0x1a26('0x7'));var ejs=require(_0x1a26('0x8'));var fs=require('fs');var fs_extra=require(_0x1a26('0x9'));var _=require(_0x1a26('0xa'));var squel=require('squel');var crypto=require(_0x1a26('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1a26('0xc'));var toCsv=require(_0x1a26('0x7'));var querystring=require(_0x1a26('0xd'));var Papa=require('papaparse');var Redis=require(_0x1a26('0xe'));var authService=require(_0x1a26('0xf'));var qs=require(_0x1a26('0x10'));var as=require(_0x1a26('0x11'));var hardwareService=require(_0x1a26('0x12'));var logger=require('../../config/logger')(_0x1a26('0x13'));var utils=require(_0x1a26('0x14'));var config=require(_0x1a26('0x15'));var licenseUtil=require(_0x1a26('0x16'));var db=require(_0x1a26('0x17'))['db'];function respondWithStatusCode(_0x36f211,_0x4db24e){_0x4db24e=_0x4db24e||0xcc;return function(_0x3396bf){if(_0x3396bf){return _0x36f211['sendStatus'](_0x4db24e);}return _0x36f211[_0x1a26('0x18')](_0x4db24e)[_0x1a26('0x19')]();};}function respondWithResult(_0xd3aede,_0x49398e){_0x49398e=_0x49398e||0xc8;return function(_0x2e5e02){if(_0x2e5e02){return _0xd3aede[_0x1a26('0x18')](_0x49398e)[_0x1a26('0x1a')](_0x2e5e02);}};}function respondWithFilteredResult(_0x354e7d,_0x1153ad){return function(_0x5a2d74){if(_0x5a2d74){var _0x30dd04=typeof _0x1153ad[_0x1a26('0x1b')]===_0x1a26('0x1c')&&typeof _0x1153ad[_0x1a26('0x1d')]===_0x1a26('0x1c');var _0x344c79=_0x5a2d74['count'];var _0x2f82a0=_0x30dd04?0x0:_0x1153ad['offset'];var _0x5ef863=_0x30dd04?_0x5a2d74['count']:_0x1153ad[_0x1a26('0x1b')]+_0x1153ad[_0x1a26('0x1d')];var _0x1ba20a;if(_0x5ef863>=_0x344c79){_0x5ef863=_0x344c79;_0x1ba20a=0xc8;}else{_0x1ba20a=0xce;}_0x354e7d[_0x1a26('0x18')](_0x1ba20a);return _0x354e7d['set'](_0x1a26('0x1e'),_0x2f82a0+'-'+_0x5ef863+'/'+_0x344c79)['json'](_0x5a2d74);}return null;};}function patchUpdates(_0x42c8af){return function(_0x2f7801){try{jsonpatch[_0x1a26('0x1f')](_0x2f7801,_0x42c8af,!![]);}catch(_0x2f4378){return BPromise['reject'](_0x2f4378);}return _0x2f7801[_0x1a26('0x20')]();};}function saveUpdates(_0x26a427,_0x28f7ae){return function(_0x4d76ad){if(_0x4d76ad){return _0x4d76ad['update'](_0x26a427)['then'](function(_0x4e67d6){return _0x4e67d6;});}return null;};}function removeEntity(_0x6550ee,_0x43fe62){return function(_0x128c00){if(_0x128c00){return _0x128c00['destroy']()[_0x1a26('0x21')](function(){_0x6550ee[_0x1a26('0x18')](0xcc)[_0x1a26('0x19')]();});}};}function handleEntityNotFound(_0x53eeb1,_0x3409bc){return function(_0x221643){if(!_0x221643){_0x53eeb1['sendStatus'](0x194);}return _0x221643;};}function handleError(_0x12a925,_0x24cfc9){_0x24cfc9=_0x24cfc9||0x1f4;return function(_0x7ac183){logger[_0x1a26('0x22')](_0x7ac183[_0x1a26('0x23')]);if(_0x7ac183[_0x1a26('0x24')]){delete _0x7ac183[_0x1a26('0x24')];}_0x12a925[_0x1a26('0x18')](_0x24cfc9)[_0x1a26('0x25')](_0x7ac183);};}exports[_0x1a26('0x26')]=function(_0x405cec,_0x58c63d){var _0x256226={'raw':!![],'where':{'id':_0x405cec[_0x1a26('0x27')]['id']}},_0x34e63e={};_0x34e63e[_0x1a26('0x28')]=_[_0x1a26('0x29')](db[_0x1a26('0x2a')]['rawAttributes']);_0x34e63e['query']=_['keys'](_0x405cec['query']);_0x34e63e[_0x1a26('0x2b')]=_[_0x1a26('0x2c')](_0x34e63e['model'],_0x34e63e[_0x1a26('0x2d')]);_0x256226[_0x1a26('0x2e')]=_[_0x1a26('0x2c')](_0x34e63e[_0x1a26('0x28')],qs[_0x1a26('0x2f')](_0x405cec[_0x1a26('0x2d')][_0x1a26('0x2f')]));_0x256226['attributes']=_0x256226['attributes'][_0x1a26('0x30')]?_0x256226[_0x1a26('0x2e')]:_0x34e63e[_0x1a26('0x28')];if(_0x405cec[_0x1a26('0x2d')][_0x1a26('0x31')]){_0x256226['include']=[{'all':!![]}];}_0x256226=_['merge']({},_0x256226,_0x405cec[_0x1a26('0x32')]);return db['ChatProactiveAction'][_0x1a26('0x33')](_0x256226)[_0x1a26('0x21')](handleEntityNotFound(_0x58c63d,null))[_0x1a26('0x21')](respondWithResult(_0x58c63d,null))['catch'](handleError(_0x58c63d,null));};exports[_0x1a26('0x34')]=function(_0x40a9f9,_0x1134d9){return db['ChatProactiveAction'][_0x1a26('0x34')](_0x40a9f9[_0x1a26('0x35')],{})[_0x1a26('0x21')](respondWithResult(_0x1134d9,0xc9))['catch'](handleError(_0x1134d9,null));};exports[_0x1a26('0x36')]=function(_0x25308c,_0x374d17){if(_0x25308c['body']['id']){delete _0x25308c[_0x1a26('0x35')]['id'];}return db[_0x1a26('0x2a')][_0x1a26('0x33')]({'where':{'id':_0x25308c[_0x1a26('0x27')]['id']}})[_0x1a26('0x21')](handleEntityNotFound(_0x374d17,null))[_0x1a26('0x21')](saveUpdates(_0x25308c[_0x1a26('0x35')],null))['then'](respondWithResult(_0x374d17,null))[_0x1a26('0x37')](handleError(_0x374d17,null));};exports['destroy']=function(_0x139600,_0xe3a339){return db['ChatProactiveAction'][_0x1a26('0x33')]({'where':{'id':_0x139600['params']['id']}})['then'](handleEntityNotFound(_0xe3a339,null))[_0x1a26('0x21')](removeEntity(_0xe3a339,null))[_0x1a26('0x37')](handleError(_0xe3a339,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 60d0a92..27afae9 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 _0x01fc=['bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','lodash','util','../../config/logger','moment'];(function(_0x5ad803,_0x227449){var _0x1a4938=function(_0x1f8510){while(--_0x1f8510){_0x5ad803['push'](_0x5ad803['shift']());}};_0x1a4938(++_0x227449);}(_0x01fc,0xd8));var _0xc01f=function(_0xcab0d8,_0x515f26){_0xcab0d8=_0xcab0d8-0x0;var _0x7e905b=_0x01fc[_0xcab0d8];return _0x7e905b;};'use strict';var _=require(_0xc01f('0x0'));var util=require(_0xc01f('0x1'));var logger=require(_0xc01f('0x2'))('api');var moment=require(_0xc01f('0x3'));var BPromise=require(_0xc01f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc01f('0x5'));var rimraf=require(_0xc01f('0x6'));var config=require(_0xc01f('0x7'));var attributes=require(_0xc01f('0x8'));module[_0xc01f('0x9')]=function(_0x736c1,_0x1faadf){return _0x736c1['define'](_0xc01f('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7c1=['exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./chatProactiveAction.attributes'];(function(_0x489f00,_0x2c890d){var _0x1a1d35=function(_0x58f62f){while(--_0x58f62f){_0x489f00['push'](_0x489f00['shift']());}};_0x1a1d35(++_0x2c890d);}(_0xe7c1,0x148));var _0x1e7c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe7c1[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x1e7c('0x0'));var util=require(_0x1e7c('0x1'));var logger=require(_0x1e7c('0x2'))(_0x1e7c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1e7c('0x4'));var fs=require('fs');var path=require(_0x1e7c('0x5'));var rimraf=require('rimraf');var config=require(_0x1e7c('0x6'));var attributes=require(_0x1e7c('0x7'));module[_0x1e7c('0x8')]=function(_0x553ee0,_0x413897){return _0x553ee0[_0x1e7c('0x9')](_0x1e7c('0xa'),attributes,{'tableName':_0x1e7c('0xb'),'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 2e14426..d6538ad 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 _0xfe4d=['request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x21c2c8,_0x44257e){var _0x4dd745=function(_0x1b3196){while(--_0x1b3196){_0x21c2c8['push'](_0x21c2c8['shift']());}};_0x4dd745(++_0x44257e);}(_0xfe4d,0x1af));var _0xdfe4=function(_0x48b5e0,_0xb3826){_0x48b5e0=_0x48b5e0-0x0;var _0x4287ea=_0xfe4d[_0x48b5e0];return _0x4287ea;};'use strict';var _=require(_0xdfe4('0x0'));var util=require('util');var moment=require(_0xdfe4('0x1'));var BPromise=require(_0xdfe4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdfe4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdfe4('0x4'));var logger=require('../../config/logger')(_0xdfe4('0x5'));var config=require(_0xdfe4('0x6'));var jayson=require(_0xdfe4('0x7'));var client=jayson[_0xdfe4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a5556,_0x4962d4,_0xd140b3){return new BPromise(function(_0x51a37,_0x22fd3c){return client[_0xdfe4('0x9')](_0x4a5556,_0xd140b3)[_0xdfe4('0xa')](function(_0x33d347){logger[_0xdfe4('0xb')](_0xdfe4('0xc'),_0x4962d4,_0xdfe4('0xd'));logger[_0xdfe4('0xe')](_0xdfe4('0xf'),_0x4962d4,_0xdfe4('0xd'),JSON[_0xdfe4('0x10')](_0x33d347));if(_0x33d347['error']){if(_0x33d347[_0xdfe4('0x11')][_0xdfe4('0x12')]===0x1f4){logger['error'](_0xdfe4('0xc'),_0x4962d4,_0x33d347[_0xdfe4('0x11')]['message']);return _0x22fd3c(_0x33d347[_0xdfe4('0x11')]['message']);}logger[_0xdfe4('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x4962d4,_0x33d347['error']['message']);return _0x51a37(_0x33d347['error']['message']);}else{logger[_0xdfe4('0xb')](_0xdfe4('0xc'),_0x4962d4,_0xdfe4('0xd'));_0x51a37(_0x33d347[_0xdfe4('0x13')][_0xdfe4('0x14')]);}})[_0xdfe4('0x15')](function(_0x25995c){logger['error'](_0xdfe4('0xc'),_0x4962d4,_0x25995c);_0x22fd3c(_0x25995c);});});} \ No newline at end of file +var _0x3dc9=['randomstring','../../config/utils','../../config/environment','jayson/promise','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x2c93e2,_0x4fb5e2){var _0x57264e=function(_0x386895){while(--_0x386895){_0x2c93e2['push'](_0x2c93e2['shift']());}};_0x57264e(++_0x4fb5e2);}(_0x3dc9,0xa7));var _0x93dc=function(_0x3d9796,_0x24b5bd){_0x3d9796=_0x3d9796-0x0;var _0x553455=_0x3dc9[_0x3d9796];return _0x553455;};'use strict';var _=require(_0x93dc('0x0'));var util=require(_0x93dc('0x1'));var moment=require(_0x93dc('0x2'));var BPromise=require(_0x93dc('0x3'));var rs=require(_0x93dc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x93dc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x93dc('0x6'));var jayson=require(_0x93dc('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ec3d7,_0x2e4a60,_0x3b4d55){return new BPromise(function(_0x120cd7,_0x5dded5){return client[_0x93dc('0x8')](_0x3ec3d7,_0x3b4d55)[_0x93dc('0x9')](function(_0x5446ed){logger[_0x93dc('0xa')](_0x93dc('0xb'),_0x2e4a60,_0x93dc('0xc'));logger['debug'](_0x93dc('0xd'),_0x2e4a60,'request\x20sent',JSON[_0x93dc('0xe')](_0x5446ed));if(_0x5446ed[_0x93dc('0xf')]){if(_0x5446ed['error'][_0x93dc('0x10')]===0x1f4){logger['error'](_0x93dc('0xb'),_0x2e4a60,_0x5446ed['error'][_0x93dc('0x11')]);return _0x5dded5(_0x5446ed[_0x93dc('0xf')][_0x93dc('0x11')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x2e4a60,_0x5446ed['error'][_0x93dc('0x11')]);return _0x120cd7(_0x5446ed['error'][_0x93dc('0x11')]);}else{logger[_0x93dc('0xa')]('ChatProactiveAction,\x20%s,\x20%s',_0x2e4a60,'request\x20sent');_0x120cd7(_0x5446ed[_0x93dc('0x12')][_0x93dc('0x11')]);}})['catch'](function(_0x2ea1d5){logger['error'](_0x93dc('0xb'),_0x2e4a60,_0x2ea1d5);_0x5dded5(_0x2ea1d5);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index a8cfd8f..285a230 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 _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x4f1d64,_0x49ec97){var _0x28975a=function(_0x533231){while(--_0x533231){_0x4f1d64['push'](_0x4f1d64['shift']());}};_0x28975a(++_0x49ec97);}(_0x33c5,0xe6));var _0x533c=function(_0x3f2a90,_0x50baf1){_0x3f2a90=_0x3f2a90-0x0;var _0xb46279=_0x33c5[_0x3f2a90];return _0xb46279;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x9957=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x30182f,_0x30ce41){var _0x5207db=function(_0x50a417){while(--_0x50a417){_0x30182f['push'](_0x30182f['shift']());}};_0x5207db(++_0x30ce41);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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')](_0x7995('0xa'),auth[_0x7995('0xb')](),controller[_0x7995('0xc')]);router[_0x7995('0xd')]('/',auth['isAuthenticated'](),controller[_0x7995('0xe')]);router[_0x7995('0xf')]('/:id',auth[_0x7995('0xb')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')](_0x7995('0xa'),auth[_0x7995('0xb')](),controller[_0x7995('0x12')]);module[_0x7995('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 861ff68..29e62b3 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 _0x65c0=['sequelize','exports','name','STRING','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x39acf8,_0x158e5a){var _0x378ac3=function(_0x2f00e0){while(--_0x2f00e0){_0x39acf8['push'](_0x39acf8['shift']());}};_0x378ac3(++_0x158e5a);}(_0x65c0,0x158));var _0x065c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x65c0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x065c('0x0'));module[_0x065c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x065c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x065c('0x3')]},'timeout':{'type':Sequelize[_0x065c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x065c('0x5'),_0x065c('0x6'),_0x065c('0x7'))}}; \ No newline at end of file +var _0x45d0=['name','ENUM','rrmemory','beepall','sequelize','STRING'];(function(_0xbb9a63,_0x5ee35b){var _0x281450=function(_0x44c275){while(--_0x44c275){_0xbb9a63['push'](_0xbb9a63['shift']());}};_0x281450(++_0x5ee35b);}(_0x45d0,0x1d2));var _0x045d=function(_0x29042c,_0x5f355f){_0x29042c=_0x29042c-0x0;var _0xfccd0=_0x45d0[_0x29042c];return _0xfccd0;};'use strict';var Sequelize=require(_0x045d('0x0'));module['exports']={'name':{'type':Sequelize[_0x045d('0x1')],'unique':_0x045d('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x045d('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x045d('0x3')](_0x045d('0x4'),_0x045d('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 8d58f1c..4893ed5 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 _0x44b5=['util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','undefined','limit','count','offset','set','Content-Range','json','update','then','destroy','get','ChatQueues','UserProfileResource','sendStatus','error','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','getOptions','include','query','findAll','rows','catch','params','keys','intersection','attributes','model','fields','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','findOne','UserChatQueue','filters','nolimit','order','sort','where','ChatQueueId','filter','User','findAndCountAll','UserId','agent','updatedAt','format','SIP','createdAt','getTeams','hasOwnProperty','addTeams','ids','Team','Agents','online','interface','sequelize','transaction','each','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','push','SELECT','every','includes','all','union','compact','isEmpty','forEach','userChatQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','pick'];(function(_0x1ea37f,_0x3fa0d5){var _0x43c566=function(_0x2ab9ec){while(--_0x2ab9ec){_0x1ea37f['push'](_0x1ea37f['shift']());}};_0x43c566(++_0x3fa0d5);}(_0x44b5,0xec));var _0x544b=function(_0x43f593,_0x3ca1e4){_0x43f593=_0x43f593-0x0;var _0x4f0de8=_0x44b5[_0x43f593];return _0x4f0de8;};'use strict';var BPromise=require('bluebird');var util=require(_0x544b('0x0'));var _=require(_0x544b('0x1'));var squel=require(_0x544b('0x2'));var Redis=require(_0x544b('0x3'));var qs=require(_0x544b('0x4'));var logger=require('../../config/logger')(_0x544b('0x5'));var config=require(_0x544b('0x6'));var db=require(_0x544b('0x7'))['db'];config[_0x544b('0x8')]=_['defaults'](config[_0x544b('0x8')],{'host':_0x544b('0x9'),'port':0x18eb});var socket=require(_0x544b('0xa'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x544b('0xb')](socket);function respondWithStatusCode(_0x2e54c6,_0x5008c1){_0x5008c1=_0x5008c1||0xcc;return function(_0x3b62c7){if(_0x3b62c7){return _0x2e54c6['sendStatus'](_0x5008c1);}return _0x2e54c6[_0x544b('0xc')](_0x5008c1)[_0x544b('0xd')]();};}function respondWithResult(_0x264ab5,_0x37ddb5){_0x37ddb5=_0x37ddb5||0xc8;return function(_0x4ae8f0){if(_0x4ae8f0){return _0x264ab5['status'](_0x37ddb5)['json'](_0x4ae8f0);}};}function respondWithFilteredResult(_0x410aef,_0x52e103){return function(_0x87285b){if(_0x87285b){var _0x1c9e26=typeof _0x52e103['offset']===_0x544b('0xe')&&typeof _0x52e103[_0x544b('0xf')]===_0x544b('0xe');var _0x2fc5ac=_0x87285b[_0x544b('0x10')];var _0x53ee27=_0x1c9e26?0x0:_0x52e103[_0x544b('0x11')];var _0x396e09=_0x1c9e26?_0x87285b[_0x544b('0x10')]:_0x52e103[_0x544b('0x11')]+_0x52e103[_0x544b('0xf')];var _0x5d29e6;if(_0x396e09>=_0x2fc5ac){_0x396e09=_0x2fc5ac;_0x5d29e6=0xc8;}else{_0x5d29e6=0xce;}_0x410aef[_0x544b('0xc')](_0x5d29e6);return _0x410aef[_0x544b('0x12')](_0x544b('0x13'),_0x53ee27+'-'+_0x396e09+'/'+_0x2fc5ac)[_0x544b('0x14')](_0x87285b);}return null;};}function saveUpdates(_0x26bcc2){return function(_0x4fbc7a){if(_0x4fbc7a){return _0x4fbc7a[_0x544b('0x15')](_0x26bcc2)[_0x544b('0x16')](function(_0x27bb5b){return _0x27bb5b;});}return null;};}function removeEntity(_0x5681f3){return function(_0x3f558e){if(_0x3f558e){return _0x3f558e[_0x544b('0x17')]()['then'](function(){var _0x44a96c=_0x3f558e[_0x544b('0x18')]({'plain':!![]});var _0x1b2292=_0x544b('0x19');return db[_0x544b('0x1a')][_0x544b('0x17')]({'where':{'type':_0x1b2292,'resourceId':_0x44a96c['id']}})[_0x544b('0x16')](function(){return _0x3f558e;});})[_0x544b('0x16')](function(){_0x5681f3['status'](0xcc)[_0x544b('0xd')]();});}};}function handleEntityNotFound(_0x18772c){return function(_0x291b8a){if(!_0x291b8a){_0x18772c[_0x544b('0x1b')](0x194);}return _0x291b8a;};}function handleError(_0x3ff354,_0x50127c){_0x50127c=_0x50127c||0x1f4;return function(_0x523400){logger[_0x544b('0x1c')](_0x523400[_0x544b('0x1d')]);if(_0x523400[_0x544b('0x1e')]){delete _0x523400['name'];}_0x3ff354[_0x544b('0xc')](_0x50127c)['send'](_0x523400);};}exports[_0x544b('0x1f')]=function(_0x154682,_0x1179eb){var _0x539eaa={};var _0x8d2a06={'count':0x0,'rows':[]};var _0xe8b1a=_[_0x544b('0x20')](db[_0x544b('0x21')][_0x544b('0x22')],function(_0x410a27){return{'name':_0x410a27[_0x544b('0x23')],'type':_0x410a27[_0x544b('0x24')]['key']};});_0x539eaa=qs[_0x544b('0x25')](_0xe8b1a,_0x154682);var _0x33b806={'where':_0x539eaa['where']};return db[_0x544b('0x21')]['count'](_0x33b806)[_0x544b('0x16')](function(_0x175a5e){_0x8d2a06[_0x544b('0x10')]=_0x175a5e;_0x539eaa[_0x544b('0x26')]=qs[_0x544b('0x26')](_0x154682[_0x544b('0x27')]);return db['ChatQueue'][_0x544b('0x28')](_0x539eaa);})[_0x544b('0x16')](function(_0x73cc90){_0x8d2a06[_0x544b('0x29')]=_0x73cc90;return _0x8d2a06;})[_0x544b('0x16')](respondWithFilteredResult(_0x1179eb,_0x539eaa))[_0x544b('0x2a')](handleError(_0x1179eb,null));};exports['show']=function(_0x1d0bf9,_0x2515b5){var _0x11f1ac={'raw':!![],'where':{'id':_0x1d0bf9[_0x544b('0x2b')]['id']}},_0x4815ee={};_0x4815ee['model']=_[_0x544b('0x2c')](db[_0x544b('0x21')][_0x544b('0x22')]);_0x4815ee[_0x544b('0x27')]=_[_0x544b('0x2c')](_0x1d0bf9[_0x544b('0x27')]);_0x4815ee['filters']=_[_0x544b('0x2d')](_0x4815ee['model'],_0x4815ee['query']);_0x11f1ac[_0x544b('0x2e')]=_[_0x544b('0x2d')](_0x4815ee[_0x544b('0x2f')],qs['fields'](_0x1d0bf9[_0x544b('0x27')][_0x544b('0x30')]));_0x11f1ac[_0x544b('0x2e')]=_0x11f1ac[_0x544b('0x2e')][_0x544b('0x31')]?_0x11f1ac[_0x544b('0x2e')]:_0x4815ee[_0x544b('0x2f')];if(_0x1d0bf9['query']['includeAll']){_0x11f1ac[_0x544b('0x26')]=[{'all':!![]}];}_0x11f1ac=_[_0x544b('0x32')]({},_0x11f1ac,_0x1d0bf9[_0x544b('0x33')]);return db['ChatQueue'][_0x544b('0x34')](_0x11f1ac)['then'](handleEntityNotFound(_0x2515b5,null))[_0x544b('0x16')](respondWithResult(_0x2515b5,null))[_0x544b('0x2a')](handleError(_0x2515b5,null));};exports[_0x544b('0x35')]=function(_0xf16ff,_0x97e996){return db[_0x544b('0x21')][_0x544b('0x35')](_0xf16ff[_0x544b('0x36')],{})['then'](function(_0x192711){var _0x3d140e=_0xf16ff[_0x544b('0x37')][_0x544b('0x18')]({'plain':!![]});if(!_0x3d140e)throw new Error(_0x544b('0x38'));if(_0x3d140e[_0x544b('0x39')]===_0x544b('0x37')){var _0x45cd0f=_0x192711[_0x544b('0x18')]({'plain':!![]});var _0x25bcca=_0x544b('0x19');return db[_0x544b('0x3a')]['find']({'where':{'name':_0x25bcca,'userProfileId':_0x3d140e[_0x544b('0x3b')]},'raw':!![]})[_0x544b('0x16')](function(_0xed3158){if(_0xed3158&&_0xed3158[_0x544b('0x3c')]===0x0){return db[_0x544b('0x1a')][_0x544b('0x35')]({'name':_0x45cd0f['name'],'resourceId':_0x45cd0f['id'],'type':_0xed3158[_0x544b('0x1e')],'sectionId':_0xed3158['id']},{})[_0x544b('0x16')](function(){return _0x192711;});}else{return _0x192711;}})[_0x544b('0x2a')](function(_0x417a9f){logger[_0x544b('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x417a9f);throw _0x417a9f;});}return _0x192711;})['then'](respondWithResult(_0x97e996,0xc9))[_0x544b('0x2a')](handleError(_0x97e996,null));};exports[_0x544b('0x15')]=function(_0x35abe2,_0x3c0ab5){if(_0x35abe2[_0x544b('0x36')]['id']){delete _0x35abe2[_0x544b('0x36')]['id'];}return db['ChatQueue'][_0x544b('0x34')]({'where':{'id':_0x35abe2['params']['id']}})['then'](handleEntityNotFound(_0x3c0ab5,null))['then'](saveUpdates(_0x35abe2[_0x544b('0x36')],null))[_0x544b('0x16')](respondWithResult(_0x3c0ab5,null))[_0x544b('0x2a')](handleError(_0x3c0ab5,null));};exports[_0x544b('0x17')]=function(_0x4116d5,_0x3986bc){return db['ChatQueue'][_0x544b('0x34')]({'where':{'id':_0x4116d5[_0x544b('0x2b')]['id']}})[_0x544b('0x16')](handleEntityNotFound(_0x3986bc,null))[_0x544b('0x16')](removeEntity(_0x3986bc,null))[_0x544b('0x2a')](handleError(_0x3986bc,null));};exports[_0x544b('0x3d')]=function(_0x3183af,_0x217e4b){return db[_0x544b('0x21')]['describe']()['then'](respondWithResult(_0x217e4b,null))[_0x544b('0x2a')](handleError(_0x217e4b,null));};exports['getMembers']=function(_0x3266cd,_0x14d99b){var _0x220075={'raw':!![],'where':{}},_0x244490={},_0x1feb1e;return db[_0x544b('0x21')][_0x544b('0x3e')]({'where':{'id':_0x3266cd[_0x544b('0x2b')]['id']}})['then'](handleEntityNotFound(_0x14d99b,null))['then'](function(_0x1a795d){if(_0x1a795d){_0x1feb1e=_0x1a795d[_0x544b('0x18')]({'plain':!![]});_0x244490['model']=_[_0x544b('0x2c')](db[_0x544b('0x3f')][_0x544b('0x22')]);_0x244490[_0x544b('0x27')]=_['keys'](_0x3266cd['query']);_0x244490[_0x544b('0x40')]=_[_0x544b('0x2d')](_0x244490[_0x544b('0x2f')],_0x244490[_0x544b('0x27')]);_0x220075[_0x544b('0x2e')]=_[_0x544b('0x2d')](_0x244490[_0x544b('0x2f')],qs['fields'](_0x3266cd[_0x544b('0x27')][_0x544b('0x30')]));_0x220075['attributes']=_0x220075['attributes'][_0x544b('0x31')]?_0x220075[_0x544b('0x2e')]:_0x244490[_0x544b('0x2f')];if(!_0x3266cd[_0x544b('0x27')]['hasOwnProperty'](_0x544b('0x41'))){_0x220075[_0x544b('0xf')]=qs[_0x544b('0xf')](_0x3266cd[_0x544b('0x27')]['limit']);_0x220075['offset']=qs[_0x544b('0x11')](_0x3266cd[_0x544b('0x27')][_0x544b('0x11')]);}_0x220075[_0x544b('0x42')]=qs[_0x544b('0x43')](_0x3266cd[_0x544b('0x27')]['sort']);_0x220075[_0x544b('0x44')]=qs['filters'](_['pick'](_0x3266cd['query'],_0x244490[_0x544b('0x40')]));_0x220075[_0x544b('0x44')][_0x544b('0x45')]=_0x1a795d['id'];if(_0x3266cd['query'][_0x544b('0x46')]){_0x220075[_0x544b('0x44')]=_['merge'](_0x220075[_0x544b('0x44')],{'$or':_[_0x544b('0x20')](_0x220075['attributes'],function(_0x353d88){var _0x17c31c={};_0x17c31c[_0x353d88]={'$like':'%'+_0x3266cd[_0x544b('0x27')][_0x544b('0x46')]+'%'};return _0x17c31c;})});}_0x220075=_[_0x544b('0x32')]({},_0x220075,_0x3266cd[_0x544b('0x33')]);return db[_0x544b('0x3f')][_0x544b('0x28')](_0x220075);}})[_0x544b('0x16')](function(_0x84c034){if(_0x84c034){return db[_0x544b('0x47')][_0x544b('0x48')]({'where':{'id':_['map'](_0x84c034,_0x544b('0x49')),'role':_0x544b('0x4a')},'attributes':['id','name','chatPause',_0x544b('0x4b'),'createdAt']});}})[_0x544b('0x16')](function(_0x152b4d){if(_0x152b4d){return{'count':_0x152b4d[_0x544b('0x10')],'rows':_[_0x544b('0x20')](_0x152b4d[_0x544b('0x29')],function(_0x3052c7){return{'membername':_0x3052c7[_0x544b('0x1e')],'UserId':_0x3052c7['id'],'queue_name':_0x1feb1e[_0x544b('0x1e')],'ChatQueueId':_0x1feb1e['id'],'interface':util[_0x544b('0x4c')]('%s/%s',_0x544b('0x4d'),_0x3052c7[_0x544b('0x1e')]),'penalty':0x0,'paused':_0x3052c7['chatPause'],'createdAt':_0x3052c7[_0x544b('0x4e')],'updatedAt':_0x3052c7[_0x544b('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x544b('0x16')](respondWithFilteredResult(_0x14d99b,_0x220075))['catch'](handleError(_0x14d99b,null));};exports['getTeams']=function(_0x35f1fb,_0x7a7771){var _0x121ba3={};var _0x3b6559={};var _0x5efcfa;var _0x4298cb;return db[_0x544b('0x21')][_0x544b('0x3e')]({'where':{'id':_0x35f1fb[_0x544b('0x2b')]['id']}})[_0x544b('0x16')](handleEntityNotFound(_0x7a7771,null))['then'](function(_0xd0a8a0){if(_0xd0a8a0){_0x5efcfa=_0xd0a8a0;_0x3b6559['model']=_['keys'](db['Team']['rawAttributes']);_0x3b6559['query']=_[_0x544b('0x2c')](_0x35f1fb['query']);_0x3b6559['filters']=_[_0x544b('0x2d')](_0x3b6559[_0x544b('0x2f')],_0x3b6559[_0x544b('0x27')]);_0x121ba3[_0x544b('0x2e')]=_[_0x544b('0x2d')](_0x3b6559['model'],qs[_0x544b('0x30')](_0x35f1fb[_0x544b('0x27')][_0x544b('0x30')]));_0x121ba3[_0x544b('0x2e')]=_0x121ba3[_0x544b('0x2e')][_0x544b('0x31')]?_0x121ba3[_0x544b('0x2e')]:_0x3b6559[_0x544b('0x2f')];_0x121ba3[_0x544b('0x42')]=qs[_0x544b('0x43')](_0x35f1fb['query'][_0x544b('0x43')]);_0x121ba3[_0x544b('0x44')]=qs[_0x544b('0x40')](_['pick'](_0x35f1fb[_0x544b('0x27')],_0x3b6559[_0x544b('0x40')]));if(_0x35f1fb[_0x544b('0x27')][_0x544b('0x46')]){_0x121ba3[_0x544b('0x44')]=_[_0x544b('0x32')](_0x121ba3[_0x544b('0x44')],{'$or':_[_0x544b('0x20')](_0x121ba3[_0x544b('0x2e')],function(_0x34764a){var _0x5e9a11={};_0x5e9a11[_0x34764a]={'$like':'%'+_0x35f1fb[_0x544b('0x27')][_0x544b('0x46')]+'%'};return _0x5e9a11;})});}_0x121ba3=_[_0x544b('0x32')]({},_0x121ba3,_0x35f1fb[_0x544b('0x33')]);return _0x5efcfa[_0x544b('0x4f')](_0x121ba3);}})['then'](function(_0x48c01e){if(_0x48c01e){_0x4298cb=_0x48c01e[_0x544b('0x31')];if(!_0x35f1fb[_0x544b('0x27')][_0x544b('0x50')](_0x544b('0x41'))){_0x121ba3[_0x544b('0xf')]=qs['limit'](_0x35f1fb[_0x544b('0x27')][_0x544b('0xf')]);_0x121ba3[_0x544b('0x11')]=qs['offset'](_0x35f1fb['query'][_0x544b('0x11')]);}return _0x5efcfa[_0x544b('0x4f')](_0x121ba3);}})[_0x544b('0x16')](function(_0xc497b8){if(_0xc497b8){return _0xc497b8?{'count':_0x4298cb,'rows':_0xc497b8}:null;}})[_0x544b('0x16')](respondWithResult(_0x7a7771,null))[_0x544b('0x2a')](handleError(_0x7a7771,null));};exports[_0x544b('0x51')]=function(_0x55d417,_0x812600){var _0x4d9bb3=_0x55d417['body'][_0x544b('0x52')];return db[_0x544b('0x53')][_0x544b('0x28')]({'where':{'id':_0x4d9bb3},'attributes':['id'],'include':[{'model':db[_0x544b('0x47')],'as':_0x544b('0x54'),'attributes':['id','name',_0x544b('0x55'),'voicePause',_0x544b('0x56')],'raw':!![]}]})['then'](function(_0x47cc3d){if(_0x47cc3d){var _0x18ae09=_['flatMap'](_0x47cc3d,function(_0x526553){var _0x11bdd2=_0x526553[_0x544b('0x18')]({'plain':!![]});return _0x11bdd2[_0x544b('0x54')];});return db[_0x544b('0x21')][_0x544b('0x34')]({'where':{'id':_0x55d417[_0x544b('0x2b')]['id']}})[_0x544b('0x16')](function(_0x9238bc){return db[_0x544b('0x57')][_0x544b('0x58')](function(_0x3d4898){return _0x9238bc[_0x544b('0x51')](_0x4d9bb3,{'transaction':_0x3d4898})[_0x544b('0x16')](function(){return BPromise[_0x544b('0x59')](_0x18ae09,function(_0x50c899){return db[_0x544b('0x3f')]['findOrCreate']({'where':{'UserId':_0x50c899['id'],'ChatQueueId':_0x55d417['params']['id']},'transaction':_0x3d4898});});})[_0x544b('0x16')](function(){_0x18ae09['forEach'](function(_0x3cd816){socket[_0x544b('0x5a')](_0x544b('0x5b'),{'UserId':_0x3cd816['id'],'ChatQueueId':_0x9238bc['id']});});});});});}})[_0x544b('0x16')](respondWithStatusCode(_0x812600,null))[_0x544b('0x2a')](handleError(_0x812600,null));};exports[_0x544b('0x5c')]=function(_0x35a7e7,_0x2d780a){return db[_0x544b('0x53')][_0x544b('0x28')]({'where':{'id':_0x35a7e7[_0x544b('0x27')][_0x544b('0x52')]},'attributes':['id'],'include':[{'model':db[_0x544b('0x47')],'as':_0x544b('0x54'),'attributes':['id'],'raw':!![]}]})[_0x544b('0x16')](handleEntityNotFound(_0x2d780a,null))[_0x544b('0x16')](function(_0x537e12){var _0x1b0164=_[_0x544b('0x20')](_0x537e12,'id');var _0x422dc7=[];var _0x4afa02=[];var _0x543e16=squel[_0x544b('0x5d')]();_0x543e16[_0x544b('0x5e')](_0x544b('0x5f'))[_0x544b('0x60')](_0x544b('0x61'),'tq')[_0x544b('0x62')](_0x544b('0x63'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x544b('0x64'),_0x35a7e7[_0x544b('0x2b')]['id']);for(var _0x5375b6=0x0;_0x5375b6<_0x537e12['length'];_0x5375b6+=0x1){let _0x3b8db5=_0x537e12[_0x5375b6];for(var _0x5c06b7=0x0;_0x5c06b7<_0x3b8db5[_0x544b('0x54')][_0x544b('0x31')];_0x5c06b7+=0x1){let _0x2642dd=_0x3b8db5['Agents'][_0x5c06b7];var _0x25c19b=_0x543e16[_0x544b('0x65')]();_0x25c19b['where']('ut.UserId\x20=\x20?',_0x2642dd['id']);_0x4afa02[_0x544b('0x66')](db[_0x544b('0x57')][_0x544b('0x27')](_0x25c19b['toString'](),{'type':db['sequelize']['QueryTypes'][_0x544b('0x67')]})['then'](function(_0x5bd844){if(_0x5bd844[_0x544b('0x31')]===0x1){return _0x2642dd['id'];}else{var _0x38b453=_[_0x544b('0x68')](_[_0x544b('0x20')](_0x5bd844,'TeamId'),function(_0x562472){return _[_0x544b('0x69')](_0x1b0164,_0x562472);});if(_0x38b453){return _0x2642dd['id'];}}}));}}return BPromise[_0x544b('0x6a')](_0x4afa02)['then'](function(_0x3024e4){_0x422dc7=_(_0x422dc7)[_0x544b('0x6b')](_0x3024e4)[_0x544b('0x6c')]()['value']();return db[_0x544b('0x21')][_0x544b('0x34')]({'where':{'id':_0x35a7e7[_0x544b('0x2b')]['id']}})[_0x544b('0x16')](function(_0x2ab161){return db[_0x544b('0x57')][_0x544b('0x58')](function(_0x5d7551){return _0x2ab161[_0x544b('0x5c')](_0x35a7e7['query']['ids'],{'transaction':_0x5d7551})[_0x544b('0x16')](function(){if(!_[_0x544b('0x6d')](_0x422dc7)){return _0x2ab161['removeAgents'](_0x422dc7,{'transaction':_0x5d7551});}})[_0x544b('0x16')](function(){_0x422dc7[_0x544b('0x6e')](function(_0x449078){socket[_0x544b('0x5a')](_0x544b('0x6f'),{'UserId':_0x449078,'ChatQueueId':_0x2ab161['id']});});});});});});})[_0x544b('0x16')](respondWithStatusCode(_0x2d780a,null))[_0x544b('0x2a')](handleError(_0x2d780a,null));};exports['addAgents']=function(_0x465c12,_0x592fd3){return db[_0x544b('0x21')][_0x544b('0x34')]({'where':{'id':_0x465c12['params']['id']}})[_0x544b('0x16')](handleEntityNotFound(_0x592fd3,null))['then'](function(_0x3dcd13){if(_0x3dcd13){return _0x3dcd13[_0x544b('0x70')](_0x465c12[_0x544b('0x36')][_0x544b('0x52')],_[_0x544b('0x71')](_0x465c12['body'],[_0x544b('0x52'),'id'])||{})['spread'](function(_0x23bc4a){for(var _0x518034=0x0;_0x518034<_0x465c12['body']['ids'][_0x544b('0x31')];_0x518034+=0x1){socket[_0x544b('0x5a')](_0x544b('0x5b'),{'UserId':Number(_0x465c12[_0x544b('0x36')][_0x544b('0x52')][_0x518034]),'ChatQueueId':Number(_0x465c12[_0x544b('0x2b')]['id'])});}return _0x23bc4a;});}})[_0x544b('0x16')](respondWithResult(_0x592fd3,null))[_0x544b('0x2a')](handleError(_0x592fd3,null));};exports[_0x544b('0x72')]=function(_0x584fa1,_0x4e1c0b){return db[_0x544b('0x21')]['find']({'where':{'id':_0x584fa1[_0x544b('0x2b')]['id']}})[_0x544b('0x16')](handleEntityNotFound(_0x4e1c0b,null))['then'](function(_0x4bc030){if(_0x4bc030){return _0x4bc030[_0x544b('0x72')](_0x584fa1[_0x544b('0x27')][_0x544b('0x52')])[_0x544b('0x16')](function(){if(_[_0x544b('0x73')](_0x584fa1[_0x544b('0x27')]['ids'])){for(var _0x5eceef=0x0;_0x5eceef<_0x584fa1[_0x544b('0x27')]['ids'][_0x544b('0x31')];_0x5eceef+=0x1){socket['emit'](_0x544b('0x6f'),{'UserId':Number(_0x584fa1['query'][_0x544b('0x52')][_0x5eceef]),'ChatQueueId':Number(_0x584fa1[_0x544b('0x2b')]['id'])});}}else{socket[_0x544b('0x5a')](_0x544b('0x6f'),{'UserId':Number(_0x584fa1[_0x544b('0x27')][_0x544b('0x52')]),'ChatQueueId':Number(_0x584fa1[_0x544b('0x2b')]['id'])});}});}})['then'](respondWithStatusCode(_0x4e1c0b,null))[_0x544b('0x2a')](handleError(_0x4e1c0b,null));};exports[_0x544b('0x74')]=function(_0x1d17e9,_0x1795ee){var _0x2f7cd1={};var _0x1ccdb9={};var _0x137ef5;var _0x50f8ba;return db[_0x544b('0x21')]['findOne']({'where':{'id':_0x1d17e9['params']['id']}})['then'](handleEntityNotFound(_0x1795ee,null))[_0x544b('0x16')](function(_0x16af5f){if(_0x16af5f){_0x137ef5=_0x16af5f;_0x1ccdb9[_0x544b('0x2f')]=_['keys'](db[_0x544b('0x47')][_0x544b('0x22')]);_0x1ccdb9['query']=_[_0x544b('0x2c')](_0x1d17e9[_0x544b('0x27')]);_0x1ccdb9[_0x544b('0x40')]=_[_0x544b('0x2d')](_0x1ccdb9['model'],_0x1ccdb9['query']);_0x2f7cd1['attributes']=_[_0x544b('0x2d')](_0x1ccdb9[_0x544b('0x2f')],qs[_0x544b('0x30')](_0x1d17e9[_0x544b('0x27')][_0x544b('0x30')]));_0x2f7cd1[_0x544b('0x2e')]=_0x2f7cd1[_0x544b('0x2e')][_0x544b('0x31')]?_0x2f7cd1[_0x544b('0x2e')]:_0x1ccdb9[_0x544b('0x2f')];_0x2f7cd1[_0x544b('0x42')]=qs[_0x544b('0x43')](_0x1d17e9[_0x544b('0x27')][_0x544b('0x43')]);_0x2f7cd1['where']=qs[_0x544b('0x40')](_[_0x544b('0x75')](_0x1d17e9['query'],_0x1ccdb9['filters']));if(_0x1d17e9[_0x544b('0x27')][_0x544b('0x46')]){_0x2f7cd1['where']=_[_0x544b('0x32')](_0x2f7cd1[_0x544b('0x44')],{'$or':_[_0x544b('0x20')](_0x2f7cd1[_0x544b('0x2e')],function(_0x163b31){var _0xa6e25c={};_0xa6e25c[_0x163b31]={'$like':'%'+_0x1d17e9[_0x544b('0x27')]['filter']+'%'};return _0xa6e25c;})});}_0x2f7cd1=_[_0x544b('0x32')]({},_0x2f7cd1,_0x1d17e9[_0x544b('0x33')]);return _0x137ef5[_0x544b('0x74')](_0x2f7cd1);}})[_0x544b('0x16')](function(_0x4496a0){if(_0x4496a0){_0x50f8ba=_0x4496a0[_0x544b('0x31')];if(!_0x1d17e9[_0x544b('0x27')]['hasOwnProperty'](_0x544b('0x41'))){_0x2f7cd1[_0x544b('0xf')]=qs[_0x544b('0xf')](_0x1d17e9[_0x544b('0x27')][_0x544b('0xf')]);_0x2f7cd1[_0x544b('0x11')]=qs[_0x544b('0x11')](_0x1d17e9['query']['offset']);}return _0x137ef5['getAgents'](_0x2f7cd1);}})[_0x544b('0x16')](function(_0xf30029){if(_0xf30029){return _0xf30029?{'count':_0x50f8ba,'rows':_0xf30029}:null;}})['then'](respondWithResult(_0x1795ee,null))[_0x544b('0x2a')](handleError(_0x1795ee,null));}; \ No newline at end of file +var _0x3443=['limit','count','Content-Range','update','then','ChatQueues','destroy','sendStatus','error','name','send','index','ChatQueue','fieldName','type','include','query','findAll','rows','catch','show','params','model','keys','rawAttributes','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','get','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','filters','hasOwnProperty','offset','order','sort','where','pick','map','filter','User','agent','chatPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','nolimit','addTeams','ids','Agents','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','QueryTypes','SELECT','every','TeamId','includes','all','isEmpty','removeAgents','userChatQueue:remove','omit','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../config/logger','api','../../mysqldb','redis','localhost','./chatQueue.socket','register','status','end','json'];(function(_0x5a5651,_0x2b60b0){var _0x2582c5=function(_0x52bb86){while(--_0x52bb86){_0x5a5651['push'](_0x5a5651['shift']());}};_0x2582c5(++_0x2b60b0);}(_0x3443,0x1b1));var _0x3344=function(_0x3f2454,_0x34e0ff){_0x3f2454=_0x3f2454-0x0;var _0x29231b=_0x3443[_0x3f2454];return _0x29231b;};'use strict';var BPromise=require(_0x3344('0x0'));var util=require(_0x3344('0x1'));var _=require(_0x3344('0x2'));var squel=require(_0x3344('0x3'));var Redis=require(_0x3344('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x3344('0x5'))(_0x3344('0x6'));var config=require('../../config/environment');var db=require(_0x3344('0x7'))['db'];config[_0x3344('0x8')]=_['defaults'](config[_0x3344('0x8')],{'host':_0x3344('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3344('0x8')]));require(_0x3344('0xa'))[_0x3344('0xb')](socket);function respondWithStatusCode(_0x44c840,_0x4aca79){_0x4aca79=_0x4aca79||0xcc;return function(_0x5b7fa5){if(_0x5b7fa5){return _0x44c840['sendStatus'](_0x4aca79);}return _0x44c840[_0x3344('0xc')](_0x4aca79)[_0x3344('0xd')]();};}function respondWithResult(_0x215e8f,_0x325f01){_0x325f01=_0x325f01||0xc8;return function(_0x5adddf){if(_0x5adddf){return _0x215e8f[_0x3344('0xc')](_0x325f01)[_0x3344('0xe')](_0x5adddf);}};}function respondWithFilteredResult(_0x5bba34,_0x51d312){return function(_0x41f571){if(_0x41f571){var _0x49d8dc=typeof _0x51d312['offset']==='undefined'&&typeof _0x51d312[_0x3344('0xf')]==='undefined';var _0x34d157=_0x41f571[_0x3344('0x10')];var _0x221ef9=_0x49d8dc?0x0:_0x51d312['offset'];var _0x39cc81=_0x49d8dc?_0x41f571[_0x3344('0x10')]:_0x51d312['offset']+_0x51d312[_0x3344('0xf')];var _0x444068;if(_0x39cc81>=_0x34d157){_0x39cc81=_0x34d157;_0x444068=0xc8;}else{_0x444068=0xce;}_0x5bba34[_0x3344('0xc')](_0x444068);return _0x5bba34['set'](_0x3344('0x11'),_0x221ef9+'-'+_0x39cc81+'/'+_0x34d157)[_0x3344('0xe')](_0x41f571);}return null;};}function saveUpdates(_0x4bbf7e){return function(_0x2c828e){if(_0x2c828e){return _0x2c828e[_0x3344('0x12')](_0x4bbf7e)[_0x3344('0x13')](function(_0x1fb2e3){return _0x1fb2e3;});}return null;};}function removeEntity(_0x1e2e9a){return function(_0x4149d5){if(_0x4149d5){return _0x4149d5['destroy']()[_0x3344('0x13')](function(){var _0x3628d3=_0x4149d5['get']({'plain':!![]});var _0x233451=_0x3344('0x14');return db['UserProfileResource'][_0x3344('0x15')]({'where':{'type':_0x233451,'resourceId':_0x3628d3['id']}})[_0x3344('0x13')](function(){return _0x4149d5;});})[_0x3344('0x13')](function(){_0x1e2e9a[_0x3344('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b186a){return function(_0x1003ea){if(!_0x1003ea){_0x5b186a[_0x3344('0x16')](0x194);}return _0x1003ea;};}function handleError(_0x42428d,_0x3ab3b5){_0x3ab3b5=_0x3ab3b5||0x1f4;return function(_0x447cbf){logger[_0x3344('0x17')](_0x447cbf['stack']);if(_0x447cbf[_0x3344('0x18')]){delete _0x447cbf[_0x3344('0x18')];}_0x42428d[_0x3344('0xc')](_0x3ab3b5)[_0x3344('0x19')](_0x447cbf);};}exports[_0x3344('0x1a')]=function(_0x36de1a,_0x263b43){var _0x1e9471={};var _0x17b0a4={'count':0x0,'rows':[]};var _0x26dd46=_['map'](db[_0x3344('0x1b')]['rawAttributes'],function(_0x169e8a){return{'name':_0x169e8a[_0x3344('0x1c')],'type':_0x169e8a[_0x3344('0x1d')]['key']};});_0x1e9471=qs['getOptions'](_0x26dd46,_0x36de1a);var _0x1ea29f={'where':_0x1e9471['where']};return db[_0x3344('0x1b')][_0x3344('0x10')](_0x1ea29f)['then'](function(_0x111569){_0x17b0a4['count']=_0x111569;_0x1e9471['include']=qs[_0x3344('0x1e')](_0x36de1a[_0x3344('0x1f')]);return db[_0x3344('0x1b')][_0x3344('0x20')](_0x1e9471);})['then'](function(_0x523bcd){_0x17b0a4[_0x3344('0x21')]=_0x523bcd;return _0x17b0a4;})[_0x3344('0x13')](respondWithFilteredResult(_0x263b43,_0x1e9471))[_0x3344('0x22')](handleError(_0x263b43,null));};exports[_0x3344('0x23')]=function(_0xa8b4d4,_0x570eec){var _0x3db7a7={'raw':!![],'where':{'id':_0xa8b4d4[_0x3344('0x24')]['id']}},_0x3c50f5={};_0x3c50f5[_0x3344('0x25')]=_[_0x3344('0x26')](db['ChatQueue'][_0x3344('0x27')]);_0x3c50f5[_0x3344('0x1f')]=_[_0x3344('0x26')](_0xa8b4d4[_0x3344('0x1f')]);_0x3c50f5['filters']=_[_0x3344('0x28')](_0x3c50f5[_0x3344('0x25')],_0x3c50f5[_0x3344('0x1f')]);_0x3db7a7[_0x3344('0x29')]=_[_0x3344('0x28')](_0x3c50f5['model'],qs[_0x3344('0x2a')](_0xa8b4d4[_0x3344('0x1f')]['fields']));_0x3db7a7[_0x3344('0x29')]=_0x3db7a7[_0x3344('0x29')][_0x3344('0x2b')]?_0x3db7a7[_0x3344('0x29')]:_0x3c50f5[_0x3344('0x25')];if(_0xa8b4d4[_0x3344('0x1f')][_0x3344('0x2c')]){_0x3db7a7[_0x3344('0x1e')]=[{'all':!![]}];}_0x3db7a7=_[_0x3344('0x2d')]({},_0x3db7a7,_0xa8b4d4[_0x3344('0x2e')]);return db[_0x3344('0x1b')][_0x3344('0x2f')](_0x3db7a7)[_0x3344('0x13')](handleEntityNotFound(_0x570eec,null))[_0x3344('0x13')](respondWithResult(_0x570eec,null))['catch'](handleError(_0x570eec,null));};exports[_0x3344('0x30')]=function(_0x7f0c31,_0x337af9){return db[_0x3344('0x1b')][_0x3344('0x30')](_0x7f0c31[_0x3344('0x31')],{})['then'](function(_0xe5858){var _0xd5ee07=_0x7f0c31['user'][_0x3344('0x32')]({'plain':!![]});if(!_0xd5ee07)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd5ee07['role']===_0x3344('0x33')){var _0x301898=_0xe5858[_0x3344('0x32')]({'plain':!![]});var _0x257dc6=_0x3344('0x14');return db[_0x3344('0x34')]['find']({'where':{'name':_0x257dc6,'userProfileId':_0xd5ee07[_0x3344('0x35')]},'raw':!![]})[_0x3344('0x13')](function(_0x5b4912){if(_0x5b4912&&_0x5b4912[_0x3344('0x36')]===0x0){return db[_0x3344('0x37')][_0x3344('0x30')]({'name':_0x301898['name'],'resourceId':_0x301898['id'],'type':_0x5b4912['name'],'sectionId':_0x5b4912['id']},{})[_0x3344('0x13')](function(){return _0xe5858;});}else{return _0xe5858;}})[_0x3344('0x22')](function(_0x25a5b6){logger[_0x3344('0x17')](_0x3344('0x38'),_0x25a5b6);throw _0x25a5b6;});}return _0xe5858;})[_0x3344('0x13')](respondWithResult(_0x337af9,0xc9))['catch'](handleError(_0x337af9,null));};exports['update']=function(_0x114841,_0x468fdf){if(_0x114841[_0x3344('0x31')]['id']){delete _0x114841[_0x3344('0x31')]['id'];}return db[_0x3344('0x1b')][_0x3344('0x2f')]({'where':{'id':_0x114841[_0x3344('0x24')]['id']}})['then'](handleEntityNotFound(_0x468fdf,null))['then'](saveUpdates(_0x114841[_0x3344('0x31')],null))['then'](respondWithResult(_0x468fdf,null))[_0x3344('0x22')](handleError(_0x468fdf,null));};exports[_0x3344('0x15')]=function(_0x2fc8eb,_0x2d3b5e){return db[_0x3344('0x1b')][_0x3344('0x2f')]({'where':{'id':_0x2fc8eb[_0x3344('0x24')]['id']}})[_0x3344('0x13')](handleEntityNotFound(_0x2d3b5e,null))[_0x3344('0x13')](removeEntity(_0x2d3b5e,null))['catch'](handleError(_0x2d3b5e,null));};exports[_0x3344('0x39')]=function(_0x3f76ec,_0x402328){return db[_0x3344('0x1b')][_0x3344('0x39')]()['then'](respondWithResult(_0x402328,null))['catch'](handleError(_0x402328,null));};exports['getMembers']=function(_0x539b67,_0x47e744){var _0x171c18={'raw':!![],'where':{}},_0x3dc241={},_0x4547fe;return db[_0x3344('0x1b')][_0x3344('0x3a')]({'where':{'id':_0x539b67[_0x3344('0x24')]['id']}})['then'](handleEntityNotFound(_0x47e744,null))[_0x3344('0x13')](function(_0x5d04f9){if(_0x5d04f9){_0x4547fe=_0x5d04f9['get']({'plain':!![]});_0x3dc241['model']=_[_0x3344('0x26')](db[_0x3344('0x3b')][_0x3344('0x27')]);_0x3dc241[_0x3344('0x1f')]=_[_0x3344('0x26')](_0x539b67[_0x3344('0x1f')]);_0x3dc241[_0x3344('0x3c')]=_[_0x3344('0x28')](_0x3dc241['model'],_0x3dc241['query']);_0x171c18[_0x3344('0x29')]=_[_0x3344('0x28')](_0x3dc241[_0x3344('0x25')],qs['fields'](_0x539b67[_0x3344('0x1f')][_0x3344('0x2a')]));_0x171c18[_0x3344('0x29')]=_0x171c18[_0x3344('0x29')][_0x3344('0x2b')]?_0x171c18[_0x3344('0x29')]:_0x3dc241['model'];if(!_0x539b67[_0x3344('0x1f')][_0x3344('0x3d')]('nolimit')){_0x171c18[_0x3344('0xf')]=qs[_0x3344('0xf')](_0x539b67['query'][_0x3344('0xf')]);_0x171c18['offset']=qs[_0x3344('0x3e')](_0x539b67[_0x3344('0x1f')][_0x3344('0x3e')]);}_0x171c18[_0x3344('0x3f')]=qs[_0x3344('0x40')](_0x539b67[_0x3344('0x1f')]['sort']);_0x171c18[_0x3344('0x41')]=qs['filters'](_[_0x3344('0x42')](_0x539b67[_0x3344('0x1f')],_0x3dc241['filters']));_0x171c18[_0x3344('0x41')]['ChatQueueId']=_0x5d04f9['id'];if(_0x539b67[_0x3344('0x1f')]['filter']){_0x171c18['where']=_[_0x3344('0x2d')](_0x171c18['where'],{'$or':_[_0x3344('0x43')](_0x171c18['attributes'],function(_0x340948){var _0x4e1399={};_0x4e1399[_0x340948]={'$like':'%'+_0x539b67[_0x3344('0x1f')][_0x3344('0x44')]+'%'};return _0x4e1399;})});}_0x171c18=_[_0x3344('0x2d')]({},_0x171c18,_0x539b67[_0x3344('0x2e')]);return db[_0x3344('0x3b')][_0x3344('0x20')](_0x171c18);}})['then'](function(_0x5a2615){if(_0x5a2615){return db[_0x3344('0x45')]['findAndCountAll']({'where':{'id':_[_0x3344('0x43')](_0x5a2615,'UserId'),'role':_0x3344('0x46')},'attributes':['id',_0x3344('0x18'),_0x3344('0x47'),'updatedAt','createdAt']});}})[_0x3344('0x13')](function(_0x2c16e2){if(_0x2c16e2){return{'count':_0x2c16e2[_0x3344('0x10')],'rows':_[_0x3344('0x43')](_0x2c16e2[_0x3344('0x21')],function(_0x5e730b){return{'membername':_0x5e730b['name'],'UserId':_0x5e730b['id'],'queue_name':_0x4547fe[_0x3344('0x18')],'ChatQueueId':_0x4547fe['id'],'interface':util[_0x3344('0x48')](_0x3344('0x49'),_0x3344('0x4a'),_0x5e730b[_0x3344('0x18')]),'penalty':0x0,'paused':_0x5e730b[_0x3344('0x47')],'createdAt':_0x5e730b[_0x3344('0x4b')],'updatedAt':_0x5e730b[_0x3344('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3344('0x13')](respondWithFilteredResult(_0x47e744,_0x171c18))[_0x3344('0x22')](handleError(_0x47e744,null));};exports[_0x3344('0x4d')]=function(_0x12ed59,_0x13fe30){var _0xbb5c54={};var _0x4cafe2={};var _0x10c316;var _0x52f092;return db[_0x3344('0x1b')][_0x3344('0x3a')]({'where':{'id':_0x12ed59['params']['id']}})[_0x3344('0x13')](handleEntityNotFound(_0x13fe30,null))[_0x3344('0x13')](function(_0x667468){if(_0x667468){_0x10c316=_0x667468;_0x4cafe2['model']=_[_0x3344('0x26')](db[_0x3344('0x4e')][_0x3344('0x27')]);_0x4cafe2[_0x3344('0x1f')]=_[_0x3344('0x26')](_0x12ed59[_0x3344('0x1f')]);_0x4cafe2[_0x3344('0x3c')]=_['intersection'](_0x4cafe2['model'],_0x4cafe2['query']);_0xbb5c54['attributes']=_[_0x3344('0x28')](_0x4cafe2[_0x3344('0x25')],qs[_0x3344('0x2a')](_0x12ed59[_0x3344('0x1f')][_0x3344('0x2a')]));_0xbb5c54[_0x3344('0x29')]=_0xbb5c54[_0x3344('0x29')][_0x3344('0x2b')]?_0xbb5c54[_0x3344('0x29')]:_0x4cafe2['model'];_0xbb5c54['order']=qs[_0x3344('0x40')](_0x12ed59[_0x3344('0x1f')][_0x3344('0x40')]);_0xbb5c54['where']=qs[_0x3344('0x3c')](_[_0x3344('0x42')](_0x12ed59[_0x3344('0x1f')],_0x4cafe2[_0x3344('0x3c')]));if(_0x12ed59[_0x3344('0x1f')][_0x3344('0x44')]){_0xbb5c54[_0x3344('0x41')]=_[_0x3344('0x2d')](_0xbb5c54[_0x3344('0x41')],{'$or':_[_0x3344('0x43')](_0xbb5c54[_0x3344('0x29')],function(_0x1f1094){var _0x16b842={};_0x16b842[_0x1f1094]={'$like':'%'+_0x12ed59['query'][_0x3344('0x44')]+'%'};return _0x16b842;})});}_0xbb5c54=_[_0x3344('0x2d')]({},_0xbb5c54,_0x12ed59[_0x3344('0x2e')]);return _0x10c316['getTeams'](_0xbb5c54);}})[_0x3344('0x13')](function(_0x311d34){if(_0x311d34){_0x52f092=_0x311d34['length'];if(!_0x12ed59[_0x3344('0x1f')][_0x3344('0x3d')](_0x3344('0x4f'))){_0xbb5c54[_0x3344('0xf')]=qs[_0x3344('0xf')](_0x12ed59[_0x3344('0x1f')][_0x3344('0xf')]);_0xbb5c54['offset']=qs[_0x3344('0x3e')](_0x12ed59[_0x3344('0x1f')]['offset']);}return _0x10c316[_0x3344('0x4d')](_0xbb5c54);}})[_0x3344('0x13')](function(_0xc4466c){if(_0xc4466c){return _0xc4466c?{'count':_0x52f092,'rows':_0xc4466c}:null;}})['then'](respondWithResult(_0x13fe30,null))[_0x3344('0x22')](handleError(_0x13fe30,null));};exports[_0x3344('0x50')]=function(_0x5679b8,_0x926f8b){var _0x241fd4=_0x5679b8['body'][_0x3344('0x51')];return db[_0x3344('0x4e')][_0x3344('0x20')]({'where':{'id':_0x241fd4},'attributes':['id'],'include':[{'model':db[_0x3344('0x45')],'as':_0x3344('0x52'),'attributes':['id','name','online',_0x3344('0x53'),'interface'],'raw':!![]}]})[_0x3344('0x13')](function(_0x5a3a40){if(_0x5a3a40){var _0x4d363c=_[_0x3344('0x54')](_0x5a3a40,function(_0x215f94){var _0x3302ee=_0x215f94[_0x3344('0x32')]({'plain':!![]});return _0x3302ee[_0x3344('0x52')];});return db[_0x3344('0x1b')][_0x3344('0x2f')]({'where':{'id':_0x5679b8[_0x3344('0x24')]['id']}})[_0x3344('0x13')](function(_0x2f211b){return db[_0x3344('0x55')][_0x3344('0x56')](function(_0x2e268a){return _0x2f211b[_0x3344('0x50')](_0x241fd4,{'transaction':_0x2e268a})['then'](function(){return BPromise[_0x3344('0x57')](_0x4d363c,function(_0x24b25e){return db[_0x3344('0x3b')][_0x3344('0x58')]({'where':{'UserId':_0x24b25e['id'],'ChatQueueId':_0x5679b8[_0x3344('0x24')]['id']},'transaction':_0x2e268a});});})['then'](function(){_0x4d363c[_0x3344('0x59')](function(_0x199645){socket[_0x3344('0x5a')](_0x3344('0x5b'),{'UserId':_0x199645['id'],'ChatQueueId':_0x2f211b['id']});});});});});}})['then'](respondWithStatusCode(_0x926f8b,null))[_0x3344('0x22')](handleError(_0x926f8b,null));};exports[_0x3344('0x5c')]=function(_0xbfda64,_0x557ea8){return db['Team'][_0x3344('0x20')]({'where':{'id':_0xbfda64['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3344('0x52'),'attributes':['id'],'raw':!![]}]})[_0x3344('0x13')](handleEntityNotFound(_0x557ea8,null))[_0x3344('0x13')](function(_0x3892e9){var _0x290faa=_[_0x3344('0x43')](_0x3892e9,'id');var _0x18cad3=[];var _0x23d7d8=[];var _0x33083b=squel['select']();_0x33083b['field'](_0x3344('0x5d'))['from']('team_has_chat_queues','tq')[_0x3344('0x5e')](_0x3344('0x5f'),'ut',_0x3344('0x60'))['where'](_0x3344('0x61'),_0xbfda64[_0x3344('0x24')]['id']);for(var _0x22f8d4=0x0;_0x22f8d4<_0x3892e9['length'];_0x22f8d4+=0x1){let _0x2a6540=_0x3892e9[_0x22f8d4];for(var _0x33ce18=0x0;_0x33ce18<_0x2a6540[_0x3344('0x52')][_0x3344('0x2b')];_0x33ce18+=0x1){let _0x83fc04=_0x2a6540[_0x3344('0x52')][_0x33ce18];var _0x40a829=_0x33083b[_0x3344('0x62')]();_0x40a829[_0x3344('0x41')]('ut.UserId\x20=\x20?',_0x83fc04['id']);_0x23d7d8['push'](db['sequelize'][_0x3344('0x1f')](_0x40a829['toString'](),{'type':db['sequelize'][_0x3344('0x63')][_0x3344('0x64')]})[_0x3344('0x13')](function(_0x5ab369){if(_0x5ab369[_0x3344('0x2b')]===0x1){return _0x83fc04['id'];}else{var _0xf29c11=_[_0x3344('0x65')](_[_0x3344('0x43')](_0x5ab369,_0x3344('0x66')),function(_0x17c227){return _[_0x3344('0x67')](_0x290faa,_0x17c227);});if(_0xf29c11){return _0x83fc04['id'];}}}));}}return BPromise[_0x3344('0x68')](_0x23d7d8)['then'](function(_0x198bc2){_0x18cad3=_(_0x18cad3)['union'](_0x198bc2)['compact']()['value']();return db[_0x3344('0x1b')][_0x3344('0x2f')]({'where':{'id':_0xbfda64[_0x3344('0x24')]['id']}})[_0x3344('0x13')](function(_0x41f087){return db['sequelize']['transaction'](function(_0x2c68b2){return _0x41f087[_0x3344('0x5c')](_0xbfda64[_0x3344('0x1f')]['ids'],{'transaction':_0x2c68b2})['then'](function(){if(!_[_0x3344('0x69')](_0x18cad3)){return _0x41f087[_0x3344('0x6a')](_0x18cad3,{'transaction':_0x2c68b2});}})[_0x3344('0x13')](function(){_0x18cad3[_0x3344('0x59')](function(_0x42a344){socket[_0x3344('0x5a')](_0x3344('0x6b'),{'UserId':_0x42a344,'ChatQueueId':_0x41f087['id']});});});});});});})[_0x3344('0x13')](respondWithStatusCode(_0x557ea8,null))[_0x3344('0x22')](handleError(_0x557ea8,null));};exports['addAgents']=function(_0x18e9bf,_0x744478){return db[_0x3344('0x1b')]['find']({'where':{'id':_0x18e9bf[_0x3344('0x24')]['id']}})[_0x3344('0x13')](handleEntityNotFound(_0x744478,null))[_0x3344('0x13')](function(_0x3ba6fb){if(_0x3ba6fb){return _0x3ba6fb['addAgents'](_0x18e9bf[_0x3344('0x31')]['ids'],_[_0x3344('0x6c')](_0x18e9bf[_0x3344('0x31')],[_0x3344('0x51'),'id'])||{})[_0x3344('0x6d')](function(_0x2b4da2){for(var _0x3ea322=0x0;_0x3ea322<_0x18e9bf['body']['ids'][_0x3344('0x2b')];_0x3ea322+=0x1){socket['emit'](_0x3344('0x5b'),{'UserId':Number(_0x18e9bf[_0x3344('0x31')]['ids'][_0x3ea322]),'ChatQueueId':Number(_0x18e9bf[_0x3344('0x24')]['id'])});}return _0x2b4da2;});}})[_0x3344('0x13')](respondWithResult(_0x744478,null))[_0x3344('0x22')](handleError(_0x744478,null));};exports['removeAgents']=function(_0x3a1426,_0xda02fe){return db[_0x3344('0x1b')][_0x3344('0x2f')]({'where':{'id':_0x3a1426[_0x3344('0x24')]['id']}})[_0x3344('0x13')](handleEntityNotFound(_0xda02fe,null))[_0x3344('0x13')](function(_0x1d1226){if(_0x1d1226){return _0x1d1226[_0x3344('0x6a')](_0x3a1426[_0x3344('0x1f')]['ids'])[_0x3344('0x13')](function(){if(_[_0x3344('0x6e')](_0x3a1426['query'][_0x3344('0x51')])){for(var _0x1b181c=0x0;_0x1b181c<_0x3a1426[_0x3344('0x1f')]['ids'][_0x3344('0x2b')];_0x1b181c+=0x1){socket[_0x3344('0x5a')](_0x3344('0x6b'),{'UserId':Number(_0x3a1426[_0x3344('0x1f')][_0x3344('0x51')][_0x1b181c]),'ChatQueueId':Number(_0x3a1426[_0x3344('0x24')]['id'])});}}else{socket[_0x3344('0x5a')](_0x3344('0x6b'),{'UserId':Number(_0x3a1426[_0x3344('0x1f')]['ids']),'ChatQueueId':Number(_0x3a1426[_0x3344('0x24')]['id'])});}});}})[_0x3344('0x13')](respondWithStatusCode(_0xda02fe,null))[_0x3344('0x22')](handleError(_0xda02fe,null));};exports[_0x3344('0x6f')]=function(_0x4af34f,_0x5efa00){var _0x162ead={};var _0xacc607={};var _0x5fab5d;var _0x1058a5;return db['ChatQueue'][_0x3344('0x3a')]({'where':{'id':_0x4af34f[_0x3344('0x24')]['id']}})['then'](handleEntityNotFound(_0x5efa00,null))[_0x3344('0x13')](function(_0x1fe196){if(_0x1fe196){_0x5fab5d=_0x1fe196;_0xacc607['model']=_[_0x3344('0x26')](db['User'][_0x3344('0x27')]);_0xacc607['query']=_[_0x3344('0x26')](_0x4af34f[_0x3344('0x1f')]);_0xacc607[_0x3344('0x3c')]=_[_0x3344('0x28')](_0xacc607['model'],_0xacc607['query']);_0x162ead['attributes']=_[_0x3344('0x28')](_0xacc607[_0x3344('0x25')],qs['fields'](_0x4af34f[_0x3344('0x1f')][_0x3344('0x2a')]));_0x162ead[_0x3344('0x29')]=_0x162ead[_0x3344('0x29')][_0x3344('0x2b')]?_0x162ead[_0x3344('0x29')]:_0xacc607[_0x3344('0x25')];_0x162ead[_0x3344('0x3f')]=qs[_0x3344('0x40')](_0x4af34f[_0x3344('0x1f')]['sort']);_0x162ead[_0x3344('0x41')]=qs[_0x3344('0x3c')](_['pick'](_0x4af34f[_0x3344('0x1f')],_0xacc607[_0x3344('0x3c')]));if(_0x4af34f[_0x3344('0x1f')]['filter']){_0x162ead[_0x3344('0x41')]=_[_0x3344('0x2d')](_0x162ead[_0x3344('0x41')],{'$or':_[_0x3344('0x43')](_0x162ead[_0x3344('0x29')],function(_0x377e73){var _0x1135a3={};_0x1135a3[_0x377e73]={'$like':'%'+_0x4af34f[_0x3344('0x1f')][_0x3344('0x44')]+'%'};return _0x1135a3;})});}_0x162ead=_[_0x3344('0x2d')]({},_0x162ead,_0x4af34f[_0x3344('0x2e')]);return _0x5fab5d[_0x3344('0x6f')](_0x162ead);}})[_0x3344('0x13')](function(_0x294a98){if(_0x294a98){_0x1058a5=_0x294a98[_0x3344('0x2b')];if(!_0x4af34f[_0x3344('0x1f')][_0x3344('0x3d')](_0x3344('0x4f'))){_0x162ead[_0x3344('0xf')]=qs[_0x3344('0xf')](_0x4af34f[_0x3344('0x1f')][_0x3344('0xf')]);_0x162ead[_0x3344('0x3e')]=qs[_0x3344('0x3e')](_0x4af34f[_0x3344('0x1f')][_0x3344('0x3e')]);}return _0x5fab5d[_0x3344('0x6f')](_0x162ead);}})[_0x3344('0x13')](function(_0x3221a0){if(_0x3221a0){return _0x3221a0?{'count':_0x1058a5,'rows':_0x3221a0}:null;}})[_0x3344('0x13')](respondWithResult(_0x5efa00,null))[_0x3344('0x22')](handleError(_0x5efa00,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 307e233..000b286 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 _0x794b=['emit','hook','ChatQueue','setMaxListeners','update'];(function(_0x1f84a4,_0x35f5f4){var _0x174f90=function(_0xa39cd0){while(--_0xa39cd0){_0x1f84a4['push'](_0x1f84a4['shift']());}};_0x174f90(++_0x35f5f4);}(_0x794b,0xa7));var _0xb794=function(_0x24e48a,_0x50a53c){_0x24e48a=_0x24e48a-0x0;var _0x356e3c=_0x794b[_0x24e48a];return _0x356e3c;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0xb794('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb794('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb794('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3f2dc0){return function(_0xa8f38a,_0x261ed7,_0x112b01){ChatQueueEvents[_0xb794('0x3')](_0x3f2dc0+':'+_0xa8f38a['id'],_0xa8f38a);ChatQueueEvents['emit'](_0x3f2dc0,_0xa8f38a);_0x112b01(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xb794('0x4')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x2e30=['emit','hasOwnProperty','exports','update','remove'];(function(_0xbe809,_0x1cf5da){var _0x5b6ef0=function(_0x1e568a){while(--_0x1e568a){_0xbe809['push'](_0xbe809['shift']());}};_0x5b6ef0(++_0x1cf5da);}(_0x2e30,0x1e3));var _0x02e3=function(_0x2779fb,_0x4ffc56){_0x2779fb=_0x2779fb-0x0;var _0x3d63f3=_0x2e30[_0x2779fb];return _0x3d63f3;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x02e3('0x0'),'afterDestroy':_0x02e3('0x1')};function emitEvent(_0xc85bb0){return function(_0x235d0f,_0x290f55,_0x4e04e4){ChatQueueEvents[_0x02e3('0x2')](_0xc85bb0+':'+_0x235d0f['id'],_0x235d0f);ChatQueueEvents['emit'](_0xc85bb0,_0x235d0f);_0x4e04e4(null);};}for(var e in events){if(events[_0x02e3('0x3')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x02e3('0x4')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index fc35ad1..8fbb4d2 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 _0x4abd=['request-promise','path','rimraf','../../config/environment','exports','ChatQueue','chat_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x50506e,_0x3ab243){var _0x92a67a=function(_0x53af20){while(--_0x53af20){_0x50506e['push'](_0x50506e['shift']());}};_0x92a67a(++_0x3ab243);}(_0x4abd,0x103));var _0xd4ab=function(_0x47899b,_0x3a9171){_0x47899b=_0x47899b-0x0;var _0x3cf890=_0x4abd[_0x47899b];return _0x3cf890;};'use strict';var _=require(_0xd4ab('0x0'));var util=require(_0xd4ab('0x1'));var logger=require(_0xd4ab('0x2'))('api');var moment=require(_0xd4ab('0x3'));var BPromise=require(_0xd4ab('0x4'));var rp=require(_0xd4ab('0x5'));var fs=require('fs');var path=require(_0xd4ab('0x6'));var rimraf=require(_0xd4ab('0x7'));var config=require(_0xd4ab('0x8'));var attributes=require('./chatQueue.attributes');module[_0xd4ab('0x9')]=function(_0x25b97c,_0xaafa40){return _0x25b97c['define'](_0xd4ab('0xa'),attributes,{'tableName':_0xd4ab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc4e=['chat_queues','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','ChatQueue'];(function(_0x4df076,_0x482da3){var _0x5e8fed=function(_0x1d0eba){while(--_0x1d0eba){_0x4df076['push'](_0x4df076['shift']());}};_0x5e8fed(++_0x482da3);}(_0xbc4e,0xdd));var _0xebc4=function(_0x3845c1,_0x5090a2){_0x3845c1=_0x3845c1-0x0;var _0x4222f5=_0xbc4e[_0x3845c1];return _0x4222f5;};'use strict';var _=require('lodash');var util=require(_0xebc4('0x0'));var logger=require(_0xebc4('0x1'))(_0xebc4('0x2'));var moment=require('moment');var BPromise=require(_0xebc4('0x3'));var rp=require(_0xebc4('0x4'));var fs=require('fs');var path=require(_0xebc4('0x5'));var rimraf=require(_0xebc4('0x6'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0xebc4('0x7')]=function(_0x5c45e5,_0x5a4756){return _0x5c45e5['define'](_0xebc4('0x8'),attributes,{'tableName':_0xebc4('0x9'),'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 fb4fc4a..de429f6 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 _0xbb84=['socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','findAll','options','where','limit','include','map','model','attributes','GetChatQueue','ShowChatQueue','ChatQueue','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x57835f,_0xf8f644){var _0x3e42da=function(_0x64b95e){while(--_0x64b95e){_0x57835f['push'](_0x57835f['shift']());}};_0x3e42da(++_0xf8f644);}(_0xbb84,0x158));var _0x4bb8=function(_0x408a02,_0x478ca0){_0x408a02=_0x408a02-0x0;var _0x579bce=_0xbb84[_0x408a02];return _0x579bce;};'use strict';var _=require(_0x4bb8('0x0'));var util=require(_0x4bb8('0x1'));var moment=require(_0x4bb8('0x2'));var BPromise=require(_0x4bb8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4bb8('0x4'));var db=require(_0x4bb8('0x5'))['db'];var utils=require(_0x4bb8('0x6'));var logger=require(_0x4bb8('0x7'))(_0x4bb8('0x8'));var config=require(_0x4bb8('0x9'));var jayson=require(_0x4bb8('0xa'));var client=jayson[_0x4bb8('0xb')][_0x4bb8('0xc')]({'port':0x232a});config[_0x4bb8('0xd')]=_[_0x4bb8('0xe')](config[_0x4bb8('0xd')],{'host':_0x4bb8('0xf'),'port':0x18eb});var socket=require(_0x4bb8('0x10'))(new Redis(config[_0x4bb8('0xd')]));require(_0x4bb8('0x11'))[_0x4bb8('0x12')](socket);function respondWithRpcPromise(_0x435072,_0x2f9dec,_0x36aa28){return new BPromise(function(_0x4a3625,_0x4051fa){return client[_0x4bb8('0x13')](_0x435072,_0x36aa28)[_0x4bb8('0x14')](function(_0x12a614){logger[_0x4bb8('0x15')](_0x4bb8('0x16'),_0x2f9dec,'request\x20sent');logger[_0x4bb8('0x17')](_0x4bb8('0x18'),_0x2f9dec,'request\x20sent',JSON[_0x4bb8('0x19')](_0x12a614));if(_0x12a614[_0x4bb8('0x1a')]){if(_0x12a614['error'][_0x4bb8('0x1b')]===0x1f4){logger[_0x4bb8('0x1a')](_0x4bb8('0x16'),_0x2f9dec,_0x12a614['error'][_0x4bb8('0x1c')]);return _0x4051fa(_0x12a614[_0x4bb8('0x1a')]['message']);}logger[_0x4bb8('0x1a')](_0x4bb8('0x16'),_0x2f9dec,_0x12a614[_0x4bb8('0x1a')][_0x4bb8('0x1c')]);return _0x4a3625(_0x12a614[_0x4bb8('0x1a')][_0x4bb8('0x1c')]);}else{logger['info'](_0x4bb8('0x16'),_0x2f9dec,_0x4bb8('0x1d'));_0x4a3625(_0x12a614[_0x4bb8('0x1e')]['message']);}})[_0x4bb8('0x1f')](function(_0xd6bbc6){logger[_0x4bb8('0x1a')]('ChatQueue,\x20%s,\x20%s',_0x2f9dec,_0xd6bbc6);_0x4051fa(_0xd6bbc6);});});}exports['GetChatQueue']=function(_0x5f1f72){var _0x1efb7f=this;return new Promise(function(_0x2245d9,_0x14a2cb){return db['ChatQueue'][_0x4bb8('0x20')]({'raw':_0x5f1f72[_0x4bb8('0x21')]?_0x5f1f72[_0x4bb8('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x5f1f72[_0x4bb8('0x21')]?_0x5f1f72[_0x4bb8('0x21')][_0x4bb8('0x22')]||null:null,'attributes':_0x5f1f72[_0x4bb8('0x21')]?_0x5f1f72['options']['attributes']||null:null,'limit':_0x5f1f72['options']?_0x5f1f72[_0x4bb8('0x21')][_0x4bb8('0x23')]||null:null,'include':_0x5f1f72[_0x4bb8('0x21')]?_0x5f1f72[_0x4bb8('0x21')][_0x4bb8('0x24')]?_[_0x4bb8('0x25')](_0x5f1f72[_0x4bb8('0x21')]['include'],function(_0xeda907){return{'model':db[_0xeda907[_0x4bb8('0x26')]],'as':_0xeda907['as'],'attributes':_0xeda907[_0x4bb8('0x27')],'include':_0xeda907[_0x4bb8('0x24')]?_['map'](_0xeda907[_0x4bb8('0x24')],function(_0x57f3c1){return{'model':db[_0x57f3c1[_0x4bb8('0x26')]],'as':_0x57f3c1['as'],'attributes':_0x57f3c1['attributes'],'include':_0x57f3c1[_0x4bb8('0x24')]?_[_0x4bb8('0x25')](_0x57f3c1[_0x4bb8('0x24')],function(_0x4614f8){return{'model':db[_0x4614f8['model']],'as':_0x4614f8['as'],'attributes':_0x4614f8[_0x4bb8('0x27')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2eb0c7){logger[_0x4bb8('0x15')]('GetChatQueue',_0x5f1f72);logger[_0x4bb8('0x17')](_0x4bb8('0x28'),_0x5f1f72,JSON[_0x4bb8('0x19')](_0x2eb0c7));_0x2245d9(_0x2eb0c7);})[_0x4bb8('0x1f')](function(_0x52975c){logger[_0x4bb8('0x1a')](_0x4bb8('0x28'),_0x52975c['message'],_0x5f1f72);_0x14a2cb(_0x1efb7f[_0x4bb8('0x1a')](0x1f4,_0x52975c[_0x4bb8('0x1c')]));});});};exports[_0x4bb8('0x29')]=function(_0x3b894b){var _0x211a7a=this;return new Promise(function(_0x2b3198,_0x24ae22){return db[_0x4bb8('0x2a')][_0x4bb8('0x2b')]({'raw':_0x3b894b['options']?_0x3b894b['options'][_0x4bb8('0x2c')]===undefined?!![]:![]:!![],'where':_0x3b894b[_0x4bb8('0x21')]?_0x3b894b[_0x4bb8('0x21')][_0x4bb8('0x22')]||null:null,'attributes':_0x3b894b[_0x4bb8('0x21')]?_0x3b894b[_0x4bb8('0x21')][_0x4bb8('0x27')]||null:null,'include':_0x3b894b[_0x4bb8('0x21')]?_0x3b894b['options'][_0x4bb8('0x24')]?_[_0x4bb8('0x25')](_0x3b894b[_0x4bb8('0x21')][_0x4bb8('0x24')],function(_0x3c32cf){return{'model':db[_0x3c32cf[_0x4bb8('0x26')]],'as':_0x3c32cf['as'],'attributes':_0x3c32cf[_0x4bb8('0x27')],'include':_0x3c32cf['include']?_[_0x4bb8('0x25')](_0x3c32cf['include'],function(_0x29b9f6){return{'model':db[_0x29b9f6['model']],'as':_0x29b9f6['as'],'attributes':_0x29b9f6[_0x4bb8('0x27')],'include':_0x29b9f6[_0x4bb8('0x24')]?_['map'](_0x29b9f6['include'],function(_0x187e61){return{'model':db[_0x187e61[_0x4bb8('0x26')]],'as':_0x187e61['as'],'attributes':_0x187e61['attributes']};}):[]};}):[]};}):[]:[]})[_0x4bb8('0x14')](function(_0x274e6d){logger['info'](_0x4bb8('0x29'),_0x3b894b);logger[_0x4bb8('0x17')]('ShowChatQueue',_0x3b894b,JSON[_0x4bb8('0x19')](_0x274e6d));_0x2b3198(_0x274e6d);})[_0x4bb8('0x1f')](function(_0x400ce3){logger[_0x4bb8('0x1a')](_0x4bb8('0x29'),_0x400ce3[_0x4bb8('0x1c')],_0x3b894b);_0x24ae22(_0x211a7a[_0x4bb8('0x1a')](0x1f4,_0x400ce3[_0x4bb8('0x1c')]));});});}; \ No newline at end of file +var _0x9fda=['request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue','findAll','options','where','attributes','limit','include','map','model','stringify','catch','ShowChatQueue','ChatQueue','find','raw','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','then','info'];(function(_0x44b7e7,_0x5b9902){var _0x11ed08=function(_0x3dc71c){while(--_0x3dc71c){_0x44b7e7['push'](_0x44b7e7['shift']());}};_0x11ed08(++_0x5b9902);}(_0x9fda,0x8c));var _0xa9fd=function(_0x1482b5,_0x259774){_0x1482b5=_0x1482b5-0x0;var _0x464db2=_0x9fda[_0x1482b5];return _0x464db2;};'use strict';var _=require(_0xa9fd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa9fd('0x1'));var rs=require(_0xa9fd('0x2'));var fs=require('fs');var Redis=require(_0xa9fd('0x3'));var db=require(_0xa9fd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa9fd('0x5'))(_0xa9fd('0x6'));var config=require('../../config/environment');var jayson=require(_0xa9fd('0x7'));var client=jayson[_0xa9fd('0x8')]['http']({'port':0x232a});config['redis']=_[_0xa9fd('0x9')](config[_0xa9fd('0xa')],{'host':_0xa9fd('0xb'),'port':0x18eb});var socket=require(_0xa9fd('0xc'))(new Redis(config[_0xa9fd('0xa')]));require('./chatQueue.socket')[_0xa9fd('0xd')](socket);function respondWithRpcPromise(_0x17c068,_0x32c4d2,_0x5d7915){return new BPromise(function(_0xe1b24b,_0x4a850d){return client['request'](_0x17c068,_0x5d7915)[_0xa9fd('0xe')](function(_0xa68009){logger[_0xa9fd('0xf')]('ChatQueue,\x20%s,\x20%s',_0x32c4d2,_0xa9fd('0x10'));logger[_0xa9fd('0x11')](_0xa9fd('0x12'),_0x32c4d2,_0xa9fd('0x10'),JSON['stringify'](_0xa68009));if(_0xa68009[_0xa9fd('0x13')]){if(_0xa68009[_0xa9fd('0x13')][_0xa9fd('0x14')]===0x1f4){logger[_0xa9fd('0x13')](_0xa9fd('0x15'),_0x32c4d2,_0xa68009[_0xa9fd('0x13')][_0xa9fd('0x16')]);return _0x4a850d(_0xa68009[_0xa9fd('0x13')]['message']);}logger[_0xa9fd('0x13')](_0xa9fd('0x15'),_0x32c4d2,_0xa68009['error']['message']);return _0xe1b24b(_0xa68009[_0xa9fd('0x13')][_0xa9fd('0x16')]);}else{logger[_0xa9fd('0xf')](_0xa9fd('0x15'),_0x32c4d2,_0xa9fd('0x10'));_0xe1b24b(_0xa68009[_0xa9fd('0x17')][_0xa9fd('0x16')]);}})['catch'](function(_0x48bb74){logger[_0xa9fd('0x13')](_0xa9fd('0x15'),_0x32c4d2,_0x48bb74);_0x4a850d(_0x48bb74);});});}exports[_0xa9fd('0x18')]=function(_0x3247ac){var _0x3940e3=this;return new Promise(function(_0x3560b6,_0x7c1572){return db['ChatQueue'][_0xa9fd('0x19')]({'raw':_0x3247ac['options']?_0x3247ac['options']['raw']===undefined?!![]:![]:!![],'where':_0x3247ac['options']?_0x3247ac[_0xa9fd('0x1a')][_0xa9fd('0x1b')]||null:null,'attributes':_0x3247ac[_0xa9fd('0x1a')]?_0x3247ac[_0xa9fd('0x1a')][_0xa9fd('0x1c')]||null:null,'limit':_0x3247ac['options']?_0x3247ac[_0xa9fd('0x1a')][_0xa9fd('0x1d')]||null:null,'include':_0x3247ac['options']?_0x3247ac[_0xa9fd('0x1a')][_0xa9fd('0x1e')]?_[_0xa9fd('0x1f')](_0x3247ac[_0xa9fd('0x1a')][_0xa9fd('0x1e')],function(_0x177eba){return{'model':db[_0x177eba[_0xa9fd('0x20')]],'as':_0x177eba['as'],'attributes':_0x177eba[_0xa9fd('0x1c')],'include':_0x177eba[_0xa9fd('0x1e')]?_[_0xa9fd('0x1f')](_0x177eba[_0xa9fd('0x1e')],function(_0x31c216){return{'model':db[_0x31c216[_0xa9fd('0x20')]],'as':_0x31c216['as'],'attributes':_0x31c216[_0xa9fd('0x1c')],'include':_0x31c216[_0xa9fd('0x1e')]?_[_0xa9fd('0x1f')](_0x31c216[_0xa9fd('0x1e')],function(_0x517a16){return{'model':db[_0x517a16[_0xa9fd('0x20')]],'as':_0x517a16['as'],'attributes':_0x517a16[_0xa9fd('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa9fd('0xe')](function(_0x5cb7b4){logger[_0xa9fd('0xf')](_0xa9fd('0x18'),_0x3247ac);logger[_0xa9fd('0x11')](_0xa9fd('0x18'),_0x3247ac,JSON[_0xa9fd('0x21')](_0x5cb7b4));_0x3560b6(_0x5cb7b4);})[_0xa9fd('0x22')](function(_0x34480a){logger['error'](_0xa9fd('0x18'),_0x34480a[_0xa9fd('0x16')],_0x3247ac);_0x7c1572(_0x3940e3[_0xa9fd('0x13')](0x1f4,_0x34480a['message']));});});};exports[_0xa9fd('0x23')]=function(_0x151ee8){var _0x45d0fd=this;return new Promise(function(_0x189b77,_0x4e7608){return db[_0xa9fd('0x24')][_0xa9fd('0x25')]({'raw':_0x151ee8[_0xa9fd('0x1a')]?_0x151ee8[_0xa9fd('0x1a')][_0xa9fd('0x26')]===undefined?!![]:![]:!![],'where':_0x151ee8[_0xa9fd('0x1a')]?_0x151ee8['options']['where']||null:null,'attributes':_0x151ee8[_0xa9fd('0x1a')]?_0x151ee8[_0xa9fd('0x1a')][_0xa9fd('0x1c')]||null:null,'include':_0x151ee8[_0xa9fd('0x1a')]?_0x151ee8['options'][_0xa9fd('0x1e')]?_['map'](_0x151ee8['options']['include'],function(_0x1c8989){return{'model':db[_0x1c8989[_0xa9fd('0x20')]],'as':_0x1c8989['as'],'attributes':_0x1c8989['attributes'],'include':_0x1c8989[_0xa9fd('0x1e')]?_[_0xa9fd('0x1f')](_0x1c8989[_0xa9fd('0x1e')],function(_0x469c8a){return{'model':db[_0x469c8a[_0xa9fd('0x20')]],'as':_0x469c8a['as'],'attributes':_0x469c8a['attributes'],'include':_0x469c8a['include']?_['map'](_0x469c8a[_0xa9fd('0x1e')],function(_0x1def7e){return{'model':db[_0x1def7e['model']],'as':_0x1def7e['as'],'attributes':_0x1def7e['attributes']};}):[]};}):[]};}):[]:[]})[_0xa9fd('0xe')](function(_0x16d098){logger[_0xa9fd('0xf')](_0xa9fd('0x23'),_0x151ee8);logger[_0xa9fd('0x11')](_0xa9fd('0x23'),_0x151ee8,JSON[_0xa9fd('0x21')](_0x16d098));_0x189b77(_0x16d098);})[_0xa9fd('0x22')](function(_0x379afd){logger[_0xa9fd('0x13')](_0xa9fd('0x23'),_0x379afd[_0xa9fd('0x16')],_0x151ee8);_0x4e7608(_0x45d0fd['error'](0x1f4,_0x379afd[_0xa9fd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 05fa22f..083010e 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 _0x9bde=['chatQueue:','save','update','emit','removeListener','register','length'];(function(_0x5538d5,_0x190032){var _0x323b1a=function(_0x179caa){while(--_0x179caa){_0x5538d5['push'](_0x5538d5['shift']());}};_0x323b1a(++_0x190032);}(_0x9bde,0xe1));var _0xe9bd=function(_0x376126,_0x88d3d0){_0x376126=_0x376126-0x0;var _0x439903=_0x9bde[_0x376126];return _0x439903;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe9bd('0x0'),'remove',_0xe9bd('0x1')];function createListener(_0x4c63ca,_0x51786f){return function(_0x3005aa){_0x51786f[_0xe9bd('0x2')](_0x4c63ca,_0x3005aa);};}function removeListener(_0x1c1b34,_0x10822d){return function(){ChatQueueEvents[_0xe9bd('0x3')](_0x1c1b34,_0x10822d);};}exports[_0xe9bd('0x4')]=function(_0x4fd7b8){for(var _0x4763e9=0x0,_0x5f18fe=events[_0xe9bd('0x5')];_0x4763e9<_0x5f18fe;_0x4763e9++){var _0xa66ae2=events[_0x4763e9];var _0x2d5c75=createListener(_0xe9bd('0x6')+_0xa66ae2,_0x4fd7b8);ChatQueueEvents['on'](_0xa66ae2,_0x2d5c75);}}; \ No newline at end of file +var _0x34e8=['register','length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0x34e8,0x12c));var _0x834e=function(_0x30ca15,_0x5e4f04){_0x30ca15=_0x30ca15-0x0;var _0x30ed77=_0x34e8[_0x30ca15];return _0x30ed77;};'use strict';var ChatQueueEvents=require(_0x834e('0x0'));var events=[_0x834e('0x1'),_0x834e('0x2'),_0x834e('0x3')];function createListener(_0x530939,_0x832422){return function(_0x21e2e0){_0x832422[_0x834e('0x4')](_0x530939,_0x21e2e0);};}function removeListener(_0x31bf20,_0x289ef2){return function(){ChatQueueEvents[_0x834e('0x5')](_0x31bf20,_0x289ef2);};}exports[_0x834e('0x6')]=function(_0x4a2018){for(var _0x858aa1=0x0,_0x52056d=events[_0x834e('0x7')];_0x858aa1<_0x52056d;_0x858aa1++){var _0x3cc2e3=events[_0x858aa1];var _0x3a3ef6=createListener(_0x834e('0x8')+_0x3cc2e3,_0x4a2018);ChatQueueEvents['on'](_0x3cc2e3,_0x3a3ef6);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 72aa0d6..715e2b3 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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x5a7bf4,_0x5120f6){var _0x4652db=function(_0x54cfbc){while(--_0x54cfbc){_0x5a7bf4['push'](_0x5a7bf4['shift']());}};_0x4652db(++_0x5120f6);}(_0xe14b,0x93));var _0xbe14=function(_0x14b803,_0x5db31c){_0x14b803=_0x14b803-0x0;var _0x4040d9=_0xe14b[_0x14b803];return _0x4040d9;};'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['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=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(_0x3de556,_0x4151ae){var _0x48302d=function(_0x30fd38){while(--_0x30fd38){_0x3de556['push'](_0x3de556['shift']());}};_0x48302d(++_0x4151ae);}(_0x7217,0x19e));var _0x7721=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x7217[_0x38a7ac];return _0x53061a;};'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 8ac2ecf..ad7fbdd 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 _0xaf2d=['STRING','DATE','sequelize'];(function(_0x727854,_0x325cc1){var _0x58b5db=function(_0x5d1587){while(--_0x5d1587){_0x727854['push'](_0x727854['shift']());}};_0x58b5db(++_0x325cc1);}(_0xaf2d,0xbc));var _0xdaf2=function(_0x31e52c,_0xd7d992){_0x31e52c=_0x31e52c-0x0;var _0x4b6887=_0xaf2d[_0x31e52c];return _0x4b6887;};'use strict';var moment=require('moment');var Sequelize=require(_0xdaf2('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xdaf2('0x1')]},'joinAt':{'type':Sequelize[_0xdaf2('0x2')]},'leaveAt':{'type':Sequelize[_0xdaf2('0x2')]},'acceptAt':{'type':Sequelize[_0xdaf2('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xdaf2('0x1')]}}; \ No newline at end of file +var _0xcc0e=['moment','exports','STRING','DATE'];(function(_0x501e90,_0x1e8f51){var _0x5dd09c=function(_0x5f3072){while(--_0x5f3072){_0x501e90['push'](_0x501e90['shift']());}};_0x5dd09c(++_0x1e8f51);}(_0xcc0e,0x8c));var _0xecc0=function(_0x17eb18,_0x927702){_0x17eb18=_0x17eb18-0x0;var _0x46516f=_0xcc0e[_0x17eb18];return _0x46516f;};'use strict';var moment=require(_0xecc0('0x0'));var Sequelize=require('sequelize');module[_0xecc0('0x1')]={'uniqueid':{'type':Sequelize[_0xecc0('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xecc0('0x2')]},'joinAt':{'type':Sequelize[_0xecc0('0x3')]},'leaveAt':{'type':Sequelize[_0xecc0('0x3')]},'acceptAt':{'type':Sequelize[_0xecc0('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xecc0('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index cdb501e..2dc1f68 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 _0x9851=['rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','order','sort','where','VIRTUAL','filter','merge','options','rows','show','params','keys','length','includeAll','include','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','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','../../mysqldb','sendStatus','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','status','send','index','ChatQueueReport'];(function(_0x27bb91,_0x104800){var _0x53e32b=function(_0x5d4a3c){while(--_0x5d4a3c){_0x27bb91['push'](_0x27bb91['shift']());}};_0x53e32b(++_0x104800);}(_0x9851,0x1f1));var _0x1985=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9851[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x1985('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1985('0x1'));var jsonpatch=require(_0x1985('0x2'));var rp=require(_0x1985('0x3'));var moment=require(_0x1985('0x4'));var BPromise=require(_0x1985('0x5'));var Mustache=require(_0x1985('0x6'));var util=require(_0x1985('0x7'));var path=require(_0x1985('0x8'));var sox=require(_0x1985('0x9'));var csv=require(_0x1985('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1985('0xb'));var _=require(_0x1985('0xc'));var squel=require(_0x1985('0xd'));var crypto=require('crypto');var jsforce=require(_0x1985('0xe'));var deskjs=require(_0x1985('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1985('0x10'));var Papa=require('papaparse');var Redis=require(_0x1985('0x11'));var authService=require(_0x1985('0x12'));var qs=require(_0x1985('0x13'));var as=require(_0x1985('0x14'));var hardwareService=require(_0x1985('0x15'));var logger=require(_0x1985('0x16'))(_0x1985('0x17'));var utils=require(_0x1985('0x18'));var config=require(_0x1985('0x19'));var licenseUtil=require(_0x1985('0x1a'));var db=require(_0x1985('0x1b'))['db'];function respondWithStatusCode(_0x10e96b,_0x50f28f){_0x50f28f=_0x50f28f||0xcc;return function(_0x262ff9){if(_0x262ff9){return _0x10e96b[_0x1985('0x1c')](_0x50f28f);}return _0x10e96b['status'](_0x50f28f)['end']();};}function respondWithResult(_0x4cdde9,_0xacb40f){_0xacb40f=_0xacb40f||0xc8;return function(_0x3a8db7){if(_0x3a8db7){return _0x4cdde9['status'](_0xacb40f)[_0x1985('0x1d')](_0x3a8db7);}};}function respondWithFilteredResult(_0x324644,_0x131884){return function(_0x49ec6e){if(_0x49ec6e){var _0xbe7245=typeof _0x131884['offset']===_0x1985('0x1e')&&typeof _0x131884['limit']===_0x1985('0x1e');var _0x51b4f4=_0x49ec6e[_0x1985('0x1f')];var _0x2c7279=_0xbe7245?0x0:_0x131884[_0x1985('0x20')];var _0x433a33=_0xbe7245?_0x49ec6e[_0x1985('0x1f')]:_0x131884[_0x1985('0x20')]+_0x131884[_0x1985('0x21')];var _0x112913;if(_0x433a33>=_0x51b4f4){_0x433a33=_0x51b4f4;_0x112913=0xc8;}else{_0x112913=0xce;}_0x324644['status'](_0x112913);return _0x324644[_0x1985('0x22')](_0x1985('0x23'),_0x2c7279+'-'+_0x433a33+'/'+_0x51b4f4)['json'](_0x49ec6e);}return null;};}function patchUpdates(_0x417bf7){return function(_0x17aa33){try{jsonpatch[_0x1985('0x24')](_0x17aa33,_0x417bf7,!![]);}catch(_0x435422){return BPromise[_0x1985('0x25')](_0x435422);}return _0x17aa33[_0x1985('0x26')]();};}function saveUpdates(_0xb73151,_0x290c1a){return function(_0x2e648a){if(_0x2e648a){return _0x2e648a[_0x1985('0x27')](_0xb73151)[_0x1985('0x28')](function(_0x5506a7){return _0x5506a7;});}return null;};}function removeEntity(_0xeac967,_0x6d7358){return function(_0x42889c){if(_0x42889c){return _0x42889c[_0x1985('0x29')]()[_0x1985('0x28')](function(){_0xeac967['status'](0xcc)[_0x1985('0x2a')]();});}};}function handleEntityNotFound(_0x17ffe2,_0x452e15){return function(_0x1ed802){if(!_0x1ed802){_0x17ffe2['sendStatus'](0x194);}return _0x1ed802;};}function handleError(_0xa9578,_0x36e919){_0x36e919=_0x36e919||0x1f4;return function(_0x3ea584){logger[_0x1985('0x2b')](_0x3ea584['stack']);if(_0x3ea584['name']){delete _0x3ea584[_0x1985('0x2c')];}_0xa9578[_0x1985('0x2d')](_0x36e919)[_0x1985('0x2e')](_0x3ea584);};}exports[_0x1985('0x2f')]=function(_0x518449,_0x3ad278){var _0x51a226={},_0x5ed429={},_0x20bd30={'count':0x0,'rows':[]};var _0x488e9c=_['map'](db[_0x1985('0x30')][_0x1985('0x31')],function(_0x1e7701){return{'name':_0x1e7701[_0x1985('0x32')],'type':_0x1e7701['type'][_0x1985('0x33')]};});_0x5ed429[_0x1985('0x34')]=_[_0x1985('0x35')](_0x488e9c,_0x1985('0x2c'));_0x5ed429[_0x1985('0x36')]=_['keys'](_0x518449[_0x1985('0x36')]);_0x5ed429[_0x1985('0x37')]=_[_0x1985('0x38')](_0x5ed429[_0x1985('0x34')],_0x5ed429[_0x1985('0x36')]);_0x51a226[_0x1985('0x39')]=_['intersection'](_0x5ed429[_0x1985('0x34')],qs[_0x1985('0x3a')](_0x518449[_0x1985('0x36')][_0x1985('0x3a')]));_0x51a226['attributes']=_0x51a226[_0x1985('0x39')]['length']?_0x51a226['attributes']:_0x5ed429[_0x1985('0x34')];if(!_0x518449[_0x1985('0x36')]['hasOwnProperty']('nolimit')){_0x51a226[_0x1985('0x21')]=qs[_0x1985('0x21')](_0x518449[_0x1985('0x36')][_0x1985('0x21')]);_0x51a226[_0x1985('0x20')]=qs[_0x1985('0x20')](_0x518449[_0x1985('0x36')][_0x1985('0x20')]);}_0x51a226[_0x1985('0x3b')]=qs[_0x1985('0x3c')](_0x518449[_0x1985('0x36')]['sort']);_0x51a226[_0x1985('0x3d')]=qs['filters'](_['pick'](_0x518449['query'],_0x5ed429[_0x1985('0x37')]),_0x488e9c);if(_0x518449[_0x1985('0x36')]['filter']){_0x51a226[_0x1985('0x3d')]=_['merge'](_0x51a226[_0x1985('0x3d')],{'$or':_[_0x1985('0x35')](_0x488e9c,function(_0x1fc3b3){if(_0x1fc3b3['type']!==_0x1985('0x3e')){var _0x5aecab={};_0x5aecab[_0x1fc3b3[_0x1985('0x2c')]]={'$like':'%'+_0x518449['query'][_0x1985('0x3f')]+'%'};return _0x5aecab;}})});}_0x51a226=_[_0x1985('0x40')]({},_0x51a226,_0x518449[_0x1985('0x41')]);var _0x2ae405={'where':_0x51a226[_0x1985('0x3d')]};return db['ChatQueueReport'][_0x1985('0x1f')](_0x2ae405)[_0x1985('0x28')](function(_0x19a114){_0x20bd30[_0x1985('0x1f')]=_0x19a114;if(_0x518449[_0x1985('0x36')]['includeAll']){_0x51a226['include']=[{'all':!![]}];}return db[_0x1985('0x30')]['findAll'](_0x51a226);})[_0x1985('0x28')](function(_0x38fc14){_0x20bd30[_0x1985('0x42')]=_0x38fc14;return _0x20bd30;})['then'](respondWithFilteredResult(_0x3ad278,_0x51a226))['catch'](handleError(_0x3ad278,null));};exports[_0x1985('0x43')]=function(_0x4736ad,_0x181abf){var _0x5486b7={'raw':!![],'where':{'id':_0x4736ad[_0x1985('0x44')]['id']}},_0x537f6e={};_0x537f6e[_0x1985('0x34')]=_[_0x1985('0x45')](db[_0x1985('0x30')][_0x1985('0x31')]);_0x537f6e[_0x1985('0x36')]=_[_0x1985('0x45')](_0x4736ad[_0x1985('0x36')]);_0x537f6e[_0x1985('0x37')]=_[_0x1985('0x38')](_0x537f6e[_0x1985('0x34')],_0x537f6e[_0x1985('0x36')]);_0x5486b7[_0x1985('0x39')]=_[_0x1985('0x38')](_0x537f6e[_0x1985('0x34')],qs[_0x1985('0x3a')](_0x4736ad['query']['fields']));_0x5486b7['attributes']=_0x5486b7[_0x1985('0x39')][_0x1985('0x46')]?_0x5486b7[_0x1985('0x39')]:_0x537f6e['model'];if(_0x4736ad[_0x1985('0x36')][_0x1985('0x47')]){_0x5486b7[_0x1985('0x48')]=[{'all':!![]}];}_0x5486b7=_['merge']({},_0x5486b7,_0x4736ad['options']);return db['ChatQueueReport']['find'](_0x5486b7)[_0x1985('0x28')](handleEntityNotFound(_0x181abf,null))[_0x1985('0x28')](respondWithResult(_0x181abf,null))[_0x1985('0x49')](handleError(_0x181abf,null));};exports[_0x1985('0x4a')]=function(_0x26dbee,_0x32cf0c){return db['ChatQueueReport']['create'](_0x26dbee['body'],{})[_0x1985('0x28')](respondWithResult(_0x32cf0c,0xc9))[_0x1985('0x49')](handleError(_0x32cf0c,null));};exports[_0x1985('0x27')]=function(_0x3be6b2,_0x434e52){if(_0x3be6b2[_0x1985('0x4b')]['id']){delete _0x3be6b2[_0x1985('0x4b')]['id'];}return db[_0x1985('0x30')][_0x1985('0x4c')]({'where':{'id':_0x3be6b2[_0x1985('0x44')]['id']}})[_0x1985('0x28')](handleEntityNotFound(_0x434e52,null))['then'](saveUpdates(_0x3be6b2[_0x1985('0x4b')],null))['then'](respondWithResult(_0x434e52,null))[_0x1985('0x49')](handleError(_0x434e52,null));};exports[_0x1985('0x29')]=function(_0x4e1e39,_0x423541){return db[_0x1985('0x30')][_0x1985('0x4c')]({'where':{'id':_0x4e1e39[_0x1985('0x44')]['id']}})[_0x1985('0x28')](handleEntityNotFound(_0x423541,null))[_0x1985('0x28')](removeEntity(_0x423541,null))[_0x1985('0x49')](handleError(_0x423541,null));};exports[_0x1985('0x4d')]=function(_0x4b61cb,_0x31f375){return db[_0x1985('0x30')]['describe']()[_0x1985('0x28')](respondWithResult(_0x31f375,null))[_0x1985('0x49')](handleError(_0x31f375,null));}; \ No newline at end of file +var _0xee9c=['rawAttributes','create','find','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xee9c,0x1e6));var _0xcee9=function(_0x457b64,_0x49a219){_0x457b64=_0x457b64-0x0;var _0x437111=_0xee9c[_0x457b64];return _0x437111;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcee9('0x0'));var zipdir=require(_0xcee9('0x1'));var jsonpatch=require(_0xcee9('0x2'));var rp=require(_0xcee9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcee9('0x4'));var util=require(_0xcee9('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xcee9('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcee9('0x7'));var _=require(_0xcee9('0x8'));var squel=require(_0xcee9('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcee9('0xa'));var toCsv=require(_0xcee9('0x6'));var querystring=require('querystring');var Papa=require(_0xcee9('0xb'));var Redis=require(_0xcee9('0xc'));var authService=require(_0xcee9('0xd'));var qs=require(_0xcee9('0xe'));var as=require(_0xcee9('0xf'));var hardwareService=require(_0xcee9('0x10'));var logger=require('../../config/logger')(_0xcee9('0x11'));var utils=require(_0xcee9('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xcee9('0x13'));var db=require(_0xcee9('0x14'))['db'];function respondWithStatusCode(_0x2df879,_0x562f74){_0x562f74=_0x562f74||0xcc;return function(_0x1ed4fc){if(_0x1ed4fc){return _0x2df879[_0xcee9('0x15')](_0x562f74);}return _0x2df879[_0xcee9('0x16')](_0x562f74)[_0xcee9('0x17')]();};}function respondWithResult(_0x1d93a2,_0x4a0125){_0x4a0125=_0x4a0125||0xc8;return function(_0x5e9930){if(_0x5e9930){return _0x1d93a2[_0xcee9('0x16')](_0x4a0125)[_0xcee9('0x18')](_0x5e9930);}};}function respondWithFilteredResult(_0x2558a2,_0x1eb62c){return function(_0x3a513f){if(_0x3a513f){var _0x1e3790=typeof _0x1eb62c[_0xcee9('0x19')]===_0xcee9('0x1a')&&typeof _0x1eb62c[_0xcee9('0x1b')]===_0xcee9('0x1a');var _0x1eec39=_0x3a513f[_0xcee9('0x1c')];var _0x552ca1=_0x1e3790?0x0:_0x1eb62c[_0xcee9('0x19')];var _0x414032=_0x1e3790?_0x3a513f[_0xcee9('0x1c')]:_0x1eb62c[_0xcee9('0x19')]+_0x1eb62c[_0xcee9('0x1b')];var _0x492fd6;if(_0x414032>=_0x1eec39){_0x414032=_0x1eec39;_0x492fd6=0xc8;}else{_0x492fd6=0xce;}_0x2558a2[_0xcee9('0x16')](_0x492fd6);return _0x2558a2[_0xcee9('0x1d')](_0xcee9('0x1e'),_0x552ca1+'-'+_0x414032+'/'+_0x1eec39)[_0xcee9('0x18')](_0x3a513f);}return null;};}function patchUpdates(_0x580b06){return function(_0x932166){try{jsonpatch[_0xcee9('0x1f')](_0x932166,_0x580b06,!![]);}catch(_0x4e5a1a){return BPromise['reject'](_0x4e5a1a);}return _0x932166[_0xcee9('0x20')]();};}function saveUpdates(_0x1c90b2,_0x146018){return function(_0x49afe8){if(_0x49afe8){return _0x49afe8[_0xcee9('0x21')](_0x1c90b2)[_0xcee9('0x22')](function(_0x39956f){return _0x39956f;});}return null;};}function removeEntity(_0x57b548,_0x2c219){return function(_0x5c1250){if(_0x5c1250){return _0x5c1250[_0xcee9('0x23')]()[_0xcee9('0x22')](function(){_0x57b548[_0xcee9('0x16')](0xcc)[_0xcee9('0x17')]();});}};}function handleEntityNotFound(_0xef4b0a,_0x3ce813){return function(_0x1c8d26){if(!_0x1c8d26){_0xef4b0a[_0xcee9('0x15')](0x194);}return _0x1c8d26;};}function handleError(_0x26d277,_0x2ec6ca){_0x2ec6ca=_0x2ec6ca||0x1f4;return function(_0x4cc9a1){logger['error'](_0x4cc9a1[_0xcee9('0x24')]);if(_0x4cc9a1['name']){delete _0x4cc9a1[_0xcee9('0x25')];}_0x26d277[_0xcee9('0x16')](_0x2ec6ca)[_0xcee9('0x26')](_0x4cc9a1);};}exports[_0xcee9('0x27')]=function(_0x5911bf,_0x277262){var _0x22efee={},_0x3e88cd={},_0x4c4d51={'count':0x0,'rows':[]};var _0x3d3027=_[_0xcee9('0x28')](db[_0xcee9('0x29')]['rawAttributes'],function(_0x6a9aa8){return{'name':_0x6a9aa8[_0xcee9('0x2a')],'type':_0x6a9aa8[_0xcee9('0x2b')][_0xcee9('0x2c')]};});_0x3e88cd['model']=_[_0xcee9('0x28')](_0x3d3027,_0xcee9('0x25'));_0x3e88cd['query']=_[_0xcee9('0x2d')](_0x5911bf[_0xcee9('0x2e')]);_0x3e88cd[_0xcee9('0x2f')]=_[_0xcee9('0x30')](_0x3e88cd['model'],_0x3e88cd['query']);_0x22efee[_0xcee9('0x31')]=_[_0xcee9('0x30')](_0x3e88cd[_0xcee9('0x32')],qs[_0xcee9('0x33')](_0x5911bf[_0xcee9('0x2e')][_0xcee9('0x33')]));_0x22efee[_0xcee9('0x31')]=_0x22efee['attributes'][_0xcee9('0x34')]?_0x22efee[_0xcee9('0x31')]:_0x3e88cd[_0xcee9('0x32')];if(!_0x5911bf['query'][_0xcee9('0x35')](_0xcee9('0x36'))){_0x22efee[_0xcee9('0x1b')]=qs[_0xcee9('0x1b')](_0x5911bf[_0xcee9('0x2e')]['limit']);_0x22efee['offset']=qs[_0xcee9('0x19')](_0x5911bf[_0xcee9('0x2e')][_0xcee9('0x19')]);}_0x22efee['order']=qs[_0xcee9('0x37')](_0x5911bf[_0xcee9('0x2e')][_0xcee9('0x37')]);_0x22efee[_0xcee9('0x38')]=qs[_0xcee9('0x2f')](_[_0xcee9('0x39')](_0x5911bf['query'],_0x3e88cd[_0xcee9('0x2f')]),_0x3d3027);if(_0x5911bf[_0xcee9('0x2e')][_0xcee9('0x3a')]){_0x22efee[_0xcee9('0x38')]=_['merge'](_0x22efee['where'],{'$or':_[_0xcee9('0x28')](_0x3d3027,function(_0x15b3a2){if(_0x15b3a2['type']!=='VIRTUAL'){var _0x192589={};_0x192589[_0x15b3a2[_0xcee9('0x25')]]={'$like':'%'+_0x5911bf['query'][_0xcee9('0x3a')]+'%'};return _0x192589;}})});}_0x22efee=_[_0xcee9('0x3b')]({},_0x22efee,_0x5911bf[_0xcee9('0x3c')]);var _0x5e6628={'where':_0x22efee['where']};return db[_0xcee9('0x29')][_0xcee9('0x1c')](_0x5e6628)[_0xcee9('0x22')](function(_0xe0ba07){_0x4c4d51[_0xcee9('0x1c')]=_0xe0ba07;if(_0x5911bf[_0xcee9('0x2e')][_0xcee9('0x3d')]){_0x22efee[_0xcee9('0x3e')]=[{'all':!![]}];}return db[_0xcee9('0x29')][_0xcee9('0x3f')](_0x22efee);})[_0xcee9('0x22')](function(_0x5827ae){_0x4c4d51['rows']=_0x5827ae;return _0x4c4d51;})[_0xcee9('0x22')](respondWithFilteredResult(_0x277262,_0x22efee))[_0xcee9('0x40')](handleError(_0x277262,null));};exports['show']=function(_0x33c17b,_0x11efe2){var _0x292645={'raw':!![],'where':{'id':_0x33c17b[_0xcee9('0x41')]['id']}},_0x53409e={};_0x53409e['model']=_[_0xcee9('0x2d')](db[_0xcee9('0x29')][_0xcee9('0x42')]);_0x53409e['query']=_[_0xcee9('0x2d')](_0x33c17b[_0xcee9('0x2e')]);_0x53409e[_0xcee9('0x2f')]=_['intersection'](_0x53409e[_0xcee9('0x32')],_0x53409e['query']);_0x292645[_0xcee9('0x31')]=_[_0xcee9('0x30')](_0x53409e[_0xcee9('0x32')],qs[_0xcee9('0x33')](_0x33c17b[_0xcee9('0x2e')][_0xcee9('0x33')]));_0x292645[_0xcee9('0x31')]=_0x292645[_0xcee9('0x31')][_0xcee9('0x34')]?_0x292645[_0xcee9('0x31')]:_0x53409e[_0xcee9('0x32')];if(_0x33c17b[_0xcee9('0x2e')]['includeAll']){_0x292645['include']=[{'all':!![]}];}_0x292645=_[_0xcee9('0x3b')]({},_0x292645,_0x33c17b[_0xcee9('0x3c')]);return db[_0xcee9('0x29')]['find'](_0x292645)['then'](handleEntityNotFound(_0x11efe2,null))['then'](respondWithResult(_0x11efe2,null))[_0xcee9('0x40')](handleError(_0x11efe2,null));};exports[_0xcee9('0x43')]=function(_0x1792af,_0x30976b){return db['ChatQueueReport'][_0xcee9('0x43')](_0x1792af['body'],{})[_0xcee9('0x22')](respondWithResult(_0x30976b,0xc9))[_0xcee9('0x40')](handleError(_0x30976b,null));};exports[_0xcee9('0x21')]=function(_0x315446,_0x499152){if(_0x315446['body']['id']){delete _0x315446['body']['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x315446['params']['id']}})[_0xcee9('0x22')](handleEntityNotFound(_0x499152,null))[_0xcee9('0x22')](saveUpdates(_0x315446['body'],null))[_0xcee9('0x22')](respondWithResult(_0x499152,null))[_0xcee9('0x40')](handleError(_0x499152,null));};exports[_0xcee9('0x23')]=function(_0x5d4448,_0x370f43){return db['ChatQueueReport'][_0xcee9('0x44')]({'where':{'id':_0x5d4448[_0xcee9('0x41')]['id']}})[_0xcee9('0x22')](handleEntityNotFound(_0x370f43,null))[_0xcee9('0x22')](removeEntity(_0x370f43,null))[_0xcee9('0x40')](handleError(_0x370f43,null));};exports['describe']=function(_0xcc2c79,_0x23c598){return db[_0xcee9('0x29')]['describe']()['then'](respondWithResult(_0x23c598,null))[_0xcee9('0x40')](handleError(_0x23c598,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 51c0cfa..6efc10a 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x34580f,_0x45216a){var _0x47b41e=function(_0x5d08ea){while(--_0x5d08ea){_0x34580f['push'](_0x34580f['shift']());}};_0x47b41e(++_0x45216a);}(_0x757a,0xde));var _0xa757=function(_0x532402,_0x574da0){_0x532402=_0x532402-0x0;var _0x1c63b8=_0x757a[_0x532402];return _0x1c63b8;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_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/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index cb267bd..130d56b 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 _0xfbe5=['debug','stringify','error','code','message','info','result','catch','CreateChatQueueReport','create','options','UpdateChatQueueReport','update','body','raw','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2da570,_0x1cfd80){var _0xfd126e=function(_0x3a701a){while(--_0x3a701a){_0x2da570['push'](_0x2da570['shift']());}};_0xfd126e(++_0x1cfd80);}(_0xfbe5,0xb7));var _0x5fbe=function(_0x2a2d1f,_0x478e4b){_0x2a2d1f=_0x2a2d1f-0x0;var _0x57d7eb=_0xfbe5[_0x2a2d1f];return _0x57d7eb;};'use strict';var _=require(_0x5fbe('0x0'));var util=require(_0x5fbe('0x1'));var moment=require(_0x5fbe('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fbe('0x3'));var db=require(_0x5fbe('0x4'))['db'];var utils=require(_0x5fbe('0x5'));var logger=require('../../config/logger')(_0x5fbe('0x6'));var config=require(_0x5fbe('0x7'));var jayson=require(_0x5fbe('0x8'));var client=jayson[_0x5fbe('0x9')][_0x5fbe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24c95d,_0x1d339d,_0x2721a1){return new BPromise(function(_0x586bf1,_0x3ca796){return client[_0x5fbe('0xb')](_0x24c95d,_0x2721a1)[_0x5fbe('0xc')](function(_0x547b12){logger['info'](_0x5fbe('0xd'),_0x1d339d,_0x5fbe('0xe'));logger[_0x5fbe('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x1d339d,_0x5fbe('0xe'),JSON[_0x5fbe('0x10')](_0x547b12));if(_0x547b12[_0x5fbe('0x11')]){if(_0x547b12['error'][_0x5fbe('0x12')]===0x1f4){logger[_0x5fbe('0x11')](_0x5fbe('0xd'),_0x1d339d,_0x547b12[_0x5fbe('0x11')]['message']);return _0x3ca796(_0x547b12[_0x5fbe('0x11')][_0x5fbe('0x13')]);}logger['error'](_0x5fbe('0xd'),_0x1d339d,_0x547b12[_0x5fbe('0x11')]['message']);return _0x586bf1(_0x547b12['error'][_0x5fbe('0x13')]);}else{logger[_0x5fbe('0x14')](_0x5fbe('0xd'),_0x1d339d,_0x5fbe('0xe'));_0x586bf1(_0x547b12[_0x5fbe('0x15')][_0x5fbe('0x13')]);}})[_0x5fbe('0x16')](function(_0x2601a6){logger[_0x5fbe('0x11')](_0x5fbe('0xd'),_0x1d339d,_0x2601a6);_0x3ca796(_0x2601a6);});});}exports[_0x5fbe('0x17')]=function(_0x386943){var _0x591030=this;return new Promise(function(_0x587e24,_0x216657){return db['ChatQueueReport'][_0x5fbe('0x18')](_0x386943['body'],{'raw':_0x386943[_0x5fbe('0x19')]?_0x386943[_0x5fbe('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x5fbe('0xc')](function(_0x9d78c4){logger[_0x5fbe('0x14')](_0x5fbe('0x17'),_0x386943);logger[_0x5fbe('0xf')](_0x5fbe('0x17'),_0x386943,JSON[_0x5fbe('0x10')](_0x9d78c4));_0x587e24(_0x9d78c4);})[_0x5fbe('0x16')](function(_0x403103){logger[_0x5fbe('0x11')](_0x5fbe('0x17'),_0x403103[_0x5fbe('0x13')],_0x386943);_0x216657(_0x591030[_0x5fbe('0x11')](0x1f4,_0x403103[_0x5fbe('0x13')]));});});};exports[_0x5fbe('0x1a')]=function(_0x393298){var _0x117559=this;return new Promise(function(_0x1e6191,_0x4738d4){return db['ChatQueueReport'][_0x5fbe('0x1b')](_0x393298[_0x5fbe('0x1c')],{'raw':_0x393298[_0x5fbe('0x19')]?_0x393298[_0x5fbe('0x19')][_0x5fbe('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x393298[_0x5fbe('0x19')]?_0x393298['options'][_0x5fbe('0x1e')]||null:null,'attributes':_0x393298[_0x5fbe('0x19')]?_0x393298[_0x5fbe('0x19')][_0x5fbe('0x1f')]||null:null,'limit':_0x393298[_0x5fbe('0x19')]?_0x393298[_0x5fbe('0x19')][_0x5fbe('0x20')]||null:null})[_0x5fbe('0xc')](function(_0x283c4e){logger[_0x5fbe('0x14')](_0x5fbe('0x1a'),_0x393298);logger[_0x5fbe('0xf')](_0x5fbe('0x1a'),_0x393298,JSON['stringify'](_0x283c4e));_0x1e6191(_0x283c4e);})[_0x5fbe('0x16')](function(_0x161f04){logger[_0x5fbe('0x11')]('UpdateChatQueueReport',_0x161f04[_0x5fbe('0x13')],_0x393298);_0x4738d4(_0x117559[_0x5fbe('0x11')](0x1f4,_0x161f04[_0x5fbe('0x13')]));});});}; \ No newline at end of file +var _0x47a1=['code','message','result','catch','create','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','ChatQueueReport','update','attributes','limit','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x32f9ca,_0x2fa8bc){var _0x52e083=function(_0x4fd86a){while(--_0x4fd86a){_0x32f9ca['push'](_0x32f9ca['shift']());}};_0x52e083(++_0x2fa8bc);}(_0x47a1,0x179));var _0x147a=function(_0x8365cd,_0x3c72a1){_0x8365cd=_0x8365cd-0x0;var _0x16c08c=_0x47a1[_0x8365cd];return _0x16c08c;};'use strict';var _=require('lodash');var util=require(_0x147a('0x0'));var moment=require(_0x147a('0x1'));var BPromise=require('bluebird');var rs=require(_0x147a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x147a('0x3'))['db'];var utils=require(_0x147a('0x4'));var logger=require('../../config/logger')(_0x147a('0x5'));var config=require(_0x147a('0x6'));var jayson=require(_0x147a('0x7'));var client=jayson[_0x147a('0x8')][_0x147a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x575604,_0x3d39e3,_0x3ed04b){return new BPromise(function(_0x23ca54,_0x557edf){return client[_0x147a('0xa')](_0x575604,_0x3ed04b)[_0x147a('0xb')](function(_0x20178e){logger[_0x147a('0xc')](_0x147a('0xd'),_0x3d39e3,_0x147a('0xe'));logger[_0x147a('0xf')](_0x147a('0x10'),_0x3d39e3,_0x147a('0xe'),JSON[_0x147a('0x11')](_0x20178e));if(_0x20178e[_0x147a('0x12')]){if(_0x20178e[_0x147a('0x12')][_0x147a('0x13')]===0x1f4){logger[_0x147a('0x12')](_0x147a('0xd'),_0x3d39e3,_0x20178e[_0x147a('0x12')][_0x147a('0x14')]);return _0x557edf(_0x20178e['error'][_0x147a('0x14')]);}logger['error'](_0x147a('0xd'),_0x3d39e3,_0x20178e[_0x147a('0x12')][_0x147a('0x14')]);return _0x23ca54(_0x20178e['error'][_0x147a('0x14')]);}else{logger[_0x147a('0xc')](_0x147a('0xd'),_0x3d39e3,'request\x20sent');_0x23ca54(_0x20178e[_0x147a('0x15')][_0x147a('0x14')]);}})[_0x147a('0x16')](function(_0x58f49a){logger[_0x147a('0x12')](_0x147a('0xd'),_0x3d39e3,_0x58f49a);_0x557edf(_0x58f49a);});});}exports['CreateChatQueueReport']=function(_0x3afb93){var _0x11838a=this;return new Promise(function(_0x17f4da,_0x477e4e){return db['ChatQueueReport'][_0x147a('0x17')](_0x3afb93[_0x147a('0x18')],{'raw':_0x3afb93[_0x147a('0x19')]?_0x3afb93['options'][_0x147a('0x1a')]===undefined?!![]:![]:!![]})[_0x147a('0xb')](function(_0x5490b4){logger[_0x147a('0xc')](_0x147a('0x1b'),_0x3afb93);logger[_0x147a('0xf')](_0x147a('0x1b'),_0x3afb93,JSON[_0x147a('0x11')](_0x5490b4));_0x17f4da(_0x5490b4);})[_0x147a('0x16')](function(_0x2f37dc){logger[_0x147a('0x12')](_0x147a('0x1b'),_0x2f37dc[_0x147a('0x14')],_0x3afb93);_0x477e4e(_0x11838a[_0x147a('0x12')](0x1f4,_0x2f37dc[_0x147a('0x14')]));});});};exports[_0x147a('0x1c')]=function(_0x59d552){var _0x9c1f70=this;return new Promise(function(_0x5107c2,_0x34a6fd){return db[_0x147a('0x1d')][_0x147a('0x1e')](_0x59d552[_0x147a('0x18')],{'raw':_0x59d552['options']?_0x59d552['options'][_0x147a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59d552[_0x147a('0x19')]?_0x59d552[_0x147a('0x19')]['where']||null:null,'attributes':_0x59d552[_0x147a('0x19')]?_0x59d552[_0x147a('0x19')][_0x147a('0x1f')]||null:null,'limit':_0x59d552[_0x147a('0x19')]?_0x59d552[_0x147a('0x19')][_0x147a('0x20')]||null:null})[_0x147a('0xb')](function(_0x1a3cb2){logger[_0x147a('0xc')](_0x147a('0x1c'),_0x59d552);logger[_0x147a('0xf')](_0x147a('0x1c'),_0x59d552,JSON['stringify'](_0x1a3cb2));_0x5107c2(_0x1a3cb2);})[_0x147a('0x16')](function(_0x11c8df){logger['error']('UpdateChatQueueReport',_0x11c8df[_0x147a('0x14')],_0x59d552);_0x34a6fd(_0x9c1f70[_0x147a('0x12')](0x1f4,_0x11c8df[_0x147a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 454009c..34f2e87 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 _0x7425=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x5baddf,_0x2e88fc){var _0x52a130=function(_0x298dc9){while(--_0x298dc9){_0x5baddf['push'](_0x5baddf['shift']());}};_0x52a130(++_0x2e88fc);}(_0x7425,0x187));var _0x5742=function(_0xcbb7c2,_0x62f821){_0xcbb7c2=_0xcbb7c2-0x0;var _0x4134d5=_0x7425[_0xcbb7c2];return _0x4134d5;};'use strict';var multer=require(_0x5742('0x0'));var util=require(_0x5742('0x1'));var path=require(_0x5742('0x2'));var timeout=require(_0x5742('0x3'));var express=require(_0x5742('0x4'));var router=express[_0x5742('0x5')]();var fs_extra=require(_0x5742('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5742('0x7'));var config=require(_0x5742('0x8'));var controller=require('./chatQueueReport.controller');router[_0x5742('0x9')]('/',auth[_0x5742('0xa')](),controller[_0x5742('0xb')]);router['get'](_0x5742('0xc'),auth[_0x5742('0xa')](),controller[_0x5742('0xd')]);router[_0x5742('0x9')](_0x5742('0xe'),auth['isAuthenticated'](),controller[_0x5742('0xf')]);router[_0x5742('0x10')]('/',auth[_0x5742('0xa')](),controller[_0x5742('0x11')]);router[_0x5742('0x12')](_0x5742('0xe'),auth['isAuthenticated'](),controller[_0x5742('0x13')]);router[_0x5742('0x14')](_0x5742('0xe'),auth[_0x5742('0xa')](),controller[_0x5742('0x15')]);module[_0x5742('0x16')]=router; \ No newline at end of file +var _0x623a=['/:id','update','delete','destroy','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0x623a,0x159));var _0xa623=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x623a[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa623('0x0'));var router=express[_0xa623('0x1')]();var fs_extra=require(_0xa623('0x2'));var auth=require(_0xa623('0x3'));var interaction=require(_0xa623('0x4'));var config=require(_0xa623('0x5'));var controller=require(_0xa623('0x6'));router[_0xa623('0x7')]('/',auth[_0xa623('0x8')](),controller[_0xa623('0x9')]);router[_0xa623('0x7')](_0xa623('0xa'),auth['isAuthenticated'](),controller[_0xa623('0xb')]);router[_0xa623('0x7')]('/:id',auth[_0xa623('0x8')](),controller[_0xa623('0xc')]);router['post']('/',auth[_0xa623('0x8')](),controller[_0xa623('0xd')]);router[_0xa623('0xe')](_0xa623('0xf'),auth[_0xa623('0x8')](),controller[_0xa623('0x10')]);router[_0xa623('0x11')](_0xa623('0xf'),auth[_0xa623('0x8')](),controller[_0xa623('0x12')]);module[_0xa623('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index fb1b6bb..ee80085 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(_0x1cdd60,_0x33ce06){var _0x43291e=function(_0x3cbcf7){while(--_0x3cbcf7){_0x1cdd60['push'](_0x1cdd60['shift']());}};_0x43291e(++_0x33ce06);}(_0xedd9,0xfc));var _0x9edd=function(_0x5d1185,_0x124b58){_0x5d1185=_0x5d1185-0x0;var _0x27212b=_0xedd9[_0x5d1185];return _0x27212b;};'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(_0x5e93a1,_0x1b188b){var _0xc4e764=function(_0x129a78){while(--_0x129a78){_0x5e93a1['push'](_0x5e93a1['shift']());}};_0xc4e764(++_0x1b188b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x54ea7a,_0x19df9b){_0x54ea7a=_0x54ea7a-0x0;var _0x65a10d=_0xcb91[_0x54ea7a];return _0x65a10d;};'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 23c7af8..08bc979 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 _0xaa31=['attributes','fields','length','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','options','include','ChatTransferReport','findAll','rows','catch','params','find','create','body','destroy','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection'];(function(_0x482393,_0x355061){var _0x4c07ae=function(_0x139328){while(--_0x139328){_0x482393['push'](_0x482393['shift']());}};_0x4c07ae(++_0x355061);}(_0xaa31,0xa6));var _0x1aa3=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xaa31[_0x44946b];return _0x249bc4;};'use strict';var emlformat=require(_0x1aa3('0x0'));var rimraf=require(_0x1aa3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1aa3('0x2'));var moment=require(_0x1aa3('0x3'));var BPromise=require(_0x1aa3('0x4'));var Mustache=require(_0x1aa3('0x5'));var util=require(_0x1aa3('0x6'));var path=require('path');var sox=require(_0x1aa3('0x7'));var csv=require(_0x1aa3('0x8'));var ejs=require(_0x1aa3('0x9'));var fs=require('fs');var fs_extra=require(_0x1aa3('0xa'));var _=require(_0x1aa3('0xb'));var squel=require('squel');var crypto=require(_0x1aa3('0xc'));var jsforce=require(_0x1aa3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1aa3('0x8'));var querystring=require(_0x1aa3('0xe'));var Papa=require('papaparse');var Redis=require(_0x1aa3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1aa3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1aa3('0x11'));var logger=require('../../config/logger')(_0x1aa3('0x12'));var utils=require(_0x1aa3('0x13'));var config=require(_0x1aa3('0x14'));var licenseUtil=require(_0x1aa3('0x15'));var db=require(_0x1aa3('0x16'))['db'];function respondWithStatusCode(_0x13136d,_0x39cbb7){_0x39cbb7=_0x39cbb7||0xcc;return function(_0x40f71e){if(_0x40f71e){return _0x13136d[_0x1aa3('0x17')](_0x39cbb7);}return _0x13136d[_0x1aa3('0x18')](_0x39cbb7)[_0x1aa3('0x19')]();};}function respondWithResult(_0x255c35,_0x315dd0){_0x315dd0=_0x315dd0||0xc8;return function(_0x2a153d){if(_0x2a153d){return _0x255c35[_0x1aa3('0x18')](_0x315dd0)[_0x1aa3('0x1a')](_0x2a153d);}};}function respondWithFilteredResult(_0x400822,_0x51af52){return function(_0x12b835){if(_0x12b835){var _0x52adaa=typeof _0x51af52['offset']===_0x1aa3('0x1b')&&typeof _0x51af52['limit']===_0x1aa3('0x1b');var _0x2ec7c0=_0x12b835[_0x1aa3('0x1c')];var _0x3e8625=_0x52adaa?0x0:_0x51af52['offset'];var _0x11db96=_0x52adaa?_0x12b835[_0x1aa3('0x1c')]:_0x51af52[_0x1aa3('0x1d')]+_0x51af52[_0x1aa3('0x1e')];var _0x108776;if(_0x11db96>=_0x2ec7c0){_0x11db96=_0x2ec7c0;_0x108776=0xc8;}else{_0x108776=0xce;}_0x400822[_0x1aa3('0x18')](_0x108776);return _0x400822[_0x1aa3('0x1f')](_0x1aa3('0x20'),_0x3e8625+'-'+_0x11db96+'/'+_0x2ec7c0)['json'](_0x12b835);}return null;};}function patchUpdates(_0xbb8796){return function(_0x3fcdab){try{jsonpatch[_0x1aa3('0x21')](_0x3fcdab,_0xbb8796,!![]);}catch(_0x1dbb47){return BPromise['reject'](_0x1dbb47);}return _0x3fcdab[_0x1aa3('0x22')]();};}function saveUpdates(_0x467e5a,_0x4e94f7){return function(_0x3c1528){if(_0x3c1528){return _0x3c1528[_0x1aa3('0x23')](_0x467e5a)['then'](function(_0x3e09a1){return _0x3e09a1;});}return null;};}function removeEntity(_0x1ee34d,_0x594735){return function(_0x298359){if(_0x298359){return _0x298359['destroy']()[_0x1aa3('0x24')](function(){_0x1ee34d[_0x1aa3('0x18')](0xcc)[_0x1aa3('0x19')]();});}};}function handleEntityNotFound(_0x332798,_0x102d4f){return function(_0x23d894){if(!_0x23d894){_0x332798[_0x1aa3('0x17')](0x194);}return _0x23d894;};}function handleError(_0x4dd2a3,_0x30880d){_0x30880d=_0x30880d||0x1f4;return function(_0x4db671){logger[_0x1aa3('0x25')](_0x4db671[_0x1aa3('0x26')]);if(_0x4db671[_0x1aa3('0x27')]){delete _0x4db671['name'];}_0x4dd2a3[_0x1aa3('0x18')](_0x30880d)[_0x1aa3('0x28')](_0x4db671);};}exports[_0x1aa3('0x29')]=function(_0x4e8c85,_0x1ff221){var _0x5128a5={},_0x11af71={},_0x2a6a98={'count':0x0,'rows':[]};var _0x5c4c6a=_[_0x1aa3('0x2a')](db['ChatTransferReport'][_0x1aa3('0x2b')],function(_0x499dc8){return{'name':_0x499dc8[_0x1aa3('0x2c')],'type':_0x499dc8['type']['key']};});_0x11af71[_0x1aa3('0x2d')]=_[_0x1aa3('0x2a')](_0x5c4c6a,_0x1aa3('0x27'));_0x11af71[_0x1aa3('0x2e')]=_[_0x1aa3('0x2f')](_0x4e8c85[_0x1aa3('0x2e')]);_0x11af71[_0x1aa3('0x30')]=_[_0x1aa3('0x31')](_0x11af71['model'],_0x11af71[_0x1aa3('0x2e')]);_0x5128a5[_0x1aa3('0x32')]=_[_0x1aa3('0x31')](_0x11af71[_0x1aa3('0x2d')],qs[_0x1aa3('0x33')](_0x4e8c85[_0x1aa3('0x2e')]['fields']));_0x5128a5[_0x1aa3('0x32')]=_0x5128a5['attributes'][_0x1aa3('0x34')]?_0x5128a5[_0x1aa3('0x32')]:_0x11af71[_0x1aa3('0x2d')];if(!_0x4e8c85[_0x1aa3('0x2e')][_0x1aa3('0x35')]('nolimit')){_0x5128a5[_0x1aa3('0x1e')]=qs[_0x1aa3('0x1e')](_0x4e8c85['query'][_0x1aa3('0x1e')]);_0x5128a5[_0x1aa3('0x1d')]=qs[_0x1aa3('0x1d')](_0x4e8c85[_0x1aa3('0x2e')][_0x1aa3('0x1d')]);}_0x5128a5['order']=qs[_0x1aa3('0x36')](_0x4e8c85[_0x1aa3('0x2e')]['sort']);_0x5128a5[_0x1aa3('0x37')]=qs[_0x1aa3('0x30')](_['pick'](_0x4e8c85[_0x1aa3('0x2e')],_0x11af71['filters']),_0x5c4c6a);if(_0x4e8c85[_0x1aa3('0x2e')][_0x1aa3('0x38')]){_0x5128a5[_0x1aa3('0x37')]=_[_0x1aa3('0x39')](_0x5128a5[_0x1aa3('0x37')],{'$or':_['map'](_0x5c4c6a,function(_0x1be125){if(_0x1be125[_0x1aa3('0x3a')]!==_0x1aa3('0x3b')){var _0x32bfdd={};_0x32bfdd[_0x1be125[_0x1aa3('0x27')]]={'$like':'%'+_0x4e8c85[_0x1aa3('0x2e')][_0x1aa3('0x38')]+'%'};return _0x32bfdd;}})});}_0x5128a5=_[_0x1aa3('0x39')]({},_0x5128a5,_0x4e8c85[_0x1aa3('0x3c')]);var _0x56e5b5={'where':_0x5128a5['where']};return db['ChatTransferReport']['count'](_0x56e5b5)['then'](function(_0x294b3c){_0x2a6a98[_0x1aa3('0x1c')]=_0x294b3c;if(_0x4e8c85['query']['includeAll']){_0x5128a5[_0x1aa3('0x3d')]=[{'all':!![]}];}return db[_0x1aa3('0x3e')][_0x1aa3('0x3f')](_0x5128a5);})[_0x1aa3('0x24')](function(_0x46b943){_0x2a6a98[_0x1aa3('0x40')]=_0x46b943;return _0x2a6a98;})[_0x1aa3('0x24')](respondWithFilteredResult(_0x1ff221,_0x5128a5))[_0x1aa3('0x41')](handleError(_0x1ff221,null));};exports['show']=function(_0x3868c7,_0x4bd638){var _0x12fbe2={'raw':!![],'where':{'id':_0x3868c7[_0x1aa3('0x42')]['id']}},_0x55834d={};_0x55834d['model']=_[_0x1aa3('0x2f')](db[_0x1aa3('0x3e')][_0x1aa3('0x2b')]);_0x55834d[_0x1aa3('0x2e')]=_[_0x1aa3('0x2f')](_0x3868c7[_0x1aa3('0x2e')]);_0x55834d[_0x1aa3('0x30')]=_[_0x1aa3('0x31')](_0x55834d[_0x1aa3('0x2d')],_0x55834d[_0x1aa3('0x2e')]);_0x12fbe2[_0x1aa3('0x32')]=_['intersection'](_0x55834d['model'],qs[_0x1aa3('0x33')](_0x3868c7[_0x1aa3('0x2e')][_0x1aa3('0x33')]));_0x12fbe2[_0x1aa3('0x32')]=_0x12fbe2[_0x1aa3('0x32')]['length']?_0x12fbe2[_0x1aa3('0x32')]:_0x55834d[_0x1aa3('0x2d')];if(_0x3868c7[_0x1aa3('0x2e')]['includeAll']){_0x12fbe2['include']=[{'all':!![]}];}_0x12fbe2=_['merge']({},_0x12fbe2,_0x3868c7[_0x1aa3('0x3c')]);return db[_0x1aa3('0x3e')][_0x1aa3('0x43')](_0x12fbe2)['then'](handleEntityNotFound(_0x4bd638,null))[_0x1aa3('0x24')](respondWithResult(_0x4bd638,null))['catch'](handleError(_0x4bd638,null));};exports[_0x1aa3('0x44')]=function(_0x3dc30b,_0x1033c9){return db[_0x1aa3('0x3e')][_0x1aa3('0x44')](_0x3dc30b[_0x1aa3('0x45')],{})['then'](respondWithResult(_0x1033c9,0xc9))[_0x1aa3('0x41')](handleError(_0x1033c9,null));};exports[_0x1aa3('0x23')]=function(_0x45814e,_0x3c6ffd){if(_0x45814e[_0x1aa3('0x45')]['id']){delete _0x45814e[_0x1aa3('0x45')]['id'];}return db[_0x1aa3('0x3e')][_0x1aa3('0x43')]({'where':{'id':_0x45814e[_0x1aa3('0x42')]['id']}})[_0x1aa3('0x24')](handleEntityNotFound(_0x3c6ffd,null))[_0x1aa3('0x24')](saveUpdates(_0x45814e[_0x1aa3('0x45')],null))[_0x1aa3('0x24')](respondWithResult(_0x3c6ffd,null))['catch'](handleError(_0x3c6ffd,null));};exports[_0x1aa3('0x46')]=function(_0x5f3ca5,_0x8c34f6){return db['ChatTransferReport'][_0x1aa3('0x43')]({'where':{'id':_0x5f3ca5[_0x1aa3('0x42')]['id']}})[_0x1aa3('0x24')](handleEntityNotFound(_0x8c34f6,null))[_0x1aa3('0x24')](removeEntity(_0x8c34f6,null))[_0x1aa3('0x41')](handleError(_0x8c34f6,null));};exports[_0x1aa3('0x47')]=function(_0x28499d,_0x443228){return db[_0x1aa3('0x3e')][_0x1aa3('0x47')]()['then'](respondWithResult(_0x443228,null))['catch'](handleError(_0x443228,null));}; \ No newline at end of file +var _0x2e2c=['type','merge','options','ChatTransferReport','includeAll','include','findAll','rows','catch','keys','find','create','body','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x4dbb37,_0x3389ae){var _0x32cb2d=function(_0xbd4e34){while(--_0xbd4e34){_0x4dbb37['push'](_0x4dbb37['shift']());}};_0x32cb2d(++_0x3389ae);}(_0x2e2c,0xa4));var _0xc2e2=function(_0x46401e,_0x2a345b){_0x46401e=_0x46401e-0x0;var _0x447cba=_0x2e2c[_0x46401e];return _0x447cba;};'use strict';var emlformat=require(_0xc2e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc2e2('0x1'));var jsonpatch=require(_0xc2e2('0x2'));var rp=require('request-promise');var moment=require(_0xc2e2('0x3'));var BPromise=require(_0xc2e2('0x4'));var Mustache=require(_0xc2e2('0x5'));var util=require('util');var path=require('path');var sox=require(_0xc2e2('0x6'));var csv=require(_0xc2e2('0x7'));var ejs=require(_0xc2e2('0x8'));var fs=require('fs');var fs_extra=require(_0xc2e2('0x9'));var _=require(_0xc2e2('0xa'));var squel=require(_0xc2e2('0xb'));var crypto=require(_0xc2e2('0xc'));var jsforce=require(_0xc2e2('0xd'));var deskjs=require(_0xc2e2('0xe'));var toCsv=require(_0xc2e2('0x7'));var querystring=require(_0xc2e2('0xf'));var Papa=require('papaparse');var Redis=require(_0xc2e2('0x10'));var authService=require(_0xc2e2('0x11'));var qs=require(_0xc2e2('0x12'));var as=require(_0xc2e2('0x13'));var hardwareService=require(_0xc2e2('0x14'));var logger=require(_0xc2e2('0x15'))(_0xc2e2('0x16'));var utils=require('../../config/utils');var config=require(_0xc2e2('0x17'));var licenseUtil=require(_0xc2e2('0x18'));var db=require(_0xc2e2('0x19'))['db'];function respondWithStatusCode(_0xb16fd2,_0x4a7134){_0x4a7134=_0x4a7134||0xcc;return function(_0x10d341){if(_0x10d341){return _0xb16fd2['sendStatus'](_0x4a7134);}return _0xb16fd2[_0xc2e2('0x1a')](_0x4a7134)['end']();};}function respondWithResult(_0x1d6553,_0x69123c){_0x69123c=_0x69123c||0xc8;return function(_0x4778ec){if(_0x4778ec){return _0x1d6553[_0xc2e2('0x1a')](_0x69123c)[_0xc2e2('0x1b')](_0x4778ec);}};}function respondWithFilteredResult(_0x505909,_0x40651a){return function(_0x284adf){if(_0x284adf){var _0x358a43=typeof _0x40651a[_0xc2e2('0x1c')]===_0xc2e2('0x1d')&&typeof _0x40651a['limit']==='undefined';var _0x5395b=_0x284adf[_0xc2e2('0x1e')];var _0x933cb2=_0x358a43?0x0:_0x40651a[_0xc2e2('0x1c')];var _0x52e34c=_0x358a43?_0x284adf['count']:_0x40651a['offset']+_0x40651a[_0xc2e2('0x1f')];var _0x9bd27c;if(_0x52e34c>=_0x5395b){_0x52e34c=_0x5395b;_0x9bd27c=0xc8;}else{_0x9bd27c=0xce;}_0x505909[_0xc2e2('0x1a')](_0x9bd27c);return _0x505909[_0xc2e2('0x20')](_0xc2e2('0x21'),_0x933cb2+'-'+_0x52e34c+'/'+_0x5395b)[_0xc2e2('0x1b')](_0x284adf);}return null;};}function patchUpdates(_0x3baa97){return function(_0x1fa59a){try{jsonpatch[_0xc2e2('0x22')](_0x1fa59a,_0x3baa97,!![]);}catch(_0x243126){return BPromise[_0xc2e2('0x23')](_0x243126);}return _0x1fa59a['save']();};}function saveUpdates(_0x55eeaa,_0x22df44){return function(_0x2f7323){if(_0x2f7323){return _0x2f7323[_0xc2e2('0x24')](_0x55eeaa)[_0xc2e2('0x25')](function(_0x1cfe77){return _0x1cfe77;});}return null;};}function removeEntity(_0x304328,_0x21723f){return function(_0x54298a){if(_0x54298a){return _0x54298a[_0xc2e2('0x26')]()['then'](function(){_0x304328[_0xc2e2('0x1a')](0xcc)[_0xc2e2('0x27')]();});}};}function handleEntityNotFound(_0x31ff,_0x4212d7){return function(_0x22331d){if(!_0x22331d){_0x31ff['sendStatus'](0x194);}return _0x22331d;};}function handleError(_0x973d2,_0x378325){_0x378325=_0x378325||0x1f4;return function(_0x1a7dd2){logger['error'](_0x1a7dd2[_0xc2e2('0x28')]);if(_0x1a7dd2[_0xc2e2('0x29')]){delete _0x1a7dd2['name'];}_0x973d2[_0xc2e2('0x1a')](_0x378325)[_0xc2e2('0x2a')](_0x1a7dd2);};}exports[_0xc2e2('0x2b')]=function(_0x4ac267,_0x5b2511){var _0x5365bd={},_0x2acb4c={},_0x3020b9={'count':0x0,'rows':[]};var _0x386208=_[_0xc2e2('0x2c')](db['ChatTransferReport'][_0xc2e2('0x2d')],function(_0x45ecd4){return{'name':_0x45ecd4[_0xc2e2('0x2e')],'type':_0x45ecd4['type'][_0xc2e2('0x2f')]};});_0x2acb4c[_0xc2e2('0x30')]=_['map'](_0x386208,'name');_0x2acb4c[_0xc2e2('0x31')]=_['keys'](_0x4ac267[_0xc2e2('0x31')]);_0x2acb4c[_0xc2e2('0x32')]=_[_0xc2e2('0x33')](_0x2acb4c[_0xc2e2('0x30')],_0x2acb4c[_0xc2e2('0x31')]);_0x5365bd['attributes']=_['intersection'](_0x2acb4c['model'],qs['fields'](_0x4ac267['query'][_0xc2e2('0x34')]));_0x5365bd[_0xc2e2('0x35')]=_0x5365bd['attributes'][_0xc2e2('0x36')]?_0x5365bd[_0xc2e2('0x35')]:_0x2acb4c['model'];if(!_0x4ac267['query'][_0xc2e2('0x37')](_0xc2e2('0x38'))){_0x5365bd[_0xc2e2('0x1f')]=qs[_0xc2e2('0x1f')](_0x4ac267['query'][_0xc2e2('0x1f')]);_0x5365bd[_0xc2e2('0x1c')]=qs[_0xc2e2('0x1c')](_0x4ac267[_0xc2e2('0x31')]['offset']);}_0x5365bd['order']=qs[_0xc2e2('0x39')](_0x4ac267[_0xc2e2('0x31')]['sort']);_0x5365bd[_0xc2e2('0x3a')]=qs['filters'](_[_0xc2e2('0x3b')](_0x4ac267[_0xc2e2('0x31')],_0x2acb4c[_0xc2e2('0x32')]),_0x386208);if(_0x4ac267[_0xc2e2('0x31')][_0xc2e2('0x3c')]){_0x5365bd[_0xc2e2('0x3a')]=_['merge'](_0x5365bd['where'],{'$or':_['map'](_0x386208,function(_0xc9aa79){if(_0xc9aa79[_0xc2e2('0x3d')]!=='VIRTUAL'){var _0x2022f5={};_0x2022f5[_0xc9aa79[_0xc2e2('0x29')]]={'$like':'%'+_0x4ac267[_0xc2e2('0x31')][_0xc2e2('0x3c')]+'%'};return _0x2022f5;}})});}_0x5365bd=_[_0xc2e2('0x3e')]({},_0x5365bd,_0x4ac267[_0xc2e2('0x3f')]);var _0xf3e154={'where':_0x5365bd[_0xc2e2('0x3a')]};return db[_0xc2e2('0x40')][_0xc2e2('0x1e')](_0xf3e154)[_0xc2e2('0x25')](function(_0x1b2fb3){_0x3020b9['count']=_0x1b2fb3;if(_0x4ac267[_0xc2e2('0x31')][_0xc2e2('0x41')]){_0x5365bd[_0xc2e2('0x42')]=[{'all':!![]}];}return db[_0xc2e2('0x40')][_0xc2e2('0x43')](_0x5365bd);})[_0xc2e2('0x25')](function(_0x2c06d9){_0x3020b9[_0xc2e2('0x44')]=_0x2c06d9;return _0x3020b9;})[_0xc2e2('0x25')](respondWithFilteredResult(_0x5b2511,_0x5365bd))[_0xc2e2('0x45')](handleError(_0x5b2511,null));};exports['show']=function(_0xdb553d,_0x36e3e7){var _0x8914ff={'raw':!![],'where':{'id':_0xdb553d['params']['id']}},_0x2c05a1={};_0x2c05a1['model']=_[_0xc2e2('0x46')](db['ChatTransferReport'][_0xc2e2('0x2d')]);_0x2c05a1['query']=_[_0xc2e2('0x46')](_0xdb553d[_0xc2e2('0x31')]);_0x2c05a1['filters']=_['intersection'](_0x2c05a1[_0xc2e2('0x30')],_0x2c05a1[_0xc2e2('0x31')]);_0x8914ff[_0xc2e2('0x35')]=_[_0xc2e2('0x33')](_0x2c05a1['model'],qs[_0xc2e2('0x34')](_0xdb553d[_0xc2e2('0x31')]['fields']));_0x8914ff[_0xc2e2('0x35')]=_0x8914ff[_0xc2e2('0x35')][_0xc2e2('0x36')]?_0x8914ff[_0xc2e2('0x35')]:_0x2c05a1['model'];if(_0xdb553d[_0xc2e2('0x31')][_0xc2e2('0x41')]){_0x8914ff[_0xc2e2('0x42')]=[{'all':!![]}];}_0x8914ff=_['merge']({},_0x8914ff,_0xdb553d['options']);return db['ChatTransferReport'][_0xc2e2('0x47')](_0x8914ff)[_0xc2e2('0x25')](handleEntityNotFound(_0x36e3e7,null))[_0xc2e2('0x25')](respondWithResult(_0x36e3e7,null))[_0xc2e2('0x45')](handleError(_0x36e3e7,null));};exports[_0xc2e2('0x48')]=function(_0x3bba86,_0x128225){return db[_0xc2e2('0x40')][_0xc2e2('0x48')](_0x3bba86[_0xc2e2('0x49')],{})[_0xc2e2('0x25')](respondWithResult(_0x128225,0xc9))[_0xc2e2('0x45')](handleError(_0x128225,null));};exports[_0xc2e2('0x24')]=function(_0x1ab051,_0x57aeb3){if(_0x1ab051['body']['id']){delete _0x1ab051[_0xc2e2('0x49')]['id'];}return db[_0xc2e2('0x40')][_0xc2e2('0x47')]({'where':{'id':_0x1ab051[_0xc2e2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x57aeb3,null))[_0xc2e2('0x25')](saveUpdates(_0x1ab051[_0xc2e2('0x49')],null))[_0xc2e2('0x25')](respondWithResult(_0x57aeb3,null))['catch'](handleError(_0x57aeb3,null));};exports['destroy']=function(_0x4b1676,_0x24fa0f){return db[_0xc2e2('0x40')][_0xc2e2('0x47')]({'where':{'id':_0x4b1676['params']['id']}})[_0xc2e2('0x25')](handleEntityNotFound(_0x24fa0f,null))['then'](removeEntity(_0x24fa0f,null))[_0xc2e2('0x45')](handleError(_0x24fa0f,null));};exports['describe']=function(_0x52b193,_0x104a05){return db[_0xc2e2('0x40')]['describe']()[_0xc2e2('0x25')](respondWithResult(_0x104a05,null))[_0xc2e2('0x45')](handleError(_0x104a05,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index be24a90..e27c14f 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 _0xbf23=['ChatTransferReport','report_chat_transfer','uniqueid','../../config/logger','moment','bluebird','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xbf23,0x184));var _0x3bf2=function(_0x251b25,_0x35b453){_0x251b25=_0x251b25-0x0;var _0x1671a1=_0xbf23[_0x251b25];return _0x1671a1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3bf2('0x0'))('api');var moment=require(_0x3bf2('0x1'));var BPromise=require(_0x3bf2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3bf2('0x3'));var config=require(_0x3bf2('0x4'));var attributes=require(_0x3bf2('0x5'));module[_0x3bf2('0x6')]=function(_0x168b37,_0x3ba9c1){return _0x168b37[_0x3bf2('0x7')](_0x3bf2('0x8'),attributes,{'tableName':_0x3bf2('0x9'),'paranoid':![],'indexes':[{'name':_0x3bf2('0xa'),'fields':[_0x3bf2('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc57f=['api','moment','path','rimraf','../../config/environment','exports','define','ChatTransferReport','uniqueid','lodash','../../config/logger'];(function(_0x44d658,_0x5913f6){var _0x4bf7f3=function(_0x4550ad){while(--_0x4550ad){_0x44d658['push'](_0x44d658['shift']());}};_0x4bf7f3(++_0x5913f6);}(_0xc57f,0x98));var _0xfc57=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xc57f[_0x313c96];return _0x522f53;};'use strict';var _=require(_0xfc57('0x0'));var util=require('util');var logger=require(_0xfc57('0x1'))(_0xfc57('0x2'));var moment=require(_0xfc57('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc57('0x4'));var rimraf=require(_0xfc57('0x5'));var config=require(_0xfc57('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0xfc57('0x7')]=function(_0xbcb4dc,_0xb777ba){return _0xbcb4dc[_0xfc57('0x8')](_0xfc57('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xfc57('0xa'),'fields':[_0xfc57('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 4ab008d..571d51c 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 _0xe968=['request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x438ef2,_0x352581){var _0x55998c=function(_0xc9f81f){while(--_0xc9f81f){_0x438ef2['push'](_0x438ef2['shift']());}};_0x55998c(++_0x352581);}(_0xe968,0xab));var _0x8e96=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xe968[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x8e96('0x0'));var util=require(_0x8e96('0x1'));var moment=require(_0x8e96('0x2'));var BPromise=require(_0x8e96('0x3'));var rs=require(_0x8e96('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e96('0x5'))['db'];var utils=require(_0x8e96('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8e96('0x7'));var jayson=require(_0x8e96('0x8'));var client=jayson[_0x8e96('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cf789,_0x52272d,_0x40a37b){return new BPromise(function(_0x134af1,_0x49f971){return client[_0x8e96('0xa')](_0x4cf789,_0x40a37b)[_0x8e96('0xb')](function(_0x75a038){logger[_0x8e96('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x52272d,_0x8e96('0xd'));logger[_0x8e96('0xe')](_0x8e96('0xf'),_0x52272d,_0x8e96('0xd'),JSON[_0x8e96('0x10')](_0x75a038));if(_0x75a038[_0x8e96('0x11')]){if(_0x75a038[_0x8e96('0x11')][_0x8e96('0x12')]===0x1f4){logger[_0x8e96('0x11')](_0x8e96('0x13'),_0x52272d,_0x75a038['error'][_0x8e96('0x14')]);return _0x49f971(_0x75a038[_0x8e96('0x11')][_0x8e96('0x14')]);}logger['error'](_0x8e96('0x13'),_0x52272d,_0x75a038[_0x8e96('0x11')][_0x8e96('0x14')]);return _0x134af1(_0x75a038[_0x8e96('0x11')][_0x8e96('0x14')]);}else{logger[_0x8e96('0xc')](_0x8e96('0x13'),_0x52272d,_0x8e96('0xd'));_0x134af1(_0x75a038[_0x8e96('0x15')][_0x8e96('0x14')]);}})[_0x8e96('0x16')](function(_0x16f6fa){logger[_0x8e96('0x11')](_0x8e96('0x13'),_0x52272d,_0x16f6fa);_0x49f971(_0x16f6fa);});});} \ No newline at end of file +var _0xb169=['request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x28e6e4,_0x2f6728){var _0x16b271=function(_0x53cec0){while(--_0x53cec0){_0x28e6e4['push'](_0x28e6e4['shift']());}};_0x16b271(++_0x2f6728);}(_0xb169,0x8c));var _0x9b16=function(_0x2920dd,_0x19d049){_0x2920dd=_0x2920dd-0x0;var _0x5d4e52=_0xb169[_0x2920dd];return _0x5d4e52;};'use strict';var _=require(_0x9b16('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9b16('0x1'));var rs=require(_0x9b16('0x2'));var fs=require('fs');var Redis=require(_0x9b16('0x3'));var db=require(_0x9b16('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b16('0x5'))(_0x9b16('0x6'));var config=require(_0x9b16('0x7'));var jayson=require(_0x9b16('0x8'));var client=jayson[_0x9b16('0x9')][_0x9b16('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b19f0,_0x40509a,_0x1611be){return new BPromise(function(_0x588242,_0x5d8482){return client['request'](_0x4b19f0,_0x1611be)[_0x9b16('0xb')](function(_0x35877e){logger[_0x9b16('0xc')](_0x9b16('0xd'),_0x40509a,_0x9b16('0xe'));logger[_0x9b16('0xf')](_0x9b16('0x10'),_0x40509a,_0x9b16('0xe'),JSON[_0x9b16('0x11')](_0x35877e));if(_0x35877e['error']){if(_0x35877e[_0x9b16('0x12')]['code']===0x1f4){logger[_0x9b16('0x12')](_0x9b16('0xd'),_0x40509a,_0x35877e['error']['message']);return _0x5d8482(_0x35877e['error']['message']);}logger[_0x9b16('0x12')](_0x9b16('0xd'),_0x40509a,_0x35877e['error']['message']);return _0x588242(_0x35877e[_0x9b16('0x12')][_0x9b16('0x13')]);}else{logger[_0x9b16('0xc')](_0x9b16('0xd'),_0x40509a,_0x9b16('0xe'));_0x588242(_0x35877e[_0x9b16('0x14')][_0x9b16('0x13')]);}})[_0x9b16('0x15')](function(_0x7ed35a){logger[_0x9b16('0x12')](_0x9b16('0xd'),_0x40509a,_0x7ed35a);_0x5d8482(_0x7ed35a);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index b6c0c7a..72e72c3 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 _0xb2d2=['./chatTransferReport.controller','get','isAuthenticated','describe','/:id','show','create','put','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x27e21b,_0x439a44){var _0x5dba70=function(_0x465db8){while(--_0x465db8){_0x27e21b['push'](_0x27e21b['shift']());}};_0x5dba70(++_0x439a44);}(_0xb2d2,0x16f));var _0x2b2d=function(_0x2e625a,_0x593d72){_0x2e625a=_0x2e625a-0x0;var _0x3faa9f=_0xb2d2[_0x2e625a];return _0x3faa9f;};'use strict';var multer=require(_0x2b2d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2b2d('0x1'));var express=require(_0x2b2d('0x2'));var router=express[_0x2b2d('0x3')]();var fs_extra=require(_0x2b2d('0x4'));var auth=require(_0x2b2d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2b2d('0x6'));var controller=require(_0x2b2d('0x7'));router[_0x2b2d('0x8')]('/',auth[_0x2b2d('0x9')](),controller['index']);router[_0x2b2d('0x8')]('/describe',auth[_0x2b2d('0x9')](),controller[_0x2b2d('0xa')]);router['get'](_0x2b2d('0xb'),auth['isAuthenticated'](),controller[_0x2b2d('0xc')]);router['post']('/',auth[_0x2b2d('0x9')](),controller[_0x2b2d('0xd')]);router[_0x2b2d('0xe')](_0x2b2d('0xb'),auth[_0x2b2d('0x9')](),controller['update']);router[_0x2b2d('0xf')](_0x2b2d('0xb'),auth[_0x2b2d('0x9')](),controller['destroy']);module[_0x2b2d('0x10')]=router; \ No newline at end of file +var _0xdc00=['index','get','describe','create','put','/:id','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated'];(function(_0x5c2161,_0x5a1984){var _0x377c24=function(_0xe43a12){while(--_0xe43a12){_0x5c2161['push'](_0x5c2161['shift']());}};_0x377c24(++_0x5a1984);}(_0xdc00,0x1ca));var _0x0dc0=function(_0x46e017,_0x25e4a9){_0x46e017=_0x46e017-0x0;var _0x56f77d=_0xdc00[_0x46e017];return _0x56f77d;};'use strict';var multer=require(_0x0dc0('0x0'));var util=require('util');var path=require(_0x0dc0('0x1'));var timeout=require(_0x0dc0('0x2'));var express=require(_0x0dc0('0x3'));var router=express[_0x0dc0('0x4')]();var fs_extra=require(_0x0dc0('0x5'));var auth=require(_0x0dc0('0x6'));var interaction=require(_0x0dc0('0x7'));var config=require('../../config/environment');var controller=require(_0x0dc0('0x8'));router['get']('/',auth[_0x0dc0('0x9')](),controller[_0x0dc0('0xa')]);router[_0x0dc0('0xb')]('/describe',auth[_0x0dc0('0x9')](),controller[_0x0dc0('0xc')]);router[_0x0dc0('0xb')]('/:id',auth[_0x0dc0('0x9')](),controller['show']);router['post']('/',auth[_0x0dc0('0x9')](),controller[_0x0dc0('0xd')]);router[_0x0dc0('0xe')](_0x0dc0('0xf'),auth[_0x0dc0('0x9')](),controller[_0x0dc0('0x10')]);router['delete'](_0x0dc0('0xf'),auth[_0x0dc0('0x9')](),controller[_0x0dc0('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 1a31dce..4f52a47 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 _0xe7d9=['Skip','Feedback','star','thumb','stringify','input','name','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','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','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0xe7d9,0x168));var _0x9e7d=function(_0x49e663,_0x321465){_0x49e663=_0x49e663-0x0;var _0x17c609=_0xe7d9[_0x49e663];return _0x17c609;};'use strict';var Sequelize=require(_0x9e7d('0x0'));var rs=require('randomstring');module[_0x9e7d('0x1')]={'name':{'type':Sequelize[_0x9e7d('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x9e7d('0x2')]},'mapKey':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':_0x9e7d('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x9e7d('0x3')},'key':{'type':Sequelize[_0x9e7d('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9e7d('0x2')],'allowNull':![],'defaultValue':_0x9e7d('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9e7d('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9e7d('0x2')],'allowNull':![],'defaultValue':_0x9e7d('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9e7d('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x9e7d('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9e7d('0x2')]},'animation':{'type':Sequelize[_0x9e7d('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded','squared'),'defaultValue':_0x9e7d('0x8')},'header_online':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':_0x9e7d('0x9')},'offline_chat_button':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':_0x9e7d('0xa')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9e7d('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':_0x9e7d('0xb')},'defaultWhiteLabel':{'type':Sequelize[_0x9e7d('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9e7d('0xc')]},'closingQuestion':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':_0x9e7d('0xd')},'formSubmitSuccessMessage':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':_0x9e7d('0xe')},'noteTitle':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':_0x9e7d('0xf')},'placeholderMessage':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':_0x9e7d('0x10')},'conditionAgreement':{'type':Sequelize[_0x9e7d('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x9e7d('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':_0x9e7d('0x11')},'ratingType':{'type':Sequelize['ENUM'](_0x9e7d('0x12'),_0x9e7d('0x13')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x9e7d('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9e7d('0xc')],'defaultValue':function(){return JSON[_0x9e7d('0x14')]({'items':[{'type':_0x9e7d('0x15'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x9e7d('0x16'),'helpText':''}},{'type':'input','props':{'title':_0x9e7d('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x9e7d('0x3'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9e7d('0x17')](_0x9e7d('0x18'))?JSON['parse'](this[_0x9e7d('0x17')]('onlineForm')):{};},'set':function(_0x4e36f4){return this[_0x9e7d('0x19')](_0x9e7d('0x18'),JSON[_0x9e7d('0x14')](_0x4e36f4));}},'offlineForm':{'type':Sequelize[_0x9e7d('0xc')],'defaultValue':function(){return JSON[_0x9e7d('0x14')]({'items':[{'type':_0x9e7d('0x15'),'props':{'title':_0x9e7d('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x9e7d('0x3'),'type':_0x9e7d('0x3')},'variable':null},{'type':_0x9e7d('0x1a'),'config':{'placeholder':_0x9e7d('0x1b')},'props':{'title':_0x9e7d('0x1b'),'helpText':_0x9e7d('0x1c')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x9e7d('0x1d'))?JSON[_0x9e7d('0x1e')](this[_0x9e7d('0x17')](_0x9e7d('0x1d'))):{};},'set':function(_0x36f9e6){return this[_0x9e7d('0x19')]('offlineForm',JSON['stringify'](_0x36f9e6));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x9e7d('0x1f')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9e7d('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9e7d('0x2')]},'forwardOffline':{'type':Sequelize[_0x9e7d('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9e7d('0x20')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x9e7d('0x21')},'offlineMessageBody':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x9e7d('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':_0x9e7d('0x22')},'skipUnmanaged':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':_0x9e7d('0x10')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9e7d('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x9e7d('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9e7d('0x2')]},'notificationTemplate':{'type':Sequelize[_0x9e7d('0xc')],'defaultValue':function(){return _0x9e7d('0x23');}},'notificationSound':{'type':Sequelize[_0x9e7d('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9e7d('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9e7d('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':_0x9e7d('0x24')},'waitForTheAssignedAgent':{'type':Sequelize[_0x9e7d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x9e7d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':_0x9e7d('0x25')},'verticalAlignment':{'type':Sequelize[_0x9e7d('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x9e7d('0x26')},'messagesAlignment':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':_0x9e7d('0x27')},'defaultTitle':{'type':Sequelize[_0x9e7d('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x9e7d('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9e7d('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9e7d('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9e7d('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9e7d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9e7d('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9e7d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':_0x9e7d('0x29')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9e7d('0x6')],'comment':_0x9e7d('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0x9e7d('0x7')],'defaultValue':![],'comment':_0x9e7d('0x2b'),'set':function(_0x36a890){if(!_0x36a890)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x9e7d('0x19')](_0x9e7d('0x2c'),_0x36a890);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9e7d('0x2')]},'vidaooTopic':{'type':Sequelize[_0x9e7d('0x2')],'allowNull':![],'defaultValue':_0x9e7d('0x2d')},'vidaooNote':{'type':Sequelize[_0x9e7d('0x2')],'defaultValue':function(){return _0x9e7d('0x2e');}},'vidaooMetadata':{'type':Sequelize[_0x9e7d('0xc')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x9e7d('0xc')]}}; \ No newline at end of file +var _0x7045=['TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY'];(function(_0x2e0967,_0x3fd097){var _0x180b59=function(_0x1048f2){while(--_0x1048f2){_0x2e0967['push'](_0x2e0967['shift']());}};_0x180b59(++_0x3fd097);}(_0x7045,0x1cc));var _0x5704=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7045[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5704('0x0'));var rs=require(_0x5704('0x1'));module['exports']={'name':{'type':Sequelize[_0x5704('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x3')},'mapKeyOffline':{'type':Sequelize[_0x5704('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x5704('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x4')},'customerAlias':{'type':Sequelize[_0x5704('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5704('0x2')],'allowNull':![],'defaultValue':_0x5704('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5704('0x2')],'allowNull':![],'defaultValue':_0x5704('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x5704('0x2')],'allowNull':![],'defaultValue':_0x5704('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x5704('0x2')]},'animation':{'type':Sequelize[_0x5704('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x5704('0x8')]('rounded',_0x5704('0x9')),'defaultValue':_0x5704('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x5704('0xb')},'start_chat_button':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0xc')},'offline_chat_button':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0xd')},'header_offline':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0xe')},'download_transcript':{'type':Sequelize[_0x5704('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x5704('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x5704('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5704('0x11')]},'closingQuestion':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x14')},'noteTitle':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x15')},'placeholderMessage':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x16')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5704('0x17')},'closingMessageButton':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0xd')},'skipMessageButton':{'type':Sequelize[_0x5704('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x18')},'ratingType':{'type':Sequelize[_0x5704('0x8')](_0x5704('0x19'),_0x5704('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x5704('0xf')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x5704('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x5704('0x1b'),'variable':null,'config':{'placeholder':_0x5704('0x1c'),'type':_0x5704('0x1d'),'required':!![]},'props':{'title':_0x5704('0x1c'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x5704('0x3'),'type':_0x5704('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x5704('0x1e')](_0x5704('0x1f'))?JSON[_0x5704('0x20')](this[_0x5704('0x1e')]('onlineForm')):{};},'set':function(_0x571e54){return this[_0x5704('0x21')]('onlineForm',JSON[_0x5704('0x22')](_0x571e54));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x5704('0x1b'),'props':{'title':_0x5704('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x5704('0x3'),'type':_0x5704('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0x5704('0x23')},'props':{'title':_0x5704('0x23'),'helpText':_0x5704('0x24')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x5704('0x25'))?JSON[_0x5704('0x20')](this['getDataValue'](_0x5704('0x25'))):{};},'set':function(_0x51cce1){return this[_0x5704('0x21')]('offlineForm',JSON[_0x5704('0x22')](_0x51cce1));}},'token':{'type':Sequelize[_0x5704('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x5704('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x5704('0x26')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5704('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x5704('0x28')},'offlineMessageBody':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x5704('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x5704('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x2a')},'sendUnmanaged':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x5704('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x5704('0x2')]},'notificationTemplate':{'type':Sequelize[_0x5704('0x11')],'defaultValue':function(){return _0x5704('0x2b');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x5704('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x5704('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x5704('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x5704('0xf')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x2d')},'messagesAlignment':{'type':Sequelize[_0x5704('0x2')],'defaultValue':_0x5704('0x2e')},'defaultTitle':{'type':Sequelize[_0x5704('0x2')]},'customerAvatar':{'type':Sequelize[_0x5704('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5704('0xf')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x5704('0x2')],'allowNull':![],'defaultValue':_0x5704('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5704('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5704('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x5704('0x30')},'systemAvatar':{'type':Sequelize[_0x5704('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5704('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![],'comment':_0x5704('0x31'),'set':function(_0x5e1fb0){if(!_0x5e1fb0)this[_0x5704('0x21')](_0x5704('0x32'),null);this[_0x5704('0x21')](_0x5704('0x33'),_0x5e1fb0);}},'vidaooEscalation':{'type':Sequelize[_0x5704('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x5704('0x2')]},'vidaooTopic':{'type':Sequelize[_0x5704('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x5704('0x2')],'defaultValue':function(){return _0x5704('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x5704('0x11')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 63b1770..a791a14 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 _0xc95c=['EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','mimetype','server','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','email','NotifyMailAccount','notifyMail','attachments','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','tag','getSnippet','Intervals','getProactiveActions','virtual','License','increment','server/files/chat/iframe.ejs','origin','x-real-ip','connection','remoteAddress','replace','verticalAlignment','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','querystring','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIBadRequestError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','redis','defaults','localhost','socket.io-emitter','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','update','destroy','get','ChatWebsites','name','send','user-agent-parser','setUA','user-agent','getResult','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','model','vendor','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','body','address','forEach','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','testWildcardValidity','find','params','describe','addDisposition','ChatWebsiteId','Disposition','findOne','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','download','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','notify','from','mapKey','MapKey\x20is\x20mandatory','customerIp','No\x20available\x20attributes','updatedAt','includes','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','CmContact','Contacts','DESC','ChatApplication','Applications','interval','applications','orderBy','priority','asc','account','list','List','headers','threadId','closed','ChatInteraction','externalUrl','ContactId','interaction','Writing\x20on\x20closed\x20interaction','contact','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','ChatQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting'];(function(_0x592218,_0xcfde76){var _0xf9329e=function(_0x1e07b8){while(--_0x1e07b8){_0x592218['push'](_0x592218['shift']());}};_0xf9329e(++_0xcfde76);}(_0xc95c,0x18d));var _0xcc95=function(_0x177a9e,_0x51bb94){_0x177a9e=_0x177a9e-0x0;var _0xbec7e4=_0xc95c[_0x177a9e];return _0xbec7e4;};'use strict';var Mustache=require(_0xcc95('0x0'));var util=require(_0xcc95('0x1'));var path=require(_0xcc95('0x2'));var ejs=require(_0xcc95('0x3'));var fs=require('fs');var fs_extra=require(_0xcc95('0x4'));var _=require('lodash');var querystring=require(_0xcc95('0x5'));var htmlToText=require('html-to-text');var Redis=require(_0xcc95('0x6'));var jayson=require(_0xcc95('0x7'));var qs=require(_0xcc95('0x8'));var logger=require(_0xcc95('0x9'))('api');var config=require(_0xcc95('0xa'));var APIBadRequestError=require(_0xcc95('0xb'))[_0xcc95('0xc')];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIOutOfIntervalError=require(_0xcc95('0xb'))['APIOutOfIntervalError'];var APIHandleError=require(_0xcc95('0xb'))[_0xcc95('0xd')];var APIConflictError=require(_0xcc95('0xb'))[_0xcc95('0xe')];var wildcardUtils=require(_0xcc95('0xf'));var URL=require(_0xcc95('0x10'))[_0xcc95('0x11')];var db=require('../../mysqldb')['db'];config[_0xcc95('0x12')]=_[_0xcc95('0x13')](config[_0xcc95('0x12')],{'host':_0xcc95('0x14'),'port':0x18eb});var socket=require(_0xcc95('0x15'))(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);var client=jayson[_0xcc95('0x16')][_0xcc95('0x17')]({'port':0x232c});var client9002=jayson[_0xcc95('0x16')][_0xcc95('0x17')]({'port':0x232a});var client9003=jayson[_0xcc95('0x16')][_0xcc95('0x17')]({'port':0x232b});var client9001=jayson[_0xcc95('0x16')]['http']({'port':0x2329});function respondWithRpcPromise(_0x2c851b,_0x5eee08,_0x2fb561,_0x3a6c5a){return new Promise(function(_0x5130f4,_0x987ea5){var _0x518254=_0x3a6c5a||client;return _0x518254[_0xcc95('0x18')](_0x2c851b,_0x2fb561)[_0xcc95('0x19')](function(_0x43c17f){logger[_0xcc95('0x1a')](_0xcc95('0x1b'),_0x5eee08,_0xcc95('0x1c'));logger[_0xcc95('0x1d')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5eee08,_0xcc95('0x1c'),JSON[_0xcc95('0x1e')](_0x43c17f));if(_0x43c17f[_0xcc95('0x1f')]){if(_0x43c17f[_0xcc95('0x1f')][_0xcc95('0x20')]===0x1f4){logger[_0xcc95('0x1f')](_0xcc95('0x1b'),_0x5eee08,_0x43c17f['error']['message']);return _0x987ea5(_0x43c17f['error'][_0xcc95('0x21')]);}logger[_0xcc95('0x1f')](_0xcc95('0x1b'),_0x5eee08,_0x43c17f[_0xcc95('0x1f')][_0xcc95('0x21')]);return _0x5130f4(_0x43c17f[_0xcc95('0x1f')][_0xcc95('0x21')]);}else{logger[_0xcc95('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x5eee08,_0xcc95('0x1c'));_0x5130f4(_0x43c17f[_0xcc95('0x22')]['message']);}})[_0xcc95('0x23')](function(_0x42ec48){logger['error'](_0xcc95('0x1b'),_0x5eee08,_0x42ec48);_0x987ea5(_0x42ec48);});});}function respondWithStatusCode(_0x538abd,_0x220073){_0x220073=_0x220073||0xcc;return function(_0x3e4d1f){if(_0x3e4d1f){return _0x538abd[_0xcc95('0x24')](_0x220073);}return _0x538abd[_0xcc95('0x25')](_0x220073)[_0xcc95('0x26')]();};}function respondWithResult(_0x2d7f5c,_0x2b5c0d){_0x2b5c0d=_0x2b5c0d||0xc8;return function(_0x4a5c71){if(_0x4a5c71){return _0x2d7f5c[_0xcc95('0x25')](_0x2b5c0d)['json'](_0x4a5c71);}};}function respondWithFilteredResult(_0x3b4af1,_0x48eaa2){return function(_0xcff5ed){if(_0xcff5ed){var _0x4fb26b=typeof _0x48eaa2['offset']===_0xcc95('0x27')&&typeof _0x48eaa2[_0xcc95('0x28')]==='undefined';var _0x32fa47=_0xcff5ed[_0xcc95('0x29')];var _0x457807=_0x4fb26b?0x0:_0x48eaa2[_0xcc95('0x2a')];var _0x51c3ec=_0x4fb26b?_0xcff5ed[_0xcc95('0x29')]:_0x48eaa2[_0xcc95('0x2a')]+_0x48eaa2[_0xcc95('0x28')];var _0x2d2d8d;if(_0x51c3ec>=_0x32fa47){_0x51c3ec=_0x32fa47;_0x2d2d8d=0xc8;}else{_0x2d2d8d=0xce;}_0x3b4af1[_0xcc95('0x25')](_0x2d2d8d);return _0x3b4af1[_0xcc95('0x2b')](_0xcc95('0x2c'),_0x457807+'-'+_0x51c3ec+'/'+_0x32fa47)['json'](_0xcff5ed);}return null;};}function saveUpdates(_0x30af66){return function(_0x4e34e8){if(_0x4e34e8){return _0x4e34e8[_0xcc95('0x2d')](_0x30af66)[_0xcc95('0x19')](function(_0x4054fa){return _0x4054fa;});}return null;};}function removeEntity(_0x24879e){return function(_0x1fc144){if(_0x1fc144){return _0x1fc144[_0xcc95('0x2e')]()['then'](function(){var _0x281033=_0x1fc144[_0xcc95('0x2f')]({'plain':!![]});var _0x2c0dd0=_0xcc95('0x30');return db['UserProfileResource'][_0xcc95('0x2e')]({'where':{'type':_0x2c0dd0,'resourceId':_0x281033['id']}})[_0xcc95('0x19')](function(){return _0x1fc144;});})[_0xcc95('0x19')](function(){_0x24879e['status'](0xcc)[_0xcc95('0x26')]();});}};}function handleEntityNotFound(_0x28f360){return function(_0x84fea1){if(!_0x84fea1){_0x28f360['sendStatus'](0x194);}return _0x84fea1;};}function handleError(_0x38711e,_0x64f5c){_0x64f5c=_0x64f5c||0x1f4;return function(_0x2eb94d){logger[_0xcc95('0x1f')](_0x2eb94d['stack']);if(_0x2eb94d[_0xcc95('0x31')]){delete _0x2eb94d[_0xcc95('0x31')];}_0x38711e['status'](_0x64f5c)[_0xcc95('0x32')](_0x2eb94d);};}function createInteractionObject(_0x5656b2,_0x4e1a4c,_0x3967ef,_0x1d100f){var _0x39f9c4=require(_0xcc95('0x33'));var _0x455ee4=new _0x39f9c4();var _0x9d4732=_0x455ee4[_0xcc95('0x34')](_0x3967ef[_0xcc95('0x35')])[_0xcc95('0x36')]();var _0x589027=_0x4e1a4c['customerIp'];if(_0x3967ef['cf-connecting-ip']){_0x589027=_0x3967ef[_0xcc95('0x37')];}else if(_0x3967ef[_0xcc95('0x38')]){_0x589027=_[_0xcc95('0x39')](_0x3967ef[_0xcc95('0x38')][_0xcc95('0x3a')](','));}return{'ContactId':_0x1d100f['id'],'ChatWebsiteId':_0x5656b2,'from':(_0x1d100f[_0xcc95('0x3b')]||'')+'\x20'+(_0x1d100f[_0xcc95('0x3c')]||''),'customerIp':_0x589027,'customerPort':_0x3967ef[_0xcc95('0x3d')]?_0x3967ef['x-real-port']:null,'referer':_0x4e1a4c[_0xcc95('0x3e')],'browserName':_0x9d4732[_0xcc95('0x3f')][_0xcc95('0x31')]&&_0x9d4732[_0xcc95('0x3f')][_0xcc95('0x40')]?util[_0xcc95('0x41')](_0xcc95('0x42'),_0x9d4732[_0xcc95('0x3f')][_0xcc95('0x31')],_0x9d4732[_0xcc95('0x3f')][_0xcc95('0x40')]):_0xcc95('0x43'),'browserVersion':_0x9d4732['browser'][_0xcc95('0x40')]||_0xcc95('0x43'),'osName':util[_0xcc95('0x41')](_0xcc95('0x42'),_0x9d4732['os'][_0xcc95('0x31')],_0x9d4732['os']['version']),'osVersion':_0x9d4732['os'][_0xcc95('0x40')],'deviceModel':_0x9d4732[_0xcc95('0x44')][_0xcc95('0x45')]&&_0x9d4732['device'][_0xcc95('0x46')]?util[_0xcc95('0x41')]('%s\x20%s\x20%s',_0x9d4732[_0xcc95('0x44')][_0xcc95('0x45')],_0x9d4732['device']['vendor'],_0x9d4732[_0xcc95('0x44')]['type']):null,'deviceVendor':_0x9d4732[_0xcc95('0x44')][_0xcc95('0x46')],'deviceType':_0x9d4732[_0xcc95('0x44')]['type'],'formData':JSON['stringify'](_0x4e1a4c)};}exports[_0xcc95('0x47')]=function(_0x1db76b,_0x160693){var _0x15b8f1={'include':[{'model':db[_0xcc95('0x48')],'as':_0xcc95('0x49')}]},_0x344eff={},_0x953372={'count':0x0,'rows':[]};var _0x4f71a8=_[_0xcc95('0x4a')](db[_0xcc95('0x4b')][_0xcc95('0x4c')],function(_0x369a2b){return{'name':_0x369a2b['fieldName'],'type':_0x369a2b[_0xcc95('0x4d')]['key']};});_0x344eff[_0xcc95('0x45')]=_[_0xcc95('0x4a')](_0x4f71a8,_0xcc95('0x31'));_0x344eff['query']=_[_0xcc95('0x4e')](_0x1db76b[_0xcc95('0x4f')]);_0x344eff[_0xcc95('0x50')]=_[_0xcc95('0x51')](_0x344eff[_0xcc95('0x45')],_0x344eff['query']);_0x15b8f1['attributes']=_[_0xcc95('0x51')](_0x344eff[_0xcc95('0x45')],qs[_0xcc95('0x52')](_0x1db76b[_0xcc95('0x4f')][_0xcc95('0x52')]));_0x15b8f1[_0xcc95('0x53')]=_0x15b8f1[_0xcc95('0x53')][_0xcc95('0x54')]?_0x15b8f1['attributes']:_0x344eff['model'];if(!_0x1db76b[_0xcc95('0x4f')][_0xcc95('0x55')](_0xcc95('0x56'))){_0x15b8f1[_0xcc95('0x28')]=qs[_0xcc95('0x28')](_0x1db76b[_0xcc95('0x4f')]['limit']);_0x15b8f1[_0xcc95('0x2a')]=qs['offset'](_0x1db76b['query'][_0xcc95('0x2a')]);}_0x15b8f1[_0xcc95('0x57')]=qs['sort'](_0x1db76b[_0xcc95('0x4f')][_0xcc95('0x58')]);_0x15b8f1[_0xcc95('0x59')]=qs[_0xcc95('0x50')](_[_0xcc95('0x5a')](_0x1db76b['query'],_0x344eff['filters']),_0x4f71a8);if(_0x1db76b[_0xcc95('0x4f')][_0xcc95('0x5b')]){_0x15b8f1['where']=_[_0xcc95('0x5c')](_0x15b8f1[_0xcc95('0x59')],{'$or':_[_0xcc95('0x4a')](_0x4f71a8,function(_0xe29f18){if(_0xe29f18[_0xcc95('0x4d')]!==_0xcc95('0x5d')){var _0x3df0b9={};_0x3df0b9[_0xe29f18['name']]={'$like':'%'+_0x1db76b[_0xcc95('0x4f')]['filter']+'%'};return _0x3df0b9;}})});}_0x15b8f1=_[_0xcc95('0x5c')]({},_0x15b8f1,_0x1db76b[_0xcc95('0x5e')]);var _0x478718={'where':_0x15b8f1[_0xcc95('0x59')]};return db[_0xcc95('0x4b')]['count'](_0x478718)[_0xcc95('0x19')](function(_0x345ce6){_0x953372[_0xcc95('0x29')]=_0x345ce6;if(_0x1db76b[_0xcc95('0x4f')][_0xcc95('0x5f')]){_0x15b8f1[_0xcc95('0x60')]=[{'all':!![]}];}return db['ChatWebsite'][_0xcc95('0x61')](_0x15b8f1);})[_0xcc95('0x19')](function(_0x425299){_0x953372['rows']=_0x425299;return _0x953372;})[_0xcc95('0x19')](respondWithFilteredResult(_0x160693,_0x15b8f1))[_0xcc95('0x23')](handleError(_0x160693,null));};exports[_0xcc95('0x62')]=function(_0x12662f,_0x952c47){var _0x294f72={'raw':![],'where':{'id':_0x12662f['params']['id']},'include':[{'model':db[_0xcc95('0x48')],'as':_0xcc95('0x49')}]},_0x37e1fe={};_0x37e1fe['model']=_['keys'](db['ChatWebsite'][_0xcc95('0x4c')]);_0x37e1fe[_0xcc95('0x4f')]=_[_0xcc95('0x4e')](_0x12662f[_0xcc95('0x4f')]);_0x37e1fe['filters']=_['intersection'](_0x37e1fe[_0xcc95('0x45')],_0x37e1fe['query']);_0x294f72['attributes']=_[_0xcc95('0x51')](_0x37e1fe[_0xcc95('0x45')],qs['fields'](_0x12662f['query']['fields']));_0x294f72[_0xcc95('0x53')]=_0x294f72['attributes'][_0xcc95('0x54')]?_0x294f72['attributes']:_0x37e1fe[_0xcc95('0x45')];if(_0x12662f[_0xcc95('0x4f')][_0xcc95('0x5f')]){_0x294f72[_0xcc95('0x60')]=[{'all':!![]}];}_0x294f72=_[_0xcc95('0x5c')]({},_0x294f72,_0x12662f[_0xcc95('0x5e')]);return db[_0xcc95('0x4b')]['find'](_0x294f72)['then'](handleEntityNotFound(_0x952c47,null))[_0xcc95('0x19')](respondWithResult(_0x952c47,null))[_0xcc95('0x23')](handleError(_0x952c47,null));};exports['create']=function(_0x414de0,_0x3e0c25){var _0x4ac6f0=null;_0x414de0[_0xcc95('0x63')][_0xcc95('0x64')][_0xcc95('0x3a')](',')[_0xcc95('0x65')](_0x2be08c=>{if(_0x2be08c[_0xcc95('0x66')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x2be08c[_0xcc95('0x66')]())){_0x4ac6f0=new APIBadRequestError('\x22'+_0x2be08c+_0xcc95('0x67'));}});if(_0x4ac6f0){return handleError(_0x3e0c25,null)(_0x4ac6f0);}return db[_0xcc95('0x4b')]['create'](_0x414de0[_0xcc95('0x63')],{})[_0xcc95('0x19')](function(_0x55feb7){var _0x565c23=_0x414de0[_0xcc95('0x68')]['get']({'plain':!![]});if(!_0x565c23)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x565c23['role']===_0xcc95('0x68')){var _0xade1bf=_0x55feb7[_0xcc95('0x2f')]({'plain':!![]});var _0x1e88a8='ChatWebsites';return db[_0xcc95('0x69')]['find']({'where':{'name':_0x1e88a8,'userProfileId':_0x565c23[_0xcc95('0x6a')]},'raw':!![]})['then'](function(_0x129e76){if(_0x129e76&&_0x129e76[_0xcc95('0x6b')]===0x0){return db[_0xcc95('0x6c')][_0xcc95('0x6d')]({'name':_0xade1bf[_0xcc95('0x31')],'resourceId':_0xade1bf['id'],'type':_0x129e76[_0xcc95('0x31')],'sectionId':_0x129e76['id']},{})[_0xcc95('0x19')](function(){return _0x55feb7;});}else{return _0x55feb7;}})[_0xcc95('0x23')](function(_0x5d674a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d674a);throw _0x5d674a;});}return _0x55feb7;})[_0xcc95('0x19')](respondWithResult(_0x3e0c25,0xc9))['catch'](handleError(_0x3e0c25,null));};exports[_0xcc95('0x2d')]=function(_0x107353,_0x346e49){var _0x3c5778=null;_0x107353[_0xcc95('0x63')][_0xcc95('0x64')][_0xcc95('0x3a')](',')['forEach'](_0x1f8694=>{if(_0x1f8694[_0xcc95('0x66')]()!==''&&!wildcardUtils[_0xcc95('0x6e')](_0x1f8694['trim']())){_0x3c5778=new APIBadRequestError('\x22'+_0x1f8694+_0xcc95('0x67'));}});if(_0x3c5778){return handleError(_0x346e49,null)(_0x3c5778);}if(_0x107353[_0xcc95('0x63')]['id']){delete _0x107353[_0xcc95('0x63')]['id'];}return db[_0xcc95('0x4b')][_0xcc95('0x6f')]({'where':{'id':_0x107353[_0xcc95('0x70')]['id']},'include':[{'model':db[_0xcc95('0x48')],'as':_0xcc95('0x49')}]})['then'](handleEntityNotFound(_0x346e49,null))[_0xcc95('0x19')](saveUpdates(_0x107353[_0xcc95('0x63')],null))[_0xcc95('0x19')](respondWithResult(_0x346e49,null))[_0xcc95('0x23')](handleError(_0x346e49,null));};exports[_0xcc95('0x2e')]=function(_0x36d7a2,_0x49be3d){return db[_0xcc95('0x4b')][_0xcc95('0x6f')]({'where':{'id':_0x36d7a2['params']['id']}})[_0xcc95('0x19')](handleEntityNotFound(_0x49be3d,null))[_0xcc95('0x19')](removeEntity(_0x49be3d,null))[_0xcc95('0x23')](handleError(_0x49be3d,null));};exports[_0xcc95('0x71')]=function(_0x36194e,_0x5e049e){return db['ChatWebsite'][_0xcc95('0x71')]()['then'](respondWithResult(_0x5e049e,null))['catch'](handleError(_0x5e049e,null));};exports[_0xcc95('0x72')]=function(_0x498917,_0xa8d78e){if(_0x498917[_0xcc95('0x63')]['id']){delete _0x498917[_0xcc95('0x63')]['id'];}return db[_0xcc95('0x4b')]['find']({'where':{'id':_0x498917[_0xcc95('0x70')]['id']}})[_0xcc95('0x19')](handleEntityNotFound(_0xa8d78e,null))[_0xcc95('0x19')](function(_0x39add2){if(_0x39add2){_0x498917['body'][_0xcc95('0x73')]=_0x39add2['id'];return db[_0xcc95('0x74')][_0xcc95('0x6d')](_0x498917[_0xcc95('0x63')]);}})[_0xcc95('0x19')](respondWithResult(_0xa8d78e,null))[_0xcc95('0x23')](handleError(_0xa8d78e,null));};exports['getDispositions']=function(_0x88acd,_0x1af549){var _0x2723dd={'raw':![],'where':{}};var _0x28f052={};var _0x3e3fc0={'count':0x0,'rows':[]};return db[_0xcc95('0x4b')][_0xcc95('0x75')]({'where':{'id':_0x88acd[_0xcc95('0x70')]['id']}})['then'](handleEntityNotFound(_0x1af549,null))[_0xcc95('0x19')](function(_0x1a1ff2){if(_0x1a1ff2){_0x28f052[_0xcc95('0x45')]=_[_0xcc95('0x4e')](db[_0xcc95('0x74')]['rawAttributes']);_0x28f052[_0xcc95('0x4f')]=_[_0xcc95('0x4e')](_0x88acd['query']);_0x28f052[_0xcc95('0x50')]=_[_0xcc95('0x51')](_0x28f052[_0xcc95('0x45')],_0x28f052[_0xcc95('0x4f')]);_0x2723dd[_0xcc95('0x53')]=_[_0xcc95('0x51')](_0x28f052[_0xcc95('0x45')],qs[_0xcc95('0x52')](_0x88acd[_0xcc95('0x4f')][_0xcc95('0x52')]));_0x2723dd['attributes']=_0x2723dd[_0xcc95('0x53')][_0xcc95('0x54')]?_0x2723dd['attributes']:_0x28f052[_0xcc95('0x45')];if(!_0x88acd['query'][_0xcc95('0x55')](_0xcc95('0x56'))){_0x2723dd[_0xcc95('0x28')]=qs[_0xcc95('0x28')](_0x88acd[_0xcc95('0x4f')][_0xcc95('0x28')]);_0x2723dd['offset']=qs[_0xcc95('0x2a')](_0x88acd[_0xcc95('0x4f')][_0xcc95('0x2a')]);}_0x2723dd[_0xcc95('0x57')]=qs[_0xcc95('0x58')](_0x88acd[_0xcc95('0x4f')][_0xcc95('0x58')]);_0x2723dd['where']=qs[_0xcc95('0x50')](_[_0xcc95('0x5a')](_0x88acd['query'],_0x28f052['filters']));_0x2723dd[_0xcc95('0x59')][_0xcc95('0x73')]=_0x1a1ff2['id'];if(_0x88acd['query'][_0xcc95('0x5b')]){_0x2723dd[_0xcc95('0x59')]=_[_0xcc95('0x5c')](_0x2723dd[_0xcc95('0x59')],{'$or':_[_0xcc95('0x4a')](_0x2723dd[_0xcc95('0x53')],function(_0x5d686d){var _0x56f9d1={};_0x56f9d1[_0x5d686d]={'$like':'%'+_0x88acd[_0xcc95('0x4f')][_0xcc95('0x5b')]+'%'};return _0x56f9d1;})});}_0x2723dd=_[_0xcc95('0x5c')]({},_0x2723dd,_0x88acd[_0xcc95('0x5e')]);return db[_0xcc95('0x74')][_0xcc95('0x29')]({'where':_0x2723dd[_0xcc95('0x59')]})[_0xcc95('0x19')](function(_0x16ff42){_0x3e3fc0[_0xcc95('0x29')]=_0x16ff42;if(_0x88acd[_0xcc95('0x4f')][_0xcc95('0x5f')]){_0x2723dd['include']=[{'all':!![]}];}return db['Disposition'][_0xcc95('0x61')](_0x2723dd);})[_0xcc95('0x19')](function(_0x5f04bb){_0x3e3fc0[_0xcc95('0x76')]=_0x5f04bb;return _0x3e3fc0;});}})[_0xcc95('0x19')](respondWithFilteredResult(_0x1af549,_0x2723dd))['catch'](handleError(_0x1af549,null));};exports[_0xcc95('0x77')]=function(_0x10f2f1,_0xd365c7){return db[_0xcc95('0x4b')][_0xcc95('0x6f')]({'where':{'id':_0x10f2f1[_0xcc95('0x70')]['id']}})[_0xcc95('0x19')](handleEntityNotFound(_0xd365c7,null))[_0xcc95('0x19')](function(_0x2a41fd){if(_0x2a41fd){return _0x2a41fd[_0xcc95('0x77')](_0x10f2f1[_0xcc95('0x4f')][_0xcc95('0x78')]);}})[_0xcc95('0x19')](respondWithStatusCode(_0xd365c7,null))[_0xcc95('0x23')](handleError(_0xd365c7,null));};exports[_0xcc95('0x79')]=function(_0x54166f,_0x818940){if(_0x54166f['body']['id']){delete _0x54166f[_0xcc95('0x63')]['id'];}return db[_0xcc95('0x4b')][_0xcc95('0x6f')]({'where':{'id':_0x54166f[_0xcc95('0x70')]['id']}})['then'](handleEntityNotFound(_0x818940,null))[_0xcc95('0x19')](function(_0x4c25d2){if(_0x4c25d2){_0x54166f[_0xcc95('0x63')]['ChatWebsiteId']=_0x4c25d2['id'];return db['CannedAnswer'][_0xcc95('0x6d')](_0x54166f[_0xcc95('0x63')]);}})['then'](respondWithResult(_0x818940,null))['catch'](handleError(_0x818940,null));};exports[_0xcc95('0x7a')]=function(_0x3e76f8,_0x10798e){var _0x95069={'raw':![],'where':{}};var _0x2b1aa5={};var _0x578372={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x3e76f8[_0xcc95('0x70')]['id']}})['then'](handleEntityNotFound(_0x10798e,null))[_0xcc95('0x19')](function(_0xca70d5){if(_0xca70d5){_0x2b1aa5[_0xcc95('0x45')]=_[_0xcc95('0x4e')](db['CannedAnswer'][_0xcc95('0x4c')]);_0x2b1aa5[_0xcc95('0x4f')]=_['keys'](_0x3e76f8[_0xcc95('0x4f')]);_0x2b1aa5[_0xcc95('0x50')]=_[_0xcc95('0x51')](_0x2b1aa5['model'],_0x2b1aa5[_0xcc95('0x4f')]);_0x95069['attributes']=_[_0xcc95('0x51')](_0x2b1aa5[_0xcc95('0x45')],qs['fields'](_0x3e76f8['query'][_0xcc95('0x52')]));_0x95069['attributes']=_0x95069[_0xcc95('0x53')][_0xcc95('0x54')]?_0x95069[_0xcc95('0x53')]:_0x2b1aa5['model'];if(!_0x3e76f8[_0xcc95('0x4f')]['hasOwnProperty'](_0xcc95('0x56'))){_0x95069[_0xcc95('0x28')]=qs['limit'](_0x3e76f8[_0xcc95('0x4f')][_0xcc95('0x28')]);_0x95069[_0xcc95('0x2a')]=qs[_0xcc95('0x2a')](_0x3e76f8[_0xcc95('0x4f')][_0xcc95('0x2a')]);}_0x95069[_0xcc95('0x57')]=qs[_0xcc95('0x58')](_0x3e76f8[_0xcc95('0x4f')][_0xcc95('0x58')]);_0x95069[_0xcc95('0x59')]=qs[_0xcc95('0x50')](_['pick'](_0x3e76f8[_0xcc95('0x4f')],_0x2b1aa5[_0xcc95('0x50')]));_0x95069[_0xcc95('0x59')][_0xcc95('0x73')]=_0xca70d5['id'];if(_0x3e76f8[_0xcc95('0x4f')][_0xcc95('0x5b')]){_0x95069[_0xcc95('0x59')]=_['merge'](_0x95069[_0xcc95('0x59')],{'$or':_[_0xcc95('0x4a')](_0x95069[_0xcc95('0x53')],function(_0x2d6627){var _0x12a712={};_0x12a712[_0x2d6627]={'$like':'%'+_0x3e76f8[_0xcc95('0x4f')]['filter']+'%'};return _0x12a712;})});}_0x95069=_[_0xcc95('0x5c')]({},_0x95069,_0x3e76f8[_0xcc95('0x5e')]);return db[_0xcc95('0x7b')][_0xcc95('0x29')]({'where':_0x95069['where']})['then'](function(_0x1b6ff2){_0x578372[_0xcc95('0x29')]=_0x1b6ff2;if(_0x3e76f8['query']['includeAll']){_0x95069[_0xcc95('0x60')]=[{'all':!![]}];}return db[_0xcc95('0x7b')][_0xcc95('0x61')](_0x95069);})[_0xcc95('0x19')](function(_0x52ca1b){_0x578372[_0xcc95('0x76')]=_0x52ca1b;return _0x578372;});}})[_0xcc95('0x19')](respondWithFilteredResult(_0x10798e,_0x95069))[_0xcc95('0x23')](handleError(_0x10798e,null));};exports[_0xcc95('0x7c')]=function(_0x376d1b,_0x48ba4e){return db['ChatWebsite']['find']({'where':{'id':_0x376d1b[_0xcc95('0x70')]['id']}})['then'](handleEntityNotFound(_0x48ba4e,null))[_0xcc95('0x19')](function(_0x5454a7){if(_0x5454a7){return _0x5454a7[_0xcc95('0x7c')](_0x376d1b[_0xcc95('0x4f')][_0xcc95('0x78')]);}})[_0xcc95('0x19')](respondWithStatusCode(_0x48ba4e,null))[_0xcc95('0x23')](handleError(_0x48ba4e,null));};exports['addLogo']=function(_0x3ffa08,_0x1cf8ee){_0x3ffa08[_0xcc95('0x63')][_0xcc95('0x7d')]=_0x3ffa08[_0xcc95('0x7e')][_0xcc95('0x7f')];return db[_0xcc95('0x4b')][_0xcc95('0x6f')]({'where':{'id':_0x3ffa08[_0xcc95('0x70')]['id']}})['then'](handleEntityNotFound(_0x1cf8ee,null))[_0xcc95('0x19')](saveUpdates(_0x3ffa08[_0xcc95('0x63')],null))[_0xcc95('0x19')](respondWithResult(_0x1cf8ee,null))[_0xcc95('0x23')](handleError(_0x1cf8ee,null));};exports[_0xcc95('0x80')]=function(_0x1c5b96,_0x106da5){_0x1c5b96[_0xcc95('0x63')]['agentAvatar']=_0x1c5b96[_0xcc95('0x7e')][_0xcc95('0x7f')];return db[_0xcc95('0x4b')][_0xcc95('0x6f')]({'where':{'id':_0x1c5b96[_0xcc95('0x70')]['id']}})[_0xcc95('0x19')](handleEntityNotFound(_0x106da5,null))['then'](saveUpdates(_0x1c5b96[_0xcc95('0x63')],null))[_0xcc95('0x19')](respondWithResult(_0x106da5,null))[_0xcc95('0x23')](handleError(_0x106da5,null));};exports[_0xcc95('0x81')]=function(_0x2fd8c0,_0x201008){_0x2fd8c0[_0xcc95('0x63')][_0xcc95('0x82')]=_0x2fd8c0[_0xcc95('0x7e')]['filename'];return db[_0xcc95('0x4b')][_0xcc95('0x6f')]({'where':{'id':_0x2fd8c0['params']['id']}})[_0xcc95('0x19')](handleEntityNotFound(_0x201008,null))['then'](saveUpdates(_0x2fd8c0['body'],null))['then'](respondWithResult(_0x201008,null))[_0xcc95('0x23')](handleError(_0x201008,null));};exports[_0xcc95('0x83')]=function(_0x46b7f8,_0x4e4df2){_0x46b7f8[_0xcc95('0x63')][_0xcc95('0x84')]=_0x46b7f8['file'][_0xcc95('0x7f')];return db[_0xcc95('0x4b')][_0xcc95('0x6f')]({'where':{'id':_0x46b7f8[_0xcc95('0x70')]['id']}})['then'](handleEntityNotFound(_0x4e4df2,null))[_0xcc95('0x19')](saveUpdates(_0x46b7f8['body'],null))[_0xcc95('0x19')](respondWithResult(_0x4e4df2,null))[_0xcc95('0x23')](handleError(_0x4e4df2,null));};exports['getLogo']=function(_0x52947c,_0x519bff){var _0x487f54=path[_0xcc95('0x85')](config[_0xcc95('0x86')],_0xcc95('0x87'));var _0x237bf4={'where':{'id':_0x52947c[_0xcc95('0x70')]['id']},'attributes':['id',_0xcc95('0x7d')],'raw':!![]};var _0x11f1e3=![];return require(_0xcc95('0x88'))[_0xcc95('0x89')]()[_0xcc95('0x19')](function(_0x1eefc3){if(_0x1eefc3){_0x11f1e3=_0x1eefc3[_0xcc95('0x8a')];}})[_0xcc95('0x19')](function(){return db[_0xcc95('0x4b')][_0xcc95('0x6f')](_0x237bf4);})[_0xcc95('0x19')](handleEntityNotFound(_0x519bff,null))[_0xcc95('0x19')](function(_0x12ceb7){if(_0x12ceb7){if(!_[_0xcc95('0x8b')](_0x12ceb7[_0xcc95('0x7d')])){if(fs[_0xcc95('0x8c')](path[_0xcc95('0x85')](config[_0xcc95('0x86')],'server/files/images/logos/',_0x12ceb7[_0xcc95('0x7d')]))&&_0x11f1e3){_0x487f54=path[_0xcc95('0x85')](config[_0xcc95('0x86')],'server/files/images/logos/',_0x12ceb7[_0xcc95('0x7d')]);}}return _0x519bff[_0xcc95('0x8d')](_0x487f54);}})[_0xcc95('0x23')](handleError(_0x519bff,null));};exports['getAvatar']=function(_0x38a57a,_0x578681){var _0x583f77=path[_0xcc95('0x85')](config['root'],_0xcc95('0x8e'));var _0x26382c={'where':{'id':_0x38a57a['params']['id']},'attributes':['id',_0xcc95('0x8f')],'raw':!![]};return db[_0xcc95('0x4b')][_0xcc95('0x6f')](_0x26382c)['then'](handleEntityNotFound(_0x578681,null))[_0xcc95('0x19')](function(_0x414906){if(_0x414906){if(!_['isNil'](_0x414906[_0xcc95('0x8f')])){if(fs[_0xcc95('0x8c')](path[_0xcc95('0x85')](config[_0xcc95('0x86')],_0xcc95('0x90'),_0x414906[_0xcc95('0x8f')]))){_0x583f77=path[_0xcc95('0x85')](config['root'],'server/files/images/avatars/',_0x414906[_0xcc95('0x8f')]);}}return _0x578681[_0xcc95('0x8d')](_0x583f77);}})[_0xcc95('0x23')](handleError(_0x578681,null));};exports['getCustomerAvatar']=function(_0x4cb73,_0x39df7d){var _0x28f3af=path[_0xcc95('0x85')](config['root'],_0xcc95('0x91'));var _0x3a1003={'where':{'id':_0x4cb73[_0xcc95('0x70')]['id']},'attributes':['id',_0xcc95('0x82'),_0xcc95('0x92')],'raw':!![]};return db[_0xcc95('0x4b')]['find'](_0x3a1003)['then'](handleEntityNotFound(_0x39df7d,null))[_0xcc95('0x19')](function(_0x424fe9){if(_0x424fe9){if(!_[_0xcc95('0x8b')](_0x424fe9[_0xcc95('0x82')])){if(fs[_0xcc95('0x8c')](path[_0xcc95('0x85')](config[_0xcc95('0x86')],_0xcc95('0x90'),_0x424fe9[_0xcc95('0x82')]))&&_0x424fe9[_0xcc95('0x92')]){_0x28f3af=path[_0xcc95('0x85')](config[_0xcc95('0x86')],'server/files/images/avatars/',_0x424fe9['customerAvatar']);}}return _0x39df7d[_0xcc95('0x8d')](_0x28f3af);}})['catch'](handleError(_0x39df7d,null));};exports[_0xcc95('0x93')]=function(_0x5c0504,_0x2aeb){var _0x1afd3c=path['join'](config[_0xcc95('0x86')],_0xcc95('0x94'));var _0x333ddd={'where':{'id':_0x5c0504[_0xcc95('0x70')]['id']},'attributes':['id',_0xcc95('0x84')],'raw':!![]};return db[_0xcc95('0x4b')][_0xcc95('0x6f')](_0x333ddd)[_0xcc95('0x19')](handleEntityNotFound(_0x2aeb,null))['then'](function(_0x27063b){if(_0x27063b){if(!_[_0xcc95('0x8b')](_0x27063b[_0xcc95('0x84')])){if(fs[_0xcc95('0x8c')](path[_0xcc95('0x85')](config[_0xcc95('0x86')],'server/files/images/avatars/',_0x27063b['systemAvatar']))){_0x1afd3c=path[_0xcc95('0x85')](config[_0xcc95('0x86')],_0xcc95('0x90'),_0x27063b[_0xcc95('0x84')]);}}return _0x2aeb['download'](_0x1afd3c);}})[_0xcc95('0x23')](handleError(_0x2aeb,null));};function checkWebsiteInterval(_0x17279f){var _0x4dadc9=_0x17279f[_0xcc95('0x95')];if(!_0x4dadc9){return Promise[_0xcc95('0x96')](_0x17279f);}var _0x2a15b2=_0x17279f[_0xcc95('0x97')]||undefined;return _0x4dadc9[_0xcc95('0x98')](_0x2a15b2)[_0xcc95('0x19')](function(_0x4a2356){if(!_0x4a2356){throw new APIOutOfIntervalError();}return _0x17279f;});}exports[_0xcc95('0x99')]=function(_0x475d57,_0x156c35){var _0x149dce={'body':_0x475d57[_0xcc95('0x63')],'channel':'chat'};var _0x770800=[];var _0x8c2af=[];var _0x3c3b3e={};var _0x214f6a=![];if(_0x475d57[_0xcc95('0x63')]['id']){delete _0x475d57[_0xcc95('0x63')]['id'];}if(_[_0xcc95('0x8b')](_0x475d57['body'][_0xcc95('0x9a')])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0xcc95('0x8b')](_0x475d57[_0xcc95('0x63')][_0xcc95('0x9b')])){throw new APIBadRequestError(_0xcc95('0x9c'));}if(_['isEmpty'](_0x475d57['body']['body'])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x1aadc0=_0x475d57[_0xcc95('0x63')][_0xcc95('0x9d')]&&_0x475d57[_0xcc95('0x63')][_0xcc95('0x3e')];return db['CmContact'][_0xcc95('0x71')]()[_0xcc95('0x19')](function(_0x328731){if(!_0x328731){throw new Error(_0xcc95('0x9e'));}_0x770800=Object[_0xcc95('0x4e')](_0x328731)[_0xcc95('0x5b')](function(_0x2a0abc){return!['createdAt',_0xcc95('0x9f')][_0xcc95('0xa0')](_0x2a0abc);});_0x8c2af=Object[_0xcc95('0x4e')](_0x328731)['filter'](function(_0xa0817c){return!['createdAt',_0xcc95('0x9f'),_0xcc95('0xa1'),_0xcc95('0xa2')]['includes'](_0xa0817c);});if(!_[_0xcc95('0xa0')](_0x8c2af,_0x475d57['body'][_0xcc95('0x9b')])){throw new APIBadRequestError(_0xcc95('0xa3')+_0x8c2af[_0xcc95('0x85')](',\x20'));}_0x3c3b3e[_0x475d57[_0xcc95('0x63')][_0xcc95('0x9b')]]=_0x475d57[_0xcc95('0x63')]['from'];})[_0xcc95('0x19')](function(){return db[_0xcc95('0x4b')][_0xcc95('0x6f')]({'where':{'id':_0x475d57['params']['id']},'include':[{'model':db[_0xcc95('0xa4')],'as':'List','include':[{'model':db[_0xcc95('0xa5')],'as':_0xcc95('0xa6'),'where':_0x3c3b3e,'limit':0x1,'order':[[_0xcc95('0x9f'),_0xcc95('0xa7')]]}]},{'model':db[_0xcc95('0xa8')],'as':_0xcc95('0xa9')},{'model':db[_0xcc95('0x95')],'as':_0xcc95('0x95'),'include':[{'model':db[_0xcc95('0x95')],'as':'Intervals','attributes':['id',_0xcc95('0xaa')],'raw':!![]}]}]});})[_0xcc95('0x19')](function(_0xb6fa84){if(!_0xb6fa84){throw new APINotFoundError(util['format']('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x475d57[_0xcc95('0x70')]['id']));}if(_0x1aadc0){return checkWebsiteInterval(_0xb6fa84);}return _0xb6fa84;})['then'](function(_0x5e4023){_0x149dce['account']=_0x5e4023;_0x149dce[_0xcc95('0xab')]=_[_0xcc95('0xac')](_0x5e4023[_0xcc95('0xa9')],[_0xcc95('0xad')],[_0xcc95('0xae')]);if(_0x149dce[_0xcc95('0xaf')]['Applications']){delete _0x149dce['account']['Applications'];}_0x149dce[_0xcc95('0xb0')]=_0x5e4023[_0xcc95('0xb1')]||{'id':_0x5e4023[_0xcc95('0xa2')]};if(_0x149dce['list']&&_0x149dce[_0xcc95('0xb0')]['Contacts'][_0xcc95('0x54')]){return _0x149dce[_0xcc95('0xb0')][_0xcc95('0xa6')][0x0];}var _0xadcf0e=_[_0xcc95('0x13')](_0x475d57[_0xcc95('0x63')],{'firstName':_0x475d57['body'][_0xcc95('0x9a')],'ListId':_0x5e4023[_0xcc95('0xa2')]});_0xadcf0e[_0x475d57[_0xcc95('0x63')][_0xcc95('0x9b')]]=_0x475d57[_0xcc95('0x63')][_0xcc95('0x9a')];return db['CmContact'][_0xcc95('0x6d')](_0xadcf0e,{'fields':_0x770800,'raw':!![]});})['then'](function(_0x58cf5a){_0x149dce['contact']=_0x58cf5a;var _0x366666=createInteractionObject(_0x475d57[_0xcc95('0x70')]['id'],_0x475d57[_0xcc95('0x63')],_0x475d57[_0xcc95('0xb2')],_0x58cf5a);var _0x73f69d={'ChatWebsiteId':_0x475d57['params']['id']};if(_0x475d57[_0xcc95('0x63')][_0xcc95('0xb3')]){_0x73f69d[_0xcc95('0xb3')]=_0x475d57[_0xcc95('0x63')][_0xcc95('0xb3')];_0x73f69d[_0xcc95('0xb4')]=![];return db[_0xcc95('0xb5')][_0xcc95('0x6f')]({'where':_0x73f69d})[_0xcc95('0x19')](function(_0x5e712c){var _0x1ca4e9=_0x475d57[_0xcc95('0x63')][_0xcc95('0x9d')]&&_0x475d57[_0xcc95('0x63')]['referer'];if(_0x5e712c){_0x214f6a=!![];return _0x5e712c;}else if(!_0x1ca4e9&&_0x5e712c&&_0x5e712c[_0xcc95('0xb4')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x366666[_0xcc95('0xb3')]=_0x475d57[_0xcc95('0x63')][_0xcc95('0xb3')];_0x366666[_0xcc95('0xb6')]=_0x475d57['body'][_0xcc95('0xb6')];return db[_0xcc95('0xb5')][_0xcc95('0x6d')](_0x366666);});}_0x73f69d[_0xcc95('0xb7')]=_0x58cf5a['id'];if(_0x475d57['body'][_0xcc95('0xb8')]&&_0x475d57['body'][_0xcc95('0xb8')]['id']){_0x73f69d['id']=_0x475d57[_0xcc95('0x63')]['interaction']['id'];return db[_0xcc95('0xb5')]['find']({'where':_0x73f69d})[_0xcc95('0x19')](function(_0x294365){var _0xf26188=_0x475d57[_0xcc95('0x63')][_0xcc95('0x9d')]&&_0x475d57[_0xcc95('0x63')]['referer'];if(!_0xf26188&&_0x294365&&_0x294365[_0xcc95('0xb4')]){throw new APIConflictError(_0xcc95('0xb9'));}else if(_0x294365){_0x214f6a=!![];return _0x294365;}else{return db[_0xcc95('0xb5')][_0xcc95('0x6d')](_0x366666);}});}return db[_0xcc95('0xb5')][_0xcc95('0x6d')](_0x366666);})[_0xcc95('0x19')](function(_0x36c137){if(!_0x214f6a){return _0x36c137;}var _0x2e48f8={'from':(_0x149dce[_0xcc95('0xba')]['firstName']||'')+'\x20'+(_0x149dce['contact'][_0xcc95('0x3c')]||'')};if(_0x475d57[_0xcc95('0x63')][_0xcc95('0xb3')]&&_0x475d57[_0xcc95('0x63')][_0xcc95('0xbb')]&&_0x475d57[_0xcc95('0x63')][_0xcc95('0xb3')]!=_0x475d57[_0xcc95('0x63')][_0xcc95('0xbb')]){_0x2e48f8[_0xcc95('0xb3')]=_0x475d57[_0xcc95('0x63')][_0xcc95('0xbb')];}return _0x36c137[_0xcc95('0x2d')](_0x2e48f8);})['then'](function(_0x3687da){_0x149dce['interaction']=_0x3687da[_0xcc95('0x2f')]({'plain':!![]});_0x149dce[_0xcc95('0xb8')][_0xcc95('0xbc')]=!_0x214f6a;if(_0x149dce['interaction'][_0xcc95('0xbc')]){if(_0x149dce[_0xcc95('0xaf')][_0xcc95('0xbd')]){_0x149dce['applications'][_0xcc95('0xbe')]({'id':0x0,'priority':_0x149dce[_0xcc95('0xab')][_0xcc95('0x54')]+0x1,'app':'close','appdata':_0xcc95('0xbf'),'interval':_0xcc95('0xc0')});}}return db[_0xcc95('0xc1')][_0xcc95('0x6d')]({'body':_0x475d57['body']['body'],'ChatWebsiteId':_0x475d57['params']['id'],'ChatInteractionId':_0x3687da['id'],'direction':'in','ContactId':_0x149dce['contact']['id'],'AttachmentId':_0x475d57[_0xcc95('0x63')][_0xcc95('0xc2')]});})[_0xcc95('0x19')](function(_0x46cedc){_0x149dce[_0xcc95('0x21')]=_0x46cedc;if(!_0x149dce[_0xcc95('0xb8')]['UserId']){return;}return db[_0xcc95('0xc3')][_0xcc95('0x6f')]({'attributes':['id','name'],'where':{'id':_0x149dce['interaction'][_0xcc95('0xc4')]}});})[_0xcc95('0x19')](function(_0x5c856c){if(_0x5c856c){_0x149dce[_0xcc95('0xab')][_0xcc95('0xc5')]({'id':0x0,'priority':0x0,'app':_0xcc95('0xc6'),'appdata':_0x5c856c['name']+','+(_0x149dce[_0xcc95('0xaf')]['waitForTheAssignedAgent']||0xa),'interval':_0xcc95('0xc0')});_0x149dce['forcedOwnership']=!![];}if(!_0x149dce[_0xcc95('0xb8')]['queueId']){return;}return db[_0xcc95('0xc7')][_0xcc95('0x6f')]({'attributes':['id',_0xcc95('0x31')],'where':{'id':_0x149dce['interaction'][_0xcc95('0xc8')]}});})[_0xcc95('0x19')](function(_0x9f6cd0){if(_0x9f6cd0){_0x149dce[_0xcc95('0xab')][_0xcc95('0xc5')]({'id':0x0,'priority':0x1,'app':_0xcc95('0xc9'),'appdata':_0x9f6cd0[_0xcc95('0x31')]+','+(_0x149dce[_0xcc95('0xaf')][_0xcc95('0xca')]||0x12c),'interval':_0xcc95('0xc0')});}return respondWithRpcPromise(_0xcc95('0xcb'),_0xcc95('0xcc'),_0x149dce);})[_0xcc95('0x19')](function(_0x2d8d72){respondWithRpcPromise(_0xcc95('0xcd'),_0xcc95('0xcd'),{'event':_0xcc95('0x99'),'message':_0x2d8d72},client9002);return _0x2d8d72;})[_0xcc95('0x19')](respondWithResult(_0x156c35,null))['catch'](APIHandleError(_0x156c35));};exports[_0xcc95('0xce')]=function(_0x42c7ed,_0x11a0f8){var _0x3e62f2,_0x46e8c2,_0x35acc4;var _0x5a2dd4=[];var _0x48c0e3={};var _0x3c3a90=_0x42c7ed[_0xcc95('0xcf')]||[];var _0x97f289=[];var _0x53ef0c;return db['CmContact'][_0xcc95('0x71')]()['then'](function(_0x4232e5){if(!_0x4232e5){throw new db[(_0xcc95('0xd0'))][(_0xcc95('0xd1'))](_0xcc95('0xd2'));}_0x5a2dd4=_[_0xcc95('0xd3')](_[_0xcc95('0x4e')](_0x4232e5),[_0xcc95('0xd4'),_0xcc95('0x9f'),_0xcc95('0xa1'),_0xcc95('0xa2')]);if(_0x42c7ed['body']['id']){delete _0x42c7ed[_0xcc95('0x63')]['id'];}if(_[_0xcc95('0x8b')](_0x42c7ed[_0xcc95('0x63')][_0xcc95('0x9a')])){throw _0x11a0f8[_0xcc95('0x25')](0x1f4)['send'](new db['Sequelize'][(_0xcc95('0xd1'))](_0xcc95('0xd5')));}if(_[_0xcc95('0x8b')](_0x42c7ed[_0xcc95('0x63')]['body'])||_0x42c7ed[_0xcc95('0x63')][_0xcc95('0x63')]===''){throw _0x11a0f8[_0xcc95('0x25')](0x1f4)[_0xcc95('0x32')](new db[(_0xcc95('0xd0'))]['ValidationError'](_0xcc95('0xd6')));}if(_[_0xcc95('0x8b')](_0x42c7ed['body'][_0xcc95('0xd7')])){throw _0x11a0f8[_0xcc95('0x25')](0x1f4)['send'](new db[(_0xcc95('0xd0'))][(_0xcc95('0xd1'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5a2dd4));}if(!_[_0xcc95('0xa0')](_0x5a2dd4,_0x42c7ed[_0xcc95('0x63')]['mapKeyOffline'])){throw _0x11a0f8[_0xcc95('0x25')](0x1f4)[_0xcc95('0x32')](new db[(_0xcc95('0xd0'))][(_0xcc95('0xd1'))](_0xcc95('0xd8')+_0x5a2dd4));}_0x48c0e3[_0x42c7ed['body'][_0xcc95('0xd7')]]=_0x42c7ed[_0xcc95('0x63')][_0xcc95('0x9a')];})[_0xcc95('0x19')](function(){return db[_0xcc95('0x4b')]['find']({'where':{'id':_0x42c7ed['params']['id']},'include':[{'model':db[_0xcc95('0xa4')],'as':_0xcc95('0xb1')},{'model':db['MailAccount'],'as':_0xcc95('0xd9')}]});})[_0xcc95('0x19')](handleEntityNotFound(_0x11a0f8,null))[_0xcc95('0x19')](function(_0x8af0f){if(_0x8af0f&&_0x8af0f['List']){_0x46e8c2=_0x8af0f;var _0x331767=_[_0xcc95('0x13')](_0x42c7ed['body'],{'firstName':_0x42c7ed[_0xcc95('0x63')][_0xcc95('0x9a')],'phone':_0x42c7ed['body'][_0xcc95('0x9a')],'ListId':_0x8af0f[_0xcc95('0xa2')]});_0x331767[_0x42c7ed[_0xcc95('0x63')][_0xcc95('0xd7')]]=_0x42c7ed[_0xcc95('0x63')][_0xcc95('0x9a')];return db['CmContact'][_0xcc95('0xda')]({'where':_0x48c0e3,'defaults':_0x331767});}})[_0xcc95('0xdb')](function(_0x46a8f6){if(_0x46a8f6){_0x35acc4=_0x46a8f6;var _0x30429f=fs[_0xcc95('0xdc')](path['join'](config[_0xcc95('0x86')],_0xcc95('0xdd')),_0xcc95('0xde'));var _0x5d0e54=ejs[_0xcc95('0xdf')](_0x30429f,{'body':_['toPairs'](_0x42c7ed[_0xcc95('0x63')]['body']),'bodyTitle':_0x46e8c2[_0xcc95('0xe0')]});return db[_0xcc95('0xe1')][_0xcc95('0x6d')]({'body':_0x5d0e54,'plainBody':htmlToText['fromString'](_0x5d0e54),'ContactId':_0x46a8f6['id'],'ChatWebsiteId':_0x46e8c2['id']});}})[_0xcc95('0x19')](function(_0x18993d){_0x53ef0c=_0x18993d;if(_0x3c3a90[_0xcc95('0x54')]){var _0x58e8e1=_0x3c3a90[_0xcc95('0x4a')](function(_0x77fc78){return{'name':_0x77fc78['originalname'],'basename':_0x77fc78[_0xcc95('0x7f')],'type':_0x77fc78[_0xcc95('0xe2')],'ChatOfflineMessageId':_0x18993d['id']};});_0x97f289=_0x58e8e1[_0xcc95('0x4a')](_0x3e86e6=>{var _0xcebe63={'filename':_0x3e86e6['name'],'path':path[_0xcc95('0x85')](config[_0xcc95('0x86')],_0xcc95('0xe3'),'files','attachments','offline-chat',_0x3e86e6['basename'])};return _0xcebe63;});if(!_0x46e8c2[_0xcc95('0xe4')]){return db['sequelize'][_0xcc95('0xe5')](function(_0x5778a3){return db[_0xcc95('0xe6')][_0xcc95('0xe7')](_0x58e8e1,{'transaction':_0x5778a3});});}}})[_0xcc95('0x19')](function(){if(_0x53ef0c){_0x3e62f2=_0x53ef0c;return db[_0xcc95('0xd9')][_0xcc95('0x75')]({'where':{'service':!![]},'include':[{'model':db[_0xcc95('0xe8')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xcc95('0xe9')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x4f46fb){if(_0x4f46fb&&_0x4f46fb[_0xcc95('0xea')]&&_0x46e8c2[_0xcc95('0xeb')]&&_0x46e8c2[_0xcc95('0xec')]){var _0x324722=_0x4f46fb[_0xcc95('0xed')]();return respondWithRpcPromise(_0xcc95('0xee'),'sendMail',{'account':_0x324722,'message':{'from':util[_0xcc95('0x41')]('\x22%s\x22\x20<%s>',_0x4f46fb['name'],_0x4f46fb['email']||_0x4f46fb[_0xcc95('0xea')][_0xcc95('0x68')]),'to':_0x46e8c2[_0xcc95('0xec')],'subject':_0x46e8c2[_0xcc95('0xef')],'html':_0x3e62f2['body'],'attachments':_0x97f289}},client9003)[_0xcc95('0x19')](function(){return _0x3e62f2;})[_0xcc95('0x23')](function(_0x51eac3){logger[_0xcc95('0x1f')](_0x51eac3);});}})[_0xcc95('0x19')](function(){if(_0x46e8c2&&_0x46e8c2['openNewInteraction']&&_0x46e8c2[_0xcc95('0xf0')]){var _0x119b8c=[];if(_0x3c3a90[_0xcc95('0x54')]){_0x119b8c=_0x3c3a90['map'](function(_0x26ddce){return{'name':_0x26ddce[_0xcc95('0xf1')],'basename':_0x26ddce[_0xcc95('0x7f')],'type':_0x26ddce[_0xcc95('0xe2')],'ChatOfflineMessageId':_0x53ef0c['id']};});}var _0xef164f;if(!_[_0xcc95('0x8b')](_0x46e8c2[_0xcc95('0xf2')])){var _0x3f3aed=_['map'](_0x42c7ed[_0xcc95('0x63')],function(_0x1e1478){return _0x1e1478;});var _0x53ffc8=_[_0xcc95('0xf3')](_0x3f3aed)[0x0];var _0x204f66=_['mapValues'](_0x53ffc8,function(_0xf09b0){return _0xf09b0;});_0xef164f=_0x204f66[0x1][_0x46e8c2['subjectOffline']];}var _0x3c4177={'from':_0x35acc4['email'],'firstName':_0x35acc4[_0xcc95('0x3b')],'lastName':_0x35acc4[_0xcc95('0x3c')],'mapKey':_0xcc95('0xf4'),'message':{'from':_0x35acc4[_0xcc95('0xf4')],'to':_0x46e8c2[_0xcc95('0xd9')]['email'],'cc':'','subject':_['isNil'](_0xef164f)?_0x46e8c2[_0xcc95('0xef')]:_0xef164f,'messageId':'','sentAt':new Date(),'attach':_0x119b8c[_0xcc95('0x54')],'attachments':_0x119b8c,'originChannel':'Chat','ChatWebsiteId':_0x46e8c2['id'],'ChatOfflineMessageId':_0x3e62f2['id'],'originTo':_0x46e8c2[_0xcc95('0xd9')][_0xcc95('0xf4')]},'body':_0x3e62f2[_0xcc95('0x63')]};var _0x2e2c70={'account':{'id':_0x46e8c2[_0xcc95('0xf0')]},'body':_0x3c4177,'log':_0xcc95('0xf5')};return respondWithRpcPromise(_0xcc95('0xf5'),_0xcc95('0xf6'),_0x2e2c70,client9001)[_0xcc95('0x19')](function(){return _0x3e62f2;})[_0xcc95('0x23')](function(_0x239fd0){logger[_0xcc95('0x1f')](_0x239fd0);});}return;})[_0xcc95('0x19')](function(){if(_0x3e62f2){return _0x3e62f2;}})[_0xcc95('0x19')](respondWithResult(_0x11a0f8,null))[_0xcc95('0x23')](function(){for(var _0x48bbfc of _0x3c3a90){var _0x126e48=path['join'](config[_0xcc95('0x86')],_0xcc95('0xe3'),_0xcc95('0xcf'),_0xcc95('0xf7'),_0xcc95('0xf8'),_0x48bbfc[_0xcc95('0x7f')]);fs_extra[_0xcc95('0xf9')](_0x126e48)['catch'](function(_0x22d1b3){logger['error'](_0xcc95('0xfa'),_0x126e48,_0x22d1b3);});}});};exports['addInteraction']=function(_0x5bfe5d,_0x41124b){return db[_0xcc95('0xb5')][_0xcc95('0x6f')]({'where':{'id':_0x5bfe5d['params']['id']}})[_0xcc95('0x19')](handleEntityNotFound(_0x41124b,null))[_0xcc95('0x19')](function(_0x6dfa3){if(_0x6dfa3){return _0x6dfa3[_0xcc95('0xfb')](_0x5bfe5d['body'][_0xcc95('0x78')],_[_0xcc95('0xfc')](_0x5bfe5d[_0xcc95('0x63')],[_0xcc95('0x78'),'id'])||{});}})['then'](respondWithResult(_0x41124b,null))['catch'](handleError(_0x41124b,null));};exports[_0xcc95('0xfd')]=function(_0x59ca4c,_0x3e9e4c){var _0x260179={'raw':![],'where':{}};var _0x5997b9={};var _0x314d7a={'count':0x0,'rows':[]};return db[_0xcc95('0x4b')][_0xcc95('0x75')]({'where':{'id':_0x59ca4c['params']['id']}})[_0xcc95('0x19')](handleEntityNotFound(_0x3e9e4c,null))['then'](function(_0x399ad6){if(_0x399ad6){_0x5997b9[_0xcc95('0x45')]=_[_0xcc95('0x4e')](db['ChatInteraction'][_0xcc95('0x4c')]);_0x5997b9[_0xcc95('0x4f')]=_[_0xcc95('0x4e')](_0x59ca4c[_0xcc95('0x4f')]);_0x5997b9[_0xcc95('0x50')]=_['intersection'](_0x5997b9[_0xcc95('0x45')],_0x5997b9[_0xcc95('0x4f')]);_0x260179[_0xcc95('0x53')]=_[_0xcc95('0x51')](_0x5997b9[_0xcc95('0x45')],qs[_0xcc95('0x52')](_0x59ca4c[_0xcc95('0x4f')]['fields']));_0x260179[_0xcc95('0x53')]=_0x260179['attributes'][_0xcc95('0x54')]?_0x260179[_0xcc95('0x53')]:_0x5997b9[_0xcc95('0x45')];if(!_0x59ca4c['query']['hasOwnProperty'](_0xcc95('0x56'))){_0x260179[_0xcc95('0x28')]=qs[_0xcc95('0x28')](_0x59ca4c[_0xcc95('0x4f')][_0xcc95('0x28')]);_0x260179[_0xcc95('0x2a')]=qs[_0xcc95('0x2a')](_0x59ca4c[_0xcc95('0x4f')][_0xcc95('0x2a')]);}_0x260179[_0xcc95('0x57')]=qs[_0xcc95('0x58')](_0x59ca4c[_0xcc95('0x4f')]['sort']);_0x260179[_0xcc95('0x59')]=qs[_0xcc95('0x50')](_[_0xcc95('0x5a')](_0x59ca4c[_0xcc95('0x4f')],_0x5997b9[_0xcc95('0x50')]));_0x260179[_0xcc95('0x59')][_0xcc95('0x73')]=_0x399ad6['id'];if(_0x59ca4c[_0xcc95('0x4f')][_0xcc95('0x5b')]){_0x260179['where']=_[_0xcc95('0x5c')](_0x260179[_0xcc95('0x59')],{'$or':_[_0xcc95('0x4a')](_0x260179[_0xcc95('0x53')],function(_0x3f684f){var _0x418039={};_0x418039[_0x3f684f]={'$like':'%'+_0x59ca4c[_0xcc95('0x4f')][_0xcc95('0x5b')]+'%'};return _0x418039;})});}_0x260179=_[_0xcc95('0x5c')]({},_0x260179,_0x59ca4c[_0xcc95('0x5e')]);return db['ChatInteraction'][_0xcc95('0x29')]({'where':_0x260179['where']})[_0xcc95('0x19')](function(_0x4eca18){_0x314d7a[_0xcc95('0x29')]=_0x4eca18;if(_0x59ca4c[_0xcc95('0x4f')][_0xcc95('0x5f')]){_0x260179[_0xcc95('0x60')]=[{'model':db[_0xcc95('0xa5')],'as':_0xcc95('0xfe'),'required':![]},{'model':db['User'],'as':_0xcc95('0xff'),'attributes':[_0xcc95('0x31'),'fullname',_0xcc95('0x100')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xcc95('0x31'),'color'],'where':_0x59ca4c['query']['tag']?{'id':_0x59ca4c[_0xcc95('0x4f')]['tag']}:undefined,'required':_0x59ca4c[_0xcc95('0x4f')][_0xcc95('0x101')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x260179);})[_0xcc95('0x19')](function(_0x44c53d){_0x314d7a[_0xcc95('0x76')]=_0x44c53d;return _0x314d7a;});}})[_0xcc95('0x19')](respondWithFilteredResult(_0x3e9e4c,_0x260179))[_0xcc95('0x23')](handleError(_0x3e9e4c,null));};exports[_0xcc95('0x102')]=function(_0x47dc06,_0x5eae2a){var _0x304c78=0x0;var _0x1a5551=0x0;var _0x17ee68=![];var _0x20d8e7;var _0x1904fd;return db['ChatWebsite']['find']({'where':{'id':_0x47dc06[_0xcc95('0x70')]['id']},'include':[{'model':db[_0xcc95('0x95')],'as':_0xcc95('0x95'),'include':[{'model':db[_0xcc95('0x95')],'as':_0xcc95('0x103'),'attributes':['id',_0xcc95('0xaa')]}]}]})[_0xcc95('0x19')](handleEntityNotFound(_0x5eae2a,null))[_0xcc95('0x19')](function(_0x454baf){if(_0x454baf){_0x20d8e7=_0x454baf;return _0x454baf[_0xcc95('0x104')]({'raw':!![]});}})['then'](function(_0x5434e9){if(_0x20d8e7){if(_0x5434e9){_0x1904fd=_0x5434e9;}}return require(_0xcc95('0x88'))[_0xcc95('0x89')]();})[_0xcc95('0x19')](function(_0x4f62e4){if(_0x4f62e4){_0x1a5551=_0x4f62e4[_0xcc95('0x105')];_0x17ee68=_0x4f62e4[_0xcc95('0x8a')];}})['then'](function(){return db[_0xcc95('0xb5')][_0xcc95('0x29')]({'where':{'closed':![]}});})['then'](function(_0x2838bb){_0x304c78=_0x2838bb;if(_0x1a5551&&_0x2838bb>_0x1a5551){return db[_0xcc95('0x106')]['findOne']({'where':{'id':0x1}})[_0xcc95('0x19')](function(_0x437307){if(_0x437307){_0x437307[_0xcc95('0x107')]('chatLicenseExceeded');}});}})['then'](function(){var _0x1872f9=_0x20d8e7[_0xcc95('0x95')];var _0x1a29cb=_0x20d8e7[_0xcc95('0x97')]||undefined;return _0x1872f9?_0x1872f9['ifTime'](_0x1a29cb):!![];})['then'](function(_0x48932e){var _0x2f42a9=fs[_0xcc95('0xdc')](path[_0xcc95('0x85')](config[_0xcc95('0x86')],_0xcc95('0x108')),_0xcc95('0xde'));var _0x2acbe9='3.9.0';var _0x240b43=![];try{const _0x1240d8=new URL(_0x20d8e7[_0xcc95('0x64')]);_0x20d8e7[_0xcc95('0x64')]=_0x1240d8[_0xcc95('0x109')];}catch(_0x4997f2){}var _0x2b4bf8,_0x3730ba;if(_0x47dc06[_0xcc95('0xb2')][_0xcc95('0x3e')]){_0x2b4bf8=new URL(_0x47dc06[_0xcc95('0xb2')][_0xcc95('0x3e')])[_0xcc95('0x109')];}else if(_0x47dc06[_0xcc95('0xb2')][_0xcc95('0x109')]){_0x2b4bf8=new URL(_0x47dc06[_0xcc95('0xb2')]['origin'])[_0xcc95('0x109')];}else{_0x2b4bf8='http://localhost:9000';}_0x3730ba=typeof _0x20d8e7[_0xcc95('0x64')][_0xcc95('0x3a')](',')['find'](function(_0x2c6118){return wildcardUtils['testWebsiteWithWildcard'](_0x2c6118['trim'](),_0x2b4bf8);})!==_0xcc95('0x27');var _0xfb965={'chatVersion':_0x2acbe9,'chatWebsiteAddressOrigin':_0x3730ba?_0x47dc06[_0xcc95('0xb2')][_0xcc95('0x3e')]:_0x20d8e7[_0xcc95('0x64')],'remote':_0x20d8e7['remote'],'query':querystring[_0xcc95('0x1e')](_[_0xcc95('0x5c')](_0x20d8e7[_0xcc95('0x2f')]({'plain':!![]}),{'customerIp':_0x47dc06[_0xcc95('0xb2')][_0xcc95('0x38')]||_0x47dc06[_0xcc95('0xb2')][_0xcc95('0x10a')]||_0x47dc06[_0xcc95('0x10b')][_0xcc95('0x10c')]||_0x47dc06['ip'],'referer':_0x47dc06['headers']['referer'],'openedInteractions':_0x304c78,'maxInteractions':_0x1a5551,'virtual':_0x17ee68[_0xcc95('0x105')],'online':_0x48932e,'custom':_0x17ee68,'address':_0x3730ba?_0x47dc06[_0xcc95('0xb2')][_0xcc95('0x3e')]:null}))[_0xcc95('0x10d')](/'/g,'\x5c\x27')};_0x5eae2a[_0xcc95('0x32')](ejs[_0xcc95('0xdf')](Mustache[_0xcc95('0xdf')](_0x2f42a9,_0xfb965),{'proactiveActions':_0x1904fd,'alignment':_0x20d8e7['alignment'],'verticalAlignment':_0x20d8e7[_0xcc95('0x10e')],'div_color':_0x20d8e7['color'],'labelText':_0x20d8e7['labelText'],'text_color':_0x20d8e7[_0xcc95('0x10f')],'text_button_color':_0x20d8e7[_0xcc95('0x110')],'button_color':_0x20d8e7[_0xcc95('0x111')],'background_color':_0x20d8e7['backgroundColor'],'hideWhenOffline':_0x20d8e7[_0xcc95('0x112')],'intervalId':_0x20d8e7[_0xcc95('0x113')],'isDevelopment':_0x240b43,'chatVersion':_0x2acbe9}));})[_0xcc95('0x23')](handleError(_0x5eae2a,null));};exports[_0xcc95('0x114')]=function(_0x39ca78,_0x26721c){var _0x18f81a=_0x39ca78[_0xcc95('0x70')]['id'];var _0x50acaa=_0x39ca78[_0xcc95('0x63')];var _0x2dea6c=0xc8;var _0x403613=null;return db[_0xcc95('0x115')]['transaction']({'isolationLevel':db[_0xcc95('0x115')][_0xcc95('0x116')][_0xcc95('0x117')]['READ_COMMITTED']},function(_0xce84d0){return db['ChatWebsite'][_0xcc95('0x75')]({'where':{'id':_0x18f81a},'transaction':_0xce84d0})[_0xcc95('0x19')](function(_0x19bf3d){if(_0x19bf3d){return db['ChatApplication'][_0xcc95('0x2e')]({'where':{'ChatWebsiteId':_0x18f81a},'transaction':_0xce84d0})[_0xcc95('0x19')](function(){var _0x2cb486=_[_0xcc95('0x4a')](_0x50acaa,function(_0x23ffd3){_0x23ffd3[_0xcc95('0x73')]=_0x18f81a;return _0x23ffd3;});return db[_0xcc95('0xa8')][_0xcc95('0xe7')](_0x2cb486,{'transaction':_0xce84d0});});}else{_0x2dea6c=0x194;_0x403613=[];}});})[_0xcc95('0x19')](function(){if(_0x2dea6c!==0x194){return db[_0xcc95('0xa8')][_0xcc95('0x118')]({'where':{'ChatWebsiteId':_0x18f81a},'order':_0xcc95('0xad')})['then'](function(_0x34d29b){_0x403613=_0x34d29b;});}})[_0xcc95('0x23')](function(_0xcfdef8){_0x2dea6c=0x1f4;logger['error'](_0xcfdef8['stack']);if(_0xcfdef8[_0xcc95('0x31')]){delete _0xcfdef8[_0xcc95('0x31')];}_0x403613=_0xcfdef8;})[_0xcc95('0x119')](function(){if(_0x403613===null){_0x26721c['sendStatus'](_0x2dea6c);}else{if(_0x2dea6c===0x1f4){_0x26721c['status'](_0x2dea6c)[_0xcc95('0x32')](_0x403613);}else{_0x26721c[_0xcc95('0x25')](_0x2dea6c)['json'](_0x403613);}}});};exports['getApplications']=function(_0x18b9b4,_0x1c0e9f){var _0x38e82d={};var _0x2ad18a={};var _0x10700b;var _0x35434a;return db[_0xcc95('0x4b')][_0xcc95('0x75')]({'where':{'id':_0x18b9b4['params']['id']}})['then'](handleEntityNotFound(_0x1c0e9f,null))[_0xcc95('0x19')](function(_0x2b7c3f){if(_0x2b7c3f){_0x10700b=_0x2b7c3f;_0x2ad18a[_0xcc95('0x45')]=_['keys'](db[_0xcc95('0xa8')][_0xcc95('0x4c')]);_0x2ad18a[_0xcc95('0x4f')]=_['keys'](_0x18b9b4['query']);_0x2ad18a[_0xcc95('0x50')]=_[_0xcc95('0x51')](_0x2ad18a['model'],_0x2ad18a['query']);_0x38e82d[_0xcc95('0x53')]=_[_0xcc95('0x51')](_0x2ad18a[_0xcc95('0x45')],qs['fields'](_0x18b9b4['query']['fields']));_0x38e82d[_0xcc95('0x53')]=_0x38e82d['attributes']['length']?_0x38e82d['attributes']:_0x2ad18a[_0xcc95('0x45')];_0x38e82d[_0xcc95('0x57')]=qs[_0xcc95('0x58')](_0x18b9b4['query']['sort']);_0x38e82d['where']=qs['filters'](_[_0xcc95('0x5a')](_0x18b9b4['query'],_0x2ad18a['filters']));if(_0x18b9b4[_0xcc95('0x4f')]['filter']){_0x38e82d['where']=_[_0xcc95('0x5c')](_0x38e82d[_0xcc95('0x59')],{'$or':_[_0xcc95('0x4a')](_0x38e82d['attributes'],function(_0x11cf1a){var _0x1bebc9={};_0x1bebc9[_0x11cf1a]={'$like':'%'+_0x18b9b4[_0xcc95('0x4f')]['filter']+'%'};return _0x1bebc9;})});}_0x38e82d=_['merge']({},_0x38e82d,_0x18b9b4[_0xcc95('0x5e')]);return _0x10700b[_0xcc95('0x11a')](_0x38e82d);}})[_0xcc95('0x19')](function(_0x59afac){if(_0x59afac){_0x35434a=_0x59afac[_0xcc95('0x54')];if(!_0x18b9b4[_0xcc95('0x4f')]['hasOwnProperty']('nolimit')){_0x38e82d[_0xcc95('0x28')]=qs['limit'](_0x18b9b4[_0xcc95('0x4f')]['limit']);_0x38e82d[_0xcc95('0x2a')]=qs['offset'](_0x18b9b4['query'][_0xcc95('0x2a')]);}return _0x10700b[_0xcc95('0x11a')](_0x38e82d);}})[_0xcc95('0x19')](function(_0x330179){if(_0x330179){return _0x330179?{'count':_0x35434a,'rows':_0x330179}:null;}})[_0xcc95('0x19')](respondWithResult(_0x1c0e9f,null))['catch'](handleError(_0x1c0e9f,null));};exports[_0xcc95('0x11b')]=function(_0x2fe7b5,_0x35ed2c){return db[_0xcc95('0x11c')][_0xcc95('0x6f')]({'where':{'id':_0x2fe7b5[_0xcc95('0x70')]['id']}})[_0xcc95('0x19')](handleEntityNotFound(_0x35ed2c,null))['then'](function(_0x27c867){if(_0x27c867){return _0x27c867[_0xcc95('0x11b')](_0x2fe7b5['body'][_0xcc95('0x78')],_[_0xcc95('0xfc')](_0x2fe7b5[_0xcc95('0x63')],[_0xcc95('0x78'),'id'])||{});}})[_0xcc95('0x19')](respondWithResult(_0x35ed2c,null))[_0xcc95('0x23')](handleError(_0x35ed2c,null));};exports[_0xcc95('0x104')]=function(_0x451daa,_0x32f6c2){var _0x2946f0={};var _0x1f4fbc={};var _0x4f47da;var _0x3cf906;return db['ChatWebsite'][_0xcc95('0x75')]({'where':{'id':_0x451daa[_0xcc95('0x70')]['id']}})[_0xcc95('0x19')](handleEntityNotFound(_0x32f6c2,null))[_0xcc95('0x19')](function(_0x1f4fb5){if(_0x1f4fb5){_0x4f47da=_0x1f4fb5;_0x1f4fbc[_0xcc95('0x45')]=_[_0xcc95('0x4e')](db[_0xcc95('0x11d')][_0xcc95('0x4c')]);_0x1f4fbc[_0xcc95('0x4f')]=_[_0xcc95('0x4e')](_0x451daa[_0xcc95('0x4f')]);_0x1f4fbc[_0xcc95('0x50')]=_[_0xcc95('0x51')](_0x1f4fbc['model'],_0x1f4fbc[_0xcc95('0x4f')]);_0x2946f0[_0xcc95('0x53')]=_[_0xcc95('0x51')](_0x1f4fbc[_0xcc95('0x45')],qs[_0xcc95('0x52')](_0x451daa[_0xcc95('0x4f')][_0xcc95('0x52')]));_0x2946f0['attributes']=_0x2946f0[_0xcc95('0x53')][_0xcc95('0x54')]?_0x2946f0[_0xcc95('0x53')]:_0x1f4fbc[_0xcc95('0x45')];_0x2946f0[_0xcc95('0x57')]=qs[_0xcc95('0x58')](_0x451daa['query'][_0xcc95('0x58')]);_0x2946f0[_0xcc95('0x59')]=qs[_0xcc95('0x50')](_[_0xcc95('0x5a')](_0x451daa[_0xcc95('0x4f')],_0x1f4fbc[_0xcc95('0x50')]));if(_0x451daa['query'][_0xcc95('0x5b')]){_0x2946f0['where']=_[_0xcc95('0x5c')](_0x2946f0[_0xcc95('0x59')],{'$or':_['map'](_0x2946f0['attributes'],function(_0x531ae5){var _0x508b86={};_0x508b86[_0x531ae5]={'$like':'%'+_0x451daa['query']['filter']+'%'};return _0x508b86;})});}_0x2946f0=_[_0xcc95('0x5c')]({},_0x2946f0,_0x451daa[_0xcc95('0x5e')]);return _0x4f47da[_0xcc95('0x104')](_0x2946f0);}})['then'](function(_0x3a496a){if(_0x3a496a){_0x3cf906=_0x3a496a[_0xcc95('0x54')];if(!_0x451daa[_0xcc95('0x4f')][_0xcc95('0x55')](_0xcc95('0x56'))){_0x2946f0[_0xcc95('0x28')]=qs[_0xcc95('0x28')](_0x451daa[_0xcc95('0x4f')]['limit']);_0x2946f0[_0xcc95('0x2a')]=qs[_0xcc95('0x2a')](_0x451daa[_0xcc95('0x4f')][_0xcc95('0x2a')]);}return _0x4f47da[_0xcc95('0x104')](_0x2946f0);}})[_0xcc95('0x19')](function(_0x468668){if(_0x468668){return _0x468668?{'count':_0x3cf906,'rows':_0x468668}:null;}})['then'](respondWithResult(_0x32f6c2,null))['catch'](handleError(_0x32f6c2,null));};exports[_0xcc95('0x11e')]=function(_0x7d70e3,_0x185a66){var _0x269a51=_0x7d70e3['query'][_0xcc95('0x11f')]===_0xcc95('0x120')?_0xcc95('0x121'):_0xcc95('0x122');return db[_0xcc95('0x4b')]['find']({'attributes':['id',_0x269a51],'where':{'id':_0x7d70e3[_0xcc95('0x70')]['id']}})[_0xcc95('0x19')](handleEntityNotFound(_0x185a66,null))[_0xcc95('0x19')](function(_0x3f88c6){if(_0x3f88c6){var _0x32a824=_0x3f88c6[_0x269a51];var _0x314374=_0x32a824&&_0x32a824[_0xcc95('0x123')]?_0x32a824['items']:[];_0x185a66[_0xcc95('0x32')]({'fromKey':_['isNil'](_0x32a824[_0xcc95('0x124')])?undefined:_0x32a824[_0xcc95('0x124')],'count':_0x314374[_0xcc95('0x54')],'rows':_0x314374});}})['catch'](handleError(_0x185a66,null));};exports[_0xcc95('0x125')]=function(_0x2ef060,_0xc8e4f0){var _0x1c12e2={'raw':![],'where':{}};var _0x233ae8={};var _0x5f1240={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcc95('0x75')]({'where':{'id':_0x2ef060[_0xcc95('0x70')]['id']}})[_0xcc95('0x19')](handleEntityNotFound(_0xc8e4f0,null))[_0xcc95('0x19')](function(_0x415514){if(_0x415514){_0x233ae8[_0xcc95('0x45')]=_[_0xcc95('0x4e')](db[_0xcc95('0xe1')][_0xcc95('0x4c')]);_0x233ae8[_0xcc95('0x4f')]=_[_0xcc95('0x4e')](_0x2ef060[_0xcc95('0x4f')]);_0x233ae8[_0xcc95('0x50')]=_[_0xcc95('0x51')](_0x233ae8['model'],_0x233ae8[_0xcc95('0x4f')]);_0x1c12e2[_0xcc95('0x53')]=_[_0xcc95('0x51')](_0x233ae8[_0xcc95('0x45')],qs[_0xcc95('0x52')](_0x2ef060['query']['fields']));_0x1c12e2['attributes']=_0x1c12e2[_0xcc95('0x53')][_0xcc95('0x54')]?_0x1c12e2['attributes']:_0x233ae8[_0xcc95('0x45')];if(!_0x2ef060[_0xcc95('0x4f')]['hasOwnProperty']('nolimit')){_0x1c12e2[_0xcc95('0x28')]=qs[_0xcc95('0x28')](_0x2ef060[_0xcc95('0x4f')]['limit']);_0x1c12e2['offset']=qs[_0xcc95('0x2a')](_0x2ef060[_0xcc95('0x4f')][_0xcc95('0x2a')]);}_0x1c12e2[_0xcc95('0x57')]=qs[_0xcc95('0x58')](_0x2ef060[_0xcc95('0x4f')][_0xcc95('0x58')]);_0x1c12e2['where']=qs[_0xcc95('0x50')](_['pick'](_0x2ef060[_0xcc95('0x4f')],_0x233ae8['filters']));_0x1c12e2['where']['ChatWebsiteId']=_0x415514['id'];if(_0x2ef060[_0xcc95('0x4f')][_0xcc95('0x5b')]){_0x1c12e2[_0xcc95('0x59')]=_[_0xcc95('0x5c')](_0x1c12e2['where'],{'$or':_[_0xcc95('0x4a')](_0x1c12e2[_0xcc95('0x53')],function(_0x3d478a){var _0x3bff69={};_0x3bff69[_0x3d478a]={'$like':'%'+_0x2ef060['query'][_0xcc95('0x5b')]+'%'};return _0x3bff69;})});}_0x1c12e2=_['merge']({},_0x1c12e2,_0x2ef060['options']);return db[_0xcc95('0xe1')]['count']({'where':_0x1c12e2[_0xcc95('0x59')]})['then'](function(_0x245d3e){_0x5f1240[_0xcc95('0x29')]=_0x245d3e;if(_0x2ef060[_0xcc95('0x4f')][_0xcc95('0x5f')]){_0x1c12e2[_0xcc95('0x60')]=[{'all':!![]}];}else{_0x1c12e2[_0xcc95('0x60')]=[{'model':db[_0xcc95('0xa5')],'as':_0xcc95('0xfe'),'required':![]},{'model':db[_0xcc95('0xe6')],'as':_0xcc95('0x126'),'required':![]}];}return db[_0xcc95('0xe1')][_0xcc95('0x61')](_0x1c12e2);})[_0xcc95('0x19')](function(_0x114d5d){_0x5f1240[_0xcc95('0x76')]=_0x114d5d;return _0x5f1240;});}})['then'](respondWithFilteredResult(_0xc8e4f0,_0x1c12e2))['catch'](handleError(_0xc8e4f0,null));};exports[_0xcc95('0x127')]=function(_0x4161c9,_0x4f3b75){return db[_0xcc95('0x4b')]['find']({'where':{'id':_0x4161c9[_0xcc95('0x70')]['id']}})[_0xcc95('0x19')](handleEntityNotFound(_0x4f3b75,null))['then'](function(_0x50d115){if(_0x50d115){return _0x50d115[_0xcc95('0x127')](_0x4161c9[_0xcc95('0x63')]['ids'],_['omit'](_0x4161c9[_0xcc95('0x63')],['ids','id'])||{})[_0xcc95('0xdb')](function(_0x52a7b4){for(var _0x499dcf=0x0;_0x499dcf<_0x4161c9[_0xcc95('0x63')]['ids'][_0xcc95('0x54')];_0x499dcf+=0x1){socket[_0xcc95('0x128')](_0xcc95('0x129'),{'UserId':Number(_0x4161c9[_0xcc95('0x63')][_0xcc95('0x78')][_0x499dcf]),'ChatWebsiteId':Number(_0x4161c9['params']['id'])});}return _0x52a7b4;});}})[_0xcc95('0x19')](respondWithResult(_0x4f3b75,null))[_0xcc95('0x23')](handleError(_0x4f3b75,null));};exports['removeAgents']=function(_0x3952eb,_0x108b73){return db[_0xcc95('0x4b')][_0xcc95('0x6f')]({'where':{'id':_0x3952eb[_0xcc95('0x70')]['id']}})[_0xcc95('0x19')](handleEntityNotFound(_0x108b73,null))[_0xcc95('0x19')](function(_0x247dad){if(_0x247dad){return _0x247dad['removeAgents'](_0x3952eb[_0xcc95('0x4f')]['ids'])[_0xcc95('0x19')](function(){if(_[_0xcc95('0x12a')](_0x3952eb[_0xcc95('0x4f')][_0xcc95('0x78')])){for(var _0x559e4d=0x0;_0x559e4d<_0x3952eb[_0xcc95('0x4f')][_0xcc95('0x78')][_0xcc95('0x54')];_0x559e4d+=0x1){socket[_0xcc95('0x128')](_0xcc95('0x12b'),{'UserId':Number(_0x3952eb[_0xcc95('0x4f')][_0xcc95('0x78')][_0x559e4d]),'ChatWebsiteId':Number(_0x3952eb[_0xcc95('0x70')]['id'])});}}else{socket[_0xcc95('0x128')](_0xcc95('0x12b'),{'UserId':Number(_0x3952eb[_0xcc95('0x4f')][_0xcc95('0x78')]),'ChatWebsiteId':Number(_0x3952eb['params']['id'])});}});}})[_0xcc95('0x19')](respondWithStatusCode(_0x108b73,null))['catch'](handleError(_0x108b73,null));};exports[_0xcc95('0x12c')]=function(_0x218f1a,_0x88c5d1){var _0x172498={};var _0x38afa7={};var _0x1ac84a;var _0x1cf519;return db[_0xcc95('0x4b')][_0xcc95('0x75')]({'where':{'id':_0x218f1a[_0xcc95('0x70')]['id']}})[_0xcc95('0x19')](handleEntityNotFound(_0x88c5d1,null))[_0xcc95('0x19')](function(_0x302a46){if(_0x302a46){_0x1ac84a=_0x302a46;_0x38afa7[_0xcc95('0x45')]=_[_0xcc95('0x4e')](db[_0xcc95('0xc3')]['rawAttributes']);_0x38afa7[_0xcc95('0x4f')]=_[_0xcc95('0x4e')](_0x218f1a[_0xcc95('0x4f')]);_0x38afa7['filters']=_['intersection'](_0x38afa7[_0xcc95('0x45')],_0x38afa7[_0xcc95('0x4f')]);_0x172498['attributes']=_[_0xcc95('0x51')](_0x38afa7[_0xcc95('0x45')],qs[_0xcc95('0x52')](_0x218f1a[_0xcc95('0x4f')][_0xcc95('0x52')]));_0x172498['attributes']=_0x172498['attributes']['length']?_0x172498['attributes']:_0x38afa7[_0xcc95('0x45')];_0x172498[_0xcc95('0x57')]=qs['sort'](_0x218f1a['query'][_0xcc95('0x58')]);_0x172498['where']=qs[_0xcc95('0x50')](_['pick'](_0x218f1a['query'],_0x38afa7[_0xcc95('0x50')]));if(_0x218f1a[_0xcc95('0x4f')]['filter']){_0x172498['where']=_[_0xcc95('0x5c')](_0x172498[_0xcc95('0x59')],{'$or':_[_0xcc95('0x4a')](_0x172498[_0xcc95('0x53')],function(_0x427c6e){var _0x2531bc={};_0x2531bc[_0x427c6e]={'$like':'%'+_0x218f1a[_0xcc95('0x4f')][_0xcc95('0x5b')]+'%'};return _0x2531bc;})});}_0x172498=_[_0xcc95('0x5c')]({},_0x172498,_0x218f1a[_0xcc95('0x5e')]);return _0x1ac84a[_0xcc95('0x12c')](_0x172498);}})[_0xcc95('0x19')](function(_0x5ac2af){if(_0x5ac2af){_0x1cf519=_0x5ac2af[_0xcc95('0x54')];if(!_0x218f1a['query'][_0xcc95('0x55')](_0xcc95('0x56'))){_0x172498[_0xcc95('0x28')]=qs[_0xcc95('0x28')](_0x218f1a[_0xcc95('0x4f')][_0xcc95('0x28')]);_0x172498[_0xcc95('0x2a')]=qs[_0xcc95('0x2a')](_0x218f1a[_0xcc95('0x4f')]['offset']);}return _0x1ac84a[_0xcc95('0x12c')](_0x172498);}})[_0xcc95('0x19')](function(_0x28efd7){if(_0x28efd7){return _0x28efd7?{'count':_0x1cf519,'rows':_0x28efd7}:null;}})['then'](respondWithResult(_0x88c5d1,null))[_0xcc95('0x23')](handleError(_0x88c5d1,null));}; \ No newline at end of file +var _0x4e8a=['*,*,*,*','ChatMessage','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','startRouting','EventManager','offline','Sequelize','no\x20available\x20attributes','difference','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','utf8','render','toPairs','offlineMessageBody','originalname','mimetype','server','files','attachments','basename','openNewInteraction','sequelize','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','getSnippet','getProactiveActions','virtual','custom','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.9.0','headers','replace','testWebsiteWithWildcard','remote','x-real-ip','connection','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','bulkCreate','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachment','Attachments','addAgents','omit','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','jayson/promise','../../components/parsers/qs','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','handleError','APIConflictError','URL','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','offset','undefined','limit','count','status','Content-Range','update','then','get','ChatWebsites','UserProfileResource','stack','name','send','user-agent-parser','user-agent','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','%s\x20%s\x20%s','device','model','vendor','type','stringify','Pause','map','ChatWebsite','fieldName','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','options','where','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','find','create','body','address','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','testWildcardValidity','describe','ChatWebsiteId','Disposition','getDispositions','removeDispositions','CannedAnswer','getAnswers','findOne','pick','removeAnswers','ids','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','notify','chat','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','customerIp','createdAt','updatedAt','CompanyId','includes','mapKey','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','CmContact','Contacts','DESC','Applications','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','list','ListId','defaults','contact','threadId','closed','ChatInteraction','externalUrl','ContactId','interaction','Writing\x20on\x20closed\x20interaction','lastName','messageId','created','push','close','unmanaged'];(function(_0x2d88d5,_0x166b23){var _0x13edaa=function(_0xa8dfb1){while(--_0xa8dfb1){_0x2d88d5['push'](_0x2d88d5['shift']());}};_0x13edaa(++_0x166b23);}(_0x4e8a,0x1ae));var _0xa4e8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4e8a[_0x3dd15e];return _0x231fd0;};'use strict';var Mustache=require(_0xa4e8('0x0'));var util=require(_0xa4e8('0x1'));var path=require(_0xa4e8('0x2'));var ejs=require(_0xa4e8('0x3'));var fs=require('fs');var fs_extra=require(_0xa4e8('0x4'));var _=require(_0xa4e8('0x5'));var querystring=require(_0xa4e8('0x6'));var htmlToText=require('html-to-text');var Redis=require(_0xa4e8('0x7'));var jayson=require(_0xa4e8('0x8'));var qs=require(_0xa4e8('0x9'));var logger=require('../../config/logger')(_0xa4e8('0xa'));var config=require(_0xa4e8('0xb'));var APIBadRequestError=require(_0xa4e8('0xc'))[_0xa4e8('0xd')];var APINotFoundError=require('../../errors/api')[_0xa4e8('0xe')];var APIOutOfIntervalError=require('../../errors/api')['APIOutOfIntervalError'];var APIHandleError=require('../../errors/api')[_0xa4e8('0xf')];var APIConflictError=require(_0xa4e8('0xc'))[_0xa4e8('0x10')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require('url')[_0xa4e8('0x11')];var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xa4e8('0x12')],{'host':_0xa4e8('0x13'),'port':0x18eb});var socket=require(_0xa4e8('0x14'))(new Redis(config['redis']));require(_0xa4e8('0x15'))[_0xa4e8('0x16')](socket);var client=jayson[_0xa4e8('0x17')][_0xa4e8('0x18')]({'port':0x232c});var client9002=jayson['client'][_0xa4e8('0x18')]({'port':0x232a});var client9003=jayson['client'][_0xa4e8('0x18')]({'port':0x232b});var client9001=jayson[_0xa4e8('0x17')][_0xa4e8('0x18')]({'port':0x2329});function respondWithRpcPromise(_0xafc910,_0x4e6467,_0x5b9c52,_0x37bbc8){return new Promise(function(_0x5c16b0,_0x43b6ce){var _0x158767=_0x37bbc8||client;return _0x158767[_0xa4e8('0x19')](_0xafc910,_0x5b9c52)['then'](function(_0xb85874){logger[_0xa4e8('0x1a')](_0xa4e8('0x1b'),_0x4e6467,_0xa4e8('0x1c'));logger[_0xa4e8('0x1d')](_0xa4e8('0x1e'),_0x4e6467,_0xa4e8('0x1c'),JSON['stringify'](_0xb85874));if(_0xb85874['error']){if(_0xb85874[_0xa4e8('0x1f')][_0xa4e8('0x20')]===0x1f4){logger['error'](_0xa4e8('0x1b'),_0x4e6467,_0xb85874['error'][_0xa4e8('0x21')]);return _0x43b6ce(_0xb85874[_0xa4e8('0x1f')][_0xa4e8('0x21')]);}logger[_0xa4e8('0x1f')]('ChatWebsite,\x20%s,\x20%s',_0x4e6467,_0xb85874[_0xa4e8('0x1f')][_0xa4e8('0x21')]);return _0x5c16b0(_0xb85874[_0xa4e8('0x1f')][_0xa4e8('0x21')]);}else{logger[_0xa4e8('0x1a')](_0xa4e8('0x1b'),_0x4e6467,_0xa4e8('0x1c'));_0x5c16b0(_0xb85874[_0xa4e8('0x22')]['message']);}})[_0xa4e8('0x23')](function(_0x5578fb){logger['error'](_0xa4e8('0x1b'),_0x4e6467,_0x5578fb);_0x43b6ce(_0x5578fb);});});}function respondWithStatusCode(_0x138bd1,_0x27d06b){_0x27d06b=_0x27d06b||0xcc;return function(_0x325e42){if(_0x325e42){return _0x138bd1[_0xa4e8('0x24')](_0x27d06b);}return _0x138bd1['status'](_0x27d06b)[_0xa4e8('0x25')]();};}function respondWithResult(_0x1bad49,_0x2cc633){_0x2cc633=_0x2cc633||0xc8;return function(_0x99a877){if(_0x99a877){return _0x1bad49['status'](_0x2cc633)['json'](_0x99a877);}};}function respondWithFilteredResult(_0x833308,_0x231702){return function(_0x38488a){if(_0x38488a){var _0x1599e7=typeof _0x231702[_0xa4e8('0x26')]===_0xa4e8('0x27')&&typeof _0x231702[_0xa4e8('0x28')]==='undefined';var _0x40051f=_0x38488a[_0xa4e8('0x29')];var _0x44bc23=_0x1599e7?0x0:_0x231702[_0xa4e8('0x26')];var _0x60faed=_0x1599e7?_0x38488a[_0xa4e8('0x29')]:_0x231702[_0xa4e8('0x26')]+_0x231702[_0xa4e8('0x28')];var _0x2344ce;if(_0x60faed>=_0x40051f){_0x60faed=_0x40051f;_0x2344ce=0xc8;}else{_0x2344ce=0xce;}_0x833308[_0xa4e8('0x2a')](_0x2344ce);return _0x833308['set'](_0xa4e8('0x2b'),_0x44bc23+'-'+_0x60faed+'/'+_0x40051f)['json'](_0x38488a);}return null;};}function saveUpdates(_0x1455e1){return function(_0x3ec8d5){if(_0x3ec8d5){return _0x3ec8d5[_0xa4e8('0x2c')](_0x1455e1)['then'](function(_0x488156){return _0x488156;});}return null;};}function removeEntity(_0x190021){return function(_0x19928a){if(_0x19928a){return _0x19928a['destroy']()[_0xa4e8('0x2d')](function(){var _0x5a0205=_0x19928a[_0xa4e8('0x2e')]({'plain':!![]});var _0x136270=_0xa4e8('0x2f');return db[_0xa4e8('0x30')]['destroy']({'where':{'type':_0x136270,'resourceId':_0x5a0205['id']}})[_0xa4e8('0x2d')](function(){return _0x19928a;});})[_0xa4e8('0x2d')](function(){_0x190021[_0xa4e8('0x2a')](0xcc)[_0xa4e8('0x25')]();});}};}function handleEntityNotFound(_0x4875fe){return function(_0xe90ff){if(!_0xe90ff){_0x4875fe[_0xa4e8('0x24')](0x194);}return _0xe90ff;};}function handleError(_0x54d7a7,_0x270e6d){_0x270e6d=_0x270e6d||0x1f4;return function(_0x2ea4d6){logger[_0xa4e8('0x1f')](_0x2ea4d6[_0xa4e8('0x31')]);if(_0x2ea4d6['name']){delete _0x2ea4d6[_0xa4e8('0x32')];}_0x54d7a7[_0xa4e8('0x2a')](_0x270e6d)[_0xa4e8('0x33')](_0x2ea4d6);};}function createInteractionObject(_0x4e4e9e,_0x45daad,_0x9c7991,_0x2e4f01){var _0x2287bd=require(_0xa4e8('0x34'));var _0x2ff0a9=new _0x2287bd();var _0x19b200=_0x2ff0a9['setUA'](_0x9c7991[_0xa4e8('0x35')])['getResult']();var _0x596898=_0x45daad['customerIp'];if(_0x9c7991['cf-connecting-ip']){_0x596898=_0x9c7991[_0xa4e8('0x36')];}else if(_0x9c7991[_0xa4e8('0x37')]){_0x596898=_[_0xa4e8('0x38')](_0x9c7991[_0xa4e8('0x37')]['split'](','));}return{'ContactId':_0x2e4f01['id'],'ChatWebsiteId':_0x4e4e9e,'from':(_0x2e4f01[_0xa4e8('0x39')]||'')+'\x20'+(_0x2e4f01['lastName']||''),'customerIp':_0x596898,'customerPort':_0x9c7991[_0xa4e8('0x3a')]?_0x9c7991[_0xa4e8('0x3a')]:null,'referer':_0x45daad[_0xa4e8('0x3b')],'browserName':_0x19b200[_0xa4e8('0x3c')][_0xa4e8('0x32')]&&_0x19b200[_0xa4e8('0x3c')][_0xa4e8('0x3d')]?util['format'](_0xa4e8('0x3e'),_0x19b200[_0xa4e8('0x3c')][_0xa4e8('0x32')],_0x19b200['browser'][_0xa4e8('0x3d')]):_0xa4e8('0x3f'),'browserVersion':_0x19b200[_0xa4e8('0x3c')][_0xa4e8('0x3d')]||_0xa4e8('0x3f'),'osName':util[_0xa4e8('0x40')](_0xa4e8('0x3e'),_0x19b200['os']['name'],_0x19b200['os'][_0xa4e8('0x3d')]),'osVersion':_0x19b200['os']['version'],'deviceModel':_0x19b200['device']['model']&&_0x19b200['device']['vendor']?util['format'](_0xa4e8('0x41'),_0x19b200[_0xa4e8('0x42')][_0xa4e8('0x43')],_0x19b200[_0xa4e8('0x42')][_0xa4e8('0x44')],_0x19b200[_0xa4e8('0x42')][_0xa4e8('0x45')]):null,'deviceVendor':_0x19b200[_0xa4e8('0x42')][_0xa4e8('0x44')],'deviceType':_0x19b200[_0xa4e8('0x42')][_0xa4e8('0x45')],'formData':JSON[_0xa4e8('0x46')](_0x45daad)};}exports['index']=function(_0x25da92,_0x59f528){var _0x32f10a={'include':[{'model':db[_0xa4e8('0x47')],'as':'mandatoryDispositionPause'}]},_0x51e858={},_0x2a8883={'count':0x0,'rows':[]};var _0x5f0f07=_[_0xa4e8('0x48')](db[_0xa4e8('0x49')]['rawAttributes'],function(_0x1c0cf6){return{'name':_0x1c0cf6[_0xa4e8('0x4a')],'type':_0x1c0cf6[_0xa4e8('0x45')][_0xa4e8('0x4b')]};});_0x51e858['model']=_[_0xa4e8('0x48')](_0x5f0f07,_0xa4e8('0x32'));_0x51e858[_0xa4e8('0x4c')]=_[_0xa4e8('0x4d')](_0x25da92[_0xa4e8('0x4c')]);_0x51e858[_0xa4e8('0x4e')]=_[_0xa4e8('0x4f')](_0x51e858[_0xa4e8('0x43')],_0x51e858[_0xa4e8('0x4c')]);_0x32f10a[_0xa4e8('0x50')]=_[_0xa4e8('0x4f')](_0x51e858[_0xa4e8('0x43')],qs[_0xa4e8('0x51')](_0x25da92[_0xa4e8('0x4c')][_0xa4e8('0x51')]));_0x32f10a[_0xa4e8('0x50')]=_0x32f10a[_0xa4e8('0x50')][_0xa4e8('0x52')]?_0x32f10a[_0xa4e8('0x50')]:_0x51e858[_0xa4e8('0x43')];if(!_0x25da92[_0xa4e8('0x4c')][_0xa4e8('0x53')](_0xa4e8('0x54'))){_0x32f10a[_0xa4e8('0x28')]=qs['limit'](_0x25da92[_0xa4e8('0x4c')]['limit']);_0x32f10a[_0xa4e8('0x26')]=qs[_0xa4e8('0x26')](_0x25da92[_0xa4e8('0x4c')]['offset']);}_0x32f10a[_0xa4e8('0x55')]=qs[_0xa4e8('0x56')](_0x25da92[_0xa4e8('0x4c')][_0xa4e8('0x56')]);_0x32f10a['where']=qs['filters'](_['pick'](_0x25da92[_0xa4e8('0x4c')],_0x51e858[_0xa4e8('0x4e')]),_0x5f0f07);if(_0x25da92[_0xa4e8('0x4c')]['filter']){_0x32f10a['where']=_['merge'](_0x32f10a['where'],{'$or':_['map'](_0x5f0f07,function(_0x4a1c35){if(_0x4a1c35['type']!=='VIRTUAL'){var _0x5fa13b={};_0x5fa13b[_0x4a1c35[_0xa4e8('0x32')]]={'$like':'%'+_0x25da92[_0xa4e8('0x4c')][_0xa4e8('0x57')]+'%'};return _0x5fa13b;}})});}_0x32f10a=_[_0xa4e8('0x58')]({},_0x32f10a,_0x25da92[_0xa4e8('0x59')]);var _0x16aaac={'where':_0x32f10a[_0xa4e8('0x5a')]};return db[_0xa4e8('0x49')][_0xa4e8('0x29')](_0x16aaac)['then'](function(_0x5be81f){_0x2a8883[_0xa4e8('0x29')]=_0x5be81f;if(_0x25da92[_0xa4e8('0x4c')][_0xa4e8('0x5b')]){_0x32f10a[_0xa4e8('0x5c')]=[{'all':!![]}];}return db[_0xa4e8('0x49')][_0xa4e8('0x5d')](_0x32f10a);})[_0xa4e8('0x2d')](function(_0x3cbde6){_0x2a8883[_0xa4e8('0x5e')]=_0x3cbde6;return _0x2a8883;})[_0xa4e8('0x2d')](respondWithFilteredResult(_0x59f528,_0x32f10a))['catch'](handleError(_0x59f528,null));};exports[_0xa4e8('0x5f')]=function(_0x56e1b2,_0x54e17b){var _0x5df81a={'raw':![],'where':{'id':_0x56e1b2[_0xa4e8('0x60')]['id']},'include':[{'model':db[_0xa4e8('0x47')],'as':_0xa4e8('0x61')}]},_0x592acc={};_0x592acc[_0xa4e8('0x43')]=_['keys'](db[_0xa4e8('0x49')][_0xa4e8('0x62')]);_0x592acc[_0xa4e8('0x4c')]=_[_0xa4e8('0x4d')](_0x56e1b2[_0xa4e8('0x4c')]);_0x592acc[_0xa4e8('0x4e')]=_[_0xa4e8('0x4f')](_0x592acc[_0xa4e8('0x43')],_0x592acc[_0xa4e8('0x4c')]);_0x5df81a[_0xa4e8('0x50')]=_[_0xa4e8('0x4f')](_0x592acc['model'],qs['fields'](_0x56e1b2['query'][_0xa4e8('0x51')]));_0x5df81a[_0xa4e8('0x50')]=_0x5df81a[_0xa4e8('0x50')][_0xa4e8('0x52')]?_0x5df81a[_0xa4e8('0x50')]:_0x592acc[_0xa4e8('0x43')];if(_0x56e1b2[_0xa4e8('0x4c')][_0xa4e8('0x5b')]){_0x5df81a[_0xa4e8('0x5c')]=[{'all':!![]}];}_0x5df81a=_['merge']({},_0x5df81a,_0x56e1b2[_0xa4e8('0x59')]);return db[_0xa4e8('0x49')][_0xa4e8('0x63')](_0x5df81a)[_0xa4e8('0x2d')](handleEntityNotFound(_0x54e17b,null))[_0xa4e8('0x2d')](respondWithResult(_0x54e17b,null))[_0xa4e8('0x23')](handleError(_0x54e17b,null));};exports[_0xa4e8('0x64')]=function(_0x1e49c7,_0x105f18){if(!wildcardUtils['testWildcardValidity'](_0x1e49c7[_0xa4e8('0x65')][_0xa4e8('0x66')])){return handleError(_0x105f18,null)(new APIBadRequestError('\x22'+_0x1e49c7[_0xa4e8('0x65')][_0xa4e8('0x66')]+_0xa4e8('0x67')));}return db['ChatWebsite'][_0xa4e8('0x64')](_0x1e49c7['body'],{})['then'](function(_0x323d2c){var _0x5ab10f=_0x1e49c7[_0xa4e8('0x68')][_0xa4e8('0x2e')]({'plain':!![]});if(!_0x5ab10f)throw new Error(_0xa4e8('0x69'));if(_0x5ab10f[_0xa4e8('0x6a')]===_0xa4e8('0x68')){var _0x1a71b5=_0x323d2c[_0xa4e8('0x2e')]({'plain':!![]});var _0x3f22f8='ChatWebsites';return db[_0xa4e8('0x6b')][_0xa4e8('0x63')]({'where':{'name':_0x3f22f8,'userProfileId':_0x5ab10f[_0xa4e8('0x6c')]},'raw':!![]})['then'](function(_0x1dd8fa){if(_0x1dd8fa&&_0x1dd8fa['autoAssociation']===0x0){return db[_0xa4e8('0x30')][_0xa4e8('0x64')]({'name':_0x1a71b5[_0xa4e8('0x32')],'resourceId':_0x1a71b5['id'],'type':_0x1dd8fa[_0xa4e8('0x32')],'sectionId':_0x1dd8fa['id']},{})[_0xa4e8('0x2d')](function(){return _0x323d2c;});}else{return _0x323d2c;}})[_0xa4e8('0x23')](function(_0x13fe49){logger[_0xa4e8('0x1f')](_0xa4e8('0x6d'),_0x13fe49);throw _0x13fe49;});}return _0x323d2c;})[_0xa4e8('0x2d')](respondWithResult(_0x105f18,0xc9))[_0xa4e8('0x23')](handleError(_0x105f18,null));};exports['update']=function(_0x11f3b3,_0x1889b4){if(!wildcardUtils[_0xa4e8('0x6e')](_0x11f3b3[_0xa4e8('0x65')]['address'])){return handleError(_0x1889b4,null)(new APIBadRequestError('\x22'+_0x11f3b3[_0xa4e8('0x65')]['address']+_0xa4e8('0x67')));}if(_0x11f3b3[_0xa4e8('0x65')]['id']){delete _0x11f3b3[_0xa4e8('0x65')]['id'];}return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'where':{'id':_0x11f3b3['params']['id']},'include':[{'model':db[_0xa4e8('0x47')],'as':_0xa4e8('0x61')}]})[_0xa4e8('0x2d')](handleEntityNotFound(_0x1889b4,null))[_0xa4e8('0x2d')](saveUpdates(_0x11f3b3[_0xa4e8('0x65')],null))[_0xa4e8('0x2d')](respondWithResult(_0x1889b4,null))['catch'](handleError(_0x1889b4,null));};exports['destroy']=function(_0x15ac38,_0x2e4c91){return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'where':{'id':_0x15ac38[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x2e4c91,null))[_0xa4e8('0x2d')](removeEntity(_0x2e4c91,null))[_0xa4e8('0x23')](handleError(_0x2e4c91,null));};exports[_0xa4e8('0x6f')]=function(_0x268245,_0x539034){return db[_0xa4e8('0x49')][_0xa4e8('0x6f')]()[_0xa4e8('0x2d')](respondWithResult(_0x539034,null))[_0xa4e8('0x23')](handleError(_0x539034,null));};exports['addDisposition']=function(_0x41e6ff,_0x53998d){if(_0x41e6ff[_0xa4e8('0x65')]['id']){delete _0x41e6ff[_0xa4e8('0x65')]['id'];}return db['ChatWebsite'][_0xa4e8('0x63')]({'where':{'id':_0x41e6ff['params']['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x53998d,null))[_0xa4e8('0x2d')](function(_0x5a20b7){if(_0x5a20b7){_0x41e6ff[_0xa4e8('0x65')][_0xa4e8('0x70')]=_0x5a20b7['id'];return db[_0xa4e8('0x71')]['create'](_0x41e6ff[_0xa4e8('0x65')]);}})[_0xa4e8('0x2d')](respondWithResult(_0x53998d,null))['catch'](handleError(_0x53998d,null));};exports[_0xa4e8('0x72')]=function(_0x2ff27a,_0x4234b1){var _0x548c79={'raw':![],'where':{}};var _0x1fb98c={};var _0x2c70c7={'count':0x0,'rows':[]};return db[_0xa4e8('0x49')]['findOne']({'where':{'id':_0x2ff27a[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x4234b1,null))[_0xa4e8('0x2d')](function(_0xb907dc){if(_0xb907dc){_0x1fb98c[_0xa4e8('0x43')]=_[_0xa4e8('0x4d')](db[_0xa4e8('0x71')][_0xa4e8('0x62')]);_0x1fb98c[_0xa4e8('0x4c')]=_['keys'](_0x2ff27a[_0xa4e8('0x4c')]);_0x1fb98c['filters']=_[_0xa4e8('0x4f')](_0x1fb98c[_0xa4e8('0x43')],_0x1fb98c['query']);_0x548c79[_0xa4e8('0x50')]=_[_0xa4e8('0x4f')](_0x1fb98c['model'],qs[_0xa4e8('0x51')](_0x2ff27a['query'][_0xa4e8('0x51')]));_0x548c79['attributes']=_0x548c79[_0xa4e8('0x50')][_0xa4e8('0x52')]?_0x548c79[_0xa4e8('0x50')]:_0x1fb98c[_0xa4e8('0x43')];if(!_0x2ff27a[_0xa4e8('0x4c')][_0xa4e8('0x53')](_0xa4e8('0x54'))){_0x548c79['limit']=qs[_0xa4e8('0x28')](_0x2ff27a[_0xa4e8('0x4c')][_0xa4e8('0x28')]);_0x548c79[_0xa4e8('0x26')]=qs[_0xa4e8('0x26')](_0x2ff27a[_0xa4e8('0x4c')][_0xa4e8('0x26')]);}_0x548c79[_0xa4e8('0x55')]=qs['sort'](_0x2ff27a[_0xa4e8('0x4c')][_0xa4e8('0x56')]);_0x548c79[_0xa4e8('0x5a')]=qs[_0xa4e8('0x4e')](_['pick'](_0x2ff27a[_0xa4e8('0x4c')],_0x1fb98c[_0xa4e8('0x4e')]));_0x548c79[_0xa4e8('0x5a')]['ChatWebsiteId']=_0xb907dc['id'];if(_0x2ff27a['query'][_0xa4e8('0x57')]){_0x548c79['where']=_[_0xa4e8('0x58')](_0x548c79[_0xa4e8('0x5a')],{'$or':_[_0xa4e8('0x48')](_0x548c79['attributes'],function(_0x3c44a4){var _0x23c4a7={};_0x23c4a7[_0x3c44a4]={'$like':'%'+_0x2ff27a[_0xa4e8('0x4c')][_0xa4e8('0x57')]+'%'};return _0x23c4a7;})});}_0x548c79=_[_0xa4e8('0x58')]({},_0x548c79,_0x2ff27a[_0xa4e8('0x59')]);return db[_0xa4e8('0x71')][_0xa4e8('0x29')]({'where':_0x548c79['where']})[_0xa4e8('0x2d')](function(_0x3b73c6){_0x2c70c7['count']=_0x3b73c6;if(_0x2ff27a['query'][_0xa4e8('0x5b')]){_0x548c79['include']=[{'all':!![]}];}return db['Disposition'][_0xa4e8('0x5d')](_0x548c79);})['then'](function(_0x1986bf){_0x2c70c7[_0xa4e8('0x5e')]=_0x1986bf;return _0x2c70c7;});}})[_0xa4e8('0x2d')](respondWithFilteredResult(_0x4234b1,_0x548c79))[_0xa4e8('0x23')](handleError(_0x4234b1,null));};exports[_0xa4e8('0x73')]=function(_0x14c978,_0x2045e3){return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'where':{'id':_0x14c978[_0xa4e8('0x60')]['id']}})['then'](handleEntityNotFound(_0x2045e3,null))['then'](function(_0x40ce27){if(_0x40ce27){return _0x40ce27['removeDispositions'](_0x14c978[_0xa4e8('0x4c')]['ids']);}})[_0xa4e8('0x2d')](respondWithStatusCode(_0x2045e3,null))[_0xa4e8('0x23')](handleError(_0x2045e3,null));};exports['addAnswer']=function(_0x5d6e60,_0x5c6872){if(_0x5d6e60['body']['id']){delete _0x5d6e60[_0xa4e8('0x65')]['id'];}return db['ChatWebsite'][_0xa4e8('0x63')]({'where':{'id':_0x5d6e60[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x5c6872,null))['then'](function(_0x19b7a5){if(_0x19b7a5){_0x5d6e60[_0xa4e8('0x65')][_0xa4e8('0x70')]=_0x19b7a5['id'];return db[_0xa4e8('0x74')][_0xa4e8('0x64')](_0x5d6e60[_0xa4e8('0x65')]);}})[_0xa4e8('0x2d')](respondWithResult(_0x5c6872,null))[_0xa4e8('0x23')](handleError(_0x5c6872,null));};exports[_0xa4e8('0x75')]=function(_0xde6dc5,_0x4b7f73){var _0x5d56aa={'raw':![],'where':{}};var _0x5621f5={};var _0x52f377={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xa4e8('0x76')]({'where':{'id':_0xde6dc5[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x4b7f73,null))['then'](function(_0x410cb9){if(_0x410cb9){_0x5621f5[_0xa4e8('0x43')]=_['keys'](db[_0xa4e8('0x74')][_0xa4e8('0x62')]);_0x5621f5[_0xa4e8('0x4c')]=_[_0xa4e8('0x4d')](_0xde6dc5['query']);_0x5621f5[_0xa4e8('0x4e')]=_[_0xa4e8('0x4f')](_0x5621f5['model'],_0x5621f5[_0xa4e8('0x4c')]);_0x5d56aa[_0xa4e8('0x50')]=_[_0xa4e8('0x4f')](_0x5621f5['model'],qs[_0xa4e8('0x51')](_0xde6dc5['query'][_0xa4e8('0x51')]));_0x5d56aa[_0xa4e8('0x50')]=_0x5d56aa[_0xa4e8('0x50')][_0xa4e8('0x52')]?_0x5d56aa[_0xa4e8('0x50')]:_0x5621f5['model'];if(!_0xde6dc5[_0xa4e8('0x4c')][_0xa4e8('0x53')](_0xa4e8('0x54'))){_0x5d56aa['limit']=qs['limit'](_0xde6dc5['query'][_0xa4e8('0x28')]);_0x5d56aa['offset']=qs['offset'](_0xde6dc5[_0xa4e8('0x4c')][_0xa4e8('0x26')]);}_0x5d56aa['order']=qs[_0xa4e8('0x56')](_0xde6dc5['query'][_0xa4e8('0x56')]);_0x5d56aa['where']=qs[_0xa4e8('0x4e')](_[_0xa4e8('0x77')](_0xde6dc5[_0xa4e8('0x4c')],_0x5621f5[_0xa4e8('0x4e')]));_0x5d56aa[_0xa4e8('0x5a')]['ChatWebsiteId']=_0x410cb9['id'];if(_0xde6dc5['query'][_0xa4e8('0x57')]){_0x5d56aa[_0xa4e8('0x5a')]=_[_0xa4e8('0x58')](_0x5d56aa[_0xa4e8('0x5a')],{'$or':_[_0xa4e8('0x48')](_0x5d56aa[_0xa4e8('0x50')],function(_0x159166){var _0x5ee72b={};_0x5ee72b[_0x159166]={'$like':'%'+_0xde6dc5[_0xa4e8('0x4c')]['filter']+'%'};return _0x5ee72b;})});}_0x5d56aa=_[_0xa4e8('0x58')]({},_0x5d56aa,_0xde6dc5[_0xa4e8('0x59')]);return db[_0xa4e8('0x74')][_0xa4e8('0x29')]({'where':_0x5d56aa[_0xa4e8('0x5a')]})[_0xa4e8('0x2d')](function(_0x791899){_0x52f377[_0xa4e8('0x29')]=_0x791899;if(_0xde6dc5[_0xa4e8('0x4c')]['includeAll']){_0x5d56aa[_0xa4e8('0x5c')]=[{'all':!![]}];}return db[_0xa4e8('0x74')]['findAll'](_0x5d56aa);})[_0xa4e8('0x2d')](function(_0x1b32c9){_0x52f377[_0xa4e8('0x5e')]=_0x1b32c9;return _0x52f377;});}})[_0xa4e8('0x2d')](respondWithFilteredResult(_0x4b7f73,_0x5d56aa))[_0xa4e8('0x23')](handleError(_0x4b7f73,null));};exports[_0xa4e8('0x78')]=function(_0x5c51a9,_0x19b5b5){return db['ChatWebsite']['find']({'where':{'id':_0x5c51a9[_0xa4e8('0x60')]['id']}})['then'](handleEntityNotFound(_0x19b5b5,null))[_0xa4e8('0x2d')](function(_0x3002a7){if(_0x3002a7){return _0x3002a7['removeAnswers'](_0x5c51a9['query'][_0xa4e8('0x79')]);}})[_0xa4e8('0x2d')](respondWithStatusCode(_0x19b5b5,null))[_0xa4e8('0x23')](handleError(_0x19b5b5,null));};exports[_0xa4e8('0x7a')]=function(_0x40c509,_0x31c94e){_0x40c509[_0xa4e8('0x65')][_0xa4e8('0x7b')]=_0x40c509[_0xa4e8('0x7c')][_0xa4e8('0x7d')];return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'where':{'id':_0x40c509[_0xa4e8('0x60')]['id']}})['then'](handleEntityNotFound(_0x31c94e,null))[_0xa4e8('0x2d')](saveUpdates(_0x40c509[_0xa4e8('0x65')],null))['then'](respondWithResult(_0x31c94e,null))[_0xa4e8('0x23')](handleError(_0x31c94e,null));};exports['addAvatar']=function(_0x2dcded,_0x5531b7){_0x2dcded['body'][_0xa4e8('0x7e')]=_0x2dcded[_0xa4e8('0x7c')][_0xa4e8('0x7d')];return db[_0xa4e8('0x49')]['find']({'where':{'id':_0x2dcded[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x5531b7,null))[_0xa4e8('0x2d')](saveUpdates(_0x2dcded['body'],null))[_0xa4e8('0x2d')](respondWithResult(_0x5531b7,null))[_0xa4e8('0x23')](handleError(_0x5531b7,null));};exports[_0xa4e8('0x7f')]=function(_0x32aa40,_0x4c0301){_0x32aa40[_0xa4e8('0x65')][_0xa4e8('0x80')]=_0x32aa40[_0xa4e8('0x7c')]['filename'];return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'where':{'id':_0x32aa40['params']['id']}})['then'](handleEntityNotFound(_0x4c0301,null))['then'](saveUpdates(_0x32aa40[_0xa4e8('0x65')],null))[_0xa4e8('0x2d')](respondWithResult(_0x4c0301,null))[_0xa4e8('0x23')](handleError(_0x4c0301,null));};exports['addSystemAvatar']=function(_0x2d4e23,_0x553ce2){_0x2d4e23[_0xa4e8('0x65')][_0xa4e8('0x81')]=_0x2d4e23[_0xa4e8('0x7c')]['filename'];return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'where':{'id':_0x2d4e23['params']['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x553ce2,null))[_0xa4e8('0x2d')](saveUpdates(_0x2d4e23[_0xa4e8('0x65')],null))[_0xa4e8('0x2d')](respondWithResult(_0x553ce2,null))[_0xa4e8('0x23')](handleError(_0x553ce2,null));};exports[_0xa4e8('0x82')]=function(_0x1c4f3f,_0x132f4d){var _0x4e36ec=path['join'](config[_0xa4e8('0x83')],_0xa4e8('0x84'));var _0x33e4ed={'where':{'id':_0x1c4f3f[_0xa4e8('0x60')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x5880e6=![];return require(_0xa4e8('0x85'))[_0xa4e8('0x86')]()[_0xa4e8('0x2d')](function(_0x12cefe){if(_0x12cefe){_0x5880e6=_0x12cefe['custom'];}})[_0xa4e8('0x2d')](function(){return db[_0xa4e8('0x49')][_0xa4e8('0x63')](_0x33e4ed);})[_0xa4e8('0x2d')](handleEntityNotFound(_0x132f4d,null))[_0xa4e8('0x2d')](function(_0x4ba6a1){if(_0x4ba6a1){if(!_[_0xa4e8('0x87')](_0x4ba6a1[_0xa4e8('0x7b')])){if(fs['existsSync'](path[_0xa4e8('0x88')](config[_0xa4e8('0x83')],_0xa4e8('0x89'),_0x4ba6a1['sitepic']))&&_0x5880e6){_0x4e36ec=path[_0xa4e8('0x88')](config['root'],'server/files/images/logos/',_0x4ba6a1['sitepic']);}}return _0x132f4d[_0xa4e8('0x8a')](_0x4e36ec);}})[_0xa4e8('0x23')](handleError(_0x132f4d,null));};exports['getAvatar']=function(_0xefd939,_0x20ac57){var _0x58abc2=path[_0xa4e8('0x88')](config[_0xa4e8('0x83')],_0xa4e8('0x8b'));var _0xb7270a={'where':{'id':_0xefd939[_0xa4e8('0x60')]['id']},'attributes':['id',_0xa4e8('0x7e')],'raw':!![]};return db[_0xa4e8('0x49')][_0xa4e8('0x63')](_0xb7270a)[_0xa4e8('0x2d')](handleEntityNotFound(_0x20ac57,null))[_0xa4e8('0x2d')](function(_0x28f435){if(_0x28f435){if(!_['isNil'](_0x28f435[_0xa4e8('0x7e')])){if(fs[_0xa4e8('0x8c')](path[_0xa4e8('0x88')](config[_0xa4e8('0x83')],_0xa4e8('0x8d'),_0x28f435[_0xa4e8('0x7e')]))){_0x58abc2=path[_0xa4e8('0x88')](config[_0xa4e8('0x83')],_0xa4e8('0x8d'),_0x28f435[_0xa4e8('0x7e')]);}}return _0x20ac57['download'](_0x58abc2);}})[_0xa4e8('0x23')](handleError(_0x20ac57,null));};exports['getCustomerAvatar']=function(_0x1a979b,_0x9ad3d7){var _0x3d1a25=path[_0xa4e8('0x88')](config[_0xa4e8('0x83')],'server/files/images/avatars/customer_avatar.png');var _0x4dba5c={'where':{'id':_0x1a979b['params']['id']},'attributes':['id',_0xa4e8('0x80'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0xa4e8('0x63')](_0x4dba5c)[_0xa4e8('0x2d')](handleEntityNotFound(_0x9ad3d7,null))['then'](function(_0x3d2648){if(_0x3d2648){if(!_[_0xa4e8('0x87')](_0x3d2648[_0xa4e8('0x80')])){if(fs[_0xa4e8('0x8c')](path['join'](config[_0xa4e8('0x83')],'server/files/images/avatars/',_0x3d2648[_0xa4e8('0x80')]))&&_0x3d2648['showCustomerAvatar']){_0x3d1a25=path[_0xa4e8('0x88')](config[_0xa4e8('0x83')],_0xa4e8('0x8d'),_0x3d2648['customerAvatar']);}}return _0x9ad3d7['download'](_0x3d1a25);}})[_0xa4e8('0x23')](handleError(_0x9ad3d7,null));};exports['getSystemAvatar']=function(_0x2d2baa,_0x504cbb){var _0x3260d9=path[_0xa4e8('0x88')](config[_0xa4e8('0x83')],_0xa4e8('0x8e'));var _0x480102={'where':{'id':_0x2d2baa[_0xa4e8('0x60')]['id']},'attributes':['id',_0xa4e8('0x81')],'raw':!![]};return db['ChatWebsite']['find'](_0x480102)[_0xa4e8('0x2d')](handleEntityNotFound(_0x504cbb,null))['then'](function(_0x40e10d){if(_0x40e10d){if(!_[_0xa4e8('0x87')](_0x40e10d[_0xa4e8('0x81')])){if(fs['existsSync'](path[_0xa4e8('0x88')](config['root'],_0xa4e8('0x8d'),_0x40e10d[_0xa4e8('0x81')]))){_0x3260d9=path[_0xa4e8('0x88')](config['root'],_0xa4e8('0x8d'),_0x40e10d[_0xa4e8('0x81')]);}}return _0x504cbb[_0xa4e8('0x8a')](_0x3260d9);}})[_0xa4e8('0x23')](handleError(_0x504cbb,null));};function checkWebsiteInterval(_0xd665e7){var _0x494c65=_0xd665e7[_0xa4e8('0x8f')];if(!_0x494c65){return Promise[_0xa4e8('0x90')](_0xd665e7);}var _0x2fc723=_0xd665e7[_0xa4e8('0x91')]||undefined;return _0x494c65[_0xa4e8('0x92')](_0x2fc723)[_0xa4e8('0x2d')](function(_0x3247bb){if(!_0x3247bb){throw new APIOutOfIntervalError();}return _0xd665e7;});}exports[_0xa4e8('0x93')]=function(_0x348345,_0x230248){var _0x4ce14d={'body':_0x348345['body'],'channel':_0xa4e8('0x94')};var _0xea11e2=[];var _0x538a91=[];var _0x33b58f={};var _0x543dec=![];if(_0x348345[_0xa4e8('0x65')]['id']){delete _0x348345[_0xa4e8('0x65')]['id'];}if(_['isNil'](_0x348345[_0xa4e8('0x65')]['from'])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0xa4e8('0x87')](_0x348345[_0xa4e8('0x65')]['mapKey'])){throw new APIBadRequestError(_0xa4e8('0x95'));}if(_[_0xa4e8('0x96')](_0x348345['body']['body'])){throw new APIBadRequestError(_0xa4e8('0x97'));}var _0x26eab2=_0x348345[_0xa4e8('0x65')][_0xa4e8('0x98')]&&_0x348345['body'][_0xa4e8('0x3b')];return db['CmContact'][_0xa4e8('0x6f')]()[_0xa4e8('0x2d')](function(_0x29da45){if(!_0x29da45){throw new Error('No\x20available\x20attributes');}_0xea11e2=Object[_0xa4e8('0x4d')](_0x29da45)[_0xa4e8('0x57')](function(_0x439a34){return![_0xa4e8('0x99'),_0xa4e8('0x9a')]['includes'](_0x439a34);});_0x538a91=Object[_0xa4e8('0x4d')](_0x29da45)[_0xa4e8('0x57')](function(_0x278403){return![_0xa4e8('0x99'),_0xa4e8('0x9a'),_0xa4e8('0x9b'),'ListId']['includes'](_0x278403);});if(!_[_0xa4e8('0x9c')](_0x538a91,_0x348345['body'][_0xa4e8('0x9d')])){throw new APIBadRequestError(_0xa4e8('0x9e')+_0x538a91['join'](',\x20'));}_0x33b58f[_0x348345['body'][_0xa4e8('0x9d')]]=_0x348345[_0xa4e8('0x65')]['from'];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x348345['params']['id']},'include':[{'model':db[_0xa4e8('0x9f')],'as':_0xa4e8('0xa0'),'include':[{'model':db[_0xa4e8('0xa1')],'as':_0xa4e8('0xa2'),'where':_0x33b58f,'limit':0x1,'order':[[_0xa4e8('0x9a'),_0xa4e8('0xa3')]]}]},{'model':db['ChatApplication'],'as':_0xa4e8('0xa4')},{'model':db[_0xa4e8('0x8f')],'as':_0xa4e8('0x8f'),'include':[{'model':db[_0xa4e8('0x8f')],'as':'Intervals','attributes':['id',_0xa4e8('0xa5')],'raw':!![]}]}]});})[_0xa4e8('0x2d')](function(_0x2e8279){if(!_0x2e8279){throw new APINotFoundError(util[_0xa4e8('0x40')](_0xa4e8('0xa6'),_0x348345[_0xa4e8('0x60')]['id']));}if(_0x26eab2){return checkWebsiteInterval(_0x2e8279);}return _0x2e8279;})[_0xa4e8('0x2d')](function(_0x52d369){_0x4ce14d[_0xa4e8('0xa7')]=_0x52d369;_0x4ce14d[_0xa4e8('0xa8')]=_[_0xa4e8('0xa9')](_0x52d369[_0xa4e8('0xa4')],[_0xa4e8('0xaa')],['asc']);if(_0x4ce14d[_0xa4e8('0xa7')]['Applications']){delete _0x4ce14d[_0xa4e8('0xa7')][_0xa4e8('0xa4')];}_0x4ce14d[_0xa4e8('0xab')]=_0x52d369[_0xa4e8('0xa0')]||{'id':_0x52d369[_0xa4e8('0xac')]};if(_0x4ce14d['list']&&_0x4ce14d[_0xa4e8('0xab')][_0xa4e8('0xa2')][_0xa4e8('0x52')]){return _0x4ce14d[_0xa4e8('0xab')]['Contacts'][0x0];}var _0x4e4e38=_[_0xa4e8('0xad')](_0x348345['body'],{'firstName':_0x348345['body']['from'],'ListId':_0x52d369[_0xa4e8('0xac')]});_0x4e4e38[_0x348345[_0xa4e8('0x65')]['mapKey']]=_0x348345[_0xa4e8('0x65')]['from'];return db[_0xa4e8('0xa1')][_0xa4e8('0x64')](_0x4e4e38,{'fields':_0xea11e2,'raw':!![]});})[_0xa4e8('0x2d')](function(_0x1c2db1){_0x4ce14d[_0xa4e8('0xae')]=_0x1c2db1;var _0x5c44b9=createInteractionObject(_0x348345[_0xa4e8('0x60')]['id'],_0x348345['body'],_0x348345['headers'],_0x1c2db1);var _0x19ef89={'ChatWebsiteId':_0x348345['params']['id']};if(_0x348345[_0xa4e8('0x65')][_0xa4e8('0xaf')]){_0x19ef89[_0xa4e8('0xaf')]=_0x348345[_0xa4e8('0x65')]['threadId'];_0x19ef89[_0xa4e8('0xb0')]=![];return db[_0xa4e8('0xb1')][_0xa4e8('0x63')]({'where':_0x19ef89})[_0xa4e8('0x2d')](function(_0x48c0aa){var _0x49dfab=_0x348345['body'][_0xa4e8('0x98')]&&_0x348345[_0xa4e8('0x65')]['referer'];if(_0x48c0aa){_0x543dec=!![];return _0x48c0aa;}else if(!_0x49dfab&&_0x48c0aa&&_0x48c0aa[_0xa4e8('0xb0')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x5c44b9['threadId']=_0x348345['body'][_0xa4e8('0xaf')];_0x5c44b9[_0xa4e8('0xb2')]=_0x348345['body'][_0xa4e8('0xb2')];return db[_0xa4e8('0xb1')][_0xa4e8('0x64')](_0x5c44b9);});}_0x19ef89[_0xa4e8('0xb3')]=_0x1c2db1['id'];if(_0x348345[_0xa4e8('0x65')][_0xa4e8('0xb4')]&&_0x348345[_0xa4e8('0x65')]['interaction']['id']){_0x19ef89['id']=_0x348345['body'][_0xa4e8('0xb4')]['id'];return db[_0xa4e8('0xb1')][_0xa4e8('0x63')]({'where':_0x19ef89})[_0xa4e8('0x2d')](function(_0x3b3efa){var _0x574d95=_0x348345['body'][_0xa4e8('0x98')]&&_0x348345[_0xa4e8('0x65')][_0xa4e8('0x3b')];if(!_0x574d95&&_0x3b3efa&&_0x3b3efa['closed']){throw new APIConflictError(_0xa4e8('0xb5'));}else if(_0x3b3efa){_0x543dec=!![];return _0x3b3efa;}else{return db[_0xa4e8('0xb1')][_0xa4e8('0x64')](_0x5c44b9);}});}return db[_0xa4e8('0xb1')][_0xa4e8('0x64')](_0x5c44b9);})[_0xa4e8('0x2d')](function(_0x27fb1c){if(!_0x543dec){return _0x27fb1c;}var _0x1b30a8={'from':(_0x4ce14d[_0xa4e8('0xae')]['firstName']||'')+'\x20'+(_0x4ce14d[_0xa4e8('0xae')][_0xa4e8('0xb6')]||'')};if(_0x348345[_0xa4e8('0x65')][_0xa4e8('0xaf')]&&_0x348345[_0xa4e8('0x65')][_0xa4e8('0xb7')]&&_0x348345[_0xa4e8('0x65')][_0xa4e8('0xaf')]!=_0x348345['body']['messageId']){_0x1b30a8['threadId']=_0x348345[_0xa4e8('0x65')][_0xa4e8('0xb7')];}return _0x27fb1c['update'](_0x1b30a8);})[_0xa4e8('0x2d')](function(_0x4a4ce8){_0x4ce14d[_0xa4e8('0xb4')]=_0x4a4ce8[_0xa4e8('0x2e')]({'plain':!![]});_0x4ce14d[_0xa4e8('0xb4')][_0xa4e8('0xb8')]=!_0x543dec;if(_0x4ce14d[_0xa4e8('0xb4')][_0xa4e8('0xb8')]){if(_0x4ce14d[_0xa4e8('0xa7')]['autoclose']){_0x4ce14d[_0xa4e8('0xa8')][_0xa4e8('0xb9')]({'id':0x0,'priority':_0x4ce14d[_0xa4e8('0xa8')]['length']+0x1,'app':_0xa4e8('0xba'),'appdata':_0xa4e8('0xbb'),'interval':_0xa4e8('0xbc')});}}return db[_0xa4e8('0xbd')][_0xa4e8('0x64')]({'body':_0x348345[_0xa4e8('0x65')][_0xa4e8('0x65')],'ChatWebsiteId':_0x348345[_0xa4e8('0x60')]['id'],'ChatInteractionId':_0x4a4ce8['id'],'direction':'in','ContactId':_0x4ce14d['contact']['id'],'AttachmentId':_0x348345[_0xa4e8('0x65')]['AttachmentId']});})[_0xa4e8('0x2d')](function(_0x375567){_0x4ce14d[_0xa4e8('0x21')]=_0x375567;if(!_0x4ce14d[_0xa4e8('0xb4')]['UserId']){return;}return db[_0xa4e8('0xbe')][_0xa4e8('0x63')]({'attributes':['id',_0xa4e8('0x32')],'where':{'id':_0x4ce14d[_0xa4e8('0xb4')][_0xa4e8('0xbf')]}});})[_0xa4e8('0x2d')](function(_0x444806){if(_0x444806){_0x4ce14d[_0xa4e8('0xa8')][_0xa4e8('0xc0')]({'id':0x0,'priority':0x0,'app':_0xa4e8('0xc1'),'appdata':_0x444806[_0xa4e8('0x32')]+','+(_0x4ce14d['account'][_0xa4e8('0xc2')]||0xa),'interval':_0xa4e8('0xbc')});_0x4ce14d[_0xa4e8('0xc3')]=!![];}if(!_0x4ce14d[_0xa4e8('0xb4')][_0xa4e8('0xc4')]){return;}return db[_0xa4e8('0xc5')][_0xa4e8('0x63')]({'attributes':['id',_0xa4e8('0x32')],'where':{'id':_0x4ce14d[_0xa4e8('0xb4')][_0xa4e8('0xc4')]}});})[_0xa4e8('0x2d')](function(_0x28a95c){if(_0x28a95c){_0x4ce14d[_0xa4e8('0xa8')][_0xa4e8('0xc0')]({'id':0x0,'priority':0x1,'app':_0xa4e8('0xc6'),'appdata':_0x28a95c[_0xa4e8('0x32')]+','+(_0x4ce14d[_0xa4e8('0xa7')]['waitForTheAssignedQueue']||0x12c),'interval':_0xa4e8('0xbc')});}return respondWithRpcPromise('Start',_0xa4e8('0xc7'),_0x4ce14d);})[_0xa4e8('0x2d')](function(_0x2c7d45){respondWithRpcPromise(_0xa4e8('0xc8'),_0xa4e8('0xc8'),{'event':'notify','message':_0x2c7d45},client9002);return _0x2c7d45;})['then'](respondWithResult(_0x230248,null))[_0xa4e8('0x23')](APIHandleError(_0x230248));};exports[_0xa4e8('0xc9')]=function(_0x5b9321,_0x39ef30){var _0x28dc37,_0x426ccb,_0x1b2eae;var _0x1052a1=[];var _0x26020f={};var _0x163b37=_0x5b9321['files']||[];var _0x5f2a26=[];var _0x1aa96e;return db[_0xa4e8('0xa1')][_0xa4e8('0x6f')]()['then'](function(_0x4aae64){if(!_0x4aae64){throw new db[(_0xa4e8('0xca'))]['ValidationError'](_0xa4e8('0xcb'));}_0x1052a1=_[_0xa4e8('0xcc')](_['keys'](_0x4aae64),['createdAt','updatedAt',_0xa4e8('0x9b'),'ListId']);if(_0x5b9321[_0xa4e8('0x65')]['id']){delete _0x5b9321[_0xa4e8('0x65')]['id'];}if(_[_0xa4e8('0x87')](_0x5b9321['body'][_0xa4e8('0xcd')])){throw _0x39ef30[_0xa4e8('0x2a')](0x1f4)[_0xa4e8('0x33')](new db['Sequelize'][(_0xa4e8('0xce'))](_0xa4e8('0xcf')));}if(_[_0xa4e8('0x87')](_0x5b9321[_0xa4e8('0x65')][_0xa4e8('0x65')])||_0x5b9321['body'][_0xa4e8('0x65')]===''){throw _0x39ef30['status'](0x1f4)['send'](new db[(_0xa4e8('0xca'))][(_0xa4e8('0xce'))](_0xa4e8('0xd0')));}if(_[_0xa4e8('0x87')](_0x5b9321[_0xa4e8('0x65')]['mapKeyOffline'])){throw _0x39ef30[_0xa4e8('0x2a')](0x1f4)[_0xa4e8('0x33')](new db[(_0xa4e8('0xca'))][(_0xa4e8('0xce'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1052a1));}if(!_[_0xa4e8('0x9c')](_0x1052a1,_0x5b9321[_0xa4e8('0x65')][_0xa4e8('0xd1')])){throw _0x39ef30['status'](0x1f4)['send'](new db[(_0xa4e8('0xca'))][(_0xa4e8('0xce'))](_0xa4e8('0xd2')+_0x1052a1));}_0x26020f[_0x5b9321[_0xa4e8('0x65')][_0xa4e8('0xd1')]]=_0x5b9321[_0xa4e8('0x65')][_0xa4e8('0xcd')];})[_0xa4e8('0x2d')](function(){return db['ChatWebsite'][_0xa4e8('0x63')]({'where':{'id':_0x5b9321[_0xa4e8('0x60')]['id']},'include':[{'model':db[_0xa4e8('0x9f')],'as':_0xa4e8('0xa0')},{'model':db[_0xa4e8('0xd3')],'as':_0xa4e8('0xd3')}]});})[_0xa4e8('0x2d')](handleEntityNotFound(_0x39ef30,null))[_0xa4e8('0x2d')](function(_0x4786e8){if(_0x4786e8&&_0x4786e8['List']){_0x426ccb=_0x4786e8;var _0x45226e=_[_0xa4e8('0xad')](_0x5b9321[_0xa4e8('0x65')],{'firstName':_0x5b9321[_0xa4e8('0x65')][_0xa4e8('0xcd')],'phone':_0x5b9321[_0xa4e8('0x65')][_0xa4e8('0xcd')],'ListId':_0x4786e8[_0xa4e8('0xac')]});_0x45226e[_0x5b9321[_0xa4e8('0x65')][_0xa4e8('0xd1')]]=_0x5b9321['body'][_0xa4e8('0xcd')];return db[_0xa4e8('0xa1')][_0xa4e8('0xd4')]({'where':_0x26020f,'defaults':_0x45226e});}})[_0xa4e8('0xd5')](function(_0x5402b2){if(_0x5402b2){_0x1b2eae=_0x5402b2;var _0x3368ea=fs['readFileSync'](path['join'](config[_0xa4e8('0x83')],'server/files/templates/chatOfflineMessage.ejs'),_0xa4e8('0xd6'));var _0x60d391=ejs[_0xa4e8('0xd7')](_0x3368ea,{'body':_[_0xa4e8('0xd8')](_0x5b9321[_0xa4e8('0x65')][_0xa4e8('0x65')]),'bodyTitle':_0x426ccb[_0xa4e8('0xd9')]});return db['ChatOfflineMessage'][_0xa4e8('0x64')]({'body':_0x60d391,'plainBody':htmlToText['fromString'](_0x60d391),'ContactId':_0x5402b2['id'],'ChatWebsiteId':_0x426ccb['id']});}})['then'](function(_0x47c9a4){_0x1aa96e=_0x47c9a4;if(_0x163b37[_0xa4e8('0x52')]){var _0x39d094=_0x163b37[_0xa4e8('0x48')](function(_0x2569c0){return{'name':_0x2569c0[_0xa4e8('0xda')],'basename':_0x2569c0['filename'],'type':_0x2569c0[_0xa4e8('0xdb')],'ChatOfflineMessageId':_0x47c9a4['id']};});_0x5f2a26=_0x39d094[_0xa4e8('0x48')](_0x46f721=>{var _0x5195c8={'filename':_0x46f721[_0xa4e8('0x32')],'path':path[_0xa4e8('0x88')](config[_0xa4e8('0x83')],_0xa4e8('0xdc'),_0xa4e8('0xdd'),_0xa4e8('0xde'),'offline-chat',_0x46f721[_0xa4e8('0xdf')])};return _0x5195c8;});if(!_0x426ccb[_0xa4e8('0xe0')]){return db[_0xa4e8('0xe1')]['transaction'](function(_0x2a972a){return db['Attachment']['bulkCreate'](_0x39d094,{'transaction':_0x2a972a});});}}})[_0xa4e8('0x2d')](function(){if(_0x1aa96e){_0x28dc37=_0x1aa96e;return db[_0xa4e8('0xd3')][_0xa4e8('0x76')]({'where':{'service':!![]},'include':[{'model':db[_0xa4e8('0xe2')],'as':_0xa4e8('0xe3'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xa4e8('0xe4'),'raw':!![]}]}]});}})[_0xa4e8('0x2d')](function(_0x53085f){if(_0x53085f&&_0x53085f[_0xa4e8('0xe3')]&&_0x426ccb[_0xa4e8('0xe5')]&&_0x426ccb['forwardOfflineAddress']){var _0x16a58d=_0x53085f[_0xa4e8('0xe6')]();return respondWithRpcPromise(_0xa4e8('0xe7'),_0xa4e8('0xe8'),{'account':_0x16a58d,'message':{'from':util[_0xa4e8('0x40')](_0xa4e8('0xe9'),_0x53085f[_0xa4e8('0x32')],_0x53085f[_0xa4e8('0xea')]||_0x53085f[_0xa4e8('0xe3')][_0xa4e8('0x68')]),'to':_0x426ccb[_0xa4e8('0xeb')],'subject':_0x426ccb[_0xa4e8('0xec')],'html':_0x28dc37[_0xa4e8('0x65')],'attachments':_0x5f2a26}},client9003)[_0xa4e8('0x2d')](function(){return _0x28dc37;})['catch'](function(_0xf29e2f){logger['error'](_0xf29e2f);});}})[_0xa4e8('0x2d')](function(){if(_0x426ccb&&_0x426ccb[_0xa4e8('0xe0')]&&_0x426ccb[_0xa4e8('0xed')]){var _0x58272a=[];if(_0x163b37[_0xa4e8('0x52')]){_0x58272a=_0x163b37[_0xa4e8('0x48')](function(_0x4893a7){return{'name':_0x4893a7[_0xa4e8('0xda')],'basename':_0x4893a7['filename'],'type':_0x4893a7[_0xa4e8('0xdb')],'ChatOfflineMessageId':_0x1aa96e['id']};});}var _0x708b11;if(!_[_0xa4e8('0x87')](_0x426ccb[_0xa4e8('0xee')])){var _0x1662e3=_[_0xa4e8('0x48')](_0x5b9321[_0xa4e8('0x65')],function(_0x2fba20){return _0x2fba20;});var _0x2f111f=_[_0xa4e8('0xef')](_0x1662e3)[0x0];var _0x338d1f=_[_0xa4e8('0xf0')](_0x2f111f,function(_0x149b49){return _0x149b49;});_0x708b11=_0x338d1f[0x1][_0x426ccb[_0xa4e8('0xee')]];}var _0x4fec75={'from':_0x1b2eae['email'],'firstName':_0x1b2eae['firstName'],'lastName':_0x1b2eae[_0xa4e8('0xb6')],'mapKey':_0xa4e8('0xea'),'message':{'from':_0x1b2eae[_0xa4e8('0xea')],'to':_0x426ccb[_0xa4e8('0xd3')][_0xa4e8('0xea')],'cc':'','subject':_[_0xa4e8('0x87')](_0x708b11)?_0x426ccb[_0xa4e8('0xec')]:_0x708b11,'messageId':'','sentAt':new Date(),'attach':_0x58272a['length'],'attachments':_0x58272a,'originChannel':_0xa4e8('0xf1'),'ChatWebsiteId':_0x426ccb['id'],'ChatOfflineMessageId':_0x28dc37['id'],'originTo':_0x426ccb[_0xa4e8('0xd3')][_0xa4e8('0xea')]},'body':_0x28dc37[_0xa4e8('0x65')]};var _0x5f5480={'account':{'id':_0x426ccb['MailAccountId']},'body':_0x4fec75,'log':_0xa4e8('0xf2')};return respondWithRpcPromise(_0xa4e8('0xf2'),_0xa4e8('0xf3'),_0x5f5480,client9001)[_0xa4e8('0x2d')](function(){return _0x28dc37;})[_0xa4e8('0x23')](function(_0x4de7f7){logger[_0xa4e8('0x1f')](_0x4de7f7);});}return;})[_0xa4e8('0x2d')](function(){if(_0x28dc37){return _0x28dc37;}})[_0xa4e8('0x2d')](respondWithResult(_0x39ef30,null))[_0xa4e8('0x23')](function(){for(var _0x128e63 of _0x163b37){var _0x3928bc=path[_0xa4e8('0x88')](config['root'],'server',_0xa4e8('0xdd'),'attachments',_0xa4e8('0xf4'),_0x128e63[_0xa4e8('0x7d')]);fs_extra[_0xa4e8('0xf5')](_0x3928bc)['catch'](function(_0x172b8a){logger[_0xa4e8('0x1f')](_0xa4e8('0xf6'),_0x3928bc,_0x172b8a);});}});};exports[_0xa4e8('0xf7')]=function(_0x317b60,_0x2660a0){return db[_0xa4e8('0xb1')]['find']({'where':{'id':_0x317b60[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x2660a0,null))[_0xa4e8('0x2d')](function(_0xaa074d){if(_0xaa074d){return _0xaa074d[_0xa4e8('0xf7')](_0x317b60[_0xa4e8('0x65')][_0xa4e8('0x79')],_['omit'](_0x317b60[_0xa4e8('0x65')],[_0xa4e8('0x79'),'id'])||{});}})[_0xa4e8('0x2d')](respondWithResult(_0x2660a0,null))['catch'](handleError(_0x2660a0,null));};exports[_0xa4e8('0xf8')]=function(_0x389069,_0x570a15){var _0x5931f6={'raw':![],'where':{}};var _0x2d7b44={};var _0x4f6578={'count':0x0,'rows':[]};return db[_0xa4e8('0x49')][_0xa4e8('0x76')]({'where':{'id':_0x389069[_0xa4e8('0x60')]['id']}})['then'](handleEntityNotFound(_0x570a15,null))[_0xa4e8('0x2d')](function(_0x1b1a62){if(_0x1b1a62){_0x2d7b44[_0xa4e8('0x43')]=_[_0xa4e8('0x4d')](db[_0xa4e8('0xb1')]['rawAttributes']);_0x2d7b44[_0xa4e8('0x4c')]=_[_0xa4e8('0x4d')](_0x389069[_0xa4e8('0x4c')]);_0x2d7b44['filters']=_['intersection'](_0x2d7b44[_0xa4e8('0x43')],_0x2d7b44[_0xa4e8('0x4c')]);_0x5931f6[_0xa4e8('0x50')]=_[_0xa4e8('0x4f')](_0x2d7b44[_0xa4e8('0x43')],qs[_0xa4e8('0x51')](_0x389069['query'][_0xa4e8('0x51')]));_0x5931f6['attributes']=_0x5931f6[_0xa4e8('0x50')]['length']?_0x5931f6[_0xa4e8('0x50')]:_0x2d7b44['model'];if(!_0x389069['query'][_0xa4e8('0x53')](_0xa4e8('0x54'))){_0x5931f6[_0xa4e8('0x28')]=qs[_0xa4e8('0x28')](_0x389069[_0xa4e8('0x4c')][_0xa4e8('0x28')]);_0x5931f6['offset']=qs[_0xa4e8('0x26')](_0x389069['query']['offset']);}_0x5931f6[_0xa4e8('0x55')]=qs[_0xa4e8('0x56')](_0x389069[_0xa4e8('0x4c')][_0xa4e8('0x56')]);_0x5931f6[_0xa4e8('0x5a')]=qs['filters'](_[_0xa4e8('0x77')](_0x389069['query'],_0x2d7b44['filters']));_0x5931f6[_0xa4e8('0x5a')][_0xa4e8('0x70')]=_0x1b1a62['id'];if(_0x389069[_0xa4e8('0x4c')][_0xa4e8('0x57')]){_0x5931f6[_0xa4e8('0x5a')]=_[_0xa4e8('0x58')](_0x5931f6[_0xa4e8('0x5a')],{'$or':_[_0xa4e8('0x48')](_0x5931f6[_0xa4e8('0x50')],function(_0x369335){var _0x5cd20a={};_0x5cd20a[_0x369335]={'$like':'%'+_0x389069[_0xa4e8('0x4c')][_0xa4e8('0x57')]+'%'};return _0x5cd20a;})});}_0x5931f6=_[_0xa4e8('0x58')]({},_0x5931f6,_0x389069[_0xa4e8('0x59')]);return db[_0xa4e8('0xb1')][_0xa4e8('0x29')]({'where':_0x5931f6[_0xa4e8('0x5a')]})[_0xa4e8('0x2d')](function(_0x2cc8fb){_0x4f6578[_0xa4e8('0x29')]=_0x2cc8fb;if(_0x389069['query'][_0xa4e8('0x5b')]){_0x5931f6['include']=[{'model':db[_0xa4e8('0xa1')],'as':_0xa4e8('0xf9'),'required':![]},{'model':db['User'],'as':_0xa4e8('0xfa'),'attributes':[_0xa4e8('0x32'),_0xa4e8('0xfb'),_0xa4e8('0xfc')],'required':![]},{'model':db['Tag'],'as':_0xa4e8('0xfd'),'attributes':['id','name',_0xa4e8('0xfe')],'where':_0x389069['query'][_0xa4e8('0xff')]?{'id':_0x389069[_0xa4e8('0x4c')][_0xa4e8('0xff')]}:undefined,'required':_0x389069[_0xa4e8('0x4c')][_0xa4e8('0xff')]?!![]:![]}];}return db[_0xa4e8('0xb1')][_0xa4e8('0x5d')](_0x5931f6);})[_0xa4e8('0x2d')](function(_0x16f5bb){_0x4f6578[_0xa4e8('0x5e')]=_0x16f5bb;return _0x4f6578;});}})[_0xa4e8('0x2d')](respondWithFilteredResult(_0x570a15,_0x5931f6))[_0xa4e8('0x23')](handleError(_0x570a15,null));};exports[_0xa4e8('0x100')]=function(_0x1f1b6c,_0x331aae){var _0x1696f4=0x0;var _0x5c4a8f=0x0;var _0x135918=![];var _0x2198a8;var _0x51614d;return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'where':{'id':_0x1f1b6c[_0xa4e8('0x60')]['id']},'include':[{'model':db[_0xa4e8('0x8f')],'as':_0xa4e8('0x8f'),'include':[{'model':db[_0xa4e8('0x8f')],'as':'Intervals','attributes':['id',_0xa4e8('0xa5')]}]}]})[_0xa4e8('0x2d')](handleEntityNotFound(_0x331aae,null))[_0xa4e8('0x2d')](function(_0x212f83){if(_0x212f83){_0x2198a8=_0x212f83;return _0x212f83[_0xa4e8('0x101')]({'raw':!![]});}})[_0xa4e8('0x2d')](function(_0x57f973){if(_0x2198a8){if(_0x57f973){_0x51614d=_0x57f973;}}return require('../../config/license/util')[_0xa4e8('0x86')]();})[_0xa4e8('0x2d')](function(_0x319ea5){if(_0x319ea5){_0x5c4a8f=_0x319ea5[_0xa4e8('0x102')];_0x135918=_0x319ea5[_0xa4e8('0x103')];}})[_0xa4e8('0x2d')](function(){return db['ChatInteraction'][_0xa4e8('0x29')]({'where':{'closed':![]}});})[_0xa4e8('0x2d')](function(_0x313804){_0x1696f4=_0x313804;if(_0x5c4a8f&&_0x313804>_0x5c4a8f){return db['License'][_0xa4e8('0x76')]({'where':{'id':0x1}})['then'](function(_0x6fbd81){if(_0x6fbd81){_0x6fbd81[_0xa4e8('0x104')](_0xa4e8('0x105'));}});}})[_0xa4e8('0x2d')](function(){var _0x55a04d=_0x2198a8[_0xa4e8('0x8f')];var _0xf259d4=_0x2198a8[_0xa4e8('0x91')]||undefined;return _0x55a04d?_0x55a04d[_0xa4e8('0x92')](_0xf259d4):!![];})[_0xa4e8('0x2d')](function(_0x48ec6e){var _0x21754a=fs['readFileSync'](path[_0xa4e8('0x88')](config['root'],_0xa4e8('0x106')),_0xa4e8('0xd6'));var _0x27af8b=_0xa4e8('0x107');var _0x15329=![];try{const _0x1ffd04=new URL(_0x2198a8[_0xa4e8('0x66')]);_0x2198a8[_0xa4e8('0x66')]=_0x1ffd04['origin'];}catch(_0x5531ae){}var _0x4f3147;if(_0x1f1b6c[_0xa4e8('0x108')][_0xa4e8('0x3b')]){_0x1f1b6c[_0xa4e8('0x108')]['referer']=_0x1f1b6c[_0xa4e8('0x108')][_0xa4e8('0x3b')][_0xa4e8('0x109')](/\/$/,'');_0x4f3147=wildcardUtils[_0xa4e8('0x10a')](_0x2198a8[_0xa4e8('0x66')],_0x1f1b6c['headers'][_0xa4e8('0x3b')]);}else{_0x1f1b6c[_0xa4e8('0x108')]['referer']=_0x2198a8['address'];_0x4f3147=!![];}var _0x2a8bc8={'chatVersion':_0x27af8b,'chatWebsiteAddressOrigin':_0x4f3147?_0x1f1b6c['headers'][_0xa4e8('0x3b')]:_0x2198a8[_0xa4e8('0x66')],'remote':_0x2198a8[_0xa4e8('0x10b')],'query':querystring[_0xa4e8('0x46')](_[_0xa4e8('0x58')](_0x2198a8[_0xa4e8('0x2e')]({'plain':!![]}),{'customerIp':_0x1f1b6c[_0xa4e8('0x108')][_0xa4e8('0x37')]||_0x1f1b6c['headers'][_0xa4e8('0x10c')]||_0x1f1b6c[_0xa4e8('0x10d')]['remoteAddress']||_0x1f1b6c['ip'],'referer':_0x1f1b6c['headers'][_0xa4e8('0x3b')],'openedInteractions':_0x1696f4,'maxInteractions':_0x5c4a8f,'virtual':_0x135918['virtual'],'online':_0x48ec6e,'custom':_0x135918,'address':_0x4f3147?_0x1f1b6c['headers'][_0xa4e8('0x3b')]:null}))[_0xa4e8('0x109')](/'/g,'\x5c\x27')};_0x331aae['send'](ejs['render'](Mustache[_0xa4e8('0xd7')](_0x21754a,_0x2a8bc8),{'proactiveActions':_0x51614d,'alignment':_0x2198a8['alignment'],'verticalAlignment':_0x2198a8[_0xa4e8('0x10e')],'div_color':_0x2198a8[_0xa4e8('0xfe')],'labelText':_0x2198a8[_0xa4e8('0x10f')],'text_color':_0x2198a8[_0xa4e8('0x110')],'text_button_color':_0x2198a8[_0xa4e8('0x111')],'button_color':_0x2198a8[_0xa4e8('0x112')],'background_color':_0x2198a8[_0xa4e8('0x113')],'hideWhenOffline':_0x2198a8[_0xa4e8('0x114')],'intervalId':_0x2198a8[_0xa4e8('0x115')],'isDevelopment':_0x15329,'chatVersion':_0x27af8b}));})['catch'](handleError(_0x331aae,null));};exports[_0xa4e8('0x116')]=function(_0x30ca35,_0x56746c){var _0x382bcb=_0x30ca35['params']['id'];var _0x28b1c1=_0x30ca35[_0xa4e8('0x65')];var _0x2cc9f5=0xc8;var _0x1ac3c9=null;return db[_0xa4e8('0xe1')][_0xa4e8('0x117')]({'isolationLevel':db['sequelize'][_0xa4e8('0x118')][_0xa4e8('0x119')][_0xa4e8('0x11a')]},function(_0x4945cb){return db[_0xa4e8('0x49')]['findOne']({'where':{'id':_0x382bcb},'transaction':_0x4945cb})[_0xa4e8('0x2d')](function(_0x1534b0){if(_0x1534b0){return db[_0xa4e8('0x11b')]['destroy']({'where':{'ChatWebsiteId':_0x382bcb},'transaction':_0x4945cb})[_0xa4e8('0x2d')](function(){var _0x329567=_[_0xa4e8('0x48')](_0x28b1c1,function(_0xb95b72){_0xb95b72[_0xa4e8('0x70')]=_0x382bcb;return _0xb95b72;});return db[_0xa4e8('0x11b')][_0xa4e8('0x11c')](_0x329567,{'transaction':_0x4945cb});});}else{_0x2cc9f5=0x194;_0x1ac3c9=[];}});})[_0xa4e8('0x2d')](function(){if(_0x2cc9f5!==0x194){return db[_0xa4e8('0x11b')][_0xa4e8('0x11d')]({'where':{'ChatWebsiteId':_0x382bcb},'order':_0xa4e8('0xaa')})['then'](function(_0x29ba07){_0x1ac3c9=_0x29ba07;});}})[_0xa4e8('0x23')](function(_0x4d08c7){_0x2cc9f5=0x1f4;logger[_0xa4e8('0x1f')](_0x4d08c7['stack']);if(_0x4d08c7[_0xa4e8('0x32')]){delete _0x4d08c7[_0xa4e8('0x32')];}_0x1ac3c9=_0x4d08c7;})[_0xa4e8('0x11e')](function(){if(_0x1ac3c9===null){_0x56746c[_0xa4e8('0x24')](_0x2cc9f5);}else{if(_0x2cc9f5===0x1f4){_0x56746c[_0xa4e8('0x2a')](_0x2cc9f5)[_0xa4e8('0x33')](_0x1ac3c9);}else{_0x56746c[_0xa4e8('0x2a')](_0x2cc9f5)['json'](_0x1ac3c9);}}});};exports[_0xa4e8('0x11f')]=function(_0x51c485,_0x7acadd){var _0x1687d3={};var _0x49458a={};var _0x12cc57;var _0x4ab294;return db['ChatWebsite']['findOne']({'where':{'id':_0x51c485[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x7acadd,null))[_0xa4e8('0x2d')](function(_0x3d4cee){if(_0x3d4cee){_0x12cc57=_0x3d4cee;_0x49458a[_0xa4e8('0x43')]=_[_0xa4e8('0x4d')](db[_0xa4e8('0x11b')][_0xa4e8('0x62')]);_0x49458a[_0xa4e8('0x4c')]=_[_0xa4e8('0x4d')](_0x51c485[_0xa4e8('0x4c')]);_0x49458a[_0xa4e8('0x4e')]=_['intersection'](_0x49458a['model'],_0x49458a['query']);_0x1687d3[_0xa4e8('0x50')]=_[_0xa4e8('0x4f')](_0x49458a['model'],qs[_0xa4e8('0x51')](_0x51c485[_0xa4e8('0x4c')][_0xa4e8('0x51')]));_0x1687d3[_0xa4e8('0x50')]=_0x1687d3[_0xa4e8('0x50')][_0xa4e8('0x52')]?_0x1687d3[_0xa4e8('0x50')]:_0x49458a[_0xa4e8('0x43')];_0x1687d3['order']=qs[_0xa4e8('0x56')](_0x51c485[_0xa4e8('0x4c')][_0xa4e8('0x56')]);_0x1687d3[_0xa4e8('0x5a')]=qs[_0xa4e8('0x4e')](_[_0xa4e8('0x77')](_0x51c485['query'],_0x49458a[_0xa4e8('0x4e')]));if(_0x51c485[_0xa4e8('0x4c')][_0xa4e8('0x57')]){_0x1687d3['where']=_[_0xa4e8('0x58')](_0x1687d3['where'],{'$or':_[_0xa4e8('0x48')](_0x1687d3[_0xa4e8('0x50')],function(_0x30c568){var _0x2388a5={};_0x2388a5[_0x30c568]={'$like':'%'+_0x51c485['query'][_0xa4e8('0x57')]+'%'};return _0x2388a5;})});}_0x1687d3=_['merge']({},_0x1687d3,_0x51c485[_0xa4e8('0x59')]);return _0x12cc57[_0xa4e8('0x11f')](_0x1687d3);}})[_0xa4e8('0x2d')](function(_0x1096a0){if(_0x1096a0){_0x4ab294=_0x1096a0['length'];if(!_0x51c485[_0xa4e8('0x4c')]['hasOwnProperty'](_0xa4e8('0x54'))){_0x1687d3[_0xa4e8('0x28')]=qs[_0xa4e8('0x28')](_0x51c485['query'][_0xa4e8('0x28')]);_0x1687d3[_0xa4e8('0x26')]=qs[_0xa4e8('0x26')](_0x51c485[_0xa4e8('0x4c')][_0xa4e8('0x26')]);}return _0x12cc57[_0xa4e8('0x11f')](_0x1687d3);}})[_0xa4e8('0x2d')](function(_0x3a3b36){if(_0x3a3b36){return _0x3a3b36?{'count':_0x4ab294,'rows':_0x3a3b36}:null;}})[_0xa4e8('0x2d')](respondWithResult(_0x7acadd,null))[_0xa4e8('0x23')](handleError(_0x7acadd,null));};exports['addProactiveActions']=function(_0x253bc0,_0x4b9dc9){return db[_0xa4e8('0x120')][_0xa4e8('0x63')]({'where':{'id':_0x253bc0[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x4b9dc9,null))[_0xa4e8('0x2d')](function(_0xc8d20c){if(_0xc8d20c){return _0xc8d20c[_0xa4e8('0x121')](_0x253bc0[_0xa4e8('0x65')][_0xa4e8('0x79')],_['omit'](_0x253bc0['body'],['ids','id'])||{});}})[_0xa4e8('0x2d')](respondWithResult(_0x4b9dc9,null))[_0xa4e8('0x23')](handleError(_0x4b9dc9,null));};exports[_0xa4e8('0x101')]=function(_0x40d14a,_0x3bb732){var _0x21b784={};var _0x204b95={};var _0x19dbc9;var _0x4da7c1;return db[_0xa4e8('0x49')][_0xa4e8('0x76')]({'where':{'id':_0x40d14a[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x3bb732,null))[_0xa4e8('0x2d')](function(_0x32e442){if(_0x32e442){_0x19dbc9=_0x32e442;_0x204b95[_0xa4e8('0x43')]=_[_0xa4e8('0x4d')](db[_0xa4e8('0x122')][_0xa4e8('0x62')]);_0x204b95[_0xa4e8('0x4c')]=_[_0xa4e8('0x4d')](_0x40d14a[_0xa4e8('0x4c')]);_0x204b95['filters']=_['intersection'](_0x204b95[_0xa4e8('0x43')],_0x204b95[_0xa4e8('0x4c')]);_0x21b784[_0xa4e8('0x50')]=_['intersection'](_0x204b95[_0xa4e8('0x43')],qs[_0xa4e8('0x51')](_0x40d14a[_0xa4e8('0x4c')][_0xa4e8('0x51')]));_0x21b784['attributes']=_0x21b784['attributes']['length']?_0x21b784[_0xa4e8('0x50')]:_0x204b95[_0xa4e8('0x43')];_0x21b784['order']=qs[_0xa4e8('0x56')](_0x40d14a['query'][_0xa4e8('0x56')]);_0x21b784[_0xa4e8('0x5a')]=qs[_0xa4e8('0x4e')](_[_0xa4e8('0x77')](_0x40d14a[_0xa4e8('0x4c')],_0x204b95[_0xa4e8('0x4e')]));if(_0x40d14a['query'][_0xa4e8('0x57')]){_0x21b784['where']=_['merge'](_0x21b784['where'],{'$or':_['map'](_0x21b784['attributes'],function(_0x8712e7){var _0x4f52ba={};_0x4f52ba[_0x8712e7]={'$like':'%'+_0x40d14a[_0xa4e8('0x4c')]['filter']+'%'};return _0x4f52ba;})});}_0x21b784=_[_0xa4e8('0x58')]({},_0x21b784,_0x40d14a[_0xa4e8('0x59')]);return _0x19dbc9[_0xa4e8('0x101')](_0x21b784);}})[_0xa4e8('0x2d')](function(_0x20d03e){if(_0x20d03e){_0x4da7c1=_0x20d03e[_0xa4e8('0x52')];if(!_0x40d14a['query'][_0xa4e8('0x53')](_0xa4e8('0x54'))){_0x21b784['limit']=qs['limit'](_0x40d14a[_0xa4e8('0x4c')]['limit']);_0x21b784['offset']=qs[_0xa4e8('0x26')](_0x40d14a[_0xa4e8('0x4c')][_0xa4e8('0x26')]);}return _0x19dbc9[_0xa4e8('0x101')](_0x21b784);}})[_0xa4e8('0x2d')](function(_0xbb5378){if(_0xbb5378){return _0xbb5378?{'count':_0x4da7c1,'rows':_0xbb5378}:null;}})['then'](respondWithResult(_0x3bb732,null))[_0xa4e8('0x23')](handleError(_0x3bb732,null));};exports[_0xa4e8('0x123')]=function(_0x59d382,_0x4c79eb){var _0x18cbcc=_0x59d382['query'][_0xa4e8('0x124')]===_0xa4e8('0x125')?_0xa4e8('0x126'):_0xa4e8('0x127');return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'attributes':['id',_0x18cbcc],'where':{'id':_0x59d382[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x4c79eb,null))[_0xa4e8('0x2d')](function(_0x8583ff){if(_0x8583ff){var _0x5c7c9b=_0x8583ff[_0x18cbcc];var _0x15ee6e=_0x5c7c9b&&_0x5c7c9b[_0xa4e8('0x128')]?_0x5c7c9b[_0xa4e8('0x128')]:[];_0x4c79eb[_0xa4e8('0x33')]({'fromKey':_[_0xa4e8('0x87')](_0x5c7c9b[_0xa4e8('0x129')])?undefined:_0x5c7c9b[_0xa4e8('0x129')],'count':_0x15ee6e[_0xa4e8('0x52')],'rows':_0x15ee6e});}})[_0xa4e8('0x23')](handleError(_0x4c79eb,null));};exports[_0xa4e8('0x12a')]=function(_0x2b496d,_0x3bb4b9){var _0x4e62b6={'raw':![],'where':{}};var _0x4b9075={};var _0x56a5f2={'count':0x0,'rows':[]};return db[_0xa4e8('0x49')][_0xa4e8('0x76')]({'where':{'id':_0x2b496d[_0xa4e8('0x60')]['id']}})['then'](handleEntityNotFound(_0x3bb4b9,null))[_0xa4e8('0x2d')](function(_0x3f8703){if(_0x3f8703){_0x4b9075[_0xa4e8('0x43')]=_[_0xa4e8('0x4d')](db[_0xa4e8('0x12b')][_0xa4e8('0x62')]);_0x4b9075[_0xa4e8('0x4c')]=_[_0xa4e8('0x4d')](_0x2b496d[_0xa4e8('0x4c')]);_0x4b9075['filters']=_[_0xa4e8('0x4f')](_0x4b9075['model'],_0x4b9075[_0xa4e8('0x4c')]);_0x4e62b6[_0xa4e8('0x50')]=_[_0xa4e8('0x4f')](_0x4b9075[_0xa4e8('0x43')],qs[_0xa4e8('0x51')](_0x2b496d[_0xa4e8('0x4c')]['fields']));_0x4e62b6[_0xa4e8('0x50')]=_0x4e62b6[_0xa4e8('0x50')][_0xa4e8('0x52')]?_0x4e62b6[_0xa4e8('0x50')]:_0x4b9075[_0xa4e8('0x43')];if(!_0x2b496d['query'][_0xa4e8('0x53')](_0xa4e8('0x54'))){_0x4e62b6['limit']=qs[_0xa4e8('0x28')](_0x2b496d[_0xa4e8('0x4c')][_0xa4e8('0x28')]);_0x4e62b6[_0xa4e8('0x26')]=qs[_0xa4e8('0x26')](_0x2b496d[_0xa4e8('0x4c')][_0xa4e8('0x26')]);}_0x4e62b6[_0xa4e8('0x55')]=qs['sort'](_0x2b496d[_0xa4e8('0x4c')][_0xa4e8('0x56')]);_0x4e62b6[_0xa4e8('0x5a')]=qs[_0xa4e8('0x4e')](_['pick'](_0x2b496d[_0xa4e8('0x4c')],_0x4b9075[_0xa4e8('0x4e')]));_0x4e62b6[_0xa4e8('0x5a')][_0xa4e8('0x70')]=_0x3f8703['id'];if(_0x2b496d['query'][_0xa4e8('0x57')]){_0x4e62b6[_0xa4e8('0x5a')]=_[_0xa4e8('0x58')](_0x4e62b6['where'],{'$or':_[_0xa4e8('0x48')](_0x4e62b6[_0xa4e8('0x50')],function(_0x5c18ad){var _0x1b4d99={};_0x1b4d99[_0x5c18ad]={'$like':'%'+_0x2b496d['query']['filter']+'%'};return _0x1b4d99;})});}_0x4e62b6=_['merge']({},_0x4e62b6,_0x2b496d[_0xa4e8('0x59')]);return db[_0xa4e8('0x12b')]['count']({'where':_0x4e62b6[_0xa4e8('0x5a')]})[_0xa4e8('0x2d')](function(_0x3436d5){_0x56a5f2[_0xa4e8('0x29')]=_0x3436d5;if(_0x2b496d[_0xa4e8('0x4c')][_0xa4e8('0x5b')]){_0x4e62b6[_0xa4e8('0x5c')]=[{'all':!![]}];}else{_0x4e62b6['include']=[{'model':db[_0xa4e8('0xa1')],'as':_0xa4e8('0xf9'),'required':![]},{'model':db[_0xa4e8('0x12c')],'as':_0xa4e8('0x12d'),'required':![]}];}return db[_0xa4e8('0x12b')][_0xa4e8('0x5d')](_0x4e62b6);})[_0xa4e8('0x2d')](function(_0x4a5717){_0x56a5f2['rows']=_0x4a5717;return _0x56a5f2;});}})['then'](respondWithFilteredResult(_0x3bb4b9,_0x4e62b6))[_0xa4e8('0x23')](handleError(_0x3bb4b9,null));};exports[_0xa4e8('0x12e')]=function(_0x2f2479,_0x2c21e0){return db[_0xa4e8('0x49')]['find']({'where':{'id':_0x2f2479[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x2c21e0,null))['then'](function(_0x2e9a16){if(_0x2e9a16){return _0x2e9a16['addAgents'](_0x2f2479[_0xa4e8('0x65')][_0xa4e8('0x79')],_[_0xa4e8('0x12f')](_0x2f2479[_0xa4e8('0x65')],['ids','id'])||{})['spread'](function(_0x5f0207){for(var _0x847eef=0x0;_0x847eef<_0x2f2479[_0xa4e8('0x65')][_0xa4e8('0x79')][_0xa4e8('0x52')];_0x847eef+=0x1){socket[_0xa4e8('0x130')](_0xa4e8('0x131'),{'UserId':Number(_0x2f2479[_0xa4e8('0x65')]['ids'][_0x847eef]),'ChatWebsiteId':Number(_0x2f2479['params']['id'])});}return _0x5f0207;});}})['then'](respondWithResult(_0x2c21e0,null))[_0xa4e8('0x23')](handleError(_0x2c21e0,null));};exports[_0xa4e8('0x132')]=function(_0x1da025,_0x2177af){return db[_0xa4e8('0x49')][_0xa4e8('0x63')]({'where':{'id':_0x1da025['params']['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x2177af,null))[_0xa4e8('0x2d')](function(_0x20bda5){if(_0x20bda5){return _0x20bda5[_0xa4e8('0x132')](_0x1da025['query'][_0xa4e8('0x79')])[_0xa4e8('0x2d')](function(){if(_['isArray'](_0x1da025[_0xa4e8('0x4c')]['ids'])){for(var _0xe4bb7d=0x0;_0xe4bb7d<_0x1da025[_0xa4e8('0x4c')]['ids'][_0xa4e8('0x52')];_0xe4bb7d+=0x1){socket[_0xa4e8('0x130')]('userChatWebsite:remove',{'UserId':Number(_0x1da025[_0xa4e8('0x4c')][_0xa4e8('0x79')][_0xe4bb7d]),'ChatWebsiteId':Number(_0x1da025['params']['id'])});}}else{socket['emit'](_0xa4e8('0x133'),{'UserId':Number(_0x1da025[_0xa4e8('0x4c')][_0xa4e8('0x79')]),'ChatWebsiteId':Number(_0x1da025[_0xa4e8('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x2177af,null))['catch'](handleError(_0x2177af,null));};exports[_0xa4e8('0x134')]=function(_0x555a54,_0x50282e){var _0x18ae6c={};var _0x174902={};var _0x2fde66;var _0x1385dc;return db[_0xa4e8('0x49')][_0xa4e8('0x76')]({'where':{'id':_0x555a54[_0xa4e8('0x60')]['id']}})[_0xa4e8('0x2d')](handleEntityNotFound(_0x50282e,null))[_0xa4e8('0x2d')](function(_0x2ca2c1){if(_0x2ca2c1){_0x2fde66=_0x2ca2c1;_0x174902[_0xa4e8('0x43')]=_[_0xa4e8('0x4d')](db[_0xa4e8('0xbe')][_0xa4e8('0x62')]);_0x174902[_0xa4e8('0x4c')]=_[_0xa4e8('0x4d')](_0x555a54[_0xa4e8('0x4c')]);_0x174902['filters']=_[_0xa4e8('0x4f')](_0x174902[_0xa4e8('0x43')],_0x174902['query']);_0x18ae6c[_0xa4e8('0x50')]=_['intersection'](_0x174902['model'],qs[_0xa4e8('0x51')](_0x555a54[_0xa4e8('0x4c')]['fields']));_0x18ae6c[_0xa4e8('0x50')]=_0x18ae6c[_0xa4e8('0x50')][_0xa4e8('0x52')]?_0x18ae6c[_0xa4e8('0x50')]:_0x174902[_0xa4e8('0x43')];_0x18ae6c[_0xa4e8('0x55')]=qs[_0xa4e8('0x56')](_0x555a54[_0xa4e8('0x4c')]['sort']);_0x18ae6c['where']=qs[_0xa4e8('0x4e')](_[_0xa4e8('0x77')](_0x555a54['query'],_0x174902[_0xa4e8('0x4e')]));if(_0x555a54['query'][_0xa4e8('0x57')]){_0x18ae6c['where']=_[_0xa4e8('0x58')](_0x18ae6c[_0xa4e8('0x5a')],{'$or':_[_0xa4e8('0x48')](_0x18ae6c[_0xa4e8('0x50')],function(_0x146677){var _0x44434c={};_0x44434c[_0x146677]={'$like':'%'+_0x555a54['query'][_0xa4e8('0x57')]+'%'};return _0x44434c;})});}_0x18ae6c=_[_0xa4e8('0x58')]({},_0x18ae6c,_0x555a54['options']);return _0x2fde66[_0xa4e8('0x134')](_0x18ae6c);}})[_0xa4e8('0x2d')](function(_0x34c077){if(_0x34c077){_0x1385dc=_0x34c077[_0xa4e8('0x52')];if(!_0x555a54[_0xa4e8('0x4c')]['hasOwnProperty'](_0xa4e8('0x54'))){_0x18ae6c[_0xa4e8('0x28')]=qs[_0xa4e8('0x28')](_0x555a54['query']['limit']);_0x18ae6c[_0xa4e8('0x26')]=qs[_0xa4e8('0x26')](_0x555a54[_0xa4e8('0x4c')][_0xa4e8('0x26')]);}return _0x2fde66[_0xa4e8('0x134')](_0x18ae6c);}})['then'](function(_0x2b6896){if(_0x2b6896){return _0x2b6896?{'count':_0x1385dc,'rows':_0x2b6896}:null;}})['then'](respondWithResult(_0x50282e,null))[_0xa4e8('0x23')](handleError(_0x50282e,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 95b4586..f52c24e 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 _0x7f90=['save','emit','hasOwnProperty','hook','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x90d801,_0x5e10e5){var _0x136d39=function(_0x5b723c){while(--_0x5b723c){_0x90d801['push'](_0x90d801['shift']());}};_0x136d39(++_0x5e10e5);}(_0x7f90,0xf4));var _0x07f9=function(_0x3fa4bd,_0x14a72d){_0x3fa4bd=_0x3fa4bd-0x0;var _0x358c95=_0x7f90[_0x3fa4bd];return _0x358c95;};'use strict';var EventEmitter=require(_0x07f9('0x0'));var ChatWebsite=require(_0x07f9('0x1'))['db'][_0x07f9('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x07f9('0x3')](0x0);var events={'afterCreate':_0x07f9('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x15b548){return function(_0x132ae4,_0x574e7d,_0x36a0f1){ChatWebsiteEvents[_0x07f9('0x5')](_0x15b548+':'+_0x132ae4['id'],_0x132ae4);ChatWebsiteEvents[_0x07f9('0x5')](_0x15b548,_0x132ae4);_0x36a0f1(null);};}for(var e in events){if(events[_0x07f9('0x6')](e)){var event=events[e];ChatWebsite[_0x07f9('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0xb790=['exports','../../mysqldb','update','emit','hasOwnProperty','hook'];(function(_0x1669fa,_0x1617a6){var _0x172622=function(_0x57a81b){while(--_0x57a81b){_0x1669fa['push'](_0x1669fa['shift']());}};_0x172622(++_0x1617a6);}(_0xb790,0xe5));var _0x0b79=function(_0xe65ac8,_0x2691be){_0xe65ac8=_0xe65ac8-0x0;var _0x202ba1=_0xb790[_0xe65ac8];return _0x202ba1;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x0b79('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0b79('0x1'),'afterDestroy':'remove'};function emitEvent(_0x4d16f6){return function(_0x2d75b0,_0x30b3fa,_0x55d197){ChatWebsiteEvents[_0x0b79('0x2')](_0x4d16f6+':'+_0x2d75b0['id'],_0x2d75b0);ChatWebsiteEvents[_0x0b79('0x2')](_0x4d16f6,_0x2d75b0);_0x55d197(null);};}for(var e in events){if(events[_0x0b79('0x3')](e)){var event=events[e];ChatWebsite[_0x0b79('0x4')](e,emitEvent(event));}}module[_0x0b79('0x5')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 9ddca83..9917c8a 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 _0x30e8=['rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1db70f,_0x1ead6a){var _0x5f31f4=function(_0x1f503d){while(--_0x1f503d){_0x1db70f['push'](_0x1db70f['shift']());}};_0x5f31f4(++_0x1ead6a);}(_0x30e8,0x142));var _0x830e=function(_0x40440c,_0x37a4e1){_0x40440c=_0x40440c-0x0;var _0x3d7b2c=_0x30e8[_0x40440c];return _0x3d7b2c;};'use strict';var _=require(_0x830e('0x0'));var util=require(_0x830e('0x1'));var logger=require(_0x830e('0x2'))(_0x830e('0x3'));var moment=require(_0x830e('0x4'));var BPromise=require(_0x830e('0x5'));var rp=require(_0x830e('0x6'));var fs=require('fs');var path=require(_0x830e('0x7'));var rimraf=require(_0x830e('0x8'));var config=require(_0x830e('0x9'));var attributes=require(_0x830e('0xa'));module[_0x830e('0xb')]=function(_0xcc72e2,_0x30b082){return _0xcc72e2[_0x830e('0xc')](_0x830e('0xd'),attributes,{'tableName':_0x830e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x542b=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash'];(function(_0x4418b2,_0x5d6c76){var _0x379e74=function(_0x14b351){while(--_0x14b351){_0x4418b2['push'](_0x4418b2['shift']());}};_0x379e74(++_0x5d6c76);}(_0x542b,0xb5));var _0xb542=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0x542b[_0x54edc9];return _0x2ae7a9;};'use strict';var _=require(_0xb542('0x0'));var util=require(_0xb542('0x1'));var logger=require(_0xb542('0x2'))(_0xb542('0x3'));var moment=require('moment');var BPromise=require(_0xb542('0x4'));var rp=require(_0xb542('0x5'));var fs=require('fs');var path=require(_0xb542('0x6'));var rimraf=require('rimraf');var config=require(_0xb542('0x7'));var attributes=require(_0xb542('0x8'));module[_0xb542('0x9')]=function(_0x146e3d,_0x16ed4){return _0x146e3d[_0xb542('0xa')](_0xb542('0xb'),attributes,{'tableName':_0xb542('0xc'),'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 c876d64..9324b0e 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 _0x34a4=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x5449e9,_0x4f69bb){var _0x20ad70=function(_0x5cac63){while(--_0x5cac63){_0x5449e9['push'](_0x5449e9['shift']());}};_0x20ad70(++_0x4f69bb);}(_0x34a4,0x143));var _0x434a=function(_0x5e8c5a,_0x55f183){_0x5e8c5a=_0x5e8c5a-0x0;var _0xac732d=_0x34a4[_0x5e8c5a];return _0xac732d;};'use strict';var _=require('lodash');var util=require(_0x434a('0x0'));var moment=require(_0x434a('0x1'));var BPromise=require(_0x434a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x434a('0x3'));var db=require(_0x434a('0x4'))['db'];var utils=require(_0x434a('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x434a('0x6'));var client=jayson[_0x434a('0x7')][_0x434a('0x8')]({'port':0x232a});config[_0x434a('0x9')]=_[_0x434a('0xa')](config[_0x434a('0x9')],{'host':_0x434a('0xb'),'port':0x18eb});var socket=require(_0x434a('0xc'))(new Redis(config['redis']));require(_0x434a('0xd'))[_0x434a('0xe')](socket);function respondWithRpcPromise(_0x357e5e,_0x5798ca,_0xb3fbdc){return new BPromise(function(_0x172406,_0x3c2401){return client[_0x434a('0xf')](_0x357e5e,_0xb3fbdc)['then'](function(_0x3f1cb3){logger[_0x434a('0x10')](_0x434a('0x11'),_0x5798ca,_0x434a('0x12'));logger[_0x434a('0x13')](_0x434a('0x14'),_0x5798ca,_0x434a('0x12'),JSON[_0x434a('0x15')](_0x3f1cb3));if(_0x3f1cb3[_0x434a('0x16')]){if(_0x3f1cb3['error'][_0x434a('0x17')]===0x1f4){logger[_0x434a('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x5798ca,_0x3f1cb3[_0x434a('0x16')][_0x434a('0x18')]);return _0x3c2401(_0x3f1cb3[_0x434a('0x16')]['message']);}logger[_0x434a('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x5798ca,_0x3f1cb3['error'][_0x434a('0x18')]);return _0x172406(_0x3f1cb3[_0x434a('0x16')][_0x434a('0x18')]);}else{logger[_0x434a('0x10')](_0x434a('0x11'),_0x5798ca,_0x434a('0x12'));_0x172406(_0x3f1cb3[_0x434a('0x19')][_0x434a('0x18')]);}})[_0x434a('0x1a')](function(_0x28553a){logger[_0x434a('0x16')](_0x434a('0x11'),_0x5798ca,_0x28553a);_0x3c2401(_0x28553a);});});} \ No newline at end of file +var _0xc476=['info','result','catch','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x175f09,_0x5f158d){var _0x5d99fe=function(_0x4b828c){while(--_0x4b828c){_0x175f09['push'](_0x175f09['shift']());}};_0x5d99fe(++_0x5f158d);}(_0xc476,0x161));var _0x6c47=function(_0x3caae0,_0x2a5646){_0x3caae0=_0x3caae0-0x0;var _0x34e8bc=_0xc476[_0x3caae0];return _0x34e8bc;};'use strict';var _=require(_0x6c47('0x0'));var util=require(_0x6c47('0x1'));var moment=require(_0x6c47('0x2'));var BPromise=require(_0x6c47('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c47('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6c47('0x5'));var config=require(_0x6c47('0x6'));var jayson=require(_0x6c47('0x7'));var client=jayson[_0x6c47('0x8')][_0x6c47('0x9')]({'port':0x232a});config[_0x6c47('0xa')]=_[_0x6c47('0xb')](config[_0x6c47('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6c47('0xc'))(new Redis(config['redis']));require(_0x6c47('0xd'))[_0x6c47('0xe')](socket);function respondWithRpcPromise(_0xe0471,_0x173604,_0x5b3814){return new BPromise(function(_0x16417e,_0x49355a){return client['request'](_0xe0471,_0x5b3814)['then'](function(_0x562cc0){logger['info'](_0x6c47('0xf'),_0x173604,_0x6c47('0x10'));logger[_0x6c47('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x173604,_0x6c47('0x10'),JSON[_0x6c47('0x12')](_0x562cc0));if(_0x562cc0['error']){if(_0x562cc0[_0x6c47('0x13')][_0x6c47('0x14')]===0x1f4){logger['error'](_0x6c47('0xf'),_0x173604,_0x562cc0[_0x6c47('0x13')][_0x6c47('0x15')]);return _0x49355a(_0x562cc0[_0x6c47('0x13')][_0x6c47('0x15')]);}logger['error'](_0x6c47('0xf'),_0x173604,_0x562cc0[_0x6c47('0x13')][_0x6c47('0x15')]);return _0x16417e(_0x562cc0['error']['message']);}else{logger[_0x6c47('0x16')](_0x6c47('0xf'),_0x173604,_0x6c47('0x10'));_0x16417e(_0x562cc0[_0x6c47('0x17')][_0x6c47('0x15')]);}})[_0x6c47('0x18')](function(_0xb8dc09){logger[_0x6c47('0x13')](_0x6c47('0xf'),_0x173604,_0xb8dc09);_0x49355a(_0xb8dc09);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 3cfb8f6..38780d4 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 _0xc8b9=['emit','removeListener','register','length','chatWebsite:','save','update'];(function(_0x324eef,_0x4e91e0){var _0x35fe39=function(_0x155530){while(--_0x155530){_0x324eef['push'](_0x324eef['shift']());}};_0x35fe39(++_0x4e91e0);}(_0xc8b9,0xd0));var _0x9c8b=function(_0x761974,_0x68a82d){_0x761974=_0x761974-0x0;var _0x3bff15=_0xc8b9[_0x761974];return _0x3bff15;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x9c8b('0x0'),'remove',_0x9c8b('0x1')];function createListener(_0x59b4aa,_0x49af4a){return function(_0x20cbbe){_0x49af4a[_0x9c8b('0x2')](_0x59b4aa,_0x20cbbe);};}function removeListener(_0x4796b6,_0x392f9c){return function(){ChatWebsiteEvents[_0x9c8b('0x3')](_0x4796b6,_0x392f9c);};}exports[_0x9c8b('0x4')]=function(_0x3af40c){for(var _0x133155=0x0,_0x1da985=events[_0x9c8b('0x5')];_0x133155<_0x1da985;_0x133155++){var _0x4de776=events[_0x133155];var _0xa977fe=createListener(_0x9c8b('0x6')+_0x4de776,_0x3af40c);ChatWebsiteEvents['on'](_0x4de776,_0xa977fe);}}; \ No newline at end of file +var _0xb958=['chatWebsite:','./chatWebsite.events','update','emit','removeListener','register','length'];(function(_0x1bb7be,_0x84652d){var _0x2101d4=function(_0x242a89){while(--_0x242a89){_0x1bb7be['push'](_0x1bb7be['shift']());}};_0x2101d4(++_0x84652d);}(_0xb958,0xb0));var _0x8b95=function(_0x1c37a5,_0x59ee51){_0x1c37a5=_0x1c37a5-0x0;var _0x389d03=_0xb958[_0x1c37a5];return _0x389d03;};'use strict';var ChatWebsiteEvents=require(_0x8b95('0x0'));var events=['save','remove',_0x8b95('0x1')];function createListener(_0x266166,_0x47c5a0){return function(_0x527bc1){_0x47c5a0[_0x8b95('0x2')](_0x266166,_0x527bc1);};}function removeListener(_0x1bf94b,_0x1bb8be){return function(){ChatWebsiteEvents[_0x8b95('0x3')](_0x1bf94b,_0x1bb8be);};}exports[_0x8b95('0x4')]=function(_0x18c7fe){for(var _0x385991=0x0,_0x1b7a2b=events[_0x8b95('0x5')];_0x385991<_0x1b7a2b;_0x385991++){var _0x14b3c9=events[_0x385991];var _0x4dd3f6=createListener(_0x8b95('0x6')+_0x14b3c9,_0x18c7fe);ChatWebsiteEvents['on'](_0x14b3c9,_0x4dd3f6);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js index 4ab6182..7c45fa3 100644 --- a/server/api/chatWebsite/helpers/wildcard-expressions.js +++ b/server/api/chatWebsite/helpers/wildcard-expressions.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb332=['../../../utils/misc','url','URL','localhost','test','replace','exports'];(function(_0x366532,_0x1124cb){var _0x35b466=function(_0x19f495){while(--_0x19f495){_0x366532['push'](_0x366532['shift']());}};_0x35b466(++_0x1124cb);}(_0xb332,0xd9));var _0x2b33=function(_0x3d78d7,_0x44acea){_0x3d78d7=_0x3d78d7-0x0;var _0x4b6784=_0xb332[_0x3d78d7];return _0x4b6784;};var escapeRegExp=require(_0x2b33('0x0'))['escapeRegExp'];var URL=require(_0x2b33('0x1'))[_0x2b33('0x2')];function testWildcardValidity(_0x5ee720){let _0xf8c6a7=!![];try{new URL(_0x5ee720['replace']('*',_0x2b33('0x3')));}catch(_0x4c6634){_0xf8c6a7=![];}return _0xf8c6a7&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x2b33('0x4')](_0x5ee720);}function testWebsiteWithWildcard(_0x5e5e86,_0xf9b9c2){let _0x22d66;const _0x478214=escapeRegExp(_0x5e5e86)[_0x2b33('0x5')]('\x5c*','([\x5cw]+)');try{new URL(_0x5e5e86['replace']('\x5c*',_0x2b33('0x3')));_0x22d66=new RegExp(_0x478214)['test'](_0xf9b9c2);}catch(_0xb3aeab){_0x22d66=![];}return _0x22d66;}module[_0x2b33('0x6')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file +var _0x43fd=['../../../utils/misc','escapeRegExp','URL','replace','localhost','test','([\x5cw]+)','exports'];(function(_0x20a9d0,_0x1ab2b3){var _0xf67c4e=function(_0x217a43){while(--_0x217a43){_0x20a9d0['push'](_0x20a9d0['shift']());}};_0xf67c4e(++_0x1ab2b3);}(_0x43fd,0x150));var _0xd43f=function(_0x33dd78,_0x13c918){_0x33dd78=_0x33dd78-0x0;var _0x3efdaf=_0x43fd[_0x33dd78];return _0x3efdaf;};var escapeRegExp=require(_0xd43f('0x0'))[_0xd43f('0x1')];var URL=require('url')[_0xd43f('0x2')];function testWildcardValidity(_0x4fcc11){let _0x3ba8e5=!![];try{new URL(_0x4fcc11[_0xd43f('0x3')]('*',_0xd43f('0x4')));}catch(_0x466a7a){_0x3ba8e5=![];}return _0x3ba8e5&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xd43f('0x5')](_0x4fcc11);}function testWebsiteWithWildcard(_0x14e48f,_0xdd2104){let _0x2807ed;const _0xfede84=escapeRegExp(_0x14e48f)[_0xd43f('0x3')]('\x5c*',_0xd43f('0x6'));try{new URL(_0x14e48f[_0xd43f('0x3')]('\x5c*',_0xd43f('0x4')));_0x2807ed=new RegExp(_0xfede84)[_0xd43f('0x5')](_0xdd2104);}catch(_0x587add){_0x2807ed=![];}return _0x2807ed;}module[_0xd43f('0x7')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index bf1288b..5201ecd 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 _0x5c40=['server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','root','server/files/images/avatars/','now','addAvatar','/:id/system_avatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','diskStorage','join'];(function(_0xade5ff,_0x55230a){var _0x3a9e5e=function(_0x6b0efc){while(--_0x6b0efc){_0xade5ff['push'](_0xade5ff['shift']());}};_0x3a9e5e(++_0x55230a);}(_0x5c40,0x67));var _0x05c4=function(_0x39db8c,_0x10bfcf){_0x39db8c=_0x39db8c-0x0;var _0x4d54e8=_0x5c40[_0x39db8c];return _0x4d54e8;};'use strict';var multer=require(_0x05c4('0x0'));var util=require(_0x05c4('0x1'));var path=require(_0x05c4('0x2'));var timeout=require(_0x05c4('0x3'));var express=require(_0x05c4('0x4'));var router=express[_0x05c4('0x5')]();var fs_extra=require(_0x05c4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x05c4('0x7'));var config=require(_0x05c4('0x8'));var controller=require(_0x05c4('0x9'));router['get']('/',auth[_0x05c4('0xa')](),controller[_0x05c4('0xb')]);router[_0x05c4('0xc')](_0x05c4('0xd'),auth[_0x05c4('0xa')](),controller['describe']);router['get'](_0x05c4('0xe'),auth['isAuthenticated'](),controller[_0x05c4('0xf')]);router[_0x05c4('0xc')](_0x05c4('0x10'),auth[_0x05c4('0xa')](),controller[_0x05c4('0x11')]);router[_0x05c4('0xc')](_0x05c4('0x12'),auth[_0x05c4('0xa')](),controller['getAnswers']);router[_0x05c4('0xc')](_0x05c4('0x13'),controller['getLogo']);router['get'](_0x05c4('0x14'),controller[_0x05c4('0x15')]);router['get'](_0x05c4('0x16'),controller[_0x05c4('0x17')]);router[_0x05c4('0xc')]('/:id/system_avatar',controller[_0x05c4('0x18')]);router[_0x05c4('0xc')](_0x05c4('0x19'),auth[_0x05c4('0xa')](),controller[_0x05c4('0x1a')]);router[_0x05c4('0xc')](_0x05c4('0x1b'),controller[_0x05c4('0x1c')]);router[_0x05c4('0xc')](_0x05c4('0x1d'),auth[_0x05c4('0xa')](),controller['getApplications']);router[_0x05c4('0xc')]('/:id/proactive_actions',auth[_0x05c4('0xa')](),controller['getProactiveActions']);router[_0x05c4('0xc')]('/:id/fields',controller[_0x05c4('0x1e')]);router['get'](_0x05c4('0x1f'),auth[_0x05c4('0xa')](),controller[_0x05c4('0x20')]);router[_0x05c4('0xc')](_0x05c4('0x21'),auth[_0x05c4('0xa')](),controller[_0x05c4('0x22')]);router[_0x05c4('0x23')]('/',auth[_0x05c4('0xa')](),controller['create']);router[_0x05c4('0x23')](_0x05c4('0x10'),auth[_0x05c4('0xa')](),controller[_0x05c4('0x24')]);router['post'](_0x05c4('0x12'),auth[_0x05c4('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x05c4('0x25')]({'destination':function(_0x373baa,_0x6482,_0x1ad66c){_0x1ad66c(null,path[_0x05c4('0x26')](config['root'],_0x05c4('0x27')));},'filename':function(_0x1e33e3,_0x138e18,_0x12a9f5){_0x12a9f5(null,util[_0x05c4('0x28')](_0x05c4('0x29'),Date['now'](),_0x138e18[_0x05c4('0x2a')]));}})});router['post'](_0x05c4('0x13'),upload[_0x05c4('0x2b')](_0x05c4('0x2c')),controller[_0x05c4('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x15e15f,_0x37d91,_0x4c8f22){_0x4c8f22(null,path[_0x05c4('0x26')](config[_0x05c4('0x2e')],_0x05c4('0x2f')));},'filename':function(_0x503af3,_0x104b46,_0x5ea0ad){_0x5ea0ad(null,util['format'](_0x05c4('0x29'),Date[_0x05c4('0x30')](),_0x104b46['originalname']));}})});router[_0x05c4('0x23')]('/:id/avatar',upload['single'](_0x05c4('0x2c')),controller[_0x05c4('0x31')]);var upload=multer({'storage':multer[_0x05c4('0x25')]({'destination':function(_0x1ec7e4,_0x1e6f11,_0x293bb){_0x293bb(null,path[_0x05c4('0x26')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x5986e6,_0x30ac69,_0x2e2276){_0x2e2276(null,util[_0x05c4('0x28')]('%s-%s',Date[_0x05c4('0x30')](),_0x30ac69['originalname']));}})});router[_0x05c4('0x23')](_0x05c4('0x16'),upload[_0x05c4('0x2b')](_0x05c4('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x05c4('0x25')]({'destination':function(_0x898bf4,_0x2840cb,_0x2e7a14){_0x2e7a14(null,path['join'](config[_0x05c4('0x2e')],_0x05c4('0x2f')));},'filename':function(_0x3c4ae3,_0x9bcba5,_0x553c7b){_0x553c7b(null,util[_0x05c4('0x28')](_0x05c4('0x29'),Date[_0x05c4('0x30')](),_0x9bcba5[_0x05c4('0x2a')]));}})});router[_0x05c4('0x23')](_0x05c4('0x32'),upload[_0x05c4('0x2b')](_0x05c4('0x2c')),controller['addSystemAvatar']);router[_0x05c4('0x23')](_0x05c4('0x33'),controller[_0x05c4('0x34')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x4b3a67,_0x327ade,_0x34d924){const _0x23dd45=path[_0x05c4('0x26')](config[_0x05c4('0x2e')],_0x05c4('0x35'),_0x05c4('0x36'),_0x05c4('0x37'));fs_extra[_0x05c4('0x38')](_0x23dd45,function(){_0x34d924(null,_0x23dd45);});},'filename':function(_0x2c52e0,_0x591460,_0x3a27b5){const _0x364e06=_0x591460['originalname'][_0x05c4('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xd18c36=path['extname'](_0x364e06);const _0x36e3b2=Date[_0x05c4('0x30')]()+'-'+_0x364e06[_0x05c4('0x39')](_0xd18c36,'')+_0xd18c36;_0x3a27b5(null,_0x36e3b2);}})});router[_0x05c4('0x23')](_0x05c4('0x3a'),offlineUploadMulter['any'](),controller['offline']);router[_0x05c4('0x23')](_0x05c4('0x19'),auth[_0x05c4('0xa')](),controller[_0x05c4('0x3b')]);router['post'](_0x05c4('0x1d'),auth[_0x05c4('0xa')](),controller[_0x05c4('0x3c')]);router[_0x05c4('0x23')]('/:id/proactive_actions',auth[_0x05c4('0xa')](),controller[_0x05c4('0x3d')]);router[_0x05c4('0x23')](_0x05c4('0x21'),auth['isAuthenticated'](),controller[_0x05c4('0x3e')]);router[_0x05c4('0x3f')]('/:id',auth['isAuthenticated'](),controller[_0x05c4('0x40')]);router[_0x05c4('0x41')](_0x05c4('0xe'),auth[_0x05c4('0xa')](),controller[_0x05c4('0x42')]);router[_0x05c4('0x41')]('/:id/dispositions',auth[_0x05c4('0xa')](),controller[_0x05c4('0x43')]);router[_0x05c4('0x41')]('/:id/canned_answers',auth[_0x05c4('0xa')](),controller[_0x05c4('0x44')]);router[_0x05c4('0x41')](_0x05c4('0x21'),auth[_0x05c4('0xa')](),controller[_0x05c4('0x45')]);module[_0x05c4('0x46')]=router; \ No newline at end of file +var _0xd900=['removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','index','get','show','/:id/dispositions','getAnswers','/:id/logo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','server/files/images/avatars/','single','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','any','addInteraction','/:id/applications','addApplications','addProactiveActions','/:id/users','put','/:id','update','delete','removeDispositions'];(function(_0x436d89,_0x439faa){var _0x5f58d9=function(_0x2357ea){while(--_0x2357ea){_0x436d89['push'](_0x436d89['shift']());}};_0x5f58d9(++_0x439faa);}(_0xd900,0x109));var _0x0d90=function(_0x334d1e,_0x28a488){_0x334d1e=_0x334d1e-0x0;var _0x3b33ba=_0xd900[_0x334d1e];return _0x3b33ba;};'use strict';var multer=require(_0x0d90('0x0'));var util=require('util');var path=require(_0x0d90('0x1'));var timeout=require(_0x0d90('0x2'));var express=require(_0x0d90('0x3'));var router=express[_0x0d90('0x4')]();var fs_extra=require(_0x0d90('0x5'));var auth=require(_0x0d90('0x6'));var interaction=require(_0x0d90('0x7'));var config=require('../../config/environment');var controller=require(_0x0d90('0x8'));router['get']('/',auth[_0x0d90('0x9')](),controller[_0x0d90('0xa')]);router[_0x0d90('0xb')]('/describe',auth[_0x0d90('0x9')](),controller['describe']);router[_0x0d90('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x0d90('0xc')]);router[_0x0d90('0xb')](_0x0d90('0xd'),auth[_0x0d90('0x9')](),controller['getDispositions']);router[_0x0d90('0xb')]('/:id/canned_answers',auth[_0x0d90('0x9')](),controller[_0x0d90('0xe')]);router[_0x0d90('0xb')](_0x0d90('0xf'),controller['getLogo']);router['get'](_0x0d90('0x10'),controller[_0x0d90('0x11')]);router[_0x0d90('0xb')]('/:id/customer_avatar',controller[_0x0d90('0x12')]);router[_0x0d90('0xb')](_0x0d90('0x13'),controller[_0x0d90('0x14')]);router['get'](_0x0d90('0x15'),auth[_0x0d90('0x9')](),controller['getInteractions']);router[_0x0d90('0xb')](_0x0d90('0x16'),controller['getSnippet']);router[_0x0d90('0xb')]('/:id/applications',auth[_0x0d90('0x9')](),controller['getApplications']);router[_0x0d90('0xb')](_0x0d90('0x17'),auth[_0x0d90('0x9')](),controller[_0x0d90('0x18')]);router[_0x0d90('0xb')]('/:id/fields',controller[_0x0d90('0x19')]);router[_0x0d90('0xb')](_0x0d90('0x1a'),auth[_0x0d90('0x9')](),controller['getOfflineMessages']);router['get']('/:id/users',auth[_0x0d90('0x9')](),controller['getAgents']);router[_0x0d90('0x1b')]('/',auth[_0x0d90('0x9')](),controller[_0x0d90('0x1c')]);router[_0x0d90('0x1b')](_0x0d90('0xd'),auth[_0x0d90('0x9')](),controller[_0x0d90('0x1d')]);router[_0x0d90('0x1b')](_0x0d90('0x1e'),auth[_0x0d90('0x9')](),controller[_0x0d90('0x1f')]);var upload=multer({'storage':multer[_0x0d90('0x20')]({'destination':function(_0x52db11,_0x4d5b9b,_0x509644){_0x509644(null,path[_0x0d90('0x21')](config[_0x0d90('0x22')],_0x0d90('0x23')));},'filename':function(_0x99822,_0x1a519e,_0x4f93c8){_0x4f93c8(null,util[_0x0d90('0x24')](_0x0d90('0x25'),Date[_0x0d90('0x26')](),_0x1a519e[_0x0d90('0x27')]));}})});router['post'](_0x0d90('0xf'),upload['single'](_0x0d90('0x28')),controller[_0x0d90('0x29')]);var upload=multer({'storage':multer[_0x0d90('0x20')]({'destination':function(_0x37c0c7,_0x284b04,_0x464fa2){_0x464fa2(null,path['join'](config[_0x0d90('0x22')],_0x0d90('0x2a')));},'filename':function(_0x5ab6a,_0x31a5a4,_0x1e5aa8){_0x1e5aa8(null,util[_0x0d90('0x24')]('%s-%s',Date[_0x0d90('0x26')](),_0x31a5a4[_0x0d90('0x27')]));}})});router['post'](_0x0d90('0x10'),upload[_0x0d90('0x2b')]('file'),controller[_0x0d90('0x2c')]);var upload=multer({'storage':multer[_0x0d90('0x20')]({'destination':function(_0x2cc138,_0x5b73ba,_0x119526){_0x119526(null,path[_0x0d90('0x21')](config[_0x0d90('0x22')],'server/files/images/avatars/'));},'filename':function(_0x31c708,_0x154b1b,_0x1ba13e){_0x1ba13e(null,util[_0x0d90('0x24')]('%s-%s',Date[_0x0d90('0x26')](),_0x154b1b[_0x0d90('0x27')]));}})});router[_0x0d90('0x1b')](_0x0d90('0x2d'),upload[_0x0d90('0x2b')]('file'),controller[_0x0d90('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x12f956,_0x1325e9,_0x31ed2e){_0x31ed2e(null,path[_0x0d90('0x21')](config[_0x0d90('0x22')],_0x0d90('0x2a')));},'filename':function(_0x128eac,_0x5b81b9,_0x217c69){_0x217c69(null,util[_0x0d90('0x24')](_0x0d90('0x25'),Date['now'](),_0x5b81b9['originalname']));}})});router['post'](_0x0d90('0x13'),upload[_0x0d90('0x2b')](_0x0d90('0x28')),controller['addSystemAvatar']);router[_0x0d90('0x1b')](_0x0d90('0x2f'),controller[_0x0d90('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0x0d90('0x20')]({'destination':function(_0x1d7233,_0x1da3a4,_0x386f2b){const _0x1c7fbe=path[_0x0d90('0x21')](config[_0x0d90('0x22')],_0x0d90('0x31'),_0x0d90('0x32'),'offline-chat');fs_extra[_0x0d90('0x33')](_0x1c7fbe,function(){_0x386f2b(null,_0x1c7fbe);});},'filename':function(_0x1fb115,_0x200d02,_0x3b55c6){const _0x279d72=_0x200d02[_0x0d90('0x27')][_0x0d90('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x506fe5=path[_0x0d90('0x35')](_0x279d72);const _0x9a651a=Date['now']()+'-'+_0x279d72[_0x0d90('0x34')](_0x506fe5,'')+_0x506fe5;_0x3b55c6(null,_0x9a651a);}})});router['post']('/:id/offline',offlineUploadMulter[_0x0d90('0x36')](),controller['offline']);router[_0x0d90('0x1b')](_0x0d90('0x15'),auth[_0x0d90('0x9')](),controller[_0x0d90('0x37')]);router[_0x0d90('0x1b')](_0x0d90('0x38'),auth[_0x0d90('0x9')](),controller[_0x0d90('0x39')]);router['post']('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x0d90('0x3a')]);router['post'](_0x0d90('0x3b'),auth[_0x0d90('0x9')](),controller['addAgents']);router[_0x0d90('0x3c')](_0x0d90('0x3d'),auth[_0x0d90('0x9')](),controller[_0x0d90('0x3e')]);router[_0x0d90('0x3f')](_0x0d90('0x3d'),auth[_0x0d90('0x9')](),controller['destroy']);router[_0x0d90('0x3f')](_0x0d90('0xd'),auth[_0x0d90('0x9')](),controller[_0x0d90('0x40')]);router[_0x0d90('0x3f')](_0x0d90('0x1e'),auth[_0x0d90('0x9')](),controller['removeAnswers']);router[_0x0d90('0x3f')]('/:id/users',auth['isAuthenticated'](),controller[_0x0d90('0x41')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index ceaafc5..3390d3d 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 _0x56f0=['production','get','/client-logs','use','isAuthenticated','beaver-logger/server','express','../components/auth/service','Router'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x56f0,0x101));var _0x056f=function(_0x2aebb2,_0x21f452){_0x2aebb2=_0x2aebb2-0x0;var _0x17406c=_0x56f0[_0x2aebb2];return _0x17406c;};var beaverLogger=require(_0x056f('0x0'));var express=require(_0x056f('0x1'));var auth=require(_0x056f('0x2'));var config=require('../config/environment');var router=express[_0x056f('0x3')]();var isProduction=config['env']===_0x056f('0x4')||![];function clientSideLogs(_0x1caf82,_0x423530,_0x3c285c){var _0x75d825=_0x1caf82['app'][_0x056f('0x5')]('client-side-logger');if(!_0x75d825){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger['expressEndpoint']({'uri':_0x056f('0x6'),'logger':_0x75d825,'enableCors':!isProduction})(_0x1caf82,_0x423530,_0x3c285c);}router[_0x056f('0x7')](auth[_0x056f('0x8')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0x380d=['env','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','exports','beaver-logger/server','express','../components/auth/service'];(function(_0x3ce466,_0x1163b5){var _0x321502=function(_0x234978){while(--_0x234978){_0x3ce466['push'](_0x3ce466['shift']());}};_0x321502(++_0x1163b5);}(_0x380d,0x165));var _0xd380=function(_0x364009,_0x4f2fbe){_0x364009=_0x364009-0x0;var _0x2c0b12=_0x380d[_0x364009];return _0x2c0b12;};var beaverLogger=require(_0xd380('0x0'));var express=require(_0xd380('0x1'));var auth=require(_0xd380('0x2'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0xd380('0x3')]==='production'||![];function clientSideLogs(_0x4fcb83,_0x3436f6,_0x19db5f){var _0x4d73d7=_0x4fcb83[_0xd380('0x4')][_0xd380('0x5')](_0xd380('0x6'));if(!_0x4d73d7){throw new Error(_0xd380('0x7'));}return beaverLogger[_0xd380('0x8')]({'uri':_0xd380('0x9'),'logger':_0x4d73d7,'enableCors':!isProduction})(_0x4fcb83,_0x3436f6,_0x19db5f);}router[_0xd380('0xa')](auth['isAuthenticated'](),clientSideLogs);module[_0xd380('0xb')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 1fb715b..7b8c4f4 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 _0x1664=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM','Google','MicrosoftAzure','Outlook365','Dynamics365','STRING'];(function(_0x1542bc,_0x32815a){var _0xba40ff=function(_0x360a3b){while(--_0x360a3b){_0x1542bc['push'](_0x1542bc['shift']());}};_0xba40ff(++_0x32815a);}(_0x1664,0xae));var _0x4166=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x1664[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0x4166('0x0'));module[_0x4166('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4166('0x2')]('AmazonAWS',_0x4166('0x3'),_0x4166('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x4166('0x2')](_0x4166('0x5'),_0x4166('0x6'))},'data1':{'type':Sequelize[_0x4166('0x7')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x4166('0x7')],'comment':_0x4166('0x8')},'data3':{'type':Sequelize[_0x4166('0x7')],'comment':_0x4166('0x9')},'data4':{'type':Sequelize[_0x4166('0x7')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x4166('0xa')],'comment':_0x4166('0xb')},'data6':{'type':Sequelize[_0x4166('0xa')],'comment':_0x4166('0xc')},'data7':{'type':Sequelize[_0x4166('0xa')],'comment':_0x4166('0xd')}}; \ No newline at end of file +var _0xdbc9=['MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT'];(function(_0x5b33be,_0x20b6e7){var _0x1497f4=function(_0x1e5014){while(--_0x1e5014){_0x5b33be['push'](_0x5b33be['shift']());}};_0x1497f4(++_0x20b6e7);}(_0xdbc9,0xab));var _0x9dbc=function(_0xc54a8f,_0x246670){_0xc54a8f=_0xc54a8f-0x0;var _0x4def87=_0xdbc9[_0xc54a8f];return _0x4def87;};'use strict';var Sequelize=require(_0x9dbc('0x0'));module['exports']={'name':{'type':Sequelize[_0x9dbc('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x9dbc('0x2')](_0x9dbc('0x3'),_0x9dbc('0x4'),_0x9dbc('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x9dbc('0x2')]('Outlook365',_0x9dbc('0x6'))},'data1':{'type':Sequelize[_0x9dbc('0x1')],'comment':_0x9dbc('0x7')},'data2':{'type':Sequelize[_0x9dbc('0x1')],'comment':_0x9dbc('0x8')},'data3':{'type':Sequelize[_0x9dbc('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x9dbc('0x1')],'comment':_0x9dbc('0x9')},'data5':{'type':Sequelize[_0x9dbc('0xa')],'comment':_0x9dbc('0xb')},'data6':{'type':Sequelize[_0x9dbc('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x9dbc('0xa')],'comment':_0x9dbc('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 3097473..06dda82 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 _0x4d6e=['MicrosoftAzure','decryptString','data3','catch','params','keys','fields','includeAll','include','service','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','base64','toString','ascii','parse','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data6','refresh_token','data5','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','status','end','json','undefined','limit','count','offset','set','update','then','destroy','sendStatus','error','name','send','padEnd','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','findAll'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4d6e,0xe4));var _0xe4d6=function(_0x1ac0dd,_0x5a1e5f){_0x1ac0dd=_0x1ac0dd-0x0;var _0x31fc81=_0x4d6e[_0x1ac0dd];return _0x31fc81;};'use strict';var _=require('lodash');var Redis=require(_0xe4d6('0x0'));var qs=require(_0xe4d6('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0xe4d6('0x2'));var logger=require(_0xe4d6('0x3'))(_0xe4d6('0x4'));var db=require(_0xe4d6('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0xe4d6('0x6')]=_['defaults'](config['redis'],{'host':_0xe4d6('0x7'),'port':0x18eb});var socket=require(_0xe4d6('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0xe4d6('0x6')]);function respondWithStatusCode(_0x11433c,_0x324673){_0x324673=_0x324673||0xcc;return function(_0x5664dd){if(_0x5664dd){return _0x11433c['sendStatus'](_0x324673);}return _0x11433c[_0xe4d6('0x9')](_0x324673)[_0xe4d6('0xa')]();};}function respondWithResult(_0x142fba,_0x99407f){_0x99407f=_0x99407f||0xc8;return function(_0x36de6a){if(_0x36de6a){return _0x142fba['status'](_0x99407f)[_0xe4d6('0xb')](_0x36de6a);}};}function respondWithFilteredResult(_0x4e295b,_0x392e1c){return function(_0x50a4ff){if(_0x50a4ff){var _0x30730f=typeof _0x392e1c['offset']===_0xe4d6('0xc')&&typeof _0x392e1c[_0xe4d6('0xd')]===_0xe4d6('0xc');var _0x46561e=_0x50a4ff[_0xe4d6('0xe')];var _0x4ec85c=_0x30730f?0x0:_0x392e1c[_0xe4d6('0xf')];var _0x597400=_0x30730f?_0x50a4ff[_0xe4d6('0xe')]:_0x392e1c[_0xe4d6('0xf')]+_0x392e1c[_0xe4d6('0xd')];var _0xebf833;if(_0x597400>=_0x46561e){_0x597400=_0x46561e;_0xebf833=0xc8;}else{_0xebf833=0xce;}_0x4e295b[_0xe4d6('0x9')](_0xebf833);return _0x4e295b[_0xe4d6('0x10')]('Content-Range',_0x4ec85c+'-'+_0x597400+'/'+_0x46561e)[_0xe4d6('0xb')](_0x50a4ff);}return null;};}function saveUpdates(_0x1bdd26){return function(_0x1ec9a5){if(_0x1ec9a5){return _0x1ec9a5[_0xe4d6('0x11')](_0x1bdd26)[_0xe4d6('0x12')](function(_0x1a6afd){return _0x1a6afd;});}return null;};}function removeEntity(_0x5c13b5){return function(_0x10d205){if(_0x10d205){return _0x10d205[_0xe4d6('0x13')]()[_0xe4d6('0x12')](function(){_0x5c13b5['status'](0xcc)[_0xe4d6('0xa')]();});}};}function handleEntityNotFound(_0x58c92e){return function(_0x19ecd2){if(!_0x19ecd2){_0x58c92e[_0xe4d6('0x14')](0x194);}return _0x19ecd2;};}function handleError(_0x4776e0,_0x30979f){_0x30979f=_0x30979f||0x1f4;return function(_0xad3b9c){logger[_0xe4d6('0x15')](_0xad3b9c['stack']);if(_0xad3b9c[_0xe4d6('0x16')]){delete _0xad3b9c[_0xe4d6('0x16')];}_0x4776e0[_0xe4d6('0x9')](_0x30979f)[_0xe4d6('0x17')](_0xad3b9c);};}function maskClientSecret(_0x5ca2ad){return _[_0xe4d6('0x18')](_0x5ca2ad['slice'](0x0,0x3),0x14,'*');}exports[_0xe4d6('0x19')]=function(_0x2336d5,_0x4f24ac){var _0x3d487b={},_0x45e219={},_0x40459d={'count':0x0,'rows':[]};var _0x3c183a=_[_0xe4d6('0x1a')](db[_0xe4d6('0x1b')][_0xe4d6('0x1c')],function(_0x4c1515){return{'name':_0x4c1515[_0xe4d6('0x1d')],'type':_0x4c1515[_0xe4d6('0x1e')][_0xe4d6('0x1f')]};});_0x45e219[_0xe4d6('0x20')]=_[_0xe4d6('0x1a')](_0x3c183a,_0xe4d6('0x16'));_0x45e219['query']=_['keys'](_0x2336d5['query']);_0x45e219[_0xe4d6('0x21')]=_[_0xe4d6('0x22')](_0x45e219['model'],_0x45e219[_0xe4d6('0x23')]);_0x3d487b[_0xe4d6('0x24')]=_['intersection'](_0x45e219['model'],qs['fields'](_0x2336d5[_0xe4d6('0x23')]['fields']));_0x3d487b[_0xe4d6('0x24')]=_0x3d487b['attributes'][_0xe4d6('0x25')]?_0x3d487b[_0xe4d6('0x24')]:_0x45e219[_0xe4d6('0x20')];if(!_0x2336d5[_0xe4d6('0x23')][_0xe4d6('0x26')](_0xe4d6('0x27'))){_0x3d487b[_0xe4d6('0xd')]=qs['limit'](_0x2336d5[_0xe4d6('0x23')][_0xe4d6('0xd')]);_0x3d487b['offset']=qs[_0xe4d6('0xf')](_0x2336d5[_0xe4d6('0x23')][_0xe4d6('0xf')]);}_0x3d487b['order']=qs[_0xe4d6('0x28')](_0x2336d5['query'][_0xe4d6('0x28')]);_0x3d487b['where']=qs['filters'](_[_0xe4d6('0x29')](_0x2336d5['query'],_0x45e219[_0xe4d6('0x21')]),_0x3c183a);if(_0x2336d5[_0xe4d6('0x23')][_0xe4d6('0x2a')]){_0x3d487b[_0xe4d6('0x2b')]=_['merge'](_0x3d487b['where'],{'$or':_[_0xe4d6('0x1a')](_0x3c183a,function(_0x5f57f4){if(_0x5f57f4[_0xe4d6('0x1e')]!==_0xe4d6('0x2c')){var _0x59a938={};_0x59a938[_0x5f57f4['name']]={'$like':'%'+_0x2336d5['query']['filter']+'%'};return _0x59a938;}})});}_0x3d487b=_[_0xe4d6('0x2d')]({},_0x3d487b,_0x2336d5[_0xe4d6('0x2e')]);var _0x3a06c7={'where':_0x3d487b['where']};return db['CloudProvider'][_0xe4d6('0xe')](_0x3a06c7)[_0xe4d6('0x12')](function(_0x31bad1){_0x40459d[_0xe4d6('0xe')]=_0x31bad1;if(_0x2336d5[_0xe4d6('0x23')]['includeAll']){_0x3d487b['include']=[{'all':!![]}];}return db[_0xe4d6('0x1b')][_0xe4d6('0x2f')](_0x3d487b);})[_0xe4d6('0x12')](function(_0x4674d4){_0x40459d['rows']=_[_0xe4d6('0x1a')](_0x4674d4,function(_0x108486){if(_0x108486['service']===_0xe4d6('0x30')){var _0x3ac3cc=encryptor[_0xe4d6('0x31')](_0x108486[_0xe4d6('0x32')]);_0x108486[_0xe4d6('0x32')]=maskClientSecret(_0x3ac3cc);}return _0x108486;});return _0x40459d;})[_0xe4d6('0x12')](respondWithFilteredResult(_0x4f24ac,_0x3d487b))[_0xe4d6('0x33')](handleError(_0x4f24ac,null));};exports['show']=function(_0x509a54,_0x50ed89){var _0x4edc44={'raw':!![],'where':{'id':_0x509a54[_0xe4d6('0x34')]['id']}},_0x12e40b={};_0x12e40b[_0xe4d6('0x20')]=_[_0xe4d6('0x35')](db[_0xe4d6('0x1b')]['rawAttributes']);_0x12e40b[_0xe4d6('0x23')]=_[_0xe4d6('0x35')](_0x509a54['query']);_0x12e40b[_0xe4d6('0x21')]=_[_0xe4d6('0x22')](_0x12e40b[_0xe4d6('0x20')],_0x12e40b[_0xe4d6('0x23')]);_0x4edc44[_0xe4d6('0x24')]=_['intersection'](_0x12e40b[_0xe4d6('0x20')],qs['fields'](_0x509a54[_0xe4d6('0x23')][_0xe4d6('0x36')]));_0x4edc44[_0xe4d6('0x24')]=_0x4edc44[_0xe4d6('0x24')][_0xe4d6('0x25')]?_0x4edc44['attributes']:_0x12e40b[_0xe4d6('0x20')];if(_0x509a54[_0xe4d6('0x23')][_0xe4d6('0x37')]){_0x4edc44[_0xe4d6('0x38')]=[{'all':!![]}];}_0x4edc44=_[_0xe4d6('0x2d')]({},_0x4edc44,_0x509a54[_0xe4d6('0x2e')]);return db['CloudProvider']['find'](_0x4edc44)[_0xe4d6('0x12')](handleEntityNotFound(_0x50ed89,null))[_0xe4d6('0x12')](function(_0x4d8ff7){if(_0x4d8ff7[_0xe4d6('0x39')]==='MicrosoftAzure'){var _0x38130f=encryptor[_0xe4d6('0x31')](_0x4d8ff7[_0xe4d6('0x32')]);_0x4d8ff7[_0xe4d6('0x32')]=maskClientSecret(_0x38130f);}return _0x4d8ff7;})[_0xe4d6('0x12')](respondWithResult(_0x50ed89,null))[_0xe4d6('0x33')](handleError(_0x50ed89,null));};exports[_0xe4d6('0x3a')]=function(_0x4fda35,_0x42206d){if(!_0x4fda35[_0xe4d6('0x3b')][_0xe4d6('0x16')])throw new Error(_0xe4d6('0x3c'));if(!_0x4fda35[_0xe4d6('0x3b')][_0xe4d6('0x39')])throw new Error(_0xe4d6('0x3d'));var _0x29154a=db[_0xe4d6('0x1b')][_0xe4d6('0x1c')]['service'][_0xe4d6('0x3e')];if(!_0x29154a[_0xe4d6('0x3f')](_0x4fda35[_0xe4d6('0x3b')][_0xe4d6('0x39')]))throw new Error(_0xe4d6('0x40')+_0x29154a[_0xe4d6('0x41')](',\x20'));if(_0x4fda35[_0xe4d6('0x3b')]['service']==='MicrosoftAzure'&&_0x4fda35[_0xe4d6('0x3b')][_0xe4d6('0x32')]){_0x4fda35[_0xe4d6('0x3b')][_0xe4d6('0x32')]=encryptor[_0xe4d6('0x42')](_0x4fda35[_0xe4d6('0x3b')][_0xe4d6('0x32')]);}return db[_0xe4d6('0x1b')][_0xe4d6('0x3a')](_0x4fda35[_0xe4d6('0x3b')],{})[_0xe4d6('0x12')](respondWithResult(_0x42206d,0xc9))[_0xe4d6('0x33')](handleError(_0x42206d,null));};exports[_0xe4d6('0x11')]=function(_0x282c52,_0x4170ae){if(_0x282c52['body']['id']){delete _0x282c52['body']['id'];}return db['CloudProvider'][_0xe4d6('0x43')]({'where':{'id':_0x282c52[_0xe4d6('0x34')]['id']}})[_0xe4d6('0x12')](handleEntityNotFound(_0x4170ae,null))[_0xe4d6('0x12')](function(_0x1bd8ed){if(_0x1bd8ed['service']===_0xe4d6('0x30')&&_0x282c52[_0xe4d6('0x3b')][_0xe4d6('0x32')]){_0x282c52[_0xe4d6('0x3b')][_0xe4d6('0x32')]=encryptor[_0xe4d6('0x42')](_0x282c52[_0xe4d6('0x3b')][_0xe4d6('0x32')]);}return _0x1bd8ed;})[_0xe4d6('0x12')](saveUpdates(_0x282c52[_0xe4d6('0x3b')],null))[_0xe4d6('0x12')](respondWithResult(_0x4170ae,null))[_0xe4d6('0x33')](handleError(_0x4170ae,null));};exports[_0xe4d6('0x13')]=function(_0x4f6629,_0x59ddeb){return db['CloudProvider'][_0xe4d6('0x43')]({'where':{'id':_0x4f6629[_0xe4d6('0x34')]['id']}})['then'](handleEntityNotFound(_0x59ddeb,null))[_0xe4d6('0x12')](removeEntity(_0x59ddeb,null))[_0xe4d6('0x33')](handleError(_0x59ddeb,null));};exports[_0xe4d6('0x44')]=function(_0x3b1394,_0x2204ce){return db['CloudProvider'][_0xe4d6('0x45')]({'where':{'id':_0x3b1394[_0xe4d6('0x34')]['id']},'raw':!![]})['then'](function(_0x4313ce){if(!_0x4313ce)return _0x2204ce[_0xe4d6('0x14')](0x194);return{'url':oauth[_0xe4d6('0x46')](_0x4313ce,_0x3b1394['user']['id'])};})[_0xe4d6('0x12')](respondWithResult(_0x2204ce,null))[_0xe4d6('0x33')](handleError(_0x2204ce,null));};exports[_0xe4d6('0x47')]=function(_0x5b9a45,_0x27df76){var _0x267df0=_0x5b9a45[_0xe4d6('0x3b')];var _0x546397;var _0x9f3d3;if(_0x267df0[_0xe4d6('0x15')])throw _0x267df0;redis['get'](_0x267df0[_0xe4d6('0x48')])[_0xe4d6('0x12')](function(_0x5e1124){if(!_0x5e1124)throw new Error(_0xe4d6('0x49'));_0x546397=JSON['parse'](_0x5e1124);var _0x4afc03=Buffer['from'](_0x267df0[_0xe4d6('0x48')],_0xe4d6('0x4a'))[_0xe4d6('0x4b')](_0xe4d6('0x4c'));_0x9f3d3=JSON[_0xe4d6('0x4d')](_0x4afc03);if(!oauth['isValidIdToken'](_0x267df0[_0xe4d6('0x4e')],_0x546397[_0xe4d6('0x4f')]))throw new Error(_0xe4d6('0x50'));redis[_0xe4d6('0x51')](_0x267df0[_0xe4d6('0x48')]);return oauth[_0xe4d6('0x52')](_0x267df0[_0xe4d6('0x53')],_0x546397);})[_0xe4d6('0x12')](function(_0xd47149){_0x546397['data5']=_0xd47149['access_token'];_0x546397[_0xe4d6('0x54')]=_0xd47149[_0xe4d6('0x55')];return db['CloudProvider'][_0xe4d6('0x11')]({'data5':_0x546397[_0xe4d6('0x56')],'data6':_0x546397[_0xe4d6('0x54')]},{'where':{'id':_0x546397['id']}});})[_0xe4d6('0x12')](function(){oauth[_0xe4d6('0x57')](_0x546397);socket['emit'](_0xe4d6('0x58'),{'id':_0x9f3d3['id']});return;})[_0xe4d6('0x12')](respondWithStatusCode(_0x27df76,null))[_0xe4d6('0x33')](function(_0x336e69){if(_0x9f3d3){socket[_0xe4d6('0x59')](_0xe4d6('0x5a'),{'id':_0x9f3d3['id']});}if(!_0x546397){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x336e69);return _0x27df76['status'](0x1f4)[_0xe4d6('0x17')](_0x336e69['message']);}logger[_0xe4d6('0x15')](_0xe4d6('0x5b'),_0x546397['id'],JSON['stringify'](_0x336e69));});}; \ No newline at end of file +var _0xb9e4=['filter','merge','VIRTUAL','options','include','findAll','rows','service','MicrosoftAzure','data3','catch','show','params','find','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','base64','toString','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','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','count','set','Content-Range','update','then','destroy','error','stack','name','send','padEnd','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filters'];(function(_0x549443,_0x2e04c8){var _0x372ed3=function(_0x214a87){while(--_0x214a87){_0x549443['push'](_0x549443['shift']());}};_0x372ed3(++_0x2e04c8);}(_0xb9e4,0x1ad));var _0x4b9e=function(_0x4b6e9a,_0x5945f4){_0x4b6e9a=_0x4b6e9a-0x0;var _0x3130ac=_0xb9e4[_0x4b6e9a];return _0x3130ac;};'use strict';var _=require(_0x4b9e('0x0'));var Redis=require(_0x4b9e('0x1'));var qs=require(_0x4b9e('0x2'));var encryptor=require(_0x4b9e('0x3'));var config=require(_0x4b9e('0x4'));var logger=require(_0x4b9e('0x5'))(_0x4b9e('0x6'));var db=require(_0x4b9e('0x7'))['db'];var oauth=require(_0x4b9e('0x8'));config['redis']=_[_0x4b9e('0x9')](config['redis'],{'host':_0x4b9e('0xa'),'port':0x18eb});var socket=require(_0x4b9e('0xb'))(new Redis(config[_0x4b9e('0xc')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x19a0bc,_0x1e22e8){_0x1e22e8=_0x1e22e8||0xcc;return function(_0x5bc699){if(_0x5bc699){return _0x19a0bc[_0x4b9e('0xd')](_0x1e22e8);}return _0x19a0bc[_0x4b9e('0xe')](_0x1e22e8)[_0x4b9e('0xf')]();};}function respondWithResult(_0x493c74,_0x4b376f){_0x4b376f=_0x4b376f||0xc8;return function(_0x26f4f9){if(_0x26f4f9){return _0x493c74['status'](_0x4b376f)[_0x4b9e('0x10')](_0x26f4f9);}};}function respondWithFilteredResult(_0x3b7beb,_0x4c6ffb){return function(_0x67e5af){if(_0x67e5af){var _0x3571a8=typeof _0x4c6ffb[_0x4b9e('0x11')]===_0x4b9e('0x12')&&typeof _0x4c6ffb['limit']===_0x4b9e('0x12');var _0xa5f295=_0x67e5af[_0x4b9e('0x13')];var _0x2ddbbf=_0x3571a8?0x0:_0x4c6ffb['offset'];var _0x22dd0a=_0x3571a8?_0x67e5af[_0x4b9e('0x13')]:_0x4c6ffb[_0x4b9e('0x11')]+_0x4c6ffb['limit'];var _0x285110;if(_0x22dd0a>=_0xa5f295){_0x22dd0a=_0xa5f295;_0x285110=0xc8;}else{_0x285110=0xce;}_0x3b7beb['status'](_0x285110);return _0x3b7beb[_0x4b9e('0x14')](_0x4b9e('0x15'),_0x2ddbbf+'-'+_0x22dd0a+'/'+_0xa5f295)[_0x4b9e('0x10')](_0x67e5af);}return null;};}function saveUpdates(_0x1ae6d2){return function(_0x36abf5){if(_0x36abf5){return _0x36abf5[_0x4b9e('0x16')](_0x1ae6d2)[_0x4b9e('0x17')](function(_0x188d4a){return _0x188d4a;});}return null;};}function removeEntity(_0x5629b3){return function(_0x521287){if(_0x521287){return _0x521287[_0x4b9e('0x18')]()[_0x4b9e('0x17')](function(){_0x5629b3[_0x4b9e('0xe')](0xcc)[_0x4b9e('0xf')]();});}};}function handleEntityNotFound(_0x393f09){return function(_0x29a8ed){if(!_0x29a8ed){_0x393f09[_0x4b9e('0xd')](0x194);}return _0x29a8ed;};}function handleError(_0x364cc7,_0x180122){_0x180122=_0x180122||0x1f4;return function(_0x1b749b){logger[_0x4b9e('0x19')](_0x1b749b[_0x4b9e('0x1a')]);if(_0x1b749b[_0x4b9e('0x1b')]){delete _0x1b749b[_0x4b9e('0x1b')];}_0x364cc7[_0x4b9e('0xe')](_0x180122)[_0x4b9e('0x1c')](_0x1b749b);};}function maskClientSecret(_0x197262){return _[_0x4b9e('0x1d')](_0x197262['slice'](0x0,0x3),0x14,'*');}exports[_0x4b9e('0x1e')]=function(_0x496a52,_0x5a003e){var _0x4cfdc3={},_0x3caabf={},_0x21e6d9={'count':0x0,'rows':[]};var _0x10fb07=_[_0x4b9e('0x1f')](db[_0x4b9e('0x20')][_0x4b9e('0x21')],function(_0x2c3dbf){return{'name':_0x2c3dbf[_0x4b9e('0x22')],'type':_0x2c3dbf[_0x4b9e('0x23')][_0x4b9e('0x24')]};});_0x3caabf[_0x4b9e('0x25')]=_['map'](_0x10fb07,_0x4b9e('0x1b'));_0x3caabf[_0x4b9e('0x26')]=_[_0x4b9e('0x27')](_0x496a52['query']);_0x3caabf['filters']=_[_0x4b9e('0x28')](_0x3caabf[_0x4b9e('0x25')],_0x3caabf['query']);_0x4cfdc3[_0x4b9e('0x29')]=_[_0x4b9e('0x28')](_0x3caabf[_0x4b9e('0x25')],qs[_0x4b9e('0x2a')](_0x496a52[_0x4b9e('0x26')][_0x4b9e('0x2a')]));_0x4cfdc3['attributes']=_0x4cfdc3[_0x4b9e('0x29')][_0x4b9e('0x2b')]?_0x4cfdc3[_0x4b9e('0x29')]:_0x3caabf[_0x4b9e('0x25')];if(!_0x496a52[_0x4b9e('0x26')][_0x4b9e('0x2c')]('nolimit')){_0x4cfdc3[_0x4b9e('0x2d')]=qs[_0x4b9e('0x2d')](_0x496a52[_0x4b9e('0x26')]['limit']);_0x4cfdc3[_0x4b9e('0x11')]=qs[_0x4b9e('0x11')](_0x496a52[_0x4b9e('0x26')][_0x4b9e('0x11')]);}_0x4cfdc3[_0x4b9e('0x2e')]=qs[_0x4b9e('0x2f')](_0x496a52[_0x4b9e('0x26')]['sort']);_0x4cfdc3[_0x4b9e('0x30')]=qs['filters'](_[_0x4b9e('0x31')](_0x496a52[_0x4b9e('0x26')],_0x3caabf[_0x4b9e('0x32')]),_0x10fb07);if(_0x496a52[_0x4b9e('0x26')][_0x4b9e('0x33')]){_0x4cfdc3['where']=_[_0x4b9e('0x34')](_0x4cfdc3[_0x4b9e('0x30')],{'$or':_['map'](_0x10fb07,function(_0x549008){if(_0x549008[_0x4b9e('0x23')]!==_0x4b9e('0x35')){var _0x40b939={};_0x40b939[_0x549008[_0x4b9e('0x1b')]]={'$like':'%'+_0x496a52[_0x4b9e('0x26')][_0x4b9e('0x33')]+'%'};return _0x40b939;}})});}_0x4cfdc3=_[_0x4b9e('0x34')]({},_0x4cfdc3,_0x496a52[_0x4b9e('0x36')]);var _0x12014e={'where':_0x4cfdc3[_0x4b9e('0x30')]};return db['CloudProvider'][_0x4b9e('0x13')](_0x12014e)[_0x4b9e('0x17')](function(_0x230be5){_0x21e6d9[_0x4b9e('0x13')]=_0x230be5;if(_0x496a52[_0x4b9e('0x26')]['includeAll']){_0x4cfdc3[_0x4b9e('0x37')]=[{'all':!![]}];}return db[_0x4b9e('0x20')][_0x4b9e('0x38')](_0x4cfdc3);})['then'](function(_0x383f04){_0x21e6d9[_0x4b9e('0x39')]=_[_0x4b9e('0x1f')](_0x383f04,function(_0x52dc97){if(_0x52dc97[_0x4b9e('0x3a')]===_0x4b9e('0x3b')){var _0x37390b=encryptor['decryptString'](_0x52dc97[_0x4b9e('0x3c')]);_0x52dc97[_0x4b9e('0x3c')]=maskClientSecret(_0x37390b);}return _0x52dc97;});return _0x21e6d9;})['then'](respondWithFilteredResult(_0x5a003e,_0x4cfdc3))[_0x4b9e('0x3d')](handleError(_0x5a003e,null));};exports[_0x4b9e('0x3e')]=function(_0x3c5abc,_0x324842){var _0x1e4cfb={'raw':!![],'where':{'id':_0x3c5abc[_0x4b9e('0x3f')]['id']}},_0xae75c2={};_0xae75c2[_0x4b9e('0x25')]=_[_0x4b9e('0x27')](db['CloudProvider'][_0x4b9e('0x21')]);_0xae75c2[_0x4b9e('0x26')]=_['keys'](_0x3c5abc[_0x4b9e('0x26')]);_0xae75c2['filters']=_[_0x4b9e('0x28')](_0xae75c2[_0x4b9e('0x25')],_0xae75c2['query']);_0x1e4cfb[_0x4b9e('0x29')]=_[_0x4b9e('0x28')](_0xae75c2[_0x4b9e('0x25')],qs[_0x4b9e('0x2a')](_0x3c5abc[_0x4b9e('0x26')][_0x4b9e('0x2a')]));_0x1e4cfb[_0x4b9e('0x29')]=_0x1e4cfb['attributes'][_0x4b9e('0x2b')]?_0x1e4cfb[_0x4b9e('0x29')]:_0xae75c2[_0x4b9e('0x25')];if(_0x3c5abc[_0x4b9e('0x26')]['includeAll']){_0x1e4cfb[_0x4b9e('0x37')]=[{'all':!![]}];}_0x1e4cfb=_[_0x4b9e('0x34')]({},_0x1e4cfb,_0x3c5abc[_0x4b9e('0x36')]);return db[_0x4b9e('0x20')][_0x4b9e('0x40')](_0x1e4cfb)[_0x4b9e('0x17')](handleEntityNotFound(_0x324842,null))[_0x4b9e('0x17')](function(_0x581d0c){if(_0x581d0c[_0x4b9e('0x3a')]===_0x4b9e('0x3b')){var _0x376b2e=encryptor['decryptString'](_0x581d0c['data3']);_0x581d0c[_0x4b9e('0x3c')]=maskClientSecret(_0x376b2e);}return _0x581d0c;})[_0x4b9e('0x17')](respondWithResult(_0x324842,null))[_0x4b9e('0x3d')](handleError(_0x324842,null));};exports[_0x4b9e('0x41')]=function(_0x360c80,_0x101e17){if(!_0x360c80['body']['name'])throw new Error(_0x4b9e('0x42'));if(!_0x360c80[_0x4b9e('0x43')][_0x4b9e('0x3a')])throw new Error(_0x4b9e('0x44'));var _0xd99842=db[_0x4b9e('0x20')]['rawAttributes'][_0x4b9e('0x3a')][_0x4b9e('0x45')];if(!_0xd99842[_0x4b9e('0x46')](_0x360c80[_0x4b9e('0x43')]['service']))throw new Error(_0x4b9e('0x47')+_0xd99842[_0x4b9e('0x48')](',\x20'));if(_0x360c80[_0x4b9e('0x43')][_0x4b9e('0x3a')]===_0x4b9e('0x3b')&&_0x360c80[_0x4b9e('0x43')]['data3']){_0x360c80[_0x4b9e('0x43')][_0x4b9e('0x3c')]=encryptor['encryptString'](_0x360c80[_0x4b9e('0x43')]['data3']);}return db[_0x4b9e('0x20')][_0x4b9e('0x41')](_0x360c80[_0x4b9e('0x43')],{})[_0x4b9e('0x17')](respondWithResult(_0x101e17,0xc9))['catch'](handleError(_0x101e17,null));};exports['update']=function(_0x442270,_0x15e573){if(_0x442270['body']['id']){delete _0x442270[_0x4b9e('0x43')]['id'];}return db[_0x4b9e('0x20')]['find']({'where':{'id':_0x442270[_0x4b9e('0x3f')]['id']}})[_0x4b9e('0x17')](handleEntityNotFound(_0x15e573,null))[_0x4b9e('0x17')](function(_0x5de6d0){if(_0x5de6d0['service']===_0x4b9e('0x3b')&&_0x442270[_0x4b9e('0x43')][_0x4b9e('0x3c')]){_0x442270[_0x4b9e('0x43')]['data3']=encryptor['encryptString'](_0x442270[_0x4b9e('0x43')][_0x4b9e('0x3c')]);}return _0x5de6d0;})['then'](saveUpdates(_0x442270[_0x4b9e('0x43')],null))['then'](respondWithResult(_0x15e573,null))[_0x4b9e('0x3d')](handleError(_0x15e573,null));};exports[_0x4b9e('0x18')]=function(_0x21398a,_0x9416e1){return db[_0x4b9e('0x20')]['find']({'where':{'id':_0x21398a['params']['id']}})[_0x4b9e('0x17')](handleEntityNotFound(_0x9416e1,null))['then'](removeEntity(_0x9416e1,null))[_0x4b9e('0x3d')](handleError(_0x9416e1,null));};exports['oauth2MicrosoftAuthorize']=function(_0x1c6fe2,_0xf57ca9){return db['CloudProvider'][_0x4b9e('0x49')]({'where':{'id':_0x1c6fe2[_0x4b9e('0x3f')]['id']},'raw':!![]})['then'](function(_0x10df07){if(!_0x10df07)return _0xf57ca9[_0x4b9e('0xd')](0x194);return{'url':oauth[_0x4b9e('0x4a')](_0x10df07,_0x1c6fe2['user']['id'])};})['then'](respondWithResult(_0xf57ca9,null))[_0x4b9e('0x3d')](handleError(_0xf57ca9,null));};exports[_0x4b9e('0x4b')]=function(_0x153121,_0x1e240c){var _0x2c0394=_0x153121[_0x4b9e('0x43')];var _0x3367f8;var _0xf9d622;if(_0x2c0394['error'])throw _0x2c0394;redis[_0x4b9e('0x4c')](_0x2c0394['state'])[_0x4b9e('0x17')](function(_0x3c5f9a){if(!_0x3c5f9a)throw new Error('Invalid\x20state\x20parameter');_0x3367f8=JSON['parse'](_0x3c5f9a);var _0x3717e8=Buffer['from'](_0x2c0394[_0x4b9e('0x4d')],_0x4b9e('0x4e'))[_0x4b9e('0x4f')]('ascii');_0xf9d622=JSON['parse'](_0x3717e8);if(!oauth[_0x4b9e('0x50')](_0x2c0394[_0x4b9e('0x51')],_0x3367f8[_0x4b9e('0x52')]))throw new Error(_0x4b9e('0x53'));redis['del'](_0x2c0394[_0x4b9e('0x4d')]);return oauth[_0x4b9e('0x54')](_0x2c0394['code'],_0x3367f8);})[_0x4b9e('0x17')](function(_0x4703cb){_0x3367f8[_0x4b9e('0x55')]=_0x4703cb[_0x4b9e('0x56')];_0x3367f8['data6']=_0x4703cb[_0x4b9e('0x57')];return db['CloudProvider'][_0x4b9e('0x16')]({'data5':_0x3367f8[_0x4b9e('0x55')],'data6':_0x3367f8[_0x4b9e('0x58')]},{'where':{'id':_0x3367f8['id']}});})[_0x4b9e('0x17')](function(){oauth[_0x4b9e('0x59')](_0x3367f8);socket[_0x4b9e('0x5a')](_0x4b9e('0x5b'),{'id':_0xf9d622['id']});return;})[_0x4b9e('0x17')](respondWithStatusCode(_0x1e240c,null))[_0x4b9e('0x3d')](function(_0x234b1d){if(_0xf9d622){socket[_0x4b9e('0x5a')](_0x4b9e('0x5c'),{'id':_0xf9d622['id']});}if(!_0x3367f8){logger[_0x4b9e('0x19')](_0x4b9e('0x5d'),_0x234b1d);return _0x1e240c['status'](0x1f4)[_0x4b9e('0x1c')](_0x234b1d['message']);}logger[_0x4b9e('0x19')](_0x4b9e('0x5e'),_0x3367f8['id'],JSON[_0x4b9e('0x5f')](_0x234b1d));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index edc5b61..137dcc2 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 _0xce2a=['cloud_providers','../../config/logger','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x33155c,_0x3fdde1){var _0x5becf7=function(_0x2f7a2f){while(--_0x2f7a2f){_0x33155c['push'](_0x33155c['shift']());}};_0x5becf7(++_0x3fdde1);}(_0xce2a,0x104));var _0xace2=function(_0x32af91,_0x496dde){_0x32af91=_0x32af91-0x0;var _0x492bfd=_0xce2a[_0x32af91];return _0x492bfd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xace2('0x0'))('api');var moment=require('moment');var BPromise=require(_0xace2('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xace2('0x2'));var rimraf=require(_0xace2('0x3'));var config=require(_0xace2('0x4'));var attributes=require('./cloudProvider.attributes');module[_0xace2('0x5')]=function(_0x582945,_0x18c7f5){return _0x582945['define']('CloudProvider',attributes,{'tableName':_0xace2('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9d3=['CloudProvider','cloud_providers','lodash','util','api','bluebird','path','../../config/environment','exports','define'];(function(_0x2451c3,_0x2c16e0){var _0x4bc3bb=function(_0x378dd5){while(--_0x378dd5){_0x2451c3['push'](_0x2451c3['shift']());}};_0x4bc3bb(++_0x2c16e0);}(_0xd9d3,0x174));var _0x3d9d=function(_0x3aacd4,_0x46ed3b){_0x3aacd4=_0x3aacd4-0x0;var _0x3b4e07=_0xd9d3[_0x3aacd4];return _0x3b4e07;};'use strict';var _=require(_0x3d9d('0x0'));var util=require(_0x3d9d('0x1'));var logger=require('../../config/logger')(_0x3d9d('0x2'));var moment=require('moment');var BPromise=require(_0x3d9d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d9d('0x4'));var rimraf=require('rimraf');var config=require(_0x3d9d('0x5'));var attributes=require('./cloudProvider.attributes');module[_0x3d9d('0x6')]=function(_0x185a55,_0xebbd0){return _0x185a55[_0x3d9d('0x7')](_0x3d9d('0x8'),attributes,{'tableName':_0x3d9d('0x9'),'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 2b53d51..1e7b0d1 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 _0xfbf6=['value','oauth2Claims','oauth2/','set','stringify','payload','iss','issuer','aud','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','data6','decryptString','POST','access_token','refresh_token','update','data5','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','offline_access','/authorize','map','type','Dynamics365','push','data7','join','Outlook365','replace','{TENANT_ID}','data2','code','id_token','from','toString','base64','randomBytes','hex','data1','response_type','redirect_uri','data4','response_mode','scope','state','nonce','prompt','login','key'];(function(_0x2c2b3a,_0xaad94f){var _0x261b5d=function(_0x3e4c50){while(--_0x3e4c50){_0x2c2b3a['push'](_0x2c2b3a['shift']());}};_0x261b5d(++_0xaad94f);}(_0xfbf6,0x117));var _0x6fbf=function(_0x128450,_0x5869ba){_0x128450=_0x128450-0x0;var _0x4d80ed=_0xfbf6[_0x128450];return _0x4d80ed;};'use strict';var _=require(_0x6fbf('0x0'));var crypto=require(_0x6fbf('0x1'));var jwt=require(_0x6fbf('0x2'));var moment=require(_0x6fbf('0x3'));var Redis=require(_0x6fbf('0x4'));var rp=require(_0x6fbf('0x5'));var util=require(_0x6fbf('0x6'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x6fbf('0x7'))(_0x6fbf('0x8'));var schedule=require(_0x6fbf('0x9'));var db=require(_0x6fbf('0xa'))['db'];config['redis']=_[_0x6fbf('0xb')](config[_0x6fbf('0xc')],{'host':_0x6fbf('0xd'),'port':0x18eb});var redis=new Redis(config[_0x6fbf('0xc')]);var MICROSOFT_AUTH_URL=_0x6fbf('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0x6fbf('0xf'),'profile',_0x6fbf('0x10'),'offline_access',_0x6fbf('0x11'),_0x6fbf('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x6fbf('0xf'),_0x6fbf('0x13')]};var MICROSOFT_AUTH_ENDPOINT=_0x6fbf('0x14');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x135563){var _0x392552=_[_0x6fbf('0x15')](AZURE_AUTH_SCOPES[_0x135563[_0x6fbf('0x16')]]);if(_0x135563[_0x6fbf('0x16')]===_0x6fbf('0x17'))_0x392552[_0x6fbf('0x18')](_0x135563[_0x6fbf('0x19')]+'/.default');return _0x392552[_0x6fbf('0x1a')]('\x20');}function getAccessTokenScope(_0x7f0d94){if(_0x7f0d94['type']===_0x6fbf('0x1b'))return _0x6fbf('0x11');if(_0x7f0d94['type']===_0x6fbf('0x17'))return _0x7f0d94[_0x6fbf('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x3217da,_0x1e61b3){var _0x24534c=MICROSOFT_AUTH_URL[_0x6fbf('0x1c')](_0x6fbf('0x1d'),_0x3217da[_0x6fbf('0x1e')]);var _0x460fb5=[_0x6fbf('0x1f'),_0x6fbf('0x20')];var _0x153389=Buffer[_0x6fbf('0x21')](JSON['stringify']({'id':_0x1e61b3}))[_0x6fbf('0x22')](_0x6fbf('0x23'));var _0x3b0e39=crypto[_0x6fbf('0x24')](0x10)['toString'](_0x6fbf('0x25'));var _0x188623=getAuthorizationScopes(_0x3217da);var _0x51ab60=[{'key':'client_id','value':_0x3217da[_0x6fbf('0x26')]},{'key':_0x6fbf('0x27'),'value':encodeURIComponent(_0x460fb5['join']('\x20'))},{'key':_0x6fbf('0x28'),'value':_0x3217da[_0x6fbf('0x29')]},{'key':_0x6fbf('0x2a'),'value':'form_post'},{'key':_0x6fbf('0x2b'),'value':encodeURIComponent(_0x188623)},{'key':_0x6fbf('0x2c'),'value':_0x153389},{'key':_0x6fbf('0x2d'),'value':_0x3b0e39},{'key':_0x6fbf('0x2e'),'value':_0x6fbf('0x2f')}];var _0x26f053=_0x24534c+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x6fbf('0x15')](_0x51ab60,function(_0x2b3887){return _0x2b3887[_0x6fbf('0x30')]+'='+_0x2b3887[_0x6fbf('0x31')];})[_0x6fbf('0x1a')]('&');_0x3217da[_0x6fbf('0x32')]={'issuer':_0x24534c[_0x6fbf('0x1c')](_0x6fbf('0x33'),''),'audience':_0x3217da['data1'],'state':_0x153389,'nonce':_0x3b0e39};redis[_0x6fbf('0x34')](_0x153389,JSON[_0x6fbf('0x35')](_0x3217da));return _0x26f053;}function isValidIdToken(_0x12853e,_0x357407){try{var _0x50625d=jwt['decode'](_0x12853e,{'complete':!![]});var _0xb6c343=_0x50625d[_0x6fbf('0x36')];if(_0xb6c343[_0x6fbf('0x37')]!==_0x357407[_0x6fbf('0x38')])return![];if(_0xb6c343[_0x6fbf('0x39')]!==_0x357407['audience'])return![];if(_0xb6c343['nonce']!==_0x357407[_0x6fbf('0x2d')])return![];if(moment()[_0x6fbf('0x3a')](moment[_0x6fbf('0x3b')](_0xb6c343[_0x6fbf('0x3c')])))return![];return!![];}catch(_0x2201a1){throw _0x2201a1;}}function refreshOauth2MicrosoftAccessToken(_0xc83255){return Promise[_0x6fbf('0x3d')]()[_0x6fbf('0x3e')](function(){if(_0xc83255[_0x6fbf('0x3f')])return _0xc83255;return db[_0x6fbf('0x40')][_0x6fbf('0x41')]({'where':{'id':_0xc83255['id']},'raw':!![]});})[_0x6fbf('0x3e')](function(_0x15026b){var _0x13ff2a={'grant_type':'refresh_token','refresh_token':_0x15026b[_0x6fbf('0x42')],'scope':getAccessTokenScope(_0x15026b),'redirect_uri':_0x15026b[_0x6fbf('0x29')],'client_id':_0x15026b[_0x6fbf('0x26')],'client_secret':encryptor[_0x6fbf('0x43')](_0x15026b[_0x6fbf('0x3f')])};var _0x3fc395={'method':_0x6fbf('0x44'),'uri':MICROSOFT_AUTH_URL[_0x6fbf('0x1c')](_0x6fbf('0x1d'),_0x15026b['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x13ff2a,'json':!![]};return rp(_0x3fc395);})[_0x6fbf('0x3e')](function(_0x14f45d){_0xc83255['data5']=_0x14f45d[_0x6fbf('0x45')];_0xc83255[_0x6fbf('0x42')]=_0x14f45d[_0x6fbf('0x46')];return db[_0x6fbf('0x40')][_0x6fbf('0x47')]({'data5':_0xc83255[_0x6fbf('0x48')],'data6':_0xc83255[_0x6fbf('0x42')]},{'where':{'id':_0xc83255['id']}});})[_0x6fbf('0x3e')](function(){return _0xc83255;})['catch'](function(_0x22ffd1){logger[_0x6fbf('0x49')](_0x6fbf('0x4a'),_0xc83255['id'],_0x22ffd1);});}function getOauth2MicrosoftAccessToken(_0x48b797,_0x342aa0){var _0x1c6741={'grant_type':'authorization_code','code':_0x48b797,'scope':getAccessTokenScope(_0x342aa0),'redirect_uri':_0x342aa0[_0x6fbf('0x29')],'client_id':_0x342aa0['data1'],'client_secret':encryptor[_0x6fbf('0x43')](_0x342aa0[_0x6fbf('0x3f')])};var _0x55df76={'method':_0x6fbf('0x44'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x342aa0[_0x6fbf('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1c6741,'json':!![]};return rp(_0x55df76);}function startRefreshInterval(_0x44be06){var _0x4f2ad9=schedule[_0x6fbf('0x4b')];if(_0x4f2ad9[_0x44be06['id']])clearInterval(_0x4f2ad9[_0x44be06['id']]);_0x4f2ad9[_0x44be06['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x6fbf('0x4c')](this,{'id':_0x44be06['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x6fbf('0x4b')]=_0x4f2ad9;}function startAllRefreshIntervals(){return db[_0x6fbf('0x40')][_0x6fbf('0x4d')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x6fbf('0x3e')](function(_0x556e13){var _0x4eca12=_0x556e13[_0x6fbf('0x15')](function(_0x3a7127){return refreshOauth2MicrosoftAccessToken(_0x3a7127)[_0x6fbf('0x3e')](function(_0x5946cf){startRefreshInterval(_0x5946cf);});});return Promise['all'](_0x4eca12);})[_0x6fbf('0x4e')](function(_0x1f632){var _0x4566b6=_0x1f632?util[_0x6fbf('0x4f')](_0x1f632,{'showHidden':![],'depth':null}):'';logger[_0x6fbf('0x49')](_0x6fbf('0x50'),_0x4566b6);});}module[_0x6fbf('0x51')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xbe81=['redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','from','base64','toString','hex','client_id','data1','redirect_uri','data4','response_mode','scope','state','nonce','login','key','value','oauth2Claims','oauth2/','set','stringify','payload','iss','issuer','audience','isAfter','unix','exp','resolve','data3','then','refresh_token','data6','decryptString','POST','data5','access_token','CloudProvider','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','findAll','all','inspect','exports','lodash','ioredis','request-promise','../../components/encryptor','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb'];(function(_0x149c91,_0x10138a){var _0x552396=function(_0x487233){while(--_0x487233){_0x149c91['push'](_0x149c91['shift']());}};_0x552396(++_0x10138a);}(_0xbe81,0x121));var _0x1be8=function(_0x584b9d,_0x1cb5c5){_0x584b9d=_0x584b9d-0x0;var _0x172053=_0xbe81[_0x584b9d];return _0x172053;};'use strict';var _=require(_0x1be8('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0x1be8('0x1'));var rp=require(_0x1be8('0x2'));var util=require('util');var encryptor=require(_0x1be8('0x3'));var config=require('../../config/environment');var logger=require(_0x1be8('0x4'))('api');var schedule=require(_0x1be8('0x5'));var db=require(_0x1be8('0x6'))['db'];config[_0x1be8('0x7')]=_[_0x1be8('0x8')](config[_0x1be8('0x7')],{'host':_0x1be8('0x9'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x1be8('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0x1be8('0xb'),_0x1be8('0xc'),_0x1be8('0xd'),_0x1be8('0xe'),_0x1be8('0xf'),_0x1be8('0x10'),_0x1be8('0x11')],'Dynamics365':['openid',_0x1be8('0xe')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x1be8('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x225013){var _0x5dd7d6=_[_0x1be8('0x13')](AZURE_AUTH_SCOPES[_0x225013[_0x1be8('0x14')]]);if(_0x225013['type']===_0x1be8('0x15'))_0x5dd7d6['push'](_0x225013['data7']+_0x1be8('0x16'));return _0x5dd7d6[_0x1be8('0x17')]('\x20');}function getAccessTokenScope(_0x2ed6a2){if(_0x2ed6a2[_0x1be8('0x14')]===_0x1be8('0x18'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x2ed6a2[_0x1be8('0x14')]===_0x1be8('0x15'))return _0x2ed6a2['data7']+_0x1be8('0x16');}function generateMicrosoftAuthorizationUrl(_0x40dafb,_0x356590){var _0x3afdb4=MICROSOFT_AUTH_URL[_0x1be8('0x19')](_0x1be8('0x1a'),_0x40dafb[_0x1be8('0x1b')]);var _0x576f27=[_0x1be8('0x1c'),'id_token'];var _0x7a6d92=Buffer[_0x1be8('0x1d')](JSON['stringify']({'id':_0x356590}))['toString'](_0x1be8('0x1e'));var _0x72f7e1=crypto['randomBytes'](0x10)[_0x1be8('0x1f')](_0x1be8('0x20'));var _0x1c3019=getAuthorizationScopes(_0x40dafb);var _0x5017d2=[{'key':_0x1be8('0x21'),'value':_0x40dafb[_0x1be8('0x22')]},{'key':'response_type','value':encodeURIComponent(_0x576f27[_0x1be8('0x17')]('\x20'))},{'key':_0x1be8('0x23'),'value':_0x40dafb[_0x1be8('0x24')]},{'key':_0x1be8('0x25'),'value':'form_post'},{'key':_0x1be8('0x26'),'value':encodeURIComponent(_0x1c3019)},{'key':_0x1be8('0x27'),'value':_0x7a6d92},{'key':_0x1be8('0x28'),'value':_0x72f7e1},{'key':'prompt','value':_0x1be8('0x29')}];var _0x5b463f=_0x3afdb4+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x1be8('0x13')](_0x5017d2,function(_0x5da5de){return _0x5da5de[_0x1be8('0x2a')]+'='+_0x5da5de[_0x1be8('0x2b')];})[_0x1be8('0x17')]('&');_0x40dafb[_0x1be8('0x2c')]={'issuer':_0x3afdb4['replace'](_0x1be8('0x2d'),''),'audience':_0x40dafb['data1'],'state':_0x7a6d92,'nonce':_0x72f7e1};redis[_0x1be8('0x2e')](_0x7a6d92,JSON[_0x1be8('0x2f')](_0x40dafb));return _0x5b463f;}function isValidIdToken(_0x1a9402,_0x3b7b0c){try{var _0xfef6fe=jwt['decode'](_0x1a9402,{'complete':!![]});var _0x11f64d=_0xfef6fe[_0x1be8('0x30')];if(_0x11f64d[_0x1be8('0x31')]!==_0x3b7b0c[_0x1be8('0x32')])return![];if(_0x11f64d['aud']!==_0x3b7b0c[_0x1be8('0x33')])return![];if(_0x11f64d['nonce']!==_0x3b7b0c['nonce'])return![];if(moment()[_0x1be8('0x34')](moment[_0x1be8('0x35')](_0x11f64d[_0x1be8('0x36')])))return![];return!![];}catch(_0xdea15b){throw _0xdea15b;}}function refreshOauth2MicrosoftAccessToken(_0x459717){return Promise[_0x1be8('0x37')]()['then'](function(){if(_0x459717[_0x1be8('0x38')])return _0x459717;return db['CloudProvider']['findOne']({'where':{'id':_0x459717['id']},'raw':!![]});})[_0x1be8('0x39')](function(_0x38e41c){var _0xe65bd7={'grant_type':_0x1be8('0x3a'),'refresh_token':_0x38e41c[_0x1be8('0x3b')],'scope':getAccessTokenScope(_0x38e41c),'redirect_uri':_0x38e41c[_0x1be8('0x24')],'client_id':_0x38e41c[_0x1be8('0x22')],'client_secret':encryptor[_0x1be8('0x3c')](_0x38e41c[_0x1be8('0x38')])};var _0x4215a6={'method':_0x1be8('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x1be8('0x19')]('{TENANT_ID}',_0x38e41c[_0x1be8('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xe65bd7,'json':!![]};return rp(_0x4215a6);})[_0x1be8('0x39')](function(_0x39221d){_0x459717[_0x1be8('0x3e')]=_0x39221d[_0x1be8('0x3f')];_0x459717['data6']=_0x39221d['refresh_token'];return db[_0x1be8('0x40')][_0x1be8('0x41')]({'data5':_0x459717[_0x1be8('0x3e')],'data6':_0x459717['data6']},{'where':{'id':_0x459717['id']}});})[_0x1be8('0x39')](function(){return _0x459717;})[_0x1be8('0x42')](function(_0x5712a4){logger[_0x1be8('0x43')](_0x1be8('0x44'),_0x459717['id'],_0x5712a4);});}function getOauth2MicrosoftAccessToken(_0x43d717,_0xa05819){var _0x407b8d={'grant_type':_0x1be8('0x45'),'code':_0x43d717,'scope':getAccessTokenScope(_0xa05819),'redirect_uri':_0xa05819[_0x1be8('0x24')],'client_id':_0xa05819[_0x1be8('0x22')],'client_secret':encryptor['decryptString'](_0xa05819[_0x1be8('0x38')])};var _0x148ca0={'method':_0x1be8('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x1be8('0x19')]('{TENANT_ID}',_0xa05819[_0x1be8('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x407b8d,'json':!![]};return rp(_0x148ca0);}function startRefreshInterval(_0x469d16){var _0x5d0cd7=schedule['intervals'];if(_0x5d0cd7[_0x469d16['id']])clearInterval(_0x5d0cd7[_0x469d16['id']]);_0x5d0cd7[_0x469d16['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x469d16['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x5d0cd7;}function startAllRefreshIntervals(){return db[_0x1be8('0x40')][_0x1be8('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x1be8('0x39')](function(_0x3ef62d){var _0x36b146=_0x3ef62d[_0x1be8('0x13')](function(_0x1c3b8b){return refreshOauth2MicrosoftAccessToken(_0x1c3b8b)[_0x1be8('0x39')](function(_0x1d8019){startRefreshInterval(_0x1d8019);});});return Promise[_0x1be8('0x47')](_0x36b146);})[_0x1be8('0x42')](function(_0x239cf8){var _0x126297=_0x239cf8?util[_0x1be8('0x48')](_0x239cf8,{'showHidden':![],'depth':null}):'';logger[_0x1be8('0x43')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x126297);});}module[_0x1be8('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 56df6c6..c0d3a44 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 _0x6947=['../../config/environment','jayson/promise','client','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0xe0b81f,_0x1fb734){var _0x290e5e=function(_0x19b8d3){while(--_0x19b8d3){_0xe0b81f['push'](_0xe0b81f['shift']());}};_0x290e5e(++_0x1fb734);}(_0x6947,0x72));var _0x7694=function(_0x3a2fa1,_0x210433){_0x3a2fa1=_0x3a2fa1-0x0;var _0x21be50=_0x6947[_0x3a2fa1];return _0x21be50;};'use strict';var _=require('lodash');var util=require(_0x7694('0x0'));var moment=require('moment');var BPromise=require(_0x7694('0x1'));var rs=require(_0x7694('0x2'));var fs=require('fs');var Redis=require(_0x7694('0x3'));var db=require(_0x7694('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7694('0x5'));var config=require(_0x7694('0x6'));var jayson=require(_0x7694('0x7'));var client=jayson[_0x7694('0x8')][_0x7694('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x266a27,_0x52cecf,_0x9ecd68){return new BPromise(function(_0x57d637,_0x28ea4f){return client[_0x7694('0xa')](_0x266a27,_0x9ecd68)['then'](function(_0x3a4a92){logger[_0x7694('0xb')](_0x7694('0xc'),_0x52cecf,_0x7694('0xd'));logger[_0x7694('0xe')](_0x7694('0xf'),_0x52cecf,_0x7694('0xd'),JSON['stringify'](_0x3a4a92));if(_0x3a4a92[_0x7694('0x10')]){if(_0x3a4a92[_0x7694('0x10')]['code']===0x1f4){logger[_0x7694('0x10')](_0x7694('0xc'),_0x52cecf,_0x3a4a92[_0x7694('0x10')]['message']);return _0x28ea4f(_0x3a4a92['error'][_0x7694('0x11')]);}logger[_0x7694('0x10')](_0x7694('0xc'),_0x52cecf,_0x3a4a92['error'][_0x7694('0x11')]);return _0x57d637(_0x3a4a92['error'][_0x7694('0x11')]);}else{logger[_0x7694('0xb')](_0x7694('0xc'),_0x52cecf,_0x7694('0xd'));_0x57d637(_0x3a4a92[_0x7694('0x12')]['message']);}})[_0x7694('0x13')](function(_0xb1edf0){logger[_0x7694('0x10')](_0x7694('0xc'),_0x52cecf,_0xb1edf0);_0x28ea4f(_0xb1edf0);});});} \ No newline at end of file +var _0x4e2e=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x42c1d9,_0x404ad8){var _0x210da3=function(_0x472452){while(--_0x472452){_0x42c1d9['push'](_0x42c1d9['shift']());}};_0x210da3(++_0x404ad8);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x1a74cd,_0x18a485){_0x1a74cd=_0x1a74cd-0x0;var _0x4dadd1=_0x4e2e[_0x1a74cd];return _0x4dadd1;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));var BPromise=require(_0xe4e2('0x2'));var rs=require(_0xe4e2('0x3'));var fs=require('fs');var Redis=require(_0xe4e2('0x4'));var db=require(_0xe4e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4e2('0x6'))(_0xe4e2('0x7'));var config=require(_0xe4e2('0x8'));var jayson=require(_0xe4e2('0x9'));var client=jayson['client'][_0xe4e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b1c6,_0x1c4e64,_0x125338){return new BPromise(function(_0x956c75,_0x27304b){return client[_0xe4e2('0xb')](_0x36b1c6,_0x125338)[_0xe4e2('0xc')](function(_0x4912da){logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));logger['debug'](_0xe4e2('0x10'),_0x1c4e64,_0xe4e2('0xf'),JSON[_0xe4e2('0x11')](_0x4912da));if(_0x4912da[_0xe4e2('0x12')]){if(_0x4912da[_0xe4e2('0x12')]['code']===0x1f4){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x27304b(_0x4912da['error'][_0xe4e2('0x13')]);}logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x956c75(_0x4912da['error']['message']);}else{logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));_0x956c75(_0x4912da[_0xe4e2('0x14')][_0xe4e2('0x13')]);}})['catch'](function(_0x754778){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x754778);_0x27304b(_0x754778);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 8d7a31f..be6eca6 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 _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x387350,_0x7e90b9){var _0x1b6529=function(_0x2dfcab){while(--_0x2dfcab){_0x387350['push'](_0x387350['shift']());}};_0x1b6529(++_0x7e90b9);}(_0x2ef3,0xba));var _0x32ef=function(_0x26ca47,_0x44be01){_0x26ca47=_0x26ca47-0x0;var _0x27dbef=_0x2ef3[_0x26ca47];return _0x27dbef;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file +var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x5751e6,_0x125e5e){var _0x4199e4=function(_0x559843){while(--_0x559843){_0x5751e6['push'](_0x5751e6['shift']());}};_0x4199e4(++_0x125e5e);}(_0x5f2f,0x73));var _0xf5f2=function(_0xd1730e,_0x4adb9f){_0xd1730e=_0xd1730e-0x0;var _0x4ce7d4=_0x5f2f[_0xd1730e];return _0x4ce7d4;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 9a9ae63..9a82dbe 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 _0x2dc2=['STRING','name','sequelize'];(function(_0x40b3f2,_0x2c4f5f){var _0x4ce90c=function(_0x516f31){while(--_0x516f31){_0x40b3f2['push'](_0x40b3f2['shift']());}};_0x4ce90c(++_0x2c4f5f);}(_0x2dc2,0xcb));var _0x22dc=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x2dc2[_0x32d457];return _0x338386;};'use strict';var Sequelize=require(_0x22dc('0x0'));module['exports']={'name':{'type':Sequelize[_0x22dc('0x1')],'unique':_0x22dc('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x22dc('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x22dc('0x1')]},'phone':{'type':Sequelize[_0x22dc('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x22dc('0x1')]},'street':{'type':Sequelize[_0x22dc('0x1')]},'postalCode':{'type':Sequelize[_0x22dc('0x1')]},'city':{'type':Sequelize[_0x22dc('0x1')]},'country':{'type':Sequelize[_0x22dc('0x1')]},'email':{'type':Sequelize[_0x22dc('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x22dc('0x1')]},'sStreet':{'type':Sequelize[_0x22dc('0x1')]},'sPostalCode':{'type':Sequelize[_0x22dc('0x1')]},'sCity':{'type':Sequelize[_0x22dc('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x22dc('0x1')]}}; \ No newline at end of file +var _0x023b=['STRING','sequelize'];(function(_0x32088f,_0x538e0a){var _0x43abf1=function(_0x52c41d){while(--_0x52c41d){_0x32088f['push'](_0x32088f['shift']());}};_0x43abf1(++_0x538e0a);}(_0x023b,0x123));var _0xb023=function(_0x170d59,_0x4743ad){_0x170d59=_0x170d59-0x0;var _0x53ed9f=_0x023b[_0x170d59];return _0x53ed9f;};'use strict';var Sequelize=require(_0xb023('0x0'));module['exports']={'name':{'type':Sequelize[_0xb023('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb023('0x1')]},'companyId':{'type':Sequelize[_0xb023('0x1')]},'website':{'type':Sequelize[_0xb023('0x1')]},'phone':{'type':Sequelize[_0xb023('0x1')]},'fax':{'type':Sequelize[_0xb023('0x1')]},'type':{'type':Sequelize[_0xb023('0x1')]},'street':{'type':Sequelize[_0xb023('0x1')]},'postalCode':{'type':Sequelize[_0xb023('0x1')]},'city':{'type':Sequelize[_0xb023('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xb023('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb023('0x1')]},'sStreet':{'type':Sequelize[_0xb023('0x1')]},'sPostalCode':{'type':Sequelize[_0xb023('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb023('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 97e58c6..7ec3256 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 _0x0cc6=['limit','count','set','update','then','destroy','get','Companies','UserProfileResource','end','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','map','filter','merge','findAll','rows','catch','show','params','rawAttributes','includeAll','include','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','findOne','pick','nolimit','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined'];(function(_0x5a636f,_0x3fec2b){var _0x6a8cfb=function(_0x20e6ca){while(--_0x20e6ca){_0x5a636f['push'](_0x5a636f['shift']());}};_0x6a8cfb(++_0x3fec2b);}(_0x0cc6,0x1ec));var _0x60cc=function(_0x59a549,_0x2fe2bb){_0x59a549=_0x59a549-0x0;var _0x12adbe=_0x0cc6[_0x59a549];return _0x12adbe;};'use strict';var emlformat=require(_0x60cc('0x0'));var rimraf=require(_0x60cc('0x1'));var zipdir=require(_0x60cc('0x2'));var jsonpatch=require(_0x60cc('0x3'));var rp=require(_0x60cc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x60cc('0x5'));var util=require(_0x60cc('0x6'));var path=require(_0x60cc('0x7'));var sox=require(_0x60cc('0x8'));var csv=require('to-csv');var ejs=require(_0x60cc('0x9'));var fs=require('fs');var fs_extra=require(_0x60cc('0xa'));var _=require('lodash');var squel=require(_0x60cc('0xb'));var crypto=require(_0x60cc('0xc'));var jsforce=require(_0x60cc('0xd'));var deskjs=require(_0x60cc('0xe'));var toCsv=require(_0x60cc('0xf'));var querystring=require(_0x60cc('0x10'));var Papa=require(_0x60cc('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x60cc('0x12'));var as=require(_0x60cc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x60cc('0x14'))(_0x60cc('0x15'));var utils=require(_0x60cc('0x16'));var config=require(_0x60cc('0x17'));var licenseUtil=require(_0x60cc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x589c66,_0x2184fa){_0x2184fa=_0x2184fa||0xcc;return function(_0x242940){if(_0x242940){return _0x589c66[_0x60cc('0x19')](_0x2184fa);}return _0x589c66[_0x60cc('0x1a')](_0x2184fa)['end']();};}function respondWithResult(_0x20504a,_0x4dc365){_0x4dc365=_0x4dc365||0xc8;return function(_0x7f0d94){if(_0x7f0d94){return _0x20504a[_0x60cc('0x1a')](_0x4dc365)[_0x60cc('0x1b')](_0x7f0d94);}};}function respondWithFilteredResult(_0x35cc0f,_0x553e3b){return function(_0xe8ed9f){if(_0xe8ed9f){var _0x3744a6=typeof _0x553e3b[_0x60cc('0x1c')]===_0x60cc('0x1d')&&typeof _0x553e3b[_0x60cc('0x1e')]===_0x60cc('0x1d');var _0x5529c9=_0xe8ed9f[_0x60cc('0x1f')];var _0x46b939=_0x3744a6?0x0:_0x553e3b[_0x60cc('0x1c')];var _0x1a458e=_0x3744a6?_0xe8ed9f[_0x60cc('0x1f')]:_0x553e3b[_0x60cc('0x1c')]+_0x553e3b[_0x60cc('0x1e')];var _0x460925;if(_0x1a458e>=_0x5529c9){_0x1a458e=_0x5529c9;_0x460925=0xc8;}else{_0x460925=0xce;}_0x35cc0f[_0x60cc('0x1a')](_0x460925);return _0x35cc0f[_0x60cc('0x20')]('Content-Range',_0x46b939+'-'+_0x1a458e+'/'+_0x5529c9)[_0x60cc('0x1b')](_0xe8ed9f);}return null;};}function patchUpdates(_0x15916c){return function(_0x2faef7){try{jsonpatch['apply'](_0x2faef7,_0x15916c,!![]);}catch(_0x5cc6a5){return BPromise['reject'](_0x5cc6a5);}return _0x2faef7['save']();};}function saveUpdates(_0x583479,_0x2039fb){return function(_0xfc3f37){if(_0xfc3f37){return _0xfc3f37[_0x60cc('0x21')](_0x583479)[_0x60cc('0x22')](function(_0x463071){return _0x463071;});}return null;};}function removeEntity(_0x56c10b,_0x53f4b9){return function(_0x36a31a){if(_0x36a31a){return _0x36a31a[_0x60cc('0x23')]()[_0x60cc('0x22')](function(){var _0x4bb9af=_0x36a31a[_0x60cc('0x24')]({'plain':!![]});var _0x29c0d9=_0x60cc('0x25');return db[_0x60cc('0x26')][_0x60cc('0x23')]({'where':{'type':_0x29c0d9,'resourceId':_0x4bb9af['id']}})['then'](function(){return _0x36a31a;});})[_0x60cc('0x22')](function(){_0x56c10b[_0x60cc('0x1a')](0xcc)[_0x60cc('0x27')]();});}};}function handleEntityNotFound(_0x5434da,_0x4810d2){return function(_0x39d31f){if(!_0x39d31f){_0x5434da['sendStatus'](0x194);}return _0x39d31f;};}function handleError(_0x14341b,_0x46b248){_0x46b248=_0x46b248||0x1f4;return function(_0x5f0f6c){logger[_0x60cc('0x28')](_0x5f0f6c[_0x60cc('0x29')]);if(_0x5f0f6c[_0x60cc('0x2a')]){delete _0x5f0f6c[_0x60cc('0x2a')];}_0x14341b[_0x60cc('0x1a')](_0x46b248)[_0x60cc('0x2b')](_0x5f0f6c);};}exports[_0x60cc('0x2c')]=function(_0xbae86e,_0x58472a){var _0x4fae6e={},_0x1a58e1={},_0x29879e={'count':0x0,'rows':[]};return db[_0x60cc('0x2d')][_0x60cc('0x2e')]()[_0x60cc('0x22')](function(_0x59eabf){_0x1a58e1[_0x60cc('0x2f')]=_[_0x60cc('0x30')](_0x59eabf);_0x1a58e1[_0x60cc('0x31')]=_[_0x60cc('0x30')](_0xbae86e['query']);_0x1a58e1[_0x60cc('0x32')]=_[_0x60cc('0x33')](_0x1a58e1[_0x60cc('0x2f')],_0x1a58e1[_0x60cc('0x31')]);_0x4fae6e[_0x60cc('0x34')]=_[_0x60cc('0x33')](_0x1a58e1[_0x60cc('0x2f')],qs['fields'](_0xbae86e[_0x60cc('0x31')][_0x60cc('0x35')]));_0x4fae6e['attributes']=_0x4fae6e[_0x60cc('0x34')][_0x60cc('0x36')]?_0x4fae6e[_0x60cc('0x34')]:_0x1a58e1[_0x60cc('0x2f')];if(!_0xbae86e[_0x60cc('0x31')][_0x60cc('0x37')]('nolimit')){_0x4fae6e['limit']=qs[_0x60cc('0x1e')](_0xbae86e[_0x60cc('0x31')][_0x60cc('0x1e')]);_0x4fae6e[_0x60cc('0x1c')]=qs['offset'](_0xbae86e[_0x60cc('0x31')]['offset']);}_0x4fae6e[_0x60cc('0x38')]=qs['sort'](_0xbae86e[_0x60cc('0x31')][_0x60cc('0x39')]);_0x4fae6e[_0x60cc('0x3a')]=qs['filters'](_['pick'](_0xbae86e['query'],_0x1a58e1['filters']),_0x59eabf);if(_0xbae86e['query']['filter']){_0x4fae6e[_0x60cc('0x3a')]=_['merge'](_0x4fae6e[_0x60cc('0x3a')],{'$or':_[_0x60cc('0x3b')](_0x4fae6e['attributes'],function(_0xc1bbf7){var _0x43fc76={};_0x43fc76[_0xc1bbf7]={'$like':'%'+_0xbae86e[_0x60cc('0x31')][_0x60cc('0x3c')]+'%'};return _0x43fc76;})});}_0x4fae6e=_[_0x60cc('0x3d')]({},_0x4fae6e,_0xbae86e['options']);var _0x56aaf7={'where':_0x4fae6e[_0x60cc('0x3a')]};return db[_0x60cc('0x2d')][_0x60cc('0x1f')](_0x56aaf7)['then'](function(_0x1f8c05){_0x29879e[_0x60cc('0x1f')]=_0x1f8c05;if(_0xbae86e[_0x60cc('0x31')]['includeAll']){_0x4fae6e['include']=[{'all':!![]}];}return db[_0x60cc('0x2d')][_0x60cc('0x3e')](_0x4fae6e);})[_0x60cc('0x22')](function(_0x3b964e){_0x29879e[_0x60cc('0x3f')]=_0x3b964e;return _0x29879e;})['then'](respondWithFilteredResult(_0x58472a,_0x4fae6e))[_0x60cc('0x40')](handleError(_0x58472a,null));})['catch'](handleError(_0x58472a,null));};exports[_0x60cc('0x41')]=function(_0x3cf61b,_0x48df3a){var _0x67e912={'raw':![],'where':{'id':_0x3cf61b[_0x60cc('0x42')]['id']}},_0x3a492d={};_0x3a492d[_0x60cc('0x2f')]=_[_0x60cc('0x30')](db[_0x60cc('0x2d')][_0x60cc('0x43')]);_0x3a492d[_0x60cc('0x31')]=_[_0x60cc('0x30')](_0x3cf61b[_0x60cc('0x31')]);_0x3a492d[_0x60cc('0x32')]=_[_0x60cc('0x33')](_0x3a492d['model'],_0x3a492d['query']);_0x67e912[_0x60cc('0x34')]=_['intersection'](_0x3a492d[_0x60cc('0x2f')],qs[_0x60cc('0x35')](_0x3cf61b['query'][_0x60cc('0x35')]));_0x67e912[_0x60cc('0x34')]=_0x67e912['attributes']['length']?_0x67e912[_0x60cc('0x34')]:_0x3a492d[_0x60cc('0x2f')];if(_0x3cf61b['query'][_0x60cc('0x44')]){_0x67e912[_0x60cc('0x45')]=[{'all':!![]}];}_0x67e912=_['merge']({},_0x67e912,_0x3cf61b[_0x60cc('0x46')]);return db['CmCompany'][_0x60cc('0x47')](_0x67e912)['then'](handleEntityNotFound(_0x48df3a,null))[_0x60cc('0x22')](respondWithResult(_0x48df3a,null))['catch'](handleError(_0x48df3a,null));};exports['create']=function(_0x53c01a,_0x57500c){return db[_0x60cc('0x2d')][_0x60cc('0x48')](_0x53c01a[_0x60cc('0x49')],{})[_0x60cc('0x22')](function(_0x5663a3){var _0x20a282=_0x53c01a[_0x60cc('0x4a')][_0x60cc('0x24')]({'plain':!![]});if(!_0x20a282)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20a282[_0x60cc('0x4b')]===_0x60cc('0x4a')){var _0x10dc36=_0x5663a3[_0x60cc('0x24')]({'plain':!![]});var _0xf27ad5=_0x60cc('0x25');return db[_0x60cc('0x4c')][_0x60cc('0x47')]({'where':{'name':_0xf27ad5,'userProfileId':_0x20a282[_0x60cc('0x4d')]},'raw':!![]})[_0x60cc('0x22')](function(_0x17a019){if(_0x17a019&&_0x17a019[_0x60cc('0x4e')]===0x0){return db[_0x60cc('0x26')]['create']({'name':_0x10dc36[_0x60cc('0x2a')],'resourceId':_0x10dc36['id'],'type':_0x17a019['name'],'sectionId':_0x17a019['id']},{})[_0x60cc('0x22')](function(){return _0x5663a3;});}else{return _0x5663a3;}})[_0x60cc('0x40')](function(_0x547386){logger[_0x60cc('0x28')](_0x60cc('0x4f'),_0x547386);throw _0x547386;});}return _0x5663a3;})[_0x60cc('0x22')](respondWithResult(_0x57500c,0xc9))[_0x60cc('0x40')](handleError(_0x57500c,null));};exports['update']=function(_0x113ea7,_0x503cb9){if(_0x113ea7[_0x60cc('0x49')]['id']){delete _0x113ea7[_0x60cc('0x49')]['id'];}return db['CmCompany'][_0x60cc('0x47')]({'where':{'id':_0x113ea7[_0x60cc('0x42')]['id']}})['then'](handleEntityNotFound(_0x503cb9,null))[_0x60cc('0x22')](saveUpdates(_0x113ea7[_0x60cc('0x49')],null))[_0x60cc('0x22')](respondWithResult(_0x503cb9,null))[_0x60cc('0x40')](handleError(_0x503cb9,null));};exports[_0x60cc('0x23')]=function(_0xa93a23,_0x3967bf){return db[_0x60cc('0x2d')][_0x60cc('0x47')]({'where':{'id':_0xa93a23['params']['id']}})[_0x60cc('0x22')](handleEntityNotFound(_0x3967bf,null))['then'](removeEntity(_0x3967bf,null))['catch'](handleError(_0x3967bf,null));};exports[_0x60cc('0x2e')]=function(_0x414f3c,_0x2d4c17){return db[_0x60cc('0x2d')]['describe']()[_0x60cc('0x22')](respondWithResult(_0x2d4c17,null))[_0x60cc('0x40')](handleError(_0x2d4c17,null));};exports[_0x60cc('0x50')]=function(_0x1feb94,_0x59d478,_0xa29ccb){return db[_0x60cc('0x51')][_0x60cc('0x47')]({'where':{'id':_0x1feb94['params']['id']}})[_0x60cc('0x22')](handleEntityNotFound(_0x59d478,null))[_0x60cc('0x22')](function(_0x32b1d5){if(_0x32b1d5){return _0x32b1d5[_0x60cc('0x50')](_0x1feb94['body'][_0x60cc('0x52')],_['omit'](_0x1feb94[_0x60cc('0x49')],[_0x60cc('0x52'),'id'])||{});}})[_0x60cc('0x22')](respondWithResult(_0x59d478,null))[_0x60cc('0x40')](handleError(_0x59d478,null));};exports['getContacts']=function(_0x304a5f,_0x5ac881,_0x2fd248){var _0x431130={};var _0x4483d6={};var _0x162fc6;var _0x5ca3d9;return db[_0x60cc('0x2d')][_0x60cc('0x53')]({'where':{'id':_0x304a5f[_0x60cc('0x42')]['id']}})[_0x60cc('0x22')](handleEntityNotFound(_0x5ac881,null))[_0x60cc('0x22')](function(_0x239fe3){if(_0x239fe3){_0x162fc6=_0x239fe3;_0x4483d6['model']=_[_0x60cc('0x30')](db[_0x60cc('0x51')][_0x60cc('0x43')]);_0x4483d6['query']=_[_0x60cc('0x30')](_0x304a5f[_0x60cc('0x31')]);_0x4483d6[_0x60cc('0x32')]=_['intersection'](_0x4483d6[_0x60cc('0x2f')],_0x4483d6['query']);_0x431130[_0x60cc('0x34')]=_['intersection'](_0x4483d6['model'],qs[_0x60cc('0x35')](_0x304a5f['query'][_0x60cc('0x35')]));_0x431130[_0x60cc('0x34')]=_0x431130[_0x60cc('0x34')][_0x60cc('0x36')]?_0x431130[_0x60cc('0x34')]:_0x4483d6[_0x60cc('0x2f')];_0x431130[_0x60cc('0x38')]=qs[_0x60cc('0x39')](_0x304a5f[_0x60cc('0x31')][_0x60cc('0x39')]);_0x431130[_0x60cc('0x3a')]=qs[_0x60cc('0x32')](_[_0x60cc('0x54')](_0x304a5f['query'],_0x4483d6[_0x60cc('0x32')]));if(_0x304a5f[_0x60cc('0x31')][_0x60cc('0x3c')]){_0x431130[_0x60cc('0x3a')]=_['merge'](_0x431130[_0x60cc('0x3a')],{'$or':_[_0x60cc('0x3b')](_0x431130[_0x60cc('0x34')],function(_0x570103){var _0x52347c={};_0x52347c[_0x570103]={'$like':'%'+_0x304a5f[_0x60cc('0x31')][_0x60cc('0x3c')]+'%'};return _0x52347c;})});}_0x431130=_[_0x60cc('0x3d')]({},_0x431130,_0x304a5f[_0x60cc('0x46')]);return _0x162fc6['getContacts'](_0x431130);}})[_0x60cc('0x22')](function(_0x268cfc){if(_0x268cfc){_0x5ca3d9=_0x268cfc[_0x60cc('0x36')];if(!_0x304a5f[_0x60cc('0x31')][_0x60cc('0x37')](_0x60cc('0x55'))){_0x431130[_0x60cc('0x1e')]=qs[_0x60cc('0x1e')](_0x304a5f[_0x60cc('0x31')]['limit']);_0x431130['offset']=qs['offset'](_0x304a5f['query'][_0x60cc('0x1c')]);}return _0x162fc6[_0x60cc('0x56')](_0x431130);}})['then'](function(_0x40b9fa){if(_0x40b9fa){return _0x40b9fa?{'count':_0x5ca3d9,'rows':_0x40b9fa}:null;}})[_0x60cc('0x22')](respondWithResult(_0x5ac881,null))[_0x60cc('0x40')](handleError(_0x5ac881,null));}; \ No newline at end of file +var _0xc815=['index','CmCompany','describe','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','includeAll','findAll','rows','catch','params','rawAttributes','filters','include','options','create','body','user','role','Companies','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','findOne','getContacts','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','status','json','offset','count','limit','set','apply','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','name','send'];(function(_0x19ef72,_0x275be0){var _0x541034=function(_0x161a14){while(--_0x161a14){_0x19ef72['push'](_0x19ef72['shift']());}};_0x541034(++_0x275be0);}(_0xc815,0x1d4));var _0x5c81=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc815[_0x16b9ed];return _0x66b1f8;};'use strict';var emlformat=require(_0x5c81('0x0'));var rimraf=require(_0x5c81('0x1'));var zipdir=require(_0x5c81('0x2'));var jsonpatch=require(_0x5c81('0x3'));var rp=require(_0x5c81('0x4'));var moment=require('moment');var BPromise=require(_0x5c81('0x5'));var Mustache=require(_0x5c81('0x6'));var util=require('util');var path=require(_0x5c81('0x7'));var sox=require(_0x5c81('0x8'));var csv=require('to-csv');var ejs=require(_0x5c81('0x9'));var fs=require('fs');var fs_extra=require(_0x5c81('0xa'));var _=require('lodash');var squel=require(_0x5c81('0xb'));var crypto=require(_0x5c81('0xc'));var jsforce=require(_0x5c81('0xd'));var deskjs=require(_0x5c81('0xe'));var toCsv=require(_0x5c81('0xf'));var querystring=require(_0x5c81('0x10'));var Papa=require(_0x5c81('0x11'));var Redis=require('ioredis');var authService=require(_0x5c81('0x12'));var qs=require(_0x5c81('0x13'));var as=require(_0x5c81('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5c81('0x15'));var utils=require('../../config/utils');var config=require(_0x5c81('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c81('0x17'))['db'];function respondWithStatusCode(_0x256024,_0x14e20a){_0x14e20a=_0x14e20a||0xcc;return function(_0x5c95ac){if(_0x5c95ac){return _0x256024['sendStatus'](_0x14e20a);}return _0x256024[_0x5c81('0x18')](_0x14e20a)['end']();};}function respondWithResult(_0x197479,_0x1a5728){_0x1a5728=_0x1a5728||0xc8;return function(_0x121c00){if(_0x121c00){return _0x197479[_0x5c81('0x18')](_0x1a5728)[_0x5c81('0x19')](_0x121c00);}};}function respondWithFilteredResult(_0x549bd1,_0x3d7009){return function(_0x3e2487){if(_0x3e2487){var _0x124e3a=typeof _0x3d7009[_0x5c81('0x1a')]==='undefined'&&typeof _0x3d7009['limit']==='undefined';var _0x1f190e=_0x3e2487[_0x5c81('0x1b')];var _0x190233=_0x124e3a?0x0:_0x3d7009[_0x5c81('0x1a')];var _0x32d374=_0x124e3a?_0x3e2487[_0x5c81('0x1b')]:_0x3d7009[_0x5c81('0x1a')]+_0x3d7009[_0x5c81('0x1c')];var _0x18ca33;if(_0x32d374>=_0x1f190e){_0x32d374=_0x1f190e;_0x18ca33=0xc8;}else{_0x18ca33=0xce;}_0x549bd1['status'](_0x18ca33);return _0x549bd1[_0x5c81('0x1d')]('Content-Range',_0x190233+'-'+_0x32d374+'/'+_0x1f190e)['json'](_0x3e2487);}return null;};}function patchUpdates(_0x5ca887){return function(_0x3e146f){try{jsonpatch[_0x5c81('0x1e')](_0x3e146f,_0x5ca887,!![]);}catch(_0x1b33d2){return BPromise[_0x5c81('0x1f')](_0x1b33d2);}return _0x3e146f[_0x5c81('0x20')]();};}function saveUpdates(_0x1e8d8b,_0x3830a0){return function(_0x249c17){if(_0x249c17){return _0x249c17[_0x5c81('0x21')](_0x1e8d8b)[_0x5c81('0x22')](function(_0x1c77e3){return _0x1c77e3;});}return null;};}function removeEntity(_0x1a02be,_0xfa73d){return function(_0x4f96c8){if(_0x4f96c8){return _0x4f96c8[_0x5c81('0x23')]()[_0x5c81('0x22')](function(){var _0x3ef49e=_0x4f96c8[_0x5c81('0x24')]({'plain':!![]});var _0x31e1bf='Companies';return db[_0x5c81('0x25')]['destroy']({'where':{'type':_0x31e1bf,'resourceId':_0x3ef49e['id']}})[_0x5c81('0x22')](function(){return _0x4f96c8;});})[_0x5c81('0x22')](function(){_0x1a02be[_0x5c81('0x18')](0xcc)[_0x5c81('0x26')]();});}};}function handleEntityNotFound(_0x18689c,_0x1ff427){return function(_0x477ab6){if(!_0x477ab6){_0x18689c[_0x5c81('0x27')](0x194);}return _0x477ab6;};}function handleError(_0x4a26d7,_0xf477a9){_0xf477a9=_0xf477a9||0x1f4;return function(_0x61d7a){logger['error'](_0x61d7a['stack']);if(_0x61d7a[_0x5c81('0x28')]){delete _0x61d7a[_0x5c81('0x28')];}_0x4a26d7[_0x5c81('0x18')](_0xf477a9)[_0x5c81('0x29')](_0x61d7a);};}exports[_0x5c81('0x2a')]=function(_0x267a4b,_0x566923){var _0x39934d={},_0x38f01a={},_0x373d01={'count':0x0,'rows':[]};return db[_0x5c81('0x2b')][_0x5c81('0x2c')]()[_0x5c81('0x22')](function(_0x461022){_0x38f01a['model']=_[_0x5c81('0x2d')](_0x461022);_0x38f01a[_0x5c81('0x2e')]=_[_0x5c81('0x2d')](_0x267a4b[_0x5c81('0x2e')]);_0x38f01a['filters']=_[_0x5c81('0x2f')](_0x38f01a[_0x5c81('0x30')],_0x38f01a[_0x5c81('0x2e')]);_0x39934d[_0x5c81('0x31')]=_[_0x5c81('0x2f')](_0x38f01a[_0x5c81('0x30')],qs[_0x5c81('0x32')](_0x267a4b['query']['fields']));_0x39934d[_0x5c81('0x31')]=_0x39934d[_0x5c81('0x31')][_0x5c81('0x33')]?_0x39934d[_0x5c81('0x31')]:_0x38f01a[_0x5c81('0x30')];if(!_0x267a4b[_0x5c81('0x2e')][_0x5c81('0x34')]('nolimit')){_0x39934d['limit']=qs[_0x5c81('0x1c')](_0x267a4b[_0x5c81('0x2e')][_0x5c81('0x1c')]);_0x39934d[_0x5c81('0x1a')]=qs['offset'](_0x267a4b[_0x5c81('0x2e')][_0x5c81('0x1a')]);}_0x39934d[_0x5c81('0x35')]=qs[_0x5c81('0x36')](_0x267a4b['query'][_0x5c81('0x36')]);_0x39934d[_0x5c81('0x37')]=qs['filters'](_[_0x5c81('0x38')](_0x267a4b['query'],_0x38f01a['filters']),_0x461022);if(_0x267a4b[_0x5c81('0x2e')][_0x5c81('0x39')]){_0x39934d['where']=_[_0x5c81('0x3a')](_0x39934d['where'],{'$or':_[_0x5c81('0x3b')](_0x39934d[_0x5c81('0x31')],function(_0x333649){var _0x9ecd38={};_0x9ecd38[_0x333649]={'$like':'%'+_0x267a4b[_0x5c81('0x2e')][_0x5c81('0x39')]+'%'};return _0x9ecd38;})});}_0x39934d=_['merge']({},_0x39934d,_0x267a4b['options']);var _0x41c97f={'where':_0x39934d['where']};return db['CmCompany'][_0x5c81('0x1b')](_0x41c97f)[_0x5c81('0x22')](function(_0x3b3161){_0x373d01[_0x5c81('0x1b')]=_0x3b3161;if(_0x267a4b['query'][_0x5c81('0x3c')]){_0x39934d['include']=[{'all':!![]}];}return db[_0x5c81('0x2b')][_0x5c81('0x3d')](_0x39934d);})[_0x5c81('0x22')](function(_0x1f40c9){_0x373d01[_0x5c81('0x3e')]=_0x1f40c9;return _0x373d01;})['then'](respondWithFilteredResult(_0x566923,_0x39934d))[_0x5c81('0x3f')](handleError(_0x566923,null));})['catch'](handleError(_0x566923,null));};exports['show']=function(_0x30985c,_0x5a80b9){var _0x152bd7={'raw':![],'where':{'id':_0x30985c[_0x5c81('0x40')]['id']}},_0x38642f={};_0x38642f[_0x5c81('0x30')]=_[_0x5c81('0x2d')](db['CmCompany'][_0x5c81('0x41')]);_0x38642f[_0x5c81('0x2e')]=_[_0x5c81('0x2d')](_0x30985c[_0x5c81('0x2e')]);_0x38642f[_0x5c81('0x42')]=_[_0x5c81('0x2f')](_0x38642f[_0x5c81('0x30')],_0x38642f[_0x5c81('0x2e')]);_0x152bd7['attributes']=_[_0x5c81('0x2f')](_0x38642f['model'],qs[_0x5c81('0x32')](_0x30985c[_0x5c81('0x2e')][_0x5c81('0x32')]));_0x152bd7[_0x5c81('0x31')]=_0x152bd7[_0x5c81('0x31')][_0x5c81('0x33')]?_0x152bd7[_0x5c81('0x31')]:_0x38642f[_0x5c81('0x30')];if(_0x30985c[_0x5c81('0x2e')]['includeAll']){_0x152bd7[_0x5c81('0x43')]=[{'all':!![]}];}_0x152bd7=_[_0x5c81('0x3a')]({},_0x152bd7,_0x30985c[_0x5c81('0x44')]);return db['CmCompany']['find'](_0x152bd7)['then'](handleEntityNotFound(_0x5a80b9,null))['then'](respondWithResult(_0x5a80b9,null))['catch'](handleError(_0x5a80b9,null));};exports[_0x5c81('0x45')]=function(_0x535e3a,_0xaa5e60){return db['CmCompany'][_0x5c81('0x45')](_0x535e3a[_0x5c81('0x46')],{})[_0x5c81('0x22')](function(_0x13027e){var _0x3e9b44=_0x535e3a[_0x5c81('0x47')]['get']({'plain':!![]});if(!_0x3e9b44)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e9b44[_0x5c81('0x48')]===_0x5c81('0x47')){var _0x441600=_0x13027e[_0x5c81('0x24')]({'plain':!![]});var _0x219ccc=_0x5c81('0x49');return db['UserProfileSection'][_0x5c81('0x4a')]({'where':{'name':_0x219ccc,'userProfileId':_0x3e9b44[_0x5c81('0x4b')]},'raw':!![]})[_0x5c81('0x22')](function(_0x2a6971){if(_0x2a6971&&_0x2a6971[_0x5c81('0x4c')]===0x0){return db[_0x5c81('0x25')][_0x5c81('0x45')]({'name':_0x441600[_0x5c81('0x28')],'resourceId':_0x441600['id'],'type':_0x2a6971[_0x5c81('0x28')],'sectionId':_0x2a6971['id']},{})['then'](function(){return _0x13027e;});}else{return _0x13027e;}})[_0x5c81('0x3f')](function(_0x381e51){logger['error'](_0x5c81('0x4d'),_0x381e51);throw _0x381e51;});}return _0x13027e;})[_0x5c81('0x22')](respondWithResult(_0xaa5e60,0xc9))[_0x5c81('0x3f')](handleError(_0xaa5e60,null));};exports['update']=function(_0x39a93a,_0x2da11b){if(_0x39a93a[_0x5c81('0x46')]['id']){delete _0x39a93a[_0x5c81('0x46')]['id'];}return db[_0x5c81('0x2b')][_0x5c81('0x4a')]({'where':{'id':_0x39a93a[_0x5c81('0x40')]['id']}})[_0x5c81('0x22')](handleEntityNotFound(_0x2da11b,null))[_0x5c81('0x22')](saveUpdates(_0x39a93a[_0x5c81('0x46')],null))[_0x5c81('0x22')](respondWithResult(_0x2da11b,null))[_0x5c81('0x3f')](handleError(_0x2da11b,null));};exports[_0x5c81('0x23')]=function(_0x2267ff,_0x4f43ab){return db[_0x5c81('0x2b')]['find']({'where':{'id':_0x2267ff[_0x5c81('0x40')]['id']}})[_0x5c81('0x22')](handleEntityNotFound(_0x4f43ab,null))[_0x5c81('0x22')](removeEntity(_0x4f43ab,null))['catch'](handleError(_0x4f43ab,null));};exports[_0x5c81('0x2c')]=function(_0x4c5a7d,_0x56df9e){return db[_0x5c81('0x2b')][_0x5c81('0x2c')]()['then'](respondWithResult(_0x56df9e,null))[_0x5c81('0x3f')](handleError(_0x56df9e,null));};exports[_0x5c81('0x4e')]=function(_0x35a51a,_0xf84bad,_0x102570){return db[_0x5c81('0x4f')][_0x5c81('0x4a')]({'where':{'id':_0x35a51a[_0x5c81('0x40')]['id']}})[_0x5c81('0x22')](handleEntityNotFound(_0xf84bad,null))[_0x5c81('0x22')](function(_0x4a30d8){if(_0x4a30d8){return _0x4a30d8['addContacts'](_0x35a51a[_0x5c81('0x46')][_0x5c81('0x50')],_[_0x5c81('0x51')](_0x35a51a[_0x5c81('0x46')],[_0x5c81('0x50'),'id'])||{});}})['then'](respondWithResult(_0xf84bad,null))[_0x5c81('0x3f')](handleError(_0xf84bad,null));};exports['getContacts']=function(_0x14aa9d,_0x260b68,_0x1de365){var _0x597d0b={};var _0x9781fc={};var _0x521eea;var _0x33b412;return db[_0x5c81('0x2b')][_0x5c81('0x52')]({'where':{'id':_0x14aa9d['params']['id']}})[_0x5c81('0x22')](handleEntityNotFound(_0x260b68,null))[_0x5c81('0x22')](function(_0x309c90){if(_0x309c90){_0x521eea=_0x309c90;_0x9781fc[_0x5c81('0x30')]=_[_0x5c81('0x2d')](db[_0x5c81('0x4f')][_0x5c81('0x41')]);_0x9781fc[_0x5c81('0x2e')]=_[_0x5c81('0x2d')](_0x14aa9d[_0x5c81('0x2e')]);_0x9781fc[_0x5c81('0x42')]=_[_0x5c81('0x2f')](_0x9781fc[_0x5c81('0x30')],_0x9781fc['query']);_0x597d0b[_0x5c81('0x31')]=_[_0x5c81('0x2f')](_0x9781fc['model'],qs[_0x5c81('0x32')](_0x14aa9d['query']['fields']));_0x597d0b[_0x5c81('0x31')]=_0x597d0b[_0x5c81('0x31')][_0x5c81('0x33')]?_0x597d0b['attributes']:_0x9781fc[_0x5c81('0x30')];_0x597d0b[_0x5c81('0x35')]=qs['sort'](_0x14aa9d[_0x5c81('0x2e')][_0x5c81('0x36')]);_0x597d0b[_0x5c81('0x37')]=qs[_0x5c81('0x42')](_[_0x5c81('0x38')](_0x14aa9d[_0x5c81('0x2e')],_0x9781fc[_0x5c81('0x42')]));if(_0x14aa9d[_0x5c81('0x2e')][_0x5c81('0x39')]){_0x597d0b[_0x5c81('0x37')]=_[_0x5c81('0x3a')](_0x597d0b['where'],{'$or':_[_0x5c81('0x3b')](_0x597d0b[_0x5c81('0x31')],function(_0x42e3fc){var _0x487e98={};_0x487e98[_0x42e3fc]={'$like':'%'+_0x14aa9d[_0x5c81('0x2e')][_0x5c81('0x39')]+'%'};return _0x487e98;})});}_0x597d0b=_[_0x5c81('0x3a')]({},_0x597d0b,_0x14aa9d[_0x5c81('0x44')]);return _0x521eea[_0x5c81('0x53')](_0x597d0b);}})['then'](function(_0x44a4a5){if(_0x44a4a5){_0x33b412=_0x44a4a5[_0x5c81('0x33')];if(!_0x14aa9d[_0x5c81('0x2e')][_0x5c81('0x34')](_0x5c81('0x54'))){_0x597d0b[_0x5c81('0x1c')]=qs[_0x5c81('0x1c')](_0x14aa9d[_0x5c81('0x2e')][_0x5c81('0x1c')]);_0x597d0b[_0x5c81('0x1a')]=qs[_0x5c81('0x1a')](_0x14aa9d['query'][_0x5c81('0x1a')]);}return _0x521eea['getContacts'](_0x597d0b);}})[_0x5c81('0x22')](function(_0x226420){if(_0x226420){return _0x226420?{'count':_0x33b412,'rows':_0x226420}:null;}})[_0x5c81('0x22')](respondWithResult(_0x260b68,null))[_0x5c81('0x3f')](handleError(_0x260b68,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index b8f369e..7b81260 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 _0xa9e4=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','CmCompany','cm_companies'];(function(_0x6fa8a4,_0x340079){var _0x1fd25b=function(_0x38fc6c){while(--_0x38fc6c){_0x6fa8a4['push'](_0x6fa8a4['shift']());}};_0x1fd25b(++_0x340079);}(_0xa9e4,0xc0));var _0x4a9e=function(_0x5a2f5d,_0x5dbf5d){_0x5a2f5d=_0x5a2f5d-0x0;var _0x33d3bd=_0xa9e4[_0x5a2f5d];return _0x33d3bd;};'use strict';var _=require(_0x4a9e('0x0'));var util=require(_0x4a9e('0x1'));var logger=require(_0x4a9e('0x2'))('api');var moment=require(_0x4a9e('0x3'));var BPromise=require(_0x4a9e('0x4'));var rp=require(_0x4a9e('0x5'));var fs=require('fs');var path=require(_0x4a9e('0x6'));var rimraf=require(_0x4a9e('0x7'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x4a9e('0x8')]=function(_0x3c5a8c,_0x5c0850){return _0x3c5a8c[_0x4a9e('0x9')](_0x4a9e('0xa'),attributes,{'tableName':_0x4a9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x667f=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x18f3dc,_0x1289b9){var _0x2a10c5=function(_0x37b935){while(--_0x37b935){_0x18f3dc['push'](_0x18f3dc['shift']());}};_0x2a10c5(++_0x1289b9);}(_0x667f,0x192));var _0xf667=function(_0x32e835,_0x4f2b26){_0x32e835=_0x32e835-0x0;var _0x3cef1b=_0x667f[_0x32e835];return _0x3cef1b;};'use strict';var _=require('lodash');var util=require(_0xf667('0x0'));var logger=require(_0xf667('0x1'))(_0xf667('0x2'));var moment=require('moment');var BPromise=require(_0xf667('0x3'));var rp=require(_0xf667('0x4'));var fs=require('fs');var path=require(_0xf667('0x5'));var rimraf=require('rimraf');var config=require(_0xf667('0x6'));var attributes=require(_0xf667('0x7'));module[_0xf667('0x8')]=function(_0x592201,_0x21c5d1){return _0x592201[_0xf667('0x9')](_0xf667('0xa'),attributes,{'tableName':_0xf667('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index c934fce..bc636a8 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 _0x89d9=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis'];(function(_0x2ea4f0,_0x420118){var _0x5c5877=function(_0x16f450){while(--_0x16f450){_0x2ea4f0['push'](_0x2ea4f0['shift']());}};_0x5c5877(++_0x420118);}(_0x89d9,0x80));var _0x989d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x89d9[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x989d('0x0'));var util=require('util');var moment=require(_0x989d('0x1'));var BPromise=require(_0x989d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x989d('0x3'));var db=require(_0x989d('0x4'))['db'];var utils=require(_0x989d('0x5'));var logger=require(_0x989d('0x6'))(_0x989d('0x7'));var config=require(_0x989d('0x8'));var jayson=require(_0x989d('0x9'));var client=jayson[_0x989d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1626f4,_0x1e9811,_0x3a9038){return new BPromise(function(_0x555838,_0x2d5a86){return client['request'](_0x1626f4,_0x3a9038)[_0x989d('0xb')](function(_0x1cd6e5){logger[_0x989d('0xc')](_0x989d('0xd'),_0x1e9811,'request\x20sent');logger[_0x989d('0xe')](_0x989d('0xf'),_0x1e9811,_0x989d('0x10'),JSON[_0x989d('0x11')](_0x1cd6e5));if(_0x1cd6e5[_0x989d('0x12')]){if(_0x1cd6e5[_0x989d('0x12')][_0x989d('0x13')]===0x1f4){logger[_0x989d('0x12')](_0x989d('0xd'),_0x1e9811,_0x1cd6e5[_0x989d('0x12')][_0x989d('0x14')]);return _0x2d5a86(_0x1cd6e5[_0x989d('0x12')]['message']);}logger[_0x989d('0x12')](_0x989d('0xd'),_0x1e9811,_0x1cd6e5[_0x989d('0x12')][_0x989d('0x14')]);return _0x555838(_0x1cd6e5[_0x989d('0x12')][_0x989d('0x14')]);}else{logger[_0x989d('0xc')]('CmCompany,\x20%s,\x20%s',_0x1e9811,_0x989d('0x10'));_0x555838(_0x1cd6e5['result']['message']);}})[_0x989d('0x15')](function(_0x15042d){logger[_0x989d('0x12')](_0x989d('0xd'),_0x1e9811,_0x15042d);_0x2d5a86(_0x15042d);});});} \ No newline at end of file +var _0xc430=['stringify','error','code','message','CmCompany,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc430,0xaf));var _0x0c43=function(_0x278a54,_0x8f113b){_0x278a54=_0x278a54-0x0;var _0x1e8b43=_0xc430[_0x278a54];return _0x1e8b43;};'use strict';var _=require(_0x0c43('0x0'));var util=require(_0x0c43('0x1'));var moment=require('moment');var BPromise=require(_0x0c43('0x2'));var rs=require(_0x0c43('0x3'));var fs=require('fs');var Redis=require(_0x0c43('0x4'));var db=require(_0x0c43('0x5'))['db'];var utils=require(_0x0c43('0x6'));var logger=require(_0x0c43('0x7'))(_0x0c43('0x8'));var config=require(_0x0c43('0x9'));var jayson=require(_0x0c43('0xa'));var client=jayson[_0x0c43('0xb')][_0x0c43('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31abbf,_0x3cdb8e,_0x9d71ea){return new BPromise(function(_0x492a9a,_0x59d536){return client[_0x0c43('0xd')](_0x31abbf,_0x9d71ea)[_0x0c43('0xe')](function(_0x4bb719){logger[_0x0c43('0xf')]('CmCompany,\x20%s,\x20%s',_0x3cdb8e,_0x0c43('0x10'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x3cdb8e,_0x0c43('0x10'),JSON[_0x0c43('0x11')](_0x4bb719));if(_0x4bb719[_0x0c43('0x12')]){if(_0x4bb719[_0x0c43('0x12')][_0x0c43('0x13')]===0x1f4){logger[_0x0c43('0x12')]('CmCompany,\x20%s,\x20%s',_0x3cdb8e,_0x4bb719['error'][_0x0c43('0x14')]);return _0x59d536(_0x4bb719[_0x0c43('0x12')][_0x0c43('0x14')]);}logger['error'](_0x0c43('0x15'),_0x3cdb8e,_0x4bb719['error'][_0x0c43('0x14')]);return _0x492a9a(_0x4bb719[_0x0c43('0x12')]['message']);}else{logger[_0x0c43('0xf')](_0x0c43('0x15'),_0x3cdb8e,'request\x20sent');_0x492a9a(_0x4bb719[_0x0c43('0x16')][_0x0c43('0x14')]);}})[_0x0c43('0x17')](function(_0x1c7b86){logger[_0x0c43('0x12')](_0x0c43('0x15'),_0x3cdb8e,_0x1c7b86);_0x59d536(_0x1c7b86);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 3dbcbb5..05676e8 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 _0x0d49=['show','/:id/contacts','getContacts','post','create','addContacts','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x18e17a,_0x207f88){var _0x1ab533=function(_0x556584){while(--_0x556584){_0x18e17a['push'](_0x18e17a['shift']());}};_0x1ab533(++_0x207f88);}(_0x0d49,0x19c));var _0x90d4=function(_0x4841a4,_0x426546){_0x4841a4=_0x4841a4-0x0;var _0x499763=_0x0d49[_0x4841a4];return _0x499763;};'use strict';var multer=require('multer');var util=require(_0x90d4('0x0'));var path=require('path');var timeout=require(_0x90d4('0x1'));var express=require(_0x90d4('0x2'));var router=express[_0x90d4('0x3')]();var fs_extra=require(_0x90d4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x90d4('0x5'));var config=require(_0x90d4('0x6'));var controller=require(_0x90d4('0x7'));router[_0x90d4('0x8')]('/',auth[_0x90d4('0x9')](),controller[_0x90d4('0xa')]);router[_0x90d4('0x8')](_0x90d4('0xb'),auth[_0x90d4('0x9')](),controller[_0x90d4('0xc')]);router[_0x90d4('0x8')]('/:id',auth[_0x90d4('0x9')](),controller[_0x90d4('0xd')]);router['get'](_0x90d4('0xe'),auth['isAuthenticated'](),controller[_0x90d4('0xf')]);router[_0x90d4('0x10')]('/',auth[_0x90d4('0x9')](),controller[_0x90d4('0x11')]);router[_0x90d4('0x10')](_0x90d4('0xe'),auth[_0x90d4('0x9')](),controller[_0x90d4('0x12')]);router[_0x90d4('0x13')](_0x90d4('0x14'),auth[_0x90d4('0x9')](),controller[_0x90d4('0x15')]);router[_0x90d4('0x16')](_0x90d4('0x14'),auth[_0x90d4('0x9')](),controller[_0x90d4('0x17')]);module[_0x90d4('0x18')]=router; \ No newline at end of file +var _0x2175=['describe','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x2175,0xa7));var _0x5217=function(_0x12d533,_0x2f6b8c){_0x12d533=_0x12d533-0x0;var _0x56f21b=_0x2175[_0x12d533];return _0x56f21b;};'use strict';var multer=require(_0x5217('0x0'));var util=require(_0x5217('0x1'));var path=require('path');var timeout=require(_0x5217('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5217('0x3'));var auth=require(_0x5217('0x4'));var interaction=require(_0x5217('0x5'));var config=require(_0x5217('0x6'));var controller=require('./cmCompany.controller');router[_0x5217('0x7')]('/',auth[_0x5217('0x8')](),controller['index']);router[_0x5217('0x7')]('/describe',auth[_0x5217('0x8')](),controller[_0x5217('0x9')]);router[_0x5217('0x7')]('/:id',auth[_0x5217('0x8')](),controller[_0x5217('0xa')]);router['get'](_0x5217('0xb'),auth[_0x5217('0x8')](),controller[_0x5217('0xc')]);router[_0x5217('0xd')]('/',auth[_0x5217('0x8')](),controller[_0x5217('0xe')]);router['post']('/:id/contacts',auth['isAuthenticated'](),controller[_0x5217('0xf')]);router[_0x5217('0x10')]('/:id',auth[_0x5217('0x8')](),controller[_0x5217('0x11')]);router[_0x5217('0x12')](_0x5217('0x13'),auth['isAuthenticated'](),controller[_0x5217('0x14')]);module[_0x5217('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 0cd6f45..cb5513a 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 _0x7039=['STRING','TEXT','DATE','NOW','INTEGER','lodash','sequelize','exports'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0x7039,0x11d));var _0x9703=function(_0x4831f1,_0x4e9161){_0x4831f1=_0x4831f1-0x0;var _0x1eee43=_0x7039[_0x4831f1];return _0x1eee43;};'use strict';var _=require(_0x9703('0x0'));var Sequelize=require(_0x9703('0x1'));module[_0x9703('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x9703('0x3')]},'street':{'type':Sequelize[_0x9703('0x3')]},'postalCode':{'type':Sequelize[_0x9703('0x3')]},'city':{'type':Sequelize[_0x9703('0x3')]},'country':{'type':Sequelize[_0x9703('0x3')]},'dateOfBirth':{'type':Sequelize[_0x9703('0x3')]},'description':{'type':Sequelize[_0x9703('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x9703('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x9703('0x3')]},'fb_data':{'type':Sequelize[_0x9703('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x9703('0x3')]},'teams':{'type':Sequelize[_0x9703('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x9703('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x9703('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x9703('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9703('0x5')],'defaultValue':Sequelize[_0x9703('0x6')]},'dialTimezone':{'type':Sequelize[_0x9703('0x3')]},'utcOffset':{'type':Sequelize[_0x9703('0x7')]}}; \ No newline at end of file +var _0xe150=['INTEGER','UNSIGNED','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe150,0x11b));var _0x0e15=function(_0x18d85e,_0x293097){_0x18d85e=_0x18d85e-0x0;var _0x1f7760=_0xe150[_0x18d85e];return _0x1f7760;};'use strict';var _=require(_0x0e15('0x0'));var Sequelize=require(_0x0e15('0x1'));module[_0x0e15('0x2')]={'firstName':{'type':Sequelize[_0x0e15('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0e15('0x3')]},'street':{'type':Sequelize[_0x0e15('0x3')]},'postalCode':{'type':Sequelize[_0x0e15('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0e15('0x4')]},'phone':{'type':Sequelize[_0x0e15('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x0e15('0x3')]},'email':{'type':Sequelize[_0x0e15('0x3')]},'url':{'type':Sequelize[_0x0e15('0x3')]},'facebook':{'type':Sequelize[_0x0e15('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x0e15('0x3')]},'skype':{'type':Sequelize[_0x0e15('0x3')]},'teams':{'type':Sequelize[_0x0e15('0x3')]},'viber':{'type':Sequelize[_0x0e15('0x3')]},'line':{'type':Sequelize[_0x0e15('0x3')]},'wechat':{'type':Sequelize[_0x0e15('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x0e15('0x5')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x0e15('0x5')](0x2)[_0x0e15('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x0e15('0x7')]},'dialTimezone':{'type':Sequelize[_0x0e15('0x3')]},'utcOffset':{'type':Sequelize[_0x0e15('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 62ca5ab..18be428 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 _0x73ac=['description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','count','includeAll','include','rows','getHopperHistories','ContactId','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','server/files/tmp','file','filename','chmodSync','0777','child_process','File\x20uploaded\x20correctly!','upload','createReadStream','import','User','agent','No\x20ListId\x20specified','binding','firstName','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','fork','stringify','message','start\x20child\x20process\x20correctly!','pid','error\x20child\x20process','importUpdates','getJourney','mail','openchannel','fax','whatsapp','voice','-createdAt','resolve','includes','toLowerCase','Invalid\x20channel','channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','createdAt','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','findAndCountAll','startCase','chat','Website','Account','secondDisposition','thirdDisposition','key','Tag','Tags','customerIp','customerPort','osName','ratingMessage','ratingType','ratingValue','subject','substatus','externalUrl','Interaction','Owner','sortBy','reverse','value','slice','bluebird','util','path','squel','papaparse','ioredis','../../config/environment/shared','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','status','json','offset','undefined','limit','set','Content-Range','update','destroy','then','end','sendStatus','stack','name','send','index','describe','findAll','query','user','catch','CmContact','find','params','tags','keys','length','cf_','columnName','displayName','analytics','CmCustomField','custom','type','info','forEach','hasOwnProperty','body','from','get','mergeWith','isArray','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','join','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','push','where','ListId','findOrCreate','spread','all','color','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','omit','map','cf_%d','pickBy','format','isEmpty','table','cm_contacts','id\x20=\x20?','toParam','text','values','phone','findOne','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','options','nolimit','getTags','setTags','OrderBy','items','item_types','ItemTypeId'];(function(_0x29a666,_0x5bbe75){var _0x56ec68=function(_0x22e71a){while(--_0x22e71a){_0x29a666['push'](_0x29a666['shift']());}};_0x56ec68(++_0x5bbe75);}(_0x73ac,0x165));var _0xc73a=function(_0x9d5d19,_0x57bdce){_0x9d5d19=_0x9d5d19-0x0;var _0x5c8284=_0x73ac[_0x9d5d19];return _0x5c8284;};'use strict';var moment=require('moment');var BPromise=require(_0xc73a('0x0'));var util=require(_0xc73a('0x1'));var path=require(_0xc73a('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc73a('0x3'));var Papa=require(_0xc73a('0x4'));var Redis=require(_0xc73a('0x5'));var contacts=require('../../components/contacts');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require('../../config/environment');var shared=require(_0xc73a('0x6'));var db=require(_0xc73a('0x7'))['db'];config[_0xc73a('0x8')]=_['defaults'](config['redis'],{'host':_0xc73a('0x9'),'port':0x18eb});var socket=require(_0xc73a('0xa'))(new Redis(config['redis']));require(_0xc73a('0xb'))['register'](socket);function respondWithResult(_0x2ac95d,_0x2484d9){_0x2484d9=_0x2484d9||0xc8;return function(_0x4266fb){if(_0x4266fb){return _0x2ac95d[_0xc73a('0xc')](_0x2484d9)[_0xc73a('0xd')](_0x4266fb);}};}function respondWithFilteredResult(_0x4e2fb6,_0x429d7f){return function(_0x113319){if(_0x113319){var _0x4ee571=typeof _0x429d7f[_0xc73a('0xe')]===_0xc73a('0xf')&&typeof _0x429d7f['limit']===_0xc73a('0xf');var _0x920c82=_0x113319['count'];var _0x59e6a1=_0x4ee571?0x0:_0x429d7f[_0xc73a('0xe')];var _0x3a9fff=_0x4ee571?_0x113319['count']:_0x429d7f['offset']+_0x429d7f[_0xc73a('0x10')];var _0x548626;if(_0x3a9fff>=_0x920c82){_0x3a9fff=_0x920c82;_0x548626=0xc8;}else{_0x548626=0xce;}_0x4e2fb6['status'](_0x548626);return _0x4e2fb6[_0xc73a('0x11')](_0xc73a('0x12'),_0x59e6a1+'-'+_0x3a9fff+'/'+_0x920c82)[_0xc73a('0xd')](_0x113319);}return null;};}function saveUpdates(_0x1554c5){return function(_0x2eb3dc){if(_0x2eb3dc){return _0x2eb3dc[_0xc73a('0x13')](_0x1554c5)['then'](function(_0x434436){return _0x434436;});}return null;};}function removeEntity(_0x443634){return function(_0x14b4bb){if(_0x14b4bb){return _0x14b4bb[_0xc73a('0x14')]()[_0xc73a('0x15')](function(){_0x443634[_0xc73a('0xc')](0xcc)[_0xc73a('0x16')]();});}};}function handleEntityNotFound(_0xba679e){return function(_0x233f69){if(!_0x233f69){_0xba679e[_0xc73a('0x17')](0x194);}return _0x233f69;};}function handleError(_0x26654c,_0x51d141){_0x51d141=_0x51d141||0x1f4;return function(_0x3aab07){logger['error'](_0x3aab07[_0xc73a('0x18')]);if(_0x3aab07[_0xc73a('0x19')]){delete _0x3aab07[_0xc73a('0x19')];}_0x26654c[_0xc73a('0xc')](_0x51d141)[_0xc73a('0x1a')](_0x3aab07);};}exports[_0xc73a('0x1b')]=function(_0x1128bb,_0x3f9016){var _0x2b8d56={};return contacts[_0xc73a('0x1c')]()['then'](function(_0x307ec8){_0x2b8d56=qs['getOptions'](_0x307ec8,_0x1128bb);return contacts[_0xc73a('0x1d')](_0x1128bb[_0xc73a('0x1e')],_0x1128bb[_0xc73a('0x1f')],_0x2b8d56,_0x307ec8);})[_0xc73a('0x15')](respondWithFilteredResult(_0x3f9016,_0x2b8d56))[_0xc73a('0x20')](handleError(_0x3f9016,null));};exports[_0xc73a('0x14')]=function(_0x4170c8,_0x283825){return db[_0xc73a('0x21')][_0xc73a('0x22')]({'where':{'id':_0x4170c8[_0xc73a('0x23')]['id']}})['then'](handleEntityNotFound(_0x283825,null))['then'](removeEntity(_0x283825,null))[_0xc73a('0x20')](handleError(_0x283825,null));};exports[_0xc73a('0x1c')]=function(_0x91ca05,_0x1f27ff){return db['CmContact'][_0xc73a('0x1c')]()[_0xc73a('0x15')](function(_0x44c1d1){delete _0x44c1d1[_0xc73a('0x24')];for(var _0x14bd1f=0x0;_0x14bd1f0x0){return new Promise(function(_0x2a5404){var _0x37b28d=[];for(var _0x57cd6e=0x0;_0x57cd6e<_0x3006ec[_0xc73a('0x26')];_0x57cd6e++){_0x37b28d[_0xc73a('0x58')](insertAdditionalPhones(_0x3006ec[_0x57cd6e]['contact'],_0x3006ec[_0x57cd6e][_0xc73a('0x53')]));}Promise[_0xc73a('0x5d')](_0x37b28d)[_0xc73a('0x15')](function(){_0x2a5404(0x1);});})[_0xc73a('0x15')](function(){return{'success':_0xeedec8,'failure':_0x1b2452,'duplicates':_0x477bfc};});}else{return{'success':_0xeedec8,'failure':_0x1b2452,'duplicates':_0x477bfc};}}})['then'](respondWithResult(_0x2f642a,0xc9))[_0xc73a('0x20')](handleError(_0x2f642a,null));};exports['show']=function(_0x1d364e,_0x4f9c39){var _0x36fdb4;return db[_0xc73a('0x21')][_0xc73a('0x1c')]()[_0xc73a('0x15')](function(_0x30be0d){return db[_0xc73a('0x21')][_0xc73a('0x22')]({'where':{'id':_0x1d364e[_0xc73a('0x23')]['id']},'include':[{'model':db['Tag'],'as':'Tags','attributes':['id',_0xc73a('0x19'),_0xc73a('0x5e')],'required':_0x1d364e['query']['tag']?!![]:![]},{'model':db['CmContactHasItem'],'as':_0xc73a('0x5f'),'where':{'CmContactId':_0x1d364e[_0xc73a('0x23')]['id']},'required':![],'include':[{'model':db[_0xc73a('0x60')],'as':_0xc73a('0x61')}]}],'order':[db[_0xc73a('0x62')][_0xc73a('0x63')](_0xc73a('0x64'))],'attributes':_['keys'](_0x30be0d)});})[_0xc73a('0x15')](function(_0xeb6dc5){if(!_[_0xc73a('0x4f')](_0xeb6dc5)){_0x36fdb4=_0xeb6dc5[_0xc73a('0x33')]({'plain':!![]});var _0xedea60={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xeb6dc5&&_0xeb6dc5[_0xc73a('0x5a')]){if(_0xeb6dc5[_0xc73a('0x5a')]){_0xedea60[_0xc73a('0x59')][_0xc73a('0x65')][_0xc73a('0x58')]({'ListId':{'$ne':_0xeb6dc5[_0xc73a('0x5a')]}});}}return db['CmCustomField'][_0xc73a('0x1d')](_0xedea60);}})[_0xc73a('0x15')](function(_0x120be2){if(!_[_0xc73a('0x4f')](_0x120be2)){return _[_0xc73a('0x66')](_0x36fdb4,_[_0xc73a('0x67')](_0x120be2,function(_0x5300d1){return util['format'](_0xc73a('0x68'),_0x5300d1['id']);}));}})[_0xc73a('0x15')](handleEntityNotFound(_0x4f9c39,null))[_0xc73a('0x15')](respondWithResult(_0x4f9c39,null))['catch'](handleError(_0x4f9c39,null));};exports[_0xc73a('0x13')]=function(_0x524b66,_0x2c0e72){var _0x1309d7;if(_0x524b66[_0xc73a('0x31')]['id']){delete _0x524b66[_0xc73a('0x31')]['id'];}if(!_[_0xc73a('0x4f')](_0x524b66[_0xc73a('0x31')]['dialTimezone'])){var _0x43a789=_0x524b66[_0xc73a('0x31')]['dialTimezone'];if(!_['isNil'](shared[_0xc73a('0x51')][_0x43a789]))_0x524b66[_0xc73a('0x31')][_0xc73a('0x52')]=shared[_0xc73a('0x51')][_0x43a789][_0xc73a('0x52')];}return db[_0xc73a('0x21')]['find']({'where':{'id':_0x524b66['params']['id']}})['then'](handleEntityNotFound(_0x2c0e72,null))[_0xc73a('0x15')](saveUpdates(_0x524b66[_0xc73a('0x31')],null))[_0xc73a('0x15')](function(_0x41025b){_0x1309d7=_0x41025b;var _0xd406fc={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x41025b&&_0x41025b[_0xc73a('0x5a')]){if(_0x41025b[_0xc73a('0x5a')]){_0xd406fc[_0xc73a('0x59')][_0xc73a('0x65')][_0xc73a('0x58')]({'ListId':{'$ne':_0x41025b[_0xc73a('0x5a')]}});}}return db[_0xc73a('0x2b')][_0xc73a('0x1d')](_0xd406fc);})[_0xc73a('0x15')](function(_0x113ea4){if(_0x113ea4){return _['omit'](_[_0xc73a('0x69')](_0x524b66['body'],function(_0x2c8796,_0x32c2ce){return _['startsWith'](_0x32c2ce,'cf_');}),_['map'](_0x113ea4,function(_0x168d58){return util[_0xc73a('0x6a')](_0xc73a('0x68'),_0x168d58['id']);}));}})[_0xc73a('0x15')](function(_0x25669c){if(_0x25669c&&!_[_0xc73a('0x6b')](_0x25669c)){var _0x179a04=squel[_0xc73a('0x13')]()[_0xc73a('0x6c')](_0xc73a('0x6d'))['setFields'](_0x25669c)[_0xc73a('0x59')](_0xc73a('0x6e'),_0x524b66['params']['id'])[_0xc73a('0x6f')]();return db[_0xc73a('0x62')][_0xc73a('0x1e')](_0x179a04[_0xc73a('0x70')],{'replacements':_0x179a04[_0xc73a('0x71')]});}})[_0xc73a('0x15')](function(){if(_0x524b66[_0xc73a('0x31')]['phone']&&_0x1309d7){return db[_0xc73a('0x37')]['update']({'phone':_0x524b66[_0xc73a('0x31')][_0xc73a('0x72')],'OrderBy':0x0},{'where':{'ContactId':_0x1309d7['id']}});}})['then'](function(){return _0x1309d7;})['then'](respondWithResult(_0x2c0e72,null))[_0xc73a('0x20')](handleError(_0x2c0e72,null));};exports['getTags']=function(_0x74b9a6,_0x510840){var _0x1a1866={};var _0x5aae9c={};var _0x4df41d;var _0x3d235f;return db[_0xc73a('0x21')][_0xc73a('0x73')]({'where':{'id':_0x74b9a6['params']['id']}})[_0xc73a('0x15')](handleEntityNotFound(_0x510840,null))[_0xc73a('0x15')](function(_0x41c06c){if(_0x41c06c){_0x4df41d=_0x41c06c;_0x5aae9c[_0xc73a('0x74')]=_[_0xc73a('0x25')](db['Tag'][_0xc73a('0x75')]);_0x5aae9c['query']=_[_0xc73a('0x25')](_0x74b9a6[_0xc73a('0x1e')]);_0x5aae9c[_0xc73a('0x76')]=_[_0xc73a('0x77')](_0x5aae9c[_0xc73a('0x74')],_0x5aae9c[_0xc73a('0x1e')]);_0x1a1866[_0xc73a('0x78')]=_[_0xc73a('0x77')](_0x5aae9c['model'],qs['fields'](_0x74b9a6[_0xc73a('0x1e')][_0xc73a('0x79')]));_0x1a1866['attributes']=_0x1a1866[_0xc73a('0x78')][_0xc73a('0x26')]?_0x1a1866[_0xc73a('0x78')]:_0x5aae9c['model'];_0x1a1866[_0xc73a('0x7a')]=qs[_0xc73a('0x7b')](_0x74b9a6[_0xc73a('0x1e')]['sort']);_0x1a1866['where']=qs[_0xc73a('0x76')](_[_0xc73a('0x7c')](_0x74b9a6[_0xc73a('0x1e')],_0x5aae9c[_0xc73a('0x76')]));if(_0x74b9a6['query'][_0xc73a('0x7d')]){_0x1a1866[_0xc73a('0x59')]=_[_0xc73a('0x7e')](_0x1a1866['where'],{'$or':_[_0xc73a('0x67')](_0x1a1866[_0xc73a('0x78')],function(_0x1bef09){var _0x399210={};_0x399210[_0x1bef09]={'$like':'%'+_0x74b9a6['query']['filter']+'%'};return _0x399210;})});}_0x1a1866=_[_0xc73a('0x7e')]({},_0x1a1866,_0x74b9a6[_0xc73a('0x7f')]);return _0x4df41d['getTags'](_0x1a1866);}})[_0xc73a('0x15')](function(_0x595283){if(_0x595283){_0x3d235f=_0x595283[_0xc73a('0x26')];if(!_0x74b9a6[_0xc73a('0x1e')][_0xc73a('0x30')](_0xc73a('0x80'))){_0x1a1866['limit']=qs[_0xc73a('0x10')](_0x74b9a6[_0xc73a('0x1e')]['limit']);_0x1a1866[_0xc73a('0xe')]=qs[_0xc73a('0xe')](_0x74b9a6[_0xc73a('0x1e')][_0xc73a('0xe')]);}return _0x4df41d[_0xc73a('0x81')](_0x1a1866);}})[_0xc73a('0x15')](function(_0xe28915){if(_0xe28915){return _0xe28915?{'count':_0x3d235f,'rows':_0xe28915}:null;}})['then'](respondWithResult(_0x510840,null))[_0xc73a('0x20')](handleError(_0x510840,null));};exports[_0xc73a('0x82')]=function(_0x12fcf1,_0x28a050){if(_0x12fcf1[_0xc73a('0x31')]['id']){delete _0x12fcf1[_0xc73a('0x31')]['id'];}return db[_0xc73a('0x21')][_0xc73a('0x73')]({'where':{'id':_0x12fcf1[_0xc73a('0x23')]['id']}})['then'](handleEntityNotFound(_0x28a050,null))[_0xc73a('0x15')](function(_0x53d07b){if(_0x53d07b){return _0x53d07b[_0xc73a('0x82')](_0x12fcf1['body']['ids']||[]);}return null;})[_0xc73a('0x15')](respondWithResult(_0x28a050,null))[_0xc73a('0x20')](handleError(_0x28a050,null));};exports['setAdditionalPhones']=function(_0x46a010,_0x2eb00d){var _0x112402=[];_0x112402[_0xc73a('0x58')](addAdditionalPhones(_0x46a010[_0xc73a('0x31')]));Promise['all'](_0x112402)[_0xc73a('0x15')](function(){_0x112402=[];_0x112402[_0xc73a('0x58')](deleteCmHopperPhones(_0x46a010[_0xc73a('0x31')]['id']));_0x112402[_0xc73a('0x58')](addCmHopperPhones(_0x46a010[_0xc73a('0x31')]['id']));Promise[_0xc73a('0x5d')](_0x112402)[_0xc73a('0x15')](function(){return[0x1];})['then'](respondWithResult(_0x2eb00d,null));});};function addAdditionalPhones(_0x4f9653){var _0x169263;return new Promise(function(_0x3b4e8e){return db[_0xc73a('0x43')][_0xc73a('0x14')]({'where':{'CmContactId':_0x4f9653['id']}})[_0xc73a('0x15')](function(){db[_0xc73a('0x60')][_0xc73a('0x1d')]({'raw':!![],'attributes':['id',_0xc73a('0x83')]})[_0xc73a('0x15')](function(_0x3e858d){var _0x1bb325=[];for(var _0x25b6e9=0x0;_0x25b6e9<_0x4f9653[_0xc73a('0x84')][_0xc73a('0x26')];_0x25b6e9++){var _0x599046=_0x4f9653[_0xc73a('0x85')]?_[_0xc73a('0x4f')](_0x4f9653[_0xc73a('0x85')][_0x25b6e9])?'':_0x4f9653[_0xc73a('0x85')][_0x25b6e9]:_0x4f9653[_0xc73a('0x84')][_0x25b6e9][_0xc73a('0x86')]?_0x4f9653[_0xc73a('0x84')][_0x25b6e9][_0xc73a('0x86')]:'';var _0x54ecd7=_[_0xc73a('0x4f')](_0x4f9653[_0xc73a('0x84')][_0x25b6e9][_0xc73a('0x87')])?'':_0x4f9653[_0xc73a('0x84')][_0x25b6e9][_0xc73a('0x87')];var _0x59de19=_0x599046+':'+_0x4f9653[_0xc73a('0x84')][_0x25b6e9]['phone']+'§'+_0x54ecd7;if(_[_0xc73a('0x4f')](_0x169263))_0x169263=_0x59de19;else _0x169263+=';'+_0x59de19;var _0x4db886=null;var _0x221b86=null;if(_0x4f9653[_0xc73a('0x85')]){if(!_[_0xc73a('0x4f')](_0x4f9653[_0xc73a('0x85')][_0x25b6e9])){_0x221b86=_[_0xc73a('0x22')](_0x3e858d,function(_0x174f83){return _0x174f83['id']===_0x4f9653[_0xc73a('0x85')][_0x25b6e9];});if(!_[_0xc73a('0x4f')](_0x221b86)){_0x4db886=_0x221b86[_0xc73a('0x83')];}}}else{if(!_[_0xc73a('0x4f')](_0x4f9653[_0xc73a('0x84')][_0x25b6e9])){_0x221b86=_['find'](_0x3e858d,function(_0x298003){return _0x298003['id']===_0x4f9653[_0xc73a('0x84')][_0x25b6e9][_0xc73a('0x86')];});if(!_['isNil'](_0x221b86)){_0x4db886=_0x25b6e9;}}}if(_['isNil'](_0x4db886)){_0x4db886=0x64;}_0x1bb325[_0xc73a('0x58')](addAdditionalPhone(_0x4f9653['id'],_0x4f9653[_0xc73a('0x84')][_0x25b6e9][_0xc73a('0x72')],_0x4f9653[_0xc73a('0x85')]?_['isNil'](_0x4f9653[_0xc73a('0x85')][_0x25b6e9])?null:_0x4f9653['item_types'][_0x25b6e9]:_0x4f9653['items'][_0x25b6e9][_0xc73a('0x86')]?_0x4f9653['items'][_0x25b6e9]['ItemTypeId']:null,_0x4db886,_0x54ecd7));}Promise[_0xc73a('0x5d')](_0x1bb325)[_0xc73a('0x15')](function(){db[_0xc73a('0x21')][_0xc73a('0x13')]({'AdditionalPhones':_0x169263},{'where':{'id':_0x4f9653['id']}})[_0xc73a('0x15')](function(){_0x3b4e8e(0x1);});});});});});}function addAdditionalPhone(_0x4d7b45,_0x5aa78f,_0x27d688,_0x49fcae,_0xa9d09e){return db[_0xc73a('0x43')][_0xc73a('0x22')]({'where':{'CmContactId':_0x4d7b45,'item':_0x5aa78f}})[_0xc73a('0x15')](function(_0x21b245){if(_0x21b245)logger[_0xc73a('0x2e')](_0xc73a('0x88'),_0x21b245);else{db[_0xc73a('0x43')][_0xc73a('0x39')]({'CmContactId':_0x4d7b45,'item':_0x5aa78f,'ItemTypeId':_0x27d688,'OrderBy':_0x49fcae,'ItemClass':_0xc73a('0x89'),'description':_0xa9d09e});}});}function deleteCmHopperPhones(_0x1164cd){return new Promise(function(_0x1e0070){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1164cd}})[_0xc73a('0x15')](function(_0x34c0fd){db[_0xc73a('0x8a')]['destroy']({'where':{'CmHopperId':{'$in':_[_0xc73a('0x67')](_0x34c0fd,'id')}}});})[_0xc73a('0x15')](function(){_0x1e0070(0x1);});});}function addCmHopperPhones(_0x4e2887){return new Promise(function(_0x1d9892){return db[_0xc73a('0x37')][_0xc73a('0x1d')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4e2887}})[_0xc73a('0x15')](function(_0x426b13){var _0x38d695=[];_[_0xc73a('0x67')](_0x426b13,function(_0x35267e){_0x38d695[_0xc73a('0x58')](createCmHopperPhone(_0x4e2887,_0x35267e['id']));});Promise[_0xc73a('0x5d')](_0x38d695)[_0xc73a('0x15')](function(){_0x1d9892(0x1);});});});}function createCmHopperPhone(_0x451a8a,_0x4a40b8){return new Promise(function(_0x5a3b7e){db['CmContactHasItem'][_0xc73a('0x1d')]({'raw':!![],'attributes':[_0xc73a('0x8b'),_0xc73a('0x83')],'where':{'CmContactId':_0x451a8a,'ItemClass':_0xc73a('0x89')},'include':[{'model':db[_0xc73a('0x60')],'attributes':['OrderBy'],'as':_0xc73a('0x61')}],'order':[_0xc73a('0x83'),db[_0xc73a('0x62')][_0xc73a('0x63')](_0xc73a('0x8c'))]})['then'](function(_0x399337){var _0x518a14=0x1;var _0x743e50=_[_0xc73a('0x67')](_0x399337,function(_0x4febaa){_0x4febaa[_0xc73a('0x8d')]=_0x4a40b8;_0x4febaa[_0xc73a('0x72')]=_0x4febaa[_0xc73a('0x8b')];_0x4febaa[_0xc73a('0x83')]=_0x518a14;delete _0x4febaa[_0xc73a('0x8e')];_0x518a14=_0x518a14+0x1;return _0x4febaa;});return db['CmHopperAdditionalPhone'][_0xc73a('0x54')](_0x743e50,{});})['then'](function(){_0x5a3b7e(0x1);});});}function insertAdditionalPhones(_0x464b65,_0x28d7a5){return new Promise(function(_0x46bb7c){var _0x48f460=[];for(var _0xf62251=0x0;_0xf62251<_0x28d7a5[_0xc73a('0x26')];_0xf62251++){var _0x187e05=_0x28d7a5[_0xf62251];_0x48f460[_0xc73a('0x58')](parseContactItemType(_0x187e05));}Promise[_0xc73a('0x5d')](_0x48f460)[_0xc73a('0x15')](function(){var _0x212434={'id':_0x464b65['id'],'items':_0x28d7a5};return addAdditionalPhones(_0x212434)[_0xc73a('0x15')](function(){return addCmHopperPhones(_0x464b65['id']);});})[_0xc73a('0x15')](function(){_0x46bb7c(_0x464b65);});});}function parseContactItemType(_0x3d17e5){return new Promise(function(_0x61fd7f){if(_0x3d17e5[_0xc73a('0x30')](_0xc73a('0x86'))){_0x61fd7f(_0x3d17e5);}else{return db['ContactItemType'][_0xc73a('0x22')]({'where':{'name':_0x3d17e5[_0xc73a('0x61')]}})['then'](function(_0x531d6f){if(_[_0xc73a('0x4f')](_0x531d6f))_0x3d17e5[_0xc73a('0x86')]=null;else _0x3d17e5[_0xc73a('0x86')]=_0x531d6f['id'];_0x61fd7f(_0x3d17e5);});}});}exports['getAdditionalPhones']=function(_0x1777a9,_0x1556d8){return db[_0xc73a('0x43')][_0xc73a('0x1d')]({'raw':!![],'where':{'CmContactId':_0x1777a9[_0xc73a('0x23')]['id'],'ItemClass':_0xc73a('0x89')},'include':[{'model':db[_0xc73a('0x60')],'as':_0xc73a('0x61')}],'order':[[_0xc73a('0x83')],[db[_0xc73a('0x62')][_0xc73a('0x63')](_0xc73a('0x8c'))]]})[_0xc73a('0x15')](function(_0x3b3f8d){return _0x3b3f8d;})[_0xc73a('0x15')](respondWithResult(_0x1556d8,null))[_0xc73a('0x20')](handleError(_0x1556d8,null));};exports[_0xc73a('0x8f')]=function(_0x1be2cc,_0x4388ed){return db['CmContactHasItem'][_0xc73a('0x1d')]({'raw':!![],'where':{'CmContactId':_0x1be2cc[_0xc73a('0x31')][_0xc73a('0x90')]}})['then'](function(_0x5a612e){var _0x13326c=_['map'](_0x5a612e,function(_0x3275e5){_0x3275e5[_0xc73a('0x91')]=_0x1be2cc['body'][_0xc73a('0x92')];return _0x3275e5;});return db['CmContactHasItem'][_0xc73a('0x54')](_0x13326c,{});})['then'](function(){return addCmHopperPhones(_0x1be2cc['body'][_0xc73a('0x92')]);})[_0xc73a('0x15')](function(){return['ok'];})['then'](respondWithResult(_0x4388ed,null))[_0xc73a('0x20')](handleError(_0x4388ed,null));};exports[_0xc73a('0x93')]=function(_0x4b42ef,_0x28cfac){var _0x36a67b=[];_0x36a67b['push'](createCmHopperPhone(_0x4b42ef[_0xc73a('0x31')]['id'],_0x4b42ef[_0xc73a('0x31')]['hopperId']));Promise[_0xc73a('0x5d')](_0x36a67b)[_0xc73a('0x15')](function(){return[0x1];})[_0xc73a('0x15')](respondWithResult(_0x28cfac,null));};exports[_0xc73a('0x94')]=function(_0x46626c,_0x549d3c){var _0x223411={'raw':![],'where':{}};var _0x100d45={};var _0xa654a1={'count':0x0,'rows':[]};return db[_0xc73a('0x21')][_0xc73a('0x73')]({'where':{'id':_0x46626c['params']['id']}})[_0xc73a('0x15')](handleEntityNotFound(_0x549d3c,null))[_0xc73a('0x15')](function(_0x6619ac){if(_0x6619ac){_0x100d45[_0xc73a('0x74')]=_['keys'](db[_0xc73a('0x37')][_0xc73a('0x75')]);_0x100d45[_0xc73a('0x1e')]=_['keys'](_0x46626c[_0xc73a('0x1e')]);_0x100d45[_0xc73a('0x76')]=_[_0xc73a('0x77')](_0x100d45[_0xc73a('0x74')],_0x100d45[_0xc73a('0x1e')]);_0x223411[_0xc73a('0x78')]=_['intersection'](_0x100d45[_0xc73a('0x74')],qs[_0xc73a('0x79')](_0x46626c[_0xc73a('0x1e')][_0xc73a('0x79')]));_0x223411[_0xc73a('0x78')]=_0x223411[_0xc73a('0x78')][_0xc73a('0x26')]?_0x223411[_0xc73a('0x78')]:_0x100d45['model'];if(!_0x46626c[_0xc73a('0x1e')][_0xc73a('0x30')]('nolimit')){_0x223411[_0xc73a('0x10')]=qs[_0xc73a('0x10')](_0x46626c[_0xc73a('0x1e')][_0xc73a('0x10')]);_0x223411[_0xc73a('0xe')]=qs[_0xc73a('0xe')](_0x46626c[_0xc73a('0x1e')][_0xc73a('0xe')]);}_0x223411[_0xc73a('0x7a')]=qs[_0xc73a('0x7b')](_0x46626c['query'][_0xc73a('0x7b')]);_0x223411['where']=qs[_0xc73a('0x76')](_[_0xc73a('0x7c')](_0x46626c[_0xc73a('0x1e')],_0x100d45[_0xc73a('0x76')]));_0x223411['where']['ContactId']=_0x6619ac['id'];if(_0x46626c[_0xc73a('0x1e')]['filter']){_0x223411[_0xc73a('0x59')]=_[_0xc73a('0x7e')](_0x223411['where'],{'$or':_[_0xc73a('0x67')](_0x223411[_0xc73a('0x78')],function(_0x2d6319){var _0x433100={};_0x433100[_0x2d6319]={'$like':'%'+_0x46626c['query'][_0xc73a('0x7d')]+'%'};return _0x433100;})});}_0x223411=_['merge']({},_0x223411,_0x46626c['options']);return db[_0xc73a('0x37')][_0xc73a('0x95')]({'where':_0x223411[_0xc73a('0x59')]})[_0xc73a('0x15')](function(_0x4c244e){_0xa654a1[_0xc73a('0x95')]=_0x4c244e;if(_0x46626c[_0xc73a('0x1e')][_0xc73a('0x96')]){_0x223411[_0xc73a('0x97')]=[{'all':!![]}];}return db[_0xc73a('0x37')][_0xc73a('0x1d')](_0x223411);})[_0xc73a('0x15')](function(_0x4ace07){_0xa654a1[_0xc73a('0x98')]=_0x4ace07;return _0xa654a1;});}})[_0xc73a('0x15')](respondWithFilteredResult(_0x549d3c,_0x223411))[_0xc73a('0x20')](handleError(_0x549d3c,null));};exports[_0xc73a('0x99')]=function(_0x278f03,_0x3ee548){var _0x593de7={'raw':!![],'where':{}};var _0x3eff79={};var _0x364f25={'count':0x0,'rows':[]};return db[_0xc73a('0x21')]['findOne']({'where':{'id':_0x278f03[_0xc73a('0x23')]['id']}})[_0xc73a('0x15')](handleEntityNotFound(_0x3ee548,null))[_0xc73a('0x15')](function(_0xdc9b27){if(_0xdc9b27){_0x3eff79[_0xc73a('0x74')]=_[_0xc73a('0x25')](db[_0xc73a('0x45')][_0xc73a('0x75')]);_0x3eff79[_0xc73a('0x1e')]=_[_0xc73a('0x25')](_0x278f03[_0xc73a('0x1e')]);_0x3eff79[_0xc73a('0x76')]=_['intersection'](_0x3eff79['model'],_0x3eff79[_0xc73a('0x1e')]);_0x593de7['attributes']=_[_0xc73a('0x77')](_0x3eff79[_0xc73a('0x74')],qs[_0xc73a('0x79')](_0x278f03['query']['fields']));_0x593de7[_0xc73a('0x78')]=_0x593de7[_0xc73a('0x78')][_0xc73a('0x26')]?_0x593de7['attributes']:_0x3eff79['model'];if(!_0x278f03[_0xc73a('0x1e')][_0xc73a('0x30')]('nolimit')){_0x593de7[_0xc73a('0x10')]=qs[_0xc73a('0x10')](_0x278f03[_0xc73a('0x1e')][_0xc73a('0x10')]);_0x593de7[_0xc73a('0xe')]=qs['offset'](_0x278f03[_0xc73a('0x1e')][_0xc73a('0xe')]);}_0x593de7['order']=qs['sort'](_0x278f03[_0xc73a('0x1e')]['sort']);_0x593de7[_0xc73a('0x59')]=qs['filters'](_[_0xc73a('0x7c')](_0x278f03[_0xc73a('0x1e')],_0x3eff79['filters']));_0x593de7[_0xc73a('0x59')][_0xc73a('0x9a')]=_0xdc9b27['id'];if(_0x278f03['query'][_0xc73a('0x7d')]){_0x593de7[_0xc73a('0x59')]=_[_0xc73a('0x7e')](_0x593de7['where'],{'$or':_[_0xc73a('0x67')](_0x593de7[_0xc73a('0x78')],function(_0x2a07eb){var _0x591a31={};_0x591a31[_0x2a07eb]={'$like':'%'+_0x278f03[_0xc73a('0x1e')][_0xc73a('0x7d')]+'%'};return _0x591a31;})});}_0x593de7=_[_0xc73a('0x7e')]({},_0x593de7,_0x278f03[_0xc73a('0x7f')]);return db['CmHopperHistory'][_0xc73a('0x95')]({'where':_0x593de7[_0xc73a('0x59')]})[_0xc73a('0x15')](function(_0x319f8b){_0x364f25[_0xc73a('0x95')]=_0x319f8b;if(_0x278f03[_0xc73a('0x1e')][_0xc73a('0x96')]){_0x593de7['include']=[{'all':!![]}];}return db[_0xc73a('0x45')][_0xc73a('0x1d')](_0x593de7);})['then'](function(_0x575d66){_0x364f25[_0xc73a('0x98')]=_0x575d66;return _0x364f25;});}})['then'](respondWithFilteredResult(_0x3ee548,_0x593de7))['catch'](handleError(_0x3ee548,null));};exports[_0xc73a('0x9b')]=function(_0x59f37f,_0x1a9cfe){var _0x1b79b3={'raw':!![],'where':{}};var _0x38cb82={};var _0x4768f6={'count':0x0,'rows':[]};return db[_0xc73a('0x21')][_0xc73a('0x73')]({'where':{'id':_0x59f37f[_0xc73a('0x23')]['id']}})[_0xc73a('0x15')](handleEntityNotFound(_0x1a9cfe,null))[_0xc73a('0x15')](function(_0x1ff1d5){if(_0x1ff1d5){_0x38cb82[_0xc73a('0x74')]=_[_0xc73a('0x25')](db['CmHopperFinal'][_0xc73a('0x75')]);_0x38cb82['query']=_['keys'](_0x59f37f[_0xc73a('0x1e')]);_0x38cb82['filters']=_['intersection'](_0x38cb82[_0xc73a('0x74')],_0x38cb82[_0xc73a('0x1e')]);_0x1b79b3[_0xc73a('0x78')]=_[_0xc73a('0x77')](_0x38cb82['model'],qs[_0xc73a('0x79')](_0x59f37f[_0xc73a('0x1e')][_0xc73a('0x79')]));_0x1b79b3[_0xc73a('0x78')]=_0x1b79b3[_0xc73a('0x78')][_0xc73a('0x26')]?_0x1b79b3['attributes']:_0x38cb82[_0xc73a('0x74')];if(!_0x59f37f['query'][_0xc73a('0x30')](_0xc73a('0x80'))){_0x1b79b3[_0xc73a('0x10')]=qs[_0xc73a('0x10')](_0x59f37f['query'][_0xc73a('0x10')]);_0x1b79b3[_0xc73a('0xe')]=qs[_0xc73a('0xe')](_0x59f37f[_0xc73a('0x1e')][_0xc73a('0xe')]);}_0x1b79b3['order']=qs[_0xc73a('0x7b')](_0x59f37f[_0xc73a('0x1e')][_0xc73a('0x7b')]);_0x1b79b3[_0xc73a('0x59')]=qs['filters'](_['pick'](_0x59f37f[_0xc73a('0x1e')],_0x38cb82['filters']));_0x1b79b3[_0xc73a('0x59')]['ContactId']=_0x1ff1d5['id'];if(_0x59f37f[_0xc73a('0x1e')][_0xc73a('0x7d')]){_0x1b79b3[_0xc73a('0x59')]=_[_0xc73a('0x7e')](_0x1b79b3[_0xc73a('0x59')],{'$or':_[_0xc73a('0x67')](_0x1b79b3[_0xc73a('0x78')],function(_0x4d97a7){var _0x4d69fd={};_0x4d69fd[_0x4d97a7]={'$like':'%'+_0x59f37f[_0xc73a('0x1e')][_0xc73a('0x7d')]+'%'};return _0x4d69fd;})});}_0x1b79b3=_[_0xc73a('0x7e')]({},_0x1b79b3,_0x59f37f[_0xc73a('0x7f')]);return db[_0xc73a('0x44')][_0xc73a('0x95')]({'where':_0x1b79b3[_0xc73a('0x59')]})[_0xc73a('0x15')](function(_0x3e7d6f){_0x4768f6['count']=_0x3e7d6f;if(_0x59f37f[_0xc73a('0x1e')][_0xc73a('0x96')]){_0x1b79b3[_0xc73a('0x97')]=[{'all':!![]}];}return db[_0xc73a('0x44')][_0xc73a('0x1d')](_0x1b79b3);})[_0xc73a('0x15')](function(_0x88d67){_0x4768f6[_0xc73a('0x98')]=_0x88d67;return _0x4768f6;});}})[_0xc73a('0x15')](respondWithFilteredResult(_0x1a9cfe,_0x1b79b3))[_0xc73a('0x20')](handleError(_0x1a9cfe,null));};exports[_0xc73a('0x9c')]=function(_0x507e1f,_0x1e0ed8){var _0x1b16fb={'raw':!![],'where':{}};var _0x314c15={};var _0x27f389={'count':0x0,'rows':[]};return db[_0xc73a('0x21')][_0xc73a('0x73')]({'where':{'id':_0x507e1f[_0xc73a('0x23')]['id']}})[_0xc73a('0x15')](handleEntityNotFound(_0x1e0ed8,null))[_0xc73a('0x15')](function(_0x274642){if(_0x274642){_0x314c15[_0xc73a('0x74')]=_['keys'](db[_0xc73a('0x4b')]['rawAttributes']);_0x314c15[_0xc73a('0x1e')]=_[_0xc73a('0x25')](_0x507e1f[_0xc73a('0x1e')]);_0x314c15['filters']=_[_0xc73a('0x77')](_0x314c15[_0xc73a('0x74')],_0x314c15[_0xc73a('0x1e')]);_0x1b16fb[_0xc73a('0x78')]=_[_0xc73a('0x77')](_0x314c15[_0xc73a('0x74')],qs[_0xc73a('0x79')](_0x507e1f[_0xc73a('0x1e')][_0xc73a('0x79')]));_0x1b16fb['attributes']=_0x1b16fb['attributes'][_0xc73a('0x26')]?_0x1b16fb[_0xc73a('0x78')]:_0x314c15['model'];if(!_0x507e1f[_0xc73a('0x1e')][_0xc73a('0x30')]('nolimit')){_0x1b16fb['limit']=qs[_0xc73a('0x10')](_0x507e1f['query']['limit']);_0x1b16fb[_0xc73a('0xe')]=qs[_0xc73a('0xe')](_0x507e1f['query'][_0xc73a('0xe')]);}_0x1b16fb[_0xc73a('0x7a')]=qs[_0xc73a('0x7b')](_0x507e1f['query']['sort']);_0x1b16fb['where']=qs[_0xc73a('0x76')](_[_0xc73a('0x7c')](_0x507e1f[_0xc73a('0x1e')],_0x314c15[_0xc73a('0x76')]));_0x1b16fb[_0xc73a('0x59')][_0xc73a('0x9a')]=_0x274642['id'];if(_0x507e1f[_0xc73a('0x1e')][_0xc73a('0x7d')]){_0x1b16fb[_0xc73a('0x59')]=_[_0xc73a('0x7e')](_0x1b16fb['where'],{'$or':_[_0xc73a('0x67')](_0x1b16fb[_0xc73a('0x78')],function(_0x4f6882){var _0x5902ce={};_0x5902ce[_0x4f6882]={'$like':'%'+_0x507e1f[_0xc73a('0x1e')]['filter']+'%'};return _0x5902ce;})});}_0x1b16fb=_[_0xc73a('0x7e')]({},_0x1b16fb,_0x507e1f[_0xc73a('0x7f')]);return db[_0xc73a('0x4b')][_0xc73a('0x95')]({'where':_0x1b16fb['where']})[_0xc73a('0x15')](function(_0x338e7b){_0x27f389[_0xc73a('0x95')]=_0x338e7b;if(_0x507e1f[_0xc73a('0x1e')][_0xc73a('0x96')]){_0x1b16fb[_0xc73a('0x97')]=[{'all':!![]}];}return db[_0xc73a('0x4b')][_0xc73a('0x1d')](_0x1b16fb);})['then'](function(_0x5f4352){_0x27f389[_0xc73a('0x98')]=_0x5f4352;return _0x27f389;});}})[_0xc73a('0x15')](respondWithFilteredResult(_0x1e0ed8,_0x1b16fb))[_0xc73a('0x20')](handleError(_0x1e0ed8,null));};exports[_0xc73a('0x9d')]=function(_0x555d6c,_0xcf2103){try{if(!_0x555d6c['body']['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x555d6c['body'][_0xc73a('0x9e')]){throw new Error(_0xc73a('0x9f'));}if(!_0x555d6c[_0xc73a('0x31')][_0xc73a('0xa0')]){throw new Error(_0xc73a('0xa1'));}if(!_0x555d6c[_0xc73a('0x31')][_0xc73a('0xa2')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x34754e=_0x555d6c[_0xc73a('0x31')]['binding_keys'][_0xc73a('0xa3')](',');var _0x17dba3=_0x555d6c[_0xc73a('0x31')][_0xc73a('0xa0')][_0xc73a('0xa3')](',');if(!_0x34754e['length']||!_0x17dba3[_0xc73a('0x26')]||_0x34754e[_0xc73a('0x26')]!==_0x17dba3[_0xc73a('0x26')]){throw new Error(_0xc73a('0xa4'));}_0x555d6c[_0xc73a('0x31')][_0xc73a('0x79')]=_[_0xc73a('0xa5')](_0x34754e,_0x17dba3);if(!_0x555d6c[_0xc73a('0x31')][_0xc73a('0x79')][_0xc73a('0x72')]){throw new Error(_0xc73a('0xa6'));}if(!_0x555d6c[_0xc73a('0x31')][_0xc73a('0x79')]['firstName']){throw new Error('No\x20firstName\x20column\x20specified');}var _0x5dfa85=path['join'](config['root'],_0xc73a('0xa7'),_0x555d6c[_0xc73a('0xa8')][_0xc73a('0xa9')]);fs[_0xc73a('0xaa')](_0x5dfa85,parseInt(_0xc73a('0xab'),0x8));var _0x5f33bb=require(_0xc73a('0xac'))['fork'](path[_0xc73a('0x4e')](__dirname,'../../components/import/cm/csv'),[_0x5dfa85,_0x555d6c['body']['binding_keys'],_0x555d6c[_0xc73a('0x31')][_0xc73a('0xa0')],_0x555d6c[_0xc73a('0x31')][_0xc73a('0x5a')],_0x555d6c[_0xc73a('0x31')]['CompanyId'],_0x555d6c[_0xc73a('0x31')][_0xc73a('0x56')],_0x555d6c['body']['socket_timestamp']]);return _0xcf2103[_0xc73a('0xc')](0xc8)[_0xc73a('0xd')]({'message':_0xc73a('0xad'),'pid':_0x5f33bb['pid']});}catch(_0x39c9b5){return _0xcf2103[_0xc73a('0xc')](0x1f4)['send'](_0x39c9b5);}};exports[_0xc73a('0xae')]=function(_0x4764ab,_0x175d07){var _0x5e550e=fs[_0xc73a('0xaf')](_0x4764ab[_0xc73a('0xa8')][_0xc73a('0x2')]);Papa['parse'](_0x5e550e,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x25d809){return _0x175d07[_0xc73a('0xc')](0xc8)[_0xc73a('0xd')]({'file':_0x4764ab[_0xc73a('0xa8')],'fields':_0x25d809['meta'][_0xc73a('0x79')]});}});};exports[_0xc73a('0xb0')]=function(_0x37856d,_0x4ee661){return db[_0xc73a('0xb1')][_0xc73a('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0xc73a('0xb2')}})[_0xc73a('0x15')](function(_0x49bc4c){var _0xacf187=![];if(!_0x37856d[_0xc73a('0x31')][_0xc73a('0x5a')]){throw new Error(_0xc73a('0xb3'));}if(!_0x37856d[_0xc73a('0x31')][_0xc73a('0xb4')][_0xc73a('0x72')]){throw new Error(_0xc73a('0xa6'));}if(!_0x37856d[_0xc73a('0x31')][_0xc73a('0xb4')][_0xc73a('0xb5')]){throw new Error(_0xc73a('0xb6'));}if(!_0x37856d[_0xc73a('0x31')][_0xc73a('0xa2')]){throw new Error(_0xc73a('0xb7'));}var _0x4ea304=require('child_process')[_0xc73a('0xb8')](path[_0xc73a('0x4e')](__dirname,'../../components/import/cm/csv2'),[_0x37856d['params']['id'],JSON[_0xc73a('0xb9')](_0x37856d[_0xc73a('0x31')]),JSON[_0xc73a('0xb9')](_0x49bc4c)]);_0x4ea304['on'](_0xc73a('0xba'),function(){_0xacf187=!![];return _0x4ee661[_0xc73a('0xc')](0xc8)[_0xc73a('0xd')]({'message':_0xc73a('0xbb'),'pid':_0x4ea304[_0xc73a('0xbc')]});});_0x4ea304['on']('exit',function(_0x51f206){if(_0x51f206&&!_0xacf187){return _0x4ee661[_0xc73a('0xc')](0x1f4)['json']({'message':_0xc73a('0xbd'),'pid':_0x4ea304[_0xc73a('0xbc')]});}});})['catch'](handleError(_0x4ee661,null));};exports[_0xc73a('0xbe')]=function(_0x1f57d5,_0x3d4a3e){return db['User'][_0xc73a('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0xc73a('0x15')](function(_0x628f9a){var _0x123975=![];if(!_0x1f57d5[_0xc73a('0x31')][_0xc73a('0x5a')]){throw new Error('No\x20ListId\x20specified');}if(!_0x1f57d5['body'][_0xc73a('0xb4')]['phone']){throw new Error(_0xc73a('0xa6'));}if(!_0x1f57d5['body'][_0xc73a('0xb4')]['firstName']){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x1f57d5[_0xc73a('0x31')][_0xc73a('0xa2')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x4b916a=require(_0xc73a('0xac'))[_0xc73a('0xb8')](path[_0xc73a('0x4e')](__dirname,'../../components/import/cm/csvUpdates'),[_0x1f57d5[_0xc73a('0x23')]['id'],JSON[_0xc73a('0xb9')](_0x1f57d5[_0xc73a('0x31')]),JSON[_0xc73a('0xb9')](_0x628f9a)]);_0x4b916a['on'](_0xc73a('0xba'),function(){_0x123975=!![];return _0x3d4a3e[_0xc73a('0xc')](0xc8)['json']({'message':_0xc73a('0xbb'),'pid':_0x4b916a['pid']});});_0x4b916a['on']('exit',function(_0x31618e){if(_0x31618e&&!_0x123975){return _0x3d4a3e['status'](0x1f4)[_0xc73a('0xd')]({'message':_0xc73a('0xbd'),'pid':_0x4b916a[_0xc73a('0xbc')]});}});})[_0xc73a('0x20')](handleError(_0x3d4a3e,null));};exports[_0xc73a('0xbf')]=function(_0x263142,_0x4f90c9){var _0xa225f4=[_0xc73a('0xc0'),'chat','sms',_0xc73a('0xc1'),_0xc73a('0xc2'),_0xc73a('0xc3'),_0xc73a('0xc4')];var _0x1b921f={'offset':0x0,'order':qs[_0xc73a('0x7b')](_0xc73a('0xc5'))},_0x401f40={'count':0x0,'rows':[]};Promise[_0xc73a('0xc6')]()[_0xc73a('0x15')](function(){if(_0x263142[_0xc73a('0x1e')]['channel']){if(!_[_0xc73a('0xc7')](_0xa225f4,_0x263142[_0xc73a('0x1e')]['channel'][_0xc73a('0xc8')]())){throw new Error(_0xc73a('0xc9'));}_0xa225f4=[_0x263142['query'][_0xc73a('0xca')][_0xc73a('0xc8')]()];}if(_0x263142[_0xc73a('0x1e')][_0xc73a('0xcb')]){try{var _0x12e21d=JSON[_0xc73a('0xcc')](_0x263142[_0xc73a('0x1e')][_0xc73a('0xcb')]);if(!moment(_0x12e21d[_0xc73a('0x32')])[_0xc73a('0xcd')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x12e21d['to'])[_0xc73a('0xcd')]()){throw new Error(_0xc73a('0xce'));}}catch(_0x26cadb){throw new Error(_0xc73a('0xcf'));}}if(!_0x263142['query'][_0xc73a('0x30')](_0xc73a('0x80'))){_0x1b921f[_0xc73a('0x10')]=qs[_0xc73a('0x10')](_0x263142[_0xc73a('0x1e')][_0xc73a('0x10')]||0xa);_0x1b921f[_0xc73a('0xe')]=qs[_0xc73a('0xe')](_0x263142[_0xc73a('0x1e')][_0xc73a('0xe')]);}var _0x397427=_0xa225f4[_0xc73a('0x67')](function(_0x3ab99c){if(_0x3ab99c===_0xc73a('0xc4')){var _0x2fb63b={'attributes':['id',_0xc73a('0xd0'),'type',_0xc73a('0xd1'),_0xc73a('0xd2'),_0xc73a('0xd3'),_0xc73a('0xd4'),'endtime',_0xc73a('0xd5'),_0xc73a('0xd6'),_0xc73a('0xd7'),'userDisposition',_0xc73a('0xd8'),_0xc73a('0xd9'),_0xc73a('0xda')],'where':{'ContactId':_0x263142[_0xc73a('0x23')]['id']},'include':[{'model':db[_0xc73a('0xb1')],'as':_0xc73a('0xb1'),'attributes':['id',_0xc73a('0x19'),_0xc73a('0xdb'),'alias']}],'order':[[_0xc73a('0xd7'),_0xc73a('0xdc')]]};if(_0x263142[_0xc73a('0x1e')][_0xc73a('0xcb')]){_0x2fb63b[_0xc73a('0x59')][_0xc73a('0xd7')]={'$gte':_0x12e21d[_0xc73a('0x32')],'$lte':_0x12e21d['to']};}return db['VoiceCallReport'][_0xc73a('0xdd')](_0x2fb63b)[_0xc73a('0x15')](function(_0x254ef8){_0x401f40['count']+=_0x254ef8[_0xc73a('0x95')];return _['map'](_0x254ef8[_0xc73a('0x98')],function(_0x9da7d7){var _0x374701=_0x9da7d7[_0xc73a('0x33')]({'plain':!![]});_0x374701[_0xc73a('0xca')]=_0x3ab99c;if(_0x374701[_0xc73a('0xb1')]){_0x374701['User']={'id':_0x374701[_0xc73a('0xb1')]['id'],'name':_0x374701[_0xc73a('0xb1')][_0xc73a('0x19')],'fullname':_0x374701[_0xc73a('0xb1')]['fullname'],'alias':_0x374701[_0xc73a('0xb1')]['alias']};}return _0x374701;});});}else{var _0x5c4e9c=_[_0xc73a('0xde')](_0x3ab99c)+(_0x3ab99c===_0xc73a('0xdf')?_0xc73a('0xe0'):_0xc73a('0xe1'));var _0x437846={'attributes':['id','closed','closedAt',_0xc73a('0xd7'),_0xc73a('0xd6'),'disposition',_0xc73a('0xe2'),_0xc73a('0xe3'),_0xc73a('0xda'),_0x5c4e9c+'Id'],'where':{'ContactId':_0x263142[_0xc73a('0x23')]['id']},'include':[{'model':db[_0x5c4e9c],'as':_0xc73a('0xe1'),'attributes':['id',_0xc73a('0x19'),_0xc73a('0xe4')]},{'model':db[_0xc73a('0xb1')],'as':'Owner','attributes':['id','name',_0xc73a('0xdb')]},{'model':db[_0xc73a('0xe5')],'as':_0xc73a('0xe6'),'attributes':['id',_0xc73a('0x19'),'color'],'through':{'attributes':[]}}],'order':[[_0xc73a('0xd7'),_0xc73a('0xdc')]]};if(_0x263142[_0xc73a('0x1e')]['range']){_0x437846[_0xc73a('0x59')][_0xc73a('0xd7')]={'$gte':_0x12e21d['from'],'$lte':_0x12e21d['to']};}switch(_0x3ab99c){case _0xc73a('0xdf'):_0x437846[_0xc73a('0x78')][_0xc73a('0x58')]('browserName',_0xc73a('0xe7'),_0xc73a('0xe8'),'deviceModel',_0xc73a('0xe9'),_0xc73a('0xea'),_0xc73a('0xeb'),_0xc73a('0xec'),'referer');break;case _0xc73a('0xc0'):_0x437846['attributes'][_0xc73a('0x58')](_0xc73a('0xed'),_0xc73a('0xee'));break;case _0xc73a('0xc1'):_0x437846['attributes']['push'](_0xc73a('0xef'),'threadId');break;}return db[_['startCase'](_0x3ab99c)+_0xc73a('0xf0')][_0xc73a('0xdd')](_0x437846)['then'](function(_0x20f640){_0x401f40[_0xc73a('0x95')]+=_0x20f640[_0xc73a('0x95')];return _[_0xc73a('0x67')](_0x20f640['rows'],function(_0x38ecb5){var _0x3ddf32=_0x38ecb5[_0xc73a('0x33')]({'plain':!![]});_0x3ddf32[_0xc73a('0xca')]=_0x3ab99c;if(_0x3ddf32['Owner']){_0x3ddf32['Owner']={'id':_0x3ddf32[_0xc73a('0xf1')]['id'],'name':_0x3ddf32[_0xc73a('0xf1')][_0xc73a('0x19')],'fullname':_0x3ddf32[_0xc73a('0xf1')][_0xc73a('0xdb')]};}return _0x3ddf32;});});}});return Promise[_0xc73a('0x5d')](_0x397427);})[_0xc73a('0x15')](function(_0x787c2c){return _(_0x787c2c)['flatten']()[_0xc73a('0xf2')](_0xc73a('0xd7'))[_0xc73a('0xf3')]()[_0xc73a('0xf4')]();})['then'](function(_0x5bdbb9){_0x401f40[_0xc73a('0x98')]=_0x1b921f[_0xc73a('0x10')]?_0x5bdbb9[_0xc73a('0xf5')](_0x1b921f[_0xc73a('0xe')],_0x1b921f[_0xc73a('0xe')]+_0x1b921f[_0xc73a('0x10')]):_0x5bdbb9;return _0x401f40;})['then'](respondWithFilteredResult(_0x4f90c9,_0x1b921f))[_0xc73a('0x20')](handleError(_0x4f90c9,null));}; \ No newline at end of file +var _0xda27=['find','params','describe','tags','keys','length','startsWith','columnName','displayName','analytics','cf_','custom','type','values','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','create','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','contact','all','show','Tag','Tags','color','tag','Phones','ItemType','literal','Phones.OrderBy','$and','omit','format','cf_%d','CmCustomField','pickBy','map','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','phone','getTags','findOne','model','rawAttributes','intersection','fields','attributes','sort','filters','pick','filter','options','setTags','ids','setAdditionalPhones','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','getAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','nolimit','order','ContactId','includeAll','rows','getHopperHistories','getHopperFinals','include','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','pid','upload','createReadStream','file','parse','User','agent','binding','No\x20phone\x20column\x20specified','socket_timestamp','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','getJourney','mail','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','callerid','starttime','endtime','duration','note','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','createdAt','DESC','findAndCountAll','startCase','chat','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer','subject','substatus','openchannel','threadId','Interaction','flatten','sortBy','reverse','value','slice','moment','bluebird','util','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','end','sendStatus','error','name','send','index','getOptions','findAll','query','user','catch','CmContact'];(function(_0x3b25e8,_0x548a8f){var _0x4db9fa=function(_0x20cfda){while(--_0x20cfda){_0x3b25e8['push'](_0x3b25e8['shift']());}};_0x4db9fa(++_0x548a8f);}(_0xda27,0x1e8));var _0x7da2=function(_0x4165cc,_0x1b4780){_0x4165cc=_0x4165cc-0x0;var _0x5e3a4c=_0xda27[_0x4165cc];return _0x5e3a4c;};'use strict';var moment=require(_0x7da2('0x0'));var BPromise=require(_0x7da2('0x1'));var util=require(_0x7da2('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x7da2('0x3'));var Papa=require(_0x7da2('0x4'));var Redis=require(_0x7da2('0x5'));var contacts=require(_0x7da2('0x6'));var qs=require(_0x7da2('0x7'));var logger=require('../../config/logger')(_0x7da2('0x8'));var config=require(_0x7da2('0x9'));var shared=require(_0x7da2('0xa'));var db=require(_0x7da2('0xb'))['db'];config[_0x7da2('0xc')]=_[_0x7da2('0xd')](config[_0x7da2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7da2('0xe'))(new Redis(config[_0x7da2('0xc')]));require(_0x7da2('0xf'))[_0x7da2('0x10')](socket);function respondWithResult(_0x49c0b3,_0x158d88){_0x158d88=_0x158d88||0xc8;return function(_0x138afd){if(_0x138afd){return _0x49c0b3[_0x7da2('0x11')](_0x158d88)[_0x7da2('0x12')](_0x138afd);}};}function respondWithFilteredResult(_0x53aa63,_0x3c4eb6){return function(_0x2449ea){if(_0x2449ea){var _0xdb5ea8=typeof _0x3c4eb6[_0x7da2('0x13')]==='undefined'&&typeof _0x3c4eb6[_0x7da2('0x14')]===_0x7da2('0x15');var _0x3fbfdd=_0x2449ea['count'];var _0x4ff261=_0xdb5ea8?0x0:_0x3c4eb6[_0x7da2('0x13')];var _0x8b55d=_0xdb5ea8?_0x2449ea[_0x7da2('0x16')]:_0x3c4eb6[_0x7da2('0x13')]+_0x3c4eb6[_0x7da2('0x14')];var _0x551931;if(_0x8b55d>=_0x3fbfdd){_0x8b55d=_0x3fbfdd;_0x551931=0xc8;}else{_0x551931=0xce;}_0x53aa63[_0x7da2('0x11')](_0x551931);return _0x53aa63[_0x7da2('0x17')](_0x7da2('0x18'),_0x4ff261+'-'+_0x8b55d+'/'+_0x3fbfdd)[_0x7da2('0x12')](_0x2449ea);}return null;};}function saveUpdates(_0x2d2e32){return function(_0x374dc0){if(_0x374dc0){return _0x374dc0[_0x7da2('0x19')](_0x2d2e32)[_0x7da2('0x1a')](function(_0x1ccbc2){return _0x1ccbc2;});}return null;};}function removeEntity(_0x409550){return function(_0x5f0764){if(_0x5f0764){return _0x5f0764[_0x7da2('0x1b')]()[_0x7da2('0x1a')](function(){_0x409550[_0x7da2('0x11')](0xcc)[_0x7da2('0x1c')]();});}};}function handleEntityNotFound(_0x2e9e11){return function(_0x1a03c8){if(!_0x1a03c8){_0x2e9e11[_0x7da2('0x1d')](0x194);}return _0x1a03c8;};}function handleError(_0xf18457,_0x51435e){_0x51435e=_0x51435e||0x1f4;return function(_0x577f33){logger[_0x7da2('0x1e')](_0x577f33['stack']);if(_0x577f33[_0x7da2('0x1f')]){delete _0x577f33['name'];}_0xf18457[_0x7da2('0x11')](_0x51435e)[_0x7da2('0x20')](_0x577f33);};}exports[_0x7da2('0x21')]=function(_0x456d77,_0x136671){var _0xc46f9c={};return contacts['describe']()['then'](function(_0x1e4948){_0xc46f9c=qs[_0x7da2('0x22')](_0x1e4948,_0x456d77);return contacts[_0x7da2('0x23')](_0x456d77[_0x7da2('0x24')],_0x456d77[_0x7da2('0x25')],_0xc46f9c,_0x1e4948);})[_0x7da2('0x1a')](respondWithFilteredResult(_0x136671,_0xc46f9c))[_0x7da2('0x26')](handleError(_0x136671,null));};exports[_0x7da2('0x1b')]=function(_0x5de172,_0x1137b2){return db[_0x7da2('0x27')][_0x7da2('0x28')]({'where':{'id':_0x5de172[_0x7da2('0x29')]['id']}})[_0x7da2('0x1a')](handleEntityNotFound(_0x1137b2,null))[_0x7da2('0x1a')](removeEntity(_0x1137b2,null))[_0x7da2('0x26')](handleError(_0x1137b2,null));};exports['describe']=function(_0x5f46e2,_0x2390dd){return db[_0x7da2('0x27')][_0x7da2('0x2a')]()['then'](function(_0x1a5d35){delete _0x1a5d35[_0x7da2('0x2b')];for(var _0x2bb0a4=0x0;_0x2bb0a40x0){return new Promise(function(_0x4f37a1){var _0x275ee1=[];for(var _0x2dc46e=0x0;_0x2dc46e<_0x3ffb69[_0x7da2('0x2d')];_0x2dc46e++){_0x275ee1[_0x7da2('0x61')](insertAdditionalPhones(_0x3ffb69[_0x2dc46e][_0x7da2('0x64')],_0x3ffb69[_0x2dc46e][_0x7da2('0x5b')]));}Promise[_0x7da2('0x65')](_0x275ee1)[_0x7da2('0x1a')](function(){_0x4f37a1(0x1);});})[_0x7da2('0x1a')](function(){return{'success':_0x506440,'failure':_0x147355,'duplicates':_0x16e9af};});}else{return{'success':_0x506440,'failure':_0x147355,'duplicates':_0x16e9af};}}})['then'](respondWithResult(_0x108961,0xc9))[_0x7da2('0x26')](handleError(_0x108961,null));};exports[_0x7da2('0x66')]=function(_0x59e237,_0x319ce5){var _0x4681e7;return db['CmContact'][_0x7da2('0x2a')]()['then'](function(_0x4e3ea8){return db[_0x7da2('0x27')][_0x7da2('0x28')]({'where':{'id':_0x59e237[_0x7da2('0x29')]['id']},'include':[{'model':db[_0x7da2('0x67')],'as':_0x7da2('0x68'),'attributes':['id',_0x7da2('0x1f'),_0x7da2('0x69')],'required':_0x59e237[_0x7da2('0x24')][_0x7da2('0x6a')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x7da2('0x6b'),'where':{'CmContactId':_0x59e237[_0x7da2('0x29')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0x7da2('0x6c')}]}],'order':[db['sequelize'][_0x7da2('0x6d')](_0x7da2('0x6e'))],'attributes':_[_0x7da2('0x2c')](_0x4e3ea8)});})[_0x7da2('0x1a')](function(_0x95e05d){if(!_['isNil'](_0x95e05d)){_0x4681e7=_0x95e05d[_0x7da2('0x3c')]({'plain':!![]});var _0x32caa2={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x95e05d&&_0x95e05d[_0x7da2('0x62')]){if(_0x95e05d['ListId']){_0x32caa2[_0x7da2('0x5f')][_0x7da2('0x6f')][_0x7da2('0x61')]({'ListId':{'$ne':_0x95e05d[_0x7da2('0x62')]}});}}return db['CmCustomField']['findAll'](_0x32caa2);}})[_0x7da2('0x1a')](function(_0xb184db){if(!_['isNil'](_0xb184db)){return _[_0x7da2('0x70')](_0x4681e7,_['map'](_0xb184db,function(_0x3cd396){return util[_0x7da2('0x71')](_0x7da2('0x72'),_0x3cd396['id']);}));}})[_0x7da2('0x1a')](handleEntityNotFound(_0x319ce5,null))['then'](respondWithResult(_0x319ce5,null))[_0x7da2('0x26')](handleError(_0x319ce5,null));};exports[_0x7da2('0x19')]=function(_0x317cf3,_0x2e8e9e){var _0x59e064;if(_0x317cf3['body']['id']){delete _0x317cf3[_0x7da2('0x3a')]['id'];}if(!_[_0x7da2('0x58')](_0x317cf3[_0x7da2('0x3a')][_0x7da2('0x57')])){var _0x5e9e8a=_0x317cf3[_0x7da2('0x3a')][_0x7da2('0x57')];if(!_['isNil'](shared[_0x7da2('0x59')][_0x5e9e8a]))_0x317cf3[_0x7da2('0x3a')]['utcOffset']=shared[_0x7da2('0x59')][_0x5e9e8a][_0x7da2('0x5a')];}return db['CmContact'][_0x7da2('0x28')]({'where':{'id':_0x317cf3[_0x7da2('0x29')]['id']}})[_0x7da2('0x1a')](handleEntityNotFound(_0x2e8e9e,null))[_0x7da2('0x1a')](saveUpdates(_0x317cf3[_0x7da2('0x3a')],null))[_0x7da2('0x1a')](function(_0x58a145){_0x59e064=_0x58a145;var _0x250624={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x58a145&&_0x58a145[_0x7da2('0x62')]){if(_0x58a145[_0x7da2('0x62')]){_0x250624[_0x7da2('0x5f')][_0x7da2('0x6f')]['push']({'ListId':{'$ne':_0x58a145[_0x7da2('0x62')]}});}}return db[_0x7da2('0x73')][_0x7da2('0x23')](_0x250624);})[_0x7da2('0x1a')](function(_0x5649fa){if(_0x5649fa){return _[_0x7da2('0x70')](_[_0x7da2('0x74')](_0x317cf3[_0x7da2('0x3a')],function(_0x248f66,_0x5644e9){return _['startsWith'](_0x5644e9,_0x7da2('0x32'));}),_[_0x7da2('0x75')](_0x5649fa,function(_0x5c048f){return util[_0x7da2('0x71')](_0x7da2('0x72'),_0x5c048f['id']);}));}})['then'](function(_0x3ee8cb){if(_0x3ee8cb&&!_[_0x7da2('0x76')](_0x3ee8cb)){var _0x2ce534=squel[_0x7da2('0x19')]()[_0x7da2('0x77')](_0x7da2('0x78'))[_0x7da2('0x79')](_0x3ee8cb)[_0x7da2('0x5f')](_0x7da2('0x7a'),_0x317cf3['params']['id'])['toParam']();return db['sequelize']['query'](_0x2ce534['text'],{'replacements':_0x2ce534[_0x7da2('0x35')]});}})[_0x7da2('0x1a')](function(){if(_0x317cf3[_0x7da2('0x3a')][_0x7da2('0x7b')]&&_0x59e064){return db['CmHopper'][_0x7da2('0x19')]({'phone':_0x317cf3[_0x7da2('0x3a')][_0x7da2('0x7b')],'OrderBy':0x0},{'where':{'ContactId':_0x59e064['id']}});}})[_0x7da2('0x1a')](function(){return _0x59e064;})[_0x7da2('0x1a')](respondWithResult(_0x2e8e9e,null))['catch'](handleError(_0x2e8e9e,null));};exports[_0x7da2('0x7c')]=function(_0xa59d08,_0x26e8b0){var _0x178f7b={};var _0x27a8d0={};var _0x4bfe34;var _0x3ed813;return db[_0x7da2('0x27')][_0x7da2('0x7d')]({'where':{'id':_0xa59d08[_0x7da2('0x29')]['id']}})[_0x7da2('0x1a')](handleEntityNotFound(_0x26e8b0,null))[_0x7da2('0x1a')](function(_0x14e5c2){if(_0x14e5c2){_0x4bfe34=_0x14e5c2;_0x27a8d0[_0x7da2('0x7e')]=_[_0x7da2('0x2c')](db[_0x7da2('0x67')][_0x7da2('0x7f')]);_0x27a8d0[_0x7da2('0x24')]=_[_0x7da2('0x2c')](_0xa59d08['query']);_0x27a8d0['filters']=_[_0x7da2('0x80')](_0x27a8d0[_0x7da2('0x7e')],_0x27a8d0[_0x7da2('0x24')]);_0x178f7b['attributes']=_[_0x7da2('0x80')](_0x27a8d0[_0x7da2('0x7e')],qs[_0x7da2('0x81')](_0xa59d08['query']['fields']));_0x178f7b[_0x7da2('0x82')]=_0x178f7b['attributes']['length']?_0x178f7b[_0x7da2('0x82')]:_0x27a8d0[_0x7da2('0x7e')];_0x178f7b['order']=qs[_0x7da2('0x83')](_0xa59d08[_0x7da2('0x24')][_0x7da2('0x83')]);_0x178f7b['where']=qs[_0x7da2('0x84')](_[_0x7da2('0x85')](_0xa59d08['query'],_0x27a8d0[_0x7da2('0x84')]));if(_0xa59d08[_0x7da2('0x24')][_0x7da2('0x86')]){_0x178f7b[_0x7da2('0x5f')]=_['merge'](_0x178f7b[_0x7da2('0x5f')],{'$or':_[_0x7da2('0x75')](_0x178f7b['attributes'],function(_0xe62987){var _0x31e493={};_0x31e493[_0xe62987]={'$like':'%'+_0xa59d08[_0x7da2('0x24')]['filter']+'%'};return _0x31e493;})});}_0x178f7b=_[_0x7da2('0x39')]({},_0x178f7b,_0xa59d08[_0x7da2('0x87')]);return _0x4bfe34['getTags'](_0x178f7b);}})[_0x7da2('0x1a')](function(_0x46218c){if(_0x46218c){_0x3ed813=_0x46218c[_0x7da2('0x2d')];if(!_0xa59d08['query'][_0x7da2('0x38')]('nolimit')){_0x178f7b[_0x7da2('0x14')]=qs[_0x7da2('0x14')](_0xa59d08[_0x7da2('0x24')][_0x7da2('0x14')]);_0x178f7b[_0x7da2('0x13')]=qs['offset'](_0xa59d08[_0x7da2('0x24')]['offset']);}return _0x4bfe34['getTags'](_0x178f7b);}})['then'](function(_0x38fa8c){if(_0x38fa8c){return _0x38fa8c?{'count':_0x3ed813,'rows':_0x38fa8c}:null;}})['then'](respondWithResult(_0x26e8b0,null))[_0x7da2('0x26')](handleError(_0x26e8b0,null));};exports[_0x7da2('0x88')]=function(_0x238267,_0x471179){if(_0x238267['body']['id']){delete _0x238267[_0x7da2('0x3a')]['id'];}return db[_0x7da2('0x27')][_0x7da2('0x7d')]({'where':{'id':_0x238267[_0x7da2('0x29')]['id']}})['then'](handleEntityNotFound(_0x471179,null))[_0x7da2('0x1a')](function(_0x1c946d){if(_0x1c946d){return _0x1c946d[_0x7da2('0x88')](_0x238267[_0x7da2('0x3a')][_0x7da2('0x89')]||[]);}return null;})[_0x7da2('0x1a')](respondWithResult(_0x471179,null))[_0x7da2('0x26')](handleError(_0x471179,null));};exports[_0x7da2('0x8a')]=function(_0x1f6368,_0x201a33){var _0x23f74a=[];_0x23f74a[_0x7da2('0x61')](addAdditionalPhones(_0x1f6368[_0x7da2('0x3a')]));Promise[_0x7da2('0x65')](_0x23f74a)[_0x7da2('0x1a')](function(){_0x23f74a=[];_0x23f74a[_0x7da2('0x61')](deleteCmHopperPhones(_0x1f6368[_0x7da2('0x3a')]['id']));_0x23f74a['push'](addCmHopperPhones(_0x1f6368[_0x7da2('0x3a')]['id']));Promise[_0x7da2('0x65')](_0x23f74a)[_0x7da2('0x1a')](function(){return[0x1];})[_0x7da2('0x1a')](respondWithResult(_0x201a33,null));});};function addAdditionalPhones(_0xa015a8){var _0x4dbc74;return new Promise(function(_0x97102d){return db[_0x7da2('0x4b')][_0x7da2('0x1b')]({'where':{'CmContactId':_0xa015a8['id']}})[_0x7da2('0x1a')](function(){db[_0x7da2('0x8b')][_0x7da2('0x23')]({'raw':!![],'attributes':['id',_0x7da2('0x8c')]})[_0x7da2('0x1a')](function(_0x3fa705){var _0x607b36=[];for(var _0x3ebfc0=0x0;_0x3ebfc0<_0xa015a8[_0x7da2('0x8d')][_0x7da2('0x2d')];_0x3ebfc0++){var _0x5961bf=_0xa015a8[_0x7da2('0x8e')]?_['isNil'](_0xa015a8['item_types'][_0x3ebfc0])?'':_0xa015a8[_0x7da2('0x8e')][_0x3ebfc0]:_0xa015a8[_0x7da2('0x8d')][_0x3ebfc0][_0x7da2('0x8f')]?_0xa015a8[_0x7da2('0x8d')][_0x3ebfc0]['ItemTypeId']:'';var _0x2a7d24=_[_0x7da2('0x58')](_0xa015a8[_0x7da2('0x8d')][_0x3ebfc0][_0x7da2('0x90')])?'':_0xa015a8[_0x7da2('0x8d')][_0x3ebfc0]['description'];var _0x25c9b4=_0x5961bf+':'+_0xa015a8[_0x7da2('0x8d')][_0x3ebfc0]['phone']+'§'+_0x2a7d24;if(_['isNil'](_0x4dbc74))_0x4dbc74=_0x25c9b4;else _0x4dbc74+=';'+_0x25c9b4;var _0x3061c4=null;var _0x44f181=null;if(_0xa015a8[_0x7da2('0x8e')]){if(!_[_0x7da2('0x58')](_0xa015a8[_0x7da2('0x8e')][_0x3ebfc0])){_0x44f181=_[_0x7da2('0x28')](_0x3fa705,function(_0x81f2a5){return _0x81f2a5['id']===_0xa015a8[_0x7da2('0x8e')][_0x3ebfc0];});if(!_['isNil'](_0x44f181)){_0x3061c4=_0x44f181[_0x7da2('0x8c')];}}}else{if(!_[_0x7da2('0x58')](_0xa015a8[_0x7da2('0x8d')][_0x3ebfc0])){_0x44f181=_[_0x7da2('0x28')](_0x3fa705,function(_0x37b13f){return _0x37b13f['id']===_0xa015a8[_0x7da2('0x8d')][_0x3ebfc0][_0x7da2('0x8f')];});if(!_['isNil'](_0x44f181)){_0x3061c4=_0x3ebfc0;}}}if(_[_0x7da2('0x58')](_0x3061c4)){_0x3061c4=0x64;}_0x607b36[_0x7da2('0x61')](addAdditionalPhone(_0xa015a8['id'],_0xa015a8[_0x7da2('0x8d')][_0x3ebfc0]['phone'],_0xa015a8[_0x7da2('0x8e')]?_[_0x7da2('0x58')](_0xa015a8[_0x7da2('0x8e')][_0x3ebfc0])?null:_0xa015a8[_0x7da2('0x8e')][_0x3ebfc0]:_0xa015a8[_0x7da2('0x8d')][_0x3ebfc0][_0x7da2('0x8f')]?_0xa015a8['items'][_0x3ebfc0]['ItemTypeId']:null,_0x3061c4,_0x2a7d24));}Promise['all'](_0x607b36)['then'](function(){db[_0x7da2('0x27')][_0x7da2('0x19')]({'AdditionalPhones':_0x4dbc74},{'where':{'id':_0xa015a8['id']}})[_0x7da2('0x1a')](function(){_0x97102d(0x1);});});});});});}function addAdditionalPhone(_0x1c8a68,_0x2b3f6d,_0x1c5017,_0x397638,_0x39b44c){return db[_0x7da2('0x4b')][_0x7da2('0x28')]({'where':{'CmContactId':_0x1c8a68,'item':_0x2b3f6d}})[_0x7da2('0x1a')](function(_0x311898){if(_0x311898)logger[_0x7da2('0x40')](_0x7da2('0x91'),_0x311898);else{db['CmContactHasItem'][_0x7da2('0x56')]({'CmContactId':_0x1c8a68,'item':_0x2b3f6d,'ItemTypeId':_0x1c5017,'OrderBy':_0x397638,'ItemClass':_0x7da2('0x92'),'description':_0x39b44c});}});}function deleteCmHopperPhones(_0x3ba72c){return new Promise(function(_0x13573e){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x3ba72c}})['then'](function(_0x3fc7a5){db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':{'$in':_[_0x7da2('0x75')](_0x3fc7a5,'id')}}});})[_0x7da2('0x1a')](function(){_0x13573e(0x1);});});}function addCmHopperPhones(_0x81d1fe){return new Promise(function(_0x4afa4a){return db[_0x7da2('0x42')][_0x7da2('0x23')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x81d1fe}})[_0x7da2('0x1a')](function(_0x313811){var _0x284746=[];_[_0x7da2('0x75')](_0x313811,function(_0x29fa96){_0x284746['push'](createCmHopperPhone(_0x81d1fe,_0x29fa96['id']));});Promise['all'](_0x284746)['then'](function(){_0x4afa4a(0x1);});});});}function createCmHopperPhone(_0x1abc0b,_0x54db98){return new Promise(function(_0x4dd475){db[_0x7da2('0x4b')]['findAll']({'raw':!![],'attributes':[_0x7da2('0x93'),_0x7da2('0x8c')],'where':{'CmContactId':_0x1abc0b,'ItemClass':_0x7da2('0x92')},'include':[{'model':db[_0x7da2('0x8b')],'attributes':[_0x7da2('0x8c')],'as':_0x7da2('0x6c')}],'order':[_0x7da2('0x8c'),db[_0x7da2('0x94')][_0x7da2('0x6d')](_0x7da2('0x95'))]})[_0x7da2('0x1a')](function(_0x10c769){var _0x806b18=0x1;var _0x507270=_[_0x7da2('0x75')](_0x10c769,function(_0x1df89e){_0x1df89e[_0x7da2('0x96')]=_0x54db98;_0x1df89e[_0x7da2('0x7b')]=_0x1df89e['item'];_0x1df89e['OrderBy']=_0x806b18;delete _0x1df89e[_0x7da2('0x97')];_0x806b18=_0x806b18+0x1;return _0x1df89e;});return db[_0x7da2('0x98')]['bulkCreate'](_0x507270,{});})[_0x7da2('0x1a')](function(){_0x4dd475(0x1);});});}function insertAdditionalPhones(_0x150831,_0x417fcd){return new Promise(function(_0x426550){var _0x185ee3=[];for(var _0x1ad945=0x0;_0x1ad945<_0x417fcd['length'];_0x1ad945++){var _0x6ae59d=_0x417fcd[_0x1ad945];_0x185ee3[_0x7da2('0x61')](parseContactItemType(_0x6ae59d));}Promise[_0x7da2('0x65')](_0x185ee3)[_0x7da2('0x1a')](function(){var _0x2ec7e9={'id':_0x150831['id'],'items':_0x417fcd};return addAdditionalPhones(_0x2ec7e9)[_0x7da2('0x1a')](function(){return addCmHopperPhones(_0x150831['id']);});})[_0x7da2('0x1a')](function(){_0x426550(_0x150831);});});}function parseContactItemType(_0x15d8e5){return new Promise(function(_0x34d810){if(_0x15d8e5['hasOwnProperty'](_0x7da2('0x8f'))){_0x34d810(_0x15d8e5);}else{return db[_0x7da2('0x8b')][_0x7da2('0x28')]({'where':{'name':_0x15d8e5[_0x7da2('0x6c')]}})[_0x7da2('0x1a')](function(_0x5333de){if(_[_0x7da2('0x58')](_0x5333de))_0x15d8e5['ItemTypeId']=null;else _0x15d8e5['ItemTypeId']=_0x5333de['id'];_0x34d810(_0x15d8e5);});}});}exports[_0x7da2('0x99')]=function(_0x8bee67,_0x193795){return db[_0x7da2('0x4b')][_0x7da2('0x23')]({'raw':!![],'where':{'CmContactId':_0x8bee67[_0x7da2('0x29')]['id'],'ItemClass':_0x7da2('0x92')},'include':[{'model':db[_0x7da2('0x8b')],'as':_0x7da2('0x6c')}],'order':[[_0x7da2('0x8c')],[db['sequelize'][_0x7da2('0x6d')](_0x7da2('0x95'))]]})['then'](function(_0x5a4e73){return _0x5a4e73;})[_0x7da2('0x1a')](respondWithResult(_0x193795,null))[_0x7da2('0x26')](handleError(_0x193795,null));};exports['duplicateAdditionalPhones']=function(_0x12b855,_0x140817){return db[_0x7da2('0x4b')]['findAll']({'raw':!![],'where':{'CmContactId':_0x12b855[_0x7da2('0x3a')][_0x7da2('0x9a')]}})[_0x7da2('0x1a')](function(_0x772665){var _0x26419a=_[_0x7da2('0x75')](_0x772665,function(_0x498a0d){_0x498a0d[_0x7da2('0x9b')]=_0x12b855[_0x7da2('0x3a')]['toContactId'];return _0x498a0d;});return db[_0x7da2('0x4b')][_0x7da2('0x5c')](_0x26419a,{});})['then'](function(){return addCmHopperPhones(_0x12b855[_0x7da2('0x3a')][_0x7da2('0x9c')]);})[_0x7da2('0x1a')](function(){return['ok'];})[_0x7da2('0x1a')](respondWithResult(_0x140817,null))[_0x7da2('0x26')](handleError(_0x140817,null));};exports[_0x7da2('0x9d')]=function(_0x5f0f9c,_0x47251e){var _0x204267=[];_0x204267['push'](createCmHopperPhone(_0x5f0f9c[_0x7da2('0x3a')]['id'],_0x5f0f9c[_0x7da2('0x3a')]['hopperId']));Promise[_0x7da2('0x65')](_0x204267)[_0x7da2('0x1a')](function(){return[0x1];})[_0x7da2('0x1a')](respondWithResult(_0x47251e,null));};exports[_0x7da2('0x9e')]=function(_0x494233,_0x474d4a){var _0x590e1e={'raw':![],'where':{}};var _0x2b94a5={};var _0x15e2d4={'count':0x0,'rows':[]};return db['CmContact'][_0x7da2('0x7d')]({'where':{'id':_0x494233[_0x7da2('0x29')]['id']}})[_0x7da2('0x1a')](handleEntityNotFound(_0x474d4a,null))[_0x7da2('0x1a')](function(_0x3db156){if(_0x3db156){_0x2b94a5[_0x7da2('0x7e')]=_[_0x7da2('0x2c')](db[_0x7da2('0x42')][_0x7da2('0x7f')]);_0x2b94a5['query']=_['keys'](_0x494233['query']);_0x2b94a5[_0x7da2('0x84')]=_['intersection'](_0x2b94a5[_0x7da2('0x7e')],_0x2b94a5['query']);_0x590e1e['attributes']=_['intersection'](_0x2b94a5[_0x7da2('0x7e')],qs[_0x7da2('0x81')](_0x494233[_0x7da2('0x24')][_0x7da2('0x81')]));_0x590e1e[_0x7da2('0x82')]=_0x590e1e['attributes'][_0x7da2('0x2d')]?_0x590e1e[_0x7da2('0x82')]:_0x2b94a5[_0x7da2('0x7e')];if(!_0x494233['query'][_0x7da2('0x38')](_0x7da2('0x9f'))){_0x590e1e[_0x7da2('0x14')]=qs[_0x7da2('0x14')](_0x494233[_0x7da2('0x24')]['limit']);_0x590e1e[_0x7da2('0x13')]=qs[_0x7da2('0x13')](_0x494233['query'][_0x7da2('0x13')]);}_0x590e1e[_0x7da2('0xa0')]=qs[_0x7da2('0x83')](_0x494233['query'][_0x7da2('0x83')]);_0x590e1e[_0x7da2('0x5f')]=qs[_0x7da2('0x84')](_[_0x7da2('0x85')](_0x494233[_0x7da2('0x24')],_0x2b94a5[_0x7da2('0x84')]));_0x590e1e['where'][_0x7da2('0xa1')]=_0x3db156['id'];if(_0x494233['query'][_0x7da2('0x86')]){_0x590e1e[_0x7da2('0x5f')]=_[_0x7da2('0x39')](_0x590e1e[_0x7da2('0x5f')],{'$or':_[_0x7da2('0x75')](_0x590e1e[_0x7da2('0x82')],function(_0x5f257a){var _0x1a6147={};_0x1a6147[_0x5f257a]={'$like':'%'+_0x494233[_0x7da2('0x24')]['filter']+'%'};return _0x1a6147;})});}_0x590e1e=_[_0x7da2('0x39')]({},_0x590e1e,_0x494233[_0x7da2('0x87')]);return db[_0x7da2('0x42')]['count']({'where':_0x590e1e['where']})['then'](function(_0xaa083f){_0x15e2d4[_0x7da2('0x16')]=_0xaa083f;if(_0x494233['query'][_0x7da2('0xa2')]){_0x590e1e['include']=[{'all':!![]}];}return db[_0x7da2('0x42')][_0x7da2('0x23')](_0x590e1e);})[_0x7da2('0x1a')](function(_0x400039){_0x15e2d4[_0x7da2('0xa3')]=_0x400039;return _0x15e2d4;});}})[_0x7da2('0x1a')](respondWithFilteredResult(_0x474d4a,_0x590e1e))[_0x7da2('0x26')](handleError(_0x474d4a,null));};exports[_0x7da2('0xa4')]=function(_0x1d7692,_0x25a7f4){var _0x440b12={'raw':!![],'where':{}};var _0x42ba7e={};var _0x3a10d7={'count':0x0,'rows':[]};return db['CmContact'][_0x7da2('0x7d')]({'where':{'id':_0x1d7692[_0x7da2('0x29')]['id']}})['then'](handleEntityNotFound(_0x25a7f4,null))[_0x7da2('0x1a')](function(_0x1e0a34){if(_0x1e0a34){_0x42ba7e[_0x7da2('0x7e')]=_[_0x7da2('0x2c')](db[_0x7da2('0x4d')][_0x7da2('0x7f')]);_0x42ba7e[_0x7da2('0x24')]=_[_0x7da2('0x2c')](_0x1d7692[_0x7da2('0x24')]);_0x42ba7e['filters']=_[_0x7da2('0x80')](_0x42ba7e[_0x7da2('0x7e')],_0x42ba7e[_0x7da2('0x24')]);_0x440b12[_0x7da2('0x82')]=_[_0x7da2('0x80')](_0x42ba7e[_0x7da2('0x7e')],qs[_0x7da2('0x81')](_0x1d7692[_0x7da2('0x24')][_0x7da2('0x81')]));_0x440b12[_0x7da2('0x82')]=_0x440b12[_0x7da2('0x82')][_0x7da2('0x2d')]?_0x440b12[_0x7da2('0x82')]:_0x42ba7e[_0x7da2('0x7e')];if(!_0x1d7692[_0x7da2('0x24')]['hasOwnProperty'](_0x7da2('0x9f'))){_0x440b12[_0x7da2('0x14')]=qs[_0x7da2('0x14')](_0x1d7692[_0x7da2('0x24')][_0x7da2('0x14')]);_0x440b12[_0x7da2('0x13')]=qs[_0x7da2('0x13')](_0x1d7692['query'][_0x7da2('0x13')]);}_0x440b12['order']=qs[_0x7da2('0x83')](_0x1d7692['query'][_0x7da2('0x83')]);_0x440b12[_0x7da2('0x5f')]=qs[_0x7da2('0x84')](_[_0x7da2('0x85')](_0x1d7692[_0x7da2('0x24')],_0x42ba7e[_0x7da2('0x84')]));_0x440b12['where'][_0x7da2('0xa1')]=_0x1e0a34['id'];if(_0x1d7692[_0x7da2('0x24')][_0x7da2('0x86')]){_0x440b12['where']=_['merge'](_0x440b12[_0x7da2('0x5f')],{'$or':_[_0x7da2('0x75')](_0x440b12[_0x7da2('0x82')],function(_0x4ba000){var _0x3bc765={};_0x3bc765[_0x4ba000]={'$like':'%'+_0x1d7692['query'][_0x7da2('0x86')]+'%'};return _0x3bc765;})});}_0x440b12=_[_0x7da2('0x39')]({},_0x440b12,_0x1d7692[_0x7da2('0x87')]);return db[_0x7da2('0x4d')][_0x7da2('0x16')]({'where':_0x440b12['where']})[_0x7da2('0x1a')](function(_0x268e2f){_0x3a10d7[_0x7da2('0x16')]=_0x268e2f;if(_0x1d7692[_0x7da2('0x24')]['includeAll']){_0x440b12['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x7da2('0x23')](_0x440b12);})[_0x7da2('0x1a')](function(_0x219b37){_0x3a10d7[_0x7da2('0xa3')]=_0x219b37;return _0x3a10d7;});}})['then'](respondWithFilteredResult(_0x25a7f4,_0x440b12))['catch'](handleError(_0x25a7f4,null));};exports[_0x7da2('0xa5')]=function(_0x486a5c,_0x1c3979){var _0x55470f={'raw':!![],'where':{}};var _0xcafec8={};var _0xb1e800={'count':0x0,'rows':[]};return db[_0x7da2('0x27')][_0x7da2('0x7d')]({'where':{'id':_0x486a5c[_0x7da2('0x29')]['id']}})[_0x7da2('0x1a')](handleEntityNotFound(_0x1c3979,null))['then'](function(_0x273af7){if(_0x273af7){_0xcafec8[_0x7da2('0x7e')]=_['keys'](db[_0x7da2('0x4c')]['rawAttributes']);_0xcafec8[_0x7da2('0x24')]=_['keys'](_0x486a5c['query']);_0xcafec8[_0x7da2('0x84')]=_[_0x7da2('0x80')](_0xcafec8[_0x7da2('0x7e')],_0xcafec8['query']);_0x55470f[_0x7da2('0x82')]=_[_0x7da2('0x80')](_0xcafec8['model'],qs[_0x7da2('0x81')](_0x486a5c[_0x7da2('0x24')][_0x7da2('0x81')]));_0x55470f[_0x7da2('0x82')]=_0x55470f[_0x7da2('0x82')]['length']?_0x55470f[_0x7da2('0x82')]:_0xcafec8['model'];if(!_0x486a5c['query']['hasOwnProperty'](_0x7da2('0x9f'))){_0x55470f[_0x7da2('0x14')]=qs[_0x7da2('0x14')](_0x486a5c[_0x7da2('0x24')][_0x7da2('0x14')]);_0x55470f[_0x7da2('0x13')]=qs[_0x7da2('0x13')](_0x486a5c[_0x7da2('0x24')][_0x7da2('0x13')]);}_0x55470f[_0x7da2('0xa0')]=qs[_0x7da2('0x83')](_0x486a5c[_0x7da2('0x24')][_0x7da2('0x83')]);_0x55470f[_0x7da2('0x5f')]=qs[_0x7da2('0x84')](_['pick'](_0x486a5c[_0x7da2('0x24')],_0xcafec8[_0x7da2('0x84')]));_0x55470f[_0x7da2('0x5f')]['ContactId']=_0x273af7['id'];if(_0x486a5c[_0x7da2('0x24')]['filter']){_0x55470f[_0x7da2('0x5f')]=_[_0x7da2('0x39')](_0x55470f['where'],{'$or':_[_0x7da2('0x75')](_0x55470f['attributes'],function(_0x520f6d){var _0x4ff4f9={};_0x4ff4f9[_0x520f6d]={'$like':'%'+_0x486a5c[_0x7da2('0x24')][_0x7da2('0x86')]+'%'};return _0x4ff4f9;})});}_0x55470f=_[_0x7da2('0x39')]({},_0x55470f,_0x486a5c['options']);return db[_0x7da2('0x4c')]['count']({'where':_0x55470f[_0x7da2('0x5f')]})[_0x7da2('0x1a')](function(_0x12813e){_0xb1e800[_0x7da2('0x16')]=_0x12813e;if(_0x486a5c[_0x7da2('0x24')][_0x7da2('0xa2')]){_0x55470f[_0x7da2('0xa6')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x55470f);})[_0x7da2('0x1a')](function(_0x4fe045){_0xb1e800['rows']=_0x4fe045;return _0xb1e800;});}})[_0x7da2('0x1a')](respondWithFilteredResult(_0x1c3979,_0x55470f))['catch'](handleError(_0x1c3979,null));};exports[_0x7da2('0xa7')]=function(_0x36e6f7,_0x1fa933){var _0x4ae8bc={'raw':!![],'where':{}};var _0x4af936={};var _0x2ed587={'count':0x0,'rows':[]};return db[_0x7da2('0x27')]['findOne']({'where':{'id':_0x36e6f7[_0x7da2('0x29')]['id']}})[_0x7da2('0x1a')](handleEntityNotFound(_0x1fa933,null))['then'](function(_0x2897fd){if(_0x2897fd){_0x4af936['model']=_[_0x7da2('0x2c')](db['JscriptySessionReport'][_0x7da2('0x7f')]);_0x4af936[_0x7da2('0x24')]=_['keys'](_0x36e6f7[_0x7da2('0x24')]);_0x4af936[_0x7da2('0x84')]=_[_0x7da2('0x80')](_0x4af936[_0x7da2('0x7e')],_0x4af936[_0x7da2('0x24')]);_0x4ae8bc['attributes']=_[_0x7da2('0x80')](_0x4af936[_0x7da2('0x7e')],qs[_0x7da2('0x81')](_0x36e6f7[_0x7da2('0x24')][_0x7da2('0x81')]));_0x4ae8bc[_0x7da2('0x82')]=_0x4ae8bc[_0x7da2('0x82')]['length']?_0x4ae8bc['attributes']:_0x4af936[_0x7da2('0x7e')];if(!_0x36e6f7[_0x7da2('0x24')][_0x7da2('0x38')](_0x7da2('0x9f'))){_0x4ae8bc[_0x7da2('0x14')]=qs[_0x7da2('0x14')](_0x36e6f7[_0x7da2('0x24')][_0x7da2('0x14')]);_0x4ae8bc[_0x7da2('0x13')]=qs[_0x7da2('0x13')](_0x36e6f7[_0x7da2('0x24')]['offset']);}_0x4ae8bc[_0x7da2('0xa0')]=qs['sort'](_0x36e6f7['query']['sort']);_0x4ae8bc[_0x7da2('0x5f')]=qs[_0x7da2('0x84')](_['pick'](_0x36e6f7[_0x7da2('0x24')],_0x4af936[_0x7da2('0x84')]));_0x4ae8bc['where'][_0x7da2('0xa1')]=_0x2897fd['id'];if(_0x36e6f7[_0x7da2('0x24')][_0x7da2('0x86')]){_0x4ae8bc[_0x7da2('0x5f')]=_['merge'](_0x4ae8bc[_0x7da2('0x5f')],{'$or':_[_0x7da2('0x75')](_0x4ae8bc[_0x7da2('0x82')],function(_0x13f59f){var _0x1a7ac4={};_0x1a7ac4[_0x13f59f]={'$like':'%'+_0x36e6f7[_0x7da2('0x24')][_0x7da2('0x86')]+'%'};return _0x1a7ac4;})});}_0x4ae8bc=_[_0x7da2('0x39')]({},_0x4ae8bc,_0x36e6f7[_0x7da2('0x87')]);return db[_0x7da2('0x54')][_0x7da2('0x16')]({'where':_0x4ae8bc['where']})[_0x7da2('0x1a')](function(_0x4c387d){_0x2ed587[_0x7da2('0x16')]=_0x4c387d;if(_0x36e6f7[_0x7da2('0x24')][_0x7da2('0xa2')]){_0x4ae8bc['include']=[{'all':!![]}];}return db[_0x7da2('0x54')]['findAll'](_0x4ae8bc);})[_0x7da2('0x1a')](function(_0x4a03ef){_0x2ed587[_0x7da2('0xa3')]=_0x4a03ef;return _0x2ed587;});}})[_0x7da2('0x1a')](respondWithFilteredResult(_0x1fa933,_0x4ae8bc))[_0x7da2('0x26')](handleError(_0x1fa933,null));};exports[_0x7da2('0xa8')]=function(_0x260fb4,_0x3398f3){try{if(!_0x260fb4[_0x7da2('0x3a')][_0x7da2('0x62')]){throw new Error(_0x7da2('0xa9'));}if(!_0x260fb4[_0x7da2('0x3a')][_0x7da2('0xaa')]){throw new Error(_0x7da2('0xab'));}if(!_0x260fb4['body'][_0x7da2('0xac')]){throw new Error(_0x7da2('0xad'));}if(!_0x260fb4[_0x7da2('0x3a')]['socket_timestamp']){throw new Error(_0x7da2('0xae'));}var _0x34b504=_0x260fb4[_0x7da2('0x3a')][_0x7da2('0xaa')][_0x7da2('0xaf')](',');var _0x25d9d9=_0x260fb4[_0x7da2('0x3a')][_0x7da2('0xac')][_0x7da2('0xaf')](',');if(!_0x34b504[_0x7da2('0x2d')]||!_0x25d9d9['length']||_0x34b504[_0x7da2('0x2d')]!==_0x25d9d9[_0x7da2('0x2d')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x260fb4[_0x7da2('0x3a')][_0x7da2('0x81')]=_[_0x7da2('0xb0')](_0x34b504,_0x25d9d9);if(!_0x260fb4[_0x7da2('0x3a')]['fields']['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x260fb4['body'][_0x7da2('0x81')][_0x7da2('0xb1')]){throw new Error(_0x7da2('0xb2'));}var _0x12778=path[_0x7da2('0x3f')](config[_0x7da2('0xb3')],_0x7da2('0xb4'),_0x260fb4['file'][_0x7da2('0xb5')]);fs['chmodSync'](_0x12778,parseInt(_0x7da2('0xb6'),0x8));var _0x2d037d=require(_0x7da2('0xb7'))[_0x7da2('0xb8')](path[_0x7da2('0x3f')](__dirname,_0x7da2('0xb9')),[_0x12778,_0x260fb4[_0x7da2('0x3a')][_0x7da2('0xaa')],_0x260fb4[_0x7da2('0x3a')][_0x7da2('0xac')],_0x260fb4[_0x7da2('0x3a')]['ListId'],_0x260fb4[_0x7da2('0x3a')][_0x7da2('0xba')],_0x260fb4[_0x7da2('0x3a')][_0x7da2('0x5e')],_0x260fb4[_0x7da2('0x3a')]['socket_timestamp']]);return _0x3398f3[_0x7da2('0x11')](0xc8)[_0x7da2('0x12')]({'message':'File\x20uploaded\x20correctly!','pid':_0x2d037d[_0x7da2('0xbb')]});}catch(_0x13a7de){return _0x3398f3[_0x7da2('0x11')](0x1f4)[_0x7da2('0x20')](_0x13a7de);}};exports[_0x7da2('0xbc')]=function(_0x1fe39b,_0x26f975){var _0x5d5895=fs[_0x7da2('0xbd')](_0x1fe39b[_0x7da2('0xbe')]['path']);Papa[_0x7da2('0xbf')](_0x5d5895,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x1f4b1b){return _0x26f975[_0x7da2('0x11')](0xc8)[_0x7da2('0x12')]({'file':_0x1fe39b[_0x7da2('0xbe')],'fields':_0x1f4b1b['meta'][_0x7da2('0x81')]});}});};exports['import']=function(_0x20fb95,_0x11fa7c){return db[_0x7da2('0xc0')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x7da2('0xc1')}})[_0x7da2('0x1a')](function(_0x59429c){var _0xc9f9b5=![];if(!_0x20fb95[_0x7da2('0x3a')][_0x7da2('0x62')]){throw new Error(_0x7da2('0xa9'));}if(!_0x20fb95[_0x7da2('0x3a')][_0x7da2('0xc2')][_0x7da2('0x7b')]){throw new Error(_0x7da2('0xc3'));}if(!_0x20fb95[_0x7da2('0x3a')][_0x7da2('0xc2')][_0x7da2('0xb1')]){throw new Error(_0x7da2('0xb2'));}if(!_0x20fb95[_0x7da2('0x3a')][_0x7da2('0xc4')]){throw new Error(_0x7da2('0xae'));}var _0x1bfee3=require(_0x7da2('0xb7'))[_0x7da2('0xb8')](path[_0x7da2('0x3f')](__dirname,_0x7da2('0xc5')),[_0x20fb95[_0x7da2('0x29')]['id'],JSON[_0x7da2('0xc6')](_0x20fb95[_0x7da2('0x3a')]),JSON[_0x7da2('0xc6')](_0x59429c)]);_0x1bfee3['on'](_0x7da2('0xc7'),function(){_0xc9f9b5=!![];return _0x11fa7c['status'](0xc8)['json']({'message':_0x7da2('0xc8'),'pid':_0x1bfee3[_0x7da2('0xbb')]});});_0x1bfee3['on'](_0x7da2('0xc9'),function(_0x3c35d7){if(_0x3c35d7&&!_0xc9f9b5){return _0x11fa7c[_0x7da2('0x11')](0x1f4)['json']({'message':_0x7da2('0xca'),'pid':_0x1bfee3[_0x7da2('0xbb')]});}});})[_0x7da2('0x26')](handleError(_0x11fa7c,null));};exports[_0x7da2('0xcb')]=function(_0xf405a4,_0xd07318){return db[_0x7da2('0xc0')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x7da2('0x1a')](function(_0x3d31e3){var _0x38678e=![];if(!_0xf405a4[_0x7da2('0x3a')][_0x7da2('0x62')]){throw new Error(_0x7da2('0xa9'));}if(!_0xf405a4['body'][_0x7da2('0xc2')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0xf405a4[_0x7da2('0x3a')][_0x7da2('0xc2')][_0x7da2('0xb1')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0xf405a4[_0x7da2('0x3a')][_0x7da2('0xc4')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x36badc=require(_0x7da2('0xb7'))['fork'](path[_0x7da2('0x3f')](__dirname,'../../components/import/cm/csvUpdates'),[_0xf405a4['params']['id'],JSON[_0x7da2('0xc6')](_0xf405a4[_0x7da2('0x3a')]),JSON[_0x7da2('0xc6')](_0x3d31e3)]);_0x36badc['on'](_0x7da2('0xc7'),function(){_0x38678e=!![];return _0xd07318[_0x7da2('0x11')](0xc8)[_0x7da2('0x12')]({'message':_0x7da2('0xc8'),'pid':_0x36badc[_0x7da2('0xbb')]});});_0x36badc['on'](_0x7da2('0xc9'),function(_0x29d182){if(_0x29d182&&!_0x38678e){return _0xd07318[_0x7da2('0x11')](0x1f4)[_0x7da2('0x12')]({'message':_0x7da2('0xca'),'pid':_0x36badc[_0x7da2('0xbb')]});}});})[_0x7da2('0x26')](handleError(_0xd07318,null));};exports[_0x7da2('0xcc')]=function(_0x2f578f,_0x4a36aa){var _0x1d5b87=[_0x7da2('0xcd'),'chat','sms','openchannel',_0x7da2('0xce'),_0x7da2('0xcf'),_0x7da2('0xd0')];var _0x1b11c1={'offset':0x0,'order':qs['sort'](_0x7da2('0xd1'))},_0x19ff3d={'count':0x0,'rows':[]};Promise[_0x7da2('0xd2')]()[_0x7da2('0x1a')](function(){if(_0x2f578f['query'][_0x7da2('0xd3')]){if(!_[_0x7da2('0xd4')](_0x1d5b87,_0x2f578f[_0x7da2('0x24')][_0x7da2('0xd3')][_0x7da2('0xd5')]())){throw new Error(_0x7da2('0xd6'));}_0x1d5b87=[_0x2f578f[_0x7da2('0x24')][_0x7da2('0xd3')]['toLowerCase']()];}if(_0x2f578f[_0x7da2('0x24')][_0x7da2('0xd7')]){try{var _0x5bf0bd=JSON[_0x7da2('0xbf')](_0x2f578f[_0x7da2('0x24')][_0x7da2('0xd7')]);if(!moment(_0x5bf0bd['from'])['isValid']()){throw new Error(_0x7da2('0xd8'));}if(!moment(_0x5bf0bd['to'])[_0x7da2('0xd9')]()){throw new Error(_0x7da2('0xda'));}}catch(_0x27829b){throw new Error(_0x7da2('0xdb'));}}if(!_0x2f578f[_0x7da2('0x24')][_0x7da2('0x38')](_0x7da2('0x9f'))){_0x1b11c1[_0x7da2('0x14')]=qs['limit'](_0x2f578f[_0x7da2('0x24')][_0x7da2('0x14')]||0xa);_0x1b11c1[_0x7da2('0x13')]=qs[_0x7da2('0x13')](_0x2f578f[_0x7da2('0x24')][_0x7da2('0x13')]);}var _0x1572e6=_0x1d5b87[_0x7da2('0x75')](function(_0x41f6ce){if(_0x41f6ce===_0x7da2('0xd0')){var _0x233353={'attributes':['id',_0x7da2('0xdc'),_0x7da2('0x34'),'source',_0x7da2('0xdd'),_0x7da2('0xde'),_0x7da2('0xdf'),_0x7da2('0xe0'),_0x7da2('0xe1'),_0x7da2('0xe2'),'createdAt',_0x7da2('0xe3'),_0x7da2('0xe4'),_0x7da2('0xe5'),_0x7da2('0xe6')],'where':{'ContactId':_0x2f578f[_0x7da2('0x29')]['id']},'include':[{'model':db[_0x7da2('0xc0')],'as':_0x7da2('0xc0'),'attributes':['id',_0x7da2('0x1f'),_0x7da2('0xe7'),_0x7da2('0xe8')]}],'order':[[_0x7da2('0xe9'),_0x7da2('0xea')]]};if(_0x2f578f[_0x7da2('0x24')][_0x7da2('0xd7')]){_0x233353[_0x7da2('0x5f')]['createdAt']={'$gte':_0x5bf0bd['from'],'$lte':_0x5bf0bd['to']};}return db['VoiceCallReport'][_0x7da2('0xeb')](_0x233353)[_0x7da2('0x1a')](function(_0x31219f){_0x19ff3d[_0x7da2('0x16')]+=_0x31219f[_0x7da2('0x16')];return _['map'](_0x31219f[_0x7da2('0xa3')],function(_0x444771){var _0x31c18d=_0x444771[_0x7da2('0x3c')]({'plain':!![]});_0x31c18d[_0x7da2('0xd3')]=_0x41f6ce;if(_0x31c18d[_0x7da2('0xc0')]){_0x31c18d[_0x7da2('0xc0')]={'id':_0x31c18d[_0x7da2('0xc0')]['id'],'name':_0x31c18d[_0x7da2('0xc0')]['name'],'fullname':_0x31c18d[_0x7da2('0xc0')][_0x7da2('0xe7')],'alias':_0x31c18d[_0x7da2('0xc0')][_0x7da2('0xe8')]};}return _0x31c18d;});});}else{var _0x2a14f0=_[_0x7da2('0xec')](_0x41f6ce)+(_0x41f6ce===_0x7da2('0xed')?_0x7da2('0xee'):_0x7da2('0xef'));var _0x50d33a={'attributes':['id','closed',_0x7da2('0xf0'),_0x7da2('0xe9'),_0x7da2('0xe2'),_0x7da2('0xf1'),_0x7da2('0xf2'),_0x7da2('0xf3'),'UserId',_0x2a14f0+'Id'],'where':{'ContactId':_0x2f578f[_0x7da2('0x29')]['id']},'include':[{'model':db[_0x2a14f0],'as':_0x7da2('0xef'),'attributes':['id','name',_0x7da2('0xf4')]},{'model':db[_0x7da2('0xc0')],'as':_0x7da2('0xf5'),'attributes':['id',_0x7da2('0x1f'),_0x7da2('0xe7')]},{'model':db[_0x7da2('0x67')],'as':'Tags','attributes':['id',_0x7da2('0x1f'),_0x7da2('0x69')],'through':{'attributes':[]}}],'order':[['createdAt','DESC']]};if(_0x2f578f[_0x7da2('0x24')][_0x7da2('0xd7')]){_0x50d33a[_0x7da2('0x5f')][_0x7da2('0xe9')]={'$gte':_0x5bf0bd['from'],'$lte':_0x5bf0bd['to']};}switch(_0x41f6ce){case _0x7da2('0xed'):_0x50d33a['attributes'][_0x7da2('0x61')](_0x7da2('0xf6'),_0x7da2('0xf7'),_0x7da2('0xf8'),_0x7da2('0xf9'),_0x7da2('0xfa'),_0x7da2('0xfb'),'ratingType',_0x7da2('0xfc'),_0x7da2('0xfd'));break;case _0x7da2('0xcd'):_0x50d33a[_0x7da2('0x82')][_0x7da2('0x61')](_0x7da2('0xfe'),_0x7da2('0xff'));break;case _0x7da2('0x100'):_0x50d33a[_0x7da2('0x82')]['push']('externalUrl',_0x7da2('0x101'));break;}return db[_[_0x7da2('0xec')](_0x41f6ce)+_0x7da2('0x102')][_0x7da2('0xeb')](_0x50d33a)['then'](function(_0x12f736){_0x19ff3d[_0x7da2('0x16')]+=_0x12f736[_0x7da2('0x16')];return _[_0x7da2('0x75')](_0x12f736[_0x7da2('0xa3')],function(_0x1482af){var _0x2c9458=_0x1482af[_0x7da2('0x3c')]({'plain':!![]});_0x2c9458[_0x7da2('0xd3')]=_0x41f6ce;if(_0x2c9458['Owner']){_0x2c9458[_0x7da2('0xf5')]={'id':_0x2c9458[_0x7da2('0xf5')]['id'],'name':_0x2c9458['Owner'][_0x7da2('0x1f')],'fullname':_0x2c9458['Owner']['fullname']};}return _0x2c9458;});});}});return Promise[_0x7da2('0x65')](_0x1572e6);})['then'](function(_0x439acb){return _(_0x439acb)[_0x7da2('0x103')]()[_0x7da2('0x104')](_0x7da2('0xe9'))[_0x7da2('0x105')]()[_0x7da2('0x106')]();})[_0x7da2('0x1a')](function(_0x22bf2c){_0x19ff3d[_0x7da2('0xa3')]=_0x1b11c1[_0x7da2('0x14')]?_0x22bf2c[_0x7da2('0x107')](_0x1b11c1['offset'],_0x1b11c1['offset']+_0x1b11c1[_0x7da2('0x14')]):_0x22bf2c;return _0x19ff3d;})[_0x7da2('0x1a')](respondWithFilteredResult(_0x4a36aa,_0x1b11c1))[_0x7da2('0x26')](handleError(_0x4a36aa,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 85d0e5a..d124a7c 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 _0x23ce=['save','update','remove','hasOwnProperty','hook','events','../../mysqldb','CmContact','setMaxListeners'];(function(_0xa087f5,_0x34fd10){var _0x4c8806=function(_0x4b1cfe){while(--_0x4b1cfe){_0xa087f5['push'](_0xa087f5['shift']());}};_0x4c8806(++_0x34fd10);}(_0x23ce,0x140));var _0xe23c=function(_0x377c68,_0x5f10d7){_0x377c68=_0x377c68-0x0;var _0x21fdfc=_0x23ce[_0x377c68];return _0x21fdfc;};'use strict';var EventEmitter=require(_0xe23c('0x0'));var CmContact=require(_0xe23c('0x1'))['db'][_0xe23c('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xe23c('0x3')](0x0);var events={'afterCreate':_0xe23c('0x4'),'afterUpdate':_0xe23c('0x5'),'afterDestroy':_0xe23c('0x6')};function emitEvent(_0x4740c1){return function(_0x2726a6,_0x512ec3,_0x5267bf){CmContactEvents['emit'](_0x4740c1+':'+_0x2726a6['id'],_0x2726a6);CmContactEvents['emit'](_0x4740c1,_0x2726a6);_0x5267bf(null);};}for(var e in events){if(events[_0xe23c('0x7')](e)){var event=events[e];CmContact[_0xe23c('0x8')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0x723f=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','CmContact','setMaxListeners','save','update'];(function(_0x55021a,_0x15fdee){var _0x1affcf=function(_0x149a50){while(--_0x149a50){_0x55021a['push'](_0x55021a['shift']());}};_0x1affcf(++_0x15fdee);}(_0x723f,0x18a));var _0xf723=function(_0x4aeddc,_0x288ae8){_0x4aeddc=_0x4aeddc-0x0;var _0x4106fb=_0x723f[_0x4aeddc];return _0x4106fb;};'use strict';var EventEmitter=require(_0xf723('0x0'));var CmContact=require(_0xf723('0x1'))['db'][_0xf723('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xf723('0x3')](0x0);var events={'afterCreate':_0xf723('0x4'),'afterUpdate':_0xf723('0x5'),'afterDestroy':_0xf723('0x6')};function emitEvent(_0x3fc9e4){return function(_0x516c11,_0x1d6469,_0x439eb0){CmContactEvents['emit'](_0x3fc9e4+':'+_0x516c11['id'],_0x516c11);CmContactEvents['emit'](_0x3fc9e4,_0x516c11);_0x439eb0(null);};}for(var e in events){if(events[_0xf723('0x7')](e)){var event=events[e];CmContact[_0xf723('0x8')](e,emitEvent(event));}}module[_0xf723('0x9')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 408e20e..c88b9f8 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 _0xaf3a=['models','isEmpty','destroy','CampaignId','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','email','utf8mb4','utf8mb4_unicode_ci','get','error','cmContact','inspect','scheduledat','format','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','YYYY-MM-DD\x20HH:mm:ss','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','CmHopper','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','afterCreate','Campaign','minutes','\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','dialCheckDuplicateType','CmList','BlackLists','length','CmHopperBlack','cmContact,\x20%s,\x20%s','message','always','List\x20not\x20found'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaf3a,0x1be));var _0xaaf3=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xaf3a[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0xaaf3('0x0'));var util=require(_0xaaf3('0x1'));var logger=require(_0xaaf3('0x2'))('api');var moment=require(_0xaaf3('0x3'));var BPromise=require(_0xaaf3('0x4'));var rp=require(_0xaaf3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaaf3('0x6'));var config=require(_0xaaf3('0x7'));var shared=require(_0xaaf3('0x8'));var attributes=require(_0xaaf3('0x9'));module[_0xaaf3('0xa')]=function(_0x350d73,_0x2f2e47){return _0x350d73[_0xaaf3('0xb')]('CmContact',attributes,{'tableName':_0xaaf3('0xc'),'paranoid':!![],'indexes':[{'name':_0xaaf3('0xd'),'fields':[_0xaaf3('0xd')]},{'name':_0xaaf3('0xe'),'fields':[_0xaaf3('0xf'),_0xaaf3('0x10'),_0xaaf3('0xd'),_0xaaf3('0x11'),'fax',_0xaaf3('0x12')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0xaaf3('0x13'),'collate':_0xaaf3('0x14'),'hooks':{'afterCreate':function(_0x337492,_0x194647,_0x49c6e4){var _0x44c757=_0x350d73['models'];var _0x34fefe=_0x337492[_0xaaf3('0x15')]({'plain':!![]});function _0x28b09f(){return function(_0x53469f){logger[_0xaaf3('0x16')](_0xaaf3('0x17'),'afterCreate',util[_0xaaf3('0x18')](_0x53469f,{'showHidden':![],'depth':null}));};}function _0x3e3e62(_0x79302f,_0x46347c){var _0x1cda8b=_0x46347c['scheduledat']?_0x46347c[_0xaaf3('0x19')]:moment()[_0xaaf3('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x54d05e,_0x49fc48){if(_[_0xaaf3('0x1b')](_0x46347c[_0xaaf3('0x1c')])){_0x54d05e({'ret':_0x1cda8b});}else{_0x44c757[_0xaaf3('0x1d')][_0xaaf3('0x1e')]({'where':{'id':_0x79302f['id']}})[_0xaaf3('0x1f')](function(_0x165d88){if(!_['isNil'](_0x165d88)){var _0xdaaaa6=_0x165d88[_0xaaf3('0x1c')];if(!_[_0xaaf3('0x1b')](_0xdaaaa6)){var _0x5891d9=shared[_0xaaf3('0x20')];var _0x11ba90=_0x5891d9[_0xdaaaa6];var _0x20b397=_0x5891d9[_0x46347c[_0xaaf3('0x1c')]];if(!_[_0xaaf3('0x1b')](_0x11ba90)&&!_[_0xaaf3('0x1b')](_0x20b397)){var _0x2bbc39=_0x11ba90[_0xaaf3('0x21')]-_0x20b397[_0xaaf3('0x21')];_0x1cda8b=_0x46347c[_0xaaf3('0x19')]?_0x46347c[_0xaaf3('0x19')]:moment();var _0x5781ce=moment(_0x1cda8b)[_0xaaf3('0x22')](_0x2bbc39,'minutes');_0x54d05e({'ret':_0x5781ce[_0xaaf3('0x1a')](_0xaaf3('0x23'))});}else _0x54d05e({'ret':_0x1cda8b});}else _0x54d05e({'ret':_0x1cda8b});}else{_0x54d05e({'ret':_0x1cda8b});}});}});return 0xa;}var _0xe8bf5e=function(_0x2ccb35){return new BPromise(function(_0x545298,_0x458feb){_0x3e3e62(_0x2ccb35,_0x34fefe)[_0xaaf3('0x1f')](function(_0x3bc019){_0x34fefe['scheduledat']=_0x3bc019[_0xaaf3('0x24')];_0x44c757['CmHopper']['findOne']({'where':{'phone':_0x34fefe[_0xaaf3('0xd')],'VoiceQueueId':_0x2ccb35['id']}})[_0xaaf3('0x1f')](function(_0x3dfb52){if(!_[_0xaaf3('0x1b')](_0x3dfb52)){throw new Error(_0xaaf3('0x25')+_0x34fefe[_0xaaf3('0xd')]+_0xaaf3('0x26')+_0x2ccb35['id']);}return _0x44c757['CmHopper'][_0xaaf3('0x27')]({'phone':_0x34fefe[_0xaaf3('0xd')],'ContactId':_0x34fefe['id'],'ListId':_0x34fefe[_0xaaf3('0x28')],'priority':_0x34fefe[_0xaaf3('0x29')]?_0x34fefe[_0xaaf3('0x29')]:0x2,'scheduledat':_0x34fefe[_0xaaf3('0x19')]?_0x34fefe[_0xaaf3('0x19')]:moment()[_0xaaf3('0x1a')](_0xaaf3('0x23')),'callback':_0x34fefe[_0xaaf3('0x2a')]?!![]:![],'callbackuniqueid':_0x34fefe['callbackUniqueid']?_0x34fefe['callbackUniqueid']:undefined,'callbackat':_0x34fefe[_0xaaf3('0x2a')]?moment()['format'](_0xaaf3('0x23')):undefined,'VoiceQueueId':_0x2ccb35['id']});})[_0xaaf3('0x2b')](function(_0x4de223){_0x458feb(_0x4de223);});});});};var _0x321978=function(_0x39e468){return new BPromise(function(_0x301905,_0xd74a16){_0x3e3e62(_0x39e468,_0x34fefe)['then'](function(_0x32de21){_0x34fefe['scheduledat']=_0x32de21[_0xaaf3('0x24')];_0x44c757[_0xaaf3('0x2c')][_0xaaf3('0x1e')]({'where':{'phone':_0x34fefe[_0xaaf3('0xd')],'VoiceQueueId':_0x39e468['id']}})[_0xaaf3('0x1f')](function(_0x2c45f0){if(!_[_0xaaf3('0x1b')](_0x2c45f0)){throw new Error('cmContact,\x20afterCreate\x20'+_0x34fefe[_0xaaf3('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x39e468['id']);}return _0x44c757[_0xaaf3('0x2d')][_0xaaf3('0x1e')]({'where':{'calleridnum':_0x34fefe['phone'],'VoiceQueueId':_0x39e468['id']}});})[_0xaaf3('0x1f')](function(_0xc3cf14){if(!_[_0xaaf3('0x1b')](_0xc3cf14)){throw new Error(_0xaaf3('0x2e')+_0x34fefe[_0xaaf3('0xd')]+_0xaaf3('0x2f')+_0x39e468['id']);}return _0x44c757[_0xaaf3('0x2c')]['create']({'phone':_0x34fefe[_0xaaf3('0xd')],'ContactId':_0x34fefe['id'],'ListId':_0x34fefe[_0xaaf3('0x28')],'priority':_0x34fefe['priority']?_0x34fefe[_0xaaf3('0x29')]:0x2,'scheduledat':_0x34fefe[_0xaaf3('0x19')]?_0x34fefe[_0xaaf3('0x19')]:moment()[_0xaaf3('0x1a')](_0xaaf3('0x23')),'callback':_0x34fefe['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x34fefe['callbackUniqueid']?_0x34fefe[_0xaaf3('0x2a')]:undefined,'callbackat':_0x34fefe['callbackUniqueid']?moment()[_0xaaf3('0x1a')](_0xaaf3('0x23')):undefined,'VoiceQueueId':_0x39e468['id']});})[_0xaaf3('0x2b')](function(_0x4e4213){_0xd74a16(_0x4e4213);});});});};function _0x4c16c5(){return function(_0x21909e){logger[_0xaaf3('0x16')](_0xaaf3('0x17'),_0xaaf3('0x30'),util[_0xaaf3('0x18')](_0x21909e,{'showHidden':![],'depth':null}));};}function _0x4774e9(_0x67fc1d,_0x29ac55){var _0x58c401=_0x29ac55[_0xaaf3('0x19')]?_0x29ac55[_0xaaf3('0x19')]:moment()[_0xaaf3('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x1349ff,_0x551fb2){if(_[_0xaaf3('0x1b')](_0x29ac55[_0xaaf3('0x1c')])){_0x1349ff({'ret':_0x58c401});}else{_0x44c757[_0xaaf3('0x31')][_0xaaf3('0x1e')]({'where':{'id':_0x67fc1d['id']}})[_0xaaf3('0x1f')](function(_0x5e9058){if(!_[_0xaaf3('0x1b')](_0x5e9058)){var _0x30daab=_0x5e9058[_0xaaf3('0x1c')];if(!_[_0xaaf3('0x1b')](_0x30daab)){var _0x288c62=shared[_0xaaf3('0x20')];var _0x21274d=_0x288c62[_0x30daab];var _0x41b5b7=_0x288c62[_0x29ac55[_0xaaf3('0x1c')]];if(!_[_0xaaf3('0x1b')](_0x21274d)&&!_[_0xaaf3('0x1b')](_0x41b5b7)){var _0x53ce50=_0x21274d[_0xaaf3('0x21')]-_0x41b5b7[_0xaaf3('0x21')];_0x58c401=_0x29ac55[_0xaaf3('0x19')]?_0x29ac55[_0xaaf3('0x19')]:moment();var _0x1a4d8f=moment(_0x58c401)[_0xaaf3('0x22')](_0x53ce50,_0xaaf3('0x32'));_0x1349ff({'ret':_0x1a4d8f[_0xaaf3('0x1a')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1349ff({'ret':_0x58c401});}else _0x1349ff({'ret':_0x58c401});}else{_0x1349ff({'ret':_0x58c401});}});}});return 0xa;}var _0x1cc9a4=function(_0x3bcdcd){return new BPromise(function(_0x28369e,_0x167dcd){_0x4774e9(_0x3bcdcd,_0x34fefe)[_0xaaf3('0x1f')](function(_0x175468){_0x34fefe[_0xaaf3('0x19')]=_0x175468['ret'];_0x44c757[_0xaaf3('0x2c')][_0xaaf3('0x1e')]({'where':{'phone':_0x34fefe[_0xaaf3('0xd')],'CampaignId':_0x3bcdcd['id']}})[_0xaaf3('0x1f')](function(_0xf7749d){if(!_['isNil'](_0xf7749d)){throw new Error('cmContact,\x20afterCreate\x20'+_0x34fefe['phone']+_0xaaf3('0x33')+_0x3bcdcd['id']);}return _0x44c757[_0xaaf3('0x2c')][_0xaaf3('0x27')]({'phone':_0x34fefe[_0xaaf3('0xd')],'ContactId':_0x34fefe['id'],'ListId':_0x34fefe[_0xaaf3('0x28')],'priority':_0x34fefe[_0xaaf3('0x29')]?_0x34fefe[_0xaaf3('0x29')]:0x2,'scheduledat':_0x34fefe[_0xaaf3('0x19')]?_0x34fefe[_0xaaf3('0x19')]:moment()[_0xaaf3('0x1a')](_0xaaf3('0x23')),'callback':_0x34fefe[_0xaaf3('0x2a')]?!![]:![],'callbackuniqueid':_0x34fefe[_0xaaf3('0x2a')]?_0x34fefe[_0xaaf3('0x2a')]:undefined,'callbackat':_0x34fefe[_0xaaf3('0x2a')]?moment()[_0xaaf3('0x1a')](_0xaaf3('0x23')):undefined,'CampaignId':_0x3bcdcd['id']});})[_0xaaf3('0x2b')](function(_0x10bc87){_0x167dcd(_0x10bc87);});});});};var _0x1d678a=function(_0xf44293){return new BPromise(function(_0x60cdb3,_0x8e9835){_0x4774e9(_0xf44293,_0x34fefe)[_0xaaf3('0x1f')](function(_0x1097a7){_0x34fefe[_0xaaf3('0x19')]=_0x1097a7['ret'];_0x44c757[_0xaaf3('0x2c')]['findOne']({'where':{'phone':_0x34fefe['phone'],'CampaignId':_0xf44293['id']}})['then'](function(_0x5acd38){if(!_[_0xaaf3('0x1b')](_0x5acd38)){throw new Error(_0xaaf3('0x25')+_0x34fefe[_0xaaf3('0xd')]+_0xaaf3('0x34')+_0xf44293['id']);}return _0x44c757['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x34fefe[_0xaaf3('0xd')],'CampaignId':_0xf44293['id']}});})[_0xaaf3('0x1f')](function(_0x8167fd){if(!_[_0xaaf3('0x1b')](_0x8167fd)){throw new Error(_0xaaf3('0x2e')+_0x34fefe[_0xaaf3('0xd')]+_0xaaf3('0x35')+_0xf44293['id']);}return _0x44c757['CmHopper'][_0xaaf3('0x27')]({'phone':_0x34fefe[_0xaaf3('0xd')],'ContactId':_0x34fefe['id'],'ListId':_0x34fefe[_0xaaf3('0x28')],'priority':_0x34fefe[_0xaaf3('0x29')]?_0x34fefe[_0xaaf3('0x29')]:0x2,'scheduledat':_0x34fefe[_0xaaf3('0x19')]?_0x34fefe['scheduledat']:moment()['format'](_0xaaf3('0x23')),'callback':_0x34fefe['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x34fefe[_0xaaf3('0x2a')]?_0x34fefe[_0xaaf3('0x2a')]:undefined,'callbackat':_0x34fefe[_0xaaf3('0x2a')]?moment()[_0xaaf3('0x1a')](_0xaaf3('0x23')):undefined,'CampaignId':_0xf44293['id']});})[_0xaaf3('0x2b')](function(_0x19cc53){_0x8e9835(_0x19cc53);});});});};if(_0x34fefe[_0xaaf3('0x28')]){_0x44c757[_0xaaf3('0x1d')][_0xaaf3('0x36')]({'where':{'type':_0xaaf3('0x37')},'attributes':['id',_0xaaf3('0x38'),_0xaaf3('0x1c')],'include':[{'model':_0x44c757[_0xaaf3('0x39')],'as':'Lists','where':{'id':_0x34fefe[_0xaaf3('0x28')]}}]})['then'](function(_0xf48fd6){if(_0xf48fd6){var _0x2f7643=[];for(var _0x1929b0=0x0,_0x5cb42c;_0x1929b0<_0xf48fd6['length'];_0x1929b0+=0x1){_0x5cb42c=_0xf48fd6[_0x1929b0][_0xaaf3('0x15')]({'plain':!![]});switch(_0x5cb42c[_0xaaf3('0x38')]){case'always':_0x321978(_0x5cb42c)[_0xaaf3('0x2b')](_0x28b09f());break;case'onlyIfOpen':_0xe8bf5e(_0x5cb42c)[_0xaaf3('0x2b')](_0x28b09f());break;default:_0x4774e9(_0x5cb42c,_0x34fefe)[_0xaaf3('0x1f')](function(_0x28cedc){_0x34fefe[_0xaaf3('0x19')]=_0x28cedc[_0xaaf3('0x24')];_0x44c757[_0xaaf3('0x2c')][_0xaaf3('0x27')]({'phone':_0x34fefe['phone'],'ContactId':_0x34fefe['id'],'ListId':_0x34fefe[_0xaaf3('0x28')],'scheduledat':_0x34fefe[_0xaaf3('0x19')]?_0x34fefe['scheduledat']:moment()['format'](_0xaaf3('0x23')),'priority':_0x34fefe['priority']?_0x34fefe[_0xaaf3('0x29')]:0x2,'callback':_0x34fefe[_0xaaf3('0x2a')]?!![]:![],'callbackuniqueid':_0x34fefe['callbackUniqueid']?_0x34fefe['callbackUniqueid']:undefined,'callbackat':_0x34fefe[_0xaaf3('0x2a')]?moment()['format'](_0xaaf3('0x23')):undefined,'VoiceQueueId':_0x5cb42c['id']})[_0xaaf3('0x2b')](_0x28b09f());});}}}})[_0xaaf3('0x1f')](function(){return _0x44c757['VoiceQueue'][_0xaaf3('0x36')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x44c757[_0xaaf3('0x39')],'as':_0xaaf3('0x3a'),'where':{'id':_0x34fefe[_0xaaf3('0x28')]}}]})[_0xaaf3('0x1f')](function(_0x2b43b8){if(_0x2b43b8){var _0x349092=[];for(var _0x42c04f=0x0,_0x22f4de;_0x42c04f<_0x2b43b8[_0xaaf3('0x3b')];_0x42c04f+=0x1){_0x22f4de=_0x2b43b8[_0x42c04f][_0xaaf3('0x15')]({'plain':!![]});_0x44c757[_0xaaf3('0x3c')]['create']({'phone':_0x34fefe['phone'],'ContactId':_0x34fefe['id'],'ListId':_0x34fefe[_0xaaf3('0x28')],'VoiceQueueId':_0x22f4de['id']})['catch'](function(_0x3acd46){logger[_0xaaf3('0x16')](_0xaaf3('0x3d'),'afterCreate',_0x3acd46[_0xaaf3('0x3e')]);});}}});})[_0xaaf3('0x1f')](function(){return _0x44c757[_0xaaf3('0x31')][_0xaaf3('0x36')]({'attributes':['id',_0xaaf3('0x38'),_0xaaf3('0x1c')],'include':[{'model':_0x44c757[_0xaaf3('0x39')],'as':'Lists','where':{'id':_0x34fefe[_0xaaf3('0x28')]}}]})['then'](function(_0x42cf8b){if(_0x42cf8b){var _0x5728cb=[];for(var _0x45f20e=0x0,_0x3d7aaf;_0x45f20e<_0x42cf8b[_0xaaf3('0x3b')];_0x45f20e+=0x1){_0x3d7aaf=_0x42cf8b[_0x45f20e]['get']({'plain':!![]});switch(_0x3d7aaf['dialCheckDuplicateType']){case _0xaaf3('0x3f'):_0x1d678a(_0x3d7aaf)['catch'](_0x4c16c5());break;case'onlyIfOpen':_0x1cc9a4(_0x3d7aaf)[_0xaaf3('0x2b')](_0x4c16c5());break;default:_0x44c757[_0xaaf3('0x2c')][_0xaaf3('0x27')]({'phone':_0x34fefe[_0xaaf3('0xd')],'ContactId':_0x34fefe['id'],'ListId':_0x34fefe[_0xaaf3('0x28')],'scheduledat':_0x34fefe[_0xaaf3('0x19')]?_0x34fefe[_0xaaf3('0x19')]:moment()[_0xaaf3('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x34fefe['priority']?_0x34fefe[_0xaaf3('0x29')]:0x2,'callback':_0x34fefe[_0xaaf3('0x2a')]?!![]:![],'callbackuniqueid':_0x34fefe[_0xaaf3('0x2a')]?_0x34fefe['callbackUniqueid']:undefined,'callbackat':_0x34fefe[_0xaaf3('0x2a')]?moment()[_0xaaf3('0x1a')](_0xaaf3('0x23')):undefined,'CampaignId':_0x3d7aaf['id']})[_0xaaf3('0x2b')](_0x4c16c5());}}}});})['then'](function(){return _0x44c757[_0xaaf3('0x31')][_0xaaf3('0x36')]({'attributes':['id'],'include':[{'model':_0x44c757[_0xaaf3('0x39')],'as':_0xaaf3('0x3a'),'where':{'id':_0x34fefe[_0xaaf3('0x28')]}}]})[_0xaaf3('0x1f')](function(_0x22420b){if(_0x22420b){var _0x4b2e90=[];for(var _0x497cdb=0x0,_0x29026c;_0x497cdb<_0x22420b[_0xaaf3('0x3b')];_0x497cdb+=0x1){_0x29026c=_0x22420b[_0x497cdb]['get']({'plain':!![]});_0x44c757[_0xaaf3('0x3c')][_0xaaf3('0x27')]({'phone':_0x34fefe[_0xaaf3('0xd')],'ContactId':_0x34fefe['id'],'ListId':_0x34fefe[_0xaaf3('0x28')],'CampaignId':_0x29026c['id']})[_0xaaf3('0x2b')](function(_0xb84c32){logger['error'](_0xaaf3('0x3d'),_0xaaf3('0x30'),_0xb84c32['message']);});}}});})['then'](function(){_0x49c6e4();})['catch'](function(_0x3fb38f){logger[_0xaaf3('0x16')]('cmContact,\x20%s,\x20%s','afterCreate',_0x3fb38f[_0xaaf3('0x3e')]);_0x49c6e4(_0x3fb38f);});}else{_0x49c6e4(new Error(_0xaaf3('0x40')));}},'afterDestroy':function(_0x19d941,_0x2728b9,_0x1adabe){var _0x34b831=_0x350d73[_0xaaf3('0x41')];var _0x1f21aa=_0x19d941[_0xaaf3('0x15')]({'plain':!![]});return _0x34b831[_0xaaf3('0x2c')][_0xaaf3('0x36')]({'raw':!![],'where':{'ListId':_0x1f21aa[_0xaaf3('0x28')],'ContactId':_0x1f21aa['id']}})[_0xaaf3('0x1f')](function(_0x25c1ac){if(!_[_0xaaf3('0x42')](_0x25c1ac)){var _0x2542e3=[];for(var _0x212846=0x0;_0x212846<_0x25c1ac[_0xaaf3('0x3b')];_0x212846+=0x1){var _0x39fc49=_0x34b831[_0xaaf3('0x2c')][_0xaaf3('0x43')]({'where':{'ListId':_0x25c1ac[_0x212846]['ListId'],'ContactId':_0x25c1ac[_0x212846]['ContactId'],'VoiceQueueId':_0x25c1ac[_0x212846]['VoiceQueueId'],'CampaignId':_0x25c1ac[_0x212846][_0xaaf3('0x44')]}});_0x2542e3['push'](_0x39fc49);}return BPromise[_0xaaf3('0x45')](_0x2542e3);}})[_0xaaf3('0x1f')](function(_0x5271a8){logger[_0xaaf3('0x46')](_0xaaf3('0x47'),util['inspect'](_0x5271a8,{'showHidden':![],'depth':null}));_0x1adabe();})['catch'](function(_0x467dad){logger[_0xaaf3('0x16')](_0xaaf3('0x48'),util[_0xaaf3('0x18')](_0x467dad,{'showHidden':![],'depth':null}));_0x1adabe(_0x467dad);});}}});}; \ No newline at end of file +var _0x420f=['priority','callbackUniqueid','catch','ret','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','Campaign','CmHopperFinal','outbound','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','findAll','BlackLists','CmHopperBlack','error','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','ContactId','VoiceQueueId','CampaignId','all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','api','moment','request-promise','path','define','CmContact','cm_contacts','phone','firstName','lastName','mobile','fax','email','utf8mb4','utf8mb4_unicode_ci','get','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','VoiceQueue','then','timezones','isNil','utcOffset','add','minutes','CmHopper','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x420f,0x1ea));var _0xf420=function(_0x27e01b,_0x22e76a){_0x27e01b=_0x27e01b-0x0;var _0x5cc835=_0x420f[_0x27e01b];return _0x5cc835;};'use strict';var _=require(_0xf420('0x0'));var util=require(_0xf420('0x1'));var logger=require('../../config/logger')(_0xf420('0x2'));var moment=require(_0xf420('0x3'));var BPromise=require('bluebird');var rp=require(_0xf420('0x4'));var fs=require('fs');var path=require(_0xf420('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var shared=require('../../config/environment/shared');var attributes=require('./cmContact.attributes');module['exports']=function(_0x34629f,_0x5b8918){return _0x34629f[_0xf420('0x6')](_0xf420('0x7'),attributes,{'tableName':_0xf420('0x8'),'paranoid':!![],'indexes':[{'name':_0xf420('0x9'),'fields':[_0xf420('0x9')]},{'name':'fti_cm_contacts','fields':[_0xf420('0xa'),_0xf420('0xb'),_0xf420('0x9'),_0xf420('0xc'),_0xf420('0xd'),_0xf420('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0xf420('0xf'),'collate':_0xf420('0x10'),'hooks':{'afterCreate':function(_0x558382,_0x5cfd38,_0x231c27){var _0x57b32d=_0x34629f['models'];var _0x33cba9=_0x558382[_0xf420('0x11')]({'plain':!![]});function _0xdad764(){return function(_0xd94e46){logger['error'](_0xf420('0x12'),_0xf420('0x13'),util[_0xf420('0x14')](_0xd94e46,{'showHidden':![],'depth':null}));};}function _0x2dc5a9(_0x2041c0,_0x118b56){var _0x4f48aa=_0x118b56[_0xf420('0x15')]?_0x118b56[_0xf420('0x15')]:moment()[_0xf420('0x16')](_0xf420('0x17'));return new BPromise(function(_0xb1aace,_0x508b11){if(_['isNil'](_0x118b56[_0xf420('0x18')])){_0xb1aace({'ret':_0x4f48aa});}else{_0x57b32d[_0xf420('0x19')]['findOne']({'where':{'id':_0x2041c0['id']}})[_0xf420('0x1a')](function(_0x127e00){if(!_['isNil'](_0x127e00)){var _0x2af2e5=_0x127e00[_0xf420('0x18')];if(!_['isNil'](_0x2af2e5)){var _0x4f4c62=shared[_0xf420('0x1b')];var _0x24976b=_0x4f4c62[_0x2af2e5];var _0x350c99=_0x4f4c62[_0x118b56[_0xf420('0x18')]];if(!_[_0xf420('0x1c')](_0x24976b)&&!_[_0xf420('0x1c')](_0x350c99)){var _0x551d63=_0x24976b[_0xf420('0x1d')]-_0x350c99[_0xf420('0x1d')];_0x4f48aa=_0x118b56[_0xf420('0x15')]?_0x118b56[_0xf420('0x15')]:moment();var _0x21dcf7=moment(_0x4f48aa)[_0xf420('0x1e')](_0x551d63,_0xf420('0x1f'));_0xb1aace({'ret':_0x21dcf7[_0xf420('0x16')](_0xf420('0x17'))});}else _0xb1aace({'ret':_0x4f48aa});}else _0xb1aace({'ret':_0x4f48aa});}else{_0xb1aace({'ret':_0x4f48aa});}});}});return 0xa;}var _0xb71ac7=function(_0x2827f0){return new BPromise(function(_0x4e8ebf,_0x59a741){_0x2dc5a9(_0x2827f0,_0x33cba9)[_0xf420('0x1a')](function(_0x10534c){_0x33cba9[_0xf420('0x15')]=_0x10534c['ret'];_0x57b32d[_0xf420('0x20')][_0xf420('0x21')]({'where':{'phone':_0x33cba9[_0xf420('0x9')],'VoiceQueueId':_0x2827f0['id']}})[_0xf420('0x1a')](function(_0x26a951){if(!_['isNil'](_0x26a951)){throw new Error(_0xf420('0x22')+_0x33cba9['phone']+_0xf420('0x23')+_0x2827f0['id']);}return _0x57b32d[_0xf420('0x20')][_0xf420('0x24')]({'phone':_0x33cba9[_0xf420('0x9')],'ContactId':_0x33cba9['id'],'ListId':_0x33cba9[_0xf420('0x25')],'priority':_0x33cba9[_0xf420('0x26')]?_0x33cba9[_0xf420('0x26')]:0x2,'scheduledat':_0x33cba9[_0xf420('0x15')]?_0x33cba9['scheduledat']:moment()[_0xf420('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x33cba9[_0xf420('0x27')]?!![]:![],'callbackuniqueid':_0x33cba9[_0xf420('0x27')]?_0x33cba9['callbackUniqueid']:undefined,'callbackat':_0x33cba9[_0xf420('0x27')]?moment()[_0xf420('0x16')](_0xf420('0x17')):undefined,'VoiceQueueId':_0x2827f0['id']});})[_0xf420('0x28')](function(_0x2c8d83){_0x59a741(_0x2c8d83);});});});};var _0x46e2dd=function(_0x36933e){return new BPromise(function(_0x472614,_0x58e176){_0x2dc5a9(_0x36933e,_0x33cba9)[_0xf420('0x1a')](function(_0x206c2c){_0x33cba9['scheduledat']=_0x206c2c[_0xf420('0x29')];_0x57b32d[_0xf420('0x20')][_0xf420('0x21')]({'where':{'phone':_0x33cba9[_0xf420('0x9')],'VoiceQueueId':_0x36933e['id']}})['then'](function(_0x454829){if(!_[_0xf420('0x1c')](_0x454829)){throw new Error(_0xf420('0x22')+_0x33cba9[_0xf420('0x9')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x36933e['id']);}return _0x57b32d['CmHopperFinal'][_0xf420('0x21')]({'where':{'calleridnum':_0x33cba9[_0xf420('0x9')],'VoiceQueueId':_0x36933e['id']}});})['then'](function(_0xce0fad){if(!_['isNil'](_0xce0fad)){throw new Error(_0xf420('0x2a')+_0x33cba9[_0xf420('0x9')]+_0xf420('0x2b')+_0x36933e['id']);}return _0x57b32d[_0xf420('0x20')]['create']({'phone':_0x33cba9['phone'],'ContactId':_0x33cba9['id'],'ListId':_0x33cba9[_0xf420('0x25')],'priority':_0x33cba9['priority']?_0x33cba9[_0xf420('0x26')]:0x2,'scheduledat':_0x33cba9[_0xf420('0x15')]?_0x33cba9['scheduledat']:moment()[_0xf420('0x16')](_0xf420('0x17')),'callback':_0x33cba9[_0xf420('0x27')]?!![]:![],'callbackuniqueid':_0x33cba9['callbackUniqueid']?_0x33cba9[_0xf420('0x27')]:undefined,'callbackat':_0x33cba9[_0xf420('0x27')]?moment()[_0xf420('0x16')](_0xf420('0x17')):undefined,'VoiceQueueId':_0x36933e['id']});})[_0xf420('0x28')](function(_0x1c5459){_0x58e176(_0x1c5459);});});});};function _0x319b4b(){return function(_0x5fd947){logger['error'](_0xf420('0x12'),_0xf420('0x13'),util[_0xf420('0x14')](_0x5fd947,{'showHidden':![],'depth':null}));};}function _0x5475ca(_0x396445,_0x2cd387){var _0x3fb025=_0x2cd387[_0xf420('0x15')]?_0x2cd387[_0xf420('0x15')]:moment()[_0xf420('0x16')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x455fa7,_0x41c18e){if(_[_0xf420('0x1c')](_0x2cd387['dialTimezone'])){_0x455fa7({'ret':_0x3fb025});}else{_0x57b32d[_0xf420('0x2c')][_0xf420('0x21')]({'where':{'id':_0x396445['id']}})['then'](function(_0x24dc0b){if(!_[_0xf420('0x1c')](_0x24dc0b)){var _0x16ba17=_0x24dc0b[_0xf420('0x18')];if(!_[_0xf420('0x1c')](_0x16ba17)){var _0x230673=shared[_0xf420('0x1b')];var _0x1cd573=_0x230673[_0x16ba17];var _0x14a39e=_0x230673[_0x2cd387[_0xf420('0x18')]];if(!_['isNil'](_0x1cd573)&&!_[_0xf420('0x1c')](_0x14a39e)){var _0x2c8a05=_0x1cd573[_0xf420('0x1d')]-_0x14a39e[_0xf420('0x1d')];_0x3fb025=_0x2cd387[_0xf420('0x15')]?_0x2cd387[_0xf420('0x15')]:moment();var _0x19e718=moment(_0x3fb025)['add'](_0x2c8a05,_0xf420('0x1f'));_0x455fa7({'ret':_0x19e718[_0xf420('0x16')](_0xf420('0x17'))});}else _0x455fa7({'ret':_0x3fb025});}else _0x455fa7({'ret':_0x3fb025});}else{_0x455fa7({'ret':_0x3fb025});}});}});return 0xa;}var _0x46f510=function(_0x13f354){return new BPromise(function(_0xb5be16,_0x355363){_0x5475ca(_0x13f354,_0x33cba9)[_0xf420('0x1a')](function(_0x524499){_0x33cba9[_0xf420('0x15')]=_0x524499[_0xf420('0x29')];_0x57b32d[_0xf420('0x20')][_0xf420('0x21')]({'where':{'phone':_0x33cba9['phone'],'CampaignId':_0x13f354['id']}})[_0xf420('0x1a')](function(_0x357984){if(!_[_0xf420('0x1c')](_0x357984)){throw new Error(_0xf420('0x22')+_0x33cba9['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x13f354['id']);}return _0x57b32d[_0xf420('0x20')][_0xf420('0x24')]({'phone':_0x33cba9[_0xf420('0x9')],'ContactId':_0x33cba9['id'],'ListId':_0x33cba9[_0xf420('0x25')],'priority':_0x33cba9[_0xf420('0x26')]?_0x33cba9[_0xf420('0x26')]:0x2,'scheduledat':_0x33cba9[_0xf420('0x15')]?_0x33cba9['scheduledat']:moment()[_0xf420('0x16')](_0xf420('0x17')),'callback':_0x33cba9[_0xf420('0x27')]?!![]:![],'callbackuniqueid':_0x33cba9[_0xf420('0x27')]?_0x33cba9[_0xf420('0x27')]:undefined,'callbackat':_0x33cba9[_0xf420('0x27')]?moment()[_0xf420('0x16')](_0xf420('0x17')):undefined,'CampaignId':_0x13f354['id']});})['catch'](function(_0x991cac){_0x355363(_0x991cac);});});});};var _0x42d11d=function(_0x223c3c){return new BPromise(function(_0x61211e,_0x434546){_0x5475ca(_0x223c3c,_0x33cba9)[_0xf420('0x1a')](function(_0x483359){_0x33cba9[_0xf420('0x15')]=_0x483359[_0xf420('0x29')];_0x57b32d['CmHopper'][_0xf420('0x21')]({'where':{'phone':_0x33cba9['phone'],'CampaignId':_0x223c3c['id']}})[_0xf420('0x1a')](function(_0x4507d9){if(!_['isNil'](_0x4507d9)){throw new Error(_0xf420('0x22')+_0x33cba9[_0xf420('0x9')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x223c3c['id']);}return _0x57b32d[_0xf420('0x2d')][_0xf420('0x21')]({'where':{'calleridnum':_0x33cba9[_0xf420('0x9')],'CampaignId':_0x223c3c['id']}});})[_0xf420('0x1a')](function(_0x39fb2e){if(!_[_0xf420('0x1c')](_0x39fb2e)){throw new Error(_0xf420('0x2a')+_0x33cba9['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x223c3c['id']);}return _0x57b32d[_0xf420('0x20')][_0xf420('0x24')]({'phone':_0x33cba9[_0xf420('0x9')],'ContactId':_0x33cba9['id'],'ListId':_0x33cba9['ListId'],'priority':_0x33cba9[_0xf420('0x26')]?_0x33cba9['priority']:0x2,'scheduledat':_0x33cba9[_0xf420('0x15')]?_0x33cba9[_0xf420('0x15')]:moment()['format'](_0xf420('0x17')),'callback':_0x33cba9[_0xf420('0x27')]?!![]:![],'callbackuniqueid':_0x33cba9[_0xf420('0x27')]?_0x33cba9['callbackUniqueid']:undefined,'callbackat':_0x33cba9[_0xf420('0x27')]?moment()['format'](_0xf420('0x17')):undefined,'CampaignId':_0x223c3c['id']});})[_0xf420('0x28')](function(_0x4771f2){_0x434546(_0x4771f2);});});});};if(_0x33cba9['ListId']){_0x57b32d[_0xf420('0x19')]['findAll']({'where':{'type':_0xf420('0x2e')},'attributes':['id',_0xf420('0x2f'),_0xf420('0x18')],'include':[{'model':_0x57b32d[_0xf420('0x30')],'as':_0xf420('0x31'),'where':{'id':_0x33cba9[_0xf420('0x25')]}}]})[_0xf420('0x1a')](function(_0x290534){if(_0x290534){var _0x2e0b80=[];for(var _0x358112=0x0,_0x48b245;_0x358112<_0x290534[_0xf420('0x32')];_0x358112+=0x1){_0x48b245=_0x290534[_0x358112][_0xf420('0x11')]({'plain':!![]});switch(_0x48b245[_0xf420('0x2f')]){case _0xf420('0x33'):_0x46e2dd(_0x48b245)[_0xf420('0x28')](_0xdad764());break;case _0xf420('0x34'):_0xb71ac7(_0x48b245)['catch'](_0xdad764());break;default:_0x5475ca(_0x48b245,_0x33cba9)[_0xf420('0x1a')](function(_0x52e156){_0x33cba9[_0xf420('0x15')]=_0x52e156[_0xf420('0x29')];_0x57b32d[_0xf420('0x20')][_0xf420('0x24')]({'phone':_0x33cba9[_0xf420('0x9')],'ContactId':_0x33cba9['id'],'ListId':_0x33cba9[_0xf420('0x25')],'scheduledat':_0x33cba9[_0xf420('0x15')]?_0x33cba9[_0xf420('0x15')]:moment()[_0xf420('0x16')](_0xf420('0x17')),'priority':_0x33cba9[_0xf420('0x26')]?_0x33cba9[_0xf420('0x26')]:0x2,'callback':_0x33cba9[_0xf420('0x27')]?!![]:![],'callbackuniqueid':_0x33cba9['callbackUniqueid']?_0x33cba9[_0xf420('0x27')]:undefined,'callbackat':_0x33cba9[_0xf420('0x27')]?moment()[_0xf420('0x16')](_0xf420('0x17')):undefined,'VoiceQueueId':_0x48b245['id']})[_0xf420('0x28')](_0xdad764());});}}}})[_0xf420('0x1a')](function(){return _0x57b32d[_0xf420('0x19')][_0xf420('0x35')]({'where':{'type':_0xf420('0x2e')},'attributes':['id'],'include':[{'model':_0x57b32d[_0xf420('0x30')],'as':_0xf420('0x36'),'where':{'id':_0x33cba9[_0xf420('0x25')]}}]})[_0xf420('0x1a')](function(_0xd49151){if(_0xd49151){var _0x258a38=[];for(var _0xead56=0x0,_0x42a90b;_0xead56<_0xd49151[_0xf420('0x32')];_0xead56+=0x1){_0x42a90b=_0xd49151[_0xead56]['get']({'plain':!![]});_0x57b32d[_0xf420('0x37')][_0xf420('0x24')]({'phone':_0x33cba9['phone'],'ContactId':_0x33cba9['id'],'ListId':_0x33cba9[_0xf420('0x25')],'VoiceQueueId':_0x42a90b['id']})[_0xf420('0x28')](function(_0x5370f4){logger[_0xf420('0x38')](_0xf420('0x39'),_0xf420('0x13'),_0x5370f4['message']);});}}});})[_0xf420('0x1a')](function(){return _0x57b32d['Campaign'][_0xf420('0x35')]({'attributes':['id',_0xf420('0x2f'),_0xf420('0x18')],'include':[{'model':_0x57b32d[_0xf420('0x30')],'as':_0xf420('0x31'),'where':{'id':_0x33cba9[_0xf420('0x25')]}}]})[_0xf420('0x1a')](function(_0x5e9861){if(_0x5e9861){var _0x1d3e2c=[];for(var _0xf35a2a=0x0,_0xefc8f1;_0xf35a2a<_0x5e9861[_0xf420('0x32')];_0xf35a2a+=0x1){_0xefc8f1=_0x5e9861[_0xf35a2a][_0xf420('0x11')]({'plain':!![]});switch(_0xefc8f1[_0xf420('0x2f')]){case'always':_0x42d11d(_0xefc8f1)[_0xf420('0x28')](_0x319b4b());break;case _0xf420('0x34'):_0x46f510(_0xefc8f1)[_0xf420('0x28')](_0x319b4b());break;default:_0x57b32d[_0xf420('0x20')]['create']({'phone':_0x33cba9[_0xf420('0x9')],'ContactId':_0x33cba9['id'],'ListId':_0x33cba9[_0xf420('0x25')],'scheduledat':_0x33cba9['scheduledat']?_0x33cba9['scheduledat']:moment()[_0xf420('0x16')](_0xf420('0x17')),'priority':_0x33cba9[_0xf420('0x26')]?_0x33cba9[_0xf420('0x26')]:0x2,'callback':_0x33cba9[_0xf420('0x27')]?!![]:![],'callbackuniqueid':_0x33cba9['callbackUniqueid']?_0x33cba9[_0xf420('0x27')]:undefined,'callbackat':_0x33cba9[_0xf420('0x27')]?moment()[_0xf420('0x16')](_0xf420('0x17')):undefined,'CampaignId':_0xefc8f1['id']})[_0xf420('0x28')](_0x319b4b());}}}});})[_0xf420('0x1a')](function(){return _0x57b32d[_0xf420('0x2c')]['findAll']({'attributes':['id'],'include':[{'model':_0x57b32d[_0xf420('0x30')],'as':_0xf420('0x36'),'where':{'id':_0x33cba9[_0xf420('0x25')]}}]})[_0xf420('0x1a')](function(_0x395441){if(_0x395441){var _0x4a7991=[];for(var _0x22e9db=0x0,_0x59ff35;_0x22e9db<_0x395441[_0xf420('0x32')];_0x22e9db+=0x1){_0x59ff35=_0x395441[_0x22e9db]['get']({'plain':!![]});_0x57b32d[_0xf420('0x37')][_0xf420('0x24')]({'phone':_0x33cba9[_0xf420('0x9')],'ContactId':_0x33cba9['id'],'ListId':_0x33cba9['ListId'],'CampaignId':_0x59ff35['id']})[_0xf420('0x28')](function(_0xb8dda3){logger[_0xf420('0x38')](_0xf420('0x39'),_0xf420('0x13'),_0xb8dda3[_0xf420('0x3a')]);});}}});})['then'](function(){_0x231c27();})[_0xf420('0x28')](function(_0x40c5fe){logger[_0xf420('0x38')](_0xf420('0x39'),_0xf420('0x13'),_0x40c5fe[_0xf420('0x3a')]);_0x231c27(_0x40c5fe);});}else{_0x231c27(new Error(_0xf420('0x3b')));}},'afterDestroy':function(_0x5f43c8,_0x2b41fc,_0xbbd842){var _0x5cb1fd=_0x34629f['models'];var _0x4a39a9=_0x5f43c8[_0xf420('0x11')]({'plain':!![]});return _0x5cb1fd[_0xf420('0x20')][_0xf420('0x35')]({'raw':!![],'where':{'ListId':_0x4a39a9['ListId'],'ContactId':_0x4a39a9['id']}})[_0xf420('0x1a')](function(_0x5cd3ea){if(!_['isEmpty'](_0x5cd3ea)){var _0x2686bc=[];for(var _0x21cb37=0x0;_0x21cb37<_0x5cd3ea[_0xf420('0x32')];_0x21cb37+=0x1){var _0x22773c=_0x5cb1fd['CmHopper']['destroy']({'where':{'ListId':_0x5cd3ea[_0x21cb37][_0xf420('0x25')],'ContactId':_0x5cd3ea[_0x21cb37][_0xf420('0x3c')],'VoiceQueueId':_0x5cd3ea[_0x21cb37][_0xf420('0x3d')],'CampaignId':_0x5cd3ea[_0x21cb37][_0xf420('0x3e')]}});_0x2686bc['push'](_0x22773c);}return BPromise[_0xf420('0x3f')](_0x2686bc);}})[_0xf420('0x1a')](function(_0x1985e6){logger['info'](_0xf420('0x40'),util[_0xf420('0x14')](_0x1985e6,{'showHidden':![],'depth':null}));_0xbbd842();})[_0xf420('0x28')](function(_0x3bb748){logger[_0xf420('0x38')](_0xf420('0x41'),util[_0xf420('0x14')](_0x3bb748,{'showHidden':![],'depth':null}));_0xbbd842(_0x3bb748);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 8e055a4..f35d2f8 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(_0x54eb0b,_0x1aecb7){var _0x383fa6=function(_0x5cc06b){while(--_0x5cc06b){_0x54eb0b['push'](_0x54eb0b['shift']());}};_0x383fa6(++_0x1aecb7);}(_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(_0x5733de,_0x45f7f5){var _0x4d277a=function(_0x3eae16){while(--_0x3eae16){_0x5733de['push'](_0x5733de['shift']());}};_0x4d277a(++_0x45f7f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 0f005f2..d646953 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 _0x18e0=['exports','STRING','INTEGER'];(function(_0x1c4c1e,_0x37ae2c){var _0x308b62=function(_0x485166){while(--_0x485166){_0x1c4c1e['push'](_0x1c4c1e['shift']());}};_0x308b62(++_0x37ae2c);}(_0x18e0,0xa2));var _0x018e=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x18e0[_0x4c445a];return _0x2f611c;};'use strict';var Sequelize=require('sequelize');module[_0x018e('0x0')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x018e('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x018e('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x018e('0x1')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x018e('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0xa631=['exports','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa631,0xe4));var _0x1a63=function(_0x543f9f,_0x23f70d){_0x543f9f=_0x543f9f-0x0;var _0x1fa110=_0xa631[_0x543f9f];return _0x1fa110;};'use strict';var Sequelize=require('sequelize');module[_0x1a63('0x0')]={'CmContactId':{'type':Sequelize[_0x1a63('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x1a63('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x1a63('0x2')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0x1a63('0x2')],'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 973c33d..17e13df 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 _0x264b=['update','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','name','index','CmContactHasItem','rawAttributes','type','key','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save'];(function(_0x59cf4e,_0xcb47e9){var _0x4e7228=function(_0x399d81){while(--_0x399d81){_0x59cf4e['push'](_0x59cf4e['shift']());}};_0x4e7228(++_0xcb47e9);}(_0x264b,0x13c));var _0xb264=function(_0x195913,_0x2c8ac5){_0x195913=_0x195913-0x0;var _0x48b743=_0x264b[_0x195913];return _0x48b743;};'use strict';var emlformat=require(_0xb264('0x0'));var rimraf=require(_0xb264('0x1'));var zipdir=require(_0xb264('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb264('0x3'));var moment=require(_0xb264('0x4'));var BPromise=require(_0xb264('0x5'));var Mustache=require(_0xb264('0x6'));var util=require(_0xb264('0x7'));var path=require(_0xb264('0x8'));var sox=require(_0xb264('0x9'));var csv=require('to-csv');var ejs=require(_0xb264('0xa'));var fs=require('fs');var fs_extra=require(_0xb264('0xb'));var _=require(_0xb264('0xc'));var squel=require(_0xb264('0xd'));var crypto=require(_0xb264('0xe'));var jsforce=require(_0xb264('0xf'));var deskjs=require(_0xb264('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb264('0x11'));var Papa=require(_0xb264('0x12'));var Redis=require(_0xb264('0x13'));var authService=require(_0xb264('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb264('0x15'));var hardwareService=require(_0xb264('0x16'));var logger=require(_0xb264('0x17'))(_0xb264('0x18'));var utils=require(_0xb264('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb264('0x1a'));var db=require(_0xb264('0x1b'))['db'];function respondWithStatusCode(_0x394697,_0x1efeac){_0x1efeac=_0x1efeac||0xcc;return function(_0x1fdcc4){if(_0x1fdcc4){return _0x394697[_0xb264('0x1c')](_0x1efeac);}return _0x394697[_0xb264('0x1d')](_0x1efeac)[_0xb264('0x1e')]();};}function respondWithResult(_0x38b1b1,_0x321236){_0x321236=_0x321236||0xc8;return function(_0x133025){if(_0x133025){return _0x38b1b1[_0xb264('0x1d')](_0x321236)[_0xb264('0x1f')](_0x133025);}};}function respondWithFilteredResult(_0x40300a,_0x4ef135){return function(_0x4afd0c){if(_0x4afd0c){var _0x512cc5=typeof _0x4ef135[_0xb264('0x20')]===_0xb264('0x21')&&typeof _0x4ef135[_0xb264('0x22')]==='undefined';var _0x40cd9a=_0x4afd0c[_0xb264('0x23')];var _0xf9ed0e=_0x512cc5?0x0:_0x4ef135['offset'];var _0x2189de=_0x512cc5?_0x4afd0c[_0xb264('0x23')]:_0x4ef135[_0xb264('0x20')]+_0x4ef135[_0xb264('0x22')];var _0x5ba178;if(_0x2189de>=_0x40cd9a){_0x2189de=_0x40cd9a;_0x5ba178=0xc8;}else{_0x5ba178=0xce;}_0x40300a[_0xb264('0x1d')](_0x5ba178);return _0x40300a[_0xb264('0x24')](_0xb264('0x25'),_0xf9ed0e+'-'+_0x2189de+'/'+_0x40cd9a)[_0xb264('0x1f')](_0x4afd0c);}return null;};}function patchUpdates(_0x567d4f){return function(_0x13d6bc){try{jsonpatch[_0xb264('0x26')](_0x13d6bc,_0x567d4f,!![]);}catch(_0x20d8df){return BPromise['reject'](_0x20d8df);}return _0x13d6bc[_0xb264('0x27')]();};}function saveUpdates(_0x2299b7,_0x3ad86a){return function(_0x16f4f4){if(_0x16f4f4){return _0x16f4f4[_0xb264('0x28')](_0x2299b7)[_0xb264('0x29')](function(_0x1ffcd2){return _0x1ffcd2;});}return null;};}function removeEntity(_0x368acf,_0xfd5dce){return function(_0x120e17){if(_0x120e17){return _0x120e17[_0xb264('0x2a')]()['then'](function(){var _0x1031fc=_0x120e17[_0xb264('0x2b')]({'plain':!![]});var _0x3ce9da=_0xb264('0x2c');return db[_0xb264('0x2d')]['destroy']({'where':{'type':_0x3ce9da,'resourceId':_0x1031fc['id']}})[_0xb264('0x29')](function(){return _0x120e17;});})[_0xb264('0x29')](function(){_0x368acf[_0xb264('0x1d')](0xcc)[_0xb264('0x1e')]();});}};}function handleEntityNotFound(_0x44f871,_0xf77253){return function(_0x17e957){if(!_0x17e957){_0x44f871[_0xb264('0x1c')](0x194);}return _0x17e957;};}function handleError(_0x2c11bf,_0x4aad29){_0x4aad29=_0x4aad29||0x1f4;return function(_0xe5832b){logger[_0xb264('0x2e')](_0xe5832b[_0xb264('0x2f')]);if(_0xe5832b['name']){delete _0xe5832b[_0xb264('0x30')];}_0x2c11bf[_0xb264('0x1d')](_0x4aad29)['send'](_0xe5832b);};}exports[_0xb264('0x31')]=function(_0xfd2952,_0xdc1d3d){var _0x11080b={},_0x307915={},_0x5e66df={'count':0x0,'rows':[]};var _0x56981a=_['map'](db[_0xb264('0x32')][_0xb264('0x33')],function(_0x4cbc3c){return{'name':_0x4cbc3c['fieldName'],'type':_0x4cbc3c[_0xb264('0x34')][_0xb264('0x35')]};});_0x307915['model']=_[_0xb264('0x36')](_0x56981a,_0xb264('0x30'));_0x307915['query']=_[_0xb264('0x37')](_0xfd2952[_0xb264('0x38')]);_0x307915[_0xb264('0x39')]=_['intersection'](_0x307915[_0xb264('0x3a')],_0x307915['query']);_0x11080b['attributes']=_[_0xb264('0x3b')](_0x307915[_0xb264('0x3a')],qs['fields'](_0xfd2952[_0xb264('0x38')][_0xb264('0x3c')]));_0x11080b[_0xb264('0x3d')]=_0x11080b[_0xb264('0x3d')][_0xb264('0x3e')]?_0x11080b[_0xb264('0x3d')]:_0x307915[_0xb264('0x3a')];if(!_0xfd2952[_0xb264('0x38')][_0xb264('0x3f')](_0xb264('0x40'))){_0x11080b[_0xb264('0x22')]=qs[_0xb264('0x22')](_0xfd2952[_0xb264('0x38')][_0xb264('0x22')]);_0x11080b['offset']=qs[_0xb264('0x20')](_0xfd2952['query']['offset']);}_0x11080b[_0xb264('0x41')]=qs[_0xb264('0x42')](_0xfd2952[_0xb264('0x38')][_0xb264('0x42')]);_0x11080b['where']=qs[_0xb264('0x39')](_[_0xb264('0x43')](_0xfd2952[_0xb264('0x38')],_0x307915[_0xb264('0x39')]),_0x56981a);if(_0xfd2952[_0xb264('0x38')][_0xb264('0x44')]){_0x11080b[_0xb264('0x45')]=_[_0xb264('0x46')](_0x11080b[_0xb264('0x45')],{'$or':_['map'](_0x56981a,function(_0x5c91e3){if(_0x5c91e3[_0xb264('0x34')]!==_0xb264('0x47')){var _0x4885df={};_0x4885df[_0x5c91e3[_0xb264('0x30')]]={'$like':'%'+_0xfd2952[_0xb264('0x38')][_0xb264('0x44')]+'%'};return _0x4885df;}})});}_0x11080b=_[_0xb264('0x46')]({},_0x11080b,_0xfd2952[_0xb264('0x48')]);var _0x74dfba={'where':_0x11080b[_0xb264('0x45')]};return db['CmContactHasItem'][_0xb264('0x23')](_0x74dfba)[_0xb264('0x29')](function(_0x1a7a07){_0x5e66df[_0xb264('0x23')]=_0x1a7a07;if(_0xfd2952['query']['includeAll']){_0x11080b[_0xb264('0x49')]=[{'all':!![]}];}return db[_0xb264('0x32')][_0xb264('0x4a')](_0x11080b);})['then'](function(_0x2386ae){_0x5e66df[_0xb264('0x4b')]=_0x2386ae;return _0x5e66df;})['then'](respondWithFilteredResult(_0xdc1d3d,_0x11080b))[_0xb264('0x4c')](handleError(_0xdc1d3d,null));};exports['show']=function(_0x158410,_0x20714b){var _0x284fc1={'raw':!![],'where':{'id':_0x158410[_0xb264('0x4d')]['id']}},_0x48e4db={};_0x48e4db[_0xb264('0x3a')]=_['keys'](db[_0xb264('0x32')][_0xb264('0x33')]);_0x48e4db[_0xb264('0x38')]=_[_0xb264('0x37')](_0x158410[_0xb264('0x38')]);_0x48e4db['filters']=_['intersection'](_0x48e4db[_0xb264('0x3a')],_0x48e4db['query']);_0x284fc1[_0xb264('0x3d')]=_[_0xb264('0x3b')](_0x48e4db[_0xb264('0x3a')],qs[_0xb264('0x3c')](_0x158410[_0xb264('0x38')][_0xb264('0x3c')]));_0x284fc1[_0xb264('0x3d')]=_0x284fc1[_0xb264('0x3d')]['length']?_0x284fc1['attributes']:_0x48e4db[_0xb264('0x3a')];if(_0x158410[_0xb264('0x38')][_0xb264('0x4e')]){_0x284fc1[_0xb264('0x49')]=[{'all':!![]}];}_0x284fc1=_[_0xb264('0x46')]({},_0x284fc1,_0x158410['options']);return db[_0xb264('0x32')][_0xb264('0x4f')](_0x284fc1)[_0xb264('0x29')](handleEntityNotFound(_0x20714b,null))['then'](respondWithResult(_0x20714b,null))['catch'](handleError(_0x20714b,null));};exports[_0xb264('0x50')]=function(_0x22fdcb,_0x494ed9){return db[_0xb264('0x32')][_0xb264('0x50')](_0x22fdcb[_0xb264('0x51')],{})[_0xb264('0x29')](function(_0x4a9044){var _0x2052cf=_0x22fdcb[_0xb264('0x52')][_0xb264('0x2b')]({'plain':!![]});if(!_0x2052cf)throw new Error(_0xb264('0x53'));if(_0x2052cf[_0xb264('0x54')]===_0xb264('0x52')){var _0xa14a37=_0x4a9044['get']({'plain':!![]});var _0x4ec079=_0xb264('0x2c');return db[_0xb264('0x55')][_0xb264('0x4f')]({'where':{'name':_0x4ec079,'userProfileId':_0x2052cf[_0xb264('0x56')]},'raw':!![]})[_0xb264('0x29')](function(_0x5b2bfd){if(_0x5b2bfd&&_0x5b2bfd[_0xb264('0x57')]===0x0){return db[_0xb264('0x2d')][_0xb264('0x50')]({'name':_0xa14a37[_0xb264('0x30')],'resourceId':_0xa14a37['id'],'type':_0x5b2bfd[_0xb264('0x30')],'sectionId':_0x5b2bfd['id']},{})[_0xb264('0x29')](function(){return _0x4a9044;});}else{return _0x4a9044;}})[_0xb264('0x4c')](function(_0x14d110){logger[_0xb264('0x2e')](_0xb264('0x58'),_0x14d110);throw _0x14d110;});}return _0x4a9044;})[_0xb264('0x29')](respondWithResult(_0x494ed9,0xc9))[_0xb264('0x4c')](handleError(_0x494ed9,null));};exports[_0xb264('0x28')]=function(_0x3e6c55,_0x535429){if(_0x3e6c55[_0xb264('0x51')]['id']){delete _0x3e6c55['body']['id'];}return db[_0xb264('0x32')][_0xb264('0x4f')]({'where':{'id':_0x3e6c55[_0xb264('0x4d')]['id']}})['then'](handleEntityNotFound(_0x535429,null))['then'](saveUpdates(_0x3e6c55[_0xb264('0x51')],null))[_0xb264('0x29')](respondWithResult(_0x535429,null))[_0xb264('0x4c')](handleError(_0x535429,null));};exports[_0xb264('0x2a')]=function(_0x4e1e9f,_0x4d6690){return db[_0xb264('0x32')][_0xb264('0x4f')]({'where':{'id':_0x4e1e9f['params']['id']}})[_0xb264('0x29')](handleEntityNotFound(_0x4d6690,null))[_0xb264('0x29')](removeEntity(_0x4d6690,null))['catch'](handleError(_0x4d6690,null));}; \ No newline at end of file +var _0x61b2=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','CmContactHasItems','error','stack','name','CmContactHasItem','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','options','include','findAll','rows','show','params','find','catch','create','body','user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x34dd28,_0x127915){var _0x3f0b01=function(_0x1c1c00){while(--_0x1c1c00){_0x34dd28['push'](_0x34dd28['shift']());}};_0x3f0b01(++_0x127915);}(_0x61b2,0x1b5));var _0x261b=function(_0x1bf55e,_0x449a4a){_0x1bf55e=_0x1bf55e-0x0;var _0x1577a7=_0x61b2[_0x1bf55e];return _0x1577a7;};'use strict';var emlformat=require(_0x261b('0x0'));var rimraf=require(_0x261b('0x1'));var zipdir=require(_0x261b('0x2'));var jsonpatch=require(_0x261b('0x3'));var rp=require('request-promise');var moment=require(_0x261b('0x4'));var BPromise=require(_0x261b('0x5'));var Mustache=require(_0x261b('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x261b('0x7'));var ejs=require(_0x261b('0x8'));var fs=require('fs');var fs_extra=require(_0x261b('0x9'));var _=require(_0x261b('0xa'));var squel=require(_0x261b('0xb'));var crypto=require(_0x261b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x261b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x261b('0xe'));var Papa=require(_0x261b('0xf'));var Redis=require(_0x261b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x261b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x261b('0x12'))(_0x261b('0x13'));var utils=require(_0x261b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x261b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43fdd1,_0xbd88fe){_0xbd88fe=_0xbd88fe||0xcc;return function(_0x3f7cc5){if(_0x3f7cc5){return _0x43fdd1[_0x261b('0x16')](_0xbd88fe);}return _0x43fdd1['status'](_0xbd88fe)[_0x261b('0x17')]();};}function respondWithResult(_0x53e013,_0x31617d){_0x31617d=_0x31617d||0xc8;return function(_0x27764b){if(_0x27764b){return _0x53e013['status'](_0x31617d)[_0x261b('0x18')](_0x27764b);}};}function respondWithFilteredResult(_0x3e7f82,_0x10d2e2){return function(_0x3bdb39){if(_0x3bdb39){var _0x39624c=typeof _0x10d2e2[_0x261b('0x19')]===_0x261b('0x1a')&&typeof _0x10d2e2['limit']===_0x261b('0x1a');var _0x20bcd4=_0x3bdb39[_0x261b('0x1b')];var _0x377a7f=_0x39624c?0x0:_0x10d2e2[_0x261b('0x19')];var _0x125a3e=_0x39624c?_0x3bdb39[_0x261b('0x1b')]:_0x10d2e2[_0x261b('0x19')]+_0x10d2e2[_0x261b('0x1c')];var _0x4eb9f6;if(_0x125a3e>=_0x20bcd4){_0x125a3e=_0x20bcd4;_0x4eb9f6=0xc8;}else{_0x4eb9f6=0xce;}_0x3e7f82[_0x261b('0x1d')](_0x4eb9f6);return _0x3e7f82[_0x261b('0x1e')](_0x261b('0x1f'),_0x377a7f+'-'+_0x125a3e+'/'+_0x20bcd4)[_0x261b('0x18')](_0x3bdb39);}return null;};}function patchUpdates(_0x2ac025){return function(_0x285080){try{jsonpatch[_0x261b('0x20')](_0x285080,_0x2ac025,!![]);}catch(_0x5caf3a){return BPromise[_0x261b('0x21')](_0x5caf3a);}return _0x285080[_0x261b('0x22')]();};}function saveUpdates(_0x365004,_0x4ff690){return function(_0x29795c){if(_0x29795c){return _0x29795c[_0x261b('0x23')](_0x365004)[_0x261b('0x24')](function(_0x57d775){return _0x57d775;});}return null;};}function removeEntity(_0x229efc,_0x1ef2a2){return function(_0x2629e1){if(_0x2629e1){return _0x2629e1[_0x261b('0x25')]()['then'](function(){var _0x2d44ff=_0x2629e1['get']({'plain':!![]});var _0x40ba05=_0x261b('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x40ba05,'resourceId':_0x2d44ff['id']}})[_0x261b('0x24')](function(){return _0x2629e1;});})['then'](function(){_0x229efc['status'](0xcc)[_0x261b('0x17')]();});}};}function handleEntityNotFound(_0x3dad39,_0x379488){return function(_0x2ddfd4){if(!_0x2ddfd4){_0x3dad39[_0x261b('0x16')](0x194);}return _0x2ddfd4;};}function handleError(_0x4945a5,_0x3c2f75){_0x3c2f75=_0x3c2f75||0x1f4;return function(_0x3ada56){logger[_0x261b('0x27')](_0x3ada56[_0x261b('0x28')]);if(_0x3ada56[_0x261b('0x29')]){delete _0x3ada56[_0x261b('0x29')];}_0x4945a5[_0x261b('0x1d')](_0x3c2f75)['send'](_0x3ada56);};}exports['index']=function(_0x50a6f3,_0x1cacda){var _0x3be1ec={},_0x38519e={},_0x89c89={'count':0x0,'rows':[]};var _0x4e6bdf=_['map'](db[_0x261b('0x2a')][_0x261b('0x2b')],function(_0xcdb11b){return{'name':_0xcdb11b[_0x261b('0x2c')],'type':_0xcdb11b[_0x261b('0x2d')]['key']};});_0x38519e[_0x261b('0x2e')]=_[_0x261b('0x2f')](_0x4e6bdf,_0x261b('0x29'));_0x38519e[_0x261b('0x30')]=_[_0x261b('0x31')](_0x50a6f3[_0x261b('0x30')]);_0x38519e[_0x261b('0x32')]=_[_0x261b('0x33')](_0x38519e['model'],_0x38519e['query']);_0x3be1ec[_0x261b('0x34')]=_[_0x261b('0x33')](_0x38519e[_0x261b('0x2e')],qs[_0x261b('0x35')](_0x50a6f3['query'][_0x261b('0x35')]));_0x3be1ec[_0x261b('0x34')]=_0x3be1ec[_0x261b('0x34')][_0x261b('0x36')]?_0x3be1ec['attributes']:_0x38519e[_0x261b('0x2e')];if(!_0x50a6f3['query']['hasOwnProperty'](_0x261b('0x37'))){_0x3be1ec[_0x261b('0x1c')]=qs['limit'](_0x50a6f3[_0x261b('0x30')][_0x261b('0x1c')]);_0x3be1ec[_0x261b('0x19')]=qs[_0x261b('0x19')](_0x50a6f3['query']['offset']);}_0x3be1ec['order']=qs[_0x261b('0x38')](_0x50a6f3[_0x261b('0x30')][_0x261b('0x38')]);_0x3be1ec[_0x261b('0x39')]=qs['filters'](_['pick'](_0x50a6f3[_0x261b('0x30')],_0x38519e['filters']),_0x4e6bdf);if(_0x50a6f3[_0x261b('0x30')][_0x261b('0x3a')]){_0x3be1ec[_0x261b('0x39')]=_['merge'](_0x3be1ec[_0x261b('0x39')],{'$or':_['map'](_0x4e6bdf,function(_0x2a8ddd){if(_0x2a8ddd['type']!=='VIRTUAL'){var _0x3d9538={};_0x3d9538[_0x2a8ddd[_0x261b('0x29')]]={'$like':'%'+_0x50a6f3[_0x261b('0x30')]['filter']+'%'};return _0x3d9538;}})});}_0x3be1ec=_['merge']({},_0x3be1ec,_0x50a6f3[_0x261b('0x3b')]);var _0x337e7e={'where':_0x3be1ec['where']};return db[_0x261b('0x2a')][_0x261b('0x1b')](_0x337e7e)[_0x261b('0x24')](function(_0xac7d60){_0x89c89['count']=_0xac7d60;if(_0x50a6f3[_0x261b('0x30')]['includeAll']){_0x3be1ec[_0x261b('0x3c')]=[{'all':!![]}];}return db[_0x261b('0x2a')][_0x261b('0x3d')](_0x3be1ec);})['then'](function(_0x1e830c){_0x89c89[_0x261b('0x3e')]=_0x1e830c;return _0x89c89;})[_0x261b('0x24')](respondWithFilteredResult(_0x1cacda,_0x3be1ec))['catch'](handleError(_0x1cacda,null));};exports[_0x261b('0x3f')]=function(_0x3d5e4d,_0x165260){var _0x52ab5e={'raw':!![],'where':{'id':_0x3d5e4d[_0x261b('0x40')]['id']}},_0x2021d5={};_0x2021d5['model']=_['keys'](db[_0x261b('0x2a')][_0x261b('0x2b')]);_0x2021d5[_0x261b('0x30')]=_[_0x261b('0x31')](_0x3d5e4d[_0x261b('0x30')]);_0x2021d5[_0x261b('0x32')]=_[_0x261b('0x33')](_0x2021d5[_0x261b('0x2e')],_0x2021d5['query']);_0x52ab5e[_0x261b('0x34')]=_[_0x261b('0x33')](_0x2021d5[_0x261b('0x2e')],qs[_0x261b('0x35')](_0x3d5e4d[_0x261b('0x30')][_0x261b('0x35')]));_0x52ab5e['attributes']=_0x52ab5e[_0x261b('0x34')]['length']?_0x52ab5e[_0x261b('0x34')]:_0x2021d5[_0x261b('0x2e')];if(_0x3d5e4d['query']['includeAll']){_0x52ab5e[_0x261b('0x3c')]=[{'all':!![]}];}_0x52ab5e=_['merge']({},_0x52ab5e,_0x3d5e4d[_0x261b('0x3b')]);return db['CmContactHasItem'][_0x261b('0x41')](_0x52ab5e)[_0x261b('0x24')](handleEntityNotFound(_0x165260,null))[_0x261b('0x24')](respondWithResult(_0x165260,null))[_0x261b('0x42')](handleError(_0x165260,null));};exports[_0x261b('0x43')]=function(_0x498068,_0xebe393){return db['CmContactHasItem']['create'](_0x498068[_0x261b('0x44')],{})[_0x261b('0x24')](function(_0x28b945){var _0x26cc76=_0x498068[_0x261b('0x45')]['get']({'plain':!![]});if(!_0x26cc76)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26cc76[_0x261b('0x46')]===_0x261b('0x45')){var _0xb91f2=_0x28b945[_0x261b('0x47')]({'plain':!![]});var _0x316af9=_0x261b('0x26');return db[_0x261b('0x48')][_0x261b('0x41')]({'where':{'name':_0x316af9,'userProfileId':_0x26cc76['userProfileId']},'raw':!![]})[_0x261b('0x24')](function(_0x5b9b86){if(_0x5b9b86&&_0x5b9b86[_0x261b('0x49')]===0x0){return db['UserProfileResource'][_0x261b('0x43')]({'name':_0xb91f2[_0x261b('0x29')],'resourceId':_0xb91f2['id'],'type':_0x5b9b86[_0x261b('0x29')],'sectionId':_0x5b9b86['id']},{})[_0x261b('0x24')](function(){return _0x28b945;});}else{return _0x28b945;}})[_0x261b('0x42')](function(_0x51dcb1){logger[_0x261b('0x27')](_0x261b('0x4a'),_0x51dcb1);throw _0x51dcb1;});}return _0x28b945;})[_0x261b('0x24')](respondWithResult(_0xebe393,0xc9))['catch'](handleError(_0xebe393,null));};exports['update']=function(_0x29dfeb,_0x23593d){if(_0x29dfeb['body']['id']){delete _0x29dfeb['body']['id'];}return db[_0x261b('0x2a')][_0x261b('0x41')]({'where':{'id':_0x29dfeb[_0x261b('0x40')]['id']}})['then'](handleEntityNotFound(_0x23593d,null))['then'](saveUpdates(_0x29dfeb[_0x261b('0x44')],null))[_0x261b('0x24')](respondWithResult(_0x23593d,null))[_0x261b('0x42')](handleError(_0x23593d,null));};exports['destroy']=function(_0x455ae3,_0x47e5f8){return db[_0x261b('0x2a')][_0x261b('0x41')]({'where':{'id':_0x455ae3[_0x261b('0x40')]['id']}})[_0x261b('0x24')](handleEntityNotFound(_0x47e5f8,null))['then'](removeEntity(_0x47e5f8,null))[_0x261b('0x42')](handleError(_0x47e5f8,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 1ac454c..125d4b7 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 _0x7062=['../../config/environment','./cmContactHasItem.attributes','exports','define','cm_contact_has_items','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x299041,_0x31ad72){var _0xda9aca=function(_0x47abdc){while(--_0x47abdc){_0x299041['push'](_0x299041['shift']());}};_0xda9aca(++_0x31ad72);}(_0x7062,0x6d));var _0x2706=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7062[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x2706('0x0'));var util=require(_0x2706('0x1'));var logger=require(_0x2706('0x2'))(_0x2706('0x3'));var moment=require('moment');var BPromise=require(_0x2706('0x4'));var rp=require(_0x2706('0x5'));var fs=require('fs');var path=require(_0x2706('0x6'));var rimraf=require(_0x2706('0x7'));var config=require(_0x2706('0x8'));var attributes=require(_0x2706('0x9'));module[_0x2706('0xa')]=function(_0x40419c,_0x19e72a){return _0x40419c[_0x2706('0xb')]('CmContactHasItem',attributes,{'tableName':_0x2706('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e78=['./cmContactHasItem.attributes','exports','define','CmContactHasItem','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x16bfc5,_0x4f9dc3){var _0x43b820=function(_0x363ced){while(--_0x363ced){_0x16bfc5['push'](_0x16bfc5['shift']());}};_0x43b820(++_0x4f9dc3);}(_0x8e78,0xdc));var _0x88e7=function(_0x14c37d,_0x59f2b8){_0x14c37d=_0x14c37d-0x0;var _0xc09aa6=_0x8e78[_0x14c37d];return _0xc09aa6;};'use strict';var _=require(_0x88e7('0x0'));var util=require(_0x88e7('0x1'));var logger=require(_0x88e7('0x2'))(_0x88e7('0x3'));var moment=require(_0x88e7('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x88e7('0x5'));var rimraf=require(_0x88e7('0x6'));var config=require(_0x88e7('0x7'));var attributes=require(_0x88e7('0x8'));module[_0x88e7('0x9')]=function(_0x4c1384,_0x316ed7){return _0x4c1384[_0x88e7('0xa')](_0x88e7('0xb'),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 769656e..27670ad 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 _0xc09c=['../../config/utils','../../config/logger','rpc','client','http','request','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0xc09c,0x13a));var _0xcc09=function(_0x17b686,_0x4e5a89){_0x17b686=_0x17b686-0x0;var _0x438cf7=_0xc09c[_0x17b686];return _0x438cf7;};'use strict';var _=require(_0xcc09('0x0'));var util=require(_0xcc09('0x1'));var moment=require(_0xcc09('0x2'));var BPromise=require(_0xcc09('0x3'));var rs=require(_0xcc09('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc09('0x5'))['db'];var utils=require(_0xcc09('0x6'));var logger=require(_0xcc09('0x7'))(_0xcc09('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcc09('0x9')][_0xcc09('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b180c,_0x13e448,_0xd5889e){return new BPromise(function(_0x1da286,_0x35632f){return client[_0xcc09('0xb')](_0x4b180c,_0xd5889e)['then'](function(_0x2b5818){logger['info'](_0xcc09('0xc'),_0x13e448,_0xcc09('0xd'));logger[_0xcc09('0xe')](_0xcc09('0xf'),_0x13e448,_0xcc09('0xd'),JSON['stringify'](_0x2b5818));if(_0x2b5818[_0xcc09('0x10')]){if(_0x2b5818[_0xcc09('0x10')][_0xcc09('0x11')]===0x1f4){logger['error'](_0xcc09('0xc'),_0x13e448,_0x2b5818[_0xcc09('0x10')][_0xcc09('0x12')]);return _0x35632f(_0x2b5818[_0xcc09('0x10')][_0xcc09('0x12')]);}logger[_0xcc09('0x10')](_0xcc09('0xc'),_0x13e448,_0x2b5818[_0xcc09('0x10')][_0xcc09('0x12')]);return _0x1da286(_0x2b5818[_0xcc09('0x10')][_0xcc09('0x12')]);}else{logger['info'](_0xcc09('0xc'),_0x13e448,'request\x20sent');_0x1da286(_0x2b5818[_0xcc09('0x13')][_0xcc09('0x12')]);}})['catch'](function(_0x24d428){logger[_0xcc09('0x10')](_0xcc09('0xc'),_0x13e448,_0x24d428);_0x35632f(_0x24d428);});});} \ No newline at end of file +var _0xd529=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd529,0x10d));var _0x9d52=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd529[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x9d52('0x0'));var util=require(_0x9d52('0x1'));var moment=require(_0x9d52('0x2'));var BPromise=require(_0x9d52('0x3'));var rs=require(_0x9d52('0x4'));var fs=require('fs');var Redis=require(_0x9d52('0x5'));var db=require(_0x9d52('0x6'))['db'];var utils=require(_0x9d52('0x7'));var logger=require(_0x9d52('0x8'))('rpc');var config=require(_0x9d52('0x9'));var jayson=require(_0x9d52('0xa'));var client=jayson['client'][_0x9d52('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38da68,_0x525ad9,_0x3097f0){return new BPromise(function(_0x31978c,_0x4a255f){return client['request'](_0x38da68,_0x3097f0)[_0x9d52('0xc')](function(_0x212253){logger[_0x9d52('0xd')](_0x9d52('0xe'),_0x525ad9,_0x9d52('0xf'));logger[_0x9d52('0x10')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x525ad9,_0x9d52('0xf'),JSON['stringify'](_0x212253));if(_0x212253[_0x9d52('0x11')]){if(_0x212253[_0x9d52('0x11')][_0x9d52('0x12')]===0x1f4){logger[_0x9d52('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x525ad9,_0x212253['error'][_0x9d52('0x13')]);return _0x4a255f(_0x212253['error'][_0x9d52('0x13')]);}logger['error'](_0x9d52('0xe'),_0x525ad9,_0x212253[_0x9d52('0x11')][_0x9d52('0x13')]);return _0x31978c(_0x212253[_0x9d52('0x11')]['message']);}else{logger[_0x9d52('0xd')](_0x9d52('0xe'),_0x525ad9,'request\x20sent');_0x31978c(_0x212253[_0x9d52('0x14')][_0x9d52('0x13')]);}})[_0x9d52('0x15')](function(_0x25d578){logger[_0x9d52('0x11')](_0x9d52('0xe'),_0x525ad9,_0x25d578);_0x4a255f(_0x25d578);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 318cb53..e4db1a5 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 _0xd795=['multer','util','path','express','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports'];(function(_0x98d63b,_0x594e30){var _0x4f827b=function(_0x1b7972){while(--_0x1b7972){_0x98d63b['push'](_0x98d63b['shift']());}};_0x4f827b(++_0x594e30);}(_0xd795,0x121));var _0x5d79=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xd795[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0x5d79('0x0'));var util=require(_0x5d79('0x1'));var path=require(_0x5d79('0x2'));var timeout=require('connect-timeout');var express=require(_0x5d79('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5d79('0x4'));var interaction=require(_0x5d79('0x5'));var config=require('../../config/environment');var controller=require(_0x5d79('0x6'));router[_0x5d79('0x7')]('/',auth[_0x5d79('0x8')](),controller[_0x5d79('0x9')]);router[_0x5d79('0x7')](_0x5d79('0xa'),auth[_0x5d79('0x8')](),controller['show']);router['post']('/',auth[_0x5d79('0x8')](),controller[_0x5d79('0xb')]);router[_0x5d79('0xc')]('/:id',auth[_0x5d79('0x8')](),controller[_0x5d79('0xd')]);router[_0x5d79('0xe')](_0x5d79('0xa'),auth[_0x5d79('0x8')](),controller[_0x5d79('0xf')]);module[_0x5d79('0x10')]=router; \ No newline at end of file +var _0x1b07=['fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','/:id','show','post','put','delete','destroy','multer','util','path','express'];(function(_0x56dbe5,_0x57fa97){var _0x47009d=function(_0x2ed2db){while(--_0x2ed2db){_0x56dbe5['push'](_0x56dbe5['shift']());}};_0x47009d(++_0x57fa97);}(_0x1b07,0x1a0));var _0x71b0=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0x1b07[_0x12ddb2];return _0x10b6dd;};'use strict';var multer=require(_0x71b0('0x0'));var util=require(_0x71b0('0x1'));var path=require(_0x71b0('0x2'));var timeout=require('connect-timeout');var express=require(_0x71b0('0x3'));var router=express['Router']();var fs_extra=require(_0x71b0('0x4'));var auth=require(_0x71b0('0x5'));var interaction=require(_0x71b0('0x6'));var config=require('../../config/environment');var controller=require('./cmContactHasItem.controller');router['get']('/',auth[_0x71b0('0x7')](),controller['index']);router['get'](_0x71b0('0x8'),auth[_0x71b0('0x7')](),controller[_0x71b0('0x9')]);router[_0x71b0('0xa')]('/',auth[_0x71b0('0x7')](),controller['create']);router[_0x71b0('0xb')](_0x71b0('0x8'),auth[_0x71b0('0x7')](),controller['update']);router[_0x71b0('0xc')]('/:id',auth[_0x71b0('0x7')](),controller[_0x71b0('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 2e96db6..7e92008 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 _0xb269=['ENUM','voice','sequelize','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','parse','values','isArray','stringify','BOOLEAN'];(function(_0x3b68bb,_0x5b9b8a){var _0x12338f=function(_0x19aa48){while(--_0x19aa48){_0x3b68bb['push'](_0x3b68bb['shift']());}};_0x12338f(++_0x5b9b8a);}(_0xb269,0x192));var _0x9b26=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xb269[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x9b26('0x0'));var _=require('lodash');module[_0x9b26('0x1')]={'name':{'type':Sequelize[_0x9b26('0x2')],'get':function(_0x48a03d){return this[_0x9b26('0x3')](_0x9b26('0x4'));}},'alias':{'type':Sequelize[_0x9b26('0x5')],'allowNull':![],'set':function(_0x117893){this[_0x9b26('0x6')](_0x9b26('0x4'),_0x117893?_0x117893:this[_0x9b26('0x3')](_0x9b26('0x7')));}},'type':{'type':Sequelize[_0x9b26('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x9b26('0x8')]('long'),'get':function(){if(this[_0x9b26('0x3')]('type')==='select'){return JSON[_0x9b26('0x9')](this[_0x9b26('0x3')](_0x9b26('0xa')));}else{return this[_0x9b26('0x3')](_0x9b26('0xa'));}},'set':function(_0x2521f7){if(Array[_0x9b26('0xb')](_0x2521f7)){this[_0x9b26('0x6')]('values',JSON[_0x9b26('0xc')](_0x2521f7));}else{this['setDataValue'](_0x9b26('0xa'),_0x2521f7);}}},'required':{'type':Sequelize[_0x9b26('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x9b26('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x9b26('0xe')](_0x9b26('0xf'))}}; \ No newline at end of file +var _0x190f=['exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','type','select','parse','values','stringify','ENUM','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x190f,0x187));var _0xf190=function(_0x109596,_0x4f7b03){_0x109596=_0x109596-0x0;var _0x39faf2=_0x190f[_0x109596];return _0x39faf2;};'use strict';var Sequelize=require('sequelize');var _=require(_0xf190('0x0'));module[_0xf190('0x1')]={'name':{'type':Sequelize[_0xf190('0x2')],'get':function(_0x582e92){return this[_0xf190('0x3')](_0xf190('0x4'));}},'alias':{'type':Sequelize[_0xf190('0x5')],'allowNull':![],'set':function(_0x503adf){this[_0xf190('0x6')](_0xf190('0x4'),_0x503adf?_0x503adf:this[_0xf190('0x3')](_0xf190('0x7')));}},'type':{'type':Sequelize[_0xf190('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this[_0xf190('0x3')](_0xf190('0x8'))===_0xf190('0x9')){return JSON[_0xf190('0xa')](this[_0xf190('0x3')](_0xf190('0xb')));}else{return this[_0xf190('0x3')]('values');}},'set':function(_0x43cc83){if(Array['isArray'](_0x43cc83)){this['setDataValue']('values',JSON[_0xf190('0xc')](_0x43cc83));}else{this[_0xf190('0x6')](_0xf190('0xb'),_0x43cc83);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xf190('0xd')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 2605d38..1490c5e 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 _0xd93d=['INTEGER','switch','BOOLEAN','queryInterface','cm_contacts','format','cf_%d','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','reject','then','destroy','error','stack','send','index','map','CmCustomField','type','key','model','differenceBy','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','find','body','params','create','sequelize','transaction','TEXT','text','Sequelize','number'];(function(_0x581ce9,_0x5a146c){var _0x19b3aa=function(_0x45d68f){while(--_0x45d68f){_0x581ce9['push'](_0x581ce9['shift']());}};_0x19b3aa(++_0x5a146c);}(_0xd93d,0x1ab));var _0xdd93=function(_0x2fec78,_0x3071c2){_0x2fec78=_0x2fec78-0x0;var _0x18dff4=_0xd93d[_0x2fec78];return _0x18dff4;};'use strict';var emlformat=require(_0xdd93('0x0'));var rimraf=require(_0xdd93('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd93('0x2'));var rp=require(_0xdd93('0x3'));var moment=require(_0xdd93('0x4'));var BPromise=require(_0xdd93('0x5'));var Mustache=require(_0xdd93('0x6'));var util=require('util');var path=require(_0xdd93('0x7'));var sox=require(_0xdd93('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd93('0x9'));var _=require(_0xdd93('0xa'));var squel=require('squel');var crypto=require(_0xdd93('0xb'));var jsforce=require(_0xdd93('0xc'));var deskjs=require(_0xdd93('0xd'));var toCsv=require(_0xdd93('0xe'));var querystring=require(_0xdd93('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdd93('0x10'));var qs=require(_0xdd93('0x11'));var as=require(_0xdd93('0x12'));var hardwareService=require(_0xdd93('0x13'));var logger=require('../../config/logger')(_0xdd93('0x14'));var utils=require('../../config/utils');var config=require(_0xdd93('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57a9f4,_0x273ce9){_0x273ce9=_0x273ce9||0xcc;return function(_0x5d82ae){if(_0x5d82ae){return _0x57a9f4[_0xdd93('0x16')](_0x273ce9);}return _0x57a9f4['status'](_0x273ce9)[_0xdd93('0x17')]();};}function respondWithResult(_0x44ea07,_0x43d82f){_0x43d82f=_0x43d82f||0xc8;return function(_0xbcf0a1){if(_0xbcf0a1){return _0x44ea07[_0xdd93('0x18')](_0x43d82f)['json'](_0xbcf0a1);}};}function respondWithFilteredResult(_0x57ffd6,_0x83b7b3){return function(_0x30bf60){if(_0x30bf60){var _0x245468=typeof _0x83b7b3[_0xdd93('0x19')]==='undefined'&&typeof _0x83b7b3[_0xdd93('0x1a')]===_0xdd93('0x1b');var _0x59d793=_0x30bf60['count'];var _0x106bdb=_0x245468?0x0:_0x83b7b3[_0xdd93('0x19')];var _0x5f193a=_0x245468?_0x30bf60[_0xdd93('0x1c')]:_0x83b7b3[_0xdd93('0x19')]+_0x83b7b3['limit'];var _0x1f1908;if(_0x5f193a>=_0x59d793){_0x5f193a=_0x59d793;_0x1f1908=0xc8;}else{_0x1f1908=0xce;}_0x57ffd6[_0xdd93('0x18')](_0x1f1908);return _0x57ffd6[_0xdd93('0x1d')](_0xdd93('0x1e'),_0x106bdb+'-'+_0x5f193a+'/'+_0x59d793)['json'](_0x30bf60);}return null;};}function patchUpdates(_0x5919df){return function(_0x49efd0){try{jsonpatch['apply'](_0x49efd0,_0x5919df,!![]);}catch(_0x1eb4a7){return BPromise[_0xdd93('0x1f')](_0x1eb4a7);}return _0x49efd0['save']();};}function saveUpdates(_0x2cfee9,_0x452c24){return function(_0x56a4ac){if(_0x56a4ac){return _0x56a4ac['update'](_0x2cfee9)[_0xdd93('0x20')](function(_0x25a0e6){return _0x25a0e6;});}return null;};}function removeEntity(_0x3b64cf,_0x564119){return function(_0x3ddf15){if(_0x3ddf15){return _0x3ddf15[_0xdd93('0x21')]()[_0xdd93('0x20')](function(){_0x3b64cf[_0xdd93('0x18')](0xcc)[_0xdd93('0x17')]();});}};}function handleEntityNotFound(_0x3685b9,_0x2ff348){return function(_0x5b0c79){if(!_0x5b0c79){_0x3685b9[_0xdd93('0x16')](0x194);}return _0x5b0c79;};}function handleError(_0x4017ae,_0x85278a){_0x85278a=_0x85278a||0x1f4;return function(_0x366f75){logger[_0xdd93('0x22')](_0x366f75[_0xdd93('0x23')]);if(_0x366f75['name']){delete _0x366f75['name'];}_0x4017ae[_0xdd93('0x18')](_0x85278a)[_0xdd93('0x24')](_0x366f75);};}exports[_0xdd93('0x25')]=function(_0x3df8a7,_0x308cad){var _0x55067d={},_0xe97c2a={},_0x21574b={'count':0x0,'rows':[]};var _0x48fd11=_[_0xdd93('0x26')](db[_0xdd93('0x27')]['rawAttributes'],function(_0x2302f6){return{'name':_0x2302f6['fieldName'],'type':_0x2302f6[_0xdd93('0x28')][_0xdd93('0x29')]};});_0xe97c2a[_0xdd93('0x2a')]=_[_0xdd93('0x2b')](_[_0xdd93('0x26')](_0x48fd11,_0xdd93('0x2c')),[_0xdd93('0x2c')]);_0xe97c2a[_0xdd93('0x2d')]=_['keys'](_0x3df8a7[_0xdd93('0x2d')]);_0xe97c2a[_0xdd93('0x2e')]=_[_0xdd93('0x2f')](_0xe97c2a[_0xdd93('0x2a')],_0xe97c2a[_0xdd93('0x2d')]);_0x55067d[_0xdd93('0x30')]=_['intersection'](_0xe97c2a[_0xdd93('0x2a')],qs[_0xdd93('0x31')](_0x3df8a7['query'][_0xdd93('0x31')]));_0x55067d[_0xdd93('0x30')]=_0x55067d[_0xdd93('0x30')][_0xdd93('0x32')]?_0x55067d[_0xdd93('0x30')]:_0xe97c2a['model'];if(!_0x3df8a7[_0xdd93('0x2d')][_0xdd93('0x33')](_0xdd93('0x34'))){_0x55067d['limit']=qs[_0xdd93('0x1a')](_0x3df8a7[_0xdd93('0x2d')][_0xdd93('0x1a')]);_0x55067d['offset']=qs['offset'](_0x3df8a7['query']['offset']);}_0x55067d[_0xdd93('0x35')]=qs[_0xdd93('0x36')](_0x3df8a7[_0xdd93('0x2d')][_0xdd93('0x36')]);_0x55067d[_0xdd93('0x37')]=qs[_0xdd93('0x2e')](_[_0xdd93('0x38')](_0x3df8a7[_0xdd93('0x2d')],_0xe97c2a['filters']),_0x48fd11);if(_0x3df8a7[_0xdd93('0x2d')][_0xdd93('0x39')]){_0x55067d['where']=_[_0xdd93('0x3a')](_0x55067d[_0xdd93('0x37')],{'$or':_['map'](_0x48fd11,function(_0x5db7af){if(_0x5db7af['type']!==_0xdd93('0x3b')){var _0x13ac73={};_0x13ac73[_0x5db7af[_0xdd93('0x2c')]]={'$like':'%'+_0x3df8a7[_0xdd93('0x2d')][_0xdd93('0x39')]+'%'};return _0x13ac73;}})});}_0x55067d=_[_0xdd93('0x3a')]({},_0x55067d,_0x3df8a7[_0xdd93('0x3c')]);var _0x4c9177={'where':_0x55067d[_0xdd93('0x37')]};return db[_0xdd93('0x27')][_0xdd93('0x1c')](_0x4c9177)[_0xdd93('0x20')](function(_0x5b909c){_0x21574b[_0xdd93('0x1c')]=_0x5b909c;if(_0x3df8a7[_0xdd93('0x2d')][_0xdd93('0x3d')]){_0x55067d[_0xdd93('0x3e')]=[{'all':!![]}];}return db[_0xdd93('0x27')][_0xdd93('0x3f')](_0x55067d);})['then'](function(_0x1b4ffd){_0x21574b['rows']=_0x1b4ffd;return _0x21574b;})[_0xdd93('0x20')](respondWithFilteredResult(_0x308cad,_0x55067d))[_0xdd93('0x40')](handleError(_0x308cad,null));};exports[_0xdd93('0x41')]=function(_0x5ecdfe,_0x12be22){var _0x11862d={'raw':!![],'where':{'id':_0x5ecdfe['params']['id']}},_0x78a3b4={};_0x78a3b4[_0xdd93('0x2a')]=_[_0xdd93('0x42')](db[_0xdd93('0x27')]['rawAttributes']);_0x78a3b4[_0xdd93('0x2d')]=_[_0xdd93('0x42')](_0x5ecdfe[_0xdd93('0x2d')]);_0x78a3b4[_0xdd93('0x2e')]=_['intersection'](_0x78a3b4[_0xdd93('0x2a')],_0x78a3b4[_0xdd93('0x2d')]);_0x11862d[_0xdd93('0x30')]=_[_0xdd93('0x2f')](_0x78a3b4[_0xdd93('0x2a')],qs[_0xdd93('0x31')](_0x5ecdfe[_0xdd93('0x2d')][_0xdd93('0x31')]));_0x11862d['attributes']=_0x11862d[_0xdd93('0x30')]['length']?_0x11862d[_0xdd93('0x30')]:_0x78a3b4[_0xdd93('0x2a')];if(_0x5ecdfe[_0xdd93('0x2d')][_0xdd93('0x3d')]){_0x11862d[_0xdd93('0x3e')]=[{'all':!![]}];}_0x11862d=_['merge']({},_0x11862d,_0x5ecdfe[_0xdd93('0x3c')]);return db['CmCustomField'][_0xdd93('0x43')](_0x11862d)[_0xdd93('0x20')](handleEntityNotFound(_0x12be22,null))[_0xdd93('0x20')](respondWithResult(_0x12be22,null))[_0xdd93('0x40')](handleError(_0x12be22,null));};exports['update']=function(_0x29fbea,_0xa02635){if(_0x29fbea[_0xdd93('0x44')]['id']){delete _0x29fbea[_0xdd93('0x44')]['id'];}return db[_0xdd93('0x27')][_0xdd93('0x43')]({'where':{'id':_0x29fbea[_0xdd93('0x45')]['id']}})['then'](handleEntityNotFound(_0xa02635,null))[_0xdd93('0x20')](saveUpdates(_0x29fbea['body'],null))[_0xdd93('0x20')](respondWithResult(_0xa02635,null))[_0xdd93('0x40')](handleError(_0xa02635,null));};exports[_0xdd93('0x21')]=function(_0x19299a,_0x5a3e9c){return db[_0xdd93('0x27')][_0xdd93('0x43')]({'where':{'id':_0x19299a[_0xdd93('0x45')]['id']}})['then'](handleEntityNotFound(_0x5a3e9c,null))[_0xdd93('0x20')](removeEntity(_0x5a3e9c,null))['catch'](handleError(_0x5a3e9c,null));};exports[_0xdd93('0x46')]=function(_0x27951e,_0xdccef8){var _0x44832c;return db[_0xdd93('0x47')][_0xdd93('0x48')](function(_0x1aac78){return db[_0xdd93('0x27')][_0xdd93('0x46')](_0x27951e[_0xdd93('0x44')],{'transaction':_0x1aac78})[_0xdd93('0x20')](function(_0x210c6e){_0x44832c=_0x210c6e;var _0x2a5ec5={'type':db['Sequelize'][_0xdd93('0x49')],'transaction':_0x1aac78};switch(_0x27951e[_0xdd93('0x44')][_0xdd93('0x28')]){case _0xdd93('0x4a'):_0x2a5ec5[_0xdd93('0x28')]=db[_0xdd93('0x4b')]['TEXT'];break;case _0xdd93('0x4c'):_0x2a5ec5[_0xdd93('0x28')]=db['Sequelize'][_0xdd93('0x4d')];break;case _0xdd93('0x4e'):_0x2a5ec5[_0xdd93('0x28')]=db[_0xdd93('0x4b')][_0xdd93('0x4f')];_0x2a5ec5['defaultValue']=![];break;default:}return db[_0xdd93('0x47')][_0xdd93('0x50')]['addColumn'](_0xdd93('0x51'),util[_0xdd93('0x52')](_0xdd93('0x53'),_0x44832c['id']),_0x2a5ec5);})[_0xdd93('0x20')](function(){return _0x44832c;});})[_0xdd93('0x20')](respondWithResult(_0xdccef8,0xc9))['catch'](handleError(_0xdccef8,null));}; \ No newline at end of file +var _0xd2b8=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','map','CmCustomField','rawAttributes','differenceBy','name','filters','intersection','model','query','fields','attributes','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','body','find','transaction','create','type','text','number','INTEGER','switch','Sequelize','BOOLEAN','sequelize','addColumn','cm_contacts','format','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x43e603,_0x510e97){var _0x2e6cd1=function(_0x18615a){while(--_0x18615a){_0x43e603['push'](_0x43e603['shift']());}};_0x2e6cd1(++_0x510e97);}(_0xd2b8,0x132));var _0x8d2b=function(_0x2fb17a,_0x1341d8){_0x2fb17a=_0x2fb17a-0x0;var _0x9c7d94=_0xd2b8[_0x2fb17a];return _0x9c7d94;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8d2b('0x0'));var rp=require(_0x8d2b('0x1'));var moment=require('moment');var BPromise=require(_0x8d2b('0x2'));var Mustache=require(_0x8d2b('0x3'));var util=require(_0x8d2b('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x8d2b('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8d2b('0x6'));var _=require(_0x8d2b('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8d2b('0x8'));var deskjs=require(_0x8d2b('0x9'));var toCsv=require(_0x8d2b('0x5'));var querystring=require(_0x8d2b('0xa'));var Papa=require(_0x8d2b('0xb'));var Redis=require(_0x8d2b('0xc'));var authService=require(_0x8d2b('0xd'));var qs=require(_0x8d2b('0xe'));var as=require(_0x8d2b('0xf'));var hardwareService=require(_0x8d2b('0x10'));var logger=require(_0x8d2b('0x11'))(_0x8d2b('0x12'));var utils=require(_0x8d2b('0x13'));var config=require(_0x8d2b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8d2b('0x15'))['db'];function respondWithStatusCode(_0x313fc3,_0x1d1174){_0x1d1174=_0x1d1174||0xcc;return function(_0x32ae82){if(_0x32ae82){return _0x313fc3['sendStatus'](_0x1d1174);}return _0x313fc3[_0x8d2b('0x16')](_0x1d1174)[_0x8d2b('0x17')]();};}function respondWithResult(_0x25d64d,_0x556c65){_0x556c65=_0x556c65||0xc8;return function(_0x946e93){if(_0x946e93){return _0x25d64d[_0x8d2b('0x16')](_0x556c65)[_0x8d2b('0x18')](_0x946e93);}};}function respondWithFilteredResult(_0x65c48d,_0x35cabe){return function(_0x437b9a){if(_0x437b9a){var _0x4eb912=typeof _0x35cabe[_0x8d2b('0x19')]===_0x8d2b('0x1a')&&typeof _0x35cabe[_0x8d2b('0x1b')]===_0x8d2b('0x1a');var _0x2797b1=_0x437b9a[_0x8d2b('0x1c')];var _0x49e3f7=_0x4eb912?0x0:_0x35cabe[_0x8d2b('0x19')];var _0x3d0bdc=_0x4eb912?_0x437b9a[_0x8d2b('0x1c')]:_0x35cabe[_0x8d2b('0x19')]+_0x35cabe[_0x8d2b('0x1b')];var _0x2d8f49;if(_0x3d0bdc>=_0x2797b1){_0x3d0bdc=_0x2797b1;_0x2d8f49=0xc8;}else{_0x2d8f49=0xce;}_0x65c48d[_0x8d2b('0x16')](_0x2d8f49);return _0x65c48d[_0x8d2b('0x1d')](_0x8d2b('0x1e'),_0x49e3f7+'-'+_0x3d0bdc+'/'+_0x2797b1)[_0x8d2b('0x18')](_0x437b9a);}return null;};}function patchUpdates(_0x80c73c){return function(_0xa85e55){try{jsonpatch[_0x8d2b('0x1f')](_0xa85e55,_0x80c73c,!![]);}catch(_0x1e9594){return BPromise[_0x8d2b('0x20')](_0x1e9594);}return _0xa85e55[_0x8d2b('0x21')]();};}function saveUpdates(_0x55952a,_0x1dd3b5){return function(_0x1dbc9c){if(_0x1dbc9c){return _0x1dbc9c[_0x8d2b('0x22')](_0x55952a)[_0x8d2b('0x23')](function(_0x3e43d2){return _0x3e43d2;});}return null;};}function removeEntity(_0x5bc965,_0x119f5b){return function(_0x3f3ef1){if(_0x3f3ef1){return _0x3f3ef1[_0x8d2b('0x24')]()[_0x8d2b('0x23')](function(){_0x5bc965[_0x8d2b('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdacad9,_0x3cd52a){return function(_0x7ee3ef){if(!_0x7ee3ef){_0xdacad9[_0x8d2b('0x25')](0x194);}return _0x7ee3ef;};}function handleError(_0x109078,_0x356f74){_0x356f74=_0x356f74||0x1f4;return function(_0x39b21b){logger['error'](_0x39b21b[_0x8d2b('0x26')]);if(_0x39b21b['name']){delete _0x39b21b['name'];}_0x109078[_0x8d2b('0x16')](_0x356f74)[_0x8d2b('0x27')](_0x39b21b);};}exports['index']=function(_0x527682,_0x25d5c4){var _0xd53157={},_0x5a890d={},_0x179bd7={'count':0x0,'rows':[]};var _0x28fad7=_[_0x8d2b('0x28')](db[_0x8d2b('0x29')][_0x8d2b('0x2a')],function(_0x5dfc99){return{'name':_0x5dfc99['fieldName'],'type':_0x5dfc99['type']['key']};});_0x5a890d['model']=_[_0x8d2b('0x2b')](_[_0x8d2b('0x28')](_0x28fad7,_0x8d2b('0x2c')),[_0x8d2b('0x2c')]);_0x5a890d['query']=_['keys'](_0x527682['query']);_0x5a890d[_0x8d2b('0x2d')]=_[_0x8d2b('0x2e')](_0x5a890d[_0x8d2b('0x2f')],_0x5a890d[_0x8d2b('0x30')]);_0xd53157['attributes']=_[_0x8d2b('0x2e')](_0x5a890d[_0x8d2b('0x2f')],qs[_0x8d2b('0x31')](_0x527682['query']['fields']));_0xd53157[_0x8d2b('0x32')]=_0xd53157['attributes'][_0x8d2b('0x33')]?_0xd53157[_0x8d2b('0x32')]:_0x5a890d[_0x8d2b('0x2f')];if(!_0x527682['query']['hasOwnProperty'](_0x8d2b('0x34'))){_0xd53157[_0x8d2b('0x1b')]=qs[_0x8d2b('0x1b')](_0x527682[_0x8d2b('0x30')][_0x8d2b('0x1b')]);_0xd53157[_0x8d2b('0x19')]=qs[_0x8d2b('0x19')](_0x527682[_0x8d2b('0x30')]['offset']);}_0xd53157[_0x8d2b('0x35')]=qs[_0x8d2b('0x36')](_0x527682[_0x8d2b('0x30')][_0x8d2b('0x36')]);_0xd53157['where']=qs[_0x8d2b('0x2d')](_['pick'](_0x527682[_0x8d2b('0x30')],_0x5a890d['filters']),_0x28fad7);if(_0x527682[_0x8d2b('0x30')][_0x8d2b('0x37')]){_0xd53157[_0x8d2b('0x38')]=_[_0x8d2b('0x39')](_0xd53157[_0x8d2b('0x38')],{'$or':_[_0x8d2b('0x28')](_0x28fad7,function(_0x440308){if(_0x440308['type']!==_0x8d2b('0x3a')){var _0x1d9796={};_0x1d9796[_0x440308[_0x8d2b('0x2c')]]={'$like':'%'+_0x527682[_0x8d2b('0x30')][_0x8d2b('0x37')]+'%'};return _0x1d9796;}})});}_0xd53157=_['merge']({},_0xd53157,_0x527682[_0x8d2b('0x3b')]);var _0x3bb58d={'where':_0xd53157[_0x8d2b('0x38')]};return db[_0x8d2b('0x29')]['count'](_0x3bb58d)[_0x8d2b('0x23')](function(_0x179c37){_0x179bd7[_0x8d2b('0x1c')]=_0x179c37;if(_0x527682[_0x8d2b('0x30')][_0x8d2b('0x3c')]){_0xd53157[_0x8d2b('0x3d')]=[{'all':!![]}];}return db[_0x8d2b('0x29')][_0x8d2b('0x3e')](_0xd53157);})['then'](function(_0x2ae1fc){_0x179bd7['rows']=_0x2ae1fc;return _0x179bd7;})[_0x8d2b('0x23')](respondWithFilteredResult(_0x25d5c4,_0xd53157))[_0x8d2b('0x3f')](handleError(_0x25d5c4,null));};exports['show']=function(_0x57ff8c,_0x4f5715){var _0x210549={'raw':!![],'where':{'id':_0x57ff8c[_0x8d2b('0x40')]['id']}},_0x4e683e={};_0x4e683e[_0x8d2b('0x2f')]=_['keys'](db[_0x8d2b('0x29')][_0x8d2b('0x2a')]);_0x4e683e[_0x8d2b('0x30')]=_['keys'](_0x57ff8c[_0x8d2b('0x30')]);_0x4e683e['filters']=_[_0x8d2b('0x2e')](_0x4e683e[_0x8d2b('0x2f')],_0x4e683e[_0x8d2b('0x30')]);_0x210549[_0x8d2b('0x32')]=_[_0x8d2b('0x2e')](_0x4e683e[_0x8d2b('0x2f')],qs[_0x8d2b('0x31')](_0x57ff8c[_0x8d2b('0x30')]['fields']));_0x210549[_0x8d2b('0x32')]=_0x210549[_0x8d2b('0x32')][_0x8d2b('0x33')]?_0x210549['attributes']:_0x4e683e[_0x8d2b('0x2f')];if(_0x57ff8c[_0x8d2b('0x30')][_0x8d2b('0x3c')]){_0x210549[_0x8d2b('0x3d')]=[{'all':!![]}];}_0x210549=_['merge']({},_0x210549,_0x57ff8c['options']);return db[_0x8d2b('0x29')]['find'](_0x210549)[_0x8d2b('0x23')](handleEntityNotFound(_0x4f5715,null))[_0x8d2b('0x23')](respondWithResult(_0x4f5715,null))[_0x8d2b('0x3f')](handleError(_0x4f5715,null));};exports[_0x8d2b('0x22')]=function(_0x4e4171,_0x46730b){if(_0x4e4171['body']['id']){delete _0x4e4171[_0x8d2b('0x41')]['id'];}return db[_0x8d2b('0x29')]['find']({'where':{'id':_0x4e4171[_0x8d2b('0x40')]['id']}})[_0x8d2b('0x23')](handleEntityNotFound(_0x46730b,null))[_0x8d2b('0x23')](saveUpdates(_0x4e4171[_0x8d2b('0x41')],null))[_0x8d2b('0x23')](respondWithResult(_0x46730b,null))[_0x8d2b('0x3f')](handleError(_0x46730b,null));};exports['destroy']=function(_0x1c2d73,_0x42fd4e){return db[_0x8d2b('0x29')][_0x8d2b('0x42')]({'where':{'id':_0x1c2d73[_0x8d2b('0x40')]['id']}})[_0x8d2b('0x23')](handleEntityNotFound(_0x42fd4e,null))['then'](removeEntity(_0x42fd4e,null))[_0x8d2b('0x3f')](handleError(_0x42fd4e,null));};exports['create']=function(_0x55efff,_0x4dc381){var _0x4259b0;return db['sequelize'][_0x8d2b('0x43')](function(_0x21adb4){return db[_0x8d2b('0x29')][_0x8d2b('0x44')](_0x55efff['body'],{'transaction':_0x21adb4})['then'](function(_0x3dce3e){_0x4259b0=_0x3dce3e;var _0x1b56e0={'type':db['Sequelize']['TEXT'],'transaction':_0x21adb4};switch(_0x55efff[_0x8d2b('0x41')][_0x8d2b('0x45')]){case _0x8d2b('0x46'):_0x1b56e0[_0x8d2b('0x45')]=db['Sequelize']['TEXT'];break;case _0x8d2b('0x47'):_0x1b56e0[_0x8d2b('0x45')]=db['Sequelize'][_0x8d2b('0x48')];break;case _0x8d2b('0x49'):_0x1b56e0[_0x8d2b('0x45')]=db[_0x8d2b('0x4a')][_0x8d2b('0x4b')];_0x1b56e0['defaultValue']=![];break;default:}return db[_0x8d2b('0x4c')]['queryInterface'][_0x8d2b('0x4d')](_0x8d2b('0x4e'),util[_0x8d2b('0x4f')]('cf_%d',_0x4259b0['id']),_0x1b56e0);})[_0x8d2b('0x23')](function(){return _0x4259b0;});})[_0x8d2b('0x23')](respondWithResult(_0x4dc381,0xc9))[_0x8d2b('0x3f')](handleError(_0x4dc381,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 87f229f..e5ce435 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 _0x1949=['api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger'];(function(_0x23a425,_0x335f2d){var _0x3782e9=function(_0x5065a6){while(--_0x5065a6){_0x23a425['push'](_0x23a425['shift']());}};_0x3782e9(++_0x335f2d);}(_0x1949,0x123));var _0x9194=function(_0x5da38b,_0x37adb8){_0x5da38b=_0x5da38b-0x0;var _0x2e8960=_0x1949[_0x5da38b];return _0x2e8960;};'use strict';var _=require(_0x9194('0x0'));var util=require(_0x9194('0x1'));var logger=require(_0x9194('0x2'))(_0x9194('0x3'));var moment=require('moment');var BPromise=require(_0x9194('0x4'));var rp=require(_0x9194('0x5'));var fs=require('fs');var path=require(_0x9194('0x6'));var rimraf=require(_0x9194('0x7'));var config=require(_0x9194('0x8'));var attributes=require(_0x9194('0x9'));module[_0x9194('0xa')]=function(_0x7f0639,_0x25486b){return _0x7f0639[_0x9194('0xb')](_0x9194('0xc'),attributes,{'tableName':_0x9194('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x19a8=['cm_custom_fields','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField'];(function(_0x1c97c8,_0x28d564){var _0x2c096d=function(_0x1bf3ec){while(--_0x1bf3ec){_0x1c97c8['push'](_0x1c97c8['shift']());}};_0x2c096d(++_0x28d564);}(_0x19a8,0x1a5));var _0x819a=function(_0x31edc9,_0x4404a1){_0x31edc9=_0x31edc9-0x0;var _0x4d1cd4=_0x19a8[_0x31edc9];return _0x4d1cd4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x819a('0x0'))(_0x819a('0x1'));var moment=require('moment');var BPromise=require(_0x819a('0x2'));var rp=require(_0x819a('0x3'));var fs=require('fs');var path=require(_0x819a('0x4'));var rimraf=require(_0x819a('0x5'));var config=require(_0x819a('0x6'));var attributes=require(_0x819a('0x7'));module[_0x819a('0x8')]=function(_0x1cfb8b,_0x10cfda){return _0x1cfb8b[_0x819a('0x9')](_0x819a('0xa'),attributes,{'tableName':_0x819a('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 32666a2..b33651d 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 _0xe986=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xe077d9,_0x2dd6dd){var _0x4f7690=function(_0x2e40b2){while(--_0x2e40b2){_0xe077d9['push'](_0xe077d9['shift']());}};_0x4f7690(++_0x2dd6dd);}(_0xe986,0x1c3));var _0x6e98=function(_0x2a2011,_0x4649f5){_0x2a2011=_0x2a2011-0x0;var _0x5d161a=_0xe986[_0x2a2011];return _0x5d161a;};'use strict';var _=require(_0x6e98('0x0'));var util=require(_0x6e98('0x1'));var moment=require(_0x6e98('0x2'));var BPromise=require(_0x6e98('0x3'));var rs=require(_0x6e98('0x4'));var fs=require('fs');var Redis=require(_0x6e98('0x5'));var db=require(_0x6e98('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6e98('0x7'));var config=require(_0x6e98('0x8'));var jayson=require(_0x6e98('0x9'));var client=jayson[_0x6e98('0xa')][_0x6e98('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ff10c,_0x44d686,_0x476c90){return new BPromise(function(_0x456ca8,_0x337a19){return client[_0x6e98('0xc')](_0x3ff10c,_0x476c90)['then'](function(_0x1dc240){logger[_0x6e98('0xd')](_0x6e98('0xe'),_0x44d686,'request\x20sent');logger[_0x6e98('0xf')](_0x6e98('0x10'),_0x44d686,_0x6e98('0x11'),JSON[_0x6e98('0x12')](_0x1dc240));if(_0x1dc240['error']){if(_0x1dc240[_0x6e98('0x13')][_0x6e98('0x14')]===0x1f4){logger['error'](_0x6e98('0xe'),_0x44d686,_0x1dc240[_0x6e98('0x13')]['message']);return _0x337a19(_0x1dc240[_0x6e98('0x13')][_0x6e98('0x15')]);}logger[_0x6e98('0x13')](_0x6e98('0xe'),_0x44d686,_0x1dc240[_0x6e98('0x13')][_0x6e98('0x15')]);return _0x456ca8(_0x1dc240[_0x6e98('0x13')]['message']);}else{logger[_0x6e98('0xd')](_0x6e98('0xe'),_0x44d686,_0x6e98('0x11'));_0x456ca8(_0x1dc240[_0x6e98('0x16')][_0x6e98('0x15')]);}})[_0x6e98('0x17')](function(_0x4a0ba5){logger['error']('CmCustomField,\x20%s,\x20%s',_0x44d686,_0x4a0ba5);_0x337a19(_0x4a0ba5);});});} \ No newline at end of file +var _0xa635=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x457ba4,_0x3fe3db){var _0xaca6f=function(_0xc0421){while(--_0xc0421){_0x457ba4['push'](_0x457ba4['shift']());}};_0xaca6f(++_0x3fe3db);}(_0xa635,0x73));var _0x5a63=function(_0x63b6c3,_0x5c3125){_0x63b6c3=_0x63b6c3-0x0;var _0x1b01f9=_0xa635[_0x63b6c3];return _0x1b01f9;};'use strict';var _=require(_0x5a63('0x0'));var util=require(_0x5a63('0x1'));var moment=require(_0x5a63('0x2'));var BPromise=require(_0x5a63('0x3'));var rs=require(_0x5a63('0x4'));var fs=require('fs');var Redis=require(_0x5a63('0x5'));var db=require(_0x5a63('0x6'))['db'];var utils=require(_0x5a63('0x7'));var logger=require('../../config/logger')(_0x5a63('0x8'));var config=require(_0x5a63('0x9'));var jayson=require(_0x5a63('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2fca04,_0x4d4c0,_0x5c5b07){return new BPromise(function(_0x2a6e0f,_0x572aea){return client['request'](_0x2fca04,_0x5c5b07)[_0x5a63('0xb')](function(_0x4cf89a){logger[_0x5a63('0xc')](_0x5a63('0xd'),_0x4d4c0,_0x5a63('0xe'));logger[_0x5a63('0xf')](_0x5a63('0x10'),_0x4d4c0,_0x5a63('0xe'),JSON[_0x5a63('0x11')](_0x4cf89a));if(_0x4cf89a[_0x5a63('0x12')]){if(_0x4cf89a[_0x5a63('0x12')][_0x5a63('0x13')]===0x1f4){logger[_0x5a63('0x12')](_0x5a63('0xd'),_0x4d4c0,_0x4cf89a[_0x5a63('0x12')][_0x5a63('0x14')]);return _0x572aea(_0x4cf89a['error'][_0x5a63('0x14')]);}logger[_0x5a63('0x12')]('CmCustomField,\x20%s,\x20%s',_0x4d4c0,_0x4cf89a[_0x5a63('0x12')]['message']);return _0x2a6e0f(_0x4cf89a['error'][_0x5a63('0x14')]);}else{logger[_0x5a63('0xc')]('CmCustomField,\x20%s,\x20%s',_0x4d4c0,_0x5a63('0xe'));_0x2a6e0f(_0x4cf89a[_0x5a63('0x15')]['message']);}})[_0x5a63('0x16')](function(_0x11f4f){logger[_0x5a63('0x12')](_0x5a63('0xd'),_0x4d4c0,_0x11f4f);_0x572aea(_0x11f4f);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index eaf4768..cf9b0b5 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 _0x36f3=['delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id'];(function(_0x51e8dc,_0x2ebe78){var _0x5f0693=function(_0xde8257){while(--_0xde8257){_0x51e8dc['push'](_0x51e8dc['shift']());}};_0x5f0693(++_0x2ebe78);}(_0x36f3,0xe6));var _0x336f=function(_0xe01c24,_0x508d50){_0xe01c24=_0xe01c24-0x0;var _0x18c6fe=_0x36f3[_0xe01c24];return _0x18c6fe;};'use strict';var multer=require('multer');var util=require(_0x336f('0x0'));var path=require(_0x336f('0x1'));var timeout=require(_0x336f('0x2'));var express=require(_0x336f('0x3'));var router=express[_0x336f('0x4')]();var fs_extra=require(_0x336f('0x5'));var auth=require(_0x336f('0x6'));var interaction=require(_0x336f('0x7'));var config=require(_0x336f('0x8'));var controller=require('./cmCustomField.controller');router[_0x336f('0x9')]('/',auth[_0x336f('0xa')](),controller[_0x336f('0xb')]);router['get']('/:id',auth[_0x336f('0xa')](),controller[_0x336f('0xc')]);router[_0x336f('0xd')]('/',auth[_0x336f('0xa')](),controller[_0x336f('0xe')]);router[_0x336f('0xf')](_0x336f('0x10'),auth[_0x336f('0xa')](),controller['update']);router[_0x336f('0x11')](_0x336f('0x10'),auth[_0x336f('0xa')](),controller[_0x336f('0x12')]);module['exports']=router; \ No newline at end of file +var _0x16a6=['get','/:id','post','create','isAuthenticated','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller'];(function(_0x42eff9,_0x14ec4d){var _0x5ef4d5=function(_0x4c8a37){while(--_0x4c8a37){_0x42eff9['push'](_0x42eff9['shift']());}};_0x5ef4d5(++_0x14ec4d);}(_0x16a6,0x15c));var _0x616a=function(_0x5a6de2,_0x5c8b10){_0x5a6de2=_0x5a6de2-0x0;var _0x2c0525=_0x16a6[_0x5a6de2];return _0x2c0525;};'use strict';var multer=require(_0x616a('0x0'));var util=require(_0x616a('0x1'));var path=require('path');var timeout=require(_0x616a('0x2'));var express=require(_0x616a('0x3'));var router=express[_0x616a('0x4')]();var fs_extra=require(_0x616a('0x5'));var auth=require(_0x616a('0x6'));var interaction=require(_0x616a('0x7'));var config=require('../../config/environment');var controller=require(_0x616a('0x8'));router[_0x616a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x616a('0x9')](_0x616a('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x616a('0xb')]('/',auth['isAuthenticated'](),controller[_0x616a('0xc')]);router['put'](_0x616a('0xa'),auth[_0x616a('0xd')](),controller[_0x616a('0xe')]);router['delete'](_0x616a('0xa'),auth[_0x616a('0xd')](),controller[_0x616a('0xf')]);module[_0x616a('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 08dea57..55ea0c2 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 _0xc425=['INTEGER','UNSIGNED','contactListQueue','sequelize','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xfe657b,_0x596d9f){var _0x3bc18d=function(_0x5ac0b1){while(--_0x5ac0b1){_0xfe657b['push'](_0xfe657b['shift']());}};_0x3bc18d(++_0x596d9f);}(_0xc425,0xc0));var _0x5c42=function(_0x4e9ed9,_0x2d5ebe){_0x4e9ed9=_0x4e9ed9-0x0;var _0x3a541c=_0xc425[_0x4e9ed9];return _0x3a541c;};'use strict';var moment=require('moment');var Sequelize=require(_0x5c42('0x0'));module['exports']={'phone':{'type':Sequelize[_0x5c42('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x5c42('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x5c42('0x3')],'defaultValue':moment()[_0x5c42('0x4')](_0x5c42('0x5'))},'countbusyretry':{'type':Sequelize[_0x5c42('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5c42('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5c42('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x5c42('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5c42('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x5c42('0x6')],'unique':_0x5c42('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x5c42('0x8')},'CampaignId':{'type':Sequelize[_0x5c42('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x5c42('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5c42('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5c42('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x5c42('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x5c42('0x1')]},'recallmeNotifiedDate':{'type':Sequelize[_0x5c42('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xf5f9=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue','STRING','BOOLEAN','DATE'];(function(_0xaa197b,_0x4fe403){var _0x5a407f=function(_0x49dc9a){while(--_0x49dc9a){_0xaa197b['push'](_0xaa197b['shift']());}};_0x5a407f(++_0x4fe403);}(_0xf5f9,0x1a8));var _0x9f5f=function(_0x2f7802,_0x29a4a3){_0x2f7802=_0x2f7802-0x0;var _0x29b223=_0xf5f9[_0x2f7802];return _0x29b223;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x9f5f('0x0')],'allowNull':![]},'active':{'type':Sequelize[_0x9f5f('0x1')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x9f5f('0x2')],'defaultValue':moment()[_0x9f5f('0x3')](_0x9f5f('0x4'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9f5f('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x9f5f('0x1')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9f5f('0x0')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9f5f('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x9f5f('0x1')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x9f5f('0x6')},'ListId':{'type':Sequelize[_0x9f5f('0x5')],'unique':_0x9f5f('0x6')},'UserId':{'type':Sequelize[_0x9f5f('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x9f5f('0x5')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x9f5f('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x9f5f('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9f5f('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9f5f('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9f5f('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9f5f('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x9f5f('0x2')],'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 f10b9f1..4578a44 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 _0x446c=['show','params','find','create','body','describe','VoiceQueueId','VoiceQueue','CampaignId','omit','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','end','getPreview','outbound','preview','dialPreviewAutoRecallMe','transaction','value','direction','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','sequelize','literal','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','phone','recallme','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','timezones','push','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','offset','undefined','limit','count','status','set','Content-Range','json','update','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','attributes','fields','length','sort','where','filter','merge','VIRTUAL','options','includeAll','include','CmHopper','findAll','rows','catch'];(function(_0x5988b1,_0x4222a5){var _0x260655=function(_0x35a274){while(--_0x35a274){_0x5988b1['push'](_0x5988b1['shift']());}};_0x260655(++_0x4222a5);}(_0x446c,0x156));var _0xc446=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0x446c[_0x4c7b20];return _0x4872bd;};'use strict';var moment=require(_0xc446('0x0'));var _=require(_0xc446('0x1'));var qs=require(_0xc446('0x2'));var logger=require(_0xc446('0x3'))('api');var shared=require(_0xc446('0x4'));var db=require(_0xc446('0x5'))['db'];function respondWithResult(_0xd67fc7,_0x570a67){_0x570a67=_0x570a67||0xc8;return function(_0x10047a){if(_0x10047a){return _0xd67fc7['status'](_0x570a67)['json'](_0x10047a);}};}function respondWithFilteredResult(_0x115a9e,_0x235050){return function(_0x578895){if(_0x578895){var _0x549fac=typeof _0x235050[_0xc446('0x6')]===_0xc446('0x7')&&typeof _0x235050[_0xc446('0x8')]===_0xc446('0x7');var _0x155b5c=_0x578895['count'];var _0xa44393=_0x549fac?0x0:_0x235050[_0xc446('0x6')];var _0xbbd769=_0x549fac?_0x578895[_0xc446('0x9')]:_0x235050['offset']+_0x235050[_0xc446('0x8')];var _0xbb2f6f;if(_0xbbd769>=_0x155b5c){_0xbbd769=_0x155b5c;_0xbb2f6f=0xc8;}else{_0xbb2f6f=0xce;}_0x115a9e[_0xc446('0xa')](_0xbb2f6f);return _0x115a9e[_0xc446('0xb')](_0xc446('0xc'),_0xa44393+'-'+_0xbbd769+'/'+_0x155b5c)[_0xc446('0xd')](_0x578895);}return null;};}function saveUpdates(_0x1a2099,_0x19083f){return function(_0x22a70e){if(_0x22a70e){return _0x22a70e[_0xc446('0xe')](_0x1a2099)[_0xc446('0xf')](function(_0x306814){return _0x306814;});}return null;};}function handleEntityNotFound(_0x1cfc0a,_0x72faac){return function(_0x21d8e4){if(!_0x21d8e4){_0x1cfc0a[_0xc446('0x10')](0x194);}return _0x21d8e4;};}function handleError(_0x7229de,_0x20e51b){_0x20e51b=_0x20e51b||0x1f4;return function(_0x2b09db){logger['error'](_0x2b09db[_0xc446('0x11')]);if(_0x2b09db[_0xc446('0x12')]){delete _0x2b09db[_0xc446('0x12')];}_0x7229de[_0xc446('0xa')](_0x20e51b)[_0xc446('0x13')](_0x2b09db);};}exports[_0xc446('0x14')]=function(_0x146be5,_0x30038f){var _0x16f337={},_0x606af1={},_0x51fa01={'count':0x0,'rows':[]};var _0x19c4d8=_[_0xc446('0x15')](db['CmHopper'][_0xc446('0x16')],function(_0x16b806){return{'name':_0x16b806[_0xc446('0x17')],'type':_0x16b806[_0xc446('0x18')][_0xc446('0x19')]};});_0x606af1[_0xc446('0x1a')]=_[_0xc446('0x15')](_0x19c4d8,_0xc446('0x12'));_0x606af1[_0xc446('0x1b')]=_[_0xc446('0x1c')](_0x146be5['query']);_0x606af1[_0xc446('0x1d')]=_[_0xc446('0x1e')](_0x606af1[_0xc446('0x1a')],_0x606af1[_0xc446('0x1b')]);_0x606af1[_0xc446('0x1d')]=_[_0xc446('0x1f')](_0x606af1[_0xc446('0x1d')],[_0xc446('0x20'),_0xc446('0x21'),_0xc446('0x22'),_0xc446('0x23'),_0xc446('0x24'),_0xc446('0x25'),_0xc446('0x26'),_0xc446('0x27'),_0xc446('0x28'),_0xc446('0x29'),'$notBetween',_0xc446('0x2a'),_0xc446('0x2b'),_0xc446('0x2c'),_0xc446('0x2d'),_0xc446('0x2e'),_0xc446('0x2f'),'$like','$overlap',_0xc446('0x30'),_0xc446('0x31'),_0xc446('0x32')]);_0x16f337[_0xc446('0x33')]=_['intersection'](_0x606af1[_0xc446('0x1a')],qs[_0xc446('0x34')](_0x146be5[_0xc446('0x1b')][_0xc446('0x34')]));_0x16f337[_0xc446('0x33')]=_0x16f337[_0xc446('0x33')][_0xc446('0x35')]?_0x16f337[_0xc446('0x33')]:_0x606af1[_0xc446('0x1a')];if(!_0x146be5[_0xc446('0x1b')]['hasOwnProperty']('nolimit')){_0x16f337['limit']=qs[_0xc446('0x8')](_0x146be5[_0xc446('0x1b')][_0xc446('0x8')]);_0x16f337[_0xc446('0x6')]=qs[_0xc446('0x6')](_0x146be5[_0xc446('0x1b')][_0xc446('0x6')]);}_0x16f337['order']=qs[_0xc446('0x36')](_0x146be5[_0xc446('0x1b')][_0xc446('0x36')]);_0x16f337[_0xc446('0x37')]=qs[_0xc446('0x1d')](_['pick'](_0x146be5[_0xc446('0x1b')],_0x606af1[_0xc446('0x1d')]),_0x19c4d8);if(_0x146be5[_0xc446('0x1b')][_0xc446('0x38')]){_0x16f337[_0xc446('0x37')]=_[_0xc446('0x39')](_0x16f337[_0xc446('0x37')],{'$or':_[_0xc446('0x15')](_0x19c4d8,function(_0x5c2bf3){if(_0x5c2bf3['type']!==_0xc446('0x3a')){var _0x396ec6={};_0x396ec6[_0x5c2bf3[_0xc446('0x12')]]={'$like':'%'+_0x146be5['query'][_0xc446('0x38')]+'%'};return _0x396ec6;}})});}_0x16f337=_[_0xc446('0x39')]({},_0x16f337,_0x146be5[_0xc446('0x3b')]);var _0x4d10a0={'where':_0x16f337['where']};return db['CmHopper'][_0xc446('0x9')](_0x4d10a0)['then'](function(_0x8b1c5b){_0x51fa01[_0xc446('0x9')]=_0x8b1c5b;if(_0x146be5['query'][_0xc446('0x3c')]){_0x16f337[_0xc446('0x3d')]=[{'all':!![]}];}return db[_0xc446('0x3e')][_0xc446('0x3f')](_0x16f337);})['then'](function(_0x1d4f83){_0x51fa01[_0xc446('0x40')]=_0x1d4f83;return _0x51fa01;})['then'](respondWithFilteredResult(_0x30038f,_0x16f337))[_0xc446('0x41')](handleError(_0x30038f,null));};exports[_0xc446('0x42')]=function(_0x43cf3e,_0x28a8b6){var _0xf3400e={'raw':!![],'where':{'id':_0x43cf3e[_0xc446('0x43')]['id']}},_0x49f14c={};_0x49f14c[_0xc446('0x1a')]=_[_0xc446('0x1c')](db[_0xc446('0x3e')][_0xc446('0x16')]);_0x49f14c['query']=_[_0xc446('0x1c')](_0x43cf3e[_0xc446('0x1b')]);_0x49f14c[_0xc446('0x1d')]=_[_0xc446('0x1e')](_0x49f14c[_0xc446('0x1a')],_0x49f14c['query']);_0xf3400e[_0xc446('0x33')]=_['intersection'](_0x49f14c[_0xc446('0x1a')],qs[_0xc446('0x34')](_0x43cf3e['query'][_0xc446('0x34')]));_0xf3400e[_0xc446('0x33')]=_0xf3400e[_0xc446('0x33')][_0xc446('0x35')]?_0xf3400e[_0xc446('0x33')]:_0x49f14c[_0xc446('0x1a')];if(_0x43cf3e['query'][_0xc446('0x3c')]){_0xf3400e[_0xc446('0x3d')]=[{'all':!![]}];}_0xf3400e=_[_0xc446('0x39')]({},_0xf3400e,_0x43cf3e['options']);return db[_0xc446('0x3e')][_0xc446('0x44')](_0xf3400e)[_0xc446('0xf')](handleEntityNotFound(_0x28a8b6,null))[_0xc446('0xf')](respondWithResult(_0x28a8b6,null))[_0xc446('0x41')](handleError(_0x28a8b6,null));};exports[_0xc446('0x45')]=function(_0x430a41,_0x39b03d){return db[_0xc446('0x3e')][_0xc446('0x45')](_0x430a41[_0xc446('0x46')],{})[_0xc446('0xf')](respondWithResult(_0x39b03d,0xc9))[_0xc446('0x41')](handleError(_0x39b03d,null));};exports[_0xc446('0xe')]=function(_0x3d1581,_0x50c85d){if(_0x3d1581['body']['id']){delete _0x3d1581[_0xc446('0x46')]['id'];}return db[_0xc446('0x3e')]['find']({'where':{'id':_0x3d1581['params']['id']}})['then'](handleEntityNotFound(_0x50c85d,null))['then'](saveUpdates(_0x3d1581[_0xc446('0x46')],null))[_0xc446('0xf')](respondWithResult(_0x50c85d,null))[_0xc446('0x41')](handleError(_0x50c85d,null));};exports[_0xc446('0x47')]=function(_0x19ca3d,_0x146b7c){return db[_0xc446('0x3e')][_0xc446('0x47')]()[_0xc446('0xf')](respondWithResult(_0x146b7c,null))[_0xc446('0x41')](handleError(_0x146b7c,null));};exports['destroy']=function(_0x40aa4f,_0x317559){var _0xe71d6;var _0x531460=_0x40aa4f[_0xc446('0x43')]['id'];return db['CmHopper'][_0xc446('0x44')]({'where':{'id':_0x40aa4f[_0xc446('0x43')]['id']}})[_0xc446('0xf')](handleEntityNotFound(_0x317559,null))[_0xc446('0xf')](function(_0x1b1602){if(_0x1b1602){return _0x1b1602['destroy']()[_0xc446('0xf')](function(_0x5415e5){return _0x5415e5;});}})[_0xc446('0xf')](function(_0x55d81d){_0xe71d6=_0x55d81d;if(_0x55d81d){if(_0x55d81d[_0xc446('0x48')]||_0x55d81d['CampaignId']){return db[_0x55d81d[_0xc446('0x48')]?_0xc446('0x49'):'Campaign']['find']({'where':{'id':_0x55d81d[_0xc446('0x48')]?_0x55d81d['VoiceQueueId']:_0x55d81d[_0xc446('0x4a')]},'attributes':['id',_0xc446('0x12')],'raw':!![]});}}})[_0xc446('0xf')](function(_0x3aa59b){var _0x455a87={};if(_0x3aa59b){_[_0xc446('0x39')](_0x455a87,_[_0xc446('0x4b')](_0xe71d6['dataValues'],[_0xc446('0x4c'),_0xc446('0x4d'),'id']));_0x455a87[_0xc446('0x4e')]=0x15;_0x455a87[_0xc446('0x4f')]=_0xc446('0x50');_0x455a87[_0xc446('0x51')]=_0x3aa59b[_0xc446('0x12')];_0x455a87[_0xc446('0x52')]=_0x40aa4f[_0xc446('0x53')][_0xc446('0x12')];_0x455a87[_0xc446('0x54')]=_0x40aa4f[_0xc446('0x53')]['id'];_0x455a87['deleted']=!![];_0x455a87[_0xc446('0x55')]=moment()[_0xc446('0x56')](_0xc446('0x57'));_0x455a87[_0xc446('0x58')]=_0xe71d6['phone'];_0x455a87['campaigntype']=_0xe71d6[_0xc446('0x48')]?'queue':_0xc446('0x59');return db[_0xc446('0x5a')][_0xc446('0x44')]({'where':{'id':_0x455a87['ContactId']},'attributes':[_0xc446('0x5b'),_0xc446('0x5c')]})[_0xc446('0xf')](function(_0x489cd1){if(!_['isNil'](_0x317559)&&!_[_0xc446('0x5d')](_0x489cd1[_0xc446('0x5b')])){_0x455a87[_0xc446('0x5e')]=_0x489cd1[_0xc446('0x5b')];if(!_[_0xc446('0x5d')](_0x489cd1[_0xc446('0x5c')])){_0x455a87[_0xc446('0x5e')]+='\x20'+_0x489cd1[_0xc446('0x5c')];}}})[_0xc446('0x5f')](function(){return db[_0xc446('0x60')][_0xc446('0x45')](_0x455a87);});}})['then'](function(_0x4abb72){return db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':_0x531460}});})['then'](function(){return _0x317559[_0xc446('0xa')](0xcc)[_0xc446('0x61')]();})[_0xc446('0x41')](handleError(_0x317559,null));};exports[_0xc446('0x62')]=function(_0x41eae9,_0x531513){var _0x2b5ce5=[];return db['CmContact'][_0xc446('0x47')]()[_0xc446('0xf')](function(_0x15e481){_0x2b5ce5=_['keys'](_0x15e481);return _0x41eae9[_0xc446('0x53')]['getVoiceQueues']({'where':{'type':_0xc446('0x63'),'dialActive':!![],'dialMethod':_0xc446('0x64')},'attributes':['id','dialOrderByScheduledAt',_0xc446('0x65')],'raw':!![]});})[_0xc446('0xf')](function(_0x2bf81e){if(_0x2bf81e&&_0x2bf81e[_0xc446('0x35')]){return db['sequelize'][_0xc446('0x66')](function(_0x21267f){var _0x31eb58={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xc446('0x56')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x2bf81e,'id')},'$or':[{'UserId':null},{'UserId':_0x41eae9[_0xc446('0x53')]['id']}]};var _0x245581={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2bf81e)[_0xc446('0x38')]([_0xc446('0x65'),0x0])[_0xc446('0x15')]('id')[_0xc446('0x67')]()},'$or':[{'UserId':null},{'UserId':_0x41eae9[_0xc446('0x53')]['id']}]};var _0x4a4cd5={'$or':[_0x31eb58,_0x245581]};var _0xf97ada=[];if(_0x41eae9[_0xc446('0x46')][_0xc446('0x68')]&&_0x41eae9['body']['direction']==='prev'){if(!_['isEmpty'](_0x41eae9['body'][_0xc446('0x69')])){_0x4a4cd5['id']={'$in':_0x41eae9['body'][_0xc446('0x69')]};}_0xf97ada=[[_0xc446('0x6a'),_0xc446('0x6b')],[_0xc446('0x6c'),_0x2bf81e[0x0][_0xc446('0x6d')]===_0xc446('0x6b')?_0xc446('0x6e'):_0xc446('0x6b')],db[_0xc446('0x6f')][_0xc446('0x70')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xc446('0x6e')]];}else{if(!_[_0xc446('0x71')](_0x41eae9[_0xc446('0x46')][_0xc446('0x69')])){_0x4a4cd5['id']={'$notIn':_0x41eae9['body'][_0xc446('0x69')]};}_0xf97ada=[[_0xc446('0x6a'),_0xc446('0x6e')],[_0xc446('0x6c'),_0x2bf81e[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0xc446('0x70')](_0xc446('0x72')),['id',_0xc446('0x6b')]];}return db['CmHopper']['findOne']({'attributes':['id',_0xc446('0x73'),_0xc446('0x74'),_0xc446('0x75')],'where':_0x4a4cd5,'order':_0xf97ada,'transaction':_0x21267f,'lock':_0x21267f['LOCK'][_0xc446('0x76')],'include':[{'model':db['CmContact'],'as':_0xc446('0x77'),'attributes':_0x2b5ce5,'include':[{'model':db[_0xc446('0x78')],'as':_0xc446('0x79'),'attributes':['id',_0xc446('0x12')]}]},{'model':db[_0xc446('0x7a')],'as':_0xc446('0x7b'),'attributes':['id',_0xc446('0x12')]},{'model':db['VoiceQueue'],'as':_0xc446('0x7c'),'attributes':['id',_0xc446('0x12'),_0xc446('0x7d')]}]})[_0xc446('0xf')](function(_0x37fa25){if(_0x37fa25){return _0x37fa25['update']({'UserId':_0x41eae9['user']['id']},{'transaction':_0x21267f});}});});}})[_0xc446('0xf')](handleEntityNotFound(_0x531513,null))['then'](respondWithResult(_0x531513,null))[_0xc446('0x41')](handleError(_0x531513,null));};exports[_0xc446('0x7e')]=function(_0x268319,_0xe968ab,_0x47b4c0){var _0x41db15=[];var _0xd309ce=_0x268319[_0xc446('0x43')]['id'];var _0x31979a=_0x268319[_0xc446('0x53')]['id'];return db[_0xc446('0x5a')][_0xc446('0x47')]()[_0xc446('0xf')](function(_0x4b9fda){_0x41db15=_['keys'](_0x4b9fda);return db[_0xc446('0x6f')]['transaction'](function(_0x597e8a){const _0x23b991={'id':_0xd309ce};return db[_0xc446('0x3e')]['findOne']({'attributes':['id',_0xc446('0x73'),_0xc446('0x75')],'where':_0x23b991,'transaction':_0x597e8a,'lock':_0x597e8a['LOCK']['UPDATE'],'include':[{'model':db[_0xc446('0x5a')],'as':_0xc446('0x77'),'attributes':_0x41db15,'include':[{'model':db[_0xc446('0x78')],'as':_0xc446('0x79'),'attributes':['id','name']}]},{'model':db[_0xc446('0x7a')],'as':_0xc446('0x7b'),'attributes':['id',_0xc446('0x12')]},{'model':db[_0xc446('0x49')],'as':_0xc446('0x7c'),'attributes':['id',_0xc446('0x12'),_0xc446('0x7d')]}]})['then'](function(_0x393858){if(_0x393858){return _0x393858[_0xc446('0xe')]({'UserId':_0x31979a},{'transaction':_0x597e8a});}});});})[_0xc446('0xf')](handleEntityNotFound(_0xe968ab,null))[_0xc446('0xf')](respondWithResult(_0xe968ab,null))[_0xc446('0x41')](handleError(_0xe968ab,null));};exports['getOpenContacts']=function(_0x498560,_0x41ca35){return _0x498560['user']['getVoiceQueues']({'where':{'type':_0xc446('0x63'),'dialActive':!![],'dialMethod':_0xc446('0x64')},'attributes':['id'],'raw':!![]})['then'](function(_0x59782d){if(_0x59782d&&_0x59782d[_0xc446('0x35')]){return db[_0xc446('0x3e')][_0xc446('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xc446('0x56')](_0xc446('0x57'))},'VoiceQueueId':{'$in':_[_0xc446('0x15')](_0x59782d,'id')},'$or':[{'UserId':null},{'UserId':_0x498560[_0xc446('0x53')]['id']}]}});}return 0x0;})[_0xc446('0xf')](function(_0x29b170){if(!_['isNil'](_0x29b170)&&_[_0xc446('0x7f')](_0x29b170)){return _0x41ca35[_0xc446('0xa')](0xc8)['json']({'contacts':_0x29b170});}else{logger[_0xc446('0x80')](_0xc446('0x81'),_0xc446('0x82'),0x194,_0xc446('0x83'));_0x41ca35[_0xc446('0x10')](0x194);}})['catch'](handleError(_0x41ca35,null));};exports['getTimezones']=function(_0xbdd557,_0xd9ae2){var _0x120058=shared[_0xc446('0x84')];var _0x1d547c=[];_[_0xc446('0x15')](_0x120058,function(_0x4a496d){_0x1d547c[_0xc446('0x85')]({'id':_0x4a496d[_0xc446('0x12')],'name':_0x4a496d[_0xc446('0x12')],'utcOffset':_0x4a496d[_0xc446('0x86')]});});return _0xd9ae2[_0xc446('0xa')](0xc8)[_0xc446('0xd')]({'tz':_0x1d547c});};exports[_0xc446('0x87')]=function(_0x565e16,_0x6a724a){var _0x16ceb8=shared['timezones'];var _0x269566={};if(!_[_0xc446('0x5d')](_0x16ceb8[_0x565e16['body']['id']]))_0x269566=_0x16ceb8[_0x565e16[_0xc446('0x46')]['id']];return _0x6a724a[_0xc446('0xa')](0xc8)[_0xc446('0xd')](_0x269566);}; \ No newline at end of file +var _0x79a8=['user','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ContactId','lastName','isNil','firstName','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','format','value','direction','prev','isEmpty','hopperIds','scheduledAt','ASC','DESC','literal','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','VoiceQueue','Queue','dialActive','getPreviewRecall','transaction','recallme','List','getOpenContacts','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','timezones','push','utcOffset','getTimezone','moment','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','json','undefined','offset','limit','set','Content-Range','update','then','sendStatus','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','key','model','query','intersection','filters','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','$any','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','count','rows','params','keys','includeAll','catch','create','body','find','describe','CampaignId','VoiceQueueId','Campaign','omit','dataValues','createdAt','state','statedesc','deleted','campaign','membername'];(function(_0x475612,_0x54baf2){var _0x1abc5a=function(_0x40b395){while(--_0x40b395){_0x475612['push'](_0x475612['shift']());}};_0x1abc5a(++_0x54baf2);}(_0x79a8,0x1d0));var _0x879a=function(_0xfcfc35,_0x41125e){_0xfcfc35=_0xfcfc35-0x0;var _0x13a3c7=_0x79a8[_0xfcfc35];return _0x13a3c7;};'use strict';var moment=require(_0x879a('0x0'));var _=require('lodash');var qs=require(_0x879a('0x1'));var logger=require(_0x879a('0x2'))(_0x879a('0x3'));var shared=require('../../config/environment');var db=require(_0x879a('0x4'))['db'];function respondWithResult(_0x49b7c0,_0x46ee67){_0x46ee67=_0x46ee67||0xc8;return function(_0x1fe9b2){if(_0x1fe9b2){return _0x49b7c0[_0x879a('0x5')](_0x46ee67)[_0x879a('0x6')](_0x1fe9b2);}};}function respondWithFilteredResult(_0x1808f1,_0x3cb89c){return function(_0x1d353e){if(_0x1d353e){var _0x2427bf=typeof _0x3cb89c['offset']===_0x879a('0x7')&&typeof _0x3cb89c['limit']===_0x879a('0x7');var _0x2182a3=_0x1d353e['count'];var _0x32f78d=_0x2427bf?0x0:_0x3cb89c[_0x879a('0x8')];var _0x832c07=_0x2427bf?_0x1d353e['count']:_0x3cb89c[_0x879a('0x8')]+_0x3cb89c[_0x879a('0x9')];var _0x4ce306;if(_0x832c07>=_0x2182a3){_0x832c07=_0x2182a3;_0x4ce306=0xc8;}else{_0x4ce306=0xce;}_0x1808f1['status'](_0x4ce306);return _0x1808f1[_0x879a('0xa')](_0x879a('0xb'),_0x32f78d+'-'+_0x832c07+'/'+_0x2182a3)[_0x879a('0x6')](_0x1d353e);}return null;};}function saveUpdates(_0x320115,_0x54a9b6){return function(_0x4738b4){if(_0x4738b4){return _0x4738b4[_0x879a('0xc')](_0x320115)[_0x879a('0xd')](function(_0x1ea66e){return _0x1ea66e;});}return null;};}function handleEntityNotFound(_0x1a20c5,_0x1c2853){return function(_0x461f1e){if(!_0x461f1e){_0x1a20c5[_0x879a('0xe')](0x194);}return _0x461f1e;};}function handleError(_0x1746b6,_0x16b649){_0x16b649=_0x16b649||0x1f4;return function(_0x5b4dbe){logger['error'](_0x5b4dbe[_0x879a('0xf')]);if(_0x5b4dbe[_0x879a('0x10')]){delete _0x5b4dbe['name'];}_0x1746b6[_0x879a('0x5')](_0x16b649)[_0x879a('0x11')](_0x5b4dbe);};}exports[_0x879a('0x12')]=function(_0x3d4462,_0x32d9f5){var _0x61427a={},_0x4160bd={},_0x849ec5={'count':0x0,'rows':[]};var _0x1ed368=_[_0x879a('0x13')](db[_0x879a('0x14')][_0x879a('0x15')],function(_0x18b3d2){return{'name':_0x18b3d2[_0x879a('0x16')],'type':_0x18b3d2['type'][_0x879a('0x17')]};});_0x4160bd[_0x879a('0x18')]=_['map'](_0x1ed368,_0x879a('0x10'));_0x4160bd[_0x879a('0x19')]=_['keys'](_0x3d4462['query']);_0x4160bd['filters']=_[_0x879a('0x1a')](_0x4160bd[_0x879a('0x18')],_0x4160bd[_0x879a('0x19')]);_0x4160bd[_0x879a('0x1b')]=_['concat'](_0x4160bd['filters'],[_0x879a('0x1c'),_0x879a('0x1d'),_0x879a('0x1e'),_0x879a('0x1f'),_0x879a('0x20'),_0x879a('0x21'),_0x879a('0x22'),_0x879a('0x23'),_0x879a('0x24'),_0x879a('0x25'),_0x879a('0x26'),_0x879a('0x27'),_0x879a('0x28'),'$like',_0x879a('0x29'),_0x879a('0x2a'),_0x879a('0x2b'),_0x879a('0x2c'),_0x879a('0x2d'),_0x879a('0x2e'),_0x879a('0x2f'),_0x879a('0x30')]);_0x61427a[_0x879a('0x31')]=_[_0x879a('0x1a')](_0x4160bd[_0x879a('0x18')],qs[_0x879a('0x32')](_0x3d4462[_0x879a('0x19')][_0x879a('0x32')]));_0x61427a[_0x879a('0x31')]=_0x61427a[_0x879a('0x31')][_0x879a('0x33')]?_0x61427a[_0x879a('0x31')]:_0x4160bd['model'];if(!_0x3d4462[_0x879a('0x19')]['hasOwnProperty'](_0x879a('0x34'))){_0x61427a[_0x879a('0x9')]=qs[_0x879a('0x9')](_0x3d4462['query'][_0x879a('0x9')]);_0x61427a['offset']=qs['offset'](_0x3d4462['query']['offset']);}_0x61427a[_0x879a('0x35')]=qs[_0x879a('0x36')](_0x3d4462['query'][_0x879a('0x36')]);_0x61427a[_0x879a('0x37')]=qs[_0x879a('0x1b')](_['pick'](_0x3d4462[_0x879a('0x19')],_0x4160bd[_0x879a('0x1b')]),_0x1ed368);if(_0x3d4462[_0x879a('0x19')][_0x879a('0x38')]){_0x61427a['where']=_[_0x879a('0x39')](_0x61427a[_0x879a('0x37')],{'$or':_[_0x879a('0x13')](_0x1ed368,function(_0x2f5cb8){if(_0x2f5cb8['type']!==_0x879a('0x3a')){var _0x4bbddc={};_0x4bbddc[_0x2f5cb8[_0x879a('0x10')]]={'$like':'%'+_0x3d4462['query'][_0x879a('0x38')]+'%'};return _0x4bbddc;}})});}_0x61427a=_[_0x879a('0x39')]({},_0x61427a,_0x3d4462['options']);var _0x2b80ee={'where':_0x61427a[_0x879a('0x37')]};return db[_0x879a('0x14')][_0x879a('0x3b')](_0x2b80ee)['then'](function(_0x26d0ee){_0x849ec5[_0x879a('0x3b')]=_0x26d0ee;if(_0x3d4462[_0x879a('0x19')]['includeAll']){_0x61427a['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x61427a);})['then'](function(_0x452558){_0x849ec5[_0x879a('0x3c')]=_0x452558;return _0x849ec5;})[_0x879a('0xd')](respondWithFilteredResult(_0x32d9f5,_0x61427a))['catch'](handleError(_0x32d9f5,null));};exports['show']=function(_0x4a047b,_0x44cff6){var _0x5597f9={'raw':!![],'where':{'id':_0x4a047b[_0x879a('0x3d')]['id']}},_0x3ecbe0={};_0x3ecbe0[_0x879a('0x18')]=_['keys'](db['CmHopper'][_0x879a('0x15')]);_0x3ecbe0['query']=_[_0x879a('0x3e')](_0x4a047b[_0x879a('0x19')]);_0x3ecbe0['filters']=_[_0x879a('0x1a')](_0x3ecbe0[_0x879a('0x18')],_0x3ecbe0[_0x879a('0x19')]);_0x5597f9['attributes']=_[_0x879a('0x1a')](_0x3ecbe0[_0x879a('0x18')],qs['fields'](_0x4a047b[_0x879a('0x19')][_0x879a('0x32')]));_0x5597f9['attributes']=_0x5597f9[_0x879a('0x31')][_0x879a('0x33')]?_0x5597f9[_0x879a('0x31')]:_0x3ecbe0[_0x879a('0x18')];if(_0x4a047b['query'][_0x879a('0x3f')]){_0x5597f9['include']=[{'all':!![]}];}_0x5597f9=_[_0x879a('0x39')]({},_0x5597f9,_0x4a047b['options']);return db[_0x879a('0x14')]['find'](_0x5597f9)[_0x879a('0xd')](handleEntityNotFound(_0x44cff6,null))[_0x879a('0xd')](respondWithResult(_0x44cff6,null))[_0x879a('0x40')](handleError(_0x44cff6,null));};exports[_0x879a('0x41')]=function(_0x1059ac,_0x3686b3){return db['CmHopper'][_0x879a('0x41')](_0x1059ac[_0x879a('0x42')],{})[_0x879a('0xd')](respondWithResult(_0x3686b3,0xc9))['catch'](handleError(_0x3686b3,null));};exports[_0x879a('0xc')]=function(_0x445d1f,_0x7f2d83){if(_0x445d1f['body']['id']){delete _0x445d1f[_0x879a('0x42')]['id'];}return db[_0x879a('0x14')][_0x879a('0x43')]({'where':{'id':_0x445d1f[_0x879a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x7f2d83,null))['then'](saveUpdates(_0x445d1f[_0x879a('0x42')],null))[_0x879a('0xd')](respondWithResult(_0x7f2d83,null))['catch'](handleError(_0x7f2d83,null));};exports[_0x879a('0x44')]=function(_0x4420ac,_0x48f92a){return db[_0x879a('0x14')][_0x879a('0x44')]()[_0x879a('0xd')](respondWithResult(_0x48f92a,null))[_0x879a('0x40')](handleError(_0x48f92a,null));};exports['destroy']=function(_0x3ffbe6,_0x32933f){var _0x2b1e44;var _0x51dc92=_0x3ffbe6['params']['id'];return db[_0x879a('0x14')][_0x879a('0x43')]({'where':{'id':_0x3ffbe6['params']['id']}})[_0x879a('0xd')](handleEntityNotFound(_0x32933f,null))[_0x879a('0xd')](function(_0x196d84){if(_0x196d84){return _0x196d84['destroy']()[_0x879a('0xd')](function(_0x677418){return _0x677418;});}})[_0x879a('0xd')](function(_0x2f7691){_0x2b1e44=_0x2f7691;if(_0x2f7691){if(_0x2f7691['VoiceQueueId']||_0x2f7691[_0x879a('0x45')]){return db[_0x2f7691[_0x879a('0x46')]?'VoiceQueue':_0x879a('0x47')][_0x879a('0x43')]({'where':{'id':_0x2f7691['VoiceQueueId']?_0x2f7691['VoiceQueueId']:_0x2f7691[_0x879a('0x45')]},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x1fe260){var _0x397e90={};if(_0x1fe260){_['merge'](_0x397e90,_[_0x879a('0x48')](_0x2b1e44[_0x879a('0x49')],[_0x879a('0x4a'),'updatedAt','id']));_0x397e90[_0x879a('0x4b')]=0x15;_0x397e90[_0x879a('0x4c')]=_0x879a('0x4d');_0x397e90[_0x879a('0x4e')]=_0x1fe260[_0x879a('0x10')];_0x397e90[_0x879a('0x4f')]=_0x3ffbe6[_0x879a('0x50')][_0x879a('0x10')];_0x397e90['UserId']=_0x3ffbe6[_0x879a('0x50')]['id'];_0x397e90[_0x879a('0x4d')]=!![];_0x397e90['deletedat']=moment()['format'](_0x879a('0x51'));_0x397e90['calleridnum']=_0x2b1e44[_0x879a('0x52')];_0x397e90[_0x879a('0x53')]=_0x2b1e44[_0x879a('0x46')]?_0x879a('0x54'):'ivr';return db['CmContact'][_0x879a('0x43')]({'where':{'id':_0x397e90[_0x879a('0x55')]},'attributes':['firstName',_0x879a('0x56')]})[_0x879a('0xd')](function(_0x1d7ab7){if(!_[_0x879a('0x57')](_0x32933f)&&!_['isNil'](_0x1d7ab7['firstName'])){_0x397e90['calleridname']=_0x1d7ab7[_0x879a('0x58')];if(!_[_0x879a('0x57')](_0x1d7ab7['lastName'])){_0x397e90['calleridname']+='\x20'+_0x1d7ab7[_0x879a('0x56')];}}})[_0x879a('0x59')](function(){return db[_0x879a('0x5a')][_0x879a('0x41')](_0x397e90);});}})['then'](function(_0x3cb80f){return db[_0x879a('0x5b')]['destroy']({'where':{'CmHopperId':_0x51dc92}});})['then'](function(){return _0x32933f[_0x879a('0x5')](0xcc)[_0x879a('0x5c')]();})['catch'](handleError(_0x32933f,null));};exports[_0x879a('0x5d')]=function(_0x1ee969,_0x47f7a1){var _0x3d05a8=[];return db[_0x879a('0x5e')][_0x879a('0x44')]()['then'](function(_0x37e79a){_0x3d05a8=_[_0x879a('0x3e')](_0x37e79a);return _0x1ee969[_0x879a('0x50')][_0x879a('0x5f')]({'where':{'type':_0x879a('0x60'),'dialActive':!![],'dialMethod':_0x879a('0x61')},'attributes':['id',_0x879a('0x62'),_0x879a('0x63')],'raw':!![]});})['then'](function(_0x14b751){if(_0x14b751&&_0x14b751[_0x879a('0x33')]){return db[_0x879a('0x64')]['transaction'](function(_0x4aeca5){var _0x197035={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x879a('0x65')](_0x879a('0x51'))},'VoiceQueueId':{'$in':_['map'](_0x14b751,'id')},'$or':[{'UserId':null},{'UserId':_0x1ee969[_0x879a('0x50')]['id']}]};var _0x2885ae={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x14b751)[_0x879a('0x38')](['dialPreviewAutoRecallMe',0x0])['map']('id')[_0x879a('0x66')]()},'$or':[{'UserId':null},{'UserId':_0x1ee969['user']['id']}]};var _0x5bd8a7={'$or':[_0x197035,_0x2885ae]};var _0x46a2ac=[];if(_0x1ee969[_0x879a('0x42')][_0x879a('0x67')]&&_0x1ee969[_0x879a('0x42')]['direction']===_0x879a('0x68')){if(!_[_0x879a('0x69')](_0x1ee969[_0x879a('0x42')]['hopperIds'])){_0x5bd8a7['id']={'$in':_0x1ee969[_0x879a('0x42')][_0x879a('0x6a')]};}_0x46a2ac=[['priority','ASC'],[_0x879a('0x6b'),_0x14b751[0x0][_0x879a('0x62')]===_0x879a('0x6c')?_0x879a('0x6d'):'ASC'],db[_0x879a('0x64')][_0x879a('0x6e')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x879a('0x6d')]];}else{if(!_[_0x879a('0x69')](_0x1ee969[_0x879a('0x42')][_0x879a('0x6a')])){_0x5bd8a7['id']={'$notIn':_0x1ee969[_0x879a('0x42')][_0x879a('0x6a')]};}_0x46a2ac=[[_0x879a('0x6f'),'DESC'],[_0x879a('0x6b'),_0x14b751[0x0]['dialOrderByScheduledAt']],db[_0x879a('0x64')][_0x879a('0x6e')](_0x879a('0x70')),['id',_0x879a('0x6c')]];}return db[_0x879a('0x14')][_0x879a('0x71')]({'attributes':['id',_0x879a('0x72'),_0x879a('0x52'),'recallme'],'where':_0x5bd8a7,'order':_0x46a2ac,'transaction':_0x4aeca5,'lock':_0x4aeca5[_0x879a('0x73')][_0x879a('0x74')],'include':[{'model':db[_0x879a('0x5e')],'as':_0x879a('0x75'),'attributes':_0x3d05a8,'include':[{'model':db[_0x879a('0x76')],'as':_0x879a('0x77'),'attributes':['id',_0x879a('0x10')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x879a('0x10')]},{'model':db[_0x879a('0x78')],'as':_0x879a('0x79'),'attributes':['id',_0x879a('0x10'),_0x879a('0x7a')]}]})['then'](function(_0x3ae266){if(_0x3ae266){return _0x3ae266[_0x879a('0xc')]({'UserId':_0x1ee969['user']['id']},{'transaction':_0x4aeca5});}});});}})[_0x879a('0xd')](handleEntityNotFound(_0x47f7a1,null))[_0x879a('0xd')](respondWithResult(_0x47f7a1,null))['catch'](handleError(_0x47f7a1,null));};exports[_0x879a('0x7b')]=function(_0x58db87,_0x307be0,_0x258ce2){var _0x528baf=[];var _0x4703d8=_0x58db87[_0x879a('0x3d')]['id'];var _0x33644f=_0x58db87['user']['id'];return db[_0x879a('0x5e')][_0x879a('0x44')]()[_0x879a('0xd')](function(_0x1ab184){_0x528baf=_[_0x879a('0x3e')](_0x1ab184);return db[_0x879a('0x64')][_0x879a('0x7c')](function(_0x59b327){const _0x4a10b1={'id':_0x4703d8};return db[_0x879a('0x14')][_0x879a('0x71')]({'attributes':['id',_0x879a('0x72'),_0x879a('0x7d')],'where':_0x4a10b1,'transaction':_0x59b327,'lock':_0x59b327[_0x879a('0x73')]['UPDATE'],'include':[{'model':db[_0x879a('0x5e')],'as':_0x879a('0x75'),'attributes':_0x528baf,'include':[{'model':db[_0x879a('0x76')],'as':_0x879a('0x77'),'attributes':['id',_0x879a('0x10')]}]},{'model':db['CmList'],'as':_0x879a('0x7e'),'attributes':['id',_0x879a('0x10')]},{'model':db[_0x879a('0x78')],'as':_0x879a('0x79'),'attributes':['id',_0x879a('0x10'),'dialActive']}]})['then'](function(_0x25d9b5){if(_0x25d9b5){return _0x25d9b5[_0x879a('0xc')]({'UserId':_0x33644f},{'transaction':_0x59b327});}});});})[_0x879a('0xd')](handleEntityNotFound(_0x307be0,null))[_0x879a('0xd')](respondWithResult(_0x307be0,null))[_0x879a('0x40')](handleError(_0x307be0,null));};exports[_0x879a('0x7f')]=function(_0xa497cb,_0x19b43a){return _0xa497cb[_0x879a('0x50')][_0x879a('0x5f')]({'where':{'type':_0x879a('0x60'),'dialActive':!![],'dialMethod':_0x879a('0x61')},'attributes':['id'],'raw':!![]})['then'](function(_0x3bbe14){if(_0x3bbe14&&_0x3bbe14[_0x879a('0x33')]){return db[_0x879a('0x14')][_0x879a('0x3b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x879a('0x65')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x879a('0x13')](_0x3bbe14,'id')},'$or':[{'UserId':null},{'UserId':_0xa497cb['user']['id']}]}});}return 0x0;})[_0x879a('0xd')](function(_0x5d0f15){if(!_[_0x879a('0x57')](_0x5d0f15)&&_[_0x879a('0x80')](_0x5d0f15)){return _0x19b43a[_0x879a('0x5')](0xc8)['json']({'contacts':_0x5d0f15});}else{logger[_0x879a('0x81')](_0x879a('0x82'),_0x879a('0x7f'),0x194,'entity\x20not\x20found');_0x19b43a[_0x879a('0xe')](0x194);}})[_0x879a('0x40')](handleError(_0x19b43a,null));};exports[_0x879a('0x83')]=function(_0x289784,_0x4b5da3){var _0x607595=shared[_0x879a('0x84')];var _0x155a40=[];_[_0x879a('0x13')](_0x607595,function(_0x257d24){_0x155a40[_0x879a('0x85')]({'id':_0x257d24[_0x879a('0x10')],'name':_0x257d24[_0x879a('0x10')],'utcOffset':_0x257d24[_0x879a('0x86')]});});return _0x4b5da3[_0x879a('0x5')](0xc8)[_0x879a('0x6')]({'tz':_0x155a40});};exports[_0x879a('0x87')]=function(_0x377d42,_0x5a4163){var _0x3963e9=shared[_0x879a('0x84')];var _0x3301f4={};if(!_['isNil'](_0x3963e9[_0x377d42['body']['id']]))_0x3301f4=_0x3963e9[_0x377d42[_0x879a('0x42')]['id']];return _0x5a4163[_0x879a('0x5')](0xc8)['json'](_0x3301f4);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 5fac36c..6ad5a1e 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 _0x5496=['request-promise','rimraf','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x1430d1,_0x49d8f2){var _0x379e24=function(_0x2aab12){while(--_0x2aab12){_0x1430d1['push'](_0x1430d1['shift']());}};_0x379e24(++_0x49d8f2);}(_0x5496,0x175));var _0x6549=function(_0x4d87ff,_0x454826){_0x4d87ff=_0x4d87ff-0x0;var _0x2842e1=_0x5496[_0x4d87ff];return _0x2842e1;};'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'));module['exports']=function(_0x5a4658,_0x43cb17){return _0x5a4658[_0x6549('0x9')]('CmHopper',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[{'name':_0x6549('0xb'),'fields':[_0x6549('0xb')]},{'name':'phone','fields':[_0x6549('0xc')]},{'name':_0x6549('0xd'),'fields':[_0x6549('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['path','rimraf','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x12436d,_0xe01009){var _0x1b8ce1=function(_0x47cb9b){while(--_0x47cb9b){_0x12436d['push'](_0x12436d['shift']());}};_0x1b8ce1(++_0xe01009);}(_0x1261,0x144));var _0x1126=function(_0x5c27b6,_0x4a3c28){_0x5c27b6=_0x5c27b6-0x0;var _0x284ce4=_0x1261[_0x5c27b6];return _0x284ce4;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('CmHopper',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]},{'name':_0x1126('0xd'),'fields':[_0x1126('0xd')]},{'name':'priority','fields':[_0x1126('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 2f13756..a4b75aa 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 _0x2f8b=['where','attributes','limit','include','map','model','info','stringify','message','error','ShowCmHopper','raw','then','debug','CreateCmHopper','create','body','catch','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','order','UPDATE','Contact','keys','Agent','name','voicePause','length','UserId','update','includes','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','transaction','CmHopperFinal','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','CountReScheduled','CmContact','LOCK','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','User','CmList','List','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options'];(function(_0x13a8d0,_0x251f26){var _0x273f89=function(_0x499eda){while(--_0x499eda){_0x13a8d0['push'](_0x13a8d0['shift']());}};_0x273f89(++_0x251f26);}(_0x2f8b,0x96));var _0xb2f8=function(_0x188a45,_0x156762){_0x188a45=_0x188a45-0x0;var _0x4caf65=_0x2f8b[_0x188a45];return _0x4caf65;};'use strict';var _=require(_0xb2f8('0x0'));var util=require(_0xb2f8('0x1'));var moment=require('moment');var BPromise=require(_0xb2f8('0x2'));var db=require(_0xb2f8('0x3'))['db'];var logger=require(_0xb2f8('0x4'))(_0xb2f8('0x5'));exports[_0xb2f8('0x6')]=function(_0x306f3c){var _0x14d705=this;return new Promise(function(_0x4dc3ef,_0x2d4d99){return db[_0xb2f8('0x7')][_0xb2f8('0x8')]({'raw':_0x306f3c['options']?_0x306f3c[_0xb2f8('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x306f3c[_0xb2f8('0x9')]?_0x306f3c[_0xb2f8('0x9')][_0xb2f8('0xa')]||null:null,'attributes':_0x306f3c[_0xb2f8('0x9')]?_0x306f3c[_0xb2f8('0x9')][_0xb2f8('0xb')]||null:null,'limit':_0x306f3c[_0xb2f8('0x9')]?_0x306f3c['options'][_0xb2f8('0xc')]||null:null,'include':_0x306f3c[_0xb2f8('0x9')]?_0x306f3c[_0xb2f8('0x9')][_0xb2f8('0xd')]?_[_0xb2f8('0xe')](_0x306f3c[_0xb2f8('0x9')][_0xb2f8('0xd')],function(_0x39350f){return{'model':db[_0x39350f[_0xb2f8('0xf')]],'as':_0x39350f['as'],'attributes':_0x39350f[_0xb2f8('0xb')],'include':_0x39350f[_0xb2f8('0xd')]?_[_0xb2f8('0xe')](_0x39350f[_0xb2f8('0xd')],function(_0x51bdb9){return{'model':db[_0x51bdb9['model']],'as':_0x51bdb9['as'],'attributes':_0x51bdb9[_0xb2f8('0xb')],'include':_0x51bdb9[_0xb2f8('0xd')]?_['map'](_0x51bdb9[_0xb2f8('0xd')],function(_0x6d73fd){return{'model':db[_0x6d73fd[_0xb2f8('0xf')]],'as':_0x6d73fd['as'],'attributes':_0x6d73fd[_0xb2f8('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4aabd4){logger[_0xb2f8('0x10')](_0xb2f8('0x6'),_0x306f3c);logger['debug'](_0xb2f8('0x6'),_0x306f3c,JSON[_0xb2f8('0x11')](_0x4aabd4));_0x4dc3ef(_0x4aabd4);})['catch'](function(_0x345a20){logger['error'](_0xb2f8('0x6'),_0x345a20[_0xb2f8('0x12')],_0x306f3c);_0x2d4d99(_0x14d705[_0xb2f8('0x13')](0x1f4,_0x345a20[_0xb2f8('0x12')]));});});};exports[_0xb2f8('0x14')]=function(_0xab891f){var _0x2da267=this;return new Promise(function(_0x9e53ef,_0x3f1efa){return db[_0xb2f8('0x7')]['find']({'raw':_0xab891f[_0xb2f8('0x9')]?_0xab891f['options'][_0xb2f8('0x15')]===undefined?!![]:![]:!![],'where':_0xab891f[_0xb2f8('0x9')]?_0xab891f[_0xb2f8('0x9')][_0xb2f8('0xa')]||null:null,'attributes':_0xab891f['options']?_0xab891f[_0xb2f8('0x9')][_0xb2f8('0xb')]||null:null,'include':_0xab891f[_0xb2f8('0x9')]?_0xab891f['options'][_0xb2f8('0xd')]?_['map'](_0xab891f['options'][_0xb2f8('0xd')],function(_0x2d01fe){return{'model':db[_0x2d01fe['model']],'as':_0x2d01fe['as'],'attributes':_0x2d01fe[_0xb2f8('0xb')],'include':_0x2d01fe[_0xb2f8('0xd')]?_[_0xb2f8('0xe')](_0x2d01fe[_0xb2f8('0xd')],function(_0x451d71){return{'model':db[_0x451d71[_0xb2f8('0xf')]],'as':_0x451d71['as'],'attributes':_0x451d71['attributes'],'include':_0x451d71[_0xb2f8('0xd')]?_[_0xb2f8('0xe')](_0x451d71[_0xb2f8('0xd')],function(_0x2352dc){return{'model':db[_0x2352dc[_0xb2f8('0xf')]],'as':_0x2352dc['as'],'attributes':_0x2352dc['attributes']};}):[]};}):[]};}):[]:[]})[_0xb2f8('0x16')](function(_0x190115){logger['info'](_0xb2f8('0x14'),_0xab891f);logger[_0xb2f8('0x17')](_0xb2f8('0x14'),_0xab891f,JSON[_0xb2f8('0x11')](_0x190115));_0x9e53ef(_0x190115);})['catch'](function(_0x2695e7){logger[_0xb2f8('0x13')](_0xb2f8('0x14'),_0x2695e7['message'],_0xab891f);_0x3f1efa(_0x2da267[_0xb2f8('0x13')](0x1f4,_0x2695e7['message']));});});};exports[_0xb2f8('0x18')]=function(_0x2e1bea){var _0x26316e=this;return new Promise(function(_0x37f31b,_0x3e63e9){return db[_0xb2f8('0x7')][_0xb2f8('0x19')](_0x2e1bea[_0xb2f8('0x1a')],{'raw':_0x2e1bea[_0xb2f8('0x9')]?_0x2e1bea[_0xb2f8('0x9')]['raw']===undefined?!![]:![]:!![]})[_0xb2f8('0x16')](function(_0x28f7ca){logger[_0xb2f8('0x10')](_0xb2f8('0x18'),_0x2e1bea);logger['debug'](_0xb2f8('0x18'),_0x2e1bea,JSON[_0xb2f8('0x11')](_0x28f7ca));_0x37f31b(_0x28f7ca);})[_0xb2f8('0x1b')](function(_0x20fbfe){logger[_0xb2f8('0x13')]('CreateCmHopper',_0x20fbfe[_0xb2f8('0x12')],_0x2e1bea);_0x3e63e9(_0x26316e['error'](0x1f4,_0x20fbfe['message']));});});};exports[_0xb2f8('0x1c')]=function(_0x43867d){var _0x30aa2b=this;return new Promise(function(_0x1d769b,_0x185d3c){return db[_0xb2f8('0x7')]['update'](_0x43867d[_0xb2f8('0x1a')],{'raw':_0x43867d[_0xb2f8('0x9')]?_0x43867d[_0xb2f8('0x9')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43867d['options']?_0x43867d['options'][_0xb2f8('0xa')]||null:null,'attributes':_0x43867d[_0xb2f8('0x9')]?_0x43867d[_0xb2f8('0x9')]['attributes']||null:null,'limit':_0x43867d[_0xb2f8('0x9')]?_0x43867d[_0xb2f8('0x9')][_0xb2f8('0xc')]||null:null})[_0xb2f8('0x16')](function(_0x340b3e){logger[_0xb2f8('0x10')](_0xb2f8('0x1c'),_0x43867d);logger['info'](_0xb2f8('0x1d'),JSON[_0xb2f8('0x11')](_0x43867d['options'][_0xb2f8('0xa')]),_0x43867d[_0xb2f8('0x1a')][_0xb2f8('0x1e')]);logger[_0xb2f8('0x17')](_0xb2f8('0x1c'),_0x43867d,JSON[_0xb2f8('0x11')](_0x340b3e));_0x1d769b(_0x340b3e);})[_0xb2f8('0x1b')](function(_0x23d928){logger[_0xb2f8('0x13')](_0xb2f8('0x1c'),_0x23d928['message'],_0x43867d);_0x185d3c(_0x30aa2b[_0xb2f8('0x13')](0x1f4,_0x23d928[_0xb2f8('0x12')]));});});};exports[_0xb2f8('0x1f')]=function(_0x3504d8){var _0x1e946f=this;return new Promise(function(_0x2dbc5d,_0x51a568){return db[_0xb2f8('0x7')][_0xb2f8('0x20')]({'where':_0x3504d8['options']?_0x3504d8[_0xb2f8('0x9')][_0xb2f8('0xa')]||null:null})[_0xb2f8('0x16')](function(_0x4e2f93){logger[_0xb2f8('0x10')](_0xb2f8('0x1f'),_0x3504d8);logger['debug']('DestroyCmHopper',_0x3504d8,JSON[_0xb2f8('0x11')](_0x4e2f93));_0x2dbc5d(_0x4e2f93);})[_0xb2f8('0x1b')](function(_0x575636){logger[_0xb2f8('0x13')]('DestroyCmHopper',_0x575636[_0xb2f8('0x12')],_0x3504d8);_0x51a568(_0x1e946f[_0xb2f8('0x13')](0x1f4,_0x575636[_0xb2f8('0x12')]));});});};exports[_0xb2f8('0x21')]=function(_0x34562d){var _0x4c528e=this;return new Promise(function(_0x18d4b9,_0x2b0e11){return db['CmContact'][_0xb2f8('0x22')]()[_0xb2f8('0x16')](function(_0x3e7866){return db[_0xb2f8('0x23')]['transaction'](function(_0x17cf38){return db['CmHopper'][_0xb2f8('0x8')]({'where':_0x34562d['options']?_0x34562d[_0xb2f8('0x9')][_0xb2f8('0xa')]||null:null,'attributes':_0x34562d[_0xb2f8('0x9')]?_0x34562d[_0xb2f8('0x9')][_0xb2f8('0xb')]||null:null,'limit':_0x34562d[_0xb2f8('0x9')]?_0x34562d['options'][_0xb2f8('0xc')]||null:null,'order':_0x34562d[_0xb2f8('0x9')]?_0x34562d[_0xb2f8('0x9')][_0xb2f8('0x24')]||null:null,'transaction':_0x17cf38,'lock':_0x17cf38['LOCK'][_0xb2f8('0x25')],'include':[{'model':db['CmContact'],'as':_0xb2f8('0x26'),'attributes':_[_0xb2f8('0x27')](_0x3e7866)},{'model':db['User'],'as':_0xb2f8('0x28'),'attributes':['id',_0xb2f8('0x29'),_0xb2f8('0x2a')]}]})[_0xb2f8('0x16')](function(_0x182d18){var _0x57280b=[];var _0x1fc9f3=[];for(var _0x284ded=0x0;_0x284ded<_0x182d18[_0xb2f8('0x2b')];_0x284ded+=0x1){var _0x4980ac=_0x182d18[_0x284ded][_0xb2f8('0x2c')];if(_0x4980ac===null){_0x57280b['push'](_0x182d18[_0x284ded][_0xb2f8('0x2d')](_0x34562d[_0xb2f8('0x1a')],{'transaction':_0x17cf38}));}else if(!_0x1fc9f3[_0xb2f8('0x2e')](_0x4980ac)){_0x1fc9f3[_0xb2f8('0x2f')](_0x4980ac);_0x57280b['push'](_0x182d18[_0x284ded][_0xb2f8('0x2d')](_0x34562d[_0xb2f8('0x1a')],{'transaction':_0x17cf38}));}}return BPromise[_0xb2f8('0x30')](_0x57280b);});})[_0xb2f8('0x16')](function(_0x5aea03){logger['info'](_0xb2f8('0x21'),_0x34562d);if(_0x5aea03[_0xb2f8('0x2b')]>0x0){logger['info'](_0xb2f8('0x31'),_0x5aea03[0x0]['dataValues']['id'],_0x5aea03[0x0][_0xb2f8('0x32')][_0xb2f8('0x33')],_0x5aea03[0x0][_0xb2f8('0x32')][_0xb2f8('0x1e')]);}logger[_0xb2f8('0x17')](_0xb2f8('0x21'),_0x34562d,JSON['stringify'](_0x5aea03));_0x18d4b9(_0x5aea03);})[_0xb2f8('0x1b')](function(_0x17d9e9){logger[_0xb2f8('0x13')](_0xb2f8('0x21'),_0x17d9e9['message'],_0x34562d);_0x2b0e11(_0x4c528e[_0xb2f8('0x13')](0x1f4,_0x17d9e9['message']));});});});};exports[_0xb2f8('0x34')]=function(_0x109431){var _0x24ea0d=this;return new Promise(function(_0x20f0c3,_0x405c17){return db[_0xb2f8('0x23')][_0xb2f8('0x35')](function(_0x1d2d51){return db[_0xb2f8('0x36')][_0xb2f8('0x19')](_0x109431['body'],{'raw':_0x109431['options']?_0x109431[_0xb2f8('0x9')][_0xb2f8('0x15')]===undefined?!![]:![]:!![],'transaction':_0x1d2d51})['then'](function(){logger['info']('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xb2f8('0x11')](_0x109431['options'][_0xb2f8('0xa')]),_0x109431[_0xb2f8('0x9')][_0xb2f8('0xa')]['active']);return db[_0xb2f8('0x7')]['destroy']({'where':_0x109431['options']?_0x109431['options'][_0xb2f8('0xa')]||null:null,'transaction':_0x1d2d51});});})[_0xb2f8('0x16')](function(_0x24002a){logger[_0xb2f8('0x10')](_0xb2f8('0x34'),_0x109431);logger['debug'](_0xb2f8('0x34'),_0x109431,JSON[_0xb2f8('0x11')](_0x24002a));_0x20f0c3(_0x24002a);})[_0xb2f8('0x1b')](function(_0xd820df){logger['error'](_0xb2f8('0x34'),_0xd820df['message'],_0x109431);_0x405c17(_0x24ea0d[_0xb2f8('0x13')](0x1f4,_0xd820df[_0xb2f8('0x12')]));});});};exports['CountReScheduled']=function(_0x502d65){var _0x14f8bc=this;return new Promise(function(_0x12fb93,_0x24e90b){return db[_0xb2f8('0x7')][_0xb2f8('0x8')]({'raw':_0x502d65[_0xb2f8('0x9')]?_0x502d65[_0xb2f8('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x502d65['options']?_0x502d65[_0xb2f8('0x9')]['where']||null:null,'attributes':[[db[_0xb2f8('0x23')]['fn'](_0xb2f8('0x37'),db[_0xb2f8('0x23')]['fn']('IF',db[_0xb2f8('0x23')][_0xb2f8('0x38')](_0xb2f8('0x39')+util['format']('\x22%s\x22',moment()[_0xb2f8('0x3a')](_0xb2f8('0x3b')))+_0xb2f8('0x3c')))),'contactsRescheduled']]})[_0xb2f8('0x16')](function(_0x51bcda){logger[_0xb2f8('0x10')](_0xb2f8('0x3d'),_0x502d65);logger[_0xb2f8('0x17')](_0xb2f8('0x3d'),_0x502d65,JSON['stringify'](_0x51bcda));_0x12fb93(_0x51bcda);})['catch'](function(_0x221be9){logger[_0xb2f8('0x13')](_0xb2f8('0x3d'),_0x221be9[_0xb2f8('0x12')],_0x502d65);_0x24e90b(_0x14f8bc[_0xb2f8('0x13')](0x1f4,_0x221be9[_0xb2f8('0x12')]));});});};exports['GetContactRecallMe']=function(_0x1e6c4b){var _0x565f89=this;return new Promise(function(_0x313243,_0x300eca){return db[_0xb2f8('0x3e')][_0xb2f8('0x22')]()['then'](function(){return db[_0xb2f8('0x23')]['transaction'](function(_0x593eb8){return db['CmHopper']['findAll']({'where':_0x1e6c4b[_0xb2f8('0x9')]?_0x1e6c4b[_0xb2f8('0x9')][_0xb2f8('0xa')]||null:null,'attributes':_0x1e6c4b[_0xb2f8('0x9')]?_0x1e6c4b[_0xb2f8('0x9')]['attributes']||null:null,'limit':0x1,'order':_0x1e6c4b[_0xb2f8('0x9')]?_0x1e6c4b[_0xb2f8('0x9')]['order']||null:null,'group':db[_0xb2f8('0x7')][_0xb2f8('0x2c')],'transaction':_0x593eb8,'lock':_0x593eb8[_0xb2f8('0x3f')][_0xb2f8('0x25')],'include':_0x1e6c4b[_0xb2f8('0x9')]?_0x1e6c4b[_0xb2f8('0x9')][_0xb2f8('0xd')]?_[_0xb2f8('0xe')](_0x1e6c4b[_0xb2f8('0x9')][_0xb2f8('0xd')],function(_0xa13e08){return{'model':db[_0xa13e08[_0xb2f8('0xf')]],'as':_0xa13e08['as'],'attributes':_0xa13e08[_0xb2f8('0xb')],'include':_0xa13e08['include']?_[_0xb2f8('0xe')](_0xa13e08[_0xb2f8('0xd')],function(_0x3cd727){return{'model':db[_0x3cd727[_0xb2f8('0xf')]],'as':_0x3cd727['as'],'attributes':_0x3cd727[_0xb2f8('0xb')],'include':_0x3cd727[_0xb2f8('0xd')]?_[_0xb2f8('0xe')](_0x3cd727['include'],function(_0x451695){return{'model':db[_0x451695[_0xb2f8('0xf')]],'as':_0x451695['as'],'attributes':_0x451695[_0xb2f8('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b8317){var _0x505112=[];for(var _0x4bf1b0=0x0;_0x4bf1b0<_0x2b8317[_0xb2f8('0x2b')];_0x4bf1b0+=0x1){_0x505112[_0xb2f8('0x2f')](_0x2b8317[_0x4bf1b0][_0xb2f8('0x2d')](_0x1e6c4b[_0xb2f8('0x1a')],{'transaction':_0x593eb8}));}return BPromise[_0xb2f8('0x30')](_0x505112);});})[_0xb2f8('0x16')](function(_0x125262){logger[_0xb2f8('0x10')](_0xb2f8('0x40'),_0x1e6c4b);logger[_0xb2f8('0x17')](_0xb2f8('0x40'),_0x1e6c4b,JSON[_0xb2f8('0x11')](_0x125262));_0x313243(_0x125262);})['catch'](function(_0xaecc38){logger[_0xb2f8('0x13')](_0xb2f8('0x40'),_0xaecc38[_0xb2f8('0x12')],_0x1e6c4b);_0x300eca(_0x565f89['error'](0x1f4,_0xaecc38['message']));});});});};exports[_0xb2f8('0x41')]=function(_0xe1fc99){var _0x5bbb7b=this;return new Promise(function(_0x3616d8,_0x270a83){db['CmContact'][_0xb2f8('0x22')]()[_0xb2f8('0x16')](function(_0x31bed1){return db['CmHopper'][_0xb2f8('0x8')]({'raw':_0xe1fc99['options']?_0xe1fc99[_0xb2f8('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0xe1fc99[_0xb2f8('0x9')]?_0xe1fc99[_0xb2f8('0x9')]['where']||null:null,'attributes':_0xe1fc99['options']?_0xe1fc99[_0xb2f8('0x9')]['attributes']||null:null,'limit':_0xe1fc99[_0xb2f8('0x9')]?_0xe1fc99[_0xb2f8('0x9')]['limit']||null:null,'include':_0xe1fc99['options']?_0xe1fc99['options'][_0xb2f8('0xd')]?_[_0xb2f8('0xe')](_0xe1fc99['options']['include'],function(_0x45cbeb){return{'model':db[_0x45cbeb[_0xb2f8('0xf')]],'as':_0x45cbeb['as'],'attributes':_0x45cbeb['as']===_0xb2f8('0x26')?_[_0xb2f8('0x27')](_0x31bed1):_0x45cbeb[_0xb2f8('0xb')],'include':_0x45cbeb['include']?_[_0xb2f8('0xe')](_0x45cbeb[_0xb2f8('0xd')],function(_0x170f46){return{'model':db[_0x170f46[_0xb2f8('0xf')]],'as':_0x170f46['as'],'attributes':_0x170f46['attributes'],'include':_0x170f46['include']?_[_0xb2f8('0xe')](_0x170f46[_0xb2f8('0xd')],function(_0x4bd190){return{'model':db[_0x4bd190[_0xb2f8('0xf')]],'as':_0x4bd190['as'],'attributes':_0x4bd190[_0xb2f8('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1afd7f){logger[_0xb2f8('0x10')](_0xb2f8('0x6'),_0xe1fc99);logger[_0xb2f8('0x17')](_0xb2f8('0x6'),_0xe1fc99,JSON[_0xb2f8('0x11')](_0x1afd7f));_0x3616d8(_0x1afd7f);})['catch'](function(_0x4b879b){logger[_0xb2f8('0x13')](_0xb2f8('0x6'),_0x4b879b[_0xb2f8('0x12')],_0xe1fc99);_0x270a83(_0x5bbb7b['error'](0x1f4,_0x4b879b[_0xb2f8('0x12')]));});});});};exports[_0xb2f8('0x42')]=function(_0x124aa8){var _0x3ff150=this;return new Promise(function(_0x4d1f4e,_0x5d04b7){return db[_0xb2f8('0x3e')]['findOne']({'raw':!![],'where':{'phone':_0x124aa8['options'][_0xb2f8('0xa')]['phone']},'attributes':['id',_0xb2f8('0x43')],'order':[['id','DESC']]})[_0xb2f8('0x16')](function(_0x268d59){logger[_0xb2f8('0x10')](_0xb2f8('0x44'),_0x124aa8);logger[_0xb2f8('0x17')](_0xb2f8('0x44'),_0x124aa8,JSON[_0xb2f8('0x11')](_0x268d59));_0x4d1f4e(_0x268d59);})[_0xb2f8('0x1b')](function(_0xb148f4){logger[_0xb2f8('0x13')](_0xb2f8('0x44'),_0xb148f4[_0xb2f8('0x12')],_0x124aa8);_0x5d04b7(_0x3ff150[_0xb2f8('0x13')](0x1f4,_0xb148f4[_0xb2f8('0x12')]));});});};exports[_0xb2f8('0x45')]=function(_0x443b88){var _0x3d4f2e=this;return new Promise(function(_0x14da36,_0x1457ea){return db[_0xb2f8('0x23')]['transaction'](function(_0x3320d5){var _0x168f72=_0x443b88[_0xb2f8('0x9')]&&_0x443b88[_0xb2f8('0x9')][_0xb2f8('0xa')]?_0x443b88[_0xb2f8('0x9')][_0xb2f8('0xa')]:{};return db[_0xb2f8('0x7')]['update'](_0x443b88[_0xb2f8('0x1a')],{'where':_0x168f72,'transaction':_0x3320d5})[_0xb2f8('0x16')](function(_0x2f2ff2){logger[_0xb2f8('0x10')](_0xb2f8('0x45'),_0x443b88);logger[_0xb2f8('0x17')](_0xb2f8('0x45'),_0x443b88,JSON['stringify'](_0x2f2ff2));_0x14da36(_0x2f2ff2);})[_0xb2f8('0x1b')](function(_0x412dcd){logger[_0xb2f8('0x13')]('ResetActiveCalls',_0x412dcd[_0xb2f8('0x12')],_0x443b88);_0x1457ea(_0x3d4f2e['error'](0x1f4,_0x412dcd[_0xb2f8('0x12')]));});});});};exports[_0xb2f8('0x46')]=function(_0x5abd68){var _0x1599df=this;var _0x26033d=_0x5abd68[_0xb2f8('0x1a')][_0xb2f8('0xa')][_0xb2f8('0x47')];var _0x410abc=_0x5abd68[_0xb2f8('0x1a')][_0xb2f8('0xa')][_0xb2f8('0x48')];var _0x3481c6=_0x5abd68[_0xb2f8('0x1a')][_0xb2f8('0xa')][_0xb2f8('0x49')];return new Promise(function(_0x5e65ad,_0x21fb3b){return db[_0xb2f8('0x7')][_0xb2f8('0x8')]({'where':{'voiceQueueId':{'$in':_0x26033d},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xb2f8('0x23')][_0xb2f8('0x38')](_0xb2f8('0x4a')+_0x410abc+_0xb2f8('0x4b')),'$gt':db[_0xb2f8('0x23')][_0xb2f8('0x38')](_0xb2f8('0x4c'))}},'UserId':{'$in':_0x3481c6}},'include':[{'model':db[_0xb2f8('0x3e')],'as':_0xb2f8('0x26')},{'model':db[_0xb2f8('0x4d')],'as':_0xb2f8('0x28'),'attributes':['id','name','voicePause']},{'model':db[_0xb2f8('0x4e')],'as':_0xb2f8('0x4f')}]})[_0xb2f8('0x16')](function(_0x302c4b){if(_0x302c4b[_0xb2f8('0x2b')]>0x0){return db[_0xb2f8('0x23')]['transaction'](function(_0x5185f0){return db[_0xb2f8('0x7')][_0xb2f8('0x2d')]({'recallmeNotifiedDate':db['sequelize'][_0xb2f8('0x38')]('NOW()')},{'where':{'id':{'$in':_[_0xb2f8('0xe')](_0x302c4b,'id')}},'transaction':_0x5185f0})[_0xb2f8('0x16')](function(){_0x5e65ad(_0x302c4b);})[_0xb2f8('0x1b')](function(_0x346e26){logger[_0xb2f8('0x13')](_0xb2f8('0x46'),_0x346e26[_0xb2f8('0x12')],_0x5abd68);_0x21fb3b(_0x1599df[_0xb2f8('0x13')](0x1f4,_0x346e26[_0xb2f8('0x12')]));});})[_0xb2f8('0x1b')](function(_0x37dab2){logger['error'](_0xb2f8('0x46'),_0x37dab2[_0xb2f8('0x12')],_0x5abd68);_0x21fb3b(_0x1599df[_0xb2f8('0x13')](0x1f4,_0x37dab2[_0xb2f8('0x12')]));});}else{_0x5e65ad(_0x302c4b);}});});}; \ No newline at end of file +var _0xd709=['Contact','keys','Agent','name','length','push','includes','all','GetContactDialer','dataValues','ContactId','active','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','LOCK','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','availableAgentsIds','\x20MINUTE','NOW()','User','voicePause','CmList','List','CmHopperHandlePreviewRecallNotifications','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','findAll','options','raw','where','attributes','limit','include','model','map','then','info','debug','stringify','error','message','ShowCmHopper','CmHopper','find','catch','body','CreateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','DestroyCmHopper','CmContact','describe','sequelize','transaction','order','UPDATE'];(function(_0x29e154,_0x497fb3){var _0x22fa5a=function(_0x12faf9){while(--_0x12faf9){_0x29e154['push'](_0x29e154['shift']());}};_0x22fa5a(++_0x497fb3);}(_0xd709,0x1b0));var _0x9d70=function(_0x372ad3,_0x2e2974){_0x372ad3=_0x372ad3-0x0;var _0x58193c=_0xd709[_0x372ad3];return _0x58193c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9d70('0x0'));var db=require(_0x9d70('0x1'))['db'];var logger=require(_0x9d70('0x2'))(_0x9d70('0x3'));exports[_0x9d70('0x4')]=function(_0x3c0164){var _0x49846f=this;return new Promise(function(_0x58b93b,_0x43cb6f){return db['CmHopper'][_0x9d70('0x5')]({'raw':_0x3c0164[_0x9d70('0x6')]?_0x3c0164[_0x9d70('0x6')][_0x9d70('0x7')]===undefined?!![]:![]:!![],'where':_0x3c0164[_0x9d70('0x6')]?_0x3c0164[_0x9d70('0x6')][_0x9d70('0x8')]||null:null,'attributes':_0x3c0164[_0x9d70('0x6')]?_0x3c0164['options'][_0x9d70('0x9')]||null:null,'limit':_0x3c0164['options']?_0x3c0164[_0x9d70('0x6')][_0x9d70('0xa')]||null:null,'include':_0x3c0164['options']?_0x3c0164[_0x9d70('0x6')]['include']?_['map'](_0x3c0164[_0x9d70('0x6')][_0x9d70('0xb')],function(_0x435079){return{'model':db[_0x435079[_0x9d70('0xc')]],'as':_0x435079['as'],'attributes':_0x435079[_0x9d70('0x9')],'include':_0x435079[_0x9d70('0xb')]?_[_0x9d70('0xd')](_0x435079[_0x9d70('0xb')],function(_0x437a9e){return{'model':db[_0x437a9e[_0x9d70('0xc')]],'as':_0x437a9e['as'],'attributes':_0x437a9e[_0x9d70('0x9')],'include':_0x437a9e[_0x9d70('0xb')]?_[_0x9d70('0xd')](_0x437a9e[_0x9d70('0xb')],function(_0x1b8968){return{'model':db[_0x1b8968[_0x9d70('0xc')]],'as':_0x1b8968['as'],'attributes':_0x1b8968[_0x9d70('0x9')]};}):[]};}):[]};}):[]:[]})[_0x9d70('0xe')](function(_0x4ffb9f){logger[_0x9d70('0xf')](_0x9d70('0x4'),_0x3c0164);logger[_0x9d70('0x10')](_0x9d70('0x4'),_0x3c0164,JSON[_0x9d70('0x11')](_0x4ffb9f));_0x58b93b(_0x4ffb9f);})['catch'](function(_0x4c7fe6){logger[_0x9d70('0x12')]('GetCmHopper',_0x4c7fe6[_0x9d70('0x13')],_0x3c0164);_0x43cb6f(_0x49846f['error'](0x1f4,_0x4c7fe6['message']));});});};exports[_0x9d70('0x14')]=function(_0x42ccbd){var _0x36fb1b=this;return new Promise(function(_0x2a665d,_0x412a7f){return db[_0x9d70('0x15')][_0x9d70('0x16')]({'raw':_0x42ccbd[_0x9d70('0x6')]?_0x42ccbd[_0x9d70('0x6')][_0x9d70('0x7')]===undefined?!![]:![]:!![],'where':_0x42ccbd[_0x9d70('0x6')]?_0x42ccbd[_0x9d70('0x6')][_0x9d70('0x8')]||null:null,'attributes':_0x42ccbd[_0x9d70('0x6')]?_0x42ccbd[_0x9d70('0x6')][_0x9d70('0x9')]||null:null,'include':_0x42ccbd[_0x9d70('0x6')]?_0x42ccbd[_0x9d70('0x6')][_0x9d70('0xb')]?_['map'](_0x42ccbd[_0x9d70('0x6')][_0x9d70('0xb')],function(_0x155a30){return{'model':db[_0x155a30[_0x9d70('0xc')]],'as':_0x155a30['as'],'attributes':_0x155a30['attributes'],'include':_0x155a30['include']?_[_0x9d70('0xd')](_0x155a30[_0x9d70('0xb')],function(_0x2665fb){return{'model':db[_0x2665fb['model']],'as':_0x2665fb['as'],'attributes':_0x2665fb['attributes'],'include':_0x2665fb[_0x9d70('0xb')]?_[_0x9d70('0xd')](_0x2665fb[_0x9d70('0xb')],function(_0x313925){return{'model':db[_0x313925['model']],'as':_0x313925['as'],'attributes':_0x313925[_0x9d70('0x9')]};}):[]};}):[]};}):[]:[]})[_0x9d70('0xe')](function(_0x32fe17){logger[_0x9d70('0xf')](_0x9d70('0x14'),_0x42ccbd);logger['debug'](_0x9d70('0x14'),_0x42ccbd,JSON[_0x9d70('0x11')](_0x32fe17));_0x2a665d(_0x32fe17);})[_0x9d70('0x17')](function(_0x2b72f6){logger[_0x9d70('0x12')](_0x9d70('0x14'),_0x2b72f6['message'],_0x42ccbd);_0x412a7f(_0x36fb1b[_0x9d70('0x12')](0x1f4,_0x2b72f6[_0x9d70('0x13')]));});});};exports['CreateCmHopper']=function(_0x4d204f){var _0x9aa356=this;return new Promise(function(_0x294d6f,_0x2eead6){return db[_0x9d70('0x15')]['create'](_0x4d204f[_0x9d70('0x18')],{'raw':_0x4d204f[_0x9d70('0x6')]?_0x4d204f['options']['raw']===undefined?!![]:![]:!![]})[_0x9d70('0xe')](function(_0x4552e2){logger[_0x9d70('0xf')](_0x9d70('0x19'),_0x4d204f);logger[_0x9d70('0x10')]('CreateCmHopper',_0x4d204f,JSON[_0x9d70('0x11')](_0x4552e2));_0x294d6f(_0x4552e2);})[_0x9d70('0x17')](function(_0x462e20){logger[_0x9d70('0x12')](_0x9d70('0x19'),_0x462e20[_0x9d70('0x13')],_0x4d204f);_0x2eead6(_0x9aa356[_0x9d70('0x12')](0x1f4,_0x462e20[_0x9d70('0x13')]));});});};exports['UpdateCmHopper']=function(_0x433b4a){var _0x32941e=this;return new Promise(function(_0x32f1aa,_0x446844){return db[_0x9d70('0x15')][_0x9d70('0x1a')](_0x433b4a['body'],{'raw':_0x433b4a['options']?_0x433b4a['options'][_0x9d70('0x7')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x433b4a[_0x9d70('0x6')]?_0x433b4a[_0x9d70('0x6')][_0x9d70('0x8')]||null:null,'attributes':_0x433b4a[_0x9d70('0x6')]?_0x433b4a[_0x9d70('0x6')][_0x9d70('0x9')]||null:null,'limit':_0x433b4a[_0x9d70('0x6')]?_0x433b4a[_0x9d70('0x6')][_0x9d70('0xa')]||null:null})['then'](function(_0x13417c){logger[_0x9d70('0xf')]('UpdateCmHopper',_0x433b4a);logger[_0x9d70('0xf')](_0x9d70('0x1b'),JSON[_0x9d70('0x11')](_0x433b4a[_0x9d70('0x6')][_0x9d70('0x8')]),_0x433b4a[_0x9d70('0x18')]['active']);logger['debug']('UpdateCmHopper',_0x433b4a,JSON[_0x9d70('0x11')](_0x13417c));_0x32f1aa(_0x13417c);})['catch'](function(_0x11186d){logger[_0x9d70('0x12')]('UpdateCmHopper',_0x11186d[_0x9d70('0x13')],_0x433b4a);_0x446844(_0x32941e[_0x9d70('0x12')](0x1f4,_0x11186d[_0x9d70('0x13')]));});});};exports['DestroyCmHopper']=function(_0x3ded0a){var _0x42e8bd=this;return new Promise(function(_0x522db0,_0x36decc){return db[_0x9d70('0x15')][_0x9d70('0x1c')]({'where':_0x3ded0a[_0x9d70('0x6')]?_0x3ded0a['options'][_0x9d70('0x8')]||null:null})[_0x9d70('0xe')](function(_0x5c1ea4){logger[_0x9d70('0xf')]('DestroyCmHopper',_0x3ded0a);logger[_0x9d70('0x10')](_0x9d70('0x1d'),_0x3ded0a,JSON[_0x9d70('0x11')](_0x5c1ea4));_0x522db0(_0x5c1ea4);})['catch'](function(_0x163a47){logger[_0x9d70('0x12')]('DestroyCmHopper',_0x163a47['message'],_0x3ded0a);_0x36decc(_0x42e8bd[_0x9d70('0x12')](0x1f4,_0x163a47['message']));});});};exports['GetContactDialer']=function(_0x5cfb27){var _0x104505=this;return new Promise(function(_0x4c4fcc,_0x227e56){return db[_0x9d70('0x1e')][_0x9d70('0x1f')]()[_0x9d70('0xe')](function(_0x3af0e2){return db[_0x9d70('0x20')][_0x9d70('0x21')](function(_0x4fdd10){return db[_0x9d70('0x15')][_0x9d70('0x5')]({'where':_0x5cfb27[_0x9d70('0x6')]?_0x5cfb27[_0x9d70('0x6')][_0x9d70('0x8')]||null:null,'attributes':_0x5cfb27[_0x9d70('0x6')]?_0x5cfb27[_0x9d70('0x6')]['attributes']||null:null,'limit':_0x5cfb27['options']?_0x5cfb27[_0x9d70('0x6')]['limit']||null:null,'order':_0x5cfb27[_0x9d70('0x6')]?_0x5cfb27['options'][_0x9d70('0x22')]||null:null,'transaction':_0x4fdd10,'lock':_0x4fdd10['LOCK'][_0x9d70('0x23')],'include':[{'model':db[_0x9d70('0x1e')],'as':_0x9d70('0x24'),'attributes':_[_0x9d70('0x25')](_0x3af0e2)},{'model':db['User'],'as':_0x9d70('0x26'),'attributes':['id',_0x9d70('0x27'),'voicePause']}]})[_0x9d70('0xe')](function(_0x54f053){var _0x484778=[];var _0x69b56d=[];for(var _0x14162f=0x0;_0x14162f<_0x54f053[_0x9d70('0x28')];_0x14162f+=0x1){var _0x29780d=_0x54f053[_0x14162f]['UserId'];if(_0x29780d===null){_0x484778[_0x9d70('0x29')](_0x54f053[_0x14162f][_0x9d70('0x1a')](_0x5cfb27[_0x9d70('0x18')],{'transaction':_0x4fdd10}));}else if(!_0x69b56d[_0x9d70('0x2a')](_0x29780d)){_0x69b56d[_0x9d70('0x29')](_0x29780d);_0x484778[_0x9d70('0x29')](_0x54f053[_0x14162f][_0x9d70('0x1a')](_0x5cfb27[_0x9d70('0x18')],{'transaction':_0x4fdd10}));}}return BPromise[_0x9d70('0x2b')](_0x484778);});})['then'](function(_0x2a6411){logger[_0x9d70('0xf')](_0x9d70('0x2c'),_0x5cfb27);if(_0x2a6411[_0x9d70('0x28')]>0x0){logger[_0x9d70('0xf')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x2a6411[0x0][_0x9d70('0x2d')]['id'],_0x2a6411[0x0][_0x9d70('0x2d')][_0x9d70('0x2e')],_0x2a6411[0x0]['dataValues'][_0x9d70('0x2f')]);}logger[_0x9d70('0x10')](_0x9d70('0x2c'),_0x5cfb27,JSON['stringify'](_0x2a6411));_0x4c4fcc(_0x2a6411);})['catch'](function(_0x38cf1b){logger['error'](_0x9d70('0x2c'),_0x38cf1b[_0x9d70('0x13')],_0x5cfb27);_0x227e56(_0x104505['error'](0x1f4,_0x38cf1b[_0x9d70('0x13')]));});});});};exports[_0x9d70('0x30')]=function(_0x1748d3){var _0x2fc043=this;return new Promise(function(_0x37e0cd,_0x50112d){return db['sequelize'][_0x9d70('0x21')](function(_0x4a5871){return db[_0x9d70('0x31')]['create'](_0x1748d3[_0x9d70('0x18')],{'raw':_0x1748d3[_0x9d70('0x6')]?_0x1748d3[_0x9d70('0x6')][_0x9d70('0x7')]===undefined?!![]:![]:!![],'transaction':_0x4a5871})['then'](function(){logger[_0x9d70('0xf')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x1748d3['options'][_0x9d70('0x8')]),_0x1748d3['options']['where']['active']);return db[_0x9d70('0x15')][_0x9d70('0x1c')]({'where':_0x1748d3['options']?_0x1748d3['options'][_0x9d70('0x8')]||null:null,'transaction':_0x4a5871});});})[_0x9d70('0xe')](function(_0x29448b){logger[_0x9d70('0xf')](_0x9d70('0x30'),_0x1748d3);logger[_0x9d70('0x10')](_0x9d70('0x30'),_0x1748d3,JSON['stringify'](_0x29448b));_0x37e0cd(_0x29448b);})['catch'](function(_0x2a472b){logger[_0x9d70('0x12')]('MoveContactManagedDialer',_0x2a472b[_0x9d70('0x13')],_0x1748d3);_0x50112d(_0x2fc043[_0x9d70('0x12')](0x1f4,_0x2a472b[_0x9d70('0x13')]));});});};exports[_0x9d70('0x32')]=function(_0x55a33a){var _0x1f1edd=this;return new Promise(function(_0x2da24c,_0x3f49f0){return db['CmHopper'][_0x9d70('0x5')]({'raw':_0x55a33a[_0x9d70('0x6')]?_0x55a33a[_0x9d70('0x6')][_0x9d70('0x7')]===undefined?!![]:![]:!![],'where':_0x55a33a[_0x9d70('0x6')]?_0x55a33a[_0x9d70('0x6')][_0x9d70('0x8')]||null:null,'attributes':[[db[_0x9d70('0x20')]['fn'](_0x9d70('0x33'),db[_0x9d70('0x20')]['fn']('IF',db[_0x9d70('0x20')][_0x9d70('0x34')](_0x9d70('0x35')+util[_0x9d70('0x36')](_0x9d70('0x37'),moment()[_0x9d70('0x36')](_0x9d70('0x38')))+_0x9d70('0x39')))),_0x9d70('0x3a')]]})['then'](function(_0xc27f61){logger[_0x9d70('0xf')](_0x9d70('0x32'),_0x55a33a);logger[_0x9d70('0x10')](_0x9d70('0x32'),_0x55a33a,JSON[_0x9d70('0x11')](_0xc27f61));_0x2da24c(_0xc27f61);})[_0x9d70('0x17')](function(_0x23ebfb){logger[_0x9d70('0x12')](_0x9d70('0x32'),_0x23ebfb[_0x9d70('0x13')],_0x55a33a);_0x3f49f0(_0x1f1edd[_0x9d70('0x12')](0x1f4,_0x23ebfb['message']));});});};exports[_0x9d70('0x3b')]=function(_0x3d16db){var _0x42bf94=this;return new Promise(function(_0x3a81e8,_0x44f39e){return db['CmContact'][_0x9d70('0x1f')]()[_0x9d70('0xe')](function(){return db[_0x9d70('0x20')][_0x9d70('0x21')](function(_0x3b58ad){return db[_0x9d70('0x15')][_0x9d70('0x5')]({'where':_0x3d16db['options']?_0x3d16db[_0x9d70('0x6')][_0x9d70('0x8')]||null:null,'attributes':_0x3d16db[_0x9d70('0x6')]?_0x3d16db[_0x9d70('0x6')][_0x9d70('0x9')]||null:null,'limit':0x1,'order':_0x3d16db[_0x9d70('0x6')]?_0x3d16db[_0x9d70('0x6')][_0x9d70('0x22')]||null:null,'group':db['CmHopper'][_0x9d70('0x3c')],'transaction':_0x3b58ad,'lock':_0x3b58ad[_0x9d70('0x3d')][_0x9d70('0x23')],'include':_0x3d16db['options']?_0x3d16db['options'][_0x9d70('0xb')]?_['map'](_0x3d16db[_0x9d70('0x6')][_0x9d70('0xb')],function(_0x10bfe7){return{'model':db[_0x10bfe7[_0x9d70('0xc')]],'as':_0x10bfe7['as'],'attributes':_0x10bfe7[_0x9d70('0x9')],'include':_0x10bfe7[_0x9d70('0xb')]?_['map'](_0x10bfe7['include'],function(_0x5f344c){return{'model':db[_0x5f344c[_0x9d70('0xc')]],'as':_0x5f344c['as'],'attributes':_0x5f344c[_0x9d70('0x9')],'include':_0x5f344c[_0x9d70('0xb')]?_[_0x9d70('0xd')](_0x5f344c[_0x9d70('0xb')],function(_0x5a0584){return{'model':db[_0x5a0584[_0x9d70('0xc')]],'as':_0x5a0584['as'],'attributes':_0x5a0584[_0x9d70('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39fd63){var _0x4e2a4e=[];for(var _0x552409=0x0;_0x552409<_0x39fd63[_0x9d70('0x28')];_0x552409+=0x1){_0x4e2a4e['push'](_0x39fd63[_0x552409][_0x9d70('0x1a')](_0x3d16db[_0x9d70('0x18')],{'transaction':_0x3b58ad}));}return BPromise['all'](_0x4e2a4e);});})[_0x9d70('0xe')](function(_0x5b6af0){logger[_0x9d70('0xf')]('GetContactRecallMe',_0x3d16db);logger[_0x9d70('0x10')]('GetContactRecallMe',_0x3d16db,JSON[_0x9d70('0x11')](_0x5b6af0));_0x3a81e8(_0x5b6af0);})['catch'](function(_0x5b6058){logger[_0x9d70('0x12')](_0x9d70('0x3b'),_0x5b6058[_0x9d70('0x13')],_0x3d16db);_0x44f39e(_0x42bf94[_0x9d70('0x12')](0x1f4,_0x5b6058[_0x9d70('0x13')]));});});});};exports['GetCmHopperPreview']=function(_0x370a55){var _0x129630=this;return new Promise(function(_0xbb2c80,_0x45745b){db[_0x9d70('0x1e')][_0x9d70('0x1f')]()[_0x9d70('0xe')](function(_0x30ed06){return db[_0x9d70('0x15')][_0x9d70('0x5')]({'raw':_0x370a55['options']?_0x370a55[_0x9d70('0x6')]['raw']===undefined?!![]:![]:!![],'where':_0x370a55['options']?_0x370a55[_0x9d70('0x6')]['where']||null:null,'attributes':_0x370a55[_0x9d70('0x6')]?_0x370a55[_0x9d70('0x6')][_0x9d70('0x9')]||null:null,'limit':_0x370a55[_0x9d70('0x6')]?_0x370a55[_0x9d70('0x6')][_0x9d70('0xa')]||null:null,'include':_0x370a55[_0x9d70('0x6')]?_0x370a55['options'][_0x9d70('0xb')]?_[_0x9d70('0xd')](_0x370a55[_0x9d70('0x6')][_0x9d70('0xb')],function(_0x1f4f41){return{'model':db[_0x1f4f41['model']],'as':_0x1f4f41['as'],'attributes':_0x1f4f41['as']===_0x9d70('0x24')?_[_0x9d70('0x25')](_0x30ed06):_0x1f4f41[_0x9d70('0x9')],'include':_0x1f4f41['include']?_[_0x9d70('0xd')](_0x1f4f41[_0x9d70('0xb')],function(_0x16581a){return{'model':db[_0x16581a[_0x9d70('0xc')]],'as':_0x16581a['as'],'attributes':_0x16581a[_0x9d70('0x9')],'include':_0x16581a['include']?_[_0x9d70('0xd')](_0x16581a[_0x9d70('0xb')],function(_0x5808a5){return{'model':db[_0x5808a5[_0x9d70('0xc')]],'as':_0x5808a5['as'],'attributes':_0x5808a5[_0x9d70('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f8e84){logger['info'](_0x9d70('0x4'),_0x370a55);logger[_0x9d70('0x10')](_0x9d70('0x4'),_0x370a55,JSON[_0x9d70('0x11')](_0x4f8e84));_0xbb2c80(_0x4f8e84);})[_0x9d70('0x17')](function(_0x26fa15){logger[_0x9d70('0x12')](_0x9d70('0x4'),_0x26fa15[_0x9d70('0x13')],_0x370a55);_0x45745b(_0x129630['error'](0x1f4,_0x26fa15[_0x9d70('0x13')]));});});});};exports[_0x9d70('0x3e')]=function(_0x1c3ac1){var _0x47c7f9=this;return new Promise(function(_0x227365,_0x316ab9){return db[_0x9d70('0x1e')][_0x9d70('0x3f')]({'raw':!![],'where':{'phone':_0x1c3ac1['options'][_0x9d70('0x8')][_0x9d70('0x40')]},'attributes':['id',_0x9d70('0x41')],'order':[['id',_0x9d70('0x42')]]})['then'](function(_0x382a0e){logger[_0x9d70('0xf')](_0x9d70('0x43'),_0x1c3ac1);logger['debug'](_0x9d70('0x43'),_0x1c3ac1,JSON[_0x9d70('0x11')](_0x382a0e));_0x227365(_0x382a0e);})[_0x9d70('0x17')](function(_0x32477d){logger[_0x9d70('0x12')](_0x9d70('0x43'),_0x32477d[_0x9d70('0x13')],_0x1c3ac1);_0x316ab9(_0x47c7f9[_0x9d70('0x12')](0x1f4,_0x32477d[_0x9d70('0x13')]));});});};exports[_0x9d70('0x44')]=function(_0x21628){var _0xdb1b15=this;return new Promise(function(_0x373d24,_0x57e275){return db[_0x9d70('0x20')][_0x9d70('0x21')](function(_0x48c645){var _0x3e2c2e=_0x21628[_0x9d70('0x6')]&&_0x21628[_0x9d70('0x6')][_0x9d70('0x8')]?_0x21628[_0x9d70('0x6')][_0x9d70('0x8')]:{};return db[_0x9d70('0x15')][_0x9d70('0x1a')](_0x21628[_0x9d70('0x18')],{'where':_0x3e2c2e,'transaction':_0x48c645})[_0x9d70('0xe')](function(_0x1b5d5b){logger[_0x9d70('0xf')]('ResetActiveCalls',_0x21628);logger[_0x9d70('0x10')](_0x9d70('0x44'),_0x21628,JSON[_0x9d70('0x11')](_0x1b5d5b));_0x373d24(_0x1b5d5b);})[_0x9d70('0x17')](function(_0x26925e){logger[_0x9d70('0x12')](_0x9d70('0x44'),_0x26925e[_0x9d70('0x13')],_0x21628);_0x57e275(_0xdb1b15[_0x9d70('0x12')](0x1f4,_0x26925e[_0x9d70('0x13')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x411428){var _0x1d78ac=this;var _0x189490=_0x411428[_0x9d70('0x18')][_0x9d70('0x8')][_0x9d70('0x45')];var _0x35f78f=_0x411428['body'][_0x9d70('0x8')]['interval'];var _0x24bd74=_0x411428[_0x9d70('0x18')][_0x9d70('0x8')][_0x9d70('0x46')];return new Promise(function(_0x315cfb,_0x136ebc){return db['CmHopper'][_0x9d70('0x5')]({'where':{'voiceQueueId':{'$in':_0x189490},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x9d70('0x20')][_0x9d70('0x34')]('NOW()\x20+\x20INTERVAL\x20'+_0x35f78f+_0x9d70('0x47')),'$gt':db['sequelize'][_0x9d70('0x34')](_0x9d70('0x48'))}},'UserId':{'$in':_0x24bd74}},'include':[{'model':db['CmContact'],'as':_0x9d70('0x24')},{'model':db[_0x9d70('0x49')],'as':'Agent','attributes':['id',_0x9d70('0x27'),_0x9d70('0x4a')]},{'model':db[_0x9d70('0x4b')],'as':_0x9d70('0x4c')}]})['then'](function(_0x1a3f76){if(_0x1a3f76[_0x9d70('0x28')]>0x0){return db['sequelize'][_0x9d70('0x21')](function(_0x4f57e8){return db['CmHopper'][_0x9d70('0x1a')]({'recallmeNotifiedDate':db[_0x9d70('0x20')][_0x9d70('0x34')](_0x9d70('0x48'))},{'where':{'id':{'$in':_['map'](_0x1a3f76,'id')}},'transaction':_0x4f57e8})[_0x9d70('0xe')](function(){_0x315cfb(_0x1a3f76);})[_0x9d70('0x17')](function(_0x275b0c){logger[_0x9d70('0x12')]('CmHopperHandlePreviewRecallNotifications',_0x275b0c[_0x9d70('0x13')],_0x411428);_0x136ebc(_0x1d78ac[_0x9d70('0x12')](0x1f4,_0x275b0c[_0x9d70('0x13')]));});})[_0x9d70('0x17')](function(_0x2d3677){logger[_0x9d70('0x12')](_0x9d70('0x4d'),_0x2d3677[_0x9d70('0x13')],_0x411428);_0x136ebc(_0x1d78ac[_0x9d70('0x12')](0x1f4,_0x2d3677['message']));});}else{_0x315cfb(_0x1a3f76);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 77f1dd0..2a26be2 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 _0x9bb4=['index','/describe','describe','/opencontacts','/timezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','getPreview','/timezone','getTimezone','put','delete','destroy','exports','express','Router','../../components/auth/service','get','isAuthenticated'];(function(_0x599798,_0x2cbe80){var _0x592116=function(_0x572d13){while(--_0x572d13){_0x599798['push'](_0x599798['shift']());}};_0x592116(++_0x2cbe80);}(_0x9bb4,0x13d));var _0x49bb=function(_0x11d980,_0x1674f2){_0x11d980=_0x11d980-0x0;var _0x259bee=_0x9bb4[_0x11d980];return _0x259bee;};'use strict';var express=require(_0x49bb('0x0'));var router=express[_0x49bb('0x1')]();var auth=require(_0x49bb('0x2'));var controller=require('./cmHopper.controller');router[_0x49bb('0x3')]('/',auth[_0x49bb('0x4')](),controller[_0x49bb('0x5')]);router['get'](_0x49bb('0x6'),auth[_0x49bb('0x4')](),controller[_0x49bb('0x7')]);router[_0x49bb('0x3')](_0x49bb('0x8'),auth[_0x49bb('0x4')](),controller['getOpenContacts']);router['get'](_0x49bb('0x9'),auth[_0x49bb('0x4')](),controller['getTimezones']);router[_0x49bb('0x3')](_0x49bb('0xa'),auth[_0x49bb('0x4')](),controller[_0x49bb('0xb')]);router['get'](_0x49bb('0xc'),auth[_0x49bb('0x4')](),controller[_0x49bb('0xd')]);router[_0x49bb('0xe')]('/',auth[_0x49bb('0x4')](),controller[_0x49bb('0xf')]);router[_0x49bb('0xe')]('/preview',auth['isAuthenticated'](),controller[_0x49bb('0x10')]);router[_0x49bb('0xe')](_0x49bb('0x11'),auth[_0x49bb('0x4')](),controller[_0x49bb('0x12')]);router[_0x49bb('0x13')](_0x49bb('0xa'),auth[_0x49bb('0x4')](),controller['update']);router[_0x49bb('0x14')](_0x49bb('0xa'),auth['isAuthenticated'](),controller[_0x49bb('0x15')]);module[_0x49bb('0x16')]=router; \ No newline at end of file +var _0xa208=['create','/preview','getPreview','put','update','delete','destroy','exports','express','Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','getTimezones','/:id','/:id/previewrecall','getPreviewRecall','post'];(function(_0x2a2783,_0x493053){var _0x287a57=function(_0x19de32){while(--_0x19de32){_0x2a2783['push'](_0x2a2783['shift']());}};_0x287a57(++_0x493053);}(_0xa208,0x18f));var _0x8a20=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa208[_0x34bc30];return _0x5706de;};'use strict';var express=require(_0x8a20('0x0'));var router=express[_0x8a20('0x1')]();var auth=require(_0x8a20('0x2'));var controller=require('./cmHopper.controller');router[_0x8a20('0x3')]('/',auth[_0x8a20('0x4')](),controller[_0x8a20('0x5')]);router['get'](_0x8a20('0x6'),auth[_0x8a20('0x4')](),controller[_0x8a20('0x7')]);router[_0x8a20('0x3')](_0x8a20('0x8'),auth[_0x8a20('0x4')](),controller[_0x8a20('0x9')]);router[_0x8a20('0x3')]('/timezones',auth[_0x8a20('0x4')](),controller[_0x8a20('0xa')]);router['get'](_0x8a20('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x8a20('0x3')](_0x8a20('0xc'),auth[_0x8a20('0x4')](),controller[_0x8a20('0xd')]);router[_0x8a20('0xe')]('/',auth[_0x8a20('0x4')](),controller[_0x8a20('0xf')]);router[_0x8a20('0xe')](_0x8a20('0x10'),auth[_0x8a20('0x4')](),controller[_0x8a20('0x11')]);router[_0x8a20('0xe')]('/timezone',auth[_0x8a20('0x4')](),controller['getTimezone']);router[_0x8a20('0x12')](_0x8a20('0xb'),auth['isAuthenticated'](),controller[_0x8a20('0x13')]);router[_0x8a20('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x8a20('0x15')]);module[_0x8a20('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 1697ab0..440df9c 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 _0xf76c=['moment','exports','STRING','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x1db7ba,_0x298d04){var _0x381603=function(_0x593451){while(--_0x593451){_0x1db7ba['push'](_0x1db7ba['shift']());}};_0x381603(++_0x298d04);}(_0xf76c,0xea));var _0xcf76=function(_0x1222b3,_0x3bbd73){_0x1222b3=_0x1222b3-0x0;var _0x51a4f0=_0xf76c[_0x1222b3];return _0x51a4f0;};'use strict';var moment=require(_0xcf76('0x0'));var Sequelize=require('sequelize');module[_0xcf76('0x1')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0xcf76('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xcf76('0x3')](_0xcf76('0x4'))},'countbusyretry':{'type':Sequelize[_0xcf76('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xcf76('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xcf76('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xcf76('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1712=['moment','sequelize','INTEGER','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3571af,_0x4f577b){var _0x5641e2=function(_0x200cff){while(--_0x200cff){_0x3571af['push'](_0x3571af['shift']());}};_0x5641e2(++_0x4f577b);}(_0x1712,0xc4));var _0x2171=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x1712[_0x35885a];return _0xe86249;};'use strict';var moment=require(_0x2171('0x0'));var Sequelize=require(_0x2171('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0x2171('0x2')]},'phone':{'type':Sequelize[_0x2171('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x2171('0x4')],'defaultValue':moment()[_0x2171('0x5')](_0x2171('0x6'))},'countbusyretry':{'type':Sequelize[_0x2171('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2171('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x2171('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2171('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2171('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2171('0x2')],'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 4599b98..86eadae 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 _0x3ec8=['../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','reject','then','destroy','get','CmHopperAdditionalPhones','error','name','CmHopperAdditionalPhone','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','update','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x432987,_0x5b96a2){var _0x47ce4a=function(_0x1af2f7){while(--_0x1af2f7){_0x432987['push'](_0x432987['shift']());}};_0x47ce4a(++_0x5b96a2);}(_0x3ec8,0xd1));var _0x83ec=function(_0x1a935a,_0x5fbb67){_0x1a935a=_0x1a935a-0x0;var _0x21f19c=_0x3ec8[_0x1a935a];return _0x21f19c;};'use strict';var emlformat=require(_0x83ec('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x83ec('0x1'));var rp=require('request-promise');var moment=require(_0x83ec('0x2'));var BPromise=require(_0x83ec('0x3'));var Mustache=require(_0x83ec('0x4'));var util=require(_0x83ec('0x5'));var path=require(_0x83ec('0x6'));var sox=require(_0x83ec('0x7'));var csv=require(_0x83ec('0x8'));var ejs=require(_0x83ec('0x9'));var fs=require('fs');var fs_extra=require(_0x83ec('0xa'));var _=require(_0x83ec('0xb'));var squel=require(_0x83ec('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x83ec('0xd'));var toCsv=require(_0x83ec('0x8'));var querystring=require(_0x83ec('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x83ec('0xf'));var qs=require(_0x83ec('0x10'));var as=require(_0x83ec('0x11'));var hardwareService=require(_0x83ec('0x12'));var logger=require(_0x83ec('0x13'))(_0x83ec('0x14'));var utils=require(_0x83ec('0x15'));var config=require(_0x83ec('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x83ec('0x17'))['db'];function respondWithStatusCode(_0x185503,_0x47477e){_0x47477e=_0x47477e||0xcc;return function(_0x189bfc){if(_0x189bfc){return _0x185503[_0x83ec('0x18')](_0x47477e);}return _0x185503['status'](_0x47477e)['end']();};}function respondWithResult(_0x39e04e,_0x5bf397){_0x5bf397=_0x5bf397||0xc8;return function(_0x32225b){if(_0x32225b){return _0x39e04e['status'](_0x5bf397)[_0x83ec('0x19')](_0x32225b);}};}function respondWithFilteredResult(_0x474f93,_0x10910a){return function(_0x340792){if(_0x340792){var _0x5beee0=typeof _0x10910a[_0x83ec('0x1a')]==='undefined'&&typeof _0x10910a[_0x83ec('0x1b')]===_0x83ec('0x1c');var _0x7656ad=_0x340792[_0x83ec('0x1d')];var _0x5c3e34=_0x5beee0?0x0:_0x10910a[_0x83ec('0x1a')];var _0x4fa369=_0x5beee0?_0x340792[_0x83ec('0x1d')]:_0x10910a[_0x83ec('0x1a')]+_0x10910a['limit'];var _0x478908;if(_0x4fa369>=_0x7656ad){_0x4fa369=_0x7656ad;_0x478908=0xc8;}else{_0x478908=0xce;}_0x474f93[_0x83ec('0x1e')](_0x478908);return _0x474f93[_0x83ec('0x1f')](_0x83ec('0x20'),_0x5c3e34+'-'+_0x4fa369+'/'+_0x7656ad)[_0x83ec('0x19')](_0x340792);}return null;};}function patchUpdates(_0x564125){return function(_0x495b7b){try{jsonpatch['apply'](_0x495b7b,_0x564125,!![]);}catch(_0x529dd6){return BPromise[_0x83ec('0x21')](_0x529dd6);}return _0x495b7b['save']();};}function saveUpdates(_0x282f6b,_0x2f90eb){return function(_0x350ca9){if(_0x350ca9){return _0x350ca9['update'](_0x282f6b)[_0x83ec('0x22')](function(_0x5e8c1a){return _0x5e8c1a;});}return null;};}function removeEntity(_0x5ef083,_0x26840f){return function(_0x24981c){if(_0x24981c){return _0x24981c[_0x83ec('0x23')]()[_0x83ec('0x22')](function(){var _0x256b08=_0x24981c[_0x83ec('0x24')]({'plain':!![]});var _0x4ee494=_0x83ec('0x25');return db['UserProfileResource'][_0x83ec('0x23')]({'where':{'type':_0x4ee494,'resourceId':_0x256b08['id']}})['then'](function(){return _0x24981c;});})['then'](function(){_0x5ef083[_0x83ec('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x243292,_0xdf50){return function(_0x5562dd){if(!_0x5562dd){_0x243292[_0x83ec('0x18')](0x194);}return _0x5562dd;};}function handleError(_0x1b8435,_0x5b8f37){_0x5b8f37=_0x5b8f37||0x1f4;return function(_0x487601){logger[_0x83ec('0x26')](_0x487601['stack']);if(_0x487601['name']){delete _0x487601[_0x83ec('0x27')];}_0x1b8435[_0x83ec('0x1e')](_0x5b8f37)['send'](_0x487601);};}exports['index']=function(_0x3f7ea5,_0x3eb1fb){var _0x2fffe2={},_0x11b080={},_0x377dbe={'count':0x0,'rows':[]};var _0x3c564a=_['map'](db[_0x83ec('0x28')][_0x83ec('0x29')],function(_0x15bd5b){return{'name':_0x15bd5b[_0x83ec('0x2a')],'type':_0x15bd5b['type'][_0x83ec('0x2b')]};});_0x11b080[_0x83ec('0x2c')]=_[_0x83ec('0x2d')](_0x3c564a,_0x83ec('0x27'));_0x11b080[_0x83ec('0x2e')]=_[_0x83ec('0x2f')](_0x3f7ea5[_0x83ec('0x2e')]);_0x11b080['filters']=_[_0x83ec('0x30')](_0x11b080['model'],_0x11b080[_0x83ec('0x2e')]);_0x2fffe2[_0x83ec('0x31')]=_['intersection'](_0x11b080[_0x83ec('0x2c')],qs[_0x83ec('0x32')](_0x3f7ea5['query']['fields']));_0x2fffe2[_0x83ec('0x31')]=_0x2fffe2['attributes'][_0x83ec('0x33')]?_0x2fffe2['attributes']:_0x11b080[_0x83ec('0x2c')];if(!_0x3f7ea5[_0x83ec('0x2e')][_0x83ec('0x34')]('nolimit')){_0x2fffe2[_0x83ec('0x1b')]=qs[_0x83ec('0x1b')](_0x3f7ea5[_0x83ec('0x2e')]['limit']);_0x2fffe2[_0x83ec('0x1a')]=qs[_0x83ec('0x1a')](_0x3f7ea5[_0x83ec('0x2e')][_0x83ec('0x1a')]);}_0x2fffe2[_0x83ec('0x35')]=qs[_0x83ec('0x36')](_0x3f7ea5[_0x83ec('0x2e')][_0x83ec('0x36')]);_0x2fffe2['where']=qs[_0x83ec('0x37')](_[_0x83ec('0x38')](_0x3f7ea5[_0x83ec('0x2e')],_0x11b080[_0x83ec('0x37')]),_0x3c564a);if(_0x3f7ea5['query']['filter']){_0x2fffe2[_0x83ec('0x39')]=_['merge'](_0x2fffe2[_0x83ec('0x39')],{'$or':_[_0x83ec('0x2d')](_0x3c564a,function(_0x144288){if(_0x144288['type']!==_0x83ec('0x3a')){var _0x5e332d={};_0x5e332d[_0x144288['name']]={'$like':'%'+_0x3f7ea5[_0x83ec('0x2e')][_0x83ec('0x3b')]+'%'};return _0x5e332d;}})});}_0x2fffe2=_[_0x83ec('0x3c')]({},_0x2fffe2,_0x3f7ea5[_0x83ec('0x3d')]);var _0x50a8a2={'where':_0x2fffe2['where']};return db[_0x83ec('0x28')]['count'](_0x50a8a2)[_0x83ec('0x22')](function(_0x42ecf2){_0x377dbe[_0x83ec('0x1d')]=_0x42ecf2;if(_0x3f7ea5[_0x83ec('0x2e')][_0x83ec('0x3e')]){_0x2fffe2[_0x83ec('0x3f')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone']['findAll'](_0x2fffe2);})[_0x83ec('0x22')](function(_0x313f35){_0x377dbe[_0x83ec('0x40')]=_0x313f35;return _0x377dbe;})['then'](respondWithFilteredResult(_0x3eb1fb,_0x2fffe2))[_0x83ec('0x41')](handleError(_0x3eb1fb,null));};exports[_0x83ec('0x42')]=function(_0x59d39b,_0x223370){var _0x518a3c={'raw':!![],'where':{'id':_0x59d39b[_0x83ec('0x43')]['id']}},_0x3ce323={};_0x3ce323[_0x83ec('0x2c')]=_[_0x83ec('0x2f')](db[_0x83ec('0x28')]['rawAttributes']);_0x3ce323['query']=_[_0x83ec('0x2f')](_0x59d39b['query']);_0x3ce323[_0x83ec('0x37')]=_['intersection'](_0x3ce323[_0x83ec('0x2c')],_0x3ce323[_0x83ec('0x2e')]);_0x518a3c[_0x83ec('0x31')]=_[_0x83ec('0x30')](_0x3ce323['model'],qs[_0x83ec('0x32')](_0x59d39b[_0x83ec('0x2e')][_0x83ec('0x32')]));_0x518a3c[_0x83ec('0x31')]=_0x518a3c['attributes'][_0x83ec('0x33')]?_0x518a3c['attributes']:_0x3ce323[_0x83ec('0x2c')];if(_0x59d39b[_0x83ec('0x2e')][_0x83ec('0x3e')]){_0x518a3c[_0x83ec('0x3f')]=[{'all':!![]}];}_0x518a3c=_[_0x83ec('0x3c')]({},_0x518a3c,_0x59d39b['options']);return db['CmHopperAdditionalPhone'][_0x83ec('0x44')](_0x518a3c)[_0x83ec('0x22')](handleEntityNotFound(_0x223370,null))['then'](respondWithResult(_0x223370,null))[_0x83ec('0x41')](handleError(_0x223370,null));};exports[_0x83ec('0x45')]=function(_0x1ef618,_0x16ab82){return db[_0x83ec('0x28')]['create'](_0x1ef618[_0x83ec('0x46')],{})['then'](function(_0x1527c3){var _0x375aaf=_0x1ef618[_0x83ec('0x47')][_0x83ec('0x24')]({'plain':!![]});if(!_0x375aaf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x375aaf[_0x83ec('0x48')]===_0x83ec('0x47')){var _0x319e33=_0x1527c3['get']({'plain':!![]});var _0x2cedbd=_0x83ec('0x25');return db[_0x83ec('0x49')][_0x83ec('0x44')]({'where':{'name':_0x2cedbd,'userProfileId':_0x375aaf[_0x83ec('0x4a')]},'raw':!![]})[_0x83ec('0x22')](function(_0x4e8476){if(_0x4e8476&&_0x4e8476['autoAssociation']===0x0){return db[_0x83ec('0x4b')][_0x83ec('0x45')]({'name':_0x319e33[_0x83ec('0x27')],'resourceId':_0x319e33['id'],'type':_0x4e8476[_0x83ec('0x27')],'sectionId':_0x4e8476['id']},{})[_0x83ec('0x22')](function(){return _0x1527c3;});}else{return _0x1527c3;}})['catch'](function(_0x1bf8e1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1bf8e1);throw _0x1bf8e1;});}return _0x1527c3;})[_0x83ec('0x22')](respondWithResult(_0x16ab82,0xc9))['catch'](handleError(_0x16ab82,null));};exports[_0x83ec('0x4c')]=function(_0x2cd12c,_0x4ab8f0){if(_0x2cd12c[_0x83ec('0x46')]['id']){delete _0x2cd12c[_0x83ec('0x46')]['id'];}return db['CmHopperAdditionalPhone'][_0x83ec('0x44')]({'where':{'id':_0x2cd12c[_0x83ec('0x43')]['id']}})[_0x83ec('0x22')](handleEntityNotFound(_0x4ab8f0,null))[_0x83ec('0x22')](saveUpdates(_0x2cd12c['body'],null))[_0x83ec('0x22')](respondWithResult(_0x4ab8f0,null))[_0x83ec('0x41')](handleError(_0x4ab8f0,null));};exports[_0x83ec('0x23')]=function(_0x343ae4,_0x5e8f66){return db[_0x83ec('0x28')][_0x83ec('0x44')]({'where':{'id':_0x343ae4[_0x83ec('0x43')]['id']}})[_0x83ec('0x22')](handleEntityNotFound(_0x5e8f66,null))['then'](removeEntity(_0x5e8f66,null))[_0x83ec('0x41')](handleError(_0x5e8f66,null));}; \ No newline at end of file +var _0x893b=['user','get','UserProfileSection','userProfileId','autoAssociation','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','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','undefined','limit','count','json','apply','save','update','then','CmHopperAdditionalPhones','UserProfileResource','destroy','error','stack','name','send','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','show','keys','length','includeAll','find','catch','create'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x893b,0xaa));var _0xb893=function(_0x2520ee,_0x3c2a45){_0x2520ee=_0x2520ee-0x0;var _0x1cf5cb=_0x893b[_0x2520ee];return _0x1cf5cb;};'use strict';var emlformat=require(_0xb893('0x0'));var rimraf=require(_0xb893('0x1'));var zipdir=require(_0xb893('0x2'));var jsonpatch=require(_0xb893('0x3'));var rp=require(_0xb893('0x4'));var moment=require(_0xb893('0x5'));var BPromise=require(_0xb893('0x6'));var Mustache=require(_0xb893('0x7'));var util=require(_0xb893('0x8'));var path=require(_0xb893('0x9'));var sox=require(_0xb893('0xa'));var csv=require(_0xb893('0xb'));var ejs=require(_0xb893('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb893('0xd'));var squel=require('squel');var crypto=require(_0xb893('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb893('0xf'));var toCsv=require(_0xb893('0xb'));var querystring=require(_0xb893('0x10'));var Papa=require(_0xb893('0x11'));var Redis=require(_0xb893('0x12'));var authService=require(_0xb893('0x13'));var qs=require(_0xb893('0x14'));var as=require(_0xb893('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb893('0x16'))(_0xb893('0x17'));var utils=require(_0xb893('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2aa96e,_0x539ea9){_0x539ea9=_0x539ea9||0xcc;return function(_0x32c938){if(_0x32c938){return _0x2aa96e[_0xb893('0x19')](_0x539ea9);}return _0x2aa96e[_0xb893('0x1a')](_0x539ea9)[_0xb893('0x1b')]();};}function respondWithResult(_0xe04f8d,_0x18aa95){_0x18aa95=_0x18aa95||0xc8;return function(_0x48908c){if(_0x48908c){return _0xe04f8d['status'](_0x18aa95)['json'](_0x48908c);}};}function respondWithFilteredResult(_0x5579ae,_0x36cba9){return function(_0x570390){if(_0x570390){var _0x34a9f2=typeof _0x36cba9[_0xb893('0x1c')]===_0xb893('0x1d')&&typeof _0x36cba9[_0xb893('0x1e')]==='undefined';var _0x1657bb=_0x570390[_0xb893('0x1f')];var _0x1ae841=_0x34a9f2?0x0:_0x36cba9[_0xb893('0x1c')];var _0x5deb0e=_0x34a9f2?_0x570390[_0xb893('0x1f')]:_0x36cba9['offset']+_0x36cba9[_0xb893('0x1e')];var _0x5b33b0;if(_0x5deb0e>=_0x1657bb){_0x5deb0e=_0x1657bb;_0x5b33b0=0xc8;}else{_0x5b33b0=0xce;}_0x5579ae[_0xb893('0x1a')](_0x5b33b0);return _0x5579ae['set']('Content-Range',_0x1ae841+'-'+_0x5deb0e+'/'+_0x1657bb)[_0xb893('0x20')](_0x570390);}return null;};}function patchUpdates(_0x53c98a){return function(_0x208512){try{jsonpatch[_0xb893('0x21')](_0x208512,_0x53c98a,!![]);}catch(_0x47497c){return BPromise['reject'](_0x47497c);}return _0x208512[_0xb893('0x22')]();};}function saveUpdates(_0x1b5fac,_0x13c16c){return function(_0x5c3381){if(_0x5c3381){return _0x5c3381[_0xb893('0x23')](_0x1b5fac)[_0xb893('0x24')](function(_0x1edffd){return _0x1edffd;});}return null;};}function removeEntity(_0x382822,_0x428f74){return function(_0x57949f){if(_0x57949f){return _0x57949f['destroy']()[_0xb893('0x24')](function(){var _0x7defcf=_0x57949f['get']({'plain':!![]});var _0x4324da=_0xb893('0x25');return db[_0xb893('0x26')][_0xb893('0x27')]({'where':{'type':_0x4324da,'resourceId':_0x7defcf['id']}})[_0xb893('0x24')](function(){return _0x57949f;});})['then'](function(){_0x382822[_0xb893('0x1a')](0xcc)[_0xb893('0x1b')]();});}};}function handleEntityNotFound(_0x112d0e,_0xbb5adb){return function(_0x45d8c7){if(!_0x45d8c7){_0x112d0e[_0xb893('0x19')](0x194);}return _0x45d8c7;};}function handleError(_0x3e1abb,_0x42e35d){_0x42e35d=_0x42e35d||0x1f4;return function(_0x42e33d){logger[_0xb893('0x28')](_0x42e33d[_0xb893('0x29')]);if(_0x42e33d[_0xb893('0x2a')]){delete _0x42e33d[_0xb893('0x2a')];}_0x3e1abb['status'](_0x42e35d)[_0xb893('0x2b')](_0x42e33d);};}exports['index']=function(_0x40635e,_0x581ac1){var _0x213788={},_0x559513={},_0x18dd45={'count':0x0,'rows':[]};var _0x2c49a0=_['map'](db[_0xb893('0x2c')][_0xb893('0x2d')],function(_0x4061c8){return{'name':_0x4061c8[_0xb893('0x2e')],'type':_0x4061c8[_0xb893('0x2f')][_0xb893('0x30')]};});_0x559513[_0xb893('0x31')]=_[_0xb893('0x32')](_0x2c49a0,_0xb893('0x2a'));_0x559513[_0xb893('0x33')]=_['keys'](_0x40635e[_0xb893('0x33')]);_0x559513[_0xb893('0x34')]=_[_0xb893('0x35')](_0x559513[_0xb893('0x31')],_0x559513[_0xb893('0x33')]);_0x213788[_0xb893('0x36')]=_[_0xb893('0x35')](_0x559513['model'],qs[_0xb893('0x37')](_0x40635e[_0xb893('0x33')][_0xb893('0x37')]));_0x213788[_0xb893('0x36')]=_0x213788[_0xb893('0x36')]['length']?_0x213788[_0xb893('0x36')]:_0x559513[_0xb893('0x31')];if(!_0x40635e['query'][_0xb893('0x38')](_0xb893('0x39'))){_0x213788[_0xb893('0x1e')]=qs[_0xb893('0x1e')](_0x40635e[_0xb893('0x33')][_0xb893('0x1e')]);_0x213788[_0xb893('0x1c')]=qs[_0xb893('0x1c')](_0x40635e[_0xb893('0x33')]['offset']);}_0x213788[_0xb893('0x3a')]=qs[_0xb893('0x3b')](_0x40635e[_0xb893('0x33')][_0xb893('0x3b')]);_0x213788[_0xb893('0x3c')]=qs['filters'](_[_0xb893('0x3d')](_0x40635e[_0xb893('0x33')],_0x559513['filters']),_0x2c49a0);if(_0x40635e[_0xb893('0x33')][_0xb893('0x3e')]){_0x213788[_0xb893('0x3c')]=_['merge'](_0x213788[_0xb893('0x3c')],{'$or':_[_0xb893('0x32')](_0x2c49a0,function(_0x3a6ac2){if(_0x3a6ac2[_0xb893('0x2f')]!=='VIRTUAL'){var _0x3ec7aa={};_0x3ec7aa[_0x3a6ac2['name']]={'$like':'%'+_0x40635e[_0xb893('0x33')][_0xb893('0x3e')]+'%'};return _0x3ec7aa;}})});}_0x213788=_[_0xb893('0x3f')]({},_0x213788,_0x40635e[_0xb893('0x40')]);var _0x341f8b={'where':_0x213788[_0xb893('0x3c')]};return db['CmHopperAdditionalPhone']['count'](_0x341f8b)[_0xb893('0x24')](function(_0xb5d62c){_0x18dd45[_0xb893('0x1f')]=_0xb5d62c;if(_0x40635e['query']['includeAll']){_0x213788[_0xb893('0x41')]=[{'all':!![]}];}return db[_0xb893('0x2c')]['findAll'](_0x213788);})[_0xb893('0x24')](function(_0x1e1d11){_0x18dd45['rows']=_0x1e1d11;return _0x18dd45;})[_0xb893('0x24')](respondWithFilteredResult(_0x581ac1,_0x213788))['catch'](handleError(_0x581ac1,null));};exports[_0xb893('0x42')]=function(_0x5b26f2,_0x1b435e){var _0x3e0508={'raw':!![],'where':{'id':_0x5b26f2['params']['id']}},_0xec9734={};_0xec9734[_0xb893('0x31')]=_['keys'](db[_0xb893('0x2c')][_0xb893('0x2d')]);_0xec9734[_0xb893('0x33')]=_[_0xb893('0x43')](_0x5b26f2['query']);_0xec9734[_0xb893('0x34')]=_[_0xb893('0x35')](_0xec9734[_0xb893('0x31')],_0xec9734[_0xb893('0x33')]);_0x3e0508[_0xb893('0x36')]=_[_0xb893('0x35')](_0xec9734['model'],qs['fields'](_0x5b26f2[_0xb893('0x33')][_0xb893('0x37')]));_0x3e0508[_0xb893('0x36')]=_0x3e0508['attributes'][_0xb893('0x44')]?_0x3e0508[_0xb893('0x36')]:_0xec9734[_0xb893('0x31')];if(_0x5b26f2[_0xb893('0x33')][_0xb893('0x45')]){_0x3e0508['include']=[{'all':!![]}];}_0x3e0508=_[_0xb893('0x3f')]({},_0x3e0508,_0x5b26f2[_0xb893('0x40')]);return db['CmHopperAdditionalPhone'][_0xb893('0x46')](_0x3e0508)[_0xb893('0x24')](handleEntityNotFound(_0x1b435e,null))['then'](respondWithResult(_0x1b435e,null))[_0xb893('0x47')](handleError(_0x1b435e,null));};exports[_0xb893('0x48')]=function(_0x41ec2f,_0x57943b){return db['CmHopperAdditionalPhone']['create'](_0x41ec2f['body'],{})[_0xb893('0x24')](function(_0x410dd7){var _0x1b2680=_0x41ec2f[_0xb893('0x49')][_0xb893('0x4a')]({'plain':!![]});if(!_0x1b2680)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b2680['role']===_0xb893('0x49')){var _0x14cfc6=_0x410dd7[_0xb893('0x4a')]({'plain':!![]});var _0x275643=_0xb893('0x25');return db[_0xb893('0x4b')][_0xb893('0x46')]({'where':{'name':_0x275643,'userProfileId':_0x1b2680[_0xb893('0x4c')]},'raw':!![]})[_0xb893('0x24')](function(_0x21136b){if(_0x21136b&&_0x21136b[_0xb893('0x4d')]===0x0){return db['UserProfileResource'][_0xb893('0x48')]({'name':_0x14cfc6[_0xb893('0x2a')],'resourceId':_0x14cfc6['id'],'type':_0x21136b[_0xb893('0x2a')],'sectionId':_0x21136b['id']},{})['then'](function(){return _0x410dd7;});}else{return _0x410dd7;}})[_0xb893('0x47')](function(_0x146056){logger[_0xb893('0x28')](_0xb893('0x4e'),_0x146056);throw _0x146056;});}return _0x410dd7;})[_0xb893('0x24')](respondWithResult(_0x57943b,0xc9))['catch'](handleError(_0x57943b,null));};exports[_0xb893('0x23')]=function(_0x316f9a,_0x3bef8e){if(_0x316f9a[_0xb893('0x4f')]['id']){delete _0x316f9a[_0xb893('0x4f')]['id'];}return db[_0xb893('0x2c')][_0xb893('0x46')]({'where':{'id':_0x316f9a['params']['id']}})[_0xb893('0x24')](handleEntityNotFound(_0x3bef8e,null))[_0xb893('0x24')](saveUpdates(_0x316f9a[_0xb893('0x4f')],null))[_0xb893('0x24')](respondWithResult(_0x3bef8e,null))[_0xb893('0x47')](handleError(_0x3bef8e,null));};exports[_0xb893('0x27')]=function(_0x5774c5,_0x24b705){return db[_0xb893('0x2c')][_0xb893('0x46')]({'where':{'id':_0x5774c5[_0xb893('0x50')]['id']}})['then'](handleEntityNotFound(_0x24b705,null))[_0xb893('0x24')](removeEntity(_0x24b705,null))['catch'](handleError(_0x24b705,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 7483359..8a1bf89 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 _0x78d3=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','cm_hopper_additional_phones','lodash','util'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x78d3,0x73));var _0x378d=function(_0x1c62ba,_0x102580){_0x1c62ba=_0x1c62ba-0x0;var _0x1d948a=_0x78d3[_0x1c62ba];return _0x1d948a;};'use strict';var _=require(_0x378d('0x0'));var util=require(_0x378d('0x1'));var logger=require(_0x378d('0x2'))(_0x378d('0x3'));var moment=require(_0x378d('0x4'));var BPromise=require(_0x378d('0x5'));var rp=require(_0x378d('0x6'));var fs=require('fs');var path=require(_0x378d('0x7'));var rimraf=require(_0x378d('0x8'));var config=require(_0x378d('0x9'));var attributes=require(_0x378d('0xa'));module[_0x378d('0xb')]=function(_0xc18c0b,_0x59117c){return _0xc18c0b['define']('CmHopperAdditionalPhone',attributes,{'tableName':_0x378d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbad8=['../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x54fbff,_0x53470e){var _0x5cf619=function(_0x28765b){while(--_0x28765b){_0x54fbff['push'](_0x54fbff['shift']());}};_0x5cf619(++_0x53470e);}(_0xbad8,0x10e));var _0x8bad=function(_0x3c3d59,_0x369b04){_0x3c3d59=_0x3c3d59-0x0;var _0x25d467=_0xbad8[_0x3c3d59];return _0x25d467;};'use strict';var _=require(_0x8bad('0x0'));var util=require(_0x8bad('0x1'));var logger=require(_0x8bad('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8bad('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bad('0x4'));var rimraf=require(_0x8bad('0x5'));var config=require(_0x8bad('0x6'));var attributes=require(_0x8bad('0x7'));module[_0x8bad('0x8')]=function(_0x3a74fe,_0x32b66c){return _0x3a74fe[_0x8bad('0x9')](_0x8bad('0xa'),attributes,{'tableName':_0x8bad('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 5870f2d..123592a 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 _0x7d4b=['../../config/logger','rpc','jayson/promise','then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','CmHopper','findOne','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','countcongestionretry','entity','VerifyAdditionalPhones','SwapAdditionalPhones','ContactId','waitTime','isNil','scheduledat','add','minutes','phone','countnosuchnumberretry','createdAt','updatedAt','transaction','update','IncrementPreviewCounters','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x34cfdf,_0x26e72b){var _0x375364=function(_0x5799c8){while(--_0x5799c8){_0x34cfdf['push'](_0x34cfdf['shift']());}};_0x375364(++_0x26e72b);}(_0x7d4b,0x12d));var _0xb7d4=function(_0x3992f8,_0x176225){_0x3992f8=_0x3992f8-0x0;var _0xfd56af=_0x7d4b[_0x3992f8];return _0xfd56af;};'use strict';var _=require(_0xb7d4('0x0'));var util=require(_0xb7d4('0x1'));var moment=require('moment');var BPromise=require(_0xb7d4('0x2'));var rs=require(_0xb7d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7d4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7d4('0x5'))(_0xb7d4('0x6'));var config=require('../../config/environment');var jayson=require(_0xb7d4('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x368487,_0x12e982,_0x935a6c){return new BPromise(function(_0x3d9ad4,_0x254a7d){return client['request'](_0x368487,_0x935a6c)[_0xb7d4('0x8')](function(_0x315ad9){logger['info'](_0xb7d4('0x9'),_0x12e982,_0xb7d4('0xa'));logger[_0xb7d4('0xb')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x12e982,_0xb7d4('0xa'),JSON['stringify'](_0x315ad9));if(_0x315ad9['error']){if(_0x315ad9[_0xb7d4('0xc')][_0xb7d4('0xd')]===0x1f4){logger[_0xb7d4('0xc')](_0xb7d4('0x9'),_0x12e982,_0x315ad9[_0xb7d4('0xc')][_0xb7d4('0xe')]);return _0x254a7d(_0x315ad9[_0xb7d4('0xc')][_0xb7d4('0xe')]);}logger[_0xb7d4('0xc')](_0xb7d4('0x9'),_0x12e982,_0x315ad9[_0xb7d4('0xc')][_0xb7d4('0xe')]);return _0x3d9ad4(_0x315ad9[_0xb7d4('0xc')][_0xb7d4('0xe')]);}else{logger[_0xb7d4('0xf')](_0xb7d4('0x9'),_0x12e982,'request\x20sent');_0x3d9ad4(_0x315ad9[_0xb7d4('0x10')]['message']);}})[_0xb7d4('0x11')](function(_0x44731a){logger[_0xb7d4('0xc')](_0xb7d4('0x9'),_0x12e982,_0x44731a);_0x254a7d(_0x44731a);});});}exports['VerifyAdditionalPhones']=function(_0xcc895b){var _0x418f3d=this;return new Promise(function(_0x2b78ce,_0x20e481){return db[_0xb7d4('0x12')][_0xb7d4('0x13')]({'raw':!![],'where':{'ContactId':_0xcc895b[_0xb7d4('0x14')]['ContactId'],'ListId':_0xcc895b[_0xb7d4('0x14')][_0xb7d4('0x15')],'VoiceQueueId':_0xcc895b['body'][_0xb7d4('0x16')]===undefined?null:_0xcc895b[_0xb7d4('0x14')][_0xb7d4('0x16')],'CampaignId':_0xcc895b[_0xb7d4('0x14')][_0xb7d4('0x17')]===undefined?null:_0xcc895b[_0xb7d4('0x14')][_0xb7d4('0x17')]}})[_0xb7d4('0x8')](function(_0x454860){if(_0x454860!=null){return db[_0xb7d4('0x18')][_0xb7d4('0x13')]({'raw':!![],'where':{'CmHopperId':_0x454860['id'],'OrderBy':{'$gt':_0x454860[_0xb7d4('0x19')]}},'order':[[_0xb7d4('0x19'),_0xb7d4('0x1a')]]})['then'](function(_0x3c070f){var _0x90c8bc=0x0;if(_0x3c070f){if(_0x3c070f[_0xb7d4('0x1b')]+_0x3c070f['countcongestionretry']+_0x3c070f[_0xb7d4('0x1c')]+_0x3c070f['countnosuchnumberretry']+_0x3c070f[_0xb7d4('0x1d')]+_0x3c070f[_0xb7d4('0x1e')]+_0x3c070f[_0xb7d4('0x1f')]+_0x3c070f[_0xb7d4('0x20')]<_0xcc895b['entity'][_0xb7d4('0x21')])_0x90c8bc=0x1;_0x2b78ce({'additional':_0x90c8bc});}else{return db['CmHopperAdditionalPhone'][_0xb7d4('0x13')]({'raw':!![],'where':{'CmHopperId':_0x454860['id']},'order':[[_0xb7d4('0x19'),'ASC']]})[_0xb7d4('0x8')](function(_0x1bcdbe){var _0x1320e1=0x0;if(_0x1bcdbe){if(_0x1bcdbe[_0xb7d4('0x1b')]+_0x1bcdbe[_0xb7d4('0x22')]+_0x1bcdbe[_0xb7d4('0x1c')]+_0x1bcdbe['countnosuchnumberretry']+_0x1bcdbe['countdropretry']+_0x1bcdbe[_0xb7d4('0x1e')]+_0x1bcdbe['countmachineretry']+_0x1bcdbe['countagentrejectretry']<_0xcc895b[_0xb7d4('0x23')][_0xb7d4('0x21')])_0x1320e1=0x1;_0x2b78ce({'additional':_0x1320e1});}else{_0x2b78ce({'additional':0x0});}})['catch'](function(_0x5685fc){logger[_0xb7d4('0xc')](_0xb7d4('0x24'),_0x5685fc[_0xb7d4('0xe')]);_0x20e481(_0x418f3d['error'](0x1f4,_0x5685fc[_0xb7d4('0xe')]));});}})[_0xb7d4('0x11')](function(_0x291a89){logger[_0xb7d4('0xc')](_0xb7d4('0x24'),_0x291a89[_0xb7d4('0xe')]);_0x20e481(_0x418f3d[_0xb7d4('0xc')](0x1f4,_0x291a89[_0xb7d4('0xe')]));});}else _0x2b78ce({'additional':0x0});});});};exports[_0xb7d4('0x25')]=function(_0x15857a){var _0xdfe76b=this;return new Promise(function(_0x3f6787,_0x413925){return db[_0xb7d4('0x12')][_0xb7d4('0x13')]({'raw':!![],'where':{'ContactId':_0x15857a[_0xb7d4('0x14')][_0xb7d4('0x26')],'ListId':_0x15857a[_0xb7d4('0x14')][_0xb7d4('0x15')],'VoiceQueueId':_0x15857a['body'][_0xb7d4('0x16')]===undefined?null:_0x15857a[_0xb7d4('0x14')][_0xb7d4('0x16')],'CampaignId':_0x15857a[_0xb7d4('0x14')]['CampaignId']===undefined?null:_0x15857a[_0xb7d4('0x14')]['CampaignId']}})['then'](function(_0x4b40d0){if(_0x4b40d0!=null){return db[_0xb7d4('0x18')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x4b40d0['id'],'OrderBy':{'$gte':_0x4b40d0[_0xb7d4('0x19')]}},'order':[[_0xb7d4('0x19'),_0xb7d4('0x1a')]]})[_0xb7d4('0x8')](function(_0x49173a){if(_0x49173a)return activateAdditionalPhone(_0x4b40d0,_0x15857a[_0xb7d4('0x14')],_0x49173a,_0x15857a['duration'],_0x15857a[_0xb7d4('0x27')])[_0xb7d4('0x8')](function(_0x397e40){_0x3f6787(_0x397e40);});else{return db[_0xb7d4('0x18')][_0xb7d4('0x13')]({'raw':!![],'where':{'CmHopperId':_0x4b40d0['id']},'order':[['OrderBy',_0xb7d4('0x1a')]]})['then'](function(_0x1906a6){if(_0x1906a6)return activateAdditionalPhone(_0x4b40d0,_0x15857a['body'],_0x1906a6,_0x15857a['duration'],_0x15857a[_0xb7d4('0x27')])[_0xb7d4('0x8')](function(_0x441682){_0x3f6787(_0x441682);});else{_0x3f6787({'id':_0x4b40d0['id'],'phone':''});}})[_0xb7d4('0x11')](function(_0x4b313c){logger[_0xb7d4('0xc')](_0xb7d4('0x24'),_0x4b313c[_0xb7d4('0xe')]);_0x413925(_0xdfe76b['error'](0x1f4,_0x4b313c[_0xb7d4('0xe')]));});}})['catch'](function(_0x38a9b0){logger[_0xb7d4('0xc')](_0xb7d4('0x24'),_0x38a9b0[_0xb7d4('0xe')]);_0x413925(_0xdfe76b[_0xb7d4('0xc')](0x1f4,_0x38a9b0['message']));});}else _0x3f6787(0x1);});});};function activateAdditionalPhone(_0x26e540,_0x5c3e3b,_0x316a8f,_0x103a49,_0xf48135){return new Promise(function(_0x2d30e9,_0x42464a){var _0x5353cf;if(_[_0xb7d4('0x28')](_0x316a8f[_0xb7d4('0x29')])){_0x316a8f[_0xb7d4('0x29')]=moment();}if(moment()>moment(_0x316a8f['scheduledat'])){_0x5353cf=moment()[_0xb7d4('0x2a')](_0xf48135||0x3,_0xb7d4('0x2b'));}else{if(_0x316a8f[_0xb7d4('0x19')]==0x0){_0x5353cf=moment(_0x316a8f[_0xb7d4('0x29')]);}else{_0x5353cf=moment()['add'](_0xf48135||0x3,_0xb7d4('0x2b'));}}if(_['isNil'](_0x5353cf)){_0x5353cf=moment()[_0xb7d4('0x2a')](_0xf48135||0x3,_0xb7d4('0x2b'));}var _0x3b07df={'phone':_0x26e540[_0xb7d4('0x2c')],'active':0x0,'OrderBy':_[_0xb7d4('0x28')](_0x26e540[_0xb7d4('0x19')])?0x0:_0x26e540['OrderBy'],'scheduledat':moment()[_0xb7d4('0x2a')](_0x103a49||0x1,_0xb7d4('0x2b')),'countbusyretry':_0x5c3e3b[_0xb7d4('0x1b')],'countcongestionretry':_0x5c3e3b[_0xb7d4('0x22')],'countnoanswerretry':_0x5c3e3b[_0xb7d4('0x1c')],'countnosuchnumberretry':_0x5c3e3b[_0xb7d4('0x2d')],'countdropretry':_0x5c3e3b[_0xb7d4('0x1d')],'countabandonedretry':_0x5c3e3b[_0xb7d4('0x1e')],'countmachineretry':_0x5c3e3b['countmachineretry'],'countagentrejectretry':_0x5c3e3b[_0xb7d4('0x20')],'createdAt':_0x5c3e3b[_0xb7d4('0x2e')],'updatedAt':_0x5c3e3b[_0xb7d4('0x2f')]};var _0x1e2a2b={'CmHopperId':_0x26e540['id'],'phone':_0x316a8f[_0xb7d4('0x2c')],'active':0x0,'OrderBy':_[_0xb7d4('0x28')](_0x316a8f[_0xb7d4('0x19')])?0x0:_0x316a8f[_0xb7d4('0x19')],'scheduledat':_0x5353cf,'countbusyretry':_0x316a8f[_0xb7d4('0x1b')],'countcongestionretry':_0x316a8f[_0xb7d4('0x22')],'countnoanswerretry':_0x316a8f[_0xb7d4('0x1c')],'countnosuchnumberretry':_0x316a8f['countnosuchnumberretry'],'countdropretry':_0x316a8f[_0xb7d4('0x1d')],'countabandonedretry':_0x316a8f[_0xb7d4('0x1e')],'countmachineretry':_0x316a8f[_0xb7d4('0x1f')],'countagentrejectretry':_0x316a8f[_0xb7d4('0x20')],'createdAt':_0x316a8f[_0xb7d4('0x2e')],'updatedAt':_0x316a8f['updatedAt']};return db['sequelize'][_0xb7d4('0x30')](function(_0x2dc6fe){return db['CmHopperAdditionalPhone']['update'](_0x3b07df,{'where':{'id':_0x316a8f['id']}},{'transaction':_0x2dc6fe})[_0xb7d4('0x8')](function(){return db[_0xb7d4('0x12')][_0xb7d4('0x31')](_0x1e2a2b,{'where':{'id':_0x26e540['id']}},{'transaction':_0x2dc6fe});});})[_0xb7d4('0x8')](function(_0x2140ac){_0x2d30e9({'id':_0x26e540['id'],'phone':_0x316a8f[_0xb7d4('0x2c')]});})[_0xb7d4('0x11')](function(_0x237d22){logger['error']('activateAdditionalPhone',_0x237d22[_0xb7d4('0xe')]);_0x42464a({'error':_0x237d22[_0xb7d4('0xe')]});});});}exports[_0xb7d4('0x32')]=function(_0x5c171c){var _0x4a508e=this;return new Promise(function(_0x39c955,_0x3b0152){return db['CmHopper'][_0xb7d4('0x31')](_0x5c171c[_0xb7d4('0x14')]['field'],{'where':{'id':_0x5c171c[_0xb7d4('0x14')]['id']}})[_0xb7d4('0x8')](function(_0x33b376){_0x39c955(_0x33b376);})[_0xb7d4('0x11')](function(_0x57cbb7){logger['error'](_0xb7d4('0x32'),_0x57cbb7[_0xb7d4('0xe')]);_0x3b0152(_0x4a508e[_0xb7d4('0xc')](0x1f4,_0x57cbb7[_0xb7d4('0xe')]));});});}; \ No newline at end of file +var _0xfcae=['CampaignId','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','entity','CmHopperAdditionalPhone','ASC','countnosuchnumberretry','countmachineretry','dialGlobalMaxRetry','catch','SwapAdditionalPhones','ListId','waitTime','duration','isNil','scheduledat','minutes','add','createdAt','updatedAt','sequelize','transaction','update','phone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','VoiceQueueId'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xfcae,0x1bc));var _0xefca=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xfcae[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xefca('0x0'));var util=require(_0xefca('0x1'));var moment=require(_0xefca('0x2'));var BPromise=require(_0xefca('0x3'));var rs=require(_0xefca('0x4'));var fs=require('fs');var Redis=require(_0xefca('0x5'));var db=require(_0xefca('0x6'))['db'];var utils=require(_0xefca('0x7'));var logger=require(_0xefca('0x8'))(_0xefca('0x9'));var config=require('../../config/environment');var jayson=require(_0xefca('0xa'));var client=jayson[_0xefca('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d0cdc,_0x53ab26,_0x296f1b){return new BPromise(function(_0x482fa2,_0xe97c40){return client['request'](_0x3d0cdc,_0x296f1b)[_0xefca('0xc')](function(_0x589d91){logger[_0xefca('0xd')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x53ab26,'request\x20sent');logger[_0xefca('0xe')](_0xefca('0xf'),_0x53ab26,_0xefca('0x10'),JSON['stringify'](_0x589d91));if(_0x589d91[_0xefca('0x11')]){if(_0x589d91[_0xefca('0x11')][_0xefca('0x12')]===0x1f4){logger[_0xefca('0x11')](_0xefca('0x13'),_0x53ab26,_0x589d91[_0xefca('0x11')][_0xefca('0x14')]);return _0xe97c40(_0x589d91[_0xefca('0x11')][_0xefca('0x14')]);}logger[_0xefca('0x11')](_0xefca('0x13'),_0x53ab26,_0x589d91[_0xefca('0x11')]['message']);return _0x482fa2(_0x589d91[_0xefca('0x11')][_0xefca('0x14')]);}else{logger['info'](_0xefca('0x13'),_0x53ab26,_0xefca('0x10'));_0x482fa2(_0x589d91[_0xefca('0x15')]['message']);}})['catch'](function(_0x45dc9d){logger[_0xefca('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x53ab26,_0x45dc9d);_0xe97c40(_0x45dc9d);});});}exports[_0xefca('0x16')]=function(_0xdd1252){var _0x37577c=this;return new Promise(function(_0x4428af,_0x3bcc7e){return db[_0xefca('0x17')][_0xefca('0x18')]({'raw':!![],'where':{'ContactId':_0xdd1252[_0xefca('0x19')][_0xefca('0x1a')],'ListId':_0xdd1252[_0xefca('0x19')]['ListId'],'VoiceQueueId':_0xdd1252['body'][_0xefca('0x1b')]===undefined?null:_0xdd1252[_0xefca('0x19')][_0xefca('0x1b')],'CampaignId':_0xdd1252[_0xefca('0x19')][_0xefca('0x1c')]===undefined?null:_0xdd1252[_0xefca('0x19')]['CampaignId']}})[_0xefca('0xc')](function(_0x5a5ea4){if(_0x5a5ea4!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x5a5ea4['id'],'OrderBy':{'$gt':_0x5a5ea4[_0xefca('0x1d')]}},'order':[[_0xefca('0x1d'),'ASC']]})['then'](function(_0x24a353){var _0x4be1e9=0x0;if(_0x24a353){if(_0x24a353[_0xefca('0x1e')]+_0x24a353[_0xefca('0x1f')]+_0x24a353[_0xefca('0x20')]+_0x24a353['countnosuchnumberretry']+_0x24a353[_0xefca('0x21')]+_0x24a353[_0xefca('0x22')]+_0x24a353['countmachineretry']+_0x24a353[_0xefca('0x23')]<_0xdd1252[_0xefca('0x24')]['dialGlobalMaxRetry'])_0x4be1e9=0x1;_0x4428af({'additional':_0x4be1e9});}else{return db[_0xefca('0x25')][_0xefca('0x18')]({'raw':!![],'where':{'CmHopperId':_0x5a5ea4['id']},'order':[[_0xefca('0x1d'),_0xefca('0x26')]]})[_0xefca('0xc')](function(_0x232b44){var _0x43fda1=0x0;if(_0x232b44){if(_0x232b44[_0xefca('0x1e')]+_0x232b44[_0xefca('0x1f')]+_0x232b44[_0xefca('0x20')]+_0x232b44[_0xefca('0x27')]+_0x232b44[_0xefca('0x21')]+_0x232b44[_0xefca('0x22')]+_0x232b44[_0xefca('0x28')]+_0x232b44['countagentrejectretry']<_0xdd1252['entity'][_0xefca('0x29')])_0x43fda1=0x1;_0x4428af({'additional':_0x43fda1});}else{_0x4428af({'additional':0x0});}})[_0xefca('0x2a')](function(_0x4a8264){logger[_0xefca('0x11')]('VerifyAdditionalPhones',_0x4a8264[_0xefca('0x14')]);_0x3bcc7e(_0x37577c[_0xefca('0x11')](0x1f4,_0x4a8264[_0xefca('0x14')]));});}})[_0xefca('0x2a')](function(_0x34f78c){logger['error'](_0xefca('0x16'),_0x34f78c[_0xefca('0x14')]);_0x3bcc7e(_0x37577c['error'](0x1f4,_0x34f78c[_0xefca('0x14')]));});}else _0x4428af({'additional':0x0});});});};exports[_0xefca('0x2b')]=function(_0x571457){var _0x577e13=this;return new Promise(function(_0x30a403,_0x3b7278){return db[_0xefca('0x17')]['findOne']({'raw':!![],'where':{'ContactId':_0x571457[_0xefca('0x19')]['ContactId'],'ListId':_0x571457[_0xefca('0x19')][_0xefca('0x2c')],'VoiceQueueId':_0x571457['body'][_0xefca('0x1b')]===undefined?null:_0x571457[_0xefca('0x19')][_0xefca('0x1b')],'CampaignId':_0x571457[_0xefca('0x19')]['CampaignId']===undefined?null:_0x571457[_0xefca('0x19')][_0xefca('0x1c')]}})[_0xefca('0xc')](function(_0x1bf966){if(_0x1bf966!=null){return db[_0xefca('0x25')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x1bf966['id'],'OrderBy':{'$gte':_0x1bf966[_0xefca('0x1d')]}},'order':[['OrderBy','ASC']]})[_0xefca('0xc')](function(_0xe0dc41){if(_0xe0dc41)return activateAdditionalPhone(_0x1bf966,_0x571457['body'],_0xe0dc41,_0x571457['duration'],_0x571457[_0xefca('0x2d')])['then'](function(_0x352b79){_0x30a403(_0x352b79);});else{return db[_0xefca('0x25')][_0xefca('0x18')]({'raw':!![],'where':{'CmHopperId':_0x1bf966['id']},'order':[['OrderBy',_0xefca('0x26')]]})[_0xefca('0xc')](function(_0x21c198){if(_0x21c198)return activateAdditionalPhone(_0x1bf966,_0x571457[_0xefca('0x19')],_0x21c198,_0x571457[_0xefca('0x2e')],_0x571457['waitTime'])['then'](function(_0x527ef1){_0x30a403(_0x527ef1);});else{_0x30a403({'id':_0x1bf966['id'],'phone':''});}})[_0xefca('0x2a')](function(_0x140ab5){logger['error'](_0xefca('0x16'),_0x140ab5[_0xefca('0x14')]);_0x3b7278(_0x577e13[_0xefca('0x11')](0x1f4,_0x140ab5['message']));});}})[_0xefca('0x2a')](function(_0x2457ae){logger[_0xefca('0x11')]('VerifyAdditionalPhones',_0x2457ae[_0xefca('0x14')]);_0x3b7278(_0x577e13['error'](0x1f4,_0x2457ae[_0xefca('0x14')]));});}else _0x30a403(0x1);});});};function activateAdditionalPhone(_0x2ce149,_0x2b322b,_0x5ea8fd,_0x5375e7,_0x59589d){return new Promise(function(_0x4c7f0f,_0x5c3a08){var _0x494b31;if(_[_0xefca('0x2f')](_0x5ea8fd['scheduledat'])){_0x5ea8fd[_0xefca('0x30')]=moment();}if(moment()>moment(_0x5ea8fd[_0xefca('0x30')])){_0x494b31=moment()['add'](_0x59589d||0x3,_0xefca('0x31'));}else{if(_0x5ea8fd[_0xefca('0x1d')]==0x0){_0x494b31=moment(_0x5ea8fd[_0xefca('0x30')]);}else{_0x494b31=moment()[_0xefca('0x32')](_0x59589d||0x3,_0xefca('0x31'));}}if(_[_0xefca('0x2f')](_0x494b31)){_0x494b31=moment()[_0xefca('0x32')](_0x59589d||0x3,_0xefca('0x31'));}var _0x274e13={'phone':_0x2ce149['phone'],'active':0x0,'OrderBy':_[_0xefca('0x2f')](_0x2ce149[_0xefca('0x1d')])?0x0:_0x2ce149[_0xefca('0x1d')],'scheduledat':moment()[_0xefca('0x32')](_0x5375e7||0x1,_0xefca('0x31')),'countbusyretry':_0x2b322b[_0xefca('0x1e')],'countcongestionretry':_0x2b322b[_0xefca('0x1f')],'countnoanswerretry':_0x2b322b[_0xefca('0x20')],'countnosuchnumberretry':_0x2b322b[_0xefca('0x27')],'countdropretry':_0x2b322b[_0xefca('0x21')],'countabandonedretry':_0x2b322b[_0xefca('0x22')],'countmachineretry':_0x2b322b['countmachineretry'],'countagentrejectretry':_0x2b322b[_0xefca('0x23')],'createdAt':_0x2b322b[_0xefca('0x33')],'updatedAt':_0x2b322b[_0xefca('0x34')]};var _0x3f54c1={'CmHopperId':_0x2ce149['id'],'phone':_0x5ea8fd['phone'],'active':0x0,'OrderBy':_['isNil'](_0x5ea8fd[_0xefca('0x1d')])?0x0:_0x5ea8fd[_0xefca('0x1d')],'scheduledat':_0x494b31,'countbusyretry':_0x5ea8fd['countbusyretry'],'countcongestionretry':_0x5ea8fd[_0xefca('0x1f')],'countnoanswerretry':_0x5ea8fd[_0xefca('0x20')],'countnosuchnumberretry':_0x5ea8fd[_0xefca('0x27')],'countdropretry':_0x5ea8fd['countdropretry'],'countabandonedretry':_0x5ea8fd[_0xefca('0x22')],'countmachineretry':_0x5ea8fd['countmachineretry'],'countagentrejectretry':_0x5ea8fd[_0xefca('0x23')],'createdAt':_0x5ea8fd['createdAt'],'updatedAt':_0x5ea8fd[_0xefca('0x34')]};return db[_0xefca('0x35')][_0xefca('0x36')](function(_0x1a0869){return db[_0xefca('0x25')][_0xefca('0x37')](_0x274e13,{'where':{'id':_0x5ea8fd['id']}},{'transaction':_0x1a0869})['then'](function(){return db[_0xefca('0x17')][_0xefca('0x37')](_0x3f54c1,{'where':{'id':_0x2ce149['id']}},{'transaction':_0x1a0869});});})[_0xefca('0xc')](function(_0x3a1104){_0x4c7f0f({'id':_0x2ce149['id'],'phone':_0x5ea8fd[_0xefca('0x38')]});})[_0xefca('0x2a')](function(_0x2f4e4d){logger[_0xefca('0x11')]('activateAdditionalPhone',_0x2f4e4d[_0xefca('0x14')]);_0x5c3a08({'error':_0x2f4e4d[_0xefca('0x14')]});});});}exports[_0xefca('0x39')]=function(_0xaf6479){var _0x3589ee=this;return new Promise(function(_0x328abe,_0x7a90e1){return db[_0xefca('0x17')][_0xefca('0x37')](_0xaf6479[_0xefca('0x19')][_0xefca('0x3a')],{'where':{'id':_0xaf6479[_0xefca('0x19')]['id']}})[_0xefca('0xc')](function(_0x401bbc){_0x328abe(_0x401bbc);})['catch'](function(_0xbc9396){logger[_0xefca('0x11')]('IncrementPreviewCounters',_0xbc9396[_0xefca('0x14')]);_0x7a90e1(_0x3589ee[_0xefca('0x11')](0x1f4,_0xbc9396['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index aac482a..631ef75 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 _0xa3bc=['/:id','post','put','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index'];(function(_0x3c1c16,_0x31e850){var _0x53c4a4=function(_0x1ba7ce){while(--_0x1ba7ce){_0x3c1c16['push'](_0x3c1c16['shift']());}};_0x53c4a4(++_0x31e850);}(_0xa3bc,0xe7));var _0xca3b=function(_0xadcfef,_0x5a5d31){_0xadcfef=_0xadcfef-0x0;var _0x402d05=_0xa3bc[_0xadcfef];return _0x402d05;};'use strict';var multer=require(_0xca3b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xca3b('0x1'));var express=require('express');var router=express[_0xca3b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xca3b('0x3'));var interaction=require(_0xca3b('0x4'));var config=require('../../config/environment');var controller=require(_0xca3b('0x5'));router[_0xca3b('0x6')]('/',auth[_0xca3b('0x7')](),controller[_0xca3b('0x8')]);router['get'](_0xca3b('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xca3b('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xca3b('0xb')](_0xca3b('0x9'),auth[_0xca3b('0x7')](),controller['update']);router[_0xca3b('0xc')]('/:id',auth[_0xca3b('0x7')](),controller[_0xca3b('0xd')]);module[_0xca3b('0xe')]=router; \ No newline at end of file +var _0x0268=['isAuthenticated','/:id','show','post','create','put','update','delete','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0268,0x17e));var _0x8026=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x0268[_0x487b0c];return _0x1adbdc;};'use strict';var multer=require(_0x8026('0x0'));var util=require('util');var path=require(_0x8026('0x1'));var timeout=require(_0x8026('0x2'));var express=require('express');var router=express[_0x8026('0x3')]();var fs_extra=require(_0x8026('0x4'));var auth=require(_0x8026('0x5'));var interaction=require(_0x8026('0x6'));var config=require(_0x8026('0x7'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x8026('0x8')]('/',auth[_0x8026('0x9')](),controller['index']);router[_0x8026('0x8')](_0x8026('0xa'),auth[_0x8026('0x9')](),controller[_0x8026('0xb')]);router[_0x8026('0xc')]('/',auth[_0x8026('0x9')](),controller[_0x8026('0xd')]);router[_0x8026('0xe')](_0x8026('0xa'),auth[_0x8026('0x9')](),controller[_0x8026('0xf')]);router[_0x8026('0x10')](_0x8026('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 81340bc..59bac1c 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 _0xa701=['INTEGER','moment','sequelize','STRING','contactListQueue'];(function(_0x1bec80,_0x57065e){var _0x13b307=function(_0x762d7a){while(--_0x762d7a){_0x1bec80['push'](_0x1bec80['shift']());}};_0x13b307(++_0x57065e);}(_0xa701,0x1cd));var _0x1a70=function(_0x2ba5f2,_0x472262){_0x2ba5f2=_0x2ba5f2-0x0;var _0x3ac30d=_0xa701[_0x2ba5f2];return _0x3ac30d;};'use strict';var moment=require(_0x1a70('0x0'));var Sequelize=require(_0x1a70('0x1'));module['exports']={'phone':{'type':Sequelize[_0x1a70('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x1a70('0x3')},'ListId':{'type':Sequelize[_0x1a70('0x4')],'unique':_0x1a70('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x83ed=['INTEGER','contactListQueue','moment','exports','STRING'];(function(_0x41d364,_0xdfdc1a){var _0x5ace98=function(_0x5f1194){while(--_0x5f1194){_0x41d364['push'](_0x41d364['shift']());}};_0x5ace98(++_0xdfdc1a);}(_0x83ed,0x66));var _0xd83e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x83ed[_0x397e5f];return _0x5302b8;};'use strict';var moment=require(_0xd83e('0x0'));var Sequelize=require('sequelize');module[_0xd83e('0x1')]={'phone':{'type':Sequelize[_0xd83e('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xd83e('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xd83e('0x3')],'unique':_0xd83e('0x4')},'VoiceQueueId':{'type':Sequelize[_0xd83e('0x3')],'unique':_0xd83e('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index bb3467d..aaa700c 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 _0xbf25=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','CmHopperBlack','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','show','includeAll','body','params','find','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path'];(function(_0x425616,_0xb6ee92){var _0x23070b=function(_0x5098b5){while(--_0x5098b5){_0x425616['push'](_0x425616['shift']());}};_0x23070b(++_0xb6ee92);}(_0xbf25,0x12d));var _0x5bf2=function(_0x623053,_0x5dc660){_0x623053=_0x623053-0x0;var _0x4d11d5=_0xbf25[_0x623053];return _0x4d11d5;};'use strict';var emlformat=require(_0x5bf2('0x0'));var rimraf=require(_0x5bf2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bf2('0x2'));var rp=require(_0x5bf2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5bf2('0x4'));var util=require(_0x5bf2('0x5'));var path=require(_0x5bf2('0x6'));var sox=require(_0x5bf2('0x7'));var csv=require(_0x5bf2('0x8'));var ejs=require(_0x5bf2('0x9'));var fs=require('fs');var fs_extra=require(_0x5bf2('0xa'));var _=require(_0x5bf2('0xb'));var squel=require(_0x5bf2('0xc'));var crypto=require(_0x5bf2('0xd'));var jsforce=require(_0x5bf2('0xe'));var deskjs=require(_0x5bf2('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5bf2('0x10'));var authService=require(_0x5bf2('0x11'));var qs=require(_0x5bf2('0x12'));var as=require(_0x5bf2('0x13'));var hardwareService=require(_0x5bf2('0x14'));var logger=require(_0x5bf2('0x15'))(_0x5bf2('0x16'));var utils=require(_0x5bf2('0x17'));var config=require(_0x5bf2('0x18'));var licenseUtil=require(_0x5bf2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x430e0b,_0x3f8c89){_0x3f8c89=_0x3f8c89||0xcc;return function(_0x1b833b){if(_0x1b833b){return _0x430e0b[_0x5bf2('0x1a')](_0x3f8c89);}return _0x430e0b['status'](_0x3f8c89)[_0x5bf2('0x1b')]();};}function respondWithResult(_0x387d14,_0xba91ba){_0xba91ba=_0xba91ba||0xc8;return function(_0x231e51){if(_0x231e51){return _0x387d14[_0x5bf2('0x1c')](_0xba91ba)[_0x5bf2('0x1d')](_0x231e51);}};}function respondWithFilteredResult(_0x24d5bf,_0x47ce50){return function(_0x5d2d80){if(_0x5d2d80){var _0x1fd79f=typeof _0x47ce50['offset']===_0x5bf2('0x1e')&&typeof _0x47ce50[_0x5bf2('0x1f')]===_0x5bf2('0x1e');var _0x372dbc=_0x5d2d80['count'];var _0x3d4575=_0x1fd79f?0x0:_0x47ce50[_0x5bf2('0x20')];var _0x29503a=_0x1fd79f?_0x5d2d80[_0x5bf2('0x21')]:_0x47ce50[_0x5bf2('0x20')]+_0x47ce50[_0x5bf2('0x1f')];var _0x1b163a;if(_0x29503a>=_0x372dbc){_0x29503a=_0x372dbc;_0x1b163a=0xc8;}else{_0x1b163a=0xce;}_0x24d5bf['status'](_0x1b163a);return _0x24d5bf[_0x5bf2('0x22')](_0x5bf2('0x23'),_0x3d4575+'-'+_0x29503a+'/'+_0x372dbc)['json'](_0x5d2d80);}return null;};}function patchUpdates(_0x9e8322){return function(_0x3fe970){try{jsonpatch[_0x5bf2('0x24')](_0x3fe970,_0x9e8322,!![]);}catch(_0x4b96df){return BPromise[_0x5bf2('0x25')](_0x4b96df);}return _0x3fe970[_0x5bf2('0x26')]();};}function saveUpdates(_0x4cba7a,_0x429fdc){return function(_0x255449){if(_0x255449){return _0x255449[_0x5bf2('0x27')](_0x4cba7a)[_0x5bf2('0x28')](function(_0x326816){return _0x326816;});}return null;};}function removeEntity(_0x5a8897,_0x157b33){return function(_0x5a35e0){if(_0x5a35e0){return _0x5a35e0[_0x5bf2('0x29')]()[_0x5bf2('0x28')](function(){_0x5a8897[_0x5bf2('0x1c')](0xcc)[_0x5bf2('0x1b')]();});}};}function handleEntityNotFound(_0xbe6f98,_0x197094){return function(_0x25f5ee){if(!_0x25f5ee){_0xbe6f98['sendStatus'](0x194);}return _0x25f5ee;};}function handleError(_0x585e5a,_0x84bc57){_0x84bc57=_0x84bc57||0x1f4;return function(_0x2cc066){logger[_0x5bf2('0x2a')](_0x2cc066['stack']);if(_0x2cc066[_0x5bf2('0x2b')]){delete _0x2cc066[_0x5bf2('0x2b')];}_0x585e5a[_0x5bf2('0x1c')](_0x84bc57)[_0x5bf2('0x2c')](_0x2cc066);};}exports[_0x5bf2('0x2d')]=function(_0x4c1b42,_0x2ab3fb){var _0x22aca2={},_0x33a309={},_0x37a996={'count':0x0,'rows':[]};var _0x4bb412=_[_0x5bf2('0x2e')](db[_0x5bf2('0x2f')]['rawAttributes'],function(_0x1c9a5f){return{'name':_0x1c9a5f[_0x5bf2('0x30')],'type':_0x1c9a5f[_0x5bf2('0x31')][_0x5bf2('0x32')]};});_0x33a309[_0x5bf2('0x33')]=_[_0x5bf2('0x2e')](_0x4bb412,'name');_0x33a309['query']=_[_0x5bf2('0x34')](_0x4c1b42[_0x5bf2('0x35')]);_0x33a309[_0x5bf2('0x36')]=_[_0x5bf2('0x37')](_0x33a309[_0x5bf2('0x33')],_0x33a309[_0x5bf2('0x35')]);_0x22aca2[_0x5bf2('0x38')]=_[_0x5bf2('0x37')](_0x33a309[_0x5bf2('0x33')],qs['fields'](_0x4c1b42[_0x5bf2('0x35')][_0x5bf2('0x39')]));_0x22aca2[_0x5bf2('0x38')]=_0x22aca2[_0x5bf2('0x38')][_0x5bf2('0x3a')]?_0x22aca2[_0x5bf2('0x38')]:_0x33a309[_0x5bf2('0x33')];if(!_0x4c1b42['query'][_0x5bf2('0x3b')](_0x5bf2('0x3c'))){_0x22aca2[_0x5bf2('0x1f')]=qs[_0x5bf2('0x1f')](_0x4c1b42[_0x5bf2('0x35')][_0x5bf2('0x1f')]);_0x22aca2[_0x5bf2('0x20')]=qs[_0x5bf2('0x20')](_0x4c1b42[_0x5bf2('0x35')]['offset']);}_0x22aca2[_0x5bf2('0x3d')]=qs['sort'](_0x4c1b42[_0x5bf2('0x35')][_0x5bf2('0x3e')]);_0x22aca2[_0x5bf2('0x3f')]=qs['filters'](_['pick'](_0x4c1b42['query'],_0x33a309[_0x5bf2('0x36')]),_0x4bb412);if(_0x4c1b42[_0x5bf2('0x35')][_0x5bf2('0x40')]){_0x22aca2[_0x5bf2('0x3f')]=_[_0x5bf2('0x41')](_0x22aca2['where'],{'$or':_[_0x5bf2('0x2e')](_0x4bb412,function(_0x4ab340){if(_0x4ab340['type']!==_0x5bf2('0x42')){var _0x309c22={};_0x309c22[_0x4ab340[_0x5bf2('0x2b')]]={'$like':'%'+_0x4c1b42[_0x5bf2('0x35')][_0x5bf2('0x40')]+'%'};return _0x309c22;}})});}_0x22aca2=_['merge']({},_0x22aca2,_0x4c1b42[_0x5bf2('0x43')]);var _0x4c2549={'where':_0x22aca2['where']};return db[_0x5bf2('0x2f')]['count'](_0x4c2549)[_0x5bf2('0x28')](function(_0x301172){_0x37a996[_0x5bf2('0x21')]=_0x301172;if(_0x4c1b42['query']['includeAll']){_0x22aca2[_0x5bf2('0x44')]=[{'all':!![]}];}return db[_0x5bf2('0x2f')]['findAll'](_0x22aca2);})[_0x5bf2('0x28')](function(_0x2f5021){_0x37a996[_0x5bf2('0x45')]=_0x2f5021;return _0x37a996;})[_0x5bf2('0x28')](respondWithFilteredResult(_0x2ab3fb,_0x22aca2))[_0x5bf2('0x46')](handleError(_0x2ab3fb,null));};exports[_0x5bf2('0x47')]=function(_0x5c9073,_0x308989){var _0xa241a1={'raw':!![],'where':{'id':_0x5c9073['params']['id']}},_0x2f26b3={};_0x2f26b3[_0x5bf2('0x33')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x2f26b3[_0x5bf2('0x35')]=_[_0x5bf2('0x34')](_0x5c9073['query']);_0x2f26b3['filters']=_[_0x5bf2('0x37')](_0x2f26b3[_0x5bf2('0x33')],_0x2f26b3[_0x5bf2('0x35')]);_0xa241a1['attributes']=_['intersection'](_0x2f26b3[_0x5bf2('0x33')],qs[_0x5bf2('0x39')](_0x5c9073[_0x5bf2('0x35')]['fields']));_0xa241a1[_0x5bf2('0x38')]=_0xa241a1[_0x5bf2('0x38')][_0x5bf2('0x3a')]?_0xa241a1['attributes']:_0x2f26b3[_0x5bf2('0x33')];if(_0x5c9073[_0x5bf2('0x35')][_0x5bf2('0x48')]){_0xa241a1[_0x5bf2('0x44')]=[{'all':!![]}];}_0xa241a1=_['merge']({},_0xa241a1,_0x5c9073[_0x5bf2('0x43')]);return db[_0x5bf2('0x2f')]['find'](_0xa241a1)['then'](handleEntityNotFound(_0x308989,null))[_0x5bf2('0x28')](respondWithResult(_0x308989,null))[_0x5bf2('0x46')](handleError(_0x308989,null));};exports[_0x5bf2('0x27')]=function(_0x3df814,_0x441029){if(_0x3df814[_0x5bf2('0x49')]['id']){delete _0x3df814[_0x5bf2('0x49')]['id'];}return db[_0x5bf2('0x2f')]['find']({'where':{'id':_0x3df814[_0x5bf2('0x4a')]['id']}})[_0x5bf2('0x28')](handleEntityNotFound(_0x441029,null))['then'](saveUpdates(_0x3df814[_0x5bf2('0x49')],null))[_0x5bf2('0x28')](respondWithResult(_0x441029,null))[_0x5bf2('0x46')](handleError(_0x441029,null));};exports[_0x5bf2('0x29')]=function(_0x5220b7,_0x444129){return db[_0x5bf2('0x2f')][_0x5bf2('0x4b')]({'where':{'id':_0x5220b7['params']['id']}})[_0x5bf2('0x28')](handleEntityNotFound(_0x444129,null))[_0x5bf2('0x28')](removeEntity(_0x444129,null))[_0x5bf2('0x46')](handleError(_0x444129,null));};exports[_0x5bf2('0x4c')]=function(_0x225bc5,_0x2c1b7c){return db[_0x5bf2('0x2f')][_0x5bf2('0x4c')]()[_0x5bf2('0x28')](respondWithResult(_0x2c1b7c,null))[_0x5bf2('0x46')](handleError(_0x2c1b7c,null));}; \ No newline at end of file +var _0x983f=['fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','body','find','describe','zip-dir','request-promise','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','destroy','then','end','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x3c8d8d,_0x232554){var _0x8a2586=function(_0x178e06){while(--_0x178e06){_0x3c8d8d['push'](_0x3c8d8d['shift']());}};_0x8a2586(++_0x232554);}(_0x983f,0xe3));var _0xf983=function(_0x1e894a,_0x4202da){_0x1e894a=_0x1e894a-0x0;var _0x53539e=_0x983f[_0x1e894a];return _0x53539e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf983('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf983('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf983('0x2'));var sox=require(_0xf983('0x3'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf983('0x4'));var _=require(_0xf983('0x5'));var squel=require('squel');var crypto=require(_0xf983('0x6'));var jsforce=require(_0xf983('0x7'));var deskjs=require(_0xf983('0x8'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf983('0x9'));var authService=require(_0xf983('0xa'));var qs=require('../../components/parsers/qs');var as=require(_0xf983('0xb'));var hardwareService=require(_0xf983('0xc'));var logger=require('../../config/logger')(_0xf983('0xd'));var utils=require(_0xf983('0xe'));var config=require(_0xf983('0xf'));var licenseUtil=require(_0xf983('0x10'));var db=require(_0xf983('0x11'))['db'];function respondWithStatusCode(_0x1b6658,_0x1dc754){_0x1dc754=_0x1dc754||0xcc;return function(_0x3ca911){if(_0x3ca911){return _0x1b6658[_0xf983('0x12')](_0x1dc754);}return _0x1b6658[_0xf983('0x13')](_0x1dc754)['end']();};}function respondWithResult(_0x5b2ffa,_0x228b5e){_0x228b5e=_0x228b5e||0xc8;return function(_0x2a325d){if(_0x2a325d){return _0x5b2ffa['status'](_0x228b5e)['json'](_0x2a325d);}};}function respondWithFilteredResult(_0x20fe3c,_0x399737){return function(_0x4810d7){if(_0x4810d7){var _0x58e3cc=typeof _0x399737[_0xf983('0x14')]===_0xf983('0x15')&&typeof _0x399737[_0xf983('0x16')]==='undefined';var _0x173705=_0x4810d7['count'];var _0x34a456=_0x58e3cc?0x0:_0x399737['offset'];var _0x27bada=_0x58e3cc?_0x4810d7[_0xf983('0x17')]:_0x399737[_0xf983('0x14')]+_0x399737['limit'];var _0x3215cc;if(_0x27bada>=_0x173705){_0x27bada=_0x173705;_0x3215cc=0xc8;}else{_0x3215cc=0xce;}_0x20fe3c[_0xf983('0x13')](_0x3215cc);return _0x20fe3c[_0xf983('0x18')](_0xf983('0x19'),_0x34a456+'-'+_0x27bada+'/'+_0x173705)[_0xf983('0x1a')](_0x4810d7);}return null;};}function patchUpdates(_0x136ac1){return function(_0x5013ff){try{jsonpatch['apply'](_0x5013ff,_0x136ac1,!![]);}catch(_0x1d8dd0){return BPromise[_0xf983('0x1b')](_0x1d8dd0);}return _0x5013ff['save']();};}function saveUpdates(_0x193484,_0x23e5b6){return function(_0x565308){if(_0x565308){return _0x565308[_0xf983('0x1c')](_0x193484)['then'](function(_0x2799b8){return _0x2799b8;});}return null;};}function removeEntity(_0x4f29bf,_0x4dc38a){return function(_0xc72bc2){if(_0xc72bc2){return _0xc72bc2[_0xf983('0x1d')]()[_0xf983('0x1e')](function(){_0x4f29bf[_0xf983('0x13')](0xcc)[_0xf983('0x1f')]();});}};}function handleEntityNotFound(_0x4aa20a,_0x3255ed){return function(_0x31fa51){if(!_0x31fa51){_0x4aa20a['sendStatus'](0x194);}return _0x31fa51;};}function handleError(_0x13bdd3,_0x419bb0){_0x419bb0=_0x419bb0||0x1f4;return function(_0x4e4b46){logger[_0xf983('0x20')](_0x4e4b46[_0xf983('0x21')]);if(_0x4e4b46[_0xf983('0x22')]){delete _0x4e4b46['name'];}_0x13bdd3[_0xf983('0x13')](_0x419bb0)[_0xf983('0x23')](_0x4e4b46);};}exports[_0xf983('0x24')]=function(_0x214db0,_0x1e7d9d){var _0x10aa65={},_0x166822={},_0x4af419={'count':0x0,'rows':[]};var _0x4e0678=_[_0xf983('0x25')](db[_0xf983('0x26')][_0xf983('0x27')],function(_0x31cd6c){return{'name':_0x31cd6c[_0xf983('0x28')],'type':_0x31cd6c[_0xf983('0x29')][_0xf983('0x2a')]};});_0x166822[_0xf983('0x2b')]=_[_0xf983('0x25')](_0x4e0678,_0xf983('0x22'));_0x166822[_0xf983('0x2c')]=_[_0xf983('0x2d')](_0x214db0[_0xf983('0x2c')]);_0x166822[_0xf983('0x2e')]=_[_0xf983('0x2f')](_0x166822['model'],_0x166822[_0xf983('0x2c')]);_0x10aa65[_0xf983('0x30')]=_[_0xf983('0x2f')](_0x166822[_0xf983('0x2b')],qs[_0xf983('0x31')](_0x214db0[_0xf983('0x2c')][_0xf983('0x31')]));_0x10aa65[_0xf983('0x30')]=_0x10aa65[_0xf983('0x30')]['length']?_0x10aa65[_0xf983('0x30')]:_0x166822['model'];if(!_0x214db0[_0xf983('0x2c')][_0xf983('0x32')](_0xf983('0x33'))){_0x10aa65[_0xf983('0x16')]=qs[_0xf983('0x16')](_0x214db0[_0xf983('0x2c')][_0xf983('0x16')]);_0x10aa65[_0xf983('0x14')]=qs[_0xf983('0x14')](_0x214db0[_0xf983('0x2c')][_0xf983('0x14')]);}_0x10aa65[_0xf983('0x34')]=qs[_0xf983('0x35')](_0x214db0[_0xf983('0x2c')][_0xf983('0x35')]);_0x10aa65[_0xf983('0x36')]=qs[_0xf983('0x2e')](_['pick'](_0x214db0[_0xf983('0x2c')],_0x166822[_0xf983('0x2e')]),_0x4e0678);if(_0x214db0['query'][_0xf983('0x37')]){_0x10aa65[_0xf983('0x36')]=_['merge'](_0x10aa65[_0xf983('0x36')],{'$or':_[_0xf983('0x25')](_0x4e0678,function(_0x32b921){if(_0x32b921[_0xf983('0x29')]!=='VIRTUAL'){var _0x254835={};_0x254835[_0x32b921['name']]={'$like':'%'+_0x214db0['query'][_0xf983('0x37')]+'%'};return _0x254835;}})});}_0x10aa65=_[_0xf983('0x38')]({},_0x10aa65,_0x214db0[_0xf983('0x39')]);var _0x47f58b={'where':_0x10aa65[_0xf983('0x36')]};return db[_0xf983('0x26')][_0xf983('0x17')](_0x47f58b)[_0xf983('0x1e')](function(_0x1cf849){_0x4af419['count']=_0x1cf849;if(_0x214db0[_0xf983('0x2c')][_0xf983('0x3a')]){_0x10aa65[_0xf983('0x3b')]=[{'all':!![]}];}return db[_0xf983('0x26')][_0xf983('0x3c')](_0x10aa65);})[_0xf983('0x1e')](function(_0x5c2701){_0x4af419[_0xf983('0x3d')]=_0x5c2701;return _0x4af419;})[_0xf983('0x1e')](respondWithFilteredResult(_0x1e7d9d,_0x10aa65))[_0xf983('0x3e')](handleError(_0x1e7d9d,null));};exports[_0xf983('0x3f')]=function(_0x2027f5,_0x4e3d03){var _0x1f0a80={'raw':!![],'where':{'id':_0x2027f5[_0xf983('0x40')]['id']}},_0x4c071f={};_0x4c071f['model']=_['keys'](db[_0xf983('0x26')][_0xf983('0x27')]);_0x4c071f[_0xf983('0x2c')]=_[_0xf983('0x2d')](_0x2027f5[_0xf983('0x2c')]);_0x4c071f[_0xf983('0x2e')]=_[_0xf983('0x2f')](_0x4c071f[_0xf983('0x2b')],_0x4c071f['query']);_0x1f0a80['attributes']=_[_0xf983('0x2f')](_0x4c071f[_0xf983('0x2b')],qs[_0xf983('0x31')](_0x2027f5[_0xf983('0x2c')][_0xf983('0x31')]));_0x1f0a80['attributes']=_0x1f0a80['attributes'][_0xf983('0x41')]?_0x1f0a80[_0xf983('0x30')]:_0x4c071f[_0xf983('0x2b')];if(_0x2027f5[_0xf983('0x2c')][_0xf983('0x3a')]){_0x1f0a80['include']=[{'all':!![]}];}_0x1f0a80=_[_0xf983('0x38')]({},_0x1f0a80,_0x2027f5[_0xf983('0x39')]);return db['CmHopperBlack']['find'](_0x1f0a80)[_0xf983('0x1e')](handleEntityNotFound(_0x4e3d03,null))[_0xf983('0x1e')](respondWithResult(_0x4e3d03,null))[_0xf983('0x3e')](handleError(_0x4e3d03,null));};exports[_0xf983('0x1c')]=function(_0x634adc,_0x21100e){if(_0x634adc[_0xf983('0x42')]['id']){delete _0x634adc[_0xf983('0x42')]['id'];}return db[_0xf983('0x26')][_0xf983('0x43')]({'where':{'id':_0x634adc[_0xf983('0x40')]['id']}})[_0xf983('0x1e')](handleEntityNotFound(_0x21100e,null))[_0xf983('0x1e')](saveUpdates(_0x634adc[_0xf983('0x42')],null))[_0xf983('0x1e')](respondWithResult(_0x21100e,null))[_0xf983('0x3e')](handleError(_0x21100e,null));};exports['destroy']=function(_0x2527cb,_0x4dd365){return db[_0xf983('0x26')][_0xf983('0x43')]({'where':{'id':_0x2527cb[_0xf983('0x40')]['id']}})[_0xf983('0x1e')](handleEntityNotFound(_0x4dd365,null))['then'](removeEntity(_0x4dd365,null))[_0xf983('0x3e')](handleError(_0x4dd365,null));};exports[_0xf983('0x44')]=function(_0x291901,_0x2f1fe0){return db[_0xf983('0x26')][_0xf983('0x44')]()[_0xf983('0x1e')](respondWithResult(_0x2f1fe0,null))[_0xf983('0x3e')](handleError(_0x2f1fe0,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index d606dae..42b3037 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 _0x7f92=['./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x16c04e,_0x577135){var _0xebca7=function(_0x4dcd66){while(--_0x4dcd66){_0x16c04e['push'](_0x16c04e['shift']());}};_0xebca7(++_0x577135);}(_0x7f92,0xae));var _0x27f9=function(_0x51958b,_0x3cd9d4){_0x51958b=_0x51958b-0x0;var _0x4e4929=_0x7f92[_0x51958b];return _0x4e4929;};'use strict';var _=require(_0x27f9('0x0'));var util=require(_0x27f9('0x1'));var logger=require('../../config/logger')(_0x27f9('0x2'));var moment=require('moment');var BPromise=require(_0x27f9('0x3'));var rp=require(_0x27f9('0x4'));var fs=require('fs');var path=require(_0x27f9('0x5'));var rimraf=require(_0x27f9('0x6'));var config=require(_0x27f9('0x7'));var attributes=require(_0x27f9('0x8'));module[_0x27f9('0x9')]=function(_0x4bf23d,_0x4f2496){return _0x4bf23d[_0x27f9('0xa')](_0x27f9('0xb'),attributes,{'tableName':_0x27f9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c7d=['../../config/logger','api','request-promise','rimraf','../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2c7d,0x12a));var _0xd2c7=function(_0x12448c,_0x4b049c){_0x12448c=_0x12448c-0x0;var _0x28fd98=_0x2c7d[_0x12448c];return _0x28fd98;};'use strict';var _=require(_0xd2c7('0x0'));var util=require(_0xd2c7('0x1'));var logger=require(_0xd2c7('0x2'))(_0xd2c7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd2c7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd2c7('0x5'));var config=require(_0xd2c7('0x6'));var attributes=require(_0xd2c7('0x7'));module['exports']=function(_0x5e5f27,_0x4d006a){return _0x5e5f27[_0xd2c7('0x8')](_0xd2c7('0x9'),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 d1de2ee..a887b71 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 _0xed3d=['catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','include','map','model','then','UpdateCmHopperBlack','update','body','raw','destroy','DestroyCmHopperBlack','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xed3d,0x1d8));var _0xded3=function(_0x58558f,_0x19faa9){_0x58558f=_0x58558f-0x0;var _0x4d3230=_0xed3d[_0x58558f];return _0x4d3230;};'use strict';var _=require('lodash');var util=require(_0xded3('0x0'));var moment=require(_0xded3('0x1'));var BPromise=require(_0xded3('0x2'));var rs=require(_0xded3('0x3'));var fs=require('fs');var Redis=require(_0xded3('0x4'));var db=require(_0xded3('0x5'))['db'];var utils=require(_0xded3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xded3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xded3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10299f,_0x318498,_0x5b0baa){return new BPromise(function(_0x4cb14b,_0x10313d){return client[_0xded3('0x9')](_0x10299f,_0x5b0baa)['then'](function(_0x2f850b){logger[_0xded3('0xa')](_0xded3('0xb'),_0x318498,_0xded3('0xc'));logger[_0xded3('0xd')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x318498,'request\x20sent',JSON[_0xded3('0xe')](_0x2f850b));if(_0x2f850b[_0xded3('0xf')]){if(_0x2f850b[_0xded3('0xf')]['code']===0x1f4){logger[_0xded3('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x318498,_0x2f850b[_0xded3('0xf')][_0xded3('0x10')]);return _0x10313d(_0x2f850b[_0xded3('0xf')][_0xded3('0x10')]);}logger[_0xded3('0xf')](_0xded3('0xb'),_0x318498,_0x2f850b[_0xded3('0xf')]['message']);return _0x4cb14b(_0x2f850b[_0xded3('0xf')]['message']);}else{logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x318498,_0xded3('0xc'));_0x4cb14b(_0x2f850b[_0xded3('0x11')][_0xded3('0x10')]);}})[_0xded3('0x12')](function(_0x211514){logger[_0xded3('0xf')](_0xded3('0xb'),_0x318498,_0x211514);_0x10313d(_0x211514);});});}exports[_0xded3('0x13')]=function(_0x28f8e1){var _0x5112cf=this;return new Promise(function(_0x141526,_0x52ef23){return db[_0xded3('0x14')][_0xded3('0x15')]({'raw':_0x28f8e1['options']?_0x28f8e1[_0xded3('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x28f8e1[_0xded3('0x16')]?_0x28f8e1[_0xded3('0x16')][_0xded3('0x17')]||null:null,'attributes':_0x28f8e1[_0xded3('0x16')]?_0x28f8e1[_0xded3('0x16')][_0xded3('0x18')]||null:null,'limit':_0x28f8e1['options']?_0x28f8e1[_0xded3('0x16')]['limit']||null:null,'include':_0x28f8e1[_0xded3('0x16')]?_0x28f8e1[_0xded3('0x16')][_0xded3('0x19')]?_[_0xded3('0x1a')](_0x28f8e1[_0xded3('0x16')][_0xded3('0x19')],function(_0x4e9aa7){return{'model':db[_0x4e9aa7[_0xded3('0x1b')]],'as':_0x4e9aa7['as'],'attributes':_0x4e9aa7[_0xded3('0x18')],'include':_0x4e9aa7[_0xded3('0x19')]?_['map'](_0x4e9aa7[_0xded3('0x19')],function(_0x499e7a){return{'model':db[_0x499e7a[_0xded3('0x1b')]],'as':_0x499e7a['as'],'attributes':_0x499e7a[_0xded3('0x18')],'include':_0x499e7a[_0xded3('0x19')]?_['map'](_0x499e7a[_0xded3('0x19')],function(_0x43e4de){return{'model':db[_0x43e4de['model']],'as':_0x43e4de['as'],'attributes':_0x43e4de['attributes']};}):[]};}):[]};}):[]:[]})[_0xded3('0x1c')](function(_0x1009c2){logger[_0xded3('0xa')](_0xded3('0x13'),_0x28f8e1);logger[_0xded3('0xd')](_0xded3('0x13'),_0x28f8e1,JSON[_0xded3('0xe')](_0x1009c2));_0x141526(_0x1009c2);})[_0xded3('0x12')](function(_0x2a2182){logger[_0xded3('0xf')](_0xded3('0x13'),_0x2a2182[_0xded3('0x10')],_0x28f8e1);_0x52ef23(_0x5112cf[_0xded3('0xf')](0x1f4,_0x2a2182[_0xded3('0x10')]));});});};exports[_0xded3('0x1d')]=function(_0x1c1181){var _0x38b6b6=this;return new Promise(function(_0x44b0ce,_0x3a67e0){return db[_0xded3('0x14')][_0xded3('0x1e')](_0x1c1181[_0xded3('0x1f')],{'raw':_0x1c1181[_0xded3('0x16')]?_0x1c1181[_0xded3('0x16')][_0xded3('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c1181[_0xded3('0x16')]?_0x1c1181[_0xded3('0x16')][_0xded3('0x17')]||null:null,'attributes':_0x1c1181[_0xded3('0x16')]?_0x1c1181[_0xded3('0x16')][_0xded3('0x18')]||null:null,'limit':_0x1c1181[_0xded3('0x16')]?_0x1c1181[_0xded3('0x16')]['limit']||null:null})[_0xded3('0x1c')](function(_0x3c93bf){logger[_0xded3('0xa')](_0xded3('0x1d'),_0x1c1181);logger[_0xded3('0xd')](_0xded3('0x1d'),_0x1c1181,JSON[_0xded3('0xe')](_0x3c93bf));_0x44b0ce(_0x3c93bf);})[_0xded3('0x12')](function(_0x2980c2){logger[_0xded3('0xf')](_0xded3('0x1d'),_0x2980c2[_0xded3('0x10')],_0x1c1181);_0x3a67e0(_0x38b6b6[_0xded3('0xf')](0x1f4,_0x2980c2[_0xded3('0x10')]));});});};exports['DestroyCmHopperBlack']=function(_0x5027c3){var _0x443247=this;return new Promise(function(_0x41fb45,_0x3eda8b){return db['CmHopperBlack'][_0xded3('0x21')]({'where':_0x5027c3[_0xded3('0x16')]?_0x5027c3[_0xded3('0x16')][_0xded3('0x17')]||null:null})[_0xded3('0x1c')](function(_0x23de96){logger['info'](_0xded3('0x22'),_0x5027c3);logger[_0xded3('0xd')](_0xded3('0x22'),_0x5027c3,JSON['stringify'](_0x23de96));_0x41fb45(_0x23de96);})[_0xded3('0x12')](function(_0x47e203){logger[_0xded3('0xf')](_0xded3('0x22'),_0x47e203['message'],_0x5027c3);_0x3eda8b(_0x443247[_0xded3('0xf')](0x1f4,_0x47e203[_0xded3('0x10')]));});});}; \ No newline at end of file +var _0xc9e3=['jayson/promise','http','request','info','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','CmHopperBlack,\x20%s,\x20%s','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','include','map','model','attributes','then','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1d8126,_0x2831c6){var _0x356ac7=function(_0x264ee8){while(--_0x264ee8){_0x1d8126['push'](_0x1d8126['shift']());}};_0x356ac7(++_0x2831c6);}(_0xc9e3,0xa8));var _0x3c9e=function(_0x5024ef,_0x31cb9a){_0x5024ef=_0x5024ef-0x0;var _0xd618e3=_0xc9e3[_0x5024ef];return _0xd618e3;};'use strict';var _=require('lodash');var util=require(_0x3c9e('0x0'));var moment=require(_0x3c9e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c9e('0x2'));var db=require(_0x3c9e('0x3'))['db'];var utils=require(_0x3c9e('0x4'));var logger=require('../../config/logger')(_0x3c9e('0x5'));var config=require(_0x3c9e('0x6'));var jayson=require(_0x3c9e('0x7'));var client=jayson['client'][_0x3c9e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b6007,_0x2080d6,_0x6bbf18){return new BPromise(function(_0x5c42aa,_0x55ad24){return client[_0x3c9e('0x9')](_0x5b6007,_0x6bbf18)['then'](function(_0x3cbe96){logger[_0x3c9e('0xa')]('CmHopperBlack,\x20%s,\x20%s',_0x2080d6,'request\x20sent');logger[_0x3c9e('0xb')](_0x3c9e('0xc'),_0x2080d6,_0x3c9e('0xd'),JSON[_0x3c9e('0xe')](_0x3cbe96));if(_0x3cbe96['error']){if(_0x3cbe96['error'][_0x3c9e('0xf')]===0x1f4){logger[_0x3c9e('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x2080d6,_0x3cbe96['error'][_0x3c9e('0x11')]);return _0x55ad24(_0x3cbe96[_0x3c9e('0x10')][_0x3c9e('0x11')]);}logger[_0x3c9e('0x10')](_0x3c9e('0x12'),_0x2080d6,_0x3cbe96[_0x3c9e('0x10')][_0x3c9e('0x11')]);return _0x5c42aa(_0x3cbe96[_0x3c9e('0x10')][_0x3c9e('0x11')]);}else{logger[_0x3c9e('0xa')](_0x3c9e('0x12'),_0x2080d6,_0x3c9e('0xd'));_0x5c42aa(_0x3cbe96['result'][_0x3c9e('0x11')]);}})[_0x3c9e('0x13')](function(_0x3f030c){logger[_0x3c9e('0x10')](_0x3c9e('0x12'),_0x2080d6,_0x3f030c);_0x55ad24(_0x3f030c);});});}exports[_0x3c9e('0x14')]=function(_0x5dc7ae){var _0x2d3753=this;return new Promise(function(_0x2cdd73,_0x18b6c2){return db[_0x3c9e('0x15')][_0x3c9e('0x16')]({'raw':_0x5dc7ae[_0x3c9e('0x17')]?_0x5dc7ae[_0x3c9e('0x17')][_0x3c9e('0x18')]===undefined?!![]:![]:!![],'where':_0x5dc7ae[_0x3c9e('0x17')]?_0x5dc7ae[_0x3c9e('0x17')][_0x3c9e('0x19')]||null:null,'attributes':_0x5dc7ae['options']?_0x5dc7ae[_0x3c9e('0x17')]['attributes']||null:null,'limit':_0x5dc7ae[_0x3c9e('0x17')]?_0x5dc7ae[_0x3c9e('0x17')][_0x3c9e('0x1a')]||null:null,'include':_0x5dc7ae[_0x3c9e('0x17')]?_0x5dc7ae[_0x3c9e('0x17')][_0x3c9e('0x1b')]?_[_0x3c9e('0x1c')](_0x5dc7ae[_0x3c9e('0x17')][_0x3c9e('0x1b')],function(_0x59b53b){return{'model':db[_0x59b53b[_0x3c9e('0x1d')]],'as':_0x59b53b['as'],'attributes':_0x59b53b['attributes'],'include':_0x59b53b[_0x3c9e('0x1b')]?_[_0x3c9e('0x1c')](_0x59b53b[_0x3c9e('0x1b')],function(_0x1aa293){return{'model':db[_0x1aa293['model']],'as':_0x1aa293['as'],'attributes':_0x1aa293[_0x3c9e('0x1e')],'include':_0x1aa293[_0x3c9e('0x1b')]?_[_0x3c9e('0x1c')](_0x1aa293[_0x3c9e('0x1b')],function(_0x4d5ccb){return{'model':db[_0x4d5ccb[_0x3c9e('0x1d')]],'as':_0x4d5ccb['as'],'attributes':_0x4d5ccb[_0x3c9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3c9e('0x1f')](function(_0x118c6e){logger[_0x3c9e('0xa')](_0x3c9e('0x14'),_0x5dc7ae);logger[_0x3c9e('0xb')](_0x3c9e('0x14'),_0x5dc7ae,JSON[_0x3c9e('0xe')](_0x118c6e));_0x2cdd73(_0x118c6e);})[_0x3c9e('0x13')](function(_0xbb89e9){logger[_0x3c9e('0x10')]('GetCmHopperBlack',_0xbb89e9[_0x3c9e('0x11')],_0x5dc7ae);_0x18b6c2(_0x2d3753[_0x3c9e('0x10')](0x1f4,_0xbb89e9[_0x3c9e('0x11')]));});});};exports[_0x3c9e('0x20')]=function(_0x226975){var _0x32e6f3=this;return new Promise(function(_0x30ed9c,_0x2a2825){return db[_0x3c9e('0x15')]['update'](_0x226975['body'],{'raw':_0x226975['options']?_0x226975[_0x3c9e('0x17')][_0x3c9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x226975[_0x3c9e('0x17')]?_0x226975[_0x3c9e('0x17')][_0x3c9e('0x19')]||null:null,'attributes':_0x226975[_0x3c9e('0x17')]?_0x226975[_0x3c9e('0x17')][_0x3c9e('0x1e')]||null:null,'limit':_0x226975[_0x3c9e('0x17')]?_0x226975[_0x3c9e('0x17')][_0x3c9e('0x1a')]||null:null})[_0x3c9e('0x1f')](function(_0xa8f781){logger[_0x3c9e('0xa')](_0x3c9e('0x20'),_0x226975);logger[_0x3c9e('0xb')]('UpdateCmHopperBlack',_0x226975,JSON['stringify'](_0xa8f781));_0x30ed9c(_0xa8f781);})[_0x3c9e('0x13')](function(_0x21c34c){logger['error'](_0x3c9e('0x20'),_0x21c34c[_0x3c9e('0x11')],_0x226975);_0x2a2825(_0x32e6f3['error'](0x1f4,_0x21c34c[_0x3c9e('0x11')]));});});};exports[_0x3c9e('0x21')]=function(_0x274cdb){var _0x59ad97=this;return new Promise(function(_0x264bac,_0x545893){return db[_0x3c9e('0x15')][_0x3c9e('0x22')]({'where':_0x274cdb[_0x3c9e('0x17')]?_0x274cdb[_0x3c9e('0x17')][_0x3c9e('0x19')]||null:null})[_0x3c9e('0x1f')](function(_0x4725a6){logger[_0x3c9e('0xa')](_0x3c9e('0x21'),_0x274cdb);logger[_0x3c9e('0xb')](_0x3c9e('0x21'),_0x274cdb,JSON[_0x3c9e('0xe')](_0x4725a6));_0x264bac(_0x4725a6);})['catch'](function(_0xc2e86){logger['error'](_0x3c9e('0x21'),_0xc2e86[_0x3c9e('0x11')],_0x274cdb);_0x545893(_0x59ad97[_0x3c9e('0x10')](0x1f4,_0xc2e86[_0x3c9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 644bdb5..a3185b1 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 _0xd046=['isAuthenticated','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','./cmHopperBlack.controller','index','get','describe','show','/:id'];(function(_0x5d860f,_0x467498){var _0x236490=function(_0x5e045c){while(--_0x5e045c){_0x5d860f['push'](_0x5d860f['shift']());}};_0x236490(++_0x467498);}(_0xd046,0x129));var _0x6d04=function(_0x1cb3ba,_0x240bf3){_0x1cb3ba=_0x1cb3ba-0x0;var _0xff6b4b=_0xd046[_0x1cb3ba];return _0xff6b4b;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d04('0x4'));var config=require('../../config/environment');var controller=require(_0x6d04('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6d04('0x6')]);router[_0x6d04('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x6d04('0x8')]);router[_0x6d04('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router['put'](_0x6d04('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6d04('0xa'),auth[_0x6d04('0xb')](),controller[_0x6d04('0xc')]);module[_0x6d04('0xd')]=router; \ No newline at end of file +var _0x9fd4=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id'];(function(_0x46efe9,_0x465611){var _0x3eb009=function(_0x3a0ec6){while(--_0x3a0ec6){_0x46efe9['push'](_0x46efe9['shift']());}};_0x3eb009(++_0x465611);}(_0x9fd4,0x16c));var _0x49fd=function(_0x1f68e6,_0xe62604){_0x1f68e6=_0x1f68e6-0x0;var _0x28a862=_0x9fd4[_0x1f68e6];return _0x28a862;};'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('./cmHopperBlack.controller');router[_0x49fd('0x9')]('/',auth[_0x49fd('0xa')](),controller[_0x49fd('0xb')]);router[_0x49fd('0x9')]('/describe',auth[_0x49fd('0xa')](),controller[_0x49fd('0xc')]);router[_0x49fd('0x9')](_0x49fd('0xd'),auth[_0x49fd('0xa')](),controller['show']);router[_0x49fd('0xe')](_0x49fd('0xd'),auth[_0x49fd('0xa')](),controller[_0x49fd('0xf')]);router[_0x49fd('0x10')](_0x49fd('0xd'),auth[_0x49fd('0xa')](),controller['destroy']);module[_0x49fd('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 8c014bf..ff4e873 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 _0x2c20=['INTEGER','STRING','DATE','endtime','diff','BOOLEAN','sequelize','moment','exports'];(function(_0x1250b9,_0x24f4cc){var _0x3ebe8d=function(_0x108fc6){while(--_0x108fc6){_0x1250b9['push'](_0x1250b9['shift']());}};_0x3ebe8d(++_0x24f4cc);}(_0x2c20,0x9f));var _0x02c2=function(_0x151e4f,_0x45b100){_0x151e4f=_0x151e4f-0x0;var _0x3a7128=_0x2c20[_0x151e4f];return _0x3a7128;};'use strict';var Sequelize=require(_0x02c2('0x0'));var moment=require(_0x02c2('0x1'));module[_0x02c2('0x2')]={'state':{'type':Sequelize[_0x02c2('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x02c2('0x4')]},'scheduledat':{'type':Sequelize[_0x02c2('0x5')]},'countbusyretry':{'type':Sequelize[_0x02c2('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x02c2('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x02c2('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x02c2('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x02c2('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x02c2('0x4')]},'originatecalleridname':{'type':Sequelize[_0x02c2('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x02c2('0x4')]},'starttime':{'type':Sequelize[_0x02c2('0x5')]},'responsetime':{'type':Sequelize[_0x02c2('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x02c2('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x02c2('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x02c2('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x02c2('0x4')]},'campaigntype':{'type':Sequelize[_0x02c2('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x02c2('0x4')]},'disposition':{'type':Sequelize[_0x02c2('0x4')]},'secondDisposition':{'type':Sequelize[_0x02c2('0x4')]},'thirdDisposition':{'type':Sequelize[_0x02c2('0x4')]},'dispositionat':{'type':Sequelize[_0x02c2('0x5')],'set':function(_0x59c8c4){var _0x460e81=this['getDataValue'](_0x02c2('0x6'));if(_0x460e81&&_0x59c8c4){this['setDataValue']('followuptime',moment(_0x59c8c4)[_0x02c2('0x7')](moment(_0x460e81),'seconds'));}}},'amd':{'type':Sequelize[_0x02c2('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0x02c2('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x02c2('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x02c2('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x02c2('0x5')]},'deleted':{'type':Sequelize[_0x02c2('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x02c2('0x5')]},'recallme':{'type':Sequelize[_0x02c2('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x02c2('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x02c2('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x02c2('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x02c2('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc6d1=['STRING','DATE','endtime','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER'];(function(_0x5b325c,_0x74bf05){var _0x27cb24=function(_0x1a8749){while(--_0x1a8749){_0x5b325c['push'](_0x5b325c['shift']());}};_0x27cb24(++_0x74bf05);}(_0xc6d1,0xcd));var _0x1c6d=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xc6d1[_0x39096d];return _0x13da4f;};'use strict';var Sequelize=require(_0x1c6d('0x0'));var moment=require(_0x1c6d('0x1'));module[_0x1c6d('0x2')]={'state':{'type':Sequelize[_0x1c6d('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x1c6d('0x4')]},'scheduledat':{'type':Sequelize[_0x1c6d('0x5')]},'countbusyretry':{'type':Sequelize[_0x1c6d('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1c6d('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x1c6d('0x4')]},'originatecalleridname':{'type':Sequelize[_0x1c6d('0x4')]},'calleridnum':{'type':Sequelize[_0x1c6d('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x1c6d('0x5')]},'responsetime':{'type':Sequelize[_0x1c6d('0x5')]},'answertime':{'type':Sequelize[_0x1c6d('0x5')]},'droptime':{'type':Sequelize[_0x1c6d('0x5')]},'endtime':{'type':Sequelize[_0x1c6d('0x5')]},'ringtime':{'type':Sequelize[_0x1c6d('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1c6d('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1c6d('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1c6d('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1c6d('0x4')]},'campaign':{'type':Sequelize[_0x1c6d('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x1c6d('0x4')]},'reason':{'type':Sequelize[_0x1c6d('0x4')]},'disposition':{'type':Sequelize[_0x1c6d('0x4')]},'secondDisposition':{'type':Sequelize[_0x1c6d('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1c6d('0x4')]},'dispositionat':{'type':Sequelize[_0x1c6d('0x5')],'set':function(_0x5c1504){var _0x8a031=this['getDataValue'](_0x1c6d('0x6'));if(_0x8a031&&_0x5c1504){this['setDataValue'](_0x1c6d('0x7'),moment(_0x5c1504)[_0x1c6d('0x8')](moment(_0x8a031),_0x1c6d('0x9')));}}},'amd':{'type':Sequelize[_0x1c6d('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x1c6d('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x1c6d('0x5')]},'callback':{'type':Sequelize[_0x1c6d('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1c6d('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1c6d('0x5')]},'deleted':{'type':Sequelize[_0x1c6d('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x1c6d('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1c6d('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1c6d('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1c6d('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index e57d580..b5d3155 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 _0xfcf0=['noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','field','NOW()','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','state\x20=\x20?','state','toString','VoiceQueueId\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','ListId','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','describe','body','uniqueid','find','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null'];(function(_0x1df7b8,_0x1ea2df){var _0x4e57c3=function(_0x519925){while(--_0x519925){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x4e57c3(++_0x1ea2df);}(_0xfcf0,0x138));var _0x0fcf=function(_0x514260,_0x1891e1){_0x514260=_0x514260-0x0;var _0x4ac81b=_0xfcf0[_0x514260];return _0x4ac81b;};'use strict';var emlformat=require(_0x0fcf('0x0'));var rimraf=require(_0x0fcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fcf('0x2'));var rp=require(_0x0fcf('0x3'));var moment=require(_0x0fcf('0x4'));var BPromise=require(_0x0fcf('0x5'));var Mustache=require('mustache');var util=require(_0x0fcf('0x6'));var path=require(_0x0fcf('0x7'));var sox=require(_0x0fcf('0x8'));var csv=require(_0x0fcf('0x9'));var ejs=require(_0x0fcf('0xa'));var fs=require('fs');var fs_extra=require(_0x0fcf('0xb'));var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0x9'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fcf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fcf('0x14'))(_0x0fcf('0x15'));var utils=require(_0x0fcf('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fcf('0x17'))['db'];function respondWithStatusCode(_0x3c999e,_0x4b4904){_0x4b4904=_0x4b4904||0xcc;return function(_0x20153d){if(_0x20153d){return _0x3c999e[_0x0fcf('0x18')](_0x4b4904);}return _0x3c999e[_0x0fcf('0x19')](_0x4b4904)[_0x0fcf('0x1a')]();};}function respondWithResult(_0x25fadc,_0x48bba6){_0x48bba6=_0x48bba6||0xc8;return function(_0xa32692){if(_0xa32692){return _0x25fadc[_0x0fcf('0x19')](_0x48bba6)[_0x0fcf('0x1b')](_0xa32692);}};}function respondWithFilteredResult(_0x5e867f,_0x3c09c4){return function(_0x610106){if(_0x610106){var _0x445207=typeof _0x3c09c4[_0x0fcf('0x1c')]==='undefined'&&typeof _0x3c09c4[_0x0fcf('0x1d')]===_0x0fcf('0x1e');var _0x1a8477=_0x610106[_0x0fcf('0x1f')];var _0x19cfbd=_0x445207?0x0:_0x3c09c4['offset'];var _0x18ea32=_0x445207?_0x610106[_0x0fcf('0x1f')]:_0x3c09c4['offset']+_0x3c09c4[_0x0fcf('0x1d')];var _0x1b9a90;if(_0x18ea32>=_0x1a8477){_0x18ea32=_0x1a8477;_0x1b9a90=0xc8;}else{_0x1b9a90=0xce;}_0x5e867f['status'](_0x1b9a90);return _0x5e867f[_0x0fcf('0x20')]('Content-Range',_0x19cfbd+'-'+_0x18ea32+'/'+_0x1a8477)[_0x0fcf('0x1b')](_0x610106);}return null;};}function patchUpdates(_0x13454e){return function(_0x5c8279){try{jsonpatch[_0x0fcf('0x21')](_0x5c8279,_0x13454e,!![]);}catch(_0x3f28d0){return BPromise[_0x0fcf('0x22')](_0x3f28d0);}return _0x5c8279['save']();};}function saveUpdates(_0x2f03ce,_0x1dafc8){return function(_0x196d30){if(_0x196d30){return _0x196d30[_0x0fcf('0x23')](_0x2f03ce)[_0x0fcf('0x24')](function(_0x30e1b0){return _0x30e1b0;});}return null;};}function removeEntity(_0x5841a9,_0x2eef74){return function(_0x253641){if(_0x253641){return _0x253641[_0x0fcf('0x25')]()[_0x0fcf('0x24')](function(){_0x5841a9[_0x0fcf('0x19')](0xcc)[_0x0fcf('0x1a')]();});}};}function handleEntityNotFound(_0x2ce990,_0x18f269){return function(_0x117510){if(!_0x117510){_0x2ce990['sendStatus'](0x194);}return _0x117510;};}function handleError(_0x18965e,_0xc107a){_0xc107a=_0xc107a||0x1f4;return function(_0x41b7a2){logger[_0x0fcf('0x26')](_0x41b7a2[_0x0fcf('0x27')]);if(_0x41b7a2[_0x0fcf('0x28')]){delete _0x41b7a2[_0x0fcf('0x28')];}_0x18965e['status'](_0xc107a)[_0x0fcf('0x29')](_0x41b7a2);};}exports[_0x0fcf('0x2a')]=function(_0x200517,_0x35180d){var _0x49fd0e={},_0x5d9bcd={},_0x4af80d={'count':0x0,'rows':[]};var _0x428194=_['map'](db[_0x0fcf('0x2b')][_0x0fcf('0x2c')],function(_0x56a416){return{'name':_0x56a416[_0x0fcf('0x2d')],'type':_0x56a416[_0x0fcf('0x2e')][_0x0fcf('0x2f')]};});_0x5d9bcd[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x428194,_0x0fcf('0x28'));_0x5d9bcd['query']=_[_0x0fcf('0x32')](_0x200517[_0x0fcf('0x33')]);_0x5d9bcd[_0x0fcf('0x34')]=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],_0x5d9bcd[_0x0fcf('0x33')]);_0x49fd0e['attributes']=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x49fd0e[_0x0fcf('0x37')]=_0x49fd0e[_0x0fcf('0x37')][_0x0fcf('0x38')]?_0x49fd0e[_0x0fcf('0x37')]:_0x5d9bcd[_0x0fcf('0x30')];if(!_0x200517[_0x0fcf('0x33')][_0x0fcf('0x39')](_0x0fcf('0x3a'))){_0x49fd0e[_0x0fcf('0x1d')]=qs['limit'](_0x200517['query'][_0x0fcf('0x1d')]);_0x49fd0e['offset']=qs['offset'](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x1c')]);}_0x49fd0e[_0x0fcf('0x3b')]=qs['sort'](_0x200517['query'][_0x0fcf('0x3c')]);_0x49fd0e[_0x0fcf('0x3d')]=qs[_0x0fcf('0x34')](_['pick'](_0x200517[_0x0fcf('0x33')],_0x5d9bcd[_0x0fcf('0x34')]),_0x428194);if(_0x200517[_0x0fcf('0x33')]['filter']){_0x49fd0e['where']=_['merge'](_0x49fd0e[_0x0fcf('0x3d')],{'$or':_[_0x0fcf('0x31')](_0x428194,function(_0xdfdd1){if(_0xdfdd1[_0x0fcf('0x2e')]!==_0x0fcf('0x3e')){var _0x4be8eb={};_0x4be8eb[_0xdfdd1[_0x0fcf('0x28')]]={'$like':'%'+_0x200517[_0x0fcf('0x33')][_0x0fcf('0x3f')]+'%'};return _0x4be8eb;}})});}_0x49fd0e=_['merge']({},_0x49fd0e,_0x200517['options']);var _0x13e4b2={'where':_0x49fd0e[_0x0fcf('0x3d')]};return db[_0x0fcf('0x2b')][_0x0fcf('0x1f')](_0x13e4b2)[_0x0fcf('0x24')](function(_0x4c6669){_0x4af80d[_0x0fcf('0x1f')]=_0x4c6669;if(_0x200517[_0x0fcf('0x33')][_0x0fcf('0x40')]){_0x49fd0e[_0x0fcf('0x41')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x49fd0e);})[_0x0fcf('0x24')](function(_0x2444a6){_0x4af80d['rows']=_0x2444a6;return _0x4af80d;})[_0x0fcf('0x24')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x42')](handleError(_0x35180d,null));};exports['show']=function(_0x237fa6,_0xfc2f2b){var _0x44eb03={'raw':!![],'where':{'id':_0x237fa6[_0x0fcf('0x43')]['id']}},_0x1f322b={};_0x1f322b['model']=_[_0x0fcf('0x32')](db[_0x0fcf('0x2b')]['rawAttributes']);_0x1f322b['query']=_[_0x0fcf('0x32')](_0x237fa6['query']);_0x1f322b['filters']=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],_0x1f322b[_0x0fcf('0x33')]);_0x44eb03[_0x0fcf('0x37')]=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x237fa6[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x44eb03[_0x0fcf('0x37')]=_0x44eb03['attributes'][_0x0fcf('0x38')]?_0x44eb03[_0x0fcf('0x37')]:_0x1f322b[_0x0fcf('0x30')];if(_0x237fa6['query']['includeAll']){_0x44eb03[_0x0fcf('0x41')]=[{'all':!![]}];}_0x44eb03=_[_0x0fcf('0x44')]({},_0x44eb03,_0x237fa6[_0x0fcf('0x45')]);return db[_0x0fcf('0x2b')]['find'](_0x44eb03)['then'](handleEntityNotFound(_0xfc2f2b,null))[_0x0fcf('0x24')](respondWithResult(_0xfc2f2b,null))[_0x0fcf('0x42')](handleError(_0xfc2f2b,null));};exports[_0x0fcf('0x46')]=function(_0x1fb83d,_0x345188){return db[_0x0fcf('0x2b')][_0x0fcf('0x46')]()[_0x0fcf('0x24')](respondWithResult(_0x345188,null))['catch'](handleError(_0x345188,null));};exports['update']=function(_0x259c91,_0x243699){if(_0x259c91[_0x0fcf('0x47')][_0x0fcf('0x48')]){delete _0x259c91[_0x0fcf('0x47')][_0x0fcf('0x48')];}return db['CmHopperFinal'][_0x0fcf('0x49')]({'where':{'uniqueid':_0x259c91[_0x0fcf('0x43')]['id']}})['then'](handleEntityNotFound(_0x243699,null))[_0x0fcf('0x24')](saveUpdates(_0x259c91[_0x0fcf('0x47')],null))[_0x0fcf('0x24')](respondWithResult(_0x243699,null))[_0x0fcf('0x42')](handleError(_0x243699,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0xc514bf,_0x382448,_0x1bb062){return db[_0x0fcf('0x2b')][_0x0fcf('0x4a')]({'raw':![],'where':{'VoiceQueueId':_0xc514bf[_0x0fcf('0x43')]['id']},'attributes':[[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')](_0x0fcf('0x4e')))),_0x0fcf('0x4f')],[db[_0x0fcf('0x4b')]['fn']('COUNT',db[_0x0fcf('0x4b')]['fn']('IF',db['sequelize'][_0x0fcf('0x4d')](_0x0fcf('0x50')))),_0x0fcf('0x51')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db['sequelize']['fn']('IF',db[_0x0fcf('0x4b')]['literal'](_0x0fcf('0x52')))),_0x0fcf('0x53')],[db['sequelize']['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db['sequelize'][_0x0fcf('0x4d')](_0x0fcf('0x54')))),_0x0fcf('0x55')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x0fcf('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x0fcf('0x56')],[db[_0x0fcf('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')](_0x0fcf('0x57')))),'abandonedContacts'],[db[_0x0fcf('0x4b')]['fn']('COUNT',db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')]('`state`\x20=\x2022,\x201,\x20null'))),_0x0fcf('0x58')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')](_0x0fcf('0x59')))),_0x0fcf('0x5a')]]})[_0x0fcf('0x24')](handleEntityNotFound(_0x382448,null))[_0x0fcf('0x24')](respondWithResult(_0x382448,null))[_0x0fcf('0x42')](handleError(_0x382448,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x62d12e,_0x1dda2e,_0x6af0f5){return db[_0x0fcf('0x2b')][_0x0fcf('0x4a')]({'raw':![],'where':{'CampaignId':_0x62d12e[_0x0fcf('0x43')]['id']},'attributes':[[db[_0x0fcf('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0x0fcf('0x4f')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db['sequelize'][_0x0fcf('0x4d')](_0x0fcf('0x50')))),_0x0fcf('0x51')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db['sequelize'][_0x0fcf('0x4d')](_0x0fcf('0x52')))),_0x0fcf('0x53')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x0fcf('0x4d')](_0x0fcf('0x54')))),_0x0fcf('0x55')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')](_0x0fcf('0x5b')))),_0x0fcf('0x56')],[db['sequelize']['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')](_0x0fcf('0x57')))),_0x0fcf('0x5c')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db[_0x0fcf('0x4b')]['fn']('COUNT',db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x0fcf('0x24')](handleEntityNotFound(_0x1dda2e,null))[_0x0fcf('0x24')](respondWithResult(_0x1dda2e,null))['catch'](handleError(_0x1dda2e,null));};exports[_0x0fcf('0x5d')]=function(_0x3cb75a,_0x5936a6,_0x3d02c1){return db[_0x0fcf('0x5e')][_0x0fcf('0x49')]({'where':{'id':_0x3cb75a[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0x5936a6,null))[_0x0fcf('0x24')](function(_0x4704c9){var _0x4b1f10;if(_0x4704c9){_0x4b1f10=squel[_0x0fcf('0x5f')]()[_0x0fcf('0x60')](_0x0fcf('0x61'))[_0x0fcf('0x62')]([_0x0fcf('0x63'),_0x0fcf('0x64'),'ContactId','ListId',_0x0fcf('0x65'),_0x0fcf('0x66'),_0x0fcf('0x67')],squel[_0x0fcf('0x68')]()['field'](_0x0fcf('0x69'),_0x0fcf('0x63'))[_0x0fcf('0x6a')](_0x0fcf('0x6b'),_0x0fcf('0x64'))['field']('ANY_VALUE(ContactId)',_0x0fcf('0x6c'))['field'](_0x0fcf('0x6d'),'ListId')[_0x0fcf('0x6a')](_0x0fcf('0x6e'),_0x0fcf('0x65'))[_0x0fcf('0x6a')](_0x0fcf('0x6b'),'createdAt')[_0x0fcf('0x6a')](_0x0fcf('0x6b'),_0x0fcf('0x67'))[_0x0fcf('0x6f')]('cm_hopper_final')[_0x0fcf('0x3d')]('VoiceQueueId\x20=\x20?',_0x3cb75a[_0x0fcf('0x43')]['id']['toString']())[_0x0fcf('0x3d')](_0x0fcf('0x70'),_0x3cb75a['body'][_0x0fcf('0x71')][_0x0fcf('0x72')]())[_0x0fcf('0x3d')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x0fcf('0x68')]()['field'](_0x0fcf('0x63'))[_0x0fcf('0x6f')](_0x0fcf('0x61'))[_0x0fcf('0x3d')](_0x0fcf('0x73'),_0x3cb75a[_0x0fcf('0x43')]['id'][_0x0fcf('0x72')]()))[_0x0fcf('0x3d')](_0x0fcf('0x74'),squel['select']()[_0x0fcf('0x6a')](_0x0fcf('0x75'))[_0x0fcf('0x6f')](_0x0fcf('0x76'))[_0x0fcf('0x3d')](_0x0fcf('0x73'),_0x3cb75a[_0x0fcf('0x43')]['id'][_0x0fcf('0x72')]())['where'](_0x0fcf('0x77')))[_0x0fcf('0x78')](_0x0fcf('0x6c')))[_0x0fcf('0x72')]();return db[_0x0fcf('0x4b')][_0x0fcf('0x33')](_0x4b1f10);}return[];})[_0x0fcf('0x24')](respondWithResult(_0x5936a6,null))['catch'](handleError(_0x5936a6,null));};exports[_0x0fcf('0x79')]=function(_0x489c6d,_0x18645d,_0x9e933e){return db[_0x0fcf('0x7a')]['find']({'where':{'id':_0x489c6d['params']['id']}})['then'](handleEntityNotFound(_0x18645d,null))['then'](function(_0x301991){var _0x46bcc2;if(_0x301991){_0x46bcc2=squel[_0x0fcf('0x5f')]()[_0x0fcf('0x60')](_0x0fcf('0x61'))[_0x0fcf('0x62')]([_0x0fcf('0x63'),_0x0fcf('0x64'),_0x0fcf('0x6c'),_0x0fcf('0x7b'),_0x0fcf('0x7c'),'createdAt',_0x0fcf('0x67')],squel[_0x0fcf('0x68')]()['field'](_0x0fcf('0x69'),'phone')[_0x0fcf('0x6a')](_0x0fcf('0x6b'),'scheduledAt')['field'](_0x0fcf('0x7d'),_0x0fcf('0x6c'))['field'](_0x0fcf('0x6d'),_0x0fcf('0x7b'))[_0x0fcf('0x6a')](_0x0fcf('0x7e'),_0x0fcf('0x7c'))[_0x0fcf('0x6a')](_0x0fcf('0x6b'),_0x0fcf('0x66'))['field'](_0x0fcf('0x6b'),_0x0fcf('0x67'))[_0x0fcf('0x6f')](_0x0fcf('0x76'))['where'](_0x0fcf('0x7f'),_0x489c6d['params']['id']['toString']())['where'](_0x0fcf('0x70'),_0x489c6d[_0x0fcf('0x47')][_0x0fcf('0x71')][_0x0fcf('0x72')]())[_0x0fcf('0x3d')](_0x0fcf('0x80'))[_0x0fcf('0x3d')](_0x0fcf('0x74'),squel[_0x0fcf('0x68')]()['field'](_0x0fcf('0x63'))[_0x0fcf('0x6f')](_0x0fcf('0x61'))[_0x0fcf('0x3d')](_0x0fcf('0x7f'),_0x489c6d[_0x0fcf('0x43')]['id'][_0x0fcf('0x72')]()))[_0x0fcf('0x3d')](_0x0fcf('0x74'),squel['select']()['field']('calleridnum')[_0x0fcf('0x6f')](_0x0fcf('0x76'))[_0x0fcf('0x3d')](_0x0fcf('0x7f'),_0x489c6d['params']['id']['toString']())['where'](_0x0fcf('0x77')))['group'](_0x0fcf('0x6c')))['toString']();return db[_0x0fcf('0x4b')]['query'](_0x46bcc2);}return[];})[_0x0fcf('0x24')](respondWithResult(_0x18645d,null))['catch'](handleError(_0x18645d,null));};exports['checkContactHopper']=function(_0x426625,_0x4ccae3,_0x2905fa){return db[_0x0fcf('0x81')][_0x0fcf('0x82')]({'where':{'VoiceQueueId':_0x426625[_0x0fcf('0x47')][_0x0fcf('0x65')],'CampaignId':_0x426625[_0x0fcf('0x47')][_0x0fcf('0x7c')],'ContactId':_0x426625[_0x0fcf('0x47')][_0x0fcf('0x6c')]}})[_0x0fcf('0x24')](handleEntityNotFound(_0x4ccae3,null))[_0x0fcf('0x24')](function(_0x274aa9){if(_0x274aa9){return _0x274aa9;}return null;})[_0x0fcf('0x24')](respondWithResult(_0x4ccae3,null))['catch'](handleError(_0x4ccae3,null));}; \ No newline at end of file +var _0xc6ac=['key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','VoiceQueueId','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','into','CampaignId','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','CmHopperFinal','rawAttributes','fieldName','type'];(function(_0x483547,_0x5eca97){var _0x46b5ed=function(_0x2b4ec0){while(--_0x2b4ec0){_0x483547['push'](_0x483547['shift']());}};_0x46b5ed(++_0x5eca97);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x3b10ba,_0x17df42){_0x3b10ba=_0x3b10ba-0x0;var _0x420662=_0xc6ac[_0x3b10ba];return _0x420662;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':!![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['describe']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')]()[_0xcc6a('0x27')](respondWithResult(_0x47c999,null))[_0xcc6a('0x4b')](handleError(_0x47c999,null));};exports['update']=function(_0x1c3bb8,_0x5e7bab){if(_0x1c3bb8[_0xcc6a('0x4d')][_0xcc6a('0x4e')]){delete _0x1c3bb8[_0xcc6a('0x4d')][_0xcc6a('0x4e')];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'uniqueid':_0x1c3bb8['params']['id']}})[_0xcc6a('0x27')](handleEntityNotFound(_0x5e7bab,null))[_0xcc6a('0x27')](saveUpdates(_0x1c3bb8[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x5e7bab,null))[_0xcc6a('0x4b')](handleError(_0x5e7bab,null));};exports[_0xcc6a('0x4f')]=function(_0x431684,_0x392805,_0x31987f){return db[_0xcc6a('0x2d')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x431684[_0xcc6a('0x47')]['id']},'attributes':[[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0xcc6a('0x50')]['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x53')))),_0xcc6a('0x54')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x55')))),'busyContacts'],[db[_0xcc6a('0x50')]['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')]('`state`\x20=\x208,\x201,\x20null'))),_0xcc6a('0x56')],[db['sequelize']['fn'](_0xcc6a('0x51'),db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x57')))),_0xcc6a('0x58')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')]['literal'](_0xcc6a('0x59')))),'abandonedContacts'],[db[_0xcc6a('0x50')]['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')]('`state`\x20=\x2022,\x201,\x20null'))),_0xcc6a('0x5a')],[db['sequelize']['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x5b')))),_0xcc6a('0x5c')]]})[_0xcc6a('0x27')](handleEntityNotFound(_0x392805,null))[_0xcc6a('0x27')](respondWithResult(_0x392805,null))[_0xcc6a('0x4b')](handleError(_0x392805,null));};exports[_0xcc6a('0x5d')]=function(_0x3e76d7,_0x42bbc7,_0x2ad9a6){return db[_0xcc6a('0x2d')]['findAll']({'raw':![],'where':{'CampaignId':_0x3e76d7[_0xcc6a('0x47')]['id']},'attributes':[[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db['sequelize'][_0xcc6a('0x52')](_0xcc6a('0x5e')))),_0xcc6a('0x5f')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x53')))),_0xcc6a('0x54')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x55')))),'busyContacts'],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xcc6a('0x56')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db['sequelize'][_0xcc6a('0x52')](_0xcc6a('0x57')))),_0xcc6a('0x58')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0xcc6a('0x52')](_0xcc6a('0x59')))),_0xcc6a('0x60')],[db[_0xcc6a('0x50')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x61')))),_0xcc6a('0x5a')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x5b')))),_0xcc6a('0x5c')]]})['then'](handleEntityNotFound(_0x42bbc7,null))[_0xcc6a('0x27')](respondWithResult(_0x42bbc7,null))[_0xcc6a('0x4b')](handleError(_0x42bbc7,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x72e53a,_0x5b61df,_0x3b4ce0){return db['VoiceQueue'][_0xcc6a('0x4a')]({'where':{'id':_0x72e53a[_0xcc6a('0x47')]['id']}})[_0xcc6a('0x27')](handleEntityNotFound(_0x5b61df,null))['then'](function(_0x3ce1eb){var _0x51390a;if(_0x3ce1eb){_0x51390a=squel[_0xcc6a('0x62')]()['into'](_0xcc6a('0x63'))[_0xcc6a('0x64')]([_0xcc6a('0x65'),_0xcc6a('0x66'),_0xcc6a('0x67'),_0xcc6a('0x68'),'VoiceQueueId',_0xcc6a('0x69'),_0xcc6a('0x6a')],squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')](_0xcc6a('0x6d'),'phone')[_0xcc6a('0x6c')](_0xcc6a('0x6e'),'scheduledAt')['field'](_0xcc6a('0x6f'),_0xcc6a('0x67'))[_0xcc6a('0x6c')](_0xcc6a('0x70'),_0xcc6a('0x68'))[_0xcc6a('0x6c')]('ANY_VALUE(VoiceQueueId)',_0xcc6a('0x71'))[_0xcc6a('0x6c')](_0xcc6a('0x6e'),_0xcc6a('0x69'))[_0xcc6a('0x6c')](_0xcc6a('0x6e'),'updatedAt')['from'](_0xcc6a('0x72'))[_0xcc6a('0x3e')](_0xcc6a('0x73'),_0x72e53a[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x75'),_0x72e53a['body'][_0xcc6a('0x76')][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x77'))[_0xcc6a('0x3e')](_0xcc6a('0x78'),squel['select']()[_0xcc6a('0x6c')](_0xcc6a('0x65'))[_0xcc6a('0x79')]('cm_hopper')[_0xcc6a('0x3e')](_0xcc6a('0x73'),_0x72e53a[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]()))[_0xcc6a('0x3e')](_0xcc6a('0x78'),squel['select']()[_0xcc6a('0x6c')](_0xcc6a('0x7a'))['from'](_0xcc6a('0x72'))[_0xcc6a('0x3e')](_0xcc6a('0x73'),_0x72e53a[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]())['where'](_0xcc6a('0x7b')))[_0xcc6a('0x7c')](_0xcc6a('0x67')))[_0xcc6a('0x74')]();return db[_0xcc6a('0x50')][_0xcc6a('0x33')](_0x51390a);}return[];})['then'](respondWithResult(_0x5b61df,null))['catch'](handleError(_0x5b61df,null));};exports[_0xcc6a('0x7d')]=function(_0x5be65b,_0xb42e9,_0x35a798){return db[_0xcc6a('0x7e')][_0xcc6a('0x4a')]({'where':{'id':_0x5be65b[_0xcc6a('0x47')]['id']}})[_0xcc6a('0x27')](handleEntityNotFound(_0xb42e9,null))[_0xcc6a('0x27')](function(_0x1746d8){var _0xc0d194;if(_0x1746d8){_0xc0d194=squel[_0xcc6a('0x62')]()[_0xcc6a('0x7f')](_0xcc6a('0x63'))['fromQuery']([_0xcc6a('0x65'),_0xcc6a('0x66'),_0xcc6a('0x67'),_0xcc6a('0x68'),'CampaignId',_0xcc6a('0x69'),'updatedAt'],squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')](_0xcc6a('0x6d'),_0xcc6a('0x65'))[_0xcc6a('0x6c')](_0xcc6a('0x6e'),_0xcc6a('0x66'))['field'](_0xcc6a('0x6f'),_0xcc6a('0x67'))[_0xcc6a('0x6c')](_0xcc6a('0x70'),_0xcc6a('0x68'))[_0xcc6a('0x6c')]('ANY_VALUE(CampaignId)',_0xcc6a('0x80'))[_0xcc6a('0x6c')]('NOW()','createdAt')[_0xcc6a('0x6c')](_0xcc6a('0x6e'),_0xcc6a('0x6a'))[_0xcc6a('0x79')](_0xcc6a('0x72'))['where'](_0xcc6a('0x81'),_0x5be65b['params']['id'][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x75'),_0x5be65b[_0xcc6a('0x4d')][_0xcc6a('0x76')][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x77'))['where'](_0xcc6a('0x78'),squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')]('phone')[_0xcc6a('0x79')](_0xcc6a('0x63'))[_0xcc6a('0x3e')](_0xcc6a('0x81'),_0x5be65b[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]()))[_0xcc6a('0x3e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')](_0xcc6a('0x7a'))[_0xcc6a('0x79')](_0xcc6a('0x72'))[_0xcc6a('0x3e')](_0xcc6a('0x81'),_0x5be65b[_0xcc6a('0x47')]['id']['toString']())['where'](_0xcc6a('0x7b')))['group'](_0xcc6a('0x67')))[_0xcc6a('0x74')]();return db[_0xcc6a('0x50')][_0xcc6a('0x33')](_0xc0d194);}return[];})[_0xcc6a('0x27')](respondWithResult(_0xb42e9,null))[_0xcc6a('0x4b')](handleError(_0xb42e9,null));};exports[_0xcc6a('0x82')]=function(_0x48b6e3,_0x10d731,_0x537e2b){return db['CmHopper'][_0xcc6a('0x83')]({'where':{'VoiceQueueId':_0x48b6e3['body'][_0xcc6a('0x71')],'CampaignId':_0x48b6e3[_0xcc6a('0x4d')]['CampaignId'],'ContactId':_0x48b6e3['body'][_0xcc6a('0x67')]}})['then'](handleEntityNotFound(_0x10d731,null))[_0xcc6a('0x27')](function(_0x3df510){if(_0x3df510){return _0x3df510;}return null;})[_0xcc6a('0x27')](respondWithResult(_0x10d731,null))[_0xcc6a('0x4b')](handleError(_0x10d731,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index d33eac4..1d347c7 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 _0x83a6=['path','rimraf','../../config/environment','./cmHopperFinal.attributes','CmHopperFinal','cm_hopper_final','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x42e8f3,_0x5c8dba){var _0x47feab=function(_0x35fbf7){while(--_0x35fbf7){_0x42e8f3['push'](_0x42e8f3['shift']());}};_0x47feab(++_0x5c8dba);}(_0x83a6,0xe4));var _0x683a=function(_0x5a2c76,_0x18344d){_0x5a2c76=_0x5a2c76-0x0;var _0xb00e10=_0x83a6[_0x5a2c76];return _0xb00e10;};'use strict';var _=require(_0x683a('0x0'));var util=require('util');var logger=require(_0x683a('0x1'))(_0x683a('0x2'));var moment=require(_0x683a('0x3'));var BPromise=require(_0x683a('0x4'));var rp=require(_0x683a('0x5'));var fs=require('fs');var path=require(_0x683a('0x6'));var rimraf=require(_0x683a('0x7'));var config=require(_0x683a('0x8'));var attributes=require(_0x683a('0x9'));module['exports']=function(_0x1260c4,_0x386fb5){return _0x1260c4['define'](_0x683a('0xa'),attributes,{'tableName':_0x683a('0xb'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':'uniqueid','fields':[_0x683a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfe1a=['calleridnum','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal'];(function(_0x2efd4b,_0x2bc31a){var _0x1141e9=function(_0x421f71){while(--_0x421f71){_0x2efd4b['push'](_0x2efd4b['shift']());}};_0x1141e9(++_0x2bc31a);}(_0xfe1a,0x183));var _0xafe1=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xfe1a[_0x411add];return _0x238242;};'use strict';var _=require(_0xafe1('0x0'));var util=require('util');var logger=require(_0xafe1('0x1'))(_0xafe1('0x2'));var moment=require('moment');var BPromise=require(_0xafe1('0x3'));var rp=require(_0xafe1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xafe1('0x5'));var attributes=require(_0xafe1('0x6'));module[_0xafe1('0x7')]=function(_0x406f43,_0x53ba99){return _0x406f43['define'](_0xafe1('0x8'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xafe1('0x9')]},{'name':_0xafe1('0xa'),'fields':[_0xafe1('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index de8bfe2..5491bfa 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x34bc9c,_0x46c38a){var _0x4af87d=function(_0x1281cc){while(--_0x1281cc){_0x34bc9c['push'](_0x34bc9c['shift']());}};_0x4af87d(++_0x46c38a);}(_0xb10b,0x12a));var _0xbb10=function(_0x56e60b,_0x3c1bdc){_0x56e60b=_0x56e60b-0x0;var _0x305ce1=_0xb10b[_0x56e60b];return _0x305ce1;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5c9a9a,_0x59ac61){var _0x4e31c8=function(_0x4526e8){while(--_0x4526e8){_0x5c9a9a['push'](_0x5c9a9a['shift']());}};_0x4e31c8(++_0x59ac61);}(_0x7a54,0x106));var _0x47a5=function(_0x339f7b,_0x52722f){_0x339f7b=_0x339f7b-0x0;var _0xa892a2=_0x7a54[_0x339f7b];return _0xa892a2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 7fd88ab..974048c 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 _0xc971=['checkContactHopper','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','moveContactsIvrCampaignHopperFinal','/checkContactHopper'];(function(_0x5fc4f9,_0x75415d){var _0x3d82ab=function(_0x233903){while(--_0x233903){_0x5fc4f9['push'](_0x5fc4f9['shift']());}};_0x3d82ab(++_0x75415d);}(_0xc971,0x17b));var _0x1c97=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xc971[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0x1c97('0x0'));var util=require(_0x1c97('0x1'));var path=require(_0x1c97('0x2'));var timeout=require(_0x1c97('0x3'));var express=require(_0x1c97('0x4'));var router=express['Router']();var fs_extra=require(_0x1c97('0x5'));var auth=require(_0x1c97('0x6'));var interaction=require(_0x1c97('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x1c97('0x8')]('/',auth[_0x1c97('0x9')](),controller['index']);router['get'](_0x1c97('0xa'),auth[_0x1c97('0x9')](),controller['describe']);router[_0x1c97('0x8')](_0x1c97('0xb'),auth['isAuthenticated'](),controller[_0x1c97('0xc')]);router[_0x1c97('0x8')](_0x1c97('0xd'),auth['isAuthenticated'](),controller[_0x1c97('0xe')]);router['get']('/campaign/countAttributes/:id',auth[_0x1c97('0x9')](),controller[_0x1c97('0xf')]);router['post'](_0x1c97('0x10'),auth[_0x1c97('0x9')](),controller[_0x1c97('0x11')]);router[_0x1c97('0x12')]('/voice/campaign/moveContacts/:id',auth[_0x1c97('0x9')](),controller[_0x1c97('0x13')]);router[_0x1c97('0x12')](_0x1c97('0x14'),auth[_0x1c97('0x9')](),controller[_0x1c97('0x15')]);router[_0x1c97('0x16')]('/:id',auth[_0x1c97('0x9')](),controller[_0x1c97('0x17')]);module[_0x1c97('0x18')]=router; \ No newline at end of file +var _0x6c79=['moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','/:id','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe','describe','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id'];(function(_0x1c2344,_0x33e89f){var _0x4c4a0f=function(_0x141789){while(--_0x141789){_0x1c2344['push'](_0x1c2344['shift']());}};_0x4c4a0f(++_0x33e89f);}(_0x6c79,0x184));var _0x96c7=function(_0x5a1613,_0x370b1b){_0x5a1613=_0x5a1613-0x0;var _0x2197d8=_0x6c79[_0x5a1613];return _0x2197d8;};'use strict';var multer=require(_0x96c7('0x0'));var util=require(_0x96c7('0x1'));var path=require(_0x96c7('0x2'));var timeout=require(_0x96c7('0x3'));var express=require(_0x96c7('0x4'));var router=express['Router']();var fs_extra=require(_0x96c7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x96c7('0x6'));var config=require(_0x96c7('0x7'));var controller=require(_0x96c7('0x8'));router[_0x96c7('0x9')]('/',auth[_0x96c7('0xa')](),controller['index']);router[_0x96c7('0x9')](_0x96c7('0xb'),auth[_0x96c7('0xa')](),controller[_0x96c7('0xc')]);router[_0x96c7('0x9')]('/:id',auth[_0x96c7('0xa')](),controller[_0x96c7('0xd')]);router[_0x96c7('0x9')](_0x96c7('0xe'),auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router[_0x96c7('0x9')](_0x96c7('0xf'),auth['isAuthenticated'](),controller[_0x96c7('0x10')]);router[_0x96c7('0x11')]('/voice/queue/moveContacts/:id',auth[_0x96c7('0xa')](),controller[_0x96c7('0x12')]);router['post'](_0x96c7('0x13'),auth['isAuthenticated'](),controller[_0x96c7('0x14')]);router[_0x96c7('0x11')](_0x96c7('0x15'),auth[_0x96c7('0xa')](),controller[_0x96c7('0x16')]);router['put'](_0x96c7('0x17'),auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index bcebb01..d4f3e08 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 _0xc695=['BOOLEAN','sequelize','exports','DATE','INTEGER','STRING'];(function(_0x5da810,_0x186f7c){var _0x2f0493=function(_0x22ca7c){while(--_0x22ca7c){_0x5da810['push'](_0x5da810['shift']());}};_0x2f0493(++_0x186f7c);}(_0xc695,0x109));var _0x5c69=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0xc695[_0x34e752];return _0x7c6347;};'use strict';var Sequelize=require(_0x5c69('0x0'));module[_0x5c69('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x5c69('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5c69('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5c69('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5c69('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5c69('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x5c69('0x4')]},'calleridnum':{'type':Sequelize[_0x5c69('0x4')]},'calleridname':{'type':Sequelize[_0x5c69('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x5c69('0x2')]},'endtime':{'type':Sequelize[_0x5c69('0x2')]},'ringtime':{'type':Sequelize[_0x5c69('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5c69('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5c69('0x4')]},'campaign':{'type':Sequelize[_0x5c69('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5c69('0x4')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x5c69('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5c69('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x5c69('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5c69('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5c69('0x2')]},'recallme':{'type':Sequelize[_0x5c69('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x5c69('0x2')]},'edited':{'type':Sequelize[_0x5c69('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x5c69('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5c69('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5c69('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5c69('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5c69('0x3')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x5c69('0x4')]}}; \ No newline at end of file +var _0xb839=['BOOLEAN','INTEGER','STRING','DATE'];(function(_0x3d61c6,_0x4571e6){var _0x47e0df=function(_0x25adfd){while(--_0x25adfd){_0x3d61c6['push'](_0x3d61c6['shift']());}};_0x47e0df(++_0x4571e6);}(_0xb839,0x11d));var _0x9b83=function(_0x290800,_0x3479dd){_0x290800=_0x290800-0x0;var _0x15fa2a=_0xb839[_0x290800];return _0x15fa2a;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x9b83('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x9b83('0x1')]},'scheduledat':{'type':Sequelize[_0x9b83('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9b83('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9b83('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9b83('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x9b83('0x1')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9b83('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x9b83('0x2')]},'answertime':{'type':Sequelize[_0x9b83('0x2')]},'droptime':{'type':Sequelize[_0x9b83('0x2')]},'endtime':{'type':Sequelize[_0x9b83('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9b83('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9b83('0x1')]},'campaign':{'type':Sequelize[_0x9b83('0x1')]},'campaigntype':{'type':Sequelize[_0x9b83('0x1')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x9b83('0x1')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x9b83('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0x9b83('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9b83('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x9b83('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9b83('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9b83('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9b83('0x0')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x9b83('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 3dbe6b2..59450bc 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 _0x24b4=['status','end','offset','limit','undefined','count','set','json','apply','reject','update','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','CmHopperHistory','includeAll','findAll','catch','show','params','include','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x2174d8,_0x482f83){var _0x4cff33=function(_0x20a599){while(--_0x20a599){_0x2174d8['push'](_0x2174d8['shift']());}};_0x4cff33(++_0x482f83);}(_0x24b4,0xcf));var _0x424b=function(_0x35ec0e,_0x3066a5){_0x35ec0e=_0x35ec0e-0x0;var _0x116548=_0x24b4[_0x35ec0e];return _0x116548;};'use strict';var emlformat=require(_0x424b('0x0'));var rimraf=require(_0x424b('0x1'));var zipdir=require(_0x424b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x424b('0x3'));var moment=require('moment');var BPromise=require(_0x424b('0x4'));var Mustache=require('mustache');var util=require(_0x424b('0x5'));var path=require('path');var sox=require(_0x424b('0x6'));var csv=require('to-csv');var ejs=require(_0x424b('0x7'));var fs=require('fs');var fs_extra=require(_0x424b('0x8'));var _=require(_0x424b('0x9'));var squel=require(_0x424b('0xa'));var crypto=require(_0x424b('0xb'));var jsforce=require(_0x424b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x424b('0xd'));var Papa=require(_0x424b('0xe'));var Redis=require(_0x424b('0xf'));var authService=require(_0x424b('0x10'));var qs=require(_0x424b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x424b('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x424b('0x13'));var config=require(_0x424b('0x14'));var licenseUtil=require(_0x424b('0x15'));var db=require(_0x424b('0x16'))['db'];function respondWithStatusCode(_0x20f3a5,_0x39693e){_0x39693e=_0x39693e||0xcc;return function(_0x49431d){if(_0x49431d){return _0x20f3a5[_0x424b('0x17')](_0x39693e);}return _0x20f3a5[_0x424b('0x18')](_0x39693e)[_0x424b('0x19')]();};}function respondWithResult(_0x223630,_0x531047){_0x531047=_0x531047||0xc8;return function(_0x24149a){if(_0x24149a){return _0x223630[_0x424b('0x18')](_0x531047)['json'](_0x24149a);}};}function respondWithFilteredResult(_0x30036c,_0x202cf9){return function(_0x2836e2){if(_0x2836e2){var _0xd4253e=typeof _0x202cf9[_0x424b('0x1a')]==='undefined'&&typeof _0x202cf9[_0x424b('0x1b')]===_0x424b('0x1c');var _0x129db7=_0x2836e2[_0x424b('0x1d')];var _0x5e81c9=_0xd4253e?0x0:_0x202cf9[_0x424b('0x1a')];var _0x11514b=_0xd4253e?_0x2836e2[_0x424b('0x1d')]:_0x202cf9[_0x424b('0x1a')]+_0x202cf9[_0x424b('0x1b')];var _0x4823b9;if(_0x11514b>=_0x129db7){_0x11514b=_0x129db7;_0x4823b9=0xc8;}else{_0x4823b9=0xce;}_0x30036c['status'](_0x4823b9);return _0x30036c[_0x424b('0x1e')]('Content-Range',_0x5e81c9+'-'+_0x11514b+'/'+_0x129db7)[_0x424b('0x1f')](_0x2836e2);}return null;};}function patchUpdates(_0xa79437){return function(_0x1fe959){try{jsonpatch[_0x424b('0x20')](_0x1fe959,_0xa79437,!![]);}catch(_0x175cfc){return BPromise[_0x424b('0x21')](_0x175cfc);}return _0x1fe959['save']();};}function saveUpdates(_0x2b1fd3,_0x3f2043){return function(_0x152cca){if(_0x152cca){return _0x152cca[_0x424b('0x22')](_0x2b1fd3)[_0x424b('0x23')](function(_0x4138fd){return _0x4138fd;});}return null;};}function removeEntity(_0x4ee72e,_0x473844){return function(_0x509e43){if(_0x509e43){return _0x509e43[_0x424b('0x24')]()[_0x424b('0x23')](function(){_0x4ee72e[_0x424b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bff23,_0x151c4e){return function(_0x29d18b){if(!_0x29d18b){_0x4bff23[_0x424b('0x17')](0x194);}return _0x29d18b;};}function handleError(_0x3566b6,_0x2ceced){_0x2ceced=_0x2ceced||0x1f4;return function(_0x125dda){logger[_0x424b('0x25')](_0x125dda[_0x424b('0x26')]);if(_0x125dda['name']){delete _0x125dda['name'];}_0x3566b6[_0x424b('0x18')](_0x2ceced)[_0x424b('0x27')](_0x125dda);};}exports[_0x424b('0x28')]=function(_0x1be4d0,_0xf1a836){var _0x536c43={},_0x11c8d7={},_0x2a5976={'count':0x0,'rows':[]};var _0x5d81ba=_[_0x424b('0x29')](db['CmHopperHistory'][_0x424b('0x2a')],function(_0x1f691c){return{'name':_0x1f691c[_0x424b('0x2b')],'type':_0x1f691c[_0x424b('0x2c')][_0x424b('0x2d')]};});_0x11c8d7[_0x424b('0x2e')]=_[_0x424b('0x29')](_0x5d81ba,_0x424b('0x2f'));_0x11c8d7[_0x424b('0x30')]=_[_0x424b('0x31')](_0x1be4d0['query']);_0x11c8d7['filters']=_[_0x424b('0x32')](_0x11c8d7[_0x424b('0x2e')],_0x11c8d7[_0x424b('0x30')]);_0x536c43[_0x424b('0x33')]=_[_0x424b('0x32')](_0x11c8d7[_0x424b('0x2e')],qs['fields'](_0x1be4d0[_0x424b('0x30')][_0x424b('0x34')]));_0x536c43[_0x424b('0x33')]=_0x536c43[_0x424b('0x33')][_0x424b('0x35')]?_0x536c43[_0x424b('0x33')]:_0x11c8d7[_0x424b('0x2e')];if(!_0x1be4d0[_0x424b('0x30')][_0x424b('0x36')](_0x424b('0x37'))){_0x536c43['limit']=qs[_0x424b('0x1b')](_0x1be4d0['query'][_0x424b('0x1b')]);_0x536c43[_0x424b('0x1a')]=qs[_0x424b('0x1a')](_0x1be4d0[_0x424b('0x30')]['offset']);}_0x536c43[_0x424b('0x38')]=qs[_0x424b('0x39')](_0x1be4d0['query']['sort']);_0x536c43[_0x424b('0x3a')]=qs[_0x424b('0x3b')](_[_0x424b('0x3c')](_0x1be4d0[_0x424b('0x30')],_0x11c8d7[_0x424b('0x3b')]),_0x5d81ba);if(_0x1be4d0[_0x424b('0x30')][_0x424b('0x3d')]){_0x536c43[_0x424b('0x3a')]=_[_0x424b('0x3e')](_0x536c43[_0x424b('0x3a')],{'$or':_['map'](_0x5d81ba,function(_0x570c34){if(_0x570c34['type']!==_0x424b('0x3f')){var _0x59bf83={};_0x59bf83[_0x570c34[_0x424b('0x2f')]]={'$like':'%'+_0x1be4d0[_0x424b('0x30')][_0x424b('0x3d')]+'%'};return _0x59bf83;}})});}_0x536c43=_[_0x424b('0x3e')]({},_0x536c43,_0x1be4d0[_0x424b('0x40')]);var _0x540937={'where':_0x536c43[_0x424b('0x3a')]};return db[_0x424b('0x41')][_0x424b('0x1d')](_0x540937)[_0x424b('0x23')](function(_0x881295){_0x2a5976[_0x424b('0x1d')]=_0x881295;if(_0x1be4d0[_0x424b('0x30')][_0x424b('0x42')]){_0x536c43['include']=[{'all':!![]}];}return db[_0x424b('0x41')][_0x424b('0x43')](_0x536c43);})[_0x424b('0x23')](function(_0x2dec4f){_0x2a5976['rows']=_0x2dec4f;return _0x2a5976;})[_0x424b('0x23')](respondWithFilteredResult(_0xf1a836,_0x536c43))[_0x424b('0x44')](handleError(_0xf1a836,null));};exports[_0x424b('0x45')]=function(_0x4991e1,_0x37051e){var _0x193b7d={'raw':!![],'where':{'id':_0x4991e1[_0x424b('0x46')]['id']}},_0x84fa5f={};_0x84fa5f['model']=_[_0x424b('0x31')](db[_0x424b('0x41')][_0x424b('0x2a')]);_0x84fa5f[_0x424b('0x30')]=_[_0x424b('0x31')](_0x4991e1[_0x424b('0x30')]);_0x84fa5f[_0x424b('0x3b')]=_[_0x424b('0x32')](_0x84fa5f[_0x424b('0x2e')],_0x84fa5f[_0x424b('0x30')]);_0x193b7d[_0x424b('0x33')]=_['intersection'](_0x84fa5f[_0x424b('0x2e')],qs['fields'](_0x4991e1[_0x424b('0x30')]['fields']));_0x193b7d[_0x424b('0x33')]=_0x193b7d['attributes'][_0x424b('0x35')]?_0x193b7d[_0x424b('0x33')]:_0x84fa5f[_0x424b('0x2e')];if(_0x4991e1[_0x424b('0x30')][_0x424b('0x42')]){_0x193b7d[_0x424b('0x47')]=[{'all':!![]}];}_0x193b7d=_['merge']({},_0x193b7d,_0x4991e1[_0x424b('0x40')]);return db[_0x424b('0x41')][_0x424b('0x48')](_0x193b7d)['then'](handleEntityNotFound(_0x37051e,null))[_0x424b('0x23')](respondWithResult(_0x37051e,null))[_0x424b('0x44')](handleError(_0x37051e,null));};exports[_0x424b('0x49')]=function(_0x3de121,_0x5c38c4){return db[_0x424b('0x41')][_0x424b('0x49')](_0x3de121[_0x424b('0x4a')],{})[_0x424b('0x23')](respondWithResult(_0x5c38c4,0xc9))[_0x424b('0x44')](handleError(_0x5c38c4,null));};exports[_0x424b('0x4b')]=function(_0x16534e,_0x290b11){return db[_0x424b('0x41')][_0x424b('0x4b')]()[_0x424b('0x23')](respondWithResult(_0x290b11,null))['catch'](handleError(_0x290b11,null));};exports[_0x424b('0x22')]=function(_0x9d9224,_0x441421){if(_0x9d9224[_0x424b('0x4a')]['uniqueid']){delete _0x9d9224[_0x424b('0x4a')][_0x424b('0x4c')];}return db[_0x424b('0x41')][_0x424b('0x48')]({'where':{'uniqueid':_0x9d9224[_0x424b('0x46')]['id']}})['then'](handleEntityNotFound(_0x441421,null))['then'](saveUpdates(_0x9d9224[_0x424b('0x4a')],null))[_0x424b('0x23')](respondWithResult(_0x441421,null))[_0x424b('0x44')](handleError(_0x441421,null));}; \ No newline at end of file +var _0xfa53=['include','options','find','create','body','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','length','attributes','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params'];(function(_0x32eb63,_0x24f38c){var _0xb55e84=function(_0x58e19f){while(--_0x58e19f){_0x32eb63['push'](_0x32eb63['shift']());}};_0xb55e84(++_0x24f38c);}(_0xfa53,0xdc));var _0x3fa5=function(_0x4d6304,_0x140426){_0x4d6304=_0x4d6304-0x0;var _0x39a640=_0xfa53[_0x4d6304];return _0x39a640;};'use strict';var emlformat=require(_0x3fa5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fa5('0x1'));var jsonpatch=require(_0x3fa5('0x2'));var rp=require(_0x3fa5('0x3'));var moment=require(_0x3fa5('0x4'));var BPromise=require(_0x3fa5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3fa5('0x6'));var ejs=require(_0x3fa5('0x7'));var fs=require('fs');var fs_extra=require(_0x3fa5('0x8'));var _=require(_0x3fa5('0x9'));var squel=require('squel');var crypto=require(_0x3fa5('0xa'));var jsforce=require(_0x3fa5('0xb'));var deskjs=require(_0x3fa5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3fa5('0xd'));var Papa=require('papaparse');var Redis=require(_0x3fa5('0xe'));var authService=require(_0x3fa5('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3fa5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x3fa5('0x11'));var config=require(_0x3fa5('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1dcd0e,_0x4bdd92){_0x4bdd92=_0x4bdd92||0xcc;return function(_0x4a54db){if(_0x4a54db){return _0x1dcd0e[_0x3fa5('0x13')](_0x4bdd92);}return _0x1dcd0e[_0x3fa5('0x14')](_0x4bdd92)['end']();};}function respondWithResult(_0x352859,_0x16b3f2){_0x16b3f2=_0x16b3f2||0xc8;return function(_0x36c158){if(_0x36c158){return _0x352859[_0x3fa5('0x14')](_0x16b3f2)[_0x3fa5('0x15')](_0x36c158);}};}function respondWithFilteredResult(_0x3fd519,_0x261aaf){return function(_0x482b0d){if(_0x482b0d){var _0x4a4aaf=typeof _0x261aaf[_0x3fa5('0x16')]===_0x3fa5('0x17')&&typeof _0x261aaf['limit']===_0x3fa5('0x17');var _0x1302b6=_0x482b0d[_0x3fa5('0x18')];var _0x294b66=_0x4a4aaf?0x0:_0x261aaf[_0x3fa5('0x16')];var _0x524769=_0x4a4aaf?_0x482b0d[_0x3fa5('0x18')]:_0x261aaf[_0x3fa5('0x16')]+_0x261aaf[_0x3fa5('0x19')];var _0x344590;if(_0x524769>=_0x1302b6){_0x524769=_0x1302b6;_0x344590=0xc8;}else{_0x344590=0xce;}_0x3fd519[_0x3fa5('0x14')](_0x344590);return _0x3fd519[_0x3fa5('0x1a')](_0x3fa5('0x1b'),_0x294b66+'-'+_0x524769+'/'+_0x1302b6)[_0x3fa5('0x15')](_0x482b0d);}return null;};}function patchUpdates(_0x5ed13f){return function(_0x48ccd3){try{jsonpatch[_0x3fa5('0x1c')](_0x48ccd3,_0x5ed13f,!![]);}catch(_0x3d2a17){return BPromise['reject'](_0x3d2a17);}return _0x48ccd3[_0x3fa5('0x1d')]();};}function saveUpdates(_0x5a477a,_0x418321){return function(_0xce10bc){if(_0xce10bc){return _0xce10bc[_0x3fa5('0x1e')](_0x5a477a)[_0x3fa5('0x1f')](function(_0x356aa8){return _0x356aa8;});}return null;};}function removeEntity(_0x13d2cc,_0x118444){return function(_0x533afb){if(_0x533afb){return _0x533afb[_0x3fa5('0x20')]()[_0x3fa5('0x1f')](function(){_0x13d2cc[_0x3fa5('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x425e1d,_0x10e6a5){return function(_0x499a83){if(!_0x499a83){_0x425e1d['sendStatus'](0x194);}return _0x499a83;};}function handleError(_0x304085,_0x220843){_0x220843=_0x220843||0x1f4;return function(_0x5d4a77){logger[_0x3fa5('0x21')](_0x5d4a77[_0x3fa5('0x22')]);if(_0x5d4a77[_0x3fa5('0x23')]){delete _0x5d4a77['name'];}_0x304085[_0x3fa5('0x14')](_0x220843)[_0x3fa5('0x24')](_0x5d4a77);};}exports[_0x3fa5('0x25')]=function(_0x261ca8,_0x31cad5){var _0x46180e={},_0x94d8e6={},_0x3a394c={'count':0x0,'rows':[]};var _0x5959b9=_[_0x3fa5('0x26')](db[_0x3fa5('0x27')][_0x3fa5('0x28')],function(_0x43005f){return{'name':_0x43005f[_0x3fa5('0x29')],'type':_0x43005f[_0x3fa5('0x2a')][_0x3fa5('0x2b')]};});_0x94d8e6['model']=_[_0x3fa5('0x26')](_0x5959b9,'name');_0x94d8e6[_0x3fa5('0x2c')]=_[_0x3fa5('0x2d')](_0x261ca8['query']);_0x94d8e6['filters']=_[_0x3fa5('0x2e')](_0x94d8e6[_0x3fa5('0x2f')],_0x94d8e6[_0x3fa5('0x2c')]);_0x46180e['attributes']=_[_0x3fa5('0x2e')](_0x94d8e6[_0x3fa5('0x2f')],qs['fields'](_0x261ca8[_0x3fa5('0x2c')][_0x3fa5('0x30')]));_0x46180e['attributes']=_0x46180e['attributes'][_0x3fa5('0x31')]?_0x46180e[_0x3fa5('0x32')]:_0x94d8e6['model'];if(!_0x261ca8['query']['hasOwnProperty']('nolimit')){_0x46180e[_0x3fa5('0x19')]=qs[_0x3fa5('0x19')](_0x261ca8['query']['limit']);_0x46180e[_0x3fa5('0x16')]=qs[_0x3fa5('0x16')](_0x261ca8[_0x3fa5('0x2c')]['offset']);}_0x46180e[_0x3fa5('0x33')]=qs[_0x3fa5('0x34')](_0x261ca8[_0x3fa5('0x2c')][_0x3fa5('0x34')]);_0x46180e[_0x3fa5('0x35')]=qs[_0x3fa5('0x36')](_[_0x3fa5('0x37')](_0x261ca8[_0x3fa5('0x2c')],_0x94d8e6[_0x3fa5('0x36')]),_0x5959b9);if(_0x261ca8['query'][_0x3fa5('0x38')]){_0x46180e[_0x3fa5('0x35')]=_[_0x3fa5('0x39')](_0x46180e[_0x3fa5('0x35')],{'$or':_[_0x3fa5('0x26')](_0x5959b9,function(_0x7426a2){if(_0x7426a2[_0x3fa5('0x2a')]!==_0x3fa5('0x3a')){var _0x22e177={};_0x22e177[_0x7426a2[_0x3fa5('0x23')]]={'$like':'%'+_0x261ca8[_0x3fa5('0x2c')][_0x3fa5('0x38')]+'%'};return _0x22e177;}})});}_0x46180e=_['merge']({},_0x46180e,_0x261ca8['options']);var _0x175bc7={'where':_0x46180e[_0x3fa5('0x35')]};return db[_0x3fa5('0x27')][_0x3fa5('0x18')](_0x175bc7)[_0x3fa5('0x1f')](function(_0x3cd2d9){_0x3a394c[_0x3fa5('0x18')]=_0x3cd2d9;if(_0x261ca8['query'][_0x3fa5('0x3b')]){_0x46180e['include']=[{'all':!![]}];}return db[_0x3fa5('0x27')][_0x3fa5('0x3c')](_0x46180e);})[_0x3fa5('0x1f')](function(_0x281424){_0x3a394c['rows']=_0x281424;return _0x3a394c;})[_0x3fa5('0x1f')](respondWithFilteredResult(_0x31cad5,_0x46180e))[_0x3fa5('0x3d')](handleError(_0x31cad5,null));};exports[_0x3fa5('0x3e')]=function(_0x4ba01f,_0x301716){var _0x16c0a0={'raw':!![],'where':{'id':_0x4ba01f[_0x3fa5('0x3f')]['id']}},_0x2da8a5={};_0x2da8a5[_0x3fa5('0x2f')]=_[_0x3fa5('0x2d')](db[_0x3fa5('0x27')][_0x3fa5('0x28')]);_0x2da8a5[_0x3fa5('0x2c')]=_[_0x3fa5('0x2d')](_0x4ba01f[_0x3fa5('0x2c')]);_0x2da8a5[_0x3fa5('0x36')]=_[_0x3fa5('0x2e')](_0x2da8a5['model'],_0x2da8a5['query']);_0x16c0a0[_0x3fa5('0x32')]=_[_0x3fa5('0x2e')](_0x2da8a5[_0x3fa5('0x2f')],qs[_0x3fa5('0x30')](_0x4ba01f['query'][_0x3fa5('0x30')]));_0x16c0a0['attributes']=_0x16c0a0[_0x3fa5('0x32')][_0x3fa5('0x31')]?_0x16c0a0['attributes']:_0x2da8a5[_0x3fa5('0x2f')];if(_0x4ba01f['query'][_0x3fa5('0x3b')]){_0x16c0a0[_0x3fa5('0x40')]=[{'all':!![]}];}_0x16c0a0=_['merge']({},_0x16c0a0,_0x4ba01f[_0x3fa5('0x41')]);return db['CmHopperHistory'][_0x3fa5('0x42')](_0x16c0a0)['then'](handleEntityNotFound(_0x301716,null))[_0x3fa5('0x1f')](respondWithResult(_0x301716,null))[_0x3fa5('0x3d')](handleError(_0x301716,null));};exports[_0x3fa5('0x43')]=function(_0x245bd3,_0x32fea9){return db[_0x3fa5('0x27')]['create'](_0x245bd3[_0x3fa5('0x44')],{})[_0x3fa5('0x1f')](respondWithResult(_0x32fea9,0xc9))['catch'](handleError(_0x32fea9,null));};exports[_0x3fa5('0x45')]=function(_0x5f0ba3,_0x5697ed){return db[_0x3fa5('0x27')][_0x3fa5('0x45')]()[_0x3fa5('0x1f')](respondWithResult(_0x5697ed,null))[_0x3fa5('0x3d')](handleError(_0x5697ed,null));};exports[_0x3fa5('0x1e')]=function(_0x23f079,_0xe56108){if(_0x23f079['body'][_0x3fa5('0x46')]){delete _0x23f079[_0x3fa5('0x44')][_0x3fa5('0x46')];}return db[_0x3fa5('0x27')][_0x3fa5('0x42')]({'where':{'uniqueid':_0x23f079['params']['id']}})['then'](handleEntityNotFound(_0xe56108,null))[_0x3fa5('0x1f')](saveUpdates(_0x23f079[_0x3fa5('0x44')],null))[_0x3fa5('0x1f')](respondWithResult(_0xe56108,null))[_0x3fa5('0x3d')](handleError(_0xe56108,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 733ec06..77e1ea0 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 _0x0c2b=['api','moment','bluebird','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x0c2b,0x194));var _0xb0c2=function(_0x7e47b5,_0x73d3e8){_0x7e47b5=_0x7e47b5-0x0;var _0x28a255=_0x0c2b[_0x7e47b5];return _0x28a255;};'use strict';var _=require(_0xb0c2('0x0'));var util=require(_0xb0c2('0x1'));var logger=require('../../config/logger')(_0xb0c2('0x2'));var moment=require(_0xb0c2('0x3'));var BPromise=require(_0xb0c2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb0c2('0x5'));var config=require(_0xb0c2('0x6'));var attributes=require(_0xb0c2('0x7'));module[_0xb0c2('0x8')]=function(_0x1ba842,_0x5f102a){return _0x1ba842[_0xb0c2('0x9')](_0xb0c2('0xa'),attributes,{'tableName':_0xb0c2('0xb'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xb0c2('0xc')]},{'name':_0xb0c2('0xd'),'fields':[_0xb0c2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd1ca=['lodash','util','bluebird','request-promise','path','../../config/environment','define','cm_hopper_history','endtime','uniqueid'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0xd1ca,0x140));var _0xad1c=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xd1ca[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0xad1c('0x0'));var util=require(_0xad1c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xad1c('0x2'));var rp=require(_0xad1c('0x3'));var fs=require('fs');var path=require(_0xad1c('0x4'));var rimraf=require('rimraf');var config=require(_0xad1c('0x5'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0xd08c6,_0x44ae9c){return _0xd08c6[_0xad1c('0x6')]('CmHopperHistory',attributes,{'tableName':_0xad1c('0x7'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xad1c('0x8')]},{'name':_0xad1c('0x9'),'fields':[_0xad1c('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index fac832f..a249b27 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 _0x422f=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','body','options','AvgHandleTime','findAll','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','CmHopperHistory','raw','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','moment'];(function(_0x59029a,_0x5c0b2c){var _0x41ee54=function(_0x5020c9){while(--_0x5020c9){_0x59029a['push'](_0x59029a['shift']());}};_0x41ee54(++_0x5c0b2c);}(_0x422f,0xd9));var _0xf422=function(_0x3385bc,_0x89b525){_0x3385bc=_0x3385bc-0x0;var _0x43bfc9=_0x422f[_0x3385bc];return _0x43bfc9;};'use strict';var _=require(_0xf422('0x0'));var util=require('util');var moment=require(_0xf422('0x1'));var BPromise=require(_0xf422('0x2'));var rs=require(_0xf422('0x3'));var fs=require('fs');var Redis=require(_0xf422('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf422('0x5'));var logger=require(_0xf422('0x6'))(_0xf422('0x7'));var config=require(_0xf422('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf422('0x9')][_0xf422('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3df250,_0x3b667b,_0x44e391){return new BPromise(function(_0x3f6f26,_0x4b88de){return client[_0xf422('0xb')](_0x3df250,_0x44e391)[_0xf422('0xc')](function(_0x28e169){logger[_0xf422('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x3b667b,_0xf422('0xe'));logger[_0xf422('0xf')](_0xf422('0x10'),_0x3b667b,_0xf422('0xe'),JSON[_0xf422('0x11')](_0x28e169));if(_0x28e169[_0xf422('0x12')]){if(_0x28e169[_0xf422('0x12')][_0xf422('0x13')]===0x1f4){logger[_0xf422('0x12')](_0xf422('0x14'),_0x3b667b,_0x28e169[_0xf422('0x12')]['message']);return _0x4b88de(_0x28e169[_0xf422('0x12')][_0xf422('0x15')]);}logger[_0xf422('0x12')](_0xf422('0x14'),_0x3b667b,_0x28e169[_0xf422('0x12')][_0xf422('0x15')]);return _0x3f6f26(_0x28e169[_0xf422('0x12')][_0xf422('0x15')]);}else{logger['info'](_0xf422('0x14'),_0x3b667b,_0xf422('0xe'));_0x3f6f26(_0x28e169[_0xf422('0x16')][_0xf422('0x15')]);}})[_0xf422('0x17')](function(_0x42e868){logger[_0xf422('0x12')](_0xf422('0x14'),_0x3b667b,_0x42e868);_0x4b88de(_0x42e868);});});}exports[_0xf422('0x18')]=function(_0x5498df){var _0x8c44c0=this;return new Promise(function(_0x345a15,_0x45096d){return db['CmHopperHistory']['create'](_0x5498df[_0xf422('0x19')],{'raw':_0x5498df[_0xf422('0x1a')]?_0x5498df['options']['raw']===undefined?!![]:![]:!![]})[_0xf422('0xc')](function(_0x206b2d){logger[_0xf422('0xd')]('CreateCmHopperHistory',_0x5498df);logger[_0xf422('0xf')](_0xf422('0x18'),_0x5498df,JSON[_0xf422('0x11')](_0x206b2d));_0x345a15(_0x206b2d);})[_0xf422('0x17')](function(_0x53abd4){logger[_0xf422('0x12')](_0xf422('0x18'),_0x53abd4['message'],_0x5498df);_0x45096d(_0x8c44c0[_0xf422('0x12')](0x1f4,_0x53abd4[_0xf422('0x15')]));});});};exports[_0xf422('0x1b')]=function(_0x2f679a){var _0x19ce5b=this;return new Promise(function(_0x523fc4,_0x33d805){return db['CmHopperHistory'][_0xf422('0x1c')]({'raw':_0x2f679a[_0xf422('0x1a')]?_0x2f679a[_0xf422('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2f679a[_0xf422('0x1a')]?_0x2f679a[_0xf422('0x1a')][_0xf422('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')][_0xf422('0x20')]('id')),_0xf422('0x21')],[db[_0xf422('0x1f')]['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db['sequelize'][_0xf422('0x22')](_0xf422('0x23')))),_0xf422('0x24')],[db['sequelize']['fn']('COUNT',db[_0xf422('0x1f')]['fn']('IF',db['sequelize'][_0xf422('0x22')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xf422('0x1f')]['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db[_0xf422('0x1f')][_0xf422('0x22')](_0xf422('0x25')))),_0xf422('0x26')],[db['sequelize']['fn']('AVG',db[_0xf422('0x1f')]['fn']('IF',db[_0xf422('0x1f')]['literal'](_0xf422('0x27')))),_0xf422('0x28')],[db[_0xf422('0x1f')]['fn'](_0xf422('0x29'),db[_0xf422('0x1f')]['fn']('IF',db['sequelize'][_0xf422('0x22')](_0xf422('0x2a')))),_0xf422('0x2b')]]})['then'](function(_0x470e4d){logger['info']('AvgHandleTime',_0x2f679a);logger['debug'](_0xf422('0x1b'),_0x2f679a,JSON[_0xf422('0x11')](_0x470e4d));_0x523fc4(_0x470e4d);})['catch'](function(_0x411ea8){logger[_0xf422('0x12')](_0xf422('0x1b'),_0x411ea8[_0xf422('0x15')],_0x2f679a);_0x33d805(_0x19ce5b[_0xf422('0x12')](0x1f4,_0x411ea8[_0xf422('0x15')]));});});};exports[_0xf422('0x2c')]=function(_0x546264){var _0x2bd699=this;return new Promise(function(_0x3ba49c,_0x146125){return db[_0xf422('0x2d')][_0xf422('0x1c')]({'raw':_0x546264[_0xf422('0x1a')]?_0x546264[_0xf422('0x1a')][_0xf422('0x2e')]===undefined?!![]:![]:!![],'where':_0x546264[_0xf422('0x1a')]?_0x546264['options'][_0xf422('0x1d')]||null:null,'attributes':[['campaign',_0xf422('0x2f')],[db[_0xf422('0x1f')]['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db['sequelize'][_0xf422('0x22')]('`state`\x20=\x200,\x201,\x20null'))),_0xf422('0x30')],[db[_0xf422('0x1f')]['fn']('COUNT',db[_0xf422('0x1f')]['fn']('IF',db[_0xf422('0x1f')][_0xf422('0x22')](_0xf422('0x31')))),_0xf422('0x32')],[db[_0xf422('0x1f')]['fn'](_0xf422('0x1e'),db['sequelize']['fn']('IF',db[_0xf422('0x1f')][_0xf422('0x22')](_0xf422('0x23')))),_0xf422('0x33')],[db[_0xf422('0x1f')]['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db['sequelize'][_0xf422('0x22')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0xf422('0x1f')]['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db[_0xf422('0x1f')][_0xf422('0x22')](_0xf422('0x34')))),_0xf422('0x35')],[db['sequelize']['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db['sequelize'][_0xf422('0x22')](_0xf422('0x36')))),_0xf422('0x37')],[db[_0xf422('0x1f')]['fn']('COUNT',db[_0xf422('0x1f')]['fn']('IF',db[_0xf422('0x1f')]['literal'](_0xf422('0x38')))),_0xf422('0x39')],[db[_0xf422('0x1f')]['fn']('COUNT',db[_0xf422('0x1f')]['fn']('IF',db[_0xf422('0x1f')][_0xf422('0x22')](_0xf422('0x3a')))),_0xf422('0x3b')],[db[_0xf422('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf422('0x1f')][_0xf422('0x22')](_0xf422('0x3c')))),_0xf422('0x3d')],[db[_0xf422('0x1f')]['fn']('COUNT',db[_0xf422('0x1f')]['fn']('IF',db['sequelize'][_0xf422('0x22')](_0xf422('0x3e')))),_0xf422('0x3f')],[db['sequelize']['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db[_0xf422('0x1f')][_0xf422('0x22')](_0xf422('0x40')))),_0xf422('0x41')],[db[_0xf422('0x1f')]['fn'](_0xf422('0x1e'),db['sequelize']['fn']('IF',db[_0xf422('0x1f')]['literal']('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db[_0xf422('0x1f')]['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db['sequelize'][_0xf422('0x22')](_0xf422('0x42')))),_0xf422('0x41')],[db['sequelize']['fn'](_0xf422('0x1e'),db[_0xf422('0x1f')]['fn']('IF',db[_0xf422('0x1f')][_0xf422('0x22')](_0xf422('0x43')))),_0xf422('0x44')]],'group':[_0xf422('0x45')]})[_0xf422('0xc')](function(_0x15559e){logger[_0xf422('0xd')](_0xf422('0x2c'),_0x546264);logger['debug'](_0xf422('0x2c'),_0x546264,JSON['stringify'](_0x15559e));_0x3ba49c(_0x15559e);})[_0xf422('0x17')](function(_0x2797dd){logger['error'](_0xf422('0x2c'),_0x2797dd[_0xf422('0x15')],_0x546264);_0x146125(_0x2bd699[_0xf422('0x12')](0x1f4,_0x2797dd['message']));});});};exports['GetCampaignHopperHistory']=function(_0x1b92ec){var _0x4d92a0=this;return new Promise(function(_0x264e70,_0x4ba29e){return db['CmHopperHistory'][_0xf422('0x1c')]({'raw':_0x1b92ec[_0xf422('0x1a')]?_0x1b92ec[_0xf422('0x1a')][_0xf422('0x2e')]===undefined?!![]:![]:!![],'where':_0x1b92ec[_0xf422('0x1a')]?_0x1b92ec[_0xf422('0x1a')][_0xf422('0x1d')]||null:null,'attributes':[['campaign','name'],[db[_0xf422('0x1f')]['fn']('COUNT',db[_0xf422('0x1f')][_0xf422('0x20')]('id')),_0xf422('0x46')],[db[_0xf422('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xf422('0x22')](_0xf422('0x23')))),_0xf422('0x47')]],'group':[_0xf422('0x45')]})[_0xf422('0xc')](function(_0x236010){logger['info'](_0xf422('0x48'),_0x1b92ec);logger['debug']('GetCampaignHopperHistory',_0x1b92ec,JSON[_0xf422('0x11')](_0x236010));_0x264e70(_0x236010);})[_0xf422('0x17')](function(_0xa514c3){logger['error'](_0xf422('0x48'),_0xa514c3[_0xf422('0x15')],_0x1b92ec);_0x4ba29e(_0x4d92a0[_0xf422('0x12')](0x1f4,_0xa514c3[_0xf422('0x15')]));});});}; \ No newline at end of file +var _0x5dea=['options','raw','where','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','AvgHandleTime','GetVoiceQueueHopperHistory','findAll','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','campaign','ivrAnswerCallsDay','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','catch','CreateCmHopperHistory','CmHopperHistory','create'];(function(_0x31e8b8,_0xd4ce2d){var _0x29d91d=function(_0x27e486){while(--_0x27e486){_0x31e8b8['push'](_0x31e8b8['shift']());}};_0x29d91d(++_0xd4ce2d);}(_0x5dea,0x1bc));var _0xa5de=function(_0x150d8f,_0x26bc1e){_0x150d8f=_0x150d8f-0x0;var _0xff6c99=_0x5dea[_0x150d8f];return _0xff6c99;};'use strict';var _=require(_0xa5de('0x0'));var util=require(_0xa5de('0x1'));var moment=require(_0xa5de('0x2'));var BPromise=require(_0xa5de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa5de('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa5de('0x5'))(_0xa5de('0x6'));var config=require(_0xa5de('0x7'));var jayson=require(_0xa5de('0x8'));var client=jayson['client'][_0xa5de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52ab35,_0x37f97d,_0x39579f){return new BPromise(function(_0x49eb0a,_0x44f1a8){return client[_0xa5de('0xa')](_0x52ab35,_0x39579f)[_0xa5de('0xb')](function(_0x119d05){logger[_0xa5de('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x37f97d,_0xa5de('0xd'));logger[_0xa5de('0xe')](_0xa5de('0xf'),_0x37f97d,_0xa5de('0xd'),JSON[_0xa5de('0x10')](_0x119d05));if(_0x119d05['error']){if(_0x119d05[_0xa5de('0x11')][_0xa5de('0x12')]===0x1f4){logger['error'](_0xa5de('0x13'),_0x37f97d,_0x119d05[_0xa5de('0x11')][_0xa5de('0x14')]);return _0x44f1a8(_0x119d05[_0xa5de('0x11')]['message']);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x37f97d,_0x119d05['error'][_0xa5de('0x14')]);return _0x49eb0a(_0x119d05['error'][_0xa5de('0x14')]);}else{logger[_0xa5de('0xc')](_0xa5de('0x13'),_0x37f97d,_0xa5de('0xd'));_0x49eb0a(_0x119d05['result'][_0xa5de('0x14')]);}})[_0xa5de('0x15')](function(_0x1d4c54){logger[_0xa5de('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x37f97d,_0x1d4c54);_0x44f1a8(_0x1d4c54);});});}exports[_0xa5de('0x16')]=function(_0x4bf68a){var _0x4eccb9=this;return new Promise(function(_0x5302ca,_0x414d8c){return db[_0xa5de('0x17')][_0xa5de('0x18')](_0x4bf68a['body'],{'raw':_0x4bf68a[_0xa5de('0x19')]?_0x4bf68a[_0xa5de('0x19')][_0xa5de('0x1a')]===undefined?!![]:![]:!![]})[_0xa5de('0xb')](function(_0x5e3e42){logger[_0xa5de('0xc')]('CreateCmHopperHistory',_0x4bf68a);logger[_0xa5de('0xe')]('CreateCmHopperHistory',_0x4bf68a,JSON[_0xa5de('0x10')](_0x5e3e42));_0x5302ca(_0x5e3e42);})[_0xa5de('0x15')](function(_0x3b190e){logger[_0xa5de('0x11')](_0xa5de('0x16'),_0x3b190e[_0xa5de('0x14')],_0x4bf68a);_0x414d8c(_0x4eccb9[_0xa5de('0x11')](0x1f4,_0x3b190e[_0xa5de('0x14')]));});});};exports['AvgHandleTime']=function(_0x4938dd){var _0x1e7542=this;return new Promise(function(_0x4ed8e1,_0x181574){return db[_0xa5de('0x17')]['findAll']({'raw':_0x4938dd['options']?_0x4938dd[_0xa5de('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4938dd[_0xa5de('0x19')]?_0x4938dd['options'][_0xa5de('0x1b')]||null:null,'attributes':[[db[_0xa5de('0x1c')]['fn'](_0xa5de('0x1d'),db[_0xa5de('0x1c')][_0xa5de('0x1e')]('id')),'predictiveIntervalTotalCalls'],[db[_0xa5de('0x1c')]['fn'](_0xa5de('0x1d'),db[_0xa5de('0x1c')]['fn']('IF',db[_0xa5de('0x1c')][_0xa5de('0x1f')](_0xa5de('0x20')))),_0xa5de('0x21')],[db[_0xa5de('0x1c')]['fn'](_0xa5de('0x1d'),db[_0xa5de('0x1c')]['fn']('IF',db['sequelize'][_0xa5de('0x1f')](_0xa5de('0x22')))),_0xa5de('0x23')],[db[_0xa5de('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xa5de('0x1c')]['literal'](_0xa5de('0x24')))),_0xa5de('0x25')],[db[_0xa5de('0x1c')]['fn']('AVG',db[_0xa5de('0x1c')]['fn']('IF',db[_0xa5de('0x1c')][_0xa5de('0x1f')](_0xa5de('0x26')))),_0xa5de('0x27')],[db['sequelize']['fn'](_0xa5de('0x28'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x55b822){logger[_0xa5de('0xc')]('AvgHandleTime',_0x4938dd);logger[_0xa5de('0xe')]('AvgHandleTime',_0x4938dd,JSON[_0xa5de('0x10')](_0x55b822));_0x4ed8e1(_0x55b822);})[_0xa5de('0x15')](function(_0x42775b){logger[_0xa5de('0x11')](_0xa5de('0x29'),_0x42775b['message'],_0x4938dd);_0x181574(_0x1e7542[_0xa5de('0x11')](0x1f4,_0x42775b[_0xa5de('0x14')]));});});};exports[_0xa5de('0x2a')]=function(_0x5b2a23){var _0x459899=this;return new Promise(function(_0x42cc38,_0x50f174){return db[_0xa5de('0x17')][_0xa5de('0x2b')]({'raw':_0x5b2a23[_0xa5de('0x19')]?_0x5b2a23['options'][_0xa5de('0x1a')]===undefined?!![]:![]:!![],'where':_0x5b2a23[_0xa5de('0x19')]?_0x5b2a23[_0xa5de('0x19')][_0xa5de('0x1b')]||null:null,'attributes':[['campaign',_0xa5de('0x2c')],[db[_0xa5de('0x1c')]['fn'](_0xa5de('0x1d'),db[_0xa5de('0x1c')]['fn']('IF',db[_0xa5de('0x1c')]['literal'](_0xa5de('0x2d')))),_0xa5de('0x2e')],[db[_0xa5de('0x1c')]['fn']('COUNT',db[_0xa5de('0x1c')]['fn']('IF',db[_0xa5de('0x1c')][_0xa5de('0x1f')](_0xa5de('0x2f')))),_0xa5de('0x30')],[db[_0xa5de('0x1c')]['fn'](_0xa5de('0x1d'),db[_0xa5de('0x1c')]['fn']('IF',db[_0xa5de('0x1c')][_0xa5de('0x1f')](_0xa5de('0x20')))),'outboundAnswerCallsDay'],[db[_0xa5de('0x1c')]['fn']('COUNT',db[_0xa5de('0x1c')]['fn']('IF',db[_0xa5de('0x1c')][_0xa5de('0x1f')](_0xa5de('0x31')))),'outboundBusyCallsDay'],[db[_0xa5de('0x1c')]['fn'](_0xa5de('0x1d'),db['sequelize']['fn']('IF',db[_0xa5de('0x1c')]['literal'](_0xa5de('0x32')))),_0xa5de('0x33')],[db[_0xa5de('0x1c')]['fn'](_0xa5de('0x1d'),db['sequelize']['fn']('IF',db[_0xa5de('0x1c')][_0xa5de('0x1f')](_0xa5de('0x34')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0xa5de('0x1d'),db[_0xa5de('0x1c')]['fn']('IF',db[_0xa5de('0x1c')][_0xa5de('0x1f')](_0xa5de('0x35')))),_0xa5de('0x36')],[db[_0xa5de('0x1c')]['fn'](_0xa5de('0x1d'),db['sequelize']['fn']('IF',db[_0xa5de('0x1c')][_0xa5de('0x1f')]('`state`\x20=\x2012,\x201,\x20null'))),_0xa5de('0x37')],[db[_0xa5de('0x1c')]['fn'](_0xa5de('0x1d'),db[_0xa5de('0x1c')]['fn']('IF',db[_0xa5de('0x1c')][_0xa5de('0x1f')](_0xa5de('0x38')))),_0xa5de('0x39')],[db['sequelize']['fn'](_0xa5de('0x1d'),db[_0xa5de('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xa5de('0x3a')))),_0xa5de('0x3b')],[db['sequelize']['fn']('COUNT',db[_0xa5de('0x1c')]['fn']('IF',db[_0xa5de('0x1c')][_0xa5de('0x1f')]('`state`\x20=\x2018,\x201,\x20null'))),_0xa5de('0x3c')],[db['sequelize']['fn']('COUNT',db[_0xa5de('0x1c')]['fn']('IF',db[_0xa5de('0x1c')][_0xa5de('0x1f')](_0xa5de('0x3d')))),'outboundAnswerAgiCallsDay'],[db[_0xa5de('0x1c')]['fn'](_0xa5de('0x1d'),db[_0xa5de('0x1c')]['fn']('IF',db[_0xa5de('0x1c')][_0xa5de('0x1f')]('`state`\x20=\x2020,\x201,\x20null'))),_0xa5de('0x3c')],[db['sequelize']['fn'](_0xa5de('0x1d'),db[_0xa5de('0x1c')]['fn']('IF',db['sequelize'][_0xa5de('0x1f')](_0xa5de('0x3e')))),_0xa5de('0x3f')]],'group':['campaign']})['then'](function(_0x12eb97){logger[_0xa5de('0xc')]('GetVoiceQueueHopperHistory',_0x5b2a23);logger[_0xa5de('0xe')]('GetVoiceQueueHopperHistory',_0x5b2a23,JSON[_0xa5de('0x10')](_0x12eb97));_0x42cc38(_0x12eb97);})[_0xa5de('0x15')](function(_0x3e0818){logger[_0xa5de('0x11')](_0xa5de('0x2a'),_0x3e0818[_0xa5de('0x14')],_0x5b2a23);_0x50f174(_0x459899[_0xa5de('0x11')](0x1f4,_0x3e0818[_0xa5de('0x14')]));});});};exports[_0xa5de('0x40')]=function(_0xbc113d){var _0x515b7f=this;return new Promise(function(_0x502063,_0x216a49){return db[_0xa5de('0x17')][_0xa5de('0x2b')]({'raw':_0xbc113d[_0xa5de('0x19')]?_0xbc113d[_0xa5de('0x19')][_0xa5de('0x1a')]===undefined?!![]:![]:!![],'where':_0xbc113d[_0xa5de('0x19')]?_0xbc113d['options'][_0xa5de('0x1b')]||null:null,'attributes':[[_0xa5de('0x41'),_0xa5de('0x2c')],[db[_0xa5de('0x1c')]['fn'](_0xa5de('0x1d'),db[_0xa5de('0x1c')][_0xa5de('0x1e')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0xa5de('0x1d'),db[_0xa5de('0x1c')]['fn']('IF',db[_0xa5de('0x1c')][_0xa5de('0x1f')](_0xa5de('0x20')))),_0xa5de('0x42')]],'group':[_0xa5de('0x41')]})['then'](function(_0x3f46fb){logger[_0xa5de('0xc')](_0xa5de('0x40'),_0xbc113d);logger[_0xa5de('0xe')](_0xa5de('0x40'),_0xbc113d,JSON['stringify'](_0x3f46fb));_0x502063(_0x3f46fb);})[_0xa5de('0x15')](function(_0x2f5e6a){logger[_0xa5de('0x11')](_0xa5de('0x40'),_0x2f5e6a[_0xa5de('0x14')],_0xbc113d);_0x216a49(_0x515b7f[_0xa5de('0x11')](0x1f4,_0x2f5e6a[_0xa5de('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index b3e09bb..2dcd308 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 _0x804f=['show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/:id'];(function(_0x5caf51,_0x1cebef){var _0x1cf047=function(_0x428246){while(--_0x428246){_0x5caf51['push'](_0x5caf51['shift']());}};_0x1cf047(++_0x1cebef);}(_0x804f,0x15a));var _0xf804=function(_0x2bd609,_0xf1c40b){_0x2bd609=_0x2bd609-0x0;var _0x347745=_0x804f[_0x2bd609];return _0x347745;};'use strict';var multer=require(_0xf804('0x0'));var util=require(_0xf804('0x1'));var path=require(_0xf804('0x2'));var timeout=require(_0xf804('0x3'));var express=require(_0xf804('0x4'));var router=express[_0xf804('0x5')]();var fs_extra=require(_0xf804('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf804('0x7'));var config=require(_0xf804('0x8'));var controller=require(_0xf804('0x9'));router[_0xf804('0xa')]('/',auth[_0xf804('0xb')](),controller[_0xf804('0xc')]);router[_0xf804('0xa')]('/describe',auth[_0xf804('0xb')](),controller['describe']);router[_0xf804('0xa')](_0xf804('0xd'),auth['isAuthenticated'](),controller[_0xf804('0xe')]);router[_0xf804('0xf')]('/',auth[_0xf804('0xb')](),controller[_0xf804('0x10')]);router[_0xf804('0x11')](_0xf804('0xd'),auth[_0xf804('0xb')](),controller[_0xf804('0x12')]);module[_0xf804('0x13')]=router; \ No newline at end of file +var _0x07a5=['get','isAuthenticated','/describe','describe','/:id','post','create','put','update','multer','util','../../components/auth/service','./cmHopperHistory.controller'];(function(_0x5259c7,_0x27338a){var _0x19e1dd=function(_0x2cd481){while(--_0x2cd481){_0x5259c7['push'](_0x5259c7['shift']());}};_0x19e1dd(++_0x27338a);}(_0x07a5,0x1a9));var _0x507a=function(_0x559cd9,_0x161f8a){_0x559cd9=_0x559cd9-0x0;var _0x40ca25=_0x07a5[_0x559cd9];return _0x40ca25;};'use strict';var multer=require(_0x507a('0x0'));var util=require(_0x507a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x507a('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x507a('0x3'));router[_0x507a('0x4')]('/',auth[_0x507a('0x5')](),controller['index']);router['get'](_0x507a('0x6'),auth[_0x507a('0x5')](),controller[_0x507a('0x7')]);router[_0x507a('0x4')](_0x507a('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x507a('0x9')]('/',auth['isAuthenticated'](),controller[_0x507a('0xa')]);router[_0x507a('0xb')](_0x507a('0x8'),auth[_0x507a('0x5')](),controller[_0x507a('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 1c363c5..ec42621 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 _0x2123=['sequelize','exports','STRING','name'];(function(_0x8692f9,_0x2a4581){var _0x1b21bc=function(_0x24305b){while(--_0x24305b){_0x8692f9['push'](_0x8692f9['shift']());}};_0x1b21bc(++_0x2a4581);}(_0x2123,0x190));var _0x3212=function(_0x58565a,_0x4c73fe){_0x58565a=_0x58565a-0x0;var _0x5868db=_0x2123[_0x58565a];return _0x5868db;};'use strict';var Sequelize=require(_0x3212('0x0'));module[_0x3212('0x1')]={'name':{'type':Sequelize[_0x3212('0x2')],'unique':_0x3212('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3212('0x2')]},'dialPrefix':{'type':Sequelize[_0x3212('0x2')]}}; \ No newline at end of file +var _0x1061=['STRING','sequelize'];(function(_0x1a7691,_0xc6a24c){var _0x11d89b=function(_0x52018d){while(--_0x52018d){_0x1a7691['push'](_0x1a7691['shift']());}};_0x11d89b(++_0xc6a24c);}(_0x1061,0x1b5));var _0x1106=function(_0x307f72,_0x4ecb2b){_0x307f72=_0x307f72-0x0;var _0x317597=_0x1061[_0x307f72];return _0x317597;};'use strict';var Sequelize=require(_0x1106('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1106('0x1')]},'dialPrefix':{'type':Sequelize[_0x1106('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 91a77a8..e914457 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 _0x1a41=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','Lists','status','error','stack','name','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','CmList','include','findAll','rows','catch','length','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','findOne','ListId','removeDispositions','ids','addContacts','tags','isArray','join','push','each','CmContact','omit','dataValues','errors','message','json','Malformed\x20request\x20syntax','CmCustomField','CustomFields','format','cf_%d','nolimit','raw','getContacts','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.deletedAt\x20is\x20null','distinct','field','c.cf_','item','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','cm_contact_has_items','description_additionalPhone_','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','text/csv','download','addCustomField','sequelize','addCustomFields','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cf_%s','getCustomFields','findAndCountAll','addAgents','userCmList:save','removeAgents','userCmList:remove','emit','getAgents','User','info','spread','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x4fc2b3,_0x7ee804){var _0xb65d65=function(_0x31f217){while(--_0x31f217){_0x4fc2b3['push'](_0x4fc2b3['shift']());}};_0xb65d65(++_0x7ee804);}(_0x1a41,0x13c));var _0x11a4=function(_0x19e66f,_0x48c469){_0x19e66f=_0x19e66f-0x0;var _0x1c2cba=_0x1a41[_0x19e66f];return _0x1c2cba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x11a4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x11a4('0x1'));var rp=require('request-promise');var moment=require(_0x11a4('0x2'));var BPromise=require(_0x11a4('0x3'));var Mustache=require(_0x11a4('0x4'));var util=require(_0x11a4('0x5'));var path=require('path');var sox=require(_0x11a4('0x6'));var csv=require(_0x11a4('0x7'));var ejs=require(_0x11a4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11a4('0x9'));var squel=require(_0x11a4('0xa'));var crypto=require(_0x11a4('0xb'));var jsforce=require(_0x11a4('0xc'));var deskjs=require(_0x11a4('0xd'));var toCsv=require(_0x11a4('0x7'));var querystring=require(_0x11a4('0xe'));var Papa=require(_0x11a4('0xf'));var Redis=require(_0x11a4('0x10'));var authService=require(_0x11a4('0x11'));var qs=require(_0x11a4('0x12'));var as=require(_0x11a4('0x13'));var hardwareService=require(_0x11a4('0x14'));var logger=require(_0x11a4('0x15'))('api');var utils=require(_0x11a4('0x16'));var config=require(_0x11a4('0x17'));var licenseUtil=require(_0x11a4('0x18'));var db=require(_0x11a4('0x19'))['db'];var csv_results;config[_0x11a4('0x1a')]=_[_0x11a4('0x1b')](config[_0x11a4('0x1a')],{'host':_0x11a4('0x1c'),'port':0x18eb});var socket=require(_0x11a4('0x1d'))(new Redis(config['redis']));require(_0x11a4('0x1e'))[_0x11a4('0x1f')](socket);function respondWithStatusCode(_0x923601,_0x1f3c85){_0x1f3c85=_0x1f3c85||0xcc;return function(_0x22b5f8){if(_0x22b5f8){return _0x923601[_0x11a4('0x20')](_0x1f3c85);}return _0x923601['status'](_0x1f3c85)[_0x11a4('0x21')]();};}function respondWithResult(_0xac8913,_0x158e91){_0x158e91=_0x158e91||0xc8;return function(_0x4ec01c){if(_0x4ec01c){return _0xac8913['status'](_0x158e91)['json'](_0x4ec01c);}};}function respondWithFilteredResult(_0x163fc8,_0x45e5){return function(_0x127770){if(_0x127770){var _0x3823ef=typeof _0x45e5[_0x11a4('0x22')]===_0x11a4('0x23')&&typeof _0x45e5[_0x11a4('0x24')]===_0x11a4('0x23');var _0x2a6997=_0x127770[_0x11a4('0x25')];var _0x5d2edc=_0x3823ef?0x0:_0x45e5[_0x11a4('0x22')];var _0x145814=_0x3823ef?_0x127770['count']:_0x45e5[_0x11a4('0x22')]+_0x45e5[_0x11a4('0x24')];var _0x2f731b;if(_0x145814>=_0x2a6997){_0x145814=_0x2a6997;_0x2f731b=0xc8;}else{_0x2f731b=0xce;}_0x163fc8['status'](_0x2f731b);return _0x163fc8['set'](_0x11a4('0x26'),_0x5d2edc+'-'+_0x145814+'/'+_0x2a6997)['json'](_0x127770);}return null;};}function patchUpdates(_0x3fb520){return function(_0xde8bda){try{jsonpatch[_0x11a4('0x27')](_0xde8bda,_0x3fb520,!![]);}catch(_0xc57566){return BPromise[_0x11a4('0x28')](_0xc57566);}return _0xde8bda[_0x11a4('0x29')]();};}function saveUpdates(_0x417b43,_0x2179dc){return function(_0x59f948){if(_0x59f948){return _0x59f948[_0x11a4('0x2a')](_0x417b43)[_0x11a4('0x2b')](function(_0x264798){return _0x264798;});}return null;};}function removeEntity(_0x4b1769,_0x296bd6){return function(_0x318f1a){if(_0x318f1a){return _0x318f1a[_0x11a4('0x2c')]()[_0x11a4('0x2b')](function(){var _0x924288=_0x318f1a['get']({'plain':!![]});var _0x5dd75e=_0x11a4('0x2d');return db['UserProfileResource'][_0x11a4('0x2c')]({'where':{'type':_0x5dd75e,'resourceId':_0x924288['id']}})[_0x11a4('0x2b')](function(){return _0x318f1a;});})['then'](function(){_0x4b1769[_0x11a4('0x2e')](0xcc)[_0x11a4('0x21')]();});}};}function handleEntityNotFound(_0xa118a0,_0x236692){return function(_0x994585){if(!_0x994585){_0xa118a0[_0x11a4('0x20')](0x194);}return _0x994585;};}function handleError(_0x5da3fd,_0x2f095b){_0x2f095b=_0x2f095b||0x1f4;return function(_0x5567f4){logger[_0x11a4('0x2f')](_0x5567f4[_0x11a4('0x30')]);if(_0x5567f4['name']){delete _0x5567f4[_0x11a4('0x31')];}_0x5da3fd[_0x11a4('0x2e')](_0x2f095b)['send'](_0x5567f4);};}exports['index']=function(_0x15f264,_0x2e7312){var _0x4d70e0={},_0x1961d5={},_0x42fc47={'count':0x0,'rows':[]};var _0x24d567=_[_0x11a4('0x32')](db['CmList'][_0x11a4('0x33')],function(_0x12abb8){return{'name':_0x12abb8[_0x11a4('0x34')],'type':_0x12abb8[_0x11a4('0x35')][_0x11a4('0x36')]};});_0x1961d5['model']=_[_0x11a4('0x32')](_0x24d567,'name');_0x1961d5[_0x11a4('0x37')]=_[_0x11a4('0x38')](_0x15f264[_0x11a4('0x37')]);_0x1961d5[_0x11a4('0x39')]=_[_0x11a4('0x3a')](_0x1961d5[_0x11a4('0x3b')],_0x1961d5['query']);_0x4d70e0[_0x11a4('0x3c')]=_['intersection'](_0x1961d5['model'],qs['fields'](_0x15f264[_0x11a4('0x37')][_0x11a4('0x3d')]));_0x4d70e0[_0x11a4('0x3c')]=_0x4d70e0['attributes']['length']?_0x4d70e0[_0x11a4('0x3c')]:_0x1961d5['model'];if(!_0x15f264['query'][_0x11a4('0x3e')]('nolimit')){_0x4d70e0[_0x11a4('0x24')]=qs['limit'](_0x15f264[_0x11a4('0x37')][_0x11a4('0x24')]);_0x4d70e0[_0x11a4('0x22')]=qs[_0x11a4('0x22')](_0x15f264[_0x11a4('0x37')][_0x11a4('0x22')]);}_0x4d70e0[_0x11a4('0x3f')]=qs[_0x11a4('0x40')](_0x15f264[_0x11a4('0x37')][_0x11a4('0x40')]);_0x4d70e0[_0x11a4('0x41')]=qs[_0x11a4('0x39')](_[_0x11a4('0x42')](_0x15f264[_0x11a4('0x37')],_0x1961d5['filters']),_0x24d567);if(_0x15f264[_0x11a4('0x37')][_0x11a4('0x43')]){_0x4d70e0[_0x11a4('0x41')]=_[_0x11a4('0x44')](_0x4d70e0[_0x11a4('0x41')],{'$or':_[_0x11a4('0x32')](_0x24d567,function(_0x3e6170){if(_0x3e6170[_0x11a4('0x35')]!==_0x11a4('0x45')){var _0x4de2f2={};_0x4de2f2[_0x3e6170[_0x11a4('0x31')]]={'$like':'%'+_0x15f264[_0x11a4('0x37')][_0x11a4('0x43')]+'%'};return _0x4de2f2;}})});}_0x4d70e0=_['merge']({},_0x4d70e0,_0x15f264[_0x11a4('0x46')]);var _0x4097b3={'where':_0x4d70e0[_0x11a4('0x41')]};return db[_0x11a4('0x47')][_0x11a4('0x25')](_0x4097b3)['then'](function(_0x3dd01c){_0x42fc47[_0x11a4('0x25')]=_0x3dd01c;if(_0x15f264[_0x11a4('0x37')]['includeAll']){_0x4d70e0[_0x11a4('0x48')]=[{'all':!![]}];}return db[_0x11a4('0x47')][_0x11a4('0x49')](_0x4d70e0);})['then'](function(_0x282f31){_0x42fc47[_0x11a4('0x4a')]=_0x282f31;return _0x42fc47;})['then'](respondWithFilteredResult(_0x2e7312,_0x4d70e0))[_0x11a4('0x4b')](handleError(_0x2e7312,null));};exports['show']=function(_0x1d06fe,_0x33d320){var _0x234824={'raw':![],'where':{'id':_0x1d06fe['params']['id']}},_0x1eac1d={};_0x1eac1d[_0x11a4('0x3b')]=_['keys'](db[_0x11a4('0x47')][_0x11a4('0x33')]);_0x1eac1d['query']=_[_0x11a4('0x38')](_0x1d06fe[_0x11a4('0x37')]);_0x1eac1d[_0x11a4('0x39')]=_['intersection'](_0x1eac1d[_0x11a4('0x3b')],_0x1eac1d['query']);_0x234824['attributes']=_['intersection'](_0x1eac1d[_0x11a4('0x3b')],qs[_0x11a4('0x3d')](_0x1d06fe[_0x11a4('0x37')]['fields']));_0x234824[_0x11a4('0x3c')]=_0x234824[_0x11a4('0x3c')][_0x11a4('0x4c')]?_0x234824['attributes']:_0x1eac1d[_0x11a4('0x3b')];if(_0x1d06fe[_0x11a4('0x37')][_0x11a4('0x4d')]){_0x234824[_0x11a4('0x48')]=[{'all':!![]}];}_0x234824=_[_0x11a4('0x44')]({},_0x234824,_0x1d06fe[_0x11a4('0x46')]);return db['CmList'][_0x11a4('0x4e')](_0x234824)[_0x11a4('0x2b')](handleEntityNotFound(_0x33d320,null))[_0x11a4('0x2b')](respondWithResult(_0x33d320,null))[_0x11a4('0x4b')](handleError(_0x33d320,null));};exports[_0x11a4('0x4f')]=function(_0x2d7728,_0x363a76){return db[_0x11a4('0x47')][_0x11a4('0x4f')](_0x2d7728[_0x11a4('0x50')],{})[_0x11a4('0x2b')](function(_0x5ab5e7){var _0x2fb57c=_0x2d7728[_0x11a4('0x51')][_0x11a4('0x52')]({'plain':!![]});if(!_0x2fb57c)throw new Error(_0x11a4('0x53'));if(_0x2fb57c['role']===_0x11a4('0x51')){var _0x139a5f=_0x5ab5e7['get']({'plain':!![]});var _0x5eecce='Lists';return db[_0x11a4('0x54')][_0x11a4('0x4e')]({'where':{'name':_0x5eecce,'userProfileId':_0x2fb57c['userProfileId']},'raw':!![]})[_0x11a4('0x2b')](function(_0xe5ab96){if(_0xe5ab96&&_0xe5ab96['autoAssociation']===0x0){return db['UserProfileResource'][_0x11a4('0x4f')]({'name':_0x139a5f[_0x11a4('0x31')],'resourceId':_0x139a5f['id'],'type':_0xe5ab96[_0x11a4('0x31')],'sectionId':_0xe5ab96['id']},{})[_0x11a4('0x2b')](function(){return _0x5ab5e7;});}else{return _0x5ab5e7;}})['catch'](function(_0x376bb3){logger[_0x11a4('0x2f')](_0x11a4('0x55'),_0x376bb3);throw _0x376bb3;});}return _0x5ab5e7;})['then'](respondWithResult(_0x363a76,0xc9))[_0x11a4('0x4b')](handleError(_0x363a76,null));};exports[_0x11a4('0x2a')]=function(_0x3394f8,_0x104704){if(_0x3394f8[_0x11a4('0x50')]['id']){delete _0x3394f8[_0x11a4('0x50')]['id'];}return db['CmList'][_0x11a4('0x4e')]({'where':{'id':_0x3394f8['params']['id']}})[_0x11a4('0x2b')](handleEntityNotFound(_0x104704,null))[_0x11a4('0x2b')](saveUpdates(_0x3394f8[_0x11a4('0x50')],null))[_0x11a4('0x2b')](respondWithResult(_0x104704,null))[_0x11a4('0x4b')](handleError(_0x104704,null));};exports[_0x11a4('0x2c')]=function(_0x34d627,_0x2a0d2e){return db[_0x11a4('0x47')][_0x11a4('0x4e')]({'where':{'id':_0x34d627[_0x11a4('0x56')]['id']}})[_0x11a4('0x2b')](handleEntityNotFound(_0x2a0d2e,null))[_0x11a4('0x2b')](removeEntity(_0x2a0d2e,null))['catch'](handleError(_0x2a0d2e,null));};exports[_0x11a4('0x57')]=function(_0x14d98d,_0x2f2857){return db[_0x11a4('0x47')][_0x11a4('0x57')]()[_0x11a4('0x2b')](respondWithResult(_0x2f2857,null))[_0x11a4('0x4b')](handleError(_0x2f2857,null));};exports[_0x11a4('0x58')]=function(_0x13a60e,_0x53166f,_0x12dc7d){if(_0x13a60e[_0x11a4('0x50')]['id']){delete _0x13a60e['body']['id'];}return db[_0x11a4('0x47')][_0x11a4('0x4e')]({'where':{'id':_0x13a60e[_0x11a4('0x56')]['id']}})[_0x11a4('0x2b')](handleEntityNotFound(_0x53166f,null))[_0x11a4('0x2b')](function(_0xadf83f){if(_0xadf83f){_0x13a60e['body']['ListId']=_0xadf83f['id'];return db[_0x11a4('0x59')][_0x11a4('0x4f')](_0x13a60e[_0x11a4('0x50')]);}})[_0x11a4('0x2b')](respondWithResult(_0x53166f,null))['catch'](handleError(_0x53166f,null));};exports['getDispositions']=function(_0x405251,_0x4bdb55,_0x426d39){var _0x2ec89c={'raw':![],'where':{}};var _0x2871e7={};var _0x310082={'count':0x0,'rows':[]};return db[_0x11a4('0x47')][_0x11a4('0x5a')]({'where':{'id':_0x405251['params']['id']}})[_0x11a4('0x2b')](handleEntityNotFound(_0x4bdb55,null))[_0x11a4('0x2b')](function(_0x472b23){if(_0x472b23){_0x2871e7[_0x11a4('0x3b')]=_[_0x11a4('0x38')](db['Disposition'][_0x11a4('0x33')]);_0x2871e7[_0x11a4('0x37')]=_['keys'](_0x405251[_0x11a4('0x37')]);_0x2871e7['filters']=_[_0x11a4('0x3a')](_0x2871e7['model'],_0x2871e7[_0x11a4('0x37')]);_0x2ec89c[_0x11a4('0x3c')]=_[_0x11a4('0x3a')](_0x2871e7[_0x11a4('0x3b')],qs[_0x11a4('0x3d')](_0x405251[_0x11a4('0x37')][_0x11a4('0x3d')]));_0x2ec89c[_0x11a4('0x3c')]=_0x2ec89c[_0x11a4('0x3c')][_0x11a4('0x4c')]?_0x2ec89c[_0x11a4('0x3c')]:_0x2871e7[_0x11a4('0x3b')];if(!_0x405251[_0x11a4('0x37')][_0x11a4('0x3e')]('nolimit')){_0x2ec89c[_0x11a4('0x24')]=qs[_0x11a4('0x24')](_0x405251['query'][_0x11a4('0x24')]);_0x2ec89c[_0x11a4('0x22')]=qs['offset'](_0x405251[_0x11a4('0x37')][_0x11a4('0x22')]);}_0x2ec89c[_0x11a4('0x3f')]=qs[_0x11a4('0x40')](_0x405251[_0x11a4('0x37')][_0x11a4('0x40')]);_0x2ec89c['where']=qs[_0x11a4('0x39')](_[_0x11a4('0x42')](_0x405251[_0x11a4('0x37')],_0x2871e7[_0x11a4('0x39')]));_0x2ec89c['where'][_0x11a4('0x5b')]=_0x472b23['id'];if(_0x405251['query'][_0x11a4('0x43')]){_0x2ec89c[_0x11a4('0x41')]=_[_0x11a4('0x44')](_0x2ec89c['where'],{'$or':_[_0x11a4('0x32')](_0x2ec89c[_0x11a4('0x3c')],function(_0x49fb62){var _0x2daa07={};_0x2daa07[_0x49fb62]={'$like':'%'+_0x405251[_0x11a4('0x37')][_0x11a4('0x43')]+'%'};return _0x2daa07;})});}_0x2ec89c=_[_0x11a4('0x44')]({},_0x2ec89c,_0x405251['options']);return db[_0x11a4('0x59')][_0x11a4('0x25')]({'where':_0x2ec89c[_0x11a4('0x41')]})[_0x11a4('0x2b')](function(_0x47f1fc){_0x310082[_0x11a4('0x25')]=_0x47f1fc;if(_0x405251[_0x11a4('0x37')]['includeAll']){_0x2ec89c[_0x11a4('0x48')]=[{'all':!![]}];}return db[_0x11a4('0x59')]['findAll'](_0x2ec89c);})['then'](function(_0x2b59e1){_0x310082[_0x11a4('0x4a')]=_0x2b59e1;return _0x310082;});}})[_0x11a4('0x2b')](respondWithFilteredResult(_0x4bdb55,_0x2ec89c))[_0x11a4('0x4b')](handleError(_0x4bdb55,null));};exports[_0x11a4('0x5c')]=function(_0x2ba7f5,_0x20d9c4,_0x5e41db){return db[_0x11a4('0x47')][_0x11a4('0x4e')]({'where':{'id':_0x2ba7f5[_0x11a4('0x56')]['id']}})[_0x11a4('0x2b')](handleEntityNotFound(_0x20d9c4,null))['then'](function(_0x55a83a){if(_0x55a83a){return _0x55a83a[_0x11a4('0x5c')](_0x2ba7f5[_0x11a4('0x37')][_0x11a4('0x5d')]);}})[_0x11a4('0x2b')](respondWithStatusCode(_0x20d9c4,null))['catch'](handleError(_0x20d9c4,null));};exports[_0x11a4('0x5e')]=function(_0x3d6b30,_0x253a56,_0x5de2f4){return db[_0x11a4('0x47')][_0x11a4('0x4e')]({'where':{'id':_0x3d6b30[_0x11a4('0x56')]['id']}})[_0x11a4('0x2b')](handleEntityNotFound(_0x253a56,null))['then'](function(_0x2804ad){if(_0x2804ad){var _0x21947a=[];var _0xe8487f={'success':[],'errors':[]};return db['CmContact']['describe']()[_0x11a4('0x2b')](function(_0x5a5f93){if(_0x3d6b30[_0x11a4('0x50')][_0x11a4('0x5f')]&&_[_0x11a4('0x60')](_0x3d6b30[_0x11a4('0x50')][_0x11a4('0x5f')])){if(_0x3d6b30[_0x11a4('0x50')][_0x11a4('0x5f')][_0x11a4('0x4c')]){_0x3d6b30[_0x11a4('0x50')][_0x11a4('0x5f')]=_0x3d6b30[_0x11a4('0x50')][_0x11a4('0x5f')][_0x11a4('0x61')](';')+';';}else{_0x3d6b30[_0x11a4('0x50')][_0x11a4('0x5f')]=null;}}else{_0x3d6b30[_0x11a4('0x50')][_0x11a4('0x5f')]=null;}if(_0x3d6b30[_0x11a4('0x50')]&&_[_0x11a4('0x60')](_0x3d6b30[_0x11a4('0x50')])){for(var _0x16c963=0x0;_0x16c963<_0x3d6b30[_0x11a4('0x50')]['length'];_0x16c963+=0x1){_0x3d6b30['body'][_0x16c963][_0x11a4('0x5b')]=_0x3d6b30[_0x11a4('0x56')]['id'];_0x21947a[_0x11a4('0x62')](_0x3d6b30[_0x11a4('0x50')][_0x16c963]);}return BPromise[_0x11a4('0x63')](_0x21947a,function(_0x157a79){return db[_0x11a4('0x64')][_0x11a4('0x4f')](_[_0x11a4('0x65')](_0x157a79,[_0x11a4('0x5d'),'id'])||{},{'fields':_['keys'](_0x5a5f93),'raw':!![]})['then'](function(_0x3ad241){_0xe8487f['success']['push'](_0x3ad241[_0x11a4('0x66')]);})[_0x11a4('0x4b')](function(_0x36280f){_0xe8487f[_0x11a4('0x67')][_0x11a4('0x62')]({'data':_0x157a79,'error':_0x36280f[_0x11a4('0x68')]});});})[_0x11a4('0x2b')](function(_0x5ade65){return _0xe8487f;})[_0x11a4('0x4b')](function(_0x12d37f){return _0x12d37f;});}else{_0x253a56[_0x11a4('0x2e')](0x190)[_0x11a4('0x69')]({'message':_0x11a4('0x6a')});}});}})['then'](respondWithResult(_0x253a56,null))['catch'](handleError(_0x253a56,null));};exports['getContacts']=function(_0x3114af,_0x173c48,_0x4cbab4){var _0x3d4caf;return db['CmList'][_0x11a4('0x4e')]({'where':{'id':_0x3114af[_0x11a4('0x56')]['id']},'include':[{'model':db[_0x11a4('0x6b')],'as':_0x11a4('0x6c')}]})[_0x11a4('0x2b')](handleEntityNotFound(_0x173c48,null))[_0x11a4('0x2b')](function(_0x34e468){if(_0x34e468){_0x3d4caf=_0x34e468;return db['CmContact'][_0x11a4('0x33')];}})[_0x11a4('0x2b')](function(_0x2e291b){if(_0x2e291b){var _0x40f65c={};var _0x149e67={};_0x149e67[_0x11a4('0x3b')]=_['concat'](_[_0x11a4('0x38')](_0x2e291b),_[_0x11a4('0x32')](_0x3d4caf[_0x11a4('0x6c')],function(_0x27fc97){return util[_0x11a4('0x6d')](_0x11a4('0x6e'),_0x27fc97['id']);}));_0x149e67[_0x11a4('0x37')]=_[_0x11a4('0x38')](_0x3114af[_0x11a4('0x37')]);_0x149e67[_0x11a4('0x39')]=_[_0x11a4('0x3a')](_0x149e67[_0x11a4('0x3b')],_0x149e67[_0x11a4('0x37')]);_0x40f65c[_0x11a4('0x3c')]=_['intersection'](_0x149e67['model'],qs[_0x11a4('0x3d')](_0x3114af[_0x11a4('0x37')][_0x11a4('0x3d')]));_0x40f65c['attributes']=_0x40f65c[_0x11a4('0x3c')][_0x11a4('0x4c')]?_0x40f65c[_0x11a4('0x3c')]:_0x149e67['model'];if(!_0x3114af[_0x11a4('0x37')][_0x11a4('0x3e')](_0x11a4('0x6f'))){_0x40f65c[_0x11a4('0x24')]=qs[_0x11a4('0x24')](_0x3114af[_0x11a4('0x37')][_0x11a4('0x24')]);_0x40f65c[_0x11a4('0x22')]=qs[_0x11a4('0x22')](_0x3114af['query'][_0x11a4('0x22')]);}_0x40f65c[_0x11a4('0x3f')]=qs['sort'](_0x3114af['query'][_0x11a4('0x40')]);_0x40f65c['where']=qs['filters'](_[_0x11a4('0x42')](_0x3114af['query'],_0x149e67['filters']));_0x40f65c[_0x11a4('0x70')]=!![];if(_0x3114af[_0x11a4('0x37')][_0x11a4('0x43')]){_0x40f65c[_0x11a4('0x41')]=_['merge'](_0x40f65c['where'],{'$or':_[_0x11a4('0x32')](_0x40f65c[_0x11a4('0x3c')],function(_0xfa1134){var _0x1b53dd={};_0x1b53dd[_0xfa1134]={'$like':'%'+_0x3114af[_0x11a4('0x37')]['filter']+'%'};return _0x1b53dd;})});}_0x40f65c=_[_0x11a4('0x44')]({},_0x40f65c,_0x3114af[_0x11a4('0x46')]);return _0x3d4caf[_0x11a4('0x71')](_0x40f65c);}})[_0x11a4('0x2b')](respondWithResult(_0x173c48,null))[_0x11a4('0x4b')](handleError(_0x173c48,null));};exports['getContactsCsv']=function(_0x1a45c1,_0x3aece0,_0x59e0c8){var _0x4e8e79;var _0x5e2061;var _0x13d9c2;var _0x14597c=_0x1a45c1[_0x11a4('0x56')]['id'];csv_results=[];return db[_0x11a4('0x72')][_0x11a4('0x49')]({'attributes':['id',_0x11a4('0x31')],'raw':!![],'order':[_0x11a4('0x73')]})[_0x11a4('0x2b')](function(_0xb4fd4d){_0x4e8e79=_0xb4fd4d;var _0xce50be=_[_0x11a4('0x38')](db[_0x11a4('0x64')][_0x11a4('0x33')]);return db['CmCustomField']['findAll']({'raw':!![],'attributes':['id',_0x11a4('0x74')]})[_0x11a4('0x2b')](function(_0x341a7d){_0x5e2061=_0x341a7d;var _0x1a4b76=squel[_0x11a4('0x75')]()[_0x11a4('0x3d')](_0xce50be)[_0x11a4('0x76')](_0x11a4('0x77'),'c')[_0x11a4('0x41')]('c.ListId\x20=\x20?',_0x14597c)[_0x11a4('0x41')](_0x11a4('0x78'))[_0x11a4('0x79')]();for(var _0x17b5da=0x0;_0x17b5da<_0x5e2061[_0x11a4('0x4c')];_0x17b5da++){_0x1a4b76[_0x11a4('0x7a')](_0x11a4('0x7b')+_0x5e2061[_0x17b5da]['id'],'customField_'+_0x5e2061[_0x17b5da][_0x11a4('0x74')]);}for(var _0x17b5da=0x0;_0x17b5da<_0x4e8e79[_0x11a4('0x4c')];_0x17b5da++){_0x1a4b76['field'](squel[_0x11a4('0x75')]()['field'](_0x11a4('0x7c'))[_0x11a4('0x76')]('cm_contact_has_items')['where'](_0x11a4('0x7d'),_0x4e8e79[_0x17b5da]['id'])[_0x11a4('0x41')](_0x11a4('0x7e')),_0x11a4('0x7f')+_0x4e8e79[_0x17b5da][_0x11a4('0x31')]);_0x1a4b76['field'](squel['select']()[_0x11a4('0x7a')](_0x11a4('0x80'))['from'](_0x11a4('0x81'))[_0x11a4('0x41')]('ItemTypeId\x20=\x20?',_0x4e8e79[_0x17b5da]['id'])[_0x11a4('0x41')](_0x11a4('0x7e')),_0x11a4('0x82')+_0x4e8e79[_0x17b5da][_0x11a4('0x31')]);}var _0x9a3e50=[];_0x9a3e50['push'](_0x1a4b76['toString']());BPromise[_0x11a4('0x63')](_0x9a3e50,handleQuery)[_0x11a4('0x2b')](function(_0x2373bf){handleQuery(_0x1a4b76['toString']());var _0x4cf62b=csv_results[0x0];if(!_[_0x11a4('0x83')](_0x4cf62b)){var _0x1ee35c=toCsv(_0x4cf62b);var _0x3dc36d=Date[_0x11a4('0x84')]();fs[_0x11a4('0x85')](util['format'](_0x11a4('0x86'),_0x14597c,_0x3dc36d),_0x1ee35c);_0x3aece0[_0x11a4('0x87')](_0x11a4('0x88'),'attachment;\x20filename='+util[_0x11a4('0x6d')](_0x11a4('0x89'),_0x14597c,_0x3dc36d));_0x3aece0['setHeader']('Content-type',_0x11a4('0x8a'));return _0x3aece0[_0x11a4('0x8b')](util[_0x11a4('0x6d')](_0x11a4('0x86'),_0x14597c,_0x3dc36d));}else{return _0x3aece0[_0x11a4('0x20')](0xcc);}});});});};exports[_0x11a4('0x8c')]=function(_0x214225,_0x327c63,_0x3f345d){var _0x544db9;delete _0x214225['body']['id'];return db['CmList']['findOne']({'where':{'id':_0x214225['params']['id']}})[_0x11a4('0x2b')](handleEntityNotFound(_0x327c63,null))['then'](function(_0x3acde8){if(_0x3acde8){return db[_0x11a4('0x8d')]['transaction'](function(_0x211876){return db[_0x11a4('0x6b')][_0x11a4('0x4f')](_0x214225[_0x11a4('0x50')],{'transaction':_0x211876})[_0x11a4('0x2b')](function(_0x537117){_0x544db9=_0x537117;return _0x3acde8[_0x11a4('0x8e')](_0x537117,{'transaction':_0x211876});})[_0x11a4('0x2b')](function(){var _0x4f66ce={'type':db['Sequelize'][_0x11a4('0x8f')],'transaction':_0x211876};switch(_0x214225[_0x11a4('0x50')][_0x11a4('0x35')]){case _0x11a4('0x90'):_0x4f66ce[_0x11a4('0x35')]=db[_0x11a4('0x91')][_0x11a4('0x8f')];break;case _0x11a4('0x92'):_0x4f66ce[_0x11a4('0x35')]=db[_0x11a4('0x91')][_0x11a4('0x93')];break;case _0x11a4('0x94'):_0x4f66ce[_0x11a4('0x35')]=db[_0x11a4('0x91')][_0x11a4('0x95')];_0x4f66ce[_0x11a4('0x96')]=![];break;default:}return db[_0x11a4('0x8d')][_0x11a4('0x97')]['addColumn'](_0x11a4('0x77'),util[_0x11a4('0x6d')](_0x11a4('0x98'),_0x544db9['id']),_0x4f66ce);})['then'](function(){return _0x544db9;});});}})[_0x11a4('0x2b')](respondWithResult(_0x327c63,null))[_0x11a4('0x4b')](handleError(_0x327c63,null));};exports[_0x11a4('0x99')]=function(_0xa1552,_0x14e4d7,_0x444b44){var _0x5f1a7e={};var _0x24823b={};var _0x16acfa;var _0x21c3ea;return db['CmList'][_0x11a4('0x5a')]({'where':{'id':_0xa1552['params']['id']}})[_0x11a4('0x2b')](handleEntityNotFound(_0x14e4d7,null))['then'](function(_0x3103e5){if(_0x3103e5){_0x16acfa=_0x3103e5;_0x24823b[_0x11a4('0x3b')]=_[_0x11a4('0x38')](db[_0x11a4('0x6b')][_0x11a4('0x33')]);_0x24823b[_0x11a4('0x37')]=_[_0x11a4('0x38')](_0xa1552['query']);_0x24823b['filters']=_[_0x11a4('0x3a')](_0x24823b['model'],_0x24823b[_0x11a4('0x37')]);_0x5f1a7e[_0x11a4('0x3c')]=_[_0x11a4('0x3a')](_0x24823b['model'],qs[_0x11a4('0x3d')](_0xa1552['query'][_0x11a4('0x3d')]));_0x5f1a7e[_0x11a4('0x3c')]=_0x5f1a7e[_0x11a4('0x3c')]['length']?_0x5f1a7e[_0x11a4('0x3c')]:_0x24823b[_0x11a4('0x3b')];_0x5f1a7e[_0x11a4('0x3f')]=qs['sort'](_0xa1552[_0x11a4('0x37')]['sort']);_0x5f1a7e['where']=qs[_0x11a4('0x39')](_[_0x11a4('0x42')](_0xa1552[_0x11a4('0x37')],_0x24823b[_0x11a4('0x39')]));_0x5f1a7e['where']=_[_0x11a4('0x44')](_0x5f1a7e[_0x11a4('0x41')],{'$or':[{'ListId':_0x3103e5['id']},{'ListId':null}]});if(_0xa1552[_0x11a4('0x37')][_0x11a4('0x43')]){_0x5f1a7e[_0x11a4('0x41')]=_[_0x11a4('0x44')](_0x5f1a7e[_0x11a4('0x41')],{'$or':_[_0x11a4('0x32')](_0x5f1a7e[_0x11a4('0x3c')],function(_0x1b90b3){var _0x1c102f={};_0x1c102f[_0x1b90b3]={'$like':'%'+_0xa1552[_0x11a4('0x37')][_0x11a4('0x43')]+'%'};return _0x1c102f;})});}_0x5f1a7e=_[_0x11a4('0x44')]({},_0x5f1a7e,_0xa1552[_0x11a4('0x46')]);return db[_0x11a4('0x6b')][_0x11a4('0x9a')](_0x5f1a7e);}})[_0x11a4('0x2b')](respondWithResult(_0x14e4d7,null))[_0x11a4('0x4b')](handleError(_0x14e4d7,null));};exports['getGlobalCustomFields']=function(_0x5814b2,_0x4176f5){return db['CmCustomField'][_0x11a4('0x9a')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x4176f5,null))[_0x11a4('0x2b')](function(_0x3913dc){return _0x3913dc;})[_0x11a4('0x2b')](respondWithResult(_0x4176f5,null))['catch'](handleError(_0x4176f5,null));};exports[_0x11a4('0x9b')]=function(_0x278135,_0x1aa2c5,_0x5a0bff){return db[_0x11a4('0x47')][_0x11a4('0x4e')]({'where':{'id':_0x278135[_0x11a4('0x56')]['id']}})[_0x11a4('0x2b')](handleEntityNotFound(_0x1aa2c5,null))[_0x11a4('0x2b')](function(_0x3d8307){if(_0x3d8307){return _0x3d8307['addAgents'](_0x278135[_0x11a4('0x50')][_0x11a4('0x5d')],_[_0x11a4('0x65')](_0x278135[_0x11a4('0x50')],[_0x11a4('0x5d'),'id'])||{})['spread'](function(_0x35d962){for(var _0x2b4f5e=0x0;_0x2b4f5e<_0x278135[_0x11a4('0x50')][_0x11a4('0x5d')][_0x11a4('0x4c')];_0x2b4f5e+=0x1){socket['emit'](_0x11a4('0x9c'),{'UserId':Number(_0x278135['body']['ids'][_0x2b4f5e]),'CmListId':Number(_0x278135[_0x11a4('0x56')]['id'])});}return _0x35d962;});}})['then'](respondWithResult(_0x1aa2c5,null))[_0x11a4('0x4b')](handleError(_0x1aa2c5,null));};exports[_0x11a4('0x9d')]=function(_0x21d4ae,_0x57f996,_0x12f1c0){return db['CmList']['find']({'where':{'id':_0x21d4ae[_0x11a4('0x56')]['id']}})['then'](handleEntityNotFound(_0x57f996,null))[_0x11a4('0x2b')](function(_0x592da9){if(_0x592da9){return _0x592da9[_0x11a4('0x9d')](_0x21d4ae[_0x11a4('0x37')]['ids'])['then'](function(){if(_[_0x11a4('0x60')](_0x21d4ae[_0x11a4('0x37')][_0x11a4('0x5d')])){for(var _0x3b3ca5=0x0;_0x3b3ca5<_0x21d4ae[_0x11a4('0x37')][_0x11a4('0x5d')][_0x11a4('0x4c')];_0x3b3ca5+=0x1){socket['emit'](_0x11a4('0x9e'),{'UserId':Number(_0x21d4ae[_0x11a4('0x37')][_0x11a4('0x5d')][_0x3b3ca5]),'CmListId':Number(_0x21d4ae[_0x11a4('0x56')]['id'])});}}else{socket[_0x11a4('0x9f')](_0x11a4('0x9e'),{'UserId':Number(_0x21d4ae[_0x11a4('0x37')][_0x11a4('0x5d')]),'CmListId':Number(_0x21d4ae['params']['id'])});}});}})[_0x11a4('0x2b')](respondWithStatusCode(_0x57f996,null))[_0x11a4('0x4b')](handleError(_0x57f996,null));};exports[_0x11a4('0xa0')]=function(_0x5e3a20,_0x43a9ad,_0x3f8e37){var _0x30f1e3={};var _0x3bbad9={};var _0x28fbdb;var _0x20b438;return db[_0x11a4('0x47')][_0x11a4('0x5a')]({'where':{'id':_0x5e3a20[_0x11a4('0x56')]['id']}})[_0x11a4('0x2b')](handleEntityNotFound(_0x43a9ad,null))[_0x11a4('0x2b')](function(_0x27674e){if(_0x27674e){_0x28fbdb=_0x27674e;_0x3bbad9[_0x11a4('0x3b')]=_[_0x11a4('0x38')](db[_0x11a4('0xa1')][_0x11a4('0x33')]);_0x3bbad9[_0x11a4('0x37')]=_[_0x11a4('0x38')](_0x5e3a20[_0x11a4('0x37')]);_0x3bbad9['filters']=_[_0x11a4('0x3a')](_0x3bbad9[_0x11a4('0x3b')],_0x3bbad9[_0x11a4('0x37')]);_0x30f1e3[_0x11a4('0x3c')]=_[_0x11a4('0x3a')](_0x3bbad9[_0x11a4('0x3b')],qs['fields'](_0x5e3a20[_0x11a4('0x37')][_0x11a4('0x3d')]));_0x30f1e3['attributes']=_0x30f1e3[_0x11a4('0x3c')][_0x11a4('0x4c')]?_0x30f1e3[_0x11a4('0x3c')]:_0x3bbad9[_0x11a4('0x3b')];_0x30f1e3[_0x11a4('0x3f')]=qs[_0x11a4('0x40')](_0x5e3a20[_0x11a4('0x37')]['sort']);_0x30f1e3[_0x11a4('0x41')]=qs[_0x11a4('0x39')](_[_0x11a4('0x42')](_0x5e3a20[_0x11a4('0x37')],_0x3bbad9[_0x11a4('0x39')]));if(_0x5e3a20[_0x11a4('0x37')][_0x11a4('0x43')]){_0x30f1e3['where']=_['merge'](_0x30f1e3['where'],{'$or':_['map'](_0x30f1e3[_0x11a4('0x3c')],function(_0x5e2529){var _0x3dba89={};_0x3dba89[_0x5e2529]={'$like':'%'+_0x5e3a20[_0x11a4('0x37')][_0x11a4('0x43')]+'%'};return _0x3dba89;})});}_0x30f1e3=_['merge']({},_0x30f1e3,_0x5e3a20[_0x11a4('0x46')]);return _0x28fbdb[_0x11a4('0xa0')](_0x30f1e3);}})['then'](function(_0x57b8ec){if(_0x57b8ec){_0x20b438=_0x57b8ec[_0x11a4('0x4c')];if(!_0x5e3a20[_0x11a4('0x37')][_0x11a4('0x3e')]('nolimit')){_0x30f1e3['limit']=qs[_0x11a4('0x24')](_0x5e3a20[_0x11a4('0x37')][_0x11a4('0x24')]);_0x30f1e3[_0x11a4('0x22')]=qs[_0x11a4('0x22')](_0x5e3a20['query']['offset']);}return _0x28fbdb[_0x11a4('0xa0')](_0x30f1e3);}})[_0x11a4('0x2b')](function(_0x36734c){if(_0x36734c){return _0x36734c?{'count':_0x20b438,'rows':_0x36734c}:null;}})[_0x11a4('0x2b')](respondWithResult(_0x43a9ad,null))['catch'](handleError(_0x43a9ad,null));};function handleQuery(_0x2e37a5){logger[_0x11a4('0xa2')](_0x2e37a5);return db[_0x11a4('0x8d')][_0x11a4('0x37')](_0x2e37a5)[_0x11a4('0xa3')](function(_0x4c2153){csv_results[_0x11a4('0x62')](_0x4c2153);})[_0x11a4('0x4b')](function(_0x22453c){logger[_0x11a4('0x2f')](_0x22453c[_0x11a4('0x68')]);});} \ No newline at end of file +var _0x2bae=['find','create','user','get','role','userProfileId','body','describe','ListId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addContacts','tags','isArray','join','push','CmContact','omit','success','errors','message','getContacts','CmCustomField','CustomFields','cf_%d','pick','raw','getContactsCsv','ContactItemType','OrderBy','alias','select','cm_contacts','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','from','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description_additionalPhone_','toString','isEmpty','now','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','count','limit','apply','reject','save','update','then','Lists','UserProfileResource','destroy','end','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','CmList','findAll','catch','params','includeAll','include'];(function(_0x5b84e5,_0x26076b){var _0xff9066=function(_0x3f17df){while(--_0x3f17df){_0x5b84e5['push'](_0x5b84e5['shift']());}};_0xff9066(++_0x26076b);}(_0x2bae,0x18f));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe2ba('0x0'));var rimraf=require(_0xe2ba('0x1'));var zipdir=require(_0xe2ba('0x2'));var jsonpatch=require(_0xe2ba('0x3'));var rp=require(_0xe2ba('0x4'));var moment=require(_0xe2ba('0x5'));var BPromise=require(_0xe2ba('0x6'));var Mustache=require(_0xe2ba('0x7'));var util=require(_0xe2ba('0x8'));var path=require(_0xe2ba('0x9'));var sox=require(_0xe2ba('0xa'));var csv=require('to-csv');var ejs=require(_0xe2ba('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe2ba('0xc'));var squel=require(_0xe2ba('0xd'));var crypto=require('crypto');var jsforce=require(_0xe2ba('0xe'));var deskjs=require(_0xe2ba('0xf'));var toCsv=require(_0xe2ba('0x10'));var querystring=require(_0xe2ba('0x11'));var Papa=require(_0xe2ba('0x12'));var Redis=require(_0xe2ba('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xe2ba('0x14'));var as=require(_0xe2ba('0x15'));var hardwareService=require(_0xe2ba('0x16'));var logger=require(_0xe2ba('0x17'))('api');var utils=require(_0xe2ba('0x18'));var config=require(_0xe2ba('0x19'));var licenseUtil=require(_0xe2ba('0x1a'));var db=require('../../mysqldb')['db'];var csv_results;config[_0xe2ba('0x1b')]=_['defaults'](config[_0xe2ba('0x1b')],{'host':_0xe2ba('0x1c'),'port':0x18eb});var socket=require(_0xe2ba('0x1d'))(new Redis(config[_0xe2ba('0x1b')]));require(_0xe2ba('0x1e'))[_0xe2ba('0x1f')](socket);function respondWithStatusCode(_0x3a1bc0,_0x2ddc28){_0x2ddc28=_0x2ddc28||0xcc;return function(_0xf50867){if(_0xf50867){return _0x3a1bc0[_0xe2ba('0x20')](_0x2ddc28);}return _0x3a1bc0[_0xe2ba('0x21')](_0x2ddc28)['end']();};}function respondWithResult(_0x4c0007,_0x466c24){_0x466c24=_0x466c24||0xc8;return function(_0x56c8c3){if(_0x56c8c3){return _0x4c0007['status'](_0x466c24)[_0xe2ba('0x22')](_0x56c8c3);}};}function respondWithFilteredResult(_0x58177d,_0x13d53d){return function(_0x3df46d){if(_0x3df46d){var _0x1f46a8=typeof _0x13d53d[_0xe2ba('0x23')]==='undefined'&&typeof _0x13d53d['limit']===_0xe2ba('0x24');var _0x3db3d0=_0x3df46d[_0xe2ba('0x25')];var _0x480248=_0x1f46a8?0x0:_0x13d53d[_0xe2ba('0x23')];var _0x36ab05=_0x1f46a8?_0x3df46d[_0xe2ba('0x25')]:_0x13d53d[_0xe2ba('0x23')]+_0x13d53d[_0xe2ba('0x26')];var _0x3d5d64;if(_0x36ab05>=_0x3db3d0){_0x36ab05=_0x3db3d0;_0x3d5d64=0xc8;}else{_0x3d5d64=0xce;}_0x58177d[_0xe2ba('0x21')](_0x3d5d64);return _0x58177d['set']('Content-Range',_0x480248+'-'+_0x36ab05+'/'+_0x3db3d0)['json'](_0x3df46d);}return null;};}function patchUpdates(_0x5b47f9){return function(_0x181833){try{jsonpatch[_0xe2ba('0x27')](_0x181833,_0x5b47f9,!![]);}catch(_0xab2e55){return BPromise[_0xe2ba('0x28')](_0xab2e55);}return _0x181833[_0xe2ba('0x29')]();};}function saveUpdates(_0x202cb8,_0x4e6bc4){return function(_0x4cb845){if(_0x4cb845){return _0x4cb845[_0xe2ba('0x2a')](_0x202cb8)[_0xe2ba('0x2b')](function(_0x3bc464){return _0x3bc464;});}return null;};}function removeEntity(_0x3ba6d7,_0x1b718c){return function(_0x1e2682){if(_0x1e2682){return _0x1e2682['destroy']()['then'](function(){var _0x4afde9=_0x1e2682['get']({'plain':!![]});var _0x6c1b2=_0xe2ba('0x2c');return db[_0xe2ba('0x2d')][_0xe2ba('0x2e')]({'where':{'type':_0x6c1b2,'resourceId':_0x4afde9['id']}})[_0xe2ba('0x2b')](function(){return _0x1e2682;});})[_0xe2ba('0x2b')](function(){_0x3ba6d7['status'](0xcc)[_0xe2ba('0x2f')]();});}};}function handleEntityNotFound(_0xa0574,_0x4997cd){return function(_0x329333){if(!_0x329333){_0xa0574['sendStatus'](0x194);}return _0x329333;};}function handleError(_0xb7238e,_0x180d4b){_0x180d4b=_0x180d4b||0x1f4;return function(_0x24421e){logger[_0xe2ba('0x30')](_0x24421e[_0xe2ba('0x31')]);if(_0x24421e['name']){delete _0x24421e[_0xe2ba('0x32')];}_0xb7238e[_0xe2ba('0x21')](_0x180d4b)[_0xe2ba('0x33')](_0x24421e);};}exports[_0xe2ba('0x34')]=function(_0x5d2550,_0x224e3e){var _0x2498fd={},_0x5afb45={},_0x46fb29={'count':0x0,'rows':[]};var _0x19a8c7=_[_0xe2ba('0x35')](db['CmList'][_0xe2ba('0x36')],function(_0x405871){return{'name':_0x405871['fieldName'],'type':_0x405871[_0xe2ba('0x37')]['key']};});_0x5afb45[_0xe2ba('0x38')]=_[_0xe2ba('0x35')](_0x19a8c7,_0xe2ba('0x32'));_0x5afb45[_0xe2ba('0x39')]=_[_0xe2ba('0x3a')](_0x5d2550[_0xe2ba('0x39')]);_0x5afb45[_0xe2ba('0x3b')]=_[_0xe2ba('0x3c')](_0x5afb45[_0xe2ba('0x38')],_0x5afb45[_0xe2ba('0x39')]);_0x2498fd[_0xe2ba('0x3d')]=_[_0xe2ba('0x3c')](_0x5afb45[_0xe2ba('0x38')],qs[_0xe2ba('0x3e')](_0x5d2550[_0xe2ba('0x39')][_0xe2ba('0x3e')]));_0x2498fd[_0xe2ba('0x3d')]=_0x2498fd[_0xe2ba('0x3d')][_0xe2ba('0x3f')]?_0x2498fd[_0xe2ba('0x3d')]:_0x5afb45[_0xe2ba('0x38')];if(!_0x5d2550[_0xe2ba('0x39')]['hasOwnProperty'](_0xe2ba('0x40'))){_0x2498fd[_0xe2ba('0x26')]=qs['limit'](_0x5d2550[_0xe2ba('0x39')]['limit']);_0x2498fd['offset']=qs['offset'](_0x5d2550[_0xe2ba('0x39')][_0xe2ba('0x23')]);}_0x2498fd[_0xe2ba('0x41')]=qs[_0xe2ba('0x42')](_0x5d2550[_0xe2ba('0x39')][_0xe2ba('0x42')]);_0x2498fd[_0xe2ba('0x43')]=qs[_0xe2ba('0x3b')](_['pick'](_0x5d2550[_0xe2ba('0x39')],_0x5afb45[_0xe2ba('0x3b')]),_0x19a8c7);if(_0x5d2550[_0xe2ba('0x39')][_0xe2ba('0x44')]){_0x2498fd[_0xe2ba('0x43')]=_['merge'](_0x2498fd[_0xe2ba('0x43')],{'$or':_[_0xe2ba('0x35')](_0x19a8c7,function(_0x35d653){if(_0x35d653[_0xe2ba('0x37')]!==_0xe2ba('0x45')){var _0x2d812a={};_0x2d812a[_0x35d653[_0xe2ba('0x32')]]={'$like':'%'+_0x5d2550['query'][_0xe2ba('0x44')]+'%'};return _0x2d812a;}})});}_0x2498fd=_[_0xe2ba('0x46')]({},_0x2498fd,_0x5d2550[_0xe2ba('0x47')]);var _0x1a1848={'where':_0x2498fd[_0xe2ba('0x43')]};return db[_0xe2ba('0x48')][_0xe2ba('0x25')](_0x1a1848)[_0xe2ba('0x2b')](function(_0x2d5d62){_0x46fb29[_0xe2ba('0x25')]=_0x2d5d62;if(_0x5d2550[_0xe2ba('0x39')]['includeAll']){_0x2498fd['include']=[{'all':!![]}];}return db[_0xe2ba('0x48')][_0xe2ba('0x49')](_0x2498fd);})[_0xe2ba('0x2b')](function(_0x466ba2){_0x46fb29['rows']=_0x466ba2;return _0x46fb29;})[_0xe2ba('0x2b')](respondWithFilteredResult(_0x224e3e,_0x2498fd))[_0xe2ba('0x4a')](handleError(_0x224e3e,null));};exports['show']=function(_0x453210,_0x8b3a90){var _0xc4215={'raw':![],'where':{'id':_0x453210[_0xe2ba('0x4b')]['id']}},_0x18b5e7={};_0x18b5e7[_0xe2ba('0x38')]=_['keys'](db[_0xe2ba('0x48')][_0xe2ba('0x36')]);_0x18b5e7[_0xe2ba('0x39')]=_[_0xe2ba('0x3a')](_0x453210[_0xe2ba('0x39')]);_0x18b5e7[_0xe2ba('0x3b')]=_[_0xe2ba('0x3c')](_0x18b5e7['model'],_0x18b5e7[_0xe2ba('0x39')]);_0xc4215['attributes']=_['intersection'](_0x18b5e7['model'],qs['fields'](_0x453210[_0xe2ba('0x39')]['fields']));_0xc4215[_0xe2ba('0x3d')]=_0xc4215[_0xe2ba('0x3d')][_0xe2ba('0x3f')]?_0xc4215[_0xe2ba('0x3d')]:_0x18b5e7[_0xe2ba('0x38')];if(_0x453210[_0xe2ba('0x39')][_0xe2ba('0x4c')]){_0xc4215[_0xe2ba('0x4d')]=[{'all':!![]}];}_0xc4215=_[_0xe2ba('0x46')]({},_0xc4215,_0x453210[_0xe2ba('0x47')]);return db[_0xe2ba('0x48')][_0xe2ba('0x4e')](_0xc4215)['then'](handleEntityNotFound(_0x8b3a90,null))['then'](respondWithResult(_0x8b3a90,null))[_0xe2ba('0x4a')](handleError(_0x8b3a90,null));};exports[_0xe2ba('0x4f')]=function(_0x2286ef,_0x2f5be2){return db[_0xe2ba('0x48')]['create'](_0x2286ef['body'],{})[_0xe2ba('0x2b')](function(_0x11ab65){var _0x4458b2=_0x2286ef[_0xe2ba('0x50')][_0xe2ba('0x51')]({'plain':!![]});if(!_0x4458b2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4458b2[_0xe2ba('0x52')]==='user'){var _0xc27ee5=_0x11ab65[_0xe2ba('0x51')]({'plain':!![]});var _0x11e42d=_0xe2ba('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x11e42d,'userProfileId':_0x4458b2[_0xe2ba('0x53')]},'raw':!![]})[_0xe2ba('0x2b')](function(_0x29fd43){if(_0x29fd43&&_0x29fd43['autoAssociation']===0x0){return db[_0xe2ba('0x2d')][_0xe2ba('0x4f')]({'name':_0xc27ee5['name'],'resourceId':_0xc27ee5['id'],'type':_0x29fd43[_0xe2ba('0x32')],'sectionId':_0x29fd43['id']},{})[_0xe2ba('0x2b')](function(){return _0x11ab65;});}else{return _0x11ab65;}})[_0xe2ba('0x4a')](function(_0x2dd382){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2dd382);throw _0x2dd382;});}return _0x11ab65;})['then'](respondWithResult(_0x2f5be2,0xc9))['catch'](handleError(_0x2f5be2,null));};exports[_0xe2ba('0x2a')]=function(_0x5f58e9,_0x3fef84){if(_0x5f58e9[_0xe2ba('0x54')]['id']){delete _0x5f58e9[_0xe2ba('0x54')]['id'];}return db[_0xe2ba('0x48')][_0xe2ba('0x4e')]({'where':{'id':_0x5f58e9[_0xe2ba('0x4b')]['id']}})[_0xe2ba('0x2b')](handleEntityNotFound(_0x3fef84,null))[_0xe2ba('0x2b')](saveUpdates(_0x5f58e9[_0xe2ba('0x54')],null))[_0xe2ba('0x2b')](respondWithResult(_0x3fef84,null))[_0xe2ba('0x4a')](handleError(_0x3fef84,null));};exports[_0xe2ba('0x2e')]=function(_0x2e6fc8,_0x16cb88){return db[_0xe2ba('0x48')][_0xe2ba('0x4e')]({'where':{'id':_0x2e6fc8[_0xe2ba('0x4b')]['id']}})[_0xe2ba('0x2b')](handleEntityNotFound(_0x16cb88,null))[_0xe2ba('0x2b')](removeEntity(_0x16cb88,null))[_0xe2ba('0x4a')](handleError(_0x16cb88,null));};exports[_0xe2ba('0x55')]=function(_0x309ba8,_0x589c85){return db[_0xe2ba('0x48')][_0xe2ba('0x55')]()[_0xe2ba('0x2b')](respondWithResult(_0x589c85,null))[_0xe2ba('0x4a')](handleError(_0x589c85,null));};exports['addDisposition']=function(_0x39adbe,_0x210672,_0x4a2147){if(_0x39adbe[_0xe2ba('0x54')]['id']){delete _0x39adbe['body']['id'];}return db[_0xe2ba('0x48')][_0xe2ba('0x4e')]({'where':{'id':_0x39adbe[_0xe2ba('0x4b')]['id']}})[_0xe2ba('0x2b')](handleEntityNotFound(_0x210672,null))[_0xe2ba('0x2b')](function(_0x2f3479){if(_0x2f3479){_0x39adbe[_0xe2ba('0x54')][_0xe2ba('0x56')]=_0x2f3479['id'];return db[_0xe2ba('0x57')][_0xe2ba('0x4f')](_0x39adbe['body']);}})['then'](respondWithResult(_0x210672,null))['catch'](handleError(_0x210672,null));};exports[_0xe2ba('0x58')]=function(_0x3989d5,_0x4c05fb,_0x1d607a){var _0x44c71f={'raw':![],'where':{}};var _0x269a7f={};var _0x5c4b7f={'count':0x0,'rows':[]};return db[_0xe2ba('0x48')][_0xe2ba('0x59')]({'where':{'id':_0x3989d5[_0xe2ba('0x4b')]['id']}})[_0xe2ba('0x2b')](handleEntityNotFound(_0x4c05fb,null))[_0xe2ba('0x2b')](function(_0xd4fd2f){if(_0xd4fd2f){_0x269a7f[_0xe2ba('0x38')]=_[_0xe2ba('0x3a')](db[_0xe2ba('0x57')][_0xe2ba('0x36')]);_0x269a7f[_0xe2ba('0x39')]=_[_0xe2ba('0x3a')](_0x3989d5['query']);_0x269a7f[_0xe2ba('0x3b')]=_[_0xe2ba('0x3c')](_0x269a7f[_0xe2ba('0x38')],_0x269a7f[_0xe2ba('0x39')]);_0x44c71f['attributes']=_[_0xe2ba('0x3c')](_0x269a7f[_0xe2ba('0x38')],qs[_0xe2ba('0x3e')](_0x3989d5[_0xe2ba('0x39')]['fields']));_0x44c71f[_0xe2ba('0x3d')]=_0x44c71f['attributes'][_0xe2ba('0x3f')]?_0x44c71f[_0xe2ba('0x3d')]:_0x269a7f[_0xe2ba('0x38')];if(!_0x3989d5[_0xe2ba('0x39')][_0xe2ba('0x5a')](_0xe2ba('0x40'))){_0x44c71f['limit']=qs['limit'](_0x3989d5['query'][_0xe2ba('0x26')]);_0x44c71f[_0xe2ba('0x23')]=qs[_0xe2ba('0x23')](_0x3989d5[_0xe2ba('0x39')][_0xe2ba('0x23')]);}_0x44c71f[_0xe2ba('0x41')]=qs[_0xe2ba('0x42')](_0x3989d5[_0xe2ba('0x39')][_0xe2ba('0x42')]);_0x44c71f[_0xe2ba('0x43')]=qs['filters'](_['pick'](_0x3989d5[_0xe2ba('0x39')],_0x269a7f[_0xe2ba('0x3b')]));_0x44c71f[_0xe2ba('0x43')][_0xe2ba('0x56')]=_0xd4fd2f['id'];if(_0x3989d5[_0xe2ba('0x39')][_0xe2ba('0x44')]){_0x44c71f[_0xe2ba('0x43')]=_[_0xe2ba('0x46')](_0x44c71f[_0xe2ba('0x43')],{'$or':_[_0xe2ba('0x35')](_0x44c71f[_0xe2ba('0x3d')],function(_0xc0aa52){var _0x2e9697={};_0x2e9697[_0xc0aa52]={'$like':'%'+_0x3989d5['query']['filter']+'%'};return _0x2e9697;})});}_0x44c71f=_[_0xe2ba('0x46')]({},_0x44c71f,_0x3989d5[_0xe2ba('0x47')]);return db[_0xe2ba('0x57')][_0xe2ba('0x25')]({'where':_0x44c71f['where']})[_0xe2ba('0x2b')](function(_0x2bf8d6){_0x5c4b7f[_0xe2ba('0x25')]=_0x2bf8d6;if(_0x3989d5[_0xe2ba('0x39')][_0xe2ba('0x4c')]){_0x44c71f['include']=[{'all':!![]}];}return db[_0xe2ba('0x57')][_0xe2ba('0x49')](_0x44c71f);})[_0xe2ba('0x2b')](function(_0x302e1d){_0x5c4b7f['rows']=_0x302e1d;return _0x5c4b7f;});}})[_0xe2ba('0x2b')](respondWithFilteredResult(_0x4c05fb,_0x44c71f))[_0xe2ba('0x4a')](handleError(_0x4c05fb,null));};exports[_0xe2ba('0x5b')]=function(_0x160d27,_0x35efe2,_0x5dbf8b){return db[_0xe2ba('0x48')][_0xe2ba('0x4e')]({'where':{'id':_0x160d27[_0xe2ba('0x4b')]['id']}})[_0xe2ba('0x2b')](handleEntityNotFound(_0x35efe2,null))[_0xe2ba('0x2b')](function(_0x7dc3f6){if(_0x7dc3f6){return _0x7dc3f6[_0xe2ba('0x5b')](_0x160d27[_0xe2ba('0x39')][_0xe2ba('0x5c')]);}})['then'](respondWithStatusCode(_0x35efe2,null))[_0xe2ba('0x4a')](handleError(_0x35efe2,null));};exports[_0xe2ba('0x5d')]=function(_0xc5a484,_0xc59e6,_0x34eb32){return db[_0xe2ba('0x48')]['find']({'where':{'id':_0xc5a484[_0xe2ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0xc59e6,null))[_0xe2ba('0x2b')](function(_0x33bcbb){if(_0x33bcbb){var _0x3a920e=[];var _0x58761d={'success':[],'errors':[]};return db['CmContact']['describe']()[_0xe2ba('0x2b')](function(_0x333622){if(_0xc5a484['body'][_0xe2ba('0x5e')]&&_[_0xe2ba('0x5f')](_0xc5a484[_0xe2ba('0x54')][_0xe2ba('0x5e')])){if(_0xc5a484[_0xe2ba('0x54')][_0xe2ba('0x5e')]['length']){_0xc5a484[_0xe2ba('0x54')]['tags']=_0xc5a484[_0xe2ba('0x54')][_0xe2ba('0x5e')][_0xe2ba('0x60')](';')+';';}else{_0xc5a484[_0xe2ba('0x54')][_0xe2ba('0x5e')]=null;}}else{_0xc5a484[_0xe2ba('0x54')][_0xe2ba('0x5e')]=null;}if(_0xc5a484[_0xe2ba('0x54')]&&_[_0xe2ba('0x5f')](_0xc5a484[_0xe2ba('0x54')])){for(var _0x301bc8=0x0;_0x301bc8<_0xc5a484[_0xe2ba('0x54')][_0xe2ba('0x3f')];_0x301bc8+=0x1){_0xc5a484[_0xe2ba('0x54')][_0x301bc8][_0xe2ba('0x56')]=_0xc5a484['params']['id'];_0x3a920e[_0xe2ba('0x61')](_0xc5a484['body'][_0x301bc8]);}return BPromise['each'](_0x3a920e,function(_0x39960){return db[_0xe2ba('0x62')][_0xe2ba('0x4f')](_[_0xe2ba('0x63')](_0x39960,[_0xe2ba('0x5c'),'id'])||{},{'fields':_[_0xe2ba('0x3a')](_0x333622),'raw':!![]})[_0xe2ba('0x2b')](function(_0x27be96){_0x58761d[_0xe2ba('0x64')]['push'](_0x27be96['dataValues']);})[_0xe2ba('0x4a')](function(_0x4a695d){_0x58761d[_0xe2ba('0x65')][_0xe2ba('0x61')]({'data':_0x39960,'error':_0x4a695d[_0xe2ba('0x66')]});});})[_0xe2ba('0x2b')](function(_0x1bf62f){return _0x58761d;})[_0xe2ba('0x4a')](function(_0xec6e1d){return _0xec6e1d;});}else{_0xc59e6[_0xe2ba('0x21')](0x190)[_0xe2ba('0x22')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0xe2ba('0x2b')](respondWithResult(_0xc59e6,null))[_0xe2ba('0x4a')](handleError(_0xc59e6,null));};exports[_0xe2ba('0x67')]=function(_0x1bc1ab,_0x491137,_0xc21448){var _0x57644f;return db[_0xe2ba('0x48')][_0xe2ba('0x4e')]({'where':{'id':_0x1bc1ab['params']['id']},'include':[{'model':db[_0xe2ba('0x68')],'as':_0xe2ba('0x69')}]})[_0xe2ba('0x2b')](handleEntityNotFound(_0x491137,null))[_0xe2ba('0x2b')](function(_0x193377){if(_0x193377){_0x57644f=_0x193377;return db[_0xe2ba('0x62')][_0xe2ba('0x36')];}})[_0xe2ba('0x2b')](function(_0x444d29){if(_0x444d29){var _0x54ecc1={};var _0x1a0b7d={};_0x1a0b7d[_0xe2ba('0x38')]=_['concat'](_[_0xe2ba('0x3a')](_0x444d29),_[_0xe2ba('0x35')](_0x57644f['CustomFields'],function(_0x11a7a5){return util['format'](_0xe2ba('0x6a'),_0x11a7a5['id']);}));_0x1a0b7d['query']=_['keys'](_0x1bc1ab['query']);_0x1a0b7d['filters']=_['intersection'](_0x1a0b7d[_0xe2ba('0x38')],_0x1a0b7d[_0xe2ba('0x39')]);_0x54ecc1[_0xe2ba('0x3d')]=_[_0xe2ba('0x3c')](_0x1a0b7d[_0xe2ba('0x38')],qs[_0xe2ba('0x3e')](_0x1bc1ab[_0xe2ba('0x39')]['fields']));_0x54ecc1[_0xe2ba('0x3d')]=_0x54ecc1[_0xe2ba('0x3d')][_0xe2ba('0x3f')]?_0x54ecc1[_0xe2ba('0x3d')]:_0x1a0b7d[_0xe2ba('0x38')];if(!_0x1bc1ab[_0xe2ba('0x39')][_0xe2ba('0x5a')](_0xe2ba('0x40'))){_0x54ecc1['limit']=qs[_0xe2ba('0x26')](_0x1bc1ab['query'][_0xe2ba('0x26')]);_0x54ecc1[_0xe2ba('0x23')]=qs[_0xe2ba('0x23')](_0x1bc1ab[_0xe2ba('0x39')]['offset']);}_0x54ecc1[_0xe2ba('0x41')]=qs[_0xe2ba('0x42')](_0x1bc1ab[_0xe2ba('0x39')][_0xe2ba('0x42')]);_0x54ecc1[_0xe2ba('0x43')]=qs[_0xe2ba('0x3b')](_[_0xe2ba('0x6b')](_0x1bc1ab[_0xe2ba('0x39')],_0x1a0b7d['filters']));_0x54ecc1[_0xe2ba('0x6c')]=!![];if(_0x1bc1ab[_0xe2ba('0x39')][_0xe2ba('0x44')]){_0x54ecc1[_0xe2ba('0x43')]=_[_0xe2ba('0x46')](_0x54ecc1[_0xe2ba('0x43')],{'$or':_[_0xe2ba('0x35')](_0x54ecc1[_0xe2ba('0x3d')],function(_0x43f6b7){var _0x34f5b3={};_0x34f5b3[_0x43f6b7]={'$like':'%'+_0x1bc1ab['query'][_0xe2ba('0x44')]+'%'};return _0x34f5b3;})});}_0x54ecc1=_[_0xe2ba('0x46')]({},_0x54ecc1,_0x1bc1ab[_0xe2ba('0x47')]);return _0x57644f['getContacts'](_0x54ecc1);}})['then'](respondWithResult(_0x491137,null))['catch'](handleError(_0x491137,null));};exports[_0xe2ba('0x6d')]=function(_0x5e3a63,_0x3dc8de,_0x2263d1){var _0x301149;var _0x380a25;var _0x2e4067;var _0x4987c9=_0x5e3a63[_0xe2ba('0x4b')]['id'];csv_results=[];return db[_0xe2ba('0x6e')][_0xe2ba('0x49')]({'attributes':['id',_0xe2ba('0x32')],'raw':!![],'order':[_0xe2ba('0x6f')]})[_0xe2ba('0x2b')](function(_0xf35445){_0x301149=_0xf35445;var _0x1a066b=_[_0xe2ba('0x3a')](db[_0xe2ba('0x62')][_0xe2ba('0x36')]);return db[_0xe2ba('0x68')]['findAll']({'raw':!![],'attributes':['id',_0xe2ba('0x70')]})[_0xe2ba('0x2b')](function(_0x4e3b95){_0x380a25=_0x4e3b95;var _0x2321f6=squel[_0xe2ba('0x71')]()['fields'](_0x1a066b)['from'](_0xe2ba('0x72'),'c')[_0xe2ba('0x43')]('c.ListId\x20=\x20?',_0x4987c9)[_0xe2ba('0x43')](_0xe2ba('0x73'))[_0xe2ba('0x74')]();for(var _0x31999b=0x0;_0x31999b<_0x380a25[_0xe2ba('0x3f')];_0x31999b++){_0x2321f6[_0xe2ba('0x75')](_0xe2ba('0x76')+_0x380a25[_0x31999b]['id'],_0xe2ba('0x77')+_0x380a25[_0x31999b][_0xe2ba('0x70')]);}for(var _0x31999b=0x0;_0x31999b<_0x301149[_0xe2ba('0x3f')];_0x31999b++){_0x2321f6[_0xe2ba('0x75')](squel['select']()[_0xe2ba('0x75')](_0xe2ba('0x78'))[_0xe2ba('0x79')](_0xe2ba('0x7a'))[_0xe2ba('0x43')](_0xe2ba('0x7b'),_0x301149[_0x31999b]['id'])[_0xe2ba('0x43')](_0xe2ba('0x7c')),_0xe2ba('0x7d')+_0x301149[_0x31999b][_0xe2ba('0x32')]);_0x2321f6[_0xe2ba('0x75')](squel[_0xe2ba('0x71')]()[_0xe2ba('0x75')]('description')[_0xe2ba('0x79')](_0xe2ba('0x7a'))[_0xe2ba('0x43')](_0xe2ba('0x7b'),_0x301149[_0x31999b]['id'])[_0xe2ba('0x43')](_0xe2ba('0x7c')),_0xe2ba('0x7e')+_0x301149[_0x31999b][_0xe2ba('0x32')]);}var _0x39870d=[];_0x39870d[_0xe2ba('0x61')](_0x2321f6[_0xe2ba('0x7f')]());BPromise['each'](_0x39870d,handleQuery)[_0xe2ba('0x2b')](function(_0x1f503d){handleQuery(_0x2321f6[_0xe2ba('0x7f')]());var _0x3bc972=csv_results[0x0];if(!_[_0xe2ba('0x80')](_0x3bc972)){var _0x2b1ed9=toCsv(_0x3bc972);var _0x42767a=Date[_0xe2ba('0x81')]();fs['writeFileSync'](util[_0xe2ba('0x82')](_0xe2ba('0x83'),_0x4987c9,_0x42767a),_0x2b1ed9);_0x3dc8de[_0xe2ba('0x84')](_0xe2ba('0x85'),_0xe2ba('0x86')+util[_0xe2ba('0x82')]('list_%d_%s.csv',_0x4987c9,_0x42767a));_0x3dc8de[_0xe2ba('0x84')](_0xe2ba('0x87'),'text/csv');return _0x3dc8de[_0xe2ba('0x88')](util[_0xe2ba('0x82')]('/tmp/list_%d_%s.csv',_0x4987c9,_0x42767a));}else{return _0x3dc8de[_0xe2ba('0x20')](0xcc);}});});});};exports[_0xe2ba('0x89')]=function(_0x560b78,_0x20b68f,_0x3f5110){var _0x52ae75;delete _0x560b78[_0xe2ba('0x54')]['id'];return db['CmList'][_0xe2ba('0x59')]({'where':{'id':_0x560b78[_0xe2ba('0x4b')]['id']}})[_0xe2ba('0x2b')](handleEntityNotFound(_0x20b68f,null))['then'](function(_0x5b2a1a){if(_0x5b2a1a){return db[_0xe2ba('0x8a')][_0xe2ba('0x8b')](function(_0x232839){return db[_0xe2ba('0x68')][_0xe2ba('0x4f')](_0x560b78['body'],{'transaction':_0x232839})[_0xe2ba('0x2b')](function(_0x3eecfc){_0x52ae75=_0x3eecfc;return _0x5b2a1a[_0xe2ba('0x8c')](_0x3eecfc,{'transaction':_0x232839});})[_0xe2ba('0x2b')](function(){var _0x5c45a7={'type':db[_0xe2ba('0x8d')][_0xe2ba('0x8e')],'transaction':_0x232839};switch(_0x560b78[_0xe2ba('0x54')]['type']){case _0xe2ba('0x8f'):_0x5c45a7['type']=db['Sequelize']['TEXT'];break;case _0xe2ba('0x90'):_0x5c45a7[_0xe2ba('0x37')]=db[_0xe2ba('0x8d')][_0xe2ba('0x91')];break;case'switch':_0x5c45a7[_0xe2ba('0x37')]=db['Sequelize'][_0xe2ba('0x92')];_0x5c45a7[_0xe2ba('0x93')]=![];break;default:}return db[_0xe2ba('0x8a')]['queryInterface']['addColumn']('cm_contacts',util[_0xe2ba('0x82')](_0xe2ba('0x94'),_0x52ae75['id']),_0x5c45a7);})[_0xe2ba('0x2b')](function(){return _0x52ae75;});});}})[_0xe2ba('0x2b')](respondWithResult(_0x20b68f,null))[_0xe2ba('0x4a')](handleError(_0x20b68f,null));};exports[_0xe2ba('0x95')]=function(_0x5a3ad3,_0x161a03,_0x3f35e2){var _0xff5e71={};var _0x552aeb={};var _0x168bdd;var _0x616e6b;return db[_0xe2ba('0x48')][_0xe2ba('0x59')]({'where':{'id':_0x5a3ad3[_0xe2ba('0x4b')]['id']}})[_0xe2ba('0x2b')](handleEntityNotFound(_0x161a03,null))[_0xe2ba('0x2b')](function(_0x2c4eee){if(_0x2c4eee){_0x168bdd=_0x2c4eee;_0x552aeb[_0xe2ba('0x38')]=_['keys'](db[_0xe2ba('0x68')][_0xe2ba('0x36')]);_0x552aeb[_0xe2ba('0x39')]=_[_0xe2ba('0x3a')](_0x5a3ad3[_0xe2ba('0x39')]);_0x552aeb['filters']=_[_0xe2ba('0x3c')](_0x552aeb[_0xe2ba('0x38')],_0x552aeb[_0xe2ba('0x39')]);_0xff5e71[_0xe2ba('0x3d')]=_[_0xe2ba('0x3c')](_0x552aeb[_0xe2ba('0x38')],qs[_0xe2ba('0x3e')](_0x5a3ad3[_0xe2ba('0x39')]['fields']));_0xff5e71[_0xe2ba('0x3d')]=_0xff5e71[_0xe2ba('0x3d')]['length']?_0xff5e71[_0xe2ba('0x3d')]:_0x552aeb[_0xe2ba('0x38')];_0xff5e71[_0xe2ba('0x41')]=qs[_0xe2ba('0x42')](_0x5a3ad3[_0xe2ba('0x39')][_0xe2ba('0x42')]);_0xff5e71[_0xe2ba('0x43')]=qs[_0xe2ba('0x3b')](_['pick'](_0x5a3ad3[_0xe2ba('0x39')],_0x552aeb[_0xe2ba('0x3b')]));_0xff5e71['where']=_['merge'](_0xff5e71[_0xe2ba('0x43')],{'$or':[{'ListId':_0x2c4eee['id']},{'ListId':null}]});if(_0x5a3ad3[_0xe2ba('0x39')]['filter']){_0xff5e71[_0xe2ba('0x43')]=_[_0xe2ba('0x46')](_0xff5e71['where'],{'$or':_[_0xe2ba('0x35')](_0xff5e71['attributes'],function(_0x21af3c){var _0xc82762={};_0xc82762[_0x21af3c]={'$like':'%'+_0x5a3ad3[_0xe2ba('0x39')][_0xe2ba('0x44')]+'%'};return _0xc82762;})});}_0xff5e71=_[_0xe2ba('0x46')]({},_0xff5e71,_0x5a3ad3[_0xe2ba('0x47')]);return db[_0xe2ba('0x68')][_0xe2ba('0x96')](_0xff5e71);}})[_0xe2ba('0x2b')](respondWithResult(_0x161a03,null))[_0xe2ba('0x4a')](handleError(_0x161a03,null));};exports[_0xe2ba('0x97')]=function(_0x317272,_0x534237){return db['CmCustomField'][_0xe2ba('0x96')]({'where':{'ListId':null}})[_0xe2ba('0x2b')](handleEntityNotFound(_0x534237,null))['then'](function(_0x255200){return _0x255200;})['then'](respondWithResult(_0x534237,null))['catch'](handleError(_0x534237,null));};exports[_0xe2ba('0x98')]=function(_0x76b6d9,_0xcdd61e,_0x57d5e0){return db[_0xe2ba('0x48')][_0xe2ba('0x4e')]({'where':{'id':_0x76b6d9[_0xe2ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0xcdd61e,null))['then'](function(_0xdd396a){if(_0xdd396a){return _0xdd396a[_0xe2ba('0x98')](_0x76b6d9[_0xe2ba('0x54')][_0xe2ba('0x5c')],_[_0xe2ba('0x63')](_0x76b6d9[_0xe2ba('0x54')],[_0xe2ba('0x5c'),'id'])||{})[_0xe2ba('0x99')](function(_0x2f165f){for(var _0x3503e6=0x0;_0x3503e6<_0x76b6d9[_0xe2ba('0x54')][_0xe2ba('0x5c')][_0xe2ba('0x3f')];_0x3503e6+=0x1){socket[_0xe2ba('0x9a')]('userCmList:save',{'UserId':Number(_0x76b6d9[_0xe2ba('0x54')][_0xe2ba('0x5c')][_0x3503e6]),'CmListId':Number(_0x76b6d9[_0xe2ba('0x4b')]['id'])});}return _0x2f165f;});}})[_0xe2ba('0x2b')](respondWithResult(_0xcdd61e,null))[_0xe2ba('0x4a')](handleError(_0xcdd61e,null));};exports[_0xe2ba('0x9b')]=function(_0x350222,_0x4d41aa,_0x2039b4){return db[_0xe2ba('0x48')][_0xe2ba('0x4e')]({'where':{'id':_0x350222['params']['id']}})[_0xe2ba('0x2b')](handleEntityNotFound(_0x4d41aa,null))['then'](function(_0x1a17c7){if(_0x1a17c7){return _0x1a17c7[_0xe2ba('0x9b')](_0x350222[_0xe2ba('0x39')]['ids'])['then'](function(){if(_[_0xe2ba('0x5f')](_0x350222[_0xe2ba('0x39')][_0xe2ba('0x5c')])){for(var _0x48763e=0x0;_0x48763e<_0x350222[_0xe2ba('0x39')]['ids'][_0xe2ba('0x3f')];_0x48763e+=0x1){socket[_0xe2ba('0x9a')](_0xe2ba('0x9c'),{'UserId':Number(_0x350222[_0xe2ba('0x39')][_0xe2ba('0x5c')][_0x48763e]),'CmListId':Number(_0x350222[_0xe2ba('0x4b')]['id'])});}}else{socket[_0xe2ba('0x9a')]('userCmList:remove',{'UserId':Number(_0x350222[_0xe2ba('0x39')][_0xe2ba('0x5c')]),'CmListId':Number(_0x350222[_0xe2ba('0x4b')]['id'])});}});}})[_0xe2ba('0x2b')](respondWithStatusCode(_0x4d41aa,null))[_0xe2ba('0x4a')](handleError(_0x4d41aa,null));};exports[_0xe2ba('0x9d')]=function(_0x30e019,_0x1877eb,_0x115c42){var _0x522e35={};var _0x22200a={};var _0x1e6de0;var _0x435e54;return db[_0xe2ba('0x48')][_0xe2ba('0x59')]({'where':{'id':_0x30e019['params']['id']}})['then'](handleEntityNotFound(_0x1877eb,null))['then'](function(_0x288c65){if(_0x288c65){_0x1e6de0=_0x288c65;_0x22200a[_0xe2ba('0x38')]=_[_0xe2ba('0x3a')](db[_0xe2ba('0x9e')][_0xe2ba('0x36')]);_0x22200a[_0xe2ba('0x39')]=_[_0xe2ba('0x3a')](_0x30e019[_0xe2ba('0x39')]);_0x22200a[_0xe2ba('0x3b')]=_[_0xe2ba('0x3c')](_0x22200a[_0xe2ba('0x38')],_0x22200a[_0xe2ba('0x39')]);_0x522e35[_0xe2ba('0x3d')]=_[_0xe2ba('0x3c')](_0x22200a[_0xe2ba('0x38')],qs[_0xe2ba('0x3e')](_0x30e019[_0xe2ba('0x39')][_0xe2ba('0x3e')]));_0x522e35['attributes']=_0x522e35[_0xe2ba('0x3d')]['length']?_0x522e35[_0xe2ba('0x3d')]:_0x22200a[_0xe2ba('0x38')];_0x522e35[_0xe2ba('0x41')]=qs[_0xe2ba('0x42')](_0x30e019[_0xe2ba('0x39')]['sort']);_0x522e35['where']=qs[_0xe2ba('0x3b')](_[_0xe2ba('0x6b')](_0x30e019['query'],_0x22200a[_0xe2ba('0x3b')]));if(_0x30e019[_0xe2ba('0x39')][_0xe2ba('0x44')]){_0x522e35[_0xe2ba('0x43')]=_[_0xe2ba('0x46')](_0x522e35['where'],{'$or':_[_0xe2ba('0x35')](_0x522e35['attributes'],function(_0xef6b8c){var _0x2cd150={};_0x2cd150[_0xef6b8c]={'$like':'%'+_0x30e019[_0xe2ba('0x39')][_0xe2ba('0x44')]+'%'};return _0x2cd150;})});}_0x522e35=_[_0xe2ba('0x46')]({},_0x522e35,_0x30e019[_0xe2ba('0x47')]);return _0x1e6de0['getAgents'](_0x522e35);}})[_0xe2ba('0x2b')](function(_0x2755e0){if(_0x2755e0){_0x435e54=_0x2755e0[_0xe2ba('0x3f')];if(!_0x30e019[_0xe2ba('0x39')][_0xe2ba('0x5a')](_0xe2ba('0x40'))){_0x522e35[_0xe2ba('0x26')]=qs[_0xe2ba('0x26')](_0x30e019['query'][_0xe2ba('0x26')]);_0x522e35[_0xe2ba('0x23')]=qs[_0xe2ba('0x23')](_0x30e019[_0xe2ba('0x39')]['offset']);}return _0x1e6de0[_0xe2ba('0x9d')](_0x522e35);}})[_0xe2ba('0x2b')](function(_0x1f98a7){if(_0x1f98a7){return _0x1f98a7?{'count':_0x435e54,'rows':_0x1f98a7}:null;}})[_0xe2ba('0x2b')](respondWithResult(_0x1877eb,null))[_0xe2ba('0x4a')](handleError(_0x1877eb,null));};function handleQuery(_0x16fb11){logger['info'](_0x16fb11);return db[_0xe2ba('0x8a')]['query'](_0x16fb11)[_0xe2ba('0x99')](function(_0x18ed4e){csv_results[_0xe2ba('0x61')](_0x18ed4e);})[_0xe2ba('0x4a')](function(_0x37e39b){logger[_0xe2ba('0x30')](_0x37e39b[_0xe2ba('0x66')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 2a38815..8749f0a 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 _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x32b122,_0x1ad490){var _0x4ad25a=function(_0x590ee6){while(--_0x590ee6){_0x32b122['push'](_0x32b122['shift']());}};_0x4ad25a(++_0x1ad490);}(_0x5fc3,0xa8));var _0x35fc=function(_0x376db5,_0x2b8874){_0x376db5=_0x376db5-0x0;var _0x304c17=_0x5fc3[_0x376db5];return _0x304c17;};'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 +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0x55ca,0x126));var _0xa55c=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x55ca[_0x39d544];return _0x5a5ff2;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](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 848a8d1..e6d73f6 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 _0xec56=['define','CmList','cm_lists','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0x5c43ac,_0x1d7c18){var _0x408b74=function(_0x401d8f){while(--_0x401d8f){_0x5c43ac['push'](_0x5c43ac['shift']());}};_0x408b74(++_0x1d7c18);}(_0xec56,0x1bd));var _0x6ec5=function(_0x51d551,_0x100058){_0x51d551=_0x51d551-0x0;var _0x83bac4=_0xec56[_0x51d551];return _0x83bac4;};'use strict';var _=require(_0x6ec5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6ec5('0x1'));var moment=require(_0x6ec5('0x2'));var BPromise=require(_0x6ec5('0x3'));var rp=require(_0x6ec5('0x4'));var fs=require('fs');var path=require(_0x6ec5('0x5'));var rimraf=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var attributes=require(_0x6ec5('0x8'));module[_0x6ec5('0x9')]=function(_0x28b12b,_0x2d0a93){return _0x28b12b[_0x6ec5('0xa')](_0x6ec5('0xb'),attributes,{'tableName':_0x6ec5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b02=['define','CmList','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0x22c622,_0x245dc7){var _0x4ce41c=function(_0xc30ae5){while(--_0xc30ae5){_0x22c622['push'](_0x22c622['shift']());}};_0x4ce41c(++_0x245dc7);}(_0x5b02,0xe9));var _0x25b0=function(_0x4a9cf8,_0x5d7391){_0x4a9cf8=_0x4a9cf8-0x0;var _0x94aab9=_0x5b02[_0x4a9cf8];return _0x94aab9;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'cm_lists','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 7c93a5c..5377908 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 _0xbd3f=['stringify','error','code','message','result','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2efe6a,_0x3295fa){var _0x1e42df=function(_0x54ba44){while(--_0x54ba44){_0x2efe6a['push'](_0x2efe6a['shift']());}};_0x1e42df(++_0x3295fa);}(_0xbd3f,0xe6));var _0xfbd3=function(_0x2bd88d,_0x2d5dc3){_0x2bd88d=_0x2bd88d-0x0;var _0x5516d4=_0xbd3f[_0x2bd88d];return _0x5516d4;};'use strict';var _=require('lodash');var util=require(_0xfbd3('0x0'));var moment=require(_0xfbd3('0x1'));var BPromise=require(_0xfbd3('0x2'));var rs=require(_0xfbd3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfbd3('0x4'));var logger=require(_0xfbd3('0x5'))(_0xfbd3('0x6'));var config=require(_0xfbd3('0x7'));var jayson=require(_0xfbd3('0x8'));var client=jayson[_0xfbd3('0x9')][_0xfbd3('0xa')]({'port':0x232a});config[_0xfbd3('0xb')]=_[_0xfbd3('0xc')](config[_0xfbd3('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfbd3('0xb')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x4627e7,_0x32374b,_0x1b3e79){return new BPromise(function(_0x13f563,_0x663fdd){return client[_0xfbd3('0xd')](_0x4627e7,_0x1b3e79)[_0xfbd3('0xe')](function(_0x431641){logger[_0xfbd3('0xf')](_0xfbd3('0x10'),_0x32374b,'request\x20sent');logger[_0xfbd3('0x11')](_0xfbd3('0x12'),_0x32374b,_0xfbd3('0x13'),JSON[_0xfbd3('0x14')](_0x431641));if(_0x431641[_0xfbd3('0x15')]){if(_0x431641[_0xfbd3('0x15')][_0xfbd3('0x16')]===0x1f4){logger[_0xfbd3('0x15')](_0xfbd3('0x10'),_0x32374b,_0x431641[_0xfbd3('0x15')][_0xfbd3('0x17')]);return _0x663fdd(_0x431641[_0xfbd3('0x15')]['message']);}logger[_0xfbd3('0x15')](_0xfbd3('0x10'),_0x32374b,_0x431641[_0xfbd3('0x15')][_0xfbd3('0x17')]);return _0x13f563(_0x431641[_0xfbd3('0x15')][_0xfbd3('0x17')]);}else{logger[_0xfbd3('0xf')](_0xfbd3('0x10'),_0x32374b,_0xfbd3('0x13'));_0x13f563(_0x431641[_0xfbd3('0x18')][_0xfbd3('0x17')]);}})['catch'](function(_0x4322cc){logger[_0xfbd3('0x15')](_0xfbd3('0x10'),_0x32374b,_0x4322cc);_0x663fdd(_0x4322cc);});});} \ No newline at end of file +var _0x083d=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring'];(function(_0x5a4b42,_0x2b9c18){var _0x5e81d6=function(_0x595077){while(--_0x595077){_0x5a4b42['push'](_0x5a4b42['shift']());}};_0x5e81d6(++_0x2b9c18);}(_0x083d,0x15a));var _0xd083=function(_0x2c8756,_0x8642a){_0x2c8756=_0x2c8756-0x0;var _0x262014=_0x083d[_0x2c8756];return _0x262014;};'use strict';var _=require(_0xd083('0x0'));var util=require('util');var moment=require(_0xd083('0x1'));var BPromise=require(_0xd083('0x2'));var rs=require(_0xd083('0x3'));var fs=require('fs');var Redis=require(_0xd083('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd083('0x5'));var logger=require(_0xd083('0x6'))(_0xd083('0x7'));var config=require(_0xd083('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd083('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd083('0xa')],{'host':_0xd083('0xb'),'port':0x18eb});var socket=require(_0xd083('0xc'))(new Redis(config[_0xd083('0xa')]));require(_0xd083('0xd'))[_0xd083('0xe')](socket);function respondWithRpcPromise(_0x351960,_0x3c62c3,_0x1f18fd){return new BPromise(function(_0x23a01a,_0x441eac){return client[_0xd083('0xf')](_0x351960,_0x1f18fd)[_0xd083('0x10')](function(_0x4264a9){logger[_0xd083('0x11')](_0xd083('0x12'),_0x3c62c3,_0xd083('0x13'));logger['debug'](_0xd083('0x14'),_0x3c62c3,_0xd083('0x13'),JSON['stringify'](_0x4264a9));if(_0x4264a9[_0xd083('0x15')]){if(_0x4264a9[_0xd083('0x15')][_0xd083('0x16')]===0x1f4){logger[_0xd083('0x15')](_0xd083('0x12'),_0x3c62c3,_0x4264a9[_0xd083('0x15')][_0xd083('0x17')]);return _0x441eac(_0x4264a9[_0xd083('0x15')][_0xd083('0x17')]);}logger[_0xd083('0x15')]('CmList,\x20%s,\x20%s',_0x3c62c3,_0x4264a9[_0xd083('0x15')][_0xd083('0x17')]);return _0x23a01a(_0x4264a9[_0xd083('0x15')][_0xd083('0x17')]);}else{logger[_0xd083('0x11')]('CmList,\x20%s,\x20%s',_0x3c62c3,'request\x20sent');_0x23a01a(_0x4264a9['result'][_0xd083('0x17')]);}})[_0xd083('0x18')](function(_0x3d761a){logger[_0xd083('0x15')](_0xd083('0x12'),_0x3c62c3,_0x3d761a);_0x441eac(_0x3d761a);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 5fc449c..e788164 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 _0x7659=['emit','removeListener','register','length','cmList:','save','remove','update'];(function(_0x5a383e,_0x5fd890){var _0x5e5439=function(_0x3d7535){while(--_0x3d7535){_0x5a383e['push'](_0x5a383e['shift']());}};_0x5e5439(++_0x5fd890);}(_0x7659,0x125));var _0x9765=function(_0x2ca2dd,_0xdd8ba5){_0x2ca2dd=_0x2ca2dd-0x0;var _0x50dee8=_0x7659[_0x2ca2dd];return _0x50dee8;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x9765('0x0'),_0x9765('0x1'),_0x9765('0x2')];function createListener(_0x243b6d,_0x4f088c){return function(_0x4fff2d){_0x4f088c[_0x9765('0x3')](_0x243b6d,_0x4fff2d);};}function removeListener(_0x131dcb,_0x4e8547){return function(){CmListEvents[_0x9765('0x4')](_0x131dcb,_0x4e8547);};}exports[_0x9765('0x5')]=function(_0x4f8ef5){for(var _0x3080ee=0x0,_0x30f71b=events[_0x9765('0x6')];_0x3080ee<_0x30f71b;_0x3080ee++){var _0x34f961=events[_0x3080ee];var _0x207447=createListener(_0x9765('0x7')+_0x34f961,_0x4f8ef5);CmListEvents['on'](_0x34f961,_0x207447);}}; \ No newline at end of file +var _0xe222=['emit','removeListener','register','length','cmList:','./cmList.events','save','remove','update'];(function(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0xe222,0x1b5));var _0x2e22=function(_0x4480b9,_0x5c2949){_0x4480b9=_0x4480b9-0x0;var _0x3f0f02=_0xe222[_0x4480b9];return _0x3f0f02;};'use strict';var CmListEvents=require(_0x2e22('0x0'));var events=[_0x2e22('0x1'),_0x2e22('0x2'),_0x2e22('0x3')];function createListener(_0x545328,_0x1f6926){return function(_0x2a3b42){_0x1f6926[_0x2e22('0x4')](_0x545328,_0x2a3b42);};}function removeListener(_0x3b02d2,_0x2f7516){return function(){CmListEvents[_0x2e22('0x5')](_0x3b02d2,_0x2f7516);};}exports[_0x2e22('0x6')]=function(_0xf980ba){for(var _0x58b214=0x0,_0xecba97=events[_0x2e22('0x7')];_0x58b214<_0xecba97;_0x58b214++){var _0x3ac390=events[_0x58b214];var _0x5130a1=createListener(_0x2e22('0x8')+_0x3ac390,_0xf980ba);CmListEvents['on'](_0x3ac390,_0x5130a1);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index afefddf..4a37d07 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 _0xb2d5=['getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','create','addDisposition','/:id/contacts','addContacts','addCustomField','addAgents','put','delete','destroy','removeDispositions','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions'];(function(_0x587cb3,_0x5cddc1){var _0x444931=function(_0x31db46){while(--_0x31db46){_0x587cb3['push'](_0x587cb3['shift']());}};_0x444931(++_0x5cddc1);}(_0xb2d5,0x11c));var _0x5b2d=function(_0x36a3bd,_0x1ef929){_0x36a3bd=_0x36a3bd-0x0;var _0x64662=_0xb2d5[_0x36a3bd];return _0x64662;};'use strict';var multer=require(_0x5b2d('0x0'));var util=require('util');var path=require(_0x5b2d('0x1'));var timeout=require(_0x5b2d('0x2'));var express=require(_0x5b2d('0x3'));var router=express[_0x5b2d('0x4')]();var fs_extra=require(_0x5b2d('0x5'));var auth=require(_0x5b2d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5b2d('0x7'));var controller=require(_0x5b2d('0x8'));router[_0x5b2d('0x9')]('/',auth[_0x5b2d('0xa')](),controller[_0x5b2d('0xb')]);router[_0x5b2d('0x9')](_0x5b2d('0xc'),auth[_0x5b2d('0xa')](),controller[_0x5b2d('0xd')]);router[_0x5b2d('0x9')](_0x5b2d('0xe'),auth[_0x5b2d('0xa')](),controller[_0x5b2d('0xf')]);router[_0x5b2d('0x9')](_0x5b2d('0x10'),auth[_0x5b2d('0xa')](),controller[_0x5b2d('0x11')]);router[_0x5b2d('0x9')](_0x5b2d('0x12'),auth[_0x5b2d('0xa')](),controller[_0x5b2d('0x13')]);router[_0x5b2d('0x9')]('/:id/contacts',auth[_0x5b2d('0xa')](),controller[_0x5b2d('0x14')]);router['get'](_0x5b2d('0x15'),auth[_0x5b2d('0xa')](),controller[_0x5b2d('0x16')]);router['get'](_0x5b2d('0x17'),auth[_0x5b2d('0xa')](),controller[_0x5b2d('0x18')]);router[_0x5b2d('0x9')](_0x5b2d('0x19'),auth[_0x5b2d('0xa')](),controller['getAgents']);router[_0x5b2d('0x1a')]('/',auth[_0x5b2d('0xa')](),controller[_0x5b2d('0x1b')]);router[_0x5b2d('0x1a')](_0x5b2d('0x12'),auth[_0x5b2d('0xa')](),controller[_0x5b2d('0x1c')]);router[_0x5b2d('0x1a')](_0x5b2d('0x1d'),auth[_0x5b2d('0xa')](),controller[_0x5b2d('0x1e')]);router[_0x5b2d('0x1a')]('/:id/fields',auth[_0x5b2d('0xa')](),controller[_0x5b2d('0x1f')]);router[_0x5b2d('0x1a')](_0x5b2d('0x19'),auth[_0x5b2d('0xa')](),controller[_0x5b2d('0x20')]);router[_0x5b2d('0x21')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5b2d('0x22')](_0x5b2d('0x10'),auth[_0x5b2d('0xa')](),controller[_0x5b2d('0x23')]);router[_0x5b2d('0x22')](_0x5b2d('0x12'),auth[_0x5b2d('0xa')](),controller[_0x5b2d('0x24')]);router[_0x5b2d('0x22')](_0x5b2d('0x19'),auth[_0x5b2d('0xa')](),controller[_0x5b2d('0x25')]);module['exports']=router; \ No newline at end of file +var _0x1093=['/:id/fields','getCustomFields','/:id/users','post','create','addDisposition','addContacts','addAgents','/:id','update','delete','/:id/dispositions','removeDispositions','removeAgents','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','get','getGlobalCustomFields','show','/:id/contacts','getContacts','/:id/contacts/csv'];(function(_0x545b28,_0x266b1a){var _0x459b6c=function(_0x50ba68){while(--_0x50ba68){_0x545b28['push'](_0x545b28['shift']());}};_0x459b6c(++_0x266b1a);}(_0x1093,0xa5));var _0x3109=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x1093[_0x5c9307];return _0x373e29;};'use strict';var multer=require('multer');var util=require(_0x3109('0x0'));var path=require('path');var timeout=require(_0x3109('0x1'));var express=require('express');var router=express[_0x3109('0x2')]();var fs_extra=require(_0x3109('0x3'));var auth=require(_0x3109('0x4'));var interaction=require(_0x3109('0x5'));var config=require(_0x3109('0x6'));var controller=require(_0x3109('0x7'));router['get']('/',auth[_0x3109('0x8')](),controller['index']);router[_0x3109('0x9')]('/describe',auth[_0x3109('0x8')](),controller['describe']);router['get']('/global_fields',auth['isAuthenticated'](),controller[_0x3109('0xa')]);router[_0x3109('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3109('0xb')]);router[_0x3109('0x9')]('/:id/dispositions',auth[_0x3109('0x8')](),controller['getDispositions']);router[_0x3109('0x9')](_0x3109('0xc'),auth['isAuthenticated'](),controller[_0x3109('0xd')]);router['get'](_0x3109('0xe'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0x3109('0x9')](_0x3109('0xf'),auth[_0x3109('0x8')](),controller[_0x3109('0x10')]);router[_0x3109('0x9')](_0x3109('0x11'),auth[_0x3109('0x8')](),controller['getAgents']);router[_0x3109('0x12')]('/',auth[_0x3109('0x8')](),controller[_0x3109('0x13')]);router[_0x3109('0x12')]('/:id/dispositions',auth[_0x3109('0x8')](),controller[_0x3109('0x14')]);router[_0x3109('0x12')](_0x3109('0xc'),auth['isAuthenticated'](),controller[_0x3109('0x15')]);router[_0x3109('0x12')](_0x3109('0xf'),auth[_0x3109('0x8')](),controller['addCustomField']);router[_0x3109('0x12')](_0x3109('0x11'),auth['isAuthenticated'](),controller[_0x3109('0x16')]);router['put'](_0x3109('0x17'),auth['isAuthenticated'](),controller[_0x3109('0x18')]);router[_0x3109('0x19')](_0x3109('0x17'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x3109('0x1a'),auth[_0x3109('0x8')](),controller[_0x3109('0x1b')]);router[_0x3109('0x19')](_0x3109('0x11'),auth['isAuthenticated'](),controller[_0x3109('0x1c')]);module[_0x3109('0x1d')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 1b6bb31..29406d1 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 _0xdc3c=['field','STRING','sequelize','getDataValue'];(function(_0x2aed3,_0x5f9c05){var _0x160e00=function(_0x552b3a){while(--_0x552b3a){_0x2aed3['push'](_0x2aed3['shift']());}};_0x160e00(++_0x5f9c05);}(_0xdc3c,0x1a6));var _0xcdc3=function(_0x15bf8e,_0xc84ea){_0x15bf8e=_0x15bf8e-0x0;var _0x11a359=_0xdc3c[_0x15bf8e];return _0x11a359;};'use strict';var Sequelize=require(_0xcdc3('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3c38de){return this[_0xcdc3('0x1')](_0xcdc3('0x2'));}},'field':{'type':Sequelize[_0xcdc3('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xcdc3('0x3')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x9c59=['VIRTUAL','field','STRING','sequelize'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x9c59,0x107));var _0x99c5=function(_0x47e629,_0x5ec1d9){_0x47e629=_0x47e629-0x0;var _0x33e4fc=_0x9c59[_0x47e629];return _0x33e4fc;};'use strict';var Sequelize=require(_0x99c5('0x0'));module['exports']={'name':{'type':Sequelize[_0x99c5('0x1')],'get':function(_0x42f3eb){return this['getDataValue'](_0x99c5('0x2'));}},'field':{'type':Sequelize[_0x99c5('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x99c5('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 60a5b79..ee6d067 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(_0x430129,_0x3fc06a){var _0x157c4e=function(_0x39863d){while(--_0x39863d){_0x430129['push'](_0x430129['shift']());}};_0x157c4e(++_0x3fc06a);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x38eabc,_0x1d960a){var _0x2a6ce7=function(_0x1e3260){while(--_0x1e3260){_0x38eabc['push'](_0x38eabc['shift']());}};_0x2a6ce7(++_0x1d960a);}(_0x7a54,0x106));var _0x47a5=function(_0x3d1433,_0x121dc0){_0x3d1433=_0x3d1433-0x0;var _0x585461=_0x7a54[_0x3d1433];return _0x585461;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 1168f80..8ebcb8f 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 _0xd920=['moment','request-promise','path','rimraf','../../config/environment','./condition.attributes','util','../../config/logger','api'];(function(_0x422823,_0x2672cf){var _0x393557=function(_0x50a7f9){while(--_0x50a7f9){_0x422823['push'](_0x422823['shift']());}};_0x393557(++_0x2672cf);}(_0xd920,0x1d1));var _0x0d92=function(_0x12254f,_0x100cfe){_0x12254f=_0x12254f-0x0;var _0x3a4fa2=_0xd920[_0x12254f];return _0x3a4fa2;};'use strict';var _=require('lodash');var util=require(_0x0d92('0x0'));var logger=require(_0x0d92('0x1'))(_0x0d92('0x2'));var moment=require(_0x0d92('0x3'));var BPromise=require('bluebird');var rp=require(_0x0d92('0x4'));var fs=require('fs');var path=require(_0x0d92('0x5'));var rimraf=require(_0x0d92('0x6'));var config=require(_0x0d92('0x7'));var attributes=require(_0x0d92('0x8'));module['exports']=function(_0x2aded6,_0x8fdae7){return _0x2aded6['define']('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3107=['moment','bluebird','path','../../config/environment','./condition.attributes','exports','define','Condition','lodash','../../config/logger','api'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x3107,0xd9));var _0x7310=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3107[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7310('0x0'));var util=require('util');var logger=require(_0x7310('0x1'))(_0x7310('0x2'));var moment=require(_0x7310('0x3'));var BPromise=require(_0x7310('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7310('0x5'));var rimraf=require('rimraf');var config=require(_0x7310('0x6'));var attributes=require(_0x7310('0x7'));module[_0x7310('0x8')]=function(_0x564024,_0x1e98b3){return _0x564024[_0x7310('0x9')](_0x7310('0xa'),attributes,{'tableName':'tools_conditions','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 37567be..4c36baf 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 _0x77f3=['moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x77f3,0x12c));var _0x377f=function(_0x3b48f0,_0x425152){_0x3b48f0=_0x3b48f0-0x0;var _0x59f454=_0x77f3[_0x3b48f0];return _0x59f454;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x377f('0x0'));var BPromise=require('bluebird');var rs=require(_0x377f('0x1'));var fs=require('fs');var Redis=require(_0x377f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x377f('0x3'));var logger=require('../../config/logger')(_0x377f('0x4'));var config=require(_0x377f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x377f('0x6')][_0x377f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e3672,_0x35157a,_0x4b3428){return new BPromise(function(_0x39e7f1,_0x44019a){return client['request'](_0x5e3672,_0x4b3428)[_0x377f('0x8')](function(_0x6dfd5){logger[_0x377f('0x9')](_0x377f('0xa'),_0x35157a,_0x377f('0xb'));logger[_0x377f('0xc')](_0x377f('0xd'),_0x35157a,_0x377f('0xb'),JSON[_0x377f('0xe')](_0x6dfd5));if(_0x6dfd5[_0x377f('0xf')]){if(_0x6dfd5['error'][_0x377f('0x10')]===0x1f4){logger['error'](_0x377f('0xa'),_0x35157a,_0x6dfd5[_0x377f('0xf')]['message']);return _0x44019a(_0x6dfd5['error']['message']);}logger[_0x377f('0xf')](_0x377f('0xa'),_0x35157a,_0x6dfd5['error']['message']);return _0x39e7f1(_0x6dfd5[_0x377f('0xf')][_0x377f('0x11')]);}else{logger[_0x377f('0x9')]('Condition,\x20%s,\x20%s',_0x35157a,_0x377f('0xb'));_0x39e7f1(_0x6dfd5[_0x377f('0x12')][_0x377f('0x11')]);}})[_0x377f('0x13')](function(_0x41df8a){logger['error']('Condition,\x20%s,\x20%s',_0x35157a,_0x41df8a);_0x44019a(_0x41df8a);});});} \ No newline at end of file +var _0x2c79=['rpc','jayson/promise','http','request','then','info','debug','request\x20sent','error','Condition,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0xa58b3c,_0x57a029){var _0x59152f=function(_0x45d5d7){while(--_0x45d5d7){_0xa58b3c['push'](_0xa58b3c['shift']());}};_0x59152f(++_0x57a029);}(_0x2c79,0x1c0));var _0x92c7=function(_0x594cd5,_0x177879){_0x594cd5=_0x594cd5-0x0;var _0xd63c11=_0x2c79[_0x594cd5];return _0xd63c11;};'use strict';var _=require(_0x92c7('0x0'));var util=require(_0x92c7('0x1'));var moment=require(_0x92c7('0x2'));var BPromise=require(_0x92c7('0x3'));var rs=require(_0x92c7('0x4'));var fs=require('fs');var Redis=require(_0x92c7('0x5'));var db=require(_0x92c7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x92c7('0x7'))(_0x92c7('0x8'));var config=require('../../config/environment');var jayson=require(_0x92c7('0x9'));var client=jayson['client'][_0x92c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b10e9,_0x3c9986,_0x1f0739){return new BPromise(function(_0x3797c9,_0x3cabbc){return client[_0x92c7('0xb')](_0x4b10e9,_0x1f0739)[_0x92c7('0xc')](function(_0x4bd0da){logger[_0x92c7('0xd')]('Condition,\x20%s,\x20%s',_0x3c9986,'request\x20sent');logger[_0x92c7('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0x3c9986,_0x92c7('0xf'),JSON['stringify'](_0x4bd0da));if(_0x4bd0da[_0x92c7('0x10')]){if(_0x4bd0da[_0x92c7('0x10')]['code']===0x1f4){logger[_0x92c7('0x10')](_0x92c7('0x11'),_0x3c9986,_0x4bd0da[_0x92c7('0x10')][_0x92c7('0x12')]);return _0x3cabbc(_0x4bd0da[_0x92c7('0x10')]['message']);}logger[_0x92c7('0x10')](_0x92c7('0x11'),_0x3c9986,_0x4bd0da[_0x92c7('0x10')][_0x92c7('0x12')]);return _0x3797c9(_0x4bd0da[_0x92c7('0x10')]['message']);}else{logger[_0x92c7('0xd')]('Condition,\x20%s,\x20%s',_0x3c9986,_0x92c7('0xf'));_0x3797c9(_0x4bd0da['result'][_0x92c7('0x12')]);}})['catch'](function(_0x4b3c91){logger['error']('Condition,\x20%s,\x20%s',_0x3c9986,_0x4b3c91);_0x3cabbc(_0x4b3c91);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index a5b47b5..17f357e 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 _0xf105=['../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','delete','isAuthenticated','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x34d98b,_0x666db6){var _0x39088a=function(_0x5b4f90){while(--_0x5b4f90){_0x34d98b['push'](_0x34d98b['shift']());}};_0x39088a(++_0x666db6);}(_0xf105,0x129));var _0x5f10=function(_0x53fe3f,_0xe39fa6){_0x53fe3f=_0x53fe3f-0x0;var _0x10fc74=_0xf105[_0x53fe3f];return _0x10fc74;};'use strict';var multer=require(_0x5f10('0x0'));var util=require(_0x5f10('0x1'));var path=require(_0x5f10('0x2'));var timeout=require('connect-timeout');var express=require(_0x5f10('0x3'));var router=express[_0x5f10('0x4')]();var fs_extra=require(_0x5f10('0x5'));var auth=require(_0x5f10('0x6'));var interaction=require(_0x5f10('0x7'));var config=require(_0x5f10('0x8'));var controller=require(_0x5f10('0x9'));router[_0x5f10('0xa')](_0x5f10('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x5f10('0xc')]('/:id',auth[_0x5f10('0xd')](),controller[_0x5f10('0xe')]);module[_0x5f10('0xf')]=router; \ No newline at end of file +var _0xb8d1=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','update','delete'];(function(_0xe0b98,_0x4875ee){var _0x29f74f=function(_0x456590){while(--_0x456590){_0xe0b98['push'](_0xe0b98['shift']());}};_0x29f74f(++_0x4875ee);}(_0xb8d1,0xdb));var _0x1b8d=function(_0x482214,_0x2550ff){_0x482214=_0x482214-0x0;var _0x38d0cb=_0xb8d1[_0x482214];return _0x38d0cb;};'use strict';var multer=require(_0x1b8d('0x0'));var util=require(_0x1b8d('0x1'));var path=require(_0x1b8d('0x2'));var timeout=require(_0x1b8d('0x3'));var express=require(_0x1b8d('0x4'));var router=express[_0x1b8d('0x5')]();var fs_extra=require(_0x1b8d('0x6'));var auth=require(_0x1b8d('0x7'));var interaction=require(_0x1b8d('0x8'));var config=require(_0x1b8d('0x9'));var controller=require(_0x1b8d('0xa'));router[_0x1b8d('0xb')]('/:id',auth[_0x1b8d('0xc')](),controller[_0x1b8d('0xd')]);router[_0x1b8d('0xe')](_0x1b8d('0xf'),auth[_0x1b8d('0xc')](),controller[_0x1b8d('0x10')]);module[_0x1b8d('0x11')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 312bf88..2467732 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 _0xe6a1=['name','INTEGER','sequelize','exports','STRING'];(function(_0x4640df,_0x55e6fc){var _0x56d142=function(_0xa2fdaa){while(--_0xa2fdaa){_0x4640df['push'](_0x4640df['shift']());}};_0x56d142(++_0x55e6fc);}(_0xe6a1,0x1b0));var _0x1e6a=function(_0x271547,_0x1b5a55){_0x271547=_0x271547-0x0;var _0x2d9292=_0xe6a1[_0x271547];return _0x2d9292;};'use strict';var Sequelize=require(_0x1e6a('0x0'));module[_0x1e6a('0x1')]={'name':{'type':Sequelize[_0x1e6a('0x2')],'allowNull':![],'unique':_0x1e6a('0x3')},'OrderBy':{'type':Sequelize[_0x1e6a('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x1e6a('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xd809=['exports','STRING','INTEGER','sequelize'];(function(_0xf091f4,_0x10a976){var _0x289a3a=function(_0x1b8d7c){while(--_0x1b8d7c){_0xf091f4['push'](_0xf091f4['shift']());}};_0x289a3a(++_0x10a976);}(_0xd809,0x123));var _0x9d80=function(_0x12d5b0,_0x4e107c){_0x12d5b0=_0x12d5b0-0x0;var _0x59b03b=_0xd809[_0x12d5b0];return _0x59b03b;};'use strict';var Sequelize=require(_0x9d80('0x0'));module[_0x9d80('0x1')]={'name':{'type':Sequelize[_0x9d80('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x9d80('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index a23cfbd..f83d27b 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 _0xab40=['error','stack','name','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','ContactItemType','count','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','update','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','apply','reject','save','then','get','UserProfileResource','destroy'];(function(_0x2f13e0,_0x1a8bc4){var _0x35d89f=function(_0x185074){while(--_0x185074){_0x2f13e0['push'](_0x2f13e0['shift']());}};_0x35d89f(++_0x1a8bc4);}(_0xab40,0xcd));var _0x0ab4=function(_0x314bb7,_0x46aca4){_0x314bb7=_0x314bb7-0x0;var _0x3f2dc3=_0xab40[_0x314bb7];return _0x3f2dc3;};'use strict';var emlformat=require(_0x0ab4('0x0'));var rimraf=require(_0x0ab4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0ab4('0x2'));var BPromise=require(_0x0ab4('0x3'));var Mustache=require(_0x0ab4('0x4'));var util=require(_0x0ab4('0x5'));var path=require(_0x0ab4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0ab4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ab4('0x8'));var squel=require(_0x0ab4('0x9'));var crypto=require(_0x0ab4('0xa'));var jsforce=require(_0x0ab4('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ab4('0xc'));var Redis=require(_0x0ab4('0xd'));var authService=require(_0x0ab4('0xe'));var qs=require(_0x0ab4('0xf'));var as=require(_0x0ab4('0x10'));var hardwareService=require(_0x0ab4('0x11'));var logger=require(_0x0ab4('0x12'))(_0x0ab4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ab4('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x249dc3,_0x45e6fd){_0x45e6fd=_0x45e6fd||0xcc;return function(_0x1e7555){if(_0x1e7555){return _0x249dc3[_0x0ab4('0x15')](_0x45e6fd);}return _0x249dc3[_0x0ab4('0x16')](_0x45e6fd)[_0x0ab4('0x17')]();};}function respondWithResult(_0x112162,_0x2cc644){_0x2cc644=_0x2cc644||0xc8;return function(_0x3cb1df){if(_0x3cb1df){return _0x112162[_0x0ab4('0x16')](_0x2cc644)[_0x0ab4('0x18')](_0x3cb1df);}};}function respondWithFilteredResult(_0x36d246,_0x293e20){return function(_0x45fad1){if(_0x45fad1){var _0x2a83a8=typeof _0x293e20[_0x0ab4('0x19')]===_0x0ab4('0x1a')&&typeof _0x293e20[_0x0ab4('0x1b')]==='undefined';var _0x5000d4=_0x45fad1['count'];var _0x17422f=_0x2a83a8?0x0:_0x293e20[_0x0ab4('0x19')];var _0x2f50d2=_0x2a83a8?_0x45fad1['count']:_0x293e20[_0x0ab4('0x19')]+_0x293e20[_0x0ab4('0x1b')];var _0x212ebd;if(_0x2f50d2>=_0x5000d4){_0x2f50d2=_0x5000d4;_0x212ebd=0xc8;}else{_0x212ebd=0xce;}_0x36d246[_0x0ab4('0x16')](_0x212ebd);return _0x36d246['set']('Content-Range',_0x17422f+'-'+_0x2f50d2+'/'+_0x5000d4)[_0x0ab4('0x18')](_0x45fad1);}return null;};}function patchUpdates(_0x5b1ed5){return function(_0x2b0e29){try{jsonpatch[_0x0ab4('0x1c')](_0x2b0e29,_0x5b1ed5,!![]);}catch(_0x5bb1d0){return BPromise[_0x0ab4('0x1d')](_0x5bb1d0);}return _0x2b0e29[_0x0ab4('0x1e')]();};}function saveUpdates(_0x2c55b3,_0x1d5c14){return function(_0x12d06d){if(_0x12d06d){return _0x12d06d['update'](_0x2c55b3)['then'](function(_0x24b929){return _0x24b929;});}return null;};}function removeEntity(_0x14087f,_0x392afe){return function(_0x13c882){if(_0x13c882){return _0x13c882['destroy']()[_0x0ab4('0x1f')](function(){var _0x3caa9d=_0x13c882[_0x0ab4('0x20')]({'plain':!![]});var _0x4ea9aa='ContactItemTypes';return db[_0x0ab4('0x21')][_0x0ab4('0x22')]({'where':{'type':_0x4ea9aa,'resourceId':_0x3caa9d['id']}})[_0x0ab4('0x1f')](function(){return _0x13c882;});})['then'](function(){_0x14087f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19ecc6,_0x5ba3a2){return function(_0x3bf844){if(!_0x3bf844){_0x19ecc6[_0x0ab4('0x15')](0x194);}return _0x3bf844;};}function handleError(_0x4f1aeb,_0x4bd747){_0x4bd747=_0x4bd747||0x1f4;return function(_0x4d0cc1){logger[_0x0ab4('0x23')](_0x4d0cc1[_0x0ab4('0x24')]);if(_0x4d0cc1[_0x0ab4('0x25')]){delete _0x4d0cc1[_0x0ab4('0x25')];}_0x4f1aeb[_0x0ab4('0x16')](_0x4bd747)['send'](_0x4d0cc1);};}exports['index']=function(_0x580d56,_0x2e7a97){var _0x2b66d5={},_0x155d96={},_0x182bbe={'count':0x0,'rows':[]};var _0x46eda7=_['map'](db['ContactItemType'][_0x0ab4('0x26')],function(_0xe6682){return{'name':_0xe6682[_0x0ab4('0x27')],'type':_0xe6682['type']['key']};});_0x155d96[_0x0ab4('0x28')]=_['map'](_0x46eda7,_0x0ab4('0x25'));_0x155d96[_0x0ab4('0x29')]=_[_0x0ab4('0x2a')](_0x580d56[_0x0ab4('0x29')]);_0x155d96[_0x0ab4('0x2b')]=_[_0x0ab4('0x2c')](_0x155d96['model'],_0x155d96[_0x0ab4('0x29')]);_0x2b66d5[_0x0ab4('0x2d')]=_[_0x0ab4('0x2c')](_0x155d96[_0x0ab4('0x28')],qs['fields'](_0x580d56['query'][_0x0ab4('0x2e')]));_0x2b66d5[_0x0ab4('0x2d')]=_0x2b66d5[_0x0ab4('0x2d')]['length']?_0x2b66d5['attributes']:_0x155d96['model'];if(!_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x2f')](_0x0ab4('0x30'))){_0x2b66d5['limit']=qs['limit'](_0x580d56['query'][_0x0ab4('0x1b')]);_0x2b66d5[_0x0ab4('0x19')]=qs[_0x0ab4('0x19')](_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x19')]);}_0x2b66d5[_0x0ab4('0x31')]=qs[_0x0ab4('0x32')](_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x32')]);_0x2b66d5[_0x0ab4('0x33')]=qs['filters'](_[_0x0ab4('0x34')](_0x580d56[_0x0ab4('0x29')],_0x155d96[_0x0ab4('0x2b')]),_0x46eda7);if(_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x35')]){_0x2b66d5[_0x0ab4('0x33')]=_[_0x0ab4('0x36')](_0x2b66d5[_0x0ab4('0x33')],{'$or':_[_0x0ab4('0x37')](_0x46eda7,function(_0x3774ca){if(_0x3774ca[_0x0ab4('0x38')]!==_0x0ab4('0x39')){var _0x4a05c4={};_0x4a05c4[_0x3774ca[_0x0ab4('0x25')]]={'$like':'%'+_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x35')]+'%'};return _0x4a05c4;}})});}_0x2b66d5=_[_0x0ab4('0x36')]({},_0x2b66d5,_0x580d56['options']);var _0x42bece={'where':_0x2b66d5['where']};return db[_0x0ab4('0x3a')][_0x0ab4('0x3b')](_0x42bece)[_0x0ab4('0x1f')](function(_0x245021){_0x182bbe[_0x0ab4('0x3b')]=_0x245021;if(_0x580d56[_0x0ab4('0x29')]['includeAll']){_0x2b66d5[_0x0ab4('0x3c')]=[{'all':!![]}];}return db[_0x0ab4('0x3a')][_0x0ab4('0x3d')](_0x2b66d5);})['then'](function(_0x395e0b){_0x182bbe[_0x0ab4('0x3e')]=_0x395e0b;return _0x182bbe;})[_0x0ab4('0x1f')](respondWithFilteredResult(_0x2e7a97,_0x2b66d5))[_0x0ab4('0x3f')](handleError(_0x2e7a97,null));};exports[_0x0ab4('0x40')]=function(_0x5aa047,_0x5d70eb){var _0x498845={'raw':!![],'where':{'id':_0x5aa047[_0x0ab4('0x41')]['id']}},_0x2f54dd={};_0x2f54dd['model']=_[_0x0ab4('0x2a')](db['ContactItemType'][_0x0ab4('0x26')]);_0x2f54dd['query']=_[_0x0ab4('0x2a')](_0x5aa047[_0x0ab4('0x29')]);_0x2f54dd[_0x0ab4('0x2b')]=_[_0x0ab4('0x2c')](_0x2f54dd[_0x0ab4('0x28')],_0x2f54dd[_0x0ab4('0x29')]);_0x498845['attributes']=_[_0x0ab4('0x2c')](_0x2f54dd[_0x0ab4('0x28')],qs[_0x0ab4('0x2e')](_0x5aa047[_0x0ab4('0x29')][_0x0ab4('0x2e')]));_0x498845[_0x0ab4('0x2d')]=_0x498845['attributes'][_0x0ab4('0x42')]?_0x498845['attributes']:_0x2f54dd[_0x0ab4('0x28')];if(_0x5aa047[_0x0ab4('0x29')][_0x0ab4('0x43')]){_0x498845['include']=[{'all':!![]}];}_0x498845=_[_0x0ab4('0x36')]({},_0x498845,_0x5aa047[_0x0ab4('0x44')]);return db[_0x0ab4('0x3a')][_0x0ab4('0x45')](_0x498845)[_0x0ab4('0x1f')](handleEntityNotFound(_0x5d70eb,null))[_0x0ab4('0x1f')](respondWithResult(_0x5d70eb,null))['catch'](handleError(_0x5d70eb,null));};exports[_0x0ab4('0x46')]=function(_0xdcc118,_0x302894){return db[_0x0ab4('0x3a')][_0x0ab4('0x46')](_0xdcc118[_0x0ab4('0x47')],{})[_0x0ab4('0x1f')](function(_0x356bc9){var _0x22402e=_0xdcc118[_0x0ab4('0x48')][_0x0ab4('0x20')]({'plain':!![]});if(!_0x22402e)throw new Error(_0x0ab4('0x49'));if(_0x22402e[_0x0ab4('0x4a')]==='user'){var _0x2c3a0a=_0x356bc9[_0x0ab4('0x20')]({'plain':!![]});var _0x5800cc=_0x0ab4('0x4b');return db['UserProfileSection']['find']({'where':{'name':_0x5800cc,'userProfileId':_0x22402e[_0x0ab4('0x4c')]},'raw':!![]})[_0x0ab4('0x1f')](function(_0x156e22){if(_0x156e22&&_0x156e22['autoAssociation']===0x0){return db[_0x0ab4('0x21')][_0x0ab4('0x46')]({'name':_0x2c3a0a[_0x0ab4('0x25')],'resourceId':_0x2c3a0a['id'],'type':_0x156e22[_0x0ab4('0x25')],'sectionId':_0x156e22['id']},{})[_0x0ab4('0x1f')](function(){return _0x356bc9;});}else{return _0x356bc9;}})[_0x0ab4('0x3f')](function(_0x1eea3b){logger['error'](_0x0ab4('0x4d'),_0x1eea3b);throw _0x1eea3b;});}return _0x356bc9;})['then'](respondWithResult(_0x302894,0xc9))[_0x0ab4('0x3f')](handleError(_0x302894,null));};exports['update']=function(_0x2597f2,_0x5550ff){if(_0x2597f2['body']['id']){delete _0x2597f2[_0x0ab4('0x47')]['id'];}return db[_0x0ab4('0x3a')][_0x0ab4('0x45')]({'where':{'id':_0x2597f2[_0x0ab4('0x41')]['id']}})['then'](handleEntityNotFound(_0x5550ff,null))[_0x0ab4('0x1f')](saveUpdates(_0x2597f2[_0x0ab4('0x47')],null))[_0x0ab4('0x1f')](respondWithResult(_0x5550ff,null))[_0x0ab4('0x3f')](handleError(_0x5550ff,null));};exports[_0x0ab4('0x22')]=function(_0x2354fa,_0x134437){return db[_0x0ab4('0x3a')][_0x0ab4('0x45')]({'where':{'id':_0x2354fa[_0x0ab4('0x41')]['id']}})[_0x0ab4('0x1f')](handleEntityNotFound(_0x134437,null))[_0x0ab4('0x1f')](db[_0x0ab4('0x4e')][_0x0ab4('0x4f')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x2354fa[_0x0ab4('0x41')]['id']}}))[_0x0ab4('0x1f')](removeEntity(_0x134437,null))[_0x0ab4('0x3f')](handleError(_0x134437,null));}; \ No newline at end of file +var _0x430c=['merge','options','includeAll','include','rows','catch','show','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','CmContactHasItem','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','get','ContactItemTypes','error','name','index','map','ContactItemType','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x430c,0x1a1));var _0xc430=function(_0x273f77,_0xe5b0cb){_0x273f77=_0x273f77-0x0;var _0x71e147=_0x430c[_0x273f77];return _0x71e147;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){var _0x48f67a=_0x4efecd[_0xc430('0x20')]({'plain':!![]});var _0x59c498=_0xc430('0x21');return db['UserProfileResource'][_0xc430('0x1f')]({'where':{'type':_0x59c498,'resourceId':_0x48f67a['id']}})[_0xc430('0x1e')](function(){return _0x4efecd;});})['then'](function(){_0x23425d[_0xc430('0x15')](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x2c0422,_0x44833e){return function(_0x285407){if(!_0x285407){_0x2c0422['sendStatus'](0x194);}return _0x285407;};}function handleError(_0x2ccc13,_0x1a9512){_0x1a9512=_0x1a9512||0x1f4;return function(_0x1c1da9){logger[_0xc430('0x22')](_0x1c1da9['stack']);if(_0x1c1da9[_0xc430('0x23')]){delete _0x1c1da9['name'];}_0x2ccc13[_0xc430('0x15')](_0x1a9512)['send'](_0x1c1da9);};}exports[_0xc430('0x24')]=function(_0x1045c0,_0xfc8767){var _0x3d7ccf={},_0x49977b={},_0x17c975={'count':0x0,'rows':[]};var _0x2a85aa=_[_0xc430('0x25')](db[_0xc430('0x26')]['rawAttributes'],function(_0xfcc12c){return{'name':_0xfcc12c[_0xc430('0x27')],'type':_0xfcc12c['type'][_0xc430('0x28')]};});_0x49977b['model']=_['map'](_0x2a85aa,_0xc430('0x23'));_0x49977b[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1045c0[_0xc430('0x29')]);_0x49977b[_0xc430('0x2b')]=_[_0xc430('0x2c')](_0x49977b[_0xc430('0x2d')],_0x49977b[_0xc430('0x29')]);_0x3d7ccf['attributes']=_[_0xc430('0x2c')](_0x49977b['model'],qs[_0xc430('0x2e')](_0x1045c0[_0xc430('0x29')][_0xc430('0x2e')]));_0x3d7ccf[_0xc430('0x2f')]=_0x3d7ccf['attributes'][_0xc430('0x30')]?_0x3d7ccf['attributes']:_0x49977b['model'];if(!_0x1045c0[_0xc430('0x29')][_0xc430('0x31')]('nolimit')){_0x3d7ccf[_0xc430('0x18')]=qs[_0xc430('0x18')](_0x1045c0[_0xc430('0x29')][_0xc430('0x18')]);_0x3d7ccf[_0xc430('0x1a')]=qs[_0xc430('0x1a')](_0x1045c0[_0xc430('0x29')][_0xc430('0x1a')]);}_0x3d7ccf[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1045c0[_0xc430('0x29')][_0xc430('0x33')]);_0x3d7ccf[_0xc430('0x34')]=qs[_0xc430('0x2b')](_[_0xc430('0x35')](_0x1045c0['query'],_0x49977b[_0xc430('0x2b')]),_0x2a85aa);if(_0x1045c0[_0xc430('0x29')][_0xc430('0x36')]){_0x3d7ccf[_0xc430('0x34')]=_['merge'](_0x3d7ccf[_0xc430('0x34')],{'$or':_[_0xc430('0x25')](_0x2a85aa,function(_0x13ac85){if(_0x13ac85[_0xc430('0x37')]!==_0xc430('0x38')){var _0x393f49={};_0x393f49[_0x13ac85['name']]={'$like':'%'+_0x1045c0[_0xc430('0x29')][_0xc430('0x36')]+'%'};return _0x393f49;}})});}_0x3d7ccf=_[_0xc430('0x39')]({},_0x3d7ccf,_0x1045c0[_0xc430('0x3a')]);var _0x1d156c={'where':_0x3d7ccf[_0xc430('0x34')]};return db[_0xc430('0x26')][_0xc430('0x1b')](_0x1d156c)[_0xc430('0x1e')](function(_0x4174d2){_0x17c975[_0xc430('0x1b')]=_0x4174d2;if(_0x1045c0[_0xc430('0x29')][_0xc430('0x3b')]){_0x3d7ccf[_0xc430('0x3c')]=[{'all':!![]}];}return db['ContactItemType']['findAll'](_0x3d7ccf);})['then'](function(_0x262063){_0x17c975[_0xc430('0x3d')]=_0x262063;return _0x17c975;})[_0xc430('0x1e')](respondWithFilteredResult(_0xfc8767,_0x3d7ccf))[_0xc430('0x3e')](handleError(_0xfc8767,null));};exports[_0xc430('0x3f')]=function(_0x3bfb23,_0x26cc86){var _0x270667={'raw':!![],'where':{'id':_0x3bfb23[_0xc430('0x40')]['id']}},_0x2d3473={};_0x2d3473[_0xc430('0x2d')]=_[_0xc430('0x2a')](db[_0xc430('0x26')][_0xc430('0x41')]);_0x2d3473[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x3bfb23['query']);_0x2d3473[_0xc430('0x2b')]=_[_0xc430('0x2c')](_0x2d3473[_0xc430('0x2d')],_0x2d3473[_0xc430('0x29')]);_0x270667[_0xc430('0x2f')]=_[_0xc430('0x2c')](_0x2d3473[_0xc430('0x2d')],qs[_0xc430('0x2e')](_0x3bfb23['query'][_0xc430('0x2e')]));_0x270667['attributes']=_0x270667[_0xc430('0x2f')][_0xc430('0x30')]?_0x270667['attributes']:_0x2d3473['model'];if(_0x3bfb23[_0xc430('0x29')]['includeAll']){_0x270667['include']=[{'all':!![]}];}_0x270667=_[_0xc430('0x39')]({},_0x270667,_0x3bfb23['options']);return db[_0xc430('0x26')][_0xc430('0x42')](_0x270667)[_0xc430('0x1e')](handleEntityNotFound(_0x26cc86,null))['then'](respondWithResult(_0x26cc86,null))[_0xc430('0x3e')](handleError(_0x26cc86,null));};exports[_0xc430('0x43')]=function(_0x19e563,_0x549400){return db[_0xc430('0x26')][_0xc430('0x43')](_0x19e563[_0xc430('0x44')],{})[_0xc430('0x1e')](function(_0x636374){var _0x3b85f6=_0x19e563[_0xc430('0x45')]['get']({'plain':!![]});if(!_0x3b85f6)throw new Error(_0xc430('0x46'));if(_0x3b85f6[_0xc430('0x47')]===_0xc430('0x45')){var _0x4e9aff=_0x636374[_0xc430('0x20')]({'plain':!![]});var _0x4178d7=_0xc430('0x21');return db[_0xc430('0x48')]['find']({'where':{'name':_0x4178d7,'userProfileId':_0x3b85f6[_0xc430('0x49')]},'raw':!![]})['then'](function(_0x110566){if(_0x110566&&_0x110566[_0xc430('0x4a')]===0x0){return db[_0xc430('0x4b')][_0xc430('0x43')]({'name':_0x4e9aff[_0xc430('0x23')],'resourceId':_0x4e9aff['id'],'type':_0x110566[_0xc430('0x23')],'sectionId':_0x110566['id']},{})['then'](function(){return _0x636374;});}else{return _0x636374;}})[_0xc430('0x3e')](function(_0x654bed){logger['error'](_0xc430('0x4c'),_0x654bed);throw _0x654bed;});}return _0x636374;})[_0xc430('0x1e')](respondWithResult(_0x549400,0xc9))[_0xc430('0x3e')](handleError(_0x549400,null));};exports[_0xc430('0x4d')]=function(_0x5e361a,_0x23f2e9){if(_0x5e361a['body']['id']){delete _0x5e361a[_0xc430('0x44')]['id'];}return db[_0xc430('0x26')][_0xc430('0x42')]({'where':{'id':_0x5e361a[_0xc430('0x40')]['id']}})['then'](handleEntityNotFound(_0x23f2e9,null))[_0xc430('0x1e')](saveUpdates(_0x5e361a[_0xc430('0x44')],null))['then'](respondWithResult(_0x23f2e9,null))['catch'](handleError(_0x23f2e9,null));};exports[_0xc430('0x1f')]=function(_0x274760,_0x2d3e0b){return db[_0xc430('0x26')][_0xc430('0x42')]({'where':{'id':_0x274760[_0xc430('0x40')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x2d3e0b,null))['then'](db[_0xc430('0x4e')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x274760[_0xc430('0x40')]['id']}}))[_0xc430('0x1e')](removeEntity(_0x2d3e0b,null))[_0xc430('0x3e')](handleError(_0x2d3e0b,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 9461395..3526f2b 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 _0x17d1=['exports','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','bluebird','request-promise','path','./contactItemType.attributes'];(function(_0x4c27d6,_0x17cac5){var _0x1a79b6=function(_0x4eb6cd){while(--_0x4eb6cd){_0x4c27d6['push'](_0x4c27d6['shift']());}};_0x1a79b6(++_0x17cac5);}(_0x17d1,0x1e8));var _0x117d=function(_0x2798cd,_0x557b94){_0x2798cd=_0x2798cd-0x0;var _0x210123=_0x17d1[_0x2798cd];return _0x210123;};'use strict';var _=require(_0x117d('0x0'));var util=require(_0x117d('0x1'));var logger=require(_0x117d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x117d('0x3'));var rp=require(_0x117d('0x4'));var fs=require('fs');var path=require(_0x117d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x117d('0x6'));module[_0x117d('0x7')]=function(_0xc97bb0,_0x908fa4){return _0xc97bb0[_0x117d('0x8')](_0x117d('0x9'),attributes,{'tableName':_0x117d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0005=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType'];(function(_0x90bed1,_0x433916){var _0x430f0c=function(_0x4da123){while(--_0x4da123){_0x90bed1['push'](_0x90bed1['shift']());}};_0x430f0c(++_0x433916);}(_0x0005,0xa8));var _0x5000=function(_0x25ee34,_0x1eca12){_0x25ee34=_0x25ee34-0x0;var _0x36b68c=_0x0005[_0x25ee34];return _0x36b68c;};'use strict';var _=require(_0x5000('0x0'));var util=require(_0x5000('0x1'));var logger=require('../../config/logger')(_0x5000('0x2'));var moment=require('moment');var BPromise=require(_0x5000('0x3'));var rp=require(_0x5000('0x4'));var fs=require('fs');var path=require(_0x5000('0x5'));var rimraf=require(_0x5000('0x6'));var config=require(_0x5000('0x7'));var attributes=require(_0x5000('0x8'));module[_0x5000('0x9')]=function(_0x50694b,_0x425adf){return _0x50694b[_0x5000('0xa')](_0x5000('0xb'),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 a413d63..2766da6 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 _0x23b4=['ContactItemType,\x20%s,\x20%s','result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x30705f,_0xd4804a){var _0x5dd64c=function(_0x2f3c93){while(--_0x2f3c93){_0x30705f['push'](_0x30705f['shift']());}};_0x5dd64c(++_0xd4804a);}(_0x23b4,0xf3));var _0x423b=function(_0x47c5d8,_0x39bd42){_0x47c5d8=_0x47c5d8-0x0;var _0x55acdb=_0x23b4[_0x47c5d8];return _0x55acdb;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x423b('0x0'));var rs=require(_0x423b('0x1'));var fs=require('fs');var Redis=require(_0x423b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x423b('0x3'));var logger=require(_0x423b('0x4'))(_0x423b('0x5'));var config=require(_0x423b('0x6'));var jayson=require(_0x423b('0x7'));var client=jayson[_0x423b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45f269,_0x3d1243,_0x153956){return new BPromise(function(_0x5a4e0f,_0x55d5e0){return client['request'](_0x45f269,_0x153956)[_0x423b('0x9')](function(_0x17446){logger[_0x423b('0xa')]('ContactItemType,\x20%s,\x20%s',_0x3d1243,_0x423b('0xb'));logger['debug'](_0x423b('0xc'),_0x3d1243,_0x423b('0xb'),JSON[_0x423b('0xd')](_0x17446));if(_0x17446[_0x423b('0xe')]){if(_0x17446[_0x423b('0xe')][_0x423b('0xf')]===0x1f4){logger[_0x423b('0xe')]('ContactItemType,\x20%s,\x20%s',_0x3d1243,_0x17446[_0x423b('0xe')][_0x423b('0x10')]);return _0x55d5e0(_0x17446[_0x423b('0xe')][_0x423b('0x10')]);}logger[_0x423b('0xe')](_0x423b('0x11'),_0x3d1243,_0x17446['error'][_0x423b('0x10')]);return _0x5a4e0f(_0x17446[_0x423b('0xe')]['message']);}else{logger[_0x423b('0xa')]('ContactItemType,\x20%s,\x20%s',_0x3d1243,_0x423b('0xb'));_0x5a4e0f(_0x17446[_0x423b('0x12')][_0x423b('0x10')]);}})[_0x423b('0x13')](function(_0x262c84){logger[_0x423b('0xe')](_0x423b('0x11'),_0x3d1243,_0x262c84);_0x55d5e0(_0x262c84);});});} \ No newline at end of file +var _0xa887=['rpc','../../config/environment','jayson/promise','client','http','then','info','debug','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ContactItemType,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4f152e,_0x35162a){var _0x9b2c79=function(_0x152076){while(--_0x152076){_0x4f152e['push'](_0x4f152e['shift']());}};_0x9b2c79(++_0x35162a);}(_0xa887,0x89));var _0x7a88=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa887[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x7a88('0x0'));var util=require('util');var moment=require(_0x7a88('0x1'));var BPromise=require(_0x7a88('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a88('0x3'));var db=require(_0x7a88('0x4'))['db'];var utils=require(_0x7a88('0x5'));var logger=require(_0x7a88('0x6'))(_0x7a88('0x7'));var config=require(_0x7a88('0x8'));var jayson=require(_0x7a88('0x9'));var client=jayson[_0x7a88('0xa')][_0x7a88('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52edce,_0x3a49be,_0x2d0445){return new BPromise(function(_0x5d7a48,_0x34f335){return client['request'](_0x52edce,_0x2d0445)[_0x7a88('0xc')](function(_0x179388){logger[_0x7a88('0xd')]('ContactItemType,\x20%s,\x20%s',_0x3a49be,'request\x20sent');logger[_0x7a88('0xe')](_0x7a88('0xf'),_0x3a49be,_0x7a88('0x10'),JSON[_0x7a88('0x11')](_0x179388));if(_0x179388[_0x7a88('0x12')]){if(_0x179388[_0x7a88('0x12')][_0x7a88('0x13')]===0x1f4){logger[_0x7a88('0x12')]('ContactItemType,\x20%s,\x20%s',_0x3a49be,_0x179388[_0x7a88('0x12')]['message']);return _0x34f335(_0x179388[_0x7a88('0x12')][_0x7a88('0x14')]);}logger[_0x7a88('0x12')](_0x7a88('0x15'),_0x3a49be,_0x179388['error'][_0x7a88('0x14')]);return _0x5d7a48(_0x179388['error'][_0x7a88('0x14')]);}else{logger['info']('ContactItemType,\x20%s,\x20%s',_0x3a49be,'request\x20sent');_0x5d7a48(_0x179388[_0x7a88('0x16')]['message']);}})[_0x7a88('0x17')](function(_0x71c7b9){logger[_0x7a88('0x12')](_0x7a88('0x15'),_0x3a49be,_0x71c7b9);_0x34f335(_0x71c7b9);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 76efa3b..85c71a9 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 _0x17ad=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','index','get','/:id','show','post','create','put','isAuthenticated'];(function(_0x3392bc,_0x6fde3c){var _0x20f6c8=function(_0xd6fae0){while(--_0xd6fae0){_0x3392bc['push'](_0x3392bc['shift']());}};_0x20f6c8(++_0x6fde3c);}(_0x17ad,0xb7));var _0xd17a=function(_0x7a5e2e,_0x19129f){_0x7a5e2e=_0x7a5e2e-0x0;var _0x1fd69d=_0x17ad[_0x7a5e2e];return _0x1fd69d;};'use strict';var multer=require(_0xd17a('0x0'));var util=require('util');var path=require(_0xd17a('0x1'));var timeout=require(_0xd17a('0x2'));var express=require(_0xd17a('0x3'));var router=express[_0xd17a('0x4')]();var fs_extra=require(_0xd17a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd17a('0x6'));var controller=require('./contactItemType.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd17a('0x7')]);router[_0xd17a('0x8')](_0xd17a('0x9'),auth['isAuthenticated'](),controller[_0xd17a('0xa')]);router[_0xd17a('0xb')]('/',auth['isAuthenticated'](),controller[_0xd17a('0xc')]);router[_0xd17a('0xd')]('/:id',auth[_0xd17a('0xe')](),controller['update']);router[_0xd17a('0xf')](_0xd17a('0x9'),auth['isAuthenticated'](),controller[_0xd17a('0x10')]);module[_0xd17a('0x11')]=router; \ No newline at end of file +var _0xc8c3=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x399095,_0x133dae){var _0x40a046=function(_0x1e6803){while(--_0x1e6803){_0x399095['push'](_0x399095['shift']());}};_0x40a046(++_0x133dae);}(_0xc8c3,0x112));var _0x3c8c=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xc8c3[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x3c8c('0x0'));var util=require(_0x3c8c('0x1'));var path=require(_0x3c8c('0x2'));var timeout=require(_0x3c8c('0x3'));var express=require(_0x3c8c('0x4'));var router=express[_0x3c8c('0x5')]();var fs_extra=require(_0x3c8c('0x6'));var auth=require(_0x3c8c('0x7'));var interaction=require(_0x3c8c('0x8'));var config=require(_0x3c8c('0x9'));var controller=require(_0x3c8c('0xa'));router[_0x3c8c('0xb')]('/',auth[_0x3c8c('0xc')](),controller['index']);router[_0x3c8c('0xb')]('/:id',auth[_0x3c8c('0xc')](),controller[_0x3c8c('0xd')]);router[_0x3c8c('0xe')]('/',auth[_0x3c8c('0xc')](),controller[_0x3c8c('0xf')]);router[_0x3c8c('0x10')](_0x3c8c('0x11'),auth[_0x3c8c('0xc')](),controller[_0x3c8c('0x12')]);router[_0x3c8c('0x13')](_0x3c8c('0x11'),auth[_0x3c8c('0xc')](),controller[_0x3c8c('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 4cde4bc..d3a4dbb 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 _0xd8b0=['exports','sequelize'];(function(_0x516480,_0x45ab1d){var _0x4ae7c1=function(_0x58db20){while(--_0x58db20){_0x516480['push'](_0x516480['shift']());}};_0x4ae7c1(++_0x45ab1d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x2a7b00,_0x414607){var _0x552aaf=function(_0x30d69f){while(--_0x30d69f){_0x2a7b00['push'](_0x2a7b00['shift']());}};_0x552aaf(++_0x414607);}(_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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 98fd7d4..70561d7 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 _0xbcb4=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','./dashboard.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','get','CustomDashboards','UserProfileResource','destroy','end','error','stack','name','send','index','Dashboard','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','filters','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','clone','include','omit','createdAt','updatedAt','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','findOne','params','eml-format','zip-dir','request-promise','bluebird','util','path','sox'];(function(_0x4159e9,_0x1714ff){var _0x30a9ae=function(_0x47465a){while(--_0x47465a){_0x4159e9['push'](_0x4159e9['shift']());}};_0x30a9ae(++_0x1714ff);}(_0xbcb4,0x79));var _0x4bcb=function(_0x22f5e6,_0x2a8dec){_0x22f5e6=_0x22f5e6-0x0;var _0x268795=_0xbcb4[_0x22f5e6];return _0x268795;};'use strict';var emlformat=require(_0x4bcb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4bcb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4bcb('0x2'));var moment=require('moment');var BPromise=require(_0x4bcb('0x3'));var Mustache=require('mustache');var util=require(_0x4bcb('0x4'));var path=require(_0x4bcb('0x5'));var sox=require(_0x4bcb('0x6'));var csv=require(_0x4bcb('0x7'));var ejs=require(_0x4bcb('0x8'));var fs=require('fs');var fs_extra=require(_0x4bcb('0x9'));var _=require(_0x4bcb('0xa'));var squel=require(_0x4bcb('0xb'));var crypto=require(_0x4bcb('0xc'));var jsforce=require(_0x4bcb('0xd'));var deskjs=require(_0x4bcb('0xe'));var toCsv=require(_0x4bcb('0x7'));var querystring=require(_0x4bcb('0xf'));var Papa=require(_0x4bcb('0x10'));var Redis=require('ioredis');var authService=require(_0x4bcb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4bcb('0x12'));var hardwareService=require(_0x4bcb('0x13'));var logger=require('../../config/logger')(_0x4bcb('0x14'));var utils=require(_0x4bcb('0x15'));var config=require(_0x4bcb('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4bcb('0x17')]=_[_0x4bcb('0x18')](config[_0x4bcb('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4bcb('0x17')]));require(_0x4bcb('0x19'))[_0x4bcb('0x1a')](socket);function respondWithStatusCode(_0x4120d2,_0x444b95){_0x444b95=_0x444b95||0xcc;return function(_0x2abd8e){if(_0x2abd8e){return _0x4120d2[_0x4bcb('0x1b')](_0x444b95);}return _0x4120d2[_0x4bcb('0x1c')](_0x444b95)['end']();};}function respondWithResult(_0xbe8805,_0x2923a0){_0x2923a0=_0x2923a0||0xc8;return function(_0x2b5145){if(_0x2b5145){return _0xbe8805['status'](_0x2923a0)[_0x4bcb('0x1d')](_0x2b5145);}};}function respondWithFilteredResult(_0x59ea6b,_0x60b8b0){return function(_0x27c921){if(_0x27c921){var _0x575c22=typeof _0x60b8b0[_0x4bcb('0x1e')]==='undefined'&&typeof _0x60b8b0[_0x4bcb('0x1f')]===_0x4bcb('0x20');var _0x2f8a27=_0x27c921[_0x4bcb('0x21')];var _0x170be4=_0x575c22?0x0:_0x60b8b0['offset'];var _0x3ba42a=_0x575c22?_0x27c921[_0x4bcb('0x21')]:_0x60b8b0['offset']+_0x60b8b0[_0x4bcb('0x1f')];var _0x53db4f;if(_0x3ba42a>=_0x2f8a27){_0x3ba42a=_0x2f8a27;_0x53db4f=0xc8;}else{_0x53db4f=0xce;}_0x59ea6b[_0x4bcb('0x1c')](_0x53db4f);return _0x59ea6b[_0x4bcb('0x22')](_0x4bcb('0x23'),_0x170be4+'-'+_0x3ba42a+'/'+_0x2f8a27)[_0x4bcb('0x1d')](_0x27c921);}return null;};}function patchUpdates(_0x22b648){return function(_0x811fce){try{jsonpatch[_0x4bcb('0x24')](_0x811fce,_0x22b648,!![]);}catch(_0x4ca11c){return BPromise['reject'](_0x4ca11c);}return _0x811fce[_0x4bcb('0x25')]();};}function saveUpdates(_0x14bca6,_0x4f790d){return function(_0x170922){if(_0x170922){return _0x170922[_0x4bcb('0x26')](_0x14bca6)[_0x4bcb('0x27')](function(_0x1f5758){return _0x1f5758;});}return null;};}function removeEntity(_0x5a7054,_0x4bdbe7){return function(_0x2fb876){if(_0x2fb876){return _0x2fb876['destroy']()[_0x4bcb('0x27')](function(){var _0x3914ba=_0x2fb876[_0x4bcb('0x28')]({'plain':!![]});var _0x31ad0d=_0x4bcb('0x29');return db[_0x4bcb('0x2a')][_0x4bcb('0x2b')]({'where':{'type':_0x31ad0d,'resourceId':_0x3914ba['id']}})[_0x4bcb('0x27')](function(){return _0x2fb876;});})['then'](function(){_0x5a7054[_0x4bcb('0x1c')](0xcc)[_0x4bcb('0x2c')]();});}};}function handleEntityNotFound(_0x45627a,_0xd512b0){return function(_0x417e7d){if(!_0x417e7d){_0x45627a[_0x4bcb('0x1b')](0x194);}return _0x417e7d;};}function handleError(_0x1d8724,_0x21d4f5){_0x21d4f5=_0x21d4f5||0x1f4;return function(_0x3082ca){logger[_0x4bcb('0x2d')](_0x3082ca[_0x4bcb('0x2e')]);if(_0x3082ca[_0x4bcb('0x2f')]){delete _0x3082ca[_0x4bcb('0x2f')];}_0x1d8724[_0x4bcb('0x1c')](_0x21d4f5)[_0x4bcb('0x30')](_0x3082ca);};}exports[_0x4bcb('0x31')]=function(_0x40a6b3,_0x59c355){var _0x35771f={},_0x10575d={},_0x55f23e={'count':0x0,'rows':[]};var _0x5e322e=_['map'](db[_0x4bcb('0x32')][_0x4bcb('0x33')],function(_0x33a5c1){return{'name':_0x33a5c1[_0x4bcb('0x34')],'type':_0x33a5c1[_0x4bcb('0x35')][_0x4bcb('0x36')]};});_0x10575d[_0x4bcb('0x37')]=_[_0x4bcb('0x38')](_0x5e322e,_0x4bcb('0x2f'));_0x10575d[_0x4bcb('0x39')]=_[_0x4bcb('0x3a')](_0x40a6b3['query']);_0x10575d['filters']=_[_0x4bcb('0x3b')](_0x10575d[_0x4bcb('0x37')],_0x10575d[_0x4bcb('0x39')]);_0x35771f[_0x4bcb('0x3c')]=_[_0x4bcb('0x3b')](_0x10575d[_0x4bcb('0x37')],qs[_0x4bcb('0x3d')](_0x40a6b3[_0x4bcb('0x39')][_0x4bcb('0x3d')]));_0x35771f['attributes']=_0x35771f[_0x4bcb('0x3c')][_0x4bcb('0x3e')]?_0x35771f[_0x4bcb('0x3c')]:_0x10575d['model'];if(!_0x40a6b3[_0x4bcb('0x39')][_0x4bcb('0x3f')](_0x4bcb('0x40'))){_0x35771f[_0x4bcb('0x1f')]=qs[_0x4bcb('0x1f')](_0x40a6b3[_0x4bcb('0x39')][_0x4bcb('0x1f')]);_0x35771f[_0x4bcb('0x1e')]=qs['offset'](_0x40a6b3[_0x4bcb('0x39')][_0x4bcb('0x1e')]);}_0x35771f[_0x4bcb('0x41')]=qs['sort'](_0x40a6b3[_0x4bcb('0x39')][_0x4bcb('0x42')]);_0x35771f[_0x4bcb('0x43')]=qs['filters'](_[_0x4bcb('0x44')](_0x40a6b3[_0x4bcb('0x39')],_0x10575d['filters']),_0x5e322e);if(_0x40a6b3[_0x4bcb('0x39')][_0x4bcb('0x45')]){_0x35771f[_0x4bcb('0x43')]=_[_0x4bcb('0x46')](_0x35771f[_0x4bcb('0x43')],{'$or':_[_0x4bcb('0x38')](_0x5e322e,function(_0x3ed53f){if(_0x3ed53f[_0x4bcb('0x35')]!==_0x4bcb('0x47')){var _0x3d9915={};_0x3d9915[_0x3ed53f[_0x4bcb('0x2f')]]={'$like':'%'+_0x40a6b3['query'][_0x4bcb('0x45')]+'%'};return _0x3d9915;}})});}_0x35771f=_[_0x4bcb('0x46')]({},_0x35771f,_0x40a6b3[_0x4bcb('0x48')]);var _0x2039ec={'where':_0x35771f['where']};return db[_0x4bcb('0x32')][_0x4bcb('0x21')](_0x2039ec)['then'](function(_0xbfd7bc){_0x55f23e['count']=_0xbfd7bc;if(_0x40a6b3[_0x4bcb('0x39')][_0x4bcb('0x49')]){_0x35771f['include']=[{'all':!![]}];}return db[_0x4bcb('0x32')]['findAll'](_0x35771f);})[_0x4bcb('0x27')](function(_0xbf1c22){_0x55f23e[_0x4bcb('0x4a')]=_0xbf1c22;return _0x55f23e;})[_0x4bcb('0x27')](respondWithFilteredResult(_0x59c355,_0x35771f))['catch'](handleError(_0x59c355,null));};exports[_0x4bcb('0x4b')]=function(_0x137f1b,_0x736eca){var _0x3b73dc={'raw':![],'where':{'id':_0x137f1b['params']['id']}},_0x52c01b={};_0x52c01b[_0x4bcb('0x37')]=_['keys'](db['Dashboard'][_0x4bcb('0x33')]);_0x52c01b[_0x4bcb('0x39')]=_[_0x4bcb('0x3a')](_0x137f1b[_0x4bcb('0x39')]);_0x52c01b[_0x4bcb('0x4c')]=_[_0x4bcb('0x3b')](_0x52c01b[_0x4bcb('0x37')],_0x52c01b['query']);_0x3b73dc[_0x4bcb('0x3c')]=_['intersection'](_0x52c01b[_0x4bcb('0x37')],qs[_0x4bcb('0x3d')](_0x137f1b['query'][_0x4bcb('0x3d')]));_0x3b73dc['attributes']=_0x3b73dc[_0x4bcb('0x3c')][_0x4bcb('0x3e')]?_0x3b73dc[_0x4bcb('0x3c')]:_0x52c01b[_0x4bcb('0x37')];if(_0x137f1b['query']['includeAll']){_0x3b73dc['include']=[{'all':!![]}];}_0x3b73dc=_[_0x4bcb('0x46')]({},_0x3b73dc,_0x137f1b[_0x4bcb('0x48')]);return db[_0x4bcb('0x32')][_0x4bcb('0x4d')](_0x3b73dc)[_0x4bcb('0x27')](handleEntityNotFound(_0x736eca,null))[_0x4bcb('0x27')](respondWithResult(_0x736eca,null))['catch'](handleError(_0x736eca,null));};exports['create']=function(_0x1a114e,_0x294631){return db['Dashboard'][_0x4bcb('0x4e')](_0x1a114e[_0x4bcb('0x4f')],{})['then'](function(_0x3a9655){var _0x12c54c=_0x1a114e[_0x4bcb('0x50')][_0x4bcb('0x28')]({'plain':!![]});if(!_0x12c54c)throw new Error(_0x4bcb('0x51'));if(_0x12c54c[_0x4bcb('0x52')]==='user'){var _0x41883a=_0x3a9655[_0x4bcb('0x28')]({'plain':!![]});var _0x3cdca4=_0x4bcb('0x29');return db[_0x4bcb('0x53')][_0x4bcb('0x4d')]({'where':{'name':_0x3cdca4,'userProfileId':_0x12c54c[_0x4bcb('0x54')]},'raw':!![]})[_0x4bcb('0x27')](function(_0x2272af){if(_0x2272af&&_0x2272af[_0x4bcb('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x41883a[_0x4bcb('0x2f')],'resourceId':_0x41883a['id'],'type':_0x2272af[_0x4bcb('0x2f')],'sectionId':_0x2272af['id']},{})[_0x4bcb('0x27')](function(){return _0x3a9655;});}else{return _0x3a9655;}})[_0x4bcb('0x56')](function(_0x3879d0){logger[_0x4bcb('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3879d0);throw _0x3879d0;});}return _0x3a9655;})[_0x4bcb('0x27')](respondWithResult(_0x294631,0xc9))['catch'](handleError(_0x294631,null));};exports[_0x4bcb('0x57')]=function(_0x4486b9,_0x579870){var _0x304e6b={'where':{'id':_0x4486b9['params']['id']}},_0x5613f8={};_0x5613f8['model']=_['keys'](db[_0x4bcb('0x32')][_0x4bcb('0x33')]);_0x304e6b[_0x4bcb('0x3c')]=_[_0x4bcb('0x3b')](_0x5613f8['model'],qs[_0x4bcb('0x3d')](_0x4486b9[_0x4bcb('0x39')][_0x4bcb('0x3d')]));_0x304e6b[_0x4bcb('0x3c')]=_0x304e6b['attributes'][_0x4bcb('0x3e')]?_0x304e6b[_0x4bcb('0x3c')]:_0x5613f8[_0x4bcb('0x37')];if(_0x4486b9[_0x4bcb('0x39')][_0x4bcb('0x49')]){_0x304e6b[_0x4bcb('0x58')]=[{'all':!![]}];}_0x304e6b=_['merge']({},_0x304e6b,_0x4486b9[_0x4bcb('0x48')]);return db[_0x4bcb('0x32')][_0x4bcb('0x4d')](_0x304e6b)[_0x4bcb('0x27')](handleEntityNotFound(_0x579870,null))[_0x4bcb('0x27')](function(_0x47a648){if(_0x47a648){var _0x45db10=_0x47a648[_0x4bcb('0x28')]({'plain':!![]});_0x45db10=qs[_0x4bcb('0x59')](_0x45db10,['id',_0x4bcb('0x5a'),_0x4bcb('0x5b')]);_0x4486b9[_0x4bcb('0x4f')]=_[_0x4bcb('0x59')](_0x4486b9[_0x4bcb('0x4f')],['id',_0x4bcb('0x5a'),_0x4bcb('0x5b')]);return db[_0x4bcb('0x32')][_0x4bcb('0x4e')](_['merge'](_0x45db10,_0x4486b9[_0x4bcb('0x4f')]),{'include':_0x4486b9[_0x4bcb('0x39')][_0x4bcb('0x49')]?[{'all':!![]}]:undefined})[_0x4bcb('0x27')](function(_0x4a11d5){var _0xf90eac=_0x4486b9[_0x4bcb('0x50')][_0x4bcb('0x28')]({'plain':!![]});if(!_0xf90eac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf90eac['role']===_0x4bcb('0x50')){var _0x58b258=_0x4a11d5[_0x4bcb('0x28')]({'plain':!![]});var _0x600b83=_0x4bcb('0x29');return db['UserProfileSection'][_0x4bcb('0x4d')]({'where':{'name':_0x600b83,'userProfileId':_0xf90eac[_0x4bcb('0x54')]},'raw':!![]})[_0x4bcb('0x27')](function(_0xaceb92){if(_0xaceb92&&_0xaceb92[_0x4bcb('0x55')]===0x0){return db[_0x4bcb('0x2a')]['create']({'name':_0x58b258['name'],'resourceId':_0x58b258['id'],'type':_0xaceb92[_0x4bcb('0x2f')],'sectionId':_0xaceb92['id']},{})[_0x4bcb('0x27')](function(){return _0x4a11d5;});}else{return _0x4a11d5;}})[_0x4bcb('0x56')](function(_0xd2598e){logger[_0x4bcb('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd2598e);throw _0xd2598e;});}return _0x4a11d5;});}})[_0x4bcb('0x27')](respondWithResult(_0x579870,0xc9))[_0x4bcb('0x56')](handleError(_0x579870,null));};exports[_0x4bcb('0x26')]=function(_0x5727ce,_0x574663){if(_0x5727ce['body']['id']){delete _0x5727ce[_0x4bcb('0x4f')]['id'];}return db[_0x4bcb('0x32')][_0x4bcb('0x4d')]({'where':{'id':_0x5727ce['params']['id']}})[_0x4bcb('0x27')](handleEntityNotFound(_0x574663,null))[_0x4bcb('0x27')](saveUpdates(_0x5727ce[_0x4bcb('0x4f')],null))[_0x4bcb('0x27')](respondWithResult(_0x574663,null))['catch'](handleError(_0x574663,null));};exports[_0x4bcb('0x2b')]=function(_0x2200f1,_0x4208ad){return db[_0x4bcb('0x32')][_0x4bcb('0x4d')]({'where':{'id':_0x2200f1['params']['id']}})[_0x4bcb('0x27')](handleEntityNotFound(_0x4208ad,null))[_0x4bcb('0x27')](removeEntity(_0x4208ad,null))[_0x4bcb('0x56')](handleError(_0x4208ad,null));};function widgetAttributes(_0x597764){try{switch(_0x597764[_0x4bcb('0x35')]){case _0x4bcb('0x5c'):return[{'name':_0x4bcb('0x5d'),'value':_0x597764[_0x4bcb('0x5d')]||(_0x597764['attrs']&&_0x597764[_0x4bcb('0x5e')][0x0]?_0x597764[_0x4bcb('0x5e')][0x0][_0x4bcb('0x5f')]:undefined)||_0x4bcb('0x60')}];case'custom':return[{'name':_0x4bcb('0x61'),'value':_0x597764[_0x4bcb('0x61')]||(_0x597764['attrs']&&_0x597764[_0x4bcb('0x5e')][0x0]?_0x597764[_0x4bcb('0x5e')][0x0][_0x4bcb('0x5f')]:undefined)||''}];case _0x4bcb('0x62'):return[{'name':'attrHourFormat','value':_0x597764[_0x4bcb('0x63')]||(_0x597764[_0x4bcb('0x5e')]&&_0x597764[_0x4bcb('0x5e')][0x0]?_0x597764[_0x4bcb('0x5e')][0x0][_0x4bcb('0x5f')]:undefined)||_0x4bcb('0x64')},{'name':_0x4bcb('0x65'),'value':_0x597764['attrTimezone']||(_0x597764['attrs']&&_0x597764[_0x4bcb('0x5e')][0x1]?_0x597764[_0x4bcb('0x5e')][0x1][_0x4bcb('0x5f')]:undefined)||_0x4bcb('0x66')},{'name':_0x4bcb('0x67'),'value':_0x597764[_0x4bcb('0x67')]||(_0x597764[_0x4bcb('0x5e')]&&_0x597764[_0x4bcb('0x5e')][0x2]?_0x597764[_0x4bcb('0x5e')][0x2][_0x4bcb('0x5f')]:undefined)||0xc}];case _0x4bcb('0x68'):return[{'name':_0x4bcb('0x69'),'value':_0x597764['attrMetric']||(_0x597764['attrs']&&_0x597764['attrs'][0x0]?_0x597764[_0x4bcb('0x5e')][0x0][_0x4bcb('0x5f')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x597764[_0x4bcb('0x6a')]||(_0x597764['attrs']&&_0x597764[_0x4bcb('0x5e')][0x1]?_0x597764['attrs'][0x1]['value']:undefined)||[]},{'name':_0x4bcb('0x67'),'value':_0x597764[_0x4bcb('0x67')]||(_0x597764[_0x4bcb('0x5e')]&&_0x597764[_0x4bcb('0x5e')][0x2]?_0x597764[_0x4bcb('0x5e')][0x2][_0x4bcb('0x5f')]:undefined)||0x14},{'name':_0x4bcb('0x6b'),'value':_0x597764[_0x4bcb('0x6b')]||(_0x597764[_0x4bcb('0x5e')]&&_0x597764[_0x4bcb('0x5e')][0x3]?_0x597764[_0x4bcb('0x5e')][0x3][_0x4bcb('0x5f')]:undefined)||'voice'},{'name':_0x4bcb('0x6c'),'value':_0x597764[_0x4bcb('0x6c')]||(_0x597764[_0x4bcb('0x5e')]&&_0x597764['attrs'][0x4]?_0x597764[_0x4bcb('0x5e')][0x4][_0x4bcb('0x5f')]:undefined)||''},{'name':_0x4bcb('0x6d'),'value':_0x597764[_0x4bcb('0x6d')]||(_0x597764[_0x4bcb('0x5e')]&&_0x597764[_0x4bcb('0x5e')][0x5]?_0x597764[_0x4bcb('0x5e')][0x5][_0x4bcb('0x5f')]:undefined)||''},{'name':_0x4bcb('0x6e'),'value':_0x597764[_0x4bcb('0x6e')]||(_0x597764['attrs']&&_0x597764[_0x4bcb('0x5e')][0x6]?_0x597764[_0x4bcb('0x5e')][0x6][_0x4bcb('0x5f')]:undefined)||''},{'name':_0x4bcb('0x6f'),'value':_0x597764['attrOpenchannelAccounts']||(_0x597764['attrs']&&_0x597764['attrs'][0x7]?_0x597764['attrs'][0x7][_0x4bcb('0x5f')]:undefined)||''},{'name':_0x4bcb('0x70'),'value':_0x597764[_0x4bcb('0x70')]||(_0x597764[_0x4bcb('0x5e')]&&_0x597764[_0x4bcb('0x5e')][0x8]?_0x597764[_0x4bcb('0x5e')][0x8]['value']:undefined)||''},{'name':_0x4bcb('0x71'),'value':_0x597764[_0x4bcb('0x71')]||(_0x597764[_0x4bcb('0x5e')]&&_0x597764[_0x4bcb('0x5e')][0x9]?_0x597764[_0x4bcb('0x5e')][0x9][_0x4bcb('0x5f')]:undefined)||''}];case'multibar-chart':case _0x4bcb('0x72'):return[{'name':'attrSerie1','value':_0x597764[_0x4bcb('0x73')]||(_0x597764[_0x4bcb('0x5e')]&&_0x597764['attrs'][0x0]?_0x597764['attrs'][0x0][_0x4bcb('0x5f')]:undefined)||'total'},{'name':_0x4bcb('0x74'),'value':_0x597764[_0x4bcb('0x74')]||(_0x597764[_0x4bcb('0x5e')]&&_0x597764['attrs'][0x1]?_0x597764[_0x4bcb('0x5e')][0x1]['value']:undefined)||null},{'name':_0x4bcb('0x75'),'value':_0x597764['attrSerie3']||(_0x597764[_0x4bcb('0x5e')]&&_0x597764[_0x4bcb('0x5e')][0x2]?_0x597764['attrs'][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x597764[_0x4bcb('0x6a')]||(_0x597764[_0x4bcb('0x5e')]&&_0x597764[_0x4bcb('0x5e')][0x3]?_0x597764['attrs'][0x3][_0x4bcb('0x5f')]:undefined)||[]},{'name':_0x4bcb('0x6b'),'value':_0x597764['attrChannel']||(_0x597764['attrs']&&_0x597764[_0x4bcb('0x5e')][0x4]?_0x597764[_0x4bcb('0x5e')][0x4][_0x4bcb('0x5f')]:undefined)||_0x4bcb('0x76')},{'name':_0x4bcb('0x6c'),'value':_0x597764['attrEmailAccounts']||(_0x597764[_0x4bcb('0x5e')]&&_0x597764[_0x4bcb('0x5e')][0x5]?_0x597764[_0x4bcb('0x5e')][0x5]['value']:undefined)||''},{'name':_0x4bcb('0x6d'),'value':_0x597764['attrFaxAccounts']||(_0x597764[_0x4bcb('0x5e')]&&_0x597764[_0x4bcb('0x5e')][0x6]?_0x597764['attrs'][0x6][_0x4bcb('0x5f')]:undefined)||''},{'name':_0x4bcb('0x6e'),'value':_0x597764[_0x4bcb('0x6e')]||(_0x597764['attrs']&&_0x597764['attrs'][0x7]?_0x597764[_0x4bcb('0x5e')][0x7][_0x4bcb('0x5f')]:undefined)||''},{'name':_0x4bcb('0x6f'),'value':_0x597764['attrOpenchannelAccounts']||(_0x597764['attrs']&&_0x597764[_0x4bcb('0x5e')][0x8]?_0x597764[_0x4bcb('0x5e')][0x8][_0x4bcb('0x5f')]:undefined)||''},{'name':_0x4bcb('0x70'),'value':_0x597764[_0x4bcb('0x70')]||(_0x597764[_0x4bcb('0x5e')]&&_0x597764[_0x4bcb('0x5e')][0x9]?_0x597764[_0x4bcb('0x5e')][0x9][_0x4bcb('0x5f')]:undefined)||''},{'name':_0x4bcb('0x71'),'value':_0x597764[_0x4bcb('0x71')]||(_0x597764[_0x4bcb('0x5e')]&&_0x597764[_0x4bcb('0x5e')][0xa]?_0x597764[_0x4bcb('0x5e')][0xa][_0x4bcb('0x5f')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x597764['reportType']||(_0x597764[_0x4bcb('0x5e')]&&_0x597764[_0x4bcb('0x5e')][0x0]?_0x597764[_0x4bcb('0x5e')][0x0]['type']:undefined)||null,'value':_0x597764[_0x4bcb('0x77')]||(_0x597764[_0x4bcb('0x5e')]&&_0x597764[_0x4bcb('0x5e')][0x0]?_0x597764[_0x4bcb('0x5e')][0x0][_0x4bcb('0x5f')]:undefined)||null},{'name':_0x4bcb('0x78'),'value':_0x597764[_0x4bcb('0x78')]||(_0x597764[_0x4bcb('0x5e')]&&_0x597764[_0x4bcb('0x5e')][0x1]?_0x597764[_0x4bcb('0x5e')][0x1][_0x4bcb('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x5b4d1a){logger[_0x4bcb('0x2d')](_0x4bcb('0x79'),JSON[_0x4bcb('0x7a')](_0x5b4d1a));return[];}}exports[_0x4bcb('0x7b')]=function(_0x1f7a89,_0x412ef0,_0x42cd48){if(_0x1f7a89[_0x4bcb('0x4f')]['id']){delete _0x1f7a89[_0x4bcb('0x4f')]['id'];}return db[_0x4bcb('0x32')][_0x4bcb('0x4d')]({'where':{'id':_0x1f7a89['params']['id']}})[_0x4bcb('0x27')](handleEntityNotFound(_0x412ef0,null))[_0x4bcb('0x27')](function(_0x285cd3){if(_0x285cd3){_0x1f7a89['body'][_0x4bcb('0x7c')]=_0x285cd3['id'];_0x1f7a89[_0x4bcb('0x4f')]['attrs']=widgetAttributes(_0x1f7a89[_0x4bcb('0x4f')]);return db['DashboardItem'][_0x4bcb('0x4e')](_0x1f7a89[_0x4bcb('0x4f')]);}})['then'](respondWithResult(_0x412ef0,null))[_0x4bcb('0x56')](handleError(_0x412ef0,null));};exports[_0x4bcb('0x7d')]=function(_0x3bf233,_0x338181,_0x4954df){var _0x491587={};var _0x4f88bd={};var _0x39a619;var _0x5aba9e;return db[_0x4bcb('0x32')][_0x4bcb('0x7e')]({'where':{'id':_0x3bf233[_0x4bcb('0x7f')]['id']}})[_0x4bcb('0x27')](handleEntityNotFound(_0x338181,null))[_0x4bcb('0x27')](function(_0x1a035a){if(_0x1a035a){_0x39a619=_0x1a035a;_0x4f88bd[_0x4bcb('0x37')]=_[_0x4bcb('0x3a')](db['DashboardItem'][_0x4bcb('0x33')]);_0x4f88bd[_0x4bcb('0x39')]=_[_0x4bcb('0x3a')](_0x3bf233[_0x4bcb('0x39')]);_0x4f88bd[_0x4bcb('0x4c')]=_[_0x4bcb('0x3b')](_0x4f88bd[_0x4bcb('0x37')],_0x4f88bd['query']);_0x491587[_0x4bcb('0x3c')]=_[_0x4bcb('0x3b')](_0x4f88bd[_0x4bcb('0x37')],qs[_0x4bcb('0x3d')](_0x3bf233[_0x4bcb('0x39')][_0x4bcb('0x3d')]));_0x491587[_0x4bcb('0x3c')]=_0x491587['attributes'][_0x4bcb('0x3e')]?_0x491587[_0x4bcb('0x3c')]:_0x4f88bd[_0x4bcb('0x37')];_0x491587['order']=qs[_0x4bcb('0x42')](_0x3bf233[_0x4bcb('0x39')]['sort']);_0x491587[_0x4bcb('0x43')]=qs['filters'](_['pick'](_0x3bf233[_0x4bcb('0x39')],_0x4f88bd[_0x4bcb('0x4c')]));if(_0x3bf233[_0x4bcb('0x39')][_0x4bcb('0x45')]){_0x491587[_0x4bcb('0x43')]=_[_0x4bcb('0x46')](_0x491587[_0x4bcb('0x43')],{'$or':_['map'](_0x491587[_0x4bcb('0x3c')],function(_0x4f7fd7){var _0x4c70ca={};_0x4c70ca[_0x4f7fd7]={'$like':'%'+_0x3bf233[_0x4bcb('0x39')][_0x4bcb('0x45')]+'%'};return _0x4c70ca;})});}_0x491587=_[_0x4bcb('0x46')]({},_0x491587,_0x3bf233[_0x4bcb('0x48')]);return _0x39a619[_0x4bcb('0x7d')](_0x491587);}})[_0x4bcb('0x27')](function(_0x37e407){if(_0x37e407){_0x5aba9e=_0x37e407['length'];if(!_0x3bf233['query'][_0x4bcb('0x3f')](_0x4bcb('0x40'))){_0x491587[_0x4bcb('0x1f')]=qs['limit'](_0x3bf233[_0x4bcb('0x39')][_0x4bcb('0x1f')]);_0x491587[_0x4bcb('0x1e')]=qs[_0x4bcb('0x1e')](_0x3bf233[_0x4bcb('0x39')][_0x4bcb('0x1e')]);}return _0x39a619[_0x4bcb('0x7d')](_0x491587);}})['then'](function(_0x4e09ed){if(_0x4e09ed){return _0x4e09ed?{'count':_0x5aba9e,'rows':_0x4e09ed}:null;}})['then'](respondWithResult(_0x338181,null))[_0x4bcb('0x56')](handleError(_0x338181,null));}; \ No newline at end of file +var _0x2d9a=['voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardItem','getItems','hasOwnProperty','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboard.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Dashboard','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','include','omit','createdAt','updatedAt','update','iframe','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel'];(function(_0x485a78,_0x2774ec){var _0x363256=function(_0x2bca55){while(--_0x2bca55){_0x485a78['push'](_0x485a78['shift']());}};_0x363256(++_0x2774ec);}(_0x2d9a,0x197));var _0xa2d9=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x2d9a[_0x17406a];return _0x1501ff;};'use strict';var emlformat=require(_0xa2d9('0x0'));var rimraf=require(_0xa2d9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa2d9('0x2'));var rp=require('request-promise');var moment=require(_0xa2d9('0x3'));var BPromise=require(_0xa2d9('0x4'));var Mustache=require(_0xa2d9('0x5'));var util=require(_0xa2d9('0x6'));var path=require('path');var sox=require(_0xa2d9('0x7'));var csv=require(_0xa2d9('0x8'));var ejs=require(_0xa2d9('0x9'));var fs=require('fs');var fs_extra=require(_0xa2d9('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa2d9('0xb'));var jsforce=require(_0xa2d9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa2d9('0x8'));var querystring=require(_0xa2d9('0xd'));var Papa=require(_0xa2d9('0xe'));var Redis=require(_0xa2d9('0xf'));var authService=require(_0xa2d9('0x10'));var qs=require(_0xa2d9('0x11'));var as=require(_0xa2d9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2d9('0x13'))(_0xa2d9('0x14'));var utils=require('../../config/utils');var config=require(_0xa2d9('0x15'));var licenseUtil=require(_0xa2d9('0x16'));var db=require(_0xa2d9('0x17'))['db'];config[_0xa2d9('0x18')]=_[_0xa2d9('0x19')](config[_0xa2d9('0x18')],{'host':_0xa2d9('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa2d9('0x18')]));require(_0xa2d9('0x1b'))[_0xa2d9('0x1c')](socket);function respondWithStatusCode(_0x253079,_0x3f1195){_0x3f1195=_0x3f1195||0xcc;return function(_0x3cce04){if(_0x3cce04){return _0x253079[_0xa2d9('0x1d')](_0x3f1195);}return _0x253079[_0xa2d9('0x1e')](_0x3f1195)[_0xa2d9('0x1f')]();};}function respondWithResult(_0x15d1b1,_0x20a5b){_0x20a5b=_0x20a5b||0xc8;return function(_0x456c85){if(_0x456c85){return _0x15d1b1[_0xa2d9('0x1e')](_0x20a5b)[_0xa2d9('0x20')](_0x456c85);}};}function respondWithFilteredResult(_0x2a0435,_0x2cf216){return function(_0x470ccb){if(_0x470ccb){var _0x2de2dc=typeof _0x2cf216[_0xa2d9('0x21')]==='undefined'&&typeof _0x2cf216[_0xa2d9('0x22')]===_0xa2d9('0x23');var _0x5efe25=_0x470ccb[_0xa2d9('0x24')];var _0xbdee07=_0x2de2dc?0x0:_0x2cf216['offset'];var _0x330131=_0x2de2dc?_0x470ccb[_0xa2d9('0x24')]:_0x2cf216[_0xa2d9('0x21')]+_0x2cf216[_0xa2d9('0x22')];var _0x52865f;if(_0x330131>=_0x5efe25){_0x330131=_0x5efe25;_0x52865f=0xc8;}else{_0x52865f=0xce;}_0x2a0435['status'](_0x52865f);return _0x2a0435[_0xa2d9('0x25')]('Content-Range',_0xbdee07+'-'+_0x330131+'/'+_0x5efe25)[_0xa2d9('0x20')](_0x470ccb);}return null;};}function patchUpdates(_0x3f9941){return function(_0x553e8c){try{jsonpatch['apply'](_0x553e8c,_0x3f9941,!![]);}catch(_0x56432f){return BPromise[_0xa2d9('0x26')](_0x56432f);}return _0x553e8c[_0xa2d9('0x27')]();};}function saveUpdates(_0x323deb,_0x21c217){return function(_0x49cd40){if(_0x49cd40){return _0x49cd40['update'](_0x323deb)[_0xa2d9('0x28')](function(_0x4bb5de){return _0x4bb5de;});}return null;};}function removeEntity(_0x3ea02f,_0x5e6d95){return function(_0x527564){if(_0x527564){return _0x527564[_0xa2d9('0x29')]()[_0xa2d9('0x28')](function(){var _0x194086=_0x527564[_0xa2d9('0x2a')]({'plain':!![]});var _0x4e1a6d=_0xa2d9('0x2b');return db[_0xa2d9('0x2c')]['destroy']({'where':{'type':_0x4e1a6d,'resourceId':_0x194086['id']}})['then'](function(){return _0x527564;});})[_0xa2d9('0x28')](function(){_0x3ea02f[_0xa2d9('0x1e')](0xcc)[_0xa2d9('0x1f')]();});}};}function handleEntityNotFound(_0x196150,_0x1c2f39){return function(_0x242f4a){if(!_0x242f4a){_0x196150['sendStatus'](0x194);}return _0x242f4a;};}function handleError(_0x5530df,_0xe2111d){_0xe2111d=_0xe2111d||0x1f4;return function(_0x2d4a04){logger[_0xa2d9('0x2d')](_0x2d4a04[_0xa2d9('0x2e')]);if(_0x2d4a04[_0xa2d9('0x2f')]){delete _0x2d4a04[_0xa2d9('0x2f')];}_0x5530df['status'](_0xe2111d)[_0xa2d9('0x30')](_0x2d4a04);};}exports[_0xa2d9('0x31')]=function(_0x1d5b60,_0x46f8cc){var _0x2d6ee2={},_0x1e7f2e={},_0x31dc9a={'count':0x0,'rows':[]};var _0x57e5dd=_[_0xa2d9('0x32')](db['Dashboard']['rawAttributes'],function(_0x1ed60f){return{'name':_0x1ed60f[_0xa2d9('0x33')],'type':_0x1ed60f[_0xa2d9('0x34')][_0xa2d9('0x35')]};});_0x1e7f2e[_0xa2d9('0x36')]=_[_0xa2d9('0x32')](_0x57e5dd,'name');_0x1e7f2e[_0xa2d9('0x37')]=_['keys'](_0x1d5b60[_0xa2d9('0x37')]);_0x1e7f2e['filters']=_[_0xa2d9('0x38')](_0x1e7f2e[_0xa2d9('0x36')],_0x1e7f2e[_0xa2d9('0x37')]);_0x2d6ee2[_0xa2d9('0x39')]=_[_0xa2d9('0x38')](_0x1e7f2e[_0xa2d9('0x36')],qs['fields'](_0x1d5b60[_0xa2d9('0x37')][_0xa2d9('0x3a')]));_0x2d6ee2[_0xa2d9('0x39')]=_0x2d6ee2[_0xa2d9('0x39')][_0xa2d9('0x3b')]?_0x2d6ee2[_0xa2d9('0x39')]:_0x1e7f2e[_0xa2d9('0x36')];if(!_0x1d5b60[_0xa2d9('0x37')]['hasOwnProperty'](_0xa2d9('0x3c'))){_0x2d6ee2[_0xa2d9('0x22')]=qs[_0xa2d9('0x22')](_0x1d5b60[_0xa2d9('0x37')]['limit']);_0x2d6ee2[_0xa2d9('0x21')]=qs[_0xa2d9('0x21')](_0x1d5b60['query'][_0xa2d9('0x21')]);}_0x2d6ee2[_0xa2d9('0x3d')]=qs[_0xa2d9('0x3e')](_0x1d5b60['query'][_0xa2d9('0x3e')]);_0x2d6ee2[_0xa2d9('0x3f')]=qs[_0xa2d9('0x40')](_[_0xa2d9('0x41')](_0x1d5b60[_0xa2d9('0x37')],_0x1e7f2e['filters']),_0x57e5dd);if(_0x1d5b60[_0xa2d9('0x37')][_0xa2d9('0x42')]){_0x2d6ee2['where']=_[_0xa2d9('0x43')](_0x2d6ee2[_0xa2d9('0x3f')],{'$or':_[_0xa2d9('0x32')](_0x57e5dd,function(_0x4dc375){if(_0x4dc375[_0xa2d9('0x34')]!==_0xa2d9('0x44')){var _0x4e67f7={};_0x4e67f7[_0x4dc375['name']]={'$like':'%'+_0x1d5b60[_0xa2d9('0x37')]['filter']+'%'};return _0x4e67f7;}})});}_0x2d6ee2=_['merge']({},_0x2d6ee2,_0x1d5b60[_0xa2d9('0x45')]);var _0x349712={'where':_0x2d6ee2[_0xa2d9('0x3f')]};return db[_0xa2d9('0x46')]['count'](_0x349712)[_0xa2d9('0x28')](function(_0x41e51e){_0x31dc9a[_0xa2d9('0x24')]=_0x41e51e;if(_0x1d5b60[_0xa2d9('0x37')]['includeAll']){_0x2d6ee2['include']=[{'all':!![]}];}return db[_0xa2d9('0x46')][_0xa2d9('0x47')](_0x2d6ee2);})['then'](function(_0x58982c){_0x31dc9a[_0xa2d9('0x48')]=_0x58982c;return _0x31dc9a;})[_0xa2d9('0x28')](respondWithFilteredResult(_0x46f8cc,_0x2d6ee2))[_0xa2d9('0x49')](handleError(_0x46f8cc,null));};exports[_0xa2d9('0x4a')]=function(_0xa42770,_0x18ccd8){var _0x42918f={'raw':![],'where':{'id':_0xa42770[_0xa2d9('0x4b')]['id']}},_0x1fea33={};_0x1fea33[_0xa2d9('0x36')]=_[_0xa2d9('0x4c')](db[_0xa2d9('0x46')][_0xa2d9('0x4d')]);_0x1fea33['query']=_[_0xa2d9('0x4c')](_0xa42770[_0xa2d9('0x37')]);_0x1fea33[_0xa2d9('0x40')]=_[_0xa2d9('0x38')](_0x1fea33['model'],_0x1fea33[_0xa2d9('0x37')]);_0x42918f['attributes']=_[_0xa2d9('0x38')](_0x1fea33[_0xa2d9('0x36')],qs[_0xa2d9('0x3a')](_0xa42770[_0xa2d9('0x37')][_0xa2d9('0x3a')]));_0x42918f[_0xa2d9('0x39')]=_0x42918f[_0xa2d9('0x39')]['length']?_0x42918f[_0xa2d9('0x39')]:_0x1fea33[_0xa2d9('0x36')];if(_0xa42770[_0xa2d9('0x37')][_0xa2d9('0x4e')]){_0x42918f['include']=[{'all':!![]}];}_0x42918f=_[_0xa2d9('0x43')]({},_0x42918f,_0xa42770['options']);return db[_0xa2d9('0x46')][_0xa2d9('0x4f')](_0x42918f)[_0xa2d9('0x28')](handleEntityNotFound(_0x18ccd8,null))[_0xa2d9('0x28')](respondWithResult(_0x18ccd8,null))['catch'](handleError(_0x18ccd8,null));};exports[_0xa2d9('0x50')]=function(_0x275f3f,_0x1762ab){return db['Dashboard'][_0xa2d9('0x50')](_0x275f3f[_0xa2d9('0x51')],{})[_0xa2d9('0x28')](function(_0x221f56){var _0x1f794f=_0x275f3f[_0xa2d9('0x52')]['get']({'plain':!![]});if(!_0x1f794f)throw new Error(_0xa2d9('0x53'));if(_0x1f794f[_0xa2d9('0x54')]===_0xa2d9('0x52')){var _0x198120=_0x221f56[_0xa2d9('0x2a')]({'plain':!![]});var _0x53a2ad=_0xa2d9('0x2b');return db['UserProfileSection'][_0xa2d9('0x4f')]({'where':{'name':_0x53a2ad,'userProfileId':_0x1f794f[_0xa2d9('0x55')]},'raw':!![]})['then'](function(_0x1fd5a1){if(_0x1fd5a1&&_0x1fd5a1[_0xa2d9('0x56')]===0x0){return db[_0xa2d9('0x2c')][_0xa2d9('0x50')]({'name':_0x198120[_0xa2d9('0x2f')],'resourceId':_0x198120['id'],'type':_0x1fd5a1[_0xa2d9('0x2f')],'sectionId':_0x1fd5a1['id']},{})[_0xa2d9('0x28')](function(){return _0x221f56;});}else{return _0x221f56;}})[_0xa2d9('0x49')](function(_0x38649a){logger[_0xa2d9('0x2d')](_0xa2d9('0x57'),_0x38649a);throw _0x38649a;});}return _0x221f56;})['then'](respondWithResult(_0x1762ab,0xc9))[_0xa2d9('0x49')](handleError(_0x1762ab,null));};exports['clone']=function(_0x741eb9,_0x2bc194){var _0x1ca182={'where':{'id':_0x741eb9[_0xa2d9('0x4b')]['id']}},_0x701345={};_0x701345[_0xa2d9('0x36')]=_[_0xa2d9('0x4c')](db[_0xa2d9('0x46')][_0xa2d9('0x4d')]);_0x1ca182['attributes']=_[_0xa2d9('0x38')](_0x701345[_0xa2d9('0x36')],qs['fields'](_0x741eb9[_0xa2d9('0x37')]['fields']));_0x1ca182[_0xa2d9('0x39')]=_0x1ca182[_0xa2d9('0x39')][_0xa2d9('0x3b')]?_0x1ca182['attributes']:_0x701345[_0xa2d9('0x36')];if(_0x741eb9['query'][_0xa2d9('0x4e')]){_0x1ca182[_0xa2d9('0x58')]=[{'all':!![]}];}_0x1ca182=_[_0xa2d9('0x43')]({},_0x1ca182,_0x741eb9[_0xa2d9('0x45')]);return db[_0xa2d9('0x46')][_0xa2d9('0x4f')](_0x1ca182)[_0xa2d9('0x28')](handleEntityNotFound(_0x2bc194,null))['then'](function(_0x164449){if(_0x164449){var _0x133b5a=_0x164449['get']({'plain':!![]});_0x133b5a=qs[_0xa2d9('0x59')](_0x133b5a,['id',_0xa2d9('0x5a'),_0xa2d9('0x5b')]);_0x741eb9['body']=_['omit'](_0x741eb9['body'],['id',_0xa2d9('0x5a'),_0xa2d9('0x5b')]);return db[_0xa2d9('0x46')][_0xa2d9('0x50')](_['merge'](_0x133b5a,_0x741eb9[_0xa2d9('0x51')]),{'include':_0x741eb9[_0xa2d9('0x37')][_0xa2d9('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x16c8ca){var _0x158556=_0x741eb9[_0xa2d9('0x52')][_0xa2d9('0x2a')]({'plain':!![]});if(!_0x158556)throw new Error(_0xa2d9('0x53'));if(_0x158556['role']===_0xa2d9('0x52')){var _0x2a403b=_0x16c8ca['get']({'plain':!![]});var _0x542e62=_0xa2d9('0x2b');return db['UserProfileSection'][_0xa2d9('0x4f')]({'where':{'name':_0x542e62,'userProfileId':_0x158556[_0xa2d9('0x55')]},'raw':!![]})[_0xa2d9('0x28')](function(_0x4cc4da){if(_0x4cc4da&&_0x4cc4da['autoAssociation']===0x0){return db[_0xa2d9('0x2c')]['create']({'name':_0x2a403b['name'],'resourceId':_0x2a403b['id'],'type':_0x4cc4da[_0xa2d9('0x2f')],'sectionId':_0x4cc4da['id']},{})[_0xa2d9('0x28')](function(){return _0x16c8ca;});}else{return _0x16c8ca;}})[_0xa2d9('0x49')](function(_0x427c8c){logger[_0xa2d9('0x2d')](_0xa2d9('0x57'),_0x427c8c);throw _0x427c8c;});}return _0x16c8ca;});}})[_0xa2d9('0x28')](respondWithResult(_0x2bc194,0xc9))[_0xa2d9('0x49')](handleError(_0x2bc194,null));};exports[_0xa2d9('0x5c')]=function(_0xe280f0,_0x3cda2e){if(_0xe280f0['body']['id']){delete _0xe280f0[_0xa2d9('0x51')]['id'];}return db[_0xa2d9('0x46')][_0xa2d9('0x4f')]({'where':{'id':_0xe280f0[_0xa2d9('0x4b')]['id']}})[_0xa2d9('0x28')](handleEntityNotFound(_0x3cda2e,null))[_0xa2d9('0x28')](saveUpdates(_0xe280f0['body'],null))[_0xa2d9('0x28')](respondWithResult(_0x3cda2e,null))[_0xa2d9('0x49')](handleError(_0x3cda2e,null));};exports[_0xa2d9('0x29')]=function(_0x8917a8,_0x1d0041){return db[_0xa2d9('0x46')][_0xa2d9('0x4f')]({'where':{'id':_0x8917a8[_0xa2d9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1d0041,null))[_0xa2d9('0x28')](removeEntity(_0x1d0041,null))[_0xa2d9('0x49')](handleError(_0x1d0041,null));};function widgetAttributes(_0x553061){try{switch(_0x553061['type']){case _0xa2d9('0x5d'):return[{'name':'attrUrl','value':_0x553061[_0xa2d9('0x5e')]||(_0x553061[_0xa2d9('0x5f')]&&_0x553061[_0xa2d9('0x5f')][0x0]?_0x553061[_0xa2d9('0x5f')][0x0][_0xa2d9('0x60')]:undefined)||'https://'}];case _0xa2d9('0x61'):return[{'name':_0xa2d9('0x62'),'value':_0x553061[_0xa2d9('0x62')]||(_0x553061[_0xa2d9('0x5f')]&&_0x553061[_0xa2d9('0x5f')][0x0]?_0x553061['attrs'][0x0][_0xa2d9('0x60')]:undefined)||''}];case'clock':return[{'name':_0xa2d9('0x63'),'value':_0x553061[_0xa2d9('0x63')]||(_0x553061[_0xa2d9('0x5f')]&&_0x553061[_0xa2d9('0x5f')][0x0]?_0x553061['attrs'][0x0]['value']:undefined)||_0xa2d9('0x64')},{'name':_0xa2d9('0x65'),'value':_0x553061['attrTimezone']||(_0x553061['attrs']&&_0x553061[_0xa2d9('0x5f')][0x1]?_0x553061[_0xa2d9('0x5f')][0x1]['value']:undefined)||_0xa2d9('0x66')},{'name':'attrFontSize','value':_0x553061[_0xa2d9('0x67')]||(_0x553061[_0xa2d9('0x5f')]&&_0x553061[_0xa2d9('0x5f')][0x2]?_0x553061[_0xa2d9('0x5f')][0x2]['value']:undefined)||0xc}];case _0xa2d9('0x68'):return[{'name':_0xa2d9('0x69'),'value':_0x553061[_0xa2d9('0x69')]||(_0x553061[_0xa2d9('0x5f')]&&_0x553061[_0xa2d9('0x5f')][0x0]?_0x553061['attrs'][0x0][_0xa2d9('0x60')]:undefined)||_0xa2d9('0x6a')},{'name':'attrVoiceQueues','value':_0x553061[_0xa2d9('0x6b')]||(_0x553061[_0xa2d9('0x5f')]&&_0x553061[_0xa2d9('0x5f')][0x1]?_0x553061['attrs'][0x1][_0xa2d9('0x60')]:undefined)||[]},{'name':'attrFontSize','value':_0x553061[_0xa2d9('0x67')]||(_0x553061['attrs']&&_0x553061[_0xa2d9('0x5f')][0x2]?_0x553061[_0xa2d9('0x5f')][0x2][_0xa2d9('0x60')]:undefined)||0x14},{'name':_0xa2d9('0x6c'),'value':_0x553061[_0xa2d9('0x6c')]||(_0x553061['attrs']&&_0x553061['attrs'][0x3]?_0x553061['attrs'][0x3]['value']:undefined)||_0xa2d9('0x6d')},{'name':_0xa2d9('0x6e'),'value':_0x553061[_0xa2d9('0x6e')]||(_0x553061['attrs']&&_0x553061[_0xa2d9('0x5f')][0x4]?_0x553061[_0xa2d9('0x5f')][0x4][_0xa2d9('0x60')]:undefined)||''},{'name':_0xa2d9('0x6f'),'value':_0x553061['attrFaxAccounts']||(_0x553061[_0xa2d9('0x5f')]&&_0x553061['attrs'][0x5]?_0x553061[_0xa2d9('0x5f')][0x5][_0xa2d9('0x60')]:undefined)||''},{'name':_0xa2d9('0x70'),'value':_0x553061[_0xa2d9('0x70')]||(_0x553061[_0xa2d9('0x5f')]&&_0x553061[_0xa2d9('0x5f')][0x6]?_0x553061['attrs'][0x6][_0xa2d9('0x60')]:undefined)||''},{'name':_0xa2d9('0x71'),'value':_0x553061['attrOpenchannelAccounts']||(_0x553061[_0xa2d9('0x5f')]&&_0x553061[_0xa2d9('0x5f')][0x7]?_0x553061[_0xa2d9('0x5f')][0x7][_0xa2d9('0x60')]:undefined)||''},{'name':_0xa2d9('0x72'),'value':_0x553061['attrWhatsappAccounts']||(_0x553061[_0xa2d9('0x5f')]&&_0x553061['attrs'][0x8]?_0x553061[_0xa2d9('0x5f')][0x8][_0xa2d9('0x60')]:undefined)||''},{'name':_0xa2d9('0x73'),'value':_0x553061[_0xa2d9('0x73')]||(_0x553061[_0xa2d9('0x5f')]&&_0x553061[_0xa2d9('0x5f')][0x9]?_0x553061['attrs'][0x9][_0xa2d9('0x60')]:undefined)||''}];case _0xa2d9('0x74'):case _0xa2d9('0x75'):return[{'name':'attrSerie1','value':_0x553061[_0xa2d9('0x76')]||(_0x553061['attrs']&&_0x553061[_0xa2d9('0x5f')][0x0]?_0x553061[_0xa2d9('0x5f')][0x0][_0xa2d9('0x60')]:undefined)||_0xa2d9('0x6a')},{'name':_0xa2d9('0x77'),'value':_0x553061[_0xa2d9('0x77')]||(_0x553061[_0xa2d9('0x5f')]&&_0x553061[_0xa2d9('0x5f')][0x1]?_0x553061['attrs'][0x1][_0xa2d9('0x60')]:undefined)||null},{'name':_0xa2d9('0x78'),'value':_0x553061['attrSerie3']||(_0x553061['attrs']&&_0x553061[_0xa2d9('0x5f')][0x2]?_0x553061['attrs'][0x2][_0xa2d9('0x60')]:undefined)||null},{'name':_0xa2d9('0x6b'),'value':_0x553061[_0xa2d9('0x6b')]||(_0x553061['attrs']&&_0x553061[_0xa2d9('0x5f')][0x3]?_0x553061[_0xa2d9('0x5f')][0x3]['value']:undefined)||[]},{'name':_0xa2d9('0x6c'),'value':_0x553061[_0xa2d9('0x6c')]||(_0x553061['attrs']&&_0x553061['attrs'][0x4]?_0x553061[_0xa2d9('0x5f')][0x4][_0xa2d9('0x60')]:undefined)||_0xa2d9('0x6d')},{'name':_0xa2d9('0x6e'),'value':_0x553061[_0xa2d9('0x6e')]||(_0x553061['attrs']&&_0x553061[_0xa2d9('0x5f')][0x5]?_0x553061[_0xa2d9('0x5f')][0x5][_0xa2d9('0x60')]:undefined)||''},{'name':_0xa2d9('0x6f'),'value':_0x553061[_0xa2d9('0x6f')]||(_0x553061[_0xa2d9('0x5f')]&&_0x553061['attrs'][0x6]?_0x553061['attrs'][0x6][_0xa2d9('0x60')]:undefined)||''},{'name':_0xa2d9('0x70'),'value':_0x553061[_0xa2d9('0x70')]||(_0x553061['attrs']&&_0x553061['attrs'][0x7]?_0x553061['attrs'][0x7][_0xa2d9('0x60')]:undefined)||''},{'name':_0xa2d9('0x71'),'value':_0x553061['attrOpenchannelAccounts']||(_0x553061[_0xa2d9('0x5f')]&&_0x553061[_0xa2d9('0x5f')][0x8]?_0x553061[_0xa2d9('0x5f')][0x8]['value']:undefined)||''},{'name':_0xa2d9('0x72'),'value':_0x553061[_0xa2d9('0x72')]||(_0x553061[_0xa2d9('0x5f')]&&_0x553061[_0xa2d9('0x5f')][0x9]?_0x553061[_0xa2d9('0x5f')][0x9][_0xa2d9('0x60')]:undefined)||''},{'name':_0xa2d9('0x73'),'value':_0x553061[_0xa2d9('0x73')]||(_0x553061[_0xa2d9('0x5f')]&&_0x553061['attrs'][0xa]?_0x553061[_0xa2d9('0x5f')][0xa][_0xa2d9('0x60')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x553061[_0xa2d9('0x79')]||(_0x553061[_0xa2d9('0x5f')]&&_0x553061[_0xa2d9('0x5f')][0x0]?_0x553061[_0xa2d9('0x5f')][0x0][_0xa2d9('0x34')]:undefined)||null,'value':_0x553061[_0xa2d9('0x7a')]||(_0x553061['attrs']&&_0x553061['attrs'][0x0]?_0x553061['attrs'][0x0][_0xa2d9('0x60')]:undefined)||null},{'name':_0xa2d9('0x7b'),'value':_0x553061[_0xa2d9('0x7b')]||(_0x553061[_0xa2d9('0x5f')]&&_0x553061[_0xa2d9('0x5f')][0x1]?_0x553061[_0xa2d9('0x5f')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x34180e){logger[_0xa2d9('0x2d')](_0xa2d9('0x7c'),JSON['stringify'](_0x34180e));return[];}}exports[_0xa2d9('0x7d')]=function(_0x17bdcb,_0x2b2291,_0x37b689){if(_0x17bdcb['body']['id']){delete _0x17bdcb[_0xa2d9('0x51')]['id'];}return db[_0xa2d9('0x46')][_0xa2d9('0x4f')]({'where':{'id':_0x17bdcb['params']['id']}})[_0xa2d9('0x28')](handleEntityNotFound(_0x2b2291,null))[_0xa2d9('0x28')](function(_0x1807f5){if(_0x1807f5){_0x17bdcb[_0xa2d9('0x51')]['DashboardId']=_0x1807f5['id'];_0x17bdcb[_0xa2d9('0x51')]['attrs']=widgetAttributes(_0x17bdcb[_0xa2d9('0x51')]);return db[_0xa2d9('0x7e')][_0xa2d9('0x50')](_0x17bdcb[_0xa2d9('0x51')]);}})['then'](respondWithResult(_0x2b2291,null))[_0xa2d9('0x49')](handleError(_0x2b2291,null));};exports[_0xa2d9('0x7f')]=function(_0x101f1a,_0x5cf3b4,_0x2d1fde){var _0x6c1a54={};var _0x328e58={};var _0x1db121;var _0x172820;return db['Dashboard']['findOne']({'where':{'id':_0x101f1a[_0xa2d9('0x4b')]['id']}})[_0xa2d9('0x28')](handleEntityNotFound(_0x5cf3b4,null))[_0xa2d9('0x28')](function(_0x5ab059){if(_0x5ab059){_0x1db121=_0x5ab059;_0x328e58['model']=_['keys'](db[_0xa2d9('0x7e')][_0xa2d9('0x4d')]);_0x328e58[_0xa2d9('0x37')]=_[_0xa2d9('0x4c')](_0x101f1a[_0xa2d9('0x37')]);_0x328e58[_0xa2d9('0x40')]=_[_0xa2d9('0x38')](_0x328e58[_0xa2d9('0x36')],_0x328e58['query']);_0x6c1a54[_0xa2d9('0x39')]=_['intersection'](_0x328e58[_0xa2d9('0x36')],qs[_0xa2d9('0x3a')](_0x101f1a[_0xa2d9('0x37')][_0xa2d9('0x3a')]));_0x6c1a54[_0xa2d9('0x39')]=_0x6c1a54[_0xa2d9('0x39')][_0xa2d9('0x3b')]?_0x6c1a54['attributes']:_0x328e58[_0xa2d9('0x36')];_0x6c1a54[_0xa2d9('0x3d')]=qs['sort'](_0x101f1a['query'][_0xa2d9('0x3e')]);_0x6c1a54[_0xa2d9('0x3f')]=qs['filters'](_[_0xa2d9('0x41')](_0x101f1a['query'],_0x328e58['filters']));if(_0x101f1a[_0xa2d9('0x37')][_0xa2d9('0x42')]){_0x6c1a54[_0xa2d9('0x3f')]=_[_0xa2d9('0x43')](_0x6c1a54[_0xa2d9('0x3f')],{'$or':_[_0xa2d9('0x32')](_0x6c1a54[_0xa2d9('0x39')],function(_0x40b3de){var _0x19f9fd={};_0x19f9fd[_0x40b3de]={'$like':'%'+_0x101f1a[_0xa2d9('0x37')][_0xa2d9('0x42')]+'%'};return _0x19f9fd;})});}_0x6c1a54=_[_0xa2d9('0x43')]({},_0x6c1a54,_0x101f1a['options']);return _0x1db121[_0xa2d9('0x7f')](_0x6c1a54);}})['then'](function(_0x51be99){if(_0x51be99){_0x172820=_0x51be99['length'];if(!_0x101f1a[_0xa2d9('0x37')][_0xa2d9('0x80')]('nolimit')){_0x6c1a54['limit']=qs[_0xa2d9('0x22')](_0x101f1a[_0xa2d9('0x37')]['limit']);_0x6c1a54['offset']=qs['offset'](_0x101f1a[_0xa2d9('0x37')]['offset']);}return _0x1db121[_0xa2d9('0x7f')](_0x6c1a54);}})[_0xa2d9('0x28')](function(_0x33940c){if(_0x33940c){return _0x33940c?{'count':_0x172820,'rows':_0x33940c}:null;}})[_0xa2d9('0x28')](respondWithResult(_0x5cf3b4,null))[_0xa2d9('0x49')](handleError(_0x5cf3b4,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index b6d74cb..45f6112 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 _0xeda7=['../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xeda7,0x196));var _0x7eda=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xeda7[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x7eda('0x0'));var Dashboard=require(_0x7eda('0x1'))['db'][_0x7eda('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x7eda('0x3')](0x0);var events={'afterCreate':_0x7eda('0x4'),'afterUpdate':_0x7eda('0x5'),'afterDestroy':_0x7eda('0x6')};function emitEvent(_0x2b1d21){return function(_0x324a25,_0x36a9f1,_0x15856b){DashboardEvents[_0x7eda('0x7')](_0x2b1d21+':'+_0x324a25['id'],_0x324a25);DashboardEvents[_0x7eda('0x7')](_0x2b1d21,_0x324a25);_0x15856b(null);};}for(var e in events){if(events[_0x7eda('0x8')](e)){var event=events[e];Dashboard[_0x7eda('0x9')](e,emitEvent(event));}}module[_0x7eda('0xa')]=DashboardEvents; \ No newline at end of file +var _0x85a7=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard'];(function(_0x372aad,_0x849481){var _0xef2e8e=function(_0x568ef6){while(--_0x568ef6){_0x372aad['push'](_0x372aad['shift']());}};_0xef2e8e(++_0x849481);}(_0x85a7,0xa7));var _0x785a=function(_0x32069f,_0x397585){_0x32069f=_0x32069f-0x0;var _0x5506c3=_0x85a7[_0x32069f];return _0x5506c3;};'use strict';var EventEmitter=require(_0x785a('0x0'));var Dashboard=require(_0x785a('0x1'))['db'][_0x785a('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x785a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x785a('0x4'),'afterDestroy':_0x785a('0x5')};function emitEvent(_0x57008d){return function(_0x424393,_0x6f673c,_0x189d71){DashboardEvents['emit'](_0x57008d+':'+_0x424393['id'],_0x424393);DashboardEvents[_0x785a('0x6')](_0x57008d,_0x424393);_0x189d71(null);};}for(var e in events){if(events[_0x785a('0x7')](e)){var event=events[e];Dashboard[_0x785a('0x8')](e,emitEvent(event));}}module[_0x785a('0x9')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 49300ab..635da06 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 _0xa8d9=['moment','bluebird','request-promise','path','../../config/environment','./dashboard.attributes','define','dashboards','lodash','util','../../config/logger','api'];(function(_0x70c97a,_0xd4d263){var _0x5cb362=function(_0x163f30){while(--_0x163f30){_0x70c97a['push'](_0x70c97a['shift']());}};_0x5cb362(++_0xd4d263);}(_0xa8d9,0x1ac));var _0x9a8d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa8d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9a8d('0x0'));var util=require(_0x9a8d('0x1'));var logger=require(_0x9a8d('0x2'))(_0x9a8d('0x3'));var moment=require(_0x9a8d('0x4'));var BPromise=require(_0x9a8d('0x5'));var rp=require(_0x9a8d('0x6'));var fs=require('fs');var path=require(_0x9a8d('0x7'));var rimraf=require('rimraf');var config=require(_0x9a8d('0x8'));var attributes=require(_0x9a8d('0x9'));module['exports']=function(_0x1e3506,_0x20d1fc){return _0x1e3506[_0x9a8d('0xa')]('Dashboard',attributes,{'tableName':_0x9a8d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7211=['dashboards','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x7211,0x123));var _0x1721=function(_0x415372,_0x5bb1d2){_0x415372=_0x415372-0x0;var _0x4cc1cd=_0x7211[_0x415372];return _0x4cc1cd;};'use strict';var _=require('lodash');var util=require(_0x1721('0x0'));var logger=require(_0x1721('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1721('0x2'));var fs=require('fs');var path=require(_0x1721('0x3'));var rimraf=require(_0x1721('0x4'));var config=require(_0x1721('0x5'));var attributes=require(_0x1721('0x6'));module[_0x1721('0x7')]=function(_0x5555e1,_0x25d5d9){return _0x5555e1[_0x1721('0x8')]('Dashboard',attributes,{'tableName':_0x1721('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 936555f..f51e160 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 _0xb045=['./dashboard.socket','register','request','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','Dashboard,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x264e33,_0x38d36e){var _0x555826=function(_0x42a2a5){while(--_0x42a2a5){_0x264e33['push'](_0x264e33['shift']());}};_0x555826(++_0x38d36e);}(_0xb045,0x1d8));var _0x5b04=function(_0x574d9b,_0x2063da){_0x574d9b=_0x574d9b-0x0;var _0x31d2a5=_0xb045[_0x574d9b];return _0x31d2a5;};'use strict';var _=require(_0x5b04('0x0'));var util=require(_0x5b04('0x1'));var moment=require(_0x5b04('0x2'));var BPromise=require(_0x5b04('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b04('0x4'))['db'];var utils=require(_0x5b04('0x5'));var logger=require(_0x5b04('0x6'))(_0x5b04('0x7'));var config=require(_0x5b04('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5b04('0x9')][_0x5b04('0xa')]({'port':0x232a});config[_0x5b04('0xb')]=_[_0x5b04('0xc')](config[_0x5b04('0xb')],{'host':_0x5b04('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5b04('0xb')]));require(_0x5b04('0xe'))[_0x5b04('0xf')](socket);function respondWithRpcPromise(_0x40b909,_0xa2745,_0x2136c1){return new BPromise(function(_0x393a30,_0x33ea3e){return client[_0x5b04('0x10')](_0x40b909,_0x2136c1)['then'](function(_0x244ef7){logger['info']('Dashboard,\x20%s,\x20%s',_0xa2745,_0x5b04('0x11'));logger[_0x5b04('0x12')](_0x5b04('0x13'),_0xa2745,'request\x20sent',JSON[_0x5b04('0x14')](_0x244ef7));if(_0x244ef7[_0x5b04('0x15')]){if(_0x244ef7[_0x5b04('0x15')]['code']===0x1f4){logger[_0x5b04('0x15')](_0x5b04('0x16'),_0xa2745,_0x244ef7[_0x5b04('0x15')][_0x5b04('0x17')]);return _0x33ea3e(_0x244ef7[_0x5b04('0x15')][_0x5b04('0x17')]);}logger['error'](_0x5b04('0x16'),_0xa2745,_0x244ef7[_0x5b04('0x15')]['message']);return _0x393a30(_0x244ef7[_0x5b04('0x15')][_0x5b04('0x17')]);}else{logger[_0x5b04('0x18')]('Dashboard,\x20%s,\x20%s',_0xa2745,_0x5b04('0x11'));_0x393a30(_0x244ef7[_0x5b04('0x19')]['message']);}})[_0x5b04('0x1a')](function(_0x465efd){logger[_0x5b04('0x15')](_0x5b04('0x16'),_0xa2745,_0x465efd);_0x33ea3e(_0x465efd);});});} \ No newline at end of file +var _0xaf6f=['register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboard.socket'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xaf6f,0x193));var _0xfaf6=function(_0x4ca58d,_0x54c7b9){_0x4ca58d=_0x4ca58d-0x0;var _0x1f3e49=_0xaf6f[_0x4ca58d];return _0x1f3e49;};'use strict';var _=require(_0xfaf6('0x0'));var util=require(_0xfaf6('0x1'));var moment=require(_0xfaf6('0x2'));var BPromise=require(_0xfaf6('0x3'));var rs=require(_0xfaf6('0x4'));var fs=require('fs');var Redis=require(_0xfaf6('0x5'));var db=require(_0xfaf6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfaf6('0x7'))(_0xfaf6('0x8'));var config=require(_0xfaf6('0x9'));var jayson=require(_0xfaf6('0xa'));var client=jayson[_0xfaf6('0xb')][_0xfaf6('0xc')]({'port':0x232a});config[_0xfaf6('0xd')]=_[_0xfaf6('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfaf6('0xf'))(new Redis(config[_0xfaf6('0xd')]));require(_0xfaf6('0x10'))[_0xfaf6('0x11')](socket);function respondWithRpcPromise(_0x228ead,_0x4cc521,_0x5e65cc){return new BPromise(function(_0x1c929e,_0x57d353){return client[_0xfaf6('0x12')](_0x228ead,_0x5e65cc)[_0xfaf6('0x13')](function(_0x40e982){logger[_0xfaf6('0x14')](_0xfaf6('0x15'),_0x4cc521,_0xfaf6('0x16'));logger[_0xfaf6('0x17')](_0xfaf6('0x18'),_0x4cc521,_0xfaf6('0x16'),JSON[_0xfaf6('0x19')](_0x40e982));if(_0x40e982[_0xfaf6('0x1a')]){if(_0x40e982[_0xfaf6('0x1a')][_0xfaf6('0x1b')]===0x1f4){logger[_0xfaf6('0x1a')](_0xfaf6('0x15'),_0x4cc521,_0x40e982[_0xfaf6('0x1a')][_0xfaf6('0x1c')]);return _0x57d353(_0x40e982[_0xfaf6('0x1a')]['message']);}logger[_0xfaf6('0x1a')](_0xfaf6('0x15'),_0x4cc521,_0x40e982[_0xfaf6('0x1a')][_0xfaf6('0x1c')]);return _0x1c929e(_0x40e982[_0xfaf6('0x1a')][_0xfaf6('0x1c')]);}else{logger[_0xfaf6('0x14')](_0xfaf6('0x15'),_0x4cc521,_0xfaf6('0x16'));_0x1c929e(_0x40e982['result'][_0xfaf6('0x1c')]);}})[_0xfaf6('0x1d')](function(_0x28e471){logger[_0xfaf6('0x1a')](_0xfaf6('0x15'),_0x4cc521,_0x28e471);_0x57d353(_0x28e471);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 5de3d30..0073600 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 _0x6b51=['emit','length','dashboard:','save','remove'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x6b51,0xa8));var _0x16b5=function(_0x9a0834,_0x284c98){_0x9a0834=_0x9a0834-0x0;var _0x51912e=_0x6b51[_0x9a0834];return _0x51912e;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x16b5('0x0'),_0x16b5('0x1'),'update'];function createListener(_0x10337f,_0x207f01){return function(_0xf4a867){_0x207f01[_0x16b5('0x2')](_0x10337f,_0xf4a867);};}function removeListener(_0x1df3ab,_0x358683){return function(){DashboardEvents['removeListener'](_0x1df3ab,_0x358683);};}exports['register']=function(_0x4237ec){for(var _0x3980bd=0x0,_0x481d53=events[_0x16b5('0x3')];_0x3980bd<_0x481d53;_0x3980bd++){var _0x4e4057=events[_0x3980bd];var _0x3fc67b=createListener(_0x16b5('0x4')+_0x4e4057,_0x4237ec);DashboardEvents['on'](_0x4e4057,_0x3fc67b);}}; \ No newline at end of file +var _0xeba1=['length','./dashboard.events','save','remove','emit','removeListener','register'];(function(_0x595adf,_0x4b1317){var _0x5dca45=function(_0x4a65c8){while(--_0x4a65c8){_0x595adf['push'](_0x595adf['shift']());}};_0x5dca45(++_0x4b1317);}(_0xeba1,0xd3));var _0x1eba=function(_0x5525c7,_0xe772c5){_0x5525c7=_0x5525c7-0x0;var _0x14eb5b=_0xeba1[_0x5525c7];return _0x14eb5b;};'use strict';var DashboardEvents=require(_0x1eba('0x0'));var events=[_0x1eba('0x1'),_0x1eba('0x2'),'update'];function createListener(_0xbb8460,_0x154a1b){return function(_0x455226){_0x154a1b[_0x1eba('0x3')](_0xbb8460,_0x455226);};}function removeListener(_0x59d0ac,_0x9b80ed){return function(){DashboardEvents[_0x1eba('0x4')](_0x59d0ac,_0x9b80ed);};}exports[_0x1eba('0x5')]=function(_0x2dbc20){for(var _0x59eddf=0x0,_0x3b3fd4=events[_0x1eba('0x6')];_0x59eddf<_0x3b3fd4;_0x59eddf++){var _0x5daac9=events[_0x59eddf];var _0x2790a7=createListener('dashboard:'+_0x5daac9,_0x2dbc20);DashboardEvents['on'](_0x5daac9,_0x2790a7);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 0502cb6..f340e87 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 _0x2094=['/:id/items','isAuthenticated','create','post','/:id/clone','addItem','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','show'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x2094,0x1a3));var _0x4209=function(_0x3c80c6,_0x560b01){_0x3c80c6=_0x3c80c6-0x0;var _0x211ffc=_0x2094[_0x3c80c6];return _0x211ffc;};'use strict';var multer=require(_0x4209('0x0'));var util=require('util');var path=require(_0x4209('0x1'));var timeout=require(_0x4209('0x2'));var express=require(_0x4209('0x3'));var router=express[_0x4209('0x4')]();var fs_extra=require(_0x4209('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4209('0x6'));var config=require(_0x4209('0x7'));var controller=require(_0x4209('0x8'));router[_0x4209('0x9')]('/',auth['isAuthenticated'](),controller[_0x4209('0xa')]);router[_0x4209('0x9')](_0x4209('0xb'),auth['isAuthenticated'](),controller[_0x4209('0xc')]);router[_0x4209('0x9')](_0x4209('0xd'),auth[_0x4209('0xe')](),controller['getItems']);router['post']('/',auth[_0x4209('0xe')](),controller[_0x4209('0xf')]);router[_0x4209('0x10')](_0x4209('0x11'),auth[_0x4209('0xe')](),controller['clone']);router['post']('/:id/items',auth[_0x4209('0xe')](),controller[_0x4209('0x12')]);router[_0x4209('0x13')](_0x4209('0xb'),auth[_0x4209('0xe')](),controller[_0x4209('0x14')]);router[_0x4209('0x15')](_0x4209('0xb'),auth[_0x4209('0xe')](),controller[_0x4209('0x16')]);module[_0x4209('0x17')]=router; \ No newline at end of file +var _0xdab4=['isAuthenticated','/:id/items','getItems','post','create','/:id/clone','clone','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id'];(function(_0x27a5bb,_0x3f4cfb){var _0x2e17ea=function(_0x22912d){while(--_0x22912d){_0x27a5bb['push'](_0x27a5bb['shift']());}};_0x2e17ea(++_0x3f4cfb);}(_0xdab4,0x1d3));var _0x4dab=function(_0x31a322,_0x8fd978){_0x31a322=_0x31a322-0x0;var _0x419acb=_0xdab4[_0x31a322];return _0x419acb;};'use strict';var multer=require(_0x4dab('0x0'));var util=require(_0x4dab('0x1'));var path=require('path');var timeout=require(_0x4dab('0x2'));var express=require(_0x4dab('0x3'));var router=express[_0x4dab('0x4')]();var fs_extra=require(_0x4dab('0x5'));var auth=require(_0x4dab('0x6'));var interaction=require(_0x4dab('0x7'));var config=require(_0x4dab('0x8'));var controller=require(_0x4dab('0x9'));router[_0x4dab('0xa')]('/',auth['isAuthenticated'](),controller[_0x4dab('0xb')]);router['get'](_0x4dab('0xc'),auth[_0x4dab('0xd')](),controller['show']);router[_0x4dab('0xa')](_0x4dab('0xe'),auth[_0x4dab('0xd')](),controller[_0x4dab('0xf')]);router[_0x4dab('0x10')]('/',auth['isAuthenticated'](),controller[_0x4dab('0x11')]);router[_0x4dab('0x10')](_0x4dab('0x12'),auth[_0x4dab('0xd')](),controller[_0x4dab('0x13')]);router[_0x4dab('0x10')]('/:id/items',auth['isAuthenticated'](),controller['addItem']);router[_0x4dab('0x14')](_0x4dab('0xc'),auth[_0x4dab('0xd')](),controller[_0x4dab('0x15')]);router[_0x4dab('0x16')](_0x4dab('0xc'),auth[_0x4dab('0xd')](),controller['destroy']);module[_0x4dab('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index d196730..0978c1e 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 _0x2bd8=['TEXT','long','parse','attrs','stringify','setDataValue','INTEGER','sequelize','lodash','exports','STRING'];(function(_0x5ba629,_0x4d6405){var _0x5d3fdf=function(_0x1e9232){while(--_0x1e9232){_0x5ba629['push'](_0x5ba629['shift']());}};_0x5d3fdf(++_0x4d6405);}(_0x2bd8,0x130));var _0x82bd=function(_0x311a64,_0x247efa){_0x311a64=_0x311a64-0x0;var _0x5f9f4e=_0x2bd8[_0x311a64];return _0x5f9f4e;};'use strict';var Sequelize=require(_0x82bd('0x0'));var squel=require('squel');var _=require(_0x82bd('0x1'));module[_0x82bd('0x2')]={'title':{'type':Sequelize[_0x82bd('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x82bd('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x82bd('0x4')](_0x82bd('0x5')),'get':function(){try{return JSON[_0x82bd('0x6')](this['getDataValue'](_0x82bd('0x7')));}catch(_0x2e1a98){return[];}},'set':function(_0x3bf810){try{this['setDataValue'](_0x82bd('0x7'),JSON[_0x82bd('0x8')](_0x3bf810));}catch(_0x226f60){this[_0x82bd('0x9')]('attrs',JSON[_0x82bd('0x8')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x82bd('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x82bd('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x82bd('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x5d58=['attrs','stringify','INTEGER','#2196f3','STRING','TEXT','parse','getDataValue','setDataValue'];(function(_0x3d4ddb,_0x1c9228){var _0x46ea55=function(_0x5aea0d){while(--_0x5aea0d){_0x3d4ddb['push'](_0x3d4ddb['shift']());}};_0x46ea55(++_0x1c9228);}(_0x5d58,0x187));var _0x85d5=function(_0x208313,_0x3c8fa6){_0x208313=_0x208313-0x0;var _0x12480c=_0x5d58[_0x208313];return _0x12480c;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require('lodash');module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x85d5('0x0')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x85d5('0x1')]('long'),'get':function(){try{return JSON[_0x85d5('0x2')](this[_0x85d5('0x3')]('attrs'));}catch(_0x1eb211){return[];}},'set':function(_0x2d457a){try{this[_0x85d5('0x4')](_0x85d5('0x5'),JSON['stringify'](_0x2d457a));}catch(_0x98c963){this[_0x85d5('0x4')]('attrs',JSON[_0x85d5('0x6')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x85d5('0x7')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x85d5('0x7')]},'col':{'type':Sequelize[_0x85d5('0x7')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x85d5('0x8'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x85d5('0x0')]},'titleFontSize':{'type':Sequelize[_0x85d5('0x7')],'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 a910e0d..2e7295a 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 _0xdc03=['attrWhatsappAccounts','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrChatWebsites','reportType','type','attrReport','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','name','show','params','model','DashboardItem','query','keys','filters','intersection','attributes','fields','merge','options','catch','find','iframe','attrUrl','attrs','value','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts'];(function(_0x364cba,_0x19c43b){var _0x1e6de2=function(_0x11731b){while(--_0x11731b){_0x364cba['push'](_0x364cba['shift']());}};_0x1e6de2(++_0x19c43b);}(_0xdc03,0x65));var _0x3dc0=function(_0x42fb09,_0x3478b4){_0x42fb09=_0x42fb09-0x0;var _0x48cf62=_0xdc03[_0x42fb09];return _0x48cf62;};'use strict';var emlformat=require(_0x3dc0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3dc0('0x1'));var jsonpatch=require(_0x3dc0('0x2'));var rp=require('request-promise');var moment=require(_0x3dc0('0x3'));var BPromise=require(_0x3dc0('0x4'));var Mustache=require(_0x3dc0('0x5'));var util=require(_0x3dc0('0x6'));var path=require(_0x3dc0('0x7'));var sox=require(_0x3dc0('0x8'));var csv=require('to-csv');var ejs=require(_0x3dc0('0x9'));var fs=require('fs');var fs_extra=require(_0x3dc0('0xa'));var _=require(_0x3dc0('0xb'));var squel=require('squel');var crypto=require(_0x3dc0('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3dc0('0xd'));var Papa=require(_0x3dc0('0xe'));var Redis=require(_0x3dc0('0xf'));var authService=require(_0x3dc0('0x10'));var qs=require(_0x3dc0('0x11'));var as=require(_0x3dc0('0x12'));var hardwareService=require(_0x3dc0('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x3dc0('0x14'));var config=require(_0x3dc0('0x15'));var licenseUtil=require(_0x3dc0('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3dc0('0x17')](config['redis'],{'host':_0x3dc0('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3dc0('0x19'))[_0x3dc0('0x1a')](socket);function respondWithStatusCode(_0x1d250c,_0x1a69c0){_0x1a69c0=_0x1a69c0||0xcc;return function(_0x2bed0d){if(_0x2bed0d){return _0x1d250c[_0x3dc0('0x1b')](_0x1a69c0);}return _0x1d250c[_0x3dc0('0x1c')](_0x1a69c0)[_0x3dc0('0x1d')]();};}function respondWithResult(_0x4e449a,_0x42fb1f){_0x42fb1f=_0x42fb1f||0xc8;return function(_0x3bcee6){if(_0x3bcee6){return _0x4e449a['status'](_0x42fb1f)[_0x3dc0('0x1e')](_0x3bcee6);}};}function respondWithFilteredResult(_0xd5b9f1,_0x4bd6b0){return function(_0x5d45ee){if(_0x5d45ee){var _0x42db3a=typeof _0x4bd6b0[_0x3dc0('0x1f')]===_0x3dc0('0x20')&&typeof _0x4bd6b0['limit']===_0x3dc0('0x20');var _0x3776f4=_0x5d45ee[_0x3dc0('0x21')];var _0xac9dc8=_0x42db3a?0x0:_0x4bd6b0[_0x3dc0('0x1f')];var _0x3efe80=_0x42db3a?_0x5d45ee[_0x3dc0('0x21')]:_0x4bd6b0[_0x3dc0('0x1f')]+_0x4bd6b0[_0x3dc0('0x22')];var _0xbef495;if(_0x3efe80>=_0x3776f4){_0x3efe80=_0x3776f4;_0xbef495=0xc8;}else{_0xbef495=0xce;}_0xd5b9f1['status'](_0xbef495);return _0xd5b9f1[_0x3dc0('0x23')](_0x3dc0('0x24'),_0xac9dc8+'-'+_0x3efe80+'/'+_0x3776f4)[_0x3dc0('0x1e')](_0x5d45ee);}return null;};}function patchUpdates(_0x5ee6b3){return function(_0x4f4e4b){try{jsonpatch[_0x3dc0('0x25')](_0x4f4e4b,_0x5ee6b3,!![]);}catch(_0x3843bb){return BPromise[_0x3dc0('0x26')](_0x3843bb);}return _0x4f4e4b[_0x3dc0('0x27')]();};}function saveUpdates(_0x503332,_0x252cda){return function(_0x5d67a5){if(_0x5d67a5){return _0x5d67a5['update'](_0x503332)[_0x3dc0('0x28')](function(_0x25b492){return _0x25b492;});}return null;};}function removeEntity(_0x3db379,_0x346d17){return function(_0x1dfdbc){if(_0x1dfdbc){return _0x1dfdbc['destroy']()['then'](function(){_0x3db379[_0x3dc0('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45a74e,_0x1ec992){return function(_0x4dcc24){if(!_0x4dcc24){_0x45a74e[_0x3dc0('0x1b')](0x194);}return _0x4dcc24;};}function handleError(_0x57fb09,_0x3348b6){_0x3348b6=_0x3348b6||0x1f4;return function(_0xf1f3e6){logger['error'](_0xf1f3e6['stack']);if(_0xf1f3e6[_0x3dc0('0x29')]){delete _0xf1f3e6['name'];}_0x57fb09['status'](_0x3348b6)['send'](_0xf1f3e6);};}exports[_0x3dc0('0x2a')]=function(_0x1a4905,_0x195560){var _0x528355={'raw':![],'where':{'id':_0x1a4905[_0x3dc0('0x2b')]['id']}},_0xde1690={};_0xde1690[_0x3dc0('0x2c')]=_['keys'](db[_0x3dc0('0x2d')]['rawAttributes']);_0xde1690[_0x3dc0('0x2e')]=_[_0x3dc0('0x2f')](_0x1a4905[_0x3dc0('0x2e')]);_0xde1690[_0x3dc0('0x30')]=_[_0x3dc0('0x31')](_0xde1690['model'],_0xde1690['query']);_0x528355[_0x3dc0('0x32')]=_[_0x3dc0('0x31')](_0xde1690[_0x3dc0('0x2c')],qs[_0x3dc0('0x33')](_0x1a4905[_0x3dc0('0x2e')][_0x3dc0('0x33')]));_0x528355['attributes']=_0x528355['attributes']['length']?_0x528355[_0x3dc0('0x32')]:_0xde1690[_0x3dc0('0x2c')];if(_0x1a4905[_0x3dc0('0x2e')]['includeAll']){_0x528355['include']=[{'all':!![]}];}_0x528355=_[_0x3dc0('0x34')]({},_0x528355,_0x1a4905[_0x3dc0('0x35')]);return db[_0x3dc0('0x2d')]['find'](_0x528355)[_0x3dc0('0x28')](handleEntityNotFound(_0x195560,null))[_0x3dc0('0x28')](respondWithResult(_0x195560,null))[_0x3dc0('0x36')](handleError(_0x195560,null));};exports['destroy']=function(_0x39ef49,_0x3c8e48){return db[_0x3dc0('0x2d')][_0x3dc0('0x37')]({'where':{'id':_0x39ef49[_0x3dc0('0x2b')]['id']}})[_0x3dc0('0x28')](handleEntityNotFound(_0x3c8e48,null))[_0x3dc0('0x28')](removeEntity(_0x3c8e48,null))['catch'](handleError(_0x3c8e48,null));};function widgetAttributes(_0x316604){try{switch(_0x316604['type']){case _0x3dc0('0x38'):return[{'name':_0x3dc0('0x39'),'value':_0x316604[_0x3dc0('0x39')]||(_0x316604[_0x3dc0('0x3a')]&&_0x316604[_0x3dc0('0x3a')][0x0]?_0x316604[_0x3dc0('0x3a')][0x0][_0x3dc0('0x3b')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x316604[_0x3dc0('0x3c')]||(_0x316604[_0x3dc0('0x3a')]&&_0x316604[_0x3dc0('0x3a')][0x0]?_0x316604['attrs'][0x0][_0x3dc0('0x3b')]:undefined)||''}];case'clock':return[{'name':_0x3dc0('0x3d'),'value':_0x316604[_0x3dc0('0x3d')]||(_0x316604[_0x3dc0('0x3a')]&&_0x316604['attrs'][0x0]?_0x316604[_0x3dc0('0x3a')][0x0][_0x3dc0('0x3b')]:undefined)||_0x3dc0('0x3e')},{'name':_0x3dc0('0x3f'),'value':_0x316604[_0x3dc0('0x3f')]||(_0x316604['attrs']&&_0x316604[_0x3dc0('0x3a')][0x1]?_0x316604[_0x3dc0('0x3a')][0x1][_0x3dc0('0x3b')]:undefined)||'0.00'},{'name':_0x3dc0('0x40'),'value':_0x316604['attrFontSize']||(_0x316604[_0x3dc0('0x3a')]&&_0x316604[_0x3dc0('0x3a')][0x2]?_0x316604[_0x3dc0('0x3a')][0x2][_0x3dc0('0x3b')]:undefined)||0xc}];case _0x3dc0('0x41'):return[{'name':_0x3dc0('0x42'),'value':_0x316604['attrMetric']||(_0x316604[_0x3dc0('0x3a')]&&_0x316604['attrs'][0x0]?_0x316604[_0x3dc0('0x3a')][0x0][_0x3dc0('0x3b')]:undefined)||_0x3dc0('0x43')},{'name':'attrVoiceQueues','value':_0x316604[_0x3dc0('0x44')]||(_0x316604[_0x3dc0('0x3a')]&&_0x316604[_0x3dc0('0x3a')][0x1]?_0x316604[_0x3dc0('0x3a')][0x1][_0x3dc0('0x3b')]:undefined)||[]},{'name':_0x3dc0('0x40'),'value':_0x316604[_0x3dc0('0x40')]||(_0x316604['attrs']&&_0x316604[_0x3dc0('0x3a')][0x2]?_0x316604[_0x3dc0('0x3a')][0x2][_0x3dc0('0x3b')]:undefined)||0x14},{'name':_0x3dc0('0x45'),'value':_0x316604[_0x3dc0('0x45')]||(_0x316604['attrs']&&_0x316604[_0x3dc0('0x3a')][0x3]?_0x316604[_0x3dc0('0x3a')][0x3][_0x3dc0('0x3b')]:undefined)||_0x3dc0('0x46')},{'name':'attrEmailAccounts','value':_0x316604[_0x3dc0('0x47')]||(_0x316604[_0x3dc0('0x3a')]&&_0x316604[_0x3dc0('0x3a')][0x4]?_0x316604[_0x3dc0('0x3a')][0x4][_0x3dc0('0x3b')]:undefined)||''},{'name':_0x3dc0('0x48'),'value':_0x316604[_0x3dc0('0x48')]||(_0x316604['attrs']&&_0x316604[_0x3dc0('0x3a')][0x5]?_0x316604['attrs'][0x5][_0x3dc0('0x3b')]:undefined)||''},{'name':_0x3dc0('0x49'),'value':_0x316604[_0x3dc0('0x49')]||(_0x316604[_0x3dc0('0x3a')]&&_0x316604[_0x3dc0('0x3a')][0x6]?_0x316604[_0x3dc0('0x3a')][0x6][_0x3dc0('0x3b')]:undefined)||''},{'name':_0x3dc0('0x4a'),'value':_0x316604[_0x3dc0('0x4a')]||(_0x316604[_0x3dc0('0x3a')]&&_0x316604[_0x3dc0('0x3a')][0x7]?_0x316604[_0x3dc0('0x3a')][0x7][_0x3dc0('0x3b')]:undefined)||''},{'name':_0x3dc0('0x4b'),'value':_0x316604[_0x3dc0('0x4b')]||(_0x316604[_0x3dc0('0x3a')]&&_0x316604[_0x3dc0('0x3a')][0x8]?_0x316604[_0x3dc0('0x3a')][0x8][_0x3dc0('0x3b')]:undefined)||''},{'name':'attrChatWebsites','value':_0x316604['attrChatWebsites']||(_0x316604[_0x3dc0('0x3a')]&&_0x316604[_0x3dc0('0x3a')][0x9]?_0x316604[_0x3dc0('0x3a')][0x9][_0x3dc0('0x3b')]:undefined)||''}];case _0x3dc0('0x4c'):case'pie-chart':return[{'name':_0x3dc0('0x4d'),'value':_0x316604[_0x3dc0('0x4d')]||(_0x316604[_0x3dc0('0x3a')]&&_0x316604[_0x3dc0('0x3a')][0x0]?_0x316604['attrs'][0x0][_0x3dc0('0x3b')]:undefined)||'total'},{'name':'attrSerie2','value':_0x316604[_0x3dc0('0x4e')]||(_0x316604['attrs']&&_0x316604['attrs'][0x1]?_0x316604[_0x3dc0('0x3a')][0x1][_0x3dc0('0x3b')]:undefined)||null},{'name':_0x3dc0('0x4f'),'value':_0x316604[_0x3dc0('0x4f')]||(_0x316604[_0x3dc0('0x3a')]&&_0x316604['attrs'][0x2]?_0x316604['attrs'][0x2][_0x3dc0('0x3b')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x316604[_0x3dc0('0x44')]||(_0x316604[_0x3dc0('0x3a')]&&_0x316604['attrs'][0x3]?_0x316604[_0x3dc0('0x3a')][0x3][_0x3dc0('0x3b')]:undefined)||[]},{'name':_0x3dc0('0x45'),'value':_0x316604[_0x3dc0('0x45')]||(_0x316604[_0x3dc0('0x3a')]&&_0x316604['attrs'][0x4]?_0x316604['attrs'][0x4][_0x3dc0('0x3b')]:undefined)||'voice'},{'name':_0x3dc0('0x47'),'value':_0x316604[_0x3dc0('0x47')]||(_0x316604['attrs']&&_0x316604[_0x3dc0('0x3a')][0x5]?_0x316604[_0x3dc0('0x3a')][0x5]['value']:undefined)||''},{'name':_0x3dc0('0x48'),'value':_0x316604[_0x3dc0('0x48')]||(_0x316604[_0x3dc0('0x3a')]&&_0x316604[_0x3dc0('0x3a')][0x6]?_0x316604['attrs'][0x6][_0x3dc0('0x3b')]:undefined)||''},{'name':_0x3dc0('0x49'),'value':_0x316604[_0x3dc0('0x49')]||(_0x316604[_0x3dc0('0x3a')]&&_0x316604[_0x3dc0('0x3a')][0x7]?_0x316604[_0x3dc0('0x3a')][0x7]['value']:undefined)||''},{'name':_0x3dc0('0x4a'),'value':_0x316604['attrOpenchannelAccounts']||(_0x316604['attrs']&&_0x316604['attrs'][0x8]?_0x316604[_0x3dc0('0x3a')][0x8][_0x3dc0('0x3b')]:undefined)||''},{'name':_0x3dc0('0x4b'),'value':_0x316604[_0x3dc0('0x4b')]||(_0x316604[_0x3dc0('0x3a')]&&_0x316604['attrs'][0x9]?_0x316604[_0x3dc0('0x3a')][0x9][_0x3dc0('0x3b')]:undefined)||''},{'name':_0x3dc0('0x50'),'value':_0x316604['attrChatWebsites']||(_0x316604[_0x3dc0('0x3a')]&&_0x316604['attrs'][0xa]?_0x316604[_0x3dc0('0x3a')][0xa][_0x3dc0('0x3b')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x316604[_0x3dc0('0x51')]||(_0x316604[_0x3dc0('0x3a')]&&_0x316604[_0x3dc0('0x3a')][0x0]?_0x316604[_0x3dc0('0x3a')][0x0][_0x3dc0('0x52')]:undefined)||null,'value':_0x316604[_0x3dc0('0x53')]||(_0x316604['attrs']&&_0x316604[_0x3dc0('0x3a')][0x0]?_0x316604['attrs'][0x0][_0x3dc0('0x3b')]:undefined)||null},{'name':_0x3dc0('0x54'),'value':_0x316604[_0x3dc0('0x54')]||(_0x316604[_0x3dc0('0x3a')]&&_0x316604[_0x3dc0('0x3a')][0x1]?_0x316604['attrs'][0x1][_0x3dc0('0x3b')]:undefined)||0x0}];default:return[];}}catch(_0x437203){logger['error'](_0x3dc0('0x55'),JSON['stringify'](_0x437203));return[];}}exports[_0x3dc0('0x56')]=function(_0x562c1f,_0x3e5fea){if(_0x562c1f[_0x3dc0('0x57')]){_0x562c1f[_0x3dc0('0x57')][_0x3dc0('0x3a')]=widgetAttributes(_0x562c1f[_0x3dc0('0x57')]);}return db[_0x3dc0('0x2d')][_0x3dc0('0x56')](_0x562c1f[_0x3dc0('0x57')],{})[_0x3dc0('0x28')](respondWithResult(_0x3e5fea,0xc9))[_0x3dc0('0x36')](handleError(_0x3e5fea,null));};exports['update']=function(_0x5903ff,_0x493b83){if(_0x5903ff[_0x3dc0('0x57')]['id']){delete _0x5903ff[_0x3dc0('0x57')]['id'];}_0x5903ff['body'][_0x3dc0('0x3a')]=widgetAttributes(_0x5903ff[_0x3dc0('0x57')]);return db['DashboardItem']['find']({'where':{'id':_0x5903ff[_0x3dc0('0x2b')]['id']}})[_0x3dc0('0x28')](handleEntityNotFound(_0x493b83,null))['then'](saveUpdates(_0x5903ff[_0x3dc0('0x57')],null))['then'](respondWithResult(_0x493b83,null))['catch'](handleError(_0x493b83,null));}; \ No newline at end of file +var _0x4f0d=['reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','DashboardItem','catch','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','body','moment','bluebird','mustache','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0x1f5303,_0x354414){var _0x84ef1a=function(_0x27e275){while(--_0x27e275){_0x1f5303['push'](_0x1f5303['shift']());}};_0x84ef1a(++_0x354414);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0x4f0d[_0x280ae7];return _0x418b9e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd4f0('0x0'));var BPromise=require(_0xd4f0('0x1'));var Mustache=require(_0xd4f0('0x2'));var util=require('util');var path=require(_0xd4f0('0x3'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd4f0('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4f0('0x5'));var squel=require(_0xd4f0('0x6'));var crypto=require('crypto');var jsforce=require(_0xd4f0('0x7'));var deskjs=require(_0xd4f0('0x8'));var toCsv=require(_0xd4f0('0x9'));var querystring=require(_0xd4f0('0xa'));var Papa=require(_0xd4f0('0xb'));var Redis=require('ioredis');var authService=require(_0xd4f0('0xc'));var qs=require(_0xd4f0('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4f0('0xe'))(_0xd4f0('0xf'));var utils=require('../../config/utils');var config=require(_0xd4f0('0x10'));var licenseUtil=require(_0xd4f0('0x11'));var db=require(_0xd4f0('0x12'))['db'];config[_0xd4f0('0x13')]=_[_0xd4f0('0x14')](config['redis'],{'host':_0xd4f0('0x15'),'port':0x18eb});var socket=require(_0xd4f0('0x16'))(new Redis(config[_0xd4f0('0x13')]));require(_0xd4f0('0x17'))[_0xd4f0('0x18')](socket);function respondWithStatusCode(_0x544936,_0x100cd4){_0x100cd4=_0x100cd4||0xcc;return function(_0x386f84){if(_0x386f84){return _0x544936[_0xd4f0('0x19')](_0x100cd4);}return _0x544936[_0xd4f0('0x1a')](_0x100cd4)[_0xd4f0('0x1b')]();};}function respondWithResult(_0x2dd02d,_0x4f8e76){_0x4f8e76=_0x4f8e76||0xc8;return function(_0x5adf8a){if(_0x5adf8a){return _0x2dd02d[_0xd4f0('0x1a')](_0x4f8e76)[_0xd4f0('0x1c')](_0x5adf8a);}};}function respondWithFilteredResult(_0xff90e,_0x7b2ca4){return function(_0x4d0dcc){if(_0x4d0dcc){var _0x5bf265=typeof _0x7b2ca4[_0xd4f0('0x1d')]===_0xd4f0('0x1e')&&typeof _0x7b2ca4[_0xd4f0('0x1f')]===_0xd4f0('0x1e');var _0x7560d6=_0x4d0dcc[_0xd4f0('0x20')];var _0x57d418=_0x5bf265?0x0:_0x7b2ca4[_0xd4f0('0x1d')];var _0x2f0b79=_0x5bf265?_0x4d0dcc[_0xd4f0('0x20')]:_0x7b2ca4['offset']+_0x7b2ca4[_0xd4f0('0x1f')];var _0x474c22;if(_0x2f0b79>=_0x7560d6){_0x2f0b79=_0x7560d6;_0x474c22=0xc8;}else{_0x474c22=0xce;}_0xff90e[_0xd4f0('0x1a')](_0x474c22);return _0xff90e['set'](_0xd4f0('0x21'),_0x57d418+'-'+_0x2f0b79+'/'+_0x7560d6)[_0xd4f0('0x1c')](_0x4d0dcc);}return null;};}function patchUpdates(_0x655480){return function(_0x5b94bb){try{jsonpatch[_0xd4f0('0x22')](_0x5b94bb,_0x655480,!![]);}catch(_0x174e52){return BPromise[_0xd4f0('0x23')](_0x174e52);}return _0x5b94bb[_0xd4f0('0x24')]();};}function saveUpdates(_0x4fd650,_0x1552e9){return function(_0x3345c6){if(_0x3345c6){return _0x3345c6[_0xd4f0('0x25')](_0x4fd650)[_0xd4f0('0x26')](function(_0x5f4858){return _0x5f4858;});}return null;};}function removeEntity(_0x37e8a1,_0x49b94b){return function(_0x15e310){if(_0x15e310){return _0x15e310[_0xd4f0('0x27')]()[_0xd4f0('0x26')](function(){_0x37e8a1[_0xd4f0('0x1a')](0xcc)[_0xd4f0('0x1b')]();});}};}function handleEntityNotFound(_0x2f4291,_0x1dd584){return function(_0xe25e57){if(!_0xe25e57){_0x2f4291[_0xd4f0('0x19')](0x194);}return _0xe25e57;};}function handleError(_0x2c1f4f,_0xe2bf28){_0xe2bf28=_0xe2bf28||0x1f4;return function(_0x4ea8aa){logger[_0xd4f0('0x28')](_0x4ea8aa[_0xd4f0('0x29')]);if(_0x4ea8aa[_0xd4f0('0x2a')]){delete _0x4ea8aa[_0xd4f0('0x2a')];}_0x2c1f4f['status'](_0xe2bf28)[_0xd4f0('0x2b')](_0x4ea8aa);};}exports[_0xd4f0('0x2c')]=function(_0x401a5b,_0x40da73){var _0x4b8244={'raw':![],'where':{'id':_0x401a5b[_0xd4f0('0x2d')]['id']}},_0x39c44a={};_0x39c44a[_0xd4f0('0x2e')]=_[_0xd4f0('0x2f')](db['DashboardItem'][_0xd4f0('0x30')]);_0x39c44a[_0xd4f0('0x31')]=_[_0xd4f0('0x2f')](_0x401a5b[_0xd4f0('0x31')]);_0x39c44a[_0xd4f0('0x32')]=_[_0xd4f0('0x33')](_0x39c44a[_0xd4f0('0x2e')],_0x39c44a[_0xd4f0('0x31')]);_0x4b8244[_0xd4f0('0x34')]=_[_0xd4f0('0x33')](_0x39c44a[_0xd4f0('0x2e')],qs['fields'](_0x401a5b[_0xd4f0('0x31')][_0xd4f0('0x35')]));_0x4b8244[_0xd4f0('0x34')]=_0x4b8244[_0xd4f0('0x34')][_0xd4f0('0x36')]?_0x4b8244['attributes']:_0x39c44a[_0xd4f0('0x2e')];if(_0x401a5b[_0xd4f0('0x31')]['includeAll']){_0x4b8244[_0xd4f0('0x37')]=[{'all':!![]}];}_0x4b8244=_[_0xd4f0('0x38')]({},_0x4b8244,_0x401a5b[_0xd4f0('0x39')]);return db['DashboardItem'][_0xd4f0('0x3a')](_0x4b8244)['then'](handleEntityNotFound(_0x40da73,null))['then'](respondWithResult(_0x40da73,null))['catch'](handleError(_0x40da73,null));};exports[_0xd4f0('0x27')]=function(_0x33c1ea,_0x23283b){return db[_0xd4f0('0x3b')][_0xd4f0('0x3a')]({'where':{'id':_0x33c1ea['params']['id']}})['then'](handleEntityNotFound(_0x23283b,null))[_0xd4f0('0x26')](removeEntity(_0x23283b,null))[_0xd4f0('0x3c')](handleError(_0x23283b,null));};function widgetAttributes(_0x386ec3){try{switch(_0x386ec3['type']){case _0xd4f0('0x3d'):return[{'name':_0xd4f0('0x3e'),'value':_0x386ec3[_0xd4f0('0x3e')]||(_0x386ec3['attrs']&&_0x386ec3[_0xd4f0('0x3f')][0x0]?_0x386ec3['attrs'][0x0][_0xd4f0('0x40')]:undefined)||_0xd4f0('0x41')}];case _0xd4f0('0x42'):return[{'name':_0xd4f0('0x43'),'value':_0x386ec3[_0xd4f0('0x43')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x0]?_0x386ec3['attrs'][0x0][_0xd4f0('0x40')]:undefined)||''}];case _0xd4f0('0x44'):return[{'name':'attrHourFormat','value':_0x386ec3[_0xd4f0('0x45')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x0]?_0x386ec3[_0xd4f0('0x3f')][0x0][_0xd4f0('0x40')]:undefined)||_0xd4f0('0x46')},{'name':'attrTimezone','value':_0x386ec3[_0xd4f0('0x47')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x1]?_0x386ec3[_0xd4f0('0x3f')][0x1][_0xd4f0('0x40')]:undefined)||_0xd4f0('0x48')},{'name':'attrFontSize','value':_0x386ec3[_0xd4f0('0x49')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x2]?_0x386ec3['attrs'][0x2][_0xd4f0('0x40')]:undefined)||0xc}];case _0xd4f0('0x4a'):return[{'name':_0xd4f0('0x4b'),'value':_0x386ec3['attrMetric']||(_0x386ec3['attrs']&&_0x386ec3[_0xd4f0('0x3f')][0x0]?_0x386ec3[_0xd4f0('0x3f')][0x0][_0xd4f0('0x40')]:undefined)||_0xd4f0('0x4c')},{'name':_0xd4f0('0x4d'),'value':_0x386ec3[_0xd4f0('0x4d')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x1]?_0x386ec3[_0xd4f0('0x3f')][0x1][_0xd4f0('0x40')]:undefined)||[]},{'name':_0xd4f0('0x49'),'value':_0x386ec3[_0xd4f0('0x49')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x2]?_0x386ec3[_0xd4f0('0x3f')][0x2]['value']:undefined)||0x14},{'name':_0xd4f0('0x4e'),'value':_0x386ec3['attrChannel']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x3]?_0x386ec3[_0xd4f0('0x3f')][0x3]['value']:undefined)||_0xd4f0('0x4f')},{'name':_0xd4f0('0x50'),'value':_0x386ec3['attrEmailAccounts']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x4]?_0x386ec3[_0xd4f0('0x3f')][0x4][_0xd4f0('0x40')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x386ec3[_0xd4f0('0x51')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x5]?_0x386ec3[_0xd4f0('0x3f')][0x5][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x52'),'value':_0x386ec3[_0xd4f0('0x52')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x6]?_0x386ec3[_0xd4f0('0x3f')][0x6][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x53'),'value':_0x386ec3['attrOpenchannelAccounts']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x7]?_0x386ec3[_0xd4f0('0x3f')][0x7][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x54'),'value':_0x386ec3['attrWhatsappAccounts']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x8]?_0x386ec3[_0xd4f0('0x3f')][0x8][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x55'),'value':_0x386ec3[_0xd4f0('0x55')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x9]?_0x386ec3[_0xd4f0('0x3f')][0x9][_0xd4f0('0x40')]:undefined)||''}];case _0xd4f0('0x56'):case _0xd4f0('0x57'):return[{'name':_0xd4f0('0x58'),'value':_0x386ec3[_0xd4f0('0x58')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x0]?_0x386ec3[_0xd4f0('0x3f')][0x0]['value']:undefined)||_0xd4f0('0x4c')},{'name':_0xd4f0('0x59'),'value':_0x386ec3[_0xd4f0('0x59')]||(_0x386ec3['attrs']&&_0x386ec3[_0xd4f0('0x3f')][0x1]?_0x386ec3[_0xd4f0('0x3f')][0x1]['value']:undefined)||null},{'name':_0xd4f0('0x5a'),'value':_0x386ec3[_0xd4f0('0x5a')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x2]?_0x386ec3['attrs'][0x2][_0xd4f0('0x40')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x386ec3[_0xd4f0('0x4d')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x3]?_0x386ec3[_0xd4f0('0x3f')][0x3][_0xd4f0('0x40')]:undefined)||[]},{'name':'attrChannel','value':_0x386ec3['attrChannel']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x4]?_0x386ec3[_0xd4f0('0x3f')][0x4][_0xd4f0('0x40')]:undefined)||_0xd4f0('0x4f')},{'name':_0xd4f0('0x50'),'value':_0x386ec3[_0xd4f0('0x50')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x5]?_0x386ec3['attrs'][0x5][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x51'),'value':_0x386ec3['attrFaxAccounts']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x6]?_0x386ec3[_0xd4f0('0x3f')][0x6][_0xd4f0('0x40')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x386ec3['attrSmsAccounts']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x7]?_0x386ec3['attrs'][0x7]['value']:undefined)||''},{'name':_0xd4f0('0x53'),'value':_0x386ec3[_0xd4f0('0x53')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3['attrs'][0x8]?_0x386ec3[_0xd4f0('0x3f')][0x8][_0xd4f0('0x40')]:undefined)||''},{'name':_0xd4f0('0x54'),'value':_0x386ec3[_0xd4f0('0x54')]||(_0x386ec3['attrs']&&_0x386ec3['attrs'][0x9]?_0x386ec3[_0xd4f0('0x3f')][0x9]['value']:undefined)||''},{'name':_0xd4f0('0x55'),'value':_0x386ec3['attrChatWebsites']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0xa]?_0x386ec3['attrs'][0xa][_0xd4f0('0x40')]:undefined)||''}];case _0xd4f0('0x5b'):return[{'name':_0xd4f0('0x5c'),'type':_0x386ec3[_0xd4f0('0x5d')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x0]?_0x386ec3[_0xd4f0('0x3f')][0x0]['type']:undefined)||null,'value':_0x386ec3['attrReport']||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x0]?_0x386ec3['attrs'][0x0][_0xd4f0('0x40')]:undefined)||null},{'name':'attrRefresh','value':_0x386ec3[_0xd4f0('0x5e')]||(_0x386ec3[_0xd4f0('0x3f')]&&_0x386ec3[_0xd4f0('0x3f')][0x1]?_0x386ec3[_0xd4f0('0x3f')][0x1][_0xd4f0('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x3d4979){logger[_0xd4f0('0x28')]('widgetAttributes:\x20%s',JSON[_0xd4f0('0x5f')](_0x3d4979));return[];}}exports['create']=function(_0x1c0afe,_0x41da67){if(_0x1c0afe[_0xd4f0('0x60')]){_0x1c0afe[_0xd4f0('0x60')][_0xd4f0('0x3f')]=widgetAttributes(_0x1c0afe['body']);}return db[_0xd4f0('0x3b')]['create'](_0x1c0afe[_0xd4f0('0x60')],{})[_0xd4f0('0x26')](respondWithResult(_0x41da67,0xc9))['catch'](handleError(_0x41da67,null));};exports[_0xd4f0('0x25')]=function(_0x45427c,_0x5e330c){if(_0x45427c[_0xd4f0('0x60')]['id']){delete _0x45427c[_0xd4f0('0x60')]['id'];}_0x45427c[_0xd4f0('0x60')][_0xd4f0('0x3f')]=widgetAttributes(_0x45427c[_0xd4f0('0x60')]);return db[_0xd4f0('0x3b')]['find']({'where':{'id':_0x45427c[_0xd4f0('0x2d')]['id']}})[_0xd4f0('0x26')](handleEntityNotFound(_0x5e330c,null))[_0xd4f0('0x26')](saveUpdates(_0x45427c['body'],null))[_0xd4f0('0x26')](respondWithResult(_0x5e330c,null))[_0xd4f0('0x3c')](handleError(_0x5e330c,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 525fa0b..7c851ec 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 _0x22b9=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0x356bf7,_0x1e6de4){var _0x487897=function(_0x33c1cd){while(--_0x33c1cd){_0x356bf7['push'](_0x356bf7['shift']());}};_0x487897(++_0x1e6de4);}(_0x22b9,0x8c));var _0x922b=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x22b9[_0x5d4607];return _0x5e4a86;};'use strict';var EventEmitter=require(_0x922b('0x0'));var DashboardItem=require(_0x922b('0x1'))['db'][_0x922b('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x922b('0x3')](0x0);var events={'afterCreate':_0x922b('0x4'),'afterUpdate':_0x922b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x51d95c){return function(_0x1d7bbf,_0x48fcab,_0x44947f){DashboardItemEvents[_0x922b('0x6')](_0x51d95c+':'+_0x1d7bbf['id'],_0x1d7bbf);DashboardItemEvents[_0x922b('0x6')](_0x51d95c,_0x1d7bbf);_0x44947f(null);};}for(var e in events){if(events[_0x922b('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x922b('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0xa3e8=['DashboardItem','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x403b7c,_0x5d1d4d){var _0x34e519=function(_0x96866b){while(--_0x96866b){_0x403b7c['push'](_0x403b7c['shift']());}};_0x34e519(++_0x5d1d4d);}(_0xa3e8,0x127));var _0x8a3e=function(_0x5ad729,_0xb024b2){_0x5ad729=_0x5ad729-0x0;var _0x40e411=_0xa3e8[_0x5ad729];return _0x40e411;};'use strict';var EventEmitter=require(_0x8a3e('0x0'));var DashboardItem=require(_0x8a3e('0x1'))['db'][_0x8a3e('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8a3e('0x3'),'afterUpdate':_0x8a3e('0x4'),'afterDestroy':_0x8a3e('0x5')};function emitEvent(_0xe6cae2){return function(_0x109d7a,_0x5a81bb,_0x4889a0){DashboardItemEvents['emit'](_0xe6cae2+':'+_0x109d7a['id'],_0x109d7a);DashboardItemEvents[_0x8a3e('0x6')](_0xe6cae2,_0x109d7a);_0x4889a0(null);};}for(var e in events){if(events[_0x8a3e('0x7')](e)){var event=events[e];DashboardItem[_0x8a3e('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index b4bb17d..260179a 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 _0x18ab=['path','rimraf','../../config/environment','./dashboardItem.attributes','define','DashboardItem','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x18ab,0xd2));var _0xb18a=function(_0xec9c2d,_0x5f58fe){_0xec9c2d=_0xec9c2d-0x0;var _0x24e434=_0x18ab[_0xec9c2d];return _0x24e434;};'use strict';var _=require(_0xb18a('0x0'));var util=require(_0xb18a('0x1'));var logger=require(_0xb18a('0x2'))(_0xb18a('0x3'));var moment=require(_0xb18a('0x4'));var BPromise=require(_0xb18a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb18a('0x6'));var rimraf=require(_0xb18a('0x7'));var config=require(_0xb18a('0x8'));var attributes=require(_0xb18a('0x9'));module['exports']=function(_0x1e5da1,_0x4cccff){return _0x1e5da1[_0xb18a('0xa')](_0xb18a('0xb'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47b4=['exports','DashboardItem','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./dashboardItem.attributes'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x47b4,0x1e2));var _0x447b=function(_0x368161,_0x56df36){_0x368161=_0x368161-0x0;var _0x5f50e2=_0x47b4[_0x368161];return _0x5f50e2;};'use strict';var _=require(_0x447b('0x0'));var util=require('util');var logger=require(_0x447b('0x1'))(_0x447b('0x2'));var moment=require('moment');var BPromise=require(_0x447b('0x3'));var rp=require(_0x447b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x447b('0x5'));var config=require(_0x447b('0x6'));var attributes=require(_0x447b('0x7'));module[_0x447b('0x8')]=function(_0x302a00,_0x58ffc0){return _0x302a00['define'](_0x447b('0x9'),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 c4b4b8e..9e3487f 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 _0xc9db=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./dashboardItem.socket','register','request','then','info','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x29e8aa,_0x4d394a){var _0x7a6891=function(_0x1ec537){while(--_0x1ec537){_0x29e8aa['push'](_0x29e8aa['shift']());}};_0x7a6891(++_0x4d394a);}(_0xc9db,0x1b6));var _0xbc9d=function(_0x40c30a,_0x543fb2){_0x40c30a=_0x40c30a-0x0;var _0x40d9f3=_0xc9db[_0x40c30a];return _0x40d9f3;};'use strict';var _=require('lodash');var util=require(_0xbc9d('0x0'));var moment=require('moment');var BPromise=require(_0xbc9d('0x1'));var rs=require(_0xbc9d('0x2'));var fs=require('fs');var Redis=require(_0xbc9d('0x3'));var db=require(_0xbc9d('0x4'))['db'];var utils=require(_0xbc9d('0x5'));var logger=require(_0xbc9d('0x6'))('rpc');var config=require(_0xbc9d('0x7'));var jayson=require(_0xbc9d('0x8'));var client=jayson[_0xbc9d('0x9')][_0xbc9d('0xa')]({'port':0x232a});config[_0xbc9d('0xb')]=_['defaults'](config['redis'],{'host':_0xbc9d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbc9d('0xd'))[_0xbc9d('0xe')](socket);function respondWithRpcPromise(_0x211d74,_0x12e6fd,_0x4995ea){return new BPromise(function(_0x45aff5,_0x3a1b98){return client[_0xbc9d('0xf')](_0x211d74,_0x4995ea)[_0xbc9d('0x10')](function(_0x28def2){logger[_0xbc9d('0x11')]('DashboardItem,\x20%s,\x20%s',_0x12e6fd,_0xbc9d('0x12'));logger['debug'](_0xbc9d('0x13'),_0x12e6fd,'request\x20sent',JSON['stringify'](_0x28def2));if(_0x28def2[_0xbc9d('0x14')]){if(_0x28def2[_0xbc9d('0x14')][_0xbc9d('0x15')]===0x1f4){logger['error'](_0xbc9d('0x16'),_0x12e6fd,_0x28def2[_0xbc9d('0x14')][_0xbc9d('0x17')]);return _0x3a1b98(_0x28def2[_0xbc9d('0x14')][_0xbc9d('0x17')]);}logger[_0xbc9d('0x14')](_0xbc9d('0x16'),_0x12e6fd,_0x28def2['error'][_0xbc9d('0x17')]);return _0x45aff5(_0x28def2[_0xbc9d('0x14')][_0xbc9d('0x17')]);}else{logger[_0xbc9d('0x11')]('DashboardItem,\x20%s,\x20%s',_0x12e6fd,_0xbc9d('0x12'));_0x45aff5(_0x28def2[_0xbc9d('0x18')][_0xbc9d('0x17')]);}})[_0xbc9d('0x19')](function(_0x62c620){logger['error']('DashboardItem,\x20%s,\x20%s',_0x12e6fd,_0x62c620);_0x3a1b98(_0x62c620);});});} \ No newline at end of file +var _0x8ea3=['http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x146e71,_0x3ef320){var _0x592b5a=function(_0x210186){while(--_0x210186){_0x146e71['push'](_0x146e71['shift']());}};_0x592b5a(++_0x3ef320);}(_0x8ea3,0x1b9));var _0x38ea=function(_0x159c68,_0xc544c9){_0x159c68=_0x159c68-0x0;var _0x32792f=_0x8ea3[_0x159c68];return _0x32792f;};'use strict';var _=require(_0x38ea('0x0'));var util=require('util');var moment=require(_0x38ea('0x1'));var BPromise=require(_0x38ea('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x38ea('0x3'));var db=require(_0x38ea('0x4'))['db'];var utils=require(_0x38ea('0x5'));var logger=require('../../config/logger')(_0x38ea('0x6'));var config=require(_0x38ea('0x7'));var jayson=require(_0x38ea('0x8'));var client=jayson['client'][_0x38ea('0x9')]({'port':0x232a});config[_0x38ea('0xa')]=_[_0x38ea('0xb')](config[_0x38ea('0xa')],{'host':_0x38ea('0xc'),'port':0x18eb});var socket=require(_0x38ea('0xd'))(new Redis(config[_0x38ea('0xa')]));require(_0x38ea('0xe'))['register'](socket);function respondWithRpcPromise(_0x143e07,_0x515638,_0x51f348){return new BPromise(function(_0x3d73bd,_0xd9d4e){return client[_0x38ea('0xf')](_0x143e07,_0x51f348)[_0x38ea('0x10')](function(_0x21e186){logger[_0x38ea('0x11')](_0x38ea('0x12'),_0x515638,'request\x20sent');logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x515638,_0x38ea('0x13'),JSON[_0x38ea('0x14')](_0x21e186));if(_0x21e186[_0x38ea('0x15')]){if(_0x21e186['error'][_0x38ea('0x16')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x515638,_0x21e186[_0x38ea('0x15')][_0x38ea('0x17')]);return _0xd9d4e(_0x21e186['error']['message']);}logger[_0x38ea('0x15')](_0x38ea('0x12'),_0x515638,_0x21e186['error'][_0x38ea('0x17')]);return _0x3d73bd(_0x21e186[_0x38ea('0x15')]['message']);}else{logger['info'](_0x38ea('0x12'),_0x515638,_0x38ea('0x13'));_0x3d73bd(_0x21e186['result']['message']);}})[_0x38ea('0x18')](function(_0x5f55b1){logger[_0x38ea('0x15')](_0x38ea('0x12'),_0x515638,_0x5f55b1);_0xd9d4e(_0x5f55b1);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 804f1a1..89b2566 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 _0x7e91=['save','remove','dashboardItem:','./dashboardItem.events'];(function(_0x4f4d19,_0x574245){var _0x27a258=function(_0x38da3e){while(--_0x38da3e){_0x4f4d19['push'](_0x4f4d19['shift']());}};_0x27a258(++_0x574245);}(_0x7e91,0x133));var _0x17e9=function(_0x4f87a8,_0x38a2e9){_0x4f87a8=_0x4f87a8-0x0;var _0x1aa94b=_0x7e91[_0x4f87a8];return _0x1aa94b;};'use strict';var DashboardItemEvents=require(_0x17e9('0x0'));var events=[_0x17e9('0x1'),_0x17e9('0x2'),'update'];function createListener(_0x442fb6,_0x30b728){return function(_0x1111e2){_0x30b728['emit'](_0x442fb6,_0x1111e2);};}function removeListener(_0x54ef68,_0x273439){return function(){DashboardItemEvents['removeListener'](_0x54ef68,_0x273439);};}exports['register']=function(_0x11273d){for(var _0x1f017f=0x0,_0x87b397=events['length'];_0x1f017f<_0x87b397;_0x1f017f++){var _0x420b15=events[_0x1f017f];var _0x37f3ad=createListener(_0x17e9('0x3')+_0x420b15,_0x11273d);DashboardItemEvents['on'](_0x420b15,_0x37f3ad);}}; \ No newline at end of file +var _0x327a=['remove','update','removeListener','register','length','./dashboardItem.events','save'];(function(_0x469fe3,_0x1c116f){var _0x323496=function(_0x5a639f){while(--_0x5a639f){_0x469fe3['push'](_0x469fe3['shift']());}};_0x323496(++_0x1c116f);}(_0x327a,0xc9));var _0xa327=function(_0x260808,_0x3b3ca0){_0x260808=_0x260808-0x0;var _0xefc021=_0x327a[_0x260808];return _0xefc021;};'use strict';var DashboardItemEvents=require(_0xa327('0x0'));var events=[_0xa327('0x1'),_0xa327('0x2'),_0xa327('0x3')];function createListener(_0x52d4f6,_0x16355e){return function(_0x5eb136){_0x16355e['emit'](_0x52d4f6,_0x5eb136);};}function removeListener(_0x11123e,_0x4b2468){return function(){DashboardItemEvents[_0xa327('0x4')](_0x11123e,_0x4b2468);};}exports[_0xa327('0x5')]=function(_0x4fccb6){for(var _0x13d622=0x0,_0x500bf9=events[_0xa327('0x6')];_0x13d622<_0x500bf9;_0x13d622++){var _0x4a01fb=events[_0x13d622];var _0x4d06d0=createListener('dashboardItem:'+_0x4a01fb,_0x4fccb6);DashboardItemEvents['on'](_0x4a01fb,_0x4d06d0);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 86c087b..77b430c 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 _0x6462=['/:id','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','post','create','put','update','delete'];(function(_0x59110f,_0x326f19){var _0x27c622=function(_0x30dbce){while(--_0x30dbce){_0x59110f['push'](_0x59110f['shift']());}};_0x27c622(++_0x326f19);}(_0x6462,0x133));var _0x2646=function(_0x206b4d,_0x2da7cc){_0x206b4d=_0x206b4d-0x0;var _0x5526c7=_0x6462[_0x206b4d];return _0x5526c7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2646('0x0'));var timeout=require(_0x2646('0x1'));var express=require(_0x2646('0x2'));var router=express[_0x2646('0x3')]();var fs_extra=require(_0x2646('0x4'));var auth=require(_0x2646('0x5'));var interaction=require(_0x2646('0x6'));var config=require(_0x2646('0x7'));var controller=require(_0x2646('0x8'));router[_0x2646('0x9')]('/:id',auth[_0x2646('0xa')](),controller['show']);router[_0x2646('0xb')]('/',auth[_0x2646('0xa')](),controller[_0x2646('0xc')]);router[_0x2646('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x2646('0xe')]);router[_0x2646('0xf')](_0x2646('0x10'),auth[_0x2646('0xa')](),controller[_0x2646('0x11')]);module[_0x2646('0x12')]=router; \ No newline at end of file +var _0x522a=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','create','put','update','delete','destroy','exports','multer','util'];(function(_0x18fc83,_0x205c12){var _0x397c28=function(_0x545253){while(--_0x545253){_0x18fc83['push'](_0x18fc83['shift']());}};_0x397c28(++_0x205c12);}(_0x522a,0x11f));var _0xa522=function(_0x485038,_0x3e26e8){_0x485038=_0x485038-0x0;var _0xa87ace=_0x522a[_0x485038];return _0xa87ace;};'use strict';var multer=require(_0xa522('0x0'));var util=require(_0xa522('0x1'));var path=require('path');var timeout=require(_0xa522('0x2'));var express=require(_0xa522('0x3'));var router=express[_0xa522('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa522('0x5'));var config=require(_0xa522('0x6'));var controller=require(_0xa522('0x7'));router[_0xa522('0x8')](_0xa522('0x9'),auth[_0xa522('0xa')](),controller['show']);router['post']('/',auth[_0xa522('0xa')](),controller[_0xa522('0xb')]);router[_0xa522('0xc')]('/:id',auth[_0xa522('0xa')](),controller[_0xa522('0xd')]);router[_0xa522('0xe')]('/:id',auth[_0xa522('0xa')](),controller[_0xa522('0xf')]);module[_0xa522('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 5bbf60c..4e90ca6 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 _0x6517=['third','exports','STRING','ENUM','first','second'];(function(_0x43d79c,_0x531a55){var _0x4866b0=function(_0x847a){while(--_0x847a){_0x43d79c['push'](_0x43d79c['shift']());}};_0x4866b0(++_0x531a55);}(_0x6517,0xfd));var _0x7651=function(_0x308035,_0x3c05a6){_0x308035=_0x308035-0x0;var _0x579592=_0x6517[_0x308035];return _0x579592;};'use strict';var Sequelize=require('sequelize');module[_0x7651('0x0')]={'name':{'type':Sequelize[_0x7651('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x7651('0x2')](_0x7651('0x3'),_0x7651('0x4'),_0x7651('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x7651('0x1')]}}; \ No newline at end of file +var _0xae10=['first','third','STRING','sequelize','exports'];(function(_0x4073ea,_0x56357c){var _0x44df4a=function(_0x165cf9){while(--_0x165cf9){_0x4073ea['push'](_0x4073ea['shift']());}};_0x44df4a(++_0x56357c);}(_0xae10,0x94));var _0x0ae1=function(_0xad0054,_0x20c4a5){_0xad0054=_0xad0054-0x0;var _0x2733fd=_0xae10[_0xad0054];return _0x2733fd;};'use strict';var Sequelize=require(_0x0ae1('0x0'));module[_0x0ae1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x0ae1('0x2'),'second',_0x0ae1('0x3')),'allowNull':![],'defaultValue':_0x0ae1('0x2')},'description':{'type':Sequelize[_0x0ae1('0x4')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 8bb3bb3..b86c0d6 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 _0x370d=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','name','index','Disposition','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','UserProfileResource','error','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x1adc8a,_0x21d890){var _0x93178a=function(_0x165c57){while(--_0x165c57){_0x1adc8a['push'](_0x1adc8a['shift']());}};_0x93178a(++_0x21d890);}(_0x370d,0x194));var _0xd370=function(_0x3c099c,_0x3fb3ea){_0x3c099c=_0x3c099c-0x0;var _0x58eb31=_0x370d[_0x3c099c];return _0x58eb31;};'use strict';var emlformat=require(_0xd370('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd370('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd370('0x2'));var moment=require(_0xd370('0x3'));var BPromise=require(_0xd370('0x4'));var Mustache=require(_0xd370('0x5'));var util=require(_0xd370('0x6'));var path=require(_0xd370('0x7'));var sox=require(_0xd370('0x8'));var csv=require(_0xd370('0x9'));var ejs=require(_0xd370('0xa'));var fs=require('fs');var fs_extra=require(_0xd370('0xb'));var _=require(_0xd370('0xc'));var squel=require(_0xd370('0xd'));var crypto=require('crypto');var jsforce=require(_0xd370('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd370('0x9'));var querystring=require(_0xd370('0xf'));var Papa=require(_0xd370('0x10'));var Redis=require(_0xd370('0x11'));var authService=require(_0xd370('0x12'));var qs=require(_0xd370('0x13'));var as=require(_0xd370('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd370('0x15'))(_0xd370('0x16'));var utils=require(_0xd370('0x17'));var config=require(_0xd370('0x18'));var licenseUtil=require(_0xd370('0x19'));var db=require(_0xd370('0x1a'))['db'];function respondWithStatusCode(_0x5d0ddf,_0x39be4b){_0x39be4b=_0x39be4b||0xcc;return function(_0x15ec10){if(_0x15ec10){return _0x5d0ddf[_0xd370('0x1b')](_0x39be4b);}return _0x5d0ddf[_0xd370('0x1c')](_0x39be4b)[_0xd370('0x1d')]();};}function respondWithResult(_0x503227,_0x262b92){_0x262b92=_0x262b92||0xc8;return function(_0x5cd350){if(_0x5cd350){return _0x503227[_0xd370('0x1c')](_0x262b92)[_0xd370('0x1e')](_0x5cd350);}};}function respondWithFilteredResult(_0x549356,_0x39305f){return function(_0x33e82c){if(_0x33e82c){var _0x3f9e10=typeof _0x39305f[_0xd370('0x1f')]===_0xd370('0x20')&&typeof _0x39305f[_0xd370('0x21')]==='undefined';var _0xb32d95=_0x33e82c['count'];var _0x302fca=_0x3f9e10?0x0:_0x39305f[_0xd370('0x1f')];var _0x1db2d9=_0x3f9e10?_0x33e82c[_0xd370('0x22')]:_0x39305f[_0xd370('0x1f')]+_0x39305f[_0xd370('0x21')];var _0x3eae5e;if(_0x1db2d9>=_0xb32d95){_0x1db2d9=_0xb32d95;_0x3eae5e=0xc8;}else{_0x3eae5e=0xce;}_0x549356[_0xd370('0x1c')](_0x3eae5e);return _0x549356[_0xd370('0x23')](_0xd370('0x24'),_0x302fca+'-'+_0x1db2d9+'/'+_0xb32d95)['json'](_0x33e82c);}return null;};}function patchUpdates(_0x19c6e5){return function(_0x142893){try{jsonpatch[_0xd370('0x25')](_0x142893,_0x19c6e5,!![]);}catch(_0x5668f){return BPromise[_0xd370('0x26')](_0x5668f);}return _0x142893[_0xd370('0x27')]();};}function saveUpdates(_0x251436,_0x381a09){return function(_0x201886){if(_0x201886){return _0x201886[_0xd370('0x28')](_0x251436)[_0xd370('0x29')](function(_0x3aff75){return _0x3aff75;});}return null;};}function removeEntity(_0x4e821b,_0x208dff){return function(_0x5be2a1){if(_0x5be2a1){return _0x5be2a1[_0xd370('0x2a')]()['then'](function(){var _0x24c1ca=_0x5be2a1[_0xd370('0x2b')]({'plain':!![]});var _0x48ea9f=_0xd370('0x2c');return db['UserProfileResource'][_0xd370('0x2a')]({'where':{'type':_0x48ea9f,'resourceId':_0x24c1ca['id']}})[_0xd370('0x29')](function(){return _0x5be2a1;});})['then'](function(){_0x4e821b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23a54c,_0xe42474){return function(_0x5d6b4d){if(!_0x5d6b4d){_0x23a54c[_0xd370('0x1b')](0x194);}return _0x5d6b4d;};}function handleError(_0x3d3508,_0x2c75ed){_0x2c75ed=_0x2c75ed||0x1f4;return function(_0x281cba){logger['error'](_0x281cba['stack']);if(_0x281cba[_0xd370('0x2d')]){delete _0x281cba[_0xd370('0x2d')];}_0x3d3508['status'](_0x2c75ed)['send'](_0x281cba);};}exports[_0xd370('0x2e')]=function(_0x13d561,_0x2823fb){var _0x12e4b2={},_0x369251={},_0x2a3ebc={'count':0x0,'rows':[]};var _0x4f86bf=_['map'](db[_0xd370('0x2f')][_0xd370('0x30')],function(_0x4a7371){return{'name':_0x4a7371[_0xd370('0x31')],'type':_0x4a7371[_0xd370('0x32')]['key']};});_0x369251[_0xd370('0x33')]=_['map'](_0x4f86bf,_0xd370('0x2d'));_0x369251[_0xd370('0x34')]=_['keys'](_0x13d561[_0xd370('0x34')]);_0x369251[_0xd370('0x35')]=_[_0xd370('0x36')](_0x369251['model'],_0x369251[_0xd370('0x34')]);_0x12e4b2[_0xd370('0x37')]=_['intersection'](_0x369251['model'],qs[_0xd370('0x38')](_0x13d561['query'][_0xd370('0x38')]));_0x12e4b2[_0xd370('0x37')]=_0x12e4b2['attributes'][_0xd370('0x39')]?_0x12e4b2['attributes']:_0x369251['model'];if(!_0x13d561[_0xd370('0x34')]['hasOwnProperty']('nolimit')){_0x12e4b2['limit']=qs['limit'](_0x13d561[_0xd370('0x34')]['limit']);_0x12e4b2[_0xd370('0x1f')]=qs[_0xd370('0x1f')](_0x13d561[_0xd370('0x34')]['offset']);}_0x12e4b2[_0xd370('0x3a')]=qs[_0xd370('0x3b')](_0x13d561['query'][_0xd370('0x3b')]);_0x12e4b2[_0xd370('0x3c')]=qs['filters'](_[_0xd370('0x3d')](_0x13d561[_0xd370('0x34')],_0x369251['filters']),_0x4f86bf);if(_0x13d561[_0xd370('0x34')]['filter']){_0x12e4b2[_0xd370('0x3c')]=_[_0xd370('0x3e')](_0x12e4b2[_0xd370('0x3c')],{'$or':_['map'](_0x4f86bf,function(_0x59904b){if(_0x59904b['type']!==_0xd370('0x3f')){var _0x48acf4={};_0x48acf4[_0x59904b['name']]={'$like':'%'+_0x13d561[_0xd370('0x34')][_0xd370('0x40')]+'%'};return _0x48acf4;}})});}_0x12e4b2=_[_0xd370('0x3e')]({},_0x12e4b2,_0x13d561[_0xd370('0x41')]);var _0x3ecb73={'where':_0x12e4b2[_0xd370('0x3c')]};return db[_0xd370('0x2f')][_0xd370('0x22')](_0x3ecb73)['then'](function(_0x3bbd68){_0x2a3ebc['count']=_0x3bbd68;if(_0x13d561['query'][_0xd370('0x42')]){_0x12e4b2[_0xd370('0x43')]=[{'all':!![]}];}return db[_0xd370('0x2f')][_0xd370('0x44')](_0x12e4b2);})[_0xd370('0x29')](function(_0x309940){_0x2a3ebc[_0xd370('0x45')]=_0x309940;return _0x2a3ebc;})['then'](respondWithFilteredResult(_0x2823fb,_0x12e4b2))[_0xd370('0x46')](handleError(_0x2823fb,null));};exports['show']=function(_0x37e176,_0x4eeb33){var _0xc7acbe={'raw':!![],'where':{'id':_0x37e176['params']['id']}},_0x222f2f={};_0x222f2f[_0xd370('0x33')]=_[_0xd370('0x47')](db[_0xd370('0x2f')]['rawAttributes']);_0x222f2f[_0xd370('0x34')]=_['keys'](_0x37e176[_0xd370('0x34')]);_0x222f2f[_0xd370('0x35')]=_[_0xd370('0x36')](_0x222f2f[_0xd370('0x33')],_0x222f2f[_0xd370('0x34')]);_0xc7acbe[_0xd370('0x37')]=_[_0xd370('0x36')](_0x222f2f['model'],qs[_0xd370('0x38')](_0x37e176[_0xd370('0x34')][_0xd370('0x38')]));_0xc7acbe[_0xd370('0x37')]=_0xc7acbe['attributes'][_0xd370('0x39')]?_0xc7acbe['attributes']:_0x222f2f['model'];if(_0x37e176[_0xd370('0x34')][_0xd370('0x42')]){_0xc7acbe[_0xd370('0x43')]=[{'all':!![]}];}_0xc7acbe=_[_0xd370('0x3e')]({},_0xc7acbe,_0x37e176[_0xd370('0x41')]);return db[_0xd370('0x2f')][_0xd370('0x48')](_0xc7acbe)[_0xd370('0x29')](handleEntityNotFound(_0x4eeb33,null))[_0xd370('0x29')](respondWithResult(_0x4eeb33,null))['catch'](handleError(_0x4eeb33,null));};exports[_0xd370('0x49')]=function(_0x5c01f1,_0x5041b5){return db['Disposition']['create'](_0x5c01f1[_0xd370('0x4a')],{})[_0xd370('0x29')](function(_0x2ddd97){var _0x152122=_0x5c01f1['user']['get']({'plain':!![]});if(!_0x152122)throw new Error(_0xd370('0x4b'));if(_0x152122[_0xd370('0x4c')]===_0xd370('0x4d')){var _0xab2098=_0x2ddd97[_0xd370('0x2b')]({'plain':!![]});var _0x1fcea4=_0xd370('0x2c');return db['UserProfileSection'][_0xd370('0x48')]({'where':{'name':_0x1fcea4,'userProfileId':_0x152122['userProfileId']},'raw':!![]})[_0xd370('0x29')](function(_0x30b8f7){if(_0x30b8f7&&_0x30b8f7[_0xd370('0x4e')]===0x0){return db[_0xd370('0x4f')]['create']({'name':_0xab2098[_0xd370('0x2d')],'resourceId':_0xab2098['id'],'type':_0x30b8f7[_0xd370('0x2d')],'sectionId':_0x30b8f7['id']},{})['then'](function(){return _0x2ddd97;});}else{return _0x2ddd97;}})[_0xd370('0x46')](function(_0x1ef554){logger[_0xd370('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ef554);throw _0x1ef554;});}return _0x2ddd97;})['then'](respondWithResult(_0x5041b5,0xc9))[_0xd370('0x46')](handleError(_0x5041b5,null));};exports[_0xd370('0x28')]=function(_0x382fe7,_0x19f96c){if(_0x382fe7['body']['id']){delete _0x382fe7[_0xd370('0x4a')]['id'];}return db[_0xd370('0x2f')][_0xd370('0x48')]({'where':{'id':_0x382fe7['params']['id']}})['then'](handleEntityNotFound(_0x19f96c,null))[_0xd370('0x29')](saveUpdates(_0x382fe7[_0xd370('0x4a')],null))[_0xd370('0x29')](respondWithResult(_0x19f96c,null))[_0xd370('0x46')](handleError(_0x19f96c,null));};exports['destroy']=function(_0x2169dd,_0x1c2588){return db[_0xd370('0x2f')][_0xd370('0x48')]({'where':{'id':_0x2169dd[_0xd370('0x51')]['id']}})[_0xd370('0x29')](handleEntityNotFound(_0x1c2588,null))[_0xd370('0x29')](removeEntity(_0x1c2588,null))[_0xd370('0x46')](handleError(_0x1c2588,null));}; \ No newline at end of file +var _0x7c1a=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','Dispositions','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','type','key','model','keys','query','filters','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','intersection','fields','includeAll','find','create','body'];(function(_0x3b9909,_0x39cbd5){var _0x4419cd=function(_0x4458bf){while(--_0x4458bf){_0x3b9909['push'](_0x3b9909['shift']());}};_0x4419cd(++_0x39cbd5);}(_0x7c1a,0x159));var _0xa7c1=function(_0x1e647b,_0x359b5e){_0x1e647b=_0x1e647b-0x0;var _0x23b626=_0x7c1a[_0x1e647b];return _0x23b626;};'use strict';var emlformat=require(_0xa7c1('0x0'));var rimraf=require(_0xa7c1('0x1'));var zipdir=require(_0xa7c1('0x2'));var jsonpatch=require(_0xa7c1('0x3'));var rp=require(_0xa7c1('0x4'));var moment=require(_0xa7c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa7c1('0x6'));var util=require(_0xa7c1('0x7'));var path=require('path');var sox=require(_0xa7c1('0x8'));var csv=require('to-csv');var ejs=require(_0xa7c1('0x9'));var fs=require('fs');var fs_extra=require(_0xa7c1('0xa'));var _=require(_0xa7c1('0xb'));var squel=require(_0xa7c1('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa7c1('0xd'));var toCsv=require(_0xa7c1('0xe'));var querystring=require(_0xa7c1('0xf'));var Papa=require('papaparse');var Redis=require(_0xa7c1('0x10'));var authService=require(_0xa7c1('0x11'));var qs=require(_0xa7c1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7c1('0x13'));var logger=require(_0xa7c1('0x14'))('api');var utils=require(_0xa7c1('0x15'));var config=require(_0xa7c1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa7c1('0x17'))['db'];function respondWithStatusCode(_0x1d7d67,_0x26d63a){_0x26d63a=_0x26d63a||0xcc;return function(_0x3f5f02){if(_0x3f5f02){return _0x1d7d67[_0xa7c1('0x18')](_0x26d63a);}return _0x1d7d67[_0xa7c1('0x19')](_0x26d63a)[_0xa7c1('0x1a')]();};}function respondWithResult(_0xb74ba2,_0x3fc9e6){_0x3fc9e6=_0x3fc9e6||0xc8;return function(_0x21ce41){if(_0x21ce41){return _0xb74ba2[_0xa7c1('0x19')](_0x3fc9e6)[_0xa7c1('0x1b')](_0x21ce41);}};}function respondWithFilteredResult(_0xe28779,_0x5a0c8e){return function(_0xba02b){if(_0xba02b){var _0x3a6f47=typeof _0x5a0c8e[_0xa7c1('0x1c')]===_0xa7c1('0x1d')&&typeof _0x5a0c8e[_0xa7c1('0x1e')]==='undefined';var _0x3b77af=_0xba02b['count'];var _0x440251=_0x3a6f47?0x0:_0x5a0c8e[_0xa7c1('0x1c')];var _0x5dc8e3=_0x3a6f47?_0xba02b[_0xa7c1('0x1f')]:_0x5a0c8e[_0xa7c1('0x1c')]+_0x5a0c8e[_0xa7c1('0x1e')];var _0x5d3841;if(_0x5dc8e3>=_0x3b77af){_0x5dc8e3=_0x3b77af;_0x5d3841=0xc8;}else{_0x5d3841=0xce;}_0xe28779[_0xa7c1('0x19')](_0x5d3841);return _0xe28779[_0xa7c1('0x20')](_0xa7c1('0x21'),_0x440251+'-'+_0x5dc8e3+'/'+_0x3b77af)[_0xa7c1('0x1b')](_0xba02b);}return null;};}function patchUpdates(_0x3b131e){return function(_0x31c16a){try{jsonpatch[_0xa7c1('0x22')](_0x31c16a,_0x3b131e,!![]);}catch(_0xdfcbd9){return BPromise[_0xa7c1('0x23')](_0xdfcbd9);}return _0x31c16a['save']();};}function saveUpdates(_0x42ad46,_0x1c9b7c){return function(_0x1ebcdd){if(_0x1ebcdd){return _0x1ebcdd['update'](_0x42ad46)[_0xa7c1('0x24')](function(_0x7dbe77){return _0x7dbe77;});}return null;};}function removeEntity(_0x43d61f,_0x2dc42b){return function(_0x30cb15){if(_0x30cb15){return _0x30cb15[_0xa7c1('0x25')]()[_0xa7c1('0x24')](function(){var _0x53e490=_0x30cb15['get']({'plain':!![]});var _0x48280a=_0xa7c1('0x26');return db[_0xa7c1('0x27')][_0xa7c1('0x25')]({'where':{'type':_0x48280a,'resourceId':_0x53e490['id']}})[_0xa7c1('0x24')](function(){return _0x30cb15;});})[_0xa7c1('0x24')](function(){_0x43d61f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x465dd1,_0x2726e9){return function(_0xc60f7c){if(!_0xc60f7c){_0x465dd1['sendStatus'](0x194);}return _0xc60f7c;};}function handleError(_0x2c42b4,_0x9a6f55){_0x9a6f55=_0x9a6f55||0x1f4;return function(_0x2fe45b){logger[_0xa7c1('0x28')](_0x2fe45b[_0xa7c1('0x29')]);if(_0x2fe45b[_0xa7c1('0x2a')]){delete _0x2fe45b[_0xa7c1('0x2a')];}_0x2c42b4[_0xa7c1('0x19')](_0x9a6f55)[_0xa7c1('0x2b')](_0x2fe45b);};}exports[_0xa7c1('0x2c')]=function(_0x599b08,_0x6b764d){var _0x924b93={},_0x2a5d5c={},_0x40ad2b={'count':0x0,'rows':[]};var _0x216fd5=_[_0xa7c1('0x2d')](db[_0xa7c1('0x2e')][_0xa7c1('0x2f')],function(_0x42b5a1){return{'name':_0x42b5a1['fieldName'],'type':_0x42b5a1[_0xa7c1('0x30')][_0xa7c1('0x31')]};});_0x2a5d5c[_0xa7c1('0x32')]=_[_0xa7c1('0x2d')](_0x216fd5,'name');_0x2a5d5c['query']=_[_0xa7c1('0x33')](_0x599b08[_0xa7c1('0x34')]);_0x2a5d5c[_0xa7c1('0x35')]=_['intersection'](_0x2a5d5c['model'],_0x2a5d5c[_0xa7c1('0x34')]);_0x924b93[_0xa7c1('0x36')]=_['intersection'](_0x2a5d5c[_0xa7c1('0x32')],qs['fields'](_0x599b08[_0xa7c1('0x34')]['fields']));_0x924b93[_0xa7c1('0x36')]=_0x924b93[_0xa7c1('0x36')]['length']?_0x924b93['attributes']:_0x2a5d5c[_0xa7c1('0x32')];if(!_0x599b08[_0xa7c1('0x34')][_0xa7c1('0x37')](_0xa7c1('0x38'))){_0x924b93[_0xa7c1('0x1e')]=qs[_0xa7c1('0x1e')](_0x599b08[_0xa7c1('0x34')]['limit']);_0x924b93[_0xa7c1('0x1c')]=qs[_0xa7c1('0x1c')](_0x599b08[_0xa7c1('0x34')][_0xa7c1('0x1c')]);}_0x924b93[_0xa7c1('0x39')]=qs[_0xa7c1('0x3a')](_0x599b08['query'][_0xa7c1('0x3a')]);_0x924b93[_0xa7c1('0x3b')]=qs[_0xa7c1('0x35')](_[_0xa7c1('0x3c')](_0x599b08[_0xa7c1('0x34')],_0x2a5d5c[_0xa7c1('0x35')]),_0x216fd5);if(_0x599b08[_0xa7c1('0x34')][_0xa7c1('0x3d')]){_0x924b93['where']=_[_0xa7c1('0x3e')](_0x924b93[_0xa7c1('0x3b')],{'$or':_[_0xa7c1('0x2d')](_0x216fd5,function(_0x1822e8){if(_0x1822e8[_0xa7c1('0x30')]!==_0xa7c1('0x3f')){var _0x3e438b={};_0x3e438b[_0x1822e8[_0xa7c1('0x2a')]]={'$like':'%'+_0x599b08[_0xa7c1('0x34')][_0xa7c1('0x3d')]+'%'};return _0x3e438b;}})});}_0x924b93=_[_0xa7c1('0x3e')]({},_0x924b93,_0x599b08[_0xa7c1('0x40')]);var _0x24f152={'where':_0x924b93[_0xa7c1('0x3b')]};return db[_0xa7c1('0x2e')][_0xa7c1('0x1f')](_0x24f152)[_0xa7c1('0x24')](function(_0x4c0ef7){_0x40ad2b[_0xa7c1('0x1f')]=_0x4c0ef7;if(_0x599b08[_0xa7c1('0x34')]['includeAll']){_0x924b93[_0xa7c1('0x41')]=[{'all':!![]}];}return db[_0xa7c1('0x2e')][_0xa7c1('0x42')](_0x924b93);})[_0xa7c1('0x24')](function(_0x4a43c1){_0x40ad2b[_0xa7c1('0x43')]=_0x4a43c1;return _0x40ad2b;})['then'](respondWithFilteredResult(_0x6b764d,_0x924b93))['catch'](handleError(_0x6b764d,null));};exports[_0xa7c1('0x44')]=function(_0x1d131e,_0x3c1a72){var _0xdbc206={'raw':!![],'where':{'id':_0x1d131e['params']['id']}},_0x3a1b90={};_0x3a1b90[_0xa7c1('0x32')]=_[_0xa7c1('0x33')](db[_0xa7c1('0x2e')]['rawAttributes']);_0x3a1b90['query']=_[_0xa7c1('0x33')](_0x1d131e[_0xa7c1('0x34')]);_0x3a1b90['filters']=_[_0xa7c1('0x45')](_0x3a1b90[_0xa7c1('0x32')],_0x3a1b90[_0xa7c1('0x34')]);_0xdbc206[_0xa7c1('0x36')]=_[_0xa7c1('0x45')](_0x3a1b90['model'],qs[_0xa7c1('0x46')](_0x1d131e[_0xa7c1('0x34')][_0xa7c1('0x46')]));_0xdbc206[_0xa7c1('0x36')]=_0xdbc206[_0xa7c1('0x36')]['length']?_0xdbc206[_0xa7c1('0x36')]:_0x3a1b90[_0xa7c1('0x32')];if(_0x1d131e[_0xa7c1('0x34')][_0xa7c1('0x47')]){_0xdbc206[_0xa7c1('0x41')]=[{'all':!![]}];}_0xdbc206=_[_0xa7c1('0x3e')]({},_0xdbc206,_0x1d131e['options']);return db[_0xa7c1('0x2e')][_0xa7c1('0x48')](_0xdbc206)[_0xa7c1('0x24')](handleEntityNotFound(_0x3c1a72,null))[_0xa7c1('0x24')](respondWithResult(_0x3c1a72,null))['catch'](handleError(_0x3c1a72,null));};exports['create']=function(_0x33e535,_0x4b8da7){return db[_0xa7c1('0x2e')][_0xa7c1('0x49')](_0x33e535[_0xa7c1('0x4a')],{})['then'](function(_0x219197){var _0x4269a0=_0x33e535['user']['get']({'plain':!![]});if(!_0x4269a0)throw new Error(_0xa7c1('0x4b'));if(_0x4269a0[_0xa7c1('0x4c')]===_0xa7c1('0x4d')){var _0x4b58bb=_0x219197[_0xa7c1('0x4e')]({'plain':!![]});var _0x3c4819=_0xa7c1('0x26');return db[_0xa7c1('0x4f')][_0xa7c1('0x48')]({'where':{'name':_0x3c4819,'userProfileId':_0x4269a0['userProfileId']},'raw':!![]})['then'](function(_0x1a459c){if(_0x1a459c&&_0x1a459c[_0xa7c1('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x4b58bb[_0xa7c1('0x2a')],'resourceId':_0x4b58bb['id'],'type':_0x1a459c[_0xa7c1('0x2a')],'sectionId':_0x1a459c['id']},{})['then'](function(){return _0x219197;});}else{return _0x219197;}})[_0xa7c1('0x51')](function(_0x53c506){logger['error'](_0xa7c1('0x52'),_0x53c506);throw _0x53c506;});}return _0x219197;})[_0xa7c1('0x24')](respondWithResult(_0x4b8da7,0xc9))[_0xa7c1('0x51')](handleError(_0x4b8da7,null));};exports['update']=function(_0x33db7d,_0x507cd8){if(_0x33db7d[_0xa7c1('0x4a')]['id']){delete _0x33db7d[_0xa7c1('0x4a')]['id'];}return db['Disposition'][_0xa7c1('0x48')]({'where':{'id':_0x33db7d['params']['id']}})[_0xa7c1('0x24')](handleEntityNotFound(_0x507cd8,null))[_0xa7c1('0x24')](saveUpdates(_0x33db7d['body'],null))[_0xa7c1('0x24')](respondWithResult(_0x507cd8,null))['catch'](handleError(_0x507cd8,null));};exports[_0xa7c1('0x25')]=function(_0x154305,_0x2da015){return db[_0xa7c1('0x2e')]['find']({'where':{'id':_0x154305[_0xa7c1('0x53')]['id']}})[_0xa7c1('0x24')](handleEntityNotFound(_0x2da015,null))['then'](removeEntity(_0x2da015,null))['catch'](handleError(_0x2da015,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index e747306..d661ab8 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 _0x7eb1=['SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Disposition','tools_dispositions','name_voice','ListId','name','ChatWebsiteId','MailAccountId','name_sms'];(function(_0xcffae0,_0x1f70ca){var _0x24f329=function(_0x228238){while(--_0x228238){_0xcffae0['push'](_0xcffae0['shift']());}};_0x24f329(++_0x1f70ca);}(_0x7eb1,0x1ce));var _0x17eb=function(_0x2b59db,_0x2fd753){_0x2b59db=_0x2b59db-0x0;var _0x1b8a3b=_0x7eb1[_0x2b59db];return _0x1b8a3b;};'use strict';var _=require(_0x17eb('0x0'));var util=require(_0x17eb('0x1'));var logger=require(_0x17eb('0x2'))('api');var moment=require(_0x17eb('0x3'));var BPromise=require(_0x17eb('0x4'));var rp=require(_0x17eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17eb('0x6'));var config=require(_0x17eb('0x7'));var attributes=require('./disposition.attributes');module[_0x17eb('0x8')]=function(_0x1ed7eb,_0x23900c){return _0x1ed7eb[_0x17eb('0x9')](_0x17eb('0xa'),attributes,{'tableName':_0x17eb('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x17eb('0xc'),'fields':['name',_0x17eb('0xd')]},{'unique':!![],'name':'name_chat','fields':[_0x17eb('0xe'),_0x17eb('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0x17eb('0xe'),_0x17eb('0x10')]},{'unique':!![],'name':_0x17eb('0x11'),'fields':[_0x17eb('0xe'),_0x17eb('0x12')]},{'unique':!![],'name':_0x17eb('0x13'),'fields':['name',_0x17eb('0x14')]},{'unique':!![],'name':'name_openchannel','fields':[_0x17eb('0xe'),_0x17eb('0x15')]},{'unique':!![],'name':_0x17eb('0x16'),'fields':[_0x17eb('0xe'),_0x17eb('0x17')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd68b=['define','Disposition','name_voice','name','ListId','name_sms','name_fax','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./disposition.attributes'];(function(_0x283428,_0x5cd704){var _0x58a493=function(_0x3a879f){while(--_0x3a879f){_0x283428['push'](_0x283428['shift']());}};_0x58a493(++_0x5cd704);}(_0xd68b,0x8f));var _0xbd68=function(_0x3af6d3,_0xd6ff2e){_0x3af6d3=_0x3af6d3-0x0;var _0xf0c5a8=_0xd68b[_0x3af6d3];return _0xf0c5a8;};'use strict';var _=require(_0xbd68('0x0'));var util=require(_0xbd68('0x1'));var logger=require(_0xbd68('0x2'))(_0xbd68('0x3'));var moment=require(_0xbd68('0x4'));var BPromise=require(_0xbd68('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd68('0x6'));var rimraf=require(_0xbd68('0x7'));var config=require('../../config/environment');var attributes=require(_0xbd68('0x8'));module['exports']=function(_0x6c3bd0,_0x17e22c){return _0x6c3bd0[_0xbd68('0x9')](_0xbd68('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xbd68('0xb'),'fields':[_0xbd68('0xc'),_0xbd68('0xd')]},{'unique':!![],'name':'name_chat','fields':[_0xbd68('0xc'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':['name','MailAccountId']},{'unique':!![],'name':_0xbd68('0xe'),'fields':[_0xbd68('0xc'),'SmsAccountId']},{'unique':!![],'name':_0xbd68('0xf'),'fields':[_0xbd68('0xc'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0xbd68('0xc'),_0xbd68('0x10')]},{'unique':!![],'name':_0xbd68('0x11'),'fields':['name',_0xbd68('0x12')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 9db1c2d..4d807d9 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(_0x55d989,_0x3b6c5b){var _0x3632ab=function(_0x3ffc28){while(--_0x3ffc28){_0x55d989['push'](_0x55d989['shift']());}};_0x3632ab(++_0x3b6c5b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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(_0x214603,_0x5b1286){var _0x43e175=function(_0x44daa4){while(--_0x44daa4){_0x214603['push'](_0x214603['shift']());}};_0x43e175(++_0x5b1286);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 dea5cb5..f737966 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 _0x55b9=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','delete'];(function(_0x4a5d41,_0x158625){var _0x21141b=function(_0x36446d){while(--_0x36446d){_0x4a5d41['push'](_0x4a5d41['shift']());}};_0x21141b(++_0x158625);}(_0x55b9,0x80));var _0x955b=function(_0x3cd5d0,_0x6eab1b){_0x3cd5d0=_0x3cd5d0-0x0;var _0x1f5286=_0x55b9[_0x3cd5d0];return _0x1f5286;};'use strict';var multer=require('multer');var util=require(_0x955b('0x0'));var path=require(_0x955b('0x1'));var timeout=require(_0x955b('0x2'));var express=require(_0x955b('0x3'));var router=express[_0x955b('0x4')]();var fs_extra=require(_0x955b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x955b('0x6'));var controller=require(_0x955b('0x7'));router[_0x955b('0x8')]('/',auth[_0x955b('0x9')](),controller[_0x955b('0xa')]);router[_0x955b('0x8')](_0x955b('0xb'),auth['isAuthenticated'](),controller[_0x955b('0xc')]);router[_0x955b('0xd')]('/',auth[_0x955b('0x9')](),controller[_0x955b('0xe')]);router['put']('/:id',auth[_0x955b('0x9')](),controller['update']);router[_0x955b('0xf')](_0x955b('0xb'),auth['isAuthenticated'](),controller[_0x955b('0x10')]);module[_0x955b('0x11')]=router; \ No newline at end of file +var _0xd24e=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','index','/:id','isAuthenticated','show','post','update','delete','destroy'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xd24e,0x1a2));var _0xed24=function(_0xd2ea80,_0x518b7a){_0xd2ea80=_0xd2ea80-0x0;var _0x1ef457=_0xd24e[_0xd2ea80];return _0x1ef457;};'use strict';var multer=require(_0xed24('0x0'));var util=require(_0xed24('0x1'));var path=require(_0xed24('0x2'));var timeout=require(_0xed24('0x3'));var express=require('express');var router=express[_0xed24('0x4')]();var fs_extra=require(_0xed24('0x5'));var auth=require(_0xed24('0x6'));var interaction=require(_0xed24('0x7'));var config=require(_0xed24('0x8'));var controller=require(_0xed24('0x9'));router[_0xed24('0xa')]('/',auth['isAuthenticated'](),controller[_0xed24('0xb')]);router[_0xed24('0xa')](_0xed24('0xc'),auth[_0xed24('0xd')](),controller[_0xed24('0xe')]);router[_0xed24('0xf')]('/',auth[_0xed24('0xd')](),controller['create']);router['put'](_0xed24('0xc'),auth[_0xed24('0xd')](),controller[_0xed24('0x10')]);router[_0xed24('0x11')](_0xed24('0xc'),auth[_0xed24('0xd')](),controller[_0xed24('0x12')]);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 2a08ff1..27c45c6 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 _0x5fab=['12000','14400','4800','v17,v27,v29','INTEGER','IAX','DADHI','SIP','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','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','9600'];(function(_0x25efc1,_0x562953){var _0x2b55f1=function(_0x1cb20c){while(--_0x1cb20c){_0x25efc1['push'](_0x25efc1['shift']());}};_0x2b55f1(++_0x562953);}(_0x5fab,0x177));var _0xb5fa=function(_0x3bc158,_0x436e3a){_0x3bc158=_0x3bc158-0x0;var _0x977671=_0x5fab[_0x3bc158];return _0x977671;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb5fa('0x2')]},'ecm':{'type':Sequelize[_0xb5fa('0x3')](_0xb5fa('0x4'),'no'),'defaultValue':_0xb5fa('0x4')},'headerinfo':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':_0xb5fa('0x5')},'localstationid':{'type':Sequelize[_0xb5fa('0x2')],'unique':_0xb5fa('0x6')},'minrate':{'type':Sequelize[_0xb5fa('0x3')](_0xb5fa('0x7'),'4800','7200',_0xb5fa('0x8'),_0xb5fa('0x9'),_0xb5fa('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xb5fa('0x3')](_0xb5fa('0x7'),_0xb5fa('0xb'),'7200','9600',_0xb5fa('0x9'),_0xb5fa('0xa')),'defaultValue':_0xb5fa('0xa')},'modem':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':_0xb5fa('0xc')},'gateway':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xb5fa('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xb5fa('0x3')]('SIP',_0xb5fa('0xe'),_0xb5fa('0xf'),'KHOMP'),'defaultValue':_0xb5fa('0x10')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb5fa('0x11')],'defaultValue':function(){return _0xb5fa('0x12');}},'notificationSound':{'type':Sequelize[_0xb5fa('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb5fa('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb5fa('0xd')],'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[_0xb5fa('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb5fa('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb5fa('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb5fa('0xd')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb5fa('0x14'),'set':function(_0x1f7f05){if(!_0x1f7f05)this[_0xb5fa('0x15')](_0xb5fa('0x16'),null);this[_0xb5fa('0x15')](_0xb5fa('0x17'),_0x1f7f05);}}}; \ No newline at end of file +var _0x6b8f=['KHOMP','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','exports','STRING','yes','localstationid','ENUM','4800','7200','9600','12000','14400','INTEGER','SIP'];(function(_0x4f2c69,_0x528c29){var _0x29db31=function(_0x5f3081){while(--_0x5f3081){_0x4f2c69['push'](_0x4f2c69['shift']());}};_0x29db31(++_0x528c29);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x457a02,_0x198a1b){_0x457a02=_0x457a02-0x0;var _0x432698=_0x6b8f[_0x457a02];return _0x432698;};'use strict';var Sequelize=require('sequelize');module[_0xf6b8('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf6b8('0x1')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xf6b8('0x2')},'headerinfo':{'type':Sequelize[_0xf6b8('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xf6b8('0x1')],'unique':_0xf6b8('0x3')},'minrate':{'type':Sequelize[_0xf6b8('0x4')]('2400',_0xf6b8('0x5'),_0xf6b8('0x6'),_0xf6b8('0x7'),_0xf6b8('0x8'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xf6b8('0x4')]('2400',_0xf6b8('0x5'),_0xf6b8('0x6'),_0xf6b8('0x7'),_0xf6b8('0x8'),_0xf6b8('0x9')),'defaultValue':_0xf6b8('0x9')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xf6b8('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xf6b8('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xf6b8('0x4')](_0xf6b8('0xb'),'IAX','DADHI',_0xf6b8('0xc')),'defaultValue':_0xf6b8('0xb')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf6b8('0xd')],'defaultValue':function(){return _0xf6b8('0xe');}},'notificationSound':{'type':Sequelize[_0xf6b8('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf6b8('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf6b8('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf6b8('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf6b8('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf6b8('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf6b8('0xa')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf6b8('0x10'),'set':function(_0x56508b){if(!_0x56508b)this[_0xf6b8('0x11')](_0xf6b8('0x12'),null);this['setDataValue']('mandatoryDisposition',_0x56508b);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 7b13bea..5822da1 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 _0x253a=['Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','info','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','end','stack','send','map','FaxAccount','rawAttributes','fieldName','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','show','Pause','mandatoryDispositionPause','body','user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','fullname','internal','Tag','Tags','tag','addApplications','transaction','Transaction','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','type','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','ecm','gateway','faxdetect','headerinfo','maxrate','modem','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','sequelize','updateAccountApplications','VoiceExtension','tech','key','createdAt','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','Contacts','defaults','List\x20not\x20found','Send\x20Fax\x20failed','filename'];(function(_0x23b6db,_0x200f94){var _0x44082c=function(_0x80f609){while(--_0x80f609){_0x23b6db['push'](_0x23b6db['shift']());}};_0x44082c(++_0x200f94);}(_0x253a,0x1a4));var _0xa253=function(_0x40ea63,_0x45b9be){_0x40ea63=_0x40ea63-0x0;var _0x25d72b=_0x253a[_0x40ea63];return _0x25d72b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa253('0x0'));var zipdir=require(_0xa253('0x1'));var jsonpatch=require(_0xa253('0x2'));var rp=require(_0xa253('0x3'));var moment=require(_0xa253('0x4'));var BPromise=require(_0xa253('0x5'));var Mustache=require(_0xa253('0x6'));var util=require('util');var path=require(_0xa253('0x7'));var sox=require(_0xa253('0x8'));var csv=require(_0xa253('0x9'));var ejs=require(_0xa253('0xa'));var fs=require('fs');var fs_extra=require(_0xa253('0xb'));var _=require('lodash');var squel=require(_0xa253('0xc'));var crypto=require(_0xa253('0xd'));var jsforce=require(_0xa253('0xe'));var deskjs=require(_0xa253('0xf'));var toCsv=require(_0xa253('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa253('0x10'));var authService=require(_0xa253('0x11'));var qs=require(_0xa253('0x12'));var as=require(_0xa253('0x13'));var hardwareService=require(_0xa253('0x14'));var logger=require('../../config/logger')(_0xa253('0x15'));var utils=require(_0xa253('0x16'));var config=require(_0xa253('0x17'));var licenseUtil=require(_0xa253('0x18'));var db=require('../../mysqldb')['db'];config[_0xa253('0x19')]=_['defaults'](config[_0xa253('0x19')],{'host':_0xa253('0x1a'),'port':0x18eb});var socket=require(_0xa253('0x1b'))(new Redis(config[_0xa253('0x19')]));require(_0xa253('0x1c'))[_0xa253('0x1d')](socket);var jayson=require(_0xa253('0x1e'));var client=jayson[_0xa253('0x1f')][_0xa253('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xa253('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x54f40e,_0x47186a,_0x242079,_0x4aaaad){return new BPromise(function(_0x2b8629,_0x187d09){var _0x153bbb=_0x4aaaad||client;return _0x153bbb[_0xa253('0x21')](_0x54f40e,_0x242079)[_0xa253('0x22')](function(_0x5e25b0){logger['info']('FaxAccount,\x20%s,\x20%s',_0x47186a,_0xa253('0x23'));logger[_0xa253('0x24')](_0xa253('0x25'),_0x47186a,_0xa253('0x23'),JSON['stringify'](_0x5e25b0));if(_0x5e25b0['error']){if(_0x5e25b0[_0xa253('0x26')][_0xa253('0x27')]===0x1f4){logger[_0xa253('0x26')](_0xa253('0x28'),_0x47186a,_0x5e25b0[_0xa253('0x26')][_0xa253('0x29')]);return _0x187d09(_0x5e25b0[_0xa253('0x26')][_0xa253('0x29')]);}logger[_0xa253('0x26')](_0xa253('0x28'),_0x47186a,_0x5e25b0[_0xa253('0x26')]['message']);return _0x2b8629(_0x5e25b0[_0xa253('0x26')]['message']);}else{logger['info'](_0xa253('0x28'),_0x47186a,_0xa253('0x23'));_0x2b8629(_0x5e25b0[_0xa253('0x2a')][_0xa253('0x29')]);}})[_0xa253('0x2b')](function(_0x20f2ea){logger[_0xa253('0x26')]('FaxAccount,\x20%s,\x20%s',_0x47186a,_0x20f2ea);_0x187d09(_0x20f2ea);});});}function respondWithStatusCode(_0x50afcc,_0x14ae41){_0x14ae41=_0x14ae41||0xcc;return function(_0x42aec5){if(_0x42aec5){return _0x50afcc[_0xa253('0x2c')](_0x14ae41);}return _0x50afcc[_0xa253('0x2d')](_0x14ae41)['end']();};}function respondWithResult(_0x24da77,_0x409f80){_0x409f80=_0x409f80||0xc8;return function(_0x310887){if(_0x310887){return _0x24da77[_0xa253('0x2d')](_0x409f80)[_0xa253('0x2e')](_0x310887);}};}function respondWithFilteredResult(_0x19aa3b,_0x5465e5){return function(_0x246f30){if(_0x246f30){var _0x29a934=typeof _0x5465e5['offset']===_0xa253('0x2f')&&typeof _0x5465e5[_0xa253('0x30')]===_0xa253('0x2f');var _0x1d8cfc=_0x246f30['count'];var _0x8b8f55=_0x29a934?0x0:_0x5465e5[_0xa253('0x31')];var _0x5884af=_0x29a934?_0x246f30[_0xa253('0x32')]:_0x5465e5[_0xa253('0x31')]+_0x5465e5[_0xa253('0x30')];var _0x909c5a;if(_0x5884af>=_0x1d8cfc){_0x5884af=_0x1d8cfc;_0x909c5a=0xc8;}else{_0x909c5a=0xce;}_0x19aa3b[_0xa253('0x2d')](_0x909c5a);return _0x19aa3b[_0xa253('0x33')](_0xa253('0x34'),_0x8b8f55+'-'+_0x5884af+'/'+_0x1d8cfc)[_0xa253('0x2e')](_0x246f30);}return null;};}function patchUpdates(_0x6158ec){return function(_0x656315){try{jsonpatch[_0xa253('0x35')](_0x656315,_0x6158ec,!![]);}catch(_0x11fdb1){return BPromise[_0xa253('0x36')](_0x11fdb1);}return _0x656315[_0xa253('0x37')]();};}function saveUpdates(_0x22e680,_0x3ebaeb){return function(_0x5c5008){if(_0x5c5008){return _0x5c5008[_0xa253('0x38')](_0x22e680)[_0xa253('0x22')](function(_0x1375d2){return _0x1375d2;});}return null;};}function removeEntity(_0x1c9dde,_0x53d419){return function(_0x4c33cc){if(_0x4c33cc){return _0x4c33cc[_0xa253('0x39')]()[_0xa253('0x22')](function(){var _0x5bc188=_0x4c33cc[_0xa253('0x3a')]({'plain':!![]});var _0x52eb9a=_0xa253('0x3b');return db[_0xa253('0x3c')][_0xa253('0x39')]({'where':{'type':_0x52eb9a,'resourceId':_0x5bc188['id']}})[_0xa253('0x22')](function(){return _0x4c33cc;});})[_0xa253('0x22')](function(){_0x1c9dde[_0xa253('0x2d')](0xcc)[_0xa253('0x3d')]();});}};}function handleEntityNotFound(_0xffc38d,_0x5eb4a0){return function(_0xc1a378){if(!_0xc1a378){_0xffc38d['sendStatus'](0x194);}return _0xc1a378;};}function handleError(_0x235ff2,_0x1ceb47){_0x1ceb47=_0x1ceb47||0x1f4;return function(_0x4f0da7){logger[_0xa253('0x26')](_0x4f0da7[_0xa253('0x3e')]);if(_0x4f0da7['name']){delete _0x4f0da7['name'];}_0x235ff2['status'](_0x1ceb47)[_0xa253('0x3f')](_0x4f0da7);};}exports['index']=function(_0x232a98,_0x348886){var _0x55fd88={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x57bd20={},_0x1b91fb={'count':0x0,'rows':[]};var _0x25c35b=_[_0xa253('0x40')](db[_0xa253('0x41')][_0xa253('0x42')],function(_0x3729f7){return{'name':_0x3729f7[_0xa253('0x43')],'type':_0x3729f7['type']['key']};});_0x57bd20[_0xa253('0x44')]=_[_0xa253('0x40')](_0x25c35b,_0xa253('0x45'));_0x57bd20[_0xa253('0x46')]=_[_0xa253('0x47')](_0x232a98[_0xa253('0x46')]);_0x57bd20['filters']=_['intersection'](_0x57bd20[_0xa253('0x44')],_0x57bd20[_0xa253('0x46')]);_0x55fd88[_0xa253('0x48')]=_[_0xa253('0x49')](_0x57bd20[_0xa253('0x44')],qs[_0xa253('0x4a')](_0x232a98[_0xa253('0x46')][_0xa253('0x4a')]));_0x55fd88['attributes']=_0x55fd88[_0xa253('0x48')][_0xa253('0x4b')]?_0x55fd88['attributes']:_0x57bd20[_0xa253('0x44')];if(!_0x232a98[_0xa253('0x46')][_0xa253('0x4c')](_0xa253('0x4d'))){_0x55fd88['limit']=qs[_0xa253('0x30')](_0x232a98[_0xa253('0x46')][_0xa253('0x30')]);_0x55fd88['offset']=qs[_0xa253('0x31')](_0x232a98['query'][_0xa253('0x31')]);}_0x55fd88[_0xa253('0x4e')]=qs[_0xa253('0x4f')](_0x232a98['query'][_0xa253('0x4f')]);_0x55fd88[_0xa253('0x50')]=qs['filters'](_[_0xa253('0x51')](_0x232a98[_0xa253('0x46')],_0x57bd20[_0xa253('0x52')]),_0x25c35b);if(_0x232a98[_0xa253('0x46')][_0xa253('0x53')]){_0x55fd88[_0xa253('0x50')]=_[_0xa253('0x54')](_0x55fd88['where'],{'$or':_[_0xa253('0x40')](_0x25c35b,function(_0x2b6520){if(_0x2b6520['type']!=='VIRTUAL'){var _0x42a903={};_0x42a903[_0x2b6520[_0xa253('0x45')]]={'$like':'%'+_0x232a98[_0xa253('0x46')][_0xa253('0x53')]+'%'};return _0x42a903;}})});}_0x55fd88=_['merge']({},_0x55fd88,_0x232a98[_0xa253('0x55')]);var _0x5b6f3b={'where':_0x55fd88['where']};return db['FaxAccount'][_0xa253('0x32')](_0x5b6f3b)[_0xa253('0x22')](function(_0x31afb4){_0x1b91fb['count']=_0x31afb4;if(_0x232a98['query'][_0xa253('0x56')]){_0x55fd88[_0xa253('0x57')]=[{'all':!![]}];}return db[_0xa253('0x41')][_0xa253('0x58')](_0x55fd88);})['then'](function(_0x2eadc8){_0x1b91fb[_0xa253('0x59')]=_0x2eadc8;return _0x1b91fb;})[_0xa253('0x22')](respondWithFilteredResult(_0x348886,_0x55fd88))[_0xa253('0x2b')](handleError(_0x348886,null));};exports[_0xa253('0x5a')]=function(_0x2fd988,_0xf5dd25){var _0x995bc0={'raw':![],'where':{'id':_0x2fd988['params']['id']},'include':[{'model':db[_0xa253('0x5b')],'as':_0xa253('0x5c')}]},_0xd78060={};_0xd78060[_0xa253('0x44')]=_['keys'](db['FaxAccount']['rawAttributes']);_0xd78060['query']=_[_0xa253('0x47')](_0x2fd988[_0xa253('0x46')]);_0xd78060[_0xa253('0x52')]=_[_0xa253('0x49')](_0xd78060[_0xa253('0x44')],_0xd78060[_0xa253('0x46')]);_0x995bc0[_0xa253('0x48')]=_[_0xa253('0x49')](_0xd78060[_0xa253('0x44')],qs[_0xa253('0x4a')](_0x2fd988[_0xa253('0x46')][_0xa253('0x4a')]));_0x995bc0[_0xa253('0x48')]=_0x995bc0[_0xa253('0x48')][_0xa253('0x4b')]?_0x995bc0[_0xa253('0x48')]:_0xd78060[_0xa253('0x44')];if(_0x2fd988['query'][_0xa253('0x56')]){_0x995bc0[_0xa253('0x57')]=[{'all':!![]}];}_0x995bc0=_[_0xa253('0x54')]({},_0x995bc0,_0x2fd988[_0xa253('0x55')]);return db[_0xa253('0x41')]['find'](_0x995bc0)[_0xa253('0x22')](handleEntityNotFound(_0xf5dd25,null))[_0xa253('0x22')](respondWithResult(_0xf5dd25,null))['catch'](handleError(_0xf5dd25,null));};exports['create']=function(_0xfdbaf,_0x3aeb29){return db['FaxAccount']['create'](_0xfdbaf[_0xa253('0x5d')],{})[_0xa253('0x22')](function(_0x15f89d){var _0x205a18=_0xfdbaf[_0xa253('0x5e')][_0xa253('0x3a')]({'plain':!![]});if(!_0x205a18)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x205a18[_0xa253('0x5f')]==='user'){var _0x467bb0=_0x15f89d['get']({'plain':!![]});var _0x5743c3=_0xa253('0x3b');return db[_0xa253('0x60')]['find']({'where':{'name':_0x5743c3,'userProfileId':_0x205a18[_0xa253('0x61')]},'raw':!![]})[_0xa253('0x22')](function(_0x3b6d8b){if(_0x3b6d8b&&_0x3b6d8b['autoAssociation']===0x0){return db[_0xa253('0x3c')][_0xa253('0x62')]({'name':_0x467bb0[_0xa253('0x45')],'resourceId':_0x467bb0['id'],'type':_0x3b6d8b[_0xa253('0x45')],'sectionId':_0x3b6d8b['id']},{})[_0xa253('0x22')](function(){return _0x15f89d;});}else{return _0x15f89d;}})[_0xa253('0x2b')](function(_0x4b270f){logger[_0xa253('0x26')](_0xa253('0x63'),_0x4b270f);throw _0x4b270f;});}return _0x15f89d;})[_0xa253('0x22')](respondWithResult(_0x3aeb29,0xc9))[_0xa253('0x2b')](handleError(_0x3aeb29,null));};exports[_0xa253('0x38')]=function(_0x5da6fa,_0x46b75e){if(_0x5da6fa[_0xa253('0x5d')]['id']){delete _0x5da6fa[_0xa253('0x5d')]['id'];}return db[_0xa253('0x41')][_0xa253('0x64')]({'where':{'id':_0x5da6fa[_0xa253('0x65')]['id']},'include':[{'model':db[_0xa253('0x5b')],'as':_0xa253('0x5c')}]})['then'](handleEntityNotFound(_0x46b75e,null))[_0xa253('0x22')](saveUpdates(_0x5da6fa['body'],null))['then'](respondWithResult(_0x46b75e,null))[_0xa253('0x2b')](handleError(_0x46b75e,null));};exports[_0xa253('0x39')]=function(_0x232d34,_0x2d32b6){return db['FaxAccount']['find']({'where':{'id':_0x232d34['params']['id']}})[_0xa253('0x22')](handleEntityNotFound(_0x2d32b6,null))['then'](removeEntity(_0x2d32b6,null))[_0xa253('0x2b')](handleError(_0x2d32b6,null));};exports[_0xa253('0x66')]=function(_0x584588,_0x22429a){return db['FaxAccount'][_0xa253('0x66')]()[_0xa253('0x22')](respondWithResult(_0x22429a,null))[_0xa253('0x2b')](handleError(_0x22429a,null));};exports[_0xa253('0x67')]=function(_0x43ce1e,_0x310d00,_0x5ac3ec){if(_0x43ce1e[_0xa253('0x5d')]['id']){delete _0x43ce1e[_0xa253('0x5d')]['id'];}return db[_0xa253('0x41')][_0xa253('0x64')]({'where':{'id':_0x43ce1e['params']['id']}})[_0xa253('0x22')](handleEntityNotFound(_0x310d00,null))[_0xa253('0x22')](function(_0x331fca){if(_0x331fca){_0x43ce1e[_0xa253('0x5d')][_0xa253('0x68')]=_0x331fca['id'];return db[_0xa253('0x69')][_0xa253('0x62')](_0x43ce1e['body']);}})[_0xa253('0x22')](respondWithResult(_0x310d00,null))[_0xa253('0x2b')](handleError(_0x310d00,null));};exports[_0xa253('0x6a')]=function(_0x38e0eb,_0x3f4d0f,_0x37f6ba){var _0x1b86d4={'raw':![],'where':{}};var _0x2c5365={};var _0x23a288={'count':0x0,'rows':[]};return db[_0xa253('0x41')][_0xa253('0x6b')]({'where':{'id':_0x38e0eb[_0xa253('0x65')]['id']}})['then'](handleEntityNotFound(_0x3f4d0f,null))[_0xa253('0x22')](function(_0x12d68c){if(_0x12d68c){_0x2c5365['model']=_['keys'](db[_0xa253('0x69')]['rawAttributes']);_0x2c5365['query']=_[_0xa253('0x47')](_0x38e0eb[_0xa253('0x46')]);_0x2c5365['filters']=_[_0xa253('0x49')](_0x2c5365['model'],_0x2c5365[_0xa253('0x46')]);_0x1b86d4['attributes']=_[_0xa253('0x49')](_0x2c5365[_0xa253('0x44')],qs['fields'](_0x38e0eb[_0xa253('0x46')]['fields']));_0x1b86d4[_0xa253('0x48')]=_0x1b86d4['attributes'][_0xa253('0x4b')]?_0x1b86d4[_0xa253('0x48')]:_0x2c5365['model'];if(!_0x38e0eb[_0xa253('0x46')]['hasOwnProperty'](_0xa253('0x4d'))){_0x1b86d4[_0xa253('0x30')]=qs[_0xa253('0x30')](_0x38e0eb['query'][_0xa253('0x30')]);_0x1b86d4['offset']=qs[_0xa253('0x31')](_0x38e0eb[_0xa253('0x46')][_0xa253('0x31')]);}_0x1b86d4[_0xa253('0x4e')]=qs['sort'](_0x38e0eb[_0xa253('0x46')]['sort']);_0x1b86d4[_0xa253('0x50')]=qs[_0xa253('0x52')](_[_0xa253('0x51')](_0x38e0eb[_0xa253('0x46')],_0x2c5365[_0xa253('0x52')]));_0x1b86d4[_0xa253('0x50')][_0xa253('0x68')]=_0x12d68c['id'];if(_0x38e0eb['query'][_0xa253('0x53')]){_0x1b86d4[_0xa253('0x50')]=_[_0xa253('0x54')](_0x1b86d4['where'],{'$or':_[_0xa253('0x40')](_0x1b86d4['attributes'],function(_0x2e939a){var _0x17095b={};_0x17095b[_0x2e939a]={'$like':'%'+_0x38e0eb[_0xa253('0x46')][_0xa253('0x53')]+'%'};return _0x17095b;})});}_0x1b86d4=_[_0xa253('0x54')]({},_0x1b86d4,_0x38e0eb[_0xa253('0x55')]);return db[_0xa253('0x69')][_0xa253('0x32')]({'where':_0x1b86d4[_0xa253('0x50')]})[_0xa253('0x22')](function(_0x5b8091){_0x23a288[_0xa253('0x32')]=_0x5b8091;if(_0x38e0eb['query'][_0xa253('0x56')]){_0x1b86d4[_0xa253('0x57')]=[{'all':!![]}];}return db[_0xa253('0x69')][_0xa253('0x58')](_0x1b86d4);})[_0xa253('0x22')](function(_0x42fd54){_0x23a288[_0xa253('0x59')]=_0x42fd54;return _0x23a288;});}})[_0xa253('0x22')](respondWithFilteredResult(_0x3f4d0f,_0x1b86d4))[_0xa253('0x2b')](handleError(_0x3f4d0f,null));};exports[_0xa253('0x6c')]=function(_0xf9090a,_0x3cab84,_0x22f3f5){return db[_0xa253('0x41')][_0xa253('0x64')]({'where':{'id':_0xf9090a['params']['id']}})[_0xa253('0x22')](handleEntityNotFound(_0x3cab84,null))[_0xa253('0x22')](function(_0xe2616e){if(_0xe2616e){return _0xe2616e[_0xa253('0x6c')](_0xf9090a[_0xa253('0x46')][_0xa253('0x6d')]);}})[_0xa253('0x22')](respondWithStatusCode(_0x3cab84,null))[_0xa253('0x2b')](handleError(_0x3cab84,null));};exports[_0xa253('0x6e')]=function(_0x397ce9,_0x7cb2b3,_0x119c34){if(_0x397ce9['body']['id']){delete _0x397ce9[_0xa253('0x5d')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x397ce9[_0xa253('0x65')]['id']}})[_0xa253('0x22')](handleEntityNotFound(_0x7cb2b3,null))[_0xa253('0x22')](function(_0x10d0f8){if(_0x10d0f8){_0x397ce9[_0xa253('0x5d')][_0xa253('0x68')]=_0x10d0f8['id'];return db['CannedAnswer'][_0xa253('0x62')](_0x397ce9[_0xa253('0x5d')]);}})[_0xa253('0x22')](respondWithResult(_0x7cb2b3,null))[_0xa253('0x2b')](handleError(_0x7cb2b3,null));};exports[_0xa253('0x6f')]=function(_0xb67e09,_0x2ee0fb,_0x5b6bdf){var _0x948adf={'raw':![],'where':{}};var _0x42221f={};var _0x50f3d5={'count':0x0,'rows':[]};return db[_0xa253('0x41')][_0xa253('0x6b')]({'where':{'id':_0xb67e09['params']['id']}})[_0xa253('0x22')](handleEntityNotFound(_0x2ee0fb,null))[_0xa253('0x22')](function(_0x2f8546){if(_0x2f8546){_0x42221f['model']=_[_0xa253('0x47')](db[_0xa253('0x70')][_0xa253('0x42')]);_0x42221f['query']=_['keys'](_0xb67e09[_0xa253('0x46')]);_0x42221f['filters']=_[_0xa253('0x49')](_0x42221f['model'],_0x42221f[_0xa253('0x46')]);_0x948adf['attributes']=_[_0xa253('0x49')](_0x42221f[_0xa253('0x44')],qs[_0xa253('0x4a')](_0xb67e09[_0xa253('0x46')][_0xa253('0x4a')]));_0x948adf[_0xa253('0x48')]=_0x948adf[_0xa253('0x48')]['length']?_0x948adf[_0xa253('0x48')]:_0x42221f[_0xa253('0x44')];if(!_0xb67e09[_0xa253('0x46')][_0xa253('0x4c')](_0xa253('0x4d'))){_0x948adf[_0xa253('0x30')]=qs[_0xa253('0x30')](_0xb67e09[_0xa253('0x46')][_0xa253('0x30')]);_0x948adf[_0xa253('0x31')]=qs[_0xa253('0x31')](_0xb67e09['query']['offset']);}_0x948adf[_0xa253('0x4e')]=qs[_0xa253('0x4f')](_0xb67e09['query'][_0xa253('0x4f')]);_0x948adf[_0xa253('0x50')]=qs[_0xa253('0x52')](_['pick'](_0xb67e09[_0xa253('0x46')],_0x42221f['filters']));_0x948adf['where'][_0xa253('0x68')]=_0x2f8546['id'];if(_0xb67e09[_0xa253('0x46')]['filter']){_0x948adf['where']=_[_0xa253('0x54')](_0x948adf[_0xa253('0x50')],{'$or':_[_0xa253('0x40')](_0x948adf[_0xa253('0x48')],function(_0x53ace0){var _0x149ace={};_0x149ace[_0x53ace0]={'$like':'%'+_0xb67e09[_0xa253('0x46')][_0xa253('0x53')]+'%'};return _0x149ace;})});}_0x948adf=_[_0xa253('0x54')]({},_0x948adf,_0xb67e09[_0xa253('0x55')]);return db[_0xa253('0x70')][_0xa253('0x32')]({'where':_0x948adf['where']})['then'](function(_0x2db908){_0x50f3d5[_0xa253('0x32')]=_0x2db908;if(_0xb67e09[_0xa253('0x46')]['includeAll']){_0x948adf['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x948adf);})[_0xa253('0x22')](function(_0x2d6da8){_0x50f3d5[_0xa253('0x59')]=_0x2d6da8;return _0x50f3d5;});}})[_0xa253('0x22')](respondWithFilteredResult(_0x2ee0fb,_0x948adf))[_0xa253('0x2b')](handleError(_0x2ee0fb,null));};exports[_0xa253('0x71')]=function(_0x5c60b3,_0x49b27e,_0xf1aa84){return db[_0xa253('0x41')][_0xa253('0x64')]({'where':{'id':_0x5c60b3[_0xa253('0x65')]['id']}})[_0xa253('0x22')](handleEntityNotFound(_0x49b27e,null))[_0xa253('0x22')](function(_0xc0dfc7){if(_0xc0dfc7){return _0xc0dfc7[_0xa253('0x71')](_0x5c60b3['query'][_0xa253('0x6d')]);}})[_0xa253('0x22')](respondWithStatusCode(_0x49b27e,null))['catch'](handleError(_0x49b27e,null));};exports[_0xa253('0x72')]=function(_0x1502be,_0x1c7af4,_0x31d5d5){return db[_0xa253('0x73')][_0xa253('0x64')]({'where':{'id':_0x1502be[_0xa253('0x65')]['id']}})['then'](handleEntityNotFound(_0x1c7af4,null))[_0xa253('0x22')](function(_0x3ba2c4){if(_0x3ba2c4){return _0x3ba2c4[_0xa253('0x72')](_0x1502be[_0xa253('0x5d')]['ids'],_[_0xa253('0x74')](_0x1502be[_0xa253('0x5d')],[_0xa253('0x6d'),'id'])||{});}})[_0xa253('0x22')](respondWithResult(_0x1c7af4,null))['catch'](handleError(_0x1c7af4,null));};exports[_0xa253('0x75')]=function(_0x4be7e6,_0x5418ef,_0x37ed96){var _0x4511af={'raw':![],'where':{}};var _0x416a7e={};var _0x5476a3={'count':0x0,'rows':[]};return db['FaxAccount'][_0xa253('0x6b')]({'where':{'id':_0x4be7e6[_0xa253('0x65')]['id']}})[_0xa253('0x22')](handleEntityNotFound(_0x5418ef,null))['then'](function(_0x1dae1c){if(_0x1dae1c){_0x416a7e[_0xa253('0x44')]=_[_0xa253('0x47')](db[_0xa253('0x73')][_0xa253('0x42')]);_0x416a7e[_0xa253('0x46')]=_[_0xa253('0x47')](_0x4be7e6['query']);_0x416a7e[_0xa253('0x52')]=_[_0xa253('0x49')](_0x416a7e['model'],_0x416a7e['query']);_0x4511af['attributes']=_[_0xa253('0x49')](_0x416a7e[_0xa253('0x44')],qs['fields'](_0x4be7e6[_0xa253('0x46')][_0xa253('0x4a')]));_0x4511af[_0xa253('0x48')]=_0x4511af['attributes'][_0xa253('0x4b')]?_0x4511af[_0xa253('0x48')]:_0x416a7e[_0xa253('0x44')];if(!_0x4be7e6['query']['hasOwnProperty'](_0xa253('0x4d'))){_0x4511af['limit']=qs['limit'](_0x4be7e6[_0xa253('0x46')][_0xa253('0x30')]);_0x4511af[_0xa253('0x31')]=qs[_0xa253('0x31')](_0x4be7e6[_0xa253('0x46')][_0xa253('0x31')]);}_0x4511af[_0xa253('0x4e')]=qs['sort'](_0x4be7e6[_0xa253('0x46')]['sort']);_0x4511af[_0xa253('0x50')]=qs[_0xa253('0x52')](_[_0xa253('0x51')](_0x4be7e6[_0xa253('0x46')],_0x416a7e[_0xa253('0x52')]));_0x4511af[_0xa253('0x50')]['FaxAccountId']=_0x1dae1c['id'];if(_0x4be7e6[_0xa253('0x46')]['filter']){_0x4511af['where']=_['merge'](_0x4511af[_0xa253('0x50')],{'$or':_[_0xa253('0x40')](_0x4511af[_0xa253('0x48')],function(_0x3e902b){var _0x5607a7={};_0x5607a7[_0x3e902b]={'$like':'%'+_0x4be7e6[_0xa253('0x46')][_0xa253('0x53')]+'%'};return _0x5607a7;})});}_0x4511af=_[_0xa253('0x54')]({},_0x4511af,_0x4be7e6[_0xa253('0x55')]);return db[_0xa253('0x73')][_0xa253('0x32')]({'where':_0x4511af[_0xa253('0x50')]})[_0xa253('0x22')](function(_0xd866e1){_0x5476a3[_0xa253('0x32')]=_0xd866e1;if(_0x4be7e6[_0xa253('0x46')]['includeAll']){_0x4511af[_0xa253('0x57')]=[{'model':db[_0xa253('0x76')],'as':_0xa253('0x77'),'required':![]},{'model':db[_0xa253('0x78')],'as':'Owner','attributes':[_0xa253('0x45'),_0xa253('0x79'),_0xa253('0x7a')],'required':![]},{'model':db[_0xa253('0x7b')],'as':_0xa253('0x7c'),'attributes':['id',_0xa253('0x45'),'color'],'where':_0x4be7e6['query']['tag']?{'id':_0x4be7e6['query'][_0xa253('0x7d')]}:undefined,'required':_0x4be7e6[_0xa253('0x46')][_0xa253('0x7d')]?!![]:![]}];}return db[_0xa253('0x73')]['findAll'](_0x4511af);})[_0xa253('0x22')](function(_0x5e997b){_0x5476a3['rows']=_0x5e997b;return _0x5476a3;});}})[_0xa253('0x22')](respondWithFilteredResult(_0x5418ef,_0x4511af))[_0xa253('0x2b')](handleError(_0x5418ef,null));};exports[_0xa253('0x7e')]=function(_0x1f0227,_0x47eeb3){var _0x2c08b6=_0x1f0227[_0xa253('0x65')]['id'];var _0x242da8=_0x1f0227[_0xa253('0x5d')];var _0x4a3234=0xc8;var _0x2efa43=null;return db['sequelize'][_0xa253('0x7f')]({'isolationLevel':db['sequelize'][_0xa253('0x80')]['ISOLATION_LEVELS'][_0xa253('0x81')]},function(_0x87268c){return db[_0xa253('0x41')][_0xa253('0x6b')]({'where':{'id':_0x2c08b6},'transaction':_0x87268c})['then'](function(_0x514377){if(_0x514377){return db[_0xa253('0x82')]['destroy']({'where':{'FaxAccountId':_0x2c08b6},'transaction':_0x87268c})[_0xa253('0x22')](function(){var _0x127bf0=_[_0xa253('0x40')](_0x242da8,function(_0x2ff908){_0x2ff908[_0xa253('0x68')]=_0x2c08b6;return _0x2ff908;});return db[_0xa253('0x82')][_0xa253('0x83')](_0x127bf0,{'transaction':_0x87268c});});}else{_0x4a3234=0x194;_0x2efa43=[];}});})[_0xa253('0x22')](function(){if(_0x4a3234!==0x194){return db[_0xa253('0x82')][_0xa253('0x84')]({'where':{'FaxAccountId':_0x2c08b6},'order':_0xa253('0x85')})[_0xa253('0x22')](function(_0x2889fe){_0x2efa43=_0x2889fe;});}})[_0xa253('0x2b')](function(_0x47b36d){_0x4a3234=0x1f4;logger[_0xa253('0x26')](_0x47b36d[_0xa253('0x3e')]);if(_0x47b36d[_0xa253('0x45')]){delete _0x47b36d[_0xa253('0x45')];}_0x2efa43=_0x47b36d;})['finally'](function(){if(_0x2efa43===null){_0x47eeb3['sendStatus'](_0x4a3234);}else{if(_0x4a3234===0x1f4){_0x47eeb3[_0xa253('0x2d')](_0x4a3234)['send'](_0x2efa43);}else{_0x47eeb3[_0xa253('0x2d')](_0x4a3234)[_0xa253('0x2e')](_0x2efa43);}}});};exports['getApplications']=function(_0x408ef1,_0x404d07,_0x4e529a){var _0x53363b={};var _0x93d62d={};var _0x25f6a4;var _0x1339df;return db[_0xa253('0x41')][_0xa253('0x6b')]({'where':{'id':_0x408ef1[_0xa253('0x65')]['id']}})[_0xa253('0x22')](handleEntityNotFound(_0x404d07,null))[_0xa253('0x22')](function(_0x40e35b){if(_0x40e35b){_0x25f6a4=_0x40e35b;_0x93d62d[_0xa253('0x44')]=_[_0xa253('0x47')](db[_0xa253('0x82')][_0xa253('0x42')]);_0x93d62d[_0xa253('0x46')]=_[_0xa253('0x47')](_0x408ef1[_0xa253('0x46')]);_0x93d62d[_0xa253('0x52')]=_['intersection'](_0x93d62d[_0xa253('0x44')],_0x93d62d[_0xa253('0x46')]);_0x53363b[_0xa253('0x48')]=_['intersection'](_0x93d62d[_0xa253('0x44')],qs[_0xa253('0x4a')](_0x408ef1['query'][_0xa253('0x4a')]));_0x53363b['attributes']=_0x53363b[_0xa253('0x48')][_0xa253('0x4b')]?_0x53363b[_0xa253('0x48')]:_0x93d62d['model'];_0x53363b[_0xa253('0x4e')]=qs[_0xa253('0x4f')](_0x408ef1[_0xa253('0x46')][_0xa253('0x4f')]);_0x53363b[_0xa253('0x50')]=qs[_0xa253('0x52')](_[_0xa253('0x51')](_0x408ef1[_0xa253('0x46')],_0x93d62d[_0xa253('0x52')]));if(_0x408ef1[_0xa253('0x46')][_0xa253('0x53')]){_0x53363b['where']=_[_0xa253('0x54')](_0x53363b[_0xa253('0x50')],{'$or':_[_0xa253('0x40')](_0x53363b[_0xa253('0x48')],function(_0x24de50){var _0x2b1b05={};_0x2b1b05[_0x24de50]={'$like':'%'+_0x408ef1[_0xa253('0x46')][_0xa253('0x53')]+'%'};return _0x2b1b05;})});}_0x53363b=_['merge']({},_0x53363b,_0x408ef1[_0xa253('0x55')]);return _0x25f6a4[_0xa253('0x86')](_0x53363b);}})[_0xa253('0x22')](function(_0x5b9cf2){if(_0x5b9cf2){_0x1339df=_0x5b9cf2[_0xa253('0x4b')];if(!_0x408ef1[_0xa253('0x46')]['hasOwnProperty'](_0xa253('0x4d'))){_0x53363b['limit']=qs[_0xa253('0x30')](_0x408ef1[_0xa253('0x46')][_0xa253('0x30')]);_0x53363b[_0xa253('0x31')]=qs[_0xa253('0x31')](_0x408ef1[_0xa253('0x46')][_0xa253('0x31')]);}return _0x25f6a4[_0xa253('0x86')](_0x53363b);}})['then'](function(_0x5167bb){if(_0x5167bb){return _0x5167bb?{'count':_0x1339df,'rows':_0x5167bb}:null;}})[_0xa253('0x22')](respondWithResult(_0x404d07,null))[_0xa253('0x2b')](handleError(_0x404d07,null));};function Extension(_0x51963c,_0x2782b2,_0x452819,_0x2c8557){this[_0xa253('0x87')]=_0xa253('0x88');this[_0xa253('0x89')]=_0x51963c[_0xa253('0x8a')];this['app']=_0x2c8557;this[_0xa253('0x8b')]='system';this[_0xa253('0x8c')]=_0xa253('0x8d');this[_0xa253('0x68')]=_0x51963c['id'];this[_0xa253('0x85')]=_0x2782b2;this[_0xa253('0x8e')]=_0x452819;}function createExtensionsReciveFax(_0x4f08f1){var _0x274953=0x1;var _0x2815f6=[];_0x2815f6[_0xa253('0x8f')](new Extension(_0x4f08f1,_0x274953,'',_0xa253('0x90')));_0x274953+=0x1;_0x2815f6['push'](new Extension(_0x4f08f1,_0x274953,_0xa253('0x91'),'Set'));_0x274953+=0x1;for(var _0x2334ba in _0x4f08f1){if(_0x4f08f1['hasOwnProperty'](_0x2334ba)&&(_0x2334ba===_0xa253('0x92')||_0x2334ba===_0xa253('0x8a')||_0x2334ba===_0xa253('0x93')||_0x2334ba===_0xa253('0x94')||_0x2334ba===_0xa253('0x95')||_0x2334ba===_0xa253('0x96')||_0x2334ba==='minrate'||_0x2334ba===_0xa253('0x97')||_0x2334ba==='t38timeout')){_0x2815f6[_0xa253('0x8f')](new Extension(_0x4f08f1,_0x274953,_0xa253('0x98')+_0x2334ba+')='+_0x4f08f1[_0x2334ba],_0xa253('0x99')));_0x274953+=0x1;}}_0x2815f6[_0xa253('0x8f')](new Extension(_0x4f08f1,_0x274953,'6',_0xa253('0x9a')));_0x274953+=0x1;_0x2815f6[_0xa253('0x8f')](new Extension(_0x4f08f1,_0x274953,_0xa253('0x9b'),_0xa253('0x9c')));_0x274953=0x0;return _0x2815f6;}exports['addAccountApplications']=function(_0x181a84,_0x6c64f4,_0x1e0f45){var _0x3aa33a;return db[_0xa253('0x9d')][_0xa253('0x7f')](function(_0x1f5d53){return db['FaxAccount']['create'](_0x181a84[_0xa253('0x5d')],{'transaction':_0x1f5d53})['then'](function(_0x2a2446){_0x3aa33a=_0x2a2446[_0xa253('0x3a')]({'plain':!![]});return db['VoiceExtension'][_0xa253('0x83')](createExtensionsReciveFax(_0x3aa33a),{'transaction':_0x1f5d53});});})['then'](function(){return _0x3aa33a;})[_0xa253('0x22')](respondWithResult(_0x6c64f4,null))[_0xa253('0x2b')](handleError(_0x6c64f4,null));};exports[_0xa253('0x9e')]=function(_0x3588bb,_0x53f4e6,_0x27b7d7){var _0x32a466;return db[_0xa253('0x9d')][_0xa253('0x7f')](function(_0x222970){return db['FaxAccount'][_0xa253('0x38')](_0x3588bb[_0xa253('0x5d')],{'where':{'id':_0x3588bb[_0xa253('0x5d')]['id']},'transaction':_0x222970})[_0xa253('0x22')](function(_0xbf49d1){return db[_0xa253('0x9f')][_0xa253('0x39')]({'where':{'FaxAccountId':_0x3588bb[_0xa253('0x5d')]['id']},'transaction':_0x222970})['then'](function(_0x4f9e46){return db[_0xa253('0x9f')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x3588bb[_0xa253('0x5d')],[_0xa253('0xa0'),_0xa253('0xa1'),_0xa253('0xa2'),'updatedAt','TrunkId','ListId'])),{'transaction':_0x222970});});});})['then'](function(){return db[_0xa253('0x41')][_0xa253('0xa3')](_0x3588bb['body']['id']);})[_0xa253('0x22')](respondWithResult(_0x53f4e6,null))['catch'](handleError(_0x53f4e6,null));};exports[_0xa253('0xa4')]=function(_0x587bf0,_0x5b6160,_0x20a6d4){var _0x17f2dc={'raw':!![],'where':{}};var _0x2658ac={};var _0x156545={'count':0x0,'rows':[]};return db['FaxAccount'][_0xa253('0x6b')]({'where':{'id':_0x587bf0[_0xa253('0x65')]['id']}})[_0xa253('0x22')](handleEntityNotFound(_0x5b6160,null))[_0xa253('0x22')](function(_0x558666){if(_0x558666){_0x2658ac['model']=_['keys'](db['FaxMessage'][_0xa253('0x42')]);_0x2658ac['query']=_['keys'](_0x587bf0[_0xa253('0x46')]);_0x2658ac['filters']=_[_0xa253('0x49')](_0x2658ac[_0xa253('0x44')],_0x2658ac[_0xa253('0x46')]);_0x17f2dc[_0xa253('0x48')]=_[_0xa253('0x49')](_0x2658ac[_0xa253('0x44')],qs[_0xa253('0x4a')](_0x587bf0[_0xa253('0x46')][_0xa253('0x4a')]));_0x17f2dc[_0xa253('0x48')]=_0x17f2dc[_0xa253('0x48')]['length']?_0x17f2dc[_0xa253('0x48')]:_0x2658ac['model'];if(!_0x587bf0[_0xa253('0x46')]['hasOwnProperty'](_0xa253('0x4d'))){_0x17f2dc[_0xa253('0x30')]=qs[_0xa253('0x30')](_0x587bf0[_0xa253('0x46')][_0xa253('0x30')]);_0x17f2dc['offset']=qs[_0xa253('0x31')](_0x587bf0[_0xa253('0x46')][_0xa253('0x31')]);}_0x17f2dc[_0xa253('0x4e')]=qs[_0xa253('0x4f')](_0x587bf0[_0xa253('0x46')][_0xa253('0x4f')]);_0x17f2dc[_0xa253('0x50')]=qs[_0xa253('0x52')](_[_0xa253('0x51')](_0x587bf0[_0xa253('0x46')],_0x2658ac[_0xa253('0x52')]));_0x17f2dc[_0xa253('0x50')][_0xa253('0x68')]=_0x558666['id'];if(_0x587bf0[_0xa253('0x46')]['filter']){_0x17f2dc[_0xa253('0x50')]=_[_0xa253('0x54')](_0x17f2dc[_0xa253('0x50')],{'$or':_[_0xa253('0x40')](_0x17f2dc[_0xa253('0x48')],function(_0x417eec){var _0x3e5994={};_0x3e5994[_0x417eec]={'$like':'%'+_0x587bf0[_0xa253('0x46')][_0xa253('0x53')]+'%'};return _0x3e5994;})});}if(_0x587bf0['query'][_0xa253('0xa5')]){var _0x22920c=_0x587bf0[_0xa253('0x46')][_0xa253('0xa5')][_0xa253('0xa6')](',');var _0x1f1979={};_0x1f1979[_0x22920c[0x0]]={'$gte':moment(_0x22920c[0x1])[_0xa253('0xa7')](_0xa253('0xa8'))};_0x17f2dc[_0xa253('0x50')]=_['merge'](_0x17f2dc[_0xa253('0x50')],_0x1f1979);}_0x17f2dc=_['merge']({},_0x17f2dc,_0x587bf0[_0xa253('0x55')]);return db[_0xa253('0xa9')][_0xa253('0x32')]({'where':_0x17f2dc[_0xa253('0x50')]})[_0xa253('0x22')](function(_0x2e7481){_0x156545['count']=_0x2e7481;if(_0x587bf0[_0xa253('0x46')][_0xa253('0x56')]){_0x17f2dc['include']=[{'all':!![]}];}return db[_0xa253('0xa9')][_0xa253('0x58')](_0x17f2dc);})[_0xa253('0x22')](function(_0xa21bf){_0x156545['rows']=_0xa21bf;return _0x156545;});}})[_0xa253('0x22')](respondWithFilteredResult(_0x5b6160,_0x17f2dc))['catch'](handleError(_0x5b6160,null));};exports[_0xa253('0x3f')]=function(_0x37ee98,_0x51cbee,_0x550098){var _0x4eb531,_0x15bc9b={},_0x215421;if(_0x37ee98[_0xa253('0x5d')]['to']){_0x215421=_0x37ee98['body']['to'][0x0];}return db[_0xa253('0x41')][_0xa253('0x64')]({'where':{'id':_0x37ee98['params']['id']},'include':[{'model':db[_0xa253('0xaa')],'as':_0xa253('0xab'),'include':[{'model':db[_0xa253('0x76')],'as':'Contacts','where':{'fax':_0x215421},'limit':0x1,'order':[['updatedAt',_0xa253('0xac')]]}]}]})[_0xa253('0x22')](handleEntityNotFound(_0x51cbee,null))[_0xa253('0x22')](function(_0x41bf6c){_0x4eb531=_0x41bf6c;if(_0x37ee98['body'][_0xa253('0xad')]&&_0x37ee98[_0xa253('0x5d')]['attachments'][_0xa253('0x4b')]){for(var _0x1d1588=0x0;_0x1d1588<_0x37ee98[_0xa253('0x5d')][_0xa253('0xad')][_0xa253('0x4b')];_0x1d1588+=0x1){_0x37ee98[_0xa253('0x5d')][_0xa253('0xad')][_0x1d1588]={'filename':_0x37ee98['body'][_0xa253('0xad')][_0x1d1588]['name'],'id':_0x37ee98['body'][_0xa253('0xad')][_0x1d1588]['id'],'path':path['join'](config[_0xa253('0xae')],_0xa253('0xaf'),_0x37ee98[_0xa253('0x5d')]['attachments'][_0x1d1588][_0xa253('0xb0')])};}}return respondWithRpcPromise(_0xa253('0xb1'),_0xa253('0xb1'),{'FaxAccountId':_[_0xa253('0xb2')](_0x37ee98[_0xa253('0x65')]['id'])?undefined:_0x37ee98[_0xa253('0x65')]['id'],'path':_[_0xa253('0xb2')](_0x37ee98[_0xa253('0x5d')][_0xa253('0xad')][0x0][_0xa253('0x7')])?undefined:_0x37ee98[_0xa253('0x5d')][_0xa253('0xad')][0x0]['path'],'fax':_[_0xa253('0xb2')](_0x37ee98[_0xa253('0x5d')]['to'][0x0])?undefined:_0x37ee98[_0xa253('0x5d')]['to'][0x0]},client9002);})[_0xa253('0x22')](function(){if(_0x4eb531){if(_[_0xa253('0xb2')](_0x37ee98[_0xa253('0x5d')][_0xa253('0xb3')])){_0x37ee98[_0xa253('0x5d')][_0xa253('0xb3')]=util['format']('\x22%s\x22\x20<%s>',_0x4eb531[_0xa253('0x45')],_0x4eb531[_0xa253('0xb4')]);}if(_0x4eb531[_0xa253('0xab')]){if(_0x4eb531[_0xa253('0xab')][_0xa253('0xb5')][_0xa253('0x4b')]){return _0x4eb531[_0xa253('0xab')][_0xa253('0xb5')][0x0];}else{return db[_0xa253('0x76')][_0xa253('0x62')](_[_0xa253('0xb6')](_0x37ee98[_0xa253('0x5d')],{'firstName':_0x37ee98[_0xa253('0x5d')]['to'][0x0],'phone':_0x37ee98[_0xa253('0x5d')]['to'][0x0],'fax':_0x37ee98['body']['to'][0x0],'ListId':_0x4eb531['ListId']}));}}else{throw new Error(_0xa253('0xb7'));}}else{throw new Error(_0xa253('0xb8'));}})[_0xa253('0x22')](function(_0x857b67){if(_0x857b67){return db[_0xa253('0x73')][_0xa253('0x64')]({'where':{'ContactId':_0x857b67['id'],'closed':![],'FaxAccountId':_0x4eb531['id']}})[_0xa253('0x22')](function(_0x49c715){if(_0x49c715){return[_0x49c715,![]];}return db['FaxInteraction'][_0xa253('0x62')]({'UserId':_0x37ee98['user']['id'],'ContactId':_0x857b67['id'],'FaxAccountId':_0x4eb531['id'],'fax':_0x37ee98[_0xa253('0x5d')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xa253('0x54')](_0x37ee98[_0xa253('0x5d')],{'read':![],'body':_0x37ee98[_0xa253('0x5d')][_0xa253('0xad')][0x0][_0xa253('0xb9')],'FaxAccountId':_0x4eb531['id'],'UserId':_0x37ee98[_0xa253('0x5e')]['id'],'ContactId':_0x857b67['id'],'AttachmentId':_0x37ee98[_0xa253('0x5d')][_0xa253('0xad')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xa253('0xba')}]})[_0xa253('0x22')](function(_0x8c3d6c){return[_0x8c3d6c,!![]];});});}else{throw new Error(_0xa253('0xbb'));}})[_0xa253('0xbc')](function(_0x3e761b,_0x385670){if(_0x385670){return _0x3e761b;}return db[_0xa253('0xa9')]['create']({'direction':_0xa253('0xbd'),'read':![],'body':_0x37ee98[_0xa253('0x5d')][_0xa253('0xad')][0x0]['filename'],'FaxAccountId':_0x4eb531['id'],'FaxInteractionId':_0x3e761b['id'],'UserId':_0x37ee98[_0xa253('0x5e')]['id'],'ContactId':_0x3e761b[_0xa253('0xbe')],'AttachmentId':_0x37ee98[_0xa253('0x5d')][_0xa253('0xad')][0x0]['id']})[_0xa253('0x22')](function(_0x97fc5f){_0x3e761b['dataValues']['Messages']=[];_0x3e761b['dataValues'][_0xa253('0xba')]['push'](_0x97fc5f[_0xa253('0xbf')]);return _0x3e761b;});})[_0xa253('0x22')](function(_0x5f8020){respondWithRpcPromise('SendFax',_0xa253('0xc0'),{'FaxAccountId':_[_0xa253('0xb2')](_0x37ee98['params']['id'])?undefined:_0x37ee98[_0xa253('0x65')]['id'],'path':_[_0xa253('0xb2')](_0x37ee98[_0xa253('0x5d')]['attachments'][0x0][_0xa253('0x7')])?undefined:_0x37ee98[_0xa253('0x5d')][_0xa253('0xad')][0x0][_0xa253('0x7')],'fax':_[_0xa253('0xb2')](_0x37ee98['body']['to'][0x0])?undefined:_0x37ee98[_0xa253('0x5d')]['to'][0x0],'AttachmentId':_0x37ee98['body'][_0xa253('0xad')][0x0]['id']},client9002)[_0xa253('0x22')](function(_0x2d5de1){logger['info'](_0xa253('0xc1'),_0x2d5de1);})['catch'](function(_0x5cc7a9){logger[_0xa253('0xc2')](_0xa253('0xc1'),_0x5cc7a9);});return _0x5f8020;})[_0xa253('0x22')](respondWithResult(_0x51cbee,null))[_0xa253('0x2b')](handleError(_0x51cbee,null));};exports[_0xa253('0xc3')]=function(_0x3d2122,_0x46b38b,_0x154002){return db[_0xa253('0x41')][_0xa253('0x64')]({'where':{'id':_0x3d2122['params']['id']}})['then'](handleEntityNotFound(_0x46b38b,null))[_0xa253('0x22')](function(_0x2a2ca7){if(_0x2a2ca7){return _0x2a2ca7['addAgents'](_0x3d2122[_0xa253('0x5d')][_0xa253('0x6d')],_['omit'](_0x3d2122[_0xa253('0x5d')],[_0xa253('0x6d'),'id'])||{})['spread'](function(_0x523be2){for(var _0x44839c=0x0;_0x44839c<_0x3d2122[_0xa253('0x5d')][_0xa253('0x6d')][_0xa253('0x4b')];_0x44839c+=0x1){socket['emit'](_0xa253('0xc4'),{'UserId':Number(_0x3d2122[_0xa253('0x5d')][_0xa253('0x6d')][_0x44839c]),'FaxAccountId':Number(_0x3d2122[_0xa253('0x65')]['id'])});}return _0x523be2;});}})[_0xa253('0x22')](respondWithResult(_0x46b38b,null))[_0xa253('0x2b')](handleError(_0x46b38b,null));};exports[_0xa253('0xc5')]=function(_0x34278b,_0x9fc65c,_0x53aea8){return db['FaxAccount'][_0xa253('0x64')]({'where':{'id':_0x34278b[_0xa253('0x65')]['id']}})[_0xa253('0x22')](handleEntityNotFound(_0x9fc65c,null))[_0xa253('0x22')](function(_0x4b9e45){if(_0x4b9e45){return _0x4b9e45['removeAgents'](_0x34278b[_0xa253('0x46')][_0xa253('0x6d')])[_0xa253('0x22')](function(){if(_[_0xa253('0xc6')](_0x34278b[_0xa253('0x46')][_0xa253('0x6d')])){for(var _0x502317=0x0;_0x502317<_0x34278b['query']['ids'][_0xa253('0x4b')];_0x502317+=0x1){socket[_0xa253('0xc7')](_0xa253('0xc8'),{'UserId':Number(_0x34278b['query']['ids'][_0x502317]),'FaxAccountId':Number(_0x34278b[_0xa253('0x65')]['id'])});}}else{socket[_0xa253('0xc7')](_0xa253('0xc8'),{'UserId':Number(_0x34278b[_0xa253('0x46')][_0xa253('0x6d')]),'FaxAccountId':Number(_0x34278b[_0xa253('0x65')]['id'])});}});}})[_0xa253('0x22')](respondWithStatusCode(_0x9fc65c,null))[_0xa253('0x2b')](handleError(_0x9fc65c,null));};exports[_0xa253('0xc9')]=function(_0x2bd71a,_0x4ed94f,_0x1b9474){var _0x1ba8b0={};var _0x444259={};var _0x5d08bf;var _0x51599b;return db['FaxAccount'][_0xa253('0x6b')]({'where':{'id':_0x2bd71a[_0xa253('0x65')]['id']}})[_0xa253('0x22')](handleEntityNotFound(_0x4ed94f,null))[_0xa253('0x22')](function(_0x5200c2){if(_0x5200c2){_0x5d08bf=_0x5200c2;_0x444259[_0xa253('0x44')]=_['keys'](db[_0xa253('0x78')]['rawAttributes']);_0x444259[_0xa253('0x46')]=_[_0xa253('0x47')](_0x2bd71a[_0xa253('0x46')]);_0x444259[_0xa253('0x52')]=_['intersection'](_0x444259[_0xa253('0x44')],_0x444259[_0xa253('0x46')]);_0x1ba8b0['attributes']=_[_0xa253('0x49')](_0x444259[_0xa253('0x44')],qs[_0xa253('0x4a')](_0x2bd71a['query'][_0xa253('0x4a')]));_0x1ba8b0['attributes']=_0x1ba8b0[_0xa253('0x48')]['length']?_0x1ba8b0[_0xa253('0x48')]:_0x444259[_0xa253('0x44')];_0x1ba8b0[_0xa253('0x4e')]=qs[_0xa253('0x4f')](_0x2bd71a['query'][_0xa253('0x4f')]);_0x1ba8b0[_0xa253('0x50')]=qs[_0xa253('0x52')](_[_0xa253('0x51')](_0x2bd71a['query'],_0x444259[_0xa253('0x52')]));if(_0x2bd71a[_0xa253('0x46')][_0xa253('0x53')]){_0x1ba8b0[_0xa253('0x50')]=_[_0xa253('0x54')](_0x1ba8b0[_0xa253('0x50')],{'$or':_[_0xa253('0x40')](_0x1ba8b0[_0xa253('0x48')],function(_0x4ae812){var _0x20a392={};_0x20a392[_0x4ae812]={'$like':'%'+_0x2bd71a['query'][_0xa253('0x53')]+'%'};return _0x20a392;})});}_0x1ba8b0=_[_0xa253('0x54')]({},_0x1ba8b0,_0x2bd71a[_0xa253('0x55')]);return _0x5d08bf[_0xa253('0xc9')](_0x1ba8b0);}})[_0xa253('0x22')](function(_0x59c440){if(_0x59c440){_0x51599b=_0x59c440['length'];if(!_0x2bd71a[_0xa253('0x46')]['hasOwnProperty']('nolimit')){_0x1ba8b0['limit']=qs[_0xa253('0x30')](_0x2bd71a[_0xa253('0x46')][_0xa253('0x30')]);_0x1ba8b0['offset']=qs['offset'](_0x2bd71a[_0xa253('0x46')][_0xa253('0x31')]);}return _0x5d08bf[_0xa253('0xc9')](_0x1ba8b0);}})[_0xa253('0x22')](function(_0x53c002){if(_0x53c002){return _0x53c002?{'count':_0x51599b,'rows':_0x53c002}:null;}})[_0xa253('0x22')](respondWithResult(_0x4ed94f,null))[_0xa253('0x2b')](handleError(_0x4ed94f,null));}; \ No newline at end of file +var _0xa85f=['omit','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','sequelize','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','json','getApplications','context','from-voip-provider','localstationid','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','faxdetect','headerinfo','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','addAccountApplications','transaction','updateAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','split','FaxMessage','CmList','List','Contacts','DESC','attachments','join','server/files/attachments','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','user','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','Pause','map','FaxAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','mandatoryDispositionPause','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','FaxAccountId','Disposition','getDispositions','findOne','nolimit','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','sort','removeAnswers','addInteraction','FaxInteraction'];(function(_0x1d4d67,_0x5c92b6){var _0x9fd1fb=function(_0x44d9e9){while(--_0x44d9e9){_0x1d4d67['push'](_0x1d4d67['shift']());}};_0x9fd1fb(++_0x5c92b6);}(_0xa85f,0x1e1));var _0xfa85=function(_0x4d2219,_0x5b7f96){_0x4d2219=_0x4d2219-0x0;var _0x10edcf=_0xa85f[_0x4d2219];return _0x10edcf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfa85('0x0'));var zipdir=require(_0xfa85('0x1'));var jsonpatch=require(_0xfa85('0x2'));var rp=require(_0xfa85('0x3'));var moment=require(_0xfa85('0x4'));var BPromise=require(_0xfa85('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfa85('0x6'));var sox=require(_0xfa85('0x7'));var csv=require(_0xfa85('0x8'));var ejs=require(_0xfa85('0x9'));var fs=require('fs');var fs_extra=require(_0xfa85('0xa'));var _=require(_0xfa85('0xb'));var squel=require(_0xfa85('0xc'));var crypto=require('crypto');var jsforce=require(_0xfa85('0xd'));var deskjs=require(_0xfa85('0xe'));var toCsv=require(_0xfa85('0x8'));var querystring=require(_0xfa85('0xf'));var Papa=require(_0xfa85('0x10'));var Redis=require(_0xfa85('0x11'));var authService=require(_0xfa85('0x12'));var qs=require(_0xfa85('0x13'));var as=require(_0xfa85('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfa85('0x15'))(_0xfa85('0x16'));var utils=require(_0xfa85('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfa85('0x18'));var db=require(_0xfa85('0x19'))['db'];config['redis']=_[_0xfa85('0x1a')](config[_0xfa85('0x1b')],{'host':_0xfa85('0x1c'),'port':0x18eb});var socket=require(_0xfa85('0x1d'))(new Redis(config[_0xfa85('0x1b')]));require(_0xfa85('0x1e'))[_0xfa85('0x1f')](socket);var jayson=require(_0xfa85('0x20'));var client=jayson[_0xfa85('0x21')][_0xfa85('0x22')]({'port':0x232c});var client9002=jayson[_0xfa85('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31226a,_0x5a31c0,_0x55d035,_0x353721){return new BPromise(function(_0x53f614,_0x46c550){var _0x198107=_0x353721||client;return _0x198107[_0xfa85('0x23')](_0x31226a,_0x55d035)[_0xfa85('0x24')](function(_0x26d678){logger['info'](_0xfa85('0x25'),_0x5a31c0,_0xfa85('0x26'));logger[_0xfa85('0x27')](_0xfa85('0x28'),_0x5a31c0,_0xfa85('0x26'),JSON[_0xfa85('0x29')](_0x26d678));if(_0x26d678[_0xfa85('0x2a')]){if(_0x26d678[_0xfa85('0x2a')][_0xfa85('0x2b')]===0x1f4){logger[_0xfa85('0x2a')](_0xfa85('0x25'),_0x5a31c0,_0x26d678[_0xfa85('0x2a')]['message']);return _0x46c550(_0x26d678[_0xfa85('0x2a')]['message']);}logger[_0xfa85('0x2a')](_0xfa85('0x25'),_0x5a31c0,_0x26d678['error'][_0xfa85('0x2c')]);return _0x53f614(_0x26d678[_0xfa85('0x2a')]['message']);}else{logger[_0xfa85('0x2d')](_0xfa85('0x25'),_0x5a31c0,'request\x20sent');_0x53f614(_0x26d678[_0xfa85('0x2e')][_0xfa85('0x2c')]);}})[_0xfa85('0x2f')](function(_0x5632f0){logger[_0xfa85('0x2a')](_0xfa85('0x25'),_0x5a31c0,_0x5632f0);_0x46c550(_0x5632f0);});});}function respondWithStatusCode(_0x1c9b6b,_0x1f2c0c){_0x1f2c0c=_0x1f2c0c||0xcc;return function(_0x5517b9){if(_0x5517b9){return _0x1c9b6b[_0xfa85('0x30')](_0x1f2c0c);}return _0x1c9b6b[_0xfa85('0x31')](_0x1f2c0c)[_0xfa85('0x32')]();};}function respondWithResult(_0x27fbcb,_0x3c4a58){_0x3c4a58=_0x3c4a58||0xc8;return function(_0x1afd42){if(_0x1afd42){return _0x27fbcb[_0xfa85('0x31')](_0x3c4a58)['json'](_0x1afd42);}};}function respondWithFilteredResult(_0x3dda49,_0x1f407f){return function(_0x40baf7){if(_0x40baf7){var _0x29632f=typeof _0x1f407f[_0xfa85('0x33')]===_0xfa85('0x34')&&typeof _0x1f407f[_0xfa85('0x35')]===_0xfa85('0x34');var _0x28fd9a=_0x40baf7[_0xfa85('0x36')];var _0x559c62=_0x29632f?0x0:_0x1f407f[_0xfa85('0x33')];var _0xd88a4d=_0x29632f?_0x40baf7[_0xfa85('0x36')]:_0x1f407f[_0xfa85('0x33')]+_0x1f407f[_0xfa85('0x35')];var _0x455ecd;if(_0xd88a4d>=_0x28fd9a){_0xd88a4d=_0x28fd9a;_0x455ecd=0xc8;}else{_0x455ecd=0xce;}_0x3dda49['status'](_0x455ecd);return _0x3dda49[_0xfa85('0x37')](_0xfa85('0x38'),_0x559c62+'-'+_0xd88a4d+'/'+_0x28fd9a)['json'](_0x40baf7);}return null;};}function patchUpdates(_0x65f686){return function(_0x37cd95){try{jsonpatch['apply'](_0x37cd95,_0x65f686,!![]);}catch(_0x6812c0){return BPromise[_0xfa85('0x39')](_0x6812c0);}return _0x37cd95[_0xfa85('0x3a')]();};}function saveUpdates(_0x377aa,_0x31cfdb){return function(_0x23d999){if(_0x23d999){return _0x23d999[_0xfa85('0x3b')](_0x377aa)[_0xfa85('0x24')](function(_0x1ca1f2){return _0x1ca1f2;});}return null;};}function removeEntity(_0x5aaf13,_0x301c00){return function(_0xa8c402){if(_0xa8c402){return _0xa8c402[_0xfa85('0x3c')]()['then'](function(){var _0x451843=_0xa8c402[_0xfa85('0x3d')]({'plain':!![]});var _0x5039db=_0xfa85('0x3e');return db[_0xfa85('0x3f')][_0xfa85('0x3c')]({'where':{'type':_0x5039db,'resourceId':_0x451843['id']}})[_0xfa85('0x24')](function(){return _0xa8c402;});})[_0xfa85('0x24')](function(){_0x5aaf13[_0xfa85('0x31')](0xcc)[_0xfa85('0x32')]();});}};}function handleEntityNotFound(_0x19f35b,_0x43b888){return function(_0x5c482b){if(!_0x5c482b){_0x19f35b['sendStatus'](0x194);}return _0x5c482b;};}function handleError(_0x2cda6e,_0x5a7b73){_0x5a7b73=_0x5a7b73||0x1f4;return function(_0x53c52e){logger[_0xfa85('0x2a')](_0x53c52e[_0xfa85('0x40')]);if(_0x53c52e['name']){delete _0x53c52e[_0xfa85('0x41')];}_0x2cda6e[_0xfa85('0x31')](_0x5a7b73)[_0xfa85('0x42')](_0x53c52e);};}exports['index']=function(_0x440796,_0x15a162){var _0x371fef={'include':[{'model':db[_0xfa85('0x43')],'as':'mandatoryDispositionPause'}]},_0x3d5f97={},_0x508922={'count':0x0,'rows':[]};var _0x4ff72f=_[_0xfa85('0x44')](db[_0xfa85('0x45')][_0xfa85('0x46')],function(_0x3f8198){return{'name':_0x3f8198['fieldName'],'type':_0x3f8198[_0xfa85('0x47')][_0xfa85('0x48')]};});_0x3d5f97[_0xfa85('0x49')]=_[_0xfa85('0x44')](_0x4ff72f,'name');_0x3d5f97[_0xfa85('0x4a')]=_[_0xfa85('0x4b')](_0x440796[_0xfa85('0x4a')]);_0x3d5f97[_0xfa85('0x4c')]=_[_0xfa85('0x4d')](_0x3d5f97[_0xfa85('0x49')],_0x3d5f97[_0xfa85('0x4a')]);_0x371fef[_0xfa85('0x4e')]=_[_0xfa85('0x4d')](_0x3d5f97[_0xfa85('0x49')],qs['fields'](_0x440796[_0xfa85('0x4a')][_0xfa85('0x4f')]));_0x371fef['attributes']=_0x371fef[_0xfa85('0x4e')][_0xfa85('0x50')]?_0x371fef[_0xfa85('0x4e')]:_0x3d5f97['model'];if(!_0x440796['query'][_0xfa85('0x51')]('nolimit')){_0x371fef[_0xfa85('0x35')]=qs['limit'](_0x440796[_0xfa85('0x4a')][_0xfa85('0x35')]);_0x371fef['offset']=qs[_0xfa85('0x33')](_0x440796[_0xfa85('0x4a')][_0xfa85('0x33')]);}_0x371fef[_0xfa85('0x52')]=qs['sort'](_0x440796[_0xfa85('0x4a')]['sort']);_0x371fef[_0xfa85('0x53')]=qs[_0xfa85('0x4c')](_[_0xfa85('0x54')](_0x440796[_0xfa85('0x4a')],_0x3d5f97['filters']),_0x4ff72f);if(_0x440796['query']['filter']){_0x371fef['where']=_[_0xfa85('0x55')](_0x371fef[_0xfa85('0x53')],{'$or':_['map'](_0x4ff72f,function(_0xe5bad8){if(_0xe5bad8[_0xfa85('0x47')]!==_0xfa85('0x56')){var _0x421afb={};_0x421afb[_0xe5bad8[_0xfa85('0x41')]]={'$like':'%'+_0x440796[_0xfa85('0x4a')][_0xfa85('0x57')]+'%'};return _0x421afb;}})});}_0x371fef=_[_0xfa85('0x55')]({},_0x371fef,_0x440796[_0xfa85('0x58')]);var _0x1ccd84={'where':_0x371fef[_0xfa85('0x53')]};return db['FaxAccount'][_0xfa85('0x36')](_0x1ccd84)['then'](function(_0x3d1e45){_0x508922['count']=_0x3d1e45;if(_0x440796[_0xfa85('0x4a')][_0xfa85('0x59')]){_0x371fef[_0xfa85('0x5a')]=[{'all':!![]}];}return db[_0xfa85('0x45')]['findAll'](_0x371fef);})[_0xfa85('0x24')](function(_0x3d1ddb){_0x508922[_0xfa85('0x5b')]=_0x3d1ddb;return _0x508922;})[_0xfa85('0x24')](respondWithFilteredResult(_0x15a162,_0x371fef))['catch'](handleError(_0x15a162,null));};exports[_0xfa85('0x5c')]=function(_0xe0801a,_0x347738){var _0x193075={'raw':![],'where':{'id':_0xe0801a[_0xfa85('0x5d')]['id']},'include':[{'model':db[_0xfa85('0x43')],'as':_0xfa85('0x5e')}]},_0x2cd48c={};_0x2cd48c[_0xfa85('0x49')]=_[_0xfa85('0x4b')](db[_0xfa85('0x45')][_0xfa85('0x46')]);_0x2cd48c['query']=_[_0xfa85('0x4b')](_0xe0801a[_0xfa85('0x4a')]);_0x2cd48c[_0xfa85('0x4c')]=_[_0xfa85('0x4d')](_0x2cd48c[_0xfa85('0x49')],_0x2cd48c[_0xfa85('0x4a')]);_0x193075[_0xfa85('0x4e')]=_['intersection'](_0x2cd48c['model'],qs[_0xfa85('0x4f')](_0xe0801a[_0xfa85('0x4a')][_0xfa85('0x4f')]));_0x193075[_0xfa85('0x4e')]=_0x193075['attributes'][_0xfa85('0x50')]?_0x193075[_0xfa85('0x4e')]:_0x2cd48c[_0xfa85('0x49')];if(_0xe0801a['query']['includeAll']){_0x193075['include']=[{'all':!![]}];}_0x193075=_['merge']({},_0x193075,_0xe0801a[_0xfa85('0x58')]);return db['FaxAccount'][_0xfa85('0x5f')](_0x193075)[_0xfa85('0x24')](handleEntityNotFound(_0x347738,null))['then'](respondWithResult(_0x347738,null))[_0xfa85('0x2f')](handleError(_0x347738,null));};exports[_0xfa85('0x60')]=function(_0x3fa08b,_0x1652cc){return db[_0xfa85('0x45')][_0xfa85('0x60')](_0x3fa08b[_0xfa85('0x61')],{})[_0xfa85('0x24')](function(_0x1e95eb){var _0x115713=_0x3fa08b['user'][_0xfa85('0x3d')]({'plain':!![]});if(!_0x115713)throw new Error(_0xfa85('0x62'));if(_0x115713[_0xfa85('0x63')]==='user'){var _0x569d28=_0x1e95eb['get']({'plain':!![]});var _0x22d2b8=_0xfa85('0x3e');return db['UserProfileSection'][_0xfa85('0x5f')]({'where':{'name':_0x22d2b8,'userProfileId':_0x115713[_0xfa85('0x64')]},'raw':!![]})[_0xfa85('0x24')](function(_0x4f21a5){if(_0x4f21a5&&_0x4f21a5[_0xfa85('0x65')]===0x0){return db[_0xfa85('0x3f')]['create']({'name':_0x569d28[_0xfa85('0x41')],'resourceId':_0x569d28['id'],'type':_0x4f21a5[_0xfa85('0x41')],'sectionId':_0x4f21a5['id']},{})['then'](function(){return _0x1e95eb;});}else{return _0x1e95eb;}})[_0xfa85('0x2f')](function(_0x18101b){logger[_0xfa85('0x2a')](_0xfa85('0x66'),_0x18101b);throw _0x18101b;});}return _0x1e95eb;})['then'](respondWithResult(_0x1652cc,0xc9))[_0xfa85('0x2f')](handleError(_0x1652cc,null));};exports[_0xfa85('0x3b')]=function(_0x56ba9c,_0x551468){if(_0x56ba9c[_0xfa85('0x61')]['id']){delete _0x56ba9c[_0xfa85('0x61')]['id'];}return db[_0xfa85('0x45')][_0xfa85('0x5f')]({'where':{'id':_0x56ba9c['params']['id']},'include':[{'model':db['Pause'],'as':_0xfa85('0x5e')}]})['then'](handleEntityNotFound(_0x551468,null))[_0xfa85('0x24')](saveUpdates(_0x56ba9c[_0xfa85('0x61')],null))['then'](respondWithResult(_0x551468,null))[_0xfa85('0x2f')](handleError(_0x551468,null));};exports[_0xfa85('0x3c')]=function(_0x3bae9b,_0x333781){return db['FaxAccount'][_0xfa85('0x5f')]({'where':{'id':_0x3bae9b[_0xfa85('0x5d')]['id']}})[_0xfa85('0x24')](handleEntityNotFound(_0x333781,null))[_0xfa85('0x24')](removeEntity(_0x333781,null))['catch'](handleError(_0x333781,null));};exports[_0xfa85('0x67')]=function(_0x5d310a,_0x346f4b){return db[_0xfa85('0x45')][_0xfa85('0x67')]()[_0xfa85('0x24')](respondWithResult(_0x346f4b,null))[_0xfa85('0x2f')](handleError(_0x346f4b,null));};exports['addDisposition']=function(_0xcf52b1,_0x277796,_0x456851){if(_0xcf52b1[_0xfa85('0x61')]['id']){delete _0xcf52b1[_0xfa85('0x61')]['id'];}return db[_0xfa85('0x45')][_0xfa85('0x5f')]({'where':{'id':_0xcf52b1[_0xfa85('0x5d')]['id']}})['then'](handleEntityNotFound(_0x277796,null))['then'](function(_0x277934){if(_0x277934){_0xcf52b1[_0xfa85('0x61')][_0xfa85('0x68')]=_0x277934['id'];return db[_0xfa85('0x69')][_0xfa85('0x60')](_0xcf52b1[_0xfa85('0x61')]);}})[_0xfa85('0x24')](respondWithResult(_0x277796,null))[_0xfa85('0x2f')](handleError(_0x277796,null));};exports[_0xfa85('0x6a')]=function(_0x30ab55,_0x1f0bef,_0x972799){var _0x51cfd2={'raw':![],'where':{}};var _0x51d30c={};var _0x46ddd6={'count':0x0,'rows':[]};return db['FaxAccount'][_0xfa85('0x6b')]({'where':{'id':_0x30ab55[_0xfa85('0x5d')]['id']}})[_0xfa85('0x24')](handleEntityNotFound(_0x1f0bef,null))[_0xfa85('0x24')](function(_0x17e7a9){if(_0x17e7a9){_0x51d30c[_0xfa85('0x49')]=_[_0xfa85('0x4b')](db[_0xfa85('0x69')][_0xfa85('0x46')]);_0x51d30c[_0xfa85('0x4a')]=_[_0xfa85('0x4b')](_0x30ab55[_0xfa85('0x4a')]);_0x51d30c['filters']=_[_0xfa85('0x4d')](_0x51d30c[_0xfa85('0x49')],_0x51d30c[_0xfa85('0x4a')]);_0x51cfd2['attributes']=_[_0xfa85('0x4d')](_0x51d30c[_0xfa85('0x49')],qs[_0xfa85('0x4f')](_0x30ab55[_0xfa85('0x4a')][_0xfa85('0x4f')]));_0x51cfd2[_0xfa85('0x4e')]=_0x51cfd2[_0xfa85('0x4e')][_0xfa85('0x50')]?_0x51cfd2[_0xfa85('0x4e')]:_0x51d30c['model'];if(!_0x30ab55[_0xfa85('0x4a')]['hasOwnProperty'](_0xfa85('0x6c'))){_0x51cfd2['limit']=qs['limit'](_0x30ab55[_0xfa85('0x4a')][_0xfa85('0x35')]);_0x51cfd2[_0xfa85('0x33')]=qs[_0xfa85('0x33')](_0x30ab55[_0xfa85('0x4a')]['offset']);}_0x51cfd2[_0xfa85('0x52')]=qs['sort'](_0x30ab55['query']['sort']);_0x51cfd2[_0xfa85('0x53')]=qs[_0xfa85('0x4c')](_['pick'](_0x30ab55['query'],_0x51d30c['filters']));_0x51cfd2['where'][_0xfa85('0x68')]=_0x17e7a9['id'];if(_0x30ab55[_0xfa85('0x4a')][_0xfa85('0x57')]){_0x51cfd2[_0xfa85('0x53')]=_[_0xfa85('0x55')](_0x51cfd2[_0xfa85('0x53')],{'$or':_[_0xfa85('0x44')](_0x51cfd2[_0xfa85('0x4e')],function(_0x50b410){var _0x3e808c={};_0x3e808c[_0x50b410]={'$like':'%'+_0x30ab55[_0xfa85('0x4a')][_0xfa85('0x57')]+'%'};return _0x3e808c;})});}_0x51cfd2=_[_0xfa85('0x55')]({},_0x51cfd2,_0x30ab55['options']);return db[_0xfa85('0x69')][_0xfa85('0x36')]({'where':_0x51cfd2[_0xfa85('0x53')]})[_0xfa85('0x24')](function(_0x46dd32){_0x46ddd6[_0xfa85('0x36')]=_0x46dd32;if(_0x30ab55['query'][_0xfa85('0x59')]){_0x51cfd2[_0xfa85('0x5a')]=[{'all':!![]}];}return db[_0xfa85('0x69')][_0xfa85('0x6d')](_0x51cfd2);})[_0xfa85('0x24')](function(_0x1f8b71){_0x46ddd6[_0xfa85('0x5b')]=_0x1f8b71;return _0x46ddd6;});}})[_0xfa85('0x24')](respondWithFilteredResult(_0x1f0bef,_0x51cfd2))[_0xfa85('0x2f')](handleError(_0x1f0bef,null));};exports[_0xfa85('0x6e')]=function(_0x376620,_0x3212ef,_0x2d31c2){return db[_0xfa85('0x45')][_0xfa85('0x5f')]({'where':{'id':_0x376620['params']['id']}})[_0xfa85('0x24')](handleEntityNotFound(_0x3212ef,null))['then'](function(_0x37a4c0){if(_0x37a4c0){return _0x37a4c0[_0xfa85('0x6e')](_0x376620[_0xfa85('0x4a')][_0xfa85('0x6f')]);}})['then'](respondWithStatusCode(_0x3212ef,null))[_0xfa85('0x2f')](handleError(_0x3212ef,null));};exports[_0xfa85('0x70')]=function(_0x2d4b62,_0x2219fe,_0x3b4fb4){if(_0x2d4b62[_0xfa85('0x61')]['id']){delete _0x2d4b62['body']['id'];}return db[_0xfa85('0x45')]['find']({'where':{'id':_0x2d4b62[_0xfa85('0x5d')]['id']}})[_0xfa85('0x24')](handleEntityNotFound(_0x2219fe,null))[_0xfa85('0x24')](function(_0x4404f2){if(_0x4404f2){_0x2d4b62['body'][_0xfa85('0x68')]=_0x4404f2['id'];return db[_0xfa85('0x71')][_0xfa85('0x60')](_0x2d4b62[_0xfa85('0x61')]);}})[_0xfa85('0x24')](respondWithResult(_0x2219fe,null))[_0xfa85('0x2f')](handleError(_0x2219fe,null));};exports[_0xfa85('0x72')]=function(_0x63bf65,_0x1e7c44,_0xbd08aa){var _0x34cb62={'raw':![],'where':{}};var _0x534b58={};var _0x5b1d83={'count':0x0,'rows':[]};return db[_0xfa85('0x45')][_0xfa85('0x6b')]({'where':{'id':_0x63bf65[_0xfa85('0x5d')]['id']}})[_0xfa85('0x24')](handleEntityNotFound(_0x1e7c44,null))[_0xfa85('0x24')](function(_0xaceb5){if(_0xaceb5){_0x534b58[_0xfa85('0x49')]=_[_0xfa85('0x4b')](db[_0xfa85('0x71')][_0xfa85('0x46')]);_0x534b58[_0xfa85('0x4a')]=_[_0xfa85('0x4b')](_0x63bf65[_0xfa85('0x4a')]);_0x534b58[_0xfa85('0x4c')]=_[_0xfa85('0x4d')](_0x534b58[_0xfa85('0x49')],_0x534b58[_0xfa85('0x4a')]);_0x34cb62[_0xfa85('0x4e')]=_[_0xfa85('0x4d')](_0x534b58[_0xfa85('0x49')],qs[_0xfa85('0x4f')](_0x63bf65[_0xfa85('0x4a')][_0xfa85('0x4f')]));_0x34cb62['attributes']=_0x34cb62[_0xfa85('0x4e')][_0xfa85('0x50')]?_0x34cb62['attributes']:_0x534b58[_0xfa85('0x49')];if(!_0x63bf65[_0xfa85('0x4a')]['hasOwnProperty'](_0xfa85('0x6c'))){_0x34cb62[_0xfa85('0x35')]=qs[_0xfa85('0x35')](_0x63bf65[_0xfa85('0x4a')][_0xfa85('0x35')]);_0x34cb62[_0xfa85('0x33')]=qs[_0xfa85('0x33')](_0x63bf65[_0xfa85('0x4a')][_0xfa85('0x33')]);}_0x34cb62['order']=qs[_0xfa85('0x73')](_0x63bf65[_0xfa85('0x4a')]['sort']);_0x34cb62['where']=qs[_0xfa85('0x4c')](_[_0xfa85('0x54')](_0x63bf65['query'],_0x534b58['filters']));_0x34cb62[_0xfa85('0x53')]['FaxAccountId']=_0xaceb5['id'];if(_0x63bf65[_0xfa85('0x4a')][_0xfa85('0x57')]){_0x34cb62[_0xfa85('0x53')]=_[_0xfa85('0x55')](_0x34cb62['where'],{'$or':_[_0xfa85('0x44')](_0x34cb62[_0xfa85('0x4e')],function(_0xeaf08b){var _0x5977dd={};_0x5977dd[_0xeaf08b]={'$like':'%'+_0x63bf65[_0xfa85('0x4a')]['filter']+'%'};return _0x5977dd;})});}_0x34cb62=_[_0xfa85('0x55')]({},_0x34cb62,_0x63bf65[_0xfa85('0x58')]);return db[_0xfa85('0x71')][_0xfa85('0x36')]({'where':_0x34cb62[_0xfa85('0x53')]})[_0xfa85('0x24')](function(_0x93e8df){_0x5b1d83[_0xfa85('0x36')]=_0x93e8df;if(_0x63bf65[_0xfa85('0x4a')]['includeAll']){_0x34cb62[_0xfa85('0x5a')]=[{'all':!![]}];}return db[_0xfa85('0x71')][_0xfa85('0x6d')](_0x34cb62);})[_0xfa85('0x24')](function(_0x2b58d5){_0x5b1d83[_0xfa85('0x5b')]=_0x2b58d5;return _0x5b1d83;});}})[_0xfa85('0x24')](respondWithFilteredResult(_0x1e7c44,_0x34cb62))[_0xfa85('0x2f')](handleError(_0x1e7c44,null));};exports['removeAnswers']=function(_0x30ec10,_0x3f554e,_0x3a6a34){return db['FaxAccount'][_0xfa85('0x5f')]({'where':{'id':_0x30ec10[_0xfa85('0x5d')]['id']}})[_0xfa85('0x24')](handleEntityNotFound(_0x3f554e,null))[_0xfa85('0x24')](function(_0x4ad345){if(_0x4ad345){return _0x4ad345[_0xfa85('0x74')](_0x30ec10[_0xfa85('0x4a')][_0xfa85('0x6f')]);}})[_0xfa85('0x24')](respondWithStatusCode(_0x3f554e,null))[_0xfa85('0x2f')](handleError(_0x3f554e,null));};exports[_0xfa85('0x75')]=function(_0x1a60fd,_0x5c0eec,_0x31a1b0){return db[_0xfa85('0x76')][_0xfa85('0x5f')]({'where':{'id':_0x1a60fd['params']['id']}})[_0xfa85('0x24')](handleEntityNotFound(_0x5c0eec,null))[_0xfa85('0x24')](function(_0x134814){if(_0x134814){return _0x134814[_0xfa85('0x75')](_0x1a60fd[_0xfa85('0x61')][_0xfa85('0x6f')],_[_0xfa85('0x77')](_0x1a60fd['body'],['ids','id'])||{});}})[_0xfa85('0x24')](respondWithResult(_0x5c0eec,null))['catch'](handleError(_0x5c0eec,null));};exports['getInteractions']=function(_0x3493ab,_0xfb4437,_0x15451d){var _0x37ffb0={'raw':![],'where':{}};var _0x815534={};var _0x21aa46={'count':0x0,'rows':[]};return db[_0xfa85('0x45')][_0xfa85('0x6b')]({'where':{'id':_0x3493ab[_0xfa85('0x5d')]['id']}})[_0xfa85('0x24')](handleEntityNotFound(_0xfb4437,null))['then'](function(_0x33d9e6){if(_0x33d9e6){_0x815534[_0xfa85('0x49')]=_[_0xfa85('0x4b')](db[_0xfa85('0x76')]['rawAttributes']);_0x815534[_0xfa85('0x4a')]=_[_0xfa85('0x4b')](_0x3493ab[_0xfa85('0x4a')]);_0x815534[_0xfa85('0x4c')]=_[_0xfa85('0x4d')](_0x815534[_0xfa85('0x49')],_0x815534['query']);_0x37ffb0[_0xfa85('0x4e')]=_[_0xfa85('0x4d')](_0x815534[_0xfa85('0x49')],qs[_0xfa85('0x4f')](_0x3493ab[_0xfa85('0x4a')][_0xfa85('0x4f')]));_0x37ffb0[_0xfa85('0x4e')]=_0x37ffb0[_0xfa85('0x4e')][_0xfa85('0x50')]?_0x37ffb0['attributes']:_0x815534[_0xfa85('0x49')];if(!_0x3493ab['query']['hasOwnProperty']('nolimit')){_0x37ffb0[_0xfa85('0x35')]=qs[_0xfa85('0x35')](_0x3493ab['query'][_0xfa85('0x35')]);_0x37ffb0[_0xfa85('0x33')]=qs[_0xfa85('0x33')](_0x3493ab['query'][_0xfa85('0x33')]);}_0x37ffb0[_0xfa85('0x52')]=qs[_0xfa85('0x73')](_0x3493ab[_0xfa85('0x4a')][_0xfa85('0x73')]);_0x37ffb0[_0xfa85('0x53')]=qs[_0xfa85('0x4c')](_[_0xfa85('0x54')](_0x3493ab['query'],_0x815534[_0xfa85('0x4c')]));_0x37ffb0['where']['FaxAccountId']=_0x33d9e6['id'];if(_0x3493ab['query'][_0xfa85('0x57')]){_0x37ffb0[_0xfa85('0x53')]=_[_0xfa85('0x55')](_0x37ffb0[_0xfa85('0x53')],{'$or':_[_0xfa85('0x44')](_0x37ffb0['attributes'],function(_0x39ad59){var _0x335bb8={};_0x335bb8[_0x39ad59]={'$like':'%'+_0x3493ab['query'][_0xfa85('0x57')]+'%'};return _0x335bb8;})});}_0x37ffb0=_[_0xfa85('0x55')]({},_0x37ffb0,_0x3493ab[_0xfa85('0x58')]);return db[_0xfa85('0x76')][_0xfa85('0x36')]({'where':_0x37ffb0['where']})[_0xfa85('0x24')](function(_0x2a088e){_0x21aa46[_0xfa85('0x36')]=_0x2a088e;if(_0x3493ab['query']['includeAll']){_0x37ffb0[_0xfa85('0x5a')]=[{'model':db[_0xfa85('0x78')],'as':_0xfa85('0x79'),'required':![]},{'model':db[_0xfa85('0x7a')],'as':_0xfa85('0x7b'),'attributes':[_0xfa85('0x41'),_0xfa85('0x7c'),'internal'],'required':![]},{'model':db[_0xfa85('0x7d')],'as':_0xfa85('0x7e'),'attributes':['id',_0xfa85('0x41'),_0xfa85('0x7f')],'where':_0x3493ab[_0xfa85('0x4a')][_0xfa85('0x80')]?{'id':_0x3493ab[_0xfa85('0x4a')]['tag']}:undefined,'required':_0x3493ab[_0xfa85('0x4a')][_0xfa85('0x80')]?!![]:![]}];}return db['FaxInteraction'][_0xfa85('0x6d')](_0x37ffb0);})[_0xfa85('0x24')](function(_0x2e1c3f){_0x21aa46[_0xfa85('0x5b')]=_0x2e1c3f;return _0x21aa46;});}})['then'](respondWithFilteredResult(_0xfb4437,_0x37ffb0))[_0xfa85('0x2f')](handleError(_0xfb4437,null));};exports['addApplications']=function(_0x576b53,_0x1f531a){var _0x145062=_0x576b53[_0xfa85('0x5d')]['id'];var _0xe134d=_0x576b53[_0xfa85('0x61')];var _0x1de496=0xc8;var _0x203006=null;return db[_0xfa85('0x81')]['transaction']({'isolationLevel':db[_0xfa85('0x81')]['Transaction'][_0xfa85('0x82')][_0xfa85('0x83')]},function(_0x585737){return db['FaxAccount'][_0xfa85('0x6b')]({'where':{'id':_0x145062},'transaction':_0x585737})[_0xfa85('0x24')](function(_0x1bdcf5){if(_0x1bdcf5){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x145062},'transaction':_0x585737})['then'](function(){var _0x58e7f0=_[_0xfa85('0x44')](_0xe134d,function(_0x29e60f){_0x29e60f[_0xfa85('0x68')]=_0x145062;return _0x29e60f;});return db[_0xfa85('0x84')][_0xfa85('0x85')](_0x58e7f0,{'transaction':_0x585737});});}else{_0x1de496=0x194;_0x203006=[];}});})[_0xfa85('0x24')](function(){if(_0x1de496!==0x194){return db['FaxApplication'][_0xfa85('0x86')]({'where':{'FaxAccountId':_0x145062},'order':_0xfa85('0x87')})[_0xfa85('0x24')](function(_0xf2e6fc){_0x203006=_0xf2e6fc;});}})[_0xfa85('0x2f')](function(_0x552f74){_0x1de496=0x1f4;logger[_0xfa85('0x2a')](_0x552f74[_0xfa85('0x40')]);if(_0x552f74[_0xfa85('0x41')]){delete _0x552f74[_0xfa85('0x41')];}_0x203006=_0x552f74;})[_0xfa85('0x88')](function(){if(_0x203006===null){_0x1f531a['sendStatus'](_0x1de496);}else{if(_0x1de496===0x1f4){_0x1f531a[_0xfa85('0x31')](_0x1de496)[_0xfa85('0x42')](_0x203006);}else{_0x1f531a[_0xfa85('0x31')](_0x1de496)[_0xfa85('0x89')](_0x203006);}}});};exports['getApplications']=function(_0x555e18,_0x4d8b8e,_0x8e23bd){var _0x4797ef={};var _0x430da7={};var _0x55a57e;var _0x533301;return db[_0xfa85('0x45')][_0xfa85('0x6b')]({'where':{'id':_0x555e18['params']['id']}})[_0xfa85('0x24')](handleEntityNotFound(_0x4d8b8e,null))[_0xfa85('0x24')](function(_0x4bb095){if(_0x4bb095){_0x55a57e=_0x4bb095;_0x430da7[_0xfa85('0x49')]=_[_0xfa85('0x4b')](db[_0xfa85('0x84')]['rawAttributes']);_0x430da7['query']=_[_0xfa85('0x4b')](_0x555e18[_0xfa85('0x4a')]);_0x430da7['filters']=_[_0xfa85('0x4d')](_0x430da7[_0xfa85('0x49')],_0x430da7[_0xfa85('0x4a')]);_0x4797ef['attributes']=_[_0xfa85('0x4d')](_0x430da7[_0xfa85('0x49')],qs[_0xfa85('0x4f')](_0x555e18[_0xfa85('0x4a')][_0xfa85('0x4f')]));_0x4797ef[_0xfa85('0x4e')]=_0x4797ef[_0xfa85('0x4e')][_0xfa85('0x50')]?_0x4797ef[_0xfa85('0x4e')]:_0x430da7[_0xfa85('0x49')];_0x4797ef[_0xfa85('0x52')]=qs['sort'](_0x555e18['query'][_0xfa85('0x73')]);_0x4797ef[_0xfa85('0x53')]=qs['filters'](_[_0xfa85('0x54')](_0x555e18[_0xfa85('0x4a')],_0x430da7[_0xfa85('0x4c')]));if(_0x555e18['query'][_0xfa85('0x57')]){_0x4797ef[_0xfa85('0x53')]=_[_0xfa85('0x55')](_0x4797ef['where'],{'$or':_[_0xfa85('0x44')](_0x4797ef['attributes'],function(_0x4e5085){var _0x2bd6f8={};_0x2bd6f8[_0x4e5085]={'$like':'%'+_0x555e18[_0xfa85('0x4a')]['filter']+'%'};return _0x2bd6f8;})});}_0x4797ef=_['merge']({},_0x4797ef,_0x555e18[_0xfa85('0x58')]);return _0x55a57e[_0xfa85('0x8a')](_0x4797ef);}})[_0xfa85('0x24')](function(_0x44ca99){if(_0x44ca99){_0x533301=_0x44ca99[_0xfa85('0x50')];if(!_0x555e18[_0xfa85('0x4a')]['hasOwnProperty']('nolimit')){_0x4797ef[_0xfa85('0x35')]=qs['limit'](_0x555e18[_0xfa85('0x4a')][_0xfa85('0x35')]);_0x4797ef[_0xfa85('0x33')]=qs[_0xfa85('0x33')](_0x555e18[_0xfa85('0x4a')][_0xfa85('0x33')]);}return _0x55a57e[_0xfa85('0x8a')](_0x4797ef);}})[_0xfa85('0x24')](function(_0x258942){if(_0x258942){return _0x258942?{'count':_0x533301,'rows':_0x258942}:null;}})[_0xfa85('0x24')](respondWithResult(_0x4d8b8e,null))['catch'](handleError(_0x4d8b8e,null));};function Extension(_0x524fb5,_0xdd0352,_0x119c2b,_0x21baa5){this[_0xfa85('0x8b')]=_0xfa85('0x8c');this['exten']=_0x524fb5[_0xfa85('0x8d')];this['app']=_0x21baa5;this[_0xfa85('0x47')]=_0xfa85('0x8e');this[_0xfa85('0x8f')]=_0xfa85('0x90');this['FaxAccountId']=_0x524fb5['id'];this['priority']=_0xdd0352;this[_0xfa85('0x91')]=_0x119c2b;}function createExtensionsReciveFax(_0x1066e3){var _0x1f11cc=0x1;var _0x1effdf=[];_0x1effdf[_0xfa85('0x92')](new Extension(_0x1066e3,_0x1f11cc,'',_0xfa85('0x93')));_0x1f11cc+=0x1;_0x1effdf['push'](new Extension(_0x1066e3,_0x1f11cc,_0xfa85('0x94'),_0xfa85('0x95')));_0x1f11cc+=0x1;for(var _0x4c68c0 in _0x1066e3){if(_0x1066e3[_0xfa85('0x51')](_0x4c68c0)&&(_0x4c68c0==='ecm'||_0x4c68c0===_0xfa85('0x8d')||_0x4c68c0==='gateway'||_0x4c68c0===_0xfa85('0x96')||_0x4c68c0===_0xfa85('0x97')||_0x4c68c0==='maxrate'||_0x4c68c0==='minrate'||_0x4c68c0===_0xfa85('0x98')||_0x4c68c0===_0xfa85('0x99'))){_0x1effdf[_0xfa85('0x92')](new Extension(_0x1066e3,_0x1f11cc,_0xfa85('0x9a')+_0x4c68c0+')='+_0x1066e3[_0x4c68c0],'Set'));_0x1f11cc+=0x1;}}_0x1effdf[_0xfa85('0x92')](new Extension(_0x1066e3,_0x1f11cc,'6',_0xfa85('0x9b')));_0x1f11cc+=0x1;_0x1effdf[_0xfa85('0x92')](new Extension(_0x1066e3,_0x1f11cc,_0xfa85('0x9c'),'ReceiveFax'));_0x1f11cc=0x0;return _0x1effdf;}exports[_0xfa85('0x9d')]=function(_0x57cf11,_0xea465,_0xa475ae){var _0xa3a481;return db[_0xfa85('0x81')][_0xfa85('0x9e')](function(_0x1f9971){return db[_0xfa85('0x45')][_0xfa85('0x60')](_0x57cf11[_0xfa85('0x61')],{'transaction':_0x1f9971})[_0xfa85('0x24')](function(_0x2aad82){_0xa3a481=_0x2aad82[_0xfa85('0x3d')]({'plain':!![]});return db['VoiceExtension'][_0xfa85('0x85')](createExtensionsReciveFax(_0xa3a481),{'transaction':_0x1f9971});});})[_0xfa85('0x24')](function(){return _0xa3a481;})['then'](respondWithResult(_0xea465,null))['catch'](handleError(_0xea465,null));};exports[_0xfa85('0x9f')]=function(_0x1f85cc,_0x2f4fd4,_0x1a5baf){var _0x865193;return db[_0xfa85('0x81')][_0xfa85('0x9e')](function(_0x445e2a){return db[_0xfa85('0x45')]['update'](_0x1f85cc['body'],{'where':{'id':_0x1f85cc[_0xfa85('0x61')]['id']},'transaction':_0x445e2a})[_0xfa85('0x24')](function(_0xa09eaa){return db['VoiceExtension'][_0xfa85('0x3c')]({'where':{'FaxAccountId':_0x1f85cc[_0xfa85('0x61')]['id']},'transaction':_0x445e2a})['then'](function(_0x3e372c){return db[_0xfa85('0xa0')][_0xfa85('0x85')](createExtensionsReciveFax(_[_0xfa85('0x77')](_0x1f85cc['body'],[_0xfa85('0xa1'),_0xfa85('0x48'),_0xfa85('0xa2'),_0xfa85('0xa3'),_0xfa85('0xa4'),_0xfa85('0xa5')])),{'transaction':_0x445e2a});});});})[_0xfa85('0x24')](function(){return db[_0xfa85('0x45')][_0xfa85('0xa6')](_0x1f85cc[_0xfa85('0x61')]['id']);})[_0xfa85('0x24')](respondWithResult(_0x2f4fd4,null))[_0xfa85('0x2f')](handleError(_0x2f4fd4,null));};exports[_0xfa85('0xa7')]=function(_0x453309,_0x1ce53f,_0x1ada1f){var _0x305aa0={'raw':!![],'where':{}};var _0x2610e8={};var _0x89b971={'count':0x0,'rows':[]};return db[_0xfa85('0x45')][_0xfa85('0x6b')]({'where':{'id':_0x453309[_0xfa85('0x5d')]['id']}})[_0xfa85('0x24')](handleEntityNotFound(_0x1ce53f,null))['then'](function(_0x5cc6ff){if(_0x5cc6ff){_0x2610e8[_0xfa85('0x49')]=_[_0xfa85('0x4b')](db['FaxMessage']['rawAttributes']);_0x2610e8['query']=_[_0xfa85('0x4b')](_0x453309[_0xfa85('0x4a')]);_0x2610e8[_0xfa85('0x4c')]=_[_0xfa85('0x4d')](_0x2610e8[_0xfa85('0x49')],_0x2610e8[_0xfa85('0x4a')]);_0x305aa0[_0xfa85('0x4e')]=_[_0xfa85('0x4d')](_0x2610e8[_0xfa85('0x49')],qs[_0xfa85('0x4f')](_0x453309[_0xfa85('0x4a')][_0xfa85('0x4f')]));_0x305aa0[_0xfa85('0x4e')]=_0x305aa0['attributes'][_0xfa85('0x50')]?_0x305aa0[_0xfa85('0x4e')]:_0x2610e8[_0xfa85('0x49')];if(!_0x453309['query'][_0xfa85('0x51')](_0xfa85('0x6c'))){_0x305aa0[_0xfa85('0x35')]=qs[_0xfa85('0x35')](_0x453309['query'][_0xfa85('0x35')]);_0x305aa0[_0xfa85('0x33')]=qs['offset'](_0x453309[_0xfa85('0x4a')][_0xfa85('0x33')]);}_0x305aa0[_0xfa85('0x52')]=qs[_0xfa85('0x73')](_0x453309['query'][_0xfa85('0x73')]);_0x305aa0[_0xfa85('0x53')]=qs[_0xfa85('0x4c')](_[_0xfa85('0x54')](_0x453309['query'],_0x2610e8[_0xfa85('0x4c')]));_0x305aa0[_0xfa85('0x53')][_0xfa85('0x68')]=_0x5cc6ff['id'];if(_0x453309[_0xfa85('0x4a')]['filter']){_0x305aa0[_0xfa85('0x53')]=_[_0xfa85('0x55')](_0x305aa0[_0xfa85('0x53')],{'$or':_['map'](_0x305aa0[_0xfa85('0x4e')],function(_0x237d03){var _0x19e5c6={};_0x19e5c6[_0x237d03]={'$like':'%'+_0x453309[_0xfa85('0x4a')][_0xfa85('0x57')]+'%'};return _0x19e5c6;})});}if(_0x453309[_0xfa85('0x4a')]['$gte']){var _0x4273ca=_0x453309[_0xfa85('0x4a')]['$gte'][_0xfa85('0xa8')](',');var _0x468e2a={};_0x468e2a[_0x4273ca[0x0]]={'$gte':moment(_0x4273ca[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x305aa0[_0xfa85('0x53')]=_[_0xfa85('0x55')](_0x305aa0[_0xfa85('0x53')],_0x468e2a);}_0x305aa0=_['merge']({},_0x305aa0,_0x453309[_0xfa85('0x58')]);return db[_0xfa85('0xa9')][_0xfa85('0x36')]({'where':_0x305aa0['where']})[_0xfa85('0x24')](function(_0x2e3041){_0x89b971['count']=_0x2e3041;if(_0x453309[_0xfa85('0x4a')][_0xfa85('0x59')]){_0x305aa0[_0xfa85('0x5a')]=[{'all':!![]}];}return db[_0xfa85('0xa9')][_0xfa85('0x6d')](_0x305aa0);})[_0xfa85('0x24')](function(_0x17cc6a){_0x89b971[_0xfa85('0x5b')]=_0x17cc6a;return _0x89b971;});}})['then'](respondWithFilteredResult(_0x1ce53f,_0x305aa0))[_0xfa85('0x2f')](handleError(_0x1ce53f,null));};exports[_0xfa85('0x42')]=function(_0x256439,_0x487235,_0x1745b0){var _0x32af10,_0x3aa229={},_0x3ccd17;if(_0x256439['body']['to']){_0x3ccd17=_0x256439[_0xfa85('0x61')]['to'][0x0];}return db[_0xfa85('0x45')][_0xfa85('0x5f')]({'where':{'id':_0x256439[_0xfa85('0x5d')]['id']},'include':[{'model':db[_0xfa85('0xaa')],'as':_0xfa85('0xab'),'include':[{'model':db[_0xfa85('0x78')],'as':_0xfa85('0xac'),'where':{'fax':_0x3ccd17},'limit':0x1,'order':[[_0xfa85('0xa3'),_0xfa85('0xad')]]}]}]})[_0xfa85('0x24')](handleEntityNotFound(_0x487235,null))['then'](function(_0x49d4a4){_0x32af10=_0x49d4a4;if(_0x256439[_0xfa85('0x61')][_0xfa85('0xae')]&&_0x256439[_0xfa85('0x61')][_0xfa85('0xae')][_0xfa85('0x50')]){for(var _0x2e32db=0x0;_0x2e32db<_0x256439['body'][_0xfa85('0xae')]['length'];_0x2e32db+=0x1){_0x256439['body'][_0xfa85('0xae')][_0x2e32db]={'filename':_0x256439['body'][_0xfa85('0xae')][_0x2e32db][_0xfa85('0x41')],'id':_0x256439[_0xfa85('0x61')]['attachments'][_0x2e32db]['id'],'path':path[_0xfa85('0xaf')](config['root'],_0xfa85('0xb0'),_0x256439['body'][_0xfa85('0xae')][_0x2e32db]['basename'])};}}return respondWithRpcPromise(_0xfa85('0xb1'),_0xfa85('0xb1'),{'FaxAccountId':_[_0xfa85('0xb2')](_0x256439[_0xfa85('0x5d')]['id'])?undefined:_0x256439[_0xfa85('0x5d')]['id'],'path':_[_0xfa85('0xb2')](_0x256439['body']['attachments'][0x0][_0xfa85('0x6')])?undefined:_0x256439[_0xfa85('0x61')][_0xfa85('0xae')][0x0][_0xfa85('0x6')],'fax':_[_0xfa85('0xb2')](_0x256439[_0xfa85('0x61')]['to'][0x0])?undefined:_0x256439['body']['to'][0x0]},client9002);})[_0xfa85('0x24')](function(){if(_0x32af10){if(_[_0xfa85('0xb2')](_0x256439['body'][_0xfa85('0xb3')])){_0x256439[_0xfa85('0x61')][_0xfa85('0xb3')]=util[_0xfa85('0xb4')](_0xfa85('0xb5'),_0x32af10[_0xfa85('0x41')],_0x32af10[_0xfa85('0xb6')]);}if(_0x32af10['List']){if(_0x32af10['List'][_0xfa85('0xac')][_0xfa85('0x50')]){return _0x32af10['List'][_0xfa85('0xac')][0x0];}else{return db[_0xfa85('0x78')][_0xfa85('0x60')](_[_0xfa85('0x1a')](_0x256439[_0xfa85('0x61')],{'firstName':_0x256439['body']['to'][0x0],'phone':_0x256439[_0xfa85('0x61')]['to'][0x0],'fax':_0x256439[_0xfa85('0x61')]['to'][0x0],'ListId':_0x32af10['ListId']}));}}else{throw new Error(_0xfa85('0xb7'));}}else{throw new Error(_0xfa85('0xb8'));}})['then'](function(_0x40ee90){if(_0x40ee90){return db[_0xfa85('0x76')][_0xfa85('0x5f')]({'where':{'ContactId':_0x40ee90['id'],'closed':![],'FaxAccountId':_0x32af10['id']}})[_0xfa85('0x24')](function(_0x4cca4f){if(_0x4cca4f){return[_0x4cca4f,![]];}return db['FaxInteraction'][_0xfa85('0x60')]({'UserId':_0x256439['user']['id'],'ContactId':_0x40ee90['id'],'FaxAccountId':_0x32af10['id'],'fax':_0x256439[_0xfa85('0x61')]['to'][0x0],'firstMsgDirection':_0xfa85('0xb9'),'Messages':[_[_0xfa85('0x55')](_0x256439[_0xfa85('0x61')],{'read':![],'body':_0x256439[_0xfa85('0x61')]['attachments'][0x0][_0xfa85('0xba')],'FaxAccountId':_0x32af10['id'],'UserId':_0x256439[_0xfa85('0xbb')]['id'],'ContactId':_0x40ee90['id'],'AttachmentId':_0x256439['body'][_0xfa85('0xae')][0x0]['id']})]},{'include':[{'model':db[_0xfa85('0xa9')],'as':'Messages'}]})[_0xfa85('0x24')](function(_0x438fb5){return[_0x438fb5,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xfa85('0xbc')](function(_0x3726f5,_0x2fd7c3){if(_0x2fd7c3){return _0x3726f5;}return db[_0xfa85('0xa9')]['create']({'direction':_0xfa85('0xb9'),'read':![],'body':_0x256439[_0xfa85('0x61')][_0xfa85('0xae')][0x0]['filename'],'FaxAccountId':_0x32af10['id'],'FaxInteractionId':_0x3726f5['id'],'UserId':_0x256439[_0xfa85('0xbb')]['id'],'ContactId':_0x3726f5[_0xfa85('0xbd')],'AttachmentId':_0x256439[_0xfa85('0x61')]['attachments'][0x0]['id']})['then'](function(_0x302d21){_0x3726f5[_0xfa85('0xbe')][_0xfa85('0xbf')]=[];_0x3726f5[_0xfa85('0xbe')][_0xfa85('0xbf')]['push'](_0x302d21['dataValues']);return _0x3726f5;});})[_0xfa85('0x24')](function(_0x42f2bf){respondWithRpcPromise(_0xfa85('0xc0'),'SendFax',{'FaxAccountId':_['isNil'](_0x256439[_0xfa85('0x5d')]['id'])?undefined:_0x256439[_0xfa85('0x5d')]['id'],'path':_[_0xfa85('0xb2')](_0x256439['body'][_0xfa85('0xae')][0x0][_0xfa85('0x6')])?undefined:_0x256439[_0xfa85('0x61')][_0xfa85('0xae')][0x0][_0xfa85('0x6')],'fax':_[_0xfa85('0xb2')](_0x256439[_0xfa85('0x61')]['to'][0x0])?undefined:_0x256439[_0xfa85('0x61')]['to'][0x0],'AttachmentId':_0x256439[_0xfa85('0x61')][_0xfa85('0xae')][0x0]['id']},client9002)['then'](function(_0x4e31e5){logger['info'](_0xfa85('0xc1'),_0x4e31e5);})['catch'](function(_0x389fbd){logger['info'](_0xfa85('0xc1'),_0x389fbd);});return _0x42f2bf;})[_0xfa85('0x24')](respondWithResult(_0x487235,null))[_0xfa85('0x2f')](handleError(_0x487235,null));};exports[_0xfa85('0xc2')]=function(_0x3132c2,_0x57e39f,_0x2b6a4f){return db[_0xfa85('0x45')][_0xfa85('0x5f')]({'where':{'id':_0x3132c2[_0xfa85('0x5d')]['id']}})[_0xfa85('0x24')](handleEntityNotFound(_0x57e39f,null))[_0xfa85('0x24')](function(_0x5a27e7){if(_0x5a27e7){return _0x5a27e7[_0xfa85('0xc2')](_0x3132c2[_0xfa85('0x61')]['ids'],_[_0xfa85('0x77')](_0x3132c2[_0xfa85('0x61')],['ids','id'])||{})[_0xfa85('0xbc')](function(_0x47c65f){for(var _0x5b2e13=0x0;_0x5b2e13<_0x3132c2[_0xfa85('0x61')][_0xfa85('0x6f')][_0xfa85('0x50')];_0x5b2e13+=0x1){socket[_0xfa85('0xc3')]('userFaxAccount:save',{'UserId':Number(_0x3132c2[_0xfa85('0x61')]['ids'][_0x5b2e13]),'FaxAccountId':Number(_0x3132c2[_0xfa85('0x5d')]['id'])});}return _0x47c65f;});}})[_0xfa85('0x24')](respondWithResult(_0x57e39f,null))[_0xfa85('0x2f')](handleError(_0x57e39f,null));};exports['removeAgents']=function(_0x285fa3,_0x173087,_0x4bb870){return db['FaxAccount'][_0xfa85('0x5f')]({'where':{'id':_0x285fa3[_0xfa85('0x5d')]['id']}})[_0xfa85('0x24')](handleEntityNotFound(_0x173087,null))['then'](function(_0x536498){if(_0x536498){return _0x536498[_0xfa85('0xc4')](_0x285fa3[_0xfa85('0x4a')][_0xfa85('0x6f')])[_0xfa85('0x24')](function(){if(_[_0xfa85('0xc5')](_0x285fa3[_0xfa85('0x4a')][_0xfa85('0x6f')])){for(var _0xb78dc1=0x0;_0xb78dc1<_0x285fa3[_0xfa85('0x4a')][_0xfa85('0x6f')][_0xfa85('0x50')];_0xb78dc1+=0x1){socket[_0xfa85('0xc3')]('userFaxAccount:remove',{'UserId':Number(_0x285fa3[_0xfa85('0x4a')][_0xfa85('0x6f')][_0xb78dc1]),'FaxAccountId':Number(_0x285fa3[_0xfa85('0x5d')]['id'])});}}else{socket[_0xfa85('0xc3')](_0xfa85('0xc6'),{'UserId':Number(_0x285fa3[_0xfa85('0x4a')]['ids']),'FaxAccountId':Number(_0x285fa3[_0xfa85('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x173087,null))[_0xfa85('0x2f')](handleError(_0x173087,null));};exports[_0xfa85('0xc7')]=function(_0x1bc802,_0x195237,_0x59fede){var _0x5ea5a5={};var _0x75cfa0={};var _0x279524;var _0x40ffba;return db['FaxAccount'][_0xfa85('0x6b')]({'where':{'id':_0x1bc802[_0xfa85('0x5d')]['id']}})[_0xfa85('0x24')](handleEntityNotFound(_0x195237,null))[_0xfa85('0x24')](function(_0x45aaab){if(_0x45aaab){_0x279524=_0x45aaab;_0x75cfa0[_0xfa85('0x49')]=_[_0xfa85('0x4b')](db[_0xfa85('0x7a')][_0xfa85('0x46')]);_0x75cfa0[_0xfa85('0x4a')]=_['keys'](_0x1bc802[_0xfa85('0x4a')]);_0x75cfa0['filters']=_[_0xfa85('0x4d')](_0x75cfa0[_0xfa85('0x49')],_0x75cfa0[_0xfa85('0x4a')]);_0x5ea5a5['attributes']=_[_0xfa85('0x4d')](_0x75cfa0[_0xfa85('0x49')],qs[_0xfa85('0x4f')](_0x1bc802['query'][_0xfa85('0x4f')]));_0x5ea5a5['attributes']=_0x5ea5a5['attributes']['length']?_0x5ea5a5[_0xfa85('0x4e')]:_0x75cfa0['model'];_0x5ea5a5[_0xfa85('0x52')]=qs[_0xfa85('0x73')](_0x1bc802[_0xfa85('0x4a')]['sort']);_0x5ea5a5['where']=qs[_0xfa85('0x4c')](_[_0xfa85('0x54')](_0x1bc802['query'],_0x75cfa0[_0xfa85('0x4c')]));if(_0x1bc802[_0xfa85('0x4a')][_0xfa85('0x57')]){_0x5ea5a5[_0xfa85('0x53')]=_[_0xfa85('0x55')](_0x5ea5a5[_0xfa85('0x53')],{'$or':_['map'](_0x5ea5a5[_0xfa85('0x4e')],function(_0x2d5dff){var _0x496b22={};_0x496b22[_0x2d5dff]={'$like':'%'+_0x1bc802[_0xfa85('0x4a')][_0xfa85('0x57')]+'%'};return _0x496b22;})});}_0x5ea5a5=_[_0xfa85('0x55')]({},_0x5ea5a5,_0x1bc802[_0xfa85('0x58')]);return _0x279524[_0xfa85('0xc7')](_0x5ea5a5);}})['then'](function(_0x16e1b6){if(_0x16e1b6){_0x40ffba=_0x16e1b6[_0xfa85('0x50')];if(!_0x1bc802['query'][_0xfa85('0x51')](_0xfa85('0x6c'))){_0x5ea5a5[_0xfa85('0x35')]=qs['limit'](_0x1bc802['query'][_0xfa85('0x35')]);_0x5ea5a5[_0xfa85('0x33')]=qs[_0xfa85('0x33')](_0x1bc802[_0xfa85('0x4a')][_0xfa85('0x33')]);}return _0x279524[_0xfa85('0xc7')](_0x5ea5a5);}})[_0xfa85('0x24')](function(_0x579d0f){if(_0x579d0f){return _0x579d0f?{'count':_0x40ffba,'rows':_0x579d0f}:null;}})[_0xfa85('0x24')](respondWithResult(_0x195237,null))[_0xfa85('0x2f')](handleError(_0x195237,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index efae230..b5d1611 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 _0x2232=['events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4b35ce,_0x4f1e65){var _0x5e5879=function(_0x9ef94){while(--_0x9ef94){_0x4b35ce['push'](_0x4b35ce['shift']());}};_0x5e5879(++_0x4f1e65);}(_0x2232,0xd2));var _0x2223=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2232[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x2223('0x0'));var FaxAccount=require(_0x2223('0x1'))['db'][_0x2223('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x2223('0x3')](0x0);var events={'afterCreate':_0x2223('0x4'),'afterUpdate':_0x2223('0x5'),'afterDestroy':_0x2223('0x6')};function emitEvent(_0x2e2ba9){return function(_0x33ff80,_0x46221a,_0x46905f){FaxAccountEvents['emit'](_0x2e2ba9+':'+_0x33ff80['id'],_0x33ff80);FaxAccountEvents[_0x2223('0x7')](_0x2e2ba9,_0x33ff80);_0x46905f(null);};}for(var e in events){if(events[_0x2223('0x8')](e)){var event=events[e];FaxAccount[_0x2223('0x9')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0xbd65=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0x11b4fb,_0x10c784){var _0x56cbb5=function(_0x56d812){while(--_0x56d812){_0x11b4fb['push'](_0x11b4fb['shift']());}};_0x56cbb5(++_0x10c784);}(_0xbd65,0x102));var _0x5bd6=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xbd65[_0x53ccf2];return _0x5a2964;};'use strict';var EventEmitter=require(_0x5bd6('0x0'));var FaxAccount=require(_0x5bd6('0x1'))['db'][_0x5bd6('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x5bd6('0x3')](0x0);var events={'afterCreate':_0x5bd6('0x4'),'afterUpdate':_0x5bd6('0x5'),'afterDestroy':_0x5bd6('0x6')};function emitEvent(_0x162a6e){return function(_0x93918f,_0x1c297d,_0x36c2ea){FaxAccountEvents[_0x5bd6('0x7')](_0x162a6e+':'+_0x93918f['id'],_0x93918f);FaxAccountEvents[_0x5bd6('0x7')](_0x162a6e,_0x93918f);_0x36c2ea(null);};}for(var e in events){if(events[_0x5bd6('0x8')](e)){var event=events[e];FaxAccount[_0x5bd6('0x9')](e,emitEvent(event));}}module[_0x5bd6('0xa')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 1c0a8b2..c9977f9 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 _0x6d10=['fax_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','FaxAccount'];(function(_0x2aaeac,_0x30bda5){var _0x757741=function(_0x5893d2){while(--_0x5893d2){_0x2aaeac['push'](_0x2aaeac['shift']());}};_0x757741(++_0x30bda5);}(_0x6d10,0x64));var _0x06d1=function(_0x10ada7,_0x35b921){_0x10ada7=_0x10ada7-0x0;var _0x2d3d95=_0x6d10[_0x10ada7];return _0x2d3d95;};'use strict';var _=require(_0x06d1('0x0'));var util=require(_0x06d1('0x1'));var logger=require(_0x06d1('0x2'))(_0x06d1('0x3'));var moment=require('moment');var BPromise=require(_0x06d1('0x4'));var rp=require(_0x06d1('0x5'));var fs=require('fs');var path=require(_0x06d1('0x6'));var rimraf=require(_0x06d1('0x7'));var config=require(_0x06d1('0x8'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x3b5eb6,_0x13517b){return _0x3b5eb6['define'](_0x06d1('0x9'),attributes,{'tableName':_0x06d1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c1c=['request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','fax_accounts','lodash','util','../../config/logger','moment'];(function(_0x4b652c,_0xdf9e7c){var _0x23f319=function(_0x169341){while(--_0x169341){_0x4b652c['push'](_0x4b652c['shift']());}};_0x23f319(++_0xdf9e7c);}(_0x6c1c,0xac));var _0xc6c1=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x6c1c[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0xc6c1('0x0'));var util=require(_0xc6c1('0x1'));var logger=require(_0xc6c1('0x2'))('api');var moment=require(_0xc6c1('0x3'));var BPromise=require('bluebird');var rp=require(_0xc6c1('0x4'));var fs=require('fs');var path=require(_0xc6c1('0x5'));var rimraf=require(_0xc6c1('0x6'));var config=require(_0xc6c1('0x7'));var attributes=require(_0xc6c1('0x8'));module[_0xc6c1('0x9')]=function(_0x455080,_0x361a43){return _0x455080['define']('FaxAccount',attributes,{'tableName':_0xc6c1('0xa'),'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 1c9ff03..0171c7b 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 _0x7eb3=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','where','attributes','include','map','model','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','FaxApplication','Applications','applications','list','orderBy','priority','length','create','contact','FaxInteraction','spread','get','push','close','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','UserId','User','find','name','unshift','agent','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','lodash','util'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x7eb3,0x1cf));var _0x37eb=function(_0x16c5dc,_0x4f99e6){_0x16c5dc=_0x16c5dc-0x0;var _0x548f8f=_0x7eb3[_0x16c5dc];return _0x548f8f;};'use strict';var _=require(_0x37eb('0x0'));var util=require(_0x37eb('0x1'));var moment=require(_0x37eb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37eb('0x3'));var db=require(_0x37eb('0x4'))['db'];var utils=require(_0x37eb('0x5'));var logger=require(_0x37eb('0x6'))(_0x37eb('0x7'));var config=require('../../config/environment');var jayson=require(_0x37eb('0x8'));var client=jayson[_0x37eb('0x9')][_0x37eb('0xa')]({'port':0x232c});config[_0x37eb('0xb')]=_[_0x37eb('0xc')](config[_0x37eb('0xb')],{'host':_0x37eb('0xd'),'port':0x18eb});var socket=require(_0x37eb('0xe'))(new Redis(config[_0x37eb('0xb')]));require(_0x37eb('0xf'))['register'](socket);function respondWithRpcPromise(_0x5e60d9,_0x304f38,_0x54fec0){return new BPromise(function(_0x1fad8a,_0x2c2b4e){return client[_0x37eb('0x10')](_0x5e60d9,_0x54fec0)[_0x37eb('0x11')](function(_0x2335f5){logger[_0x37eb('0x12')](_0x37eb('0x13'),_0x304f38,_0x37eb('0x14'));logger[_0x37eb('0x15')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x304f38,_0x37eb('0x14'),JSON[_0x37eb('0x16')](_0x2335f5));if(_0x2335f5[_0x37eb('0x17')]){if(_0x2335f5[_0x37eb('0x17')][_0x37eb('0x18')]===0x1f4){logger[_0x37eb('0x17')](_0x37eb('0x13'),_0x304f38,_0x2335f5['error']['message']);return _0x2c2b4e(_0x2335f5['error']['message']);}logger[_0x37eb('0x17')]('FaxAccount,\x20%s,\x20%s',_0x304f38,_0x2335f5[_0x37eb('0x17')][_0x37eb('0x19')]);return _0x1fad8a(_0x2335f5['error'][_0x37eb('0x19')]);}else{logger[_0x37eb('0x12')]('FaxAccount,\x20%s,\x20%s',_0x304f38,_0x37eb('0x14'));_0x1fad8a(_0x2335f5[_0x37eb('0x1a')]['message']);}})[_0x37eb('0x1b')](function(_0x4e4c02){logger[_0x37eb('0x17')](_0x37eb('0x13'),_0x304f38,_0x4e4c02);_0x2c2b4e(_0x4e4c02);});});}exports[_0x37eb('0x1c')]=function(_0x12c31f){var _0x61f8d9=this;return new Promise(function(_0x30e1a5,_0x3330e9){return db[_0x37eb('0x1d')][_0x37eb('0x1e')]({'raw':_0x12c31f[_0x37eb('0x1f')]?_0x12c31f['options']['raw']===undefined?!![]:![]:!![],'where':_0x12c31f[_0x37eb('0x1f')]?_0x12c31f[_0x37eb('0x1f')][_0x37eb('0x20')]||null:null,'attributes':_0x12c31f['options']?_0x12c31f[_0x37eb('0x1f')][_0x37eb('0x21')]||null:null,'limit':_0x12c31f[_0x37eb('0x1f')]?_0x12c31f[_0x37eb('0x1f')]['limit']||null:null,'include':_0x12c31f['options']?_0x12c31f[_0x37eb('0x1f')][_0x37eb('0x22')]?_[_0x37eb('0x23')](_0x12c31f[_0x37eb('0x1f')][_0x37eb('0x22')],function(_0x59687a){return{'model':db[_0x59687a[_0x37eb('0x24')]],'as':_0x59687a['as'],'attributes':_0x59687a[_0x37eb('0x21')],'include':_0x59687a[_0x37eb('0x22')]?_[_0x37eb('0x23')](_0x59687a['include'],function(_0x37d38e){return{'model':db[_0x37d38e[_0x37eb('0x24')]],'as':_0x37d38e['as'],'attributes':_0x37d38e[_0x37eb('0x21')],'include':_0x37d38e[_0x37eb('0x22')]?_['map'](_0x37d38e[_0x37eb('0x22')],function(_0x2a4c72){return{'model':db[_0x2a4c72[_0x37eb('0x24')]],'as':_0x2a4c72['as'],'attributes':_0x2a4c72[_0x37eb('0x21')]};}):[]};}):[]};}):[]:[]})[_0x37eb('0x11')](function(_0x76d52f){logger[_0x37eb('0x12')]('GetFaxAccount',_0x12c31f);logger['debug'](_0x37eb('0x1c'),_0x12c31f,JSON[_0x37eb('0x16')](_0x76d52f));_0x30e1a5(_0x76d52f);})[_0x37eb('0x1b')](function(_0x19118b){logger[_0x37eb('0x17')](_0x37eb('0x1c'),_0x19118b[_0x37eb('0x19')],_0x12c31f);_0x3330e9(_0x61f8d9[_0x37eb('0x17')](0x1f4,_0x19118b[_0x37eb('0x19')]));});});};exports[_0x37eb('0x25')]=function(_0x274635,_0x512f40,_0x2cbb88){var _0x131f4d=this;return new Promise(function(_0x1c3bf4,_0x42e507){var _0x20065b={'body':_0x274635[_0x37eb('0x26')],'channel':_0x37eb('0x27')};var _0x60ae68=[];var _0x393808=[];var _0x460d52={};return db[_0x37eb('0x28')][_0x37eb('0x29')]()[_0x37eb('0x11')](function(_0xf97230){if(!_0xf97230){throw new db[(_0x37eb('0x2a'))][(_0x37eb('0x2b'))](_0x37eb('0x2c'));}_0x60ae68=_['difference'](_[_0x37eb('0x2d')](_0xf97230),[_0x37eb('0x2e'),_0x37eb('0x2f')]);_0x393808=_['difference'](_[_0x37eb('0x2d')](_0xf97230),['createdAt',_0x37eb('0x2f'),_0x37eb('0x30'),_0x37eb('0x31')]);if(_0x274635[_0x37eb('0x26')]['id']){delete _0x274635[_0x37eb('0x26')]['id'];}if(_[_0x37eb('0x32')](_0x274635[_0x37eb('0x26')][_0x37eb('0x33')])){throw new db[(_0x37eb('0x2a'))][(_0x37eb('0x2b'))](_0x37eb('0x34'));}if(_['isNil'](_0x274635[_0x37eb('0x26')]['body'])||_0x274635[_0x37eb('0x26')][_0x37eb('0x26')]===''){throw new db[(_0x37eb('0x2a'))][(_0x37eb('0x2b'))](_0x37eb('0x35'));}if(_[_0x37eb('0x32')](_0x274635[_0x37eb('0x26')][_0x37eb('0x36')])){throw new db[(_0x37eb('0x2a'))]['ValidationError'](_0x37eb('0x37')+_0x393808);}if(!_[_0x37eb('0x38')](_0x393808,_0x274635[_0x37eb('0x26')]['mapKey'])){throw new db[(_0x37eb('0x2a'))][(_0x37eb('0x2b'))](_0x37eb('0x39')+_0x393808);}_0x460d52[_0x274635['body'][_0x37eb('0x36')]]=_0x274635[_0x37eb('0x26')][_0x37eb('0x33')];})['then'](function(){return db[_0x37eb('0x1d')]['find']({'where':{'id':_0x274635[_0x37eb('0x3a')]['id']},'include':[{'model':db[_0x37eb('0x3b')],'as':_0x37eb('0x3c'),'include':[{'model':db[_0x37eb('0x28')],'as':_0x37eb('0x3d'),'where':_0x460d52,'limit':0x1,'order':[[_0x37eb('0x2f'),'DESC']]}]},{'model':db[_0x37eb('0x3e')],'as':_0x37eb('0x3f')}]});})[_0x37eb('0x11')](function(_0x57c364){if(_0x57c364&&_0x57c364['List']){var _0x3c968f=_0x57c364['get']({'plain':!![]});_0x20065b['account']=_0x3c968f;_0x20065b[_0x37eb('0x40')]=_0x3c968f['Applications'];_0x20065b[_0x37eb('0x41')]=_0x3c968f[_0x37eb('0x3c')];_0x20065b[_0x37eb('0x40')]=_[_0x37eb('0x42')](_0x20065b['applications'],[_0x37eb('0x43')],['asc']);if(_0x20065b[_0x37eb('0x3a')][_0x37eb('0x3f')]){delete _0x20065b[_0x37eb('0x3a')][_0x37eb('0x3f')];}if(_0x20065b[_0x37eb('0x3a')][_0x37eb('0x3c')]&&_0x20065b[_0x37eb('0x3a')][_0x37eb('0x3c')]['Contacts'][_0x37eb('0x44')]){return _0x20065b[_0x37eb('0x3a')][_0x37eb('0x3c')]['Contacts'][0x0];}var _0x1e852d=_['defaults'](_0x274635['body'],{'firstName':_0x274635['body'][_0x37eb('0x33')],'ListId':_0x3c968f[_0x37eb('0x31')]});_0x1e852d[_0x274635['body'][_0x37eb('0x36')]]=_0x274635[_0x37eb('0x26')][_0x37eb('0x33')];return db['CmContact'][_0x37eb('0x45')](_0x1e852d,{'fields':_0x60ae68,'raw':!![]});}})['then'](function(_0x1663f1){_0x20065b[_0x37eb('0x46')]=_0x1663f1;if(_0x1663f1){var _0x298c94={'ContactId':_0x1663f1['id'],'FaxAccountId':_0x274635[_0x37eb('0x3a')]['id'],'fax':_0x1663f1[_0x37eb('0x27')]};return db[_0x37eb('0x47')]['find']({'where':{'ContactId':_0x1663f1['id'],'closed':![],'FaxAccountId':_0x274635['account']['id']}})[_0x37eb('0x11')](function(_0x56f030){if(_0x56f030){return[_0x56f030,![]];}return db[_0x37eb('0x47')]['create'](_0x298c94)['then'](function(_0xeba283){return[_0xeba283,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x37eb('0x48')](function(_0x28a1b8,_0x1181a3){var _0xc70fc1=_0x28a1b8[_0x37eb('0x49')]({'plain':!![]});if(_0x1181a3){if(_0x20065b[_0x37eb('0x3a')]['autoclose']){_0x20065b[_0x37eb('0x40')][_0x37eb('0x4a')]({'id':0x0,'priority':_0x20065b[_0x37eb('0x40')][_0x37eb('0x44')]+0x1,'app':_0x37eb('0x4b'),'appdata':_0x37eb('0x4c'),'interval':_0x37eb('0x4d')});}_0xc70fc1[_0x37eb('0x4e')]=!![];}else{_0xc70fc1['created']=![];}_0x20065b[_0x37eb('0x4f')]=_0xc70fc1;return db['FaxMessage']['create']({'body':_0x274635[_0x37eb('0x26')][_0x37eb('0x26')],'FaxAccountId':_0x274635[_0x37eb('0x3a')]['id'],'FaxInteractionId':_0x28a1b8['id'],'direction':'in','ContactId':_0x28a1b8[_0x37eb('0x50')],'AttachmentId':_0x274635[_0x37eb('0x26')][_0x37eb('0x51')]});})[_0x37eb('0x11')](function(_0x3b7a8b){_0x20065b[_0x37eb('0x19')]=_0x3b7a8b;if(!_0x20065b['interaction'][_0x37eb('0x52')])return;return db[_0x37eb('0x53')][_0x37eb('0x54')]({'attributes':['id',_0x37eb('0x55')],'where':{'id':_0x20065b['interaction'][_0x37eb('0x52')]}});})[_0x37eb('0x11')](function(_0x3ac6ad){if(_0x3ac6ad){_0x20065b[_0x37eb('0x40')][_0x37eb('0x56')]({'id':0x0,'priority':0x0,'app':_0x37eb('0x57'),'appdata':_0x3ac6ad[_0x37eb('0x55')]+','+(_0x20065b[_0x37eb('0x3a')][_0x37eb('0x58')]||0xa),'interval':_0x37eb('0x4d')});}if(!_0x20065b[_0x37eb('0x4f')][_0x37eb('0x59')])return;return db['FaxQueue']['find']({'attributes':['id','name'],'where':{'id':_0x20065b[_0x37eb('0x4f')][_0x37eb('0x59')]}});})['then'](function(_0x2d18){if(_0x2d18){_0x20065b[_0x37eb('0x40')][_0x37eb('0x56')]({'id':0x0,'priority':0x1,'app':_0x37eb('0x5a'),'appdata':_0x2d18['name']+','+(_0x20065b['account'][_0x37eb('0x5b')]||0x12c),'interval':_0x37eb('0x4d')});}return respondWithRpcPromise(_0x37eb('0x5c'),'startRouting',_0x20065b);})[_0x37eb('0x11')](function(_0x38e2c9){_0x1c3bf4(_0x38e2c9);})[_0x37eb('0x1b')](function(_0x189812){_0x42e507(_0x131f4d[_0x37eb('0x17')](0x1f4,_0x189812['message']));});});}; \ No newline at end of file +var _0xf3a8=['defaults','localhost','socket.io-emitter','./faxAccount.socket','request','then','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','FaxAccount,\x20%s,\x20%s','catch','FaxAccount','findAll','options','raw','attributes','include','map','model','info','GetFaxAccount','stringify','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','CmList','List','Applications','list','applications','orderBy','priority','asc','account','Contacts','length','contact','FaxInteraction','Contact\x20not\x20found','spread','get','autoclose','push','unmanaged','*,*,*,*','created','FaxMessage','ContactId','interaction','UserId','User','unshift','agent','queueId','FaxQueue','name','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x315607,_0x51f930){var _0x250340=function(_0x3ebca9){while(--_0x3ebca9){_0x315607['push'](_0x315607['shift']());}};_0x250340(++_0x51f930);}(_0xf3a8,0xa4));var _0x8f3a=function(_0x28bbb6,_0x1bf830){_0x28bbb6=_0x28bbb6-0x0;var _0x9574=_0xf3a8[_0x28bbb6];return _0x9574;};'use strict';var _=require(_0x8f3a('0x0'));var util=require(_0x8f3a('0x1'));var moment=require(_0x8f3a('0x2'));var BPromise=require('bluebird');var rs=require(_0x8f3a('0x3'));var fs=require('fs');var Redis=require(_0x8f3a('0x4'));var db=require(_0x8f3a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8f3a('0x6'))(_0x8f3a('0x7'));var config=require(_0x8f3a('0x8'));var jayson=require(_0x8f3a('0x9'));var client=jayson[_0x8f3a('0xa')]['http']({'port':0x232c});config[_0x8f3a('0xb')]=_[_0x8f3a('0xc')](config[_0x8f3a('0xb')],{'host':_0x8f3a('0xd'),'port':0x18eb});var socket=require(_0x8f3a('0xe'))(new Redis(config[_0x8f3a('0xb')]));require(_0x8f3a('0xf'))['register'](socket);function respondWithRpcPromise(_0xf30294,_0x40d85b,_0x1fc77c){return new BPromise(function(_0x4d75d2,_0x25c8ce){return client[_0x8f3a('0x10')](_0xf30294,_0x1fc77c)[_0x8f3a('0x11')](function(_0x58ed6c){logger['info']('FaxAccount,\x20%s,\x20%s',_0x40d85b,'request\x20sent');logger['debug'](_0x8f3a('0x12'),_0x40d85b,_0x8f3a('0x13'),JSON['stringify'](_0x58ed6c));if(_0x58ed6c[_0x8f3a('0x14')]){if(_0x58ed6c[_0x8f3a('0x14')][_0x8f3a('0x15')]===0x1f4){logger[_0x8f3a('0x14')]('FaxAccount,\x20%s,\x20%s',_0x40d85b,_0x58ed6c[_0x8f3a('0x14')][_0x8f3a('0x16')]);return _0x25c8ce(_0x58ed6c[_0x8f3a('0x14')]['message']);}logger[_0x8f3a('0x14')](_0x8f3a('0x17'),_0x40d85b,_0x58ed6c[_0x8f3a('0x14')][_0x8f3a('0x16')]);return _0x4d75d2(_0x58ed6c[_0x8f3a('0x14')][_0x8f3a('0x16')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x40d85b,_0x8f3a('0x13'));_0x4d75d2(_0x58ed6c['result']['message']);}})[_0x8f3a('0x18')](function(_0x3b2c13){logger[_0x8f3a('0x14')](_0x8f3a('0x17'),_0x40d85b,_0x3b2c13);_0x25c8ce(_0x3b2c13);});});}exports['GetFaxAccount']=function(_0x12e0c5){var _0x5d8827=this;return new Promise(function(_0x5f155c,_0x1f62cd){return db[_0x8f3a('0x19')][_0x8f3a('0x1a')]({'raw':_0x12e0c5[_0x8f3a('0x1b')]?_0x12e0c5[_0x8f3a('0x1b')][_0x8f3a('0x1c')]===undefined?!![]:![]:!![],'where':_0x12e0c5[_0x8f3a('0x1b')]?_0x12e0c5[_0x8f3a('0x1b')]['where']||null:null,'attributes':_0x12e0c5[_0x8f3a('0x1b')]?_0x12e0c5['options'][_0x8f3a('0x1d')]||null:null,'limit':_0x12e0c5['options']?_0x12e0c5['options']['limit']||null:null,'include':_0x12e0c5[_0x8f3a('0x1b')]?_0x12e0c5[_0x8f3a('0x1b')][_0x8f3a('0x1e')]?_[_0x8f3a('0x1f')](_0x12e0c5[_0x8f3a('0x1b')][_0x8f3a('0x1e')],function(_0x5b8c14){return{'model':db[_0x5b8c14[_0x8f3a('0x20')]],'as':_0x5b8c14['as'],'attributes':_0x5b8c14[_0x8f3a('0x1d')],'include':_0x5b8c14['include']?_['map'](_0x5b8c14[_0x8f3a('0x1e')],function(_0x1bcbf4){return{'model':db[_0x1bcbf4[_0x8f3a('0x20')]],'as':_0x1bcbf4['as'],'attributes':_0x1bcbf4[_0x8f3a('0x1d')],'include':_0x1bcbf4[_0x8f3a('0x1e')]?_[_0x8f3a('0x1f')](_0x1bcbf4[_0x8f3a('0x1e')],function(_0x20a928){return{'model':db[_0x20a928[_0x8f3a('0x20')]],'as':_0x20a928['as'],'attributes':_0x20a928[_0x8f3a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8f3a('0x11')](function(_0x383a67){logger[_0x8f3a('0x21')]('GetFaxAccount',_0x12e0c5);logger['debug'](_0x8f3a('0x22'),_0x12e0c5,JSON[_0x8f3a('0x23')](_0x383a67));_0x5f155c(_0x383a67);})[_0x8f3a('0x18')](function(_0x1b6c37){logger['error'](_0x8f3a('0x22'),_0x1b6c37[_0x8f3a('0x16')],_0x12e0c5);_0x1f62cd(_0x5d8827[_0x8f3a('0x14')](0x1f4,_0x1b6c37[_0x8f3a('0x16')]));});});};exports[_0x8f3a('0x24')]=function(_0x4c70c6,_0x3f5438,_0x4240bf){var _0x13741e=this;return new Promise(function(_0x163f5f,_0x5aeedc){var _0x29fb33={'body':_0x4c70c6[_0x8f3a('0x25')],'channel':_0x8f3a('0x26')};var _0x3b4baa=[];var _0x219434=[];var _0xba5f81={};return db[_0x8f3a('0x27')][_0x8f3a('0x28')]()[_0x8f3a('0x11')](function(_0x127063){if(!_0x127063){throw new db[(_0x8f3a('0x29'))][(_0x8f3a('0x2a'))](_0x8f3a('0x2b'));}_0x3b4baa=_['difference'](_[_0x8f3a('0x2c')](_0x127063),[_0x8f3a('0x2d'),_0x8f3a('0x2e')]);_0x219434=_['difference'](_[_0x8f3a('0x2c')](_0x127063),[_0x8f3a('0x2d'),_0x8f3a('0x2e'),_0x8f3a('0x2f'),_0x8f3a('0x30')]);if(_0x4c70c6['body']['id']){delete _0x4c70c6[_0x8f3a('0x25')]['id'];}if(_[_0x8f3a('0x31')](_0x4c70c6[_0x8f3a('0x25')]['from'])){throw new db[(_0x8f3a('0x29'))][(_0x8f3a('0x2a'))](_0x8f3a('0x32'));}if(_['isNil'](_0x4c70c6[_0x8f3a('0x25')][_0x8f3a('0x25')])||_0x4c70c6[_0x8f3a('0x25')][_0x8f3a('0x25')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8f3a('0x31')](_0x4c70c6['body'][_0x8f3a('0x33')])){throw new db[(_0x8f3a('0x29'))][(_0x8f3a('0x2a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x219434);}if(!_[_0x8f3a('0x34')](_0x219434,_0x4c70c6[_0x8f3a('0x25')][_0x8f3a('0x33')])){throw new db[(_0x8f3a('0x29'))][(_0x8f3a('0x2a'))](_0x8f3a('0x35')+_0x219434);}_0xba5f81[_0x4c70c6['body'][_0x8f3a('0x33')]]=_0x4c70c6[_0x8f3a('0x25')][_0x8f3a('0x36')];})[_0x8f3a('0x11')](function(){return db[_0x8f3a('0x19')][_0x8f3a('0x37')]({'where':{'id':_0x4c70c6['account']['id']},'include':[{'model':db[_0x8f3a('0x38')],'as':'List','include':[{'model':db[_0x8f3a('0x27')],'as':'Contacts','where':_0xba5f81,'limit':0x1,'order':[[_0x8f3a('0x2e'),'DESC']]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0x8f3a('0x11')](function(_0x5a83c2){if(_0x5a83c2&&_0x5a83c2[_0x8f3a('0x39')]){var _0x266f49=_0x5a83c2['get']({'plain':!![]});_0x29fb33['account']=_0x266f49;_0x29fb33['applications']=_0x266f49[_0x8f3a('0x3a')];_0x29fb33[_0x8f3a('0x3b')]=_0x266f49[_0x8f3a('0x39')];_0x29fb33[_0x8f3a('0x3c')]=_[_0x8f3a('0x3d')](_0x29fb33[_0x8f3a('0x3c')],[_0x8f3a('0x3e')],[_0x8f3a('0x3f')]);if(_0x29fb33[_0x8f3a('0x40')][_0x8f3a('0x3a')]){delete _0x29fb33[_0x8f3a('0x40')][_0x8f3a('0x3a')];}if(_0x29fb33[_0x8f3a('0x40')][_0x8f3a('0x39')]&&_0x29fb33[_0x8f3a('0x40')]['List'][_0x8f3a('0x41')][_0x8f3a('0x42')]){return _0x29fb33[_0x8f3a('0x40')]['List'][_0x8f3a('0x41')][0x0];}var _0x1d25aa=_[_0x8f3a('0xc')](_0x4c70c6[_0x8f3a('0x25')],{'firstName':_0x4c70c6[_0x8f3a('0x25')]['from'],'ListId':_0x266f49[_0x8f3a('0x30')]});_0x1d25aa[_0x4c70c6['body']['mapKey']]=_0x4c70c6[_0x8f3a('0x25')][_0x8f3a('0x36')];return db['CmContact']['create'](_0x1d25aa,{'fields':_0x3b4baa,'raw':!![]});}})[_0x8f3a('0x11')](function(_0x5ab16d){_0x29fb33[_0x8f3a('0x43')]=_0x5ab16d;if(_0x5ab16d){var _0x1eedae={'ContactId':_0x5ab16d['id'],'FaxAccountId':_0x4c70c6[_0x8f3a('0x40')]['id'],'fax':_0x5ab16d['fax']};return db['FaxInteraction'][_0x8f3a('0x37')]({'where':{'ContactId':_0x5ab16d['id'],'closed':![],'FaxAccountId':_0x4c70c6[_0x8f3a('0x40')]['id']}})[_0x8f3a('0x11')](function(_0xa88510){if(_0xa88510){return[_0xa88510,![]];}return db[_0x8f3a('0x44')]['create'](_0x1eedae)[_0x8f3a('0x11')](function(_0x22d6ee){return[_0x22d6ee,!![]];});});}else{throw new Error(_0x8f3a('0x45'));}})[_0x8f3a('0x46')](function(_0x3f1995,_0x1897ff){var _0x3b5a8d=_0x3f1995[_0x8f3a('0x47')]({'plain':!![]});if(_0x1897ff){if(_0x29fb33[_0x8f3a('0x40')][_0x8f3a('0x48')]){_0x29fb33[_0x8f3a('0x3c')][_0x8f3a('0x49')]({'id':0x0,'priority':_0x29fb33[_0x8f3a('0x3c')]['length']+0x1,'app':'close','appdata':_0x8f3a('0x4a'),'interval':_0x8f3a('0x4b')});}_0x3b5a8d[_0x8f3a('0x4c')]=!![];}else{_0x3b5a8d[_0x8f3a('0x4c')]=![];}_0x29fb33['interaction']=_0x3b5a8d;return db[_0x8f3a('0x4d')]['create']({'body':_0x4c70c6['body'][_0x8f3a('0x25')],'FaxAccountId':_0x4c70c6['account']['id'],'FaxInteractionId':_0x3f1995['id'],'direction':'in','ContactId':_0x3f1995[_0x8f3a('0x4e')],'AttachmentId':_0x4c70c6[_0x8f3a('0x25')]['AttachmentId']});})['then'](function(_0x29f11a){_0x29fb33[_0x8f3a('0x16')]=_0x29f11a;if(!_0x29fb33[_0x8f3a('0x4f')][_0x8f3a('0x50')])return;return db[_0x8f3a('0x51')][_0x8f3a('0x37')]({'attributes':['id','name'],'where':{'id':_0x29fb33[_0x8f3a('0x4f')]['UserId']}});})[_0x8f3a('0x11')](function(_0x4d723f){if(_0x4d723f){_0x29fb33[_0x8f3a('0x3c')][_0x8f3a('0x52')]({'id':0x0,'priority':0x0,'app':_0x8f3a('0x53'),'appdata':_0x4d723f['name']+','+(_0x29fb33['account']['waitForTheAssignedAgent']||0xa),'interval':_0x8f3a('0x4b')});}if(!_0x29fb33['interaction'][_0x8f3a('0x54')])return;return db[_0x8f3a('0x55')][_0x8f3a('0x37')]({'attributes':['id',_0x8f3a('0x56')],'where':{'id':_0x29fb33[_0x8f3a('0x4f')][_0x8f3a('0x54')]}});})['then'](function(_0x2cfbfa){if(_0x2cfbfa){_0x29fb33[_0x8f3a('0x3c')][_0x8f3a('0x52')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x2cfbfa[_0x8f3a('0x56')]+','+(_0x29fb33[_0x8f3a('0x40')]['waitForTheAssignedQueue']||0x12c),'interval':_0x8f3a('0x4b')});}return respondWithRpcPromise('Start',_0x8f3a('0x57'),_0x29fb33);})[_0x8f3a('0x11')](function(_0x45e44f){_0x163f5f(_0x45e44f);})[_0x8f3a('0x18')](function(_0x4af324){_0x5aeedc(_0x13741e[_0x8f3a('0x14')](0x1f4,_0x4af324[_0x8f3a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 551014a..b380de0 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 _0x0792=['save','remove','update','emit','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x1d2780,_0x597c45){var _0xcf874c=function(_0x32b12c){while(--_0x32b12c){_0x1d2780['push'](_0x1d2780['shift']());}};_0xcf874c(++_0x597c45);}(_0x0792,0x7d));var _0x2079=function(_0x2252be,_0x1bceeb){_0x2252be=_0x2252be-0x0;var _0x3dd367=_0x0792[_0x2252be];return _0x3dd367;};'use strict';var FaxAccountEvents=require(_0x2079('0x0'));var events=[_0x2079('0x1'),_0x2079('0x2'),_0x2079('0x3')];function createListener(_0x3ce231,_0x28236a){return function(_0x2bc06f){_0x28236a[_0x2079('0x4')](_0x3ce231,_0x2bc06f);};}function removeListener(_0x4e66f7,_0x406cf8){return function(){FaxAccountEvents[_0x2079('0x5')](_0x4e66f7,_0x406cf8);};}exports[_0x2079('0x6')]=function(_0x461434){for(var _0x5e2c5f=0x0,_0x39b8dc=events[_0x2079('0x7')];_0x5e2c5f<_0x39b8dc;_0x5e2c5f++){var _0x4dc398=events[_0x5e2c5f];var _0xad484a=createListener(_0x2079('0x8')+_0x4dc398,_0x461434);FaxAccountEvents['on'](_0x4dc398,_0xad484a);}}; \ No newline at end of file +var _0x1a4e=['register','length','faxAccount:','./faxAccount.events','remove','emit','removeListener'];(function(_0x174592,_0x2448e3){var _0x22f2ab=function(_0xde7f0f){while(--_0xde7f0f){_0x174592['push'](_0x174592['shift']());}};_0x22f2ab(++_0x2448e3);}(_0x1a4e,0xd5));var _0xe1a4=function(_0x4b2412,_0x5de7f7){_0x4b2412=_0x4b2412-0x0;var _0x2db47d=_0x1a4e[_0x4b2412];return _0x2db47d;};'use strict';var FaxAccountEvents=require(_0xe1a4('0x0'));var events=['save',_0xe1a4('0x1'),'update'];function createListener(_0xbdb4cf,_0x5036c5){return function(_0x278908){_0x5036c5[_0xe1a4('0x2')](_0xbdb4cf,_0x278908);};}function removeListener(_0x42bfe7,_0x5820c6){return function(){FaxAccountEvents[_0xe1a4('0x3')](_0x42bfe7,_0x5820c6);};}exports[_0xe1a4('0x4')]=function(_0x47136c){for(var _0x530236=0x0,_0x2c9657=events[_0xe1a4('0x5')];_0x530236<_0x2c9657;_0x530236++){var _0x24010e=events[_0x530236];var _0x3940bb=createListener(_0xe1a4('0x6')+_0x24010e,_0x47136c);FaxAccountEvents['on'](_0x24010e,_0x3940bb);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 2d96ca6..a26e206 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 _0xafd6=['show','/:id/dispositions','getDispositions','getAnswers','getInteractions','getApplications','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/interactions','addInteraction','/addaccountapplications','/updateaccountapplications','/:id/send','send','addAgents','put','update','delete','destroy','removeAnswers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x4c8437,_0x538435){var _0x2f7930=function(_0x3fed53){while(--_0x3fed53){_0x4c8437['push'](_0x4c8437['shift']());}};_0x2f7930(++_0x538435);}(_0xafd6,0x10f));var _0x6afd=function(_0x229ed4,_0x4de44d){_0x229ed4=_0x229ed4-0x0;var _0x305825=_0xafd6[_0x229ed4];return _0x305825;};'use strict';var multer=require(_0x6afd('0x0'));var util=require(_0x6afd('0x1'));var path=require(_0x6afd('0x2'));var timeout=require(_0x6afd('0x3'));var express=require(_0x6afd('0x4'));var router=express[_0x6afd('0x5')]();var fs_extra=require(_0x6afd('0x6'));var auth=require(_0x6afd('0x7'));var interaction=require(_0x6afd('0x8'));var config=require(_0x6afd('0x9'));var controller=require(_0x6afd('0xa'));router[_0x6afd('0xb')]('/',auth[_0x6afd('0xc')](),controller[_0x6afd('0xd')]);router[_0x6afd('0xb')](_0x6afd('0xe'),auth[_0x6afd('0xc')](),controller['describe']);router[_0x6afd('0xb')](_0x6afd('0xf'),auth['isAuthenticated'](),controller[_0x6afd('0x10')]);router[_0x6afd('0xb')](_0x6afd('0x11'),auth[_0x6afd('0xc')](),controller[_0x6afd('0x12')]);router[_0x6afd('0xb')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x6afd('0x13')]);router[_0x6afd('0xb')]('/:id/interactions',auth[_0x6afd('0xc')](),controller[_0x6afd('0x14')]);router[_0x6afd('0xb')]('/:id/applications',auth[_0x6afd('0xc')](),controller[_0x6afd('0x15')]);router[_0x6afd('0xb')]('/:id/messages',auth[_0x6afd('0xc')](),controller['getMessages']);router[_0x6afd('0xb')](_0x6afd('0x16'),auth[_0x6afd('0xc')](),controller[_0x6afd('0x17')]);router[_0x6afd('0x18')]('/',auth[_0x6afd('0xc')](),controller[_0x6afd('0x19')]);router[_0x6afd('0x18')]('/:id/dispositions',auth[_0x6afd('0xc')](),controller[_0x6afd('0x1a')]);router[_0x6afd('0x18')](_0x6afd('0x1b'),auth['isAuthenticated'](),controller[_0x6afd('0x1c')]);router[_0x6afd('0x18')](_0x6afd('0x1d'),auth['isAuthenticated'](),controller[_0x6afd('0x1e')]);router['post']('/:id/applications',auth[_0x6afd('0xc')](),controller['addApplications']);router[_0x6afd('0x18')](_0x6afd('0x1f'),auth[_0x6afd('0xc')](),controller['addAccountApplications']);router[_0x6afd('0x18')](_0x6afd('0x20'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x6afd('0x18')](_0x6afd('0x21'),auth[_0x6afd('0xc')](),controller[_0x6afd('0x22')]);router[_0x6afd('0x18')]('/:id/users',auth[_0x6afd('0xc')](),controller[_0x6afd('0x23')]);router[_0x6afd('0x24')](_0x6afd('0xf'),auth[_0x6afd('0xc')](),controller[_0x6afd('0x25')]);router[_0x6afd('0x26')](_0x6afd('0xf'),auth[_0x6afd('0xc')](),controller[_0x6afd('0x27')]);router[_0x6afd('0x26')](_0x6afd('0x11'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x6afd('0x26')](_0x6afd('0x1b'),auth['isAuthenticated'](),controller[_0x6afd('0x28')]);router[_0x6afd('0x26')](_0x6afd('0x16'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xb245=['/:id/canned_answers','/:id/interactions','getInteractions','getApplications','/:id/messages','/:id/users','create','post','/:id/dispositions','addDisposition','addAnswer','/:id/applications','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','/:id/send','addAgents','put','update','destroy','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxAccount.controller','get','isAuthenticated','index','/describe','/:id','show','getDispositions'];(function(_0x1227c3,_0x37615e){var _0x27943a=function(_0x2d6c1f){while(--_0x2d6c1f){_0x1227c3['push'](_0x1227c3['shift']());}};_0x27943a(++_0x37615e);}(_0xb245,0x6d));var _0x5b24=function(_0x4bc32a,_0x4b8114){_0x4bc32a=_0x4bc32a-0x0;var _0x5c902c=_0xb245[_0x4bc32a];return _0x5c902c;};'use strict';var multer=require(_0x5b24('0x0'));var util=require(_0x5b24('0x1'));var path=require(_0x5b24('0x2'));var timeout=require(_0x5b24('0x3'));var express=require(_0x5b24('0x4'));var router=express[_0x5b24('0x5')]();var fs_extra=require(_0x5b24('0x6'));var auth=require(_0x5b24('0x7'));var interaction=require(_0x5b24('0x8'));var config=require('../../config/environment');var controller=require(_0x5b24('0x9'));router[_0x5b24('0xa')]('/',auth[_0x5b24('0xb')](),controller[_0x5b24('0xc')]);router['get'](_0x5b24('0xd'),auth[_0x5b24('0xb')](),controller['describe']);router[_0x5b24('0xa')](_0x5b24('0xe'),auth[_0x5b24('0xb')](),controller[_0x5b24('0xf')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x5b24('0x10')]);router[_0x5b24('0xa')](_0x5b24('0x11'),auth[_0x5b24('0xb')](),controller['getAnswers']);router[_0x5b24('0xa')](_0x5b24('0x12'),auth['isAuthenticated'](),controller[_0x5b24('0x13')]);router['get']('/:id/applications',auth[_0x5b24('0xb')](),controller[_0x5b24('0x14')]);router[_0x5b24('0xa')](_0x5b24('0x15'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x5b24('0x16'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x5b24('0xb')](),controller[_0x5b24('0x17')]);router[_0x5b24('0x18')](_0x5b24('0x19'),auth[_0x5b24('0xb')](),controller[_0x5b24('0x1a')]);router['post'](_0x5b24('0x11'),auth['isAuthenticated'](),controller[_0x5b24('0x1b')]);router['post'](_0x5b24('0x12'),auth[_0x5b24('0xb')](),controller['addInteraction']);router['post'](_0x5b24('0x1c'),auth['isAuthenticated'](),controller[_0x5b24('0x1d')]);router['post'](_0x5b24('0x1e'),auth[_0x5b24('0xb')](),controller[_0x5b24('0x1f')]);router[_0x5b24('0x18')](_0x5b24('0x20'),auth[_0x5b24('0xb')](),controller['updateAccountApplications']);router[_0x5b24('0x18')](_0x5b24('0x21'),auth[_0x5b24('0xb')](),controller['send']);router[_0x5b24('0x18')](_0x5b24('0x16'),auth[_0x5b24('0xb')](),controller[_0x5b24('0x22')]);router[_0x5b24('0x23')](_0x5b24('0xe'),auth[_0x5b24('0xb')](),controller[_0x5b24('0x24')]);router['delete'](_0x5b24('0xe'),auth[_0x5b24('0xb')](),controller[_0x5b24('0x25')]);router[_0x5b24('0x26')](_0x5b24('0x19'),auth[_0x5b24('0xb')](),controller[_0x5b24('0x27')]);router[_0x5b24('0x26')](_0x5b24('0x11'),auth[_0x5b24('0xb')](),controller['removeAnswers']);router['delete']('/:id/users',auth[_0x5b24('0xb')](),controller[_0x5b24('0x28')]);module[_0x5b24('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 865f146..ccbc8c7 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 _0x4a33=['*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x5d9a28,_0x1bf0bf){var _0x1a0fcd=function(_0x44a228){while(--_0x44a228){_0x5d9a28['push'](_0x5d9a28['shift']());}};_0x1a0fcd(++_0x1bf0bf);}(_0x4a33,0x164));var _0x34a3=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x4a33[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require('sequelize');module[_0x34a3('0x0')]={'priority':{'type':Sequelize[_0x34a3('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x34a3('0x2')],'allowNull':![],'defaultValue':_0x34a3('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x34a3('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x34a3('0x4')}}; \ No newline at end of file +var _0x977e=['TEXT','INTEGER','STRING','noop'];(function(_0xa76c09,_0x4bb97c){var _0x5edc71=function(_0x1a56ce){while(--_0x1a56ce){_0xa76c09['push'](_0xa76c09['shift']());}};_0x5edc71(++_0x4bb97c);}(_0x977e,0x121));var _0xe977=function(_0x4d2268,_0x1fa847){_0x4d2268=_0x4d2268-0x0;var _0x2c34d0=_0x977e[_0x4d2268];return _0x2c34d0;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xe977('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xe977('0x1')],'allowNull':![],'defaultValue':_0xe977('0x2')},'appdata':{'type':Sequelize[_0xe977('0x3')]()},'description':{'type':Sequelize[_0xe977('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 72dc266..f689be9 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 _0x9219=['key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','FaxApplication','findAll','rows','catch','show','params','length','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../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','apply','save','update','then','destroy','error','stack','name','map','rawAttributes','fieldName','type'];(function(_0x585c3d,_0x2e2300){var _0x327889=function(_0x51e542){while(--_0x51e542){_0x585c3d['push'](_0x585c3d['shift']());}};_0x327889(++_0x2e2300);}(_0x9219,0x68));var _0x9921=function(_0x341733,_0x55646e){_0x341733=_0x341733-0x0;var _0x33bee9=_0x9219[_0x341733];return _0x33bee9;};'use strict';var emlformat=require(_0x9921('0x0'));var rimraf=require(_0x9921('0x1'));var zipdir=require(_0x9921('0x2'));var jsonpatch=require(_0x9921('0x3'));var rp=require(_0x9921('0x4'));var moment=require(_0x9921('0x5'));var BPromise=require(_0x9921('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x9921('0x7'));var csv=require(_0x9921('0x8'));var ejs=require(_0x9921('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9921('0xa'));var squel=require(_0x9921('0xb'));var crypto=require(_0x9921('0xc'));var jsforce=require(_0x9921('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9921('0x8'));var querystring=require(_0x9921('0xe'));var Papa=require(_0x9921('0xf'));var Redis=require(_0x9921('0x10'));var authService=require(_0x9921('0x11'));var qs=require(_0x9921('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9921('0x13'));var logger=require(_0x9921('0x14'))(_0x9921('0x15'));var utils=require(_0x9921('0x16'));var config=require(_0x9921('0x17'));var licenseUtil=require(_0x9921('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x702bfc,_0x3620ce){_0x3620ce=_0x3620ce||0xcc;return function(_0x301e16){if(_0x301e16){return _0x702bfc[_0x9921('0x19')](_0x3620ce);}return _0x702bfc['status'](_0x3620ce)[_0x9921('0x1a')]();};}function respondWithResult(_0x39686a,_0x3f1c17){_0x3f1c17=_0x3f1c17||0xc8;return function(_0x2100d2){if(_0x2100d2){return _0x39686a[_0x9921('0x1b')](_0x3f1c17)[_0x9921('0x1c')](_0x2100d2);}};}function respondWithFilteredResult(_0x13da8a,_0x8735fe){return function(_0x2dd633){if(_0x2dd633){var _0x30c1ac=typeof _0x8735fe[_0x9921('0x1d')]===_0x9921('0x1e')&&typeof _0x8735fe[_0x9921('0x1f')]===_0x9921('0x1e');var _0x46225a=_0x2dd633[_0x9921('0x20')];var _0x310bae=_0x30c1ac?0x0:_0x8735fe[_0x9921('0x1d')];var _0x5bd078=_0x30c1ac?_0x2dd633['count']:_0x8735fe['offset']+_0x8735fe[_0x9921('0x1f')];var _0x2d2faf;if(_0x5bd078>=_0x46225a){_0x5bd078=_0x46225a;_0x2d2faf=0xc8;}else{_0x2d2faf=0xce;}_0x13da8a['status'](_0x2d2faf);return _0x13da8a['set'](_0x9921('0x21'),_0x310bae+'-'+_0x5bd078+'/'+_0x46225a)['json'](_0x2dd633);}return null;};}function patchUpdates(_0x434b52){return function(_0x49f3a9){try{jsonpatch[_0x9921('0x22')](_0x49f3a9,_0x434b52,!![]);}catch(_0x5e6c87){return BPromise['reject'](_0x5e6c87);}return _0x49f3a9[_0x9921('0x23')]();};}function saveUpdates(_0x4a53c0,_0x177a2c){return function(_0xd677de){if(_0xd677de){return _0xd677de[_0x9921('0x24')](_0x4a53c0)[_0x9921('0x25')](function(_0x1d8209){return _0x1d8209;});}return null;};}function removeEntity(_0x577d23,_0x53f95e){return function(_0x2cfd54){if(_0x2cfd54){return _0x2cfd54[_0x9921('0x26')]()['then'](function(){_0x577d23[_0x9921('0x1b')](0xcc)[_0x9921('0x1a')]();});}};}function handleEntityNotFound(_0x3997bc,_0x5d8c6a){return function(_0x5d0b31){if(!_0x5d0b31){_0x3997bc[_0x9921('0x19')](0x194);}return _0x5d0b31;};}function handleError(_0x3d9048,_0x17765f){_0x17765f=_0x17765f||0x1f4;return function(_0x277bc8){logger[_0x9921('0x27')](_0x277bc8[_0x9921('0x28')]);if(_0x277bc8[_0x9921('0x29')]){delete _0x277bc8[_0x9921('0x29')];}_0x3d9048[_0x9921('0x1b')](_0x17765f)['send'](_0x277bc8);};}exports['index']=function(_0x331eb3,_0x34cb29){var _0xc16df0={},_0x2efed6={},_0x4696a1={'count':0x0,'rows':[]};var _0x340649=_[_0x9921('0x2a')](db['FaxApplication'][_0x9921('0x2b')],function(_0x4ec98f){return{'name':_0x4ec98f[_0x9921('0x2c')],'type':_0x4ec98f[_0x9921('0x2d')][_0x9921('0x2e')]};});_0x2efed6['model']=_['map'](_0x340649,_0x9921('0x29'));_0x2efed6[_0x9921('0x2f')]=_[_0x9921('0x30')](_0x331eb3[_0x9921('0x2f')]);_0x2efed6[_0x9921('0x31')]=_[_0x9921('0x32')](_0x2efed6[_0x9921('0x33')],_0x2efed6[_0x9921('0x2f')]);_0xc16df0[_0x9921('0x34')]=_['intersection'](_0x2efed6[_0x9921('0x33')],qs[_0x9921('0x35')](_0x331eb3['query'][_0x9921('0x35')]));_0xc16df0[_0x9921('0x34')]=_0xc16df0['attributes']['length']?_0xc16df0['attributes']:_0x2efed6[_0x9921('0x33')];if(!_0x331eb3[_0x9921('0x2f')][_0x9921('0x36')](_0x9921('0x37'))){_0xc16df0[_0x9921('0x1f')]=qs['limit'](_0x331eb3[_0x9921('0x2f')][_0x9921('0x1f')]);_0xc16df0['offset']=qs['offset'](_0x331eb3['query'][_0x9921('0x1d')]);}_0xc16df0[_0x9921('0x38')]=qs[_0x9921('0x39')](_0x331eb3[_0x9921('0x2f')]['sort']);_0xc16df0[_0x9921('0x3a')]=qs[_0x9921('0x31')](_[_0x9921('0x3b')](_0x331eb3[_0x9921('0x2f')],_0x2efed6[_0x9921('0x31')]),_0x340649);if(_0x331eb3[_0x9921('0x2f')][_0x9921('0x3c')]){_0xc16df0[_0x9921('0x3a')]=_[_0x9921('0x3d')](_0xc16df0['where'],{'$or':_[_0x9921('0x2a')](_0x340649,function(_0x1ab93c){if(_0x1ab93c[_0x9921('0x2d')]!=='VIRTUAL'){var _0x15c399={};_0x15c399[_0x1ab93c[_0x9921('0x29')]]={'$like':'%'+_0x331eb3[_0x9921('0x2f')][_0x9921('0x3c')]+'%'};return _0x15c399;}})});}_0xc16df0=_[_0x9921('0x3d')]({},_0xc16df0,_0x331eb3[_0x9921('0x3e')]);var _0xa451f={'where':_0xc16df0['where']};return db[_0x9921('0x3f')][_0x9921('0x20')](_0xa451f)[_0x9921('0x25')](function(_0xad3536){_0x4696a1[_0x9921('0x20')]=_0xad3536;if(_0x331eb3[_0x9921('0x2f')]['includeAll']){_0xc16df0['include']=[{'all':!![]}];}return db[_0x9921('0x3f')][_0x9921('0x40')](_0xc16df0);})[_0x9921('0x25')](function(_0x277b85){_0x4696a1[_0x9921('0x41')]=_0x277b85;return _0x4696a1;})['then'](respondWithFilteredResult(_0x34cb29,_0xc16df0))[_0x9921('0x42')](handleError(_0x34cb29,null));};exports[_0x9921('0x43')]=function(_0x3ad7a4,_0x4b83b0){var _0x1f92e8={'raw':!![],'where':{'id':_0x3ad7a4[_0x9921('0x44')]['id']}},_0x1ebd4f={};_0x1ebd4f[_0x9921('0x33')]=_[_0x9921('0x30')](db[_0x9921('0x3f')]['rawAttributes']);_0x1ebd4f[_0x9921('0x2f')]=_[_0x9921('0x30')](_0x3ad7a4[_0x9921('0x2f')]);_0x1ebd4f[_0x9921('0x31')]=_['intersection'](_0x1ebd4f[_0x9921('0x33')],_0x1ebd4f[_0x9921('0x2f')]);_0x1f92e8['attributes']=_[_0x9921('0x32')](_0x1ebd4f[_0x9921('0x33')],qs[_0x9921('0x35')](_0x3ad7a4['query'][_0x9921('0x35')]));_0x1f92e8[_0x9921('0x34')]=_0x1f92e8[_0x9921('0x34')][_0x9921('0x45')]?_0x1f92e8[_0x9921('0x34')]:_0x1ebd4f[_0x9921('0x33')];if(_0x3ad7a4[_0x9921('0x2f')][_0x9921('0x46')]){_0x1f92e8[_0x9921('0x47')]=[{'all':!![]}];}_0x1f92e8=_['merge']({},_0x1f92e8,_0x3ad7a4[_0x9921('0x3e')]);return db['FaxApplication'][_0x9921('0x48')](_0x1f92e8)[_0x9921('0x25')](handleEntityNotFound(_0x4b83b0,null))[_0x9921('0x25')](respondWithResult(_0x4b83b0,null))[_0x9921('0x42')](handleError(_0x4b83b0,null));};exports[_0x9921('0x49')]=function(_0x1c1303,_0x37b8b1){return db[_0x9921('0x3f')][_0x9921('0x49')](_0x1c1303[_0x9921('0x4a')],{})['then'](respondWithResult(_0x37b8b1,0xc9))[_0x9921('0x42')](handleError(_0x37b8b1,null));};exports[_0x9921('0x24')]=function(_0x25d4ab,_0x4402a8){if(_0x25d4ab[_0x9921('0x4a')]['id']){delete _0x25d4ab['body']['id'];}return db[_0x9921('0x3f')]['find']({'where':{'id':_0x25d4ab[_0x9921('0x44')]['id']}})['then'](handleEntityNotFound(_0x4402a8,null))[_0x9921('0x25')](saveUpdates(_0x25d4ab[_0x9921('0x4a')],null))[_0x9921('0x25')](respondWithResult(_0x4402a8,null))[_0x9921('0x42')](handleError(_0x4402a8,null));};exports[_0x9921('0x26')]=function(_0x433229,_0x479202){return db[_0x9921('0x3f')][_0x9921('0x48')]({'where':{'id':_0x433229['params']['id']}})[_0x9921('0x25')](handleEntityNotFound(_0x479202,null))['then'](removeEntity(_0x479202,null))[_0x9921('0x42')](handleError(_0x479202,null));}; \ No newline at end of file +var _0xb4b3=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','FaxApplication','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','options','create','body','find','params','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x211499,_0x4e8b52){var _0x1eb435=function(_0x86b4fa){while(--_0x86b4fa){_0x211499['push'](_0x211499['shift']());}};_0x1eb435(++_0x4e8b52);}(_0xb4b3,0xc8));var _0x3b4b=function(_0x4dda18,_0x393cf6){_0x4dda18=_0x4dda18-0x0;var _0x3ff252=_0xb4b3[_0x4dda18];return _0x3ff252;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b4b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3b4b('0x1'));var rp=require(_0x3b4b('0x2'));var moment=require(_0x3b4b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3b4b('0x4'));var util=require(_0x3b4b('0x5'));var path=require('path');var sox=require(_0x3b4b('0x6'));var csv=require('to-csv');var ejs=require(_0x3b4b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3b4b('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x3b4b('0x9'));var toCsv=require('to-csv');var querystring=require(_0x3b4b('0xa'));var Papa=require(_0x3b4b('0xb'));var Redis=require(_0x3b4b('0xc'));var authService=require(_0x3b4b('0xd'));var qs=require(_0x3b4b('0xe'));var as=require(_0x3b4b('0xf'));var hardwareService=require(_0x3b4b('0x10'));var logger=require(_0x3b4b('0x11'))('api');var utils=require(_0x3b4b('0x12'));var config=require(_0x3b4b('0x13'));var licenseUtil=require(_0x3b4b('0x14'));var db=require(_0x3b4b('0x15'))['db'];function respondWithStatusCode(_0x5398fd,_0x2ec0e6){_0x2ec0e6=_0x2ec0e6||0xcc;return function(_0x36eab8){if(_0x36eab8){return _0x5398fd['sendStatus'](_0x2ec0e6);}return _0x5398fd['status'](_0x2ec0e6)[_0x3b4b('0x16')]();};}function respondWithResult(_0x130f95,_0x38e38d){_0x38e38d=_0x38e38d||0xc8;return function(_0x17bc4a){if(_0x17bc4a){return _0x130f95[_0x3b4b('0x17')](_0x38e38d)['json'](_0x17bc4a);}};}function respondWithFilteredResult(_0x5608a5,_0x4f987a){return function(_0x553897){if(_0x553897){var _0x3b736e=typeof _0x4f987a['offset']===_0x3b4b('0x18')&&typeof _0x4f987a[_0x3b4b('0x19')]===_0x3b4b('0x18');var _0x1cff3b=_0x553897[_0x3b4b('0x1a')];var _0x53f07c=_0x3b736e?0x0:_0x4f987a[_0x3b4b('0x1b')];var _0x6064c0=_0x3b736e?_0x553897['count']:_0x4f987a[_0x3b4b('0x1b')]+_0x4f987a[_0x3b4b('0x19')];var _0x308697;if(_0x6064c0>=_0x1cff3b){_0x6064c0=_0x1cff3b;_0x308697=0xc8;}else{_0x308697=0xce;}_0x5608a5[_0x3b4b('0x17')](_0x308697);return _0x5608a5[_0x3b4b('0x1c')](_0x3b4b('0x1d'),_0x53f07c+'-'+_0x6064c0+'/'+_0x1cff3b)[_0x3b4b('0x1e')](_0x553897);}return null;};}function patchUpdates(_0x2c6f2b){return function(_0xfdc011){try{jsonpatch[_0x3b4b('0x1f')](_0xfdc011,_0x2c6f2b,!![]);}catch(_0x1ae0dc){return BPromise[_0x3b4b('0x20')](_0x1ae0dc);}return _0xfdc011[_0x3b4b('0x21')]();};}function saveUpdates(_0x599141,_0x7ca751){return function(_0x421db1){if(_0x421db1){return _0x421db1[_0x3b4b('0x22')](_0x599141)[_0x3b4b('0x23')](function(_0x290a07){return _0x290a07;});}return null;};}function removeEntity(_0x1a1e90,_0x19f2c8){return function(_0x3b9011){if(_0x3b9011){return _0x3b9011[_0x3b4b('0x24')]()[_0x3b4b('0x23')](function(){_0x1a1e90[_0x3b4b('0x17')](0xcc)[_0x3b4b('0x16')]();});}};}function handleEntityNotFound(_0xcd4297,_0x505934){return function(_0x4a00b4){if(!_0x4a00b4){_0xcd4297[_0x3b4b('0x25')](0x194);}return _0x4a00b4;};}function handleError(_0x2121e9,_0x43e419){_0x43e419=_0x43e419||0x1f4;return function(_0x3c5b76){logger[_0x3b4b('0x26')](_0x3c5b76['stack']);if(_0x3c5b76[_0x3b4b('0x27')]){delete _0x3c5b76['name'];}_0x2121e9['status'](_0x43e419)[_0x3b4b('0x28')](_0x3c5b76);};}exports['index']=function(_0x26d3cd,_0x14f680){var _0x3e396e={},_0x5adeed={},_0x1787f9={'count':0x0,'rows':[]};var _0x1d2d80=_[_0x3b4b('0x29')](db[_0x3b4b('0x2a')]['rawAttributes'],function(_0x2f6862){return{'name':_0x2f6862[_0x3b4b('0x2b')],'type':_0x2f6862['type']['key']};});_0x5adeed[_0x3b4b('0x2c')]=_[_0x3b4b('0x29')](_0x1d2d80,_0x3b4b('0x27'));_0x5adeed['query']=_['keys'](_0x26d3cd[_0x3b4b('0x2d')]);_0x5adeed[_0x3b4b('0x2e')]=_[_0x3b4b('0x2f')](_0x5adeed[_0x3b4b('0x2c')],_0x5adeed[_0x3b4b('0x2d')]);_0x3e396e[_0x3b4b('0x30')]=_[_0x3b4b('0x2f')](_0x5adeed[_0x3b4b('0x2c')],qs[_0x3b4b('0x31')](_0x26d3cd['query'][_0x3b4b('0x31')]));_0x3e396e[_0x3b4b('0x30')]=_0x3e396e[_0x3b4b('0x30')][_0x3b4b('0x32')]?_0x3e396e[_0x3b4b('0x30')]:_0x5adeed[_0x3b4b('0x2c')];if(!_0x26d3cd[_0x3b4b('0x2d')][_0x3b4b('0x33')](_0x3b4b('0x34'))){_0x3e396e[_0x3b4b('0x19')]=qs[_0x3b4b('0x19')](_0x26d3cd['query'][_0x3b4b('0x19')]);_0x3e396e[_0x3b4b('0x1b')]=qs[_0x3b4b('0x1b')](_0x26d3cd[_0x3b4b('0x2d')][_0x3b4b('0x1b')]);}_0x3e396e['order']=qs[_0x3b4b('0x35')](_0x26d3cd['query'][_0x3b4b('0x35')]);_0x3e396e[_0x3b4b('0x36')]=qs[_0x3b4b('0x2e')](_['pick'](_0x26d3cd[_0x3b4b('0x2d')],_0x5adeed[_0x3b4b('0x2e')]),_0x1d2d80);if(_0x26d3cd[_0x3b4b('0x2d')][_0x3b4b('0x37')]){_0x3e396e[_0x3b4b('0x36')]=_['merge'](_0x3e396e[_0x3b4b('0x36')],{'$or':_[_0x3b4b('0x29')](_0x1d2d80,function(_0x28c1b7){if(_0x28c1b7[_0x3b4b('0x38')]!==_0x3b4b('0x39')){var _0x1db74f={};_0x1db74f[_0x28c1b7[_0x3b4b('0x27')]]={'$like':'%'+_0x26d3cd[_0x3b4b('0x2d')]['filter']+'%'};return _0x1db74f;}})});}_0x3e396e=_[_0x3b4b('0x3a')]({},_0x3e396e,_0x26d3cd['options']);var _0x162d93={'where':_0x3e396e[_0x3b4b('0x36')]};return db[_0x3b4b('0x2a')][_0x3b4b('0x1a')](_0x162d93)['then'](function(_0x15c451){_0x1787f9[_0x3b4b('0x1a')]=_0x15c451;if(_0x26d3cd[_0x3b4b('0x2d')][_0x3b4b('0x3b')]){_0x3e396e[_0x3b4b('0x3c')]=[{'all':!![]}];}return db[_0x3b4b('0x2a')][_0x3b4b('0x3d')](_0x3e396e);})[_0x3b4b('0x23')](function(_0x4a1331){_0x1787f9[_0x3b4b('0x3e')]=_0x4a1331;return _0x1787f9;})['then'](respondWithFilteredResult(_0x14f680,_0x3e396e))[_0x3b4b('0x3f')](handleError(_0x14f680,null));};exports[_0x3b4b('0x40')]=function(_0x3bd6d4,_0x29a158){var _0x453621={'raw':!![],'where':{'id':_0x3bd6d4['params']['id']}},_0x525a37={};_0x525a37[_0x3b4b('0x2c')]=_[_0x3b4b('0x41')](db[_0x3b4b('0x2a')][_0x3b4b('0x42')]);_0x525a37['query']=_[_0x3b4b('0x41')](_0x3bd6d4[_0x3b4b('0x2d')]);_0x525a37[_0x3b4b('0x2e')]=_[_0x3b4b('0x2f')](_0x525a37[_0x3b4b('0x2c')],_0x525a37['query']);_0x453621[_0x3b4b('0x30')]=_[_0x3b4b('0x2f')](_0x525a37[_0x3b4b('0x2c')],qs['fields'](_0x3bd6d4[_0x3b4b('0x2d')][_0x3b4b('0x31')]));_0x453621['attributes']=_0x453621[_0x3b4b('0x30')][_0x3b4b('0x32')]?_0x453621[_0x3b4b('0x30')]:_0x525a37['model'];if(_0x3bd6d4['query']['includeAll']){_0x453621['include']=[{'all':!![]}];}_0x453621=_['merge']({},_0x453621,_0x3bd6d4[_0x3b4b('0x43')]);return db[_0x3b4b('0x2a')]['find'](_0x453621)[_0x3b4b('0x23')](handleEntityNotFound(_0x29a158,null))['then'](respondWithResult(_0x29a158,null))['catch'](handleError(_0x29a158,null));};exports[_0x3b4b('0x44')]=function(_0x18a2fb,_0x197ef7){return db['FaxApplication'][_0x3b4b('0x44')](_0x18a2fb[_0x3b4b('0x45')],{})[_0x3b4b('0x23')](respondWithResult(_0x197ef7,0xc9))[_0x3b4b('0x3f')](handleError(_0x197ef7,null));};exports[_0x3b4b('0x22')]=function(_0x2275b3,_0x1ef153){if(_0x2275b3[_0x3b4b('0x45')]['id']){delete _0x2275b3[_0x3b4b('0x45')]['id'];}return db['FaxApplication'][_0x3b4b('0x46')]({'where':{'id':_0x2275b3[_0x3b4b('0x47')]['id']}})[_0x3b4b('0x23')](handleEntityNotFound(_0x1ef153,null))[_0x3b4b('0x23')](saveUpdates(_0x2275b3[_0x3b4b('0x45')],null))[_0x3b4b('0x23')](respondWithResult(_0x1ef153,null))['catch'](handleError(_0x1ef153,null));};exports[_0x3b4b('0x24')]=function(_0x4f8d7d,_0x1bbc97){return db['FaxApplication']['find']({'where':{'id':_0x4f8d7d[_0x3b4b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1bbc97,null))[_0x3b4b('0x23')](removeEntity(_0x1bbc97,null))[_0x3b4b('0x3f')](handleError(_0x1bbc97,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 7045215..eb5be9b 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 _0xf87b=['../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5d4bd1,_0x409871){var _0x1a415d=function(_0x3b17d2){while(--_0x3b17d2){_0x5d4bd1['push'](_0x5d4bd1['shift']());}};_0x1a415d(++_0x409871);}(_0xf87b,0x163));var _0xbf87=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf87b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf87('0x0'))(_0xbf87('0x1'));var moment=require(_0xbf87('0x2'));var BPromise=require(_0xbf87('0x3'));var rp=require(_0xbf87('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbf87('0x5'));var attributes=require(_0xbf87('0x6'));module[_0xbf87('0x7')]=function(_0x2b57ff,_0x3f47ad){return _0x2b57ff['define'](_0xbf87('0x8'),attributes,{'tableName':_0xbf87('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbf87('0xa'),'collate':_0xbf87('0xb')});}; \ No newline at end of file +var _0xb0d6=['exports','FaxApplication','fax_applications','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./faxApplication.attributes'];(function(_0x13248d,_0x35184a){var _0x564f27=function(_0x32ce2c){while(--_0x32ce2c){_0x13248d['push'](_0x13248d['shift']());}};_0x564f27(++_0x35184a);}(_0xb0d6,0xa3));var _0x6b0d=function(_0x15d59a,_0x4b13c2){_0x15d59a=_0x15d59a-0x0;var _0x575cd5=_0xb0d6[_0x15d59a];return _0x575cd5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6b0d('0x0'))('api');var moment=require(_0x6b0d('0x1'));var BPromise=require(_0x6b0d('0x2'));var rp=require(_0x6b0d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b0d('0x4'));var config=require(_0x6b0d('0x5'));var attributes=require(_0x6b0d('0x6'));module[_0x6b0d('0x7')]=function(_0x43752b,_0x4e6039){return _0x43752b['define'](_0x6b0d('0x8'),attributes,{'tableName':_0x6b0d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index b3fcf26..fdfa37f 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 _0xf2a5=['raw','where','attributes','limit','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','options'];(function(_0x1233d2,_0x5416f4){var _0x22759e=function(_0xb516aa){while(--_0xb516aa){_0x1233d2['push'](_0x1233d2['shift']());}};_0x22759e(++_0x5416f4);}(_0xf2a5,0xc8));var _0x5f2a=function(_0x251588,_0x1daa84){_0x251588=_0x251588-0x0;var _0x1539c3=_0xf2a5[_0x251588];return _0x1539c3;};'use strict';var _=require('lodash');var util=require(_0x5f2a('0x0'));var moment=require(_0x5f2a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5f2a('0x2'));var logger=require(_0x5f2a('0x3'))(_0x5f2a('0x4'));var config=require(_0x5f2a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x5f2a('0x6')][_0x5f2a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5837e8,_0x2eceac,_0x37baf7){return new BPromise(function(_0x231a8d,_0x3fa8c3){return client[_0x5f2a('0x8')](_0x5837e8,_0x37baf7)[_0x5f2a('0x9')](function(_0x7cd44e){logger[_0x5f2a('0xa')](_0x5f2a('0xb'),_0x2eceac,'request\x20sent');logger[_0x5f2a('0xc')](_0x5f2a('0xd'),_0x2eceac,_0x5f2a('0xe'),JSON[_0x5f2a('0xf')](_0x7cd44e));if(_0x7cd44e['error']){if(_0x7cd44e[_0x5f2a('0x10')][_0x5f2a('0x11')]===0x1f4){logger[_0x5f2a('0x10')](_0x5f2a('0xb'),_0x2eceac,_0x7cd44e[_0x5f2a('0x10')][_0x5f2a('0x12')]);return _0x3fa8c3(_0x7cd44e[_0x5f2a('0x10')][_0x5f2a('0x12')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x2eceac,_0x7cd44e[_0x5f2a('0x10')][_0x5f2a('0x12')]);return _0x231a8d(_0x7cd44e['error']['message']);}else{logger[_0x5f2a('0xa')]('FaxApplication,\x20%s,\x20%s',_0x2eceac,_0x5f2a('0xe'));_0x231a8d(_0x7cd44e[_0x5f2a('0x13')][_0x5f2a('0x12')]);}})[_0x5f2a('0x14')](function(_0x277984){logger[_0x5f2a('0x10')](_0x5f2a('0xb'),_0x2eceac,_0x277984);_0x3fa8c3(_0x277984);});});}exports[_0x5f2a('0x15')]=function(_0x29eef5){var _0x1a362c=this;return new Promise(function(_0x2c7858,_0x37216d){return db[_0x5f2a('0x16')]['update'](_0x29eef5['body'],{'raw':_0x29eef5[_0x5f2a('0x17')]?_0x29eef5[_0x5f2a('0x17')][_0x5f2a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29eef5[_0x5f2a('0x17')]?_0x29eef5[_0x5f2a('0x17')][_0x5f2a('0x19')]||null:null,'attributes':_0x29eef5['options']?_0x29eef5['options'][_0x5f2a('0x1a')]||null:null,'limit':_0x29eef5[_0x5f2a('0x17')]?_0x29eef5[_0x5f2a('0x17')][_0x5f2a('0x1b')]||null:null})[_0x5f2a('0x9')](function(_0x12be76){logger[_0x5f2a('0xa')](_0x5f2a('0x15'),_0x29eef5);logger[_0x5f2a('0xc')](_0x5f2a('0x15'),_0x29eef5,JSON['stringify'](_0x12be76));_0x2c7858(_0x12be76);})[_0x5f2a('0x14')](function(_0x18d9d3){logger[_0x5f2a('0x10')](_0x5f2a('0x15'),_0x18d9d3[_0x5f2a('0x12')],_0x29eef5);_0x37216d(_0x1a362c['error'](0x1f4,_0x18d9d3[_0x5f2a('0x12')]));});});}; \ No newline at end of file +var _0x30c6=['catch','UpdateFaxApplication','FaxApplication','update','options','raw','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x30c6,0x15e));var _0x630c=function(_0x4d9668,_0x249fed){_0x4d9668=_0x4d9668-0x0;var _0x3d9eaa=_0x30c6[_0x4d9668];return _0x3d9eaa;};'use strict';var _=require(_0x630c('0x0'));var util=require(_0x630c('0x1'));var moment=require(_0x630c('0x2'));var BPromise=require(_0x630c('0x3'));var rs=require(_0x630c('0x4'));var fs=require('fs');var Redis=require(_0x630c('0x5'));var db=require(_0x630c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x630c('0x7'))(_0x630c('0x8'));var config=require(_0x630c('0x9'));var jayson=require(_0x630c('0xa'));var client=jayson[_0x630c('0xb')][_0x630c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d9749,_0x36c16a,_0x467e85){return new BPromise(function(_0x2a8c4e,_0x29ac9a){return client[_0x630c('0xd')](_0x1d9749,_0x467e85)['then'](function(_0x7113a7){logger[_0x630c('0xe')](_0x630c('0xf'),_0x36c16a,_0x630c('0x10'));logger[_0x630c('0x11')](_0x630c('0x12'),_0x36c16a,_0x630c('0x10'),JSON[_0x630c('0x13')](_0x7113a7));if(_0x7113a7[_0x630c('0x14')]){if(_0x7113a7[_0x630c('0x14')][_0x630c('0x15')]===0x1f4){logger[_0x630c('0x14')](_0x630c('0xf'),_0x36c16a,_0x7113a7[_0x630c('0x14')][_0x630c('0x16')]);return _0x29ac9a(_0x7113a7[_0x630c('0x14')]['message']);}logger[_0x630c('0x14')](_0x630c('0xf'),_0x36c16a,_0x7113a7[_0x630c('0x14')]['message']);return _0x2a8c4e(_0x7113a7['error'][_0x630c('0x16')]);}else{logger[_0x630c('0xe')](_0x630c('0xf'),_0x36c16a,_0x630c('0x10'));_0x2a8c4e(_0x7113a7[_0x630c('0x17')][_0x630c('0x16')]);}})[_0x630c('0x18')](function(_0x3b2b98){logger['error'](_0x630c('0xf'),_0x36c16a,_0x3b2b98);_0x29ac9a(_0x3b2b98);});});}exports[_0x630c('0x19')]=function(_0x272f58){var _0xba4a67=this;return new Promise(function(_0x51f9fb,_0x4fd6fd){return db[_0x630c('0x1a')][_0x630c('0x1b')](_0x272f58['body'],{'raw':_0x272f58[_0x630c('0x1c')]?_0x272f58['options'][_0x630c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x272f58[_0x630c('0x1c')]?_0x272f58['options'][_0x630c('0x1e')]||null:null,'attributes':_0x272f58[_0x630c('0x1c')]?_0x272f58[_0x630c('0x1c')][_0x630c('0x1f')]||null:null,'limit':_0x272f58[_0x630c('0x1c')]?_0x272f58['options'][_0x630c('0x20')]||null:null})[_0x630c('0x21')](function(_0x9932fe){logger['info'](_0x630c('0x19'),_0x272f58);logger[_0x630c('0x11')](_0x630c('0x19'),_0x272f58,JSON['stringify'](_0x9932fe));_0x51f9fb(_0x9932fe);})[_0x630c('0x18')](function(_0x5ef547){logger[_0x630c('0x14')](_0x630c('0x19'),_0x5ef547['message'],_0x272f58);_0x4fd6fd(_0xba4a67['error'](0x1f4,_0x5ef547['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index be7d03f..3b5d790 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 _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x863558,_0x401331){_0x863558=_0x863558-0x0;var _0x580899=_0x9ffd[_0x863558];return _0x580899;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file +var _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x55eacc,_0x3257f1){var _0x54decc=function(_0x43df93){while(--_0x43df93){_0x55eacc['push'](_0x55eacc['shift']());}};_0x54decc(++_0x3257f1);}(_0x5eb8,0xb0));var _0x85eb=function(_0x1a3243,_0x201872){_0x1a3243=_0x1a3243-0x0;var _0x33f2ca=_0x5eb8[_0x1a3243];return _0x33f2ca;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index f2dde80..de2576b 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 _0x1967=['exports','BOOLEAN','DATE','STRING','ENUM','out','INTEGER'];(function(_0x13fb93,_0xb192ab){var _0x485b0a=function(_0x402c68){while(--_0x402c68){_0x13fb93['push'](_0x13fb93['shift']());}};_0x485b0a(++_0xb192ab);}(_0x1967,0x173));var _0x7196=function(_0x713a2d,_0x2f5224){_0x713a2d=_0x713a2d-0x0;var _0x127220=_0x1967[_0x713a2d];return _0x127220;};'use strict';var Sequelize=require('sequelize');module[_0x7196('0x0')]={'closed':{'type':Sequelize[_0x7196('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7196('0x2')]},'disposition':{'type':Sequelize[_0x7196('0x3')]},'secondDisposition':{'type':Sequelize[_0x7196('0x3')]},'thirdDisposition':{'type':Sequelize[_0x7196('0x3')]},'note':{'type':Sequelize[_0x7196('0x3')]},'read1stAt':{'type':Sequelize[_0x7196('0x2')]},'fax':{'type':Sequelize[_0x7196('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x7196('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7196('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x7196('0x4')]('in',_0x7196('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x7196('0x6')]}}; \ No newline at end of file +var _0x32b6=['ENUM','out','INTEGER','sequelize','exports','DATE','STRING'];(function(_0x313d6f,_0x122c8d){var _0x2059ac=function(_0x49c551){while(--_0x49c551){_0x313d6f['push'](_0x313d6f['shift']());}};_0x2059ac(++_0x122c8d);}(_0x32b6,0x1d1));var _0x632b=function(_0x528dc8,_0x374049){_0x528dc8=_0x528dc8-0x0;var _0x492c85=_0x32b6[_0x528dc8];return _0x492c85;};'use strict';var Sequelize=require(_0x632b('0x0'));module[_0x632b('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x632b('0x2')]},'disposition':{'type':Sequelize[_0x632b('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x632b('0x3')]},'read1stAt':{'type':Sequelize[_0x632b('0x2')]},'fax':{'type':Sequelize[_0x632b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x632b('0x4')]('in',_0x632b('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x632b('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x632b('0x4')]('in',_0x632b('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x632b('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 302cc98..f4b8673 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 _0x471e=['files','tmp','join','attachments','transcript-%d-%s.zip','push','Attachment','Messages','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','resolve','log','err','rimraf','zip-dir','moment','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','json','then','destroy','stack','send','index','rawAttributes','fieldName','type','key','getOptions','findAll','fax','query','user','show','params','model','FaxInteraction','keys','filters','intersection','attributes','fields','length','includeAll','merge','find','catch','create','body','update','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','hasOwnProperty','order','sort','where','pick','FaxInteractionId','map','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','include','rows','addTags','setTags','spread','Tag','name','removeTags','download','unix','toString','root','server'];(function(_0xa7c05d,_0x312374){var _0x47b002=function(_0x44aa2f){while(--_0x44aa2f){_0xa7c05d['push'](_0xa7c05d['shift']());}};_0x47b002(++_0x312374);}(_0x471e,0x149));var _0xe471=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x471e[_0x2641f9];return _0x585741;};'use strict';var rimraf=require(_0xe471('0x0'));var zipdir=require(_0xe471('0x1'));var moment=require(_0xe471('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0xe471('0x3'));var Redis=require(_0xe471('0x4'));var interaction=require(_0xe471('0x5'));var qs=require(_0xe471('0x6'));var logger=require('../../config/logger')(_0xe471('0x7'));var config=require(_0xe471('0x8'));var db=require(_0xe471('0x9'))['db'];config[_0xe471('0xa')]=_[_0xe471('0xb')](config[_0xe471('0xa')],{'host':_0xe471('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe471('0xa')]));require(_0xe471('0xd'))[_0xe471('0xe')](socket);function respondWithStatusCode(_0x12c851,_0x474c4d){_0x474c4d=_0x474c4d||0xcc;return function(_0x314930){if(_0x314930){return _0x12c851[_0xe471('0xf')](_0x474c4d);}return _0x12c851[_0xe471('0x10')](_0x474c4d)[_0xe471('0x11')]();};}function respondWithResult(_0x63c431,_0x846c7c){_0x846c7c=_0x846c7c||0xc8;return function(_0x89b04a){if(_0x89b04a){return _0x63c431['status'](_0x846c7c)['json'](_0x89b04a);}};}function respondWithFilteredResult(_0x2e4da5,_0x2d7a7d){return function(_0x25de79){if(_0x25de79){var _0x172ee7=typeof _0x2d7a7d[_0xe471('0x12')]===_0xe471('0x13')&&typeof _0x2d7a7d[_0xe471('0x14')]===_0xe471('0x13');var _0x4f7c84=_0x25de79['count'];var _0x432308=_0x172ee7?0x0:_0x2d7a7d['offset'];var _0x28cc5c=_0x172ee7?_0x25de79[_0xe471('0x15')]:_0x2d7a7d['offset']+_0x2d7a7d[_0xe471('0x14')];var _0x1cfa76;if(_0x28cc5c>=_0x4f7c84){_0x28cc5c=_0x4f7c84;_0x1cfa76=0xc8;}else{_0x1cfa76=0xce;}_0x2e4da5[_0xe471('0x10')](_0x1cfa76);return _0x2e4da5['set']('Content-Range',_0x432308+'-'+_0x28cc5c+'/'+_0x4f7c84)[_0xe471('0x16')](_0x25de79);}return null;};}function saveUpdates(_0x183aa7){return function(_0x316273){if(_0x316273){return _0x316273['update'](_0x183aa7)[_0xe471('0x17')](function(_0x5019d9){return _0x5019d9;});}return null;};}function removeEntity(_0x5d2787){return function(_0x58976a){if(_0x58976a){return _0x58976a[_0xe471('0x18')]()[_0xe471('0x17')](function(){_0x5d2787[_0xe471('0x10')](0xcc)[_0xe471('0x11')]();});}};}function handleEntityNotFound(_0x27247f){return function(_0x475d09){if(!_0x475d09){_0x27247f[_0xe471('0xf')](0x194);}return _0x475d09;};}function handleError(_0x5dbe7e,_0x4ddded){_0x4ddded=_0x4ddded||0x1f4;return function(_0x1a33b4){logger['error'](_0x1a33b4[_0xe471('0x19')]);if(_0x1a33b4['name']){delete _0x1a33b4['name'];}_0x5dbe7e[_0xe471('0x10')](_0x4ddded)[_0xe471('0x1a')](_0x1a33b4);};}exports[_0xe471('0x1b')]=function(_0x51ba83,_0x29d6da){var _0x4340b6={};var _0x54f947=_['map'](db['FaxInteraction'][_0xe471('0x1c')],function(_0x22b273){return{'name':_0x22b273[_0xe471('0x1d')],'type':_0x22b273[_0xe471('0x1e')][_0xe471('0x1f')]};});_0x4340b6=qs[_0xe471('0x20')](_0x54f947,_0x51ba83);return interaction[_0xe471('0x21')](_0xe471('0x22'),_0x51ba83[_0xe471('0x23')],_0x51ba83[_0xe471('0x24')],_0x4340b6,_0x54f947)[_0xe471('0x17')](respondWithFilteredResult(_0x29d6da,_0x4340b6))['catch'](handleError(_0x29d6da,null));};exports[_0xe471('0x25')]=function(_0x58d274,_0x29baa8){var _0x10826b={'raw':![],'where':{'id':_0x58d274[_0xe471('0x26')]['id']}},_0x41ebdf={};_0x41ebdf[_0xe471('0x27')]=_['keys'](db[_0xe471('0x28')]['rawAttributes']);_0x41ebdf[_0xe471('0x23')]=_[_0xe471('0x29')](_0x58d274[_0xe471('0x23')]);_0x41ebdf[_0xe471('0x2a')]=_[_0xe471('0x2b')](_0x41ebdf[_0xe471('0x27')],_0x41ebdf[_0xe471('0x23')]);_0x10826b[_0xe471('0x2c')]=_[_0xe471('0x2b')](_0x41ebdf[_0xe471('0x27')],qs[_0xe471('0x2d')](_0x58d274['query'][_0xe471('0x2d')]));_0x10826b[_0xe471('0x2c')]=_0x10826b[_0xe471('0x2c')][_0xe471('0x2e')]?_0x10826b[_0xe471('0x2c')]:_0x41ebdf[_0xe471('0x27')];if(_0x58d274[_0xe471('0x23')][_0xe471('0x2f')]){_0x10826b['include']=[{'all':!![]}];}_0x10826b=_[_0xe471('0x30')]({},_0x10826b,_0x58d274['options']);return db[_0xe471('0x28')][_0xe471('0x31')](_0x10826b)[_0xe471('0x17')](handleEntityNotFound(_0x29baa8,null))['then'](respondWithResult(_0x29baa8,null))[_0xe471('0x32')](handleError(_0x29baa8,null));};exports[_0xe471('0x33')]=function(_0x2b2fa0,_0x23d8ea){return db[_0xe471('0x28')][_0xe471('0x33')](_0x2b2fa0[_0xe471('0x34')],{})['then'](respondWithResult(_0x23d8ea,0xc9))['catch'](handleError(_0x23d8ea,null));};exports[_0xe471('0x35')]=function(_0x4f3f8a,_0x5912e8){if(_0x4f3f8a[_0xe471('0x34')]['id']){delete _0x4f3f8a[_0xe471('0x34')]['id'];}return db[_0xe471('0x28')][_0xe471('0x31')]({'where':{'id':_0x4f3f8a['params']['id']}})[_0xe471('0x17')](handleEntityNotFound(_0x5912e8,null))[_0xe471('0x17')](saveUpdates(_0x4f3f8a[_0xe471('0x34')],null))['then'](respondWithResult(_0x5912e8,null))[_0xe471('0x32')](handleError(_0x5912e8,null));};exports[_0xe471('0x18')]=function(_0x3161ff,_0x38c2d0){return db['FaxInteraction'][_0xe471('0x31')]({'where':{'id':_0x3161ff['params']['id']}})[_0xe471('0x17')](handleEntityNotFound(_0x38c2d0,null))[_0xe471('0x17')](removeEntity(_0x38c2d0,null))['catch'](handleError(_0x38c2d0,null));};exports[_0xe471('0x36')]=function(_0x5d5c22,_0x2068de){return db[_0xe471('0x28')][_0xe471('0x36')]()[_0xe471('0x17')](respondWithResult(_0x2068de,null))['catch'](handleError(_0x2068de,null));};exports[_0xe471('0x37')]=function(_0x1ae932,_0x49c0c2){return db[_0xe471('0x38')][_0xe471('0x31')]({'where':{'id':_0x1ae932[_0xe471('0x26')]['id']}})[_0xe471('0x17')](handleEntityNotFound(_0x49c0c2,null))[_0xe471('0x17')](function(_0x10a37a){if(_0x10a37a){return _0x10a37a['addMessage'](_0x1ae932[_0xe471('0x34')][_0xe471('0x39')],_[_0xe471('0x3a')](_0x1ae932['body'],[_0xe471('0x39'),'id'])||{});}})[_0xe471('0x17')](respondWithResult(_0x49c0c2,null))['catch'](handleError(_0x49c0c2,null));};exports[_0xe471('0x3b')]=function(_0x591332,_0x4aca55){var _0x61d4c={'raw':![],'where':{}};var _0x267ed9={};var _0x2fd65d={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xe471('0x3c')]({'where':{'id':_0x591332[_0xe471('0x26')]['id']}})['then'](handleEntityNotFound(_0x4aca55,null))[_0xe471('0x17')](function(_0x45f78f){if(_0x45f78f){_0x267ed9[_0xe471('0x27')]=_['keys'](db[_0xe471('0x38')][_0xe471('0x1c')]);_0x267ed9[_0xe471('0x23')]=_[_0xe471('0x29')](_0x591332[_0xe471('0x23')]);_0x267ed9['filters']=_[_0xe471('0x2b')](_0x267ed9['model'],_0x267ed9[_0xe471('0x23')]);_0x61d4c[_0xe471('0x2c')]=_[_0xe471('0x2b')](_0x267ed9[_0xe471('0x27')],qs[_0xe471('0x2d')](_0x591332[_0xe471('0x23')]['fields']));_0x61d4c[_0xe471('0x2c')]=_0x61d4c[_0xe471('0x2c')]['length']?_0x61d4c['attributes']:_0x267ed9[_0xe471('0x27')];if(!_0x591332['query'][_0xe471('0x3d')]('nolimit')){_0x61d4c[_0xe471('0x14')]=qs['limit'](_0x591332[_0xe471('0x23')][_0xe471('0x14')]);_0x61d4c[_0xe471('0x12')]=qs[_0xe471('0x12')](_0x591332[_0xe471('0x23')][_0xe471('0x12')]);}_0x61d4c[_0xe471('0x3e')]=qs['sort'](_0x591332[_0xe471('0x23')][_0xe471('0x3f')]);_0x61d4c[_0xe471('0x40')]=qs[_0xe471('0x2a')](_[_0xe471('0x41')](_0x591332[_0xe471('0x23')],_0x267ed9['filters']));_0x61d4c['where'][_0xe471('0x42')]=_0x45f78f['id'];if(_0x591332[_0xe471('0x23')]['filter']){_0x61d4c[_0xe471('0x40')]=_[_0xe471('0x30')](_0x61d4c[_0xe471('0x40')],{'$or':_[_0xe471('0x43')](_0x61d4c[_0xe471('0x2c')],function(_0x38b727){var _0x5cf271={};_0x5cf271[_0x38b727]={'$like':'%'+_0x591332[_0xe471('0x23')][_0xe471('0x44')]+'%'};return _0x5cf271;})});}if(_0x591332[_0xe471('0x23')][_0xe471('0x45')]){var _0x21d786=_0x591332['query'][_0xe471('0x45')][_0xe471('0x46')](',');var _0x2b9fc3={};_0x2b9fc3[_0x21d786[0x0]]={'$gte':moment(_0x21d786[0x1])[_0xe471('0x47')](_0xe471('0x48'))};_0x61d4c[_0xe471('0x40')]=_[_0xe471('0x30')](_0x61d4c[_0xe471('0x40')],_0x2b9fc3);}_0x61d4c=_[_0xe471('0x30')]({},_0x61d4c,_0x591332[_0xe471('0x49')]);return db[_0xe471('0x38')][_0xe471('0x15')]({'where':_0x61d4c[_0xe471('0x40')]})[_0xe471('0x17')](function(_0x3472f3){_0x2fd65d[_0xe471('0x15')]=_0x3472f3;if(_0x591332['query'][_0xe471('0x2f')]){_0x61d4c[_0xe471('0x4a')]=[{'all':!![]}];}return db[_0xe471('0x38')][_0xe471('0x21')](_0x61d4c);})[_0xe471('0x17')](function(_0x28d411){_0x2fd65d[_0xe471('0x4b')]=_0x28d411;return _0x2fd65d;});}})[_0xe471('0x17')](respondWithFilteredResult(_0x4aca55,_0x61d4c))[_0xe471('0x32')](handleError(_0x4aca55,null));};exports[_0xe471('0x4c')]=function(_0x1dc18b,_0x2b9de7){return db['FaxInteraction'][_0xe471('0x31')]({'where':{'id':_0x1dc18b[_0xe471('0x26')]['id']}})[_0xe471('0x17')](handleEntityNotFound(_0x2b9de7,null))[_0xe471('0x17')](function(_0x3dfc0a){if(_0x3dfc0a){return _0x3dfc0a[_0xe471('0x4d')](_0x1dc18b[_0xe471('0x34')][_0xe471('0x39')],_[_0xe471('0x3a')](_0x1dc18b[_0xe471('0x34')],[_0xe471('0x39'),'id'])||{})[_0xe471('0x4e')](function(){return db[_0xe471('0x4f')][_0xe471('0x21')]({'attributes':['id',_0xe471('0x50'),'color'],'where':{'id':_0x1dc18b['body'][_0xe471('0x39')]}});})['then'](function(_0x1597ed){socket['emit']('faxInteractionTags:save',{'id':Number(_0x1dc18b[_0xe471('0x26')]['id']),'tags':_0x1597ed||[]});return{'id':Number(_0x1dc18b[_0xe471('0x26')]['id']),'tags':_0x1597ed||[]};});}})['then'](respondWithResult(_0x2b9de7,null))[_0xe471('0x32')](handleError(_0x2b9de7,null));};exports[_0xe471('0x51')]=function(_0x1d247e,_0x1b443e){return db[_0xe471('0x28')][_0xe471('0x31')]({'where':{'id':_0x1d247e['params']['id']}})[_0xe471('0x17')](handleEntityNotFound(_0x1b443e,null))['then'](function(_0x4e9421){if(_0x4e9421){return _0x4e9421['removeTags'](_0x1d247e[_0xe471('0x23')][_0xe471('0x39')]);}})[_0xe471('0x17')](respondWithStatusCode(_0x1b443e,null))[_0xe471('0x32')](handleError(_0x1b443e,null));};exports[_0xe471('0x52')]=function(_0x175add,_0x251df7){var _0x8349f8=moment()[_0xe471('0x53')]()[_0xe471('0x54')]();var _0x1ff9b3=path['join'](config[_0xe471('0x55')],_0xe471('0x56'),_0xe471('0x57'),_0xe471('0x58'));var _0x1335a8=path[_0xe471('0x59')](config[_0xe471('0x55')],'server',_0xe471('0x57'),_0xe471('0x5a'));var _0xa753e1=path[_0xe471('0x59')](_0x1ff9b3,_0x8349f8);var _0x235677=util[_0xe471('0x47')](_0xe471('0x5b'),_0x175add[_0xe471('0x26')]['id'],_0x8349f8);var _0x470a43=path[_0xe471('0x59')](_0x1ff9b3,_0x235677);var _0x58fdec=[];_0x58fdec[_0xe471('0x5c')]({'model':db[_0xe471('0x5d')],'as':'Attachment','raw':!![]});var _0x45365b=[{'model':db[_0xe471('0x38')],'as':'Messages','attributes':['id',_0xe471('0x34'),'createdAt'],'include':_0x58fdec}];return db[_0xe471('0x28')][_0xe471('0x31')]({'where':{'id':_0x175add[_0xe471('0x26')]['id']},'include':_0x45365b})[_0xe471('0x17')](handleEntityNotFound(_0x251df7,null))[_0xe471('0x17')](function(_0x1661f2){if(_0x1661f2&&_0x1661f2[_0xe471('0x5e')]){var _0xaa7b23=_0x1661f2[_0xe471('0x5f')]({'plain':!![]});fs[_0xe471('0x60')](_0xa753e1);for(var _0x3bd6f5=0x0;_0x3bd6f5<_0xaa7b23['Messages'][_0xe471('0x2e')];_0x3bd6f5++){var _0x57e5b4=_0xaa7b23['Messages'][_0x3bd6f5]['Attachment'];if(_0x57e5b4){var _0x4a1632=path[_0xe471('0x59')](_0x1335a8,_0x57e5b4[_0xe471('0x61')]);if(fs['existsSync'](_0x4a1632)){fs[_0xe471('0x62')](_0x4a1632)[_0xe471('0x63')](fs[_0xe471('0x64')](path['join'](_0xa753e1,_0x57e5b4[_0xe471('0x61')])));}}}return BPromise[_0xe471('0x65')]()[_0xe471('0x17')](function(){return new BPromise(function(_0xe646bd,_0x3a731d){zipdir(_0xa753e1,{'saveTo':_0x470a43},function(_0xbf4868,_0xccbf68){if(_0xbf4868)return _0x3a731d(_0xbf4868);return _0xe646bd(_0xccbf68);});})[_0xe471('0x17')](function(){return new BPromise(function(_0x1b1ec9,_0x3072e0){rimraf(_0xa753e1,function(_0x3afaa0){if(_0x3afaa0)_0x3072e0(_0x3afaa0);return _0x1b1ec9();});});})[_0xe471('0x17')](function(){return _0x251df7[_0xe471('0x52')](_0x470a43,_0x235677,function(_0x455965){if(_0x455965){console[_0xe471('0x66')](_0xe471('0x67'),_0x455965);}else{fs['unlinkSync'](_0x470a43);}});});});}else{return _0x251df7[_0xe471('0xf')](0xc8);}})[_0xe471('0x32')](handleError(_0x251df7,null));}; \ No newline at end of file +var _0x5eed=['type','key','fax','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','find','create','body','describe','FaxMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','addTags','setTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','toString','join','files','tmp','push','Attachment','Messages','createdAt','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','rimraf','moment','bluebird','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../mysqldb','redis','defaults','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','index','map','FaxInteraction','rawAttributes','fieldName'];(function(_0x2d16d8,_0x295ba2){var _0x40e2bf=function(_0x45c1cf){while(--_0x45c1cf){_0x2d16d8['push'](_0x2d16d8['shift']());}};_0x40e2bf(++_0x295ba2);}(_0x5eed,0x103));var _0xd5ee=function(_0x473dc1,_0x2f2a62){_0x473dc1=_0x473dc1-0x0;var _0x2c5bde=_0x5eed[_0x473dc1];return _0x2c5bde;};'use strict';var rimraf=require(_0xd5ee('0x0'));var zipdir=require('zip-dir');var moment=require(_0xd5ee('0x1'));var BPromise=require(_0xd5ee('0x2'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0xd5ee('0x3'));var Redis=require(_0xd5ee('0x4'));var interaction=require(_0xd5ee('0x5'));var qs=require(_0xd5ee('0x6'));var logger=require('../../config/logger')(_0xd5ee('0x7'));var config=require('../../config/environment');var db=require(_0xd5ee('0x8'))['db'];config[_0xd5ee('0x9')]=_[_0xd5ee('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd5ee('0x9')]));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x24ca67,_0x1096ee){_0x1096ee=_0x1096ee||0xcc;return function(_0x4ee662){if(_0x4ee662){return _0x24ca67['sendStatus'](_0x1096ee);}return _0x24ca67[_0xd5ee('0xb')](_0x1096ee)['end']();};}function respondWithResult(_0x96099c,_0x59d766){_0x59d766=_0x59d766||0xc8;return function(_0x3d8265){if(_0x3d8265){return _0x96099c[_0xd5ee('0xb')](_0x59d766)[_0xd5ee('0xc')](_0x3d8265);}};}function respondWithFilteredResult(_0x34f421,_0x6b8845){return function(_0x2efea9){if(_0x2efea9){var _0x17af6f=typeof _0x6b8845['offset']===_0xd5ee('0xd')&&typeof _0x6b8845[_0xd5ee('0xe')]===_0xd5ee('0xd');var _0x3294f3=_0x2efea9[_0xd5ee('0xf')];var _0x139193=_0x17af6f?0x0:_0x6b8845[_0xd5ee('0x10')];var _0x2e0970=_0x17af6f?_0x2efea9[_0xd5ee('0xf')]:_0x6b8845[_0xd5ee('0x10')]+_0x6b8845[_0xd5ee('0xe')];var _0x24b43d;if(_0x2e0970>=_0x3294f3){_0x2e0970=_0x3294f3;_0x24b43d=0xc8;}else{_0x24b43d=0xce;}_0x34f421[_0xd5ee('0xb')](_0x24b43d);return _0x34f421[_0xd5ee('0x11')](_0xd5ee('0x12'),_0x139193+'-'+_0x2e0970+'/'+_0x3294f3)[_0xd5ee('0xc')](_0x2efea9);}return null;};}function saveUpdates(_0x4f43be){return function(_0x36c179){if(_0x36c179){return _0x36c179[_0xd5ee('0x13')](_0x4f43be)[_0xd5ee('0x14')](function(_0x8ef175){return _0x8ef175;});}return null;};}function removeEntity(_0x39aa2a){return function(_0x32de9a){if(_0x32de9a){return _0x32de9a[_0xd5ee('0x15')]()[_0xd5ee('0x14')](function(){_0x39aa2a[_0xd5ee('0xb')](0xcc)[_0xd5ee('0x16')]();});}};}function handleEntityNotFound(_0x2aa1bc){return function(_0x21b54d){if(!_0x21b54d){_0x2aa1bc[_0xd5ee('0x17')](0x194);}return _0x21b54d;};}function handleError(_0x108504,_0xe4854){_0xe4854=_0xe4854||0x1f4;return function(_0x1ddefa){logger[_0xd5ee('0x18')](_0x1ddefa[_0xd5ee('0x19')]);if(_0x1ddefa[_0xd5ee('0x1a')]){delete _0x1ddefa[_0xd5ee('0x1a')];}_0x108504['status'](_0xe4854)['send'](_0x1ddefa);};}exports[_0xd5ee('0x1b')]=function(_0x3ed7e8,_0x546578){var _0x24e017={};var _0xaee91=_[_0xd5ee('0x1c')](db[_0xd5ee('0x1d')][_0xd5ee('0x1e')],function(_0x3546b8){return{'name':_0x3546b8[_0xd5ee('0x1f')],'type':_0x3546b8[_0xd5ee('0x20')][_0xd5ee('0x21')]};});_0x24e017=qs['getOptions'](_0xaee91,_0x3ed7e8);return interaction['findAll'](_0xd5ee('0x22'),_0x3ed7e8[_0xd5ee('0x23')],_0x3ed7e8[_0xd5ee('0x24')],_0x24e017,_0xaee91)[_0xd5ee('0x14')](respondWithFilteredResult(_0x546578,_0x24e017))[_0xd5ee('0x25')](handleError(_0x546578,null));};exports[_0xd5ee('0x26')]=function(_0x10b2bb,_0x261599){var _0x52c9e={'raw':![],'where':{'id':_0x10b2bb[_0xd5ee('0x27')]['id']}},_0x14745d={};_0x14745d[_0xd5ee('0x28')]=_[_0xd5ee('0x29')](db[_0xd5ee('0x1d')]['rawAttributes']);_0x14745d[_0xd5ee('0x23')]=_[_0xd5ee('0x29')](_0x10b2bb['query']);_0x14745d[_0xd5ee('0x2a')]=_[_0xd5ee('0x2b')](_0x14745d[_0xd5ee('0x28')],_0x14745d[_0xd5ee('0x23')]);_0x52c9e[_0xd5ee('0x2c')]=_[_0xd5ee('0x2b')](_0x14745d[_0xd5ee('0x28')],qs['fields'](_0x10b2bb['query'][_0xd5ee('0x2d')]));_0x52c9e[_0xd5ee('0x2c')]=_0x52c9e[_0xd5ee('0x2c')][_0xd5ee('0x2e')]?_0x52c9e[_0xd5ee('0x2c')]:_0x14745d[_0xd5ee('0x28')];if(_0x10b2bb['query'][_0xd5ee('0x2f')]){_0x52c9e['include']=[{'all':!![]}];}_0x52c9e=_['merge']({},_0x52c9e,_0x10b2bb['options']);return db['FaxInteraction'][_0xd5ee('0x30')](_0x52c9e)[_0xd5ee('0x14')](handleEntityNotFound(_0x261599,null))[_0xd5ee('0x14')](respondWithResult(_0x261599,null))[_0xd5ee('0x25')](handleError(_0x261599,null));};exports[_0xd5ee('0x31')]=function(_0x160c93,_0x43546b){return db[_0xd5ee('0x1d')][_0xd5ee('0x31')](_0x160c93[_0xd5ee('0x32')],{})['then'](respondWithResult(_0x43546b,0xc9))[_0xd5ee('0x25')](handleError(_0x43546b,null));};exports[_0xd5ee('0x13')]=function(_0x4b9cd7,_0x1d1078){if(_0x4b9cd7[_0xd5ee('0x32')]['id']){delete _0x4b9cd7[_0xd5ee('0x32')]['id'];}return db['FaxInteraction'][_0xd5ee('0x30')]({'where':{'id':_0x4b9cd7[_0xd5ee('0x27')]['id']}})[_0xd5ee('0x14')](handleEntityNotFound(_0x1d1078,null))[_0xd5ee('0x14')](saveUpdates(_0x4b9cd7[_0xd5ee('0x32')],null))[_0xd5ee('0x14')](respondWithResult(_0x1d1078,null))[_0xd5ee('0x25')](handleError(_0x1d1078,null));};exports['destroy']=function(_0x2f114f,_0x586c56){return db['FaxInteraction'][_0xd5ee('0x30')]({'where':{'id':_0x2f114f[_0xd5ee('0x27')]['id']}})['then'](handleEntityNotFound(_0x586c56,null))[_0xd5ee('0x14')](removeEntity(_0x586c56,null))[_0xd5ee('0x25')](handleError(_0x586c56,null));};exports[_0xd5ee('0x33')]=function(_0x43acae,_0x1978be){return db['FaxInteraction'][_0xd5ee('0x33')]()[_0xd5ee('0x14')](respondWithResult(_0x1978be,null))[_0xd5ee('0x25')](handleError(_0x1978be,null));};exports['addMessage']=function(_0x428bcf,_0x5a8673){return db[_0xd5ee('0x34')][_0xd5ee('0x30')]({'where':{'id':_0x428bcf[_0xd5ee('0x27')]['id']}})[_0xd5ee('0x14')](handleEntityNotFound(_0x5a8673,null))[_0xd5ee('0x14')](function(_0x4f7549){if(_0x4f7549){return _0x4f7549['addMessage'](_0x428bcf['body'][_0xd5ee('0x35')],_[_0xd5ee('0x36')](_0x428bcf['body'],[_0xd5ee('0x35'),'id'])||{});}})[_0xd5ee('0x14')](respondWithResult(_0x5a8673,null))[_0xd5ee('0x25')](handleError(_0x5a8673,null));};exports[_0xd5ee('0x37')]=function(_0x306499,_0x302577){var _0x3ff515={'raw':![],'where':{}};var _0x401c98={};var _0x4952b6={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xd5ee('0x38')]({'where':{'id':_0x306499[_0xd5ee('0x27')]['id']}})[_0xd5ee('0x14')](handleEntityNotFound(_0x302577,null))[_0xd5ee('0x14')](function(_0x3b4b5d){if(_0x3b4b5d){_0x401c98[_0xd5ee('0x28')]=_[_0xd5ee('0x29')](db['FaxMessage'][_0xd5ee('0x1e')]);_0x401c98[_0xd5ee('0x23')]=_['keys'](_0x306499['query']);_0x401c98[_0xd5ee('0x2a')]=_[_0xd5ee('0x2b')](_0x401c98[_0xd5ee('0x28')],_0x401c98['query']);_0x3ff515[_0xd5ee('0x2c')]=_[_0xd5ee('0x2b')](_0x401c98['model'],qs[_0xd5ee('0x2d')](_0x306499[_0xd5ee('0x23')][_0xd5ee('0x2d')]));_0x3ff515[_0xd5ee('0x2c')]=_0x3ff515[_0xd5ee('0x2c')][_0xd5ee('0x2e')]?_0x3ff515[_0xd5ee('0x2c')]:_0x401c98[_0xd5ee('0x28')];if(!_0x306499['query'][_0xd5ee('0x39')](_0xd5ee('0x3a'))){_0x3ff515[_0xd5ee('0xe')]=qs[_0xd5ee('0xe')](_0x306499['query'][_0xd5ee('0xe')]);_0x3ff515[_0xd5ee('0x10')]=qs[_0xd5ee('0x10')](_0x306499[_0xd5ee('0x23')][_0xd5ee('0x10')]);}_0x3ff515[_0xd5ee('0x3b')]=qs[_0xd5ee('0x3c')](_0x306499[_0xd5ee('0x23')][_0xd5ee('0x3c')]);_0x3ff515[_0xd5ee('0x3d')]=qs[_0xd5ee('0x2a')](_[_0xd5ee('0x3e')](_0x306499[_0xd5ee('0x23')],_0x401c98[_0xd5ee('0x2a')]));_0x3ff515[_0xd5ee('0x3d')]['FaxInteractionId']=_0x3b4b5d['id'];if(_0x306499[_0xd5ee('0x23')][_0xd5ee('0x3f')]){_0x3ff515[_0xd5ee('0x3d')]=_[_0xd5ee('0x40')](_0x3ff515[_0xd5ee('0x3d')],{'$or':_[_0xd5ee('0x1c')](_0x3ff515[_0xd5ee('0x2c')],function(_0x2f44c1){var _0x2cf054={};_0x2cf054[_0x2f44c1]={'$like':'%'+_0x306499[_0xd5ee('0x23')][_0xd5ee('0x3f')]+'%'};return _0x2cf054;})});}if(_0x306499['query'][_0xd5ee('0x41')]){var _0x303176=_0x306499['query'][_0xd5ee('0x41')][_0xd5ee('0x42')](',');var _0x5e47f8={};_0x5e47f8[_0x303176[0x0]]={'$gte':moment(_0x303176[0x1])[_0xd5ee('0x43')](_0xd5ee('0x44'))};_0x3ff515[_0xd5ee('0x3d')]=_[_0xd5ee('0x40')](_0x3ff515[_0xd5ee('0x3d')],_0x5e47f8);}_0x3ff515=_[_0xd5ee('0x40')]({},_0x3ff515,_0x306499[_0xd5ee('0x45')]);return db[_0xd5ee('0x34')][_0xd5ee('0xf')]({'where':_0x3ff515[_0xd5ee('0x3d')]})['then'](function(_0x5907c6){_0x4952b6[_0xd5ee('0xf')]=_0x5907c6;if(_0x306499[_0xd5ee('0x23')][_0xd5ee('0x2f')]){_0x3ff515[_0xd5ee('0x46')]=[{'all':!![]}];}return db[_0xd5ee('0x34')][_0xd5ee('0x47')](_0x3ff515);})[_0xd5ee('0x14')](function(_0x3d09e2){_0x4952b6['rows']=_0x3d09e2;return _0x4952b6;});}})[_0xd5ee('0x14')](respondWithFilteredResult(_0x302577,_0x3ff515))[_0xd5ee('0x25')](handleError(_0x302577,null));};exports[_0xd5ee('0x48')]=function(_0x327205,_0x14f0ee){return db[_0xd5ee('0x1d')]['find']({'where':{'id':_0x327205[_0xd5ee('0x27')]['id']}})[_0xd5ee('0x14')](handleEntityNotFound(_0x14f0ee,null))[_0xd5ee('0x14')](function(_0x481551){if(_0x481551){return _0x481551[_0xd5ee('0x49')](_0x327205[_0xd5ee('0x32')][_0xd5ee('0x35')],_[_0xd5ee('0x36')](_0x327205[_0xd5ee('0x32')],[_0xd5ee('0x35'),'id'])||{})[_0xd5ee('0x4a')](function(){return db[_0xd5ee('0x4b')][_0xd5ee('0x47')]({'attributes':['id','name',_0xd5ee('0x4c')],'where':{'id':_0x327205['body'][_0xd5ee('0x35')]}});})['then'](function(_0x412b15){socket[_0xd5ee('0x4d')](_0xd5ee('0x4e'),{'id':Number(_0x327205['params']['id']),'tags':_0x412b15||[]});return{'id':Number(_0x327205[_0xd5ee('0x27')]['id']),'tags':_0x412b15||[]};});}})['then'](respondWithResult(_0x14f0ee,null))['catch'](handleError(_0x14f0ee,null));};exports[_0xd5ee('0x4f')]=function(_0x4770a1,_0x44b6db){return db['FaxInteraction']['find']({'where':{'id':_0x4770a1['params']['id']}})[_0xd5ee('0x14')](handleEntityNotFound(_0x44b6db,null))['then'](function(_0x4c5986){if(_0x4c5986){return _0x4c5986[_0xd5ee('0x4f')](_0x4770a1[_0xd5ee('0x23')][_0xd5ee('0x35')]);}})[_0xd5ee('0x14')](respondWithStatusCode(_0x44b6db,null))[_0xd5ee('0x25')](handleError(_0x44b6db,null));};exports[_0xd5ee('0x50')]=function(_0x1b6226,_0x2fce10){var _0x46db95=moment()['unix']()[_0xd5ee('0x51')]();var _0x1560b8=path[_0xd5ee('0x52')](config['root'],'server',_0xd5ee('0x53'),_0xd5ee('0x54'));var _0x43504a=path[_0xd5ee('0x52')](config['root'],'server','files','attachments');var _0x37e8c1=path[_0xd5ee('0x52')](_0x1560b8,_0x46db95);var _0x227b02=util[_0xd5ee('0x43')]('transcript-%d-%s.zip',_0x1b6226['params']['id'],_0x46db95);var _0x578667=path[_0xd5ee('0x52')](_0x1560b8,_0x227b02);var _0x24b983=[];_0x24b983[_0xd5ee('0x55')]({'model':db[_0xd5ee('0x56')],'as':_0xd5ee('0x56'),'raw':!![]});var _0x42ce9f=[{'model':db['FaxMessage'],'as':_0xd5ee('0x57'),'attributes':['id','body',_0xd5ee('0x58')],'include':_0x24b983}];return db[_0xd5ee('0x1d')][_0xd5ee('0x30')]({'where':{'id':_0x1b6226[_0xd5ee('0x27')]['id']},'include':_0x42ce9f})['then'](handleEntityNotFound(_0x2fce10,null))[_0xd5ee('0x14')](function(_0x53ca23){if(_0x53ca23&&_0x53ca23[_0xd5ee('0x57')]){var _0x568781=_0x53ca23['get']({'plain':!![]});fs[_0xd5ee('0x59')](_0x37e8c1);for(var _0x1e0019=0x0;_0x1e0019<_0x568781[_0xd5ee('0x57')][_0xd5ee('0x2e')];_0x1e0019++){var _0x2df13a=_0x568781[_0xd5ee('0x57')][_0x1e0019]['Attachment'];if(_0x2df13a){var _0x270b14=path[_0xd5ee('0x52')](_0x43504a,_0x2df13a[_0xd5ee('0x5a')]);if(fs[_0xd5ee('0x5b')](_0x270b14)){fs[_0xd5ee('0x5c')](_0x270b14)[_0xd5ee('0x5d')](fs[_0xd5ee('0x5e')](path['join'](_0x37e8c1,_0x2df13a[_0xd5ee('0x5a')])));}}}return BPromise['resolve']()[_0xd5ee('0x14')](function(){return new BPromise(function(_0x3b37ab,_0x56246c){zipdir(_0x37e8c1,{'saveTo':_0x578667},function(_0x17ef0a,_0x57498e){if(_0x17ef0a)return _0x56246c(_0x17ef0a);return _0x3b37ab(_0x57498e);});})[_0xd5ee('0x14')](function(){return new BPromise(function(_0xda8a34,_0x56b2b3){rimraf(_0x37e8c1,function(_0x11f9ca){if(_0x11f9ca)_0x56b2b3(_0x11f9ca);return _0xda8a34();});});})[_0xd5ee('0x14')](function(){return _0x2fce10['download'](_0x578667,_0x227b02,function(_0x58372e){if(_0x58372e){console[_0xd5ee('0x5f')](_0xd5ee('0x60'),_0x58372e);}else{fs['unlinkSync'](_0x578667);}});});});}else{return _0x2fce10['sendStatus'](0xc8);}})[_0xd5ee('0x25')](handleError(_0x2fce10,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 9e8c652..60fa370 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 _0x62d0=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','getUsers','then','Users','findAll','setDataValue'];(function(_0x5cb8cd,_0x5821d4){var _0x1bccd6=function(_0x42f1f8){while(--_0x42f1f8){_0x5cb8cd['push'](_0x5cb8cd['shift']());}};_0x1bccd6(++_0x5821d4);}(_0x62d0,0x183));var _0x062d=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x62d0[_0x599f41];return _0x2e4d58;};'use strict';var EventEmitter=require(_0x062d('0x0'));var FaxInteraction=require(_0x062d('0x1'))['db'][_0x062d('0x2')];var FaxMessage=require(_0x062d('0x1'))['db'][_0x062d('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x062d('0x4')](0x0);var events={'afterCreate':_0x062d('0x5'),'afterUpdate':_0x062d('0x6'),'afterDestroy':'remove'};function emitEvent(_0x540a6f){return function(_0x3f32fe,_0x2b8a60,_0x2dc1af){_0x3f32fe[_0x062d('0x7')]({'attributes':['id'],'raw':!![]})[_0x062d('0x8')](function(_0x373c57){_0x3f32fe['setDataValue'](_0x062d('0x9'),_0x373c57['map'](function(_0x450320){return{'id':_0x450320['id']};}));return FaxMessage[_0x062d('0xa')]({'where':{'FaxInteractionId':_0x3f32fe['id'],'direction':'in','read':![]},'raw':!![]});})[_0x062d('0x8')](function(_0x5371ca){_0x3f32fe[_0x062d('0xb')](_0x062d('0xc'),_0x5371ca[_0x062d('0xd')]);FaxInteractionEvents[_0x062d('0xe')](_0x540a6f+':'+_0x3f32fe['id'],_0x3f32fe);FaxInteractionEvents['emit'](_0x540a6f,_0x3f32fe);_0x2dc1af(null);})[_0x062d('0xf')](_0x2dc1af(null));};}for(var e in events){if(events[_0x062d('0x10')](e)){var event=events[e];FaxInteraction[_0x062d('0x11')](e,emitEvent(event));}}module[_0x062d('0x12')]=FaxInteractionEvents; \ No newline at end of file +var _0x38b7=['hasOwnProperty','hook','exports','events','FaxInteraction','../../mysqldb','FaxMessage','save','update','remove','getUsers','Users','map','findAll','then','setDataValue','unreadMessages','emit','catch'];(function(_0x52764f,_0xdd7611){var _0x48c128=function(_0x4817c3){while(--_0x4817c3){_0x52764f['push'](_0x52764f['shift']());}};_0x48c128(++_0xdd7611);}(_0x38b7,0x9b));var _0x738b=function(_0x36f5bf,_0x38d7fd){_0x36f5bf=_0x36f5bf-0x0;var _0x23e6be=_0x38b7[_0x36f5bf];return _0x23e6be;};'use strict';var EventEmitter=require(_0x738b('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x738b('0x1')];var FaxMessage=require(_0x738b('0x2'))['db'][_0x738b('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x738b('0x4'),'afterUpdate':_0x738b('0x5'),'afterDestroy':_0x738b('0x6')};function emitEvent(_0x26db5c){return function(_0x4d04cb,_0xa1dcbe,_0x413f1f){_0x4d04cb[_0x738b('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x156b4b){_0x4d04cb['setDataValue'](_0x738b('0x8'),_0x156b4b[_0x738b('0x9')](function(_0x16a1df){return{'id':_0x16a1df['id']};}));return FaxMessage[_0x738b('0xa')]({'where':{'FaxInteractionId':_0x4d04cb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x738b('0xb')](function(_0xa57c60){_0x4d04cb[_0x738b('0xc')](_0x738b('0xd'),_0xa57c60['length']);FaxInteractionEvents['emit'](_0x26db5c+':'+_0x4d04cb['id'],_0x4d04cb);FaxInteractionEvents[_0x738b('0xe')](_0x26db5c,_0x4d04cb);_0x413f1f(null);})[_0x738b('0xf')](_0x413f1f(null));};}for(var e in events){if(events[_0x738b('0x10')](e)){var event=events[e];FaxInteraction[_0x738b('0x11')](e,emitEvent(event));}}module[_0x738b('0x12')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index f946291..74427b5 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 _0xa469=['YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird','request-promise','path','./faxInteraction.attributes','FaxInteraction','fax_interactions','changed','closedAt','format'];(function(_0x3ae1a6,_0x4b43cd){var _0x1279af=function(_0x21e6b6){while(--_0x21e6b6){_0x3ae1a6['push'](_0x3ae1a6['shift']());}};_0x1279af(++_0x4b43cd);}(_0xa469,0x9d));var _0x9a46=function(_0x40396f,_0x59d380){_0x40396f=_0x40396f-0x0;var _0x4c9702=_0xa469[_0x40396f];return _0x4c9702;};'use strict';var _=require(_0x9a46('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9a46('0x1'));var moment=require(_0x9a46('0x2'));var BPromise=require(_0x9a46('0x3'));var rp=require(_0x9a46('0x4'));var fs=require('fs');var path=require(_0x9a46('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9a46('0x6'));module['exports']=function(_0x187d07,_0x4db94c){return _0x187d07['define'](_0x9a46('0x7'),attributes,{'tableName':_0x9a46('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x9fb0af,_0x412968,_0x2140c3){if(_0x9fb0af[_0x9a46('0x9')]('closed')){_0x9fb0af[_0x9a46('0xa')]=moment()[_0x9a46('0xb')](_0x9a46('0xc'));}_0x2140c3(null,_0x9fb0af);}}});}; \ No newline at end of file +var _0x96b8=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x36ff43,_0x49011a){var _0x3e2543=function(_0x45c08c){while(--_0x45c08c){_0x36ff43['push'](_0x36ff43['shift']());}};_0x3e2543(++_0x49011a);}(_0x96b8,0x1b9));var _0x896b=function(_0x117abd,_0x55d08b){_0x117abd=_0x117abd-0x0;var _0x2e46f2=_0x96b8[_0x117abd];return _0x2e46f2;};'use strict';var _=require(_0x896b('0x0'));var util=require(_0x896b('0x1'));var logger=require(_0x896b('0x2'))(_0x896b('0x3'));var moment=require(_0x896b('0x4'));var BPromise=require(_0x896b('0x5'));var rp=require(_0x896b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x896b('0x7'));var config=require(_0x896b('0x8'));var attributes=require('./faxInteraction.attributes');module[_0x896b('0x9')]=function(_0x2bf636,_0x32e6c0){return _0x2bf636[_0x896b('0xa')]('FaxInteraction',attributes,{'tableName':_0x896b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x176394,_0x4fce4f,_0x298e03){if(_0x176394[_0x896b('0xc')](_0x896b('0xd'))){_0x176394[_0x896b('0xe')]=moment()[_0x896b('0xf')](_0x896b('0x10'));}_0x298e03(null,_0x176394);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 557247d..2142f98 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 _0xf638=['jayson/promise','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','FaxInteraction','update','raw','options','where','attributes','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x31dd7d,_0x41e269){var _0x3f8100=function(_0x93301b){while(--_0x93301b){_0x31dd7d['push'](_0x31dd7d['shift']());}};_0x3f8100(++_0x41e269);}(_0xf638,0x9d));var _0x8f63=function(_0x2c014d,_0x195a80){_0x2c014d=_0x2c014d-0x0;var _0xa9393=_0xf638[_0x2c014d];return _0xa9393;};'use strict';var _=require(_0x8f63('0x0'));var util=require(_0x8f63('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8f63('0x2'));var fs=require('fs');var Redis=require(_0x8f63('0x3'));var db=require(_0x8f63('0x4'))['db'];var utils=require(_0x8f63('0x5'));var logger=require('../../config/logger')(_0x8f63('0x6'));var config=require('../../config/environment');var jayson=require(_0x8f63('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x8f63('0x8')]=_[_0x8f63('0x9')](config[_0x8f63('0x8')],{'host':_0x8f63('0xa'),'port':0x18eb});var socket=require(_0x8f63('0xb'))(new Redis(config[_0x8f63('0x8')]));require(_0x8f63('0xc'))[_0x8f63('0xd')](socket);function respondWithRpcPromise(_0x51508a,_0x3cbfb3,_0x4cbcd9){return new BPromise(function(_0x49cc81,_0x29f416){return client[_0x8f63('0xe')](_0x51508a,_0x4cbcd9)[_0x8f63('0xf')](function(_0x4ab272){logger[_0x8f63('0x10')](_0x8f63('0x11'),_0x3cbfb3,_0x8f63('0x12'));logger[_0x8f63('0x13')](_0x8f63('0x14'),_0x3cbfb3,_0x8f63('0x12'),JSON[_0x8f63('0x15')](_0x4ab272));if(_0x4ab272[_0x8f63('0x16')]){if(_0x4ab272['error']['code']===0x1f4){logger[_0x8f63('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x3cbfb3,_0x4ab272[_0x8f63('0x16')]['message']);return _0x29f416(_0x4ab272[_0x8f63('0x16')][_0x8f63('0x17')]);}logger[_0x8f63('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x3cbfb3,_0x4ab272[_0x8f63('0x16')][_0x8f63('0x17')]);return _0x49cc81(_0x4ab272[_0x8f63('0x16')][_0x8f63('0x17')]);}else{logger[_0x8f63('0x10')](_0x8f63('0x11'),_0x3cbfb3,_0x8f63('0x12'));_0x49cc81(_0x4ab272[_0x8f63('0x18')][_0x8f63('0x17')]);}})['catch'](function(_0x18035c){logger['error'](_0x8f63('0x11'),_0x3cbfb3,_0x18035c);_0x29f416(_0x18035c);});});}exports['UpdateFaxInteraction']=function(_0x293e99){var _0x31e0fc=this;return new Promise(function(_0x487c50,_0x3c68bb){return db[_0x8f63('0x19')][_0x8f63('0x1a')](_0x293e99['body'],{'raw':_0x293e99['options']?_0x293e99['options'][_0x8f63('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x293e99[_0x8f63('0x1c')]?_0x293e99['options'][_0x8f63('0x1d')]||null:null,'attributes':_0x293e99['options']?_0x293e99[_0x8f63('0x1c')][_0x8f63('0x1e')]||null:null,'limit':_0x293e99[_0x8f63('0x1c')]?_0x293e99['options'][_0x8f63('0x1f')]||null:null})[_0x8f63('0xf')](function(_0x4c9f84){logger[_0x8f63('0x10')](_0x8f63('0x20'),_0x293e99);logger[_0x8f63('0x13')](_0x8f63('0x20'),_0x293e99,JSON[_0x8f63('0x15')](_0x4c9f84));_0x487c50(_0x4c9f84);})['catch'](function(_0x5ceec5){logger[_0x8f63('0x16')](_0x8f63('0x20'),_0x5ceec5[_0x8f63('0x17')],_0x293e99);_0x3c68bb(_0x31e0fc[_0x8f63('0x16')](0x1f4,_0x5ceec5['message']));});});};exports[_0x8f63('0x21')]=function(_0x29b0e9){return new Promise(function(_0x2345be,_0x197562){return db[_0x8f63('0x19')][_0x8f63('0x22')]({'where':_0x29b0e9[_0x8f63('0x1c')]?_0x29b0e9['options']['where']||null:null})[_0x8f63('0xf')](function(_0x3f139a){if(_0x3f139a){return _0x3f139a[_0x8f63('0x23')](_0x29b0e9[_0x8f63('0x24')][_0x8f63('0x25')],_[_0x8f63('0x26')](_0x29b0e9[_0x8f63('0x24')],['ids','id'])||{});}})[_0x8f63('0x27')](function(_0x2dd047){logger['info'](_0x8f63('0x28'),_0x29b0e9);logger[_0x8f63('0x13')](_0x8f63('0x28'),_0x29b0e9,JSON[_0x8f63('0x15')](_0x2dd047));_0x2345be(_0x2dd047);})['catch'](function(_0x157402){logger['error'](_0x8f63('0x28'),_0x157402[_0x8f63('0x17')],_0x29b0e9);_0x197562(_this[_0x8f63('0x16')](0x1f4,_0x157402[_0x8f63('0x17')]));});});}; \ No newline at end of file +var _0x1a06=['limit','catch','AddTagsToFaxInteraction','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x1a06,0x10f));var _0x61a0=function(_0x57cde5,_0x1f90a3){_0x57cde5=_0x57cde5-0x0;var _0x5d9dd6=_0x1a06[_0x57cde5];return _0x5d9dd6;};'use strict';var _=require(_0x61a0('0x0'));var util=require(_0x61a0('0x1'));var moment=require(_0x61a0('0x2'));var BPromise=require(_0x61a0('0x3'));var rs=require(_0x61a0('0x4'));var fs=require('fs');var Redis=require(_0x61a0('0x5'));var db=require(_0x61a0('0x6'))['db'];var utils=require(_0x61a0('0x7'));var logger=require(_0x61a0('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x61a0('0x9'));var client=jayson[_0x61a0('0xa')]['http']({'port':0x232a});config['redis']=_[_0x61a0('0xb')](config[_0x61a0('0xc')],{'host':_0x61a0('0xd'),'port':0x18eb});var socket=require(_0x61a0('0xe'))(new Redis(config[_0x61a0('0xc')]));require(_0x61a0('0xf'))[_0x61a0('0x10')](socket);function respondWithRpcPromise(_0x3dc03c,_0x567fa7,_0x4f3db1){return new BPromise(function(_0x7f489e,_0x145fc2){return client[_0x61a0('0x11')](_0x3dc03c,_0x4f3db1)[_0x61a0('0x12')](function(_0x297998){logger[_0x61a0('0x13')](_0x61a0('0x14'),_0x567fa7,'request\x20sent');logger[_0x61a0('0x15')](_0x61a0('0x16'),_0x567fa7,_0x61a0('0x17'),JSON[_0x61a0('0x18')](_0x297998));if(_0x297998['error']){if(_0x297998['error'][_0x61a0('0x19')]===0x1f4){logger['error'](_0x61a0('0x14'),_0x567fa7,_0x297998['error'][_0x61a0('0x1a')]);return _0x145fc2(_0x297998[_0x61a0('0x1b')][_0x61a0('0x1a')]);}logger[_0x61a0('0x1b')]('FaxInteraction,\x20%s,\x20%s',_0x567fa7,_0x297998[_0x61a0('0x1b')][_0x61a0('0x1a')]);return _0x7f489e(_0x297998[_0x61a0('0x1b')]['message']);}else{logger[_0x61a0('0x13')](_0x61a0('0x14'),_0x567fa7,_0x61a0('0x17'));_0x7f489e(_0x297998[_0x61a0('0x1c')]['message']);}})['catch'](function(_0x58e120){logger[_0x61a0('0x1b')](_0x61a0('0x14'),_0x567fa7,_0x58e120);_0x145fc2(_0x58e120);});});}exports[_0x61a0('0x1d')]=function(_0x3a39e7){var _0x3c6167=this;return new Promise(function(_0xbe6ff1,_0x52f34e){return db[_0x61a0('0x1e')][_0x61a0('0x1f')](_0x3a39e7[_0x61a0('0x20')],{'raw':_0x3a39e7[_0x61a0('0x21')]?_0x3a39e7[_0x61a0('0x21')][_0x61a0('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a39e7['options']?_0x3a39e7[_0x61a0('0x21')][_0x61a0('0x23')]||null:null,'attributes':_0x3a39e7[_0x61a0('0x21')]?_0x3a39e7['options'][_0x61a0('0x24')]||null:null,'limit':_0x3a39e7[_0x61a0('0x21')]?_0x3a39e7[_0x61a0('0x21')][_0x61a0('0x25')]||null:null})['then'](function(_0x500f0b){logger[_0x61a0('0x13')](_0x61a0('0x1d'),_0x3a39e7);logger[_0x61a0('0x15')](_0x61a0('0x1d'),_0x3a39e7,JSON['stringify'](_0x500f0b));_0xbe6ff1(_0x500f0b);})[_0x61a0('0x26')](function(_0x18c7c1){logger[_0x61a0('0x1b')](_0x61a0('0x1d'),_0x18c7c1['message'],_0x3a39e7);_0x52f34e(_0x3c6167[_0x61a0('0x1b')](0x1f4,_0x18c7c1[_0x61a0('0x1a')]));});});};exports[_0x61a0('0x27')]=function(_0x4917d1){return new Promise(function(_0x135ddc,_0x63c287){return db[_0x61a0('0x1e')]['find']({'where':_0x4917d1[_0x61a0('0x21')]?_0x4917d1[_0x61a0('0x21')][_0x61a0('0x23')]||null:null})['then'](function(_0x3699fa){if(_0x3699fa){return _0x3699fa[_0x61a0('0x28')](_0x4917d1['body'][_0x61a0('0x29')],_['omit'](_0x4917d1[_0x61a0('0x20')],[_0x61a0('0x29'),'id'])||{});}})[_0x61a0('0x2a')](function(_0x1ca53e){logger['info']('AddTags',_0x4917d1);logger[_0x61a0('0x15')](_0x61a0('0x2b'),_0x4917d1,JSON[_0x61a0('0x18')](_0x1ca53e));_0x135ddc(_0x1ca53e);})['catch'](function(_0x1902f2){logger[_0x61a0('0x1b')](_0x61a0('0x2b'),_0x1902f2[_0x61a0('0x1a')],_0x4917d1);_0x63c287(_this['error'](0x1f4,_0x1902f2[_0x61a0('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 1d780c8..c2313cd 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 _0x6f12=['removeListener','register','length','faxInteraction:','save','remove'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6f12,0x14e));var _0x26f1=function(_0x25b4d8,_0x3f00b3){_0x25b4d8=_0x25b4d8-0x0;var _0x4aeb9a=_0x6f12[_0x25b4d8];return _0x4aeb9a;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x26f1('0x0'),_0x26f1('0x1'),'update'];function createListener(_0x5e35d1,_0x5134ac){return function(_0x19f91d){_0x5134ac['emit'](_0x5e35d1,_0x19f91d);};}function removeListener(_0x34e314,_0x3ab148){return function(){FaxInteractionEvents[_0x26f1('0x2')](_0x34e314,_0x3ab148);};}exports[_0x26f1('0x3')]=function(_0x2aad2f){for(var _0x5886d8=0x0,_0x28887d=events[_0x26f1('0x4')];_0x5886d8<_0x28887d;_0x5886d8++){var _0x2601d2=events[_0x5886d8];var _0x4fdf3b=createListener(_0x26f1('0x5')+_0x2601d2,_0x2aad2f);FaxInteractionEvents['on'](_0x2601d2,_0x4fdf3b);}}; \ No newline at end of file +var _0xb770=['save','remove','update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events'];(function(_0x2449bc,_0x493bc9){var _0x2f8628=function(_0xab2e47){while(--_0xab2e47){_0x2449bc['push'](_0x2449bc['shift']());}};_0x2f8628(++_0x493bc9);}(_0xb770,0x7d));var _0x0b77=function(_0x555e05,_0x21c425){_0x555e05=_0x555e05-0x0;var _0x1d4250=_0xb770[_0x555e05];return _0x1d4250;};'use strict';var FaxInteractionEvents=require(_0x0b77('0x0'));var events=[_0x0b77('0x1'),_0x0b77('0x2'),_0x0b77('0x3')];function createListener(_0x3ac79c,_0x35180f){return function(_0x30effa){_0x35180f[_0x0b77('0x4')](_0x3ac79c,_0x30effa);};}function removeListener(_0x2dded6,_0x5222d7){return function(){FaxInteractionEvents[_0x0b77('0x5')](_0x2dded6,_0x5222d7);};}exports[_0x0b77('0x6')]=function(_0x259256){for(var _0x119335=0x0,_0x5e18e8=events[_0x0b77('0x7')];_0x119335<_0x5e18e8;_0x119335++){var _0x1249c0=events[_0x119335];var _0x5ac3de=createListener(_0x0b77('0x8')+_0x1249c0,_0x259256);FaxInteractionEvents['on'](_0x1249c0,_0x5ac3de);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index b64039f..2bced01 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 _0x73f9=['/:id/tags','tracked','fax','faxinteraction:addtags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','index','/describe','get','/:id','show','isAuthenticated','getMessages','/:id/download','download','post','create','/:id/messages','addMessage'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x73f9,0x1c6));var _0x973f=function(_0x5dfe1c,_0x4720fe){_0x5dfe1c=_0x5dfe1c-0x0;var _0x16606f=_0x73f9[_0x5dfe1c];return _0x16606f;};'use strict';var multer=require('multer');var util=require(_0x973f('0x0'));var path=require(_0x973f('0x1'));var timeout=require(_0x973f('0x2'));var express=require(_0x973f('0x3'));var router=express[_0x973f('0x4')]();var fs_extra=require(_0x973f('0x5'));var auth=require(_0x973f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x973f('0x7'));var controller=require(_0x973f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x973f('0x9')]);router['get'](_0x973f('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x973f('0xb')](_0x973f('0xc'),auth['isAuthenticated'](),controller[_0x973f('0xd')]);router['get']('/:id/messages',auth[_0x973f('0xe')](),controller[_0x973f('0xf')]);router[_0x973f('0xb')](_0x973f('0x10'),auth[_0x973f('0xe')](),controller[_0x973f('0x11')]);router[_0x973f('0x12')]('/',auth[_0x973f('0xe')](),controller[_0x973f('0x13')]);router['post'](_0x973f('0x14'),auth[_0x973f('0xe')](),controller[_0x973f('0x15')]);router[_0x973f('0x12')](_0x973f('0x16'),auth[_0x973f('0xe')](),interaction[_0x973f('0x17')](_0x973f('0x18'),_0x973f('0x19')),controller['addTags']);router[_0x973f('0x1a')]('/:id',auth[_0x973f('0xe')](),interaction[_0x973f('0x17')]('fax',_0x973f('0x1b')),controller[_0x973f('0x1c')]);router[_0x973f('0x1d')](_0x973f('0xc'),auth['isAuthenticated'](),interaction[_0x973f('0x17')](_0x973f('0x18'),_0x973f('0x1e')),controller[_0x973f('0x1f')]);router[_0x973f('0x1d')]('/:id/tags',auth[_0x973f('0xe')](),controller[_0x973f('0x20')]);module[_0x973f('0x21')]=router; \ No newline at end of file +var _0x8485=['../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','create','/:id/messages','post','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','update','delete','faxinteraction:destroy','destroy','exports','multer','path','express','Router'];(function(_0x5530a1,_0x4ee22c){var _0x52180d=function(_0x23e64c){while(--_0x23e64c){_0x5530a1['push'](_0x5530a1['shift']());}};_0x52180d(++_0x4ee22c);}(_0x8485,0x88));var _0x5848=function(_0x469a6f,_0x1e12bc){_0x469a6f=_0x469a6f-0x0;var _0x3a9b89=_0x8485[_0x469a6f];return _0x3a9b89;};'use strict';var multer=require(_0x5848('0x0'));var util=require('util');var path=require(_0x5848('0x1'));var timeout=require('connect-timeout');var express=require(_0x5848('0x2'));var router=express[_0x5848('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5848('0x4'));var config=require(_0x5848('0x5'));var controller=require(_0x5848('0x6'));router[_0x5848('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5848('0x7')](_0x5848('0x8'),auth[_0x5848('0x9')](),controller[_0x5848('0xa')]);router['get'](_0x5848('0xb'),auth[_0x5848('0x9')](),controller[_0x5848('0xc')]);router[_0x5848('0x7')]('/:id/messages',auth[_0x5848('0x9')](),controller['getMessages']);router[_0x5848('0x7')](_0x5848('0xd'),auth[_0x5848('0x9')](),controller[_0x5848('0xe')]);router['post']('/',auth[_0x5848('0x9')](),controller[_0x5848('0xf')]);router['post'](_0x5848('0x10'),auth[_0x5848('0x9')](),controller['addMessage']);router[_0x5848('0x11')](_0x5848('0x12'),auth['isAuthenticated'](),interaction[_0x5848('0x13')](_0x5848('0x14'),_0x5848('0x15')),controller[_0x5848('0x16')]);router['put'](_0x5848('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0x5848('0x14'),'faxinteraction:update'),controller[_0x5848('0x17')]);router[_0x5848('0x18')](_0x5848('0xb'),auth[_0x5848('0x9')](),interaction['tracked'](_0x5848('0x14'),_0x5848('0x19')),controller[_0x5848('0x1a')]);router[_0x5848('0x18')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x5848('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 ca90e80..8a8723d 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 _0x6ddd=['TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x4fb12a,_0x15bead){var _0x8cd6ec=function(_0xa310d5){while(--_0xa310d5){_0x4fb12a['push'](_0x4fb12a['shift']());}};_0x8cd6ec(++_0x15bead);}(_0x6ddd,0xae));var _0xd6dd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6ddd[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xd6dd('0x0')](_0xd6dd('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xd6dd('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd6dd('0x3')]('in','out'),'defaultValue':_0xd6dd('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xd6dd('0x5')]}}; \ No newline at end of file +var _0xb7c8=['DATE','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x255ed7,_0x363bc1){var _0x2b2d54=function(_0x2f45a8){while(--_0x2f45a8){_0x255ed7['push'](_0x255ed7['shift']());}};_0x2b2d54(++_0x363bc1);}(_0xb7c8,0x119));var _0x8b7c=function(_0xc95aac,_0x462047){_0xc95aac=_0xc95aac-0x0;var _0x22ed08=_0xb7c8[_0xc95aac];return _0x22ed08;};'use strict';var Sequelize=require('sequelize');module[_0x8b7c('0x0')]={'body':{'type':Sequelize[_0x8b7c('0x1')](_0x8b7c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8b7c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8b7c('0x4')]('in',_0x8b7c('0x5')),'defaultValue':_0x8b7c('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x8b7c('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index d8f83f9..e4dc87f 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 _0x9fac=['contact','User','fullname','email','internal','manual','interface','SIP/%s','motionChannel','event','EventManager','acceptmessage','fax','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','Sequelize','channel','rejectmessage','create','CmContact','findOne','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','attachments','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','FaxMessage','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','body','find','describe','fax-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteractionId','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT'];(function(_0x53a2c7,_0x38aeb7){var _0xfccf41=function(_0x48026f){while(--_0x48026f){_0x53a2c7['push'](_0x53a2c7['shift']());}};_0xfccf41(++_0x38aeb7);}(_0x9fac,0x1df));var _0xc9fa=function(_0xe61247,_0x12abb3){_0xe61247=_0xe61247-0x0;var _0x599e3b=_0x9fac[_0xe61247];return _0x599e3b;};'use strict';var emlformat=require(_0xc9fa('0x0'));var rimraf=require(_0xc9fa('0x1'));var zipdir=require(_0xc9fa('0x2'));var jsonpatch=require(_0xc9fa('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc9fa('0x4'));var Mustache=require(_0xc9fa('0x5'));var util=require(_0xc9fa('0x6'));var path=require(_0xc9fa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc9fa('0x8'));var fs=require('fs');var fs_extra=require(_0xc9fa('0x9'));var _=require(_0xc9fa('0xa'));var squel=require(_0xc9fa('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc9fa('0xc'));var Papa=require(_0xc9fa('0xd'));var Redis=require(_0xc9fa('0xe'));var authService=require(_0xc9fa('0xf'));var qs=require(_0xc9fa('0x10'));var as=require(_0xc9fa('0x11'));var hardwareService=require(_0xc9fa('0x12'));var logger=require(_0xc9fa('0x13'))('api');var utils=require(_0xc9fa('0x14'));var config=require(_0xc9fa('0x15'));var licenseUtil=require(_0xc9fa('0x16'));var db=require(_0xc9fa('0x17'))['db'];config['redis']=_[_0xc9fa('0x18')](config['redis'],{'host':_0xc9fa('0x19'),'port':0x18eb});var socket=require(_0xc9fa('0x1a'))(new Redis(config[_0xc9fa('0x1b')]));require(_0xc9fa('0x1c'))[_0xc9fa('0x1d')](socket);var jayson=require(_0xc9fa('0x1e'));var client=jayson[_0xc9fa('0x1f')][_0xc9fa('0x20')]({'port':0x232c});var client9002=jayson[_0xc9fa('0x1f')][_0xc9fa('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xcb82b4,_0x47e96e,_0x28112a,_0x57a6e5){return new BPromise(function(_0x36f120,_0x5d9cae){var _0x9a4a08=_0x57a6e5||client;return _0x9a4a08[_0xc9fa('0x21')](_0xcb82b4,_0x28112a)[_0xc9fa('0x22')](function(_0x1052aa){logger[_0xc9fa('0x23')](_0xc9fa('0x24'),_0x47e96e,'request\x20sent');logger[_0xc9fa('0x25')](_0xc9fa('0x26'),_0x47e96e,_0xc9fa('0x27'),JSON['stringify'](_0x1052aa));if(_0x1052aa[_0xc9fa('0x28')]){if(_0x1052aa[_0xc9fa('0x28')][_0xc9fa('0x29')]===0x1f4){logger['error'](_0xc9fa('0x24'),_0x47e96e,_0x1052aa[_0xc9fa('0x28')][_0xc9fa('0x2a')]);return _0x5d9cae(_0x1052aa[_0xc9fa('0x28')]['message']);}logger[_0xc9fa('0x28')](_0xc9fa('0x24'),_0x47e96e,_0x1052aa[_0xc9fa('0x28')][_0xc9fa('0x2a')]);return _0x36f120(_0x1052aa[_0xc9fa('0x28')][_0xc9fa('0x2a')]);}else{logger[_0xc9fa('0x23')]('FaxMessage,\x20%s,\x20%s',_0x47e96e,'request\x20sent');_0x36f120(_0x1052aa['result'][_0xc9fa('0x2a')]);}})[_0xc9fa('0x2b')](function(_0x5e8415){logger[_0xc9fa('0x28')]('FaxMessage,\x20%s,\x20%s',_0x47e96e,_0x5e8415);_0x5d9cae(_0x5e8415);});});}function respondWithStatusCode(_0x4549b1,_0x5ba4f5){_0x5ba4f5=_0x5ba4f5||0xcc;return function(_0xd430d){if(_0xd430d){return _0x4549b1[_0xc9fa('0x2c')](_0x5ba4f5);}return _0x4549b1[_0xc9fa('0x2d')](_0x5ba4f5)[_0xc9fa('0x2e')]();};}function respondWithResult(_0x1f13b4,_0x14d631){_0x14d631=_0x14d631||0xc8;return function(_0x577a08){if(_0x577a08){return _0x1f13b4[_0xc9fa('0x2d')](_0x14d631)[_0xc9fa('0x2f')](_0x577a08);}};}function respondWithFilteredResult(_0x199f74,_0x6cfe0b){return function(_0x208ae3){if(_0x208ae3){var _0x9a13af=typeof _0x6cfe0b['offset']==='undefined'&&typeof _0x6cfe0b[_0xc9fa('0x30')]===_0xc9fa('0x31');var _0x57b7f1=_0x208ae3[_0xc9fa('0x32')];var _0x2b8c15=_0x9a13af?0x0:_0x6cfe0b['offset'];var _0x3814d2=_0x9a13af?_0x208ae3[_0xc9fa('0x32')]:_0x6cfe0b[_0xc9fa('0x33')]+_0x6cfe0b[_0xc9fa('0x30')];var _0x3d5290;if(_0x3814d2>=_0x57b7f1){_0x3814d2=_0x57b7f1;_0x3d5290=0xc8;}else{_0x3d5290=0xce;}_0x199f74['status'](_0x3d5290);return _0x199f74[_0xc9fa('0x34')](_0xc9fa('0x35'),_0x2b8c15+'-'+_0x3814d2+'/'+_0x57b7f1)[_0xc9fa('0x2f')](_0x208ae3);}return null;};}function patchUpdates(_0x2d95db){return function(_0x216c58){try{jsonpatch[_0xc9fa('0x36')](_0x216c58,_0x2d95db,!![]);}catch(_0x385aa1){return BPromise[_0xc9fa('0x37')](_0x385aa1);}return _0x216c58[_0xc9fa('0x38')]();};}function saveUpdates(_0x220a7e,_0x482953){return function(_0x135997){if(_0x135997){return _0x135997[_0xc9fa('0x39')](_0x220a7e)[_0xc9fa('0x22')](function(_0x3cc89b){return _0x3cc89b;});}return null;};}function removeEntity(_0x4183b7,_0x149b7d){return function(_0x1ce047){if(_0x1ce047){return _0x1ce047[_0xc9fa('0x3a')]()[_0xc9fa('0x22')](function(){_0x4183b7[_0xc9fa('0x2d')](0xcc)[_0xc9fa('0x2e')]();});}};}function handleEntityNotFound(_0x4bb856,_0x1e0981){return function(_0x4c94b2){if(!_0x4c94b2){_0x4bb856[_0xc9fa('0x2c')](0x194);}return _0x4c94b2;};}function handleError(_0x5ebbd2,_0x4d1c2c){_0x4d1c2c=_0x4d1c2c||0x1f4;return function(_0x186b80){logger[_0xc9fa('0x28')](_0x186b80[_0xc9fa('0x3b')]);if(_0x186b80[_0xc9fa('0x3c')]){delete _0x186b80['name'];}_0x5ebbd2['status'](_0x4d1c2c)[_0xc9fa('0x3d')](_0x186b80);};}exports[_0xc9fa('0x3e')]=function(_0x5f27b5,_0x5c32d1){var _0x17a038={},_0x3d3874={},_0x3edfed={'count':0x0,'rows':[]};var _0x212dba=_['map'](db[_0xc9fa('0x3f')][_0xc9fa('0x40')],function(_0x35890e){return{'name':_0x35890e[_0xc9fa('0x41')],'type':_0x35890e[_0xc9fa('0x42')]['key']};});_0x3d3874[_0xc9fa('0x43')]=_[_0xc9fa('0x44')](_0x212dba,'name');_0x3d3874['query']=_['keys'](_0x5f27b5[_0xc9fa('0x45')]);_0x3d3874[_0xc9fa('0x46')]=_[_0xc9fa('0x47')](_0x3d3874[_0xc9fa('0x43')],_0x3d3874['query']);_0x17a038[_0xc9fa('0x48')]=_[_0xc9fa('0x47')](_0x3d3874[_0xc9fa('0x43')],qs[_0xc9fa('0x49')](_0x5f27b5[_0xc9fa('0x45')][_0xc9fa('0x49')]));_0x17a038[_0xc9fa('0x48')]=_0x17a038[_0xc9fa('0x48')][_0xc9fa('0x4a')]?_0x17a038[_0xc9fa('0x48')]:_0x3d3874['model'];if(!_0x5f27b5['query'][_0xc9fa('0x4b')]('nolimit')){_0x17a038[_0xc9fa('0x30')]=qs['limit'](_0x5f27b5['query']['limit']);_0x17a038[_0xc9fa('0x33')]=qs['offset'](_0x5f27b5['query']['offset']);}_0x17a038[_0xc9fa('0x4c')]=qs[_0xc9fa('0x4d')](_0x5f27b5[_0xc9fa('0x45')][_0xc9fa('0x4d')]);_0x17a038['where']=qs['filters'](_['pick'](_0x5f27b5['query'],_0x3d3874[_0xc9fa('0x46')]),_0x212dba);if(_0x5f27b5['query'][_0xc9fa('0x4e')]){_0x17a038[_0xc9fa('0x4f')]=_[_0xc9fa('0x50')](_0x17a038[_0xc9fa('0x4f')],{'$or':_[_0xc9fa('0x44')](_0x212dba,function(_0x50407b){if(_0x50407b['type']!==_0xc9fa('0x51')){var _0x1addfb={};_0x1addfb[_0x50407b[_0xc9fa('0x3c')]]={'$like':'%'+_0x5f27b5[_0xc9fa('0x45')][_0xc9fa('0x4e')]+'%'};return _0x1addfb;}})});}_0x17a038=_[_0xc9fa('0x50')]({},_0x17a038,_0x5f27b5[_0xc9fa('0x52')]);var _0x1b983c={'where':_0x17a038['where']};return db['FaxMessage'][_0xc9fa('0x32')](_0x1b983c)[_0xc9fa('0x22')](function(_0x38d40d){_0x3edfed['count']=_0x38d40d;if(_0x5f27b5[_0xc9fa('0x45')][_0xc9fa('0x53')]){_0x17a038[_0xc9fa('0x54')]=[{'all':!![]}];}return db[_0xc9fa('0x3f')][_0xc9fa('0x55')](_0x17a038);})[_0xc9fa('0x22')](function(_0x77e210){_0x3edfed[_0xc9fa('0x56')]=_0x77e210;return _0x3edfed;})[_0xc9fa('0x22')](respondWithFilteredResult(_0x5c32d1,_0x17a038))[_0xc9fa('0x2b')](handleError(_0x5c32d1,null));};exports['show']=function(_0x1e183f,_0xa9acc0){var _0x3bac95={'raw':!![],'where':{'id':_0x1e183f[_0xc9fa('0x57')]['id']}},_0x2d38a6={};_0x2d38a6[_0xc9fa('0x43')]=_[_0xc9fa('0x58')](db['FaxMessage'][_0xc9fa('0x40')]);_0x2d38a6[_0xc9fa('0x45')]=_['keys'](_0x1e183f['query']);_0x2d38a6[_0xc9fa('0x46')]=_['intersection'](_0x2d38a6[_0xc9fa('0x43')],_0x2d38a6['query']);_0x3bac95[_0xc9fa('0x48')]=_[_0xc9fa('0x47')](_0x2d38a6['model'],qs[_0xc9fa('0x49')](_0x1e183f['query'][_0xc9fa('0x49')]));_0x3bac95[_0xc9fa('0x48')]=_0x3bac95['attributes'][_0xc9fa('0x4a')]?_0x3bac95[_0xc9fa('0x48')]:_0x2d38a6[_0xc9fa('0x43')];if(_0x1e183f[_0xc9fa('0x45')]['includeAll']){_0x3bac95[_0xc9fa('0x54')]=[{'all':!![]}];}_0x3bac95=_[_0xc9fa('0x50')]({},_0x3bac95,_0x1e183f[_0xc9fa('0x52')]);return db[_0xc9fa('0x3f')]['find'](_0x3bac95)[_0xc9fa('0x22')](handleEntityNotFound(_0xa9acc0,null))[_0xc9fa('0x22')](respondWithResult(_0xa9acc0,null))[_0xc9fa('0x2b')](handleError(_0xa9acc0,null));};exports[_0xc9fa('0x39')]=function(_0x3182c5,_0xc2d5){if(_0x3182c5[_0xc9fa('0x59')]['id']){delete _0x3182c5[_0xc9fa('0x59')]['id'];}return db['FaxMessage'][_0xc9fa('0x5a')]({'where':{'id':_0x3182c5[_0xc9fa('0x57')]['id']}})['then'](handleEntityNotFound(_0xc2d5,null))[_0xc9fa('0x22')](saveUpdates(_0x3182c5[_0xc9fa('0x59')],null))[_0xc9fa('0x22')](respondWithResult(_0xc2d5,null))[_0xc9fa('0x2b')](handleError(_0xc2d5,null));};exports[_0xc9fa('0x3a')]=function(_0x553857,_0x3e395b){return db['FaxMessage'][_0xc9fa('0x5a')]({'where':{'id':_0x553857[_0xc9fa('0x57')]['id']}})[_0xc9fa('0x22')](handleEntityNotFound(_0x3e395b,null))[_0xc9fa('0x22')](removeEntity(_0x3e395b,null))[_0xc9fa('0x2b')](handleError(_0x3e395b,null));};exports[_0xc9fa('0x5b')]=function(_0x4cc195,_0x13bed1){return db[_0xc9fa('0x3f')][_0xc9fa('0x5b')]()[_0xc9fa('0x22')](respondWithResult(_0x13bed1,null))[_0xc9fa('0x2b')](handleError(_0x13bed1,null));};var interaction_log=require(_0xc9fa('0x13'))(_0xc9fa('0x5c'));exports[_0xc9fa('0x5d')]=function(_0x478757,_0x59dd67,_0x174da0){var _0x4c9b8c={'agent':{},'channel':'fax'};if(_0x478757['body']['id']){delete _0x478757[_0xc9fa('0x59')]['id'];}_0x478757[_0xc9fa('0x59')][_0xc9fa('0x5e')]=!![];_0x478757['body'][_0xc9fa('0x5f')]=moment()[_0xc9fa('0x60')](_0xc9fa('0x61'));_0x478757[_0xc9fa('0x59')][_0xc9fa('0x62')]=_0x478757[_0xc9fa('0x59')][_0xc9fa('0x62')]||_0x478757[_0xc9fa('0x63')]['id'];_0x4c9b8c[_0xc9fa('0x64')]['id']=_0x478757[_0xc9fa('0x59')][_0xc9fa('0x62')];return db['FaxMessage'][_0xc9fa('0x5a')]({'where':{'id':_0x478757[_0xc9fa('0x57')]['id'],'UserId':null}})[_0xc9fa('0x22')](handleEntityNotFound(_0x59dd67,null))[_0xc9fa('0x22')](saveUpdates(_0x478757[_0xc9fa('0x59')],null))[_0xc9fa('0x22')](function(_0x5828bb){if(_0x5828bb){_0x4c9b8c[_0xc9fa('0x2a')]=_0x5828bb[_0xc9fa('0x65')]({'plain':!![]});return db['FaxInteraction'][_0xc9fa('0x5a')]({'where':{'id':_0x5828bb[_0xc9fa('0x66')]}});}return null;})[_0xc9fa('0x22')](handleEntityNotFound(_0x59dd67,null))['then'](function(_0x24c6a7){if(_0x24c6a7){return _0x24c6a7['update']({'UserId':_0x478757[_0xc9fa('0x59')]['UserId'],'read1stAt':_['isNil'](_0x24c6a7[_0xc9fa('0x67')])?moment()[_0xc9fa('0x60')](_0xc9fa('0x61')):undefined});}return null;})[_0xc9fa('0x22')](function(_0x6ba146){if(_0x6ba146){_0x4c9b8c[_0xc9fa('0x68')]=_0x6ba146[_0xc9fa('0x65')]({'plain':!![]});interaction_log['info'](_0xc9fa('0x69'),_0x478757[_0xc9fa('0x63')]['id'],_0x478757['user']['name'],_0x478757[_0xc9fa('0x63')][_0xc9fa('0x6a')],_0x4c9b8c['interaction']['id'],_0x478757['body']?JSON[_0xc9fa('0x6b')](_0x478757[_0xc9fa('0x59')]):_0xc9fa('0x6c'));return respondWithRpcPromise(_0xc9fa('0x6d'),'acceptMessage',_0x4c9b8c);}return null;})[_0xc9fa('0x22')](function(_0x487f61){var _0x33b59a=_0xc9fa('0x6e')+_0x487f61['message']['ContactId'];return db['sequelize'][_0xc9fa('0x45')](_0x33b59a,{'type':db['Sequelize'][_0xc9fa('0x6f')][_0xc9fa('0x70')],'raw':!![]})['then'](function(_0x1e89d3){return _0x1e89d3;});})[_0xc9fa('0x22')](function(_0x44d74b){if(_0x44d74b){_0x4c9b8c[_0xc9fa('0x2a')][_0xc9fa('0x71')]=_0x44d74b[0x0];if(!_0x478757[_0xc9fa('0x59')][_0xc9fa('0x62')])return;return db[_0xc9fa('0x72')][_0xc9fa('0x5a')]({'where':{'id':_0x478757['body']['UserId'],'role':_0xc9fa('0x64')},'attributes':['id',_0xc9fa('0x3c'),_0xc9fa('0x73'),_0xc9fa('0x74'),_0xc9fa('0x75')],'raw':!![]});}return null;})[_0xc9fa('0x22')](function(_0x1a465a){if(!_0x1a465a)return null;_0x4c9b8c[_0xc9fa('0x2a')][_0xc9fa('0x64')]=_0x1a465a;return _0x4c9b8c;})[_0xc9fa('0x22')](function(_0x4d0817){if(_0x4d0817){if(_0x478757[_0xc9fa('0x59')][_0xc9fa('0x76')]){_0x4c9b8c['message'][_0xc9fa('0x77')]=util[_0xc9fa('0x60')](_0xc9fa('0x78'),_0x478757[_0xc9fa('0x63')][_0xc9fa('0x3c')]);_0x4c9b8c[_0xc9fa('0x2a')]['channel']=_0x4c9b8c['channel'];_0x4c9b8c['message'][_0xc9fa('0x79')]=_0x4c9b8c['channel'];_0x4c9b8c[_0xc9fa('0x2a')][_0xc9fa('0x7a')]=_0xc9fa('0x5d');return respondWithRpcPromise(_0xc9fa('0x7b'),_0xc9fa('0x7b'),{'event':_0xc9fa('0x7c'),'message':_0x4c9b8c['message']},client9002)[_0xc9fa('0x22')](function(){return _0x4c9b8c;});}return _0x4c9b8c;}return null;})[_0xc9fa('0x22')](respondWithResult(_0x59dd67,null))[_0xc9fa('0x2b')](handleError(_0x59dd67,null));};var interaction_log=require('../../config/logger')(_0xc9fa('0x5c'));exports[_0xc9fa('0x37')]=function(_0x139f06,_0x3e145a,_0x492a83){var _0x26a154={'agent':{},'channel':_0xc9fa('0x7d')};if(_0x139f06['body']['id']){delete _0x139f06['body']['id'];}_0x139f06[_0xc9fa('0x59')]['UserId']=_0x139f06[_0xc9fa('0x59')][_0xc9fa('0x62')]||_0x139f06[_0xc9fa('0x63')]['id'];_0x26a154[_0xc9fa('0x64')]['id']=_0x139f06[_0xc9fa('0x59')][_0xc9fa('0x62')];return db[_0xc9fa('0x3f')][_0xc9fa('0x5a')]({'where':{'id':_0x139f06[_0xc9fa('0x57')]['id'],'UserId':null}})[_0xc9fa('0x22')](handleEntityNotFound(_0x3e145a,null))[_0xc9fa('0x22')](function(_0x44f457){if(_0x44f457){_0x26a154[_0xc9fa('0x2a')]=_0x44f457['get']({'plain':!![]});return db[_0xc9fa('0x7e')]['find']({'where':{'id':_0x44f457[_0xc9fa('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x3e145a,null))['then'](function(_0x1d6a61){if(_0x1d6a61){_0x26a154['interaction']=_0x1d6a61[_0xc9fa('0x65')]({'plain':!![]});interaction_log[_0xc9fa('0x23')](_0xc9fa('0x7f'),_0x139f06[_0xc9fa('0x63')]['id'],_0x139f06[_0xc9fa('0x63')][_0xc9fa('0x3c')],_0x139f06[_0xc9fa('0x63')]['role'],_0x26a154[_0xc9fa('0x68')]['id'],_0x139f06[_0xc9fa('0x59')]?JSON[_0xc9fa('0x6b')](_0x139f06[_0xc9fa('0x59')]):_0xc9fa('0x6c'));return respondWithRpcPromise(_0xc9fa('0x80'),'rejectMessage',_0x26a154);}return null;})[_0xc9fa('0x22')](function(_0x22f4d4){var _0x25754e=_0xc9fa('0x6e')+_0x22f4d4[_0xc9fa('0x2a')][_0xc9fa('0x81')];return db['sequelize'][_0xc9fa('0x45')](_0x25754e,{'type':db[_0xc9fa('0x82')][_0xc9fa('0x6f')]['SELECT'],'raw':!![]})[_0xc9fa('0x22')](function(_0xd719eb){return _0xd719eb;});})[_0xc9fa('0x22')](function(_0xd03d71){if(_0xd03d71){_0x26a154[_0xc9fa('0x2a')]['contact']=_0xd03d71[0x0];if(!_0x139f06[_0xc9fa('0x59')][_0xc9fa('0x62')])return;return db[_0xc9fa('0x72')][_0xc9fa('0x5a')]({'where':{'id':_0x139f06[_0xc9fa('0x59')][_0xc9fa('0x62')],'role':_0xc9fa('0x64')},'attributes':['id',_0xc9fa('0x3c'),_0xc9fa('0x73'),'email',_0xc9fa('0x75')],'raw':!![]});}return null;})[_0xc9fa('0x22')](function(_0x114eb2){if(!_0x114eb2)return null;_0x26a154[_0xc9fa('0x2a')][_0xc9fa('0x64')]=_0x114eb2;return _0x26a154;})[_0xc9fa('0x22')](function(_0x2ce537){if(_0x2ce537){_0x2ce537[_0xc9fa('0x2a')]['interface']=util[_0xc9fa('0x60')](_0xc9fa('0x78'),_0x139f06[_0xc9fa('0x63')][_0xc9fa('0x3c')]);_0x2ce537[_0xc9fa('0x2a')][_0xc9fa('0x83')]=_0x26a154['channel'];_0x2ce537[_0xc9fa('0x2a')][_0xc9fa('0x79')]=_0x26a154[_0xc9fa('0x83')];_0x2ce537['message'][_0xc9fa('0x7a')]='reject';respondWithRpcPromise('EventManager',_0xc9fa('0x7b'),{'event':_0xc9fa('0x84'),'message':_0x2ce537[_0xc9fa('0x2a')]},client9002);return _0x26a154;}return null;})['then'](respondWithResult(_0x3e145a,null))['catch'](handleError(_0x3e145a,null));};exports[_0xc9fa('0x85')]=function(_0x4afad9,_0x4fd033){var _0x2a4bec;return db[_0xc9fa('0x3f')][_0xc9fa('0x85')](_0x4afad9[_0xc9fa('0x59')],{})[_0xc9fa('0x22')](function(_0x12d7b5){_0x2a4bec=_0x12d7b5;return db[_0xc9fa('0x86')][_0xc9fa('0x87')]({'where':{'id':_0x2a4bec[_0xc9fa('0x81')]}});})['then'](function(_0x103dcd){if(_[_0xc9fa('0x88')](_0x103dcd)){return;}else{_0x2a4bec['fax']=_0x103dcd[_0xc9fa('0x7d')];return db[_0xc9fa('0x89')][_0xc9fa('0x87')]({'where':{'id':_0x2a4bec[_0xc9fa('0x8a')]}});}})[_0xc9fa('0x22')](function(_0x294363){return respondWithRpcPromise(_0xc9fa('0x8b'),_0xc9fa('0x8b'),{'FaxAccountId':_[_0xc9fa('0x88')](_0x4afad9[_0xc9fa('0x59')])?undefined:_0x4afad9[_0xc9fa('0x59')][_0xc9fa('0x8c')],'path':_[_0xc9fa('0x88')](_0x294363)?undefined:util[_0xc9fa('0x60')](_0xc9fa('0x8d'),_0x294363[_0xc9fa('0x8e')]),'fax':_[_0xc9fa('0x88')](_0x2a4bec[_0xc9fa('0x7d')])?undefined:_0x2a4bec['fax'],'AttachmentId':_0x2a4bec[_0xc9fa('0x8a')]},client9002);})[_0xc9fa('0x22')](respondWithResult(_0x4fd033,0xc9))[_0xc9fa('0x2b')](handleError(_0x4fd033,null));};exports[_0xc9fa('0x8f')]=function(_0x76c752,_0x315fe6){var _0x56583d=path[_0xc9fa('0x90')](config[_0xc9fa('0x91')],_0xc9fa('0x92'),'files',_0xc9fa('0x93'));return db['FaxMessage']['find']({'where':{'id':_0x76c752[_0xc9fa('0x57')]['id']},'include':[{'model':db[_0xc9fa('0x89')],'as':_0xc9fa('0x89')}]})[_0xc9fa('0x22')](handleEntityNotFound(_0x315fe6,null))[_0xc9fa('0x22')](function(_0x2b83c5){if(_0x2b83c5){return _0x315fe6[_0xc9fa('0x8f')](path[_0xc9fa('0x90')](_0x56583d,_0x2b83c5['Attachment'][_0xc9fa('0x8e')]));}})[_0xc9fa('0x2b')](handleError(_0x315fe6,null));}; \ No newline at end of file +var _0x786c=['read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE: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','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','channel','motionChannel','event','acceptmessage','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','sequelize','fullname','SIP/%s','EventManager','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','basename','download','join','root','server','attachments','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','update','then','end','name','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','FaxMessage','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','body','destroy','describe','accept','fax','readAt','format','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil'];(function(_0x253141,_0x3a1973){var _0x23971f=function(_0x2c08a7){while(--_0x2c08a7){_0x253141['push'](_0x253141['shift']());}};_0x23971f(++_0x3a1973);}(_0x786c,0x1ea));var _0xc786=function(_0x599f0f,_0x22c044){_0x599f0f=_0x599f0f-0x0;var _0x3b04b2=_0x786c[_0x599f0f];return _0x3b04b2;};'use strict';var emlformat=require(_0xc786('0x0'));var rimraf=require(_0xc786('0x1'));var zipdir=require(_0xc786('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc786('0x3'));var BPromise=require(_0xc786('0x4'));var Mustache=require(_0xc786('0x5'));var util=require('util');var path=require(_0xc786('0x6'));var sox=require(_0xc786('0x7'));var csv=require(_0xc786('0x8'));var ejs=require(_0xc786('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc786('0xa'));var squel=require('squel');var crypto=require(_0xc786('0xb'));var jsforce=require(_0xc786('0xc'));var deskjs=require(_0xc786('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc786('0xe'));var Papa=require(_0xc786('0xf'));var Redis=require('ioredis');var authService=require(_0xc786('0x10'));var qs=require(_0xc786('0x11'));var as=require(_0xc786('0x12'));var hardwareService=require(_0xc786('0x13'));var logger=require(_0xc786('0x14'))(_0xc786('0x15'));var utils=require('../../config/utils');var config=require(_0xc786('0x16'));var licenseUtil=require(_0xc786('0x17'));var db=require(_0xc786('0x18'))['db'];config['redis']=_[_0xc786('0x19')](config[_0xc786('0x1a')],{'host':_0xc786('0x1b'),'port':0x18eb});var socket=require(_0xc786('0x1c'))(new Redis(config[_0xc786('0x1a')]));require(_0xc786('0x1d'))[_0xc786('0x1e')](socket);var jayson=require(_0xc786('0x1f'));var client=jayson[_0xc786('0x20')][_0xc786('0x21')]({'port':0x232c});var client9002=jayson['client'][_0xc786('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x36caa8,_0x34e684,_0x30bfb7,_0x572065){return new BPromise(function(_0x256e1c,_0x43c3a5){var _0x298223=_0x572065||client;return _0x298223[_0xc786('0x22')](_0x36caa8,_0x30bfb7)['then'](function(_0x3a680d){logger[_0xc786('0x23')](_0xc786('0x24'),_0x34e684,_0xc786('0x25'));logger[_0xc786('0x26')](_0xc786('0x27'),_0x34e684,_0xc786('0x25'),JSON['stringify'](_0x3a680d));if(_0x3a680d['error']){if(_0x3a680d['error']['code']===0x1f4){logger[_0xc786('0x28')](_0xc786('0x24'),_0x34e684,_0x3a680d[_0xc786('0x28')][_0xc786('0x29')]);return _0x43c3a5(_0x3a680d[_0xc786('0x28')]['message']);}logger[_0xc786('0x28')]('FaxMessage,\x20%s,\x20%s',_0x34e684,_0x3a680d[_0xc786('0x28')]['message']);return _0x256e1c(_0x3a680d[_0xc786('0x28')][_0xc786('0x29')]);}else{logger[_0xc786('0x23')](_0xc786('0x24'),_0x34e684,_0xc786('0x25'));_0x256e1c(_0x3a680d[_0xc786('0x2a')][_0xc786('0x29')]);}})[_0xc786('0x2b')](function(_0x34f5a7){logger['error'](_0xc786('0x24'),_0x34e684,_0x34f5a7);_0x43c3a5(_0x34f5a7);});});}function respondWithStatusCode(_0x460686,_0x11d1a3){_0x11d1a3=_0x11d1a3||0xcc;return function(_0x39f29e){if(_0x39f29e){return _0x460686[_0xc786('0x2c')](_0x11d1a3);}return _0x460686[_0xc786('0x2d')](_0x11d1a3)['end']();};}function respondWithResult(_0x1d7313,_0x18ea6d){_0x18ea6d=_0x18ea6d||0xc8;return function(_0x13030e){if(_0x13030e){return _0x1d7313[_0xc786('0x2d')](_0x18ea6d)[_0xc786('0x2e')](_0x13030e);}};}function respondWithFilteredResult(_0x5750c1,_0x408265){return function(_0x4b3d99){if(_0x4b3d99){var _0x307186=typeof _0x408265[_0xc786('0x2f')]===_0xc786('0x30')&&typeof _0x408265[_0xc786('0x31')]===_0xc786('0x30');var _0x3040e8=_0x4b3d99['count'];var _0x1b4b57=_0x307186?0x0:_0x408265['offset'];var _0x110802=_0x307186?_0x4b3d99['count']:_0x408265['offset']+_0x408265[_0xc786('0x31')];var _0xfbfe86;if(_0x110802>=_0x3040e8){_0x110802=_0x3040e8;_0xfbfe86=0xc8;}else{_0xfbfe86=0xce;}_0x5750c1['status'](_0xfbfe86);return _0x5750c1['set'](_0xc786('0x32'),_0x1b4b57+'-'+_0x110802+'/'+_0x3040e8)['json'](_0x4b3d99);}return null;};}function patchUpdates(_0xd48f80){return function(_0x5b1f92){try{jsonpatch[_0xc786('0x33')](_0x5b1f92,_0xd48f80,!![]);}catch(_0x4b5d35){return BPromise[_0xc786('0x34')](_0x4b5d35);}return _0x5b1f92['save']();};}function saveUpdates(_0x2d5f2f,_0x324007){return function(_0x18b472){if(_0x18b472){return _0x18b472[_0xc786('0x35')](_0x2d5f2f)[_0xc786('0x36')](function(_0x5e8795){return _0x5e8795;});}return null;};}function removeEntity(_0x26bbac,_0x14d197){return function(_0x45c562){if(_0x45c562){return _0x45c562['destroy']()[_0xc786('0x36')](function(){_0x26bbac[_0xc786('0x2d')](0xcc)[_0xc786('0x37')]();});}};}function handleEntityNotFound(_0x4043a3,_0x21dd55){return function(_0x2ef259){if(!_0x2ef259){_0x4043a3[_0xc786('0x2c')](0x194);}return _0x2ef259;};}function handleError(_0x244fea,_0x521781){_0x521781=_0x521781||0x1f4;return function(_0x45fc32){logger[_0xc786('0x28')](_0x45fc32['stack']);if(_0x45fc32[_0xc786('0x38')]){delete _0x45fc32[_0xc786('0x38')];}_0x244fea[_0xc786('0x2d')](_0x521781)['send'](_0x45fc32);};}exports['index']=function(_0x45497b,_0x52a0b4){var _0x12967e={},_0x42d055={},_0x23cae6={'count':0x0,'rows':[]};var _0x5ceeb9=_[_0xc786('0x39')](db['FaxMessage']['rawAttributes'],function(_0x51c0bb){return{'name':_0x51c0bb[_0xc786('0x3a')],'type':_0x51c0bb[_0xc786('0x3b')][_0xc786('0x3c')]};});_0x42d055[_0xc786('0x3d')]=_[_0xc786('0x39')](_0x5ceeb9,_0xc786('0x38'));_0x42d055['query']=_[_0xc786('0x3e')](_0x45497b[_0xc786('0x3f')]);_0x42d055[_0xc786('0x40')]=_[_0xc786('0x41')](_0x42d055[_0xc786('0x3d')],_0x42d055[_0xc786('0x3f')]);_0x12967e[_0xc786('0x42')]=_[_0xc786('0x41')](_0x42d055[_0xc786('0x3d')],qs[_0xc786('0x43')](_0x45497b['query'][_0xc786('0x43')]));_0x12967e[_0xc786('0x42')]=_0x12967e['attributes'][_0xc786('0x44')]?_0x12967e[_0xc786('0x42')]:_0x42d055[_0xc786('0x3d')];if(!_0x45497b[_0xc786('0x3f')][_0xc786('0x45')](_0xc786('0x46'))){_0x12967e['limit']=qs['limit'](_0x45497b['query'][_0xc786('0x31')]);_0x12967e[_0xc786('0x2f')]=qs[_0xc786('0x2f')](_0x45497b[_0xc786('0x3f')][_0xc786('0x2f')]);}_0x12967e[_0xc786('0x47')]=qs['sort'](_0x45497b[_0xc786('0x3f')][_0xc786('0x48')]);_0x12967e[_0xc786('0x49')]=qs[_0xc786('0x40')](_['pick'](_0x45497b['query'],_0x42d055['filters']),_0x5ceeb9);if(_0x45497b['query'][_0xc786('0x4a')]){_0x12967e[_0xc786('0x49')]=_[_0xc786('0x4b')](_0x12967e[_0xc786('0x49')],{'$or':_[_0xc786('0x39')](_0x5ceeb9,function(_0x24f9c6){if(_0x24f9c6[_0xc786('0x3b')]!==_0xc786('0x4c')){var _0x1c62df={};_0x1c62df[_0x24f9c6['name']]={'$like':'%'+_0x45497b[_0xc786('0x3f')]['filter']+'%'};return _0x1c62df;}})});}_0x12967e=_[_0xc786('0x4b')]({},_0x12967e,_0x45497b[_0xc786('0x4d')]);var _0x365c63={'where':_0x12967e[_0xc786('0x49')]};return db[_0xc786('0x4e')][_0xc786('0x4f')](_0x365c63)[_0xc786('0x36')](function(_0x3dec2a){_0x23cae6[_0xc786('0x4f')]=_0x3dec2a;if(_0x45497b['query'][_0xc786('0x50')]){_0x12967e[_0xc786('0x51')]=[{'all':!![]}];}return db[_0xc786('0x4e')][_0xc786('0x52')](_0x12967e);})[_0xc786('0x36')](function(_0x54c6ef){_0x23cae6[_0xc786('0x53')]=_0x54c6ef;return _0x23cae6;})[_0xc786('0x36')](respondWithFilteredResult(_0x52a0b4,_0x12967e))['catch'](handleError(_0x52a0b4,null));};exports[_0xc786('0x54')]=function(_0x1431e2,_0x1ab571){var _0x50fa52={'raw':!![],'where':{'id':_0x1431e2[_0xc786('0x55')]['id']}},_0x1aafca={};_0x1aafca[_0xc786('0x3d')]=_[_0xc786('0x3e')](db[_0xc786('0x4e')][_0xc786('0x56')]);_0x1aafca[_0xc786('0x3f')]=_[_0xc786('0x3e')](_0x1431e2[_0xc786('0x3f')]);_0x1aafca[_0xc786('0x40')]=_[_0xc786('0x41')](_0x1aafca[_0xc786('0x3d')],_0x1aafca[_0xc786('0x3f')]);_0x50fa52[_0xc786('0x42')]=_['intersection'](_0x1aafca[_0xc786('0x3d')],qs[_0xc786('0x43')](_0x1431e2['query'][_0xc786('0x43')]));_0x50fa52[_0xc786('0x42')]=_0x50fa52[_0xc786('0x42')][_0xc786('0x44')]?_0x50fa52[_0xc786('0x42')]:_0x1aafca[_0xc786('0x3d')];if(_0x1431e2[_0xc786('0x3f')]['includeAll']){_0x50fa52[_0xc786('0x51')]=[{'all':!![]}];}_0x50fa52=_['merge']({},_0x50fa52,_0x1431e2[_0xc786('0x4d')]);return db['FaxMessage'][_0xc786('0x57')](_0x50fa52)[_0xc786('0x36')](handleEntityNotFound(_0x1ab571,null))[_0xc786('0x36')](respondWithResult(_0x1ab571,null))[_0xc786('0x2b')](handleError(_0x1ab571,null));};exports[_0xc786('0x35')]=function(_0x1cc752,_0x77e045){if(_0x1cc752['body']['id']){delete _0x1cc752['body']['id'];}return db[_0xc786('0x4e')][_0xc786('0x57')]({'where':{'id':_0x1cc752[_0xc786('0x55')]['id']}})[_0xc786('0x36')](handleEntityNotFound(_0x77e045,null))[_0xc786('0x36')](saveUpdates(_0x1cc752[_0xc786('0x58')],null))['then'](respondWithResult(_0x77e045,null))[_0xc786('0x2b')](handleError(_0x77e045,null));};exports[_0xc786('0x59')]=function(_0xc72453,_0x4cba9b){return db[_0xc786('0x4e')][_0xc786('0x57')]({'where':{'id':_0xc72453[_0xc786('0x55')]['id']}})[_0xc786('0x36')](handleEntityNotFound(_0x4cba9b,null))['then'](removeEntity(_0x4cba9b,null))[_0xc786('0x2b')](handleError(_0x4cba9b,null));};exports[_0xc786('0x5a')]=function(_0xec6da4,_0x27b2d4){return db[_0xc786('0x4e')][_0xc786('0x5a')]()[_0xc786('0x36')](respondWithResult(_0x27b2d4,null))[_0xc786('0x2b')](handleError(_0x27b2d4,null));};var interaction_log=require(_0xc786('0x14'))('fax-interactions');exports[_0xc786('0x5b')]=function(_0x319a54,_0x2ed759,_0x413bfa){var _0x8f7370={'agent':{},'channel':_0xc786('0x5c')};if(_0x319a54[_0xc786('0x58')]['id']){delete _0x319a54[_0xc786('0x58')]['id'];}_0x319a54[_0xc786('0x58')]['read']=!![];_0x319a54['body'][_0xc786('0x5d')]=moment()[_0xc786('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x319a54[_0xc786('0x58')][_0xc786('0x5f')]=_0x319a54[_0xc786('0x58')][_0xc786('0x5f')]||_0x319a54[_0xc786('0x60')]['id'];_0x8f7370[_0xc786('0x61')]['id']=_0x319a54['body']['UserId'];return db[_0xc786('0x4e')][_0xc786('0x57')]({'where':{'id':_0x319a54[_0xc786('0x55')]['id'],'UserId':null}})[_0xc786('0x36')](handleEntityNotFound(_0x2ed759,null))[_0xc786('0x36')](saveUpdates(_0x319a54[_0xc786('0x58')],null))[_0xc786('0x36')](function(_0x5943ce){if(_0x5943ce){_0x8f7370[_0xc786('0x29')]=_0x5943ce[_0xc786('0x62')]({'plain':!![]});return db[_0xc786('0x63')][_0xc786('0x57')]({'where':{'id':_0x5943ce[_0xc786('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x2ed759,null))['then'](function(_0x57984c){if(_0x57984c){return _0x57984c[_0xc786('0x35')]({'UserId':_0x319a54[_0xc786('0x58')][_0xc786('0x5f')],'read1stAt':_[_0xc786('0x65')](_0x57984c[_0xc786('0x66')])?moment()[_0xc786('0x5e')](_0xc786('0x67')):undefined});}return null;})[_0xc786('0x36')](function(_0x2dbe0){if(_0x2dbe0){_0x8f7370[_0xc786('0x68')]=_0x2dbe0[_0xc786('0x62')]({'plain':!![]});interaction_log['info'](_0xc786('0x69'),_0x319a54[_0xc786('0x60')]['id'],_0x319a54[_0xc786('0x60')][_0xc786('0x38')],_0x319a54[_0xc786('0x60')][_0xc786('0x6a')],_0x8f7370[_0xc786('0x68')]['id'],_0x319a54[_0xc786('0x58')]?JSON[_0xc786('0x6b')](_0x319a54['body']):_0xc786('0x6c'));return respondWithRpcPromise(_0xc786('0x6d'),_0xc786('0x6e'),_0x8f7370);}return null;})[_0xc786('0x36')](function(_0x406215){var _0x35b77f=_0xc786('0x6f')+_0x406215[_0xc786('0x29')]['ContactId'];return db['sequelize']['query'](_0x35b77f,{'type':db[_0xc786('0x70')][_0xc786('0x71')][_0xc786('0x72')],'raw':!![]})[_0xc786('0x36')](function(_0x115c29){return _0x115c29;});})[_0xc786('0x36')](function(_0x55caf1){if(_0x55caf1){_0x8f7370[_0xc786('0x29')][_0xc786('0x73')]=_0x55caf1[0x0];if(!_0x319a54[_0xc786('0x58')][_0xc786('0x5f')])return;return db[_0xc786('0x74')][_0xc786('0x57')]({'where':{'id':_0x319a54[_0xc786('0x58')][_0xc786('0x5f')],'role':_0xc786('0x61')},'attributes':['id',_0xc786('0x38'),'fullname',_0xc786('0x75'),_0xc786('0x76')],'raw':!![]});}return null;})[_0xc786('0x36')](function(_0x5e5a61){if(!_0x5e5a61)return null;_0x8f7370[_0xc786('0x29')][_0xc786('0x61')]=_0x5e5a61;return _0x8f7370;})['then'](function(_0x4be497){if(_0x4be497){if(_0x319a54[_0xc786('0x58')][_0xc786('0x77')]){_0x8f7370[_0xc786('0x29')][_0xc786('0x78')]=util[_0xc786('0x5e')]('SIP/%s',_0x319a54['user']['name']);_0x8f7370[_0xc786('0x29')][_0xc786('0x79')]=_0x8f7370[_0xc786('0x79')];_0x8f7370[_0xc786('0x29')][_0xc786('0x7a')]=_0x8f7370['channel'];_0x8f7370['message'][_0xc786('0x7b')]=_0xc786('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xc786('0x7c'),'message':_0x8f7370[_0xc786('0x29')]},client9002)[_0xc786('0x36')](function(){return _0x8f7370;});}return _0x8f7370;}return null;})[_0xc786('0x36')](respondWithResult(_0x2ed759,null))['catch'](handleError(_0x2ed759,null));};var interaction_log=require(_0xc786('0x14'))(_0xc786('0x7d'));exports[_0xc786('0x34')]=function(_0x185104,_0x26ba51,_0xe5c5e2){var _0x29af7b={'agent':{},'channel':_0xc786('0x5c')};if(_0x185104['body']['id']){delete _0x185104[_0xc786('0x58')]['id'];}_0x185104['body'][_0xc786('0x5f')]=_0x185104['body'][_0xc786('0x5f')]||_0x185104[_0xc786('0x60')]['id'];_0x29af7b['agent']['id']=_0x185104[_0xc786('0x58')][_0xc786('0x5f')];return db[_0xc786('0x4e')][_0xc786('0x57')]({'where':{'id':_0x185104[_0xc786('0x55')]['id'],'UserId':null}})[_0xc786('0x36')](handleEntityNotFound(_0x26ba51,null))[_0xc786('0x36')](function(_0x3c6e4c){if(_0x3c6e4c){_0x29af7b[_0xc786('0x29')]=_0x3c6e4c[_0xc786('0x62')]({'plain':!![]});return db['FaxInteraction'][_0xc786('0x57')]({'where':{'id':_0x3c6e4c[_0xc786('0x64')]}});}return null;})[_0xc786('0x36')](handleEntityNotFound(_0x26ba51,null))['then'](function(_0x5dbb09){if(_0x5dbb09){_0x29af7b['interaction']=_0x5dbb09[_0xc786('0x62')]({'plain':!![]});interaction_log[_0xc786('0x23')](_0xc786('0x7e'),_0x185104[_0xc786('0x60')]['id'],_0x185104['user'][_0xc786('0x38')],_0x185104[_0xc786('0x60')][_0xc786('0x6a')],_0x29af7b[_0xc786('0x68')]['id'],_0x185104['body']?JSON[_0xc786('0x6b')](_0x185104[_0xc786('0x58')]):_0xc786('0x6c'));return respondWithRpcPromise(_0xc786('0x7f'),_0xc786('0x80'),_0x29af7b);}return null;})[_0xc786('0x36')](function(_0x5c622c){var _0x4469d0=_0xc786('0x6f')+_0x5c622c[_0xc786('0x29')][_0xc786('0x81')];return db[_0xc786('0x82')][_0xc786('0x3f')](_0x4469d0,{'type':db[_0xc786('0x70')]['QueryTypes'][_0xc786('0x72')],'raw':!![]})[_0xc786('0x36')](function(_0x55d808){return _0x55d808;});})[_0xc786('0x36')](function(_0xd2787c){if(_0xd2787c){_0x29af7b['message'][_0xc786('0x73')]=_0xd2787c[0x0];if(!_0x185104[_0xc786('0x58')]['UserId'])return;return db[_0xc786('0x74')]['find']({'where':{'id':_0x185104['body'][_0xc786('0x5f')],'role':_0xc786('0x61')},'attributes':['id',_0xc786('0x38'),_0xc786('0x83'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0xca0120){if(!_0xca0120)return null;_0x29af7b[_0xc786('0x29')][_0xc786('0x61')]=_0xca0120;return _0x29af7b;})[_0xc786('0x36')](function(_0xad7bfb){if(_0xad7bfb){_0xad7bfb[_0xc786('0x29')][_0xc786('0x78')]=util[_0xc786('0x5e')](_0xc786('0x84'),_0x185104[_0xc786('0x60')][_0xc786('0x38')]);_0xad7bfb[_0xc786('0x29')][_0xc786('0x79')]=_0x29af7b[_0xc786('0x79')];_0xad7bfb[_0xc786('0x29')][_0xc786('0x7a')]=_0x29af7b[_0xc786('0x79')];_0xad7bfb[_0xc786('0x29')][_0xc786('0x7b')]=_0xc786('0x34');respondWithRpcPromise('EventManager',_0xc786('0x85'),{'event':_0xc786('0x86'),'message':_0xad7bfb[_0xc786('0x29')]},client9002);return _0x29af7b;}return null;})[_0xc786('0x36')](respondWithResult(_0x26ba51,null))[_0xc786('0x2b')](handleError(_0x26ba51,null));};exports[_0xc786('0x87')]=function(_0xd55489,_0x4d4742){var _0x358bcb;return db[_0xc786('0x4e')]['create'](_0xd55489['body'],{})[_0xc786('0x36')](function(_0x409884){_0x358bcb=_0x409884;return db[_0xc786('0x88')][_0xc786('0x89')]({'where':{'id':_0x358bcb[_0xc786('0x81')]}});})['then'](function(_0x407078){if(_[_0xc786('0x65')](_0x407078)){return;}else{_0x358bcb['fax']=_0x407078['fax'];return db[_0xc786('0x8a')]['findOne']({'where':{'id':_0x358bcb[_0xc786('0x8b')]}});}})[_0xc786('0x36')](function(_0xac5136){return respondWithRpcPromise(_0xc786('0x8c'),_0xc786('0x8c'),{'FaxAccountId':_[_0xc786('0x65')](_0xd55489[_0xc786('0x58')])?undefined:_0xd55489[_0xc786('0x58')][_0xc786('0x8d')],'path':_[_0xc786('0x65')](_0xac5136)?undefined:util[_0xc786('0x5e')]('/var/opt/motion2/server/files/attachments/%s',_0xac5136[_0xc786('0x8e')]),'fax':_['isNil'](_0x358bcb[_0xc786('0x5c')])?undefined:_0x358bcb[_0xc786('0x5c')],'AttachmentId':_0x358bcb['AttachmentId']},client9002);})[_0xc786('0x36')](respondWithResult(_0x4d4742,0xc9))['catch'](handleError(_0x4d4742,null));};exports[_0xc786('0x8f')]=function(_0x4faff4,_0x5b44fa){var _0x2f8843=path[_0xc786('0x90')](config[_0xc786('0x91')],_0xc786('0x92'),'files',_0xc786('0x93'));return db[_0xc786('0x4e')]['find']({'where':{'id':_0x4faff4[_0xc786('0x55')]['id']},'include':[{'model':db[_0xc786('0x8a')],'as':_0xc786('0x8a')}]})[_0xc786('0x36')](handleEntityNotFound(_0x5b44fa,null))[_0xc786('0x36')](function(_0x197def){if(_0x197def){return _0x5b44fa[_0xc786('0x8f')](path[_0xc786('0x90')](_0x2f8843,_0x197def[_0xc786('0x8a')][_0xc786('0x8e')]));}})[_0xc786('0x2b')](handleError(_0x5b44fa,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 6c5afee..e5a75e6 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 _0x20de=['update','remove','emit','hook','events','FaxMessage','setMaxListeners','save'];(function(_0x2227e2,_0x138e1b){var _0x2fd070=function(_0x422a91){while(--_0x422a91){_0x2227e2['push'](_0x2227e2['shift']());}};_0x2fd070(++_0x138e1b);}(_0x20de,0x134));var _0xe20d=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x20de[_0x2f45ea];return _0x485a84;};'use strict';var EventEmitter=require(_0xe20d('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xe20d('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xe20d('0x2')](0x0);var events={'afterCreate':_0xe20d('0x3'),'afterUpdate':_0xe20d('0x4'),'afterDestroy':_0xe20d('0x5')};function emitEvent(_0x39a7f3){return function(_0x31c533,_0x174186,_0x7b02d6){FaxMessageEvents[_0xe20d('0x6')](_0x39a7f3+':'+_0x31c533['id'],_0x31c533);FaxMessageEvents[_0xe20d('0x6')](_0x39a7f3,_0x31c533);_0x7b02d6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xe20d('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xdbb1=['exports','events','save','hasOwnProperty','hook'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xdbb1,0x105));var _0x1dbb=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xdbb1[_0x1694f5];return _0x5b4321;};'use strict';var EventEmitter=require(_0x1dbb('0x0'));var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1dbb('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x395788){return function(_0x483e15,_0xa1e321,_0xd53e45){FaxMessageEvents['emit'](_0x395788+':'+_0x483e15['id'],_0x483e15);FaxMessageEvents['emit'](_0x395788,_0x483e15);_0xd53e45(null);};}for(var e in events){if(events[_0x1dbb('0x2')](e)){var event=events[e];FaxMessage[_0x1dbb('0x3')](e,emitEvent(event));}}module[_0x1dbb('0x4')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 505e6b0..625fe1d 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 _0xb7e8=['get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','models'];(function(_0x364e83,_0x4bbe62){var _0x125fc7=function(_0x1a33f5){while(--_0x1a33f5){_0x364e83['push'](_0x364e83['shift']());}};_0x125fc7(++_0x4bbe62);}(_0xb7e8,0x127));var _0x8b7e=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xb7e8[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x8b7e('0x0'));var util=require(_0x8b7e('0x1'));var logger=require(_0x8b7e('0x2'))('api');var moment=require(_0x8b7e('0x3'));var BPromise=require(_0x8b7e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b7e('0x5'));var rimraf=require(_0x8b7e('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b7e('0x7'));module[_0x8b7e('0x8')]=function(_0x300775,_0x47e230){return _0x300775[_0x8b7e('0x9')](_0x8b7e('0xa'),attributes,{'tableName':_0x8b7e('0xb'),'paranoid':![],'indexes':[{'name':_0x8b7e('0xc'),'fields':[_0x8b7e('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fae28,_0x7a4cb0,_0x2fc6f3){var _0x4ee0af=_0x300775[_0x8b7e('0xe')];var _0x5b648d=_0x1fae28[_0x8b7e('0xf')]({'plain':!![]});if(_0x5b648d[_0x8b7e('0x10')][_0x8b7e('0x11')]()==='in'||_0x5b648d[_0x8b7e('0x10')]['toLowerCase']()===_0x8b7e('0x12')&&!_0x5b648d[_0x8b7e('0x13')]&&!_[_0x8b7e('0x14')](_0x5b648d[_0x8b7e('0x15')])){_0x4ee0af[_0x8b7e('0x16')][_0x8b7e('0x17')]({'where':{'id':_0x5b648d[_0x8b7e('0x18')]}})[_0x8b7e('0x19')](function(_0x2e8ded){if(_0x2e8ded){_0x2e8ded[_0x8b7e('0x1a')]({'lastMsgAt':_0x5b648d['createdAt'],'lastMsgDirection':_0x5b648d[_0x8b7e('0x10')]['toLowerCase']()});}})[_0x8b7e('0x1b')](function(_0x3ffc43){console[_0x8b7e('0x1c')](_0x3ffc43);});}_0x2fc6f3();}},'charset':_0x8b7e('0x1d'),'collate':_0x8b7e('0x1e')});}; \ No newline at end of file +var _0xe727=['fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage'];(function(_0x3f074f,_0x2ad621){var _0x3f1bdc=function(_0x6f3f0b){while(--_0x6f3f0b){_0x3f074f['push'](_0x3f074f['shift']());}};_0x3f1bdc(++_0x2ad621);}(_0xe727,0x1e1));var _0x7e72=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe727[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x7e72('0x0'));var util=require(_0x7e72('0x1'));var logger=require(_0x7e72('0x2'))(_0x7e72('0x3'));var moment=require(_0x7e72('0x4'));var BPromise=require(_0x7e72('0x5'));var rp=require(_0x7e72('0x6'));var fs=require('fs');var path=require(_0x7e72('0x7'));var rimraf=require(_0x7e72('0x8'));var config=require(_0x7e72('0x9'));var attributes=require(_0x7e72('0xa'));module[_0x7e72('0xb')]=function(_0x2053e4,_0x1ee85e){return _0x2053e4[_0x7e72('0xc')](_0x7e72('0xd'),attributes,{'tableName':_0x7e72('0xe'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x7e72('0xf')],'type':_0x7e72('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1259ba,_0xdecd43,_0x53c2ee){var _0x379cfe=_0x2053e4[_0x7e72('0x11')];var _0x415fad=_0x1259ba[_0x7e72('0x12')]({'plain':!![]});if(_0x415fad[_0x7e72('0x13')]['toLowerCase']()==='in'||_0x415fad['direction'][_0x7e72('0x14')]()===_0x7e72('0x15')&&!_0x415fad[_0x7e72('0x16')]&&!_[_0x7e72('0x17')](_0x415fad[_0x7e72('0x18')])){_0x379cfe[_0x7e72('0x19')][_0x7e72('0x1a')]({'where':{'id':_0x415fad[_0x7e72('0x1b')]}})['then'](function(_0x277d37){if(_0x277d37){_0x277d37[_0x7e72('0x1c')]({'lastMsgAt':_0x415fad[_0x7e72('0x1d')],'lastMsgDirection':_0x415fad[_0x7e72('0x13')][_0x7e72('0x14')]()});}})[_0x7e72('0x1e')](function(_0x2aaeab){console[_0x7e72('0x1f')](_0x2aaeab);});}_0x53c2ee();}},'charset':_0x7e72('0x20'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 6dbaa34..9c4d9e8 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c4e=['localhost','socket.io-emitter','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','then','debug','stringify','attributes','limit','UpdateFaxMessage','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults'];(function(_0x1557fd,_0x291f6e){var _0x41ce5d=function(_0xa91d55){while(--_0xa91d55){_0x1557fd['push'](_0x1557fd['shift']());}};_0x41ce5d(++_0x291f6e);}(_0x4c4e,0x152));var _0xe4c4=function(_0x11466b,_0x4f89de){_0x11466b=_0x11466b-0x0;var _0x3ae5b2=_0x4c4e[_0x11466b];return _0x3ae5b2;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});config[_0xe4c4('0xa')]=_[_0xe4c4('0xb')](config[_0xe4c4('0xa')],{'host':_0xe4c4('0xc'),'port':0x18eb});var socket=require(_0xe4c4('0xd'))(new Redis(config[_0xe4c4('0xa')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x31f879,_0x6f2545,_0x27ad42){return new BPromise(function(_0x1bc786,_0x333c08){return client[_0xe4c4('0xe')](_0x31f879,_0x27ad42)['then'](function(_0x303d89){logger[_0xe4c4('0xf')](_0xe4c4('0x10'),_0x6f2545,_0xe4c4('0x11'));logger['debug'](_0xe4c4('0x12'),_0x6f2545,_0xe4c4('0x11'),JSON['stringify'](_0x303d89));if(_0x303d89[_0xe4c4('0x13')]){if(_0x303d89[_0xe4c4('0x13')]['code']===0x1f4){logger[_0xe4c4('0x13')](_0xe4c4('0x10'),_0x6f2545,_0x303d89['error'][_0xe4c4('0x14')]);return _0x333c08(_0x303d89[_0xe4c4('0x13')][_0xe4c4('0x14')]);}logger[_0xe4c4('0x13')](_0xe4c4('0x10'),_0x6f2545,_0x303d89[_0xe4c4('0x13')][_0xe4c4('0x14')]);return _0x1bc786(_0x303d89[_0xe4c4('0x13')][_0xe4c4('0x14')]);}else{logger[_0xe4c4('0xf')](_0xe4c4('0x10'),_0x6f2545,_0xe4c4('0x11'));_0x1bc786(_0x303d89[_0xe4c4('0x15')][_0xe4c4('0x14')]);}})[_0xe4c4('0x16')](function(_0x5a32b5){logger[_0xe4c4('0x13')](_0xe4c4('0x10'),_0x6f2545,_0x5a32b5);_0x333c08(_0x5a32b5);});});}exports[_0xe4c4('0x17')]=function(_0x317cc8){var _0x5da165=this;return new Promise(function(_0x3d5856,_0x1cad5d){return db[_0xe4c4('0x18')][_0xe4c4('0x19')](_0x317cc8[_0xe4c4('0x1a')],{'raw':_0x317cc8[_0xe4c4('0x1b')]?_0x317cc8[_0xe4c4('0x1b')][_0xe4c4('0x1c')]===undefined?!![]:![]:!![]})[_0xe4c4('0x1d')](function(_0x1a7690){logger[_0xe4c4('0xf')](_0xe4c4('0x17'),_0x317cc8);logger[_0xe4c4('0x1e')](_0xe4c4('0x17'),_0x317cc8,JSON[_0xe4c4('0x1f')](_0x1a7690));_0x3d5856(_0x1a7690);})['catch'](function(_0x49cadc){logger[_0xe4c4('0x13')]('CreateFaxMessage',_0x49cadc[_0xe4c4('0x14')],_0x317cc8);_0x1cad5d(_0x5da165['error'](0x1f4,_0x49cadc[_0xe4c4('0x14')]));});});};exports['UpdateFaxMessage']=function(_0x34d667){var _0x583393=this;return new Promise(function(_0xba53ef,_0x4a0199){return db['FaxMessage']['update'](_0x34d667['body'],{'raw':_0x34d667[_0xe4c4('0x1b')]?_0x34d667['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34d667[_0xe4c4('0x1b')]?_0x34d667[_0xe4c4('0x1b')]['where']||null:null,'attributes':_0x34d667['options']?_0x34d667[_0xe4c4('0x1b')][_0xe4c4('0x20')]||null:null,'limit':_0x34d667['options']?_0x34d667[_0xe4c4('0x1b')][_0xe4c4('0x21')]||null:null})[_0xe4c4('0x1d')](function(_0x48060e){logger['info'](_0xe4c4('0x22'),_0x34d667);logger[_0xe4c4('0x1e')](_0xe4c4('0x22'),_0x34d667,JSON[_0xe4c4('0x1f')](_0x48060e));_0xba53ef(_0x48060e);})['catch'](function(_0x49c913){logger[_0xe4c4('0x13')](_0xe4c4('0x22'),_0x49c913['message'],_0x34d667);_0x4a0199(_0x583393[_0xe4c4('0x13')](0x1f4,_0x49c913[_0xe4c4('0x14')]));});});}; \ No newline at end of file +var _0x6f0d=['../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','body','options','raw','UpdateFaxMessage','update','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x47b7c9,_0x3848b2){var _0x435aaf=function(_0x3befc4){while(--_0x3befc4){_0x47b7c9['push'](_0x47b7c9['shift']());}};_0x435aaf(++_0x3848b2);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x14c76a,_0x94b2b4){_0x14c76a=_0x14c76a-0x0;var _0x42cef7=_0x6f0d[_0x14c76a];return _0x42cef7;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});config[_0xd6f0('0xa')]=_[_0xd6f0('0xb')](config[_0xd6f0('0xa')],{'host':_0xd6f0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd6f0('0xd'))[_0xd6f0('0xe')](socket);function respondWithRpcPromise(_0x2854cd,_0x382a2e,_0x225dcf){return new BPromise(function(_0x4db64a,_0x136eee){return client[_0xd6f0('0xf')](_0x2854cd,_0x225dcf)[_0xd6f0('0x10')](function(_0x44bba6){logger['info'](_0xd6f0('0x11'),_0x382a2e,_0xd6f0('0x12'));logger[_0xd6f0('0x13')](_0xd6f0('0x14'),_0x382a2e,_0xd6f0('0x12'),JSON[_0xd6f0('0x15')](_0x44bba6));if(_0x44bba6[_0xd6f0('0x16')]){if(_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x17')]===0x1f4){logger['error'](_0xd6f0('0x11'),_0x382a2e,_0x44bba6[_0xd6f0('0x16')]['message']);return _0x136eee(_0x44bba6[_0xd6f0('0x16')]['message']);}logger[_0xd6f0('0x16')](_0xd6f0('0x11'),_0x382a2e,_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x18')]);return _0x4db64a(_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x18')]);}else{logger[_0xd6f0('0x19')](_0xd6f0('0x11'),_0x382a2e,_0xd6f0('0x12'));_0x4db64a(_0x44bba6[_0xd6f0('0x1a')][_0xd6f0('0x18')]);}})[_0xd6f0('0x1b')](function(_0x327231){logger[_0xd6f0('0x16')](_0xd6f0('0x11'),_0x382a2e,_0x327231);_0x136eee(_0x327231);});});}exports[_0xd6f0('0x1c')]=function(_0x5cd367){var _0x48ac38=this;return new Promise(function(_0x3939aa,_0x264104){return db[_0xd6f0('0x1d')]['create'](_0x5cd367[_0xd6f0('0x1e')],{'raw':_0x5cd367[_0xd6f0('0x1f')]?_0x5cd367['options'][_0xd6f0('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x1ee584){logger[_0xd6f0('0x19')]('CreateFaxMessage',_0x5cd367);logger[_0xd6f0('0x13')](_0xd6f0('0x1c'),_0x5cd367,JSON['stringify'](_0x1ee584));_0x3939aa(_0x1ee584);})[_0xd6f0('0x1b')](function(_0x402070){logger[_0xd6f0('0x16')]('CreateFaxMessage',_0x402070[_0xd6f0('0x18')],_0x5cd367);_0x264104(_0x48ac38[_0xd6f0('0x16')](0x1f4,_0x402070['message']));});});};exports[_0xd6f0('0x21')]=function(_0x551be8){var _0x2042d5=this;return new Promise(function(_0x3fb5c3,_0x1630dc){return db[_0xd6f0('0x1d')][_0xd6f0('0x22')](_0x551be8[_0xd6f0('0x1e')],{'raw':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')]['where']||null:null,'attributes':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')][_0xd6f0('0x23')]||null:null,'limit':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')][_0xd6f0('0x24')]||null:null})[_0xd6f0('0x10')](function(_0x3151f8){logger[_0xd6f0('0x19')](_0xd6f0('0x21'),_0x551be8);logger[_0xd6f0('0x13')](_0xd6f0('0x21'),_0x551be8,JSON[_0xd6f0('0x15')](_0x3151f8));_0x3fb5c3(_0x3151f8);})[_0xd6f0('0x1b')](function(_0xbdd223){logger[_0xd6f0('0x16')](_0xd6f0('0x21'),_0xbdd223[_0xd6f0('0x18')],_0x551be8);_0x1630dc(_0x2042d5[_0xd6f0('0x16')](0x1f4,_0xbdd223[_0xd6f0('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 6439cd5..59bc1c2 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 _0x4239=['save','remove','update','emit','removeListener','register'];(function(_0x23c73d,_0x357b21){var _0x36ba47=function(_0x317b8e){while(--_0x317b8e){_0x23c73d['push'](_0x23c73d['shift']());}};_0x36ba47(++_0x357b21);}(_0x4239,0x13e));var _0x9423=function(_0xe39824,_0xbdf61f){_0xe39824=_0xe39824-0x0;var _0x4bc31e=_0x4239[_0xe39824];return _0x4bc31e;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x9423('0x0'),_0x9423('0x1'),_0x9423('0x2')];function createListener(_0x4cbd28,_0x280761){return function(_0x3b444f){_0x280761[_0x9423('0x3')](_0x4cbd28,_0x3b444f);};}function removeListener(_0x3aede1,_0x375619){return function(){FaxMessageEvents[_0x9423('0x4')](_0x3aede1,_0x375619);};}exports[_0x9423('0x5')]=function(_0x244020){for(var _0x175c65=0x0,_0x1cfaae=events['length'];_0x175c65<_0x1cfaae;_0x175c65++){var _0x294962=events[_0x175c65];var _0x4b9272=createListener('faxMessage:'+_0x294962,_0x244020);FaxMessageEvents['on'](_0x294962,_0x4b9272);}}; \ No newline at end of file +var _0xd295=['register','faxMessage:','./faxMessage.events','remove','update','removeListener'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xd295,0x8c));var _0x5d29=function(_0x1e29b6,_0x454a6b){_0x1e29b6=_0x1e29b6-0x0;var _0x3bf7ef=_0xd295[_0x1e29b6];return _0x3bf7ef;};'use strict';var FaxMessageEvents=require(_0x5d29('0x0'));var events=['save',_0x5d29('0x1'),_0x5d29('0x2')];function createListener(_0x28085c,_0x4d707e){return function(_0x37a198){_0x4d707e['emit'](_0x28085c,_0x37a198);};}function removeListener(_0x34b7c1,_0x229959){return function(){FaxMessageEvents[_0x5d29('0x3')](_0x34b7c1,_0x229959);};}exports[_0x5d29('0x4')]=function(_0x1be515){for(var _0x165bfb=0x0,_0xcec7=events['length'];_0x165bfb<_0xcec7;_0x165bfb++){var _0x1e6212=events[_0x165bfb];var _0x460219=createListener(_0x5d29('0x5')+_0x1e6212,_0x1be515);FaxMessageEvents['on'](_0x1e6212,_0x460219);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 9f9761c..c612ef1 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 _0x6324=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','download','post','tracked','fax','faxmessage:create','create','/:id','update','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util'];(function(_0x125ee6,_0x1c51b0){var _0x1d9a17=function(_0x2bbceb){while(--_0x2bbceb){_0x125ee6['push'](_0x125ee6['shift']());}};_0x1d9a17(++_0x1c51b0);}(_0x6324,0x142));var _0x4632=function(_0x134b84,_0x29e050){_0x134b84=_0x134b84-0x0;var _0x28b48a=_0x6324[_0x134b84];return _0x28b48a;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./faxMessage.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/describe',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xb')]);router['get']('/:id/download',auth[_0x4632('0x8')](),controller[_0x4632('0xc')]);router[_0x4632('0xd')]('/',auth[_0x4632('0x8')](),interaction[_0x4632('0xe')](_0x4632('0xf'),_0x4632('0x10')),controller[_0x4632('0x11')]);router['put'](_0x4632('0x12'),auth['isAuthenticated'](),controller[_0x4632('0x13')]);router[_0x4632('0x14')](_0x4632('0x15'),auth[_0x4632('0x8')](),controller['accept']);router[_0x4632('0x14')](_0x4632('0x16'),auth[_0x4632('0x8')](),controller[_0x4632('0x17')]);router[_0x4632('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x4632('0x19')]);module[_0x4632('0x1a')]=router; \ No newline at end of file +var _0xd64b=['tracked','fax','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','/:id/download','post'];(function(_0x18a79e,_0x69ebe8){var _0x42bbea=function(_0x280e3f){while(--_0x280e3f){_0x18a79e['push'](_0x18a79e['shift']());}};_0x42bbea(++_0x69ebe8);}(_0xd64b,0xc1));var _0xbd64=function(_0xce755b,_0x58fb87){_0xce755b=_0xce755b-0x0;var _0x30d6da=_0xd64b[_0xce755b];return _0x30d6da;};'use strict';var multer=require(_0xbd64('0x0'));var util=require('util');var path=require(_0xbd64('0x1'));var timeout=require('connect-timeout');var express=require(_0xbd64('0x2'));var router=express[_0xbd64('0x3')]();var fs_extra=require(_0xbd64('0x4'));var auth=require(_0xbd64('0x5'));var interaction=require(_0xbd64('0x6'));var config=require('../../config/environment');var controller=require('./faxMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xbd64('0x7')]);router[_0xbd64('0x8')](_0xbd64('0x9'),auth[_0xbd64('0xa')](),controller[_0xbd64('0xb')]);router[_0xbd64('0x8')](_0xbd64('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xbd64('0x8')](_0xbd64('0xd'),auth[_0xbd64('0xa')](),controller['download']);router[_0xbd64('0xe')]('/',auth[_0xbd64('0xa')](),interaction[_0xbd64('0xf')](_0xbd64('0x10'),'faxmessage:create'),controller[_0xbd64('0x11')]);router['put'](_0xbd64('0xc'),auth[_0xbd64('0xa')](),controller[_0xbd64('0x12')]);router[_0xbd64('0x13')](_0xbd64('0x14'),auth[_0xbd64('0xa')](),controller[_0xbd64('0x15')]);router[_0xbd64('0x13')](_0xbd64('0x16'),auth['isAuthenticated'](),controller[_0xbd64('0x17')]);router[_0xbd64('0x18')](_0xbd64('0xc'),auth[_0xbd64('0xa')](),controller[_0xbd64('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 9730646..e2c1c2a 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 _0xbd0a=['sequelize','STRING','ENUM','rrmemory','beepall','roundrobin','INTEGER'];(function(_0x14179f,_0x18b584){var _0x46ebf8=function(_0x32966b){while(--_0x32966b){_0x14179f['push'](_0x14179f['shift']());}};_0x46ebf8(++_0x18b584);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x2c732e,_0x2797d8){_0x2c732e=_0x2c732e-0x0;var _0x3e6722=_0xbd0a[_0x2c732e];return _0x3e6722;};'use strict';var Sequelize=require(_0xabd0('0x0'));module['exports']={'name':{'type':Sequelize[_0xabd0('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xabd0('0x2')](_0xabd0('0x3'),_0xabd0('0x4'),_0xabd0('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xabd0('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0ce9=['beepall','INTEGER','sequelize','exports','STRING','name','ENUM','rrmemory'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x0ce9,0x9a));var _0x90ce=function(_0x280d57,_0x5e6418){_0x280d57=_0x280d57-0x0;var _0x39af06=_0x0ce9[_0x280d57];return _0x39af06;};'use strict';var Sequelize=require(_0x90ce('0x0'));module[_0x90ce('0x1')]={'name':{'type':Sequelize[_0x90ce('0x2')],'unique':_0x90ce('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x90ce('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x90ce('0x4')](_0x90ce('0x5'),_0x90ce('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x90ce('0x7')],'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 f9d0c38..81ff794 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 _0x4819=['show','model','keys','intersection','fields','attributes','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','getMembers','findOne','UserFaxQueue','filters','hasOwnProperty','nolimit','pick','FaxQueueId','filter','User','findAndCountAll','UserId','agent','faxPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','params','order','sort','addTeams','ids','Team','Agents','online','voicePause','flatMap','each','forEach','emit','removeTeams','select','field','from','team_has_fax_queues','join','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','all','union','compact','value','transaction','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','./faxQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','update','then','get','FaxQueues','UserProfileResource','error','stack','name','send','index','map','FaxQueue','rawAttributes','type','key','getOptions','where','include','query','findAll','rows','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4819,0xcd));var _0x9481=function(_0x503641,_0x33a3cf){_0x503641=_0x503641-0x0;var _0x17757d=_0x4819[_0x503641];return _0x17757d;};'use strict';var BPromise=require('bluebird');var util=require(_0x9481('0x0'));var _=require(_0x9481('0x1'));var squel=require(_0x9481('0x2'));var Redis=require(_0x9481('0x3'));var qs=require(_0x9481('0x4'));var logger=require(_0x9481('0x5'))(_0x9481('0x6'));var config=require(_0x9481('0x7'));var db=require(_0x9481('0x8'))['db'];config[_0x9481('0x9')]=_['defaults'](config[_0x9481('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9481('0x9')]));require(_0x9481('0xa'))[_0x9481('0xb')](socket);function respondWithStatusCode(_0x3278ff,_0x15d895){_0x15d895=_0x15d895||0xcc;return function(_0x4c7d9c){if(_0x4c7d9c){return _0x3278ff[_0x9481('0xc')](_0x15d895);}return _0x3278ff['status'](_0x15d895)[_0x9481('0xd')]();};}function respondWithResult(_0x564d5b,_0x411d24){_0x411d24=_0x411d24||0xc8;return function(_0x2d5d0f){if(_0x2d5d0f){return _0x564d5b[_0x9481('0xe')](_0x411d24)[_0x9481('0xf')](_0x2d5d0f);}};}function respondWithFilteredResult(_0xe84f77,_0x29515a){return function(_0xa38c93){if(_0xa38c93){var _0xe410c3=typeof _0x29515a[_0x9481('0x10')]==='undefined'&&typeof _0x29515a['limit']===_0x9481('0x11');var _0x150276=_0xa38c93[_0x9481('0x12')];var _0x28fcb6=_0xe410c3?0x0:_0x29515a[_0x9481('0x10')];var _0xc7a0b5=_0xe410c3?_0xa38c93[_0x9481('0x12')]:_0x29515a['offset']+_0x29515a[_0x9481('0x13')];var _0x7a7ee;if(_0xc7a0b5>=_0x150276){_0xc7a0b5=_0x150276;_0x7a7ee=0xc8;}else{_0x7a7ee=0xce;}_0xe84f77['status'](_0x7a7ee);return _0xe84f77[_0x9481('0x14')]('Content-Range',_0x28fcb6+'-'+_0xc7a0b5+'/'+_0x150276)[_0x9481('0xf')](_0xa38c93);}return null;};}function saveUpdates(_0x7a2ac8){return function(_0x2bc12a){if(_0x2bc12a){return _0x2bc12a[_0x9481('0x15')](_0x7a2ac8)['then'](function(_0x5eda66){return _0x5eda66;});}return null;};}function removeEntity(_0x20473d){return function(_0x50a559){if(_0x50a559){return _0x50a559['destroy']()[_0x9481('0x16')](function(){var _0x33e32b=_0x50a559[_0x9481('0x17')]({'plain':!![]});var _0x41051d=_0x9481('0x18');return db[_0x9481('0x19')]['destroy']({'where':{'type':_0x41051d,'resourceId':_0x33e32b['id']}})[_0x9481('0x16')](function(){return _0x50a559;});})[_0x9481('0x16')](function(){_0x20473d[_0x9481('0xe')](0xcc)[_0x9481('0xd')]();});}};}function handleEntityNotFound(_0xb5cd2c){return function(_0x56da97){if(!_0x56da97){_0xb5cd2c[_0x9481('0xc')](0x194);}return _0x56da97;};}function handleError(_0x294908,_0x572599){_0x572599=_0x572599||0x1f4;return function(_0x2bcf37){logger[_0x9481('0x1a')](_0x2bcf37[_0x9481('0x1b')]);if(_0x2bcf37[_0x9481('0x1c')]){delete _0x2bcf37[_0x9481('0x1c')];}_0x294908['status'](_0x572599)[_0x9481('0x1d')](_0x2bcf37);};}exports[_0x9481('0x1e')]=function(_0x56c889,_0x5eb4f5){var _0x12b0c3={};var _0x299e28={'count':0x0,'rows':[]};var _0x550fce=_[_0x9481('0x1f')](db[_0x9481('0x20')][_0x9481('0x21')],function(_0x28ae1b){return{'name':_0x28ae1b['fieldName'],'type':_0x28ae1b[_0x9481('0x22')][_0x9481('0x23')]};});_0x12b0c3=qs[_0x9481('0x24')](_0x550fce,_0x56c889);var _0x587706={'where':_0x12b0c3[_0x9481('0x25')]};return db['FaxQueue'][_0x9481('0x12')](_0x587706)[_0x9481('0x16')](function(_0x22ab26){_0x299e28[_0x9481('0x12')]=_0x22ab26;_0x12b0c3[_0x9481('0x26')]=qs['include'](_0x56c889[_0x9481('0x27')]);return db[_0x9481('0x20')][_0x9481('0x28')](_0x12b0c3);})['then'](function(_0x56752e){_0x299e28[_0x9481('0x29')]=_0x56752e;return _0x299e28;})[_0x9481('0x16')](respondWithFilteredResult(_0x5eb4f5,_0x12b0c3))[_0x9481('0x2a')](handleError(_0x5eb4f5,null));};exports[_0x9481('0x2b')]=function(_0x5d9926,_0x5163e3){var _0x5e7d16={'raw':!![],'where':{'id':_0x5d9926['params']['id']}},_0x29e6b6={};_0x29e6b6[_0x9481('0x2c')]=_['keys'](db[_0x9481('0x20')][_0x9481('0x21')]);_0x29e6b6[_0x9481('0x27')]=_[_0x9481('0x2d')](_0x5d9926[_0x9481('0x27')]);_0x29e6b6['filters']=_[_0x9481('0x2e')](_0x29e6b6[_0x9481('0x2c')],_0x29e6b6[_0x9481('0x27')]);_0x5e7d16['attributes']=_[_0x9481('0x2e')](_0x29e6b6[_0x9481('0x2c')],qs[_0x9481('0x2f')](_0x5d9926[_0x9481('0x27')][_0x9481('0x2f')]));_0x5e7d16[_0x9481('0x30')]=_0x5e7d16['attributes'][_0x9481('0x31')]?_0x5e7d16['attributes']:_0x29e6b6[_0x9481('0x2c')];if(_0x5d9926[_0x9481('0x27')][_0x9481('0x32')]){_0x5e7d16[_0x9481('0x26')]=[{'all':!![]}];}_0x5e7d16=_[_0x9481('0x33')]({},_0x5e7d16,_0x5d9926[_0x9481('0x34')]);return db['FaxQueue'][_0x9481('0x35')](_0x5e7d16)[_0x9481('0x16')](handleEntityNotFound(_0x5163e3,null))['then'](respondWithResult(_0x5163e3,null))['catch'](handleError(_0x5163e3,null));};exports[_0x9481('0x36')]=function(_0x5ab28f,_0x224b88){return db[_0x9481('0x20')][_0x9481('0x36')](_0x5ab28f[_0x9481('0x37')],{})['then'](function(_0x3c30e8){var _0x590d50=_0x5ab28f[_0x9481('0x38')]['get']({'plain':!![]});if(!_0x590d50)throw new Error(_0x9481('0x39'));if(_0x590d50['role']===_0x9481('0x38')){var _0x22e916=_0x3c30e8[_0x9481('0x17')]({'plain':!![]});var _0x37c5c3=_0x9481('0x18');return db[_0x9481('0x3a')][_0x9481('0x35')]({'where':{'name':_0x37c5c3,'userProfileId':_0x590d50['userProfileId']},'raw':!![]})[_0x9481('0x16')](function(_0x3857e8){if(_0x3857e8&&_0x3857e8[_0x9481('0x3b')]===0x0){return db[_0x9481('0x19')][_0x9481('0x36')]({'name':_0x22e916[_0x9481('0x1c')],'resourceId':_0x22e916['id'],'type':_0x3857e8[_0x9481('0x1c')],'sectionId':_0x3857e8['id']},{})['then'](function(){return _0x3c30e8;});}else{return _0x3c30e8;}})[_0x9481('0x2a')](function(_0x1872ff){logger['error'](_0x9481('0x3c'),_0x1872ff);throw _0x1872ff;});}return _0x3c30e8;})[_0x9481('0x16')](respondWithResult(_0x224b88,0xc9))[_0x9481('0x2a')](handleError(_0x224b88,null));};exports[_0x9481('0x15')]=function(_0x29a8e9,_0x5a8ffd){if(_0x29a8e9[_0x9481('0x37')]['id']){delete _0x29a8e9['body']['id'];}return db[_0x9481('0x20')][_0x9481('0x35')]({'where':{'id':_0x29a8e9['params']['id']}})['then'](handleEntityNotFound(_0x5a8ffd,null))[_0x9481('0x16')](saveUpdates(_0x29a8e9[_0x9481('0x37')],null))[_0x9481('0x16')](respondWithResult(_0x5a8ffd,null))['catch'](handleError(_0x5a8ffd,null));};exports[_0x9481('0x3d')]=function(_0x184923,_0x5502ad){return db['FaxQueue'][_0x9481('0x35')]({'where':{'id':_0x184923['params']['id']}})[_0x9481('0x16')](handleEntityNotFound(_0x5502ad,null))[_0x9481('0x16')](removeEntity(_0x5502ad,null))[_0x9481('0x2a')](handleError(_0x5502ad,null));};exports[_0x9481('0x3e')]=function(_0x68d81d,_0x52926b){return db[_0x9481('0x20')][_0x9481('0x3e')]()['then'](respondWithResult(_0x52926b,null))[_0x9481('0x2a')](handleError(_0x52926b,null));};exports[_0x9481('0x3f')]=function(_0x1e0f4e,_0x349d09){var _0x4db2d3={'raw':!![],'where':{}},_0x3929a8={},_0x3a1bee;return db[_0x9481('0x20')][_0x9481('0x40')]({'where':{'id':_0x1e0f4e['params']['id']}})[_0x9481('0x16')](handleEntityNotFound(_0x349d09,null))['then'](function(_0x5c4d18){if(_0x5c4d18){_0x3a1bee=_0x5c4d18[_0x9481('0x17')]({'plain':!![]});_0x3929a8['model']=_[_0x9481('0x2d')](db[_0x9481('0x41')]['rawAttributes']);_0x3929a8[_0x9481('0x27')]=_[_0x9481('0x2d')](_0x1e0f4e[_0x9481('0x27')]);_0x3929a8[_0x9481('0x42')]=_[_0x9481('0x2e')](_0x3929a8[_0x9481('0x2c')],_0x3929a8['query']);_0x4db2d3['attributes']=_[_0x9481('0x2e')](_0x3929a8[_0x9481('0x2c')],qs[_0x9481('0x2f')](_0x1e0f4e[_0x9481('0x27')][_0x9481('0x2f')]));_0x4db2d3[_0x9481('0x30')]=_0x4db2d3[_0x9481('0x30')][_0x9481('0x31')]?_0x4db2d3['attributes']:_0x3929a8[_0x9481('0x2c')];if(!_0x1e0f4e[_0x9481('0x27')][_0x9481('0x43')](_0x9481('0x44'))){_0x4db2d3[_0x9481('0x13')]=qs['limit'](_0x1e0f4e['query'][_0x9481('0x13')]);_0x4db2d3[_0x9481('0x10')]=qs[_0x9481('0x10')](_0x1e0f4e['query']['offset']);}_0x4db2d3['order']=qs['sort'](_0x1e0f4e['query']['sort']);_0x4db2d3['where']=qs[_0x9481('0x42')](_[_0x9481('0x45')](_0x1e0f4e['query'],_0x3929a8[_0x9481('0x42')]));_0x4db2d3['where'][_0x9481('0x46')]=_0x5c4d18['id'];if(_0x1e0f4e[_0x9481('0x27')][_0x9481('0x47')]){_0x4db2d3[_0x9481('0x25')]=_[_0x9481('0x33')](_0x4db2d3[_0x9481('0x25')],{'$or':_[_0x9481('0x1f')](_0x4db2d3['attributes'],function(_0x26b41f){var _0x1b51b7={};_0x1b51b7[_0x26b41f]={'$like':'%'+_0x1e0f4e['query'][_0x9481('0x47')]+'%'};return _0x1b51b7;})});}_0x4db2d3=_[_0x9481('0x33')]({},_0x4db2d3,_0x1e0f4e[_0x9481('0x34')]);return db[_0x9481('0x41')][_0x9481('0x28')](_0x4db2d3);}})['then'](function(_0x2255b2){if(_0x2255b2){return db[_0x9481('0x48')][_0x9481('0x49')]({'where':{'id':_[_0x9481('0x1f')](_0x2255b2,_0x9481('0x4a')),'role':_0x9481('0x4b')},'attributes':['id',_0x9481('0x1c'),_0x9481('0x4c'),_0x9481('0x4d'),'createdAt']});}})['then'](function(_0x5b4234){if(_0x5b4234){return{'count':_0x5b4234[_0x9481('0x12')],'rows':_[_0x9481('0x1f')](_0x5b4234['rows'],function(_0xe8ce2a){return{'membername':_0xe8ce2a[_0x9481('0x1c')],'UserId':_0xe8ce2a['id'],'queue_name':_0x3a1bee[_0x9481('0x1c')],'FaxQueueId':_0x3a1bee['id'],'interface':util[_0x9481('0x4e')](_0x9481('0x4f'),_0x9481('0x50'),_0xe8ce2a['name']),'penalty':0x0,'paused':_0xe8ce2a['faxPause'],'createdAt':_0xe8ce2a[_0x9481('0x51')],'updatedAt':_0xe8ce2a[_0x9481('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9481('0x16')](respondWithFilteredResult(_0x349d09,_0x4db2d3))[_0x9481('0x2a')](handleError(_0x349d09,null));};exports[_0x9481('0x52')]=function(_0x205b96,_0x592664){var _0x542ae7={};var _0x17edbc={};var _0x5aaf14;var _0x39dfaa;return db['FaxQueue'][_0x9481('0x40')]({'where':{'id':_0x205b96[_0x9481('0x53')]['id']}})[_0x9481('0x16')](handleEntityNotFound(_0x592664,null))['then'](function(_0x28d331){if(_0x28d331){_0x5aaf14=_0x28d331;_0x17edbc[_0x9481('0x2c')]=_['keys'](db['Team']['rawAttributes']);_0x17edbc['query']=_[_0x9481('0x2d')](_0x205b96['query']);_0x17edbc[_0x9481('0x42')]=_[_0x9481('0x2e')](_0x17edbc[_0x9481('0x2c')],_0x17edbc['query']);_0x542ae7[_0x9481('0x30')]=_['intersection'](_0x17edbc[_0x9481('0x2c')],qs[_0x9481('0x2f')](_0x205b96[_0x9481('0x27')]['fields']));_0x542ae7[_0x9481('0x30')]=_0x542ae7[_0x9481('0x30')]['length']?_0x542ae7[_0x9481('0x30')]:_0x17edbc[_0x9481('0x2c')];_0x542ae7[_0x9481('0x54')]=qs[_0x9481('0x55')](_0x205b96[_0x9481('0x27')][_0x9481('0x55')]);_0x542ae7[_0x9481('0x25')]=qs[_0x9481('0x42')](_[_0x9481('0x45')](_0x205b96[_0x9481('0x27')],_0x17edbc[_0x9481('0x42')]));if(_0x205b96[_0x9481('0x27')][_0x9481('0x47')]){_0x542ae7[_0x9481('0x25')]=_[_0x9481('0x33')](_0x542ae7[_0x9481('0x25')],{'$or':_[_0x9481('0x1f')](_0x542ae7['attributes'],function(_0x1e05f8){var _0x504875={};_0x504875[_0x1e05f8]={'$like':'%'+_0x205b96['query'][_0x9481('0x47')]+'%'};return _0x504875;})});}_0x542ae7=_['merge']({},_0x542ae7,_0x205b96['options']);return _0x5aaf14['getTeams'](_0x542ae7);}})[_0x9481('0x16')](function(_0x1b8f9f){if(_0x1b8f9f){_0x39dfaa=_0x1b8f9f[_0x9481('0x31')];if(!_0x205b96[_0x9481('0x27')]['hasOwnProperty'](_0x9481('0x44'))){_0x542ae7[_0x9481('0x13')]=qs[_0x9481('0x13')](_0x205b96[_0x9481('0x27')]['limit']);_0x542ae7['offset']=qs[_0x9481('0x10')](_0x205b96[_0x9481('0x27')][_0x9481('0x10')]);}return _0x5aaf14[_0x9481('0x52')](_0x542ae7);}})[_0x9481('0x16')](function(_0x5bf10b){if(_0x5bf10b){return _0x5bf10b?{'count':_0x39dfaa,'rows':_0x5bf10b}:null;}})[_0x9481('0x16')](respondWithResult(_0x592664,null))[_0x9481('0x2a')](handleError(_0x592664,null));};exports[_0x9481('0x56')]=function(_0xbf5986,_0x8f29b){var _0xadbdb0=_0xbf5986[_0x9481('0x37')][_0x9481('0x57')];return db[_0x9481('0x58')][_0x9481('0x28')]({'where':{'id':_0xadbdb0},'attributes':['id'],'include':[{'model':db[_0x9481('0x48')],'as':_0x9481('0x59'),'attributes':['id',_0x9481('0x1c'),_0x9481('0x5a'),_0x9481('0x5b'),'interface'],'raw':!![]}]})[_0x9481('0x16')](function(_0x10c298){if(_0x10c298){var _0x3f51c5=_[_0x9481('0x5c')](_0x10c298,function(_0x1b5c97){var _0x317a4e=_0x1b5c97[_0x9481('0x17')]({'plain':!![]});return _0x317a4e['Agents'];});return db[_0x9481('0x20')][_0x9481('0x35')]({'where':{'id':_0xbf5986['params']['id']}})['then'](function(_0x84ff4f){return db['sequelize']['transaction'](function(_0x3c262f){return _0x84ff4f['addTeams'](_0xadbdb0,{'transaction':_0x3c262f})[_0x9481('0x16')](function(){return BPromise[_0x9481('0x5d')](_0x3f51c5,function(_0x220825){return db[_0x9481('0x41')]['findOrCreate']({'where':{'UserId':_0x220825['id'],'FaxQueueId':_0xbf5986[_0x9481('0x53')]['id']},'transaction':_0x3c262f});});})['then'](function(){_0x3f51c5[_0x9481('0x5e')](function(_0x40bd99){socket[_0x9481('0x5f')]('userFaxQueue:save',{'UserId':_0x40bd99['id'],'FaxQueueId':_0x84ff4f['id']});});});});});}})['then'](respondWithStatusCode(_0x8f29b,null))['catch'](handleError(_0x8f29b,null));};exports[_0x9481('0x60')]=function(_0x59921c,_0x56e35a){return db[_0x9481('0x58')][_0x9481('0x28')]({'where':{'id':_0x59921c[_0x9481('0x27')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9481('0x48')],'as':_0x9481('0x59'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x56e35a,null))[_0x9481('0x16')](function(_0x3c8241){var _0x1ea93a=_[_0x9481('0x1f')](_0x3c8241,'id');var _0x5f4be2=[];var _0x2e585d=[];var _0x4962f0=squel[_0x9481('0x61')]();_0x4962f0[_0x9481('0x62')]('tq.TeamId')[_0x9481('0x63')](_0x9481('0x64'),'tq')[_0x9481('0x65')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9481('0x25')]('FaxQueueId\x20=\x20?',_0x59921c[_0x9481('0x53')]['id']);for(var _0x15d112=0x0;_0x15d112<_0x3c8241[_0x9481('0x31')];_0x15d112+=0x1){let _0x55b428=_0x3c8241[_0x15d112];for(var _0x3f74f1=0x0;_0x3f74f1<_0x55b428[_0x9481('0x59')][_0x9481('0x31')];_0x3f74f1+=0x1){let _0x540e8e=_0x55b428[_0x9481('0x59')][_0x3f74f1];var _0x31e097=_0x4962f0[_0x9481('0x66')]();_0x31e097[_0x9481('0x25')](_0x9481('0x67'),_0x540e8e['id']);_0x2e585d[_0x9481('0x68')](db[_0x9481('0x69')][_0x9481('0x27')](_0x31e097[_0x9481('0x6a')](),{'type':db[_0x9481('0x69')]['QueryTypes'][_0x9481('0x6b')]})['then'](function(_0x4f55b5){if(_0x4f55b5['length']===0x1){return _0x540e8e['id'];}else{var _0x2d4967=_[_0x9481('0x6c')](_[_0x9481('0x1f')](_0x4f55b5,_0x9481('0x6d')),function(_0x36b627){return _['includes'](_0x1ea93a,_0x36b627);});if(_0x2d4967){return _0x540e8e['id'];}}}));}}return BPromise[_0x9481('0x6e')](_0x2e585d)[_0x9481('0x16')](function(_0x2e7d07){_0x5f4be2=_(_0x5f4be2)[_0x9481('0x6f')](_0x2e7d07)[_0x9481('0x70')]()[_0x9481('0x71')]();return db[_0x9481('0x20')][_0x9481('0x35')]({'where':{'id':_0x59921c[_0x9481('0x53')]['id']}})[_0x9481('0x16')](function(_0x5808c8){return db[_0x9481('0x69')][_0x9481('0x72')](function(_0x458a6f){return _0x5808c8[_0x9481('0x60')](_0x59921c[_0x9481('0x27')][_0x9481('0x57')],{'transaction':_0x458a6f})[_0x9481('0x16')](function(){if(!_[_0x9481('0x73')](_0x5f4be2)){return _0x5808c8[_0x9481('0x74')](_0x5f4be2,{'transaction':_0x458a6f});}})[_0x9481('0x16')](function(){_0x5f4be2['forEach'](function(_0x12a450){socket[_0x9481('0x5f')](_0x9481('0x75'),{'UserId':_0x12a450,'FaxQueueId':_0x5808c8['id']});});});});});});})[_0x9481('0x16')](respondWithStatusCode(_0x56e35a,null))[_0x9481('0x2a')](handleError(_0x56e35a,null));};exports[_0x9481('0x76')]=function(_0x16311f,_0x3ae3e2){return db[_0x9481('0x20')]['find']({'where':{'id':_0x16311f[_0x9481('0x53')]['id']}})['then'](handleEntityNotFound(_0x3ae3e2,null))['then'](function(_0xf42781){if(_0xf42781){return _0xf42781[_0x9481('0x76')](_0x16311f[_0x9481('0x37')][_0x9481('0x57')],_[_0x9481('0x77')](_0x16311f[_0x9481('0x37')],['ids','id'])||{})[_0x9481('0x78')](function(_0x561b37){for(var _0x4bc7ea=0x0;_0x4bc7ea<_0x16311f[_0x9481('0x37')][_0x9481('0x57')]['length'];_0x4bc7ea+=0x1){socket['emit'](_0x9481('0x79'),{'UserId':Number(_0x16311f[_0x9481('0x37')][_0x9481('0x57')][_0x4bc7ea]),'FaxQueueId':Number(_0x16311f[_0x9481('0x53')]['id'])});}return _0x561b37;});}})[_0x9481('0x16')](respondWithResult(_0x3ae3e2,null))[_0x9481('0x2a')](handleError(_0x3ae3e2,null));};exports[_0x9481('0x74')]=function(_0x2c8d0d,_0x3fbedd){return db['FaxQueue'][_0x9481('0x35')]({'where':{'id':_0x2c8d0d[_0x9481('0x53')]['id']}})['then'](handleEntityNotFound(_0x3fbedd,null))[_0x9481('0x16')](function(_0x534979){if(_0x534979){return _0x534979[_0x9481('0x74')](_0x2c8d0d[_0x9481('0x27')]['ids'])[_0x9481('0x16')](function(){if(_[_0x9481('0x7a')](_0x2c8d0d[_0x9481('0x27')]['ids'])){for(var _0x393a0c=0x0;_0x393a0c<_0x2c8d0d[_0x9481('0x27')]['ids'][_0x9481('0x31')];_0x393a0c+=0x1){socket['emit'](_0x9481('0x75'),{'UserId':Number(_0x2c8d0d[_0x9481('0x27')][_0x9481('0x57')][_0x393a0c]),'FaxQueueId':Number(_0x2c8d0d['params']['id'])});}}else{socket['emit'](_0x9481('0x75'),{'UserId':Number(_0x2c8d0d[_0x9481('0x27')][_0x9481('0x57')]),'FaxQueueId':Number(_0x2c8d0d[_0x9481('0x53')]['id'])});}});}})[_0x9481('0x16')](respondWithStatusCode(_0x3fbedd,null))[_0x9481('0x2a')](handleError(_0x3fbedd,null));};exports['getAgents']=function(_0x9c6bc7,_0x619ca8){var _0x232b8c={};var _0x38254c={};var _0x467b1d;var _0x32643f;return db[_0x9481('0x20')]['findOne']({'where':{'id':_0x9c6bc7[_0x9481('0x53')]['id']}})[_0x9481('0x16')](handleEntityNotFound(_0x619ca8,null))[_0x9481('0x16')](function(_0x4307e0){if(_0x4307e0){_0x467b1d=_0x4307e0;_0x38254c['model']=_[_0x9481('0x2d')](db[_0x9481('0x48')][_0x9481('0x21')]);_0x38254c[_0x9481('0x27')]=_['keys'](_0x9c6bc7[_0x9481('0x27')]);_0x38254c[_0x9481('0x42')]=_[_0x9481('0x2e')](_0x38254c[_0x9481('0x2c')],_0x38254c[_0x9481('0x27')]);_0x232b8c[_0x9481('0x30')]=_[_0x9481('0x2e')](_0x38254c[_0x9481('0x2c')],qs[_0x9481('0x2f')](_0x9c6bc7[_0x9481('0x27')][_0x9481('0x2f')]));_0x232b8c['attributes']=_0x232b8c[_0x9481('0x30')]['length']?_0x232b8c[_0x9481('0x30')]:_0x38254c[_0x9481('0x2c')];_0x232b8c[_0x9481('0x54')]=qs[_0x9481('0x55')](_0x9c6bc7[_0x9481('0x27')]['sort']);_0x232b8c[_0x9481('0x25')]=qs[_0x9481('0x42')](_[_0x9481('0x45')](_0x9c6bc7[_0x9481('0x27')],_0x38254c[_0x9481('0x42')]));if(_0x9c6bc7[_0x9481('0x27')]['filter']){_0x232b8c[_0x9481('0x25')]=_[_0x9481('0x33')](_0x232b8c[_0x9481('0x25')],{'$or':_[_0x9481('0x1f')](_0x232b8c[_0x9481('0x30')],function(_0x394dae){var _0x377384={};_0x377384[_0x394dae]={'$like':'%'+_0x9c6bc7[_0x9481('0x27')][_0x9481('0x47')]+'%'};return _0x377384;})});}_0x232b8c=_[_0x9481('0x33')]({},_0x232b8c,_0x9c6bc7[_0x9481('0x34')]);return _0x467b1d[_0x9481('0x7b')](_0x232b8c);}})['then'](function(_0x336f3f){if(_0x336f3f){_0x32643f=_0x336f3f[_0x9481('0x31')];if(!_0x9c6bc7[_0x9481('0x27')][_0x9481('0x43')](_0x9481('0x44'))){_0x232b8c[_0x9481('0x13')]=qs[_0x9481('0x13')](_0x9c6bc7[_0x9481('0x27')][_0x9481('0x13')]);_0x232b8c[_0x9481('0x10')]=qs[_0x9481('0x10')](_0x9c6bc7[_0x9481('0x27')][_0x9481('0x10')]);}return _0x467b1d[_0x9481('0x7b')](_0x232b8c);}})[_0x9481('0x16')](function(_0xcf83d2){if(_0xcf83d2){return _0xcf83d2?{'count':_0x32643f,'rows':_0xcf83d2}:null;}})[_0x9481('0x16')](respondWithResult(_0x619ca8,null))[_0x9481('0x2a')](handleError(_0x619ca8,null));}; \ No newline at end of file +var _0x363e=['getAgents','order','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','update','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','where','include','query','FaxQueue','rows','show','params','model','keys','filters','intersection','fields','attributes','includeAll','merge','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserFaxQueue','length','hasOwnProperty','nolimit','sort','pick','FaxQueueId','filter','findAll','User','findAndCountAll','UserId','faxPause','updatedAt','%s/%s','SIP','createdAt','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','compact','value','removeAgents','userFaxQueue:remove','addAgents','omit','isArray'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x363e,0x179));var _0xe363=function(_0x33a925,_0x16b1ee){_0x33a925=_0x33a925-0x0;var _0x134841=_0x363e[_0x33a925];return _0x134841;};'use strict';var BPromise=require(_0xe363('0x0'));var util=require(_0xe363('0x1'));var _=require('lodash');var squel=require(_0xe363('0x2'));var Redis=require(_0xe363('0x3'));var qs=require(_0xe363('0x4'));var logger=require(_0xe363('0x5'))(_0xe363('0x6'));var config=require(_0xe363('0x7'));var db=require(_0xe363('0x8'))['db'];config[_0xe363('0x9')]=_[_0xe363('0xa')](config[_0xe363('0x9')],{'host':_0xe363('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe363('0x9')]));require(_0xe363('0xc'))[_0xe363('0xd')](socket);function respondWithStatusCode(_0x29d330,_0x515185){_0x515185=_0x515185||0xcc;return function(_0x24255d){if(_0x24255d){return _0x29d330[_0xe363('0xe')](_0x515185);}return _0x29d330[_0xe363('0xf')](_0x515185)[_0xe363('0x10')]();};}function respondWithResult(_0x29a78c,_0x4133e9){_0x4133e9=_0x4133e9||0xc8;return function(_0x3304a1){if(_0x3304a1){return _0x29a78c['status'](_0x4133e9)[_0xe363('0x11')](_0x3304a1);}};}function respondWithFilteredResult(_0x45cd96,_0x58d1b6){return function(_0x393a1f){if(_0x393a1f){var _0x5d031e=typeof _0x58d1b6['offset']===_0xe363('0x12')&&typeof _0x58d1b6[_0xe363('0x13')]===_0xe363('0x12');var _0x359f69=_0x393a1f[_0xe363('0x14')];var _0x563fbf=_0x5d031e?0x0:_0x58d1b6[_0xe363('0x15')];var _0x22b227=_0x5d031e?_0x393a1f['count']:_0x58d1b6[_0xe363('0x15')]+_0x58d1b6[_0xe363('0x13')];var _0x52e6c6;if(_0x22b227>=_0x359f69){_0x22b227=_0x359f69;_0x52e6c6=0xc8;}else{_0x52e6c6=0xce;}_0x45cd96[_0xe363('0xf')](_0x52e6c6);return _0x45cd96[_0xe363('0x16')]('Content-Range',_0x563fbf+'-'+_0x22b227+'/'+_0x359f69)[_0xe363('0x11')](_0x393a1f);}return null;};}function saveUpdates(_0xc94d0a){return function(_0x5e148d){if(_0x5e148d){return _0x5e148d[_0xe363('0x17')](_0xc94d0a)[_0xe363('0x18')](function(_0x2f2c20){return _0x2f2c20;});}return null;};}function removeEntity(_0x4dcba0){return function(_0x287104){if(_0x287104){return _0x287104[_0xe363('0x19')]()['then'](function(){var _0x37ea93=_0x287104[_0xe363('0x1a')]({'plain':!![]});var _0x1c4953=_0xe363('0x1b');return db[_0xe363('0x1c')][_0xe363('0x19')]({'where':{'type':_0x1c4953,'resourceId':_0x37ea93['id']}})['then'](function(){return _0x287104;});})[_0xe363('0x18')](function(){_0x4dcba0[_0xe363('0xf')](0xcc)[_0xe363('0x10')]();});}};}function handleEntityNotFound(_0x379b8a){return function(_0x43c9c0){if(!_0x43c9c0){_0x379b8a[_0xe363('0xe')](0x194);}return _0x43c9c0;};}function handleError(_0x24199a,_0xaff56f){_0xaff56f=_0xaff56f||0x1f4;return function(_0x41d04b){logger[_0xe363('0x1d')](_0x41d04b[_0xe363('0x1e')]);if(_0x41d04b[_0xe363('0x1f')]){delete _0x41d04b[_0xe363('0x1f')];}_0x24199a[_0xe363('0xf')](_0xaff56f)[_0xe363('0x20')](_0x41d04b);};}exports[_0xe363('0x21')]=function(_0xf9b981,_0xf9949b){var _0x19c7b4={};var _0x3e24ad={'count':0x0,'rows':[]};var _0x312d75=_[_0xe363('0x22')](db['FaxQueue'][_0xe363('0x23')],function(_0x12358b){return{'name':_0x12358b[_0xe363('0x24')],'type':_0x12358b[_0xe363('0x25')][_0xe363('0x26')]};});_0x19c7b4=qs['getOptions'](_0x312d75,_0xf9b981);var _0x33b50c={'where':_0x19c7b4[_0xe363('0x27')]};return db['FaxQueue'][_0xe363('0x14')](_0x33b50c)['then'](function(_0x3ed3e1){_0x3e24ad[_0xe363('0x14')]=_0x3ed3e1;_0x19c7b4['include']=qs[_0xe363('0x28')](_0xf9b981[_0xe363('0x29')]);return db[_0xe363('0x2a')]['findAll'](_0x19c7b4);})[_0xe363('0x18')](function(_0x32c9ab){_0x3e24ad[_0xe363('0x2b')]=_0x32c9ab;return _0x3e24ad;})[_0xe363('0x18')](respondWithFilteredResult(_0xf9949b,_0x19c7b4))['catch'](handleError(_0xf9949b,null));};exports[_0xe363('0x2c')]=function(_0x3869bd,_0x404b32){var _0x187a23={'raw':!![],'where':{'id':_0x3869bd[_0xe363('0x2d')]['id']}},_0x26ac10={};_0x26ac10[_0xe363('0x2e')]=_[_0xe363('0x2f')](db[_0xe363('0x2a')][_0xe363('0x23')]);_0x26ac10['query']=_['keys'](_0x3869bd[_0xe363('0x29')]);_0x26ac10[_0xe363('0x30')]=_['intersection'](_0x26ac10[_0xe363('0x2e')],_0x26ac10[_0xe363('0x29')]);_0x187a23['attributes']=_[_0xe363('0x31')](_0x26ac10[_0xe363('0x2e')],qs[_0xe363('0x32')](_0x3869bd[_0xe363('0x29')]['fields']));_0x187a23['attributes']=_0x187a23[_0xe363('0x33')]['length']?_0x187a23['attributes']:_0x26ac10[_0xe363('0x2e')];if(_0x3869bd[_0xe363('0x29')][_0xe363('0x34')]){_0x187a23[_0xe363('0x28')]=[{'all':!![]}];}_0x187a23=_[_0xe363('0x35')]({},_0x187a23,_0x3869bd[_0xe363('0x36')]);return db[_0xe363('0x2a')][_0xe363('0x37')](_0x187a23)[_0xe363('0x18')](handleEntityNotFound(_0x404b32,null))[_0xe363('0x18')](respondWithResult(_0x404b32,null))[_0xe363('0x38')](handleError(_0x404b32,null));};exports[_0xe363('0x39')]=function(_0x544532,_0x574af3){return db[_0xe363('0x2a')][_0xe363('0x39')](_0x544532[_0xe363('0x3a')],{})['then'](function(_0x534039){var _0x815550=_0x544532[_0xe363('0x3b')][_0xe363('0x1a')]({'plain':!![]});if(!_0x815550)throw new Error(_0xe363('0x3c'));if(_0x815550['role']===_0xe363('0x3b')){var _0x49b8c4=_0x534039[_0xe363('0x1a')]({'plain':!![]});var _0x2a279b=_0xe363('0x1b');return db[_0xe363('0x3d')][_0xe363('0x37')]({'where':{'name':_0x2a279b,'userProfileId':_0x815550[_0xe363('0x3e')]},'raw':!![]})[_0xe363('0x18')](function(_0x44f03c){if(_0x44f03c&&_0x44f03c[_0xe363('0x3f')]===0x0){return db['UserProfileResource']['create']({'name':_0x49b8c4[_0xe363('0x1f')],'resourceId':_0x49b8c4['id'],'type':_0x44f03c[_0xe363('0x1f')],'sectionId':_0x44f03c['id']},{})[_0xe363('0x18')](function(){return _0x534039;});}else{return _0x534039;}})[_0xe363('0x38')](function(_0x2fc2f0){logger[_0xe363('0x1d')](_0xe363('0x40'),_0x2fc2f0);throw _0x2fc2f0;});}return _0x534039;})[_0xe363('0x18')](respondWithResult(_0x574af3,0xc9))[_0xe363('0x38')](handleError(_0x574af3,null));};exports['update']=function(_0x3da5ba,_0x58b837){if(_0x3da5ba[_0xe363('0x3a')]['id']){delete _0x3da5ba['body']['id'];}return db[_0xe363('0x2a')][_0xe363('0x37')]({'where':{'id':_0x3da5ba['params']['id']}})[_0xe363('0x18')](handleEntityNotFound(_0x58b837,null))[_0xe363('0x18')](saveUpdates(_0x3da5ba[_0xe363('0x3a')],null))[_0xe363('0x18')](respondWithResult(_0x58b837,null))[_0xe363('0x38')](handleError(_0x58b837,null));};exports[_0xe363('0x19')]=function(_0x5f4bc0,_0x33a561){return db[_0xe363('0x2a')][_0xe363('0x37')]({'where':{'id':_0x5f4bc0[_0xe363('0x2d')]['id']}})[_0xe363('0x18')](handleEntityNotFound(_0x33a561,null))['then'](removeEntity(_0x33a561,null))[_0xe363('0x38')](handleError(_0x33a561,null));};exports[_0xe363('0x41')]=function(_0x3badf5,_0x18147d){return db[_0xe363('0x2a')][_0xe363('0x41')]()[_0xe363('0x18')](respondWithResult(_0x18147d,null))['catch'](handleError(_0x18147d,null));};exports['getMembers']=function(_0x234523,_0x23d249){var _0x8f6a76={'raw':!![],'where':{}},_0x4aa733={},_0x28b38d;return db[_0xe363('0x2a')]['findOne']({'where':{'id':_0x234523['params']['id']}})[_0xe363('0x18')](handleEntityNotFound(_0x23d249,null))[_0xe363('0x18')](function(_0x1a6c70){if(_0x1a6c70){_0x28b38d=_0x1a6c70[_0xe363('0x1a')]({'plain':!![]});_0x4aa733['model']=_[_0xe363('0x2f')](db[_0xe363('0x42')]['rawAttributes']);_0x4aa733['query']=_[_0xe363('0x2f')](_0x234523[_0xe363('0x29')]);_0x4aa733['filters']=_[_0xe363('0x31')](_0x4aa733['model'],_0x4aa733[_0xe363('0x29')]);_0x8f6a76[_0xe363('0x33')]=_['intersection'](_0x4aa733[_0xe363('0x2e')],qs[_0xe363('0x32')](_0x234523['query'][_0xe363('0x32')]));_0x8f6a76[_0xe363('0x33')]=_0x8f6a76['attributes'][_0xe363('0x43')]?_0x8f6a76['attributes']:_0x4aa733[_0xe363('0x2e')];if(!_0x234523[_0xe363('0x29')][_0xe363('0x44')](_0xe363('0x45'))){_0x8f6a76['limit']=qs[_0xe363('0x13')](_0x234523[_0xe363('0x29')][_0xe363('0x13')]);_0x8f6a76['offset']=qs[_0xe363('0x15')](_0x234523[_0xe363('0x29')][_0xe363('0x15')]);}_0x8f6a76['order']=qs[_0xe363('0x46')](_0x234523[_0xe363('0x29')]['sort']);_0x8f6a76[_0xe363('0x27')]=qs[_0xe363('0x30')](_[_0xe363('0x47')](_0x234523[_0xe363('0x29')],_0x4aa733[_0xe363('0x30')]));_0x8f6a76[_0xe363('0x27')][_0xe363('0x48')]=_0x1a6c70['id'];if(_0x234523[_0xe363('0x29')][_0xe363('0x49')]){_0x8f6a76[_0xe363('0x27')]=_[_0xe363('0x35')](_0x8f6a76[_0xe363('0x27')],{'$or':_[_0xe363('0x22')](_0x8f6a76['attributes'],function(_0x58ba21){var _0x696718={};_0x696718[_0x58ba21]={'$like':'%'+_0x234523[_0xe363('0x29')][_0xe363('0x49')]+'%'};return _0x696718;})});}_0x8f6a76=_[_0xe363('0x35')]({},_0x8f6a76,_0x234523[_0xe363('0x36')]);return db[_0xe363('0x42')][_0xe363('0x4a')](_0x8f6a76);}})[_0xe363('0x18')](function(_0x418e00){if(_0x418e00){return db[_0xe363('0x4b')][_0xe363('0x4c')]({'where':{'id':_[_0xe363('0x22')](_0x418e00,_0xe363('0x4d')),'role':'agent'},'attributes':['id',_0xe363('0x1f'),_0xe363('0x4e'),_0xe363('0x4f'),'createdAt']});}})[_0xe363('0x18')](function(_0xd18c3c){if(_0xd18c3c){return{'count':_0xd18c3c[_0xe363('0x14')],'rows':_[_0xe363('0x22')](_0xd18c3c[_0xe363('0x2b')],function(_0x5cb808){return{'membername':_0x5cb808['name'],'UserId':_0x5cb808['id'],'queue_name':_0x28b38d[_0xe363('0x1f')],'FaxQueueId':_0x28b38d['id'],'interface':util['format'](_0xe363('0x50'),_0xe363('0x51'),_0x5cb808[_0xe363('0x1f')]),'penalty':0x0,'paused':_0x5cb808[_0xe363('0x4e')],'createdAt':_0x5cb808[_0xe363('0x52')],'updatedAt':_0x5cb808[_0xe363('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe363('0x18')](respondWithFilteredResult(_0x23d249,_0x8f6a76))[_0xe363('0x38')](handleError(_0x23d249,null));};exports[_0xe363('0x53')]=function(_0x1d6310,_0x436127){var _0x4dfef5={};var _0x3e3cb8={};var _0xc949cf;var _0xace979;return db['FaxQueue'][_0xe363('0x54')]({'where':{'id':_0x1d6310[_0xe363('0x2d')]['id']}})[_0xe363('0x18')](handleEntityNotFound(_0x436127,null))[_0xe363('0x18')](function(_0x24da3a){if(_0x24da3a){_0xc949cf=_0x24da3a;_0x3e3cb8[_0xe363('0x2e')]=_[_0xe363('0x2f')](db[_0xe363('0x55')][_0xe363('0x23')]);_0x3e3cb8[_0xe363('0x29')]=_[_0xe363('0x2f')](_0x1d6310['query']);_0x3e3cb8['filters']=_[_0xe363('0x31')](_0x3e3cb8['model'],_0x3e3cb8[_0xe363('0x29')]);_0x4dfef5[_0xe363('0x33')]=_[_0xe363('0x31')](_0x3e3cb8[_0xe363('0x2e')],qs['fields'](_0x1d6310['query']['fields']));_0x4dfef5[_0xe363('0x33')]=_0x4dfef5[_0xe363('0x33')][_0xe363('0x43')]?_0x4dfef5[_0xe363('0x33')]:_0x3e3cb8['model'];_0x4dfef5['order']=qs[_0xe363('0x46')](_0x1d6310['query'][_0xe363('0x46')]);_0x4dfef5[_0xe363('0x27')]=qs[_0xe363('0x30')](_[_0xe363('0x47')](_0x1d6310[_0xe363('0x29')],_0x3e3cb8[_0xe363('0x30')]));if(_0x1d6310[_0xe363('0x29')][_0xe363('0x49')]){_0x4dfef5['where']=_[_0xe363('0x35')](_0x4dfef5[_0xe363('0x27')],{'$or':_['map'](_0x4dfef5[_0xe363('0x33')],function(_0x5714f2){var _0x5272d3={};_0x5272d3[_0x5714f2]={'$like':'%'+_0x1d6310[_0xe363('0x29')]['filter']+'%'};return _0x5272d3;})});}_0x4dfef5=_[_0xe363('0x35')]({},_0x4dfef5,_0x1d6310[_0xe363('0x36')]);return _0xc949cf['getTeams'](_0x4dfef5);}})[_0xe363('0x18')](function(_0x3876fb){if(_0x3876fb){_0xace979=_0x3876fb[_0xe363('0x43')];if(!_0x1d6310[_0xe363('0x29')]['hasOwnProperty'](_0xe363('0x45'))){_0x4dfef5['limit']=qs['limit'](_0x1d6310[_0xe363('0x29')][_0xe363('0x13')]);_0x4dfef5[_0xe363('0x15')]=qs[_0xe363('0x15')](_0x1d6310[_0xe363('0x29')][_0xe363('0x15')]);}return _0xc949cf[_0xe363('0x53')](_0x4dfef5);}})[_0xe363('0x18')](function(_0x17ff56){if(_0x17ff56){return _0x17ff56?{'count':_0xace979,'rows':_0x17ff56}:null;}})[_0xe363('0x18')](respondWithResult(_0x436127,null))[_0xe363('0x38')](handleError(_0x436127,null));};exports[_0xe363('0x56')]=function(_0x5abaa5,_0x1ac3a8){var _0xad373c=_0x5abaa5[_0xe363('0x3a')][_0xe363('0x57')];return db[_0xe363('0x55')]['findAll']({'where':{'id':_0xad373c},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe363('0x58'),'attributes':['id',_0xe363('0x1f'),_0xe363('0x59'),_0xe363('0x5a'),_0xe363('0x5b')],'raw':!![]}]})[_0xe363('0x18')](function(_0x459807){if(_0x459807){var _0x445588=_['flatMap'](_0x459807,function(_0x379d16){var _0x3b3f63=_0x379d16[_0xe363('0x1a')]({'plain':!![]});return _0x3b3f63['Agents'];});return db['FaxQueue'][_0xe363('0x37')]({'where':{'id':_0x5abaa5['params']['id']}})['then'](function(_0x283104){return db[_0xe363('0x5c')][_0xe363('0x5d')](function(_0xa200e5){return _0x283104['addTeams'](_0xad373c,{'transaction':_0xa200e5})[_0xe363('0x18')](function(){return BPromise[_0xe363('0x5e')](_0x445588,function(_0x346c79){return db[_0xe363('0x42')][_0xe363('0x5f')]({'where':{'UserId':_0x346c79['id'],'FaxQueueId':_0x5abaa5[_0xe363('0x2d')]['id']},'transaction':_0xa200e5});});})['then'](function(){_0x445588[_0xe363('0x60')](function(_0x3404b4){socket[_0xe363('0x61')](_0xe363('0x62'),{'UserId':_0x3404b4['id'],'FaxQueueId':_0x283104['id']});});});});});}})['then'](respondWithStatusCode(_0x1ac3a8,null))[_0xe363('0x38')](handleError(_0x1ac3a8,null));};exports[_0xe363('0x63')]=function(_0x6937b6,_0x48be1b){return db['Team']['findAll']({'where':{'id':_0x6937b6[_0xe363('0x29')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe363('0x58'),'attributes':['id'],'raw':!![]}]})[_0xe363('0x18')](handleEntityNotFound(_0x48be1b,null))[_0xe363('0x18')](function(_0x170f63){var _0x7a1c97=_[_0xe363('0x22')](_0x170f63,'id');var _0xe9e6ce=[];var _0x4cf629=[];var _0x3f10a6=squel[_0xe363('0x64')]();_0x3f10a6[_0xe363('0x65')](_0xe363('0x66'))[_0xe363('0x67')](_0xe363('0x68'),'tq')['join'](_0xe363('0x69'),'ut',_0xe363('0x6a'))[_0xe363('0x27')]('FaxQueueId\x20=\x20?',_0x6937b6[_0xe363('0x2d')]['id']);for(var _0x5e1a3c=0x0;_0x5e1a3c<_0x170f63[_0xe363('0x43')];_0x5e1a3c+=0x1){let _0x23d7fb=_0x170f63[_0x5e1a3c];for(var _0x4f4628=0x0;_0x4f4628<_0x23d7fb[_0xe363('0x58')][_0xe363('0x43')];_0x4f4628+=0x1){let _0x2541f5=_0x23d7fb[_0xe363('0x58')][_0x4f4628];var _0xe4f7e9=_0x3f10a6[_0xe363('0x6b')]();_0xe4f7e9[_0xe363('0x27')](_0xe363('0x6c'),_0x2541f5['id']);_0x4cf629[_0xe363('0x6d')](db[_0xe363('0x5c')][_0xe363('0x29')](_0xe4f7e9[_0xe363('0x6e')](),{'type':db[_0xe363('0x5c')][_0xe363('0x6f')][_0xe363('0x70')]})[_0xe363('0x18')](function(_0x11c151){if(_0x11c151[_0xe363('0x43')]===0x1){return _0x2541f5['id'];}else{var _0x3aaa0d=_[_0xe363('0x71')](_[_0xe363('0x22')](_0x11c151,'TeamId'),function(_0x25a408){return _['includes'](_0x7a1c97,_0x25a408);});if(_0x3aaa0d){return _0x2541f5['id'];}}}));}}return BPromise[_0xe363('0x72')](_0x4cf629)[_0xe363('0x18')](function(_0x4f19b0){_0xe9e6ce=_(_0xe9e6ce)[_0xe363('0x73')](_0x4f19b0)[_0xe363('0x74')]()[_0xe363('0x75')]();return db[_0xe363('0x2a')][_0xe363('0x37')]({'where':{'id':_0x6937b6['params']['id']}})['then'](function(_0x1b689f){return db[_0xe363('0x5c')][_0xe363('0x5d')](function(_0x2ede84){return _0x1b689f[_0xe363('0x63')](_0x6937b6['query']['ids'],{'transaction':_0x2ede84})[_0xe363('0x18')](function(){if(!_['isEmpty'](_0xe9e6ce)){return _0x1b689f[_0xe363('0x76')](_0xe9e6ce,{'transaction':_0x2ede84});}})[_0xe363('0x18')](function(){_0xe9e6ce[_0xe363('0x60')](function(_0x17aec5){socket[_0xe363('0x61')](_0xe363('0x77'),{'UserId':_0x17aec5,'FaxQueueId':_0x1b689f['id']});});});});});});})[_0xe363('0x18')](respondWithStatusCode(_0x48be1b,null))[_0xe363('0x38')](handleError(_0x48be1b,null));};exports['addAgents']=function(_0x59a30f,_0x188fc3){return db[_0xe363('0x2a')][_0xe363('0x37')]({'where':{'id':_0x59a30f[_0xe363('0x2d')]['id']}})['then'](handleEntityNotFound(_0x188fc3,null))['then'](function(_0x11e504){if(_0x11e504){return _0x11e504[_0xe363('0x78')](_0x59a30f[_0xe363('0x3a')][_0xe363('0x57')],_[_0xe363('0x79')](_0x59a30f['body'],[_0xe363('0x57'),'id'])||{})['spread'](function(_0x9566f2){for(var _0x2197cb=0x0;_0x2197cb<_0x59a30f['body']['ids']['length'];_0x2197cb+=0x1){socket[_0xe363('0x61')](_0xe363('0x62'),{'UserId':Number(_0x59a30f[_0xe363('0x3a')]['ids'][_0x2197cb]),'FaxQueueId':Number(_0x59a30f[_0xe363('0x2d')]['id'])});}return _0x9566f2;});}})['then'](respondWithResult(_0x188fc3,null))[_0xe363('0x38')](handleError(_0x188fc3,null));};exports['removeAgents']=function(_0x279bb0,_0x440e33){return db[_0xe363('0x2a')][_0xe363('0x37')]({'where':{'id':_0x279bb0[_0xe363('0x2d')]['id']}})['then'](handleEntityNotFound(_0x440e33,null))[_0xe363('0x18')](function(_0x64257c){if(_0x64257c){return _0x64257c[_0xe363('0x76')](_0x279bb0[_0xe363('0x29')][_0xe363('0x57')])[_0xe363('0x18')](function(){if(_[_0xe363('0x7a')](_0x279bb0[_0xe363('0x29')][_0xe363('0x57')])){for(var _0x1059df=0x0;_0x1059df<_0x279bb0[_0xe363('0x29')][_0xe363('0x57')][_0xe363('0x43')];_0x1059df+=0x1){socket['emit'](_0xe363('0x77'),{'UserId':Number(_0x279bb0[_0xe363('0x29')][_0xe363('0x57')][_0x1059df]),'FaxQueueId':Number(_0x279bb0[_0xe363('0x2d')]['id'])});}}else{socket[_0xe363('0x61')](_0xe363('0x77'),{'UserId':Number(_0x279bb0['query']['ids']),'FaxQueueId':Number(_0x279bb0['params']['id'])});}});}})[_0xe363('0x18')](respondWithStatusCode(_0x440e33,null))[_0xe363('0x38')](handleError(_0x440e33,null));};exports[_0xe363('0x7b')]=function(_0x4419d6,_0x27ce3c){var _0x2b8bac={};var _0xf3ae80={};var _0x4e52e8;var _0xf661d0;return db[_0xe363('0x2a')]['findOne']({'where':{'id':_0x4419d6['params']['id']}})['then'](handleEntityNotFound(_0x27ce3c,null))[_0xe363('0x18')](function(_0x14837a){if(_0x14837a){_0x4e52e8=_0x14837a;_0xf3ae80[_0xe363('0x2e')]=_['keys'](db[_0xe363('0x4b')][_0xe363('0x23')]);_0xf3ae80[_0xe363('0x29')]=_[_0xe363('0x2f')](_0x4419d6[_0xe363('0x29')]);_0xf3ae80[_0xe363('0x30')]=_[_0xe363('0x31')](_0xf3ae80[_0xe363('0x2e')],_0xf3ae80[_0xe363('0x29')]);_0x2b8bac[_0xe363('0x33')]=_[_0xe363('0x31')](_0xf3ae80[_0xe363('0x2e')],qs['fields'](_0x4419d6[_0xe363('0x29')][_0xe363('0x32')]));_0x2b8bac[_0xe363('0x33')]=_0x2b8bac[_0xe363('0x33')][_0xe363('0x43')]?_0x2b8bac[_0xe363('0x33')]:_0xf3ae80['model'];_0x2b8bac[_0xe363('0x7c')]=qs[_0xe363('0x46')](_0x4419d6[_0xe363('0x29')][_0xe363('0x46')]);_0x2b8bac['where']=qs[_0xe363('0x30')](_[_0xe363('0x47')](_0x4419d6['query'],_0xf3ae80[_0xe363('0x30')]));if(_0x4419d6[_0xe363('0x29')][_0xe363('0x49')]){_0x2b8bac['where']=_[_0xe363('0x35')](_0x2b8bac['where'],{'$or':_['map'](_0x2b8bac['attributes'],function(_0x331fd6){var _0x4e516b={};_0x4e516b[_0x331fd6]={'$like':'%'+_0x4419d6[_0xe363('0x29')][_0xe363('0x49')]+'%'};return _0x4e516b;})});}_0x2b8bac=_[_0xe363('0x35')]({},_0x2b8bac,_0x4419d6[_0xe363('0x36')]);return _0x4e52e8[_0xe363('0x7b')](_0x2b8bac);}})['then'](function(_0x48caa8){if(_0x48caa8){_0xf661d0=_0x48caa8['length'];if(!_0x4419d6[_0xe363('0x29')][_0xe363('0x44')]('nolimit')){_0x2b8bac[_0xe363('0x13')]=qs[_0xe363('0x13')](_0x4419d6['query']['limit']);_0x2b8bac[_0xe363('0x15')]=qs[_0xe363('0x15')](_0x4419d6[_0xe363('0x29')][_0xe363('0x15')]);}return _0x4e52e8[_0xe363('0x7b')](_0x2b8bac);}})['then'](function(_0x57300c){if(_0x57300c){return _0x57300c?{'count':_0xf661d0,'rows':_0x57300c}:null;}})[_0xe363('0x18')](respondWithResult(_0x27ce3c,null))[_0xe363('0x38')](handleError(_0x27ce3c,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 7b53255..71553da 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 _0x7b8f=['remove','emit','hook','events','../../mysqldb','setMaxListeners','update'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7b8f,0x145));var _0xf7b8=function(_0x2884a7,_0x3efe41){_0x2884a7=_0x2884a7-0x0;var _0x513fd6=_0x7b8f[_0x2884a7];return _0x513fd6;};'use strict';var EventEmitter=require(_0xf7b8('0x0'));var FaxQueue=require(_0xf7b8('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xf7b8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf7b8('0x3'),'afterDestroy':_0xf7b8('0x4')};function emitEvent(_0x41a2d1){return function(_0x16207f,_0x1ffede,_0xcd4250){FaxQueueEvents[_0xf7b8('0x5')](_0x41a2d1+':'+_0x16207f['id'],_0x16207f);FaxQueueEvents[_0xf7b8('0x5')](_0x41a2d1,_0x16207f);_0xcd4250(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xf7b8('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x2bb4=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','save','update'];(function(_0x223e1a,_0x3e471b){var _0x4757bb=function(_0x2574f4){while(--_0x2574f4){_0x223e1a['push'](_0x223e1a['shift']());}};_0x4757bb(++_0x3e471b);}(_0x2bb4,0x18c));var _0x42bb=function(_0x509195,_0x100287){_0x509195=_0x509195-0x0;var _0x195357=_0x2bb4[_0x509195];return _0x195357;};'use strict';var EventEmitter=require(_0x42bb('0x0'));var FaxQueue=require(_0x42bb('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x42bb('0x2'),'afterUpdate':_0x42bb('0x3'),'afterDestroy':_0x42bb('0x4')};function emitEvent(_0x37ca6f){return function(_0x312e3a,_0x3b0951,_0x410806){FaxQueueEvents[_0x42bb('0x5')](_0x37ca6f+':'+_0x312e3a['id'],_0x312e3a);FaxQueueEvents[_0x42bb('0x5')](_0x37ca6f,_0x312e3a);_0x410806(null);};}for(var e in events){if(events[_0x42bb('0x6')](e)){var event=events[e];FaxQueue[_0x42bb('0x7')](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 c030808..28bc3ac 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 _0x4694=['rimraf','./faxQueue.attributes','exports','define','FaxQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5db2c6,_0x52cf81){var _0x214df5=function(_0x1e14a4){while(--_0x1e14a4){_0x5db2c6['push'](_0x5db2c6['shift']());}};_0x214df5(++_0x52cf81);}(_0x4694,0x17b));var _0x4469=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x4694[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x4469('0x0'));var util=require(_0x4469('0x1'));var logger=require(_0x4469('0x2'))(_0x4469('0x3'));var moment=require(_0x4469('0x4'));var BPromise=require(_0x4469('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4469('0x6'));var config=require('../../config/environment');var attributes=require(_0x4469('0x7'));module[_0x4469('0x8')]=function(_0x4efda,_0x7897e0){return _0x4efda[_0x4469('0x9')](_0x4469('0xa'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b13=['FaxQueue','fax_queues','lodash','util','api','bluebird','request-promise','path','../../config/environment','./faxQueue.attributes','exports','define'];(function(_0x5f46ff,_0x448bb3){var _0x4688c9=function(_0x214efe){while(--_0x214efe){_0x5f46ff['push'](_0x5f46ff['shift']());}};_0x4688c9(++_0x448bb3);}(_0x3b13,0xf2));var _0x33b1=function(_0x16d991,_0x3f07cc){_0x16d991=_0x16d991-0x0;var _0x4f41c3=_0x3b13[_0x16d991];return _0x4f41c3;};'use strict';var _=require(_0x33b1('0x0'));var util=require(_0x33b1('0x1'));var logger=require('../../config/logger')(_0x33b1('0x2'));var moment=require('moment');var BPromise=require(_0x33b1('0x3'));var rp=require(_0x33b1('0x4'));var fs=require('fs');var path=require(_0x33b1('0x5'));var rimraf=require('rimraf');var config=require(_0x33b1('0x6'));var attributes=require(_0x33b1('0x7'));module[_0x33b1('0x8')]=function(_0x26a8ee,_0x4dae2b){return _0x26a8ee[_0x33b1('0x9')](_0x33b1('0xa'),attributes,{'tableName':_0x33b1('0xb'),'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 9d01069..05cd992 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 _0x60de=['client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxQueue,\x20%s,\x20%s','result','catch','GetFaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','FaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x60de,0x1ef));var _0xe60d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x60de[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xe60d('0x0'));var util=require(_0xe60d('0x1'));var moment=require(_0xe60d('0x2'));var BPromise=require(_0xe60d('0x3'));var rs=require(_0xe60d('0x4'));var fs=require('fs');var Redis=require(_0xe60d('0x5'));var db=require(_0xe60d('0x6'))['db'];var utils=require(_0xe60d('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xe60d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe60d('0x9')][_0xe60d('0xa')]({'port':0x232a});config[_0xe60d('0xb')]=_[_0xe60d('0xc')](config['redis'],{'host':_0xe60d('0xd'),'port':0x18eb});var socket=require(_0xe60d('0xe'))(new Redis(config[_0xe60d('0xb')]));require('./faxQueue.socket')[_0xe60d('0xf')](socket);function respondWithRpcPromise(_0x5c4462,_0x39f77b,_0x5c608c){return new BPromise(function(_0xc236b,_0x2bd955){return client[_0xe60d('0x10')](_0x5c4462,_0x5c608c)[_0xe60d('0x11')](function(_0x34d62b){logger[_0xe60d('0x12')]('FaxQueue,\x20%s,\x20%s',_0x39f77b,_0xe60d('0x13'));logger[_0xe60d('0x14')](_0xe60d('0x15'),_0x39f77b,_0xe60d('0x13'),JSON[_0xe60d('0x16')](_0x34d62b));if(_0x34d62b[_0xe60d('0x17')]){if(_0x34d62b[_0xe60d('0x17')][_0xe60d('0x18')]===0x1f4){logger[_0xe60d('0x17')]('FaxQueue,\x20%s,\x20%s',_0x39f77b,_0x34d62b[_0xe60d('0x17')]['message']);return _0x2bd955(_0x34d62b[_0xe60d('0x17')][_0xe60d('0x19')]);}logger[_0xe60d('0x17')](_0xe60d('0x1a'),_0x39f77b,_0x34d62b[_0xe60d('0x17')][_0xe60d('0x19')]);return _0xc236b(_0x34d62b['error']['message']);}else{logger[_0xe60d('0x12')]('FaxQueue,\x20%s,\x20%s',_0x39f77b,_0xe60d('0x13'));_0xc236b(_0x34d62b[_0xe60d('0x1b')][_0xe60d('0x19')]);}})[_0xe60d('0x1c')](function(_0x5c1ba7){logger[_0xe60d('0x17')]('FaxQueue,\x20%s,\x20%s',_0x39f77b,_0x5c1ba7);_0x2bd955(_0x5c1ba7);});});}exports[_0xe60d('0x1d')]=function(_0x451821){var _0x58ceb3=this;return new Promise(function(_0x59510c,_0x22f34d){return db['FaxQueue'][_0xe60d('0x1e')]({'raw':_0x451821[_0xe60d('0x1f')]?_0x451821['options'][_0xe60d('0x20')]===undefined?!![]:![]:!![],'where':_0x451821['options']?_0x451821[_0xe60d('0x1f')][_0xe60d('0x21')]||null:null,'attributes':_0x451821[_0xe60d('0x1f')]?_0x451821[_0xe60d('0x1f')][_0xe60d('0x22')]||null:null,'limit':_0x451821[_0xe60d('0x1f')]?_0x451821['options'][_0xe60d('0x23')]||null:null,'include':_0x451821[_0xe60d('0x1f')]?_0x451821['options'][_0xe60d('0x24')]?_[_0xe60d('0x25')](_0x451821[_0xe60d('0x1f')]['include'],function(_0x2a3997){return{'model':db[_0x2a3997[_0xe60d('0x26')]],'as':_0x2a3997['as'],'attributes':_0x2a3997[_0xe60d('0x22')],'include':_0x2a3997['include']?_[_0xe60d('0x25')](_0x2a3997['include'],function(_0x8e35e8){return{'model':db[_0x8e35e8[_0xe60d('0x26')]],'as':_0x8e35e8['as'],'attributes':_0x8e35e8[_0xe60d('0x22')],'include':_0x8e35e8[_0xe60d('0x24')]?_['map'](_0x8e35e8[_0xe60d('0x24')],function(_0x233e68){return{'model':db[_0x233e68[_0xe60d('0x26')]],'as':_0x233e68['as'],'attributes':_0x233e68[_0xe60d('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe60d('0x11')](function(_0x28e349){logger[_0xe60d('0x12')](_0xe60d('0x1d'),_0x451821);logger[_0xe60d('0x14')](_0xe60d('0x1d'),_0x451821,JSON[_0xe60d('0x16')](_0x28e349));_0x59510c(_0x28e349);})['catch'](function(_0x1a99e8){logger[_0xe60d('0x17')]('GetFaxQueue',_0x1a99e8[_0xe60d('0x19')],_0x451821);_0x22f34d(_0x58ceb3[_0xe60d('0x17')](0x1f4,_0x1a99e8[_0xe60d('0x19')]));});});};exports[_0xe60d('0x27')]=function(_0x1ce1d1){var _0x5c1bef=this;return new Promise(function(_0x12d519,_0xba12b9){return db[_0xe60d('0x28')][_0xe60d('0x29')]({'raw':_0x1ce1d1[_0xe60d('0x1f')]?_0x1ce1d1[_0xe60d('0x1f')][_0xe60d('0x20')]===undefined?!![]:![]:!![],'where':_0x1ce1d1[_0xe60d('0x1f')]?_0x1ce1d1[_0xe60d('0x1f')]['where']||null:null,'attributes':_0x1ce1d1[_0xe60d('0x1f')]?_0x1ce1d1[_0xe60d('0x1f')][_0xe60d('0x22')]||null:null,'include':_0x1ce1d1['options']?_0x1ce1d1[_0xe60d('0x1f')][_0xe60d('0x24')]?_[_0xe60d('0x25')](_0x1ce1d1['options'][_0xe60d('0x24')],function(_0x2db62f){return{'model':db[_0x2db62f[_0xe60d('0x26')]],'as':_0x2db62f['as'],'attributes':_0x2db62f[_0xe60d('0x22')],'include':_0x2db62f['include']?_[_0xe60d('0x25')](_0x2db62f['include'],function(_0x16ec44){return{'model':db[_0x16ec44[_0xe60d('0x26')]],'as':_0x16ec44['as'],'attributes':_0x16ec44[_0xe60d('0x22')],'include':_0x16ec44[_0xe60d('0x24')]?_[_0xe60d('0x25')](_0x16ec44[_0xe60d('0x24')],function(_0x14c9e6){return{'model':db[_0x14c9e6[_0xe60d('0x26')]],'as':_0x14c9e6['as'],'attributes':_0x14c9e6[_0xe60d('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe60d('0x11')](function(_0x73eb5d){logger[_0xe60d('0x12')](_0xe60d('0x27'),_0x1ce1d1);logger[_0xe60d('0x14')](_0xe60d('0x27'),_0x1ce1d1,JSON[_0xe60d('0x16')](_0x73eb5d));_0x12d519(_0x73eb5d);})['catch'](function(_0x49c104){logger['error'](_0xe60d('0x27'),_0x49c104[_0xe60d('0x19')],_0x1ce1d1);_0xba12b9(_0x5c1bef['error'](0x1f4,_0x49c104[_0xe60d('0x19')]));});});}; \ No newline at end of file +var _0xa685=['model','stringify','ShowFaxQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','raw','options','attributes','map','include'];(function(_0x1b99d4,_0x393a85){var _0x5e27a4=function(_0x11af05){while(--_0x11af05){_0x1b99d4['push'](_0x1b99d4['shift']());}};_0x5e27a4(++_0x393a85);}(_0xa685,0x12b));var _0x5a68=function(_0x352d28,_0x444033){_0x352d28=_0x352d28-0x0;var _0x387d7e=_0xa685[_0x352d28];return _0x387d7e;};'use strict';var _=require(_0x5a68('0x0'));var util=require(_0x5a68('0x1'));var moment=require(_0x5a68('0x2'));var BPromise=require(_0x5a68('0x3'));var rs=require(_0x5a68('0x4'));var fs=require('fs');var Redis=require(_0x5a68('0x5'));var db=require(_0x5a68('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a68('0x7'))(_0x5a68('0x8'));var config=require(_0x5a68('0x9'));var jayson=require(_0x5a68('0xa'));var client=jayson[_0x5a68('0xb')]['http']({'port':0x232a});config[_0x5a68('0xc')]=_[_0x5a68('0xd')](config[_0x5a68('0xc')],{'host':_0x5a68('0xe'),'port':0x18eb});var socket=require(_0x5a68('0xf'))(new Redis(config[_0x5a68('0xc')]));require('./faxQueue.socket')[_0x5a68('0x10')](socket);function respondWithRpcPromise(_0x50624d,_0x285f9b,_0x4fbacf){return new BPromise(function(_0x18d081,_0x4b1a4e){return client[_0x5a68('0x11')](_0x50624d,_0x4fbacf)[_0x5a68('0x12')](function(_0x41f1c7){logger[_0x5a68('0x13')](_0x5a68('0x14'),_0x285f9b,_0x5a68('0x15'));logger[_0x5a68('0x16')](_0x5a68('0x17'),_0x285f9b,_0x5a68('0x15'),JSON['stringify'](_0x41f1c7));if(_0x41f1c7[_0x5a68('0x18')]){if(_0x41f1c7[_0x5a68('0x18')][_0x5a68('0x19')]===0x1f4){logger[_0x5a68('0x18')](_0x5a68('0x14'),_0x285f9b,_0x41f1c7[_0x5a68('0x18')][_0x5a68('0x1a')]);return _0x4b1a4e(_0x41f1c7['error'][_0x5a68('0x1a')]);}logger[_0x5a68('0x18')]('FaxQueue,\x20%s,\x20%s',_0x285f9b,_0x41f1c7[_0x5a68('0x18')][_0x5a68('0x1a')]);return _0x18d081(_0x41f1c7['error'][_0x5a68('0x1a')]);}else{logger[_0x5a68('0x13')](_0x5a68('0x14'),_0x285f9b,_0x5a68('0x15'));_0x18d081(_0x41f1c7[_0x5a68('0x1b')]['message']);}})[_0x5a68('0x1c')](function(_0xa9a749){logger[_0x5a68('0x18')](_0x5a68('0x14'),_0x285f9b,_0xa9a749);_0x4b1a4e(_0xa9a749);});});}exports[_0x5a68('0x1d')]=function(_0x654c02){var _0x3a0d87=this;return new Promise(function(_0x4aa404,_0x19649d){return db[_0x5a68('0x1e')][_0x5a68('0x1f')]({'raw':_0x654c02['options']?_0x654c02['options'][_0x5a68('0x20')]===undefined?!![]:![]:!![],'where':_0x654c02['options']?_0x654c02['options']['where']||null:null,'attributes':_0x654c02[_0x5a68('0x21')]?_0x654c02[_0x5a68('0x21')][_0x5a68('0x22')]||null:null,'limit':_0x654c02[_0x5a68('0x21')]?_0x654c02['options']['limit']||null:null,'include':_0x654c02[_0x5a68('0x21')]?_0x654c02[_0x5a68('0x21')]['include']?_[_0x5a68('0x23')](_0x654c02[_0x5a68('0x21')][_0x5a68('0x24')],function(_0x2f5b86){return{'model':db[_0x2f5b86[_0x5a68('0x25')]],'as':_0x2f5b86['as'],'attributes':_0x2f5b86[_0x5a68('0x22')],'include':_0x2f5b86['include']?_[_0x5a68('0x23')](_0x2f5b86[_0x5a68('0x24')],function(_0x313c18){return{'model':db[_0x313c18[_0x5a68('0x25')]],'as':_0x313c18['as'],'attributes':_0x313c18[_0x5a68('0x22')],'include':_0x313c18[_0x5a68('0x24')]?_[_0x5a68('0x23')](_0x313c18['include'],function(_0x2035a0){return{'model':db[_0x2035a0['model']],'as':_0x2035a0['as'],'attributes':_0x2035a0[_0x5a68('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x310fd1){logger[_0x5a68('0x13')](_0x5a68('0x1d'),_0x654c02);logger[_0x5a68('0x16')](_0x5a68('0x1d'),_0x654c02,JSON[_0x5a68('0x26')](_0x310fd1));_0x4aa404(_0x310fd1);})[_0x5a68('0x1c')](function(_0x3c6f61){logger[_0x5a68('0x18')](_0x5a68('0x1d'),_0x3c6f61[_0x5a68('0x1a')],_0x654c02);_0x19649d(_0x3a0d87[_0x5a68('0x18')](0x1f4,_0x3c6f61['message']));});});};exports[_0x5a68('0x27')]=function(_0x555e8c){var _0x555dca=this;return new Promise(function(_0x3b706c,_0x51bf28){return db[_0x5a68('0x1e')][_0x5a68('0x28')]({'raw':_0x555e8c[_0x5a68('0x21')]?_0x555e8c[_0x5a68('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x555e8c[_0x5a68('0x21')]?_0x555e8c['options'][_0x5a68('0x29')]||null:null,'attributes':_0x555e8c[_0x5a68('0x21')]?_0x555e8c[_0x5a68('0x21')]['attributes']||null:null,'include':_0x555e8c['options']?_0x555e8c[_0x5a68('0x21')][_0x5a68('0x24')]?_[_0x5a68('0x23')](_0x555e8c[_0x5a68('0x21')][_0x5a68('0x24')],function(_0x23b214){return{'model':db[_0x23b214[_0x5a68('0x25')]],'as':_0x23b214['as'],'attributes':_0x23b214[_0x5a68('0x22')],'include':_0x23b214[_0x5a68('0x24')]?_['map'](_0x23b214[_0x5a68('0x24')],function(_0x3f1800){return{'model':db[_0x3f1800['model']],'as':_0x3f1800['as'],'attributes':_0x3f1800[_0x5a68('0x22')],'include':_0x3f1800[_0x5a68('0x24')]?_['map'](_0x3f1800[_0x5a68('0x24')],function(_0x27013b){return{'model':db[_0x27013b[_0x5a68('0x25')]],'as':_0x27013b['as'],'attributes':_0x27013b[_0x5a68('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x802b5b){logger[_0x5a68('0x13')]('ShowFaxQueue',_0x555e8c);logger[_0x5a68('0x16')]('ShowFaxQueue',_0x555e8c,JSON[_0x5a68('0x26')](_0x802b5b));_0x3b706c(_0x802b5b);})[_0x5a68('0x1c')](function(_0x4b5f8f){logger['error'](_0x5a68('0x27'),_0x4b5f8f[_0x5a68('0x1a')],_0x555e8c);_0x51bf28(_0x555dca[_0x5a68('0x18')](0x1f4,_0x4b5f8f[_0x5a68('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 4ee2885..0e16482 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 _0x0ae1=['removeListener','register','./faxQueue.events','save','remove','update','emit'];(function(_0x5af410,_0x4e9ee4){var _0x170c35=function(_0x57c0f6){while(--_0x57c0f6){_0x5af410['push'](_0x5af410['shift']());}};_0x170c35(++_0x4e9ee4);}(_0x0ae1,0x167));var _0x10ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ae1[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require(_0x10ae('0x0'));var events=[_0x10ae('0x1'),_0x10ae('0x2'),_0x10ae('0x3')];function createListener(_0x5e001c,_0x40767b){return function(_0x123ee8){_0x40767b[_0x10ae('0x4')](_0x5e001c,_0x123ee8);};}function removeListener(_0x2b23dd,_0x2cc5fe){return function(){FaxQueueEvents[_0x10ae('0x5')](_0x2b23dd,_0x2cc5fe);};}exports[_0x10ae('0x6')]=function(_0x4fda2f){for(var _0x202602=0x0,_0x3402f6=events['length'];_0x202602<_0x3402f6;_0x202602++){var _0x4bc33d=events[_0x202602];var _0x558ff0=createListener('faxQueue:'+_0x4bc33d,_0x4fda2f);FaxQueueEvents['on'](_0x4bc33d,_0x558ff0);}}; \ No newline at end of file +var _0x3a7e=['update','emit','removeListener','register','length','faxQueue:','./faxQueue.events'];(function(_0x1a1667,_0x2224b1){var _0x45a134=function(_0x362be7){while(--_0x362be7){_0x1a1667['push'](_0x1a1667['shift']());}};_0x45a134(++_0x2224b1);}(_0x3a7e,0x1cd));var _0xe3a7=function(_0x151381,_0x97b314){_0x151381=_0x151381-0x0;var _0x2afab6=_0x3a7e[_0x151381];return _0x2afab6;};'use strict';var FaxQueueEvents=require(_0xe3a7('0x0'));var events=['save','remove',_0xe3a7('0x1')];function createListener(_0x378da0,_0x1dd5c8){return function(_0x11cc66){_0x1dd5c8[_0xe3a7('0x2')](_0x378da0,_0x11cc66);};}function removeListener(_0x354b99,_0x3a599f){return function(){FaxQueueEvents[_0xe3a7('0x3')](_0x354b99,_0x3a599f);};}exports[_0xe3a7('0x4')]=function(_0x1dfd5e){for(var _0x1c015d=0x0,_0x1b64e8=events[_0xe3a7('0x5')];_0x1c015d<_0x1b64e8;_0x1c015d++){var _0x119dd7=events[_0x1c015d];var _0x253660=createListener(_0xe3a7('0x6')+_0x119dd7,_0x1dfd5e);FaxQueueEvents['on'](_0x119dd7,_0x253660);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index bb20686..71b22e9 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 _0xc0d7=['get','index','/describe','isAuthenticated','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','update','destroy','delete','removeTeams','removeAgents','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller'];(function(_0x2d2e85,_0x22faa9){var _0x3e9f5e=function(_0x101c22){while(--_0x101c22){_0x2d2e85['push'](_0x2d2e85['shift']());}};_0x3e9f5e(++_0x22faa9);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x5e7a80,_0x2a7d00){_0x5e7a80=_0x5e7a80-0x0;var _0xf21fcb=_0xc0d7[_0x5e7a80];return _0xf21fcb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7c0d('0x0'));var express=require(_0x7c0d('0x1'));var router=express[_0x7c0d('0x2')]();var fs_extra=require(_0x7c0d('0x3'));var auth=require(_0x7c0d('0x4'));var interaction=require(_0x7c0d('0x5'));var config=require(_0x7c0d('0x6'));var controller=require(_0x7c0d('0x7'));router[_0x7c0d('0x8')]('/',auth['isAuthenticated'](),controller[_0x7c0d('0x9')]);router[_0x7c0d('0x8')](_0x7c0d('0xa'),auth[_0x7c0d('0xb')](),controller['describe']);router[_0x7c0d('0x8')](_0x7c0d('0xc'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0xd')]);router['get'](_0x7c0d('0xe'),auth[_0x7c0d('0xb')](),controller['getMembers']);router['get'](_0x7c0d('0xf'),auth[_0x7c0d('0xb')](),controller['getTeams']);router[_0x7c0d('0x8')](_0x7c0d('0x10'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x11')]);router[_0x7c0d('0x12')]('/',auth[_0x7c0d('0xb')](),controller['create']);router[_0x7c0d('0x12')](_0x7c0d('0xf'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x13')]);router[_0x7c0d('0x12')](_0x7c0d('0x10'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x14')]);router['put'](_0x7c0d('0xc'),auth['isAuthenticated'](),controller[_0x7c0d('0x15')]);router['delete'](_0x7c0d('0xc'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x16')]);router[_0x7c0d('0x17')](_0x7c0d('0xf'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x18')]);router[_0x7c0d('0x17')](_0x7c0d('0x10'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x19')]);module[_0x7c0d('0x1a')]=router; \ No newline at end of file +var _0x77d4=['getTeams','/:id/users','create','/:id/teams','addAgents','put','/:id','update','delete','removeTeams','removeAgents','util','connect-timeout','Router','fs-extra','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','describe','show','/:id/members'];(function(_0x5308ff,_0x593ed4){var _0x38e643=function(_0x248dc5){while(--_0x248dc5){_0x5308ff['push'](_0x5308ff['shift']());}};_0x38e643(++_0x593ed4);}(_0x77d4,0x108));var _0x477d=function(_0x551c89,_0x49d911){_0x551c89=_0x551c89-0x0;var _0x220e4a=_0x77d4[_0x551c89];return _0x220e4a;};'use strict';var multer=require('multer');var util=require(_0x477d('0x0'));var path=require('path');var timeout=require(_0x477d('0x1'));var express=require('express');var router=express[_0x477d('0x2')]();var fs_extra=require(_0x477d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x477d('0x4'));var controller=require(_0x477d('0x5'));router[_0x477d('0x6')]('/',auth[_0x477d('0x7')](),controller[_0x477d('0x8')]);router[_0x477d('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x477d('0x9')]);router['get']('/:id',auth[_0x477d('0x7')](),controller[_0x477d('0xa')]);router[_0x477d('0x6')](_0x477d('0xb'),auth[_0x477d('0x7')](),controller['getMembers']);router[_0x477d('0x6')]('/:id/teams',auth[_0x477d('0x7')](),controller[_0x477d('0xc')]);router['get'](_0x477d('0xd'),auth[_0x477d('0x7')](),controller['getAgents']);router['post']('/',auth[_0x477d('0x7')](),controller[_0x477d('0xe')]);router['post'](_0x477d('0xf'),auth[_0x477d('0x7')](),controller['addTeams']);router['post'](_0x477d('0xd'),auth['isAuthenticated'](),controller[_0x477d('0x10')]);router[_0x477d('0x11')](_0x477d('0x12'),auth['isAuthenticated'](),controller[_0x477d('0x13')]);router[_0x477d('0x14')](_0x477d('0x12'),auth[_0x477d('0x7')](),controller['destroy']);router[_0x477d('0x14')]('/:id/teams',auth[_0x477d('0x7')](),controller[_0x477d('0x15')]);router[_0x477d('0x14')](_0x477d('0xd'),auth[_0x477d('0x7')](),controller[_0x477d('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index a783d33..5ccaa4f 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 _0xf0c2=['STRING','DATE','sequelize','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xf0c2,0x6e));var _0x2f0c=function(_0x1a5a12,_0x3ca984){_0x1a5a12=_0x1a5a12-0x0;var _0x323d05=_0xf0c2[_0x1a5a12];return _0x323d05;};'use strict';var moment=require('moment');var Sequelize=require(_0x2f0c('0x0'));module[_0x2f0c('0x1')]={'uniqueid':{'type':Sequelize[_0x2f0c('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2f0c('0x2')]},'joinAt':{'type':Sequelize[_0x2f0c('0x3')]},'leaveAt':{'type':Sequelize[_0x2f0c('0x3')]},'acceptAt':{'type':Sequelize[_0x2f0c('0x3')]},'exitAt':{'type':Sequelize[_0x2f0c('0x3')]},'reason':{'type':Sequelize[_0x2f0c('0x2')]}}; \ No newline at end of file +var _0xa169=['DATE','moment','sequelize','STRING'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0xa169,0x1ed));var _0x9a16=function(_0x2a8781,_0x11ae3d){_0x2a8781=_0x2a8781-0x0;var _0x4831e3=_0xa169[_0x2a8781];return _0x4831e3;};'use strict';var moment=require(_0x9a16('0x0'));var Sequelize=require(_0x9a16('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x9a16('0x2')]},'joinAt':{'type':Sequelize[_0x9a16('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x9a16('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 09d6261..bbb2999 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 _0xee53=['where','merge','map','VIRTUAL','filter','includeAll','catch','params','include','options','create','body','find','describe','zip-dir','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xee53,0xa8));var _0x3ee5=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xee53[_0x2db12b];return _0x20990b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3ee5('0x0'));var jsonpatch=require(_0x3ee5('0x1'));var rp=require(_0x3ee5('0x2'));var moment=require('moment');var BPromise=require(_0x3ee5('0x3'));var Mustache=require(_0x3ee5('0x4'));var util=require(_0x3ee5('0x5'));var path=require(_0x3ee5('0x6'));var sox=require(_0x3ee5('0x7'));var csv=require(_0x3ee5('0x8'));var ejs=require(_0x3ee5('0x9'));var fs=require('fs');var fs_extra=require(_0x3ee5('0xa'));var _=require(_0x3ee5('0xb'));var squel=require(_0x3ee5('0xc'));var crypto=require(_0x3ee5('0xd'));var jsforce=require(_0x3ee5('0xe'));var deskjs=require(_0x3ee5('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3ee5('0x10'));var Papa=require(_0x3ee5('0x11'));var Redis=require(_0x3ee5('0x12'));var authService=require(_0x3ee5('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3ee5('0x14'));var hardwareService=require(_0x3ee5('0x15'));var logger=require(_0x3ee5('0x16'))(_0x3ee5('0x17'));var utils=require('../../config/utils');var config=require(_0x3ee5('0x18'));var licenseUtil=require(_0x3ee5('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbf85a3,_0x509a41){_0x509a41=_0x509a41||0xcc;return function(_0x10da9f){if(_0x10da9f){return _0xbf85a3['sendStatus'](_0x509a41);}return _0xbf85a3['status'](_0x509a41)[_0x3ee5('0x1a')]();};}function respondWithResult(_0x27816b,_0x244ca2){_0x244ca2=_0x244ca2||0xc8;return function(_0x21c9b6){if(_0x21c9b6){return _0x27816b[_0x3ee5('0x1b')](_0x244ca2)[_0x3ee5('0x1c')](_0x21c9b6);}};}function respondWithFilteredResult(_0x3ee06d,_0x1452b5){return function(_0x4023a9){if(_0x4023a9){var _0x5568f3=typeof _0x1452b5[_0x3ee5('0x1d')]==='undefined'&&typeof _0x1452b5[_0x3ee5('0x1e')]===_0x3ee5('0x1f');var _0x245aa9=_0x4023a9[_0x3ee5('0x20')];var _0x3a7356=_0x5568f3?0x0:_0x1452b5[_0x3ee5('0x1d')];var _0x6a8b6b=_0x5568f3?_0x4023a9['count']:_0x1452b5[_0x3ee5('0x1d')]+_0x1452b5[_0x3ee5('0x1e')];var _0x150187;if(_0x6a8b6b>=_0x245aa9){_0x6a8b6b=_0x245aa9;_0x150187=0xc8;}else{_0x150187=0xce;}_0x3ee06d[_0x3ee5('0x1b')](_0x150187);return _0x3ee06d['set'](_0x3ee5('0x21'),_0x3a7356+'-'+_0x6a8b6b+'/'+_0x245aa9)[_0x3ee5('0x1c')](_0x4023a9);}return null;};}function patchUpdates(_0x203a60){return function(_0xa872c4){try{jsonpatch[_0x3ee5('0x22')](_0xa872c4,_0x203a60,!![]);}catch(_0x5d6c3e){return BPromise[_0x3ee5('0x23')](_0x5d6c3e);}return _0xa872c4[_0x3ee5('0x24')]();};}function saveUpdates(_0x591bde,_0x4a3b83){return function(_0x1b5139){if(_0x1b5139){return _0x1b5139[_0x3ee5('0x25')](_0x591bde)[_0x3ee5('0x26')](function(_0x4f3d8c){return _0x4f3d8c;});}return null;};}function removeEntity(_0x1f5871,_0x4d7114){return function(_0x318c36){if(_0x318c36){return _0x318c36[_0x3ee5('0x27')]()['then'](function(){_0x1f5871[_0x3ee5('0x1b')](0xcc)[_0x3ee5('0x1a')]();});}};}function handleEntityNotFound(_0x31d980,_0x11db5c){return function(_0x388b58){if(!_0x388b58){_0x31d980[_0x3ee5('0x28')](0x194);}return _0x388b58;};}function handleError(_0x2e0794,_0x482593){_0x482593=_0x482593||0x1f4;return function(_0x415f50){logger[_0x3ee5('0x29')](_0x415f50[_0x3ee5('0x2a')]);if(_0x415f50['name']){delete _0x415f50[_0x3ee5('0x2b')];}_0x2e0794['status'](_0x482593)[_0x3ee5('0x2c')](_0x415f50);};}exports[_0x3ee5('0x2d')]=function(_0x2ec4ac,_0x47f620){var _0xb8f45f={},_0x10cd45={},_0x44faa4={'count':0x0,'rows':[]};var _0x1b7356=_['map'](db[_0x3ee5('0x2e')][_0x3ee5('0x2f')],function(_0x3f4cd2){return{'name':_0x3f4cd2[_0x3ee5('0x30')],'type':_0x3f4cd2[_0x3ee5('0x31')]['key']};});_0x10cd45[_0x3ee5('0x32')]=_['map'](_0x1b7356,'name');_0x10cd45[_0x3ee5('0x33')]=_[_0x3ee5('0x34')](_0x2ec4ac[_0x3ee5('0x33')]);_0x10cd45['filters']=_[_0x3ee5('0x35')](_0x10cd45[_0x3ee5('0x32')],_0x10cd45[_0x3ee5('0x33')]);_0xb8f45f[_0x3ee5('0x36')]=_['intersection'](_0x10cd45[_0x3ee5('0x32')],qs[_0x3ee5('0x37')](_0x2ec4ac[_0x3ee5('0x33')][_0x3ee5('0x37')]));_0xb8f45f[_0x3ee5('0x36')]=_0xb8f45f[_0x3ee5('0x36')][_0x3ee5('0x38')]?_0xb8f45f[_0x3ee5('0x36')]:_0x10cd45[_0x3ee5('0x32')];if(!_0x2ec4ac['query'][_0x3ee5('0x39')](_0x3ee5('0x3a'))){_0xb8f45f[_0x3ee5('0x1e')]=qs[_0x3ee5('0x1e')](_0x2ec4ac[_0x3ee5('0x33')][_0x3ee5('0x1e')]);_0xb8f45f[_0x3ee5('0x1d')]=qs[_0x3ee5('0x1d')](_0x2ec4ac[_0x3ee5('0x33')][_0x3ee5('0x1d')]);}_0xb8f45f[_0x3ee5('0x3b')]=qs['sort'](_0x2ec4ac['query'][_0x3ee5('0x3c')]);_0xb8f45f['where']=qs[_0x3ee5('0x3d')](_[_0x3ee5('0x3e')](_0x2ec4ac['query'],_0x10cd45[_0x3ee5('0x3d')]),_0x1b7356);if(_0x2ec4ac[_0x3ee5('0x33')]['filter']){_0xb8f45f[_0x3ee5('0x3f')]=_[_0x3ee5('0x40')](_0xb8f45f[_0x3ee5('0x3f')],{'$or':_[_0x3ee5('0x41')](_0x1b7356,function(_0x546109){if(_0x546109[_0x3ee5('0x31')]!==_0x3ee5('0x42')){var _0x4a3da8={};_0x4a3da8[_0x546109['name']]={'$like':'%'+_0x2ec4ac[_0x3ee5('0x33')][_0x3ee5('0x43')]+'%'};return _0x4a3da8;}})});}_0xb8f45f=_[_0x3ee5('0x40')]({},_0xb8f45f,_0x2ec4ac['options']);var _0x2afec2={'where':_0xb8f45f['where']};return db[_0x3ee5('0x2e')][_0x3ee5('0x20')](_0x2afec2)['then'](function(_0x1e9206){_0x44faa4[_0x3ee5('0x20')]=_0x1e9206;if(_0x2ec4ac[_0x3ee5('0x33')][_0x3ee5('0x44')]){_0xb8f45f['include']=[{'all':!![]}];}return db[_0x3ee5('0x2e')]['findAll'](_0xb8f45f);})[_0x3ee5('0x26')](function(_0x3c8565){_0x44faa4['rows']=_0x3c8565;return _0x44faa4;})[_0x3ee5('0x26')](respondWithFilteredResult(_0x47f620,_0xb8f45f))[_0x3ee5('0x45')](handleError(_0x47f620,null));};exports['show']=function(_0x4fac0f,_0x397de2){var _0x3badab={'raw':!![],'where':{'id':_0x4fac0f[_0x3ee5('0x46')]['id']}},_0x368871={};_0x368871['model']=_['keys'](db['FaxQueueReport'][_0x3ee5('0x2f')]);_0x368871['query']=_[_0x3ee5('0x34')](_0x4fac0f[_0x3ee5('0x33')]);_0x368871['filters']=_[_0x3ee5('0x35')](_0x368871[_0x3ee5('0x32')],_0x368871[_0x3ee5('0x33')]);_0x3badab[_0x3ee5('0x36')]=_['intersection'](_0x368871[_0x3ee5('0x32')],qs[_0x3ee5('0x37')](_0x4fac0f['query'][_0x3ee5('0x37')]));_0x3badab[_0x3ee5('0x36')]=_0x3badab[_0x3ee5('0x36')][_0x3ee5('0x38')]?_0x3badab[_0x3ee5('0x36')]:_0x368871[_0x3ee5('0x32')];if(_0x4fac0f[_0x3ee5('0x33')][_0x3ee5('0x44')]){_0x3badab[_0x3ee5('0x47')]=[{'all':!![]}];}_0x3badab=_[_0x3ee5('0x40')]({},_0x3badab,_0x4fac0f[_0x3ee5('0x48')]);return db['FaxQueueReport']['find'](_0x3badab)[_0x3ee5('0x26')](handleEntityNotFound(_0x397de2,null))['then'](respondWithResult(_0x397de2,null))[_0x3ee5('0x45')](handleError(_0x397de2,null));};exports[_0x3ee5('0x49')]=function(_0x441fee,_0x1d8cdb){return db[_0x3ee5('0x2e')]['create'](_0x441fee[_0x3ee5('0x4a')],{})[_0x3ee5('0x26')](respondWithResult(_0x1d8cdb,0xc9))[_0x3ee5('0x45')](handleError(_0x1d8cdb,null));};exports[_0x3ee5('0x25')]=function(_0x57c738,_0x1b4bef){if(_0x57c738[_0x3ee5('0x4a')]['id']){delete _0x57c738[_0x3ee5('0x4a')]['id'];}return db[_0x3ee5('0x2e')][_0x3ee5('0x4b')]({'where':{'id':_0x57c738[_0x3ee5('0x46')]['id']}})[_0x3ee5('0x26')](handleEntityNotFound(_0x1b4bef,null))[_0x3ee5('0x26')](saveUpdates(_0x57c738[_0x3ee5('0x4a')],null))[_0x3ee5('0x26')](respondWithResult(_0x1b4bef,null))[_0x3ee5('0x45')](handleError(_0x1b4bef,null));};exports[_0x3ee5('0x27')]=function(_0x240e6f,_0x576461){return db[_0x3ee5('0x2e')][_0x3ee5('0x4b')]({'where':{'id':_0x240e6f[_0x3ee5('0x46')]['id']}})['then'](handleEntityNotFound(_0x576461,null))[_0x3ee5('0x26')](removeEntity(_0x576461,null))[_0x3ee5('0x45')](handleError(_0x576461,null));};exports[_0x3ee5('0x4c')]=function(_0x765394,_0x23669f){return db['FaxQueueReport']['describe']()[_0x3ee5('0x26')](respondWithResult(_0x23669f,null))[_0x3ee5('0x45')](handleError(_0x23669f,null));}; \ No newline at end of file +var _0xe80c=['order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','show','params','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','count','limit','Content-Range','reject','save','then','destroy','status','error','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x406d90,_0x462d52){var _0x373cfe=function(_0x15358d){while(--_0x15358d){_0x406d90['push'](_0x406d90['shift']());}};_0x373cfe(++_0x462d52);}(_0xe80c,0x1c2));var _0xce80=function(_0x5d24c7,_0x45cd1f){_0x5d24c7=_0x5d24c7-0x0;var _0x3baf0d=_0xe80c[_0x5d24c7];return _0x3baf0d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce80('0x0'));var zipdir=require(_0xce80('0x1'));var jsonpatch=require(_0xce80('0x2'));var rp=require(_0xce80('0x3'));var moment=require(_0xce80('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xce80('0x5'));var util=require(_0xce80('0x6'));var path=require(_0xce80('0x7'));var sox=require(_0xce80('0x8'));var csv=require('to-csv');var ejs=require(_0xce80('0x9'));var fs=require('fs');var fs_extra=require(_0xce80('0xa'));var _=require(_0xce80('0xb'));var squel=require('squel');var crypto=require(_0xce80('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xce80('0xd'));var toCsv=require('to-csv');var querystring=require(_0xce80('0xe'));var Papa=require(_0xce80('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xce80('0x10'));var as=require(_0xce80('0x11'));var hardwareService=require(_0xce80('0x12'));var logger=require(_0xce80('0x13'))(_0xce80('0x14'));var utils=require(_0xce80('0x15'));var config=require(_0xce80('0x16'));var licenseUtil=require(_0xce80('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45a9b7,_0x37561b){_0x37561b=_0x37561b||0xcc;return function(_0x12d8c7){if(_0x12d8c7){return _0x45a9b7['sendStatus'](_0x37561b);}return _0x45a9b7['status'](_0x37561b)[_0xce80('0x18')]();};}function respondWithResult(_0x1903ec,_0x15f870){_0x15f870=_0x15f870||0xc8;return function(_0x3cac82){if(_0x3cac82){return _0x1903ec['status'](_0x15f870)[_0xce80('0x19')](_0x3cac82);}};}function respondWithFilteredResult(_0x5d134e,_0x9402b9){return function(_0x48796f){if(_0x48796f){var _0x24efa3=typeof _0x9402b9[_0xce80('0x1a')]==='undefined'&&typeof _0x9402b9['limit']==='undefined';var _0x35b40d=_0x48796f[_0xce80('0x1b')];var _0x148d57=_0x24efa3?0x0:_0x9402b9[_0xce80('0x1a')];var _0x4375b7=_0x24efa3?_0x48796f['count']:_0x9402b9[_0xce80('0x1a')]+_0x9402b9[_0xce80('0x1c')];var _0x4d4345;if(_0x4375b7>=_0x35b40d){_0x4375b7=_0x35b40d;_0x4d4345=0xc8;}else{_0x4d4345=0xce;}_0x5d134e['status'](_0x4d4345);return _0x5d134e['set'](_0xce80('0x1d'),_0x148d57+'-'+_0x4375b7+'/'+_0x35b40d)[_0xce80('0x19')](_0x48796f);}return null;};}function patchUpdates(_0x468b61){return function(_0x44f399){try{jsonpatch['apply'](_0x44f399,_0x468b61,!![]);}catch(_0x259a0b){return BPromise[_0xce80('0x1e')](_0x259a0b);}return _0x44f399[_0xce80('0x1f')]();};}function saveUpdates(_0x5315eb,_0x4df9bb){return function(_0x116b5e){if(_0x116b5e){return _0x116b5e['update'](_0x5315eb)[_0xce80('0x20')](function(_0x348d2d){return _0x348d2d;});}return null;};}function removeEntity(_0x2c5d01,_0x34f511){return function(_0x4fc91c){if(_0x4fc91c){return _0x4fc91c[_0xce80('0x21')]()['then'](function(){_0x2c5d01[_0xce80('0x22')](0xcc)[_0xce80('0x18')]();});}};}function handleEntityNotFound(_0x4cd1f5,_0x48080b){return function(_0x2b2dc3){if(!_0x2b2dc3){_0x4cd1f5['sendStatus'](0x194);}return _0x2b2dc3;};}function handleError(_0x2b7a4a,_0x1017f1){_0x1017f1=_0x1017f1||0x1f4;return function(_0x2a935a){logger[_0xce80('0x23')](_0x2a935a['stack']);if(_0x2a935a[_0xce80('0x24')]){delete _0x2a935a[_0xce80('0x24')];}_0x2b7a4a[_0xce80('0x22')](_0x1017f1)[_0xce80('0x25')](_0x2a935a);};}exports[_0xce80('0x26')]=function(_0x4792fe,_0x4d8796){var _0x6d1190={},_0x51b5bf={},_0x40cd7e={'count':0x0,'rows':[]};var _0x43ffb6=_[_0xce80('0x27')](db[_0xce80('0x28')][_0xce80('0x29')],function(_0x2f445c){return{'name':_0x2f445c[_0xce80('0x2a')],'type':_0x2f445c['type'][_0xce80('0x2b')]};});_0x51b5bf['model']=_['map'](_0x43ffb6,_0xce80('0x24'));_0x51b5bf[_0xce80('0x2c')]=_[_0xce80('0x2d')](_0x4792fe[_0xce80('0x2c')]);_0x51b5bf[_0xce80('0x2e')]=_[_0xce80('0x2f')](_0x51b5bf[_0xce80('0x30')],_0x51b5bf[_0xce80('0x2c')]);_0x6d1190['attributes']=_[_0xce80('0x2f')](_0x51b5bf['model'],qs[_0xce80('0x31')](_0x4792fe[_0xce80('0x2c')][_0xce80('0x31')]));_0x6d1190[_0xce80('0x32')]=_0x6d1190[_0xce80('0x32')][_0xce80('0x33')]?_0x6d1190['attributes']:_0x51b5bf[_0xce80('0x30')];if(!_0x4792fe[_0xce80('0x2c')][_0xce80('0x34')](_0xce80('0x35'))){_0x6d1190[_0xce80('0x1c')]=qs[_0xce80('0x1c')](_0x4792fe['query']['limit']);_0x6d1190[_0xce80('0x1a')]=qs[_0xce80('0x1a')](_0x4792fe[_0xce80('0x2c')][_0xce80('0x1a')]);}_0x6d1190[_0xce80('0x36')]=qs['sort'](_0x4792fe[_0xce80('0x2c')][_0xce80('0x37')]);_0x6d1190[_0xce80('0x38')]=qs[_0xce80('0x2e')](_[_0xce80('0x39')](_0x4792fe[_0xce80('0x2c')],_0x51b5bf[_0xce80('0x2e')]),_0x43ffb6);if(_0x4792fe[_0xce80('0x2c')][_0xce80('0x3a')]){_0x6d1190[_0xce80('0x38')]=_['merge'](_0x6d1190[_0xce80('0x38')],{'$or':_['map'](_0x43ffb6,function(_0x79ad39){if(_0x79ad39[_0xce80('0x3b')]!==_0xce80('0x3c')){var _0x2c87ce={};_0x2c87ce[_0x79ad39[_0xce80('0x24')]]={'$like':'%'+_0x4792fe['query'][_0xce80('0x3a')]+'%'};return _0x2c87ce;}})});}_0x6d1190=_[_0xce80('0x3d')]({},_0x6d1190,_0x4792fe[_0xce80('0x3e')]);var _0x53715e={'where':_0x6d1190[_0xce80('0x38')]};return db['FaxQueueReport'][_0xce80('0x1b')](_0x53715e)[_0xce80('0x20')](function(_0x3a5b0e){_0x40cd7e[_0xce80('0x1b')]=_0x3a5b0e;if(_0x4792fe[_0xce80('0x2c')][_0xce80('0x3f')]){_0x6d1190['include']=[{'all':!![]}];}return db[_0xce80('0x28')][_0xce80('0x40')](_0x6d1190);})[_0xce80('0x20')](function(_0x12bb2c){_0x40cd7e['rows']=_0x12bb2c;return _0x40cd7e;})[_0xce80('0x20')](respondWithFilteredResult(_0x4d8796,_0x6d1190))['catch'](handleError(_0x4d8796,null));};exports[_0xce80('0x41')]=function(_0x30b72c,_0x3e2edd){var _0x4167b9={'raw':!![],'where':{'id':_0x30b72c[_0xce80('0x42')]['id']}},_0x338393={};_0x338393[_0xce80('0x30')]=_[_0xce80('0x2d')](db[_0xce80('0x28')]['rawAttributes']);_0x338393[_0xce80('0x2c')]=_[_0xce80('0x2d')](_0x30b72c[_0xce80('0x2c')]);_0x338393['filters']=_[_0xce80('0x2f')](_0x338393[_0xce80('0x30')],_0x338393[_0xce80('0x2c')]);_0x4167b9['attributes']=_[_0xce80('0x2f')](_0x338393['model'],qs[_0xce80('0x31')](_0x30b72c[_0xce80('0x2c')][_0xce80('0x31')]));_0x4167b9['attributes']=_0x4167b9[_0xce80('0x32')][_0xce80('0x33')]?_0x4167b9[_0xce80('0x32')]:_0x338393['model'];if(_0x30b72c[_0xce80('0x2c')]['includeAll']){_0x4167b9['include']=[{'all':!![]}];}_0x4167b9=_[_0xce80('0x3d')]({},_0x4167b9,_0x30b72c[_0xce80('0x3e')]);return db[_0xce80('0x28')][_0xce80('0x43')](_0x4167b9)[_0xce80('0x20')](handleEntityNotFound(_0x3e2edd,null))[_0xce80('0x20')](respondWithResult(_0x3e2edd,null))[_0xce80('0x44')](handleError(_0x3e2edd,null));};exports[_0xce80('0x45')]=function(_0x5f448e,_0x217fa4){return db['FaxQueueReport'][_0xce80('0x45')](_0x5f448e[_0xce80('0x46')],{})[_0xce80('0x20')](respondWithResult(_0x217fa4,0xc9))[_0xce80('0x44')](handleError(_0x217fa4,null));};exports[_0xce80('0x47')]=function(_0x118583,_0x595662){if(_0x118583[_0xce80('0x46')]['id']){delete _0x118583['body']['id'];}return db[_0xce80('0x28')]['find']({'where':{'id':_0x118583['params']['id']}})[_0xce80('0x20')](handleEntityNotFound(_0x595662,null))[_0xce80('0x20')](saveUpdates(_0x118583[_0xce80('0x46')],null))[_0xce80('0x20')](respondWithResult(_0x595662,null))['catch'](handleError(_0x595662,null));};exports[_0xce80('0x21')]=function(_0xc420ef,_0x56dc30){return db[_0xce80('0x28')][_0xce80('0x43')]({'where':{'id':_0xc420ef[_0xce80('0x42')]['id']}})[_0xce80('0x20')](handleEntityNotFound(_0x56dc30,null))['then'](removeEntity(_0x56dc30,null))['catch'](handleError(_0x56dc30,null));};exports['describe']=function(_0x4671d0,_0x2bd460){return db[_0xce80('0x28')]['describe']()['then'](respondWithResult(_0x2bd460,null))[_0xce80('0x44')](handleError(_0x2bd460,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 3c266ac..d73dc0c 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 _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x139920,_0xd9064d){var _0x949608=function(_0x574698){while(--_0x574698){_0x139920['push'](_0x139920['shift']());}};_0x949608(++_0xd9064d);}(_0xe14b,0x93));var _0xbe14=function(_0x12da4d,_0x1449ff){_0x12da4d=_0x12da4d-0x0;var _0x3213f9=_0xe14b[_0x12da4d];return _0x3213f9;};'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 +var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0x37dd4a,_0x1af85b){var _0x1c6da0=function(_0x3a9453){while(--_0x3a9453){_0x37dd4a['push'](_0x37dd4a['shift']());}};_0x1c6da0(++_0x1af85b);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2ef251,_0x3687e5){_0x2ef251=_0x2ef251-0x0;var _0x5c931b=_0x7fbe[_0x2ef251];return _0x5c931b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 7fea14f..7d45ad8 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 _0x3030=['FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateFaxQueueReport','create','options','then','info','debug','UpdateFaxQueueReport','update','body','raw','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','FaxQueueReport,\x20%s,\x20%s'];(function(_0x547d5a,_0x35681d){var _0xab7526=function(_0x9db19e){while(--_0x9db19e){_0x547d5a['push'](_0x547d5a['shift']());}};_0xab7526(++_0x35681d);}(_0x3030,0xd9));var _0x0303=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0x3030[_0x3fc97b];return _0x3a0c82;};'use strict';var _=require(_0x0303('0x0'));var util=require(_0x0303('0x1'));var moment=require(_0x0303('0x2'));var BPromise=require(_0x0303('0x3'));var rs=require(_0x0303('0x4'));var fs=require('fs');var Redis=require(_0x0303('0x5'));var db=require(_0x0303('0x6'))['db'];var utils=require(_0x0303('0x7'));var logger=require(_0x0303('0x8'))(_0x0303('0x9'));var config=require('../../config/environment');var jayson=require(_0x0303('0xa'));var client=jayson[_0x0303('0xb')][_0x0303('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x29f4d3,_0x3d5cfe,_0x257421){return new BPromise(function(_0x280bf2,_0x109227){return client['request'](_0x29f4d3,_0x257421)['then'](function(_0x4568f8){logger['info'](_0x0303('0xd'),_0x3d5cfe,'request\x20sent');logger['debug'](_0x0303('0xe'),_0x3d5cfe,_0x0303('0xf'),JSON[_0x0303('0x10')](_0x4568f8));if(_0x4568f8[_0x0303('0x11')]){if(_0x4568f8[_0x0303('0x11')]['code']===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x3d5cfe,_0x4568f8[_0x0303('0x11')]['message']);return _0x109227(_0x4568f8[_0x0303('0x11')][_0x0303('0x12')]);}logger['error'](_0x0303('0xd'),_0x3d5cfe,_0x4568f8[_0x0303('0x11')][_0x0303('0x12')]);return _0x280bf2(_0x4568f8['error']['message']);}else{logger['info'](_0x0303('0xd'),_0x3d5cfe,_0x0303('0xf'));_0x280bf2(_0x4568f8[_0x0303('0x13')]['message']);}})[_0x0303('0x14')](function(_0x24e7a5){logger[_0x0303('0x11')](_0x0303('0xd'),_0x3d5cfe,_0x24e7a5);_0x109227(_0x24e7a5);});});}exports[_0x0303('0x15')]=function(_0x1f0198){var _0x6e98dc=this;return new Promise(function(_0x2b5c57,_0x3df2fe){return db['FaxQueueReport'][_0x0303('0x16')](_0x1f0198['body'],{'raw':_0x1f0198[_0x0303('0x17')]?_0x1f0198[_0x0303('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x0303('0x18')](function(_0x271a34){logger[_0x0303('0x19')](_0x0303('0x15'),_0x1f0198);logger[_0x0303('0x1a')](_0x0303('0x15'),_0x1f0198,JSON['stringify'](_0x271a34));_0x2b5c57(_0x271a34);})[_0x0303('0x14')](function(_0x4eb7e0){logger[_0x0303('0x11')](_0x0303('0x15'),_0x4eb7e0[_0x0303('0x12')],_0x1f0198);_0x3df2fe(_0x6e98dc[_0x0303('0x11')](0x1f4,_0x4eb7e0['message']));});});};exports[_0x0303('0x1b')]=function(_0x40fc15){var _0x40cef9=this;return new Promise(function(_0x5008e8,_0x18b67e){return db['FaxQueueReport'][_0x0303('0x1c')](_0x40fc15[_0x0303('0x1d')],{'raw':_0x40fc15[_0x0303('0x17')]?_0x40fc15[_0x0303('0x17')][_0x0303('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40fc15[_0x0303('0x17')]?_0x40fc15[_0x0303('0x17')][_0x0303('0x1f')]||null:null,'attributes':_0x40fc15[_0x0303('0x17')]?_0x40fc15[_0x0303('0x17')]['attributes']||null:null,'limit':_0x40fc15[_0x0303('0x17')]?_0x40fc15[_0x0303('0x17')][_0x0303('0x20')]||null:null})[_0x0303('0x18')](function(_0x1a4cd2){logger[_0x0303('0x19')](_0x0303('0x1b'),_0x40fc15);logger[_0x0303('0x1a')]('UpdateFaxQueueReport',_0x40fc15,JSON[_0x0303('0x10')](_0x1a4cd2));_0x5008e8(_0x1a4cd2);})['catch'](function(_0x3be866){logger[_0x0303('0x11')]('UpdateFaxQueueReport',_0x3be866[_0x0303('0x12')],_0x40fc15);_0x18b67e(_0x40cef9[_0x0303('0x11')](0x1f4,_0x3be866[_0x0303('0x12')]));});});}; \ No newline at end of file +var _0xad5e=['request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FaxQueueReport','body','options','then','CreateFaxQueueReport','UpdateFaxQueueReport','update','where','attributes','limit','info','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','FaxQueueReport,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xad5e,0x1f3));var _0xead5=function(_0x1559a3,_0x1e4f51){_0x1559a3=_0x1559a3-0x0;var _0x3a4b87=_0xad5e[_0x1559a3];return _0x3a4b87;};'use strict';var _=require(_0xead5('0x0'));var util=require(_0xead5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xead5('0x2'));var fs=require('fs');var Redis=require(_0xead5('0x3'));var db=require(_0xead5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xead5('0x5'))(_0xead5('0x6'));var config=require('../../config/environment');var jayson=require(_0xead5('0x7'));var client=jayson[_0xead5('0x8')][_0xead5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x366897,_0x2906b4,_0x5ad2b){return new BPromise(function(_0xb86b38,_0x2b2723){return client['request'](_0x366897,_0x5ad2b)['then'](function(_0x32b036){logger['info'](_0xead5('0xa'),_0x2906b4,_0xead5('0xb'));logger[_0xead5('0xc')](_0xead5('0xd'),_0x2906b4,'request\x20sent',JSON[_0xead5('0xe')](_0x32b036));if(_0x32b036[_0xead5('0xf')]){if(_0x32b036[_0xead5('0xf')][_0xead5('0x10')]===0x1f4){logger[_0xead5('0xf')](_0xead5('0xa'),_0x2906b4,_0x32b036['error'][_0xead5('0x11')]);return _0x2b2723(_0x32b036['error']['message']);}logger[_0xead5('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x2906b4,_0x32b036[_0xead5('0xf')][_0xead5('0x11')]);return _0xb86b38(_0x32b036[_0xead5('0xf')][_0xead5('0x11')]);}else{logger['info'](_0xead5('0xa'),_0x2906b4,_0xead5('0xb'));_0xb86b38(_0x32b036['result'][_0xead5('0x11')]);}})[_0xead5('0x12')](function(_0x5712c6){logger['error'](_0xead5('0xa'),_0x2906b4,_0x5712c6);_0x2b2723(_0x5712c6);});});}exports['CreateFaxQueueReport']=function(_0x52c49a){var _0x15a9a2=this;return new Promise(function(_0x3f0423,_0x36cc81){return db[_0xead5('0x13')]['create'](_0x52c49a[_0xead5('0x14')],{'raw':_0x52c49a['options']?_0x52c49a[_0xead5('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xead5('0x16')](function(_0x2ff87d){logger['info'](_0xead5('0x17'),_0x52c49a);logger[_0xead5('0xc')](_0xead5('0x17'),_0x52c49a,JSON['stringify'](_0x2ff87d));_0x3f0423(_0x2ff87d);})[_0xead5('0x12')](function(_0x55d2f5){logger[_0xead5('0xf')](_0xead5('0x17'),_0x55d2f5[_0xead5('0x11')],_0x52c49a);_0x36cc81(_0x15a9a2[_0xead5('0xf')](0x1f4,_0x55d2f5[_0xead5('0x11')]));});});};exports[_0xead5('0x18')]=function(_0x4bb8db){var _0x22cfd2=this;return new Promise(function(_0x1c02aa,_0x40b798){return db['FaxQueueReport'][_0xead5('0x19')](_0x4bb8db[_0xead5('0x14')],{'raw':_0x4bb8db['options']?_0x4bb8db['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bb8db[_0xead5('0x15')]?_0x4bb8db[_0xead5('0x15')][_0xead5('0x1a')]||null:null,'attributes':_0x4bb8db[_0xead5('0x15')]?_0x4bb8db[_0xead5('0x15')][_0xead5('0x1b')]||null:null,'limit':_0x4bb8db['options']?_0x4bb8db[_0xead5('0x15')][_0xead5('0x1c')]||null:null})[_0xead5('0x16')](function(_0x4132b5){logger[_0xead5('0x1d')]('UpdateFaxQueueReport',_0x4bb8db);logger[_0xead5('0xc')](_0xead5('0x18'),_0x4bb8db,JSON['stringify'](_0x4132b5));_0x1c02aa(_0x4132b5);})[_0xead5('0x12')](function(_0x598782){logger['error'](_0xead5('0x18'),_0x598782[_0xead5('0x11')],_0x4bb8db);_0x40b798(_0x22cfd2[_0xead5('0xf')](0x1f4,_0x598782[_0xead5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index e858a6d..579bfc4 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 _0x7931=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x1f71d8,_0x278518){var _0x10b045=function(_0x57aea4){while(--_0x57aea4){_0x1f71d8['push'](_0x1f71d8['shift']());}};_0x10b045(++_0x278518);}(_0x7931,0xe6));var _0x1793=function(_0x3b89ab,_0x3ae228){_0x3b89ab=_0x3b89ab-0x0;var _0x3deb2d=_0x7931[_0x3b89ab];return _0x3deb2d;};'use strict';var multer=require(_0x1793('0x0'));var util=require(_0x1793('0x1'));var path=require(_0x1793('0x2'));var timeout=require(_0x1793('0x3'));var express=require(_0x1793('0x4'));var router=express[_0x1793('0x5')]();var fs_extra=require(_0x1793('0x6'));var auth=require(_0x1793('0x7'));var interaction=require(_0x1793('0x8'));var config=require(_0x1793('0x9'));var controller=require(_0x1793('0xa'));router[_0x1793('0xb')]('/',auth[_0x1793('0xc')](),controller['index']);router[_0x1793('0xb')]('/describe',auth[_0x1793('0xc')](),controller[_0x1793('0xd')]);router['get'](_0x1793('0xe'),auth[_0x1793('0xc')](),controller[_0x1793('0xf')]);router[_0x1793('0x10')]('/',auth[_0x1793('0xc')](),controller[_0x1793('0x11')]);router[_0x1793('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x1793('0x13')]);router[_0x1793('0x14')](_0x1793('0xe'),auth[_0x1793('0xc')](),controller[_0x1793('0x15')]);module[_0x1793('0x16')]=router; \ No newline at end of file +var _0x3de9=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','multer'];(function(_0x266e57,_0x41125b){var _0x4cdc1d=function(_0x3d3734){while(--_0x3d3734){_0x266e57['push'](_0x266e57['shift']());}};_0x4cdc1d(++_0x41125b);}(_0x3de9,0x110));var _0x93de=function(_0x564904,_0x183d0e){_0x564904=_0x564904-0x0;var _0x1335fc=_0x3de9[_0x564904];return _0x1335fc;};'use strict';var multer=require(_0x93de('0x0'));var util=require(_0x93de('0x1'));var path=require(_0x93de('0x2'));var timeout=require(_0x93de('0x3'));var express=require(_0x93de('0x4'));var router=express['Router']();var fs_extra=require(_0x93de('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x93de('0x6'));var config=require(_0x93de('0x7'));var controller=require(_0x93de('0x8'));router[_0x93de('0x9')]('/',auth[_0x93de('0xa')](),controller[_0x93de('0xb')]);router[_0x93de('0x9')](_0x93de('0xc'),auth[_0x93de('0xa')](),controller['describe']);router['get'](_0x93de('0xd'),auth[_0x93de('0xa')](),controller[_0x93de('0xe')]);router[_0x93de('0xf')]('/',auth[_0x93de('0xa')](),controller[_0x93de('0x10')]);router[_0x93de('0x11')](_0x93de('0xd'),auth[_0x93de('0xa')](),controller[_0x93de('0x12')]);router[_0x93de('0x13')](_0x93de('0xd'),auth[_0x93de('0xa')](),controller[_0x93de('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 772ec3f..3162de6 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x315eed,_0x52feaf){var _0x4a9cbc=function(_0x2d6b6d){while(--_0x2d6b6d){_0x315eed['push'](_0x315eed['shift']());}};_0x4a9cbc(++_0x52feaf);}(_0xf4eb,0xec));var _0xbf4e=function(_0x48e366,_0x1bb09e){_0x48e366=_0x48e366-0x0;var _0xa9797f=_0xf4eb[_0x48e366];return _0xa9797f;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x55715d,_0x230bea){var _0x13a35b=function(_0x2cda11){while(--_0x2cda11){_0x55715d['push'](_0x55715d['shift']());}};_0x13a35b(++_0x230bea);}(_0x70e0,0x17b));var _0x070e=function(_0x1d3329,_0x29dc23){_0x1d3329=_0x1d3329-0x0;var _0x182d42=_0x70e0[_0x1d3329];return _0x182d42;};'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 dc6a89c..6e98ea5 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 _0xae4c=['sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','update','then','destroy','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xae4c,0x7e));var _0xcae4=function(_0x778a34,_0xb4f3d3){_0x778a34=_0x778a34-0x0;var _0x4b956f=_0xae4c[_0x778a34];return _0x4b956f;};'use strict';var emlformat=require(_0xcae4('0x0'));var rimraf=require(_0xcae4('0x1'));var zipdir=require(_0xcae4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcae4('0x3'));var moment=require(_0xcae4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcae4('0x5'));var path=require(_0xcae4('0x6'));var sox=require(_0xcae4('0x7'));var csv=require('to-csv');var ejs=require(_0xcae4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcae4('0x9'));var squel=require(_0xcae4('0xa'));var crypto=require(_0xcae4('0xb'));var jsforce=require(_0xcae4('0xc'));var deskjs=require(_0xcae4('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcae4('0xe'));var Redis=require(_0xcae4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xcae4('0x10'));var as=require(_0xcae4('0x11'));var hardwareService=require(_0xcae4('0x12'));var logger=require(_0xcae4('0x13'))(_0xcae4('0x14'));var utils=require(_0xcae4('0x15'));var config=require(_0xcae4('0x16'));var licenseUtil=require(_0xcae4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x333268,_0x5679ec){_0x5679ec=_0x5679ec||0xcc;return function(_0x3a49f2){if(_0x3a49f2){return _0x333268[_0xcae4('0x18')](_0x5679ec);}return _0x333268['status'](_0x5679ec)[_0xcae4('0x19')]();};}function respondWithResult(_0x21e60b,_0x264fbc){_0x264fbc=_0x264fbc||0xc8;return function(_0x588c32){if(_0x588c32){return _0x21e60b['status'](_0x264fbc)[_0xcae4('0x1a')](_0x588c32);}};}function respondWithFilteredResult(_0x25a5f2,_0x3d299f){return function(_0x258b17){if(_0x258b17){var _0x4aee66=typeof _0x3d299f[_0xcae4('0x1b')]===_0xcae4('0x1c')&&typeof _0x3d299f['limit']===_0xcae4('0x1c');var _0x2742a9=_0x258b17[_0xcae4('0x1d')];var _0x24c382=_0x4aee66?0x0:_0x3d299f[_0xcae4('0x1b')];var _0x198c36=_0x4aee66?_0x258b17['count']:_0x3d299f[_0xcae4('0x1b')]+_0x3d299f[_0xcae4('0x1e')];var _0x27f534;if(_0x198c36>=_0x2742a9){_0x198c36=_0x2742a9;_0x27f534=0xc8;}else{_0x27f534=0xce;}_0x25a5f2[_0xcae4('0x1f')](_0x27f534);return _0x25a5f2['set'](_0xcae4('0x20'),_0x24c382+'-'+_0x198c36+'/'+_0x2742a9)['json'](_0x258b17);}return null;};}function patchUpdates(_0x5e56f9){return function(_0x371c0c){try{jsonpatch['apply'](_0x371c0c,_0x5e56f9,!![]);}catch(_0xc63416){return BPromise['reject'](_0xc63416);}return _0x371c0c['save']();};}function saveUpdates(_0x497e72,_0x363f64){return function(_0x583282){if(_0x583282){return _0x583282[_0xcae4('0x21')](_0x497e72)[_0xcae4('0x22')](function(_0x4418c5){return _0x4418c5;});}return null;};}function removeEntity(_0x63b01f,_0x35ddf3){return function(_0x55add3){if(_0x55add3){return _0x55add3[_0xcae4('0x23')]()[_0xcae4('0x22')](function(){_0x63b01f[_0xcae4('0x1f')](0xcc)[_0xcae4('0x19')]();});}};}function handleEntityNotFound(_0xcbcbd0,_0x2838e5){return function(_0x21271d){if(!_0x21271d){_0xcbcbd0['sendStatus'](0x194);}return _0x21271d;};}function handleError(_0x52e435,_0x4de8aa){_0x4de8aa=_0x4de8aa||0x1f4;return function(_0x27bf5f){logger[_0xcae4('0x24')](_0x27bf5f[_0xcae4('0x25')]);if(_0x27bf5f[_0xcae4('0x26')]){delete _0x27bf5f[_0xcae4('0x26')];}_0x52e435['status'](_0x4de8aa)[_0xcae4('0x27')](_0x27bf5f);};}exports[_0xcae4('0x28')]=function(_0x3a8a94,_0x24d78e){var _0x1907e3={},_0x58a2f5={},_0x47a6fb={'count':0x0,'rows':[]};var _0x3d5f0d=_[_0xcae4('0x29')](db[_0xcae4('0x2a')][_0xcae4('0x2b')],function(_0x50ad27){return{'name':_0x50ad27[_0xcae4('0x2c')],'type':_0x50ad27['type'][_0xcae4('0x2d')]};});_0x58a2f5[_0xcae4('0x2e')]=_[_0xcae4('0x29')](_0x3d5f0d,_0xcae4('0x26'));_0x58a2f5[_0xcae4('0x2f')]=_[_0xcae4('0x30')](_0x3a8a94[_0xcae4('0x2f')]);_0x58a2f5[_0xcae4('0x31')]=_[_0xcae4('0x32')](_0x58a2f5['model'],_0x58a2f5[_0xcae4('0x2f')]);_0x1907e3[_0xcae4('0x33')]=_['intersection'](_0x58a2f5[_0xcae4('0x2e')],qs['fields'](_0x3a8a94[_0xcae4('0x2f')][_0xcae4('0x34')]));_0x1907e3[_0xcae4('0x33')]=_0x1907e3[_0xcae4('0x33')][_0xcae4('0x35')]?_0x1907e3[_0xcae4('0x33')]:_0x58a2f5['model'];if(!_0x3a8a94[_0xcae4('0x2f')]['hasOwnProperty'](_0xcae4('0x36'))){_0x1907e3['limit']=qs[_0xcae4('0x1e')](_0x3a8a94['query'][_0xcae4('0x1e')]);_0x1907e3[_0xcae4('0x1b')]=qs[_0xcae4('0x1b')](_0x3a8a94[_0xcae4('0x2f')][_0xcae4('0x1b')]);}_0x1907e3[_0xcae4('0x37')]=qs[_0xcae4('0x38')](_0x3a8a94[_0xcae4('0x2f')][_0xcae4('0x38')]);_0x1907e3['where']=qs[_0xcae4('0x31')](_[_0xcae4('0x39')](_0x3a8a94[_0xcae4('0x2f')],_0x58a2f5[_0xcae4('0x31')]),_0x3d5f0d);if(_0x3a8a94['query'][_0xcae4('0x3a')]){_0x1907e3['where']=_[_0xcae4('0x3b')](_0x1907e3[_0xcae4('0x3c')],{'$or':_['map'](_0x3d5f0d,function(_0x2ab499){if(_0x2ab499[_0xcae4('0x3d')]!==_0xcae4('0x3e')){var _0x4b0ff9={};_0x4b0ff9[_0x2ab499[_0xcae4('0x26')]]={'$like':'%'+_0x3a8a94['query'][_0xcae4('0x3a')]+'%'};return _0x4b0ff9;}})});}_0x1907e3=_[_0xcae4('0x3b')]({},_0x1907e3,_0x3a8a94[_0xcae4('0x3f')]);var _0x4a5d3f={'where':_0x1907e3[_0xcae4('0x3c')]};return db[_0xcae4('0x2a')][_0xcae4('0x1d')](_0x4a5d3f)[_0xcae4('0x22')](function(_0x46f42e){_0x47a6fb[_0xcae4('0x1d')]=_0x46f42e;if(_0x3a8a94['query'][_0xcae4('0x40')]){_0x1907e3[_0xcae4('0x41')]=[{'all':!![]}];}return db[_0xcae4('0x2a')][_0xcae4('0x42')](_0x1907e3);})['then'](function(_0x1d17e3){_0x47a6fb[_0xcae4('0x43')]=_0x1d17e3;return _0x47a6fb;})[_0xcae4('0x22')](respondWithFilteredResult(_0x24d78e,_0x1907e3))[_0xcae4('0x44')](handleError(_0x24d78e,null));};exports[_0xcae4('0x45')]=function(_0x31bb5a,_0x5ed1ae){var _0x183efb={'raw':!![],'where':{'id':_0x31bb5a[_0xcae4('0x46')]['id']}},_0x41c548={};_0x41c548[_0xcae4('0x2e')]=_[_0xcae4('0x30')](db[_0xcae4('0x2a')]['rawAttributes']);_0x41c548[_0xcae4('0x2f')]=_[_0xcae4('0x30')](_0x31bb5a[_0xcae4('0x2f')]);_0x41c548[_0xcae4('0x31')]=_[_0xcae4('0x32')](_0x41c548['model'],_0x41c548[_0xcae4('0x2f')]);_0x183efb[_0xcae4('0x33')]=_[_0xcae4('0x32')](_0x41c548[_0xcae4('0x2e')],qs[_0xcae4('0x34')](_0x31bb5a[_0xcae4('0x2f')]['fields']));_0x183efb['attributes']=_0x183efb[_0xcae4('0x33')][_0xcae4('0x35')]?_0x183efb[_0xcae4('0x33')]:_0x41c548[_0xcae4('0x2e')];if(_0x31bb5a[_0xcae4('0x2f')][_0xcae4('0x40')]){_0x183efb[_0xcae4('0x41')]=[{'all':!![]}];}_0x183efb=_[_0xcae4('0x3b')]({},_0x183efb,_0x31bb5a[_0xcae4('0x3f')]);return db[_0xcae4('0x2a')][_0xcae4('0x47')](_0x183efb)[_0xcae4('0x22')](handleEntityNotFound(_0x5ed1ae,null))[_0xcae4('0x22')](respondWithResult(_0x5ed1ae,null))[_0xcae4('0x44')](handleError(_0x5ed1ae,null));};exports[_0xcae4('0x48')]=function(_0x1c9d30,_0x2ba4f6){return db[_0xcae4('0x2a')][_0xcae4('0x48')](_0x1c9d30[_0xcae4('0x49')],{})['then'](respondWithResult(_0x2ba4f6,0xc9))[_0xcae4('0x44')](handleError(_0x2ba4f6,null));};exports[_0xcae4('0x21')]=function(_0x44780b,_0x5e8566){if(_0x44780b[_0xcae4('0x49')]['id']){delete _0x44780b['body']['id'];}return db[_0xcae4('0x2a')][_0xcae4('0x47')]({'where':{'id':_0x44780b[_0xcae4('0x46')]['id']}})[_0xcae4('0x22')](handleEntityNotFound(_0x5e8566,null))['then'](saveUpdates(_0x44780b[_0xcae4('0x49')],null))['then'](respondWithResult(_0x5e8566,null))[_0xcae4('0x44')](handleError(_0x5e8566,null));};exports['destroy']=function(_0x3ef671,_0x1c57d6){return db[_0xcae4('0x2a')][_0xcae4('0x47')]({'where':{'id':_0x3ef671[_0xcae4('0x46')]['id']}})[_0xcae4('0x22')](handleEntityNotFound(_0x1c57d6,null))[_0xcae4('0x22')](removeEntity(_0x1c57d6,null))[_0xcae4('0x44')](handleError(_0x1c57d6,null));};exports[_0xcae4('0x4a')]=function(_0x54ed15,_0x797116){return db[_0xcae4('0x2a')][_0xcae4('0x4a')]()['then'](respondWithResult(_0x797116,null))['catch'](handleError(_0x797116,null));}; \ No newline at end of file +var _0xd0c7=['status','json','offset','undefined','limit','set','reject','save','then','destroy','end','name','send','FaxTransferReport','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','type','VIRTUAL','filter','count','include','findAll','rows','catch','show','params','includeAll','merge','options','create','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','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'];(function(_0x34323e,_0x2b395b){var _0xb5fbf8=function(_0x2ad2d5){while(--_0x2ad2d5){_0x34323e['push'](_0x34323e['shift']());}};_0xb5fbf8(++_0x2b395b);}(_0xd0c7,0x7b));var _0x7d0c=function(_0x1e6053,_0x307fba){_0x1e6053=_0x1e6053-0x0;var _0x460c98=_0xd0c7[_0x1e6053];return _0x460c98;};'use strict';var emlformat=require(_0x7d0c('0x0'));var rimraf=require(_0x7d0c('0x1'));var zipdir=require(_0x7d0c('0x2'));var jsonpatch=require(_0x7d0c('0x3'));var rp=require('request-promise');var moment=require(_0x7d0c('0x4'));var BPromise=require(_0x7d0c('0x5'));var Mustache=require(_0x7d0c('0x6'));var util=require(_0x7d0c('0x7'));var path=require('path');var sox=require(_0x7d0c('0x8'));var csv=require(_0x7d0c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d0c('0xa'));var _=require(_0x7d0c('0xb'));var squel=require(_0x7d0c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7d0c('0xd'));var toCsv=require(_0x7d0c('0x9'));var querystring=require(_0x7d0c('0xe'));var Papa=require(_0x7d0c('0xf'));var Redis=require(_0x7d0c('0x10'));var authService=require(_0x7d0c('0x11'));var qs=require(_0x7d0c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d0c('0x13'));var logger=require(_0x7d0c('0x14'))(_0x7d0c('0x15'));var utils=require(_0x7d0c('0x16'));var config=require(_0x7d0c('0x17'));var licenseUtil=require(_0x7d0c('0x18'));var db=require(_0x7d0c('0x19'))['db'];function respondWithStatusCode(_0x4c8a00,_0x499577){_0x499577=_0x499577||0xcc;return function(_0x220803){if(_0x220803){return _0x4c8a00[_0x7d0c('0x1a')](_0x499577);}return _0x4c8a00[_0x7d0c('0x1b')](_0x499577)['end']();};}function respondWithResult(_0xc16bee,_0x18cf50){_0x18cf50=_0x18cf50||0xc8;return function(_0xed984d){if(_0xed984d){return _0xc16bee[_0x7d0c('0x1b')](_0x18cf50)[_0x7d0c('0x1c')](_0xed984d);}};}function respondWithFilteredResult(_0x3838dd,_0x4b7414){return function(_0x5d770b){if(_0x5d770b){var _0x58c9da=typeof _0x4b7414[_0x7d0c('0x1d')]===_0x7d0c('0x1e')&&typeof _0x4b7414['limit']===_0x7d0c('0x1e');var _0x590ec5=_0x5d770b['count'];var _0x4864ea=_0x58c9da?0x0:_0x4b7414[_0x7d0c('0x1d')];var _0x38069a=_0x58c9da?_0x5d770b['count']:_0x4b7414[_0x7d0c('0x1d')]+_0x4b7414[_0x7d0c('0x1f')];var _0x2c896d;if(_0x38069a>=_0x590ec5){_0x38069a=_0x590ec5;_0x2c896d=0xc8;}else{_0x2c896d=0xce;}_0x3838dd[_0x7d0c('0x1b')](_0x2c896d);return _0x3838dd[_0x7d0c('0x20')]('Content-Range',_0x4864ea+'-'+_0x38069a+'/'+_0x590ec5)[_0x7d0c('0x1c')](_0x5d770b);}return null;};}function patchUpdates(_0x338015){return function(_0x5354c2){try{jsonpatch['apply'](_0x5354c2,_0x338015,!![]);}catch(_0x5f3ae4){return BPromise[_0x7d0c('0x21')](_0x5f3ae4);}return _0x5354c2[_0x7d0c('0x22')]();};}function saveUpdates(_0x51b6f5,_0x2dd9bf){return function(_0x4eb03b){if(_0x4eb03b){return _0x4eb03b['update'](_0x51b6f5)[_0x7d0c('0x23')](function(_0x4c7d47){return _0x4c7d47;});}return null;};}function removeEntity(_0x10d4fc,_0x2ba8f5){return function(_0x4123b3){if(_0x4123b3){return _0x4123b3[_0x7d0c('0x24')]()[_0x7d0c('0x23')](function(){_0x10d4fc[_0x7d0c('0x1b')](0xcc)[_0x7d0c('0x25')]();});}};}function handleEntityNotFound(_0x1deebd,_0x5d67be){return function(_0x43a933){if(!_0x43a933){_0x1deebd['sendStatus'](0x194);}return _0x43a933;};}function handleError(_0x3e84e7,_0x37c25d){_0x37c25d=_0x37c25d||0x1f4;return function(_0x3121e4){logger['error'](_0x3121e4['stack']);if(_0x3121e4[_0x7d0c('0x26')]){delete _0x3121e4[_0x7d0c('0x26')];}_0x3e84e7[_0x7d0c('0x1b')](_0x37c25d)[_0x7d0c('0x27')](_0x3121e4);};}exports['index']=function(_0x291fe2,_0x252ff4){var _0x1d4ecc={},_0x479b4f={},_0x9d9090={'count':0x0,'rows':[]};var _0xafea22=_['map'](db[_0x7d0c('0x28')][_0x7d0c('0x29')],function(_0x5f0978){return{'name':_0x5f0978[_0x7d0c('0x2a')],'type':_0x5f0978['type'][_0x7d0c('0x2b')]};});_0x479b4f[_0x7d0c('0x2c')]=_[_0x7d0c('0x2d')](_0xafea22,_0x7d0c('0x26'));_0x479b4f['query']=_[_0x7d0c('0x2e')](_0x291fe2[_0x7d0c('0x2f')]);_0x479b4f[_0x7d0c('0x30')]=_['intersection'](_0x479b4f['model'],_0x479b4f[_0x7d0c('0x2f')]);_0x1d4ecc['attributes']=_[_0x7d0c('0x31')](_0x479b4f[_0x7d0c('0x2c')],qs[_0x7d0c('0x32')](_0x291fe2['query']['fields']));_0x1d4ecc[_0x7d0c('0x33')]=_0x1d4ecc[_0x7d0c('0x33')][_0x7d0c('0x34')]?_0x1d4ecc['attributes']:_0x479b4f['model'];if(!_0x291fe2[_0x7d0c('0x2f')]['hasOwnProperty'](_0x7d0c('0x35'))){_0x1d4ecc[_0x7d0c('0x1f')]=qs[_0x7d0c('0x1f')](_0x291fe2[_0x7d0c('0x2f')][_0x7d0c('0x1f')]);_0x1d4ecc[_0x7d0c('0x1d')]=qs[_0x7d0c('0x1d')](_0x291fe2[_0x7d0c('0x2f')]['offset']);}_0x1d4ecc['order']=qs[_0x7d0c('0x36')](_0x291fe2[_0x7d0c('0x2f')][_0x7d0c('0x36')]);_0x1d4ecc[_0x7d0c('0x37')]=qs[_0x7d0c('0x30')](_[_0x7d0c('0x38')](_0x291fe2[_0x7d0c('0x2f')],_0x479b4f[_0x7d0c('0x30')]),_0xafea22);if(_0x291fe2[_0x7d0c('0x2f')]['filter']){_0x1d4ecc['where']=_['merge'](_0x1d4ecc[_0x7d0c('0x37')],{'$or':_[_0x7d0c('0x2d')](_0xafea22,function(_0x54daa6){if(_0x54daa6[_0x7d0c('0x39')]!==_0x7d0c('0x3a')){var _0x477d31={};_0x477d31[_0x54daa6['name']]={'$like':'%'+_0x291fe2[_0x7d0c('0x2f')][_0x7d0c('0x3b')]+'%'};return _0x477d31;}})});}_0x1d4ecc=_['merge']({},_0x1d4ecc,_0x291fe2['options']);var _0x4a2251={'where':_0x1d4ecc[_0x7d0c('0x37')]};return db['FaxTransferReport'][_0x7d0c('0x3c')](_0x4a2251)[_0x7d0c('0x23')](function(_0x788063){_0x9d9090[_0x7d0c('0x3c')]=_0x788063;if(_0x291fe2[_0x7d0c('0x2f')]['includeAll']){_0x1d4ecc[_0x7d0c('0x3d')]=[{'all':!![]}];}return db[_0x7d0c('0x28')][_0x7d0c('0x3e')](_0x1d4ecc);})[_0x7d0c('0x23')](function(_0x13fbc4){_0x9d9090[_0x7d0c('0x3f')]=_0x13fbc4;return _0x9d9090;})[_0x7d0c('0x23')](respondWithFilteredResult(_0x252ff4,_0x1d4ecc))[_0x7d0c('0x40')](handleError(_0x252ff4,null));};exports[_0x7d0c('0x41')]=function(_0x3d6dcf,_0x4a18a0){var _0x5f3bbd={'raw':!![],'where':{'id':_0x3d6dcf[_0x7d0c('0x42')]['id']}},_0xa328f={};_0xa328f[_0x7d0c('0x2c')]=_[_0x7d0c('0x2e')](db[_0x7d0c('0x28')][_0x7d0c('0x29')]);_0xa328f[_0x7d0c('0x2f')]=_[_0x7d0c('0x2e')](_0x3d6dcf[_0x7d0c('0x2f')]);_0xa328f[_0x7d0c('0x30')]=_['intersection'](_0xa328f[_0x7d0c('0x2c')],_0xa328f[_0x7d0c('0x2f')]);_0x5f3bbd[_0x7d0c('0x33')]=_[_0x7d0c('0x31')](_0xa328f[_0x7d0c('0x2c')],qs[_0x7d0c('0x32')](_0x3d6dcf[_0x7d0c('0x2f')]['fields']));_0x5f3bbd['attributes']=_0x5f3bbd[_0x7d0c('0x33')][_0x7d0c('0x34')]?_0x5f3bbd[_0x7d0c('0x33')]:_0xa328f[_0x7d0c('0x2c')];if(_0x3d6dcf[_0x7d0c('0x2f')][_0x7d0c('0x43')]){_0x5f3bbd[_0x7d0c('0x3d')]=[{'all':!![]}];}_0x5f3bbd=_[_0x7d0c('0x44')]({},_0x5f3bbd,_0x3d6dcf[_0x7d0c('0x45')]);return db[_0x7d0c('0x28')]['find'](_0x5f3bbd)[_0x7d0c('0x23')](handleEntityNotFound(_0x4a18a0,null))[_0x7d0c('0x23')](respondWithResult(_0x4a18a0,null))['catch'](handleError(_0x4a18a0,null));};exports[_0x7d0c('0x46')]=function(_0x4aeb0c,_0x62d081){return db[_0x7d0c('0x28')][_0x7d0c('0x46')](_0x4aeb0c['body'],{})[_0x7d0c('0x23')](respondWithResult(_0x62d081,0xc9))[_0x7d0c('0x40')](handleError(_0x62d081,null));};exports[_0x7d0c('0x47')]=function(_0x1691dc,_0x9cd25f){if(_0x1691dc[_0x7d0c('0x48')]['id']){delete _0x1691dc[_0x7d0c('0x48')]['id'];}return db[_0x7d0c('0x28')][_0x7d0c('0x49')]({'where':{'id':_0x1691dc['params']['id']}})[_0x7d0c('0x23')](handleEntityNotFound(_0x9cd25f,null))['then'](saveUpdates(_0x1691dc[_0x7d0c('0x48')],null))[_0x7d0c('0x23')](respondWithResult(_0x9cd25f,null))[_0x7d0c('0x40')](handleError(_0x9cd25f,null));};exports[_0x7d0c('0x24')]=function(_0xfe4254,_0x35ed15){return db[_0x7d0c('0x28')]['find']({'where':{'id':_0xfe4254[_0x7d0c('0x42')]['id']}})[_0x7d0c('0x23')](handleEntityNotFound(_0x35ed15,null))[_0x7d0c('0x23')](removeEntity(_0x35ed15,null))[_0x7d0c('0x40')](handleError(_0x35ed15,null));};exports[_0x7d0c('0x4a')]=function(_0x1a5f2d,_0x37f538){return db['FaxTransferReport'][_0x7d0c('0x4a')]()['then'](respondWithResult(_0x37f538,null))[_0x7d0c('0x40')](handleError(_0x37f538,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 0943cf1..73810f9 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 _0xd959=['rimraf','./faxTransferReport.attributes','define','FaxTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xfd3658,_0x4d17ea){var _0x4fe2ba=function(_0x239b03){while(--_0x239b03){_0xfd3658['push'](_0xfd3658['shift']());}};_0x4fe2ba(++_0x4d17ea);}(_0xd959,0x1f3));var _0x9d95=function(_0x5642cb,_0x5d4511){_0x5642cb=_0x5642cb-0x0;var _0x345ad5=_0xd959[_0x5642cb];return _0x345ad5;};'use strict';var _=require(_0x9d95('0x0'));var util=require(_0x9d95('0x1'));var logger=require(_0x9d95('0x2'))(_0x9d95('0x3'));var moment=require(_0x9d95('0x4'));var BPromise=require(_0x9d95('0x5'));var rp=require(_0x9d95('0x6'));var fs=require('fs');var path=require(_0x9d95('0x7'));var rimraf=require(_0x9d95('0x8'));var config=require('../../config/environment');var attributes=require(_0x9d95('0x9'));module['exports']=function(_0x226c6f,_0x3d4bae){return _0x226c6f[_0x9d95('0xa')](_0x9d95('0xb'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x9d95('0xc'),'fields':[_0x9d95('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x46d9=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','lodash','util'];(function(_0x55be03,_0x58375a){var _0x745919=function(_0x147e34){while(--_0x147e34){_0x55be03['push'](_0x55be03['shift']());}};_0x745919(++_0x58375a);}(_0x46d9,0x16a));var _0x946d=function(_0x1986d,_0x2af5c4){_0x1986d=_0x1986d-0x0;var _0x27dda5=_0x46d9[_0x1986d];return _0x27dda5;};'use strict';var _=require(_0x946d('0x0'));var util=require(_0x946d('0x1'));var logger=require(_0x946d('0x2'))(_0x946d('0x3'));var moment=require(_0x946d('0x4'));var BPromise=require(_0x946d('0x5'));var rp=require(_0x946d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x946d('0x7'));var config=require(_0x946d('0x8'));var attributes=require(_0x946d('0x9'));module[_0x946d('0xa')]=function(_0x27bc4d,_0x35688c){return _0x27bc4d[_0x946d('0xb')](_0x946d('0xc'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x946d('0xd'),'fields':[_0x946d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 0ff495e..f84fda7 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 _0xcf1c=['../../config/environment','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0xcf1c,0xff));var _0xccf1=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0xcf1c[_0x421cf8];return _0x145c48;};'use strict';var _=require(_0xccf1('0x0'));var util=require(_0xccf1('0x1'));var moment=require(_0xccf1('0x2'));var BPromise=require(_0xccf1('0x3'));var rs=require(_0xccf1('0x4'));var fs=require('fs');var Redis=require(_0xccf1('0x5'));var db=require(_0xccf1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xccf1('0x7'))(_0xccf1('0x8'));var config=require(_0xccf1('0x9'));var jayson=require(_0xccf1('0xa'));var client=jayson[_0xccf1('0xb')][_0xccf1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x541743,_0x15ed97,_0x1a70f2){return new BPromise(function(_0x26adf0,_0x5f4b39){return client[_0xccf1('0xd')](_0x541743,_0x1a70f2)['then'](function(_0x4d721d){logger[_0xccf1('0xe')](_0xccf1('0xf'),_0x15ed97,'request\x20sent');logger[_0xccf1('0x10')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x15ed97,_0xccf1('0x11'),JSON[_0xccf1('0x12')](_0x4d721d));if(_0x4d721d[_0xccf1('0x13')]){if(_0x4d721d['error'][_0xccf1('0x14')]===0x1f4){logger[_0xccf1('0x13')](_0xccf1('0xf'),_0x15ed97,_0x4d721d[_0xccf1('0x13')][_0xccf1('0x15')]);return _0x5f4b39(_0x4d721d[_0xccf1('0x13')][_0xccf1('0x15')]);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x15ed97,_0x4d721d['error'][_0xccf1('0x15')]);return _0x26adf0(_0x4d721d[_0xccf1('0x13')][_0xccf1('0x15')]);}else{logger[_0xccf1('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x15ed97,_0xccf1('0x11'));_0x26adf0(_0x4d721d[_0xccf1('0x16')][_0xccf1('0x15')]);}})[_0xccf1('0x17')](function(_0x2673bf){logger[_0xccf1('0x13')](_0xccf1('0xf'),_0x15ed97,_0x2673bf);_0x5f4b39(_0x2673bf);});});} \ No newline at end of file +var _0x967c=['catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxTransferReport,\x20%s,\x20%s','result'];(function(_0x2a85ee,_0x4673e8){var _0x5ceb06=function(_0x6638d0){while(--_0x6638d0){_0x2a85ee['push'](_0x2a85ee['shift']());}};_0x5ceb06(++_0x4673e8);}(_0x967c,0xb9));var _0xc967=function(_0x1df7f7,_0x16007a){_0x1df7f7=_0x1df7f7-0x0;var _0x2b3229=_0x967c[_0x1df7f7];return _0x2b3229;};'use strict';var _=require(_0xc967('0x0'));var util=require(_0xc967('0x1'));var moment=require('moment');var BPromise=require(_0xc967('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc967('0x3'));var db=require(_0xc967('0x4'))['db'];var utils=require(_0xc967('0x5'));var logger=require('../../config/logger')(_0xc967('0x6'));var config=require(_0xc967('0x7'));var jayson=require(_0xc967('0x8'));var client=jayson['client'][_0xc967('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x308779,_0x15377d,_0x31378a){return new BPromise(function(_0x3ed73f,_0x27de0a){return client[_0xc967('0xa')](_0x308779,_0x31378a)[_0xc967('0xb')](function(_0x292f2f){logger[_0xc967('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x15377d,_0xc967('0xd'));logger[_0xc967('0xe')](_0xc967('0xf'),_0x15377d,_0xc967('0xd'),JSON[_0xc967('0x10')](_0x292f2f));if(_0x292f2f[_0xc967('0x11')]){if(_0x292f2f[_0xc967('0x11')][_0xc967('0x12')]===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x15377d,_0x292f2f[_0xc967('0x11')][_0xc967('0x13')]);return _0x27de0a(_0x292f2f['error']['message']);}logger[_0xc967('0x11')](_0xc967('0x14'),_0x15377d,_0x292f2f[_0xc967('0x11')][_0xc967('0x13')]);return _0x3ed73f(_0x292f2f['error'][_0xc967('0x13')]);}else{logger[_0xc967('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x15377d,_0xc967('0xd'));_0x3ed73f(_0x292f2f[_0xc967('0x15')]['message']);}})[_0xc967('0x16')](function(_0x15415d){logger[_0xc967('0x11')](_0xc967('0x14'),_0x15377d,_0x15415d);_0x27de0a(_0x15415d);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 441c802..35a800e 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 _0xa6d1=['create','put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x4790e8,_0x3ffa02){var _0x31dcd5=function(_0x19e86b){while(--_0x19e86b){_0x4790e8['push'](_0x4790e8['shift']());}};_0x31dcd5(++_0x3ffa02);}(_0xa6d1,0xe1));var _0x1a6d=function(_0x32ad1a,_0x17638d){_0x32ad1a=_0x32ad1a-0x0;var _0x76bdb=_0xa6d1[_0x32ad1a];return _0x76bdb;};'use strict';var multer=require('multer');var util=require(_0x1a6d('0x0'));var path=require(_0x1a6d('0x1'));var timeout=require('connect-timeout');var express=require(_0x1a6d('0x2'));var router=express[_0x1a6d('0x3')]();var fs_extra=require(_0x1a6d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1a6d('0x5'));var config=require(_0x1a6d('0x6'));var controller=require(_0x1a6d('0x7'));router[_0x1a6d('0x8')]('/',auth[_0x1a6d('0x9')](),controller[_0x1a6d('0xa')]);router[_0x1a6d('0x8')](_0x1a6d('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x1a6d('0x8')](_0x1a6d('0xc'),auth[_0x1a6d('0x9')](),controller[_0x1a6d('0xd')]);router[_0x1a6d('0xe')]('/',auth['isAuthenticated'](),controller[_0x1a6d('0xf')]);router[_0x1a6d('0x10')](_0x1a6d('0xc'),auth[_0x1a6d('0x9')](),controller['update']);router[_0x1a6d('0x11')](_0x1a6d('0xc'),auth[_0x1a6d('0x9')](),controller[_0x1a6d('0x12')]);module[_0x1a6d('0x13')]=router; \ No newline at end of file +var _0x41bf=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','create','put','update','destroy'];(function(_0x1e5c84,_0x4ff783){var _0x8a9208=function(_0x3da42a){while(--_0x3da42a){_0x1e5c84['push'](_0x1e5c84['shift']());}};_0x8a9208(++_0x4ff783);}(_0x41bf,0x7f));var _0xf41b=function(_0x4ffad9,_0x2d4f8d){_0x4ffad9=_0x4ffad9-0x0;var _0x45b8e8=_0x41bf[_0x4ffad9];return _0x45b8e8;};'use strict';var multer=require(_0xf41b('0x0'));var util=require(_0xf41b('0x1'));var path=require(_0xf41b('0x2'));var timeout=require(_0xf41b('0x3'));var express=require('express');var router=express[_0xf41b('0x4')]();var fs_extra=require(_0xf41b('0x5'));var auth=require(_0xf41b('0x6'));var interaction=require(_0xf41b('0x7'));var config=require(_0xf41b('0x8'));var controller=require(_0xf41b('0x9'));router['get']('/',auth[_0xf41b('0xa')](),controller[_0xf41b('0xb')]);router[_0xf41b('0xc')]('/describe',auth[_0xf41b('0xa')](),controller[_0xf41b('0xd')]);router[_0xf41b('0xc')](_0xf41b('0xe'),auth[_0xf41b('0xa')](),controller[_0xf41b('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf41b('0x10')]);router[_0xf41b('0x11')](_0xf41b('0xe'),auth['isAuthenticated'](),controller[_0xf41b('0x12')]);router['delete'](_0xf41b('0xe'),auth[_0xf41b('0xa')](),controller[_0xf41b('0x13')]);module[_0xf41b('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index a8201e5..2e7db09 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 _0x74b5=['addConfiguration','put','update','delete','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x74b5,0x11d));var _0x574b=function(_0x19e4ce,_0x1a8a80){_0x19e4ce=_0x19e4ce-0x0;var _0x1c9c08=_0x74b5[_0x19e4ce];return _0x1c9c08;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x574b('0x0'));var timeout=require(_0x574b('0x1'));var express=require('express');var router=express[_0x574b('0x2')]();var fs_extra=require(_0x574b('0x3'));var auth=require(_0x574b('0x4'));var interaction=require(_0x574b('0x5'));var config=require('../../config/environment');var controller=require(_0x574b('0x6'));router[_0x574b('0x7')]('/',auth[_0x574b('0x8')](),controller['index']);router['get'](_0x574b('0x9'),auth[_0x574b('0x8')](),controller[_0x574b('0xa')]);router[_0x574b('0x7')](_0x574b('0xb'),auth[_0x574b('0x8')](),controller[_0x574b('0xc')]);router[_0x574b('0x7')](_0x574b('0xd'),auth[_0x574b('0x8')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x574b('0xe')]);router['post'](_0x574b('0xb'),auth[_0x574b('0x8')](),controller[_0x574b('0xf')]);router[_0x574b('0x10')]('/:id',auth[_0x574b('0x8')](),controller[_0x574b('0x11')]);router[_0x574b('0x12')](_0x574b('0x9'),auth[_0x574b('0x8')](),controller['destroy']);module[_0x574b('0x13')]=router; \ No newline at end of file +var _0x20e2=['/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x20e2,0x64));var _0x220e=function(_0x5e293a,_0x14ff49){_0x5e293a=_0x5e293a-0x0;var _0x2d1065=_0x20e2[_0x5e293a];return _0x2d1065;};'use strict';var multer=require(_0x220e('0x0'));var util=require('util');var path=require(_0x220e('0x1'));var timeout=require(_0x220e('0x2'));var express=require(_0x220e('0x3'));var router=express['Router']();var fs_extra=require(_0x220e('0x4'));var auth=require(_0x220e('0x5'));var interaction=require(_0x220e('0x6'));var config=require(_0x220e('0x7'));var controller=require(_0x220e('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x220e('0x9')](_0x220e('0xa'),auth[_0x220e('0xb')](),controller[_0x220e('0xc')]);router[_0x220e('0x9')](_0x220e('0xd'),auth['isAuthenticated'](),controller[_0x220e('0xe')]);router['get'](_0x220e('0xf'),auth['isAuthenticated'](),controller[_0x220e('0x10')]);router[_0x220e('0x11')]('/',auth[_0x220e('0xb')](),controller['create']);router['post']('/:id/configurations',auth[_0x220e('0xb')](),controller[_0x220e('0x12')]);router[_0x220e('0x13')](_0x220e('0xa'),auth[_0x220e('0xb')](),controller['update']);router['delete'](_0x220e('0xa'),auth[_0x220e('0xb')](),controller[_0x220e('0x14')]);module[_0x220e('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 24a8545..22b9759 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 _0xbdd9=['ENUM','basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x177813,_0x1993b6){var _0x3553b3=function(_0x1313f7){while(--_0x1313f7){_0x177813['push'](_0x177813['shift']());}};_0x3553b3(++_0x1993b6);}(_0xbdd9,0x1d2));var _0x9bdd=function(_0xce93c,_0x555be5){_0xce93c=_0xce93c-0x0;var _0x230720=_0xbdd9[_0xce93c];return _0x230720;};'use strict';var Sequelize=require(_0x9bdd('0x0'));module[_0x9bdd('0x1')]={'name':{'type':Sequelize[_0x9bdd('0x2')]},'description':{'type':Sequelize[_0x9bdd('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x9bdd('0x2')]},'authType':{'type':Sequelize[_0x9bdd('0x3')](_0x9bdd('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x9bdd('0x2')]},'consumerKey':{'type':Sequelize[_0x9bdd('0x2')]},'consumerSecret':{'type':Sequelize[_0x9bdd('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x9bdd('0x2')]},'serverUrl':{'type':Sequelize[_0x9bdd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9bdd('0x3')](_0x9bdd('0x5'),_0x9bdd('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xf223=['STRING','ENUM','basic','integrationTab','newTab'];(function(_0x308350,_0x2ba908){var _0x59cc78=function(_0x2da3e5){while(--_0x2da3e5){_0x308350['push'](_0x308350['shift']());}};_0x59cc78(++_0x2ba908);}(_0xf223,0x1cc));var _0x3f22=function(_0x5595ca,_0x353118){_0x5595ca=_0x5595ca-0x0;var _0x4cda51=_0xf223[_0x5595ca];return _0x4cda51;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3f22('0x0')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3f22('0x0')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x3f22('0x1')](_0x3f22('0x2')),'defaultValue':_0x3f22('0x2')},'password':{'type':Sequelize[_0x3f22('0x0')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x3f22('0x0')]},'token':{'type':Sequelize[_0x3f22('0x0')]},'tokenSecret':{'type':Sequelize[_0x3f22('0x0')]},'serverUrl':{'type':Sequelize[_0x3f22('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x3f22('0x3'),_0x3f22('0x4')),'defaultValue':_0x3f22('0x3')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 76a12ad..67c1d0e 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 _0x39e0=['find','create','body','destroy','getConfigurations','findOne','order','nolimit','addConfiguration','AccountId','Subjects','type','getDescriptions','DeskConfiguration','DeskField','Descriptions','getFields','priority','remoteUri','authType','username','password','consumerKey','token','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','base64','concat','_embedded','entries','active','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','error','name','send','index','map','DeskAccount','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x39e0,0x1e9));var _0x039e=function(_0x36aa02,_0x22844c){_0x36aa02=_0x36aa02-0x0;var _0x41c9c3=_0x39e0[_0x36aa02];return _0x41c9c3;};'use strict';var emlformat=require(_0x039e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x039e('0x1'));var jsonpatch=require(_0x039e('0x2'));var rp=require(_0x039e('0x3'));var moment=require('moment');var BPromise=require(_0x039e('0x4'));var Mustache=require(_0x039e('0x5'));var util=require(_0x039e('0x6'));var path=require('path');var sox=require(_0x039e('0x7'));var csv=require(_0x039e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x039e('0x9'));var _=require('lodash');var squel=require(_0x039e('0xa'));var crypto=require(_0x039e('0xb'));var jsforce=require(_0x039e('0xc'));var deskjs=require(_0x039e('0xd'));var toCsv=require(_0x039e('0x8'));var querystring=require(_0x039e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x039e('0xf'));var qs=require(_0x039e('0x10'));var as=require(_0x039e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x039e('0x12'));var utils=require(_0x039e('0x13'));var config=require(_0x039e('0x14'));var licenseUtil=require(_0x039e('0x15'));var db=require(_0x039e('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5d992f,_0x301252){_0x301252=_0x301252||0xcc;return function(_0x45a617){if(_0x45a617){return _0x5d992f[_0x039e('0x17')](_0x301252);}return _0x5d992f[_0x039e('0x18')](_0x301252)[_0x039e('0x19')]();};}function respondWithResult(_0x348d16,_0x51daaa){_0x51daaa=_0x51daaa||0xc8;return function(_0x4ece95){if(_0x4ece95){return _0x348d16[_0x039e('0x18')](_0x51daaa)['json'](_0x4ece95);}};}function respondWithFilteredResult(_0x144bc4,_0x453d99){return function(_0x37176c){if(_0x37176c){var _0x137be1=typeof _0x453d99[_0x039e('0x1a')]===_0x039e('0x1b')&&typeof _0x453d99[_0x039e('0x1c')]==='undefined';var _0x45520b=_0x37176c['count'];var _0x9cf319=_0x137be1?0x0:_0x453d99[_0x039e('0x1a')];var _0x4c66a2=_0x137be1?_0x37176c[_0x039e('0x1d')]:_0x453d99[_0x039e('0x1a')]+_0x453d99['limit'];var _0x110c51;if(_0x4c66a2>=_0x45520b){_0x4c66a2=_0x45520b;_0x110c51=0xc8;}else{_0x110c51=0xce;}_0x144bc4[_0x039e('0x18')](_0x110c51);return _0x144bc4[_0x039e('0x1e')](_0x039e('0x1f'),_0x9cf319+'-'+_0x4c66a2+'/'+_0x45520b)[_0x039e('0x20')](_0x37176c);}return null;};}function patchUpdates(_0x28892a){return function(_0x336477){try{jsonpatch['apply'](_0x336477,_0x28892a,!![]);}catch(_0xa555de){return BPromise[_0x039e('0x21')](_0xa555de);}return _0x336477[_0x039e('0x22')]();};}function saveUpdates(_0x38335c,_0x57337b){return function(_0x58b9a7){if(_0x58b9a7){return _0x58b9a7['update'](_0x38335c)['then'](function(_0x262b98){return _0x262b98;});}return null;};}function removeEntity(_0x50cce2,_0x1623ce){return function(_0x5c90db){if(_0x5c90db){return _0x5c90db['destroy']()[_0x039e('0x23')](function(){_0x50cce2[_0x039e('0x18')](0xcc)[_0x039e('0x19')]();});}};}function handleEntityNotFound(_0x901a19,_0x240427){return function(_0x2c7611){if(!_0x2c7611){_0x901a19[_0x039e('0x17')](0x194);}return _0x2c7611;};}function handleError(_0x2646be,_0x275b08){_0x275b08=_0x275b08||0x1f4;return function(_0x106d49){logger[_0x039e('0x24')](_0x106d49['stack']);if(_0x106d49['name']){delete _0x106d49[_0x039e('0x25')];}_0x2646be['status'](_0x275b08)[_0x039e('0x26')](_0x106d49);};}exports[_0x039e('0x27')]=function(_0x17ccb8,_0x159841){var _0x250210={},_0x55e567={},_0x38f002={'count':0x0,'rows':[]};var _0x5e1682=_[_0x039e('0x28')](db[_0x039e('0x29')]['rawAttributes'],function(_0x5443b8){return{'name':_0x5443b8[_0x039e('0x2a')],'type':_0x5443b8['type'][_0x039e('0x2b')]};});_0x55e567[_0x039e('0x2c')]=_[_0x039e('0x28')](_0x5e1682,'name');_0x55e567['query']=_[_0x039e('0x2d')](_0x17ccb8[_0x039e('0x2e')]);_0x55e567[_0x039e('0x2f')]=_[_0x039e('0x30')](_0x55e567[_0x039e('0x2c')],_0x55e567['query']);_0x250210[_0x039e('0x31')]=_[_0x039e('0x30')](_0x55e567[_0x039e('0x2c')],qs[_0x039e('0x32')](_0x17ccb8[_0x039e('0x2e')][_0x039e('0x32')]));_0x250210['attributes']=_0x250210['attributes'][_0x039e('0x33')]?_0x250210[_0x039e('0x31')]:_0x55e567[_0x039e('0x2c')];if(!_0x17ccb8['query'][_0x039e('0x34')]('nolimit')){_0x250210[_0x039e('0x1c')]=qs['limit'](_0x17ccb8[_0x039e('0x2e')][_0x039e('0x1c')]);_0x250210[_0x039e('0x1a')]=qs[_0x039e('0x1a')](_0x17ccb8[_0x039e('0x2e')][_0x039e('0x1a')]);}_0x250210['order']=qs[_0x039e('0x35')](_0x17ccb8[_0x039e('0x2e')]['sort']);_0x250210[_0x039e('0x36')]=qs[_0x039e('0x2f')](_[_0x039e('0x37')](_0x17ccb8[_0x039e('0x2e')],_0x55e567[_0x039e('0x2f')]),_0x5e1682);if(_0x17ccb8[_0x039e('0x2e')][_0x039e('0x38')]){_0x250210[_0x039e('0x36')]=_[_0x039e('0x39')](_0x250210[_0x039e('0x36')],{'$or':_['map'](_0x5e1682,function(_0x454590){if(_0x454590['type']!=='VIRTUAL'){var _0x1b8af6={};_0x1b8af6[_0x454590[_0x039e('0x25')]]={'$like':'%'+_0x17ccb8[_0x039e('0x2e')][_0x039e('0x38')]+'%'};return _0x1b8af6;}})});}_0x250210=_[_0x039e('0x39')]({},_0x250210,_0x17ccb8[_0x039e('0x3a')]);var _0x37f284={'where':_0x250210[_0x039e('0x36')]};return db['DeskAccount']['count'](_0x37f284)[_0x039e('0x23')](function(_0xa23a09){_0x38f002['count']=_0xa23a09;if(_0x17ccb8[_0x039e('0x2e')][_0x039e('0x3b')]){_0x250210[_0x039e('0x3c')]=[{'all':!![]}];}return db[_0x039e('0x29')][_0x039e('0x3d')](_0x250210);})[_0x039e('0x23')](function(_0xc4d28f){_0x38f002['rows']=_0xc4d28f;return _0x38f002;})['then'](respondWithFilteredResult(_0x159841,_0x250210))[_0x039e('0x3e')](handleError(_0x159841,null));};exports[_0x039e('0x3f')]=function(_0x43c91c,_0x548634){var _0x5396f3={'raw':![],'where':{'id':_0x43c91c[_0x039e('0x40')]['id']}},_0x30e458={};_0x30e458['model']=_[_0x039e('0x2d')](db['DeskAccount'][_0x039e('0x41')]);_0x30e458[_0x039e('0x2e')]=_[_0x039e('0x2d')](_0x43c91c[_0x039e('0x2e')]);_0x30e458[_0x039e('0x2f')]=_['intersection'](_0x30e458[_0x039e('0x2c')],_0x30e458[_0x039e('0x2e')]);_0x5396f3[_0x039e('0x31')]=_[_0x039e('0x30')](_0x30e458['model'],qs[_0x039e('0x32')](_0x43c91c[_0x039e('0x2e')][_0x039e('0x32')]));_0x5396f3[_0x039e('0x31')]=_0x5396f3['attributes'][_0x039e('0x33')]?_0x5396f3['attributes']:_0x30e458[_0x039e('0x2c')];if(_0x43c91c[_0x039e('0x2e')][_0x039e('0x3b')]){_0x5396f3[_0x039e('0x3c')]=[{'all':!![]}];}_0x5396f3=_[_0x039e('0x39')]({},_0x5396f3,_0x43c91c[_0x039e('0x3a')]);return db['DeskAccount'][_0x039e('0x42')](_0x5396f3)[_0x039e('0x23')](handleEntityNotFound(_0x548634,null))['then'](respondWithResult(_0x548634,null))[_0x039e('0x3e')](handleError(_0x548634,null));};exports[_0x039e('0x43')]=function(_0x4a263c,_0x478997){return db['DeskAccount'][_0x039e('0x43')](_0x4a263c['body'],{})['then'](respondWithResult(_0x478997,0xc9))['catch'](handleError(_0x478997,null));};exports['update']=function(_0x5bc536,_0x5783e8){if(_0x5bc536[_0x039e('0x44')]['id']){delete _0x5bc536['body']['id'];}return db['DeskAccount'][_0x039e('0x42')]({'where':{'id':_0x5bc536[_0x039e('0x40')]['id']}})['then'](handleEntityNotFound(_0x5783e8,null))[_0x039e('0x23')](saveUpdates(_0x5bc536[_0x039e('0x44')],null))['then'](respondWithResult(_0x5783e8,null))[_0x039e('0x3e')](handleError(_0x5783e8,null));};exports[_0x039e('0x45')]=function(_0x1a7448,_0x3ae1f0){return db[_0x039e('0x29')][_0x039e('0x42')]({'where':{'id':_0x1a7448[_0x039e('0x40')]['id']}})[_0x039e('0x23')](handleEntityNotFound(_0x3ae1f0,null))[_0x039e('0x23')](removeEntity(_0x3ae1f0,null))['catch'](handleError(_0x3ae1f0,null));};exports[_0x039e('0x46')]=function(_0x366303,_0x50f77a,_0x17f780){var _0x3a14df={};var _0x4456ac={};var _0x387118;var _0x1af700;return db[_0x039e('0x29')][_0x039e('0x47')]({'where':{'id':_0x366303[_0x039e('0x40')]['id']}})['then'](handleEntityNotFound(_0x50f77a,null))[_0x039e('0x23')](function(_0x446cf7){if(_0x446cf7){_0x387118=_0x446cf7;_0x4456ac[_0x039e('0x2c')]=_[_0x039e('0x2d')](db['DeskConfiguration'][_0x039e('0x41')]);_0x4456ac[_0x039e('0x2e')]=_[_0x039e('0x2d')](_0x366303['query']);_0x4456ac[_0x039e('0x2f')]=_[_0x039e('0x30')](_0x4456ac[_0x039e('0x2c')],_0x4456ac['query']);_0x3a14df[_0x039e('0x31')]=_[_0x039e('0x30')](_0x4456ac[_0x039e('0x2c')],qs['fields'](_0x366303[_0x039e('0x2e')][_0x039e('0x32')]));_0x3a14df['attributes']=_0x3a14df[_0x039e('0x31')][_0x039e('0x33')]?_0x3a14df[_0x039e('0x31')]:_0x4456ac[_0x039e('0x2c')];_0x3a14df[_0x039e('0x48')]=qs[_0x039e('0x35')](_0x366303[_0x039e('0x2e')][_0x039e('0x35')]);_0x3a14df['where']=qs['filters'](_[_0x039e('0x37')](_0x366303[_0x039e('0x2e')],_0x4456ac['filters']));if(_0x366303[_0x039e('0x2e')][_0x039e('0x38')]){_0x3a14df['where']=_[_0x039e('0x39')](_0x3a14df[_0x039e('0x36')],{'$or':_[_0x039e('0x28')](_0x3a14df[_0x039e('0x31')],function(_0x141d86){var _0x1c0018={};_0x1c0018[_0x141d86]={'$like':'%'+_0x366303[_0x039e('0x2e')][_0x039e('0x38')]+'%'};return _0x1c0018;})});}_0x3a14df=_['merge']({},_0x3a14df,_0x366303[_0x039e('0x3a')]);return _0x387118['getConfigurations'](_0x3a14df);}})['then'](function(_0x49191b){if(_0x49191b){_0x1af700=_0x49191b[_0x039e('0x33')];if(!_0x366303[_0x039e('0x2e')][_0x039e('0x34')](_0x039e('0x49'))){_0x3a14df[_0x039e('0x1c')]=qs[_0x039e('0x1c')](_0x366303[_0x039e('0x2e')][_0x039e('0x1c')]);_0x3a14df[_0x039e('0x1a')]=qs['offset'](_0x366303[_0x039e('0x2e')]['offset']);}return _0x387118['getConfigurations'](_0x3a14df);}})['then'](function(_0x41f5ea){if(_0x41f5ea){return _0x41f5ea?{'count':_0x1af700,'rows':_0x41f5ea}:null;}})[_0x039e('0x23')](respondWithResult(_0x50f77a,null))[_0x039e('0x3e')](handleError(_0x50f77a,null));};exports[_0x039e('0x4a')]=function(_0xf55eb0,_0x572e81,_0x2727ab){if(_0xf55eb0['body']['id']){delete _0xf55eb0[_0x039e('0x44')]['id'];}return db[_0x039e('0x29')][_0x039e('0x47')]({'where':{'id':_0xf55eb0[_0x039e('0x40')]['id']}})[_0x039e('0x23')](handleEntityNotFound(_0x572e81,null))[_0x039e('0x23')](function(_0x155c83){if(_0x155c83){_0xf55eb0['body'][_0x039e('0x4b')]=_0x155c83['id'];_0xf55eb0[_0x039e('0x44')][_0x039e('0x4c')]=integrations['getSubjects'](_0xf55eb0[_0x039e('0x44')]['channel'],_0xf55eb0[_0x039e('0x44')][_0x039e('0x4d')]);_0xf55eb0[_0x039e('0x44')]['Descriptions']=integrations[_0x039e('0x4e')](_0xf55eb0['body']['channel'],_0xf55eb0[_0x039e('0x44')][_0x039e('0x4d')]);return db[_0x039e('0x4f')][_0x039e('0x43')](_0xf55eb0[_0x039e('0x44')],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0x039e('0x50')],'as':_0x039e('0x51')}]});}return null;})[_0x039e('0x23')](respondWithResult(_0x572e81,null))[_0x039e('0x3e')](handleError(_0x572e81,null));};exports[_0x039e('0x52')]=function(_0x17ba66,_0x343b5f,_0x1e6f24){var _0x23656c=[{'name':_0x039e('0x53'),'label':_0x039e('0x53'),'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 _0x2ee6fb='';return db[_0x039e('0x29')][_0x039e('0x47')]({'where':{'id':_0x17ba66['params']['id']},'attributes':['id',_0x039e('0x54'),_0x039e('0x55'),_0x039e('0x56'),_0x039e('0x57'),_0x039e('0x58'),'consumerSecret',_0x039e('0x59'),'tokenSecret']})['then'](handleEntityNotFound(_0x343b5f,null))[_0x039e('0x23')](function(_0x299529){if(_0x299529){_0x2ee6fb=_0x299529[_0x039e('0x54')];var _0x453218=_0x2ee6fb[_0x039e('0x5a')](-0x1);if(_0x453218==='/'){_0x2ee6fb=_0x2ee6fb[_0x039e('0x5b')](0x0,_0x2ee6fb[_0x039e('0x5c')](_0x453218));}var _0x3e4972={'method':_0x039e('0x5d'),'uri':util[_0x039e('0x5e')](_0x039e('0x5f'),_0x2ee6fb),'headers':{'Content-Type':_0x039e('0x60'),'Accept':_0x039e('0x60')},'json':!![]};if(_0x299529[_0x039e('0x55')]===_0x039e('0x61')){_0x3e4972[_0x039e('0x62')][_0x039e('0x63')]=util['format'](_0x039e('0x64'),new Buffer(util[_0x039e('0x5e')]('%s:%s',_0x299529['username'],_0x299529[_0x039e('0x57')]))['toString'](_0x039e('0x65')));}return rp(_0x3e4972)[_0x039e('0x23')](function(_0x4af077){return _0x23656c[_0x039e('0x66')](_[_0x039e('0x28')](_0x4af077[_0x039e('0x67')][_0x039e('0x68')],function(_0x14fde9){return{'id':_0x14fde9[_0x039e('0x25')],'name':_0x14fde9[_0x039e('0x25')],'type':_0x14fde9[_0x039e('0x4d')],'active':_0x14fde9[_0x039e('0x69')],'label':_0x14fde9[_0x039e('0x6a')],'custom':!![]};}));});}})[_0x039e('0x23')](function(_0x10902f){return{'count':_0x10902f['length'],'rows':_0x10902f};})[_0x039e('0x23')](respondWithResult(_0x343b5f,null))[_0x039e('0x3e')](function(_0x1f8c26){var _0x48f308=_0x17ba66['query'][_0x039e('0x6b')]?0x1f4:_0x1f8c26['statusCode']||0x1f4;logger[_0x039e('0x24')](_0x039e('0x6c'),_0x039e('0x52'),_0x48f308,JSON[_0x039e('0x6d')](_0x1f8c26));delete _0x1f8c26[_0x039e('0x25')];if(_0x48f308===0x191){_0x48f308=0x190;}_0x343b5f[_0x039e('0x18')](_0x48f308)[_0x039e('0x26')](_0x17ba66[_0x039e('0x2e')][_0x039e('0x6b')]?{'message':_0x039e('0x6e'),'statusCode':_0x1f8c26['statusCode']}:_0x1f8c26);});}; \ No newline at end of file +var _0x8eef=['merge','VIRTUAL','includeAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','getConfigurations','DeskConfiguration','addConfiguration','findOne','AccountId','Subjects','channel','getDescriptions','DeskField','Descriptions','priority','authType','username','password','consumerKey','consumerSecret','token','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label','statusCode','getFields','stringify','test','Wrong\x20credentials','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','map','DeskAccount','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x8eef,0x190));var _0xf8ee=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8eef[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xf8ee('0x0'));var rimraf=require(_0xf8ee('0x1'));var zipdir=require(_0xf8ee('0x2'));var jsonpatch=require(_0xf8ee('0x3'));var rp=require('request-promise');var moment=require(_0xf8ee('0x4'));var BPromise=require(_0xf8ee('0x5'));var Mustache=require(_0xf8ee('0x6'));var util=require(_0xf8ee('0x7'));var path=require('path');var sox=require(_0xf8ee('0x8'));var csv=require(_0xf8ee('0x9'));var ejs=require(_0xf8ee('0xa'));var fs=require('fs');var fs_extra=require(_0xf8ee('0xb'));var _=require(_0xf8ee('0xc'));var squel=require(_0xf8ee('0xd'));var crypto=require('crypto');var jsforce=require(_0xf8ee('0xe'));var deskjs=require(_0xf8ee('0xf'));var toCsv=require(_0xf8ee('0x9'));var querystring=require(_0xf8ee('0x10'));var Papa=require(_0xf8ee('0x11'));var Redis=require('ioredis');var authService=require(_0xf8ee('0x12'));var qs=require(_0xf8ee('0x13'));var as=require(_0xf8ee('0x14'));var hardwareService=require(_0xf8ee('0x15'));var logger=require(_0xf8ee('0x16'))(_0xf8ee('0x17'));var utils=require('../../config/utils');var config=require(_0xf8ee('0x18'));var licenseUtil=require(_0xf8ee('0x19'));var db=require(_0xf8ee('0x1a'))['db'];var integrations=require(_0xf8ee('0x1b'));function respondWithStatusCode(_0x2c0d7e,_0x4a5de8){_0x4a5de8=_0x4a5de8||0xcc;return function(_0x5cb18d){if(_0x5cb18d){return _0x2c0d7e[_0xf8ee('0x1c')](_0x4a5de8);}return _0x2c0d7e[_0xf8ee('0x1d')](_0x4a5de8)[_0xf8ee('0x1e')]();};}function respondWithResult(_0xebbb4,_0x146c48){_0x146c48=_0x146c48||0xc8;return function(_0x2c5479){if(_0x2c5479){return _0xebbb4[_0xf8ee('0x1d')](_0x146c48)['json'](_0x2c5479);}};}function respondWithFilteredResult(_0xcfb748,_0x37db3a){return function(_0x39f9ca){if(_0x39f9ca){var _0x439e4b=typeof _0x37db3a[_0xf8ee('0x1f')]==='undefined'&&typeof _0x37db3a[_0xf8ee('0x20')]===_0xf8ee('0x21');var _0x59c3c7=_0x39f9ca[_0xf8ee('0x22')];var _0x52e4aa=_0x439e4b?0x0:_0x37db3a[_0xf8ee('0x1f')];var _0x1cdb62=_0x439e4b?_0x39f9ca['count']:_0x37db3a[_0xf8ee('0x1f')]+_0x37db3a[_0xf8ee('0x20')];var _0x360858;if(_0x1cdb62>=_0x59c3c7){_0x1cdb62=_0x59c3c7;_0x360858=0xc8;}else{_0x360858=0xce;}_0xcfb748[_0xf8ee('0x1d')](_0x360858);return _0xcfb748[_0xf8ee('0x23')](_0xf8ee('0x24'),_0x52e4aa+'-'+_0x1cdb62+'/'+_0x59c3c7)[_0xf8ee('0x25')](_0x39f9ca);}return null;};}function patchUpdates(_0x3ab137){return function(_0x5a5987){try{jsonpatch[_0xf8ee('0x26')](_0x5a5987,_0x3ab137,!![]);}catch(_0xcbfd39){return BPromise[_0xf8ee('0x27')](_0xcbfd39);}return _0x5a5987[_0xf8ee('0x28')]();};}function saveUpdates(_0x471b99,_0x25ef54){return function(_0x59e756){if(_0x59e756){return _0x59e756[_0xf8ee('0x29')](_0x471b99)[_0xf8ee('0x2a')](function(_0x4e6394){return _0x4e6394;});}return null;};}function removeEntity(_0x5c63fa,_0x79b183){return function(_0x568d97){if(_0x568d97){return _0x568d97[_0xf8ee('0x2b')]()['then'](function(){_0x5c63fa[_0xf8ee('0x1d')](0xcc)[_0xf8ee('0x1e')]();});}};}function handleEntityNotFound(_0x515235,_0x39a5ad){return function(_0x3157ed){if(!_0x3157ed){_0x515235['sendStatus'](0x194);}return _0x3157ed;};}function handleError(_0x2f86d3,_0x515361){_0x515361=_0x515361||0x1f4;return function(_0x1f7a5e){logger[_0xf8ee('0x2c')](_0x1f7a5e['stack']);if(_0x1f7a5e[_0xf8ee('0x2d')]){delete _0x1f7a5e[_0xf8ee('0x2d')];}_0x2f86d3[_0xf8ee('0x1d')](_0x515361)[_0xf8ee('0x2e')](_0x1f7a5e);};}exports['index']=function(_0x3495d6,_0x1e9782){var _0x2da113={},_0x342e46={},_0x2cfe99={'count':0x0,'rows':[]};var _0x407e82=_[_0xf8ee('0x2f')](db[_0xf8ee('0x30')]['rawAttributes'],function(_0x5c2e73){return{'name':_0x5c2e73['fieldName'],'type':_0x5c2e73[_0xf8ee('0x31')]['key']};});_0x342e46['model']=_['map'](_0x407e82,_0xf8ee('0x2d'));_0x342e46[_0xf8ee('0x32')]=_[_0xf8ee('0x33')](_0x3495d6[_0xf8ee('0x32')]);_0x342e46[_0xf8ee('0x34')]=_[_0xf8ee('0x35')](_0x342e46[_0xf8ee('0x36')],_0x342e46[_0xf8ee('0x32')]);_0x2da113[_0xf8ee('0x37')]=_[_0xf8ee('0x35')](_0x342e46['model'],qs['fields'](_0x3495d6[_0xf8ee('0x32')][_0xf8ee('0x38')]));_0x2da113[_0xf8ee('0x37')]=_0x2da113['attributes'][_0xf8ee('0x39')]?_0x2da113[_0xf8ee('0x37')]:_0x342e46['model'];if(!_0x3495d6[_0xf8ee('0x32')][_0xf8ee('0x3a')]('nolimit')){_0x2da113[_0xf8ee('0x20')]=qs['limit'](_0x3495d6['query']['limit']);_0x2da113['offset']=qs['offset'](_0x3495d6[_0xf8ee('0x32')][_0xf8ee('0x1f')]);}_0x2da113[_0xf8ee('0x3b')]=qs[_0xf8ee('0x3c')](_0x3495d6[_0xf8ee('0x32')][_0xf8ee('0x3c')]);_0x2da113[_0xf8ee('0x3d')]=qs[_0xf8ee('0x34')](_[_0xf8ee('0x3e')](_0x3495d6['query'],_0x342e46[_0xf8ee('0x34')]),_0x407e82);if(_0x3495d6[_0xf8ee('0x32')][_0xf8ee('0x3f')]){_0x2da113[_0xf8ee('0x3d')]=_[_0xf8ee('0x40')](_0x2da113[_0xf8ee('0x3d')],{'$or':_[_0xf8ee('0x2f')](_0x407e82,function(_0x473cef){if(_0x473cef[_0xf8ee('0x31')]!==_0xf8ee('0x41')){var _0x3afcbb={};_0x3afcbb[_0x473cef[_0xf8ee('0x2d')]]={'$like':'%'+_0x3495d6[_0xf8ee('0x32')][_0xf8ee('0x3f')]+'%'};return _0x3afcbb;}})});}_0x2da113=_[_0xf8ee('0x40')]({},_0x2da113,_0x3495d6['options']);var _0x2ceb4e={'where':_0x2da113[_0xf8ee('0x3d')]};return db[_0xf8ee('0x30')][_0xf8ee('0x22')](_0x2ceb4e)[_0xf8ee('0x2a')](function(_0x2afc8a){_0x2cfe99['count']=_0x2afc8a;if(_0x3495d6[_0xf8ee('0x32')][_0xf8ee('0x42')]){_0x2da113['include']=[{'all':!![]}];}return db[_0xf8ee('0x30')]['findAll'](_0x2da113);})[_0xf8ee('0x2a')](function(_0x1a86c8){_0x2cfe99[_0xf8ee('0x43')]=_0x1a86c8;return _0x2cfe99;})[_0xf8ee('0x2a')](respondWithFilteredResult(_0x1e9782,_0x2da113))[_0xf8ee('0x44')](handleError(_0x1e9782,null));};exports[_0xf8ee('0x45')]=function(_0x29ec45,_0x440eed){var _0x42abd9={'raw':![],'where':{'id':_0x29ec45[_0xf8ee('0x46')]['id']}},_0x219207={};_0x219207[_0xf8ee('0x36')]=_[_0xf8ee('0x33')](db['DeskAccount'][_0xf8ee('0x47')]);_0x219207[_0xf8ee('0x32')]=_[_0xf8ee('0x33')](_0x29ec45['query']);_0x219207[_0xf8ee('0x34')]=_[_0xf8ee('0x35')](_0x219207[_0xf8ee('0x36')],_0x219207[_0xf8ee('0x32')]);_0x42abd9[_0xf8ee('0x37')]=_[_0xf8ee('0x35')](_0x219207[_0xf8ee('0x36')],qs[_0xf8ee('0x38')](_0x29ec45[_0xf8ee('0x32')][_0xf8ee('0x38')]));_0x42abd9[_0xf8ee('0x37')]=_0x42abd9[_0xf8ee('0x37')][_0xf8ee('0x39')]?_0x42abd9['attributes']:_0x219207['model'];if(_0x29ec45[_0xf8ee('0x32')]['includeAll']){_0x42abd9[_0xf8ee('0x48')]=[{'all':!![]}];}_0x42abd9=_['merge']({},_0x42abd9,_0x29ec45[_0xf8ee('0x49')]);return db[_0xf8ee('0x30')][_0xf8ee('0x4a')](_0x42abd9)[_0xf8ee('0x2a')](handleEntityNotFound(_0x440eed,null))[_0xf8ee('0x2a')](respondWithResult(_0x440eed,null))[_0xf8ee('0x44')](handleError(_0x440eed,null));};exports[_0xf8ee('0x4b')]=function(_0x4346c8,_0x4b80d5){return db[_0xf8ee('0x30')][_0xf8ee('0x4b')](_0x4346c8[_0xf8ee('0x4c')],{})[_0xf8ee('0x2a')](respondWithResult(_0x4b80d5,0xc9))['catch'](handleError(_0x4b80d5,null));};exports['update']=function(_0x325292,_0x54543c){if(_0x325292[_0xf8ee('0x4c')]['id']){delete _0x325292[_0xf8ee('0x4c')]['id'];}return db[_0xf8ee('0x30')][_0xf8ee('0x4a')]({'where':{'id':_0x325292[_0xf8ee('0x46')]['id']}})[_0xf8ee('0x2a')](handleEntityNotFound(_0x54543c,null))['then'](saveUpdates(_0x325292[_0xf8ee('0x4c')],null))[_0xf8ee('0x2a')](respondWithResult(_0x54543c,null))[_0xf8ee('0x44')](handleError(_0x54543c,null));};exports[_0xf8ee('0x2b')]=function(_0x56bd4c,_0x3844c2){return db[_0xf8ee('0x30')]['find']({'where':{'id':_0x56bd4c[_0xf8ee('0x46')]['id']}})[_0xf8ee('0x2a')](handleEntityNotFound(_0x3844c2,null))[_0xf8ee('0x2a')](removeEntity(_0x3844c2,null))[_0xf8ee('0x44')](handleError(_0x3844c2,null));};exports[_0xf8ee('0x4d')]=function(_0x339b2d,_0xc418ec,_0x4a32ae){var _0x141791={};var _0x881754={};var _0x5983ab;var _0x3b79a3;return db[_0xf8ee('0x30')]['findOne']({'where':{'id':_0x339b2d[_0xf8ee('0x46')]['id']}})[_0xf8ee('0x2a')](handleEntityNotFound(_0xc418ec,null))[_0xf8ee('0x2a')](function(_0x481437){if(_0x481437){_0x5983ab=_0x481437;_0x881754[_0xf8ee('0x36')]=_[_0xf8ee('0x33')](db[_0xf8ee('0x4e')][_0xf8ee('0x47')]);_0x881754[_0xf8ee('0x32')]=_[_0xf8ee('0x33')](_0x339b2d[_0xf8ee('0x32')]);_0x881754[_0xf8ee('0x34')]=_[_0xf8ee('0x35')](_0x881754[_0xf8ee('0x36')],_0x881754[_0xf8ee('0x32')]);_0x141791[_0xf8ee('0x37')]=_[_0xf8ee('0x35')](_0x881754[_0xf8ee('0x36')],qs['fields'](_0x339b2d[_0xf8ee('0x32')][_0xf8ee('0x38')]));_0x141791['attributes']=_0x141791[_0xf8ee('0x37')][_0xf8ee('0x39')]?_0x141791[_0xf8ee('0x37')]:_0x881754['model'];_0x141791[_0xf8ee('0x3b')]=qs['sort'](_0x339b2d[_0xf8ee('0x32')][_0xf8ee('0x3c')]);_0x141791[_0xf8ee('0x3d')]=qs[_0xf8ee('0x34')](_[_0xf8ee('0x3e')](_0x339b2d['query'],_0x881754['filters']));if(_0x339b2d['query'][_0xf8ee('0x3f')]){_0x141791[_0xf8ee('0x3d')]=_[_0xf8ee('0x40')](_0x141791[_0xf8ee('0x3d')],{'$or':_['map'](_0x141791[_0xf8ee('0x37')],function(_0x3a6540){var _0x1a36ae={};_0x1a36ae[_0x3a6540]={'$like':'%'+_0x339b2d[_0xf8ee('0x32')][_0xf8ee('0x3f')]+'%'};return _0x1a36ae;})});}_0x141791=_[_0xf8ee('0x40')]({},_0x141791,_0x339b2d[_0xf8ee('0x49')]);return _0x5983ab[_0xf8ee('0x4d')](_0x141791);}})[_0xf8ee('0x2a')](function(_0x5a4e0d){if(_0x5a4e0d){_0x3b79a3=_0x5a4e0d[_0xf8ee('0x39')];if(!_0x339b2d['query'][_0xf8ee('0x3a')]('nolimit')){_0x141791[_0xf8ee('0x20')]=qs[_0xf8ee('0x20')](_0x339b2d[_0xf8ee('0x32')][_0xf8ee('0x20')]);_0x141791['offset']=qs[_0xf8ee('0x1f')](_0x339b2d[_0xf8ee('0x32')][_0xf8ee('0x1f')]);}return _0x5983ab[_0xf8ee('0x4d')](_0x141791);}})[_0xf8ee('0x2a')](function(_0x27afa3){if(_0x27afa3){return _0x27afa3?{'count':_0x3b79a3,'rows':_0x27afa3}:null;}})['then'](respondWithResult(_0xc418ec,null))[_0xf8ee('0x44')](handleError(_0xc418ec,null));};exports[_0xf8ee('0x4f')]=function(_0x31e192,_0x1fed19,_0x55a5c8){if(_0x31e192[_0xf8ee('0x4c')]['id']){delete _0x31e192[_0xf8ee('0x4c')]['id'];}return db[_0xf8ee('0x30')][_0xf8ee('0x50')]({'where':{'id':_0x31e192[_0xf8ee('0x46')]['id']}})[_0xf8ee('0x2a')](handleEntityNotFound(_0x1fed19,null))[_0xf8ee('0x2a')](function(_0x2f4933){if(_0x2f4933){_0x31e192['body'][_0xf8ee('0x51')]=_0x2f4933['id'];_0x31e192['body'][_0xf8ee('0x52')]=integrations['getSubjects'](_0x31e192['body'][_0xf8ee('0x53')],_0x31e192[_0xf8ee('0x4c')][_0xf8ee('0x31')]);_0x31e192[_0xf8ee('0x4c')]['Descriptions']=integrations[_0xf8ee('0x54')](_0x31e192['body']['channel'],_0x31e192['body'][_0xf8ee('0x31')]);return db[_0xf8ee('0x4e')][_0xf8ee('0x4b')](_0x31e192['body'],{'include':[{'model':db[_0xf8ee('0x55')],'as':_0xf8ee('0x52')},{'model':db[_0xf8ee('0x55')],'as':_0xf8ee('0x56')}]});}return null;})[_0xf8ee('0x2a')](respondWithResult(_0x1fed19,null))[_0xf8ee('0x44')](handleError(_0x1fed19,null));};exports['getFields']=function(_0x4a37ae,_0x2bead3,_0x5a2683){var _0x584bce=[{'name':'priority','label':_0xf8ee('0x57'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x3793e8='';return db[_0xf8ee('0x30')][_0xf8ee('0x50')]({'where':{'id':_0x4a37ae[_0xf8ee('0x46')]['id']},'attributes':['id','remoteUri',_0xf8ee('0x58'),_0xf8ee('0x59'),_0xf8ee('0x5a'),_0xf8ee('0x5b'),_0xf8ee('0x5c'),_0xf8ee('0x5d'),'tokenSecret']})[_0xf8ee('0x2a')](handleEntityNotFound(_0x2bead3,null))[_0xf8ee('0x2a')](function(_0x2d6061){if(_0x2d6061){_0x3793e8=_0x2d6061['remoteUri'];var _0x48b9fe=_0x3793e8['slice'](-0x1);if(_0x48b9fe==='/'){_0x3793e8=_0x3793e8[_0xf8ee('0x5e')](0x0,_0x3793e8[_0xf8ee('0x5f')](_0x48b9fe));}var _0x5c2b30={'method':_0xf8ee('0x60'),'uri':util[_0xf8ee('0x61')](_0xf8ee('0x62'),_0x3793e8),'headers':{'Content-Type':'application/json','Accept':_0xf8ee('0x63')},'json':!![]};if(_0x2d6061[_0xf8ee('0x58')]===_0xf8ee('0x64')){_0x5c2b30['headers'][_0xf8ee('0x65')]=util[_0xf8ee('0x61')](_0xf8ee('0x66'),new Buffer(util[_0xf8ee('0x61')](_0xf8ee('0x67'),_0x2d6061[_0xf8ee('0x59')],_0x2d6061[_0xf8ee('0x5a')]))[_0xf8ee('0x68')](_0xf8ee('0x69')));}return rp(_0x5c2b30)['then'](function(_0x3c0e8f){return _0x584bce[_0xf8ee('0x6a')](_[_0xf8ee('0x2f')](_0x3c0e8f[_0xf8ee('0x6b')][_0xf8ee('0x6c')],function(_0x352cc2){return{'id':_0x352cc2[_0xf8ee('0x2d')],'name':_0x352cc2[_0xf8ee('0x2d')],'type':_0x352cc2[_0xf8ee('0x31')],'active':_0x352cc2[_0xf8ee('0x6d')],'label':_0x352cc2[_0xf8ee('0x6e')],'custom':!![]};}));});}})[_0xf8ee('0x2a')](function(_0x30fcd7){return{'count':_0x30fcd7[_0xf8ee('0x39')],'rows':_0x30fcd7};})[_0xf8ee('0x2a')](respondWithResult(_0x2bead3,null))[_0xf8ee('0x44')](function(_0x37f9d9){var _0x7d6fce=_0x4a37ae['query']['test']?0x1f4:_0x37f9d9[_0xf8ee('0x6f')]||0x1f4;logger[_0xf8ee('0x2c')]('getFields,\x20%s,\x20%s,\x20%s',_0xf8ee('0x70'),_0x7d6fce,JSON[_0xf8ee('0x71')](_0x37f9d9));delete _0x37f9d9[_0xf8ee('0x2d')];if(_0x7d6fce===0x191){_0x7d6fce=0x190;}_0x2bead3['status'](_0x7d6fce)['send'](_0x4a37ae[_0xf8ee('0x32')][_0xf8ee('0x72')]?{'message':_0xf8ee('0x73'),'statusCode':_0x37f9d9[_0xf8ee('0x6f')]}:_0x37f9d9);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 98f3c1d..af85d2c 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 _0xdd28=['int_desk_accounts','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount'];(function(_0x4d94d,_0x584295){var _0x664f2=function(_0x9b1409){while(--_0x9b1409){_0x4d94d['push'](_0x4d94d['shift']());}};_0x664f2(++_0x584295);}(_0xdd28,0x181));var _0x8dd2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd28[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8dd2('0x0'));var util=require('util');var logger=require(_0x8dd2('0x1'))(_0x8dd2('0x2'));var moment=require(_0x8dd2('0x3'));var BPromise=require('bluebird');var rp=require(_0x8dd2('0x4'));var fs=require('fs');var path=require(_0x8dd2('0x5'));var rimraf=require('rimraf');var config=require(_0x8dd2('0x6'));var attributes=require(_0x8dd2('0x7'));var integrations=require(_0x8dd2('0x8'));module['exports']=function(_0x83cf9,_0xb3a32b){return _0x83cf9[_0x8dd2('0x9')](_0x8dd2('0xa'),attributes,{'tableName':_0x8dd2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10fe=['rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','int_desk_accounts','api','moment','bluebird','request-promise','path'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x10fe,0xd7));var _0xe10f=function(_0x5b7619,_0x4d50f8){_0x5b7619=_0x5b7619-0x0;var _0x2b3134=_0x10fe[_0x5b7619];return _0x2b3134;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe10f('0x0'));var moment=require(_0xe10f('0x1'));var BPromise=require(_0xe10f('0x2'));var rp=require(_0xe10f('0x3'));var fs=require('fs');var path=require(_0xe10f('0x4'));var rimraf=require(_0xe10f('0x5'));var config=require(_0xe10f('0x6'));var attributes=require(_0xe10f('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xe10f('0x8')]=function(_0x49fa18,_0x5bcb7e){return _0x49fa18[_0xe10f('0x9')]('DeskAccount',attributes,{'tableName':_0xe10f('0xa'),'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 d7f3570..c49cf03 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 _0xfc84=['include','model','map','GetDeskAccount','stringify','ShowDeskAccount','find','then','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','DeskAccount','findAll','options','raw','where','attributes'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xfc84,0x121));var _0x4fc8=function(_0x4e1926,_0x2415d6){_0x4e1926=_0x4e1926-0x0;var _0x85fa41=_0xfc84[_0x4e1926];return _0x85fa41;};'use strict';var _=require(_0x4fc8('0x0'));var util=require('util');var moment=require(_0x4fc8('0x1'));var BPromise=require(_0x4fc8('0x2'));var rs=require(_0x4fc8('0x3'));var fs=require('fs');var Redis=require(_0x4fc8('0x4'));var db=require(_0x4fc8('0x5'))['db'];var utils=require(_0x4fc8('0x6'));var logger=require('../../config/logger')(_0x4fc8('0x7'));var config=require(_0x4fc8('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4fc8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5604a7,_0xf481f3,_0x58c60e){return new BPromise(function(_0x5e0842,_0x4d5156){return client[_0x4fc8('0xa')](_0x5604a7,_0x58c60e)['then'](function(_0x26ac4e){logger[_0x4fc8('0xb')](_0x4fc8('0xc'),_0xf481f3,_0x4fc8('0xd'));logger[_0x4fc8('0xe')](_0x4fc8('0xf'),_0xf481f3,_0x4fc8('0xd'),JSON['stringify'](_0x26ac4e));if(_0x26ac4e['error']){if(_0x26ac4e[_0x4fc8('0x10')][_0x4fc8('0x11')]===0x1f4){logger[_0x4fc8('0x10')](_0x4fc8('0xc'),_0xf481f3,_0x26ac4e[_0x4fc8('0x10')]['message']);return _0x4d5156(_0x26ac4e[_0x4fc8('0x10')][_0x4fc8('0x12')]);}logger['error'](_0x4fc8('0xc'),_0xf481f3,_0x26ac4e['error'][_0x4fc8('0x12')]);return _0x5e0842(_0x26ac4e[_0x4fc8('0x10')][_0x4fc8('0x12')]);}else{logger[_0x4fc8('0xb')](_0x4fc8('0xc'),_0xf481f3,'request\x20sent');_0x5e0842(_0x26ac4e[_0x4fc8('0x13')][_0x4fc8('0x12')]);}})['catch'](function(_0x51ae60){logger[_0x4fc8('0x10')]('DeskAccount,\x20%s,\x20%s',_0xf481f3,_0x51ae60);_0x4d5156(_0x51ae60);});});}exports['GetDeskAccount']=function(_0x595139){var _0x2ce172=this;return new Promise(function(_0xae75f4,_0x30b59e){return db[_0x4fc8('0x14')][_0x4fc8('0x15')]({'raw':_0x595139[_0x4fc8('0x16')]?_0x595139[_0x4fc8('0x16')][_0x4fc8('0x17')]===undefined?!![]:![]:!![],'where':_0x595139[_0x4fc8('0x16')]?_0x595139['options'][_0x4fc8('0x18')]||null:null,'attributes':_0x595139[_0x4fc8('0x16')]?_0x595139[_0x4fc8('0x16')][_0x4fc8('0x19')]||null:null,'limit':_0x595139['options']?_0x595139[_0x4fc8('0x16')]['limit']||null:null,'include':_0x595139[_0x4fc8('0x16')]?_0x595139[_0x4fc8('0x16')][_0x4fc8('0x1a')]?_['map'](_0x595139[_0x4fc8('0x16')][_0x4fc8('0x1a')],function(_0x5d3928){return{'model':db[_0x5d3928[_0x4fc8('0x1b')]],'as':_0x5d3928['as'],'attributes':_0x5d3928[_0x4fc8('0x19')],'include':_0x5d3928[_0x4fc8('0x1a')]?_[_0x4fc8('0x1c')](_0x5d3928[_0x4fc8('0x1a')],function(_0x2849aa){return{'model':db[_0x2849aa[_0x4fc8('0x1b')]],'as':_0x2849aa['as'],'attributes':_0x2849aa['attributes'],'include':_0x2849aa[_0x4fc8('0x1a')]?_[_0x4fc8('0x1c')](_0x2849aa['include'],function(_0x5ded98){return{'model':db[_0x5ded98[_0x4fc8('0x1b')]],'as':_0x5ded98['as'],'attributes':_0x5ded98['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f56a3){logger['info']('GetDeskAccount',_0x595139);logger[_0x4fc8('0xe')](_0x4fc8('0x1d'),_0x595139,JSON[_0x4fc8('0x1e')](_0x1f56a3));_0xae75f4(_0x1f56a3);})['catch'](function(_0x4b5e6c){logger[_0x4fc8('0x10')]('GetDeskAccount',_0x4b5e6c[_0x4fc8('0x12')],_0x595139);_0x30b59e(_0x2ce172['error'](0x1f4,_0x4b5e6c['message']));});});};exports[_0x4fc8('0x1f')]=function(_0x36dac3){var _0x51a571=this;return new Promise(function(_0x48df2e,_0x1da473){return db['DeskAccount'][_0x4fc8('0x20')]({'raw':_0x36dac3[_0x4fc8('0x16')]?_0x36dac3[_0x4fc8('0x16')][_0x4fc8('0x17')]===undefined?!![]:![]:!![],'where':_0x36dac3[_0x4fc8('0x16')]?_0x36dac3[_0x4fc8('0x16')][_0x4fc8('0x18')]||null:null,'attributes':_0x36dac3[_0x4fc8('0x16')]?_0x36dac3[_0x4fc8('0x16')][_0x4fc8('0x19')]||null:null,'include':_0x36dac3[_0x4fc8('0x16')]?_0x36dac3[_0x4fc8('0x16')]['include']?_['map'](_0x36dac3['options'][_0x4fc8('0x1a')],function(_0x252fe4){return{'model':db[_0x252fe4['model']],'as':_0x252fe4['as'],'attributes':_0x252fe4[_0x4fc8('0x19')],'include':_0x252fe4['include']?_['map'](_0x252fe4[_0x4fc8('0x1a')],function(_0x53cb5e){return{'model':db[_0x53cb5e[_0x4fc8('0x1b')]],'as':_0x53cb5e['as'],'attributes':_0x53cb5e[_0x4fc8('0x19')],'include':_0x53cb5e[_0x4fc8('0x1a')]?_[_0x4fc8('0x1c')](_0x53cb5e[_0x4fc8('0x1a')],function(_0x4f480b){return{'model':db[_0x4f480b[_0x4fc8('0x1b')]],'as':_0x4f480b['as'],'attributes':_0x4f480b['attributes']};}):[]};}):[]};}):[]:[]})[_0x4fc8('0x21')](function(_0xaf3c57){logger['info'](_0x4fc8('0x1f'),_0x36dac3);logger[_0x4fc8('0xe')](_0x4fc8('0x1f'),_0x36dac3,JSON[_0x4fc8('0x1e')](_0xaf3c57));_0x48df2e(_0xaf3c57);})[_0x4fc8('0x22')](function(_0x52bcff){logger[_0x4fc8('0x10')]('ShowDeskAccount',_0x52bcff[_0x4fc8('0x12')],_0x36dac3);_0x1da473(_0x51a571[_0x4fc8('0x10')](0x1f4,_0x52bcff[_0x4fc8('0x12')]));});});}; \ No newline at end of file +var _0x7dcb=['http','then','info','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','options','where','include','model','attributes','map','debug','find','raw','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7dcb,0xe8));var _0xb7dc=function(_0x129ed5,_0x4c5b10){_0x129ed5=_0x129ed5-0x0;var _0x46443c=_0x7dcb[_0x129ed5];return _0x46443c;};'use strict';var _=require(_0xb7dc('0x0'));var util=require(_0xb7dc('0x1'));var moment=require(_0xb7dc('0x2'));var BPromise=require(_0xb7dc('0x3'));var rs=require(_0xb7dc('0x4'));var fs=require('fs');var Redis=require(_0xb7dc('0x5'));var db=require(_0xb7dc('0x6'))['db'];var utils=require(_0xb7dc('0x7'));var logger=require(_0xb7dc('0x8'))(_0xb7dc('0x9'));var config=require(_0xb7dc('0xa'));var jayson=require(_0xb7dc('0xb'));var client=jayson[_0xb7dc('0xc')][_0xb7dc('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5aae92,_0xed3e1d,_0x419ed8){return new BPromise(function(_0x318bae,_0x55407e){return client['request'](_0x5aae92,_0x419ed8)[_0xb7dc('0xe')](function(_0x4b2835){logger[_0xb7dc('0xf')]('DeskAccount,\x20%s,\x20%s',_0xed3e1d,'request\x20sent');logger['debug'](_0xb7dc('0x10'),_0xed3e1d,'request\x20sent',JSON[_0xb7dc('0x11')](_0x4b2835));if(_0x4b2835[_0xb7dc('0x12')]){if(_0x4b2835[_0xb7dc('0x12')]['code']===0x1f4){logger[_0xb7dc('0x12')](_0xb7dc('0x13'),_0xed3e1d,_0x4b2835[_0xb7dc('0x12')][_0xb7dc('0x14')]);return _0x55407e(_0x4b2835[_0xb7dc('0x12')]['message']);}logger['error'](_0xb7dc('0x13'),_0xed3e1d,_0x4b2835[_0xb7dc('0x12')][_0xb7dc('0x14')]);return _0x318bae(_0x4b2835[_0xb7dc('0x12')]['message']);}else{logger[_0xb7dc('0xf')]('DeskAccount,\x20%s,\x20%s',_0xed3e1d,'request\x20sent');_0x318bae(_0x4b2835[_0xb7dc('0x15')][_0xb7dc('0x14')]);}})[_0xb7dc('0x16')](function(_0x29eed9){logger[_0xb7dc('0x12')](_0xb7dc('0x13'),_0xed3e1d,_0x29eed9);_0x55407e(_0x29eed9);});});}exports[_0xb7dc('0x17')]=function(_0x1572d1){var _0x30b939=this;return new Promise(function(_0x4d1eb6,_0x429274){return db[_0xb7dc('0x18')]['findAll']({'raw':_0x1572d1['options']?_0x1572d1[_0xb7dc('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1572d1[_0xb7dc('0x19')]?_0x1572d1[_0xb7dc('0x19')][_0xb7dc('0x1a')]||null:null,'attributes':_0x1572d1['options']?_0x1572d1[_0xb7dc('0x19')]['attributes']||null:null,'limit':_0x1572d1[_0xb7dc('0x19')]?_0x1572d1[_0xb7dc('0x19')]['limit']||null:null,'include':_0x1572d1['options']?_0x1572d1[_0xb7dc('0x19')][_0xb7dc('0x1b')]?_['map'](_0x1572d1[_0xb7dc('0x19')][_0xb7dc('0x1b')],function(_0x162e40){return{'model':db[_0x162e40[_0xb7dc('0x1c')]],'as':_0x162e40['as'],'attributes':_0x162e40[_0xb7dc('0x1d')],'include':_0x162e40['include']?_['map'](_0x162e40[_0xb7dc('0x1b')],function(_0x4d7885){return{'model':db[_0x4d7885[_0xb7dc('0x1c')]],'as':_0x4d7885['as'],'attributes':_0x4d7885[_0xb7dc('0x1d')],'include':_0x4d7885['include']?_[_0xb7dc('0x1e')](_0x4d7885[_0xb7dc('0x1b')],function(_0x113859){return{'model':db[_0x113859[_0xb7dc('0x1c')]],'as':_0x113859['as'],'attributes':_0x113859['attributes']};}):[]};}):[]};}):[]:[]})[_0xb7dc('0xe')](function(_0x5a54a4){logger[_0xb7dc('0xf')](_0xb7dc('0x17'),_0x1572d1);logger[_0xb7dc('0x1f')](_0xb7dc('0x17'),_0x1572d1,JSON[_0xb7dc('0x11')](_0x5a54a4));_0x4d1eb6(_0x5a54a4);})[_0xb7dc('0x16')](function(_0x398c52){logger[_0xb7dc('0x12')](_0xb7dc('0x17'),_0x398c52[_0xb7dc('0x14')],_0x1572d1);_0x429274(_0x30b939['error'](0x1f4,_0x398c52[_0xb7dc('0x14')]));});});};exports['ShowDeskAccount']=function(_0xee01ef){var _0x3a975b=this;return new Promise(function(_0x402207,_0x28737e){return db[_0xb7dc('0x18')][_0xb7dc('0x20')]({'raw':_0xee01ef[_0xb7dc('0x19')]?_0xee01ef['options'][_0xb7dc('0x21')]===undefined?!![]:![]:!![],'where':_0xee01ef[_0xb7dc('0x19')]?_0xee01ef[_0xb7dc('0x19')][_0xb7dc('0x1a')]||null:null,'attributes':_0xee01ef[_0xb7dc('0x19')]?_0xee01ef[_0xb7dc('0x19')][_0xb7dc('0x1d')]||null:null,'include':_0xee01ef[_0xb7dc('0x19')]?_0xee01ef['options'][_0xb7dc('0x1b')]?_[_0xb7dc('0x1e')](_0xee01ef[_0xb7dc('0x19')]['include'],function(_0x3a2de4){return{'model':db[_0x3a2de4[_0xb7dc('0x1c')]],'as':_0x3a2de4['as'],'attributes':_0x3a2de4[_0xb7dc('0x1d')],'include':_0x3a2de4[_0xb7dc('0x1b')]?_[_0xb7dc('0x1e')](_0x3a2de4[_0xb7dc('0x1b')],function(_0x41be87){return{'model':db[_0x41be87['model']],'as':_0x41be87['as'],'attributes':_0x41be87[_0xb7dc('0x1d')],'include':_0x41be87[_0xb7dc('0x1b')]?_[_0xb7dc('0x1e')](_0x41be87[_0xb7dc('0x1b')],function(_0x3824d8){return{'model':db[_0x3824d8['model']],'as':_0x3824d8['as'],'attributes':_0x3824d8['attributes']};}):[]};}):[]};}):[]:[]})[_0xb7dc('0xe')](function(_0x39d0f5){logger[_0xb7dc('0xf')](_0xb7dc('0x22'),_0xee01ef);logger[_0xb7dc('0x1f')](_0xb7dc('0x22'),_0xee01ef,JSON['stringify'](_0x39d0f5));_0x402207(_0x39d0f5);})[_0xb7dc('0x16')](function(_0x53c4df){logger['error'](_0xb7dc('0x22'),_0x53c4df[_0xb7dc('0x14')],_0xee01ef);_0x28737e(_0x3a975b['error'](0x1f4,_0x53c4df[_0xb7dc('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 6c18e0a..64cd855 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x2ba7b5,_0x2364df){var _0x182ca1=function(_0x26266e){while(--_0x26266e){_0x2ba7b5['push'](_0x2ba7b5['shift']());}};_0x182ca1(++_0x2364df);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file +var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x1941ee,_0x3b65e7){var _0x2aad97=function(_0x295fdd){while(--_0x295fdd){_0x1941ee['push'](_0x1941ee['shift']());}};_0x2aad97(++_0x3b65e7);}(_0xedd9,0xfc));var _0x9edd=function(_0x34bfe9,_0x32e6b9){_0x34bfe9=_0x34bfe9-0x0;var _0x12958a=_0xedd9[_0x34bfe9];return _0x12958a;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index d4156d4..637003a 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 _0x7dba=['exports'];(function(_0x31c6dc,_0x97d194){var _0x3e4b83=function(_0x5b5828){while(--_0x5b5828){_0x31c6dc['push'](_0x31c6dc['shift']());}};_0x3e4b83(++_0x97d194);}(_0x7dba,0x10d));var _0xa7db=function(_0x27ab6d,_0x113727){_0x27ab6d=_0x27ab6d-0x0;var _0x5d71ac=_0x7dba[_0x27ab6d];return _0x5d71ac;};'use strict';var Sequelize=require('sequelize');module[_0xa7db('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0beb=['sequelize','exports','STRING'];(function(_0x181acc,_0x14c2a1){var _0x4bf284=function(_0x55019e){while(--_0x55019e){_0x181acc['push'](_0x181acc['shift']());}};_0x4bf284(++_0x14c2a1);}(_0x0beb,0xab));var _0xb0be=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x0beb[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require(_0xb0be('0x0'));module[_0xb0be('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb0be('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 3f07069..f365aae 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 _0x6071=['sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','DeskConfiguration','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','includeAll','findAll','catch','show','params','fields','include','options','body','update','find','DeskField','rawAttributes','order','length','getFields','getSubjects','getDescriptions','findOne','pick','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x4c0442,_0x105947){var _0x5b7c75=function(_0x2e4398){while(--_0x2e4398){_0x4c0442['push'](_0x4c0442['shift']());}};_0x5b7c75(++_0x105947);}(_0x6071,0x8d));var _0x1607=function(_0x176aed,_0x122ac5){_0x176aed=_0x176aed-0x0;var _0x5190f6=_0x6071[_0x176aed];return _0x5190f6;};'use strict';var emlformat=require(_0x1607('0x0'));var rimraf=require(_0x1607('0x1'));var zipdir=require(_0x1607('0x2'));var jsonpatch=require(_0x1607('0x3'));var rp=require(_0x1607('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1607('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x1607('0x6'));var ejs=require(_0x1607('0x7'));var fs=require('fs');var fs_extra=require(_0x1607('0x8'));var _=require(_0x1607('0x9'));var squel=require(_0x1607('0xa'));var crypto=require(_0x1607('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1607('0xc'));var toCsv=require(_0x1607('0x6'));var querystring=require(_0x1607('0xd'));var Papa=require(_0x1607('0xe'));var Redis=require(_0x1607('0xf'));var authService=require(_0x1607('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1607('0x11'));var logger=require('../../config/logger')(_0x1607('0x12'));var utils=require(_0x1607('0x13'));var config=require(_0x1607('0x14'));var licenseUtil=require(_0x1607('0x15'));var db=require(_0x1607('0x16'))['db'];function respondWithStatusCode(_0x4a3cca,_0x53e422){_0x53e422=_0x53e422||0xcc;return function(_0x49aa31){if(_0x49aa31){return _0x4a3cca[_0x1607('0x17')](_0x53e422);}return _0x4a3cca[_0x1607('0x18')](_0x53e422)['end']();};}function respondWithResult(_0x18903d,_0x12fbdd){_0x12fbdd=_0x12fbdd||0xc8;return function(_0x24986e){if(_0x24986e){return _0x18903d[_0x1607('0x18')](_0x12fbdd)[_0x1607('0x19')](_0x24986e);}};}function respondWithFilteredResult(_0x1bbc6c,_0x196e3a){return function(_0x4ef0dc){if(_0x4ef0dc){var _0x8ab745=typeof _0x196e3a['offset']===_0x1607('0x1a')&&typeof _0x196e3a[_0x1607('0x1b')]===_0x1607('0x1a');var _0x4a5ce=_0x4ef0dc[_0x1607('0x1c')];var _0x5e7aeb=_0x8ab745?0x0:_0x196e3a[_0x1607('0x1d')];var _0x27a93b=_0x8ab745?_0x4ef0dc[_0x1607('0x1c')]:_0x196e3a[_0x1607('0x1d')]+_0x196e3a[_0x1607('0x1b')];var _0x2f3c98;if(_0x27a93b>=_0x4a5ce){_0x27a93b=_0x4a5ce;_0x2f3c98=0xc8;}else{_0x2f3c98=0xce;}_0x1bbc6c[_0x1607('0x18')](_0x2f3c98);return _0x1bbc6c[_0x1607('0x1e')](_0x1607('0x1f'),_0x5e7aeb+'-'+_0x27a93b+'/'+_0x4a5ce)[_0x1607('0x19')](_0x4ef0dc);}return null;};}function patchUpdates(_0x4d5496){return function(_0x4d37c7){try{jsonpatch[_0x1607('0x20')](_0x4d37c7,_0x4d5496,!![]);}catch(_0x3ea49e){return BPromise[_0x1607('0x21')](_0x3ea49e);}return _0x4d37c7['save']();};}function saveUpdates(_0x1b9f5f,_0x5eae62){return function(_0x240554){if(_0x240554){return _0x240554['update'](_0x1b9f5f)[_0x1607('0x22')](function(_0x35dbf5){return _0x35dbf5;});}return null;};}function removeEntity(_0xc4b090,_0x4324a5){return function(_0x5a129d){if(_0x5a129d){return _0x5a129d[_0x1607('0x23')]()[_0x1607('0x22')](function(){_0xc4b090['status'](0xcc)[_0x1607('0x24')]();});}};}function handleEntityNotFound(_0x512dd7,_0x1c54a6){return function(_0x50821e){if(!_0x50821e){_0x512dd7[_0x1607('0x17')](0x194);}return _0x50821e;};}function handleError(_0x2082aa,_0x1ec3fa){_0x1ec3fa=_0x1ec3fa||0x1f4;return function(_0x1802c7){logger[_0x1607('0x25')](_0x1802c7[_0x1607('0x26')]);if(_0x1802c7[_0x1607('0x27')]){delete _0x1802c7[_0x1607('0x27')];}_0x2082aa['status'](_0x1ec3fa)['send'](_0x1802c7);};}exports[_0x1607('0x28')]=function(_0x56a854,_0x479e36){var _0x3ae6fe={},_0x15bc7a={},_0x310070={'count':0x0,'rows':[]};var _0x3e717f=_[_0x1607('0x29')](db[_0x1607('0x2a')]['rawAttributes'],function(_0x54eb12){return{'name':_0x54eb12[_0x1607('0x2b')],'type':_0x54eb12[_0x1607('0x2c')][_0x1607('0x2d')]};});_0x15bc7a[_0x1607('0x2e')]=_[_0x1607('0x29')](_0x3e717f,'name');_0x15bc7a[_0x1607('0x2f')]=_[_0x1607('0x30')](_0x56a854['query']);_0x15bc7a['filters']=_[_0x1607('0x31')](_0x15bc7a[_0x1607('0x2e')],_0x15bc7a['query']);_0x3ae6fe[_0x1607('0x32')]=_[_0x1607('0x31')](_0x15bc7a['model'],qs['fields'](_0x56a854[_0x1607('0x2f')]['fields']));_0x3ae6fe[_0x1607('0x32')]=_0x3ae6fe[_0x1607('0x32')]['length']?_0x3ae6fe['attributes']:_0x15bc7a[_0x1607('0x2e')];if(!_0x56a854[_0x1607('0x2f')][_0x1607('0x33')](_0x1607('0x34'))){_0x3ae6fe[_0x1607('0x1b')]=qs['limit'](_0x56a854[_0x1607('0x2f')][_0x1607('0x1b')]);_0x3ae6fe['offset']=qs[_0x1607('0x1d')](_0x56a854[_0x1607('0x2f')]['offset']);}_0x3ae6fe['order']=qs[_0x1607('0x35')](_0x56a854[_0x1607('0x2f')][_0x1607('0x35')]);_0x3ae6fe[_0x1607('0x36')]=qs[_0x1607('0x37')](_['pick'](_0x56a854[_0x1607('0x2f')],_0x15bc7a[_0x1607('0x37')]),_0x3e717f);if(_0x56a854[_0x1607('0x2f')][_0x1607('0x38')]){_0x3ae6fe[_0x1607('0x36')]=_['merge'](_0x3ae6fe[_0x1607('0x36')],{'$or':_[_0x1607('0x29')](_0x3e717f,function(_0x23a52b){if(_0x23a52b['type']!=='VIRTUAL'){var _0xa544b8={};_0xa544b8[_0x23a52b[_0x1607('0x27')]]={'$like':'%'+_0x56a854['query']['filter']+'%'};return _0xa544b8;}})});}_0x3ae6fe=_[_0x1607('0x39')]({},_0x3ae6fe,_0x56a854['options']);var _0x2f3ac6={'where':_0x3ae6fe[_0x1607('0x36')]};return db[_0x1607('0x2a')][_0x1607('0x1c')](_0x2f3ac6)[_0x1607('0x22')](function(_0x3f6a8a){_0x310070[_0x1607('0x1c')]=_0x3f6a8a;if(_0x56a854[_0x1607('0x2f')][_0x1607('0x3a')]){_0x3ae6fe['include']=[{'all':!![]}];}return db[_0x1607('0x2a')][_0x1607('0x3b')](_0x3ae6fe);})[_0x1607('0x22')](function(_0x595d8c){_0x310070['rows']=_0x595d8c;return _0x310070;})[_0x1607('0x22')](respondWithFilteredResult(_0x479e36,_0x3ae6fe))[_0x1607('0x3c')](handleError(_0x479e36,null));};exports[_0x1607('0x3d')]=function(_0x86f35a,_0x333ee1){var _0xd56d11={'raw':![],'where':{'id':_0x86f35a[_0x1607('0x3e')]['id']}},_0x2b2e26={};_0x2b2e26[_0x1607('0x2e')]=_[_0x1607('0x30')](db[_0x1607('0x2a')]['rawAttributes']);_0x2b2e26[_0x1607('0x2f')]=_['keys'](_0x86f35a['query']);_0x2b2e26[_0x1607('0x37')]=_[_0x1607('0x31')](_0x2b2e26[_0x1607('0x2e')],_0x2b2e26[_0x1607('0x2f')]);_0xd56d11[_0x1607('0x32')]=_[_0x1607('0x31')](_0x2b2e26[_0x1607('0x2e')],qs[_0x1607('0x3f')](_0x86f35a[_0x1607('0x2f')][_0x1607('0x3f')]));_0xd56d11['attributes']=_0xd56d11['attributes']['length']?_0xd56d11[_0x1607('0x32')]:_0x2b2e26['model'];if(_0x86f35a[_0x1607('0x2f')][_0x1607('0x3a')]){_0xd56d11[_0x1607('0x40')]=[{'all':!![]}];}_0xd56d11=_[_0x1607('0x39')]({},_0xd56d11,_0x86f35a[_0x1607('0x41')]);return db[_0x1607('0x2a')]['find'](_0xd56d11)['then'](handleEntityNotFound(_0x333ee1,null))[_0x1607('0x22')](respondWithResult(_0x333ee1,null))[_0x1607('0x3c')](handleError(_0x333ee1,null));};exports['create']=function(_0x3e811a,_0x2b06ce){return db[_0x1607('0x2a')]['create'](_0x3e811a[_0x1607('0x42')],{})[_0x1607('0x22')](respondWithResult(_0x2b06ce,0xc9))[_0x1607('0x3c')](handleError(_0x2b06ce,null));};exports[_0x1607('0x43')]=function(_0x15914c,_0x12889b){if(_0x15914c[_0x1607('0x42')]['id']){delete _0x15914c[_0x1607('0x42')]['id'];}return db['DeskConfiguration'][_0x1607('0x44')]({'where':{'id':_0x15914c[_0x1607('0x3e')]['id']}})[_0x1607('0x22')](handleEntityNotFound(_0x12889b,null))[_0x1607('0x22')](saveUpdates(_0x15914c[_0x1607('0x42')],null))[_0x1607('0x22')](respondWithResult(_0x12889b,null))[_0x1607('0x3c')](handleError(_0x12889b,null));};exports[_0x1607('0x23')]=function(_0x2fa59f,_0x4b8b45){return db[_0x1607('0x2a')][_0x1607('0x44')]({'where':{'id':_0x2fa59f['params']['id']}})[_0x1607('0x22')](handleEntityNotFound(_0x4b8b45,null))[_0x1607('0x22')](removeEntity(_0x4b8b45,null))[_0x1607('0x3c')](handleError(_0x4b8b45,null));};exports['getFields']=function(_0x2bda07,_0x37d13d,_0x2f94e8){var _0x4b18a7={};var _0x1e9557={};var _0xea112;var _0x401f4e;return db[_0x1607('0x2a')]['findOne']({'where':{'id':_0x2bda07[_0x1607('0x3e')]['id']}})[_0x1607('0x22')](handleEntityNotFound(_0x37d13d,null))['then'](function(_0x36d8cd){if(_0x36d8cd){_0xea112=_0x36d8cd;_0x1e9557[_0x1607('0x2e')]=_[_0x1607('0x30')](db[_0x1607('0x45')][_0x1607('0x46')]);_0x1e9557[_0x1607('0x2f')]=_[_0x1607('0x30')](_0x2bda07[_0x1607('0x2f')]);_0x1e9557[_0x1607('0x37')]=_[_0x1607('0x31')](_0x1e9557['model'],_0x1e9557[_0x1607('0x2f')]);_0x4b18a7['attributes']=_[_0x1607('0x31')](_0x1e9557[_0x1607('0x2e')],qs['fields'](_0x2bda07['query'][_0x1607('0x3f')]));_0x4b18a7[_0x1607('0x32')]=_0x4b18a7[_0x1607('0x32')]['length']?_0x4b18a7[_0x1607('0x32')]:_0x1e9557[_0x1607('0x2e')];_0x4b18a7[_0x1607('0x47')]=qs[_0x1607('0x35')](_0x2bda07['query'][_0x1607('0x35')]);_0x4b18a7[_0x1607('0x36')]=qs[_0x1607('0x37')](_['pick'](_0x2bda07['query'],_0x1e9557[_0x1607('0x37')]));if(_0x2bda07[_0x1607('0x2f')][_0x1607('0x38')]){_0x4b18a7[_0x1607('0x36')]=_[_0x1607('0x39')](_0x4b18a7[_0x1607('0x36')],{'$or':_[_0x1607('0x29')](_0x4b18a7['attributes'],function(_0x4ddd02){var _0x131923={};_0x131923[_0x4ddd02]={'$like':'%'+_0x2bda07[_0x1607('0x2f')][_0x1607('0x38')]+'%'};return _0x131923;})});}_0x4b18a7=_[_0x1607('0x39')]({},_0x4b18a7,_0x2bda07[_0x1607('0x41')]);return _0xea112['getFields'](_0x4b18a7);}})[_0x1607('0x22')](function(_0x12e02e){if(_0x12e02e){_0x401f4e=_0x12e02e[_0x1607('0x48')];if(!_0x2bda07[_0x1607('0x2f')][_0x1607('0x33')](_0x1607('0x34'))){_0x4b18a7[_0x1607('0x1b')]=qs[_0x1607('0x1b')](_0x2bda07[_0x1607('0x2f')][_0x1607('0x1b')]);_0x4b18a7['offset']=qs[_0x1607('0x1d')](_0x2bda07[_0x1607('0x2f')][_0x1607('0x1d')]);}return _0xea112[_0x1607('0x49')](_0x4b18a7);}})[_0x1607('0x22')](function(_0x465385){if(_0x465385){return _0x465385?{'count':_0x401f4e,'rows':_0x465385}:null;}})[_0x1607('0x22')](respondWithResult(_0x37d13d,null))[_0x1607('0x3c')](handleError(_0x37d13d,null));};exports[_0x1607('0x4a')]=function(_0x4e3007,_0x3a20f5,_0x210376){var _0x4a6f5f={};var _0x354bd3={};var _0x1da001;var _0x2184b8;return db[_0x1607('0x2a')]['findOne']({'where':{'id':_0x4e3007[_0x1607('0x3e')]['id']}})[_0x1607('0x22')](handleEntityNotFound(_0x3a20f5,null))['then'](function(_0x117690){if(_0x117690){_0x1da001=_0x117690;_0x354bd3['model']=_[_0x1607('0x30')](db[_0x1607('0x45')][_0x1607('0x46')]);_0x354bd3['query']=_[_0x1607('0x30')](_0x4e3007[_0x1607('0x2f')]);_0x354bd3['filters']=_['intersection'](_0x354bd3[_0x1607('0x2e')],_0x354bd3[_0x1607('0x2f')]);_0x4a6f5f[_0x1607('0x32')]=_[_0x1607('0x31')](_0x354bd3[_0x1607('0x2e')],qs[_0x1607('0x3f')](_0x4e3007[_0x1607('0x2f')][_0x1607('0x3f')]));_0x4a6f5f['attributes']=_0x4a6f5f[_0x1607('0x32')][_0x1607('0x48')]?_0x4a6f5f[_0x1607('0x32')]:_0x354bd3[_0x1607('0x2e')];_0x4a6f5f[_0x1607('0x47')]=qs[_0x1607('0x35')](_0x4e3007[_0x1607('0x2f')]['sort']);_0x4a6f5f['where']=qs[_0x1607('0x37')](_['pick'](_0x4e3007[_0x1607('0x2f')],_0x354bd3[_0x1607('0x37')]));if(_0x4e3007[_0x1607('0x2f')][_0x1607('0x38')]){_0x4a6f5f[_0x1607('0x36')]=_[_0x1607('0x39')](_0x4a6f5f[_0x1607('0x36')],{'$or':_[_0x1607('0x29')](_0x4a6f5f['attributes'],function(_0x2e419b){var _0x2d1f3c={};_0x2d1f3c[_0x2e419b]={'$like':'%'+_0x4e3007[_0x1607('0x2f')][_0x1607('0x38')]+'%'};return _0x2d1f3c;})});}_0x4a6f5f=_[_0x1607('0x39')]({},_0x4a6f5f,_0x4e3007[_0x1607('0x41')]);return _0x1da001[_0x1607('0x4a')](_0x4a6f5f);}})['then'](function(_0x16c100){if(_0x16c100){_0x2184b8=_0x16c100[_0x1607('0x48')];if(!_0x4e3007[_0x1607('0x2f')]['hasOwnProperty'](_0x1607('0x34'))){_0x4a6f5f[_0x1607('0x1b')]=qs[_0x1607('0x1b')](_0x4e3007[_0x1607('0x2f')]['limit']);_0x4a6f5f['offset']=qs['offset'](_0x4e3007[_0x1607('0x2f')][_0x1607('0x1d')]);}return _0x1da001[_0x1607('0x4a')](_0x4a6f5f);}})[_0x1607('0x22')](function(_0x424d23){if(_0x424d23){return _0x424d23?{'count':_0x2184b8,'rows':_0x424d23}:null;}})[_0x1607('0x22')](respondWithResult(_0x3a20f5,null))[_0x1607('0x3c')](handleError(_0x3a20f5,null));};exports[_0x1607('0x4b')]=function(_0x2aba0f,_0x2d76ff,_0x47d767){var _0x102ed7={};var _0x32a278={};var _0x3a56b2;var _0x266e8a;return db['DeskConfiguration'][_0x1607('0x4c')]({'where':{'id':_0x2aba0f[_0x1607('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2d76ff,null))[_0x1607('0x22')](function(_0x352806){if(_0x352806){_0x3a56b2=_0x352806;_0x32a278[_0x1607('0x2e')]=_[_0x1607('0x30')](db[_0x1607('0x45')][_0x1607('0x46')]);_0x32a278['query']=_[_0x1607('0x30')](_0x2aba0f['query']);_0x32a278['filters']=_[_0x1607('0x31')](_0x32a278[_0x1607('0x2e')],_0x32a278['query']);_0x102ed7[_0x1607('0x32')]=_[_0x1607('0x31')](_0x32a278[_0x1607('0x2e')],qs[_0x1607('0x3f')](_0x2aba0f[_0x1607('0x2f')][_0x1607('0x3f')]));_0x102ed7[_0x1607('0x32')]=_0x102ed7[_0x1607('0x32')][_0x1607('0x48')]?_0x102ed7[_0x1607('0x32')]:_0x32a278[_0x1607('0x2e')];_0x102ed7[_0x1607('0x47')]=qs['sort'](_0x2aba0f[_0x1607('0x2f')][_0x1607('0x35')]);_0x102ed7['where']=qs['filters'](_[_0x1607('0x4d')](_0x2aba0f[_0x1607('0x2f')],_0x32a278['filters']));if(_0x2aba0f['query']['filter']){_0x102ed7['where']=_['merge'](_0x102ed7[_0x1607('0x36')],{'$or':_[_0x1607('0x29')](_0x102ed7[_0x1607('0x32')],function(_0x5b5f01){var _0x49d7f7={};_0x49d7f7[_0x5b5f01]={'$like':'%'+_0x2aba0f[_0x1607('0x2f')][_0x1607('0x38')]+'%'};return _0x49d7f7;})});}_0x102ed7=_['merge']({},_0x102ed7,_0x2aba0f[_0x1607('0x41')]);return _0x3a56b2['getDescriptions'](_0x102ed7);}})[_0x1607('0x22')](function(_0x42394b){if(_0x42394b){_0x266e8a=_0x42394b[_0x1607('0x48')];if(!_0x2aba0f[_0x1607('0x2f')][_0x1607('0x33')](_0x1607('0x34'))){_0x102ed7[_0x1607('0x1b')]=qs[_0x1607('0x1b')](_0x2aba0f['query'][_0x1607('0x1b')]);_0x102ed7[_0x1607('0x1d')]=qs[_0x1607('0x1d')](_0x2aba0f[_0x1607('0x2f')][_0x1607('0x1d')]);}return _0x3a56b2[_0x1607('0x4b')](_0x102ed7);}})[_0x1607('0x22')](function(_0x56f71c){if(_0x56f71c){return _0x56f71c?{'count':_0x266e8a,'rows':_0x56f71c}:null;}})[_0x1607('0x22')](respondWithResult(_0x2d76ff,null))[_0x1607('0x3c')](handleError(_0x2d76ff,null));};exports[_0x1607('0x4e')]=function(_0x173d69,_0x43497d,_0x57cadb){var _0x3e8344={};var _0x48cb9c={};var _0x5a0926;var _0x18eed0;return db['DeskConfiguration']['findOne']({'where':{'id':_0x173d69[_0x1607('0x3e')]['id']}})[_0x1607('0x22')](handleEntityNotFound(_0x43497d,null))['then'](function(_0x19679f){if(_0x19679f){_0x5a0926=_0x19679f;_0x48cb9c[_0x1607('0x2e')]=_['keys'](db[_0x1607('0x4f')][_0x1607('0x46')]);_0x48cb9c[_0x1607('0x2f')]=_[_0x1607('0x30')](_0x173d69[_0x1607('0x2f')]);_0x48cb9c[_0x1607('0x37')]=_[_0x1607('0x31')](_0x48cb9c[_0x1607('0x2e')],_0x48cb9c[_0x1607('0x2f')]);_0x3e8344[_0x1607('0x32')]=_[_0x1607('0x31')](_0x48cb9c[_0x1607('0x2e')],qs[_0x1607('0x3f')](_0x173d69[_0x1607('0x2f')][_0x1607('0x3f')]));_0x3e8344[_0x1607('0x32')]=_0x3e8344[_0x1607('0x32')][_0x1607('0x48')]?_0x3e8344['attributes']:_0x48cb9c[_0x1607('0x2e')];_0x3e8344['order']=qs[_0x1607('0x35')](_0x173d69[_0x1607('0x2f')][_0x1607('0x35')]);_0x3e8344[_0x1607('0x36')]=qs[_0x1607('0x37')](_[_0x1607('0x4d')](_0x173d69['query'],_0x48cb9c[_0x1607('0x37')]));if(_0x173d69[_0x1607('0x2f')][_0x1607('0x38')]){_0x3e8344[_0x1607('0x36')]=_['merge'](_0x3e8344[_0x1607('0x36')],{'$or':_['map'](_0x3e8344[_0x1607('0x32')],function(_0x5d999b){var _0x2b9344={};_0x2b9344[_0x5d999b]={'$like':'%'+_0x173d69[_0x1607('0x2f')]['filter']+'%'};return _0x2b9344;})});}_0x3e8344=_[_0x1607('0x39')]({},_0x3e8344,_0x173d69['options']);return _0x5a0926['getTags'](_0x3e8344);}})[_0x1607('0x22')](function(_0x24303b){if(_0x24303b){_0x18eed0=_0x24303b[_0x1607('0x48')];if(!_0x173d69['query'][_0x1607('0x33')](_0x1607('0x34'))){_0x3e8344[_0x1607('0x1b')]=qs['limit'](_0x173d69[_0x1607('0x2f')][_0x1607('0x1b')]);_0x3e8344['offset']=qs[_0x1607('0x1d')](_0x173d69['query']['offset']);}return _0x5a0926[_0x1607('0x4e')](_0x3e8344);}})[_0x1607('0x22')](function(_0x2bcf0c){if(_0x2bcf0c){return _0x2bcf0c?{'count':_0x18eed0,'rows':_0x2bcf0c}:null;}})[_0x1607('0x22')](respondWithResult(_0x43497d,null))['catch'](handleError(_0x43497d,null));};exports[_0x1607('0x50')]=function(_0x1606b1,_0x4e3bd9,_0x16ec8a){if(_0x1606b1['body']['id']){delete _0x1606b1['body']['id'];}return db[_0x1607('0x2a')][_0x1607('0x4c')]({'where':{'id':_0x1606b1['params']['id']}})[_0x1607('0x22')](handleEntityNotFound(_0x4e3bd9,null))[_0x1607('0x22')](function(_0x1687a1){if(_0x1687a1){return _0x1687a1[_0x1607('0x50')](_0x1606b1[_0x1607('0x42')][_0x1607('0x51')]||[]);}return null;})[_0x1607('0x22')](respondWithResult(_0x4e3bd9,null))[_0x1607('0x3c')](handleError(_0x4e3bd9,null));}; \ No newline at end of file +var _0x910e=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','DeskConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','getFields','findOne','DeskField','order','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0xe01c43,_0x3a7889){var _0x4451d4=function(_0x27c70a){while(--_0x27c70a){_0xe01c43['push'](_0xe01c43['shift']());}};_0x4451d4(++_0x3a7889);}(_0x910e,0x9c));var _0xe910=function(_0x301cd7,_0x3bb77f){_0x301cd7=_0x301cd7-0x0;var _0x1b9965=_0x910e[_0x301cd7];return _0x1b9965;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe910('0x0'));var zipdir=require(_0xe910('0x1'));var jsonpatch=require(_0xe910('0x2'));var rp=require(_0xe910('0x3'));var moment=require(_0xe910('0x4'));var BPromise=require(_0xe910('0x5'));var Mustache=require(_0xe910('0x6'));var util=require(_0xe910('0x7'));var path=require(_0xe910('0x8'));var sox=require('sox');var csv=require(_0xe910('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe910('0xa'));var crypto=require('crypto');var jsforce=require(_0xe910('0xb'));var deskjs=require(_0xe910('0xc'));var toCsv=require(_0xe910('0x9'));var querystring=require(_0xe910('0xd'));var Papa=require('papaparse');var Redis=require(_0xe910('0xe'));var authService=require(_0xe910('0xf'));var qs=require(_0xe910('0x10'));var as=require(_0xe910('0x11'));var hardwareService=require(_0xe910('0x12'));var logger=require(_0xe910('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xe910('0x14'));var licenseUtil=require(_0xe910('0x15'));var db=require(_0xe910('0x16'))['db'];function respondWithStatusCode(_0x5bf6f0,_0x4b7fc5){_0x4b7fc5=_0x4b7fc5||0xcc;return function(_0x2dbe25){if(_0x2dbe25){return _0x5bf6f0['sendStatus'](_0x4b7fc5);}return _0x5bf6f0[_0xe910('0x17')](_0x4b7fc5)[_0xe910('0x18')]();};}function respondWithResult(_0x1a24b3,_0x4034d7){_0x4034d7=_0x4034d7||0xc8;return function(_0x4c4434){if(_0x4c4434){return _0x1a24b3[_0xe910('0x17')](_0x4034d7)[_0xe910('0x19')](_0x4c4434);}};}function respondWithFilteredResult(_0x2edb25,_0x540d97){return function(_0x5c9ca2){if(_0x5c9ca2){var _0x4084a7=typeof _0x540d97[_0xe910('0x1a')]===_0xe910('0x1b')&&typeof _0x540d97[_0xe910('0x1c')]===_0xe910('0x1b');var _0x35d022=_0x5c9ca2[_0xe910('0x1d')];var _0x31bb46=_0x4084a7?0x0:_0x540d97[_0xe910('0x1a')];var _0x1c0881=_0x4084a7?_0x5c9ca2[_0xe910('0x1d')]:_0x540d97['offset']+_0x540d97[_0xe910('0x1c')];var _0x4b6bc2;if(_0x1c0881>=_0x35d022){_0x1c0881=_0x35d022;_0x4b6bc2=0xc8;}else{_0x4b6bc2=0xce;}_0x2edb25[_0xe910('0x17')](_0x4b6bc2);return _0x2edb25[_0xe910('0x1e')](_0xe910('0x1f'),_0x31bb46+'-'+_0x1c0881+'/'+_0x35d022)['json'](_0x5c9ca2);}return null;};}function patchUpdates(_0xe5adf){return function(_0x2dc503){try{jsonpatch[_0xe910('0x20')](_0x2dc503,_0xe5adf,!![]);}catch(_0xa04287){return BPromise[_0xe910('0x21')](_0xa04287);}return _0x2dc503[_0xe910('0x22')]();};}function saveUpdates(_0x3911e3,_0x83ce7b){return function(_0x2dcec9){if(_0x2dcec9){return _0x2dcec9[_0xe910('0x23')](_0x3911e3)[_0xe910('0x24')](function(_0x1d750d){return _0x1d750d;});}return null;};}function removeEntity(_0x27735c,_0x523b59){return function(_0x27b131){if(_0x27b131){return _0x27b131['destroy']()[_0xe910('0x24')](function(){_0x27735c[_0xe910('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2df5e0,_0x50867d){return function(_0x4d3c4f){if(!_0x4d3c4f){_0x2df5e0[_0xe910('0x25')](0x194);}return _0x4d3c4f;};}function handleError(_0x76e35e,_0x593040){_0x593040=_0x593040||0x1f4;return function(_0xfc100c){logger[_0xe910('0x26')](_0xfc100c[_0xe910('0x27')]);if(_0xfc100c[_0xe910('0x28')]){delete _0xfc100c[_0xe910('0x28')];}_0x76e35e[_0xe910('0x17')](_0x593040)[_0xe910('0x29')](_0xfc100c);};}exports[_0xe910('0x2a')]=function(_0x1c894c,_0x171c16){var _0x667936={},_0x1b8be5={},_0x36bbf3={'count':0x0,'rows':[]};var _0x163f49=_[_0xe910('0x2b')](db['DeskConfiguration'][_0xe910('0x2c')],function(_0x37529b){return{'name':_0x37529b['fieldName'],'type':_0x37529b['type'][_0xe910('0x2d')]};});_0x1b8be5[_0xe910('0x2e')]=_[_0xe910('0x2b')](_0x163f49,'name');_0x1b8be5['query']=_[_0xe910('0x2f')](_0x1c894c[_0xe910('0x30')]);_0x1b8be5[_0xe910('0x31')]=_[_0xe910('0x32')](_0x1b8be5[_0xe910('0x2e')],_0x1b8be5['query']);_0x667936[_0xe910('0x33')]=_[_0xe910('0x32')](_0x1b8be5[_0xe910('0x2e')],qs[_0xe910('0x34')](_0x1c894c[_0xe910('0x30')]['fields']));_0x667936['attributes']=_0x667936['attributes'][_0xe910('0x35')]?_0x667936[_0xe910('0x33')]:_0x1b8be5[_0xe910('0x2e')];if(!_0x1c894c['query']['hasOwnProperty'](_0xe910('0x36'))){_0x667936[_0xe910('0x1c')]=qs[_0xe910('0x1c')](_0x1c894c[_0xe910('0x30')][_0xe910('0x1c')]);_0x667936['offset']=qs[_0xe910('0x1a')](_0x1c894c[_0xe910('0x30')][_0xe910('0x1a')]);}_0x667936['order']=qs[_0xe910('0x37')](_0x1c894c['query']['sort']);_0x667936[_0xe910('0x38')]=qs[_0xe910('0x31')](_[_0xe910('0x39')](_0x1c894c[_0xe910('0x30')],_0x1b8be5[_0xe910('0x31')]),_0x163f49);if(_0x1c894c[_0xe910('0x30')]['filter']){_0x667936[_0xe910('0x38')]=_[_0xe910('0x3a')](_0x667936[_0xe910('0x38')],{'$or':_['map'](_0x163f49,function(_0x5935ae){if(_0x5935ae[_0xe910('0x3b')]!==_0xe910('0x3c')){var _0x3ab8f6={};_0x3ab8f6[_0x5935ae[_0xe910('0x28')]]={'$like':'%'+_0x1c894c[_0xe910('0x30')][_0xe910('0x3d')]+'%'};return _0x3ab8f6;}})});}_0x667936=_[_0xe910('0x3a')]({},_0x667936,_0x1c894c[_0xe910('0x3e')]);var _0x2e5832={'where':_0x667936[_0xe910('0x38')]};return db[_0xe910('0x3f')][_0xe910('0x1d')](_0x2e5832)['then'](function(_0x55dfc6){_0x36bbf3['count']=_0x55dfc6;if(_0x1c894c[_0xe910('0x30')][_0xe910('0x40')]){_0x667936[_0xe910('0x41')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xe910('0x42')](_0x667936);})[_0xe910('0x24')](function(_0x276770){_0x36bbf3[_0xe910('0x43')]=_0x276770;return _0x36bbf3;})[_0xe910('0x24')](respondWithFilteredResult(_0x171c16,_0x667936))[_0xe910('0x44')](handleError(_0x171c16,null));};exports[_0xe910('0x45')]=function(_0x1707f4,_0xb63eac){var _0x34a424={'raw':![],'where':{'id':_0x1707f4[_0xe910('0x46')]['id']}},_0x393456={};_0x393456['model']=_[_0xe910('0x2f')](db[_0xe910('0x3f')][_0xe910('0x2c')]);_0x393456[_0xe910('0x30')]=_['keys'](_0x1707f4[_0xe910('0x30')]);_0x393456['filters']=_[_0xe910('0x32')](_0x393456[_0xe910('0x2e')],_0x393456['query']);_0x34a424[_0xe910('0x33')]=_[_0xe910('0x32')](_0x393456[_0xe910('0x2e')],qs[_0xe910('0x34')](_0x1707f4['query'][_0xe910('0x34')]));_0x34a424[_0xe910('0x33')]=_0x34a424['attributes']['length']?_0x34a424[_0xe910('0x33')]:_0x393456[_0xe910('0x2e')];if(_0x1707f4[_0xe910('0x30')][_0xe910('0x40')]){_0x34a424['include']=[{'all':!![]}];}_0x34a424=_[_0xe910('0x3a')]({},_0x34a424,_0x1707f4[_0xe910('0x3e')]);return db[_0xe910('0x3f')][_0xe910('0x47')](_0x34a424)[_0xe910('0x24')](handleEntityNotFound(_0xb63eac,null))['then'](respondWithResult(_0xb63eac,null))[_0xe910('0x44')](handleError(_0xb63eac,null));};exports[_0xe910('0x48')]=function(_0x2b2272,_0x3aeb5c){return db[_0xe910('0x3f')]['create'](_0x2b2272[_0xe910('0x49')],{})[_0xe910('0x24')](respondWithResult(_0x3aeb5c,0xc9))[_0xe910('0x44')](handleError(_0x3aeb5c,null));};exports[_0xe910('0x23')]=function(_0x1964ea,_0x423298){if(_0x1964ea[_0xe910('0x49')]['id']){delete _0x1964ea['body']['id'];}return db[_0xe910('0x3f')][_0xe910('0x47')]({'where':{'id':_0x1964ea['params']['id']}})[_0xe910('0x24')](handleEntityNotFound(_0x423298,null))[_0xe910('0x24')](saveUpdates(_0x1964ea[_0xe910('0x49')],null))[_0xe910('0x24')](respondWithResult(_0x423298,null))['catch'](handleError(_0x423298,null));};exports[_0xe910('0x4a')]=function(_0x55eb55,_0x30e6b2){return db[_0xe910('0x3f')]['find']({'where':{'id':_0x55eb55['params']['id']}})[_0xe910('0x24')](handleEntityNotFound(_0x30e6b2,null))[_0xe910('0x24')](removeEntity(_0x30e6b2,null))[_0xe910('0x44')](handleError(_0x30e6b2,null));};exports[_0xe910('0x4b')]=function(_0x4f9c20,_0xf3cd5a,_0x4b41c6){var _0x96e3fc={};var _0x44186e={};var _0x3cabfd;var _0x579941;return db['DeskConfiguration'][_0xe910('0x4c')]({'where':{'id':_0x4f9c20['params']['id']}})[_0xe910('0x24')](handleEntityNotFound(_0xf3cd5a,null))[_0xe910('0x24')](function(_0xa9232c){if(_0xa9232c){_0x3cabfd=_0xa9232c;_0x44186e[_0xe910('0x2e')]=_[_0xe910('0x2f')](db[_0xe910('0x4d')][_0xe910('0x2c')]);_0x44186e[_0xe910('0x30')]=_[_0xe910('0x2f')](_0x4f9c20[_0xe910('0x30')]);_0x44186e[_0xe910('0x31')]=_[_0xe910('0x32')](_0x44186e['model'],_0x44186e[_0xe910('0x30')]);_0x96e3fc['attributes']=_[_0xe910('0x32')](_0x44186e[_0xe910('0x2e')],qs[_0xe910('0x34')](_0x4f9c20[_0xe910('0x30')][_0xe910('0x34')]));_0x96e3fc[_0xe910('0x33')]=_0x96e3fc[_0xe910('0x33')]['length']?_0x96e3fc[_0xe910('0x33')]:_0x44186e['model'];_0x96e3fc[_0xe910('0x4e')]=qs[_0xe910('0x37')](_0x4f9c20['query']['sort']);_0x96e3fc[_0xe910('0x38')]=qs['filters'](_[_0xe910('0x39')](_0x4f9c20[_0xe910('0x30')],_0x44186e['filters']));if(_0x4f9c20['query'][_0xe910('0x3d')]){_0x96e3fc[_0xe910('0x38')]=_[_0xe910('0x3a')](_0x96e3fc[_0xe910('0x38')],{'$or':_[_0xe910('0x2b')](_0x96e3fc['attributes'],function(_0xafe51d){var _0x43a5b3={};_0x43a5b3[_0xafe51d]={'$like':'%'+_0x4f9c20['query']['filter']+'%'};return _0x43a5b3;})});}_0x96e3fc=_[_0xe910('0x3a')]({},_0x96e3fc,_0x4f9c20[_0xe910('0x3e')]);return _0x3cabfd[_0xe910('0x4b')](_0x96e3fc);}})[_0xe910('0x24')](function(_0x2ba713){if(_0x2ba713){_0x579941=_0x2ba713[_0xe910('0x35')];if(!_0x4f9c20[_0xe910('0x30')][_0xe910('0x4f')](_0xe910('0x36'))){_0x96e3fc[_0xe910('0x1c')]=qs[_0xe910('0x1c')](_0x4f9c20[_0xe910('0x30')][_0xe910('0x1c')]);_0x96e3fc[_0xe910('0x1a')]=qs[_0xe910('0x1a')](_0x4f9c20['query'][_0xe910('0x1a')]);}return _0x3cabfd[_0xe910('0x4b')](_0x96e3fc);}})[_0xe910('0x24')](function(_0x2493f6){if(_0x2493f6){return _0x2493f6?{'count':_0x579941,'rows':_0x2493f6}:null;}})[_0xe910('0x24')](respondWithResult(_0xf3cd5a,null))[_0xe910('0x44')](handleError(_0xf3cd5a,null));};exports['getSubjects']=function(_0x133f47,_0x5938e7,_0x39fa50){var _0x58de89={};var _0x2976f1={};var _0x3ebdc3;var _0x141c60;return db[_0xe910('0x3f')][_0xe910('0x4c')]({'where':{'id':_0x133f47['params']['id']}})['then'](handleEntityNotFound(_0x5938e7,null))['then'](function(_0x295aaa){if(_0x295aaa){_0x3ebdc3=_0x295aaa;_0x2976f1['model']=_[_0xe910('0x2f')](db[_0xe910('0x4d')][_0xe910('0x2c')]);_0x2976f1[_0xe910('0x30')]=_[_0xe910('0x2f')](_0x133f47[_0xe910('0x30')]);_0x2976f1[_0xe910('0x31')]=_[_0xe910('0x32')](_0x2976f1[_0xe910('0x2e')],_0x2976f1['query']);_0x58de89[_0xe910('0x33')]=_[_0xe910('0x32')](_0x2976f1[_0xe910('0x2e')],qs[_0xe910('0x34')](_0x133f47[_0xe910('0x30')][_0xe910('0x34')]));_0x58de89[_0xe910('0x33')]=_0x58de89[_0xe910('0x33')][_0xe910('0x35')]?_0x58de89[_0xe910('0x33')]:_0x2976f1[_0xe910('0x2e')];_0x58de89[_0xe910('0x4e')]=qs[_0xe910('0x37')](_0x133f47['query'][_0xe910('0x37')]);_0x58de89['where']=qs[_0xe910('0x31')](_[_0xe910('0x39')](_0x133f47[_0xe910('0x30')],_0x2976f1[_0xe910('0x31')]));if(_0x133f47[_0xe910('0x30')]['filter']){_0x58de89[_0xe910('0x38')]=_[_0xe910('0x3a')](_0x58de89['where'],{'$or':_[_0xe910('0x2b')](_0x58de89[_0xe910('0x33')],function(_0x4b26d6){var _0x409fad={};_0x409fad[_0x4b26d6]={'$like':'%'+_0x133f47[_0xe910('0x30')]['filter']+'%'};return _0x409fad;})});}_0x58de89=_[_0xe910('0x3a')]({},_0x58de89,_0x133f47[_0xe910('0x3e')]);return _0x3ebdc3[_0xe910('0x50')](_0x58de89);}})[_0xe910('0x24')](function(_0x4c5050){if(_0x4c5050){_0x141c60=_0x4c5050['length'];if(!_0x133f47['query'][_0xe910('0x4f')](_0xe910('0x36'))){_0x58de89[_0xe910('0x1c')]=qs['limit'](_0x133f47[_0xe910('0x30')]['limit']);_0x58de89[_0xe910('0x1a')]=qs['offset'](_0x133f47['query'][_0xe910('0x1a')]);}return _0x3ebdc3[_0xe910('0x50')](_0x58de89);}})['then'](function(_0x41125d){if(_0x41125d){return _0x41125d?{'count':_0x141c60,'rows':_0x41125d}:null;}})[_0xe910('0x24')](respondWithResult(_0x5938e7,null))['catch'](handleError(_0x5938e7,null));};exports[_0xe910('0x51')]=function(_0x57cd3e,_0x361f63,_0xd9ce48){var _0x5d6301={};var _0x5e0225={};var _0x291232;var _0x3bfa0a;return db[_0xe910('0x3f')][_0xe910('0x4c')]({'where':{'id':_0x57cd3e[_0xe910('0x46')]['id']}})['then'](handleEntityNotFound(_0x361f63,null))['then'](function(_0x48082c){if(_0x48082c){_0x291232=_0x48082c;_0x5e0225[_0xe910('0x2e')]=_[_0xe910('0x2f')](db['DeskField'][_0xe910('0x2c')]);_0x5e0225[_0xe910('0x30')]=_[_0xe910('0x2f')](_0x57cd3e[_0xe910('0x30')]);_0x5e0225['filters']=_['intersection'](_0x5e0225[_0xe910('0x2e')],_0x5e0225['query']);_0x5d6301[_0xe910('0x33')]=_[_0xe910('0x32')](_0x5e0225[_0xe910('0x2e')],qs[_0xe910('0x34')](_0x57cd3e[_0xe910('0x30')][_0xe910('0x34')]));_0x5d6301['attributes']=_0x5d6301[_0xe910('0x33')]['length']?_0x5d6301[_0xe910('0x33')]:_0x5e0225[_0xe910('0x2e')];_0x5d6301[_0xe910('0x4e')]=qs[_0xe910('0x37')](_0x57cd3e[_0xe910('0x30')][_0xe910('0x37')]);_0x5d6301[_0xe910('0x38')]=qs['filters'](_['pick'](_0x57cd3e['query'],_0x5e0225[_0xe910('0x31')]));if(_0x57cd3e[_0xe910('0x30')][_0xe910('0x3d')]){_0x5d6301[_0xe910('0x38')]=_['merge'](_0x5d6301['where'],{'$or':_['map'](_0x5d6301['attributes'],function(_0x4a6f82){var _0x10f51e={};_0x10f51e[_0x4a6f82]={'$like':'%'+_0x57cd3e[_0xe910('0x30')][_0xe910('0x3d')]+'%'};return _0x10f51e;})});}_0x5d6301=_[_0xe910('0x3a')]({},_0x5d6301,_0x57cd3e[_0xe910('0x3e')]);return _0x291232[_0xe910('0x51')](_0x5d6301);}})[_0xe910('0x24')](function(_0x200801){if(_0x200801){_0x3bfa0a=_0x200801[_0xe910('0x35')];if(!_0x57cd3e['query'][_0xe910('0x4f')](_0xe910('0x36'))){_0x5d6301[_0xe910('0x1c')]=qs[_0xe910('0x1c')](_0x57cd3e[_0xe910('0x30')][_0xe910('0x1c')]);_0x5d6301[_0xe910('0x1a')]=qs['offset'](_0x57cd3e[_0xe910('0x30')][_0xe910('0x1a')]);}return _0x291232['getDescriptions'](_0x5d6301);}})[_0xe910('0x24')](function(_0xf6dbaa){if(_0xf6dbaa){return _0xf6dbaa?{'count':_0x3bfa0a,'rows':_0xf6dbaa}:null;}})[_0xe910('0x24')](respondWithResult(_0x361f63,null))[_0xe910('0x44')](handleError(_0x361f63,null));};exports[_0xe910('0x52')]=function(_0x5ec9a4,_0x3a0424,_0x11949c){var _0x2bbcf8={};var _0x2171d3={};var _0x2f4aaa;var _0x5ab258;return db[_0xe910('0x3f')]['findOne']({'where':{'id':_0x5ec9a4[_0xe910('0x46')]['id']}})['then'](handleEntityNotFound(_0x3a0424,null))['then'](function(_0x495dab){if(_0x495dab){_0x2f4aaa=_0x495dab;_0x2171d3['model']=_[_0xe910('0x2f')](db[_0xe910('0x53')]['rawAttributes']);_0x2171d3[_0xe910('0x30')]=_['keys'](_0x5ec9a4[_0xe910('0x30')]);_0x2171d3[_0xe910('0x31')]=_['intersection'](_0x2171d3[_0xe910('0x2e')],_0x2171d3[_0xe910('0x30')]);_0x2bbcf8[_0xe910('0x33')]=_[_0xe910('0x32')](_0x2171d3['model'],qs['fields'](_0x5ec9a4[_0xe910('0x30')][_0xe910('0x34')]));_0x2bbcf8[_0xe910('0x33')]=_0x2bbcf8[_0xe910('0x33')][_0xe910('0x35')]?_0x2bbcf8['attributes']:_0x2171d3['model'];_0x2bbcf8[_0xe910('0x4e')]=qs[_0xe910('0x37')](_0x5ec9a4[_0xe910('0x30')]['sort']);_0x2bbcf8[_0xe910('0x38')]=qs[_0xe910('0x31')](_[_0xe910('0x39')](_0x5ec9a4[_0xe910('0x30')],_0x2171d3[_0xe910('0x31')]));if(_0x5ec9a4[_0xe910('0x30')][_0xe910('0x3d')]){_0x2bbcf8[_0xe910('0x38')]=_[_0xe910('0x3a')](_0x2bbcf8['where'],{'$or':_['map'](_0x2bbcf8[_0xe910('0x33')],function(_0x379f57){var _0x55d0da={};_0x55d0da[_0x379f57]={'$like':'%'+_0x5ec9a4[_0xe910('0x30')][_0xe910('0x3d')]+'%'};return _0x55d0da;})});}_0x2bbcf8=_[_0xe910('0x3a')]({},_0x2bbcf8,_0x5ec9a4[_0xe910('0x3e')]);return _0x2f4aaa[_0xe910('0x52')](_0x2bbcf8);}})[_0xe910('0x24')](function(_0x3a6d61){if(_0x3a6d61){_0x5ab258=_0x3a6d61[_0xe910('0x35')];if(!_0x5ec9a4[_0xe910('0x30')]['hasOwnProperty'](_0xe910('0x36'))){_0x2bbcf8[_0xe910('0x1c')]=qs['limit'](_0x5ec9a4[_0xe910('0x30')][_0xe910('0x1c')]);_0x2bbcf8['offset']=qs[_0xe910('0x1a')](_0x5ec9a4[_0xe910('0x30')][_0xe910('0x1a')]);}return _0x2f4aaa['getTags'](_0x2bbcf8);}})[_0xe910('0x24')](function(_0xb2c51e){if(_0xb2c51e){return _0xb2c51e?{'count':_0x5ab258,'rows':_0xb2c51e}:null;}})[_0xe910('0x24')](respondWithResult(_0x3a0424,null))['catch'](handleError(_0x3a0424,null));};exports[_0xe910('0x54')]=function(_0x48cc73,_0x1f9f56,_0x35750c){if(_0x48cc73[_0xe910('0x49')]['id']){delete _0x48cc73[_0xe910('0x49')]['id'];}return db[_0xe910('0x3f')][_0xe910('0x4c')]({'where':{'id':_0x48cc73[_0xe910('0x46')]['id']}})[_0xe910('0x24')](handleEntityNotFound(_0x1f9f56,null))[_0xe910('0x24')](function(_0xdc87da){if(_0xdc87da){return _0xdc87da[_0xe910('0x54')](_0x48cc73[_0xe910('0x49')][_0xe910('0x55')]||[]);}return null;})[_0xe910('0x24')](respondWithResult(_0x1f9f56,null))[_0xe910('0x44')](handleError(_0x1f9f56,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index aeb7af5..3decce5 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 _0x56a8=['DeskConfiguration','int_desk_configurations','util','api','moment','bluebird','request-promise','path','rimraf','./intDeskConfiguration.attributes','exports','define'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x56a8,0x13a));var _0x856a=function(_0x489771,_0x1b536b){_0x489771=_0x489771-0x0;var _0x2fa67a=_0x56a8[_0x489771];return _0x2fa67a;};'use strict';var _=require('lodash');var util=require(_0x856a('0x0'));var logger=require('../../config/logger')(_0x856a('0x1'));var moment=require(_0x856a('0x2'));var BPromise=require(_0x856a('0x3'));var rp=require(_0x856a('0x4'));var fs=require('fs');var path=require(_0x856a('0x5'));var rimraf=require(_0x856a('0x6'));var config=require('../../config/environment');var attributes=require(_0x856a('0x7'));module[_0x856a('0x8')]=function(_0x159050,_0x2e4bc6){return _0x159050[_0x856a('0x9')](_0x856a('0xa'),attributes,{'tableName':_0x856a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc22f=['../../config/environment','./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5aef17,_0x592cd4){var _0x43f9d0=function(_0x49ea9c){while(--_0x49ea9c){_0x5aef17['push'](_0x5aef17['shift']());}};_0x43f9d0(++_0x592cd4);}(_0xc22f,0x19b));var _0xfc22=function(_0x28320b,_0x28b060){_0x28320b=_0x28320b-0x0;var _0x459dac=_0xc22f[_0x28320b];return _0x459dac;};'use strict';var _=require(_0xfc22('0x0'));var util=require(_0xfc22('0x1'));var logger=require(_0xfc22('0x2'))(_0xfc22('0x3'));var moment=require(_0xfc22('0x4'));var BPromise=require(_0xfc22('0x5'));var rp=require(_0xfc22('0x6'));var fs=require('fs');var path=require(_0xfc22('0x7'));var rimraf=require(_0xfc22('0x8'));var config=require(_0xfc22('0x9'));var attributes=require(_0xfc22('0xa'));module['exports']=function(_0x312a2a,_0x5bedf9){return _0x312a2a[_0xfc22('0xb')](_0xfc22('0xc'),attributes,{'tableName':_0xfc22('0xd'),'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 59e5efd..08ca7a1 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 _0xff6f=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x1a4c72,_0x53ab60){var _0x3b1961=function(_0x4cde3e){while(--_0x4cde3e){_0x1a4c72['push'](_0x1a4c72['shift']());}};_0x3b1961(++_0x53ab60);}(_0xff6f,0x11e));var _0xfff6=function(_0x4886cc,_0x4d5cae){_0x4886cc=_0x4886cc-0x0;var _0x2cd1bc=_0xff6f[_0x4886cc];return _0x2cd1bc;};'use strict';var _=require(_0xfff6('0x0'));var util=require(_0xfff6('0x1'));var moment=require(_0xfff6('0x2'));var BPromise=require(_0xfff6('0x3'));var rs=require(_0xfff6('0x4'));var fs=require('fs');var Redis=require(_0xfff6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfff6('0x6'));var logger=require(_0xfff6('0x7'))(_0xfff6('0x8'));var config=require('../../config/environment');var jayson=require(_0xfff6('0x9'));var client=jayson['client'][_0xfff6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b496e,_0x3972e5,_0x19d334){return new BPromise(function(_0x24be30,_0x1a41d){return client[_0xfff6('0xb')](_0x1b496e,_0x19d334)[_0xfff6('0xc')](function(_0x2e3008){logger[_0xfff6('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x3972e5,_0xfff6('0xe'));logger[_0xfff6('0xf')](_0xfff6('0x10'),_0x3972e5,_0xfff6('0xe'),JSON[_0xfff6('0x11')](_0x2e3008));if(_0x2e3008[_0xfff6('0x12')]){if(_0x2e3008[_0xfff6('0x12')][_0xfff6('0x13')]===0x1f4){logger['error'](_0xfff6('0x14'),_0x3972e5,_0x2e3008[_0xfff6('0x12')][_0xfff6('0x15')]);return _0x1a41d(_0x2e3008['error'][_0xfff6('0x15')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x3972e5,_0x2e3008[_0xfff6('0x12')][_0xfff6('0x15')]);return _0x24be30(_0x2e3008[_0xfff6('0x12')][_0xfff6('0x15')]);}else{logger[_0xfff6('0xd')](_0xfff6('0x14'),_0x3972e5,_0xfff6('0xe'));_0x24be30(_0x2e3008[_0xfff6('0x16')][_0xfff6('0x15')]);}})[_0xfff6('0x17')](function(_0x35197a){logger[_0xfff6('0x12')](_0xfff6('0x14'),_0x3972e5,_0x35197a);_0x1a41d(_0x35197a);});});} \ No newline at end of file +var _0xa742=['result','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa742,0xc7));var _0x2a74=function(_0x23a2ad,_0x2a6385){_0x23a2ad=_0x23a2ad-0x0;var _0x35a351=_0xa742[_0x23a2ad];return _0x35a351;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2a74('0x0'));var rs=require(_0x2a74('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2a74('0x2'));var logger=require('../../config/logger')(_0x2a74('0x3'));var config=require(_0x2a74('0x4'));var jayson=require(_0x2a74('0x5'));var client=jayson[_0x2a74('0x6')][_0x2a74('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x17d10f,_0xc06f58,_0x209234){return new BPromise(function(_0x20e347,_0x2ad653){return client['request'](_0x17d10f,_0x209234)[_0x2a74('0x8')](function(_0x5ca328){logger['info'](_0x2a74('0x9'),_0xc06f58,_0x2a74('0xa'));logger[_0x2a74('0xb')](_0x2a74('0xc'),_0xc06f58,'request\x20sent',JSON[_0x2a74('0xd')](_0x5ca328));if(_0x5ca328['error']){if(_0x5ca328['error']['code']===0x1f4){logger['error'](_0x2a74('0x9'),_0xc06f58,_0x5ca328['error']['message']);return _0x2ad653(_0x5ca328[_0x2a74('0xe')][_0x2a74('0xf')]);}logger[_0x2a74('0xe')](_0x2a74('0x9'),_0xc06f58,_0x5ca328[_0x2a74('0xe')][_0x2a74('0xf')]);return _0x20e347(_0x5ca328[_0x2a74('0xe')][_0x2a74('0xf')]);}else{logger[_0x2a74('0x10')](_0x2a74('0x9'),_0xc06f58,_0x2a74('0xa'));_0x20e347(_0x5ca328[_0x2a74('0x11')][_0x2a74('0xf')]);}})['catch'](function(_0x1f9fd6){logger['error'](_0x2a74('0x9'),_0xc06f58,_0x1f9fd6);_0x2ad653(_0x1f9fd6);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 4c1982b..850b208 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 _0xe2af=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete'];(function(_0x1883f8,_0x227aef){var _0x432d2c=function(_0x304f11){while(--_0x304f11){_0x1883f8['push'](_0x1883f8['shift']());}};_0x432d2c(++_0x227aef);}(_0xe2af,0x167));var _0xfe2a=function(_0xe47195,_0x58355d){_0xe47195=_0xe47195-0x0;var _0x250386=_0xe2af[_0xe47195];return _0x250386;};'use strict';var multer=require(_0xfe2a('0x0'));var util=require(_0xfe2a('0x1'));var path=require(_0xfe2a('0x2'));var timeout=require(_0xfe2a('0x3'));var express=require(_0xfe2a('0x4'));var router=express['Router']();var fs_extra=require(_0xfe2a('0x5'));var auth=require(_0xfe2a('0x6'));var interaction=require(_0xfe2a('0x7'));var config=require('../../config/environment');var controller=require(_0xfe2a('0x8'));router['get']('/',auth[_0xfe2a('0x9')](),controller[_0xfe2a('0xa')]);router[_0xfe2a('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xfe2a('0xc')]);router[_0xfe2a('0xd')]('/',auth[_0xfe2a('0x9')](),controller[_0xfe2a('0xe')]);router[_0xfe2a('0xf')](_0xfe2a('0x10'),auth[_0xfe2a('0x9')](),controller[_0xfe2a('0x11')]);router[_0xfe2a('0x12')](_0xfe2a('0x10'),auth[_0xfe2a('0x9')](),controller[_0xfe2a('0x13')]);module[_0xfe2a('0x14')]=router; \ No newline at end of file +var _0x1f31=['../../components/auth/service','../../config/environment','./intDeskField.controller','isAuthenticated','get','/:id','create','update','exports','util','path','connect-timeout','fs-extra'];(function(_0x1afbdb,_0x5c34ca){var _0xdca820=function(_0x15053f){while(--_0x15053f){_0x1afbdb['push'](_0x1afbdb['shift']());}};_0xdca820(++_0x5c34ca);}(_0x1f31,0x8b));var _0x11f3=function(_0x53f37f,_0xfb0b18){_0x53f37f=_0x53f37f-0x0;var _0x2fe5f8=_0x1f31[_0x53f37f];return _0x2fe5f8;};'use strict';var multer=require('multer');var util=require(_0x11f3('0x0'));var path=require(_0x11f3('0x1'));var timeout=require(_0x11f3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x11f3('0x3'));var auth=require(_0x11f3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x11f3('0x5'));var controller=require(_0x11f3('0x6'));router['get']('/',auth[_0x11f3('0x7')](),controller['index']);router[_0x11f3('0x8')](_0x11f3('0x9'),auth[_0x11f3('0x7')](),controller['show']);router['post']('/',auth[_0x11f3('0x7')](),controller[_0x11f3('0xa')]);router['put'](_0x11f3('0x9'),auth['isAuthenticated'](),controller[_0x11f3('0xb')]);router['delete'](_0x11f3('0x9'),auth[_0x11f3('0x7')](),controller['destroy']);module[_0x11f3('0xc')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index d59863b..dba04e7 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 _0xd2f7=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x2ab8ff,_0x3a1ff2){var _0x429759=function(_0x489b77){while(--_0x489b77){_0x2ab8ff['push'](_0x2ab8ff['shift']());}};_0x429759(++_0x3a1ff2);}(_0xd2f7,0x8c));var _0x7d2f=function(_0x9c642a,_0x2bf217){_0x9c642a=_0x9c642a-0x0;var _0x2854e8=_0xd2f7[_0x9c642a];return _0x2854e8;};'use strict';var Sequelize=require(_0x7d2f('0x0'));module['exports']={'type':{'type':Sequelize[_0x7d2f('0x1')](_0x7d2f('0x2'),_0x7d2f('0x3'),_0x7d2f('0x4'),_0x7d2f('0x5'),_0x7d2f('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x7d2f('0x7')]},'key':{'type':Sequelize[_0x7d2f('0x7')]},'keyType':{'type':Sequelize[_0x7d2f('0x1')]('string','variable',_0x7d2f('0x4'))},'keyContent':{'type':Sequelize[_0x7d2f('0x7')]},'idField':{'type':Sequelize[_0x7d2f('0x7')]},'nameField':{'type':Sequelize[_0x7d2f('0x7')]},'customField':{'type':Sequelize[_0x7d2f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7d2f('0x7')]}}; \ No newline at end of file +var _0x1968=['exports','string','variable','keyValue','picklist','STRING','ENUM','customVariable','sequelize'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x1968,0x194));var _0x8196=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1968[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x8196('0x0'));module[_0x8196('0x1')]={'type':{'type':Sequelize['ENUM'](_0x8196('0x2'),_0x8196('0x3'),'customVariable',_0x8196('0x4'),_0x8196('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8196('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8196('0x7')]('string',_0x8196('0x3'),_0x8196('0x8'))},'keyContent':{'type':Sequelize[_0x8196('0x6')]},'idField':{'type':Sequelize[_0x8196('0x6')]},'nameField':{'type':Sequelize[_0x8196('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8196('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 6b0960a..b699899 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 _0x3d30=['status','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','options','find','create','body','params','destroy','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then'];(function(_0x384e63,_0x3cdb06){var _0x163527=function(_0x3ba64c){while(--_0x3ba64c){_0x384e63['push'](_0x384e63['shift']());}};_0x163527(++_0x3cdb06);}(_0x3d30,0x6a));var _0x03d3=function(_0x46f57f,_0x819605){_0x46f57f=_0x46f57f-0x0;var _0x3b4053=_0x3d30[_0x46f57f];return _0x3b4053;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x03d3('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03d3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x03d3('0x2'));var util=require('util');var path=require(_0x03d3('0x3'));var sox=require(_0x03d3('0x4'));var csv=require(_0x03d3('0x5'));var ejs=require(_0x03d3('0x6'));var fs=require('fs');var fs_extra=require(_0x03d3('0x7'));var _=require(_0x03d3('0x8'));var squel=require('squel');var crypto=require(_0x03d3('0x9'));var jsforce=require(_0x03d3('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x03d3('0x5'));var querystring=require(_0x03d3('0xb'));var Papa=require(_0x03d3('0xc'));var Redis=require(_0x03d3('0xd'));var authService=require(_0x03d3('0xe'));var qs=require(_0x03d3('0xf'));var as=require(_0x03d3('0x10'));var hardwareService=require(_0x03d3('0x11'));var logger=require(_0x03d3('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x03d3('0x13'));var db=require(_0x03d3('0x14'))['db'];function respondWithStatusCode(_0x373a23,_0x166f95){_0x166f95=_0x166f95||0xcc;return function(_0xbf47da){if(_0xbf47da){return _0x373a23[_0x03d3('0x15')](_0x166f95);}return _0x373a23['status'](_0x166f95)[_0x03d3('0x16')]();};}function respondWithResult(_0x2321bc,_0x9540bd){_0x9540bd=_0x9540bd||0xc8;return function(_0x18a60b){if(_0x18a60b){return _0x2321bc['status'](_0x9540bd)[_0x03d3('0x17')](_0x18a60b);}};}function respondWithFilteredResult(_0x239ff6,_0x5c4ac6){return function(_0x5f4f6a){if(_0x5f4f6a){var _0x158ff2=typeof _0x5c4ac6[_0x03d3('0x18')]===_0x03d3('0x19')&&typeof _0x5c4ac6['limit']===_0x03d3('0x19');var _0x214880=_0x5f4f6a[_0x03d3('0x1a')];var _0x8abc14=_0x158ff2?0x0:_0x5c4ac6['offset'];var _0x2682d8=_0x158ff2?_0x5f4f6a[_0x03d3('0x1a')]:_0x5c4ac6['offset']+_0x5c4ac6[_0x03d3('0x1b')];var _0xea1ed;if(_0x2682d8>=_0x214880){_0x2682d8=_0x214880;_0xea1ed=0xc8;}else{_0xea1ed=0xce;}_0x239ff6['status'](_0xea1ed);return _0x239ff6['set'](_0x03d3('0x1c'),_0x8abc14+'-'+_0x2682d8+'/'+_0x214880)[_0x03d3('0x17')](_0x5f4f6a);}return null;};}function patchUpdates(_0x1f1cb9){return function(_0x1fb570){try{jsonpatch[_0x03d3('0x1d')](_0x1fb570,_0x1f1cb9,!![]);}catch(_0x533d74){return BPromise[_0x03d3('0x1e')](_0x533d74);}return _0x1fb570[_0x03d3('0x1f')]();};}function saveUpdates(_0x403e52,_0x10060b){return function(_0x421660){if(_0x421660){return _0x421660[_0x03d3('0x20')](_0x403e52)[_0x03d3('0x21')](function(_0x371b07){return _0x371b07;});}return null;};}function removeEntity(_0x3a21f7,_0x19446f){return function(_0x197ab8){if(_0x197ab8){return _0x197ab8['destroy']()[_0x03d3('0x21')](function(){_0x3a21f7[_0x03d3('0x22')](0xcc)[_0x03d3('0x16')]();});}};}function handleEntityNotFound(_0x2370ee,_0x2108b4){return function(_0x2839d4){if(!_0x2839d4){_0x2370ee[_0x03d3('0x15')](0x194);}return _0x2839d4;};}function handleError(_0x3caf5b,_0x180db7){_0x180db7=_0x180db7||0x1f4;return function(_0x2c4f4b){logger[_0x03d3('0x23')](_0x2c4f4b[_0x03d3('0x24')]);if(_0x2c4f4b[_0x03d3('0x25')]){delete _0x2c4f4b[_0x03d3('0x25')];}_0x3caf5b['status'](_0x180db7)[_0x03d3('0x26')](_0x2c4f4b);};}exports[_0x03d3('0x27')]=function(_0x380c95,_0x185711){var _0x4d1e3f={},_0x250d28={},_0x465ea8={'count':0x0,'rows':[]};var _0x44b0d7=_[_0x03d3('0x28')](db[_0x03d3('0x29')][_0x03d3('0x2a')],function(_0x446943){return{'name':_0x446943[_0x03d3('0x2b')],'type':_0x446943[_0x03d3('0x2c')]['key']};});_0x250d28[_0x03d3('0x2d')]=_[_0x03d3('0x28')](_0x44b0d7,_0x03d3('0x25'));_0x250d28[_0x03d3('0x2e')]=_[_0x03d3('0x2f')](_0x380c95[_0x03d3('0x2e')]);_0x250d28[_0x03d3('0x30')]=_['intersection'](_0x250d28['model'],_0x250d28[_0x03d3('0x2e')]);_0x4d1e3f['attributes']=_[_0x03d3('0x31')](_0x250d28[_0x03d3('0x2d')],qs['fields'](_0x380c95[_0x03d3('0x2e')][_0x03d3('0x32')]));_0x4d1e3f[_0x03d3('0x33')]=_0x4d1e3f[_0x03d3('0x33')][_0x03d3('0x34')]?_0x4d1e3f[_0x03d3('0x33')]:_0x250d28[_0x03d3('0x2d')];if(!_0x380c95[_0x03d3('0x2e')][_0x03d3('0x35')]('nolimit')){_0x4d1e3f[_0x03d3('0x1b')]=qs[_0x03d3('0x1b')](_0x380c95[_0x03d3('0x2e')]['limit']);_0x4d1e3f[_0x03d3('0x18')]=qs[_0x03d3('0x18')](_0x380c95[_0x03d3('0x2e')][_0x03d3('0x18')]);}_0x4d1e3f[_0x03d3('0x36')]=qs[_0x03d3('0x37')](_0x380c95['query'][_0x03d3('0x37')]);_0x4d1e3f[_0x03d3('0x38')]=qs[_0x03d3('0x30')](_[_0x03d3('0x39')](_0x380c95[_0x03d3('0x2e')],_0x250d28[_0x03d3('0x30')]),_0x44b0d7);if(_0x380c95[_0x03d3('0x2e')][_0x03d3('0x3a')]){_0x4d1e3f[_0x03d3('0x38')]=_[_0x03d3('0x3b')](_0x4d1e3f[_0x03d3('0x38')],{'$or':_[_0x03d3('0x28')](_0x44b0d7,function(_0xc82817){if(_0xc82817[_0x03d3('0x2c')]!=='VIRTUAL'){var _0x469f47={};_0x469f47[_0xc82817[_0x03d3('0x25')]]={'$like':'%'+_0x380c95[_0x03d3('0x2e')]['filter']+'%'};return _0x469f47;}})});}_0x4d1e3f=_[_0x03d3('0x3b')]({},_0x4d1e3f,_0x380c95['options']);var _0x4a0bf4={'where':_0x4d1e3f[_0x03d3('0x38')]};return db[_0x03d3('0x29')][_0x03d3('0x1a')](_0x4a0bf4)[_0x03d3('0x21')](function(_0x2b6857){_0x465ea8[_0x03d3('0x1a')]=_0x2b6857;if(_0x380c95['query'][_0x03d3('0x3c')]){_0x4d1e3f[_0x03d3('0x3d')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x4d1e3f);})[_0x03d3('0x21')](function(_0x28177c){_0x465ea8[_0x03d3('0x3e')]=_0x28177c;return _0x465ea8;})['then'](respondWithFilteredResult(_0x185711,_0x4d1e3f))[_0x03d3('0x3f')](handleError(_0x185711,null));};exports['show']=function(_0x55e04f,_0x42d81a){var _0x212298={'raw':!![],'where':{'id':_0x55e04f['params']['id']}},_0x2094b8={};_0x2094b8[_0x03d3('0x2d')]=_[_0x03d3('0x2f')](db[_0x03d3('0x29')][_0x03d3('0x2a')]);_0x2094b8[_0x03d3('0x2e')]=_[_0x03d3('0x2f')](_0x55e04f['query']);_0x2094b8[_0x03d3('0x30')]=_[_0x03d3('0x31')](_0x2094b8[_0x03d3('0x2d')],_0x2094b8['query']);_0x212298[_0x03d3('0x33')]=_[_0x03d3('0x31')](_0x2094b8[_0x03d3('0x2d')],qs[_0x03d3('0x32')](_0x55e04f[_0x03d3('0x2e')]['fields']));_0x212298[_0x03d3('0x33')]=_0x212298[_0x03d3('0x33')][_0x03d3('0x34')]?_0x212298[_0x03d3('0x33')]:_0x2094b8['model'];if(_0x55e04f[_0x03d3('0x2e')][_0x03d3('0x3c')]){_0x212298[_0x03d3('0x3d')]=[{'all':!![]}];}_0x212298=_['merge']({},_0x212298,_0x55e04f[_0x03d3('0x40')]);return db[_0x03d3('0x29')][_0x03d3('0x41')](_0x212298)[_0x03d3('0x21')](handleEntityNotFound(_0x42d81a,null))[_0x03d3('0x21')](respondWithResult(_0x42d81a,null))[_0x03d3('0x3f')](handleError(_0x42d81a,null));};exports[_0x03d3('0x42')]=function(_0x47540a,_0x298e69){return db['DeskField']['create'](_0x47540a[_0x03d3('0x43')],{})[_0x03d3('0x21')](respondWithResult(_0x298e69,0xc9))[_0x03d3('0x3f')](handleError(_0x298e69,null));};exports['update']=function(_0xaa6db2,_0x33fb2d){if(_0xaa6db2['body']['id']){delete _0xaa6db2['body']['id'];}return db[_0x03d3('0x29')]['find']({'where':{'id':_0xaa6db2[_0x03d3('0x44')]['id']}})[_0x03d3('0x21')](handleEntityNotFound(_0x33fb2d,null))[_0x03d3('0x21')](saveUpdates(_0xaa6db2[_0x03d3('0x43')],null))['then'](respondWithResult(_0x33fb2d,null))[_0x03d3('0x3f')](handleError(_0x33fb2d,null));};exports[_0x03d3('0x45')]=function(_0x185ad8,_0x309a30){return db[_0x03d3('0x29')][_0x03d3('0x41')]({'where':{'id':_0x185ad8[_0x03d3('0x44')]['id']}})['then'](handleEntityNotFound(_0x309a30,null))[_0x03d3('0x21')](removeEntity(_0x309a30,null))[_0x03d3('0x3f')](handleError(_0x309a30,null));}; \ No newline at end of file +var _0xd7c3=['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','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','DeskField','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js'];(function(_0x1a7c4a,_0x4110a9){var _0x101fc4=function(_0x422eab){while(--_0x422eab){_0x1a7c4a['push'](_0x1a7c4a['shift']());}};_0x101fc4(++_0x4110a9);}(_0xd7c3,0x1c5));var _0x3d7c=function(_0x51cf09,_0x2c3f3c){_0x51cf09=_0x51cf09-0x0;var _0x47a759=_0xd7c3[_0x51cf09];return _0x47a759;};'use strict';var emlformat=require(_0x3d7c('0x0'));var rimraf=require(_0x3d7c('0x1'));var zipdir=require(_0x3d7c('0x2'));var jsonpatch=require(_0x3d7c('0x3'));var rp=require(_0x3d7c('0x4'));var moment=require(_0x3d7c('0x5'));var BPromise=require(_0x3d7c('0x6'));var Mustache=require(_0x3d7c('0x7'));var util=require(_0x3d7c('0x8'));var path=require('path');var sox=require(_0x3d7c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d7c('0xa'));var squel=require(_0x3d7c('0xb'));var crypto=require(_0x3d7c('0xc'));var jsforce=require(_0x3d7c('0xd'));var deskjs=require(_0x3d7c('0xe'));var toCsv=require(_0x3d7c('0xf'));var querystring=require(_0x3d7c('0x10'));var Papa=require(_0x3d7c('0x11'));var Redis=require(_0x3d7c('0x12'));var authService=require(_0x3d7c('0x13'));var qs=require(_0x3d7c('0x14'));var as=require(_0x3d7c('0x15'));var hardwareService=require(_0x3d7c('0x16'));var logger=require(_0x3d7c('0x17'))(_0x3d7c('0x18'));var utils=require(_0x3d7c('0x19'));var config=require(_0x3d7c('0x1a'));var licenseUtil=require(_0x3d7c('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20148f,_0x40e8a6){_0x40e8a6=_0x40e8a6||0xcc;return function(_0xb7bd60){if(_0xb7bd60){return _0x20148f[_0x3d7c('0x1c')](_0x40e8a6);}return _0x20148f[_0x3d7c('0x1d')](_0x40e8a6)[_0x3d7c('0x1e')]();};}function respondWithResult(_0x4728dc,_0x477faf){_0x477faf=_0x477faf||0xc8;return function(_0x2717c5){if(_0x2717c5){return _0x4728dc[_0x3d7c('0x1d')](_0x477faf)[_0x3d7c('0x1f')](_0x2717c5);}};}function respondWithFilteredResult(_0x37122a,_0x1ba7ee){return function(_0xf0a186){if(_0xf0a186){var _0x9d0305=typeof _0x1ba7ee[_0x3d7c('0x20')]==='undefined'&&typeof _0x1ba7ee[_0x3d7c('0x21')]===_0x3d7c('0x22');var _0x49e25c=_0xf0a186['count'];var _0x447ea0=_0x9d0305?0x0:_0x1ba7ee[_0x3d7c('0x20')];var _0x323204=_0x9d0305?_0xf0a186[_0x3d7c('0x23')]:_0x1ba7ee['offset']+_0x1ba7ee[_0x3d7c('0x21')];var _0x328851;if(_0x323204>=_0x49e25c){_0x323204=_0x49e25c;_0x328851=0xc8;}else{_0x328851=0xce;}_0x37122a[_0x3d7c('0x1d')](_0x328851);return _0x37122a['set'](_0x3d7c('0x24'),_0x447ea0+'-'+_0x323204+'/'+_0x49e25c)[_0x3d7c('0x1f')](_0xf0a186);}return null;};}function patchUpdates(_0x3a99fd){return function(_0x5a91d2){try{jsonpatch[_0x3d7c('0x25')](_0x5a91d2,_0x3a99fd,!![]);}catch(_0x22f9f6){return BPromise[_0x3d7c('0x26')](_0x22f9f6);}return _0x5a91d2[_0x3d7c('0x27')]();};}function saveUpdates(_0xa4fbe9,_0x4c977f){return function(_0x126c5e){if(_0x126c5e){return _0x126c5e[_0x3d7c('0x28')](_0xa4fbe9)[_0x3d7c('0x29')](function(_0x81a5a3){return _0x81a5a3;});}return null;};}function removeEntity(_0x553df1,_0x4a7966){return function(_0x3518c9){if(_0x3518c9){return _0x3518c9[_0x3d7c('0x2a')]()[_0x3d7c('0x29')](function(){_0x553df1[_0x3d7c('0x1d')](0xcc)[_0x3d7c('0x1e')]();});}};}function handleEntityNotFound(_0x2806a5,_0x139fa2){return function(_0x2ac594){if(!_0x2ac594){_0x2806a5[_0x3d7c('0x1c')](0x194);}return _0x2ac594;};}function handleError(_0x4696f1,_0x820d20){_0x820d20=_0x820d20||0x1f4;return function(_0x4d440b){logger['error'](_0x4d440b[_0x3d7c('0x2b')]);if(_0x4d440b[_0x3d7c('0x2c')]){delete _0x4d440b['name'];}_0x4696f1[_0x3d7c('0x1d')](_0x820d20)[_0x3d7c('0x2d')](_0x4d440b);};}exports[_0x3d7c('0x2e')]=function(_0x53698b,_0x457c53){var _0x386719={},_0x215c60={},_0x236440={'count':0x0,'rows':[]};var _0x257dde=_['map'](db[_0x3d7c('0x2f')][_0x3d7c('0x30')],function(_0x20dc15){return{'name':_0x20dc15['fieldName'],'type':_0x20dc15[_0x3d7c('0x31')][_0x3d7c('0x32')]};});_0x215c60[_0x3d7c('0x33')]=_[_0x3d7c('0x34')](_0x257dde,_0x3d7c('0x2c'));_0x215c60[_0x3d7c('0x35')]=_['keys'](_0x53698b['query']);_0x215c60[_0x3d7c('0x36')]=_[_0x3d7c('0x37')](_0x215c60[_0x3d7c('0x33')],_0x215c60[_0x3d7c('0x35')]);_0x386719[_0x3d7c('0x38')]=_[_0x3d7c('0x37')](_0x215c60['model'],qs[_0x3d7c('0x39')](_0x53698b[_0x3d7c('0x35')][_0x3d7c('0x39')]));_0x386719['attributes']=_0x386719[_0x3d7c('0x38')]['length']?_0x386719['attributes']:_0x215c60[_0x3d7c('0x33')];if(!_0x53698b[_0x3d7c('0x35')][_0x3d7c('0x3a')](_0x3d7c('0x3b'))){_0x386719['limit']=qs[_0x3d7c('0x21')](_0x53698b[_0x3d7c('0x35')]['limit']);_0x386719[_0x3d7c('0x20')]=qs['offset'](_0x53698b[_0x3d7c('0x35')][_0x3d7c('0x20')]);}_0x386719[_0x3d7c('0x3c')]=qs[_0x3d7c('0x3d')](_0x53698b[_0x3d7c('0x35')][_0x3d7c('0x3d')]);_0x386719[_0x3d7c('0x3e')]=qs[_0x3d7c('0x36')](_[_0x3d7c('0x3f')](_0x53698b[_0x3d7c('0x35')],_0x215c60[_0x3d7c('0x36')]),_0x257dde);if(_0x53698b[_0x3d7c('0x35')]['filter']){_0x386719[_0x3d7c('0x3e')]=_[_0x3d7c('0x40')](_0x386719[_0x3d7c('0x3e')],{'$or':_[_0x3d7c('0x34')](_0x257dde,function(_0x1f1e29){if(_0x1f1e29[_0x3d7c('0x31')]!==_0x3d7c('0x41')){var _0x55ada1={};_0x55ada1[_0x1f1e29[_0x3d7c('0x2c')]]={'$like':'%'+_0x53698b[_0x3d7c('0x35')]['filter']+'%'};return _0x55ada1;}})});}_0x386719=_['merge']({},_0x386719,_0x53698b['options']);var _0x40058f={'where':_0x386719[_0x3d7c('0x3e')]};return db[_0x3d7c('0x2f')][_0x3d7c('0x23')](_0x40058f)['then'](function(_0x130583){_0x236440[_0x3d7c('0x23')]=_0x130583;if(_0x53698b[_0x3d7c('0x35')][_0x3d7c('0x42')]){_0x386719[_0x3d7c('0x43')]=[{'all':!![]}];}return db[_0x3d7c('0x2f')][_0x3d7c('0x44')](_0x386719);})[_0x3d7c('0x29')](function(_0x12fc85){_0x236440[_0x3d7c('0x45')]=_0x12fc85;return _0x236440;})[_0x3d7c('0x29')](respondWithFilteredResult(_0x457c53,_0x386719))[_0x3d7c('0x46')](handleError(_0x457c53,null));};exports[_0x3d7c('0x47')]=function(_0x5bb21a,_0x5b0db8){var _0x177ad7={'raw':!![],'where':{'id':_0x5bb21a[_0x3d7c('0x48')]['id']}},_0x2ed019={};_0x2ed019['model']=_[_0x3d7c('0x49')](db[_0x3d7c('0x2f')][_0x3d7c('0x30')]);_0x2ed019[_0x3d7c('0x35')]=_[_0x3d7c('0x49')](_0x5bb21a[_0x3d7c('0x35')]);_0x2ed019[_0x3d7c('0x36')]=_[_0x3d7c('0x37')](_0x2ed019['model'],_0x2ed019[_0x3d7c('0x35')]);_0x177ad7[_0x3d7c('0x38')]=_[_0x3d7c('0x37')](_0x2ed019[_0x3d7c('0x33')],qs['fields'](_0x5bb21a[_0x3d7c('0x35')][_0x3d7c('0x39')]));_0x177ad7[_0x3d7c('0x38')]=_0x177ad7[_0x3d7c('0x38')][_0x3d7c('0x4a')]?_0x177ad7['attributes']:_0x2ed019[_0x3d7c('0x33')];if(_0x5bb21a['query'][_0x3d7c('0x42')]){_0x177ad7[_0x3d7c('0x43')]=[{'all':!![]}];}_0x177ad7=_[_0x3d7c('0x40')]({},_0x177ad7,_0x5bb21a['options']);return db[_0x3d7c('0x2f')][_0x3d7c('0x4b')](_0x177ad7)[_0x3d7c('0x29')](handleEntityNotFound(_0x5b0db8,null))[_0x3d7c('0x29')](respondWithResult(_0x5b0db8,null))[_0x3d7c('0x46')](handleError(_0x5b0db8,null));};exports['create']=function(_0x468a9c,_0x393217){return db[_0x3d7c('0x2f')][_0x3d7c('0x4c')](_0x468a9c[_0x3d7c('0x4d')],{})[_0x3d7c('0x29')](respondWithResult(_0x393217,0xc9))[_0x3d7c('0x46')](handleError(_0x393217,null));};exports[_0x3d7c('0x28')]=function(_0x2549ed,_0x33cc2c){if(_0x2549ed['body']['id']){delete _0x2549ed[_0x3d7c('0x4d')]['id'];}return db[_0x3d7c('0x2f')][_0x3d7c('0x4b')]({'where':{'id':_0x2549ed[_0x3d7c('0x48')]['id']}})[_0x3d7c('0x29')](handleEntityNotFound(_0x33cc2c,null))['then'](saveUpdates(_0x2549ed[_0x3d7c('0x4d')],null))[_0x3d7c('0x29')](respondWithResult(_0x33cc2c,null))[_0x3d7c('0x46')](handleError(_0x33cc2c,null));};exports[_0x3d7c('0x2a')]=function(_0x1cba46,_0x31bbac){return db[_0x3d7c('0x2f')][_0x3d7c('0x4b')]({'where':{'id':_0x1cba46['params']['id']}})[_0x3d7c('0x29')](handleEntityNotFound(_0x31bbac,null))['then'](removeEntity(_0x31bbac,null))['catch'](handleError(_0x31bbac,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index ec845d0..6f69cbe 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 _0xd70d=['moment','bluebird','request-promise','path','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x387fe4,_0x186656){var _0x43c1c1=function(_0x19ab90){while(--_0x19ab90){_0x387fe4['push'](_0x387fe4['shift']());}};_0x43c1c1(++_0x186656);}(_0xd70d,0x1dc));var _0xdd70=function(_0x441994,_0x58bb50){_0x441994=_0x441994-0x0;var _0x479c50=_0xd70d[_0x441994];return _0x479c50;};'use strict';var _=require(_0xdd70('0x0'));var util=require(_0xdd70('0x1'));var logger=require(_0xdd70('0x2'))(_0xdd70('0x3'));var moment=require(_0xdd70('0x4'));var BPromise=require(_0xdd70('0x5'));var rp=require(_0xdd70('0x6'));var fs=require('fs');var path=require(_0xdd70('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdd70('0x8'));module[_0xdd70('0x9')]=function(_0x3e0ecf,_0x2a7222){return _0x3e0ecf[_0xdd70('0xa')](_0xdd70('0xb'),attributes,{'tableName':_0xdd70('0xc'),'paranoid':![],'indexes':[{'name':_0xdd70('0xd'),'fields':[_0xdd70('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3f2b=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x3f2b,0x10f));var _0xb3f2=function(_0x49d0fb,_0x99b10b){_0x49d0fb=_0x49d0fb-0x0;var _0x10869b=_0x3f2b[_0x49d0fb];return _0x10869b;};'use strict';var _=require(_0xb3f2('0x0'));var util=require(_0xb3f2('0x1'));var logger=require(_0xb3f2('0x2'))(_0xb3f2('0x3'));var moment=require(_0xb3f2('0x4'));var BPromise=require(_0xb3f2('0x5'));var rp=require(_0xb3f2('0x6'));var fs=require('fs');var path=require(_0xb3f2('0x7'));var rimraf=require(_0xb3f2('0x8'));var config=require(_0xb3f2('0x9'));var attributes=require(_0xb3f2('0xa'));module[_0xb3f2('0xb')]=function(_0x3f6fb8,_0x46e84c){return _0x3f6fb8[_0xb3f2('0xc')](_0xb3f2('0xd'),attributes,{'tableName':_0xb3f2('0xe'),'paranoid':![],'indexes':[{'name':_0xb3f2('0xf'),'fields':[_0xb3f2('0x10'),_0xb3f2('0x11')],'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 4786047..fe4f326 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 _0xe59b=['client','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0xe59b,0xe6));var _0xbe59=function(_0x2ea4cc,_0x1a7dc4){_0x2ea4cc=_0x2ea4cc-0x0;var _0x318a7d=_0xe59b[_0x2ea4cc];return _0x318a7d;};'use strict';var _=require(_0xbe59('0x0'));var util=require(_0xbe59('0x1'));var moment=require(_0xbe59('0x2'));var BPromise=require(_0xbe59('0x3'));var rs=require(_0xbe59('0x4'));var fs=require('fs');var Redis=require(_0xbe59('0x5'));var db=require(_0xbe59('0x6'))['db'];var utils=require(_0xbe59('0x7'));var logger=require(_0xbe59('0x8'))(_0xbe59('0x9'));var config=require(_0xbe59('0xa'));var jayson=require(_0xbe59('0xb'));var client=jayson[_0xbe59('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x105333,_0x16d4c1,_0x369ebb){return new BPromise(function(_0x8dcfee,_0x5daec9){return client[_0xbe59('0xd')](_0x105333,_0x369ebb)['then'](function(_0x18d915){logger[_0xbe59('0xe')](_0xbe59('0xf'),_0x16d4c1,_0xbe59('0x10'));logger[_0xbe59('0x11')]('DeskField,\x20%s,\x20%s,\x20%s',_0x16d4c1,_0xbe59('0x10'),JSON['stringify'](_0x18d915));if(_0x18d915[_0xbe59('0x12')]){if(_0x18d915[_0xbe59('0x12')]['code']===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x16d4c1,_0x18d915['error'][_0xbe59('0x13')]);return _0x5daec9(_0x18d915[_0xbe59('0x12')]['message']);}logger['error'](_0xbe59('0xf'),_0x16d4c1,_0x18d915[_0xbe59('0x12')][_0xbe59('0x13')]);return _0x8dcfee(_0x18d915[_0xbe59('0x12')]['message']);}else{logger['info'](_0xbe59('0xf'),_0x16d4c1,_0xbe59('0x10'));_0x8dcfee(_0x18d915[_0xbe59('0x14')]['message']);}})[_0xbe59('0x15')](function(_0x298cf4){logger[_0xbe59('0x12')](_0xbe59('0xf'),_0x16d4c1,_0x298cf4);_0x5daec9(_0x298cf4);});});} \ No newline at end of file +var _0xb6a2=['error','code','DeskField,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x101bbe,_0x172b68){var _0x1658d7=function(_0x3995b4){while(--_0x3995b4){_0x101bbe['push'](_0x101bbe['shift']());}};_0x1658d7(++_0x172b68);}(_0xb6a2,0x1d1));var _0x2b6a=function(_0x19f2db,_0x431044){_0x19f2db=_0x19f2db-0x0;var _0x3f4eab=_0xb6a2[_0x19f2db];return _0x3f4eab;};'use strict';var _=require(_0x2b6a('0x0'));var util=require('util');var moment=require(_0x2b6a('0x1'));var BPromise=require(_0x2b6a('0x2'));var rs=require(_0x2b6a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2b6a('0x4'));var logger=require('../../config/logger')(_0x2b6a('0x5'));var config=require(_0x2b6a('0x6'));var jayson=require(_0x2b6a('0x7'));var client=jayson[_0x2b6a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x442c4d,_0x5500ee,_0x3beabb){return new BPromise(function(_0x4a9297,_0x29d6cc){return client[_0x2b6a('0x9')](_0x442c4d,_0x3beabb)['then'](function(_0xb6affd){logger[_0x2b6a('0xa')]('DeskField,\x20%s,\x20%s',_0x5500ee,_0x2b6a('0xb'));logger[_0x2b6a('0xc')](_0x2b6a('0xd'),_0x5500ee,_0x2b6a('0xb'),JSON[_0x2b6a('0xe')](_0xb6affd));if(_0xb6affd[_0x2b6a('0xf')]){if(_0xb6affd[_0x2b6a('0xf')][_0x2b6a('0x10')]===0x1f4){logger['error'](_0x2b6a('0x11'),_0x5500ee,_0xb6affd['error']['message']);return _0x29d6cc(_0xb6affd[_0x2b6a('0xf')]['message']);}logger[_0x2b6a('0xf')](_0x2b6a('0x11'),_0x5500ee,_0xb6affd[_0x2b6a('0xf')]['message']);return _0x4a9297(_0xb6affd[_0x2b6a('0xf')][_0x2b6a('0x12')]);}else{logger[_0x2b6a('0xa')](_0x2b6a('0x11'),_0x5500ee,_0x2b6a('0xb'));_0x4a9297(_0xb6affd['result']['message']);}})[_0x2b6a('0x13')](function(_0x27b07a){logger['error'](_0x2b6a('0x11'),_0x5500ee,_0x27b07a);_0x29d6cc(_0x27b07a);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 52eca40..c9a9ba7 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 _0x84f5=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x600d0,_0x3c6074){var _0x4fe86a=function(_0x4cc62d){while(--_0x4cc62d){_0x600d0['push'](_0x600d0['shift']());}};_0x4fe86a(++_0x3c6074);}(_0x84f5,0xf1));var _0x584f=function(_0x106db6,_0xd6decc){_0x106db6=_0x106db6-0x0;var _0x4dc175=_0x84f5[_0x106db6];return _0x4dc175;};'use strict';var multer=require(_0x584f('0x0'));var util=require(_0x584f('0x1'));var path=require(_0x584f('0x2'));var timeout=require(_0x584f('0x3'));var express=require(_0x584f('0x4'));var router=express[_0x584f('0x5')]();var fs_extra=require(_0x584f('0x6'));var auth=require(_0x584f('0x7'));var interaction=require(_0x584f('0x8'));var config=require(_0x584f('0x9'));var controller=require('./intDynamics365Account.controller');router[_0x584f('0xa')]('/',auth[_0x584f('0xb')](),controller[_0x584f('0xc')]);router['get'](_0x584f('0xd'),auth['isAuthenticated'](),controller[_0x584f('0xe')]);router['get'](_0x584f('0xf'),auth[_0x584f('0xb')](),controller[_0x584f('0x10')]);router[_0x584f('0xa')](_0x584f('0x11'),auth[_0x584f('0xb')](),controller['getFields']);router[_0x584f('0x12')]('/',auth['isAuthenticated'](),controller[_0x584f('0x13')]);router['post'](_0x584f('0xf'),auth[_0x584f('0xb')](),controller[_0x584f('0x14')]);router[_0x584f('0x15')](_0x584f('0xd'),auth[_0x584f('0xb')](),controller[_0x584f('0x16')]);router[_0x584f('0x17')](_0x584f('0xd'),auth[_0x584f('0xb')](),controller['destroy']);module[_0x584f('0x18')]=router; \ No newline at end of file +var _0x0136=['index','show','isAuthenticated','getFields','post','create','/:id/configurations','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x391d9a,_0x28f029){var _0x29fad8=function(_0x59259b){while(--_0x59259b){_0x391d9a['push'](_0x391d9a['shift']());}};_0x29fad8(++_0x28f029);}(_0x0136,0xc7));var _0x6013=function(_0x4f21f6,_0xa85e36){_0x4f21f6=_0x4f21f6-0x0;var _0x450641=_0x0136[_0x4f21f6];return _0x450641;};'use strict';var multer=require(_0x6013('0x0'));var util=require(_0x6013('0x1'));var path=require(_0x6013('0x2'));var timeout=require(_0x6013('0x3'));var express=require(_0x6013('0x4'));var router=express[_0x6013('0x5')]();var fs_extra=require(_0x6013('0x6'));var auth=require(_0x6013('0x7'));var interaction=require(_0x6013('0x8'));var config=require(_0x6013('0x9'));var controller=require('./intDynamics365Account.controller');router[_0x6013('0xa')]('/',auth['isAuthenticated'](),controller[_0x6013('0xb')]);router[_0x6013('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x6013('0xc')]);router[_0x6013('0xa')]('/:id/configurations',auth[_0x6013('0xd')](),controller['getConfigurations']);router[_0x6013('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x6013('0xe')]);router[_0x6013('0xf')]('/',auth['isAuthenticated'](),controller[_0x6013('0x10')]);router[_0x6013('0xf')](_0x6013('0x11'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x6013('0x12'),auth[_0x6013('0xd')](),controller['update']);router['delete'](_0x6013('0x12'),auth[_0x6013('0xd')](),controller[_0x6013('0x13')]);module[_0x6013('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index c6f251c..354c854 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 _0x21cd=['STRING','BOOLEAN','sequelize','exports'];(function(_0x209e01,_0x12d6fa){var _0x1cf850=function(_0x9c4482){while(--_0x9c4482){_0x209e01['push'](_0x209e01['shift']());}};_0x1cf850(++_0x12d6fa);}(_0x21cd,0x6a));var _0xd21c=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x21cd[_0x2261ce];return _0x524640;};'use strict';var Sequelize=require(_0xd21c('0x0'));module[_0xd21c('0x1')]={'name':{'type':Sequelize[_0xd21c('0x2')]},'username':{'type':Sequelize[_0xd21c('0x2')]},'password':{'type':Sequelize[_0xd21c('0x2')]},'remoteUri':{'type':Sequelize[_0xd21c('0x2')]},'tenantId':{'type':Sequelize[_0xd21c('0x2')]},'clientId':{'type':Sequelize[_0xd21c('0x2')]},'clientSecret':{'type':Sequelize[_0xd21c('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xd21c('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4279=['exports','STRING','BOOLEAN'];(function(_0x4362c4,_0x57b51f){var _0x4e2876=function(_0x208a59){while(--_0x208a59){_0x4362c4['push'](_0x4362c4['shift']());}};_0x4e2876(++_0x57b51f);}(_0x4279,0x8d));var _0x9427=function(_0x17556d,_0x4e1b9e){_0x17556d=_0x17556d-0x0;var _0x17b765=_0x4279[_0x17556d];return _0x17b765;};'use strict';var Sequelize=require('sequelize');module[_0x9427('0x0')]={'name':{'type':Sequelize[_0x9427('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x9427('0x1')]},'remoteUri':{'type':Sequelize[_0x9427('0x1')]},'tenantId':{'type':Sequelize[_0x9427('0x1')]},'clientId':{'type':Sequelize[_0x9427('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x9427('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x9427('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 30094c7..48656d6 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 _0xca99=['followupby','importsequencenumber','influencescore','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientId','clientSecret','CloudProvider','data5','data7','modernAuthentication','POST','https://login.microsoftonline.com/','/oauth2/token','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','LogicalName','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','MetadataId','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','UserLocalizedLabel','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','offset','limit','undefined','count','status','set','Content-Range','json','update','then','destroy','end','sendStatus','error','stack','name','send','index','Dynamics365Account','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','fields','length','options','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','pick','addConfiguration','AccountId','channel','Descriptions','Dynamics365Field','Subjects','slice','substring','format','%s/api/data/v9.0/','getFields','ticketType','Incident','title','customerid','ownerid','subject','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridtype','customeridyominame','entitlementidname','entityimage_url','escalatedon','exchangerate'];(function(_0x1905ed,_0x1ac28b){var _0x82b429=function(_0x58483e){while(--_0x58483e){_0x1905ed['push'](_0x1905ed['shift']());}};_0x82b429(++_0x1ac28b);}(_0xca99,0x1c6));var _0x9ca9=function(_0x3338fe,_0x43ca83){_0x3338fe=_0x3338fe-0x0;var _0x1bb7f1=_0xca99[_0x3338fe];return _0x1bb7f1;};'use strict';var rp=require(_0x9ca9('0x0'));var util=require(_0x9ca9('0x1'));var _=require(_0x9ca9('0x2'));var qs=require(_0x9ca9('0x3'));var logger=require(_0x9ca9('0x4'))(_0x9ca9('0x5'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9ca9('0x6'));function respondWithResult(_0x10bea0,_0xf0820d){_0xf0820d=_0xf0820d||0xc8;return function(_0x303bfa){if(_0x303bfa){return _0x10bea0['status'](_0xf0820d)['json'](_0x303bfa);}};}function respondWithFilteredResult(_0x4e5608,_0x2438b5){return function(_0x23f69f){if(_0x23f69f){var _0x4c7888=typeof _0x2438b5[_0x9ca9('0x7')]==='undefined'&&typeof _0x2438b5[_0x9ca9('0x8')]===_0x9ca9('0x9');var _0x400763=_0x23f69f[_0x9ca9('0xa')];var _0x2d387b=_0x4c7888?0x0:_0x2438b5[_0x9ca9('0x7')];var _0x2e56e7=_0x4c7888?_0x23f69f[_0x9ca9('0xa')]:_0x2438b5[_0x9ca9('0x7')]+_0x2438b5[_0x9ca9('0x8')];var _0x1232af;if(_0x2e56e7>=_0x400763){_0x2e56e7=_0x400763;_0x1232af=0xc8;}else{_0x1232af=0xce;}_0x4e5608[_0x9ca9('0xb')](_0x1232af);return _0x4e5608[_0x9ca9('0xc')](_0x9ca9('0xd'),_0x2d387b+'-'+_0x2e56e7+'/'+_0x400763)[_0x9ca9('0xe')](_0x23f69f);}return null;};}function saveUpdates(_0x5552f4){return function(_0x4ff7a8){if(_0x4ff7a8){return _0x4ff7a8[_0x9ca9('0xf')](_0x5552f4)[_0x9ca9('0x10')](function(_0x2358e0){return _0x2358e0;});}return null;};}function removeEntity(_0xd5384f){return function(_0x55a11d){if(_0x55a11d){return _0x55a11d[_0x9ca9('0x11')]()[_0x9ca9('0x10')](function(){_0xd5384f['status'](0xcc)[_0x9ca9('0x12')]();});}};}function handleEntityNotFound(_0x3e1ee9){return function(_0x5dc086){if(!_0x5dc086){_0x3e1ee9[_0x9ca9('0x13')](0x194);}return _0x5dc086;};}function handleError(_0x9eed50,_0x34b56c){_0x34b56c=_0x34b56c||0x1f4;return function(_0x18a2a6){logger[_0x9ca9('0x14')](_0x18a2a6[_0x9ca9('0x15')]);if(_0x18a2a6['name']){delete _0x18a2a6[_0x9ca9('0x16')];}_0x9eed50[_0x9ca9('0xb')](_0x34b56c)[_0x9ca9('0x17')](_0x18a2a6);};}exports[_0x9ca9('0x18')]=function(_0x2b286a,_0x9107aa){var _0x92f471={},_0x1e54d0={},_0x378b39={'count':0x0,'rows':[]};var _0x37f10c=_['map'](db[_0x9ca9('0x19')][_0x9ca9('0x1a')],function(_0x544509){return{'name':_0x544509[_0x9ca9('0x1b')],'type':_0x544509[_0x9ca9('0x1c')][_0x9ca9('0x1d')]};});_0x1e54d0[_0x9ca9('0x1e')]=_['map'](_0x37f10c,_0x9ca9('0x16'));_0x1e54d0['query']=_[_0x9ca9('0x1f')](_0x2b286a[_0x9ca9('0x20')]);_0x1e54d0['filters']=_[_0x9ca9('0x21')](_0x1e54d0[_0x9ca9('0x1e')],_0x1e54d0[_0x9ca9('0x20')]);_0x92f471[_0x9ca9('0x22')]=_[_0x9ca9('0x21')](_0x1e54d0[_0x9ca9('0x1e')],qs['fields'](_0x2b286a[_0x9ca9('0x20')]['fields']));_0x92f471['attributes']=_0x92f471[_0x9ca9('0x22')]['length']?_0x92f471['attributes']:_0x1e54d0[_0x9ca9('0x1e')];if(!_0x2b286a[_0x9ca9('0x20')][_0x9ca9('0x23')](_0x9ca9('0x24'))){_0x92f471[_0x9ca9('0x8')]=qs[_0x9ca9('0x8')](_0x2b286a[_0x9ca9('0x20')]['limit']);_0x92f471[_0x9ca9('0x7')]=qs[_0x9ca9('0x7')](_0x2b286a[_0x9ca9('0x20')][_0x9ca9('0x7')]);}_0x92f471[_0x9ca9('0x25')]=qs[_0x9ca9('0x26')](_0x2b286a[_0x9ca9('0x20')][_0x9ca9('0x26')]);_0x92f471[_0x9ca9('0x27')]=qs[_0x9ca9('0x28')](_['pick'](_0x2b286a['query'],_0x1e54d0[_0x9ca9('0x28')]),_0x37f10c);if(_0x2b286a['query'][_0x9ca9('0x29')]){_0x92f471[_0x9ca9('0x27')]=_[_0x9ca9('0x2a')](_0x92f471[_0x9ca9('0x27')],{'$or':_[_0x9ca9('0x2b')](_0x37f10c,function(_0x1048df){if(_0x1048df['type']!==_0x9ca9('0x2c')){var _0x4fe39c={};_0x4fe39c[_0x1048df[_0x9ca9('0x16')]]={'$like':'%'+_0x2b286a[_0x9ca9('0x20')]['filter']+'%'};return _0x4fe39c;}})});}_0x92f471=_[_0x9ca9('0x2a')]({},_0x92f471,_0x2b286a['options']);var _0x5ef01d={'where':_0x92f471['where']};return db[_0x9ca9('0x19')][_0x9ca9('0xa')](_0x5ef01d)['then'](function(_0x2e2658){_0x378b39[_0x9ca9('0xa')]=_0x2e2658;if(_0x2b286a['query'][_0x9ca9('0x2d')]){_0x92f471[_0x9ca9('0x2e')]=[{'all':!![]}];}return db[_0x9ca9('0x19')][_0x9ca9('0x2f')](_0x92f471);})[_0x9ca9('0x10')](function(_0x127281){_0x378b39[_0x9ca9('0x30')]=_0x127281;return _0x378b39;})[_0x9ca9('0x10')](respondWithFilteredResult(_0x9107aa,_0x92f471))[_0x9ca9('0x31')](handleError(_0x9107aa,null));};exports[_0x9ca9('0x32')]=function(_0x335d6f,_0x4bfd3e){var _0x5647de={'raw':![],'where':{'id':_0x335d6f['params']['id']}},_0x428fef={};_0x428fef[_0x9ca9('0x1e')]=_['keys'](db[_0x9ca9('0x19')][_0x9ca9('0x1a')]);_0x428fef[_0x9ca9('0x20')]=_[_0x9ca9('0x1f')](_0x335d6f[_0x9ca9('0x20')]);_0x428fef[_0x9ca9('0x28')]=_['intersection'](_0x428fef['model'],_0x428fef[_0x9ca9('0x20')]);_0x5647de[_0x9ca9('0x22')]=_[_0x9ca9('0x21')](_0x428fef['model'],qs['fields'](_0x335d6f[_0x9ca9('0x20')][_0x9ca9('0x33')]));_0x5647de[_0x9ca9('0x22')]=_0x5647de['attributes'][_0x9ca9('0x34')]?_0x5647de[_0x9ca9('0x22')]:_0x428fef[_0x9ca9('0x1e')];if(_0x335d6f['query'][_0x9ca9('0x2d')]){_0x5647de[_0x9ca9('0x2e')]=[{'all':!![]}];}_0x5647de=_[_0x9ca9('0x2a')]({},_0x5647de,_0x335d6f[_0x9ca9('0x35')]);return db[_0x9ca9('0x19')][_0x9ca9('0x36')](_0x5647de)[_0x9ca9('0x10')](handleEntityNotFound(_0x4bfd3e,null))[_0x9ca9('0x10')](respondWithResult(_0x4bfd3e,null))[_0x9ca9('0x31')](handleError(_0x4bfd3e,null));};exports[_0x9ca9('0x37')]=function(_0x2cc7c4,_0x4ab2cf){return db[_0x9ca9('0x19')][_0x9ca9('0x37')](_0x2cc7c4[_0x9ca9('0x38')],{})['then'](respondWithResult(_0x4ab2cf,0xc9))[_0x9ca9('0x31')](handleError(_0x4ab2cf,null));};exports[_0x9ca9('0xf')]=function(_0x16fcb1,_0x23e898){if(_0x16fcb1[_0x9ca9('0x38')]['id']){delete _0x16fcb1[_0x9ca9('0x38')]['id'];}return db[_0x9ca9('0x19')]['find']({'where':{'id':_0x16fcb1[_0x9ca9('0x39')]['id']}})[_0x9ca9('0x10')](handleEntityNotFound(_0x23e898,null))[_0x9ca9('0x10')](saveUpdates(_0x16fcb1[_0x9ca9('0x38')],null))[_0x9ca9('0x10')](respondWithResult(_0x23e898,null))['catch'](handleError(_0x23e898,null));};exports['destroy']=function(_0x40cb22,_0xfe838f){return db[_0x9ca9('0x19')]['find']({'where':{'id':_0x40cb22[_0x9ca9('0x39')]['id']}})[_0x9ca9('0x10')](handleEntityNotFound(_0xfe838f,null))[_0x9ca9('0x10')](removeEntity(_0xfe838f,null))['catch'](handleError(_0xfe838f,null));};exports[_0x9ca9('0x3a')]=function(_0x1b801f,_0x27ffc1){var _0x4fb976={};var _0x219d35={};var _0x5bb240;var _0x8b4a93;return db[_0x9ca9('0x19')][_0x9ca9('0x3b')]({'where':{'id':_0x1b801f[_0x9ca9('0x39')]['id']}})[_0x9ca9('0x10')](handleEntityNotFound(_0x27ffc1,null))[_0x9ca9('0x10')](function(_0xf791f8){if(_0xf791f8){_0x5bb240=_0xf791f8;_0x219d35[_0x9ca9('0x1e')]=_[_0x9ca9('0x1f')](db[_0x9ca9('0x3c')][_0x9ca9('0x1a')]);_0x219d35[_0x9ca9('0x20')]=_['keys'](_0x1b801f[_0x9ca9('0x20')]);_0x219d35['filters']=_[_0x9ca9('0x21')](_0x219d35['model'],_0x219d35[_0x9ca9('0x20')]);_0x4fb976[_0x9ca9('0x22')]=_[_0x9ca9('0x21')](_0x219d35[_0x9ca9('0x1e')],qs[_0x9ca9('0x33')](_0x1b801f[_0x9ca9('0x20')]['fields']));_0x4fb976['attributes']=_0x4fb976[_0x9ca9('0x22')][_0x9ca9('0x34')]?_0x4fb976['attributes']:_0x219d35[_0x9ca9('0x1e')];_0x4fb976['order']=qs['sort'](_0x1b801f[_0x9ca9('0x20')][_0x9ca9('0x26')]);_0x4fb976['where']=qs['filters'](_[_0x9ca9('0x3d')](_0x1b801f[_0x9ca9('0x20')],_0x219d35[_0x9ca9('0x28')]));if(_0x1b801f['query'][_0x9ca9('0x29')]){_0x4fb976[_0x9ca9('0x27')]=_[_0x9ca9('0x2a')](_0x4fb976['where'],{'$or':_['map'](_0x4fb976[_0x9ca9('0x22')],function(_0x1e7fcc){var _0xab25c1={};_0xab25c1[_0x1e7fcc]={'$like':'%'+_0x1b801f[_0x9ca9('0x20')][_0x9ca9('0x29')]+'%'};return _0xab25c1;})});}_0x4fb976=_[_0x9ca9('0x2a')]({},_0x4fb976,_0x1b801f[_0x9ca9('0x35')]);return _0x5bb240['getConfigurations'](_0x4fb976);}})[_0x9ca9('0x10')](function(_0x468187){if(_0x468187){_0x8b4a93=_0x468187[_0x9ca9('0x34')];if(!_0x1b801f[_0x9ca9('0x20')][_0x9ca9('0x23')]('nolimit')){_0x4fb976[_0x9ca9('0x8')]=qs['limit'](_0x1b801f[_0x9ca9('0x20')][_0x9ca9('0x8')]);_0x4fb976['offset']=qs[_0x9ca9('0x7')](_0x1b801f[_0x9ca9('0x20')][_0x9ca9('0x7')]);}return _0x5bb240[_0x9ca9('0x3a')](_0x4fb976);}})[_0x9ca9('0x10')](function(_0x1125fc){if(_0x1125fc){return _0x1125fc?{'count':_0x8b4a93,'rows':_0x1125fc}:null;}})[_0x9ca9('0x10')](respondWithResult(_0x27ffc1,null))['catch'](handleError(_0x27ffc1,null));};exports[_0x9ca9('0x3e')]=function(_0x5ce451,_0x9e3630){if(_0x5ce451[_0x9ca9('0x38')]['id']){delete _0x5ce451[_0x9ca9('0x38')]['id'];}return db['Dynamics365Account'][_0x9ca9('0x3b')]({'where':{'id':_0x5ce451['params']['id']}})['then'](handleEntityNotFound(_0x9e3630,null))[_0x9ca9('0x10')](function(_0x33cfa8){if(_0x33cfa8){_0x5ce451['body'][_0x9ca9('0x3f')]=_0x33cfa8['id'];_0x5ce451[_0x9ca9('0x38')]['Subjects']=integrations['getSubjects'](_0x5ce451[_0x9ca9('0x38')][_0x9ca9('0x40')],_0x5ce451[_0x9ca9('0x38')][_0x9ca9('0x1c')]);_0x5ce451[_0x9ca9('0x38')][_0x9ca9('0x41')]=integrations['getDescriptions'](_0x5ce451[_0x9ca9('0x38')][_0x9ca9('0x40')],_0x5ce451[_0x9ca9('0x38')][_0x9ca9('0x1c')]);return db[_0x9ca9('0x3c')]['create'](_0x5ce451['body'],{'include':[{'model':db[_0x9ca9('0x42')],'as':_0x9ca9('0x43')},{'model':db[_0x9ca9('0x42')],'as':_0x9ca9('0x41')}]});}return null;})[_0x9ca9('0x10')](respondWithResult(_0x9e3630,null))[_0x9ca9('0x31')](handleError(_0x9e3630,null));};function sanitizeRemoteUri(_0x4c1078){var _0x40e2fe=_0x4c1078[_0x9ca9('0x44')](-0x1);if(_0x40e2fe==='/')return _0x4c1078[_0x9ca9('0x45')](0x0,_0x4c1078['lastIndexOf'](_0x40e2fe));return _0x4c1078;}function getWebApiUrl(_0x40a9e7){return util[_0x9ca9('0x46')](_0x9ca9('0x47'),_0x40a9e7);}exports[_0x9ca9('0x48')]=function(_0x601351,_0x54f21d){var _0x44dad8=_0x601351[_0x9ca9('0x20')][_0x9ca9('0x49')];var _0x3f5751=_0x44dad8==='incident'?_0x9ca9('0x4a'):'PhoneCall';var _0x4c3577='';var _0x392999='';var _0x5450e8='';var _0x53ba7d='';var _0x3e7079='';var _0x3e5b33='';var _0x1d1007='';var _0x39105c='';var _0x5c8d43=[_0x9ca9('0x4b'),'description',_0x9ca9('0x4c'),_0x9ca9('0x4d'),'caseorigincode',_0x9ca9('0x4e'),'phonenumber',_0x9ca9('0x4f'),'directioncode',_0x9ca9('0x50')];var _0x223b25=[_0x9ca9('0x51'),_0x9ca9('0x52'),_0x9ca9('0x53'),_0x9ca9('0x54'),'contactidname',_0x9ca9('0x55'),'contractdetailidname',_0x9ca9('0x56'),_0x9ca9('0x57'),'createdbyexternalpartyyominame',_0x9ca9('0x58'),_0x9ca9('0x59'),_0x9ca9('0x5a'),_0x9ca9('0x5b'),'createdonbehalfbyyominame','customeridname',_0x9ca9('0x5c'),_0x9ca9('0x5d'),'emailaddress',_0x9ca9('0x5e'),'entityimage_timestamp',_0x9ca9('0x5f'),_0x9ca9('0x60'),_0x9ca9('0x61'),'firstresponsebykpiidname',_0x9ca9('0x62'),_0x9ca9('0x63'),_0x9ca9('0x64'),'kbarticleidname','lastonholdtime',_0x9ca9('0x65'),_0x9ca9('0x66'),'modifiedbyexternalpartyyominame',_0x9ca9('0x67'),_0x9ca9('0x68'),_0x9ca9('0x69'),_0x9ca9('0x6a'),'modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname',_0x9ca9('0x6b'),_0x9ca9('0x6c'),_0x9ca9('0x6d'),_0x9ca9('0x6e'),_0x9ca9('0x6f'),'owneridyominame',_0x9ca9('0x70'),_0x9ca9('0x71'),'primarycontactidyominame','prioritycodename',_0x9ca9('0x72'),_0x9ca9('0x73'),_0x9ca9('0x74'),_0x9ca9('0x75'),_0x9ca9('0x76'),_0x9ca9('0x77'),_0x9ca9('0x78'),_0x9ca9('0x79'),'slainvokedidname',_0x9ca9('0x7a'),_0x9ca9('0x7b'),_0x9ca9('0x7c'),'statuscode','subjectidname',_0x9ca9('0x7d'),'timezoneruleversionnumber',_0x9ca9('0x7e'),_0x9ca9('0x7f'),_0x9ca9('0x80'),_0x9ca9('0x81')];var _0x4d46e3=_0x5c8d43[_0x9ca9('0x82')](_0x223b25);return db[_0x9ca9('0x19')][_0x9ca9('0x3b')]({'where':{'id':_0x601351['params']['id']},'attributes':['id',_0x9ca9('0x83'),'password',_0x9ca9('0x84'),_0x9ca9('0x85'),_0x9ca9('0x86'),_0x9ca9('0x87'),'modernAuthentication'],'include':[{'model':db[_0x9ca9('0x88')],'as':'CloudProvider','attributes':['id',_0x9ca9('0x89'),_0x9ca9('0x8a')]}]})[_0x9ca9('0x10')](handleEntityNotFound(_0x54f21d,null))[_0x9ca9('0x10')](function(_0x2b9192){if(_0x2b9192){if(_0x2b9192[_0x9ca9('0x8b')]){_0x2b9192['access_token']=_0x2b9192[_0x9ca9('0x88')][_0x9ca9('0x89')];_0x39105c=sanitizeRemoteUri(_0x2b9192[_0x9ca9('0x88')][_0x9ca9('0x8a')]);_0x1d1007=getWebApiUrl(_0x39105c);return _0x2b9192;}_0x39105c=sanitizeRemoteUri(_0x2b9192['remoteUri']);_0x1d1007=getWebApiUrl(_0x39105c);var _0x326bc1={'method':_0x9ca9('0x8c'),'uri':_0x9ca9('0x8d')+_0x2b9192[_0x9ca9('0x85')]+_0x9ca9('0x8e'),'form':{'client_id':_0x2b9192[_0x9ca9('0x86')],'resource':_0x39105c,'username':_0x2b9192[_0x9ca9('0x83')],'password':_0x2b9192[_0x9ca9('0x8f')],'grant_type':_0x9ca9('0x8f'),'client_secret':_0x2b9192['clientSecret']},'json':!![]};return rp(_0x326bc1);}})[_0x9ca9('0x10')](function(_0x13891c){_0x3e5b33=_0x13891c[_0x9ca9('0x90')];var _0x5c7c3e={'method':_0x9ca9('0x91'),'uri':encodeURI(_0x1d1007+_0x9ca9('0x92')+_0x3f5751+'\x27'),'headers':{'Authorization':_0x9ca9('0x93')+_0x3e5b33,'If-None-Match':null,'OData-Version':_0x9ca9('0x94')},'json':!![]};return rp(_0x5c7c3e);})[_0x9ca9('0x10')](function(_0xbe0f6e){var _0x329040=_0xbe0f6e['value'][0x0];var _0x3f0906=_0x329040['MetadataId'];var _0x1d6fa5={'method':_0x9ca9('0x91'),'uri':_0x1d1007+'EntityDefinitions('+_0x3f0906+_0x9ca9('0x95'),'headers':{'Authorization':_0x9ca9('0x93')+_0x3e5b33,'If-None-Match':null,'OData-Version':_0x9ca9('0x94')},'json':!![]};return rp(_0x1d6fa5);})[_0x9ca9('0x10')](function(_0x3b449e){_0x4c3577=_0x3b449e;_0x392999=_0x4c3577[_0x9ca9('0x96')];_0x392999=_['remove'](_0x392999,function(_0x3b31e8){return!_0x4d46e3['includes'](_0x3b31e8[_0x9ca9('0x97')]);});var _0x500343=[];var _0x67ff0a=[];_0x392999[_0x9ca9('0x98')](function(_0x1bd7e6){if(_0x1bd7e6['@odata.type']){var _0x4cf35e=_0x1bd7e6['@odata.type'][_0x9ca9('0x45')](_0x1bd7e6[_0x9ca9('0x99')][_0x9ca9('0x9a')]('.')+0x1);if(_0x4cf35e===_0x9ca9('0x9b')){_0x500343['push'](getSelectList(_0x1d1007,_0x44dad8,_0x67ff0a,_0x4c3577[_0x9ca9('0x9c')],_0x1bd7e6[_0x9ca9('0x9c')],_0x3e5b33));}}});return Promise[_0x9ca9('0x9d')](_0x500343);})['then'](function(_0x1e110c){_0x5450e8=_0x1e110c[0x0];var _0x3a1376=[];var _0x2c8237=[];_0x392999['forEach'](function(_0x4d8842){if(!_[_0x9ca9('0x9e')](_0x4d8842[_0x9ca9('0x99')])){var _0x138f96=_0x4d8842[_0x9ca9('0x99')][_0x9ca9('0x45')](_0x4d8842[_0x9ca9('0x99')][_0x9ca9('0x9a')]('.')+0x1);if(_0x138f96===_0x9ca9('0x9f')){_0x3a1376[_0x9ca9('0xa0')](getBooleanList(_0x1d1007,_0x44dad8,_0x2c8237,_0x4c3577[_0x9ca9('0x9c')],_0x4d8842[_0x9ca9('0x9c')],_0x3e5b33));}}});return Promise[_0x9ca9('0x9d')](_0x3a1376);})[_0x9ca9('0x10')](function(_0x3fd0c9){_0x53ba7d=_0x3fd0c9[0x0];var _0x3e48d9=[];var _0x4bef8d=[];_0x392999[_0x9ca9('0x98')](function(_0x50ac32){if(_0x50ac32[_0x9ca9('0x99')]){var _0xebeea1=_0x50ac32[_0x9ca9('0x99')][_0x9ca9('0x45')](_0x50ac32['@odata.type'][_0x9ca9('0x9a')]('.')+0x1);if(_0xebeea1===_0x9ca9('0xa1')||_0xebeea1==='DoubleAttributeMetadata'||_0xebeea1===_0x9ca9('0xa2')||_0xebeea1==='IntegerAttributeMetadata'||_0xebeea1===_0x9ca9('0xa3')||_0xebeea1==='DateTimeAttributeMetadata'||_0xebeea1===_0x9ca9('0xa4')||_0xebeea1===_0x9ca9('0xa5')||_0xebeea1==='StateAttributeMetadata'||_0xebeea1===_0x9ca9('0xa6')){_0x3e48d9[_0x9ca9('0xa0')](getInputList(_0x1d1007,_0x44dad8,_0xebeea1,_0x4bef8d,_0x4c3577[_0x9ca9('0x9c')],_0x50ac32[_0x9ca9('0x9c')],_0x3e5b33));}}});return Promise['all'](_0x3e48d9);})['then'](function(_0x89ab39){_0x3e7079=_0x89ab39[0x0];var _0x15fcc6=_0x5450e8[_0x9ca9('0x82')](_0x53ba7d)[_0x9ca9('0x82')](_0x3e7079);var _0xb1d17d={'count':_0x15fcc6['length'],'rows':_0x15fcc6};return _0xb1d17d;})[_0x9ca9('0x10')](respondWithResult(_0x54f21d,null))[_0x9ca9('0x31')](function(_0x488517){var _0x2c54e5=_0x601351[_0x9ca9('0x20')]['test']?0x1f4:_0x488517[_0x9ca9('0xa7')]||0x1f4;logger[_0x9ca9('0x14')](_0x488517[_0x9ca9('0x15')]);delete _0x488517['name'];if(_0x2c54e5===0x191){_0x2c54e5=0x190;}_0x54f21d['status'](_0x2c54e5)[_0x9ca9('0x17')](_0x601351[_0x9ca9('0x20')]['test']?{'message':_0x9ca9('0xa8'),'statusCode':_0x488517[_0x9ca9('0xa7')]}:_0x488517);});};function getSelectList(_0x45de8a,_0x2ac160,_0x2b1711,_0xfc4787,_0x38e6c6,_0x37b83d){var _0x37c5b7={'method':_0x9ca9('0x91'),'uri':_0x45de8a+_0x9ca9('0xa9')+_0xfc4787+_0x9ca9('0xaa')+_0x38e6c6+_0x9ca9('0xab')+_0x9ca9('0xac'),'headers':{'Authorization':_0x9ca9('0x93')+_0x37b83d,'If-None-Match':null,'OData-Version':_0x9ca9('0x94')},'json':!![]};return rp(_0x37c5b7)[_0x9ca9('0x10')](function(_0x519138){var _0xd8dcdd=[];var _0xd238d7=_0x519138[_0x9ca9('0xad')][_0x9ca9('0xae')];_0xd238d7[_0x9ca9('0x98')](function(_0x4299ee){_0xd8dcdd[_0x9ca9('0xa0')]({'name':_0x4299ee[_0x9ca9('0xaf')]['UserLocalizedLabel']['Label'],'value':String(_0x4299ee[_0x9ca9('0xb0')])});});var _0x346e58={'id':_0x2ac160+'_'+_0x519138[_0x9ca9('0x97')],'name':_0x519138[_0x9ca9('0xb1')]['UserLocalizedLabel'][_0x9ca9('0xaf')],'custom':![],'options':_0xd8dcdd};_0x2b1711[_0x9ca9('0xa0')](_0x346e58);return _0x2b1711;});}function getBooleanList(_0x4be7b2,_0x4445dd,_0x1adaa9,_0x12018f,_0x44a440,_0x28fed8){var _0x308aad={'method':'GET','uri':_0x4be7b2+_0x9ca9('0xa9')+_0x12018f+_0x9ca9('0xaa')+_0x44a440+_0x9ca9('0xb2'),'headers':{'Authorization':'Bearer\x20'+_0x28fed8,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x308aad)[_0x9ca9('0x10')](function(_0xc6ee92){var _0x48cfa6=[];_0x48cfa6['push']({'name':_0xc6ee92[_0x9ca9('0xad')]['TrueOption'][_0x9ca9('0xaf')][_0x9ca9('0xb3')][_0x9ca9('0xaf')],'value':_0x9ca9('0xb4')},{'name':_0xc6ee92['OptionSet'][_0x9ca9('0xb5')][_0x9ca9('0xaf')][_0x9ca9('0xb3')][_0x9ca9('0xaf')],'value':_0x9ca9('0xb6')});var _0xe6a8cc={'id':_0x4445dd+'_'+_0xc6ee92[_0x9ca9('0x97')],'name':_0xc6ee92[_0x9ca9('0xb1')][_0x9ca9('0xb3')][_0x9ca9('0xaf')],'custom':![],'options':_0x48cfa6};_0x1adaa9['push'](_0xe6a8cc);return _0x1adaa9;});}function getInputList(_0x192f58,_0x1d9cfa,_0x1f05a7,_0x43f90e,_0x2fb5c3,_0x239252,_0x49b183){var _0x8fd15e={'method':'GET','uri':_0x192f58+_0x9ca9('0xa9')+_0x2fb5c3+_0x9ca9('0xaa')+_0x239252+_0x9ca9('0xb7')+_0x1f05a7+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x9ca9('0x93')+_0x49b183,'If-None-Match':null,'OData-Version':_0x9ca9('0x94')},'json':!![]};return rp(_0x8fd15e)[_0x9ca9('0x10')](function(_0x3aba43){var _0x2f76d5={'id':_0x1d9cfa+'_'+_0x3aba43[_0x9ca9('0x97')],'name':_0x3aba43[_0x9ca9('0xb1')]['UserLocalizedLabel']?_0x3aba43[_0x9ca9('0xb1')][_0x9ca9('0xb3')][_0x9ca9('0xaf')]:_0x3aba43['LogicalName'],'custom':![],'options':[]};_0x43f90e[_0x9ca9('0xa0')](_0x2f76d5);return _0x43f90e;});} \ No newline at end of file +var _0x7b10=['clientId','clientSecret','modernAuthentication','CloudProvider','data5','access_token','data7','https://login.microsoftonline.com/','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','substring','push','isNil','BooleanAttributeMetadata','all','DoubleAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','UserLocalizedLabel','Label','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','false','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','count','limit','set','Content-Range','update','destroy','end','sendStatus','error','stack','name','status','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','then','includeAll','include','Dynamics365Account','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','Dynamics365Configuration','length','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','channel','Dynamics365Field','slice','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','directioncode','accountidyominame','actualserviceunits','contactidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','username','password','tenantId'];(function(_0x4393af,_0x1c524a){var _0x55f141=function(_0x13d3d3){while(--_0x13d3d3){_0x4393af['push'](_0x4393af['shift']());}};_0x55f141(++_0x1c524a);}(_0x7b10,0x1ac));var _0x07b1=function(_0x5650af,_0x53009d){_0x5650af=_0x5650af-0x0;var _0x412bd7=_0x7b10[_0x5650af];return _0x412bd7;};'use strict';var rp=require(_0x07b1('0x0'));var util=require(_0x07b1('0x1'));var _=require(_0x07b1('0x2'));var qs=require(_0x07b1('0x3'));var logger=require(_0x07b1('0x4'))('api');var db=require(_0x07b1('0x5'))['db'];var integrations=require(_0x07b1('0x6'));function respondWithResult(_0x7c39e7,_0x443b4f){_0x443b4f=_0x443b4f||0xc8;return function(_0x651044){if(_0x651044){return _0x7c39e7['status'](_0x443b4f)[_0x07b1('0x7')](_0x651044);}};}function respondWithFilteredResult(_0x106f8d,_0xece33d){return function(_0x38d152){if(_0x38d152){var _0x1bfc1d=typeof _0xece33d[_0x07b1('0x8')]===_0x07b1('0x9')&&typeof _0xece33d['limit']==='undefined';var _0x5ac2a6=_0x38d152['count'];var _0x13447f=_0x1bfc1d?0x0:_0xece33d[_0x07b1('0x8')];var _0x36c968=_0x1bfc1d?_0x38d152[_0x07b1('0xa')]:_0xece33d[_0x07b1('0x8')]+_0xece33d[_0x07b1('0xb')];var _0x3c5b0d;if(_0x36c968>=_0x5ac2a6){_0x36c968=_0x5ac2a6;_0x3c5b0d=0xc8;}else{_0x3c5b0d=0xce;}_0x106f8d['status'](_0x3c5b0d);return _0x106f8d[_0x07b1('0xc')](_0x07b1('0xd'),_0x13447f+'-'+_0x36c968+'/'+_0x5ac2a6)[_0x07b1('0x7')](_0x38d152);}return null;};}function saveUpdates(_0x47e2e7){return function(_0x2dccb2){if(_0x2dccb2){return _0x2dccb2[_0x07b1('0xe')](_0x47e2e7)['then'](function(_0x1230b6){return _0x1230b6;});}return null;};}function removeEntity(_0x35febf){return function(_0x506383){if(_0x506383){return _0x506383[_0x07b1('0xf')]()['then'](function(){_0x35febf['status'](0xcc)[_0x07b1('0x10')]();});}};}function handleEntityNotFound(_0x11a638){return function(_0x31628c){if(!_0x31628c){_0x11a638[_0x07b1('0x11')](0x194);}return _0x31628c;};}function handleError(_0x5a4858,_0x54f67d){_0x54f67d=_0x54f67d||0x1f4;return function(_0x2d0189){logger[_0x07b1('0x12')](_0x2d0189[_0x07b1('0x13')]);if(_0x2d0189['name']){delete _0x2d0189[_0x07b1('0x14')];}_0x5a4858[_0x07b1('0x15')](_0x54f67d)[_0x07b1('0x16')](_0x2d0189);};}exports['index']=function(_0x3ece8a,_0x4dd2c5){var _0x53601d={},_0x5d94e7={},_0xe3afab={'count':0x0,'rows':[]};var _0x19b591=_[_0x07b1('0x17')](db['Dynamics365Account'][_0x07b1('0x18')],function(_0x3a1792){return{'name':_0x3a1792[_0x07b1('0x19')],'type':_0x3a1792[_0x07b1('0x1a')][_0x07b1('0x1b')]};});_0x5d94e7[_0x07b1('0x1c')]=_['map'](_0x19b591,_0x07b1('0x14'));_0x5d94e7['query']=_[_0x07b1('0x1d')](_0x3ece8a['query']);_0x5d94e7[_0x07b1('0x1e')]=_[_0x07b1('0x1f')](_0x5d94e7[_0x07b1('0x1c')],_0x5d94e7['query']);_0x53601d[_0x07b1('0x20')]=_[_0x07b1('0x1f')](_0x5d94e7[_0x07b1('0x1c')],qs[_0x07b1('0x21')](_0x3ece8a[_0x07b1('0x22')][_0x07b1('0x21')]));_0x53601d[_0x07b1('0x20')]=_0x53601d[_0x07b1('0x20')]['length']?_0x53601d[_0x07b1('0x20')]:_0x5d94e7[_0x07b1('0x1c')];if(!_0x3ece8a[_0x07b1('0x22')]['hasOwnProperty'](_0x07b1('0x23'))){_0x53601d['limit']=qs[_0x07b1('0xb')](_0x3ece8a[_0x07b1('0x22')]['limit']);_0x53601d['offset']=qs['offset'](_0x3ece8a[_0x07b1('0x22')]['offset']);}_0x53601d[_0x07b1('0x24')]=qs[_0x07b1('0x25')](_0x3ece8a[_0x07b1('0x22')][_0x07b1('0x25')]);_0x53601d['where']=qs[_0x07b1('0x1e')](_[_0x07b1('0x26')](_0x3ece8a[_0x07b1('0x22')],_0x5d94e7['filters']),_0x19b591);if(_0x3ece8a['query']['filter']){_0x53601d[_0x07b1('0x27')]=_['merge'](_0x53601d['where'],{'$or':_[_0x07b1('0x17')](_0x19b591,function(_0x3b2264){if(_0x3b2264[_0x07b1('0x1a')]!==_0x07b1('0x28')){var _0xa5dea1={};_0xa5dea1[_0x3b2264[_0x07b1('0x14')]]={'$like':'%'+_0x3ece8a['query'][_0x07b1('0x29')]+'%'};return _0xa5dea1;}})});}_0x53601d=_[_0x07b1('0x2a')]({},_0x53601d,_0x3ece8a[_0x07b1('0x2b')]);var _0x200536={'where':_0x53601d['where']};return db['Dynamics365Account'][_0x07b1('0xa')](_0x200536)[_0x07b1('0x2c')](function(_0x108251){_0xe3afab[_0x07b1('0xa')]=_0x108251;if(_0x3ece8a[_0x07b1('0x22')][_0x07b1('0x2d')]){_0x53601d[_0x07b1('0x2e')]=[{'all':!![]}];}return db[_0x07b1('0x2f')][_0x07b1('0x30')](_0x53601d);})['then'](function(_0x19efee){_0xe3afab[_0x07b1('0x31')]=_0x19efee;return _0xe3afab;})['then'](respondWithFilteredResult(_0x4dd2c5,_0x53601d))[_0x07b1('0x32')](handleError(_0x4dd2c5,null));};exports[_0x07b1('0x33')]=function(_0x3d53e1,_0x256cf1){var _0x20d54b={'raw':![],'where':{'id':_0x3d53e1[_0x07b1('0x34')]['id']}},_0x467fe0={};_0x467fe0['model']=_[_0x07b1('0x1d')](db[_0x07b1('0x2f')][_0x07b1('0x18')]);_0x467fe0['query']=_[_0x07b1('0x1d')](_0x3d53e1[_0x07b1('0x22')]);_0x467fe0[_0x07b1('0x1e')]=_[_0x07b1('0x1f')](_0x467fe0[_0x07b1('0x1c')],_0x467fe0[_0x07b1('0x22')]);_0x20d54b[_0x07b1('0x20')]=_[_0x07b1('0x1f')](_0x467fe0[_0x07b1('0x1c')],qs[_0x07b1('0x21')](_0x3d53e1[_0x07b1('0x22')][_0x07b1('0x21')]));_0x20d54b[_0x07b1('0x20')]=_0x20d54b[_0x07b1('0x20')]['length']?_0x20d54b[_0x07b1('0x20')]:_0x467fe0[_0x07b1('0x1c')];if(_0x3d53e1[_0x07b1('0x22')][_0x07b1('0x2d')]){_0x20d54b['include']=[{'all':!![]}];}_0x20d54b=_[_0x07b1('0x2a')]({},_0x20d54b,_0x3d53e1[_0x07b1('0x2b')]);return db['Dynamics365Account'][_0x07b1('0x35')](_0x20d54b)[_0x07b1('0x2c')](handleEntityNotFound(_0x256cf1,null))[_0x07b1('0x2c')](respondWithResult(_0x256cf1,null))[_0x07b1('0x32')](handleError(_0x256cf1,null));};exports['create']=function(_0x31b605,_0x22ebe0){return db[_0x07b1('0x2f')][_0x07b1('0x36')](_0x31b605[_0x07b1('0x37')],{})[_0x07b1('0x2c')](respondWithResult(_0x22ebe0,0xc9))[_0x07b1('0x32')](handleError(_0x22ebe0,null));};exports['update']=function(_0x1a18b5,_0x2601b6){if(_0x1a18b5[_0x07b1('0x37')]['id']){delete _0x1a18b5['body']['id'];}return db[_0x07b1('0x2f')][_0x07b1('0x35')]({'where':{'id':_0x1a18b5['params']['id']}})['then'](handleEntityNotFound(_0x2601b6,null))[_0x07b1('0x2c')](saveUpdates(_0x1a18b5[_0x07b1('0x37')],null))[_0x07b1('0x2c')](respondWithResult(_0x2601b6,null))[_0x07b1('0x32')](handleError(_0x2601b6,null));};exports[_0x07b1('0xf')]=function(_0x2148e3,_0x31e31f){return db[_0x07b1('0x2f')][_0x07b1('0x35')]({'where':{'id':_0x2148e3[_0x07b1('0x34')]['id']}})[_0x07b1('0x2c')](handleEntityNotFound(_0x31e31f,null))[_0x07b1('0x2c')](removeEntity(_0x31e31f,null))['catch'](handleError(_0x31e31f,null));};exports[_0x07b1('0x38')]=function(_0x51d2be,_0x4fea77){var _0x5a81a7={};var _0x22d23c={};var _0x3294a4;var _0xa9d249;return db[_0x07b1('0x2f')][_0x07b1('0x39')]({'where':{'id':_0x51d2be[_0x07b1('0x34')]['id']}})[_0x07b1('0x2c')](handleEntityNotFound(_0x4fea77,null))[_0x07b1('0x2c')](function(_0x1f1d00){if(_0x1f1d00){_0x3294a4=_0x1f1d00;_0x22d23c[_0x07b1('0x1c')]=_[_0x07b1('0x1d')](db[_0x07b1('0x3a')][_0x07b1('0x18')]);_0x22d23c[_0x07b1('0x22')]=_[_0x07b1('0x1d')](_0x51d2be[_0x07b1('0x22')]);_0x22d23c[_0x07b1('0x1e')]=_[_0x07b1('0x1f')](_0x22d23c[_0x07b1('0x1c')],_0x22d23c[_0x07b1('0x22')]);_0x5a81a7['attributes']=_[_0x07b1('0x1f')](_0x22d23c['model'],qs[_0x07b1('0x21')](_0x51d2be[_0x07b1('0x22')]['fields']));_0x5a81a7['attributes']=_0x5a81a7[_0x07b1('0x20')][_0x07b1('0x3b')]?_0x5a81a7[_0x07b1('0x20')]:_0x22d23c[_0x07b1('0x1c')];_0x5a81a7['order']=qs[_0x07b1('0x25')](_0x51d2be[_0x07b1('0x22')][_0x07b1('0x25')]);_0x5a81a7[_0x07b1('0x27')]=qs[_0x07b1('0x1e')](_[_0x07b1('0x26')](_0x51d2be[_0x07b1('0x22')],_0x22d23c[_0x07b1('0x1e')]));if(_0x51d2be[_0x07b1('0x22')][_0x07b1('0x29')]){_0x5a81a7[_0x07b1('0x27')]=_[_0x07b1('0x2a')](_0x5a81a7[_0x07b1('0x27')],{'$or':_['map'](_0x5a81a7[_0x07b1('0x20')],function(_0x4cf598){var _0x5dd51c={};_0x5dd51c[_0x4cf598]={'$like':'%'+_0x51d2be[_0x07b1('0x22')]['filter']+'%'};return _0x5dd51c;})});}_0x5a81a7=_[_0x07b1('0x2a')]({},_0x5a81a7,_0x51d2be[_0x07b1('0x2b')]);return _0x3294a4[_0x07b1('0x38')](_0x5a81a7);}})['then'](function(_0x25ef9c){if(_0x25ef9c){_0xa9d249=_0x25ef9c[_0x07b1('0x3b')];if(!_0x51d2be[_0x07b1('0x22')][_0x07b1('0x3c')](_0x07b1('0x23'))){_0x5a81a7[_0x07b1('0xb')]=qs[_0x07b1('0xb')](_0x51d2be[_0x07b1('0x22')][_0x07b1('0xb')]);_0x5a81a7['offset']=qs[_0x07b1('0x8')](_0x51d2be[_0x07b1('0x22')][_0x07b1('0x8')]);}return _0x3294a4[_0x07b1('0x38')](_0x5a81a7);}})[_0x07b1('0x2c')](function(_0x3ee716){if(_0x3ee716){return _0x3ee716?{'count':_0xa9d249,'rows':_0x3ee716}:null;}})[_0x07b1('0x2c')](respondWithResult(_0x4fea77,null))[_0x07b1('0x32')](handleError(_0x4fea77,null));};exports['addConfiguration']=function(_0x3500ed,_0x66cb1b){if(_0x3500ed[_0x07b1('0x37')]['id']){delete _0x3500ed[_0x07b1('0x37')]['id'];}return db['Dynamics365Account'][_0x07b1('0x39')]({'where':{'id':_0x3500ed[_0x07b1('0x34')]['id']}})[_0x07b1('0x2c')](handleEntityNotFound(_0x66cb1b,null))['then'](function(_0x3cb2a5){if(_0x3cb2a5){_0x3500ed[_0x07b1('0x37')][_0x07b1('0x3d')]=_0x3cb2a5['id'];_0x3500ed['body'][_0x07b1('0x3e')]=integrations[_0x07b1('0x3f')](_0x3500ed[_0x07b1('0x37')]['channel'],_0x3500ed['body']['type']);_0x3500ed[_0x07b1('0x37')][_0x07b1('0x40')]=integrations['getDescriptions'](_0x3500ed[_0x07b1('0x37')][_0x07b1('0x41')],_0x3500ed['body'][_0x07b1('0x1a')]);return db[_0x07b1('0x3a')]['create'](_0x3500ed[_0x07b1('0x37')],{'include':[{'model':db[_0x07b1('0x42')],'as':_0x07b1('0x3e')},{'model':db[_0x07b1('0x42')],'as':_0x07b1('0x40')}]});}return null;})[_0x07b1('0x2c')](respondWithResult(_0x66cb1b,null))[_0x07b1('0x32')](handleError(_0x66cb1b,null));};function sanitizeRemoteUri(_0x37f9ab){var _0x34a69c=_0x37f9ab[_0x07b1('0x43')](-0x1);if(_0x34a69c==='/')return _0x37f9ab['substring'](0x0,_0x37f9ab[_0x07b1('0x44')](_0x34a69c));return _0x37f9ab;}function getWebApiUrl(_0x5e2158){return util[_0x07b1('0x45')](_0x07b1('0x46'),_0x5e2158);}exports[_0x07b1('0x47')]=function(_0x31e143,_0x28904e){var _0x561792=_0x31e143[_0x07b1('0x22')][_0x07b1('0x48')];var _0x48e2ee=_0x561792==='incident'?'Incident':_0x07b1('0x49');var _0x285048='';var _0x45694e='';var _0x231237='';var _0x128fdc='';var _0x586389='';var _0x287ad1='';var _0x55856b='';var _0x50c482='';var _0x40cefd=[_0x07b1('0x4a'),_0x07b1('0x4b'),_0x07b1('0x4c'),_0x07b1('0x4d'),_0x07b1('0x4e'),_0x07b1('0x4f'),_0x07b1('0x50'),'regardingobjectid',_0x07b1('0x51'),'phonecall_activity_parties'];var _0x2c3b4c=['accountidname',_0x07b1('0x52'),_0x07b1('0x53'),'billedserviceunits',_0x07b1('0x54'),'contactidyominame','contractdetailidname',_0x07b1('0x55'),_0x07b1('0x56'),_0x07b1('0x57'),_0x07b1('0x58'),_0x07b1('0x59'),_0x07b1('0x5a'),_0x07b1('0x5b'),_0x07b1('0x5c'),_0x07b1('0x5d'),_0x07b1('0x5e'),_0x07b1('0x5f'),_0x07b1('0x60'),_0x07b1('0x61'),_0x07b1('0x62'),_0x07b1('0x63'),_0x07b1('0x64'),'exchangerate',_0x07b1('0x65'),_0x07b1('0x66'),_0x07b1('0x67'),_0x07b1('0x68'),_0x07b1('0x69'),_0x07b1('0x6a'),_0x07b1('0x6b'),_0x07b1('0x6c'),_0x07b1('0x6d'),_0x07b1('0x6e'),'modifiedbyyominame',_0x07b1('0x6f'),_0x07b1('0x70'),_0x07b1('0x71'),_0x07b1('0x72'),_0x07b1('0x73'),_0x07b1('0x74'),_0x07b1('0x75'),'overriddencreatedon','owneridname','owneridtype',_0x07b1('0x76'),_0x07b1('0x77'),_0x07b1('0x78'),_0x07b1('0x79'),_0x07b1('0x7a'),_0x07b1('0x7b'),_0x07b1('0x7c'),_0x07b1('0x7d'),_0x07b1('0x7e'),_0x07b1('0x7f'),'responsiblecontactidname',_0x07b1('0x80'),_0x07b1('0x81'),_0x07b1('0x82'),_0x07b1('0x83'),'socialprofileidname',_0x07b1('0x84'),_0x07b1('0x85'),_0x07b1('0x86'),_0x07b1('0x87'),_0x07b1('0x88'),'transactioncurrencyidname','traversedpath',_0x07b1('0x89'),_0x07b1('0x8a')];var _0x4e8f0d=_0x40cefd['concat'](_0x2c3b4c);return db['Dynamics365Account'][_0x07b1('0x39')]({'where':{'id':_0x31e143[_0x07b1('0x34')]['id']},'attributes':['id',_0x07b1('0x8b'),_0x07b1('0x8c'),'remoteUri',_0x07b1('0x8d'),_0x07b1('0x8e'),_0x07b1('0x8f'),_0x07b1('0x90')],'include':[{'model':db[_0x07b1('0x91')],'as':_0x07b1('0x91'),'attributes':['id',_0x07b1('0x92'),'data7']}]})[_0x07b1('0x2c')](handleEntityNotFound(_0x28904e,null))['then'](function(_0x4a3cce){if(_0x4a3cce){if(_0x4a3cce[_0x07b1('0x90')]){_0x4a3cce[_0x07b1('0x93')]=_0x4a3cce[_0x07b1('0x91')][_0x07b1('0x92')];_0x50c482=sanitizeRemoteUri(_0x4a3cce['CloudProvider'][_0x07b1('0x94')]);_0x55856b=getWebApiUrl(_0x50c482);return _0x4a3cce;}_0x50c482=sanitizeRemoteUri(_0x4a3cce['remoteUri']);_0x55856b=getWebApiUrl(_0x50c482);var _0x9ff7df={'method':'POST','uri':_0x07b1('0x95')+_0x4a3cce['tenantId']+_0x07b1('0x96'),'form':{'client_id':_0x4a3cce[_0x07b1('0x8e')],'resource':_0x50c482,'username':_0x4a3cce[_0x07b1('0x8b')],'password':_0x4a3cce[_0x07b1('0x8c')],'grant_type':_0x07b1('0x8c'),'client_secret':_0x4a3cce[_0x07b1('0x8f')]},'json':!![]};return rp(_0x9ff7df);}})[_0x07b1('0x2c')](function(_0x589d13){_0x287ad1=_0x589d13[_0x07b1('0x93')];var _0x5491da={'method':_0x07b1('0x97'),'uri':encodeURI(_0x55856b+_0x07b1('0x98')+_0x48e2ee+'\x27'),'headers':{'Authorization':_0x07b1('0x99')+_0x287ad1,'If-None-Match':null,'OData-Version':_0x07b1('0x9a')},'json':!![]};return rp(_0x5491da);})[_0x07b1('0x2c')](function(_0x15c713){var _0x56861f=_0x15c713[_0x07b1('0x9b')][0x0];var _0x10df90=_0x56861f[_0x07b1('0x9c')];var _0x2f4516={'method':_0x07b1('0x97'),'uri':_0x55856b+_0x07b1('0x9d')+_0x10df90+_0x07b1('0x9e'),'headers':{'Authorization':_0x07b1('0x99')+_0x287ad1,'If-None-Match':null,'OData-Version':_0x07b1('0x9a')},'json':!![]};return rp(_0x2f4516);})['then'](function(_0x4c3792){_0x285048=_0x4c3792;_0x45694e=_0x285048[_0x07b1('0x9f')];_0x45694e=_['remove'](_0x45694e,function(_0x4f0be1){return!_0x4e8f0d[_0x07b1('0xa0')](_0x4f0be1[_0x07b1('0xa1')]);});var _0x1ca6ff=[];var _0x135070=[];_0x45694e[_0x07b1('0xa2')](function(_0x1e7702){if(_0x1e7702[_0x07b1('0xa3')]){var _0x4887b9=_0x1e7702[_0x07b1('0xa3')][_0x07b1('0xa4')](_0x1e7702[_0x07b1('0xa3')][_0x07b1('0x44')]('.')+0x1);if(_0x4887b9==='PicklistAttributeMetadata'){_0x1ca6ff[_0x07b1('0xa5')](getSelectList(_0x55856b,_0x561792,_0x135070,_0x285048[_0x07b1('0x9c')],_0x1e7702[_0x07b1('0x9c')],_0x287ad1));}}});return Promise['all'](_0x1ca6ff);})[_0x07b1('0x2c')](function(_0xf525c3){_0x231237=_0xf525c3[0x0];var _0x35d292=[];var _0x399c75=[];_0x45694e[_0x07b1('0xa2')](function(_0x230944){if(!_[_0x07b1('0xa6')](_0x230944[_0x07b1('0xa3')])){var _0x42c120=_0x230944[_0x07b1('0xa3')]['substring'](_0x230944['@odata.type'][_0x07b1('0x44')]('.')+0x1);if(_0x42c120===_0x07b1('0xa7')){_0x35d292['push'](getBooleanList(_0x55856b,_0x561792,_0x399c75,_0x285048[_0x07b1('0x9c')],_0x230944['MetadataId'],_0x287ad1));}}});return Promise[_0x07b1('0xa8')](_0x35d292);})[_0x07b1('0x2c')](function(_0x4547e2){_0x128fdc=_0x4547e2[0x0];var _0x938c02=[];var _0x55ae9a=[];_0x45694e[_0x07b1('0xa2')](function(_0x5553ee){if(_0x5553ee['@odata.type']){var _0x2ca1c3=_0x5553ee[_0x07b1('0xa3')][_0x07b1('0xa4')](_0x5553ee[_0x07b1('0xa3')][_0x07b1('0x44')]('.')+0x1);if(_0x2ca1c3==='StringAttributeMetadata'||_0x2ca1c3===_0x07b1('0xa9')||_0x2ca1c3==='BigIntAttributeMetadata'||_0x2ca1c3===_0x07b1('0xaa')||_0x2ca1c3==='MemoAttributeMetadata'||_0x2ca1c3===_0x07b1('0xab')||_0x2ca1c3===_0x07b1('0xac')||_0x2ca1c3===_0x07b1('0xad')||_0x2ca1c3===_0x07b1('0xae')||_0x2ca1c3===_0x07b1('0xaf')){_0x938c02['push'](getInputList(_0x55856b,_0x561792,_0x2ca1c3,_0x55ae9a,_0x285048['MetadataId'],_0x5553ee['MetadataId'],_0x287ad1));}}});return Promise[_0x07b1('0xa8')](_0x938c02);})['then'](function(_0x2b5460){_0x586389=_0x2b5460[0x0];var _0x404503=_0x231237[_0x07b1('0xb0')](_0x128fdc)[_0x07b1('0xb0')](_0x586389);var _0x4abc27={'count':_0x404503[_0x07b1('0x3b')],'rows':_0x404503};return _0x4abc27;})['then'](respondWithResult(_0x28904e,null))[_0x07b1('0x32')](function(_0x376fe7){var _0x3c6a97=_0x31e143[_0x07b1('0x22')][_0x07b1('0xb1')]?0x1f4:_0x376fe7[_0x07b1('0xb2')]||0x1f4;logger['error'](_0x376fe7[_0x07b1('0x13')]);delete _0x376fe7[_0x07b1('0x14')];if(_0x3c6a97===0x191){_0x3c6a97=0x190;}_0x28904e[_0x07b1('0x15')](_0x3c6a97)[_0x07b1('0x16')](_0x31e143[_0x07b1('0x22')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x376fe7[_0x07b1('0xb2')]}:_0x376fe7);});};function getSelectList(_0x5e30a3,_0x46079f,_0xfa9f54,_0x2d2010,_0x2d48de,_0x249f91){var _0x5d5dc9={'method':_0x07b1('0x97'),'uri':_0x5e30a3+_0x07b1('0x9d')+_0x2d2010+')/Attributes('+_0x2d48de+_0x07b1('0xb3')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x249f91,'If-None-Match':null,'OData-Version':_0x07b1('0x9a')},'json':!![]};return rp(_0x5d5dc9)[_0x07b1('0x2c')](function(_0x52ca6d){var _0x5482a4=[];var _0x256374=_0x52ca6d[_0x07b1('0xb4')]['Options'];_0x256374[_0x07b1('0xa2')](function(_0x298337){_0x5482a4['push']({'name':_0x298337['Label'][_0x07b1('0xb5')][_0x07b1('0xb6')],'value':String(_0x298337[_0x07b1('0xb7')])});});var _0xe4b5c6={'id':_0x46079f+'_'+_0x52ca6d[_0x07b1('0xa1')],'name':_0x52ca6d[_0x07b1('0xb8')]['UserLocalizedLabel'][_0x07b1('0xb6')],'custom':![],'options':_0x5482a4};_0xfa9f54[_0x07b1('0xa5')](_0xe4b5c6);return _0xfa9f54;});}function getBooleanList(_0x112fc4,_0xdd514f,_0x297855,_0x44d1c2,_0x5be69a,_0x44730e){var _0x445e16={'method':_0x07b1('0x97'),'uri':_0x112fc4+_0x07b1('0x9d')+_0x44d1c2+_0x07b1('0xb9')+_0x5be69a+_0x07b1('0xba'),'headers':{'Authorization':_0x07b1('0x99')+_0x44730e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x445e16)[_0x07b1('0x2c')](function(_0xc0d268){var _0x53f1af=[];_0x53f1af[_0x07b1('0xa5')]({'name':_0xc0d268[_0x07b1('0xb4')]['TrueOption']['Label']['UserLocalizedLabel'][_0x07b1('0xb6')],'value':_0x07b1('0xbb')},{'name':_0xc0d268[_0x07b1('0xb4')]['FalseOption'][_0x07b1('0xb6')][_0x07b1('0xb5')][_0x07b1('0xb6')],'value':_0x07b1('0xbc')});var _0x242ba3={'id':_0xdd514f+'_'+_0xc0d268['LogicalName'],'name':_0xc0d268[_0x07b1('0xb8')][_0x07b1('0xb5')][_0x07b1('0xb6')],'custom':![],'options':_0x53f1af};_0x297855[_0x07b1('0xa5')](_0x242ba3);return _0x297855;});}function getInputList(_0x145852,_0x44e2e7,_0x4d09f0,_0x16d6f9,_0x5927cf,_0x286d10,_0x5d1b2e){var _0x2f4d9b={'method':_0x07b1('0x97'),'uri':_0x145852+_0x07b1('0x9d')+_0x5927cf+')/Attributes('+_0x286d10+')/Microsoft.Dynamics.CRM.'+_0x4d09f0+_0x07b1('0xbd'),'headers':{'Authorization':'Bearer\x20'+_0x5d1b2e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2f4d9b)[_0x07b1('0x2c')](function(_0x213674){var _0x104479={'id':_0x44e2e7+'_'+_0x213674[_0x07b1('0xa1')],'name':_0x213674[_0x07b1('0xb8')][_0x07b1('0xb5')]?_0x213674[_0x07b1('0xb8')][_0x07b1('0xb5')][_0x07b1('0xb6')]:_0x213674[_0x07b1('0xa1')],'custom':![],'options':[]};_0x16d6f9['push'](_0x104479);return _0x16d6f9;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 80b1d07..e93ac67 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0xb5fd61,_0x407428){var _0x564d90=function(_0x3b3671){while(--_0x3b3671){_0xb5fd61['push'](_0xb5fd61['shift']());}};_0x564d90(++_0x407428);}(_0xe706,0xa3));var _0x6e70=function(_0x562f0a,_0x1593f5){_0x562f0a=_0x562f0a-0x0;var _0x1b2cba=_0xe706[_0x562f0a];return _0x1b2cba;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x29d0e0,_0x1bd476){var _0x169f96=function(_0x36a1a2){while(--_0x36a1a2){_0x29d0e0['push'](_0x29d0e0['shift']());}};_0x169f96(++_0x1bd476);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),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 19c8067..8d76653 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 _0x4d50=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetDynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','stringify','Dynamics365Account','ShowDynamics365Account','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x133c58,_0x5d85f2){var _0x5937d5=function(_0x5d27fc){while(--_0x5d27fc){_0x133c58['push'](_0x133c58['shift']());}};_0x5937d5(++_0x5d85f2);}(_0x4d50,0x12d));var _0x04d5=function(_0x4d5cd5,_0x5b6aa4){_0x4d5cd5=_0x4d5cd5-0x0;var _0x14e500=_0x4d50[_0x4d5cd5];return _0x14e500;};'use strict';var _=require('lodash');var util=require(_0x04d5('0x0'));var moment=require(_0x04d5('0x1'));var BPromise=require(_0x04d5('0x2'));var rs=require(_0x04d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x04d5('0x4'))['db'];var utils=require(_0x04d5('0x5'));var logger=require('../../config/logger')(_0x04d5('0x6'));var config=require(_0x04d5('0x7'));var jayson=require(_0x04d5('0x8'));var client=jayson['client'][_0x04d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a546a,_0x1f3e1c,_0x38f275){return new BPromise(function(_0x45283c,_0x240b92){return client[_0x04d5('0xa')](_0x5a546a,_0x38f275)[_0x04d5('0xb')](function(_0x165085){logger[_0x04d5('0xc')](_0x04d5('0xd'),_0x1f3e1c,_0x04d5('0xe'));logger[_0x04d5('0xf')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x1f3e1c,_0x04d5('0xe'),JSON['stringify'](_0x165085));if(_0x165085[_0x04d5('0x10')]){if(_0x165085[_0x04d5('0x10')][_0x04d5('0x11')]===0x1f4){logger[_0x04d5('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x1f3e1c,_0x165085[_0x04d5('0x10')]['message']);return _0x240b92(_0x165085[_0x04d5('0x10')][_0x04d5('0x12')]);}logger['error'](_0x04d5('0xd'),_0x1f3e1c,_0x165085[_0x04d5('0x10')][_0x04d5('0x12')]);return _0x45283c(_0x165085['error'][_0x04d5('0x12')]);}else{logger[_0x04d5('0xc')](_0x04d5('0xd'),_0x1f3e1c,_0x04d5('0xe'));_0x45283c(_0x165085[_0x04d5('0x13')]['message']);}})[_0x04d5('0x14')](function(_0x37676a){logger[_0x04d5('0x10')](_0x04d5('0xd'),_0x1f3e1c,_0x37676a);_0x240b92(_0x37676a);});});}exports[_0x04d5('0x15')]=function(_0x5a3fff){var _0x546c5c=this;return new Promise(function(_0x57a42a,_0x411920){return db['Dynamics365Account'][_0x04d5('0x16')]({'raw':_0x5a3fff[_0x04d5('0x17')]?_0x5a3fff[_0x04d5('0x17')][_0x04d5('0x18')]===undefined?!![]:![]:!![],'where':_0x5a3fff[_0x04d5('0x17')]?_0x5a3fff[_0x04d5('0x17')][_0x04d5('0x19')]||null:null,'attributes':_0x5a3fff[_0x04d5('0x17')]?_0x5a3fff[_0x04d5('0x17')][_0x04d5('0x1a')]||null:null,'limit':_0x5a3fff[_0x04d5('0x17')]?_0x5a3fff[_0x04d5('0x17')][_0x04d5('0x1b')]||null:null,'include':_0x5a3fff[_0x04d5('0x17')]?_0x5a3fff[_0x04d5('0x17')][_0x04d5('0x1c')]?_[_0x04d5('0x1d')](_0x5a3fff[_0x04d5('0x17')][_0x04d5('0x1c')],function(_0x564a95){return{'model':db[_0x564a95[_0x04d5('0x1e')]],'as':_0x564a95['as'],'attributes':_0x564a95[_0x04d5('0x1a')],'include':_0x564a95[_0x04d5('0x1c')]?_[_0x04d5('0x1d')](_0x564a95[_0x04d5('0x1c')],function(_0x22b3e4){return{'model':db[_0x22b3e4[_0x04d5('0x1e')]],'as':_0x22b3e4['as'],'attributes':_0x22b3e4[_0x04d5('0x1a')],'include':_0x22b3e4[_0x04d5('0x1c')]?_['map'](_0x22b3e4[_0x04d5('0x1c')],function(_0x224a1e){return{'model':db[_0x224a1e[_0x04d5('0x1e')]],'as':_0x224a1e['as'],'attributes':_0x224a1e[_0x04d5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x04d5('0xb')](function(_0x115f95){logger[_0x04d5('0xc')]('GetDynamics365Account',_0x5a3fff);logger[_0x04d5('0xf')](_0x04d5('0x15'),_0x5a3fff,JSON[_0x04d5('0x1f')](_0x115f95));_0x57a42a(_0x115f95);})[_0x04d5('0x14')](function(_0x545d7b){logger[_0x04d5('0x10')](_0x04d5('0x15'),_0x545d7b[_0x04d5('0x12')],_0x5a3fff);_0x411920(_0x546c5c['error'](0x1f4,_0x545d7b[_0x04d5('0x12')]));});});};exports['ShowDynamics365Account']=function(_0x3249ab){var _0x1ef3e5=this;return new Promise(function(_0x1ca8df,_0x3ecb31){return db[_0x04d5('0x20')]['find']({'raw':_0x3249ab[_0x04d5('0x17')]?_0x3249ab['options'][_0x04d5('0x18')]===undefined?!![]:![]:!![],'where':_0x3249ab['options']?_0x3249ab['options'][_0x04d5('0x19')]||null:null,'attributes':_0x3249ab[_0x04d5('0x17')]?_0x3249ab[_0x04d5('0x17')]['attributes']||null:null,'include':_0x3249ab[_0x04d5('0x17')]?_0x3249ab[_0x04d5('0x17')]['include']?_[_0x04d5('0x1d')](_0x3249ab[_0x04d5('0x17')][_0x04d5('0x1c')],function(_0x149678){return{'model':db[_0x149678[_0x04d5('0x1e')]],'as':_0x149678['as'],'attributes':_0x149678[_0x04d5('0x1a')],'include':_0x149678[_0x04d5('0x1c')]?_['map'](_0x149678[_0x04d5('0x1c')],function(_0x1af7e4){return{'model':db[_0x1af7e4[_0x04d5('0x1e')]],'as':_0x1af7e4['as'],'attributes':_0x1af7e4[_0x04d5('0x1a')],'include':_0x1af7e4['include']?_['map'](_0x1af7e4['include'],function(_0xdeffd2){return{'model':db[_0xdeffd2['model']],'as':_0xdeffd2['as'],'attributes':_0xdeffd2['attributes']};}):[]};}):[]};}):[]:[]})[_0x04d5('0xb')](function(_0x44d0f7){logger[_0x04d5('0xc')](_0x04d5('0x21'),_0x3249ab);logger['debug'](_0x04d5('0x21'),_0x3249ab,JSON['stringify'](_0x44d0f7));_0x1ca8df(_0x44d0f7);})[_0x04d5('0x14')](function(_0x48cfbf){logger[_0x04d5('0x10')](_0x04d5('0x21'),_0x48cfbf[_0x04d5('0x12')],_0x3249ab);_0x3ecb31(_0x1ef3e5['error'](0x1f4,_0x48cfbf[_0x04d5('0x12')]));});});}; \ No newline at end of file +var _0x485a=['jayson/promise','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','raw','options','where','attributes','limit','include','map','model','info','ShowDynamics365Account','find','debug','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xc2e451,_0x1e5681){var _0x3bc314=function(_0x48736d){while(--_0x48736d){_0xc2e451['push'](_0xc2e451['shift']());}};_0x3bc314(++_0x1e5681);}(_0x485a,0x1b4));var _0xa485=function(_0xfb65aa,_0x1651a6){_0xfb65aa=_0xfb65aa-0x0;var _0x2aee31=_0x485a[_0xfb65aa];return _0x2aee31;};'use strict';var _=require(_0xa485('0x0'));var util=require('util');var moment=require(_0xa485('0x1'));var BPromise=require('bluebird');var rs=require(_0xa485('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa485('0x3'))['db'];var utils=require(_0xa485('0x4'));var logger=require(_0xa485('0x5'))(_0xa485('0x6'));var config=require(_0xa485('0x7'));var jayson=require(_0xa485('0x8'));var client=jayson[_0xa485('0x9')][_0xa485('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bfb5b,_0x1292cf,_0x2199d0){return new BPromise(function(_0x256dbb,_0xbdbd62){return client[_0xa485('0xb')](_0x4bfb5b,_0x2199d0)[_0xa485('0xc')](function(_0x1897be){logger['info'](_0xa485('0xd'),_0x1292cf,_0xa485('0xe'));logger['debug'](_0xa485('0xf'),_0x1292cf,_0xa485('0xe'),JSON[_0xa485('0x10')](_0x1897be));if(_0x1897be['error']){if(_0x1897be[_0xa485('0x11')][_0xa485('0x12')]===0x1f4){logger[_0xa485('0x11')](_0xa485('0xd'),_0x1292cf,_0x1897be[_0xa485('0x11')]['message']);return _0xbdbd62(_0x1897be[_0xa485('0x11')][_0xa485('0x13')]);}logger[_0xa485('0x11')](_0xa485('0xd'),_0x1292cf,_0x1897be[_0xa485('0x11')][_0xa485('0x13')]);return _0x256dbb(_0x1897be['error'][_0xa485('0x13')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x1292cf,_0xa485('0xe'));_0x256dbb(_0x1897be[_0xa485('0x14')][_0xa485('0x13')]);}})[_0xa485('0x15')](function(_0x5a62ba){logger[_0xa485('0x11')](_0xa485('0xd'),_0x1292cf,_0x5a62ba);_0xbdbd62(_0x5a62ba);});});}exports[_0xa485('0x16')]=function(_0x1e736a){var _0xf396e2=this;return new Promise(function(_0x49929c,_0x18e5f7){return db[_0xa485('0x17')][_0xa485('0x18')]({'raw':_0x1e736a['options']?_0x1e736a['options'][_0xa485('0x19')]===undefined?!![]:![]:!![],'where':_0x1e736a[_0xa485('0x1a')]?_0x1e736a[_0xa485('0x1a')][_0xa485('0x1b')]||null:null,'attributes':_0x1e736a['options']?_0x1e736a[_0xa485('0x1a')][_0xa485('0x1c')]||null:null,'limit':_0x1e736a['options']?_0x1e736a[_0xa485('0x1a')][_0xa485('0x1d')]||null:null,'include':_0x1e736a[_0xa485('0x1a')]?_0x1e736a['options'][_0xa485('0x1e')]?_[_0xa485('0x1f')](_0x1e736a['options']['include'],function(_0x240df1){return{'model':db[_0x240df1[_0xa485('0x20')]],'as':_0x240df1['as'],'attributes':_0x240df1[_0xa485('0x1c')],'include':_0x240df1['include']?_[_0xa485('0x1f')](_0x240df1[_0xa485('0x1e')],function(_0x4fe1c7){return{'model':db[_0x4fe1c7[_0xa485('0x20')]],'as':_0x4fe1c7['as'],'attributes':_0x4fe1c7[_0xa485('0x1c')],'include':_0x4fe1c7['include']?_['map'](_0x4fe1c7[_0xa485('0x1e')],function(_0x33b907){return{'model':db[_0x33b907[_0xa485('0x20')]],'as':_0x33b907['as'],'attributes':_0x33b907[_0xa485('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa485('0xc')](function(_0x57531d){logger[_0xa485('0x21')](_0xa485('0x16'),_0x1e736a);logger['debug'](_0xa485('0x16'),_0x1e736a,JSON['stringify'](_0x57531d));_0x49929c(_0x57531d);})['catch'](function(_0x312068){logger['error']('GetDynamics365Account',_0x312068[_0xa485('0x13')],_0x1e736a);_0x18e5f7(_0xf396e2[_0xa485('0x11')](0x1f4,_0x312068[_0xa485('0x13')]));});});};exports[_0xa485('0x22')]=function(_0x5c23ca){var _0x13a980=this;return new Promise(function(_0x3a6cf7,_0x12ebb9){return db['Dynamics365Account'][_0xa485('0x23')]({'raw':_0x5c23ca[_0xa485('0x1a')]?_0x5c23ca[_0xa485('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5c23ca[_0xa485('0x1a')]?_0x5c23ca[_0xa485('0x1a')][_0xa485('0x1b')]||null:null,'attributes':_0x5c23ca['options']?_0x5c23ca['options'][_0xa485('0x1c')]||null:null,'include':_0x5c23ca[_0xa485('0x1a')]?_0x5c23ca['options'][_0xa485('0x1e')]?_[_0xa485('0x1f')](_0x5c23ca['options'][_0xa485('0x1e')],function(_0x546e8b){return{'model':db[_0x546e8b[_0xa485('0x20')]],'as':_0x546e8b['as'],'attributes':_0x546e8b[_0xa485('0x1c')],'include':_0x546e8b[_0xa485('0x1e')]?_[_0xa485('0x1f')](_0x546e8b['include'],function(_0x266862){return{'model':db[_0x266862[_0xa485('0x20')]],'as':_0x266862['as'],'attributes':_0x266862[_0xa485('0x1c')],'include':_0x266862['include']?_[_0xa485('0x1f')](_0x266862[_0xa485('0x1e')],function(_0x3faff6){return{'model':db[_0x3faff6[_0xa485('0x20')]],'as':_0x3faff6['as'],'attributes':_0x3faff6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4271c7){logger[_0xa485('0x21')](_0xa485('0x22'),_0x5c23ca);logger[_0xa485('0x24')](_0xa485('0x22'),_0x5c23ca,JSON[_0xa485('0x10')](_0x4271c7));_0x3a6cf7(_0x4271c7);})[_0xa485('0x15')](function(_0x347701){logger[_0xa485('0x11')](_0xa485('0x22'),_0x347701[_0xa485('0x13')],_0x5c23ca);_0x12ebb9(_0x13a980[_0xa485('0x11')](0x1f4,_0x347701[_0xa485('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 591cc5a..4de211a 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 _0x96da=['put','update','delete','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create'];(function(_0xd681dd,_0x1e0a39){var _0x376098=function(_0x5a03e5){while(--_0x5a03e5){_0xd681dd['push'](_0xd681dd['shift']());}};_0x376098(++_0x1e0a39);}(_0x96da,0x1d2));var _0xa96d=function(_0x4a258d,_0x30f281){_0x4a258d=_0x4a258d-0x0;var _0x104963=_0x96da[_0x4a258d];return _0x104963;};'use strict';var multer=require(_0xa96d('0x0'));var util=require(_0xa96d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa96d('0x2'));var router=express['Router']();var fs_extra=require(_0xa96d('0x3'));var auth=require(_0xa96d('0x4'));var interaction=require(_0xa96d('0x5'));var config=require('../../config/environment');var controller=require(_0xa96d('0x6'));router[_0xa96d('0x7')]('/',auth[_0xa96d('0x8')](),controller[_0xa96d('0x9')]);router[_0xa96d('0x7')](_0xa96d('0xa'),auth[_0xa96d('0x8')](),controller[_0xa96d('0xb')]);router[_0xa96d('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0xa96d('0xc')]);router['get'](_0xa96d('0xd'),auth[_0xa96d('0x8')](),controller['getSubjects']);router['get'](_0xa96d('0xe'),auth[_0xa96d('0x8')](),controller[_0xa96d('0xf')]);router[_0xa96d('0x10')]('/',auth['isAuthenticated'](),controller[_0xa96d('0x11')]);router[_0xa96d('0x12')](_0xa96d('0xa'),auth[_0xa96d('0x8')](),controller[_0xa96d('0x13')]);router[_0xa96d('0x14')](_0xa96d('0xa'),auth[_0xa96d('0x8')](),controller['destroy']);module[_0xa96d('0x15')]=router; \ No newline at end of file +var _0xad6b=['./intDynamics365Configuration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0xad6b,0x159));var _0xbad6=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xad6b[_0x2070da];return _0x4f9fe1;};'use strict';var multer=require(_0xbad6('0x0'));var util=require(_0xbad6('0x1'));var path=require('path');var timeout=require(_0xbad6('0x2'));var express=require(_0xbad6('0x3'));var router=express[_0xbad6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbad6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbad6('0x6'));var controller=require(_0xbad6('0x7'));router[_0xbad6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbad6('0x8')](_0xbad6('0x9'),auth[_0xbad6('0xa')](),controller[_0xbad6('0xb')]);router[_0xbad6('0x8')]('/:id/fields',auth[_0xbad6('0xa')](),controller[_0xbad6('0xc')]);router[_0xbad6('0x8')](_0xbad6('0xd'),auth[_0xbad6('0xa')](),controller[_0xbad6('0xe')]);router[_0xbad6('0x8')](_0xbad6('0xf'),auth[_0xbad6('0xa')](),controller[_0xbad6('0x10')]);router['post']('/',auth[_0xbad6('0xa')](),controller[_0xbad6('0x11')]);router[_0xbad6('0x12')](_0xbad6('0x9'),auth[_0xbad6('0xa')](),controller[_0xbad6('0x13')]);router['delete'](_0xbad6('0x9'),auth[_0xbad6('0xa')](),controller[_0xbad6('0x14')]);module[_0xbad6('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 57bec37..c30c44c 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 _0x2f67=['contact','nothing','exports','STRING','ENUM','incident','phonecall'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2f67,0x14b));var _0x72f6=function(_0x260c7c,_0x52bde1){_0x260c7c=_0x260c7c-0x0;var _0x3b4473=_0x2f67[_0x260c7c];return _0x3b4473;};'use strict';var Sequelize=require('sequelize');module[_0x72f6('0x0')]={'name':{'type':Sequelize[_0x72f6('0x1')]},'description':{'type':Sequelize[_0x72f6('0x1')]},'ticketType':{'type':Sequelize[_0x72f6('0x2')](_0x72f6('0x3'),_0x72f6('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x72f6('0x2')](_0x72f6('0x5'),_0x72f6('0x6')),'defaultValue':_0x72f6('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x72f6('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x6e7c=['nothing','BOOLEAN','sequelize','STRING','ENUM','incident'];(function(_0x1e4d9a,_0x145493){var _0x1a2d25=function(_0x26048d){while(--_0x26048d){_0x1e4d9a['push'](_0x1e4d9a['shift']());}};_0x1a2d25(++_0x145493);}(_0x6e7c,0x92));var _0xc6e7=function(_0xe274a3,_0x48dc31){_0xe274a3=_0xe274a3-0x0;var _0x18c49e=_0x6e7c[_0xe274a3];return _0x18c49e;};'use strict';var Sequelize=require(_0xc6e7('0x0'));module['exports']={'name':{'type':Sequelize[_0xc6e7('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xc6e7('0x2')](_0xc6e7('0x3'),'phonecall'),'defaultValue':_0xc6e7('0x3')},'moduleCreate':{'type':Sequelize[_0xc6e7('0x2')]('contact',_0xc6e7('0x4')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xc6e7('0x5')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 28fb4dc..65f02cb 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 _0x64b7=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','Dynamics365Configuration','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','params','find','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0x64b7,0x1c5));var _0x764b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64b7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x764b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x764b('0x1'));var jsonpatch=require(_0x764b('0x2'));var rp=require(_0x764b('0x3'));var moment=require(_0x764b('0x4'));var BPromise=require(_0x764b('0x5'));var Mustache=require(_0x764b('0x6'));var util=require(_0x764b('0x7'));var path=require(_0x764b('0x8'));var sox=require(_0x764b('0x9'));var csv=require(_0x764b('0xa'));var ejs=require(_0x764b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x764b('0xc'));var crypto=require(_0x764b('0xd'));var jsforce=require(_0x764b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x764b('0xa'));var querystring=require('querystring');var Papa=require(_0x764b('0xf'));var Redis=require(_0x764b('0x10'));var authService=require(_0x764b('0x11'));var qs=require(_0x764b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x764b('0x13'))(_0x764b('0x14'));var utils=require('../../config/utils');var config=require(_0x764b('0x15'));var licenseUtil=require(_0x764b('0x16'));var db=require(_0x764b('0x17'))['db'];function respondWithStatusCode(_0x29d0b1,_0x25f686){_0x25f686=_0x25f686||0xcc;return function(_0x3671a2){if(_0x3671a2){return _0x29d0b1['sendStatus'](_0x25f686);}return _0x29d0b1['status'](_0x25f686)[_0x764b('0x18')]();};}function respondWithResult(_0x126828,_0x2ec0d2){_0x2ec0d2=_0x2ec0d2||0xc8;return function(_0xa07ca6){if(_0xa07ca6){return _0x126828['status'](_0x2ec0d2)[_0x764b('0x19')](_0xa07ca6);}};}function respondWithFilteredResult(_0x3c02b0,_0x3f4132){return function(_0x3948cf){if(_0x3948cf){var _0x4c4328=typeof _0x3f4132[_0x764b('0x1a')]===_0x764b('0x1b')&&typeof _0x3f4132[_0x764b('0x1c')]===_0x764b('0x1b');var _0x5110ee=_0x3948cf[_0x764b('0x1d')];var _0x937690=_0x4c4328?0x0:_0x3f4132[_0x764b('0x1a')];var _0x365ed9=_0x4c4328?_0x3948cf[_0x764b('0x1d')]:_0x3f4132[_0x764b('0x1a')]+_0x3f4132[_0x764b('0x1c')];var _0x2e7dd3;if(_0x365ed9>=_0x5110ee){_0x365ed9=_0x5110ee;_0x2e7dd3=0xc8;}else{_0x2e7dd3=0xce;}_0x3c02b0[_0x764b('0x1e')](_0x2e7dd3);return _0x3c02b0[_0x764b('0x1f')](_0x764b('0x20'),_0x937690+'-'+_0x365ed9+'/'+_0x5110ee)[_0x764b('0x19')](_0x3948cf);}return null;};}function patchUpdates(_0x3c116c){return function(_0x3ce1f8){try{jsonpatch[_0x764b('0x21')](_0x3ce1f8,_0x3c116c,!![]);}catch(_0x2dea10){return BPromise[_0x764b('0x22')](_0x2dea10);}return _0x3ce1f8['save']();};}function saveUpdates(_0x22c20a,_0x44cc2b){return function(_0x12719a){if(_0x12719a){return _0x12719a['update'](_0x22c20a)[_0x764b('0x23')](function(_0xa7cb64){return _0xa7cb64;});}return null;};}function removeEntity(_0x273aa4,_0x72c04){return function(_0x1f8a66){if(_0x1f8a66){return _0x1f8a66[_0x764b('0x24')]()['then'](function(){_0x273aa4[_0x764b('0x1e')](0xcc)[_0x764b('0x18')]();});}};}function handleEntityNotFound(_0x5d5b5b,_0x441821){return function(_0xad2633){if(!_0xad2633){_0x5d5b5b['sendStatus'](0x194);}return _0xad2633;};}function handleError(_0x4a52ad,_0x37457a){_0x37457a=_0x37457a||0x1f4;return function(_0x36b317){logger[_0x764b('0x25')](_0x36b317[_0x764b('0x26')]);if(_0x36b317[_0x764b('0x27')]){delete _0x36b317[_0x764b('0x27')];}_0x4a52ad[_0x764b('0x1e')](_0x37457a)[_0x764b('0x28')](_0x36b317);};}exports['index']=function(_0x3fe1d9,_0x330ca0){var _0x58e961={},_0x57ae77={},_0x3d3c4f={'count':0x0,'rows':[]};var _0x457707=_['map'](db[_0x764b('0x29')][_0x764b('0x2a')],function(_0x13cd1a){return{'name':_0x13cd1a['fieldName'],'type':_0x13cd1a[_0x764b('0x2b')][_0x764b('0x2c')]};});_0x57ae77[_0x764b('0x2d')]=_[_0x764b('0x2e')](_0x457707,_0x764b('0x27'));_0x57ae77[_0x764b('0x2f')]=_[_0x764b('0x30')](_0x3fe1d9['query']);_0x57ae77[_0x764b('0x31')]=_['intersection'](_0x57ae77[_0x764b('0x2d')],_0x57ae77[_0x764b('0x2f')]);_0x58e961[_0x764b('0x32')]=_[_0x764b('0x33')](_0x57ae77['model'],qs[_0x764b('0x34')](_0x3fe1d9[_0x764b('0x2f')][_0x764b('0x34')]));_0x58e961[_0x764b('0x32')]=_0x58e961['attributes'][_0x764b('0x35')]?_0x58e961[_0x764b('0x32')]:_0x57ae77[_0x764b('0x2d')];if(!_0x3fe1d9[_0x764b('0x2f')][_0x764b('0x36')](_0x764b('0x37'))){_0x58e961[_0x764b('0x1c')]=qs['limit'](_0x3fe1d9['query'][_0x764b('0x1c')]);_0x58e961['offset']=qs[_0x764b('0x1a')](_0x3fe1d9[_0x764b('0x2f')][_0x764b('0x1a')]);}_0x58e961[_0x764b('0x38')]=qs['sort'](_0x3fe1d9[_0x764b('0x2f')][_0x764b('0x39')]);_0x58e961[_0x764b('0x3a')]=qs[_0x764b('0x31')](_[_0x764b('0x3b')](_0x3fe1d9['query'],_0x57ae77['filters']),_0x457707);if(_0x3fe1d9['query'][_0x764b('0x3c')]){_0x58e961[_0x764b('0x3a')]=_[_0x764b('0x3d')](_0x58e961['where'],{'$or':_['map'](_0x457707,function(_0x30c168){if(_0x30c168[_0x764b('0x2b')]!=='VIRTUAL'){var _0x17749b={};_0x17749b[_0x30c168[_0x764b('0x27')]]={'$like':'%'+_0x3fe1d9[_0x764b('0x2f')][_0x764b('0x3c')]+'%'};return _0x17749b;}})});}_0x58e961=_['merge']({},_0x58e961,_0x3fe1d9[_0x764b('0x3e')]);var _0x16f2c1={'where':_0x58e961['where']};return db[_0x764b('0x29')][_0x764b('0x1d')](_0x16f2c1)[_0x764b('0x23')](function(_0x351c79){_0x3d3c4f[_0x764b('0x1d')]=_0x351c79;if(_0x3fe1d9['query'][_0x764b('0x3f')]){_0x58e961[_0x764b('0x40')]=[{'all':!![]}];}return db[_0x764b('0x29')][_0x764b('0x41')](_0x58e961);})[_0x764b('0x23')](function(_0x550cf1){_0x3d3c4f[_0x764b('0x42')]=_0x550cf1;return _0x3d3c4f;})[_0x764b('0x23')](respondWithFilteredResult(_0x330ca0,_0x58e961))['catch'](handleError(_0x330ca0,null));};exports[_0x764b('0x43')]=function(_0x2c62e5,_0x469e03){var _0x56b2d3={'raw':![],'where':{'id':_0x2c62e5['params']['id']}},_0x345e6f={};_0x345e6f[_0x764b('0x2d')]=_[_0x764b('0x30')](db[_0x764b('0x29')]['rawAttributes']);_0x345e6f[_0x764b('0x2f')]=_['keys'](_0x2c62e5[_0x764b('0x2f')]);_0x345e6f[_0x764b('0x31')]=_[_0x764b('0x33')](_0x345e6f['model'],_0x345e6f[_0x764b('0x2f')]);_0x56b2d3[_0x764b('0x32')]=_[_0x764b('0x33')](_0x345e6f[_0x764b('0x2d')],qs[_0x764b('0x34')](_0x2c62e5[_0x764b('0x2f')][_0x764b('0x34')]));_0x56b2d3[_0x764b('0x32')]=_0x56b2d3[_0x764b('0x32')][_0x764b('0x35')]?_0x56b2d3[_0x764b('0x32')]:_0x345e6f[_0x764b('0x2d')];if(_0x2c62e5[_0x764b('0x2f')][_0x764b('0x3f')]){_0x56b2d3[_0x764b('0x40')]=[{'all':!![]}];}_0x56b2d3=_[_0x764b('0x3d')]({},_0x56b2d3,_0x2c62e5[_0x764b('0x3e')]);return db[_0x764b('0x29')]['find'](_0x56b2d3)['then'](handleEntityNotFound(_0x469e03,null))[_0x764b('0x23')](respondWithResult(_0x469e03,null))[_0x764b('0x44')](handleError(_0x469e03,null));};exports[_0x764b('0x45')]=function(_0x1dfdc1,_0x4ded96){return db[_0x764b('0x29')][_0x764b('0x45')](_0x1dfdc1['body'],{})['then'](respondWithResult(_0x4ded96,0xc9))[_0x764b('0x44')](handleError(_0x4ded96,null));};exports['update']=function(_0x4696c8,_0x510074){if(_0x4696c8[_0x764b('0x46')]['id']){delete _0x4696c8[_0x764b('0x46')]['id'];}return db[_0x764b('0x29')]['find']({'where':{'id':_0x4696c8[_0x764b('0x47')]['id']}})[_0x764b('0x23')](handleEntityNotFound(_0x510074,null))['then'](saveUpdates(_0x4696c8[_0x764b('0x46')],null))['then'](respondWithResult(_0x510074,null))[_0x764b('0x44')](handleError(_0x510074,null));};exports[_0x764b('0x24')]=function(_0x5f2213,_0x438b74){return db[_0x764b('0x29')][_0x764b('0x48')]({'where':{'id':_0x5f2213[_0x764b('0x47')]['id']}})[_0x764b('0x23')](handleEntityNotFound(_0x438b74,null))['then'](removeEntity(_0x438b74,null))[_0x764b('0x44')](handleError(_0x438b74,null));};exports[_0x764b('0x49')]=function(_0x1a398e,_0x40d923,_0x10545a){var _0x484211={};var _0x410736={};var _0x538d93;var _0xe9fdfb;return db['Dynamics365Configuration'][_0x764b('0x4a')]({'where':{'id':_0x1a398e[_0x764b('0x47')]['id']}})[_0x764b('0x23')](handleEntityNotFound(_0x40d923,null))[_0x764b('0x23')](function(_0x64d733){if(_0x64d733){_0x538d93=_0x64d733;_0x410736[_0x764b('0x2d')]=_['keys'](db['Dynamics365Field'][_0x764b('0x2a')]);_0x410736[_0x764b('0x2f')]=_['keys'](_0x1a398e[_0x764b('0x2f')]);_0x410736[_0x764b('0x31')]=_[_0x764b('0x33')](_0x410736[_0x764b('0x2d')],_0x410736[_0x764b('0x2f')]);_0x484211[_0x764b('0x32')]=_[_0x764b('0x33')](_0x410736['model'],qs[_0x764b('0x34')](_0x1a398e[_0x764b('0x2f')][_0x764b('0x34')]));_0x484211[_0x764b('0x32')]=_0x484211[_0x764b('0x32')]['length']?_0x484211[_0x764b('0x32')]:_0x410736['model'];_0x484211[_0x764b('0x38')]=qs[_0x764b('0x39')](_0x1a398e[_0x764b('0x2f')][_0x764b('0x39')]);_0x484211['where']=qs[_0x764b('0x31')](_['pick'](_0x1a398e[_0x764b('0x2f')],_0x410736[_0x764b('0x31')]));if(_0x1a398e['query'][_0x764b('0x3c')]){_0x484211['where']=_[_0x764b('0x3d')](_0x484211['where'],{'$or':_[_0x764b('0x2e')](_0x484211[_0x764b('0x32')],function(_0x4feea5){var _0x222a86={};_0x222a86[_0x4feea5]={'$like':'%'+_0x1a398e[_0x764b('0x2f')][_0x764b('0x3c')]+'%'};return _0x222a86;})});}_0x484211=_[_0x764b('0x3d')]({},_0x484211,_0x1a398e[_0x764b('0x3e')]);return _0x538d93[_0x764b('0x49')](_0x484211);}})[_0x764b('0x23')](function(_0x51b3f2){if(_0x51b3f2){_0xe9fdfb=_0x51b3f2[_0x764b('0x35')];if(!_0x1a398e[_0x764b('0x2f')]['hasOwnProperty'](_0x764b('0x37'))){_0x484211['limit']=qs[_0x764b('0x1c')](_0x1a398e['query'][_0x764b('0x1c')]);_0x484211['offset']=qs[_0x764b('0x1a')](_0x1a398e[_0x764b('0x2f')][_0x764b('0x1a')]);}return _0x538d93[_0x764b('0x49')](_0x484211);}})[_0x764b('0x23')](function(_0x188566){if(_0x188566){return _0x188566?{'count':_0xe9fdfb,'rows':_0x188566}:null;}})['then'](respondWithResult(_0x40d923,null))[_0x764b('0x44')](handleError(_0x40d923,null));};exports['getSubjects']=function(_0x1bf5b4,_0x5a7a8e,_0x363c6b){var _0x4d50c={};var _0x4d59ef={};var _0x833d55;var _0xacca84;return db[_0x764b('0x29')]['findOne']({'where':{'id':_0x1bf5b4[_0x764b('0x47')]['id']}})[_0x764b('0x23')](handleEntityNotFound(_0x5a7a8e,null))[_0x764b('0x23')](function(_0x323bee){if(_0x323bee){_0x833d55=_0x323bee;_0x4d59ef[_0x764b('0x2d')]=_[_0x764b('0x30')](db[_0x764b('0x4b')][_0x764b('0x2a')]);_0x4d59ef['query']=_[_0x764b('0x30')](_0x1bf5b4[_0x764b('0x2f')]);_0x4d59ef[_0x764b('0x31')]=_['intersection'](_0x4d59ef['model'],_0x4d59ef[_0x764b('0x2f')]);_0x4d50c[_0x764b('0x32')]=_[_0x764b('0x33')](_0x4d59ef[_0x764b('0x2d')],qs[_0x764b('0x34')](_0x1bf5b4['query'][_0x764b('0x34')]));_0x4d50c[_0x764b('0x32')]=_0x4d50c[_0x764b('0x32')][_0x764b('0x35')]?_0x4d50c['attributes']:_0x4d59ef[_0x764b('0x2d')];_0x4d50c['order']=qs[_0x764b('0x39')](_0x1bf5b4[_0x764b('0x2f')][_0x764b('0x39')]);_0x4d50c['where']=qs[_0x764b('0x31')](_['pick'](_0x1bf5b4['query'],_0x4d59ef[_0x764b('0x31')]));if(_0x1bf5b4[_0x764b('0x2f')][_0x764b('0x3c')]){_0x4d50c['where']=_[_0x764b('0x3d')](_0x4d50c[_0x764b('0x3a')],{'$or':_[_0x764b('0x2e')](_0x4d50c[_0x764b('0x32')],function(_0x55463d){var _0x1af74a={};_0x1af74a[_0x55463d]={'$like':'%'+_0x1bf5b4[_0x764b('0x2f')]['filter']+'%'};return _0x1af74a;})});}_0x4d50c=_['merge']({},_0x4d50c,_0x1bf5b4[_0x764b('0x3e')]);return _0x833d55[_0x764b('0x4c')](_0x4d50c);}})[_0x764b('0x23')](function(_0x28e648){if(_0x28e648){_0xacca84=_0x28e648[_0x764b('0x35')];if(!_0x1bf5b4[_0x764b('0x2f')][_0x764b('0x36')](_0x764b('0x37'))){_0x4d50c[_0x764b('0x1c')]=qs[_0x764b('0x1c')](_0x1bf5b4[_0x764b('0x2f')][_0x764b('0x1c')]);_0x4d50c[_0x764b('0x1a')]=qs[_0x764b('0x1a')](_0x1bf5b4[_0x764b('0x2f')][_0x764b('0x1a')]);}return _0x833d55[_0x764b('0x4c')](_0x4d50c);}})[_0x764b('0x23')](function(_0x468ef4){if(_0x468ef4){return _0x468ef4?{'count':_0xacca84,'rows':_0x468ef4}:null;}})[_0x764b('0x23')](respondWithResult(_0x5a7a8e,null))[_0x764b('0x44')](handleError(_0x5a7a8e,null));};exports[_0x764b('0x4d')]=function(_0x2629fe,_0x25c74a,_0x1854c7){var _0x199792={};var _0x1390e2={};var _0x5b033d;var _0x29b01c;return db[_0x764b('0x29')][_0x764b('0x4a')]({'where':{'id':_0x2629fe[_0x764b('0x47')]['id']}})[_0x764b('0x23')](handleEntityNotFound(_0x25c74a,null))[_0x764b('0x23')](function(_0x2f1702){if(_0x2f1702){_0x5b033d=_0x2f1702;_0x1390e2[_0x764b('0x2d')]=_[_0x764b('0x30')](db[_0x764b('0x4b')][_0x764b('0x2a')]);_0x1390e2[_0x764b('0x2f')]=_[_0x764b('0x30')](_0x2629fe[_0x764b('0x2f')]);_0x1390e2[_0x764b('0x31')]=_[_0x764b('0x33')](_0x1390e2[_0x764b('0x2d')],_0x1390e2[_0x764b('0x2f')]);_0x199792['attributes']=_[_0x764b('0x33')](_0x1390e2['model'],qs[_0x764b('0x34')](_0x2629fe[_0x764b('0x2f')][_0x764b('0x34')]));_0x199792['attributes']=_0x199792[_0x764b('0x32')][_0x764b('0x35')]?_0x199792[_0x764b('0x32')]:_0x1390e2[_0x764b('0x2d')];_0x199792[_0x764b('0x38')]=qs[_0x764b('0x39')](_0x2629fe['query']['sort']);_0x199792[_0x764b('0x3a')]=qs['filters'](_['pick'](_0x2629fe[_0x764b('0x2f')],_0x1390e2[_0x764b('0x31')]));if(_0x2629fe['query'][_0x764b('0x3c')]){_0x199792['where']=_[_0x764b('0x3d')](_0x199792['where'],{'$or':_[_0x764b('0x2e')](_0x199792[_0x764b('0x32')],function(_0x2379d7){var _0x35399f={};_0x35399f[_0x2379d7]={'$like':'%'+_0x2629fe[_0x764b('0x2f')]['filter']+'%'};return _0x35399f;})});}_0x199792=_[_0x764b('0x3d')]({},_0x199792,_0x2629fe['options']);return _0x5b033d['getDescriptions'](_0x199792);}})[_0x764b('0x23')](function(_0x24af81){if(_0x24af81){_0x29b01c=_0x24af81[_0x764b('0x35')];if(!_0x2629fe[_0x764b('0x2f')]['hasOwnProperty'](_0x764b('0x37'))){_0x199792[_0x764b('0x1c')]=qs[_0x764b('0x1c')](_0x2629fe[_0x764b('0x2f')][_0x764b('0x1c')]);_0x199792['offset']=qs[_0x764b('0x1a')](_0x2629fe[_0x764b('0x2f')][_0x764b('0x1a')]);}return _0x5b033d[_0x764b('0x4d')](_0x199792);}})['then'](function(_0x1edb72){if(_0x1edb72){return _0x1edb72?{'count':_0x29b01c,'rows':_0x1edb72}:null;}})['then'](respondWithResult(_0x25c74a,null))[_0x764b('0x44')](handleError(_0x25c74a,null));}; \ No newline at end of file +var _0xff29=['request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','fieldName','type','key','model','map','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','Dynamics365Configuration','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','findOne','Dynamics365Field','rawAttributes','options','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch'];(function(_0x539f31,_0x185cd2){var _0x33b2b4=function(_0xa53148){while(--_0xa53148){_0x539f31['push'](_0x539f31['shift']());}};_0x33b2b4(++_0x185cd2);}(_0xff29,0x145));var _0x9ff2=function(_0xb8ae57,_0x59b086){_0xb8ae57=_0xb8ae57-0x0;var _0x2758c1=_0xff29[_0xb8ae57];return _0x2758c1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9ff2('0x0'));var zipdir=require(_0x9ff2('0x1'));var jsonpatch=require(_0x9ff2('0x2'));var rp=require(_0x9ff2('0x3'));var moment=require(_0x9ff2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9ff2('0x5'));var util=require('util');var path=require(_0x9ff2('0x6'));var sox=require(_0x9ff2('0x7'));var csv=require(_0x9ff2('0x8'));var ejs=require(_0x9ff2('0x9'));var fs=require('fs');var fs_extra=require(_0x9ff2('0xa'));var _=require('lodash');var squel=require(_0x9ff2('0xb'));var crypto=require(_0x9ff2('0xc'));var jsforce=require(_0x9ff2('0xd'));var deskjs=require(_0x9ff2('0xe'));var toCsv=require(_0x9ff2('0x8'));var querystring=require(_0x9ff2('0xf'));var Papa=require(_0x9ff2('0x10'));var Redis=require(_0x9ff2('0x11'));var authService=require(_0x9ff2('0x12'));var qs=require(_0x9ff2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9ff2('0x14'))(_0x9ff2('0x15'));var utils=require(_0x9ff2('0x16'));var config=require(_0x9ff2('0x17'));var licenseUtil=require(_0x9ff2('0x18'));var db=require(_0x9ff2('0x19'))['db'];function respondWithStatusCode(_0x255757,_0x17603b){_0x17603b=_0x17603b||0xcc;return function(_0x581791){if(_0x581791){return _0x255757[_0x9ff2('0x1a')](_0x17603b);}return _0x255757[_0x9ff2('0x1b')](_0x17603b)[_0x9ff2('0x1c')]();};}function respondWithResult(_0x238263,_0x463ccf){_0x463ccf=_0x463ccf||0xc8;return function(_0x5c6a73){if(_0x5c6a73){return _0x238263[_0x9ff2('0x1b')](_0x463ccf)[_0x9ff2('0x1d')](_0x5c6a73);}};}function respondWithFilteredResult(_0x3e3523,_0x5b3ea4){return function(_0x37abea){if(_0x37abea){var _0x3086cd=typeof _0x5b3ea4[_0x9ff2('0x1e')]===_0x9ff2('0x1f')&&typeof _0x5b3ea4[_0x9ff2('0x20')]===_0x9ff2('0x1f');var _0x2b3603=_0x37abea[_0x9ff2('0x21')];var _0x17b320=_0x3086cd?0x0:_0x5b3ea4[_0x9ff2('0x1e')];var _0x50aab4=_0x3086cd?_0x37abea[_0x9ff2('0x21')]:_0x5b3ea4[_0x9ff2('0x1e')]+_0x5b3ea4['limit'];var _0x16bbf4;if(_0x50aab4>=_0x2b3603){_0x50aab4=_0x2b3603;_0x16bbf4=0xc8;}else{_0x16bbf4=0xce;}_0x3e3523[_0x9ff2('0x1b')](_0x16bbf4);return _0x3e3523[_0x9ff2('0x22')](_0x9ff2('0x23'),_0x17b320+'-'+_0x50aab4+'/'+_0x2b3603)['json'](_0x37abea);}return null;};}function patchUpdates(_0x3a38b8){return function(_0x133362){try{jsonpatch[_0x9ff2('0x24')](_0x133362,_0x3a38b8,!![]);}catch(_0xca8a6d){return BPromise[_0x9ff2('0x25')](_0xca8a6d);}return _0x133362[_0x9ff2('0x26')]();};}function saveUpdates(_0x25491e,_0x4f6596){return function(_0x5a595e){if(_0x5a595e){return _0x5a595e[_0x9ff2('0x27')](_0x25491e)[_0x9ff2('0x28')](function(_0x1183fd){return _0x1183fd;});}return null;};}function removeEntity(_0x3513a,_0x25f25c){return function(_0x3615c1){if(_0x3615c1){return _0x3615c1[_0x9ff2('0x29')]()[_0x9ff2('0x28')](function(){_0x3513a[_0x9ff2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2246b1,_0x28d84d){return function(_0x420e3e){if(!_0x420e3e){_0x2246b1[_0x9ff2('0x1a')](0x194);}return _0x420e3e;};}function handleError(_0x7ccfe3,_0x215726){_0x215726=_0x215726||0x1f4;return function(_0x43a300){logger[_0x9ff2('0x2a')](_0x43a300['stack']);if(_0x43a300['name']){delete _0x43a300[_0x9ff2('0x2b')];}_0x7ccfe3[_0x9ff2('0x1b')](_0x215726)['send'](_0x43a300);};}exports[_0x9ff2('0x2c')]=function(_0x52b10b,_0x37f2e0){var _0x8060c={},_0x21fe85={},_0x3eba94={'count':0x0,'rows':[]};var _0x5b5b54=_['map'](db['Dynamics365Configuration']['rawAttributes'],function(_0x9e2c61){return{'name':_0x9e2c61[_0x9ff2('0x2d')],'type':_0x9e2c61[_0x9ff2('0x2e')][_0x9ff2('0x2f')]};});_0x21fe85[_0x9ff2('0x30')]=_[_0x9ff2('0x31')](_0x5b5b54,'name');_0x21fe85['query']=_[_0x9ff2('0x32')](_0x52b10b[_0x9ff2('0x33')]);_0x21fe85['filters']=_['intersection'](_0x21fe85[_0x9ff2('0x30')],_0x21fe85['query']);_0x8060c[_0x9ff2('0x34')]=_['intersection'](_0x21fe85[_0x9ff2('0x30')],qs[_0x9ff2('0x35')](_0x52b10b[_0x9ff2('0x33')][_0x9ff2('0x35')]));_0x8060c[_0x9ff2('0x34')]=_0x8060c['attributes'][_0x9ff2('0x36')]?_0x8060c['attributes']:_0x21fe85[_0x9ff2('0x30')];if(!_0x52b10b[_0x9ff2('0x33')][_0x9ff2('0x37')](_0x9ff2('0x38'))){_0x8060c[_0x9ff2('0x20')]=qs[_0x9ff2('0x20')](_0x52b10b[_0x9ff2('0x33')][_0x9ff2('0x20')]);_0x8060c[_0x9ff2('0x1e')]=qs['offset'](_0x52b10b[_0x9ff2('0x33')][_0x9ff2('0x1e')]);}_0x8060c[_0x9ff2('0x39')]=qs[_0x9ff2('0x3a')](_0x52b10b[_0x9ff2('0x33')]['sort']);_0x8060c[_0x9ff2('0x3b')]=qs[_0x9ff2('0x3c')](_[_0x9ff2('0x3d')](_0x52b10b['query'],_0x21fe85[_0x9ff2('0x3c')]),_0x5b5b54);if(_0x52b10b['query'][_0x9ff2('0x3e')]){_0x8060c[_0x9ff2('0x3b')]=_[_0x9ff2('0x3f')](_0x8060c[_0x9ff2('0x3b')],{'$or':_[_0x9ff2('0x31')](_0x5b5b54,function(_0x4ef5e3){if(_0x4ef5e3['type']!=='VIRTUAL'){var _0x52e03e={};_0x52e03e[_0x4ef5e3[_0x9ff2('0x2b')]]={'$like':'%'+_0x52b10b[_0x9ff2('0x33')][_0x9ff2('0x3e')]+'%'};return _0x52e03e;}})});}_0x8060c=_[_0x9ff2('0x3f')]({},_0x8060c,_0x52b10b['options']);var _0x63aa84={'where':_0x8060c['where']};return db[_0x9ff2('0x40')][_0x9ff2('0x21')](_0x63aa84)[_0x9ff2('0x28')](function(_0x26991d){_0x3eba94[_0x9ff2('0x21')]=_0x26991d;if(_0x52b10b['query'][_0x9ff2('0x41')]){_0x8060c[_0x9ff2('0x42')]=[{'all':!![]}];}return db[_0x9ff2('0x40')][_0x9ff2('0x43')](_0x8060c);})[_0x9ff2('0x28')](function(_0x4c9940){_0x3eba94[_0x9ff2('0x44')]=_0x4c9940;return _0x3eba94;})[_0x9ff2('0x28')](respondWithFilteredResult(_0x37f2e0,_0x8060c))[_0x9ff2('0x45')](handleError(_0x37f2e0,null));};exports[_0x9ff2('0x46')]=function(_0x5b2bb0,_0x2653cb){var _0x5e6323={'raw':![],'where':{'id':_0x5b2bb0[_0x9ff2('0x47')]['id']}},_0x46d540={};_0x46d540[_0x9ff2('0x30')]=_[_0x9ff2('0x32')](db[_0x9ff2('0x40')]['rawAttributes']);_0x46d540['query']=_['keys'](_0x5b2bb0[_0x9ff2('0x33')]);_0x46d540[_0x9ff2('0x3c')]=_[_0x9ff2('0x48')](_0x46d540[_0x9ff2('0x30')],_0x46d540[_0x9ff2('0x33')]);_0x5e6323[_0x9ff2('0x34')]=_['intersection'](_0x46d540[_0x9ff2('0x30')],qs[_0x9ff2('0x35')](_0x5b2bb0[_0x9ff2('0x33')][_0x9ff2('0x35')]));_0x5e6323[_0x9ff2('0x34')]=_0x5e6323[_0x9ff2('0x34')][_0x9ff2('0x36')]?_0x5e6323['attributes']:_0x46d540[_0x9ff2('0x30')];if(_0x5b2bb0[_0x9ff2('0x33')]['includeAll']){_0x5e6323['include']=[{'all':!![]}];}_0x5e6323=_['merge']({},_0x5e6323,_0x5b2bb0['options']);return db[_0x9ff2('0x40')][_0x9ff2('0x49')](_0x5e6323)['then'](handleEntityNotFound(_0x2653cb,null))[_0x9ff2('0x28')](respondWithResult(_0x2653cb,null))[_0x9ff2('0x45')](handleError(_0x2653cb,null));};exports[_0x9ff2('0x4a')]=function(_0x244260,_0x55cb59){return db[_0x9ff2('0x40')][_0x9ff2('0x4a')](_0x244260[_0x9ff2('0x4b')],{})[_0x9ff2('0x28')](respondWithResult(_0x55cb59,0xc9))[_0x9ff2('0x45')](handleError(_0x55cb59,null));};exports[_0x9ff2('0x27')]=function(_0x106fcd,_0xa22e11){if(_0x106fcd[_0x9ff2('0x4b')]['id']){delete _0x106fcd[_0x9ff2('0x4b')]['id'];}return db[_0x9ff2('0x40')]['find']({'where':{'id':_0x106fcd[_0x9ff2('0x47')]['id']}})[_0x9ff2('0x28')](handleEntityNotFound(_0xa22e11,null))[_0x9ff2('0x28')](saveUpdates(_0x106fcd[_0x9ff2('0x4b')],null))[_0x9ff2('0x28')](respondWithResult(_0xa22e11,null))[_0x9ff2('0x45')](handleError(_0xa22e11,null));};exports[_0x9ff2('0x29')]=function(_0x13cba7,_0x8e3cab){return db['Dynamics365Configuration']['find']({'where':{'id':_0x13cba7[_0x9ff2('0x47')]['id']}})[_0x9ff2('0x28')](handleEntityNotFound(_0x8e3cab,null))['then'](removeEntity(_0x8e3cab,null))[_0x9ff2('0x45')](handleError(_0x8e3cab,null));};exports['getFields']=function(_0x399af8,_0x4da9e2,_0x3aafba){var _0x5accc0={};var _0x4ca158={};var _0x3f5cb6;var _0x351c0a;return db[_0x9ff2('0x40')][_0x9ff2('0x4c')]({'where':{'id':_0x399af8[_0x9ff2('0x47')]['id']}})[_0x9ff2('0x28')](handleEntityNotFound(_0x4da9e2,null))['then'](function(_0x1df5e4){if(_0x1df5e4){_0x3f5cb6=_0x1df5e4;_0x4ca158[_0x9ff2('0x30')]=_[_0x9ff2('0x32')](db[_0x9ff2('0x4d')][_0x9ff2('0x4e')]);_0x4ca158[_0x9ff2('0x33')]=_[_0x9ff2('0x32')](_0x399af8[_0x9ff2('0x33')]);_0x4ca158[_0x9ff2('0x3c')]=_[_0x9ff2('0x48')](_0x4ca158[_0x9ff2('0x30')],_0x4ca158[_0x9ff2('0x33')]);_0x5accc0[_0x9ff2('0x34')]=_[_0x9ff2('0x48')](_0x4ca158[_0x9ff2('0x30')],qs[_0x9ff2('0x35')](_0x399af8['query'][_0x9ff2('0x35')]));_0x5accc0['attributes']=_0x5accc0[_0x9ff2('0x34')][_0x9ff2('0x36')]?_0x5accc0[_0x9ff2('0x34')]:_0x4ca158['model'];_0x5accc0[_0x9ff2('0x39')]=qs[_0x9ff2('0x3a')](_0x399af8['query'][_0x9ff2('0x3a')]);_0x5accc0['where']=qs[_0x9ff2('0x3c')](_[_0x9ff2('0x3d')](_0x399af8[_0x9ff2('0x33')],_0x4ca158[_0x9ff2('0x3c')]));if(_0x399af8[_0x9ff2('0x33')][_0x9ff2('0x3e')]){_0x5accc0[_0x9ff2('0x3b')]=_[_0x9ff2('0x3f')](_0x5accc0[_0x9ff2('0x3b')],{'$or':_[_0x9ff2('0x31')](_0x5accc0[_0x9ff2('0x34')],function(_0x44a058){var _0x12b132={};_0x12b132[_0x44a058]={'$like':'%'+_0x399af8[_0x9ff2('0x33')][_0x9ff2('0x3e')]+'%'};return _0x12b132;})});}_0x5accc0=_['merge']({},_0x5accc0,_0x399af8[_0x9ff2('0x4f')]);return _0x3f5cb6['getFields'](_0x5accc0);}})['then'](function(_0x12fb6a){if(_0x12fb6a){_0x351c0a=_0x12fb6a['length'];if(!_0x399af8['query']['hasOwnProperty'](_0x9ff2('0x38'))){_0x5accc0[_0x9ff2('0x20')]=qs[_0x9ff2('0x20')](_0x399af8['query'][_0x9ff2('0x20')]);_0x5accc0[_0x9ff2('0x1e')]=qs[_0x9ff2('0x1e')](_0x399af8['query'][_0x9ff2('0x1e')]);}return _0x3f5cb6['getFields'](_0x5accc0);}})['then'](function(_0x3f36e3){if(_0x3f36e3){return _0x3f36e3?{'count':_0x351c0a,'rows':_0x3f36e3}:null;}})[_0x9ff2('0x28')](respondWithResult(_0x4da9e2,null))[_0x9ff2('0x45')](handleError(_0x4da9e2,null));};exports[_0x9ff2('0x50')]=function(_0x3ccf8e,_0x146d19,_0x48a210){var _0x4e0001={};var _0x5dc749={};var _0x252211;var _0x40d5db;return db['Dynamics365Configuration'][_0x9ff2('0x4c')]({'where':{'id':_0x3ccf8e[_0x9ff2('0x47')]['id']}})['then'](handleEntityNotFound(_0x146d19,null))[_0x9ff2('0x28')](function(_0x508e7c){if(_0x508e7c){_0x252211=_0x508e7c;_0x5dc749['model']=_[_0x9ff2('0x32')](db[_0x9ff2('0x4d')][_0x9ff2('0x4e')]);_0x5dc749['query']=_['keys'](_0x3ccf8e[_0x9ff2('0x33')]);_0x5dc749[_0x9ff2('0x3c')]=_['intersection'](_0x5dc749['model'],_0x5dc749[_0x9ff2('0x33')]);_0x4e0001['attributes']=_[_0x9ff2('0x48')](_0x5dc749[_0x9ff2('0x30')],qs[_0x9ff2('0x35')](_0x3ccf8e[_0x9ff2('0x33')][_0x9ff2('0x35')]));_0x4e0001['attributes']=_0x4e0001[_0x9ff2('0x34')][_0x9ff2('0x36')]?_0x4e0001['attributes']:_0x5dc749[_0x9ff2('0x30')];_0x4e0001['order']=qs[_0x9ff2('0x3a')](_0x3ccf8e[_0x9ff2('0x33')][_0x9ff2('0x3a')]);_0x4e0001[_0x9ff2('0x3b')]=qs['filters'](_[_0x9ff2('0x3d')](_0x3ccf8e[_0x9ff2('0x33')],_0x5dc749[_0x9ff2('0x3c')]));if(_0x3ccf8e[_0x9ff2('0x33')][_0x9ff2('0x3e')]){_0x4e0001['where']=_[_0x9ff2('0x3f')](_0x4e0001['where'],{'$or':_[_0x9ff2('0x31')](_0x4e0001['attributes'],function(_0x2fb557){var _0x281347={};_0x281347[_0x2fb557]={'$like':'%'+_0x3ccf8e[_0x9ff2('0x33')][_0x9ff2('0x3e')]+'%'};return _0x281347;})});}_0x4e0001=_[_0x9ff2('0x3f')]({},_0x4e0001,_0x3ccf8e[_0x9ff2('0x4f')]);return _0x252211[_0x9ff2('0x50')](_0x4e0001);}})['then'](function(_0x43fbef){if(_0x43fbef){_0x40d5db=_0x43fbef[_0x9ff2('0x36')];if(!_0x3ccf8e[_0x9ff2('0x33')][_0x9ff2('0x37')]('nolimit')){_0x4e0001[_0x9ff2('0x20')]=qs[_0x9ff2('0x20')](_0x3ccf8e['query'][_0x9ff2('0x20')]);_0x4e0001[_0x9ff2('0x1e')]=qs[_0x9ff2('0x1e')](_0x3ccf8e[_0x9ff2('0x33')][_0x9ff2('0x1e')]);}return _0x252211[_0x9ff2('0x50')](_0x4e0001);}})['then'](function(_0x56fcd2){if(_0x56fcd2){return _0x56fcd2?{'count':_0x40d5db,'rows':_0x56fcd2}:null;}})['then'](respondWithResult(_0x146d19,null))[_0x9ff2('0x45')](handleError(_0x146d19,null));};exports[_0x9ff2('0x51')]=function(_0xa467c3,_0x16bf37,_0x5d7fa5){var _0x53503c={};var _0x4c753d={};var _0xd3005d;var _0x121bf3;return db['Dynamics365Configuration'][_0x9ff2('0x4c')]({'where':{'id':_0xa467c3['params']['id']}})['then'](handleEntityNotFound(_0x16bf37,null))[_0x9ff2('0x28')](function(_0x358c42){if(_0x358c42){_0xd3005d=_0x358c42;_0x4c753d['model']=_[_0x9ff2('0x32')](db[_0x9ff2('0x4d')]['rawAttributes']);_0x4c753d[_0x9ff2('0x33')]=_['keys'](_0xa467c3[_0x9ff2('0x33')]);_0x4c753d[_0x9ff2('0x3c')]=_[_0x9ff2('0x48')](_0x4c753d['model'],_0x4c753d[_0x9ff2('0x33')]);_0x53503c[_0x9ff2('0x34')]=_[_0x9ff2('0x48')](_0x4c753d[_0x9ff2('0x30')],qs[_0x9ff2('0x35')](_0xa467c3[_0x9ff2('0x33')]['fields']));_0x53503c['attributes']=_0x53503c[_0x9ff2('0x34')][_0x9ff2('0x36')]?_0x53503c['attributes']:_0x4c753d[_0x9ff2('0x30')];_0x53503c[_0x9ff2('0x39')]=qs['sort'](_0xa467c3[_0x9ff2('0x33')][_0x9ff2('0x3a')]);_0x53503c[_0x9ff2('0x3b')]=qs['filters'](_[_0x9ff2('0x3d')](_0xa467c3[_0x9ff2('0x33')],_0x4c753d[_0x9ff2('0x3c')]));if(_0xa467c3[_0x9ff2('0x33')]['filter']){_0x53503c['where']=_[_0x9ff2('0x3f')](_0x53503c[_0x9ff2('0x3b')],{'$or':_[_0x9ff2('0x31')](_0x53503c[_0x9ff2('0x34')],function(_0x57fb99){var _0x3c3b7a={};_0x3c3b7a[_0x57fb99]={'$like':'%'+_0xa467c3[_0x9ff2('0x33')]['filter']+'%'};return _0x3c3b7a;})});}_0x53503c=_[_0x9ff2('0x3f')]({},_0x53503c,_0xa467c3[_0x9ff2('0x4f')]);return _0xd3005d['getDescriptions'](_0x53503c);}})[_0x9ff2('0x28')](function(_0x310f48){if(_0x310f48){_0x121bf3=_0x310f48['length'];if(!_0xa467c3[_0x9ff2('0x33')][_0x9ff2('0x37')](_0x9ff2('0x38'))){_0x53503c[_0x9ff2('0x20')]=qs[_0x9ff2('0x20')](_0xa467c3[_0x9ff2('0x33')][_0x9ff2('0x20')]);_0x53503c['offset']=qs['offset'](_0xa467c3[_0x9ff2('0x33')][_0x9ff2('0x1e')]);}return _0xd3005d[_0x9ff2('0x51')](_0x53503c);}})['then'](function(_0x49cf83){if(_0x49cf83){return _0x49cf83?{'count':_0x121bf3,'rows':_0x49cf83}:null;}})[_0x9ff2('0x28')](respondWithResult(_0x16bf37,null))[_0x9ff2('0x45')](handleError(_0x16bf37,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index ef8ed8c..1b48a31 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 _0x4b84=['moment','path','rimraf','../../config/environment','Dynamics365Configuration','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b84,0x1cc));var _0x44b8=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x4b84[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b8('0x3'));var rimraf=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var attributes=require('./intDynamics365Configuration.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bde=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','api','bluebird'];(function(_0x2ff6e6,_0xa7317c){var _0x1a0ecc=function(_0x9dcbb3){while(--_0x9dcbb3){_0x2ff6e6['push'](_0x2ff6e6['shift']());}};_0x1a0ecc(++_0xa7317c);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3a9875,_0x3b5e4f){_0x3a9875=_0x3a9875-0x0;var _0x593d43=_0x9bde[_0x3a9875];return _0x593d43;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));module[_0xe9bd('0x8')]=function(_0x4fd7b8,_0x4763e9){return _0x4fd7b8[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'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 d47c0a6..44f6f66 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 _0x074a=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','info','request\x20sent','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message'];(function(_0x551b0a,_0x41348c){var _0x5dacb8=function(_0x1123cf){while(--_0x1123cf){_0x551b0a['push'](_0x551b0a['shift']());}};_0x5dacb8(++_0x41348c);}(_0x074a,0xab));var _0xa074=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x074a[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xa074('0x0'));var moment=require(_0xa074('0x1'));var BPromise=require(_0xa074('0x2'));var rs=require(_0xa074('0x3'));var fs=require('fs');var Redis=require(_0xa074('0x4'));var db=require(_0xa074('0x5'))['db'];var utils=require(_0xa074('0x6'));var logger=require(_0xa074('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa074('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26cd99,_0x4de9bc,_0x42d336){return new BPromise(function(_0x5d7c9f,_0x128fb4){return client[_0xa074('0x9')](_0x26cd99,_0x42d336)['then'](function(_0x45b89c){logger[_0xa074('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4de9bc,'request\x20sent');logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4de9bc,_0xa074('0xb'),JSON[_0xa074('0xc')](_0x45b89c));if(_0x45b89c[_0xa074('0xd')]){if(_0x45b89c['error']['code']===0x1f4){logger[_0xa074('0xd')](_0xa074('0xe'),_0x4de9bc,_0x45b89c[_0xa074('0xd')][_0xa074('0xf')]);return _0x128fb4(_0x45b89c[_0xa074('0xd')][_0xa074('0xf')]);}logger[_0xa074('0xd')](_0xa074('0xe'),_0x4de9bc,_0x45b89c['error'][_0xa074('0xf')]);return _0x5d7c9f(_0x45b89c[_0xa074('0xd')]['message']);}else{logger[_0xa074('0xa')](_0xa074('0xe'),_0x4de9bc,'request\x20sent');_0x5d7c9f(_0x45b89c['result']['message']);}})[_0xa074('0x10')](function(_0x49a8ef){logger[_0xa074('0xd')](_0xa074('0xe'),_0x4de9bc,_0x49a8ef);_0x128fb4(_0x49a8ef);});});} \ No newline at end of file +var _0x439c=['request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x1bc90a,_0x579aa1){var _0x3a0f8c=function(_0x44b567){while(--_0x44b567){_0x1bc90a['push'](_0x1bc90a['shift']());}};_0x3a0f8c(++_0x579aa1);}(_0x439c,0x87));var _0xc439=function(_0x2d54d6,_0x3fa088){_0x2d54d6=_0x2d54d6-0x0;var _0x5b0f69=_0x439c[_0x2d54d6];return _0x5b0f69;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc439('0x0'));var rs=require(_0xc439('0x1'));var fs=require('fs');var Redis=require(_0xc439('0x2'));var db=require(_0xc439('0x3'))['db'];var utils=require(_0xc439('0x4'));var logger=require('../../config/logger')(_0xc439('0x5'));var config=require(_0xc439('0x6'));var jayson=require(_0xc439('0x7'));var client=jayson[_0xc439('0x8')][_0xc439('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x517945,_0x5195ad,_0x447e93){return new BPromise(function(_0xfac479,_0x3c7472){return client['request'](_0x517945,_0x447e93)[_0xc439('0xa')](function(_0x34703c){logger[_0xc439('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5195ad,_0xc439('0xc'));logger[_0xc439('0xd')](_0xc439('0xe'),_0x5195ad,_0xc439('0xc'),JSON['stringify'](_0x34703c));if(_0x34703c[_0xc439('0xf')]){if(_0x34703c['error'][_0xc439('0x10')]===0x1f4){logger['error'](_0xc439('0x11'),_0x5195ad,_0x34703c[_0xc439('0xf')][_0xc439('0x12')]);return _0x3c7472(_0x34703c[_0xc439('0xf')][_0xc439('0x12')]);}logger['error'](_0xc439('0x11'),_0x5195ad,_0x34703c[_0xc439('0xf')][_0xc439('0x12')]);return _0xfac479(_0x34703c[_0xc439('0xf')][_0xc439('0x12')]);}else{logger[_0xc439('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5195ad,_0xc439('0xc'));_0xfac479(_0x34703c[_0xc439('0x13')]['message']);}})[_0xc439('0x14')](function(_0xae5681){logger[_0xc439('0xf')](_0xc439('0x11'),_0x5195ad,_0xae5681);_0x3c7472(_0xae5681);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 4208ffe..fec461c 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 _0xbf4c=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x509f69,_0x161340){var _0x5292a3=function(_0x206a8a){while(--_0x206a8a){_0x509f69['push'](_0x509f69['shift']());}};_0x5292a3(++_0x161340);}(_0xbf4c,0x1b8));var _0xcbf4=function(_0x10b8e0,_0x402dfd){_0x10b8e0=_0x10b8e0-0x0;var _0x5eafc2=_0xbf4c[_0x10b8e0];return _0x5eafc2;};'use strict';var multer=require(_0xcbf4('0x0'));var util=require('util');var path=require(_0xcbf4('0x1'));var timeout=require(_0xcbf4('0x2'));var express=require(_0xcbf4('0x3'));var router=express[_0xcbf4('0x4')]();var fs_extra=require(_0xcbf4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcbf4('0x6'));var config=require(_0xcbf4('0x7'));var controller=require(_0xcbf4('0x8'));router[_0xcbf4('0x9')]('/',auth[_0xcbf4('0xa')](),controller['index']);router[_0xcbf4('0x9')](_0xcbf4('0xb'),auth[_0xcbf4('0xa')](),controller[_0xcbf4('0xc')]);router[_0xcbf4('0xd')]('/',auth[_0xcbf4('0xa')](),controller[_0xcbf4('0xe')]);router[_0xcbf4('0xf')]('/:id',auth[_0xcbf4('0xa')](),controller['update']);router[_0xcbf4('0x10')](_0xcbf4('0xb'),auth[_0xcbf4('0xa')](),controller[_0xcbf4('0x11')]);module[_0xcbf4('0x12')]=router; \ No newline at end of file +var _0x6695=['create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x38079f,_0x17bb1e){var _0x3086a5=function(_0x53fb96){while(--_0x53fb96){_0x38079f['push'](_0x38079f['shift']());}};_0x3086a5(++_0x17bb1e);}(_0x6695,0xd8));var _0x5669=function(_0x18205e,_0x47323c){_0x18205e=_0x18205e-0x0;var _0x19cea9=_0x6695[_0x18205e];return _0x19cea9;};'use strict';var multer=require('multer');var util=require(_0x5669('0x0'));var path=require(_0x5669('0x1'));var timeout=require(_0x5669('0x2'));var express=require('express');var router=express[_0x5669('0x3')]();var fs_extra=require(_0x5669('0x4'));var auth=require(_0x5669('0x5'));var interaction=require(_0x5669('0x6'));var config=require(_0x5669('0x7'));var controller=require(_0x5669('0x8'));router['get']('/',auth[_0x5669('0x9')](),controller[_0x5669('0xa')]);router[_0x5669('0xb')](_0x5669('0xc'),auth['isAuthenticated'](),controller[_0x5669('0xd')]);router[_0x5669('0xe')]('/',auth[_0x5669('0x9')](),controller[_0x5669('0xf')]);router[_0x5669('0x10')](_0x5669('0xc'),auth[_0x5669('0x9')](),controller[_0x5669('0x11')]);router[_0x5669('0x12')](_0x5669('0xc'),auth['isAuthenticated'](),controller[_0x5669('0x13')]);module[_0x5669('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 481ab40..6469818 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 _0x5d64=['keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x46b6e5,_0x1e702c){var _0x3a039e=function(_0x37617d){while(--_0x37617d){_0x46b6e5['push'](_0x46b6e5['shift']());}};_0x3a039e(++_0x1e702c);}(_0x5d64,0x1f2));var _0x45d6=function(_0x28efad,_0x1a80b6){_0x28efad=_0x28efad-0x0;var _0x175cc8=_0x5d64[_0x28efad];return _0x175cc8;};'use strict';var Sequelize=require(_0x45d6('0x0'));module[_0x45d6('0x1')]={'type':{'type':Sequelize[_0x45d6('0x2')](_0x45d6('0x3'),_0x45d6('0x4'),_0x45d6('0x5'),_0x45d6('0x6'),_0x45d6('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x45d6('0x8')]},'key':{'type':Sequelize[_0x45d6('0x8')]},'keyType':{'type':Sequelize[_0x45d6('0x2')](_0x45d6('0x3'),'variable',_0x45d6('0x5'))},'keyContent':{'type':Sequelize[_0x45d6('0x8')]},'idField':{'type':Sequelize[_0x45d6('0x8')]},'nameField':{'type':Sequelize[_0x45d6('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x45d6('0x8')]}}; \ No newline at end of file +var _0xcfe6=['picklist','STRING','ENUM','BOOLEAN','sequelize','string','customVariable','keyValue'];(function(_0x41d6eb,_0x100ceb){var _0x64d1cb=function(_0x184758){while(--_0x184758){_0x41d6eb['push'](_0x41d6eb['shift']());}};_0x64d1cb(++_0x100ceb);}(_0xcfe6,0x18c));var _0x6cfe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcfe6[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x6cfe('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x6cfe('0x1'),'variable',_0x6cfe('0x2'),_0x6cfe('0x3'),_0x6cfe('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6cfe('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6cfe('0x6')](_0x6cfe('0x1'),'variable',_0x6cfe('0x2'))},'keyContent':{'type':Sequelize[_0x6cfe('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6cfe('0x5')]},'customField':{'type':Sequelize[_0x6cfe('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6cfe('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index ae056ce..5f4b0fb 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 _0x6ed5=['reject','save','update','then','destroy','sendStatus','name','send','index','map','Dynamics365Field','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body','find','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','count','set','Content-Range','json','apply'];(function(_0x541fb0,_0x1f5551){var _0x5f7025=function(_0x3bc8b1){while(--_0x3bc8b1){_0x541fb0['push'](_0x541fb0['shift']());}};_0x5f7025(++_0x1f5551);}(_0x6ed5,0x19c));var _0x56ed=function(_0x98478a,_0x593ccc){_0x98478a=_0x98478a-0x0;var _0x267c02=_0x6ed5[_0x98478a];return _0x267c02;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x56ed('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x56ed('0x1'));var moment=require(_0x56ed('0x2'));var BPromise=require(_0x56ed('0x3'));var Mustache=require(_0x56ed('0x4'));var util=require(_0x56ed('0x5'));var path=require(_0x56ed('0x6'));var sox=require(_0x56ed('0x7'));var csv=require(_0x56ed('0x8'));var ejs=require(_0x56ed('0x9'));var fs=require('fs');var fs_extra=require(_0x56ed('0xa'));var _=require(_0x56ed('0xb'));var squel=require(_0x56ed('0xc'));var crypto=require('crypto');var jsforce=require(_0x56ed('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x56ed('0x8'));var querystring=require('querystring');var Papa=require(_0x56ed('0xe'));var Redis=require(_0x56ed('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x56ed('0x10'));var as=require(_0x56ed('0x11'));var hardwareService=require(_0x56ed('0x12'));var logger=require(_0x56ed('0x13'))(_0x56ed('0x14'));var utils=require(_0x56ed('0x15'));var config=require(_0x56ed('0x16'));var licenseUtil=require(_0x56ed('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12dd79,_0x3a1bbd){_0x3a1bbd=_0x3a1bbd||0xcc;return function(_0xb9310a){if(_0xb9310a){return _0x12dd79['sendStatus'](_0x3a1bbd);}return _0x12dd79[_0x56ed('0x18')](_0x3a1bbd)[_0x56ed('0x19')]();};}function respondWithResult(_0x56ffe9,_0x2cffbe){_0x2cffbe=_0x2cffbe||0xc8;return function(_0x3c9981){if(_0x3c9981){return _0x56ffe9[_0x56ed('0x18')](_0x2cffbe)['json'](_0x3c9981);}};}function respondWithFilteredResult(_0x123969,_0x2db7a9){return function(_0x1b77a8){if(_0x1b77a8){var _0x258b9a=typeof _0x2db7a9[_0x56ed('0x1a')]==='undefined'&&typeof _0x2db7a9['limit']==='undefined';var _0x19ae25=_0x1b77a8['count'];var _0x59a650=_0x258b9a?0x0:_0x2db7a9[_0x56ed('0x1a')];var _0x3d0704=_0x258b9a?_0x1b77a8[_0x56ed('0x1b')]:_0x2db7a9[_0x56ed('0x1a')]+_0x2db7a9['limit'];var _0x314d9b;if(_0x3d0704>=_0x19ae25){_0x3d0704=_0x19ae25;_0x314d9b=0xc8;}else{_0x314d9b=0xce;}_0x123969[_0x56ed('0x18')](_0x314d9b);return _0x123969[_0x56ed('0x1c')](_0x56ed('0x1d'),_0x59a650+'-'+_0x3d0704+'/'+_0x19ae25)[_0x56ed('0x1e')](_0x1b77a8);}return null;};}function patchUpdates(_0x5dea6c){return function(_0x14687e){try{jsonpatch[_0x56ed('0x1f')](_0x14687e,_0x5dea6c,!![]);}catch(_0x20076f){return BPromise[_0x56ed('0x20')](_0x20076f);}return _0x14687e[_0x56ed('0x21')]();};}function saveUpdates(_0x5f498e,_0x454b6c){return function(_0xde24e4){if(_0xde24e4){return _0xde24e4[_0x56ed('0x22')](_0x5f498e)[_0x56ed('0x23')](function(_0x449ed0){return _0x449ed0;});}return null;};}function removeEntity(_0x20000c,_0x425e69){return function(_0x5b361b){if(_0x5b361b){return _0x5b361b[_0x56ed('0x24')]()[_0x56ed('0x23')](function(){_0x20000c[_0x56ed('0x18')](0xcc)[_0x56ed('0x19')]();});}};}function handleEntityNotFound(_0x5922d9,_0xbb63c0){return function(_0x4c2fe3){if(!_0x4c2fe3){_0x5922d9[_0x56ed('0x25')](0x194);}return _0x4c2fe3;};}function handleError(_0x40bf0e,_0x34b80e){_0x34b80e=_0x34b80e||0x1f4;return function(_0x199e74){logger['error'](_0x199e74['stack']);if(_0x199e74[_0x56ed('0x26')]){delete _0x199e74['name'];}_0x40bf0e[_0x56ed('0x18')](_0x34b80e)[_0x56ed('0x27')](_0x199e74);};}exports[_0x56ed('0x28')]=function(_0x212a49,_0x3dcb34){var _0x254e58={},_0x1546a0={},_0x588727={'count':0x0,'rows':[]};var _0x576065=_[_0x56ed('0x29')](db[_0x56ed('0x2a')]['rawAttributes'],function(_0x4cdd4f){return{'name':_0x4cdd4f[_0x56ed('0x2b')],'type':_0x4cdd4f['type'][_0x56ed('0x2c')]};});_0x1546a0[_0x56ed('0x2d')]=_[_0x56ed('0x29')](_0x576065,_0x56ed('0x26'));_0x1546a0[_0x56ed('0x2e')]=_[_0x56ed('0x2f')](_0x212a49[_0x56ed('0x2e')]);_0x1546a0[_0x56ed('0x30')]=_[_0x56ed('0x31')](_0x1546a0[_0x56ed('0x2d')],_0x1546a0[_0x56ed('0x2e')]);_0x254e58[_0x56ed('0x32')]=_[_0x56ed('0x31')](_0x1546a0[_0x56ed('0x2d')],qs[_0x56ed('0x33')](_0x212a49[_0x56ed('0x2e')][_0x56ed('0x33')]));_0x254e58[_0x56ed('0x32')]=_0x254e58[_0x56ed('0x32')][_0x56ed('0x34')]?_0x254e58[_0x56ed('0x32')]:_0x1546a0['model'];if(!_0x212a49[_0x56ed('0x2e')][_0x56ed('0x35')](_0x56ed('0x36'))){_0x254e58[_0x56ed('0x37')]=qs[_0x56ed('0x37')](_0x212a49['query'][_0x56ed('0x37')]);_0x254e58[_0x56ed('0x1a')]=qs['offset'](_0x212a49['query']['offset']);}_0x254e58['order']=qs[_0x56ed('0x38')](_0x212a49[_0x56ed('0x2e')][_0x56ed('0x38')]);_0x254e58['where']=qs[_0x56ed('0x30')](_['pick'](_0x212a49['query'],_0x1546a0[_0x56ed('0x30')]),_0x576065);if(_0x212a49['query'][_0x56ed('0x39')]){_0x254e58[_0x56ed('0x3a')]=_[_0x56ed('0x3b')](_0x254e58[_0x56ed('0x3a')],{'$or':_[_0x56ed('0x29')](_0x576065,function(_0x599fce){if(_0x599fce[_0x56ed('0x3c')]!==_0x56ed('0x3d')){var _0x300fc4={};_0x300fc4[_0x599fce[_0x56ed('0x26')]]={'$like':'%'+_0x212a49[_0x56ed('0x2e')][_0x56ed('0x39')]+'%'};return _0x300fc4;}})});}_0x254e58=_['merge']({},_0x254e58,_0x212a49[_0x56ed('0x3e')]);var _0x46d00e={'where':_0x254e58[_0x56ed('0x3a')]};return db[_0x56ed('0x2a')][_0x56ed('0x1b')](_0x46d00e)[_0x56ed('0x23')](function(_0x510527){_0x588727[_0x56ed('0x1b')]=_0x510527;if(_0x212a49[_0x56ed('0x2e')][_0x56ed('0x3f')]){_0x254e58['include']=[{'all':!![]}];}return db[_0x56ed('0x2a')][_0x56ed('0x40')](_0x254e58);})['then'](function(_0x58602a){_0x588727[_0x56ed('0x41')]=_0x58602a;return _0x588727;})[_0x56ed('0x23')](respondWithFilteredResult(_0x3dcb34,_0x254e58))[_0x56ed('0x42')](handleError(_0x3dcb34,null));};exports[_0x56ed('0x43')]=function(_0xc6d3c8,_0x3325f){var _0xe2cb08={'raw':!![],'where':{'id':_0xc6d3c8[_0x56ed('0x44')]['id']}},_0x3bba54={};_0x3bba54['model']=_[_0x56ed('0x2f')](db[_0x56ed('0x2a')][_0x56ed('0x45')]);_0x3bba54['query']=_[_0x56ed('0x2f')](_0xc6d3c8[_0x56ed('0x2e')]);_0x3bba54[_0x56ed('0x30')]=_[_0x56ed('0x31')](_0x3bba54[_0x56ed('0x2d')],_0x3bba54[_0x56ed('0x2e')]);_0xe2cb08[_0x56ed('0x32')]=_['intersection'](_0x3bba54[_0x56ed('0x2d')],qs[_0x56ed('0x33')](_0xc6d3c8[_0x56ed('0x2e')][_0x56ed('0x33')]));_0xe2cb08[_0x56ed('0x32')]=_0xe2cb08[_0x56ed('0x32')][_0x56ed('0x34')]?_0xe2cb08[_0x56ed('0x32')]:_0x3bba54[_0x56ed('0x2d')];if(_0xc6d3c8[_0x56ed('0x2e')]['includeAll']){_0xe2cb08[_0x56ed('0x46')]=[{'all':!![]}];}_0xe2cb08=_[_0x56ed('0x3b')]({},_0xe2cb08,_0xc6d3c8[_0x56ed('0x3e')]);return db[_0x56ed('0x2a')]['find'](_0xe2cb08)[_0x56ed('0x23')](handleEntityNotFound(_0x3325f,null))[_0x56ed('0x23')](respondWithResult(_0x3325f,null))[_0x56ed('0x42')](handleError(_0x3325f,null));};exports[_0x56ed('0x47')]=function(_0x15e4bd,_0x2eb54e){return db[_0x56ed('0x2a')]['create'](_0x15e4bd['body'],{})[_0x56ed('0x23')](respondWithResult(_0x2eb54e,0xc9))[_0x56ed('0x42')](handleError(_0x2eb54e,null));};exports[_0x56ed('0x22')]=function(_0x433ae6,_0xda090b){if(_0x433ae6[_0x56ed('0x48')]['id']){delete _0x433ae6[_0x56ed('0x48')]['id'];}return db[_0x56ed('0x2a')]['find']({'where':{'id':_0x433ae6['params']['id']}})['then'](handleEntityNotFound(_0xda090b,null))[_0x56ed('0x23')](saveUpdates(_0x433ae6['body'],null))[_0x56ed('0x23')](respondWithResult(_0xda090b,null))['catch'](handleError(_0xda090b,null));};exports[_0x56ed('0x24')]=function(_0x29eb02,_0x1063f2){return db['Dynamics365Field'][_0x56ed('0x49')]({'where':{'id':_0x29eb02[_0x56ed('0x44')]['id']}})[_0x56ed('0x23')](handleEntityNotFound(_0x1063f2,null))[_0x56ed('0x23')](removeEntity(_0x1063f2,null))['catch'](handleError(_0x1063f2,null));}; \ No newline at end of file +var _0x670a=['create','body','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','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','update','then','destroy','error','stack','name','send','index','map','Dynamics365Field','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','findAll','rows','catch','params','rawAttributes','include','options','find'];(function(_0x5b6553,_0x2526c4){var _0x5c9e87=function(_0x2ac608){while(--_0x2ac608){_0x5b6553['push'](_0x5b6553['shift']());}};_0x5c9e87(++_0x2526c4);}(_0x670a,0xe3));var _0xa670=function(_0x55dcc3,_0x1839bb){_0x55dcc3=_0x55dcc3-0x0;var _0x37be1c=_0x670a[_0x55dcc3];return _0x37be1c;};'use strict';var emlformat=require(_0xa670('0x0'));var rimraf=require(_0xa670('0x1'));var zipdir=require(_0xa670('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa670('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa670('0x4'));var util=require('util');var path=require(_0xa670('0x5'));var sox=require(_0xa670('0x6'));var csv=require(_0xa670('0x7'));var ejs=require(_0xa670('0x8'));var fs=require('fs');var fs_extra=require(_0xa670('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa670('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa670('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa670('0xc'));var Papa=require(_0xa670('0xd'));var Redis=require(_0xa670('0xe'));var authService=require(_0xa670('0xf'));var qs=require(_0xa670('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa670('0x11'));var logger=require(_0xa670('0x12'))(_0xa670('0x13'));var utils=require(_0xa670('0x14'));var config=require(_0xa670('0x15'));var licenseUtil=require(_0xa670('0x16'));var db=require(_0xa670('0x17'))['db'];function respondWithStatusCode(_0x351f7d,_0x416166){_0x416166=_0x416166||0xcc;return function(_0x5c9e40){if(_0x5c9e40){return _0x351f7d[_0xa670('0x18')](_0x416166);}return _0x351f7d[_0xa670('0x19')](_0x416166)[_0xa670('0x1a')]();};}function respondWithResult(_0x2461dd,_0x1fe33b){_0x1fe33b=_0x1fe33b||0xc8;return function(_0xcd2036){if(_0xcd2036){return _0x2461dd[_0xa670('0x19')](_0x1fe33b)[_0xa670('0x1b')](_0xcd2036);}};}function respondWithFilteredResult(_0x5e283d,_0x578f29){return function(_0x2ef7fe){if(_0x2ef7fe){var _0x344995=typeof _0x578f29[_0xa670('0x1c')]===_0xa670('0x1d')&&typeof _0x578f29[_0xa670('0x1e')]===_0xa670('0x1d');var _0x3d2e47=_0x2ef7fe['count'];var _0x3573e9=_0x344995?0x0:_0x578f29[_0xa670('0x1c')];var _0x3f5177=_0x344995?_0x2ef7fe[_0xa670('0x1f')]:_0x578f29[_0xa670('0x1c')]+_0x578f29[_0xa670('0x1e')];var _0x4cb003;if(_0x3f5177>=_0x3d2e47){_0x3f5177=_0x3d2e47;_0x4cb003=0xc8;}else{_0x4cb003=0xce;}_0x5e283d['status'](_0x4cb003);return _0x5e283d[_0xa670('0x20')](_0xa670('0x21'),_0x3573e9+'-'+_0x3f5177+'/'+_0x3d2e47)[_0xa670('0x1b')](_0x2ef7fe);}return null;};}function patchUpdates(_0x46b161){return function(_0x494fc7){try{jsonpatch[_0xa670('0x22')](_0x494fc7,_0x46b161,!![]);}catch(_0x273e2e){return BPromise['reject'](_0x273e2e);}return _0x494fc7['save']();};}function saveUpdates(_0x3dfe2a,_0x20449b){return function(_0x5822a5){if(_0x5822a5){return _0x5822a5[_0xa670('0x23')](_0x3dfe2a)[_0xa670('0x24')](function(_0x5d5fb0){return _0x5d5fb0;});}return null;};}function removeEntity(_0x52ba93,_0x219fc1){return function(_0x1f6a42){if(_0x1f6a42){return _0x1f6a42[_0xa670('0x25')]()[_0xa670('0x24')](function(){_0x52ba93['status'](0xcc)[_0xa670('0x1a')]();});}};}function handleEntityNotFound(_0x18e51b,_0x388997){return function(_0x27861b){if(!_0x27861b){_0x18e51b['sendStatus'](0x194);}return _0x27861b;};}function handleError(_0x359923,_0x539728){_0x539728=_0x539728||0x1f4;return function(_0x4b5f52){logger[_0xa670('0x26')](_0x4b5f52[_0xa670('0x27')]);if(_0x4b5f52['name']){delete _0x4b5f52[_0xa670('0x28')];}_0x359923[_0xa670('0x19')](_0x539728)[_0xa670('0x29')](_0x4b5f52);};}exports[_0xa670('0x2a')]=function(_0x4503ba,_0x5d5361){var _0x3b4d4e={},_0xddca07={},_0x22da3f={'count':0x0,'rows':[]};var _0x4f7790=_[_0xa670('0x2b')](db[_0xa670('0x2c')]['rawAttributes'],function(_0x295c4f){return{'name':_0x295c4f[_0xa670('0x2d')],'type':_0x295c4f[_0xa670('0x2e')][_0xa670('0x2f')]};});_0xddca07[_0xa670('0x30')]=_['map'](_0x4f7790,'name');_0xddca07[_0xa670('0x31')]=_[_0xa670('0x32')](_0x4503ba['query']);_0xddca07['filters']=_[_0xa670('0x33')](_0xddca07['model'],_0xddca07['query']);_0x3b4d4e['attributes']=_[_0xa670('0x33')](_0xddca07[_0xa670('0x30')],qs['fields'](_0x4503ba[_0xa670('0x31')][_0xa670('0x34')]));_0x3b4d4e[_0xa670('0x35')]=_0x3b4d4e['attributes'][_0xa670('0x36')]?_0x3b4d4e[_0xa670('0x35')]:_0xddca07[_0xa670('0x30')];if(!_0x4503ba[_0xa670('0x31')][_0xa670('0x37')](_0xa670('0x38'))){_0x3b4d4e['limit']=qs[_0xa670('0x1e')](_0x4503ba[_0xa670('0x31')]['limit']);_0x3b4d4e[_0xa670('0x1c')]=qs[_0xa670('0x1c')](_0x4503ba['query']['offset']);}_0x3b4d4e[_0xa670('0x39')]=qs[_0xa670('0x3a')](_0x4503ba[_0xa670('0x31')][_0xa670('0x3a')]);_0x3b4d4e[_0xa670('0x3b')]=qs[_0xa670('0x3c')](_[_0xa670('0x3d')](_0x4503ba[_0xa670('0x31')],_0xddca07['filters']),_0x4f7790);if(_0x4503ba[_0xa670('0x31')][_0xa670('0x3e')]){_0x3b4d4e[_0xa670('0x3b')]=_[_0xa670('0x3f')](_0x3b4d4e[_0xa670('0x3b')],{'$or':_[_0xa670('0x2b')](_0x4f7790,function(_0x534f58){if(_0x534f58[_0xa670('0x2e')]!=='VIRTUAL'){var _0x340962={};_0x340962[_0x534f58[_0xa670('0x28')]]={'$like':'%'+_0x4503ba[_0xa670('0x31')]['filter']+'%'};return _0x340962;}})});}_0x3b4d4e=_['merge']({},_0x3b4d4e,_0x4503ba['options']);var _0x2970c5={'where':_0x3b4d4e['where']};return db[_0xa670('0x2c')][_0xa670('0x1f')](_0x2970c5)['then'](function(_0x4d8eb6){_0x22da3f[_0xa670('0x1f')]=_0x4d8eb6;if(_0x4503ba[_0xa670('0x31')][_0xa670('0x40')]){_0x3b4d4e['include']=[{'all':!![]}];}return db[_0xa670('0x2c')][_0xa670('0x41')](_0x3b4d4e);})[_0xa670('0x24')](function(_0x5f27a9){_0x22da3f[_0xa670('0x42')]=_0x5f27a9;return _0x22da3f;})[_0xa670('0x24')](respondWithFilteredResult(_0x5d5361,_0x3b4d4e))[_0xa670('0x43')](handleError(_0x5d5361,null));};exports['show']=function(_0x854dac,_0x1b8f5c){var _0x51c64d={'raw':!![],'where':{'id':_0x854dac[_0xa670('0x44')]['id']}},_0xffdaf5={};_0xffdaf5[_0xa670('0x30')]=_[_0xa670('0x32')](db[_0xa670('0x2c')][_0xa670('0x45')]);_0xffdaf5['query']=_[_0xa670('0x32')](_0x854dac[_0xa670('0x31')]);_0xffdaf5[_0xa670('0x3c')]=_[_0xa670('0x33')](_0xffdaf5[_0xa670('0x30')],_0xffdaf5[_0xa670('0x31')]);_0x51c64d[_0xa670('0x35')]=_[_0xa670('0x33')](_0xffdaf5[_0xa670('0x30')],qs[_0xa670('0x34')](_0x854dac['query'][_0xa670('0x34')]));_0x51c64d[_0xa670('0x35')]=_0x51c64d[_0xa670('0x35')][_0xa670('0x36')]?_0x51c64d[_0xa670('0x35')]:_0xffdaf5['model'];if(_0x854dac[_0xa670('0x31')][_0xa670('0x40')]){_0x51c64d[_0xa670('0x46')]=[{'all':!![]}];}_0x51c64d=_['merge']({},_0x51c64d,_0x854dac[_0xa670('0x47')]);return db[_0xa670('0x2c')][_0xa670('0x48')](_0x51c64d)[_0xa670('0x24')](handleEntityNotFound(_0x1b8f5c,null))[_0xa670('0x24')](respondWithResult(_0x1b8f5c,null))[_0xa670('0x43')](handleError(_0x1b8f5c,null));};exports[_0xa670('0x49')]=function(_0x33eb47,_0xbaaf62){return db[_0xa670('0x2c')][_0xa670('0x49')](_0x33eb47[_0xa670('0x4a')],{})[_0xa670('0x24')](respondWithResult(_0xbaaf62,0xc9))['catch'](handleError(_0xbaaf62,null));};exports['update']=function(_0x12146f,_0x236f92){if(_0x12146f[_0xa670('0x4a')]['id']){delete _0x12146f[_0xa670('0x4a')]['id'];}return db[_0xa670('0x2c')][_0xa670('0x48')]({'where':{'id':_0x12146f['params']['id']}})[_0xa670('0x24')](handleEntityNotFound(_0x236f92,null))[_0xa670('0x24')](saveUpdates(_0x12146f[_0xa670('0x4a')],null))[_0xa670('0x24')](respondWithResult(_0x236f92,null))[_0xa670('0x43')](handleError(_0x236f92,null));};exports[_0xa670('0x25')]=function(_0x4d13b0,_0x16e7c1){return db['Dynamics365Field'][_0xa670('0x48')]({'where':{'id':_0x4d13b0[_0xa670('0x44')]['id']}})[_0xa670('0x24')](handleEntityNotFound(_0x16e7c1,null))[_0xa670('0x24')](removeEntity(_0x16e7c1,null))[_0xa670('0x43')](handleError(_0x16e7c1,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 86729c0..48910f2 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 _0xa68e=['define','dynamics365_unique_index','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes'];(function(_0x55d4c2,_0x37bb04){var _0x20cbb1=function(_0x19a2ba){while(--_0x19a2ba){_0x55d4c2['push'](_0x55d4c2['shift']());}};_0x20cbb1(++_0x37bb04);}(_0xa68e,0xaa));var _0xea68=function(_0x467cb0,_0x303070){_0x467cb0=_0x467cb0-0x0;var _0x2153f7=_0xa68e[_0x467cb0];return _0x2153f7;};'use strict';var _=require('lodash');var util=require(_0xea68('0x0'));var logger=require(_0xea68('0x1'))(_0xea68('0x2'));var moment=require(_0xea68('0x3'));var BPromise=require(_0xea68('0x4'));var rp=require(_0xea68('0x5'));var fs=require('fs');var path=require(_0xea68('0x6'));var rimraf=require(_0xea68('0x7'));var config=require(_0xea68('0x8'));var attributes=require(_0xea68('0x9'));module['exports']=function(_0x3035cc,_0x42e3c5){return _0x3035cc[_0xea68('0xa')]('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xea68('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xee9d=['Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','api','bluebird','path','rimraf','exports','define'];(function(_0x2faca6,_0x528c2c){var _0x1b1b5b=function(_0x5cd7cd){while(--_0x5cd7cd){_0x2faca6['push'](_0x2faca6['shift']());}};_0x1b1b5b(++_0x528c2c);}(_0xee9d,0x9f));var _0xdee9=function(_0x3f26ba,_0x10fabd){_0x3f26ba=_0x3f26ba-0x0;var _0x3c6cfa=_0xee9d[_0x3f26ba];return _0x3c6cfa;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xdee9('0x0'));var moment=require('moment');var BPromise=require(_0xdee9('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdee9('0x2'));var rimraf=require(_0xdee9('0x3'));var config=require('../../config/environment');var attributes=require('./intDynamics365Field.attributes');module[_0xdee9('0x4')]=function(_0x3bc7ed,_0x293b91){return _0x3bc7ed[_0xdee9('0x5')](_0xdee9('0x6'),attributes,{'tableName':_0xdee9('0x7'),'paranoid':![],'indexes':[{'name':_0xdee9('0x8'),'fields':[_0xdee9('0x9'),_0xdee9('0xa')],'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 ccbfe84..56b070e 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 _0xf3a6=['message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x52831d,_0x522977){var _0x43fddb=function(_0x4b146e){while(--_0x4b146e){_0x52831d['push'](_0x52831d['shift']());}};_0x43fddb(++_0x522977);}(_0xf3a6,0x17c));var _0x6f3a=function(_0x3a177b,_0x10d9fe){_0x3a177b=_0x3a177b-0x0;var _0x205959=_0xf3a6[_0x3a177b];return _0x205959;};'use strict';var _=require(_0x6f3a('0x0'));var util=require(_0x6f3a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6f3a('0x2'));var fs=require('fs');var Redis=require(_0x6f3a('0x3'));var db=require(_0x6f3a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6f3a('0x5'))(_0x6f3a('0x6'));var config=require(_0x6f3a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6f3a('0x8')][_0x6f3a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x306905,_0x2369ef,_0x34612d){return new BPromise(function(_0xb50b9,_0x2dcf33){return client[_0x6f3a('0xa')](_0x306905,_0x34612d)['then'](function(_0x7dff16){logger[_0x6f3a('0xb')](_0x6f3a('0xc'),_0x2369ef,_0x6f3a('0xd'));logger[_0x6f3a('0xe')](_0x6f3a('0xf'),_0x2369ef,_0x6f3a('0xd'),JSON[_0x6f3a('0x10')](_0x7dff16));if(_0x7dff16['error']){if(_0x7dff16[_0x6f3a('0x11')][_0x6f3a('0x12')]===0x1f4){logger['error'](_0x6f3a('0xc'),_0x2369ef,_0x7dff16[_0x6f3a('0x11')][_0x6f3a('0x13')]);return _0x2dcf33(_0x7dff16[_0x6f3a('0x11')]['message']);}logger[_0x6f3a('0x11')](_0x6f3a('0xc'),_0x2369ef,_0x7dff16[_0x6f3a('0x11')]['message']);return _0xb50b9(_0x7dff16['error'][_0x6f3a('0x13')]);}else{logger[_0x6f3a('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x2369ef,_0x6f3a('0xd'));_0xb50b9(_0x7dff16['result'][_0x6f3a('0x13')]);}})[_0x6f3a('0x14')](function(_0x25f32b){logger[_0x6f3a('0x11')](_0x6f3a('0xc'),_0x2369ef,_0x25f32b);_0x2dcf33(_0x25f32b);});});} \ No newline at end of file +var _0x2507=['result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x54a001,_0x2f6d72){var _0xac26e0=function(_0x3f8b24){while(--_0x3f8b24){_0x54a001['push'](_0x54a001['shift']());}};_0xac26e0(++_0x2f6d72);}(_0x2507,0x1ba));var _0x7250=function(_0x5c72f6,_0x303fc0){_0x5c72f6=_0x5c72f6-0x0;var _0x1207d7=_0x2507[_0x5c72f6];return _0x1207d7;};'use strict';var _=require(_0x7250('0x0'));var util=require('util');var moment=require(_0x7250('0x1'));var BPromise=require('bluebird');var rs=require(_0x7250('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7250('0x3'))['db'];var utils=require(_0x7250('0x4'));var logger=require('../../config/logger')(_0x7250('0x5'));var config=require(_0x7250('0x6'));var jayson=require(_0x7250('0x7'));var client=jayson[_0x7250('0x8')][_0x7250('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x549b17,_0x5d9bf2,_0x457574){return new BPromise(function(_0x4df9c7,_0x48f270){return client[_0x7250('0xa')](_0x549b17,_0x457574)[_0x7250('0xb')](function(_0x1dc5a0){logger[_0x7250('0xc')](_0x7250('0xd'),_0x5d9bf2,_0x7250('0xe'));logger[_0x7250('0xf')](_0x7250('0x10'),_0x5d9bf2,_0x7250('0xe'),JSON[_0x7250('0x11')](_0x1dc5a0));if(_0x1dc5a0['error']){if(_0x1dc5a0[_0x7250('0x12')]['code']===0x1f4){logger[_0x7250('0x12')](_0x7250('0xd'),_0x5d9bf2,_0x1dc5a0[_0x7250('0x12')][_0x7250('0x13')]);return _0x48f270(_0x1dc5a0['error'][_0x7250('0x13')]);}logger['error'](_0x7250('0xd'),_0x5d9bf2,_0x1dc5a0[_0x7250('0x12')][_0x7250('0x13')]);return _0x4df9c7(_0x1dc5a0[_0x7250('0x12')]['message']);}else{logger[_0x7250('0xc')](_0x7250('0xd'),_0x5d9bf2,_0x7250('0xe'));_0x4df9c7(_0x1dc5a0[_0x7250('0x14')][_0x7250('0x13')]);}})[_0x7250('0x15')](function(_0x1aa812){logger[_0x7250('0x12')](_0x7250('0xd'),_0x5d9bf2,_0x1aa812);_0x48f270(_0x1aa812);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 59e13b1..7da0abb 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 _0xc410=['./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','show','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1ef113,_0x3600a7){var _0x367b61=function(_0x56ce67){while(--_0x56ce67){_0x1ef113['push'](_0x1ef113['shift']());}};_0x367b61(++_0x3600a7);}(_0xc410,0xe6));var _0x0c41=function(_0x432d74,_0x51d55b){_0x432d74=_0x432d74-0x0;var _0x3b2daa=_0xc410[_0x432d74];return _0x3b2daa;};'use strict';var multer=require(_0x0c41('0x0'));var util=require(_0x0c41('0x1'));var path=require(_0x0c41('0x2'));var timeout=require(_0x0c41('0x3'));var express=require(_0x0c41('0x4'));var router=express[_0x0c41('0x5')]();var fs_extra=require(_0x0c41('0x6'));var auth=require(_0x0c41('0x7'));var interaction=require(_0x0c41('0x8'));var config=require(_0x0c41('0x9'));var controller=require(_0x0c41('0xa'));router[_0x0c41('0xb')]('/',auth['isAuthenticated'](),controller[_0x0c41('0xc')]);router[_0x0c41('0xb')](_0x0c41('0xd'),auth[_0x0c41('0xe')](),controller[_0x0c41('0xf')]);router[_0x0c41('0xb')]('/:id/configurations',auth[_0x0c41('0xe')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x0c41('0xe')](),controller[_0x0c41('0x10')]);router[_0x0c41('0x11')]('/',auth[_0x0c41('0xe')](),controller[_0x0c41('0x12')]);router[_0x0c41('0x11')](_0x0c41('0x13'),auth[_0x0c41('0xe')](),controller[_0x0c41('0x14')]);router[_0x0c41('0x15')](_0x0c41('0xd'),auth[_0x0c41('0xe')](),controller[_0x0c41('0x16')]);router[_0x0c41('0x17')](_0x0c41('0xd'),auth[_0x0c41('0xe')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9b19=['express','Router','fs-extra','../../components/interaction/service','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','put','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x25e1fd,_0x244fb6){var _0x311f26=function(_0x56e92c){while(--_0x56e92c){_0x25e1fd['push'](_0x25e1fd['shift']());}};_0x311f26(++_0x244fb6);}(_0x9b19,0xd9));var _0x99b1=function(_0x507597,_0x412525){_0x507597=_0x507597-0x0;var _0x110a0f=_0x9b19[_0x507597];return _0x110a0f;};'use strict';var multer=require(_0x99b1('0x0'));var util=require(_0x99b1('0x1'));var path=require('path');var timeout=require(_0x99b1('0x2'));var express=require(_0x99b1('0x3'));var router=express[_0x99b1('0x4')]();var fs_extra=require(_0x99b1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x99b1('0x6'));var config=require('../../config/environment');var controller=require(_0x99b1('0x7'));router[_0x99b1('0x8')]('/',auth['isAuthenticated'](),controller[_0x99b1('0x9')]);router[_0x99b1('0x8')](_0x99b1('0xa'),auth[_0x99b1('0xb')](),controller[_0x99b1('0xc')]);router['get'](_0x99b1('0xd'),auth[_0x99b1('0xb')](),controller['getConfigurations']);router['get'](_0x99b1('0xe'),auth[_0x99b1('0xb')](),controller[_0x99b1('0xf')]);router[_0x99b1('0x10')]('/',auth[_0x99b1('0xb')](),controller[_0x99b1('0x11')]);router['post'](_0x99b1('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x99b1('0x12')](_0x99b1('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x99b1('0x13')](_0x99b1('0xa'),auth[_0x99b1('0xb')](),controller[_0x99b1('0x14')]);module[_0x99b1('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 a6cfc42..76e37c3 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 _0x0120=['remoteUri','sequelize','exports','STRING','username'];(function(_0x366601,_0x1807aa){var _0x8dd90e=function(_0x18a3b9){while(--_0x18a3b9){_0x366601['push'](_0x366601['shift']());}};_0x8dd90e(++_0x1807aa);}(_0x0120,0x6f));var _0x0012=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x0120[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0x0012('0x0'));module[_0x0012('0x1')]={'name':{'type':Sequelize[_0x0012('0x2')]},'description':{'type':Sequelize[_0x0012('0x2')]},'username':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x3')},'apiKey':{'type':Sequelize[_0x0012('0x2')]},'remoteUri':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x4')},'serverUrl':{'type':Sequelize[_0x0012('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6a55=['STRING','sequelize'];(function(_0x331cce,_0x5dc2ae){var _0x5b7cb4=function(_0x3f3d3d){while(--_0x3f3d3d){_0x331cce['push'](_0x331cce['shift']());}};_0x5b7cb4(++_0x5dc2ae);}(_0x6a55,0xdb));var _0x56a5=function(_0x17882c,_0x4b964b){_0x17882c=_0x17882c-0x0;var _0x355a59=_0x6a55[_0x17882c];return _0x355a59;};'use strict';var Sequelize=require(_0x56a5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x56a5('0x1')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x56a5('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x56a5('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 15c5ec2..f92378d 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 _0xceb0=['channel','Descriptions','getDescriptions','FreshdeskConfiguration','FreshdeskField','remoteUri','apiKey','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','base64','requester','subject','description','group','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','end','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','getConfigurations','findOne','order','addConfiguration','Subjects','getSubjects'];(function(_0x28cefa,_0x296d46){var _0x1f22ee=function(_0x1d8f97){while(--_0x1d8f97){_0x28cefa['push'](_0x28cefa['shift']());}};_0x1f22ee(++_0x296d46);}(_0xceb0,0x173));var _0x0ceb=function(_0x23ca2e,_0x19758d){_0x23ca2e=_0x23ca2e-0x0;var _0x266df8=_0xceb0[_0x23ca2e];return _0x266df8;};'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(_0x0ceb('0x0'));var moment=require('moment');var BPromise=require(_0x0ceb('0x1'));var Mustache=require(_0x0ceb('0x2'));var util=require(_0x0ceb('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x0ceb('0x4'));var ejs=require(_0x0ceb('0x5'));var fs=require('fs');var fs_extra=require(_0x0ceb('0x6'));var _=require('lodash');var squel=require(_0x0ceb('0x7'));var crypto=require(_0x0ceb('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x0ceb('0x9'));var toCsv=require('to-csv');var querystring=require(_0x0ceb('0xa'));var Papa=require(_0x0ceb('0xb'));var Redis=require(_0x0ceb('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0ceb('0xd'));var hardwareService=require(_0x0ceb('0xe'));var logger=require(_0x0ceb('0xf'))(_0x0ceb('0x10'));var utils=require(_0x0ceb('0x11'));var config=require(_0x0ceb('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ceb('0x13'))['db'];var integrations=require(_0x0ceb('0x14'));function respondWithStatusCode(_0x358801,_0x26cb7a){_0x26cb7a=_0x26cb7a||0xcc;return function(_0x41f120){if(_0x41f120){return _0x358801[_0x0ceb('0x15')](_0x26cb7a);}return _0x358801[_0x0ceb('0x16')](_0x26cb7a)['end']();};}function respondWithResult(_0x416fbb,_0x54a173){_0x54a173=_0x54a173||0xc8;return function(_0x55620b){if(_0x55620b){return _0x416fbb[_0x0ceb('0x16')](_0x54a173)[_0x0ceb('0x17')](_0x55620b);}};}function respondWithFilteredResult(_0x218d6e,_0x536bdd){return function(_0x33a190){if(_0x33a190){var _0xc02d04=typeof _0x536bdd['offset']===_0x0ceb('0x18')&&typeof _0x536bdd[_0x0ceb('0x19')]===_0x0ceb('0x18');var _0x436a7c=_0x33a190[_0x0ceb('0x1a')];var _0x27fbeb=_0xc02d04?0x0:_0x536bdd[_0x0ceb('0x1b')];var _0x2a2eae=_0xc02d04?_0x33a190[_0x0ceb('0x1a')]:_0x536bdd[_0x0ceb('0x1b')]+_0x536bdd[_0x0ceb('0x19')];var _0x18f845;if(_0x2a2eae>=_0x436a7c){_0x2a2eae=_0x436a7c;_0x18f845=0xc8;}else{_0x18f845=0xce;}_0x218d6e[_0x0ceb('0x16')](_0x18f845);return _0x218d6e[_0x0ceb('0x1c')](_0x0ceb('0x1d'),_0x27fbeb+'-'+_0x2a2eae+'/'+_0x436a7c)[_0x0ceb('0x17')](_0x33a190);}return null;};}function patchUpdates(_0x241c07){return function(_0x5e13ad){try{jsonpatch['apply'](_0x5e13ad,_0x241c07,!![]);}catch(_0x25c48a){return BPromise[_0x0ceb('0x1e')](_0x25c48a);}return _0x5e13ad['save']();};}function saveUpdates(_0x2fd374,_0x54fce7){return function(_0x38a716){if(_0x38a716){return _0x38a716[_0x0ceb('0x1f')](_0x2fd374)[_0x0ceb('0x20')](function(_0x17efd7){return _0x17efd7;});}return null;};}function removeEntity(_0x27e058,_0x4a2b69){return function(_0x5c41dd){if(_0x5c41dd){return _0x5c41dd['destroy']()[_0x0ceb('0x20')](function(){_0x27e058['status'](0xcc)[_0x0ceb('0x21')]();});}};}function handleEntityNotFound(_0x4c3e4c,_0x45f2fe){return function(_0xa8be2a){if(!_0xa8be2a){_0x4c3e4c[_0x0ceb('0x15')](0x194);}return _0xa8be2a;};}function handleError(_0x72e51,_0x5a15ee){_0x5a15ee=_0x5a15ee||0x1f4;return function(_0x106916){logger[_0x0ceb('0x22')](_0x106916[_0x0ceb('0x23')]);if(_0x106916[_0x0ceb('0x24')]){delete _0x106916[_0x0ceb('0x24')];}_0x72e51['status'](_0x5a15ee)[_0x0ceb('0x25')](_0x106916);};}exports[_0x0ceb('0x26')]=function(_0x3c934b,_0x4427b8){var _0x1ca4cb={},_0x16265d={},_0x58aa8b={'count':0x0,'rows':[]};var _0x30adcb=_[_0x0ceb('0x27')](db[_0x0ceb('0x28')][_0x0ceb('0x29')],function(_0x331e98){return{'name':_0x331e98[_0x0ceb('0x2a')],'type':_0x331e98[_0x0ceb('0x2b')][_0x0ceb('0x2c')]};});_0x16265d[_0x0ceb('0x2d')]=_[_0x0ceb('0x27')](_0x30adcb,'name');_0x16265d[_0x0ceb('0x2e')]=_[_0x0ceb('0x2f')](_0x3c934b['query']);_0x16265d[_0x0ceb('0x30')]=_[_0x0ceb('0x31')](_0x16265d[_0x0ceb('0x2d')],_0x16265d['query']);_0x1ca4cb[_0x0ceb('0x32')]=_[_0x0ceb('0x31')](_0x16265d[_0x0ceb('0x2d')],qs[_0x0ceb('0x33')](_0x3c934b[_0x0ceb('0x2e')][_0x0ceb('0x33')]));_0x1ca4cb[_0x0ceb('0x32')]=_0x1ca4cb[_0x0ceb('0x32')][_0x0ceb('0x34')]?_0x1ca4cb[_0x0ceb('0x32')]:_0x16265d[_0x0ceb('0x2d')];if(!_0x3c934b[_0x0ceb('0x2e')][_0x0ceb('0x35')]('nolimit')){_0x1ca4cb[_0x0ceb('0x19')]=qs[_0x0ceb('0x19')](_0x3c934b[_0x0ceb('0x2e')][_0x0ceb('0x19')]);_0x1ca4cb[_0x0ceb('0x1b')]=qs[_0x0ceb('0x1b')](_0x3c934b['query'][_0x0ceb('0x1b')]);}_0x1ca4cb['order']=qs['sort'](_0x3c934b['query'][_0x0ceb('0x36')]);_0x1ca4cb['where']=qs[_0x0ceb('0x30')](_[_0x0ceb('0x37')](_0x3c934b['query'],_0x16265d[_0x0ceb('0x30')]),_0x30adcb);if(_0x3c934b[_0x0ceb('0x2e')][_0x0ceb('0x38')]){_0x1ca4cb['where']=_[_0x0ceb('0x39')](_0x1ca4cb[_0x0ceb('0x3a')],{'$or':_[_0x0ceb('0x27')](_0x30adcb,function(_0x8b0683){if(_0x8b0683[_0x0ceb('0x2b')]!==_0x0ceb('0x3b')){var _0x31d20e={};_0x31d20e[_0x8b0683[_0x0ceb('0x24')]]={'$like':'%'+_0x3c934b[_0x0ceb('0x2e')][_0x0ceb('0x38')]+'%'};return _0x31d20e;}})});}_0x1ca4cb=_[_0x0ceb('0x39')]({},_0x1ca4cb,_0x3c934b[_0x0ceb('0x3c')]);var _0x3c3813={'where':_0x1ca4cb[_0x0ceb('0x3a')]};return db[_0x0ceb('0x28')][_0x0ceb('0x1a')](_0x3c3813)[_0x0ceb('0x20')](function(_0x3de5c7){_0x58aa8b[_0x0ceb('0x1a')]=_0x3de5c7;if(_0x3c934b[_0x0ceb('0x2e')][_0x0ceb('0x3d')]){_0x1ca4cb[_0x0ceb('0x3e')]=[{'all':!![]}];}return db[_0x0ceb('0x28')][_0x0ceb('0x3f')](_0x1ca4cb);})[_0x0ceb('0x20')](function(_0x146bb8){_0x58aa8b[_0x0ceb('0x40')]=_0x146bb8;return _0x58aa8b;})[_0x0ceb('0x20')](respondWithFilteredResult(_0x4427b8,_0x1ca4cb))['catch'](handleError(_0x4427b8,null));};exports[_0x0ceb('0x41')]=function(_0x4d1972,_0x482889){var _0x3d2607={'raw':![],'where':{'id':_0x4d1972[_0x0ceb('0x42')]['id']}},_0x6ad0e3={};_0x6ad0e3['model']=_['keys'](db[_0x0ceb('0x28')][_0x0ceb('0x29')]);_0x6ad0e3[_0x0ceb('0x2e')]=_[_0x0ceb('0x2f')](_0x4d1972[_0x0ceb('0x2e')]);_0x6ad0e3[_0x0ceb('0x30')]=_[_0x0ceb('0x31')](_0x6ad0e3[_0x0ceb('0x2d')],_0x6ad0e3[_0x0ceb('0x2e')]);_0x3d2607['attributes']=_[_0x0ceb('0x31')](_0x6ad0e3[_0x0ceb('0x2d')],qs[_0x0ceb('0x33')](_0x4d1972[_0x0ceb('0x2e')]['fields']));_0x3d2607[_0x0ceb('0x32')]=_0x3d2607['attributes'][_0x0ceb('0x34')]?_0x3d2607['attributes']:_0x6ad0e3[_0x0ceb('0x2d')];if(_0x4d1972[_0x0ceb('0x2e')][_0x0ceb('0x3d')]){_0x3d2607[_0x0ceb('0x3e')]=[{'all':!![]}];}_0x3d2607=_[_0x0ceb('0x39')]({},_0x3d2607,_0x4d1972[_0x0ceb('0x3c')]);return db[_0x0ceb('0x28')][_0x0ceb('0x43')](_0x3d2607)['then'](handleEntityNotFound(_0x482889,null))[_0x0ceb('0x20')](respondWithResult(_0x482889,null))[_0x0ceb('0x44')](handleError(_0x482889,null));};exports['create']=function(_0x3898fe,_0x24efd4){return db[_0x0ceb('0x28')][_0x0ceb('0x45')](_0x3898fe[_0x0ceb('0x46')],{})['then'](respondWithResult(_0x24efd4,0xc9))[_0x0ceb('0x44')](handleError(_0x24efd4,null));};exports[_0x0ceb('0x1f')]=function(_0x1a7c52,_0xf17e0b){if(_0x1a7c52[_0x0ceb('0x46')]['id']){delete _0x1a7c52[_0x0ceb('0x46')]['id'];}return db[_0x0ceb('0x28')][_0x0ceb('0x43')]({'where':{'id':_0x1a7c52[_0x0ceb('0x42')]['id']}})['then'](handleEntityNotFound(_0xf17e0b,null))[_0x0ceb('0x20')](saveUpdates(_0x1a7c52[_0x0ceb('0x46')],null))[_0x0ceb('0x20')](respondWithResult(_0xf17e0b,null))[_0x0ceb('0x44')](handleError(_0xf17e0b,null));};exports['destroy']=function(_0x4aef77,_0x34a427){return db[_0x0ceb('0x28')][_0x0ceb('0x43')]({'where':{'id':_0x4aef77[_0x0ceb('0x42')]['id']}})[_0x0ceb('0x20')](handleEntityNotFound(_0x34a427,null))['then'](removeEntity(_0x34a427,null))[_0x0ceb('0x44')](handleError(_0x34a427,null));};exports[_0x0ceb('0x47')]=function(_0x4c420c,_0x4c70ab,_0x483570){var _0x348381={};var _0x33a79b={};var _0x13fa76;var _0x47c4d6;return db[_0x0ceb('0x28')][_0x0ceb('0x48')]({'where':{'id':_0x4c420c['params']['id']}})[_0x0ceb('0x20')](handleEntityNotFound(_0x4c70ab,null))[_0x0ceb('0x20')](function(_0x2d4947){if(_0x2d4947){_0x13fa76=_0x2d4947;_0x33a79b['model']=_[_0x0ceb('0x2f')](db['FreshdeskConfiguration'][_0x0ceb('0x29')]);_0x33a79b[_0x0ceb('0x2e')]=_[_0x0ceb('0x2f')](_0x4c420c[_0x0ceb('0x2e')]);_0x33a79b[_0x0ceb('0x30')]=_['intersection'](_0x33a79b[_0x0ceb('0x2d')],_0x33a79b[_0x0ceb('0x2e')]);_0x348381[_0x0ceb('0x32')]=_[_0x0ceb('0x31')](_0x33a79b[_0x0ceb('0x2d')],qs[_0x0ceb('0x33')](_0x4c420c[_0x0ceb('0x2e')][_0x0ceb('0x33')]));_0x348381[_0x0ceb('0x32')]=_0x348381[_0x0ceb('0x32')]['length']?_0x348381[_0x0ceb('0x32')]:_0x33a79b[_0x0ceb('0x2d')];_0x348381[_0x0ceb('0x49')]=qs[_0x0ceb('0x36')](_0x4c420c[_0x0ceb('0x2e')][_0x0ceb('0x36')]);_0x348381[_0x0ceb('0x3a')]=qs['filters'](_[_0x0ceb('0x37')](_0x4c420c[_0x0ceb('0x2e')],_0x33a79b[_0x0ceb('0x30')]));if(_0x4c420c[_0x0ceb('0x2e')][_0x0ceb('0x38')]){_0x348381[_0x0ceb('0x3a')]=_[_0x0ceb('0x39')](_0x348381[_0x0ceb('0x3a')],{'$or':_[_0x0ceb('0x27')](_0x348381[_0x0ceb('0x32')],function(_0x42a084){var _0x4d363e={};_0x4d363e[_0x42a084]={'$like':'%'+_0x4c420c[_0x0ceb('0x2e')][_0x0ceb('0x38')]+'%'};return _0x4d363e;})});}_0x348381=_[_0x0ceb('0x39')]({},_0x348381,_0x4c420c[_0x0ceb('0x3c')]);return _0x13fa76[_0x0ceb('0x47')](_0x348381);}})['then'](function(_0x5afd08){if(_0x5afd08){_0x47c4d6=_0x5afd08[_0x0ceb('0x34')];if(!_0x4c420c['query'][_0x0ceb('0x35')]('nolimit')){_0x348381[_0x0ceb('0x19')]=qs[_0x0ceb('0x19')](_0x4c420c[_0x0ceb('0x2e')][_0x0ceb('0x19')]);_0x348381[_0x0ceb('0x1b')]=qs['offset'](_0x4c420c[_0x0ceb('0x2e')][_0x0ceb('0x1b')]);}return _0x13fa76[_0x0ceb('0x47')](_0x348381);}})[_0x0ceb('0x20')](function(_0x4412f0){if(_0x4412f0){return _0x4412f0?{'count':_0x47c4d6,'rows':_0x4412f0}:null;}})[_0x0ceb('0x20')](respondWithResult(_0x4c70ab,null))['catch'](handleError(_0x4c70ab,null));};exports[_0x0ceb('0x4a')]=function(_0x11c6c8,_0x1d224c,_0x2b688f){if(_0x11c6c8['body']['id']){delete _0x11c6c8['body']['id'];}return db[_0x0ceb('0x28')][_0x0ceb('0x48')]({'where':{'id':_0x11c6c8[_0x0ceb('0x42')]['id']}})[_0x0ceb('0x20')](handleEntityNotFound(_0x1d224c,null))[_0x0ceb('0x20')](function(_0x27bc5e){if(_0x27bc5e){_0x11c6c8[_0x0ceb('0x46')]['AccountId']=_0x27bc5e['id'];_0x11c6c8[_0x0ceb('0x46')][_0x0ceb('0x4b')]=integrations[_0x0ceb('0x4c')](_0x11c6c8[_0x0ceb('0x46')][_0x0ceb('0x4d')],_0x11c6c8[_0x0ceb('0x46')][_0x0ceb('0x2b')]);_0x11c6c8[_0x0ceb('0x46')][_0x0ceb('0x4e')]=integrations[_0x0ceb('0x4f')](_0x11c6c8[_0x0ceb('0x46')]['channel'],_0x11c6c8[_0x0ceb('0x46')][_0x0ceb('0x2b')]);return db[_0x0ceb('0x50')][_0x0ceb('0x45')](_0x11c6c8[_0x0ceb('0x46')],{'include':[{'model':db[_0x0ceb('0x51')],'as':_0x0ceb('0x4b')},{'model':db['FreshdeskField'],'as':_0x0ceb('0x4e')}]});}return null;})[_0x0ceb('0x20')](respondWithResult(_0x1d224c,null))[_0x0ceb('0x44')](handleError(_0x1d224c,null));};exports['getFields']=function(_0x3f5c74,_0x25903d,_0x363b23){var _0x126a03='';return db[_0x0ceb('0x28')][_0x0ceb('0x48')]({'where':{'id':_0x3f5c74[_0x0ceb('0x42')]['id']},'attributes':['id',_0x0ceb('0x52'),_0x0ceb('0x53')]})[_0x0ceb('0x20')](handleEntityNotFound(_0x25903d,null))['then'](function(_0x547459){if(_0x547459){_0x126a03=_0x547459[_0x0ceb('0x52')];var _0x16bfcd=_0x126a03['slice'](-0x1);if(_0x16bfcd==='/'){_0x126a03=_0x126a03[_0x0ceb('0x54')](0x0,_0x126a03[_0x0ceb('0x55')](_0x16bfcd));}return rp({'method':_0x0ceb('0x56'),'uri':util['format'](_0x0ceb('0x57'),_0x126a03,_0x0ceb('0x58')),'headers':{'Authorization':util[_0x0ceb('0x59')](_0x0ceb('0x5a'),new Buffer(util[_0x0ceb('0x59')]('%s:X',_0x547459['apiKey']))['toString'](_0x0ceb('0x5b')))},'json':!![]});}})['then'](function(_0x162e78){if(_0x162e78){var _0x29479c=[_0x0ceb('0x5c'),_0x0ceb('0x5d'),'agent',_0x0ceb('0x5e'),_0x0ceb('0x16'),'priority',_0x0ceb('0x5f'),'source',_0x0ceb('0x60'),_0x0ceb('0x5f'),_0x0ceb('0x61')];_[_0x0ceb('0x62')](_0x162e78,function(_0x5da5f6){return _0x29479c[_0x0ceb('0x63')](_0x5da5f6[_0x0ceb('0x24')])||!_0x5da5f6[_0x0ceb('0x64')]&&_0x5da5f6['type']!==_0x0ceb('0x65')&&_0x5da5f6['type']!==_0x0ceb('0x66');});return{'count':_0x162e78[_0x0ceb('0x34')],'rows':_[_0x0ceb('0x27')](_0x162e78,function(_0x43dd7b){return{'id':_0x43dd7b[_0x0ceb('0x24')],'name':_0x43dd7b[_0x0ceb('0x67')],'custom':!_0x43dd7b['default'],'options':_0x43dd7b[_0x0ceb('0x68')]?_[_0x0ceb('0x27')](_0x43dd7b[_0x0ceb('0x68')],function(_0x27942d){return{'name':_[_0x0ceb('0x69')](_0x27942d),'value':_0x27942d};}):[]};})};}})[_0x0ceb('0x20')](respondWithResult(_0x25903d,null))[_0x0ceb('0x44')](function(_0x448051){var _0x5cba25=_0x3f5c74[_0x0ceb('0x2e')][_0x0ceb('0x6a')]?0x1f4:_0x448051[_0x0ceb('0x6b')]||0x1f4;logger['error'](_0x0ceb('0x6c'),_0x0ceb('0x6d'),_0x5cba25,JSON[_0x0ceb('0x6e')](_0x448051));delete _0x448051['name'];if(_0x5cba25===0x191){_0x5cba25=0x190;}_0x25903d[_0x0ceb('0x16')](_0x5cba25)['send'](_0x3f5c74['query'][_0x0ceb('0x6a')]?{'message':_0x0ceb('0x6f'),'statusCode':_0x448051['statusCode']}:_0x448051);});}; \ No newline at end of file +var _0x9a62=['util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','params','length','find','create','body','getConfigurations','findOne','pick','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:X','toString','base64','subject','description','group','source','ticket_type','company','remove','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment'];(function(_0x2e1fcf,_0x1c8494){var _0x130938=function(_0x16313d){while(--_0x16313d){_0x2e1fcf['push'](_0x2e1fcf['shift']());}};_0x130938(++_0x1c8494);}(_0x9a62,0x1bc));var _0x29a6=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9a62[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x29a6('0x0'));var zipdir=require(_0x29a6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29a6('0x2'));var moment=require(_0x29a6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x29a6('0x4'));var path=require(_0x29a6('0x5'));var sox=require(_0x29a6('0x6'));var csv=require(_0x29a6('0x7'));var ejs=require(_0x29a6('0x8'));var fs=require('fs');var fs_extra=require(_0x29a6('0x9'));var _=require(_0x29a6('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x29a6('0xb'));var deskjs=require(_0x29a6('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x29a6('0xd'));var Redis=require(_0x29a6('0xe'));var authService=require(_0x29a6('0xf'));var qs=require(_0x29a6('0x10'));var as=require(_0x29a6('0x11'));var hardwareService=require(_0x29a6('0x12'));var logger=require(_0x29a6('0x13'))('api');var utils=require(_0x29a6('0x14'));var config=require(_0x29a6('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1d78fa,_0x7acc03){_0x7acc03=_0x7acc03||0xcc;return function(_0x5e2abb){if(_0x5e2abb){return _0x1d78fa[_0x29a6('0x16')](_0x7acc03);}return _0x1d78fa[_0x29a6('0x17')](_0x7acc03)['end']();};}function respondWithResult(_0x50c663,_0x36d6fd){_0x36d6fd=_0x36d6fd||0xc8;return function(_0x186afa){if(_0x186afa){return _0x50c663['status'](_0x36d6fd)[_0x29a6('0x18')](_0x186afa);}};}function respondWithFilteredResult(_0x22378a,_0x307dd9){return function(_0x4fef5c){if(_0x4fef5c){var _0x862659=typeof _0x307dd9[_0x29a6('0x19')]===_0x29a6('0x1a')&&typeof _0x307dd9[_0x29a6('0x1b')]===_0x29a6('0x1a');var _0x340d75=_0x4fef5c[_0x29a6('0x1c')];var _0x34b66e=_0x862659?0x0:_0x307dd9['offset'];var _0x196882=_0x862659?_0x4fef5c['count']:_0x307dd9[_0x29a6('0x19')]+_0x307dd9[_0x29a6('0x1b')];var _0xdc0ff6;if(_0x196882>=_0x340d75){_0x196882=_0x340d75;_0xdc0ff6=0xc8;}else{_0xdc0ff6=0xce;}_0x22378a['status'](_0xdc0ff6);return _0x22378a[_0x29a6('0x1d')]('Content-Range',_0x34b66e+'-'+_0x196882+'/'+_0x340d75)['json'](_0x4fef5c);}return null;};}function patchUpdates(_0x5a8d55){return function(_0x152b00){try{jsonpatch[_0x29a6('0x1e')](_0x152b00,_0x5a8d55,!![]);}catch(_0x2065be){return BPromise[_0x29a6('0x1f')](_0x2065be);}return _0x152b00[_0x29a6('0x20')]();};}function saveUpdates(_0x552bc7,_0x13341e){return function(_0xae08a5){if(_0xae08a5){return _0xae08a5[_0x29a6('0x21')](_0x552bc7)[_0x29a6('0x22')](function(_0x46fcc7){return _0x46fcc7;});}return null;};}function removeEntity(_0x2dc6c0,_0xedfa4){return function(_0x51761e){if(_0x51761e){return _0x51761e[_0x29a6('0x23')]()[_0x29a6('0x22')](function(){_0x2dc6c0[_0x29a6('0x17')](0xcc)[_0x29a6('0x24')]();});}};}function handleEntityNotFound(_0x1798dd,_0x17b835){return function(_0x364e72){if(!_0x364e72){_0x1798dd['sendStatus'](0x194);}return _0x364e72;};}function handleError(_0x483d22,_0x5a67df){_0x5a67df=_0x5a67df||0x1f4;return function(_0x1bcbf1){logger[_0x29a6('0x25')](_0x1bcbf1[_0x29a6('0x26')]);if(_0x1bcbf1[_0x29a6('0x27')]){delete _0x1bcbf1[_0x29a6('0x27')];}_0x483d22['status'](_0x5a67df)['send'](_0x1bcbf1);};}exports[_0x29a6('0x28')]=function(_0x3607b3,_0x4c5cb8){var _0x454df0={},_0x2b6b35={},_0x4fa41e={'count':0x0,'rows':[]};var _0x5a5cea=_[_0x29a6('0x29')](db[_0x29a6('0x2a')][_0x29a6('0x2b')],function(_0x4250f4){return{'name':_0x4250f4[_0x29a6('0x2c')],'type':_0x4250f4[_0x29a6('0x2d')]['key']};});_0x2b6b35['model']=_[_0x29a6('0x29')](_0x5a5cea,_0x29a6('0x27'));_0x2b6b35[_0x29a6('0x2e')]=_[_0x29a6('0x2f')](_0x3607b3[_0x29a6('0x2e')]);_0x2b6b35[_0x29a6('0x30')]=_[_0x29a6('0x31')](_0x2b6b35['model'],_0x2b6b35[_0x29a6('0x2e')]);_0x454df0[_0x29a6('0x32')]=_[_0x29a6('0x31')](_0x2b6b35[_0x29a6('0x33')],qs[_0x29a6('0x34')](_0x3607b3[_0x29a6('0x2e')][_0x29a6('0x34')]));_0x454df0[_0x29a6('0x32')]=_0x454df0[_0x29a6('0x32')]['length']?_0x454df0[_0x29a6('0x32')]:_0x2b6b35[_0x29a6('0x33')];if(!_0x3607b3[_0x29a6('0x2e')][_0x29a6('0x35')](_0x29a6('0x36'))){_0x454df0[_0x29a6('0x1b')]=qs[_0x29a6('0x1b')](_0x3607b3['query']['limit']);_0x454df0['offset']=qs[_0x29a6('0x19')](_0x3607b3[_0x29a6('0x2e')][_0x29a6('0x19')]);}_0x454df0[_0x29a6('0x37')]=qs[_0x29a6('0x38')](_0x3607b3[_0x29a6('0x2e')]['sort']);_0x454df0[_0x29a6('0x39')]=qs[_0x29a6('0x30')](_['pick'](_0x3607b3[_0x29a6('0x2e')],_0x2b6b35[_0x29a6('0x30')]),_0x5a5cea);if(_0x3607b3['query'][_0x29a6('0x3a')]){_0x454df0[_0x29a6('0x39')]=_[_0x29a6('0x3b')](_0x454df0['where'],{'$or':_[_0x29a6('0x29')](_0x5a5cea,function(_0x3c35b6){if(_0x3c35b6[_0x29a6('0x2d')]!=='VIRTUAL'){var _0x50ab51={};_0x50ab51[_0x3c35b6[_0x29a6('0x27')]]={'$like':'%'+_0x3607b3['query'][_0x29a6('0x3a')]+'%'};return _0x50ab51;}})});}_0x454df0=_[_0x29a6('0x3b')]({},_0x454df0,_0x3607b3['options']);var _0x1a428f={'where':_0x454df0[_0x29a6('0x39')]};return db[_0x29a6('0x2a')][_0x29a6('0x1c')](_0x1a428f)[_0x29a6('0x22')](function(_0xc0e144){_0x4fa41e[_0x29a6('0x1c')]=_0xc0e144;if(_0x3607b3[_0x29a6('0x2e')][_0x29a6('0x3c')]){_0x454df0[_0x29a6('0x3d')]=[{'all':!![]}];}return db[_0x29a6('0x2a')][_0x29a6('0x3e')](_0x454df0);})[_0x29a6('0x22')](function(_0x54b0b1){_0x4fa41e[_0x29a6('0x3f')]=_0x54b0b1;return _0x4fa41e;})[_0x29a6('0x22')](respondWithFilteredResult(_0x4c5cb8,_0x454df0))[_0x29a6('0x40')](handleError(_0x4c5cb8,null));};exports['show']=function(_0x3b71ad,_0x5300ee){var _0x46dc89={'raw':![],'where':{'id':_0x3b71ad[_0x29a6('0x41')]['id']}},_0x2e14af={};_0x2e14af[_0x29a6('0x33')]=_['keys'](db[_0x29a6('0x2a')][_0x29a6('0x2b')]);_0x2e14af[_0x29a6('0x2e')]=_['keys'](_0x3b71ad[_0x29a6('0x2e')]);_0x2e14af[_0x29a6('0x30')]=_['intersection'](_0x2e14af[_0x29a6('0x33')],_0x2e14af[_0x29a6('0x2e')]);_0x46dc89[_0x29a6('0x32')]=_[_0x29a6('0x31')](_0x2e14af[_0x29a6('0x33')],qs[_0x29a6('0x34')](_0x3b71ad[_0x29a6('0x2e')][_0x29a6('0x34')]));_0x46dc89[_0x29a6('0x32')]=_0x46dc89[_0x29a6('0x32')][_0x29a6('0x42')]?_0x46dc89[_0x29a6('0x32')]:_0x2e14af[_0x29a6('0x33')];if(_0x3b71ad[_0x29a6('0x2e')][_0x29a6('0x3c')]){_0x46dc89[_0x29a6('0x3d')]=[{'all':!![]}];}_0x46dc89=_['merge']({},_0x46dc89,_0x3b71ad['options']);return db['FreshdeskAccount'][_0x29a6('0x43')](_0x46dc89)['then'](handleEntityNotFound(_0x5300ee,null))[_0x29a6('0x22')](respondWithResult(_0x5300ee,null))['catch'](handleError(_0x5300ee,null));};exports['create']=function(_0x25995e,_0x57e994){return db[_0x29a6('0x2a')][_0x29a6('0x44')](_0x25995e['body'],{})[_0x29a6('0x22')](respondWithResult(_0x57e994,0xc9))[_0x29a6('0x40')](handleError(_0x57e994,null));};exports[_0x29a6('0x21')]=function(_0x477085,_0x453ba7){if(_0x477085[_0x29a6('0x45')]['id']){delete _0x477085[_0x29a6('0x45')]['id'];}return db[_0x29a6('0x2a')][_0x29a6('0x43')]({'where':{'id':_0x477085[_0x29a6('0x41')]['id']}})['then'](handleEntityNotFound(_0x453ba7,null))[_0x29a6('0x22')](saveUpdates(_0x477085[_0x29a6('0x45')],null))[_0x29a6('0x22')](respondWithResult(_0x453ba7,null))[_0x29a6('0x40')](handleError(_0x453ba7,null));};exports['destroy']=function(_0x3252cd,_0x36ce7e){return db['FreshdeskAccount']['find']({'where':{'id':_0x3252cd['params']['id']}})[_0x29a6('0x22')](handleEntityNotFound(_0x36ce7e,null))[_0x29a6('0x22')](removeEntity(_0x36ce7e,null))[_0x29a6('0x40')](handleError(_0x36ce7e,null));};exports[_0x29a6('0x46')]=function(_0x5cf8cf,_0x3c3262,_0x32327b){var _0x5af0be={};var _0x342585={};var _0x1eacb0;var _0x40f52b;return db[_0x29a6('0x2a')][_0x29a6('0x47')]({'where':{'id':_0x5cf8cf[_0x29a6('0x41')]['id']}})['then'](handleEntityNotFound(_0x3c3262,null))[_0x29a6('0x22')](function(_0x371313){if(_0x371313){_0x1eacb0=_0x371313;_0x342585['model']=_[_0x29a6('0x2f')](db['FreshdeskConfiguration'][_0x29a6('0x2b')]);_0x342585['query']=_[_0x29a6('0x2f')](_0x5cf8cf[_0x29a6('0x2e')]);_0x342585[_0x29a6('0x30')]=_[_0x29a6('0x31')](_0x342585['model'],_0x342585[_0x29a6('0x2e')]);_0x5af0be[_0x29a6('0x32')]=_[_0x29a6('0x31')](_0x342585['model'],qs['fields'](_0x5cf8cf['query']['fields']));_0x5af0be['attributes']=_0x5af0be[_0x29a6('0x32')][_0x29a6('0x42')]?_0x5af0be['attributes']:_0x342585[_0x29a6('0x33')];_0x5af0be['order']=qs[_0x29a6('0x38')](_0x5cf8cf[_0x29a6('0x2e')][_0x29a6('0x38')]);_0x5af0be[_0x29a6('0x39')]=qs[_0x29a6('0x30')](_[_0x29a6('0x48')](_0x5cf8cf[_0x29a6('0x2e')],_0x342585[_0x29a6('0x30')]));if(_0x5cf8cf[_0x29a6('0x2e')]['filter']){_0x5af0be[_0x29a6('0x39')]=_[_0x29a6('0x3b')](_0x5af0be['where'],{'$or':_[_0x29a6('0x29')](_0x5af0be[_0x29a6('0x32')],function(_0x317803){var _0x569944={};_0x569944[_0x317803]={'$like':'%'+_0x5cf8cf['query'][_0x29a6('0x3a')]+'%'};return _0x569944;})});}_0x5af0be=_[_0x29a6('0x3b')]({},_0x5af0be,_0x5cf8cf['options']);return _0x1eacb0[_0x29a6('0x46')](_0x5af0be);}})['then'](function(_0x45f503){if(_0x45f503){_0x40f52b=_0x45f503['length'];if(!_0x5cf8cf[_0x29a6('0x2e')]['hasOwnProperty']('nolimit')){_0x5af0be[_0x29a6('0x1b')]=qs[_0x29a6('0x1b')](_0x5cf8cf['query'][_0x29a6('0x1b')]);_0x5af0be['offset']=qs[_0x29a6('0x19')](_0x5cf8cf['query'][_0x29a6('0x19')]);}return _0x1eacb0['getConfigurations'](_0x5af0be);}})[_0x29a6('0x22')](function(_0x4e4b06){if(_0x4e4b06){return _0x4e4b06?{'count':_0x40f52b,'rows':_0x4e4b06}:null;}})[_0x29a6('0x22')](respondWithResult(_0x3c3262,null))[_0x29a6('0x40')](handleError(_0x3c3262,null));};exports['addConfiguration']=function(_0x290f86,_0x1f8726,_0x41a9e6){if(_0x290f86[_0x29a6('0x45')]['id']){delete _0x290f86[_0x29a6('0x45')]['id'];}return db[_0x29a6('0x2a')][_0x29a6('0x47')]({'where':{'id':_0x290f86[_0x29a6('0x41')]['id']}})[_0x29a6('0x22')](handleEntityNotFound(_0x1f8726,null))[_0x29a6('0x22')](function(_0x9d7bdc){if(_0x9d7bdc){_0x290f86[_0x29a6('0x45')][_0x29a6('0x49')]=_0x9d7bdc['id'];_0x290f86[_0x29a6('0x45')][_0x29a6('0x4a')]=integrations[_0x29a6('0x4b')](_0x290f86[_0x29a6('0x45')][_0x29a6('0x4c')],_0x290f86['body'][_0x29a6('0x2d')]);_0x290f86[_0x29a6('0x45')][_0x29a6('0x4d')]=integrations[_0x29a6('0x4e')](_0x290f86[_0x29a6('0x45')][_0x29a6('0x4c')],_0x290f86[_0x29a6('0x45')][_0x29a6('0x2d')]);return db[_0x29a6('0x4f')][_0x29a6('0x44')](_0x290f86[_0x29a6('0x45')],{'include':[{'model':db[_0x29a6('0x50')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1f8726,null))['catch'](handleError(_0x1f8726,null));};exports[_0x29a6('0x51')]=function(_0x13a545,_0x27ba9a,_0x422344){var _0x27d33f='';return db[_0x29a6('0x2a')][_0x29a6('0x47')]({'where':{'id':_0x13a545[_0x29a6('0x41')]['id']},'attributes':['id',_0x29a6('0x52'),_0x29a6('0x53')]})['then'](handleEntityNotFound(_0x27ba9a,null))['then'](function(_0x176d48){if(_0x176d48){_0x27d33f=_0x176d48[_0x29a6('0x52')];var _0x354bdf=_0x27d33f[_0x29a6('0x54')](-0x1);if(_0x354bdf==='/'){_0x27d33f=_0x27d33f[_0x29a6('0x55')](0x0,_0x27d33f[_0x29a6('0x56')](_0x354bdf));}return rp({'method':_0x29a6('0x57'),'uri':util[_0x29a6('0x58')](_0x29a6('0x59'),_0x27d33f,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x29a6('0x58')](_0x29a6('0x5a'),new Buffer(util[_0x29a6('0x58')](_0x29a6('0x5b'),_0x176d48[_0x29a6('0x53')]))[_0x29a6('0x5c')](_0x29a6('0x5d')))},'json':!![]});}})[_0x29a6('0x22')](function(_0x80b865){if(_0x80b865){var _0x2be85d=['requester',_0x29a6('0x5e'),'agent',_0x29a6('0x5f'),_0x29a6('0x17'),'priority',_0x29a6('0x60'),_0x29a6('0x61'),_0x29a6('0x62'),_0x29a6('0x60'),_0x29a6('0x63')];_[_0x29a6('0x64')](_0x80b865,function(_0x1302ca){return _0x2be85d['includes'](_0x1302ca[_0x29a6('0x27')])||!_0x1302ca[_0x29a6('0x65')]&&_0x1302ca[_0x29a6('0x2d')]!==_0x29a6('0x66')&&_0x1302ca[_0x29a6('0x2d')]!==_0x29a6('0x67');});return{'count':_0x80b865[_0x29a6('0x42')],'rows':_[_0x29a6('0x29')](_0x80b865,function(_0x51f622){return{'id':_0x51f622[_0x29a6('0x27')],'name':_0x51f622[_0x29a6('0x68')],'custom':!_0x51f622[_0x29a6('0x65')],'options':_0x51f622[_0x29a6('0x69')]?_[_0x29a6('0x29')](_0x51f622['choices'],function(_0x5d5ba6){return{'name':_[_0x29a6('0x6a')](_0x5d5ba6),'value':_0x5d5ba6};}):[]};})};}})[_0x29a6('0x22')](respondWithResult(_0x27ba9a,null))[_0x29a6('0x40')](function(_0x1a6254){var _0xd860e4=_0x13a545['query']['test']?0x1f4:_0x1a6254[_0x29a6('0x6b')]||0x1f4;logger[_0x29a6('0x25')](_0x29a6('0x6c'),_0x29a6('0x51'),_0xd860e4,JSON[_0x29a6('0x6d')](_0x1a6254));delete _0x1a6254[_0x29a6('0x27')];if(_0xd860e4===0x191){_0xd860e4=0x190;}_0x27ba9a[_0x29a6('0x17')](_0xd860e4)['send'](_0x13a545[_0x29a6('0x2e')][_0x29a6('0x6e')]?{'message':_0x29a6('0x6f'),'statusCode':_0x1a6254[_0x29a6('0x6b')]}:_0x1a6254);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 7874cf1..934f96a 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 _0x1ecf=['int_freshdesk_accounts','util','../../config/logger','api','moment','bluebird','path','rimraf','../../components/integrations/configuration','exports','define','FreshdeskAccount'];(function(_0x13518d,_0x5536b0){var _0x1fe3e8=function(_0x33d72c){while(--_0x33d72c){_0x13518d['push'](_0x13518d['shift']());}};_0x1fe3e8(++_0x5536b0);}(_0x1ecf,0x15d));var _0xf1ec=function(_0xce93c,_0x555be5){_0xce93c=_0xce93c-0x0;var _0x230720=_0x1ecf[_0xce93c];return _0x230720;};'use strict';var _=require('lodash');var util=require(_0xf1ec('0x0'));var logger=require(_0xf1ec('0x1'))(_0xf1ec('0x2'));var moment=require(_0xf1ec('0x3'));var BPromise=require(_0xf1ec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1ec('0x5'));var rimraf=require(_0xf1ec('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xf1ec('0x7'));module[_0xf1ec('0x8')]=function(_0x4f151f,_0x24f80b){return _0x4f151f[_0xf1ec('0x9')](_0xf1ec('0xa'),attributes,{'tableName':_0xf1ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf1f=['../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','int_freshdesk_accounts','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x516a7e,_0x17f43d){var _0x5b8444=function(_0x1b4eca){while(--_0x1b4eca){_0x516a7e['push'](_0x516a7e['shift']());}};_0x5b8444(++_0x17f43d);}(_0xdf1f,0x191));var _0xfdf1=function(_0x9f79f1,_0xcfdcd9){_0x9f79f1=_0x9f79f1-0x0;var _0x4da7c8=_0xdf1f[_0x9f79f1];return _0x4da7c8;};'use strict';var _=require(_0xfdf1('0x0'));var util=require(_0xfdf1('0x1'));var logger=require(_0xfdf1('0x2'))('api');var moment=require('moment');var BPromise=require(_0xfdf1('0x3'));var rp=require(_0xfdf1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfdf1('0x5'));var config=require(_0xfdf1('0x6'));var attributes=require(_0xfdf1('0x7'));var integrations=require(_0xfdf1('0x8'));module['exports']=function(_0x7e82c1,_0x462d50){return _0x7e82c1[_0xfdf1('0x9')]('FreshdeskAccount',attributes,{'tableName':_0xfdf1('0xa'),'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 057f5f6..ce46898 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 _0x6a2a=['FreshdeskAccount','findAll','options','raw','where','attributes','limit','map','model','include','catch','ShowFreshdeskAccount','find','debug','util','moment','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','GetFreshdeskAccount'];(function(_0x10e870,_0x4c4324){var _0x29b93d=function(_0x11943e){while(--_0x11943e){_0x10e870['push'](_0x10e870['shift']());}};_0x29b93d(++_0x4c4324);}(_0x6a2a,0x1ee));var _0xa6a2=function(_0x30c7c5,_0x168208){_0x30c7c5=_0x30c7c5-0x0;var _0x29e24e=_0x6a2a[_0x30c7c5];return _0x29e24e;};'use strict';var _=require('lodash');var util=require(_0xa6a2('0x0'));var moment=require(_0xa6a2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6a2('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa6a2('0x3'))('rpc');var config=require(_0xa6a2('0x4'));var jayson=require(_0xa6a2('0x5'));var client=jayson[_0xa6a2('0x6')][_0xa6a2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x213315,_0x4e523c,_0x2c25d1){return new BPromise(function(_0x3e8c6b,_0x54d13a){return client[_0xa6a2('0x8')](_0x213315,_0x2c25d1)['then'](function(_0x37b0ef){logger['info'](_0xa6a2('0x9'),_0x4e523c,'request\x20sent');logger['debug'](_0xa6a2('0xa'),_0x4e523c,_0xa6a2('0xb'),JSON[_0xa6a2('0xc')](_0x37b0ef));if(_0x37b0ef[_0xa6a2('0xd')]){if(_0x37b0ef[_0xa6a2('0xd')][_0xa6a2('0xe')]===0x1f4){logger[_0xa6a2('0xd')](_0xa6a2('0x9'),_0x4e523c,_0x37b0ef[_0xa6a2('0xd')]['message']);return _0x54d13a(_0x37b0ef[_0xa6a2('0xd')][_0xa6a2('0xf')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x4e523c,_0x37b0ef[_0xa6a2('0xd')]['message']);return _0x3e8c6b(_0x37b0ef[_0xa6a2('0xd')][_0xa6a2('0xf')]);}else{logger[_0xa6a2('0x10')](_0xa6a2('0x9'),_0x4e523c,'request\x20sent');_0x3e8c6b(_0x37b0ef['result'][_0xa6a2('0xf')]);}})['catch'](function(_0x4768b7){logger[_0xa6a2('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x4e523c,_0x4768b7);_0x54d13a(_0x4768b7);});});}exports[_0xa6a2('0x11')]=function(_0x15f15e){var _0x4c8292=this;return new Promise(function(_0x4e7180,_0x58b63d){return db[_0xa6a2('0x12')][_0xa6a2('0x13')]({'raw':_0x15f15e['options']?_0x15f15e[_0xa6a2('0x14')][_0xa6a2('0x15')]===undefined?!![]:![]:!![],'where':_0x15f15e[_0xa6a2('0x14')]?_0x15f15e['options'][_0xa6a2('0x16')]||null:null,'attributes':_0x15f15e['options']?_0x15f15e[_0xa6a2('0x14')][_0xa6a2('0x17')]||null:null,'limit':_0x15f15e[_0xa6a2('0x14')]?_0x15f15e[_0xa6a2('0x14')][_0xa6a2('0x18')]||null:null,'include':_0x15f15e[_0xa6a2('0x14')]?_0x15f15e['options']['include']?_[_0xa6a2('0x19')](_0x15f15e[_0xa6a2('0x14')]['include'],function(_0x26ede7){return{'model':db[_0x26ede7[_0xa6a2('0x1a')]],'as':_0x26ede7['as'],'attributes':_0x26ede7['attributes'],'include':_0x26ede7[_0xa6a2('0x1b')]?_[_0xa6a2('0x19')](_0x26ede7[_0xa6a2('0x1b')],function(_0x575aec){return{'model':db[_0x575aec['model']],'as':_0x575aec['as'],'attributes':_0x575aec[_0xa6a2('0x17')],'include':_0x575aec['include']?_[_0xa6a2('0x19')](_0x575aec[_0xa6a2('0x1b')],function(_0x2bf5c6){return{'model':db[_0x2bf5c6['model']],'as':_0x2bf5c6['as'],'attributes':_0x2bf5c6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x262cd1){logger[_0xa6a2('0x10')]('GetFreshdeskAccount',_0x15f15e);logger['debug'](_0xa6a2('0x11'),_0x15f15e,JSON[_0xa6a2('0xc')](_0x262cd1));_0x4e7180(_0x262cd1);})[_0xa6a2('0x1c')](function(_0x42886b){logger[_0xa6a2('0xd')]('GetFreshdeskAccount',_0x42886b[_0xa6a2('0xf')],_0x15f15e);_0x58b63d(_0x4c8292[_0xa6a2('0xd')](0x1f4,_0x42886b['message']));});});};exports[_0xa6a2('0x1d')]=function(_0x152802){var _0xcb7adc=this;return new Promise(function(_0x4cac2b,_0x1883e3){return db[_0xa6a2('0x12')][_0xa6a2('0x1e')]({'raw':_0x152802[_0xa6a2('0x14')]?_0x152802[_0xa6a2('0x14')][_0xa6a2('0x15')]===undefined?!![]:![]:!![],'where':_0x152802[_0xa6a2('0x14')]?_0x152802[_0xa6a2('0x14')]['where']||null:null,'attributes':_0x152802[_0xa6a2('0x14')]?_0x152802[_0xa6a2('0x14')][_0xa6a2('0x17')]||null:null,'include':_0x152802[_0xa6a2('0x14')]?_0x152802[_0xa6a2('0x14')]['include']?_[_0xa6a2('0x19')](_0x152802[_0xa6a2('0x14')][_0xa6a2('0x1b')],function(_0x3f3280){return{'model':db[_0x3f3280[_0xa6a2('0x1a')]],'as':_0x3f3280['as'],'attributes':_0x3f3280[_0xa6a2('0x17')],'include':_0x3f3280[_0xa6a2('0x1b')]?_[_0xa6a2('0x19')](_0x3f3280[_0xa6a2('0x1b')],function(_0xd9d6a3){return{'model':db[_0xd9d6a3[_0xa6a2('0x1a')]],'as':_0xd9d6a3['as'],'attributes':_0xd9d6a3['attributes'],'include':_0xd9d6a3[_0xa6a2('0x1b')]?_['map'](_0xd9d6a3[_0xa6a2('0x1b')],function(_0x3f4ca3){return{'model':db[_0x3f4ca3[_0xa6a2('0x1a')]],'as':_0x3f4ca3['as'],'attributes':_0x3f4ca3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xd41f2e){logger['info'](_0xa6a2('0x1d'),_0x152802);logger[_0xa6a2('0x1f')](_0xa6a2('0x1d'),_0x152802,JSON[_0xa6a2('0xc')](_0xd41f2e));_0x4cac2b(_0xd41f2e);})[_0xa6a2('0x1c')](function(_0x5e5417){logger[_0xa6a2('0xd')]('ShowFreshdeskAccount',_0x5e5417[_0xa6a2('0xf')],_0x152802);_0x1883e3(_0xcb7adc[_0xa6a2('0xd')](0x1f4,_0x5e5417['message']));});});}; \ No newline at end of file +var _0x21d1=['request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x21d1,0x1c9));var _0x121d=function(_0x13888b,_0x1c8035){_0x13888b=_0x13888b-0x0;var _0x242c5f=_0x21d1[_0x13888b];return _0x242c5f;};'use strict';var _=require(_0x121d('0x0'));var util=require(_0x121d('0x1'));var moment=require(_0x121d('0x2'));var BPromise=require(_0x121d('0x3'));var rs=require(_0x121d('0x4'));var fs=require('fs');var Redis=require(_0x121d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x121d('0x6'))(_0x121d('0x7'));var config=require(_0x121d('0x8'));var jayson=require(_0x121d('0x9'));var client=jayson[_0x121d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x226625,_0x2bd1e8,_0x47b50b){return new BPromise(function(_0x2d4d7e,_0x242f0c){return client[_0x121d('0xb')](_0x226625,_0x47b50b)[_0x121d('0xc')](function(_0x8b07c2){logger[_0x121d('0xd')](_0x121d('0xe'),_0x2bd1e8,'request\x20sent');logger[_0x121d('0xf')](_0x121d('0x10'),_0x2bd1e8,_0x121d('0x11'),JSON['stringify'](_0x8b07c2));if(_0x8b07c2['error']){if(_0x8b07c2[_0x121d('0x12')][_0x121d('0x13')]===0x1f4){logger[_0x121d('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x2bd1e8,_0x8b07c2['error'][_0x121d('0x14')]);return _0x242f0c(_0x8b07c2['error'][_0x121d('0x14')]);}logger[_0x121d('0x12')](_0x121d('0xe'),_0x2bd1e8,_0x8b07c2['error'][_0x121d('0x14')]);return _0x2d4d7e(_0x8b07c2[_0x121d('0x12')][_0x121d('0x14')]);}else{logger[_0x121d('0xd')](_0x121d('0xe'),_0x2bd1e8,_0x121d('0x11'));_0x2d4d7e(_0x8b07c2[_0x121d('0x15')][_0x121d('0x14')]);}})[_0x121d('0x16')](function(_0x475541){logger[_0x121d('0x12')](_0x121d('0xe'),_0x2bd1e8,_0x475541);_0x242f0c(_0x475541);});});}exports[_0x121d('0x17')]=function(_0x5aee6a){var _0x5a0b2d=this;return new Promise(function(_0x48e041,_0x278593){return db[_0x121d('0x18')]['findAll']({'raw':_0x5aee6a[_0x121d('0x19')]?_0x5aee6a[_0x121d('0x19')][_0x121d('0x1a')]===undefined?!![]:![]:!![],'where':_0x5aee6a[_0x121d('0x19')]?_0x5aee6a[_0x121d('0x19')][_0x121d('0x1b')]||null:null,'attributes':_0x5aee6a[_0x121d('0x19')]?_0x5aee6a[_0x121d('0x19')][_0x121d('0x1c')]||null:null,'limit':_0x5aee6a[_0x121d('0x19')]?_0x5aee6a[_0x121d('0x19')][_0x121d('0x1d')]||null:null,'include':_0x5aee6a[_0x121d('0x19')]?_0x5aee6a[_0x121d('0x19')][_0x121d('0x1e')]?_[_0x121d('0x1f')](_0x5aee6a[_0x121d('0x19')][_0x121d('0x1e')],function(_0x331e9c){return{'model':db[_0x331e9c[_0x121d('0x20')]],'as':_0x331e9c['as'],'attributes':_0x331e9c[_0x121d('0x1c')],'include':_0x331e9c['include']?_[_0x121d('0x1f')](_0x331e9c[_0x121d('0x1e')],function(_0x78cb1a){return{'model':db[_0x78cb1a[_0x121d('0x20')]],'as':_0x78cb1a['as'],'attributes':_0x78cb1a[_0x121d('0x1c')],'include':_0x78cb1a['include']?_[_0x121d('0x1f')](_0x78cb1a['include'],function(_0x2aa75c){return{'model':db[_0x2aa75c[_0x121d('0x20')]],'as':_0x2aa75c['as'],'attributes':_0x2aa75c[_0x121d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x121d('0xc')](function(_0x1683b0){logger[_0x121d('0xd')](_0x121d('0x17'),_0x5aee6a);logger[_0x121d('0xf')](_0x121d('0x17'),_0x5aee6a,JSON[_0x121d('0x21')](_0x1683b0));_0x48e041(_0x1683b0);})['catch'](function(_0x3c041c){logger['error'](_0x121d('0x17'),_0x3c041c[_0x121d('0x14')],_0x5aee6a);_0x278593(_0x5a0b2d[_0x121d('0x12')](0x1f4,_0x3c041c['message']));});});};exports['ShowFreshdeskAccount']=function(_0x2905c4){var _0xd95b6b=this;return new Promise(function(_0x308e96,_0x40e2ba){return db[_0x121d('0x18')][_0x121d('0x22')]({'raw':_0x2905c4[_0x121d('0x19')]?_0x2905c4['options'][_0x121d('0x1a')]===undefined?!![]:![]:!![],'where':_0x2905c4[_0x121d('0x19')]?_0x2905c4[_0x121d('0x19')][_0x121d('0x1b')]||null:null,'attributes':_0x2905c4[_0x121d('0x19')]?_0x2905c4[_0x121d('0x19')][_0x121d('0x1c')]||null:null,'include':_0x2905c4[_0x121d('0x19')]?_0x2905c4['options'][_0x121d('0x1e')]?_[_0x121d('0x1f')](_0x2905c4[_0x121d('0x19')][_0x121d('0x1e')],function(_0x588f1d){return{'model':db[_0x588f1d[_0x121d('0x20')]],'as':_0x588f1d['as'],'attributes':_0x588f1d[_0x121d('0x1c')],'include':_0x588f1d[_0x121d('0x1e')]?_[_0x121d('0x1f')](_0x588f1d['include'],function(_0x1c0d27){return{'model':db[_0x1c0d27[_0x121d('0x20')]],'as':_0x1c0d27['as'],'attributes':_0x1c0d27[_0x121d('0x1c')],'include':_0x1c0d27['include']?_[_0x121d('0x1f')](_0x1c0d27[_0x121d('0x1e')],function(_0xa91e4c){return{'model':db[_0xa91e4c[_0x121d('0x20')]],'as':_0xa91e4c['as'],'attributes':_0xa91e4c[_0x121d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x121d('0xc')](function(_0x2487fa){logger['info'](_0x121d('0x23'),_0x2905c4);logger[_0x121d('0xf')](_0x121d('0x23'),_0x2905c4,JSON[_0x121d('0x21')](_0x2487fa));_0x308e96(_0x2487fa);})['catch'](function(_0x476733){logger[_0x121d('0x12')](_0x121d('0x23'),_0x476733[_0x121d('0x14')],_0x2905c4);_0x40e2ba(_0xd95b6b[_0x121d('0x12')](0x1f4,_0x476733[_0x121d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 7a83352..1a39a9c 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 _0x84e6=['setTags','put','/:id','update','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post'];(function(_0x59b386,_0x32f0c0){var _0xa609ad=function(_0x878fc8){while(--_0x878fc8){_0x59b386['push'](_0x59b386['shift']());}};_0xa609ad(++_0x32f0c0);}(_0x84e6,0x175));var _0x684e=function(_0x1bd1db,_0x396e7b){_0x1bd1db=_0x1bd1db-0x0;var _0x453587=_0x84e6[_0x1bd1db];return _0x453587;};'use strict';var multer=require(_0x684e('0x0'));var util=require(_0x684e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x684e('0x2'));var router=express[_0x684e('0x3')]();var fs_extra=require(_0x684e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x684e('0x5'));var config=require('../../config/environment');var controller=require(_0x684e('0x6'));router[_0x684e('0x7')]('/',auth[_0x684e('0x8')](),controller[_0x684e('0x9')]);router[_0x684e('0x7')]('/:id',auth[_0x684e('0x8')](),controller[_0x684e('0xa')]);router[_0x684e('0x7')](_0x684e('0xb'),auth[_0x684e('0x8')](),controller[_0x684e('0xc')]);router[_0x684e('0x7')](_0x684e('0xd'),auth['isAuthenticated'](),controller[_0x684e('0xe')]);router[_0x684e('0x7')]('/:id/descriptions',auth[_0x684e('0x8')](),controller[_0x684e('0xf')]);router[_0x684e('0x7')](_0x684e('0x10'),auth[_0x684e('0x8')](),controller['getTags']);router[_0x684e('0x11')]('/',auth[_0x684e('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0x684e('0x8')](),controller[_0x684e('0x12')]);router[_0x684e('0x13')](_0x684e('0x14'),auth['isAuthenticated'](),controller[_0x684e('0x15')]);router['delete'](_0x684e('0x14'),auth['isAuthenticated'](),controller[_0x684e('0x16')]);module['exports']=router; \ No newline at end of file +var _0xe4c4=['show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','index','get','/:id','isAuthenticated'];(function(_0x4c5034,_0x264da9){var _0x139f2f=function(_0x5544d7){while(--_0x5544d7){_0x4c5034['push'](_0x4c5034['shift']());}};_0x139f2f(++_0x264da9);}(_0xe4c4,0x18c));var _0x4e4c=function(_0x27bcf5,_0x236765){_0x27bcf5=_0x27bcf5-0x0;var _0x4ce4cf=_0xe4c4[_0x27bcf5];return _0x4ce4cf;};'use strict';var multer=require(_0x4e4c('0x0'));var util=require(_0x4e4c('0x1'));var path=require('path');var timeout=require(_0x4e4c('0x2'));var express=require('express');var router=express[_0x4e4c('0x3')]();var fs_extra=require(_0x4e4c('0x4'));var auth=require(_0x4e4c('0x5'));var interaction=require(_0x4e4c('0x6'));var config=require('../../config/environment');var controller=require(_0x4e4c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x4e4c('0x8')]);router[_0x4e4c('0x9')](_0x4e4c('0xa'),auth[_0x4e4c('0xb')](),controller[_0x4e4c('0xc')]);router[_0x4e4c('0x9')](_0x4e4c('0xd'),auth[_0x4e4c('0xb')](),controller['getFields']);router['get'](_0x4e4c('0xe'),auth['isAuthenticated'](),controller[_0x4e4c('0xf')]);router[_0x4e4c('0x9')](_0x4e4c('0x10'),auth[_0x4e4c('0xb')](),controller[_0x4e4c('0x11')]);router[_0x4e4c('0x9')](_0x4e4c('0x12'),auth[_0x4e4c('0xb')](),controller[_0x4e4c('0x13')]);router[_0x4e4c('0x14')]('/',auth[_0x4e4c('0xb')](),controller[_0x4e4c('0x15')]);router[_0x4e4c('0x14')](_0x4e4c('0x12'),auth[_0x4e4c('0xb')](),controller['setTags']);router[_0x4e4c('0x16')]('/:id',auth[_0x4e4c('0xb')](),controller['update']);router['delete'](_0x4e4c('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x4e4c('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 17d6878..5116915 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 _0x0ab4=['STRING'];(function(_0x31db70,_0x62d245){var _0x5623a4=function(_0x13ae49){while(--_0x13ae49){_0x31db70['push'](_0x31db70['shift']());}};_0x5623a4(++_0x62d245);}(_0x0ab4,0x1c1));var _0x40ab=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0ab4[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x40ab('0x0')]},'description':{'type':Sequelize[_0x40ab('0x0')]}}; \ No newline at end of file +var _0x2d1e=['STRING','sequelize'];(function(_0x553c73,_0x3eb2ad){var _0x56f9bb=function(_0x308293){while(--_0x308293){_0x553c73['push'](_0x553c73['shift']());}};_0x56f9bb(++_0x3eb2ad);}(_0x2d1e,0x153));var _0xe2d1=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x2d1e[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require(_0xe2d1('0x0'));module['exports']={'name':{'type':Sequelize[_0xe2d1('0x1')]},'description':{'type':Sequelize[_0xe2d1('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 7a127d0..508b7f3 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 _0x9f95=['getSubjects','ids','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','index','map','FreshdeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','where','pick','filter','type','VIRTUAL','name','options','includeAll','catch','params','include','merge','create','body','find','findOne','FreshdeskField','sort','getFields','hasOwnProperty','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f95,0xef));var _0x59f9=function(_0x42ad1b,_0x3074b9){_0x42ad1b=_0x42ad1b-0x0;var _0x3792a5=_0x9f95[_0x42ad1b];return _0x3792a5;};'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(_0x59f9('0x0'));var moment=require(_0x59f9('0x1'));var BPromise=require(_0x59f9('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x59f9('0x3'));var sox=require(_0x59f9('0x4'));var csv=require(_0x59f9('0x5'));var ejs=require(_0x59f9('0x6'));var fs=require('fs');var fs_extra=require(_0x59f9('0x7'));var _=require(_0x59f9('0x8'));var squel=require(_0x59f9('0x9'));var crypto=require(_0x59f9('0xa'));var jsforce=require(_0x59f9('0xb'));var deskjs=require(_0x59f9('0xc'));var toCsv=require('to-csv');var querystring=require(_0x59f9('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x59f9('0xe'));var qs=require(_0x59f9('0xf'));var as=require(_0x59f9('0x10'));var hardwareService=require(_0x59f9('0x11'));var logger=require(_0x59f9('0x12'))(_0x59f9('0x13'));var utils=require('../../config/utils');var config=require(_0x59f9('0x14'));var licenseUtil=require(_0x59f9('0x15'));var db=require(_0x59f9('0x16'))['db'];function respondWithStatusCode(_0x48e50d,_0x3f59b5){_0x3f59b5=_0x3f59b5||0xcc;return function(_0x39dedb){if(_0x39dedb){return _0x48e50d[_0x59f9('0x17')](_0x3f59b5);}return _0x48e50d[_0x59f9('0x18')](_0x3f59b5)['end']();};}function respondWithResult(_0xa97451,_0x544c30){_0x544c30=_0x544c30||0xc8;return function(_0x3f7f73){if(_0x3f7f73){return _0xa97451[_0x59f9('0x18')](_0x544c30)[_0x59f9('0x19')](_0x3f7f73);}};}function respondWithFilteredResult(_0x2f92da,_0x3c9ebc){return function(_0x3d5c02){if(_0x3d5c02){var _0x47d2fe=typeof _0x3c9ebc['offset']===_0x59f9('0x1a')&&typeof _0x3c9ebc['limit']==='undefined';var _0x16511f=_0x3d5c02['count'];var _0x226c25=_0x47d2fe?0x0:_0x3c9ebc[_0x59f9('0x1b')];var _0xae867=_0x47d2fe?_0x3d5c02[_0x59f9('0x1c')]:_0x3c9ebc[_0x59f9('0x1b')]+_0x3c9ebc[_0x59f9('0x1d')];var _0x24de99;if(_0xae867>=_0x16511f){_0xae867=_0x16511f;_0x24de99=0xc8;}else{_0x24de99=0xce;}_0x2f92da[_0x59f9('0x18')](_0x24de99);return _0x2f92da[_0x59f9('0x1e')](_0x59f9('0x1f'),_0x226c25+'-'+_0xae867+'/'+_0x16511f)[_0x59f9('0x19')](_0x3d5c02);}return null;};}function patchUpdates(_0x286c35){return function(_0x3ccf9c){try{jsonpatch[_0x59f9('0x20')](_0x3ccf9c,_0x286c35,!![]);}catch(_0x21254b){return BPromise[_0x59f9('0x21')](_0x21254b);}return _0x3ccf9c[_0x59f9('0x22')]();};}function saveUpdates(_0x5a0762,_0x3eed97){return function(_0xd2dbe){if(_0xd2dbe){return _0xd2dbe[_0x59f9('0x23')](_0x5a0762)['then'](function(_0x29f45d){return _0x29f45d;});}return null;};}function removeEntity(_0xd64a77,_0x167a19){return function(_0x1628a0){if(_0x1628a0){return _0x1628a0[_0x59f9('0x24')]()[_0x59f9('0x25')](function(){_0xd64a77[_0x59f9('0x18')](0xcc)[_0x59f9('0x26')]();});}};}function handleEntityNotFound(_0xeeb3f2,_0x18c254){return function(_0x58514f){if(!_0x58514f){_0xeeb3f2['sendStatus'](0x194);}return _0x58514f;};}function handleError(_0x749809,_0x41b1c3){_0x41b1c3=_0x41b1c3||0x1f4;return function(_0x42af3b){logger[_0x59f9('0x27')](_0x42af3b[_0x59f9('0x28')]);if(_0x42af3b['name']){delete _0x42af3b['name'];}_0x749809['status'](_0x41b1c3)['send'](_0x42af3b);};}exports[_0x59f9('0x29')]=function(_0x2d3dc8,_0x126e0b){var _0x6fe885={},_0x2febbc={},_0x5e2df9={'count':0x0,'rows':[]};var _0x5ac03a=_[_0x59f9('0x2a')](db[_0x59f9('0x2b')][_0x59f9('0x2c')],function(_0x28cc60){return{'name':_0x28cc60[_0x59f9('0x2d')],'type':_0x28cc60['type'][_0x59f9('0x2e')]};});_0x2febbc[_0x59f9('0x2f')]=_[_0x59f9('0x2a')](_0x5ac03a,'name');_0x2febbc[_0x59f9('0x30')]=_[_0x59f9('0x31')](_0x2d3dc8[_0x59f9('0x30')]);_0x2febbc[_0x59f9('0x32')]=_[_0x59f9('0x33')](_0x2febbc['model'],_0x2febbc[_0x59f9('0x30')]);_0x6fe885[_0x59f9('0x34')]=_[_0x59f9('0x33')](_0x2febbc[_0x59f9('0x2f')],qs[_0x59f9('0x35')](_0x2d3dc8[_0x59f9('0x30')]['fields']));_0x6fe885['attributes']=_0x6fe885[_0x59f9('0x34')][_0x59f9('0x36')]?_0x6fe885[_0x59f9('0x34')]:_0x2febbc[_0x59f9('0x2f')];if(!_0x2d3dc8[_0x59f9('0x30')]['hasOwnProperty']('nolimit')){_0x6fe885['limit']=qs[_0x59f9('0x1d')](_0x2d3dc8[_0x59f9('0x30')][_0x59f9('0x1d')]);_0x6fe885[_0x59f9('0x1b')]=qs[_0x59f9('0x1b')](_0x2d3dc8[_0x59f9('0x30')]['offset']);}_0x6fe885[_0x59f9('0x37')]=qs['sort'](_0x2d3dc8[_0x59f9('0x30')]['sort']);_0x6fe885[_0x59f9('0x38')]=qs[_0x59f9('0x32')](_[_0x59f9('0x39')](_0x2d3dc8[_0x59f9('0x30')],_0x2febbc['filters']),_0x5ac03a);if(_0x2d3dc8['query'][_0x59f9('0x3a')]){_0x6fe885['where']=_['merge'](_0x6fe885[_0x59f9('0x38')],{'$or':_['map'](_0x5ac03a,function(_0x10e413){if(_0x10e413[_0x59f9('0x3b')]!==_0x59f9('0x3c')){var _0x28d388={};_0x28d388[_0x10e413[_0x59f9('0x3d')]]={'$like':'%'+_0x2d3dc8[_0x59f9('0x30')][_0x59f9('0x3a')]+'%'};return _0x28d388;}})});}_0x6fe885=_['merge']({},_0x6fe885,_0x2d3dc8[_0x59f9('0x3e')]);var _0x222e11={'where':_0x6fe885[_0x59f9('0x38')]};return db[_0x59f9('0x2b')][_0x59f9('0x1c')](_0x222e11)[_0x59f9('0x25')](function(_0x401647){_0x5e2df9[_0x59f9('0x1c')]=_0x401647;if(_0x2d3dc8[_0x59f9('0x30')][_0x59f9('0x3f')]){_0x6fe885['include']=[{'all':!![]}];}return db[_0x59f9('0x2b')]['findAll'](_0x6fe885);})[_0x59f9('0x25')](function(_0x13a9d7){_0x5e2df9['rows']=_0x13a9d7;return _0x5e2df9;})[_0x59f9('0x25')](respondWithFilteredResult(_0x126e0b,_0x6fe885))[_0x59f9('0x40')](handleError(_0x126e0b,null));};exports['show']=function(_0x57eda2,_0x2ce1ff){var _0x25939e={'raw':![],'where':{'id':_0x57eda2[_0x59f9('0x41')]['id']}},_0xe6da84={};_0xe6da84[_0x59f9('0x2f')]=_['keys'](db['FreshdeskConfiguration'][_0x59f9('0x2c')]);_0xe6da84[_0x59f9('0x30')]=_['keys'](_0x57eda2[_0x59f9('0x30')]);_0xe6da84[_0x59f9('0x32')]=_[_0x59f9('0x33')](_0xe6da84[_0x59f9('0x2f')],_0xe6da84['query']);_0x25939e[_0x59f9('0x34')]=_[_0x59f9('0x33')](_0xe6da84[_0x59f9('0x2f')],qs['fields'](_0x57eda2[_0x59f9('0x30')][_0x59f9('0x35')]));_0x25939e['attributes']=_0x25939e[_0x59f9('0x34')]['length']?_0x25939e[_0x59f9('0x34')]:_0xe6da84['model'];if(_0x57eda2[_0x59f9('0x30')][_0x59f9('0x3f')]){_0x25939e[_0x59f9('0x42')]=[{'all':!![]}];}_0x25939e=_[_0x59f9('0x43')]({},_0x25939e,_0x57eda2[_0x59f9('0x3e')]);return db[_0x59f9('0x2b')]['find'](_0x25939e)[_0x59f9('0x25')](handleEntityNotFound(_0x2ce1ff,null))[_0x59f9('0x25')](respondWithResult(_0x2ce1ff,null))[_0x59f9('0x40')](handleError(_0x2ce1ff,null));};exports[_0x59f9('0x44')]=function(_0xb5cce1,_0x401a88){return db[_0x59f9('0x2b')]['create'](_0xb5cce1[_0x59f9('0x45')],{})[_0x59f9('0x25')](respondWithResult(_0x401a88,0xc9))[_0x59f9('0x40')](handleError(_0x401a88,null));};exports[_0x59f9('0x23')]=function(_0x27f4f1,_0x2f0b8b){if(_0x27f4f1[_0x59f9('0x45')]['id']){delete _0x27f4f1[_0x59f9('0x45')]['id'];}return db[_0x59f9('0x2b')][_0x59f9('0x46')]({'where':{'id':_0x27f4f1[_0x59f9('0x41')]['id']}})[_0x59f9('0x25')](handleEntityNotFound(_0x2f0b8b,null))[_0x59f9('0x25')](saveUpdates(_0x27f4f1['body'],null))[_0x59f9('0x25')](respondWithResult(_0x2f0b8b,null))['catch'](handleError(_0x2f0b8b,null));};exports['destroy']=function(_0x3b687b,_0x57a593){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x3b687b[_0x59f9('0x41')]['id']}})['then'](handleEntityNotFound(_0x57a593,null))[_0x59f9('0x25')](removeEntity(_0x57a593,null))[_0x59f9('0x40')](handleError(_0x57a593,null));};exports['getFields']=function(_0x2ea6f9,_0x4969fb,_0x6ce31){var _0x4562df={};var _0x15c62c={};var _0x46cf8a;var _0x33ed81;return db[_0x59f9('0x2b')][_0x59f9('0x47')]({'where':{'id':_0x2ea6f9[_0x59f9('0x41')]['id']}})[_0x59f9('0x25')](handleEntityNotFound(_0x4969fb,null))[_0x59f9('0x25')](function(_0x1f8b94){if(_0x1f8b94){_0x46cf8a=_0x1f8b94;_0x15c62c[_0x59f9('0x2f')]=_['keys'](db[_0x59f9('0x48')][_0x59f9('0x2c')]);_0x15c62c[_0x59f9('0x30')]=_['keys'](_0x2ea6f9[_0x59f9('0x30')]);_0x15c62c[_0x59f9('0x32')]=_['intersection'](_0x15c62c['model'],_0x15c62c['query']);_0x4562df['attributes']=_[_0x59f9('0x33')](_0x15c62c[_0x59f9('0x2f')],qs[_0x59f9('0x35')](_0x2ea6f9[_0x59f9('0x30')][_0x59f9('0x35')]));_0x4562df[_0x59f9('0x34')]=_0x4562df[_0x59f9('0x34')][_0x59f9('0x36')]?_0x4562df[_0x59f9('0x34')]:_0x15c62c[_0x59f9('0x2f')];_0x4562df[_0x59f9('0x37')]=qs[_0x59f9('0x49')](_0x2ea6f9['query'][_0x59f9('0x49')]);_0x4562df[_0x59f9('0x38')]=qs['filters'](_[_0x59f9('0x39')](_0x2ea6f9['query'],_0x15c62c[_0x59f9('0x32')]));if(_0x2ea6f9[_0x59f9('0x30')][_0x59f9('0x3a')]){_0x4562df[_0x59f9('0x38')]=_[_0x59f9('0x43')](_0x4562df[_0x59f9('0x38')],{'$or':_[_0x59f9('0x2a')](_0x4562df['attributes'],function(_0x5c6111){var _0x31db6e={};_0x31db6e[_0x5c6111]={'$like':'%'+_0x2ea6f9[_0x59f9('0x30')][_0x59f9('0x3a')]+'%'};return _0x31db6e;})});}_0x4562df=_[_0x59f9('0x43')]({},_0x4562df,_0x2ea6f9['options']);return _0x46cf8a[_0x59f9('0x4a')](_0x4562df);}})[_0x59f9('0x25')](function(_0x961cab){if(_0x961cab){_0x33ed81=_0x961cab['length'];if(!_0x2ea6f9[_0x59f9('0x30')][_0x59f9('0x4b')](_0x59f9('0x4c'))){_0x4562df[_0x59f9('0x1d')]=qs[_0x59f9('0x1d')](_0x2ea6f9[_0x59f9('0x30')][_0x59f9('0x1d')]);_0x4562df[_0x59f9('0x1b')]=qs[_0x59f9('0x1b')](_0x2ea6f9['query']['offset']);}return _0x46cf8a[_0x59f9('0x4a')](_0x4562df);}})['then'](function(_0x15336a){if(_0x15336a){return _0x15336a?{'count':_0x33ed81,'rows':_0x15336a}:null;}})[_0x59f9('0x25')](respondWithResult(_0x4969fb,null))[_0x59f9('0x40')](handleError(_0x4969fb,null));};exports[_0x59f9('0x4d')]=function(_0x3b4437,_0x162266,_0x21cac8){var _0x44e2a0={};var _0x196218={};var _0x9b0963;var _0x166abc;return db[_0x59f9('0x2b')]['findOne']({'where':{'id':_0x3b4437[_0x59f9('0x41')]['id']}})[_0x59f9('0x25')](handleEntityNotFound(_0x162266,null))['then'](function(_0x5a7c49){if(_0x5a7c49){_0x9b0963=_0x5a7c49;_0x196218[_0x59f9('0x2f')]=_['keys'](db[_0x59f9('0x48')][_0x59f9('0x2c')]);_0x196218['query']=_['keys'](_0x3b4437[_0x59f9('0x30')]);_0x196218['filters']=_['intersection'](_0x196218[_0x59f9('0x2f')],_0x196218[_0x59f9('0x30')]);_0x44e2a0[_0x59f9('0x34')]=_[_0x59f9('0x33')](_0x196218[_0x59f9('0x2f')],qs['fields'](_0x3b4437[_0x59f9('0x30')][_0x59f9('0x35')]));_0x44e2a0[_0x59f9('0x34')]=_0x44e2a0[_0x59f9('0x34')][_0x59f9('0x36')]?_0x44e2a0[_0x59f9('0x34')]:_0x196218['model'];_0x44e2a0[_0x59f9('0x37')]=qs[_0x59f9('0x49')](_0x3b4437['query'][_0x59f9('0x49')]);_0x44e2a0[_0x59f9('0x38')]=qs[_0x59f9('0x32')](_[_0x59f9('0x39')](_0x3b4437['query'],_0x196218[_0x59f9('0x32')]));if(_0x3b4437[_0x59f9('0x30')]['filter']){_0x44e2a0[_0x59f9('0x38')]=_[_0x59f9('0x43')](_0x44e2a0[_0x59f9('0x38')],{'$or':_['map'](_0x44e2a0[_0x59f9('0x34')],function(_0x16a2bb){var _0x313b0f={};_0x313b0f[_0x16a2bb]={'$like':'%'+_0x3b4437[_0x59f9('0x30')][_0x59f9('0x3a')]+'%'};return _0x313b0f;})});}_0x44e2a0=_[_0x59f9('0x43')]({},_0x44e2a0,_0x3b4437['options']);return _0x9b0963[_0x59f9('0x4d')](_0x44e2a0);}})[_0x59f9('0x25')](function(_0x1e1deb){if(_0x1e1deb){_0x166abc=_0x1e1deb['length'];if(!_0x3b4437[_0x59f9('0x30')][_0x59f9('0x4b')]('nolimit')){_0x44e2a0[_0x59f9('0x1d')]=qs[_0x59f9('0x1d')](_0x3b4437[_0x59f9('0x30')]['limit']);_0x44e2a0['offset']=qs[_0x59f9('0x1b')](_0x3b4437['query'][_0x59f9('0x1b')]);}return _0x9b0963[_0x59f9('0x4d')](_0x44e2a0);}})[_0x59f9('0x25')](function(_0xd3ab1f){if(_0xd3ab1f){return _0xd3ab1f?{'count':_0x166abc,'rows':_0xd3ab1f}:null;}})['then'](respondWithResult(_0x162266,null))['catch'](handleError(_0x162266,null));};exports['getDescriptions']=function(_0x19b138,_0x2fdd92,_0x3ed985){var _0x207c5f={};var _0x28d808={};var _0x34a473;var _0x72fa29;return db[_0x59f9('0x2b')][_0x59f9('0x47')]({'where':{'id':_0x19b138['params']['id']}})[_0x59f9('0x25')](handleEntityNotFound(_0x2fdd92,null))[_0x59f9('0x25')](function(_0x7ae302){if(_0x7ae302){_0x34a473=_0x7ae302;_0x28d808[_0x59f9('0x2f')]=_['keys'](db[_0x59f9('0x48')][_0x59f9('0x2c')]);_0x28d808[_0x59f9('0x30')]=_[_0x59f9('0x31')](_0x19b138[_0x59f9('0x30')]);_0x28d808[_0x59f9('0x32')]=_[_0x59f9('0x33')](_0x28d808[_0x59f9('0x2f')],_0x28d808[_0x59f9('0x30')]);_0x207c5f[_0x59f9('0x34')]=_[_0x59f9('0x33')](_0x28d808[_0x59f9('0x2f')],qs[_0x59f9('0x35')](_0x19b138[_0x59f9('0x30')]['fields']));_0x207c5f[_0x59f9('0x34')]=_0x207c5f[_0x59f9('0x34')][_0x59f9('0x36')]?_0x207c5f[_0x59f9('0x34')]:_0x28d808[_0x59f9('0x2f')];_0x207c5f['order']=qs[_0x59f9('0x49')](_0x19b138[_0x59f9('0x30')][_0x59f9('0x49')]);_0x207c5f['where']=qs[_0x59f9('0x32')](_['pick'](_0x19b138[_0x59f9('0x30')],_0x28d808[_0x59f9('0x32')]));if(_0x19b138['query'][_0x59f9('0x3a')]){_0x207c5f[_0x59f9('0x38')]=_['merge'](_0x207c5f[_0x59f9('0x38')],{'$or':_[_0x59f9('0x2a')](_0x207c5f[_0x59f9('0x34')],function(_0x9e98d){var _0x433c4d={};_0x433c4d[_0x9e98d]={'$like':'%'+_0x19b138[_0x59f9('0x30')][_0x59f9('0x3a')]+'%'};return _0x433c4d;})});}_0x207c5f=_['merge']({},_0x207c5f,_0x19b138[_0x59f9('0x3e')]);return _0x34a473['getDescriptions'](_0x207c5f);}})[_0x59f9('0x25')](function(_0x2aa2de){if(_0x2aa2de){_0x72fa29=_0x2aa2de[_0x59f9('0x36')];if(!_0x19b138[_0x59f9('0x30')]['hasOwnProperty']('nolimit')){_0x207c5f['limit']=qs[_0x59f9('0x1d')](_0x19b138['query'][_0x59f9('0x1d')]);_0x207c5f['offset']=qs[_0x59f9('0x1b')](_0x19b138[_0x59f9('0x30')]['offset']);}return _0x34a473['getDescriptions'](_0x207c5f);}})[_0x59f9('0x25')](function(_0x1c6b93){if(_0x1c6b93){return _0x1c6b93?{'count':_0x72fa29,'rows':_0x1c6b93}:null;}})[_0x59f9('0x25')](respondWithResult(_0x2fdd92,null))['catch'](handleError(_0x2fdd92,null));};exports['getTags']=function(_0x22404b,_0x355b10,_0x409375){var _0x502279={};var _0x4f1eae={};var _0x5c9600;var _0x143e5e;return db[_0x59f9('0x2b')]['findOne']({'where':{'id':_0x22404b[_0x59f9('0x41')]['id']}})[_0x59f9('0x25')](handleEntityNotFound(_0x355b10,null))[_0x59f9('0x25')](function(_0x502d2d){if(_0x502d2d){_0x5c9600=_0x502d2d;_0x4f1eae[_0x59f9('0x2f')]=_[_0x59f9('0x31')](db['Tag'][_0x59f9('0x2c')]);_0x4f1eae[_0x59f9('0x30')]=_[_0x59f9('0x31')](_0x22404b['query']);_0x4f1eae[_0x59f9('0x32')]=_['intersection'](_0x4f1eae[_0x59f9('0x2f')],_0x4f1eae[_0x59f9('0x30')]);_0x502279[_0x59f9('0x34')]=_['intersection'](_0x4f1eae['model'],qs[_0x59f9('0x35')](_0x22404b[_0x59f9('0x30')][_0x59f9('0x35')]));_0x502279['attributes']=_0x502279[_0x59f9('0x34')][_0x59f9('0x36')]?_0x502279[_0x59f9('0x34')]:_0x4f1eae[_0x59f9('0x2f')];_0x502279[_0x59f9('0x37')]=qs[_0x59f9('0x49')](_0x22404b['query'][_0x59f9('0x49')]);_0x502279[_0x59f9('0x38')]=qs[_0x59f9('0x32')](_[_0x59f9('0x39')](_0x22404b[_0x59f9('0x30')],_0x4f1eae[_0x59f9('0x32')]));if(_0x22404b['query']['filter']){_0x502279[_0x59f9('0x38')]=_['merge'](_0x502279[_0x59f9('0x38')],{'$or':_['map'](_0x502279[_0x59f9('0x34')],function(_0x414315){var _0x514433={};_0x514433[_0x414315]={'$like':'%'+_0x22404b[_0x59f9('0x30')][_0x59f9('0x3a')]+'%'};return _0x514433;})});}_0x502279=_[_0x59f9('0x43')]({},_0x502279,_0x22404b['options']);return _0x5c9600['getTags'](_0x502279);}})[_0x59f9('0x25')](function(_0x414d8f){if(_0x414d8f){_0x143e5e=_0x414d8f[_0x59f9('0x36')];if(!_0x22404b[_0x59f9('0x30')]['hasOwnProperty'](_0x59f9('0x4c'))){_0x502279[_0x59f9('0x1d')]=qs['limit'](_0x22404b[_0x59f9('0x30')][_0x59f9('0x1d')]);_0x502279[_0x59f9('0x1b')]=qs[_0x59f9('0x1b')](_0x22404b[_0x59f9('0x30')][_0x59f9('0x1b')]);}return _0x5c9600['getTags'](_0x502279);}})[_0x59f9('0x25')](function(_0x3a4f0a){if(_0x3a4f0a){return _0x3a4f0a?{'count':_0x143e5e,'rows':_0x3a4f0a}:null;}})[_0x59f9('0x25')](respondWithResult(_0x355b10,null))[_0x59f9('0x40')](handleError(_0x355b10,null));};exports['setTags']=function(_0x372917,_0x2ef55d,_0x48c960){if(_0x372917['body']['id']){delete _0x372917[_0x59f9('0x45')]['id'];}return db[_0x59f9('0x2b')]['findOne']({'where':{'id':_0x372917['params']['id']}})[_0x59f9('0x25')](handleEntityNotFound(_0x2ef55d,null))[_0x59f9('0x25')](function(_0x315695){if(_0x315695){return _0x315695['setTags'](_0x372917[_0x59f9('0x45')][_0x59f9('0x4e')]||[]);}return null;})[_0x59f9('0x25')](respondWithResult(_0x2ef55d,null))[_0x59f9('0x40')](handleError(_0x2ef55d,null));}; \ No newline at end of file +var _0x4522=['model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','findOne','FreshdeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../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','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','map','FreshdeskConfiguration','type','query','filters','intersection','attributes'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x4522,0x7d));var _0x2452=function(_0x135245,_0x207e50){_0x135245=_0x135245-0x0;var _0x3c91c7=_0x4522[_0x135245];return _0x3c91c7;};'use strict';var emlformat=require(_0x2452('0x0'));var rimraf=require(_0x2452('0x1'));var zipdir=require(_0x2452('0x2'));var jsonpatch=require(_0x2452('0x3'));var rp=require(_0x2452('0x4'));var moment=require(_0x2452('0x5'));var BPromise=require(_0x2452('0x6'));var Mustache=require(_0x2452('0x7'));var util=require(_0x2452('0x8'));var path=require(_0x2452('0x9'));var sox=require(_0x2452('0xa'));var csv=require(_0x2452('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2452('0xc'));var _=require(_0x2452('0xd'));var squel=require(_0x2452('0xe'));var crypto=require(_0x2452('0xf'));var jsforce=require(_0x2452('0x10'));var deskjs=require(_0x2452('0x11'));var toCsv=require('to-csv');var querystring=require(_0x2452('0x12'));var Papa=require(_0x2452('0x13'));var Redis=require(_0x2452('0x14'));var authService=require(_0x2452('0x15'));var qs=require(_0x2452('0x16'));var as=require(_0x2452('0x17'));var hardwareService=require(_0x2452('0x18'));var logger=require(_0x2452('0x19'))(_0x2452('0x1a'));var utils=require(_0x2452('0x1b'));var config=require(_0x2452('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x2452('0x1d'))['db'];function respondWithStatusCode(_0x16cbc1,_0x8abf1e){_0x8abf1e=_0x8abf1e||0xcc;return function(_0x4d42db){if(_0x4d42db){return _0x16cbc1[_0x2452('0x1e')](_0x8abf1e);}return _0x16cbc1[_0x2452('0x1f')](_0x8abf1e)['end']();};}function respondWithResult(_0x366ac9,_0x23b9b3){_0x23b9b3=_0x23b9b3||0xc8;return function(_0x2b1519){if(_0x2b1519){return _0x366ac9[_0x2452('0x1f')](_0x23b9b3)[_0x2452('0x20')](_0x2b1519);}};}function respondWithFilteredResult(_0x4853fe,_0x4dd346){return function(_0x3b9f65){if(_0x3b9f65){var _0x3e8b32=typeof _0x4dd346[_0x2452('0x21')]===_0x2452('0x22')&&typeof _0x4dd346[_0x2452('0x23')]===_0x2452('0x22');var _0x1c71c5=_0x3b9f65['count'];var _0x4a844f=_0x3e8b32?0x0:_0x4dd346[_0x2452('0x21')];var _0x12eb65=_0x3e8b32?_0x3b9f65['count']:_0x4dd346[_0x2452('0x21')]+_0x4dd346[_0x2452('0x23')];var _0x3ef2fe;if(_0x12eb65>=_0x1c71c5){_0x12eb65=_0x1c71c5;_0x3ef2fe=0xc8;}else{_0x3ef2fe=0xce;}_0x4853fe[_0x2452('0x1f')](_0x3ef2fe);return _0x4853fe[_0x2452('0x24')](_0x2452('0x25'),_0x4a844f+'-'+_0x12eb65+'/'+_0x1c71c5)[_0x2452('0x20')](_0x3b9f65);}return null;};}function patchUpdates(_0x3ce5e5){return function(_0x4ac8e5){try{jsonpatch[_0x2452('0x26')](_0x4ac8e5,_0x3ce5e5,!![]);}catch(_0x510f51){return BPromise[_0x2452('0x27')](_0x510f51);}return _0x4ac8e5[_0x2452('0x28')]();};}function saveUpdates(_0x1980ab,_0xaa4315){return function(_0x5ae3ee){if(_0x5ae3ee){return _0x5ae3ee['update'](_0x1980ab)[_0x2452('0x29')](function(_0x5c947b){return _0x5c947b;});}return null;};}function removeEntity(_0x235e30,_0x58ed65){return function(_0x475d0c){if(_0x475d0c){return _0x475d0c[_0x2452('0x2a')]()[_0x2452('0x29')](function(){_0x235e30[_0x2452('0x1f')](0xcc)[_0x2452('0x2b')]();});}};}function handleEntityNotFound(_0x1e5a1f,_0x3bc7c4){return function(_0x1bb600){if(!_0x1bb600){_0x1e5a1f['sendStatus'](0x194);}return _0x1bb600;};}function handleError(_0x5f3a9d,_0x13f43f){_0x13f43f=_0x13f43f||0x1f4;return function(_0x4fc662){logger[_0x2452('0x2c')](_0x4fc662[_0x2452('0x2d')]);if(_0x4fc662[_0x2452('0x2e')]){delete _0x4fc662['name'];}_0x5f3a9d['status'](_0x13f43f)['send'](_0x4fc662);};}exports[_0x2452('0x2f')]=function(_0x398d94,_0xbd8302){var _0x3dd382={},_0x278689={},_0x57722f={'count':0x0,'rows':[]};var _0x28894e=_[_0x2452('0x30')](db[_0x2452('0x31')]['rawAttributes'],function(_0x56f8ef){return{'name':_0x56f8ef['fieldName'],'type':_0x56f8ef[_0x2452('0x32')]['key']};});_0x278689['model']=_[_0x2452('0x30')](_0x28894e,_0x2452('0x2e'));_0x278689[_0x2452('0x33')]=_['keys'](_0x398d94[_0x2452('0x33')]);_0x278689[_0x2452('0x34')]=_[_0x2452('0x35')](_0x278689['model'],_0x278689['query']);_0x3dd382[_0x2452('0x36')]=_[_0x2452('0x35')](_0x278689[_0x2452('0x37')],qs[_0x2452('0x38')](_0x398d94[_0x2452('0x33')][_0x2452('0x38')]));_0x3dd382[_0x2452('0x36')]=_0x3dd382[_0x2452('0x36')][_0x2452('0x39')]?_0x3dd382[_0x2452('0x36')]:_0x278689['model'];if(!_0x398d94['query'][_0x2452('0x3a')](_0x2452('0x3b'))){_0x3dd382[_0x2452('0x23')]=qs[_0x2452('0x23')](_0x398d94[_0x2452('0x33')][_0x2452('0x23')]);_0x3dd382[_0x2452('0x21')]=qs[_0x2452('0x21')](_0x398d94[_0x2452('0x33')]['offset']);}_0x3dd382[_0x2452('0x3c')]=qs[_0x2452('0x3d')](_0x398d94[_0x2452('0x33')]['sort']);_0x3dd382[_0x2452('0x3e')]=qs[_0x2452('0x34')](_[_0x2452('0x3f')](_0x398d94[_0x2452('0x33')],_0x278689[_0x2452('0x34')]),_0x28894e);if(_0x398d94[_0x2452('0x33')][_0x2452('0x40')]){_0x3dd382[_0x2452('0x3e')]=_[_0x2452('0x41')](_0x3dd382[_0x2452('0x3e')],{'$or':_[_0x2452('0x30')](_0x28894e,function(_0x29a7c1){if(_0x29a7c1[_0x2452('0x32')]!==_0x2452('0x42')){var _0x196185={};_0x196185[_0x29a7c1[_0x2452('0x2e')]]={'$like':'%'+_0x398d94[_0x2452('0x33')][_0x2452('0x40')]+'%'};return _0x196185;}})});}_0x3dd382=_[_0x2452('0x41')]({},_0x3dd382,_0x398d94[_0x2452('0x43')]);var _0x50f95f={'where':_0x3dd382[_0x2452('0x3e')]};return db['FreshdeskConfiguration'][_0x2452('0x44')](_0x50f95f)[_0x2452('0x29')](function(_0x153766){_0x57722f[_0x2452('0x44')]=_0x153766;if(_0x398d94[_0x2452('0x33')][_0x2452('0x45')]){_0x3dd382[_0x2452('0x46')]=[{'all':!![]}];}return db[_0x2452('0x31')][_0x2452('0x47')](_0x3dd382);})[_0x2452('0x29')](function(_0x49d796){_0x57722f[_0x2452('0x48')]=_0x49d796;return _0x57722f;})[_0x2452('0x29')](respondWithFilteredResult(_0xbd8302,_0x3dd382))[_0x2452('0x49')](handleError(_0xbd8302,null));};exports[_0x2452('0x4a')]=function(_0x529c28,_0x184137){var _0x4e50ea={'raw':![],'where':{'id':_0x529c28[_0x2452('0x4b')]['id']}},_0x423b5b={};_0x423b5b[_0x2452('0x37')]=_[_0x2452('0x4c')](db[_0x2452('0x31')][_0x2452('0x4d')]);_0x423b5b[_0x2452('0x33')]=_[_0x2452('0x4c')](_0x529c28[_0x2452('0x33')]);_0x423b5b[_0x2452('0x34')]=_[_0x2452('0x35')](_0x423b5b[_0x2452('0x37')],_0x423b5b[_0x2452('0x33')]);_0x4e50ea['attributes']=_['intersection'](_0x423b5b[_0x2452('0x37')],qs[_0x2452('0x38')](_0x529c28[_0x2452('0x33')][_0x2452('0x38')]));_0x4e50ea[_0x2452('0x36')]=_0x4e50ea['attributes'][_0x2452('0x39')]?_0x4e50ea[_0x2452('0x36')]:_0x423b5b[_0x2452('0x37')];if(_0x529c28[_0x2452('0x33')][_0x2452('0x45')]){_0x4e50ea[_0x2452('0x46')]=[{'all':!![]}];}_0x4e50ea=_[_0x2452('0x41')]({},_0x4e50ea,_0x529c28[_0x2452('0x43')]);return db[_0x2452('0x31')][_0x2452('0x4e')](_0x4e50ea)[_0x2452('0x29')](handleEntityNotFound(_0x184137,null))[_0x2452('0x29')](respondWithResult(_0x184137,null))[_0x2452('0x49')](handleError(_0x184137,null));};exports[_0x2452('0x4f')]=function(_0x28a1af,_0x5df9aa){return db[_0x2452('0x31')][_0x2452('0x4f')](_0x28a1af[_0x2452('0x50')],{})['then'](respondWithResult(_0x5df9aa,0xc9))[_0x2452('0x49')](handleError(_0x5df9aa,null));};exports['update']=function(_0x2b0f2f,_0x198b46){if(_0x2b0f2f[_0x2452('0x50')]['id']){delete _0x2b0f2f[_0x2452('0x50')]['id'];}return db[_0x2452('0x31')][_0x2452('0x4e')]({'where':{'id':_0x2b0f2f['params']['id']}})[_0x2452('0x29')](handleEntityNotFound(_0x198b46,null))[_0x2452('0x29')](saveUpdates(_0x2b0f2f[_0x2452('0x50')],null))['then'](respondWithResult(_0x198b46,null))['catch'](handleError(_0x198b46,null));};exports[_0x2452('0x2a')]=function(_0x4a17e9,_0x165db2){return db[_0x2452('0x31')][_0x2452('0x4e')]({'where':{'id':_0x4a17e9['params']['id']}})[_0x2452('0x29')](handleEntityNotFound(_0x165db2,null))[_0x2452('0x29')](removeEntity(_0x165db2,null))[_0x2452('0x49')](handleError(_0x165db2,null));};exports['getFields']=function(_0x2d534e,_0xd6f85d,_0x4701f0){var _0x4dbd97={};var _0x5226ea={};var _0x17c779;var _0x1eb957;return db['FreshdeskConfiguration'][_0x2452('0x51')]({'where':{'id':_0x2d534e[_0x2452('0x4b')]['id']}})[_0x2452('0x29')](handleEntityNotFound(_0xd6f85d,null))[_0x2452('0x29')](function(_0x3b0167){if(_0x3b0167){_0x17c779=_0x3b0167;_0x5226ea[_0x2452('0x37')]=_[_0x2452('0x4c')](db[_0x2452('0x52')]['rawAttributes']);_0x5226ea[_0x2452('0x33')]=_[_0x2452('0x4c')](_0x2d534e[_0x2452('0x33')]);_0x5226ea[_0x2452('0x34')]=_[_0x2452('0x35')](_0x5226ea[_0x2452('0x37')],_0x5226ea['query']);_0x4dbd97[_0x2452('0x36')]=_[_0x2452('0x35')](_0x5226ea[_0x2452('0x37')],qs[_0x2452('0x38')](_0x2d534e[_0x2452('0x33')][_0x2452('0x38')]));_0x4dbd97[_0x2452('0x36')]=_0x4dbd97[_0x2452('0x36')][_0x2452('0x39')]?_0x4dbd97['attributes']:_0x5226ea[_0x2452('0x37')];_0x4dbd97[_0x2452('0x3c')]=qs[_0x2452('0x3d')](_0x2d534e[_0x2452('0x33')][_0x2452('0x3d')]);_0x4dbd97[_0x2452('0x3e')]=qs[_0x2452('0x34')](_[_0x2452('0x3f')](_0x2d534e[_0x2452('0x33')],_0x5226ea[_0x2452('0x34')]));if(_0x2d534e['query'][_0x2452('0x40')]){_0x4dbd97[_0x2452('0x3e')]=_[_0x2452('0x41')](_0x4dbd97[_0x2452('0x3e')],{'$or':_[_0x2452('0x30')](_0x4dbd97['attributes'],function(_0x255e4d){var _0x57d3af={};_0x57d3af[_0x255e4d]={'$like':'%'+_0x2d534e['query'][_0x2452('0x40')]+'%'};return _0x57d3af;})});}_0x4dbd97=_[_0x2452('0x41')]({},_0x4dbd97,_0x2d534e['options']);return _0x17c779[_0x2452('0x53')](_0x4dbd97);}})['then'](function(_0x37eef4){if(_0x37eef4){_0x1eb957=_0x37eef4[_0x2452('0x39')];if(!_0x2d534e[_0x2452('0x33')]['hasOwnProperty'](_0x2452('0x3b'))){_0x4dbd97['limit']=qs[_0x2452('0x23')](_0x2d534e[_0x2452('0x33')][_0x2452('0x23')]);_0x4dbd97[_0x2452('0x21')]=qs['offset'](_0x2d534e[_0x2452('0x33')][_0x2452('0x21')]);}return _0x17c779[_0x2452('0x53')](_0x4dbd97);}})[_0x2452('0x29')](function(_0x237195){if(_0x237195){return _0x237195?{'count':_0x1eb957,'rows':_0x237195}:null;}})[_0x2452('0x29')](respondWithResult(_0xd6f85d,null))[_0x2452('0x49')](handleError(_0xd6f85d,null));};exports['getSubjects']=function(_0x37cf34,_0x24e21f,_0x3fcd69){var _0x3c3c40={};var _0x3c4ef4={};var _0x4e6fda;var _0x135490;return db[_0x2452('0x31')][_0x2452('0x51')]({'where':{'id':_0x37cf34[_0x2452('0x4b')]['id']}})[_0x2452('0x29')](handleEntityNotFound(_0x24e21f,null))[_0x2452('0x29')](function(_0x18a9de){if(_0x18a9de){_0x4e6fda=_0x18a9de;_0x3c4ef4[_0x2452('0x37')]=_[_0x2452('0x4c')](db[_0x2452('0x52')][_0x2452('0x4d')]);_0x3c4ef4[_0x2452('0x33')]=_[_0x2452('0x4c')](_0x37cf34[_0x2452('0x33')]);_0x3c4ef4['filters']=_['intersection'](_0x3c4ef4[_0x2452('0x37')],_0x3c4ef4[_0x2452('0x33')]);_0x3c3c40[_0x2452('0x36')]=_[_0x2452('0x35')](_0x3c4ef4[_0x2452('0x37')],qs[_0x2452('0x38')](_0x37cf34[_0x2452('0x33')]['fields']));_0x3c3c40[_0x2452('0x36')]=_0x3c3c40[_0x2452('0x36')]['length']?_0x3c3c40[_0x2452('0x36')]:_0x3c4ef4[_0x2452('0x37')];_0x3c3c40['order']=qs[_0x2452('0x3d')](_0x37cf34[_0x2452('0x33')][_0x2452('0x3d')]);_0x3c3c40[_0x2452('0x3e')]=qs[_0x2452('0x34')](_[_0x2452('0x3f')](_0x37cf34['query'],_0x3c4ef4[_0x2452('0x34')]));if(_0x37cf34[_0x2452('0x33')][_0x2452('0x40')]){_0x3c3c40[_0x2452('0x3e')]=_[_0x2452('0x41')](_0x3c3c40[_0x2452('0x3e')],{'$or':_[_0x2452('0x30')](_0x3c3c40[_0x2452('0x36')],function(_0x4fdcff){var _0x4664cd={};_0x4664cd[_0x4fdcff]={'$like':'%'+_0x37cf34[_0x2452('0x33')][_0x2452('0x40')]+'%'};return _0x4664cd;})});}_0x3c3c40=_['merge']({},_0x3c3c40,_0x37cf34[_0x2452('0x43')]);return _0x4e6fda[_0x2452('0x54')](_0x3c3c40);}})['then'](function(_0x28cb13){if(_0x28cb13){_0x135490=_0x28cb13[_0x2452('0x39')];if(!_0x37cf34[_0x2452('0x33')]['hasOwnProperty']('nolimit')){_0x3c3c40[_0x2452('0x23')]=qs['limit'](_0x37cf34['query'][_0x2452('0x23')]);_0x3c3c40['offset']=qs[_0x2452('0x21')](_0x37cf34[_0x2452('0x33')][_0x2452('0x21')]);}return _0x4e6fda[_0x2452('0x54')](_0x3c3c40);}})[_0x2452('0x29')](function(_0x4e00d8){if(_0x4e00d8){return _0x4e00d8?{'count':_0x135490,'rows':_0x4e00d8}:null;}})[_0x2452('0x29')](respondWithResult(_0x24e21f,null))['catch'](handleError(_0x24e21f,null));};exports[_0x2452('0x55')]=function(_0x1c05d2,_0x2b0fb0,_0x406234){var _0xf09ab9={};var _0x285f4d={};var _0x4f03f7;var _0x36df4a;return db[_0x2452('0x31')][_0x2452('0x51')]({'where':{'id':_0x1c05d2[_0x2452('0x4b')]['id']}})[_0x2452('0x29')](handleEntityNotFound(_0x2b0fb0,null))['then'](function(_0x1376fe){if(_0x1376fe){_0x4f03f7=_0x1376fe;_0x285f4d[_0x2452('0x37')]=_['keys'](db['FreshdeskField'][_0x2452('0x4d')]);_0x285f4d['query']=_[_0x2452('0x4c')](_0x1c05d2[_0x2452('0x33')]);_0x285f4d[_0x2452('0x34')]=_['intersection'](_0x285f4d[_0x2452('0x37')],_0x285f4d[_0x2452('0x33')]);_0xf09ab9[_0x2452('0x36')]=_[_0x2452('0x35')](_0x285f4d[_0x2452('0x37')],qs[_0x2452('0x38')](_0x1c05d2['query']['fields']));_0xf09ab9[_0x2452('0x36')]=_0xf09ab9[_0x2452('0x36')][_0x2452('0x39')]?_0xf09ab9[_0x2452('0x36')]:_0x285f4d['model'];_0xf09ab9[_0x2452('0x3c')]=qs[_0x2452('0x3d')](_0x1c05d2[_0x2452('0x33')][_0x2452('0x3d')]);_0xf09ab9[_0x2452('0x3e')]=qs['filters'](_[_0x2452('0x3f')](_0x1c05d2[_0x2452('0x33')],_0x285f4d['filters']));if(_0x1c05d2['query'][_0x2452('0x40')]){_0xf09ab9[_0x2452('0x3e')]=_[_0x2452('0x41')](_0xf09ab9[_0x2452('0x3e')],{'$or':_[_0x2452('0x30')](_0xf09ab9[_0x2452('0x36')],function(_0x8f8483){var _0x5e4a5b={};_0x5e4a5b[_0x8f8483]={'$like':'%'+_0x1c05d2['query'][_0x2452('0x40')]+'%'};return _0x5e4a5b;})});}_0xf09ab9=_[_0x2452('0x41')]({},_0xf09ab9,_0x1c05d2['options']);return _0x4f03f7['getDescriptions'](_0xf09ab9);}})[_0x2452('0x29')](function(_0x38c706){if(_0x38c706){_0x36df4a=_0x38c706[_0x2452('0x39')];if(!_0x1c05d2[_0x2452('0x33')][_0x2452('0x3a')](_0x2452('0x3b'))){_0xf09ab9[_0x2452('0x23')]=qs['limit'](_0x1c05d2[_0x2452('0x33')]['limit']);_0xf09ab9[_0x2452('0x21')]=qs[_0x2452('0x21')](_0x1c05d2[_0x2452('0x33')]['offset']);}return _0x4f03f7[_0x2452('0x55')](_0xf09ab9);}})['then'](function(_0x30ac37){if(_0x30ac37){return _0x30ac37?{'count':_0x36df4a,'rows':_0x30ac37}:null;}})[_0x2452('0x29')](respondWithResult(_0x2b0fb0,null))['catch'](handleError(_0x2b0fb0,null));};exports[_0x2452('0x56')]=function(_0x46dd0e,_0x44d1f9,_0x582288){var _0x55637c={};var _0x1b76d5={};var _0x3b7e7a;var _0x2b49bb;return db[_0x2452('0x31')]['findOne']({'where':{'id':_0x46dd0e['params']['id']}})[_0x2452('0x29')](handleEntityNotFound(_0x44d1f9,null))[_0x2452('0x29')](function(_0x2478fd){if(_0x2478fd){_0x3b7e7a=_0x2478fd;_0x1b76d5[_0x2452('0x37')]=_[_0x2452('0x4c')](db[_0x2452('0x57')][_0x2452('0x4d')]);_0x1b76d5[_0x2452('0x33')]=_['keys'](_0x46dd0e[_0x2452('0x33')]);_0x1b76d5[_0x2452('0x34')]=_[_0x2452('0x35')](_0x1b76d5[_0x2452('0x37')],_0x1b76d5[_0x2452('0x33')]);_0x55637c[_0x2452('0x36')]=_[_0x2452('0x35')](_0x1b76d5[_0x2452('0x37')],qs[_0x2452('0x38')](_0x46dd0e['query'][_0x2452('0x38')]));_0x55637c[_0x2452('0x36')]=_0x55637c['attributes']['length']?_0x55637c[_0x2452('0x36')]:_0x1b76d5[_0x2452('0x37')];_0x55637c['order']=qs[_0x2452('0x3d')](_0x46dd0e['query'][_0x2452('0x3d')]);_0x55637c[_0x2452('0x3e')]=qs[_0x2452('0x34')](_[_0x2452('0x3f')](_0x46dd0e[_0x2452('0x33')],_0x1b76d5[_0x2452('0x34')]));if(_0x46dd0e[_0x2452('0x33')][_0x2452('0x40')]){_0x55637c[_0x2452('0x3e')]=_['merge'](_0x55637c['where'],{'$or':_[_0x2452('0x30')](_0x55637c['attributes'],function(_0x14dc67){var _0x442ed1={};_0x442ed1[_0x14dc67]={'$like':'%'+_0x46dd0e[_0x2452('0x33')][_0x2452('0x40')]+'%'};return _0x442ed1;})});}_0x55637c=_[_0x2452('0x41')]({},_0x55637c,_0x46dd0e[_0x2452('0x43')]);return _0x3b7e7a[_0x2452('0x56')](_0x55637c);}})[_0x2452('0x29')](function(_0xadbdcd){if(_0xadbdcd){_0x2b49bb=_0xadbdcd[_0x2452('0x39')];if(!_0x46dd0e[_0x2452('0x33')]['hasOwnProperty'](_0x2452('0x3b'))){_0x55637c[_0x2452('0x23')]=qs['limit'](_0x46dd0e[_0x2452('0x33')][_0x2452('0x23')]);_0x55637c['offset']=qs[_0x2452('0x21')](_0x46dd0e[_0x2452('0x33')][_0x2452('0x21')]);}return _0x3b7e7a[_0x2452('0x56')](_0x55637c);}})[_0x2452('0x29')](function(_0x213283){if(_0x213283){return _0x213283?{'count':_0x2b49bb,'rows':_0x213283}:null;}})[_0x2452('0x29')](respondWithResult(_0x44d1f9,null))['catch'](handleError(_0x44d1f9,null));};exports[_0x2452('0x58')]=function(_0x43227b,_0x8ccfef,_0x56cdee){if(_0x43227b[_0x2452('0x50')]['id']){delete _0x43227b['body']['id'];}return db[_0x2452('0x31')][_0x2452('0x51')]({'where':{'id':_0x43227b[_0x2452('0x4b')]['id']}})[_0x2452('0x29')](handleEntityNotFound(_0x8ccfef,null))[_0x2452('0x29')](function(_0x4ba0e9){if(_0x4ba0e9){return _0x4ba0e9[_0x2452('0x58')](_0x43227b[_0x2452('0x50')][_0x2452('0x59')]||[]);}return null;})[_0x2452('0x29')](respondWithResult(_0x8ccfef,null))[_0x2452('0x49')](handleError(_0x8ccfef,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 416c02a..0a411b4 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 _0xadc9=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','FreshdeskConfiguration','int_freshdesk_configurations','lodash'];(function(_0x3e604c,_0x52b684){var _0x392a2f=function(_0x87d20){while(--_0x87d20){_0x3e604c['push'](_0x3e604c['shift']());}};_0x392a2f(++_0x52b684);}(_0xadc9,0xe6));var _0x9adc=function(_0x509132,_0x18178b){_0x509132=_0x509132-0x0;var _0x1e3b85=_0xadc9[_0x509132];return _0x1e3b85;};'use strict';var _=require(_0x9adc('0x0'));var util=require(_0x9adc('0x1'));var logger=require(_0x9adc('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9adc('0x3'));var rp=require(_0x9adc('0x4'));var fs=require('fs');var path=require(_0x9adc('0x5'));var rimraf=require(_0x9adc('0x6'));var config=require(_0x9adc('0x7'));var attributes=require(_0x9adc('0x8'));module['exports']=function(_0x24cca0,_0x310789){return _0x24cca0['define'](_0x9adc('0x9'),attributes,{'tableName':_0x9adc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf662=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf662,0x8b));var _0x2f66=function(_0x390752,_0x42cad3){_0x390752=_0x390752-0x0;var _0x5eca55=_0xf662[_0x390752];return _0x5eca55;};'use strict';var _=require(_0x2f66('0x0'));var util=require(_0x2f66('0x1'));var logger=require(_0x2f66('0x2'))(_0x2f66('0x3'));var moment=require(_0x2f66('0x4'));var BPromise=require(_0x2f66('0x5'));var rp=require(_0x2f66('0x6'));var fs=require('fs');var path=require(_0x2f66('0x7'));var rimraf=require('rimraf');var config=require(_0x2f66('0x8'));var attributes=require(_0x2f66('0x9'));module[_0x2f66('0xa')]=function(_0x2ecc8c,_0xb80131){return _0x2ecc8c[_0x2f66('0xb')](_0x2f66('0xc'),attributes,{'tableName':_0x2f66('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 2d85046..3218856 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 _0x0a38=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x1a7261,_0x17ec8c){var _0x4d5f9b=function(_0x677b0a){while(--_0x677b0a){_0x1a7261['push'](_0x1a7261['shift']());}};_0x4d5f9b(++_0x17ec8c);}(_0x0a38,0x11c));var _0x80a3=function(_0x482dd6,_0x353712){_0x482dd6=_0x482dd6-0x0;var _0x3c7b3c=_0x0a38[_0x482dd6];return _0x3c7b3c;};'use strict';var _=require(_0x80a3('0x0'));var util=require(_0x80a3('0x1'));var moment=require('moment');var BPromise=require(_0x80a3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80a3('0x3'));var db=require(_0x80a3('0x4'))['db'];var utils=require(_0x80a3('0x5'));var logger=require(_0x80a3('0x6'))('rpc');var config=require(_0x80a3('0x7'));var jayson=require(_0x80a3('0x8'));var client=jayson[_0x80a3('0x9')][_0x80a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e0d9e,_0x216822,_0x3f5e64){return new BPromise(function(_0x37af6c,_0x425e87){return client[_0x80a3('0xb')](_0x4e0d9e,_0x3f5e64)[_0x80a3('0xc')](function(_0x270256){logger[_0x80a3('0xd')](_0x80a3('0xe'),_0x216822,'request\x20sent');logger[_0x80a3('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x216822,_0x80a3('0x10'),JSON[_0x80a3('0x11')](_0x270256));if(_0x270256[_0x80a3('0x12')]){if(_0x270256[_0x80a3('0x12')]['code']===0x1f4){logger['error'](_0x80a3('0xe'),_0x216822,_0x270256['error']['message']);return _0x425e87(_0x270256[_0x80a3('0x12')]['message']);}logger[_0x80a3('0x12')](_0x80a3('0xe'),_0x216822,_0x270256[_0x80a3('0x12')][_0x80a3('0x13')]);return _0x37af6c(_0x270256['error']['message']);}else{logger[_0x80a3('0xd')](_0x80a3('0xe'),_0x216822,_0x80a3('0x10'));_0x37af6c(_0x270256[_0x80a3('0x14')][_0x80a3('0x13')]);}})[_0x80a3('0x15')](function(_0x466d27){logger['error'](_0x80a3('0xe'),_0x216822,_0x466d27);_0x425e87(_0x466d27);});});} \ No newline at end of file +var _0x3ff3=['error','message','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x2a4881,_0x141fa9){var _0x8083c0=function(_0x4c49ae){while(--_0x4c49ae){_0x2a4881['push'](_0x2a4881['shift']());}};_0x8083c0(++_0x141fa9);}(_0x3ff3,0x16b));var _0x33ff=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x3ff3[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x33ff('0x0'));var BPromise=require(_0x33ff('0x1'));var rs=require(_0x33ff('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x33ff('0x3'))['db'];var utils=require(_0x33ff('0x4'));var logger=require(_0x33ff('0x5'))(_0x33ff('0x6'));var config=require('../../config/environment');var jayson=require(_0x33ff('0x7'));var client=jayson[_0x33ff('0x8')][_0x33ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30f9d5,_0x205b8d,_0x116a15){return new BPromise(function(_0x281c10,_0x12c9cc){return client['request'](_0x30f9d5,_0x116a15)[_0x33ff('0xa')](function(_0xbae9ce){logger['info'](_0x33ff('0xb'),_0x205b8d,_0x33ff('0xc'));logger[_0x33ff('0xd')](_0x33ff('0xe'),_0x205b8d,_0x33ff('0xc'),JSON['stringify'](_0xbae9ce));if(_0xbae9ce[_0x33ff('0xf')]){if(_0xbae9ce[_0x33ff('0xf')]['code']===0x1f4){logger['error'](_0x33ff('0xb'),_0x205b8d,_0xbae9ce[_0x33ff('0xf')]['message']);return _0x12c9cc(_0xbae9ce[_0x33ff('0xf')][_0x33ff('0x10')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x205b8d,_0xbae9ce[_0x33ff('0xf')][_0x33ff('0x10')]);return _0x281c10(_0xbae9ce['error'][_0x33ff('0x10')]);}else{logger['info'](_0x33ff('0xb'),_0x205b8d,'request\x20sent');_0x281c10(_0xbae9ce['result'][_0x33ff('0x10')]);}})[_0x33ff('0x11')](function(_0x2ad778){logger[_0x33ff('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x205b8d,_0x2ad778);_0x12c9cc(_0x2ad778);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index d23d7b6..71a94ff 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 _0x1054=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','show','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout'];(function(_0x415603,_0x21320c){var _0x131e72=function(_0x50092a){while(--_0x50092a){_0x415603['push'](_0x415603['shift']());}};_0x131e72(++_0x21320c);}(_0x1054,0x165));var _0x4105=function(_0x20ba95,_0x2e9c75){_0x20ba95=_0x20ba95-0x0;var _0x3dc88e=_0x1054[_0x20ba95];return _0x3dc88e;};'use strict';var multer=require(_0x4105('0x0'));var util=require(_0x4105('0x1'));var path=require(_0x4105('0x2'));var timeout=require(_0x4105('0x3'));var express=require(_0x4105('0x4'));var router=express['Router']();var fs_extra=require(_0x4105('0x5'));var auth=require(_0x4105('0x6'));var interaction=require(_0x4105('0x7'));var config=require(_0x4105('0x8'));var controller=require(_0x4105('0x9'));router[_0x4105('0xa')]('/',auth[_0x4105('0xb')](),controller['index']);router[_0x4105('0xa')]('/:id',auth[_0x4105('0xb')](),controller[_0x4105('0xc')]);router[_0x4105('0xd')]('/',auth[_0x4105('0xb')](),controller[_0x4105('0xe')]);router[_0x4105('0xf')](_0x4105('0x10'),auth[_0x4105('0xb')](),controller[_0x4105('0x11')]);router['delete'](_0x4105('0x10'),auth[_0x4105('0xb')](),controller[_0x4105('0x12')]);module['exports']=router; \ No newline at end of file +var _0x81a6=['index','get','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intFreshdeskField.controller','isAuthenticated'];(function(_0xb140a8,_0x2a65f0){var _0x1372e4=function(_0x2b0271){while(--_0x2b0271){_0xb140a8['push'](_0xb140a8['shift']());}};_0x1372e4(++_0x2a65f0);}(_0x81a6,0x100));var _0x681a=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x81a6[_0x3c8e9a];return _0x2d4c57;};'use strict';var multer=require(_0x681a('0x0'));var util=require(_0x681a('0x1'));var path=require(_0x681a('0x2'));var timeout=require(_0x681a('0x3'));var express=require(_0x681a('0x4'));var router=express[_0x681a('0x5')]();var fs_extra=require(_0x681a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x681a('0x7'));var config=require('../../config/environment');var controller=require(_0x681a('0x8'));router['get']('/',auth[_0x681a('0x9')](),controller[_0x681a('0xa')]);router[_0x681a('0xb')](_0x681a('0xc'),auth[_0x681a('0x9')](),controller[_0x681a('0xd')]);router['post']('/',auth[_0x681a('0x9')](),controller['create']);router[_0x681a('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x681a('0xf')]);router[_0x681a('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x681a('0x11')]);module[_0x681a('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 319d46b..f822bc3 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 _0x8a07=['keyValue','STRING','customVariable','sequelize','exports','string','variable'];(function(_0x20cc29,_0x30a46d){var _0x28d513=function(_0x179b06){while(--_0x179b06){_0x20cc29['push'](_0x20cc29['shift']());}};_0x28d513(++_0x30a46d);}(_0x8a07,0x73));var _0x78a0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8a07[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x78a0('0x0'));module[_0x78a0('0x1')]={'type':{'type':Sequelize['ENUM'](_0x78a0('0x2'),_0x78a0('0x3'),'customVariable',_0x78a0('0x4'),'picklist'),'defaultValue':_0x78a0('0x2')},'content':{'type':Sequelize[_0x78a0('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x78a0('0x2'),_0x78a0('0x3'),_0x78a0('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x78a0('0x5')]},'nameField':{'type':Sequelize[_0x78a0('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x78a0('0x5')]}}; \ No newline at end of file +var _0x1d2d=['string','variable','keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x1d2d,0x6e));var _0xd1d2=function(_0x11ae36,_0x4e17d6){_0x11ae36=_0x11ae36-0x0;var _0x5b8a8e=_0x1d2d[_0x11ae36];return _0x5b8a8e;};'use strict';var Sequelize=require(_0xd1d2('0x0'));module['exports']={'type':{'type':Sequelize[_0xd1d2('0x1')](_0xd1d2('0x2'),_0xd1d2('0x3'),'customVariable',_0xd1d2('0x4'),_0xd1d2('0x5')),'defaultValue':_0xd1d2('0x2')},'content':{'type':Sequelize[_0xd1d2('0x6')]},'key':{'type':Sequelize[_0xd1d2('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xd1d2('0x2'),_0xd1d2('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xd1d2('0x6')]},'idField':{'type':Sequelize[_0xd1d2('0x6')]},'nameField':{'type':Sequelize[_0xd1d2('0x6')]},'customField':{'type':Sequelize[_0xd1d2('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd1d2('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 369789d..524c159 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 _0x3c81=['apply','reject','save','update','then','destroy','end','error','name','send','map','FreshdeskField','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c81,0x102));var _0x13c8=function(_0x27bcba,_0x12fe8d){_0x27bcba=_0x27bcba-0x0;var _0x3b3325=_0x3c81[_0x27bcba];return _0x3b3325;};'use strict';var emlformat=require(_0x13c8('0x0'));var rimraf=require(_0x13c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x13c8('0x2'));var rp=require(_0x13c8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x13c8('0x4'));var sox=require(_0x13c8('0x5'));var csv=require(_0x13c8('0x6'));var ejs=require(_0x13c8('0x7'));var fs=require('fs');var fs_extra=require(_0x13c8('0x8'));var _=require(_0x13c8('0x9'));var squel=require(_0x13c8('0xa'));var crypto=require('crypto');var jsforce=require(_0x13c8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x13c8('0x6'));var querystring=require(_0x13c8('0xc'));var Papa=require(_0x13c8('0xd'));var Redis=require(_0x13c8('0xe'));var authService=require(_0x13c8('0xf'));var qs=require(_0x13c8('0x10'));var as=require(_0x13c8('0x11'));var hardwareService=require(_0x13c8('0x12'));var logger=require(_0x13c8('0x13'))(_0x13c8('0x14'));var utils=require(_0x13c8('0x15'));var config=require(_0x13c8('0x16'));var licenseUtil=require(_0x13c8('0x17'));var db=require(_0x13c8('0x18'))['db'];function respondWithStatusCode(_0x5ab91d,_0x21442d){_0x21442d=_0x21442d||0xcc;return function(_0x7b6da8){if(_0x7b6da8){return _0x5ab91d[_0x13c8('0x19')](_0x21442d);}return _0x5ab91d[_0x13c8('0x1a')](_0x21442d)['end']();};}function respondWithResult(_0x42955d,_0x515681){_0x515681=_0x515681||0xc8;return function(_0x4d7a88){if(_0x4d7a88){return _0x42955d['status'](_0x515681)[_0x13c8('0x1b')](_0x4d7a88);}};}function respondWithFilteredResult(_0x5e0e06,_0x337397){return function(_0x17a3c1){if(_0x17a3c1){var _0x23f64e=typeof _0x337397[_0x13c8('0x1c')]==='undefined'&&typeof _0x337397[_0x13c8('0x1d')]===_0x13c8('0x1e');var _0x31ae02=_0x17a3c1[_0x13c8('0x1f')];var _0xce1ad2=_0x23f64e?0x0:_0x337397[_0x13c8('0x1c')];var _0x346417=_0x23f64e?_0x17a3c1[_0x13c8('0x1f')]:_0x337397[_0x13c8('0x1c')]+_0x337397[_0x13c8('0x1d')];var _0xe9386a;if(_0x346417>=_0x31ae02){_0x346417=_0x31ae02;_0xe9386a=0xc8;}else{_0xe9386a=0xce;}_0x5e0e06['status'](_0xe9386a);return _0x5e0e06[_0x13c8('0x20')](_0x13c8('0x21'),_0xce1ad2+'-'+_0x346417+'/'+_0x31ae02)[_0x13c8('0x1b')](_0x17a3c1);}return null;};}function patchUpdates(_0x313ea3){return function(_0x513085){try{jsonpatch[_0x13c8('0x22')](_0x513085,_0x313ea3,!![]);}catch(_0x3c4603){return BPromise[_0x13c8('0x23')](_0x3c4603);}return _0x513085[_0x13c8('0x24')]();};}function saveUpdates(_0x436d5d,_0x2fc123){return function(_0x5ab47f){if(_0x5ab47f){return _0x5ab47f[_0x13c8('0x25')](_0x436d5d)[_0x13c8('0x26')](function(_0x315d6c){return _0x315d6c;});}return null;};}function removeEntity(_0xcf41d2,_0x577df6){return function(_0x1770e5){if(_0x1770e5){return _0x1770e5[_0x13c8('0x27')]()['then'](function(){_0xcf41d2['status'](0xcc)[_0x13c8('0x28')]();});}};}function handleEntityNotFound(_0x4aff35,_0x47e8ae){return function(_0x5ad0dc){if(!_0x5ad0dc){_0x4aff35[_0x13c8('0x19')](0x194);}return _0x5ad0dc;};}function handleError(_0xc7f1b6,_0x53ada9){_0x53ada9=_0x53ada9||0x1f4;return function(_0x4df077){logger[_0x13c8('0x29')](_0x4df077['stack']);if(_0x4df077['name']){delete _0x4df077[_0x13c8('0x2a')];}_0xc7f1b6[_0x13c8('0x1a')](_0x53ada9)[_0x13c8('0x2b')](_0x4df077);};}exports['index']=function(_0x5ef2f7,_0x277a89){var _0x1071a0={},_0x399840={},_0x441182={'count':0x0,'rows':[]};var _0x138017=_[_0x13c8('0x2c')](db[_0x13c8('0x2d')]['rawAttributes'],function(_0x109cb8){return{'name':_0x109cb8[_0x13c8('0x2e')],'type':_0x109cb8['type']['key']};});_0x399840[_0x13c8('0x2f')]=_[_0x13c8('0x2c')](_0x138017,'name');_0x399840[_0x13c8('0x30')]=_[_0x13c8('0x31')](_0x5ef2f7['query']);_0x399840[_0x13c8('0x32')]=_[_0x13c8('0x33')](_0x399840[_0x13c8('0x2f')],_0x399840[_0x13c8('0x30')]);_0x1071a0[_0x13c8('0x34')]=_[_0x13c8('0x33')](_0x399840[_0x13c8('0x2f')],qs[_0x13c8('0x35')](_0x5ef2f7['query']['fields']));_0x1071a0[_0x13c8('0x34')]=_0x1071a0[_0x13c8('0x34')]['length']?_0x1071a0[_0x13c8('0x34')]:_0x399840['model'];if(!_0x5ef2f7[_0x13c8('0x30')]['hasOwnProperty'](_0x13c8('0x36'))){_0x1071a0[_0x13c8('0x1d')]=qs[_0x13c8('0x1d')](_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x1d')]);_0x1071a0[_0x13c8('0x1c')]=qs[_0x13c8('0x1c')](_0x5ef2f7['query'][_0x13c8('0x1c')]);}_0x1071a0[_0x13c8('0x37')]=qs['sort'](_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x38')]);_0x1071a0[_0x13c8('0x39')]=qs['filters'](_['pick'](_0x5ef2f7['query'],_0x399840[_0x13c8('0x32')]),_0x138017);if(_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x3a')]){_0x1071a0[_0x13c8('0x39')]=_[_0x13c8('0x3b')](_0x1071a0[_0x13c8('0x39')],{'$or':_[_0x13c8('0x2c')](_0x138017,function(_0xe19858){if(_0xe19858[_0x13c8('0x3c')]!=='VIRTUAL'){var _0x5b2a28={};_0x5b2a28[_0xe19858[_0x13c8('0x2a')]]={'$like':'%'+_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x3a')]+'%'};return _0x5b2a28;}})});}_0x1071a0=_[_0x13c8('0x3b')]({},_0x1071a0,_0x5ef2f7['options']);var _0x35e1e7={'where':_0x1071a0['where']};return db[_0x13c8('0x2d')][_0x13c8('0x1f')](_0x35e1e7)[_0x13c8('0x26')](function(_0x1cd02c){_0x441182[_0x13c8('0x1f')]=_0x1cd02c;if(_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x3d')]){_0x1071a0[_0x13c8('0x3e')]=[{'all':!![]}];}return db[_0x13c8('0x2d')][_0x13c8('0x3f')](_0x1071a0);})[_0x13c8('0x26')](function(_0x416169){_0x441182[_0x13c8('0x40')]=_0x416169;return _0x441182;})[_0x13c8('0x26')](respondWithFilteredResult(_0x277a89,_0x1071a0))[_0x13c8('0x41')](handleError(_0x277a89,null));};exports[_0x13c8('0x42')]=function(_0x1b2ada,_0x1505fb){var _0xc5eb86={'raw':!![],'where':{'id':_0x1b2ada[_0x13c8('0x43')]['id']}},_0x1cff99={};_0x1cff99[_0x13c8('0x2f')]=_[_0x13c8('0x31')](db[_0x13c8('0x2d')][_0x13c8('0x44')]);_0x1cff99['query']=_[_0x13c8('0x31')](_0x1b2ada[_0x13c8('0x30')]);_0x1cff99[_0x13c8('0x32')]=_[_0x13c8('0x33')](_0x1cff99[_0x13c8('0x2f')],_0x1cff99['query']);_0xc5eb86['attributes']=_[_0x13c8('0x33')](_0x1cff99[_0x13c8('0x2f')],qs[_0x13c8('0x35')](_0x1b2ada['query']['fields']));_0xc5eb86['attributes']=_0xc5eb86[_0x13c8('0x34')]['length']?_0xc5eb86[_0x13c8('0x34')]:_0x1cff99['model'];if(_0x1b2ada[_0x13c8('0x30')][_0x13c8('0x3d')]){_0xc5eb86[_0x13c8('0x3e')]=[{'all':!![]}];}_0xc5eb86=_[_0x13c8('0x3b')]({},_0xc5eb86,_0x1b2ada[_0x13c8('0x45')]);return db[_0x13c8('0x2d')]['find'](_0xc5eb86)[_0x13c8('0x26')](handleEntityNotFound(_0x1505fb,null))[_0x13c8('0x26')](respondWithResult(_0x1505fb,null))['catch'](handleError(_0x1505fb,null));};exports[_0x13c8('0x46')]=function(_0x26155d,_0x2e925f){return db[_0x13c8('0x2d')][_0x13c8('0x46')](_0x26155d['body'],{})[_0x13c8('0x26')](respondWithResult(_0x2e925f,0xc9))[_0x13c8('0x41')](handleError(_0x2e925f,null));};exports[_0x13c8('0x25')]=function(_0x38418b,_0x185d18){if(_0x38418b['body']['id']){delete _0x38418b[_0x13c8('0x47')]['id'];}return db[_0x13c8('0x2d')][_0x13c8('0x48')]({'where':{'id':_0x38418b[_0x13c8('0x43')]['id']}})[_0x13c8('0x26')](handleEntityNotFound(_0x185d18,null))[_0x13c8('0x26')](saveUpdates(_0x38418b[_0x13c8('0x47')],null))[_0x13c8('0x26')](respondWithResult(_0x185d18,null))[_0x13c8('0x41')](handleError(_0x185d18,null));};exports[_0x13c8('0x27')]=function(_0x266f4e,_0x5e1fe5){return db[_0x13c8('0x2d')][_0x13c8('0x48')]({'where':{'id':_0x266f4e[_0x13c8('0x43')]['id']}})[_0x13c8('0x26')](handleEntityNotFound(_0x5e1fe5,null))[_0x13c8('0x26')](removeEntity(_0x5e1fe5,null))[_0x13c8('0x41')](handleError(_0x5e1fe5,null));}; \ No newline at end of file +var _0x702d=['nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x48a8cb,_0x1bb398){var _0x65030=function(_0x1ad10f){while(--_0x1ad10f){_0x48a8cb['push'](_0x48a8cb['shift']());}};_0x65030(++_0x1bb398);}(_0x702d,0x147));var _0xd702=function(_0x295d7d,_0x2292b0){_0x295d7d=_0x295d7d-0x0;var _0x5e4ea9=_0x702d[_0x295d7d];return _0x5e4ea9;};'use strict';var emlformat=require(_0xd702('0x0'));var rimraf=require(_0xd702('0x1'));var zipdir=require(_0xd702('0x2'));var jsonpatch=require(_0xd702('0x3'));var rp=require(_0xd702('0x4'));var moment=require('moment');var BPromise=require(_0xd702('0x5'));var Mustache=require(_0xd702('0x6'));var util=require(_0xd702('0x7'));var path=require(_0xd702('0x8'));var sox=require('sox');var csv=require(_0xd702('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd702('0xa'));var _=require(_0xd702('0xb'));var squel=require(_0xd702('0xc'));var crypto=require('crypto');var jsforce=require(_0xd702('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd702('0x9'));var querystring=require(_0xd702('0xe'));var Papa=require(_0xd702('0xf'));var Redis=require(_0xd702('0x10'));var authService=require(_0xd702('0x11'));var qs=require(_0xd702('0x12'));var as=require(_0xd702('0x13'));var hardwareService=require(_0xd702('0x14'));var logger=require(_0xd702('0x15'))(_0xd702('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd702('0x17'));var db=require(_0xd702('0x18'))['db'];function respondWithStatusCode(_0x273577,_0x5c0dad){_0x5c0dad=_0x5c0dad||0xcc;return function(_0x13ee5a){if(_0x13ee5a){return _0x273577[_0xd702('0x19')](_0x5c0dad);}return _0x273577[_0xd702('0x1a')](_0x5c0dad)[_0xd702('0x1b')]();};}function respondWithResult(_0x3948f8,_0x181ff2){_0x181ff2=_0x181ff2||0xc8;return function(_0x59dd33){if(_0x59dd33){return _0x3948f8[_0xd702('0x1a')](_0x181ff2)[_0xd702('0x1c')](_0x59dd33);}};}function respondWithFilteredResult(_0x5d7978,_0x707b9){return function(_0x4922f8){if(_0x4922f8){var _0x268c66=typeof _0x707b9[_0xd702('0x1d')]==='undefined'&&typeof _0x707b9[_0xd702('0x1e')]===_0xd702('0x1f');var _0x2a87f2=_0x4922f8['count'];var _0x5b3b1d=_0x268c66?0x0:_0x707b9[_0xd702('0x1d')];var _0x5a296e=_0x268c66?_0x4922f8[_0xd702('0x20')]:_0x707b9[_0xd702('0x1d')]+_0x707b9[_0xd702('0x1e')];var _0x265b1b;if(_0x5a296e>=_0x2a87f2){_0x5a296e=_0x2a87f2;_0x265b1b=0xc8;}else{_0x265b1b=0xce;}_0x5d7978[_0xd702('0x1a')](_0x265b1b);return _0x5d7978[_0xd702('0x21')](_0xd702('0x22'),_0x5b3b1d+'-'+_0x5a296e+'/'+_0x2a87f2)['json'](_0x4922f8);}return null;};}function patchUpdates(_0x4be140){return function(_0x536ca8){try{jsonpatch[_0xd702('0x23')](_0x536ca8,_0x4be140,!![]);}catch(_0x109284){return BPromise['reject'](_0x109284);}return _0x536ca8[_0xd702('0x24')]();};}function saveUpdates(_0x5d91fd,_0xc4c246){return function(_0x5824ec){if(_0x5824ec){return _0x5824ec['update'](_0x5d91fd)['then'](function(_0x21c00e){return _0x21c00e;});}return null;};}function removeEntity(_0xeec2e4,_0x459184){return function(_0x49761c){if(_0x49761c){return _0x49761c[_0xd702('0x25')]()[_0xd702('0x26')](function(){_0xeec2e4[_0xd702('0x1a')](0xcc)[_0xd702('0x1b')]();});}};}function handleEntityNotFound(_0x1200ed,_0x146f35){return function(_0x94c58d){if(!_0x94c58d){_0x1200ed[_0xd702('0x19')](0x194);}return _0x94c58d;};}function handleError(_0x22328a,_0x50d7ad){_0x50d7ad=_0x50d7ad||0x1f4;return function(_0x116b2f){logger[_0xd702('0x27')](_0x116b2f[_0xd702('0x28')]);if(_0x116b2f[_0xd702('0x29')]){delete _0x116b2f[_0xd702('0x29')];}_0x22328a[_0xd702('0x1a')](_0x50d7ad)[_0xd702('0x2a')](_0x116b2f);};}exports[_0xd702('0x2b')]=function(_0x5f1084,_0x47c9a2){var _0x1870b7={},_0x43cd38={},_0x56bc8d={'count':0x0,'rows':[]};var _0x45cd22=_[_0xd702('0x2c')](db[_0xd702('0x2d')][_0xd702('0x2e')],function(_0x56e9cd){return{'name':_0x56e9cd[_0xd702('0x2f')],'type':_0x56e9cd[_0xd702('0x30')][_0xd702('0x31')]};});_0x43cd38[_0xd702('0x32')]=_[_0xd702('0x2c')](_0x45cd22,'name');_0x43cd38[_0xd702('0x33')]=_[_0xd702('0x34')](_0x5f1084[_0xd702('0x33')]);_0x43cd38['filters']=_[_0xd702('0x35')](_0x43cd38['model'],_0x43cd38['query']);_0x1870b7[_0xd702('0x36')]=_[_0xd702('0x35')](_0x43cd38[_0xd702('0x32')],qs['fields'](_0x5f1084[_0xd702('0x33')][_0xd702('0x37')]));_0x1870b7['attributes']=_0x1870b7[_0xd702('0x36')][_0xd702('0x38')]?_0x1870b7[_0xd702('0x36')]:_0x43cd38[_0xd702('0x32')];if(!_0x5f1084[_0xd702('0x33')][_0xd702('0x39')](_0xd702('0x3a'))){_0x1870b7[_0xd702('0x1e')]=qs[_0xd702('0x1e')](_0x5f1084[_0xd702('0x33')][_0xd702('0x1e')]);_0x1870b7[_0xd702('0x1d')]=qs[_0xd702('0x1d')](_0x5f1084['query'][_0xd702('0x1d')]);}_0x1870b7[_0xd702('0x3b')]=qs[_0xd702('0x3c')](_0x5f1084[_0xd702('0x33')][_0xd702('0x3c')]);_0x1870b7[_0xd702('0x3d')]=qs[_0xd702('0x3e')](_['pick'](_0x5f1084['query'],_0x43cd38[_0xd702('0x3e')]),_0x45cd22);if(_0x5f1084[_0xd702('0x33')]['filter']){_0x1870b7['where']=_[_0xd702('0x3f')](_0x1870b7[_0xd702('0x3d')],{'$or':_['map'](_0x45cd22,function(_0x3a7aee){if(_0x3a7aee[_0xd702('0x30')]!==_0xd702('0x40')){var _0x4822d9={};_0x4822d9[_0x3a7aee[_0xd702('0x29')]]={'$like':'%'+_0x5f1084[_0xd702('0x33')][_0xd702('0x41')]+'%'};return _0x4822d9;}})});}_0x1870b7=_['merge']({},_0x1870b7,_0x5f1084[_0xd702('0x42')]);var _0x512854={'where':_0x1870b7[_0xd702('0x3d')]};return db[_0xd702('0x2d')][_0xd702('0x20')](_0x512854)[_0xd702('0x26')](function(_0x6af8d6){_0x56bc8d[_0xd702('0x20')]=_0x6af8d6;if(_0x5f1084[_0xd702('0x33')][_0xd702('0x43')]){_0x1870b7['include']=[{'all':!![]}];}return db[_0xd702('0x2d')][_0xd702('0x44')](_0x1870b7);})[_0xd702('0x26')](function(_0x3d703e){_0x56bc8d[_0xd702('0x45')]=_0x3d703e;return _0x56bc8d;})['then'](respondWithFilteredResult(_0x47c9a2,_0x1870b7))[_0xd702('0x46')](handleError(_0x47c9a2,null));};exports[_0xd702('0x47')]=function(_0x3424a3,_0x4c56ae){var _0xd48ad0={'raw':!![],'where':{'id':_0x3424a3[_0xd702('0x48')]['id']}},_0x3a1ed5={};_0x3a1ed5[_0xd702('0x32')]=_['keys'](db[_0xd702('0x2d')][_0xd702('0x2e')]);_0x3a1ed5[_0xd702('0x33')]=_[_0xd702('0x34')](_0x3424a3[_0xd702('0x33')]);_0x3a1ed5['filters']=_[_0xd702('0x35')](_0x3a1ed5[_0xd702('0x32')],_0x3a1ed5['query']);_0xd48ad0['attributes']=_[_0xd702('0x35')](_0x3a1ed5[_0xd702('0x32')],qs[_0xd702('0x37')](_0x3424a3[_0xd702('0x33')][_0xd702('0x37')]));_0xd48ad0[_0xd702('0x36')]=_0xd48ad0[_0xd702('0x36')][_0xd702('0x38')]?_0xd48ad0[_0xd702('0x36')]:_0x3a1ed5['model'];if(_0x3424a3['query'][_0xd702('0x43')]){_0xd48ad0['include']=[{'all':!![]}];}_0xd48ad0=_[_0xd702('0x3f')]({},_0xd48ad0,_0x3424a3['options']);return db[_0xd702('0x2d')]['find'](_0xd48ad0)[_0xd702('0x26')](handleEntityNotFound(_0x4c56ae,null))['then'](respondWithResult(_0x4c56ae,null))[_0xd702('0x46')](handleError(_0x4c56ae,null));};exports[_0xd702('0x49')]=function(_0x543b8f,_0x160f5e){return db[_0xd702('0x2d')][_0xd702('0x49')](_0x543b8f[_0xd702('0x4a')],{})[_0xd702('0x26')](respondWithResult(_0x160f5e,0xc9))['catch'](handleError(_0x160f5e,null));};exports[_0xd702('0x4b')]=function(_0x14c1db,_0x2d09be){if(_0x14c1db['body']['id']){delete _0x14c1db[_0xd702('0x4a')]['id'];}return db['FreshdeskField'][_0xd702('0x4c')]({'where':{'id':_0x14c1db[_0xd702('0x48')]['id']}})[_0xd702('0x26')](handleEntityNotFound(_0x2d09be,null))['then'](saveUpdates(_0x14c1db['body'],null))[_0xd702('0x26')](respondWithResult(_0x2d09be,null))[_0xd702('0x46')](handleError(_0x2d09be,null));};exports[_0xd702('0x25')]=function(_0x397e91,_0x16e59b){return db[_0xd702('0x2d')][_0xd702('0x4c')]({'where':{'id':_0x397e91[_0xd702('0x48')]['id']}})[_0xd702('0x26')](handleEntityNotFound(_0x16e59b,null))[_0xd702('0x26')](removeEntity(_0x16e59b,null))['catch'](handleError(_0x16e59b,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index a49be46..6ca8465 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 _0x8728=['rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','util','api','bluebird','request-promise','path'];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0x8728,0x14a));var _0x8872=function(_0x4cc860,_0xf7eea3){_0x4cc860=_0x4cc860-0x0;var _0x1d01ff=_0x8728[_0x4cc860];return _0x1d01ff;};'use strict';var _=require(_0x8872('0x0'));var util=require(_0x8872('0x1'));var logger=require('../../config/logger')(_0x8872('0x2'));var moment=require('moment');var BPromise=require(_0x8872('0x3'));var rp=require(_0x8872('0x4'));var fs=require('fs');var path=require(_0x8872('0x5'));var rimraf=require(_0x8872('0x6'));var config=require(_0x8872('0x7'));var attributes=require(_0x8872('0x8'));module[_0x8872('0x9')]=function(_0x2bf431,_0x1b9637){return _0x2bf431[_0x8872('0xa')]('FreshdeskField',attributes,{'tableName':_0x8872('0xb'),'paranoid':![],'indexes':[{'name':_0x8872('0xc'),'fields':[_0x8872('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e06=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash'];(function(_0x525bcf,_0x428c0c){var _0x4c3486=function(_0xf87f2){while(--_0xf87f2){_0x525bcf['push'](_0x525bcf['shift']());}};_0x4c3486(++_0x428c0c);}(_0x9e06,0x14f));var _0x69e0=function(_0x1b0c1d,_0x10621b){_0x1b0c1d=_0x1b0c1d-0x0;var _0x4f2e57=_0x9e06[_0x1b0c1d];return _0x4f2e57;};'use strict';var _=require(_0x69e0('0x0'));var util=require(_0x69e0('0x1'));var logger=require(_0x69e0('0x2'))('api');var moment=require(_0x69e0('0x3'));var BPromise=require(_0x69e0('0x4'));var rp=require(_0x69e0('0x5'));var fs=require('fs');var path=require(_0x69e0('0x6'));var rimraf=require(_0x69e0('0x7'));var config=require(_0x69e0('0x8'));var attributes=require('./intFreshdeskField.attributes');module[_0x69e0('0x9')]=function(_0x5de76a,_0x4c1ddc){return _0x5de76a[_0x69e0('0xa')](_0x69e0('0xb'),attributes,{'tableName':_0x69e0('0xc'),'paranoid':![],'indexes':[{'name':_0x69e0('0xd'),'fields':[_0x69e0('0xe'),_0x69e0('0xf')],'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 043bd86..1d63584 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 _0xb39f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x38e4fc,_0x370f6c){var _0x47a06e=function(_0x512ce1){while(--_0x512ce1){_0x38e4fc['push'](_0x38e4fc['shift']());}};_0x47a06e(++_0x370f6c);}(_0xb39f,0xa4));var _0xfb39=function(_0x3e5db2,_0x3970da){_0x3e5db2=_0x3e5db2-0x0;var _0x498408=_0xb39f[_0x3e5db2];return _0x498408;};'use strict';var _=require(_0xfb39('0x0'));var util=require(_0xfb39('0x1'));var moment=require(_0xfb39('0x2'));var BPromise=require(_0xfb39('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb39('0x4'));var db=require(_0xfb39('0x5'))['db'];var utils=require(_0xfb39('0x6'));var logger=require(_0xfb39('0x7'))(_0xfb39('0x8'));var config=require(_0xfb39('0x9'));var jayson=require(_0xfb39('0xa'));var client=jayson[_0xfb39('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55838a,_0x4287a7,_0x2c8787){return new BPromise(function(_0x95022b,_0x2d32d9){return client['request'](_0x55838a,_0x2c8787)[_0xfb39('0xc')](function(_0x3187a4){logger[_0xfb39('0xd')](_0xfb39('0xe'),_0x4287a7,_0xfb39('0xf'));logger[_0xfb39('0x10')](_0xfb39('0x11'),_0x4287a7,_0xfb39('0xf'),JSON[_0xfb39('0x12')](_0x3187a4));if(_0x3187a4['error']){if(_0x3187a4['error'][_0xfb39('0x13')]===0x1f4){logger[_0xfb39('0x14')](_0xfb39('0xe'),_0x4287a7,_0x3187a4[_0xfb39('0x14')]['message']);return _0x2d32d9(_0x3187a4['error'][_0xfb39('0x15')]);}logger['error'](_0xfb39('0xe'),_0x4287a7,_0x3187a4[_0xfb39('0x14')]['message']);return _0x95022b(_0x3187a4[_0xfb39('0x14')]['message']);}else{logger[_0xfb39('0xd')](_0xfb39('0xe'),_0x4287a7,_0xfb39('0xf'));_0x95022b(_0x3187a4[_0xfb39('0x16')][_0xfb39('0x15')]);}})[_0xfb39('0x17')](function(_0x1b6552){logger[_0xfb39('0x14')](_0xfb39('0xe'),_0x4287a7,_0x1b6552);_0x2d32d9(_0x1b6552);});});} \ No newline at end of file +var _0xfab1=['stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s'];(function(_0x3ee075,_0x2fb99f){var _0xd86d31=function(_0x3373e9){while(--_0x3373e9){_0x3ee075['push'](_0x3ee075['shift']());}};_0xd86d31(++_0x2fb99f);}(_0xfab1,0x159));var _0x1fab=function(_0x18da9d,_0x559a94){_0x18da9d=_0x18da9d-0x0;var _0x2563e8=_0xfab1[_0x18da9d];return _0x2563e8;};'use strict';var _=require(_0x1fab('0x0'));var util=require(_0x1fab('0x1'));var moment=require(_0x1fab('0x2'));var BPromise=require(_0x1fab('0x3'));var rs=require(_0x1fab('0x4'));var fs=require('fs');var Redis=require(_0x1fab('0x5'));var db=require(_0x1fab('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1fab('0x7'))(_0x1fab('0x8'));var config=require(_0x1fab('0x9'));var jayson=require(_0x1fab('0xa'));var client=jayson[_0x1fab('0xb')][_0x1fab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x464935,_0x357d5a,_0x1b9b51){return new BPromise(function(_0x44c526,_0xa1c283){return client[_0x1fab('0xd')](_0x464935,_0x1b9b51)[_0x1fab('0xe')](function(_0x1c6be0){logger[_0x1fab('0xf')](_0x1fab('0x10'),_0x357d5a,'request\x20sent');logger[_0x1fab('0x11')](_0x1fab('0x12'),_0x357d5a,'request\x20sent',JSON[_0x1fab('0x13')](_0x1c6be0));if(_0x1c6be0[_0x1fab('0x14')]){if(_0x1c6be0['error'][_0x1fab('0x15')]===0x1f4){logger[_0x1fab('0x14')](_0x1fab('0x10'),_0x357d5a,_0x1c6be0[_0x1fab('0x14')][_0x1fab('0x16')]);return _0xa1c283(_0x1c6be0[_0x1fab('0x14')][_0x1fab('0x16')]);}logger[_0x1fab('0x14')](_0x1fab('0x10'),_0x357d5a,_0x1c6be0['error']['message']);return _0x44c526(_0x1c6be0['error'][_0x1fab('0x16')]);}else{logger[_0x1fab('0xf')](_0x1fab('0x10'),_0x357d5a,_0x1fab('0x17'));_0x44c526(_0x1c6be0[_0x1fab('0x18')][_0x1fab('0x16')]);}})[_0x1fab('0x19')](function(_0x46582f){logger[_0x1fab('0x14')]('FreshdeskField,\x20%s,\x20%s',_0x357d5a,_0x46582f);_0xa1c283(_0x46582f);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 590b93b..f093689 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 _0xefda=['update','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getFields','post','create','addConfiguration','put'];(function(_0x168f17,_0x371e7b){var _0x527037=function(_0x224a72){while(--_0x224a72){_0x168f17['push'](_0x168f17['shift']());}};_0x527037(++_0x371e7b);}(_0xefda,0x96));var _0xaefd=function(_0x13f42c,_0x2211c4){_0x13f42c=_0x13f42c-0x0;var _0x587884=_0xefda[_0x13f42c];return _0x587884;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['show']);router[_0xaefd('0x8')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router[_0xaefd('0xe')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0xf')]);router[_0xaefd('0xe')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x10')]);router[_0xaefd('0x11')](_0xaefd('0xa'),auth['isAuthenticated'](),controller[_0xaefd('0x12')]);router['delete'](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x13')]);module[_0xaefd('0x14')]=router; \ No newline at end of file +var _0x153f=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','update','delete','exports','multer','util','path'];(function(_0x34f701,_0x37e407){var _0x3e2429=function(_0x20c0c3){while(--_0x20c0c3){_0x34f701['push'](_0x34f701['shift']());}};_0x3e2429(++_0x37e407);}(_0x153f,0x15b));var _0xf153=function(_0x16a9e0,_0x41b503){_0x16a9e0=_0x16a9e0-0x0;var _0x308ccb=_0x153f[_0x16a9e0];return _0x308ccb;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var fs_extra=require(_0xf153('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf153('0x7'));var config=require('../../config/environment');var controller=require(_0xf153('0x8'));router[_0xf153('0x9')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0xb')]);router[_0xf153('0x9')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0xc')]);router[_0xf153('0x9')](_0xf153('0xd'),auth[_0xf153('0xa')](),controller[_0xf153('0xe')]);router[_0xf153('0x9')](_0xf153('0xf'),auth[_0xf153('0xa')](),controller[_0xf153('0x10')]);router['post']('/',auth[_0xf153('0xa')](),controller[_0xf153('0x11')]);router[_0xf153('0x12')]('/:id/configurations',auth[_0xf153('0xa')](),controller[_0xf153('0x13')]);router[_0xf153('0x14')](_0xf153('0x15'),auth[_0xf153('0xa')](),controller[_0xf153('0x16')]);router[_0xf153('0x17')](_0xf153('0x15'),auth[_0xf153('0xa')](),controller['destroy']);module[_0xf153('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index da04f62..6966224 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 _0xb016=['remoteUri','sequelize','exports','STRING'];(function(_0x29e3ec,_0x138a18){var _0x25727e=function(_0x2bea0d){while(--_0x2bea0d){_0x29e3ec['push'](_0x29e3ec['shift']());}};_0x25727e(++_0x138a18);}(_0xb016,0x159));var _0x6b01=function(_0x13f008,_0xcf8ce1){_0x13f008=_0x13f008-0x0;var _0x28c838=_0xb016[_0x13f008];return _0x28c838;};'use strict';var Sequelize=require(_0x6b01('0x0'));module[_0x6b01('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6b01('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x6b01('0x2')]},'remoteUri':{'type':Sequelize[_0x6b01('0x2')],'unique':_0x6b01('0x3')},'serverUrl':{'type':Sequelize[_0x6b01('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1893=['STRING','username','remoteUri'];(function(_0x401d67,_0xeb1592){var _0x25076b=function(_0x233577){while(--_0x233577){_0x401d67['push'](_0x401d67['shift']());}};_0x25076b(++_0xeb1592);}(_0x1893,0xa2));var _0x3189=function(_0xc9bc0f,_0x12e2ac){_0xc9bc0f=_0xc9bc0f-0x0;var _0x4aacbc=_0x1893[_0xc9bc0f];return _0x4aacbc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3189('0x0')]},'description':{'type':Sequelize[_0x3189('0x0')]},'username':{'type':Sequelize[_0x3189('0x0')],'unique':_0x3189('0x1')},'apiKey':{'type':Sequelize[_0x3189('0x0')]},'remoteUri':{'type':Sequelize[_0x3189('0x0')],'unique':_0x3189('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 1b80e12..363dc0c 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 _0x6f1c=['model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','where','merge','options','includeAll','include','rows','catch','show','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','length','filter','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','apiKey','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','FreshsalesAccount','rawAttributes','fieldName','key'];(function(_0x54a5a7,_0x2a7321){var _0x56d5f5=function(_0x2075c7){while(--_0x2075c7){_0x54a5a7['push'](_0x54a5a7['shift']());}};_0x56d5f5(++_0x2a7321);}(_0x6f1c,0x15c));var _0xc6f1=function(_0x2eefff,_0x1c2a4f){_0x2eefff=_0x2eefff-0x0;var _0x52a249=_0x6f1c[_0x2eefff];return _0x52a249;};'use strict';var emlformat=require(_0xc6f1('0x0'));var rimraf=require(_0xc6f1('0x1'));var zipdir=require(_0xc6f1('0x2'));var jsonpatch=require(_0xc6f1('0x3'));var rp=require(_0xc6f1('0x4'));var moment=require(_0xc6f1('0x5'));var BPromise=require(_0xc6f1('0x6'));var Mustache=require(_0xc6f1('0x7'));var util=require(_0xc6f1('0x8'));var path=require(_0xc6f1('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc6f1('0xa'));var fs=require('fs');var fs_extra=require(_0xc6f1('0xb'));var _=require(_0xc6f1('0xc'));var squel=require('squel');var crypto=require(_0xc6f1('0xd'));var jsforce=require(_0xc6f1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc6f1('0xf'));var Papa=require(_0xc6f1('0x10'));var Redis=require(_0xc6f1('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc6f1('0x12'));var hardwareService=require(_0xc6f1('0x13'));var logger=require('../../config/logger')(_0xc6f1('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc6f1('0x15'))['db'];var integrations=require(_0xc6f1('0x16'));function respondWithStatusCode(_0x8443de,_0x1b3cb3){_0x1b3cb3=_0x1b3cb3||0xcc;return function(_0x43c3a7){if(_0x43c3a7){return _0x8443de[_0xc6f1('0x17')](_0x1b3cb3);}return _0x8443de[_0xc6f1('0x18')](_0x1b3cb3)[_0xc6f1('0x19')]();};}function respondWithResult(_0x3d7fc9,_0x29083b){_0x29083b=_0x29083b||0xc8;return function(_0x1b6330){if(_0x1b6330){return _0x3d7fc9[_0xc6f1('0x18')](_0x29083b)[_0xc6f1('0x1a')](_0x1b6330);}};}function respondWithFilteredResult(_0x1cdb39,_0x2a5ebe){return function(_0x11937f){if(_0x11937f){var _0x45ad0a=typeof _0x2a5ebe['offset']===_0xc6f1('0x1b')&&typeof _0x2a5ebe['limit']===_0xc6f1('0x1b');var _0x433a86=_0x11937f[_0xc6f1('0x1c')];var _0x417ed8=_0x45ad0a?0x0:_0x2a5ebe[_0xc6f1('0x1d')];var _0x139522=_0x45ad0a?_0x11937f[_0xc6f1('0x1c')]:_0x2a5ebe[_0xc6f1('0x1d')]+_0x2a5ebe[_0xc6f1('0x1e')];var _0x2226da;if(_0x139522>=_0x433a86){_0x139522=_0x433a86;_0x2226da=0xc8;}else{_0x2226da=0xce;}_0x1cdb39[_0xc6f1('0x18')](_0x2226da);return _0x1cdb39[_0xc6f1('0x1f')](_0xc6f1('0x20'),_0x417ed8+'-'+_0x139522+'/'+_0x433a86)[_0xc6f1('0x1a')](_0x11937f);}return null;};}function patchUpdates(_0x581f9f){return function(_0x4d8970){try{jsonpatch[_0xc6f1('0x21')](_0x4d8970,_0x581f9f,!![]);}catch(_0x536a9f){return BPromise[_0xc6f1('0x22')](_0x536a9f);}return _0x4d8970[_0xc6f1('0x23')]();};}function saveUpdates(_0x2de479,_0x3a76fa){return function(_0x543009){if(_0x543009){return _0x543009[_0xc6f1('0x24')](_0x2de479)[_0xc6f1('0x25')](function(_0x46ef80){return _0x46ef80;});}return null;};}function removeEntity(_0x3277e8,_0x5b2487){return function(_0x154407){if(_0x154407){return _0x154407[_0xc6f1('0x26')]()[_0xc6f1('0x25')](function(){_0x3277e8[_0xc6f1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40cbf4,_0x519601){return function(_0x321278){if(!_0x321278){_0x40cbf4[_0xc6f1('0x17')](0x194);}return _0x321278;};}function handleError(_0x177f08,_0x2e2257){_0x2e2257=_0x2e2257||0x1f4;return function(_0x49c465){logger[_0xc6f1('0x27')](_0x49c465[_0xc6f1('0x28')]);if(_0x49c465[_0xc6f1('0x29')]){delete _0x49c465[_0xc6f1('0x29')];}_0x177f08['status'](_0x2e2257)[_0xc6f1('0x2a')](_0x49c465);};}exports[_0xc6f1('0x2b')]=function(_0x2ecaad,_0x42f5e1){var _0x147792={},_0x2ce474={},_0x39f160={'count':0x0,'rows':[]};var _0x3ed5d6=_['map'](db[_0xc6f1('0x2c')][_0xc6f1('0x2d')],function(_0x2d1d1a){return{'name':_0x2d1d1a[_0xc6f1('0x2e')],'type':_0x2d1d1a['type'][_0xc6f1('0x2f')]};});_0x2ce474[_0xc6f1('0x30')]=_[_0xc6f1('0x31')](_0x3ed5d6,_0xc6f1('0x29'));_0x2ce474[_0xc6f1('0x32')]=_[_0xc6f1('0x33')](_0x2ecaad[_0xc6f1('0x32')]);_0x2ce474[_0xc6f1('0x34')]=_[_0xc6f1('0x35')](_0x2ce474['model'],_0x2ce474[_0xc6f1('0x32')]);_0x147792[_0xc6f1('0x36')]=_[_0xc6f1('0x35')](_0x2ce474[_0xc6f1('0x30')],qs[_0xc6f1('0x37')](_0x2ecaad[_0xc6f1('0x32')]['fields']));_0x147792[_0xc6f1('0x36')]=_0x147792['attributes']['length']?_0x147792[_0xc6f1('0x36')]:_0x2ce474[_0xc6f1('0x30')];if(!_0x2ecaad['query'][_0xc6f1('0x38')](_0xc6f1('0x39'))){_0x147792[_0xc6f1('0x1e')]=qs[_0xc6f1('0x1e')](_0x2ecaad[_0xc6f1('0x32')][_0xc6f1('0x1e')]);_0x147792['offset']=qs['offset'](_0x2ecaad[_0xc6f1('0x32')][_0xc6f1('0x1d')]);}_0x147792['order']=qs[_0xc6f1('0x3a')](_0x2ecaad[_0xc6f1('0x32')][_0xc6f1('0x3a')]);_0x147792['where']=qs['filters'](_[_0xc6f1('0x3b')](_0x2ecaad[_0xc6f1('0x32')],_0x2ce474[_0xc6f1('0x34')]),_0x3ed5d6);if(_0x2ecaad[_0xc6f1('0x32')]['filter']){_0x147792[_0xc6f1('0x3c')]=_[_0xc6f1('0x3d')](_0x147792['where'],{'$or':_['map'](_0x3ed5d6,function(_0x3f0774){if(_0x3f0774['type']!=='VIRTUAL'){var _0x5abc99={};_0x5abc99[_0x3f0774[_0xc6f1('0x29')]]={'$like':'%'+_0x2ecaad['query']['filter']+'%'};return _0x5abc99;}})});}_0x147792=_[_0xc6f1('0x3d')]({},_0x147792,_0x2ecaad[_0xc6f1('0x3e')]);var _0xc12e76={'where':_0x147792[_0xc6f1('0x3c')]};return db[_0xc6f1('0x2c')][_0xc6f1('0x1c')](_0xc12e76)[_0xc6f1('0x25')](function(_0x2e1e3d){_0x39f160[_0xc6f1('0x1c')]=_0x2e1e3d;if(_0x2ecaad[_0xc6f1('0x32')][_0xc6f1('0x3f')]){_0x147792[_0xc6f1('0x40')]=[{'all':!![]}];}return db[_0xc6f1('0x2c')]['findAll'](_0x147792);})[_0xc6f1('0x25')](function(_0x1263e4){_0x39f160[_0xc6f1('0x41')]=_0x1263e4;return _0x39f160;})[_0xc6f1('0x25')](respondWithFilteredResult(_0x42f5e1,_0x147792))[_0xc6f1('0x42')](handleError(_0x42f5e1,null));};exports[_0xc6f1('0x43')]=function(_0x4fe3ec,_0x28aee4){var _0x461103={'raw':![],'where':{'id':_0x4fe3ec['params']['id']}},_0x33ffb8={};_0x33ffb8[_0xc6f1('0x30')]=_[_0xc6f1('0x33')](db[_0xc6f1('0x2c')][_0xc6f1('0x2d')]);_0x33ffb8[_0xc6f1('0x32')]=_['keys'](_0x4fe3ec[_0xc6f1('0x32')]);_0x33ffb8[_0xc6f1('0x34')]=_['intersection'](_0x33ffb8['model'],_0x33ffb8[_0xc6f1('0x32')]);_0x461103[_0xc6f1('0x36')]=_['intersection'](_0x33ffb8[_0xc6f1('0x30')],qs[_0xc6f1('0x37')](_0x4fe3ec[_0xc6f1('0x32')][_0xc6f1('0x37')]));_0x461103[_0xc6f1('0x36')]=_0x461103[_0xc6f1('0x36')]['length']?_0x461103[_0xc6f1('0x36')]:_0x33ffb8['model'];if(_0x4fe3ec[_0xc6f1('0x32')]['includeAll']){_0x461103['include']=[{'all':!![]}];}_0x461103=_[_0xc6f1('0x3d')]({},_0x461103,_0x4fe3ec[_0xc6f1('0x3e')]);return db[_0xc6f1('0x2c')][_0xc6f1('0x44')](_0x461103)['then'](handleEntityNotFound(_0x28aee4,null))['then'](respondWithResult(_0x28aee4,null))[_0xc6f1('0x42')](handleError(_0x28aee4,null));};exports[_0xc6f1('0x45')]=function(_0x9d62c2,_0x257251){return db[_0xc6f1('0x2c')][_0xc6f1('0x45')](_0x9d62c2[_0xc6f1('0x46')],{})[_0xc6f1('0x25')](respondWithResult(_0x257251,0xc9))[_0xc6f1('0x42')](handleError(_0x257251,null));};exports[_0xc6f1('0x24')]=function(_0xe78626,_0x5abde4){if(_0xe78626[_0xc6f1('0x46')]['id']){delete _0xe78626[_0xc6f1('0x46')]['id'];}return db[_0xc6f1('0x2c')][_0xc6f1('0x44')]({'where':{'id':_0xe78626[_0xc6f1('0x47')]['id']}})['then'](handleEntityNotFound(_0x5abde4,null))[_0xc6f1('0x25')](saveUpdates(_0xe78626[_0xc6f1('0x46')],null))[_0xc6f1('0x25')](respondWithResult(_0x5abde4,null))[_0xc6f1('0x42')](handleError(_0x5abde4,null));};exports[_0xc6f1('0x26')]=function(_0x1bbdc7,_0x30a6b2){return db[_0xc6f1('0x2c')]['find']({'where':{'id':_0x1bbdc7[_0xc6f1('0x47')]['id']}})['then'](handleEntityNotFound(_0x30a6b2,null))[_0xc6f1('0x25')](removeEntity(_0x30a6b2,null))[_0xc6f1('0x42')](handleError(_0x30a6b2,null));};exports[_0xc6f1('0x48')]=function(_0x2f8235,_0x29cb5d,_0x1b749d){var _0x588f35={};var _0x57c79c={};var _0x16f209;var _0x295224;return db[_0xc6f1('0x2c')][_0xc6f1('0x49')]({'where':{'id':_0x2f8235[_0xc6f1('0x47')]['id']}})[_0xc6f1('0x25')](handleEntityNotFound(_0x29cb5d,null))[_0xc6f1('0x25')](function(_0x4287e3){if(_0x4287e3){_0x16f209=_0x4287e3;_0x57c79c[_0xc6f1('0x30')]=_[_0xc6f1('0x33')](db[_0xc6f1('0x4a')][_0xc6f1('0x2d')]);_0x57c79c[_0xc6f1('0x32')]=_['keys'](_0x2f8235['query']);_0x57c79c[_0xc6f1('0x34')]=_['intersection'](_0x57c79c[_0xc6f1('0x30')],_0x57c79c[_0xc6f1('0x32')]);_0x588f35[_0xc6f1('0x36')]=_[_0xc6f1('0x35')](_0x57c79c[_0xc6f1('0x30')],qs[_0xc6f1('0x37')](_0x2f8235[_0xc6f1('0x32')][_0xc6f1('0x37')]));_0x588f35[_0xc6f1('0x36')]=_0x588f35['attributes'][_0xc6f1('0x4b')]?_0x588f35[_0xc6f1('0x36')]:_0x57c79c[_0xc6f1('0x30')];_0x588f35['order']=qs[_0xc6f1('0x3a')](_0x2f8235[_0xc6f1('0x32')]['sort']);_0x588f35[_0xc6f1('0x3c')]=qs[_0xc6f1('0x34')](_[_0xc6f1('0x3b')](_0x2f8235[_0xc6f1('0x32')],_0x57c79c[_0xc6f1('0x34')]));if(_0x2f8235[_0xc6f1('0x32')][_0xc6f1('0x4c')]){_0x588f35['where']=_['merge'](_0x588f35['where'],{'$or':_[_0xc6f1('0x31')](_0x588f35[_0xc6f1('0x36')],function(_0x50169f){var _0x564165={};_0x564165[_0x50169f]={'$like':'%'+_0x2f8235[_0xc6f1('0x32')]['filter']+'%'};return _0x564165;})});}_0x588f35=_[_0xc6f1('0x3d')]({},_0x588f35,_0x2f8235[_0xc6f1('0x3e')]);return _0x16f209[_0xc6f1('0x48')](_0x588f35);}})[_0xc6f1('0x25')](function(_0x5249ee){if(_0x5249ee){_0x295224=_0x5249ee['length'];if(!_0x2f8235[_0xc6f1('0x32')][_0xc6f1('0x38')](_0xc6f1('0x39'))){_0x588f35['limit']=qs[_0xc6f1('0x1e')](_0x2f8235[_0xc6f1('0x32')]['limit']);_0x588f35[_0xc6f1('0x1d')]=qs[_0xc6f1('0x1d')](_0x2f8235['query'][_0xc6f1('0x1d')]);}return _0x16f209[_0xc6f1('0x48')](_0x588f35);}})[_0xc6f1('0x25')](function(_0x25a021){if(_0x25a021){return _0x25a021?{'count':_0x295224,'rows':_0x25a021}:null;}})['then'](respondWithResult(_0x29cb5d,null))['catch'](handleError(_0x29cb5d,null));};exports[_0xc6f1('0x4d')]=function(_0x1feda8,_0x53b889,_0x30f132){if(_0x1feda8[_0xc6f1('0x46')]['id']){delete _0x1feda8[_0xc6f1('0x46')]['id'];}return db[_0xc6f1('0x2c')][_0xc6f1('0x49')]({'where':{'id':_0x1feda8['params']['id']}})['then'](handleEntityNotFound(_0x53b889,null))[_0xc6f1('0x25')](function(_0x128a1e){if(_0x128a1e){_0x1feda8[_0xc6f1('0x46')]['AccountId']=_0x128a1e['id'];_0x1feda8['body'][_0xc6f1('0x4e')]=integrations[_0xc6f1('0x4f')](_0x1feda8[_0xc6f1('0x46')][_0xc6f1('0x50')],_0x1feda8[_0xc6f1('0x46')]['type']);_0x1feda8[_0xc6f1('0x46')][_0xc6f1('0x51')]=integrations[_0xc6f1('0x52')](_0x1feda8[_0xc6f1('0x46')][_0xc6f1('0x50')],_0x1feda8[_0xc6f1('0x46')]['type']);return db['FreshsalesConfiguration'][_0xc6f1('0x45')](_0x1feda8[_0xc6f1('0x46')],{'include':[{'model':db[_0xc6f1('0x53')],'as':_0xc6f1('0x4e')},{'model':db[_0xc6f1('0x53')],'as':'Descriptions'}]});}return null;})[_0xc6f1('0x25')](respondWithResult(_0x53b889,null))[_0xc6f1('0x42')](handleError(_0x53b889,null));};exports[_0xc6f1('0x54')]=function(_0x2a6ddd,_0x562a88,_0x47ef6c){var _0x95ce76='';var _0x305f93='';return db['FreshsalesAccount'][_0xc6f1('0x49')]({'where':{'id':_0x2a6ddd[_0xc6f1('0x47')]['id']},'attributes':['id',_0xc6f1('0x55'),_0xc6f1('0x56'),'apiKey']})[_0xc6f1('0x25')](handleEntityNotFound(_0x562a88,null))['then'](function(_0x1ae301){if(_0x1ae301){_0x305f93=_0x1ae301[_0xc6f1('0x55')];_0x95ce76=_0x1ae301[_0xc6f1('0x56')];var _0x24b65c=_0x1ae301[_0xc6f1('0x56')]['slice'](-0x1);if(_0x24b65c==='/'){_0x95ce76=_0x95ce76[_0xc6f1('0x57')](0x0,_0x95ce76[_0xc6f1('0x58')](_0x24b65c));}return rp({'method':_0xc6f1('0x59'),'uri':util[_0xc6f1('0x5a')](_0xc6f1('0x5b'),_0x95ce76,'/api/selector/owners'),'headers':{'Authorization':_0xc6f1('0x5c')+_0x1ae301[_0xc6f1('0x5d')]},'json':!![]});}})[_0xc6f1('0x25')](function(_0x388eb8){if(_0x388eb8){var _0x434a8a=_0x388eb8['users'];var _0x4f91af=![];var _0x1c352a=null;for(_0x1c352a=0x0;_0x1c352a<_0x434a8a[_0xc6f1('0x4b')];_0x1c352a++){if(_0x434a8a[_0x1c352a]['email']===_0x305f93){_0x4f91af=!![];}}if(_0x4f91af){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xc6f1('0x5e')});}}})[_0xc6f1('0x25')](respondWithResult(_0x562a88,null))['catch'](function(_0x4aaa4c){var _0x521cc7=_0x2a6ddd[_0xc6f1('0x32')][_0xc6f1('0x5f')]?0x1f4:_0x4aaa4c[_0xc6f1('0x60')]||0x1f4;logger[_0xc6f1('0x27')](_0xc6f1('0x61'),_0xc6f1('0x54'),_0x521cc7,JSON[_0xc6f1('0x62')](_0x4aaa4c));delete _0x4aaa4c['name'];if(_0x521cc7===0x191){_0x521cc7=0x190;}_0x562a88[_0xc6f1('0x18')](_0x521cc7)[_0xc6f1('0x2a')](_0x2a6ddd[_0xc6f1('0x32')][_0xc6f1('0x5f')]?{'message':'Wrong\x20credentials','statusCode':_0x4aaa4c[_0xc6f1('0x60')]}:_0x4aaa4c);});}; \ No newline at end of file +var _0x3206=['Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','FreshsalesAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','findOne','map','getConfigurations','hasOwnProperty','AccountId','Subjects','getSubjects','channel','FreshsalesConfiguration','FreshsalesField','Descriptions','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s%s','Token\x20token=','users','email'];(function(_0x55c0db,_0x1ed0d2){var _0xedbe65=function(_0x3a2b6a){while(--_0x3a2b6a){_0x55c0db['push'](_0x55c0db['shift']());}};_0xedbe65(++_0x1ed0d2);}(_0x3206,0x132));var _0x6320=function(_0x4f9c08,_0x4d83df){_0x4f9c08=_0x4f9c08-0x0;var _0x4da7e5=_0x3206[_0x4f9c08];return _0x4da7e5;};'use strict';var emlformat=require(_0x6320('0x0'));var rimraf=require(_0x6320('0x1'));var zipdir=require(_0x6320('0x2'));var jsonpatch=require(_0x6320('0x3'));var rp=require(_0x6320('0x4'));var moment=require(_0x6320('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6320('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6320('0x7'));var csv=require('to-csv');var ejs=require(_0x6320('0x8'));var fs=require('fs');var fs_extra=require(_0x6320('0x9'));var _=require(_0x6320('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6320('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6320('0xc'));var querystring=require(_0x6320('0xd'));var Papa=require(_0x6320('0xe'));var Redis=require(_0x6320('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6320('0x10'));var as=require(_0x6320('0x11'));var hardwareService=require(_0x6320('0x12'));var logger=require(_0x6320('0x13'))(_0x6320('0x14'));var utils=require(_0x6320('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6320('0x16'));var db=require(_0x6320('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1b6b4d,_0x2c29b3){_0x2c29b3=_0x2c29b3||0xcc;return function(_0xe707b8){if(_0xe707b8){return _0x1b6b4d[_0x6320('0x18')](_0x2c29b3);}return _0x1b6b4d[_0x6320('0x19')](_0x2c29b3)[_0x6320('0x1a')]();};}function respondWithResult(_0x48f6a1,_0x1df075){_0x1df075=_0x1df075||0xc8;return function(_0x5a1e77){if(_0x5a1e77){return _0x48f6a1[_0x6320('0x19')](_0x1df075)[_0x6320('0x1b')](_0x5a1e77);}};}function respondWithFilteredResult(_0x26f0d6,_0x8a08f7){return function(_0x2015da){if(_0x2015da){var _0x122d59=typeof _0x8a08f7[_0x6320('0x1c')]==='undefined'&&typeof _0x8a08f7[_0x6320('0x1d')]===_0x6320('0x1e');var _0x5c0bb8=_0x2015da['count'];var _0x52eaad=_0x122d59?0x0:_0x8a08f7[_0x6320('0x1c')];var _0x1d0025=_0x122d59?_0x2015da[_0x6320('0x1f')]:_0x8a08f7[_0x6320('0x1c')]+_0x8a08f7['limit'];var _0x5e5131;if(_0x1d0025>=_0x5c0bb8){_0x1d0025=_0x5c0bb8;_0x5e5131=0xc8;}else{_0x5e5131=0xce;}_0x26f0d6[_0x6320('0x19')](_0x5e5131);return _0x26f0d6[_0x6320('0x20')](_0x6320('0x21'),_0x52eaad+'-'+_0x1d0025+'/'+_0x5c0bb8)[_0x6320('0x1b')](_0x2015da);}return null;};}function patchUpdates(_0x1ad19a){return function(_0xa029a6){try{jsonpatch[_0x6320('0x22')](_0xa029a6,_0x1ad19a,!![]);}catch(_0x34af55){return BPromise[_0x6320('0x23')](_0x34af55);}return _0xa029a6[_0x6320('0x24')]();};}function saveUpdates(_0x247097,_0x5cf4db){return function(_0x1277b8){if(_0x1277b8){return _0x1277b8[_0x6320('0x25')](_0x247097)['then'](function(_0x365b74){return _0x365b74;});}return null;};}function removeEntity(_0x41a35a,_0x2634e2){return function(_0x478420){if(_0x478420){return _0x478420['destroy']()[_0x6320('0x26')](function(){_0x41a35a[_0x6320('0x19')](0xcc)[_0x6320('0x1a')]();});}};}function handleEntityNotFound(_0x319167,_0x2fe6aa){return function(_0x3d562d){if(!_0x3d562d){_0x319167[_0x6320('0x18')](0x194);}return _0x3d562d;};}function handleError(_0x243c91,_0x11d8a8){_0x11d8a8=_0x11d8a8||0x1f4;return function(_0x286853){logger[_0x6320('0x27')](_0x286853[_0x6320('0x28')]);if(_0x286853[_0x6320('0x29')]){delete _0x286853[_0x6320('0x29')];}_0x243c91['status'](_0x11d8a8)[_0x6320('0x2a')](_0x286853);};}exports['index']=function(_0x1a2ddf,_0x388382){var _0x3ec7b0={},_0x5bfdfb={},_0x5ea36c={'count':0x0,'rows':[]};var _0xf95edf=_['map'](db[_0x6320('0x2b')][_0x6320('0x2c')],function(_0x140d58){return{'name':_0x140d58[_0x6320('0x2d')],'type':_0x140d58[_0x6320('0x2e')]['key']};});_0x5bfdfb[_0x6320('0x2f')]=_['map'](_0xf95edf,_0x6320('0x29'));_0x5bfdfb[_0x6320('0x30')]=_[_0x6320('0x31')](_0x1a2ddf['query']);_0x5bfdfb[_0x6320('0x32')]=_[_0x6320('0x33')](_0x5bfdfb['model'],_0x5bfdfb[_0x6320('0x30')]);_0x3ec7b0[_0x6320('0x34')]=_['intersection'](_0x5bfdfb[_0x6320('0x2f')],qs['fields'](_0x1a2ddf[_0x6320('0x30')][_0x6320('0x35')]));_0x3ec7b0[_0x6320('0x34')]=_0x3ec7b0[_0x6320('0x34')]['length']?_0x3ec7b0[_0x6320('0x34')]:_0x5bfdfb[_0x6320('0x2f')];if(!_0x1a2ddf['query']['hasOwnProperty']('nolimit')){_0x3ec7b0['limit']=qs[_0x6320('0x1d')](_0x1a2ddf['query'][_0x6320('0x1d')]);_0x3ec7b0['offset']=qs[_0x6320('0x1c')](_0x1a2ddf[_0x6320('0x30')][_0x6320('0x1c')]);}_0x3ec7b0[_0x6320('0x36')]=qs[_0x6320('0x37')](_0x1a2ddf[_0x6320('0x30')][_0x6320('0x37')]);_0x3ec7b0[_0x6320('0x38')]=qs[_0x6320('0x32')](_[_0x6320('0x39')](_0x1a2ddf[_0x6320('0x30')],_0x5bfdfb[_0x6320('0x32')]),_0xf95edf);if(_0x1a2ddf['query'][_0x6320('0x3a')]){_0x3ec7b0['where']=_['merge'](_0x3ec7b0[_0x6320('0x38')],{'$or':_['map'](_0xf95edf,function(_0x46f3bc){if(_0x46f3bc[_0x6320('0x2e')]!==_0x6320('0x3b')){var _0x27d747={};_0x27d747[_0x46f3bc['name']]={'$like':'%'+_0x1a2ddf[_0x6320('0x30')][_0x6320('0x3a')]+'%'};return _0x27d747;}})});}_0x3ec7b0=_[_0x6320('0x3c')]({},_0x3ec7b0,_0x1a2ddf[_0x6320('0x3d')]);var _0x5da4b8={'where':_0x3ec7b0[_0x6320('0x38')]};return db[_0x6320('0x2b')][_0x6320('0x1f')](_0x5da4b8)['then'](function(_0x354afa){_0x5ea36c[_0x6320('0x1f')]=_0x354afa;if(_0x1a2ddf[_0x6320('0x30')][_0x6320('0x3e')]){_0x3ec7b0['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0x6320('0x3f')](_0x3ec7b0);})[_0x6320('0x26')](function(_0x2c5fb0){_0x5ea36c[_0x6320('0x40')]=_0x2c5fb0;return _0x5ea36c;})['then'](respondWithFilteredResult(_0x388382,_0x3ec7b0))[_0x6320('0x41')](handleError(_0x388382,null));};exports[_0x6320('0x42')]=function(_0x49d1cb,_0x499ddf){var _0x3c9baf={'raw':![],'where':{'id':_0x49d1cb[_0x6320('0x43')]['id']}},_0x348ef={};_0x348ef[_0x6320('0x2f')]=_['keys'](db[_0x6320('0x2b')]['rawAttributes']);_0x348ef['query']=_[_0x6320('0x31')](_0x49d1cb['query']);_0x348ef['filters']=_[_0x6320('0x33')](_0x348ef[_0x6320('0x2f')],_0x348ef[_0x6320('0x30')]);_0x3c9baf[_0x6320('0x34')]=_['intersection'](_0x348ef[_0x6320('0x2f')],qs[_0x6320('0x35')](_0x49d1cb[_0x6320('0x30')]['fields']));_0x3c9baf[_0x6320('0x34')]=_0x3c9baf[_0x6320('0x34')][_0x6320('0x44')]?_0x3c9baf[_0x6320('0x34')]:_0x348ef[_0x6320('0x2f')];if(_0x49d1cb[_0x6320('0x30')][_0x6320('0x3e')]){_0x3c9baf[_0x6320('0x45')]=[{'all':!![]}];}_0x3c9baf=_[_0x6320('0x3c')]({},_0x3c9baf,_0x49d1cb[_0x6320('0x3d')]);return db[_0x6320('0x2b')][_0x6320('0x46')](_0x3c9baf)[_0x6320('0x26')](handleEntityNotFound(_0x499ddf,null))[_0x6320('0x26')](respondWithResult(_0x499ddf,null))[_0x6320('0x41')](handleError(_0x499ddf,null));};exports[_0x6320('0x47')]=function(_0x5d90d5,_0x2a20ec){return db['FreshsalesAccount'][_0x6320('0x47')](_0x5d90d5[_0x6320('0x48')],{})[_0x6320('0x26')](respondWithResult(_0x2a20ec,0xc9))[_0x6320('0x41')](handleError(_0x2a20ec,null));};exports[_0x6320('0x25')]=function(_0x38f28e,_0x8d6377){if(_0x38f28e['body']['id']){delete _0x38f28e[_0x6320('0x48')]['id'];}return db[_0x6320('0x2b')][_0x6320('0x46')]({'where':{'id':_0x38f28e[_0x6320('0x43')]['id']}})[_0x6320('0x26')](handleEntityNotFound(_0x8d6377,null))[_0x6320('0x26')](saveUpdates(_0x38f28e[_0x6320('0x48')],null))[_0x6320('0x26')](respondWithResult(_0x8d6377,null))['catch'](handleError(_0x8d6377,null));};exports['destroy']=function(_0x24f496,_0x191d5a){return db['FreshsalesAccount'][_0x6320('0x46')]({'where':{'id':_0x24f496[_0x6320('0x43')]['id']}})['then'](handleEntityNotFound(_0x191d5a,null))[_0x6320('0x26')](removeEntity(_0x191d5a,null))['catch'](handleError(_0x191d5a,null));};exports['getConfigurations']=function(_0x17d8bc,_0x4e10bd,_0x51a25b){var _0x1bed3f={};var _0x1212e3={};var _0xbd948a;var _0x43c59f;return db[_0x6320('0x2b')][_0x6320('0x49')]({'where':{'id':_0x17d8bc[_0x6320('0x43')]['id']}})[_0x6320('0x26')](handleEntityNotFound(_0x4e10bd,null))[_0x6320('0x26')](function(_0x4b9417){if(_0x4b9417){_0xbd948a=_0x4b9417;_0x1212e3[_0x6320('0x2f')]=_['keys'](db['FreshsalesConfiguration']['rawAttributes']);_0x1212e3[_0x6320('0x30')]=_[_0x6320('0x31')](_0x17d8bc[_0x6320('0x30')]);_0x1212e3[_0x6320('0x32')]=_[_0x6320('0x33')](_0x1212e3[_0x6320('0x2f')],_0x1212e3['query']);_0x1bed3f['attributes']=_[_0x6320('0x33')](_0x1212e3[_0x6320('0x2f')],qs[_0x6320('0x35')](_0x17d8bc['query'][_0x6320('0x35')]));_0x1bed3f[_0x6320('0x34')]=_0x1bed3f[_0x6320('0x34')][_0x6320('0x44')]?_0x1bed3f['attributes']:_0x1212e3[_0x6320('0x2f')];_0x1bed3f['order']=qs['sort'](_0x17d8bc[_0x6320('0x30')][_0x6320('0x37')]);_0x1bed3f[_0x6320('0x38')]=qs[_0x6320('0x32')](_[_0x6320('0x39')](_0x17d8bc[_0x6320('0x30')],_0x1212e3['filters']));if(_0x17d8bc['query']['filter']){_0x1bed3f[_0x6320('0x38')]=_[_0x6320('0x3c')](_0x1bed3f[_0x6320('0x38')],{'$or':_[_0x6320('0x4a')](_0x1bed3f['attributes'],function(_0xf79faf){var _0x310e81={};_0x310e81[_0xf79faf]={'$like':'%'+_0x17d8bc[_0x6320('0x30')][_0x6320('0x3a')]+'%'};return _0x310e81;})});}_0x1bed3f=_['merge']({},_0x1bed3f,_0x17d8bc[_0x6320('0x3d')]);return _0xbd948a[_0x6320('0x4b')](_0x1bed3f);}})['then'](function(_0x16fd36){if(_0x16fd36){_0x43c59f=_0x16fd36[_0x6320('0x44')];if(!_0x17d8bc[_0x6320('0x30')][_0x6320('0x4c')]('nolimit')){_0x1bed3f['limit']=qs[_0x6320('0x1d')](_0x17d8bc['query'][_0x6320('0x1d')]);_0x1bed3f[_0x6320('0x1c')]=qs['offset'](_0x17d8bc[_0x6320('0x30')][_0x6320('0x1c')]);}return _0xbd948a['getConfigurations'](_0x1bed3f);}})[_0x6320('0x26')](function(_0x169eca){if(_0x169eca){return _0x169eca?{'count':_0x43c59f,'rows':_0x169eca}:null;}})['then'](respondWithResult(_0x4e10bd,null))['catch'](handleError(_0x4e10bd,null));};exports['addConfiguration']=function(_0x3dc18a,_0x2a8d97,_0x47f51f){if(_0x3dc18a[_0x6320('0x48')]['id']){delete _0x3dc18a['body']['id'];}return db[_0x6320('0x2b')]['findOne']({'where':{'id':_0x3dc18a[_0x6320('0x43')]['id']}})[_0x6320('0x26')](handleEntityNotFound(_0x2a8d97,null))[_0x6320('0x26')](function(_0x16d2da){if(_0x16d2da){_0x3dc18a['body'][_0x6320('0x4d')]=_0x16d2da['id'];_0x3dc18a[_0x6320('0x48')][_0x6320('0x4e')]=integrations[_0x6320('0x4f')](_0x3dc18a[_0x6320('0x48')][_0x6320('0x50')],_0x3dc18a['body'][_0x6320('0x2e')]);_0x3dc18a[_0x6320('0x48')]['Descriptions']=integrations['getDescriptions'](_0x3dc18a['body'][_0x6320('0x50')],_0x3dc18a[_0x6320('0x48')][_0x6320('0x2e')]);return db[_0x6320('0x51')][_0x6320('0x47')](_0x3dc18a[_0x6320('0x48')],{'include':[{'model':db[_0x6320('0x52')],'as':_0x6320('0x4e')},{'model':db[_0x6320('0x52')],'as':_0x6320('0x53')}]});}return null;})['then'](respondWithResult(_0x2a8d97,null))[_0x6320('0x41')](handleError(_0x2a8d97,null));};exports['getFields']=function(_0x46dbd4,_0x13e2a7,_0x8518b8){var _0x1b609d='';var _0x3f47f4='';return db[_0x6320('0x2b')]['findOne']({'where':{'id':_0x46dbd4[_0x6320('0x43')]['id']},'attributes':['id','username',_0x6320('0x54'),_0x6320('0x55')]})[_0x6320('0x26')](handleEntityNotFound(_0x13e2a7,null))[_0x6320('0x26')](function(_0x2177f3){if(_0x2177f3){_0x3f47f4=_0x2177f3['username'];_0x1b609d=_0x2177f3[_0x6320('0x54')];var _0x3ba25f=_0x2177f3[_0x6320('0x54')][_0x6320('0x56')](-0x1);if(_0x3ba25f==='/'){_0x1b609d=_0x1b609d[_0x6320('0x57')](0x0,_0x1b609d[_0x6320('0x58')](_0x3ba25f));}return rp({'method':_0x6320('0x59'),'uri':util['format'](_0x6320('0x5a'),_0x1b609d,'/api/selector/owners'),'headers':{'Authorization':_0x6320('0x5b')+_0x2177f3['apiKey']},'json':!![]});}})[_0x6320('0x26')](function(_0x1d3dda){if(_0x1d3dda){var _0x38a349=_0x1d3dda[_0x6320('0x5c')];var _0x3f5ab6=![];var _0x25ed22=null;for(_0x25ed22=0x0;_0x25ed22<_0x38a349[_0x6320('0x44')];_0x25ed22++){if(_0x38a349[_0x25ed22][_0x6320('0x5d')]===_0x3f47f4){_0x3f5ab6=!![];}}if(_0x3f5ab6){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x6320('0x5e')});}}})[_0x6320('0x26')](respondWithResult(_0x13e2a7,null))[_0x6320('0x41')](function(_0x3b1434){var _0x375d58=_0x46dbd4['query']['test']?0x1f4:_0x3b1434[_0x6320('0x5f')]||0x1f4;logger[_0x6320('0x27')](_0x6320('0x60'),_0x6320('0x61'),_0x375d58,JSON[_0x6320('0x62')](_0x3b1434));delete _0x3b1434['name'];if(_0x375d58===0x191){_0x375d58=0x190;}_0x13e2a7['status'](_0x375d58)[_0x6320('0x2a')](_0x46dbd4['query'][_0x6320('0x63')]?{'message':'Wrong\x20credentials','statusCode':_0x3b1434['statusCode']}:_0x3b1434);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 7c7e05e..37e7b0c 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 _0x77d4=['../../components/integrations/configuration','exports','int_freshsales_accounts','util','api','bluebird','request-promise','../../config/environment','./intFreshsalesAccount.attributes'];(function(_0x55c0b7,_0xf4f86a){var _0x50294b=function(_0x2a09e3){while(--_0x2a09e3){_0x55c0b7['push'](_0x55c0b7['shift']());}};_0x50294b(++_0xf4f86a);}(_0x77d4,0x108));var _0x477d=function(_0x61dbe7,_0x290a3c){_0x61dbe7=_0x61dbe7-0x0;var _0x1d8e26=_0x77d4[_0x61dbe7];return _0x1d8e26;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var logger=require('../../config/logger')(_0x477d('0x1'));var moment=require('moment');var BPromise=require(_0x477d('0x2'));var rp=require(_0x477d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x477d('0x4'));var attributes=require(_0x477d('0x5'));var integrations=require(_0x477d('0x6'));module[_0x477d('0x7')]=function(_0x2545e5,_0x45ca2d){return _0x2545e5['define']('FreshsalesAccount',attributes,{'tableName':_0x477d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7880=['bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','util','../../config/logger','api','moment'];(function(_0x5bab39,_0x33db83){var _0x40305e=function(_0x34bd3a){while(--_0x34bd3a){_0x5bab39['push'](_0x5bab39['shift']());}};_0x40305e(++_0x33db83);}(_0x7880,0x1f4));var _0x0788=function(_0x16ba74,_0x2ebcfa){_0x16ba74=_0x16ba74-0x0;var _0x4333a6=_0x7880[_0x16ba74];return _0x4333a6;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var logger=require(_0x0788('0x1'))(_0x0788('0x2'));var moment=require(_0x0788('0x3'));var BPromise=require(_0x0788('0x4'));var rp=require(_0x0788('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var attributes=require(_0x0788('0x8'));var integrations=require(_0x0788('0x9'));module[_0x0788('0xa')]=function(_0x775629,_0x3f9cb8){return _0x775629[_0x0788('0xb')](_0x0788('0xc'),attributes,{'tableName':_0x0788('0xd'),'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 1e0b100..367d5c0 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 _0x6d38=['moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','include','model','debug','catch','ShowFreshsalesAccount','find','map','util'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x6d38,0x1ef));var _0x86d3=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x6d38[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});}exports[_0x86d3('0x12')]=function(_0x46feec){var _0x120ef3=this;return new Promise(function(_0x33e459,_0x32dee7){return db[_0x86d3('0x13')]['findAll']({'raw':_0x46feec[_0x86d3('0x14')]?_0x46feec['options'][_0x86d3('0x15')]===undefined?!![]:![]:!![],'where':_0x46feec['options']?_0x46feec['options'][_0x86d3('0x16')]||null:null,'attributes':_0x46feec[_0x86d3('0x14')]?_0x46feec[_0x86d3('0x14')][_0x86d3('0x17')]||null:null,'limit':_0x46feec['options']?_0x46feec[_0x86d3('0x14')]['limit']||null:null,'include':_0x46feec[_0x86d3('0x14')]?_0x46feec[_0x86d3('0x14')][_0x86d3('0x18')]?_['map'](_0x46feec[_0x86d3('0x14')][_0x86d3('0x18')],function(_0x1fa4ac){return{'model':db[_0x1fa4ac['model']],'as':_0x1fa4ac['as'],'attributes':_0x1fa4ac['attributes'],'include':_0x1fa4ac[_0x86d3('0x18')]?_['map'](_0x1fa4ac[_0x86d3('0x18')],function(_0x1bea5e){return{'model':db[_0x1bea5e[_0x86d3('0x19')]],'as':_0x1bea5e['as'],'attributes':_0x1bea5e[_0x86d3('0x17')],'include':_0x1bea5e['include']?_['map'](_0x1bea5e[_0x86d3('0x18')],function(_0x611764){return{'model':db[_0x611764['model']],'as':_0x611764['as'],'attributes':_0x611764[_0x86d3('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42413c){logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x46feec);logger[_0x86d3('0x1a')](_0x86d3('0x12'),_0x46feec,JSON[_0x86d3('0xd')](_0x42413c));_0x33e459(_0x42413c);})[_0x86d3('0x1b')](function(_0x35d708){logger[_0x86d3('0xe')](_0x86d3('0x12'),_0x35d708[_0x86d3('0xf')],_0x46feec);_0x32dee7(_0x120ef3[_0x86d3('0xe')](0x1f4,_0x35d708[_0x86d3('0xf')]));});});};exports[_0x86d3('0x1c')]=function(_0x5b09f6){var _0x120a0c=this;return new Promise(function(_0x403be3,_0x2bda35){return db[_0x86d3('0x13')][_0x86d3('0x1d')]({'raw':_0x5b09f6[_0x86d3('0x14')]?_0x5b09f6['options'][_0x86d3('0x15')]===undefined?!![]:![]:!![],'where':_0x5b09f6['options']?_0x5b09f6['options'][_0x86d3('0x16')]||null:null,'attributes':_0x5b09f6[_0x86d3('0x14')]?_0x5b09f6[_0x86d3('0x14')]['attributes']||null:null,'include':_0x5b09f6[_0x86d3('0x14')]?_0x5b09f6[_0x86d3('0x14')]['include']?_[_0x86d3('0x1e')](_0x5b09f6[_0x86d3('0x14')][_0x86d3('0x18')],function(_0x476eb3){return{'model':db[_0x476eb3[_0x86d3('0x19')]],'as':_0x476eb3['as'],'attributes':_0x476eb3[_0x86d3('0x17')],'include':_0x476eb3[_0x86d3('0x18')]?_[_0x86d3('0x1e')](_0x476eb3['include'],function(_0x4cdf45){return{'model':db[_0x4cdf45['model']],'as':_0x4cdf45['as'],'attributes':_0x4cdf45[_0x86d3('0x17')],'include':_0x4cdf45['include']?_[_0x86d3('0x1e')](_0x4cdf45['include'],function(_0x366943){return{'model':db[_0x366943[_0x86d3('0x19')]],'as':_0x366943['as'],'attributes':_0x366943[_0x86d3('0x17')]};}):[]};}):[]};}):[]:[]})[_0x86d3('0xa')](function(_0x1e22c2){logger[_0x86d3('0x10')](_0x86d3('0x1c'),_0x5b09f6);logger['debug'](_0x86d3('0x1c'),_0x5b09f6,JSON[_0x86d3('0xd')](_0x1e22c2));_0x403be3(_0x1e22c2);})['catch'](function(_0x178fc6){logger[_0x86d3('0xe')](_0x86d3('0x1c'),_0x178fc6[_0x86d3('0xf')],_0x5b09f6);_0x2bda35(_0x120a0c['error'](0x1f4,_0x178fc6[_0x86d3('0xf')]));});});}; \ No newline at end of file +var _0xa46e=['model','attributes','GetFreshsalesAccount','ShowFreshsalesAccount','find','where','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','message','FreshsalesAccount,\x20%s,\x20%s','info','result','catch','FreshsalesAccount','findAll','options','raw','include','map'];(function(_0x5b0a46,_0x5eec42){var _0xb1c9f1=function(_0x398070){while(--_0x398070){_0x5b0a46['push'](_0x5b0a46['shift']());}};_0xb1c9f1(++_0x5eec42);}(_0xa46e,0x8a));var _0xea46=function(_0x1c5142,_0x30ea72){_0x1c5142=_0x1c5142-0x0;var _0x1268cb=_0xa46e[_0x1c5142];return _0x1268cb;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var moment=require('moment');var BPromise=require(_0xea46('0x2'));var rs=require(_0xea46('0x3'));var fs=require('fs');var Redis=require(_0xea46('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xea46('0x5'));var logger=require('../../config/logger')(_0xea46('0x6'));var config=require('../../config/environment');var jayson=require(_0xea46('0x7'));var client=jayson['client'][_0xea46('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dc26f,_0x5f1cd1,_0x2d1b30){return new BPromise(function(_0x42771a,_0xe7d428){return client[_0xea46('0x9')](_0x3dc26f,_0x2d1b30)[_0xea46('0xa')](function(_0x4cf206){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'));logger[_0xea46('0xc')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'),JSON[_0xea46('0xd')](_0x4cf206));if(_0x4cf206[_0xea46('0xe')]){if(_0x4cf206['error'][_0xea46('0xf')]===0x1f4){logger[_0xea46('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0xe7d428(_0x4cf206['error'][_0xea46('0x10')]);}logger['error'](_0xea46('0x11'),_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0x42771a(_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);}else{logger[_0xea46('0x12')](_0xea46('0x11'),_0x5f1cd1,_0xea46('0xb'));_0x42771a(_0x4cf206[_0xea46('0x13')]['message']);}})[_0xea46('0x14')](function(_0xbf225e){logger[_0xea46('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x5f1cd1,_0xbf225e);_0xe7d428(_0xbf225e);});});}exports['GetFreshsalesAccount']=function(_0x19d5c1){var _0x3f463d=this;return new Promise(function(_0x5cf5dd,_0x4b6745){return db[_0xea46('0x15')][_0xea46('0x16')]({'raw':_0x19d5c1['options']?_0x19d5c1[_0xea46('0x17')][_0xea46('0x18')]===undefined?!![]:![]:!![],'where':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1[_0xea46('0x17')]['where']||null:null,'attributes':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1['options']['attributes']||null:null,'limit':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1['options']['limit']||null:null,'include':_0x19d5c1['options']?_0x19d5c1[_0xea46('0x17')][_0xea46('0x19')]?_[_0xea46('0x1a')](_0x19d5c1['options'][_0xea46('0x19')],function(_0x59b10d){return{'model':db[_0x59b10d[_0xea46('0x1b')]],'as':_0x59b10d['as'],'attributes':_0x59b10d[_0xea46('0x1c')],'include':_0x59b10d['include']?_[_0xea46('0x1a')](_0x59b10d['include'],function(_0x2b3a8f){return{'model':db[_0x2b3a8f[_0xea46('0x1b')]],'as':_0x2b3a8f['as'],'attributes':_0x2b3a8f[_0xea46('0x1c')],'include':_0x2b3a8f['include']?_['map'](_0x2b3a8f[_0xea46('0x19')],function(_0x38ac07){return{'model':db[_0x38ac07['model']],'as':_0x38ac07['as'],'attributes':_0x38ac07[_0xea46('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11129d){logger['info'](_0xea46('0x1d'),_0x19d5c1);logger[_0xea46('0xc')](_0xea46('0x1d'),_0x19d5c1,JSON[_0xea46('0xd')](_0x11129d));_0x5cf5dd(_0x11129d);})[_0xea46('0x14')](function(_0x174345){logger['error'](_0xea46('0x1d'),_0x174345[_0xea46('0x10')],_0x19d5c1);_0x4b6745(_0x3f463d[_0xea46('0xe')](0x1f4,_0x174345['message']));});});};exports[_0xea46('0x1e')]=function(_0x3cdf96){var _0x38d631=this;return new Promise(function(_0x5a0fc0,_0x4a0635){return db['FreshsalesAccount'][_0xea46('0x1f')]({'raw':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96[_0xea46('0x17')][_0xea46('0x18')]===undefined?!![]:![]:!![],'where':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96[_0xea46('0x17')][_0xea46('0x20')]||null:null,'attributes':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96[_0xea46('0x17')][_0xea46('0x1c')]||null:null,'include':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96['options'][_0xea46('0x19')]?_[_0xea46('0x1a')](_0x3cdf96[_0xea46('0x17')][_0xea46('0x19')],function(_0x1472c0){return{'model':db[_0x1472c0[_0xea46('0x1b')]],'as':_0x1472c0['as'],'attributes':_0x1472c0[_0xea46('0x1c')],'include':_0x1472c0['include']?_[_0xea46('0x1a')](_0x1472c0[_0xea46('0x19')],function(_0x388449){return{'model':db[_0x388449[_0xea46('0x1b')]],'as':_0x388449['as'],'attributes':_0x388449[_0xea46('0x1c')],'include':_0x388449['include']?_['map'](_0x388449[_0xea46('0x19')],function(_0x343499){return{'model':db[_0x343499['model']],'as':_0x343499['as'],'attributes':_0x343499[_0xea46('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xea46('0xa')](function(_0x123aae){logger[_0xea46('0x12')]('ShowFreshsalesAccount',_0x3cdf96);logger['debug'](_0xea46('0x1e'),_0x3cdf96,JSON['stringify'](_0x123aae));_0x5a0fc0(_0x123aae);})[_0xea46('0x14')](function(_0xdec374){logger['error'](_0xea46('0x1e'),_0xdec374[_0xea46('0x10')],_0x3cdf96);_0x4a0635(_0x38d631['error'](0x1f4,_0xdec374[_0xea46('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index e8e471d..2d12d41 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 _0xcd5a=['put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','/:id','isAuthenticated','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getFields','post','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcd5a,0x1a2));var _0xacd5=function(_0x644603,_0x18b1c6){_0x644603=_0x644603-0x0;var _0x231ce9=_0xcd5a[_0x644603];return _0x231ce9;};'use strict';var multer=require('multer');var util=require(_0xacd5('0x0'));var path=require(_0xacd5('0x1'));var timeout=require(_0xacd5('0x2'));var express=require(_0xacd5('0x3'));var router=express[_0xacd5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xacd5('0x5'));var interaction=require(_0xacd5('0x6'));var config=require(_0xacd5('0x7'));var controller=require(_0xacd5('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xacd5('0x9'),auth[_0xacd5('0xa')](),controller['show']);router[_0xacd5('0xb')](_0xacd5('0xc'),auth[_0xacd5('0xa')](),controller[_0xacd5('0xd')]);router['get'](_0xacd5('0xe'),auth[_0xacd5('0xa')](),controller[_0xacd5('0xf')]);router[_0xacd5('0xb')]('/:id/fields',auth[_0xacd5('0xa')](),controller[_0xacd5('0x10')]);router[_0xacd5('0x11')]('/',auth[_0xacd5('0xa')](),controller[_0xacd5('0x12')]);router[_0xacd5('0x13')](_0xacd5('0x9'),auth['isAuthenticated'](),controller[_0xacd5('0x14')]);router['delete'](_0xacd5('0x9'),auth[_0xacd5('0xa')](),controller[_0xacd5('0x15')]);module[_0xacd5('0x16')]=router; \ No newline at end of file +var _0x0f2c=['/:id','isAuthenticated','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x0f2c,0x175));var _0xc0f2=function(_0x401176,_0x1bd06b){_0x401176=_0x401176-0x0;var _0x3f74d6=_0x0f2c[_0x401176];return _0x3f74d6;};'use strict';var multer=require(_0xc0f2('0x0'));var util=require(_0xc0f2('0x1'));var path=require('path');var timeout=require(_0xc0f2('0x2'));var express=require(_0xc0f2('0x3'));var router=express[_0xc0f2('0x4')]();var fs_extra=require(_0xc0f2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc0f2('0x6'));var config=require(_0xc0f2('0x7'));var controller=require(_0xc0f2('0x8'));router[_0xc0f2('0x9')]('/',auth['isAuthenticated'](),controller[_0xc0f2('0xa')]);router[_0xc0f2('0x9')](_0xc0f2('0xb'),auth[_0xc0f2('0xc')](),controller['show']);router[_0xc0f2('0x9')](_0xc0f2('0xd'),auth[_0xc0f2('0xc')](),controller[_0xc0f2('0xe')]);router[_0xc0f2('0x9')]('/:id/descriptions',auth[_0xc0f2('0xc')](),controller[_0xc0f2('0xf')]);router['get'](_0xc0f2('0x10'),auth[_0xc0f2('0xc')](),controller[_0xc0f2('0x11')]);router['post']('/',auth[_0xc0f2('0xc')](),controller[_0xc0f2('0x12')]);router[_0xc0f2('0x13')](_0xc0f2('0xb'),auth[_0xc0f2('0xc')](),controller[_0xc0f2('0x14')]);router[_0xc0f2('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xc0f2('0x16')]);module[_0xc0f2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 94f9c7e..3cdc075 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 _0x4e5a=['sequelize','STRING'];(function(_0x14a8c4,_0x3ff392){var _0x3e3a53=function(_0x5a8efb){while(--_0x5a8efb){_0x14a8c4['push'](_0x14a8c4['shift']());}};_0x3e3a53(++_0x3ff392);}(_0x4e5a,0x17e));var _0xa4e5=function(_0x563129,_0x26d5f9){_0x563129=_0x563129-0x0;var _0x28d1a3=_0x4e5a[_0x563129];return _0x28d1a3;};'use strict';var Sequelize=require(_0xa4e5('0x0'));module['exports']={'name':{'type':Sequelize[_0xa4e5('0x1')]},'description':{'type':Sequelize[_0xa4e5('0x1')]}}; \ No newline at end of file +var _0x92e6=['exports','STRING','sequelize'];(function(_0x55a121,_0x867e38){var _0x4a5f65=function(_0x1082bf){while(--_0x1082bf){_0x55a121['push'](_0x55a121['shift']());}};_0x4a5f65(++_0x867e38);}(_0x92e6,0x188));var _0x692e=function(_0xe69bf1,_0x487cbc){_0xe69bf1=_0xe69bf1-0x0;var _0x1259d1=_0x92e6[_0xe69bf1];return _0x1259d1;};'use strict';var Sequelize=require(_0x692e('0x0'));module[_0x692e('0x1')]={'name':{'type':Sequelize[_0x692e('0x2')]},'description':{'type':Sequelize[_0x692e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index d4b1018..7adb769 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 _0x2ca7=['catch','show','params','length','includeAll','include','find','create','body','getSubjects','FreshsalesField','getDescriptions','findOne','getFields','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows'];(function(_0x137c7a,_0x526b18){var _0x31df3f=function(_0x17202e){while(--_0x17202e){_0x137c7a['push'](_0x137c7a['shift']());}};_0x31df3f(++_0x526b18);}(_0x2ca7,0x152));var _0x72ca=function(_0x14407c,_0x272404){_0x14407c=_0x14407c-0x0;var _0x134cb6=_0x2ca7[_0x14407c];return _0x134cb6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x72ca('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x72ca('0x1'));var moment=require(_0x72ca('0x2'));var BPromise=require(_0x72ca('0x3'));var Mustache=require(_0x72ca('0x4'));var util=require(_0x72ca('0x5'));var path=require(_0x72ca('0x6'));var sox=require(_0x72ca('0x7'));var csv=require(_0x72ca('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72ca('0x9'));var _=require(_0x72ca('0xa'));var squel=require(_0x72ca('0xb'));var crypto=require(_0x72ca('0xc'));var jsforce=require(_0x72ca('0xd'));var deskjs=require(_0x72ca('0xe'));var toCsv=require(_0x72ca('0x8'));var querystring=require('querystring');var Papa=require(_0x72ca('0xf'));var Redis=require(_0x72ca('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x72ca('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72ca('0x12'));var logger=require(_0x72ca('0x13'))(_0x72ca('0x14'));var utils=require('../../config/utils');var config=require(_0x72ca('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x72ca('0x16'))['db'];function respondWithStatusCode(_0xfd5b4c,_0x3d8e83){_0x3d8e83=_0x3d8e83||0xcc;return function(_0x347971){if(_0x347971){return _0xfd5b4c[_0x72ca('0x17')](_0x3d8e83);}return _0xfd5b4c['status'](_0x3d8e83)[_0x72ca('0x18')]();};}function respondWithResult(_0x4e3ac5,_0x496729){_0x496729=_0x496729||0xc8;return function(_0x2e0412){if(_0x2e0412){return _0x4e3ac5[_0x72ca('0x19')](_0x496729)[_0x72ca('0x1a')](_0x2e0412);}};}function respondWithFilteredResult(_0x2f8c4a,_0x577c23){return function(_0x286251){if(_0x286251){var _0x353667=typeof _0x577c23[_0x72ca('0x1b')]===_0x72ca('0x1c')&&typeof _0x577c23[_0x72ca('0x1d')]===_0x72ca('0x1c');var _0x121401=_0x286251[_0x72ca('0x1e')];var _0x337802=_0x353667?0x0:_0x577c23['offset'];var _0x132d4f=_0x353667?_0x286251[_0x72ca('0x1e')]:_0x577c23[_0x72ca('0x1b')]+_0x577c23[_0x72ca('0x1d')];var _0x160886;if(_0x132d4f>=_0x121401){_0x132d4f=_0x121401;_0x160886=0xc8;}else{_0x160886=0xce;}_0x2f8c4a['status'](_0x160886);return _0x2f8c4a[_0x72ca('0x1f')]('Content-Range',_0x337802+'-'+_0x132d4f+'/'+_0x121401)[_0x72ca('0x1a')](_0x286251);}return null;};}function patchUpdates(_0x53ac31){return function(_0x4e519d){try{jsonpatch[_0x72ca('0x20')](_0x4e519d,_0x53ac31,!![]);}catch(_0x28c2a4){return BPromise[_0x72ca('0x21')](_0x28c2a4);}return _0x4e519d[_0x72ca('0x22')]();};}function saveUpdates(_0x5c3e52,_0x355098){return function(_0x116e26){if(_0x116e26){return _0x116e26[_0x72ca('0x23')](_0x5c3e52)[_0x72ca('0x24')](function(_0x2f05a2){return _0x2f05a2;});}return null;};}function removeEntity(_0x547767,_0x4bce5e){return function(_0x4aa3e9){if(_0x4aa3e9){return _0x4aa3e9[_0x72ca('0x25')]()[_0x72ca('0x24')](function(){_0x547767['status'](0xcc)[_0x72ca('0x18')]();});}};}function handleEntityNotFound(_0x2b3b4c,_0x2a24bf){return function(_0x1ed3b1){if(!_0x1ed3b1){_0x2b3b4c[_0x72ca('0x17')](0x194);}return _0x1ed3b1;};}function handleError(_0x189a36,_0x4bd2df){_0x4bd2df=_0x4bd2df||0x1f4;return function(_0x2a1fd0){logger[_0x72ca('0x26')](_0x2a1fd0[_0x72ca('0x27')]);if(_0x2a1fd0[_0x72ca('0x28')]){delete _0x2a1fd0[_0x72ca('0x28')];}_0x189a36[_0x72ca('0x19')](_0x4bd2df)[_0x72ca('0x29')](_0x2a1fd0);};}exports['index']=function(_0xbc6868,_0x3aceca){var _0x32bddb={},_0x37359a={},_0x273bd5={'count':0x0,'rows':[]};var _0x27f98f=_[_0x72ca('0x2a')](db[_0x72ca('0x2b')][_0x72ca('0x2c')],function(_0x1edae0){return{'name':_0x1edae0[_0x72ca('0x2d')],'type':_0x1edae0[_0x72ca('0x2e')][_0x72ca('0x2f')]};});_0x37359a['model']=_[_0x72ca('0x2a')](_0x27f98f,_0x72ca('0x28'));_0x37359a[_0x72ca('0x30')]=_[_0x72ca('0x31')](_0xbc6868[_0x72ca('0x30')]);_0x37359a[_0x72ca('0x32')]=_[_0x72ca('0x33')](_0x37359a['model'],_0x37359a[_0x72ca('0x30')]);_0x32bddb['attributes']=_[_0x72ca('0x33')](_0x37359a[_0x72ca('0x34')],qs[_0x72ca('0x35')](_0xbc6868[_0x72ca('0x30')]['fields']));_0x32bddb[_0x72ca('0x36')]=_0x32bddb['attributes']['length']?_0x32bddb[_0x72ca('0x36')]:_0x37359a['model'];if(!_0xbc6868[_0x72ca('0x30')][_0x72ca('0x37')](_0x72ca('0x38'))){_0x32bddb[_0x72ca('0x1d')]=qs[_0x72ca('0x1d')](_0xbc6868[_0x72ca('0x30')][_0x72ca('0x1d')]);_0x32bddb['offset']=qs['offset'](_0xbc6868[_0x72ca('0x30')]['offset']);}_0x32bddb[_0x72ca('0x39')]=qs[_0x72ca('0x3a')](_0xbc6868[_0x72ca('0x30')]['sort']);_0x32bddb[_0x72ca('0x3b')]=qs['filters'](_[_0x72ca('0x3c')](_0xbc6868['query'],_0x37359a[_0x72ca('0x32')]),_0x27f98f);if(_0xbc6868[_0x72ca('0x30')][_0x72ca('0x3d')]){_0x32bddb[_0x72ca('0x3b')]=_[_0x72ca('0x3e')](_0x32bddb[_0x72ca('0x3b')],{'$or':_[_0x72ca('0x2a')](_0x27f98f,function(_0x555865){if(_0x555865['type']!==_0x72ca('0x3f')){var _0x1d51f0={};_0x1d51f0[_0x555865[_0x72ca('0x28')]]={'$like':'%'+_0xbc6868['query'][_0x72ca('0x3d')]+'%'};return _0x1d51f0;}})});}_0x32bddb=_['merge']({},_0x32bddb,_0xbc6868[_0x72ca('0x40')]);var _0x2fbf1c={'where':_0x32bddb[_0x72ca('0x3b')]};return db[_0x72ca('0x2b')][_0x72ca('0x1e')](_0x2fbf1c)[_0x72ca('0x24')](function(_0x268380){_0x273bd5[_0x72ca('0x1e')]=_0x268380;if(_0xbc6868[_0x72ca('0x30')]['includeAll']){_0x32bddb['include']=[{'all':!![]}];}return db[_0x72ca('0x2b')][_0x72ca('0x41')](_0x32bddb);})[_0x72ca('0x24')](function(_0x476411){_0x273bd5[_0x72ca('0x42')]=_0x476411;return _0x273bd5;})[_0x72ca('0x24')](respondWithFilteredResult(_0x3aceca,_0x32bddb))[_0x72ca('0x43')](handleError(_0x3aceca,null));};exports[_0x72ca('0x44')]=function(_0x779fb7,_0xb84284){var _0x55db4b={'raw':![],'where':{'id':_0x779fb7[_0x72ca('0x45')]['id']}},_0x1027d3={};_0x1027d3[_0x72ca('0x34')]=_[_0x72ca('0x31')](db['FreshsalesConfiguration'][_0x72ca('0x2c')]);_0x1027d3[_0x72ca('0x30')]=_[_0x72ca('0x31')](_0x779fb7['query']);_0x1027d3[_0x72ca('0x32')]=_['intersection'](_0x1027d3[_0x72ca('0x34')],_0x1027d3[_0x72ca('0x30')]);_0x55db4b[_0x72ca('0x36')]=_[_0x72ca('0x33')](_0x1027d3[_0x72ca('0x34')],qs[_0x72ca('0x35')](_0x779fb7[_0x72ca('0x30')][_0x72ca('0x35')]));_0x55db4b[_0x72ca('0x36')]=_0x55db4b[_0x72ca('0x36')][_0x72ca('0x46')]?_0x55db4b[_0x72ca('0x36')]:_0x1027d3['model'];if(_0x779fb7[_0x72ca('0x30')][_0x72ca('0x47')]){_0x55db4b[_0x72ca('0x48')]=[{'all':!![]}];}_0x55db4b=_['merge']({},_0x55db4b,_0x779fb7[_0x72ca('0x40')]);return db['FreshsalesConfiguration'][_0x72ca('0x49')](_0x55db4b)['then'](handleEntityNotFound(_0xb84284,null))['then'](respondWithResult(_0xb84284,null))[_0x72ca('0x43')](handleError(_0xb84284,null));};exports['create']=function(_0x2914bd,_0x2694ac){return db[_0x72ca('0x2b')][_0x72ca('0x4a')](_0x2914bd[_0x72ca('0x4b')],{})[_0x72ca('0x24')](respondWithResult(_0x2694ac,0xc9))[_0x72ca('0x43')](handleError(_0x2694ac,null));};exports[_0x72ca('0x23')]=function(_0xa38829,_0x5ce3bf){if(_0xa38829[_0x72ca('0x4b')]['id']){delete _0xa38829[_0x72ca('0x4b')]['id'];}return db[_0x72ca('0x2b')][_0x72ca('0x49')]({'where':{'id':_0xa38829[_0x72ca('0x45')]['id']}})[_0x72ca('0x24')](handleEntityNotFound(_0x5ce3bf,null))[_0x72ca('0x24')](saveUpdates(_0xa38829[_0x72ca('0x4b')],null))[_0x72ca('0x24')](respondWithResult(_0x5ce3bf,null))['catch'](handleError(_0x5ce3bf,null));};exports[_0x72ca('0x25')]=function(_0x3743d2,_0x22d476){return db['FreshsalesConfiguration']['find']({'where':{'id':_0x3743d2[_0x72ca('0x45')]['id']}})[_0x72ca('0x24')](handleEntityNotFound(_0x22d476,null))[_0x72ca('0x24')](removeEntity(_0x22d476,null))[_0x72ca('0x43')](handleError(_0x22d476,null));};exports[_0x72ca('0x4c')]=function(_0x3adbc9,_0x5ec411,_0x1c5723){var _0xaa47b6={};var _0x640219={};var _0x10345d;var _0x3ee7de;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x3adbc9[_0x72ca('0x45')]['id']}})[_0x72ca('0x24')](handleEntityNotFound(_0x5ec411,null))[_0x72ca('0x24')](function(_0x5778b7){if(_0x5778b7){_0x10345d=_0x5778b7;_0x640219[_0x72ca('0x34')]=_[_0x72ca('0x31')](db[_0x72ca('0x4d')][_0x72ca('0x2c')]);_0x640219['query']=_[_0x72ca('0x31')](_0x3adbc9[_0x72ca('0x30')]);_0x640219[_0x72ca('0x32')]=_[_0x72ca('0x33')](_0x640219[_0x72ca('0x34')],_0x640219['query']);_0xaa47b6['attributes']=_[_0x72ca('0x33')](_0x640219[_0x72ca('0x34')],qs[_0x72ca('0x35')](_0x3adbc9[_0x72ca('0x30')][_0x72ca('0x35')]));_0xaa47b6['attributes']=_0xaa47b6[_0x72ca('0x36')][_0x72ca('0x46')]?_0xaa47b6[_0x72ca('0x36')]:_0x640219[_0x72ca('0x34')];_0xaa47b6[_0x72ca('0x39')]=qs['sort'](_0x3adbc9[_0x72ca('0x30')]['sort']);_0xaa47b6[_0x72ca('0x3b')]=qs[_0x72ca('0x32')](_[_0x72ca('0x3c')](_0x3adbc9[_0x72ca('0x30')],_0x640219[_0x72ca('0x32')]));if(_0x3adbc9[_0x72ca('0x30')]['filter']){_0xaa47b6[_0x72ca('0x3b')]=_[_0x72ca('0x3e')](_0xaa47b6[_0x72ca('0x3b')],{'$or':_[_0x72ca('0x2a')](_0xaa47b6['attributes'],function(_0x537056){var _0x217b1c={};_0x217b1c[_0x537056]={'$like':'%'+_0x3adbc9[_0x72ca('0x30')][_0x72ca('0x3d')]+'%'};return _0x217b1c;})});}_0xaa47b6=_[_0x72ca('0x3e')]({},_0xaa47b6,_0x3adbc9[_0x72ca('0x40')]);return _0x10345d[_0x72ca('0x4c')](_0xaa47b6);}})[_0x72ca('0x24')](function(_0x266136){if(_0x266136){_0x3ee7de=_0x266136[_0x72ca('0x46')];if(!_0x3adbc9[_0x72ca('0x30')][_0x72ca('0x37')]('nolimit')){_0xaa47b6[_0x72ca('0x1d')]=qs['limit'](_0x3adbc9[_0x72ca('0x30')][_0x72ca('0x1d')]);_0xaa47b6[_0x72ca('0x1b')]=qs['offset'](_0x3adbc9[_0x72ca('0x30')][_0x72ca('0x1b')]);}return _0x10345d[_0x72ca('0x4c')](_0xaa47b6);}})[_0x72ca('0x24')](function(_0x1402eb){if(_0x1402eb){return _0x1402eb?{'count':_0x3ee7de,'rows':_0x1402eb}:null;}})['then'](respondWithResult(_0x5ec411,null))[_0x72ca('0x43')](handleError(_0x5ec411,null));};exports[_0x72ca('0x4e')]=function(_0xeeff52,_0x21dc2d,_0x9a741){var _0xde1c47={};var _0x5c4167={};var _0x39f7ee;var _0xc786c9;return db['FreshsalesConfiguration'][_0x72ca('0x4f')]({'where':{'id':_0xeeff52[_0x72ca('0x45')]['id']}})[_0x72ca('0x24')](handleEntityNotFound(_0x21dc2d,null))[_0x72ca('0x24')](function(_0x4a3ed0){if(_0x4a3ed0){_0x39f7ee=_0x4a3ed0;_0x5c4167[_0x72ca('0x34')]=_[_0x72ca('0x31')](db[_0x72ca('0x4d')]['rawAttributes']);_0x5c4167[_0x72ca('0x30')]=_['keys'](_0xeeff52['query']);_0x5c4167[_0x72ca('0x32')]=_[_0x72ca('0x33')](_0x5c4167[_0x72ca('0x34')],_0x5c4167[_0x72ca('0x30')]);_0xde1c47['attributes']=_[_0x72ca('0x33')](_0x5c4167[_0x72ca('0x34')],qs['fields'](_0xeeff52['query'][_0x72ca('0x35')]));_0xde1c47[_0x72ca('0x36')]=_0xde1c47[_0x72ca('0x36')]['length']?_0xde1c47[_0x72ca('0x36')]:_0x5c4167[_0x72ca('0x34')];_0xde1c47[_0x72ca('0x39')]=qs['sort'](_0xeeff52[_0x72ca('0x30')][_0x72ca('0x3a')]);_0xde1c47['where']=qs[_0x72ca('0x32')](_[_0x72ca('0x3c')](_0xeeff52[_0x72ca('0x30')],_0x5c4167[_0x72ca('0x32')]));if(_0xeeff52['query']['filter']){_0xde1c47[_0x72ca('0x3b')]=_[_0x72ca('0x3e')](_0xde1c47[_0x72ca('0x3b')],{'$or':_[_0x72ca('0x2a')](_0xde1c47['attributes'],function(_0x780ccc){var _0x1118b6={};_0x1118b6[_0x780ccc]={'$like':'%'+_0xeeff52[_0x72ca('0x30')][_0x72ca('0x3d')]+'%'};return _0x1118b6;})});}_0xde1c47=_[_0x72ca('0x3e')]({},_0xde1c47,_0xeeff52[_0x72ca('0x40')]);return _0x39f7ee[_0x72ca('0x4e')](_0xde1c47);}})['then'](function(_0x3e6858){if(_0x3e6858){_0xc786c9=_0x3e6858['length'];if(!_0xeeff52[_0x72ca('0x30')][_0x72ca('0x37')](_0x72ca('0x38'))){_0xde1c47['limit']=qs[_0x72ca('0x1d')](_0xeeff52[_0x72ca('0x30')][_0x72ca('0x1d')]);_0xde1c47['offset']=qs[_0x72ca('0x1b')](_0xeeff52['query']['offset']);}return _0x39f7ee[_0x72ca('0x4e')](_0xde1c47);}})[_0x72ca('0x24')](function(_0x4eb146){if(_0x4eb146){return _0x4eb146?{'count':_0xc786c9,'rows':_0x4eb146}:null;}})[_0x72ca('0x24')](respondWithResult(_0x21dc2d,null))[_0x72ca('0x43')](handleError(_0x21dc2d,null));};exports[_0x72ca('0x50')]=function(_0x36d635,_0x2d5ea8,_0xe1b933){var _0x422beb={};var _0x1dbe34={};var _0x24b99f;var _0x355a4d;return db[_0x72ca('0x2b')]['findOne']({'where':{'id':_0x36d635[_0x72ca('0x45')]['id']}})[_0x72ca('0x24')](handleEntityNotFound(_0x2d5ea8,null))[_0x72ca('0x24')](function(_0x69722d){if(_0x69722d){_0x24b99f=_0x69722d;_0x1dbe34[_0x72ca('0x34')]=_[_0x72ca('0x31')](db[_0x72ca('0x4d')][_0x72ca('0x2c')]);_0x1dbe34[_0x72ca('0x30')]=_[_0x72ca('0x31')](_0x36d635['query']);_0x1dbe34[_0x72ca('0x32')]=_['intersection'](_0x1dbe34[_0x72ca('0x34')],_0x1dbe34['query']);_0x422beb[_0x72ca('0x36')]=_[_0x72ca('0x33')](_0x1dbe34[_0x72ca('0x34')],qs[_0x72ca('0x35')](_0x36d635['query']['fields']));_0x422beb['attributes']=_0x422beb[_0x72ca('0x36')][_0x72ca('0x46')]?_0x422beb[_0x72ca('0x36')]:_0x1dbe34['model'];_0x422beb['order']=qs[_0x72ca('0x3a')](_0x36d635[_0x72ca('0x30')][_0x72ca('0x3a')]);_0x422beb['where']=qs[_0x72ca('0x32')](_[_0x72ca('0x3c')](_0x36d635[_0x72ca('0x30')],_0x1dbe34[_0x72ca('0x32')]));if(_0x36d635['query']['filter']){_0x422beb[_0x72ca('0x3b')]=_[_0x72ca('0x3e')](_0x422beb[_0x72ca('0x3b')],{'$or':_[_0x72ca('0x2a')](_0x422beb['attributes'],function(_0x39bdc4){var _0x54a057={};_0x54a057[_0x39bdc4]={'$like':'%'+_0x36d635['query']['filter']+'%'};return _0x54a057;})});}_0x422beb=_[_0x72ca('0x3e')]({},_0x422beb,_0x36d635['options']);return _0x24b99f[_0x72ca('0x50')](_0x422beb);}})[_0x72ca('0x24')](function(_0x504891){if(_0x504891){_0x355a4d=_0x504891[_0x72ca('0x46')];if(!_0x36d635[_0x72ca('0x30')][_0x72ca('0x37')](_0x72ca('0x38'))){_0x422beb[_0x72ca('0x1d')]=qs[_0x72ca('0x1d')](_0x36d635[_0x72ca('0x30')][_0x72ca('0x1d')]);_0x422beb[_0x72ca('0x1b')]=qs['offset'](_0x36d635['query'][_0x72ca('0x1b')]);}return _0x24b99f[_0x72ca('0x50')](_0x422beb);}})[_0x72ca('0x24')](function(_0x742f8d){if(_0x742f8d){return _0x742f8d?{'count':_0x355a4d,'rows':_0x742f8d}:null;}})[_0x72ca('0x24')](respondWithResult(_0x2d5ea8,null))[_0x72ca('0x43')](handleError(_0x2d5ea8,null));}; \ No newline at end of file +var _0x5acd=['path','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','options','includeAll','include','rows','catch','show','params','merge','create','body','find','getSubjects','FreshsalesField','nolimit','getDescriptions','getFields','findOne','eml-format','zip-dir','request-promise','bluebird','mustache','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5acd,0x126));var _0xd5ac=function(_0x50883d,_0x52cbb2){_0x50883d=_0x50883d-0x0;var _0x117b35=_0x5acd[_0x50883d];return _0x117b35;};'use strict';var emlformat=require(_0xd5ac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd5ac('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd5ac('0x2'));var moment=require('moment');var BPromise=require(_0xd5ac('0x3'));var Mustache=require(_0xd5ac('0x4'));var util=require(_0xd5ac('0x5'));var path=require(_0xd5ac('0x6'));var sox=require(_0xd5ac('0x7'));var csv=require(_0xd5ac('0x8'));var ejs=require(_0xd5ac('0x9'));var fs=require('fs');var fs_extra=require(_0xd5ac('0xa'));var _=require(_0xd5ac('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd5ac('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd5ac('0x8'));var querystring=require('querystring');var Papa=require(_0xd5ac('0xd'));var Redis=require(_0xd5ac('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd5ac('0xf'));var hardwareService=require(_0xd5ac('0x10'));var logger=require(_0xd5ac('0x11'))('api');var utils=require(_0xd5ac('0x12'));var config=require(_0xd5ac('0x13'));var licenseUtil=require(_0xd5ac('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d79c7,_0x5b31fc){_0x5b31fc=_0x5b31fc||0xcc;return function(_0x22225c){if(_0x22225c){return _0x4d79c7[_0xd5ac('0x15')](_0x5b31fc);}return _0x4d79c7[_0xd5ac('0x16')](_0x5b31fc)[_0xd5ac('0x17')]();};}function respondWithResult(_0x43704e,_0x1ad5ed){_0x1ad5ed=_0x1ad5ed||0xc8;return function(_0x5574a6){if(_0x5574a6){return _0x43704e[_0xd5ac('0x16')](_0x1ad5ed)[_0xd5ac('0x18')](_0x5574a6);}};}function respondWithFilteredResult(_0x5be5b3,_0x381be6){return function(_0x2f01bc){if(_0x2f01bc){var _0x25a711=typeof _0x381be6[_0xd5ac('0x19')]===_0xd5ac('0x1a')&&typeof _0x381be6[_0xd5ac('0x1b')]==='undefined';var _0x35922d=_0x2f01bc[_0xd5ac('0x1c')];var _0x38f8d2=_0x25a711?0x0:_0x381be6[_0xd5ac('0x19')];var _0x5defe3=_0x25a711?_0x2f01bc[_0xd5ac('0x1c')]:_0x381be6['offset']+_0x381be6[_0xd5ac('0x1b')];var _0x9e850;if(_0x5defe3>=_0x35922d){_0x5defe3=_0x35922d;_0x9e850=0xc8;}else{_0x9e850=0xce;}_0x5be5b3[_0xd5ac('0x16')](_0x9e850);return _0x5be5b3['set']('Content-Range',_0x38f8d2+'-'+_0x5defe3+'/'+_0x35922d)[_0xd5ac('0x18')](_0x2f01bc);}return null;};}function patchUpdates(_0x1173c1){return function(_0x4b95c8){try{jsonpatch[_0xd5ac('0x1d')](_0x4b95c8,_0x1173c1,!![]);}catch(_0x2d9a32){return BPromise['reject'](_0x2d9a32);}return _0x4b95c8[_0xd5ac('0x1e')]();};}function saveUpdates(_0x360641,_0x2dcfb5){return function(_0x18a838){if(_0x18a838){return _0x18a838[_0xd5ac('0x1f')](_0x360641)[_0xd5ac('0x20')](function(_0x490ce0){return _0x490ce0;});}return null;};}function removeEntity(_0x33bd46,_0xd50308){return function(_0x3ee89c){if(_0x3ee89c){return _0x3ee89c[_0xd5ac('0x21')]()[_0xd5ac('0x20')](function(){_0x33bd46[_0xd5ac('0x16')](0xcc)[_0xd5ac('0x17')]();});}};}function handleEntityNotFound(_0x54eb52,_0x3942b5){return function(_0x4e78a8){if(!_0x4e78a8){_0x54eb52[_0xd5ac('0x15')](0x194);}return _0x4e78a8;};}function handleError(_0x5bef9e,_0x2e7e6a){_0x2e7e6a=_0x2e7e6a||0x1f4;return function(_0x27db8e){logger['error'](_0x27db8e[_0xd5ac('0x22')]);if(_0x27db8e[_0xd5ac('0x23')]){delete _0x27db8e[_0xd5ac('0x23')];}_0x5bef9e['status'](_0x2e7e6a)[_0xd5ac('0x24')](_0x27db8e);};}exports[_0xd5ac('0x25')]=function(_0x5dabb0,_0x2291ab){var _0x91f4f7={},_0x22e099={},_0x10760c={'count':0x0,'rows':[]};var _0x11c975=_[_0xd5ac('0x26')](db[_0xd5ac('0x27')][_0xd5ac('0x28')],function(_0x28fa6e){return{'name':_0x28fa6e[_0xd5ac('0x29')],'type':_0x28fa6e[_0xd5ac('0x2a')][_0xd5ac('0x2b')]};});_0x22e099[_0xd5ac('0x2c')]=_['map'](_0x11c975,_0xd5ac('0x23'));_0x22e099[_0xd5ac('0x2d')]=_[_0xd5ac('0x2e')](_0x5dabb0[_0xd5ac('0x2d')]);_0x22e099[_0xd5ac('0x2f')]=_[_0xd5ac('0x30')](_0x22e099[_0xd5ac('0x2c')],_0x22e099['query']);_0x91f4f7[_0xd5ac('0x31')]=_[_0xd5ac('0x30')](_0x22e099[_0xd5ac('0x2c')],qs['fields'](_0x5dabb0[_0xd5ac('0x2d')][_0xd5ac('0x32')]));_0x91f4f7[_0xd5ac('0x31')]=_0x91f4f7['attributes'][_0xd5ac('0x33')]?_0x91f4f7[_0xd5ac('0x31')]:_0x22e099[_0xd5ac('0x2c')];if(!_0x5dabb0[_0xd5ac('0x2d')][_0xd5ac('0x34')]('nolimit')){_0x91f4f7[_0xd5ac('0x1b')]=qs[_0xd5ac('0x1b')](_0x5dabb0[_0xd5ac('0x2d')][_0xd5ac('0x1b')]);_0x91f4f7[_0xd5ac('0x19')]=qs[_0xd5ac('0x19')](_0x5dabb0[_0xd5ac('0x2d')][_0xd5ac('0x19')]);}_0x91f4f7[_0xd5ac('0x35')]=qs[_0xd5ac('0x36')](_0x5dabb0[_0xd5ac('0x2d')]['sort']);_0x91f4f7[_0xd5ac('0x37')]=qs[_0xd5ac('0x2f')](_[_0xd5ac('0x38')](_0x5dabb0[_0xd5ac('0x2d')],_0x22e099[_0xd5ac('0x2f')]),_0x11c975);if(_0x5dabb0[_0xd5ac('0x2d')][_0xd5ac('0x39')]){_0x91f4f7['where']=_['merge'](_0x91f4f7[_0xd5ac('0x37')],{'$or':_[_0xd5ac('0x26')](_0x11c975,function(_0xe71514){if(_0xe71514['type']!=='VIRTUAL'){var _0x37fd3e={};_0x37fd3e[_0xe71514[_0xd5ac('0x23')]]={'$like':'%'+_0x5dabb0['query'][_0xd5ac('0x39')]+'%'};return _0x37fd3e;}})});}_0x91f4f7=_['merge']({},_0x91f4f7,_0x5dabb0[_0xd5ac('0x3a')]);var _0x4f6cd3={'where':_0x91f4f7['where']};return db[_0xd5ac('0x27')][_0xd5ac('0x1c')](_0x4f6cd3)[_0xd5ac('0x20')](function(_0x2bd846){_0x10760c['count']=_0x2bd846;if(_0x5dabb0[_0xd5ac('0x2d')][_0xd5ac('0x3b')]){_0x91f4f7[_0xd5ac('0x3c')]=[{'all':!![]}];}return db[_0xd5ac('0x27')]['findAll'](_0x91f4f7);})[_0xd5ac('0x20')](function(_0x518d56){_0x10760c[_0xd5ac('0x3d')]=_0x518d56;return _0x10760c;})['then'](respondWithFilteredResult(_0x2291ab,_0x91f4f7))[_0xd5ac('0x3e')](handleError(_0x2291ab,null));};exports[_0xd5ac('0x3f')]=function(_0x40a118,_0x22b9d8){var _0x32f865={'raw':![],'where':{'id':_0x40a118[_0xd5ac('0x40')]['id']}},_0x446813={};_0x446813[_0xd5ac('0x2c')]=_['keys'](db['FreshsalesConfiguration'][_0xd5ac('0x28')]);_0x446813[_0xd5ac('0x2d')]=_[_0xd5ac('0x2e')](_0x40a118[_0xd5ac('0x2d')]);_0x446813['filters']=_[_0xd5ac('0x30')](_0x446813[_0xd5ac('0x2c')],_0x446813[_0xd5ac('0x2d')]);_0x32f865[_0xd5ac('0x31')]=_[_0xd5ac('0x30')](_0x446813[_0xd5ac('0x2c')],qs[_0xd5ac('0x32')](_0x40a118[_0xd5ac('0x2d')][_0xd5ac('0x32')]));_0x32f865[_0xd5ac('0x31')]=_0x32f865[_0xd5ac('0x31')]['length']?_0x32f865[_0xd5ac('0x31')]:_0x446813[_0xd5ac('0x2c')];if(_0x40a118[_0xd5ac('0x2d')][_0xd5ac('0x3b')]){_0x32f865[_0xd5ac('0x3c')]=[{'all':!![]}];}_0x32f865=_[_0xd5ac('0x41')]({},_0x32f865,_0x40a118[_0xd5ac('0x3a')]);return db[_0xd5ac('0x27')]['find'](_0x32f865)['then'](handleEntityNotFound(_0x22b9d8,null))[_0xd5ac('0x20')](respondWithResult(_0x22b9d8,null))[_0xd5ac('0x3e')](handleError(_0x22b9d8,null));};exports[_0xd5ac('0x42')]=function(_0x2d9bcd,_0x15fe73){return db[_0xd5ac('0x27')][_0xd5ac('0x42')](_0x2d9bcd[_0xd5ac('0x43')],{})['then'](respondWithResult(_0x15fe73,0xc9))[_0xd5ac('0x3e')](handleError(_0x15fe73,null));};exports[_0xd5ac('0x1f')]=function(_0x4fd026,_0x51f626){if(_0x4fd026[_0xd5ac('0x43')]['id']){delete _0x4fd026[_0xd5ac('0x43')]['id'];}return db[_0xd5ac('0x27')]['find']({'where':{'id':_0x4fd026['params']['id']}})['then'](handleEntityNotFound(_0x51f626,null))[_0xd5ac('0x20')](saveUpdates(_0x4fd026['body'],null))[_0xd5ac('0x20')](respondWithResult(_0x51f626,null))[_0xd5ac('0x3e')](handleError(_0x51f626,null));};exports[_0xd5ac('0x21')]=function(_0x2ac777,_0x43f060){return db['FreshsalesConfiguration'][_0xd5ac('0x44')]({'where':{'id':_0x2ac777[_0xd5ac('0x40')]['id']}})[_0xd5ac('0x20')](handleEntityNotFound(_0x43f060,null))[_0xd5ac('0x20')](removeEntity(_0x43f060,null))[_0xd5ac('0x3e')](handleError(_0x43f060,null));};exports[_0xd5ac('0x45')]=function(_0x4e7597,_0x16801a,_0x3393a7){var _0x5b9a66={};var _0x12256e={};var _0x227a9d;var _0x316aa0;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x4e7597['params']['id']}})['then'](handleEntityNotFound(_0x16801a,null))[_0xd5ac('0x20')](function(_0x155c38){if(_0x155c38){_0x227a9d=_0x155c38;_0x12256e['model']=_[_0xd5ac('0x2e')](db[_0xd5ac('0x46')][_0xd5ac('0x28')]);_0x12256e[_0xd5ac('0x2d')]=_['keys'](_0x4e7597[_0xd5ac('0x2d')]);_0x12256e['filters']=_['intersection'](_0x12256e[_0xd5ac('0x2c')],_0x12256e['query']);_0x5b9a66[_0xd5ac('0x31')]=_[_0xd5ac('0x30')](_0x12256e['model'],qs[_0xd5ac('0x32')](_0x4e7597[_0xd5ac('0x2d')][_0xd5ac('0x32')]));_0x5b9a66[_0xd5ac('0x31')]=_0x5b9a66[_0xd5ac('0x31')]['length']?_0x5b9a66[_0xd5ac('0x31')]:_0x12256e[_0xd5ac('0x2c')];_0x5b9a66['order']=qs[_0xd5ac('0x36')](_0x4e7597[_0xd5ac('0x2d')][_0xd5ac('0x36')]);_0x5b9a66['where']=qs[_0xd5ac('0x2f')](_[_0xd5ac('0x38')](_0x4e7597[_0xd5ac('0x2d')],_0x12256e[_0xd5ac('0x2f')]));if(_0x4e7597[_0xd5ac('0x2d')]['filter']){_0x5b9a66[_0xd5ac('0x37')]=_[_0xd5ac('0x41')](_0x5b9a66[_0xd5ac('0x37')],{'$or':_[_0xd5ac('0x26')](_0x5b9a66['attributes'],function(_0x34035b){var _0x1d92f3={};_0x1d92f3[_0x34035b]={'$like':'%'+_0x4e7597['query']['filter']+'%'};return _0x1d92f3;})});}_0x5b9a66=_[_0xd5ac('0x41')]({},_0x5b9a66,_0x4e7597[_0xd5ac('0x3a')]);return _0x227a9d[_0xd5ac('0x45')](_0x5b9a66);}})[_0xd5ac('0x20')](function(_0x5325ba){if(_0x5325ba){_0x316aa0=_0x5325ba[_0xd5ac('0x33')];if(!_0x4e7597[_0xd5ac('0x2d')][_0xd5ac('0x34')](_0xd5ac('0x47'))){_0x5b9a66[_0xd5ac('0x1b')]=qs[_0xd5ac('0x1b')](_0x4e7597[_0xd5ac('0x2d')][_0xd5ac('0x1b')]);_0x5b9a66[_0xd5ac('0x19')]=qs['offset'](_0x4e7597[_0xd5ac('0x2d')][_0xd5ac('0x19')]);}return _0x227a9d['getSubjects'](_0x5b9a66);}})[_0xd5ac('0x20')](function(_0x192210){if(_0x192210){return _0x192210?{'count':_0x316aa0,'rows':_0x192210}:null;}})[_0xd5ac('0x20')](respondWithResult(_0x16801a,null))[_0xd5ac('0x3e')](handleError(_0x16801a,null));};exports['getDescriptions']=function(_0x45b6ed,_0x5854f7,_0x2a6607){var _0x5de04f={};var _0x49f4ee={};var _0x2f8fe3;var _0x583417;return db[_0xd5ac('0x27')]['findOne']({'where':{'id':_0x45b6ed[_0xd5ac('0x40')]['id']}})['then'](handleEntityNotFound(_0x5854f7,null))[_0xd5ac('0x20')](function(_0x599269){if(_0x599269){_0x2f8fe3=_0x599269;_0x49f4ee['model']=_[_0xd5ac('0x2e')](db[_0xd5ac('0x46')][_0xd5ac('0x28')]);_0x49f4ee[_0xd5ac('0x2d')]=_[_0xd5ac('0x2e')](_0x45b6ed[_0xd5ac('0x2d')]);_0x49f4ee['filters']=_[_0xd5ac('0x30')](_0x49f4ee[_0xd5ac('0x2c')],_0x49f4ee['query']);_0x5de04f['attributes']=_[_0xd5ac('0x30')](_0x49f4ee[_0xd5ac('0x2c')],qs['fields'](_0x45b6ed[_0xd5ac('0x2d')][_0xd5ac('0x32')]));_0x5de04f[_0xd5ac('0x31')]=_0x5de04f[_0xd5ac('0x31')][_0xd5ac('0x33')]?_0x5de04f['attributes']:_0x49f4ee[_0xd5ac('0x2c')];_0x5de04f[_0xd5ac('0x35')]=qs[_0xd5ac('0x36')](_0x45b6ed[_0xd5ac('0x2d')][_0xd5ac('0x36')]);_0x5de04f[_0xd5ac('0x37')]=qs[_0xd5ac('0x2f')](_[_0xd5ac('0x38')](_0x45b6ed[_0xd5ac('0x2d')],_0x49f4ee[_0xd5ac('0x2f')]));if(_0x45b6ed[_0xd5ac('0x2d')]['filter']){_0x5de04f[_0xd5ac('0x37')]=_['merge'](_0x5de04f[_0xd5ac('0x37')],{'$or':_[_0xd5ac('0x26')](_0x5de04f['attributes'],function(_0x2f464e){var _0xaaf34d={};_0xaaf34d[_0x2f464e]={'$like':'%'+_0x45b6ed[_0xd5ac('0x2d')][_0xd5ac('0x39')]+'%'};return _0xaaf34d;})});}_0x5de04f=_[_0xd5ac('0x41')]({},_0x5de04f,_0x45b6ed[_0xd5ac('0x3a')]);return _0x2f8fe3[_0xd5ac('0x48')](_0x5de04f);}})[_0xd5ac('0x20')](function(_0x2fac00){if(_0x2fac00){_0x583417=_0x2fac00[_0xd5ac('0x33')];if(!_0x45b6ed['query']['hasOwnProperty']('nolimit')){_0x5de04f[_0xd5ac('0x1b')]=qs[_0xd5ac('0x1b')](_0x45b6ed[_0xd5ac('0x2d')][_0xd5ac('0x1b')]);_0x5de04f[_0xd5ac('0x19')]=qs['offset'](_0x45b6ed[_0xd5ac('0x2d')][_0xd5ac('0x19')]);}return _0x2f8fe3[_0xd5ac('0x48')](_0x5de04f);}})[_0xd5ac('0x20')](function(_0x475b0a){if(_0x475b0a){return _0x475b0a?{'count':_0x583417,'rows':_0x475b0a}:null;}})[_0xd5ac('0x20')](respondWithResult(_0x5854f7,null))['catch'](handleError(_0x5854f7,null));};exports[_0xd5ac('0x49')]=function(_0x6e954a,_0x232b54,_0x5a4f6d){var _0x367a13={};var _0x2027fb={};var _0x68e8d5;var _0x3d9d6d;return db[_0xd5ac('0x27')][_0xd5ac('0x4a')]({'where':{'id':_0x6e954a[_0xd5ac('0x40')]['id']}})[_0xd5ac('0x20')](handleEntityNotFound(_0x232b54,null))[_0xd5ac('0x20')](function(_0x2aaf2f){if(_0x2aaf2f){_0x68e8d5=_0x2aaf2f;_0x2027fb[_0xd5ac('0x2c')]=_[_0xd5ac('0x2e')](db[_0xd5ac('0x46')]['rawAttributes']);_0x2027fb[_0xd5ac('0x2d')]=_[_0xd5ac('0x2e')](_0x6e954a[_0xd5ac('0x2d')]);_0x2027fb[_0xd5ac('0x2f')]=_[_0xd5ac('0x30')](_0x2027fb[_0xd5ac('0x2c')],_0x2027fb[_0xd5ac('0x2d')]);_0x367a13[_0xd5ac('0x31')]=_[_0xd5ac('0x30')](_0x2027fb[_0xd5ac('0x2c')],qs['fields'](_0x6e954a[_0xd5ac('0x2d')][_0xd5ac('0x32')]));_0x367a13[_0xd5ac('0x31')]=_0x367a13[_0xd5ac('0x31')][_0xd5ac('0x33')]?_0x367a13[_0xd5ac('0x31')]:_0x2027fb[_0xd5ac('0x2c')];_0x367a13['order']=qs[_0xd5ac('0x36')](_0x6e954a[_0xd5ac('0x2d')][_0xd5ac('0x36')]);_0x367a13['where']=qs[_0xd5ac('0x2f')](_[_0xd5ac('0x38')](_0x6e954a['query'],_0x2027fb[_0xd5ac('0x2f')]));if(_0x6e954a[_0xd5ac('0x2d')][_0xd5ac('0x39')]){_0x367a13[_0xd5ac('0x37')]=_[_0xd5ac('0x41')](_0x367a13['where'],{'$or':_['map'](_0x367a13[_0xd5ac('0x31')],function(_0xc5abd1){var _0x4d6d32={};_0x4d6d32[_0xc5abd1]={'$like':'%'+_0x6e954a[_0xd5ac('0x2d')][_0xd5ac('0x39')]+'%'};return _0x4d6d32;})});}_0x367a13=_[_0xd5ac('0x41')]({},_0x367a13,_0x6e954a[_0xd5ac('0x3a')]);return _0x68e8d5[_0xd5ac('0x49')](_0x367a13);}})['then'](function(_0x1ad0cb){if(_0x1ad0cb){_0x3d9d6d=_0x1ad0cb[_0xd5ac('0x33')];if(!_0x6e954a[_0xd5ac('0x2d')][_0xd5ac('0x34')](_0xd5ac('0x47'))){_0x367a13['limit']=qs[_0xd5ac('0x1b')](_0x6e954a[_0xd5ac('0x2d')][_0xd5ac('0x1b')]);_0x367a13[_0xd5ac('0x19')]=qs[_0xd5ac('0x19')](_0x6e954a[_0xd5ac('0x2d')]['offset']);}return _0x68e8d5[_0xd5ac('0x49')](_0x367a13);}})[_0xd5ac('0x20')](function(_0xa89480){if(_0xa89480){return _0xa89480?{'count':_0x3d9d6d,'rows':_0xa89480}:null;}})[_0xd5ac('0x20')](respondWithResult(_0x232b54,null))[_0xd5ac('0x3e')](handleError(_0x232b54,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 461f864..a4a3892 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 _0x3ae8=['define','FreshsalesConfiguration','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x179c0b,_0x447d77){var _0x435b53=function(_0x4a93a0){while(--_0x4a93a0){_0x179c0b['push'](_0x179c0b['shift']());}};_0x435b53(++_0x447d77);}(_0x3ae8,0x1ca));var _0x83ae=function(_0x615441,_0x3f7f3f){_0x615441=_0x615441-0x0;var _0x174a63=_0x3ae8[_0x615441];return _0x174a63;};'use strict';var _=require(_0x83ae('0x0'));var util=require('util');var logger=require(_0x83ae('0x1'))(_0x83ae('0x2'));var moment=require(_0x83ae('0x3'));var BPromise=require(_0x83ae('0x4'));var rp=require(_0x83ae('0x5'));var fs=require('fs');var path=require(_0x83ae('0x6'));var rimraf=require(_0x83ae('0x7'));var config=require(_0x83ae('0x8'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x83ae('0x9')]=function(_0x2bcebc,_0x3aa98c){return _0x2bcebc[_0x83ae('0xa')](_0x83ae('0xb'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81e2=['int_freshsales_configurations','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration'];(function(_0x3d4799,_0x60e496){var _0x1b744c=function(_0x2bb813){while(--_0x2bb813){_0x3d4799['push'](_0x3d4799['shift']());}};_0x1b744c(++_0x60e496);}(_0x81e2,0xc1));var _0x281e=function(_0x177f6d,_0x3d3901){_0x177f6d=_0x177f6d-0x0;var _0x1c151b=_0x81e2[_0x177f6d];return _0x1c151b;};'use strict';var _=require(_0x281e('0x0'));var util=require('util');var logger=require(_0x281e('0x1'))(_0x281e('0x2'));var moment=require(_0x281e('0x3'));var BPromise=require('bluebird');var rp=require(_0x281e('0x4'));var fs=require('fs');var path=require(_0x281e('0x5'));var rimraf=require('rimraf');var config=require(_0x281e('0x6'));var attributes=require(_0x281e('0x7'));module[_0x281e('0x8')]=function(_0x369994,_0x4b5427){return _0x369994[_0x281e('0x9')](_0x281e('0xa'),attributes,{'tableName':_0x281e('0xb'),'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 0ec33b8..665add6 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 _0x44e3=['moment','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util'];(function(_0x5f1fcd,_0x44afdb){var _0x2ca1cc=function(_0x3ca5b){while(--_0x3ca5b){_0x5f1fcd['push'](_0x5f1fcd['shift']());}};_0x2ca1cc(++_0x44afdb);}(_0x44e3,0x1de));var _0x344e=function(_0x1b0143,_0x5c6a30){_0x1b0143=_0x1b0143-0x0;var _0x1799ca=_0x44e3[_0x1b0143];return _0x1799ca;};'use strict';var _=require(_0x344e('0x0'));var util=require(_0x344e('0x1'));var moment=require(_0x344e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x344e('0x3'));var logger=require('../../config/logger')(_0x344e('0x4'));var config=require(_0x344e('0x5'));var jayson=require(_0x344e('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33d61e,_0x239c00,_0x14f245){return new BPromise(function(_0xc4384b,_0x583407){return client['request'](_0x33d61e,_0x14f245)[_0x344e('0x7')](function(_0x521241){logger[_0x344e('0x8')](_0x344e('0x9'),_0x239c00,_0x344e('0xa'));logger['debug'](_0x344e('0xb'),_0x239c00,_0x344e('0xa'),JSON[_0x344e('0xc')](_0x521241));if(_0x521241[_0x344e('0xd')]){if(_0x521241[_0x344e('0xd')]['code']===0x1f4){logger[_0x344e('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x239c00,_0x521241[_0x344e('0xd')][_0x344e('0xe')]);return _0x583407(_0x521241[_0x344e('0xd')]['message']);}logger[_0x344e('0xd')](_0x344e('0x9'),_0x239c00,_0x521241[_0x344e('0xd')]['message']);return _0xc4384b(_0x521241[_0x344e('0xd')][_0x344e('0xe')]);}else{logger[_0x344e('0x8')](_0x344e('0x9'),_0x239c00,_0x344e('0xa'));_0xc4384b(_0x521241['result'][_0x344e('0xe')]);}})[_0x344e('0xf')](function(_0x3f4364){logger[_0x344e('0xd')](_0x344e('0x9'),_0x239c00,_0x3f4364);_0x583407(_0x3f4364);});});} \ No newline at end of file +var _0x0b09=['then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x257a28,_0x2cd00d){var _0x13bccc=function(_0x32c46f){while(--_0x32c46f){_0x257a28['push'](_0x257a28['shift']());}};_0x13bccc(++_0x2cd00d);}(_0x0b09,0x127));var _0x90b0=function(_0x185c79,_0x3db22c){_0x185c79=_0x185c79-0x0;var _0x49e7db=_0x0b09[_0x185c79];return _0x49e7db;};'use strict';var _=require(_0x90b0('0x0'));var util=require(_0x90b0('0x1'));var moment=require('moment');var BPromise=require(_0x90b0('0x2'));var rs=require(_0x90b0('0x3'));var fs=require('fs');var Redis=require(_0x90b0('0x4'));var db=require(_0x90b0('0x5'))['db'];var utils=require(_0x90b0('0x6'));var logger=require(_0x90b0('0x7'))(_0x90b0('0x8'));var config=require(_0x90b0('0x9'));var jayson=require(_0x90b0('0xa'));var client=jayson['client'][_0x90b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56e22b,_0x106ba8,_0x58d926){return new BPromise(function(_0x1a5f2c,_0x33ad0b){return client[_0x90b0('0xc')](_0x56e22b,_0x58d926)[_0x90b0('0xd')](function(_0x2f0caf){logger[_0x90b0('0xe')](_0x90b0('0xf'),_0x106ba8,_0x90b0('0x10'));logger['debug'](_0x90b0('0x11'),_0x106ba8,_0x90b0('0x10'),JSON[_0x90b0('0x12')](_0x2f0caf));if(_0x2f0caf[_0x90b0('0x13')]){if(_0x2f0caf[_0x90b0('0x13')]['code']===0x1f4){logger['error'](_0x90b0('0xf'),_0x106ba8,_0x2f0caf[_0x90b0('0x13')][_0x90b0('0x14')]);return _0x33ad0b(_0x2f0caf[_0x90b0('0x13')][_0x90b0('0x14')]);}logger[_0x90b0('0x13')](_0x90b0('0xf'),_0x106ba8,_0x2f0caf[_0x90b0('0x13')][_0x90b0('0x14')]);return _0x1a5f2c(_0x2f0caf[_0x90b0('0x13')][_0x90b0('0x14')]);}else{logger[_0x90b0('0xe')](_0x90b0('0xf'),_0x106ba8,_0x90b0('0x10'));_0x1a5f2c(_0x2f0caf[_0x90b0('0x15')]['message']);}})['catch'](function(_0x45f0be){logger[_0x90b0('0x13')](_0x90b0('0xf'),_0x106ba8,_0x45f0be);_0x33ad0b(_0x45f0be);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 582ba7e..750d79e 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 _0xa4de=['index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated'];(function(_0x665319,_0x3b1616){var _0x28a10a=function(_0x320129){while(--_0x320129){_0x665319['push'](_0x665319['shift']());}};_0x28a10a(++_0x3b1616);}(_0xa4de,0x10d));var _0xea4d=function(_0x196e82,_0x4d0f66){_0x196e82=_0x196e82-0x0;var _0x4439a8=_0xa4de[_0x196e82];return _0x4439a8;};'use strict';var multer=require(_0xea4d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xea4d('0x1'));var express=require(_0xea4d('0x2'));var router=express[_0xea4d('0x3')]();var fs_extra=require(_0xea4d('0x4'));var auth=require(_0xea4d('0x5'));var interaction=require(_0xea4d('0x6'));var config=require(_0xea4d('0x7'));var controller=require(_0xea4d('0x8'));router[_0xea4d('0x9')]('/',auth[_0xea4d('0xa')](),controller[_0xea4d('0xb')]);router[_0xea4d('0x9')]('/:id',auth[_0xea4d('0xa')](),controller['show']);router[_0xea4d('0xc')]('/',auth[_0xea4d('0xa')](),controller[_0xea4d('0xd')]);router[_0xea4d('0xe')](_0xea4d('0xf'),auth[_0xea4d('0xa')](),controller[_0xea4d('0x10')]);router[_0xea4d('0x11')](_0xea4d('0xf'),auth[_0xea4d('0xa')](),controller[_0xea4d('0x12')]);module[_0xea4d('0x13')]=router; \ No newline at end of file +var _0x2621=['/:id','show','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index'];(function(_0x25ff14,_0x384501){var _0x1eef4d=function(_0x6df658){while(--_0x6df658){_0x25ff14['push'](_0x25ff14['shift']());}};_0x1eef4d(++_0x384501);}(_0x2621,0x1d2));var _0x1262=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2621[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1262('0x0'));var util=require(_0x1262('0x1'));var path=require(_0x1262('0x2'));var timeout=require(_0x1262('0x3'));var express=require(_0x1262('0x4'));var router=express[_0x1262('0x5')]();var fs_extra=require(_0x1262('0x6'));var auth=require(_0x1262('0x7'));var interaction=require(_0x1262('0x8'));var config=require(_0x1262('0x9'));var controller=require(_0x1262('0xa'));router[_0x1262('0xb')]('/',auth[_0x1262('0xc')](),controller[_0x1262('0xd')]);router['get'](_0x1262('0xe'),auth['isAuthenticated'](),controller[_0x1262('0xf')]);router['post']('/',auth[_0x1262('0xc')](),controller[_0x1262('0x10')]);router[_0x1262('0x11')]('/:id',auth[_0x1262('0xc')](),controller['update']);router[_0x1262('0x12')](_0x1262('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x1262('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 5c30d5c..9db32e2 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 _0x8d26=['picklist','string','STRING','ENUM','sequelize','exports','variable','customVariable','keyValue'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0x8d26,0x136));var _0x68d2=function(_0x151ed4,_0x23cfb8){_0x151ed4=_0x151ed4-0x0;var _0x1c6f7e=_0x8d26[_0x151ed4];return _0x1c6f7e;};'use strict';var Sequelize=require(_0x68d2('0x0'));module[_0x68d2('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x68d2('0x2'),_0x68d2('0x3'),_0x68d2('0x4'),_0x68d2('0x5')),'defaultValue':_0x68d2('0x6')},'content':{'type':Sequelize[_0x68d2('0x7')]},'key':{'type':Sequelize[_0x68d2('0x7')]},'keyType':{'type':Sequelize[_0x68d2('0x8')](_0x68d2('0x6'),'variable',_0x68d2('0x3'))},'keyContent':{'type':Sequelize[_0x68d2('0x7')]},'idField':{'type':Sequelize[_0x68d2('0x7')]},'nameField':{'type':Sequelize[_0x68d2('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa88b=['STRING','ENUM','customVariable','BOOLEAN','sequelize','string','variable','keyValue'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa88b,0x1bc));var _0xba88=function(_0x5f1cf8,_0x5e0923){_0x5f1cf8=_0x5f1cf8-0x0;var _0x27d0fa=_0xa88b[_0x5f1cf8];return _0x27d0fa;};'use strict';var Sequelize=require(_0xba88('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xba88('0x1'),_0xba88('0x2'),'customVariable',_0xba88('0x3'),'picklist'),'defaultValue':_0xba88('0x1')},'content':{'type':Sequelize[_0xba88('0x4')]},'key':{'type':Sequelize[_0xba88('0x4')]},'keyType':{'type':Sequelize[_0xba88('0x5')]('string',_0xba88('0x2'),_0xba88('0x6'))},'keyContent':{'type':Sequelize[_0xba88('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xba88('0x4')]},'customField':{'type':Sequelize[_0xba88('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xba88('0x4')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index f2f807f..8cde9fd 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 _0xda65=['save','update','then','destroy','stack','name','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','rows','catch','show','length','includeAll','include','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply'];(function(_0x559c4e,_0x30c1d2){var _0x1dad60=function(_0x452727){while(--_0x452727){_0x559c4e['push'](_0x559c4e['shift']());}};_0x1dad60(++_0x30c1d2);}(_0xda65,0x1a0));var _0x5da6=function(_0x1cce38,_0x37badb){_0x1cce38=_0x1cce38-0x0;var _0x46305b=_0xda65[_0x1cce38];return _0x46305b;};'use strict';var emlformat=require(_0x5da6('0x0'));var rimraf=require(_0x5da6('0x1'));var zipdir=require(_0x5da6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5da6('0x3'));var moment=require(_0x5da6('0x4'));var BPromise=require(_0x5da6('0x5'));var Mustache=require(_0x5da6('0x6'));var util=require('util');var path=require(_0x5da6('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5da6('0x8'));var fs=require('fs');var fs_extra=require(_0x5da6('0x9'));var _=require('lodash');var squel=require(_0x5da6('0xa'));var crypto=require(_0x5da6('0xb'));var jsforce=require(_0x5da6('0xc'));var deskjs=require(_0x5da6('0xd'));var toCsv=require(_0x5da6('0xe'));var querystring=require('querystring');var Papa=require(_0x5da6('0xf'));var Redis=require(_0x5da6('0x10'));var authService=require(_0x5da6('0x11'));var qs=require(_0x5da6('0x12'));var as=require(_0x5da6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5da6('0x14'));var utils=require(_0x5da6('0x15'));var config=require(_0x5da6('0x16'));var licenseUtil=require(_0x5da6('0x17'));var db=require(_0x5da6('0x18'))['db'];function respondWithStatusCode(_0x5f32e0,_0x380ed2){_0x380ed2=_0x380ed2||0xcc;return function(_0x6e4663){if(_0x6e4663){return _0x5f32e0[_0x5da6('0x19')](_0x380ed2);}return _0x5f32e0[_0x5da6('0x1a')](_0x380ed2)[_0x5da6('0x1b')]();};}function respondWithResult(_0x23ab73,_0x47a2f8){_0x47a2f8=_0x47a2f8||0xc8;return function(_0x1cfe87){if(_0x1cfe87){return _0x23ab73['status'](_0x47a2f8)[_0x5da6('0x1c')](_0x1cfe87);}};}function respondWithFilteredResult(_0x31ccc,_0x113e15){return function(_0x4d03b6){if(_0x4d03b6){var _0x431663=typeof _0x113e15[_0x5da6('0x1d')]==='undefined'&&typeof _0x113e15['limit']===_0x5da6('0x1e');var _0x2d147d=_0x4d03b6[_0x5da6('0x1f')];var _0x12c7fb=_0x431663?0x0:_0x113e15[_0x5da6('0x1d')];var _0x44addc=_0x431663?_0x4d03b6[_0x5da6('0x1f')]:_0x113e15[_0x5da6('0x1d')]+_0x113e15['limit'];var _0x3789b9;if(_0x44addc>=_0x2d147d){_0x44addc=_0x2d147d;_0x3789b9=0xc8;}else{_0x3789b9=0xce;}_0x31ccc[_0x5da6('0x1a')](_0x3789b9);return _0x31ccc['set'](_0x5da6('0x20'),_0x12c7fb+'-'+_0x44addc+'/'+_0x2d147d)[_0x5da6('0x1c')](_0x4d03b6);}return null;};}function patchUpdates(_0x543c85){return function(_0x4c6272){try{jsonpatch[_0x5da6('0x21')](_0x4c6272,_0x543c85,!![]);}catch(_0x64b9d9){return BPromise['reject'](_0x64b9d9);}return _0x4c6272[_0x5da6('0x22')]();};}function saveUpdates(_0x37f7c1,_0x3b9f53){return function(_0x2f2edc){if(_0x2f2edc){return _0x2f2edc[_0x5da6('0x23')](_0x37f7c1)[_0x5da6('0x24')](function(_0x572de3){return _0x572de3;});}return null;};}function removeEntity(_0x30f255,_0x175333){return function(_0x31546a){if(_0x31546a){return _0x31546a[_0x5da6('0x25')]()[_0x5da6('0x24')](function(){_0x30f255['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x387435,_0x58c0df){return function(_0x125494){if(!_0x125494){_0x387435[_0x5da6('0x19')](0x194);}return _0x125494;};}function handleError(_0x43e00f,_0x77a867){_0x77a867=_0x77a867||0x1f4;return function(_0xae4715){logger['error'](_0xae4715[_0x5da6('0x26')]);if(_0xae4715['name']){delete _0xae4715[_0x5da6('0x27')];}_0x43e00f[_0x5da6('0x1a')](_0x77a867)['send'](_0xae4715);};}exports[_0x5da6('0x28')]=function(_0x15f166,_0x3041f9){var _0x30d9ac={},_0x385faf={},_0x26bfb3={'count':0x0,'rows':[]};var _0x39b542=_[_0x5da6('0x29')](db[_0x5da6('0x2a')][_0x5da6('0x2b')],function(_0x28f598){return{'name':_0x28f598[_0x5da6('0x2c')],'type':_0x28f598[_0x5da6('0x2d')][_0x5da6('0x2e')]};});_0x385faf[_0x5da6('0x2f')]=_[_0x5da6('0x29')](_0x39b542,'name');_0x385faf[_0x5da6('0x30')]=_[_0x5da6('0x31')](_0x15f166['query']);_0x385faf[_0x5da6('0x32')]=_[_0x5da6('0x33')](_0x385faf[_0x5da6('0x2f')],_0x385faf[_0x5da6('0x30')]);_0x30d9ac[_0x5da6('0x34')]=_[_0x5da6('0x33')](_0x385faf[_0x5da6('0x2f')],qs[_0x5da6('0x35')](_0x15f166['query'][_0x5da6('0x35')]));_0x30d9ac[_0x5da6('0x34')]=_0x30d9ac[_0x5da6('0x34')]['length']?_0x30d9ac[_0x5da6('0x34')]:_0x385faf[_0x5da6('0x2f')];if(!_0x15f166[_0x5da6('0x30')][_0x5da6('0x36')](_0x5da6('0x37'))){_0x30d9ac[_0x5da6('0x38')]=qs[_0x5da6('0x38')](_0x15f166[_0x5da6('0x30')][_0x5da6('0x38')]);_0x30d9ac[_0x5da6('0x1d')]=qs[_0x5da6('0x1d')](_0x15f166[_0x5da6('0x30')][_0x5da6('0x1d')]);}_0x30d9ac[_0x5da6('0x39')]=qs[_0x5da6('0x3a')](_0x15f166[_0x5da6('0x30')][_0x5da6('0x3a')]);_0x30d9ac[_0x5da6('0x3b')]=qs[_0x5da6('0x32')](_[_0x5da6('0x3c')](_0x15f166[_0x5da6('0x30')],_0x385faf[_0x5da6('0x32')]),_0x39b542);if(_0x15f166[_0x5da6('0x30')][_0x5da6('0x3d')]){_0x30d9ac['where']=_['merge'](_0x30d9ac['where'],{'$or':_['map'](_0x39b542,function(_0x1a020c){if(_0x1a020c[_0x5da6('0x2d')]!==_0x5da6('0x3e')){var _0x2758d3={};_0x2758d3[_0x1a020c['name']]={'$like':'%'+_0x15f166[_0x5da6('0x30')][_0x5da6('0x3d')]+'%'};return _0x2758d3;}})});}_0x30d9ac=_[_0x5da6('0x3f')]({},_0x30d9ac,_0x15f166[_0x5da6('0x40')]);var _0x501725={'where':_0x30d9ac['where']};return db[_0x5da6('0x2a')][_0x5da6('0x1f')](_0x501725)[_0x5da6('0x24')](function(_0x2cffd2){_0x26bfb3['count']=_0x2cffd2;if(_0x15f166[_0x5da6('0x30')]['includeAll']){_0x30d9ac['include']=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x30d9ac);})['then'](function(_0x15ccf7){_0x26bfb3[_0x5da6('0x41')]=_0x15ccf7;return _0x26bfb3;})[_0x5da6('0x24')](respondWithFilteredResult(_0x3041f9,_0x30d9ac))[_0x5da6('0x42')](handleError(_0x3041f9,null));};exports[_0x5da6('0x43')]=function(_0xdd0cf8,_0x106383){var _0x5d6199={'raw':!![],'where':{'id':_0xdd0cf8['params']['id']}},_0x2130e5={};_0x2130e5[_0x5da6('0x2f')]=_[_0x5da6('0x31')](db[_0x5da6('0x2a')][_0x5da6('0x2b')]);_0x2130e5[_0x5da6('0x30')]=_[_0x5da6('0x31')](_0xdd0cf8[_0x5da6('0x30')]);_0x2130e5[_0x5da6('0x32')]=_[_0x5da6('0x33')](_0x2130e5[_0x5da6('0x2f')],_0x2130e5[_0x5da6('0x30')]);_0x5d6199[_0x5da6('0x34')]=_[_0x5da6('0x33')](_0x2130e5[_0x5da6('0x2f')],qs[_0x5da6('0x35')](_0xdd0cf8[_0x5da6('0x30')][_0x5da6('0x35')]));_0x5d6199[_0x5da6('0x34')]=_0x5d6199[_0x5da6('0x34')][_0x5da6('0x44')]?_0x5d6199['attributes']:_0x2130e5[_0x5da6('0x2f')];if(_0xdd0cf8[_0x5da6('0x30')][_0x5da6('0x45')]){_0x5d6199[_0x5da6('0x46')]=[{'all':!![]}];}_0x5d6199=_[_0x5da6('0x3f')]({},_0x5d6199,_0xdd0cf8['options']);return db['FreshsalesField'][_0x5da6('0x47')](_0x5d6199)['then'](handleEntityNotFound(_0x106383,null))[_0x5da6('0x24')](respondWithResult(_0x106383,null))[_0x5da6('0x42')](handleError(_0x106383,null));};exports[_0x5da6('0x48')]=function(_0x37cccb,_0x47ea28){return db[_0x5da6('0x2a')]['create'](_0x37cccb[_0x5da6('0x49')],{})[_0x5da6('0x24')](respondWithResult(_0x47ea28,0xc9))['catch'](handleError(_0x47ea28,null));};exports[_0x5da6('0x23')]=function(_0x3626d4,_0x42a461){if(_0x3626d4['body']['id']){delete _0x3626d4[_0x5da6('0x49')]['id'];}return db[_0x5da6('0x2a')]['find']({'where':{'id':_0x3626d4[_0x5da6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x42a461,null))[_0x5da6('0x24')](saveUpdates(_0x3626d4['body'],null))[_0x5da6('0x24')](respondWithResult(_0x42a461,null))[_0x5da6('0x42')](handleError(_0x42a461,null));};exports[_0x5da6('0x25')]=function(_0x47f9fc,_0x52da04){return db[_0x5da6('0x2a')]['find']({'where':{'id':_0x47f9fc[_0x5da6('0x4a')]['id']}})[_0x5da6('0x24')](handleEntityNotFound(_0x52da04,null))[_0x5da6('0x24')](removeEntity(_0x52da04,null))[_0x5da6('0x42')](handleError(_0x52da04,null));}; \ No newline at end of file +var _0xb7f1=['count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','type','merge','options','FreshsalesField','includeAll','include','findAll','rows','catch','params','length','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset'];(function(_0x491682,_0x38227f){var _0xae8b96=function(_0x3a89ef){while(--_0x3a89ef){_0x491682['push'](_0x491682['shift']());}};_0xae8b96(++_0x38227f);}(_0xb7f1,0x76));var _0x1b7f=function(_0x612853,_0x4c0b99){_0x612853=_0x612853-0x0;var _0x3f86bd=_0xb7f1[_0x612853];return _0x3f86bd;};'use strict';var emlformat=require(_0x1b7f('0x0'));var rimraf=require(_0x1b7f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1b7f('0x2'));var moment=require(_0x1b7f('0x3'));var BPromise=require(_0x1b7f('0x4'));var Mustache=require(_0x1b7f('0x5'));var util=require(_0x1b7f('0x6'));var path=require(_0x1b7f('0x7'));var sox=require(_0x1b7f('0x8'));var csv=require(_0x1b7f('0x9'));var ejs=require(_0x1b7f('0xa'));var fs=require('fs');var fs_extra=require(_0x1b7f('0xb'));var _=require(_0x1b7f('0xc'));var squel=require(_0x1b7f('0xd'));var crypto=require('crypto');var jsforce=require(_0x1b7f('0xe'));var deskjs=require(_0x1b7f('0xf'));var toCsv=require(_0x1b7f('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1b7f('0x10'));var authService=require(_0x1b7f('0x11'));var qs=require(_0x1b7f('0x12'));var as=require(_0x1b7f('0x13'));var hardwareService=require(_0x1b7f('0x14'));var logger=require('../../config/logger')(_0x1b7f('0x15'));var utils=require('../../config/utils');var config=require(_0x1b7f('0x16'));var licenseUtil=require(_0x1b7f('0x17'));var db=require(_0x1b7f('0x18'))['db'];function respondWithStatusCode(_0x330089,_0x185cb2){_0x185cb2=_0x185cb2||0xcc;return function(_0x3017a9){if(_0x3017a9){return _0x330089['sendStatus'](_0x185cb2);}return _0x330089[_0x1b7f('0x19')](_0x185cb2)[_0x1b7f('0x1a')]();};}function respondWithResult(_0x35fdbf,_0xb47869){_0xb47869=_0xb47869||0xc8;return function(_0x498b2d){if(_0x498b2d){return _0x35fdbf['status'](_0xb47869)[_0x1b7f('0x1b')](_0x498b2d);}};}function respondWithFilteredResult(_0x3953a5,_0x2f32b9){return function(_0x55a411){if(_0x55a411){var _0x578b22=typeof _0x2f32b9['offset']===_0x1b7f('0x1c')&&typeof _0x2f32b9['limit']==='undefined';var _0x1c83a7=_0x55a411['count'];var _0xcc1cf=_0x578b22?0x0:_0x2f32b9[_0x1b7f('0x1d')];var _0x321498=_0x578b22?_0x55a411[_0x1b7f('0x1e')]:_0x2f32b9[_0x1b7f('0x1d')]+_0x2f32b9[_0x1b7f('0x1f')];var _0x528c14;if(_0x321498>=_0x1c83a7){_0x321498=_0x1c83a7;_0x528c14=0xc8;}else{_0x528c14=0xce;}_0x3953a5['status'](_0x528c14);return _0x3953a5[_0x1b7f('0x20')](_0x1b7f('0x21'),_0xcc1cf+'-'+_0x321498+'/'+_0x1c83a7)[_0x1b7f('0x1b')](_0x55a411);}return null;};}function patchUpdates(_0x862de0){return function(_0x3a0090){try{jsonpatch[_0x1b7f('0x22')](_0x3a0090,_0x862de0,!![]);}catch(_0x5e3956){return BPromise[_0x1b7f('0x23')](_0x5e3956);}return _0x3a0090[_0x1b7f('0x24')]();};}function saveUpdates(_0x26c13b,_0x42b327){return function(_0xd54707){if(_0xd54707){return _0xd54707[_0x1b7f('0x25')](_0x26c13b)['then'](function(_0x3ab3cd){return _0x3ab3cd;});}return null;};}function removeEntity(_0xcd5f21,_0x141fdc){return function(_0x1288cb){if(_0x1288cb){return _0x1288cb[_0x1b7f('0x26')]()[_0x1b7f('0x27')](function(){_0xcd5f21[_0x1b7f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x262951,_0x3249f1){return function(_0x4c5dc8){if(!_0x4c5dc8){_0x262951[_0x1b7f('0x28')](0x194);}return _0x4c5dc8;};}function handleError(_0x2bad05,_0x24211a){_0x24211a=_0x24211a||0x1f4;return function(_0x5c5a57){logger[_0x1b7f('0x29')](_0x5c5a57['stack']);if(_0x5c5a57[_0x1b7f('0x2a')]){delete _0x5c5a57[_0x1b7f('0x2a')];}_0x2bad05['status'](_0x24211a)[_0x1b7f('0x2b')](_0x5c5a57);};}exports['index']=function(_0x573109,_0x137ab3){var _0x4de95b={},_0x5da4b1={},_0x40811f={'count':0x0,'rows':[]};var _0x41f998=_[_0x1b7f('0x2c')](db['FreshsalesField'][_0x1b7f('0x2d')],function(_0x563621){return{'name':_0x563621[_0x1b7f('0x2e')],'type':_0x563621['type'][_0x1b7f('0x2f')]};});_0x5da4b1[_0x1b7f('0x30')]=_[_0x1b7f('0x2c')](_0x41f998,_0x1b7f('0x2a'));_0x5da4b1[_0x1b7f('0x31')]=_[_0x1b7f('0x32')](_0x573109['query']);_0x5da4b1[_0x1b7f('0x33')]=_[_0x1b7f('0x34')](_0x5da4b1[_0x1b7f('0x30')],_0x5da4b1[_0x1b7f('0x31')]);_0x4de95b[_0x1b7f('0x35')]=_[_0x1b7f('0x34')](_0x5da4b1[_0x1b7f('0x30')],qs[_0x1b7f('0x36')](_0x573109[_0x1b7f('0x31')][_0x1b7f('0x36')]));_0x4de95b[_0x1b7f('0x35')]=_0x4de95b['attributes']['length']?_0x4de95b[_0x1b7f('0x35')]:_0x5da4b1[_0x1b7f('0x30')];if(!_0x573109[_0x1b7f('0x31')][_0x1b7f('0x37')]('nolimit')){_0x4de95b[_0x1b7f('0x1f')]=qs[_0x1b7f('0x1f')](_0x573109['query'][_0x1b7f('0x1f')]);_0x4de95b['offset']=qs[_0x1b7f('0x1d')](_0x573109[_0x1b7f('0x31')]['offset']);}_0x4de95b['order']=qs[_0x1b7f('0x38')](_0x573109[_0x1b7f('0x31')][_0x1b7f('0x38')]);_0x4de95b[_0x1b7f('0x39')]=qs[_0x1b7f('0x33')](_[_0x1b7f('0x3a')](_0x573109['query'],_0x5da4b1[_0x1b7f('0x33')]),_0x41f998);if(_0x573109[_0x1b7f('0x31')][_0x1b7f('0x3b')]){_0x4de95b[_0x1b7f('0x39')]=_['merge'](_0x4de95b[_0x1b7f('0x39')],{'$or':_[_0x1b7f('0x2c')](_0x41f998,function(_0x27caf5){if(_0x27caf5[_0x1b7f('0x3c')]!=='VIRTUAL'){var _0x256861={};_0x256861[_0x27caf5[_0x1b7f('0x2a')]]={'$like':'%'+_0x573109[_0x1b7f('0x31')]['filter']+'%'};return _0x256861;}})});}_0x4de95b=_[_0x1b7f('0x3d')]({},_0x4de95b,_0x573109[_0x1b7f('0x3e')]);var _0x5c453a={'where':_0x4de95b['where']};return db[_0x1b7f('0x3f')][_0x1b7f('0x1e')](_0x5c453a)['then'](function(_0x52f8b1){_0x40811f[_0x1b7f('0x1e')]=_0x52f8b1;if(_0x573109[_0x1b7f('0x31')][_0x1b7f('0x40')]){_0x4de95b[_0x1b7f('0x41')]=[{'all':!![]}];}return db[_0x1b7f('0x3f')][_0x1b7f('0x42')](_0x4de95b);})[_0x1b7f('0x27')](function(_0x886f10){_0x40811f[_0x1b7f('0x43')]=_0x886f10;return _0x40811f;})[_0x1b7f('0x27')](respondWithFilteredResult(_0x137ab3,_0x4de95b))[_0x1b7f('0x44')](handleError(_0x137ab3,null));};exports['show']=function(_0x13f30a,_0x1e1072){var _0x4b3747={'raw':!![],'where':{'id':_0x13f30a[_0x1b7f('0x45')]['id']}},_0x3a3eac={};_0x3a3eac['model']=_[_0x1b7f('0x32')](db[_0x1b7f('0x3f')][_0x1b7f('0x2d')]);_0x3a3eac[_0x1b7f('0x31')]=_[_0x1b7f('0x32')](_0x13f30a[_0x1b7f('0x31')]);_0x3a3eac[_0x1b7f('0x33')]=_[_0x1b7f('0x34')](_0x3a3eac[_0x1b7f('0x30')],_0x3a3eac[_0x1b7f('0x31')]);_0x4b3747[_0x1b7f('0x35')]=_[_0x1b7f('0x34')](_0x3a3eac[_0x1b7f('0x30')],qs['fields'](_0x13f30a[_0x1b7f('0x31')][_0x1b7f('0x36')]));_0x4b3747['attributes']=_0x4b3747['attributes'][_0x1b7f('0x46')]?_0x4b3747['attributes']:_0x3a3eac['model'];if(_0x13f30a[_0x1b7f('0x31')][_0x1b7f('0x40')]){_0x4b3747[_0x1b7f('0x41')]=[{'all':!![]}];}_0x4b3747=_[_0x1b7f('0x3d')]({},_0x4b3747,_0x13f30a[_0x1b7f('0x3e')]);return db[_0x1b7f('0x3f')][_0x1b7f('0x47')](_0x4b3747)['then'](handleEntityNotFound(_0x1e1072,null))[_0x1b7f('0x27')](respondWithResult(_0x1e1072,null))[_0x1b7f('0x44')](handleError(_0x1e1072,null));};exports['create']=function(_0x1e761a,_0x2e4b0b){return db[_0x1b7f('0x3f')][_0x1b7f('0x48')](_0x1e761a['body'],{})[_0x1b7f('0x27')](respondWithResult(_0x2e4b0b,0xc9))[_0x1b7f('0x44')](handleError(_0x2e4b0b,null));};exports[_0x1b7f('0x25')]=function(_0x191abe,_0x3d9997){if(_0x191abe['body']['id']){delete _0x191abe[_0x1b7f('0x49')]['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x191abe[_0x1b7f('0x45')]['id']}})[_0x1b7f('0x27')](handleEntityNotFound(_0x3d9997,null))[_0x1b7f('0x27')](saveUpdates(_0x191abe['body'],null))[_0x1b7f('0x27')](respondWithResult(_0x3d9997,null))[_0x1b7f('0x44')](handleError(_0x3d9997,null));};exports[_0x1b7f('0x26')]=function(_0x171c32,_0x38b015){return db[_0x1b7f('0x3f')][_0x1b7f('0x47')]({'where':{'id':_0x171c32[_0x1b7f('0x45')]['id']}})[_0x1b7f('0x27')](handleEntityNotFound(_0x38b015,null))['then'](removeEntity(_0x38b015,null))['catch'](handleError(_0x38b015,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 6087115..0910fbb 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 _0xf0f4=['freshsales_unique_index','FieldId','util','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields'];(function(_0x40153c,_0x1f75ae){var _0x1d53af=function(_0x11ec03){while(--_0x11ec03){_0x40153c['push'](_0x40153c['shift']());}};_0x1d53af(++_0x1f75ae);}(_0xf0f4,0x182));var _0x4f0f=function(_0x2ae19b,_0x20c2aa){_0x2ae19b=_0x2ae19b-0x0;var _0xdd5b85=_0xf0f4[_0x2ae19b];return _0xdd5b85;};'use strict';var _=require('lodash');var util=require(_0x4f0f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4f0f('0x1'));var BPromise=require(_0x4f0f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f0f('0x3'));var rimraf=require(_0x4f0f('0x4'));var config=require(_0x4f0f('0x5'));var attributes=require(_0x4f0f('0x6'));module[_0x4f0f('0x7')]=function(_0x15e6cd,_0x3285cd){return _0x15e6cd['define'](_0x4f0f('0x8'),attributes,{'tableName':_0x4f0f('0x9'),'paranoid':![],'indexes':[{'name':_0x4f0f('0xa'),'fields':['idField',_0x4f0f('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f18=['./intFreshsalesField.attributes','exports','define','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x51c4ee,_0x113035){var _0x3421cb=function(_0x1db285){while(--_0x1db285){_0x51c4ee['push'](_0x51c4ee['shift']());}};_0x3421cb(++_0x113035);}(_0x6f18,0x1b4));var _0x86f1=function(_0x18b9ed,_0x202956){_0x18b9ed=_0x18b9ed-0x0;var _0x930a87=_0x6f18[_0x18b9ed];return _0x930a87;};'use strict';var _=require(_0x86f1('0x0'));var util=require('util');var logger=require(_0x86f1('0x1'))('api');var moment=require(_0x86f1('0x2'));var BPromise=require(_0x86f1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x86f1('0x4'));var rimraf=require(_0x86f1('0x5'));var config=require('../../config/environment');var attributes=require(_0x86f1('0x6'));module[_0x86f1('0x7')]=function(_0x3c91dc,_0x15a5e1){return _0x3c91dc[_0x86f1('0x8')]('FreshsalesField',attributes,{'tableName':_0x86f1('0x9'),'paranoid':![],'indexes':[{'name':_0x86f1('0xa'),'fields':[_0x86f1('0xb'),_0x86f1('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 441f115..a773ccb 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 _0xe2fe=['then','info','FreshsalesField,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x2f91d2,_0x93add6){var _0x4707f0=function(_0x4216b9){while(--_0x4216b9){_0x2f91d2['push'](_0x2f91d2['shift']());}};_0x4707f0(++_0x93add6);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file +var _0x1967=['then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\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(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x1967,0x173));var _0x7196=function(_0x574205,_0x2e2764){_0x574205=_0x574205-0x0;var _0x12fb1a=_0x1967[_0x574205];return _0x12fb1a;};'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/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index c6d2155..f4077e1 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x6a9549,_0x784e1b){var _0x307f2e=function(_0xdf8715){while(--_0xdf8715){_0x6a9549['push'](_0x6a9549['shift']());}};_0x307f2e(++_0x784e1b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _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(_0x4dbb08,_0x5a693a){var _0x5b936e=function(_0x227b74){while(--_0x227b74){_0x4dbb08['push'](_0x4dbb08['shift']());}};_0x5b936e(++_0x5a693a);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 8095bfa..b9ff478 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 _0xfba2=['STRING','username','integrationTab','newTab','exports'];(function(_0x12b473,_0x46a9fd){var _0x2771e2=function(_0x50a384){while(--_0x50a384){_0x12b473['push'](_0x12b473['shift']());}};_0x2771e2(++_0x46a9fd);}(_0xfba2,0xf9));var _0x2fba=function(_0x56dc34,_0x778562){_0x56dc34=_0x56dc34-0x0;var _0xc5cd=_0xfba2[_0x56dc34];return _0xc5cd;};'use strict';var Sequelize=require('sequelize');module[_0x2fba('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2fba('0x1')]},'username':{'type':Sequelize[_0x2fba('0x1')],'unique':_0x2fba('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x2fba('0x1')]},'clientId':{'type':Sequelize[_0x2fba('0x1')]},'clientSecret':{'type':Sequelize[_0x2fba('0x1')]},'securityToken':{'type':Sequelize[_0x2fba('0x1')]},'serverUrl':{'type':Sequelize[_0x2fba('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x2fba('0x3'),_0x2fba('0x4')),'defaultValue':_0x2fba('0x3')}}; \ No newline at end of file +var _0x9962=['STRING','ENUM','newTab','integrationTab','sequelize'];(function(_0x451ffe,_0x3ccabd){var _0x200801=function(_0x1ae7b1){while(--_0x1ae7b1){_0x451ffe['push'](_0x451ffe['shift']());}};_0x200801(++_0x3ccabd);}(_0x9962,0xb8));var _0x2996=function(_0x4efe61,_0x5d1bb7){_0x4efe61=_0x4efe61-0x0;var _0x111983=_0x9962[_0x4efe61];return _0x111983;};'use strict';var Sequelize=require(_0x2996('0x0'));module['exports']={'name':{'type':Sequelize[_0x2996('0x1')]},'description':{'type':Sequelize[_0x2996('0x1')]},'username':{'type':Sequelize[_0x2996('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x2996('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x2996('0x1')]},'clientSecret':{'type':Sequelize[_0x2996('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x2996('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x2996('0x2')]('integrationTab',_0x2996('0x3')),'defaultValue':_0x2996('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index b17590e..d33682f 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 _0x8e00=['util','path','sox','fs-extra','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','SalesforceConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','lastIndexOf','login','concat','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x383879,_0x6d6711){var _0x151877=function(_0x2d537c){while(--_0x2d537c){_0x383879['push'](_0x383879['shift']());}};_0x151877(++_0x6d6711);}(_0x8e00,0x7a));var _0x08e0=function(_0x58c4f0,_0x2a996a){_0x58c4f0=_0x58c4f0-0x0;var _0x1dd44b=_0x8e00[_0x58c4f0];return _0x1dd44b;};'use strict';var emlformat=require(_0x08e0('0x0'));var rimraf=require(_0x08e0('0x1'));var zipdir=require(_0x08e0('0x2'));var jsonpatch=require(_0x08e0('0x3'));var rp=require(_0x08e0('0x4'));var moment=require(_0x08e0('0x5'));var BPromise=require(_0x08e0('0x6'));var Mustache=require(_0x08e0('0x7'));var util=require(_0x08e0('0x8'));var path=require(_0x08e0('0x9'));var sox=require(_0x08e0('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x08e0('0xb'));var _=require('lodash');var squel=require(_0x08e0('0xc'));var crypto=require(_0x08e0('0xd'));var jsforce=require(_0x08e0('0xe'));var deskjs=require(_0x08e0('0xf'));var toCsv=require(_0x08e0('0x10'));var querystring=require(_0x08e0('0x11'));var Papa=require(_0x08e0('0x12'));var Redis=require(_0x08e0('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x08e0('0x14'));var as=require(_0x08e0('0x15'));var hardwareService=require(_0x08e0('0x16'));var logger=require(_0x08e0('0x17'))(_0x08e0('0x18'));var utils=require(_0x08e0('0x19'));var config=require(_0x08e0('0x1a'));var licenseUtil=require(_0x08e0('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require(_0x08e0('0x1c'));function respondWithStatusCode(_0x44f197,_0x3285ba){_0x3285ba=_0x3285ba||0xcc;return function(_0x1eee5e){if(_0x1eee5e){return _0x44f197[_0x08e0('0x1d')](_0x3285ba);}return _0x44f197[_0x08e0('0x1e')](_0x3285ba)[_0x08e0('0x1f')]();};}function respondWithResult(_0x1d1aa8,_0x15cfa3){_0x15cfa3=_0x15cfa3||0xc8;return function(_0x4ef052){if(_0x4ef052){return _0x1d1aa8[_0x08e0('0x1e')](_0x15cfa3)[_0x08e0('0x20')](_0x4ef052);}};}function respondWithFilteredResult(_0x4b9e7d,_0x37c626){return function(_0x6916fb){if(_0x6916fb){var _0x79f2e1=typeof _0x37c626[_0x08e0('0x21')]===_0x08e0('0x22')&&typeof _0x37c626['limit']===_0x08e0('0x22');var _0x51ba5c=_0x6916fb[_0x08e0('0x23')];var _0x3f5ec8=_0x79f2e1?0x0:_0x37c626['offset'];var _0x2f0482=_0x79f2e1?_0x6916fb['count']:_0x37c626[_0x08e0('0x21')]+_0x37c626[_0x08e0('0x24')];var _0x4f14de;if(_0x2f0482>=_0x51ba5c){_0x2f0482=_0x51ba5c;_0x4f14de=0xc8;}else{_0x4f14de=0xce;}_0x4b9e7d['status'](_0x4f14de);return _0x4b9e7d[_0x08e0('0x25')]('Content-Range',_0x3f5ec8+'-'+_0x2f0482+'/'+_0x51ba5c)['json'](_0x6916fb);}return null;};}function patchUpdates(_0x49af6e){return function(_0x410d59){try{jsonpatch[_0x08e0('0x26')](_0x410d59,_0x49af6e,!![]);}catch(_0x59ce6b){return BPromise['reject'](_0x59ce6b);}return _0x410d59[_0x08e0('0x27')]();};}function saveUpdates(_0x3d3e8f,_0x4d6db1){return function(_0x2343b7){if(_0x2343b7){return _0x2343b7[_0x08e0('0x28')](_0x3d3e8f)[_0x08e0('0x29')](function(_0x1f9f15){return _0x1f9f15;});}return null;};}function removeEntity(_0x385df0,_0x53f97b){return function(_0x3cdc54){if(_0x3cdc54){return _0x3cdc54[_0x08e0('0x2a')]()[_0x08e0('0x29')](function(){_0x385df0[_0x08e0('0x1e')](0xcc)[_0x08e0('0x1f')]();});}};}function handleEntityNotFound(_0x2a1bc2,_0x395889){return function(_0x598b6c){if(!_0x598b6c){_0x2a1bc2['sendStatus'](0x194);}return _0x598b6c;};}function handleError(_0x46e6cc,_0x5de80e){_0x5de80e=_0x5de80e||0x1f4;return function(_0x48b7dc){logger['error'](_0x48b7dc[_0x08e0('0x2b')]);if(_0x48b7dc['name']){delete _0x48b7dc[_0x08e0('0x2c')];}_0x46e6cc['status'](_0x5de80e)[_0x08e0('0x2d')](_0x48b7dc);};}exports[_0x08e0('0x2e')]=function(_0x4f6ec9,_0x60ced){var _0x59f56c={},_0x4d7487={},_0x506556={'count':0x0,'rows':[]};var _0x1091ec=_[_0x08e0('0x2f')](db[_0x08e0('0x30')][_0x08e0('0x31')],function(_0x3da4b3){return{'name':_0x3da4b3[_0x08e0('0x32')],'type':_0x3da4b3[_0x08e0('0x33')][_0x08e0('0x34')]};});_0x4d7487['model']=_['map'](_0x1091ec,_0x08e0('0x2c'));_0x4d7487[_0x08e0('0x35')]=_['keys'](_0x4f6ec9['query']);_0x4d7487[_0x08e0('0x36')]=_['intersection'](_0x4d7487[_0x08e0('0x37')],_0x4d7487[_0x08e0('0x35')]);_0x59f56c[_0x08e0('0x38')]=_[_0x08e0('0x39')](_0x4d7487[_0x08e0('0x37')],qs[_0x08e0('0x3a')](_0x4f6ec9[_0x08e0('0x35')][_0x08e0('0x3a')]));_0x59f56c[_0x08e0('0x38')]=_0x59f56c[_0x08e0('0x38')][_0x08e0('0x3b')]?_0x59f56c['attributes']:_0x4d7487[_0x08e0('0x37')];if(!_0x4f6ec9[_0x08e0('0x35')]['hasOwnProperty'](_0x08e0('0x3c'))){_0x59f56c[_0x08e0('0x24')]=qs[_0x08e0('0x24')](_0x4f6ec9['query'][_0x08e0('0x24')]);_0x59f56c[_0x08e0('0x21')]=qs[_0x08e0('0x21')](_0x4f6ec9[_0x08e0('0x35')]['offset']);}_0x59f56c[_0x08e0('0x3d')]=qs[_0x08e0('0x3e')](_0x4f6ec9[_0x08e0('0x35')][_0x08e0('0x3e')]);_0x59f56c[_0x08e0('0x3f')]=qs[_0x08e0('0x36')](_[_0x08e0('0x40')](_0x4f6ec9[_0x08e0('0x35')],_0x4d7487[_0x08e0('0x36')]),_0x1091ec);if(_0x4f6ec9[_0x08e0('0x35')][_0x08e0('0x41')]){_0x59f56c[_0x08e0('0x3f')]=_['merge'](_0x59f56c[_0x08e0('0x3f')],{'$or':_['map'](_0x1091ec,function(_0x4d45e0){if(_0x4d45e0['type']!==_0x08e0('0x42')){var _0x824e57={};_0x824e57[_0x4d45e0[_0x08e0('0x2c')]]={'$like':'%'+_0x4f6ec9[_0x08e0('0x35')][_0x08e0('0x41')]+'%'};return _0x824e57;}})});}_0x59f56c=_[_0x08e0('0x43')]({},_0x59f56c,_0x4f6ec9[_0x08e0('0x44')]);var _0x1116e7={'where':_0x59f56c['where']};return db['SalesforceAccount'][_0x08e0('0x23')](_0x1116e7)[_0x08e0('0x29')](function(_0x398518){_0x506556['count']=_0x398518;if(_0x4f6ec9[_0x08e0('0x35')]['includeAll']){_0x59f56c[_0x08e0('0x45')]=[{'all':!![]}];}return db[_0x08e0('0x30')][_0x08e0('0x46')](_0x59f56c);})[_0x08e0('0x29')](function(_0x316de1){_0x506556[_0x08e0('0x47')]=_0x316de1;return _0x506556;})[_0x08e0('0x29')](respondWithFilteredResult(_0x60ced,_0x59f56c))[_0x08e0('0x48')](handleError(_0x60ced,null));};exports[_0x08e0('0x49')]=function(_0x6d9d07,_0x466ddf){var _0x10671b={'raw':![],'where':{'id':_0x6d9d07[_0x08e0('0x4a')]['id']}},_0x99b1ef={};_0x99b1ef[_0x08e0('0x37')]=_[_0x08e0('0x4b')](db[_0x08e0('0x30')]['rawAttributes']);_0x99b1ef['query']=_[_0x08e0('0x4b')](_0x6d9d07[_0x08e0('0x35')]);_0x99b1ef[_0x08e0('0x36')]=_[_0x08e0('0x39')](_0x99b1ef[_0x08e0('0x37')],_0x99b1ef[_0x08e0('0x35')]);_0x10671b[_0x08e0('0x38')]=_[_0x08e0('0x39')](_0x99b1ef[_0x08e0('0x37')],qs[_0x08e0('0x3a')](_0x6d9d07['query'][_0x08e0('0x3a')]));_0x10671b['attributes']=_0x10671b[_0x08e0('0x38')][_0x08e0('0x3b')]?_0x10671b[_0x08e0('0x38')]:_0x99b1ef['model'];if(_0x6d9d07[_0x08e0('0x35')]['includeAll']){_0x10671b[_0x08e0('0x45')]=[{'all':!![]}];}_0x10671b=_[_0x08e0('0x43')]({},_0x10671b,_0x6d9d07[_0x08e0('0x44')]);return db['SalesforceAccount'][_0x08e0('0x4c')](_0x10671b)[_0x08e0('0x29')](handleEntityNotFound(_0x466ddf,null))[_0x08e0('0x29')](respondWithResult(_0x466ddf,null))[_0x08e0('0x48')](handleError(_0x466ddf,null));};exports[_0x08e0('0x4d')]=function(_0x204be7,_0x1b6bbf){return db[_0x08e0('0x30')][_0x08e0('0x4d')](_0x204be7[_0x08e0('0x4e')],{})['then'](respondWithResult(_0x1b6bbf,0xc9))[_0x08e0('0x48')](handleError(_0x1b6bbf,null));};exports[_0x08e0('0x28')]=function(_0x4f9196,_0x450be5){if(_0x4f9196[_0x08e0('0x4e')]['id']){delete _0x4f9196[_0x08e0('0x4e')]['id'];}return db[_0x08e0('0x30')][_0x08e0('0x4c')]({'where':{'id':_0x4f9196['params']['id']}})['then'](handleEntityNotFound(_0x450be5,null))[_0x08e0('0x29')](saveUpdates(_0x4f9196[_0x08e0('0x4e')],null))['then'](respondWithResult(_0x450be5,null))[_0x08e0('0x48')](handleError(_0x450be5,null));};exports['destroy']=function(_0x16516a,_0x163519){return db['SalesforceAccount'][_0x08e0('0x4c')]({'where':{'id':_0x16516a[_0x08e0('0x4a')]['id']}})[_0x08e0('0x29')](handleEntityNotFound(_0x163519,null))[_0x08e0('0x29')](removeEntity(_0x163519,null))[_0x08e0('0x48')](handleError(_0x163519,null));};exports[_0x08e0('0x4f')]=function(_0x16946d,_0xb4b841,_0x26c93a){var _0x275cfe={};var _0x594b76={};var _0xd49dd8;var _0x491c42;return db[_0x08e0('0x30')]['findOne']({'where':{'id':_0x16946d[_0x08e0('0x4a')]['id']}})['then'](handleEntityNotFound(_0xb4b841,null))['then'](function(_0xd080b){if(_0xd080b){_0xd49dd8=_0xd080b;_0x594b76[_0x08e0('0x37')]=_[_0x08e0('0x4b')](db[_0x08e0('0x50')][_0x08e0('0x31')]);_0x594b76[_0x08e0('0x35')]=_[_0x08e0('0x4b')](_0x16946d[_0x08e0('0x35')]);_0x594b76[_0x08e0('0x36')]=_[_0x08e0('0x39')](_0x594b76[_0x08e0('0x37')],_0x594b76[_0x08e0('0x35')]);_0x275cfe[_0x08e0('0x38')]=_['intersection'](_0x594b76[_0x08e0('0x37')],qs[_0x08e0('0x3a')](_0x16946d[_0x08e0('0x35')]['fields']));_0x275cfe['attributes']=_0x275cfe[_0x08e0('0x38')]['length']?_0x275cfe['attributes']:_0x594b76[_0x08e0('0x37')];_0x275cfe[_0x08e0('0x3d')]=qs[_0x08e0('0x3e')](_0x16946d[_0x08e0('0x35')][_0x08e0('0x3e')]);_0x275cfe['where']=qs[_0x08e0('0x36')](_[_0x08e0('0x40')](_0x16946d[_0x08e0('0x35')],_0x594b76[_0x08e0('0x36')]));if(_0x16946d[_0x08e0('0x35')]['filter']){_0x275cfe[_0x08e0('0x3f')]=_[_0x08e0('0x43')](_0x275cfe[_0x08e0('0x3f')],{'$or':_[_0x08e0('0x2f')](_0x275cfe[_0x08e0('0x38')],function(_0x4174c7){var _0x4ed1c3={};_0x4ed1c3[_0x4174c7]={'$like':'%'+_0x16946d[_0x08e0('0x35')][_0x08e0('0x41')]+'%'};return _0x4ed1c3;})});}_0x275cfe=_['merge']({},_0x275cfe,_0x16946d[_0x08e0('0x44')]);return _0xd49dd8[_0x08e0('0x4f')](_0x275cfe);}})[_0x08e0('0x29')](function(_0x1e9e4b){if(_0x1e9e4b){_0x491c42=_0x1e9e4b[_0x08e0('0x3b')];if(!_0x16946d[_0x08e0('0x35')][_0x08e0('0x51')](_0x08e0('0x3c'))){_0x275cfe[_0x08e0('0x24')]=qs['limit'](_0x16946d[_0x08e0('0x35')][_0x08e0('0x24')]);_0x275cfe['offset']=qs[_0x08e0('0x21')](_0x16946d[_0x08e0('0x35')]['offset']);}return _0xd49dd8['getConfigurations'](_0x275cfe);}})[_0x08e0('0x29')](function(_0x2c0844){if(_0x2c0844){return _0x2c0844?{'count':_0x491c42,'rows':_0x2c0844}:null;}})['then'](respondWithResult(_0xb4b841,null))[_0x08e0('0x48')](handleError(_0xb4b841,null));};exports[_0x08e0('0x52')]=function(_0x753e9b,_0x490185,_0x7f6bbb){if(_0x753e9b[_0x08e0('0x4e')]['id']){delete _0x753e9b['body']['id'];}return db[_0x08e0('0x30')][_0x08e0('0x53')]({'where':{'id':_0x753e9b[_0x08e0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x490185,null))[_0x08e0('0x29')](function(_0x597fb7){if(_0x597fb7){_0x753e9b[_0x08e0('0x4e')][_0x08e0('0x54')]=_0x597fb7['id'];_0x753e9b['body'][_0x08e0('0x55')]=integrations[_0x08e0('0x56')](_0x753e9b['body']['channel'],_0x753e9b['body'][_0x08e0('0x33')]);_0x753e9b[_0x08e0('0x4e')][_0x08e0('0x57')]=integrations[_0x08e0('0x58')](_0x753e9b[_0x08e0('0x4e')]['channel'],_0x753e9b['body'][_0x08e0('0x33')]);return db[_0x08e0('0x50')][_0x08e0('0x4d')](_0x753e9b['body'],{'include':[{'model':db[_0x08e0('0x59')],'as':'Subjects'},{'model':db[_0x08e0('0x59')],'as':'Descriptions'}]});}return null;})[_0x08e0('0x29')](respondWithResult(_0x490185,null))['catch'](handleError(_0x490185,null));};exports[_0x08e0('0x5a')]=function(_0x5010b9,_0x45cbe4,_0x2a298c){var _0x2ce697;var _0x502003='';var _0x3ff8eb=_0x08e0('0x5b');return db['SalesforceAccount'][_0x08e0('0x53')]({'where':{'id':_0x5010b9[_0x08e0('0x4a')]['id']},'attributes':['id',_0x08e0('0x5c'),_0x08e0('0x5d'),_0x08e0('0x5e'),_0x08e0('0x5f'),_0x08e0('0x60'),_0x08e0('0x61')]})['then'](handleEntityNotFound(_0x45cbe4,null))['then'](function(_0x355ae2){if(_0x355ae2){_0x502003=_0x355ae2[_0x08e0('0x5c')];var _0x3e8d6e=_0x502003[_0x08e0('0x62')](-0x1);if(_0x3e8d6e==='/'){_0x502003=_0x502003['substring'](0x0,_0x502003[_0x08e0('0x63')](_0x3e8d6e));}_0x2ce697=new jsforce['Connection']({'oauth2':{'loginUrl':_0x502003,'clientId':_0x355ae2[_0x08e0('0x5d')],'clientSecret':_0x355ae2['clientSecret']}});return _0x2ce697[_0x08e0('0x64')](_0x355ae2[_0x08e0('0x5f')],_0x355ae2['password'][_0x08e0('0x65')](_0x355ae2[_0x08e0('0x61')]));}})['then'](function(_0x47b957){if(_0x47b957){if(!_['isNil'](_0x5010b9[_0x08e0('0x35')][_0x08e0('0x66')])){_0x3ff8eb=_0x5010b9['query']['ticketType'];}return _0x2ce697[_0x08e0('0x67')](_0x3ff8eb)[_0x08e0('0x68')]();}})[_0x08e0('0x29')](function(_0x37ec59){var _0x337673=[_0x08e0('0x69'),_0x08e0('0x6a'),_0x08e0('0x6b'),_0x08e0('0x6c'),_0x08e0('0x6d'),_0x08e0('0x6e')];var _0x465dad=[_0x08e0('0x6f'),'int',_0x08e0('0x70'),_0x08e0('0x71'),_0x08e0('0x72'),_0x08e0('0x73'),_0x08e0('0x74')];if(_0x37ec59){_[_0x08e0('0x75')](_0x37ec59[_0x08e0('0x3a')],function(_0x309892){return _0x337673[_0x08e0('0x76')](_0x309892[_0x08e0('0x2c')])||!_0x465dad[_0x08e0('0x76')](_0x309892[_0x08e0('0x33')]);});return{'count':_0x37ec59[_0x08e0('0x3a')]['length'],'rows':_['map'](_0x37ec59[_0x08e0('0x3a')],function(_0x4e2049){return{'id':_0x4e2049['name'],'name':_0x4e2049[_0x08e0('0x77')],'custom':_0x4e2049[_0x08e0('0x78')],'options':_0x4e2049['picklistValues']['length']>0x0?_[_0x08e0('0x2f')](_0x4e2049[_0x08e0('0x79')],function(_0x79ebe6){return{'name':_0x79ebe6['label'],'value':_0x79ebe6[_0x08e0('0x7a')]};}):_0x4e2049[_0x08e0('0x33')]=='boolean'?[{'name':_0x08e0('0x7b'),'value':'true'},{'name':'False','value':_0x08e0('0x7c')}]:[]};})};}})['then'](respondWithResult(_0x45cbe4,null))[_0x08e0('0x48')](function(_0x2d94ca){var _0x57e439=_0x5010b9[_0x08e0('0x35')][_0x08e0('0x7d')]?0x1f4:_0x2d94ca[_0x08e0('0x7e')]||0x1f4;logger['error'](_0x08e0('0x7f'),_0x08e0('0x5a'),_0x57e439,JSON[_0x08e0('0x80')](_0x2d94ca));delete _0x2d94ca[_0x08e0('0x2c')];if(_0x57e439===0x191){_0x57e439=0x190;}_0x45cbe4[_0x08e0('0x1e')](_0x57e439)[_0x08e0('0x2d')](_0x5010b9[_0x08e0('0x35')]['test']?{'message':_0x08e0('0x81'),'statusCode':_0x2d94ca[_0x08e0('0x7e')]}:_0x2d94ca);});}; \ No newline at end of file +var _0x3c40=['Wrong\x20credentials','eml-format','zip-dir','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','SalesforceAccount','findAll','rows','show','params','options','catch','create','body','find','SalesforceConfiguration','pick','getConfigurations','addConfiguration','findOne','getSubjects','getDescriptions','Subjects','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','clientSecret','securityToken','slice','substring','lastIndexOf','Connection','login','username','password','concat','isNil','ticketType','sobject','describe','IsReminderSet','string','int','picklist','boolean','email','textarea','remove','includes','picklistValues','label','true','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xed01eb,_0x275edb){var _0x25b9de=function(_0x3c331c){while(--_0x3c331c){_0xed01eb['push'](_0xed01eb['shift']());}};_0x25b9de(++_0x275edb);}(_0x3c40,0x1d9));var _0x03c4=function(_0x41f2f5,_0x14f33c){_0x41f2f5=_0x41f2f5-0x0;var _0x3d49f1=_0x3c40[_0x41f2f5];return _0x3d49f1;};'use strict';var emlformat=require(_0x03c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03c4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x03c4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x03c4('0x3'));var util=require('util');var path=require(_0x03c4('0x4'));var sox=require(_0x03c4('0x5'));var csv=require('to-csv');var ejs=require(_0x03c4('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x03c4('0x7'));var squel=require(_0x03c4('0x8'));var crypto=require(_0x03c4('0x9'));var jsforce=require(_0x03c4('0xa'));var deskjs=require(_0x03c4('0xb'));var toCsv=require(_0x03c4('0xc'));var querystring=require(_0x03c4('0xd'));var Papa=require(_0x03c4('0xe'));var Redis=require(_0x03c4('0xf'));var authService=require(_0x03c4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x03c4('0x11'));var logger=require(_0x03c4('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x03c4('0x13'));var db=require(_0x03c4('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1b15b1,_0x5eeaf7){_0x5eeaf7=_0x5eeaf7||0xcc;return function(_0x74bad8){if(_0x74bad8){return _0x1b15b1[_0x03c4('0x15')](_0x5eeaf7);}return _0x1b15b1[_0x03c4('0x16')](_0x5eeaf7)[_0x03c4('0x17')]();};}function respondWithResult(_0xcd5efd,_0x1195f7){_0x1195f7=_0x1195f7||0xc8;return function(_0x31d015){if(_0x31d015){return _0xcd5efd[_0x03c4('0x16')](_0x1195f7)[_0x03c4('0x18')](_0x31d015);}};}function respondWithFilteredResult(_0x2c391c,_0x13b742){return function(_0xd59862){if(_0xd59862){var _0x4d520e=typeof _0x13b742[_0x03c4('0x19')]===_0x03c4('0x1a')&&typeof _0x13b742[_0x03c4('0x1b')]===_0x03c4('0x1a');var _0x53e1a3=_0xd59862[_0x03c4('0x1c')];var _0x2e3ff4=_0x4d520e?0x0:_0x13b742[_0x03c4('0x19')];var _0x1d52f4=_0x4d520e?_0xd59862[_0x03c4('0x1c')]:_0x13b742[_0x03c4('0x19')]+_0x13b742['limit'];var _0x81cd7f;if(_0x1d52f4>=_0x53e1a3){_0x1d52f4=_0x53e1a3;_0x81cd7f=0xc8;}else{_0x81cd7f=0xce;}_0x2c391c[_0x03c4('0x16')](_0x81cd7f);return _0x2c391c[_0x03c4('0x1d')](_0x03c4('0x1e'),_0x2e3ff4+'-'+_0x1d52f4+'/'+_0x53e1a3)[_0x03c4('0x18')](_0xd59862);}return null;};}function patchUpdates(_0x126002){return function(_0x52dfab){try{jsonpatch[_0x03c4('0x1f')](_0x52dfab,_0x126002,!![]);}catch(_0x10d7c3){return BPromise[_0x03c4('0x20')](_0x10d7c3);}return _0x52dfab[_0x03c4('0x21')]();};}function saveUpdates(_0x49f1d3,_0x3266fa){return function(_0x5be6d7){if(_0x5be6d7){return _0x5be6d7[_0x03c4('0x22')](_0x49f1d3)[_0x03c4('0x23')](function(_0x291348){return _0x291348;});}return null;};}function removeEntity(_0x10204c,_0x3edc64){return function(_0x4c3821){if(_0x4c3821){return _0x4c3821['destroy']()['then'](function(){_0x10204c[_0x03c4('0x16')](0xcc)[_0x03c4('0x17')]();});}};}function handleEntityNotFound(_0x38066b,_0x1773f8){return function(_0xbf82e6){if(!_0xbf82e6){_0x38066b['sendStatus'](0x194);}return _0xbf82e6;};}function handleError(_0x674385,_0x4c08ab){_0x4c08ab=_0x4c08ab||0x1f4;return function(_0x3eb4ef){logger[_0x03c4('0x24')](_0x3eb4ef['stack']);if(_0x3eb4ef['name']){delete _0x3eb4ef[_0x03c4('0x25')];}_0x674385[_0x03c4('0x16')](_0x4c08ab)[_0x03c4('0x26')](_0x3eb4ef);};}exports['index']=function(_0x508196,_0x14b896){var _0x54054d={},_0x368450={},_0x4c0e12={'count':0x0,'rows':[]};var _0x1ac524=_[_0x03c4('0x27')](db['SalesforceAccount'][_0x03c4('0x28')],function(_0xcc5a2d){return{'name':_0xcc5a2d[_0x03c4('0x29')],'type':_0xcc5a2d[_0x03c4('0x2a')][_0x03c4('0x2b')]};});_0x368450[_0x03c4('0x2c')]=_[_0x03c4('0x27')](_0x1ac524,'name');_0x368450[_0x03c4('0x2d')]=_[_0x03c4('0x2e')](_0x508196[_0x03c4('0x2d')]);_0x368450[_0x03c4('0x2f')]=_[_0x03c4('0x30')](_0x368450['model'],_0x368450[_0x03c4('0x2d')]);_0x54054d[_0x03c4('0x31')]=_[_0x03c4('0x30')](_0x368450['model'],qs['fields'](_0x508196[_0x03c4('0x2d')][_0x03c4('0x32')]));_0x54054d['attributes']=_0x54054d[_0x03c4('0x31')][_0x03c4('0x33')]?_0x54054d[_0x03c4('0x31')]:_0x368450[_0x03c4('0x2c')];if(!_0x508196[_0x03c4('0x2d')][_0x03c4('0x34')](_0x03c4('0x35'))){_0x54054d['limit']=qs[_0x03c4('0x1b')](_0x508196[_0x03c4('0x2d')]['limit']);_0x54054d[_0x03c4('0x19')]=qs[_0x03c4('0x19')](_0x508196[_0x03c4('0x2d')][_0x03c4('0x19')]);}_0x54054d[_0x03c4('0x36')]=qs[_0x03c4('0x37')](_0x508196['query'][_0x03c4('0x37')]);_0x54054d[_0x03c4('0x38')]=qs[_0x03c4('0x2f')](_['pick'](_0x508196[_0x03c4('0x2d')],_0x368450['filters']),_0x1ac524);if(_0x508196['query'][_0x03c4('0x39')]){_0x54054d['where']=_[_0x03c4('0x3a')](_0x54054d['where'],{'$or':_[_0x03c4('0x27')](_0x1ac524,function(_0x339e5f){if(_0x339e5f[_0x03c4('0x2a')]!==_0x03c4('0x3b')){var _0x26ab01={};_0x26ab01[_0x339e5f['name']]={'$like':'%'+_0x508196[_0x03c4('0x2d')][_0x03c4('0x39')]+'%'};return _0x26ab01;}})});}_0x54054d=_[_0x03c4('0x3a')]({},_0x54054d,_0x508196['options']);var _0x522305={'where':_0x54054d['where']};return db['SalesforceAccount']['count'](_0x522305)[_0x03c4('0x23')](function(_0x57e38f){_0x4c0e12[_0x03c4('0x1c')]=_0x57e38f;if(_0x508196[_0x03c4('0x2d')][_0x03c4('0x3c')]){_0x54054d[_0x03c4('0x3d')]=[{'all':!![]}];}return db[_0x03c4('0x3e')][_0x03c4('0x3f')](_0x54054d);})['then'](function(_0x4d5b1c){_0x4c0e12[_0x03c4('0x40')]=_0x4d5b1c;return _0x4c0e12;})[_0x03c4('0x23')](respondWithFilteredResult(_0x14b896,_0x54054d))['catch'](handleError(_0x14b896,null));};exports[_0x03c4('0x41')]=function(_0x1faeb7,_0xbc437a){var _0x4b92ff={'raw':![],'where':{'id':_0x1faeb7[_0x03c4('0x42')]['id']}},_0x3d4ad0={};_0x3d4ad0[_0x03c4('0x2c')]=_['keys'](db[_0x03c4('0x3e')][_0x03c4('0x28')]);_0x3d4ad0[_0x03c4('0x2d')]=_[_0x03c4('0x2e')](_0x1faeb7['query']);_0x3d4ad0[_0x03c4('0x2f')]=_[_0x03c4('0x30')](_0x3d4ad0[_0x03c4('0x2c')],_0x3d4ad0[_0x03c4('0x2d')]);_0x4b92ff[_0x03c4('0x31')]=_[_0x03c4('0x30')](_0x3d4ad0['model'],qs[_0x03c4('0x32')](_0x1faeb7[_0x03c4('0x2d')]['fields']));_0x4b92ff[_0x03c4('0x31')]=_0x4b92ff[_0x03c4('0x31')][_0x03c4('0x33')]?_0x4b92ff[_0x03c4('0x31')]:_0x3d4ad0[_0x03c4('0x2c')];if(_0x1faeb7['query'][_0x03c4('0x3c')]){_0x4b92ff[_0x03c4('0x3d')]=[{'all':!![]}];}_0x4b92ff=_[_0x03c4('0x3a')]({},_0x4b92ff,_0x1faeb7[_0x03c4('0x43')]);return db[_0x03c4('0x3e')]['find'](_0x4b92ff)[_0x03c4('0x23')](handleEntityNotFound(_0xbc437a,null))['then'](respondWithResult(_0xbc437a,null))[_0x03c4('0x44')](handleError(_0xbc437a,null));};exports['create']=function(_0x224643,_0x5cd06e){return db[_0x03c4('0x3e')][_0x03c4('0x45')](_0x224643[_0x03c4('0x46')],{})[_0x03c4('0x23')](respondWithResult(_0x5cd06e,0xc9))[_0x03c4('0x44')](handleError(_0x5cd06e,null));};exports[_0x03c4('0x22')]=function(_0x20929f,_0x2bb87d){if(_0x20929f[_0x03c4('0x46')]['id']){delete _0x20929f[_0x03c4('0x46')]['id'];}return db[_0x03c4('0x3e')]['find']({'where':{'id':_0x20929f['params']['id']}})[_0x03c4('0x23')](handleEntityNotFound(_0x2bb87d,null))[_0x03c4('0x23')](saveUpdates(_0x20929f[_0x03c4('0x46')],null))['then'](respondWithResult(_0x2bb87d,null))[_0x03c4('0x44')](handleError(_0x2bb87d,null));};exports['destroy']=function(_0x335cc5,_0x567649){return db['SalesforceAccount'][_0x03c4('0x47')]({'where':{'id':_0x335cc5[_0x03c4('0x42')]['id']}})[_0x03c4('0x23')](handleEntityNotFound(_0x567649,null))[_0x03c4('0x23')](removeEntity(_0x567649,null))[_0x03c4('0x44')](handleError(_0x567649,null));};exports['getConfigurations']=function(_0x57c87c,_0x2bfbb2,_0x19eb7b){var _0x28cc01={};var _0x25ffea={};var _0xbf9e7b;var _0x125046;return db[_0x03c4('0x3e')]['findOne']({'where':{'id':_0x57c87c['params']['id']}})[_0x03c4('0x23')](handleEntityNotFound(_0x2bfbb2,null))[_0x03c4('0x23')](function(_0x4fe1dd){if(_0x4fe1dd){_0xbf9e7b=_0x4fe1dd;_0x25ffea['model']=_['keys'](db[_0x03c4('0x48')]['rawAttributes']);_0x25ffea[_0x03c4('0x2d')]=_[_0x03c4('0x2e')](_0x57c87c[_0x03c4('0x2d')]);_0x25ffea[_0x03c4('0x2f')]=_[_0x03c4('0x30')](_0x25ffea[_0x03c4('0x2c')],_0x25ffea[_0x03c4('0x2d')]);_0x28cc01[_0x03c4('0x31')]=_[_0x03c4('0x30')](_0x25ffea[_0x03c4('0x2c')],qs['fields'](_0x57c87c['query'][_0x03c4('0x32')]));_0x28cc01[_0x03c4('0x31')]=_0x28cc01[_0x03c4('0x31')]['length']?_0x28cc01['attributes']:_0x25ffea[_0x03c4('0x2c')];_0x28cc01[_0x03c4('0x36')]=qs[_0x03c4('0x37')](_0x57c87c[_0x03c4('0x2d')][_0x03c4('0x37')]);_0x28cc01[_0x03c4('0x38')]=qs[_0x03c4('0x2f')](_[_0x03c4('0x49')](_0x57c87c[_0x03c4('0x2d')],_0x25ffea[_0x03c4('0x2f')]));if(_0x57c87c['query']['filter']){_0x28cc01[_0x03c4('0x38')]=_[_0x03c4('0x3a')](_0x28cc01[_0x03c4('0x38')],{'$or':_[_0x03c4('0x27')](_0x28cc01[_0x03c4('0x31')],function(_0x3b59a2){var _0x56d932={};_0x56d932[_0x3b59a2]={'$like':'%'+_0x57c87c[_0x03c4('0x2d')][_0x03c4('0x39')]+'%'};return _0x56d932;})});}_0x28cc01=_[_0x03c4('0x3a')]({},_0x28cc01,_0x57c87c[_0x03c4('0x43')]);return _0xbf9e7b[_0x03c4('0x4a')](_0x28cc01);}})[_0x03c4('0x23')](function(_0x323ca9){if(_0x323ca9){_0x125046=_0x323ca9['length'];if(!_0x57c87c[_0x03c4('0x2d')][_0x03c4('0x34')](_0x03c4('0x35'))){_0x28cc01[_0x03c4('0x1b')]=qs['limit'](_0x57c87c[_0x03c4('0x2d')][_0x03c4('0x1b')]);_0x28cc01[_0x03c4('0x19')]=qs[_0x03c4('0x19')](_0x57c87c['query'][_0x03c4('0x19')]);}return _0xbf9e7b[_0x03c4('0x4a')](_0x28cc01);}})[_0x03c4('0x23')](function(_0x3143bd){if(_0x3143bd){return _0x3143bd?{'count':_0x125046,'rows':_0x3143bd}:null;}})[_0x03c4('0x23')](respondWithResult(_0x2bfbb2,null))[_0x03c4('0x44')](handleError(_0x2bfbb2,null));};exports[_0x03c4('0x4b')]=function(_0xe16ba6,_0x1fcd61,_0x2febb1){if(_0xe16ba6[_0x03c4('0x46')]['id']){delete _0xe16ba6['body']['id'];}return db[_0x03c4('0x3e')][_0x03c4('0x4c')]({'where':{'id':_0xe16ba6[_0x03c4('0x42')]['id']}})['then'](handleEntityNotFound(_0x1fcd61,null))[_0x03c4('0x23')](function(_0x4c4bad){if(_0x4c4bad){_0xe16ba6[_0x03c4('0x46')]['AccountId']=_0x4c4bad['id'];_0xe16ba6[_0x03c4('0x46')]['Subjects']=integrations[_0x03c4('0x4d')](_0xe16ba6[_0x03c4('0x46')]['channel'],_0xe16ba6['body'][_0x03c4('0x2a')]);_0xe16ba6[_0x03c4('0x46')]['Descriptions']=integrations[_0x03c4('0x4e')](_0xe16ba6['body']['channel'],_0xe16ba6[_0x03c4('0x46')][_0x03c4('0x2a')]);return db[_0x03c4('0x48')]['create'](_0xe16ba6[_0x03c4('0x46')],{'include':[{'model':db['SalesforceField'],'as':_0x03c4('0x4f')},{'model':db[_0x03c4('0x50')],'as':_0x03c4('0x51')}]});}return null;})['then'](respondWithResult(_0x1fcd61,null))[_0x03c4('0x44')](handleError(_0x1fcd61,null));};exports[_0x03c4('0x52')]=function(_0x3b5842,_0x388999,_0xdccc29){var _0x50c31d;var _0x1d8f5c='';var _0xc6e9d6=_0x03c4('0x53');return db[_0x03c4('0x3e')][_0x03c4('0x4c')]({'where':{'id':_0x3b5842['params']['id']},'attributes':['id',_0x03c4('0x54'),_0x03c4('0x55'),_0x03c4('0x56'),'username','password',_0x03c4('0x57')]})[_0x03c4('0x23')](handleEntityNotFound(_0x388999,null))[_0x03c4('0x23')](function(_0x94b84c){if(_0x94b84c){_0x1d8f5c=_0x94b84c[_0x03c4('0x54')];var _0x33a299=_0x1d8f5c[_0x03c4('0x58')](-0x1);if(_0x33a299==='/'){_0x1d8f5c=_0x1d8f5c[_0x03c4('0x59')](0x0,_0x1d8f5c[_0x03c4('0x5a')](_0x33a299));}_0x50c31d=new jsforce[(_0x03c4('0x5b'))]({'oauth2':{'loginUrl':_0x1d8f5c,'clientId':_0x94b84c[_0x03c4('0x55')],'clientSecret':_0x94b84c['clientSecret']}});return _0x50c31d[_0x03c4('0x5c')](_0x94b84c[_0x03c4('0x5d')],_0x94b84c[_0x03c4('0x5e')][_0x03c4('0x5f')](_0x94b84c[_0x03c4('0x57')]));}})[_0x03c4('0x23')](function(_0x3a4f49){if(_0x3a4f49){if(!_[_0x03c4('0x60')](_0x3b5842[_0x03c4('0x2d')]['ticketType'])){_0xc6e9d6=_0x3b5842[_0x03c4('0x2d')][_0x03c4('0x61')];}return _0x50c31d[_0x03c4('0x62')](_0xc6e9d6)[_0x03c4('0x63')]();}})[_0x03c4('0x23')](function(_0x20ae17){var _0x474ac8=['OwnerId','ActivityDate',_0x03c4('0x64'),'IsRecurrence','Subject','Description'];var _0x1d9811=[_0x03c4('0x65'),_0x03c4('0x66'),_0x03c4('0x67'),_0x03c4('0x68'),_0x03c4('0x69'),_0x03c4('0x6a'),'phone'];if(_0x20ae17){_[_0x03c4('0x6b')](_0x20ae17[_0x03c4('0x32')],function(_0x5ba583){return _0x474ac8[_0x03c4('0x6c')](_0x5ba583[_0x03c4('0x25')])||!_0x1d9811['includes'](_0x5ba583[_0x03c4('0x2a')]);});return{'count':_0x20ae17[_0x03c4('0x32')][_0x03c4('0x33')],'rows':_[_0x03c4('0x27')](_0x20ae17[_0x03c4('0x32')],function(_0x4fc5b6){return{'id':_0x4fc5b6[_0x03c4('0x25')],'name':_0x4fc5b6['label'],'custom':_0x4fc5b6['custom'],'options':_0x4fc5b6[_0x03c4('0x6d')][_0x03c4('0x33')]>0x0?_[_0x03c4('0x27')](_0x4fc5b6[_0x03c4('0x6d')],function(_0x87ac37){return{'name':_0x87ac37[_0x03c4('0x6e')],'value':_0x87ac37['value']};}):_0x4fc5b6[_0x03c4('0x2a')]==_0x03c4('0x68')?[{'name':'True','value':_0x03c4('0x6f')},{'name':_0x03c4('0x70'),'value':'false'}]:[]};})};}})[_0x03c4('0x23')](respondWithResult(_0x388999,null))[_0x03c4('0x44')](function(_0x1944e7){var _0x4666aa=_0x3b5842[_0x03c4('0x2d')][_0x03c4('0x71')]?0x1f4:_0x1944e7[_0x03c4('0x72')]||0x1f4;logger[_0x03c4('0x24')](_0x03c4('0x73'),_0x03c4('0x52'),_0x4666aa,JSON[_0x03c4('0x74')](_0x1944e7));delete _0x1944e7[_0x03c4('0x25')];if(_0x4666aa===0x191){_0x4666aa=0x190;}_0x388999['status'](_0x4666aa)[_0x03c4('0x26')](_0x3b5842[_0x03c4('0x2d')][_0x03c4('0x71')]?{'message':_0x03c4('0x75'),'statusCode':_0x1944e7[_0x03c4('0x72')]}:_0x1944e7);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index e7f876e..06eaf78 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 _0x3f43=['bluebird','path','../../config/environment','../../components/integrations/configuration','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','moment'];(function(_0x55d2ed,_0x4c35ed){var _0xc42e98=function(_0x4c9d8f){while(--_0x4c9d8f){_0x55d2ed['push'](_0x55d2ed['shift']());}};_0xc42e98(++_0x4c35ed);}(_0x3f43,0x1e6));var _0x33f4=function(_0x25a707,_0x18ebaf){_0x25a707=_0x25a707-0x0;var _0x19373c=_0x3f43[_0x25a707];return _0x19373c;};'use strict';var _=require(_0x33f4('0x0'));var util=require(_0x33f4('0x1'));var logger=require(_0x33f4('0x2'))('api');var moment=require(_0x33f4('0x3'));var BPromise=require(_0x33f4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x33f4('0x5'));var rimraf=require('rimraf');var config=require(_0x33f4('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x33f4('0x7'));module['exports']=function(_0x1a6ae9,_0xf019e8){return _0x1a6ae9['define'](_0x33f4('0x8'),attributes,{'tableName':_0x33f4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0773=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts','lodash','util'];(function(_0x89021b,_0x3ad200){var _0x5e2de2=function(_0x1755c1){while(--_0x1755c1){_0x89021b['push'](_0x89021b['shift']());}};_0x5e2de2(++_0x3ad200);}(_0x0773,0x1da));var _0x3077=function(_0x511530,_0x2b4dac){_0x511530=_0x511530-0x0;var _0xb5f6b1=_0x0773[_0x511530];return _0xb5f6b1;};'use strict';var _=require(_0x3077('0x0'));var util=require(_0x3077('0x1'));var logger=require(_0x3077('0x2'))(_0x3077('0x3'));var moment=require(_0x3077('0x4'));var BPromise=require(_0x3077('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3077('0x6'));var rimraf=require(_0x3077('0x7'));var config=require(_0x3077('0x8'));var attributes=require(_0x3077('0x9'));var integrations=require(_0x3077('0xa'));module[_0x3077('0xb')]=function(_0x47cb09,_0x2659f5){return _0x47cb09['define'](_0x3077('0xc'),attributes,{'tableName':_0x3077('0xd'),'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 1b390c2..8e5fcce 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 _0xaaee=['options','raw','include','map','model','attributes','GetSalesforceAccount','ShowSalesforceAccount','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','SalesforceAccount'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xaaee,0xa9));var _0xeaae=function(_0x4b3fbb,_0x50a7a4){_0x4b3fbb=_0x4b3fbb-0x0;var _0x2337cd=_0xaaee[_0x4b3fbb];return _0x2337cd;};'use strict';var _=require(_0xeaae('0x0'));var util=require('util');var moment=require(_0xeaae('0x1'));var BPromise=require(_0xeaae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeaae('0x3'));var db=require(_0xeaae('0x4'))['db'];var utils=require(_0xeaae('0x5'));var logger=require(_0xeaae('0x6'))('rpc');var config=require(_0xeaae('0x7'));var jayson=require(_0xeaae('0x8'));var client=jayson[_0xeaae('0x9')][_0xeaae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3633ec,_0x30422f,_0x58b332){return new BPromise(function(_0x275d1c,_0x1701a9){return client[_0xeaae('0xb')](_0x3633ec,_0x58b332)[_0xeaae('0xc')](function(_0x3ec6d0){logger[_0xeaae('0xd')](_0xeaae('0xe'),_0x30422f,_0xeaae('0xf'));logger[_0xeaae('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x30422f,_0xeaae('0xf'),JSON[_0xeaae('0x11')](_0x3ec6d0));if(_0x3ec6d0[_0xeaae('0x12')]){if(_0x3ec6d0['error']['code']===0x1f4){logger[_0xeaae('0x12')](_0xeaae('0xe'),_0x30422f,_0x3ec6d0[_0xeaae('0x12')]['message']);return _0x1701a9(_0x3ec6d0[_0xeaae('0x12')][_0xeaae('0x13')]);}logger[_0xeaae('0x12')](_0xeaae('0xe'),_0x30422f,_0x3ec6d0['error']['message']);return _0x275d1c(_0x3ec6d0[_0xeaae('0x12')][_0xeaae('0x13')]);}else{logger[_0xeaae('0xd')](_0xeaae('0xe'),_0x30422f,'request\x20sent');_0x275d1c(_0x3ec6d0[_0xeaae('0x14')]['message']);}})[_0xeaae('0x15')](function(_0x1184c4){logger[_0xeaae('0x12')](_0xeaae('0xe'),_0x30422f,_0x1184c4);_0x1701a9(_0x1184c4);});});}exports['GetSalesforceAccount']=function(_0x538e3d){var _0x5d5aa1=this;return new Promise(function(_0x5b44f5,_0x394d9b){return db[_0xeaae('0x16')]['findAll']({'raw':_0x538e3d[_0xeaae('0x17')]?_0x538e3d['options'][_0xeaae('0x18')]===undefined?!![]:![]:!![],'where':_0x538e3d[_0xeaae('0x17')]?_0x538e3d[_0xeaae('0x17')]['where']||null:null,'attributes':_0x538e3d[_0xeaae('0x17')]?_0x538e3d[_0xeaae('0x17')]['attributes']||null:null,'limit':_0x538e3d['options']?_0x538e3d[_0xeaae('0x17')]['limit']||null:null,'include':_0x538e3d['options']?_0x538e3d[_0xeaae('0x17')][_0xeaae('0x19')]?_[_0xeaae('0x1a')](_0x538e3d[_0xeaae('0x17')][_0xeaae('0x19')],function(_0x41739e){return{'model':db[_0x41739e[_0xeaae('0x1b')]],'as':_0x41739e['as'],'attributes':_0x41739e[_0xeaae('0x1c')],'include':_0x41739e[_0xeaae('0x19')]?_[_0xeaae('0x1a')](_0x41739e['include'],function(_0xa7fa13){return{'model':db[_0xa7fa13[_0xeaae('0x1b')]],'as':_0xa7fa13['as'],'attributes':_0xa7fa13[_0xeaae('0x1c')],'include':_0xa7fa13[_0xeaae('0x19')]?_[_0xeaae('0x1a')](_0xa7fa13[_0xeaae('0x19')],function(_0x145b46){return{'model':db[_0x145b46[_0xeaae('0x1b')]],'as':_0x145b46['as'],'attributes':_0x145b46['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x261ccd){logger[_0xeaae('0xd')](_0xeaae('0x1d'),_0x538e3d);logger['debug'](_0xeaae('0x1d'),_0x538e3d,JSON[_0xeaae('0x11')](_0x261ccd));_0x5b44f5(_0x261ccd);})[_0xeaae('0x15')](function(_0x14a68a){logger[_0xeaae('0x12')](_0xeaae('0x1d'),_0x14a68a[_0xeaae('0x13')],_0x538e3d);_0x394d9b(_0x5d5aa1[_0xeaae('0x12')](0x1f4,_0x14a68a[_0xeaae('0x13')]));});});};exports[_0xeaae('0x1e')]=function(_0x48aeca){var _0x43a759=this;return new Promise(function(_0x2363fa,_0x4c938f){return db['SalesforceAccount'][_0xeaae('0x1f')]({'raw':_0x48aeca['options']?_0x48aeca[_0xeaae('0x17')][_0xeaae('0x18')]===undefined?!![]:![]:!![],'where':_0x48aeca[_0xeaae('0x17')]?_0x48aeca['options']['where']||null:null,'attributes':_0x48aeca['options']?_0x48aeca[_0xeaae('0x17')]['attributes']||null:null,'include':_0x48aeca[_0xeaae('0x17')]?_0x48aeca[_0xeaae('0x17')][_0xeaae('0x19')]?_['map'](_0x48aeca[_0xeaae('0x17')][_0xeaae('0x19')],function(_0x1c606b){return{'model':db[_0x1c606b[_0xeaae('0x1b')]],'as':_0x1c606b['as'],'attributes':_0x1c606b[_0xeaae('0x1c')],'include':_0x1c606b['include']?_[_0xeaae('0x1a')](_0x1c606b[_0xeaae('0x19')],function(_0x387a61){return{'model':db[_0x387a61[_0xeaae('0x1b')]],'as':_0x387a61['as'],'attributes':_0x387a61[_0xeaae('0x1c')],'include':_0x387a61[_0xeaae('0x19')]?_[_0xeaae('0x1a')](_0x387a61[_0xeaae('0x19')],function(_0x183b99){return{'model':db[_0x183b99[_0xeaae('0x1b')]],'as':_0x183b99['as'],'attributes':_0x183b99[_0xeaae('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5da64c){logger['info']('ShowSalesforceAccount',_0x48aeca);logger['debug'](_0xeaae('0x1e'),_0x48aeca,JSON['stringify'](_0x5da64c));_0x2363fa(_0x5da64c);})[_0xeaae('0x15')](function(_0x49f5a0){logger[_0xeaae('0x12')]('ShowSalesforceAccount',_0x49f5a0['message'],_0x48aeca);_0x4c938f(_0x43a759[_0xeaae('0x12')](0x1f4,_0x49f5a0[_0xeaae('0x13')]));});});}; \ No newline at end of file +var _0xfaa7=['debug','ShowSalesforceAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x4c3ffe,_0x457374){var _0x28d3eb=function(_0x3ae2a3){while(--_0x3ae2a3){_0x4c3ffe['push'](_0x4c3ffe['shift']());}};_0x28d3eb(++_0x457374);}(_0xfaa7,0x123));var _0x7faa=function(_0xe59aef,_0x3ca5b8){_0xe59aef=_0xe59aef-0x0;var _0x10378c=_0xfaa7[_0xe59aef];return _0x10378c;};'use strict';var _=require('lodash');var util=require(_0x7faa('0x0'));var moment=require(_0x7faa('0x1'));var BPromise=require(_0x7faa('0x2'));var rs=require(_0x7faa('0x3'));var fs=require('fs');var Redis=require(_0x7faa('0x4'));var db=require(_0x7faa('0x5'))['db'];var utils=require(_0x7faa('0x6'));var logger=require('../../config/logger')(_0x7faa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7faa('0x8')][_0x7faa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2da941,_0x22ec1a,_0x307b7b){return new BPromise(function(_0x2021cc,_0x682246){return client[_0x7faa('0xa')](_0x2da941,_0x307b7b)[_0x7faa('0xb')](function(_0x2fbbde){logger[_0x7faa('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x22ec1a,_0x7faa('0xd'));logger['debug'](_0x7faa('0xe'),_0x22ec1a,_0x7faa('0xd'),JSON[_0x7faa('0xf')](_0x2fbbde));if(_0x2fbbde[_0x7faa('0x10')]){if(_0x2fbbde[_0x7faa('0x10')][_0x7faa('0x11')]===0x1f4){logger['error'](_0x7faa('0x12'),_0x22ec1a,_0x2fbbde[_0x7faa('0x10')][_0x7faa('0x13')]);return _0x682246(_0x2fbbde[_0x7faa('0x10')]['message']);}logger[_0x7faa('0x10')](_0x7faa('0x12'),_0x22ec1a,_0x2fbbde[_0x7faa('0x10')][_0x7faa('0x13')]);return _0x2021cc(_0x2fbbde[_0x7faa('0x10')][_0x7faa('0x13')]);}else{logger[_0x7faa('0xc')](_0x7faa('0x12'),_0x22ec1a,_0x7faa('0xd'));_0x2021cc(_0x2fbbde[_0x7faa('0x14')]['message']);}})[_0x7faa('0x15')](function(_0x2c354a){logger[_0x7faa('0x10')](_0x7faa('0x12'),_0x22ec1a,_0x2c354a);_0x682246(_0x2c354a);});});}exports[_0x7faa('0x16')]=function(_0x370604){var _0x489150=this;return new Promise(function(_0x51dde2,_0x4e8948){return db[_0x7faa('0x17')][_0x7faa('0x18')]({'raw':_0x370604['options']?_0x370604[_0x7faa('0x19')][_0x7faa('0x1a')]===undefined?!![]:![]:!![],'where':_0x370604[_0x7faa('0x19')]?_0x370604[_0x7faa('0x19')][_0x7faa('0x1b')]||null:null,'attributes':_0x370604['options']?_0x370604['options'][_0x7faa('0x1c')]||null:null,'limit':_0x370604['options']?_0x370604['options'][_0x7faa('0x1d')]||null:null,'include':_0x370604[_0x7faa('0x19')]?_0x370604[_0x7faa('0x19')][_0x7faa('0x1e')]?_[_0x7faa('0x1f')](_0x370604[_0x7faa('0x19')][_0x7faa('0x1e')],function(_0x4b69ba){return{'model':db[_0x4b69ba[_0x7faa('0x20')]],'as':_0x4b69ba['as'],'attributes':_0x4b69ba['attributes'],'include':_0x4b69ba[_0x7faa('0x1e')]?_[_0x7faa('0x1f')](_0x4b69ba['include'],function(_0x1b9792){return{'model':db[_0x1b9792[_0x7faa('0x20')]],'as':_0x1b9792['as'],'attributes':_0x1b9792[_0x7faa('0x1c')],'include':_0x1b9792[_0x7faa('0x1e')]?_[_0x7faa('0x1f')](_0x1b9792['include'],function(_0x8e8760){return{'model':db[_0x8e8760[_0x7faa('0x20')]],'as':_0x8e8760['as'],'attributes':_0x8e8760['attributes']};}):[]};}):[]};}):[]:[]})[_0x7faa('0xb')](function(_0xab8fe5){logger[_0x7faa('0xc')](_0x7faa('0x16'),_0x370604);logger[_0x7faa('0x21')](_0x7faa('0x16'),_0x370604,JSON[_0x7faa('0xf')](_0xab8fe5));_0x51dde2(_0xab8fe5);})[_0x7faa('0x15')](function(_0x1460a8){logger[_0x7faa('0x10')](_0x7faa('0x16'),_0x1460a8[_0x7faa('0x13')],_0x370604);_0x4e8948(_0x489150[_0x7faa('0x10')](0x1f4,_0x1460a8[_0x7faa('0x13')]));});});};exports[_0x7faa('0x22')]=function(_0x372cb3){var _0x50417d=this;return new Promise(function(_0x3acf62,_0x2ac7bc){return db[_0x7faa('0x17')][_0x7faa('0x23')]({'raw':_0x372cb3[_0x7faa('0x19')]?_0x372cb3[_0x7faa('0x19')][_0x7faa('0x1a')]===undefined?!![]:![]:!![],'where':_0x372cb3[_0x7faa('0x19')]?_0x372cb3[_0x7faa('0x19')][_0x7faa('0x1b')]||null:null,'attributes':_0x372cb3[_0x7faa('0x19')]?_0x372cb3[_0x7faa('0x19')]['attributes']||null:null,'include':_0x372cb3['options']?_0x372cb3[_0x7faa('0x19')][_0x7faa('0x1e')]?_[_0x7faa('0x1f')](_0x372cb3['options']['include'],function(_0x504b2d){return{'model':db[_0x504b2d['model']],'as':_0x504b2d['as'],'attributes':_0x504b2d[_0x7faa('0x1c')],'include':_0x504b2d[_0x7faa('0x1e')]?_['map'](_0x504b2d[_0x7faa('0x1e')],function(_0x150b21){return{'model':db[_0x150b21[_0x7faa('0x20')]],'as':_0x150b21['as'],'attributes':_0x150b21['attributes'],'include':_0x150b21[_0x7faa('0x1e')]?_[_0x7faa('0x1f')](_0x150b21[_0x7faa('0x1e')],function(_0x54db3d){return{'model':db[_0x54db3d['model']],'as':_0x54db3d['as'],'attributes':_0x54db3d[_0x7faa('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7faa('0xb')](function(_0x30b291){logger[_0x7faa('0xc')](_0x7faa('0x22'),_0x372cb3);logger[_0x7faa('0x21')](_0x7faa('0x22'),_0x372cb3,JSON[_0x7faa('0xf')](_0x30b291));_0x3acf62(_0x30b291);})[_0x7faa('0x15')](function(_0x409fa1){logger[_0x7faa('0x10')](_0x7faa('0x22'),_0x409fa1[_0x7faa('0x13')],_0x372cb3);_0x2ac7bc(_0x50417d[_0x7faa('0x10')](0x1f4,_0x409fa1[_0x7faa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index d022ff6..029563b 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 _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x38f949,_0x204705){var _0x594ec7=function(_0x37fd8c){while(--_0x37fd8c){_0x38f949['push'](_0x38f949['shift']());}};_0x594ec7(++_0x204705);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1cb7dc,_0x520430){_0x1cb7dc=_0x1cb7dc-0x0;var _0x570a66=_0x5f2f[_0x1cb7dc];return _0x570a66;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file +var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x550df5,_0x1bda30){var _0x107ed6=function(_0x10e1bc){while(--_0x10e1bc){_0x550df5['push'](_0x550df5['shift']());}};_0x107ed6(++_0x1bda30);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5e1b6b,_0x5183d6){_0x5e1b6b=_0x5e1b6b-0x0;var _0x16f2f2=_0x5f2f[_0x5e1b6b];return _0x16f2f2;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('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 5ef12c4..898003a 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 _0xafbd=['account_contact_lead','account','lead','sequelize','STRING','ENUM','Task','contact'];(function(_0xb33373,_0x9af59b){var _0x19fa63=function(_0x2e5879){while(--_0x2e5879){_0xb33373['push'](_0xb33373['shift']());}};_0x19fa63(++_0x9af59b);}(_0xafbd,0x1ab));var _0xdafb=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0xafbd[_0x44d9ab];return _0x31485e;};'use strict';var Sequelize=require(_0xdafb('0x0'));module['exports']={'name':{'type':Sequelize[_0xdafb('0x1')]},'description':{'type':Sequelize[_0xdafb('0x1')]},'ticketType':{'type':Sequelize[_0xdafb('0x2')](_0xdafb('0x3'),'Case'),'defaultValue':_0xdafb('0x3')},'moduleSearch':{'type':Sequelize[_0xdafb('0x2')]('contact_lead',_0xdafb('0x4'),'lead',_0xdafb('0x5'),_0xdafb('0x6')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xdafb('0x2')]('nothing',_0xdafb('0x4'),_0xdafb('0x7'),_0xdafb('0x6')),'defaultValue':_0xdafb('0x7')},'leadId':{'type':Sequelize[_0xdafb('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xdafb('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xdafb('0x1')]}}; \ No newline at end of file +var _0xf79b=['exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account'];(function(_0x320c04,_0x21ef13){var _0x252297=function(_0x22b5d8){while(--_0x22b5d8){_0x320c04['push'](_0x320c04['shift']());}};_0x252297(++_0x21ef13);}(_0xf79b,0xa0));var _0xbf79=function(_0x380e10,_0x444f2e){_0x380e10=_0x380e10-0x0;var _0x567b0a=_0xf79b[_0x380e10];return _0x567b0a;};'use strict';var Sequelize=require('sequelize');module[_0xbf79('0x0')]={'name':{'type':Sequelize[_0xbf79('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xbf79('0x2')](_0xbf79('0x3'),_0xbf79('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xbf79('0x2')](_0xbf79('0x5'),_0xbf79('0x6'),_0xbf79('0x7'),_0xbf79('0x8'),_0xbf79('0x9')),'defaultValue':_0xbf79('0x5')},'moduleCreate':{'type':Sequelize[_0xbf79('0x2')]('nothing',_0xbf79('0x6'),_0xbf79('0x7'),'account'),'defaultValue':_0xbf79('0x7')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xbf79('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xbf79('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 64a539b..372a8f9 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 _0x2bca=['hasOwnProperty','nolimit','limit','sort','where','filters','filter','merge','options','include','rows','show','params','keys','includeAll','create','body','catch','update','find','destroy','getFields','findOne','order','pick','getSubjects','getDescriptions','SalesforceField','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','error','stack','send','index','map','SalesforceConfiguration','rawAttributes','type','key','model','name','intersection','attributes','query','fields','length'];(function(_0x2a9146,_0x55b436){var _0xe06fdc=function(_0x152963){while(--_0x152963){_0x2a9146['push'](_0x2a9146['shift']());}};_0xe06fdc(++_0x55b436);}(_0x2bca,0xc6));var _0xa2bc=function(_0x309e88,_0x5c7f85){_0x309e88=_0x309e88-0x0;var _0x5a35ae=_0x2bca[_0x309e88];return _0x5a35ae;};'use strict';var emlformat=require(_0xa2bc('0x0'));var rimraf=require(_0xa2bc('0x1'));var zipdir=require(_0xa2bc('0x2'));var jsonpatch=require(_0xa2bc('0x3'));var rp=require(_0xa2bc('0x4'));var moment=require(_0xa2bc('0x5'));var BPromise=require(_0xa2bc('0x6'));var Mustache=require(_0xa2bc('0x7'));var util=require(_0xa2bc('0x8'));var path=require(_0xa2bc('0x9'));var sox=require('sox');var csv=require(_0xa2bc('0xa'));var ejs=require(_0xa2bc('0xb'));var fs=require('fs');var fs_extra=require(_0xa2bc('0xc'));var _=require(_0xa2bc('0xd'));var squel=require('squel');var crypto=require(_0xa2bc('0xe'));var jsforce=require(_0xa2bc('0xf'));var deskjs=require(_0xa2bc('0x10'));var toCsv=require(_0xa2bc('0xa'));var querystring=require(_0xa2bc('0x11'));var Papa=require(_0xa2bc('0x12'));var Redis=require(_0xa2bc('0x13'));var authService=require(_0xa2bc('0x14'));var qs=require(_0xa2bc('0x15'));var as=require(_0xa2bc('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2bc('0x17'))(_0xa2bc('0x18'));var utils=require(_0xa2bc('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xa2bc('0x1a'));var db=require(_0xa2bc('0x1b'))['db'];function respondWithStatusCode(_0x536c8b,_0x19d4f8){_0x19d4f8=_0x19d4f8||0xcc;return function(_0x169a53){if(_0x169a53){return _0x536c8b[_0xa2bc('0x1c')](_0x19d4f8);}return _0x536c8b[_0xa2bc('0x1d')](_0x19d4f8)[_0xa2bc('0x1e')]();};}function respondWithResult(_0x2f0618,_0x23aae6){_0x23aae6=_0x23aae6||0xc8;return function(_0x3ac4c2){if(_0x3ac4c2){return _0x2f0618[_0xa2bc('0x1d')](_0x23aae6)[_0xa2bc('0x1f')](_0x3ac4c2);}};}function respondWithFilteredResult(_0xa37bce,_0x30594e){return function(_0x3587e9){if(_0x3587e9){var _0x19241d=typeof _0x30594e[_0xa2bc('0x20')]===_0xa2bc('0x21')&&typeof _0x30594e['limit']===_0xa2bc('0x21');var _0x419f36=_0x3587e9[_0xa2bc('0x22')];var _0x4e719a=_0x19241d?0x0:_0x30594e[_0xa2bc('0x20')];var _0x2f28a1=_0x19241d?_0x3587e9['count']:_0x30594e[_0xa2bc('0x20')]+_0x30594e['limit'];var _0x2784b4;if(_0x2f28a1>=_0x419f36){_0x2f28a1=_0x419f36;_0x2784b4=0xc8;}else{_0x2784b4=0xce;}_0xa37bce[_0xa2bc('0x1d')](_0x2784b4);return _0xa37bce[_0xa2bc('0x23')](_0xa2bc('0x24'),_0x4e719a+'-'+_0x2f28a1+'/'+_0x419f36)[_0xa2bc('0x1f')](_0x3587e9);}return null;};}function patchUpdates(_0x18dde0){return function(_0xd4fc01){try{jsonpatch[_0xa2bc('0x25')](_0xd4fc01,_0x18dde0,!![]);}catch(_0x1114e3){return BPromise[_0xa2bc('0x26')](_0x1114e3);}return _0xd4fc01[_0xa2bc('0x27')]();};}function saveUpdates(_0x512b44,_0x4876d9){return function(_0x26ec6e){if(_0x26ec6e){return _0x26ec6e['update'](_0x512b44)[_0xa2bc('0x28')](function(_0x3115f3){return _0x3115f3;});}return null;};}function removeEntity(_0x5a37c0,_0x239779){return function(_0x51c642){if(_0x51c642){return _0x51c642['destroy']()[_0xa2bc('0x28')](function(){_0x5a37c0[_0xa2bc('0x1d')](0xcc)[_0xa2bc('0x1e')]();});}};}function handleEntityNotFound(_0x1216c0,_0x34a54c){return function(_0x542884){if(!_0x542884){_0x1216c0[_0xa2bc('0x1c')](0x194);}return _0x542884;};}function handleError(_0x5d8843,_0x21940f){_0x21940f=_0x21940f||0x1f4;return function(_0x339aed){logger[_0xa2bc('0x29')](_0x339aed[_0xa2bc('0x2a')]);if(_0x339aed['name']){delete _0x339aed['name'];}_0x5d8843['status'](_0x21940f)[_0xa2bc('0x2b')](_0x339aed);};}exports[_0xa2bc('0x2c')]=function(_0xfe5362,_0xd4648c){var _0x10692d={},_0x576a83={},_0x55329f={'count':0x0,'rows':[]};var _0x158a3e=_[_0xa2bc('0x2d')](db[_0xa2bc('0x2e')][_0xa2bc('0x2f')],function(_0x2ef1cc){return{'name':_0x2ef1cc['fieldName'],'type':_0x2ef1cc[_0xa2bc('0x30')][_0xa2bc('0x31')]};});_0x576a83[_0xa2bc('0x32')]=_[_0xa2bc('0x2d')](_0x158a3e,_0xa2bc('0x33'));_0x576a83['query']=_['keys'](_0xfe5362['query']);_0x576a83['filters']=_[_0xa2bc('0x34')](_0x576a83[_0xa2bc('0x32')],_0x576a83['query']);_0x10692d[_0xa2bc('0x35')]=_[_0xa2bc('0x34')](_0x576a83['model'],qs['fields'](_0xfe5362[_0xa2bc('0x36')][_0xa2bc('0x37')]));_0x10692d[_0xa2bc('0x35')]=_0x10692d[_0xa2bc('0x35')][_0xa2bc('0x38')]?_0x10692d[_0xa2bc('0x35')]:_0x576a83[_0xa2bc('0x32')];if(!_0xfe5362['query'][_0xa2bc('0x39')](_0xa2bc('0x3a'))){_0x10692d[_0xa2bc('0x3b')]=qs[_0xa2bc('0x3b')](_0xfe5362[_0xa2bc('0x36')]['limit']);_0x10692d[_0xa2bc('0x20')]=qs[_0xa2bc('0x20')](_0xfe5362[_0xa2bc('0x36')][_0xa2bc('0x20')]);}_0x10692d['order']=qs['sort'](_0xfe5362[_0xa2bc('0x36')][_0xa2bc('0x3c')]);_0x10692d[_0xa2bc('0x3d')]=qs['filters'](_['pick'](_0xfe5362[_0xa2bc('0x36')],_0x576a83[_0xa2bc('0x3e')]),_0x158a3e);if(_0xfe5362[_0xa2bc('0x36')]['filter']){_0x10692d[_0xa2bc('0x3d')]=_['merge'](_0x10692d[_0xa2bc('0x3d')],{'$or':_['map'](_0x158a3e,function(_0x1a125e){if(_0x1a125e['type']!=='VIRTUAL'){var _0xee1986={};_0xee1986[_0x1a125e[_0xa2bc('0x33')]]={'$like':'%'+_0xfe5362[_0xa2bc('0x36')][_0xa2bc('0x3f')]+'%'};return _0xee1986;}})});}_0x10692d=_[_0xa2bc('0x40')]({},_0x10692d,_0xfe5362[_0xa2bc('0x41')]);var _0x32b99d={'where':_0x10692d[_0xa2bc('0x3d')]};return db[_0xa2bc('0x2e')]['count'](_0x32b99d)[_0xa2bc('0x28')](function(_0x583254){_0x55329f[_0xa2bc('0x22')]=_0x583254;if(_0xfe5362[_0xa2bc('0x36')]['includeAll']){_0x10692d[_0xa2bc('0x42')]=[{'all':!![]}];}return db[_0xa2bc('0x2e')]['findAll'](_0x10692d);})['then'](function(_0x481f63){_0x55329f[_0xa2bc('0x43')]=_0x481f63;return _0x55329f;})['then'](respondWithFilteredResult(_0xd4648c,_0x10692d))['catch'](handleError(_0xd4648c,null));};exports[_0xa2bc('0x44')]=function(_0x4859be,_0x944e6c){var _0x2d8ba1={'raw':![],'where':{'id':_0x4859be[_0xa2bc('0x45')]['id']}},_0x43b1b7={};_0x43b1b7[_0xa2bc('0x32')]=_['keys'](db[_0xa2bc('0x2e')]['rawAttributes']);_0x43b1b7[_0xa2bc('0x36')]=_[_0xa2bc('0x46')](_0x4859be[_0xa2bc('0x36')]);_0x43b1b7[_0xa2bc('0x3e')]=_[_0xa2bc('0x34')](_0x43b1b7['model'],_0x43b1b7[_0xa2bc('0x36')]);_0x2d8ba1[_0xa2bc('0x35')]=_['intersection'](_0x43b1b7[_0xa2bc('0x32')],qs[_0xa2bc('0x37')](_0x4859be['query'][_0xa2bc('0x37')]));_0x2d8ba1['attributes']=_0x2d8ba1['attributes'][_0xa2bc('0x38')]?_0x2d8ba1[_0xa2bc('0x35')]:_0x43b1b7['model'];if(_0x4859be[_0xa2bc('0x36')][_0xa2bc('0x47')]){_0x2d8ba1[_0xa2bc('0x42')]=[{'all':!![]}];}_0x2d8ba1=_['merge']({},_0x2d8ba1,_0x4859be[_0xa2bc('0x41')]);return db[_0xa2bc('0x2e')]['find'](_0x2d8ba1)[_0xa2bc('0x28')](handleEntityNotFound(_0x944e6c,null))[_0xa2bc('0x28')](respondWithResult(_0x944e6c,null))['catch'](handleError(_0x944e6c,null));};exports[_0xa2bc('0x48')]=function(_0x378b58,_0x598dbc){return db[_0xa2bc('0x2e')][_0xa2bc('0x48')](_0x378b58[_0xa2bc('0x49')],{})[_0xa2bc('0x28')](respondWithResult(_0x598dbc,0xc9))[_0xa2bc('0x4a')](handleError(_0x598dbc,null));};exports[_0xa2bc('0x4b')]=function(_0x50eb47,_0x15d2c6){if(_0x50eb47[_0xa2bc('0x49')]['id']){delete _0x50eb47['body']['id'];}return db['SalesforceConfiguration'][_0xa2bc('0x4c')]({'where':{'id':_0x50eb47[_0xa2bc('0x45')]['id']}})['then'](handleEntityNotFound(_0x15d2c6,null))[_0xa2bc('0x28')](saveUpdates(_0x50eb47[_0xa2bc('0x49')],null))[_0xa2bc('0x28')](respondWithResult(_0x15d2c6,null))[_0xa2bc('0x4a')](handleError(_0x15d2c6,null));};exports[_0xa2bc('0x4d')]=function(_0xa59cf9,_0x269196){return db[_0xa2bc('0x2e')][_0xa2bc('0x4c')]({'where':{'id':_0xa59cf9[_0xa2bc('0x45')]['id']}})[_0xa2bc('0x28')](handleEntityNotFound(_0x269196,null))[_0xa2bc('0x28')](removeEntity(_0x269196,null))[_0xa2bc('0x4a')](handleError(_0x269196,null));};exports[_0xa2bc('0x4e')]=function(_0x454d7c,_0x24f03c,_0x4c16d8){var _0x43a2a7={};var _0x196fa6={};var _0x17acc2;var _0x48b964;return db[_0xa2bc('0x2e')][_0xa2bc('0x4f')]({'where':{'id':_0x454d7c[_0xa2bc('0x45')]['id']}})[_0xa2bc('0x28')](handleEntityNotFound(_0x24f03c,null))[_0xa2bc('0x28')](function(_0x2706e5){if(_0x2706e5){_0x17acc2=_0x2706e5;_0x196fa6[_0xa2bc('0x32')]=_['keys'](db['SalesforceField'][_0xa2bc('0x2f')]);_0x196fa6[_0xa2bc('0x36')]=_[_0xa2bc('0x46')](_0x454d7c[_0xa2bc('0x36')]);_0x196fa6[_0xa2bc('0x3e')]=_[_0xa2bc('0x34')](_0x196fa6[_0xa2bc('0x32')],_0x196fa6['query']);_0x43a2a7[_0xa2bc('0x35')]=_[_0xa2bc('0x34')](_0x196fa6[_0xa2bc('0x32')],qs['fields'](_0x454d7c[_0xa2bc('0x36')][_0xa2bc('0x37')]));_0x43a2a7[_0xa2bc('0x35')]=_0x43a2a7[_0xa2bc('0x35')][_0xa2bc('0x38')]?_0x43a2a7[_0xa2bc('0x35')]:_0x196fa6['model'];_0x43a2a7[_0xa2bc('0x50')]=qs[_0xa2bc('0x3c')](_0x454d7c[_0xa2bc('0x36')][_0xa2bc('0x3c')]);_0x43a2a7[_0xa2bc('0x3d')]=qs[_0xa2bc('0x3e')](_[_0xa2bc('0x51')](_0x454d7c['query'],_0x196fa6[_0xa2bc('0x3e')]));if(_0x454d7c[_0xa2bc('0x36')][_0xa2bc('0x3f')]){_0x43a2a7[_0xa2bc('0x3d')]=_['merge'](_0x43a2a7[_0xa2bc('0x3d')],{'$or':_[_0xa2bc('0x2d')](_0x43a2a7[_0xa2bc('0x35')],function(_0x1484d7){var _0x40c5de={};_0x40c5de[_0x1484d7]={'$like':'%'+_0x454d7c[_0xa2bc('0x36')]['filter']+'%'};return _0x40c5de;})});}_0x43a2a7=_[_0xa2bc('0x40')]({},_0x43a2a7,_0x454d7c[_0xa2bc('0x41')]);return _0x17acc2[_0xa2bc('0x4e')](_0x43a2a7);}})['then'](function(_0x21f0b1){if(_0x21f0b1){_0x48b964=_0x21f0b1[_0xa2bc('0x38')];if(!_0x454d7c[_0xa2bc('0x36')][_0xa2bc('0x39')](_0xa2bc('0x3a'))){_0x43a2a7[_0xa2bc('0x3b')]=qs[_0xa2bc('0x3b')](_0x454d7c[_0xa2bc('0x36')][_0xa2bc('0x3b')]);_0x43a2a7[_0xa2bc('0x20')]=qs['offset'](_0x454d7c[_0xa2bc('0x36')][_0xa2bc('0x20')]);}return _0x17acc2[_0xa2bc('0x4e')](_0x43a2a7);}})[_0xa2bc('0x28')](function(_0x51d399){if(_0x51d399){return _0x51d399?{'count':_0x48b964,'rows':_0x51d399}:null;}})[_0xa2bc('0x28')](respondWithResult(_0x24f03c,null))[_0xa2bc('0x4a')](handleError(_0x24f03c,null));};exports[_0xa2bc('0x52')]=function(_0x4a2f22,_0x28e259,_0x53b65d){var _0xe92aef={};var _0x1cf628={};var _0x31b738;var _0x2e024c;return db[_0xa2bc('0x2e')][_0xa2bc('0x4f')]({'where':{'id':_0x4a2f22[_0xa2bc('0x45')]['id']}})[_0xa2bc('0x28')](handleEntityNotFound(_0x28e259,null))['then'](function(_0x58ae8f){if(_0x58ae8f){_0x31b738=_0x58ae8f;_0x1cf628['model']=_[_0xa2bc('0x46')](db['SalesforceField'][_0xa2bc('0x2f')]);_0x1cf628[_0xa2bc('0x36')]=_[_0xa2bc('0x46')](_0x4a2f22[_0xa2bc('0x36')]);_0x1cf628[_0xa2bc('0x3e')]=_[_0xa2bc('0x34')](_0x1cf628[_0xa2bc('0x32')],_0x1cf628[_0xa2bc('0x36')]);_0xe92aef['attributes']=_['intersection'](_0x1cf628['model'],qs['fields'](_0x4a2f22[_0xa2bc('0x36')][_0xa2bc('0x37')]));_0xe92aef[_0xa2bc('0x35')]=_0xe92aef[_0xa2bc('0x35')][_0xa2bc('0x38')]?_0xe92aef[_0xa2bc('0x35')]:_0x1cf628[_0xa2bc('0x32')];_0xe92aef[_0xa2bc('0x50')]=qs[_0xa2bc('0x3c')](_0x4a2f22[_0xa2bc('0x36')][_0xa2bc('0x3c')]);_0xe92aef['where']=qs[_0xa2bc('0x3e')](_[_0xa2bc('0x51')](_0x4a2f22[_0xa2bc('0x36')],_0x1cf628[_0xa2bc('0x3e')]));if(_0x4a2f22['query'][_0xa2bc('0x3f')]){_0xe92aef[_0xa2bc('0x3d')]=_[_0xa2bc('0x40')](_0xe92aef[_0xa2bc('0x3d')],{'$or':_['map'](_0xe92aef[_0xa2bc('0x35')],function(_0x1b0640){var _0x337761={};_0x337761[_0x1b0640]={'$like':'%'+_0x4a2f22['query'][_0xa2bc('0x3f')]+'%'};return _0x337761;})});}_0xe92aef=_[_0xa2bc('0x40')]({},_0xe92aef,_0x4a2f22[_0xa2bc('0x41')]);return _0x31b738['getSubjects'](_0xe92aef);}})[_0xa2bc('0x28')](function(_0x4fe4d0){if(_0x4fe4d0){_0x2e024c=_0x4fe4d0[_0xa2bc('0x38')];if(!_0x4a2f22[_0xa2bc('0x36')][_0xa2bc('0x39')](_0xa2bc('0x3a'))){_0xe92aef[_0xa2bc('0x3b')]=qs['limit'](_0x4a2f22[_0xa2bc('0x36')][_0xa2bc('0x3b')]);_0xe92aef[_0xa2bc('0x20')]=qs[_0xa2bc('0x20')](_0x4a2f22[_0xa2bc('0x36')]['offset']);}return _0x31b738[_0xa2bc('0x52')](_0xe92aef);}})[_0xa2bc('0x28')](function(_0x55884f){if(_0x55884f){return _0x55884f?{'count':_0x2e024c,'rows':_0x55884f}:null;}})[_0xa2bc('0x28')](respondWithResult(_0x28e259,null))['catch'](handleError(_0x28e259,null));};exports[_0xa2bc('0x53')]=function(_0x3a7c50,_0x5e5b63,_0x1e0480){var _0x61b438={};var _0x978205={};var _0x1aa940;var _0x59d474;return db[_0xa2bc('0x2e')][_0xa2bc('0x4f')]({'where':{'id':_0x3a7c50[_0xa2bc('0x45')]['id']}})[_0xa2bc('0x28')](handleEntityNotFound(_0x5e5b63,null))[_0xa2bc('0x28')](function(_0x3222e4){if(_0x3222e4){_0x1aa940=_0x3222e4;_0x978205['model']=_[_0xa2bc('0x46')](db[_0xa2bc('0x54')][_0xa2bc('0x2f')]);_0x978205[_0xa2bc('0x36')]=_['keys'](_0x3a7c50['query']);_0x978205[_0xa2bc('0x3e')]=_[_0xa2bc('0x34')](_0x978205['model'],_0x978205[_0xa2bc('0x36')]);_0x61b438[_0xa2bc('0x35')]=_[_0xa2bc('0x34')](_0x978205[_0xa2bc('0x32')],qs['fields'](_0x3a7c50['query']['fields']));_0x61b438['attributes']=_0x61b438['attributes'][_0xa2bc('0x38')]?_0x61b438[_0xa2bc('0x35')]:_0x978205[_0xa2bc('0x32')];_0x61b438['order']=qs[_0xa2bc('0x3c')](_0x3a7c50[_0xa2bc('0x36')][_0xa2bc('0x3c')]);_0x61b438['where']=qs['filters'](_[_0xa2bc('0x51')](_0x3a7c50['query'],_0x978205[_0xa2bc('0x3e')]));if(_0x3a7c50[_0xa2bc('0x36')][_0xa2bc('0x3f')]){_0x61b438[_0xa2bc('0x3d')]=_['merge'](_0x61b438[_0xa2bc('0x3d')],{'$or':_[_0xa2bc('0x2d')](_0x61b438[_0xa2bc('0x35')],function(_0x7474b5){var _0x3301c5={};_0x3301c5[_0x7474b5]={'$like':'%'+_0x3a7c50[_0xa2bc('0x36')][_0xa2bc('0x3f')]+'%'};return _0x3301c5;})});}_0x61b438=_[_0xa2bc('0x40')]({},_0x61b438,_0x3a7c50[_0xa2bc('0x41')]);return _0x1aa940[_0xa2bc('0x53')](_0x61b438);}})[_0xa2bc('0x28')](function(_0x2cfda2){if(_0x2cfda2){_0x59d474=_0x2cfda2[_0xa2bc('0x38')];if(!_0x3a7c50[_0xa2bc('0x36')][_0xa2bc('0x39')](_0xa2bc('0x3a'))){_0x61b438[_0xa2bc('0x3b')]=qs[_0xa2bc('0x3b')](_0x3a7c50['query']['limit']);_0x61b438[_0xa2bc('0x20')]=qs['offset'](_0x3a7c50[_0xa2bc('0x36')]['offset']);}return _0x1aa940[_0xa2bc('0x53')](_0x61b438);}})[_0xa2bc('0x28')](function(_0x455bcc){if(_0x455bcc){return _0x455bcc?{'count':_0x59d474,'rows':_0x455bcc}:null;}})[_0xa2bc('0x28')](respondWithResult(_0x5e5b63,null))[_0xa2bc('0x4a')](handleError(_0x5e5b63,null));}; \ No newline at end of file +var _0x70c8=['params','create','body','find','findOne','SalesforceField','pick','getFields','hasOwnProperty','getSubjects','getDescriptions','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','reject','save','update','then','destroy','end','error','name','send','index','map','SalesforceConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show'];(function(_0x6caf42,_0x140b1c){var _0x6c4652=function(_0x766cd9){while(--_0x766cd9){_0x6caf42['push'](_0x6caf42['shift']());}};_0x6c4652(++_0x140b1c);}(_0x70c8,0xa9));var _0x870c=function(_0x20abcc,_0x174bee){_0x20abcc=_0x20abcc-0x0;var _0x58b7af=_0x70c8[_0x20abcc];return _0x58b7af;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x870c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x870c('0x1'));var moment=require(_0x870c('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x870c('0x3'));var sox=require(_0x870c('0x4'));var csv=require(_0x870c('0x5'));var ejs=require(_0x870c('0x6'));var fs=require('fs');var fs_extra=require(_0x870c('0x7'));var _=require(_0x870c('0x8'));var squel=require(_0x870c('0x9'));var crypto=require(_0x870c('0xa'));var jsforce=require(_0x870c('0xb'));var deskjs=require(_0x870c('0xc'));var toCsv=require(_0x870c('0x5'));var querystring=require(_0x870c('0xd'));var Papa=require('papaparse');var Redis=require(_0x870c('0xe'));var authService=require(_0x870c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x870c('0x10'));var hardwareService=require(_0x870c('0x11'));var logger=require(_0x870c('0x12'))(_0x870c('0x13'));var utils=require('../../config/utils');var config=require(_0x870c('0x14'));var licenseUtil=require(_0x870c('0x15'));var db=require(_0x870c('0x16'))['db'];function respondWithStatusCode(_0x3f961f,_0xd70628){_0xd70628=_0xd70628||0xcc;return function(_0x312377){if(_0x312377){return _0x3f961f[_0x870c('0x17')](_0xd70628);}return _0x3f961f[_0x870c('0x18')](_0xd70628)['end']();};}function respondWithResult(_0x35d6a7,_0x2077c1){_0x2077c1=_0x2077c1||0xc8;return function(_0x1abd03){if(_0x1abd03){return _0x35d6a7['status'](_0x2077c1)[_0x870c('0x19')](_0x1abd03);}};}function respondWithFilteredResult(_0x211c91,_0xacf80f){return function(_0x1f5aae){if(_0x1f5aae){var _0x33e032=typeof _0xacf80f[_0x870c('0x1a')]===_0x870c('0x1b')&&typeof _0xacf80f['limit']===_0x870c('0x1b');var _0x1408e1=_0x1f5aae['count'];var _0x4796c0=_0x33e032?0x0:_0xacf80f[_0x870c('0x1a')];var _0x26a0e3=_0x33e032?_0x1f5aae['count']:_0xacf80f[_0x870c('0x1a')]+_0xacf80f[_0x870c('0x1c')];var _0x596615;if(_0x26a0e3>=_0x1408e1){_0x26a0e3=_0x1408e1;_0x596615=0xc8;}else{_0x596615=0xce;}_0x211c91[_0x870c('0x18')](_0x596615);return _0x211c91[_0x870c('0x1d')]('Content-Range',_0x4796c0+'-'+_0x26a0e3+'/'+_0x1408e1)[_0x870c('0x19')](_0x1f5aae);}return null;};}function patchUpdates(_0x81f710){return function(_0x2bcde3){try{jsonpatch['apply'](_0x2bcde3,_0x81f710,!![]);}catch(_0x2bc7cd){return BPromise[_0x870c('0x1e')](_0x2bc7cd);}return _0x2bcde3[_0x870c('0x1f')]();};}function saveUpdates(_0x15a07e,_0x49e0b7){return function(_0x2466f8){if(_0x2466f8){return _0x2466f8[_0x870c('0x20')](_0x15a07e)[_0x870c('0x21')](function(_0x32d7cd){return _0x32d7cd;});}return null;};}function removeEntity(_0x1287bf,_0x528cd5){return function(_0x18bd3c){if(_0x18bd3c){return _0x18bd3c[_0x870c('0x22')]()[_0x870c('0x21')](function(){_0x1287bf[_0x870c('0x18')](0xcc)[_0x870c('0x23')]();});}};}function handleEntityNotFound(_0x5b34c0,_0x22b94c){return function(_0x31122e){if(!_0x31122e){_0x5b34c0[_0x870c('0x17')](0x194);}return _0x31122e;};}function handleError(_0x3edfd9,_0x2bd02c){_0x2bd02c=_0x2bd02c||0x1f4;return function(_0x1ad240){logger[_0x870c('0x24')](_0x1ad240['stack']);if(_0x1ad240[_0x870c('0x25')]){delete _0x1ad240[_0x870c('0x25')];}_0x3edfd9['status'](_0x2bd02c)[_0x870c('0x26')](_0x1ad240);};}exports[_0x870c('0x27')]=function(_0x14a914,_0x2199a6){var _0x2a363f={},_0x2edafd={},_0x1906bf={'count':0x0,'rows':[]};var _0x293bec=_[_0x870c('0x28')](db[_0x870c('0x29')][_0x870c('0x2a')],function(_0x227fd6){return{'name':_0x227fd6['fieldName'],'type':_0x227fd6[_0x870c('0x2b')][_0x870c('0x2c')]};});_0x2edafd[_0x870c('0x2d')]=_[_0x870c('0x28')](_0x293bec,_0x870c('0x25'));_0x2edafd[_0x870c('0x2e')]=_[_0x870c('0x2f')](_0x14a914[_0x870c('0x2e')]);_0x2edafd[_0x870c('0x30')]=_[_0x870c('0x31')](_0x2edafd[_0x870c('0x2d')],_0x2edafd['query']);_0x2a363f[_0x870c('0x32')]=_['intersection'](_0x2edafd['model'],qs[_0x870c('0x33')](_0x14a914[_0x870c('0x2e')]['fields']));_0x2a363f[_0x870c('0x32')]=_0x2a363f[_0x870c('0x32')][_0x870c('0x34')]?_0x2a363f[_0x870c('0x32')]:_0x2edafd[_0x870c('0x2d')];if(!_0x14a914[_0x870c('0x2e')]['hasOwnProperty'](_0x870c('0x35'))){_0x2a363f['limit']=qs[_0x870c('0x1c')](_0x14a914[_0x870c('0x2e')][_0x870c('0x1c')]);_0x2a363f[_0x870c('0x1a')]=qs[_0x870c('0x1a')](_0x14a914[_0x870c('0x2e')][_0x870c('0x1a')]);}_0x2a363f[_0x870c('0x36')]=qs[_0x870c('0x37')](_0x14a914[_0x870c('0x2e')][_0x870c('0x37')]);_0x2a363f[_0x870c('0x38')]=qs[_0x870c('0x30')](_['pick'](_0x14a914[_0x870c('0x2e')],_0x2edafd[_0x870c('0x30')]),_0x293bec);if(_0x14a914['query'][_0x870c('0x39')]){_0x2a363f[_0x870c('0x38')]=_[_0x870c('0x3a')](_0x2a363f[_0x870c('0x38')],{'$or':_[_0x870c('0x28')](_0x293bec,function(_0x5d31c2){if(_0x5d31c2[_0x870c('0x2b')]!==_0x870c('0x3b')){var _0x328b3a={};_0x328b3a[_0x5d31c2[_0x870c('0x25')]]={'$like':'%'+_0x14a914[_0x870c('0x2e')]['filter']+'%'};return _0x328b3a;}})});}_0x2a363f=_[_0x870c('0x3a')]({},_0x2a363f,_0x14a914[_0x870c('0x3c')]);var _0x22057f={'where':_0x2a363f[_0x870c('0x38')]};return db[_0x870c('0x29')][_0x870c('0x3d')](_0x22057f)[_0x870c('0x21')](function(_0x2acaae){_0x1906bf[_0x870c('0x3d')]=_0x2acaae;if(_0x14a914[_0x870c('0x2e')][_0x870c('0x3e')]){_0x2a363f[_0x870c('0x3f')]=[{'all':!![]}];}return db[_0x870c('0x29')][_0x870c('0x40')](_0x2a363f);})[_0x870c('0x21')](function(_0x454a5b){_0x1906bf[_0x870c('0x41')]=_0x454a5b;return _0x1906bf;})[_0x870c('0x21')](respondWithFilteredResult(_0x2199a6,_0x2a363f))[_0x870c('0x42')](handleError(_0x2199a6,null));};exports[_0x870c('0x43')]=function(_0x1fccd9,_0x4f708b){var _0x4d8d53={'raw':![],'where':{'id':_0x1fccd9[_0x870c('0x44')]['id']}},_0x4e4f19={};_0x4e4f19[_0x870c('0x2d')]=_[_0x870c('0x2f')](db[_0x870c('0x29')][_0x870c('0x2a')]);_0x4e4f19[_0x870c('0x2e')]=_['keys'](_0x1fccd9[_0x870c('0x2e')]);_0x4e4f19[_0x870c('0x30')]=_[_0x870c('0x31')](_0x4e4f19['model'],_0x4e4f19[_0x870c('0x2e')]);_0x4d8d53[_0x870c('0x32')]=_[_0x870c('0x31')](_0x4e4f19[_0x870c('0x2d')],qs['fields'](_0x1fccd9['query'][_0x870c('0x33')]));_0x4d8d53['attributes']=_0x4d8d53[_0x870c('0x32')][_0x870c('0x34')]?_0x4d8d53[_0x870c('0x32')]:_0x4e4f19[_0x870c('0x2d')];if(_0x1fccd9[_0x870c('0x2e')][_0x870c('0x3e')]){_0x4d8d53[_0x870c('0x3f')]=[{'all':!![]}];}_0x4d8d53=_[_0x870c('0x3a')]({},_0x4d8d53,_0x1fccd9['options']);return db[_0x870c('0x29')]['find'](_0x4d8d53)[_0x870c('0x21')](handleEntityNotFound(_0x4f708b,null))[_0x870c('0x21')](respondWithResult(_0x4f708b,null))[_0x870c('0x42')](handleError(_0x4f708b,null));};exports[_0x870c('0x45')]=function(_0x224a58,_0x18b193){return db[_0x870c('0x29')][_0x870c('0x45')](_0x224a58[_0x870c('0x46')],{})[_0x870c('0x21')](respondWithResult(_0x18b193,0xc9))[_0x870c('0x42')](handleError(_0x18b193,null));};exports['update']=function(_0x41d411,_0x1949af){if(_0x41d411[_0x870c('0x46')]['id']){delete _0x41d411[_0x870c('0x46')]['id'];}return db[_0x870c('0x29')][_0x870c('0x47')]({'where':{'id':_0x41d411[_0x870c('0x44')]['id']}})['then'](handleEntityNotFound(_0x1949af,null))['then'](saveUpdates(_0x41d411['body'],null))[_0x870c('0x21')](respondWithResult(_0x1949af,null))[_0x870c('0x42')](handleError(_0x1949af,null));};exports['destroy']=function(_0xc48e99,_0x45ecb5){return db['SalesforceConfiguration'][_0x870c('0x47')]({'where':{'id':_0xc48e99[_0x870c('0x44')]['id']}})[_0x870c('0x21')](handleEntityNotFound(_0x45ecb5,null))[_0x870c('0x21')](removeEntity(_0x45ecb5,null))[_0x870c('0x42')](handleError(_0x45ecb5,null));};exports['getFields']=function(_0x257d47,_0x285ded,_0x39dcb5){var _0x374af9={};var _0x128768={};var _0x4069d1;var _0x467c01;return db['SalesforceConfiguration'][_0x870c('0x48')]({'where':{'id':_0x257d47[_0x870c('0x44')]['id']}})[_0x870c('0x21')](handleEntityNotFound(_0x285ded,null))[_0x870c('0x21')](function(_0x268722){if(_0x268722){_0x4069d1=_0x268722;_0x128768['model']=_[_0x870c('0x2f')](db[_0x870c('0x49')][_0x870c('0x2a')]);_0x128768[_0x870c('0x2e')]=_['keys'](_0x257d47['query']);_0x128768[_0x870c('0x30')]=_[_0x870c('0x31')](_0x128768[_0x870c('0x2d')],_0x128768[_0x870c('0x2e')]);_0x374af9[_0x870c('0x32')]=_[_0x870c('0x31')](_0x128768['model'],qs[_0x870c('0x33')](_0x257d47[_0x870c('0x2e')]['fields']));_0x374af9[_0x870c('0x32')]=_0x374af9[_0x870c('0x32')][_0x870c('0x34')]?_0x374af9[_0x870c('0x32')]:_0x128768[_0x870c('0x2d')];_0x374af9[_0x870c('0x36')]=qs['sort'](_0x257d47[_0x870c('0x2e')]['sort']);_0x374af9[_0x870c('0x38')]=qs['filters'](_[_0x870c('0x4a')](_0x257d47[_0x870c('0x2e')],_0x128768['filters']));if(_0x257d47[_0x870c('0x2e')][_0x870c('0x39')]){_0x374af9[_0x870c('0x38')]=_[_0x870c('0x3a')](_0x374af9[_0x870c('0x38')],{'$or':_[_0x870c('0x28')](_0x374af9['attributes'],function(_0x18c693){var _0x483284={};_0x483284[_0x18c693]={'$like':'%'+_0x257d47[_0x870c('0x2e')][_0x870c('0x39')]+'%'};return _0x483284;})});}_0x374af9=_[_0x870c('0x3a')]({},_0x374af9,_0x257d47[_0x870c('0x3c')]);return _0x4069d1[_0x870c('0x4b')](_0x374af9);}})[_0x870c('0x21')](function(_0x167802){if(_0x167802){_0x467c01=_0x167802[_0x870c('0x34')];if(!_0x257d47['query'][_0x870c('0x4c')](_0x870c('0x35'))){_0x374af9[_0x870c('0x1c')]=qs[_0x870c('0x1c')](_0x257d47[_0x870c('0x2e')][_0x870c('0x1c')]);_0x374af9['offset']=qs[_0x870c('0x1a')](_0x257d47[_0x870c('0x2e')][_0x870c('0x1a')]);}return _0x4069d1[_0x870c('0x4b')](_0x374af9);}})[_0x870c('0x21')](function(_0x2f59bf){if(_0x2f59bf){return _0x2f59bf?{'count':_0x467c01,'rows':_0x2f59bf}:null;}})[_0x870c('0x21')](respondWithResult(_0x285ded,null))[_0x870c('0x42')](handleError(_0x285ded,null));};exports[_0x870c('0x4d')]=function(_0x2dc0f4,_0x4ace37,_0x5b32b5){var _0x548b75={};var _0x254e8b={};var _0x5a4747;var _0x2b7527;return db[_0x870c('0x29')]['findOne']({'where':{'id':_0x2dc0f4[_0x870c('0x44')]['id']}})[_0x870c('0x21')](handleEntityNotFound(_0x4ace37,null))['then'](function(_0x4dc3dc){if(_0x4dc3dc){_0x5a4747=_0x4dc3dc;_0x254e8b[_0x870c('0x2d')]=_['keys'](db['SalesforceField'][_0x870c('0x2a')]);_0x254e8b[_0x870c('0x2e')]=_[_0x870c('0x2f')](_0x2dc0f4[_0x870c('0x2e')]);_0x254e8b[_0x870c('0x30')]=_[_0x870c('0x31')](_0x254e8b[_0x870c('0x2d')],_0x254e8b[_0x870c('0x2e')]);_0x548b75[_0x870c('0x32')]=_[_0x870c('0x31')](_0x254e8b[_0x870c('0x2d')],qs['fields'](_0x2dc0f4[_0x870c('0x2e')]['fields']));_0x548b75[_0x870c('0x32')]=_0x548b75[_0x870c('0x32')][_0x870c('0x34')]?_0x548b75['attributes']:_0x254e8b[_0x870c('0x2d')];_0x548b75['order']=qs[_0x870c('0x37')](_0x2dc0f4[_0x870c('0x2e')][_0x870c('0x37')]);_0x548b75['where']=qs[_0x870c('0x30')](_[_0x870c('0x4a')](_0x2dc0f4[_0x870c('0x2e')],_0x254e8b[_0x870c('0x30')]));if(_0x2dc0f4[_0x870c('0x2e')][_0x870c('0x39')]){_0x548b75[_0x870c('0x38')]=_[_0x870c('0x3a')](_0x548b75['where'],{'$or':_[_0x870c('0x28')](_0x548b75['attributes'],function(_0x533203){var _0x5bc867={};_0x5bc867[_0x533203]={'$like':'%'+_0x2dc0f4['query']['filter']+'%'};return _0x5bc867;})});}_0x548b75=_[_0x870c('0x3a')]({},_0x548b75,_0x2dc0f4[_0x870c('0x3c')]);return _0x5a4747[_0x870c('0x4d')](_0x548b75);}})[_0x870c('0x21')](function(_0x1b81e5){if(_0x1b81e5){_0x2b7527=_0x1b81e5[_0x870c('0x34')];if(!_0x2dc0f4[_0x870c('0x2e')][_0x870c('0x4c')](_0x870c('0x35'))){_0x548b75[_0x870c('0x1c')]=qs[_0x870c('0x1c')](_0x2dc0f4[_0x870c('0x2e')]['limit']);_0x548b75[_0x870c('0x1a')]=qs['offset'](_0x2dc0f4[_0x870c('0x2e')][_0x870c('0x1a')]);}return _0x5a4747['getSubjects'](_0x548b75);}})[_0x870c('0x21')](function(_0xaddccb){if(_0xaddccb){return _0xaddccb?{'count':_0x2b7527,'rows':_0xaddccb}:null;}})['then'](respondWithResult(_0x4ace37,null))[_0x870c('0x42')](handleError(_0x4ace37,null));};exports[_0x870c('0x4e')]=function(_0x2897b2,_0x99158b,_0x413ac8){var _0x465a66={};var _0x112f5c={};var _0x4d3671;var _0x2d8f3d;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x2897b2['params']['id']}})[_0x870c('0x21')](handleEntityNotFound(_0x99158b,null))['then'](function(_0x11a27d){if(_0x11a27d){_0x4d3671=_0x11a27d;_0x112f5c[_0x870c('0x2d')]=_['keys'](db[_0x870c('0x49')][_0x870c('0x2a')]);_0x112f5c[_0x870c('0x2e')]=_[_0x870c('0x2f')](_0x2897b2['query']);_0x112f5c['filters']=_[_0x870c('0x31')](_0x112f5c[_0x870c('0x2d')],_0x112f5c[_0x870c('0x2e')]);_0x465a66[_0x870c('0x32')]=_[_0x870c('0x31')](_0x112f5c[_0x870c('0x2d')],qs[_0x870c('0x33')](_0x2897b2['query'][_0x870c('0x33')]));_0x465a66[_0x870c('0x32')]=_0x465a66['attributes']['length']?_0x465a66['attributes']:_0x112f5c[_0x870c('0x2d')];_0x465a66['order']=qs[_0x870c('0x37')](_0x2897b2[_0x870c('0x2e')][_0x870c('0x37')]);_0x465a66[_0x870c('0x38')]=qs[_0x870c('0x30')](_[_0x870c('0x4a')](_0x2897b2[_0x870c('0x2e')],_0x112f5c[_0x870c('0x30')]));if(_0x2897b2['query'][_0x870c('0x39')]){_0x465a66['where']=_['merge'](_0x465a66[_0x870c('0x38')],{'$or':_[_0x870c('0x28')](_0x465a66[_0x870c('0x32')],function(_0x205033){var _0x2d1f09={};_0x2d1f09[_0x205033]={'$like':'%'+_0x2897b2[_0x870c('0x2e')][_0x870c('0x39')]+'%'};return _0x2d1f09;})});}_0x465a66=_[_0x870c('0x3a')]({},_0x465a66,_0x2897b2[_0x870c('0x3c')]);return _0x4d3671[_0x870c('0x4e')](_0x465a66);}})[_0x870c('0x21')](function(_0xbf8a52){if(_0xbf8a52){_0x2d8f3d=_0xbf8a52[_0x870c('0x34')];if(!_0x2897b2[_0x870c('0x2e')]['hasOwnProperty'](_0x870c('0x35'))){_0x465a66[_0x870c('0x1c')]=qs[_0x870c('0x1c')](_0x2897b2[_0x870c('0x2e')][_0x870c('0x1c')]);_0x465a66[_0x870c('0x1a')]=qs[_0x870c('0x1a')](_0x2897b2['query'][_0x870c('0x1a')]);}return _0x4d3671[_0x870c('0x4e')](_0x465a66);}})[_0x870c('0x21')](function(_0x193334){if(_0x193334){return _0x193334?{'count':_0x2d8f3d,'rows':_0x193334}:null;}})[_0x870c('0x21')](respondWithResult(_0x99158b,null))[_0x870c('0x42')](handleError(_0x99158b,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index f72e91f..868541a 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 _0x58c6=['define','SalesforceConfiguration','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceConfiguration.attributes'];(function(_0x147d18,_0x546152){var _0x1d69c1=function(_0xba9192){while(--_0xba9192){_0x147d18['push'](_0x147d18['shift']());}};_0x1d69c1(++_0x546152);}(_0x58c6,0x8e));var _0x658c=function(_0x5eb294,_0x5b52ba){_0x5eb294=_0x5eb294-0x0;var _0xd139fd=_0x58c6[_0x5eb294];return _0xd139fd;};'use strict';var _=require(_0x658c('0x0'));var util=require('util');var logger=require(_0x658c('0x1'))('api');var moment=require(_0x658c('0x2'));var BPromise=require(_0x658c('0x3'));var rp=require(_0x658c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x658c('0x5'));var config=require(_0x658c('0x6'));var attributes=require(_0x658c('0x7'));module['exports']=function(_0x3fa987,_0x377144){return _0x3fa987[_0x658c('0x8')](_0x658c('0x9'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51d0=['int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration'];(function(_0x4cad95,_0x9a4b5){var _0xb7260e=function(_0x18b1b0){while(--_0x18b1b0){_0x4cad95['push'](_0x4cad95['shift']());}};_0xb7260e(++_0x9a4b5);}(_0x51d0,0xcd));var _0x051d=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0x51d0[_0x163040];return _0x364667;};'use strict';var _=require(_0x051d('0x0'));var util=require(_0x051d('0x1'));var logger=require(_0x051d('0x2'))(_0x051d('0x3'));var moment=require(_0x051d('0x4'));var BPromise=require(_0x051d('0x5'));var rp=require(_0x051d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x051d('0x7'));var attributes=require(_0x051d('0x8'));module['exports']=function(_0x4a0e5d,_0x523288){return _0x4a0e5d[_0x051d('0x9')](_0x051d('0xa'),attributes,{'tableName':_0x051d('0xb'),'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 7291d89..f26e4cf 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 _0xef32=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x500246,_0x9e80eb){var _0x3bd989=function(_0xf30eea){while(--_0xf30eea){_0x500246['push'](_0x500246['shift']());}};_0x3bd989(++_0x9e80eb);}(_0xef32,0x6c));var _0x2ef3=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xef32[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0x2ef3('0x0'));var util=require(_0x2ef3('0x1'));var moment=require(_0x2ef3('0x2'));var BPromise=require(_0x2ef3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ef3('0x4'));var db=require(_0x2ef3('0x5'))['db'];var utils=require(_0x2ef3('0x6'));var logger=require(_0x2ef3('0x7'))('rpc');var config=require(_0x2ef3('0x8'));var jayson=require(_0x2ef3('0x9'));var client=jayson['client'][_0x2ef3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x466736,_0x158cd1,_0x1b7ca0){return new BPromise(function(_0x386627,_0x4a6b6a){return client[_0x2ef3('0xb')](_0x466736,_0x1b7ca0)[_0x2ef3('0xc')](function(_0x39e018){logger[_0x2ef3('0xd')](_0x2ef3('0xe'),_0x158cd1,_0x2ef3('0xf'));logger[_0x2ef3('0x10')](_0x2ef3('0x11'),_0x158cd1,_0x2ef3('0xf'),JSON['stringify'](_0x39e018));if(_0x39e018[_0x2ef3('0x12')]){if(_0x39e018['error'][_0x2ef3('0x13')]===0x1f4){logger[_0x2ef3('0x12')](_0x2ef3('0xe'),_0x158cd1,_0x39e018['error'][_0x2ef3('0x14')]);return _0x4a6b6a(_0x39e018[_0x2ef3('0x12')][_0x2ef3('0x14')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x158cd1,_0x39e018[_0x2ef3('0x12')][_0x2ef3('0x14')]);return _0x386627(_0x39e018[_0x2ef3('0x12')][_0x2ef3('0x14')]);}else{logger[_0x2ef3('0xd')](_0x2ef3('0xe'),_0x158cd1,'request\x20sent');_0x386627(_0x39e018[_0x2ef3('0x15')][_0x2ef3('0x14')]);}})[_0x2ef3('0x16')](function(_0x14efcb){logger[_0x2ef3('0x12')](_0x2ef3('0xe'),_0x158cd1,_0x14efcb);_0x4a6b6a(_0x14efcb);});});} \ No newline at end of file +var _0xf7b2=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util'];(function(_0x4ad364,_0x3ff8d7){var _0x4ac3c3=function(_0x213721){while(--_0x213721){_0x4ad364['push'](_0x4ad364['shift']());}};_0x4ac3c3(++_0x3ff8d7);}(_0xf7b2,0x1e1));var _0x2f7b=function(_0x30edc9,_0x4fef54){_0x30edc9=_0x30edc9-0x0;var _0x169ec=_0xf7b2[_0x30edc9];return _0x169ec;};'use strict';var _=require(_0x2f7b('0x0'));var util=require(_0x2f7b('0x1'));var moment=require(_0x2f7b('0x2'));var BPromise=require(_0x2f7b('0x3'));var rs=require(_0x2f7b('0x4'));var fs=require('fs');var Redis=require(_0x2f7b('0x5'));var db=require(_0x2f7b('0x6'))['db'];var utils=require(_0x2f7b('0x7'));var logger=require(_0x2f7b('0x8'))('rpc');var config=require(_0x2f7b('0x9'));var jayson=require(_0x2f7b('0xa'));var client=jayson[_0x2f7b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c57df,_0x5297e0,_0x159f3a){return new BPromise(function(_0x2c7947,_0x246cf5){return client[_0x2f7b('0xc')](_0x2c57df,_0x159f3a)[_0x2f7b('0xd')](function(_0x1195db){logger[_0x2f7b('0xe')](_0x2f7b('0xf'),_0x5297e0,'request\x20sent');logger[_0x2f7b('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x5297e0,_0x2f7b('0x11'),JSON[_0x2f7b('0x12')](_0x1195db));if(_0x1195db['error']){if(_0x1195db[_0x2f7b('0x13')][_0x2f7b('0x14')]===0x1f4){logger[_0x2f7b('0x13')](_0x2f7b('0xf'),_0x5297e0,_0x1195db['error'][_0x2f7b('0x15')]);return _0x246cf5(_0x1195db['error']['message']);}logger[_0x2f7b('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5297e0,_0x1195db[_0x2f7b('0x13')][_0x2f7b('0x15')]);return _0x2c7947(_0x1195db['error'][_0x2f7b('0x15')]);}else{logger[_0x2f7b('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5297e0,_0x2f7b('0x11'));_0x2c7947(_0x1195db[_0x2f7b('0x16')][_0x2f7b('0x15')]);}})['catch'](function(_0x815469){logger[_0x2f7b('0x13')](_0x2f7b('0xf'),_0x5297e0,_0x815469);_0x246cf5(_0x815469);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 4bd3e30..777b82d 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 _0xba70=['./intSalesforceField.controller','get','isAuthenticated','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x17823f,_0xffd807){var _0x51fc21=function(_0x5e4921){while(--_0x5e4921){_0x17823f['push'](_0x17823f['shift']());}};_0x51fc21(++_0xffd807);}(_0xba70,0xb6));var _0x0ba7=function(_0x45a8c6,_0x9369d0){_0x45a8c6=_0x45a8c6-0x0;var _0x36a6f2=_0xba70[_0x45a8c6];return _0x36a6f2;};'use strict';var multer=require(_0x0ba7('0x0'));var util=require(_0x0ba7('0x1'));var path=require('path');var timeout=require(_0x0ba7('0x2'));var express=require(_0x0ba7('0x3'));var router=express[_0x0ba7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0ba7('0x5'));var interaction=require(_0x0ba7('0x6'));var config=require(_0x0ba7('0x7'));var controller=require(_0x0ba7('0x8'));router[_0x0ba7('0x9')]('/',auth[_0x0ba7('0xa')](),controller['index']);router[_0x0ba7('0x9')]('/:id',auth[_0x0ba7('0xa')](),controller['show']);router[_0x0ba7('0xb')]('/',auth[_0x0ba7('0xa')](),controller[_0x0ba7('0xc')]);router[_0x0ba7('0xd')](_0x0ba7('0xe'),auth[_0x0ba7('0xa')](),controller[_0x0ba7('0xf')]);router[_0x0ba7('0x10')](_0x0ba7('0xe'),auth[_0x0ba7('0xa')](),controller[_0x0ba7('0x11')]);module[_0x0ba7('0x12')]=router; \ No newline at end of file +var _0xa5e4=['multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','index','/:id','isAuthenticated','post','create','put','update','exports'];(function(_0x167287,_0x283601){var _0x495aa9=function(_0x1bece7){while(--_0x1bece7){_0x167287['push'](_0x167287['shift']());}};_0x495aa9(++_0x283601);}(_0xa5e4,0x1b0));var _0x4a5e=function(_0x3d5b2f,_0x308cc3){_0x3d5b2f=_0x3d5b2f-0x0;var _0xb4584a=_0xa5e4[_0x3d5b2f];return _0xb4584a;};'use strict';var multer=require(_0x4a5e('0x0'));var util=require(_0x4a5e('0x1'));var path=require(_0x4a5e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4a5e('0x3')]();var fs_extra=require(_0x4a5e('0x4'));var auth=require(_0x4a5e('0x5'));var interaction=require(_0x4a5e('0x6'));var config=require(_0x4a5e('0x7'));var controller=require(_0x4a5e('0x8'));router[_0x4a5e('0x9')]('/',auth['isAuthenticated'](),controller[_0x4a5e('0xa')]);router[_0x4a5e('0x9')](_0x4a5e('0xb'),auth[_0x4a5e('0xc')](),controller['show']);router[_0x4a5e('0xd')]('/',auth[_0x4a5e('0xc')](),controller[_0x4a5e('0xe')]);router[_0x4a5e('0xf')]('/:id',auth[_0x4a5e('0xc')](),controller[_0x4a5e('0x10')]);router['delete']('/:id',auth[_0x4a5e('0xc')](),controller['destroy']);module[_0x4a5e('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 2748361..c4d67f2 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 _0x37d4=['STRING','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x20da87,_0x5939b1){var _0x1897a3=function(_0x15416f){while(--_0x15416f){_0x20da87['push'](_0x20da87['shift']());}};_0x1897a3(++_0x5939b1);}(_0x37d4,0x166));var _0x437d=function(_0x480958,_0xc69cd7){_0x480958=_0x480958-0x0;var _0x2373a2=_0x37d4[_0x480958];return _0x2373a2;};'use strict';var Sequelize=require('sequelize');module[_0x437d('0x0')]={'type':{'type':Sequelize[_0x437d('0x1')](_0x437d('0x2'),_0x437d('0x3'),_0x437d('0x4'),'keyValue',_0x437d('0x5')),'defaultValue':_0x437d('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x437d('0x6')]},'keyType':{'type':Sequelize[_0x437d('0x1')](_0x437d('0x2'),_0x437d('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x437d('0x6')]}}; \ No newline at end of file +var _0x7ebb=['string','STRING','variable','sequelize','ENUM','customVariable','keyValue','picklist'];(function(_0x11b19b,_0x213234){var _0x1daac1=function(_0x516d3b){while(--_0x516d3b){_0x11b19b['push'](_0x11b19b['shift']());}};_0x1daac1(++_0x213234);}(_0x7ebb,0x10b));var _0xb7eb=function(_0x4e55a9,_0x241b22){_0x4e55a9=_0x4e55a9-0x0;var _0x4a9b67=_0x7ebb[_0x4e55a9];return _0x4a9b67;};'use strict';var Sequelize=require(_0xb7eb('0x0'));module['exports']={'type':{'type':Sequelize[_0xb7eb('0x1')]('string','variable',_0xb7eb('0x2'),_0xb7eb('0x3'),_0xb7eb('0x4')),'defaultValue':_0xb7eb('0x5')},'content':{'type':Sequelize[_0xb7eb('0x6')]},'key':{'type':Sequelize[_0xb7eb('0x6')]},'keyType':{'type':Sequelize[_0xb7eb('0x1')](_0xb7eb('0x5'),_0xb7eb('0x7'),_0xb7eb('0x2'))},'keyContent':{'type':Sequelize[_0xb7eb('0x6')]},'idField':{'type':Sequelize[_0xb7eb('0x6')]},'variableName':{'type':Sequelize[_0xb7eb('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index c315737..2c59c80 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 _0x424d=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','offset','count','Content-Range','apply','save','update','destroy','stack','name','index','map','SalesforceField','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','then','include','findAll','show','params','includeAll','options','find','catch','create','body','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','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1d92f8,_0xe82340){var _0x56dba3=function(_0x5ecd51){while(--_0x5ecd51){_0x1d92f8['push'](_0x1d92f8['shift']());}};_0x56dba3(++_0xe82340);}(_0x424d,0x19d));var _0xd424=function(_0x486236,_0x325e27){_0x486236=_0x486236-0x0;var _0x58d527=_0x424d[_0x486236];return _0x58d527;};'use strict';var emlformat=require(_0xd424('0x0'));var rimraf=require(_0xd424('0x1'));var zipdir=require(_0xd424('0x2'));var jsonpatch=require(_0xd424('0x3'));var rp=require(_0xd424('0x4'));var moment=require(_0xd424('0x5'));var BPromise=require(_0xd424('0x6'));var Mustache=require(_0xd424('0x7'));var util=require(_0xd424('0x8'));var path=require(_0xd424('0x9'));var sox=require('sox');var csv=require(_0xd424('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd424('0xb'));var _=require(_0xd424('0xc'));var squel=require(_0xd424('0xd'));var crypto=require(_0xd424('0xe'));var jsforce=require(_0xd424('0xf'));var deskjs=require(_0xd424('0x10'));var toCsv=require(_0xd424('0xa'));var querystring=require(_0xd424('0x11'));var Papa=require('papaparse');var Redis=require(_0xd424('0x12'));var authService=require(_0xd424('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd424('0x14'));var hardwareService=require(_0xd424('0x15'));var logger=require(_0xd424('0x16'))(_0xd424('0x17'));var utils=require(_0xd424('0x18'));var config=require(_0xd424('0x19'));var licenseUtil=require(_0xd424('0x1a'));var db=require(_0xd424('0x1b'))['db'];function respondWithStatusCode(_0x20cd20,_0x158dae){_0x158dae=_0x158dae||0xcc;return function(_0x5b4486){if(_0x5b4486){return _0x20cd20[_0xd424('0x1c')](_0x158dae);}return _0x20cd20[_0xd424('0x1d')](_0x158dae)[_0xd424('0x1e')]();};}function respondWithResult(_0x5cef7f,_0x1c40a6){_0x1c40a6=_0x1c40a6||0xc8;return function(_0xa348a7){if(_0xa348a7){return _0x5cef7f[_0xd424('0x1d')](_0x1c40a6)[_0xd424('0x1f')](_0xa348a7);}};}function respondWithFilteredResult(_0x3230b8,_0x5d2aa1){return function(_0x42c338){if(_0x42c338){var _0x134247=typeof _0x5d2aa1['offset']==='undefined'&&typeof _0x5d2aa1[_0xd424('0x20')]==='undefined';var _0x3ee249=_0x42c338['count'];var _0xa61594=_0x134247?0x0:_0x5d2aa1[_0xd424('0x21')];var _0x7b2045=_0x134247?_0x42c338[_0xd424('0x22')]:_0x5d2aa1[_0xd424('0x21')]+_0x5d2aa1['limit'];var _0x3762f1;if(_0x7b2045>=_0x3ee249){_0x7b2045=_0x3ee249;_0x3762f1=0xc8;}else{_0x3762f1=0xce;}_0x3230b8['status'](_0x3762f1);return _0x3230b8['set'](_0xd424('0x23'),_0xa61594+'-'+_0x7b2045+'/'+_0x3ee249)['json'](_0x42c338);}return null;};}function patchUpdates(_0x39c853){return function(_0x16694e){try{jsonpatch[_0xd424('0x24')](_0x16694e,_0x39c853,!![]);}catch(_0xf9aeb4){return BPromise['reject'](_0xf9aeb4);}return _0x16694e[_0xd424('0x25')]();};}function saveUpdates(_0x39e511,_0x28eba4){return function(_0x1402b9){if(_0x1402b9){return _0x1402b9[_0xd424('0x26')](_0x39e511)['then'](function(_0x317379){return _0x317379;});}return null;};}function removeEntity(_0x2a1eb4,_0x51277b){return function(_0x194f2a){if(_0x194f2a){return _0x194f2a[_0xd424('0x27')]()['then'](function(){_0x2a1eb4[_0xd424('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f3f3d,_0x202d91){return function(_0x59f2d8){if(!_0x59f2d8){_0x4f3f3d['sendStatus'](0x194);}return _0x59f2d8;};}function handleError(_0x412744,_0x294351){_0x294351=_0x294351||0x1f4;return function(_0x42e933){logger['error'](_0x42e933[_0xd424('0x28')]);if(_0x42e933[_0xd424('0x29')]){delete _0x42e933[_0xd424('0x29')];}_0x412744['status'](_0x294351)['send'](_0x42e933);};}exports[_0xd424('0x2a')]=function(_0x27f51a,_0x4d2022){var _0x2d8739={},_0x4ca8da={},_0x1111b3={'count':0x0,'rows':[]};var _0x17481f=_[_0xd424('0x2b')](db[_0xd424('0x2c')][_0xd424('0x2d')],function(_0x279351){return{'name':_0x279351['fieldName'],'type':_0x279351[_0xd424('0x2e')]['key']};});_0x4ca8da[_0xd424('0x2f')]=_[_0xd424('0x2b')](_0x17481f,_0xd424('0x29'));_0x4ca8da[_0xd424('0x30')]=_[_0xd424('0x31')](_0x27f51a[_0xd424('0x30')]);_0x4ca8da[_0xd424('0x32')]=_[_0xd424('0x33')](_0x4ca8da[_0xd424('0x2f')],_0x4ca8da[_0xd424('0x30')]);_0x2d8739['attributes']=_[_0xd424('0x33')](_0x4ca8da[_0xd424('0x2f')],qs['fields'](_0x27f51a[_0xd424('0x30')][_0xd424('0x34')]));_0x2d8739[_0xd424('0x35')]=_0x2d8739[_0xd424('0x35')][_0xd424('0x36')]?_0x2d8739[_0xd424('0x35')]:_0x4ca8da[_0xd424('0x2f')];if(!_0x27f51a[_0xd424('0x30')][_0xd424('0x37')]('nolimit')){_0x2d8739[_0xd424('0x20')]=qs[_0xd424('0x20')](_0x27f51a[_0xd424('0x30')]['limit']);_0x2d8739[_0xd424('0x21')]=qs[_0xd424('0x21')](_0x27f51a['query']['offset']);}_0x2d8739['order']=qs[_0xd424('0x38')](_0x27f51a[_0xd424('0x30')][_0xd424('0x38')]);_0x2d8739[_0xd424('0x39')]=qs['filters'](_[_0xd424('0x3a')](_0x27f51a[_0xd424('0x30')],_0x4ca8da['filters']),_0x17481f);if(_0x27f51a['query'][_0xd424('0x3b')]){_0x2d8739[_0xd424('0x39')]=_[_0xd424('0x3c')](_0x2d8739[_0xd424('0x39')],{'$or':_['map'](_0x17481f,function(_0x506d08){if(_0x506d08[_0xd424('0x2e')]!==_0xd424('0x3d')){var _0x2fb610={};_0x2fb610[_0x506d08['name']]={'$like':'%'+_0x27f51a['query'][_0xd424('0x3b')]+'%'};return _0x2fb610;}})});}_0x2d8739=_[_0xd424('0x3c')]({},_0x2d8739,_0x27f51a['options']);var _0x1f2f43={'where':_0x2d8739[_0xd424('0x39')]};return db[_0xd424('0x2c')][_0xd424('0x22')](_0x1f2f43)[_0xd424('0x3e')](function(_0xd800a1){_0x1111b3[_0xd424('0x22')]=_0xd800a1;if(_0x27f51a['query']['includeAll']){_0x2d8739[_0xd424('0x3f')]=[{'all':!![]}];}return db[_0xd424('0x2c')][_0xd424('0x40')](_0x2d8739);})[_0xd424('0x3e')](function(_0x411f7b){_0x1111b3['rows']=_0x411f7b;return _0x1111b3;})['then'](respondWithFilteredResult(_0x4d2022,_0x2d8739))['catch'](handleError(_0x4d2022,null));};exports[_0xd424('0x41')]=function(_0x14850f,_0x528b73){var _0x623501={'raw':!![],'where':{'id':_0x14850f[_0xd424('0x42')]['id']}},_0x5d60ed={};_0x5d60ed['model']=_['keys'](db[_0xd424('0x2c')]['rawAttributes']);_0x5d60ed[_0xd424('0x30')]=_[_0xd424('0x31')](_0x14850f[_0xd424('0x30')]);_0x5d60ed[_0xd424('0x32')]=_[_0xd424('0x33')](_0x5d60ed[_0xd424('0x2f')],_0x5d60ed[_0xd424('0x30')]);_0x623501[_0xd424('0x35')]=_['intersection'](_0x5d60ed['model'],qs[_0xd424('0x34')](_0x14850f[_0xd424('0x30')]['fields']));_0x623501['attributes']=_0x623501[_0xd424('0x35')][_0xd424('0x36')]?_0x623501[_0xd424('0x35')]:_0x5d60ed[_0xd424('0x2f')];if(_0x14850f[_0xd424('0x30')][_0xd424('0x43')]){_0x623501[_0xd424('0x3f')]=[{'all':!![]}];}_0x623501=_[_0xd424('0x3c')]({},_0x623501,_0x14850f[_0xd424('0x44')]);return db['SalesforceField'][_0xd424('0x45')](_0x623501)[_0xd424('0x3e')](handleEntityNotFound(_0x528b73,null))[_0xd424('0x3e')](respondWithResult(_0x528b73,null))[_0xd424('0x46')](handleError(_0x528b73,null));};exports[_0xd424('0x47')]=function(_0x418343,_0x298194){return db[_0xd424('0x2c')]['create'](_0x418343[_0xd424('0x48')],{})[_0xd424('0x3e')](respondWithResult(_0x298194,0xc9))[_0xd424('0x46')](handleError(_0x298194,null));};exports[_0xd424('0x26')]=function(_0x2a6230,_0x28e12a){if(_0x2a6230[_0xd424('0x48')]['id']){delete _0x2a6230[_0xd424('0x48')]['id'];}return db[_0xd424('0x2c')][_0xd424('0x45')]({'where':{'id':_0x2a6230[_0xd424('0x42')]['id']}})[_0xd424('0x3e')](handleEntityNotFound(_0x28e12a,null))[_0xd424('0x3e')](saveUpdates(_0x2a6230[_0xd424('0x48')],null))[_0xd424('0x3e')](respondWithResult(_0x28e12a,null))['catch'](handleError(_0x28e12a,null));};exports[_0xd424('0x27')]=function(_0x55ee06,_0x10631f){return db[_0xd424('0x2c')][_0xd424('0x45')]({'where':{'id':_0x55ee06[_0xd424('0x42')]['id']}})[_0xd424('0x3e')](handleEntityNotFound(_0x10631f,null))['then'](removeEntity(_0x10631f,null))['catch'](handleError(_0x10631f,null));}; \ No newline at end of file +var _0xe52e=['request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','json','apply','reject','update','destroy','error','name','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','findAll','rows','catch','show','params','find','create','body'];(function(_0x5da27f,_0x504b76){var _0x54a3fb=function(_0x3b65a8){while(--_0x3b65a8){_0x5da27f['push'](_0x5da27f['shift']());}};_0x54a3fb(++_0x504b76);}(_0xe52e,0x8a));var _0xee52=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0xe52e[_0x4d82ea];return _0x257f4a;};'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(_0xee52('0x0'));var moment=require('moment');var BPromise=require(_0xee52('0x1'));var Mustache=require(_0xee52('0x2'));var util=require(_0xee52('0x3'));var path=require(_0xee52('0x4'));var sox=require(_0xee52('0x5'));var csv=require(_0xee52('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee52('0x7'));var squel=require(_0xee52('0x8'));var crypto=require('crypto');var jsforce=require(_0xee52('0x9'));var deskjs=require(_0xee52('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee52('0xb'));var Redis=require(_0xee52('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xee52('0xd'));var hardwareService=require(_0xee52('0xe'));var logger=require('../../config/logger')(_0xee52('0xf'));var utils=require(_0xee52('0x10'));var config=require(_0xee52('0x11'));var licenseUtil=require(_0xee52('0x12'));var db=require(_0xee52('0x13'))['db'];function respondWithStatusCode(_0x3036fc,_0x15593a){_0x15593a=_0x15593a||0xcc;return function(_0x2978fb){if(_0x2978fb){return _0x3036fc[_0xee52('0x14')](_0x15593a);}return _0x3036fc[_0xee52('0x15')](_0x15593a)[_0xee52('0x16')]();};}function respondWithResult(_0x3c9524,_0x19860f){_0x19860f=_0x19860f||0xc8;return function(_0xa5fa2f){if(_0xa5fa2f){return _0x3c9524[_0xee52('0x15')](_0x19860f)['json'](_0xa5fa2f);}};}function respondWithFilteredResult(_0x2cb8d4,_0x140d1a){return function(_0x3e9032){if(_0x3e9032){var _0xe772c2=typeof _0x140d1a[_0xee52('0x17')]==='undefined'&&typeof _0x140d1a[_0xee52('0x18')]===_0xee52('0x19');var _0x565d1c=_0x3e9032[_0xee52('0x1a')];var _0x322d7d=_0xe772c2?0x0:_0x140d1a[_0xee52('0x17')];var _0x2d6801=_0xe772c2?_0x3e9032[_0xee52('0x1a')]:_0x140d1a[_0xee52('0x17')]+_0x140d1a[_0xee52('0x18')];var _0x26d73f;if(_0x2d6801>=_0x565d1c){_0x2d6801=_0x565d1c;_0x26d73f=0xc8;}else{_0x26d73f=0xce;}_0x2cb8d4['status'](_0x26d73f);return _0x2cb8d4['set']('Content-Range',_0x322d7d+'-'+_0x2d6801+'/'+_0x565d1c)[_0xee52('0x1b')](_0x3e9032);}return null;};}function patchUpdates(_0x40bc52){return function(_0x468c24){try{jsonpatch[_0xee52('0x1c')](_0x468c24,_0x40bc52,!![]);}catch(_0x567024){return BPromise[_0xee52('0x1d')](_0x567024);}return _0x468c24['save']();};}function saveUpdates(_0x1adbe7,_0xea9e75){return function(_0x4621a0){if(_0x4621a0){return _0x4621a0[_0xee52('0x1e')](_0x1adbe7)['then'](function(_0x58de73){return _0x58de73;});}return null;};}function removeEntity(_0x9a869b,_0x54d059){return function(_0x55a85b){if(_0x55a85b){return _0x55a85b[_0xee52('0x1f')]()['then'](function(){_0x9a869b['status'](0xcc)[_0xee52('0x16')]();});}};}function handleEntityNotFound(_0x5b62ae,_0x1a7195){return function(_0x551a33){if(!_0x551a33){_0x5b62ae[_0xee52('0x14')](0x194);}return _0x551a33;};}function handleError(_0x3525d6,_0x36c058){_0x36c058=_0x36c058||0x1f4;return function(_0x53e582){logger[_0xee52('0x20')](_0x53e582['stack']);if(_0x53e582[_0xee52('0x21')]){delete _0x53e582[_0xee52('0x21')];}_0x3525d6[_0xee52('0x15')](_0x36c058)['send'](_0x53e582);};}exports[_0xee52('0x22')]=function(_0x523581,_0x28a467){var _0x2b8bd8={},_0x442d80={},_0x4e52ad={'count':0x0,'rows':[]};var _0x47b74e=_[_0xee52('0x23')](db[_0xee52('0x24')][_0xee52('0x25')],function(_0xcbe105){return{'name':_0xcbe105[_0xee52('0x26')],'type':_0xcbe105[_0xee52('0x27')][_0xee52('0x28')]};});_0x442d80[_0xee52('0x29')]=_['map'](_0x47b74e,_0xee52('0x21'));_0x442d80[_0xee52('0x2a')]=_[_0xee52('0x2b')](_0x523581[_0xee52('0x2a')]);_0x442d80['filters']=_[_0xee52('0x2c')](_0x442d80[_0xee52('0x29')],_0x442d80[_0xee52('0x2a')]);_0x2b8bd8[_0xee52('0x2d')]=_['intersection'](_0x442d80[_0xee52('0x29')],qs[_0xee52('0x2e')](_0x523581[_0xee52('0x2a')][_0xee52('0x2e')]));_0x2b8bd8[_0xee52('0x2d')]=_0x2b8bd8[_0xee52('0x2d')][_0xee52('0x2f')]?_0x2b8bd8[_0xee52('0x2d')]:_0x442d80[_0xee52('0x29')];if(!_0x523581[_0xee52('0x2a')][_0xee52('0x30')](_0xee52('0x31'))){_0x2b8bd8[_0xee52('0x18')]=qs[_0xee52('0x18')](_0x523581[_0xee52('0x2a')]['limit']);_0x2b8bd8[_0xee52('0x17')]=qs[_0xee52('0x17')](_0x523581[_0xee52('0x2a')][_0xee52('0x17')]);}_0x2b8bd8[_0xee52('0x32')]=qs[_0xee52('0x33')](_0x523581[_0xee52('0x2a')][_0xee52('0x33')]);_0x2b8bd8[_0xee52('0x34')]=qs[_0xee52('0x35')](_[_0xee52('0x36')](_0x523581['query'],_0x442d80[_0xee52('0x35')]),_0x47b74e);if(_0x523581[_0xee52('0x2a')][_0xee52('0x37')]){_0x2b8bd8[_0xee52('0x34')]=_[_0xee52('0x38')](_0x2b8bd8[_0xee52('0x34')],{'$or':_[_0xee52('0x23')](_0x47b74e,function(_0x1e5e3e){if(_0x1e5e3e[_0xee52('0x27')]!==_0xee52('0x39')){var _0x11e0e6={};_0x11e0e6[_0x1e5e3e[_0xee52('0x21')]]={'$like':'%'+_0x523581[_0xee52('0x2a')]['filter']+'%'};return _0x11e0e6;}})});}_0x2b8bd8=_[_0xee52('0x38')]({},_0x2b8bd8,_0x523581[_0xee52('0x3a')]);var _0x442d87={'where':_0x2b8bd8['where']};return db[_0xee52('0x24')][_0xee52('0x1a')](_0x442d87)[_0xee52('0x3b')](function(_0x10475c){_0x4e52ad['count']=_0x10475c;if(_0x523581[_0xee52('0x2a')][_0xee52('0x3c')]){_0x2b8bd8['include']=[{'all':!![]}];}return db['SalesforceField'][_0xee52('0x3d')](_0x2b8bd8);})['then'](function(_0x419799){_0x4e52ad[_0xee52('0x3e')]=_0x419799;return _0x4e52ad;})['then'](respondWithFilteredResult(_0x28a467,_0x2b8bd8))[_0xee52('0x3f')](handleError(_0x28a467,null));};exports[_0xee52('0x40')]=function(_0x1a65bd,_0x367366){var _0x1632af={'raw':!![],'where':{'id':_0x1a65bd[_0xee52('0x41')]['id']}},_0x5e47c5={};_0x5e47c5['model']=_['keys'](db['SalesforceField'][_0xee52('0x25')]);_0x5e47c5[_0xee52('0x2a')]=_[_0xee52('0x2b')](_0x1a65bd[_0xee52('0x2a')]);_0x5e47c5['filters']=_[_0xee52('0x2c')](_0x5e47c5[_0xee52('0x29')],_0x5e47c5[_0xee52('0x2a')]);_0x1632af['attributes']=_[_0xee52('0x2c')](_0x5e47c5[_0xee52('0x29')],qs[_0xee52('0x2e')](_0x1a65bd[_0xee52('0x2a')]['fields']));_0x1632af['attributes']=_0x1632af[_0xee52('0x2d')][_0xee52('0x2f')]?_0x1632af[_0xee52('0x2d')]:_0x5e47c5[_0xee52('0x29')];if(_0x1a65bd[_0xee52('0x2a')][_0xee52('0x3c')]){_0x1632af['include']=[{'all':!![]}];}_0x1632af=_[_0xee52('0x38')]({},_0x1632af,_0x1a65bd[_0xee52('0x3a')]);return db[_0xee52('0x24')][_0xee52('0x42')](_0x1632af)[_0xee52('0x3b')](handleEntityNotFound(_0x367366,null))[_0xee52('0x3b')](respondWithResult(_0x367366,null))[_0xee52('0x3f')](handleError(_0x367366,null));};exports['create']=function(_0x29431a,_0x3c7ef4){return db['SalesforceField'][_0xee52('0x43')](_0x29431a[_0xee52('0x44')],{})[_0xee52('0x3b')](respondWithResult(_0x3c7ef4,0xc9))[_0xee52('0x3f')](handleError(_0x3c7ef4,null));};exports[_0xee52('0x1e')]=function(_0x30091e,_0x709b69){if(_0x30091e[_0xee52('0x44')]['id']){delete _0x30091e[_0xee52('0x44')]['id'];}return db[_0xee52('0x24')][_0xee52('0x42')]({'where':{'id':_0x30091e['params']['id']}})[_0xee52('0x3b')](handleEntityNotFound(_0x709b69,null))['then'](saveUpdates(_0x30091e[_0xee52('0x44')],null))[_0xee52('0x3b')](respondWithResult(_0x709b69,null))['catch'](handleError(_0x709b69,null));};exports['destroy']=function(_0x35fc0d,_0x11ce37){return db[_0xee52('0x24')]['find']({'where':{'id':_0x35fc0d['params']['id']}})[_0xee52('0x3b')](handleEntityNotFound(_0x11ce37,null))[_0xee52('0x3b')](removeEntity(_0x11ce37,null))[_0xee52('0x3f')](handleError(_0x11ce37,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index f944ee3..416ad1f 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 _0x691a=['salesforce_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields'];(function(_0x4692d6,_0x3f1bae){var _0x1de6ad=function(_0x3bad58){while(--_0x3bad58){_0x4692d6['push'](_0x4692d6['shift']());}};_0x1de6ad(++_0x3f1bae);}(_0x691a,0x1b2));var _0xa691=function(_0x58987e,_0x5178f0){_0x58987e=_0x58987e-0x0;var _0x3208ab=_0x691a[_0x58987e];return _0x3208ab;};'use strict';var _=require(_0xa691('0x0'));var util=require(_0xa691('0x1'));var logger=require(_0xa691('0x2'))('api');var moment=require(_0xa691('0x3'));var BPromise=require(_0xa691('0x4'));var rp=require(_0xa691('0x5'));var fs=require('fs');var path=require(_0xa691('0x6'));var rimraf=require(_0xa691('0x7'));var config=require(_0xa691('0x8'));var attributes=require(_0xa691('0x9'));module[_0xa691('0xa')]=function(_0x1d1a20,_0x1b05a0){return _0x1d1a20[_0xa691('0xb')](_0xa691('0xc'),attributes,{'tableName':_0xa691('0xd'),'paranoid':![],'indexes':[{'name':_0xa691('0xe'),'fields':['idField',_0xa691('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf312=['salesforce_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields'];(function(_0x5efae7,_0x9bdeac){var _0x32618f=function(_0xc052ec){while(--_0xc052ec){_0x5efae7['push'](_0x5efae7['shift']());}};_0x32618f(++_0x9bdeac);}(_0xf312,0x1cd));var _0x2f31=function(_0x2c4903,_0x286a98){_0x2c4903=_0x2c4903-0x0;var _0x218708=_0xf312[_0x2c4903];return _0x218708;};'use strict';var _=require(_0x2f31('0x0'));var util=require(_0x2f31('0x1'));var logger=require(_0x2f31('0x2'))(_0x2f31('0x3'));var moment=require(_0x2f31('0x4'));var BPromise=require(_0x2f31('0x5'));var rp=require(_0x2f31('0x6'));var fs=require('fs');var path=require(_0x2f31('0x7'));var rimraf=require(_0x2f31('0x8'));var config=require(_0x2f31('0x9'));var attributes=require(_0x2f31('0xa'));module[_0x2f31('0xb')]=function(_0x4e7645,_0x2d27f6){return _0x4e7645[_0x2f31('0xc')](_0x2f31('0xd'),attributes,{'tableName':_0x2f31('0xe'),'paranoid':![],'indexes':[{'name':_0x2f31('0xf'),'fields':['idField',_0x2f31('0x10')],'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 d0178ac..4b1f21c 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 _0xc9a0=['ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment'];(function(_0x81e855,_0x51a376){var _0x3cbdf3=function(_0x47075a){while(--_0x47075a){_0x81e855['push'](_0x81e855['shift']());}};_0x3cbdf3(++_0x51a376);}(_0xc9a0,0x163));var _0x0c9a=function(_0x4f3429,_0x29100c){_0x4f3429=_0x4f3429-0x0;var _0x243305=_0xc9a0[_0x4f3429];return _0x243305;};'use strict';var _=require(_0x0c9a('0x0'));var util=require('util');var moment=require(_0x0c9a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c9a('0x2'));var db=require(_0x0c9a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c9a('0x4'))('rpc');var config=require(_0x0c9a('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0c9a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x139a14,_0x23da3e,_0x3baf6c){return new BPromise(function(_0x55f936,_0x443dfd){return client[_0x0c9a('0x7')](_0x139a14,_0x3baf6c)['then'](function(_0x5e0e49){logger['info'](_0x0c9a('0x8'),_0x23da3e,_0x0c9a('0x9'));logger[_0x0c9a('0xa')](_0x0c9a('0xb'),_0x23da3e,_0x0c9a('0x9'),JSON[_0x0c9a('0xc')](_0x5e0e49));if(_0x5e0e49[_0x0c9a('0xd')]){if(_0x5e0e49[_0x0c9a('0xd')][_0x0c9a('0xe')]===0x1f4){logger[_0x0c9a('0xd')](_0x0c9a('0x8'),_0x23da3e,_0x5e0e49['error'][_0x0c9a('0xf')]);return _0x443dfd(_0x5e0e49[_0x0c9a('0xd')][_0x0c9a('0xf')]);}logger[_0x0c9a('0xd')](_0x0c9a('0x8'),_0x23da3e,_0x5e0e49['error']['message']);return _0x55f936(_0x5e0e49[_0x0c9a('0xd')]['message']);}else{logger['info'](_0x0c9a('0x8'),_0x23da3e,_0x0c9a('0x9'));_0x55f936(_0x5e0e49['result'][_0x0c9a('0xf')]);}})[_0x0c9a('0x10')](function(_0x1b3030){logger[_0x0c9a('0xd')](_0x0c9a('0x8'),_0x23da3e,_0x1b3030);_0x443dfd(_0x1b3030);});});} \ No newline at end of file +var _0x8f7e=['../../config/environment','client','http','then','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x8f7e,0x11f));var _0xe8f7=function(_0x318606,_0x26823b){_0x318606=_0x318606-0x0;var _0x5f47fd=_0x8f7e[_0x318606];return _0x5f47fd;};'use strict';var _=require(_0xe8f7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe8f7('0x1'));var rs=require(_0xe8f7('0x2'));var fs=require('fs');var Redis=require(_0xe8f7('0x3'));var db=require(_0xe8f7('0x4'))['db'];var utils=require(_0xe8f7('0x5'));var logger=require('../../config/logger')(_0xe8f7('0x6'));var config=require(_0xe8f7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe8f7('0x8')][_0xe8f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x500c69,_0x456e65,_0x1fd779){return new BPromise(function(_0x39b63e,_0x553318){return client['request'](_0x500c69,_0x1fd779)[_0xe8f7('0xa')](function(_0x2400bf){logger['info'](_0xe8f7('0xb'),_0x456e65,'request\x20sent');logger[_0xe8f7('0xc')](_0xe8f7('0xd'),_0x456e65,_0xe8f7('0xe'),JSON[_0xe8f7('0xf')](_0x2400bf));if(_0x2400bf[_0xe8f7('0x10')]){if(_0x2400bf[_0xe8f7('0x10')][_0xe8f7('0x11')]===0x1f4){logger[_0xe8f7('0x10')](_0xe8f7('0xb'),_0x456e65,_0x2400bf[_0xe8f7('0x10')][_0xe8f7('0x12')]);return _0x553318(_0x2400bf[_0xe8f7('0x10')][_0xe8f7('0x12')]);}logger[_0xe8f7('0x10')]('SalesforceField,\x20%s,\x20%s',_0x456e65,_0x2400bf[_0xe8f7('0x10')][_0xe8f7('0x12')]);return _0x39b63e(_0x2400bf[_0xe8f7('0x10')][_0xe8f7('0x12')]);}else{logger[_0xe8f7('0x13')](_0xe8f7('0xb'),_0x456e65,'request\x20sent');_0x39b63e(_0x2400bf['result']['message']);}})[_0xe8f7('0x14')](function(_0x1aa81c){logger[_0xe8f7('0x10')](_0xe8f7('0xb'),_0x456e65,_0x1aa81c);_0x553318(_0x1aa81c);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 245fd50..e6e970f 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 _0x1fee=['get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0x1fee,0x12e));var _0xe1fe=function(_0x544a7d,_0x7b4f20){_0x544a7d=_0x544a7d-0x0;var _0x439c07=_0x1fee[_0x544a7d];return _0x439c07;};'use strict';var multer=require(_0xe1fe('0x0'));var util=require(_0xe1fe('0x1'));var path=require(_0xe1fe('0x2'));var timeout=require(_0xe1fe('0x3'));var express=require(_0xe1fe('0x4'));var router=express['Router']();var fs_extra=require(_0xe1fe('0x5'));var auth=require(_0xe1fe('0x6'));var interaction=require(_0xe1fe('0x7'));var config=require(_0xe1fe('0x8'));var controller=require(_0xe1fe('0x9'));router[_0xe1fe('0xa')]('/',auth[_0xe1fe('0xb')](),controller[_0xe1fe('0xc')]);router['get']('/:id',auth[_0xe1fe('0xb')](),controller[_0xe1fe('0xd')]);router['get'](_0xe1fe('0xe'),auth['isAuthenticated'](),controller[_0xe1fe('0xf')]);router[_0xe1fe('0xa')]('/:id/fields',auth[_0xe1fe('0xb')](),controller[_0xe1fe('0x10')]);router['post']('/',auth[_0xe1fe('0xb')](),controller[_0xe1fe('0x11')]);router[_0xe1fe('0x12')](_0xe1fe('0xe'),auth[_0xe1fe('0xb')](),controller[_0xe1fe('0x13')]);router[_0xe1fe('0x14')](_0xe1fe('0x15'),auth[_0xe1fe('0xb')](),controller['update']);router['delete'](_0xe1fe('0x15'),auth[_0xe1fe('0xb')](),controller[_0xe1fe('0x16')]);module[_0xe1fe('0x17')]=router; \ No newline at end of file +var _0x933b=['put','/:id','update','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/configurations','post','create','addConfiguration'];(function(_0x263448,_0x5475bb){var _0x469f16=function(_0x51322a){while(--_0x51322a){_0x263448['push'](_0x263448['shift']());}};_0x469f16(++_0x5475bb);}(_0x933b,0x16e));var _0xb933=function(_0x94aab,_0x52c70f){_0x94aab=_0x94aab-0x0;var _0x426623=_0x933b[_0x94aab];return _0x426623;};'use strict';var multer=require(_0xb933('0x0'));var util=require(_0xb933('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb933('0x2'));var router=express[_0xb933('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb933('0x4'));var interaction=require(_0xb933('0x5'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router[_0xb933('0x6')]('/',auth[_0xb933('0x7')](),controller[_0xb933('0x8')]);router[_0xb933('0x6')]('/:id',auth[_0xb933('0x7')](),controller[_0xb933('0x9')]);router[_0xb933('0x6')](_0xb933('0xa'),auth[_0xb933('0x7')](),controller['getConfigurations']);router[_0xb933('0x6')]('/:id/fields',auth[_0xb933('0x7')](),controller['getFields']);router[_0xb933('0xb')]('/',auth[_0xb933('0x7')](),controller[_0xb933('0xc')]);router[_0xb933('0xb')](_0xb933('0xa'),auth[_0xb933('0x7')](),controller[_0xb933('0xd')]);router[_0xb933('0xe')](_0xb933('0xf'),auth[_0xb933('0x7')](),controller[_0xb933('0x10')]);router['delete'](_0xb933('0xf'),auth[_0xb933('0x7')](),controller[_0xb933('0x11')]);module[_0xb933('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index be466aa..cda6ee6 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 _0x344a=['STRING','username','remoteUri','exports'];(function(_0x5bf0d7,_0x102884){var _0x33ceb5=function(_0x261b30){while(--_0x261b30){_0x5bf0d7['push'](_0x5bf0d7['shift']());}};_0x33ceb5(++_0x102884);}(_0x344a,0xe7));var _0xa344=function(_0x490ac4,_0x57d99d){_0x490ac4=_0x490ac4-0x0;var _0x21d636=_0x344a[_0x490ac4];return _0x21d636;};'use strict';var Sequelize=require('sequelize');module[_0xa344('0x0')]={'name':{'type':Sequelize[_0xa344('0x1')]},'description':{'type':Sequelize[_0xa344('0x1')]},'username':{'type':Sequelize[_0xa344('0x1')],'unique':_0xa344('0x2')},'password':{'type':Sequelize[_0xa344('0x1')]},'email':{'type':Sequelize[_0xa344('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xa344('0x3')},'serverUrl':{'type':Sequelize[_0xa344('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xebd2=['sequelize','exports','STRING','username','remoteUri'];(function(_0x176ea9,_0x515b59){var _0x490b58=function(_0x2079c0){while(--_0x2079c0){_0x176ea9['push'](_0x176ea9['shift']());}};_0x490b58(++_0x515b59);}(_0xebd2,0x1d6));var _0x2ebd=function(_0x17e8ff,_0x3f599f){_0x17e8ff=_0x17e8ff-0x0;var _0x328d41=_0xebd2[_0x17e8ff];return _0x328d41;};'use strict';var Sequelize=require(_0x2ebd('0x0'));module[_0x2ebd('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2ebd('0x2')]},'username':{'type':Sequelize[_0x2ebd('0x2')],'unique':_0x2ebd('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2ebd('0x2')],'unique':_0x2ebd('0x4')},'serverUrl':{'type':Sequelize[_0x2ebd('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index a64755b..c6a6734 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 _0x48ed=['reopen_count','sys_tags','escalation','location','username','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','result','incident\x20table\x20objects','assign','remove','internalType','label','push','all','log','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','test','statusCode','stack','boolean','True','False','false','inactive','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','end','error','name','index','map','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ServicenowAccount','include','rows','show','params','includeAll','find','catch','create','body','findOne','ServicenowConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','number','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','impact','active','work_notes_list','sys_domain_path','rfc','time_worked','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','delivery_task','assignment_group','business_stc','description','calendar_duration','close_notes','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','reassignment_count','activity_due','comments','approval','comments_and_work_notes','due_date','sys_mod_count'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x48ed,0x189));var _0xd48e=function(_0x55dbdc,_0x2a203a){_0x55dbdc=_0x55dbdc-0x0;var _0x5d7a04=_0x48ed[_0x55dbdc];return _0x5d7a04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd48e('0x0'));var zipdir=require(_0xd48e('0x1'));var jsonpatch=require(_0xd48e('0x2'));var rp=require(_0xd48e('0x3'));var moment=require(_0xd48e('0x4'));var BPromise=require(_0xd48e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd48e('0x6'));var ejs=require(_0xd48e('0x7'));var fs=require('fs');var fs_extra=require(_0xd48e('0x8'));var _=require(_0xd48e('0x9'));var squel=require(_0xd48e('0xa'));var crypto=require('crypto');var jsforce=require(_0xd48e('0xb'));var deskjs=require(_0xd48e('0xc'));var toCsv=require(_0xd48e('0x6'));var querystring=require(_0xd48e('0xd'));var Papa=require(_0xd48e('0xe'));var Redis=require(_0xd48e('0xf'));var authService=require(_0xd48e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd48e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd48e('0x12'))(_0xd48e('0x13'));var utils=require(_0xd48e('0x14'));var config=require(_0xd48e('0x15'));var licenseUtil=require(_0xd48e('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x22b786,_0x491c33){_0x491c33=_0x491c33||0xcc;return function(_0x561143){if(_0x561143){return _0x22b786[_0xd48e('0x17')](_0x491c33);}return _0x22b786[_0xd48e('0x18')](_0x491c33)['end']();};}function respondWithResult(_0x357b4f,_0x198907){_0x198907=_0x198907||0xc8;return function(_0x37dc2b){if(_0x37dc2b){return _0x357b4f[_0xd48e('0x18')](_0x198907)[_0xd48e('0x19')](_0x37dc2b);}};}function respondWithFilteredResult(_0x56d5dc,_0x2f27da){return function(_0xbc4c09){if(_0xbc4c09){var _0x48ca05=typeof _0x2f27da[_0xd48e('0x1a')]===_0xd48e('0x1b')&&typeof _0x2f27da[_0xd48e('0x1c')]===_0xd48e('0x1b');var _0x4d3111=_0xbc4c09[_0xd48e('0x1d')];var _0x4bc742=_0x48ca05?0x0:_0x2f27da[_0xd48e('0x1a')];var _0x5e0667=_0x48ca05?_0xbc4c09[_0xd48e('0x1d')]:_0x2f27da[_0xd48e('0x1a')]+_0x2f27da[_0xd48e('0x1c')];var _0x558401;if(_0x5e0667>=_0x4d3111){_0x5e0667=_0x4d3111;_0x558401=0xc8;}else{_0x558401=0xce;}_0x56d5dc[_0xd48e('0x18')](_0x558401);return _0x56d5dc['set'](_0xd48e('0x1e'),_0x4bc742+'-'+_0x5e0667+'/'+_0x4d3111)[_0xd48e('0x19')](_0xbc4c09);}return null;};}function patchUpdates(_0x1c3139){return function(_0xea0262){try{jsonpatch[_0xd48e('0x1f')](_0xea0262,_0x1c3139,!![]);}catch(_0x3e91d5){return BPromise['reject'](_0x3e91d5);}return _0xea0262[_0xd48e('0x20')]();};}function saveUpdates(_0x40e70f,_0xb2eab4){return function(_0x128669){if(_0x128669){return _0x128669[_0xd48e('0x21')](_0x40e70f)[_0xd48e('0x22')](function(_0x235f4b){return _0x235f4b;});}return null;};}function removeEntity(_0x44f6f2,_0x25643d){return function(_0x47728f){if(_0x47728f){return _0x47728f[_0xd48e('0x23')]()[_0xd48e('0x22')](function(){_0x44f6f2['status'](0xcc)[_0xd48e('0x24')]();});}};}function handleEntityNotFound(_0x462179,_0x4878f3){return function(_0x163fa5){if(!_0x163fa5){_0x462179[_0xd48e('0x17')](0x194);}return _0x163fa5;};}function handleError(_0x31e927,_0x28e470){_0x28e470=_0x28e470||0x1f4;return function(_0x14fd05){logger[_0xd48e('0x25')](_0x14fd05['stack']);if(_0x14fd05[_0xd48e('0x26')]){delete _0x14fd05[_0xd48e('0x26')];}_0x31e927[_0xd48e('0x18')](_0x28e470)['send'](_0x14fd05);};}exports[_0xd48e('0x27')]=function(_0x123a0b,_0x2b5af1){var _0x34a610={},_0x36d341={},_0x29ef34={'count':0x0,'rows':[]};var _0x373ce0=_[_0xd48e('0x28')](db['ServicenowAccount'][_0xd48e('0x29')],function(_0x2e54a7){return{'name':_0x2e54a7['fieldName'],'type':_0x2e54a7[_0xd48e('0x2a')][_0xd48e('0x2b')]};});_0x36d341[_0xd48e('0x2c')]=_['map'](_0x373ce0,_0xd48e('0x26'));_0x36d341['query']=_[_0xd48e('0x2d')](_0x123a0b[_0xd48e('0x2e')]);_0x36d341[_0xd48e('0x2f')]=_['intersection'](_0x36d341[_0xd48e('0x2c')],_0x36d341[_0xd48e('0x2e')]);_0x34a610[_0xd48e('0x30')]=_[_0xd48e('0x31')](_0x36d341[_0xd48e('0x2c')],qs[_0xd48e('0x32')](_0x123a0b[_0xd48e('0x2e')][_0xd48e('0x32')]));_0x34a610[_0xd48e('0x30')]=_0x34a610[_0xd48e('0x30')][_0xd48e('0x33')]?_0x34a610[_0xd48e('0x30')]:_0x36d341['model'];if(!_0x123a0b[_0xd48e('0x2e')][_0xd48e('0x34')](_0xd48e('0x35'))){_0x34a610[_0xd48e('0x1c')]=qs[_0xd48e('0x1c')](_0x123a0b[_0xd48e('0x2e')]['limit']);_0x34a610[_0xd48e('0x1a')]=qs['offset'](_0x123a0b['query'][_0xd48e('0x1a')]);}_0x34a610[_0xd48e('0x36')]=qs[_0xd48e('0x37')](_0x123a0b['query'][_0xd48e('0x37')]);_0x34a610[_0xd48e('0x38')]=qs[_0xd48e('0x2f')](_[_0xd48e('0x39')](_0x123a0b[_0xd48e('0x2e')],_0x36d341[_0xd48e('0x2f')]),_0x373ce0);if(_0x123a0b[_0xd48e('0x2e')][_0xd48e('0x3a')]){_0x34a610['where']=_['merge'](_0x34a610[_0xd48e('0x38')],{'$or':_[_0xd48e('0x28')](_0x373ce0,function(_0x34cfc5){if(_0x34cfc5[_0xd48e('0x2a')]!=='VIRTUAL'){var _0x3104d7={};_0x3104d7[_0x34cfc5[_0xd48e('0x26')]]={'$like':'%'+_0x123a0b['query'][_0xd48e('0x3a')]+'%'};return _0x3104d7;}})});}_0x34a610=_[_0xd48e('0x3b')]({},_0x34a610,_0x123a0b[_0xd48e('0x3c')]);var _0xedf423={'where':_0x34a610[_0xd48e('0x38')]};return db[_0xd48e('0x3d')]['count'](_0xedf423)[_0xd48e('0x22')](function(_0x37e14a){_0x29ef34[_0xd48e('0x1d')]=_0x37e14a;if(_0x123a0b['query']['includeAll']){_0x34a610[_0xd48e('0x3e')]=[{'all':!![]}];}return db[_0xd48e('0x3d')]['findAll'](_0x34a610);})[_0xd48e('0x22')](function(_0x3482be){_0x29ef34[_0xd48e('0x3f')]=_0x3482be;return _0x29ef34;})[_0xd48e('0x22')](respondWithFilteredResult(_0x2b5af1,_0x34a610))['catch'](handleError(_0x2b5af1,null));};exports[_0xd48e('0x40')]=function(_0x3d3f79,_0x38736a){var _0x5c02e5={'raw':![],'where':{'id':_0x3d3f79[_0xd48e('0x41')]['id']}},_0x11d771={};_0x11d771[_0xd48e('0x2c')]=_[_0xd48e('0x2d')](db[_0xd48e('0x3d')][_0xd48e('0x29')]);_0x11d771['query']=_['keys'](_0x3d3f79[_0xd48e('0x2e')]);_0x11d771[_0xd48e('0x2f')]=_['intersection'](_0x11d771[_0xd48e('0x2c')],_0x11d771[_0xd48e('0x2e')]);_0x5c02e5['attributes']=_[_0xd48e('0x31')](_0x11d771[_0xd48e('0x2c')],qs[_0xd48e('0x32')](_0x3d3f79[_0xd48e('0x2e')]['fields']));_0x5c02e5[_0xd48e('0x30')]=_0x5c02e5[_0xd48e('0x30')][_0xd48e('0x33')]?_0x5c02e5[_0xd48e('0x30')]:_0x11d771['model'];if(_0x3d3f79['query'][_0xd48e('0x42')]){_0x5c02e5[_0xd48e('0x3e')]=[{'all':!![]}];}_0x5c02e5=_['merge']({},_0x5c02e5,_0x3d3f79['options']);return db['ServicenowAccount'][_0xd48e('0x43')](_0x5c02e5)['then'](handleEntityNotFound(_0x38736a,null))[_0xd48e('0x22')](respondWithResult(_0x38736a,null))[_0xd48e('0x44')](handleError(_0x38736a,null));};exports['create']=function(_0x406906,_0x2c2a4c){return db[_0xd48e('0x3d')][_0xd48e('0x45')](_0x406906[_0xd48e('0x46')],{})[_0xd48e('0x22')](respondWithResult(_0x2c2a4c,0xc9))[_0xd48e('0x44')](handleError(_0x2c2a4c,null));};exports[_0xd48e('0x21')]=function(_0x48ab2f,_0x1b2f94){if(_0x48ab2f[_0xd48e('0x46')]['id']){delete _0x48ab2f[_0xd48e('0x46')]['id'];}return db[_0xd48e('0x3d')][_0xd48e('0x43')]({'where':{'id':_0x48ab2f['params']['id']}})[_0xd48e('0x22')](handleEntityNotFound(_0x1b2f94,null))['then'](saveUpdates(_0x48ab2f[_0xd48e('0x46')],null))['then'](respondWithResult(_0x1b2f94,null))[_0xd48e('0x44')](handleError(_0x1b2f94,null));};exports[_0xd48e('0x23')]=function(_0x498ce3,_0x3d1e20){return db[_0xd48e('0x3d')][_0xd48e('0x43')]({'where':{'id':_0x498ce3['params']['id']}})[_0xd48e('0x22')](handleEntityNotFound(_0x3d1e20,null))[_0xd48e('0x22')](removeEntity(_0x3d1e20,null))[_0xd48e('0x44')](handleError(_0x3d1e20,null));};exports['getConfigurations']=function(_0x734fec,_0x15c063,_0x5b69ce){var _0x801629={};var _0x1b4cab={};var _0x15d5d6;var _0x59470d;return db[_0xd48e('0x3d')][_0xd48e('0x47')]({'where':{'id':_0x734fec[_0xd48e('0x41')]['id']}})[_0xd48e('0x22')](handleEntityNotFound(_0x15c063,null))[_0xd48e('0x22')](function(_0x22b3ed){if(_0x22b3ed){_0x15d5d6=_0x22b3ed;_0x1b4cab[_0xd48e('0x2c')]=_[_0xd48e('0x2d')](db[_0xd48e('0x48')][_0xd48e('0x29')]);_0x1b4cab['query']=_[_0xd48e('0x2d')](_0x734fec[_0xd48e('0x2e')]);_0x1b4cab[_0xd48e('0x2f')]=_[_0xd48e('0x31')](_0x1b4cab[_0xd48e('0x2c')],_0x1b4cab['query']);_0x801629[_0xd48e('0x30')]=_['intersection'](_0x1b4cab['model'],qs['fields'](_0x734fec[_0xd48e('0x2e')]['fields']));_0x801629[_0xd48e('0x30')]=_0x801629[_0xd48e('0x30')]['length']?_0x801629['attributes']:_0x1b4cab['model'];_0x801629[_0xd48e('0x36')]=qs[_0xd48e('0x37')](_0x734fec['query']['sort']);_0x801629[_0xd48e('0x38')]=qs[_0xd48e('0x2f')](_[_0xd48e('0x39')](_0x734fec['query'],_0x1b4cab[_0xd48e('0x2f')]));if(_0x734fec[_0xd48e('0x2e')][_0xd48e('0x3a')]){_0x801629[_0xd48e('0x38')]=_['merge'](_0x801629['where'],{'$or':_[_0xd48e('0x28')](_0x801629[_0xd48e('0x30')],function(_0x3b455b){var _0x5cfa49={};_0x5cfa49[_0x3b455b]={'$like':'%'+_0x734fec[_0xd48e('0x2e')]['filter']+'%'};return _0x5cfa49;})});}_0x801629=_['merge']({},_0x801629,_0x734fec['options']);return _0x15d5d6[_0xd48e('0x49')](_0x801629);}})[_0xd48e('0x22')](function(_0x4609a7){if(_0x4609a7){_0x59470d=_0x4609a7['length'];if(!_0x734fec['query']['hasOwnProperty']('nolimit')){_0x801629['limit']=qs['limit'](_0x734fec['query'][_0xd48e('0x1c')]);_0x801629['offset']=qs['offset'](_0x734fec[_0xd48e('0x2e')][_0xd48e('0x1a')]);}return _0x15d5d6[_0xd48e('0x49')](_0x801629);}})[_0xd48e('0x22')](function(_0x256a48){if(_0x256a48){return _0x256a48?{'count':_0x59470d,'rows':_0x256a48}:null;}})[_0xd48e('0x22')](respondWithResult(_0x15c063,null))[_0xd48e('0x44')](handleError(_0x15c063,null));};exports[_0xd48e('0x4a')]=function(_0x34d9dc,_0x427d0f,_0x34ca25){if(_0x34d9dc[_0xd48e('0x46')]['id']){delete _0x34d9dc[_0xd48e('0x46')]['id'];}return db[_0xd48e('0x3d')]['findOne']({'where':{'id':_0x34d9dc[_0xd48e('0x41')]['id']}})['then'](handleEntityNotFound(_0x427d0f,null))[_0xd48e('0x22')](function(_0x48cf61){if(_0x48cf61){_0x34d9dc[_0xd48e('0x46')][_0xd48e('0x4b')]=_0x48cf61['id'];_0x34d9dc[_0xd48e('0x46')][_0xd48e('0x4c')]=integrations[_0xd48e('0x4d')](_0x34d9dc['body'][_0xd48e('0x4e')],_0x34d9dc[_0xd48e('0x46')][_0xd48e('0x2a')]);_0x34d9dc[_0xd48e('0x46')][_0xd48e('0x4f')]=integrations['getDescriptions'](_0x34d9dc['body'][_0xd48e('0x4e')],_0x34d9dc[_0xd48e('0x46')][_0xd48e('0x2a')]);return db[_0xd48e('0x48')][_0xd48e('0x45')](_0x34d9dc['body'],{'include':[{'model':db[_0xd48e('0x50')],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0xd48e('0x4f')}]});}return null;})[_0xd48e('0x22')](respondWithResult(_0x427d0f,null))[_0xd48e('0x44')](handleError(_0x427d0f,null));};exports[_0xd48e('0x51')]=function(_0x1ec2fc,_0x2cc6f1,_0x5ad9df){var _0x1085f0=[_0xd48e('0x52'),_0xd48e('0x53'),_0xd48e('0x54'),_0xd48e('0x55'),'close_code',_0xd48e('0x56'),_0xd48e('0x57'),_0xd48e('0x58'),_0xd48e('0x59')];var _0x341435=[_0xd48e('0x5a'),_0xd48e('0x52'),_0xd48e('0x5b'),_0xd48e('0x5c'),_0xd48e('0x5d'),_0xd48e('0x5e'),'child_incidents',_0xd48e('0x53'),_0xd48e('0x5f'),_0xd48e('0x60'),'resolved_by',_0xd48e('0x61'),_0xd48e('0x62'),_0xd48e('0x63'),_0xd48e('0x64'),_0xd48e('0x65'),_0xd48e('0x66'),_0xd48e('0x67'),_0xd48e('0x54'),_0xd48e('0x36'),_0xd48e('0x68'),_0xd48e('0x69'),_0xd48e('0x6a'),'delivery_plan',_0xd48e('0x6b'),_0xd48e('0x6c'),_0xd48e('0x6d'),'business_service','priority',_0xd48e('0x6e'),_0xd48e('0x6f'),_0xd48e('0x70'),'expected_start','opened_at','business_duration',_0xd48e('0x71'),_0xd48e('0x72'),_0xd48e('0x73'),_0xd48e('0x74'),_0xd48e('0x75'),_0xd48e('0x76'),'subcategory',_0xd48e('0x77'),_0xd48e('0x78'),_0xd48e('0x79'),'correlation_display',_0xd48e('0x7a'),'work_start',_0xd48e('0x7b'),_0xd48e('0x7c'),'additional_assignee_list',_0xd48e('0x7d'),_0xd48e('0x7e'),_0xd48e('0x56'),'sys_class_name',_0xd48e('0x7f'),'closed_by','follow_up',_0xd48e('0x80'),_0xd48e('0x81'),_0xd48e('0x82'),_0xd48e('0x83'),'incident_state',_0xd48e('0x84'),_0xd48e('0x85'),'company',_0xd48e('0x86'),_0xd48e('0x87'),'assigned_to',_0xd48e('0x58'),_0xd48e('0x88'),'sla_due',_0xd48e('0x89'),_0xd48e('0x8a'),_0xd48e('0x8b'),_0xd48e('0x8c'),_0xd48e('0x8d'),_0xd48e('0x8e'),_0xd48e('0x8f'),'upon_approval','correlation_id',_0xd48e('0x90'),_0xd48e('0x59')];var _0x3706a1='';var _0x592e79='';var _0x246d54=[];var _0x3f1f30='';var _0x539cdb='';var _0x86a3f2=[];var _0x43de4d='';var _0x4f8cea='';var _0x2d4480={};var _0x1aa4f9='';return db[_0xd48e('0x3d')][_0xd48e('0x47')]({'where':{'id':_0x1ec2fc[_0xd48e('0x41')]['id']},'attributes':['id',_0xd48e('0x91'),_0xd48e('0x92'),_0xd48e('0x93'),_0xd48e('0x94'),_0xd48e('0x95')]})[_0xd48e('0x22')](handleEntityNotFound(_0x2cc6f1,null))[_0xd48e('0x22')](function(_0x3eea9e){if(_0x3eea9e){_0x1aa4f9=_0x3eea9e[_0xd48e('0x94')];var _0x8779a9=_0x1aa4f9[_0xd48e('0x96')](-0x1);if(_0x8779a9==='/'){_0x1aa4f9=_0x1aa4f9[_0xd48e('0x97')](0x0,_0x1aa4f9['lastIndexOf'](_0x8779a9));}_0x4f8cea=util[_0xd48e('0x98')](_0xd48e('0x99'),_0x1aa4f9);_0x43de4d=util['format'](_0xd48e('0x9a'),_0x1aa4f9);_0x2d4480={'user':_0x3eea9e[_0xd48e('0x91')],'pass':_0x3eea9e['password']};var _0x1649db={'method':_0xd48e('0x9b'),'uri':_0x4f8cea+'incident?sysparm_display_value=all','auth':_0x2d4480,'json':!![]};return rp(_0x1649db);}})[_0xd48e('0x22')](function(_0x19c4b8){if(_0x19c4b8[_0xd48e('0x9c')][_0xd48e('0x33')]>0x0){_0x3706a1=_0x19c4b8[_0xd48e('0x9c')];}console['log'](_0xd48e('0x9d'),_0x3706a1);_0x86a3f2=[];_0x592e79=Object[_0xd48e('0x9e')]([],_0x3706a1);_[_0xd48e('0x9f')](_0x592e79,function(_0x9884de){return!_0x1085f0['includes'](_0x9884de[_0xd48e('0x26')]);});_0x592e79['forEach'](function(_0x23839a){var _0x3c8fb1=createFieldObject(_0x43de4d,_0x2d4480,_0x23839a[_0xd48e('0xa0')],_0x23839a[_0xd48e('0x26')],_0x23839a[_0xd48e('0xa1')],![]);_0x86a3f2[_0xd48e('0xa2')](_0x3c8fb1);});return Promise[_0xd48e('0xa3')](_0x86a3f2);})[_0xd48e('0x22')](function(_0x53c1fa){_0x246d54=_0x53c1fa;_0x3f1f30=Object['assign']([],_0x3706a1);console[_0xd48e('0xa4')](_0xd48e('0xa5'),_0x3706a1);_[_0xd48e('0x9f')](_0x3f1f30,function(_0x56c2e7){return _0x341435[_0xd48e('0xa6')](_0x56c2e7[_0xd48e('0x26')]);});console[_0xd48e('0xa4')](_0xd48e('0xa7'),_0x3f1f30);_0x86a3f2=[];_0x3f1f30[_0xd48e('0xa8')](function(_0x2441bc){var _0x228a75=createFieldObject(_0x43de4d,_0x2d4480,_0x2441bc[_0xd48e('0xa0')],_0x2441bc['name'],_0x2441bc[_0xd48e('0xa1')],!![]);_0x86a3f2[_0xd48e('0xa2')](_0x228a75);});return Promise[_0xd48e('0xa3')](_0x86a3f2);})[_0xd48e('0x22')](function(_0x157ab5){_0x539cdb=_0x157ab5;var _0x42e6c4=_0x246d54[_0xd48e('0xa9')](_0x539cdb);return{'count':_0x42e6c4[_0xd48e('0x33')],'rows':_0x42e6c4};})[_0xd48e('0x22')](respondWithResult(_0x2cc6f1,null))['catch'](function(_0x2bc97b){console[_0xd48e('0xa4')]('ServiceNow\x20error:\x20'+_0x2bc97b);var _0x327780=_0x1ec2fc[_0xd48e('0x2e')][_0xd48e('0xaa')]?0x1f4:_0x2bc97b[_0xd48e('0xab')]||0x1f4;logger[_0xd48e('0x25')](_0x2bc97b[_0xd48e('0xac')]);delete _0x2bc97b[_0xd48e('0x26')];if(_0x327780===0x191){_0x327780=0x190;}_0x2cc6f1[_0xd48e('0x18')](_0x327780)['send'](_0x1ec2fc[_0xd48e('0x2e')][_0xd48e('0xaa')]?{'message':'Wrong\x20credentials','statusCode':_0x2bc97b[_0xd48e('0xab')]}:_0x2bc97b);});};function createFieldObject(_0x546779,_0x39c0fc,_0x117c9b,_0x38cc13,_0x42b71d,_0x3d491c){return new Promise(function(_0x395d25,_0x41576f){var _0x1f42e9={'id':_0x38cc13,'name':_0x42b71d,'custom':_0x3d491c};if(_0x117c9b===_0xd48e('0xad')){_0x1f42e9[_0xd48e('0x3c')]=[{'name':_0xd48e('0xae'),'value':'true'},{'name':_0xd48e('0xaf'),'value':_0xd48e('0xb0')}];_0x395d25(_0x1f42e9);}else{var _0x5217f0={'method':'GET','uri':_0x546779+'sys_choice?sysparm_query=name=incident^element='+_0x38cc13,'auth':_0x39c0fc,'json':!![]};return rp(_0x5217f0)[_0xd48e('0x22')](function(_0x220dda){var _0x11c31c=[];if(_0x220dda[_0xd48e('0x9c')][_0xd48e('0x33')]>0x0){_0x220dda[_0xd48e('0x9c')]['forEach'](function(_0x49b178){if(_0x49b178[_0xd48e('0xb1')]===_0xd48e('0xb0')){var _0x228bce={'name':_0x49b178[_0xd48e('0xa1')],'value':_0x49b178['value']};_0x11c31c[_0xd48e('0xa2')](_0x228bce);}});}_0x1f42e9[_0xd48e('0x3c')]=_0x11c31c;if(_0x1f42e9[_0xd48e('0x3c')][_0xd48e('0x33')]>0x0){_0x395d25(_0x1f42e9);}else{if(_0x3d491c==![]){_0x395d25();}else{_0x395d25(_0x1f42e9);}}});}});} \ No newline at end of file +var _0xab3f=['fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','apply','reject','save','update','then','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','destroy','getConfigurations','findOne','ServicenowConfiguration','sort','Descriptions','getDescriptions','channel','ServicenowField','Subjects','getFields','hold_reason','subcategory','notify','incident_state','severity','category','parent','made_sla','upon_reject','sys_updated_on','child_incidents','opened_by','user_input','sys_created_on','sys_created_by','knowledge','calendar_stc','closed_at','delivery_plan','impact','active','priority','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','calendar_duration','sys_class_name','close_notes','closed_by','parent_incident','reopened_by','urgency','problem_id','company','activity_due','assigned_to','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','serverUrl','remoteUri','slice','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','internalType','push','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','all','ServiceNow\x20error:\x20','test','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','forEach','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x47d028,_0x4d01c9){var _0x289e0c=function(_0x520547){while(--_0x520547){_0x47d028['push'](_0x47d028['shift']());}};_0x289e0c(++_0x4d01c9);}(_0xab3f,0xa4));var _0xfab3=function(_0x4a8f02,_0x525499){_0x4a8f02=_0x4a8f02-0x0;var _0x1c858a=_0xab3f[_0x4a8f02];return _0x1c858a;};'use strict';var emlformat=require(_0xfab3('0x0'));var rimraf=require(_0xfab3('0x1'));var zipdir=require(_0xfab3('0x2'));var jsonpatch=require(_0xfab3('0x3'));var rp=require(_0xfab3('0x4'));var moment=require('moment');var BPromise=require(_0xfab3('0x5'));var Mustache=require(_0xfab3('0x6'));var util=require(_0xfab3('0x7'));var path=require(_0xfab3('0x8'));var sox=require(_0xfab3('0x9'));var csv=require(_0xfab3('0xa'));var ejs=require(_0xfab3('0xb'));var fs=require('fs');var fs_extra=require(_0xfab3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfab3('0xd'));var jsforce=require(_0xfab3('0xe'));var deskjs=require(_0xfab3('0xf'));var toCsv=require(_0xfab3('0xa'));var querystring=require(_0xfab3('0x10'));var Papa=require(_0xfab3('0x11'));var Redis=require('ioredis');var authService=require(_0xfab3('0x12'));var qs=require(_0xfab3('0x13'));var as=require(_0xfab3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfab3('0x15'))('api');var utils=require(_0xfab3('0x16'));var config=require(_0xfab3('0x17'));var licenseUtil=require(_0xfab3('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2c8d6e,_0x3d95c3){_0x3d95c3=_0x3d95c3||0xcc;return function(_0x3dfadf){if(_0x3dfadf){return _0x2c8d6e[_0xfab3('0x19')](_0x3d95c3);}return _0x2c8d6e[_0xfab3('0x1a')](_0x3d95c3)[_0xfab3('0x1b')]();};}function respondWithResult(_0x2a0ad4,_0x55c01d){_0x55c01d=_0x55c01d||0xc8;return function(_0x149bd2){if(_0x149bd2){return _0x2a0ad4['status'](_0x55c01d)[_0xfab3('0x1c')](_0x149bd2);}};}function respondWithFilteredResult(_0x284df7,_0x5bdc43){return function(_0x4c3c2a){if(_0x4c3c2a){var _0x493c23=typeof _0x5bdc43['offset']===_0xfab3('0x1d')&&typeof _0x5bdc43['limit']===_0xfab3('0x1d');var _0x6415e1=_0x4c3c2a[_0xfab3('0x1e')];var _0x527537=_0x493c23?0x0:_0x5bdc43[_0xfab3('0x1f')];var _0x5c9927=_0x493c23?_0x4c3c2a[_0xfab3('0x1e')]:_0x5bdc43[_0xfab3('0x1f')]+_0x5bdc43['limit'];var _0x546de0;if(_0x5c9927>=_0x6415e1){_0x5c9927=_0x6415e1;_0x546de0=0xc8;}else{_0x546de0=0xce;}_0x284df7[_0xfab3('0x1a')](_0x546de0);return _0x284df7[_0xfab3('0x20')]('Content-Range',_0x527537+'-'+_0x5c9927+'/'+_0x6415e1)['json'](_0x4c3c2a);}return null;};}function patchUpdates(_0x442e60){return function(_0x1ec90f){try{jsonpatch[_0xfab3('0x21')](_0x1ec90f,_0x442e60,!![]);}catch(_0x575e26){return BPromise[_0xfab3('0x22')](_0x575e26);}return _0x1ec90f[_0xfab3('0x23')]();};}function saveUpdates(_0x196bad,_0x34a0db){return function(_0x5b2a4d){if(_0x5b2a4d){return _0x5b2a4d[_0xfab3('0x24')](_0x196bad)[_0xfab3('0x25')](function(_0x21c104){return _0x21c104;});}return null;};}function removeEntity(_0x4a5220,_0x3ab877){return function(_0x1914a0){if(_0x1914a0){return _0x1914a0['destroy']()['then'](function(){_0x4a5220['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b890a,_0x27562d){return function(_0x156a44){if(!_0x156a44){_0x4b890a[_0xfab3('0x19')](0x194);}return _0x156a44;};}function handleError(_0x253de6,_0x5ea37b){_0x5ea37b=_0x5ea37b||0x1f4;return function(_0x3aca90){logger[_0xfab3('0x26')](_0x3aca90[_0xfab3('0x27')]);if(_0x3aca90[_0xfab3('0x28')]){delete _0x3aca90[_0xfab3('0x28')];}_0x253de6[_0xfab3('0x1a')](_0x5ea37b)[_0xfab3('0x29')](_0x3aca90);};}exports[_0xfab3('0x2a')]=function(_0x557df2,_0x3fc401){var _0x5e0076={},_0x121177={},_0x344ddb={'count':0x0,'rows':[]};var _0x1dbe0b=_[_0xfab3('0x2b')](db[_0xfab3('0x2c')][_0xfab3('0x2d')],function(_0x2da863){return{'name':_0x2da863[_0xfab3('0x2e')],'type':_0x2da863[_0xfab3('0x2f')][_0xfab3('0x30')]};});_0x121177[_0xfab3('0x31')]=_[_0xfab3('0x2b')](_0x1dbe0b,_0xfab3('0x28'));_0x121177['query']=_[_0xfab3('0x32')](_0x557df2[_0xfab3('0x33')]);_0x121177['filters']=_[_0xfab3('0x34')](_0x121177['model'],_0x121177[_0xfab3('0x33')]);_0x5e0076[_0xfab3('0x35')]=_['intersection'](_0x121177[_0xfab3('0x31')],qs[_0xfab3('0x36')](_0x557df2['query'][_0xfab3('0x36')]));_0x5e0076[_0xfab3('0x35')]=_0x5e0076[_0xfab3('0x35')][_0xfab3('0x37')]?_0x5e0076[_0xfab3('0x35')]:_0x121177[_0xfab3('0x31')];if(!_0x557df2[_0xfab3('0x33')][_0xfab3('0x38')](_0xfab3('0x39'))){_0x5e0076[_0xfab3('0x3a')]=qs['limit'](_0x557df2[_0xfab3('0x33')][_0xfab3('0x3a')]);_0x5e0076[_0xfab3('0x1f')]=qs[_0xfab3('0x1f')](_0x557df2[_0xfab3('0x33')]['offset']);}_0x5e0076[_0xfab3('0x3b')]=qs['sort'](_0x557df2[_0xfab3('0x33')]['sort']);_0x5e0076[_0xfab3('0x3c')]=qs[_0xfab3('0x3d')](_[_0xfab3('0x3e')](_0x557df2[_0xfab3('0x33')],_0x121177[_0xfab3('0x3d')]),_0x1dbe0b);if(_0x557df2['query'][_0xfab3('0x3f')]){_0x5e0076[_0xfab3('0x3c')]=_[_0xfab3('0x40')](_0x5e0076[_0xfab3('0x3c')],{'$or':_[_0xfab3('0x2b')](_0x1dbe0b,function(_0x320f7a){if(_0x320f7a[_0xfab3('0x2f')]!=='VIRTUAL'){var _0x4e9eee={};_0x4e9eee[_0x320f7a[_0xfab3('0x28')]]={'$like':'%'+_0x557df2['query'][_0xfab3('0x3f')]+'%'};return _0x4e9eee;}})});}_0x5e0076=_[_0xfab3('0x40')]({},_0x5e0076,_0x557df2[_0xfab3('0x41')]);var _0x321926={'where':_0x5e0076[_0xfab3('0x3c')]};return db[_0xfab3('0x2c')][_0xfab3('0x1e')](_0x321926)['then'](function(_0x5ec2e9){_0x344ddb[_0xfab3('0x1e')]=_0x5ec2e9;if(_0x557df2[_0xfab3('0x33')][_0xfab3('0x42')]){_0x5e0076[_0xfab3('0x43')]=[{'all':!![]}];}return db[_0xfab3('0x2c')][_0xfab3('0x44')](_0x5e0076);})[_0xfab3('0x25')](function(_0x2bdc59){_0x344ddb[_0xfab3('0x45')]=_0x2bdc59;return _0x344ddb;})[_0xfab3('0x25')](respondWithFilteredResult(_0x3fc401,_0x5e0076))['catch'](handleError(_0x3fc401,null));};exports[_0xfab3('0x46')]=function(_0x4ee942,_0x1cf616){var _0x318959={'raw':![],'where':{'id':_0x4ee942[_0xfab3('0x47')]['id']}},_0x89f624={};_0x89f624[_0xfab3('0x31')]=_[_0xfab3('0x32')](db['ServicenowAccount'][_0xfab3('0x2d')]);_0x89f624[_0xfab3('0x33')]=_[_0xfab3('0x32')](_0x4ee942[_0xfab3('0x33')]);_0x89f624[_0xfab3('0x3d')]=_[_0xfab3('0x34')](_0x89f624[_0xfab3('0x31')],_0x89f624[_0xfab3('0x33')]);_0x318959[_0xfab3('0x35')]=_[_0xfab3('0x34')](_0x89f624[_0xfab3('0x31')],qs[_0xfab3('0x36')](_0x4ee942[_0xfab3('0x33')]['fields']));_0x318959[_0xfab3('0x35')]=_0x318959[_0xfab3('0x35')][_0xfab3('0x37')]?_0x318959['attributes']:_0x89f624[_0xfab3('0x31')];if(_0x4ee942[_0xfab3('0x33')][_0xfab3('0x42')]){_0x318959[_0xfab3('0x43')]=[{'all':!![]}];}_0x318959=_['merge']({},_0x318959,_0x4ee942['options']);return db[_0xfab3('0x2c')][_0xfab3('0x48')](_0x318959)[_0xfab3('0x25')](handleEntityNotFound(_0x1cf616,null))[_0xfab3('0x25')](respondWithResult(_0x1cf616,null))['catch'](handleError(_0x1cf616,null));};exports[_0xfab3('0x49')]=function(_0x34beba,_0x480776){return db[_0xfab3('0x2c')][_0xfab3('0x49')](_0x34beba[_0xfab3('0x4a')],{})[_0xfab3('0x25')](respondWithResult(_0x480776,0xc9))[_0xfab3('0x4b')](handleError(_0x480776,null));};exports[_0xfab3('0x24')]=function(_0x187091,_0x18a55f){if(_0x187091[_0xfab3('0x4a')]['id']){delete _0x187091[_0xfab3('0x4a')]['id'];}return db['ServicenowAccount'][_0xfab3('0x48')]({'where':{'id':_0x187091[_0xfab3('0x47')]['id']}})[_0xfab3('0x25')](handleEntityNotFound(_0x18a55f,null))['then'](saveUpdates(_0x187091['body'],null))[_0xfab3('0x25')](respondWithResult(_0x18a55f,null))[_0xfab3('0x4b')](handleError(_0x18a55f,null));};exports[_0xfab3('0x4c')]=function(_0x1183c8,_0x3fe325){return db[_0xfab3('0x2c')]['find']({'where':{'id':_0x1183c8[_0xfab3('0x47')]['id']}})[_0xfab3('0x25')](handleEntityNotFound(_0x3fe325,null))[_0xfab3('0x25')](removeEntity(_0x3fe325,null))[_0xfab3('0x4b')](handleError(_0x3fe325,null));};exports[_0xfab3('0x4d')]=function(_0x247f6f,_0x4850d0,_0xea3c90){var _0xa731a={};var _0x116a38={};var _0x5dc6f5;var _0x1c4397;return db[_0xfab3('0x2c')][_0xfab3('0x4e')]({'where':{'id':_0x247f6f[_0xfab3('0x47')]['id']}})[_0xfab3('0x25')](handleEntityNotFound(_0x4850d0,null))['then'](function(_0x3bc7c0){if(_0x3bc7c0){_0x5dc6f5=_0x3bc7c0;_0x116a38[_0xfab3('0x31')]=_['keys'](db[_0xfab3('0x4f')][_0xfab3('0x2d')]);_0x116a38[_0xfab3('0x33')]=_[_0xfab3('0x32')](_0x247f6f['query']);_0x116a38[_0xfab3('0x3d')]=_[_0xfab3('0x34')](_0x116a38[_0xfab3('0x31')],_0x116a38[_0xfab3('0x33')]);_0xa731a[_0xfab3('0x35')]=_[_0xfab3('0x34')](_0x116a38[_0xfab3('0x31')],qs[_0xfab3('0x36')](_0x247f6f[_0xfab3('0x33')][_0xfab3('0x36')]));_0xa731a[_0xfab3('0x35')]=_0xa731a[_0xfab3('0x35')][_0xfab3('0x37')]?_0xa731a['attributes']:_0x116a38[_0xfab3('0x31')];_0xa731a[_0xfab3('0x3b')]=qs[_0xfab3('0x50')](_0x247f6f[_0xfab3('0x33')][_0xfab3('0x50')]);_0xa731a[_0xfab3('0x3c')]=qs[_0xfab3('0x3d')](_[_0xfab3('0x3e')](_0x247f6f[_0xfab3('0x33')],_0x116a38['filters']));if(_0x247f6f[_0xfab3('0x33')][_0xfab3('0x3f')]){_0xa731a[_0xfab3('0x3c')]=_[_0xfab3('0x40')](_0xa731a[_0xfab3('0x3c')],{'$or':_['map'](_0xa731a[_0xfab3('0x35')],function(_0x428c13){var _0x4c3d3a={};_0x4c3d3a[_0x428c13]={'$like':'%'+_0x247f6f[_0xfab3('0x33')][_0xfab3('0x3f')]+'%'};return _0x4c3d3a;})});}_0xa731a=_[_0xfab3('0x40')]({},_0xa731a,_0x247f6f['options']);return _0x5dc6f5['getConfigurations'](_0xa731a);}})[_0xfab3('0x25')](function(_0x298160){if(_0x298160){_0x1c4397=_0x298160['length'];if(!_0x247f6f['query']['hasOwnProperty'](_0xfab3('0x39'))){_0xa731a[_0xfab3('0x3a')]=qs[_0xfab3('0x3a')](_0x247f6f[_0xfab3('0x33')][_0xfab3('0x3a')]);_0xa731a[_0xfab3('0x1f')]=qs['offset'](_0x247f6f['query'][_0xfab3('0x1f')]);}return _0x5dc6f5[_0xfab3('0x4d')](_0xa731a);}})[_0xfab3('0x25')](function(_0x32fa99){if(_0x32fa99){return _0x32fa99?{'count':_0x1c4397,'rows':_0x32fa99}:null;}})[_0xfab3('0x25')](respondWithResult(_0x4850d0,null))[_0xfab3('0x4b')](handleError(_0x4850d0,null));};exports['addConfiguration']=function(_0x147476,_0x3724b1,_0x38b947){if(_0x147476['body']['id']){delete _0x147476['body']['id'];}return db[_0xfab3('0x2c')][_0xfab3('0x4e')]({'where':{'id':_0x147476[_0xfab3('0x47')]['id']}})[_0xfab3('0x25')](handleEntityNotFound(_0x3724b1,null))[_0xfab3('0x25')](function(_0x462b96){if(_0x462b96){_0x147476[_0xfab3('0x4a')]['AccountId']=_0x462b96['id'];_0x147476[_0xfab3('0x4a')]['Subjects']=integrations['getSubjects'](_0x147476['body']['channel'],_0x147476[_0xfab3('0x4a')]['type']);_0x147476['body'][_0xfab3('0x51')]=integrations[_0xfab3('0x52')](_0x147476[_0xfab3('0x4a')][_0xfab3('0x53')],_0x147476[_0xfab3('0x4a')][_0xfab3('0x2f')]);return db[_0xfab3('0x4f')][_0xfab3('0x49')](_0x147476[_0xfab3('0x4a')],{'include':[{'model':db[_0xfab3('0x54')],'as':_0xfab3('0x55')},{'model':db[_0xfab3('0x54')],'as':'Descriptions'}]});}return null;})[_0xfab3('0x25')](respondWithResult(_0x3724b1,null))[_0xfab3('0x4b')](handleError(_0x3724b1,null));};exports[_0xfab3('0x56')]=function(_0xfebf8e,_0x205f9f,_0xa0b4c7){var _0x4eca21=['made_sla',_0xfab3('0x57'),'knowledge',_0xfab3('0x58'),'close_code',_0xfab3('0x59'),_0xfab3('0x5a'),_0xfab3('0x5b'),_0xfab3('0x5c')];var _0x344a31=[_0xfab3('0x5d'),_0xfab3('0x5e'),'caused_by','watch_list',_0xfab3('0x5f'),_0xfab3('0x60'),_0xfab3('0x61'),_0xfab3('0x57'),'approval_history','number','resolved_by','sys_updated_by',_0xfab3('0x62'),_0xfab3('0x63'),_0xfab3('0x64'),'sys_domain','state',_0xfab3('0x65'),_0xfab3('0x66'),_0xfab3('0x3b'),_0xfab3('0x67'),_0xfab3('0x68'),'cmdb_ci',_0xfab3('0x69'),_0xfab3('0x6a'),_0xfab3('0x6b'),'work_notes_list','business_service',_0xfab3('0x6c'),'sys_domain_path',_0xfab3('0x6d'),_0xfab3('0x6e'),_0xfab3('0x6f'),'opened_at',_0xfab3('0x70'),_0xfab3('0x71'),_0xfab3('0x72'),_0xfab3('0x73'),_0xfab3('0x74'),_0xfab3('0x75'),_0xfab3('0x76'),_0xfab3('0x58'),_0xfab3('0x77'),_0xfab3('0x78'),'close_code',_0xfab3('0x79'),_0xfab3('0x7a'),_0xfab3('0x7b'),_0xfab3('0x7c'),_0xfab3('0x7d'),'additional_assignee_list','description',_0xfab3('0x7e'),_0xfab3('0x59'),_0xfab3('0x7f'),_0xfab3('0x80'),_0xfab3('0x81'),'follow_up',_0xfab3('0x82'),'sys_id','contact_type',_0xfab3('0x83'),'incident_state',_0xfab3('0x84'),_0xfab3('0x85'),_0xfab3('0x86'),'reassignment_count',_0xfab3('0x87'),_0xfab3('0x88'),_0xfab3('0x5b'),'comments','sla_due','approval','comments_and_work_notes','due_date',_0xfab3('0x89'),_0xfab3('0x8a'),_0xfab3('0x8b'),_0xfab3('0x8c'),_0xfab3('0x8d'),_0xfab3('0x8e'),_0xfab3('0x8f'),_0xfab3('0x5c')];var _0x3ed656='';var _0x155163='';var _0x510f89=[];var _0x179c8a='';var _0x5bb06d='';var _0x5aac78=[];var _0x22576d='';var _0x4e138b='';var _0x5cee29={};var _0x47c97e='';return db[_0xfab3('0x2c')][_0xfab3('0x4e')]({'where':{'id':_0xfebf8e[_0xfab3('0x47')]['id']},'attributes':['id',_0xfab3('0x90'),_0xfab3('0x91'),_0xfab3('0x92'),'remoteUri',_0xfab3('0x93')]})[_0xfab3('0x25')](handleEntityNotFound(_0x205f9f,null))[_0xfab3('0x25')](function(_0x56833b){if(_0x56833b){_0x47c97e=_0x56833b[_0xfab3('0x94')];var _0x2249d9=_0x47c97e[_0xfab3('0x95')](-0x1);if(_0x2249d9==='/'){_0x47c97e=_0x47c97e['substring'](0x0,_0x47c97e[_0xfab3('0x96')](_0x2249d9));}_0x4e138b=util[_0xfab3('0x97')]('%s/api/now/doc/table/schema/',_0x47c97e);_0x22576d=util[_0xfab3('0x97')](_0xfab3('0x98'),_0x47c97e);_0x5cee29={'user':_0x56833b[_0xfab3('0x90')],'pass':_0x56833b[_0xfab3('0x91')]};var _0x54e7ef={'method':_0xfab3('0x99'),'uri':_0x4e138b+_0xfab3('0x9a'),'auth':_0x5cee29,'json':!![]};return rp(_0x54e7ef);}})[_0xfab3('0x25')](function(_0x37d116){if(_0x37d116[_0xfab3('0x9b')][_0xfab3('0x37')]>0x0){_0x3ed656=_0x37d116['result'];}console[_0xfab3('0x9c')]('incident\x20table\x20objects',_0x3ed656);_0x5aac78=[];_0x155163=Object[_0xfab3('0x9d')]([],_0x3ed656);_[_0xfab3('0x9e')](_0x155163,function(_0xaa1a69){return!_0x4eca21[_0xfab3('0x9f')](_0xaa1a69[_0xfab3('0x28')]);});_0x155163['forEach'](function(_0x375a34){var _0x173d8f=createFieldObject(_0x22576d,_0x5cee29,_0x375a34[_0xfab3('0xa0')],_0x375a34[_0xfab3('0x28')],_0x375a34['label'],![]);_0x5aac78[_0xfab3('0xa1')](_0x173d8f);});return Promise['all'](_0x5aac78);})[_0xfab3('0x25')](function(_0x2e3c6a){_0x510f89=_0x2e3c6a;_0x179c8a=Object[_0xfab3('0x9d')]([],_0x3ed656);console[_0xfab3('0x9c')]('TCL:\x20_object',_0x3ed656);_[_0xfab3('0x9e')](_0x179c8a,function(_0x275484){return _0x344a31[_0xfab3('0x9f')](_0x275484['name']);});console[_0xfab3('0x9c')](_0xfab3('0xa2'),_0x179c8a);_0x5aac78=[];_0x179c8a['forEach'](function(_0x46c559){var _0x254b19=createFieldObject(_0x22576d,_0x5cee29,_0x46c559['internalType'],_0x46c559[_0xfab3('0x28')],_0x46c559[_0xfab3('0xa3')],!![]);_0x5aac78[_0xfab3('0xa1')](_0x254b19);});return Promise[_0xfab3('0xa4')](_0x5aac78);})[_0xfab3('0x25')](function(_0x610e45){_0x5bb06d=_0x610e45;var _0x1834a1=_0x510f89['concat'](_0x5bb06d);return{'count':_0x1834a1['length'],'rows':_0x1834a1};})[_0xfab3('0x25')](respondWithResult(_0x205f9f,null))[_0xfab3('0x4b')](function(_0x3e5bc0){console[_0xfab3('0x9c')](_0xfab3('0xa5')+_0x3e5bc0);var _0x423a9f=_0xfebf8e[_0xfab3('0x33')]['test']?0x1f4:_0x3e5bc0['statusCode']||0x1f4;logger[_0xfab3('0x26')](_0x3e5bc0[_0xfab3('0x27')]);delete _0x3e5bc0[_0xfab3('0x28')];if(_0x423a9f===0x191){_0x423a9f=0x190;}_0x205f9f['status'](_0x423a9f)[_0xfab3('0x29')](_0xfebf8e['query'][_0xfab3('0xa6')]?{'message':'Wrong\x20credentials','statusCode':_0x3e5bc0[_0xfab3('0xa7')]}:_0x3e5bc0);});};function createFieldObject(_0x103d40,_0x3d920c,_0xe7b9e3,_0xc2b37f,_0x3e3183,_0x140379){return new Promise(function(_0x3a3908,_0x47fc7e){var _0x2bf91c={'id':_0xc2b37f,'name':_0x3e3183,'custom':_0x140379};if(_0xe7b9e3===_0xfab3('0xa8')){_0x2bf91c[_0xfab3('0x41')]=[{'name':_0xfab3('0xa9'),'value':_0xfab3('0xaa')},{'name':_0xfab3('0xab'),'value':_0xfab3('0xac')}];_0x3a3908(_0x2bf91c);}else{var _0x35c69a={'method':_0xfab3('0x99'),'uri':_0x103d40+_0xfab3('0xad')+_0xc2b37f,'auth':_0x3d920c,'json':!![]};return rp(_0x35c69a)[_0xfab3('0x25')](function(_0x92be02){var _0x5d74ba=[];if(_0x92be02[_0xfab3('0x9b')][_0xfab3('0x37')]>0x0){_0x92be02[_0xfab3('0x9b')][_0xfab3('0xae')](function(_0x4785ce){if(_0x4785ce['inactive']===_0xfab3('0xac')){var _0x2a0a68={'name':_0x4785ce[_0xfab3('0xa3')],'value':_0x4785ce[_0xfab3('0xaf')]};_0x5d74ba[_0xfab3('0xa1')](_0x2a0a68);}});}_0x2bf91c[_0xfab3('0x41')]=_0x5d74ba;if(_0x2bf91c[_0xfab3('0x41')][_0xfab3('0x37')]>0x0){_0x3a3908(_0x2bf91c);}else{if(_0x140379==![]){_0x3a3908();}else{_0x3a3908(_0x2bf91c);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index fc13736..0cb1fcf 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 _0x7dfd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount'];(function(_0x2a64b9,_0x21d13d){var _0x53f25=function(_0xd0f4e6){while(--_0xd0f4e6){_0x2a64b9['push'](_0x2a64b9['shift']());}};_0x53f25(++_0x21d13d);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var logger=require(_0xd7df('0x2'))(_0xd7df('0x3'));var moment=require(_0xd7df('0x4'));var BPromise=require(_0xd7df('0x5'));var rp=require(_0xd7df('0x6'));var fs=require('fs');var path=require(_0xd7df('0x7'));var rimraf=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var attributes=require(_0xd7df('0xa'));var integrations=require(_0xd7df('0xb'));module[_0xd7df('0xc')]=function(_0x39ce98,_0x354ea7){return _0x39ce98[_0xd7df('0xd')](_0xd7df('0xe'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeff8=['rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','int_servicenow_accounts','lodash','util','api','moment','bluebird','path'];(function(_0x56ba58,_0x1697c4){var _0x337772=function(_0x1fd2e8){while(--_0x1fd2e8){_0x56ba58['push'](_0x56ba58['shift']());}};_0x337772(++_0x1697c4);}(_0xeff8,0x186));var _0x8eff=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xeff8[_0x5c9307];return _0x373e29;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8eff('0x9')]=function(_0xb54063,_0x3409bc){return _0xb54063[_0x8eff('0xa')]('ServicenowAccount',attributes,{'tableName':_0x8eff('0xb'),'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 5d84963..b1a9a44 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 _0x1fb6=['result','catch','GetServicenowAccount','findAll','options','raw','where','attributes','include','map','model','debug','find','ShowServicenowAccount','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xcba6f6,_0x41bbe7){var _0x46648e=function(_0x562cee){while(--_0x562cee){_0xcba6f6['push'](_0xcba6f6['shift']());}};_0x46648e(++_0x41bbe7);}(_0x1fb6,0xda));var _0x61fb=function(_0xdf823b,_0xb7a521){_0xdf823b=_0xdf823b-0x0;var _0x1bb009=_0x1fb6[_0xdf823b];return _0x1bb009;};'use strict';var _=require(_0x61fb('0x0'));var util=require('util');var moment=require(_0x61fb('0x1'));var BPromise=require(_0x61fb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x61fb('0x3'));var db=require(_0x61fb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x61fb('0x5'))(_0x61fb('0x6'));var config=require(_0x61fb('0x7'));var jayson=require(_0x61fb('0x8'));var client=jayson[_0x61fb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a60c6,_0x56c4e7,_0x16e732){return new BPromise(function(_0x37690b,_0x5e53b9){return client[_0x61fb('0xa')](_0x2a60c6,_0x16e732)[_0x61fb('0xb')](function(_0x195e67){logger[_0x61fb('0xc')](_0x61fb('0xd'),_0x56c4e7,_0x61fb('0xe'));logger['debug'](_0x61fb('0xf'),_0x56c4e7,_0x61fb('0xe'),JSON[_0x61fb('0x10')](_0x195e67));if(_0x195e67[_0x61fb('0x11')]){if(_0x195e67[_0x61fb('0x11')][_0x61fb('0x12')]===0x1f4){logger[_0x61fb('0x11')](_0x61fb('0xd'),_0x56c4e7,_0x195e67['error'][_0x61fb('0x13')]);return _0x5e53b9(_0x195e67[_0x61fb('0x11')]['message']);}logger[_0x61fb('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x56c4e7,_0x195e67['error']['message']);return _0x37690b(_0x195e67[_0x61fb('0x11')]['message']);}else{logger[_0x61fb('0xc')](_0x61fb('0xd'),_0x56c4e7,_0x61fb('0xe'));_0x37690b(_0x195e67[_0x61fb('0x14')][_0x61fb('0x13')]);}})[_0x61fb('0x15')](function(_0x38bac6){logger[_0x61fb('0x11')](_0x61fb('0xd'),_0x56c4e7,_0x38bac6);_0x5e53b9(_0x38bac6);});});}exports[_0x61fb('0x16')]=function(_0x1fbaf0){var _0x3a6e08=this;return new Promise(function(_0x50ad5c,_0x1b4ba4){return db['ServicenowAccount'][_0x61fb('0x17')]({'raw':_0x1fbaf0[_0x61fb('0x18')]?_0x1fbaf0[_0x61fb('0x18')][_0x61fb('0x19')]===undefined?!![]:![]:!![],'where':_0x1fbaf0['options']?_0x1fbaf0['options'][_0x61fb('0x1a')]||null:null,'attributes':_0x1fbaf0['options']?_0x1fbaf0[_0x61fb('0x18')][_0x61fb('0x1b')]||null:null,'limit':_0x1fbaf0['options']?_0x1fbaf0[_0x61fb('0x18')]['limit']||null:null,'include':_0x1fbaf0[_0x61fb('0x18')]?_0x1fbaf0[_0x61fb('0x18')][_0x61fb('0x1c')]?_['map'](_0x1fbaf0['options'][_0x61fb('0x1c')],function(_0x4b2409){return{'model':db[_0x4b2409['model']],'as':_0x4b2409['as'],'attributes':_0x4b2409[_0x61fb('0x1b')],'include':_0x4b2409[_0x61fb('0x1c')]?_[_0x61fb('0x1d')](_0x4b2409[_0x61fb('0x1c')],function(_0x47c4f){return{'model':db[_0x47c4f[_0x61fb('0x1e')]],'as':_0x47c4f['as'],'attributes':_0x47c4f['attributes'],'include':_0x47c4f[_0x61fb('0x1c')]?_['map'](_0x47c4f[_0x61fb('0x1c')],function(_0x9a48a9){return{'model':db[_0x9a48a9['model']],'as':_0x9a48a9['as'],'attributes':_0x9a48a9[_0x61fb('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x61fb('0xb')](function(_0x4bda88){logger[_0x61fb('0xc')](_0x61fb('0x16'),_0x1fbaf0);logger[_0x61fb('0x1f')](_0x61fb('0x16'),_0x1fbaf0,JSON[_0x61fb('0x10')](_0x4bda88));_0x50ad5c(_0x4bda88);})['catch'](function(_0x29a426){logger['error'](_0x61fb('0x16'),_0x29a426[_0x61fb('0x13')],_0x1fbaf0);_0x1b4ba4(_0x3a6e08[_0x61fb('0x11')](0x1f4,_0x29a426['message']));});});};exports['ShowServicenowAccount']=function(_0x1dc657){var _0x4d30ee=this;return new Promise(function(_0x5b03b2,_0x2c2f32){return db['ServicenowAccount'][_0x61fb('0x20')]({'raw':_0x1dc657[_0x61fb('0x18')]?_0x1dc657['options']['raw']===undefined?!![]:![]:!![],'where':_0x1dc657['options']?_0x1dc657[_0x61fb('0x18')][_0x61fb('0x1a')]||null:null,'attributes':_0x1dc657[_0x61fb('0x18')]?_0x1dc657[_0x61fb('0x18')][_0x61fb('0x1b')]||null:null,'include':_0x1dc657[_0x61fb('0x18')]?_0x1dc657[_0x61fb('0x18')]['include']?_[_0x61fb('0x1d')](_0x1dc657[_0x61fb('0x18')][_0x61fb('0x1c')],function(_0x591cf8){return{'model':db[_0x591cf8[_0x61fb('0x1e')]],'as':_0x591cf8['as'],'attributes':_0x591cf8[_0x61fb('0x1b')],'include':_0x591cf8['include']?_[_0x61fb('0x1d')](_0x591cf8[_0x61fb('0x1c')],function(_0x313c75){return{'model':db[_0x313c75[_0x61fb('0x1e')]],'as':_0x313c75['as'],'attributes':_0x313c75[_0x61fb('0x1b')],'include':_0x313c75['include']?_['map'](_0x313c75['include'],function(_0x187e5e){return{'model':db[_0x187e5e[_0x61fb('0x1e')]],'as':_0x187e5e['as'],'attributes':_0x187e5e[_0x61fb('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x61fb('0xb')](function(_0x356db5){logger[_0x61fb('0xc')]('ShowServicenowAccount',_0x1dc657);logger[_0x61fb('0x1f')](_0x61fb('0x21'),_0x1dc657,JSON[_0x61fb('0x10')](_0x356db5));_0x5b03b2(_0x356db5);})['catch'](function(_0x227c0d){logger[_0x61fb('0x11')](_0x61fb('0x21'),_0x227c0d[_0x61fb('0x13')],_0x1dc657);_0x2c2f32(_0x4d30ee['error'](0x1f4,_0x227c0d[_0x61fb('0x13')]));});});}; \ No newline at end of file +var _0x46ea=['debug','stringify','error','message','result','GetServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ServicenowAccount','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent'];(function(_0xa382ea,_0x44d99e){var _0x64c190=function(_0xee1ec9){while(--_0xee1ec9){_0xa382ea['push'](_0xa382ea['shift']());}};_0x64c190(++_0x44d99e);}(_0x46ea,0x188));var _0xa46e=function(_0x5df265,_0x131e1c){_0x5df265=_0x5df265-0x0;var _0x4b37e5=_0x46ea[_0x5df265];return _0x4b37e5;};'use strict';var _=require(_0xa46e('0x0'));var util=require(_0xa46e('0x1'));var moment=require(_0xa46e('0x2'));var BPromise=require(_0xa46e('0x3'));var rs=require(_0xa46e('0x4'));var fs=require('fs');var Redis=require(_0xa46e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa46e('0x6'))(_0xa46e('0x7'));var config=require(_0xa46e('0x8'));var jayson=require(_0xa46e('0x9'));var client=jayson[_0xa46e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd0a732,_0xb8960,_0x582bfe){return new BPromise(function(_0x4f8d28,_0x1cef9a){return client[_0xa46e('0xb')](_0xd0a732,_0x582bfe)[_0xa46e('0xc')](function(_0x4e1539){logger[_0xa46e('0xd')](_0xa46e('0xe'),_0xb8960,_0xa46e('0xf'));logger[_0xa46e('0x10')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0xb8960,_0xa46e('0xf'),JSON[_0xa46e('0x11')](_0x4e1539));if(_0x4e1539[_0xa46e('0x12')]){if(_0x4e1539[_0xa46e('0x12')]['code']===0x1f4){logger['error'](_0xa46e('0xe'),_0xb8960,_0x4e1539[_0xa46e('0x12')][_0xa46e('0x13')]);return _0x1cef9a(_0x4e1539['error'][_0xa46e('0x13')]);}logger[_0xa46e('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0xb8960,_0x4e1539[_0xa46e('0x12')][_0xa46e('0x13')]);return _0x4f8d28(_0x4e1539[_0xa46e('0x12')][_0xa46e('0x13')]);}else{logger['info'](_0xa46e('0xe'),_0xb8960,_0xa46e('0xf'));_0x4f8d28(_0x4e1539[_0xa46e('0x14')][_0xa46e('0x13')]);}})['catch'](function(_0x50640e){logger[_0xa46e('0x12')](_0xa46e('0xe'),_0xb8960,_0x50640e);_0x1cef9a(_0x50640e);});});}exports[_0xa46e('0x15')]=function(_0x5d9a8e){var _0x171296=this;return new Promise(function(_0x1393ea,_0x50d843){return db['ServicenowAccount'][_0xa46e('0x16')]({'raw':_0x5d9a8e[_0xa46e('0x17')]?_0x5d9a8e[_0xa46e('0x17')][_0xa46e('0x18')]===undefined?!![]:![]:!![],'where':_0x5d9a8e[_0xa46e('0x17')]?_0x5d9a8e[_0xa46e('0x17')][_0xa46e('0x19')]||null:null,'attributes':_0x5d9a8e[_0xa46e('0x17')]?_0x5d9a8e[_0xa46e('0x17')][_0xa46e('0x1a')]||null:null,'limit':_0x5d9a8e[_0xa46e('0x17')]?_0x5d9a8e[_0xa46e('0x17')][_0xa46e('0x1b')]||null:null,'include':_0x5d9a8e['options']?_0x5d9a8e[_0xa46e('0x17')][_0xa46e('0x1c')]?_[_0xa46e('0x1d')](_0x5d9a8e['options'][_0xa46e('0x1c')],function(_0x5ec2ab){return{'model':db[_0x5ec2ab['model']],'as':_0x5ec2ab['as'],'attributes':_0x5ec2ab[_0xa46e('0x1a')],'include':_0x5ec2ab[_0xa46e('0x1c')]?_['map'](_0x5ec2ab[_0xa46e('0x1c')],function(_0x4f96d0){return{'model':db[_0x4f96d0[_0xa46e('0x1e')]],'as':_0x4f96d0['as'],'attributes':_0x4f96d0[_0xa46e('0x1a')],'include':_0x4f96d0[_0xa46e('0x1c')]?_['map'](_0x4f96d0[_0xa46e('0x1c')],function(_0x514693){return{'model':db[_0x514693[_0xa46e('0x1e')]],'as':_0x514693['as'],'attributes':_0x514693[_0xa46e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa46e('0xc')](function(_0x1089f7){logger[_0xa46e('0xd')](_0xa46e('0x15'),_0x5d9a8e);logger[_0xa46e('0x10')](_0xa46e('0x15'),_0x5d9a8e,JSON['stringify'](_0x1089f7));_0x1393ea(_0x1089f7);})[_0xa46e('0x1f')](function(_0x550a3e){logger['error'](_0xa46e('0x15'),_0x550a3e[_0xa46e('0x13')],_0x5d9a8e);_0x50d843(_0x171296[_0xa46e('0x12')](0x1f4,_0x550a3e[_0xa46e('0x13')]));});});};exports['ShowServicenowAccount']=function(_0x39e8bf){var _0x815a31=this;return new Promise(function(_0x55b428,_0x2d533b){return db[_0xa46e('0x20')]['find']({'raw':_0x39e8bf[_0xa46e('0x17')]?_0x39e8bf[_0xa46e('0x17')][_0xa46e('0x18')]===undefined?!![]:![]:!![],'where':_0x39e8bf[_0xa46e('0x17')]?_0x39e8bf[_0xa46e('0x17')]['where']||null:null,'attributes':_0x39e8bf[_0xa46e('0x17')]?_0x39e8bf['options']['attributes']||null:null,'include':_0x39e8bf[_0xa46e('0x17')]?_0x39e8bf[_0xa46e('0x17')][_0xa46e('0x1c')]?_['map'](_0x39e8bf[_0xa46e('0x17')][_0xa46e('0x1c')],function(_0x581521){return{'model':db[_0x581521['model']],'as':_0x581521['as'],'attributes':_0x581521['attributes'],'include':_0x581521['include']?_[_0xa46e('0x1d')](_0x581521[_0xa46e('0x1c')],function(_0x3d17fd){return{'model':db[_0x3d17fd['model']],'as':_0x3d17fd['as'],'attributes':_0x3d17fd[_0xa46e('0x1a')],'include':_0x3d17fd[_0xa46e('0x1c')]?_[_0xa46e('0x1d')](_0x3d17fd[_0xa46e('0x1c')],function(_0x551988){return{'model':db[_0x551988[_0xa46e('0x1e')]],'as':_0x551988['as'],'attributes':_0x551988['attributes']};}):[]};}):[]};}):[]:[]})[_0xa46e('0xc')](function(_0x4b1bfd){logger['info'](_0xa46e('0x21'),_0x39e8bf);logger[_0xa46e('0x10')](_0xa46e('0x21'),_0x39e8bf,JSON[_0xa46e('0x11')](_0x4b1bfd));_0x55b428(_0x4b1bfd);})[_0xa46e('0x1f')](function(_0x121130){logger[_0xa46e('0x12')](_0xa46e('0x21'),_0x121130['message'],_0x39e8bf);_0x2d533b(_0x815a31[_0xa46e('0x12')](0x1f4,_0x121130[_0xa46e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 305ac34..b143fc9 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 _0x4278=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','index','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x456492,_0x41ea6f){var _0x36dbb3=function(_0x218d87){while(--_0x218d87){_0x456492['push'](_0x456492['shift']());}};_0x36dbb3(++_0x41ea6f);}(_0x4278,0xad));var _0x8427=function(_0x8d9b2c,_0xaa9404){_0x8d9b2c=_0x8d9b2c-0x0;var _0xbe0c01=_0x4278[_0x8d9b2c];return _0xbe0c01;};'use strict';var multer=require(_0x8427('0x0'));var util=require(_0x8427('0x1'));var path=require(_0x8427('0x2'));var timeout=require(_0x8427('0x3'));var express=require(_0x8427('0x4'));var router=express[_0x8427('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8427('0x6'));var interaction=require(_0x8427('0x7'));var config=require(_0x8427('0x8'));var controller=require(_0x8427('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8427('0xa')]);router[_0x8427('0xb')](_0x8427('0xc'),auth[_0x8427('0xd')](),controller[_0x8427('0xe')]);router[_0x8427('0xb')](_0x8427('0xf'),auth[_0x8427('0xd')](),controller[_0x8427('0x10')]);router[_0x8427('0xb')](_0x8427('0x11'),auth['isAuthenticated'](),controller[_0x8427('0x12')]);router['get'](_0x8427('0x13'),auth[_0x8427('0xd')](),controller[_0x8427('0x14')]);router[_0x8427('0x15')]('/',auth[_0x8427('0xd')](),controller[_0x8427('0x16')]);router[_0x8427('0x17')](_0x8427('0xc'),auth['isAuthenticated'](),controller[_0x8427('0x18')]);router[_0x8427('0x19')](_0x8427('0xc'),auth[_0x8427('0xd')](),controller[_0x8427('0x1a')]);module[_0x8427('0x1b')]=router; \ No newline at end of file +var _0x968a=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','put'];(function(_0x185ca3,_0x91cdcb){var _0x7df8c5=function(_0x2c42fc){while(--_0x2c42fc){_0x185ca3['push'](_0x185ca3['shift']());}};_0x7df8c5(++_0x91cdcb);}(_0x968a,0xbc));var _0xa968=function(_0xf78922,_0x211eca){_0xf78922=_0xf78922-0x0;var _0x18312e=_0x968a[_0xf78922];return _0x18312e;};'use strict';var multer=require(_0xa968('0x0'));var util=require(_0xa968('0x1'));var path=require(_0xa968('0x2'));var timeout=require(_0xa968('0x3'));var express=require('express');var router=express[_0xa968('0x4')]();var fs_extra=require(_0xa968('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa968('0x6'));router[_0xa968('0x7')]('/',auth[_0xa968('0x8')](),controller[_0xa968('0x9')]);router['get'](_0xa968('0xa'),auth[_0xa968('0x8')](),controller[_0xa968('0xb')]);router[_0xa968('0x7')](_0xa968('0xc'),auth[_0xa968('0x8')](),controller[_0xa968('0xd')]);router['get'](_0xa968('0xe'),auth[_0xa968('0x8')](),controller[_0xa968('0xf')]);router[_0xa968('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xa968('0x10')]);router[_0xa968('0x11')]('/',auth[_0xa968('0x8')](),controller['create']);router[_0xa968('0x12')](_0xa968('0xa'),auth[_0xa968('0x8')](),controller[_0xa968('0x13')]);router[_0xa968('0x14')](_0xa968('0xa'),auth[_0xa968('0x8')](),controller[_0xa968('0x15')]);module[_0xa968('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index fc586d5..e1e1c29 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 _0x74fa=['STRING','exports'];(function(_0x4fc001,_0x263451){var _0x2ca5df=function(_0xf7613c){while(--_0xf7613c){_0x4fc001['push'](_0x4fc001['shift']());}};_0x2ca5df(++_0x263451);}(_0x74fa,0xb3));var _0xa74f=function(_0x156816,_0xd1637b){_0x156816=_0x156816-0x0;var _0xf78c8=_0x74fa[_0x156816];return _0xf78c8;};'use strict';var Sequelize=require('sequelize');module[_0xa74f('0x0')]={'name':{'type':Sequelize[_0xa74f('0x1')]},'description':{'type':Sequelize[_0xa74f('0x1')]}}; \ No newline at end of file +var _0xbb0d=['sequelize','STRING'];(function(_0x45e0ea,_0x54e1fa){var _0x26bb5c=function(_0x29ea5c){while(--_0x29ea5c){_0x45e0ea['push'](_0x45e0ea['shift']());}};_0x26bb5c(++_0x54e1fa);}(_0xbb0d,0x100));var _0xdbb0=function(_0x1b12d6,_0x1714ac){_0x1b12d6=_0x1b12d6-0x0;var _0x2d8379=_0xbb0d[_0x1b12d6];return _0x2d8379;};'use strict';var Sequelize=require(_0xdbb0('0x0'));module['exports']={'name':{'type':Sequelize[_0xdbb0('0x1')]},'description':{'type':Sequelize[_0xdbb0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 84dcc55..cc48dc4 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 _0x1c6d=['limit','undefined','count','set','Content-Range','reject','save','then','destroy','error','name','index','ServicenowConfiguration','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','update','getFields','findOne','ServicenowField','rawAttributes','nolimit','getSubjects','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x5dfc68,_0x425216){var _0xb8e0a8=function(_0x3652ff){while(--_0x3652ff){_0x5dfc68['push'](_0x5dfc68['shift']());}};_0xb8e0a8(++_0x425216);}(_0x1c6d,0x164));var _0xd1c6=function(_0x1b2b6a,_0x1ca7c7){_0x1b2b6a=_0x1b2b6a-0x0;var _0x122ea7=_0x1c6d[_0x1b2b6a];return _0x122ea7;};'use strict';var emlformat=require(_0xd1c6('0x0'));var rimraf=require(_0xd1c6('0x1'));var zipdir=require(_0xd1c6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd1c6('0x3'));var moment=require(_0xd1c6('0x4'));var BPromise=require(_0xd1c6('0x5'));var Mustache=require(_0xd1c6('0x6'));var util=require(_0xd1c6('0x7'));var path=require(_0xd1c6('0x8'));var sox=require('sox');var csv=require(_0xd1c6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd1c6('0xa'));var _=require('lodash');var squel=require(_0xd1c6('0xb'));var crypto=require(_0xd1c6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd1c6('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd1c6('0xe'));var Papa=require(_0xd1c6('0xf'));var Redis=require('ioredis');var authService=require(_0xd1c6('0x10'));var qs=require(_0xd1c6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd1c6('0x12'))(_0xd1c6('0x13'));var utils=require(_0xd1c6('0x14'));var config=require(_0xd1c6('0x15'));var licenseUtil=require(_0xd1c6('0x16'));var db=require(_0xd1c6('0x17'))['db'];function respondWithStatusCode(_0x12707b,_0xa90ec5){_0xa90ec5=_0xa90ec5||0xcc;return function(_0x4cb589){if(_0x4cb589){return _0x12707b[_0xd1c6('0x18')](_0xa90ec5);}return _0x12707b[_0xd1c6('0x19')](_0xa90ec5)[_0xd1c6('0x1a')]();};}function respondWithResult(_0x579b86,_0x49234f){_0x49234f=_0x49234f||0xc8;return function(_0x5eb83b){if(_0x5eb83b){return _0x579b86[_0xd1c6('0x19')](_0x49234f)[_0xd1c6('0x1b')](_0x5eb83b);}};}function respondWithFilteredResult(_0x1c463a,_0x331085){return function(_0x3dfc3a){if(_0x3dfc3a){var _0x4535b1=typeof _0x331085[_0xd1c6('0x1c')]==='undefined'&&typeof _0x331085[_0xd1c6('0x1d')]===_0xd1c6('0x1e');var _0x3e0199=_0x3dfc3a[_0xd1c6('0x1f')];var _0x2cd956=_0x4535b1?0x0:_0x331085[_0xd1c6('0x1c')];var _0x5cf504=_0x4535b1?_0x3dfc3a[_0xd1c6('0x1f')]:_0x331085[_0xd1c6('0x1c')]+_0x331085[_0xd1c6('0x1d')];var _0x5dd4f9;if(_0x5cf504>=_0x3e0199){_0x5cf504=_0x3e0199;_0x5dd4f9=0xc8;}else{_0x5dd4f9=0xce;}_0x1c463a[_0xd1c6('0x19')](_0x5dd4f9);return _0x1c463a[_0xd1c6('0x20')](_0xd1c6('0x21'),_0x2cd956+'-'+_0x5cf504+'/'+_0x3e0199)[_0xd1c6('0x1b')](_0x3dfc3a);}return null;};}function patchUpdates(_0x5c63fb){return function(_0x413539){try{jsonpatch['apply'](_0x413539,_0x5c63fb,!![]);}catch(_0x1833fb){return BPromise[_0xd1c6('0x22')](_0x1833fb);}return _0x413539[_0xd1c6('0x23')]();};}function saveUpdates(_0x29e715,_0x4a85f4){return function(_0x2281ab){if(_0x2281ab){return _0x2281ab['update'](_0x29e715)[_0xd1c6('0x24')](function(_0x334bf7){return _0x334bf7;});}return null;};}function removeEntity(_0x416d08,_0x1de88b){return function(_0x52c071){if(_0x52c071){return _0x52c071[_0xd1c6('0x25')]()[_0xd1c6('0x24')](function(){_0x416d08[_0xd1c6('0x19')](0xcc)[_0xd1c6('0x1a')]();});}};}function handleEntityNotFound(_0x1a1d78,_0x3ed95d){return function(_0x62fb9f){if(!_0x62fb9f){_0x1a1d78[_0xd1c6('0x18')](0x194);}return _0x62fb9f;};}function handleError(_0x111e43,_0x2eb4e4){_0x2eb4e4=_0x2eb4e4||0x1f4;return function(_0x22c346){logger[_0xd1c6('0x26')](_0x22c346['stack']);if(_0x22c346[_0xd1c6('0x27')]){delete _0x22c346['name'];}_0x111e43['status'](_0x2eb4e4)['send'](_0x22c346);};}exports[_0xd1c6('0x28')]=function(_0x30a1f4,_0x31763e){var _0x11e699={},_0x222707={},_0x52f636={'count':0x0,'rows':[]};var _0x5b28c5=_['map'](db[_0xd1c6('0x29')]['rawAttributes'],function(_0x205aad){return{'name':_0x205aad['fieldName'],'type':_0x205aad['type'][_0xd1c6('0x2a')]};});_0x222707[_0xd1c6('0x2b')]=_[_0xd1c6('0x2c')](_0x5b28c5,_0xd1c6('0x27'));_0x222707[_0xd1c6('0x2d')]=_['keys'](_0x30a1f4[_0xd1c6('0x2d')]);_0x222707[_0xd1c6('0x2e')]=_[_0xd1c6('0x2f')](_0x222707[_0xd1c6('0x2b')],_0x222707[_0xd1c6('0x2d')]);_0x11e699['attributes']=_[_0xd1c6('0x2f')](_0x222707['model'],qs[_0xd1c6('0x30')](_0x30a1f4[_0xd1c6('0x2d')][_0xd1c6('0x30')]));_0x11e699[_0xd1c6('0x31')]=_0x11e699['attributes'][_0xd1c6('0x32')]?_0x11e699['attributes']:_0x222707['model'];if(!_0x30a1f4['query'][_0xd1c6('0x33')]('nolimit')){_0x11e699[_0xd1c6('0x1d')]=qs['limit'](_0x30a1f4[_0xd1c6('0x2d')][_0xd1c6('0x1d')]);_0x11e699[_0xd1c6('0x1c')]=qs['offset'](_0x30a1f4['query'][_0xd1c6('0x1c')]);}_0x11e699[_0xd1c6('0x34')]=qs[_0xd1c6('0x35')](_0x30a1f4[_0xd1c6('0x2d')]['sort']);_0x11e699[_0xd1c6('0x36')]=qs[_0xd1c6('0x2e')](_[_0xd1c6('0x37')](_0x30a1f4[_0xd1c6('0x2d')],_0x222707['filters']),_0x5b28c5);if(_0x30a1f4[_0xd1c6('0x2d')][_0xd1c6('0x38')]){_0x11e699[_0xd1c6('0x36')]=_[_0xd1c6('0x39')](_0x11e699[_0xd1c6('0x36')],{'$or':_[_0xd1c6('0x2c')](_0x5b28c5,function(_0x5035cc){if(_0x5035cc['type']!==_0xd1c6('0x3a')){var _0x5895da={};_0x5895da[_0x5035cc[_0xd1c6('0x27')]]={'$like':'%'+_0x30a1f4[_0xd1c6('0x2d')][_0xd1c6('0x38')]+'%'};return _0x5895da;}})});}_0x11e699=_[_0xd1c6('0x39')]({},_0x11e699,_0x30a1f4[_0xd1c6('0x3b')]);var _0xdd4000={'where':_0x11e699[_0xd1c6('0x36')]};return db[_0xd1c6('0x29')][_0xd1c6('0x1f')](_0xdd4000)[_0xd1c6('0x24')](function(_0x1871b7){_0x52f636[_0xd1c6('0x1f')]=_0x1871b7;if(_0x30a1f4[_0xd1c6('0x2d')][_0xd1c6('0x3c')]){_0x11e699[_0xd1c6('0x3d')]=[{'all':!![]}];}return db[_0xd1c6('0x29')][_0xd1c6('0x3e')](_0x11e699);})['then'](function(_0x12d583){_0x52f636['rows']=_0x12d583;return _0x52f636;})[_0xd1c6('0x24')](respondWithFilteredResult(_0x31763e,_0x11e699))[_0xd1c6('0x3f')](handleError(_0x31763e,null));};exports[_0xd1c6('0x40')]=function(_0x14d598,_0x8b2b5d){var _0x1b464e={'raw':![],'where':{'id':_0x14d598[_0xd1c6('0x41')]['id']}},_0xfe19da={};_0xfe19da[_0xd1c6('0x2b')]=_[_0xd1c6('0x42')](db['ServicenowConfiguration']['rawAttributes']);_0xfe19da['query']=_[_0xd1c6('0x42')](_0x14d598[_0xd1c6('0x2d')]);_0xfe19da[_0xd1c6('0x2e')]=_[_0xd1c6('0x2f')](_0xfe19da[_0xd1c6('0x2b')],_0xfe19da[_0xd1c6('0x2d')]);_0x1b464e[_0xd1c6('0x31')]=_[_0xd1c6('0x2f')](_0xfe19da[_0xd1c6('0x2b')],qs[_0xd1c6('0x30')](_0x14d598[_0xd1c6('0x2d')][_0xd1c6('0x30')]));_0x1b464e[_0xd1c6('0x31')]=_0x1b464e[_0xd1c6('0x31')][_0xd1c6('0x32')]?_0x1b464e[_0xd1c6('0x31')]:_0xfe19da[_0xd1c6('0x2b')];if(_0x14d598[_0xd1c6('0x2d')][_0xd1c6('0x3c')]){_0x1b464e[_0xd1c6('0x3d')]=[{'all':!![]}];}_0x1b464e=_['merge']({},_0x1b464e,_0x14d598['options']);return db['ServicenowConfiguration'][_0xd1c6('0x43')](_0x1b464e)[_0xd1c6('0x24')](handleEntityNotFound(_0x8b2b5d,null))['then'](respondWithResult(_0x8b2b5d,null))[_0xd1c6('0x3f')](handleError(_0x8b2b5d,null));};exports['create']=function(_0x166beb,_0x500ce7){return db[_0xd1c6('0x29')][_0xd1c6('0x44')](_0x166beb[_0xd1c6('0x45')],{})[_0xd1c6('0x24')](respondWithResult(_0x500ce7,0xc9))[_0xd1c6('0x3f')](handleError(_0x500ce7,null));};exports[_0xd1c6('0x46')]=function(_0x33753d,_0x2d3c5d){if(_0x33753d[_0xd1c6('0x45')]['id']){delete _0x33753d['body']['id'];}return db[_0xd1c6('0x29')][_0xd1c6('0x43')]({'where':{'id':_0x33753d['params']['id']}})[_0xd1c6('0x24')](handleEntityNotFound(_0x2d3c5d,null))[_0xd1c6('0x24')](saveUpdates(_0x33753d['body'],null))[_0xd1c6('0x24')](respondWithResult(_0x2d3c5d,null))['catch'](handleError(_0x2d3c5d,null));};exports[_0xd1c6('0x25')]=function(_0xca7334,_0x2ce2d1){return db[_0xd1c6('0x29')][_0xd1c6('0x43')]({'where':{'id':_0xca7334[_0xd1c6('0x41')]['id']}})[_0xd1c6('0x24')](handleEntityNotFound(_0x2ce2d1,null))['then'](removeEntity(_0x2ce2d1,null))[_0xd1c6('0x3f')](handleError(_0x2ce2d1,null));};exports[_0xd1c6('0x47')]=function(_0x4ab17d,_0x330cef,_0xc587bd){var _0x57be7b={};var _0x2f748a={};var _0x3fcac5;var _0x38f57d;return db[_0xd1c6('0x29')][_0xd1c6('0x48')]({'where':{'id':_0x4ab17d['params']['id']}})[_0xd1c6('0x24')](handleEntityNotFound(_0x330cef,null))[_0xd1c6('0x24')](function(_0xb9f52e){if(_0xb9f52e){_0x3fcac5=_0xb9f52e;_0x2f748a['model']=_['keys'](db[_0xd1c6('0x49')][_0xd1c6('0x4a')]);_0x2f748a['query']=_[_0xd1c6('0x42')](_0x4ab17d['query']);_0x2f748a['filters']=_['intersection'](_0x2f748a[_0xd1c6('0x2b')],_0x2f748a['query']);_0x57be7b[_0xd1c6('0x31')]=_['intersection'](_0x2f748a[_0xd1c6('0x2b')],qs[_0xd1c6('0x30')](_0x4ab17d[_0xd1c6('0x2d')][_0xd1c6('0x30')]));_0x57be7b[_0xd1c6('0x31')]=_0x57be7b[_0xd1c6('0x31')][_0xd1c6('0x32')]?_0x57be7b['attributes']:_0x2f748a[_0xd1c6('0x2b')];_0x57be7b[_0xd1c6('0x34')]=qs['sort'](_0x4ab17d[_0xd1c6('0x2d')]['sort']);_0x57be7b[_0xd1c6('0x36')]=qs[_0xd1c6('0x2e')](_['pick'](_0x4ab17d['query'],_0x2f748a['filters']));if(_0x4ab17d['query']['filter']){_0x57be7b[_0xd1c6('0x36')]=_[_0xd1c6('0x39')](_0x57be7b[_0xd1c6('0x36')],{'$or':_[_0xd1c6('0x2c')](_0x57be7b[_0xd1c6('0x31')],function(_0x4e35a8){var _0x13f128={};_0x13f128[_0x4e35a8]={'$like':'%'+_0x4ab17d[_0xd1c6('0x2d')]['filter']+'%'};return _0x13f128;})});}_0x57be7b=_[_0xd1c6('0x39')]({},_0x57be7b,_0x4ab17d['options']);return _0x3fcac5[_0xd1c6('0x47')](_0x57be7b);}})[_0xd1c6('0x24')](function(_0xf8eda2){if(_0xf8eda2){_0x38f57d=_0xf8eda2[_0xd1c6('0x32')];if(!_0x4ab17d['query'][_0xd1c6('0x33')](_0xd1c6('0x4b'))){_0x57be7b[_0xd1c6('0x1d')]=qs[_0xd1c6('0x1d')](_0x4ab17d['query'][_0xd1c6('0x1d')]);_0x57be7b[_0xd1c6('0x1c')]=qs[_0xd1c6('0x1c')](_0x4ab17d[_0xd1c6('0x2d')][_0xd1c6('0x1c')]);}return _0x3fcac5[_0xd1c6('0x47')](_0x57be7b);}})[_0xd1c6('0x24')](function(_0x3f3f1b){if(_0x3f3f1b){return _0x3f3f1b?{'count':_0x38f57d,'rows':_0x3f3f1b}:null;}})['then'](respondWithResult(_0x330cef,null))[_0xd1c6('0x3f')](handleError(_0x330cef,null));};exports['getSubjects']=function(_0x471bca,_0x86ddb2,_0x2a618b){var _0x3e9f0b={};var _0x3989af={};var _0x3b72ac;var _0x1443cf;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x471bca['params']['id']}})['then'](handleEntityNotFound(_0x86ddb2,null))[_0xd1c6('0x24')](function(_0x449db4){if(_0x449db4){_0x3b72ac=_0x449db4;_0x3989af['model']=_[_0xd1c6('0x42')](db[_0xd1c6('0x49')][_0xd1c6('0x4a')]);_0x3989af['query']=_[_0xd1c6('0x42')](_0x471bca[_0xd1c6('0x2d')]);_0x3989af[_0xd1c6('0x2e')]=_[_0xd1c6('0x2f')](_0x3989af[_0xd1c6('0x2b')],_0x3989af[_0xd1c6('0x2d')]);_0x3e9f0b['attributes']=_[_0xd1c6('0x2f')](_0x3989af['model'],qs['fields'](_0x471bca['query'][_0xd1c6('0x30')]));_0x3e9f0b[_0xd1c6('0x31')]=_0x3e9f0b[_0xd1c6('0x31')][_0xd1c6('0x32')]?_0x3e9f0b[_0xd1c6('0x31')]:_0x3989af['model'];_0x3e9f0b[_0xd1c6('0x34')]=qs[_0xd1c6('0x35')](_0x471bca[_0xd1c6('0x2d')][_0xd1c6('0x35')]);_0x3e9f0b[_0xd1c6('0x36')]=qs['filters'](_['pick'](_0x471bca['query'],_0x3989af[_0xd1c6('0x2e')]));if(_0x471bca[_0xd1c6('0x2d')][_0xd1c6('0x38')]){_0x3e9f0b[_0xd1c6('0x36')]=_[_0xd1c6('0x39')](_0x3e9f0b['where'],{'$or':_[_0xd1c6('0x2c')](_0x3e9f0b[_0xd1c6('0x31')],function(_0x297d7f){var _0x9181ba={};_0x9181ba[_0x297d7f]={'$like':'%'+_0x471bca[_0xd1c6('0x2d')][_0xd1c6('0x38')]+'%'};return _0x9181ba;})});}_0x3e9f0b=_['merge']({},_0x3e9f0b,_0x471bca[_0xd1c6('0x3b')]);return _0x3b72ac[_0xd1c6('0x4c')](_0x3e9f0b);}})[_0xd1c6('0x24')](function(_0x2b0992){if(_0x2b0992){_0x1443cf=_0x2b0992[_0xd1c6('0x32')];if(!_0x471bca[_0xd1c6('0x2d')][_0xd1c6('0x33')](_0xd1c6('0x4b'))){_0x3e9f0b[_0xd1c6('0x1d')]=qs[_0xd1c6('0x1d')](_0x471bca[_0xd1c6('0x2d')][_0xd1c6('0x1d')]);_0x3e9f0b['offset']=qs['offset'](_0x471bca[_0xd1c6('0x2d')][_0xd1c6('0x1c')]);}return _0x3b72ac[_0xd1c6('0x4c')](_0x3e9f0b);}})['then'](function(_0x49f24b){if(_0x49f24b){return _0x49f24b?{'count':_0x1443cf,'rows':_0x49f24b}:null;}})['then'](respondWithResult(_0x86ddb2,null))[_0xd1c6('0x3f')](handleError(_0x86ddb2,null));};exports['getDescriptions']=function(_0x586dff,_0x49cfa1,_0x17a76a){var _0x38a304={};var _0x291a24={};var _0x55e8b8;var _0xc3bffd;return db[_0xd1c6('0x29')][_0xd1c6('0x48')]({'where':{'id':_0x586dff[_0xd1c6('0x41')]['id']}})[_0xd1c6('0x24')](handleEntityNotFound(_0x49cfa1,null))[_0xd1c6('0x24')](function(_0x454e6b){if(_0x454e6b){_0x55e8b8=_0x454e6b;_0x291a24[_0xd1c6('0x2b')]=_[_0xd1c6('0x42')](db[_0xd1c6('0x49')][_0xd1c6('0x4a')]);_0x291a24[_0xd1c6('0x2d')]=_[_0xd1c6('0x42')](_0x586dff['query']);_0x291a24['filters']=_[_0xd1c6('0x2f')](_0x291a24[_0xd1c6('0x2b')],_0x291a24['query']);_0x38a304[_0xd1c6('0x31')]=_['intersection'](_0x291a24[_0xd1c6('0x2b')],qs[_0xd1c6('0x30')](_0x586dff[_0xd1c6('0x2d')][_0xd1c6('0x30')]));_0x38a304[_0xd1c6('0x31')]=_0x38a304[_0xd1c6('0x31')][_0xd1c6('0x32')]?_0x38a304[_0xd1c6('0x31')]:_0x291a24[_0xd1c6('0x2b')];_0x38a304[_0xd1c6('0x34')]=qs[_0xd1c6('0x35')](_0x586dff[_0xd1c6('0x2d')]['sort']);_0x38a304[_0xd1c6('0x36')]=qs['filters'](_[_0xd1c6('0x37')](_0x586dff['query'],_0x291a24[_0xd1c6('0x2e')]));if(_0x586dff[_0xd1c6('0x2d')][_0xd1c6('0x38')]){_0x38a304[_0xd1c6('0x36')]=_[_0xd1c6('0x39')](_0x38a304[_0xd1c6('0x36')],{'$or':_['map'](_0x38a304[_0xd1c6('0x31')],function(_0x2b219a){var _0x4eae2a={};_0x4eae2a[_0x2b219a]={'$like':'%'+_0x586dff[_0xd1c6('0x2d')][_0xd1c6('0x38')]+'%'};return _0x4eae2a;})});}_0x38a304=_['merge']({},_0x38a304,_0x586dff[_0xd1c6('0x3b')]);return _0x55e8b8['getDescriptions'](_0x38a304);}})['then'](function(_0x36b6f3){if(_0x36b6f3){_0xc3bffd=_0x36b6f3[_0xd1c6('0x32')];if(!_0x586dff[_0xd1c6('0x2d')][_0xd1c6('0x33')](_0xd1c6('0x4b'))){_0x38a304[_0xd1c6('0x1d')]=qs[_0xd1c6('0x1d')](_0x586dff[_0xd1c6('0x2d')][_0xd1c6('0x1d')]);_0x38a304[_0xd1c6('0x1c')]=qs[_0xd1c6('0x1c')](_0x586dff[_0xd1c6('0x2d')][_0xd1c6('0x1c')]);}return _0x55e8b8['getDescriptions'](_0x38a304);}})['then'](function(_0x1318f1){if(_0x1318f1){return _0x1318f1?{'count':_0xc3bffd,'rows':_0x1318f1}:null;}})['then'](respondWithResult(_0x49cfa1,null))[_0xd1c6('0x3f')](handleError(_0x49cfa1,null));}; \ No newline at end of file +var _0x37f1=['then','end','error','name','map','ServicenowConfiguration','fieldName','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','body','destroy','findOne','ServicenowField','order','pick','getFields','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0x3101ff,_0xf266f){var _0x3ab3d2=function(_0x3b4045){while(--_0x3b4045){_0x3101ff['push'](_0x3101ff['shift']());}};_0x3ab3d2(++_0xf266f);}(_0x37f1,0x11c));var _0x137f=function(_0x1f2415,_0x4d54f1){_0x1f2415=_0x1f2415-0x0;var _0x148a62=_0x37f1[_0x1f2415];return _0x148a62;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x137f('0x0'));var zipdir=require(_0x137f('0x1'));var jsonpatch=require(_0x137f('0x2'));var rp=require('request-promise');var moment=require(_0x137f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x137f('0x4'));var sox=require(_0x137f('0x5'));var csv=require(_0x137f('0x6'));var ejs=require(_0x137f('0x7'));var fs=require('fs');var fs_extra=require(_0x137f('0x8'));var _=require(_0x137f('0x9'));var squel=require(_0x137f('0xa'));var crypto=require(_0x137f('0xb'));var jsforce=require(_0x137f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x137f('0xd'));var Papa=require(_0x137f('0xe'));var Redis=require(_0x137f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x137f('0x10'));var as=require(_0x137f('0x11'));var hardwareService=require(_0x137f('0x12'));var logger=require(_0x137f('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x137f('0x14'));var licenseUtil=require(_0x137f('0x15'));var db=require(_0x137f('0x16'))['db'];function respondWithStatusCode(_0x34ac4f,_0x44651d){_0x44651d=_0x44651d||0xcc;return function(_0x5cb1eb){if(_0x5cb1eb){return _0x34ac4f[_0x137f('0x17')](_0x44651d);}return _0x34ac4f[_0x137f('0x18')](_0x44651d)['end']();};}function respondWithResult(_0x115170,_0x35bb5c){_0x35bb5c=_0x35bb5c||0xc8;return function(_0x4935ce){if(_0x4935ce){return _0x115170[_0x137f('0x18')](_0x35bb5c)[_0x137f('0x19')](_0x4935ce);}};}function respondWithFilteredResult(_0x252636,_0x53e41b){return function(_0x4e0017){if(_0x4e0017){var _0x3cb279=typeof _0x53e41b[_0x137f('0x1a')]===_0x137f('0x1b')&&typeof _0x53e41b['limit']===_0x137f('0x1b');var _0x4531dd=_0x4e0017[_0x137f('0x1c')];var _0x321e5c=_0x3cb279?0x0:_0x53e41b[_0x137f('0x1a')];var _0xbf7cee=_0x3cb279?_0x4e0017[_0x137f('0x1c')]:_0x53e41b[_0x137f('0x1a')]+_0x53e41b[_0x137f('0x1d')];var _0x56f57a;if(_0xbf7cee>=_0x4531dd){_0xbf7cee=_0x4531dd;_0x56f57a=0xc8;}else{_0x56f57a=0xce;}_0x252636['status'](_0x56f57a);return _0x252636[_0x137f('0x1e')](_0x137f('0x1f'),_0x321e5c+'-'+_0xbf7cee+'/'+_0x4531dd)[_0x137f('0x19')](_0x4e0017);}return null;};}function patchUpdates(_0x49fb53){return function(_0xadc55c){try{jsonpatch[_0x137f('0x20')](_0xadc55c,_0x49fb53,!![]);}catch(_0x58e4ba){return BPromise[_0x137f('0x21')](_0x58e4ba);}return _0xadc55c[_0x137f('0x22')]();};}function saveUpdates(_0x3f541a,_0x180638){return function(_0x3d965f){if(_0x3d965f){return _0x3d965f[_0x137f('0x23')](_0x3f541a)[_0x137f('0x24')](function(_0xb4ca6d){return _0xb4ca6d;});}return null;};}function removeEntity(_0x3dfdfc,_0x41b59e){return function(_0x449b67){if(_0x449b67){return _0x449b67['destroy']()[_0x137f('0x24')](function(){_0x3dfdfc[_0x137f('0x18')](0xcc)[_0x137f('0x25')]();});}};}function handleEntityNotFound(_0x242e6c,_0x20a2db){return function(_0x388a2b){if(!_0x388a2b){_0x242e6c[_0x137f('0x17')](0x194);}return _0x388a2b;};}function handleError(_0x216050,_0x3d65df){_0x3d65df=_0x3d65df||0x1f4;return function(_0x214204){logger[_0x137f('0x26')](_0x214204['stack']);if(_0x214204[_0x137f('0x27')]){delete _0x214204[_0x137f('0x27')];}_0x216050[_0x137f('0x18')](_0x3d65df)['send'](_0x214204);};}exports['index']=function(_0x314f01,_0x576aec){var _0x46af20={},_0x462326={},_0xef41c5={'count':0x0,'rows':[]};var _0x401f43=_[_0x137f('0x28')](db[_0x137f('0x29')]['rawAttributes'],function(_0x24596b){return{'name':_0x24596b[_0x137f('0x2a')],'type':_0x24596b['type'][_0x137f('0x2b')]};});_0x462326[_0x137f('0x2c')]=_[_0x137f('0x28')](_0x401f43,_0x137f('0x27'));_0x462326[_0x137f('0x2d')]=_[_0x137f('0x2e')](_0x314f01[_0x137f('0x2d')]);_0x462326[_0x137f('0x2f')]=_['intersection'](_0x462326[_0x137f('0x2c')],_0x462326[_0x137f('0x2d')]);_0x46af20[_0x137f('0x30')]=_[_0x137f('0x31')](_0x462326[_0x137f('0x2c')],qs['fields'](_0x314f01[_0x137f('0x2d')]['fields']));_0x46af20['attributes']=_0x46af20[_0x137f('0x30')][_0x137f('0x32')]?_0x46af20[_0x137f('0x30')]:_0x462326['model'];if(!_0x314f01['query'][_0x137f('0x33')](_0x137f('0x34'))){_0x46af20[_0x137f('0x1d')]=qs[_0x137f('0x1d')](_0x314f01['query'][_0x137f('0x1d')]);_0x46af20[_0x137f('0x1a')]=qs[_0x137f('0x1a')](_0x314f01[_0x137f('0x2d')][_0x137f('0x1a')]);}_0x46af20['order']=qs[_0x137f('0x35')](_0x314f01[_0x137f('0x2d')]['sort']);_0x46af20['where']=qs[_0x137f('0x2f')](_['pick'](_0x314f01['query'],_0x462326[_0x137f('0x2f')]),_0x401f43);if(_0x314f01[_0x137f('0x2d')][_0x137f('0x36')]){_0x46af20[_0x137f('0x37')]=_[_0x137f('0x38')](_0x46af20[_0x137f('0x37')],{'$or':_[_0x137f('0x28')](_0x401f43,function(_0x324c74){if(_0x324c74[_0x137f('0x39')]!==_0x137f('0x3a')){var _0x4db414={};_0x4db414[_0x324c74[_0x137f('0x27')]]={'$like':'%'+_0x314f01['query'][_0x137f('0x36')]+'%'};return _0x4db414;}})});}_0x46af20=_[_0x137f('0x38')]({},_0x46af20,_0x314f01[_0x137f('0x3b')]);var _0x9b0fe6={'where':_0x46af20['where']};return db['ServicenowConfiguration'][_0x137f('0x1c')](_0x9b0fe6)[_0x137f('0x24')](function(_0x4eb589){_0xef41c5[_0x137f('0x1c')]=_0x4eb589;if(_0x314f01[_0x137f('0x2d')][_0x137f('0x3c')]){_0x46af20[_0x137f('0x3d')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x137f('0x3e')](_0x46af20);})[_0x137f('0x24')](function(_0x11315a){_0xef41c5[_0x137f('0x3f')]=_0x11315a;return _0xef41c5;})['then'](respondWithFilteredResult(_0x576aec,_0x46af20))[_0x137f('0x40')](handleError(_0x576aec,null));};exports[_0x137f('0x41')]=function(_0x1ee316,_0x1bcb9e){var _0x5882eb={'raw':![],'where':{'id':_0x1ee316[_0x137f('0x42')]['id']}},_0x3cf762={};_0x3cf762['model']=_[_0x137f('0x2e')](db[_0x137f('0x29')][_0x137f('0x43')]);_0x3cf762[_0x137f('0x2d')]=_['keys'](_0x1ee316[_0x137f('0x2d')]);_0x3cf762[_0x137f('0x2f')]=_[_0x137f('0x31')](_0x3cf762['model'],_0x3cf762['query']);_0x5882eb[_0x137f('0x30')]=_[_0x137f('0x31')](_0x3cf762['model'],qs[_0x137f('0x44')](_0x1ee316[_0x137f('0x2d')][_0x137f('0x44')]));_0x5882eb[_0x137f('0x30')]=_0x5882eb[_0x137f('0x30')][_0x137f('0x32')]?_0x5882eb[_0x137f('0x30')]:_0x3cf762[_0x137f('0x2c')];if(_0x1ee316[_0x137f('0x2d')][_0x137f('0x3c')]){_0x5882eb[_0x137f('0x3d')]=[{'all':!![]}];}_0x5882eb=_[_0x137f('0x38')]({},_0x5882eb,_0x1ee316[_0x137f('0x3b')]);return db[_0x137f('0x29')][_0x137f('0x45')](_0x5882eb)[_0x137f('0x24')](handleEntityNotFound(_0x1bcb9e,null))[_0x137f('0x24')](respondWithResult(_0x1bcb9e,null))[_0x137f('0x40')](handleError(_0x1bcb9e,null));};exports['create']=function(_0x5de4d6,_0x1ec774){return db[_0x137f('0x29')][_0x137f('0x46')](_0x5de4d6[_0x137f('0x47')],{})[_0x137f('0x24')](respondWithResult(_0x1ec774,0xc9))[_0x137f('0x40')](handleError(_0x1ec774,null));};exports[_0x137f('0x23')]=function(_0x4fd478,_0x4b2022){if(_0x4fd478[_0x137f('0x47')]['id']){delete _0x4fd478['body']['id'];}return db[_0x137f('0x29')][_0x137f('0x45')]({'where':{'id':_0x4fd478[_0x137f('0x42')]['id']}})[_0x137f('0x24')](handleEntityNotFound(_0x4b2022,null))[_0x137f('0x24')](saveUpdates(_0x4fd478[_0x137f('0x47')],null))['then'](respondWithResult(_0x4b2022,null))['catch'](handleError(_0x4b2022,null));};exports[_0x137f('0x48')]=function(_0x236158,_0x42f83e){return db['ServicenowConfiguration'][_0x137f('0x45')]({'where':{'id':_0x236158[_0x137f('0x42')]['id']}})[_0x137f('0x24')](handleEntityNotFound(_0x42f83e,null))[_0x137f('0x24')](removeEntity(_0x42f83e,null))[_0x137f('0x40')](handleError(_0x42f83e,null));};exports['getFields']=function(_0x2ab01f,_0x21d283,_0x82d7f4){var _0xcb5ad8={};var _0x4e3b1e={};var _0x50e320;var _0x3ac0bc;return db[_0x137f('0x29')][_0x137f('0x49')]({'where':{'id':_0x2ab01f[_0x137f('0x42')]['id']}})[_0x137f('0x24')](handleEntityNotFound(_0x21d283,null))['then'](function(_0x2a1c59){if(_0x2a1c59){_0x50e320=_0x2a1c59;_0x4e3b1e[_0x137f('0x2c')]=_[_0x137f('0x2e')](db[_0x137f('0x4a')]['rawAttributes']);_0x4e3b1e[_0x137f('0x2d')]=_['keys'](_0x2ab01f[_0x137f('0x2d')]);_0x4e3b1e[_0x137f('0x2f')]=_[_0x137f('0x31')](_0x4e3b1e[_0x137f('0x2c')],_0x4e3b1e[_0x137f('0x2d')]);_0xcb5ad8['attributes']=_['intersection'](_0x4e3b1e[_0x137f('0x2c')],qs['fields'](_0x2ab01f[_0x137f('0x2d')][_0x137f('0x44')]));_0xcb5ad8[_0x137f('0x30')]=_0xcb5ad8[_0x137f('0x30')][_0x137f('0x32')]?_0xcb5ad8[_0x137f('0x30')]:_0x4e3b1e[_0x137f('0x2c')];_0xcb5ad8[_0x137f('0x4b')]=qs[_0x137f('0x35')](_0x2ab01f[_0x137f('0x2d')]['sort']);_0xcb5ad8['where']=qs[_0x137f('0x2f')](_[_0x137f('0x4c')](_0x2ab01f[_0x137f('0x2d')],_0x4e3b1e[_0x137f('0x2f')]));if(_0x2ab01f['query'][_0x137f('0x36')]){_0xcb5ad8[_0x137f('0x37')]=_[_0x137f('0x38')](_0xcb5ad8[_0x137f('0x37')],{'$or':_[_0x137f('0x28')](_0xcb5ad8[_0x137f('0x30')],function(_0x3e1e58){var _0x170eb5={};_0x170eb5[_0x3e1e58]={'$like':'%'+_0x2ab01f[_0x137f('0x2d')][_0x137f('0x36')]+'%'};return _0x170eb5;})});}_0xcb5ad8=_[_0x137f('0x38')]({},_0xcb5ad8,_0x2ab01f[_0x137f('0x3b')]);return _0x50e320[_0x137f('0x4d')](_0xcb5ad8);}})[_0x137f('0x24')](function(_0x50fc12){if(_0x50fc12){_0x3ac0bc=_0x50fc12[_0x137f('0x32')];if(!_0x2ab01f['query'][_0x137f('0x33')](_0x137f('0x34'))){_0xcb5ad8[_0x137f('0x1d')]=qs[_0x137f('0x1d')](_0x2ab01f[_0x137f('0x2d')]['limit']);_0xcb5ad8['offset']=qs[_0x137f('0x1a')](_0x2ab01f['query'][_0x137f('0x1a')]);}return _0x50e320[_0x137f('0x4d')](_0xcb5ad8);}})[_0x137f('0x24')](function(_0x58c84f){if(_0x58c84f){return _0x58c84f?{'count':_0x3ac0bc,'rows':_0x58c84f}:null;}})[_0x137f('0x24')](respondWithResult(_0x21d283,null))[_0x137f('0x40')](handleError(_0x21d283,null));};exports['getSubjects']=function(_0x5d63d2,_0x11ef39,_0x1514d7){var _0x4b7e96={};var _0x5c483a={};var _0x46b969;var _0x40ca3d;return db[_0x137f('0x29')][_0x137f('0x49')]({'where':{'id':_0x5d63d2[_0x137f('0x42')]['id']}})[_0x137f('0x24')](handleEntityNotFound(_0x11ef39,null))[_0x137f('0x24')](function(_0x25fee5){if(_0x25fee5){_0x46b969=_0x25fee5;_0x5c483a[_0x137f('0x2c')]=_[_0x137f('0x2e')](db[_0x137f('0x4a')][_0x137f('0x43')]);_0x5c483a[_0x137f('0x2d')]=_[_0x137f('0x2e')](_0x5d63d2[_0x137f('0x2d')]);_0x5c483a[_0x137f('0x2f')]=_['intersection'](_0x5c483a[_0x137f('0x2c')],_0x5c483a[_0x137f('0x2d')]);_0x4b7e96['attributes']=_[_0x137f('0x31')](_0x5c483a[_0x137f('0x2c')],qs[_0x137f('0x44')](_0x5d63d2[_0x137f('0x2d')][_0x137f('0x44')]));_0x4b7e96[_0x137f('0x30')]=_0x4b7e96[_0x137f('0x30')][_0x137f('0x32')]?_0x4b7e96[_0x137f('0x30')]:_0x5c483a[_0x137f('0x2c')];_0x4b7e96['order']=qs[_0x137f('0x35')](_0x5d63d2['query']['sort']);_0x4b7e96[_0x137f('0x37')]=qs[_0x137f('0x2f')](_[_0x137f('0x4c')](_0x5d63d2[_0x137f('0x2d')],_0x5c483a[_0x137f('0x2f')]));if(_0x5d63d2['query'][_0x137f('0x36')]){_0x4b7e96[_0x137f('0x37')]=_[_0x137f('0x38')](_0x4b7e96[_0x137f('0x37')],{'$or':_[_0x137f('0x28')](_0x4b7e96['attributes'],function(_0x3c040c){var _0x234aa6={};_0x234aa6[_0x3c040c]={'$like':'%'+_0x5d63d2[_0x137f('0x2d')][_0x137f('0x36')]+'%'};return _0x234aa6;})});}_0x4b7e96=_['merge']({},_0x4b7e96,_0x5d63d2[_0x137f('0x3b')]);return _0x46b969[_0x137f('0x4e')](_0x4b7e96);}})['then'](function(_0x872b7d){if(_0x872b7d){_0x40ca3d=_0x872b7d[_0x137f('0x32')];if(!_0x5d63d2[_0x137f('0x2d')][_0x137f('0x33')](_0x137f('0x34'))){_0x4b7e96[_0x137f('0x1d')]=qs[_0x137f('0x1d')](_0x5d63d2[_0x137f('0x2d')][_0x137f('0x1d')]);_0x4b7e96[_0x137f('0x1a')]=qs['offset'](_0x5d63d2[_0x137f('0x2d')][_0x137f('0x1a')]);}return _0x46b969[_0x137f('0x4e')](_0x4b7e96);}})[_0x137f('0x24')](function(_0xd70793){if(_0xd70793){return _0xd70793?{'count':_0x40ca3d,'rows':_0xd70793}:null;}})[_0x137f('0x24')](respondWithResult(_0x11ef39,null))[_0x137f('0x40')](handleError(_0x11ef39,null));};exports[_0x137f('0x4f')]=function(_0x30670d,_0x4d7ed7,_0x5593dd){var _0x471d34={};var _0x5d8eb1={};var _0x39213e;var _0x3ba5b8;return db[_0x137f('0x29')][_0x137f('0x49')]({'where':{'id':_0x30670d[_0x137f('0x42')]['id']}})[_0x137f('0x24')](handleEntityNotFound(_0x4d7ed7,null))[_0x137f('0x24')](function(_0x5b0b66){if(_0x5b0b66){_0x39213e=_0x5b0b66;_0x5d8eb1[_0x137f('0x2c')]=_[_0x137f('0x2e')](db['ServicenowField']['rawAttributes']);_0x5d8eb1[_0x137f('0x2d')]=_['keys'](_0x30670d[_0x137f('0x2d')]);_0x5d8eb1[_0x137f('0x2f')]=_[_0x137f('0x31')](_0x5d8eb1[_0x137f('0x2c')],_0x5d8eb1[_0x137f('0x2d')]);_0x471d34[_0x137f('0x30')]=_[_0x137f('0x31')](_0x5d8eb1[_0x137f('0x2c')],qs[_0x137f('0x44')](_0x30670d[_0x137f('0x2d')][_0x137f('0x44')]));_0x471d34['attributes']=_0x471d34[_0x137f('0x30')][_0x137f('0x32')]?_0x471d34[_0x137f('0x30')]:_0x5d8eb1[_0x137f('0x2c')];_0x471d34['order']=qs[_0x137f('0x35')](_0x30670d[_0x137f('0x2d')][_0x137f('0x35')]);_0x471d34[_0x137f('0x37')]=qs[_0x137f('0x2f')](_[_0x137f('0x4c')](_0x30670d[_0x137f('0x2d')],_0x5d8eb1['filters']));if(_0x30670d[_0x137f('0x2d')]['filter']){_0x471d34[_0x137f('0x37')]=_[_0x137f('0x38')](_0x471d34[_0x137f('0x37')],{'$or':_[_0x137f('0x28')](_0x471d34[_0x137f('0x30')],function(_0x1848c2){var _0x401c2e={};_0x401c2e[_0x1848c2]={'$like':'%'+_0x30670d[_0x137f('0x2d')][_0x137f('0x36')]+'%'};return _0x401c2e;})});}_0x471d34=_[_0x137f('0x38')]({},_0x471d34,_0x30670d[_0x137f('0x3b')]);return _0x39213e[_0x137f('0x4f')](_0x471d34);}})[_0x137f('0x24')](function(_0x112bee){if(_0x112bee){_0x3ba5b8=_0x112bee[_0x137f('0x32')];if(!_0x30670d[_0x137f('0x2d')][_0x137f('0x33')]('nolimit')){_0x471d34[_0x137f('0x1d')]=qs[_0x137f('0x1d')](_0x30670d[_0x137f('0x2d')]['limit']);_0x471d34['offset']=qs['offset'](_0x30670d[_0x137f('0x2d')][_0x137f('0x1a')]);}return _0x39213e[_0x137f('0x4f')](_0x471d34);}})[_0x137f('0x24')](function(_0x8d7e90){if(_0x8d7e90){return _0x8d7e90?{'count':_0x3ba5b8,'rows':_0x8d7e90}:null;}})['then'](respondWithResult(_0x4d7ed7,null))['catch'](handleError(_0x4d7ed7,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 27dc309..97aea9b 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 _0x77f1=['util','../../config/logger','api','path','rimraf','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations'];(function(_0x5ba8b3,_0x462f2b){var _0x4ba550=function(_0x3afc24){while(--_0x3afc24){_0x5ba8b3['push'](_0x5ba8b3['shift']());}};_0x4ba550(++_0x462f2b);}(_0x77f1,0x1dd));var _0x177f=function(_0x317143,_0xf1ea42){_0x317143=_0x317143-0x0;var _0x31e80c=_0x77f1[_0x317143];return _0x31e80c;};'use strict';var _=require('lodash');var util=require(_0x177f('0x0'));var logger=require(_0x177f('0x1'))(_0x177f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x177f('0x3'));var rimraf=require(_0x177f('0x4'));var config=require('../../config/environment');var attributes=require(_0x177f('0x5'));module[_0x177f('0x6')]=function(_0x31c4de,_0x3f30a3){return _0x31c4de[_0x177f('0x7')]('ServicenowConfiguration',attributes,{'tableName':_0x177f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2250=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','lodash'];(function(_0x33a47b,_0x25022a){var _0x3164d0=function(_0x1f070f){while(--_0x1f070f){_0x33a47b['push'](_0x33a47b['shift']());}};_0x3164d0(++_0x25022a);}(_0x2250,0x178));var _0x0225=function(_0x4c6eaa,_0x391f8b){_0x4c6eaa=_0x4c6eaa-0x0;var _0x403439=_0x2250[_0x4c6eaa];return _0x403439;};'use strict';var _=require(_0x0225('0x0'));var util=require(_0x0225('0x1'));var logger=require(_0x0225('0x2'))(_0x0225('0x3'));var moment=require(_0x0225('0x4'));var BPromise=require(_0x0225('0x5'));var rp=require(_0x0225('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0225('0x7'));var config=require(_0x0225('0x8'));var attributes=require(_0x0225('0x9'));module[_0x0225('0xa')]=function(_0x3d3895,_0x3779fe){return _0x3d3895[_0x0225('0xb')](_0x0225('0xc'),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 3d2745f..25a43c7 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 _0x36ee=['result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x366b9d,_0x521fbc){var _0x387774=function(_0x5380b5){while(--_0x5380b5){_0x366b9d['push'](_0x366b9d['shift']());}};_0x387774(++_0x521fbc);}(_0x36ee,0xbf));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xe36e('0x0'));var util=require(_0xe36e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe36e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require('../../config/logger')(_0xe36e('0x5'));var config=require('../../config/environment');var jayson=require(_0xe36e('0x6'));var client=jayson[_0xe36e('0x7')][_0xe36e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x594996,_0x35a80f,_0x23527a){return new BPromise(function(_0x4fe87b,_0x345c88){return client['request'](_0x594996,_0x23527a)[_0xe36e('0x9')](function(_0x5a5be4){logger[_0xe36e('0xa')](_0xe36e('0xb'),_0x35a80f,_0xe36e('0xc'));logger[_0xe36e('0xd')](_0xe36e('0xe'),_0x35a80f,'request\x20sent',JSON[_0xe36e('0xf')](_0x5a5be4));if(_0x5a5be4[_0xe36e('0x10')]){if(_0x5a5be4['error'][_0xe36e('0x11')]===0x1f4){logger[_0xe36e('0x10')](_0xe36e('0xb'),_0x35a80f,_0x5a5be4['error'][_0xe36e('0x12')]);return _0x345c88(_0x5a5be4[_0xe36e('0x10')][_0xe36e('0x12')]);}logger[_0xe36e('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x35a80f,_0x5a5be4[_0xe36e('0x10')][_0xe36e('0x12')]);return _0x4fe87b(_0x5a5be4[_0xe36e('0x10')][_0xe36e('0x12')]);}else{logger[_0xe36e('0xa')](_0xe36e('0xb'),_0x35a80f,_0xe36e('0xc'));_0x4fe87b(_0x5a5be4[_0xe36e('0x13')][_0xe36e('0x12')]);}})[_0xe36e('0x14')](function(_0x4e06d4){logger[_0xe36e('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x35a80f,_0x4e06d4);_0x345c88(_0x4e06d4);});});} \ No newline at end of file +var _0xe74d=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','stringify','ServicenowConfiguration,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird'];(function(_0x2ce49f,_0x47401b){var _0x58a4c7=function(_0x193143){while(--_0x193143){_0x2ce49f['push'](_0x2ce49f['shift']());}};_0x58a4c7(++_0x47401b);}(_0xe74d,0x1a0));var _0xde74=function(_0x599c94,_0x464f0e){_0x599c94=_0x599c94-0x0;var _0x34e215=_0xe74d[_0x599c94];return _0x34e215;};'use strict';var _=require(_0xde74('0x0'));var util=require(_0xde74('0x1'));var moment=require(_0xde74('0x2'));var BPromise=require(_0xde74('0x3'));var rs=require(_0xde74('0x4'));var fs=require('fs');var Redis=require(_0xde74('0x5'));var db=require(_0xde74('0x6'))['db'];var utils=require(_0xde74('0x7'));var logger=require('../../config/logger')(_0xde74('0x8'));var config=require(_0xde74('0x9'));var jayson=require(_0xde74('0xa'));var client=jayson[_0xde74('0xb')][_0xde74('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5aa72e,_0x3e60db,_0x16bef0){return new BPromise(function(_0x4bb9a1,_0x5cb067){return client['request'](_0x5aa72e,_0x16bef0)['then'](function(_0x1f23d4){logger[_0xde74('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3e60db,_0xde74('0xe'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x3e60db,_0xde74('0xe'),JSON[_0xde74('0xf')](_0x1f23d4));if(_0x1f23d4['error']){if(_0x1f23d4['error']['code']===0x1f4){logger['error'](_0xde74('0x10'),_0x3e60db,_0x1f23d4[_0xde74('0x11')][_0xde74('0x12')]);return _0x5cb067(_0x1f23d4[_0xde74('0x11')][_0xde74('0x12')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x3e60db,_0x1f23d4[_0xde74('0x11')][_0xde74('0x12')]);return _0x4bb9a1(_0x1f23d4['error'][_0xde74('0x12')]);}else{logger[_0xde74('0xd')](_0xde74('0x10'),_0x3e60db,_0xde74('0xe'));_0x4bb9a1(_0x1f23d4['result'][_0xde74('0x12')]);}})[_0xde74('0x13')](function(_0x3d8e62){logger[_0xde74('0x11')](_0xde74('0x10'),_0x3e60db,_0x3d8e62);_0x5cb067(_0x3d8e62);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index f8dd68d..b31dd5a 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 _0x875e=['../../config/environment','./intServicenowField.controller','isAuthenticated','/:id','show','post','create','put','update','util','express','../../components/auth/service','../../components/interaction/service'];(function(_0x4fc755,_0x4c1c1f){var _0x269c5f=function(_0x364839){while(--_0x364839){_0x4fc755['push'](_0x4fc755['shift']());}};_0x269c5f(++_0x4c1c1f);}(_0x875e,0x134));var _0xe875=function(_0x1cd71f,_0x2a9d19){_0x1cd71f=_0x1cd71f-0x0;var _0x33d362=_0x875e[_0x1cd71f];return _0x33d362;};'use strict';var multer=require('multer');var util=require(_0xe875('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe875('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe875('0x2'));var interaction=require(_0xe875('0x3'));var config=require(_0xe875('0x4'));var controller=require(_0xe875('0x5'));router['get']('/',auth[_0xe875('0x6')](),controller['index']);router['get'](_0xe875('0x7'),auth[_0xe875('0x6')](),controller[_0xe875('0x8')]);router[_0xe875('0x9')]('/',auth['isAuthenticated'](),controller[_0xe875('0xa')]);router[_0xe875('0xb')]('/:id',auth[_0xe875('0x6')](),controller[_0xe875('0xc')]);router['delete']('/:id',auth[_0xe875('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd977=['../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','show','post','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x281925,_0x508353){var _0xf5687b=function(_0x14abdb){while(--_0x14abdb){_0x281925['push'](_0x281925['shift']());}};_0xf5687b(++_0x508353);}(_0xd977,0x1df));var _0x7d97=function(_0x35c16d,_0x29641a){_0x35c16d=_0x35c16d-0x0;var _0x2117c3=_0xd977[_0x35c16d];return _0x2117c3;};'use strict';var multer=require('multer');var util=require(_0x7d97('0x0'));var path=require(_0x7d97('0x1'));var timeout=require(_0x7d97('0x2'));var express=require(_0x7d97('0x3'));var router=express[_0x7d97('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7d97('0x5'));var interaction=require(_0x7d97('0x6'));var config=require(_0x7d97('0x7'));var controller=require(_0x7d97('0x8'));router[_0x7d97('0x9')]('/',auth[_0x7d97('0xa')](),controller['index']);router[_0x7d97('0x9')](_0x7d97('0xb'),auth[_0x7d97('0xa')](),controller[_0x7d97('0xc')]);router[_0x7d97('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7d97('0xe')](_0x7d97('0xb'),auth[_0x7d97('0xa')](),controller[_0x7d97('0xf')]);router['delete']('/:id',auth[_0x7d97('0xa')](),controller[_0x7d97('0x10')]);module[_0x7d97('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 34f89f0..63cec0c 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 _0xe5a8=['STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xe5a8,0x1ba));var _0x8e5a=function(_0x53a171,_0x119381){_0x53a171=_0x53a171-0x0;var _0x4c958b=_0xe5a8[_0x53a171];return _0x4c958b;};'use strict';var Sequelize=require('sequelize');module[_0x8e5a('0x0')]={'type':{'type':Sequelize[_0x8e5a('0x1')](_0x8e5a('0x2'),_0x8e5a('0x3'),_0x8e5a('0x4'),'keyValue',_0x8e5a('0x5')),'defaultValue':_0x8e5a('0x2')},'content':{'type':Sequelize[_0x8e5a('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8e5a('0x1')](_0x8e5a('0x2'),_0x8e5a('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x8e5a('0x6')]},'idField':{'type':Sequelize[_0x8e5a('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8e5a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8e5a('0x6')]}}; \ No newline at end of file +var _0x5682=['customVariable','exports','ENUM','string','variable','picklist','STRING'];(function(_0x5e8123,_0x53bb17){var _0x5b3c1b=function(_0x1be8bb){while(--_0x1be8bb){_0x5e8123['push'](_0x5e8123['shift']());}};_0x5b3c1b(++_0x53bb17);}(_0x5682,0xa9));var _0x2568=function(_0x5016c4,_0x2bbe08){_0x5016c4=_0x5016c4-0x0;var _0x2b1703=_0x5682[_0x5016c4];return _0x2b1703;};'use strict';var Sequelize=require('sequelize');module[_0x2568('0x0')]={'type':{'type':Sequelize[_0x2568('0x1')](_0x2568('0x2'),_0x2568('0x3'),'customVariable','keyValue',_0x2568('0x4')),'defaultValue':_0x2568('0x2')},'content':{'type':Sequelize[_0x2568('0x5')]},'key':{'type':Sequelize[_0x2568('0x5')]},'keyType':{'type':Sequelize[_0x2568('0x1')](_0x2568('0x2'),_0x2568('0x3'),_0x2568('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2568('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2568('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index a5e8ab3..f1468ab 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 _0x0500=['findAll','rows','catch','show','params','length','include','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','update','then','destroy','error','name','index','map','ServicenowField','rawAttributes','fieldName','model','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','options','includeAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0500,0x11e));var _0x0050=function(_0x4e879b,_0x1ce91d){_0x4e879b=_0x4e879b-0x0;var _0x5b0ce3=_0x0500[_0x4e879b];return _0x5b0ce3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0050('0x0'));var zipdir=require(_0x0050('0x1'));var jsonpatch=require(_0x0050('0x2'));var rp=require('request-promise');var moment=require(_0x0050('0x3'));var BPromise=require(_0x0050('0x4'));var Mustache=require(_0x0050('0x5'));var util=require(_0x0050('0x6'));var path=require('path');var sox=require(_0x0050('0x7'));var csv=require(_0x0050('0x8'));var ejs=require(_0x0050('0x9'));var fs=require('fs');var fs_extra=require(_0x0050('0xa'));var _=require(_0x0050('0xb'));var squel=require(_0x0050('0xc'));var crypto=require(_0x0050('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0050('0x8'));var querystring=require(_0x0050('0xe'));var Papa=require(_0x0050('0xf'));var Redis=require('ioredis');var authService=require(_0x0050('0x10'));var qs=require(_0x0050('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0050('0x12'));var logger=require(_0x0050('0x13'))('api');var utils=require(_0x0050('0x14'));var config=require(_0x0050('0x15'));var licenseUtil=require(_0x0050('0x16'));var db=require(_0x0050('0x17'))['db'];function respondWithStatusCode(_0x1f2d49,_0x39232e){_0x39232e=_0x39232e||0xcc;return function(_0x259a3e){if(_0x259a3e){return _0x1f2d49[_0x0050('0x18')](_0x39232e);}return _0x1f2d49[_0x0050('0x19')](_0x39232e)[_0x0050('0x1a')]();};}function respondWithResult(_0x184007,_0x10d0d0){_0x10d0d0=_0x10d0d0||0xc8;return function(_0x2fb37b){if(_0x2fb37b){return _0x184007[_0x0050('0x19')](_0x10d0d0)[_0x0050('0x1b')](_0x2fb37b);}};}function respondWithFilteredResult(_0x582e5c,_0x3556f9){return function(_0x20e92a){if(_0x20e92a){var _0x2f9f2e=typeof _0x3556f9['offset']===_0x0050('0x1c')&&typeof _0x3556f9[_0x0050('0x1d')]===_0x0050('0x1c');var _0x1cb464=_0x20e92a[_0x0050('0x1e')];var _0x548db3=_0x2f9f2e?0x0:_0x3556f9[_0x0050('0x1f')];var _0x5812f1=_0x2f9f2e?_0x20e92a[_0x0050('0x1e')]:_0x3556f9[_0x0050('0x1f')]+_0x3556f9['limit'];var _0x22e0e8;if(_0x5812f1>=_0x1cb464){_0x5812f1=_0x1cb464;_0x22e0e8=0xc8;}else{_0x22e0e8=0xce;}_0x582e5c[_0x0050('0x19')](_0x22e0e8);return _0x582e5c[_0x0050('0x20')]('Content-Range',_0x548db3+'-'+_0x5812f1+'/'+_0x1cb464)[_0x0050('0x1b')](_0x20e92a);}return null;};}function patchUpdates(_0x8b4ac9){return function(_0x5e750c){try{jsonpatch[_0x0050('0x21')](_0x5e750c,_0x8b4ac9,!![]);}catch(_0x12895a){return BPromise['reject'](_0x12895a);}return _0x5e750c['save']();};}function saveUpdates(_0x4be37c,_0x2b24d5){return function(_0x2d9858){if(_0x2d9858){return _0x2d9858[_0x0050('0x22')](_0x4be37c)[_0x0050('0x23')](function(_0xa891e1){return _0xa891e1;});}return null;};}function removeEntity(_0x56e9ea,_0x1725b6){return function(_0x4b812d){if(_0x4b812d){return _0x4b812d[_0x0050('0x24')]()['then'](function(){_0x56e9ea[_0x0050('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x220aa9,_0x357510){return function(_0x44f2b5){if(!_0x44f2b5){_0x220aa9['sendStatus'](0x194);}return _0x44f2b5;};}function handleError(_0x183a90,_0x178bba){_0x178bba=_0x178bba||0x1f4;return function(_0x14d74b){logger[_0x0050('0x25')](_0x14d74b['stack']);if(_0x14d74b[_0x0050('0x26')]){delete _0x14d74b['name'];}_0x183a90[_0x0050('0x19')](_0x178bba)['send'](_0x14d74b);};}exports[_0x0050('0x27')]=function(_0x2d596f,_0x5eda1e){var _0x54572a={},_0x1e3765={},_0xc85b54={'count':0x0,'rows':[]};var _0x566457=_[_0x0050('0x28')](db[_0x0050('0x29')][_0x0050('0x2a')],function(_0x284757){return{'name':_0x284757[_0x0050('0x2b')],'type':_0x284757['type']['key']};});_0x1e3765[_0x0050('0x2c')]=_[_0x0050('0x28')](_0x566457,_0x0050('0x26'));_0x1e3765['query']=_['keys'](_0x2d596f['query']);_0x1e3765[_0x0050('0x2d')]=_[_0x0050('0x2e')](_0x1e3765['model'],_0x1e3765[_0x0050('0x2f')]);_0x54572a[_0x0050('0x30')]=_[_0x0050('0x2e')](_0x1e3765[_0x0050('0x2c')],qs[_0x0050('0x31')](_0x2d596f[_0x0050('0x2f')][_0x0050('0x31')]));_0x54572a[_0x0050('0x30')]=_0x54572a[_0x0050('0x30')]['length']?_0x54572a[_0x0050('0x30')]:_0x1e3765[_0x0050('0x2c')];if(!_0x2d596f[_0x0050('0x2f')][_0x0050('0x32')]('nolimit')){_0x54572a[_0x0050('0x1d')]=qs[_0x0050('0x1d')](_0x2d596f['query'][_0x0050('0x1d')]);_0x54572a[_0x0050('0x1f')]=qs[_0x0050('0x1f')](_0x2d596f['query'][_0x0050('0x1f')]);}_0x54572a[_0x0050('0x33')]=qs['sort'](_0x2d596f[_0x0050('0x2f')][_0x0050('0x34')]);_0x54572a['where']=qs[_0x0050('0x2d')](_[_0x0050('0x35')](_0x2d596f[_0x0050('0x2f')],_0x1e3765[_0x0050('0x2d')]),_0x566457);if(_0x2d596f['query']['filter']){_0x54572a[_0x0050('0x36')]=_[_0x0050('0x37')](_0x54572a['where'],{'$or':_[_0x0050('0x28')](_0x566457,function(_0x401baf){if(_0x401baf['type']!==_0x0050('0x38')){var _0xc3873f={};_0xc3873f[_0x401baf[_0x0050('0x26')]]={'$like':'%'+_0x2d596f[_0x0050('0x2f')]['filter']+'%'};return _0xc3873f;}})});}_0x54572a=_[_0x0050('0x37')]({},_0x54572a,_0x2d596f[_0x0050('0x39')]);var _0x30deb4={'where':_0x54572a[_0x0050('0x36')]};return db[_0x0050('0x29')][_0x0050('0x1e')](_0x30deb4)[_0x0050('0x23')](function(_0x35dbb6){_0xc85b54[_0x0050('0x1e')]=_0x35dbb6;if(_0x2d596f['query'][_0x0050('0x3a')]){_0x54572a['include']=[{'all':!![]}];}return db[_0x0050('0x29')][_0x0050('0x3b')](_0x54572a);})['then'](function(_0x7b9051){_0xc85b54[_0x0050('0x3c')]=_0x7b9051;return _0xc85b54;})[_0x0050('0x23')](respondWithFilteredResult(_0x5eda1e,_0x54572a))[_0x0050('0x3d')](handleError(_0x5eda1e,null));};exports[_0x0050('0x3e')]=function(_0x35b5a2,_0x4c307a){var _0x4af4da={'raw':!![],'where':{'id':_0x35b5a2[_0x0050('0x3f')]['id']}},_0x39682a={};_0x39682a['model']=_['keys'](db[_0x0050('0x29')][_0x0050('0x2a')]);_0x39682a[_0x0050('0x2f')]=_['keys'](_0x35b5a2[_0x0050('0x2f')]);_0x39682a['filters']=_[_0x0050('0x2e')](_0x39682a[_0x0050('0x2c')],_0x39682a[_0x0050('0x2f')]);_0x4af4da[_0x0050('0x30')]=_['intersection'](_0x39682a[_0x0050('0x2c')],qs['fields'](_0x35b5a2['query'][_0x0050('0x31')]));_0x4af4da['attributes']=_0x4af4da[_0x0050('0x30')][_0x0050('0x40')]?_0x4af4da[_0x0050('0x30')]:_0x39682a[_0x0050('0x2c')];if(_0x35b5a2['query'][_0x0050('0x3a')]){_0x4af4da[_0x0050('0x41')]=[{'all':!![]}];}_0x4af4da=_[_0x0050('0x37')]({},_0x4af4da,_0x35b5a2[_0x0050('0x39')]);return db['ServicenowField'][_0x0050('0x42')](_0x4af4da)[_0x0050('0x23')](handleEntityNotFound(_0x4c307a,null))['then'](respondWithResult(_0x4c307a,null))[_0x0050('0x3d')](handleError(_0x4c307a,null));};exports[_0x0050('0x43')]=function(_0x4f07fb,_0x3bb66c){return db[_0x0050('0x29')][_0x0050('0x43')](_0x4f07fb[_0x0050('0x44')],{})['then'](respondWithResult(_0x3bb66c,0xc9))[_0x0050('0x3d')](handleError(_0x3bb66c,null));};exports['update']=function(_0x3450ab,_0x1ea36c){if(_0x3450ab['body']['id']){delete _0x3450ab[_0x0050('0x44')]['id'];}return db['ServicenowField'][_0x0050('0x42')]({'where':{'id':_0x3450ab['params']['id']}})['then'](handleEntityNotFound(_0x1ea36c,null))[_0x0050('0x23')](saveUpdates(_0x3450ab[_0x0050('0x44')],null))['then'](respondWithResult(_0x1ea36c,null))[_0x0050('0x3d')](handleError(_0x1ea36c,null));};exports[_0x0050('0x24')]=function(_0x3c1e5d,_0x2e2006){return db[_0x0050('0x29')][_0x0050('0x42')]({'where':{'id':_0x3c1e5d[_0x0050('0x3f')]['id']}})[_0x0050('0x23')](handleEntityNotFound(_0x2e2006,null))[_0x0050('0x23')](removeEntity(_0x2e2006,null))[_0x0050('0x3d')](handleError(_0x2e2006,null));}; \ No newline at end of file +var _0x8ab3=['destroy','sendStatus','stack','name','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','update','then'];(function(_0x2d1949,_0x308dac){var _0x15cd27=function(_0x36e285){while(--_0x36e285){_0x2d1949['push'](_0x2d1949['shift']());}};_0x15cd27(++_0x308dac);}(_0x8ab3,0xab));var _0x38ab=function(_0x3937e7,_0x91712b){_0x3937e7=_0x3937e7-0x0;var _0x197ad7=_0x8ab3[_0x3937e7];return _0x197ad7;};'use strict';var emlformat=require(_0x38ab('0x0'));var rimraf=require(_0x38ab('0x1'));var zipdir=require(_0x38ab('0x2'));var jsonpatch=require(_0x38ab('0x3'));var rp=require(_0x38ab('0x4'));var moment=require(_0x38ab('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x38ab('0x6'));var util=require(_0x38ab('0x7'));var path=require(_0x38ab('0x8'));var sox=require('sox');var csv=require(_0x38ab('0x9'));var ejs=require(_0x38ab('0xa'));var fs=require('fs');var fs_extra=require(_0x38ab('0xb'));var _=require('lodash');var squel=require(_0x38ab('0xc'));var crypto=require(_0x38ab('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x38ab('0xe'));var toCsv=require(_0x38ab('0x9'));var querystring=require(_0x38ab('0xf'));var Papa=require(_0x38ab('0x10'));var Redis=require('ioredis');var authService=require(_0x38ab('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38ab('0x12'));var logger=require(_0x38ab('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x38ab('0x14'))['db'];function respondWithStatusCode(_0x3adcca,_0x913d5a){_0x913d5a=_0x913d5a||0xcc;return function(_0x5ba8b4){if(_0x5ba8b4){return _0x3adcca['sendStatus'](_0x913d5a);}return _0x3adcca[_0x38ab('0x15')](_0x913d5a)[_0x38ab('0x16')]();};}function respondWithResult(_0x2037ad,_0x5560a8){_0x5560a8=_0x5560a8||0xc8;return function(_0x42612b){if(_0x42612b){return _0x2037ad[_0x38ab('0x15')](_0x5560a8)['json'](_0x42612b);}};}function respondWithFilteredResult(_0x41bb93,_0x41b6de){return function(_0x437f05){if(_0x437f05){var _0x2cf10f=typeof _0x41b6de[_0x38ab('0x17')]==='undefined'&&typeof _0x41b6de[_0x38ab('0x18')]===_0x38ab('0x19');var _0x270284=_0x437f05[_0x38ab('0x1a')];var _0x5a0303=_0x2cf10f?0x0:_0x41b6de[_0x38ab('0x17')];var _0x3e70f1=_0x2cf10f?_0x437f05[_0x38ab('0x1a')]:_0x41b6de[_0x38ab('0x17')]+_0x41b6de[_0x38ab('0x18')];var _0xcfae72;if(_0x3e70f1>=_0x270284){_0x3e70f1=_0x270284;_0xcfae72=0xc8;}else{_0xcfae72=0xce;}_0x41bb93[_0x38ab('0x15')](_0xcfae72);return _0x41bb93[_0x38ab('0x1b')](_0x38ab('0x1c'),_0x5a0303+'-'+_0x3e70f1+'/'+_0x270284)[_0x38ab('0x1d')](_0x437f05);}return null;};}function patchUpdates(_0x3b7a14){return function(_0x3f4fda){try{jsonpatch['apply'](_0x3f4fda,_0x3b7a14,!![]);}catch(_0x4257cc){return BPromise[_0x38ab('0x1e')](_0x4257cc);}return _0x3f4fda['save']();};}function saveUpdates(_0x2abba3,_0x20b7e0){return function(_0x3abc84){if(_0x3abc84){return _0x3abc84[_0x38ab('0x1f')](_0x2abba3)[_0x38ab('0x20')](function(_0x1279cb){return _0x1279cb;});}return null;};}function removeEntity(_0x175eb4,_0x4216f2){return function(_0x55b5f1){if(_0x55b5f1){return _0x55b5f1[_0x38ab('0x21')]()[_0x38ab('0x20')](function(){_0x175eb4['status'](0xcc)[_0x38ab('0x16')]();});}};}function handleEntityNotFound(_0x3f6705,_0x5a77c8){return function(_0x2fc826){if(!_0x2fc826){_0x3f6705[_0x38ab('0x22')](0x194);}return _0x2fc826;};}function handleError(_0x1b6c44,_0x2a1e74){_0x2a1e74=_0x2a1e74||0x1f4;return function(_0x51b26d){logger['error'](_0x51b26d[_0x38ab('0x23')]);if(_0x51b26d[_0x38ab('0x24')]){delete _0x51b26d[_0x38ab('0x24')];}_0x1b6c44[_0x38ab('0x15')](_0x2a1e74)['send'](_0x51b26d);};}exports['index']=function(_0x1cbfdd,_0xe2b4d6){var _0xe8392e={},_0x58416d={},_0x43d812={'count':0x0,'rows':[]};var _0x454b2b=_[_0x38ab('0x25')](db[_0x38ab('0x26')][_0x38ab('0x27')],function(_0x4c9ee0){return{'name':_0x4c9ee0[_0x38ab('0x28')],'type':_0x4c9ee0[_0x38ab('0x29')][_0x38ab('0x2a')]};});_0x58416d[_0x38ab('0x2b')]=_[_0x38ab('0x25')](_0x454b2b,'name');_0x58416d[_0x38ab('0x2c')]=_[_0x38ab('0x2d')](_0x1cbfdd['query']);_0x58416d[_0x38ab('0x2e')]=_['intersection'](_0x58416d['model'],_0x58416d[_0x38ab('0x2c')]);_0xe8392e[_0x38ab('0x2f')]=_[_0x38ab('0x30')](_0x58416d[_0x38ab('0x2b')],qs[_0x38ab('0x31')](_0x1cbfdd['query']['fields']));_0xe8392e[_0x38ab('0x2f')]=_0xe8392e['attributes'][_0x38ab('0x32')]?_0xe8392e['attributes']:_0x58416d[_0x38ab('0x2b')];if(!_0x1cbfdd[_0x38ab('0x2c')][_0x38ab('0x33')](_0x38ab('0x34'))){_0xe8392e['limit']=qs[_0x38ab('0x18')](_0x1cbfdd['query'][_0x38ab('0x18')]);_0xe8392e[_0x38ab('0x17')]=qs['offset'](_0x1cbfdd['query'][_0x38ab('0x17')]);}_0xe8392e[_0x38ab('0x35')]=qs[_0x38ab('0x36')](_0x1cbfdd['query']['sort']);_0xe8392e['where']=qs[_0x38ab('0x2e')](_[_0x38ab('0x37')](_0x1cbfdd['query'],_0x58416d['filters']),_0x454b2b);if(_0x1cbfdd[_0x38ab('0x2c')][_0x38ab('0x38')]){_0xe8392e[_0x38ab('0x39')]=_['merge'](_0xe8392e['where'],{'$or':_[_0x38ab('0x25')](_0x454b2b,function(_0x48bd4d){if(_0x48bd4d[_0x38ab('0x29')]!=='VIRTUAL'){var _0x423bcc={};_0x423bcc[_0x48bd4d[_0x38ab('0x24')]]={'$like':'%'+_0x1cbfdd[_0x38ab('0x2c')]['filter']+'%'};return _0x423bcc;}})});}_0xe8392e=_[_0x38ab('0x3a')]({},_0xe8392e,_0x1cbfdd[_0x38ab('0x3b')]);var _0x5da443={'where':_0xe8392e[_0x38ab('0x39')]};return db[_0x38ab('0x26')][_0x38ab('0x1a')](_0x5da443)[_0x38ab('0x20')](function(_0x166cf3){_0x43d812[_0x38ab('0x1a')]=_0x166cf3;if(_0x1cbfdd[_0x38ab('0x2c')][_0x38ab('0x3c')]){_0xe8392e['include']=[{'all':!![]}];}return db[_0x38ab('0x26')][_0x38ab('0x3d')](_0xe8392e);})[_0x38ab('0x20')](function(_0x54e1d4){_0x43d812['rows']=_0x54e1d4;return _0x43d812;})[_0x38ab('0x20')](respondWithFilteredResult(_0xe2b4d6,_0xe8392e))[_0x38ab('0x3e')](handleError(_0xe2b4d6,null));};exports[_0x38ab('0x3f')]=function(_0x1d4180,_0x412995){var _0x45a6f9={'raw':!![],'where':{'id':_0x1d4180[_0x38ab('0x40')]['id']}},_0x92afbd={};_0x92afbd['model']=_[_0x38ab('0x2d')](db[_0x38ab('0x26')][_0x38ab('0x27')]);_0x92afbd[_0x38ab('0x2c')]=_[_0x38ab('0x2d')](_0x1d4180[_0x38ab('0x2c')]);_0x92afbd['filters']=_[_0x38ab('0x30')](_0x92afbd['model'],_0x92afbd[_0x38ab('0x2c')]);_0x45a6f9[_0x38ab('0x2f')]=_[_0x38ab('0x30')](_0x92afbd[_0x38ab('0x2b')],qs[_0x38ab('0x31')](_0x1d4180['query'][_0x38ab('0x31')]));_0x45a6f9[_0x38ab('0x2f')]=_0x45a6f9[_0x38ab('0x2f')][_0x38ab('0x32')]?_0x45a6f9[_0x38ab('0x2f')]:_0x92afbd['model'];if(_0x1d4180[_0x38ab('0x2c')]['includeAll']){_0x45a6f9['include']=[{'all':!![]}];}_0x45a6f9=_['merge']({},_0x45a6f9,_0x1d4180[_0x38ab('0x3b')]);return db[_0x38ab('0x26')][_0x38ab('0x41')](_0x45a6f9)[_0x38ab('0x20')](handleEntityNotFound(_0x412995,null))[_0x38ab('0x20')](respondWithResult(_0x412995,null))[_0x38ab('0x3e')](handleError(_0x412995,null));};exports[_0x38ab('0x42')]=function(_0x11e499,_0x5213a0){return db[_0x38ab('0x26')][_0x38ab('0x42')](_0x11e499['body'],{})[_0x38ab('0x20')](respondWithResult(_0x5213a0,0xc9))[_0x38ab('0x3e')](handleError(_0x5213a0,null));};exports[_0x38ab('0x1f')]=function(_0xbaa135,_0x3e28db){if(_0xbaa135[_0x38ab('0x43')]['id']){delete _0xbaa135[_0x38ab('0x43')]['id'];}return db['ServicenowField'][_0x38ab('0x41')]({'where':{'id':_0xbaa135['params']['id']}})['then'](handleEntityNotFound(_0x3e28db,null))['then'](saveUpdates(_0xbaa135['body'],null))['then'](respondWithResult(_0x3e28db,null))[_0x38ab('0x3e')](handleError(_0x3e28db,null));};exports[_0x38ab('0x21')]=function(_0x28ed6f,_0x5bab39){return db[_0x38ab('0x26')][_0x38ab('0x41')]({'where':{'id':_0x28ed6f[_0x38ab('0x40')]['id']}})[_0x38ab('0x20')](handleEntityNotFound(_0x5bab39,null))[_0x38ab('0x20')](removeEntity(_0x5bab39,null))[_0x38ab('0x3e')](handleError(_0x5bab39,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index e352193..c8233b2 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 _0x2149=['../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0xcc8ce5,_0x4af8f7){var _0x1e9464=function(_0x3b68db){while(--_0x3b68db){_0xcc8ce5['push'](_0xcc8ce5['shift']());}};_0x1e9464(++_0x4af8f7);}(_0x2149,0x1e3));var _0x9214=function(_0x32b2ea,_0x1b85f0){_0x32b2ea=_0x32b2ea-0x0;var _0x21184b=_0x2149[_0x32b2ea];return _0x21184b;};'use strict';var _=require(_0x9214('0x0'));var util=require(_0x9214('0x1'));var logger=require(_0x9214('0x2'))(_0x9214('0x3'));var moment=require(_0x9214('0x4'));var BPromise=require('bluebird');var rp=require(_0x9214('0x5'));var fs=require('fs');var path=require(_0x9214('0x6'));var rimraf=require('rimraf');var config=require(_0x9214('0x7'));var attributes=require(_0x9214('0x8'));module[_0x9214('0x9')]=function(_0x4259ca,_0x514733){return _0x4259ca[_0x9214('0xa')]('ServicenowField',attributes,{'tableName':_0x9214('0xb'),'paranoid':![],'indexes':[{'name':_0x9214('0xc'),'fields':['idField',_0x9214('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x85ab=['exports','define','ServicenowField','int_servicenow_fields','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intServicenowField.attributes'];(function(_0x502598,_0x1e95c8){var _0xbdee21=function(_0x140feb){while(--_0x140feb){_0x502598['push'](_0x502598['shift']());}};_0xbdee21(++_0x1e95c8);}(_0x85ab,0x88));var _0xb85a=function(_0x38ecda,_0x3b551e){_0x38ecda=_0x38ecda-0x0;var _0x3fa8f3=_0x85ab[_0x38ecda];return _0x3fa8f3;};'use strict';var _=require(_0xb85a('0x0'));var util=require('util');var logger=require(_0xb85a('0x1'))(_0xb85a('0x2'));var moment=require(_0xb85a('0x3'));var BPromise=require(_0xb85a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb85a('0x5'));var config=require(_0xb85a('0x6'));var attributes=require(_0xb85a('0x7'));module[_0xb85a('0x8')]=function(_0x4bbf72,_0x53a738){return _0x4bbf72[_0xb85a('0x9')](_0xb85a('0xa'),attributes,{'tableName':_0xb85a('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 f5d9b33..3e53394 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 _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x49ad97,_0x583c98){var _0x482bd0=function(_0x324913){while(--_0x324913){_0x49ad97['push'](_0x49ad97['shift']());}};_0x482bd0(++_0x583c98);}(_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 moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0x70e0=['code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x281b46,_0x35cc15){var _0x5836ca=function(_0x27a06f){while(--_0x27a06f){_0x281b46['push'](_0x281b46['shift']());}};_0x5836ca(++_0x35cc15);}(_0x70e0,0x17b));var _0x070e=function(_0x357dbc,_0x133e88){_0x357dbc=_0x357dbc-0x0;var _0x3f800a=_0x70e0[_0x357dbc];return _0x3f800a;};'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')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 41772e7..2b3934a 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(_0x5e9bc0,_0x3c41f1){var _0x3022ff=function(_0x1f4e23){while(--_0x1f4e23){_0x5e9bc0['push'](_0x5e9bc0['shift']());}};_0x3022ff(++_0x3c41f1);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1ee856,_0xd5da21){var _0x1b2d34=function(_0x3bd914){while(--_0x3bd914){_0x1ee856['push'](_0x1ee856['shift']());}};_0x1b2d34(++_0xd5da21);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 8944929..835b112 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(_0x144b01,_0x19db7c){var _0x9078bf=function(_0x5112da){while(--_0x5112da){_0x144b01['push'](_0x144b01['shift']());}};_0x9078bf(++_0x19db7c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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(_0x19c03d,_0x477d5f){var _0x54a37f=function(_0x483b6d){while(--_0x483b6d){_0x19c03d['push'](_0x19c03d['shift']());}};_0x54a37f(++_0x477d5f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 117a2fa..e75bf11 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 _0x2ce1=['slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','values','module_fields','includes','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','set','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','intersection','include','find','create','body','update','params','getConfigurations','SugarcrmConfiguration','order','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','assigned_user_id','date_start','duration_minutes','parent_id','parent_type','parent_name','username','password','remoteUri'];(function(_0x222463,_0x2ca0ed){var _0x42ccfd=function(_0x67337e){while(--_0x67337e){_0x222463['push'](_0x222463['shift']());}};_0x42ccfd(++_0x2ca0ed);}(_0x2ce1,0x8b));var _0x12ce=function(_0x115cc7,_0x5e36fe){_0x115cc7=_0x115cc7-0x0;var _0x4c1218=_0x2ce1[_0x115cc7];return _0x4c1218;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x12ce('0x0'));var rp=require(_0x12ce('0x1'));var moment=require(_0x12ce('0x2'));var BPromise=require(_0x12ce('0x3'));var Mustache=require('mustache');var util=require(_0x12ce('0x4'));var path=require(_0x12ce('0x5'));var sox=require('sox');var csv=require(_0x12ce('0x6'));var ejs=require(_0x12ce('0x7'));var fs=require('fs');var fs_extra=require(_0x12ce('0x8'));var _=require('lodash');var squel=require(_0x12ce('0x9'));var crypto=require('crypto');var jsforce=require(_0x12ce('0xa'));var deskjs=require(_0x12ce('0xb'));var toCsv=require(_0x12ce('0x6'));var querystring=require('querystring');var Papa=require(_0x12ce('0xc'));var Redis=require(_0x12ce('0xd'));var authService=require(_0x12ce('0xe'));var qs=require(_0x12ce('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12ce('0x10'));var logger=require('../../config/logger')(_0x12ce('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x12ce('0x12'));var db=require(_0x12ce('0x13'))['db'];var integrations=require(_0x12ce('0x14'));function respondWithStatusCode(_0x3d274d,_0x3d1dd0){_0x3d1dd0=_0x3d1dd0||0xcc;return function(_0x3c288b){if(_0x3c288b){return _0x3d274d['sendStatus'](_0x3d1dd0);}return _0x3d274d[_0x12ce('0x15')](_0x3d1dd0)['end']();};}function respondWithResult(_0x12bcf2,_0x132867){_0x132867=_0x132867||0xc8;return function(_0x302e3e){if(_0x302e3e){return _0x12bcf2['status'](_0x132867)[_0x12ce('0x16')](_0x302e3e);}};}function respondWithFilteredResult(_0x288cff,_0x2ac396){return function(_0x39e4ec){if(_0x39e4ec){var _0x134831=typeof _0x2ac396[_0x12ce('0x17')]==='undefined'&&typeof _0x2ac396['limit']===_0x12ce('0x18');var _0x48250c=_0x39e4ec[_0x12ce('0x19')];var _0x2a0f3f=_0x134831?0x0:_0x2ac396['offset'];var _0x22ac52=_0x134831?_0x39e4ec['count']:_0x2ac396[_0x12ce('0x17')]+_0x2ac396['limit'];var _0xe24a11;if(_0x22ac52>=_0x48250c){_0x22ac52=_0x48250c;_0xe24a11=0xc8;}else{_0xe24a11=0xce;}_0x288cff['status'](_0xe24a11);return _0x288cff[_0x12ce('0x1a')]('Content-Range',_0x2a0f3f+'-'+_0x22ac52+'/'+_0x48250c)[_0x12ce('0x16')](_0x39e4ec);}return null;};}function patchUpdates(_0x521adb){return function(_0x52f813){try{jsonpatch[_0x12ce('0x1b')](_0x52f813,_0x521adb,!![]);}catch(_0x1744d6){return BPromise[_0x12ce('0x1c')](_0x1744d6);}return _0x52f813[_0x12ce('0x1d')]();};}function saveUpdates(_0x5cbb85,_0x162811){return function(_0xdd029a){if(_0xdd029a){return _0xdd029a['update'](_0x5cbb85)[_0x12ce('0x1e')](function(_0x4c86cd){return _0x4c86cd;});}return null;};}function removeEntity(_0x45a79c,_0x5c4f01){return function(_0x43c825){if(_0x43c825){return _0x43c825[_0x12ce('0x1f')]()[_0x12ce('0x1e')](function(){_0x45a79c[_0x12ce('0x15')](0xcc)[_0x12ce('0x20')]();});}};}function handleEntityNotFound(_0x186358,_0xb45ebe){return function(_0x2c99ab){if(!_0x2c99ab){_0x186358['sendStatus'](0x194);}return _0x2c99ab;};}function handleError(_0x492e77,_0x12c75e){_0x12c75e=_0x12c75e||0x1f4;return function(_0x9608af){logger[_0x12ce('0x21')](_0x9608af[_0x12ce('0x22')]);if(_0x9608af['name']){delete _0x9608af[_0x12ce('0x23')];}_0x492e77[_0x12ce('0x15')](_0x12c75e)[_0x12ce('0x24')](_0x9608af);};}exports[_0x12ce('0x25')]=function(_0x55ea43,_0x57fa70){var _0x4e511b={},_0x3ac1e3={},_0x10b653={'count':0x0,'rows':[]};var _0x54efb9=_[_0x12ce('0x26')](db[_0x12ce('0x27')][_0x12ce('0x28')],function(_0x18c305){return{'name':_0x18c305[_0x12ce('0x29')],'type':_0x18c305[_0x12ce('0x2a')][_0x12ce('0x2b')]};});_0x3ac1e3[_0x12ce('0x2c')]=_['map'](_0x54efb9,_0x12ce('0x23'));_0x3ac1e3[_0x12ce('0x2d')]=_[_0x12ce('0x2e')](_0x55ea43[_0x12ce('0x2d')]);_0x3ac1e3[_0x12ce('0x2f')]=_['intersection'](_0x3ac1e3[_0x12ce('0x2c')],_0x3ac1e3[_0x12ce('0x2d')]);_0x4e511b['attributes']=_['intersection'](_0x3ac1e3['model'],qs[_0x12ce('0x30')](_0x55ea43[_0x12ce('0x2d')][_0x12ce('0x30')]));_0x4e511b[_0x12ce('0x31')]=_0x4e511b[_0x12ce('0x31')][_0x12ce('0x32')]?_0x4e511b['attributes']:_0x3ac1e3[_0x12ce('0x2c')];if(!_0x55ea43[_0x12ce('0x2d')][_0x12ce('0x33')](_0x12ce('0x34'))){_0x4e511b[_0x12ce('0x35')]=qs[_0x12ce('0x35')](_0x55ea43[_0x12ce('0x2d')][_0x12ce('0x35')]);_0x4e511b['offset']=qs[_0x12ce('0x17')](_0x55ea43[_0x12ce('0x2d')][_0x12ce('0x17')]);}_0x4e511b['order']=qs[_0x12ce('0x36')](_0x55ea43[_0x12ce('0x2d')][_0x12ce('0x36')]);_0x4e511b['where']=qs[_0x12ce('0x2f')](_['pick'](_0x55ea43['query'],_0x3ac1e3[_0x12ce('0x2f')]),_0x54efb9);if(_0x55ea43['query'][_0x12ce('0x37')]){_0x4e511b[_0x12ce('0x38')]=_[_0x12ce('0x39')](_0x4e511b['where'],{'$or':_[_0x12ce('0x26')](_0x54efb9,function(_0x328980){if(_0x328980[_0x12ce('0x2a')]!==_0x12ce('0x3a')){var _0x332930={};_0x332930[_0x328980[_0x12ce('0x23')]]={'$like':'%'+_0x55ea43['query']['filter']+'%'};return _0x332930;}})});}_0x4e511b=_['merge']({},_0x4e511b,_0x55ea43[_0x12ce('0x3b')]);var _0x5c5367={'where':_0x4e511b[_0x12ce('0x38')]};return db['SugarcrmAccount'][_0x12ce('0x19')](_0x5c5367)[_0x12ce('0x1e')](function(_0x80e31f){_0x10b653[_0x12ce('0x19')]=_0x80e31f;if(_0x55ea43[_0x12ce('0x2d')][_0x12ce('0x3c')]){_0x4e511b['include']=[{'all':!![]}];}return db[_0x12ce('0x27')][_0x12ce('0x3d')](_0x4e511b);})[_0x12ce('0x1e')](function(_0x490b9c){_0x10b653[_0x12ce('0x3e')]=_0x490b9c;return _0x10b653;})[_0x12ce('0x1e')](respondWithFilteredResult(_0x57fa70,_0x4e511b))[_0x12ce('0x3f')](handleError(_0x57fa70,null));};exports['show']=function(_0x5da8de,_0x357d92){var _0xc2bfad={'raw':![],'where':{'id':_0x5da8de['params']['id']}},_0x45a10b={};_0x45a10b[_0x12ce('0x2c')]=_[_0x12ce('0x2e')](db[_0x12ce('0x27')][_0x12ce('0x28')]);_0x45a10b[_0x12ce('0x2d')]=_[_0x12ce('0x2e')](_0x5da8de[_0x12ce('0x2d')]);_0x45a10b[_0x12ce('0x2f')]=_[_0x12ce('0x40')](_0x45a10b[_0x12ce('0x2c')],_0x45a10b[_0x12ce('0x2d')]);_0xc2bfad['attributes']=_['intersection'](_0x45a10b[_0x12ce('0x2c')],qs[_0x12ce('0x30')](_0x5da8de[_0x12ce('0x2d')]['fields']));_0xc2bfad['attributes']=_0xc2bfad['attributes'][_0x12ce('0x32')]?_0xc2bfad[_0x12ce('0x31')]:_0x45a10b[_0x12ce('0x2c')];if(_0x5da8de[_0x12ce('0x2d')][_0x12ce('0x3c')]){_0xc2bfad[_0x12ce('0x41')]=[{'all':!![]}];}_0xc2bfad=_[_0x12ce('0x39')]({},_0xc2bfad,_0x5da8de['options']);return db['SugarcrmAccount'][_0x12ce('0x42')](_0xc2bfad)['then'](handleEntityNotFound(_0x357d92,null))[_0x12ce('0x1e')](respondWithResult(_0x357d92,null))[_0x12ce('0x3f')](handleError(_0x357d92,null));};exports[_0x12ce('0x43')]=function(_0xd17a37,_0x4bf956){return db[_0x12ce('0x27')]['create'](_0xd17a37[_0x12ce('0x44')],{})['then'](respondWithResult(_0x4bf956,0xc9))[_0x12ce('0x3f')](handleError(_0x4bf956,null));};exports[_0x12ce('0x45')]=function(_0x3a5849,_0x29acc3){if(_0x3a5849[_0x12ce('0x44')]['id']){delete _0x3a5849[_0x12ce('0x44')]['id'];}return db[_0x12ce('0x27')]['find']({'where':{'id':_0x3a5849['params']['id']}})[_0x12ce('0x1e')](handleEntityNotFound(_0x29acc3,null))[_0x12ce('0x1e')](saveUpdates(_0x3a5849['body'],null))['then'](respondWithResult(_0x29acc3,null))[_0x12ce('0x3f')](handleError(_0x29acc3,null));};exports[_0x12ce('0x1f')]=function(_0x7faa73,_0x3f5eef){return db[_0x12ce('0x27')][_0x12ce('0x42')]({'where':{'id':_0x7faa73[_0x12ce('0x46')]['id']}})[_0x12ce('0x1e')](handleEntityNotFound(_0x3f5eef,null))[_0x12ce('0x1e')](removeEntity(_0x3f5eef,null))[_0x12ce('0x3f')](handleError(_0x3f5eef,null));};exports[_0x12ce('0x47')]=function(_0x178a0a,_0x14b5f0,_0x4237f0){var _0x455f03={};var _0x4a4595={};var _0x4c4a5c;var _0x497187;return db[_0x12ce('0x27')]['findOne']({'where':{'id':_0x178a0a[_0x12ce('0x46')]['id']}})[_0x12ce('0x1e')](handleEntityNotFound(_0x14b5f0,null))['then'](function(_0x3a70a3){if(_0x3a70a3){_0x4c4a5c=_0x3a70a3;_0x4a4595[_0x12ce('0x2c')]=_[_0x12ce('0x2e')](db[_0x12ce('0x48')][_0x12ce('0x28')]);_0x4a4595[_0x12ce('0x2d')]=_[_0x12ce('0x2e')](_0x178a0a[_0x12ce('0x2d')]);_0x4a4595[_0x12ce('0x2f')]=_['intersection'](_0x4a4595[_0x12ce('0x2c')],_0x4a4595[_0x12ce('0x2d')]);_0x455f03['attributes']=_[_0x12ce('0x40')](_0x4a4595[_0x12ce('0x2c')],qs[_0x12ce('0x30')](_0x178a0a['query'][_0x12ce('0x30')]));_0x455f03[_0x12ce('0x31')]=_0x455f03['attributes'][_0x12ce('0x32')]?_0x455f03[_0x12ce('0x31')]:_0x4a4595[_0x12ce('0x2c')];_0x455f03[_0x12ce('0x49')]=qs[_0x12ce('0x36')](_0x178a0a['query'][_0x12ce('0x36')]);_0x455f03[_0x12ce('0x38')]=qs[_0x12ce('0x2f')](_['pick'](_0x178a0a[_0x12ce('0x2d')],_0x4a4595['filters']));if(_0x178a0a['query']['filter']){_0x455f03['where']=_[_0x12ce('0x39')](_0x455f03[_0x12ce('0x38')],{'$or':_[_0x12ce('0x26')](_0x455f03[_0x12ce('0x31')],function(_0x449df4){var _0x56e276={};_0x56e276[_0x449df4]={'$like':'%'+_0x178a0a['query'][_0x12ce('0x37')]+'%'};return _0x56e276;})});}_0x455f03=_[_0x12ce('0x39')]({},_0x455f03,_0x178a0a[_0x12ce('0x3b')]);return _0x4c4a5c[_0x12ce('0x47')](_0x455f03);}})[_0x12ce('0x1e')](function(_0x3073ae){if(_0x3073ae){_0x497187=_0x3073ae[_0x12ce('0x32')];if(!_0x178a0a['query'][_0x12ce('0x33')](_0x12ce('0x34'))){_0x455f03[_0x12ce('0x35')]=qs['limit'](_0x178a0a[_0x12ce('0x2d')][_0x12ce('0x35')]);_0x455f03['offset']=qs[_0x12ce('0x17')](_0x178a0a[_0x12ce('0x2d')]['offset']);}return _0x4c4a5c['getConfigurations'](_0x455f03);}})[_0x12ce('0x1e')](function(_0x5c2e63){if(_0x5c2e63){return _0x5c2e63?{'count':_0x497187,'rows':_0x5c2e63}:null;}})['then'](respondWithResult(_0x14b5f0,null))[_0x12ce('0x3f')](handleError(_0x14b5f0,null));};exports['addConfiguration']=function(_0x259f20,_0x3ffcdf,_0x153954){if(_0x259f20['body']['id']){delete _0x259f20[_0x12ce('0x44')]['id'];}return db[_0x12ce('0x27')][_0x12ce('0x4a')]({'where':{'id':_0x259f20[_0x12ce('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ffcdf,null))[_0x12ce('0x1e')](function(_0x5b0fe7){if(_0x5b0fe7){_0x259f20[_0x12ce('0x44')][_0x12ce('0x4b')]=_0x5b0fe7['id'];_0x259f20['body'][_0x12ce('0x4c')]=integrations[_0x12ce('0x4d')](_0x259f20[_0x12ce('0x44')][_0x12ce('0x4e')],_0x259f20[_0x12ce('0x44')][_0x12ce('0x2a')]);_0x259f20[_0x12ce('0x44')][_0x12ce('0x4f')]=integrations[_0x12ce('0x50')](_0x259f20[_0x12ce('0x44')][_0x12ce('0x4e')],_0x259f20[_0x12ce('0x44')][_0x12ce('0x2a')]);return db['SugarcrmConfiguration'][_0x12ce('0x43')](_0x259f20[_0x12ce('0x44')],{'include':[{'model':db['SugarcrmField'],'as':_0x12ce('0x4c')},{'model':db['SugarcrmField'],'as':_0x12ce('0x4f')}]});}return null;})[_0x12ce('0x1e')](respondWithResult(_0x3ffcdf,null))[_0x12ce('0x3f')](handleError(_0x3ffcdf,null));};exports[_0x12ce('0x51')]=function(_0x360c80,_0x12d8d5,_0x5d934b){var _0x7fe407='';var _0x13371d=['id',_0x12ce('0x23'),_0x12ce('0x52'),'created_by','description',_0x12ce('0x53'),'duration_hours',_0x12ce('0x54'),_0x12ce('0x55'),_0x12ce('0x56'),_0x12ce('0x57'),'direction'];return db['SugarcrmAccount'][_0x12ce('0x4a')]({'where':{'id':_0x360c80[_0x12ce('0x46')]['id']},'attributes':['id',_0x12ce('0x58'),_0x12ce('0x59'),_0x12ce('0x5a')]})[_0x12ce('0x1e')](handleEntityNotFound(_0x12d8d5,null))[_0x12ce('0x1e')](function(_0x5c8e53){if(_0x5c8e53){_0x7fe407=_0x5c8e53[_0x12ce('0x5a')];var _0x1d850d=_0x7fe407[_0x12ce('0x5b')](-0x1);if(_0x1d850d==='/'){_0x7fe407=_0x7fe407[_0x12ce('0x5c')](0x0,_0x7fe407[_0x12ce('0x5d')](_0x1d850d));}return rp({'method':_0x12ce('0x5e'),'uri':util[_0x12ce('0x5f')](_0x12ce('0x60'),_0x7fe407,_0x12ce('0x61')),'json':!![],'form':{'method':_0x12ce('0x62'),'input_type':_0x12ce('0x63'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5c8e53[_0x12ce('0x58')],'password':_0x5c8e53[_0x12ce('0x59')],'encryption':'PLAIN'},'application':_0x12ce('0x64')})}});}})[_0x12ce('0x1e')](function(_0xc801cd){if(_0xc801cd&&_0xc801cd[_0x12ce('0x23')]!==_0x12ce('0x65')&&_0xc801cd[_0x12ce('0x23')]!==_0x12ce('0x66')){return rp({'method':_0x12ce('0x5e'),'uri':util['format'](_0x12ce('0x60'),_0x7fe407,_0x12ce('0x61')),'json':!![],'form':{'method':_0x12ce('0x67'),'input_type':_0x12ce('0x63'),'response_type':_0x12ce('0x63'),'rest_data':JSON[_0x12ce('0x68')]({'session':_0xc801cd['id'],'module_name':_0x12ce('0x69')})}})['then'](function(_0x275f38){if(_0x275f38){var _0x10f345=_[_0x12ce('0x6a')](_0x275f38[_0x12ce('0x6b')]);_['remove'](_0x10f345,function(_0x237793){return _0x13371d[_0x12ce('0x6c')](_0x237793[_0x12ce('0x23')]);});return{'count':_0x10f345[_0x12ce('0x32')],'rows':_['map'](_0x10f345,function(_0x41bfab){return{'id':_0x41bfab['name'],'name':_0x41bfab['label'],'custom':_[_0x12ce('0x6d')](_0x41bfab[_0x12ce('0x23')],'_c')?!![]:![],'options':_0x41bfab[_0x12ce('0x3b')]?_['map'](_['values'](_0x41bfab[_0x12ce('0x3b')]),function(_0x2c1e57){return{'name':_0x2c1e57[_0x12ce('0x6e')],'value':_0x2c1e57[_0x12ce('0x23')]};}):[]};})};}})[_0x12ce('0x1e')](respondWithResult(_0x12d8d5,null))[_0x12ce('0x3f')](function(_0x445cbe){var _0x59d1c0=_0x360c80['query'][_0x12ce('0x6f')]?0x1f4:_0x445cbe['statusCode']||0x1f4;logger[_0x12ce('0x21')](_0x12ce('0x70'),'getFields',_0x59d1c0,JSON[_0x12ce('0x68')](_0x445cbe));delete _0x445cbe[_0x12ce('0x23')];if(_0x59d1c0===0x191){_0x59d1c0=0x190;}_0x12d8d5['status'](_0x59d1c0)[_0x12ce('0x24')](_0x360c80[_0x12ce('0x2d')][_0x12ce('0x6f')]?{'message':_0x12ce('0x71'),'statusCode':_0x445cbe[_0x12ce('0x72')]}:_0x445cbe);});}else{var _0x556cdd=0x1f4;_0x12d8d5[_0x12ce('0x15')](_0x556cdd)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x263c=['fast-json-patch','request-promise','moment','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','offset','undefined','limit','count','status','Content-Range','json','apply','save','update','then','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','fields','find','create','body','catch','params','destroy','getConfigurations','SugarcrmConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','Subjects','getFields','assigned_user_id','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','password','remoteUri','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','POST','get_module_fields','stringify','Calls','includes','label','endsWith','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir'];(function(_0x13182c,_0x74fb8c){var _0x1177a4=function(_0x3b5168){while(--_0x3b5168){_0x13182c['push'](_0x13182c['shift']());}};_0x1177a4(++_0x74fb8c);}(_0x263c,0x76));var _0xc263=function(_0x135d59,_0x3f9233){_0x135d59=_0x135d59-0x0;var _0xe7e1ab=_0x263c[_0x135d59];return _0xe7e1ab;};'use strict';var emlformat=require(_0xc263('0x0'));var rimraf=require(_0xc263('0x1'));var zipdir=require(_0xc263('0x2'));var jsonpatch=require(_0xc263('0x3'));var rp=require(_0xc263('0x4'));var moment=require(_0xc263('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc263('0x6'));var path=require(_0xc263('0x7'));var sox=require(_0xc263('0x8'));var csv=require(_0xc263('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc263('0xa'));var _=require(_0xc263('0xb'));var squel=require(_0xc263('0xc'));var crypto=require(_0xc263('0xd'));var jsforce=require(_0xc263('0xe'));var deskjs=require(_0xc263('0xf'));var toCsv=require(_0xc263('0x9'));var querystring=require(_0xc263('0x10'));var Papa=require(_0xc263('0x11'));var Redis=require(_0xc263('0x12'));var authService=require(_0xc263('0x13'));var qs=require(_0xc263('0x14'));var as=require(_0xc263('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc263('0x16'))('api');var utils=require(_0xc263('0x17'));var config=require(_0xc263('0x18'));var licenseUtil=require(_0xc263('0x19'));var db=require(_0xc263('0x1a'))['db'];var integrations=require(_0xc263('0x1b'));function respondWithStatusCode(_0x58a988,_0xa07f85){_0xa07f85=_0xa07f85||0xcc;return function(_0xa2a3f3){if(_0xa2a3f3){return _0x58a988['sendStatus'](_0xa07f85);}return _0x58a988['status'](_0xa07f85)[_0xc263('0x1c')]();};}function respondWithResult(_0x1ba875,_0x498261){_0x498261=_0x498261||0xc8;return function(_0x2ed27a){if(_0x2ed27a){return _0x1ba875['status'](_0x498261)['json'](_0x2ed27a);}};}function respondWithFilteredResult(_0x13478e,_0x56cd80){return function(_0xc33721){if(_0xc33721){var _0x5093b5=typeof _0x56cd80[_0xc263('0x1d')]===_0xc263('0x1e')&&typeof _0x56cd80[_0xc263('0x1f')]==='undefined';var _0xdcc253=_0xc33721[_0xc263('0x20')];var _0x1a2062=_0x5093b5?0x0:_0x56cd80[_0xc263('0x1d')];var _0xb33697=_0x5093b5?_0xc33721['count']:_0x56cd80[_0xc263('0x1d')]+_0x56cd80[_0xc263('0x1f')];var _0xefa87;if(_0xb33697>=_0xdcc253){_0xb33697=_0xdcc253;_0xefa87=0xc8;}else{_0xefa87=0xce;}_0x13478e[_0xc263('0x21')](_0xefa87);return _0x13478e['set'](_0xc263('0x22'),_0x1a2062+'-'+_0xb33697+'/'+_0xdcc253)[_0xc263('0x23')](_0xc33721);}return null;};}function patchUpdates(_0xcd65fe){return function(_0x48be61){try{jsonpatch[_0xc263('0x24')](_0x48be61,_0xcd65fe,!![]);}catch(_0xd6e8e0){return BPromise['reject'](_0xd6e8e0);}return _0x48be61[_0xc263('0x25')]();};}function saveUpdates(_0x25ee9c,_0x83da8a){return function(_0x17bb9f){if(_0x17bb9f){return _0x17bb9f[_0xc263('0x26')](_0x25ee9c)[_0xc263('0x27')](function(_0x366c31){return _0x366c31;});}return null;};}function removeEntity(_0x357470,_0x3f9175){return function(_0x4c98a4){if(_0x4c98a4){return _0x4c98a4['destroy']()['then'](function(){_0x357470[_0xc263('0x21')](0xcc)[_0xc263('0x1c')]();});}};}function handleEntityNotFound(_0x3547d5,_0x26b1a1){return function(_0x2a99aa){if(!_0x2a99aa){_0x3547d5['sendStatus'](0x194);}return _0x2a99aa;};}function handleError(_0x23e0d3,_0x25d634){_0x25d634=_0x25d634||0x1f4;return function(_0x1d55ee){logger[_0xc263('0x28')](_0x1d55ee[_0xc263('0x29')]);if(_0x1d55ee['name']){delete _0x1d55ee[_0xc263('0x2a')];}_0x23e0d3[_0xc263('0x21')](_0x25d634)['send'](_0x1d55ee);};}exports[_0xc263('0x2b')]=function(_0x2cd362,_0x1d32ad){var _0x1ada37={},_0x3e27ec={},_0x5e0f30={'count':0x0,'rows':[]};var _0x19bc1c=_[_0xc263('0x2c')](db[_0xc263('0x2d')][_0xc263('0x2e')],function(_0x190708){return{'name':_0x190708[_0xc263('0x2f')],'type':_0x190708[_0xc263('0x30')][_0xc263('0x31')]};});_0x3e27ec[_0xc263('0x32')]=_[_0xc263('0x2c')](_0x19bc1c,_0xc263('0x2a'));_0x3e27ec[_0xc263('0x33')]=_['keys'](_0x2cd362[_0xc263('0x33')]);_0x3e27ec[_0xc263('0x34')]=_[_0xc263('0x35')](_0x3e27ec[_0xc263('0x32')],_0x3e27ec[_0xc263('0x33')]);_0x1ada37['attributes']=_[_0xc263('0x35')](_0x3e27ec[_0xc263('0x32')],qs['fields'](_0x2cd362[_0xc263('0x33')]['fields']));_0x1ada37['attributes']=_0x1ada37[_0xc263('0x36')][_0xc263('0x37')]?_0x1ada37[_0xc263('0x36')]:_0x3e27ec[_0xc263('0x32')];if(!_0x2cd362['query']['hasOwnProperty'](_0xc263('0x38'))){_0x1ada37['limit']=qs[_0xc263('0x1f')](_0x2cd362['query'][_0xc263('0x1f')]);_0x1ada37['offset']=qs['offset'](_0x2cd362[_0xc263('0x33')]['offset']);}_0x1ada37['order']=qs['sort'](_0x2cd362[_0xc263('0x33')][_0xc263('0x39')]);_0x1ada37[_0xc263('0x3a')]=qs[_0xc263('0x34')](_[_0xc263('0x3b')](_0x2cd362[_0xc263('0x33')],_0x3e27ec[_0xc263('0x34')]),_0x19bc1c);if(_0x2cd362[_0xc263('0x33')]['filter']){_0x1ada37[_0xc263('0x3a')]=_[_0xc263('0x3c')](_0x1ada37[_0xc263('0x3a')],{'$or':_[_0xc263('0x2c')](_0x19bc1c,function(_0x584725){if(_0x584725['type']!==_0xc263('0x3d')){var _0x5b8162={};_0x5b8162[_0x584725[_0xc263('0x2a')]]={'$like':'%'+_0x2cd362['query'][_0xc263('0x3e')]+'%'};return _0x5b8162;}})});}_0x1ada37=_[_0xc263('0x3c')]({},_0x1ada37,_0x2cd362[_0xc263('0x3f')]);var _0x22021a={'where':_0x1ada37[_0xc263('0x3a')]};return db['SugarcrmAccount'][_0xc263('0x20')](_0x22021a)['then'](function(_0x384b37){_0x5e0f30['count']=_0x384b37;if(_0x2cd362[_0xc263('0x33')][_0xc263('0x40')]){_0x1ada37[_0xc263('0x41')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xc263('0x42')](_0x1ada37);})['then'](function(_0x42f54e){_0x5e0f30[_0xc263('0x43')]=_0x42f54e;return _0x5e0f30;})[_0xc263('0x27')](respondWithFilteredResult(_0x1d32ad,_0x1ada37))['catch'](handleError(_0x1d32ad,null));};exports[_0xc263('0x44')]=function(_0x577fb3,_0x45e2cd){var _0x42066f={'raw':![],'where':{'id':_0x577fb3['params']['id']}},_0x7c06d8={};_0x7c06d8[_0xc263('0x32')]=_['keys'](db[_0xc263('0x2d')][_0xc263('0x2e')]);_0x7c06d8[_0xc263('0x33')]=_['keys'](_0x577fb3[_0xc263('0x33')]);_0x7c06d8[_0xc263('0x34')]=_[_0xc263('0x35')](_0x7c06d8[_0xc263('0x32')],_0x7c06d8['query']);_0x42066f[_0xc263('0x36')]=_[_0xc263('0x35')](_0x7c06d8['model'],qs[_0xc263('0x45')](_0x577fb3[_0xc263('0x33')][_0xc263('0x45')]));_0x42066f[_0xc263('0x36')]=_0x42066f['attributes']['length']?_0x42066f['attributes']:_0x7c06d8['model'];if(_0x577fb3[_0xc263('0x33')]['includeAll']){_0x42066f[_0xc263('0x41')]=[{'all':!![]}];}_0x42066f=_[_0xc263('0x3c')]({},_0x42066f,_0x577fb3[_0xc263('0x3f')]);return db['SugarcrmAccount'][_0xc263('0x46')](_0x42066f)[_0xc263('0x27')](handleEntityNotFound(_0x45e2cd,null))['then'](respondWithResult(_0x45e2cd,null))['catch'](handleError(_0x45e2cd,null));};exports[_0xc263('0x47')]=function(_0x43acac,_0x24b9ee){return db[_0xc263('0x2d')][_0xc263('0x47')](_0x43acac[_0xc263('0x48')],{})['then'](respondWithResult(_0x24b9ee,0xc9))[_0xc263('0x49')](handleError(_0x24b9ee,null));};exports[_0xc263('0x26')]=function(_0x1330e4,_0x5ed5ee){if(_0x1330e4['body']['id']){delete _0x1330e4[_0xc263('0x48')]['id'];}return db[_0xc263('0x2d')]['find']({'where':{'id':_0x1330e4[_0xc263('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5ed5ee,null))['then'](saveUpdates(_0x1330e4[_0xc263('0x48')],null))[_0xc263('0x27')](respondWithResult(_0x5ed5ee,null))[_0xc263('0x49')](handleError(_0x5ed5ee,null));};exports[_0xc263('0x4b')]=function(_0x2c19ed,_0x5b16f4){return db[_0xc263('0x2d')]['find']({'where':{'id':_0x2c19ed[_0xc263('0x4a')]['id']}})[_0xc263('0x27')](handleEntityNotFound(_0x5b16f4,null))['then'](removeEntity(_0x5b16f4,null))[_0xc263('0x49')](handleError(_0x5b16f4,null));};exports[_0xc263('0x4c')]=function(_0x1e5dab,_0x4a1399,_0x38f350){var _0xe239c2={};var _0x5bb89f={};var _0x3bc922;var _0xc6cb19;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x1e5dab[_0xc263('0x4a')]['id']}})[_0xc263('0x27')](handleEntityNotFound(_0x4a1399,null))['then'](function(_0x162868){if(_0x162868){_0x3bc922=_0x162868;_0x5bb89f['model']=_['keys'](db[_0xc263('0x4d')][_0xc263('0x2e')]);_0x5bb89f[_0xc263('0x33')]=_['keys'](_0x1e5dab['query']);_0x5bb89f[_0xc263('0x34')]=_[_0xc263('0x35')](_0x5bb89f[_0xc263('0x32')],_0x5bb89f[_0xc263('0x33')]);_0xe239c2[_0xc263('0x36')]=_[_0xc263('0x35')](_0x5bb89f[_0xc263('0x32')],qs[_0xc263('0x45')](_0x1e5dab[_0xc263('0x33')][_0xc263('0x45')]));_0xe239c2[_0xc263('0x36')]=_0xe239c2[_0xc263('0x36')][_0xc263('0x37')]?_0xe239c2[_0xc263('0x36')]:_0x5bb89f[_0xc263('0x32')];_0xe239c2['order']=qs[_0xc263('0x39')](_0x1e5dab['query']['sort']);_0xe239c2[_0xc263('0x3a')]=qs[_0xc263('0x34')](_[_0xc263('0x3b')](_0x1e5dab[_0xc263('0x33')],_0x5bb89f[_0xc263('0x34')]));if(_0x1e5dab[_0xc263('0x33')][_0xc263('0x3e')]){_0xe239c2[_0xc263('0x3a')]=_[_0xc263('0x3c')](_0xe239c2[_0xc263('0x3a')],{'$or':_['map'](_0xe239c2[_0xc263('0x36')],function(_0x322266){var _0x1635b8={};_0x1635b8[_0x322266]={'$like':'%'+_0x1e5dab[_0xc263('0x33')][_0xc263('0x3e')]+'%'};return _0x1635b8;})});}_0xe239c2=_[_0xc263('0x3c')]({},_0xe239c2,_0x1e5dab[_0xc263('0x3f')]);return _0x3bc922[_0xc263('0x4c')](_0xe239c2);}})[_0xc263('0x27')](function(_0x5a9218){if(_0x5a9218){_0xc6cb19=_0x5a9218['length'];if(!_0x1e5dab[_0xc263('0x33')][_0xc263('0x4e')](_0xc263('0x38'))){_0xe239c2[_0xc263('0x1f')]=qs[_0xc263('0x1f')](_0x1e5dab[_0xc263('0x33')][_0xc263('0x1f')]);_0xe239c2[_0xc263('0x1d')]=qs[_0xc263('0x1d')](_0x1e5dab[_0xc263('0x33')][_0xc263('0x1d')]);}return _0x3bc922[_0xc263('0x4c')](_0xe239c2);}})[_0xc263('0x27')](function(_0x473a09){if(_0x473a09){return _0x473a09?{'count':_0xc6cb19,'rows':_0x473a09}:null;}})['then'](respondWithResult(_0x4a1399,null))[_0xc263('0x49')](handleError(_0x4a1399,null));};exports[_0xc263('0x4f')]=function(_0x1c0d26,_0x4504e8,_0x3fdcb3){if(_0x1c0d26[_0xc263('0x48')]['id']){delete _0x1c0d26[_0xc263('0x48')]['id'];}return db[_0xc263('0x2d')][_0xc263('0x50')]({'where':{'id':_0x1c0d26[_0xc263('0x4a')]['id']}})[_0xc263('0x27')](handleEntityNotFound(_0x4504e8,null))['then'](function(_0x1cf486){if(_0x1cf486){_0x1c0d26[_0xc263('0x48')][_0xc263('0x51')]=_0x1cf486['id'];_0x1c0d26[_0xc263('0x48')]['Subjects']=integrations[_0xc263('0x52')](_0x1c0d26[_0xc263('0x48')]['channel'],_0x1c0d26[_0xc263('0x48')][_0xc263('0x30')]);_0x1c0d26[_0xc263('0x48')][_0xc263('0x53')]=integrations[_0xc263('0x54')](_0x1c0d26[_0xc263('0x48')][_0xc263('0x55')],_0x1c0d26[_0xc263('0x48')][_0xc263('0x30')]);return db[_0xc263('0x4d')][_0xc263('0x47')](_0x1c0d26[_0xc263('0x48')],{'include':[{'model':db[_0xc263('0x56')],'as':_0xc263('0x57')},{'model':db[_0xc263('0x56')],'as':_0xc263('0x53')}]});}return null;})[_0xc263('0x27')](respondWithResult(_0x4504e8,null))[_0xc263('0x49')](handleError(_0x4504e8,null));};exports[_0xc263('0x58')]=function(_0x5e5908,_0x33ae8c,_0x1cc1b2){var _0x3df372='';var _0x14589a=['id',_0xc263('0x2a'),_0xc263('0x59'),'created_by','description',_0xc263('0x5a'),_0xc263('0x5b'),_0xc263('0x5c'),_0xc263('0x5d'),_0xc263('0x5e'),_0xc263('0x5f'),'direction'];return db[_0xc263('0x2d')]['findOne']({'where':{'id':_0x5e5908[_0xc263('0x4a')]['id']},'attributes':['id','username',_0xc263('0x60'),_0xc263('0x61')]})['then'](handleEntityNotFound(_0x33ae8c,null))[_0xc263('0x27')](function(_0x3ed4ac){if(_0x3ed4ac){_0x3df372=_0x3ed4ac['remoteUri'];var _0x4b0e79=_0x3df372['slice'](-0x1);if(_0x4b0e79==='/'){_0x3df372=_0x3df372['substring'](0x0,_0x3df372[_0xc263('0x62')](_0x4b0e79));}return rp({'method':'POST','uri':util[_0xc263('0x63')](_0xc263('0x64'),_0x3df372,_0xc263('0x65')),'json':!![],'form':{'method':_0xc263('0x66'),'input_type':'JSON','response_type':_0xc263('0x67'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3ed4ac[_0xc263('0x68')],'password':_0x3ed4ac[_0xc263('0x60')],'encryption':_0xc263('0x69')},'application':_0xc263('0x6a')})}});}})['then'](function(_0x222d11){if(_0x222d11&&_0x222d11[_0xc263('0x2a')]!=='Invalid\x20Login'&&_0x222d11[_0xc263('0x2a')]!=='Password\x20Expired'){return rp({'method':_0xc263('0x6b'),'uri':util[_0xc263('0x63')](_0xc263('0x64'),_0x3df372,_0xc263('0x65')),'json':!![],'form':{'method':_0xc263('0x6c'),'input_type':_0xc263('0x67'),'response_type':'JSON','rest_data':JSON[_0xc263('0x6d')]({'session':_0x222d11['id'],'module_name':_0xc263('0x6e')})}})[_0xc263('0x27')](function(_0x421878){if(_0x421878){var _0x5ab3d2=_['values'](_0x421878['module_fields']);_['remove'](_0x5ab3d2,function(_0xce4c82){return _0x14589a[_0xc263('0x6f')](_0xce4c82['name']);});return{'count':_0x5ab3d2['length'],'rows':_[_0xc263('0x2c')](_0x5ab3d2,function(_0x3ae27d){return{'id':_0x3ae27d[_0xc263('0x2a')],'name':_0x3ae27d[_0xc263('0x70')],'custom':_[_0xc263('0x71')](_0x3ae27d[_0xc263('0x2a')],'_c')?!![]:![],'options':_0x3ae27d[_0xc263('0x3f')]?_[_0xc263('0x2c')](_[_0xc263('0x72')](_0x3ae27d['options']),function(_0x448821){return{'name':_0x448821[_0xc263('0x73')],'value':_0x448821['name']};}):[]};})};}})[_0xc263('0x27')](respondWithResult(_0x33ae8c,null))[_0xc263('0x49')](function(_0x2427df){var _0x52319c=_0x5e5908['query'][_0xc263('0x74')]?0x1f4:_0x2427df[_0xc263('0x75')]||0x1f4;logger['error'](_0xc263('0x76'),'getFields',_0x52319c,JSON[_0xc263('0x6d')](_0x2427df));delete _0x2427df[_0xc263('0x2a')];if(_0x52319c===0x191){_0x52319c=0x190;}_0x33ae8c[_0xc263('0x21')](_0x52319c)[_0xc263('0x77')](_0x5e5908[_0xc263('0x33')][_0xc263('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x2427df[_0xc263('0x75')]}:_0x2427df);});}else{var _0x36bd25=0x1f4;_0x33ae8c[_0xc263('0x21')](_0x36bd25)['send']({'message':_0xc263('0x78'),'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 ea7a1bb..2b0b0a3 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 _0x93c6=['moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','define','SugarcrmAccount','int_sugarcrm_accounts','util','api'];(function(_0x1fd1a9,_0xad0a72){var _0x3c18af=function(_0x54b152){while(--_0x54b152){_0x1fd1a9['push'](_0x1fd1a9['shift']());}};_0x3c18af(++_0xad0a72);}(_0x93c6,0x1a0));var _0x693c=function(_0x36b91f,_0x1751a5){_0x36b91f=_0x36b91f-0x0;var _0x452505=_0x93c6[_0x36b91f];return _0x452505;};'use strict';var _=require('lodash');var util=require(_0x693c('0x0'));var logger=require('../../config/logger')(_0x693c('0x1'));var moment=require(_0x693c('0x2'));var BPromise=require(_0x693c('0x3'));var rp=require(_0x693c('0x4'));var fs=require('fs');var path=require(_0x693c('0x5'));var rimraf=require('rimraf');var config=require(_0x693c('0x6'));var attributes=require(_0x693c('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x1eeced,_0x1da5e9){return _0x1eeced[_0x693c('0x8')](_0x693c('0x9'),attributes,{'tableName':_0x693c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2deb=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x5afd0f,_0x2a9aa1){var _0x367fd7=function(_0x5bca4a){while(--_0x5bca4a){_0x5afd0f['push'](_0x5afd0f['shift']());}};_0x367fd7(++_0x2a9aa1);}(_0x2deb,0xdb));var _0xb2de=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2deb[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb2de('0x0'));var util=require(_0xb2de('0x1'));var logger=require(_0xb2de('0x2'))(_0xb2de('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb2de('0x4'));var fs=require('fs');var path=require(_0xb2de('0x5'));var rimraf=require(_0xb2de('0x6'));var config=require(_0xb2de('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xb2de('0x8')]=function(_0x2ed8ec,_0x191004){return _0x2ed8ec['define'](_0xb2de('0x9'),attributes,{'tableName':_0xb2de('0xa'),'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 49c529e..ac51bce 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 _0x6f9d=['message','result','GetSugarcrmAccount','options','raw','where','attributes','include','map','model','then','catch','ShowSugarcrmAccount','SugarcrmAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmAccount,\x20%s,\x20%s'];(function(_0x57d390,_0x37883d){var _0x415227=function(_0xf7f285){while(--_0xf7f285){_0x57d390['push'](_0x57d390['shift']());}};_0x415227(++_0x37883d);}(_0x6f9d,0xd4));var _0xd6f9=function(_0x1ba7fb,_0x3aa77e){_0x1ba7fb=_0x1ba7fb-0x0;var _0x5b12bf=_0x6f9d[_0x1ba7fb];return _0x5b12bf;};'use strict';var _=require('lodash');var util=require(_0xd6f9('0x0'));var moment=require(_0xd6f9('0x1'));var BPromise=require(_0xd6f9('0x2'));var rs=require(_0xd6f9('0x3'));var fs=require('fs');var Redis=require(_0xd6f9('0x4'));var db=require(_0xd6f9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6f9('0x6'))(_0xd6f9('0x7'));var config=require(_0xd6f9('0x8'));var jayson=require(_0xd6f9('0x9'));var client=jayson['client'][_0xd6f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52c86f,_0x4ddc12,_0x3614b4){return new BPromise(function(_0x1e2bc9,_0x47c622){return client[_0xd6f9('0xb')](_0x52c86f,_0x3614b4)['then'](function(_0x17406f){logger[_0xd6f9('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x4ddc12,_0xd6f9('0xd'));logger[_0xd6f9('0xe')](_0xd6f9('0xf'),_0x4ddc12,_0xd6f9('0xd'),JSON[_0xd6f9('0x10')](_0x17406f));if(_0x17406f['error']){if(_0x17406f[_0xd6f9('0x11')]['code']===0x1f4){logger[_0xd6f9('0x11')](_0xd6f9('0x12'),_0x4ddc12,_0x17406f[_0xd6f9('0x11')][_0xd6f9('0x13')]);return _0x47c622(_0x17406f[_0xd6f9('0x11')][_0xd6f9('0x13')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x4ddc12,_0x17406f[_0xd6f9('0x11')]['message']);return _0x1e2bc9(_0x17406f[_0xd6f9('0x11')][_0xd6f9('0x13')]);}else{logger['info'](_0xd6f9('0x12'),_0x4ddc12,_0xd6f9('0xd'));_0x1e2bc9(_0x17406f[_0xd6f9('0x14')][_0xd6f9('0x13')]);}})['catch'](function(_0x3edf14){logger['error'](_0xd6f9('0x12'),_0x4ddc12,_0x3edf14);_0x47c622(_0x3edf14);});});}exports[_0xd6f9('0x15')]=function(_0x1252e0){var _0x525a4d=this;return new Promise(function(_0x16ecf0,_0x4b3790){return db['SugarcrmAccount']['findAll']({'raw':_0x1252e0[_0xd6f9('0x16')]?_0x1252e0['options'][_0xd6f9('0x17')]===undefined?!![]:![]:!![],'where':_0x1252e0[_0xd6f9('0x16')]?_0x1252e0[_0xd6f9('0x16')][_0xd6f9('0x18')]||null:null,'attributes':_0x1252e0[_0xd6f9('0x16')]?_0x1252e0[_0xd6f9('0x16')][_0xd6f9('0x19')]||null:null,'limit':_0x1252e0[_0xd6f9('0x16')]?_0x1252e0[_0xd6f9('0x16')]['limit']||null:null,'include':_0x1252e0[_0xd6f9('0x16')]?_0x1252e0[_0xd6f9('0x16')][_0xd6f9('0x1a')]?_[_0xd6f9('0x1b')](_0x1252e0[_0xd6f9('0x16')][_0xd6f9('0x1a')],function(_0x331a11){return{'model':db[_0x331a11[_0xd6f9('0x1c')]],'as':_0x331a11['as'],'attributes':_0x331a11[_0xd6f9('0x19')],'include':_0x331a11['include']?_['map'](_0x331a11[_0xd6f9('0x1a')],function(_0x356534){return{'model':db[_0x356534['model']],'as':_0x356534['as'],'attributes':_0x356534[_0xd6f9('0x19')],'include':_0x356534[_0xd6f9('0x1a')]?_[_0xd6f9('0x1b')](_0x356534[_0xd6f9('0x1a')],function(_0x250cc3){return{'model':db[_0x250cc3['model']],'as':_0x250cc3['as'],'attributes':_0x250cc3['attributes']};}):[]};}):[]};}):[]:[]})[_0xd6f9('0x1d')](function(_0x1ce1cf){logger[_0xd6f9('0xc')](_0xd6f9('0x15'),_0x1252e0);logger[_0xd6f9('0xe')]('GetSugarcrmAccount',_0x1252e0,JSON[_0xd6f9('0x10')](_0x1ce1cf));_0x16ecf0(_0x1ce1cf);})[_0xd6f9('0x1e')](function(_0x28c7c9){logger['error'](_0xd6f9('0x15'),_0x28c7c9[_0xd6f9('0x13')],_0x1252e0);_0x4b3790(_0x525a4d['error'](0x1f4,_0x28c7c9['message']));});});};exports[_0xd6f9('0x1f')]=function(_0x31f19a){var _0x3df8c8=this;return new Promise(function(_0x411056,_0x3a6b20){return db[_0xd6f9('0x20')]['find']({'raw':_0x31f19a['options']?_0x31f19a[_0xd6f9('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x31f19a[_0xd6f9('0x16')]?_0x31f19a[_0xd6f9('0x16')][_0xd6f9('0x18')]||null:null,'attributes':_0x31f19a[_0xd6f9('0x16')]?_0x31f19a['options'][_0xd6f9('0x19')]||null:null,'include':_0x31f19a['options']?_0x31f19a[_0xd6f9('0x16')][_0xd6f9('0x1a')]?_[_0xd6f9('0x1b')](_0x31f19a['options'][_0xd6f9('0x1a')],function(_0x58e6de){return{'model':db[_0x58e6de[_0xd6f9('0x1c')]],'as':_0x58e6de['as'],'attributes':_0x58e6de[_0xd6f9('0x19')],'include':_0x58e6de[_0xd6f9('0x1a')]?_[_0xd6f9('0x1b')](_0x58e6de['include'],function(_0x43cdaf){return{'model':db[_0x43cdaf[_0xd6f9('0x1c')]],'as':_0x43cdaf['as'],'attributes':_0x43cdaf[_0xd6f9('0x19')],'include':_0x43cdaf[_0xd6f9('0x1a')]?_[_0xd6f9('0x1b')](_0x43cdaf[_0xd6f9('0x1a')],function(_0x466143){return{'model':db[_0x466143[_0xd6f9('0x1c')]],'as':_0x466143['as'],'attributes':_0x466143['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x811e96){logger['info'](_0xd6f9('0x1f'),_0x31f19a);logger['debug'](_0xd6f9('0x1f'),_0x31f19a,JSON[_0xd6f9('0x10')](_0x811e96));_0x411056(_0x811e96);})[_0xd6f9('0x1e')](function(_0x43b4e7){logger['error']('ShowSugarcrmAccount',_0x43b4e7[_0xd6f9('0x13')],_0x31f19a);_0x3a6b20(_0x3df8c8[_0xd6f9('0x11')](0x1f4,_0x43b4e7['message']));});});}; \ No newline at end of file +var _0x557c=['request\x20sent','debug','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit','include','model','map','ShowSugarcrmAccount','find','raw','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','http','then','info','SugarcrmAccount,\x20%s,\x20%s'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x557c,0x1b5));var _0xc557=function(_0xb40f40,_0x41708a){_0xb40f40=_0xb40f40-0x0;var _0x55c108=_0x557c[_0xb40f40];return _0x55c108;};'use strict';var _=require('lodash');var util=require(_0xc557('0x0'));var moment=require(_0xc557('0x1'));var BPromise=require(_0xc557('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc557('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc557('0x4'))('rpc');var config=require(_0xc557('0x5'));var jayson=require(_0xc557('0x6'));var client=jayson['client'][_0xc557('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43117d,_0x439de1,_0x40c906){return new BPromise(function(_0x5b7e64,_0x386604){return client['request'](_0x43117d,_0x40c906)[_0xc557('0x8')](function(_0x458c1d){logger[_0xc557('0x9')](_0xc557('0xa'),_0x439de1,_0xc557('0xb'));logger[_0xc557('0xc')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x439de1,_0xc557('0xb'),JSON[_0xc557('0xd')](_0x458c1d));if(_0x458c1d[_0xc557('0xe')]){if(_0x458c1d[_0xc557('0xe')][_0xc557('0xf')]===0x1f4){logger[_0xc557('0xe')](_0xc557('0xa'),_0x439de1,_0x458c1d[_0xc557('0xe')]['message']);return _0x386604(_0x458c1d[_0xc557('0xe')][_0xc557('0x10')]);}logger[_0xc557('0xe')](_0xc557('0xa'),_0x439de1,_0x458c1d[_0xc557('0xe')][_0xc557('0x10')]);return _0x5b7e64(_0x458c1d[_0xc557('0xe')][_0xc557('0x10')]);}else{logger[_0xc557('0x9')]('SugarcrmAccount,\x20%s,\x20%s',_0x439de1,'request\x20sent');_0x5b7e64(_0x458c1d[_0xc557('0x11')][_0xc557('0x10')]);}})[_0xc557('0x12')](function(_0x198347){logger[_0xc557('0xe')](_0xc557('0xa'),_0x439de1,_0x198347);_0x386604(_0x198347);});});}exports[_0xc557('0x13')]=function(_0x19936a){var _0xafcb9d=this;return new Promise(function(_0x37c4c6,_0x1ca61c){return db[_0xc557('0x14')][_0xc557('0x15')]({'raw':_0x19936a[_0xc557('0x16')]?_0x19936a[_0xc557('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x19936a[_0xc557('0x16')]?_0x19936a[_0xc557('0x16')][_0xc557('0x17')]||null:null,'attributes':_0x19936a[_0xc557('0x16')]?_0x19936a[_0xc557('0x16')][_0xc557('0x18')]||null:null,'limit':_0x19936a['options']?_0x19936a['options'][_0xc557('0x19')]||null:null,'include':_0x19936a['options']?_0x19936a[_0xc557('0x16')][_0xc557('0x1a')]?_['map'](_0x19936a[_0xc557('0x16')]['include'],function(_0x2ef889){return{'model':db[_0x2ef889[_0xc557('0x1b')]],'as':_0x2ef889['as'],'attributes':_0x2ef889[_0xc557('0x18')],'include':_0x2ef889[_0xc557('0x1a')]?_['map'](_0x2ef889[_0xc557('0x1a')],function(_0x5e846c){return{'model':db[_0x5e846c[_0xc557('0x1b')]],'as':_0x5e846c['as'],'attributes':_0x5e846c[_0xc557('0x18')],'include':_0x5e846c[_0xc557('0x1a')]?_[_0xc557('0x1c')](_0x5e846c[_0xc557('0x1a')],function(_0x3f6521){return{'model':db[_0x3f6521[_0xc557('0x1b')]],'as':_0x3f6521['as'],'attributes':_0x3f6521[_0xc557('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc557('0x8')](function(_0x4b52f9){logger[_0xc557('0x9')](_0xc557('0x13'),_0x19936a);logger['debug']('GetSugarcrmAccount',_0x19936a,JSON[_0xc557('0xd')](_0x4b52f9));_0x37c4c6(_0x4b52f9);})[_0xc557('0x12')](function(_0x28ff6e){logger['error']('GetSugarcrmAccount',_0x28ff6e[_0xc557('0x10')],_0x19936a);_0x1ca61c(_0xafcb9d[_0xc557('0xe')](0x1f4,_0x28ff6e[_0xc557('0x10')]));});});};exports[_0xc557('0x1d')]=function(_0x185fe2){var _0x251faf=this;return new Promise(function(_0x1a996c,_0x255328){return db[_0xc557('0x14')][_0xc557('0x1e')]({'raw':_0x185fe2[_0xc557('0x16')]?_0x185fe2[_0xc557('0x16')][_0xc557('0x1f')]===undefined?!![]:![]:!![],'where':_0x185fe2[_0xc557('0x16')]?_0x185fe2[_0xc557('0x16')][_0xc557('0x17')]||null:null,'attributes':_0x185fe2[_0xc557('0x16')]?_0x185fe2[_0xc557('0x16')][_0xc557('0x18')]||null:null,'include':_0x185fe2['options']?_0x185fe2[_0xc557('0x16')][_0xc557('0x1a')]?_['map'](_0x185fe2[_0xc557('0x16')][_0xc557('0x1a')],function(_0x372fd8){return{'model':db[_0x372fd8[_0xc557('0x1b')]],'as':_0x372fd8['as'],'attributes':_0x372fd8[_0xc557('0x18')],'include':_0x372fd8['include']?_[_0xc557('0x1c')](_0x372fd8[_0xc557('0x1a')],function(_0x5d5bc3){return{'model':db[_0x5d5bc3[_0xc557('0x1b')]],'as':_0x5d5bc3['as'],'attributes':_0x5d5bc3[_0xc557('0x18')],'include':_0x5d5bc3[_0xc557('0x1a')]?_[_0xc557('0x1c')](_0x5d5bc3[_0xc557('0x1a')],function(_0x5b110b){return{'model':db[_0x5b110b[_0xc557('0x1b')]],'as':_0x5b110b['as'],'attributes':_0x5b110b[_0xc557('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc557('0x8')](function(_0x200134){logger[_0xc557('0x9')]('ShowSugarcrmAccount',_0x185fe2);logger[_0xc557('0xc')](_0xc557('0x1d'),_0x185fe2,JSON['stringify'](_0x200134));_0x1a996c(_0x200134);})['catch'](function(_0x188043){logger['error'](_0xc557('0x1d'),_0x188043[_0xc557('0x10')],_0x185fe2);_0x255328(_0x251faf['error'](0x1f4,_0x188043[_0xc557('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 1df35c6..141022a 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 _0x81ea=['get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','post','put','update','delete','exports','multer','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','isAuthenticated','index'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x81ea,0x188));var _0xa81e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x81ea[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xa81e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa81e('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xa81e('0x2'));var interaction=require(_0xa81e('0x3'));var config=require('../../config/environment');var controller=require(_0xa81e('0x4'));router['get']('/',auth[_0xa81e('0x5')](),controller[_0xa81e('0x6')]);router[_0xa81e('0x7')](_0xa81e('0x8'),auth[_0xa81e('0x5')](),controller[_0xa81e('0x9')]);router[_0xa81e('0x7')](_0xa81e('0xa'),auth['isAuthenticated'](),controller[_0xa81e('0xb')]);router[_0xa81e('0x7')](_0xa81e('0xc'),auth['isAuthenticated'](),controller[_0xa81e('0xd')]);router[_0xa81e('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xa81e('0xe')]('/',auth[_0xa81e('0x5')](),controller['create']);router[_0xa81e('0xf')](_0xa81e('0x8'),auth[_0xa81e('0x5')](),controller[_0xa81e('0x10')]);router[_0xa81e('0x11')](_0xa81e('0x8'),auth[_0xa81e('0x5')](),controller['destroy']);module[_0xa81e('0x12')]=router; \ No newline at end of file +var _0x5bea=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','/:id/descriptions','create'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x5bea,0x13d));var _0xa5be=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x5bea[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0xa5be('0x0'));var util=require(_0xa5be('0x1'));var path=require(_0xa5be('0x2'));var timeout=require(_0xa5be('0x3'));var express=require('express');var router=express[_0xa5be('0x4')]();var fs_extra=require(_0xa5be('0x5'));var auth=require(_0xa5be('0x6'));var interaction=require(_0xa5be('0x7'));var config=require(_0xa5be('0x8'));var controller=require(_0xa5be('0x9'));router[_0xa5be('0xa')]('/',auth[_0xa5be('0xb')](),controller[_0xa5be('0xc')]);router[_0xa5be('0xa')](_0xa5be('0xd'),auth['isAuthenticated'](),controller[_0xa5be('0xe')]);router[_0xa5be('0xa')]('/:id/fields',auth[_0xa5be('0xb')](),controller[_0xa5be('0xf')]);router['get'](_0xa5be('0x10'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0xa5be('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0xa5be('0xb')](),controller[_0xa5be('0x12')]);router[_0xa5be('0x13')](_0xa5be('0xd'),auth[_0xa5be('0xb')](),controller[_0xa5be('0x14')]);router[_0xa5be('0x15')](_0xa5be('0xd'),auth[_0xa5be('0xb')](),controller[_0xa5be('0x16')]);module[_0xa5be('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 6eb9d32..f48dce1 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 _0x4b58=['STRING','sequelize','exports'];(function(_0x14d2ad,_0x371b71){var _0x5e6b27=function(_0x251e68){while(--_0x251e68){_0x14d2ad['push'](_0x14d2ad['shift']());}};_0x5e6b27(++_0x371b71);}(_0x4b58,0x6a));var _0x84b5=function(_0x2f79f9,_0xc1b001){_0x2f79f9=_0x2f79f9-0x0;var _0x19c0a9=_0x4b58[_0x2f79f9];return _0x19c0a9;};'use strict';var Sequelize=require(_0x84b5('0x0'));module[_0x84b5('0x1')]={'name':{'type':Sequelize[_0x84b5('0x2')]},'description':{'type':Sequelize[_0x84b5('0x2')]}}; \ No newline at end of file +var _0xe16d=['exports','STRING','sequelize'];(function(_0x2d9357,_0x2b2efd){var _0x334c81=function(_0x15f0fd){while(--_0x15f0fd){_0x2d9357['push'](_0x2d9357['shift']());}};_0x334c81(++_0x2b2efd);}(_0xe16d,0xaa));var _0xde16=function(_0x26b5fa,_0x1bea6f){_0x26b5fa=_0x26b5fa-0x0;var _0x4568c9=_0xe16d[_0x26b5fa];return _0x4568c9;};'use strict';var Sequelize=require(_0xde16('0x0'));module[_0xde16('0x1')]={'name':{'type':Sequelize[_0xde16('0x2')]},'description':{'type':Sequelize[_0xde16('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 0c51986..a58b3e3 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 _0x528f=['json','reject','then','destroy','error','stack','name','send','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','map','query','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','show','params','keys','intersection','include','find','catch','create','update','body','getFields','findOne','nolimit','getSubjects','SugarcrmField','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','Content-Range'];(function(_0x5946c2,_0x1e70f1){var _0x13a532=function(_0x1bd3e8){while(--_0x1bd3e8){_0x5946c2['push'](_0x5946c2['shift']());}};_0x13a532(++_0x1e70f1);}(_0x528f,0x80));var _0xf528=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x528f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf528('0x0'));var rimraf=require(_0xf528('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf528('0x2'));var rp=require(_0xf528('0x3'));var moment=require(_0xf528('0x4'));var BPromise=require(_0xf528('0x5'));var Mustache=require(_0xf528('0x6'));var util=require(_0xf528('0x7'));var path=require(_0xf528('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf528('0x9'));var fs=require('fs');var fs_extra=require(_0xf528('0xa'));var _=require(_0xf528('0xb'));var squel=require(_0xf528('0xc'));var crypto=require('crypto');var jsforce=require(_0xf528('0xd'));var deskjs=require(_0xf528('0xe'));var toCsv=require(_0xf528('0xf'));var querystring=require(_0xf528('0x10'));var Papa=require(_0xf528('0x11'));var Redis=require(_0xf528('0x12'));var authService=require(_0xf528('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf528('0x14'));var logger=require(_0xf528('0x15'))(_0xf528('0x16'));var utils=require(_0xf528('0x17'));var config=require(_0xf528('0x18'));var licenseUtil=require(_0xf528('0x19'));var db=require(_0xf528('0x1a'))['db'];function respondWithStatusCode(_0x3c7764,_0x104a0b){_0x104a0b=_0x104a0b||0xcc;return function(_0x168ffc){if(_0x168ffc){return _0x3c7764[_0xf528('0x1b')](_0x104a0b);}return _0x3c7764['status'](_0x104a0b)[_0xf528('0x1c')]();};}function respondWithResult(_0xb97e6d,_0x4bdf95){_0x4bdf95=_0x4bdf95||0xc8;return function(_0x48725e){if(_0x48725e){return _0xb97e6d[_0xf528('0x1d')](_0x4bdf95)['json'](_0x48725e);}};}function respondWithFilteredResult(_0xb1b894,_0x3a16d4){return function(_0x45942d){if(_0x45942d){var _0x1de0f2=typeof _0x3a16d4[_0xf528('0x1e')]===_0xf528('0x1f')&&typeof _0x3a16d4['limit']===_0xf528('0x1f');var _0x1036fb=_0x45942d[_0xf528('0x20')];var _0x4b003c=_0x1de0f2?0x0:_0x3a16d4[_0xf528('0x1e')];var _0x52d096=_0x1de0f2?_0x45942d[_0xf528('0x20')]:_0x3a16d4[_0xf528('0x1e')]+_0x3a16d4['limit'];var _0xe820f5;if(_0x52d096>=_0x1036fb){_0x52d096=_0x1036fb;_0xe820f5=0xc8;}else{_0xe820f5=0xce;}_0xb1b894[_0xf528('0x1d')](_0xe820f5);return _0xb1b894['set'](_0xf528('0x21'),_0x4b003c+'-'+_0x52d096+'/'+_0x1036fb)[_0xf528('0x22')](_0x45942d);}return null;};}function patchUpdates(_0x145244){return function(_0x19eb34){try{jsonpatch['apply'](_0x19eb34,_0x145244,!![]);}catch(_0x29a0b2){return BPromise[_0xf528('0x23')](_0x29a0b2);}return _0x19eb34['save']();};}function saveUpdates(_0x4b5067,_0x202308){return function(_0x7d21c2){if(_0x7d21c2){return _0x7d21c2['update'](_0x4b5067)[_0xf528('0x24')](function(_0x5f230b){return _0x5f230b;});}return null;};}function removeEntity(_0x213562,_0x4aad0f){return function(_0x1eaa11){if(_0x1eaa11){return _0x1eaa11[_0xf528('0x25')]()[_0xf528('0x24')](function(){_0x213562[_0xf528('0x1d')](0xcc)[_0xf528('0x1c')]();});}};}function handleEntityNotFound(_0xd068a1,_0x2a2065){return function(_0x3a4444){if(!_0x3a4444){_0xd068a1['sendStatus'](0x194);}return _0x3a4444;};}function handleError(_0x4d8ede,_0x5268d9){_0x5268d9=_0x5268d9||0x1f4;return function(_0x5c2086){logger[_0xf528('0x26')](_0x5c2086[_0xf528('0x27')]);if(_0x5c2086[_0xf528('0x28')]){delete _0x5c2086[_0xf528('0x28')];}_0x4d8ede[_0xf528('0x1d')](_0x5268d9)[_0xf528('0x29')](_0x5c2086);};}exports['index']=function(_0x1138ba,_0x198461){var _0x3dd639={},_0x4a6f3a={},_0x12d01d={'count':0x0,'rows':[]};var _0x20ec6c=_['map'](db[_0xf528('0x2a')][_0xf528('0x2b')],function(_0x4dd1e5){return{'name':_0x4dd1e5[_0xf528('0x2c')],'type':_0x4dd1e5[_0xf528('0x2d')][_0xf528('0x2e')]};});_0x4a6f3a[_0xf528('0x2f')]=_[_0xf528('0x30')](_0x20ec6c,'name');_0x4a6f3a[_0xf528('0x31')]=_['keys'](_0x1138ba['query']);_0x4a6f3a['filters']=_['intersection'](_0x4a6f3a[_0xf528('0x2f')],_0x4a6f3a[_0xf528('0x31')]);_0x3dd639[_0xf528('0x32')]=_['intersection'](_0x4a6f3a[_0xf528('0x2f')],qs['fields'](_0x1138ba[_0xf528('0x31')][_0xf528('0x33')]));_0x3dd639[_0xf528('0x32')]=_0x3dd639[_0xf528('0x32')][_0xf528('0x34')]?_0x3dd639[_0xf528('0x32')]:_0x4a6f3a['model'];if(!_0x1138ba[_0xf528('0x31')][_0xf528('0x35')]('nolimit')){_0x3dd639['limit']=qs[_0xf528('0x36')](_0x1138ba[_0xf528('0x31')][_0xf528('0x36')]);_0x3dd639['offset']=qs[_0xf528('0x1e')](_0x1138ba['query']['offset']);}_0x3dd639[_0xf528('0x37')]=qs[_0xf528('0x38')](_0x1138ba[_0xf528('0x31')][_0xf528('0x38')]);_0x3dd639[_0xf528('0x39')]=qs[_0xf528('0x3a')](_[_0xf528('0x3b')](_0x1138ba[_0xf528('0x31')],_0x4a6f3a[_0xf528('0x3a')]),_0x20ec6c);if(_0x1138ba[_0xf528('0x31')][_0xf528('0x3c')]){_0x3dd639[_0xf528('0x39')]=_[_0xf528('0x3d')](_0x3dd639[_0xf528('0x39')],{'$or':_[_0xf528('0x30')](_0x20ec6c,function(_0x3e2450){if(_0x3e2450['type']!=='VIRTUAL'){var _0xcd3b60={};_0xcd3b60[_0x3e2450[_0xf528('0x28')]]={'$like':'%'+_0x1138ba['query'][_0xf528('0x3c')]+'%'};return _0xcd3b60;}})});}_0x3dd639=_[_0xf528('0x3d')]({},_0x3dd639,_0x1138ba[_0xf528('0x3e')]);var _0x289b03={'where':_0x3dd639['where']};return db[_0xf528('0x2a')][_0xf528('0x20')](_0x289b03)[_0xf528('0x24')](function(_0x543382){_0x12d01d[_0xf528('0x20')]=_0x543382;if(_0x1138ba[_0xf528('0x31')][_0xf528('0x3f')]){_0x3dd639['include']=[{'all':!![]}];}return db[_0xf528('0x2a')][_0xf528('0x40')](_0x3dd639);})[_0xf528('0x24')](function(_0x2f0690){_0x12d01d['rows']=_0x2f0690;return _0x12d01d;})['then'](respondWithFilteredResult(_0x198461,_0x3dd639))['catch'](handleError(_0x198461,null));};exports[_0xf528('0x41')]=function(_0x53210b,_0x2b854e){var _0x2944a8={'raw':![],'where':{'id':_0x53210b[_0xf528('0x42')]['id']}},_0x1435b4={};_0x1435b4['model']=_[_0xf528('0x43')](db['SugarcrmConfiguration']['rawAttributes']);_0x1435b4[_0xf528('0x31')]=_['keys'](_0x53210b[_0xf528('0x31')]);_0x1435b4[_0xf528('0x3a')]=_[_0xf528('0x44')](_0x1435b4[_0xf528('0x2f')],_0x1435b4[_0xf528('0x31')]);_0x2944a8[_0xf528('0x32')]=_[_0xf528('0x44')](_0x1435b4[_0xf528('0x2f')],qs['fields'](_0x53210b[_0xf528('0x31')][_0xf528('0x33')]));_0x2944a8[_0xf528('0x32')]=_0x2944a8[_0xf528('0x32')][_0xf528('0x34')]?_0x2944a8['attributes']:_0x1435b4['model'];if(_0x53210b[_0xf528('0x31')]['includeAll']){_0x2944a8[_0xf528('0x45')]=[{'all':!![]}];}_0x2944a8=_[_0xf528('0x3d')]({},_0x2944a8,_0x53210b[_0xf528('0x3e')]);return db[_0xf528('0x2a')][_0xf528('0x46')](_0x2944a8)[_0xf528('0x24')](handleEntityNotFound(_0x2b854e,null))[_0xf528('0x24')](respondWithResult(_0x2b854e,null))[_0xf528('0x47')](handleError(_0x2b854e,null));};exports[_0xf528('0x48')]=function(_0x2d0421,_0x21df83){return db[_0xf528('0x2a')][_0xf528('0x48')](_0x2d0421['body'],{})['then'](respondWithResult(_0x21df83,0xc9))[_0xf528('0x47')](handleError(_0x21df83,null));};exports[_0xf528('0x49')]=function(_0x3df830,_0x5ec530){if(_0x3df830[_0xf528('0x4a')]['id']){delete _0x3df830[_0xf528('0x4a')]['id'];}return db['SugarcrmConfiguration'][_0xf528('0x46')]({'where':{'id':_0x3df830[_0xf528('0x42')]['id']}})[_0xf528('0x24')](handleEntityNotFound(_0x5ec530,null))[_0xf528('0x24')](saveUpdates(_0x3df830[_0xf528('0x4a')],null))[_0xf528('0x24')](respondWithResult(_0x5ec530,null))[_0xf528('0x47')](handleError(_0x5ec530,null));};exports[_0xf528('0x25')]=function(_0x14b5b4,_0x255321){return db['SugarcrmConfiguration'][_0xf528('0x46')]({'where':{'id':_0x14b5b4['params']['id']}})[_0xf528('0x24')](handleEntityNotFound(_0x255321,null))[_0xf528('0x24')](removeEntity(_0x255321,null))[_0xf528('0x47')](handleError(_0x255321,null));};exports[_0xf528('0x4b')]=function(_0x3b8d7a,_0x53d441,_0x331fa3){var _0x19ce3c={};var _0x207af6={};var _0x30283d;var _0x3761a2;return db['SugarcrmConfiguration'][_0xf528('0x4c')]({'where':{'id':_0x3b8d7a[_0xf528('0x42')]['id']}})[_0xf528('0x24')](handleEntityNotFound(_0x53d441,null))[_0xf528('0x24')](function(_0x350627){if(_0x350627){_0x30283d=_0x350627;_0x207af6[_0xf528('0x2f')]=_[_0xf528('0x43')](db['SugarcrmField']['rawAttributes']);_0x207af6[_0xf528('0x31')]=_[_0xf528('0x43')](_0x3b8d7a[_0xf528('0x31')]);_0x207af6[_0xf528('0x3a')]=_['intersection'](_0x207af6[_0xf528('0x2f')],_0x207af6[_0xf528('0x31')]);_0x19ce3c[_0xf528('0x32')]=_[_0xf528('0x44')](_0x207af6[_0xf528('0x2f')],qs[_0xf528('0x33')](_0x3b8d7a[_0xf528('0x31')]['fields']));_0x19ce3c[_0xf528('0x32')]=_0x19ce3c[_0xf528('0x32')][_0xf528('0x34')]?_0x19ce3c[_0xf528('0x32')]:_0x207af6[_0xf528('0x2f')];_0x19ce3c['order']=qs[_0xf528('0x38')](_0x3b8d7a[_0xf528('0x31')]['sort']);_0x19ce3c[_0xf528('0x39')]=qs['filters'](_[_0xf528('0x3b')](_0x3b8d7a[_0xf528('0x31')],_0x207af6[_0xf528('0x3a')]));if(_0x3b8d7a[_0xf528('0x31')][_0xf528('0x3c')]){_0x19ce3c['where']=_[_0xf528('0x3d')](_0x19ce3c[_0xf528('0x39')],{'$or':_[_0xf528('0x30')](_0x19ce3c[_0xf528('0x32')],function(_0x169d2a){var _0x451ec2={};_0x451ec2[_0x169d2a]={'$like':'%'+_0x3b8d7a[_0xf528('0x31')][_0xf528('0x3c')]+'%'};return _0x451ec2;})});}_0x19ce3c=_[_0xf528('0x3d')]({},_0x19ce3c,_0x3b8d7a[_0xf528('0x3e')]);return _0x30283d['getFields'](_0x19ce3c);}})['then'](function(_0x7dec6){if(_0x7dec6){_0x3761a2=_0x7dec6[_0xf528('0x34')];if(!_0x3b8d7a[_0xf528('0x31')][_0xf528('0x35')](_0xf528('0x4d'))){_0x19ce3c[_0xf528('0x36')]=qs['limit'](_0x3b8d7a[_0xf528('0x31')][_0xf528('0x36')]);_0x19ce3c[_0xf528('0x1e')]=qs['offset'](_0x3b8d7a[_0xf528('0x31')][_0xf528('0x1e')]);}return _0x30283d[_0xf528('0x4b')](_0x19ce3c);}})[_0xf528('0x24')](function(_0x3b9470){if(_0x3b9470){return _0x3b9470?{'count':_0x3761a2,'rows':_0x3b9470}:null;}})['then'](respondWithResult(_0x53d441,null))[_0xf528('0x47')](handleError(_0x53d441,null));};exports[_0xf528('0x4e')]=function(_0x14e7c6,_0x4a380c,_0x5991ac){var _0x547d1f={};var _0x151c19={};var _0x1dc30f;var _0x39a8be;return db[_0xf528('0x2a')][_0xf528('0x4c')]({'where':{'id':_0x14e7c6[_0xf528('0x42')]['id']}})['then'](handleEntityNotFound(_0x4a380c,null))[_0xf528('0x24')](function(_0x14981f){if(_0x14981f){_0x1dc30f=_0x14981f;_0x151c19['model']=_['keys'](db[_0xf528('0x4f')][_0xf528('0x2b')]);_0x151c19[_0xf528('0x31')]=_['keys'](_0x14e7c6['query']);_0x151c19[_0xf528('0x3a')]=_['intersection'](_0x151c19['model'],_0x151c19['query']);_0x547d1f[_0xf528('0x32')]=_[_0xf528('0x44')](_0x151c19[_0xf528('0x2f')],qs[_0xf528('0x33')](_0x14e7c6[_0xf528('0x31')]['fields']));_0x547d1f[_0xf528('0x32')]=_0x547d1f[_0xf528('0x32')][_0xf528('0x34')]?_0x547d1f[_0xf528('0x32')]:_0x151c19[_0xf528('0x2f')];_0x547d1f[_0xf528('0x37')]=qs[_0xf528('0x38')](_0x14e7c6['query']['sort']);_0x547d1f[_0xf528('0x39')]=qs[_0xf528('0x3a')](_[_0xf528('0x3b')](_0x14e7c6[_0xf528('0x31')],_0x151c19[_0xf528('0x3a')]));if(_0x14e7c6[_0xf528('0x31')][_0xf528('0x3c')]){_0x547d1f['where']=_[_0xf528('0x3d')](_0x547d1f[_0xf528('0x39')],{'$or':_['map'](_0x547d1f[_0xf528('0x32')],function(_0x4cd550){var _0x5bdb1a={};_0x5bdb1a[_0x4cd550]={'$like':'%'+_0x14e7c6['query']['filter']+'%'};return _0x5bdb1a;})});}_0x547d1f=_[_0xf528('0x3d')]({},_0x547d1f,_0x14e7c6[_0xf528('0x3e')]);return _0x1dc30f[_0xf528('0x4e')](_0x547d1f);}})['then'](function(_0x4de924){if(_0x4de924){_0x39a8be=_0x4de924['length'];if(!_0x14e7c6['query'][_0xf528('0x35')](_0xf528('0x4d'))){_0x547d1f[_0xf528('0x36')]=qs[_0xf528('0x36')](_0x14e7c6[_0xf528('0x31')][_0xf528('0x36')]);_0x547d1f[_0xf528('0x1e')]=qs[_0xf528('0x1e')](_0x14e7c6[_0xf528('0x31')][_0xf528('0x1e')]);}return _0x1dc30f[_0xf528('0x4e')](_0x547d1f);}})[_0xf528('0x24')](function(_0x5201cf){if(_0x5201cf){return _0x5201cf?{'count':_0x39a8be,'rows':_0x5201cf}:null;}})['then'](respondWithResult(_0x4a380c,null))[_0xf528('0x47')](handleError(_0x4a380c,null));};exports['getDescriptions']=function(_0x171dab,_0x594577,_0x20bbf1){var _0x425427={};var _0x2ff36a={};var _0x430a9e;var _0x24d3ca;return db[_0xf528('0x2a')][_0xf528('0x4c')]({'where':{'id':_0x171dab['params']['id']}})[_0xf528('0x24')](handleEntityNotFound(_0x594577,null))[_0xf528('0x24')](function(_0x3a3784){if(_0x3a3784){_0x430a9e=_0x3a3784;_0x2ff36a[_0xf528('0x2f')]=_[_0xf528('0x43')](db['SugarcrmField'][_0xf528('0x2b')]);_0x2ff36a[_0xf528('0x31')]=_[_0xf528('0x43')](_0x171dab['query']);_0x2ff36a[_0xf528('0x3a')]=_['intersection'](_0x2ff36a[_0xf528('0x2f')],_0x2ff36a['query']);_0x425427['attributes']=_[_0xf528('0x44')](_0x2ff36a['model'],qs['fields'](_0x171dab['query'][_0xf528('0x33')]));_0x425427[_0xf528('0x32')]=_0x425427[_0xf528('0x32')][_0xf528('0x34')]?_0x425427['attributes']:_0x2ff36a[_0xf528('0x2f')];_0x425427[_0xf528('0x37')]=qs[_0xf528('0x38')](_0x171dab['query'][_0xf528('0x38')]);_0x425427[_0xf528('0x39')]=qs[_0xf528('0x3a')](_[_0xf528('0x3b')](_0x171dab[_0xf528('0x31')],_0x2ff36a[_0xf528('0x3a')]));if(_0x171dab[_0xf528('0x31')][_0xf528('0x3c')]){_0x425427['where']=_[_0xf528('0x3d')](_0x425427[_0xf528('0x39')],{'$or':_[_0xf528('0x30')](_0x425427[_0xf528('0x32')],function(_0x104daf){var _0x4bf8ac={};_0x4bf8ac[_0x104daf]={'$like':'%'+_0x171dab[_0xf528('0x31')][_0xf528('0x3c')]+'%'};return _0x4bf8ac;})});}_0x425427=_['merge']({},_0x425427,_0x171dab[_0xf528('0x3e')]);return _0x430a9e[_0xf528('0x50')](_0x425427);}})[_0xf528('0x24')](function(_0x2ea58c){if(_0x2ea58c){_0x24d3ca=_0x2ea58c['length'];if(!_0x171dab[_0xf528('0x31')][_0xf528('0x35')](_0xf528('0x4d'))){_0x425427['limit']=qs[_0xf528('0x36')](_0x171dab[_0xf528('0x31')][_0xf528('0x36')]);_0x425427[_0xf528('0x1e')]=qs[_0xf528('0x1e')](_0x171dab['query'][_0xf528('0x1e')]);}return _0x430a9e['getDescriptions'](_0x425427);}})[_0xf528('0x24')](function(_0xbc41ba){if(_0xbc41ba){return _0xbc41ba?{'count':_0x24d3ca,'rows':_0xbc41ba}:null;}})[_0xf528('0x24')](respondWithResult(_0x594577,null))[_0xf528('0x47')](handleError(_0x594577,null));}; \ No newline at end of file +var _0x23e3=['keys','find','create','body','update','getFields','findOne','SugarcrmField','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','destroy','end','error','stack','name','send','index','SugarcrmConfiguration','rawAttributes','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','then','findAll','catch','show','params'];(function(_0x6bd3,_0x32eec0){var _0x109049=function(_0x11ded9){while(--_0x11ded9){_0x6bd3['push'](_0x6bd3['shift']());}};_0x109049(++_0x32eec0);}(_0x23e3,0x191));var _0x323e=function(_0x16e25c,_0x47f742){_0x16e25c=_0x16e25c-0x0;var _0x4e9d95=_0x23e3[_0x16e25c];return _0x4e9d95;};'use strict';var emlformat=require(_0x323e('0x0'));var rimraf=require(_0x323e('0x1'));var zipdir=require(_0x323e('0x2'));var jsonpatch=require(_0x323e('0x3'));var rp=require(_0x323e('0x4'));var moment=require(_0x323e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x323e('0x6'));var path=require(_0x323e('0x7'));var sox=require(_0x323e('0x8'));var csv=require('to-csv');var ejs=require(_0x323e('0x9'));var fs=require('fs');var fs_extra=require(_0x323e('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x323e('0xb'));var jsforce=require(_0x323e('0xc'));var deskjs=require(_0x323e('0xd'));var toCsv=require(_0x323e('0xe'));var querystring=require('querystring');var Papa=require(_0x323e('0xf'));var Redis=require(_0x323e('0x10'));var authService=require(_0x323e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x323e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x323e('0x13'))(_0x323e('0x14'));var utils=require(_0x323e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x323e('0x16'));var db=require(_0x323e('0x17'))['db'];function respondWithStatusCode(_0x53b90f,_0x367f07){_0x367f07=_0x367f07||0xcc;return function(_0x44ab8a){if(_0x44ab8a){return _0x53b90f[_0x323e('0x18')](_0x367f07);}return _0x53b90f[_0x323e('0x19')](_0x367f07)['end']();};}function respondWithResult(_0x1ca845,_0x45e98a){_0x45e98a=_0x45e98a||0xc8;return function(_0x2f8142){if(_0x2f8142){return _0x1ca845[_0x323e('0x19')](_0x45e98a)[_0x323e('0x1a')](_0x2f8142);}};}function respondWithFilteredResult(_0x5f4a8d,_0x4ddb3f){return function(_0x1db690){if(_0x1db690){var _0x1e16eb=typeof _0x4ddb3f['offset']===_0x323e('0x1b')&&typeof _0x4ddb3f[_0x323e('0x1c')]===_0x323e('0x1b');var _0xaa9e3c=_0x1db690[_0x323e('0x1d')];var _0x159946=_0x1e16eb?0x0:_0x4ddb3f[_0x323e('0x1e')];var _0x115379=_0x1e16eb?_0x1db690[_0x323e('0x1d')]:_0x4ddb3f[_0x323e('0x1e')]+_0x4ddb3f[_0x323e('0x1c')];var _0x1bb892;if(_0x115379>=_0xaa9e3c){_0x115379=_0xaa9e3c;_0x1bb892=0xc8;}else{_0x1bb892=0xce;}_0x5f4a8d['status'](_0x1bb892);return _0x5f4a8d[_0x323e('0x1f')]('Content-Range',_0x159946+'-'+_0x115379+'/'+_0xaa9e3c)[_0x323e('0x1a')](_0x1db690);}return null;};}function patchUpdates(_0x5552ab){return function(_0x2c252a){try{jsonpatch[_0x323e('0x20')](_0x2c252a,_0x5552ab,!![]);}catch(_0x3e8f9d){return BPromise[_0x323e('0x21')](_0x3e8f9d);}return _0x2c252a[_0x323e('0x22')]();};}function saveUpdates(_0xb08997,_0x86e08a){return function(_0x5bfd7b){if(_0x5bfd7b){return _0x5bfd7b['update'](_0xb08997)['then'](function(_0x3351cd){return _0x3351cd;});}return null;};}function removeEntity(_0x53f156,_0x20f1c2){return function(_0x3b3f5c){if(_0x3b3f5c){return _0x3b3f5c[_0x323e('0x23')]()['then'](function(){_0x53f156[_0x323e('0x19')](0xcc)[_0x323e('0x24')]();});}};}function handleEntityNotFound(_0x3f02ea,_0x543c64){return function(_0x71a997){if(!_0x71a997){_0x3f02ea['sendStatus'](0x194);}return _0x71a997;};}function handleError(_0x3d831f,_0x3d8f22){_0x3d8f22=_0x3d8f22||0x1f4;return function(_0x473d8b){logger[_0x323e('0x25')](_0x473d8b[_0x323e('0x26')]);if(_0x473d8b[_0x323e('0x27')]){delete _0x473d8b['name'];}_0x3d831f[_0x323e('0x19')](_0x3d8f22)[_0x323e('0x28')](_0x473d8b);};}exports[_0x323e('0x29')]=function(_0x5b86f9,_0x3d3d5b){var _0x24f7e1={},_0x312cb2={},_0x3f4b70={'count':0x0,'rows':[]};var _0x1ee57f=_['map'](db[_0x323e('0x2a')][_0x323e('0x2b')],function(_0x83c36b){return{'name':_0x83c36b['fieldName'],'type':_0x83c36b['type'][_0x323e('0x2c')]};});_0x312cb2[_0x323e('0x2d')]=_[_0x323e('0x2e')](_0x1ee57f,_0x323e('0x27'));_0x312cb2[_0x323e('0x2f')]=_['keys'](_0x5b86f9[_0x323e('0x2f')]);_0x312cb2['filters']=_[_0x323e('0x30')](_0x312cb2['model'],_0x312cb2[_0x323e('0x2f')]);_0x24f7e1[_0x323e('0x31')]=_[_0x323e('0x30')](_0x312cb2[_0x323e('0x2d')],qs['fields'](_0x5b86f9[_0x323e('0x2f')][_0x323e('0x32')]));_0x24f7e1['attributes']=_0x24f7e1[_0x323e('0x31')][_0x323e('0x33')]?_0x24f7e1[_0x323e('0x31')]:_0x312cb2[_0x323e('0x2d')];if(!_0x5b86f9[_0x323e('0x2f')][_0x323e('0x34')]('nolimit')){_0x24f7e1[_0x323e('0x1c')]=qs[_0x323e('0x1c')](_0x5b86f9[_0x323e('0x2f')][_0x323e('0x1c')]);_0x24f7e1[_0x323e('0x1e')]=qs[_0x323e('0x1e')](_0x5b86f9[_0x323e('0x2f')][_0x323e('0x1e')]);}_0x24f7e1[_0x323e('0x35')]=qs[_0x323e('0x36')](_0x5b86f9[_0x323e('0x2f')][_0x323e('0x36')]);_0x24f7e1['where']=qs[_0x323e('0x37')](_[_0x323e('0x38')](_0x5b86f9[_0x323e('0x2f')],_0x312cb2[_0x323e('0x37')]),_0x1ee57f);if(_0x5b86f9[_0x323e('0x2f')][_0x323e('0x39')]){_0x24f7e1[_0x323e('0x3a')]=_[_0x323e('0x3b')](_0x24f7e1[_0x323e('0x3a')],{'$or':_[_0x323e('0x2e')](_0x1ee57f,function(_0x29d9b2){if(_0x29d9b2['type']!==_0x323e('0x3c')){var _0x53ab8c={};_0x53ab8c[_0x29d9b2[_0x323e('0x27')]]={'$like':'%'+_0x5b86f9[_0x323e('0x2f')][_0x323e('0x39')]+'%'};return _0x53ab8c;}})});}_0x24f7e1=_['merge']({},_0x24f7e1,_0x5b86f9[_0x323e('0x3d')]);var _0x47b0fd={'where':_0x24f7e1[_0x323e('0x3a')]};return db['SugarcrmConfiguration'][_0x323e('0x1d')](_0x47b0fd)[_0x323e('0x3e')](function(_0x3e544b){_0x3f4b70['count']=_0x3e544b;if(_0x5b86f9[_0x323e('0x2f')]['includeAll']){_0x24f7e1['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x323e('0x3f')](_0x24f7e1);})[_0x323e('0x3e')](function(_0x2e6fde){_0x3f4b70['rows']=_0x2e6fde;return _0x3f4b70;})[_0x323e('0x3e')](respondWithFilteredResult(_0x3d3d5b,_0x24f7e1))[_0x323e('0x40')](handleError(_0x3d3d5b,null));};exports[_0x323e('0x41')]=function(_0x553f9d,_0x33df8a){var _0x145149={'raw':![],'where':{'id':_0x553f9d[_0x323e('0x42')]['id']}},_0x4d8b59={};_0x4d8b59['model']=_[_0x323e('0x43')](db[_0x323e('0x2a')][_0x323e('0x2b')]);_0x4d8b59[_0x323e('0x2f')]=_[_0x323e('0x43')](_0x553f9d['query']);_0x4d8b59[_0x323e('0x37')]=_[_0x323e('0x30')](_0x4d8b59[_0x323e('0x2d')],_0x4d8b59[_0x323e('0x2f')]);_0x145149['attributes']=_['intersection'](_0x4d8b59['model'],qs[_0x323e('0x32')](_0x553f9d[_0x323e('0x2f')][_0x323e('0x32')]));_0x145149[_0x323e('0x31')]=_0x145149[_0x323e('0x31')]['length']?_0x145149[_0x323e('0x31')]:_0x4d8b59[_0x323e('0x2d')];if(_0x553f9d[_0x323e('0x2f')]['includeAll']){_0x145149['include']=[{'all':!![]}];}_0x145149=_['merge']({},_0x145149,_0x553f9d['options']);return db['SugarcrmConfiguration'][_0x323e('0x44')](_0x145149)[_0x323e('0x3e')](handleEntityNotFound(_0x33df8a,null))[_0x323e('0x3e')](respondWithResult(_0x33df8a,null))['catch'](handleError(_0x33df8a,null));};exports[_0x323e('0x45')]=function(_0x4f76f5,_0x5eda0a){return db[_0x323e('0x2a')][_0x323e('0x45')](_0x4f76f5[_0x323e('0x46')],{})[_0x323e('0x3e')](respondWithResult(_0x5eda0a,0xc9))[_0x323e('0x40')](handleError(_0x5eda0a,null));};exports[_0x323e('0x47')]=function(_0x48b3ea,_0x3b9e36){if(_0x48b3ea[_0x323e('0x46')]['id']){delete _0x48b3ea[_0x323e('0x46')]['id'];}return db['SugarcrmConfiguration'][_0x323e('0x44')]({'where':{'id':_0x48b3ea['params']['id']}})[_0x323e('0x3e')](handleEntityNotFound(_0x3b9e36,null))['then'](saveUpdates(_0x48b3ea[_0x323e('0x46')],null))[_0x323e('0x3e')](respondWithResult(_0x3b9e36,null))['catch'](handleError(_0x3b9e36,null));};exports['destroy']=function(_0x2fc2a0,_0x384863){return db[_0x323e('0x2a')][_0x323e('0x44')]({'where':{'id':_0x2fc2a0['params']['id']}})['then'](handleEntityNotFound(_0x384863,null))['then'](removeEntity(_0x384863,null))['catch'](handleError(_0x384863,null));};exports[_0x323e('0x48')]=function(_0x24856a,_0x25b1bb,_0x14a696){var _0x210033={};var _0x5ca763={};var _0x57e81c;var _0x4aa9f2;return db[_0x323e('0x2a')][_0x323e('0x49')]({'where':{'id':_0x24856a[_0x323e('0x42')]['id']}})[_0x323e('0x3e')](handleEntityNotFound(_0x25b1bb,null))['then'](function(_0x1def6a){if(_0x1def6a){_0x57e81c=_0x1def6a;_0x5ca763[_0x323e('0x2d')]=_[_0x323e('0x43')](db[_0x323e('0x4a')][_0x323e('0x2b')]);_0x5ca763[_0x323e('0x2f')]=_[_0x323e('0x43')](_0x24856a['query']);_0x5ca763[_0x323e('0x37')]=_['intersection'](_0x5ca763[_0x323e('0x2d')],_0x5ca763[_0x323e('0x2f')]);_0x210033['attributes']=_[_0x323e('0x30')](_0x5ca763[_0x323e('0x2d')],qs['fields'](_0x24856a[_0x323e('0x2f')]['fields']));_0x210033['attributes']=_0x210033[_0x323e('0x31')][_0x323e('0x33')]?_0x210033[_0x323e('0x31')]:_0x5ca763[_0x323e('0x2d')];_0x210033[_0x323e('0x35')]=qs[_0x323e('0x36')](_0x24856a[_0x323e('0x2f')]['sort']);_0x210033[_0x323e('0x3a')]=qs[_0x323e('0x37')](_[_0x323e('0x38')](_0x24856a['query'],_0x5ca763['filters']));if(_0x24856a[_0x323e('0x2f')]['filter']){_0x210033[_0x323e('0x3a')]=_[_0x323e('0x3b')](_0x210033['where'],{'$or':_['map'](_0x210033[_0x323e('0x31')],function(_0x3d022f){var _0x3777be={};_0x3777be[_0x3d022f]={'$like':'%'+_0x24856a['query']['filter']+'%'};return _0x3777be;})});}_0x210033=_[_0x323e('0x3b')]({},_0x210033,_0x24856a[_0x323e('0x3d')]);return _0x57e81c[_0x323e('0x48')](_0x210033);}})[_0x323e('0x3e')](function(_0x458e5e){if(_0x458e5e){_0x4aa9f2=_0x458e5e[_0x323e('0x33')];if(!_0x24856a[_0x323e('0x2f')][_0x323e('0x34')](_0x323e('0x4b'))){_0x210033[_0x323e('0x1c')]=qs[_0x323e('0x1c')](_0x24856a[_0x323e('0x2f')][_0x323e('0x1c')]);_0x210033[_0x323e('0x1e')]=qs['offset'](_0x24856a[_0x323e('0x2f')][_0x323e('0x1e')]);}return _0x57e81c['getFields'](_0x210033);}})[_0x323e('0x3e')](function(_0x16abae){if(_0x16abae){return _0x16abae?{'count':_0x4aa9f2,'rows':_0x16abae}:null;}})[_0x323e('0x3e')](respondWithResult(_0x25b1bb,null))[_0x323e('0x40')](handleError(_0x25b1bb,null));};exports[_0x323e('0x4c')]=function(_0x38a975,_0x268a48,_0x5812a3){var _0x318ea7={};var _0x287cd2={};var _0xe56cd0;var _0x369933;return db['SugarcrmConfiguration'][_0x323e('0x49')]({'where':{'id':_0x38a975['params']['id']}})[_0x323e('0x3e')](handleEntityNotFound(_0x268a48,null))[_0x323e('0x3e')](function(_0x7fcb55){if(_0x7fcb55){_0xe56cd0=_0x7fcb55;_0x287cd2[_0x323e('0x2d')]=_[_0x323e('0x43')](db[_0x323e('0x4a')][_0x323e('0x2b')]);_0x287cd2[_0x323e('0x2f')]=_['keys'](_0x38a975[_0x323e('0x2f')]);_0x287cd2[_0x323e('0x37')]=_[_0x323e('0x30')](_0x287cd2[_0x323e('0x2d')],_0x287cd2[_0x323e('0x2f')]);_0x318ea7[_0x323e('0x31')]=_[_0x323e('0x30')](_0x287cd2[_0x323e('0x2d')],qs[_0x323e('0x32')](_0x38a975[_0x323e('0x2f')]['fields']));_0x318ea7[_0x323e('0x31')]=_0x318ea7[_0x323e('0x31')][_0x323e('0x33')]?_0x318ea7['attributes']:_0x287cd2[_0x323e('0x2d')];_0x318ea7[_0x323e('0x35')]=qs[_0x323e('0x36')](_0x38a975[_0x323e('0x2f')][_0x323e('0x36')]);_0x318ea7[_0x323e('0x3a')]=qs[_0x323e('0x37')](_[_0x323e('0x38')](_0x38a975[_0x323e('0x2f')],_0x287cd2[_0x323e('0x37')]));if(_0x38a975[_0x323e('0x2f')][_0x323e('0x39')]){_0x318ea7[_0x323e('0x3a')]=_[_0x323e('0x3b')](_0x318ea7[_0x323e('0x3a')],{'$or':_[_0x323e('0x2e')](_0x318ea7[_0x323e('0x31')],function(_0x528d15){var _0x3d26cd={};_0x3d26cd[_0x528d15]={'$like':'%'+_0x38a975[_0x323e('0x2f')][_0x323e('0x39')]+'%'};return _0x3d26cd;})});}_0x318ea7=_[_0x323e('0x3b')]({},_0x318ea7,_0x38a975[_0x323e('0x3d')]);return _0xe56cd0[_0x323e('0x4c')](_0x318ea7);}})[_0x323e('0x3e')](function(_0x563c1a){if(_0x563c1a){_0x369933=_0x563c1a['length'];if(!_0x38a975[_0x323e('0x2f')][_0x323e('0x34')](_0x323e('0x4b'))){_0x318ea7[_0x323e('0x1c')]=qs[_0x323e('0x1c')](_0x38a975[_0x323e('0x2f')][_0x323e('0x1c')]);_0x318ea7['offset']=qs[_0x323e('0x1e')](_0x38a975['query'][_0x323e('0x1e')]);}return _0xe56cd0[_0x323e('0x4c')](_0x318ea7);}})[_0x323e('0x3e')](function(_0x39d07b){if(_0x39d07b){return _0x39d07b?{'count':_0x369933,'rows':_0x39d07b}:null;}})[_0x323e('0x3e')](respondWithResult(_0x268a48,null))[_0x323e('0x40')](handleError(_0x268a48,null));};exports[_0x323e('0x4d')]=function(_0x4a4563,_0x2190a0,_0x540c54){var _0xc5b908={};var _0x4888fb={};var _0x5c768c;var _0x598adf;return db[_0x323e('0x2a')][_0x323e('0x49')]({'where':{'id':_0x4a4563[_0x323e('0x42')]['id']}})[_0x323e('0x3e')](handleEntityNotFound(_0x2190a0,null))[_0x323e('0x3e')](function(_0x4b0779){if(_0x4b0779){_0x5c768c=_0x4b0779;_0x4888fb[_0x323e('0x2d')]=_['keys'](db[_0x323e('0x4a')][_0x323e('0x2b')]);_0x4888fb[_0x323e('0x2f')]=_[_0x323e('0x43')](_0x4a4563[_0x323e('0x2f')]);_0x4888fb[_0x323e('0x37')]=_[_0x323e('0x30')](_0x4888fb[_0x323e('0x2d')],_0x4888fb[_0x323e('0x2f')]);_0xc5b908['attributes']=_['intersection'](_0x4888fb[_0x323e('0x2d')],qs[_0x323e('0x32')](_0x4a4563[_0x323e('0x2f')]['fields']));_0xc5b908[_0x323e('0x31')]=_0xc5b908['attributes'][_0x323e('0x33')]?_0xc5b908[_0x323e('0x31')]:_0x4888fb['model'];_0xc5b908['order']=qs[_0x323e('0x36')](_0x4a4563['query'][_0x323e('0x36')]);_0xc5b908[_0x323e('0x3a')]=qs['filters'](_[_0x323e('0x38')](_0x4a4563[_0x323e('0x2f')],_0x4888fb[_0x323e('0x37')]));if(_0x4a4563[_0x323e('0x2f')][_0x323e('0x39')]){_0xc5b908[_0x323e('0x3a')]=_['merge'](_0xc5b908['where'],{'$or':_[_0x323e('0x2e')](_0xc5b908[_0x323e('0x31')],function(_0x273a5a){var _0x9cb654={};_0x9cb654[_0x273a5a]={'$like':'%'+_0x4a4563[_0x323e('0x2f')]['filter']+'%'};return _0x9cb654;})});}_0xc5b908=_['merge']({},_0xc5b908,_0x4a4563[_0x323e('0x3d')]);return _0x5c768c['getDescriptions'](_0xc5b908);}})[_0x323e('0x3e')](function(_0x456d4a){if(_0x456d4a){_0x598adf=_0x456d4a[_0x323e('0x33')];if(!_0x4a4563[_0x323e('0x2f')][_0x323e('0x34')](_0x323e('0x4b'))){_0xc5b908[_0x323e('0x1c')]=qs['limit'](_0x4a4563[_0x323e('0x2f')]['limit']);_0xc5b908['offset']=qs[_0x323e('0x1e')](_0x4a4563[_0x323e('0x2f')][_0x323e('0x1e')]);}return _0x5c768c['getDescriptions'](_0xc5b908);}})[_0x323e('0x3e')](function(_0x28b77c){if(_0x28b77c){return _0x28b77c?{'count':_0x598adf,'rows':_0x28b77c}:null;}})[_0x323e('0x3e')](respondWithResult(_0x2190a0,null))[_0x323e('0x40')](handleError(_0x2190a0,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 6b92895..ab49d46 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 _0xfc0c=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations','../../config/logger','api','moment','request-promise','path'];(function(_0x2ac451,_0x458d7d){var _0x47dc1c=function(_0x4127d1){while(--_0x4127d1){_0x2ac451['push'](_0x2ac451['shift']());}};_0x47dc1c(++_0x458d7d);}(_0xfc0c,0x69));var _0xcfc0=function(_0x4f64a9,_0x3ec388){_0x4f64a9=_0x4f64a9-0x0;var _0x2b8ea5=_0xfc0c[_0x4f64a9];return _0x2b8ea5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcfc0('0x0'))(_0xcfc0('0x1'));var moment=require(_0xcfc0('0x2'));var BPromise=require('bluebird');var rp=require(_0xcfc0('0x3'));var fs=require('fs');var path=require(_0xcfc0('0x4'));var rimraf=require(_0xcfc0('0x5'));var config=require(_0xcfc0('0x6'));var attributes=require(_0xcfc0('0x7'));module['exports']=function(_0x3fb2ea,_0x70b2ce){return _0x3fb2ea[_0xcfc0('0x8')](_0xcfc0('0x9'),attributes,{'tableName':_0xcfc0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a05=['int_sugarcrm_configurations','util','../../config/logger','api','moment','path','rimraf','exports','define','SugarcrmConfiguration'];(function(_0x4ed698,_0x4810ab){var _0xef8aa5=function(_0x5dcc95){while(--_0x5dcc95){_0x4ed698['push'](_0x4ed698['shift']());}};_0xef8aa5(++_0x4810ab);}(_0x3a05,0xe7));var _0x53a0=function(_0x168adc,_0x4a6efe){_0x168adc=_0x168adc-0x0;var _0x22dfd4=_0x3a05[_0x168adc];return _0x22dfd4;};'use strict';var _=require('lodash');var util=require(_0x53a0('0x0'));var logger=require(_0x53a0('0x1'))(_0x53a0('0x2'));var moment=require(_0x53a0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x53a0('0x4'));var rimraf=require(_0x53a0('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x53a0('0x6')]=function(_0xe7cc63,_0x1eb827){return _0xe7cc63[_0x53a0('0x7')](_0x53a0('0x8'),attributes,{'tableName':_0x53a0('0x9'),'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 8a7f7bd..39d8323 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 _0xff20=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird'];(function(_0x314ffa,_0x4d731a){var _0x6cf802=function(_0x5285dc){while(--_0x5285dc){_0x314ffa['push'](_0x314ffa['shift']());}};_0x6cf802(++_0x4d731a);}(_0xff20,0xc4));var _0x0ff2=function(_0x3e9155,_0x38e9d2){_0x3e9155=_0x3e9155-0x0;var _0x5de67a=_0xff20[_0x3e9155];return _0x5de67a;};'use strict';var _=require('lodash');var util=require(_0x0ff2('0x0'));var moment=require('moment');var BPromise=require(_0x0ff2('0x1'));var rs=require(_0x0ff2('0x2'));var fs=require('fs');var Redis=require(_0x0ff2('0x3'));var db=require(_0x0ff2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ff2('0x5'))(_0x0ff2('0x6'));var config=require(_0x0ff2('0x7'));var jayson=require(_0x0ff2('0x8'));var client=jayson[_0x0ff2('0x9')][_0x0ff2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e2a6f,_0x31eb03,_0x54db0c){return new BPromise(function(_0x2d0cab,_0x1b436e){return client[_0x0ff2('0xb')](_0x5e2a6f,_0x54db0c)['then'](function(_0x5d65b3){logger[_0x0ff2('0xc')](_0x0ff2('0xd'),_0x31eb03,_0x0ff2('0xe'));logger[_0x0ff2('0xf')](_0x0ff2('0x10'),_0x31eb03,_0x0ff2('0xe'),JSON['stringify'](_0x5d65b3));if(_0x5d65b3[_0x0ff2('0x11')]){if(_0x5d65b3['error'][_0x0ff2('0x12')]===0x1f4){logger['error'](_0x0ff2('0xd'),_0x31eb03,_0x5d65b3['error'][_0x0ff2('0x13')]);return _0x1b436e(_0x5d65b3[_0x0ff2('0x11')][_0x0ff2('0x13')]);}logger['error'](_0x0ff2('0xd'),_0x31eb03,_0x5d65b3['error'][_0x0ff2('0x13')]);return _0x2d0cab(_0x5d65b3['error'][_0x0ff2('0x13')]);}else{logger[_0x0ff2('0xc')](_0x0ff2('0xd'),_0x31eb03,_0x0ff2('0xe'));_0x2d0cab(_0x5d65b3[_0x0ff2('0x14')][_0x0ff2('0x13')]);}})[_0x0ff2('0x15')](function(_0x5703e6){logger[_0x0ff2('0x11')](_0x0ff2('0xd'),_0x31eb03,_0x5703e6);_0x1b436e(_0x5703e6);});});} \ No newline at end of file +var _0x4707=['rpc','jayson/promise','client','http','request','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5c7e44,_0x41f509){var _0x21f53a=function(_0x3f4e46){while(--_0x3f4e46){_0x5c7e44['push'](_0x5c7e44['shift']());}};_0x21f53a(++_0x41f509);}(_0x4707,0x1b1));var _0x7470=function(_0x366b6f,_0x4c7e55){_0x366b6f=_0x366b6f-0x0;var _0x3a2e86=_0x4707[_0x366b6f];return _0x3a2e86;};'use strict';var _=require(_0x7470('0x0'));var util=require(_0x7470('0x1'));var moment=require(_0x7470('0x2'));var BPromise=require(_0x7470('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7470('0x4'));var db=require(_0x7470('0x5'))['db'];var utils=require(_0x7470('0x6'));var logger=require('../../config/logger')(_0x7470('0x7'));var config=require('../../config/environment');var jayson=require(_0x7470('0x8'));var client=jayson[_0x7470('0x9')][_0x7470('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cd7ad,_0x203a6c,_0x110645){return new BPromise(function(_0x4c2d20,_0x2294fd){return client[_0x7470('0xb')](_0x4cd7ad,_0x110645)['then'](function(_0x4b34e8){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x203a6c,'request\x20sent');logger[_0x7470('0xc')](_0x7470('0xd'),_0x203a6c,_0x7470('0xe'),JSON[_0x7470('0xf')](_0x4b34e8));if(_0x4b34e8['error']){if(_0x4b34e8[_0x7470('0x10')][_0x7470('0x11')]===0x1f4){logger['error'](_0x7470('0x12'),_0x203a6c,_0x4b34e8[_0x7470('0x10')][_0x7470('0x13')]);return _0x2294fd(_0x4b34e8[_0x7470('0x10')][_0x7470('0x13')]);}logger[_0x7470('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x203a6c,_0x4b34e8[_0x7470('0x10')][_0x7470('0x13')]);return _0x4c2d20(_0x4b34e8[_0x7470('0x10')][_0x7470('0x13')]);}else{logger[_0x7470('0x14')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x203a6c,_0x7470('0xe'));_0x4c2d20(_0x4b34e8[_0x7470('0x15')]['message']);}})['catch'](function(_0x4760a3){logger[_0x7470('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x203a6c,_0x4760a3);_0x2294fd(_0x4760a3);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 7e2cff3..5fe0975 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 _0x557f=['index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get'];(function(_0x542ae7,_0x57332f){var _0x5a96a6=function(_0x3c06ad){while(--_0x3c06ad){_0x542ae7['push'](_0x542ae7['shift']());}};_0x5a96a6(++_0x57332f);}(_0x557f,0x82));var _0xf557=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x557f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xf557('0x0'));var path=require(_0xf557('0x1'));var timeout=require(_0xf557('0x2'));var express=require('express');var router=express[_0xf557('0x3')]();var fs_extra=require(_0xf557('0x4'));var auth=require(_0xf557('0x5'));var interaction=require(_0xf557('0x6'));var config=require(_0xf557('0x7'));var controller=require(_0xf557('0x8'));router[_0xf557('0x9')]('/',auth['isAuthenticated'](),controller[_0xf557('0xa')]);router['get'](_0xf557('0xb'),auth[_0xf557('0xc')](),controller[_0xf557('0xd')]);router[_0xf557('0xe')]('/',auth[_0xf557('0xc')](),controller['create']);router[_0xf557('0xf')]('/:id',auth[_0xf557('0xc')](),controller[_0xf557('0x10')]);router[_0xf557('0x11')](_0xf557('0xb'),auth[_0xf557('0xc')](),controller[_0xf557('0x12')]);module[_0xf557('0x13')]=router; \ No newline at end of file +var _0x92fa=['../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','index','/:id','isAuthenticated','create','update','delete','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x1c4ec1,_0x231a01){var _0x526970=function(_0x57fac5){while(--_0x57fac5){_0x1c4ec1['push'](_0x1c4ec1['shift']());}};_0x526970(++_0x231a01);}(_0x92fa,0x18a));var _0xa92f=function(_0x2de114,_0xc8e415){_0x2de114=_0x2de114-0x0;var _0x467c98=_0x92fa[_0x2de114];return _0x467c98;};'use strict';var multer=require(_0xa92f('0x0'));var util=require(_0xa92f('0x1'));var path=require(_0xa92f('0x2'));var timeout=require('connect-timeout');var express=require(_0xa92f('0x3'));var router=express[_0xa92f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa92f('0x5'));var interaction=require(_0xa92f('0x6'));var config=require(_0xa92f('0x7'));var controller=require(_0xa92f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xa92f('0x9')]);router['get'](_0xa92f('0xa'),auth[_0xa92f('0xb')](),controller['show']);router['post']('/',auth[_0xa92f('0xb')](),controller[_0xa92f('0xc')]);router['put'](_0xa92f('0xa'),auth[_0xa92f('0xb')](),controller[_0xa92f('0xd')]);router[_0xa92f('0xe')](_0xa92f('0xa'),auth[_0xa92f('0xb')](),controller['destroy']);module[_0xa92f('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 172f365..ed9d97a 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 _0x5100=['ENUM','string','variable','keyValue','STRING','BOOLEAN'];(function(_0x23c550,_0x7e41c4){var _0x5635b1=function(_0x68f9ce){while(--_0x68f9ce){_0x23c550['push'](_0x23c550['shift']());}};_0x5635b1(++_0x7e41c4);}(_0x5100,0x1bc));var _0x0510=function(_0x1d02d0,_0x59840f){_0x1d02d0=_0x1d02d0-0x0;var _0x15a16c=_0x5100[_0x1d02d0];return _0x15a16c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x0510('0x0')](_0x0510('0x1'),_0x0510('0x2'),'customVariable',_0x0510('0x3'),'picklist'),'defaultValue':_0x0510('0x1')},'content':{'type':Sequelize[_0x0510('0x4')]},'key':{'type':Sequelize[_0x0510('0x4')]},'keyType':{'type':Sequelize[_0x0510('0x0')](_0x0510('0x1'),_0x0510('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x0510('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0510('0x4')]},'customField':{'type':Sequelize[_0x0510('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0510('0x4')]}}; \ No newline at end of file +var _0x1f29=['sequelize','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x478868,_0x7da992){var _0x305bed=function(_0x51ddc5){while(--_0x51ddc5){_0x478868['push'](_0x478868['shift']());}};_0x305bed(++_0x7da992);}(_0x1f29,0x181));var _0x91f2=function(_0x5531d9,_0x47d8bb){_0x5531d9=_0x5531d9-0x0;var _0xedc931=_0x1f29[_0x5531d9];return _0xedc931;};'use strict';var Sequelize=require(_0x91f2('0x0'));module['exports']={'type':{'type':Sequelize[_0x91f2('0x1')](_0x91f2('0x2'),'variable',_0x91f2('0x3'),_0x91f2('0x4'),'picklist'),'defaultValue':_0x91f2('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x91f2('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x91f2('0x2'),_0x91f2('0x6'),_0x91f2('0x3'))},'keyContent':{'type':Sequelize[_0x91f2('0x5')]},'idField':{'type':Sequelize[_0x91f2('0x5')]},'nameField':{'type':Sequelize[_0x91f2('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x91f2('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 3fdc8f0..d20b0e9 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 _0x6ff5=['util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','fieldName','type','key','map','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmField','rows','catch','show','rawAttributes','include','create','body','find','params','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x6ff5,0xd3));var _0x56ff=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x6ff5[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x56ff('0x0'));var jsonpatch=require(_0x56ff('0x1'));var rp=require(_0x56ff('0x2'));var moment=require(_0x56ff('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x56ff('0x4'));var util=require(_0x56ff('0x5'));var path=require('path');var sox=require(_0x56ff('0x6'));var csv=require('to-csv');var ejs=require(_0x56ff('0x7'));var fs=require('fs');var fs_extra=require(_0x56ff('0x8'));var _=require(_0x56ff('0x9'));var squel=require(_0x56ff('0xa'));var crypto=require(_0x56ff('0xb'));var jsforce=require(_0x56ff('0xc'));var deskjs=require(_0x56ff('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x56ff('0xe'));var Redis=require(_0x56ff('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x56ff('0x10'));var logger=require(_0x56ff('0x11'))('api');var utils=require(_0x56ff('0x12'));var config=require(_0x56ff('0x13'));var licenseUtil=require(_0x56ff('0x14'));var db=require(_0x56ff('0x15'))['db'];function respondWithStatusCode(_0xbf5b4,_0x440142){_0x440142=_0x440142||0xcc;return function(_0x165b91){if(_0x165b91){return _0xbf5b4[_0x56ff('0x16')](_0x440142);}return _0xbf5b4['status'](_0x440142)[_0x56ff('0x17')]();};}function respondWithResult(_0x39a763,_0x43698f){_0x43698f=_0x43698f||0xc8;return function(_0x15ca17){if(_0x15ca17){return _0x39a763[_0x56ff('0x18')](_0x43698f)[_0x56ff('0x19')](_0x15ca17);}};}function respondWithFilteredResult(_0x291c86,_0x2091e0){return function(_0x554f5e){if(_0x554f5e){var _0x2a6c03=typeof _0x2091e0[_0x56ff('0x1a')]===_0x56ff('0x1b')&&typeof _0x2091e0['limit']===_0x56ff('0x1b');var _0x494104=_0x554f5e[_0x56ff('0x1c')];var _0x5015c8=_0x2a6c03?0x0:_0x2091e0[_0x56ff('0x1a')];var _0xce5086=_0x2a6c03?_0x554f5e[_0x56ff('0x1c')]:_0x2091e0[_0x56ff('0x1a')]+_0x2091e0[_0x56ff('0x1d')];var _0x2fa508;if(_0xce5086>=_0x494104){_0xce5086=_0x494104;_0x2fa508=0xc8;}else{_0x2fa508=0xce;}_0x291c86[_0x56ff('0x18')](_0x2fa508);return _0x291c86[_0x56ff('0x1e')](_0x56ff('0x1f'),_0x5015c8+'-'+_0xce5086+'/'+_0x494104)[_0x56ff('0x19')](_0x554f5e);}return null;};}function patchUpdates(_0x5e71e9){return function(_0x1387b2){try{jsonpatch[_0x56ff('0x20')](_0x1387b2,_0x5e71e9,!![]);}catch(_0x34317a){return BPromise[_0x56ff('0x21')](_0x34317a);}return _0x1387b2['save']();};}function saveUpdates(_0x5c4a86,_0x19a061){return function(_0x4c0910){if(_0x4c0910){return _0x4c0910[_0x56ff('0x22')](_0x5c4a86)[_0x56ff('0x23')](function(_0x302d75){return _0x302d75;});}return null;};}function removeEntity(_0x7d21f1,_0x3832f7){return function(_0x4a4a07){if(_0x4a4a07){return _0x4a4a07[_0x56ff('0x24')]()['then'](function(){_0x7d21f1[_0x56ff('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a93f6,_0x320abf){return function(_0x239400){if(!_0x239400){_0x3a93f6[_0x56ff('0x16')](0x194);}return _0x239400;};}function handleError(_0x114422,_0x18fc1f){_0x18fc1f=_0x18fc1f||0x1f4;return function(_0x31e16d){logger['error'](_0x31e16d[_0x56ff('0x25')]);if(_0x31e16d[_0x56ff('0x26')]){delete _0x31e16d['name'];}_0x114422[_0x56ff('0x18')](_0x18fc1f)[_0x56ff('0x27')](_0x31e16d);};}exports[_0x56ff('0x28')]=function(_0x1ec542,_0x2dfd56){var _0x4434a1={},_0x33eb3f={},_0x4903fe={'count':0x0,'rows':[]};var _0x35ad4d=_['map'](db['SugarcrmField']['rawAttributes'],function(_0x27c5cb){return{'name':_0x27c5cb[_0x56ff('0x29')],'type':_0x27c5cb[_0x56ff('0x2a')][_0x56ff('0x2b')]};});_0x33eb3f['model']=_[_0x56ff('0x2c')](_0x35ad4d,_0x56ff('0x26'));_0x33eb3f['query']=_[_0x56ff('0x2d')](_0x1ec542[_0x56ff('0x2e')]);_0x33eb3f[_0x56ff('0x2f')]=_[_0x56ff('0x30')](_0x33eb3f[_0x56ff('0x31')],_0x33eb3f[_0x56ff('0x2e')]);_0x4434a1['attributes']=_[_0x56ff('0x30')](_0x33eb3f[_0x56ff('0x31')],qs[_0x56ff('0x32')](_0x1ec542[_0x56ff('0x2e')][_0x56ff('0x32')]));_0x4434a1[_0x56ff('0x33')]=_0x4434a1[_0x56ff('0x33')][_0x56ff('0x34')]?_0x4434a1[_0x56ff('0x33')]:_0x33eb3f[_0x56ff('0x31')];if(!_0x1ec542[_0x56ff('0x2e')][_0x56ff('0x35')]('nolimit')){_0x4434a1[_0x56ff('0x1d')]=qs['limit'](_0x1ec542['query'][_0x56ff('0x1d')]);_0x4434a1[_0x56ff('0x1a')]=qs[_0x56ff('0x1a')](_0x1ec542[_0x56ff('0x2e')]['offset']);}_0x4434a1[_0x56ff('0x36')]=qs[_0x56ff('0x37')](_0x1ec542['query'][_0x56ff('0x37')]);_0x4434a1[_0x56ff('0x38')]=qs[_0x56ff('0x2f')](_[_0x56ff('0x39')](_0x1ec542['query'],_0x33eb3f[_0x56ff('0x2f')]),_0x35ad4d);if(_0x1ec542['query'][_0x56ff('0x3a')]){_0x4434a1[_0x56ff('0x38')]=_[_0x56ff('0x3b')](_0x4434a1['where'],{'$or':_[_0x56ff('0x2c')](_0x35ad4d,function(_0x4d289e){if(_0x4d289e[_0x56ff('0x2a')]!==_0x56ff('0x3c')){var _0x2c7f6e={};_0x2c7f6e[_0x4d289e[_0x56ff('0x26')]]={'$like':'%'+_0x1ec542[_0x56ff('0x2e')]['filter']+'%'};return _0x2c7f6e;}})});}_0x4434a1=_[_0x56ff('0x3b')]({},_0x4434a1,_0x1ec542[_0x56ff('0x3d')]);var _0x31c6c4={'where':_0x4434a1[_0x56ff('0x38')]};return db['SugarcrmField'][_0x56ff('0x1c')](_0x31c6c4)[_0x56ff('0x23')](function(_0x47a6b3){_0x4903fe['count']=_0x47a6b3;if(_0x1ec542[_0x56ff('0x2e')]['includeAll']){_0x4434a1['include']=[{'all':!![]}];}return db[_0x56ff('0x3e')]['findAll'](_0x4434a1);})['then'](function(_0x4680e6){_0x4903fe[_0x56ff('0x3f')]=_0x4680e6;return _0x4903fe;})[_0x56ff('0x23')](respondWithFilteredResult(_0x2dfd56,_0x4434a1))[_0x56ff('0x40')](handleError(_0x2dfd56,null));};exports[_0x56ff('0x41')]=function(_0x48398,_0x105859){var _0x5c71d8={'raw':!![],'where':{'id':_0x48398['params']['id']}},_0xb52ff6={};_0xb52ff6[_0x56ff('0x31')]=_[_0x56ff('0x2d')](db[_0x56ff('0x3e')][_0x56ff('0x42')]);_0xb52ff6['query']=_[_0x56ff('0x2d')](_0x48398['query']);_0xb52ff6[_0x56ff('0x2f')]=_[_0x56ff('0x30')](_0xb52ff6[_0x56ff('0x31')],_0xb52ff6[_0x56ff('0x2e')]);_0x5c71d8[_0x56ff('0x33')]=_[_0x56ff('0x30')](_0xb52ff6[_0x56ff('0x31')],qs[_0x56ff('0x32')](_0x48398[_0x56ff('0x2e')]['fields']));_0x5c71d8[_0x56ff('0x33')]=_0x5c71d8[_0x56ff('0x33')][_0x56ff('0x34')]?_0x5c71d8['attributes']:_0xb52ff6['model'];if(_0x48398[_0x56ff('0x2e')]['includeAll']){_0x5c71d8[_0x56ff('0x43')]=[{'all':!![]}];}_0x5c71d8=_[_0x56ff('0x3b')]({},_0x5c71d8,_0x48398[_0x56ff('0x3d')]);return db[_0x56ff('0x3e')]['find'](_0x5c71d8)['then'](handleEntityNotFound(_0x105859,null))['then'](respondWithResult(_0x105859,null))[_0x56ff('0x40')](handleError(_0x105859,null));};exports[_0x56ff('0x44')]=function(_0x3a78b4,_0x11c88e){return db[_0x56ff('0x3e')][_0x56ff('0x44')](_0x3a78b4[_0x56ff('0x45')],{})['then'](respondWithResult(_0x11c88e,0xc9))['catch'](handleError(_0x11c88e,null));};exports[_0x56ff('0x22')]=function(_0x85783b,_0x3e3528){if(_0x85783b[_0x56ff('0x45')]['id']){delete _0x85783b['body']['id'];}return db[_0x56ff('0x3e')][_0x56ff('0x46')]({'where':{'id':_0x85783b[_0x56ff('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e3528,null))[_0x56ff('0x23')](saveUpdates(_0x85783b[_0x56ff('0x45')],null))[_0x56ff('0x23')](respondWithResult(_0x3e3528,null))['catch'](handleError(_0x3e3528,null));};exports[_0x56ff('0x24')]=function(_0xa03e0f,_0xfc327c){return db['SugarcrmField'][_0x56ff('0x46')]({'where':{'id':_0xa03e0f[_0x56ff('0x47')]['id']}})[_0x56ff('0x23')](handleEntityNotFound(_0xfc327c,null))[_0x56ff('0x23')](removeEntity(_0xfc327c,null))[_0x56ff('0x40')](handleError(_0xfc327c,null));}; \ No newline at end of file +var _0x7a18=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmField','includeAll','rows','catch','show','params','rawAttributes','include','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','error','name','index','map','fieldName','type','key','model','query'];(function(_0x5caa6f,_0x4508a4){var _0x264f34=function(_0x5e8700){while(--_0x5e8700){_0x5caa6f['push'](_0x5caa6f['shift']());}};_0x264f34(++_0x4508a4);}(_0x7a18,0x1a2));var _0x87a1=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0x7a18[_0x622035];return _0x326cf2;};'use strict';var emlformat=require(_0x87a1('0x0'));var rimraf=require(_0x87a1('0x1'));var zipdir=require(_0x87a1('0x2'));var jsonpatch=require(_0x87a1('0x3'));var rp=require(_0x87a1('0x4'));var moment=require(_0x87a1('0x5'));var BPromise=require(_0x87a1('0x6'));var Mustache=require(_0x87a1('0x7'));var util=require(_0x87a1('0x8'));var path=require(_0x87a1('0x9'));var sox=require(_0x87a1('0xa'));var csv=require(_0x87a1('0xb'));var ejs=require(_0x87a1('0xc'));var fs=require('fs');var fs_extra=require(_0x87a1('0xd'));var _=require(_0x87a1('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x87a1('0xf'));var deskjs=require(_0x87a1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x87a1('0x11'));var Papa=require('papaparse');var Redis=require(_0x87a1('0x12'));var authService=require(_0x87a1('0x13'));var qs=require(_0x87a1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x87a1('0x15'));var logger=require(_0x87a1('0x16'))(_0x87a1('0x17'));var utils=require(_0x87a1('0x18'));var config=require(_0x87a1('0x19'));var licenseUtil=require(_0x87a1('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d5bc8,_0x262229){_0x262229=_0x262229||0xcc;return function(_0x5d7c52){if(_0x5d7c52){return _0x5d5bc8[_0x87a1('0x1b')](_0x262229);}return _0x5d5bc8[_0x87a1('0x1c')](_0x262229)[_0x87a1('0x1d')]();};}function respondWithResult(_0x30ca35,_0x24d213){_0x24d213=_0x24d213||0xc8;return function(_0xdfce39){if(_0xdfce39){return _0x30ca35[_0x87a1('0x1c')](_0x24d213)['json'](_0xdfce39);}};}function respondWithFilteredResult(_0x12ffca,_0x6997a4){return function(_0x337b82){if(_0x337b82){var _0x417bf3=typeof _0x6997a4['offset']===_0x87a1('0x1e')&&typeof _0x6997a4['limit']===_0x87a1('0x1e');var _0x13676e=_0x337b82[_0x87a1('0x1f')];var _0x2b847d=_0x417bf3?0x0:_0x6997a4['offset'];var _0x27c6cd=_0x417bf3?_0x337b82[_0x87a1('0x1f')]:_0x6997a4[_0x87a1('0x20')]+_0x6997a4[_0x87a1('0x21')];var _0x1e5266;if(_0x27c6cd>=_0x13676e){_0x27c6cd=_0x13676e;_0x1e5266=0xc8;}else{_0x1e5266=0xce;}_0x12ffca[_0x87a1('0x1c')](_0x1e5266);return _0x12ffca[_0x87a1('0x22')](_0x87a1('0x23'),_0x2b847d+'-'+_0x27c6cd+'/'+_0x13676e)[_0x87a1('0x24')](_0x337b82);}return null;};}function patchUpdates(_0x173c44){return function(_0x385235){try{jsonpatch[_0x87a1('0x25')](_0x385235,_0x173c44,!![]);}catch(_0x568772){return BPromise[_0x87a1('0x26')](_0x568772);}return _0x385235['save']();};}function saveUpdates(_0x173562,_0x53d4a3){return function(_0x2edfd6){if(_0x2edfd6){return _0x2edfd6['update'](_0x173562)[_0x87a1('0x27')](function(_0x30bf8a){return _0x30bf8a;});}return null;};}function removeEntity(_0x3859ca,_0x208f11){return function(_0x54e84e){if(_0x54e84e){return _0x54e84e[_0x87a1('0x28')]()[_0x87a1('0x27')](function(){_0x3859ca[_0x87a1('0x1c')](0xcc)[_0x87a1('0x1d')]();});}};}function handleEntityNotFound(_0x30b6e9,_0x521a4d){return function(_0xf84a5e){if(!_0xf84a5e){_0x30b6e9['sendStatus'](0x194);}return _0xf84a5e;};}function handleError(_0x34bed1,_0x351d42){_0x351d42=_0x351d42||0x1f4;return function(_0x37d46b){logger[_0x87a1('0x29')](_0x37d46b['stack']);if(_0x37d46b[_0x87a1('0x2a')]){delete _0x37d46b[_0x87a1('0x2a')];}_0x34bed1[_0x87a1('0x1c')](_0x351d42)['send'](_0x37d46b);};}exports[_0x87a1('0x2b')]=function(_0x59c503,_0xa62bb2){var _0x2c2e62={},_0x21e37d={},_0x1d016a={'count':0x0,'rows':[]};var _0x20ec19=_[_0x87a1('0x2c')](db['SugarcrmField']['rawAttributes'],function(_0x48620f){return{'name':_0x48620f[_0x87a1('0x2d')],'type':_0x48620f[_0x87a1('0x2e')][_0x87a1('0x2f')]};});_0x21e37d[_0x87a1('0x30')]=_[_0x87a1('0x2c')](_0x20ec19,_0x87a1('0x2a'));_0x21e37d[_0x87a1('0x31')]=_[_0x87a1('0x32')](_0x59c503[_0x87a1('0x31')]);_0x21e37d[_0x87a1('0x33')]=_['intersection'](_0x21e37d['model'],_0x21e37d['query']);_0x2c2e62['attributes']=_[_0x87a1('0x34')](_0x21e37d[_0x87a1('0x30')],qs[_0x87a1('0x35')](_0x59c503['query'][_0x87a1('0x35')]));_0x2c2e62[_0x87a1('0x36')]=_0x2c2e62[_0x87a1('0x36')][_0x87a1('0x37')]?_0x2c2e62[_0x87a1('0x36')]:_0x21e37d[_0x87a1('0x30')];if(!_0x59c503[_0x87a1('0x31')][_0x87a1('0x38')](_0x87a1('0x39'))){_0x2c2e62[_0x87a1('0x21')]=qs[_0x87a1('0x21')](_0x59c503[_0x87a1('0x31')][_0x87a1('0x21')]);_0x2c2e62[_0x87a1('0x20')]=qs[_0x87a1('0x20')](_0x59c503[_0x87a1('0x31')][_0x87a1('0x20')]);}_0x2c2e62[_0x87a1('0x3a')]=qs['sort'](_0x59c503['query'][_0x87a1('0x3b')]);_0x2c2e62[_0x87a1('0x3c')]=qs[_0x87a1('0x33')](_[_0x87a1('0x3d')](_0x59c503[_0x87a1('0x31')],_0x21e37d[_0x87a1('0x33')]),_0x20ec19);if(_0x59c503['query'][_0x87a1('0x3e')]){_0x2c2e62[_0x87a1('0x3c')]=_[_0x87a1('0x3f')](_0x2c2e62[_0x87a1('0x3c')],{'$or':_[_0x87a1('0x2c')](_0x20ec19,function(_0x4e0f92){if(_0x4e0f92['type']!==_0x87a1('0x40')){var _0x36cbdf={};_0x36cbdf[_0x4e0f92[_0x87a1('0x2a')]]={'$like':'%'+_0x59c503[_0x87a1('0x31')]['filter']+'%'};return _0x36cbdf;}})});}_0x2c2e62=_[_0x87a1('0x3f')]({},_0x2c2e62,_0x59c503[_0x87a1('0x41')]);var _0x3c5365={'where':_0x2c2e62[_0x87a1('0x3c')]};return db[_0x87a1('0x42')][_0x87a1('0x1f')](_0x3c5365)[_0x87a1('0x27')](function(_0x2bcea9){_0x1d016a[_0x87a1('0x1f')]=_0x2bcea9;if(_0x59c503[_0x87a1('0x31')][_0x87a1('0x43')]){_0x2c2e62['include']=[{'all':!![]}];}return db[_0x87a1('0x42')]['findAll'](_0x2c2e62);})[_0x87a1('0x27')](function(_0x1dbf09){_0x1d016a[_0x87a1('0x44')]=_0x1dbf09;return _0x1d016a;})['then'](respondWithFilteredResult(_0xa62bb2,_0x2c2e62))[_0x87a1('0x45')](handleError(_0xa62bb2,null));};exports[_0x87a1('0x46')]=function(_0x21e73b,_0x34de58){var _0x2eb8d9={'raw':!![],'where':{'id':_0x21e73b[_0x87a1('0x47')]['id']}},_0x1321b5={};_0x1321b5['model']=_[_0x87a1('0x32')](db['SugarcrmField'][_0x87a1('0x48')]);_0x1321b5[_0x87a1('0x31')]=_[_0x87a1('0x32')](_0x21e73b[_0x87a1('0x31')]);_0x1321b5['filters']=_[_0x87a1('0x34')](_0x1321b5[_0x87a1('0x30')],_0x1321b5['query']);_0x2eb8d9['attributes']=_['intersection'](_0x1321b5[_0x87a1('0x30')],qs['fields'](_0x21e73b[_0x87a1('0x31')]['fields']));_0x2eb8d9[_0x87a1('0x36')]=_0x2eb8d9[_0x87a1('0x36')][_0x87a1('0x37')]?_0x2eb8d9['attributes']:_0x1321b5['model'];if(_0x21e73b[_0x87a1('0x31')]['includeAll']){_0x2eb8d9[_0x87a1('0x49')]=[{'all':!![]}];}_0x2eb8d9=_[_0x87a1('0x3f')]({},_0x2eb8d9,_0x21e73b[_0x87a1('0x41')]);return db[_0x87a1('0x42')]['find'](_0x2eb8d9)[_0x87a1('0x27')](handleEntityNotFound(_0x34de58,null))['then'](respondWithResult(_0x34de58,null))[_0x87a1('0x45')](handleError(_0x34de58,null));};exports[_0x87a1('0x4a')]=function(_0x36f2e9,_0x84f3ef){return db[_0x87a1('0x42')][_0x87a1('0x4a')](_0x36f2e9[_0x87a1('0x4b')],{})[_0x87a1('0x27')](respondWithResult(_0x84f3ef,0xc9))[_0x87a1('0x45')](handleError(_0x84f3ef,null));};exports[_0x87a1('0x4c')]=function(_0x55bb5f,_0x5c6dbd){if(_0x55bb5f[_0x87a1('0x4b')]['id']){delete _0x55bb5f['body']['id'];}return db[_0x87a1('0x42')][_0x87a1('0x4d')]({'where':{'id':_0x55bb5f['params']['id']}})['then'](handleEntityNotFound(_0x5c6dbd,null))[_0x87a1('0x27')](saveUpdates(_0x55bb5f[_0x87a1('0x4b')],null))[_0x87a1('0x27')](respondWithResult(_0x5c6dbd,null))[_0x87a1('0x45')](handleError(_0x5c6dbd,null));};exports[_0x87a1('0x28')]=function(_0x931dd7,_0x588241){return db[_0x87a1('0x42')][_0x87a1('0x4d')]({'where':{'id':_0x931dd7[_0x87a1('0x47')]['id']}})[_0x87a1('0x27')](handleEntityNotFound(_0x588241,null))[_0x87a1('0x27')](removeEntity(_0x588241,null))[_0x87a1('0x45')](handleError(_0x588241,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index c595f75..c589404 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 _0xaacb=['api','moment','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaacb,0x16a));var _0xbaac=function(_0x54bb5e,_0xc9513a){_0x54bb5e=_0x54bb5e-0x0;var _0x2cfe75=_0xaacb[_0x54bb5e];return _0x2cfe75;};'use strict';var _=require(_0xbaac('0x0'));var util=require('util');var logger=require(_0xbaac('0x1'))(_0xbaac('0x2'));var moment=require(_0xbaac('0x3'));var BPromise=require('bluebird');var rp=require(_0xbaac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbaac('0x5'));var config=require(_0xbaac('0x6'));var attributes=require(_0xbaac('0x7'));module[_0xbaac('0x8')]=function(_0x2c80ea,_0x142a3a){return _0x2c80ea[_0xbaac('0x9')](_0xbaac('0xa'),attributes,{'tableName':_0xbaac('0xb'),'paranoid':![],'indexes':[{'name':_0xbaac('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaba2=['SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','../../config/logger','api','moment','request-promise','path','rimraf','exports','define'];(function(_0x28001b,_0xbbcc0c){var _0x549e94=function(_0x2aaaa3){while(--_0x2aaaa3){_0x28001b['push'](_0x28001b['shift']());}};_0x549e94(++_0xbbcc0c);}(_0xaba2,0x171));var _0x2aba=function(_0x51e928,_0x5b207b){_0x51e928=_0x51e928-0x0;var _0x59615d=_0xaba2[_0x51e928];return _0x59615d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2aba('0x0'))(_0x2aba('0x1'));var moment=require(_0x2aba('0x2'));var BPromise=require('bluebird');var rp=require(_0x2aba('0x3'));var fs=require('fs');var path=require(_0x2aba('0x4'));var rimraf=require(_0x2aba('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module[_0x2aba('0x6')]=function(_0x336cd8,_0x45d372){return _0x336cd8[_0x2aba('0x7')](_0x2aba('0x8'),attributes,{'tableName':_0x2aba('0x9'),'paranoid':![],'indexes':[{'name':_0x2aba('0xa'),'fields':[_0x2aba('0xb'),_0x2aba('0xc')],'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 d19ff7c..854675f 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 _0x4fdb=['error','message','result','catch','lodash','util','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x454949,_0xf6e575){var _0xdacef6=function(_0xf2ad76){while(--_0xf2ad76){_0x454949['push'](_0x454949['shift']());}};_0xdacef6(++_0xf6e575);}(_0x4fdb,0x1a6));var _0xb4fd=function(_0x1ef1a6,_0x1ebc40){_0x1ef1a6=_0x1ef1a6-0x0;var _0x59d1be=_0x4fdb[_0x1ef1a6];return _0x59d1be;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb4fd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb4fd('0x3'));var logger=require(_0xb4fd('0x4'))('rpc');var config=require(_0xb4fd('0x5'));var jayson=require(_0xb4fd('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x113590,_0x28e1c9,_0x1e6854){return new BPromise(function(_0x179121,_0x16d55a){return client[_0xb4fd('0x7')](_0x113590,_0x1e6854)[_0xb4fd('0x8')](function(_0x26acd4){logger[_0xb4fd('0x9')](_0xb4fd('0xa'),_0x28e1c9,_0xb4fd('0xb'));logger[_0xb4fd('0xc')](_0xb4fd('0xd'),_0x28e1c9,_0xb4fd('0xb'),JSON[_0xb4fd('0xe')](_0x26acd4));if(_0x26acd4[_0xb4fd('0xf')]){if(_0x26acd4['error']['code']===0x1f4){logger['error'](_0xb4fd('0xa'),_0x28e1c9,_0x26acd4[_0xb4fd('0xf')][_0xb4fd('0x10')]);return _0x16d55a(_0x26acd4[_0xb4fd('0xf')][_0xb4fd('0x10')]);}logger[_0xb4fd('0xf')](_0xb4fd('0xa'),_0x28e1c9,_0x26acd4[_0xb4fd('0xf')][_0xb4fd('0x10')]);return _0x179121(_0x26acd4[_0xb4fd('0xf')]['message']);}else{logger[_0xb4fd('0x9')](_0xb4fd('0xa'),_0x28e1c9,'request\x20sent');_0x179121(_0x26acd4[_0xb4fd('0x11')]['message']);}})[_0xb4fd('0x12')](function(_0x304ac9){logger['error'](_0xb4fd('0xa'),_0x28e1c9,_0x304ac9);_0x16d55a(_0x304ac9);});});} \ No newline at end of file +var _0x787f=['debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','SugarcrmField,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x417441,_0x1e64d1){var _0x431950=function(_0x1e0261){while(--_0x1e0261){_0x417441['push'](_0x417441['shift']());}};_0x431950(++_0x1e64d1);}(_0x787f,0x1d4));var _0xf787=function(_0x4291d3,_0x760d53){_0x4291d3=_0x4291d3-0x0;var _0x507bd7=_0x787f[_0x4291d3];return _0x507bd7;};'use strict';var _=require(_0xf787('0x0'));var util=require(_0xf787('0x1'));var moment=require(_0xf787('0x2'));var BPromise=require(_0xf787('0x3'));var rs=require(_0xf787('0x4'));var fs=require('fs');var Redis=require(_0xf787('0x5'));var db=require(_0xf787('0x6'))['db'];var utils=require(_0xf787('0x7'));var logger=require(_0xf787('0x8'))(_0xf787('0x9'));var config=require('../../config/environment');var jayson=require(_0xf787('0xa'));var client=jayson[_0xf787('0xb')][_0xf787('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5494fd,_0x289b6c,_0x3677d8){return new BPromise(function(_0x3b0985,_0x345919){return client[_0xf787('0xd')](_0x5494fd,_0x3677d8)[_0xf787('0xe')](function(_0x2470d1){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x289b6c,'request\x20sent');logger[_0xf787('0xf')](_0xf787('0x10'),_0x289b6c,'request\x20sent',JSON['stringify'](_0x2470d1));if(_0x2470d1[_0xf787('0x11')]){if(_0x2470d1['error']['code']===0x1f4){logger['error'](_0xf787('0x12'),_0x289b6c,_0x2470d1[_0xf787('0x11')][_0xf787('0x13')]);return _0x345919(_0x2470d1[_0xf787('0x11')][_0xf787('0x13')]);}logger['error'](_0xf787('0x12'),_0x289b6c,_0x2470d1[_0xf787('0x11')]['message']);return _0x3b0985(_0x2470d1[_0xf787('0x11')]['message']);}else{logger['info'](_0xf787('0x12'),_0x289b6c,_0xf787('0x14'));_0x3b0985(_0x2470d1[_0xf787('0x15')][_0xf787('0x13')]);}})[_0xf787('0x16')](function(_0x585026){logger[_0xf787('0x11')](_0xf787('0x12'),_0x289b6c,_0x585026);_0x345919(_0x585026);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 21ddbc7..43fc55a 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 _0x45ea=['./intVtigerAccount.controller','isAuthenticated','index','show','get','/:id/configurations','getConfigurations','getFields','post','addConfiguration','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xc836fa,_0x34bbcb){var _0x3327a7=function(_0x4b0a5f){while(--_0x4b0a5f){_0xc836fa['push'](_0xc836fa['shift']());}};_0x3327a7(++_0x34bbcb);}(_0x45ea,0x1f0));var _0xa45e=function(_0x459149,_0x11722a){_0x459149=_0x459149-0x0;var _0x59e951=_0x45ea[_0x459149];return _0x59e951;};'use strict';var multer=require(_0xa45e('0x0'));var util=require(_0xa45e('0x1'));var path=require(_0xa45e('0x2'));var timeout=require(_0xa45e('0x3'));var express=require(_0xa45e('0x4'));var router=express[_0xa45e('0x5')]();var fs_extra=require(_0xa45e('0x6'));var auth=require(_0xa45e('0x7'));var interaction=require(_0xa45e('0x8'));var config=require(_0xa45e('0x9'));var controller=require(_0xa45e('0xa'));router['get']('/',auth[_0xa45e('0xb')](),controller[_0xa45e('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa45e('0xd')]);router[_0xa45e('0xe')](_0xa45e('0xf'),auth[_0xa45e('0xb')](),controller[_0xa45e('0x10')]);router['get']('/:id/fields',auth[_0xa45e('0xb')](),controller[_0xa45e('0x11')]);router[_0xa45e('0x12')]('/',auth[_0xa45e('0xb')](),controller['create']);router[_0xa45e('0x12')]('/:id/configurations',auth[_0xa45e('0xb')](),controller[_0xa45e('0x13')]);router['put']('/:id',auth[_0xa45e('0xb')](),controller['update']);router[_0xa45e('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa45e('0x15')]=router; \ No newline at end of file +var _0xeec3=['show','get','/:id/configurations','getConfigurations','post','create','update','delete','destroy','multer','util','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','isAuthenticated','index','/:id'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0xeec3,0x1c3));var _0x3eec=function(_0x59c445,_0x415677){_0x59c445=_0x59c445-0x0;var _0x34076b=_0xeec3[_0x59c445];return _0x34076b;};'use strict';var multer=require(_0x3eec('0x0'));var util=require(_0x3eec('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3eec('0x2'));var interaction=require(_0x3eec('0x3'));var config=require('../../config/environment');var controller=require(_0x3eec('0x4'));router['get']('/',auth[_0x3eec('0x5')](),controller[_0x3eec('0x6')]);router['get'](_0x3eec('0x7'),auth[_0x3eec('0x5')](),controller[_0x3eec('0x8')]);router[_0x3eec('0x9')](_0x3eec('0xa'),auth[_0x3eec('0x5')](),controller[_0x3eec('0xb')]);router[_0x3eec('0x9')]('/:id/fields',auth[_0x3eec('0x5')](),controller['getFields']);router[_0x3eec('0xc')]('/',auth[_0x3eec('0x5')](),controller[_0x3eec('0xd')]);router[_0x3eec('0xc')]('/:id/configurations',auth[_0x3eec('0x5')](),controller['addConfiguration']);router['put']('/:id',auth[_0x3eec('0x5')](),controller[_0x3eec('0xe')]);router[_0x3eec('0xf')](_0x3eec('0x7'),auth['isAuthenticated'](),controller[_0x3eec('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 741a44e..cf4b578 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 _0xceb8=['HelpDesk','exports','STRING'];(function(_0x54454a,_0x5f31c9){var _0x47049d=function(_0x4a280f){while(--_0x4a280f){_0x54454a['push'](_0x54454a['shift']());}};_0x47049d(++_0x5f31c9);}(_0xceb8,0x1b1));var _0x8ceb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xceb8[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module[_0x8ceb('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8ceb('0x1')]},'username':{'type':Sequelize[_0x8ceb('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8ceb('0x2')},'remoteUri':{'type':Sequelize[_0x8ceb('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x8ceb('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x8ceb('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x2c19=['HelpDesk','exports','STRING'];(function(_0x463309,_0x4e98a3){var _0x9d0ef9=function(_0x106616){while(--_0x106616){_0x463309['push'](_0x463309['shift']());}};_0x9d0ef9(++_0x4e98a3);}(_0x2c19,0x15a));var _0x92c1=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x2c19[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require('sequelize');module[_0x92c1('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x92c1('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x92c1('0x1')],'allowNull':![],'defaultValue':_0x92c1('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x92c1('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 103ca33..f0e32f6 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 _0xc72a=['merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','intersection','length','find','catch','create','update','body','findOne','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','getFields','username','moduleName','remoteUri','serverUrl','accessKey','substring','format','%s/webservice.php','GET','getchallenge','success','login','describe','result','sessionName','reference','owner','remove','editable','startsWith','cf_','picklist','picklistValues','log','vTiger\x20error:\x20','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','undefined','limit','count','offset','set','json','apply','reject','save','destroy','then','end','error','name','send','map','VtigerAccount','fieldName','key','model','query','filters','attributes','fields','nolimit','order','sort','where','pick','filter'];(function(_0x34c142,_0x87487e){var _0x79bb0b=function(_0x3809ae){while(--_0x3809ae){_0x34c142['push'](_0x34c142['shift']());}};_0x79bb0b(++_0x87487e);}(_0xc72a,0x12b));var _0xac72=function(_0x75ce5b,_0x3b582f){_0x75ce5b=_0x75ce5b-0x0;var _0x22195e=_0xc72a[_0x75ce5b];return _0x22195e;};'use strict';var emlformat=require(_0xac72('0x0'));var rimraf=require(_0xac72('0x1'));var zipdir=require(_0xac72('0x2'));var jsonpatch=require(_0xac72('0x3'));var rp=require(_0xac72('0x4'));var moment=require('moment');var BPromise=require(_0xac72('0x5'));var Mustache=require(_0xac72('0x6'));var util=require(_0xac72('0x7'));var path=require('path');var sox=require(_0xac72('0x8'));var csv=require(_0xac72('0x9'));var ejs=require(_0xac72('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xac72('0xb'));var crypto=require(_0xac72('0xc'));var jsforce=require(_0xac72('0xd'));var deskjs=require(_0xac72('0xe'));var toCsv=require(_0xac72('0x9'));var querystring=require(_0xac72('0xf'));var Papa=require(_0xac72('0x10'));var Redis=require(_0xac72('0x11'));var authService=require(_0xac72('0x12'));var qs=require(_0xac72('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac72('0x14'));var logger=require(_0xac72('0x15'))(_0xac72('0x16'));var utils=require(_0xac72('0x17'));var config=require(_0xac72('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xac72('0x19'));function respondWithStatusCode(_0x979f9a,_0x263609){_0x263609=_0x263609||0xcc;return function(_0x2ae199){if(_0x2ae199){return _0x979f9a[_0xac72('0x1a')](_0x263609);}return _0x979f9a['status'](_0x263609)['end']();};}function respondWithResult(_0x4ca465,_0x43724c){_0x43724c=_0x43724c||0xc8;return function(_0x440887){if(_0x440887){return _0x4ca465[_0xac72('0x1b')](_0x43724c)['json'](_0x440887);}};}function respondWithFilteredResult(_0x4ffe92,_0x4fa7da){return function(_0x5e6750){if(_0x5e6750){var _0x11c828=typeof _0x4fa7da['offset']===_0xac72('0x1c')&&typeof _0x4fa7da[_0xac72('0x1d')]===_0xac72('0x1c');var _0x2da130=_0x5e6750[_0xac72('0x1e')];var _0x19098c=_0x11c828?0x0:_0x4fa7da[_0xac72('0x1f')];var _0x1a9eaf=_0x11c828?_0x5e6750[_0xac72('0x1e')]:_0x4fa7da[_0xac72('0x1f')]+_0x4fa7da['limit'];var _0x572fb1;if(_0x1a9eaf>=_0x2da130){_0x1a9eaf=_0x2da130;_0x572fb1=0xc8;}else{_0x572fb1=0xce;}_0x4ffe92[_0xac72('0x1b')](_0x572fb1);return _0x4ffe92[_0xac72('0x20')]('Content-Range',_0x19098c+'-'+_0x1a9eaf+'/'+_0x2da130)[_0xac72('0x21')](_0x5e6750);}return null;};}function patchUpdates(_0x833344){return function(_0x13cd9f){try{jsonpatch[_0xac72('0x22')](_0x13cd9f,_0x833344,!![]);}catch(_0x48b353){return BPromise[_0xac72('0x23')](_0x48b353);}return _0x13cd9f[_0xac72('0x24')]();};}function saveUpdates(_0x1f4427,_0x2cf3a9){return function(_0x3cf082){if(_0x3cf082){return _0x3cf082['update'](_0x1f4427)['then'](function(_0x164c0c){return _0x164c0c;});}return null;};}function removeEntity(_0x20d2f9,_0x4b786b){return function(_0x5921cd){if(_0x5921cd){return _0x5921cd[_0xac72('0x25')]()[_0xac72('0x26')](function(){_0x20d2f9[_0xac72('0x1b')](0xcc)[_0xac72('0x27')]();});}};}function handleEntityNotFound(_0x166c1e,_0x2ec080){return function(_0x5130bc){if(!_0x5130bc){_0x166c1e['sendStatus'](0x194);}return _0x5130bc;};}function handleError(_0x29b310,_0x134f09){_0x134f09=_0x134f09||0x1f4;return function(_0x686998){logger[_0xac72('0x28')](_0x686998['stack']);if(_0x686998['name']){delete _0x686998[_0xac72('0x29')];}_0x29b310[_0xac72('0x1b')](_0x134f09)[_0xac72('0x2a')](_0x686998);};}exports['index']=function(_0x134277,_0x38ef1d){var _0x5d897c={},_0x124566={},_0xe149f1={'count':0x0,'rows':[]};var _0x4e0a42=_[_0xac72('0x2b')](db[_0xac72('0x2c')]['rawAttributes'],function(_0x37b581){return{'name':_0x37b581[_0xac72('0x2d')],'type':_0x37b581['type'][_0xac72('0x2e')]};});_0x124566[_0xac72('0x2f')]=_[_0xac72('0x2b')](_0x4e0a42,'name');_0x124566[_0xac72('0x30')]=_['keys'](_0x134277[_0xac72('0x30')]);_0x124566[_0xac72('0x31')]=_['intersection'](_0x124566[_0xac72('0x2f')],_0x124566['query']);_0x5d897c[_0xac72('0x32')]=_['intersection'](_0x124566[_0xac72('0x2f')],qs[_0xac72('0x33')](_0x134277[_0xac72('0x30')][_0xac72('0x33')]));_0x5d897c[_0xac72('0x32')]=_0x5d897c[_0xac72('0x32')]['length']?_0x5d897c[_0xac72('0x32')]:_0x124566['model'];if(!_0x134277['query']['hasOwnProperty'](_0xac72('0x34'))){_0x5d897c[_0xac72('0x1d')]=qs[_0xac72('0x1d')](_0x134277[_0xac72('0x30')]['limit']);_0x5d897c['offset']=qs[_0xac72('0x1f')](_0x134277[_0xac72('0x30')][_0xac72('0x1f')]);}_0x5d897c[_0xac72('0x35')]=qs[_0xac72('0x36')](_0x134277[_0xac72('0x30')]['sort']);_0x5d897c[_0xac72('0x37')]=qs[_0xac72('0x31')](_[_0xac72('0x38')](_0x134277[_0xac72('0x30')],_0x124566[_0xac72('0x31')]),_0x4e0a42);if(_0x134277['query'][_0xac72('0x39')]){_0x5d897c[_0xac72('0x37')]=_[_0xac72('0x3a')](_0x5d897c[_0xac72('0x37')],{'$or':_[_0xac72('0x2b')](_0x4e0a42,function(_0xe7024){if(_0xe7024[_0xac72('0x3b')]!==_0xac72('0x3c')){var _0x1d6063={};_0x1d6063[_0xe7024[_0xac72('0x29')]]={'$like':'%'+_0x134277[_0xac72('0x30')]['filter']+'%'};return _0x1d6063;}})});}_0x5d897c=_[_0xac72('0x3a')]({},_0x5d897c,_0x134277[_0xac72('0x3d')]);var _0x57d61c={'where':_0x5d897c[_0xac72('0x37')]};return db['VtigerAccount'][_0xac72('0x1e')](_0x57d61c)[_0xac72('0x26')](function(_0x5e5857){_0xe149f1[_0xac72('0x1e')]=_0x5e5857;if(_0x134277[_0xac72('0x30')][_0xac72('0x3e')]){_0x5d897c[_0xac72('0x3f')]=[{'all':!![]}];}return db['VtigerAccount'][_0xac72('0x40')](_0x5d897c);})[_0xac72('0x26')](function(_0x38b2a5){_0xe149f1[_0xac72('0x41')]=_0x38b2a5;return _0xe149f1;})['then'](respondWithFilteredResult(_0x38ef1d,_0x5d897c))['catch'](handleError(_0x38ef1d,null));};exports[_0xac72('0x42')]=function(_0x49e1bf,_0x5e7a18){var _0x561cf5={'raw':![],'where':{'id':_0x49e1bf[_0xac72('0x43')]['id']}},_0x4d247b={};_0x4d247b['model']=_[_0xac72('0x44')](db['VtigerAccount'][_0xac72('0x45')]);_0x4d247b[_0xac72('0x30')]=_[_0xac72('0x44')](_0x49e1bf[_0xac72('0x30')]);_0x4d247b[_0xac72('0x31')]=_[_0xac72('0x46')](_0x4d247b[_0xac72('0x2f')],_0x4d247b[_0xac72('0x30')]);_0x561cf5[_0xac72('0x32')]=_[_0xac72('0x46')](_0x4d247b['model'],qs[_0xac72('0x33')](_0x49e1bf[_0xac72('0x30')][_0xac72('0x33')]));_0x561cf5[_0xac72('0x32')]=_0x561cf5[_0xac72('0x32')][_0xac72('0x47')]?_0x561cf5[_0xac72('0x32')]:_0x4d247b['model'];if(_0x49e1bf[_0xac72('0x30')][_0xac72('0x3e')]){_0x561cf5[_0xac72('0x3f')]=[{'all':!![]}];}_0x561cf5=_[_0xac72('0x3a')]({},_0x561cf5,_0x49e1bf['options']);return db[_0xac72('0x2c')][_0xac72('0x48')](_0x561cf5)['then'](handleEntityNotFound(_0x5e7a18,null))[_0xac72('0x26')](respondWithResult(_0x5e7a18,null))[_0xac72('0x49')](handleError(_0x5e7a18,null));};exports[_0xac72('0x4a')]=function(_0x4d5de7,_0x29d4ea){return db[_0xac72('0x2c')][_0xac72('0x4a')](_0x4d5de7['body'],{})[_0xac72('0x26')](respondWithResult(_0x29d4ea,0xc9))[_0xac72('0x49')](handleError(_0x29d4ea,null));};exports[_0xac72('0x4b')]=function(_0x59afa0,_0x18a166){if(_0x59afa0[_0xac72('0x4c')]['id']){delete _0x59afa0[_0xac72('0x4c')]['id'];}return db[_0xac72('0x2c')]['find']({'where':{'id':_0x59afa0[_0xac72('0x43')]['id']}})[_0xac72('0x26')](handleEntityNotFound(_0x18a166,null))['then'](saveUpdates(_0x59afa0[_0xac72('0x4c')],null))['then'](respondWithResult(_0x18a166,null))[_0xac72('0x49')](handleError(_0x18a166,null));};exports[_0xac72('0x25')]=function(_0x224861,_0x54d0be){return db['VtigerAccount'][_0xac72('0x48')]({'where':{'id':_0x224861[_0xac72('0x43')]['id']}})[_0xac72('0x26')](handleEntityNotFound(_0x54d0be,null))['then'](removeEntity(_0x54d0be,null))['catch'](handleError(_0x54d0be,null));};exports['getConfigurations']=function(_0x1145f6,_0x5973b3,_0x1f2d19){var _0x5aea05={};var _0x2d79ce={};var _0x5ef78a;var _0x59e31d;return db[_0xac72('0x2c')][_0xac72('0x4d')]({'where':{'id':_0x1145f6['params']['id']}})[_0xac72('0x26')](handleEntityNotFound(_0x5973b3,null))['then'](function(_0x2cec91){if(_0x2cec91){_0x5ef78a=_0x2cec91;_0x2d79ce[_0xac72('0x2f')]=_[_0xac72('0x44')](db['VtigerConfiguration'][_0xac72('0x45')]);_0x2d79ce['query']=_[_0xac72('0x44')](_0x1145f6[_0xac72('0x30')]);_0x2d79ce['filters']=_[_0xac72('0x46')](_0x2d79ce[_0xac72('0x2f')],_0x2d79ce[_0xac72('0x30')]);_0x5aea05['attributes']=_[_0xac72('0x46')](_0x2d79ce[_0xac72('0x2f')],qs[_0xac72('0x33')](_0x1145f6[_0xac72('0x30')][_0xac72('0x33')]));_0x5aea05[_0xac72('0x32')]=_0x5aea05['attributes']['length']?_0x5aea05[_0xac72('0x32')]:_0x2d79ce[_0xac72('0x2f')];_0x5aea05[_0xac72('0x35')]=qs['sort'](_0x1145f6[_0xac72('0x30')][_0xac72('0x36')]);_0x5aea05[_0xac72('0x37')]=qs[_0xac72('0x31')](_['pick'](_0x1145f6['query'],_0x2d79ce[_0xac72('0x31')]));if(_0x1145f6[_0xac72('0x30')][_0xac72('0x39')]){_0x5aea05[_0xac72('0x37')]=_[_0xac72('0x3a')](_0x5aea05[_0xac72('0x37')],{'$or':_[_0xac72('0x2b')](_0x5aea05[_0xac72('0x32')],function(_0x3ceee2){var _0x2e386b={};_0x2e386b[_0x3ceee2]={'$like':'%'+_0x1145f6[_0xac72('0x30')][_0xac72('0x39')]+'%'};return _0x2e386b;})});}_0x5aea05=_[_0xac72('0x3a')]({},_0x5aea05,_0x1145f6[_0xac72('0x3d')]);return _0x5ef78a[_0xac72('0x4e')](_0x5aea05);}})['then'](function(_0x48233d){if(_0x48233d){_0x59e31d=_0x48233d[_0xac72('0x47')];if(!_0x1145f6[_0xac72('0x30')][_0xac72('0x4f')]('nolimit')){_0x5aea05['limit']=qs['limit'](_0x1145f6[_0xac72('0x30')][_0xac72('0x1d')]);_0x5aea05[_0xac72('0x1f')]=qs[_0xac72('0x1f')](_0x1145f6[_0xac72('0x30')][_0xac72('0x1f')]);}return _0x5ef78a[_0xac72('0x4e')](_0x5aea05);}})['then'](function(_0x1b3206){if(_0x1b3206){return _0x1b3206?{'count':_0x59e31d,'rows':_0x1b3206}:null;}})['then'](respondWithResult(_0x5973b3,null))[_0xac72('0x49')](handleError(_0x5973b3,null));};exports[_0xac72('0x50')]=function(_0x383fa5,_0x45c9a8,_0x1a9996){if(_0x383fa5[_0xac72('0x4c')]['id']){delete _0x383fa5[_0xac72('0x4c')]['id'];}return db['VtigerAccount'][_0xac72('0x4d')]({'where':{'id':_0x383fa5[_0xac72('0x43')]['id']}})[_0xac72('0x26')](handleEntityNotFound(_0x45c9a8,null))['then'](function(_0x2e9f16){if(_0x2e9f16){_0x383fa5[_0xac72('0x4c')][_0xac72('0x51')]=_0x2e9f16['id'];_0x383fa5['body'][_0xac72('0x52')]=integrations[_0xac72('0x53')](_0x383fa5['body'][_0xac72('0x54')],_0x383fa5[_0xac72('0x4c')][_0xac72('0x3b')]);_0x383fa5[_0xac72('0x4c')][_0xac72('0x55')]=integrations[_0xac72('0x56')](_0x383fa5[_0xac72('0x4c')]['channel'],_0x383fa5['body']['type']);return db[_0xac72('0x57')][_0xac72('0x4a')](_0x383fa5[_0xac72('0x4c')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0xac72('0x58')],'as':_0xac72('0x55')}]});}return null;})[_0xac72('0x26')](respondWithResult(_0x45c9a8,null))[_0xac72('0x49')](handleError(_0x45c9a8,null));};var md5=require('md5');exports[_0xac72('0x59')]=function(_0x112aac,_0x1ae65f,_0x7e78ad){var _0x5c1347=null;var _0x394440=null;var _0x1f99b7=null;var _0x163449=null;var _0x3c1d47='';return db[_0xac72('0x2c')]['findOne']({'where':{'id':_0x112aac['params']['id']},'attributes':['id','name',_0xac72('0x5a'),'description',_0xac72('0x5b'),_0xac72('0x5c'),_0xac72('0x5d'),'accessKey']})[_0xac72('0x26')](handleEntityNotFound(_0x1ae65f,null))['then'](function(_0x220b6f){if(_0x220b6f){_0x5c1347=_0x220b6f['username'];_0x394440=_0x220b6f[_0xac72('0x5e')];_0x1f99b7=_0x220b6f[_0xac72('0x5b')];_0x3c1d47=_0x220b6f[_0xac72('0x5c')];var _0x4b52d1=_0x3c1d47['slice'](-0x1);if(_0x4b52d1==='/'){_0x3c1d47=_0x3c1d47[_0xac72('0x5f')](0x0,_0x3c1d47['lastIndexOf'](_0x4b52d1));}_0x163449=util[_0xac72('0x60')](_0xac72('0x61'),_0x3c1d47);var _0x5273cb={'method':_0xac72('0x62'),'uri':_0x163449,'qs':{'operation':_0xac72('0x63'),'username':_0x220b6f[_0xac72('0x5a')]},'json':!![]};return rp(_0x5273cb);}})['then'](function(_0x315cc6){if(_0x315cc6[_0xac72('0x64')]){var _0xb0371f={'method':'POST','uri':_0x163449,'form':{'operation':_0xac72('0x65'),'username':_0x5c1347,'accessKey':md5(_0x315cc6['result']['token']+_0x394440)},'json':!![]};return rp(_0xb0371f);}})[_0xac72('0x26')](function(_0x5c22cc){if(_0x5c22cc['success']){var _0x4375f8={'method':_0xac72('0x62'),'uri':_0x163449,'qs':{'operation':_0xac72('0x66'),'username':_0x5c1347,'sessionName':_0x5c22cc[_0xac72('0x67')][_0xac72('0x68')],'elementType':_0x1f99b7},'json':!![]};return rp(_0x4375f8);}})[_0xac72('0x26')](function(_0x3cd78e){if(_0x3cd78e[_0xac72('0x64')]){var _0x4a102a=['autogenerated',_0xac72('0x69'),_0xac72('0x6a')];_['remove'](_0x3cd78e[_0xac72('0x67')][_0xac72('0x33')],function(_0x48a705){return _0x4a102a['includes'](_0x48a705[_0xac72('0x3b')][_0xac72('0x29')]);});_[_0xac72('0x6b')](_0x3cd78e[_0xac72('0x67')][_0xac72('0x33')],function(_0x546e88){return _0x546e88[_0xac72('0x6c')]==='false';});return{'count':_0x3cd78e['result']['fields'][_0xac72('0x47')],'rows':_[_0xac72('0x2b')](_0x3cd78e['result']['fields'],function(_0x4344bc){return{'id':_0x4344bc['name'],'name':_0x4344bc['label'],'custom':_[_0xac72('0x6d')](_0x4344bc[_0xac72('0x29')],_0xac72('0x6e'))?!![]:![],'options':_0x4344bc[_0xac72('0x3b')][_0xac72('0x29')]===_0xac72('0x6f')&&_0x4344bc['type']['picklistValues'][_0xac72('0x47')]>0x0?_[_0xac72('0x2b')](_0x4344bc[_0xac72('0x3b')][_0xac72('0x70')],function(_0x4d5056){return{'name':_0x4d5056['label'],'value':_0x4d5056['value']};}):[]};})};}})[_0xac72('0x26')](respondWithResult(_0x1ae65f,null))['catch'](function(_0x5c7698){console[_0xac72('0x71')](_0xac72('0x72')+_0x5c7698);var _0x3141f2=_0x112aac['query']['test']?0x1f4:_0x5c7698['statusCode']||0x1f4;logger[_0xac72('0x28')](_0xac72('0x73'),_0xac72('0x59'),_0x3141f2,JSON['stringify'](_0x5c7698));delete _0x5c7698[_0xac72('0x29')];if(_0x3141f2===0x191){_0x3141f2=0x190;}_0x1ae65f[_0xac72('0x1b')](_0x3141f2)[_0xac72('0x2a')](_0x112aac[_0xac72('0x30')][_0xac72('0x74')]?{'message':_0xac72('0x75'),'statusCode':_0x5c7698[_0xac72('0x76')]}:_0x5c7698);});}; \ No newline at end of file +var _0xcb0e=['destroy','VtigerConfiguration','pick','getConfigurations','hasOwnProperty','findOne','Subjects','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','substring','lastIndexOf','format','GET','getchallenge','success','login','result','token','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','label','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','end','name','send','index','map','VtigerAccount','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','nolimit','order','sort','filter','merge','where','VIRTUAL','includeAll','findAll','rows','catch','show','params','length','include','options','find','create','body'];(function(_0x2c068d,_0x48a631){var _0x156553=function(_0x32dfa0){while(--_0x32dfa0){_0x2c068d['push'](_0x2c068d['shift']());}};_0x156553(++_0x48a631);}(_0xcb0e,0x18e));var _0xecb0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcb0e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xecb0('0x0'));var rimraf=require(_0xecb0('0x1'));var zipdir=require(_0xecb0('0x2'));var jsonpatch=require(_0xecb0('0x3'));var rp=require(_0xecb0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xecb0('0x5'));var util=require(_0xecb0('0x6'));var path=require('path');var sox=require(_0xecb0('0x7'));var csv=require(_0xecb0('0x8'));var ejs=require(_0xecb0('0x9'));var fs=require('fs');var fs_extra=require(_0xecb0('0xa'));var _=require(_0xecb0('0xb'));var squel=require(_0xecb0('0xc'));var crypto=require(_0xecb0('0xd'));var jsforce=require(_0xecb0('0xe'));var deskjs=require(_0xecb0('0xf'));var toCsv=require(_0xecb0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xecb0('0x10'));var authService=require(_0xecb0('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xecb0('0x12'))(_0xecb0('0x13'));var utils=require(_0xecb0('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xecb0('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xecb0('0x16'));function respondWithStatusCode(_0xadccd3,_0x2e2c65){_0x2e2c65=_0x2e2c65||0xcc;return function(_0x16e7d2){if(_0x16e7d2){return _0xadccd3['sendStatus'](_0x2e2c65);}return _0xadccd3[_0xecb0('0x17')](_0x2e2c65)['end']();};}function respondWithResult(_0xac554a,_0x418769){_0x418769=_0x418769||0xc8;return function(_0x301c6e){if(_0x301c6e){return _0xac554a[_0xecb0('0x17')](_0x418769)[_0xecb0('0x18')](_0x301c6e);}};}function respondWithFilteredResult(_0x5d040e,_0x239788){return function(_0x46280f){if(_0x46280f){var _0x3f3a15=typeof _0x239788[_0xecb0('0x19')]===_0xecb0('0x1a')&&typeof _0x239788['limit']===_0xecb0('0x1a');var _0x376f02=_0x46280f[_0xecb0('0x1b')];var _0x3d69fb=_0x3f3a15?0x0:_0x239788[_0xecb0('0x19')];var _0x426211=_0x3f3a15?_0x46280f[_0xecb0('0x1b')]:_0x239788['offset']+_0x239788[_0xecb0('0x1c')];var _0x17e567;if(_0x426211>=_0x376f02){_0x426211=_0x376f02;_0x17e567=0xc8;}else{_0x17e567=0xce;}_0x5d040e[_0xecb0('0x17')](_0x17e567);return _0x5d040e[_0xecb0('0x1d')](_0xecb0('0x1e'),_0x3d69fb+'-'+_0x426211+'/'+_0x376f02)[_0xecb0('0x18')](_0x46280f);}return null;};}function patchUpdates(_0x30e987){return function(_0x425151){try{jsonpatch[_0xecb0('0x1f')](_0x425151,_0x30e987,!![]);}catch(_0x397971){return BPromise['reject'](_0x397971);}return _0x425151[_0xecb0('0x20')]();};}function saveUpdates(_0x47b0bb,_0x5ca150){return function(_0x4defdc){if(_0x4defdc){return _0x4defdc[_0xecb0('0x21')](_0x47b0bb)[_0xecb0('0x22')](function(_0x32a936){return _0x32a936;});}return null;};}function removeEntity(_0xe9d477,_0x1351f1){return function(_0x49efb8){if(_0x49efb8){return _0x49efb8['destroy']()[_0xecb0('0x22')](function(){_0xe9d477[_0xecb0('0x17')](0xcc)[_0xecb0('0x23')]();});}};}function handleEntityNotFound(_0x20b27a,_0x682bff){return function(_0x42b850){if(!_0x42b850){_0x20b27a['sendStatus'](0x194);}return _0x42b850;};}function handleError(_0x4cced6,_0x539ce8){_0x539ce8=_0x539ce8||0x1f4;return function(_0x3e31c8){logger['error'](_0x3e31c8['stack']);if(_0x3e31c8[_0xecb0('0x24')]){delete _0x3e31c8[_0xecb0('0x24')];}_0x4cced6[_0xecb0('0x17')](_0x539ce8)[_0xecb0('0x25')](_0x3e31c8);};}exports[_0xecb0('0x26')]=function(_0x28c064,_0x435860){var _0x5409f6={},_0x446f1a={},_0x2b3a6d={'count':0x0,'rows':[]};var _0x19c5b7=_[_0xecb0('0x27')](db[_0xecb0('0x28')][_0xecb0('0x29')],function(_0x1ed2f7){return{'name':_0x1ed2f7['fieldName'],'type':_0x1ed2f7[_0xecb0('0x2a')][_0xecb0('0x2b')]};});_0x446f1a[_0xecb0('0x2c')]=_[_0xecb0('0x27')](_0x19c5b7,_0xecb0('0x24'));_0x446f1a['query']=_[_0xecb0('0x2d')](_0x28c064['query']);_0x446f1a[_0xecb0('0x2e')]=_[_0xecb0('0x2f')](_0x446f1a[_0xecb0('0x2c')],_0x446f1a[_0xecb0('0x30')]);_0x5409f6[_0xecb0('0x31')]=_[_0xecb0('0x2f')](_0x446f1a['model'],qs[_0xecb0('0x32')](_0x28c064[_0xecb0('0x30')][_0xecb0('0x32')]));_0x5409f6[_0xecb0('0x31')]=_0x5409f6[_0xecb0('0x31')]['length']?_0x5409f6[_0xecb0('0x31')]:_0x446f1a['model'];if(!_0x28c064[_0xecb0('0x30')]['hasOwnProperty'](_0xecb0('0x33'))){_0x5409f6[_0xecb0('0x1c')]=qs['limit'](_0x28c064['query'][_0xecb0('0x1c')]);_0x5409f6[_0xecb0('0x19')]=qs[_0xecb0('0x19')](_0x28c064['query'][_0xecb0('0x19')]);}_0x5409f6[_0xecb0('0x34')]=qs['sort'](_0x28c064[_0xecb0('0x30')][_0xecb0('0x35')]);_0x5409f6['where']=qs[_0xecb0('0x2e')](_['pick'](_0x28c064[_0xecb0('0x30')],_0x446f1a[_0xecb0('0x2e')]),_0x19c5b7);if(_0x28c064[_0xecb0('0x30')][_0xecb0('0x36')]){_0x5409f6['where']=_[_0xecb0('0x37')](_0x5409f6[_0xecb0('0x38')],{'$or':_[_0xecb0('0x27')](_0x19c5b7,function(_0x2cdbd9){if(_0x2cdbd9[_0xecb0('0x2a')]!==_0xecb0('0x39')){var _0x2ac550={};_0x2ac550[_0x2cdbd9[_0xecb0('0x24')]]={'$like':'%'+_0x28c064[_0xecb0('0x30')][_0xecb0('0x36')]+'%'};return _0x2ac550;}})});}_0x5409f6=_[_0xecb0('0x37')]({},_0x5409f6,_0x28c064['options']);var _0x411da={'where':_0x5409f6[_0xecb0('0x38')]};return db[_0xecb0('0x28')][_0xecb0('0x1b')](_0x411da)[_0xecb0('0x22')](function(_0x4b4e86){_0x2b3a6d[_0xecb0('0x1b')]=_0x4b4e86;if(_0x28c064[_0xecb0('0x30')][_0xecb0('0x3a')]){_0x5409f6['include']=[{'all':!![]}];}return db[_0xecb0('0x28')][_0xecb0('0x3b')](_0x5409f6);})[_0xecb0('0x22')](function(_0x38b9f5){_0x2b3a6d[_0xecb0('0x3c')]=_0x38b9f5;return _0x2b3a6d;})[_0xecb0('0x22')](respondWithFilteredResult(_0x435860,_0x5409f6))[_0xecb0('0x3d')](handleError(_0x435860,null));};exports[_0xecb0('0x3e')]=function(_0x26c31b,_0x4bba91){var _0x5e9079={'raw':![],'where':{'id':_0x26c31b[_0xecb0('0x3f')]['id']}},_0x49a4ae={};_0x49a4ae['model']=_[_0xecb0('0x2d')](db[_0xecb0('0x28')]['rawAttributes']);_0x49a4ae[_0xecb0('0x30')]=_[_0xecb0('0x2d')](_0x26c31b[_0xecb0('0x30')]);_0x49a4ae[_0xecb0('0x2e')]=_[_0xecb0('0x2f')](_0x49a4ae[_0xecb0('0x2c')],_0x49a4ae[_0xecb0('0x30')]);_0x5e9079[_0xecb0('0x31')]=_['intersection'](_0x49a4ae[_0xecb0('0x2c')],qs[_0xecb0('0x32')](_0x26c31b[_0xecb0('0x30')][_0xecb0('0x32')]));_0x5e9079[_0xecb0('0x31')]=_0x5e9079[_0xecb0('0x31')][_0xecb0('0x40')]?_0x5e9079[_0xecb0('0x31')]:_0x49a4ae['model'];if(_0x26c31b[_0xecb0('0x30')][_0xecb0('0x3a')]){_0x5e9079[_0xecb0('0x41')]=[{'all':!![]}];}_0x5e9079=_[_0xecb0('0x37')]({},_0x5e9079,_0x26c31b[_0xecb0('0x42')]);return db[_0xecb0('0x28')][_0xecb0('0x43')](_0x5e9079)[_0xecb0('0x22')](handleEntityNotFound(_0x4bba91,null))[_0xecb0('0x22')](respondWithResult(_0x4bba91,null))[_0xecb0('0x3d')](handleError(_0x4bba91,null));};exports[_0xecb0('0x44')]=function(_0x18d15e,_0x2ae6c9){return db[_0xecb0('0x28')][_0xecb0('0x44')](_0x18d15e[_0xecb0('0x45')],{})['then'](respondWithResult(_0x2ae6c9,0xc9))[_0xecb0('0x3d')](handleError(_0x2ae6c9,null));};exports['update']=function(_0x1ef87a,_0x4aca1c){if(_0x1ef87a['body']['id']){delete _0x1ef87a[_0xecb0('0x45')]['id'];}return db[_0xecb0('0x28')]['find']({'where':{'id':_0x1ef87a[_0xecb0('0x3f')]['id']}})[_0xecb0('0x22')](handleEntityNotFound(_0x4aca1c,null))['then'](saveUpdates(_0x1ef87a[_0xecb0('0x45')],null))[_0xecb0('0x22')](respondWithResult(_0x4aca1c,null))[_0xecb0('0x3d')](handleError(_0x4aca1c,null));};exports[_0xecb0('0x46')]=function(_0x2b70b5,_0x327b00){return db[_0xecb0('0x28')][_0xecb0('0x43')]({'where':{'id':_0x2b70b5['params']['id']}})[_0xecb0('0x22')](handleEntityNotFound(_0x327b00,null))['then'](removeEntity(_0x327b00,null))[_0xecb0('0x3d')](handleError(_0x327b00,null));};exports['getConfigurations']=function(_0x39a431,_0x289788,_0x370486){var _0x10c983={};var _0xd68b52={};var _0xcb333;var _0x36cacd;return db[_0xecb0('0x28')]['findOne']({'where':{'id':_0x39a431['params']['id']}})[_0xecb0('0x22')](handleEntityNotFound(_0x289788,null))['then'](function(_0x2dd033){if(_0x2dd033){_0xcb333=_0x2dd033;_0xd68b52[_0xecb0('0x2c')]=_['keys'](db[_0xecb0('0x47')][_0xecb0('0x29')]);_0xd68b52['query']=_[_0xecb0('0x2d')](_0x39a431[_0xecb0('0x30')]);_0xd68b52[_0xecb0('0x2e')]=_[_0xecb0('0x2f')](_0xd68b52['model'],_0xd68b52[_0xecb0('0x30')]);_0x10c983[_0xecb0('0x31')]=_[_0xecb0('0x2f')](_0xd68b52[_0xecb0('0x2c')],qs[_0xecb0('0x32')](_0x39a431[_0xecb0('0x30')][_0xecb0('0x32')]));_0x10c983[_0xecb0('0x31')]=_0x10c983[_0xecb0('0x31')][_0xecb0('0x40')]?_0x10c983[_0xecb0('0x31')]:_0xd68b52['model'];_0x10c983[_0xecb0('0x34')]=qs['sort'](_0x39a431[_0xecb0('0x30')][_0xecb0('0x35')]);_0x10c983['where']=qs[_0xecb0('0x2e')](_[_0xecb0('0x48')](_0x39a431[_0xecb0('0x30')],_0xd68b52[_0xecb0('0x2e')]));if(_0x39a431[_0xecb0('0x30')]['filter']){_0x10c983[_0xecb0('0x38')]=_[_0xecb0('0x37')](_0x10c983[_0xecb0('0x38')],{'$or':_[_0xecb0('0x27')](_0x10c983['attributes'],function(_0x1b8185){var _0x4dbdfc={};_0x4dbdfc[_0x1b8185]={'$like':'%'+_0x39a431[_0xecb0('0x30')]['filter']+'%'};return _0x4dbdfc;})});}_0x10c983=_[_0xecb0('0x37')]({},_0x10c983,_0x39a431[_0xecb0('0x42')]);return _0xcb333[_0xecb0('0x49')](_0x10c983);}})['then'](function(_0x3a25b2){if(_0x3a25b2){_0x36cacd=_0x3a25b2[_0xecb0('0x40')];if(!_0x39a431[_0xecb0('0x30')][_0xecb0('0x4a')]('nolimit')){_0x10c983[_0xecb0('0x1c')]=qs[_0xecb0('0x1c')](_0x39a431['query'][_0xecb0('0x1c')]);_0x10c983[_0xecb0('0x19')]=qs[_0xecb0('0x19')](_0x39a431[_0xecb0('0x30')][_0xecb0('0x19')]);}return _0xcb333['getConfigurations'](_0x10c983);}})[_0xecb0('0x22')](function(_0x2baaca){if(_0x2baaca){return _0x2baaca?{'count':_0x36cacd,'rows':_0x2baaca}:null;}})[_0xecb0('0x22')](respondWithResult(_0x289788,null))[_0xecb0('0x3d')](handleError(_0x289788,null));};exports['addConfiguration']=function(_0x11bb28,_0x15e8cd,_0x188c84){if(_0x11bb28[_0xecb0('0x45')]['id']){delete _0x11bb28[_0xecb0('0x45')]['id'];}return db[_0xecb0('0x28')][_0xecb0('0x4b')]({'where':{'id':_0x11bb28[_0xecb0('0x3f')]['id']}})[_0xecb0('0x22')](handleEntityNotFound(_0x15e8cd,null))[_0xecb0('0x22')](function(_0xbb969c){if(_0xbb969c){_0x11bb28[_0xecb0('0x45')]['AccountId']=_0xbb969c['id'];_0x11bb28[_0xecb0('0x45')][_0xecb0('0x4c')]=integrations['getSubjects'](_0x11bb28['body']['channel'],_0x11bb28[_0xecb0('0x45')]['type']);_0x11bb28[_0xecb0('0x45')][_0xecb0('0x4d')]=integrations[_0xecb0('0x4e')](_0x11bb28[_0xecb0('0x45')]['channel'],_0x11bb28[_0xecb0('0x45')][_0xecb0('0x2a')]);return db['VtigerConfiguration'][_0xecb0('0x44')](_0x11bb28['body'],{'include':[{'model':db[_0xecb0('0x4f')],'as':_0xecb0('0x4c')},{'model':db[_0xecb0('0x4f')],'as':_0xecb0('0x4d')}]});}return null;})[_0xecb0('0x22')](respondWithResult(_0x15e8cd,null))[_0xecb0('0x3d')](handleError(_0x15e8cd,null));};var md5=require(_0xecb0('0x50'));exports[_0xecb0('0x51')]=function(_0xeee333,_0xe78128,_0x1f1464){var _0x647d3d=null;var _0x1c0c0b=null;var _0x418007=null;var _0x4b91cf=null;var _0x27ff89='';return db[_0xecb0('0x28')][_0xecb0('0x4b')]({'where':{'id':_0xeee333[_0xecb0('0x3f')]['id']},'attributes':['id','name',_0xecb0('0x52'),_0xecb0('0x53'),'moduleName',_0xecb0('0x54'),_0xecb0('0x55'),_0xecb0('0x56')]})[_0xecb0('0x22')](handleEntityNotFound(_0xe78128,null))[_0xecb0('0x22')](function(_0x56bd04){if(_0x56bd04){_0x647d3d=_0x56bd04['username'];_0x1c0c0b=_0x56bd04[_0xecb0('0x56')];_0x418007=_0x56bd04[_0xecb0('0x57')];_0x27ff89=_0x56bd04[_0xecb0('0x54')];var _0x5bbaa1=_0x27ff89[_0xecb0('0x58')](-0x1);if(_0x5bbaa1==='/'){_0x27ff89=_0x27ff89[_0xecb0('0x59')](0x0,_0x27ff89[_0xecb0('0x5a')](_0x5bbaa1));}_0x4b91cf=util[_0xecb0('0x5b')]('%s/webservice.php',_0x27ff89);var _0x2ed00d={'method':_0xecb0('0x5c'),'uri':_0x4b91cf,'qs':{'operation':_0xecb0('0x5d'),'username':_0x56bd04[_0xecb0('0x52')]},'json':!![]};return rp(_0x2ed00d);}})[_0xecb0('0x22')](function(_0x290363){if(_0x290363[_0xecb0('0x5e')]){var _0x5974b4={'method':'POST','uri':_0x4b91cf,'form':{'operation':_0xecb0('0x5f'),'username':_0x647d3d,'accessKey':md5(_0x290363[_0xecb0('0x60')][_0xecb0('0x61')]+_0x1c0c0b)},'json':!![]};return rp(_0x5974b4);}})[_0xecb0('0x22')](function(_0x5cc6b6){if(_0x5cc6b6[_0xecb0('0x5e')]){var _0x4ba5ed={'method':_0xecb0('0x5c'),'uri':_0x4b91cf,'qs':{'operation':_0xecb0('0x62'),'username':_0x647d3d,'sessionName':_0x5cc6b6['result'][_0xecb0('0x63')],'elementType':_0x418007},'json':!![]};return rp(_0x4ba5ed);}})[_0xecb0('0x22')](function(_0x545d26){if(_0x545d26[_0xecb0('0x5e')]){var _0x2893c1=[_0xecb0('0x64'),_0xecb0('0x65'),_0xecb0('0x66')];_[_0xecb0('0x67')](_0x545d26[_0xecb0('0x60')][_0xecb0('0x32')],function(_0x4297a6){return _0x2893c1[_0xecb0('0x68')](_0x4297a6[_0xecb0('0x2a')][_0xecb0('0x24')]);});_[_0xecb0('0x67')](_0x545d26[_0xecb0('0x60')]['fields'],function(_0x26f97f){return _0x26f97f[_0xecb0('0x69')]==='false';});return{'count':_0x545d26[_0xecb0('0x60')][_0xecb0('0x32')]['length'],'rows':_[_0xecb0('0x27')](_0x545d26[_0xecb0('0x60')][_0xecb0('0x32')],function(_0x24fa08){return{'id':_0x24fa08['name'],'name':_0x24fa08[_0xecb0('0x6a')],'custom':_['startsWith'](_0x24fa08['name'],'cf_')?!![]:![],'options':_0x24fa08[_0xecb0('0x2a')]['name']===_0xecb0('0x6b')&&_0x24fa08[_0xecb0('0x2a')][_0xecb0('0x6c')]['length']>0x0?_[_0xecb0('0x27')](_0x24fa08[_0xecb0('0x2a')][_0xecb0('0x6c')],function(_0x12830b){return{'name':_0x12830b[_0xecb0('0x6a')],'value':_0x12830b[_0xecb0('0x6d')]};}):[]};})};}})[_0xecb0('0x22')](respondWithResult(_0xe78128,null))[_0xecb0('0x3d')](function(_0x230965){console[_0xecb0('0x6e')](_0xecb0('0x6f')+_0x230965);var _0x64b218=_0xeee333[_0xecb0('0x30')][_0xecb0('0x70')]?0x1f4:_0x230965[_0xecb0('0x71')]||0x1f4;logger[_0xecb0('0x72')](_0xecb0('0x73'),_0xecb0('0x51'),_0x64b218,JSON['stringify'](_0x230965));delete _0x230965[_0xecb0('0x24')];if(_0x64b218===0x191){_0x64b218=0x190;}_0xe78128[_0xecb0('0x17')](_0x64b218)[_0xecb0('0x25')](_0xeee333[_0xecb0('0x30')][_0xecb0('0x70')]?{'message':_0xecb0('0x74'),'statusCode':_0x230965[_0xecb0('0x71')]}:_0x230965);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 244d61e..dc27462 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 _0x1ff1=['./intVtigerAccount.attributes','exports','define','VtigerAccount','int_vtiger_accounts','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xfb56d9,_0x374d2f){var _0x40510b=function(_0x42139f){while(--_0x42139f){_0xfb56d9['push'](_0xfb56d9['shift']());}};_0x40510b(++_0x374d2f);}(_0x1ff1,0x71));var _0x11ff=function(_0x5f273a,_0x2fc95e){_0x5f273a=_0x5f273a-0x0;var _0x307e20=_0x1ff1[_0x5f273a];return _0x307e20;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x11ff('0x0'))(_0x11ff('0x1'));var moment=require('moment');var BPromise=require(_0x11ff('0x2'));var rp=require(_0x11ff('0x3'));var fs=require('fs');var path=require(_0x11ff('0x4'));var rimraf=require(_0x11ff('0x5'));var config=require(_0x11ff('0x6'));var attributes=require(_0x11ff('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x11ff('0x8')]=function(_0x458dd6,_0x2c1c7f){return _0x458dd6[_0x11ff('0x9')](_0x11ff('0xa'),attributes,{'tableName':_0x11ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8aa=['api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','../../config/logger'];(function(_0x3d1068,_0x521bd8){var _0x39250c=function(_0x49d0f1){while(--_0x49d0f1){_0x3d1068['push'](_0x3d1068['shift']());}};_0x39250c(++_0x521bd8);}(_0xa8aa,0xe9));var _0xaa8a=function(_0x47aad8,_0x4292eb){_0x47aad8=_0x47aad8-0x0;var _0x215148=_0xa8aa[_0x47aad8];return _0x215148;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaa8a('0x0'))(_0xaa8a('0x1'));var moment=require(_0xaa8a('0x2'));var BPromise=require(_0xaa8a('0x3'));var rp=require(_0xaa8a('0x4'));var fs=require('fs');var path=require(_0xaa8a('0x5'));var rimraf=require('rimraf');var config=require(_0xaa8a('0x6'));var attributes=require(_0xaa8a('0x7'));var integrations=require(_0xaa8a('0x8'));module[_0xaa8a('0x9')]=function(_0x45788d,_0x17eb9b){return _0x45788d[_0xaa8a('0xa')](_0xaa8a('0xb'),attributes,{'tableName':_0xaa8a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 31a193a..b43644f 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 _0xf45e=['options','raw','where','attributes','limit','include','model','map','VtigerAccount','find','ShowVtigerAccount','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','findAll'];(function(_0x1e94dc,_0x59fa52){var _0x37b61f=function(_0x76bb31){while(--_0x76bb31){_0x1e94dc['push'](_0x1e94dc['shift']());}};_0x37b61f(++_0x59fa52);}(_0xf45e,0x115));var _0xef45=function(_0x3e9081,_0x6ab6f3){_0x3e9081=_0x3e9081-0x0;var _0x2b98fd=_0xf45e[_0x3e9081];return _0x2b98fd;};'use strict';var _=require(_0xef45('0x0'));var util=require('util');var moment=require(_0xef45('0x1'));var BPromise=require('bluebird');var rs=require(_0xef45('0x2'));var fs=require('fs');var Redis=require(_0xef45('0x3'));var db=require(_0xef45('0x4'))['db'];var utils=require(_0xef45('0x5'));var logger=require(_0xef45('0x6'))(_0xef45('0x7'));var config=require(_0xef45('0x8'));var jayson=require(_0xef45('0x9'));var client=jayson[_0xef45('0xa')][_0xef45('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f2e92,_0x3303ad,_0x1a68c4){return new BPromise(function(_0x1e0def,_0x268ef6){return client[_0xef45('0xc')](_0x2f2e92,_0x1a68c4)[_0xef45('0xd')](function(_0x158a0b){logger[_0xef45('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x3303ad,_0xef45('0xf'));logger[_0xef45('0x10')](_0xef45('0x11'),_0x3303ad,_0xef45('0xf'),JSON[_0xef45('0x12')](_0x158a0b));if(_0x158a0b[_0xef45('0x13')]){if(_0x158a0b['error'][_0xef45('0x14')]===0x1f4){logger[_0xef45('0x13')](_0xef45('0x15'),_0x3303ad,_0x158a0b[_0xef45('0x13')][_0xef45('0x16')]);return _0x268ef6(_0x158a0b['error']['message']);}logger[_0xef45('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x3303ad,_0x158a0b[_0xef45('0x13')][_0xef45('0x16')]);return _0x1e0def(_0x158a0b[_0xef45('0x13')]['message']);}else{logger['info'](_0xef45('0x15'),_0x3303ad,'request\x20sent');_0x1e0def(_0x158a0b[_0xef45('0x17')][_0xef45('0x16')]);}})[_0xef45('0x18')](function(_0x3f40e5){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x3303ad,_0x3f40e5);_0x268ef6(_0x3f40e5);});});}exports[_0xef45('0x19')]=function(_0x219778){var _0x3ba1f4=this;return new Promise(function(_0x258785,_0x4ca902){return db['VtigerAccount'][_0xef45('0x1a')]({'raw':_0x219778[_0xef45('0x1b')]?_0x219778[_0xef45('0x1b')][_0xef45('0x1c')]===undefined?!![]:![]:!![],'where':_0x219778[_0xef45('0x1b')]?_0x219778[_0xef45('0x1b')][_0xef45('0x1d')]||null:null,'attributes':_0x219778['options']?_0x219778[_0xef45('0x1b')][_0xef45('0x1e')]||null:null,'limit':_0x219778[_0xef45('0x1b')]?_0x219778[_0xef45('0x1b')][_0xef45('0x1f')]||null:null,'include':_0x219778['options']?_0x219778[_0xef45('0x1b')]['include']?_['map'](_0x219778[_0xef45('0x1b')][_0xef45('0x20')],function(_0xbb859b){return{'model':db[_0xbb859b[_0xef45('0x21')]],'as':_0xbb859b['as'],'attributes':_0xbb859b[_0xef45('0x1e')],'include':_0xbb859b[_0xef45('0x20')]?_[_0xef45('0x22')](_0xbb859b['include'],function(_0x208b35){return{'model':db[_0x208b35['model']],'as':_0x208b35['as'],'attributes':_0x208b35[_0xef45('0x1e')],'include':_0x208b35[_0xef45('0x20')]?_['map'](_0x208b35[_0xef45('0x20')],function(_0x2c356d){return{'model':db[_0x2c356d['model']],'as':_0x2c356d['as'],'attributes':_0x2c356d[_0xef45('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x550e18){logger['info']('GetVtigerAccount',_0x219778);logger[_0xef45('0x10')](_0xef45('0x19'),_0x219778,JSON[_0xef45('0x12')](_0x550e18));_0x258785(_0x550e18);})[_0xef45('0x18')](function(_0x5782d0){logger[_0xef45('0x13')]('GetVtigerAccount',_0x5782d0[_0xef45('0x16')],_0x219778);_0x4ca902(_0x3ba1f4['error'](0x1f4,_0x5782d0[_0xef45('0x16')]));});});};exports['ShowVtigerAccount']=function(_0x575734){var _0x14ce5a=this;return new Promise(function(_0x3e45de,_0x390a7a){return db[_0xef45('0x23')][_0xef45('0x24')]({'raw':_0x575734['options']?_0x575734['options']['raw']===undefined?!![]:![]:!![],'where':_0x575734[_0xef45('0x1b')]?_0x575734[_0xef45('0x1b')][_0xef45('0x1d')]||null:null,'attributes':_0x575734[_0xef45('0x1b')]?_0x575734[_0xef45('0x1b')][_0xef45('0x1e')]||null:null,'include':_0x575734[_0xef45('0x1b')]?_0x575734['options']['include']?_[_0xef45('0x22')](_0x575734['options'][_0xef45('0x20')],function(_0x5116b0){return{'model':db[_0x5116b0[_0xef45('0x21')]],'as':_0x5116b0['as'],'attributes':_0x5116b0[_0xef45('0x1e')],'include':_0x5116b0[_0xef45('0x20')]?_[_0xef45('0x22')](_0x5116b0[_0xef45('0x20')],function(_0x5b7d73){return{'model':db[_0x5b7d73[_0xef45('0x21')]],'as':_0x5b7d73['as'],'attributes':_0x5b7d73[_0xef45('0x1e')],'include':_0x5b7d73[_0xef45('0x20')]?_['map'](_0x5b7d73['include'],function(_0x787387){return{'model':db[_0x787387[_0xef45('0x21')]],'as':_0x787387['as'],'attributes':_0x787387['attributes']};}):[]};}):[]};}):[]:[]})[_0xef45('0xd')](function(_0x501eb3){logger['info'](_0xef45('0x25'),_0x575734);logger[_0xef45('0x10')](_0xef45('0x25'),_0x575734,JSON['stringify'](_0x501eb3));_0x3e45de(_0x501eb3);})[_0xef45('0x18')](function(_0x3a1bcc){logger[_0xef45('0x13')](_0xef45('0x25'),_0x3a1bcc['message'],_0x575734);_0x390a7a(_0x14ce5a['error'](0x1f4,_0x3a1bcc[_0xef45('0x16')]));});});}; \ No newline at end of file +var _0x0972=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','limit','include','map','model','catch','find','where','ShowVtigerAccount','util','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x97cb2e,_0x4c3c3c){var _0x364106=function(_0xd18f6f){while(--_0xd18f6f){_0x97cb2e['push'](_0x97cb2e['shift']());}};_0x364106(++_0x4c3c3c);}(_0x0972,0x64));var _0x2097=function(_0xeb7bd3,_0x19435a){_0xeb7bd3=_0xeb7bd3-0x0;var _0x5633b6=_0x0972[_0xeb7bd3];return _0x5633b6;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var moment=require('moment');var BPromise=require(_0x2097('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2097('0x2'));var db=require(_0x2097('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2097('0x4'))(_0x2097('0x5'));var config=require(_0x2097('0x6'));var jayson=require(_0x2097('0x7'));var client=jayson[_0x2097('0x8')][_0x2097('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b4f21,_0x59739f,_0x332aac){return new BPromise(function(_0x1e661a,_0x11d263){return client[_0x2097('0xa')](_0x2b4f21,_0x332aac)[_0x2097('0xb')](function(_0x59d947){logger[_0x2097('0xc')](_0x2097('0xd'),_0x59739f,_0x2097('0xe'));logger[_0x2097('0xf')](_0x2097('0x10'),_0x59739f,_0x2097('0xe'),JSON[_0x2097('0x11')](_0x59d947));if(_0x59d947[_0x2097('0x12')]){if(_0x59d947[_0x2097('0x12')][_0x2097('0x13')]===0x1f4){logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);return _0x11d263(_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);}logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);return _0x1e661a(_0x59d947['error'][_0x2097('0x14')]);}else{logger[_0x2097('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x59739f,'request\x20sent');_0x1e661a(_0x59d947['result'][_0x2097('0x14')]);}})['catch'](function(_0x28c35c){logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x28c35c);_0x11d263(_0x28c35c);});});}exports[_0x2097('0x15')]=function(_0x44c584){var _0x53e2b4=this;return new Promise(function(_0x324652,_0x140094){return db[_0x2097('0x16')][_0x2097('0x17')]({'raw':_0x44c584[_0x2097('0x18')]?_0x44c584[_0x2097('0x18')][_0x2097('0x19')]===undefined?!![]:![]:!![],'where':_0x44c584[_0x2097('0x18')]?_0x44c584['options']['where']||null:null,'attributes':_0x44c584[_0x2097('0x18')]?_0x44c584['options'][_0x2097('0x1a')]||null:null,'limit':_0x44c584[_0x2097('0x18')]?_0x44c584['options'][_0x2097('0x1b')]||null:null,'include':_0x44c584['options']?_0x44c584[_0x2097('0x18')][_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x44c584[_0x2097('0x18')][_0x2097('0x1c')],function(_0x35047b){return{'model':db[_0x35047b['model']],'as':_0x35047b['as'],'attributes':_0x35047b[_0x2097('0x1a')],'include':_0x35047b['include']?_[_0x2097('0x1d')](_0x35047b[_0x2097('0x1c')],function(_0x345875){return{'model':db[_0x345875[_0x2097('0x1e')]],'as':_0x345875['as'],'attributes':_0x345875['attributes'],'include':_0x345875[_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x345875['include'],function(_0x1229fc){return{'model':db[_0x1229fc['model']],'as':_0x1229fc['as'],'attributes':_0x1229fc[_0x2097('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbc0339){logger[_0x2097('0xc')](_0x2097('0x15'),_0x44c584);logger[_0x2097('0xf')](_0x2097('0x15'),_0x44c584,JSON[_0x2097('0x11')](_0xbc0339));_0x324652(_0xbc0339);})[_0x2097('0x1f')](function(_0x4b443d){logger[_0x2097('0x12')](_0x2097('0x15'),_0x4b443d['message'],_0x44c584);_0x140094(_0x53e2b4[_0x2097('0x12')](0x1f4,_0x4b443d[_0x2097('0x14')]));});});};exports['ShowVtigerAccount']=function(_0x4d0916){var _0x312c77=this;return new Promise(function(_0x11b051,_0x1649c8){return db[_0x2097('0x16')][_0x2097('0x20')]({'raw':_0x4d0916[_0x2097('0x18')]?_0x4d0916['options'][_0x2097('0x19')]===undefined?!![]:![]:!![],'where':_0x4d0916['options']?_0x4d0916[_0x2097('0x18')][_0x2097('0x21')]||null:null,'attributes':_0x4d0916[_0x2097('0x18')]?_0x4d0916[_0x2097('0x18')][_0x2097('0x1a')]||null:null,'include':_0x4d0916[_0x2097('0x18')]?_0x4d0916[_0x2097('0x18')][_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x4d0916['options'][_0x2097('0x1c')],function(_0x40baed){return{'model':db[_0x40baed[_0x2097('0x1e')]],'as':_0x40baed['as'],'attributes':_0x40baed['attributes'],'include':_0x40baed[_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x40baed[_0x2097('0x1c')],function(_0x396162){return{'model':db[_0x396162['model']],'as':_0x396162['as'],'attributes':_0x396162['attributes'],'include':_0x396162['include']?_[_0x2097('0x1d')](_0x396162[_0x2097('0x1c')],function(_0x4123b7){return{'model':db[_0x4123b7[_0x2097('0x1e')]],'as':_0x4123b7['as'],'attributes':_0x4123b7[_0x2097('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2097('0xb')](function(_0x49b724){logger[_0x2097('0xc')](_0x2097('0x22'),_0x4d0916);logger[_0x2097('0xf')](_0x2097('0x22'),_0x4d0916,JSON[_0x2097('0x11')](_0x49b724));_0x11b051(_0x49b724);})[_0x2097('0x1f')](function(_0x52b937){logger[_0x2097('0x12')](_0x2097('0x22'),_0x52b937[_0x2097('0x14')],_0x4d0916);_0x1649c8(_0x312c77['error'](0x1f4,_0x52b937['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index ba8a811..d5b64ce 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 _0xba76=['./intVtigerConfiguration.controller','isAuthenticated','index','get','show','/:id/subjects','getSubjects','getDescriptions','post','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0xb690b4,_0x4d122a){var _0x3b57ee=function(_0x2dfd59){while(--_0x2dfd59){_0xb690b4['push'](_0xb690b4['shift']());}};_0x3b57ee(++_0x4d122a);}(_0xba76,0x196));var _0x6ba7=function(_0x4a6995,_0x4821ea){_0x4a6995=_0x4a6995-0x0;var _0x3e5c52=_0xba76[_0x4a6995];return _0x3e5c52;};'use strict';var multer=require(_0x6ba7('0x0'));var util=require(_0x6ba7('0x1'));var path=require(_0x6ba7('0x2'));var timeout=require('connect-timeout');var express=require(_0x6ba7('0x3'));var router=express[_0x6ba7('0x4')]();var fs_extra=require(_0x6ba7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6ba7('0x6'));var config=require(_0x6ba7('0x7'));var controller=require(_0x6ba7('0x8'));router['get']('/',auth[_0x6ba7('0x9')](),controller[_0x6ba7('0xa')]);router[_0x6ba7('0xb')]('/:id',auth[_0x6ba7('0x9')](),controller[_0x6ba7('0xc')]);router[_0x6ba7('0xb')]('/:id/fields',auth[_0x6ba7('0x9')](),controller['getFields']);router[_0x6ba7('0xb')](_0x6ba7('0xd'),auth[_0x6ba7('0x9')](),controller[_0x6ba7('0xe')]);router[_0x6ba7('0xb')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x6ba7('0xf')]);router[_0x6ba7('0x10')]('/',auth[_0x6ba7('0x9')](),controller['create']);router[_0x6ba7('0x11')](_0x6ba7('0x12'),auth[_0x6ba7('0x9')](),controller[_0x6ba7('0x13')]);router[_0x6ba7('0x14')](_0x6ba7('0x12'),auth['isAuthenticated'](),controller[_0x6ba7('0x15')]);module[_0x6ba7('0x16')]=router; \ No newline at end of file +var _0xa29f=['get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intVtigerConfiguration.controller','isAuthenticated','index'];(function(_0xd2d54,_0x5329f7){var _0x78b113=function(_0x7d2b29){while(--_0x7d2b29){_0xd2d54['push'](_0xd2d54['shift']());}};_0x78b113(++_0x5329f7);}(_0xa29f,0x1d1));var _0xfa29=function(_0x46ec32,_0x1e842f){_0x46ec32=_0x46ec32-0x0;var _0x338f60=_0xa29f[_0x46ec32];return _0x338f60;};'use strict';var multer=require(_0xfa29('0x0'));var util=require(_0xfa29('0x1'));var path=require('path');var timeout=require(_0xfa29('0x2'));var express=require(_0xfa29('0x3'));var router=express[_0xfa29('0x4')]();var fs_extra=require(_0xfa29('0x5'));var auth=require(_0xfa29('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfa29('0x7'));router['get']('/',auth[_0xfa29('0x8')](),controller[_0xfa29('0x9')]);router[_0xfa29('0xa')](_0xfa29('0xb'),auth[_0xfa29('0x8')](),controller[_0xfa29('0xc')]);router[_0xfa29('0xa')](_0xfa29('0xd'),auth[_0xfa29('0x8')](),controller[_0xfa29('0xe')]);router[_0xfa29('0xa')](_0xfa29('0xf'),auth[_0xfa29('0x8')](),controller[_0xfa29('0x10')]);router[_0xfa29('0xa')](_0xfa29('0x11'),auth[_0xfa29('0x8')](),controller[_0xfa29('0x12')]);router[_0xfa29('0x13')]('/',auth[_0xfa29('0x8')](),controller[_0xfa29('0x14')]);router['put']('/:id',auth[_0xfa29('0x8')](),controller[_0xfa29('0x15')]);router[_0xfa29('0x16')]('/:id',auth[_0xfa29('0x8')](),controller[_0xfa29('0x17')]);module[_0xfa29('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 99440e2..870dc66 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 _0x2ff2=['exports','STRING','sequelize'];(function(_0x59419c,_0x40e7c0){var _0x1a7458=function(_0x346683){while(--_0x346683){_0x59419c['push'](_0x59419c['shift']());}};_0x1a7458(++_0x40e7c0);}(_0x2ff2,0x1ac));var _0x22ff=function(_0x79702,_0x34931c){_0x79702=_0x79702-0x0;var _0x417e6b=_0x2ff2[_0x79702];return _0x417e6b;};'use strict';var Sequelize=require(_0x22ff('0x0'));module[_0x22ff('0x1')]={'name':{'type':Sequelize[_0x22ff('0x2')]},'description':{'type':Sequelize[_0x22ff('0x2')]}}; \ No newline at end of file +var _0x4b2c=['sequelize','exports','STRING'];(function(_0x142b18,_0x35e4ff){var _0x24c9a5=function(_0x3bd378){while(--_0x3bd378){_0x142b18['push'](_0x142b18['shift']());}};_0x24c9a5(++_0x35e4ff);}(_0x4b2c,0xb7));var _0xc4b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b2c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc4b2('0x0'));module[_0xc4b2('0x1')]={'name':{'type':Sequelize[_0xc4b2('0x2')]},'description':{'type':Sequelize[_0xc4b2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index dc329ca..2d3b738 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 _0xfa9d=['../../config/license/hardware','../../config/logger','api','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','filters','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','getFields','findOne','VtigerField','order','filter','hasOwnProperty','getSubjects','pick','getDescriptions','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x592f00,_0x45d155){var _0x2cc65d=function(_0xdc5074){while(--_0xdc5074){_0x592f00['push'](_0x592f00['shift']());}};_0x2cc65d(++_0x45d155);}(_0xfa9d,0x1c9));var _0xdfa9=function(_0x9eb842,_0x9a30b4){_0x9eb842=_0x9eb842-0x0;var _0x2428f8=_0xfa9d[_0x9eb842];return _0x2428f8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdfa9('0x0'));var jsonpatch=require(_0xdfa9('0x1'));var rp=require(_0xdfa9('0x2'));var moment=require('moment');var BPromise=require(_0xdfa9('0x3'));var Mustache=require(_0xdfa9('0x4'));var util=require(_0xdfa9('0x5'));var path=require(_0xdfa9('0x6'));var sox=require(_0xdfa9('0x7'));var csv=require(_0xdfa9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdfa9('0x9'));var squel=require(_0xdfa9('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdfa9('0xb'));var toCsv=require(_0xdfa9('0x8'));var querystring=require(_0xdfa9('0xc'));var Papa=require(_0xdfa9('0xd'));var Redis=require('ioredis');var authService=require(_0xdfa9('0xe'));var qs=require(_0xdfa9('0xf'));var as=require(_0xdfa9('0x10'));var hardwareService=require(_0xdfa9('0x11'));var logger=require(_0xdfa9('0x12'))(_0xdfa9('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdfa9('0x14'))['db'];function respondWithStatusCode(_0x4a2b47,_0x5618ce){_0x5618ce=_0x5618ce||0xcc;return function(_0x23d095){if(_0x23d095){return _0x4a2b47['sendStatus'](_0x5618ce);}return _0x4a2b47[_0xdfa9('0x15')](_0x5618ce)['end']();};}function respondWithResult(_0x91432d,_0x56e820){_0x56e820=_0x56e820||0xc8;return function(_0x139de6){if(_0x139de6){return _0x91432d[_0xdfa9('0x15')](_0x56e820)[_0xdfa9('0x16')](_0x139de6);}};}function respondWithFilteredResult(_0x44ca8e,_0x414ec4){return function(_0x27d2d6){if(_0x27d2d6){var _0xdf2ea5=typeof _0x414ec4[_0xdfa9('0x17')]==='undefined'&&typeof _0x414ec4['limit']===_0xdfa9('0x18');var _0x53968a=_0x27d2d6[_0xdfa9('0x19')];var _0x51b5e4=_0xdf2ea5?0x0:_0x414ec4[_0xdfa9('0x17')];var _0x4d370b=_0xdf2ea5?_0x27d2d6[_0xdfa9('0x19')]:_0x414ec4[_0xdfa9('0x17')]+_0x414ec4[_0xdfa9('0x1a')];var _0x411516;if(_0x4d370b>=_0x53968a){_0x4d370b=_0x53968a;_0x411516=0xc8;}else{_0x411516=0xce;}_0x44ca8e['status'](_0x411516);return _0x44ca8e[_0xdfa9('0x1b')](_0xdfa9('0x1c'),_0x51b5e4+'-'+_0x4d370b+'/'+_0x53968a)[_0xdfa9('0x16')](_0x27d2d6);}return null;};}function patchUpdates(_0xe29f24){return function(_0x13150d){try{jsonpatch[_0xdfa9('0x1d')](_0x13150d,_0xe29f24,!![]);}catch(_0x4c7425){return BPromise[_0xdfa9('0x1e')](_0x4c7425);}return _0x13150d[_0xdfa9('0x1f')]();};}function saveUpdates(_0x124e46,_0x51d2c3){return function(_0x18eb89){if(_0x18eb89){return _0x18eb89[_0xdfa9('0x20')](_0x124e46)[_0xdfa9('0x21')](function(_0x3f266e){return _0x3f266e;});}return null;};}function removeEntity(_0x23c6bc,_0x58d018){return function(_0x2dde10){if(_0x2dde10){return _0x2dde10[_0xdfa9('0x22')]()[_0xdfa9('0x21')](function(){_0x23c6bc['status'](0xcc)[_0xdfa9('0x23')]();});}};}function handleEntityNotFound(_0x25ceab,_0x30f52d){return function(_0x39a1dd){if(!_0x39a1dd){_0x25ceab[_0xdfa9('0x24')](0x194);}return _0x39a1dd;};}function handleError(_0xafebca,_0x1cb2e8){_0x1cb2e8=_0x1cb2e8||0x1f4;return function(_0x22453f){logger['error'](_0x22453f[_0xdfa9('0x25')]);if(_0x22453f[_0xdfa9('0x26')]){delete _0x22453f['name'];}_0xafebca[_0xdfa9('0x15')](_0x1cb2e8)[_0xdfa9('0x27')](_0x22453f);};}exports[_0xdfa9('0x28')]=function(_0x4030be,_0x305279){var _0x370368={},_0x1c8642={},_0x59c6bd={'count':0x0,'rows':[]};var _0x221cfb=_[_0xdfa9('0x29')](db[_0xdfa9('0x2a')][_0xdfa9('0x2b')],function(_0x3e38f0){return{'name':_0x3e38f0[_0xdfa9('0x2c')],'type':_0x3e38f0[_0xdfa9('0x2d')][_0xdfa9('0x2e')]};});_0x1c8642[_0xdfa9('0x2f')]=_[_0xdfa9('0x29')](_0x221cfb,'name');_0x1c8642[_0xdfa9('0x30')]=_[_0xdfa9('0x31')](_0x4030be[_0xdfa9('0x30')]);_0x1c8642['filters']=_[_0xdfa9('0x32')](_0x1c8642[_0xdfa9('0x2f')],_0x1c8642[_0xdfa9('0x30')]);_0x370368[_0xdfa9('0x33')]=_[_0xdfa9('0x32')](_0x1c8642[_0xdfa9('0x2f')],qs['fields'](_0x4030be[_0xdfa9('0x30')][_0xdfa9('0x34')]));_0x370368[_0xdfa9('0x33')]=_0x370368[_0xdfa9('0x33')][_0xdfa9('0x35')]?_0x370368[_0xdfa9('0x33')]:_0x1c8642[_0xdfa9('0x2f')];if(!_0x4030be['query']['hasOwnProperty'](_0xdfa9('0x36'))){_0x370368[_0xdfa9('0x1a')]=qs[_0xdfa9('0x1a')](_0x4030be[_0xdfa9('0x30')][_0xdfa9('0x1a')]);_0x370368[_0xdfa9('0x17')]=qs[_0xdfa9('0x17')](_0x4030be['query'][_0xdfa9('0x17')]);}_0x370368['order']=qs[_0xdfa9('0x37')](_0x4030be[_0xdfa9('0x30')][_0xdfa9('0x37')]);_0x370368['where']=qs[_0xdfa9('0x38')](_['pick'](_0x4030be[_0xdfa9('0x30')],_0x1c8642[_0xdfa9('0x38')]),_0x221cfb);if(_0x4030be[_0xdfa9('0x30')]['filter']){_0x370368[_0xdfa9('0x39')]=_[_0xdfa9('0x3a')](_0x370368['where'],{'$or':_[_0xdfa9('0x29')](_0x221cfb,function(_0x21de38){if(_0x21de38['type']!==_0xdfa9('0x3b')){var _0x2f116c={};_0x2f116c[_0x21de38[_0xdfa9('0x26')]]={'$like':'%'+_0x4030be[_0xdfa9('0x30')]['filter']+'%'};return _0x2f116c;}})});}_0x370368=_[_0xdfa9('0x3a')]({},_0x370368,_0x4030be[_0xdfa9('0x3c')]);var _0x25577a={'where':_0x370368[_0xdfa9('0x39')]};return db[_0xdfa9('0x2a')][_0xdfa9('0x19')](_0x25577a)['then'](function(_0x493b39){_0x59c6bd[_0xdfa9('0x19')]=_0x493b39;if(_0x4030be[_0xdfa9('0x30')][_0xdfa9('0x3d')]){_0x370368['include']=[{'all':!![]}];}return db[_0xdfa9('0x2a')][_0xdfa9('0x3e')](_0x370368);})['then'](function(_0x4c5392){_0x59c6bd[_0xdfa9('0x3f')]=_0x4c5392;return _0x59c6bd;})[_0xdfa9('0x21')](respondWithFilteredResult(_0x305279,_0x370368))[_0xdfa9('0x40')](handleError(_0x305279,null));};exports['show']=function(_0x3e9f86,_0x96afef){var _0x2bbe4b={'raw':![],'where':{'id':_0x3e9f86[_0xdfa9('0x41')]['id']}},_0x511756={};_0x511756[_0xdfa9('0x2f')]=_[_0xdfa9('0x31')](db['VtigerConfiguration'][_0xdfa9('0x2b')]);_0x511756[_0xdfa9('0x30')]=_[_0xdfa9('0x31')](_0x3e9f86[_0xdfa9('0x30')]);_0x511756[_0xdfa9('0x38')]=_[_0xdfa9('0x32')](_0x511756[_0xdfa9('0x2f')],_0x511756['query']);_0x2bbe4b[_0xdfa9('0x33')]=_['intersection'](_0x511756[_0xdfa9('0x2f')],qs[_0xdfa9('0x34')](_0x3e9f86[_0xdfa9('0x30')][_0xdfa9('0x34')]));_0x2bbe4b[_0xdfa9('0x33')]=_0x2bbe4b[_0xdfa9('0x33')][_0xdfa9('0x35')]?_0x2bbe4b[_0xdfa9('0x33')]:_0x511756[_0xdfa9('0x2f')];if(_0x3e9f86[_0xdfa9('0x30')][_0xdfa9('0x3d')]){_0x2bbe4b[_0xdfa9('0x42')]=[{'all':!![]}];}_0x2bbe4b=_[_0xdfa9('0x3a')]({},_0x2bbe4b,_0x3e9f86['options']);return db['VtigerConfiguration'][_0xdfa9('0x43')](_0x2bbe4b)['then'](handleEntityNotFound(_0x96afef,null))[_0xdfa9('0x21')](respondWithResult(_0x96afef,null))['catch'](handleError(_0x96afef,null));};exports[_0xdfa9('0x44')]=function(_0x2c00e3,_0x489418){return db[_0xdfa9('0x2a')]['create'](_0x2c00e3['body'],{})[_0xdfa9('0x21')](respondWithResult(_0x489418,0xc9))['catch'](handleError(_0x489418,null));};exports['update']=function(_0x1aeeff,_0xdd480b){if(_0x1aeeff['body']['id']){delete _0x1aeeff['body']['id'];}return db[_0xdfa9('0x2a')]['find']({'where':{'id':_0x1aeeff[_0xdfa9('0x41')]['id']}})[_0xdfa9('0x21')](handleEntityNotFound(_0xdd480b,null))[_0xdfa9('0x21')](saveUpdates(_0x1aeeff[_0xdfa9('0x45')],null))[_0xdfa9('0x21')](respondWithResult(_0xdd480b,null))[_0xdfa9('0x40')](handleError(_0xdd480b,null));};exports[_0xdfa9('0x22')]=function(_0x4b6fa6,_0x9a5e13){return db['VtigerConfiguration'][_0xdfa9('0x43')]({'where':{'id':_0x4b6fa6['params']['id']}})['then'](handleEntityNotFound(_0x9a5e13,null))[_0xdfa9('0x21')](removeEntity(_0x9a5e13,null))[_0xdfa9('0x40')](handleError(_0x9a5e13,null));};exports[_0xdfa9('0x46')]=function(_0x46139b,_0x6cff7f,_0x35af43){var _0x493e91={};var _0x4680a8={};var _0x470c95;var _0x2c21f6;return db[_0xdfa9('0x2a')][_0xdfa9('0x47')]({'where':{'id':_0x46139b[_0xdfa9('0x41')]['id']}})[_0xdfa9('0x21')](handleEntityNotFound(_0x6cff7f,null))[_0xdfa9('0x21')](function(_0x57d0f7){if(_0x57d0f7){_0x470c95=_0x57d0f7;_0x4680a8[_0xdfa9('0x2f')]=_[_0xdfa9('0x31')](db[_0xdfa9('0x48')][_0xdfa9('0x2b')]);_0x4680a8['query']=_[_0xdfa9('0x31')](_0x46139b[_0xdfa9('0x30')]);_0x4680a8[_0xdfa9('0x38')]=_[_0xdfa9('0x32')](_0x4680a8['model'],_0x4680a8[_0xdfa9('0x30')]);_0x493e91[_0xdfa9('0x33')]=_[_0xdfa9('0x32')](_0x4680a8[_0xdfa9('0x2f')],qs[_0xdfa9('0x34')](_0x46139b['query'][_0xdfa9('0x34')]));_0x493e91[_0xdfa9('0x33')]=_0x493e91[_0xdfa9('0x33')][_0xdfa9('0x35')]?_0x493e91['attributes']:_0x4680a8['model'];_0x493e91[_0xdfa9('0x49')]=qs['sort'](_0x46139b[_0xdfa9('0x30')][_0xdfa9('0x37')]);_0x493e91[_0xdfa9('0x39')]=qs[_0xdfa9('0x38')](_['pick'](_0x46139b['query'],_0x4680a8[_0xdfa9('0x38')]));if(_0x46139b['query'][_0xdfa9('0x4a')]){_0x493e91[_0xdfa9('0x39')]=_[_0xdfa9('0x3a')](_0x493e91[_0xdfa9('0x39')],{'$or':_['map'](_0x493e91[_0xdfa9('0x33')],function(_0x5a5f0a){var _0x19be35={};_0x19be35[_0x5a5f0a]={'$like':'%'+_0x46139b[_0xdfa9('0x30')]['filter']+'%'};return _0x19be35;})});}_0x493e91=_[_0xdfa9('0x3a')]({},_0x493e91,_0x46139b['options']);return _0x470c95[_0xdfa9('0x46')](_0x493e91);}})[_0xdfa9('0x21')](function(_0x36ad88){if(_0x36ad88){_0x2c21f6=_0x36ad88[_0xdfa9('0x35')];if(!_0x46139b['query'][_0xdfa9('0x4b')]('nolimit')){_0x493e91[_0xdfa9('0x1a')]=qs[_0xdfa9('0x1a')](_0x46139b[_0xdfa9('0x30')]['limit']);_0x493e91[_0xdfa9('0x17')]=qs[_0xdfa9('0x17')](_0x46139b[_0xdfa9('0x30')][_0xdfa9('0x17')]);}return _0x470c95['getFields'](_0x493e91);}})[_0xdfa9('0x21')](function(_0x2d251b){if(_0x2d251b){return _0x2d251b?{'count':_0x2c21f6,'rows':_0x2d251b}:null;}})[_0xdfa9('0x21')](respondWithResult(_0x6cff7f,null))[_0xdfa9('0x40')](handleError(_0x6cff7f,null));};exports[_0xdfa9('0x4c')]=function(_0x32d1a4,_0x4210dc,_0x22b284){var _0x150a09={};var _0x2595f2={};var _0x841ec5;var _0x2404f0;return db[_0xdfa9('0x2a')][_0xdfa9('0x47')]({'where':{'id':_0x32d1a4['params']['id']}})[_0xdfa9('0x21')](handleEntityNotFound(_0x4210dc,null))[_0xdfa9('0x21')](function(_0x693d54){if(_0x693d54){_0x841ec5=_0x693d54;_0x2595f2['model']=_[_0xdfa9('0x31')](db[_0xdfa9('0x48')][_0xdfa9('0x2b')]);_0x2595f2[_0xdfa9('0x30')]=_['keys'](_0x32d1a4['query']);_0x2595f2[_0xdfa9('0x38')]=_[_0xdfa9('0x32')](_0x2595f2[_0xdfa9('0x2f')],_0x2595f2['query']);_0x150a09['attributes']=_[_0xdfa9('0x32')](_0x2595f2[_0xdfa9('0x2f')],qs[_0xdfa9('0x34')](_0x32d1a4[_0xdfa9('0x30')][_0xdfa9('0x34')]));_0x150a09[_0xdfa9('0x33')]=_0x150a09['attributes'][_0xdfa9('0x35')]?_0x150a09['attributes']:_0x2595f2['model'];_0x150a09['order']=qs[_0xdfa9('0x37')](_0x32d1a4[_0xdfa9('0x30')][_0xdfa9('0x37')]);_0x150a09[_0xdfa9('0x39')]=qs[_0xdfa9('0x38')](_[_0xdfa9('0x4d')](_0x32d1a4['query'],_0x2595f2[_0xdfa9('0x38')]));if(_0x32d1a4[_0xdfa9('0x30')][_0xdfa9('0x4a')]){_0x150a09['where']=_[_0xdfa9('0x3a')](_0x150a09[_0xdfa9('0x39')],{'$or':_[_0xdfa9('0x29')](_0x150a09[_0xdfa9('0x33')],function(_0x40384c){var _0x34cfff={};_0x34cfff[_0x40384c]={'$like':'%'+_0x32d1a4[_0xdfa9('0x30')]['filter']+'%'};return _0x34cfff;})});}_0x150a09=_[_0xdfa9('0x3a')]({},_0x150a09,_0x32d1a4['options']);return _0x841ec5[_0xdfa9('0x4c')](_0x150a09);}})[_0xdfa9('0x21')](function(_0x177030){if(_0x177030){_0x2404f0=_0x177030[_0xdfa9('0x35')];if(!_0x32d1a4[_0xdfa9('0x30')]['hasOwnProperty'](_0xdfa9('0x36'))){_0x150a09[_0xdfa9('0x1a')]=qs[_0xdfa9('0x1a')](_0x32d1a4[_0xdfa9('0x30')][_0xdfa9('0x1a')]);_0x150a09[_0xdfa9('0x17')]=qs[_0xdfa9('0x17')](_0x32d1a4[_0xdfa9('0x30')][_0xdfa9('0x17')]);}return _0x841ec5['getSubjects'](_0x150a09);}})[_0xdfa9('0x21')](function(_0x2747c0){if(_0x2747c0){return _0x2747c0?{'count':_0x2404f0,'rows':_0x2747c0}:null;}})['then'](respondWithResult(_0x4210dc,null))[_0xdfa9('0x40')](handleError(_0x4210dc,null));};exports[_0xdfa9('0x4e')]=function(_0x58a3a2,_0x462e66,_0x4dd97d){var _0x170a18={};var _0x4c400e={};var _0x29b73a;var _0x4ad1b7;return db[_0xdfa9('0x2a')][_0xdfa9('0x47')]({'where':{'id':_0x58a3a2[_0xdfa9('0x41')]['id']}})['then'](handleEntityNotFound(_0x462e66,null))[_0xdfa9('0x21')](function(_0xae2932){if(_0xae2932){_0x29b73a=_0xae2932;_0x4c400e[_0xdfa9('0x2f')]=_[_0xdfa9('0x31')](db[_0xdfa9('0x48')]['rawAttributes']);_0x4c400e[_0xdfa9('0x30')]=_[_0xdfa9('0x31')](_0x58a3a2['query']);_0x4c400e[_0xdfa9('0x38')]=_[_0xdfa9('0x32')](_0x4c400e[_0xdfa9('0x2f')],_0x4c400e[_0xdfa9('0x30')]);_0x170a18[_0xdfa9('0x33')]=_['intersection'](_0x4c400e[_0xdfa9('0x2f')],qs[_0xdfa9('0x34')](_0x58a3a2['query'][_0xdfa9('0x34')]));_0x170a18['attributes']=_0x170a18['attributes']['length']?_0x170a18[_0xdfa9('0x33')]:_0x4c400e[_0xdfa9('0x2f')];_0x170a18[_0xdfa9('0x49')]=qs[_0xdfa9('0x37')](_0x58a3a2[_0xdfa9('0x30')][_0xdfa9('0x37')]);_0x170a18[_0xdfa9('0x39')]=qs[_0xdfa9('0x38')](_[_0xdfa9('0x4d')](_0x58a3a2[_0xdfa9('0x30')],_0x4c400e[_0xdfa9('0x38')]));if(_0x58a3a2[_0xdfa9('0x30')][_0xdfa9('0x4a')]){_0x170a18['where']=_[_0xdfa9('0x3a')](_0x170a18[_0xdfa9('0x39')],{'$or':_[_0xdfa9('0x29')](_0x170a18[_0xdfa9('0x33')],function(_0x27e221){var _0x300413={};_0x300413[_0x27e221]={'$like':'%'+_0x58a3a2[_0xdfa9('0x30')]['filter']+'%'};return _0x300413;})});}_0x170a18=_[_0xdfa9('0x3a')]({},_0x170a18,_0x58a3a2['options']);return _0x29b73a['getDescriptions'](_0x170a18);}})[_0xdfa9('0x21')](function(_0xbc4c64){if(_0xbc4c64){_0x4ad1b7=_0xbc4c64[_0xdfa9('0x35')];if(!_0x58a3a2[_0xdfa9('0x30')]['hasOwnProperty']('nolimit')){_0x170a18[_0xdfa9('0x1a')]=qs[_0xdfa9('0x1a')](_0x58a3a2['query'][_0xdfa9('0x1a')]);_0x170a18['offset']=qs[_0xdfa9('0x17')](_0x58a3a2[_0xdfa9('0x30')][_0xdfa9('0x17')]);}return _0x29b73a[_0xdfa9('0x4e')](_0x170a18);}})[_0xdfa9('0x21')](function(_0x52fbc9){if(_0x52fbc9){return _0x52fbc9?{'count':_0x4ad1b7,'rows':_0x52fbc9}:null;}})[_0xdfa9('0x21')](respondWithResult(_0x462e66,null))['catch'](handleError(_0x462e66,null));}; \ No newline at end of file +var _0x90be=['key','query','keys','filters','model','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','VtigerConfiguration','find','create','body','findOne','VtigerField','rawAttributes','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','map','fieldName','type'];(function(_0x9f723,_0x53b4b4){var _0x2b10a4=function(_0x416281){while(--_0x416281){_0x9f723['push'](_0x9f723['shift']());}};_0x2b10a4(++_0x53b4b4);}(_0x90be,0x15f));var _0xe90b=function(_0x4ae72f,_0x15afe4){_0x4ae72f=_0x4ae72f-0x0;var _0x259011=_0x90be[_0x4ae72f];return _0x259011;};'use strict';var emlformat=require(_0xe90b('0x0'));var rimraf=require(_0xe90b('0x1'));var zipdir=require(_0xe90b('0x2'));var jsonpatch=require(_0xe90b('0x3'));var rp=require(_0xe90b('0x4'));var moment=require('moment');var BPromise=require(_0xe90b('0x5'));var Mustache=require(_0xe90b('0x6'));var util=require(_0xe90b('0x7'));var path=require('path');var sox=require(_0xe90b('0x8'));var csv=require(_0xe90b('0x9'));var ejs=require(_0xe90b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe90b('0xb'));var squel=require('squel');var crypto=require(_0xe90b('0xc'));var jsforce=require(_0xe90b('0xd'));var deskjs=require(_0xe90b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe90b('0xf'));var Redis=require(_0xe90b('0x10'));var authService=require(_0xe90b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe90b('0x12'));var hardwareService=require(_0xe90b('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xe90b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe90b('0x15'));var db=require(_0xe90b('0x16'))['db'];function respondWithStatusCode(_0x232d45,_0xdd2d34){_0xdd2d34=_0xdd2d34||0xcc;return function(_0x1fceec){if(_0x1fceec){return _0x232d45[_0xe90b('0x17')](_0xdd2d34);}return _0x232d45[_0xe90b('0x18')](_0xdd2d34)[_0xe90b('0x19')]();};}function respondWithResult(_0x1bd2da,_0x3a5f7b){_0x3a5f7b=_0x3a5f7b||0xc8;return function(_0x253211){if(_0x253211){return _0x1bd2da[_0xe90b('0x18')](_0x3a5f7b)['json'](_0x253211);}};}function respondWithFilteredResult(_0x54b806,_0x59c376){return function(_0x2bc188){if(_0x2bc188){var _0x389744=typeof _0x59c376[_0xe90b('0x1a')]==='undefined'&&typeof _0x59c376['limit']===_0xe90b('0x1b');var _0x3c4872=_0x2bc188[_0xe90b('0x1c')];var _0x169486=_0x389744?0x0:_0x59c376[_0xe90b('0x1a')];var _0x3b9cf0=_0x389744?_0x2bc188['count']:_0x59c376['offset']+_0x59c376[_0xe90b('0x1d')];var _0x5edbb2;if(_0x3b9cf0>=_0x3c4872){_0x3b9cf0=_0x3c4872;_0x5edbb2=0xc8;}else{_0x5edbb2=0xce;}_0x54b806[_0xe90b('0x18')](_0x5edbb2);return _0x54b806[_0xe90b('0x1e')](_0xe90b('0x1f'),_0x169486+'-'+_0x3b9cf0+'/'+_0x3c4872)[_0xe90b('0x20')](_0x2bc188);}return null;};}function patchUpdates(_0x180a99){return function(_0x5422e3){try{jsonpatch[_0xe90b('0x21')](_0x5422e3,_0x180a99,!![]);}catch(_0x3c0e55){return BPromise[_0xe90b('0x22')](_0x3c0e55);}return _0x5422e3[_0xe90b('0x23')]();};}function saveUpdates(_0x1346e0,_0x16fe1e){return function(_0x195a25){if(_0x195a25){return _0x195a25[_0xe90b('0x24')](_0x1346e0)[_0xe90b('0x25')](function(_0x5a0e14){return _0x5a0e14;});}return null;};}function removeEntity(_0x234a55,_0x3d1a61){return function(_0x478bd0){if(_0x478bd0){return _0x478bd0[_0xe90b('0x26')]()[_0xe90b('0x25')](function(){_0x234a55['status'](0xcc)[_0xe90b('0x19')]();});}};}function handleEntityNotFound(_0x403935,_0x5714c8){return function(_0x4f69b2){if(!_0x4f69b2){_0x403935[_0xe90b('0x17')](0x194);}return _0x4f69b2;};}function handleError(_0x3aed7f,_0x3f42e9){_0x3f42e9=_0x3f42e9||0x1f4;return function(_0x52d033){logger['error'](_0x52d033[_0xe90b('0x27')]);if(_0x52d033[_0xe90b('0x28')]){delete _0x52d033[_0xe90b('0x28')];}_0x3aed7f['status'](_0x3f42e9)['send'](_0x52d033);};}exports['index']=function(_0xb3cc33,_0x2669be){var _0x2a2d87={},_0x581504={},_0x1f5e51={'count':0x0,'rows':[]};var _0x2a2fe4=_[_0xe90b('0x29')](db['VtigerConfiguration']['rawAttributes'],function(_0x41f975){return{'name':_0x41f975[_0xe90b('0x2a')],'type':_0x41f975[_0xe90b('0x2b')][_0xe90b('0x2c')]};});_0x581504['model']=_[_0xe90b('0x29')](_0x2a2fe4,_0xe90b('0x28'));_0x581504[_0xe90b('0x2d')]=_[_0xe90b('0x2e')](_0xb3cc33['query']);_0x581504[_0xe90b('0x2f')]=_['intersection'](_0x581504[_0xe90b('0x30')],_0x581504[_0xe90b('0x2d')]);_0x2a2d87['attributes']=_[_0xe90b('0x31')](_0x581504[_0xe90b('0x30')],qs['fields'](_0xb3cc33[_0xe90b('0x2d')][_0xe90b('0x32')]));_0x2a2d87['attributes']=_0x2a2d87['attributes'][_0xe90b('0x33')]?_0x2a2d87[_0xe90b('0x34')]:_0x581504[_0xe90b('0x30')];if(!_0xb3cc33[_0xe90b('0x2d')][_0xe90b('0x35')](_0xe90b('0x36'))){_0x2a2d87['limit']=qs['limit'](_0xb3cc33[_0xe90b('0x2d')][_0xe90b('0x1d')]);_0x2a2d87[_0xe90b('0x1a')]=qs['offset'](_0xb3cc33[_0xe90b('0x2d')]['offset']);}_0x2a2d87[_0xe90b('0x37')]=qs[_0xe90b('0x38')](_0xb3cc33['query'][_0xe90b('0x38')]);_0x2a2d87[_0xe90b('0x39')]=qs[_0xe90b('0x2f')](_[_0xe90b('0x3a')](_0xb3cc33[_0xe90b('0x2d')],_0x581504[_0xe90b('0x2f')]),_0x2a2fe4);if(_0xb3cc33['query'][_0xe90b('0x3b')]){_0x2a2d87[_0xe90b('0x39')]=_[_0xe90b('0x3c')](_0x2a2d87[_0xe90b('0x39')],{'$or':_[_0xe90b('0x29')](_0x2a2fe4,function(_0xede986){if(_0xede986[_0xe90b('0x2b')]!==_0xe90b('0x3d')){var _0x3d6e03={};_0x3d6e03[_0xede986[_0xe90b('0x28')]]={'$like':'%'+_0xb3cc33[_0xe90b('0x2d')]['filter']+'%'};return _0x3d6e03;}})});}_0x2a2d87=_[_0xe90b('0x3c')]({},_0x2a2d87,_0xb3cc33[_0xe90b('0x3e')]);var _0x1b6c34={'where':_0x2a2d87[_0xe90b('0x39')]};return db['VtigerConfiguration'][_0xe90b('0x1c')](_0x1b6c34)[_0xe90b('0x25')](function(_0x1f3858){_0x1f5e51['count']=_0x1f3858;if(_0xb3cc33[_0xe90b('0x2d')][_0xe90b('0x3f')]){_0x2a2d87[_0xe90b('0x40')]=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x2a2d87);})['then'](function(_0x141aa5){_0x1f5e51[_0xe90b('0x41')]=_0x141aa5;return _0x1f5e51;})['then'](respondWithFilteredResult(_0x2669be,_0x2a2d87))[_0xe90b('0x42')](handleError(_0x2669be,null));};exports[_0xe90b('0x43')]=function(_0x3ed0c7,_0x47bda6){var _0x45b749={'raw':![],'where':{'id':_0x3ed0c7[_0xe90b('0x44')]['id']}},_0x3c9629={};_0x3c9629[_0xe90b('0x30')]=_[_0xe90b('0x2e')](db[_0xe90b('0x45')]['rawAttributes']);_0x3c9629['query']=_[_0xe90b('0x2e')](_0x3ed0c7[_0xe90b('0x2d')]);_0x3c9629[_0xe90b('0x2f')]=_['intersection'](_0x3c9629[_0xe90b('0x30')],_0x3c9629[_0xe90b('0x2d')]);_0x45b749[_0xe90b('0x34')]=_['intersection'](_0x3c9629[_0xe90b('0x30')],qs['fields'](_0x3ed0c7[_0xe90b('0x2d')]['fields']));_0x45b749[_0xe90b('0x34')]=_0x45b749[_0xe90b('0x34')][_0xe90b('0x33')]?_0x45b749['attributes']:_0x3c9629[_0xe90b('0x30')];if(_0x3ed0c7[_0xe90b('0x2d')]['includeAll']){_0x45b749[_0xe90b('0x40')]=[{'all':!![]}];}_0x45b749=_[_0xe90b('0x3c')]({},_0x45b749,_0x3ed0c7['options']);return db[_0xe90b('0x45')][_0xe90b('0x46')](_0x45b749)[_0xe90b('0x25')](handleEntityNotFound(_0x47bda6,null))[_0xe90b('0x25')](respondWithResult(_0x47bda6,null))[_0xe90b('0x42')](handleError(_0x47bda6,null));};exports['create']=function(_0x38cf76,_0x5f1321){return db[_0xe90b('0x45')][_0xe90b('0x47')](_0x38cf76[_0xe90b('0x48')],{})[_0xe90b('0x25')](respondWithResult(_0x5f1321,0xc9))['catch'](handleError(_0x5f1321,null));};exports[_0xe90b('0x24')]=function(_0x85c0f2,_0x474613){if(_0x85c0f2[_0xe90b('0x48')]['id']){delete _0x85c0f2['body']['id'];}return db[_0xe90b('0x45')]['find']({'where':{'id':_0x85c0f2[_0xe90b('0x44')]['id']}})[_0xe90b('0x25')](handleEntityNotFound(_0x474613,null))[_0xe90b('0x25')](saveUpdates(_0x85c0f2[_0xe90b('0x48')],null))['then'](respondWithResult(_0x474613,null))['catch'](handleError(_0x474613,null));};exports[_0xe90b('0x26')]=function(_0x42f823,_0x85d7a3){return db[_0xe90b('0x45')][_0xe90b('0x46')]({'where':{'id':_0x42f823[_0xe90b('0x44')]['id']}})['then'](handleEntityNotFound(_0x85d7a3,null))['then'](removeEntity(_0x85d7a3,null))['catch'](handleError(_0x85d7a3,null));};exports['getFields']=function(_0x48c9c0,_0x472cc1,_0x4b684d){var _0x44e696={};var _0x34a9fb={};var _0x1c823e;var _0xf77ac2;return db[_0xe90b('0x45')][_0xe90b('0x49')]({'where':{'id':_0x48c9c0['params']['id']}})[_0xe90b('0x25')](handleEntityNotFound(_0x472cc1,null))['then'](function(_0x1602ae){if(_0x1602ae){_0x1c823e=_0x1602ae;_0x34a9fb[_0xe90b('0x30')]=_[_0xe90b('0x2e')](db[_0xe90b('0x4a')][_0xe90b('0x4b')]);_0x34a9fb[_0xe90b('0x2d')]=_[_0xe90b('0x2e')](_0x48c9c0[_0xe90b('0x2d')]);_0x34a9fb[_0xe90b('0x2f')]=_[_0xe90b('0x31')](_0x34a9fb[_0xe90b('0x30')],_0x34a9fb[_0xe90b('0x2d')]);_0x44e696[_0xe90b('0x34')]=_['intersection'](_0x34a9fb[_0xe90b('0x30')],qs[_0xe90b('0x32')](_0x48c9c0['query'][_0xe90b('0x32')]));_0x44e696[_0xe90b('0x34')]=_0x44e696[_0xe90b('0x34')][_0xe90b('0x33')]?_0x44e696[_0xe90b('0x34')]:_0x34a9fb[_0xe90b('0x30')];_0x44e696[_0xe90b('0x37')]=qs[_0xe90b('0x38')](_0x48c9c0[_0xe90b('0x2d')][_0xe90b('0x38')]);_0x44e696[_0xe90b('0x39')]=qs[_0xe90b('0x2f')](_[_0xe90b('0x3a')](_0x48c9c0[_0xe90b('0x2d')],_0x34a9fb['filters']));if(_0x48c9c0[_0xe90b('0x2d')]['filter']){_0x44e696[_0xe90b('0x39')]=_[_0xe90b('0x3c')](_0x44e696[_0xe90b('0x39')],{'$or':_['map'](_0x44e696[_0xe90b('0x34')],function(_0x164961){var _0x28a324={};_0x28a324[_0x164961]={'$like':'%'+_0x48c9c0[_0xe90b('0x2d')][_0xe90b('0x3b')]+'%'};return _0x28a324;})});}_0x44e696=_['merge']({},_0x44e696,_0x48c9c0['options']);return _0x1c823e['getFields'](_0x44e696);}})['then'](function(_0x10d5fe){if(_0x10d5fe){_0xf77ac2=_0x10d5fe[_0xe90b('0x33')];if(!_0x48c9c0[_0xe90b('0x2d')]['hasOwnProperty'](_0xe90b('0x36'))){_0x44e696['limit']=qs[_0xe90b('0x1d')](_0x48c9c0['query'][_0xe90b('0x1d')]);_0x44e696[_0xe90b('0x1a')]=qs[_0xe90b('0x1a')](_0x48c9c0[_0xe90b('0x2d')][_0xe90b('0x1a')]);}return _0x1c823e[_0xe90b('0x4c')](_0x44e696);}})['then'](function(_0x56ed5f){if(_0x56ed5f){return _0x56ed5f?{'count':_0xf77ac2,'rows':_0x56ed5f}:null;}})[_0xe90b('0x25')](respondWithResult(_0x472cc1,null))[_0xe90b('0x42')](handleError(_0x472cc1,null));};exports[_0xe90b('0x4d')]=function(_0x460c9a,_0x3670bc,_0x4310ab){var _0x22902d={};var _0x47a8f1={};var _0x3e60cc;var _0x520fc2;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x460c9a[_0xe90b('0x44')]['id']}})['then'](handleEntityNotFound(_0x3670bc,null))[_0xe90b('0x25')](function(_0xa95528){if(_0xa95528){_0x3e60cc=_0xa95528;_0x47a8f1[_0xe90b('0x30')]=_[_0xe90b('0x2e')](db[_0xe90b('0x4a')][_0xe90b('0x4b')]);_0x47a8f1[_0xe90b('0x2d')]=_[_0xe90b('0x2e')](_0x460c9a[_0xe90b('0x2d')]);_0x47a8f1[_0xe90b('0x2f')]=_['intersection'](_0x47a8f1[_0xe90b('0x30')],_0x47a8f1[_0xe90b('0x2d')]);_0x22902d[_0xe90b('0x34')]=_['intersection'](_0x47a8f1[_0xe90b('0x30')],qs['fields'](_0x460c9a['query']['fields']));_0x22902d[_0xe90b('0x34')]=_0x22902d['attributes'][_0xe90b('0x33')]?_0x22902d[_0xe90b('0x34')]:_0x47a8f1['model'];_0x22902d[_0xe90b('0x37')]=qs[_0xe90b('0x38')](_0x460c9a['query'][_0xe90b('0x38')]);_0x22902d[_0xe90b('0x39')]=qs[_0xe90b('0x2f')](_[_0xe90b('0x3a')](_0x460c9a[_0xe90b('0x2d')],_0x47a8f1[_0xe90b('0x2f')]));if(_0x460c9a[_0xe90b('0x2d')][_0xe90b('0x3b')]){_0x22902d[_0xe90b('0x39')]=_['merge'](_0x22902d[_0xe90b('0x39')],{'$or':_[_0xe90b('0x29')](_0x22902d[_0xe90b('0x34')],function(_0x19f94b){var _0x4d05d7={};_0x4d05d7[_0x19f94b]={'$like':'%'+_0x460c9a['query'][_0xe90b('0x3b')]+'%'};return _0x4d05d7;})});}_0x22902d=_[_0xe90b('0x3c')]({},_0x22902d,_0x460c9a['options']);return _0x3e60cc[_0xe90b('0x4d')](_0x22902d);}})[_0xe90b('0x25')](function(_0x18e5a6){if(_0x18e5a6){_0x520fc2=_0x18e5a6[_0xe90b('0x33')];if(!_0x460c9a['query'][_0xe90b('0x35')]('nolimit')){_0x22902d[_0xe90b('0x1d')]=qs['limit'](_0x460c9a[_0xe90b('0x2d')][_0xe90b('0x1d')]);_0x22902d['offset']=qs[_0xe90b('0x1a')](_0x460c9a[_0xe90b('0x2d')][_0xe90b('0x1a')]);}return _0x3e60cc[_0xe90b('0x4d')](_0x22902d);}})[_0xe90b('0x25')](function(_0x34f792){if(_0x34f792){return _0x34f792?{'count':_0x520fc2,'rows':_0x34f792}:null;}})[_0xe90b('0x25')](respondWithResult(_0x3670bc,null))[_0xe90b('0x42')](handleError(_0x3670bc,null));};exports[_0xe90b('0x4e')]=function(_0x6f86a0,_0xf7f2,_0x3a8c31){var _0x111e89={};var _0x1e03a4={};var _0x4b4491;var _0x302036;return db[_0xe90b('0x45')]['findOne']({'where':{'id':_0x6f86a0[_0xe90b('0x44')]['id']}})[_0xe90b('0x25')](handleEntityNotFound(_0xf7f2,null))[_0xe90b('0x25')](function(_0x1bd150){if(_0x1bd150){_0x4b4491=_0x1bd150;_0x1e03a4[_0xe90b('0x30')]=_[_0xe90b('0x2e')](db[_0xe90b('0x4a')][_0xe90b('0x4b')]);_0x1e03a4[_0xe90b('0x2d')]=_[_0xe90b('0x2e')](_0x6f86a0[_0xe90b('0x2d')]);_0x1e03a4[_0xe90b('0x2f')]=_[_0xe90b('0x31')](_0x1e03a4['model'],_0x1e03a4[_0xe90b('0x2d')]);_0x111e89[_0xe90b('0x34')]=_[_0xe90b('0x31')](_0x1e03a4[_0xe90b('0x30')],qs['fields'](_0x6f86a0[_0xe90b('0x2d')][_0xe90b('0x32')]));_0x111e89[_0xe90b('0x34')]=_0x111e89['attributes'][_0xe90b('0x33')]?_0x111e89['attributes']:_0x1e03a4[_0xe90b('0x30')];_0x111e89['order']=qs[_0xe90b('0x38')](_0x6f86a0['query'][_0xe90b('0x38')]);_0x111e89[_0xe90b('0x39')]=qs[_0xe90b('0x2f')](_[_0xe90b('0x3a')](_0x6f86a0[_0xe90b('0x2d')],_0x1e03a4[_0xe90b('0x2f')]));if(_0x6f86a0['query']['filter']){_0x111e89['where']=_[_0xe90b('0x3c')](_0x111e89[_0xe90b('0x39')],{'$or':_[_0xe90b('0x29')](_0x111e89[_0xe90b('0x34')],function(_0x4a4b2b){var _0x4b5b9f={};_0x4b5b9f[_0x4a4b2b]={'$like':'%'+_0x6f86a0[_0xe90b('0x2d')][_0xe90b('0x3b')]+'%'};return _0x4b5b9f;})});}_0x111e89=_[_0xe90b('0x3c')]({},_0x111e89,_0x6f86a0[_0xe90b('0x3e')]);return _0x4b4491[_0xe90b('0x4e')](_0x111e89);}})[_0xe90b('0x25')](function(_0x2613dc){if(_0x2613dc){_0x302036=_0x2613dc[_0xe90b('0x33')];if(!_0x6f86a0[_0xe90b('0x2d')][_0xe90b('0x35')](_0xe90b('0x36'))){_0x111e89[_0xe90b('0x1d')]=qs[_0xe90b('0x1d')](_0x6f86a0['query'][_0xe90b('0x1d')]);_0x111e89[_0xe90b('0x1a')]=qs['offset'](_0x6f86a0[_0xe90b('0x2d')][_0xe90b('0x1a')]);}return _0x4b4491[_0xe90b('0x4e')](_0x111e89);}})[_0xe90b('0x25')](function(_0x4e7e24){if(_0x4e7e24){return _0x4e7e24?{'count':_0x302036,'rows':_0x4e7e24}:null;}})[_0xe90b('0x25')](respondWithResult(_0xf7f2,null))[_0xe90b('0x42')](handleError(_0xf7f2,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index cb51036..1a9d40d 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 _0xe3c7=['request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x113876,_0x2d243d){var _0x3da554=function(_0x4df645){while(--_0x4df645){_0x113876['push'](_0x113876['shift']());}};_0x3da554(++_0x2d243d);}(_0xe3c7,0x9f));var _0x7e3c=function(_0xf5c66c,_0x2b59be){_0xf5c66c=_0xf5c66c-0x0;var _0x4cf978=_0xe3c7[_0xf5c66c];return _0x4cf978;};'use strict';var _=require(_0x7e3c('0x0'));var util=require(_0x7e3c('0x1'));var logger=require(_0x7e3c('0x2'))(_0x7e3c('0x3'));var moment=require(_0x7e3c('0x4'));var BPromise=require(_0x7e3c('0x5'));var rp=require(_0x7e3c('0x6'));var fs=require('fs');var path=require(_0x7e3c('0x7'));var rimraf=require(_0x7e3c('0x8'));var config=require(_0x7e3c('0x9'));var attributes=require(_0x7e3c('0xa'));module[_0x7e3c('0xb')]=function(_0x5aebc0,_0x50a7a7){return _0x5aebc0[_0x7e3c('0xc')](_0x7e3c('0xd'),attributes,{'tableName':_0x7e3c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd920=['../../config/logger','bluebird','request-promise','path','../../config/environment','define','VtigerConfiguration','int_vtiger_configurations','lodash'];(function(_0x5a68bb,_0xd756b){var _0x559336=function(_0x3bd126){while(--_0x3bd126){_0x5a68bb['push'](_0x5a68bb['shift']());}};_0x559336(++_0xd756b);}(_0xd920,0x1af));var _0x0d92=function(_0x381372,_0xf0a5a){_0x381372=_0x381372-0x0;var _0x4e959a=_0xd920[_0x381372];return _0x4e959a;};'use strict';var _=require(_0x0d92('0x0'));var util=require('util');var logger=require(_0x0d92('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0d92('0x2'));var rp=require(_0x0d92('0x3'));var fs=require('fs');var path=require(_0x0d92('0x4'));var rimraf=require('rimraf');var config=require(_0x0d92('0x5'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x31384e,_0x26a5dd){return _0x31384e[_0x0d92('0x6')](_0x0d92('0x7'),attributes,{'tableName':_0x0d92('0x8'),'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 8541362..9b2f799 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 _0x08a2=['VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug'];(function(_0x3d8ca8,_0x1a9764){var _0x517e45=function(_0x641ad9){while(--_0x641ad9){_0x3d8ca8['push'](_0x3d8ca8['shift']());}};_0x517e45(++_0x1a9764);}(_0x08a2,0x1aa));var _0x208a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x08a2[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x208a('0x0'));var util=require('util');var moment=require(_0x208a('0x1'));var BPromise=require(_0x208a('0x2'));var rs=require(_0x208a('0x3'));var fs=require('fs');var Redis=require(_0x208a('0x4'));var db=require(_0x208a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x208a('0x6'));var config=require(_0x208a('0x7'));var jayson=require(_0x208a('0x8'));var client=jayson[_0x208a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48f61e,_0x30ffb2,_0x2551ce){return new BPromise(function(_0x53913c,_0x35a49b){return client[_0x208a('0xa')](_0x48f61e,_0x2551ce)[_0x208a('0xb')](function(_0x1d4ce8){logger[_0x208a('0xc')](_0x208a('0xd'),_0x30ffb2,'request\x20sent');logger[_0x208a('0xe')](_0x208a('0xf'),_0x30ffb2,_0x208a('0x10'),JSON['stringify'](_0x1d4ce8));if(_0x1d4ce8['error']){if(_0x1d4ce8[_0x208a('0x11')]['code']===0x1f4){logger[_0x208a('0x11')](_0x208a('0xd'),_0x30ffb2,_0x1d4ce8['error'][_0x208a('0x12')]);return _0x35a49b(_0x1d4ce8['error'][_0x208a('0x12')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x30ffb2,_0x1d4ce8['error'][_0x208a('0x12')]);return _0x53913c(_0x1d4ce8[_0x208a('0x11')][_0x208a('0x12')]);}else{logger['info'](_0x208a('0xd'),_0x30ffb2,'request\x20sent');_0x53913c(_0x1d4ce8[_0x208a('0x13')][_0x208a('0x12')]);}})[_0x208a('0x14')](function(_0x173914){logger[_0x208a('0x11')](_0x208a('0xd'),_0x30ffb2,_0x173914);_0x35a49b(_0x173914);});});} \ No newline at end of file +var _0x1a81=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x34a374,_0x4224b2){var _0x4e5f90=function(_0x2ff709){while(--_0x2ff709){_0x34a374['push'](_0x34a374['shift']());}};_0x4e5f90(++_0x4224b2);}(_0x1a81,0x131));var _0x11a8=function(_0x2a7867,_0x5c8949){_0x2a7867=_0x2a7867-0x0;var _0x510fe3=_0x1a81[_0x2a7867];return _0x510fe3;};'use strict';var _=require(_0x11a8('0x0'));var util=require(_0x11a8('0x1'));var moment=require(_0x11a8('0x2'));var BPromise=require(_0x11a8('0x3'));var rs=require(_0x11a8('0x4'));var fs=require('fs');var Redis=require(_0x11a8('0x5'));var db=require(_0x11a8('0x6'))['db'];var utils=require(_0x11a8('0x7'));var logger=require(_0x11a8('0x8'))(_0x11a8('0x9'));var config=require(_0x11a8('0xa'));var jayson=require(_0x11a8('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d22bb,_0x5a1c66,_0x4f62b0){return new BPromise(function(_0x581bbf,_0x1b01db){return client['request'](_0x5d22bb,_0x4f62b0)[_0x11a8('0xc')](function(_0x369e78){logger[_0x11a8('0xd')](_0x11a8('0xe'),_0x5a1c66,_0x11a8('0xf'));logger['debug'](_0x11a8('0x10'),_0x5a1c66,_0x11a8('0xf'),JSON[_0x11a8('0x11')](_0x369e78));if(_0x369e78['error']){if(_0x369e78[_0x11a8('0x12')][_0x11a8('0x13')]===0x1f4){logger[_0x11a8('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x5a1c66,_0x369e78[_0x11a8('0x12')]['message']);return _0x1b01db(_0x369e78['error'][_0x11a8('0x14')]);}logger[_0x11a8('0x12')](_0x11a8('0xe'),_0x5a1c66,_0x369e78[_0x11a8('0x12')][_0x11a8('0x14')]);return _0x581bbf(_0x369e78[_0x11a8('0x12')]['message']);}else{logger[_0x11a8('0xd')](_0x11a8('0xe'),_0x5a1c66,'request\x20sent');_0x581bbf(_0x369e78[_0x11a8('0x15')][_0x11a8('0x14')]);}})[_0x11a8('0x16')](function(_0x536720){logger[_0x11a8('0x12')](_0x11a8('0xe'),_0x5a1c66,_0x536720);_0x1b01db(_0x536720);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 4ff6292..4645639 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 _0xd0ad=['./intVtigerField.controller','get','isAuthenticated','index','/:id','show','update','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd0ad,0xf9));var _0xdd0a=function(_0x5c26c9,_0x4042c2){_0x5c26c9=_0x5c26c9-0x0;var _0x275a15=_0xd0ad[_0x5c26c9];return _0x275a15;};'use strict';var multer=require('multer');var util=require(_0xdd0a('0x0'));var path=require('path');var timeout=require(_0xdd0a('0x1'));var express=require(_0xdd0a('0x2'));var router=express[_0xdd0a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdd0a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdd0a('0x5'));var controller=require(_0xdd0a('0x6'));router[_0xdd0a('0x7')]('/',auth[_0xdd0a('0x8')](),controller[_0xdd0a('0x9')]);router[_0xdd0a('0x7')](_0xdd0a('0xa'),auth['isAuthenticated'](),controller[_0xdd0a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xdd0a('0xa'),auth[_0xdd0a('0x8')](),controller[_0xdd0a('0xc')]);router['delete'](_0xdd0a('0xa'),auth[_0xdd0a('0x8')](),controller[_0xdd0a('0xd')]);module[_0xdd0a('0xe')]=router; \ No newline at end of file +var _0x0c7f=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy'];(function(_0x39d3d9,_0xb00347){var _0x3859a6=function(_0x1a9576){while(--_0x1a9576){_0x39d3d9['push'](_0x39d3d9['shift']());}};_0x3859a6(++_0xb00347);}(_0x0c7f,0x156));var _0xf0c7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0c7f[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0xf0c7('0x0'));var path=require(_0xf0c7('0x1'));var timeout=require('connect-timeout');var express=require(_0xf0c7('0x2'));var router=express[_0xf0c7('0x3')]();var fs_extra=require(_0xf0c7('0x4'));var auth=require(_0xf0c7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf0c7('0x6'));var controller=require(_0xf0c7('0x7'));router[_0xf0c7('0x8')]('/',auth[_0xf0c7('0x9')](),controller[_0xf0c7('0xa')]);router['get'](_0xf0c7('0xb'),auth['isAuthenticated'](),controller[_0xf0c7('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf0c7('0xd')]);router[_0xf0c7('0xe')]('/:id',auth[_0xf0c7('0x9')](),controller[_0xf0c7('0xf')]);router[_0xf0c7('0x10')](_0xf0c7('0xb'),auth[_0xf0c7('0x9')](),controller[_0xf0c7('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 83af48e..d63dd0b 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 _0x4b69=['customVariable','keyValue','picklist','STRING','ENUM','sequelize','exports','string','variable'];(function(_0x52669,_0x412a94){var _0x36a6f2=function(_0x439c5f){while(--_0x439c5f){_0x52669['push'](_0x52669['shift']());}};_0x36a6f2(++_0x412a94);}(_0x4b69,0xdd));var _0x94b6=function(_0x3b3cc6,_0x1a6e24){_0x3b3cc6=_0x3b3cc6-0x0;var _0x1161e4=_0x4b69[_0x3b3cc6];return _0x1161e4;};'use strict';var Sequelize=require(_0x94b6('0x0'));module[_0x94b6('0x1')]={'type':{'type':Sequelize['ENUM'](_0x94b6('0x2'),_0x94b6('0x3'),_0x94b6('0x4'),_0x94b6('0x5'),_0x94b6('0x6')),'defaultValue':_0x94b6('0x2')},'content':{'type':Sequelize[_0x94b6('0x7')]},'key':{'type':Sequelize[_0x94b6('0x7')]},'keyType':{'type':Sequelize[_0x94b6('0x8')](_0x94b6('0x2'),_0x94b6('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x94b6('0x7')]},'idField':{'type':Sequelize[_0x94b6('0x7')]},'nameField':{'type':Sequelize[_0x94b6('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3578=['customVariable','BOOLEAN','exports','string','keyValue','picklist','STRING','ENUM'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x3578,0xda));var _0x8357=function(_0x589f71,_0x212326){_0x589f71=_0x589f71-0x0;var _0x5763bd=_0x3578[_0x589f71];return _0x5763bd;};'use strict';var Sequelize=require('sequelize');module[_0x8357('0x0')]={'type':{'type':Sequelize['ENUM'](_0x8357('0x1'),'variable','customVariable',_0x8357('0x2'),_0x8357('0x3')),'defaultValue':_0x8357('0x1')},'content':{'type':Sequelize[_0x8357('0x4')]},'key':{'type':Sequelize[_0x8357('0x4')]},'keyType':{'type':Sequelize[_0x8357('0x5')]('string','variable',_0x8357('0x6'))},'keyContent':{'type':Sequelize[_0x8357('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8357('0x4')]},'customField':{'type':Sequelize[_0x8357('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8357('0x4')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 9aa2cf8..62953a8 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 _0x5e04=['body','update','find','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','error','stack','name','send','index','VtigerField','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','rows','catch','show','params','includeAll','include','create'];(function(_0x32b122,_0x1ad490){var _0x4ad25a=function(_0x590ee6){while(--_0x590ee6){_0x32b122['push'](_0x32b122['shift']());}};_0x4ad25a(++_0x1ad490);}(_0x5e04,0x1ba));var _0x45e0=function(_0xee8438,_0x261ac6){_0xee8438=_0xee8438-0x0;var _0x251ee8=_0x5e04[_0xee8438];return _0x251ee8;};'use strict';var emlformat=require(_0x45e0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x45e0('0x1'));var jsonpatch=require(_0x45e0('0x2'));var rp=require(_0x45e0('0x3'));var moment=require('moment');var BPromise=require(_0x45e0('0x4'));var Mustache=require(_0x45e0('0x5'));var util=require(_0x45e0('0x6'));var path=require(_0x45e0('0x7'));var sox=require(_0x45e0('0x8'));var csv=require(_0x45e0('0x9'));var ejs=require(_0x45e0('0xa'));var fs=require('fs');var fs_extra=require(_0x45e0('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x45e0('0xc'));var jsforce=require(_0x45e0('0xd'));var deskjs=require(_0x45e0('0xe'));var toCsv=require(_0x45e0('0x9'));var querystring=require('querystring');var Papa=require(_0x45e0('0xf'));var Redis=require(_0x45e0('0x10'));var authService=require(_0x45e0('0x11'));var qs=require(_0x45e0('0x12'));var as=require(_0x45e0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x45e0('0x14'));var licenseUtil=require(_0x45e0('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d9ff6,_0x5dd19a){_0x5dd19a=_0x5dd19a||0xcc;return function(_0x1fdda4){if(_0x1fdda4){return _0x1d9ff6[_0x45e0('0x16')](_0x5dd19a);}return _0x1d9ff6[_0x45e0('0x17')](_0x5dd19a)[_0x45e0('0x18')]();};}function respondWithResult(_0x2cda20,_0x181dc9){_0x181dc9=_0x181dc9||0xc8;return function(_0x34d4d2){if(_0x34d4d2){return _0x2cda20[_0x45e0('0x17')](_0x181dc9)['json'](_0x34d4d2);}};}function respondWithFilteredResult(_0x3a6444,_0x2a4005){return function(_0x28a658){if(_0x28a658){var _0xffa73=typeof _0x2a4005[_0x45e0('0x19')]===_0x45e0('0x1a')&&typeof _0x2a4005['limit']===_0x45e0('0x1a');var _0x15acb5=_0x28a658['count'];var _0x26d26a=_0xffa73?0x0:_0x2a4005[_0x45e0('0x19')];var _0x2ef9f1=_0xffa73?_0x28a658[_0x45e0('0x1b')]:_0x2a4005['offset']+_0x2a4005[_0x45e0('0x1c')];var _0x25a796;if(_0x2ef9f1>=_0x15acb5){_0x2ef9f1=_0x15acb5;_0x25a796=0xc8;}else{_0x25a796=0xce;}_0x3a6444[_0x45e0('0x17')](_0x25a796);return _0x3a6444[_0x45e0('0x1d')](_0x45e0('0x1e'),_0x26d26a+'-'+_0x2ef9f1+'/'+_0x15acb5)[_0x45e0('0x1f')](_0x28a658);}return null;};}function patchUpdates(_0x1a1d8a){return function(_0x1bc465){try{jsonpatch[_0x45e0('0x20')](_0x1bc465,_0x1a1d8a,!![]);}catch(_0x41eda9){return BPromise['reject'](_0x41eda9);}return _0x1bc465[_0x45e0('0x21')]();};}function saveUpdates(_0x119031,_0x144077){return function(_0x1525c5){if(_0x1525c5){return _0x1525c5['update'](_0x119031)[_0x45e0('0x22')](function(_0x46cecb){return _0x46cecb;});}return null;};}function removeEntity(_0x35149f,_0x3f5bf1){return function(_0x26807c){if(_0x26807c){return _0x26807c['destroy']()['then'](function(){_0x35149f[_0x45e0('0x17')](0xcc)[_0x45e0('0x18')]();});}};}function handleEntityNotFound(_0x24b561,_0x38c0f3){return function(_0x5eda17){if(!_0x5eda17){_0x24b561[_0x45e0('0x16')](0x194);}return _0x5eda17;};}function handleError(_0x2bd04b,_0x13bd1c){_0x13bd1c=_0x13bd1c||0x1f4;return function(_0x15e34e){logger[_0x45e0('0x23')](_0x15e34e[_0x45e0('0x24')]);if(_0x15e34e[_0x45e0('0x25')]){delete _0x15e34e[_0x45e0('0x25')];}_0x2bd04b[_0x45e0('0x17')](_0x13bd1c)[_0x45e0('0x26')](_0x15e34e);};}exports[_0x45e0('0x27')]=function(_0x916f8f,_0x37e7c0){var _0x510cba={},_0x4e6640={},_0x3acc2a={'count':0x0,'rows':[]};var _0x1efc17=_['map'](db[_0x45e0('0x28')][_0x45e0('0x29')],function(_0x3b714a){return{'name':_0x3b714a[_0x45e0('0x2a')],'type':_0x3b714a[_0x45e0('0x2b')]['key']};});_0x4e6640[_0x45e0('0x2c')]=_[_0x45e0('0x2d')](_0x1efc17,'name');_0x4e6640[_0x45e0('0x2e')]=_[_0x45e0('0x2f')](_0x916f8f[_0x45e0('0x2e')]);_0x4e6640[_0x45e0('0x30')]=_[_0x45e0('0x31')](_0x4e6640[_0x45e0('0x2c')],_0x4e6640['query']);_0x510cba[_0x45e0('0x32')]=_[_0x45e0('0x31')](_0x4e6640[_0x45e0('0x2c')],qs['fields'](_0x916f8f['query'][_0x45e0('0x33')]));_0x510cba[_0x45e0('0x32')]=_0x510cba['attributes'][_0x45e0('0x34')]?_0x510cba[_0x45e0('0x32')]:_0x4e6640[_0x45e0('0x2c')];if(!_0x916f8f[_0x45e0('0x2e')][_0x45e0('0x35')](_0x45e0('0x36'))){_0x510cba[_0x45e0('0x1c')]=qs[_0x45e0('0x1c')](_0x916f8f[_0x45e0('0x2e')][_0x45e0('0x1c')]);_0x510cba['offset']=qs[_0x45e0('0x19')](_0x916f8f[_0x45e0('0x2e')][_0x45e0('0x19')]);}_0x510cba['order']=qs[_0x45e0('0x37')](_0x916f8f[_0x45e0('0x2e')][_0x45e0('0x37')]);_0x510cba[_0x45e0('0x38')]=qs[_0x45e0('0x30')](_[_0x45e0('0x39')](_0x916f8f['query'],_0x4e6640[_0x45e0('0x30')]),_0x1efc17);if(_0x916f8f[_0x45e0('0x2e')]['filter']){_0x510cba[_0x45e0('0x38')]=_[_0x45e0('0x3a')](_0x510cba[_0x45e0('0x38')],{'$or':_['map'](_0x1efc17,function(_0x583dfd){if(_0x583dfd['type']!==_0x45e0('0x3b')){var _0x1f0189={};_0x1f0189[_0x583dfd[_0x45e0('0x25')]]={'$like':'%'+_0x916f8f[_0x45e0('0x2e')][_0x45e0('0x3c')]+'%'};return _0x1f0189;}})});}_0x510cba=_['merge']({},_0x510cba,_0x916f8f[_0x45e0('0x3d')]);var _0x2b0f2b={'where':_0x510cba[_0x45e0('0x38')]};return db[_0x45e0('0x28')][_0x45e0('0x1b')](_0x2b0f2b)[_0x45e0('0x22')](function(_0x4d819f){_0x3acc2a[_0x45e0('0x1b')]=_0x4d819f;if(_0x916f8f['query']['includeAll']){_0x510cba['include']=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x510cba);})[_0x45e0('0x22')](function(_0x1d5c4c){_0x3acc2a[_0x45e0('0x3e')]=_0x1d5c4c;return _0x3acc2a;})[_0x45e0('0x22')](respondWithFilteredResult(_0x37e7c0,_0x510cba))[_0x45e0('0x3f')](handleError(_0x37e7c0,null));};exports[_0x45e0('0x40')]=function(_0x2671da,_0x498c97){var _0x406dba={'raw':!![],'where':{'id':_0x2671da[_0x45e0('0x41')]['id']}},_0x57c8b8={};_0x57c8b8[_0x45e0('0x2c')]=_[_0x45e0('0x2f')](db[_0x45e0('0x28')][_0x45e0('0x29')]);_0x57c8b8[_0x45e0('0x2e')]=_[_0x45e0('0x2f')](_0x2671da[_0x45e0('0x2e')]);_0x57c8b8['filters']=_[_0x45e0('0x31')](_0x57c8b8[_0x45e0('0x2c')],_0x57c8b8[_0x45e0('0x2e')]);_0x406dba['attributes']=_[_0x45e0('0x31')](_0x57c8b8['model'],qs[_0x45e0('0x33')](_0x2671da[_0x45e0('0x2e')][_0x45e0('0x33')]));_0x406dba['attributes']=_0x406dba[_0x45e0('0x32')][_0x45e0('0x34')]?_0x406dba[_0x45e0('0x32')]:_0x57c8b8['model'];if(_0x2671da['query'][_0x45e0('0x42')]){_0x406dba[_0x45e0('0x43')]=[{'all':!![]}];}_0x406dba=_['merge']({},_0x406dba,_0x2671da[_0x45e0('0x3d')]);return db['VtigerField']['find'](_0x406dba)['then'](handleEntityNotFound(_0x498c97,null))[_0x45e0('0x22')](respondWithResult(_0x498c97,null))['catch'](handleError(_0x498c97,null));};exports[_0x45e0('0x44')]=function(_0x520983,_0x599329){return db[_0x45e0('0x28')][_0x45e0('0x44')](_0x520983[_0x45e0('0x45')],{})['then'](respondWithResult(_0x599329,0xc9))[_0x45e0('0x3f')](handleError(_0x599329,null));};exports[_0x45e0('0x46')]=function(_0x1add9a,_0x247bfa){if(_0x1add9a[_0x45e0('0x45')]['id']){delete _0x1add9a[_0x45e0('0x45')]['id'];}return db[_0x45e0('0x28')][_0x45e0('0x47')]({'where':{'id':_0x1add9a['params']['id']}})[_0x45e0('0x22')](handleEntityNotFound(_0x247bfa,null))[_0x45e0('0x22')](saveUpdates(_0x1add9a[_0x45e0('0x45')],null))['then'](respondWithResult(_0x247bfa,null))['catch'](handleError(_0x247bfa,null));};exports[_0x45e0('0x48')]=function(_0x574d7c,_0x4d4bdf){return db['VtigerField'][_0x45e0('0x47')]({'where':{'id':_0x574d7c[_0x45e0('0x41')]['id']}})['then'](handleEntityNotFound(_0x4d4bdf,null))[_0x45e0('0x22')](removeEntity(_0x4d4bdf,null))[_0x45e0('0x3f')](handleError(_0x4d4bdf,null));}; \ No newline at end of file +var _0xa0c1=['rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','body','find','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','index','map','VtigerField'];(function(_0x2d7e3d,_0x31168f){var _0xcea7e2=function(_0x320c1d){while(--_0x320c1d){_0x2d7e3d['push'](_0x2d7e3d['shift']());}};_0xcea7e2(++_0x31168f);}(_0xa0c1,0x1c6));var _0x1a0c=function(_0x5dc0a5,_0x5c032e){_0x5dc0a5=_0x5dc0a5-0x0;var _0x1b976f=_0xa0c1[_0x5dc0a5];return _0x1b976f;};'use strict';var emlformat=require(_0x1a0c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a0c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a0c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1a0c('0x3'));var util=require(_0x1a0c('0x4'));var path=require(_0x1a0c('0x5'));var sox=require(_0x1a0c('0x6'));var csv=require(_0x1a0c('0x7'));var ejs=require(_0x1a0c('0x8'));var fs=require('fs');var fs_extra=require(_0x1a0c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1a0c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1a0c('0x7'));var querystring=require(_0x1a0c('0xb'));var Papa=require(_0x1a0c('0xc'));var Redis=require(_0x1a0c('0xd'));var authService=require(_0x1a0c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1a0c('0xf'));var hardwareService=require(_0x1a0c('0x10'));var logger=require(_0x1a0c('0x11'))(_0x1a0c('0x12'));var utils=require(_0x1a0c('0x13'));var config=require(_0x1a0c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1a0c('0x15'))['db'];function respondWithStatusCode(_0x158ff9,_0x3f1d82){_0x3f1d82=_0x3f1d82||0xcc;return function(_0x423dec){if(_0x423dec){return _0x158ff9[_0x1a0c('0x16')](_0x3f1d82);}return _0x158ff9[_0x1a0c('0x17')](_0x3f1d82)[_0x1a0c('0x18')]();};}function respondWithResult(_0x475c8b,_0x1f6e7d){_0x1f6e7d=_0x1f6e7d||0xc8;return function(_0x5d50bb){if(_0x5d50bb){return _0x475c8b[_0x1a0c('0x17')](_0x1f6e7d)[_0x1a0c('0x19')](_0x5d50bb);}};}function respondWithFilteredResult(_0x35454b,_0x1a4761){return function(_0x1edf90){if(_0x1edf90){var _0x4c4ef2=typeof _0x1a4761['offset']==='undefined'&&typeof _0x1a4761[_0x1a0c('0x1a')]===_0x1a0c('0x1b');var _0x259401=_0x1edf90[_0x1a0c('0x1c')];var _0x2f0f22=_0x4c4ef2?0x0:_0x1a4761[_0x1a0c('0x1d')];var _0x30f835=_0x4c4ef2?_0x1edf90[_0x1a0c('0x1c')]:_0x1a4761[_0x1a0c('0x1d')]+_0x1a4761[_0x1a0c('0x1a')];var _0x611de1;if(_0x30f835>=_0x259401){_0x30f835=_0x259401;_0x611de1=0xc8;}else{_0x611de1=0xce;}_0x35454b[_0x1a0c('0x17')](_0x611de1);return _0x35454b[_0x1a0c('0x1e')](_0x1a0c('0x1f'),_0x2f0f22+'-'+_0x30f835+'/'+_0x259401)['json'](_0x1edf90);}return null;};}function patchUpdates(_0x3cad30){return function(_0x1844ea){try{jsonpatch[_0x1a0c('0x20')](_0x1844ea,_0x3cad30,!![]);}catch(_0x1581ce){return BPromise[_0x1a0c('0x21')](_0x1581ce);}return _0x1844ea['save']();};}function saveUpdates(_0x1fdb8a,_0x33e8b4){return function(_0xdb4962){if(_0xdb4962){return _0xdb4962[_0x1a0c('0x22')](_0x1fdb8a)['then'](function(_0x24e4f5){return _0x24e4f5;});}return null;};}function removeEntity(_0x2b6936,_0xd0c507){return function(_0x498318){if(_0x498318){return _0x498318[_0x1a0c('0x23')]()[_0x1a0c('0x24')](function(){_0x2b6936['status'](0xcc)[_0x1a0c('0x18')]();});}};}function handleEntityNotFound(_0x3325c0,_0x47f8a1){return function(_0x4733a7){if(!_0x4733a7){_0x3325c0['sendStatus'](0x194);}return _0x4733a7;};}function handleError(_0x1a8d4b,_0x36009c){_0x36009c=_0x36009c||0x1f4;return function(_0x128dd9){logger[_0x1a0c('0x25')](_0x128dd9[_0x1a0c('0x26')]);if(_0x128dd9[_0x1a0c('0x27')]){delete _0x128dd9['name'];}_0x1a8d4b[_0x1a0c('0x17')](_0x36009c)['send'](_0x128dd9);};}exports[_0x1a0c('0x28')]=function(_0x4e05fc,_0x3e7e49){var _0x350165={},_0x1ff82a={},_0x2e804d={'count':0x0,'rows':[]};var _0x36bd5c=_[_0x1a0c('0x29')](db[_0x1a0c('0x2a')][_0x1a0c('0x2b')],function(_0x5abae5){return{'name':_0x5abae5[_0x1a0c('0x2c')],'type':_0x5abae5[_0x1a0c('0x2d')][_0x1a0c('0x2e')]};});_0x1ff82a[_0x1a0c('0x2f')]=_[_0x1a0c('0x29')](_0x36bd5c,_0x1a0c('0x27'));_0x1ff82a[_0x1a0c('0x30')]=_[_0x1a0c('0x31')](_0x4e05fc[_0x1a0c('0x30')]);_0x1ff82a['filters']=_[_0x1a0c('0x32')](_0x1ff82a[_0x1a0c('0x2f')],_0x1ff82a[_0x1a0c('0x30')]);_0x350165[_0x1a0c('0x33')]=_[_0x1a0c('0x32')](_0x1ff82a['model'],qs[_0x1a0c('0x34')](_0x4e05fc['query'][_0x1a0c('0x34')]));_0x350165[_0x1a0c('0x33')]=_0x350165[_0x1a0c('0x33')][_0x1a0c('0x35')]?_0x350165[_0x1a0c('0x33')]:_0x1ff82a[_0x1a0c('0x2f')];if(!_0x4e05fc[_0x1a0c('0x30')][_0x1a0c('0x36')](_0x1a0c('0x37'))){_0x350165[_0x1a0c('0x1a')]=qs['limit'](_0x4e05fc[_0x1a0c('0x30')][_0x1a0c('0x1a')]);_0x350165[_0x1a0c('0x1d')]=qs[_0x1a0c('0x1d')](_0x4e05fc['query'][_0x1a0c('0x1d')]);}_0x350165[_0x1a0c('0x38')]=qs['sort'](_0x4e05fc[_0x1a0c('0x30')][_0x1a0c('0x39')]);_0x350165[_0x1a0c('0x3a')]=qs[_0x1a0c('0x3b')](_['pick'](_0x4e05fc[_0x1a0c('0x30')],_0x1ff82a[_0x1a0c('0x3b')]),_0x36bd5c);if(_0x4e05fc['query'][_0x1a0c('0x3c')]){_0x350165[_0x1a0c('0x3a')]=_['merge'](_0x350165['where'],{'$or':_[_0x1a0c('0x29')](_0x36bd5c,function(_0x1bfd65){if(_0x1bfd65[_0x1a0c('0x2d')]!==_0x1a0c('0x3d')){var _0x24910e={};_0x24910e[_0x1bfd65[_0x1a0c('0x27')]]={'$like':'%'+_0x4e05fc[_0x1a0c('0x30')][_0x1a0c('0x3c')]+'%'};return _0x24910e;}})});}_0x350165=_['merge']({},_0x350165,_0x4e05fc[_0x1a0c('0x3e')]);var _0x3b9644={'where':_0x350165[_0x1a0c('0x3a')]};return db[_0x1a0c('0x2a')][_0x1a0c('0x1c')](_0x3b9644)[_0x1a0c('0x24')](function(_0x5b73f3){_0x2e804d['count']=_0x5b73f3;if(_0x4e05fc[_0x1a0c('0x30')]['includeAll']){_0x350165[_0x1a0c('0x3f')]=[{'all':!![]}];}return db[_0x1a0c('0x2a')][_0x1a0c('0x40')](_0x350165);})[_0x1a0c('0x24')](function(_0x2e0357){_0x2e804d[_0x1a0c('0x41')]=_0x2e0357;return _0x2e804d;})['then'](respondWithFilteredResult(_0x3e7e49,_0x350165))[_0x1a0c('0x42')](handleError(_0x3e7e49,null));};exports['show']=function(_0x2b014c,_0x22bf16){var _0x27aaf0={'raw':!![],'where':{'id':_0x2b014c[_0x1a0c('0x43')]['id']}},_0x9d7e70={};_0x9d7e70[_0x1a0c('0x2f')]=_[_0x1a0c('0x31')](db[_0x1a0c('0x2a')][_0x1a0c('0x2b')]);_0x9d7e70[_0x1a0c('0x30')]=_['keys'](_0x2b014c[_0x1a0c('0x30')]);_0x9d7e70[_0x1a0c('0x3b')]=_['intersection'](_0x9d7e70['model'],_0x9d7e70[_0x1a0c('0x30')]);_0x27aaf0[_0x1a0c('0x33')]=_[_0x1a0c('0x32')](_0x9d7e70['model'],qs[_0x1a0c('0x34')](_0x2b014c['query'][_0x1a0c('0x34')]));_0x27aaf0[_0x1a0c('0x33')]=_0x27aaf0[_0x1a0c('0x33')][_0x1a0c('0x35')]?_0x27aaf0[_0x1a0c('0x33')]:_0x9d7e70[_0x1a0c('0x2f')];if(_0x2b014c[_0x1a0c('0x30')][_0x1a0c('0x44')]){_0x27aaf0['include']=[{'all':!![]}];}_0x27aaf0=_['merge']({},_0x27aaf0,_0x2b014c[_0x1a0c('0x3e')]);return db['VtigerField']['find'](_0x27aaf0)[_0x1a0c('0x24')](handleEntityNotFound(_0x22bf16,null))[_0x1a0c('0x24')](respondWithResult(_0x22bf16,null))[_0x1a0c('0x42')](handleError(_0x22bf16,null));};exports['create']=function(_0x3062b4,_0x5ec084){return db['VtigerField']['create'](_0x3062b4[_0x1a0c('0x45')],{})['then'](respondWithResult(_0x5ec084,0xc9))[_0x1a0c('0x42')](handleError(_0x5ec084,null));};exports[_0x1a0c('0x22')]=function(_0x17e00f,_0x4ece03){if(_0x17e00f[_0x1a0c('0x45')]['id']){delete _0x17e00f['body']['id'];}return db[_0x1a0c('0x2a')]['find']({'where':{'id':_0x17e00f[_0x1a0c('0x43')]['id']}})[_0x1a0c('0x24')](handleEntityNotFound(_0x4ece03,null))[_0x1a0c('0x24')](saveUpdates(_0x17e00f[_0x1a0c('0x45')],null))['then'](respondWithResult(_0x4ece03,null))[_0x1a0c('0x42')](handleError(_0x4ece03,null));};exports[_0x1a0c('0x23')]=function(_0x116b69,_0x3ad17b){return db[_0x1a0c('0x2a')][_0x1a0c('0x46')]({'where':{'id':_0x116b69[_0x1a0c('0x43')]['id']}})[_0x1a0c('0x24')](handleEntityNotFound(_0x3ad17b,null))[_0x1a0c('0x24')](removeEntity(_0x3ad17b,null))[_0x1a0c('0x42')](handleError(_0x3ad17b,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index a42830a..ac43a36 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 _0xfec5=['define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','request-promise','../../config/environment','./intVtigerField.attributes','exports'];(function(_0x242cdb,_0xfe5636){var _0x35708b=function(_0x29e287){while(--_0x29e287){_0x242cdb['push'](_0x242cdb['shift']());}};_0x35708b(++_0xfe5636);}(_0xfec5,0x84));var _0x5fec=function(_0x1d29b2,_0x45ffc6){_0x1d29b2=_0x1d29b2-0x0;var _0x4edc72=_0xfec5[_0x1d29b2];return _0x4edc72;};'use strict';var _=require(_0x5fec('0x0'));var util=require('util');var logger=require(_0x5fec('0x1'))(_0x5fec('0x2'));var moment=require(_0x5fec('0x3'));var BPromise=require('bluebird');var rp=require(_0x5fec('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5fec('0x5'));var attributes=require(_0x5fec('0x6'));module[_0x5fec('0x7')]=function(_0x59404c,_0x363698){return _0x59404c[_0x5fec('0x8')](_0x5fec('0x9'),attributes,{'tableName':_0x5fec('0xa'),'paranoid':![],'indexes':[{'name':_0x5fec('0xb'),'fields':[_0x5fec('0xc'),_0x5fec('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x28dd=['VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x28dd,0x8d));var _0xd28d=function(_0x3b4922,_0x2fa365){_0x3b4922=_0x3b4922-0x0;var _0x239729=_0x28dd[_0x3b4922];return _0x239729;};'use strict';var _=require(_0xd28d('0x0'));var util=require(_0xd28d('0x1'));var logger=require(_0xd28d('0x2'))(_0xd28d('0x3'));var moment=require(_0xd28d('0x4'));var BPromise=require(_0xd28d('0x5'));var rp=require(_0xd28d('0x6'));var fs=require('fs');var path=require(_0xd28d('0x7'));var rimraf=require(_0xd28d('0x8'));var config=require(_0xd28d('0x9'));var attributes=require('./intVtigerField.attributes');module[_0xd28d('0xa')]=function(_0x1debe9,_0x167400){return _0x1debe9[_0xd28d('0xb')](_0xd28d('0xc'),attributes,{'tableName':_0xd28d('0xd'),'paranoid':![],'indexes':[{'name':_0xd28d('0xe'),'fields':[_0xd28d('0xf'),_0xd28d('0x10')],'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 423fa45..5b2d2d4 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 _0x1fbc=['VtigerField,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x4ce038,_0x2a286a){var _0x4f4594=function(_0x2938df){while(--_0x2938df){_0x4ce038['push'](_0x4ce038['shift']());}};_0x4f4594(++_0x2a286a);}(_0x1fbc,0x18a));var _0xc1fb=function(_0x238ce1,_0x554e2f){_0x238ce1=_0x238ce1-0x0;var _0x2334fc=_0x1fbc[_0x238ce1];return _0x2334fc;};'use strict';var _=require(_0xc1fb('0x0'));var util=require(_0xc1fb('0x1'));var moment=require(_0xc1fb('0x2'));var BPromise=require('bluebird');var rs=require(_0xc1fb('0x3'));var fs=require('fs');var Redis=require(_0xc1fb('0x4'));var db=require(_0xc1fb('0x5'))['db'];var utils=require(_0xc1fb('0x6'));var logger=require(_0xc1fb('0x7'))(_0xc1fb('0x8'));var config=require(_0xc1fb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc1fb('0xa')][_0xc1fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1aa22c,_0x32981d,_0x102bf5){return new BPromise(function(_0x33eeb2,_0x394d95){return client[_0xc1fb('0xc')](_0x1aa22c,_0x102bf5)[_0xc1fb('0xd')](function(_0x4af7cf){logger[_0xc1fb('0xe')]('VtigerField,\x20%s,\x20%s',_0x32981d,_0xc1fb('0xf'));logger[_0xc1fb('0x10')](_0xc1fb('0x11'),_0x32981d,_0xc1fb('0xf'),JSON['stringify'](_0x4af7cf));if(_0x4af7cf['error']){if(_0x4af7cf['error'][_0xc1fb('0x12')]===0x1f4){logger[_0xc1fb('0x13')](_0xc1fb('0x14'),_0x32981d,_0x4af7cf['error'][_0xc1fb('0x15')]);return _0x394d95(_0x4af7cf[_0xc1fb('0x13')][_0xc1fb('0x15')]);}logger[_0xc1fb('0x13')](_0xc1fb('0x14'),_0x32981d,_0x4af7cf['error']['message']);return _0x33eeb2(_0x4af7cf[_0xc1fb('0x13')][_0xc1fb('0x15')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x32981d,_0xc1fb('0xf'));_0x33eeb2(_0x4af7cf['result'][_0xc1fb('0x15')]);}})[_0xc1fb('0x16')](function(_0x35b0be){logger[_0xc1fb('0x13')](_0xc1fb('0x14'),_0x32981d,_0x35b0be);_0x394d95(_0x35b0be);});});} \ No newline at end of file +var _0x8030=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x14525d,_0x747b83){var _0x26b05c=function(_0xf98e52){while(--_0xf98e52){_0x14525d['push'](_0x14525d['shift']());}};_0x26b05c(++_0x747b83);}(_0x8030,0x185));var _0x0803=function(_0x115997,_0x328acc){_0x115997=_0x115997-0x0;var _0x4fbe83=_0x8030[_0x115997];return _0x4fbe83;};'use strict';var _=require(_0x0803('0x0'));var util=require(_0x0803('0x1'));var moment=require(_0x0803('0x2'));var BPromise=require('bluebird');var rs=require(_0x0803('0x3'));var fs=require('fs');var Redis=require(_0x0803('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0803('0x5'));var logger=require(_0x0803('0x6'))(_0x0803('0x7'));var config=require(_0x0803('0x8'));var jayson=require(_0x0803('0x9'));var client=jayson[_0x0803('0xa')][_0x0803('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38ff22,_0xdd803a,_0x16b13b){return new BPromise(function(_0x338f47,_0x4cc958){return client['request'](_0x38ff22,_0x16b13b)[_0x0803('0xc')](function(_0x2c7b71){logger[_0x0803('0xd')](_0x0803('0xe'),_0xdd803a,_0x0803('0xf'));logger[_0x0803('0x10')](_0x0803('0x11'),_0xdd803a,_0x0803('0xf'),JSON[_0x0803('0x12')](_0x2c7b71));if(_0x2c7b71[_0x0803('0x13')]){if(_0x2c7b71[_0x0803('0x13')][_0x0803('0x14')]===0x1f4){logger[_0x0803('0x13')]('VtigerField,\x20%s,\x20%s',_0xdd803a,_0x2c7b71[_0x0803('0x13')][_0x0803('0x15')]);return _0x4cc958(_0x2c7b71[_0x0803('0x13')]['message']);}logger[_0x0803('0x13')](_0x0803('0xe'),_0xdd803a,_0x2c7b71[_0x0803('0x13')][_0x0803('0x15')]);return _0x338f47(_0x2c7b71[_0x0803('0x13')][_0x0803('0x15')]);}else{logger['info'](_0x0803('0xe'),_0xdd803a,_0x0803('0xf'));_0x338f47(_0x2c7b71[_0x0803('0x16')][_0x0803('0x15')]);}})[_0x0803('0x17')](function(_0x23f2c4){logger[_0x0803('0x13')](_0x0803('0xe'),_0xdd803a,_0x23f2c4);_0x4cc958(_0x23f2c4);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 21a4e01..cfbcee3 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 _0x49e5=['../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','/:id','show','getConfigurations','get','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x36f243,_0x188505){var _0x426436=function(_0x1c8622){while(--_0x1c8622){_0x36f243['push'](_0x36f243['shift']());}};_0x426436(++_0x188505);}(_0x49e5,0x71));var _0x549e=function(_0x367de9,_0x4bd325){_0x367de9=_0x367de9-0x0;var _0x2ceb12=_0x49e5[_0x367de9];return _0x2ceb12;};'use strict';var multer=require(_0x549e('0x0'));var util=require(_0x549e('0x1'));var path=require(_0x549e('0x2'));var timeout=require(_0x549e('0x3'));var express=require(_0x549e('0x4'));var router=express['Router']();var fs_extra=require(_0x549e('0x5'));var auth=require(_0x549e('0x6'));var interaction=require(_0x549e('0x7'));var config=require(_0x549e('0x8'));var controller=require(_0x549e('0x9'));router['get']('/',auth[_0x549e('0xa')](),controller['index']);router['get'](_0x549e('0xb'),auth[_0x549e('0xa')](),controller[_0x549e('0xc')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0x549e('0xd')]);router[_0x549e('0xe')](_0x549e('0xf'),auth[_0x549e('0xa')](),controller[_0x549e('0x10')]);router[_0x549e('0x11')]('/',auth['isAuthenticated'](),controller[_0x549e('0x12')]);router['post'](_0x549e('0x13'),auth[_0x549e('0xa')](),controller[_0x549e('0x14')]);router['put'](_0x549e('0xb'),auth[_0x549e('0xa')](),controller[_0x549e('0x15')]);router['delete'](_0x549e('0xb'),auth[_0x549e('0xa')](),controller[_0x549e('0x16')]);module[_0x549e('0x17')]=router; \ No newline at end of file +var _0xa935=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','post','addConfiguration','put','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa935,0x8a));var _0x5a93=function(_0x2b10b5,_0x5c1f2e){_0x2b10b5=_0x2b10b5-0x0;var _0x545669=_0xa935[_0x2b10b5];return _0x545669;};'use strict';var multer=require('multer');var util=require(_0x5a93('0x0'));var path=require(_0x5a93('0x1'));var timeout=require(_0x5a93('0x2'));var express=require(_0x5a93('0x3'));var router=express[_0x5a93('0x4')]();var fs_extra=require(_0x5a93('0x5'));var auth=require(_0x5a93('0x6'));var interaction=require(_0x5a93('0x7'));var config=require(_0x5a93('0x8'));var controller=require(_0x5a93('0x9'));router[_0x5a93('0xa')]('/',auth['isAuthenticated'](),controller[_0x5a93('0xb')]);router[_0x5a93('0xa')](_0x5a93('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x5a93('0xa')](_0x5a93('0xd'),auth[_0x5a93('0xe')](),controller[_0x5a93('0xf')]);router[_0x5a93('0xa')](_0x5a93('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0x5a93('0x11')]('/',auth[_0x5a93('0xe')](),controller['create']);router[_0x5a93('0x11')](_0x5a93('0xd'),auth[_0x5a93('0xe')](),controller[_0x5a93('0x12')]);router[_0x5a93('0x13')]('/:id',auth[_0x5a93('0xe')](),controller[_0x5a93('0x14')]);router[_0x5a93('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x5a93('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 15534ec..d5c025a 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 _0xfb11=['remoteUri','ENUM','token','password','integrationTab','newTab','sequelize','STRING','username'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xfb11[_0x25bea7];return _0x175952;};'use strict';var Sequelize=require(_0x1fb1('0x0'));module['exports']={'name':{'type':Sequelize[_0x1fb1('0x1')]},'description':{'type':Sequelize[_0x1fb1('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x1fb1('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x1fb1('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x1fb1('0x3')},'authType':{'type':Sequelize[_0x1fb1('0x4')]('password',_0x1fb1('0x5')),'defaultValue':_0x1fb1('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1fb1('0x4')](_0x1fb1('0x7'),_0x1fb1('0x8')),'defaultValue':_0x1fb1('0x7')}}; \ No newline at end of file +var _0x9e6d=['integrationTab','newTab','sequelize','STRING','remoteUri','password','token','ENUM'];(function(_0x16dcc2,_0x1323f2){var _0x41d2ef=function(_0x4b3085){while(--_0x4b3085){_0x16dcc2['push'](_0x16dcc2['shift']());}};_0x41d2ef(++_0x1323f2);}(_0x9e6d,0x1d2));var _0xd9e6=function(_0xa9d2c9,_0x2a2cea){_0xa9d2c9=_0xa9d2c9-0x0;var _0x2e061a=_0x9e6d[_0xa9d2c9];return _0x2e061a;};'use strict';var Sequelize=require(_0xd9e6('0x0'));module['exports']={'name':{'type':Sequelize[_0xd9e6('0x1')]},'description':{'type':Sequelize[_0xd9e6('0x1')]},'username':{'type':Sequelize[_0xd9e6('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xd9e6('0x1')]},'token':{'type':Sequelize[_0xd9e6('0x1')]},'remoteUri':{'type':Sequelize[_0xd9e6('0x1')],'unique':_0xd9e6('0x2')},'authType':{'type':Sequelize['ENUM'](_0xd9e6('0x3'),_0xd9e6('0x4')),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd9e6('0x5')](_0xd9e6('0x6'),_0xd9e6('0x7')),'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 c5efcb0..0ebcff4 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 _0xae60=['sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','ZendeskAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','find','getConfigurations','findOne','ZendeskConfiguration','order','sort','nolimit','addConfiguration','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','username','password','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','assignee','remove','position','title','custom_field_options','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration'];(function(_0x12f42c,_0x415b84){var _0xbcf616=function(_0x242128){while(--_0x242128){_0x12f42c['push'](_0x12f42c['shift']());}};_0xbcf616(++_0x415b84);}(_0xae60,0x1c7));var _0x0ae6=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xae60[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x0ae6('0x0'));var rimraf=require(_0x0ae6('0x1'));var zipdir=require(_0x0ae6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae6('0x3'));var moment=require(_0x0ae6('0x4'));var BPromise=require(_0x0ae6('0x5'));var Mustache=require('mustache');var util=require(_0x0ae6('0x6'));var path=require(_0x0ae6('0x7'));var sox=require('sox');var csv=require(_0x0ae6('0x8'));var ejs=require(_0x0ae6('0x9'));var fs=require('fs');var fs_extra=require(_0x0ae6('0xa'));var _=require(_0x0ae6('0xb'));var squel=require(_0x0ae6('0xc'));var crypto=require(_0x0ae6('0xd'));var jsforce=require(_0x0ae6('0xe'));var deskjs=require(_0x0ae6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ae6('0x10'));var Papa=require(_0x0ae6('0x11'));var Redis=require(_0x0ae6('0x12'));var authService=require(_0x0ae6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0ae6('0x14'));var hardwareService=require(_0x0ae6('0x15'));var logger=require(_0x0ae6('0x16'))(_0x0ae6('0x17'));var utils=require(_0x0ae6('0x18'));var config=require(_0x0ae6('0x19'));var licenseUtil=require(_0x0ae6('0x1a'));var db=require(_0x0ae6('0x1b'))['db'];var integrations=require(_0x0ae6('0x1c'));function respondWithStatusCode(_0x30f8f9,_0x1aefd5){_0x1aefd5=_0x1aefd5||0xcc;return function(_0xf86cad){if(_0xf86cad){return _0x30f8f9[_0x0ae6('0x1d')](_0x1aefd5);}return _0x30f8f9[_0x0ae6('0x1e')](_0x1aefd5)['end']();};}function respondWithResult(_0x3809c6,_0x10c3bc){_0x10c3bc=_0x10c3bc||0xc8;return function(_0x1c997a){if(_0x1c997a){return _0x3809c6[_0x0ae6('0x1e')](_0x10c3bc)[_0x0ae6('0x1f')](_0x1c997a);}};}function respondWithFilteredResult(_0x3a1e26,_0x151144){return function(_0x3b64ac){if(_0x3b64ac){var _0xa797bb=typeof _0x151144[_0x0ae6('0x20')]===_0x0ae6('0x21')&&typeof _0x151144[_0x0ae6('0x22')]===_0x0ae6('0x21');var _0xd0362c=_0x3b64ac[_0x0ae6('0x23')];var _0x3f5c41=_0xa797bb?0x0:_0x151144[_0x0ae6('0x20')];var _0x1735ba=_0xa797bb?_0x3b64ac[_0x0ae6('0x23')]:_0x151144[_0x0ae6('0x20')]+_0x151144[_0x0ae6('0x22')];var _0x191eaf;if(_0x1735ba>=_0xd0362c){_0x1735ba=_0xd0362c;_0x191eaf=0xc8;}else{_0x191eaf=0xce;}_0x3a1e26['status'](_0x191eaf);return _0x3a1e26[_0x0ae6('0x24')](_0x0ae6('0x25'),_0x3f5c41+'-'+_0x1735ba+'/'+_0xd0362c)[_0x0ae6('0x1f')](_0x3b64ac);}return null;};}function patchUpdates(_0x1027c2){return function(_0x9c4075){try{jsonpatch[_0x0ae6('0x26')](_0x9c4075,_0x1027c2,!![]);}catch(_0x210ca4){return BPromise[_0x0ae6('0x27')](_0x210ca4);}return _0x9c4075['save']();};}function saveUpdates(_0x39b22e,_0x2a6484){return function(_0x2e86e8){if(_0x2e86e8){return _0x2e86e8[_0x0ae6('0x28')](_0x39b22e)[_0x0ae6('0x29')](function(_0x4eba72){return _0x4eba72;});}return null;};}function removeEntity(_0x296a9d,_0x4e1242){return function(_0xccd1c5){if(_0xccd1c5){return _0xccd1c5[_0x0ae6('0x2a')]()[_0x0ae6('0x29')](function(){_0x296a9d[_0x0ae6('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3630e6,_0x2dcdb7){return function(_0x519f17){if(!_0x519f17){_0x3630e6['sendStatus'](0x194);}return _0x519f17;};}function handleError(_0x44eb95,_0x3255a7){_0x3255a7=_0x3255a7||0x1f4;return function(_0x17360e){logger['error'](_0x17360e[_0x0ae6('0x2b')]);if(_0x17360e[_0x0ae6('0x2c')]){delete _0x17360e[_0x0ae6('0x2c')];}_0x44eb95['status'](_0x3255a7)[_0x0ae6('0x2d')](_0x17360e);};}exports[_0x0ae6('0x2e')]=function(_0x449c33,_0x232fbd){var _0x14eed5={},_0x257af5={},_0x4fc7bd={'count':0x0,'rows':[]};var _0x5b2ad6=_[_0x0ae6('0x2f')](db[_0x0ae6('0x30')]['rawAttributes'],function(_0x4a06f1){return{'name':_0x4a06f1[_0x0ae6('0x31')],'type':_0x4a06f1[_0x0ae6('0x32')][_0x0ae6('0x33')]};});_0x257af5[_0x0ae6('0x34')]=_['map'](_0x5b2ad6,_0x0ae6('0x2c'));_0x257af5[_0x0ae6('0x35')]=_[_0x0ae6('0x36')](_0x449c33['query']);_0x257af5[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x257af5[_0x0ae6('0x34')],_0x257af5[_0x0ae6('0x35')]);_0x14eed5[_0x0ae6('0x39')]=_[_0x0ae6('0x38')](_0x257af5[_0x0ae6('0x34')],qs[_0x0ae6('0x3a')](_0x449c33[_0x0ae6('0x35')][_0x0ae6('0x3a')]));_0x14eed5['attributes']=_0x14eed5[_0x0ae6('0x39')][_0x0ae6('0x3b')]?_0x14eed5['attributes']:_0x257af5[_0x0ae6('0x34')];if(!_0x449c33[_0x0ae6('0x35')][_0x0ae6('0x3c')]('nolimit')){_0x14eed5[_0x0ae6('0x22')]=qs['limit'](_0x449c33['query'][_0x0ae6('0x22')]);_0x14eed5[_0x0ae6('0x20')]=qs[_0x0ae6('0x20')](_0x449c33[_0x0ae6('0x35')][_0x0ae6('0x20')]);}_0x14eed5['order']=qs['sort'](_0x449c33[_0x0ae6('0x35')]['sort']);_0x14eed5[_0x0ae6('0x3d')]=qs['filters'](_[_0x0ae6('0x3e')](_0x449c33['query'],_0x257af5[_0x0ae6('0x37')]),_0x5b2ad6);if(_0x449c33[_0x0ae6('0x35')][_0x0ae6('0x3f')]){_0x14eed5[_0x0ae6('0x3d')]=_['merge'](_0x14eed5['where'],{'$or':_[_0x0ae6('0x2f')](_0x5b2ad6,function(_0x34b547){if(_0x34b547[_0x0ae6('0x32')]!=='VIRTUAL'){var _0xaeb354={};_0xaeb354[_0x34b547['name']]={'$like':'%'+_0x449c33[_0x0ae6('0x35')][_0x0ae6('0x3f')]+'%'};return _0xaeb354;}})});}_0x14eed5=_[_0x0ae6('0x40')]({},_0x14eed5,_0x449c33[_0x0ae6('0x41')]);var _0x450f00={'where':_0x14eed5[_0x0ae6('0x3d')]};return db['ZendeskAccount'][_0x0ae6('0x23')](_0x450f00)[_0x0ae6('0x29')](function(_0x24d9ec){_0x4fc7bd[_0x0ae6('0x23')]=_0x24d9ec;if(_0x449c33[_0x0ae6('0x35')][_0x0ae6('0x42')]){_0x14eed5[_0x0ae6('0x43')]=[{'all':!![]}];}return db[_0x0ae6('0x30')]['findAll'](_0x14eed5);})[_0x0ae6('0x29')](function(_0xba3183){_0x4fc7bd[_0x0ae6('0x44')]=_0xba3183;return _0x4fc7bd;})[_0x0ae6('0x29')](respondWithFilteredResult(_0x232fbd,_0x14eed5))[_0x0ae6('0x45')](handleError(_0x232fbd,null));};exports[_0x0ae6('0x46')]=function(_0x24c021,_0x21431e){var _0xb38cbb={'raw':![],'where':{'id':_0x24c021[_0x0ae6('0x47')]['id']}},_0x156841={};_0x156841[_0x0ae6('0x34')]=_[_0x0ae6('0x36')](db[_0x0ae6('0x30')][_0x0ae6('0x48')]);_0x156841[_0x0ae6('0x35')]=_[_0x0ae6('0x36')](_0x24c021[_0x0ae6('0x35')]);_0x156841['filters']=_[_0x0ae6('0x38')](_0x156841[_0x0ae6('0x34')],_0x156841[_0x0ae6('0x35')]);_0xb38cbb[_0x0ae6('0x39')]=_[_0x0ae6('0x38')](_0x156841[_0x0ae6('0x34')],qs['fields'](_0x24c021[_0x0ae6('0x35')][_0x0ae6('0x3a')]));_0xb38cbb[_0x0ae6('0x39')]=_0xb38cbb[_0x0ae6('0x39')]['length']?_0xb38cbb['attributes']:_0x156841['model'];if(_0x24c021[_0x0ae6('0x35')][_0x0ae6('0x42')]){_0xb38cbb[_0x0ae6('0x43')]=[{'all':!![]}];}_0xb38cbb=_['merge']({},_0xb38cbb,_0x24c021[_0x0ae6('0x41')]);return db[_0x0ae6('0x30')]['find'](_0xb38cbb)[_0x0ae6('0x29')](handleEntityNotFound(_0x21431e,null))[_0x0ae6('0x29')](respondWithResult(_0x21431e,null))['catch'](handleError(_0x21431e,null));};exports[_0x0ae6('0x49')]=function(_0x3d1e75,_0x587ab4){return db[_0x0ae6('0x30')][_0x0ae6('0x49')](_0x3d1e75[_0x0ae6('0x4a')],{})['then'](respondWithResult(_0x587ab4,0xc9))[_0x0ae6('0x45')](handleError(_0x587ab4,null));};exports[_0x0ae6('0x28')]=function(_0x46075a,_0x3b1af0){if(_0x46075a[_0x0ae6('0x4a')]['id']){delete _0x46075a[_0x0ae6('0x4a')]['id'];}return db[_0x0ae6('0x30')]['find']({'where':{'id':_0x46075a['params']['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x3b1af0,null))[_0x0ae6('0x29')](saveUpdates(_0x46075a[_0x0ae6('0x4a')],null))['then'](respondWithResult(_0x3b1af0,null))[_0x0ae6('0x45')](handleError(_0x3b1af0,null));};exports['destroy']=function(_0x582a5e,_0x23454a){return db[_0x0ae6('0x30')][_0x0ae6('0x4b')]({'where':{'id':_0x582a5e['params']['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x23454a,null))[_0x0ae6('0x29')](removeEntity(_0x23454a,null))[_0x0ae6('0x45')](handleError(_0x23454a,null));};exports[_0x0ae6('0x4c')]=function(_0x173acd,_0x2e5ea6,_0x9a64b8){var _0x36be39={};var _0x102573={};var _0x117d24;var _0x1cc515;return db[_0x0ae6('0x30')][_0x0ae6('0x4d')]({'where':{'id':_0x173acd[_0x0ae6('0x47')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x2e5ea6,null))['then'](function(_0x4cbe19){if(_0x4cbe19){_0x117d24=_0x4cbe19;_0x102573[_0x0ae6('0x34')]=_[_0x0ae6('0x36')](db[_0x0ae6('0x4e')][_0x0ae6('0x48')]);_0x102573[_0x0ae6('0x35')]=_[_0x0ae6('0x36')](_0x173acd[_0x0ae6('0x35')]);_0x102573[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x102573[_0x0ae6('0x34')],_0x102573[_0x0ae6('0x35')]);_0x36be39[_0x0ae6('0x39')]=_[_0x0ae6('0x38')](_0x102573[_0x0ae6('0x34')],qs[_0x0ae6('0x3a')](_0x173acd[_0x0ae6('0x35')][_0x0ae6('0x3a')]));_0x36be39[_0x0ae6('0x39')]=_0x36be39['attributes'][_0x0ae6('0x3b')]?_0x36be39[_0x0ae6('0x39')]:_0x102573[_0x0ae6('0x34')];_0x36be39[_0x0ae6('0x4f')]=qs[_0x0ae6('0x50')](_0x173acd[_0x0ae6('0x35')][_0x0ae6('0x50')]);_0x36be39[_0x0ae6('0x3d')]=qs[_0x0ae6('0x37')](_[_0x0ae6('0x3e')](_0x173acd['query'],_0x102573[_0x0ae6('0x37')]));if(_0x173acd[_0x0ae6('0x35')][_0x0ae6('0x3f')]){_0x36be39[_0x0ae6('0x3d')]=_[_0x0ae6('0x40')](_0x36be39[_0x0ae6('0x3d')],{'$or':_[_0x0ae6('0x2f')](_0x36be39[_0x0ae6('0x39')],function(_0x1cbada){var _0x59acf0={};_0x59acf0[_0x1cbada]={'$like':'%'+_0x173acd['query'][_0x0ae6('0x3f')]+'%'};return _0x59acf0;})});}_0x36be39=_[_0x0ae6('0x40')]({},_0x36be39,_0x173acd['options']);return _0x117d24['getConfigurations'](_0x36be39);}})[_0x0ae6('0x29')](function(_0x160dcf){if(_0x160dcf){_0x1cc515=_0x160dcf[_0x0ae6('0x3b')];if(!_0x173acd[_0x0ae6('0x35')][_0x0ae6('0x3c')](_0x0ae6('0x51'))){_0x36be39[_0x0ae6('0x22')]=qs['limit'](_0x173acd[_0x0ae6('0x35')]['limit']);_0x36be39[_0x0ae6('0x20')]=qs[_0x0ae6('0x20')](_0x173acd['query'][_0x0ae6('0x20')]);}return _0x117d24[_0x0ae6('0x4c')](_0x36be39);}})[_0x0ae6('0x29')](function(_0x593667){if(_0x593667){return _0x593667?{'count':_0x1cc515,'rows':_0x593667}:null;}})[_0x0ae6('0x29')](respondWithResult(_0x2e5ea6,null))['catch'](handleError(_0x2e5ea6,null));};exports[_0x0ae6('0x52')]=function(_0x2e0a75,_0x19f63f,_0x12c43d){if(_0x2e0a75['body']['id']){delete _0x2e0a75['body']['id'];}return db[_0x0ae6('0x30')][_0x0ae6('0x4d')]({'where':{'id':_0x2e0a75[_0x0ae6('0x47')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x19f63f,null))[_0x0ae6('0x29')](function(_0x2d9f33){if(_0x2d9f33){_0x2e0a75['body']['AccountId']=_0x2d9f33['id'];_0x2e0a75[_0x0ae6('0x4a')][_0x0ae6('0x53')]=integrations[_0x0ae6('0x54')](_0x2e0a75[_0x0ae6('0x4a')][_0x0ae6('0x55')],_0x2e0a75[_0x0ae6('0x4a')][_0x0ae6('0x32')]);_0x2e0a75[_0x0ae6('0x4a')]['Descriptions']=integrations[_0x0ae6('0x56')](_0x2e0a75[_0x0ae6('0x4a')][_0x0ae6('0x55')],_0x2e0a75[_0x0ae6('0x4a')][_0x0ae6('0x32')]);return db[_0x0ae6('0x4e')]['create'](_0x2e0a75['body'],{'include':[{'model':db[_0x0ae6('0x57')],'as':_0x0ae6('0x53')},{'model':db['ZendeskField'],'as':_0x0ae6('0x58')}]});}return null;})[_0x0ae6('0x29')](respondWithResult(_0x19f63f,null))[_0x0ae6('0x45')](handleError(_0x19f63f,null));};exports[_0x0ae6('0x59')]=function(_0x5cd03b,_0x2d9ec4,_0x243e86){var _0x42470='';return db[_0x0ae6('0x30')][_0x0ae6('0x4d')]({'where':{'id':_0x5cd03b[_0x0ae6('0x47')]['id']},'attributes':['id',_0x0ae6('0x5a'),_0x0ae6('0x5b'),'token',_0x0ae6('0x5c'),_0x0ae6('0x5d')]})[_0x0ae6('0x29')](handleEntityNotFound(_0x2d9ec4,null))[_0x0ae6('0x29')](function(_0x206021){if(_0x206021){_0x42470=_0x206021[_0x0ae6('0x5d')];var _0x20032f=_0x42470[_0x0ae6('0x5e')](-0x1);if(_0x20032f==='/'){_0x42470=_0x42470[_0x0ae6('0x5f')](0x0,_0x42470[_0x0ae6('0x60')](_0x20032f));}var _0x3db11f={'method':_0x0ae6('0x61'),'uri':util[_0x0ae6('0x62')](_0x0ae6('0x63'),_0x42470,_0x0ae6('0x64')),'json':!![]};switch(_0x206021[_0x0ae6('0x5c')]){case _0x0ae6('0x5b'):_0x3db11f[_0x0ae6('0x65')]={'Authorization':util[_0x0ae6('0x62')](_0x0ae6('0x66'),new Buffer(util[_0x0ae6('0x62')]('%s:%s',_0x206021[_0x0ae6('0x5a')],_0x206021[_0x0ae6('0x5b')]))[_0x0ae6('0x67')](_0x0ae6('0x68')))};break;case'token':_0x3db11f[_0x0ae6('0x65')]={'Authorization':util[_0x0ae6('0x62')](_0x0ae6('0x66'),new Buffer(util[_0x0ae6('0x62')](_0x0ae6('0x69'),_0x206021[_0x0ae6('0x5a')],_0x206021['token']))[_0x0ae6('0x67')]('base64'))};break;default:throw new db[(_0x0ae6('0x6a'))][(_0x0ae6('0x6b'))](_0x0ae6('0x6c'));}return rp(_0x3db11f);}})[_0x0ae6('0x29')](function(_0x1f0b9e){if(_0x1f0b9e){var _0x15003f=[_0x0ae6('0x6d'),'description','group',_0x0ae6('0x6e')];_[_0x0ae6('0x6f')](_0x1f0b9e[_0x0ae6('0x64')],function(_0x104625){return _0x15003f['includes'](_0x104625[_0x0ae6('0x32')]);});return{'count':_0x1f0b9e[_0x0ae6('0x64')]['length'],'rows':_[_0x0ae6('0x2f')](_0x1f0b9e[_0x0ae6('0x64')],function(_0x1af034){return{'id':_0x1af034['id'],'name':_0x1af034[_0x0ae6('0x70')]>0x7?_0x1af034[_0x0ae6('0x71')]:_0x1af034[_0x0ae6('0x32')],'custom':_0x1af034['position']>0x7?!![]:![],'options':_0x1af034['system_field_options']?_0x1af034['system_field_options']:_0x1af034[_0x0ae6('0x72')]?_0x1af034['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x2d9ec4,null))['catch'](function(_0x58517f){var _0xc69e9d=_0x5cd03b['query'][_0x0ae6('0x73')]?0x1f4:_0x58517f['statusCode']||0x1f4;logger[_0x0ae6('0x74')](_0x0ae6('0x75'),_0x0ae6('0x59'),_0xc69e9d,JSON[_0x0ae6('0x76')](_0x58517f));delete _0x58517f[_0x0ae6('0x2c')];if(_0xc69e9d===0x191){_0xc69e9d=0x190;}_0x2d9ec4['status'](_0xc69e9d)[_0x0ae6('0x2d')](_0x5cd03b[_0x0ae6('0x35')][_0x0ae6('0x73')]?{'message':_0x0ae6('0x77'),'statusCode':_0x58517f[_0x0ae6('0x78')]}:_0x58517f);});}; \ No newline at end of file +var _0x5423=['Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','then','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','model','map','query','keys','filters','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','intersection','length','find','create','body','destroy','ZendeskConfiguration','nolimit','findOne','AccountId','getSubjects','channel','type','Descriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','lastIndexOf','ticket_fields','headers','Basic\x20%s','format','%s:%s','base64','%s/token:%s','toString','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0x5423,0xe3));var _0x3542=function(_0xa41d00,_0x44f46b){_0xa41d00=_0xa41d00-0x0;var _0x2a9b0b=_0x5423[_0xa41d00];return _0x2a9b0b;};'use strict';var emlformat=require(_0x3542('0x0'));var rimraf=require(_0x3542('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3542('0x2'));var rp=require(_0x3542('0x3'));var moment=require('moment');var BPromise=require(_0x3542('0x4'));var Mustache=require(_0x3542('0x5'));var util=require(_0x3542('0x6'));var path=require(_0x3542('0x7'));var sox=require('sox');var csv=require(_0x3542('0x8'));var ejs=require(_0x3542('0x9'));var fs=require('fs');var fs_extra=require(_0x3542('0xa'));var _=require(_0x3542('0xb'));var squel=require(_0x3542('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3542('0xd'));var toCsv=require(_0x3542('0x8'));var querystring=require('querystring');var Papa=require(_0x3542('0xe'));var Redis=require(_0x3542('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3542('0x10'));var as=require(_0x3542('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3542('0x12'))(_0x3542('0x13'));var utils=require(_0x3542('0x14'));var config=require(_0x3542('0x15'));var licenseUtil=require(_0x3542('0x16'));var db=require(_0x3542('0x17'))['db'];var integrations=require(_0x3542('0x18'));function respondWithStatusCode(_0x43e977,_0x4ee86){_0x4ee86=_0x4ee86||0xcc;return function(_0x1a9062){if(_0x1a9062){return _0x43e977[_0x3542('0x19')](_0x4ee86);}return _0x43e977[_0x3542('0x1a')](_0x4ee86)[_0x3542('0x1b')]();};}function respondWithResult(_0x4bac5b,_0x14fe57){_0x14fe57=_0x14fe57||0xc8;return function(_0x4fb366){if(_0x4fb366){return _0x4bac5b[_0x3542('0x1a')](_0x14fe57)[_0x3542('0x1c')](_0x4fb366);}};}function respondWithFilteredResult(_0xc33d42,_0x546fbd){return function(_0x270312){if(_0x270312){var _0x177fb9=typeof _0x546fbd[_0x3542('0x1d')]==='undefined'&&typeof _0x546fbd[_0x3542('0x1e')]===_0x3542('0x1f');var _0x116859=_0x270312[_0x3542('0x20')];var _0x493d95=_0x177fb9?0x0:_0x546fbd[_0x3542('0x1d')];var _0x53d4aa=_0x177fb9?_0x270312[_0x3542('0x20')]:_0x546fbd[_0x3542('0x1d')]+_0x546fbd['limit'];var _0x1c6403;if(_0x53d4aa>=_0x116859){_0x53d4aa=_0x116859;_0x1c6403=0xc8;}else{_0x1c6403=0xce;}_0xc33d42[_0x3542('0x1a')](_0x1c6403);return _0xc33d42[_0x3542('0x21')](_0x3542('0x22'),_0x493d95+'-'+_0x53d4aa+'/'+_0x116859)[_0x3542('0x1c')](_0x270312);}return null;};}function patchUpdates(_0x4a7695){return function(_0x4a74b0){try{jsonpatch['apply'](_0x4a74b0,_0x4a7695,!![]);}catch(_0x17e3cf){return BPromise['reject'](_0x17e3cf);}return _0x4a74b0[_0x3542('0x23')]();};}function saveUpdates(_0x551645,_0x1d5f1e){return function(_0x55774d){if(_0x55774d){return _0x55774d['update'](_0x551645)[_0x3542('0x24')](function(_0xe3f983){return _0xe3f983;});}return null;};}function removeEntity(_0x5ae097,_0x5d05b2){return function(_0x3fc964){if(_0x3fc964){return _0x3fc964['destroy']()[_0x3542('0x24')](function(){_0x5ae097[_0x3542('0x1a')](0xcc)[_0x3542('0x1b')]();});}};}function handleEntityNotFound(_0x2f2e63,_0x298763){return function(_0xf1f7d0){if(!_0xf1f7d0){_0x2f2e63[_0x3542('0x19')](0x194);}return _0xf1f7d0;};}function handleError(_0x1e156e,_0x18dc6c){_0x18dc6c=_0x18dc6c||0x1f4;return function(_0x2841a1){logger[_0x3542('0x25')](_0x2841a1[_0x3542('0x26')]);if(_0x2841a1[_0x3542('0x27')]){delete _0x2841a1[_0x3542('0x27')];}_0x1e156e[_0x3542('0x1a')](_0x18dc6c)[_0x3542('0x28')](_0x2841a1);};}exports[_0x3542('0x29')]=function(_0x20eda1,_0x3bd666){var _0x5590a2={},_0x31ad47={},_0x35bbc9={'count':0x0,'rows':[]};var _0x2aec76=_['map'](db[_0x3542('0x2a')][_0x3542('0x2b')],function(_0x2e883a){return{'name':_0x2e883a[_0x3542('0x2c')],'type':_0x2e883a['type']['key']};});_0x31ad47[_0x3542('0x2d')]=_[_0x3542('0x2e')](_0x2aec76,_0x3542('0x27'));_0x31ad47[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x20eda1[_0x3542('0x2f')]);_0x31ad47[_0x3542('0x31')]=_['intersection'](_0x31ad47['model'],_0x31ad47[_0x3542('0x2f')]);_0x5590a2['attributes']=_['intersection'](_0x31ad47[_0x3542('0x2d')],qs['fields'](_0x20eda1['query'][_0x3542('0x32')]));_0x5590a2[_0x3542('0x33')]=_0x5590a2[_0x3542('0x33')]['length']?_0x5590a2[_0x3542('0x33')]:_0x31ad47['model'];if(!_0x20eda1[_0x3542('0x2f')][_0x3542('0x34')]('nolimit')){_0x5590a2[_0x3542('0x1e')]=qs['limit'](_0x20eda1[_0x3542('0x2f')][_0x3542('0x1e')]);_0x5590a2[_0x3542('0x1d')]=qs['offset'](_0x20eda1[_0x3542('0x2f')]['offset']);}_0x5590a2[_0x3542('0x35')]=qs[_0x3542('0x36')](_0x20eda1[_0x3542('0x2f')][_0x3542('0x36')]);_0x5590a2[_0x3542('0x37')]=qs[_0x3542('0x31')](_[_0x3542('0x38')](_0x20eda1[_0x3542('0x2f')],_0x31ad47[_0x3542('0x31')]),_0x2aec76);if(_0x20eda1[_0x3542('0x2f')][_0x3542('0x39')]){_0x5590a2[_0x3542('0x37')]=_[_0x3542('0x3a')](_0x5590a2['where'],{'$or':_[_0x3542('0x2e')](_0x2aec76,function(_0x4a80ea){if(_0x4a80ea['type']!==_0x3542('0x3b')){var _0x3ffccc={};_0x3ffccc[_0x4a80ea[_0x3542('0x27')]]={'$like':'%'+_0x20eda1[_0x3542('0x2f')][_0x3542('0x39')]+'%'};return _0x3ffccc;}})});}_0x5590a2=_[_0x3542('0x3a')]({},_0x5590a2,_0x20eda1[_0x3542('0x3c')]);var _0x42e87a={'where':_0x5590a2['where']};return db[_0x3542('0x2a')]['count'](_0x42e87a)[_0x3542('0x24')](function(_0x2baa01){_0x35bbc9['count']=_0x2baa01;if(_0x20eda1[_0x3542('0x2f')][_0x3542('0x3d')]){_0x5590a2['include']=[{'all':!![]}];}return db[_0x3542('0x2a')][_0x3542('0x3e')](_0x5590a2);})['then'](function(_0x2682d0){_0x35bbc9[_0x3542('0x3f')]=_0x2682d0;return _0x35bbc9;})[_0x3542('0x24')](respondWithFilteredResult(_0x3bd666,_0x5590a2))[_0x3542('0x40')](handleError(_0x3bd666,null));};exports[_0x3542('0x41')]=function(_0xb12441,_0x2b54b9){var _0x4bf45a={'raw':![],'where':{'id':_0xb12441[_0x3542('0x42')]['id']}},_0x542e0c={};_0x542e0c[_0x3542('0x2d')]=_[_0x3542('0x30')](db[_0x3542('0x2a')][_0x3542('0x2b')]);_0x542e0c['query']=_[_0x3542('0x30')](_0xb12441['query']);_0x542e0c[_0x3542('0x31')]=_[_0x3542('0x43')](_0x542e0c[_0x3542('0x2d')],_0x542e0c['query']);_0x4bf45a[_0x3542('0x33')]=_[_0x3542('0x43')](_0x542e0c['model'],qs[_0x3542('0x32')](_0xb12441[_0x3542('0x2f')][_0x3542('0x32')]));_0x4bf45a[_0x3542('0x33')]=_0x4bf45a[_0x3542('0x33')][_0x3542('0x44')]?_0x4bf45a[_0x3542('0x33')]:_0x542e0c[_0x3542('0x2d')];if(_0xb12441['query']['includeAll']){_0x4bf45a['include']=[{'all':!![]}];}_0x4bf45a=_[_0x3542('0x3a')]({},_0x4bf45a,_0xb12441[_0x3542('0x3c')]);return db[_0x3542('0x2a')][_0x3542('0x45')](_0x4bf45a)[_0x3542('0x24')](handleEntityNotFound(_0x2b54b9,null))[_0x3542('0x24')](respondWithResult(_0x2b54b9,null))[_0x3542('0x40')](handleError(_0x2b54b9,null));};exports['create']=function(_0x157683,_0x14b960){return db[_0x3542('0x2a')][_0x3542('0x46')](_0x157683['body'],{})[_0x3542('0x24')](respondWithResult(_0x14b960,0xc9))[_0x3542('0x40')](handleError(_0x14b960,null));};exports['update']=function(_0x528f8c,_0x1fb253){if(_0x528f8c[_0x3542('0x47')]['id']){delete _0x528f8c[_0x3542('0x47')]['id'];}return db[_0x3542('0x2a')][_0x3542('0x45')]({'where':{'id':_0x528f8c[_0x3542('0x42')]['id']}})[_0x3542('0x24')](handleEntityNotFound(_0x1fb253,null))['then'](saveUpdates(_0x528f8c[_0x3542('0x47')],null))[_0x3542('0x24')](respondWithResult(_0x1fb253,null))[_0x3542('0x40')](handleError(_0x1fb253,null));};exports[_0x3542('0x48')]=function(_0x1ebc82,_0x28be34){return db[_0x3542('0x2a')][_0x3542('0x45')]({'where':{'id':_0x1ebc82[_0x3542('0x42')]['id']}})['then'](handleEntityNotFound(_0x28be34,null))['then'](removeEntity(_0x28be34,null))[_0x3542('0x40')](handleError(_0x28be34,null));};exports['getConfigurations']=function(_0x5a798a,_0x572e7a,_0x286222){var _0xd5c5c3={};var _0x381885={};var _0x48cfc4;var _0x2db495;return db[_0x3542('0x2a')]['findOne']({'where':{'id':_0x5a798a[_0x3542('0x42')]['id']}})[_0x3542('0x24')](handleEntityNotFound(_0x572e7a,null))[_0x3542('0x24')](function(_0x196c59){if(_0x196c59){_0x48cfc4=_0x196c59;_0x381885[_0x3542('0x2d')]=_['keys'](db[_0x3542('0x49')][_0x3542('0x2b')]);_0x381885[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x5a798a[_0x3542('0x2f')]);_0x381885['filters']=_['intersection'](_0x381885[_0x3542('0x2d')],_0x381885[_0x3542('0x2f')]);_0xd5c5c3[_0x3542('0x33')]=_['intersection'](_0x381885[_0x3542('0x2d')],qs[_0x3542('0x32')](_0x5a798a[_0x3542('0x2f')][_0x3542('0x32')]));_0xd5c5c3[_0x3542('0x33')]=_0xd5c5c3['attributes']['length']?_0xd5c5c3[_0x3542('0x33')]:_0x381885['model'];_0xd5c5c3[_0x3542('0x35')]=qs[_0x3542('0x36')](_0x5a798a['query'][_0x3542('0x36')]);_0xd5c5c3[_0x3542('0x37')]=qs[_0x3542('0x31')](_[_0x3542('0x38')](_0x5a798a[_0x3542('0x2f')],_0x381885['filters']));if(_0x5a798a['query'][_0x3542('0x39')]){_0xd5c5c3['where']=_[_0x3542('0x3a')](_0xd5c5c3[_0x3542('0x37')],{'$or':_[_0x3542('0x2e')](_0xd5c5c3['attributes'],function(_0xd9c90c){var _0x1f8ddb={};_0x1f8ddb[_0xd9c90c]={'$like':'%'+_0x5a798a[_0x3542('0x2f')][_0x3542('0x39')]+'%'};return _0x1f8ddb;})});}_0xd5c5c3=_[_0x3542('0x3a')]({},_0xd5c5c3,_0x5a798a[_0x3542('0x3c')]);return _0x48cfc4['getConfigurations'](_0xd5c5c3);}})[_0x3542('0x24')](function(_0x3ee446){if(_0x3ee446){_0x2db495=_0x3ee446[_0x3542('0x44')];if(!_0x5a798a[_0x3542('0x2f')][_0x3542('0x34')](_0x3542('0x4a'))){_0xd5c5c3['limit']=qs[_0x3542('0x1e')](_0x5a798a[_0x3542('0x2f')][_0x3542('0x1e')]);_0xd5c5c3[_0x3542('0x1d')]=qs['offset'](_0x5a798a[_0x3542('0x2f')][_0x3542('0x1d')]);}return _0x48cfc4['getConfigurations'](_0xd5c5c3);}})['then'](function(_0x2908e5){if(_0x2908e5){return _0x2908e5?{'count':_0x2db495,'rows':_0x2908e5}:null;}})['then'](respondWithResult(_0x572e7a,null))[_0x3542('0x40')](handleError(_0x572e7a,null));};exports['addConfiguration']=function(_0x484204,_0x42a34a,_0x471408){if(_0x484204[_0x3542('0x47')]['id']){delete _0x484204[_0x3542('0x47')]['id'];}return db[_0x3542('0x2a')][_0x3542('0x4b')]({'where':{'id':_0x484204[_0x3542('0x42')]['id']}})['then'](handleEntityNotFound(_0x42a34a,null))[_0x3542('0x24')](function(_0xf1cf57){if(_0xf1cf57){_0x484204[_0x3542('0x47')][_0x3542('0x4c')]=_0xf1cf57['id'];_0x484204[_0x3542('0x47')]['Subjects']=integrations[_0x3542('0x4d')](_0x484204[_0x3542('0x47')][_0x3542('0x4e')],_0x484204[_0x3542('0x47')][_0x3542('0x4f')]);_0x484204[_0x3542('0x47')][_0x3542('0x50')]=integrations['getDescriptions'](_0x484204[_0x3542('0x47')]['channel'],_0x484204[_0x3542('0x47')][_0x3542('0x4f')]);return db[_0x3542('0x49')][_0x3542('0x46')](_0x484204['body'],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0x3542('0x51')],'as':_0x3542('0x50')}]});}return null;})[_0x3542('0x24')](respondWithResult(_0x42a34a,null))[_0x3542('0x40')](handleError(_0x42a34a,null));};exports[_0x3542('0x52')]=function(_0x2afc71,_0x3c84fa,_0x77f0af){var _0x2b0de0='';return db['ZendeskAccount'][_0x3542('0x4b')]({'where':{'id':_0x2afc71[_0x3542('0x42')]['id']},'attributes':['id',_0x3542('0x53'),_0x3542('0x54'),_0x3542('0x55'),'authType','remoteUri']})[_0x3542('0x24')](handleEntityNotFound(_0x3c84fa,null))[_0x3542('0x24')](function(_0x52c26d){if(_0x52c26d){_0x2b0de0=_0x52c26d[_0x3542('0x56')];var _0x4b5327=_0x2b0de0[_0x3542('0x57')](-0x1);if(_0x4b5327==='/'){_0x2b0de0=_0x2b0de0['substring'](0x0,_0x2b0de0[_0x3542('0x58')](_0x4b5327));}var _0x153e1b={'method':'GET','uri':util['format']('%s/%s',_0x2b0de0,_0x3542('0x59')),'json':!![]};switch(_0x52c26d['authType']){case _0x3542('0x54'):_0x153e1b[_0x3542('0x5a')]={'Authorization':util['format'](_0x3542('0x5b'),new Buffer(util[_0x3542('0x5c')](_0x3542('0x5d'),_0x52c26d['username'],_0x52c26d[_0x3542('0x54')]))['toString'](_0x3542('0x5e')))};break;case'token':_0x153e1b[_0x3542('0x5a')]={'Authorization':util[_0x3542('0x5c')](_0x3542('0x5b'),new Buffer(util['format'](_0x3542('0x5f'),_0x52c26d[_0x3542('0x53')],_0x52c26d[_0x3542('0x55')]))[_0x3542('0x60')]('base64'))};break;default:throw new db['Sequelize'][(_0x3542('0x61'))](_0x3542('0x62'));}return rp(_0x153e1b);}})[_0x3542('0x24')](function(_0xaa97d5){if(_0xaa97d5){var _0x191fdd=[_0x3542('0x63'),_0x3542('0x64'),_0x3542('0x65'),_0x3542('0x66')];_[_0x3542('0x67')](_0xaa97d5[_0x3542('0x59')],function(_0x1c318c){return _0x191fdd[_0x3542('0x68')](_0x1c318c[_0x3542('0x4f')]);});return{'count':_0xaa97d5[_0x3542('0x59')][_0x3542('0x44')],'rows':_[_0x3542('0x2e')](_0xaa97d5[_0x3542('0x59')],function(_0x4e04b6){return{'id':_0x4e04b6['id'],'name':_0x4e04b6[_0x3542('0x69')]>0x7?_0x4e04b6[_0x3542('0x6a')]:_0x4e04b6['type'],'custom':_0x4e04b6['position']>0x7?!![]:![],'options':_0x4e04b6[_0x3542('0x6b')]?_0x4e04b6[_0x3542('0x6b')]:_0x4e04b6[_0x3542('0x6c')]?_0x4e04b6[_0x3542('0x6c')]:[]};})};}})['then'](respondWithResult(_0x3c84fa,null))[_0x3542('0x40')](function(_0x2d17ce){var _0x54e723=_0x2afc71[_0x3542('0x2f')]['test']?0x1f4:_0x2d17ce[_0x3542('0x6d')]||0x1f4;logger['error'](_0x3542('0x6e'),_0x3542('0x52'),_0x54e723,JSON[_0x3542('0x6f')](_0x2d17ce));delete _0x2d17ce[_0x3542('0x27')];if(_0x54e723===0x191){_0x54e723=0x190;}_0x3c84fa[_0x3542('0x1a')](_0x54e723)[_0x3542('0x28')](_0x2afc71[_0x3542('0x2f')]['test']?{'message':_0x3542('0x70'),'statusCode':_0x2d17ce['statusCode']}:_0x2d17ce);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 50927a1..7efe4ad 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 _0x1dea=['define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x2b5d13,_0xc61713){var _0x42739b=function(_0x14bbc0){while(--_0x14bbc0){_0x2b5d13['push'](_0x2b5d13['shift']());}};_0x42739b(++_0xc61713);}(_0x1dea,0xb7));var _0xa1de=function(_0x155db6,_0x5ee4c0){_0x155db6=_0x155db6-0x0;var _0x465bb5=_0x1dea[_0x155db6];return _0x465bb5;};'use strict';var _=require(_0xa1de('0x0'));var util=require(_0xa1de('0x1'));var logger=require(_0xa1de('0x2'))(_0xa1de('0x3'));var moment=require(_0xa1de('0x4'));var BPromise=require(_0xa1de('0x5'));var rp=require(_0xa1de('0x6'));var fs=require('fs');var path=require(_0xa1de('0x7'));var rimraf=require(_0xa1de('0x8'));var config=require('../../config/environment');var attributes=require(_0xa1de('0x9'));var integrations=require(_0xa1de('0xa'));module[_0xa1de('0xb')]=function(_0x2b54a6,_0x25423b){return _0x2b54a6[_0xa1de('0xc')](_0xa1de('0xd'),attributes,{'tableName':_0xa1de('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a13=['int_zendesk_accounts','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount'];(function(_0x39ac9b,_0xd4ae1a){var _0x2e61fb=function(_0x514ef9){while(--_0x514ef9){_0x39ac9b['push'](_0x39ac9b['shift']());}};_0x2e61fb(++_0xd4ae1a);}(_0x9a13,0x199));var _0x39a1=function(_0x7934ca,_0x51fad4){_0x7934ca=_0x7934ca-0x0;var _0x1823d3=_0x9a13[_0x7934ca];return _0x1823d3;};'use strict';var _=require(_0x39a1('0x0'));var util=require(_0x39a1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x39a1('0x2'));var BPromise=require(_0x39a1('0x3'));var rp=require(_0x39a1('0x4'));var fs=require('fs');var path=require(_0x39a1('0x5'));var rimraf=require('rimraf');var config=require(_0x39a1('0x6'));var attributes=require(_0x39a1('0x7'));var integrations=require(_0x39a1('0x8'));module['exports']=function(_0x499182,_0x4e8345){return _0x499182[_0x39a1('0x9')](_0x39a1('0xa'),attributes,{'tableName':_0x39a1('0xb'),'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 32ab78b..8c40583 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 _0xf0c2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','catch','ShowZendeskAccount','util','moment','bluebird','randomstring'];(function(_0x4ee517,_0x1f718f){var _0x6630f6=function(_0x4d9d07){while(--_0x4d9d07){_0x4ee517['push'](_0x4ee517['shift']());}};_0x6630f6(++_0x1f718f);}(_0xf0c2,0x6e));var _0x2f0c=function(_0x4cba83,_0x459eb9){_0x4cba83=_0x4cba83-0x0;var _0x5d0442=_0xf0c2[_0x4cba83];return _0x5d0442;};'use strict';var _=require('lodash');var util=require(_0x2f0c('0x0'));var moment=require(_0x2f0c('0x1'));var BPromise=require(_0x2f0c('0x2'));var rs=require(_0x2f0c('0x3'));var fs=require('fs');var Redis=require(_0x2f0c('0x4'));var db=require(_0x2f0c('0x5'))['db'];var utils=require(_0x2f0c('0x6'));var logger=require(_0x2f0c('0x7'))(_0x2f0c('0x8'));var config=require(_0x2f0c('0x9'));var jayson=require(_0x2f0c('0xa'));var client=jayson[_0x2f0c('0xb')][_0x2f0c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x560dd9,_0x12eaef,_0x320fcb){return new BPromise(function(_0x56dada,_0x2b8c93){return client[_0x2f0c('0xd')](_0x560dd9,_0x320fcb)[_0x2f0c('0xe')](function(_0x1838e7){logger[_0x2f0c('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x12eaef,_0x2f0c('0x10'));logger[_0x2f0c('0x11')](_0x2f0c('0x12'),_0x12eaef,_0x2f0c('0x10'),JSON[_0x2f0c('0x13')](_0x1838e7));if(_0x1838e7[_0x2f0c('0x14')]){if(_0x1838e7[_0x2f0c('0x14')][_0x2f0c('0x15')]===0x1f4){logger[_0x2f0c('0x14')](_0x2f0c('0x16'),_0x12eaef,_0x1838e7[_0x2f0c('0x14')][_0x2f0c('0x17')]);return _0x2b8c93(_0x1838e7[_0x2f0c('0x14')]['message']);}logger['error'](_0x2f0c('0x16'),_0x12eaef,_0x1838e7[_0x2f0c('0x14')][_0x2f0c('0x17')]);return _0x56dada(_0x1838e7[_0x2f0c('0x14')]['message']);}else{logger[_0x2f0c('0xf')](_0x2f0c('0x16'),_0x12eaef,_0x2f0c('0x10'));_0x56dada(_0x1838e7[_0x2f0c('0x18')][_0x2f0c('0x17')]);}})['catch'](function(_0x3612bb){logger[_0x2f0c('0x14')]('ZendeskAccount,\x20%s,\x20%s',_0x12eaef,_0x3612bb);_0x2b8c93(_0x3612bb);});});}exports[_0x2f0c('0x19')]=function(_0x32642e){var _0x5219e9=this;return new Promise(function(_0x54e503,_0x2874b7){return db[_0x2f0c('0x1a')][_0x2f0c('0x1b')]({'raw':_0x32642e[_0x2f0c('0x1c')]?_0x32642e[_0x2f0c('0x1c')][_0x2f0c('0x1d')]===undefined?!![]:![]:!![],'where':_0x32642e[_0x2f0c('0x1c')]?_0x32642e[_0x2f0c('0x1c')][_0x2f0c('0x1e')]||null:null,'attributes':_0x32642e[_0x2f0c('0x1c')]?_0x32642e[_0x2f0c('0x1c')][_0x2f0c('0x1f')]||null:null,'limit':_0x32642e[_0x2f0c('0x1c')]?_0x32642e['options'][_0x2f0c('0x20')]||null:null,'include':_0x32642e[_0x2f0c('0x1c')]?_0x32642e['options']['include']?_[_0x2f0c('0x21')](_0x32642e[_0x2f0c('0x1c')][_0x2f0c('0x22')],function(_0x2385e5){return{'model':db[_0x2385e5[_0x2f0c('0x23')]],'as':_0x2385e5['as'],'attributes':_0x2385e5[_0x2f0c('0x1f')],'include':_0x2385e5[_0x2f0c('0x22')]?_[_0x2f0c('0x21')](_0x2385e5['include'],function(_0x2d9053){return{'model':db[_0x2d9053['model']],'as':_0x2d9053['as'],'attributes':_0x2d9053[_0x2f0c('0x1f')],'include':_0x2d9053[_0x2f0c('0x22')]?_[_0x2f0c('0x21')](_0x2d9053[_0x2f0c('0x22')],function(_0x55cd10){return{'model':db[_0x55cd10[_0x2f0c('0x23')]],'as':_0x55cd10['as'],'attributes':_0x55cd10[_0x2f0c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2f0c('0xe')](function(_0x3edbc2){logger['info']('GetZendeskAccount',_0x32642e);logger[_0x2f0c('0x11')](_0x2f0c('0x19'),_0x32642e,JSON[_0x2f0c('0x13')](_0x3edbc2));_0x54e503(_0x3edbc2);})[_0x2f0c('0x24')](function(_0x1c5638){logger[_0x2f0c('0x14')](_0x2f0c('0x19'),_0x1c5638['message'],_0x32642e);_0x2874b7(_0x5219e9[_0x2f0c('0x14')](0x1f4,_0x1c5638[_0x2f0c('0x17')]));});});};exports[_0x2f0c('0x25')]=function(_0x4f3a99){var _0x12402a=this;return new Promise(function(_0xaa2b97,_0x1a0e1d){return db[_0x2f0c('0x1a')]['find']({'raw':_0x4f3a99[_0x2f0c('0x1c')]?_0x4f3a99['options'][_0x2f0c('0x1d')]===undefined?!![]:![]:!![],'where':_0x4f3a99[_0x2f0c('0x1c')]?_0x4f3a99[_0x2f0c('0x1c')][_0x2f0c('0x1e')]||null:null,'attributes':_0x4f3a99[_0x2f0c('0x1c')]?_0x4f3a99[_0x2f0c('0x1c')]['attributes']||null:null,'include':_0x4f3a99[_0x2f0c('0x1c')]?_0x4f3a99[_0x2f0c('0x1c')][_0x2f0c('0x22')]?_[_0x2f0c('0x21')](_0x4f3a99['options'][_0x2f0c('0x22')],function(_0x28a30b){return{'model':db[_0x28a30b['model']],'as':_0x28a30b['as'],'attributes':_0x28a30b[_0x2f0c('0x1f')],'include':_0x28a30b[_0x2f0c('0x22')]?_[_0x2f0c('0x21')](_0x28a30b['include'],function(_0x122ff6){return{'model':db[_0x122ff6[_0x2f0c('0x23')]],'as':_0x122ff6['as'],'attributes':_0x122ff6[_0x2f0c('0x1f')],'include':_0x122ff6['include']?_[_0x2f0c('0x21')](_0x122ff6['include'],function(_0x5d67af){return{'model':db[_0x5d67af['model']],'as':_0x5d67af['as'],'attributes':_0x5d67af[_0x2f0c('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x303c25){logger['info'](_0x2f0c('0x25'),_0x4f3a99);logger[_0x2f0c('0x11')](_0x2f0c('0x25'),_0x4f3a99,JSON['stringify'](_0x303c25));_0xaa2b97(_0x303c25);})[_0x2f0c('0x24')](function(_0x1d3600){logger[_0x2f0c('0x14')](_0x2f0c('0x25'),_0x1d3600['message'],_0x4f3a99);_0x1a0e1d(_0x12402a[_0x2f0c('0x14')](0x1f4,_0x1d3600[_0x2f0c('0x17')]));});});}; \ No newline at end of file +var _0x4e2b=['raw','where','attributes','limit','include','model','map','ShowZendeskAccount','ZendeskAccount','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetZendeskAccount','findAll','options'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4e2b,0xa9));var _0xb4e2=function(_0x2acd60,_0x20277c){_0x2acd60=_0x2acd60-0x0;var _0x3165a8=_0x4e2b[_0x2acd60];return _0x3165a8;};'use strict';var _=require('lodash');var util=require(_0xb4e2('0x0'));var moment=require('moment');var BPromise=require(_0xb4e2('0x1'));var rs=require(_0xb4e2('0x2'));var fs=require('fs');var Redis=require(_0xb4e2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb4e2('0x4'))(_0xb4e2('0x5'));var config=require('../../config/environment');var jayson=require(_0xb4e2('0x6'));var client=jayson[_0xb4e2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35d370,_0x1e4520,_0x28d08d){return new BPromise(function(_0x33d107,_0x6e58ea){return client['request'](_0x35d370,_0x28d08d)[_0xb4e2('0x8')](function(_0x13754c){logger['info'](_0xb4e2('0x9'),_0x1e4520,_0xb4e2('0xa'));logger[_0xb4e2('0xb')](_0xb4e2('0xc'),_0x1e4520,_0xb4e2('0xa'),JSON[_0xb4e2('0xd')](_0x13754c));if(_0x13754c[_0xb4e2('0xe')]){if(_0x13754c[_0xb4e2('0xe')][_0xb4e2('0xf')]===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x1e4520,_0x13754c[_0xb4e2('0xe')][_0xb4e2('0x10')]);return _0x6e58ea(_0x13754c[_0xb4e2('0xe')][_0xb4e2('0x10')]);}logger[_0xb4e2('0xe')](_0xb4e2('0x9'),_0x1e4520,_0x13754c['error'][_0xb4e2('0x10')]);return _0x33d107(_0x13754c[_0xb4e2('0xe')][_0xb4e2('0x10')]);}else{logger[_0xb4e2('0x11')](_0xb4e2('0x9'),_0x1e4520,_0xb4e2('0xa'));_0x33d107(_0x13754c[_0xb4e2('0x12')]['message']);}})[_0xb4e2('0x13')](function(_0x119b9a){logger[_0xb4e2('0xe')](_0xb4e2('0x9'),_0x1e4520,_0x119b9a);_0x6e58ea(_0x119b9a);});});}exports[_0xb4e2('0x14')]=function(_0x569e0f){var _0x22f25=this;return new Promise(function(_0x2b75d9,_0x2023d8){return db['ZendeskAccount'][_0xb4e2('0x15')]({'raw':_0x569e0f['options']?_0x569e0f[_0xb4e2('0x16')][_0xb4e2('0x17')]===undefined?!![]:![]:!![],'where':_0x569e0f[_0xb4e2('0x16')]?_0x569e0f[_0xb4e2('0x16')][_0xb4e2('0x18')]||null:null,'attributes':_0x569e0f[_0xb4e2('0x16')]?_0x569e0f[_0xb4e2('0x16')][_0xb4e2('0x19')]||null:null,'limit':_0x569e0f[_0xb4e2('0x16')]?_0x569e0f[_0xb4e2('0x16')][_0xb4e2('0x1a')]||null:null,'include':_0x569e0f[_0xb4e2('0x16')]?_0x569e0f[_0xb4e2('0x16')][_0xb4e2('0x1b')]?_['map'](_0x569e0f[_0xb4e2('0x16')][_0xb4e2('0x1b')],function(_0x51fe2d){return{'model':db[_0x51fe2d[_0xb4e2('0x1c')]],'as':_0x51fe2d['as'],'attributes':_0x51fe2d[_0xb4e2('0x19')],'include':_0x51fe2d[_0xb4e2('0x1b')]?_['map'](_0x51fe2d[_0xb4e2('0x1b')],function(_0x49c0a2){return{'model':db[_0x49c0a2['model']],'as':_0x49c0a2['as'],'attributes':_0x49c0a2[_0xb4e2('0x19')],'include':_0x49c0a2[_0xb4e2('0x1b')]?_[_0xb4e2('0x1d')](_0x49c0a2[_0xb4e2('0x1b')],function(_0x2376fe){return{'model':db[_0x2376fe['model']],'as':_0x2376fe['as'],'attributes':_0x2376fe[_0xb4e2('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb4e2('0x8')](function(_0x20e524){logger[_0xb4e2('0x11')](_0xb4e2('0x14'),_0x569e0f);logger[_0xb4e2('0xb')]('GetZendeskAccount',_0x569e0f,JSON[_0xb4e2('0xd')](_0x20e524));_0x2b75d9(_0x20e524);})[_0xb4e2('0x13')](function(_0x268e92){logger[_0xb4e2('0xe')]('GetZendeskAccount',_0x268e92[_0xb4e2('0x10')],_0x569e0f);_0x2023d8(_0x22f25['error'](0x1f4,_0x268e92[_0xb4e2('0x10')]));});});};exports[_0xb4e2('0x1e')]=function(_0x392b20){var _0x357eb3=this;return new Promise(function(_0x49b320,_0x2ba839){return db[_0xb4e2('0x1f')]['find']({'raw':_0x392b20[_0xb4e2('0x16')]?_0x392b20[_0xb4e2('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x392b20[_0xb4e2('0x16')]?_0x392b20[_0xb4e2('0x16')][_0xb4e2('0x18')]||null:null,'attributes':_0x392b20[_0xb4e2('0x16')]?_0x392b20[_0xb4e2('0x16')][_0xb4e2('0x19')]||null:null,'include':_0x392b20[_0xb4e2('0x16')]?_0x392b20['options'][_0xb4e2('0x1b')]?_[_0xb4e2('0x1d')](_0x392b20[_0xb4e2('0x16')]['include'],function(_0x50d6db){return{'model':db[_0x50d6db[_0xb4e2('0x1c')]],'as':_0x50d6db['as'],'attributes':_0x50d6db[_0xb4e2('0x19')],'include':_0x50d6db[_0xb4e2('0x1b')]?_[_0xb4e2('0x1d')](_0x50d6db[_0xb4e2('0x1b')],function(_0x4cacec){return{'model':db[_0x4cacec[_0xb4e2('0x1c')]],'as':_0x4cacec['as'],'attributes':_0x4cacec[_0xb4e2('0x19')],'include':_0x4cacec[_0xb4e2('0x1b')]?_[_0xb4e2('0x1d')](_0x4cacec[_0xb4e2('0x1b')],function(_0x21f7b5){return{'model':db[_0x21f7b5['model']],'as':_0x21f7b5['as'],'attributes':_0x21f7b5[_0xb4e2('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb4e2('0x8')](function(_0x4a0c28){logger[_0xb4e2('0x11')](_0xb4e2('0x1e'),_0x392b20);logger[_0xb4e2('0xb')]('ShowZendeskAccount',_0x392b20,JSON['stringify'](_0x4a0c28));_0x49b320(_0x4a0c28);})[_0xb4e2('0x13')](function(_0x10b42b){logger[_0xb4e2('0xe')](_0xb4e2('0x1e'),_0x10b42b[_0xb4e2('0x10')],_0x392b20);_0x2ba839(_0x357eb3[_0xb4e2('0xe')](0x1f4,_0x10b42b[_0xb4e2('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index ce601c6..2416461 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 _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','put','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x4592a5,_0x388b83){var _0x4ef844=function(_0x5af666){while(--_0x5af666){_0x4592a5['push'](_0x4592a5['shift']());}};_0x4ef844(++_0x388b83);}(_0xda3f,0xec));var _0xfda3=function(_0x1bd41a,_0x57f5dd){_0x1bd41a=_0x1bd41a-0x0;var _0x2b0f15=_0xda3f[_0x1bd41a];return _0x2b0f15;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intZendeskConfiguration.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0x5')]('/:id/descriptions',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0x5')](_0xfda3('0xe'),auth[_0xfda3('0x6')](),controller['getTags']);router[_0xfda3('0xf')]('/',auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xf')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xfda3('0x11')](_0xfda3('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x12')]);module[_0xfda3('0x13')]=router; \ No newline at end of file +var _0xbaf0=['isAuthenticated','index','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get'];(function(_0x49b57e,_0x55496e){var _0x2dbb9c=function(_0x3b379f){while(--_0x3b379f){_0x49b57e['push'](_0x49b57e['shift']());}};_0x2dbb9c(++_0x55496e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'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['show']);router[_0x0baf('0x9')]('/:id/fields',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0x9')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x9')](_0x0baf('0x10'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x11')]);router[_0x0baf('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0x14')]);router['post'](_0x0baf('0x15'),auth['isAuthenticated'](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x18')]);router[_0x0baf('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);module[_0x0baf('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index e4594ca..bc8e657 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 _0xd259=['exports','STRING'];(function(_0x2e87d6,_0x50f80f){var _0x36b3c1=function(_0x1d0659){while(--_0x1d0659){_0x2e87d6['push'](_0x2e87d6['shift']());}};_0x36b3c1(++_0x50f80f);}(_0xd259,0x11c));var _0x9d25=function(_0x484dfc,_0x3c8990){_0x484dfc=_0x484dfc-0x0;var _0x100a85=_0xd259[_0x484dfc];return _0x100a85;};'use strict';var Sequelize=require('sequelize');module[_0x9d25('0x0')]={'name':{'type':Sequelize[_0x9d25('0x1')]},'description':{'type':Sequelize[_0x9d25('0x1')]}}; \ No newline at end of file +var _0xabb4=['exports','STRING'];(function(_0x42e22d,_0x1e1305){var _0x78df1=function(_0x25d806){while(--_0x25d806){_0x42e22d['push'](_0x42e22d['shift']());}};_0x78df1(++_0x1e1305);}(_0xabb4,0x10e));var _0x4abb=function(_0x55a84e,_0x2dd5ea){_0x55a84e=_0x55a84e-0x0;var _0x52143b=_0xabb4[_0x55a84e];return _0x52143b;};'use strict';var Sequelize=require('sequelize');module[_0x4abb('0x0')]={'name':{'type':Sequelize[_0x4abb('0x1')]},'description':{'type':Sequelize[_0x4abb('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index c3061ea..0785baf 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 _0xcbdb=['rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','options','include','findAll','catch','params','keys','includeAll','merge','find','create','body','getFields','findOne','ZendeskField','rawAttributes','pick','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format'];(function(_0x462778,_0x48857b){var _0x59bd90=function(_0x4dbc61){while(--_0x4dbc61){_0x462778['push'](_0x462778['shift']());}};_0x59bd90(++_0x48857b);}(_0xcbdb,0x1b2));var _0xbcbd=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xcbdb[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require(_0xbcbd('0x0'));var rimraf=require(_0xbcbd('0x1'));var zipdir=require(_0xbcbd('0x2'));var jsonpatch=require(_0xbcbd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbcbd('0x4'));var util=require(_0xbcbd('0x5'));var path=require(_0xbcbd('0x6'));var sox=require(_0xbcbd('0x7'));var csv=require(_0xbcbd('0x8'));var ejs=require(_0xbcbd('0x9'));var fs=require('fs');var fs_extra=require(_0xbcbd('0xa'));var _=require(_0xbcbd('0xb'));var squel=require('squel');var crypto=require(_0xbcbd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbcbd('0xd'));var toCsv=require(_0xbcbd('0x8'));var querystring=require(_0xbcbd('0xe'));var Papa=require(_0xbcbd('0xf'));var Redis=require(_0xbcbd('0x10'));var authService=require(_0xbcbd('0x11'));var qs=require(_0xbcbd('0x12'));var as=require(_0xbcbd('0x13'));var hardwareService=require(_0xbcbd('0x14'));var logger=require(_0xbcbd('0x15'))(_0xbcbd('0x16'));var utils=require(_0xbcbd('0x17'));var config=require(_0xbcbd('0x18'));var licenseUtil=require(_0xbcbd('0x19'));var db=require(_0xbcbd('0x1a'))['db'];function respondWithStatusCode(_0xc68bc1,_0xd61467){_0xd61467=_0xd61467||0xcc;return function(_0x2646ee){if(_0x2646ee){return _0xc68bc1[_0xbcbd('0x1b')](_0xd61467);}return _0xc68bc1['status'](_0xd61467)[_0xbcbd('0x1c')]();};}function respondWithResult(_0x587059,_0x47edb3){_0x47edb3=_0x47edb3||0xc8;return function(_0x2e42ca){if(_0x2e42ca){return _0x587059[_0xbcbd('0x1d')](_0x47edb3)[_0xbcbd('0x1e')](_0x2e42ca);}};}function respondWithFilteredResult(_0x50a706,_0x20681e){return function(_0x362405){if(_0x362405){var _0x5233da=typeof _0x20681e[_0xbcbd('0x1f')]===_0xbcbd('0x20')&&typeof _0x20681e[_0xbcbd('0x21')]===_0xbcbd('0x20');var _0x55502b=_0x362405[_0xbcbd('0x22')];var _0x188155=_0x5233da?0x0:_0x20681e['offset'];var _0x3e8377=_0x5233da?_0x362405['count']:_0x20681e[_0xbcbd('0x1f')]+_0x20681e[_0xbcbd('0x21')];var _0x1b08a4;if(_0x3e8377>=_0x55502b){_0x3e8377=_0x55502b;_0x1b08a4=0xc8;}else{_0x1b08a4=0xce;}_0x50a706[_0xbcbd('0x1d')](_0x1b08a4);return _0x50a706[_0xbcbd('0x23')](_0xbcbd('0x24'),_0x188155+'-'+_0x3e8377+'/'+_0x55502b)[_0xbcbd('0x1e')](_0x362405);}return null;};}function patchUpdates(_0x4e5dc8){return function(_0x172847){try{jsonpatch['apply'](_0x172847,_0x4e5dc8,!![]);}catch(_0x1172b5){return BPromise[_0xbcbd('0x25')](_0x1172b5);}return _0x172847[_0xbcbd('0x26')]();};}function saveUpdates(_0x259584,_0x3c6e75){return function(_0x27d9a5){if(_0x27d9a5){return _0x27d9a5[_0xbcbd('0x27')](_0x259584)[_0xbcbd('0x28')](function(_0x50c9ec){return _0x50c9ec;});}return null;};}function removeEntity(_0x3ada13,_0x1ab13e){return function(_0xb713d0){if(_0xb713d0){return _0xb713d0[_0xbcbd('0x29')]()[_0xbcbd('0x28')](function(){_0x3ada13[_0xbcbd('0x1d')](0xcc)[_0xbcbd('0x1c')]();});}};}function handleEntityNotFound(_0x256e23,_0x5f6617){return function(_0x54d09b){if(!_0x54d09b){_0x256e23[_0xbcbd('0x1b')](0x194);}return _0x54d09b;};}function handleError(_0x611ea,_0x5a4fac){_0x5a4fac=_0x5a4fac||0x1f4;return function(_0x301273){logger[_0xbcbd('0x2a')](_0x301273[_0xbcbd('0x2b')]);if(_0x301273[_0xbcbd('0x2c')]){delete _0x301273['name'];}_0x611ea[_0xbcbd('0x1d')](_0x5a4fac)[_0xbcbd('0x2d')](_0x301273);};}exports[_0xbcbd('0x2e')]=function(_0x5198c2,_0x3143b0){var _0x16e3c9={},_0xa5eae0={},_0x38d296={'count':0x0,'rows':[]};var _0x56310c=_[_0xbcbd('0x2f')](db[_0xbcbd('0x30')]['rawAttributes'],function(_0x41af21){return{'name':_0x41af21['fieldName'],'type':_0x41af21[_0xbcbd('0x31')][_0xbcbd('0x32')]};});_0xa5eae0[_0xbcbd('0x33')]=_['map'](_0x56310c,'name');_0xa5eae0[_0xbcbd('0x34')]=_['keys'](_0x5198c2[_0xbcbd('0x34')]);_0xa5eae0[_0xbcbd('0x35')]=_[_0xbcbd('0x36')](_0xa5eae0[_0xbcbd('0x33')],_0xa5eae0[_0xbcbd('0x34')]);_0x16e3c9[_0xbcbd('0x37')]=_['intersection'](_0xa5eae0[_0xbcbd('0x33')],qs[_0xbcbd('0x38')](_0x5198c2[_0xbcbd('0x34')][_0xbcbd('0x38')]));_0x16e3c9['attributes']=_0x16e3c9[_0xbcbd('0x37')][_0xbcbd('0x39')]?_0x16e3c9[_0xbcbd('0x37')]:_0xa5eae0[_0xbcbd('0x33')];if(!_0x5198c2['query']['hasOwnProperty'](_0xbcbd('0x3a'))){_0x16e3c9[_0xbcbd('0x21')]=qs[_0xbcbd('0x21')](_0x5198c2[_0xbcbd('0x34')][_0xbcbd('0x21')]);_0x16e3c9['offset']=qs[_0xbcbd('0x1f')](_0x5198c2[_0xbcbd('0x34')][_0xbcbd('0x1f')]);}_0x16e3c9[_0xbcbd('0x3b')]=qs[_0xbcbd('0x3c')](_0x5198c2[_0xbcbd('0x34')][_0xbcbd('0x3c')]);_0x16e3c9[_0xbcbd('0x3d')]=qs[_0xbcbd('0x35')](_['pick'](_0x5198c2['query'],_0xa5eae0['filters']),_0x56310c);if(_0x5198c2[_0xbcbd('0x34')][_0xbcbd('0x3e')]){_0x16e3c9[_0xbcbd('0x3d')]=_['merge'](_0x16e3c9[_0xbcbd('0x3d')],{'$or':_['map'](_0x56310c,function(_0xb7c8cd){if(_0xb7c8cd[_0xbcbd('0x31')]!==_0xbcbd('0x3f')){var _0x24a25a={};_0x24a25a[_0xb7c8cd[_0xbcbd('0x2c')]]={'$like':'%'+_0x5198c2[_0xbcbd('0x34')][_0xbcbd('0x3e')]+'%'};return _0x24a25a;}})});}_0x16e3c9=_['merge']({},_0x16e3c9,_0x5198c2[_0xbcbd('0x40')]);var _0x1a29ef={'where':_0x16e3c9[_0xbcbd('0x3d')]};return db[_0xbcbd('0x30')][_0xbcbd('0x22')](_0x1a29ef)[_0xbcbd('0x28')](function(_0x3eb052){_0x38d296['count']=_0x3eb052;if(_0x5198c2[_0xbcbd('0x34')]['includeAll']){_0x16e3c9[_0xbcbd('0x41')]=[{'all':!![]}];}return db[_0xbcbd('0x30')][_0xbcbd('0x42')](_0x16e3c9);})['then'](function(_0xccaff9){_0x38d296['rows']=_0xccaff9;return _0x38d296;})[_0xbcbd('0x28')](respondWithFilteredResult(_0x3143b0,_0x16e3c9))[_0xbcbd('0x43')](handleError(_0x3143b0,null));};exports['show']=function(_0xb896e3,_0x59f9fa){var _0x5af1a3={'raw':![],'where':{'id':_0xb896e3[_0xbcbd('0x44')]['id']}},_0x38c5a7={};_0x38c5a7['model']=_[_0xbcbd('0x45')](db['ZendeskConfiguration']['rawAttributes']);_0x38c5a7['query']=_[_0xbcbd('0x45')](_0xb896e3[_0xbcbd('0x34')]);_0x38c5a7[_0xbcbd('0x35')]=_['intersection'](_0x38c5a7[_0xbcbd('0x33')],_0x38c5a7[_0xbcbd('0x34')]);_0x5af1a3['attributes']=_['intersection'](_0x38c5a7[_0xbcbd('0x33')],qs[_0xbcbd('0x38')](_0xb896e3['query'][_0xbcbd('0x38')]));_0x5af1a3[_0xbcbd('0x37')]=_0x5af1a3[_0xbcbd('0x37')][_0xbcbd('0x39')]?_0x5af1a3[_0xbcbd('0x37')]:_0x38c5a7[_0xbcbd('0x33')];if(_0xb896e3[_0xbcbd('0x34')][_0xbcbd('0x46')]){_0x5af1a3[_0xbcbd('0x41')]=[{'all':!![]}];}_0x5af1a3=_[_0xbcbd('0x47')]({},_0x5af1a3,_0xb896e3[_0xbcbd('0x40')]);return db['ZendeskConfiguration'][_0xbcbd('0x48')](_0x5af1a3)['then'](handleEntityNotFound(_0x59f9fa,null))['then'](respondWithResult(_0x59f9fa,null))[_0xbcbd('0x43')](handleError(_0x59f9fa,null));};exports[_0xbcbd('0x49')]=function(_0x59535f,_0x24f029){return db['ZendeskConfiguration'][_0xbcbd('0x49')](_0x59535f['body'],{})['then'](respondWithResult(_0x24f029,0xc9))[_0xbcbd('0x43')](handleError(_0x24f029,null));};exports[_0xbcbd('0x27')]=function(_0x12e657,_0x2dcc34){if(_0x12e657[_0xbcbd('0x4a')]['id']){delete _0x12e657['body']['id'];}return db['ZendeskConfiguration'][_0xbcbd('0x48')]({'where':{'id':_0x12e657[_0xbcbd('0x44')]['id']}})['then'](handleEntityNotFound(_0x2dcc34,null))[_0xbcbd('0x28')](saveUpdates(_0x12e657[_0xbcbd('0x4a')],null))[_0xbcbd('0x28')](respondWithResult(_0x2dcc34,null))['catch'](handleError(_0x2dcc34,null));};exports[_0xbcbd('0x29')]=function(_0x5cadb0,_0x5e9d90){return db[_0xbcbd('0x30')][_0xbcbd('0x48')]({'where':{'id':_0x5cadb0[_0xbcbd('0x44')]['id']}})['then'](handleEntityNotFound(_0x5e9d90,null))[_0xbcbd('0x28')](removeEntity(_0x5e9d90,null))['catch'](handleError(_0x5e9d90,null));};exports[_0xbcbd('0x4b')]=function(_0x4e1617,_0x3b7203,_0x46052b){var _0x2a7fbd={};var _0x1aded0={};var _0x38525a;var _0x140b12;return db[_0xbcbd('0x30')][_0xbcbd('0x4c')]({'where':{'id':_0x4e1617[_0xbcbd('0x44')]['id']}})['then'](handleEntityNotFound(_0x3b7203,null))[_0xbcbd('0x28')](function(_0x2c625e){if(_0x2c625e){_0x38525a=_0x2c625e;_0x1aded0[_0xbcbd('0x33')]=_['keys'](db[_0xbcbd('0x4d')][_0xbcbd('0x4e')]);_0x1aded0['query']=_[_0xbcbd('0x45')](_0x4e1617[_0xbcbd('0x34')]);_0x1aded0['filters']=_[_0xbcbd('0x36')](_0x1aded0[_0xbcbd('0x33')],_0x1aded0[_0xbcbd('0x34')]);_0x2a7fbd[_0xbcbd('0x37')]=_[_0xbcbd('0x36')](_0x1aded0[_0xbcbd('0x33')],qs[_0xbcbd('0x38')](_0x4e1617[_0xbcbd('0x34')][_0xbcbd('0x38')]));_0x2a7fbd['attributes']=_0x2a7fbd[_0xbcbd('0x37')][_0xbcbd('0x39')]?_0x2a7fbd[_0xbcbd('0x37')]:_0x1aded0[_0xbcbd('0x33')];_0x2a7fbd[_0xbcbd('0x3b')]=qs['sort'](_0x4e1617[_0xbcbd('0x34')][_0xbcbd('0x3c')]);_0x2a7fbd[_0xbcbd('0x3d')]=qs[_0xbcbd('0x35')](_[_0xbcbd('0x4f')](_0x4e1617[_0xbcbd('0x34')],_0x1aded0[_0xbcbd('0x35')]));if(_0x4e1617['query']['filter']){_0x2a7fbd[_0xbcbd('0x3d')]=_[_0xbcbd('0x47')](_0x2a7fbd['where'],{'$or':_[_0xbcbd('0x2f')](_0x2a7fbd['attributes'],function(_0x444be3){var _0x3e9686={};_0x3e9686[_0x444be3]={'$like':'%'+_0x4e1617['query'][_0xbcbd('0x3e')]+'%'};return _0x3e9686;})});}_0x2a7fbd=_[_0xbcbd('0x47')]({},_0x2a7fbd,_0x4e1617[_0xbcbd('0x40')]);return _0x38525a['getFields'](_0x2a7fbd);}})[_0xbcbd('0x28')](function(_0x5ce161){if(_0x5ce161){_0x140b12=_0x5ce161[_0xbcbd('0x39')];if(!_0x4e1617[_0xbcbd('0x34')][_0xbcbd('0x50')](_0xbcbd('0x3a'))){_0x2a7fbd[_0xbcbd('0x21')]=qs['limit'](_0x4e1617['query'][_0xbcbd('0x21')]);_0x2a7fbd[_0xbcbd('0x1f')]=qs[_0xbcbd('0x1f')](_0x4e1617[_0xbcbd('0x34')][_0xbcbd('0x1f')]);}return _0x38525a[_0xbcbd('0x4b')](_0x2a7fbd);}})['then'](function(_0x69019a){if(_0x69019a){return _0x69019a?{'count':_0x140b12,'rows':_0x69019a}:null;}})[_0xbcbd('0x28')](respondWithResult(_0x3b7203,null))[_0xbcbd('0x43')](handleError(_0x3b7203,null));};exports[_0xbcbd('0x51')]=function(_0x55653b,_0xa61a17,_0x5a3059){var _0x3e8ed6={};var _0x515394={};var _0x344ff6;var _0x1b2dd6;return db[_0xbcbd('0x30')][_0xbcbd('0x4c')]({'where':{'id':_0x55653b[_0xbcbd('0x44')]['id']}})['then'](handleEntityNotFound(_0xa61a17,null))['then'](function(_0x2f8a9a){if(_0x2f8a9a){_0x344ff6=_0x2f8a9a;_0x515394[_0xbcbd('0x33')]=_[_0xbcbd('0x45')](db['ZendeskField']['rawAttributes']);_0x515394['query']=_[_0xbcbd('0x45')](_0x55653b[_0xbcbd('0x34')]);_0x515394['filters']=_[_0xbcbd('0x36')](_0x515394[_0xbcbd('0x33')],_0x515394[_0xbcbd('0x34')]);_0x3e8ed6[_0xbcbd('0x37')]=_[_0xbcbd('0x36')](_0x515394[_0xbcbd('0x33')],qs[_0xbcbd('0x38')](_0x55653b[_0xbcbd('0x34')]['fields']));_0x3e8ed6[_0xbcbd('0x37')]=_0x3e8ed6[_0xbcbd('0x37')]['length']?_0x3e8ed6[_0xbcbd('0x37')]:_0x515394[_0xbcbd('0x33')];_0x3e8ed6[_0xbcbd('0x3b')]=qs[_0xbcbd('0x3c')](_0x55653b[_0xbcbd('0x34')]['sort']);_0x3e8ed6[_0xbcbd('0x3d')]=qs[_0xbcbd('0x35')](_[_0xbcbd('0x4f')](_0x55653b[_0xbcbd('0x34')],_0x515394[_0xbcbd('0x35')]));if(_0x55653b['query'][_0xbcbd('0x3e')]){_0x3e8ed6['where']=_[_0xbcbd('0x47')](_0x3e8ed6[_0xbcbd('0x3d')],{'$or':_['map'](_0x3e8ed6[_0xbcbd('0x37')],function(_0xcc3bbc){var _0x43d374={};_0x43d374[_0xcc3bbc]={'$like':'%'+_0x55653b[_0xbcbd('0x34')]['filter']+'%'};return _0x43d374;})});}_0x3e8ed6=_[_0xbcbd('0x47')]({},_0x3e8ed6,_0x55653b[_0xbcbd('0x40')]);return _0x344ff6['getSubjects'](_0x3e8ed6);}})[_0xbcbd('0x28')](function(_0x417f9c){if(_0x417f9c){_0x1b2dd6=_0x417f9c[_0xbcbd('0x39')];if(!_0x55653b[_0xbcbd('0x34')][_0xbcbd('0x50')](_0xbcbd('0x3a'))){_0x3e8ed6['limit']=qs['limit'](_0x55653b[_0xbcbd('0x34')][_0xbcbd('0x21')]);_0x3e8ed6[_0xbcbd('0x1f')]=qs[_0xbcbd('0x1f')](_0x55653b[_0xbcbd('0x34')][_0xbcbd('0x1f')]);}return _0x344ff6[_0xbcbd('0x51')](_0x3e8ed6);}})['then'](function(_0x4e3972){if(_0x4e3972){return _0x4e3972?{'count':_0x1b2dd6,'rows':_0x4e3972}:null;}})[_0xbcbd('0x28')](respondWithResult(_0xa61a17,null))['catch'](handleError(_0xa61a17,null));};exports[_0xbcbd('0x52')]=function(_0x5945dd,_0x4def44,_0x3fa701){var _0x33cd78={};var _0x53e0ea={};var _0x2802ce;var _0x3d6923;return db['ZendeskConfiguration'][_0xbcbd('0x4c')]({'where':{'id':_0x5945dd[_0xbcbd('0x44')]['id']}})[_0xbcbd('0x28')](handleEntityNotFound(_0x4def44,null))[_0xbcbd('0x28')](function(_0x5781c3){if(_0x5781c3){_0x2802ce=_0x5781c3;_0x53e0ea[_0xbcbd('0x33')]=_[_0xbcbd('0x45')](db[_0xbcbd('0x4d')][_0xbcbd('0x4e')]);_0x53e0ea['query']=_[_0xbcbd('0x45')](_0x5945dd['query']);_0x53e0ea[_0xbcbd('0x35')]=_['intersection'](_0x53e0ea[_0xbcbd('0x33')],_0x53e0ea[_0xbcbd('0x34')]);_0x33cd78[_0xbcbd('0x37')]=_['intersection'](_0x53e0ea[_0xbcbd('0x33')],qs[_0xbcbd('0x38')](_0x5945dd[_0xbcbd('0x34')][_0xbcbd('0x38')]));_0x33cd78[_0xbcbd('0x37')]=_0x33cd78['attributes'][_0xbcbd('0x39')]?_0x33cd78[_0xbcbd('0x37')]:_0x53e0ea['model'];_0x33cd78[_0xbcbd('0x3b')]=qs[_0xbcbd('0x3c')](_0x5945dd[_0xbcbd('0x34')][_0xbcbd('0x3c')]);_0x33cd78['where']=qs[_0xbcbd('0x35')](_[_0xbcbd('0x4f')](_0x5945dd[_0xbcbd('0x34')],_0x53e0ea['filters']));if(_0x5945dd[_0xbcbd('0x34')]['filter']){_0x33cd78[_0xbcbd('0x3d')]=_[_0xbcbd('0x47')](_0x33cd78[_0xbcbd('0x3d')],{'$or':_[_0xbcbd('0x2f')](_0x33cd78[_0xbcbd('0x37')],function(_0x3f517e){var _0x40877e={};_0x40877e[_0x3f517e]={'$like':'%'+_0x5945dd[_0xbcbd('0x34')][_0xbcbd('0x3e')]+'%'};return _0x40877e;})});}_0x33cd78=_['merge']({},_0x33cd78,_0x5945dd[_0xbcbd('0x40')]);return _0x2802ce[_0xbcbd('0x52')](_0x33cd78);}})['then'](function(_0x3fef25){if(_0x3fef25){_0x3d6923=_0x3fef25[_0xbcbd('0x39')];if(!_0x5945dd[_0xbcbd('0x34')][_0xbcbd('0x50')]('nolimit')){_0x33cd78[_0xbcbd('0x21')]=qs[_0xbcbd('0x21')](_0x5945dd[_0xbcbd('0x34')][_0xbcbd('0x21')]);_0x33cd78[_0xbcbd('0x1f')]=qs[_0xbcbd('0x1f')](_0x5945dd[_0xbcbd('0x34')]['offset']);}return _0x2802ce[_0xbcbd('0x52')](_0x33cd78);}})[_0xbcbd('0x28')](function(_0x173791){if(_0x173791){return _0x173791?{'count':_0x3d6923,'rows':_0x173791}:null;}})[_0xbcbd('0x28')](respondWithResult(_0x4def44,null))[_0xbcbd('0x43')](handleError(_0x4def44,null));};exports[_0xbcbd('0x53')]=function(_0x4728fd,_0x44dcad,_0x36b7d2){var _0x336a14={};var _0x810460={};var _0x54aa8f;var _0x55a5df;return db[_0xbcbd('0x30')][_0xbcbd('0x4c')]({'where':{'id':_0x4728fd[_0xbcbd('0x44')]['id']}})[_0xbcbd('0x28')](handleEntityNotFound(_0x44dcad,null))['then'](function(_0x40c8c1){if(_0x40c8c1){_0x54aa8f=_0x40c8c1;_0x810460[_0xbcbd('0x33')]=_[_0xbcbd('0x45')](db[_0xbcbd('0x54')][_0xbcbd('0x4e')]);_0x810460[_0xbcbd('0x34')]=_['keys'](_0x4728fd['query']);_0x810460[_0xbcbd('0x35')]=_[_0xbcbd('0x36')](_0x810460[_0xbcbd('0x33')],_0x810460[_0xbcbd('0x34')]);_0x336a14[_0xbcbd('0x37')]=_[_0xbcbd('0x36')](_0x810460['model'],qs['fields'](_0x4728fd['query'][_0xbcbd('0x38')]));_0x336a14['attributes']=_0x336a14['attributes'][_0xbcbd('0x39')]?_0x336a14[_0xbcbd('0x37')]:_0x810460[_0xbcbd('0x33')];_0x336a14[_0xbcbd('0x3b')]=qs[_0xbcbd('0x3c')](_0x4728fd[_0xbcbd('0x34')][_0xbcbd('0x3c')]);_0x336a14[_0xbcbd('0x3d')]=qs[_0xbcbd('0x35')](_[_0xbcbd('0x4f')](_0x4728fd[_0xbcbd('0x34')],_0x810460[_0xbcbd('0x35')]));if(_0x4728fd[_0xbcbd('0x34')][_0xbcbd('0x3e')]){_0x336a14[_0xbcbd('0x3d')]=_['merge'](_0x336a14[_0xbcbd('0x3d')],{'$or':_[_0xbcbd('0x2f')](_0x336a14[_0xbcbd('0x37')],function(_0x2e2656){var _0x29968b={};_0x29968b[_0x2e2656]={'$like':'%'+_0x4728fd[_0xbcbd('0x34')]['filter']+'%'};return _0x29968b;})});}_0x336a14=_[_0xbcbd('0x47')]({},_0x336a14,_0x4728fd[_0xbcbd('0x40')]);return _0x54aa8f['getTags'](_0x336a14);}})['then'](function(_0x3d8b49){if(_0x3d8b49){_0x55a5df=_0x3d8b49[_0xbcbd('0x39')];if(!_0x4728fd[_0xbcbd('0x34')][_0xbcbd('0x50')](_0xbcbd('0x3a'))){_0x336a14['limit']=qs[_0xbcbd('0x21')](_0x4728fd[_0xbcbd('0x34')][_0xbcbd('0x21')]);_0x336a14[_0xbcbd('0x1f')]=qs['offset'](_0x4728fd['query'][_0xbcbd('0x1f')]);}return _0x54aa8f['getTags'](_0x336a14);}})['then'](function(_0x25a29f){if(_0x25a29f){return _0x25a29f?{'count':_0x55a5df,'rows':_0x25a29f}:null;}})[_0xbcbd('0x28')](respondWithResult(_0x44dcad,null))[_0xbcbd('0x43')](handleError(_0x44dcad,null));};exports[_0xbcbd('0x55')]=function(_0x28f791,_0x3ab9c2,_0x51752d){if(_0x28f791[_0xbcbd('0x4a')]['id']){delete _0x28f791['body']['id'];}return db['ZendeskConfiguration'][_0xbcbd('0x4c')]({'where':{'id':_0x28f791[_0xbcbd('0x44')]['id']}})[_0xbcbd('0x28')](handleEntityNotFound(_0x3ab9c2,null))[_0xbcbd('0x28')](function(_0x3b2b00){if(_0x3b2b00){return _0x3b2b00['setTags'](_0x28f791[_0xbcbd('0x4a')][_0xbcbd('0x56')]||[]);}return null;})['then'](respondWithResult(_0x3ab9c2,null))[_0xbcbd('0x43')](handleError(_0x3ab9c2,null));}; \ No newline at end of file +var _0x4eb9=['order','filter','findOne','getSubjects','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','update','destroy','error','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','options','includeAll','include','findAll','then','catch','show','params','keys','find','create','body','getFields','ZendeskField'];(function(_0x385346,_0x363dc4){var _0x325242=function(_0x384da7){while(--_0x384da7){_0x385346['push'](_0x385346['shift']());}};_0x325242(++_0x363dc4);}(_0x4eb9,0x154));var _0x94eb=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x4eb9[_0x164eca];return _0x2ce562;};'use strict';var emlformat=require(_0x94eb('0x0'));var rimraf=require(_0x94eb('0x1'));var zipdir=require(_0x94eb('0x2'));var jsonpatch=require(_0x94eb('0x3'));var rp=require('request-promise');var moment=require(_0x94eb('0x4'));var BPromise=require(_0x94eb('0x5'));var Mustache=require(_0x94eb('0x6'));var util=require('util');var path=require(_0x94eb('0x7'));var sox=require(_0x94eb('0x8'));var csv=require('to-csv');var ejs=require(_0x94eb('0x9'));var fs=require('fs');var fs_extra=require(_0x94eb('0xa'));var _=require(_0x94eb('0xb'));var squel=require(_0x94eb('0xc'));var crypto=require(_0x94eb('0xd'));var jsforce=require(_0x94eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x94eb('0xf'));var querystring=require(_0x94eb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x94eb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x94eb('0x12'));var hardwareService=require(_0x94eb('0x13'));var logger=require(_0x94eb('0x14'))(_0x94eb('0x15'));var utils=require(_0x94eb('0x16'));var config=require(_0x94eb('0x17'));var licenseUtil=require(_0x94eb('0x18'));var db=require(_0x94eb('0x19'))['db'];function respondWithStatusCode(_0x10458,_0x316293){_0x316293=_0x316293||0xcc;return function(_0x496095){if(_0x496095){return _0x10458[_0x94eb('0x1a')](_0x316293);}return _0x10458['status'](_0x316293)['end']();};}function respondWithResult(_0x39e8cf,_0x433905){_0x433905=_0x433905||0xc8;return function(_0x91170e){if(_0x91170e){return _0x39e8cf[_0x94eb('0x1b')](_0x433905)[_0x94eb('0x1c')](_0x91170e);}};}function respondWithFilteredResult(_0x4a514e,_0x1a1f52){return function(_0x5ae7db){if(_0x5ae7db){var _0x3520cd=typeof _0x1a1f52['offset']==='undefined'&&typeof _0x1a1f52['limit']==='undefined';var _0x50f448=_0x5ae7db[_0x94eb('0x1d')];var _0x1d16a3=_0x3520cd?0x0:_0x1a1f52[_0x94eb('0x1e')];var _0x493cf9=_0x3520cd?_0x5ae7db[_0x94eb('0x1d')]:_0x1a1f52[_0x94eb('0x1e')]+_0x1a1f52[_0x94eb('0x1f')];var _0xc65019;if(_0x493cf9>=_0x50f448){_0x493cf9=_0x50f448;_0xc65019=0xc8;}else{_0xc65019=0xce;}_0x4a514e[_0x94eb('0x1b')](_0xc65019);return _0x4a514e[_0x94eb('0x20')](_0x94eb('0x21'),_0x1d16a3+'-'+_0x493cf9+'/'+_0x50f448)[_0x94eb('0x1c')](_0x5ae7db);}return null;};}function patchUpdates(_0x53fa6c){return function(_0x255960){try{jsonpatch['apply'](_0x255960,_0x53fa6c,!![]);}catch(_0x3ad22c){return BPromise[_0x94eb('0x22')](_0x3ad22c);}return _0x255960['save']();};}function saveUpdates(_0x303ad0,_0x410e8f){return function(_0x4e3a6a){if(_0x4e3a6a){return _0x4e3a6a[_0x94eb('0x23')](_0x303ad0)['then'](function(_0xf6b8c){return _0xf6b8c;});}return null;};}function removeEntity(_0x17532d,_0xdc4e6c){return function(_0x27a689){if(_0x27a689){return _0x27a689[_0x94eb('0x24')]()['then'](function(){_0x17532d[_0x94eb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53f5f1,_0x33000c){return function(_0x4407e0){if(!_0x4407e0){_0x53f5f1[_0x94eb('0x1a')](0x194);}return _0x4407e0;};}function handleError(_0x254a7d,_0x27a9b4){_0x27a9b4=_0x27a9b4||0x1f4;return function(_0x57d9ea){logger[_0x94eb('0x25')](_0x57d9ea[_0x94eb('0x26')]);if(_0x57d9ea[_0x94eb('0x27')]){delete _0x57d9ea[_0x94eb('0x27')];}_0x254a7d[_0x94eb('0x1b')](_0x27a9b4)['send'](_0x57d9ea);};}exports[_0x94eb('0x28')]=function(_0x46976f,_0x43e8c2){var _0x5028fb={},_0x5353f3={},_0x2f5cae={'count':0x0,'rows':[]};var _0x235ab3=_[_0x94eb('0x29')](db[_0x94eb('0x2a')][_0x94eb('0x2b')],function(_0x57ea00){return{'name':_0x57ea00[_0x94eb('0x2c')],'type':_0x57ea00[_0x94eb('0x2d')][_0x94eb('0x2e')]};});_0x5353f3[_0x94eb('0x2f')]=_[_0x94eb('0x29')](_0x235ab3,_0x94eb('0x27'));_0x5353f3[_0x94eb('0x30')]=_['keys'](_0x46976f[_0x94eb('0x30')]);_0x5353f3['filters']=_['intersection'](_0x5353f3[_0x94eb('0x2f')],_0x5353f3[_0x94eb('0x30')]);_0x5028fb[_0x94eb('0x31')]=_[_0x94eb('0x32')](_0x5353f3[_0x94eb('0x2f')],qs['fields'](_0x46976f[_0x94eb('0x30')][_0x94eb('0x33')]));_0x5028fb['attributes']=_0x5028fb[_0x94eb('0x31')][_0x94eb('0x34')]?_0x5028fb[_0x94eb('0x31')]:_0x5353f3[_0x94eb('0x2f')];if(!_0x46976f[_0x94eb('0x30')][_0x94eb('0x35')](_0x94eb('0x36'))){_0x5028fb[_0x94eb('0x1f')]=qs['limit'](_0x46976f[_0x94eb('0x30')][_0x94eb('0x1f')]);_0x5028fb[_0x94eb('0x1e')]=qs[_0x94eb('0x1e')](_0x46976f[_0x94eb('0x30')][_0x94eb('0x1e')]);}_0x5028fb['order']=qs['sort'](_0x46976f[_0x94eb('0x30')][_0x94eb('0x37')]);_0x5028fb[_0x94eb('0x38')]=qs['filters'](_[_0x94eb('0x39')](_0x46976f[_0x94eb('0x30')],_0x5353f3[_0x94eb('0x3a')]),_0x235ab3);if(_0x46976f[_0x94eb('0x30')]['filter']){_0x5028fb[_0x94eb('0x38')]=_[_0x94eb('0x3b')](_0x5028fb[_0x94eb('0x38')],{'$or':_[_0x94eb('0x29')](_0x235ab3,function(_0x5a6822){if(_0x5a6822[_0x94eb('0x2d')]!==_0x94eb('0x3c')){var _0x4f4aed={};_0x4f4aed[_0x5a6822[_0x94eb('0x27')]]={'$like':'%'+_0x46976f['query']['filter']+'%'};return _0x4f4aed;}})});}_0x5028fb=_[_0x94eb('0x3b')]({},_0x5028fb,_0x46976f[_0x94eb('0x3d')]);var _0x650948={'where':_0x5028fb['where']};return db[_0x94eb('0x2a')][_0x94eb('0x1d')](_0x650948)['then'](function(_0x44af21){_0x2f5cae[_0x94eb('0x1d')]=_0x44af21;if(_0x46976f[_0x94eb('0x30')][_0x94eb('0x3e')]){_0x5028fb[_0x94eb('0x3f')]=[{'all':!![]}];}return db[_0x94eb('0x2a')][_0x94eb('0x40')](_0x5028fb);})[_0x94eb('0x41')](function(_0x2fb5df){_0x2f5cae['rows']=_0x2fb5df;return _0x2f5cae;})[_0x94eb('0x41')](respondWithFilteredResult(_0x43e8c2,_0x5028fb))[_0x94eb('0x42')](handleError(_0x43e8c2,null));};exports[_0x94eb('0x43')]=function(_0x1d37df,_0x3367cf){var _0x2d569e={'raw':![],'where':{'id':_0x1d37df[_0x94eb('0x44')]['id']}},_0x5ae6c4={};_0x5ae6c4[_0x94eb('0x2f')]=_[_0x94eb('0x45')](db[_0x94eb('0x2a')]['rawAttributes']);_0x5ae6c4[_0x94eb('0x30')]=_[_0x94eb('0x45')](_0x1d37df[_0x94eb('0x30')]);_0x5ae6c4[_0x94eb('0x3a')]=_[_0x94eb('0x32')](_0x5ae6c4[_0x94eb('0x2f')],_0x5ae6c4[_0x94eb('0x30')]);_0x2d569e[_0x94eb('0x31')]=_[_0x94eb('0x32')](_0x5ae6c4[_0x94eb('0x2f')],qs['fields'](_0x1d37df[_0x94eb('0x30')][_0x94eb('0x33')]));_0x2d569e['attributes']=_0x2d569e[_0x94eb('0x31')]['length']?_0x2d569e[_0x94eb('0x31')]:_0x5ae6c4[_0x94eb('0x2f')];if(_0x1d37df[_0x94eb('0x30')][_0x94eb('0x3e')]){_0x2d569e[_0x94eb('0x3f')]=[{'all':!![]}];}_0x2d569e=_['merge']({},_0x2d569e,_0x1d37df[_0x94eb('0x3d')]);return db[_0x94eb('0x2a')][_0x94eb('0x46')](_0x2d569e)['then'](handleEntityNotFound(_0x3367cf,null))[_0x94eb('0x41')](respondWithResult(_0x3367cf,null))[_0x94eb('0x42')](handleError(_0x3367cf,null));};exports['create']=function(_0x3043ea,_0xc37bd0){return db['ZendeskConfiguration'][_0x94eb('0x47')](_0x3043ea[_0x94eb('0x48')],{})['then'](respondWithResult(_0xc37bd0,0xc9))[_0x94eb('0x42')](handleError(_0xc37bd0,null));};exports[_0x94eb('0x23')]=function(_0x55db24,_0x241bd5){if(_0x55db24[_0x94eb('0x48')]['id']){delete _0x55db24[_0x94eb('0x48')]['id'];}return db[_0x94eb('0x2a')][_0x94eb('0x46')]({'where':{'id':_0x55db24[_0x94eb('0x44')]['id']}})['then'](handleEntityNotFound(_0x241bd5,null))[_0x94eb('0x41')](saveUpdates(_0x55db24['body'],null))['then'](respondWithResult(_0x241bd5,null))['catch'](handleError(_0x241bd5,null));};exports[_0x94eb('0x24')]=function(_0x37771f,_0x316d7c){return db[_0x94eb('0x2a')][_0x94eb('0x46')]({'where':{'id':_0x37771f[_0x94eb('0x44')]['id']}})[_0x94eb('0x41')](handleEntityNotFound(_0x316d7c,null))[_0x94eb('0x41')](removeEntity(_0x316d7c,null))['catch'](handleError(_0x316d7c,null));};exports[_0x94eb('0x49')]=function(_0x5d84d8,_0x44f329,_0x3fd61b){var _0x33f1f0={};var _0x309988={};var _0xd24c2c;var _0x136d4e;return db[_0x94eb('0x2a')]['findOne']({'where':{'id':_0x5d84d8[_0x94eb('0x44')]['id']}})[_0x94eb('0x41')](handleEntityNotFound(_0x44f329,null))['then'](function(_0xec08a4){if(_0xec08a4){_0xd24c2c=_0xec08a4;_0x309988[_0x94eb('0x2f')]=_[_0x94eb('0x45')](db[_0x94eb('0x4a')][_0x94eb('0x2b')]);_0x309988[_0x94eb('0x30')]=_[_0x94eb('0x45')](_0x5d84d8[_0x94eb('0x30')]);_0x309988[_0x94eb('0x3a')]=_[_0x94eb('0x32')](_0x309988['model'],_0x309988[_0x94eb('0x30')]);_0x33f1f0[_0x94eb('0x31')]=_['intersection'](_0x309988[_0x94eb('0x2f')],qs[_0x94eb('0x33')](_0x5d84d8[_0x94eb('0x30')]['fields']));_0x33f1f0['attributes']=_0x33f1f0[_0x94eb('0x31')][_0x94eb('0x34')]?_0x33f1f0[_0x94eb('0x31')]:_0x309988[_0x94eb('0x2f')];_0x33f1f0[_0x94eb('0x4b')]=qs[_0x94eb('0x37')](_0x5d84d8[_0x94eb('0x30')][_0x94eb('0x37')]);_0x33f1f0['where']=qs['filters'](_['pick'](_0x5d84d8[_0x94eb('0x30')],_0x309988[_0x94eb('0x3a')]));if(_0x5d84d8['query'][_0x94eb('0x4c')]){_0x33f1f0[_0x94eb('0x38')]=_[_0x94eb('0x3b')](_0x33f1f0[_0x94eb('0x38')],{'$or':_[_0x94eb('0x29')](_0x33f1f0[_0x94eb('0x31')],function(_0x17c91d){var _0x5060ee={};_0x5060ee[_0x17c91d]={'$like':'%'+_0x5d84d8[_0x94eb('0x30')][_0x94eb('0x4c')]+'%'};return _0x5060ee;})});}_0x33f1f0=_[_0x94eb('0x3b')]({},_0x33f1f0,_0x5d84d8['options']);return _0xd24c2c[_0x94eb('0x49')](_0x33f1f0);}})[_0x94eb('0x41')](function(_0x7e8bd5){if(_0x7e8bd5){_0x136d4e=_0x7e8bd5[_0x94eb('0x34')];if(!_0x5d84d8[_0x94eb('0x30')][_0x94eb('0x35')](_0x94eb('0x36'))){_0x33f1f0['limit']=qs[_0x94eb('0x1f')](_0x5d84d8[_0x94eb('0x30')]['limit']);_0x33f1f0[_0x94eb('0x1e')]=qs[_0x94eb('0x1e')](_0x5d84d8[_0x94eb('0x30')]['offset']);}return _0xd24c2c[_0x94eb('0x49')](_0x33f1f0);}})[_0x94eb('0x41')](function(_0x53e03d){if(_0x53e03d){return _0x53e03d?{'count':_0x136d4e,'rows':_0x53e03d}:null;}})[_0x94eb('0x41')](respondWithResult(_0x44f329,null))[_0x94eb('0x42')](handleError(_0x44f329,null));};exports['getSubjects']=function(_0x366c74,_0x480419,_0x13bfb1){var _0x5ba993={};var _0x27bcee={};var _0x9fefff;var _0x3e758f;return db[_0x94eb('0x2a')][_0x94eb('0x4d')]({'where':{'id':_0x366c74[_0x94eb('0x44')]['id']}})[_0x94eb('0x41')](handleEntityNotFound(_0x480419,null))[_0x94eb('0x41')](function(_0x5013fb){if(_0x5013fb){_0x9fefff=_0x5013fb;_0x27bcee['model']=_[_0x94eb('0x45')](db[_0x94eb('0x4a')]['rawAttributes']);_0x27bcee[_0x94eb('0x30')]=_[_0x94eb('0x45')](_0x366c74[_0x94eb('0x30')]);_0x27bcee[_0x94eb('0x3a')]=_[_0x94eb('0x32')](_0x27bcee[_0x94eb('0x2f')],_0x27bcee['query']);_0x5ba993['attributes']=_['intersection'](_0x27bcee[_0x94eb('0x2f')],qs[_0x94eb('0x33')](_0x366c74[_0x94eb('0x30')][_0x94eb('0x33')]));_0x5ba993[_0x94eb('0x31')]=_0x5ba993['attributes'][_0x94eb('0x34')]?_0x5ba993['attributes']:_0x27bcee[_0x94eb('0x2f')];_0x5ba993[_0x94eb('0x4b')]=qs[_0x94eb('0x37')](_0x366c74[_0x94eb('0x30')][_0x94eb('0x37')]);_0x5ba993[_0x94eb('0x38')]=qs[_0x94eb('0x3a')](_[_0x94eb('0x39')](_0x366c74[_0x94eb('0x30')],_0x27bcee[_0x94eb('0x3a')]));if(_0x366c74[_0x94eb('0x30')][_0x94eb('0x4c')]){_0x5ba993[_0x94eb('0x38')]=_[_0x94eb('0x3b')](_0x5ba993[_0x94eb('0x38')],{'$or':_[_0x94eb('0x29')](_0x5ba993['attributes'],function(_0x4366ae){var _0x291612={};_0x291612[_0x4366ae]={'$like':'%'+_0x366c74['query'][_0x94eb('0x4c')]+'%'};return _0x291612;})});}_0x5ba993=_[_0x94eb('0x3b')]({},_0x5ba993,_0x366c74[_0x94eb('0x3d')]);return _0x9fefff['getSubjects'](_0x5ba993);}})[_0x94eb('0x41')](function(_0x2a4bac){if(_0x2a4bac){_0x3e758f=_0x2a4bac['length'];if(!_0x366c74[_0x94eb('0x30')]['hasOwnProperty'](_0x94eb('0x36'))){_0x5ba993[_0x94eb('0x1f')]=qs['limit'](_0x366c74['query'][_0x94eb('0x1f')]);_0x5ba993[_0x94eb('0x1e')]=qs[_0x94eb('0x1e')](_0x366c74[_0x94eb('0x30')][_0x94eb('0x1e')]);}return _0x9fefff[_0x94eb('0x4e')](_0x5ba993);}})[_0x94eb('0x41')](function(_0x3f2733){if(_0x3f2733){return _0x3f2733?{'count':_0x3e758f,'rows':_0x3f2733}:null;}})[_0x94eb('0x41')](respondWithResult(_0x480419,null))['catch'](handleError(_0x480419,null));};exports['getDescriptions']=function(_0x4f499d,_0x2de899,_0x4be0a6){var _0x2600d8={};var _0x37df61={};var _0x391937;var _0x390497;return db[_0x94eb('0x2a')]['findOne']({'where':{'id':_0x4f499d[_0x94eb('0x44')]['id']}})[_0x94eb('0x41')](handleEntityNotFound(_0x2de899,null))[_0x94eb('0x41')](function(_0x1600e5){if(_0x1600e5){_0x391937=_0x1600e5;_0x37df61[_0x94eb('0x2f')]=_[_0x94eb('0x45')](db['ZendeskField'][_0x94eb('0x2b')]);_0x37df61[_0x94eb('0x30')]=_[_0x94eb('0x45')](_0x4f499d[_0x94eb('0x30')]);_0x37df61['filters']=_[_0x94eb('0x32')](_0x37df61[_0x94eb('0x2f')],_0x37df61[_0x94eb('0x30')]);_0x2600d8[_0x94eb('0x31')]=_[_0x94eb('0x32')](_0x37df61[_0x94eb('0x2f')],qs[_0x94eb('0x33')](_0x4f499d[_0x94eb('0x30')][_0x94eb('0x33')]));_0x2600d8['attributes']=_0x2600d8[_0x94eb('0x31')][_0x94eb('0x34')]?_0x2600d8[_0x94eb('0x31')]:_0x37df61[_0x94eb('0x2f')];_0x2600d8[_0x94eb('0x4b')]=qs[_0x94eb('0x37')](_0x4f499d['query'][_0x94eb('0x37')]);_0x2600d8[_0x94eb('0x38')]=qs[_0x94eb('0x3a')](_[_0x94eb('0x39')](_0x4f499d[_0x94eb('0x30')],_0x37df61['filters']));if(_0x4f499d[_0x94eb('0x30')]['filter']){_0x2600d8['where']=_['merge'](_0x2600d8[_0x94eb('0x38')],{'$or':_[_0x94eb('0x29')](_0x2600d8[_0x94eb('0x31')],function(_0x218f6c){var _0x1955eb={};_0x1955eb[_0x218f6c]={'$like':'%'+_0x4f499d[_0x94eb('0x30')][_0x94eb('0x4c')]+'%'};return _0x1955eb;})});}_0x2600d8=_[_0x94eb('0x3b')]({},_0x2600d8,_0x4f499d['options']);return _0x391937['getDescriptions'](_0x2600d8);}})['then'](function(_0x51e6bb){if(_0x51e6bb){_0x390497=_0x51e6bb['length'];if(!_0x4f499d[_0x94eb('0x30')]['hasOwnProperty']('nolimit')){_0x2600d8[_0x94eb('0x1f')]=qs[_0x94eb('0x1f')](_0x4f499d[_0x94eb('0x30')][_0x94eb('0x1f')]);_0x2600d8['offset']=qs[_0x94eb('0x1e')](_0x4f499d[_0x94eb('0x30')][_0x94eb('0x1e')]);}return _0x391937['getDescriptions'](_0x2600d8);}})['then'](function(_0x1f3a43){if(_0x1f3a43){return _0x1f3a43?{'count':_0x390497,'rows':_0x1f3a43}:null;}})[_0x94eb('0x41')](respondWithResult(_0x2de899,null))['catch'](handleError(_0x2de899,null));};exports[_0x94eb('0x4f')]=function(_0x3f0c81,_0x42b6da,_0x2c8171){var _0x34c27b={};var _0x585ff8={};var _0x1d28b9;var _0x3ba1e5;return db[_0x94eb('0x2a')]['findOne']({'where':{'id':_0x3f0c81[_0x94eb('0x44')]['id']}})[_0x94eb('0x41')](handleEntityNotFound(_0x42b6da,null))[_0x94eb('0x41')](function(_0x59c526){if(_0x59c526){_0x1d28b9=_0x59c526;_0x585ff8[_0x94eb('0x2f')]=_['keys'](db[_0x94eb('0x50')][_0x94eb('0x2b')]);_0x585ff8[_0x94eb('0x30')]=_[_0x94eb('0x45')](_0x3f0c81['query']);_0x585ff8['filters']=_[_0x94eb('0x32')](_0x585ff8[_0x94eb('0x2f')],_0x585ff8[_0x94eb('0x30')]);_0x34c27b[_0x94eb('0x31')]=_[_0x94eb('0x32')](_0x585ff8['model'],qs[_0x94eb('0x33')](_0x3f0c81[_0x94eb('0x30')][_0x94eb('0x33')]));_0x34c27b[_0x94eb('0x31')]=_0x34c27b[_0x94eb('0x31')]['length']?_0x34c27b[_0x94eb('0x31')]:_0x585ff8[_0x94eb('0x2f')];_0x34c27b['order']=qs['sort'](_0x3f0c81[_0x94eb('0x30')]['sort']);_0x34c27b[_0x94eb('0x38')]=qs[_0x94eb('0x3a')](_[_0x94eb('0x39')](_0x3f0c81['query'],_0x585ff8[_0x94eb('0x3a')]));if(_0x3f0c81[_0x94eb('0x30')][_0x94eb('0x4c')]){_0x34c27b[_0x94eb('0x38')]=_['merge'](_0x34c27b['where'],{'$or':_[_0x94eb('0x29')](_0x34c27b[_0x94eb('0x31')],function(_0x376a17){var _0x413642={};_0x413642[_0x376a17]={'$like':'%'+_0x3f0c81['query']['filter']+'%'};return _0x413642;})});}_0x34c27b=_[_0x94eb('0x3b')]({},_0x34c27b,_0x3f0c81[_0x94eb('0x3d')]);return _0x1d28b9[_0x94eb('0x4f')](_0x34c27b);}})['then'](function(_0x435a0e){if(_0x435a0e){_0x3ba1e5=_0x435a0e['length'];if(!_0x3f0c81['query'][_0x94eb('0x35')]('nolimit')){_0x34c27b[_0x94eb('0x1f')]=qs[_0x94eb('0x1f')](_0x3f0c81[_0x94eb('0x30')][_0x94eb('0x1f')]);_0x34c27b[_0x94eb('0x1e')]=qs[_0x94eb('0x1e')](_0x3f0c81[_0x94eb('0x30')][_0x94eb('0x1e')]);}return _0x1d28b9[_0x94eb('0x4f')](_0x34c27b);}})['then'](function(_0x4c94c9){if(_0x4c94c9){return _0x4c94c9?{'count':_0x3ba1e5,'rows':_0x4c94c9}:null;}})[_0x94eb('0x41')](respondWithResult(_0x42b6da,null))[_0x94eb('0x42')](handleError(_0x42b6da,null));};exports[_0x94eb('0x51')]=function(_0x35dc01,_0x3b319e,_0x5bfaa5){if(_0x35dc01['body']['id']){delete _0x35dc01[_0x94eb('0x48')]['id'];}return db[_0x94eb('0x2a')]['findOne']({'where':{'id':_0x35dc01[_0x94eb('0x44')]['id']}})[_0x94eb('0x41')](handleEntityNotFound(_0x3b319e,null))[_0x94eb('0x41')](function(_0x409e0b){if(_0x409e0b){return _0x409e0b[_0x94eb('0x51')](_0x35dc01[_0x94eb('0x48')][_0x94eb('0x52')]||[]);}return null;})[_0x94eb('0x41')](respondWithResult(_0x3b319e,null))[_0x94eb('0x42')](handleError(_0x3b319e,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index dfbd6b3..6ab7ffa 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 _0x087b=['../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','moment','request-promise','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x087b,0x11a));var _0xb087=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x087b[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb087('0x2'));var BPromise=require('bluebird');var rp=require(_0xb087('0x3'));var fs=require('fs');var path=require(_0xb087('0x4'));var rimraf=require(_0xb087('0x5'));var config=require(_0xb087('0x6'));var attributes=require(_0xb087('0x7'));module[_0xb087('0x8')]=function(_0x40156d,_0x17d6e8){return _0x40156d[_0xb087('0x9')](_0xb087('0xa'),attributes,{'tableName':_0xb087('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbbc=['request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x23cd38,_0x469e53){_0x23cd38=_0x23cd38-0x0;var _0x4ef98b=_0xbbbc[_0x23cd38];return _0x4ef98b;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var logger=require(_0xcbbb('0x2'))(_0xcbbb('0x3'));var moment=require(_0xcbbb('0x4'));var BPromise=require(_0xcbbb('0x5'));var rp=require(_0xcbbb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcbbb('0x7'));var config=require(_0xcbbb('0x8'));var attributes=require(_0xcbbb('0x9'));module[_0xcbbb('0xa')]=function(_0x43ff05,_0x4978a9){return _0x43ff05[_0xcbbb('0xb')](_0xcbbb('0xc'),attributes,{'tableName':_0xcbbb('0xd'),'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 79c4014..3ec7ee6 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 _0x39bb=['ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x2b6d46,_0x11867e){var _0x555bdb=function(_0x11122d){while(--_0x11122d){_0x2b6d46['push'](_0x2b6d46['shift']());}};_0x555bdb(++_0x11867e);}(_0x39bb,0x125));var _0xb39b=function(_0x539d7b,_0x5f2eba){_0x539d7b=_0x539d7b-0x0;var _0x31953c=_0x39bb[_0x539d7b];return _0x31953c;};'use strict';var _=require(_0xb39b('0x0'));var util=require('util');var moment=require(_0xb39b('0x1'));var BPromise=require(_0xb39b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb39b('0x3'));var db=require(_0xb39b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb39b('0x5'));var config=require(_0xb39b('0x6'));var jayson=require(_0xb39b('0x7'));var client=jayson[_0xb39b('0x8')][_0xb39b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3666d3,_0xec3478,_0x236f51){return new BPromise(function(_0x4a38a9,_0x51c61e){return client[_0xb39b('0xa')](_0x3666d3,_0x236f51)[_0xb39b('0xb')](function(_0x468273){logger[_0xb39b('0xc')](_0xb39b('0xd'),_0xec3478,_0xb39b('0xe'));logger['debug'](_0xb39b('0xf'),_0xec3478,_0xb39b('0xe'),JSON[_0xb39b('0x10')](_0x468273));if(_0x468273[_0xb39b('0x11')]){if(_0x468273[_0xb39b('0x11')][_0xb39b('0x12')]===0x1f4){logger[_0xb39b('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0xec3478,_0x468273['error'][_0xb39b('0x13')]);return _0x51c61e(_0x468273[_0xb39b('0x11')][_0xb39b('0x13')]);}logger[_0xb39b('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0xec3478,_0x468273[_0xb39b('0x11')][_0xb39b('0x13')]);return _0x4a38a9(_0x468273['error'][_0xb39b('0x13')]);}else{logger[_0xb39b('0xc')](_0xb39b('0xd'),_0xec3478,_0xb39b('0xe'));_0x4a38a9(_0x468273[_0xb39b('0x14')][_0xb39b('0x13')]);}})[_0xb39b('0x15')](function(_0x49c73d){logger[_0xb39b('0x11')](_0xb39b('0xd'),_0xec3478,_0x49c73d);_0x51c61e(_0x49c73d);});});} \ No newline at end of file +var _0x94c8=['info','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then'];(function(_0xab2fa1,_0x65e0c6){var _0x33c287=function(_0x3016aa){while(--_0x3016aa){_0xab2fa1['push'](_0xab2fa1['shift']());}};_0x33c287(++_0x65e0c6);}(_0x94c8,0x1d1));var _0x894c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x94c8[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x894c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x894c('0x1'));var fs=require('fs');var Redis=require(_0x894c('0x2'));var db=require(_0x894c('0x3'))['db'];var utils=require(_0x894c('0x4'));var logger=require(_0x894c('0x5'))(_0x894c('0x6'));var config=require(_0x894c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x894c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x497219,_0x1739d9,_0x7b0732){return new BPromise(function(_0x39cf0a,_0x453269){return client['request'](_0x497219,_0x7b0732)[_0x894c('0x9')](function(_0x5c755c){logger[_0x894c('0xa')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1739d9,'request\x20sent');logger[_0x894c('0xb')](_0x894c('0xc'),_0x1739d9,_0x894c('0xd'),JSON['stringify'](_0x5c755c));if(_0x5c755c['error']){if(_0x5c755c[_0x894c('0xe')][_0x894c('0xf')]===0x1f4){logger[_0x894c('0xe')](_0x894c('0x10'),_0x1739d9,_0x5c755c[_0x894c('0xe')][_0x894c('0x11')]);return _0x453269(_0x5c755c[_0x894c('0xe')][_0x894c('0x11')]);}logger[_0x894c('0xe')](_0x894c('0x10'),_0x1739d9,_0x5c755c[_0x894c('0xe')][_0x894c('0x11')]);return _0x39cf0a(_0x5c755c[_0x894c('0xe')][_0x894c('0x11')]);}else{logger[_0x894c('0xa')](_0x894c('0x10'),_0x1739d9,_0x894c('0xd'));_0x39cf0a(_0x5c755c[_0x894c('0x12')][_0x894c('0x11')]);}})['catch'](function(_0x4a8354){logger[_0x894c('0xe')](_0x894c('0x10'),_0x1739d9,_0x4a8354);_0x453269(_0x4a8354);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 3b25662..fff377d 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 _0x4c8a=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','post','create'];(function(_0x2b5854,_0x4d5ef9){var _0x178735=function(_0xe1802f){while(--_0xe1802f){_0x2b5854['push'](_0x2b5854['shift']());}};_0x178735(++_0x4d5ef9);}(_0x4c8a,0xd6));var _0xa4c8=function(_0x2c3e24,_0x473712){_0x2c3e24=_0x2c3e24-0x0;var _0x514e73=_0x4c8a[_0x2c3e24];return _0x514e73;};'use strict';var multer=require(_0xa4c8('0x0'));var util=require(_0xa4c8('0x1'));var path=require(_0xa4c8('0x2'));var timeout=require(_0xa4c8('0x3'));var express=require(_0xa4c8('0x4'));var router=express[_0xa4c8('0x5')]();var fs_extra=require(_0xa4c8('0x6'));var auth=require(_0xa4c8('0x7'));var interaction=require(_0xa4c8('0x8'));var config=require(_0xa4c8('0x9'));var controller=require(_0xa4c8('0xa'));router[_0xa4c8('0xb')]('/',auth[_0xa4c8('0xc')](),controller[_0xa4c8('0xd')]);router['get'](_0xa4c8('0xe'),auth[_0xa4c8('0xc')](),controller['show']);router[_0xa4c8('0xf')]('/',auth['isAuthenticated'](),controller[_0xa4c8('0x10')]);router[_0xa4c8('0x11')](_0xa4c8('0xe'),auth[_0xa4c8('0xc')](),controller[_0xa4c8('0x12')]);router[_0xa4c8('0x13')](_0xa4c8('0xe'),auth[_0xa4c8('0xc')](),controller[_0xa4c8('0x14')]);module['exports']=router; \ No newline at end of file +var _0x8f6e=['post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5ba38a,_0x132834){var _0x28eebe=function(_0x56946a){while(--_0x56946a){_0x5ba38a['push'](_0x5ba38a['shift']());}};_0x28eebe(++_0x132834);}(_0x8f6e,0x182));var _0xe8f6=function(_0x405778,_0xa4dd3b){_0x405778=_0x405778-0x0;var _0x341735=_0x8f6e[_0x405778];return _0x341735;};'use strict';var multer=require(_0xe8f6('0x0'));var util=require(_0xe8f6('0x1'));var path=require('path');var timeout=require(_0xe8f6('0x2'));var express=require(_0xe8f6('0x3'));var router=express[_0xe8f6('0x4')]();var fs_extra=require(_0xe8f6('0x5'));var auth=require(_0xe8f6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe8f6('0x7'));var controller=require(_0xe8f6('0x8'));router[_0xe8f6('0x9')]('/',auth[_0xe8f6('0xa')](),controller[_0xe8f6('0xb')]);router[_0xe8f6('0x9')](_0xe8f6('0xc'),auth[_0xe8f6('0xa')](),controller[_0xe8f6('0xd')]);router[_0xe8f6('0xe')]('/',auth[_0xe8f6('0xa')](),controller[_0xe8f6('0xf')]);router[_0xe8f6('0x10')](_0xe8f6('0xc'),auth[_0xe8f6('0xa')](),controller[_0xe8f6('0x11')]);router[_0xe8f6('0x12')](_0xe8f6('0xc'),auth[_0xe8f6('0xa')](),controller['destroy']);module[_0xe8f6('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 fb7a659..46e41d6 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 _0xa00e=['picklist','STRING','variable','sequelize','exports','ENUM','string','customVariable','keyValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa00e,0x66));var _0xea00=function(_0x2e69c9,_0x116647){_0x2e69c9=_0x2e69c9-0x0;var _0x2b5b60=_0xa00e[_0x2e69c9];return _0x2b5b60;};'use strict';var Sequelize=require(_0xea00('0x0'));module[_0xea00('0x1')]={'type':{'type':Sequelize[_0xea00('0x2')](_0xea00('0x3'),'variable',_0xea00('0x4'),_0xea00('0x5'),_0xea00('0x6')),'defaultValue':_0xea00('0x3')},'content':{'type':Sequelize[_0xea00('0x7')]},'key':{'type':Sequelize[_0xea00('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xea00('0x3'),_0xea00('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0xea00('0x7')]},'idField':{'type':Sequelize[_0xea00('0x7')]},'nameField':{'type':Sequelize[_0xea00('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3fc2=['ENUM','customVariable','sequelize','exports','string','variable','keyValue','picklist','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3fc2,0x185));var _0x23fc=function(_0x5133dd,_0x1e12cc){_0x5133dd=_0x5133dd-0x0;var _0x58a982=_0x3fc2[_0x5133dd];return _0x58a982;};'use strict';var Sequelize=require(_0x23fc('0x0'));module[_0x23fc('0x1')]={'type':{'type':Sequelize['ENUM'](_0x23fc('0x2'),_0x23fc('0x3'),'customVariable',_0x23fc('0x4'),_0x23fc('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x23fc('0x6')]},'key':{'type':Sequelize[_0x23fc('0x6')]},'keyType':{'type':Sequelize[_0x23fc('0x7')](_0x23fc('0x2'),_0x23fc('0x3'),_0x23fc('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x23fc('0x6')]},'nameField':{'type':Sequelize[_0x23fc('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x23fc('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 508c50c..60cc190 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 _0xcecb=['includeAll','include','findAll','rows','catch','show','length','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','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','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','ZendeskField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0x59e40a,_0x3007b2){var _0x75a770=function(_0x900d74){while(--_0x900d74){_0x59e40a['push'](_0x59e40a['shift']());}};_0x75a770(++_0x3007b2);}(_0xcecb,0xf8));var _0xbcec=function(_0x4beb99,_0x11fa63){_0x4beb99=_0x4beb99-0x0;var _0x3f8491=_0xcecb[_0x4beb99];return _0x3f8491;};'use strict';var emlformat=require(_0xbcec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbcec('0x1'));var jsonpatch=require(_0xbcec('0x2'));var rp=require(_0xbcec('0x3'));var moment=require(_0xbcec('0x4'));var BPromise=require(_0xbcec('0x5'));var Mustache=require(_0xbcec('0x6'));var util=require(_0xbcec('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xbcec('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbcec('0x9'));var _=require(_0xbcec('0xa'));var squel=require(_0xbcec('0xb'));var crypto=require('crypto');var jsforce=require(_0xbcec('0xc'));var deskjs=require(_0xbcec('0xd'));var toCsv=require(_0xbcec('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbcec('0xe'));var authService=require(_0xbcec('0xf'));var qs=require(_0xbcec('0x10'));var as=require(_0xbcec('0x11'));var hardwareService=require(_0xbcec('0x12'));var logger=require(_0xbcec('0x13'))('api');var utils=require(_0xbcec('0x14'));var config=require(_0xbcec('0x15'));var licenseUtil=require(_0xbcec('0x16'));var db=require(_0xbcec('0x17'))['db'];function respondWithStatusCode(_0x4fae59,_0x24c2ac){_0x24c2ac=_0x24c2ac||0xcc;return function(_0x1eed2f){if(_0x1eed2f){return _0x4fae59[_0xbcec('0x18')](_0x24c2ac);}return _0x4fae59[_0xbcec('0x19')](_0x24c2ac)['end']();};}function respondWithResult(_0x3aa15f,_0x1fbe2a){_0x1fbe2a=_0x1fbe2a||0xc8;return function(_0x1f1c68){if(_0x1f1c68){return _0x3aa15f[_0xbcec('0x19')](_0x1fbe2a)[_0xbcec('0x1a')](_0x1f1c68);}};}function respondWithFilteredResult(_0x21c521,_0xf5ec7a){return function(_0x499dc4){if(_0x499dc4){var _0x40699d=typeof _0xf5ec7a[_0xbcec('0x1b')]===_0xbcec('0x1c')&&typeof _0xf5ec7a['limit']===_0xbcec('0x1c');var _0x498d04=_0x499dc4[_0xbcec('0x1d')];var _0x362e15=_0x40699d?0x0:_0xf5ec7a[_0xbcec('0x1b')];var _0x20585a=_0x40699d?_0x499dc4[_0xbcec('0x1d')]:_0xf5ec7a['offset']+_0xf5ec7a[_0xbcec('0x1e')];var _0x254736;if(_0x20585a>=_0x498d04){_0x20585a=_0x498d04;_0x254736=0xc8;}else{_0x254736=0xce;}_0x21c521[_0xbcec('0x19')](_0x254736);return _0x21c521[_0xbcec('0x1f')](_0xbcec('0x20'),_0x362e15+'-'+_0x20585a+'/'+_0x498d04)['json'](_0x499dc4);}return null;};}function patchUpdates(_0x1c99fa){return function(_0x174261){try{jsonpatch[_0xbcec('0x21')](_0x174261,_0x1c99fa,!![]);}catch(_0x59c933){return BPromise[_0xbcec('0x22')](_0x59c933);}return _0x174261[_0xbcec('0x23')]();};}function saveUpdates(_0x4a7f1d,_0x348b54){return function(_0x376d1e){if(_0x376d1e){return _0x376d1e[_0xbcec('0x24')](_0x4a7f1d)[_0xbcec('0x25')](function(_0x4c4323){return _0x4c4323;});}return null;};}function removeEntity(_0x19f3a0,_0x1bdcb0){return function(_0x259a30){if(_0x259a30){return _0x259a30[_0xbcec('0x26')]()[_0xbcec('0x25')](function(){_0x19f3a0[_0xbcec('0x19')](0xcc)[_0xbcec('0x27')]();});}};}function handleEntityNotFound(_0x167bce,_0x33fe96){return function(_0x274558){if(!_0x274558){_0x167bce['sendStatus'](0x194);}return _0x274558;};}function handleError(_0x209155,_0x453892){_0x453892=_0x453892||0x1f4;return function(_0x2424c4){logger[_0xbcec('0x28')](_0x2424c4[_0xbcec('0x29')]);if(_0x2424c4[_0xbcec('0x2a')]){delete _0x2424c4['name'];}_0x209155['status'](_0x453892)[_0xbcec('0x2b')](_0x2424c4);};}exports[_0xbcec('0x2c')]=function(_0x2b23f3,_0x4d40e2){var _0xc98ef7={},_0x5559e4={},_0x2783f0={'count':0x0,'rows':[]};var _0x48a8da=_['map'](db[_0xbcec('0x2d')][_0xbcec('0x2e')],function(_0x305c9a){return{'name':_0x305c9a[_0xbcec('0x2f')],'type':_0x305c9a[_0xbcec('0x30')][_0xbcec('0x31')]};});_0x5559e4[_0xbcec('0x32')]=_[_0xbcec('0x33')](_0x48a8da,_0xbcec('0x2a'));_0x5559e4[_0xbcec('0x34')]=_[_0xbcec('0x35')](_0x2b23f3[_0xbcec('0x34')]);_0x5559e4[_0xbcec('0x36')]=_['intersection'](_0x5559e4[_0xbcec('0x32')],_0x5559e4[_0xbcec('0x34')]);_0xc98ef7[_0xbcec('0x37')]=_[_0xbcec('0x38')](_0x5559e4[_0xbcec('0x32')],qs[_0xbcec('0x39')](_0x2b23f3['query']['fields']));_0xc98ef7[_0xbcec('0x37')]=_0xc98ef7[_0xbcec('0x37')]['length']?_0xc98ef7['attributes']:_0x5559e4[_0xbcec('0x32')];if(!_0x2b23f3[_0xbcec('0x34')][_0xbcec('0x3a')](_0xbcec('0x3b'))){_0xc98ef7[_0xbcec('0x1e')]=qs['limit'](_0x2b23f3['query'][_0xbcec('0x1e')]);_0xc98ef7['offset']=qs['offset'](_0x2b23f3[_0xbcec('0x34')][_0xbcec('0x1b')]);}_0xc98ef7[_0xbcec('0x3c')]=qs[_0xbcec('0x3d')](_0x2b23f3[_0xbcec('0x34')]['sort']);_0xc98ef7[_0xbcec('0x3e')]=qs[_0xbcec('0x36')](_[_0xbcec('0x3f')](_0x2b23f3[_0xbcec('0x34')],_0x5559e4['filters']),_0x48a8da);if(_0x2b23f3[_0xbcec('0x34')]['filter']){_0xc98ef7[_0xbcec('0x3e')]=_[_0xbcec('0x40')](_0xc98ef7[_0xbcec('0x3e')],{'$or':_[_0xbcec('0x33')](_0x48a8da,function(_0x1baf9d){if(_0x1baf9d[_0xbcec('0x30')]!==_0xbcec('0x41')){var _0x5602eb={};_0x5602eb[_0x1baf9d[_0xbcec('0x2a')]]={'$like':'%'+_0x2b23f3['query'][_0xbcec('0x42')]+'%'};return _0x5602eb;}})});}_0xc98ef7=_['merge']({},_0xc98ef7,_0x2b23f3[_0xbcec('0x43')]);var _0x916f95={'where':_0xc98ef7[_0xbcec('0x3e')]};return db[_0xbcec('0x2d')]['count'](_0x916f95)['then'](function(_0x586a6f){_0x2783f0[_0xbcec('0x1d')]=_0x586a6f;if(_0x2b23f3['query'][_0xbcec('0x44')]){_0xc98ef7[_0xbcec('0x45')]=[{'all':!![]}];}return db[_0xbcec('0x2d')][_0xbcec('0x46')](_0xc98ef7);})[_0xbcec('0x25')](function(_0x2100eb){_0x2783f0[_0xbcec('0x47')]=_0x2100eb;return _0x2783f0;})[_0xbcec('0x25')](respondWithFilteredResult(_0x4d40e2,_0xc98ef7))[_0xbcec('0x48')](handleError(_0x4d40e2,null));};exports[_0xbcec('0x49')]=function(_0x564676,_0x3afcbc){var _0x36ce39={'raw':!![],'where':{'id':_0x564676['params']['id']}},_0xfc613f={};_0xfc613f[_0xbcec('0x32')]=_[_0xbcec('0x35')](db[_0xbcec('0x2d')][_0xbcec('0x2e')]);_0xfc613f[_0xbcec('0x34')]=_[_0xbcec('0x35')](_0x564676['query']);_0xfc613f['filters']=_[_0xbcec('0x38')](_0xfc613f[_0xbcec('0x32')],_0xfc613f['query']);_0x36ce39['attributes']=_[_0xbcec('0x38')](_0xfc613f[_0xbcec('0x32')],qs[_0xbcec('0x39')](_0x564676[_0xbcec('0x34')][_0xbcec('0x39')]));_0x36ce39[_0xbcec('0x37')]=_0x36ce39[_0xbcec('0x37')][_0xbcec('0x4a')]?_0x36ce39[_0xbcec('0x37')]:_0xfc613f[_0xbcec('0x32')];if(_0x564676[_0xbcec('0x34')][_0xbcec('0x44')]){_0x36ce39[_0xbcec('0x45')]=[{'all':!![]}];}_0x36ce39=_['merge']({},_0x36ce39,_0x564676[_0xbcec('0x43')]);return db['ZendeskField'][_0xbcec('0x4b')](_0x36ce39)[_0xbcec('0x25')](handleEntityNotFound(_0x3afcbc,null))['then'](respondWithResult(_0x3afcbc,null))['catch'](handleError(_0x3afcbc,null));};exports[_0xbcec('0x4c')]=function(_0x433b46,_0x585eeb){return db[_0xbcec('0x2d')][_0xbcec('0x4c')](_0x433b46[_0xbcec('0x4d')],{})[_0xbcec('0x25')](respondWithResult(_0x585eeb,0xc9))[_0xbcec('0x48')](handleError(_0x585eeb,null));};exports[_0xbcec('0x24')]=function(_0x58ad0d,_0x101100){if(_0x58ad0d['body']['id']){delete _0x58ad0d[_0xbcec('0x4d')]['id'];}return db[_0xbcec('0x2d')][_0xbcec('0x4b')]({'where':{'id':_0x58ad0d[_0xbcec('0x4e')]['id']}})[_0xbcec('0x25')](handleEntityNotFound(_0x101100,null))[_0xbcec('0x25')](saveUpdates(_0x58ad0d[_0xbcec('0x4d')],null))[_0xbcec('0x25')](respondWithResult(_0x101100,null))[_0xbcec('0x48')](handleError(_0x101100,null));};exports[_0xbcec('0x26')]=function(_0x5c92ef,_0x5934e4){return db['ZendeskField'][_0xbcec('0x4b')]({'where':{'id':_0x5c92ef[_0xbcec('0x4e')]['id']}})[_0xbcec('0x25')](handleEntityNotFound(_0x5934e4,null))[_0xbcec('0x25')](removeEntity(_0x5934e4,null))['catch'](handleError(_0x5934e4,null));}; \ No newline at end of file +var _0x4e4d=['util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../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','error','stack','name','send','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','fields','includeAll','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0xab264e,_0x21d1bf){var _0x5b4624=function(_0x506de8){while(--_0x506de8){_0xab264e['push'](_0xab264e['shift']());}};_0x5b4624(++_0x21d1bf);}(_0x4e4d,0x1c6));var _0xd4e4=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0x4e4d[_0x2c0dc0];return _0x4c0990;};'use strict';var emlformat=require(_0xd4e4('0x0'));var rimraf=require(_0xd4e4('0x1'));var zipdir=require(_0xd4e4('0x2'));var jsonpatch=require(_0xd4e4('0x3'));var rp=require(_0xd4e4('0x4'));var moment=require(_0xd4e4('0x5'));var BPromise=require(_0xd4e4('0x6'));var Mustache=require(_0xd4e4('0x7'));var util=require(_0xd4e4('0x8'));var path=require(_0xd4e4('0x9'));var sox=require(_0xd4e4('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4e4('0xb'));var squel=require(_0xd4e4('0xc'));var crypto=require(_0xd4e4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd4e4('0xe'));var toCsv=require(_0xd4e4('0xf'));var querystring=require(_0xd4e4('0x10'));var Papa=require('papaparse');var Redis=require(_0xd4e4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd4e4('0x12'));var as=require(_0xd4e4('0x13'));var hardwareService=require(_0xd4e4('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd4e4('0x15'));var config=require(_0xd4e4('0x16'));var licenseUtil=require(_0xd4e4('0x17'));var db=require(_0xd4e4('0x18'))['db'];function respondWithStatusCode(_0x3c441c,_0x1b08f5){_0x1b08f5=_0x1b08f5||0xcc;return function(_0x530c16){if(_0x530c16){return _0x3c441c['sendStatus'](_0x1b08f5);}return _0x3c441c[_0xd4e4('0x19')](_0x1b08f5)[_0xd4e4('0x1a')]();};}function respondWithResult(_0x545ad5,_0x22250c){_0x22250c=_0x22250c||0xc8;return function(_0x2bb6a8){if(_0x2bb6a8){return _0x545ad5['status'](_0x22250c)[_0xd4e4('0x1b')](_0x2bb6a8);}};}function respondWithFilteredResult(_0x22597f,_0x5bc5ba){return function(_0x2af241){if(_0x2af241){var _0x2dfe6c=typeof _0x5bc5ba[_0xd4e4('0x1c')]==='undefined'&&typeof _0x5bc5ba[_0xd4e4('0x1d')]===_0xd4e4('0x1e');var _0x42002c=_0x2af241[_0xd4e4('0x1f')];var _0x39b8a8=_0x2dfe6c?0x0:_0x5bc5ba['offset'];var _0xe771ff=_0x2dfe6c?_0x2af241[_0xd4e4('0x1f')]:_0x5bc5ba[_0xd4e4('0x1c')]+_0x5bc5ba['limit'];var _0x2fe87;if(_0xe771ff>=_0x42002c){_0xe771ff=_0x42002c;_0x2fe87=0xc8;}else{_0x2fe87=0xce;}_0x22597f[_0xd4e4('0x19')](_0x2fe87);return _0x22597f[_0xd4e4('0x20')](_0xd4e4('0x21'),_0x39b8a8+'-'+_0xe771ff+'/'+_0x42002c)[_0xd4e4('0x1b')](_0x2af241);}return null;};}function patchUpdates(_0x12282c){return function(_0x26fab3){try{jsonpatch[_0xd4e4('0x22')](_0x26fab3,_0x12282c,!![]);}catch(_0x255ce6){return BPromise[_0xd4e4('0x23')](_0x255ce6);}return _0x26fab3[_0xd4e4('0x24')]();};}function saveUpdates(_0x9c29c6,_0x1bf6b4){return function(_0x115756){if(_0x115756){return _0x115756[_0xd4e4('0x25')](_0x9c29c6)[_0xd4e4('0x26')](function(_0x5f0dda){return _0x5f0dda;});}return null;};}function removeEntity(_0x5840f5,_0x384389){return function(_0x281e97){if(_0x281e97){return _0x281e97[_0xd4e4('0x27')]()[_0xd4e4('0x26')](function(){_0x5840f5[_0xd4e4('0x19')](0xcc)[_0xd4e4('0x1a')]();});}};}function handleEntityNotFound(_0x52f62d,_0x176fe1){return function(_0x27da67){if(!_0x27da67){_0x52f62d[_0xd4e4('0x28')](0x194);}return _0x27da67;};}function handleError(_0x1e2dd5,_0x1837c4){_0x1837c4=_0x1837c4||0x1f4;return function(_0x1c9c11){logger[_0xd4e4('0x29')](_0x1c9c11[_0xd4e4('0x2a')]);if(_0x1c9c11[_0xd4e4('0x2b')]){delete _0x1c9c11['name'];}_0x1e2dd5[_0xd4e4('0x19')](_0x1837c4)[_0xd4e4('0x2c')](_0x1c9c11);};}exports['index']=function(_0x2708fa,_0x3be9ff){var _0x289fac={},_0x19a81e={},_0x36230f={'count':0x0,'rows':[]};var _0x575e45=_[_0xd4e4('0x2d')](db[_0xd4e4('0x2e')][_0xd4e4('0x2f')],function(_0x5062b0){return{'name':_0x5062b0[_0xd4e4('0x30')],'type':_0x5062b0[_0xd4e4('0x31')][_0xd4e4('0x32')]};});_0x19a81e[_0xd4e4('0x33')]=_[_0xd4e4('0x2d')](_0x575e45,_0xd4e4('0x2b'));_0x19a81e[_0xd4e4('0x34')]=_[_0xd4e4('0x35')](_0x2708fa['query']);_0x19a81e[_0xd4e4('0x36')]=_[_0xd4e4('0x37')](_0x19a81e['model'],_0x19a81e['query']);_0x289fac['attributes']=_['intersection'](_0x19a81e[_0xd4e4('0x33')],qs['fields'](_0x2708fa[_0xd4e4('0x34')]['fields']));_0x289fac[_0xd4e4('0x38')]=_0x289fac[_0xd4e4('0x38')][_0xd4e4('0x39')]?_0x289fac['attributes']:_0x19a81e[_0xd4e4('0x33')];if(!_0x2708fa[_0xd4e4('0x34')][_0xd4e4('0x3a')](_0xd4e4('0x3b'))){_0x289fac[_0xd4e4('0x1d')]=qs[_0xd4e4('0x1d')](_0x2708fa['query']['limit']);_0x289fac[_0xd4e4('0x1c')]=qs[_0xd4e4('0x1c')](_0x2708fa['query'][_0xd4e4('0x1c')]);}_0x289fac['order']=qs['sort'](_0x2708fa['query'][_0xd4e4('0x3c')]);_0x289fac[_0xd4e4('0x3d')]=qs[_0xd4e4('0x36')](_[_0xd4e4('0x3e')](_0x2708fa[_0xd4e4('0x34')],_0x19a81e[_0xd4e4('0x36')]),_0x575e45);if(_0x2708fa['query'][_0xd4e4('0x3f')]){_0x289fac[_0xd4e4('0x3d')]=_['merge'](_0x289fac['where'],{'$or':_[_0xd4e4('0x2d')](_0x575e45,function(_0x1192ba){if(_0x1192ba[_0xd4e4('0x31')]!==_0xd4e4('0x40')){var _0x4859c8={};_0x4859c8[_0x1192ba['name']]={'$like':'%'+_0x2708fa[_0xd4e4('0x34')]['filter']+'%'};return _0x4859c8;}})});}_0x289fac=_[_0xd4e4('0x41')]({},_0x289fac,_0x2708fa[_0xd4e4('0x42')]);var _0x471b44={'where':_0x289fac['where']};return db[_0xd4e4('0x2e')][_0xd4e4('0x1f')](_0x471b44)[_0xd4e4('0x26')](function(_0x1d3965){_0x36230f[_0xd4e4('0x1f')]=_0x1d3965;if(_0x2708fa[_0xd4e4('0x34')]['includeAll']){_0x289fac[_0xd4e4('0x43')]=[{'all':!![]}];}return db[_0xd4e4('0x2e')][_0xd4e4('0x44')](_0x289fac);})['then'](function(_0x55187b){_0x36230f['rows']=_0x55187b;return _0x36230f;})[_0xd4e4('0x26')](respondWithFilteredResult(_0x3be9ff,_0x289fac))[_0xd4e4('0x45')](handleError(_0x3be9ff,null));};exports[_0xd4e4('0x46')]=function(_0x2546d8,_0x1ce87b){var _0x27ada7={'raw':!![],'where':{'id':_0x2546d8[_0xd4e4('0x47')]['id']}},_0x4ae80d={};_0x4ae80d[_0xd4e4('0x33')]=_[_0xd4e4('0x35')](db[_0xd4e4('0x2e')][_0xd4e4('0x2f')]);_0x4ae80d[_0xd4e4('0x34')]=_[_0xd4e4('0x35')](_0x2546d8[_0xd4e4('0x34')]);_0x4ae80d['filters']=_[_0xd4e4('0x37')](_0x4ae80d['model'],_0x4ae80d[_0xd4e4('0x34')]);_0x27ada7[_0xd4e4('0x38')]=_[_0xd4e4('0x37')](_0x4ae80d[_0xd4e4('0x33')],qs[_0xd4e4('0x48')](_0x2546d8[_0xd4e4('0x34')]['fields']));_0x27ada7[_0xd4e4('0x38')]=_0x27ada7['attributes'][_0xd4e4('0x39')]?_0x27ada7[_0xd4e4('0x38')]:_0x4ae80d[_0xd4e4('0x33')];if(_0x2546d8[_0xd4e4('0x34')][_0xd4e4('0x49')]){_0x27ada7[_0xd4e4('0x43')]=[{'all':!![]}];}_0x27ada7=_[_0xd4e4('0x41')]({},_0x27ada7,_0x2546d8[_0xd4e4('0x42')]);return db[_0xd4e4('0x2e')]['find'](_0x27ada7)[_0xd4e4('0x26')](handleEntityNotFound(_0x1ce87b,null))[_0xd4e4('0x26')](respondWithResult(_0x1ce87b,null))['catch'](handleError(_0x1ce87b,null));};exports['create']=function(_0x836fe5,_0x55e2d3){return db[_0xd4e4('0x2e')][_0xd4e4('0x4a')](_0x836fe5[_0xd4e4('0x4b')],{})['then'](respondWithResult(_0x55e2d3,0xc9))[_0xd4e4('0x45')](handleError(_0x55e2d3,null));};exports['update']=function(_0x2b892f,_0x344f65){if(_0x2b892f['body']['id']){delete _0x2b892f[_0xd4e4('0x4b')]['id'];}return db[_0xd4e4('0x2e')]['find']({'where':{'id':_0x2b892f[_0xd4e4('0x47')]['id']}})[_0xd4e4('0x26')](handleEntityNotFound(_0x344f65,null))['then'](saveUpdates(_0x2b892f[_0xd4e4('0x4b')],null))[_0xd4e4('0x26')](respondWithResult(_0x344f65,null))[_0xd4e4('0x45')](handleError(_0x344f65,null));};exports[_0xd4e4('0x27')]=function(_0x385be7,_0x4688b9){return db[_0xd4e4('0x2e')][_0xd4e4('0x4c')]({'where':{'id':_0x385be7[_0xd4e4('0x47')]['id']}})[_0xd4e4('0x26')](handleEntityNotFound(_0x4688b9,null))[_0xd4e4('0x26')](removeEntity(_0x4688b9,null))['catch'](handleError(_0x4688b9,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 92a024a..457cb96 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 _0xce43=['ZendeskField','int_zendesk_fields','zendesk_unique_index','util','api','moment','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','define'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xce43,0x93));var _0x3ce4=function(_0x477fa8,_0x1f7f10){_0x477fa8=_0x477fa8-0x0;var _0xc426df=_0xce43[_0x477fa8];return _0xc426df;};'use strict';var _=require('lodash');var util=require(_0x3ce4('0x0'));var logger=require('../../config/logger')(_0x3ce4('0x1'));var moment=require(_0x3ce4('0x2'));var BPromise=require(_0x3ce4('0x3'));var rp=require(_0x3ce4('0x4'));var fs=require('fs');var path=require(_0x3ce4('0x5'));var rimraf=require(_0x3ce4('0x6'));var config=require('../../config/environment');var attributes=require(_0x3ce4('0x7'));module['exports']=function(_0x50579f,_0x3779cb){return _0x50579f[_0x3ce4('0x8')](_0x3ce4('0x9'),attributes,{'tableName':_0x3ce4('0xa'),'paranoid':![],'indexes':[{'name':_0x3ce4('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe30f=['moment','bluebird','request-promise','path','./intZendeskField.attributes','define','int_zendesk_fields','zendesk_unique_index','../../config/logger','api'];(function(_0x25a19a,_0x536079){var _0x9d8a38=function(_0x55a45c){while(--_0x55a45c){_0x25a19a['push'](_0x25a19a['shift']());}};_0x9d8a38(++_0x536079);}(_0xe30f,0xbc));var _0xfe30=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xe30f[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfe30('0x0'))(_0xfe30('0x1'));var moment=require(_0xfe30('0x2'));var BPromise=require(_0xfe30('0x3'));var rp=require(_0xfe30('0x4'));var fs=require('fs');var path=require(_0xfe30('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfe30('0x6'));module['exports']=function(_0x1c0a35,_0x371744){return _0x1c0a35[_0xfe30('0x7')]('ZendeskField',attributes,{'tableName':_0xfe30('0x8'),'paranoid':![],'indexes':[{'name':_0xfe30('0x9'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index cc29f4d..fa7ec54 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 _0x4239=['../../config/utils','rpc','../../config/environment','client','http','request','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x367054,_0x3ae59c){var _0x54fbd8=function(_0x1b4ac1){while(--_0x1b4ac1){_0x367054['push'](_0x367054['shift']());}};_0x54fbd8(++_0x3ae59c);}(_0x4239,0xa3));var _0x9423=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0x4239[_0x5e6ea3];return _0x4048b5;};'use strict';var _=require(_0x9423('0x0'));var util=require(_0x9423('0x1'));var moment=require(_0x9423('0x2'));var BPromise=require(_0x9423('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9423('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9423('0x5'));var logger=require('../../config/logger')(_0x9423('0x6'));var config=require(_0x9423('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9423('0x8')][_0x9423('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x529b18,_0x49762e,_0x190dce){return new BPromise(function(_0x71b733,_0x5ed6b6){return client[_0x9423('0xa')](_0x529b18,_0x190dce)['then'](function(_0x2ebd8e){logger[_0x9423('0xb')](_0x9423('0xc'),_0x49762e,'request\x20sent');logger[_0x9423('0xd')](_0x9423('0xe'),_0x49762e,_0x9423('0xf'),JSON[_0x9423('0x10')](_0x2ebd8e));if(_0x2ebd8e[_0x9423('0x11')]){if(_0x2ebd8e[_0x9423('0x11')][_0x9423('0x12')]===0x1f4){logger[_0x9423('0x11')]('ZendeskField,\x20%s,\x20%s',_0x49762e,_0x2ebd8e[_0x9423('0x11')][_0x9423('0x13')]);return _0x5ed6b6(_0x2ebd8e[_0x9423('0x11')][_0x9423('0x13')]);}logger[_0x9423('0x11')]('ZendeskField,\x20%s,\x20%s',_0x49762e,_0x2ebd8e['error']['message']);return _0x71b733(_0x2ebd8e['error'][_0x9423('0x13')]);}else{logger[_0x9423('0xb')]('ZendeskField,\x20%s,\x20%s',_0x49762e,'request\x20sent');_0x71b733(_0x2ebd8e['result'][_0x9423('0x13')]);}})[_0x9423('0x14')](function(_0x1448bc){logger[_0x9423('0x11')](_0x9423('0xc'),_0x49762e,_0x1448bc);_0x5ed6b6(_0x1448bc);});});} \ No newline at end of file +var _0x6864=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0x6864,0x1be));var _0x4686=function(_0x462fac,_0x73b34b){_0x462fac=_0x462fac-0x0;var _0x88b478=_0x6864[_0x462fac];return _0x88b478;};'use strict';var _=require(_0x4686('0x0'));var util=require(_0x4686('0x1'));var moment=require(_0x4686('0x2'));var BPromise=require(_0x4686('0x3'));var rs=require(_0x4686('0x4'));var fs=require('fs');var Redis=require(_0x4686('0x5'));var db=require(_0x4686('0x6'))['db'];var utils=require(_0x4686('0x7'));var logger=require(_0x4686('0x8'))(_0x4686('0x9'));var config=require(_0x4686('0xa'));var jayson=require(_0x4686('0xb'));var client=jayson[_0x4686('0xc')][_0x4686('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x23b075,_0x273132,_0x53af3b){return new BPromise(function(_0x5150ed,_0x175e93){return client[_0x4686('0xe')](_0x23b075,_0x53af3b)[_0x4686('0xf')](function(_0x30e377){logger[_0x4686('0x10')](_0x4686('0x11'),_0x273132,_0x4686('0x12'));logger[_0x4686('0x13')](_0x4686('0x14'),_0x273132,'request\x20sent',JSON[_0x4686('0x15')](_0x30e377));if(_0x30e377[_0x4686('0x16')]){if(_0x30e377[_0x4686('0x16')][_0x4686('0x17')]===0x1f4){logger[_0x4686('0x16')](_0x4686('0x11'),_0x273132,_0x30e377['error'][_0x4686('0x18')]);return _0x175e93(_0x30e377[_0x4686('0x16')][_0x4686('0x18')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x273132,_0x30e377['error']['message']);return _0x5150ed(_0x30e377['error'][_0x4686('0x18')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x273132,_0x4686('0x12'));_0x5150ed(_0x30e377[_0x4686('0x19')]['message']);}})['catch'](function(_0x452f1a){logger[_0x4686('0x16')](_0x4686('0x11'),_0x273132,_0x452f1a);_0x175e93(_0x452f1a);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index c145fbf..f335e9b 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 _0x5391=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','show','isAuthenticated','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x5391,0x14d));var _0x1539=function(_0x368724,_0x17cb1c){_0x368724=_0x368724-0x0;var _0x3cb6df=_0x5391[_0x368724];return _0x3cb6df;};'use strict';var multer=require(_0x1539('0x0'));var util=require('util');var path=require(_0x1539('0x1'));var timeout=require(_0x1539('0x2'));var express=require(_0x1539('0x3'));var router=express[_0x1539('0x4')]();var fs_extra=require(_0x1539('0x5'));var auth=require(_0x1539('0x6'));var interaction=require(_0x1539('0x7'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0x1539('0x8')]('/',auth['isAuthenticated'](),controller[_0x1539('0x9')]);router[_0x1539('0x8')](_0x1539('0xa'),auth['isAuthenticated'](),controller[_0x1539('0xb')]);router[_0x1539('0x8')]('/:id/configurations',auth[_0x1539('0xc')](),controller[_0x1539('0xd')]);router[_0x1539('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x1539('0xe')]);router[_0x1539('0xf')]('/',auth[_0x1539('0xc')](),controller[_0x1539('0x10')]);router['post'](_0x1539('0x11'),auth[_0x1539('0xc')](),controller[_0x1539('0x12')]);router[_0x1539('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x1539('0x14')]);router[_0x1539('0x15')](_0x1539('0xa'),auth[_0x1539('0xc')](),controller[_0x1539('0x16')]);module[_0x1539('0x17')]=router; \ No newline at end of file +var _0xc5f4=['index','get','/:id','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc5f4,0x8b));var _0x4c5f=function(_0x4428c6,_0x32d8d1){_0x4428c6=_0x4428c6-0x0;var _0x2a67c7=_0xc5f4[_0x4428c6];return _0x2a67c7;};'use strict';var multer=require(_0x4c5f('0x0'));var util=require(_0x4c5f('0x1'));var path=require('path');var timeout=require(_0x4c5f('0x2'));var express=require(_0x4c5f('0x3'));var router=express[_0x4c5f('0x4')]();var fs_extra=require(_0x4c5f('0x5'));var auth=require(_0x4c5f('0x6'));var interaction=require(_0x4c5f('0x7'));var config=require(_0x4c5f('0x8'));var controller=require(_0x4c5f('0x9'));router['get']('/',auth[_0x4c5f('0xa')](),controller[_0x4c5f('0xb')]);router[_0x4c5f('0xc')](_0x4c5f('0xd'),auth[_0x4c5f('0xa')](),controller['show']);router[_0x4c5f('0xc')]('/:id/configurations',auth[_0x4c5f('0xa')](),controller[_0x4c5f('0xe')]);router[_0x4c5f('0xc')](_0x4c5f('0xf'),auth['isAuthenticated'](),controller[_0x4c5f('0x10')]);router[_0x4c5f('0x11')]('/',auth[_0x4c5f('0xa')](),controller[_0x4c5f('0x12')]);router[_0x4c5f('0x11')](_0x4c5f('0x13'),auth['isAuthenticated'](),controller[_0x4c5f('0x14')]);router['put']('/:id',auth[_0x4c5f('0xa')](),controller[_0x4c5f('0x15')]);router[_0x4c5f('0x16')](_0x4c5f('0xd'),auth['isAuthenticated'](),controller[_0x4c5f('0x17')]);module[_0x4c5f('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 5a82e2c..c8117c2 100644 --- a/server/api/intZohoAccount/intZohoAccount.attributes.js +++ b/server/api/intZohoAccount/intZohoAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['sequelize','exports','STRING'];(function(_0x49db5c,_0x2b4f98){var _0x5bed3f=function(_0x3b2916){while(--_0x3b2916){_0x49db5c['push'](_0x49db5c['shift']());}};_0x5bed3f(++_0x2b4f98);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x0a9e('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x0a9e('0x2')]},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x0a9e('0x2')]},'refreshToken':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file +var _0xe14d=['exports','STRING','sequelize'];(function(_0xf3f2d7,_0xd96b2c){var _0x95073=function(_0x2f2396){while(--_0x2f2396){_0xf3f2d7['push'](_0xf3f2d7['shift']());}};_0x95073(++_0xd96b2c);}(_0xe14d,0x1ee));var _0xde14=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xe14d[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'name':{'type':Sequelize[_0xde14('0x2')]},'description':{'type':Sequelize[_0xde14('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xde14('0x2')]},'clientId':{'type':Sequelize[_0xde14('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xde14('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xde14('0x2')]},'refreshToken':{'type':Sequelize[_0xde14('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 6ac3ead..5264b73 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 _0xd527=['refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','com','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','Calls','Zoho-oauthtoken\x20','response','message','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','api_name','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','end','sendStatus','error','name','send','index','ZohoAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','params','length','options','find','create','body','catch','update','getConfigurations','ZohoConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xd527,0x195));var _0x7d52=function(_0x2d460c,_0x4f08c0){_0x2d460c=_0x2d460c-0x0;var _0xf6fc4c=_0xd527[_0x2d460c];return _0xf6fc4c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d52('0x0'));var zipdir=require(_0x7d52('0x1'));var jsonpatch=require(_0x7d52('0x2'));var rp=require(_0x7d52('0x3'));var moment=require(_0x7d52('0x4'));var BPromise=require(_0x7d52('0x5'));var Mustache=require(_0x7d52('0x6'));var util=require(_0x7d52('0x7'));var path=require(_0x7d52('0x8'));var sox=require(_0x7d52('0x9'));var csv=require(_0x7d52('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7d52('0xb'));var jsforce=require(_0x7d52('0xc'));var deskjs=require(_0x7d52('0xd'));var toCsv=require(_0x7d52('0xa'));var querystring=require('querystring');var Papa=require(_0x7d52('0xe'));var Redis=require('ioredis');var authService=require(_0x7d52('0xf'));var qs=require(_0x7d52('0x10'));var as=require(_0x7d52('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d52('0x12'))(_0x7d52('0x13'));var utils=require(_0x7d52('0x14'));var config=require(_0x7d52('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x6c0f71,_0x156bef){_0x156bef=_0x156bef||0xcc;return function(_0x11d40a){if(_0x11d40a){return _0x6c0f71['sendStatus'](_0x156bef);}return _0x6c0f71['status'](_0x156bef)['end']();};}function respondWithResult(_0x4b1e27,_0x59ac69){_0x59ac69=_0x59ac69||0xc8;return function(_0x4d0d33){if(_0x4d0d33){return _0x4b1e27[_0x7d52('0x16')](_0x59ac69)[_0x7d52('0x17')](_0x4d0d33);}};}function respondWithFilteredResult(_0x36a8fb,_0x242e0a){return function(_0x38762f){if(_0x38762f){var _0x4a8cb1=typeof _0x242e0a[_0x7d52('0x18')]===_0x7d52('0x19')&&typeof _0x242e0a[_0x7d52('0x1a')]===_0x7d52('0x19');var _0x3a244e=_0x38762f['count'];var _0x51b1df=_0x4a8cb1?0x0:_0x242e0a[_0x7d52('0x18')];var _0x1a016c=_0x4a8cb1?_0x38762f[_0x7d52('0x1b')]:_0x242e0a[_0x7d52('0x18')]+_0x242e0a[_0x7d52('0x1a')];var _0xb05603;if(_0x1a016c>=_0x3a244e){_0x1a016c=_0x3a244e;_0xb05603=0xc8;}else{_0xb05603=0xce;}_0x36a8fb[_0x7d52('0x16')](_0xb05603);return _0x36a8fb[_0x7d52('0x1c')](_0x7d52('0x1d'),_0x51b1df+'-'+_0x1a016c+'/'+_0x3a244e)[_0x7d52('0x17')](_0x38762f);}return null;};}function patchUpdates(_0x4df1d1){return function(_0x588b54){try{jsonpatch[_0x7d52('0x1e')](_0x588b54,_0x4df1d1,!![]);}catch(_0x4a8c5f){return BPromise[_0x7d52('0x1f')](_0x4a8c5f);}return _0x588b54[_0x7d52('0x20')]();};}function saveUpdates(_0x515bde,_0x5b86f4){return function(_0xd8c073){if(_0xd8c073){return _0xd8c073['update'](_0x515bde)['then'](function(_0xb88be5){return _0xb88be5;});}return null;};}function removeEntity(_0x442662,_0x115b59){return function(_0x1a5472){if(_0x1a5472){return _0x1a5472[_0x7d52('0x21')]()[_0x7d52('0x22')](function(){_0x442662['status'](0xcc)[_0x7d52('0x23')]();});}};}function handleEntityNotFound(_0x5063fe,_0x45847a){return function(_0x546267){if(!_0x546267){_0x5063fe[_0x7d52('0x24')](0x194);}return _0x546267;};}function handleError(_0x405181,_0x464a8a){_0x464a8a=_0x464a8a||0x1f4;return function(_0x18d3d2){logger[_0x7d52('0x25')](_0x18d3d2['stack']);if(_0x18d3d2[_0x7d52('0x26')]){delete _0x18d3d2[_0x7d52('0x26')];}_0x405181[_0x7d52('0x16')](_0x464a8a)[_0x7d52('0x27')](_0x18d3d2);};}exports[_0x7d52('0x28')]=function(_0xa618b0,_0x56ffa5){var _0x32de22={},_0x3b1232={},_0x268eb3={'count':0x0,'rows':[]};var _0x4c15f3=_['map'](db[_0x7d52('0x29')][_0x7d52('0x2a')],function(_0x253c4b){return{'name':_0x253c4b[_0x7d52('0x2b')],'type':_0x253c4b[_0x7d52('0x2c')]['key']};});_0x3b1232[_0x7d52('0x2d')]=_[_0x7d52('0x2e')](_0x4c15f3,'name');_0x3b1232[_0x7d52('0x2f')]=_[_0x7d52('0x30')](_0xa618b0[_0x7d52('0x2f')]);_0x3b1232[_0x7d52('0x31')]=_['intersection'](_0x3b1232[_0x7d52('0x2d')],_0x3b1232['query']);_0x32de22[_0x7d52('0x32')]=_[_0x7d52('0x33')](_0x3b1232[_0x7d52('0x2d')],qs[_0x7d52('0x34')](_0xa618b0['query'][_0x7d52('0x34')]));_0x32de22[_0x7d52('0x32')]=_0x32de22[_0x7d52('0x32')]['length']?_0x32de22[_0x7d52('0x32')]:_0x3b1232[_0x7d52('0x2d')];if(!_0xa618b0[_0x7d52('0x2f')][_0x7d52('0x35')](_0x7d52('0x36'))){_0x32de22[_0x7d52('0x1a')]=qs[_0x7d52('0x1a')](_0xa618b0['query'][_0x7d52('0x1a')]);_0x32de22[_0x7d52('0x18')]=qs['offset'](_0xa618b0[_0x7d52('0x2f')]['offset']);}_0x32de22[_0x7d52('0x37')]=qs[_0x7d52('0x38')](_0xa618b0[_0x7d52('0x2f')]['sort']);_0x32de22[_0x7d52('0x39')]=qs['filters'](_[_0x7d52('0x3a')](_0xa618b0['query'],_0x3b1232['filters']),_0x4c15f3);if(_0xa618b0['query']['filter']){_0x32de22[_0x7d52('0x39')]=_['merge'](_0x32de22[_0x7d52('0x39')],{'$or':_['map'](_0x4c15f3,function(_0x5b9d54){if(_0x5b9d54[_0x7d52('0x2c')]!==_0x7d52('0x3b')){var _0x4e8c71={};_0x4e8c71[_0x5b9d54[_0x7d52('0x26')]]={'$like':'%'+_0xa618b0['query'][_0x7d52('0x3c')]+'%'};return _0x4e8c71;}})});}_0x32de22=_[_0x7d52('0x3d')]({},_0x32de22,_0xa618b0['options']);var _0x2adc31={'where':_0x32de22[_0x7d52('0x39')]};return db[_0x7d52('0x29')][_0x7d52('0x1b')](_0x2adc31)[_0x7d52('0x22')](function(_0x5b0275){_0x268eb3[_0x7d52('0x1b')]=_0x5b0275;if(_0xa618b0['query'][_0x7d52('0x3e')]){_0x32de22[_0x7d52('0x3f')]=[{'all':!![]}];}return db['ZohoAccount'][_0x7d52('0x40')](_0x32de22);})[_0x7d52('0x22')](function(_0x3d2141){_0x268eb3[_0x7d52('0x41')]=_0x3d2141;return _0x268eb3;})['then'](respondWithFilteredResult(_0x56ffa5,_0x32de22))['catch'](handleError(_0x56ffa5,null));};exports['show']=function(_0x5a2660,_0x2de5a8){var _0x3bb556={'raw':![],'where':{'id':_0x5a2660[_0x7d52('0x42')]['id']}},_0x35673a={};_0x35673a[_0x7d52('0x2d')]=_[_0x7d52('0x30')](db[_0x7d52('0x29')]['rawAttributes']);_0x35673a['query']=_[_0x7d52('0x30')](_0x5a2660[_0x7d52('0x2f')]);_0x35673a[_0x7d52('0x31')]=_['intersection'](_0x35673a['model'],_0x35673a['query']);_0x3bb556[_0x7d52('0x32')]=_[_0x7d52('0x33')](_0x35673a[_0x7d52('0x2d')],qs[_0x7d52('0x34')](_0x5a2660[_0x7d52('0x2f')][_0x7d52('0x34')]));_0x3bb556[_0x7d52('0x32')]=_0x3bb556['attributes'][_0x7d52('0x43')]?_0x3bb556[_0x7d52('0x32')]:_0x35673a[_0x7d52('0x2d')];if(_0x5a2660['query'][_0x7d52('0x3e')]){_0x3bb556[_0x7d52('0x3f')]=[{'all':!![]}];}_0x3bb556=_[_0x7d52('0x3d')]({},_0x3bb556,_0x5a2660[_0x7d52('0x44')]);return db[_0x7d52('0x29')][_0x7d52('0x45')](_0x3bb556)[_0x7d52('0x22')](handleEntityNotFound(_0x2de5a8,null))[_0x7d52('0x22')](respondWithResult(_0x2de5a8,null))['catch'](handleError(_0x2de5a8,null));};exports[_0x7d52('0x46')]=function(_0x40e04a,_0x58abfd){return db[_0x7d52('0x29')][_0x7d52('0x46')](_0x40e04a[_0x7d52('0x47')],{})[_0x7d52('0x22')](respondWithResult(_0x58abfd,0xc9))[_0x7d52('0x48')](handleError(_0x58abfd,null));};exports[_0x7d52('0x49')]=function(_0x42e62e,_0x44f75f){if(_0x42e62e[_0x7d52('0x47')]['id']){delete _0x42e62e[_0x7d52('0x47')]['id'];}return db['ZohoAccount'][_0x7d52('0x45')]({'where':{'id':_0x42e62e['params']['id']}})[_0x7d52('0x22')](handleEntityNotFound(_0x44f75f,null))[_0x7d52('0x22')](saveUpdates(_0x42e62e[_0x7d52('0x47')],null))['then'](respondWithResult(_0x44f75f,null))['catch'](handleError(_0x44f75f,null));};exports[_0x7d52('0x21')]=function(_0x16c4a2,_0x78b29d){return db[_0x7d52('0x29')][_0x7d52('0x45')]({'where':{'id':_0x16c4a2['params']['id']}})[_0x7d52('0x22')](handleEntityNotFound(_0x78b29d,null))[_0x7d52('0x22')](removeEntity(_0x78b29d,null))[_0x7d52('0x48')](handleError(_0x78b29d,null));};exports[_0x7d52('0x4a')]=function(_0x26670b,_0x1abc35,_0x45f059){var _0x3559f5={};var _0x1316e4={};var _0xf086b0;var _0x19b359;return db[_0x7d52('0x29')]['findOne']({'where':{'id':_0x26670b[_0x7d52('0x42')]['id']}})['then'](handleEntityNotFound(_0x1abc35,null))['then'](function(_0x1b6b67){if(_0x1b6b67){_0xf086b0=_0x1b6b67;_0x1316e4[_0x7d52('0x2d')]=_[_0x7d52('0x30')](db[_0x7d52('0x4b')][_0x7d52('0x2a')]);_0x1316e4['query']=_[_0x7d52('0x30')](_0x26670b[_0x7d52('0x2f')]);_0x1316e4[_0x7d52('0x31')]=_['intersection'](_0x1316e4['model'],_0x1316e4[_0x7d52('0x2f')]);_0x3559f5[_0x7d52('0x32')]=_[_0x7d52('0x33')](_0x1316e4[_0x7d52('0x2d')],qs[_0x7d52('0x34')](_0x26670b[_0x7d52('0x2f')][_0x7d52('0x34')]));_0x3559f5[_0x7d52('0x32')]=_0x3559f5[_0x7d52('0x32')][_0x7d52('0x43')]?_0x3559f5[_0x7d52('0x32')]:_0x1316e4[_0x7d52('0x2d')];_0x3559f5[_0x7d52('0x37')]=qs['sort'](_0x26670b[_0x7d52('0x2f')]['sort']);_0x3559f5[_0x7d52('0x39')]=qs['filters'](_[_0x7d52('0x3a')](_0x26670b[_0x7d52('0x2f')],_0x1316e4['filters']));if(_0x26670b[_0x7d52('0x2f')][_0x7d52('0x3c')]){_0x3559f5[_0x7d52('0x39')]=_[_0x7d52('0x3d')](_0x3559f5[_0x7d52('0x39')],{'$or':_['map'](_0x3559f5[_0x7d52('0x32')],function(_0x1b58d2){var _0x4bba06={};_0x4bba06[_0x1b58d2]={'$like':'%'+_0x26670b[_0x7d52('0x2f')][_0x7d52('0x3c')]+'%'};return _0x4bba06;})});}_0x3559f5=_['merge']({},_0x3559f5,_0x26670b[_0x7d52('0x44')]);return _0xf086b0['getConfigurations'](_0x3559f5);}})[_0x7d52('0x22')](function(_0x5eed86){if(_0x5eed86){_0x19b359=_0x5eed86[_0x7d52('0x43')];if(!_0x26670b[_0x7d52('0x2f')][_0x7d52('0x35')](_0x7d52('0x36'))){_0x3559f5['limit']=qs[_0x7d52('0x1a')](_0x26670b[_0x7d52('0x2f')][_0x7d52('0x1a')]);_0x3559f5[_0x7d52('0x18')]=qs[_0x7d52('0x18')](_0x26670b[_0x7d52('0x2f')][_0x7d52('0x18')]);}return _0xf086b0[_0x7d52('0x4a')](_0x3559f5);}})[_0x7d52('0x22')](function(_0x59a817){if(_0x59a817){return _0x59a817?{'count':_0x19b359,'rows':_0x59a817}:null;}})['then'](respondWithResult(_0x1abc35,null))[_0x7d52('0x48')](handleError(_0x1abc35,null));};exports[_0x7d52('0x4c')]=function(_0x34a0bf,_0x210b6e,_0x2243f9){if(_0x34a0bf[_0x7d52('0x47')]['id']){delete _0x34a0bf[_0x7d52('0x47')]['id'];}return db[_0x7d52('0x29')][_0x7d52('0x4d')]({'where':{'id':_0x34a0bf[_0x7d52('0x42')]['id']}})[_0x7d52('0x22')](handleEntityNotFound(_0x210b6e,null))[_0x7d52('0x22')](function(_0x8aef8e){if(_0x8aef8e){_0x34a0bf['body'][_0x7d52('0x4e')]=_0x8aef8e['id'];_0x34a0bf[_0x7d52('0x47')][_0x7d52('0x4f')]=integrations[_0x7d52('0x50')](_0x34a0bf[_0x7d52('0x47')][_0x7d52('0x51')],_0x34a0bf[_0x7d52('0x47')]['type']);_0x34a0bf[_0x7d52('0x47')][_0x7d52('0x52')]=integrations[_0x7d52('0x53')](_0x34a0bf[_0x7d52('0x47')]['channel'],_0x34a0bf[_0x7d52('0x47')]['type']);return db[_0x7d52('0x4b')]['create'](_0x34a0bf[_0x7d52('0x47')],{'include':[{'model':db[_0x7d52('0x54')],'as':'Subjects'},{'model':db[_0x7d52('0x54')],'as':_0x7d52('0x52')}]});}return null;})[_0x7d52('0x22')](respondWithResult(_0x210b6e,null))[_0x7d52('0x48')](handleError(_0x210b6e,null));};function getAccessToken(_0x518b5d){return new Promise(function(_0x2e2740,_0xe67a3f){var _0x281780;switch(_0x518b5d[_0x7d52('0x55')]){case'US':_0x281780=_0x7d52('0x56');break;case'AU':_0x281780=_0x7d52('0x57');break;case'EU':_0x281780=_0x7d52('0x58');break;case'IN':_0x281780='https://accounts.zoho.in';break;case'CN':_0x281780='https://accounts.zoho.com.cn';break;default:_0x281780='https://accounts.zoho.eu';break;}var _0x57a1f4={'method':_0x7d52('0x59'),'uri':_0x281780+_0x7d52('0x5a'),'qs':{'refresh_token':_0x518b5d[_0x7d52('0x5b')],'client_id':_0x518b5d[_0x7d52('0x5c')],'client_secret':_0x518b5d[_0x7d52('0x5d')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x57a1f4)[_0x7d52('0x22')](function(_0x330e5b){if(_0x330e5b['access_token']){_0x2e2740(_0x330e5b[_0x7d52('0x5e')]);}else{_0xe67a3f(_0x7d52('0x5f'));}})[_0x7d52('0x48')](function(_0x35ff42){_0xe67a3f(_0x35ff42);});});}exports[_0x7d52('0x60')]=function(_0x58da33,_0x4c0c0f,_0x52d426){var _0x1d4d0b,_0x567904,_0x5085f8,_0x5317a2,_0x5e16db;return db[_0x7d52('0x29')][_0x7d52('0x4d')]({'where':{'id':_0x58da33[_0x7d52('0x42')]['id']},'attributes':['id',_0x7d52('0x61'),_0x7d52('0x55'),_0x7d52('0x5c'),'clientSecret',_0x7d52('0x62'),_0x7d52('0x63'),'refreshToken']})[_0x7d52('0x22')](handleEntityNotFound(_0x4c0c0f,null))['then'](function(_0x272313){_0x5e16db=_0x272313;_0x1d4d0b=_0x5e16db[_0x7d52('0x61')];_0x567904=_0x1d4d0b==='zoho.eu'?'eu':_0x7d52('0x64');_0x5085f8=_0x5e16db[_0x7d52('0x62')];var _0x539660=_0x5085f8['slice'](-0x1);if(_0x539660==='/'||_0x539660==='\x5c'||_0x539660===':'){_0x5085f8=_0x5085f8[_0x7d52('0x65')](0x0,_0x5085f8['lastIndexOf'](_0x539660));}if(!_0x5e16db[_0x7d52('0x5b')]){throw new Error(_0x7d52('0x66'));}return getAccessToken(_0x5e16db);})['then'](function(_0x151ac6){if(_0x151ac6){return rp({'method':_0x7d52('0x67'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0x567904),'qs':{'module':_0x7d52('0x68')},'headers':{'Authorization':_0x7d52('0x69')+_0x151ac6},'json':!![]});}})['then'](function(_0x3b9239){if(_0x3b9239){if(_0x3b9239[_0x7d52('0x6a')]&&_0x3b9239['response'][_0x7d52('0x25')]){throw new Error(_0x3b9239[_0x7d52('0x6a')][_0x7d52('0x25')][_0x7d52('0x6b')]);}var _0x3fc43b=[];var _0x25d024=[];var _0x2878ba=['Owner',_0x7d52('0x6c'),'Description',_0x7d52('0x6d'),_0x7d52('0x6e'),_0x7d52('0x6f'),_0x7d52('0x70'),_0x7d52('0x71')];_0x25d024=_[_0x7d52('0x72')](_0x3b9239[_0x7d52('0x34')],function(_0x3d8c0c){return _0x2878ba['includes'](_0x3d8c0c[_0x7d52('0x73')]);});for(var _0x12c1a4=0x0;_0x12c1a4<_0x25d024[_0x7d52('0x43')];_0x12c1a4++){if(_0x25d024[_0x12c1a4]['system_mandatory']===![]){_0x3fc43b['push']({'id':_0x25d024[_0x12c1a4]['id'],'name':_0x25d024[_0x12c1a4]['display_label'],'custom':_0x25d024[_0x12c1a4][_0x7d52('0x74')],'options':_0x25d024[_0x12c1a4][_0x7d52('0x75')]===_0x7d52('0x76')&&_0x25d024[_0x12c1a4][_0x7d52('0x77')]['length']>-0x1?_[_0x7d52('0x2e')](_0x25d024[_0x12c1a4][_0x7d52('0x77')],function(_0x52c10b){return{'name':_0x52c10b,'value':_0x52c10b};}):[]});}}return{'count':_0x3fc43b[_0x7d52('0x43')],'rows':_0x3fc43b};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x4c0c0f,null))['catch'](function(_0x29c8a5){var _0x18bd06=_0x58da33['query'][_0x7d52('0x78')]?0x1f4:_0x29c8a5[_0x7d52('0x79')]||0x1f4;logger['error'](_0x7d52('0x7a'),_0x7d52('0x60'),_0x18bd06,JSON[_0x7d52('0x7b')](_0x29c8a5));delete _0x29c8a5[_0x7d52('0x26')];if(_0x18bd06===0x191){_0x18bd06=0x190;}_0x4c0c0f[_0x7d52('0x16')](_0x18bd06)['send'](_0x58da33[_0x7d52('0x2f')][_0x7d52('0x78')]?{'message':'Wrong\x20credentials','statusCode':_0x29c8a5['statusCode']}:_0x29c8a5);});}; \ No newline at end of file +var _0xa7b1=['slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','rawAttributes','fieldName','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','ZohoAccount','includeAll','findAll','catch','show','params','include','create','body','find','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','clientId','clientSecret','access_token','getFields','host','serverUrl','code','refreshToken','zoho.eu','com'];(function(_0x172e2d,_0x1d6bcd){var _0x502e06=function(_0x2af53e){while(--_0x2af53e){_0x172e2d['push'](_0x172e2d['shift']());}};_0x502e06(++_0x1d6bcd);}(_0xa7b1,0x1a7));var _0x1a7b=function(_0xbced0e,_0x344c39){_0xbced0e=_0xbced0e-0x0;var _0x464815=_0xa7b1[_0xbced0e];return _0x464815;};'use strict';var emlformat=require(_0x1a7b('0x0'));var rimraf=require(_0x1a7b('0x1'));var zipdir=require(_0x1a7b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a7b('0x3'));var moment=require(_0x1a7b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1a7b('0x5'));var path=require('path');var sox=require(_0x1a7b('0x6'));var csv=require(_0x1a7b('0x7'));var ejs=require(_0x1a7b('0x8'));var fs=require('fs');var fs_extra=require(_0x1a7b('0x9'));var _=require('lodash');var squel=require(_0x1a7b('0xa'));var crypto=require(_0x1a7b('0xb'));var jsforce=require(_0x1a7b('0xc'));var deskjs=require(_0x1a7b('0xd'));var toCsv=require(_0x1a7b('0x7'));var querystring=require(_0x1a7b('0xe'));var Papa=require(_0x1a7b('0xf'));var Redis=require(_0x1a7b('0x10'));var authService=require(_0x1a7b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1a7b('0x12'));var hardwareService=require(_0x1a7b('0x13'));var logger=require('../../config/logger')(_0x1a7b('0x14'));var utils=require(_0x1a7b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1a7b('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1a7b('0x17'));function respondWithStatusCode(_0x37db9a,_0x115bd1){_0x115bd1=_0x115bd1||0xcc;return function(_0x59882d){if(_0x59882d){return _0x37db9a[_0x1a7b('0x18')](_0x115bd1);}return _0x37db9a[_0x1a7b('0x19')](_0x115bd1)[_0x1a7b('0x1a')]();};}function respondWithResult(_0xecc885,_0x56d1ba){_0x56d1ba=_0x56d1ba||0xc8;return function(_0x26edf2){if(_0x26edf2){return _0xecc885[_0x1a7b('0x19')](_0x56d1ba)[_0x1a7b('0x1b')](_0x26edf2);}};}function respondWithFilteredResult(_0x1df289,_0x919b9a){return function(_0x3ddf6e){if(_0x3ddf6e){var _0x2a32b7=typeof _0x919b9a[_0x1a7b('0x1c')]===_0x1a7b('0x1d')&&typeof _0x919b9a[_0x1a7b('0x1e')]===_0x1a7b('0x1d');var _0x1432db=_0x3ddf6e[_0x1a7b('0x1f')];var _0x225a43=_0x2a32b7?0x0:_0x919b9a['offset'];var _0x48862b=_0x2a32b7?_0x3ddf6e[_0x1a7b('0x1f')]:_0x919b9a[_0x1a7b('0x1c')]+_0x919b9a[_0x1a7b('0x1e')];var _0xfd3dd7;if(_0x48862b>=_0x1432db){_0x48862b=_0x1432db;_0xfd3dd7=0xc8;}else{_0xfd3dd7=0xce;}_0x1df289['status'](_0xfd3dd7);return _0x1df289[_0x1a7b('0x20')](_0x1a7b('0x21'),_0x225a43+'-'+_0x48862b+'/'+_0x1432db)[_0x1a7b('0x1b')](_0x3ddf6e);}return null;};}function patchUpdates(_0x3d0088){return function(_0x26415b){try{jsonpatch[_0x1a7b('0x22')](_0x26415b,_0x3d0088,!![]);}catch(_0x325533){return BPromise['reject'](_0x325533);}return _0x26415b[_0x1a7b('0x23')]();};}function saveUpdates(_0x15adaa,_0x294b90){return function(_0x3d6ff0){if(_0x3d6ff0){return _0x3d6ff0[_0x1a7b('0x24')](_0x15adaa)['then'](function(_0x39a379){return _0x39a379;});}return null;};}function removeEntity(_0x3e82e6,_0x793b3c){return function(_0x565f74){if(_0x565f74){return _0x565f74[_0x1a7b('0x25')]()[_0x1a7b('0x26')](function(){_0x3e82e6[_0x1a7b('0x19')](0xcc)[_0x1a7b('0x1a')]();});}};}function handleEntityNotFound(_0x280e68,_0x44337b){return function(_0x22635d){if(!_0x22635d){_0x280e68[_0x1a7b('0x18')](0x194);}return _0x22635d;};}function handleError(_0x339233,_0x2b0347){_0x2b0347=_0x2b0347||0x1f4;return function(_0x2d1619){logger[_0x1a7b('0x27')](_0x2d1619[_0x1a7b('0x28')]);if(_0x2d1619[_0x1a7b('0x29')]){delete _0x2d1619[_0x1a7b('0x29')];}_0x339233['status'](_0x2b0347)[_0x1a7b('0x2a')](_0x2d1619);};}exports['index']=function(_0x45a42a,_0x3ba1d1){var _0x131920={},_0xbe5a75={},_0x1035b3={'count':0x0,'rows':[]};var _0x11e876=_['map'](db['ZohoAccount'][_0x1a7b('0x2b')],function(_0x20dc64){return{'name':_0x20dc64[_0x1a7b('0x2c')],'type':_0x20dc64['type']['key']};});_0xbe5a75[_0x1a7b('0x2d')]=_[_0x1a7b('0x2e')](_0x11e876,_0x1a7b('0x29'));_0xbe5a75[_0x1a7b('0x2f')]=_[_0x1a7b('0x30')](_0x45a42a[_0x1a7b('0x2f')]);_0xbe5a75['filters']=_[_0x1a7b('0x31')](_0xbe5a75[_0x1a7b('0x2d')],_0xbe5a75[_0x1a7b('0x2f')]);_0x131920['attributes']=_[_0x1a7b('0x31')](_0xbe5a75[_0x1a7b('0x2d')],qs['fields'](_0x45a42a['query'][_0x1a7b('0x32')]));_0x131920[_0x1a7b('0x33')]=_0x131920[_0x1a7b('0x33')][_0x1a7b('0x34')]?_0x131920[_0x1a7b('0x33')]:_0xbe5a75[_0x1a7b('0x2d')];if(!_0x45a42a[_0x1a7b('0x2f')][_0x1a7b('0x35')](_0x1a7b('0x36'))){_0x131920[_0x1a7b('0x1e')]=qs[_0x1a7b('0x1e')](_0x45a42a[_0x1a7b('0x2f')][_0x1a7b('0x1e')]);_0x131920[_0x1a7b('0x1c')]=qs[_0x1a7b('0x1c')](_0x45a42a[_0x1a7b('0x2f')][_0x1a7b('0x1c')]);}_0x131920[_0x1a7b('0x37')]=qs['sort'](_0x45a42a[_0x1a7b('0x2f')][_0x1a7b('0x38')]);_0x131920[_0x1a7b('0x39')]=qs['filters'](_[_0x1a7b('0x3a')](_0x45a42a['query'],_0xbe5a75[_0x1a7b('0x3b')]),_0x11e876);if(_0x45a42a[_0x1a7b('0x2f')][_0x1a7b('0x3c')]){_0x131920[_0x1a7b('0x39')]=_['merge'](_0x131920[_0x1a7b('0x39')],{'$or':_[_0x1a7b('0x2e')](_0x11e876,function(_0x555f06){if(_0x555f06['type']!==_0x1a7b('0x3d')){var _0x33c53f={};_0x33c53f[_0x555f06[_0x1a7b('0x29')]]={'$like':'%'+_0x45a42a[_0x1a7b('0x2f')][_0x1a7b('0x3c')]+'%'};return _0x33c53f;}})});}_0x131920=_[_0x1a7b('0x3e')]({},_0x131920,_0x45a42a[_0x1a7b('0x3f')]);var _0x3caddf={'where':_0x131920[_0x1a7b('0x39')]};return db[_0x1a7b('0x40')][_0x1a7b('0x1f')](_0x3caddf)[_0x1a7b('0x26')](function(_0x5ce829){_0x1035b3[_0x1a7b('0x1f')]=_0x5ce829;if(_0x45a42a[_0x1a7b('0x2f')][_0x1a7b('0x41')]){_0x131920['include']=[{'all':!![]}];}return db[_0x1a7b('0x40')][_0x1a7b('0x42')](_0x131920);})['then'](function(_0x290573){_0x1035b3['rows']=_0x290573;return _0x1035b3;})['then'](respondWithFilteredResult(_0x3ba1d1,_0x131920))[_0x1a7b('0x43')](handleError(_0x3ba1d1,null));};exports[_0x1a7b('0x44')]=function(_0x184669,_0x5d46fd){var _0x23066f={'raw':![],'where':{'id':_0x184669[_0x1a7b('0x45')]['id']}},_0x5f1c40={};_0x5f1c40['model']=_[_0x1a7b('0x30')](db[_0x1a7b('0x40')][_0x1a7b('0x2b')]);_0x5f1c40[_0x1a7b('0x2f')]=_[_0x1a7b('0x30')](_0x184669[_0x1a7b('0x2f')]);_0x5f1c40[_0x1a7b('0x3b')]=_[_0x1a7b('0x31')](_0x5f1c40[_0x1a7b('0x2d')],_0x5f1c40[_0x1a7b('0x2f')]);_0x23066f[_0x1a7b('0x33')]=_[_0x1a7b('0x31')](_0x5f1c40[_0x1a7b('0x2d')],qs['fields'](_0x184669['query'][_0x1a7b('0x32')]));_0x23066f[_0x1a7b('0x33')]=_0x23066f[_0x1a7b('0x33')][_0x1a7b('0x34')]?_0x23066f['attributes']:_0x5f1c40[_0x1a7b('0x2d')];if(_0x184669[_0x1a7b('0x2f')][_0x1a7b('0x41')]){_0x23066f[_0x1a7b('0x46')]=[{'all':!![]}];}_0x23066f=_['merge']({},_0x23066f,_0x184669[_0x1a7b('0x3f')]);return db[_0x1a7b('0x40')]['find'](_0x23066f)[_0x1a7b('0x26')](handleEntityNotFound(_0x5d46fd,null))[_0x1a7b('0x26')](respondWithResult(_0x5d46fd,null))[_0x1a7b('0x43')](handleError(_0x5d46fd,null));};exports[_0x1a7b('0x47')]=function(_0x44fd5b,_0x2eae9b){return db[_0x1a7b('0x40')][_0x1a7b('0x47')](_0x44fd5b[_0x1a7b('0x48')],{})[_0x1a7b('0x26')](respondWithResult(_0x2eae9b,0xc9))[_0x1a7b('0x43')](handleError(_0x2eae9b,null));};exports[_0x1a7b('0x24')]=function(_0x1609d1,_0x2a19ee){if(_0x1609d1[_0x1a7b('0x48')]['id']){delete _0x1609d1['body']['id'];}return db['ZohoAccount'][_0x1a7b('0x49')]({'where':{'id':_0x1609d1['params']['id']}})['then'](handleEntityNotFound(_0x2a19ee,null))[_0x1a7b('0x26')](saveUpdates(_0x1609d1[_0x1a7b('0x48')],null))[_0x1a7b('0x26')](respondWithResult(_0x2a19ee,null))[_0x1a7b('0x43')](handleError(_0x2a19ee,null));};exports['destroy']=function(_0x5eb0d1,_0x192c46){return db['ZohoAccount'][_0x1a7b('0x49')]({'where':{'id':_0x5eb0d1[_0x1a7b('0x45')]['id']}})[_0x1a7b('0x26')](handleEntityNotFound(_0x192c46,null))[_0x1a7b('0x26')](removeEntity(_0x192c46,null))['catch'](handleError(_0x192c46,null));};exports[_0x1a7b('0x4a')]=function(_0x102654,_0x2c928f,_0x1a2288){var _0x44c080={};var _0x4ba9f2={};var _0xfd0a08;var _0x503bec;return db[_0x1a7b('0x40')][_0x1a7b('0x4b')]({'where':{'id':_0x102654['params']['id']}})[_0x1a7b('0x26')](handleEntityNotFound(_0x2c928f,null))[_0x1a7b('0x26')](function(_0x38210e){if(_0x38210e){_0xfd0a08=_0x38210e;_0x4ba9f2[_0x1a7b('0x2d')]=_[_0x1a7b('0x30')](db[_0x1a7b('0x4c')][_0x1a7b('0x2b')]);_0x4ba9f2['query']=_['keys'](_0x102654[_0x1a7b('0x2f')]);_0x4ba9f2[_0x1a7b('0x3b')]=_[_0x1a7b('0x31')](_0x4ba9f2[_0x1a7b('0x2d')],_0x4ba9f2[_0x1a7b('0x2f')]);_0x44c080[_0x1a7b('0x33')]=_[_0x1a7b('0x31')](_0x4ba9f2[_0x1a7b('0x2d')],qs[_0x1a7b('0x32')](_0x102654['query'][_0x1a7b('0x32')]));_0x44c080[_0x1a7b('0x33')]=_0x44c080[_0x1a7b('0x33')][_0x1a7b('0x34')]?_0x44c080[_0x1a7b('0x33')]:_0x4ba9f2[_0x1a7b('0x2d')];_0x44c080['order']=qs[_0x1a7b('0x38')](_0x102654[_0x1a7b('0x2f')][_0x1a7b('0x38')]);_0x44c080[_0x1a7b('0x39')]=qs[_0x1a7b('0x3b')](_[_0x1a7b('0x3a')](_0x102654['query'],_0x4ba9f2[_0x1a7b('0x3b')]));if(_0x102654['query'][_0x1a7b('0x3c')]){_0x44c080[_0x1a7b('0x39')]=_['merge'](_0x44c080['where'],{'$or':_['map'](_0x44c080[_0x1a7b('0x33')],function(_0x5651e6){var _0x51925e={};_0x51925e[_0x5651e6]={'$like':'%'+_0x102654['query']['filter']+'%'};return _0x51925e;})});}_0x44c080=_[_0x1a7b('0x3e')]({},_0x44c080,_0x102654[_0x1a7b('0x3f')]);return _0xfd0a08[_0x1a7b('0x4a')](_0x44c080);}})[_0x1a7b('0x26')](function(_0x160d5d){if(_0x160d5d){_0x503bec=_0x160d5d[_0x1a7b('0x34')];if(!_0x102654[_0x1a7b('0x2f')][_0x1a7b('0x35')](_0x1a7b('0x36'))){_0x44c080[_0x1a7b('0x1e')]=qs[_0x1a7b('0x1e')](_0x102654['query'][_0x1a7b('0x1e')]);_0x44c080[_0x1a7b('0x1c')]=qs[_0x1a7b('0x1c')](_0x102654[_0x1a7b('0x2f')][_0x1a7b('0x1c')]);}return _0xfd0a08[_0x1a7b('0x4a')](_0x44c080);}})[_0x1a7b('0x26')](function(_0x4bf378){if(_0x4bf378){return _0x4bf378?{'count':_0x503bec,'rows':_0x4bf378}:null;}})[_0x1a7b('0x26')](respondWithResult(_0x2c928f,null))[_0x1a7b('0x43')](handleError(_0x2c928f,null));};exports[_0x1a7b('0x4d')]=function(_0x4ecbc3,_0x52812c,_0x2f359e){if(_0x4ecbc3[_0x1a7b('0x48')]['id']){delete _0x4ecbc3[_0x1a7b('0x48')]['id'];}return db['ZohoAccount'][_0x1a7b('0x4b')]({'where':{'id':_0x4ecbc3[_0x1a7b('0x45')]['id']}})[_0x1a7b('0x26')](handleEntityNotFound(_0x52812c,null))[_0x1a7b('0x26')](function(_0x2bc3e1){if(_0x2bc3e1){_0x4ecbc3['body'][_0x1a7b('0x4e')]=_0x2bc3e1['id'];_0x4ecbc3['body'][_0x1a7b('0x4f')]=integrations[_0x1a7b('0x50')](_0x4ecbc3[_0x1a7b('0x48')][_0x1a7b('0x51')],_0x4ecbc3[_0x1a7b('0x48')][_0x1a7b('0x52')]);_0x4ecbc3['body'][_0x1a7b('0x53')]=integrations['getDescriptions'](_0x4ecbc3['body'][_0x1a7b('0x51')],_0x4ecbc3[_0x1a7b('0x48')][_0x1a7b('0x52')]);return db[_0x1a7b('0x4c')][_0x1a7b('0x47')](_0x4ecbc3[_0x1a7b('0x48')],{'include':[{'model':db[_0x1a7b('0x54')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0x1a7b('0x53')}]});}return null;})['then'](respondWithResult(_0x52812c,null))['catch'](handleError(_0x52812c,null));};function getAccessToken(_0x5c05e9){return new Promise(function(_0x44def8,_0x2f95d2){var _0x57afef;switch(_0x5c05e9[_0x1a7b('0x55')]){case'US':_0x57afef=_0x1a7b('0x56');break;case'AU':_0x57afef=_0x1a7b('0x57');break;case'EU':_0x57afef=_0x1a7b('0x58');break;case'IN':_0x57afef='https://accounts.zoho.in';break;case'CN':_0x57afef=_0x1a7b('0x59');break;default:_0x57afef=_0x1a7b('0x58');break;}var _0xe21c68={'method':_0x1a7b('0x5a'),'uri':_0x57afef+'/oauth/v2/token','qs':{'refresh_token':_0x5c05e9['refreshToken'],'client_id':_0x5c05e9[_0x1a7b('0x5b')],'client_secret':_0x5c05e9[_0x1a7b('0x5c')],'grant_type':'refresh_token'},'json':!![]};return rp(_0xe21c68)[_0x1a7b('0x26')](function(_0x1a4c08){if(_0x1a4c08[_0x1a7b('0x5d')]){_0x44def8(_0x1a4c08['access_token']);}else{_0x2f95d2('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x1a7b('0x43')](function(_0x1f6b3b){_0x2f95d2(_0x1f6b3b);});});}exports[_0x1a7b('0x5e')]=function(_0x5a8279,_0x1b266c,_0xbf36ac){var _0x47f7b,_0x230799,_0x598a6f,_0x58ddec,_0x37d241;return db[_0x1a7b('0x40')][_0x1a7b('0x4b')]({'where':{'id':_0x5a8279[_0x1a7b('0x45')]['id']},'attributes':['id',_0x1a7b('0x5f'),'zone','clientId','clientSecret',_0x1a7b('0x60'),_0x1a7b('0x61'),_0x1a7b('0x62')]})[_0x1a7b('0x26')](handleEntityNotFound(_0x1b266c,null))[_0x1a7b('0x26')](function(_0x5eb675){_0x37d241=_0x5eb675;_0x47f7b=_0x37d241[_0x1a7b('0x5f')];_0x230799=_0x47f7b===_0x1a7b('0x63')?'eu':_0x1a7b('0x64');_0x598a6f=_0x37d241[_0x1a7b('0x60')];var _0xf48534=_0x598a6f[_0x1a7b('0x65')](-0x1);if(_0xf48534==='/'||_0xf48534==='\x5c'||_0xf48534===':'){_0x598a6f=_0x598a6f[_0x1a7b('0x66')](0x0,_0x598a6f[_0x1a7b('0x67')](_0xf48534));}if(!_0x37d241[_0x1a7b('0x62')]){throw new Error(_0x1a7b('0x68'));}return getAccessToken(_0x37d241);})[_0x1a7b('0x26')](function(_0x414560){if(_0x414560){return rp({'method':_0x1a7b('0x69'),'uri':util[_0x1a7b('0x6a')](_0x1a7b('0x6b'),_0x230799),'qs':{'module':'Calls'},'headers':{'Authorization':_0x1a7b('0x6c')+_0x414560},'json':!![]});}})['then'](function(_0x4d057a){if(_0x4d057a){if(_0x4d057a[_0x1a7b('0x6d')]&&_0x4d057a[_0x1a7b('0x6d')][_0x1a7b('0x27')]){throw new Error(_0x4d057a[_0x1a7b('0x6d')][_0x1a7b('0x27')][_0x1a7b('0x6e')]);}var _0x5023a3=[];var _0x3a5075=[];var _0x508b8c=[_0x1a7b('0x6f'),'Subject',_0x1a7b('0x70'),_0x1a7b('0x71'),_0x1a7b('0x72'),_0x1a7b('0x73'),_0x1a7b('0x74'),_0x1a7b('0x75')];_0x3a5075=_[_0x1a7b('0x76')](_0x4d057a[_0x1a7b('0x32')],function(_0x7fd5be){return _0x508b8c[_0x1a7b('0x77')](_0x7fd5be[_0x1a7b('0x78')]);});for(var _0x29ab4a=0x0;_0x29ab4a<_0x3a5075[_0x1a7b('0x34')];_0x29ab4a++){if(_0x3a5075[_0x29ab4a]['system_mandatory']===![]){_0x5023a3[_0x1a7b('0x79')]({'id':_0x3a5075[_0x29ab4a]['id'],'name':_0x3a5075[_0x29ab4a][_0x1a7b('0x7a')],'custom':_0x3a5075[_0x29ab4a][_0x1a7b('0x7b')],'options':_0x3a5075[_0x29ab4a][_0x1a7b('0x7c')]===_0x1a7b('0x7d')&&_0x3a5075[_0x29ab4a][_0x1a7b('0x7e')][_0x1a7b('0x34')]>-0x1?_[_0x1a7b('0x2e')](_0x3a5075[_0x29ab4a][_0x1a7b('0x7e')],function(_0xea0d3b){return{'name':_0xea0d3b,'value':_0xea0d3b};}):[]});}}return{'count':_0x5023a3[_0x1a7b('0x34')],'rows':_0x5023a3};}else{return{'count':0x0,'rows':[]};}})[_0x1a7b('0x26')](respondWithResult(_0x1b266c,null))[_0x1a7b('0x43')](function(_0x371f77){var _0x235f3a=_0x5a8279['query'][_0x1a7b('0x7f')]?0x1f4:_0x371f77[_0x1a7b('0x80')]||0x1f4;logger[_0x1a7b('0x27')](_0x1a7b('0x81'),_0x1a7b('0x5e'),_0x235f3a,JSON[_0x1a7b('0x82')](_0x371f77));delete _0x371f77[_0x1a7b('0x29')];if(_0x235f3a===0x191){_0x235f3a=0x190;}_0x1b266c[_0x1a7b('0x19')](_0x235f3a)[_0x1a7b('0x2a')](_0x5a8279['query'][_0x1a7b('0x7f')]?{'message':'Wrong\x20credentials','statusCode':_0x371f77[_0x1a7b('0x80')]}:_0x371f77);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 5c9a434..f2edeef 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 _0xb022=['ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','slice','application/x-www-form-urlencoded','then','refresh_token','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','changed','zone','serverUrl','clientId','clientSecret','code','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','parse','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error'];(function(_0xb301d4,_0x27ed18){var _0x3b5bde=function(_0x1fbc5f){while(--_0x1fbc5f){_0xb301d4['push'](_0xb301d4['shift']());}};_0x3b5bde(++_0x27ed18);}(_0xb022,0x1f3));var _0x2b02=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xb022[_0xaa0309];return _0x5de7ce;};'use strict';var _=require(_0x2b02('0x0'));var util=require(_0x2b02('0x1'));var logger=require(_0x2b02('0x2'))(_0x2b02('0x3'));var moment=require(_0x2b02('0x4'));var BPromise=require(_0x2b02('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b02('0x6'));var rimraf=require(_0x2b02('0x7'));var config=require(_0x2b02('0x8'));var attributes=require(_0x2b02('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x2b02('0xa')]=function(_0x2521ef,_0x29f6ac){return _0x2521ef[_0x2b02('0xb')]('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xbe3a6a,_0x279f3e,_0x31e53d){if(_0xbe3a6a[_0x2b02('0xc')](_0x2b02('0xd'))||_0xbe3a6a['changed'](_0x2b02('0xe'))||_0xbe3a6a['changed'](_0x2b02('0xf'))||_0xbe3a6a[_0x2b02('0xc')](_0x2b02('0x10'))||_0xbe3a6a[_0x2b02('0xc')](_0x2b02('0x11'))||_0xbe3a6a['changed'](_0x2b02('0x12'))){var _0x4a132c,_0x1f4595;_0x4a132c=_0xbe3a6a['serverUrl'];var _0x289182=_0x4a132c['slice'](-0x1);if(_0x289182==='/'||_0x289182==='\x5c'||_0x289182===':'){_0x4a132c=_0x4a132c[_0x2b02('0x13')](0x0,_0x4a132c[_0x2b02('0x14')](_0x289182));}switch(_0xbe3a6a[_0x2b02('0xd')]){case'US':_0x1f4595=_0x2b02('0x15');break;case'AU':_0x1f4595=_0x2b02('0x16');break;case'IN':_0x1f4595=_0x2b02('0x17');break;case'CN':_0x1f4595=_0x2b02('0x18');break;default:_0x1f4595='https://accounts.zoho.eu';break;}var _0x3cdebd={'method':_0x2b02('0x19'),'uri':_0x1f4595+_0x2b02('0x1a'),'form':{'grant_type':_0x2b02('0x1b'),'client_id':_0xbe3a6a[_0x2b02('0xf')],'client_secret':_0xbe3a6a[_0x2b02('0x10')],'redirect_uri':_0xbe3a6a[_0x2b02('0xe')],'code':_0xbe3a6a[_0x2b02('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x3cdebd)['then'](function(_0x552c82){var _0xe61b47=JSON[_0x2b02('0x1c')](_0x552c82);if(_0xe61b47['refresh_token']){_0xbe3a6a[_0x2b02('0x1d')]=_0xe61b47['refresh_token'];logger[_0x2b02('0x1e')](util[_0x2b02('0x1f')](_0x2b02('0x20'),_0xbe3a6a['name'],_0xbe3a6a['id']));}else{logger[_0x2b02('0x21')](util[_0x2b02('0x1f')](_0x2b02('0x22'),_0xbe3a6a[_0x2b02('0x23')],_0xbe3a6a['id']),util[_0x2b02('0x24')](_0xe61b47,{'showHidden':![],'depth':null}));}return _0x31e53d(null,_0x279f3e);})['catch'](function(_0x3bb180){logger[_0x2b02('0x21')](util['format'](_0x2b02('0x22'),_0xbe3a6a[_0x2b02('0x23')],_0xbe3a6a['id']),util[_0x2b02('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x31e53d(_0x3bb180);});}else{return _0x31e53d(null,_0x279f3e);}},'beforeUpdate':function(_0x48d38f,_0x3d6136,_0x4e044a){if(_0x48d38f[_0x2b02('0xc')](_0x2b02('0xd'))||_0x48d38f['changed'](_0x2b02('0xe'))||_0x48d38f[_0x2b02('0xc')](_0x2b02('0xf'))||_0x48d38f[_0x2b02('0xc')](_0x2b02('0x10'))||_0x48d38f[_0x2b02('0xc')](_0x2b02('0x11'))||_0x48d38f[_0x2b02('0xc')]('host')){var _0x967728,_0x36e614;_0x967728=_0x48d38f[_0x2b02('0xe')];var _0x1fdd97=_0x967728[_0x2b02('0x25')](-0x1);if(_0x1fdd97==='/'||_0x1fdd97==='\x5c'||_0x1fdd97===':'){_0x967728=_0x967728['substring'](0x0,_0x967728[_0x2b02('0x14')](_0x1fdd97));}switch(_0x48d38f[_0x2b02('0xd')]){case'US':_0x36e614='https://accounts.zoho.com';break;case'AU':_0x36e614=_0x2b02('0x16');break;case'IN':_0x36e614=_0x2b02('0x17');break;case'CN':_0x36e614=_0x2b02('0x18');break;default:_0x36e614='https://accounts.zoho.eu';break;}var _0x4fe8eb={'method':_0x2b02('0x19'),'uri':_0x36e614+_0x2b02('0x1a'),'form':{'grant_type':'authorization_code','client_id':_0x48d38f[_0x2b02('0xf')],'client_secret':_0x48d38f[_0x2b02('0x10')],'redirect_uri':_0x48d38f[_0x2b02('0xe')],'code':_0x48d38f['code']},'headers':{'Content-Type':_0x2b02('0x26')}};return rp(_0x4fe8eb)[_0x2b02('0x27')](function(_0x23acaf){var _0x512cbb=JSON[_0x2b02('0x1c')](_0x23acaf);if(_0x512cbb[_0x2b02('0x28')]){_0x48d38f[_0x2b02('0x1d')]=_0x512cbb['refresh_token'];logger[_0x2b02('0x1e')](util[_0x2b02('0x1f')](_0x2b02('0x20'),_0x48d38f['name'],_0x48d38f['id']));}else{logger['error'](util[_0x2b02('0x1f')](_0x2b02('0x22'),_0x48d38f[_0x2b02('0x23')],_0x48d38f['id']),util[_0x2b02('0x24')](_0x512cbb,{'showHidden':![],'depth':null}));}return _0x4e044a(null,_0x3d6136);})['catch'](function(_0x162f81){logger[_0x2b02('0x21')](util['format'](_0x2b02('0x22'),_0x48d38f[_0x2b02('0x23')],_0x48d38f['id']),util[_0x2b02('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x4e044a(_0x162f81);});}else{return _0x4e044a(null,_0x3d6136);}}}});}; \ No newline at end of file +var _0x7945=['serverUrl','clientId','clientSecret','code','host','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','then','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','authorization_code','refreshToken','catch','lodash','util','api','moment','request-promise','../../config/environment','./intZohoAccount.attributes','exports','ZohoAccount','int_zoho_accounts','changed','zone'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7945,0xb7));var _0x5794=function(_0x4d06a0,_0x225dce){_0x4d06a0=_0x4d06a0-0x0;var _0x5cd335=_0x7945[_0x4d06a0];return _0x5cd335;};'use strict';var _=require(_0x5794('0x0'));var util=require(_0x5794('0x1'));var logger=require('../../config/logger')(_0x5794('0x2'));var moment=require(_0x5794('0x3'));var BPromise=require('bluebird');var rp=require(_0x5794('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5794('0x5'));var attributes=require(_0x5794('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x5794('0x7')]=function(_0x31dbce,_0x205092){return _0x31dbce['define'](_0x5794('0x8'),attributes,{'tableName':_0x5794('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xdad0fd,_0x14381b,_0x3974e2){if(_0xdad0fd[_0x5794('0xa')](_0x5794('0xb'))||_0xdad0fd[_0x5794('0xa')](_0x5794('0xc'))||_0xdad0fd['changed'](_0x5794('0xd'))||_0xdad0fd[_0x5794('0xa')](_0x5794('0xe'))||_0xdad0fd['changed'](_0x5794('0xf'))||_0xdad0fd['changed'](_0x5794('0x10'))){var _0x5c1488,_0x5523fc;_0x5c1488=_0xdad0fd[_0x5794('0xc')];var _0x3b1124=_0x5c1488[_0x5794('0x11')](-0x1);if(_0x3b1124==='/'||_0x3b1124==='\x5c'||_0x3b1124===':'){_0x5c1488=_0x5c1488['substring'](0x0,_0x5c1488[_0x5794('0x12')](_0x3b1124));}switch(_0xdad0fd[_0x5794('0xb')]){case'US':_0x5523fc=_0x5794('0x13');break;case'AU':_0x5523fc='https://accounts.zoho.com.au';break;case'IN':_0x5523fc=_0x5794('0x14');break;case'CN':_0x5523fc='https://accounts.zoho.com.cn';break;default:_0x5523fc=_0x5794('0x15');break;}var _0x3fb959={'method':_0x5794('0x16'),'uri':_0x5523fc+_0x5794('0x17'),'form':{'grant_type':'authorization_code','client_id':_0xdad0fd['clientId'],'client_secret':_0xdad0fd[_0x5794('0xe')],'redirect_uri':_0xdad0fd[_0x5794('0xc')],'code':_0xdad0fd[_0x5794('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x3fb959)[_0x5794('0x18')](function(_0x5028f1){var _0x4098a2=JSON[_0x5794('0x19')](_0x5028f1);if(_0x4098a2[_0x5794('0x1a')]){_0xdad0fd['refreshToken']=_0x4098a2[_0x5794('0x1a')];logger[_0x5794('0x1b')](util[_0x5794('0x1c')](_0x5794('0x1d'),_0xdad0fd[_0x5794('0x1e')],_0xdad0fd['id']));}else{logger[_0x5794('0x1f')](util[_0x5794('0x1c')](_0x5794('0x20'),_0xdad0fd[_0x5794('0x1e')],_0xdad0fd['id']),util[_0x5794('0x21')](_0x4098a2,{'showHidden':![],'depth':null}));}return _0x3974e2(null,_0x14381b);})['catch'](function(_0x5d2660){logger[_0x5794('0x1f')](util['format'](_0x5794('0x20'),_0xdad0fd['name'],_0xdad0fd['id']),util[_0x5794('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x3974e2(_0x5d2660);});}else{return _0x3974e2(null,_0x14381b);}},'beforeUpdate':function(_0xd2b0ca,_0x5e9cf7,_0x160ea7){if(_0xd2b0ca[_0x5794('0xa')](_0x5794('0xb'))||_0xd2b0ca[_0x5794('0xa')](_0x5794('0xc'))||_0xd2b0ca['changed'](_0x5794('0xd'))||_0xd2b0ca[_0x5794('0xa')](_0x5794('0xe'))||_0xd2b0ca[_0x5794('0xa')](_0x5794('0xf'))||_0xd2b0ca[_0x5794('0xa')](_0x5794('0x10'))){var _0x4bd6b9,_0x2a4f89;_0x4bd6b9=_0xd2b0ca[_0x5794('0xc')];var _0x1722f6=_0x4bd6b9['slice'](-0x1);if(_0x1722f6==='/'||_0x1722f6==='\x5c'||_0x1722f6===':'){_0x4bd6b9=_0x4bd6b9['substring'](0x0,_0x4bd6b9[_0x5794('0x12')](_0x1722f6));}switch(_0xd2b0ca[_0x5794('0xb')]){case'US':_0x2a4f89='https://accounts.zoho.com';break;case'AU':_0x2a4f89=_0x5794('0x22');break;case'IN':_0x2a4f89=_0x5794('0x14');break;case'CN':_0x2a4f89=_0x5794('0x23');break;default:_0x2a4f89=_0x5794('0x15');break;}var _0x57fb75={'method':_0x5794('0x16'),'uri':_0x2a4f89+_0x5794('0x17'),'form':{'grant_type':_0x5794('0x24'),'client_id':_0xd2b0ca[_0x5794('0xd')],'client_secret':_0xd2b0ca['clientSecret'],'redirect_uri':_0xd2b0ca[_0x5794('0xc')],'code':_0xd2b0ca[_0x5794('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x57fb75)[_0x5794('0x18')](function(_0x32bfbc){var _0x250687=JSON[_0x5794('0x19')](_0x32bfbc);if(_0x250687['refresh_token']){_0xd2b0ca[_0x5794('0x25')]=_0x250687['refresh_token'];logger[_0x5794('0x1b')](util[_0x5794('0x1c')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0xd2b0ca[_0x5794('0x1e')],_0xd2b0ca['id']));}else{logger[_0x5794('0x1f')](util[_0x5794('0x1c')](_0x5794('0x20'),_0xd2b0ca[_0x5794('0x1e')],_0xd2b0ca['id']),util[_0x5794('0x21')](_0x250687,{'showHidden':![],'depth':null}));}return _0x160ea7(null,_0x5e9cf7);})[_0x5794('0x26')](function(_0x581538){logger[_0x5794('0x1f')](util[_0x5794('0x1c')](_0x5794('0x20'),_0xd2b0ca[_0x5794('0x1e')],_0xd2b0ca['id']),util[_0x5794('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x160ea7(_0x581538);});}else{return _0x160ea7(null,_0x5e9cf7);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index b81cddc..e9e5262 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 _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(_0x151e82,_0x3e5c8e){var _0x29e3a8=function(_0x390770){while(--_0x390770){_0x151e82['push'](_0x151e82['shift']());}};_0x29e3a8(++_0x3e5c8e);}(_0xce14,0x17f));var _0x4ce1=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xce14[_0x19e35c];return _0x3e1fe8;};'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 +var _0xb1fa=['info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','model','map','find','ShowZohoAccount','moment','randomstring','../../config/environment','request'];(function(_0x5f4c5f,_0xd51f71){var _0x5a9348=function(_0x4c7193){while(--_0x4c7193){_0x5f4c5f['push'](_0x5f4c5f['shift']());}};_0x5a9348(++_0xd51f71);}(_0xb1fa,0x9e));var _0xab1f=function(_0x5331b5,_0x29e3ba){_0x5331b5=_0x5331b5-0x0;var _0x153127=_0xb1fa[_0x5331b5];return _0x153127;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab1f('0x0'));var BPromise=require('bluebird');var rs=require(_0xab1f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xab1f('0x2'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x463442,_0x54c5b0,_0x17e178){return new BPromise(function(_0x2fbc7e,_0x5213a4){return client[_0xab1f('0x3')](_0x463442,_0x17e178)['then'](function(_0x578cf7){logger[_0xab1f('0x4')](_0xab1f('0x5'),_0x54c5b0,_0xab1f('0x6'));logger[_0xab1f('0x7')](_0xab1f('0x8'),_0x54c5b0,'request\x20sent',JSON[_0xab1f('0x9')](_0x578cf7));if(_0x578cf7['error']){if(_0x578cf7['error'][_0xab1f('0xa')]===0x1f4){logger[_0xab1f('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x54c5b0,_0x578cf7['error'][_0xab1f('0xc')]);return _0x5213a4(_0x578cf7['error'][_0xab1f('0xc')]);}logger[_0xab1f('0xb')](_0xab1f('0x5'),_0x54c5b0,_0x578cf7['error'][_0xab1f('0xc')]);return _0x2fbc7e(_0x578cf7[_0xab1f('0xb')][_0xab1f('0xc')]);}else{logger[_0xab1f('0x4')]('ZohoAccount,\x20%s,\x20%s',_0x54c5b0,_0xab1f('0x6'));_0x2fbc7e(_0x578cf7['result'][_0xab1f('0xc')]);}})[_0xab1f('0xd')](function(_0xcdba98){logger['error'](_0xab1f('0x5'),_0x54c5b0,_0xcdba98);_0x5213a4(_0xcdba98);});});}exports[_0xab1f('0xe')]=function(_0x558c52){var _0x1ec084=this;return new Promise(function(_0x4ba3f4,_0x1b0ab3){return db[_0xab1f('0xf')][_0xab1f('0x10')]({'raw':_0x558c52['options']?_0x558c52[_0xab1f('0x11')][_0xab1f('0x12')]===undefined?!![]:![]:!![],'where':_0x558c52['options']?_0x558c52[_0xab1f('0x11')][_0xab1f('0x13')]||null:null,'attributes':_0x558c52['options']?_0x558c52['options'][_0xab1f('0x14')]||null:null,'limit':_0x558c52[_0xab1f('0x11')]?_0x558c52[_0xab1f('0x11')][_0xab1f('0x15')]||null:null,'include':_0x558c52[_0xab1f('0x11')]?_0x558c52[_0xab1f('0x11')][_0xab1f('0x16')]?_['map'](_0x558c52[_0xab1f('0x11')][_0xab1f('0x16')],function(_0x3662b8){return{'model':db[_0x3662b8[_0xab1f('0x17')]],'as':_0x3662b8['as'],'attributes':_0x3662b8['attributes'],'include':_0x3662b8[_0xab1f('0x16')]?_[_0xab1f('0x18')](_0x3662b8[_0xab1f('0x16')],function(_0x162041){return{'model':db[_0x162041['model']],'as':_0x162041['as'],'attributes':_0x162041[_0xab1f('0x14')],'include':_0x162041[_0xab1f('0x16')]?_[_0xab1f('0x18')](_0x162041[_0xab1f('0x16')],function(_0x27d4c3){return{'model':db[_0x27d4c3[_0xab1f('0x17')]],'as':_0x27d4c3['as'],'attributes':_0x27d4c3[_0xab1f('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2216ca){logger['info'](_0xab1f('0xe'),_0x558c52);logger['debug'](_0xab1f('0xe'),_0x558c52,JSON[_0xab1f('0x9')](_0x2216ca));_0x4ba3f4(_0x2216ca);})[_0xab1f('0xd')](function(_0x449e16){logger[_0xab1f('0xb')](_0xab1f('0xe'),_0x449e16[_0xab1f('0xc')],_0x558c52);_0x1b0ab3(_0x1ec084[_0xab1f('0xb')](0x1f4,_0x449e16[_0xab1f('0xc')]));});});};exports['ShowZohoAccount']=function(_0x355706){var _0x5e6170=this;return new Promise(function(_0x1c1bce,_0x24c678){return db[_0xab1f('0xf')][_0xab1f('0x19')]({'raw':_0x355706[_0xab1f('0x11')]?_0x355706['options'][_0xab1f('0x12')]===undefined?!![]:![]:!![],'where':_0x355706[_0xab1f('0x11')]?_0x355706[_0xab1f('0x11')]['where']||null:null,'attributes':_0x355706[_0xab1f('0x11')]?_0x355706['options'][_0xab1f('0x14')]||null:null,'include':_0x355706['options']?_0x355706[_0xab1f('0x11')]['include']?_[_0xab1f('0x18')](_0x355706[_0xab1f('0x11')][_0xab1f('0x16')],function(_0x3a5891){return{'model':db[_0x3a5891['model']],'as':_0x3a5891['as'],'attributes':_0x3a5891['attributes'],'include':_0x3a5891[_0xab1f('0x16')]?_['map'](_0x3a5891[_0xab1f('0x16')],function(_0x2f8ac5){return{'model':db[_0x2f8ac5[_0xab1f('0x17')]],'as':_0x2f8ac5['as'],'attributes':_0x2f8ac5[_0xab1f('0x14')],'include':_0x2f8ac5[_0xab1f('0x16')]?_[_0xab1f('0x18')](_0x2f8ac5['include'],function(_0x32a281){return{'model':db[_0x32a281[_0xab1f('0x17')]],'as':_0x32a281['as'],'attributes':_0x32a281['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x344aec){logger[_0xab1f('0x4')](_0xab1f('0x1a'),_0x355706);logger[_0xab1f('0x7')](_0xab1f('0x1a'),_0x355706,JSON[_0xab1f('0x9')](_0x344aec));_0x1c1bce(_0x344aec);})['catch'](function(_0x316301){logger[_0xab1f('0xb')](_0xab1f('0x1a'),_0x316301[_0xab1f('0xc')],_0x355706);_0x24c678(_0x5e6170[_0xab1f('0xb')](0x1f4,_0x316301[_0xab1f('0xc')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 38b2dc9..baa1055 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 _0x7155=['/:id/subjects','/:id/descriptions','post','create','put','/:id','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','/:id/fields'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7155,0x170));var _0x5715=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7155[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x5715('0x0'));var path=require(_0x5715('0x1'));var timeout=require(_0x5715('0x2'));var express=require(_0x5715('0x3'));var router=express[_0x5715('0x4')]();var fs_extra=require(_0x5715('0x5'));var auth=require(_0x5715('0x6'));var interaction=require(_0x5715('0x7'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0x5715('0x8')]('/',auth[_0x5715('0x9')](),controller['index']);router['get']('/:id',auth[_0x5715('0x9')](),controller[_0x5715('0xa')]);router['get'](_0x5715('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x5715('0x8')](_0x5715('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x5715('0x8')](_0x5715('0xd'),auth[_0x5715('0x9')](),controller['getDescriptions']);router[_0x5715('0xe')]('/',auth[_0x5715('0x9')](),controller[_0x5715('0xf')]);router[_0x5715('0x10')](_0x5715('0x11'),auth[_0x5715('0x9')](),controller[_0x5715('0x12')]);router[_0x5715('0x13')](_0x5715('0x11'),auth[_0x5715('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xac9b=['post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x1eff7c,_0x357ad0){var _0x304854=function(_0x27f760){while(--_0x27f760){_0x1eff7c['push'](_0x1eff7c['shift']());}};_0x304854(++_0x357ad0);}(_0xac9b,0xb5));var _0xbac9=function(_0x2de020,_0x252df0){_0x2de020=_0x2de020-0x0;var _0x182b7c=_0xac9b[_0x2de020];return _0x182b7c;};'use strict';var multer=require(_0xbac9('0x0'));var util=require(_0xbac9('0x1'));var path=require(_0xbac9('0x2'));var timeout=require(_0xbac9('0x3'));var express=require(_0xbac9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbac9('0x5'));var interaction=require(_0xbac9('0x6'));var config=require('../../config/environment');var controller=require(_0xbac9('0x7'));router[_0xbac9('0x8')]('/',auth[_0xbac9('0x9')](),controller[_0xbac9('0xa')]);router[_0xbac9('0x8')](_0xbac9('0xb'),auth[_0xbac9('0x9')](),controller[_0xbac9('0xc')]);router['get'](_0xbac9('0xd'),auth[_0xbac9('0x9')](),controller[_0xbac9('0xe')]);router[_0xbac9('0x8')](_0xbac9('0xf'),auth[_0xbac9('0x9')](),controller[_0xbac9('0x10')]);router['get'](_0xbac9('0x11'),auth[_0xbac9('0x9')](),controller[_0xbac9('0x12')]);router[_0xbac9('0x13')]('/',auth[_0xbac9('0x9')](),controller[_0xbac9('0x14')]);router['put'](_0xbac9('0xb'),auth['isAuthenticated'](),controller[_0xbac9('0x15')]);router[_0xbac9('0x16')](_0xbac9('0xb'),auth['isAuthenticated'](),controller[_0xbac9('0x17')]);module[_0xbac9('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 702f775..81d4ea6 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 _0xcbf6=['STRING','ENUM','lead','nothing','contact_lead','contact','sequelize'];(function(_0x4a2fe2,_0x36ed3d){var _0x408373=function(_0x47eefa){while(--_0x47eefa){_0x4a2fe2['push'](_0x4a2fe2['shift']());}};_0x408373(++_0x36ed3d);}(_0xcbf6,0xd8));var _0x6cbf=function(_0x36a4f9,_0x3f5506){_0x36a4f9=_0x36a4f9-0x0;var _0x479588=_0xcbf6[_0x36a4f9];return _0x479588;};'use strict';var Sequelize=require(_0x6cbf('0x0'));module['exports']={'name':{'type':Sequelize[_0x6cbf('0x1')]},'moduleCreate':{'type':Sequelize[_0x6cbf('0x2')](_0x6cbf('0x3'),'contact',_0x6cbf('0x4')),'defaultValue':_0x6cbf('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x6cbf('0x5'),_0x6cbf('0x6'),'lead'),'defaultValue':_0x6cbf('0x5')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x295f=['nothing','contact_lead','lead','exports','STRING','ENUM','contact'];(function(_0x100916,_0x25270d){var _0xa31589=function(_0x2e5f3f){while(--_0x2e5f3f){_0x100916['push'](_0x100916['shift']());}};_0xa31589(++_0x25270d);}(_0x295f,0x168));var _0xf295=function(_0x4e5842,_0x26442b){_0x4e5842=_0x4e5842-0x0;var _0x3f8ae2=_0x295f[_0x4e5842];return _0x3f8ae2;};'use strict';var Sequelize=require('sequelize');module[_0xf295('0x0')]={'name':{'type':Sequelize[_0xf295('0x1')]},'moduleCreate':{'type':Sequelize[_0xf295('0x2')]('lead',_0xf295('0x3'),_0xf295('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM'](_0xf295('0x5'),_0xf295('0x3'),_0xf295('0x6')),'defaultValue':_0xf295('0x5')},'description':{'type':Sequelize[_0xf295('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 19aa961..3f642eb 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 _0x9309=['status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','ZohoConfiguration','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','rawAttributes','find','create','body','params','catch','getFields','findOne','ZohoField','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x47a854,_0x5871dd){var _0x51a0af=function(_0x3c0d6d){while(--_0x3c0d6d){_0x47a854['push'](_0x47a854['shift']());}};_0x51a0af(++_0x5871dd);}(_0x9309,0x85));var _0x9930=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9309[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9930('0x0'));var rimraf=require(_0x9930('0x1'));var zipdir=require(_0x9930('0x2'));var jsonpatch=require(_0x9930('0x3'));var rp=require(_0x9930('0x4'));var moment=require(_0x9930('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9930('0x6'));var util=require(_0x9930('0x7'));var path=require(_0x9930('0x8'));var sox=require(_0x9930('0x9'));var csv=require(_0x9930('0xa'));var ejs=require(_0x9930('0xb'));var fs=require('fs');var fs_extra=require(_0x9930('0xc'));var _=require(_0x9930('0xd'));var squel=require(_0x9930('0xe'));var crypto=require(_0x9930('0xf'));var jsforce=require(_0x9930('0x10'));var deskjs=require(_0x9930('0x11'));var toCsv=require('to-csv');var querystring=require(_0x9930('0x12'));var Papa=require('papaparse');var Redis=require(_0x9930('0x13'));var authService=require(_0x9930('0x14'));var qs=require(_0x9930('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9930('0x16'));var utils=require(_0x9930('0x17'));var config=require(_0x9930('0x18'));var licenseUtil=require(_0x9930('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x791e5d,_0x5531b9){_0x5531b9=_0x5531b9||0xcc;return function(_0x4e2939){if(_0x4e2939){return _0x791e5d[_0x9930('0x1a')](_0x5531b9);}return _0x791e5d[_0x9930('0x1b')](_0x5531b9)[_0x9930('0x1c')]();};}function respondWithResult(_0x348862,_0x322e10){_0x322e10=_0x322e10||0xc8;return function(_0x16097c){if(_0x16097c){return _0x348862[_0x9930('0x1b')](_0x322e10)[_0x9930('0x1d')](_0x16097c);}};}function respondWithFilteredResult(_0x1cf437,_0x7e0a17){return function(_0x3feea3){if(_0x3feea3){var _0x22e54e=typeof _0x7e0a17[_0x9930('0x1e')]==='undefined'&&typeof _0x7e0a17[_0x9930('0x1f')]==='undefined';var _0x5c5f63=_0x3feea3[_0x9930('0x20')];var _0x296f39=_0x22e54e?0x0:_0x7e0a17['offset'];var _0x2fc33b=_0x22e54e?_0x3feea3[_0x9930('0x20')]:_0x7e0a17[_0x9930('0x1e')]+_0x7e0a17['limit'];var _0x15a9a2;if(_0x2fc33b>=_0x5c5f63){_0x2fc33b=_0x5c5f63;_0x15a9a2=0xc8;}else{_0x15a9a2=0xce;}_0x1cf437[_0x9930('0x1b')](_0x15a9a2);return _0x1cf437[_0x9930('0x21')](_0x9930('0x22'),_0x296f39+'-'+_0x2fc33b+'/'+_0x5c5f63)['json'](_0x3feea3);}return null;};}function patchUpdates(_0x3aaf1c){return function(_0x2c8d25){try{jsonpatch[_0x9930('0x23')](_0x2c8d25,_0x3aaf1c,!![]);}catch(_0x3b024a){return BPromise[_0x9930('0x24')](_0x3b024a);}return _0x2c8d25['save']();};}function saveUpdates(_0x2ba0cb,_0x57e0df){return function(_0x56c077){if(_0x56c077){return _0x56c077[_0x9930('0x25')](_0x2ba0cb)[_0x9930('0x26')](function(_0x97f64a){return _0x97f64a;});}return null;};}function removeEntity(_0xf0ba3d,_0x283508){return function(_0xa70c4b){if(_0xa70c4b){return _0xa70c4b[_0x9930('0x27')]()['then'](function(){_0xf0ba3d[_0x9930('0x1b')](0xcc)[_0x9930('0x1c')]();});}};}function handleEntityNotFound(_0x7dd761,_0x375c51){return function(_0x29003b){if(!_0x29003b){_0x7dd761[_0x9930('0x1a')](0x194);}return _0x29003b;};}function handleError(_0x200b94,_0x2bac6c){_0x2bac6c=_0x2bac6c||0x1f4;return function(_0x56f115){logger[_0x9930('0x28')](_0x56f115[_0x9930('0x29')]);if(_0x56f115[_0x9930('0x2a')]){delete _0x56f115['name'];}_0x200b94[_0x9930('0x1b')](_0x2bac6c)['send'](_0x56f115);};}exports[_0x9930('0x2b')]=function(_0xe7d58e,_0x16102d){var _0xc812ac={},_0x294efd={},_0x31b6ba={'count':0x0,'rows':[]};var _0x20656e=_['map'](db[_0x9930('0x2c')]['rawAttributes'],function(_0x524f04){return{'name':_0x524f04['fieldName'],'type':_0x524f04['type'][_0x9930('0x2d')]};});_0x294efd[_0x9930('0x2e')]=_[_0x9930('0x2f')](_0x20656e,_0x9930('0x2a'));_0x294efd[_0x9930('0x30')]=_[_0x9930('0x31')](_0xe7d58e['query']);_0x294efd['filters']=_[_0x9930('0x32')](_0x294efd[_0x9930('0x2e')],_0x294efd['query']);_0xc812ac[_0x9930('0x33')]=_[_0x9930('0x32')](_0x294efd['model'],qs[_0x9930('0x34')](_0xe7d58e[_0x9930('0x30')][_0x9930('0x34')]));_0xc812ac[_0x9930('0x33')]=_0xc812ac[_0x9930('0x33')][_0x9930('0x35')]?_0xc812ac[_0x9930('0x33')]:_0x294efd[_0x9930('0x2e')];if(!_0xe7d58e[_0x9930('0x30')][_0x9930('0x36')]('nolimit')){_0xc812ac[_0x9930('0x1f')]=qs[_0x9930('0x1f')](_0xe7d58e[_0x9930('0x30')][_0x9930('0x1f')]);_0xc812ac[_0x9930('0x1e')]=qs[_0x9930('0x1e')](_0xe7d58e[_0x9930('0x30')]['offset']);}_0xc812ac[_0x9930('0x37')]=qs[_0x9930('0x38')](_0xe7d58e['query']['sort']);_0xc812ac['where']=qs[_0x9930('0x39')](_[_0x9930('0x3a')](_0xe7d58e['query'],_0x294efd[_0x9930('0x39')]),_0x20656e);if(_0xe7d58e[_0x9930('0x30')][_0x9930('0x3b')]){_0xc812ac[_0x9930('0x3c')]=_[_0x9930('0x3d')](_0xc812ac[_0x9930('0x3c')],{'$or':_[_0x9930('0x2f')](_0x20656e,function(_0x2c0df7){if(_0x2c0df7['type']!==_0x9930('0x3e')){var _0x56ade7={};_0x56ade7[_0x2c0df7[_0x9930('0x2a')]]={'$like':'%'+_0xe7d58e[_0x9930('0x30')][_0x9930('0x3b')]+'%'};return _0x56ade7;}})});}_0xc812ac=_[_0x9930('0x3d')]({},_0xc812ac,_0xe7d58e[_0x9930('0x3f')]);var _0x26d69d={'where':_0xc812ac[_0x9930('0x3c')]};return db[_0x9930('0x2c')][_0x9930('0x20')](_0x26d69d)['then'](function(_0x3d189f){_0x31b6ba[_0x9930('0x20')]=_0x3d189f;if(_0xe7d58e[_0x9930('0x30')][_0x9930('0x40')]){_0xc812ac[_0x9930('0x41')]=[{'all':!![]}];}return db[_0x9930('0x2c')]['findAll'](_0xc812ac);})[_0x9930('0x26')](function(_0x2b458d){_0x31b6ba[_0x9930('0x42')]=_0x2b458d;return _0x31b6ba;})[_0x9930('0x26')](respondWithFilteredResult(_0x16102d,_0xc812ac))['catch'](handleError(_0x16102d,null));};exports[_0x9930('0x43')]=function(_0xa2dbbf,_0x1fc903){var _0x2a9563={'raw':![],'where':{'id':_0xa2dbbf['params']['id']}},_0x37dff9={};_0x37dff9[_0x9930('0x2e')]=_[_0x9930('0x31')](db['ZohoConfiguration'][_0x9930('0x44')]);_0x37dff9[_0x9930('0x30')]=_[_0x9930('0x31')](_0xa2dbbf[_0x9930('0x30')]);_0x37dff9[_0x9930('0x39')]=_[_0x9930('0x32')](_0x37dff9['model'],_0x37dff9[_0x9930('0x30')]);_0x2a9563['attributes']=_[_0x9930('0x32')](_0x37dff9['model'],qs[_0x9930('0x34')](_0xa2dbbf[_0x9930('0x30')]['fields']));_0x2a9563[_0x9930('0x33')]=_0x2a9563['attributes']['length']?_0x2a9563['attributes']:_0x37dff9['model'];if(_0xa2dbbf[_0x9930('0x30')][_0x9930('0x40')]){_0x2a9563[_0x9930('0x41')]=[{'all':!![]}];}_0x2a9563=_[_0x9930('0x3d')]({},_0x2a9563,_0xa2dbbf[_0x9930('0x3f')]);return db[_0x9930('0x2c')][_0x9930('0x45')](_0x2a9563)['then'](handleEntityNotFound(_0x1fc903,null))[_0x9930('0x26')](respondWithResult(_0x1fc903,null))['catch'](handleError(_0x1fc903,null));};exports[_0x9930('0x46')]=function(_0x225a3b,_0x52c552){return db[_0x9930('0x2c')][_0x9930('0x46')](_0x225a3b[_0x9930('0x47')],{})[_0x9930('0x26')](respondWithResult(_0x52c552,0xc9))['catch'](handleError(_0x52c552,null));};exports[_0x9930('0x25')]=function(_0x226a47,_0x219ad0){if(_0x226a47[_0x9930('0x47')]['id']){delete _0x226a47['body']['id'];}return db[_0x9930('0x2c')][_0x9930('0x45')]({'where':{'id':_0x226a47[_0x9930('0x48')]['id']}})[_0x9930('0x26')](handleEntityNotFound(_0x219ad0,null))[_0x9930('0x26')](saveUpdates(_0x226a47['body'],null))[_0x9930('0x26')](respondWithResult(_0x219ad0,null))['catch'](handleError(_0x219ad0,null));};exports[_0x9930('0x27')]=function(_0x4b2405,_0x33a143){return db[_0x9930('0x2c')][_0x9930('0x45')]({'where':{'id':_0x4b2405[_0x9930('0x48')]['id']}})[_0x9930('0x26')](handleEntityNotFound(_0x33a143,null))[_0x9930('0x26')](removeEntity(_0x33a143,null))[_0x9930('0x49')](handleError(_0x33a143,null));};exports[_0x9930('0x4a')]=function(_0x702cdb,_0x29131d,_0x19abbf){var _0x27d813={};var _0x11e360={};var _0x37b4c6;var _0x306f5a;return db['ZohoConfiguration'][_0x9930('0x4b')]({'where':{'id':_0x702cdb[_0x9930('0x48')]['id']}})[_0x9930('0x26')](handleEntityNotFound(_0x29131d,null))[_0x9930('0x26')](function(_0x18d9c1){if(_0x18d9c1){_0x37b4c6=_0x18d9c1;_0x11e360[_0x9930('0x2e')]=_[_0x9930('0x31')](db[_0x9930('0x4c')][_0x9930('0x44')]);_0x11e360['query']=_[_0x9930('0x31')](_0x702cdb[_0x9930('0x30')]);_0x11e360['filters']=_[_0x9930('0x32')](_0x11e360[_0x9930('0x2e')],_0x11e360[_0x9930('0x30')]);_0x27d813[_0x9930('0x33')]=_['intersection'](_0x11e360[_0x9930('0x2e')],qs[_0x9930('0x34')](_0x702cdb[_0x9930('0x30')][_0x9930('0x34')]));_0x27d813[_0x9930('0x33')]=_0x27d813['attributes'][_0x9930('0x35')]?_0x27d813[_0x9930('0x33')]:_0x11e360['model'];_0x27d813[_0x9930('0x37')]=qs[_0x9930('0x38')](_0x702cdb[_0x9930('0x30')][_0x9930('0x38')]);_0x27d813['where']=qs['filters'](_[_0x9930('0x3a')](_0x702cdb[_0x9930('0x30')],_0x11e360[_0x9930('0x39')]));if(_0x702cdb[_0x9930('0x30')]['filter']){_0x27d813['where']=_[_0x9930('0x3d')](_0x27d813[_0x9930('0x3c')],{'$or':_[_0x9930('0x2f')](_0x27d813[_0x9930('0x33')],function(_0x283607){var _0x168a2a={};_0x168a2a[_0x283607]={'$like':'%'+_0x702cdb['query'][_0x9930('0x3b')]+'%'};return _0x168a2a;})});}_0x27d813=_[_0x9930('0x3d')]({},_0x27d813,_0x702cdb['options']);return _0x37b4c6[_0x9930('0x4a')](_0x27d813);}})[_0x9930('0x26')](function(_0x256a96){if(_0x256a96){_0x306f5a=_0x256a96[_0x9930('0x35')];if(!_0x702cdb[_0x9930('0x30')][_0x9930('0x36')](_0x9930('0x4d'))){_0x27d813['limit']=qs['limit'](_0x702cdb[_0x9930('0x30')][_0x9930('0x1f')]);_0x27d813['offset']=qs[_0x9930('0x1e')](_0x702cdb[_0x9930('0x30')][_0x9930('0x1e')]);}return _0x37b4c6['getFields'](_0x27d813);}})[_0x9930('0x26')](function(_0x10a8ae){if(_0x10a8ae){return _0x10a8ae?{'count':_0x306f5a,'rows':_0x10a8ae}:null;}})[_0x9930('0x26')](respondWithResult(_0x29131d,null))[_0x9930('0x49')](handleError(_0x29131d,null));};exports[_0x9930('0x4e')]=function(_0x675728,_0x5c308e,_0x3abe72){var _0x13d844={};var _0x14b5df={};var _0x2ad2b1;var _0x1e5887;return db[_0x9930('0x2c')][_0x9930('0x4b')]({'where':{'id':_0x675728[_0x9930('0x48')]['id']}})[_0x9930('0x26')](handleEntityNotFound(_0x5c308e,null))[_0x9930('0x26')](function(_0x245dbb){if(_0x245dbb){_0x2ad2b1=_0x245dbb;_0x14b5df[_0x9930('0x2e')]=_[_0x9930('0x31')](db[_0x9930('0x4c')][_0x9930('0x44')]);_0x14b5df[_0x9930('0x30')]=_[_0x9930('0x31')](_0x675728['query']);_0x14b5df[_0x9930('0x39')]=_[_0x9930('0x32')](_0x14b5df[_0x9930('0x2e')],_0x14b5df[_0x9930('0x30')]);_0x13d844[_0x9930('0x33')]=_['intersection'](_0x14b5df[_0x9930('0x2e')],qs[_0x9930('0x34')](_0x675728[_0x9930('0x30')][_0x9930('0x34')]));_0x13d844[_0x9930('0x33')]=_0x13d844[_0x9930('0x33')][_0x9930('0x35')]?_0x13d844[_0x9930('0x33')]:_0x14b5df[_0x9930('0x2e')];_0x13d844[_0x9930('0x37')]=qs[_0x9930('0x38')](_0x675728[_0x9930('0x30')][_0x9930('0x38')]);_0x13d844['where']=qs[_0x9930('0x39')](_[_0x9930('0x3a')](_0x675728['query'],_0x14b5df[_0x9930('0x39')]));if(_0x675728[_0x9930('0x30')][_0x9930('0x3b')]){_0x13d844[_0x9930('0x3c')]=_['merge'](_0x13d844[_0x9930('0x3c')],{'$or':_[_0x9930('0x2f')](_0x13d844[_0x9930('0x33')],function(_0x138f58){var _0x4c40da={};_0x4c40da[_0x138f58]={'$like':'%'+_0x675728[_0x9930('0x30')][_0x9930('0x3b')]+'%'};return _0x4c40da;})});}_0x13d844=_[_0x9930('0x3d')]({},_0x13d844,_0x675728[_0x9930('0x3f')]);return _0x2ad2b1['getSubjects'](_0x13d844);}})[_0x9930('0x26')](function(_0x2597d4){if(_0x2597d4){_0x1e5887=_0x2597d4[_0x9930('0x35')];if(!_0x675728[_0x9930('0x30')][_0x9930('0x36')]('nolimit')){_0x13d844[_0x9930('0x1f')]=qs[_0x9930('0x1f')](_0x675728[_0x9930('0x30')]['limit']);_0x13d844['offset']=qs[_0x9930('0x1e')](_0x675728[_0x9930('0x30')]['offset']);}return _0x2ad2b1[_0x9930('0x4e')](_0x13d844);}})[_0x9930('0x26')](function(_0x53cab5){if(_0x53cab5){return _0x53cab5?{'count':_0x1e5887,'rows':_0x53cab5}:null;}})[_0x9930('0x26')](respondWithResult(_0x5c308e,null))[_0x9930('0x49')](handleError(_0x5c308e,null));};exports['getDescriptions']=function(_0x56b5b3,_0x3e1b64,_0x20b0ac){var _0x203651={};var _0x2b21c9={};var _0x111a96;var _0x295027;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x56b5b3[_0x9930('0x48')]['id']}})[_0x9930('0x26')](handleEntityNotFound(_0x3e1b64,null))[_0x9930('0x26')](function(_0x5490a7){if(_0x5490a7){_0x111a96=_0x5490a7;_0x2b21c9[_0x9930('0x2e')]=_[_0x9930('0x31')](db[_0x9930('0x4c')][_0x9930('0x44')]);_0x2b21c9[_0x9930('0x30')]=_[_0x9930('0x31')](_0x56b5b3[_0x9930('0x30')]);_0x2b21c9[_0x9930('0x39')]=_[_0x9930('0x32')](_0x2b21c9[_0x9930('0x2e')],_0x2b21c9[_0x9930('0x30')]);_0x203651[_0x9930('0x33')]=_[_0x9930('0x32')](_0x2b21c9[_0x9930('0x2e')],qs[_0x9930('0x34')](_0x56b5b3[_0x9930('0x30')]['fields']));_0x203651['attributes']=_0x203651[_0x9930('0x33')][_0x9930('0x35')]?_0x203651['attributes']:_0x2b21c9[_0x9930('0x2e')];_0x203651[_0x9930('0x37')]=qs[_0x9930('0x38')](_0x56b5b3[_0x9930('0x30')]['sort']);_0x203651['where']=qs['filters'](_['pick'](_0x56b5b3[_0x9930('0x30')],_0x2b21c9[_0x9930('0x39')]));if(_0x56b5b3[_0x9930('0x30')][_0x9930('0x3b')]){_0x203651['where']=_[_0x9930('0x3d')](_0x203651['where'],{'$or':_[_0x9930('0x2f')](_0x203651[_0x9930('0x33')],function(_0x6089b5){var _0x490811={};_0x490811[_0x6089b5]={'$like':'%'+_0x56b5b3[_0x9930('0x30')][_0x9930('0x3b')]+'%'};return _0x490811;})});}_0x203651=_[_0x9930('0x3d')]({},_0x203651,_0x56b5b3[_0x9930('0x3f')]);return _0x111a96[_0x9930('0x4f')](_0x203651);}})['then'](function(_0x36d428){if(_0x36d428){_0x295027=_0x36d428[_0x9930('0x35')];if(!_0x56b5b3['query'][_0x9930('0x36')]('nolimit')){_0x203651[_0x9930('0x1f')]=qs[_0x9930('0x1f')](_0x56b5b3[_0x9930('0x30')][_0x9930('0x1f')]);_0x203651[_0x9930('0x1e')]=qs['offset'](_0x56b5b3[_0x9930('0x30')][_0x9930('0x1e')]);}return _0x111a96[_0x9930('0x4f')](_0x203651);}})['then'](function(_0x3938e0){if(_0x3938e0){return _0x3938e0?{'count':_0x295027,'rows':_0x3938e0}:null;}})['then'](respondWithResult(_0x3e1b64,null))[_0x9930('0x49')](handleError(_0x3e1b64,null));}; \ No newline at end of file +var _0x1d47=['offset','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','ZohoConfiguration','rawAttributes','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','filter','findAll','catch','params','keys','options','find','create','body','getFields','ZohoField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x5941f9,_0x1261f1){var _0xbdc9f9=function(_0xcc6abe){while(--_0xcc6abe){_0x5941f9['push'](_0x5941f9['shift']());}};_0xbdc9f9(++_0x1261f1);}(_0x1d47,0x7d));var _0x71d4=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x1d47[_0x243b2f];return _0xcb3c2d;};'use strict';var emlformat=require(_0x71d4('0x0'));var rimraf=require(_0x71d4('0x1'));var zipdir=require(_0x71d4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x71d4('0x3'));var moment=require(_0x71d4('0x4'));var BPromise=require(_0x71d4('0x5'));var Mustache=require('mustache');var util=require(_0x71d4('0x6'));var path=require(_0x71d4('0x7'));var sox=require(_0x71d4('0x8'));var csv=require(_0x71d4('0x9'));var ejs=require(_0x71d4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x71d4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x71d4('0xc'));var toCsv=require(_0x71d4('0x9'));var querystring=require('querystring');var Papa=require(_0x71d4('0xd'));var Redis=require(_0x71d4('0xe'));var authService=require(_0x71d4('0xf'));var qs=require(_0x71d4('0x10'));var as=require(_0x71d4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x71d4('0x12'));var utils=require('../../config/utils');var config=require(_0x71d4('0x13'));var licenseUtil=require(_0x71d4('0x14'));var db=require(_0x71d4('0x15'))['db'];function respondWithStatusCode(_0x4a9f11,_0x5adfcc){_0x5adfcc=_0x5adfcc||0xcc;return function(_0x57bca9){if(_0x57bca9){return _0x4a9f11[_0x71d4('0x16')](_0x5adfcc);}return _0x4a9f11['status'](_0x5adfcc)[_0x71d4('0x17')]();};}function respondWithResult(_0x48bf68,_0x52f5a8){_0x52f5a8=_0x52f5a8||0xc8;return function(_0x581edc){if(_0x581edc){return _0x48bf68[_0x71d4('0x18')](_0x52f5a8)['json'](_0x581edc);}};}function respondWithFilteredResult(_0x2ebc9b,_0x485eb0){return function(_0x5b77f8){if(_0x5b77f8){var _0x386908=typeof _0x485eb0[_0x71d4('0x19')]===_0x71d4('0x1a')&&typeof _0x485eb0['limit']===_0x71d4('0x1a');var _0x41cf58=_0x5b77f8[_0x71d4('0x1b')];var _0x16e74f=_0x386908?0x0:_0x485eb0[_0x71d4('0x19')];var _0x4a1a85=_0x386908?_0x5b77f8[_0x71d4('0x1b')]:_0x485eb0[_0x71d4('0x19')]+_0x485eb0['limit'];var _0x345414;if(_0x4a1a85>=_0x41cf58){_0x4a1a85=_0x41cf58;_0x345414=0xc8;}else{_0x345414=0xce;}_0x2ebc9b[_0x71d4('0x18')](_0x345414);return _0x2ebc9b[_0x71d4('0x1c')](_0x71d4('0x1d'),_0x16e74f+'-'+_0x4a1a85+'/'+_0x41cf58)[_0x71d4('0x1e')](_0x5b77f8);}return null;};}function patchUpdates(_0x165d42){return function(_0x10b0ba){try{jsonpatch[_0x71d4('0x1f')](_0x10b0ba,_0x165d42,!![]);}catch(_0x5c73ee){return BPromise[_0x71d4('0x20')](_0x5c73ee);}return _0x10b0ba['save']();};}function saveUpdates(_0x6cf67c,_0xfd4074){return function(_0x2eafb6){if(_0x2eafb6){return _0x2eafb6[_0x71d4('0x21')](_0x6cf67c)[_0x71d4('0x22')](function(_0x66d65d){return _0x66d65d;});}return null;};}function removeEntity(_0xf10f66,_0x356cf5){return function(_0x51c205){if(_0x51c205){return _0x51c205[_0x71d4('0x23')]()[_0x71d4('0x22')](function(){_0xf10f66[_0x71d4('0x18')](0xcc)[_0x71d4('0x17')]();});}};}function handleEntityNotFound(_0x30f656,_0x24c3ba){return function(_0x992dd6){if(!_0x992dd6){_0x30f656[_0x71d4('0x16')](0x194);}return _0x992dd6;};}function handleError(_0x38d5ab,_0xea08ba){_0xea08ba=_0xea08ba||0x1f4;return function(_0x34adce){logger[_0x71d4('0x24')](_0x34adce[_0x71d4('0x25')]);if(_0x34adce[_0x71d4('0x26')]){delete _0x34adce['name'];}_0x38d5ab[_0x71d4('0x18')](_0xea08ba)[_0x71d4('0x27')](_0x34adce);};}exports[_0x71d4('0x28')]=function(_0x247886,_0x15e2fb){var _0x52eb24={},_0x587483={},_0x39b0bc={'count':0x0,'rows':[]};var _0x2d4373=_['map'](db[_0x71d4('0x29')][_0x71d4('0x2a')],function(_0x108303){return{'name':_0x108303['fieldName'],'type':_0x108303[_0x71d4('0x2b')][_0x71d4('0x2c')]};});_0x587483[_0x71d4('0x2d')]=_[_0x71d4('0x2e')](_0x2d4373,_0x71d4('0x26'));_0x587483[_0x71d4('0x2f')]=_['keys'](_0x247886['query']);_0x587483[_0x71d4('0x30')]=_['intersection'](_0x587483[_0x71d4('0x2d')],_0x587483[_0x71d4('0x2f')]);_0x52eb24['attributes']=_[_0x71d4('0x31')](_0x587483['model'],qs[_0x71d4('0x32')](_0x247886[_0x71d4('0x2f')]['fields']));_0x52eb24[_0x71d4('0x33')]=_0x52eb24['attributes'][_0x71d4('0x34')]?_0x52eb24[_0x71d4('0x33')]:_0x587483[_0x71d4('0x2d')];if(!_0x247886[_0x71d4('0x2f')][_0x71d4('0x35')](_0x71d4('0x36'))){_0x52eb24[_0x71d4('0x37')]=qs['limit'](_0x247886[_0x71d4('0x2f')]['limit']);_0x52eb24[_0x71d4('0x19')]=qs[_0x71d4('0x19')](_0x247886[_0x71d4('0x2f')][_0x71d4('0x19')]);}_0x52eb24[_0x71d4('0x38')]=qs[_0x71d4('0x39')](_0x247886[_0x71d4('0x2f')][_0x71d4('0x39')]);_0x52eb24[_0x71d4('0x3a')]=qs['filters'](_[_0x71d4('0x3b')](_0x247886[_0x71d4('0x2f')],_0x587483[_0x71d4('0x30')]),_0x2d4373);if(_0x247886[_0x71d4('0x2f')]['filter']){_0x52eb24[_0x71d4('0x3a')]=_[_0x71d4('0x3c')](_0x52eb24[_0x71d4('0x3a')],{'$or':_[_0x71d4('0x2e')](_0x2d4373,function(_0x5f688c){if(_0x5f688c[_0x71d4('0x2b')]!=='VIRTUAL'){var _0x429260={};_0x429260[_0x5f688c[_0x71d4('0x26')]]={'$like':'%'+_0x247886['query'][_0x71d4('0x3d')]+'%'};return _0x429260;}})});}_0x52eb24=_[_0x71d4('0x3c')]({},_0x52eb24,_0x247886['options']);var _0x21d633={'where':_0x52eb24[_0x71d4('0x3a')]};return db[_0x71d4('0x29')][_0x71d4('0x1b')](_0x21d633)[_0x71d4('0x22')](function(_0x12b699){_0x39b0bc[_0x71d4('0x1b')]=_0x12b699;if(_0x247886[_0x71d4('0x2f')]['includeAll']){_0x52eb24['include']=[{'all':!![]}];}return db[_0x71d4('0x29')][_0x71d4('0x3e')](_0x52eb24);})[_0x71d4('0x22')](function(_0x1c2c34){_0x39b0bc['rows']=_0x1c2c34;return _0x39b0bc;})[_0x71d4('0x22')](respondWithFilteredResult(_0x15e2fb,_0x52eb24))[_0x71d4('0x3f')](handleError(_0x15e2fb,null));};exports['show']=function(_0x5290d0,_0x41ef5c){var _0x39d578={'raw':![],'where':{'id':_0x5290d0[_0x71d4('0x40')]['id']}},_0x43dc50={};_0x43dc50[_0x71d4('0x2d')]=_[_0x71d4('0x41')](db[_0x71d4('0x29')][_0x71d4('0x2a')]);_0x43dc50[_0x71d4('0x2f')]=_[_0x71d4('0x41')](_0x5290d0[_0x71d4('0x2f')]);_0x43dc50[_0x71d4('0x30')]=_[_0x71d4('0x31')](_0x43dc50['model'],_0x43dc50['query']);_0x39d578['attributes']=_[_0x71d4('0x31')](_0x43dc50[_0x71d4('0x2d')],qs['fields'](_0x5290d0[_0x71d4('0x2f')][_0x71d4('0x32')]));_0x39d578[_0x71d4('0x33')]=_0x39d578[_0x71d4('0x33')][_0x71d4('0x34')]?_0x39d578[_0x71d4('0x33')]:_0x43dc50[_0x71d4('0x2d')];if(_0x5290d0['query']['includeAll']){_0x39d578['include']=[{'all':!![]}];}_0x39d578=_[_0x71d4('0x3c')]({},_0x39d578,_0x5290d0[_0x71d4('0x42')]);return db[_0x71d4('0x29')][_0x71d4('0x43')](_0x39d578)[_0x71d4('0x22')](handleEntityNotFound(_0x41ef5c,null))[_0x71d4('0x22')](respondWithResult(_0x41ef5c,null))[_0x71d4('0x3f')](handleError(_0x41ef5c,null));};exports['create']=function(_0x5f192d,_0x221cf5){return db[_0x71d4('0x29')][_0x71d4('0x44')](_0x5f192d['body'],{})[_0x71d4('0x22')](respondWithResult(_0x221cf5,0xc9))[_0x71d4('0x3f')](handleError(_0x221cf5,null));};exports[_0x71d4('0x21')]=function(_0x4e178a,_0x384450){if(_0x4e178a[_0x71d4('0x45')]['id']){delete _0x4e178a[_0x71d4('0x45')]['id'];}return db[_0x71d4('0x29')][_0x71d4('0x43')]({'where':{'id':_0x4e178a[_0x71d4('0x40')]['id']}})[_0x71d4('0x22')](handleEntityNotFound(_0x384450,null))[_0x71d4('0x22')](saveUpdates(_0x4e178a['body'],null))[_0x71d4('0x22')](respondWithResult(_0x384450,null))[_0x71d4('0x3f')](handleError(_0x384450,null));};exports[_0x71d4('0x23')]=function(_0x2a233c,_0x29ae1a){return db[_0x71d4('0x29')][_0x71d4('0x43')]({'where':{'id':_0x2a233c['params']['id']}})['then'](handleEntityNotFound(_0x29ae1a,null))[_0x71d4('0x22')](removeEntity(_0x29ae1a,null))[_0x71d4('0x3f')](handleError(_0x29ae1a,null));};exports[_0x71d4('0x46')]=function(_0x28fe3d,_0x14371b,_0x5f0103){var _0xb5d9df={};var _0x187746={};var _0x107946;var _0x2cbc87;return db[_0x71d4('0x29')]['findOne']({'where':{'id':_0x28fe3d['params']['id']}})[_0x71d4('0x22')](handleEntityNotFound(_0x14371b,null))[_0x71d4('0x22')](function(_0xf92e97){if(_0xf92e97){_0x107946=_0xf92e97;_0x187746[_0x71d4('0x2d')]=_[_0x71d4('0x41')](db[_0x71d4('0x47')]['rawAttributes']);_0x187746[_0x71d4('0x2f')]=_['keys'](_0x28fe3d[_0x71d4('0x2f')]);_0x187746['filters']=_['intersection'](_0x187746[_0x71d4('0x2d')],_0x187746['query']);_0xb5d9df['attributes']=_[_0x71d4('0x31')](_0x187746[_0x71d4('0x2d')],qs[_0x71d4('0x32')](_0x28fe3d[_0x71d4('0x2f')][_0x71d4('0x32')]));_0xb5d9df[_0x71d4('0x33')]=_0xb5d9df[_0x71d4('0x33')][_0x71d4('0x34')]?_0xb5d9df[_0x71d4('0x33')]:_0x187746[_0x71d4('0x2d')];_0xb5d9df[_0x71d4('0x38')]=qs[_0x71d4('0x39')](_0x28fe3d[_0x71d4('0x2f')][_0x71d4('0x39')]);_0xb5d9df[_0x71d4('0x3a')]=qs['filters'](_[_0x71d4('0x3b')](_0x28fe3d[_0x71d4('0x2f')],_0x187746['filters']));if(_0x28fe3d[_0x71d4('0x2f')][_0x71d4('0x3d')]){_0xb5d9df['where']=_['merge'](_0xb5d9df[_0x71d4('0x3a')],{'$or':_[_0x71d4('0x2e')](_0xb5d9df[_0x71d4('0x33')],function(_0xa12bdf){var _0x33da6d={};_0x33da6d[_0xa12bdf]={'$like':'%'+_0x28fe3d[_0x71d4('0x2f')][_0x71d4('0x3d')]+'%'};return _0x33da6d;})});}_0xb5d9df=_[_0x71d4('0x3c')]({},_0xb5d9df,_0x28fe3d['options']);return _0x107946[_0x71d4('0x46')](_0xb5d9df);}})[_0x71d4('0x22')](function(_0x2ba5ad){if(_0x2ba5ad){_0x2cbc87=_0x2ba5ad['length'];if(!_0x28fe3d[_0x71d4('0x2f')][_0x71d4('0x35')](_0x71d4('0x36'))){_0xb5d9df[_0x71d4('0x37')]=qs[_0x71d4('0x37')](_0x28fe3d['query'][_0x71d4('0x37')]);_0xb5d9df[_0x71d4('0x19')]=qs['offset'](_0x28fe3d[_0x71d4('0x2f')][_0x71d4('0x19')]);}return _0x107946[_0x71d4('0x46')](_0xb5d9df);}})[_0x71d4('0x22')](function(_0x527be4){if(_0x527be4){return _0x527be4?{'count':_0x2cbc87,'rows':_0x527be4}:null;}})['then'](respondWithResult(_0x14371b,null))[_0x71d4('0x3f')](handleError(_0x14371b,null));};exports[_0x71d4('0x48')]=function(_0x1e6e9c,_0x558d30,_0x554248){var _0x52035f={};var _0x4949ae={};var _0x2674f2;var _0x5c6f60;return db[_0x71d4('0x29')]['findOne']({'where':{'id':_0x1e6e9c['params']['id']}})['then'](handleEntityNotFound(_0x558d30,null))[_0x71d4('0x22')](function(_0x203bbf){if(_0x203bbf){_0x2674f2=_0x203bbf;_0x4949ae['model']=_[_0x71d4('0x41')](db['ZohoField']['rawAttributes']);_0x4949ae['query']=_['keys'](_0x1e6e9c[_0x71d4('0x2f')]);_0x4949ae[_0x71d4('0x30')]=_[_0x71d4('0x31')](_0x4949ae[_0x71d4('0x2d')],_0x4949ae[_0x71d4('0x2f')]);_0x52035f[_0x71d4('0x33')]=_[_0x71d4('0x31')](_0x4949ae[_0x71d4('0x2d')],qs[_0x71d4('0x32')](_0x1e6e9c[_0x71d4('0x2f')][_0x71d4('0x32')]));_0x52035f['attributes']=_0x52035f[_0x71d4('0x33')][_0x71d4('0x34')]?_0x52035f[_0x71d4('0x33')]:_0x4949ae[_0x71d4('0x2d')];_0x52035f[_0x71d4('0x38')]=qs['sort'](_0x1e6e9c[_0x71d4('0x2f')][_0x71d4('0x39')]);_0x52035f[_0x71d4('0x3a')]=qs['filters'](_[_0x71d4('0x3b')](_0x1e6e9c[_0x71d4('0x2f')],_0x4949ae[_0x71d4('0x30')]));if(_0x1e6e9c[_0x71d4('0x2f')][_0x71d4('0x3d')]){_0x52035f[_0x71d4('0x3a')]=_[_0x71d4('0x3c')](_0x52035f[_0x71d4('0x3a')],{'$or':_[_0x71d4('0x2e')](_0x52035f['attributes'],function(_0x13cba7){var _0xf650b8={};_0xf650b8[_0x13cba7]={'$like':'%'+_0x1e6e9c[_0x71d4('0x2f')][_0x71d4('0x3d')]+'%'};return _0xf650b8;})});}_0x52035f=_['merge']({},_0x52035f,_0x1e6e9c[_0x71d4('0x42')]);return _0x2674f2[_0x71d4('0x48')](_0x52035f);}})['then'](function(_0x46b700){if(_0x46b700){_0x5c6f60=_0x46b700[_0x71d4('0x34')];if(!_0x1e6e9c[_0x71d4('0x2f')]['hasOwnProperty']('nolimit')){_0x52035f[_0x71d4('0x37')]=qs[_0x71d4('0x37')](_0x1e6e9c['query'][_0x71d4('0x37')]);_0x52035f[_0x71d4('0x19')]=qs[_0x71d4('0x19')](_0x1e6e9c[_0x71d4('0x2f')][_0x71d4('0x19')]);}return _0x2674f2[_0x71d4('0x48')](_0x52035f);}})[_0x71d4('0x22')](function(_0x266512){if(_0x266512){return _0x266512?{'count':_0x5c6f60,'rows':_0x266512}:null;}})[_0x71d4('0x22')](respondWithResult(_0x558d30,null))[_0x71d4('0x3f')](handleError(_0x558d30,null));};exports['getDescriptions']=function(_0x3a2424,_0x194f75,_0x246bd7){var _0x373457={};var _0x5e9b1b={};var _0x2f0fd2;var _0x226b9a;return db[_0x71d4('0x29')][_0x71d4('0x49')]({'where':{'id':_0x3a2424[_0x71d4('0x40')]['id']}})[_0x71d4('0x22')](handleEntityNotFound(_0x194f75,null))[_0x71d4('0x22')](function(_0x16c7ba){if(_0x16c7ba){_0x2f0fd2=_0x16c7ba;_0x5e9b1b[_0x71d4('0x2d')]=_['keys'](db[_0x71d4('0x47')]['rawAttributes']);_0x5e9b1b[_0x71d4('0x2f')]=_[_0x71d4('0x41')](_0x3a2424['query']);_0x5e9b1b['filters']=_[_0x71d4('0x31')](_0x5e9b1b['model'],_0x5e9b1b[_0x71d4('0x2f')]);_0x373457[_0x71d4('0x33')]=_[_0x71d4('0x31')](_0x5e9b1b[_0x71d4('0x2d')],qs[_0x71d4('0x32')](_0x3a2424[_0x71d4('0x2f')][_0x71d4('0x32')]));_0x373457['attributes']=_0x373457['attributes'][_0x71d4('0x34')]?_0x373457[_0x71d4('0x33')]:_0x5e9b1b['model'];_0x373457['order']=qs['sort'](_0x3a2424[_0x71d4('0x2f')]['sort']);_0x373457[_0x71d4('0x3a')]=qs['filters'](_[_0x71d4('0x3b')](_0x3a2424['query'],_0x5e9b1b[_0x71d4('0x30')]));if(_0x3a2424[_0x71d4('0x2f')]['filter']){_0x373457[_0x71d4('0x3a')]=_[_0x71d4('0x3c')](_0x373457[_0x71d4('0x3a')],{'$or':_[_0x71d4('0x2e')](_0x373457[_0x71d4('0x33')],function(_0x12528b){var _0x3d9fd2={};_0x3d9fd2[_0x12528b]={'$like':'%'+_0x3a2424[_0x71d4('0x2f')]['filter']+'%'};return _0x3d9fd2;})});}_0x373457=_[_0x71d4('0x3c')]({},_0x373457,_0x3a2424[_0x71d4('0x42')]);return _0x2f0fd2[_0x71d4('0x4a')](_0x373457);}})[_0x71d4('0x22')](function(_0x45df1e){if(_0x45df1e){_0x226b9a=_0x45df1e['length'];if(!_0x3a2424['query'][_0x71d4('0x35')](_0x71d4('0x36'))){_0x373457[_0x71d4('0x37')]=qs[_0x71d4('0x37')](_0x3a2424[_0x71d4('0x2f')][_0x71d4('0x37')]);_0x373457[_0x71d4('0x19')]=qs[_0x71d4('0x19')](_0x3a2424['query'][_0x71d4('0x19')]);}return _0x2f0fd2['getDescriptions'](_0x373457);}})[_0x71d4('0x22')](function(_0x1e96a1){if(_0x1e96a1){return _0x1e96a1?{'count':_0x226b9a,'rows':_0x1e96a1}:null;}})[_0x71d4('0x22')](respondWithResult(_0x194f75,null))[_0x71d4('0x3f')](handleError(_0x194f75,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 7001152..4f70e06 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 _0x1428=['../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x41ef97,_0x966dab){var _0x54354c=function(_0x10045d){while(--_0x10045d){_0x41ef97['push'](_0x41ef97['shift']());}};_0x54354c(++_0x966dab);}(_0x1428,0xf0));var _0x8142=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x1428[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x8142('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8142('0x1'));var moment=require(_0x8142('0x2'));var BPromise=require(_0x8142('0x3'));var rp=require(_0x8142('0x4'));var fs=require('fs');var path=require(_0x8142('0x5'));var rimraf=require(_0x8142('0x6'));var config=require(_0x8142('0x7'));var attributes=require(_0x8142('0x8'));module[_0x8142('0x9')]=function(_0x167197,_0x503ab8){return _0x167197[_0x8142('0xa')](_0x8142('0xb'),attributes,{'tableName':_0x8142('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d2b=['path','rimraf','../../config/environment','exports','define','ZohoConfiguration','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x4af864,_0x1be11e){var _0x4a4d41=function(_0x594b98){while(--_0x594b98){_0x4af864['push'](_0x4af864['shift']());}};_0x4a4d41(++_0x1be11e);}(_0x1d2b,0x95));var _0xb1d2=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x1d2b[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xb1d2('0x0'));var util=require(_0xb1d2('0x1'));var logger=require(_0xb1d2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb1d2('0x3'));var rp=require(_0xb1d2('0x4'));var fs=require('fs');var path=require(_0xb1d2('0x5'));var rimraf=require(_0xb1d2('0x6'));var config=require(_0xb1d2('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0xb1d2('0x8')]=function(_0xd357d2,_0x11ef8f){return _0xd357d2[_0xb1d2('0x9')](_0xb1d2('0xa'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 11d6281..b93a6a4 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 _0x8b15=['request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x358897,_0x3a16a9){var _0x19671c=function(_0x54798a){while(--_0x54798a){_0x358897['push'](_0x358897['shift']());}};_0x19671c(++_0x3a16a9);}(_0x8b15,0x9d));var _0x58b1=function(_0x407974,_0x231a83){_0x407974=_0x407974-0x0;var _0x3f28bb=_0x8b15[_0x407974];return _0x3f28bb;};'use strict';var _=require(_0x58b1('0x0'));var util=require(_0x58b1('0x1'));var moment=require(_0x58b1('0x2'));var BPromise=require(_0x58b1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x58b1('0x4'));var db=require(_0x58b1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x58b1('0x6'))(_0x58b1('0x7'));var config=require(_0x58b1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x58b1('0x9')][_0x58b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x502ad0,_0x492af1,_0x1fceeb){return new BPromise(function(_0x405ccd,_0x3f8c93){return client[_0x58b1('0xb')](_0x502ad0,_0x1fceeb)[_0x58b1('0xc')](function(_0x1091fa){logger[_0x58b1('0xd')](_0x58b1('0xe'),_0x492af1,_0x58b1('0xf'));logger[_0x58b1('0x10')](_0x58b1('0x11'),_0x492af1,_0x58b1('0xf'),JSON[_0x58b1('0x12')](_0x1091fa));if(_0x1091fa[_0x58b1('0x13')]){if(_0x1091fa[_0x58b1('0x13')][_0x58b1('0x14')]===0x1f4){logger['error'](_0x58b1('0xe'),_0x492af1,_0x1091fa['error'][_0x58b1('0x15')]);return _0x3f8c93(_0x1091fa[_0x58b1('0x13')][_0x58b1('0x15')]);}logger['error'](_0x58b1('0xe'),_0x492af1,_0x1091fa['error'][_0x58b1('0x15')]);return _0x405ccd(_0x1091fa[_0x58b1('0x13')][_0x58b1('0x15')]);}else{logger['info'](_0x58b1('0xe'),_0x492af1,_0x58b1('0xf'));_0x405ccd(_0x1091fa[_0x58b1('0x16')][_0x58b1('0x15')]);}})[_0x58b1('0x17')](function(_0x193878){logger[_0x58b1('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x492af1,_0x193878);_0x3f8c93(_0x193878);});});} \ No newline at end of file +var _0x8256=['ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info'];(function(_0x264f38,_0x4cdcbf){var _0x337c1c=function(_0xd5073f){while(--_0xd5073f){_0x264f38['push'](_0x264f38['shift']());}};_0x337c1c(++_0x4cdcbf);}(_0x8256,0x1a8));var _0x6825=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8256[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x6825('0x0'));var moment=require(_0x6825('0x1'));var BPromise=require(_0x6825('0x2'));var rs=require(_0x6825('0x3'));var fs=require('fs');var Redis=require(_0x6825('0x4'));var db=require(_0x6825('0x5'))['db'];var utils=require(_0x6825('0x6'));var logger=require(_0x6825('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6825('0x8'));var client=jayson[_0x6825('0x9')][_0x6825('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a630a,_0x122ec9,_0x148cab){return new BPromise(function(_0x11c6d3,_0x33b208){return client['request'](_0x4a630a,_0x148cab)[_0x6825('0xb')](function(_0xf59581){logger[_0x6825('0xc')](_0x6825('0xd'),_0x122ec9,_0x6825('0xe'));logger[_0x6825('0xf')](_0x6825('0x10'),_0x122ec9,'request\x20sent',JSON[_0x6825('0x11')](_0xf59581));if(_0xf59581[_0x6825('0x12')]){if(_0xf59581['error'][_0x6825('0x13')]===0x1f4){logger[_0x6825('0x12')](_0x6825('0xd'),_0x122ec9,_0xf59581[_0x6825('0x12')]['message']);return _0x33b208(_0xf59581[_0x6825('0x12')][_0x6825('0x14')]);}logger[_0x6825('0x12')](_0x6825('0xd'),_0x122ec9,_0xf59581[_0x6825('0x12')][_0x6825('0x14')]);return _0x11c6d3(_0xf59581[_0x6825('0x12')]['message']);}else{logger[_0x6825('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x122ec9,_0x6825('0xe'));_0x11c6d3(_0xf59581[_0x6825('0x15')][_0x6825('0x14')]);}})[_0x6825('0x16')](function(_0x35f4ac){logger[_0x6825('0x12')](_0x6825('0xd'),_0x122ec9,_0x35f4ac);_0x33b208(_0x35f4ac);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 44a62f0..5ae3d2d 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 _0x8028=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','path'];(function(_0x28481b,_0x3bb08d){var _0x40d6de=function(_0x438c4f){while(--_0x438c4f){_0x28481b['push'](_0x28481b['shift']());}};_0x40d6de(++_0x3bb08d);}(_0x8028,0x18d));var _0x8802=function(_0x1c9f21,_0x2ac127){_0x1c9f21=_0x1c9f21-0x0;var _0x802fc0=_0x8028[_0x1c9f21];return _0x802fc0;};'use strict';var multer=require(_0x8802('0x0'));var util=require(_0x8802('0x1'));var path=require(_0x8802('0x2'));var timeout=require(_0x8802('0x3'));var express=require(_0x8802('0x4'));var router=express['Router']();var fs_extra=require(_0x8802('0x5'));var auth=require(_0x8802('0x6'));var interaction=require(_0x8802('0x7'));var config=require(_0x8802('0x8'));var controller=require(_0x8802('0x9'));router[_0x8802('0xa')]('/',auth[_0x8802('0xb')](),controller[_0x8802('0xc')]);router[_0x8802('0xa')](_0x8802('0xd'),auth[_0x8802('0xb')](),controller['show']);router[_0x8802('0xe')]('/',auth[_0x8802('0xb')](),controller[_0x8802('0xf')]);router[_0x8802('0x10')](_0x8802('0xd'),auth[_0x8802('0xb')](),controller[_0x8802('0x11')]);router[_0x8802('0x12')](_0x8802('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x8802('0x13')]=router; \ No newline at end of file +var _0x3ce9=['Router','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','isAuthenticated','index','get','show','post','create','put','/:id','delete','exports','multer','path','connect-timeout','express'];(function(_0x404450,_0x3de029){var _0x35309a=function(_0x380ee4){while(--_0x380ee4){_0x404450['push'](_0x404450['shift']());}};_0x35309a(++_0x3de029);}(_0x3ce9,0xf8));var _0x93ce=function(_0xfffa3c,_0x421a7f){_0xfffa3c=_0xfffa3c-0x0;var _0x332ce4=_0x3ce9[_0xfffa3c];return _0x332ce4;};'use strict';var multer=require(_0x93ce('0x0'));var util=require('util');var path=require(_0x93ce('0x1'));var timeout=require(_0x93ce('0x2'));var express=require(_0x93ce('0x3'));var router=express[_0x93ce('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x93ce('0x5'));var interaction=require(_0x93ce('0x6'));var config=require('../../config/environment');var controller=require(_0x93ce('0x7'));router['get']('/',auth[_0x93ce('0x8')](),controller[_0x93ce('0x9')]);router[_0x93ce('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x93ce('0xb')]);router[_0x93ce('0xc')]('/',auth[_0x93ce('0x8')](),controller[_0x93ce('0xd')]);router[_0x93ce('0xe')](_0x93ce('0xf'),auth[_0x93ce('0x8')](),controller['update']);router[_0x93ce('0x10')](_0x93ce('0xf'),auth[_0x93ce('0x8')](),controller['destroy']);module[_0x93ce('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 3a3e9dc..7a9cc90 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 _0x428e=['keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x17e2cd,_0x24b953){var _0x5f15b9=function(_0x3351b3){while(--_0x3351b3){_0x17e2cd['push'](_0x17e2cd['shift']());}};_0x5f15b9(++_0x24b953);}(_0x428e,0x13b));var _0xe428=function(_0x2a6754,_0x277259){_0x2a6754=_0x2a6754-0x0;var _0x17feda=_0x428e[_0x2a6754];return _0x17feda;};'use strict';var Sequelize=require(_0xe428('0x0'));module[_0xe428('0x1')]={'type':{'type':Sequelize[_0xe428('0x2')]('string',_0xe428('0x3'),_0xe428('0x4'),_0xe428('0x5'),_0xe428('0x6')),'defaultValue':_0xe428('0x7')},'content':{'type':Sequelize[_0xe428('0x8')]},'key':{'type':Sequelize[_0xe428('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xe428('0x7'),_0xe428('0x3'),_0xe428('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe428('0x8')]},'nameField':{'type':Sequelize[_0xe428('0x8')]},'customField':{'type':Sequelize[_0xe428('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe428('0x8')]}}; \ No newline at end of file +var _0x1f47=['STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','picklist'];(function(_0x5a7b01,_0x552690){var _0x374453=function(_0x2ad3d0){while(--_0x2ad3d0){_0x5a7b01['push'](_0x5a7b01['shift']());}};_0x374453(++_0x552690);}(_0x1f47,0x1e3));var _0x71f4=function(_0x252592,_0x1afe19){_0x252592=_0x252592-0x0;var _0x490c10=_0x1f47[_0x252592];return _0x490c10;};'use strict';var Sequelize=require(_0x71f4('0x0'));module[_0x71f4('0x1')]={'type':{'type':Sequelize['ENUM'](_0x71f4('0x2'),_0x71f4('0x3'),_0x71f4('0x4'),_0x71f4('0x5'),_0x71f4('0x6')),'defaultValue':_0x71f4('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x71f4('0x7')]},'keyType':{'type':Sequelize[_0x71f4('0x8')](_0x71f4('0x2'),_0x71f4('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x71f4('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x71f4('0x7')]},'customField':{'type':Sequelize[_0x71f4('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x71f4('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 16ee3f8..7d609b5 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 _0x9092=['VIRTUAL','options','include','findAll','length','catch','create','body','update','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','sendStatus','stack','name','map','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge'];(function(_0x3ac141,_0x3a15af){var _0x296bba=function(_0x5afa53){while(--_0x5afa53){_0x3ac141['push'](_0x3ac141['shift']());}};_0x296bba(++_0x3a15af);}(_0x9092,0x95));var _0x2909=function(_0x1e27f6,_0x2d44cb){_0x1e27f6=_0x1e27f6-0x0;var _0x157f77=_0x9092[_0x1e27f6];return _0x157f77;};'use strict';var emlformat=require(_0x2909('0x0'));var rimraf=require(_0x2909('0x1'));var zipdir=require(_0x2909('0x2'));var jsonpatch=require(_0x2909('0x3'));var rp=require(_0x2909('0x4'));var moment=require('moment');var BPromise=require(_0x2909('0x5'));var Mustache=require(_0x2909('0x6'));var util=require(_0x2909('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2909('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2909('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2909('0xa'));var jsforce=require(_0x2909('0xb'));var deskjs=require(_0x2909('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2909('0xd'));var Papa=require(_0x2909('0xe'));var Redis=require('ioredis');var authService=require(_0x2909('0xf'));var qs=require(_0x2909('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2909('0x11'));var logger=require('../../config/logger')(_0x2909('0x12'));var utils=require(_0x2909('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2909('0x14'));var db=require(_0x2909('0x15'))['db'];function respondWithStatusCode(_0x21354d,_0x3b9a22){_0x3b9a22=_0x3b9a22||0xcc;return function(_0x5e03f3){if(_0x5e03f3){return _0x21354d['sendStatus'](_0x3b9a22);}return _0x21354d['status'](_0x3b9a22)['end']();};}function respondWithResult(_0x274bd7,_0x324a0f){_0x324a0f=_0x324a0f||0xc8;return function(_0x50e5c0){if(_0x50e5c0){return _0x274bd7[_0x2909('0x16')](_0x324a0f)[_0x2909('0x17')](_0x50e5c0);}};}function respondWithFilteredResult(_0x520d98,_0x5cc8c5){return function(_0xc8c2ee){if(_0xc8c2ee){var _0x38b447=typeof _0x5cc8c5[_0x2909('0x18')]==='undefined'&&typeof _0x5cc8c5[_0x2909('0x19')]===_0x2909('0x1a');var _0x5e84cd=_0xc8c2ee[_0x2909('0x1b')];var _0x27dba6=_0x38b447?0x0:_0x5cc8c5['offset'];var _0xe9b9ec=_0x38b447?_0xc8c2ee[_0x2909('0x1b')]:_0x5cc8c5[_0x2909('0x18')]+_0x5cc8c5['limit'];var _0xd09e6d;if(_0xe9b9ec>=_0x5e84cd){_0xe9b9ec=_0x5e84cd;_0xd09e6d=0xc8;}else{_0xd09e6d=0xce;}_0x520d98[_0x2909('0x16')](_0xd09e6d);return _0x520d98[_0x2909('0x1c')](_0x2909('0x1d'),_0x27dba6+'-'+_0xe9b9ec+'/'+_0x5e84cd)[_0x2909('0x17')](_0xc8c2ee);}return null;};}function patchUpdates(_0x4f1c86){return function(_0x5daa15){try{jsonpatch[_0x2909('0x1e')](_0x5daa15,_0x4f1c86,!![]);}catch(_0x565446){return BPromise[_0x2909('0x1f')](_0x565446);}return _0x5daa15[_0x2909('0x20')]();};}function saveUpdates(_0x9f2c44,_0x43cc20){return function(_0x53ac5e){if(_0x53ac5e){return _0x53ac5e['update'](_0x9f2c44)['then'](function(_0x44b62f){return _0x44b62f;});}return null;};}function removeEntity(_0x58b5b8,_0x282190){return function(_0x29c1ea){if(_0x29c1ea){return _0x29c1ea[_0x2909('0x21')]()[_0x2909('0x22')](function(){_0x58b5b8[_0x2909('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x634877,_0x15de97){return function(_0x58795b){if(!_0x58795b){_0x634877[_0x2909('0x23')](0x194);}return _0x58795b;};}function handleError(_0x36c748,_0xd40eec){_0xd40eec=_0xd40eec||0x1f4;return function(_0x3c9284){logger['error'](_0x3c9284[_0x2909('0x24')]);if(_0x3c9284[_0x2909('0x25')]){delete _0x3c9284['name'];}_0x36c748[_0x2909('0x16')](_0xd40eec)['send'](_0x3c9284);};}exports['index']=function(_0x267e8b,_0xb11203){var _0x1279fd={},_0x4f2b1c={},_0x3866d5={'count':0x0,'rows':[]};var _0x1d632a=_[_0x2909('0x26')](db[_0x2909('0x27')][_0x2909('0x28')],function(_0xe78736){return{'name':_0xe78736[_0x2909('0x29')],'type':_0xe78736[_0x2909('0x2a')][_0x2909('0x2b')]};});_0x4f2b1c[_0x2909('0x2c')]=_['map'](_0x1d632a,_0x2909('0x25'));_0x4f2b1c[_0x2909('0x2d')]=_[_0x2909('0x2e')](_0x267e8b[_0x2909('0x2d')]);_0x4f2b1c['filters']=_[_0x2909('0x2f')](_0x4f2b1c[_0x2909('0x2c')],_0x4f2b1c[_0x2909('0x2d')]);_0x1279fd[_0x2909('0x30')]=_['intersection'](_0x4f2b1c[_0x2909('0x2c')],qs[_0x2909('0x31')](_0x267e8b[_0x2909('0x2d')]['fields']));_0x1279fd['attributes']=_0x1279fd[_0x2909('0x30')]['length']?_0x1279fd['attributes']:_0x4f2b1c[_0x2909('0x2c')];if(!_0x267e8b[_0x2909('0x2d')][_0x2909('0x32')](_0x2909('0x33'))){_0x1279fd[_0x2909('0x19')]=qs[_0x2909('0x19')](_0x267e8b['query'][_0x2909('0x19')]);_0x1279fd[_0x2909('0x18')]=qs['offset'](_0x267e8b[_0x2909('0x2d')][_0x2909('0x18')]);}_0x1279fd['order']=qs[_0x2909('0x34')](_0x267e8b['query'][_0x2909('0x34')]);_0x1279fd[_0x2909('0x35')]=qs[_0x2909('0x36')](_[_0x2909('0x37')](_0x267e8b[_0x2909('0x2d')],_0x4f2b1c[_0x2909('0x36')]),_0x1d632a);if(_0x267e8b[_0x2909('0x2d')][_0x2909('0x38')]){_0x1279fd[_0x2909('0x35')]=_[_0x2909('0x39')](_0x1279fd[_0x2909('0x35')],{'$or':_['map'](_0x1d632a,function(_0x4a3a8a){if(_0x4a3a8a['type']!==_0x2909('0x3a')){var _0x53fe6f={};_0x53fe6f[_0x4a3a8a[_0x2909('0x25')]]={'$like':'%'+_0x267e8b[_0x2909('0x2d')][_0x2909('0x38')]+'%'};return _0x53fe6f;}})});}_0x1279fd=_[_0x2909('0x39')]({},_0x1279fd,_0x267e8b[_0x2909('0x3b')]);var _0x344770={'where':_0x1279fd[_0x2909('0x35')]};return db[_0x2909('0x27')]['count'](_0x344770)[_0x2909('0x22')](function(_0x14b019){_0x3866d5['count']=_0x14b019;if(_0x267e8b['query']['includeAll']){_0x1279fd[_0x2909('0x3c')]=[{'all':!![]}];}return db['ZohoField'][_0x2909('0x3d')](_0x1279fd);})[_0x2909('0x22')](function(_0x3055d3){_0x3866d5['rows']=_0x3055d3;return _0x3866d5;})[_0x2909('0x22')](respondWithFilteredResult(_0xb11203,_0x1279fd))['catch'](handleError(_0xb11203,null));};exports['show']=function(_0x500bca,_0x5568ff){var _0x304cee={'raw':!![],'where':{'id':_0x500bca['params']['id']}},_0x460f7d={};_0x460f7d[_0x2909('0x2c')]=_[_0x2909('0x2e')](db[_0x2909('0x27')][_0x2909('0x28')]);_0x460f7d[_0x2909('0x2d')]=_[_0x2909('0x2e')](_0x500bca[_0x2909('0x2d')]);_0x460f7d[_0x2909('0x36')]=_[_0x2909('0x2f')](_0x460f7d[_0x2909('0x2c')],_0x460f7d[_0x2909('0x2d')]);_0x304cee['attributes']=_[_0x2909('0x2f')](_0x460f7d[_0x2909('0x2c')],qs[_0x2909('0x31')](_0x500bca['query'][_0x2909('0x31')]));_0x304cee['attributes']=_0x304cee[_0x2909('0x30')][_0x2909('0x3e')]?_0x304cee[_0x2909('0x30')]:_0x460f7d['model'];if(_0x500bca[_0x2909('0x2d')]['includeAll']){_0x304cee[_0x2909('0x3c')]=[{'all':!![]}];}_0x304cee=_['merge']({},_0x304cee,_0x500bca[_0x2909('0x3b')]);return db[_0x2909('0x27')]['find'](_0x304cee)[_0x2909('0x22')](handleEntityNotFound(_0x5568ff,null))[_0x2909('0x22')](respondWithResult(_0x5568ff,null))[_0x2909('0x3f')](handleError(_0x5568ff,null));};exports[_0x2909('0x40')]=function(_0x5aa260,_0x1d053b){return db['ZohoField']['create'](_0x5aa260[_0x2909('0x41')],{})['then'](respondWithResult(_0x1d053b,0xc9))[_0x2909('0x3f')](handleError(_0x1d053b,null));};exports[_0x2909('0x42')]=function(_0x5d6023,_0x3dea33){if(_0x5d6023[_0x2909('0x41')]['id']){delete _0x5d6023['body']['id'];}return db[_0x2909('0x27')][_0x2909('0x43')]({'where':{'id':_0x5d6023['params']['id']}})[_0x2909('0x22')](handleEntityNotFound(_0x3dea33,null))[_0x2909('0x22')](saveUpdates(_0x5d6023[_0x2909('0x41')],null))['then'](respondWithResult(_0x3dea33,null))[_0x2909('0x3f')](handleError(_0x3dea33,null));};exports[_0x2909('0x21')]=function(_0x420221,_0x234fe9){return db['ZohoField'][_0x2909('0x43')]({'where':{'id':_0x420221[_0x2909('0x44')]['id']}})[_0x2909('0x22')](handleEntityNotFound(_0x234fe9,null))[_0x2909('0x22')](removeEntity(_0x234fe9,null))[_0x2909('0x3f')](handleError(_0x234fe9,null));}; \ No newline at end of file +var _0x29ef=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoField','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','zip-dir','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','query'];(function(_0x289891,_0x49a0fa){var _0x31cf2e=function(_0x8cebce){while(--_0x8cebce){_0x289891['push'](_0x289891['shift']());}};_0x31cf2e(++_0x49a0fa);}(_0x29ef,0xaf));var _0xf29e=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x29ef[_0x1ed116];return _0x574066;};'use strict';var emlformat=require(_0xf29e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf29e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf29e('0x2'));var util=require(_0xf29e('0x3'));var path=require('path');var sox=require(_0xf29e('0x4'));var csv=require(_0xf29e('0x5'));var ejs=require(_0xf29e('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf29e('0x7'));var squel=require(_0xf29e('0x8'));var crypto=require(_0xf29e('0x9'));var jsforce=require(_0xf29e('0xa'));var deskjs=require(_0xf29e('0xb'));var toCsv=require(_0xf29e('0x5'));var querystring=require(_0xf29e('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf29e('0xd'));var qs=require(_0xf29e('0xe'));var as=require(_0xf29e('0xf'));var hardwareService=require(_0xf29e('0x10'));var logger=require(_0xf29e('0x11'))(_0xf29e('0x12'));var utils=require(_0xf29e('0x13'));var config=require(_0xf29e('0x14'));var licenseUtil=require(_0xf29e('0x15'));var db=require(_0xf29e('0x16'))['db'];function respondWithStatusCode(_0x2cfebe,_0x383b52){_0x383b52=_0x383b52||0xcc;return function(_0x57a43a){if(_0x57a43a){return _0x2cfebe['sendStatus'](_0x383b52);}return _0x2cfebe[_0xf29e('0x17')](_0x383b52)['end']();};}function respondWithResult(_0x3a4c63,_0x2f0c8f){_0x2f0c8f=_0x2f0c8f||0xc8;return function(_0x3017cd){if(_0x3017cd){return _0x3a4c63[_0xf29e('0x17')](_0x2f0c8f)[_0xf29e('0x18')](_0x3017cd);}};}function respondWithFilteredResult(_0x488d2d,_0xda6654){return function(_0x5740bc){if(_0x5740bc){var _0x3efd41=typeof _0xda6654['offset']===_0xf29e('0x19')&&typeof _0xda6654[_0xf29e('0x1a')]==='undefined';var _0x2e6eb1=_0x5740bc[_0xf29e('0x1b')];var _0x9b146f=_0x3efd41?0x0:_0xda6654[_0xf29e('0x1c')];var _0x5db498=_0x3efd41?_0x5740bc[_0xf29e('0x1b')]:_0xda6654[_0xf29e('0x1c')]+_0xda6654[_0xf29e('0x1a')];var _0x9c3707;if(_0x5db498>=_0x2e6eb1){_0x5db498=_0x2e6eb1;_0x9c3707=0xc8;}else{_0x9c3707=0xce;}_0x488d2d[_0xf29e('0x17')](_0x9c3707);return _0x488d2d[_0xf29e('0x1d')](_0xf29e('0x1e'),_0x9b146f+'-'+_0x5db498+'/'+_0x2e6eb1)[_0xf29e('0x18')](_0x5740bc);}return null;};}function patchUpdates(_0x461571){return function(_0x1c89b1){try{jsonpatch[_0xf29e('0x1f')](_0x1c89b1,_0x461571,!![]);}catch(_0x392bda){return BPromise[_0xf29e('0x20')](_0x392bda);}return _0x1c89b1['save']();};}function saveUpdates(_0xf6d22f,_0xb69291){return function(_0x3acd9c){if(_0x3acd9c){return _0x3acd9c[_0xf29e('0x21')](_0xf6d22f)[_0xf29e('0x22')](function(_0x282385){return _0x282385;});}return null;};}function removeEntity(_0x226366,_0x3934a7){return function(_0xc9581){if(_0xc9581){return _0xc9581[_0xf29e('0x23')]()[_0xf29e('0x22')](function(){_0x226366[_0xf29e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x523f83,_0x320b5c){return function(_0xeceb4b){if(!_0xeceb4b){_0x523f83[_0xf29e('0x24')](0x194);}return _0xeceb4b;};}function handleError(_0x31c377,_0x4a8e45){_0x4a8e45=_0x4a8e45||0x1f4;return function(_0x420787){logger['error'](_0x420787[_0xf29e('0x25')]);if(_0x420787[_0xf29e('0x26')]){delete _0x420787[_0xf29e('0x26')];}_0x31c377['status'](_0x4a8e45)[_0xf29e('0x27')](_0x420787);};}exports[_0xf29e('0x28')]=function(_0x1cc55e,_0x1bb1de){var _0x20723a={},_0x38f56d={},_0xbede83={'count':0x0,'rows':[]};var _0x549c2e=_[_0xf29e('0x29')](db['ZohoField'][_0xf29e('0x2a')],function(_0x3c8290){return{'name':_0x3c8290[_0xf29e('0x2b')],'type':_0x3c8290[_0xf29e('0x2c')]['key']};});_0x38f56d[_0xf29e('0x2d')]=_['map'](_0x549c2e,_0xf29e('0x26'));_0x38f56d[_0xf29e('0x2e')]=_[_0xf29e('0x2f')](_0x1cc55e[_0xf29e('0x2e')]);_0x38f56d[_0xf29e('0x30')]=_[_0xf29e('0x31')](_0x38f56d['model'],_0x38f56d[_0xf29e('0x2e')]);_0x20723a[_0xf29e('0x32')]=_[_0xf29e('0x31')](_0x38f56d[_0xf29e('0x2d')],qs[_0xf29e('0x33')](_0x1cc55e['query'][_0xf29e('0x33')]));_0x20723a[_0xf29e('0x32')]=_0x20723a[_0xf29e('0x32')][_0xf29e('0x34')]?_0x20723a[_0xf29e('0x32')]:_0x38f56d[_0xf29e('0x2d')];if(!_0x1cc55e[_0xf29e('0x2e')][_0xf29e('0x35')](_0xf29e('0x36'))){_0x20723a[_0xf29e('0x1a')]=qs[_0xf29e('0x1a')](_0x1cc55e[_0xf29e('0x2e')]['limit']);_0x20723a[_0xf29e('0x1c')]=qs[_0xf29e('0x1c')](_0x1cc55e['query'][_0xf29e('0x1c')]);}_0x20723a[_0xf29e('0x37')]=qs[_0xf29e('0x38')](_0x1cc55e[_0xf29e('0x2e')][_0xf29e('0x38')]);_0x20723a[_0xf29e('0x39')]=qs[_0xf29e('0x30')](_[_0xf29e('0x3a')](_0x1cc55e[_0xf29e('0x2e')],_0x38f56d[_0xf29e('0x30')]),_0x549c2e);if(_0x1cc55e[_0xf29e('0x2e')][_0xf29e('0x3b')]){_0x20723a[_0xf29e('0x39')]=_[_0xf29e('0x3c')](_0x20723a[_0xf29e('0x39')],{'$or':_[_0xf29e('0x29')](_0x549c2e,function(_0x59d0f6){if(_0x59d0f6['type']!==_0xf29e('0x3d')){var _0x825c88={};_0x825c88[_0x59d0f6[_0xf29e('0x26')]]={'$like':'%'+_0x1cc55e['query'][_0xf29e('0x3b')]+'%'};return _0x825c88;}})});}_0x20723a=_[_0xf29e('0x3c')]({},_0x20723a,_0x1cc55e[_0xf29e('0x3e')]);var _0x588a1c={'where':_0x20723a[_0xf29e('0x39')]};return db[_0xf29e('0x3f')][_0xf29e('0x1b')](_0x588a1c)['then'](function(_0x1ba3d3){_0xbede83[_0xf29e('0x1b')]=_0x1ba3d3;if(_0x1cc55e[_0xf29e('0x2e')][_0xf29e('0x40')]){_0x20723a[_0xf29e('0x41')]=[{'all':!![]}];}return db[_0xf29e('0x3f')][_0xf29e('0x42')](_0x20723a);})[_0xf29e('0x22')](function(_0x370aec){_0xbede83[_0xf29e('0x43')]=_0x370aec;return _0xbede83;})['then'](respondWithFilteredResult(_0x1bb1de,_0x20723a))[_0xf29e('0x44')](handleError(_0x1bb1de,null));};exports[_0xf29e('0x45')]=function(_0x221832,_0x717e11){var _0x2a7ae3={'raw':!![],'where':{'id':_0x221832[_0xf29e('0x46')]['id']}},_0x546246={};_0x546246['model']=_[_0xf29e('0x2f')](db[_0xf29e('0x3f')][_0xf29e('0x2a')]);_0x546246[_0xf29e('0x2e')]=_[_0xf29e('0x2f')](_0x221832['query']);_0x546246[_0xf29e('0x30')]=_['intersection'](_0x546246['model'],_0x546246['query']);_0x2a7ae3['attributes']=_['intersection'](_0x546246[_0xf29e('0x2d')],qs['fields'](_0x221832[_0xf29e('0x2e')][_0xf29e('0x33')]));_0x2a7ae3[_0xf29e('0x32')]=_0x2a7ae3[_0xf29e('0x32')][_0xf29e('0x34')]?_0x2a7ae3[_0xf29e('0x32')]:_0x546246[_0xf29e('0x2d')];if(_0x221832[_0xf29e('0x2e')][_0xf29e('0x40')]){_0x2a7ae3[_0xf29e('0x41')]=[{'all':!![]}];}_0x2a7ae3=_[_0xf29e('0x3c')]({},_0x2a7ae3,_0x221832[_0xf29e('0x3e')]);return db[_0xf29e('0x3f')][_0xf29e('0x47')](_0x2a7ae3)[_0xf29e('0x22')](handleEntityNotFound(_0x717e11,null))[_0xf29e('0x22')](respondWithResult(_0x717e11,null))['catch'](handleError(_0x717e11,null));};exports[_0xf29e('0x48')]=function(_0x5cbb64,_0x7ef023){return db[_0xf29e('0x3f')][_0xf29e('0x48')](_0x5cbb64[_0xf29e('0x49')],{})[_0xf29e('0x22')](respondWithResult(_0x7ef023,0xc9))['catch'](handleError(_0x7ef023,null));};exports['update']=function(_0x1fb472,_0x585947){if(_0x1fb472[_0xf29e('0x49')]['id']){delete _0x1fb472[_0xf29e('0x49')]['id'];}return db[_0xf29e('0x3f')]['find']({'where':{'id':_0x1fb472[_0xf29e('0x46')]['id']}})[_0xf29e('0x22')](handleEntityNotFound(_0x585947,null))[_0xf29e('0x22')](saveUpdates(_0x1fb472[_0xf29e('0x49')],null))[_0xf29e('0x22')](respondWithResult(_0x585947,null))[_0xf29e('0x44')](handleError(_0x585947,null));};exports[_0xf29e('0x23')]=function(_0x1625bf,_0x13d9f6){return db[_0xf29e('0x3f')][_0xf29e('0x47')]({'where':{'id':_0x1625bf[_0xf29e('0x46')]['id']}})[_0xf29e('0x22')](handleEntityNotFound(_0x13d9f6,null))[_0xf29e('0x22')](removeEntity(_0x13d9f6,null))[_0xf29e('0x44')](handleError(_0x13d9f6,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 0910551..dd27ad3 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 _0xafc4=['bluebird','request-promise','path','exports','define','ZohoField','int_zoho_fields','idField','FieldId','lodash','../../config/logger','moment'];(function(_0x1e3774,_0x51f705){var _0x282854=function(_0x5ecd19){while(--_0x5ecd19){_0x1e3774['push'](_0x1e3774['shift']());}};_0x282854(++_0x51f705);}(_0xafc4,0x69));var _0x4afc=function(_0x3981a3,_0x3bbcb8){_0x3981a3=_0x3981a3-0x0;var _0x17a1f4=_0xafc4[_0x3981a3];return _0x17a1f4;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x4afc('0xa'),_0x4afc('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x82c4=['moment','bluebird','request-promise','rimraf','./intZohoField.attributes','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x4176bb,_0x1aa14e){var _0x34c62f=function(_0x277df3){while(--_0x277df3){_0x4176bb['push'](_0x4176bb['shift']());}};_0x34c62f(++_0x1aa14e);}(_0x82c4,0x1ca));var _0x482c=function(_0x1fd675,_0x587658){_0x1fd675=_0x1fd675-0x0;var _0x521d1c=_0x82c4[_0x1fd675];return _0x521d1c;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var logger=require(_0x482c('0x2'))(_0x482c('0x3'));var moment=require(_0x482c('0x4'));var BPromise=require(_0x482c('0x5'));var rp=require(_0x482c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x482c('0x7'));var config=require('../../config/environment');var attributes=require(_0x482c('0x8'));module['exports']=function(_0x477cf4,_0x5d7c76){return _0x477cf4[_0x482c('0x9')](_0x482c('0xa'),attributes,{'tableName':_0x482c('0xb'),'paranoid':![],'indexes':[{'name':_0x482c('0xc'),'fields':[_0x482c('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 8a13b40..ab8226e 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 _0x6b5a=['../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0xd7d4d5,_0x5859ec){var _0x5d65d8=function(_0x30e04a){while(--_0x30e04a){_0xd7d4d5['push'](_0xd7d4d5['shift']());}};_0x5d65d8(++_0x5859ec);}(_0x6b5a,0x138));var _0xa6b5=function(_0x19541e,_0x2fe3b3){_0x19541e=_0x19541e-0x0;var _0x1ed274=_0x6b5a[_0x19541e];return _0x1ed274;};'use strict';var _=require(_0xa6b5('0x0'));var util=require('util');var moment=require(_0xa6b5('0x1'));var BPromise=require(_0xa6b5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6b5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa6b5('0x4'))('rpc');var config=require(_0xa6b5('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa6b5('0x6')][_0xa6b5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xe2ecbd,_0x109868,_0x39e89d){return new BPromise(function(_0x31a24e,_0x2fae88){return client[_0xa6b5('0x8')](_0xe2ecbd,_0x39e89d)[_0xa6b5('0x9')](function(_0x5ab35f){logger[_0xa6b5('0xa')](_0xa6b5('0xb'),_0x109868,'request\x20sent');logger[_0xa6b5('0xc')](_0xa6b5('0xd'),_0x109868,_0xa6b5('0xe'),JSON[_0xa6b5('0xf')](_0x5ab35f));if(_0x5ab35f[_0xa6b5('0x10')]){if(_0x5ab35f['error'][_0xa6b5('0x11')]===0x1f4){logger['error'](_0xa6b5('0xb'),_0x109868,_0x5ab35f[_0xa6b5('0x10')]['message']);return _0x2fae88(_0x5ab35f[_0xa6b5('0x10')][_0xa6b5('0x12')]);}logger['error'](_0xa6b5('0xb'),_0x109868,_0x5ab35f[_0xa6b5('0x10')]['message']);return _0x31a24e(_0x5ab35f[_0xa6b5('0x10')][_0xa6b5('0x12')]);}else{logger['info'](_0xa6b5('0xb'),_0x109868,_0xa6b5('0xe'));_0x31a24e(_0x5ab35f[_0xa6b5('0x13')]['message']);}})[_0xa6b5('0x14')](function(_0x2be42a){logger[_0xa6b5('0x10')](_0xa6b5('0xb'),_0x109868,_0x2be42a);_0x2fae88(_0x2be42a);});});} \ No newline at end of file +var _0x3f5b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x3611ef,_0x4fbb05){var _0x246a54=function(_0x2bbd56){while(--_0x2bbd56){_0x3611ef['push'](_0x3611ef['shift']());}};_0x246a54(++_0x4fbb05);}(_0x3f5b,0x1e4));var _0xb3f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f5b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb3f5('0x0'));var util=require('util');var moment=require(_0xb3f5('0x1'));var BPromise=require(_0xb3f5('0x2'));var rs=require(_0xb3f5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3f5('0x4'))['db'];var utils=require(_0xb3f5('0x5'));var logger=require(_0xb3f5('0x6'))(_0xb3f5('0x7'));var config=require(_0xb3f5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb3f5('0x9')][_0xb3f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcd89ff,_0x253b94,_0x3626ff){return new BPromise(function(_0x1d41f0,_0x36e66d){return client[_0xb3f5('0xb')](_0xcd89ff,_0x3626ff)[_0xb3f5('0xc')](function(_0x5a7529){logger[_0xb3f5('0xd')](_0xb3f5('0xe'),_0x253b94,'request\x20sent');logger[_0xb3f5('0xf')](_0xb3f5('0x10'),_0x253b94,_0xb3f5('0x11'),JSON[_0xb3f5('0x12')](_0x5a7529));if(_0x5a7529[_0xb3f5('0x13')]){if(_0x5a7529[_0xb3f5('0x13')]['code']===0x1f4){logger['error'](_0xb3f5('0xe'),_0x253b94,_0x5a7529[_0xb3f5('0x13')]['message']);return _0x36e66d(_0x5a7529[_0xb3f5('0x13')][_0xb3f5('0x14')]);}logger[_0xb3f5('0x13')]('ZohoField,\x20%s,\x20%s',_0x253b94,_0x5a7529['error'][_0xb3f5('0x14')]);return _0x1d41f0(_0x5a7529[_0xb3f5('0x13')][_0xb3f5('0x14')]);}else{logger[_0xb3f5('0xd')](_0xb3f5('0xe'),_0x253b94,_0xb3f5('0x11'));_0x1d41f0(_0x5a7529[_0xb3f5('0x15')][_0xb3f5('0x14')]);}})[_0xb3f5('0x16')](function(_0x99c1a4){logger[_0xb3f5('0x13')]('ZohoField,\x20%s,\x20%s',_0x253b94,_0x99c1a4);_0x36e66d(_0x99c1a4);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 05ede12..9e42c8d 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3b83ad,_0x51290d){var _0x20e6fd=function(_0x5f4f4f){while(--_0x5f4f4f){_0x3b83ad['push'](_0x3b83ad['shift']());}};_0x20e6fd(++_0x51290d);}(_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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x14c6cd,_0x25a233){var _0x1b3892=function(_0x365d13){while(--_0x365d13){_0x14c6cd['push'](_0x14c6cd['shift']());}};_0x1b3892(++_0x25a233);}(_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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 1c0201e..9060b1b 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 _0xdacb=['app.js','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version'];(function(_0x7f041d,_0x4a28a7){var _0x5daef0=function(_0x4e59ba){while(--_0x4e59ba){_0x7f041d['push'](_0x7f041d['shift']());}};_0x5daef0(++_0x4a28a7);}(_0xdacb,0x1df));var _0xbdac=function(_0x27b04b,_0x2b90dc){_0x27b04b=_0x27b04b-0x0;var _0x4951b7=_0xdacb[_0x27b04b];return _0x4951b7;};'use strict';var Sequelize=require(_0xbdac('0x0'));module[_0xbdac('0x1')]={'name':{'type':Sequelize[_0xbdac('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xbdac('0x2')],'allowNull':![],'unique':_0xbdac('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xbdac('0x4')},'filename':{'type':Sequelize[_0xbdac('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xbdac('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xbdac('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xbdac('0x2')],'unique':_0xbdac('0x6')},'description':{'type':Sequelize[_0xbdac('0x2')]},'title':{'type':Sequelize[_0xbdac('0x2')]},'remoteUri':{'type':Sequelize[_0xbdac('0x2')]},'link':{'type':Sequelize[_0xbdac('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x3ebb=['sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x21057f,_0x4e3b82){var _0x1e2c77=function(_0x211e64){while(--_0x211e64){_0x21057f['push'](_0x21057f['shift']());}};_0x1e2c77(++_0x4e3b82);}(_0x3ebb,0xcd));var _0xb3eb=function(_0x178e36,_0x3d2069){_0x178e36=_0x178e36-0x0;var _0x5b03e3=_0x3ebb[_0x178e36];return _0x5b03e3;};'use strict';var Sequelize=require(_0xb3eb('0x0'));module[_0xb3eb('0x1')]={'name':{'type':Sequelize[_0xb3eb('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xb3eb('0x2')],'allowNull':![],'unique':_0xb3eb('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xb3eb('0x4')},'filename':{'type':Sequelize[_0xb3eb('0x2')]},'path':{'type':Sequelize[_0xb3eb('0x2')]},'type':{'type':Sequelize[_0xb3eb('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xb3eb('0x2')]},'logo':{'type':Sequelize[_0xb3eb('0x2')]},'state':{'type':Sequelize[_0xb3eb('0x2')],'unique':'state'},'description':{'type':Sequelize[_0xb3eb('0x2')]},'title':{'type':Sequelize[_0xb3eb('0x2')]},'remoteUri':{'type':Sequelize[_0xb3eb('0x2')]},'link':{'type':Sequelize[_0xb3eb('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index b49d65c..21bfa22 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 _0x4991=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','Integration','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','key','model','query','filters'];(function(_0x5eb496,_0x25bc44){var _0x4f513a=function(_0x4e2351){while(--_0x4e2351){_0x5eb496['push'](_0x5eb496['shift']());}};_0x4f513a(++_0x25bc44);}(_0x4991,0xf7));var _0x1499=function(_0x273ccc,_0x21ceea){_0x273ccc=_0x273ccc-0x0;var _0x369546=_0x4991[_0x273ccc];return _0x369546;};'use strict';var emlformat=require(_0x1499('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var Mustache=require(_0x1499('0x5'));var util=require(_0x1499('0x6'));var path=require(_0x1499('0x7'));var sox=require(_0x1499('0x8'));var csv=require(_0x1499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1499('0xa'));var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x9'));var querystring=require(_0x1499('0x10'));var Papa=require('papaparse');var Redis=require(_0x1499('0x11'));var authService=require(_0x1499('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1499('0x13'));var hardwareService=require(_0x1499('0x14'));var logger=require('../../config/logger')(_0x1499('0x15'));var utils=require(_0x1499('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3039ce,_0x274bc1){_0x274bc1=_0x274bc1||0xcc;return function(_0x34a928){if(_0x34a928){return _0x3039ce[_0x1499('0x17')](_0x274bc1);}return _0x3039ce[_0x1499('0x18')](_0x274bc1)['end']();};}function respondWithResult(_0x5f34f2,_0x308177){_0x308177=_0x308177||0xc8;return function(_0x4e5195){if(_0x4e5195){return _0x5f34f2[_0x1499('0x18')](_0x308177)[_0x1499('0x19')](_0x4e5195);}};}function respondWithFilteredResult(_0x308318,_0x3ab605){return function(_0x48f654){if(_0x48f654){var _0x1ed43b=typeof _0x3ab605[_0x1499('0x1a')]==='undefined'&&typeof _0x3ab605[_0x1499('0x1b')]===_0x1499('0x1c');var _0x46b364=_0x48f654[_0x1499('0x1d')];var _0x1e45a9=_0x1ed43b?0x0:_0x3ab605[_0x1499('0x1a')];var _0x5b9859=_0x1ed43b?_0x48f654['count']:_0x3ab605['offset']+_0x3ab605[_0x1499('0x1b')];var _0xad534b;if(_0x5b9859>=_0x46b364){_0x5b9859=_0x46b364;_0xad534b=0xc8;}else{_0xad534b=0xce;}_0x308318['status'](_0xad534b);return _0x308318[_0x1499('0x1e')](_0x1499('0x1f'),_0x1e45a9+'-'+_0x5b9859+'/'+_0x46b364)[_0x1499('0x19')](_0x48f654);}return null;};}function patchUpdates(_0x18e4a6){return function(_0x21e887){try{jsonpatch[_0x1499('0x20')](_0x21e887,_0x18e4a6,!![]);}catch(_0x2b0458){return BPromise[_0x1499('0x21')](_0x2b0458);}return _0x21e887[_0x1499('0x22')]();};}function saveUpdates(_0x15bcd4,_0x2bb71f){return function(_0x836081){if(_0x836081){return _0x836081[_0x1499('0x23')](_0x15bcd4)[_0x1499('0x24')](function(_0x4ec57a){return _0x4ec57a;});}return null;};}function removeEntity(_0x1e2c51,_0x2c7f57){return function(_0x5615b4){if(_0x5615b4){return _0x5615b4[_0x1499('0x25')]()[_0x1499('0x24')](function(){_0x1e2c51[_0x1499('0x18')](0xcc)[_0x1499('0x26')]();});}};}function handleEntityNotFound(_0x3968e0,_0x16d036){return function(_0x54f3c2){if(!_0x54f3c2){_0x3968e0['sendStatus'](0x194);}return _0x54f3c2;};}function handleError(_0x12739b,_0x3c9aca){_0x3c9aca=_0x3c9aca||0x1f4;return function(_0x3b9259){logger[_0x1499('0x27')](_0x3b9259[_0x1499('0x28')]);if(_0x3b9259['name']){delete _0x3b9259[_0x1499('0x29')];}_0x12739b['status'](_0x3c9aca)['send'](_0x3b9259);};}exports['index']=function(_0x21d204,_0x103efa){var _0x40932a={},_0x1b460b={},_0x3dad86={'count':0x0,'rows':[]};var _0x388513=_[_0x1499('0x2a')](db['Integration'][_0x1499('0x2b')],function(_0x1a2c99){return{'name':_0x1a2c99[_0x1499('0x2c')],'type':_0x1a2c99['type'][_0x1499('0x2d')]};});_0x1b460b[_0x1499('0x2e')]=_['map'](_0x388513,_0x1499('0x29'));_0x1b460b[_0x1499('0x2f')]=_['keys'](_0x21d204[_0x1499('0x2f')]);_0x1b460b[_0x1499('0x30')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],_0x1b460b[_0x1499('0x2f')]);_0x40932a[_0x1499('0x32')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x21d204[_0x1499('0x2f')][_0x1499('0x33')]));_0x40932a[_0x1499('0x32')]=_0x40932a[_0x1499('0x32')][_0x1499('0x34')]?_0x40932a[_0x1499('0x32')]:_0x1b460b[_0x1499('0x2e')];if(!_0x21d204[_0x1499('0x2f')][_0x1499('0x35')](_0x1499('0x36'))){_0x40932a[_0x1499('0x1b')]=qs['limit'](_0x21d204[_0x1499('0x2f')][_0x1499('0x1b')]);_0x40932a[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x21d204[_0x1499('0x2f')][_0x1499('0x1a')]);}_0x40932a[_0x1499('0x37')]=qs[_0x1499('0x38')](_0x21d204[_0x1499('0x2f')][_0x1499('0x38')]);_0x40932a[_0x1499('0x39')]=qs['filters'](_['pick'](_0x21d204[_0x1499('0x2f')],_0x1b460b['filters']),_0x388513);if(_0x21d204[_0x1499('0x2f')]['filter']){_0x40932a[_0x1499('0x39')]=_[_0x1499('0x3a')](_0x40932a[_0x1499('0x39')],{'$or':_[_0x1499('0x2a')](_0x388513,function(_0x531933){if(_0x531933[_0x1499('0x3b')]!=='VIRTUAL'){var _0x2f9c59={};_0x2f9c59[_0x531933[_0x1499('0x29')]]={'$like':'%'+_0x21d204[_0x1499('0x2f')][_0x1499('0x3c')]+'%'};return _0x2f9c59;}})});}_0x40932a=_['merge']({},_0x40932a,_0x21d204[_0x1499('0x3d')]);var _0x815a99={'where':_0x40932a[_0x1499('0x39')]};return db[_0x1499('0x3e')]['count'](_0x815a99)[_0x1499('0x24')](function(_0x4cc411){_0x3dad86[_0x1499('0x1d')]=_0x4cc411;if(_0x21d204[_0x1499('0x2f')][_0x1499('0x3f')]){_0x40932a[_0x1499('0x40')]=[{'all':!![]}];}return db[_0x1499('0x3e')][_0x1499('0x41')](_0x40932a);})[_0x1499('0x24')](function(_0xcb85eb){_0x3dad86[_0x1499('0x42')]=_0xcb85eb;return _0x3dad86;})[_0x1499('0x24')](respondWithFilteredResult(_0x103efa,_0x40932a))['catch'](handleError(_0x103efa,null));};exports[_0x1499('0x43')]=function(_0x5dd36c,_0x2cfdaf){var _0x1af1a1={'raw':![],'where':{'id':_0x5dd36c[_0x1499('0x44')]['id']}},_0x5646cf={};_0x5646cf[_0x1499('0x2e')]=_[_0x1499('0x45')](db[_0x1499('0x3e')][_0x1499('0x2b')]);_0x5646cf['query']=_['keys'](_0x5dd36c[_0x1499('0x2f')]);_0x5646cf[_0x1499('0x30')]=_['intersection'](_0x5646cf[_0x1499('0x2e')],_0x5646cf[_0x1499('0x2f')]);_0x1af1a1['attributes']=_['intersection'](_0x5646cf[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x5dd36c[_0x1499('0x2f')]['fields']));_0x1af1a1[_0x1499('0x32')]=_0x1af1a1[_0x1499('0x32')][_0x1499('0x34')]?_0x1af1a1[_0x1499('0x32')]:_0x5646cf['model'];if(_0x5dd36c[_0x1499('0x2f')][_0x1499('0x3f')]){_0x1af1a1[_0x1499('0x40')]=[{'all':!![]}];}_0x1af1a1=_[_0x1499('0x3a')]({},_0x1af1a1,_0x5dd36c['options']);return db[_0x1499('0x3e')][_0x1499('0x46')](_0x1af1a1)[_0x1499('0x24')](handleEntityNotFound(_0x2cfdaf,null))['then'](respondWithResult(_0x2cfdaf,null))['catch'](handleError(_0x2cfdaf,null));};exports[_0x1499('0x47')]=function(_0x491777,_0x7fa101){return db[_0x1499('0x3e')][_0x1499('0x47')](_0x491777[_0x1499('0x48')],{})[_0x1499('0x24')](respondWithResult(_0x7fa101,0xc9))[_0x1499('0x49')](handleError(_0x7fa101,null));};exports[_0x1499('0x23')]=function(_0x591aa8,_0x420d16){if(_0x591aa8['body']['id']){delete _0x591aa8[_0x1499('0x48')]['id'];}return db[_0x1499('0x3e')]['find']({'where':{'id':_0x591aa8[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x420d16,null))[_0x1499('0x24')](saveUpdates(_0x591aa8['body'],null))[_0x1499('0x24')](respondWithResult(_0x420d16,null))[_0x1499('0x49')](handleError(_0x420d16,null));};exports[_0x1499('0x25')]=function(_0x29ac0f,_0x305599){return db[_0x1499('0x3e')][_0x1499('0x46')]({'where':{'id':_0x29ac0f[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x305599,null))[_0x1499('0x24')](removeEntity(_0x305599,null))['catch'](handleError(_0x305599,null));}; \ No newline at end of file +var _0x4819=['bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','Integration','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','catch','show','keys','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4819,0xcd));var _0x9481=function(_0xe7a99e,_0x4902a1){_0xe7a99e=_0xe7a99e-0x0;var _0x3bef5c=_0x4819[_0xe7a99e];return _0x3bef5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];function respondWithStatusCode(_0xed8e9,_0x499b87){_0x499b87=_0x499b87||0xcc;return function(_0x5aac02){if(_0x5aac02){return _0xed8e9[_0x9481('0x1a')](_0x499b87);}return _0xed8e9[_0x9481('0x1b')](_0x499b87)[_0x9481('0x1c')]();};}function respondWithResult(_0x28fcb6,_0x3d23c2){_0x3d23c2=_0x3d23c2||0xc8;return function(_0xc7a0b5){if(_0xc7a0b5){return _0x28fcb6[_0x9481('0x1b')](_0x3d23c2)['json'](_0xc7a0b5);}};}function respondWithFilteredResult(_0x4220f1,_0x7a7ee){return function(_0x5b1fe6){if(_0x5b1fe6){var _0x2266d5=typeof _0x7a7ee['offset']===_0x9481('0x1d')&&typeof _0x7a7ee[_0x9481('0x1e')]===_0x9481('0x1d');var _0x2bb2a4=_0x5b1fe6['count'];var _0x5eda66=_0x2266d5?0x0:_0x7a7ee[_0x9481('0x1f')];var _0x50a559=_0x2266d5?_0x5b1fe6['count']:_0x7a7ee[_0x9481('0x1f')]+_0x7a7ee[_0x9481('0x1e')];var _0x18c6f5;if(_0x50a559>=_0x2bb2a4){_0x50a559=_0x2bb2a4;_0x18c6f5=0xc8;}else{_0x18c6f5=0xce;}_0x4220f1[_0x9481('0x1b')](_0x18c6f5);return _0x4220f1[_0x9481('0x20')](_0x9481('0x21'),_0x5eda66+'-'+_0x50a559+'/'+_0x2bb2a4)['json'](_0x5b1fe6);}return null;};}function patchUpdates(_0x2cf1aa){return function(_0x272a84){try{jsonpatch[_0x9481('0x22')](_0x272a84,_0x2cf1aa,!![]);}catch(_0x615e02){return BPromise[_0x9481('0x23')](_0x615e02);}return _0x272a84['save']();};}function saveUpdates(_0x215dd7,_0x294908){return function(_0x572599){if(_0x572599){return _0x572599[_0x9481('0x24')](_0x215dd7)[_0x9481('0x25')](function(_0x352b3a){return _0x352b3a;});}return null;};}function removeEntity(_0x1809d2,_0x2dc02e){return function(_0x49ecfa){if(_0x49ecfa){return _0x49ecfa[_0x9481('0x26')]()[_0x9481('0x25')](function(){_0x1809d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12b0c3,_0x299e28){return function(_0x550fce){if(!_0x550fce){_0x12b0c3[_0x9481('0x1a')](0x194);}return _0x550fce;};}function handleError(_0x20ff9a,_0xeff0a5){_0xeff0a5=_0xeff0a5||0x1f4;return function(_0x28ae1b){logger['error'](_0x28ae1b[_0x9481('0x27')]);if(_0x28ae1b[_0x9481('0x28')]){delete _0x28ae1b[_0x9481('0x28')];}_0x20ff9a['status'](_0xeff0a5)[_0x9481('0x29')](_0x28ae1b);};}exports['index']=function(_0x2e1eff,_0xe153ab){var _0x22ab26={},_0x13ef93={},_0x2e5e63={'count':0x0,'rows':[]};var _0x53560d=_[_0x9481('0x2a')](db[_0x9481('0x2b')][_0x9481('0x2c')],function(_0x4895a0){return{'name':_0x4895a0['fieldName'],'type':_0x4895a0[_0x9481('0x2d')][_0x9481('0x2e')]};});_0x13ef93[_0x9481('0x2f')]=_[_0x9481('0x2a')](_0x53560d,'name');_0x13ef93['query']=_['keys'](_0x2e1eff[_0x9481('0x30')]);_0x13ef93['filters']=_[_0x9481('0x31')](_0x13ef93['model'],_0x13ef93[_0x9481('0x30')]);_0x22ab26[_0x9481('0x32')]=_[_0x9481('0x31')](_0x13ef93[_0x9481('0x2f')],qs[_0x9481('0x33')](_0x2e1eff['query'][_0x9481('0x33')]));_0x22ab26[_0x9481('0x32')]=_0x22ab26[_0x9481('0x32')]['length']?_0x22ab26[_0x9481('0x32')]:_0x13ef93[_0x9481('0x2f')];if(!_0x2e1eff[_0x9481('0x30')][_0x9481('0x34')](_0x9481('0x35'))){_0x22ab26[_0x9481('0x1e')]=qs['limit'](_0x2e1eff[_0x9481('0x30')]['limit']);_0x22ab26[_0x9481('0x1f')]=qs[_0x9481('0x1f')](_0x2e1eff[_0x9481('0x30')][_0x9481('0x1f')]);}_0x22ab26[_0x9481('0x36')]=qs[_0x9481('0x37')](_0x2e1eff['query'][_0x9481('0x37')]);_0x22ab26[_0x9481('0x38')]=qs['filters'](_['pick'](_0x2e1eff[_0x9481('0x30')],_0x13ef93['filters']),_0x53560d);if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]){_0x22ab26[_0x9481('0x38')]=_[_0x9481('0x3a')](_0x22ab26['where'],{'$or':_[_0x9481('0x2a')](_0x53560d,function(_0x590d50){if(_0x590d50[_0x9481('0x2d')]!=='VIRTUAL'){var _0x2ce972={};_0x2ce972[_0x590d50['name']]={'$like':'%'+_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]+'%'};return _0x2ce972;}})});}_0x22ab26=_[_0x9481('0x3a')]({},_0x22ab26,_0x2e1eff[_0x9481('0x3b')]);var _0x97dc3e={'where':_0x22ab26[_0x9481('0x38')]};return db[_0x9481('0x2b')]['count'](_0x97dc3e)[_0x9481('0x25')](function(_0x3857e8){_0x2e5e63[_0x9481('0x3c')]=_0x3857e8;if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x3d')]){_0x22ab26[_0x9481('0x3e')]=[{'all':!![]}];}return db[_0x9481('0x2b')]['findAll'](_0x22ab26);})[_0x9481('0x25')](function(_0x1872ff){_0x2e5e63['rows']=_0x1872ff;return _0x2e5e63;})[_0x9481('0x25')](respondWithFilteredResult(_0xe153ab,_0x22ab26))[_0x9481('0x3f')](handleError(_0xe153ab,null));};exports[_0x9481('0x40')]=function(_0x3eb9ee,_0x29a8e9){var _0x5a8ffd={'raw':![],'where':{'id':_0x3eb9ee['params']['id']}},_0x304791={};_0x304791[_0x9481('0x2f')]=_[_0x9481('0x41')](db['Integration']['rawAttributes']);_0x304791[_0x9481('0x30')]=_[_0x9481('0x41')](_0x3eb9ee[_0x9481('0x30')]);_0x304791['filters']=_[_0x9481('0x31')](_0x304791[_0x9481('0x2f')],_0x304791['query']);_0x5a8ffd['attributes']=_[_0x9481('0x31')](_0x304791['model'],qs[_0x9481('0x33')](_0x3eb9ee[_0x9481('0x30')][_0x9481('0x33')]));_0x5a8ffd[_0x9481('0x32')]=_0x5a8ffd[_0x9481('0x32')]['length']?_0x5a8ffd[_0x9481('0x32')]:_0x304791[_0x9481('0x2f')];if(_0x3eb9ee['query'][_0x9481('0x3d')]){_0x5a8ffd[_0x9481('0x3e')]=[{'all':!![]}];}_0x5a8ffd=_[_0x9481('0x3a')]({},_0x5a8ffd,_0x3eb9ee[_0x9481('0x3b')]);return db[_0x9481('0x2b')][_0x9481('0x42')](_0x5a8ffd)[_0x9481('0x25')](handleEntityNotFound(_0x29a8e9,null))[_0x9481('0x25')](respondWithResult(_0x29a8e9,null))[_0x9481('0x3f')](handleError(_0x29a8e9,null));};exports['create']=function(_0xd36133,_0x5d3a06){return db['Integration'][_0x9481('0x43')](_0xd36133['body'],{})[_0x9481('0x25')](respondWithResult(_0x5d3a06,0xc9))[_0x9481('0x3f')](handleError(_0x5d3a06,null));};exports['update']=function(_0x277e2a,_0x1044a2){if(_0x277e2a[_0x9481('0x44')]['id']){delete _0x277e2a[_0x9481('0x44')]['id'];}return db[_0x9481('0x2b')][_0x9481('0x42')]({'where':{'id':_0x277e2a['params']['id']}})['then'](handleEntityNotFound(_0x1044a2,null))[_0x9481('0x25')](saveUpdates(_0x277e2a[_0x9481('0x44')],null))[_0x9481('0x25')](respondWithResult(_0x1044a2,null))[_0x9481('0x3f')](handleError(_0x1044a2,null));};exports[_0x9481('0x26')]=function(_0x353aab,_0x1c070c){return db[_0x9481('0x2b')]['find']({'where':{'id':_0x353aab[_0x9481('0x45')]['id']}})[_0x9481('0x25')](handleEntityNotFound(_0x1c070c,null))[_0x9481('0x25')](removeEntity(_0x1c070c,null))[_0x9481('0x3f')](handleError(_0x1c070c,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 24d48ad..2b5fb59 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 _0xfaea=['../../config/environment','exports','define','Integration','integrations','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x4f8ec1,_0x1f7e9e){var _0x227a79=function(_0x58f620){while(--_0x58f620){_0x4f8ec1['push'](_0x4f8ec1['shift']());}};_0x227a79(++_0x1f7e9e);}(_0xfaea,0xad));var _0xafae=function(_0x210b93,_0x133e6d){_0x210b93=_0x210b93-0x0;var _0x2b020f=_0xfaea[_0x210b93];return _0x2b020f;};'use strict';var _=require('lodash');var util=require(_0xafae('0x0'));var logger=require(_0xafae('0x1'))(_0xafae('0x2'));var moment=require('moment');var BPromise=require(_0xafae('0x3'));var rp=require(_0xafae('0x4'));var fs=require('fs');var path=require(_0xafae('0x5'));var rimraf=require(_0xafae('0x6'));var config=require(_0xafae('0x7'));var attributes=require('./integration.attributes');module[_0xafae('0x8')]=function(_0x4aaf66,_0x150393){return _0x4aaf66[_0xafae('0x9')](_0xafae('0xa'),attributes,{'tableName':_0xafae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb43f=['path','rimraf','../../config/environment','./integration.attributes','define','Integration','integrations','lodash','api','moment','bluebird','request-promise'];(function(_0x597992,_0x516580){var _0x2bea67=function(_0x40b79f){while(--_0x40b79f){_0x597992['push'](_0x597992['shift']());}};_0x2bea67(++_0x516580);}(_0xb43f,0x7f));var _0xfb43=function(_0x2dfe07,_0x2b663f){_0x2dfe07=_0x2dfe07-0x0;var _0x30aee0=_0xb43f[_0x2dfe07];return _0x30aee0;};'use strict';var _=require(_0xfb43('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfb43('0x1'));var moment=require(_0xfb43('0x2'));var BPromise=require(_0xfb43('0x3'));var rp=require(_0xfb43('0x4'));var fs=require('fs');var path=require(_0xfb43('0x5'));var rimraf=require(_0xfb43('0x6'));var config=require(_0xfb43('0x7'));var attributes=require(_0xfb43('0x8'));module['exports']=function(_0x37d452,_0x2958c2){return _0x37d452[_0xfb43('0x9')](_0xfb43('0xa'),attributes,{'tableName':_0xfb43('0xb'),'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 b5a6a39..7a456cd 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 _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xc2c7,0x134));var _0x7c2c=function(_0x397b59,_0x4c5a39){_0x397b59=_0x397b59-0x0;var _0x1b4977=_0xc2c7[_0x397b59];return _0x1b4977;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('Integration,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file +var _0x0b0e=['Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','debug'];(function(_0x503cd5,_0x57774a){var _0x1fdf1e=function(_0x5222cc){while(--_0x5222cc){_0x503cd5['push'](_0x503cd5['shift']());}};_0x1fdf1e(++_0x57774a);}(_0x0b0e,0x187));var _0xe0b0=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0x0b0e[_0xf79bae];return _0x5d2cb7;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('Integration,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 6c56dc1..dd9889f 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 _0x1261=['create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','index','get','isAuthenticated','describe','/:id','post'];(function(_0x5285e2,_0x4e794d){var _0x46af3f=function(_0x5adcbb){while(--_0x5adcbb){_0x5285e2['push'](_0x5285e2['shift']());}};_0x46af3f(++_0x4e794d);}(_0x1261,0x144));var _0x1126=function(_0x1139d0,_0x41e5f8){_0x1139d0=_0x1139d0-0x0;var _0xcc01a6=_0x1261[_0x1139d0];return _0xcc01a6;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/describe',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['show']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x11')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x12')]);module[_0x1126('0x13')]=router; \ No newline at end of file +var _0x1a85=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0xd8d758,_0x153ed5){var _0x55628d=function(_0x1f43dd){while(--_0x1f43dd){_0xd8d758['push'](_0xd8d758['shift']());}};_0x55628d(++_0x153ed5);}(_0x1a85,0x178));var _0x51a8=function(_0x3523cb,_0x511b5c){_0x3523cb=_0x3523cb-0x0;var _0x54efd9=_0x1a85[_0x3523cb];return _0x54efd9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./integrationReport.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')]('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0xd')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xf')]);router[_0x51a8('0x10')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x11')]);module[_0x51a8('0x12')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 56cb5a5..6d373e5 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 _0xeae3=['TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x623e7,_0x1bef7d){var _0x121131=function(_0x59b734){while(--_0x59b734){_0x623e7['push'](_0x623e7['shift']());}};_0x121131(++_0x1bef7d);}(_0xeae3,0x1be));var _0x3eae=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0xeae3[_0x4c7935];return _0x30651d;};'use strict';var Sequelize=require('sequelize');module[_0x3eae('0x0')]={'integration':{'type':Sequelize[_0x3eae('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x3eae('0x1')]},'ticketId':{'type':Sequelize[_0x3eae('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3eae('0x1')]},'calleridnum':{'type':Sequelize[_0x3eae('0x1')]},'calleridname':{'type':Sequelize[_0x3eae('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x3eae('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x3eae('0x2')]},'holdtime':{'type':Sequelize[_0x3eae('0x3')]},'agentcomplete':{'type':Sequelize[_0x3eae('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x3eae('0x2')]},'talktime':{'type':Sequelize[_0x3eae('0x3')]},'agentacw':{'type':Sequelize[_0x3eae('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3eae('0x3')]},'reason':{'type':Sequelize[_0x3eae('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x3eae('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x3eae('0x2')]},'agentdump':{'type':Sequelize[_0x3eae('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x3eae('0x2')]},'lastevent':{'type':Sequelize[_0x3eae('0x1')]},'channel':{'type':Sequelize[_0x3eae('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x3eae('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3eae('0x1')]},'connectedlinename':{'type':Sequelize[_0x3eae('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3eae('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3eae('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x3eae('0x1')]},'destchannelstate':{'type':Sequelize[_0x3eae('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x3eae('0x1')]},'destcalleridnum':{'type':Sequelize[_0x3eae('0x1')]},'destcalleridname':{'type':Sequelize[_0x3eae('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x3eae('0x1')]},'destlanguage':{'type':Sequelize[_0x3eae('0x1')]},'destaccountcode':{'type':Sequelize[_0x3eae('0x1')]},'destcontext':{'type':Sequelize[_0x3eae('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x3eae('0x1')]},'messageId':{'type':Sequelize[_0x3eae('0x1')]},'inReplyTo':{'type':Sequelize[_0x3eae('0x1')]},'subject':{'type':Sequelize[_0x3eae('0x1')]},'from':{'type':Sequelize[_0x3eae('0x1')]},'to':{'type':Sequelize[_0x3eae('0x1')]},'cc':{'type':Sequelize[_0x3eae('0x1')]},'attachment':{'type':Sequelize[_0x3eae('0x5')]},'html':{'type':Sequelize[_0x3eae('0x5')]},'text':{'type':Sequelize[_0x3eae('0x5')]},'status':{'type':Sequelize[_0x3eae('0x6')](_0x3eae('0x7'),_0x3eae('0x8'),_0x3eae('0x9'),_0x3eae('0xa'))},'url':{'type':Sequelize[_0x3eae('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x3eae('0x3')]}}; \ No newline at end of file +var _0x80af=['ENUM','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x3b8c0d,_0x307c6b){var _0x87348a=function(_0x521083){while(--_0x521083){_0x3b8c0d['push'](_0x3b8c0d['shift']());}};_0x87348a(++_0x307c6b);}(_0x80af,0x197));var _0xf80a=function(_0x3fc8ea,_0x8c5cb6){_0x3fc8ea=_0x3fc8ea-0x0;var _0x41cad5=_0x80af[_0x3fc8ea];return _0x41cad5;};'use strict';var Sequelize=require(_0xf80a('0x0'));module[_0xf80a('0x1')]={'integration':{'type':Sequelize[_0xf80a('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xf80a('0x2')]},'ticketId':{'type':Sequelize[_0xf80a('0x2')]},'integrationId':{'type':Sequelize[_0xf80a('0x3')]},'contacts':{'type':Sequelize[_0xf80a('0x2')]},'uniqueid':{'type':Sequelize[_0xf80a('0x2')]},'calleridnum':{'type':Sequelize[_0xf80a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xf80a('0x2')]},'interface':{'type':Sequelize[_0xf80a('0x2')]},'membername':{'type':Sequelize[_0xf80a('0x2')]},'agentcalledAt':{'type':Sequelize[_0xf80a('0x4')]},'agentconnectAt':{'type':Sequelize[_0xf80a('0x4')]},'holdtime':{'type':Sequelize[_0xf80a('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf80a('0x4')]},'talktime':{'type':Sequelize[_0xf80a('0x3')]},'agentacw':{'type':Sequelize[_0xf80a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xf80a('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf80a('0x4')]},'agentdump':{'type':Sequelize[_0xf80a('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf80a('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf80a('0x2')]},'channelstate':{'type':Sequelize[_0xf80a('0x3')]},'channelstatedesc':{'type':Sequelize[_0xf80a('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf80a('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xf80a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf80a('0x2')]},'destchannel':{'type':Sequelize[_0xf80a('0x2')]},'destchannelstate':{'type':Sequelize[_0xf80a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xf80a('0x2')]},'destcalleridnum':{'type':Sequelize[_0xf80a('0x2')]},'destcalleridname':{'type':Sequelize[_0xf80a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xf80a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xf80a('0x2')]},'destlanguage':{'type':Sequelize[_0xf80a('0x2')]},'destaccountcode':{'type':Sequelize[_0xf80a('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf80a('0x2')]},'destpriority':{'type':Sequelize[_0xf80a('0x2')]},'destuniqueid':{'type':Sequelize[_0xf80a('0x2')]},'messageId':{'type':Sequelize[_0xf80a('0x2')]},'inReplyTo':{'type':Sequelize[_0xf80a('0x2')]},'subject':{'type':Sequelize[_0xf80a('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xf80a('0x2')]},'cc':{'type':Sequelize[_0xf80a('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xf80a('0x6')]},'text':{'type':Sequelize[_0xf80a('0x6')]},'status':{'type':Sequelize[_0xf80a('0x7')]('SENT','SENDING','RECEIVED',_0xf80a('0x8'))},'url':{'type':Sequelize[_0xf80a('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xf80a('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index def5c74..f7a6fab 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 _0x4649=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf'];(function(_0x4165f0,_0x360c82){var _0x324482=function(_0x378661){while(--_0x378661){_0x4165f0['push'](_0x4165f0['shift']());}};_0x324482(++_0x360c82);}(_0x4649,0x18e));var _0x9464=function(_0x713072,_0x572b31){_0x713072=_0x713072-0x0;var _0x336fee=_0x4649[_0x713072];return _0x336fee;};'use strict';var emlformat=require(_0x9464('0x0'));var rimraf=require(_0x9464('0x1'));var zipdir=require(_0x9464('0x2'));var jsonpatch=require(_0x9464('0x3'));var rp=require(_0x9464('0x4'));var moment=require(_0x9464('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9464('0x6'));var util=require(_0x9464('0x7'));var path=require('path');var sox=require(_0x9464('0x8'));var csv=require(_0x9464('0x9'));var ejs=require(_0x9464('0xa'));var fs=require('fs');var fs_extra=require(_0x9464('0xb'));var _=require('lodash');var squel=require(_0x9464('0xc'));var crypto=require(_0x9464('0xd'));var jsforce=require(_0x9464('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9464('0x9'));var querystring=require(_0x9464('0xf'));var Papa=require(_0x9464('0x10'));var Redis=require(_0x9464('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9464('0x12'));var hardwareService=require(_0x9464('0x13'));var logger=require(_0x9464('0x14'))(_0x9464('0x15'));var utils=require(_0x9464('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9464('0x17'));var db=require(_0x9464('0x18'))['db'];function respondWithStatusCode(_0xe2d518,_0xff5bf6){_0xff5bf6=_0xff5bf6||0xcc;return function(_0x3b90df){if(_0x3b90df){return _0xe2d518[_0x9464('0x19')](_0xff5bf6);}return _0xe2d518[_0x9464('0x1a')](_0xff5bf6)['end']();};}function respondWithResult(_0x35babe,_0x144269){_0x144269=_0x144269||0xc8;return function(_0x54fb44){if(_0x54fb44){return _0x35babe['status'](_0x144269)[_0x9464('0x1b')](_0x54fb44);}};}function respondWithFilteredResult(_0x4bd58e,_0x5500af){return function(_0x7a76a9){if(_0x7a76a9){var _0x15da1b=typeof _0x5500af[_0x9464('0x1c')]===_0x9464('0x1d')&&typeof _0x5500af['limit']===_0x9464('0x1d');var _0x52658c=_0x7a76a9['count'];var _0x279046=_0x15da1b?0x0:_0x5500af[_0x9464('0x1c')];var _0x94f004=_0x15da1b?_0x7a76a9[_0x9464('0x1e')]:_0x5500af[_0x9464('0x1c')]+_0x5500af['limit'];var _0xc938a5;if(_0x94f004>=_0x52658c){_0x94f004=_0x52658c;_0xc938a5=0xc8;}else{_0xc938a5=0xce;}_0x4bd58e[_0x9464('0x1a')](_0xc938a5);return _0x4bd58e['set'](_0x9464('0x1f'),_0x279046+'-'+_0x94f004+'/'+_0x52658c)['json'](_0x7a76a9);}return null;};}function patchUpdates(_0x4cf768){return function(_0x9bf637){try{jsonpatch[_0x9464('0x20')](_0x9bf637,_0x4cf768,!![]);}catch(_0x2880de){return BPromise[_0x9464('0x21')](_0x2880de);}return _0x9bf637[_0x9464('0x22')]();};}function saveUpdates(_0x1c2989,_0x314713){return function(_0x169fd6){if(_0x169fd6){return _0x169fd6[_0x9464('0x23')](_0x1c2989)[_0x9464('0x24')](function(_0x45a944){return _0x45a944;});}return null;};}function removeEntity(_0x1a5478,_0x886099){return function(_0x3d60a0){if(_0x3d60a0){return _0x3d60a0[_0x9464('0x25')]()['then'](function(){_0x1a5478[_0x9464('0x1a')](0xcc)[_0x9464('0x26')]();});}};}function handleEntityNotFound(_0xb478e5,_0x489a57){return function(_0x35a713){if(!_0x35a713){_0xb478e5[_0x9464('0x19')](0x194);}return _0x35a713;};}function handleError(_0x2b893a,_0x215c86){_0x215c86=_0x215c86||0x1f4;return function(_0x4d9348){logger[_0x9464('0x27')](_0x4d9348[_0x9464('0x28')]);if(_0x4d9348[_0x9464('0x29')]){delete _0x4d9348[_0x9464('0x29')];}_0x2b893a['status'](_0x215c86)[_0x9464('0x2a')](_0x4d9348);};}exports[_0x9464('0x2b')]=function(_0x49135b,_0x24edd4){var _0x2a71e6={},_0x3bd3fc={},_0x5da1f8={'count':0x0,'rows':[]};var _0x452cd3=_[_0x9464('0x2c')](db[_0x9464('0x2d')][_0x9464('0x2e')],function(_0x30725e){return{'name':_0x30725e[_0x9464('0x2f')],'type':_0x30725e['type'][_0x9464('0x30')]};});_0x3bd3fc[_0x9464('0x31')]=_[_0x9464('0x2c')](_0x452cd3,_0x9464('0x29'));_0x3bd3fc[_0x9464('0x32')]=_[_0x9464('0x33')](_0x49135b[_0x9464('0x32')]);_0x3bd3fc[_0x9464('0x34')]=_[_0x9464('0x35')](_0x3bd3fc[_0x9464('0x31')],_0x3bd3fc[_0x9464('0x32')]);_0x2a71e6[_0x9464('0x36')]=_[_0x9464('0x35')](_0x3bd3fc['model'],qs[_0x9464('0x37')](_0x49135b['query'][_0x9464('0x37')]));_0x2a71e6[_0x9464('0x36')]=_0x2a71e6[_0x9464('0x36')][_0x9464('0x38')]?_0x2a71e6['attributes']:_0x3bd3fc['model'];if(!_0x49135b[_0x9464('0x32')][_0x9464('0x39')](_0x9464('0x3a'))){_0x2a71e6['limit']=qs[_0x9464('0x3b')](_0x49135b[_0x9464('0x32')]['limit']);_0x2a71e6[_0x9464('0x1c')]=qs[_0x9464('0x1c')](_0x49135b[_0x9464('0x32')]['offset']);}_0x2a71e6[_0x9464('0x3c')]=qs[_0x9464('0x3d')](_0x49135b[_0x9464('0x32')]['sort']);_0x2a71e6[_0x9464('0x3e')]=qs['filters'](_[_0x9464('0x3f')](_0x49135b[_0x9464('0x32')],_0x3bd3fc[_0x9464('0x34')]),_0x452cd3);if(_0x49135b['query'][_0x9464('0x40')]){_0x2a71e6[_0x9464('0x3e')]=_[_0x9464('0x41')](_0x2a71e6[_0x9464('0x3e')],{'$or':_[_0x9464('0x2c')](_0x452cd3,function(_0x1afa66){if(_0x1afa66[_0x9464('0x42')]!==_0x9464('0x43')){var _0x38b10e={};_0x38b10e[_0x1afa66[_0x9464('0x29')]]={'$like':'%'+_0x49135b[_0x9464('0x32')]['filter']+'%'};return _0x38b10e;}})});}_0x2a71e6=_[_0x9464('0x41')]({},_0x2a71e6,_0x49135b[_0x9464('0x44')]);var _0x2a198f={'where':_0x2a71e6[_0x9464('0x3e')]};return db[_0x9464('0x2d')][_0x9464('0x1e')](_0x2a198f)[_0x9464('0x24')](function(_0x42bf9e){_0x5da1f8['count']=_0x42bf9e;if(_0x49135b[_0x9464('0x32')][_0x9464('0x45')]){_0x2a71e6[_0x9464('0x46')]=[{'all':!![]}];}return db[_0x9464('0x2d')][_0x9464('0x47')](_0x2a71e6);})[_0x9464('0x24')](function(_0xad5ea6){_0x5da1f8[_0x9464('0x48')]=_0xad5ea6;return _0x5da1f8;})[_0x9464('0x24')](respondWithFilteredResult(_0x24edd4,_0x2a71e6))[_0x9464('0x49')](handleError(_0x24edd4,null));};exports[_0x9464('0x4a')]=function(_0x2da403,_0x34b5f6){var _0x30a588={'raw':![],'where':{'id':_0x2da403[_0x9464('0x4b')]['id']}},_0x105f44={};_0x105f44[_0x9464('0x31')]=_[_0x9464('0x33')](db[_0x9464('0x2d')][_0x9464('0x2e')]);_0x105f44[_0x9464('0x32')]=_[_0x9464('0x33')](_0x2da403[_0x9464('0x32')]);_0x105f44['filters']=_[_0x9464('0x35')](_0x105f44[_0x9464('0x31')],_0x105f44['query']);_0x30a588[_0x9464('0x36')]=_[_0x9464('0x35')](_0x105f44[_0x9464('0x31')],qs['fields'](_0x2da403[_0x9464('0x32')][_0x9464('0x37')]));_0x30a588[_0x9464('0x36')]=_0x30a588[_0x9464('0x36')][_0x9464('0x38')]?_0x30a588[_0x9464('0x36')]:_0x105f44[_0x9464('0x31')];if(_0x2da403[_0x9464('0x32')][_0x9464('0x45')]){_0x30a588[_0x9464('0x46')]=[{'all':!![]}];}_0x30a588=_['merge']({},_0x30a588,_0x2da403[_0x9464('0x44')]);return db[_0x9464('0x2d')][_0x9464('0x4c')](_0x30a588)[_0x9464('0x24')](handleEntityNotFound(_0x34b5f6,null))[_0x9464('0x24')](respondWithResult(_0x34b5f6,null))[_0x9464('0x49')](handleError(_0x34b5f6,null));};exports[_0x9464('0x4d')]=function(_0x10ad34,_0x378656){return db[_0x9464('0x2d')][_0x9464('0x4d')](_0x10ad34[_0x9464('0x4e')],{})[_0x9464('0x24')](respondWithResult(_0x378656,0xc9))[_0x9464('0x49')](handleError(_0x378656,null));};exports[_0x9464('0x23')]=function(_0x38b146,_0x5efb28){if(_0x38b146['body']['id']){delete _0x38b146[_0x9464('0x4e')]['id'];}return db['IntegrationReport'][_0x9464('0x4c')]({'where':{'id':_0x38b146[_0x9464('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5efb28,null))[_0x9464('0x24')](saveUpdates(_0x38b146['body'],null))[_0x9464('0x24')](respondWithResult(_0x5efb28,null))[_0x9464('0x49')](handleError(_0x5efb28,null));};exports[_0x9464('0x25')]=function(_0xecddbc,_0x5d5047){return db[_0x9464('0x2d')][_0x9464('0x4c')]({'where':{'id':_0xecddbc[_0x9464('0x4b')]['id']}})[_0x9464('0x24')](handleEntityNotFound(_0x5d5047,null))[_0x9464('0x24')](removeEntity(_0x5d5047,null))[_0x9464('0x49')](handleError(_0x5d5047,null));};exports['describe']=function(_0x47e97b,_0x4c2008){return db[_0x9464('0x2d')][_0x9464('0x4f')]()[_0x9464('0x24')](respondWithResult(_0x4c2008,null))[_0x9464('0x49')](handleError(_0x4c2008,null));}; \ No newline at end of file +var _0x2802=['Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','options','IntegrationReport','includeAll','findAll','rows','show','params','include','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','count','set'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2802,0x75));var _0x2280=function(_0x58ceb9,_0x5601df){_0x58ceb9=_0x58ceb9-0x0;var _0x3d0ff5=_0x2802[_0x58ceb9];return _0x3d0ff5;};'use strict';var emlformat=require(_0x2280('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2280('0x1'));var jsonpatch=require(_0x2280('0x2'));var rp=require('request-promise');var moment=require(_0x2280('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2280('0x4'));var util=require(_0x2280('0x5'));var path=require(_0x2280('0x6'));var sox=require(_0x2280('0x7'));var csv=require(_0x2280('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2280('0x9'));var _=require(_0x2280('0xa'));var squel=require(_0x2280('0xb'));var crypto=require('crypto');var jsforce=require(_0x2280('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2280('0x8'));var querystring=require('querystring');var Papa=require(_0x2280('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2280('0xe'));var hardwareService=require(_0x2280('0xf'));var logger=require(_0x2280('0x10'))('api');var utils=require(_0x2280('0x11'));var config=require(_0x2280('0x12'));var licenseUtil=require(_0x2280('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1482e0,_0xec2a81){_0xec2a81=_0xec2a81||0xcc;return function(_0x3d8eba){if(_0x3d8eba){return _0x1482e0[_0x2280('0x14')](_0xec2a81);}return _0x1482e0['status'](_0xec2a81)[_0x2280('0x15')]();};}function respondWithResult(_0x319de8,_0x34b84d){_0x34b84d=_0x34b84d||0xc8;return function(_0x5324c2){if(_0x5324c2){return _0x319de8[_0x2280('0x16')](_0x34b84d)['json'](_0x5324c2);}};}function respondWithFilteredResult(_0x6f888e,_0x4f8904){return function(_0xce9fe7){if(_0xce9fe7){var _0x22b64a=typeof _0x4f8904[_0x2280('0x17')]===_0x2280('0x18')&&typeof _0x4f8904['limit']===_0x2280('0x18');var _0x4f5e5a=_0xce9fe7[_0x2280('0x19')];var _0x3966ea=_0x22b64a?0x0:_0x4f8904[_0x2280('0x17')];var _0x20a76f=_0x22b64a?_0xce9fe7[_0x2280('0x19')]:_0x4f8904[_0x2280('0x17')]+_0x4f8904['limit'];var _0x476a8b;if(_0x20a76f>=_0x4f5e5a){_0x20a76f=_0x4f5e5a;_0x476a8b=0xc8;}else{_0x476a8b=0xce;}_0x6f888e[_0x2280('0x16')](_0x476a8b);return _0x6f888e[_0x2280('0x1a')](_0x2280('0x1b'),_0x3966ea+'-'+_0x20a76f+'/'+_0x4f5e5a)[_0x2280('0x1c')](_0xce9fe7);}return null;};}function patchUpdates(_0xd98317){return function(_0x516952){try{jsonpatch[_0x2280('0x1d')](_0x516952,_0xd98317,!![]);}catch(_0x351b8a){return BPromise['reject'](_0x351b8a);}return _0x516952[_0x2280('0x1e')]();};}function saveUpdates(_0x749ac,_0x2288d7){return function(_0x5007f3){if(_0x5007f3){return _0x5007f3[_0x2280('0x1f')](_0x749ac)[_0x2280('0x20')](function(_0x5209c1){return _0x5209c1;});}return null;};}function removeEntity(_0xfb173c,_0x99c925){return function(_0x444703){if(_0x444703){return _0x444703[_0x2280('0x21')]()[_0x2280('0x20')](function(){_0xfb173c['status'](0xcc)[_0x2280('0x15')]();});}};}function handleEntityNotFound(_0xfc6373,_0x40320b){return function(_0x79236){if(!_0x79236){_0xfc6373[_0x2280('0x14')](0x194);}return _0x79236;};}function handleError(_0x5977dd,_0x6af43){_0x6af43=_0x6af43||0x1f4;return function(_0x3745dd){logger['error'](_0x3745dd[_0x2280('0x22')]);if(_0x3745dd[_0x2280('0x23')]){delete _0x3745dd[_0x2280('0x23')];}_0x5977dd[_0x2280('0x16')](_0x6af43)[_0x2280('0x24')](_0x3745dd);};}exports[_0x2280('0x25')]=function(_0x2c3625,_0x1164f7){var _0xd67270={},_0x3f8b35={},_0x3167e9={'count':0x0,'rows':[]};var _0x4697d4=_[_0x2280('0x26')](db['IntegrationReport'][_0x2280('0x27')],function(_0x4e4d61){return{'name':_0x4e4d61[_0x2280('0x28')],'type':_0x4e4d61['type'][_0x2280('0x29')]};});_0x3f8b35[_0x2280('0x2a')]=_['map'](_0x4697d4,_0x2280('0x23'));_0x3f8b35[_0x2280('0x2b')]=_[_0x2280('0x2c')](_0x2c3625[_0x2280('0x2b')]);_0x3f8b35[_0x2280('0x2d')]=_[_0x2280('0x2e')](_0x3f8b35[_0x2280('0x2a')],_0x3f8b35[_0x2280('0x2b')]);_0xd67270['attributes']=_[_0x2280('0x2e')](_0x3f8b35[_0x2280('0x2a')],qs['fields'](_0x2c3625['query'][_0x2280('0x2f')]));_0xd67270[_0x2280('0x30')]=_0xd67270[_0x2280('0x30')][_0x2280('0x31')]?_0xd67270[_0x2280('0x30')]:_0x3f8b35[_0x2280('0x2a')];if(!_0x2c3625['query']['hasOwnProperty'](_0x2280('0x32'))){_0xd67270[_0x2280('0x33')]=qs['limit'](_0x2c3625[_0x2280('0x2b')][_0x2280('0x33')]);_0xd67270[_0x2280('0x17')]=qs['offset'](_0x2c3625[_0x2280('0x2b')]['offset']);}_0xd67270[_0x2280('0x34')]=qs[_0x2280('0x35')](_0x2c3625[_0x2280('0x2b')][_0x2280('0x35')]);_0xd67270[_0x2280('0x36')]=qs[_0x2280('0x2d')](_[_0x2280('0x37')](_0x2c3625['query'],_0x3f8b35[_0x2280('0x2d')]),_0x4697d4);if(_0x2c3625[_0x2280('0x2b')][_0x2280('0x38')]){_0xd67270['where']=_['merge'](_0xd67270[_0x2280('0x36')],{'$or':_[_0x2280('0x26')](_0x4697d4,function(_0x56962c){if(_0x56962c[_0x2280('0x39')]!==_0x2280('0x3a')){var _0x3874ae={};_0x3874ae[_0x56962c[_0x2280('0x23')]]={'$like':'%'+_0x2c3625[_0x2280('0x2b')][_0x2280('0x38')]+'%'};return _0x3874ae;}})});}_0xd67270=_['merge']({},_0xd67270,_0x2c3625[_0x2280('0x3b')]);var _0x5dc66c={'where':_0xd67270[_0x2280('0x36')]};return db[_0x2280('0x3c')][_0x2280('0x19')](_0x5dc66c)['then'](function(_0x11c81c){_0x3167e9[_0x2280('0x19')]=_0x11c81c;if(_0x2c3625[_0x2280('0x2b')][_0x2280('0x3d')]){_0xd67270['include']=[{'all':!![]}];}return db[_0x2280('0x3c')][_0x2280('0x3e')](_0xd67270);})['then'](function(_0x2c5246){_0x3167e9[_0x2280('0x3f')]=_0x2c5246;return _0x3167e9;})['then'](respondWithFilteredResult(_0x1164f7,_0xd67270))['catch'](handleError(_0x1164f7,null));};exports[_0x2280('0x40')]=function(_0x2ea004,_0x352ded){var _0x345a8e={'raw':![],'where':{'id':_0x2ea004[_0x2280('0x41')]['id']}},_0x16b0be={};_0x16b0be[_0x2280('0x2a')]=_[_0x2280('0x2c')](db['IntegrationReport']['rawAttributes']);_0x16b0be['query']=_[_0x2280('0x2c')](_0x2ea004['query']);_0x16b0be['filters']=_['intersection'](_0x16b0be[_0x2280('0x2a')],_0x16b0be[_0x2280('0x2b')]);_0x345a8e[_0x2280('0x30')]=_[_0x2280('0x2e')](_0x16b0be[_0x2280('0x2a')],qs[_0x2280('0x2f')](_0x2ea004['query']['fields']));_0x345a8e[_0x2280('0x30')]=_0x345a8e[_0x2280('0x30')][_0x2280('0x31')]?_0x345a8e[_0x2280('0x30')]:_0x16b0be[_0x2280('0x2a')];if(_0x2ea004[_0x2280('0x2b')][_0x2280('0x3d')]){_0x345a8e[_0x2280('0x42')]=[{'all':!![]}];}_0x345a8e=_['merge']({},_0x345a8e,_0x2ea004[_0x2280('0x3b')]);return db[_0x2280('0x3c')]['find'](_0x345a8e)[_0x2280('0x20')](handleEntityNotFound(_0x352ded,null))[_0x2280('0x20')](respondWithResult(_0x352ded,null))[_0x2280('0x43')](handleError(_0x352ded,null));};exports[_0x2280('0x44')]=function(_0x516e33,_0x3a311a){return db['IntegrationReport'][_0x2280('0x44')](_0x516e33['body'],{})['then'](respondWithResult(_0x3a311a,0xc9))['catch'](handleError(_0x3a311a,null));};exports[_0x2280('0x1f')]=function(_0x413b42,_0x3aaf32){if(_0x413b42[_0x2280('0x45')]['id']){delete _0x413b42['body']['id'];}return db[_0x2280('0x3c')][_0x2280('0x46')]({'where':{'id':_0x413b42[_0x2280('0x41')]['id']}})[_0x2280('0x20')](handleEntityNotFound(_0x3aaf32,null))[_0x2280('0x20')](saveUpdates(_0x413b42[_0x2280('0x45')],null))[_0x2280('0x20')](respondWithResult(_0x3aaf32,null))[_0x2280('0x43')](handleError(_0x3aaf32,null));};exports[_0x2280('0x21')]=function(_0x378976,_0xa9796b){return db[_0x2280('0x3c')][_0x2280('0x46')]({'where':{'id':_0x378976[_0x2280('0x41')]['id']}})[_0x2280('0x20')](handleEntityNotFound(_0xa9796b,null))['then'](removeEntity(_0xa9796b,null))[_0x2280('0x43')](handleError(_0xa9796b,null));};exports[_0x2280('0x47')]=function(_0x291d94,_0x556606){return db[_0x2280('0x3c')][_0x2280('0x47')]()[_0x2280('0x20')](respondWithResult(_0x556606,null))[_0x2280('0x43')](handleError(_0x556606,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 2dd0883..58658ff 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 _0x893f=['api','moment','bluebird','path','rimraf','../../config/environment','define','IntegrationReport','lodash','util','../../config/logger'];(function(_0x50f78f,_0xd0c2d8){var _0x369dfd=function(_0x37f3b2){while(--_0x37f3b2){_0x50f78f['push'](_0x50f78f['shift']());}};_0x369dfd(++_0xd0c2d8);}(_0x893f,0x1ec));var _0xf893=function(_0x331131,_0x4a691b){_0x331131=_0x331131-0x0;var _0x345d91=_0x893f[_0x331131];return _0x345d91;};'use strict';var _=require(_0xf893('0x0'));var util=require(_0xf893('0x1'));var logger=require(_0xf893('0x2'))(_0xf893('0x3'));var moment=require(_0xf893('0x4'));var BPromise=require(_0xf893('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf893('0x6'));var rimraf=require(_0xf893('0x7'));var config=require(_0xf893('0x8'));var attributes=require('./integrationReport.attributes');module['exports']=function(_0x2a7230,_0x3e3e93){return _0x2a7230[_0xf893('0x9')](_0xf893('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2dc=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','define','lodash','../../config/logger'];(function(_0x446694,_0x58ac42){var _0x358a3a=function(_0x43b171){while(--_0x43b171){_0x446694['push'](_0x446694['shift']());}};_0x358a3a(++_0x58ac42);}(_0xa2dc,0x174));var _0xca2d=function(_0x1fcf1b,_0x214549){_0x1fcf1b=_0x1fcf1b-0x0;var _0x5d2952=_0xa2dc[_0x1fcf1b];return _0x5d2952;};'use strict';var _=require(_0xca2d('0x0'));var util=require('util');var logger=require(_0xca2d('0x1'))(_0xca2d('0x2'));var moment=require(_0xca2d('0x3'));var BPromise=require(_0xca2d('0x4'));var rp=require(_0xca2d('0x5'));var fs=require('fs');var path=require(_0xca2d('0x6'));var rimraf=require(_0xca2d('0x7'));var config=require(_0xca2d('0x8'));var attributes=require(_0xca2d('0x9'));module['exports']=function(_0x1ecc1e,_0x4eacc8){return _0x1ecc1e[_0xca2d('0xa')]('IntegrationReport',attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index a6a785d..95401a3 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x35d59c,_0x4aa57e){var _0x55d5cc=function(_0x243c04){while(--_0x243c04){_0x35d59c['push'](_0x35d59c['shift']());}};_0x55d5cc(++_0x4aa57e);}(_0xadb5,0xad));var _0x5adb=function(_0x5fe739,_0x5aee8f){_0x5fe739=_0x5fe739-0x0;var _0x216f83=_0xadb5[_0x5fe739];return _0x216f83;};'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']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x24c811,_0x3bb49a){var _0x536236=function(_0x3d0f87){while(--_0x3d0f87){_0x24c811['push'](_0x24c811['shift']());}};_0x536236(++_0x3bb49a);}(_0x2ef3,0xba));var _0x32ef=function(_0x3bb2ff,_0x49ea68){_0x3bb2ff=_0x3bb2ff-0x0;var _0x2c9d51=_0x2ef3[_0x3bb2ff];return _0x2c9d51;};'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')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index f386d74..96c7ada 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 _0xbccd=['isAuthenticated','index','/:id','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get'];(function(_0x2cbf12,_0x2d5094){var _0x4930bb=function(_0x166446){while(--_0x166446){_0x2cbf12['push'](_0x2cbf12['shift']());}};_0x4930bb(++_0x2d5094);}(_0xbccd,0x1b0));var _0xdbcc=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xbccd[_0x2b5eae];return _0x5f3ac9;};'use strict';var multer=require(_0xdbcc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdbcc('0x1'));var express=require(_0xdbcc('0x2'));var router=express[_0xdbcc('0x3')]();var fs_extra=require(_0xdbcc('0x4'));var auth=require(_0xdbcc('0x5'));var interaction=require(_0xdbcc('0x6'));var config=require('../../config/environment');var controller=require(_0xdbcc('0x7'));router[_0xdbcc('0x8')]('/',auth[_0xdbcc('0x9')](),controller[_0xdbcc('0xa')]);router[_0xdbcc('0x8')](_0xdbcc('0xb'),auth[_0xdbcc('0x9')](),controller[_0xdbcc('0xc')]);router[_0xdbcc('0x8')](_0xdbcc('0xd'),auth[_0xdbcc('0x9')](),controller['getIntervals']);router['post']('/',auth[_0xdbcc('0x9')](),controller['create']);router[_0xdbcc('0xe')](_0xdbcc('0xd'),auth[_0xdbcc('0x9')](),controller[_0xdbcc('0xf')]);router[_0xdbcc('0xe')](_0xdbcc('0x10'),auth[_0xdbcc('0x9')](),controller['addIntervals']);router[_0xdbcc('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xdbcc('0x12')](_0xdbcc('0xb'),auth[_0xdbcc('0x9')](),controller[_0xdbcc('0x13')]);module[_0xdbcc('0x14')]=router; \ No newline at end of file +var _0xdced=['/:id/sub_intervals/create_many','addIntervals','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./interval.controller','get','index','/:id','isAuthenticated','show','getIntervals','post','/:id/sub_intervals','addInterval'];(function(_0x10dc94,_0x2fed4f){var _0x4a462d=function(_0x5181bd){while(--_0x5181bd){_0x10dc94['push'](_0x10dc94['shift']());}};_0x4a462d(++_0x2fed4f);}(_0xdced,0xcb));var _0xddce=function(_0xa3ffc1,_0x17f690){_0xa3ffc1=_0xa3ffc1-0x0;var _0x3d7ed6=_0xdced[_0xa3ffc1];return _0x3d7ed6;};'use strict';var multer=require('multer');var util=require(_0xddce('0x0'));var path=require(_0xddce('0x1'));var timeout=require(_0xddce('0x2'));var express=require(_0xddce('0x3'));var router=express[_0xddce('0x4')]();var fs_extra=require(_0xddce('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xddce('0x6'));var config=require('../../config/environment');var controller=require(_0xddce('0x7'));router[_0xddce('0x8')]('/',auth['isAuthenticated'](),controller[_0xddce('0x9')]);router['get'](_0xddce('0xa'),auth[_0xddce('0xb')](),controller[_0xddce('0xc')]);router[_0xddce('0x8')]('/:id/sub_intervals',auth[_0xddce('0xb')](),controller[_0xddce('0xd')]);router[_0xddce('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xddce('0xe')](_0xddce('0xf'),auth['isAuthenticated'](),controller[_0xddce('0x10')]);router[_0xddce('0xe')](_0xddce('0x11'),auth['isAuthenticated'](),controller[_0xddce('0x12')]);router['put'](_0xddce('0xa'),auth[_0xddce('0xb')](),controller[_0xddce('0x13')]);router[_0xddce('0x14')](_0xddce('0xa'),auth[_0xddce('0xb')](),controller[_0xddce('0x15')]);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 f1ba79d..2ce9a48 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 _0x55c0=['STRING','sequelize','exports'];(function(_0x5a636f,_0x3fec2b){var _0x6a8cfb=function(_0x20e6ca){while(--_0x20e6ca){_0x5a636f['push'](_0x5a636f['shift']());}};_0x6a8cfb(++_0x3fec2b);}(_0x55c0,0x79));var _0x055c=function(_0x174a2d,_0x44cf92){_0x174a2d=_0x174a2d-0x0;var _0x3a58c3=_0x55c0[_0x174a2d];return _0x3a58c3;};'use strict';var Sequelize=require(_0x055c('0x0'));module[_0x055c('0x1')]={'name':{'type':Sequelize[_0x055c('0x2')]},'description':{'type':Sequelize[_0x055c('0x2')]},'interval':{'type':Sequelize[_0x055c('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x63ef=['sequelize','STRING'];(function(_0x3947ac,_0x4b2f4a){var _0x34f828=function(_0x5add25){while(--_0x5add25){_0x3947ac['push'](_0x3947ac['shift']());}};_0x34f828(++_0x4b2f4a);}(_0x63ef,0x198));var _0xf63e=function(_0x3be7ff,_0x12e714){_0x3be7ff=_0x3be7ff-0x0;var _0x186721=_0x63ef[_0x3be7ff];return _0x186721;};'use strict';var Sequelize=require(_0xf63e('0x0'));module['exports']={'name':{'type':Sequelize[_0xf63e('0x1')]},'description':{'type':Sequelize[_0xf63e('0x1')]},'interval':{'type':Sequelize[_0xf63e('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 9756bea..e47c8ff 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 _0xf62a=['map','query','keys','attributes','intersection','fields','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','catch','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addInterval','IntervalId','getIntervals','findOne','length','options','hasOwnProperty','sequelize','bulkCreate','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/utils','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','index','Interval','rawAttributes','fieldName','type','key','model'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0xf62a,0x7f));var _0xaf62=function(_0x445890,_0x191ad2){_0x445890=_0x445890-0x0;var _0x47c4da=_0xf62a[_0x445890];return _0x47c4da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf62('0x0'));var zipdir=require(_0xaf62('0x1'));var jsonpatch=require(_0xaf62('0x2'));var rp=require('request-promise');var moment=require(_0xaf62('0x3'));var BPromise=require(_0xaf62('0x4'));var Mustache=require(_0xaf62('0x5'));var util=require(_0xaf62('0x6'));var path=require(_0xaf62('0x7'));var sox=require(_0xaf62('0x8'));var csv=require(_0xaf62('0x9'));var ejs=require(_0xaf62('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf62('0xb'));var squel=require('squel');var crypto=require(_0xaf62('0xc'));var jsforce=require(_0xaf62('0xd'));var deskjs=require(_0xaf62('0xe'));var toCsv=require(_0xaf62('0x9'));var querystring=require(_0xaf62('0xf'));var Papa=require(_0xaf62('0x10'));var Redis=require(_0xaf62('0x11'));var authService=require(_0xaf62('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xaf62('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xaf62('0x14'));var db=require(_0xaf62('0x15'))['db'];var extensions=require(_0xaf62('0x16'));function respondWithStatusCode(_0xa04fa3,_0x2059a4){_0x2059a4=_0x2059a4||0xcc;return function(_0x57d6a0){if(_0x57d6a0){return _0xa04fa3['sendStatus'](_0x2059a4);}return _0xa04fa3[_0xaf62('0x17')](_0x2059a4)['end']();};}function respondWithResult(_0x4b60ba,_0x29d206){_0x29d206=_0x29d206||0xc8;return function(_0x1ce18d){if(_0x1ce18d){return _0x4b60ba['status'](_0x29d206)[_0xaf62('0x18')](_0x1ce18d);}};}function respondWithFilteredResult(_0x1ecef1,_0x2a5822){return function(_0x3b010a){if(_0x3b010a){var _0x4e2dc0=typeof _0x2a5822[_0xaf62('0x19')]===_0xaf62('0x1a')&&typeof _0x2a5822[_0xaf62('0x1b')]===_0xaf62('0x1a');var _0x715be6=_0x3b010a[_0xaf62('0x1c')];var _0x543bb4=_0x4e2dc0?0x0:_0x2a5822[_0xaf62('0x19')];var _0x26fc84=_0x4e2dc0?_0x3b010a[_0xaf62('0x1c')]:_0x2a5822[_0xaf62('0x19')]+_0x2a5822[_0xaf62('0x1b')];var _0x1aaf1b;if(_0x26fc84>=_0x715be6){_0x26fc84=_0x715be6;_0x1aaf1b=0xc8;}else{_0x1aaf1b=0xce;}_0x1ecef1['status'](_0x1aaf1b);return _0x1ecef1['set'](_0xaf62('0x1d'),_0x543bb4+'-'+_0x26fc84+'/'+_0x715be6)[_0xaf62('0x18')](_0x3b010a);}return null;};}function patchUpdates(_0xa53e74){return function(_0x3947b0){try{jsonpatch[_0xaf62('0x1e')](_0x3947b0,_0xa53e74,!![]);}catch(_0x6d0be0){return BPromise[_0xaf62('0x1f')](_0x6d0be0);}return _0x3947b0[_0xaf62('0x20')]();};}function saveUpdates(_0x10984c,_0x9740a6){return function(_0x406f1f){if(_0x406f1f){return _0x406f1f[_0xaf62('0x21')](_0x10984c)[_0xaf62('0x22')](function(_0x1b418e){return _0x1b418e;});}return null;};}function removeEntity(_0x361178,_0x147165){return function(_0x4c7ae9){if(_0x4c7ae9){return _0x4c7ae9['destroy']()[_0xaf62('0x22')](function(){var _0x4fd728=_0x4c7ae9[_0xaf62('0x23')]({'plain':!![]});var _0x3c1d88='Intervals';return db[_0xaf62('0x24')][_0xaf62('0x25')]({'where':{'type':_0x3c1d88,'resourceId':_0x4fd728['id']}})[_0xaf62('0x22')](function(){return _0x4c7ae9;});})[_0xaf62('0x22')](function(){_0x361178['status'](0xcc)[_0xaf62('0x26')]();});}};}function handleEntityNotFound(_0x1b873e,_0x14679b){return function(_0x1ce622){if(!_0x1ce622){_0x1b873e[_0xaf62('0x27')](0x194);}return _0x1ce622;};}function handleError(_0x1f1062,_0xcf162c){_0xcf162c=_0xcf162c||0x1f4;return function(_0x22097f){logger[_0xaf62('0x28')](_0x22097f[_0xaf62('0x29')]);if(_0x22097f[_0xaf62('0x2a')]){delete _0x22097f[_0xaf62('0x2a')];}_0x1f1062['status'](_0xcf162c)[_0xaf62('0x2b')](_0x22097f);};}exports[_0xaf62('0x2c')]=function(_0x5a040a,_0x56c7fd){var _0x10c4c0={},_0x4ad149={},_0x30fcc7={'count':0x0,'rows':[]};var _0x27591b=_['map'](db[_0xaf62('0x2d')][_0xaf62('0x2e')],function(_0x2418df){return{'name':_0x2418df[_0xaf62('0x2f')],'type':_0x2418df[_0xaf62('0x30')][_0xaf62('0x31')]};});_0x4ad149[_0xaf62('0x32')]=_[_0xaf62('0x33')](_0x27591b,_0xaf62('0x2a'));_0x4ad149[_0xaf62('0x34')]=_[_0xaf62('0x35')](_0x5a040a[_0xaf62('0x34')]);_0x4ad149['filters']=_['intersection'](_0x4ad149['model'],_0x4ad149['query']);_0x10c4c0[_0xaf62('0x36')]=_[_0xaf62('0x37')](_0x4ad149[_0xaf62('0x32')],qs[_0xaf62('0x38')](_0x5a040a[_0xaf62('0x34')][_0xaf62('0x38')]));_0x10c4c0[_0xaf62('0x36')]=_0x10c4c0[_0xaf62('0x36')]['length']?_0x10c4c0['attributes']:_0x4ad149[_0xaf62('0x32')];if(!_0x5a040a[_0xaf62('0x34')]['hasOwnProperty'](_0xaf62('0x39'))){_0x10c4c0[_0xaf62('0x1b')]=qs[_0xaf62('0x1b')](_0x5a040a['query'][_0xaf62('0x1b')]);_0x10c4c0[_0xaf62('0x19')]=qs[_0xaf62('0x19')](_0x5a040a[_0xaf62('0x34')][_0xaf62('0x19')]);}_0x10c4c0[_0xaf62('0x3a')]=qs[_0xaf62('0x3b')](_0x5a040a[_0xaf62('0x34')][_0xaf62('0x3b')]);_0x10c4c0[_0xaf62('0x3c')]=qs[_0xaf62('0x3d')](_[_0xaf62('0x3e')](_0x5a040a[_0xaf62('0x34')],_0x4ad149[_0xaf62('0x3d')]),_0x27591b);if(_0x5a040a[_0xaf62('0x34')]['filter']){_0x10c4c0[_0xaf62('0x3c')]=_[_0xaf62('0x3f')](_0x10c4c0['where'],{'$or':_[_0xaf62('0x33')](_0x27591b,function(_0x41842b){if(_0x41842b['type']!==_0xaf62('0x40')){var _0x35d1f5={};_0x35d1f5[_0x41842b[_0xaf62('0x2a')]]={'$like':'%'+_0x5a040a[_0xaf62('0x34')][_0xaf62('0x41')]+'%'};return _0x35d1f5;}})});}_0x10c4c0=_[_0xaf62('0x3f')]({},_0x10c4c0,_0x5a040a['options']);var _0x2887ad={'where':_0x10c4c0['where']};return db[_0xaf62('0x2d')]['count'](_0x2887ad)[_0xaf62('0x22')](function(_0x19e760){_0x30fcc7['count']=_0x19e760;if(_0x5a040a[_0xaf62('0x34')][_0xaf62('0x42')]){_0x10c4c0['include']=[{'all':!![]}];}return db[_0xaf62('0x2d')]['findAll'](_0x10c4c0);})[_0xaf62('0x22')](function(_0x580e08){_0x30fcc7['rows']=_0x580e08;return _0x30fcc7;})[_0xaf62('0x22')](respondWithFilteredResult(_0x56c7fd,_0x10c4c0))[_0xaf62('0x43')](handleError(_0x56c7fd,null));};exports[_0xaf62('0x44')]=function(_0x212488,_0x5f9559){var _0x46f37a={'raw':!![],'where':{'id':_0x212488['params']['id']}},_0xf924f4={};_0xf924f4['model']=_[_0xaf62('0x35')](db[_0xaf62('0x2d')][_0xaf62('0x2e')]);_0xf924f4[_0xaf62('0x34')]=_[_0xaf62('0x35')](_0x212488[_0xaf62('0x34')]);_0xf924f4['filters']=_['intersection'](_0xf924f4['model'],_0xf924f4[_0xaf62('0x34')]);_0x46f37a['attributes']=_[_0xaf62('0x37')](_0xf924f4[_0xaf62('0x32')],qs[_0xaf62('0x38')](_0x212488[_0xaf62('0x34')][_0xaf62('0x38')]));_0x46f37a[_0xaf62('0x36')]=_0x46f37a[_0xaf62('0x36')]['length']?_0x46f37a['attributes']:_0xf924f4[_0xaf62('0x32')];if(_0x212488['query']['includeAll']){_0x46f37a['include']=[{'all':!![]}];}_0x46f37a=_['merge']({},_0x46f37a,_0x212488['options']);return db['Interval']['find'](_0x46f37a)['then'](handleEntityNotFound(_0x5f9559,null))[_0xaf62('0x22')](respondWithResult(_0x5f9559,null))['catch'](handleError(_0x5f9559,null));};exports[_0xaf62('0x45')]=function(_0x2a474b,_0x5dace2){return db[_0xaf62('0x2d')][_0xaf62('0x45')](_0x2a474b['body'],{})[_0xaf62('0x22')](function(_0x17fd37){var _0x226edb=_0x2a474b[_0xaf62('0x46')][_0xaf62('0x23')]({'plain':!![]});if(!_0x226edb)throw new Error(_0xaf62('0x47'));if(_0x226edb[_0xaf62('0x48')]===_0xaf62('0x46')){var _0x218710=_0x17fd37['get']({'plain':!![]});var _0x1d2c12=_0xaf62('0x49');return db[_0xaf62('0x4a')][_0xaf62('0x4b')]({'where':{'name':_0x1d2c12,'userProfileId':_0x226edb['userProfileId']},'raw':!![]})[_0xaf62('0x22')](function(_0x273fdf){if(_0x273fdf&&_0x273fdf[_0xaf62('0x4c')]===0x0){return db[_0xaf62('0x24')]['create']({'name':_0x218710['name'],'resourceId':_0x218710['id'],'type':_0x273fdf[_0xaf62('0x2a')],'sectionId':_0x273fdf['id']},{})[_0xaf62('0x22')](function(){return _0x17fd37;});}else{return _0x17fd37;}})[_0xaf62('0x43')](function(_0x527ff0){logger['error'](_0xaf62('0x4d'),_0x527ff0);throw _0x527ff0;});}return _0x17fd37;})[_0xaf62('0x22')](respondWithResult(_0x5dace2,0xc9))[_0xaf62('0x43')](handleError(_0x5dace2,null));};exports[_0xaf62('0x21')]=function(_0x5f1a22,_0x3b25fe){if(_0x5f1a22[_0xaf62('0x4e')]['id']){delete _0x5f1a22[_0xaf62('0x4e')]['id'];}return db[_0xaf62('0x2d')]['find']({'where':{'id':_0x5f1a22[_0xaf62('0x4f')]['id']}})[_0xaf62('0x22')](handleEntityNotFound(_0x3b25fe,null))[_0xaf62('0x22')](saveUpdates(_0x5f1a22[_0xaf62('0x4e')],null))['then'](respondWithResult(_0x3b25fe,null))[_0xaf62('0x43')](handleError(_0x3b25fe,null));};exports['destroy']=function(_0x2f9061,_0x5eb992){return db[_0xaf62('0x2d')][_0xaf62('0x4b')]({'where':{'id':_0x2f9061[_0xaf62('0x4f')]['id']}})[_0xaf62('0x22')](handleEntityNotFound(_0x5eb992,null))['then'](removeEntity(_0x5eb992,null))[_0xaf62('0x43')](handleError(_0x5eb992,null));};exports[_0xaf62('0x50')]=function(_0x4ef354,_0x6393f5,_0x8a51c){if(_0x4ef354[_0xaf62('0x4e')]['id']){delete _0x4ef354['body']['id'];}return db[_0xaf62('0x2d')]['find']({'where':{'id':_0x4ef354['params']['id']}})['then'](handleEntityNotFound(_0x6393f5,null))[_0xaf62('0x22')](function(_0x3bcd96){if(_0x3bcd96){_0x4ef354['body'][_0xaf62('0x51')]=_0x3bcd96['id'];return db[_0xaf62('0x2d')][_0xaf62('0x45')](_0x4ef354[_0xaf62('0x4e')]);}})[_0xaf62('0x22')](respondWithResult(_0x6393f5,null))[_0xaf62('0x43')](handleError(_0x6393f5,null));};exports[_0xaf62('0x52')]=function(_0x620e1a,_0x30f924,_0x2db04b){var _0x4f20bd={};var _0x1c4b65={};var _0x528beb;var _0x481333;return db[_0xaf62('0x2d')][_0xaf62('0x53')]({'where':{'id':_0x620e1a['params']['id']}})[_0xaf62('0x22')](handleEntityNotFound(_0x30f924,null))[_0xaf62('0x22')](function(_0x52fac2){if(_0x52fac2){_0x528beb=_0x52fac2;_0x1c4b65[_0xaf62('0x32')]=_[_0xaf62('0x35')](db[_0xaf62('0x2d')][_0xaf62('0x2e')]);_0x1c4b65[_0xaf62('0x34')]=_[_0xaf62('0x35')](_0x620e1a[_0xaf62('0x34')]);_0x1c4b65[_0xaf62('0x3d')]=_['intersection'](_0x1c4b65[_0xaf62('0x32')],_0x1c4b65[_0xaf62('0x34')]);_0x4f20bd['attributes']=_[_0xaf62('0x37')](_0x1c4b65[_0xaf62('0x32')],qs[_0xaf62('0x38')](_0x620e1a[_0xaf62('0x34')][_0xaf62('0x38')]));_0x4f20bd[_0xaf62('0x36')]=_0x4f20bd['attributes'][_0xaf62('0x54')]?_0x4f20bd[_0xaf62('0x36')]:_0x1c4b65['model'];_0x4f20bd['order']=qs[_0xaf62('0x3b')](_0x620e1a[_0xaf62('0x34')][_0xaf62('0x3b')]);_0x4f20bd['where']=qs[_0xaf62('0x3d')](_[_0xaf62('0x3e')](_0x620e1a['query'],_0x1c4b65[_0xaf62('0x3d')]));if(_0x620e1a[_0xaf62('0x34')]['filter']){_0x4f20bd['where']=_['merge'](_0x4f20bd[_0xaf62('0x3c')],{'$or':_[_0xaf62('0x33')](_0x4f20bd[_0xaf62('0x36')],function(_0x300a9a){var _0x421c5b={};_0x421c5b[_0x300a9a]={'$like':'%'+_0x620e1a[_0xaf62('0x34')][_0xaf62('0x41')]+'%'};return _0x421c5b;})});}_0x4f20bd=_[_0xaf62('0x3f')]({},_0x4f20bd,_0x620e1a[_0xaf62('0x55')]);return _0x528beb['getIntervals'](_0x4f20bd);}})[_0xaf62('0x22')](function(_0x548839){if(_0x548839){_0x481333=_0x548839[_0xaf62('0x54')];if(!_0x620e1a[_0xaf62('0x34')][_0xaf62('0x56')](_0xaf62('0x39'))){_0x4f20bd['limit']=qs[_0xaf62('0x1b')](_0x620e1a[_0xaf62('0x34')][_0xaf62('0x1b')]);_0x4f20bd[_0xaf62('0x19')]=qs[_0xaf62('0x19')](_0x620e1a[_0xaf62('0x34')][_0xaf62('0x19')]);}return _0x528beb['getIntervals'](_0x4f20bd);}})[_0xaf62('0x22')](function(_0x165e4d){if(_0x165e4d){return _0x165e4d?{'count':_0x481333,'rows':_0x165e4d}:null;}})['then'](respondWithResult(_0x30f924,null))[_0xaf62('0x43')](handleError(_0x30f924,null));};exports['addIntervals']=function(_0x3d3487,_0x584f76,_0x1084dd){return db['Interval'][_0xaf62('0x53')]({'where':{'id':_0x3d3487['params']['id']}})[_0xaf62('0x22')](handleEntityNotFound(_0x584f76,null))[_0xaf62('0x22')](function(_0x364e09){if(_0x364e09){return db[_0xaf62('0x57')]['transaction'](function(_0x40252d){return db[_0xaf62('0x2d')][_0xaf62('0x25')]({'where':{'IntervalId':_0x3d3487[_0xaf62('0x4f')]['id']},'transaction':_0x40252d})[_0xaf62('0x22')](function(_0x26a454){var _0x107aa5=_['map'](_0x3d3487['body'],function(_0x116e35){delete _0x116e35['id'];_0x116e35[_0xaf62('0x51')]=_0x3d3487[_0xaf62('0x4f')]['id'];return _0x116e35;});return db[_0xaf62('0x2d')][_0xaf62('0x58')](_0x107aa5,{'transaction':_0x40252d});});})[_0xaf62('0x22')](function(){return db[_0xaf62('0x2d')]['findAll']({'where':{'IntervalId':_0x3d3487[_0xaf62('0x4f')]['id']}});});}})[_0xaf62('0x22')](respondWithResult(_0x584f76,null))[_0xaf62('0x43')](handleError(_0x584f76,null));}; \ No newline at end of file +var _0x394d=['apply','save','destroy','then','get','Intervals','error','stack','name','send','index','Interval','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','findAll','rows','params','keys','include','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','catch','update','addInterval','IntervalId','getIntervals','findOne','pick','nolimit','addIntervals','sequelize','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x4d5696,_0xd1d510){var _0x3be99c=function(_0x4a7b13){while(--_0x4a7b13){_0x4d5696['push'](_0x4d5696['shift']());}};_0x3be99c(++_0xd1d510);}(_0x394d,0x156));var _0xd394=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x394d[_0x2c7618];return _0x5ce3f0;};'use strict';var emlformat=require(_0xd394('0x0'));var rimraf=require(_0xd394('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd394('0x2'));var rp=require(_0xd394('0x3'));var moment=require('moment');var BPromise=require(_0xd394('0x4'));var Mustache=require(_0xd394('0x5'));var util=require(_0xd394('0x6'));var path=require(_0xd394('0x7'));var sox=require(_0xd394('0x8'));var csv=require(_0xd394('0x9'));var ejs=require(_0xd394('0xa'));var fs=require('fs');var fs_extra=require(_0xd394('0xb'));var _=require(_0xd394('0xc'));var squel=require(_0xd394('0xd'));var crypto=require(_0xd394('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd394('0xf'));var toCsv=require(_0xd394('0x9'));var querystring=require(_0xd394('0x10'));var Papa=require(_0xd394('0x11'));var Redis=require(_0xd394('0x12'));var authService=require(_0xd394('0x13'));var qs=require(_0xd394('0x14'));var as=require(_0xd394('0x15'));var hardwareService=require(_0xd394('0x16'));var logger=require(_0xd394('0x17'))('api');var utils=require(_0xd394('0x18'));var config=require(_0xd394('0x19'));var licenseUtil=require(_0xd394('0x1a'));var db=require(_0xd394('0x1b'))['db'];var extensions=require(_0xd394('0x1c'));function respondWithStatusCode(_0x2385a9,_0x31482f){_0x31482f=_0x31482f||0xcc;return function(_0x2040cb){if(_0x2040cb){return _0x2385a9[_0xd394('0x1d')](_0x31482f);}return _0x2385a9[_0xd394('0x1e')](_0x31482f)[_0xd394('0x1f')]();};}function respondWithResult(_0x3569e6,_0x4be43f){_0x4be43f=_0x4be43f||0xc8;return function(_0x2f596f){if(_0x2f596f){return _0x3569e6[_0xd394('0x1e')](_0x4be43f)[_0xd394('0x20')](_0x2f596f);}};}function respondWithFilteredResult(_0x56d748,_0x5df36e){return function(_0x1b9dea){if(_0x1b9dea){var _0x37cd93=typeof _0x5df36e[_0xd394('0x21')]===_0xd394('0x22')&&typeof _0x5df36e[_0xd394('0x23')]==='undefined';var _0x336062=_0x1b9dea[_0xd394('0x24')];var _0x463fca=_0x37cd93?0x0:_0x5df36e[_0xd394('0x21')];var _0x26d116=_0x37cd93?_0x1b9dea['count']:_0x5df36e[_0xd394('0x21')]+_0x5df36e[_0xd394('0x23')];var _0x48d1c1;if(_0x26d116>=_0x336062){_0x26d116=_0x336062;_0x48d1c1=0xc8;}else{_0x48d1c1=0xce;}_0x56d748[_0xd394('0x1e')](_0x48d1c1);return _0x56d748[_0xd394('0x25')]('Content-Range',_0x463fca+'-'+_0x26d116+'/'+_0x336062)['json'](_0x1b9dea);}return null;};}function patchUpdates(_0x4fe555){return function(_0x378519){try{jsonpatch[_0xd394('0x26')](_0x378519,_0x4fe555,!![]);}catch(_0xf3c1c4){return BPromise['reject'](_0xf3c1c4);}return _0x378519[_0xd394('0x27')]();};}function saveUpdates(_0xc170a5,_0x54d074){return function(_0x324aee){if(_0x324aee){return _0x324aee['update'](_0xc170a5)['then'](function(_0x5f0376){return _0x5f0376;});}return null;};}function removeEntity(_0xde0044,_0x4c6952){return function(_0x226baf){if(_0x226baf){return _0x226baf[_0xd394('0x28')]()[_0xd394('0x29')](function(){var _0x20ea4f=_0x226baf[_0xd394('0x2a')]({'plain':!![]});var _0x22fa98=_0xd394('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x22fa98,'resourceId':_0x20ea4f['id']}})[_0xd394('0x29')](function(){return _0x226baf;});})['then'](function(){_0xde0044['status'](0xcc)[_0xd394('0x1f')]();});}};}function handleEntityNotFound(_0x23282d,_0x39eba5){return function(_0x1affa5){if(!_0x1affa5){_0x23282d[_0xd394('0x1d')](0x194);}return _0x1affa5;};}function handleError(_0xc265db,_0x14298c){_0x14298c=_0x14298c||0x1f4;return function(_0x37ccad){logger[_0xd394('0x2c')](_0x37ccad[_0xd394('0x2d')]);if(_0x37ccad[_0xd394('0x2e')]){delete _0x37ccad['name'];}_0xc265db['status'](_0x14298c)[_0xd394('0x2f')](_0x37ccad);};}exports[_0xd394('0x30')]=function(_0x5e1930,_0x129bc4){var _0x182d91={},_0x3d7e46={},_0x27b2ab={'count':0x0,'rows':[]};var _0x3a7963=_['map'](db[_0xd394('0x31')][_0xd394('0x32')],function(_0x4dc0bd){return{'name':_0x4dc0bd[_0xd394('0x33')],'type':_0x4dc0bd[_0xd394('0x34')][_0xd394('0x35')]};});_0x3d7e46[_0xd394('0x36')]=_[_0xd394('0x37')](_0x3a7963,_0xd394('0x2e'));_0x3d7e46[_0xd394('0x38')]=_['keys'](_0x5e1930['query']);_0x3d7e46[_0xd394('0x39')]=_['intersection'](_0x3d7e46[_0xd394('0x36')],_0x3d7e46['query']);_0x182d91[_0xd394('0x3a')]=_[_0xd394('0x3b')](_0x3d7e46['model'],qs[_0xd394('0x3c')](_0x5e1930[_0xd394('0x38')][_0xd394('0x3c')]));_0x182d91[_0xd394('0x3a')]=_0x182d91[_0xd394('0x3a')][_0xd394('0x3d')]?_0x182d91['attributes']:_0x3d7e46[_0xd394('0x36')];if(!_0x5e1930[_0xd394('0x38')][_0xd394('0x3e')]('nolimit')){_0x182d91['limit']=qs[_0xd394('0x23')](_0x5e1930[_0xd394('0x38')]['limit']);_0x182d91[_0xd394('0x21')]=qs[_0xd394('0x21')](_0x5e1930[_0xd394('0x38')][_0xd394('0x21')]);}_0x182d91[_0xd394('0x3f')]=qs[_0xd394('0x40')](_0x5e1930[_0xd394('0x38')][_0xd394('0x40')]);_0x182d91[_0xd394('0x41')]=qs[_0xd394('0x39')](_['pick'](_0x5e1930[_0xd394('0x38')],_0x3d7e46[_0xd394('0x39')]),_0x3a7963);if(_0x5e1930[_0xd394('0x38')][_0xd394('0x42')]){_0x182d91[_0xd394('0x41')]=_[_0xd394('0x43')](_0x182d91[_0xd394('0x41')],{'$or':_[_0xd394('0x37')](_0x3a7963,function(_0xb3a571){if(_0xb3a571[_0xd394('0x34')]!=='VIRTUAL'){var _0x55f185={};_0x55f185[_0xb3a571[_0xd394('0x2e')]]={'$like':'%'+_0x5e1930[_0xd394('0x38')][_0xd394('0x42')]+'%'};return _0x55f185;}})});}_0x182d91=_[_0xd394('0x43')]({},_0x182d91,_0x5e1930[_0xd394('0x44')]);var _0x34d82a={'where':_0x182d91['where']};return db[_0xd394('0x31')][_0xd394('0x24')](_0x34d82a)[_0xd394('0x29')](function(_0x31cbb2){_0x27b2ab[_0xd394('0x24')]=_0x31cbb2;if(_0x5e1930[_0xd394('0x38')][_0xd394('0x45')]){_0x182d91['include']=[{'all':!![]}];}return db[_0xd394('0x31')][_0xd394('0x46')](_0x182d91);})[_0xd394('0x29')](function(_0x497180){_0x27b2ab[_0xd394('0x47')]=_0x497180;return _0x27b2ab;})[_0xd394('0x29')](respondWithFilteredResult(_0x129bc4,_0x182d91))['catch'](handleError(_0x129bc4,null));};exports['show']=function(_0x37e355,_0x2ea20c){var _0x4d5b6f={'raw':!![],'where':{'id':_0x37e355[_0xd394('0x48')]['id']}},_0x4c52bd={};_0x4c52bd[_0xd394('0x36')]=_[_0xd394('0x49')](db[_0xd394('0x31')][_0xd394('0x32')]);_0x4c52bd['query']=_[_0xd394('0x49')](_0x37e355[_0xd394('0x38')]);_0x4c52bd[_0xd394('0x39')]=_[_0xd394('0x3b')](_0x4c52bd[_0xd394('0x36')],_0x4c52bd[_0xd394('0x38')]);_0x4d5b6f[_0xd394('0x3a')]=_[_0xd394('0x3b')](_0x4c52bd['model'],qs[_0xd394('0x3c')](_0x37e355[_0xd394('0x38')][_0xd394('0x3c')]));_0x4d5b6f[_0xd394('0x3a')]=_0x4d5b6f[_0xd394('0x3a')]['length']?_0x4d5b6f[_0xd394('0x3a')]:_0x4c52bd['model'];if(_0x37e355[_0xd394('0x38')][_0xd394('0x45')]){_0x4d5b6f[_0xd394('0x4a')]=[{'all':!![]}];}_0x4d5b6f=_[_0xd394('0x43')]({},_0x4d5b6f,_0x37e355[_0xd394('0x44')]);return db[_0xd394('0x31')]['find'](_0x4d5b6f)[_0xd394('0x29')](handleEntityNotFound(_0x2ea20c,null))[_0xd394('0x29')](respondWithResult(_0x2ea20c,null))['catch'](handleError(_0x2ea20c,null));};exports[_0xd394('0x4b')]=function(_0x4bdddf,_0x5de8c4){return db[_0xd394('0x31')]['create'](_0x4bdddf[_0xd394('0x4c')],{})[_0xd394('0x29')](function(_0x8f1f8b){var _0x3f427a=_0x4bdddf[_0xd394('0x4d')]['get']({'plain':!![]});if(!_0x3f427a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f427a[_0xd394('0x4e')]===_0xd394('0x4d')){var _0x4e53e1=_0x8f1f8b[_0xd394('0x2a')]({'plain':!![]});var _0x4e6659=_0xd394('0x2b');return db[_0xd394('0x4f')][_0xd394('0x50')]({'where':{'name':_0x4e6659,'userProfileId':_0x3f427a[_0xd394('0x51')]},'raw':!![]})[_0xd394('0x29')](function(_0x13d000){if(_0x13d000&&_0x13d000[_0xd394('0x52')]===0x0){return db[_0xd394('0x53')][_0xd394('0x4b')]({'name':_0x4e53e1[_0xd394('0x2e')],'resourceId':_0x4e53e1['id'],'type':_0x13d000[_0xd394('0x2e')],'sectionId':_0x13d000['id']},{})['then'](function(){return _0x8f1f8b;});}else{return _0x8f1f8b;}})['catch'](function(_0x3c96a4){logger[_0xd394('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c96a4);throw _0x3c96a4;});}return _0x8f1f8b;})[_0xd394('0x29')](respondWithResult(_0x5de8c4,0xc9))[_0xd394('0x54')](handleError(_0x5de8c4,null));};exports[_0xd394('0x55')]=function(_0x268e35,_0x4e26c4){if(_0x268e35['body']['id']){delete _0x268e35[_0xd394('0x4c')]['id'];}return db['Interval'][_0xd394('0x50')]({'where':{'id':_0x268e35[_0xd394('0x48')]['id']}})['then'](handleEntityNotFound(_0x4e26c4,null))[_0xd394('0x29')](saveUpdates(_0x268e35[_0xd394('0x4c')],null))[_0xd394('0x29')](respondWithResult(_0x4e26c4,null))[_0xd394('0x54')](handleError(_0x4e26c4,null));};exports['destroy']=function(_0x3907e7,_0x1706a0){return db['Interval']['find']({'where':{'id':_0x3907e7[_0xd394('0x48')]['id']}})[_0xd394('0x29')](handleEntityNotFound(_0x1706a0,null))[_0xd394('0x29')](removeEntity(_0x1706a0,null))[_0xd394('0x54')](handleError(_0x1706a0,null));};exports[_0xd394('0x56')]=function(_0x304691,_0x5d0fe0,_0x3da7b8){if(_0x304691['body']['id']){delete _0x304691['body']['id'];}return db[_0xd394('0x31')][_0xd394('0x50')]({'where':{'id':_0x304691[_0xd394('0x48')]['id']}})[_0xd394('0x29')](handleEntityNotFound(_0x5d0fe0,null))[_0xd394('0x29')](function(_0xd6dc3f){if(_0xd6dc3f){_0x304691[_0xd394('0x4c')][_0xd394('0x57')]=_0xd6dc3f['id'];return db[_0xd394('0x31')][_0xd394('0x4b')](_0x304691[_0xd394('0x4c')]);}})[_0xd394('0x29')](respondWithResult(_0x5d0fe0,null))[_0xd394('0x54')](handleError(_0x5d0fe0,null));};exports[_0xd394('0x58')]=function(_0x20b5a4,_0x53678c,_0x1f983e){var _0x5bc4d7={};var _0x3a6421={};var _0x310dde;var _0x242588;return db[_0xd394('0x31')][_0xd394('0x59')]({'where':{'id':_0x20b5a4['params']['id']}})[_0xd394('0x29')](handleEntityNotFound(_0x53678c,null))[_0xd394('0x29')](function(_0x5e1287){if(_0x5e1287){_0x310dde=_0x5e1287;_0x3a6421['model']=_['keys'](db[_0xd394('0x31')][_0xd394('0x32')]);_0x3a6421[_0xd394('0x38')]=_[_0xd394('0x49')](_0x20b5a4[_0xd394('0x38')]);_0x3a6421[_0xd394('0x39')]=_[_0xd394('0x3b')](_0x3a6421[_0xd394('0x36')],_0x3a6421['query']);_0x5bc4d7[_0xd394('0x3a')]=_[_0xd394('0x3b')](_0x3a6421[_0xd394('0x36')],qs[_0xd394('0x3c')](_0x20b5a4[_0xd394('0x38')][_0xd394('0x3c')]));_0x5bc4d7[_0xd394('0x3a')]=_0x5bc4d7[_0xd394('0x3a')][_0xd394('0x3d')]?_0x5bc4d7[_0xd394('0x3a')]:_0x3a6421[_0xd394('0x36')];_0x5bc4d7[_0xd394('0x3f')]=qs[_0xd394('0x40')](_0x20b5a4['query'][_0xd394('0x40')]);_0x5bc4d7[_0xd394('0x41')]=qs['filters'](_[_0xd394('0x5a')](_0x20b5a4[_0xd394('0x38')],_0x3a6421['filters']));if(_0x20b5a4[_0xd394('0x38')][_0xd394('0x42')]){_0x5bc4d7[_0xd394('0x41')]=_[_0xd394('0x43')](_0x5bc4d7[_0xd394('0x41')],{'$or':_[_0xd394('0x37')](_0x5bc4d7['attributes'],function(_0x2d1fad){var _0x1517d4={};_0x1517d4[_0x2d1fad]={'$like':'%'+_0x20b5a4[_0xd394('0x38')][_0xd394('0x42')]+'%'};return _0x1517d4;})});}_0x5bc4d7=_['merge']({},_0x5bc4d7,_0x20b5a4['options']);return _0x310dde[_0xd394('0x58')](_0x5bc4d7);}})[_0xd394('0x29')](function(_0x144b4b){if(_0x144b4b){_0x242588=_0x144b4b['length'];if(!_0x20b5a4['query'][_0xd394('0x3e')](_0xd394('0x5b'))){_0x5bc4d7[_0xd394('0x23')]=qs['limit'](_0x20b5a4[_0xd394('0x38')][_0xd394('0x23')]);_0x5bc4d7[_0xd394('0x21')]=qs[_0xd394('0x21')](_0x20b5a4[_0xd394('0x38')][_0xd394('0x21')]);}return _0x310dde['getIntervals'](_0x5bc4d7);}})[_0xd394('0x29')](function(_0x926065){if(_0x926065){return _0x926065?{'count':_0x242588,'rows':_0x926065}:null;}})['then'](respondWithResult(_0x53678c,null))['catch'](handleError(_0x53678c,null));};exports[_0xd394('0x5c')]=function(_0x1c2ed9,_0x2b09b1,_0x4f87d9){return db[_0xd394('0x31')][_0xd394('0x59')]({'where':{'id':_0x1c2ed9['params']['id']}})[_0xd394('0x29')](handleEntityNotFound(_0x2b09b1,null))[_0xd394('0x29')](function(_0x43bb5d){if(_0x43bb5d){return db[_0xd394('0x5d')]['transaction'](function(_0x40afab){return db[_0xd394('0x31')][_0xd394('0x28')]({'where':{'IntervalId':_0x1c2ed9[_0xd394('0x48')]['id']},'transaction':_0x40afab})['then'](function(_0x1070f1){var _0x457ceb=_[_0xd394('0x37')](_0x1c2ed9[_0xd394('0x4c')],function(_0x1d1f31){delete _0x1d1f31['id'];_0x1d1f31[_0xd394('0x57')]=_0x1c2ed9[_0xd394('0x48')]['id'];return _0x1d1f31;});return db[_0xd394('0x31')][_0xd394('0x5e')](_0x457ceb,{'transaction':_0x40afab});});})[_0xd394('0x29')](function(){return db[_0xd394('0x31')][_0xd394('0x46')]({'where':{'IntervalId':_0x1c2ed9[_0xd394('0x48')]['id']}});});}})[_0xd394('0x29')](respondWithResult(_0x2b09b1,null))[_0xd394('0x54')](handleError(_0x2b09b1,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 091a268..1070ecd 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 _0xe501=['Interval','tools_intervals','rewrite','interval','string','getIntervals','then','map','reduce','./interval.attributes','../../utils/iftime','define'];(function(_0x1941fa,_0x2d487e){var _0x4a2d4e=function(_0x52b787){while(--_0x52b787){_0x1941fa['push'](_0x1941fa['shift']());}};_0x4a2d4e(++_0x2d487e);}(_0xe501,0x159));var _0x1e50=function(_0x5da0e9,_0x43c898){_0x5da0e9=_0x5da0e9-0x0;var _0x4b022d=_0xe501[_0x5da0e9];return _0x4b022d;};'use strict';var attributes=require(_0x1e50('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require(_0x1e50('0x1'))['iftime'];module['exports']=function(_0x11bf0b){return _0x11bf0b[_0x1e50('0x2')](_0x1e50('0x3'),attributes,{'tableName':_0x1e50('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b2115){extensions[_0x1e50('0x5')](_0x11bf0b,_0x3b2115);},'afterBulkCreate':function(_0x76cfec,_0x323508,_0x4c8033){_0x4c8033();extensions[_0x1e50('0x5')](_0x11bf0b,_0x76cfec[0x0]);},'afterUpdate':function(_0x2de337){extensions[_0x1e50('0x5')](_0x11bf0b,_0x2de337);},'afterDestroy':function(_0x3910ed){extensions[_0x1e50('0x5')](_0x11bf0b,_0x3910ed);}},'instanceMethods':{'ifTime':function(_0x1a8ce8=undefined,_0x1352e0=new Date()){if(typeof this[_0x1e50('0x6')]===_0x1e50('0x7')){return iftime(this[_0x1e50('0x6')],_0x1a8ce8,_0x1352e0);}else{return this[_0x1e50('0x8')]()[_0x1e50('0x9')](function(_0x109843){return Promise['all'](_0x109843[_0x1e50('0xa')](function(_0x19f9b2){return _0x19f9b2['ifTime'](_0x1a8ce8,_0x1352e0);}));})['then'](function(_0x473ff3){return _0x473ff3[_0x1e50('0xb')](function(_0x1eea1f,_0x13ba42){return _0x1eea1f||_0x13ba42;},![]);});}}}});}; \ No newline at end of file +var _0x7cdb=['interval','string','getIntervals','all','map','ifTime','then','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define','Interval','tools_intervals','rewrite'];(function(_0x267335,_0x378e44){var _0x201607=function(_0xc23b53){while(--_0xc23b53){_0x267335['push'](_0x267335['shift']());}};_0x201607(++_0x378e44);}(_0x7cdb,0x14b));var _0xb7cd=function(_0x460096,_0x255d37){_0x460096=_0x460096-0x0;var _0x24fc3c=_0x7cdb[_0x460096];return _0x24fc3c;};'use strict';var attributes=require(_0xb7cd('0x0'));var extensions=require(_0xb7cd('0x1'));var iftime=require(_0xb7cd('0x2'))[_0xb7cd('0x3')];module[_0xb7cd('0x4')]=function(_0x2e80c3){return _0x2e80c3[_0xb7cd('0x5')](_0xb7cd('0x6'),attributes,{'tableName':_0xb7cd('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2777a5){extensions[_0xb7cd('0x8')](_0x2e80c3,_0x2777a5);},'afterBulkCreate':function(_0x7e61e9,_0xfe1859,_0x5ddbe5){_0x5ddbe5();extensions[_0xb7cd('0x8')](_0x2e80c3,_0x7e61e9[0x0]);},'afterUpdate':function(_0x1cd2d0){extensions[_0xb7cd('0x8')](_0x2e80c3,_0x1cd2d0);},'afterDestroy':function(_0x1c4e16){extensions['rewrite'](_0x2e80c3,_0x1c4e16);}},'instanceMethods':{'ifTime':function(_0x24c4f9=undefined,_0xd11b44=new Date()){if(typeof this[_0xb7cd('0x9')]===_0xb7cd('0xa')){return iftime(this[_0xb7cd('0x9')],_0x24c4f9,_0xd11b44);}else{return this[_0xb7cd('0xb')]()['then'](function(_0xe12582){return Promise[_0xb7cd('0xc')](_0xe12582[_0xb7cd('0xd')](function(_0x1510fa){return _0x1510fa[_0xb7cd('0xe')](_0x24c4f9,_0xd11b44);}));})[_0xb7cd('0xf')](function(_0x2e74df){return _0x2e74df[_0xb7cd('0x10')](function(_0x25877b,_0x58b145){return _0x25877b||_0x58b145;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index e2b7b6c..fd1da47 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 _0xdc9c=['lodash','util','../../mysqldb','iftime','../../config/logger','rpc','Interval','findAll','options','attributes','limit','include','map','model','info','GetInterval','debug','catch','error','message','ShowInterval','find','raw','where','then','all','ifTime','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','intervalIds','intervals','string','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','IntervalIftime','resolve','isArray','reduce'];(function(_0x1f69bc,_0xaffd71){var _0x1ac3c5=function(_0x3cd005){while(--_0x3cd005){_0x1f69bc['push'](_0x1f69bc['shift']());}};_0x1ac3c5(++_0xaffd71);}(_0xdc9c,0x1ef));var _0xcdc9=function(_0x276345,_0x36c12a){_0x276345=_0x276345-0x0;var _0x32556=_0xdc9c[_0x276345];return _0x32556;};'use strict';var _=require(_0xcdc9('0x0'));var util=require(_0xcdc9('0x1'));var db=require(_0xcdc9('0x2'))['db'];var iftime=require('../../utils/iftime')[_0xcdc9('0x3')];var logger=require(_0xcdc9('0x4'))(_0xcdc9('0x5'));exports['GetInterval']=function(_0x5f3f6c){var _0x1fc037=this;return new Promise(function(_0x129cdc,_0x371802){return db[_0xcdc9('0x6')][_0xcdc9('0x7')]({'raw':_0x5f3f6c['options']?_0x5f3f6c[_0xcdc9('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x5f3f6c[_0xcdc9('0x8')]?_0x5f3f6c['options']['where']||null:null,'attributes':_0x5f3f6c['options']?_0x5f3f6c[_0xcdc9('0x8')][_0xcdc9('0x9')]||null:null,'limit':_0x5f3f6c[_0xcdc9('0x8')]?_0x5f3f6c['options'][_0xcdc9('0xa')]||null:null,'include':_0x5f3f6c[_0xcdc9('0x8')]?_0x5f3f6c[_0xcdc9('0x8')][_0xcdc9('0xb')]?_[_0xcdc9('0xc')](_0x5f3f6c[_0xcdc9('0x8')][_0xcdc9('0xb')],function(_0x52ea64){return{'model':db[_0x52ea64[_0xcdc9('0xd')]],'as':_0x52ea64['as'],'attributes':_0x52ea64[_0xcdc9('0x9')],'include':_0x52ea64['include']?_[_0xcdc9('0xc')](_0x52ea64[_0xcdc9('0xb')],function(_0x10a714){return{'model':db[_0x10a714[_0xcdc9('0xd')]],'as':_0x10a714['as'],'attributes':_0x10a714[_0xcdc9('0x9')],'include':_0x10a714[_0xcdc9('0xb')]?_['map'](_0x10a714[_0xcdc9('0xb')],function(_0x134228){return{'model':db[_0x134228[_0xcdc9('0xd')]],'as':_0x134228['as'],'attributes':_0x134228[_0xcdc9('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3059f7){logger[_0xcdc9('0xe')](_0xcdc9('0xf'),_0x5f3f6c);logger[_0xcdc9('0x10')](_0xcdc9('0xf'),_0x5f3f6c,JSON['stringify'](_0x3059f7));_0x129cdc(_0x3059f7);})[_0xcdc9('0x11')](function(_0x509e01){logger[_0xcdc9('0x12')](_0xcdc9('0xf'),_0x509e01[_0xcdc9('0x13')],_0x5f3f6c);_0x371802(_0x1fc037[_0xcdc9('0x12')](0x1f4,_0x509e01[_0xcdc9('0x13')]));});});};exports[_0xcdc9('0x14')]=function(_0x2bd3a6){var _0x30ff83=this;return new Promise(function(_0x136789,_0x3f5b07){return db[_0xcdc9('0x6')][_0xcdc9('0x15')]({'raw':_0x2bd3a6[_0xcdc9('0x8')]?_0x2bd3a6[_0xcdc9('0x8')][_0xcdc9('0x16')]===undefined?!![]:![]:!![],'where':_0x2bd3a6[_0xcdc9('0x8')]?_0x2bd3a6[_0xcdc9('0x8')][_0xcdc9('0x17')]||null:null,'attributes':_0x2bd3a6[_0xcdc9('0x8')]?_0x2bd3a6[_0xcdc9('0x8')]['attributes']||null:null,'include':_0x2bd3a6[_0xcdc9('0x8')]?_0x2bd3a6[_0xcdc9('0x8')][_0xcdc9('0xb')]?_[_0xcdc9('0xc')](_0x2bd3a6[_0xcdc9('0x8')]['include'],function(_0x1d1bb3){return{'model':db[_0x1d1bb3[_0xcdc9('0xd')]],'as':_0x1d1bb3['as'],'attributes':_0x1d1bb3[_0xcdc9('0x9')],'include':_0x1d1bb3[_0xcdc9('0xb')]?_[_0xcdc9('0xc')](_0x1d1bb3[_0xcdc9('0xb')],function(_0x28ef6d){return{'model':db[_0x28ef6d[_0xcdc9('0xd')]],'as':_0x28ef6d['as'],'attributes':_0x28ef6d[_0xcdc9('0x9')],'include':_0x28ef6d['include']?_[_0xcdc9('0xc')](_0x28ef6d[_0xcdc9('0xb')],function(_0x3b3fbc){return{'model':db[_0x3b3fbc[_0xcdc9('0xd')]],'as':_0x3b3fbc['as'],'attributes':_0x3b3fbc['attributes']};}):[]};}):[]};}):[]:[]})[_0xcdc9('0x18')](function(_0x5197d2){logger['info'](_0xcdc9('0x14'),_0x2bd3a6);logger['debug']('ShowInterval',_0x2bd3a6,JSON['stringify'](_0x5197d2));_0x136789(_0x5197d2);})[_0xcdc9('0x11')](function(_0xa3fbae){logger[_0xcdc9('0x12')]('ShowInterval',_0xa3fbae[_0xcdc9('0x13')],_0x2bd3a6);_0x3f5b07(_0x30ff83[_0xcdc9('0x12')](0x1f4,_0xa3fbae[_0xcdc9('0x13')]));});});};function checkArrayOfIntervals(_0x495b5e,_0x25940f){var _0x111a7c=[];return db[_0xcdc9('0x6')][_0xcdc9('0x7')]({'where':{'id':_0x495b5e}})['then'](function(_0x1010c3){_0x111a7c=_0x1010c3;return Promise[_0xcdc9('0x19')](_0x111a7c['map'](function(_0x549971){return _0x549971[_0xcdc9('0x1a')](_0x25940f);}));})[_0xcdc9('0x18')](function(_0x4eb421){var _0xcfd53d=_0x4eb421['reduce'](function(_0x38bec7,_0x5853e5){return _0x38bec7||_0x5853e5;},![]);logger[_0xcdc9('0xe')](util[_0xcdc9('0x1b')](_0xcdc9('0x1c'),_0x111a7c[_0xcdc9('0xc')](function(_0xb7310b){return _0xb7310b['name'];})[_0xcdc9('0x1d')](',\x20'),_0x111a7c[_0xcdc9('0xc')](function(_0x1ff814){return _0x1ff814['id'];})[_0xcdc9('0x1d')](',\x20')));return _0xcfd53d;});}function checkSingleInterval(_0x2f5322,_0x5e4f00){return db[_0xcdc9('0x6')][_0xcdc9('0x1e')](_0x2f5322)[_0xcdc9('0x18')](function(_0x2ad3c4){if(_0x2ad3c4){logger['info'](util['format'](_0xcdc9('0x1f'),_0x2ad3c4[_0xcdc9('0x20')],_0x2ad3c4['id']));return _0x2ad3c4[_0xcdc9('0x1a')](_0x5e4f00);}});}exports['IntervalIftime']=function(_0x1d6a90){var _0x4cc21a=_0x1d6a90[_0xcdc9('0x21')];var _0xde126f=Array['isArray'](_0x1d6a90['intervals'])?_0x1d6a90['intervals']:typeof _0x1d6a90[_0xcdc9('0x22')]===_0xcdc9('0x23')?[_0x1d6a90[_0xcdc9('0x22')]]:[];var _0x5039a1=_0x1d6a90['timezone']||undefined;var _0x2a6a09=![];if(_0xde126f[_0xcdc9('0x24')]){logger['info'](util[_0xcdc9('0x1b')](_0xcdc9('0x25'),_0xde126f[_0xcdc9('0x1d')](';\x20')));}if(_0x5039a1){logger['info'](util[_0xcdc9('0x1b')](_0xcdc9('0x26'),_0x5039a1));}logger['debug'](_0xcdc9('0x27'),_0x2a6a09);logger[_0xcdc9('0x28')](_0xcdc9('0x29'),_0x1d6a90);return Promise[_0xcdc9('0x2a')]()[_0xcdc9('0x18')](function(){if(Array[_0xcdc9('0x2b')](_0x4cc21a)){return checkArrayOfIntervals(_0x4cc21a,_0x5039a1);}else if(_0x4cc21a){return checkSingleInterval(_0x4cc21a,_0x5039a1);}})[_0xcdc9('0x18')](function(_0x361104){var _0x548fc1=_0xde126f[_0xcdc9('0x2c')](function(_0x2c2dc4,_0x347f2f){return _0x2c2dc4||iftime(_0x347f2f,_0x5039a1);},![]);_0x2a6a09=_0x361104||_0x548fc1;return _0x2a6a09;})[_0xcdc9('0x11')](function(_0x32ea1b){logger['error'](_0xcdc9('0x29'),_0x1d6a90,_0x32ea1b);throw this[_0xcdc9('0x12')](0x1f4,_0x32ea1b[_0xcdc9('0x13')]);});}; \ No newline at end of file +var _0xff03=['util','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','where','attributes','limit','include','model','map','then','info','debug','stringify','catch','error','find','ShowInterval','message','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)','ifTime','IntervalIftime','intervalIds','isArray','intervals','string','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','silly','lodash'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xff03,0x133));var _0x3ff0=function(_0x120746,_0xcd81b7){_0x120746=_0x120746-0x0;var _0x1de0e6=_0xff03[_0x120746];return _0x1de0e6;};'use strict';var _=require(_0x3ff0('0x0'));var util=require(_0x3ff0('0x1'));var db=require('../../mysqldb')['db'];var iftime=require(_0x3ff0('0x2'))[_0x3ff0('0x3')];var logger=require(_0x3ff0('0x4'))(_0x3ff0('0x5'));exports[_0x3ff0('0x6')]=function(_0x1a7c9d){var _0x216876=this;return new Promise(function(_0x2f253d,_0x27d78e){return db[_0x3ff0('0x7')][_0x3ff0('0x8')]({'raw':_0x1a7c9d[_0x3ff0('0x9')]?_0x1a7c9d[_0x3ff0('0x9')][_0x3ff0('0xa')]===undefined?!![]:![]:!![],'where':_0x1a7c9d[_0x3ff0('0x9')]?_0x1a7c9d['options'][_0x3ff0('0xb')]||null:null,'attributes':_0x1a7c9d['options']?_0x1a7c9d[_0x3ff0('0x9')][_0x3ff0('0xc')]||null:null,'limit':_0x1a7c9d[_0x3ff0('0x9')]?_0x1a7c9d['options'][_0x3ff0('0xd')]||null:null,'include':_0x1a7c9d[_0x3ff0('0x9')]?_0x1a7c9d[_0x3ff0('0x9')][_0x3ff0('0xe')]?_['map'](_0x1a7c9d[_0x3ff0('0x9')]['include'],function(_0x5b8df5){return{'model':db[_0x5b8df5[_0x3ff0('0xf')]],'as':_0x5b8df5['as'],'attributes':_0x5b8df5[_0x3ff0('0xc')],'include':_0x5b8df5['include']?_[_0x3ff0('0x10')](_0x5b8df5[_0x3ff0('0xe')],function(_0x44ad87){return{'model':db[_0x44ad87[_0x3ff0('0xf')]],'as':_0x44ad87['as'],'attributes':_0x44ad87['attributes'],'include':_0x44ad87[_0x3ff0('0xe')]?_['map'](_0x44ad87[_0x3ff0('0xe')],function(_0x5ed98c){return{'model':db[_0x5ed98c[_0x3ff0('0xf')]],'as':_0x5ed98c['as'],'attributes':_0x5ed98c[_0x3ff0('0xc')]};}):[]};}):[]};}):[]:[]})[_0x3ff0('0x11')](function(_0x545a94){logger[_0x3ff0('0x12')](_0x3ff0('0x6'),_0x1a7c9d);logger[_0x3ff0('0x13')](_0x3ff0('0x6'),_0x1a7c9d,JSON[_0x3ff0('0x14')](_0x545a94));_0x2f253d(_0x545a94);})[_0x3ff0('0x15')](function(_0x2f9432){logger[_0x3ff0('0x16')](_0x3ff0('0x6'),_0x2f9432['message'],_0x1a7c9d);_0x27d78e(_0x216876['error'](0x1f4,_0x2f9432['message']));});});};exports['ShowInterval']=function(_0x465880){var _0x20bc19=this;return new Promise(function(_0x4dd60e,_0x3a0d24){return db[_0x3ff0('0x7')][_0x3ff0('0x17')]({'raw':_0x465880[_0x3ff0('0x9')]?_0x465880[_0x3ff0('0x9')][_0x3ff0('0xa')]===undefined?!![]:![]:!![],'where':_0x465880['options']?_0x465880[_0x3ff0('0x9')]['where']||null:null,'attributes':_0x465880[_0x3ff0('0x9')]?_0x465880[_0x3ff0('0x9')][_0x3ff0('0xc')]||null:null,'include':_0x465880[_0x3ff0('0x9')]?_0x465880[_0x3ff0('0x9')]['include']?_[_0x3ff0('0x10')](_0x465880[_0x3ff0('0x9')]['include'],function(_0x4a0255){return{'model':db[_0x4a0255[_0x3ff0('0xf')]],'as':_0x4a0255['as'],'attributes':_0x4a0255[_0x3ff0('0xc')],'include':_0x4a0255['include']?_['map'](_0x4a0255['include'],function(_0x3a03a1){return{'model':db[_0x3a03a1['model']],'as':_0x3a03a1['as'],'attributes':_0x3a03a1[_0x3ff0('0xc')],'include':_0x3a03a1['include']?_[_0x3ff0('0x10')](_0x3a03a1[_0x3ff0('0xe')],function(_0x56aa90){return{'model':db[_0x56aa90[_0x3ff0('0xf')]],'as':_0x56aa90['as'],'attributes':_0x56aa90['attributes']};}):[]};}):[]};}):[]:[]})[_0x3ff0('0x11')](function(_0xf5a85){logger[_0x3ff0('0x12')](_0x3ff0('0x18'),_0x465880);logger[_0x3ff0('0x13')](_0x3ff0('0x18'),_0x465880,JSON[_0x3ff0('0x14')](_0xf5a85));_0x4dd60e(_0xf5a85);})[_0x3ff0('0x15')](function(_0x322573){logger[_0x3ff0('0x16')](_0x3ff0('0x18'),_0x322573['message'],_0x465880);_0x3a0d24(_0x20bc19[_0x3ff0('0x16')](0x1f4,_0x322573[_0x3ff0('0x19')]));});});};function checkArrayOfIntervals(_0x2f209d,_0x518738){var _0x1d112d=[];return db[_0x3ff0('0x7')][_0x3ff0('0x8')]({'where':{'id':_0x2f209d}})[_0x3ff0('0x11')](function(_0x262638){_0x1d112d=_0x262638;return Promise[_0x3ff0('0x1a')](_0x1d112d['map'](function(_0x127400){return _0x127400['ifTime'](_0x518738);}));})['then'](function(_0x889a83){var _0x5fae85=_0x889a83[_0x3ff0('0x1b')](function(_0x45421d,_0x5eb7b9){return _0x45421d||_0x5eb7b9;},![]);logger[_0x3ff0('0x12')](util[_0x3ff0('0x1c')](_0x3ff0('0x1d'),_0x1d112d['map'](function(_0x1e96b4){return _0x1e96b4[_0x3ff0('0x1e')];})['join'](',\x20'),_0x1d112d[_0x3ff0('0x10')](function(_0x4c76e6){return _0x4c76e6['id'];})[_0x3ff0('0x1f')](',\x20')));return _0x5fae85;});}function checkSingleInterval(_0x7a8e06,_0x32e4ee){return db[_0x3ff0('0x7')][_0x3ff0('0x20')](_0x7a8e06)[_0x3ff0('0x11')](function(_0xebfe9c){if(_0xebfe9c){logger[_0x3ff0('0x12')](util['format'](_0x3ff0('0x21'),_0xebfe9c[_0x3ff0('0x1e')],_0xebfe9c['id']));return _0xebfe9c[_0x3ff0('0x22')](_0x32e4ee);}});}exports[_0x3ff0('0x23')]=function(_0x557426){var _0x2110f3=_0x557426[_0x3ff0('0x24')];var _0x2607e4=Array[_0x3ff0('0x25')](_0x557426[_0x3ff0('0x26')])?_0x557426['intervals']:typeof _0x557426[_0x3ff0('0x26')]===_0x3ff0('0x27')?[_0x557426['intervals']]:[];var _0x2eff29=_0x557426['timezone']||undefined;var _0x4f0eee=![];if(_0x2607e4[_0x3ff0('0x28')]){logger[_0x3ff0('0x12')](util[_0x3ff0('0x1c')](_0x3ff0('0x29'),_0x2607e4[_0x3ff0('0x1f')](';\x20')));}if(_0x2eff29){logger[_0x3ff0('0x12')](util[_0x3ff0('0x1c')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x2eff29));}logger[_0x3ff0('0x13')](_0x3ff0('0x2a'),_0x4f0eee);logger[_0x3ff0('0x2b')]('IntervalIftime',_0x557426);return Promise['resolve']()[_0x3ff0('0x11')](function(){if(Array[_0x3ff0('0x25')](_0x2110f3)){return checkArrayOfIntervals(_0x2110f3,_0x2eff29);}else if(_0x2110f3){return checkSingleInterval(_0x2110f3,_0x2eff29);}})[_0x3ff0('0x11')](function(_0x4a5e6e){var _0xbd5540=_0x2607e4[_0x3ff0('0x1b')](function(_0x15c370,_0x5c6137){return _0x15c370||iftime(_0x5c6137,_0x2eff29);},![]);_0x4f0eee=_0x4a5e6e||_0xbd5540;return _0x4f0eee;})[_0x3ff0('0x15')](function(_0x108093){logger[_0x3ff0('0x16')](_0x3ff0('0x23'),_0x557426,_0x108093);throw this[_0x3ff0('0x16')](0x1f4,_0x108093['message']);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 11c05b6..46a3451 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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x0b0e,0x187));var _0xe0b0=function(_0x40df5f,_0x8fd59f){_0x40df5f=_0x40df5f-0x0;var _0x1573f1=_0x0b0e[_0x40df5f];return _0x1573f1;};'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(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'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 37f2950..d69fd76 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 _0x4fb9=['stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','name','customfield_11504','reason','track.xcallymotion.com','application/json','Basic\x20','base64','request','setEncoding','data','end','status','json','error','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description'];(function(_0x3aed47,_0x4b2c52){var _0x212915=function(_0x51c019){while(--_0x51c019){_0x3aed47['push'](_0x3aed47['shift']());}};_0x212915(++_0x4b2c52);}(_0x4fb9,0xa9));var _0x94fb=function(_0x36bf89,_0x5e8983){_0x36bf89=_0x36bf89-0x0;var _0x1fad99=_0x4fb9[_0x36bf89];return _0x1fad99;};'use strict';var BPromise=require(_0x94fb('0x0'));var https=require(_0x94fb('0x1'));var logger=require(_0x94fb('0x2'))(_0x94fb('0x3'));var USERNAME='support';var PASSWORD=_0x94fb('0x4');function openIssue(_0x13546d,_0x36ae61){var _0x4fd4e3={'fields':{'project':{'key':_0x13546d[_0x94fb('0x5')]||_0x94fb('0x6')},'summary':(_0x13546d[_0x94fb('0x7')]||_0x94fb('0x8'))+_0x94fb('0x9')+_0x13546d['ip'],'description':_0x13546d[_0x94fb('0xa')]||JSON[_0x94fb('0xb')](_0x13546d),'issuetype':{'name':_0x13546d[_0x94fb('0xc')]||_0x94fb('0xd')}}};_0x4fd4e3[_0x94fb('0xe')][_0x94fb('0xf')]=_0x13546d[_0x94fb('0x10')];_0x4fd4e3[_0x94fb('0xe')][_0x94fb('0x11')]=_0x13546d[_0x94fb('0x12')];_0x4fd4e3['fields'][_0x94fb('0x13')]=_0x13546d[_0x94fb('0x14')];_0x4fd4e3[_0x94fb('0xe')]['customfield_11503']=_0x13546d[_0x94fb('0x15')];_0x4fd4e3[_0x94fb('0xe')][_0x94fb('0x16')]=_0x13546d[_0x94fb('0x17')];_0x4fd4e3[_0x94fb('0xe')]['customfield_10102']=_0x13546d['ip'];var _0x1f9042={'host':_0x94fb('0x18'),'port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x94fb('0x19'),'Authorization':_0x94fb('0x1a')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x94fb('0x1b'))}};var _0x5142da=JSON[_0x94fb('0xb')](_0x4fd4e3);var _0x4fcbdd=https[_0x94fb('0x1c')](_0x1f9042,function(_0x2b7126){_0x2b7126[_0x94fb('0x1d')]('utf8');var _0x3a2840='';_0x2b7126['on'](_0x94fb('0x1e'),function(_0x4c8661){_0x3a2840+=_0x4c8661;});_0x2b7126['on'](_0x94fb('0x1f'),function(){if(_0x36ae61){return _0x36ae61[_0x94fb('0x20')](_0x2b7126['statusCode'])[_0x94fb('0x21')](JSON['parse'](_0x3a2840));}});});_0x4fcbdd['on'](_0x94fb('0x22'),function(_0x3b5033){if(_0x36ae61){return _0x36ae61[_0x94fb('0x20')](0x1f4)[_0x94fb('0x21')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x94fb('0x23')}]});}});_0x4fcbdd[_0x94fb('0x24')](_0x5142da);_0x4fcbdd[_0x94fb('0x1f')]();}exports[_0x94fb('0x25')]=openIssue;exports[_0x94fb('0x26')]=function(_0x51c3e8,_0x1b48e3){_0x51c3e8[_0x94fb('0x27')]['ip']=_0x51c3e8[_0x94fb('0x28')][_0x94fb('0x29')]||_0x51c3e8[_0x94fb('0x2a')][_0x94fb('0x2b')]||_0x51c3e8[_0x94fb('0x2c')]['remoteAddress']||_0x51c3e8[_0x94fb('0x2a')][_0x94fb('0x2c')][_0x94fb('0x2b')];return openIssue(_0x51c3e8['body'],_0x1b48e3);}; \ No newline at end of file +var _0xfbf4=['remoteAddress','body','bluebird','https','../../config/logger','api','support','MOTGUI','summary','Report','\x20from\x20','stringify','Bug','fields','email','customfield_11501','oldToken','customfield_11503','name','reason','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','utf8','data','statusCode','json','parse','error','status','api.jira','write','openIssue','send','x-forwarded-for','socket','connection'];(function(_0x1ded8d,_0x2cc8ad){var _0x116c74=function(_0x2dc1ba){while(--_0x2dc1ba){_0x1ded8d['push'](_0x1ded8d['shift']());}};_0x116c74(++_0x2cc8ad);}(_0xfbf4,0xf8));var _0x4fbf=function(_0x4bd0cf,_0x2c270f){_0x4bd0cf=_0x4bd0cf-0x0;var _0x43c6bd=_0xfbf4[_0x4bd0cf];return _0x43c6bd;};'use strict';var BPromise=require(_0x4fbf('0x0'));var https=require(_0x4fbf('0x1'));var logger=require(_0x4fbf('0x2'))(_0x4fbf('0x3'));var USERNAME=_0x4fbf('0x4');var PASSWORD='3eAmWpBVP0';function openIssue(_0x4748c3,_0x2461c9){var _0x4cca2a={'fields':{'project':{'key':_0x4748c3['key']||_0x4fbf('0x5')},'summary':(_0x4748c3[_0x4fbf('0x6')]||_0x4fbf('0x7'))+_0x4fbf('0x8')+_0x4748c3['ip'],'description':_0x4748c3['description']||JSON[_0x4fbf('0x9')](_0x4748c3),'issuetype':{'name':_0x4748c3['issuetype']||_0x4fbf('0xa')}}};_0x4cca2a[_0x4fbf('0xb')]['customfield_11500']=_0x4748c3[_0x4fbf('0xc')];_0x4cca2a['fields'][_0x4fbf('0xd')]=_0x4748c3[_0x4fbf('0xe')];_0x4cca2a['fields']['customfield_11502']=_0x4748c3['newToken'];_0x4cca2a[_0x4fbf('0xb')][_0x4fbf('0xf')]=_0x4748c3[_0x4fbf('0x10')];_0x4cca2a['fields']['customfield_11504']=_0x4748c3[_0x4fbf('0x11')];_0x4cca2a[_0x4fbf('0xb')]['customfield_10102']=_0x4748c3['ip'];var _0x2f0f15={'host':_0x4fbf('0x12'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x4fbf('0x13'),'timeout':0x4e20,'headers':{'Content-Type':_0x4fbf('0x14'),'Authorization':_0x4fbf('0x15')+new Buffer(USERNAME+':'+PASSWORD)[_0x4fbf('0x16')](_0x4fbf('0x17'))}};var _0x47c72c=JSON[_0x4fbf('0x9')](_0x4cca2a);var _0x2dd57a=https[_0x4fbf('0x18')](_0x2f0f15,function(_0x527953){_0x527953['setEncoding'](_0x4fbf('0x19'));var _0x255075='';_0x527953['on'](_0x4fbf('0x1a'),function(_0x35ffd6){_0x255075+=_0x35ffd6;});_0x527953['on']('end',function(){if(_0x2461c9){return _0x2461c9['status'](_0x527953[_0x4fbf('0x1b')])[_0x4fbf('0x1c')](JSON[_0x4fbf('0x1d')](_0x255075));}});});_0x2dd57a['on'](_0x4fbf('0x1e'),function(_0x89d50b){if(_0x2461c9){return _0x2461c9[_0x4fbf('0x1f')](0x1f4)[_0x4fbf('0x1c')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x4fbf('0x20')}]});}});_0x2dd57a[_0x4fbf('0x21')](_0x47c72c);_0x2dd57a['end']();}exports[_0x4fbf('0x22')]=openIssue;exports[_0x4fbf('0x23')]=function(_0x1da20e,_0x38d8f7){_0x1da20e['body']['ip']=_0x1da20e['headers'][_0x4fbf('0x24')]||_0x1da20e['connection']['remoteAddress']||_0x1da20e[_0x4fbf('0x25')]['remoteAddress']||_0x1da20e[_0x4fbf('0x26')][_0x4fbf('0x25')][_0x4fbf('0x27')];return openIssue(_0x1da20e[_0x4fbf('0x28')],_0x38d8f7);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 169531b..05c6323 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 _0xb58b=['get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./jscriptyAnswerReport.controller'];(function(_0x565450,_0x29fa41){var _0x3cd8d7=function(_0x44d5c9){while(--_0x44d5c9){_0x565450['push'](_0x565450['shift']());}};_0x3cd8d7(++_0x29fa41);}(_0xb58b,0x1f1));var _0xbb58=function(_0x17f81f,_0x5717aa){_0x17f81f=_0x17f81f-0x0;var _0x4d9350=_0xb58b[_0x17f81f];return _0x4d9350;};'use strict';var multer=require('multer');var util=require(_0xbb58('0x0'));var path=require(_0xbb58('0x1'));var timeout=require(_0xbb58('0x2'));var express=require('express');var router=express[_0xbb58('0x3')]();var fs_extra=require(_0xbb58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbb58('0x5'));var config=require('../../config/environment');var controller=require(_0xbb58('0x6'));router[_0xbb58('0x7')]('/',auth[_0xbb58('0x8')](),controller['index']);router[_0xbb58('0x7')](_0xbb58('0x9'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xa')]);router[_0xbb58('0x7')](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xc')]);router[_0xbb58('0xd')]('/',auth[_0xbb58('0x8')](),controller[_0xbb58('0xe')]);router['put'](_0xbb58('0xb'),auth['isAuthenticated'](),controller[_0xbb58('0xf')]);router[_0xbb58('0x10')](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller['destroy']);module[_0xbb58('0x11')]=router; \ No newline at end of file +var _0x0a9a=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','update','destroy','util','connect-timeout','express'];(function(_0x1ca637,_0x1f28f9){var _0x396e8a=function(_0x17bc55){while(--_0x17bc55){_0x1ca637['push'](_0x1ca637['shift']());}};_0x396e8a(++_0x1f28f9);}(_0x0a9a,0x183));var _0xa0a9=function(_0x4143ec,_0x3cd8c3){_0x4143ec=_0x4143ec-0x0;var _0x46fcf4=_0x0a9a[_0x4143ec];return _0x46fcf4;};'use strict';var multer=require('multer');var util=require(_0xa0a9('0x0'));var path=require('path');var timeout=require(_0xa0a9('0x1'));var express=require(_0xa0a9('0x2'));var router=express[_0xa0a9('0x3')]();var fs_extra=require(_0xa0a9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa0a9('0x5'));var config=require(_0xa0a9('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0xa0a9('0x7')]('/',auth[_0xa0a9('0x8')](),controller[_0xa0a9('0x9')]);router[_0xa0a9('0x7')]('/describe',auth[_0xa0a9('0x8')](),controller['describe']);router[_0xa0a9('0x7')](_0xa0a9('0xa'),auth[_0xa0a9('0x8')](),controller[_0xa0a9('0xb')]);router['post']('/',auth[_0xa0a9('0x8')](),controller[_0xa0a9('0xc')]);router['put']('/:id',auth[_0xa0a9('0x8')](),controller[_0xa0a9('0xd')]);router['delete'](_0xa0a9('0xa'),auth['isAuthenticated'](),controller[_0xa0a9('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 0f34fe5..865731e 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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7a54,0x106));var _0x47a5=function(_0x50f7a0,_0x231ad5){_0x50f7a0=_0x50f7a0-0x0;var _0xfc99a5=_0x7a54[_0x50f7a0];return _0xfc99a5;};'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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x7a54,0x106));var _0x47a5=function(_0x48b4dd,_0x18fc21){_0x48b4dd=_0x48b4dd-0x0;var _0x14617e=_0x7a54[_0x48b4dd];return _0x14617e;};'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 084836f..700187d 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 _0x8ca9=['show','params','rawAttributes','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','reject','save','then','destroy','sendStatus','stack','index','map','JscriptyAnswerReport','type','key','name','keys','filters','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','catch'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x8ca9,0x9c));var _0x98ca=function(_0x3bfc0,_0x5873c1){_0x3bfc0=_0x3bfc0-0x0;var _0x3aa15f=_0x8ca9[_0x3bfc0];return _0x3aa15f;};'use strict';var emlformat=require(_0x98ca('0x0'));var rimraf=require(_0x98ca('0x1'));var zipdir=require(_0x98ca('0x2'));var jsonpatch=require(_0x98ca('0x3'));var rp=require(_0x98ca('0x4'));var moment=require(_0x98ca('0x5'));var BPromise=require(_0x98ca('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x98ca('0x7'));var sox=require('sox');var csv=require(_0x98ca('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x98ca('0x9'));var _=require(_0x98ca('0xa'));var squel=require(_0x98ca('0xb'));var crypto=require(_0x98ca('0xc'));var jsforce=require(_0x98ca('0xd'));var deskjs=require(_0x98ca('0xe'));var toCsv=require(_0x98ca('0x8'));var querystring=require(_0x98ca('0xf'));var Papa=require(_0x98ca('0x10'));var Redis=require(_0x98ca('0x11'));var authService=require(_0x98ca('0x12'));var qs=require(_0x98ca('0x13'));var as=require(_0x98ca('0x14'));var hardwareService=require(_0x98ca('0x15'));var logger=require(_0x98ca('0x16'))(_0x98ca('0x17'));var utils=require(_0x98ca('0x18'));var config=require(_0x98ca('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x98ca('0x1a'))['db'];function respondWithStatusCode(_0x44b65b,_0xba3887){_0xba3887=_0xba3887||0xcc;return function(_0x472e13){if(_0x472e13){return _0x44b65b['sendStatus'](_0xba3887);}return _0x44b65b[_0x98ca('0x1b')](_0xba3887)[_0x98ca('0x1c')]();};}function respondWithResult(_0x9a230e,_0xa2bab4){_0xa2bab4=_0xa2bab4||0xc8;return function(_0x3df0ef){if(_0x3df0ef){return _0x9a230e[_0x98ca('0x1b')](_0xa2bab4)[_0x98ca('0x1d')](_0x3df0ef);}};}function respondWithFilteredResult(_0x4940ca,_0x330713){return function(_0x29df1b){if(_0x29df1b){var _0x29f46b=typeof _0x330713[_0x98ca('0x1e')]==='undefined'&&typeof _0x330713[_0x98ca('0x1f')]===_0x98ca('0x20');var _0xe9f8ad=_0x29df1b[_0x98ca('0x21')];var _0x4523bb=_0x29f46b?0x0:_0x330713[_0x98ca('0x1e')];var _0x28c8a6=_0x29f46b?_0x29df1b[_0x98ca('0x21')]:_0x330713[_0x98ca('0x1e')]+_0x330713[_0x98ca('0x1f')];var _0x1b2c69;if(_0x28c8a6>=_0xe9f8ad){_0x28c8a6=_0xe9f8ad;_0x1b2c69=0xc8;}else{_0x1b2c69=0xce;}_0x4940ca['status'](_0x1b2c69);return _0x4940ca[_0x98ca('0x22')]('Content-Range',_0x4523bb+'-'+_0x28c8a6+'/'+_0xe9f8ad)[_0x98ca('0x1d')](_0x29df1b);}return null;};}function patchUpdates(_0x2fe568){return function(_0x50f8b4){try{jsonpatch['apply'](_0x50f8b4,_0x2fe568,!![]);}catch(_0x4620e3){return BPromise[_0x98ca('0x23')](_0x4620e3);}return _0x50f8b4[_0x98ca('0x24')]();};}function saveUpdates(_0x519927,_0x2f7742){return function(_0xc23332){if(_0xc23332){return _0xc23332['update'](_0x519927)[_0x98ca('0x25')](function(_0x5dc400){return _0x5dc400;});}return null;};}function removeEntity(_0x3fd0bd,_0x323cdb){return function(_0x430d16){if(_0x430d16){return _0x430d16[_0x98ca('0x26')]()[_0x98ca('0x25')](function(){_0x3fd0bd[_0x98ca('0x1b')](0xcc)[_0x98ca('0x1c')]();});}};}function handleEntityNotFound(_0x50b1a2,_0x2029cb){return function(_0x4fc3c9){if(!_0x4fc3c9){_0x50b1a2[_0x98ca('0x27')](0x194);}return _0x4fc3c9;};}function handleError(_0x1bdb75,_0x5eb829){_0x5eb829=_0x5eb829||0x1f4;return function(_0x1f569b){logger['error'](_0x1f569b[_0x98ca('0x28')]);if(_0x1f569b['name']){delete _0x1f569b['name'];}_0x1bdb75[_0x98ca('0x1b')](_0x5eb829)['send'](_0x1f569b);};}exports[_0x98ca('0x29')]=function(_0x35b920,_0x13f766){var _0x21a12a={},_0x3b3e60={},_0x1e7fcf={'count':0x0,'rows':[]};var _0x11389a=_[_0x98ca('0x2a')](db[_0x98ca('0x2b')]['rawAttributes'],function(_0x2ebf28){return{'name':_0x2ebf28['fieldName'],'type':_0x2ebf28[_0x98ca('0x2c')][_0x98ca('0x2d')]};});_0x3b3e60['model']=_['map'](_0x11389a,_0x98ca('0x2e'));_0x3b3e60['query']=_[_0x98ca('0x2f')](_0x35b920['query']);_0x3b3e60[_0x98ca('0x30')]=_['intersection'](_0x3b3e60[_0x98ca('0x31')],_0x3b3e60[_0x98ca('0x32')]);_0x21a12a['attributes']=_[_0x98ca('0x33')](_0x3b3e60[_0x98ca('0x31')],qs['fields'](_0x35b920[_0x98ca('0x32')][_0x98ca('0x34')]));_0x21a12a['attributes']=_0x21a12a[_0x98ca('0x35')][_0x98ca('0x36')]?_0x21a12a[_0x98ca('0x35')]:_0x3b3e60[_0x98ca('0x31')];if(!_0x35b920[_0x98ca('0x32')]['hasOwnProperty'](_0x98ca('0x37'))){_0x21a12a[_0x98ca('0x1f')]=qs['limit'](_0x35b920[_0x98ca('0x32')][_0x98ca('0x1f')]);_0x21a12a[_0x98ca('0x1e')]=qs['offset'](_0x35b920[_0x98ca('0x32')][_0x98ca('0x1e')]);}_0x21a12a[_0x98ca('0x38')]=qs['sort'](_0x35b920[_0x98ca('0x32')][_0x98ca('0x39')]);_0x21a12a[_0x98ca('0x3a')]=qs['filters'](_['pick'](_0x35b920[_0x98ca('0x32')],_0x3b3e60[_0x98ca('0x30')]),_0x11389a);if(_0x35b920[_0x98ca('0x32')]['filter']){_0x21a12a[_0x98ca('0x3a')]=_[_0x98ca('0x3b')](_0x21a12a[_0x98ca('0x3a')],{'$or':_['map'](_0x11389a,function(_0x1f513b){if(_0x1f513b[_0x98ca('0x2c')]!==_0x98ca('0x3c')){var _0x450745={};_0x450745[_0x1f513b[_0x98ca('0x2e')]]={'$like':'%'+_0x35b920['query']['filter']+'%'};return _0x450745;}})});}_0x21a12a=_['merge']({},_0x21a12a,_0x35b920[_0x98ca('0x3d')]);var _0x2ef2f4={'where':_0x21a12a[_0x98ca('0x3a')]};return db[_0x98ca('0x2b')][_0x98ca('0x21')](_0x2ef2f4)[_0x98ca('0x25')](function(_0x29801f){_0x1e7fcf['count']=_0x29801f;if(_0x35b920['query'][_0x98ca('0x3e')]){_0x21a12a[_0x98ca('0x3f')]=[{'all':!![]}];}return db[_0x98ca('0x2b')][_0x98ca('0x40')](_0x21a12a);})[_0x98ca('0x25')](function(_0x535fdc){_0x1e7fcf['rows']=_0x535fdc;return _0x1e7fcf;})['then'](respondWithFilteredResult(_0x13f766,_0x21a12a))[_0x98ca('0x41')](handleError(_0x13f766,null));};exports[_0x98ca('0x42')]=function(_0x914606,_0x3f260b){var _0x4ede34={'raw':!![],'where':{'id':_0x914606[_0x98ca('0x43')]['id']}},_0x4c2515={};_0x4c2515[_0x98ca('0x31')]=_[_0x98ca('0x2f')](db[_0x98ca('0x2b')][_0x98ca('0x44')]);_0x4c2515[_0x98ca('0x32')]=_[_0x98ca('0x2f')](_0x914606[_0x98ca('0x32')]);_0x4c2515[_0x98ca('0x30')]=_[_0x98ca('0x33')](_0x4c2515[_0x98ca('0x31')],_0x4c2515['query']);_0x4ede34[_0x98ca('0x35')]=_[_0x98ca('0x33')](_0x4c2515[_0x98ca('0x31')],qs[_0x98ca('0x34')](_0x914606[_0x98ca('0x32')][_0x98ca('0x34')]));_0x4ede34[_0x98ca('0x35')]=_0x4ede34[_0x98ca('0x35')][_0x98ca('0x36')]?_0x4ede34['attributes']:_0x4c2515[_0x98ca('0x31')];if(_0x914606[_0x98ca('0x32')]['includeAll']){_0x4ede34[_0x98ca('0x3f')]=[{'all':!![]}];}_0x4ede34=_['merge']({},_0x4ede34,_0x914606[_0x98ca('0x3d')]);return db[_0x98ca('0x2b')][_0x98ca('0x45')](_0x4ede34)[_0x98ca('0x25')](handleEntityNotFound(_0x3f260b,null))[_0x98ca('0x25')](respondWithResult(_0x3f260b,null))[_0x98ca('0x41')](handleError(_0x3f260b,null));};exports[_0x98ca('0x46')]=function(_0x15ed74,_0x2c7d53){return db[_0x98ca('0x2b')][_0x98ca('0x46')](_0x15ed74[_0x98ca('0x47')],{})['then'](respondWithResult(_0x2c7d53,0xc9))[_0x98ca('0x41')](handleError(_0x2c7d53,null));};exports[_0x98ca('0x48')]=function(_0x40498f,_0x19dc39){if(_0x40498f['body']['id']){delete _0x40498f[_0x98ca('0x47')]['id'];}return db[_0x98ca('0x2b')][_0x98ca('0x45')]({'where':{'id':_0x40498f[_0x98ca('0x43')]['id']}})[_0x98ca('0x25')](handleEntityNotFound(_0x19dc39,null))[_0x98ca('0x25')](saveUpdates(_0x40498f[_0x98ca('0x47')],null))['then'](respondWithResult(_0x19dc39,null))['catch'](handleError(_0x19dc39,null));};exports['destroy']=function(_0x3247af,_0x3715cb){return db[_0x98ca('0x2b')][_0x98ca('0x45')]({'where':{'id':_0x3247af['params']['id']}})['then'](handleEntityNotFound(_0x3715cb,null))[_0x98ca('0x25')](removeEntity(_0x3715cb,null))[_0x98ca('0x41')](handleError(_0x3715cb,null));};exports[_0x98ca('0x49')]=function(_0x408266,_0x46bb13){return db[_0x98ca('0x2b')][_0x98ca('0x49')]()[_0x98ca('0x25')](respondWithResult(_0x46bb13,null))[_0x98ca('0x41')](handleError(_0x46bb13,null));}; \ No newline at end of file +var _0xf006=['fieldName','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','destroy','describe','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes'];(function(_0x2e3107,_0x25f970){var _0x833d69=function(_0x420e78){while(--_0x420e78){_0x2e3107['push'](_0x2e3107['shift']());}};_0x833d69(++_0x25f970);}(_0xf006,0x146));var _0x6f00=function(_0x487510,_0x6fa22e){_0x487510=_0x487510-0x0;var _0x21c61f=_0xf006[_0x487510];return _0x21c61f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6f00('0x0'));var jsonpatch=require(_0x6f00('0x1'));var rp=require('request-promise');var moment=require(_0x6f00('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6f00('0x3'));var util=require('util');var path=require('path');var sox=require(_0x6f00('0x4'));var csv=require(_0x6f00('0x5'));var ejs=require(_0x6f00('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f00('0x7'));var squel=require('squel');var crypto=require(_0x6f00('0x8'));var jsforce=require(_0x6f00('0x9'));var deskjs=require(_0x6f00('0xa'));var toCsv=require(_0x6f00('0x5'));var querystring=require(_0x6f00('0xb'));var Papa=require(_0x6f00('0xc'));var Redis=require(_0x6f00('0xd'));var authService=require(_0x6f00('0xe'));var qs=require(_0x6f00('0xf'));var as=require(_0x6f00('0x10'));var hardwareService=require(_0x6f00('0x11'));var logger=require(_0x6f00('0x12'))(_0x6f00('0x13'));var utils=require('../../config/utils');var config=require(_0x6f00('0x14'));var licenseUtil=require(_0x6f00('0x15'));var db=require(_0x6f00('0x16'))['db'];function respondWithStatusCode(_0x36a2ec,_0x289fe9){_0x289fe9=_0x289fe9||0xcc;return function(_0x5e3264){if(_0x5e3264){return _0x36a2ec[_0x6f00('0x17')](_0x289fe9);}return _0x36a2ec['status'](_0x289fe9)[_0x6f00('0x18')]();};}function respondWithResult(_0x5047f5,_0x324e67){_0x324e67=_0x324e67||0xc8;return function(_0x220e68){if(_0x220e68){return _0x5047f5[_0x6f00('0x19')](_0x324e67)[_0x6f00('0x1a')](_0x220e68);}};}function respondWithFilteredResult(_0xa6e7a1,_0x411203){return function(_0x46bc2c){if(_0x46bc2c){var _0x4d8aee=typeof _0x411203[_0x6f00('0x1b')]==='undefined'&&typeof _0x411203[_0x6f00('0x1c')]==='undefined';var _0x534275=_0x46bc2c[_0x6f00('0x1d')];var _0x6cf83f=_0x4d8aee?0x0:_0x411203[_0x6f00('0x1b')];var _0x340f78=_0x4d8aee?_0x46bc2c[_0x6f00('0x1d')]:_0x411203[_0x6f00('0x1b')]+_0x411203[_0x6f00('0x1c')];var _0x295640;if(_0x340f78>=_0x534275){_0x340f78=_0x534275;_0x295640=0xc8;}else{_0x295640=0xce;}_0xa6e7a1[_0x6f00('0x19')](_0x295640);return _0xa6e7a1[_0x6f00('0x1e')](_0x6f00('0x1f'),_0x6cf83f+'-'+_0x340f78+'/'+_0x534275)[_0x6f00('0x1a')](_0x46bc2c);}return null;};}function patchUpdates(_0x4e11de){return function(_0x4f3031){try{jsonpatch['apply'](_0x4f3031,_0x4e11de,!![]);}catch(_0x2a5286){return BPromise[_0x6f00('0x20')](_0x2a5286);}return _0x4f3031[_0x6f00('0x21')]();};}function saveUpdates(_0x57340f,_0xe301e5){return function(_0x9066ff){if(_0x9066ff){return _0x9066ff[_0x6f00('0x22')](_0x57340f)[_0x6f00('0x23')](function(_0x388983){return _0x388983;});}return null;};}function removeEntity(_0x1cbf1c,_0x90d74c){return function(_0x1ea061){if(_0x1ea061){return _0x1ea061['destroy']()[_0x6f00('0x23')](function(){_0x1cbf1c[_0x6f00('0x19')](0xcc)[_0x6f00('0x18')]();});}};}function handleEntityNotFound(_0x4d41ef,_0x37f062){return function(_0x4f7e29){if(!_0x4f7e29){_0x4d41ef[_0x6f00('0x17')](0x194);}return _0x4f7e29;};}function handleError(_0x511293,_0x434735){_0x434735=_0x434735||0x1f4;return function(_0x39375d){logger[_0x6f00('0x24')](_0x39375d[_0x6f00('0x25')]);if(_0x39375d[_0x6f00('0x26')]){delete _0x39375d['name'];}_0x511293[_0x6f00('0x19')](_0x434735)[_0x6f00('0x27')](_0x39375d);};}exports[_0x6f00('0x28')]=function(_0x4366a4,_0x2671fe){var _0x235a86={},_0xff36ce={},_0x451849={'count':0x0,'rows':[]};var _0x22f107=_[_0x6f00('0x29')](db[_0x6f00('0x2a')][_0x6f00('0x2b')],function(_0x29555d){return{'name':_0x29555d[_0x6f00('0x2c')],'type':_0x29555d['type']['key']};});_0xff36ce['model']=_['map'](_0x22f107,'name');_0xff36ce['query']=_[_0x6f00('0x2d')](_0x4366a4['query']);_0xff36ce[_0x6f00('0x2e')]=_[_0x6f00('0x2f')](_0xff36ce[_0x6f00('0x30')],_0xff36ce[_0x6f00('0x31')]);_0x235a86[_0x6f00('0x32')]=_[_0x6f00('0x2f')](_0xff36ce['model'],qs[_0x6f00('0x33')](_0x4366a4[_0x6f00('0x31')][_0x6f00('0x33')]));_0x235a86[_0x6f00('0x32')]=_0x235a86[_0x6f00('0x32')]['length']?_0x235a86['attributes']:_0xff36ce['model'];if(!_0x4366a4[_0x6f00('0x31')][_0x6f00('0x34')](_0x6f00('0x35'))){_0x235a86[_0x6f00('0x1c')]=qs[_0x6f00('0x1c')](_0x4366a4['query'][_0x6f00('0x1c')]);_0x235a86[_0x6f00('0x1b')]=qs[_0x6f00('0x1b')](_0x4366a4[_0x6f00('0x31')][_0x6f00('0x1b')]);}_0x235a86[_0x6f00('0x36')]=qs[_0x6f00('0x37')](_0x4366a4['query'][_0x6f00('0x37')]);_0x235a86[_0x6f00('0x38')]=qs[_0x6f00('0x2e')](_['pick'](_0x4366a4[_0x6f00('0x31')],_0xff36ce[_0x6f00('0x2e')]),_0x22f107);if(_0x4366a4[_0x6f00('0x31')]['filter']){_0x235a86[_0x6f00('0x38')]=_['merge'](_0x235a86[_0x6f00('0x38')],{'$or':_['map'](_0x22f107,function(_0x3dc8e3){if(_0x3dc8e3[_0x6f00('0x39')]!==_0x6f00('0x3a')){var _0x896b3f={};_0x896b3f[_0x3dc8e3['name']]={'$like':'%'+_0x4366a4[_0x6f00('0x31')]['filter']+'%'};return _0x896b3f;}})});}_0x235a86=_[_0x6f00('0x3b')]({},_0x235a86,_0x4366a4['options']);var _0x7785e1={'where':_0x235a86[_0x6f00('0x38')]};return db[_0x6f00('0x2a')][_0x6f00('0x1d')](_0x7785e1)['then'](function(_0x53dc8c){_0x451849[_0x6f00('0x1d')]=_0x53dc8c;if(_0x4366a4['query'][_0x6f00('0x3c')]){_0x235a86[_0x6f00('0x3d')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6f00('0x3e')](_0x235a86);})['then'](function(_0x4cac2c){_0x451849[_0x6f00('0x3f')]=_0x4cac2c;return _0x451849;})[_0x6f00('0x23')](respondWithFilteredResult(_0x2671fe,_0x235a86))[_0x6f00('0x40')](handleError(_0x2671fe,null));};exports[_0x6f00('0x41')]=function(_0x56399a,_0x38ee25){var _0x4523f2={'raw':!![],'where':{'id':_0x56399a[_0x6f00('0x42')]['id']}},_0x2bb5aa={};_0x2bb5aa[_0x6f00('0x30')]=_[_0x6f00('0x2d')](db['JscriptyAnswerReport'][_0x6f00('0x2b')]);_0x2bb5aa[_0x6f00('0x31')]=_[_0x6f00('0x2d')](_0x56399a[_0x6f00('0x31')]);_0x2bb5aa[_0x6f00('0x2e')]=_[_0x6f00('0x2f')](_0x2bb5aa['model'],_0x2bb5aa[_0x6f00('0x31')]);_0x4523f2[_0x6f00('0x32')]=_[_0x6f00('0x2f')](_0x2bb5aa['model'],qs[_0x6f00('0x33')](_0x56399a['query'][_0x6f00('0x33')]));_0x4523f2[_0x6f00('0x32')]=_0x4523f2['attributes'][_0x6f00('0x43')]?_0x4523f2['attributes']:_0x2bb5aa[_0x6f00('0x30')];if(_0x56399a[_0x6f00('0x31')][_0x6f00('0x3c')]){_0x4523f2[_0x6f00('0x3d')]=[{'all':!![]}];}_0x4523f2=_['merge']({},_0x4523f2,_0x56399a[_0x6f00('0x44')]);return db['JscriptyAnswerReport'][_0x6f00('0x45')](_0x4523f2)['then'](handleEntityNotFound(_0x38ee25,null))[_0x6f00('0x23')](respondWithResult(_0x38ee25,null))[_0x6f00('0x40')](handleError(_0x38ee25,null));};exports[_0x6f00('0x46')]=function(_0x9b003,_0x470ff3){return db[_0x6f00('0x2a')][_0x6f00('0x46')](_0x9b003[_0x6f00('0x47')],{})['then'](respondWithResult(_0x470ff3,0xc9))[_0x6f00('0x40')](handleError(_0x470ff3,null));};exports['update']=function(_0x265666,_0x31fb17){if(_0x265666[_0x6f00('0x47')]['id']){delete _0x265666['body']['id'];}return db['JscriptyAnswerReport'][_0x6f00('0x45')]({'where':{'id':_0x265666[_0x6f00('0x42')]['id']}})['then'](handleEntityNotFound(_0x31fb17,null))[_0x6f00('0x23')](saveUpdates(_0x265666['body'],null))[_0x6f00('0x23')](respondWithResult(_0x31fb17,null))['catch'](handleError(_0x31fb17,null));};exports[_0x6f00('0x48')]=function(_0x222b4c,_0x4c6e06){return db['JscriptyAnswerReport'][_0x6f00('0x45')]({'where':{'id':_0x222b4c[_0x6f00('0x42')]['id']}})['then'](handleEntityNotFound(_0x4c6e06,null))[_0x6f00('0x23')](removeEntity(_0x4c6e06,null))['catch'](handleError(_0x4c6e06,null));};exports[_0x6f00('0x49')]=function(_0x7f80ed,_0x3100ee){return db[_0x6f00('0x2a')][_0x6f00('0x49')]()[_0x6f00('0x23')](respondWithResult(_0x3100ee,null))[_0x6f00('0x40')](handleError(_0x3100ee,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 713fa40..9cacb6f 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 _0xa48a=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x1172e0,_0x5ed7b1){var _0x25b93a=function(_0x1c4dc1){while(--_0x1c4dc1){_0x1172e0['push'](_0x1172e0['shift']());}};_0x25b93a(++_0x5ed7b1);}(_0xa48a,0xe4));var _0xaa48=function(_0x224110,_0xabff49){_0x224110=_0x224110-0x0;var _0x23ed0a=_0xa48a[_0x224110];return _0x23ed0a;};'use strict';var _=require(_0xaa48('0x0'));var util=require(_0xaa48('0x1'));var logger=require(_0xaa48('0x2'))('api');var moment=require(_0xaa48('0x3'));var BPromise=require(_0xaa48('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa48('0x5'));var rimraf=require('rimraf');var config=require(_0xaa48('0x6'));var attributes=require(_0xaa48('0x7'));module[_0xaa48('0x8')]=function(_0x478973,_0x2d0b57){return _0x478973[_0xaa48('0x9')](_0xaa48('0xa'),attributes,{'tableName':_0xaa48('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6146=['request-promise','path','rimraf','../../config/environment','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0x6146,0x16f));var _0x6614=function(_0x425077,_0x3c4253){_0x425077=_0x425077-0x0;var _0x461364=_0x6146[_0x425077];return _0x461364;};'use strict';var _=require(_0x6614('0x0'));var util=require(_0x6614('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6614('0x2'));var fs=require('fs');var path=require(_0x6614('0x3'));var rimraf=require(_0x6614('0x4'));var config=require(_0x6614('0x5'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x403c5d,_0x39321c){return _0x403c5d[_0x6614('0x6')](_0x6614('0x7'),attributes,{'tableName':_0x6614('0x8'),'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 f596a27..4ee0c95 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 _0xfd8a=['rpc','../../config/environment','jayson/promise','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4251c1,_0x230477){var _0x5dfa9c=function(_0x2efa4c){while(--_0x2efa4c){_0x4251c1['push'](_0x4251c1['shift']());}};_0x5dfa9c(++_0x230477);}(_0xfd8a,0x93));var _0xafd8=function(_0x534c8f,_0x500079){_0x534c8f=_0x534c8f-0x0;var _0x5a57f5=_0xfd8a[_0x534c8f];return _0x5a57f5;};'use strict';var _=require('lodash');var util=require(_0xafd8('0x0'));var moment=require(_0xafd8('0x1'));var BPromise=require(_0xafd8('0x2'));var rs=require(_0xafd8('0x3'));var fs=require('fs');var Redis=require(_0xafd8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xafd8('0x5'));var logger=require(_0xafd8('0x6'))(_0xafd8('0x7'));var config=require(_0xafd8('0x8'));var jayson=require(_0xafd8('0x9'));var client=jayson['client'][_0xafd8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x512919,_0x5aa78b,_0x262b69){return new BPromise(function(_0x5a0ac6,_0x29801d){return client['request'](_0x512919,_0x262b69)[_0xafd8('0xb')](function(_0xb13310){logger[_0xafd8('0xc')](_0xafd8('0xd'),_0x5aa78b,_0xafd8('0xe'));logger[_0xafd8('0xf')](_0xafd8('0x10'),_0x5aa78b,_0xafd8('0xe'),JSON[_0xafd8('0x11')](_0xb13310));if(_0xb13310['error']){if(_0xb13310['error']['code']===0x1f4){logger[_0xafd8('0x12')](_0xafd8('0xd'),_0x5aa78b,_0xb13310['error']['message']);return _0x29801d(_0xb13310['error'][_0xafd8('0x13')]);}logger[_0xafd8('0x12')](_0xafd8('0xd'),_0x5aa78b,_0xb13310[_0xafd8('0x12')][_0xafd8('0x13')]);return _0x5a0ac6(_0xb13310[_0xafd8('0x12')][_0xafd8('0x13')]);}else{logger[_0xafd8('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5aa78b,_0xafd8('0xe'));_0x5a0ac6(_0xb13310[_0xafd8('0x14')]['message']);}})[_0xafd8('0x15')](function(_0xff43e5){logger['error'](_0xafd8('0xd'),_0x5aa78b,_0xff43e5);_0x29801d(_0xff43e5);});});} \ No newline at end of file +var _0x33fb=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x5dbfa3,_0x51a270){var _0x1a25be=function(_0x49c105){while(--_0x49c105){_0x5dbfa3['push'](_0x5dbfa3['shift']());}};_0x1a25be(++_0x51a270);}(_0x33fb,0xb8));var _0xb33f=function(_0x25ffe2,_0x30deb4){_0x25ffe2=_0x25ffe2-0x0;var _0x323d6c=_0x33fb[_0x25ffe2];return _0x323d6c;};'use strict';var _=require(_0xb33f('0x0'));var util=require(_0xb33f('0x1'));var moment=require(_0xb33f('0x2'));var BPromise=require(_0xb33f('0x3'));var rs=require(_0xb33f('0x4'));var fs=require('fs');var Redis=require(_0xb33f('0x5'));var db=require(_0xb33f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb33f('0x7'))(_0xb33f('0x8'));var config=require(_0xb33f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb33f('0xa')][_0xb33f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b588e,_0x2f65e2,_0x42de4c){return new BPromise(function(_0x5c97dc,_0x4ba45a){return client[_0xb33f('0xc')](_0x2b588e,_0x42de4c)['then'](function(_0x278f9c){logger['info'](_0xb33f('0xd'),_0x2f65e2,_0xb33f('0xe'));logger[_0xb33f('0xf')](_0xb33f('0x10'),_0x2f65e2,'request\x20sent',JSON[_0xb33f('0x11')](_0x278f9c));if(_0x278f9c[_0xb33f('0x12')]){if(_0x278f9c[_0xb33f('0x12')][_0xb33f('0x13')]===0x1f4){logger[_0xb33f('0x12')](_0xb33f('0xd'),_0x2f65e2,_0x278f9c[_0xb33f('0x12')][_0xb33f('0x14')]);return _0x4ba45a(_0x278f9c[_0xb33f('0x12')][_0xb33f('0x14')]);}logger[_0xb33f('0x12')](_0xb33f('0xd'),_0x2f65e2,_0x278f9c['error'][_0xb33f('0x14')]);return _0x5c97dc(_0x278f9c[_0xb33f('0x12')]['message']);}else{logger[_0xb33f('0x15')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2f65e2,_0xb33f('0xe'));_0x5c97dc(_0x278f9c[_0xb33f('0x16')]['message']);}})['catch'](function(_0x33b1c9){logger[_0xb33f('0x12')](_0xb33f('0xd'),_0x2f65e2,_0x33b1c9);_0x4ba45a(_0x33b1c9);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index e8b7b69..918de32 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 _0x98d6=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','/:id','isAuthenticated','getSessions','/:id/answers','/:id/summary','30s','clone','put','update','delete','destroy','exports','multer'];(function(_0x5025f4,_0x4c575c){var _0x5b540e=function(_0x106db4){while(--_0x106db4){_0x5025f4['push'](_0x5025f4['shift']());}};_0x5b540e(++_0x4c575c);}(_0x98d6,0x113));var _0x698d=function(_0x1575c7,_0x32c696){_0x1575c7=_0x1575c7-0x0;var _0x29a59e=_0x98d6[_0x1575c7];return _0x29a59e;};'use strict';var multer=require(_0x698d('0x0'));var util=require('util');var path=require(_0x698d('0x1'));var timeout=require(_0x698d('0x2'));var express=require(_0x698d('0x3'));var router=express[_0x698d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x698d('0x5'));var interaction=require(_0x698d('0x6'));var config=require(_0x698d('0x7'));var controller=require(_0x698d('0x8'));router[_0x698d('0x9')]('/',auth['isAuthenticated'](),controller[_0x698d('0xa')]);router[_0x698d('0x9')](_0x698d('0xb'),auth[_0x698d('0xc')](),controller['show']);router[_0x698d('0x9')]('/:id/sessions',auth[_0x698d('0xc')](),controller[_0x698d('0xd')]);router[_0x698d('0x9')](_0x698d('0xe'),auth[_0x698d('0xc')](),controller['getAnswers']);router[_0x698d('0x9')](_0x698d('0xf'),auth[_0x698d('0xc')](),timeout(_0x698d('0x10')),controller['getSummary']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/clone',auth[_0x698d('0xc')](),controller[_0x698d('0x11')]);router[_0x698d('0x12')]('/:id',auth[_0x698d('0xc')](),controller[_0x698d('0x13')]);router[_0x698d('0x14')](_0x698d('0xb'),auth[_0x698d('0xc')](),controller[_0x698d('0x15')]);module[_0x698d('0x16')]=router; \ No newline at end of file +var _0xafb4=['isAuthenticated','getSessions','get','getAnswers','30s','getSummary','post','create','/:id/clone','clone','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./jscriptyProject.controller','index'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xafb4,0x1f0));var _0x4afb=function(_0x5de528,_0x512696){_0x5de528=_0x5de528-0x0;var _0x2006e9=_0xafb4[_0x5de528];return _0x2006e9;};'use strict';var multer=require(_0x4afb('0x0'));var util=require(_0x4afb('0x1'));var path=require(_0x4afb('0x2'));var timeout=require(_0x4afb('0x3'));var express=require(_0x4afb('0x4'));var router=express[_0x4afb('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4afb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4afb('0x7'));var controller=require(_0x4afb('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4afb('0x9')]);router['get']('/:id',auth[_0x4afb('0xa')](),controller['show']);router['get']('/:id/sessions',auth[_0x4afb('0xa')](),controller[_0x4afb('0xb')]);router[_0x4afb('0xc')]('/:id/answers',auth[_0x4afb('0xa')](),controller[_0x4afb('0xd')]);router['get']('/:id/summary',auth[_0x4afb('0xa')](),timeout(_0x4afb('0xe')),controller[_0x4afb('0xf')]);router[_0x4afb('0x10')]('/',auth[_0x4afb('0xa')](),controller[_0x4afb('0x11')]);router['post'](_0x4afb('0x12'),auth[_0x4afb('0xa')](),controller[_0x4afb('0x13')]);router['put'](_0x4afb('0x14'),auth['isAuthenticated'](),controller['update']);router[_0x4afb('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x4afb('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index b1b4156..39c227f 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 _0x9d3a=['stringify','isString','formData','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','name','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','TEXT','isObjectLike','setDataValue'];(function(_0x5bf420,_0x2d068d){var _0x1c5255=function(_0x4964a2){while(--_0x4964a2){_0x5bf420['push'](_0x5bf420['shift']());}};_0x1c5255(++_0x2d068d);}(_0x9d3a,0x98));var _0xa9d3=function(_0x251f27,_0x1237bc){_0x251f27=_0x251f27-0x0;var _0x452654=_0x9d3a[_0x251f27];return _0x452654;};'use strict';var Sequelize=require(_0xa9d3('0x0'));var _=require(_0xa9d3('0x1'));var util=require(_0xa9d3('0x2'));module[_0xa9d3('0x3')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xa9d3('0x4')]},'formData':{'type':Sequelize[_0xa9d3('0x5')]('long'),'set':function(_0x4370c9){if(_[_0xa9d3('0x6')](_0x4370c9)){this[_0xa9d3('0x7')]('formData',JSON[_0xa9d3('0x8')](_0x4370c9));}else if(_[_0xa9d3('0x9')](_0x4370c9)){this[_0xa9d3('0x7')](_0xa9d3('0xa'),_0x4370c9);}else{this[_0xa9d3('0x7')]('formData',util['format'](_0xa9d3('0xb'),this['getDataValue'](_0xa9d3('0xc'))||'',this[_0xa9d3('0xd')](_0xa9d3('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xa9d3('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0x735d=['isObjectLike','setDataValue','stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','util','STRING','name','TEXT','long'];(function(_0x3112c5,_0x2295f7){var _0x5a7ad8=function(_0x172d97){while(--_0x172d97){_0x3112c5['push'](_0x3112c5['shift']());}};_0x5a7ad8(++_0x2295f7);}(_0x735d,0x126));var _0xd735=function(_0x644ecd,_0x397f36){_0x644ecd=_0x644ecd-0x0;var _0x1c66ce=_0x735d[_0x644ecd];return _0x1c66ce;};'use strict';var Sequelize=require(_0xd735('0x0'));var _=require('lodash');var util=require(_0xd735('0x1'));module['exports']={'name':{'type':Sequelize[_0xd735('0x2')],'unique':_0xd735('0x3')},'description':{'type':Sequelize[_0xd735('0x2')]},'formData':{'type':Sequelize[_0xd735('0x4')](_0xd735('0x5')),'set':function(_0x441af1){if(_[_0xd735('0x6')](_0x441af1)){this[_0xd735('0x7')]('formData',JSON[_0xd735('0x8')](_0x441af1));}else if(_[_0xd735('0x9')](_0x441af1)){this[_0xd735('0x7')](_0xd735('0xa'),_0x441af1);}else{this[_0xd735('0x7')](_0xd735('0xa'),util[_0xd735('0xb')](_0xd735('0xc'),this[_0xd735('0xd')](_0xd735('0x3'))||'',this[_0xd735('0xd')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xd735('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xd735('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 2801149..00534fc 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 _0xa5df=['isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','eml-format','rimraf','request-promise','mustache','sox','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','UserProfileResource','destroy','then','error','stack','name','send','index','JscriptyProject','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','createdAt','updatedAt','getSessions','findOne','JscriptySessionReport','ProjectId','JscriptyAnswerReport','hasOwnProperty','findAll','number','fromCharCode','toString','indexOf','replace','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0xa5df,0xe8));var _0xfa5d=function(_0x21f913,_0x29b247){_0x21f913=_0x21f913-0x0;var _0x3bd21e=_0xa5df[_0x21f913];return _0x3bd21e;};'use strict';var emlformat=require(_0xfa5d('0x0'));var rimraf=require(_0xfa5d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfa5d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfa5d('0x3'));var util=require('util');var path=require('path');var sox=require(_0xfa5d('0x4'));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(_0xfa5d('0x5'));var jsforce=require(_0xfa5d('0x6'));var deskjs=require('desk.js');var toCsv=require(_0xfa5d('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfa5d('0x8'));var authService=require(_0xfa5d('0x9'));var qs=require(_0xfa5d('0xa'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfa5d('0xb'));var logger=require(_0xfa5d('0xc'))('api');var utils=require(_0xfa5d('0xd'));var config=require(_0xfa5d('0xe'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2edc6d,_0x535c04){_0x535c04=_0x535c04||0xcc;return function(_0x49b6f4){if(_0x49b6f4){return _0x2edc6d[_0xfa5d('0xf')](_0x535c04);}return _0x2edc6d[_0xfa5d('0x10')](_0x535c04)[_0xfa5d('0x11')]();};}function respondWithResult(_0x485d78,_0x5f5ca0){_0x5f5ca0=_0x5f5ca0||0xc8;return function(_0xc9d9db){if(_0xc9d9db){return _0x485d78['status'](_0x5f5ca0)[_0xfa5d('0x12')](_0xc9d9db);}};}function respondWithFilteredResult(_0x1ba120,_0x198272){return function(_0x3b4b91){if(_0x3b4b91){var _0x5eb640=typeof _0x198272[_0xfa5d('0x13')]===_0xfa5d('0x14')&&typeof _0x198272[_0xfa5d('0x15')]===_0xfa5d('0x14');var _0x5595ca=_0x3b4b91[_0xfa5d('0x16')];var _0x5d165f=_0x5eb640?0x0:_0x198272[_0xfa5d('0x13')];var _0x51f9df=_0x5eb640?_0x3b4b91[_0xfa5d('0x16')]:_0x198272[_0xfa5d('0x13')]+_0x198272[_0xfa5d('0x15')];var _0x46f32d;if(_0x51f9df>=_0x5595ca){_0x51f9df=_0x5595ca;_0x46f32d=0xc8;}else{_0x46f32d=0xce;}_0x1ba120[_0xfa5d('0x10')](_0x46f32d);return _0x1ba120[_0xfa5d('0x17')](_0xfa5d('0x18'),_0x5d165f+'-'+_0x51f9df+'/'+_0x5595ca)[_0xfa5d('0x12')](_0x3b4b91);}return null;};}function patchUpdates(_0x14ff29){return function(_0x2a95f8){try{jsonpatch[_0xfa5d('0x19')](_0x2a95f8,_0x14ff29,!![]);}catch(_0x497c0a){return BPromise['reject'](_0x497c0a);}return _0x2a95f8[_0xfa5d('0x1a')]();};}function saveUpdates(_0x534add,_0x47f21e){return function(_0x499071){if(_0x499071){return _0x499071[_0xfa5d('0x1b')](_0x534add)['then'](function(_0x1664f6){return _0x1664f6;});}return null;};}function removeEntity(_0x340b7c,_0x35dc54){return function(_0x51cba2){if(_0x51cba2){return _0x51cba2['destroy']()['then'](function(){var _0x5debcd=_0x51cba2['get']({'plain':!![]});var _0x3550a1='Projects';return db[_0xfa5d('0x1c')][_0xfa5d('0x1d')]({'where':{'type':_0x3550a1,'resourceId':_0x5debcd['id']}})['then'](function(){return _0x51cba2;});})[_0xfa5d('0x1e')](function(){_0x340b7c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x128ff4,_0x4b6d11){return function(_0x37d93e){if(!_0x37d93e){_0x128ff4['sendStatus'](0x194);}return _0x37d93e;};}function handleError(_0x57bcfe,_0x5e2345){_0x5e2345=_0x5e2345||0x1f4;return function(_0x117b11){logger[_0xfa5d('0x1f')](_0x117b11[_0xfa5d('0x20')]);if(_0x117b11[_0xfa5d('0x21')]){delete _0x117b11[_0xfa5d('0x21')];}_0x57bcfe[_0xfa5d('0x10')](_0x5e2345)[_0xfa5d('0x22')](_0x117b11);};}exports[_0xfa5d('0x23')]=function(_0x5919b6,_0x20289f){var _0x474c78={},_0x5cce05={},_0x598cbc={'count':0x0,'rows':[]};var _0x2c783f=_['map'](db[_0xfa5d('0x24')][_0xfa5d('0x25')],function(_0x8bffb1){return{'name':_0x8bffb1[_0xfa5d('0x26')],'type':_0x8bffb1[_0xfa5d('0x27')][_0xfa5d('0x28')]};});_0x5cce05[_0xfa5d('0x29')]=_[_0xfa5d('0x2a')](_0x2c783f,_0xfa5d('0x21'));_0x5cce05[_0xfa5d('0x2b')]=_[_0xfa5d('0x2c')](_0x5919b6[_0xfa5d('0x2b')]);_0x5cce05['filters']=_[_0xfa5d('0x2d')](_0x5cce05[_0xfa5d('0x29')],_0x5cce05[_0xfa5d('0x2b')]);_0x474c78[_0xfa5d('0x2e')]=_[_0xfa5d('0x2d')](_0x5cce05[_0xfa5d('0x29')],qs[_0xfa5d('0x2f')](_0x5919b6[_0xfa5d('0x2b')][_0xfa5d('0x2f')]));_0x474c78[_0xfa5d('0x2e')]=_0x474c78[_0xfa5d('0x2e')][_0xfa5d('0x30')]?_0x474c78[_0xfa5d('0x2e')]:_0x5cce05[_0xfa5d('0x29')];if(!_0x5919b6[_0xfa5d('0x2b')]['hasOwnProperty'](_0xfa5d('0x31'))){_0x474c78[_0xfa5d('0x15')]=qs['limit'](_0x5919b6[_0xfa5d('0x2b')]['limit']);_0x474c78[_0xfa5d('0x13')]=qs[_0xfa5d('0x13')](_0x5919b6['query'][_0xfa5d('0x13')]);}_0x474c78[_0xfa5d('0x32')]=qs[_0xfa5d('0x33')](_0x5919b6[_0xfa5d('0x2b')]['sort']);_0x474c78[_0xfa5d('0x34')]=qs[_0xfa5d('0x35')](_[_0xfa5d('0x36')](_0x5919b6['query'],_0x5cce05['filters']),_0x2c783f);if(_0x5919b6[_0xfa5d('0x2b')][_0xfa5d('0x37')]){_0x474c78['where']=_[_0xfa5d('0x38')](_0x474c78['where'],{'$or':_['map'](_0x2c783f,function(_0x211b34){if(_0x211b34['type']!==_0xfa5d('0x39')){var _0x16e99f={};_0x16e99f[_0x211b34['name']]={'$like':'%'+_0x5919b6[_0xfa5d('0x2b')][_0xfa5d('0x37')]+'%'};return _0x16e99f;}})});}_0x474c78=_[_0xfa5d('0x38')]({},_0x474c78,_0x5919b6[_0xfa5d('0x3a')]);var _0x31868d={'where':_0x474c78['where']};return db[_0xfa5d('0x24')][_0xfa5d('0x16')](_0x31868d)[_0xfa5d('0x1e')](function(_0x1970fc){_0x598cbc[_0xfa5d('0x16')]=_0x1970fc;if(_0x5919b6[_0xfa5d('0x2b')]['includeAll']){_0x474c78[_0xfa5d('0x3b')]=[{'all':!![]}];}return db[_0xfa5d('0x24')]['findAll'](_0x474c78);})['then'](function(_0x18bea6){_0x598cbc[_0xfa5d('0x3c')]=_0x18bea6;return _0x598cbc;})[_0xfa5d('0x1e')](respondWithFilteredResult(_0x20289f,_0x474c78))[_0xfa5d('0x3d')](handleError(_0x20289f,null));};exports[_0xfa5d('0x3e')]=function(_0xf817bd,_0x18c42c){var _0xfc8bc9={'raw':![],'where':{'id':_0xf817bd[_0xfa5d('0x3f')]['id']}},_0x53c37a={};_0x53c37a['model']=_[_0xfa5d('0x2c')](db[_0xfa5d('0x24')][_0xfa5d('0x25')]);_0x53c37a[_0xfa5d('0x2b')]=_[_0xfa5d('0x2c')](_0xf817bd[_0xfa5d('0x2b')]);_0x53c37a[_0xfa5d('0x35')]=_[_0xfa5d('0x2d')](_0x53c37a[_0xfa5d('0x29')],_0x53c37a[_0xfa5d('0x2b')]);_0xfc8bc9['attributes']=_[_0xfa5d('0x2d')](_0x53c37a[_0xfa5d('0x29')],qs['fields'](_0xf817bd[_0xfa5d('0x2b')][_0xfa5d('0x2f')]));_0xfc8bc9[_0xfa5d('0x2e')]=_0xfc8bc9[_0xfa5d('0x2e')][_0xfa5d('0x30')]?_0xfc8bc9[_0xfa5d('0x2e')]:_0x53c37a['model'];if(_0xf817bd[_0xfa5d('0x2b')][_0xfa5d('0x40')]){_0xfc8bc9[_0xfa5d('0x3b')]=[{'all':!![]}];}_0xfc8bc9=_[_0xfa5d('0x38')]({},_0xfc8bc9,_0xf817bd[_0xfa5d('0x3a')]);return db[_0xfa5d('0x24')]['find'](_0xfc8bc9)[_0xfa5d('0x1e')](handleEntityNotFound(_0x18c42c,null))[_0xfa5d('0x1e')](respondWithResult(_0x18c42c,null))[_0xfa5d('0x3d')](handleError(_0x18c42c,null));};exports['create']=function(_0x50c5f3,_0x156c1e){return db[_0xfa5d('0x24')][_0xfa5d('0x41')](_0x50c5f3[_0xfa5d('0x42')],{})[_0xfa5d('0x1e')](function(_0x17b540){var _0x153bcf=_0x50c5f3['user'][_0xfa5d('0x43')]({'plain':!![]});if(!_0x153bcf)throw new Error(_0xfa5d('0x44'));if(_0x153bcf[_0xfa5d('0x45')]===_0xfa5d('0x46')){var _0x2fe279=_0x17b540[_0xfa5d('0x43')]({'plain':!![]});var _0x3f5e91='Projects';return db[_0xfa5d('0x47')]['find']({'where':{'name':_0x3f5e91,'userProfileId':_0x153bcf[_0xfa5d('0x48')]},'raw':!![]})[_0xfa5d('0x1e')](function(_0x118963){if(_0x118963&&_0x118963[_0xfa5d('0x49')]===0x0){return db[_0xfa5d('0x1c')][_0xfa5d('0x41')]({'name':_0x2fe279[_0xfa5d('0x21')],'resourceId':_0x2fe279['id'],'type':_0x118963[_0xfa5d('0x21')],'sectionId':_0x118963['id']},{})[_0xfa5d('0x1e')](function(){return _0x17b540;});}else{return _0x17b540;}})[_0xfa5d('0x3d')](function(_0x556001){logger[_0xfa5d('0x1f')](_0xfa5d('0x4a'),_0x556001);throw _0x556001;});}return _0x17b540;})[_0xfa5d('0x1e')](respondWithResult(_0x156c1e,0xc9))[_0xfa5d('0x3d')](handleError(_0x156c1e,null));};exports[_0xfa5d('0x4b')]=function(_0x1a90f1,_0x5ae786){var _0x112bd3={'where':{'id':_0x1a90f1[_0xfa5d('0x3f')]['id']}},_0x423a86={};_0x423a86[_0xfa5d('0x29')]=_[_0xfa5d('0x2c')](db['JscriptyProject']['rawAttributes']);_0x112bd3['attributes']=_[_0xfa5d('0x2d')](_0x423a86[_0xfa5d('0x29')],qs[_0xfa5d('0x2f')](_0x1a90f1[_0xfa5d('0x2b')][_0xfa5d('0x2f')]));_0x112bd3[_0xfa5d('0x2e')]=_0x112bd3[_0xfa5d('0x2e')]['length']?_0x112bd3[_0xfa5d('0x2e')]:_0x423a86[_0xfa5d('0x29')];if(_0x1a90f1[_0xfa5d('0x2b')][_0xfa5d('0x40')]){_0x112bd3[_0xfa5d('0x3b')]=[{'all':!![]}];}_0x112bd3=_[_0xfa5d('0x38')]({},_0x112bd3,_0x1a90f1[_0xfa5d('0x3a')]);return db['JscriptyProject'][_0xfa5d('0x4c')](_0x112bd3)[_0xfa5d('0x1e')](handleEntityNotFound(_0x5ae786,null))[_0xfa5d('0x1e')](function(_0x33fdcd){if(_0x33fdcd){var _0x5bb4fa=_0x33fdcd[_0xfa5d('0x43')]({'plain':!![]});_0x5bb4fa=qs['omit'](_0x5bb4fa,['id',_0xfa5d('0x4d'),'updatedAt']);_0x1a90f1[_0xfa5d('0x42')]=_['omit'](_0x1a90f1[_0xfa5d('0x42')],['id',_0xfa5d('0x4d'),_0xfa5d('0x4e')]);return db[_0xfa5d('0x24')]['create'](_[_0xfa5d('0x38')](_0x5bb4fa,_0x1a90f1[_0xfa5d('0x42')]),{'include':_0x1a90f1[_0xfa5d('0x2b')][_0xfa5d('0x40')]?[{'all':!![]}]:undefined})[_0xfa5d('0x1e')](function(_0x1abfb7){var _0x57549f=_0x1a90f1[_0xfa5d('0x46')][_0xfa5d('0x43')]({'plain':!![]});if(!_0x57549f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57549f[_0xfa5d('0x45')]===_0xfa5d('0x46')){var _0x27a586=_0x1abfb7[_0xfa5d('0x43')]({'plain':!![]});var _0xb4eff7='Projects';return db[_0xfa5d('0x47')][_0xfa5d('0x4c')]({'where':{'name':_0xb4eff7,'userProfileId':_0x57549f[_0xfa5d('0x48')]},'raw':!![]})[_0xfa5d('0x1e')](function(_0x4c4c25){if(_0x4c4c25&&_0x4c4c25['autoAssociation']===0x0){return db['UserProfileResource'][_0xfa5d('0x41')]({'name':_0x27a586[_0xfa5d('0x21')],'resourceId':_0x27a586['id'],'type':_0x4c4c25['name'],'sectionId':_0x4c4c25['id']},{})['then'](function(){return _0x1abfb7;});}else{return _0x1abfb7;}})[_0xfa5d('0x3d')](function(_0x385964){logger[_0xfa5d('0x1f')](_0xfa5d('0x4a'),_0x385964);throw _0x385964;});}return _0x1abfb7;});}})[_0xfa5d('0x1e')](respondWithResult(_0x5ae786,0xc9))[_0xfa5d('0x3d')](handleError(_0x5ae786,null));};exports[_0xfa5d('0x1b')]=function(_0x874e4d,_0x17f978){if(_0x874e4d[_0xfa5d('0x42')]['id']){delete _0x874e4d['body']['id'];}return db[_0xfa5d('0x24')]['find']({'where':{'id':_0x874e4d[_0xfa5d('0x3f')]['id']}})[_0xfa5d('0x1e')](handleEntityNotFound(_0x17f978,null))[_0xfa5d('0x1e')](saveUpdates(_0x874e4d[_0xfa5d('0x42')],null))[_0xfa5d('0x1e')](respondWithResult(_0x17f978,null))[_0xfa5d('0x3d')](handleError(_0x17f978,null));};exports[_0xfa5d('0x1d')]=function(_0x2c165,_0x1e61a8){return db['JscriptyProject'][_0xfa5d('0x4c')]({'where':{'id':_0x2c165[_0xfa5d('0x3f')]['id']}})[_0xfa5d('0x1e')](handleEntityNotFound(_0x1e61a8,null))['then'](removeEntity(_0x1e61a8,null))[_0xfa5d('0x3d')](handleError(_0x1e61a8,null));};exports[_0xfa5d('0x4f')]=function(_0x2b7a77,_0x9b533e,_0x1d02ee){var _0x423832={'raw':!![],'where':{}};var _0x1a7150={};var _0x233a37={'count':0x0,'rows':[]};return db[_0xfa5d('0x24')][_0xfa5d('0x50')]({'where':{'id':_0x2b7a77[_0xfa5d('0x3f')]['id']}})[_0xfa5d('0x1e')](handleEntityNotFound(_0x9b533e,null))['then'](function(_0x5e66b7){if(_0x5e66b7){_0x1a7150[_0xfa5d('0x29')]=_[_0xfa5d('0x2c')](db[_0xfa5d('0x51')]['rawAttributes']);_0x1a7150[_0xfa5d('0x2b')]=_[_0xfa5d('0x2c')](_0x2b7a77[_0xfa5d('0x2b')]);_0x1a7150[_0xfa5d('0x35')]=_[_0xfa5d('0x2d')](_0x1a7150[_0xfa5d('0x29')],_0x1a7150['query']);_0x423832[_0xfa5d('0x2e')]=_[_0xfa5d('0x2d')](_0x1a7150[_0xfa5d('0x29')],qs[_0xfa5d('0x2f')](_0x2b7a77[_0xfa5d('0x2b')][_0xfa5d('0x2f')]));_0x423832[_0xfa5d('0x2e')]=_0x423832[_0xfa5d('0x2e')][_0xfa5d('0x30')]?_0x423832['attributes']:_0x1a7150[_0xfa5d('0x29')];if(!_0x2b7a77['query']['hasOwnProperty']('nolimit')){_0x423832[_0xfa5d('0x15')]=qs[_0xfa5d('0x15')](_0x2b7a77['query']['limit']);_0x423832[_0xfa5d('0x13')]=qs[_0xfa5d('0x13')](_0x2b7a77['query'][_0xfa5d('0x13')]);}_0x423832['order']=qs[_0xfa5d('0x33')](_0x2b7a77[_0xfa5d('0x2b')][_0xfa5d('0x33')]);_0x423832[_0xfa5d('0x34')]=qs[_0xfa5d('0x35')](_['pick'](_0x2b7a77[_0xfa5d('0x2b')],_0x1a7150['filters']));_0x423832[_0xfa5d('0x34')][_0xfa5d('0x52')]=_0x5e66b7['id'];if(_0x2b7a77[_0xfa5d('0x2b')][_0xfa5d('0x37')]){_0x423832[_0xfa5d('0x34')]=_['merge'](_0x423832[_0xfa5d('0x34')],{'$or':_[_0xfa5d('0x2a')](_0x423832[_0xfa5d('0x2e')],function(_0x26e397){var _0x3deaeb={};_0x3deaeb[_0x26e397]={'$like':'%'+_0x2b7a77['query'][_0xfa5d('0x37')]+'%'};return _0x3deaeb;})});}_0x423832=_[_0xfa5d('0x38')]({},_0x423832,_0x2b7a77['options']);return db[_0xfa5d('0x51')]['count']({'where':_0x423832[_0xfa5d('0x34')]})[_0xfa5d('0x1e')](function(_0x3ce1bf){_0x233a37[_0xfa5d('0x16')]=_0x3ce1bf;if(_0x2b7a77[_0xfa5d('0x2b')][_0xfa5d('0x40')]){_0x423832['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x423832);})[_0xfa5d('0x1e')](function(_0x2d0a72){_0x233a37[_0xfa5d('0x3c')]=_0x2d0a72;return _0x233a37;});}})['then'](respondWithFilteredResult(_0x9b533e,_0x423832))[_0xfa5d('0x3d')](handleError(_0x9b533e,null));};exports['getAnswers']=function(_0x329fb1,_0x54e19d,_0x2405b3){var _0x12feca={'raw':!![],'where':{}};var _0x57755b={};var _0x1a4095={'count':0x0,'rows':[]};return db[_0xfa5d('0x24')][_0xfa5d('0x50')]({'where':{'id':_0x329fb1[_0xfa5d('0x3f')]['id']}})[_0xfa5d('0x1e')](handleEntityNotFound(_0x54e19d,null))[_0xfa5d('0x1e')](function(_0x1c35d9){if(_0x1c35d9){_0x57755b[_0xfa5d('0x29')]=_[_0xfa5d('0x2c')](db[_0xfa5d('0x53')][_0xfa5d('0x25')]);_0x57755b[_0xfa5d('0x2b')]=_[_0xfa5d('0x2c')](_0x329fb1[_0xfa5d('0x2b')]);_0x57755b[_0xfa5d('0x35')]=_[_0xfa5d('0x2d')](_0x57755b[_0xfa5d('0x29')],_0x57755b['query']);_0x12feca['attributes']=_[_0xfa5d('0x2d')](_0x57755b[_0xfa5d('0x29')],qs[_0xfa5d('0x2f')](_0x329fb1[_0xfa5d('0x2b')][_0xfa5d('0x2f')]));_0x12feca[_0xfa5d('0x2e')]=_0x12feca['attributes'][_0xfa5d('0x30')]?_0x12feca[_0xfa5d('0x2e')]:_0x57755b['model'];if(!_0x329fb1['query'][_0xfa5d('0x54')](_0xfa5d('0x31'))){_0x12feca[_0xfa5d('0x15')]=qs[_0xfa5d('0x15')](_0x329fb1[_0xfa5d('0x2b')][_0xfa5d('0x15')]);_0x12feca[_0xfa5d('0x13')]=qs[_0xfa5d('0x13')](_0x329fb1[_0xfa5d('0x2b')][_0xfa5d('0x13')]);}_0x12feca[_0xfa5d('0x32')]=qs['sort'](_0x329fb1[_0xfa5d('0x2b')][_0xfa5d('0x33')]);_0x12feca['where']=qs[_0xfa5d('0x35')](_[_0xfa5d('0x36')](_0x329fb1[_0xfa5d('0x2b')],_0x57755b[_0xfa5d('0x35')]));_0x12feca[_0xfa5d('0x34')][_0xfa5d('0x52')]=_0x1c35d9['id'];if(_0x329fb1['query'][_0xfa5d('0x37')]){_0x12feca['where']=_[_0xfa5d('0x38')](_0x12feca['where'],{'$or':_[_0xfa5d('0x2a')](_0x12feca[_0xfa5d('0x2e')],function(_0x37ff1e){var _0x2dda91={};_0x2dda91[_0x37ff1e]={'$like':'%'+_0x329fb1[_0xfa5d('0x2b')]['filter']+'%'};return _0x2dda91;})});}_0x12feca=_['merge']({},_0x12feca,_0x329fb1['options']);return db[_0xfa5d('0x53')][_0xfa5d('0x16')]({'where':_0x12feca[_0xfa5d('0x34')]})[_0xfa5d('0x1e')](function(_0xa85059){_0x1a4095['count']=_0xa85059;if(_0x329fb1[_0xfa5d('0x2b')][_0xfa5d('0x40')]){_0x12feca[_0xfa5d('0x3b')]=[{'all':!![]}];}return db[_0xfa5d('0x53')][_0xfa5d('0x55')](_0x12feca);})[_0xfa5d('0x1e')](function(_0x8fd596){_0x1a4095[_0xfa5d('0x3c')]=_0x8fd596;return _0x1a4095;});}})[_0xfa5d('0x1e')](respondWithFilteredResult(_0x54e19d,_0x12feca))[_0xfa5d('0x3d')](handleError(_0x54e19d,null));};function char(_0x474f0f){return _0xfa5d('0x56')===typeof _0x474f0f?String[_0xfa5d('0x57')][_0xfa5d('0x19')](null,arguments):_0x474f0f;}function needsEncapsulation(_0x5c453a){return!!_0x5c453a&&(_0x5c453a[_0xfa5d('0x58')]()['indexOf'](char(0xd))>=0x0||_0x5c453a[_0xfa5d('0x58')]()[_0xfa5d('0x59')](char(0xa))>=0x0||_0x5c453a[_0xfa5d('0x58')]()['indexOf'](char(0x2c))>=0x0||_0x5c453a[_0xfa5d('0x58')]()[_0xfa5d('0x59')](char(0x22))>=0x0);}function encapsulate(_0x13bec1){var _0x1872bd=char(0x22),_0x3ee211='\x5c'+char(0x22),_0x54e635=_0x13bec1[_0xfa5d('0x58')]()[_0xfa5d('0x5a')](new RegExp(_0x1872bd,'g'),_0x3ee211);return _0x1872bd+_0x54e635+_0x1872bd;}exports['getSummary']=function(_0x554614,_0x5c3a4f,_0x5eab32){var _0x1cc8eb,_0x7758e4;var _0x1e544b={'where':{'ProjectId':_0x554614[_0xfa5d('0x3f')]['id']}};if(_0x554614[_0xfa5d('0x2b')]['startTime']){_0x1e544b[_0xfa5d('0x34')][_0xfa5d('0x5b')]=JSON[_0xfa5d('0x5c')](_0x554614[_0xfa5d('0x2b')]['startTime']);}return db[_0xfa5d('0x51')][_0xfa5d('0x55')](_0x1e544b)['then'](handleEntityNotFound(_0x5c3a4f,null))[_0xfa5d('0x1e')](function(_0x3d3125){if(_0x3d3125){_0x1cc8eb=_0x3d3125;return db[_0xfa5d('0x5d')][_0xfa5d('0x55')]({'where':{'SessionId':{'$in':_[_0xfa5d('0x2a')](_0x1cc8eb,'id')},'ProjectId':_0x554614['params']['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x5c3a4f,null))[_0xfa5d('0x1e')](function(_0x35fc0c){if(_0x35fc0c){_0x7758e4=_0x35fc0c;var _0x540001={};for(var _0x911979=0x0,_0x1db9f9=_0x7758e4[_0xfa5d('0x30')];_0x911979<_0x1db9f9;_0x911979++){if(!_0x540001[_0xfa5d('0x54')](_0x7758e4[_0x911979][_0xfa5d('0x5e')])){_0x540001[_0x7758e4[_0x911979][_0xfa5d('0x5e')]]=needsEncapsulation(_0x7758e4[_0x911979][_0xfa5d('0x5f')])?encapsulate(_0x7758e4[_0x911979]['question']):_0x7758e4[_0x911979][_0xfa5d('0x5f')];}}var _0x154f95=[],_0x2adf18={};for(var _0x21fcc7=0x0,_0x22ac3e=_0x1cc8eb[_0xfa5d('0x30')];_0x21fcc7<_0x22ac3e;_0x21fcc7++){_0x2adf18={'ProjectId':_0x554614[_0xfa5d('0x3f')]['id'],'SessionId':_0x1cc8eb[_0x21fcc7]['id'],'StartTime':moment(_0x1cc8eb[_0x21fcc7]['starttime'])[_0xfa5d('0x60')](_0xfa5d('0x61'))};for(var _0x2196a2=0x0,_0x37eb35=_0x7758e4['length'];_0x2196a2<_0x37eb35;_0x2196a2++){if(_0x7758e4[_0x2196a2][_0xfa5d('0x62')]==_0x1cc8eb[_0x21fcc7]['id']&&_0x540001[_0xfa5d('0x54')](_0x7758e4[_0x2196a2][_0xfa5d('0x5e')])){_0x2adf18[_0x540001[_0x7758e4[_0x2196a2][_0xfa5d('0x5e')]]]=_0x7758e4[_0x2196a2][_0xfa5d('0x63')];}}for(var _0x394509 in _0x540001){if(!_0x2adf18[_0xfa5d('0x54')](_0x540001[_0x394509])){_0x2adf18[_0x540001[_0x394509]]=null;}}_0x154f95[_0xfa5d('0x64')](_0x2adf18);}return _0x154f95;}})[_0xfa5d('0x1e')](function(_0x53d237){if(!_[_0xfa5d('0x65')](_0x53d237)){var _0x5652a0=toCsv(_0x53d237);var _0x5f0f9c=Date[_0xfa5d('0x66')]();fs[_0xfa5d('0x67')](util['format'](_0xfa5d('0x68'),_0x554614['params']['id'],_0x5f0f9c),_0x5652a0);_0x5c3a4f[_0xfa5d('0x69')](_0xfa5d('0x6a'),_0xfa5d('0x6b')+util[_0xfa5d('0x60')](_0xfa5d('0x6c'),_0x554614[_0xfa5d('0x3f')]['id'],_0x5f0f9c));_0x5c3a4f[_0xfa5d('0x69')]('Content-type',_0xfa5d('0x6d'));return _0x5c3a4f[_0xfa5d('0x6e')](util[_0xfa5d('0x60')](_0xfa5d('0x68'),_0x554614[_0xfa5d('0x3f')]['id'],_0x5f0f9c));}else{return _0x5c3a4f['sendStatus'](0xcc);}})[_0xfa5d('0x3d')](handleError(_0x5c3a4f,null));}; \ No newline at end of file +var _0x112f=['user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','body','Projects','userProfileId','getSessions','findOne','JscriptySessionReport','order','pick','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','JscriptyProject','rawAttributes','fieldName','type','key','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','keys','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0x112f,0x11e));var _0xf112=function(_0x3f943f,_0x1bc3d7){_0x3f943f=_0x3f943f-0x0;var _0xdf628a=_0x112f[_0x3f943f];return _0xdf628a;};'use strict';var emlformat=require(_0xf112('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf112('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf112('0x2'));var moment=require(_0xf112('0x3'));var BPromise=require(_0xf112('0x4'));var Mustache=require(_0xf112('0x5'));var util=require('util');var path=require(_0xf112('0x6'));var sox=require('sox');var csv=require(_0xf112('0x7'));var ejs=require(_0xf112('0x8'));var fs=require('fs');var fs_extra=require(_0xf112('0x9'));var _=require(_0xf112('0xa'));var squel=require(_0xf112('0xb'));var crypto=require(_0xf112('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf112('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf112('0xe'));var Papa=require(_0xf112('0xf'));var Redis=require(_0xf112('0x10'));var authService=require(_0xf112('0x11'));var qs=require(_0xf112('0x12'));var as=require(_0xf112('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf112('0x14'));var config=require(_0xf112('0x15'));var licenseUtil=require(_0xf112('0x16'));var db=require(_0xf112('0x17'))['db'];function respondWithStatusCode(_0x350f60,_0x330f6c){_0x330f6c=_0x330f6c||0xcc;return function(_0x401344){if(_0x401344){return _0x350f60[_0xf112('0x18')](_0x330f6c);}return _0x350f60[_0xf112('0x19')](_0x330f6c)['end']();};}function respondWithResult(_0x1381f4,_0x5c32f2){_0x5c32f2=_0x5c32f2||0xc8;return function(_0x568a07){if(_0x568a07){return _0x1381f4['status'](_0x5c32f2)[_0xf112('0x1a')](_0x568a07);}};}function respondWithFilteredResult(_0x5111e9,_0xb7fc78){return function(_0x1dabb1){if(_0x1dabb1){var _0x3e5780=typeof _0xb7fc78[_0xf112('0x1b')]===_0xf112('0x1c')&&typeof _0xb7fc78['limit']===_0xf112('0x1c');var _0xae0e54=_0x1dabb1['count'];var _0x16d575=_0x3e5780?0x0:_0xb7fc78[_0xf112('0x1b')];var _0x23872c=_0x3e5780?_0x1dabb1['count']:_0xb7fc78[_0xf112('0x1b')]+_0xb7fc78[_0xf112('0x1d')];var _0x46a02c;if(_0x23872c>=_0xae0e54){_0x23872c=_0xae0e54;_0x46a02c=0xc8;}else{_0x46a02c=0xce;}_0x5111e9[_0xf112('0x19')](_0x46a02c);return _0x5111e9[_0xf112('0x1e')](_0xf112('0x1f'),_0x16d575+'-'+_0x23872c+'/'+_0xae0e54)[_0xf112('0x1a')](_0x1dabb1);}return null;};}function patchUpdates(_0x13cc44){return function(_0x2d3a1b){try{jsonpatch[_0xf112('0x20')](_0x2d3a1b,_0x13cc44,!![]);}catch(_0x240bd4){return BPromise['reject'](_0x240bd4);}return _0x2d3a1b[_0xf112('0x21')]();};}function saveUpdates(_0x5e9599,_0xaed84c){return function(_0x8e7b25){if(_0x8e7b25){return _0x8e7b25[_0xf112('0x22')](_0x5e9599)[_0xf112('0x23')](function(_0x390f4d){return _0x390f4d;});}return null;};}function removeEntity(_0x29b6fb,_0x3f9604){return function(_0x1163b6){if(_0x1163b6){return _0x1163b6[_0xf112('0x24')]()[_0xf112('0x23')](function(){var _0x27a894=_0x1163b6[_0xf112('0x25')]({'plain':!![]});var _0x48a5c9='Projects';return db[_0xf112('0x26')][_0xf112('0x24')]({'where':{'type':_0x48a5c9,'resourceId':_0x27a894['id']}})['then'](function(){return _0x1163b6;});})[_0xf112('0x23')](function(){_0x29b6fb[_0xf112('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34ef2f,_0x5227f3){return function(_0x48adaa){if(!_0x48adaa){_0x34ef2f[_0xf112('0x18')](0x194);}return _0x48adaa;};}function handleError(_0x1967df,_0x49e07e){_0x49e07e=_0x49e07e||0x1f4;return function(_0x50ca78){logger[_0xf112('0x27')](_0x50ca78[_0xf112('0x28')]);if(_0x50ca78[_0xf112('0x29')]){delete _0x50ca78[_0xf112('0x29')];}_0x1967df[_0xf112('0x19')](_0x49e07e)[_0xf112('0x2a')](_0x50ca78);};}exports[_0xf112('0x2b')]=function(_0x4fd46a,_0x55db9d){var _0x40b519={},_0x32f538={},_0x54d0e6={'count':0x0,'rows':[]};var _0x27d49d=_['map'](db[_0xf112('0x2c')][_0xf112('0x2d')],function(_0x521072){return{'name':_0x521072[_0xf112('0x2e')],'type':_0x521072[_0xf112('0x2f')][_0xf112('0x30')]};});_0x32f538['model']=_[_0xf112('0x31')](_0x27d49d,_0xf112('0x29'));_0x32f538[_0xf112('0x32')]=_['keys'](_0x4fd46a[_0xf112('0x32')]);_0x32f538['filters']=_[_0xf112('0x33')](_0x32f538[_0xf112('0x34')],_0x32f538[_0xf112('0x32')]);_0x40b519['attributes']=_[_0xf112('0x33')](_0x32f538[_0xf112('0x34')],qs['fields'](_0x4fd46a['query'][_0xf112('0x35')]));_0x40b519[_0xf112('0x36')]=_0x40b519[_0xf112('0x36')][_0xf112('0x37')]?_0x40b519[_0xf112('0x36')]:_0x32f538[_0xf112('0x34')];if(!_0x4fd46a[_0xf112('0x32')][_0xf112('0x38')](_0xf112('0x39'))){_0x40b519[_0xf112('0x1d')]=qs[_0xf112('0x1d')](_0x4fd46a[_0xf112('0x32')]['limit']);_0x40b519[_0xf112('0x1b')]=qs[_0xf112('0x1b')](_0x4fd46a[_0xf112('0x32')][_0xf112('0x1b')]);}_0x40b519['order']=qs[_0xf112('0x3a')](_0x4fd46a[_0xf112('0x32')][_0xf112('0x3a')]);_0x40b519[_0xf112('0x3b')]=qs[_0xf112('0x3c')](_['pick'](_0x4fd46a[_0xf112('0x32')],_0x32f538['filters']),_0x27d49d);if(_0x4fd46a['query'][_0xf112('0x3d')]){_0x40b519[_0xf112('0x3b')]=_[_0xf112('0x3e')](_0x40b519[_0xf112('0x3b')],{'$or':_['map'](_0x27d49d,function(_0x272d8e){if(_0x272d8e['type']!==_0xf112('0x3f')){var _0x30214f={};_0x30214f[_0x272d8e['name']]={'$like':'%'+_0x4fd46a[_0xf112('0x32')][_0xf112('0x3d')]+'%'};return _0x30214f;}})});}_0x40b519=_[_0xf112('0x3e')]({},_0x40b519,_0x4fd46a[_0xf112('0x40')]);var _0x4ba85d={'where':_0x40b519[_0xf112('0x3b')]};return db[_0xf112('0x2c')]['count'](_0x4ba85d)[_0xf112('0x23')](function(_0x685a5a){_0x54d0e6[_0xf112('0x41')]=_0x685a5a;if(_0x4fd46a['query'][_0xf112('0x42')]){_0x40b519[_0xf112('0x43')]=[{'all':!![]}];}return db[_0xf112('0x2c')][_0xf112('0x44')](_0x40b519);})[_0xf112('0x23')](function(_0x1c0f45){_0x54d0e6[_0xf112('0x45')]=_0x1c0f45;return _0x54d0e6;})[_0xf112('0x23')](respondWithFilteredResult(_0x55db9d,_0x40b519))['catch'](handleError(_0x55db9d,null));};exports[_0xf112('0x46')]=function(_0x27d074,_0x5b62ce){var _0x81ae92={'raw':![],'where':{'id':_0x27d074['params']['id']}},_0x1f380d={};_0x1f380d[_0xf112('0x34')]=_[_0xf112('0x47')](db['JscriptyProject'][_0xf112('0x2d')]);_0x1f380d[_0xf112('0x32')]=_[_0xf112('0x47')](_0x27d074[_0xf112('0x32')]);_0x1f380d[_0xf112('0x3c')]=_[_0xf112('0x33')](_0x1f380d[_0xf112('0x34')],_0x1f380d[_0xf112('0x32')]);_0x81ae92['attributes']=_['intersection'](_0x1f380d[_0xf112('0x34')],qs[_0xf112('0x35')](_0x27d074[_0xf112('0x32')][_0xf112('0x35')]));_0x81ae92[_0xf112('0x36')]=_0x81ae92[_0xf112('0x36')][_0xf112('0x37')]?_0x81ae92[_0xf112('0x36')]:_0x1f380d[_0xf112('0x34')];if(_0x27d074[_0xf112('0x32')][_0xf112('0x42')]){_0x81ae92[_0xf112('0x43')]=[{'all':!![]}];}_0x81ae92=_[_0xf112('0x3e')]({},_0x81ae92,_0x27d074[_0xf112('0x40')]);return db[_0xf112('0x2c')][_0xf112('0x48')](_0x81ae92)[_0xf112('0x23')](handleEntityNotFound(_0x5b62ce,null))['then'](respondWithResult(_0x5b62ce,null))[_0xf112('0x49')](handleError(_0x5b62ce,null));};exports[_0xf112('0x4a')]=function(_0x34c66d,_0x51a6c4){return db[_0xf112('0x2c')][_0xf112('0x4a')](_0x34c66d['body'],{})['then'](function(_0x58de11){var _0x5c8bf3=_0x34c66d['user'][_0xf112('0x25')]({'plain':!![]});if(!_0x5c8bf3)throw new Error(_0xf112('0x4b'));if(_0x5c8bf3[_0xf112('0x4c')]===_0xf112('0x4d')){var _0x5de006=_0x58de11[_0xf112('0x25')]({'plain':!![]});var _0x321469='Projects';return db[_0xf112('0x4e')][_0xf112('0x48')]({'where':{'name':_0x321469,'userProfileId':_0x5c8bf3['userProfileId']},'raw':!![]})[_0xf112('0x23')](function(_0x5797f8){if(_0x5797f8&&_0x5797f8[_0xf112('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x5de006[_0xf112('0x29')],'resourceId':_0x5de006['id'],'type':_0x5797f8[_0xf112('0x29')],'sectionId':_0x5797f8['id']},{})[_0xf112('0x23')](function(){return _0x58de11;});}else{return _0x58de11;}})[_0xf112('0x49')](function(_0x2b4021){logger[_0xf112('0x27')](_0xf112('0x50'),_0x2b4021);throw _0x2b4021;});}return _0x58de11;})[_0xf112('0x23')](respondWithResult(_0x51a6c4,0xc9))[_0xf112('0x49')](handleError(_0x51a6c4,null));};exports[_0xf112('0x51')]=function(_0x411fa8,_0x4ab934){var _0x47e28b={'where':{'id':_0x411fa8[_0xf112('0x52')]['id']}},_0x1d8d0a={};_0x1d8d0a[_0xf112('0x34')]=_[_0xf112('0x47')](db[_0xf112('0x2c')]['rawAttributes']);_0x47e28b['attributes']=_['intersection'](_0x1d8d0a[_0xf112('0x34')],qs[_0xf112('0x35')](_0x411fa8[_0xf112('0x32')][_0xf112('0x35')]));_0x47e28b[_0xf112('0x36')]=_0x47e28b[_0xf112('0x36')]['length']?_0x47e28b[_0xf112('0x36')]:_0x1d8d0a['model'];if(_0x411fa8[_0xf112('0x32')][_0xf112('0x42')]){_0x47e28b[_0xf112('0x43')]=[{'all':!![]}];}_0x47e28b=_[_0xf112('0x3e')]({},_0x47e28b,_0x411fa8['options']);return db[_0xf112('0x2c')]['find'](_0x47e28b)[_0xf112('0x23')](handleEntityNotFound(_0x4ab934,null))[_0xf112('0x23')](function(_0x3859b7){if(_0x3859b7){var _0x475e05=_0x3859b7[_0xf112('0x25')]({'plain':!![]});_0x475e05=qs[_0xf112('0x53')](_0x475e05,['id',_0xf112('0x54'),_0xf112('0x55')]);_0x411fa8[_0xf112('0x56')]=_[_0xf112('0x53')](_0x411fa8[_0xf112('0x56')],['id',_0xf112('0x54'),_0xf112('0x55')]);return db[_0xf112('0x2c')][_0xf112('0x4a')](_[_0xf112('0x3e')](_0x475e05,_0x411fa8[_0xf112('0x56')]),{'include':_0x411fa8['query'][_0xf112('0x42')]?[{'all':!![]}]:undefined})[_0xf112('0x23')](function(_0x3d084a){var _0x242c32=_0x411fa8[_0xf112('0x4d')]['get']({'plain':!![]});if(!_0x242c32)throw new Error(_0xf112('0x4b'));if(_0x242c32[_0xf112('0x4c')]==='user'){var _0x436027=_0x3d084a['get']({'plain':!![]});var _0x483efb=_0xf112('0x57');return db[_0xf112('0x4e')]['find']({'where':{'name':_0x483efb,'userProfileId':_0x242c32[_0xf112('0x58')]},'raw':!![]})[_0xf112('0x23')](function(_0x4e2fcc){if(_0x4e2fcc&&_0x4e2fcc[_0xf112('0x4f')]===0x0){return db['UserProfileResource'][_0xf112('0x4a')]({'name':_0x436027[_0xf112('0x29')],'resourceId':_0x436027['id'],'type':_0x4e2fcc[_0xf112('0x29')],'sectionId':_0x4e2fcc['id']},{})[_0xf112('0x23')](function(){return _0x3d084a;});}else{return _0x3d084a;}})['catch'](function(_0x4aa8f2){logger[_0xf112('0x27')](_0xf112('0x50'),_0x4aa8f2);throw _0x4aa8f2;});}return _0x3d084a;});}})[_0xf112('0x23')](respondWithResult(_0x4ab934,0xc9))[_0xf112('0x49')](handleError(_0x4ab934,null));};exports[_0xf112('0x22')]=function(_0x5e5718,_0xfbd3a4){if(_0x5e5718[_0xf112('0x56')]['id']){delete _0x5e5718['body']['id'];}return db['JscriptyProject'][_0xf112('0x48')]({'where':{'id':_0x5e5718[_0xf112('0x52')]['id']}})['then'](handleEntityNotFound(_0xfbd3a4,null))[_0xf112('0x23')](saveUpdates(_0x5e5718[_0xf112('0x56')],null))[_0xf112('0x23')](respondWithResult(_0xfbd3a4,null))['catch'](handleError(_0xfbd3a4,null));};exports[_0xf112('0x24')]=function(_0x23a966,_0x5a57f8){return db[_0xf112('0x2c')][_0xf112('0x48')]({'where':{'id':_0x23a966[_0xf112('0x52')]['id']}})[_0xf112('0x23')](handleEntityNotFound(_0x5a57f8,null))[_0xf112('0x23')](removeEntity(_0x5a57f8,null))[_0xf112('0x49')](handleError(_0x5a57f8,null));};exports[_0xf112('0x59')]=function(_0x2cea82,_0x803707,_0x3b5ddb){var _0x2f8876={'raw':!![],'where':{}};var _0x4f898f={};var _0x4c1b1b={'count':0x0,'rows':[]};return db[_0xf112('0x2c')][_0xf112('0x5a')]({'where':{'id':_0x2cea82['params']['id']}})[_0xf112('0x23')](handleEntityNotFound(_0x803707,null))[_0xf112('0x23')](function(_0xc88a05){if(_0xc88a05){_0x4f898f[_0xf112('0x34')]=_[_0xf112('0x47')](db[_0xf112('0x5b')][_0xf112('0x2d')]);_0x4f898f[_0xf112('0x32')]=_[_0xf112('0x47')](_0x2cea82[_0xf112('0x32')]);_0x4f898f[_0xf112('0x3c')]=_[_0xf112('0x33')](_0x4f898f[_0xf112('0x34')],_0x4f898f[_0xf112('0x32')]);_0x2f8876['attributes']=_[_0xf112('0x33')](_0x4f898f[_0xf112('0x34')],qs[_0xf112('0x35')](_0x2cea82[_0xf112('0x32')]['fields']));_0x2f8876[_0xf112('0x36')]=_0x2f8876['attributes'][_0xf112('0x37')]?_0x2f8876[_0xf112('0x36')]:_0x4f898f[_0xf112('0x34')];if(!_0x2cea82[_0xf112('0x32')][_0xf112('0x38')]('nolimit')){_0x2f8876[_0xf112('0x1d')]=qs[_0xf112('0x1d')](_0x2cea82[_0xf112('0x32')][_0xf112('0x1d')]);_0x2f8876['offset']=qs['offset'](_0x2cea82[_0xf112('0x32')]['offset']);}_0x2f8876[_0xf112('0x5c')]=qs['sort'](_0x2cea82['query']['sort']);_0x2f8876[_0xf112('0x3b')]=qs[_0xf112('0x3c')](_[_0xf112('0x5d')](_0x2cea82[_0xf112('0x32')],_0x4f898f[_0xf112('0x3c')]));_0x2f8876[_0xf112('0x3b')][_0xf112('0x5e')]=_0xc88a05['id'];if(_0x2cea82['query'][_0xf112('0x3d')]){_0x2f8876[_0xf112('0x3b')]=_[_0xf112('0x3e')](_0x2f8876[_0xf112('0x3b')],{'$or':_[_0xf112('0x31')](_0x2f8876[_0xf112('0x36')],function(_0x234736){var _0x1814fa={};_0x1814fa[_0x234736]={'$like':'%'+_0x2cea82[_0xf112('0x32')][_0xf112('0x3d')]+'%'};return _0x1814fa;})});}_0x2f8876=_[_0xf112('0x3e')]({},_0x2f8876,_0x2cea82[_0xf112('0x40')]);return db[_0xf112('0x5b')]['count']({'where':_0x2f8876[_0xf112('0x3b')]})['then'](function(_0x4c8fd7){_0x4c1b1b['count']=_0x4c8fd7;if(_0x2cea82[_0xf112('0x32')][_0xf112('0x42')]){_0x2f8876[_0xf112('0x43')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xf112('0x44')](_0x2f8876);})['then'](function(_0xfe6508){_0x4c1b1b[_0xf112('0x45')]=_0xfe6508;return _0x4c1b1b;});}})[_0xf112('0x23')](respondWithFilteredResult(_0x803707,_0x2f8876))[_0xf112('0x49')](handleError(_0x803707,null));};exports[_0xf112('0x5f')]=function(_0x279e63,_0x19995b,_0x50ed7c){var _0x1a9776={'raw':!![],'where':{}};var _0x51bbfa={};var _0x11173c={'count':0x0,'rows':[]};return db[_0xf112('0x2c')][_0xf112('0x5a')]({'where':{'id':_0x279e63['params']['id']}})[_0xf112('0x23')](handleEntityNotFound(_0x19995b,null))['then'](function(_0x370a49){if(_0x370a49){_0x51bbfa[_0xf112('0x34')]=_['keys'](db['JscriptyAnswerReport']['rawAttributes']);_0x51bbfa[_0xf112('0x32')]=_[_0xf112('0x47')](_0x279e63[_0xf112('0x32')]);_0x51bbfa[_0xf112('0x3c')]=_[_0xf112('0x33')](_0x51bbfa['model'],_0x51bbfa['query']);_0x1a9776['attributes']=_[_0xf112('0x33')](_0x51bbfa[_0xf112('0x34')],qs['fields'](_0x279e63[_0xf112('0x32')][_0xf112('0x35')]));_0x1a9776[_0xf112('0x36')]=_0x1a9776[_0xf112('0x36')][_0xf112('0x37')]?_0x1a9776[_0xf112('0x36')]:_0x51bbfa[_0xf112('0x34')];if(!_0x279e63['query'][_0xf112('0x38')]('nolimit')){_0x1a9776[_0xf112('0x1d')]=qs[_0xf112('0x1d')](_0x279e63[_0xf112('0x32')][_0xf112('0x1d')]);_0x1a9776[_0xf112('0x1b')]=qs[_0xf112('0x1b')](_0x279e63['query'][_0xf112('0x1b')]);}_0x1a9776['order']=qs[_0xf112('0x3a')](_0x279e63['query'][_0xf112('0x3a')]);_0x1a9776['where']=qs['filters'](_[_0xf112('0x5d')](_0x279e63[_0xf112('0x32')],_0x51bbfa[_0xf112('0x3c')]));_0x1a9776[_0xf112('0x3b')][_0xf112('0x5e')]=_0x370a49['id'];if(_0x279e63[_0xf112('0x32')][_0xf112('0x3d')]){_0x1a9776[_0xf112('0x3b')]=_[_0xf112('0x3e')](_0x1a9776[_0xf112('0x3b')],{'$or':_['map'](_0x1a9776['attributes'],function(_0x3c52f3){var _0x25600c={};_0x25600c[_0x3c52f3]={'$like':'%'+_0x279e63[_0xf112('0x32')][_0xf112('0x3d')]+'%'};return _0x25600c;})});}_0x1a9776=_[_0xf112('0x3e')]({},_0x1a9776,_0x279e63[_0xf112('0x40')]);return db[_0xf112('0x60')]['count']({'where':_0x1a9776[_0xf112('0x3b')]})['then'](function(_0x1e56d6){_0x11173c[_0xf112('0x41')]=_0x1e56d6;if(_0x279e63[_0xf112('0x32')]['includeAll']){_0x1a9776[_0xf112('0x43')]=[{'all':!![]}];}return db[_0xf112('0x60')]['findAll'](_0x1a9776);})[_0xf112('0x23')](function(_0x3d7853){_0x11173c[_0xf112('0x45')]=_0x3d7853;return _0x11173c;});}})['then'](respondWithFilteredResult(_0x19995b,_0x1a9776))[_0xf112('0x49')](handleError(_0x19995b,null));};function char(_0x55e088){return _0xf112('0x61')===typeof _0x55e088?String[_0xf112('0x62')][_0xf112('0x20')](null,arguments):_0x55e088;}function needsEncapsulation(_0x3f888a){return!!_0x3f888a&&(_0x3f888a[_0xf112('0x63')]()['indexOf'](char(0xd))>=0x0||_0x3f888a[_0xf112('0x63')]()[_0xf112('0x64')](char(0xa))>=0x0||_0x3f888a[_0xf112('0x63')]()['indexOf'](char(0x2c))>=0x0||_0x3f888a[_0xf112('0x63')]()[_0xf112('0x64')](char(0x22))>=0x0);}function encapsulate(_0x2de855){var _0xe98f29=char(0x22),_0x27bec2='\x5c'+char(0x22),_0x7e7e38=_0x2de855[_0xf112('0x63')]()['replace'](new RegExp(_0xe98f29,'g'),_0x27bec2);return _0xe98f29+_0x7e7e38+_0xe98f29;}exports['getSummary']=function(_0xc09f59,_0x4e8085,_0x20fd36){var _0x5003dd,_0x39a651;var _0x257e7b={'where':{'ProjectId':_0xc09f59[_0xf112('0x52')]['id']}};if(_0xc09f59[_0xf112('0x32')][_0xf112('0x65')]){_0x257e7b[_0xf112('0x3b')][_0xf112('0x66')]=JSON['parse'](_0xc09f59[_0xf112('0x32')][_0xf112('0x65')]);}return db['JscriptySessionReport'][_0xf112('0x44')](_0x257e7b)[_0xf112('0x23')](handleEntityNotFound(_0x4e8085,null))['then'](function(_0x3a7974){if(_0x3a7974){_0x5003dd=_0x3a7974;return db[_0xf112('0x67')]['findAll']({'where':{'SessionId':{'$in':_[_0xf112('0x31')](_0x5003dd,'id')},'ProjectId':_0xc09f59[_0xf112('0x52')]['id']},'order':_0xf112('0x68')});}})['then'](handleEntityNotFound(_0x4e8085,null))[_0xf112('0x23')](function(_0x18d3f1){if(_0x18d3f1){_0x39a651=_0x18d3f1;var _0x4950ec={};for(var _0x805e76=0x0,_0x107795=_0x39a651['length'];_0x805e76<_0x107795;_0x805e76++){if(!_0x4950ec[_0xf112('0x38')](_0x39a651[_0x805e76][_0xf112('0x69')])){_0x4950ec[_0x39a651[_0x805e76]['questionId']]=needsEncapsulation(_0x39a651[_0x805e76][_0xf112('0x6a')])?encapsulate(_0x39a651[_0x805e76][_0xf112('0x6a')]):_0x39a651[_0x805e76][_0xf112('0x6a')];}}var _0x899e9f=[],_0x8af59b={};for(var _0x1575b9=0x0,_0x2f0923=_0x5003dd[_0xf112('0x37')];_0x1575b9<_0x2f0923;_0x1575b9++){_0x8af59b={'ProjectId':_0xc09f59[_0xf112('0x52')]['id'],'SessionId':_0x5003dd[_0x1575b9]['id'],'StartTime':moment(_0x5003dd[_0x1575b9]['starttime'])[_0xf112('0x6b')](_0xf112('0x6c'))};for(var _0x444390=0x0,_0xd78930=_0x39a651[_0xf112('0x37')];_0x444390<_0xd78930;_0x444390++){if(_0x39a651[_0x444390][_0xf112('0x6d')]==_0x5003dd[_0x1575b9]['id']&&_0x4950ec[_0xf112('0x38')](_0x39a651[_0x444390][_0xf112('0x69')])){_0x8af59b[_0x4950ec[_0x39a651[_0x444390][_0xf112('0x69')]]]=_0x39a651[_0x444390][_0xf112('0x6e')];}}for(var _0x5d965b in _0x4950ec){if(!_0x8af59b['hasOwnProperty'](_0x4950ec[_0x5d965b])){_0x8af59b[_0x4950ec[_0x5d965b]]=null;}}_0x899e9f[_0xf112('0x6f')](_0x8af59b);}return _0x899e9f;}})[_0xf112('0x23')](function(_0x15dd8f){if(!_[_0xf112('0x70')](_0x15dd8f)){var _0x1e172d=toCsv(_0x15dd8f);var _0x43f72a=Date[_0xf112('0x71')]();fs['writeFileSync'](util[_0xf112('0x6b')](_0xf112('0x72'),_0xc09f59[_0xf112('0x52')]['id'],_0x43f72a),_0x1e172d);_0x4e8085[_0xf112('0x73')]('Content-disposition',_0xf112('0x74')+util['format'](_0xf112('0x75'),_0xc09f59['params']['id'],_0x43f72a));_0x4e8085[_0xf112('0x73')](_0xf112('0x76'),_0xf112('0x77'));return _0x4e8085[_0xf112('0x78')](util[_0xf112('0x6b')](_0xf112('0x72'),_0xc09f59[_0xf112('0x52')]['id'],_0x43f72a));}else{return _0x4e8085[_0xf112('0x18')](0xcc);}})[_0xf112('0x49')](handleError(_0x4e8085,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 7e9c590..2244329 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 _0xb715=['jscripty_projects','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x3ac179,_0x2832d4){var _0x5565f1=function(_0x7695a1){while(--_0x7695a1){_0x3ac179['push'](_0x3ac179['shift']());}};_0x5565f1(++_0x2832d4);}(_0xb715,0x16d));var _0x5b71=function(_0x7993a1,_0x3f3ff8){_0x7993a1=_0x7993a1-0x0;var _0xe47ad0=_0xb715[_0x7993a1];return _0xe47ad0;};'use strict';var _=require('lodash');var util=require(_0x5b71('0x0'));var logger=require('../../config/logger')(_0x5b71('0x1'));var moment=require(_0x5b71('0x2'));var BPromise=require('bluebird');var rp=require(_0x5b71('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5b71('0x4'));var config=require(_0x5b71('0x5'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x887674,_0x2a2950){return _0x887674['define']('JscriptyProject',attributes,{'tableName':_0x5b71('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63b6=['rimraf','../../config/environment','./jscriptyProject.attributes','define','jscripty_projects','lodash','util','../../config/logger','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63b6,0x127));var _0x663b=function(_0x440a26,_0xf3f67d){_0x440a26=_0x440a26-0x0;var _0x505dc7=_0x63b6[_0x440a26];return _0x505dc7;};'use strict';var _=require(_0x663b('0x0'));var util=require(_0x663b('0x1'));var logger=require(_0x663b('0x2'))('api');var moment=require(_0x663b('0x3'));var BPromise=require('bluebird');var rp=require(_0x663b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x663b('0x5'));var config=require(_0x663b('0x6'));var attributes=require(_0x663b('0x7'));module['exports']=function(_0x4486b1,_0x57e43e){return _0x4486b1[_0x663b('0x8')]('JscriptyProject',attributes,{'tableName':_0x663b('0x9'),'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 a0feea7..91aede9 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 _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x500e16,_0x30ec9a){var _0x54f1d1=function(_0x80d24b){while(--_0x80d24b){_0x500e16['push'](_0x500e16['shift']());}};_0x54f1d1(++_0x30ec9a);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5e73ac,_0x3d64c8){_0x5e73ac=_0x5e73ac-0x0;var _0xb42a18=_0xf4eb[_0x5e73ac];return _0xb42a18;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ 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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xac4a,0x13f));var _0xaac4=function(_0x2ec8cb,_0x558afe){_0x2ec8cb=_0x2ec8cb-0x0;var _0xc21cde=_0xac4a[_0x2ec8cb];return _0xc21cde;};'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 b038388..5487d30 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 _0xd293=['show','create','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','/:id'];(function(_0x37f755,_0x4338e6){var _0x29c2b1=function(_0x18a9fb){while(--_0x18a9fb){_0x37f755['push'](_0x37f755['shift']());}};_0x29c2b1(++_0x4338e6);}(_0xd293,0x180));var _0x3d29=function(_0x447c25,_0x5890ed){_0x447c25=_0x447c25-0x0;var _0x3fb426=_0xd293[_0x447c25];return _0x3fb426;};'use strict';var multer=require('multer');var util=require(_0x3d29('0x0'));var path=require(_0x3d29('0x1'));var timeout=require(_0x3d29('0x2'));var express=require('express');var router=express[_0x3d29('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3d29('0x4'));var interaction=require(_0x3d29('0x5'));var config=require('../../config/environment');var controller=require(_0x3d29('0x6'));router['get']('/',auth[_0x3d29('0x7')](),controller[_0x3d29('0x8')]);router[_0x3d29('0x9')](_0x3d29('0xa'),auth[_0x3d29('0x7')](),controller['describe']);router['get'](_0x3d29('0xb'),auth['isAuthenticated'](),controller[_0x3d29('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3d29('0xd')]);router['put'](_0x3d29('0xb'),auth[_0x3d29('0x7')](),controller[_0x3d29('0xe')]);router[_0x3d29('0xf')](_0x3d29('0xb'),auth[_0x3d29('0x7')](),controller[_0x3d29('0x10')]);module[_0x3d29('0x11')]=router; \ No newline at end of file +var _0xdf85=['../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3eea0a,_0x4d4e75){var _0x211124=function(_0x18ca17){while(--_0x18ca17){_0x3eea0a['push'](_0x3eea0a['shift']());}};_0x211124(++_0x4d4e75);}(_0xdf85,0x194));var _0x5df8=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xdf85[_0x11005e];return _0x29338f;};'use strict';var multer=require(_0x5df8('0x0'));var util=require(_0x5df8('0x1'));var path=require(_0x5df8('0x2'));var timeout=require(_0x5df8('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5df8('0x4'));var controller=require(_0x5df8('0x5'));router[_0x5df8('0x6')]('/',auth[_0x5df8('0x7')](),controller['index']);router[_0x5df8('0x6')](_0x5df8('0x8'),auth[_0x5df8('0x7')](),controller[_0x5df8('0x9')]);router[_0x5df8('0x6')](_0x5df8('0xa'),auth[_0x5df8('0x7')](),controller[_0x5df8('0xb')]);router[_0x5df8('0xc')]('/',auth[_0x5df8('0x7')](),controller['create']);router[_0x5df8('0xd')]('/:id',auth[_0x5df8('0x7')](),controller[_0x5df8('0xe')]);router['delete'](_0x5df8('0xa'),auth[_0x5df8('0x7')](),controller[_0x5df8('0xf')]);module[_0x5df8('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 6723baf..b148bee 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(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x7a54,0x106));var _0x47a5=function(_0x2203de,_0x1ed045){_0x2203de=_0x2203de-0x0;var _0x260e0a=_0x7a54[_0x2203de];return _0x260e0a;};'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(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x7a54,0x106));var _0x47a5=function(_0x15dc0a,_0x4dad1b){_0x15dc0a=_0x15dc0a-0x0;var _0x518fcc=_0x7a54[_0x15dc0a];return _0x518fcc;};'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 b106ee2..e3975f3 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 _0x6805=['intersection','model','attributes','fields','length','nolimit','order','pick','filter','where','merge','VIRTUAL','options','include','rows','show','params','keys','includeAll','find','catch','create','update','body','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','map','JscriptyQuestionReport','rawAttributes','type','key','query','filters'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x6805,0x1c9));var _0x5680=function(_0x45d31e,_0x474b03){_0x45d31e=_0x45d31e-0x0;var _0x18463d=_0x6805[_0x45d31e];return _0x18463d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5680('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5680('0x1'));var rp=require(_0x5680('0x2'));var moment=require('moment');var BPromise=require(_0x5680('0x3'));var Mustache=require(_0x5680('0x4'));var util=require('util');var path=require(_0x5680('0x5'));var sox=require(_0x5680('0x6'));var csv=require(_0x5680('0x7'));var ejs=require(_0x5680('0x8'));var fs=require('fs');var fs_extra=require(_0x5680('0x9'));var _=require('lodash');var squel=require(_0x5680('0xa'));var crypto=require(_0x5680('0xb'));var jsforce=require(_0x5680('0xc'));var deskjs=require(_0x5680('0xd'));var toCsv=require(_0x5680('0x7'));var querystring=require(_0x5680('0xe'));var Papa=require('papaparse');var Redis=require(_0x5680('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5680('0x10'));var as=require(_0x5680('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5680('0x12'))(_0x5680('0x13'));var utils=require(_0x5680('0x14'));var config=require(_0x5680('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5680('0x16'))['db'];function respondWithStatusCode(_0x414141,_0x2b6e8b){_0x2b6e8b=_0x2b6e8b||0xcc;return function(_0x4d4123){if(_0x4d4123){return _0x414141[_0x5680('0x17')](_0x2b6e8b);}return _0x414141[_0x5680('0x18')](_0x2b6e8b)[_0x5680('0x19')]();};}function respondWithResult(_0x54c620,_0x4a5281){_0x4a5281=_0x4a5281||0xc8;return function(_0xc9a822){if(_0xc9a822){return _0x54c620[_0x5680('0x18')](_0x4a5281)[_0x5680('0x1a')](_0xc9a822);}};}function respondWithFilteredResult(_0x2c4c13,_0x3d7028){return function(_0x11ce70){if(_0x11ce70){var _0x3cd036=typeof _0x3d7028[_0x5680('0x1b')]==='undefined'&&typeof _0x3d7028['limit']===_0x5680('0x1c');var _0x5b307b=_0x11ce70['count'];var _0x126ac6=_0x3cd036?0x0:_0x3d7028['offset'];var _0x54d685=_0x3cd036?_0x11ce70[_0x5680('0x1d')]:_0x3d7028['offset']+_0x3d7028[_0x5680('0x1e')];var _0x2a3ab1;if(_0x54d685>=_0x5b307b){_0x54d685=_0x5b307b;_0x2a3ab1=0xc8;}else{_0x2a3ab1=0xce;}_0x2c4c13[_0x5680('0x18')](_0x2a3ab1);return _0x2c4c13[_0x5680('0x1f')](_0x5680('0x20'),_0x126ac6+'-'+_0x54d685+'/'+_0x5b307b)[_0x5680('0x1a')](_0x11ce70);}return null;};}function patchUpdates(_0x34a6d8){return function(_0x38c5ca){try{jsonpatch[_0x5680('0x21')](_0x38c5ca,_0x34a6d8,!![]);}catch(_0xe7423a){return BPromise[_0x5680('0x22')](_0xe7423a);}return _0x38c5ca[_0x5680('0x23')]();};}function saveUpdates(_0x57d59d,_0x1bbca9){return function(_0x204acf){if(_0x204acf){return _0x204acf['update'](_0x57d59d)[_0x5680('0x24')](function(_0x26e20d){return _0x26e20d;});}return null;};}function removeEntity(_0x48313c,_0x2a7bf7){return function(_0x44cb5a){if(_0x44cb5a){return _0x44cb5a[_0x5680('0x25')]()['then'](function(){_0x48313c[_0x5680('0x18')](0xcc)[_0x5680('0x19')]();});}};}function handleEntityNotFound(_0x4ab585,_0xbc3749){return function(_0x11ae1c){if(!_0x11ae1c){_0x4ab585[_0x5680('0x17')](0x194);}return _0x11ae1c;};}function handleError(_0x2495b9,_0x210fc4){_0x210fc4=_0x210fc4||0x1f4;return function(_0x5ed911){logger['error'](_0x5ed911[_0x5680('0x26')]);if(_0x5ed911[_0x5680('0x27')]){delete _0x5ed911['name'];}_0x2495b9['status'](_0x210fc4)['send'](_0x5ed911);};}exports['index']=function(_0x23cd22,_0x4cb655){var _0x4bf543={},_0x283759={},_0x21a095={'count':0x0,'rows':[]};var _0x48d1ef=_[_0x5680('0x28')](db[_0x5680('0x29')][_0x5680('0x2a')],function(_0x3488ec){return{'name':_0x3488ec['fieldName'],'type':_0x3488ec[_0x5680('0x2b')][_0x5680('0x2c')]};});_0x283759['model']=_['map'](_0x48d1ef,_0x5680('0x27'));_0x283759[_0x5680('0x2d')]=_['keys'](_0x23cd22['query']);_0x283759[_0x5680('0x2e')]=_[_0x5680('0x2f')](_0x283759[_0x5680('0x30')],_0x283759[_0x5680('0x2d')]);_0x4bf543[_0x5680('0x31')]=_[_0x5680('0x2f')](_0x283759[_0x5680('0x30')],qs[_0x5680('0x32')](_0x23cd22['query']['fields']));_0x4bf543['attributes']=_0x4bf543[_0x5680('0x31')][_0x5680('0x33')]?_0x4bf543[_0x5680('0x31')]:_0x283759[_0x5680('0x30')];if(!_0x23cd22['query']['hasOwnProperty'](_0x5680('0x34'))){_0x4bf543[_0x5680('0x1e')]=qs['limit'](_0x23cd22['query'][_0x5680('0x1e')]);_0x4bf543[_0x5680('0x1b')]=qs[_0x5680('0x1b')](_0x23cd22[_0x5680('0x2d')]['offset']);}_0x4bf543[_0x5680('0x35')]=qs['sort'](_0x23cd22[_0x5680('0x2d')]['sort']);_0x4bf543['where']=qs[_0x5680('0x2e')](_[_0x5680('0x36')](_0x23cd22[_0x5680('0x2d')],_0x283759[_0x5680('0x2e')]),_0x48d1ef);if(_0x23cd22[_0x5680('0x2d')][_0x5680('0x37')]){_0x4bf543[_0x5680('0x38')]=_[_0x5680('0x39')](_0x4bf543['where'],{'$or':_[_0x5680('0x28')](_0x48d1ef,function(_0x158581){if(_0x158581[_0x5680('0x2b')]!==_0x5680('0x3a')){var _0xd15f7a={};_0xd15f7a[_0x158581[_0x5680('0x27')]]={'$like':'%'+_0x23cd22[_0x5680('0x2d')][_0x5680('0x37')]+'%'};return _0xd15f7a;}})});}_0x4bf543=_[_0x5680('0x39')]({},_0x4bf543,_0x23cd22[_0x5680('0x3b')]);var _0x4e18bd={'where':_0x4bf543[_0x5680('0x38')]};return db[_0x5680('0x29')]['count'](_0x4e18bd)['then'](function(_0x4a0753){_0x21a095[_0x5680('0x1d')]=_0x4a0753;if(_0x23cd22[_0x5680('0x2d')]['includeAll']){_0x4bf543[_0x5680('0x3c')]=[{'all':!![]}];}return db[_0x5680('0x29')]['findAll'](_0x4bf543);})['then'](function(_0x123e20){_0x21a095[_0x5680('0x3d')]=_0x123e20;return _0x21a095;})[_0x5680('0x24')](respondWithFilteredResult(_0x4cb655,_0x4bf543))['catch'](handleError(_0x4cb655,null));};exports[_0x5680('0x3e')]=function(_0x2d7f97,_0x1154b8){var _0x3041d0={'raw':!![],'where':{'id':_0x2d7f97[_0x5680('0x3f')]['id']}},_0x596d0b={};_0x596d0b[_0x5680('0x30')]=_[_0x5680('0x40')](db[_0x5680('0x29')][_0x5680('0x2a')]);_0x596d0b[_0x5680('0x2d')]=_[_0x5680('0x40')](_0x2d7f97[_0x5680('0x2d')]);_0x596d0b[_0x5680('0x2e')]=_[_0x5680('0x2f')](_0x596d0b[_0x5680('0x30')],_0x596d0b[_0x5680('0x2d')]);_0x3041d0['attributes']=_[_0x5680('0x2f')](_0x596d0b[_0x5680('0x30')],qs[_0x5680('0x32')](_0x2d7f97[_0x5680('0x2d')][_0x5680('0x32')]));_0x3041d0[_0x5680('0x31')]=_0x3041d0[_0x5680('0x31')][_0x5680('0x33')]?_0x3041d0[_0x5680('0x31')]:_0x596d0b['model'];if(_0x2d7f97[_0x5680('0x2d')][_0x5680('0x41')]){_0x3041d0[_0x5680('0x3c')]=[{'all':!![]}];}_0x3041d0=_[_0x5680('0x39')]({},_0x3041d0,_0x2d7f97[_0x5680('0x3b')]);return db[_0x5680('0x29')][_0x5680('0x42')](_0x3041d0)['then'](handleEntityNotFound(_0x1154b8,null))[_0x5680('0x24')](respondWithResult(_0x1154b8,null))[_0x5680('0x43')](handleError(_0x1154b8,null));};exports[_0x5680('0x44')]=function(_0x1e1805,_0x313dd3){return db[_0x5680('0x29')][_0x5680('0x44')](_0x1e1805['body'],{})['then'](respondWithResult(_0x313dd3,0xc9))[_0x5680('0x43')](handleError(_0x313dd3,null));};exports[_0x5680('0x45')]=function(_0x21c904,_0x56a3ac){if(_0x21c904[_0x5680('0x46')]['id']){delete _0x21c904[_0x5680('0x46')]['id'];}return db[_0x5680('0x29')][_0x5680('0x42')]({'where':{'id':_0x21c904[_0x5680('0x3f')]['id']}})[_0x5680('0x24')](handleEntityNotFound(_0x56a3ac,null))[_0x5680('0x24')](saveUpdates(_0x21c904[_0x5680('0x46')],null))[_0x5680('0x24')](respondWithResult(_0x56a3ac,null))[_0x5680('0x43')](handleError(_0x56a3ac,null));};exports[_0x5680('0x25')]=function(_0x14fc1f,_0x19afc3){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x14fc1f[_0x5680('0x3f')]['id']}})[_0x5680('0x24')](handleEntityNotFound(_0x19afc3,null))['then'](removeEntity(_0x19afc3,null))[_0x5680('0x43')](handleError(_0x19afc3,null));};exports['describe']=function(_0xdf4d63,_0x16c5c4){return db[_0x5680('0x29')][_0x5680('0x47')]()[_0x5680('0x24')](respondWithResult(_0x16c5c4,null))[_0x5680('0x43')](handleError(_0x16c5c4,null));}; \ No newline at end of file +var _0x8cf5=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','JscriptyQuestionReport','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','options','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0x8cf5,0x154));var _0x58cf=function(_0x460a08,_0x57f832){_0x460a08=_0x460a08-0x0;var _0x48467e=_0x8cf5[_0x460a08];return _0x48467e;};'use strict';var emlformat=require(_0x58cf('0x0'));var rimraf=require(_0x58cf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x58cf('0x2'));var rp=require(_0x58cf('0x3'));var moment=require(_0x58cf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x58cf('0x5'));var util=require(_0x58cf('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x58cf('0x7'));var ejs=require(_0x58cf('0x8'));var fs=require('fs');var fs_extra=require(_0x58cf('0x9'));var _=require(_0x58cf('0xa'));var squel=require(_0x58cf('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x58cf('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x58cf('0xc'));var authService=require(_0x58cf('0xd'));var qs=require(_0x58cf('0xe'));var as=require(_0x58cf('0xf'));var hardwareService=require(_0x58cf('0x10'));var logger=require(_0x58cf('0x11'))(_0x58cf('0x12'));var utils=require(_0x58cf('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e69ed,_0x17a3bd){_0x17a3bd=_0x17a3bd||0xcc;return function(_0x2c0623){if(_0x2c0623){return _0x3e69ed[_0x58cf('0x14')](_0x17a3bd);}return _0x3e69ed[_0x58cf('0x15')](_0x17a3bd)[_0x58cf('0x16')]();};}function respondWithResult(_0x5cfd84,_0x5cd5b1){_0x5cd5b1=_0x5cd5b1||0xc8;return function(_0x4f8619){if(_0x4f8619){return _0x5cfd84[_0x58cf('0x15')](_0x5cd5b1)[_0x58cf('0x17')](_0x4f8619);}};}function respondWithFilteredResult(_0x34e4ec,_0x5c7d2e){return function(_0x5c6bbb){if(_0x5c6bbb){var _0xf1f47c=typeof _0x5c7d2e[_0x58cf('0x18')]==='undefined'&&typeof _0x5c7d2e[_0x58cf('0x19')]===_0x58cf('0x1a');var _0x383a5b=_0x5c6bbb[_0x58cf('0x1b')];var _0x484c76=_0xf1f47c?0x0:_0x5c7d2e[_0x58cf('0x18')];var _0x116226=_0xf1f47c?_0x5c6bbb[_0x58cf('0x1b')]:_0x5c7d2e['offset']+_0x5c7d2e[_0x58cf('0x19')];var _0x33590d;if(_0x116226>=_0x383a5b){_0x116226=_0x383a5b;_0x33590d=0xc8;}else{_0x33590d=0xce;}_0x34e4ec[_0x58cf('0x15')](_0x33590d);return _0x34e4ec[_0x58cf('0x1c')](_0x58cf('0x1d'),_0x484c76+'-'+_0x116226+'/'+_0x383a5b)[_0x58cf('0x17')](_0x5c6bbb);}return null;};}function patchUpdates(_0x43b35d){return function(_0x1da619){try{jsonpatch['apply'](_0x1da619,_0x43b35d,!![]);}catch(_0x3fe3fd){return BPromise[_0x58cf('0x1e')](_0x3fe3fd);}return _0x1da619[_0x58cf('0x1f')]();};}function saveUpdates(_0x195995,_0x4dbb72){return function(_0x1a2fb2){if(_0x1a2fb2){return _0x1a2fb2[_0x58cf('0x20')](_0x195995)[_0x58cf('0x21')](function(_0x8251ff){return _0x8251ff;});}return null;};}function removeEntity(_0x2a76c1,_0x10b536){return function(_0xcf3b56){if(_0xcf3b56){return _0xcf3b56[_0x58cf('0x22')]()[_0x58cf('0x21')](function(){_0x2a76c1[_0x58cf('0x15')](0xcc)[_0x58cf('0x16')]();});}};}function handleEntityNotFound(_0x375aa3,_0x1e2475){return function(_0x1e0eb8){if(!_0x1e0eb8){_0x375aa3[_0x58cf('0x14')](0x194);}return _0x1e0eb8;};}function handleError(_0x536df6,_0x3ae698){_0x3ae698=_0x3ae698||0x1f4;return function(_0x228660){logger[_0x58cf('0x23')](_0x228660[_0x58cf('0x24')]);if(_0x228660[_0x58cf('0x25')]){delete _0x228660[_0x58cf('0x25')];}_0x536df6[_0x58cf('0x15')](_0x3ae698)['send'](_0x228660);};}exports[_0x58cf('0x26')]=function(_0xbab33f,_0x17e3aa){var _0x54c789={},_0x187ee4={},_0xd52e38={'count':0x0,'rows':[]};var _0x49d599=_['map'](db[_0x58cf('0x27')]['rawAttributes'],function(_0x3e5b42){return{'name':_0x3e5b42[_0x58cf('0x28')],'type':_0x3e5b42[_0x58cf('0x29')][_0x58cf('0x2a')]};});_0x187ee4[_0x58cf('0x2b')]=_[_0x58cf('0x2c')](_0x49d599,_0x58cf('0x25'));_0x187ee4[_0x58cf('0x2d')]=_['keys'](_0xbab33f[_0x58cf('0x2d')]);_0x187ee4['filters']=_[_0x58cf('0x2e')](_0x187ee4[_0x58cf('0x2b')],_0x187ee4[_0x58cf('0x2d')]);_0x54c789[_0x58cf('0x2f')]=_['intersection'](_0x187ee4['model'],qs['fields'](_0xbab33f[_0x58cf('0x2d')][_0x58cf('0x30')]));_0x54c789[_0x58cf('0x2f')]=_0x54c789[_0x58cf('0x2f')][_0x58cf('0x31')]?_0x54c789[_0x58cf('0x2f')]:_0x187ee4['model'];if(!_0xbab33f[_0x58cf('0x2d')][_0x58cf('0x32')]('nolimit')){_0x54c789[_0x58cf('0x19')]=qs[_0x58cf('0x19')](_0xbab33f['query'][_0x58cf('0x19')]);_0x54c789[_0x58cf('0x18')]=qs[_0x58cf('0x18')](_0xbab33f[_0x58cf('0x2d')][_0x58cf('0x18')]);}_0x54c789['order']=qs[_0x58cf('0x33')](_0xbab33f[_0x58cf('0x2d')][_0x58cf('0x33')]);_0x54c789[_0x58cf('0x34')]=qs[_0x58cf('0x35')](_[_0x58cf('0x36')](_0xbab33f[_0x58cf('0x2d')],_0x187ee4[_0x58cf('0x35')]),_0x49d599);if(_0xbab33f[_0x58cf('0x2d')]['filter']){_0x54c789[_0x58cf('0x34')]=_[_0x58cf('0x37')](_0x54c789['where'],{'$or':_[_0x58cf('0x2c')](_0x49d599,function(_0x196a23){if(_0x196a23[_0x58cf('0x29')]!==_0x58cf('0x38')){var _0x4eab68={};_0x4eab68[_0x196a23[_0x58cf('0x25')]]={'$like':'%'+_0xbab33f[_0x58cf('0x2d')][_0x58cf('0x39')]+'%'};return _0x4eab68;}})});}_0x54c789=_[_0x58cf('0x37')]({},_0x54c789,_0xbab33f['options']);var _0x5773b6={'where':_0x54c789[_0x58cf('0x34')]};return db[_0x58cf('0x27')][_0x58cf('0x1b')](_0x5773b6)[_0x58cf('0x21')](function(_0x3a9f3e){_0xd52e38[_0x58cf('0x1b')]=_0x3a9f3e;if(_0xbab33f[_0x58cf('0x2d')][_0x58cf('0x3a')]){_0x54c789[_0x58cf('0x3b')]=[{'all':!![]}];}return db[_0x58cf('0x27')][_0x58cf('0x3c')](_0x54c789);})[_0x58cf('0x21')](function(_0x2613a2){_0xd52e38[_0x58cf('0x3d')]=_0x2613a2;return _0xd52e38;})[_0x58cf('0x21')](respondWithFilteredResult(_0x17e3aa,_0x54c789))[_0x58cf('0x3e')](handleError(_0x17e3aa,null));};exports['show']=function(_0xf33ad3,_0x496d07){var _0x1ee9c5={'raw':!![],'where':{'id':_0xf33ad3[_0x58cf('0x3f')]['id']}},_0x2695e9={};_0x2695e9[_0x58cf('0x2b')]=_[_0x58cf('0x40')](db[_0x58cf('0x27')][_0x58cf('0x41')]);_0x2695e9['query']=_['keys'](_0xf33ad3[_0x58cf('0x2d')]);_0x2695e9['filters']=_[_0x58cf('0x2e')](_0x2695e9['model'],_0x2695e9[_0x58cf('0x2d')]);_0x1ee9c5[_0x58cf('0x2f')]=_['intersection'](_0x2695e9[_0x58cf('0x2b')],qs[_0x58cf('0x30')](_0xf33ad3[_0x58cf('0x2d')]['fields']));_0x1ee9c5[_0x58cf('0x2f')]=_0x1ee9c5[_0x58cf('0x2f')][_0x58cf('0x31')]?_0x1ee9c5[_0x58cf('0x2f')]:_0x2695e9[_0x58cf('0x2b')];if(_0xf33ad3['query'][_0x58cf('0x3a')]){_0x1ee9c5[_0x58cf('0x3b')]=[{'all':!![]}];}_0x1ee9c5=_['merge']({},_0x1ee9c5,_0xf33ad3[_0x58cf('0x42')]);return db[_0x58cf('0x27')]['find'](_0x1ee9c5)[_0x58cf('0x21')](handleEntityNotFound(_0x496d07,null))[_0x58cf('0x21')](respondWithResult(_0x496d07,null))[_0x58cf('0x3e')](handleError(_0x496d07,null));};exports[_0x58cf('0x43')]=function(_0x22916f,_0x7b542d){return db[_0x58cf('0x27')]['create'](_0x22916f[_0x58cf('0x44')],{})[_0x58cf('0x21')](respondWithResult(_0x7b542d,0xc9))[_0x58cf('0x3e')](handleError(_0x7b542d,null));};exports[_0x58cf('0x20')]=function(_0x34685f,_0x5434ca){if(_0x34685f[_0x58cf('0x44')]['id']){delete _0x34685f[_0x58cf('0x44')]['id'];}return db[_0x58cf('0x27')][_0x58cf('0x45')]({'where':{'id':_0x34685f[_0x58cf('0x3f')]['id']}})[_0x58cf('0x21')](handleEntityNotFound(_0x5434ca,null))[_0x58cf('0x21')](saveUpdates(_0x34685f['body'],null))[_0x58cf('0x21')](respondWithResult(_0x5434ca,null))[_0x58cf('0x3e')](handleError(_0x5434ca,null));};exports[_0x58cf('0x22')]=function(_0x4a7673,_0x3ae47c){return db[_0x58cf('0x27')][_0x58cf('0x45')]({'where':{'id':_0x4a7673['params']['id']}})[_0x58cf('0x21')](handleEntityNotFound(_0x3ae47c,null))['then'](removeEntity(_0x3ae47c,null))[_0x58cf('0x3e')](handleError(_0x3ae47c,null));};exports[_0x58cf('0x46')]=function(_0x1dc26f,_0x2cd5ed){return db[_0x58cf('0x27')][_0x58cf('0x46')]()[_0x58cf('0x21')](respondWithResult(_0x2cd5ed,null))[_0x58cf('0x3e')](handleError(_0x2cd5ed,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 4366f15..981cf48 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 _0x937a=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','lodash'];(function(_0x25a574,_0x932152){var _0x2e0f19=function(_0x5b75a3){while(--_0x5b75a3){_0x25a574['push'](_0x25a574['shift']());}};_0x2e0f19(++_0x932152);}(_0x937a,0x1ed));var _0xa937=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0x937a[_0x311909];return _0x8d3163;};'use strict';var _=require(_0xa937('0x0'));var util=require(_0xa937('0x1'));var logger=require(_0xa937('0x2'))(_0xa937('0x3'));var moment=require(_0xa937('0x4'));var BPromise=require(_0xa937('0x5'));var rp=require(_0xa937('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa937('0x7'));var config=require(_0xa937('0x8'));var attributes=require(_0xa937('0x9'));module[_0xa937('0xa')]=function(_0x12446c,_0x4a649c){return _0x12446c[_0xa937('0xb')](_0xa937('0xc'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d85=['define','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','api','moment','request-promise','rimraf','./jscriptyQuestionReport.attributes','exports'];(function(_0x28abcc,_0x491ec2){var _0x3ab43d=function(_0x134eec){while(--_0x134eec){_0x28abcc['push'](_0x28abcc['shift']());}};_0x3ab43d(++_0x491ec2);}(_0x3d85,0x1a5));var _0x53d8=function(_0x4e2011,_0xaca3dd){_0x4e2011=_0x4e2011-0x0;var _0x155cd5=_0x3d85[_0x4e2011];return _0x155cd5;};'use strict';var _=require(_0x53d8('0x0'));var util=require('util');var logger=require(_0x53d8('0x1'))(_0x53d8('0x2'));var moment=require(_0x53d8('0x3'));var BPromise=require('bluebird');var rp=require(_0x53d8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53d8('0x5'));var config=require('../../config/environment');var attributes=require(_0x53d8('0x6'));module[_0x53d8('0x7')]=function(_0x1c0232,_0x532d07){return _0x1c0232[_0x53d8('0x8')](_0x53d8('0x9'),attributes,{'tableName':_0x53d8('0xa'),'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 043198d..8549026 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 _0x5790=['http','request','then','info','request\x20sent','debug','stringify','error','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x410153,_0xec9c6f){var _0x1d7ed6=function(_0x1555d8){while(--_0x1555d8){_0x410153['push'](_0x410153['shift']());}};_0x1d7ed6(++_0xec9c6f);}(_0x5790,0x1ef));var _0x0579=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5790[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x0579('0x0'));var util=require(_0x0579('0x1'));var moment=require(_0x0579('0x2'));var BPromise=require(_0x0579('0x3'));var rs=require(_0x0579('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0579('0x5'))['db'];var utils=require(_0x0579('0x6'));var logger=require(_0x0579('0x7'))(_0x0579('0x8'));var config=require(_0x0579('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0579('0xa')][_0x0579('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ee022,_0x150dba,_0xf40798){return new BPromise(function(_0x397dd6,_0x2091c9){return client[_0x0579('0xc')](_0x4ee022,_0xf40798)[_0x0579('0xd')](function(_0x96988e){logger[_0x0579('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x150dba,_0x0579('0xf'));logger[_0x0579('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x150dba,_0x0579('0xf'),JSON[_0x0579('0x11')](_0x96988e));if(_0x96988e['error']){if(_0x96988e[_0x0579('0x12')]['code']===0x1f4){logger['error'](_0x0579('0x13'),_0x150dba,_0x96988e[_0x0579('0x12')][_0x0579('0x14')]);return _0x2091c9(_0x96988e['error'][_0x0579('0x14')]);}logger[_0x0579('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x150dba,_0x96988e['error'][_0x0579('0x14')]);return _0x397dd6(_0x96988e[_0x0579('0x12')][_0x0579('0x14')]);}else{logger['info'](_0x0579('0x13'),_0x150dba,'request\x20sent');_0x397dd6(_0x96988e[_0x0579('0x15')][_0x0579('0x14')]);}})[_0x0579('0x16')](function(_0x27c0c1){logger['error'](_0x0579('0x13'),_0x150dba,_0x27c0c1);_0x2091c9(_0x27c0c1);});});} \ No newline at end of file +var _0x3c14=['../../config/logger','../../config/environment','jayson/promise','client','http','then','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xd80630,_0x5834be){var _0x2da455=function(_0x543c19){while(--_0x543c19){_0xd80630['push'](_0xd80630['shift']());}};_0x2da455(++_0x5834be);}(_0x3c14,0x176));var _0x43c1=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x3c14[_0x2642cb];return _0xe6e41;};'use strict';var _=require(_0x43c1('0x0'));var util=require('util');var moment=require(_0x43c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x43c1('0x2'));var fs=require('fs');var Redis=require(_0x43c1('0x3'));var db=require(_0x43c1('0x4'))['db'];var utils=require(_0x43c1('0x5'));var logger=require(_0x43c1('0x6'))('rpc');var config=require(_0x43c1('0x7'));var jayson=require(_0x43c1('0x8'));var client=jayson[_0x43c1('0x9')][_0x43c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36c717,_0x4ae2a9,_0x6eae27){return new BPromise(function(_0x1ddb4f,_0x11c88b){return client['request'](_0x36c717,_0x6eae27)[_0x43c1('0xb')](function(_0x2886b1){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x4ae2a9,'request\x20sent');logger['debug'](_0x43c1('0xc'),_0x4ae2a9,_0x43c1('0xd'),JSON[_0x43c1('0xe')](_0x2886b1));if(_0x2886b1[_0x43c1('0xf')]){if(_0x2886b1[_0x43c1('0xf')][_0x43c1('0x10')]===0x1f4){logger[_0x43c1('0xf')](_0x43c1('0x11'),_0x4ae2a9,_0x2886b1['error'][_0x43c1('0x12')]);return _0x11c88b(_0x2886b1[_0x43c1('0xf')][_0x43c1('0x12')]);}logger['error'](_0x43c1('0x11'),_0x4ae2a9,_0x2886b1['error'][_0x43c1('0x12')]);return _0x1ddb4f(_0x2886b1[_0x43c1('0xf')]['message']);}else{logger['info'](_0x43c1('0x11'),_0x4ae2a9,'request\x20sent');_0x1ddb4f(_0x2886b1['result'][_0x43c1('0x12')]);}})[_0x43c1('0x13')](function(_0x51dd9a){logger[_0x43c1('0xf')](_0x43c1('0x11'),_0x4ae2a9,_0x51dd9a);_0x11c88b(_0x51dd9a);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 354bb87..84b19df 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 _0x0837=['/:id/questions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x125b94,_0x76da1f){var _0x37102e=function(_0x56dd7e){while(--_0x56dd7e){_0x125b94['push'](_0x125b94['shift']());}};_0x37102e(++_0x76da1f);}(_0x0837,0x16d));var _0x7083=function(_0x121b65,_0x2f4a45){_0x121b65=_0x121b65-0x0;var _0x3c1a75=_0x0837[_0x121b65];return _0x3c1a75;};'use strict';var multer=require(_0x7083('0x0'));var util=require(_0x7083('0x1'));var path=require('path');var timeout=require(_0x7083('0x2'));var express=require('express');var router=express[_0x7083('0x3')]();var fs_extra=require(_0x7083('0x4'));var auth=require(_0x7083('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7083('0x6'));var controller=require('./jscriptySessionReport.controller');router[_0x7083('0x7')]('/',auth[_0x7083('0x8')](),controller[_0x7083('0x9')]);router[_0x7083('0x7')](_0x7083('0xa'),auth[_0x7083('0x8')](),controller['describe']);router[_0x7083('0x7')](_0x7083('0xb'),auth[_0x7083('0x8')](),controller[_0x7083('0xc')]);router['get'](_0x7083('0xd'),auth[_0x7083('0x8')](),controller['getQuestions']);router[_0x7083('0xe')]('/',auth['isAuthenticated'](),controller[_0x7083('0xf')]);router[_0x7083('0x10')]('/:id',auth[_0x7083('0x8')](),controller[_0x7083('0x11')]);router[_0x7083('0x12')](_0x7083('0xb'),auth[_0x7083('0x8')](),controller[_0x7083('0x13')]);module[_0x7083('0x14')]=router; \ No newline at end of file +var _0x7628=['destroy','exports','util','connect-timeout','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x7628,0x11f));var _0x8762=function(_0x18f772,_0x5e1ed7){_0x18f772=_0x18f772-0x0;var _0x1b239b=_0x7628[_0x18f772];return _0x1b239b;};'use strict';var multer=require('multer');var util=require(_0x8762('0x0'));var path=require('path');var timeout=require(_0x8762('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8762('0x2'));var controller=require('./jscriptySessionReport.controller');router[_0x8762('0x3')]('/',auth[_0x8762('0x4')](),controller[_0x8762('0x5')]);router[_0x8762('0x3')](_0x8762('0x6'),auth[_0x8762('0x4')](),controller[_0x8762('0x7')]);router[_0x8762('0x3')](_0x8762('0x8'),auth[_0x8762('0x4')](),controller[_0x8762('0x9')]);router['get'](_0x8762('0xa'),auth[_0x8762('0x4')](),controller[_0x8762('0xb')]);router[_0x8762('0xc')]('/',auth[_0x8762('0x4')](),controller[_0x8762('0xd')]);router[_0x8762('0xe')](_0x8762('0x8'),auth['isAuthenticated'](),controller[_0x8762('0xf')]);router[_0x8762('0x10')]('/:id',auth[_0x8762('0x4')](),controller[_0x8762('0x11')]);module[_0x8762('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 46c7dd7..9b87f3d 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 _0xf926=['exports','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','moment','sequelize'];(function(_0x4fd19f,_0xb648c7){var _0x3dc57f=function(_0x39859b){while(--_0x39859b){_0x4fd19f['push'](_0x4fd19f['shift']());}};_0x3dc57f(++_0xb648c7);}(_0xf926,0xd0));var _0x6f92=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xf926[_0xdea41a];return _0x15d0d8;};'use strict';var moment=require(_0x6f92('0x0'));var Sequelize=require(_0x6f92('0x1'));module[_0x6f92('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x151127){this[_0x6f92('0x3')](_0x6f92('0x4'),_0x151127);this['setDataValue'](_0x6f92('0x5'),moment()[_0x6f92('0x6')](_0x6f92('0x7')));}},'endtime':{'type':Sequelize[_0x6f92('0x8')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x6f92('0x9')]},'queue':{'type':Sequelize[_0x6f92('0x9')]},'uniqueid':{'type':Sequelize[_0x6f92('0x9')]},'calleridname':{'type':Sequelize[_0x6f92('0x9')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x71f0=['YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','sequelize','setDataValue','endtime'];(function(_0x10b47c,_0x1add46){var _0x5900f5=function(_0x5c229d){while(--_0x5c229d){_0x10b47c['push'](_0x10b47c['shift']());}};_0x5900f5(++_0x1add46);}(_0x71f0,0x1b6));var _0x071f=function(_0x395c24,_0x48d2cb){_0x395c24=_0x395c24-0x0;var _0x1d708b=_0x71f0[_0x395c24];return _0x1d708b;};'use strict';var moment=require('moment');var Sequelize=require(_0x071f('0x0'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x1f972e){this[_0x071f('0x1')]('starttime',_0x1f972e);this[_0x071f('0x1')](_0x071f('0x2'),moment()['format'](_0x071f('0x3')));}},'endtime':{'type':Sequelize[_0x071f('0x4')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x071f('0x5')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x071f('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x071f('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index c56e6b6..d0b3052 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 _0xf918=['include','find','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','order','SessionId','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','status','end','json','limit','undefined','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','count','findAll','rows','catch','show','includeAll'];(function(_0x43cdc9,_0x35df2a){var _0x2933e0=function(_0x480a54){while(--_0x480a54){_0x43cdc9['push'](_0x43cdc9['shift']());}};_0x2933e0(++_0x35df2a);}(_0xf918,0xa3));var _0x8f91=function(_0x2e914,_0x1c7566){_0x2e914=_0x2e914-0x0;var _0x936e45=_0xf918[_0x2e914];return _0x936e45;};'use strict';var emlformat=require(_0x8f91('0x0'));var rimraf=require(_0x8f91('0x1'));var zipdir=require(_0x8f91('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8f91('0x3'));var BPromise=require(_0x8f91('0x4'));var Mustache=require('mustache');var util=require(_0x8f91('0x5'));var path=require(_0x8f91('0x6'));var sox=require('sox');var csv=require(_0x8f91('0x7'));var ejs=require(_0x8f91('0x8'));var fs=require('fs');var fs_extra=require(_0x8f91('0x9'));var _=require(_0x8f91('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8f91('0xb'));var toCsv=require(_0x8f91('0x7'));var querystring=require('querystring');var Papa=require(_0x8f91('0xc'));var Redis=require(_0x8f91('0xd'));var authService=require(_0x8f91('0xe'));var qs=require(_0x8f91('0xf'));var as=require(_0x8f91('0x10'));var hardwareService=require(_0x8f91('0x11'));var logger=require(_0x8f91('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x8f91('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ee1a8,_0x57c7d8){_0x57c7d8=_0x57c7d8||0xcc;return function(_0x21e783){if(_0x21e783){return _0x4ee1a8['sendStatus'](_0x57c7d8);}return _0x4ee1a8[_0x8f91('0x14')](_0x57c7d8)[_0x8f91('0x15')]();};}function respondWithResult(_0x35eeb6,_0x33c16c){_0x33c16c=_0x33c16c||0xc8;return function(_0x4be887){if(_0x4be887){return _0x35eeb6['status'](_0x33c16c)[_0x8f91('0x16')](_0x4be887);}};}function respondWithFilteredResult(_0x13854f,_0x2b8ab0){return function(_0x302fe3){if(_0x302fe3){var _0x204b17=typeof _0x2b8ab0['offset']==='undefined'&&typeof _0x2b8ab0[_0x8f91('0x17')]===_0x8f91('0x18');var _0x591350=_0x302fe3['count'];var _0x3e01ab=_0x204b17?0x0:_0x2b8ab0['offset'];var _0x2ae208=_0x204b17?_0x302fe3['count']:_0x2b8ab0[_0x8f91('0x19')]+_0x2b8ab0[_0x8f91('0x17')];var _0x330864;if(_0x2ae208>=_0x591350){_0x2ae208=_0x591350;_0x330864=0xc8;}else{_0x330864=0xce;}_0x13854f[_0x8f91('0x14')](_0x330864);return _0x13854f[_0x8f91('0x1a')](_0x8f91('0x1b'),_0x3e01ab+'-'+_0x2ae208+'/'+_0x591350)[_0x8f91('0x16')](_0x302fe3);}return null;};}function patchUpdates(_0x56ac37){return function(_0x59cd1d){try{jsonpatch[_0x8f91('0x1c')](_0x59cd1d,_0x56ac37,!![]);}catch(_0x170432){return BPromise['reject'](_0x170432);}return _0x59cd1d[_0x8f91('0x1d')]();};}function saveUpdates(_0x52146d,_0x2836ee){return function(_0x2ef31c){if(_0x2ef31c){return _0x2ef31c[_0x8f91('0x1e')](_0x52146d)[_0x8f91('0x1f')](function(_0x20d51d){return _0x20d51d;});}return null;};}function removeEntity(_0x438cf7,_0x3ac0d6){return function(_0x30e543){if(_0x30e543){return _0x30e543[_0x8f91('0x20')]()[_0x8f91('0x1f')](function(){_0x438cf7[_0x8f91('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa4594f,_0xecfcfb){return function(_0xd5958c){if(!_0xd5958c){_0xa4594f[_0x8f91('0x21')](0x194);}return _0xd5958c;};}function handleError(_0x408a9e,_0x337873){_0x337873=_0x337873||0x1f4;return function(_0x1c81b6){logger['error'](_0x1c81b6[_0x8f91('0x22')]);if(_0x1c81b6[_0x8f91('0x23')]){delete _0x1c81b6['name'];}_0x408a9e['status'](_0x337873)[_0x8f91('0x24')](_0x1c81b6);};}exports[_0x8f91('0x25')]=function(_0x443fd1,_0x1d78e3){var _0x5b0c70={},_0x485f39={},_0x3288a0={'count':0x0,'rows':[]};var _0xa07424=_[_0x8f91('0x26')](db[_0x8f91('0x27')][_0x8f91('0x28')],function(_0x4362e2){return{'name':_0x4362e2[_0x8f91('0x29')],'type':_0x4362e2[_0x8f91('0x2a')][_0x8f91('0x2b')]};});_0x485f39[_0x8f91('0x2c')]=_['map'](_0xa07424,'name');_0x485f39[_0x8f91('0x2d')]=_[_0x8f91('0x2e')](_0x443fd1[_0x8f91('0x2d')]);_0x485f39[_0x8f91('0x2f')]=_[_0x8f91('0x30')](_0x485f39[_0x8f91('0x2c')],_0x485f39[_0x8f91('0x2d')]);_0x5b0c70[_0x8f91('0x31')]=_[_0x8f91('0x30')](_0x485f39[_0x8f91('0x2c')],qs['fields'](_0x443fd1[_0x8f91('0x2d')][_0x8f91('0x32')]));_0x5b0c70[_0x8f91('0x31')]=_0x5b0c70['attributes'][_0x8f91('0x33')]?_0x5b0c70[_0x8f91('0x31')]:_0x485f39[_0x8f91('0x2c')];if(!_0x443fd1[_0x8f91('0x2d')]['hasOwnProperty']('nolimit')){_0x5b0c70[_0x8f91('0x17')]=qs['limit'](_0x443fd1['query'][_0x8f91('0x17')]);_0x5b0c70[_0x8f91('0x19')]=qs[_0x8f91('0x19')](_0x443fd1[_0x8f91('0x2d')][_0x8f91('0x19')]);}_0x5b0c70['order']=qs[_0x8f91('0x34')](_0x443fd1[_0x8f91('0x2d')][_0x8f91('0x34')]);_0x5b0c70[_0x8f91('0x35')]=qs['filters'](_[_0x8f91('0x36')](_0x443fd1[_0x8f91('0x2d')],_0x485f39[_0x8f91('0x2f')]),_0xa07424);if(_0x443fd1['query'][_0x8f91('0x37')]){_0x5b0c70[_0x8f91('0x35')]=_[_0x8f91('0x38')](_0x5b0c70[_0x8f91('0x35')],{'$or':_[_0x8f91('0x26')](_0xa07424,function(_0x2996c4){if(_0x2996c4[_0x8f91('0x2a')]!==_0x8f91('0x39')){var _0x2b0f67={};_0x2b0f67[_0x2996c4[_0x8f91('0x23')]]={'$like':'%'+_0x443fd1[_0x8f91('0x2d')][_0x8f91('0x37')]+'%'};return _0x2b0f67;}})});}_0x5b0c70=_[_0x8f91('0x38')]({},_0x5b0c70,_0x443fd1[_0x8f91('0x3a')]);var _0x3b4f4c={'where':_0x5b0c70['where']};return db[_0x8f91('0x27')][_0x8f91('0x3b')](_0x3b4f4c)[_0x8f91('0x1f')](function(_0x1253d9){_0x3288a0['count']=_0x1253d9;if(_0x443fd1[_0x8f91('0x2d')]['includeAll']){_0x5b0c70['include']=[{'all':!![]}];}return db[_0x8f91('0x27')][_0x8f91('0x3c')](_0x5b0c70);})[_0x8f91('0x1f')](function(_0x33fbf0){_0x3288a0[_0x8f91('0x3d')]=_0x33fbf0;return _0x3288a0;})[_0x8f91('0x1f')](respondWithFilteredResult(_0x1d78e3,_0x5b0c70))[_0x8f91('0x3e')](handleError(_0x1d78e3,null));};exports[_0x8f91('0x3f')]=function(_0x227490,_0x2efa45){var _0x355e6f={'raw':!![],'where':{'id':_0x227490['params']['id']}},_0x2ebd6a={};_0x2ebd6a[_0x8f91('0x2c')]=_[_0x8f91('0x2e')](db[_0x8f91('0x27')][_0x8f91('0x28')]);_0x2ebd6a['query']=_[_0x8f91('0x2e')](_0x227490[_0x8f91('0x2d')]);_0x2ebd6a[_0x8f91('0x2f')]=_[_0x8f91('0x30')](_0x2ebd6a[_0x8f91('0x2c')],_0x2ebd6a[_0x8f91('0x2d')]);_0x355e6f[_0x8f91('0x31')]=_[_0x8f91('0x30')](_0x2ebd6a[_0x8f91('0x2c')],qs[_0x8f91('0x32')](_0x227490['query'][_0x8f91('0x32')]));_0x355e6f['attributes']=_0x355e6f['attributes'][_0x8f91('0x33')]?_0x355e6f[_0x8f91('0x31')]:_0x2ebd6a[_0x8f91('0x2c')];if(_0x227490[_0x8f91('0x2d')][_0x8f91('0x40')]){_0x355e6f[_0x8f91('0x41')]=[{'all':!![]}];}_0x355e6f=_[_0x8f91('0x38')]({},_0x355e6f,_0x227490[_0x8f91('0x3a')]);return db[_0x8f91('0x27')][_0x8f91('0x42')](_0x355e6f)['then'](handleEntityNotFound(_0x2efa45,null))[_0x8f91('0x1f')](respondWithResult(_0x2efa45,null))[_0x8f91('0x3e')](handleError(_0x2efa45,null));};exports[_0x8f91('0x43')]=function(_0x24ddf1,_0x1adeeb){return db['JscriptySessionReport'][_0x8f91('0x43')](_0x24ddf1[_0x8f91('0x44')],{})['then'](respondWithResult(_0x1adeeb,0xc9))['catch'](handleError(_0x1adeeb,null));};exports[_0x8f91('0x1e')]=function(_0x37b957,_0x234cd9){if(_0x37b957[_0x8f91('0x44')]['id']){delete _0x37b957[_0x8f91('0x44')]['id'];}return db[_0x8f91('0x27')][_0x8f91('0x42')]({'where':{'id':_0x37b957[_0x8f91('0x45')]['id']}})[_0x8f91('0x1f')](handleEntityNotFound(_0x234cd9,null))[_0x8f91('0x1f')](saveUpdates(_0x37b957[_0x8f91('0x44')],null))[_0x8f91('0x1f')](respondWithResult(_0x234cd9,null))[_0x8f91('0x3e')](handleError(_0x234cd9,null));};exports['destroy']=function(_0xaa2b4e,_0x351edd){return db[_0x8f91('0x27')]['find']({'where':{'id':_0xaa2b4e[_0x8f91('0x45')]['id']}})['then'](handleEntityNotFound(_0x351edd,null))['then'](removeEntity(_0x351edd,null))['catch'](handleError(_0x351edd,null));};exports[_0x8f91('0x46')]=function(_0x299d5e,_0x4fe169){return db['JscriptySessionReport']['describe']()[_0x8f91('0x1f')](respondWithResult(_0x4fe169,null))[_0x8f91('0x3e')](handleError(_0x4fe169,null));};exports[_0x8f91('0x47')]=function(_0x188d05,_0x31bedd,_0xebf3da){var _0xe81eae={'raw':!![],'where':{}};var _0x55e951={};var _0x4e0aa9={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x8f91('0x48')]({'where':{'id':_0x188d05[_0x8f91('0x45')]['id']}})[_0x8f91('0x1f')](handleEntityNotFound(_0x31bedd,null))[_0x8f91('0x1f')](function(_0x26a6d6){if(_0x26a6d6){_0x55e951[_0x8f91('0x2c')]=_[_0x8f91('0x2e')](db[_0x8f91('0x49')][_0x8f91('0x28')]);_0x55e951['query']=_[_0x8f91('0x2e')](_0x188d05[_0x8f91('0x2d')]);_0x55e951[_0x8f91('0x2f')]=_[_0x8f91('0x30')](_0x55e951[_0x8f91('0x2c')],_0x55e951[_0x8f91('0x2d')]);_0xe81eae[_0x8f91('0x31')]=_[_0x8f91('0x30')](_0x55e951['model'],qs[_0x8f91('0x32')](_0x188d05['query'][_0x8f91('0x32')]));_0xe81eae[_0x8f91('0x31')]=_0xe81eae[_0x8f91('0x31')]['length']?_0xe81eae['attributes']:_0x55e951[_0x8f91('0x2c')];if(!_0x188d05['query']['hasOwnProperty']('nolimit')){_0xe81eae[_0x8f91('0x17')]=qs[_0x8f91('0x17')](_0x188d05[_0x8f91('0x2d')][_0x8f91('0x17')]);_0xe81eae[_0x8f91('0x19')]=qs['offset'](_0x188d05[_0x8f91('0x2d')][_0x8f91('0x19')]);}_0xe81eae[_0x8f91('0x4a')]=qs[_0x8f91('0x34')](_0x188d05[_0x8f91('0x2d')][_0x8f91('0x34')]);_0xe81eae[_0x8f91('0x35')]=qs[_0x8f91('0x2f')](_[_0x8f91('0x36')](_0x188d05[_0x8f91('0x2d')],_0x55e951['filters']));_0xe81eae[_0x8f91('0x35')][_0x8f91('0x4b')]=_0x26a6d6['id'];if(_0x188d05[_0x8f91('0x2d')][_0x8f91('0x37')]){_0xe81eae[_0x8f91('0x35')]=_[_0x8f91('0x38')](_0xe81eae[_0x8f91('0x35')],{'$or':_[_0x8f91('0x26')](_0xe81eae['attributes'],function(_0x5e3627){var _0x359474={};_0x359474[_0x5e3627]={'$like':'%'+_0x188d05[_0x8f91('0x2d')][_0x8f91('0x37')]+'%'};return _0x359474;})});}_0xe81eae=_[_0x8f91('0x38')]({},_0xe81eae,_0x188d05[_0x8f91('0x3a')]);return db[_0x8f91('0x49')][_0x8f91('0x3b')]({'where':_0xe81eae['where']})[_0x8f91('0x1f')](function(_0x2ab438){_0x4e0aa9[_0x8f91('0x3b')]=_0x2ab438;if(_0x188d05[_0x8f91('0x2d')][_0x8f91('0x40')]){_0xe81eae[_0x8f91('0x41')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x8f91('0x3c')](_0xe81eae);})[_0x8f91('0x1f')](function(_0x196ef5){_0x4e0aa9['rows']=_0x196ef5;return _0x4e0aa9;});}})[_0x8f91('0x1f')](respondWithFilteredResult(_0x31bedd,_0xe81eae))[_0x8f91('0x3e')](handleError(_0x31bedd,null));}; \ No newline at end of file +var _0xb61a=['where','merge','includeAll','include','findAll','rows','show','params','options','create','body','find','catch','describe','getQuestions','JscriptyQuestionReport','rawAttributes','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','JscriptySessionReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter'];(function(_0xebb43a,_0x5031dc){var _0x48fbcf=function(_0x3f2145){while(--_0x3f2145){_0xebb43a['push'](_0xebb43a['shift']());}};_0x48fbcf(++_0x5031dc);}(_0xb61a,0x105));var _0xab61=function(_0x1cdad4,_0xf4de77){_0x1cdad4=_0x1cdad4-0x0;var _0x2c8522=_0xb61a[_0x1cdad4];return _0x2c8522;};'use strict';var emlformat=require(_0xab61('0x0'));var rimraf=require(_0xab61('0x1'));var zipdir=require(_0xab61('0x2'));var jsonpatch=require(_0xab61('0x3'));var rp=require(_0xab61('0x4'));var moment=require(_0xab61('0x5'));var BPromise=require(_0xab61('0x6'));var Mustache=require('mustache');var util=require(_0xab61('0x7'));var path=require(_0xab61('0x8'));var sox=require(_0xab61('0x9'));var csv=require(_0xab61('0xa'));var ejs=require(_0xab61('0xb'));var fs=require('fs');var fs_extra=require(_0xab61('0xc'));var _=require(_0xab61('0xd'));var squel=require(_0xab61('0xe'));var crypto=require(_0xab61('0xf'));var jsforce=require(_0xab61('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xab61('0x11'));var Papa=require(_0xab61('0x12'));var Redis=require(_0xab61('0x13'));var authService=require(_0xab61('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xab61('0x15'));var hardwareService=require(_0xab61('0x16'));var logger=require('../../config/logger')(_0xab61('0x17'));var utils=require(_0xab61('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x460bca,_0xec6ddc){_0xec6ddc=_0xec6ddc||0xcc;return function(_0x362bdd){if(_0x362bdd){return _0x460bca['sendStatus'](_0xec6ddc);}return _0x460bca['status'](_0xec6ddc)[_0xab61('0x19')]();};}function respondWithResult(_0x31b5b1,_0xf8811b){_0xf8811b=_0xf8811b||0xc8;return function(_0x54b037){if(_0x54b037){return _0x31b5b1[_0xab61('0x1a')](_0xf8811b)['json'](_0x54b037);}};}function respondWithFilteredResult(_0x1799f2,_0x58f7c9){return function(_0x2052d9){if(_0x2052d9){var _0x4591d9=typeof _0x58f7c9[_0xab61('0x1b')]===_0xab61('0x1c')&&typeof _0x58f7c9[_0xab61('0x1d')]===_0xab61('0x1c');var _0x43ee01=_0x2052d9['count'];var _0x1b4e94=_0x4591d9?0x0:_0x58f7c9[_0xab61('0x1b')];var _0x3054dc=_0x4591d9?_0x2052d9[_0xab61('0x1e')]:_0x58f7c9[_0xab61('0x1b')]+_0x58f7c9[_0xab61('0x1d')];var _0x44636f;if(_0x3054dc>=_0x43ee01){_0x3054dc=_0x43ee01;_0x44636f=0xc8;}else{_0x44636f=0xce;}_0x1799f2[_0xab61('0x1a')](_0x44636f);return _0x1799f2[_0xab61('0x1f')]('Content-Range',_0x1b4e94+'-'+_0x3054dc+'/'+_0x43ee01)[_0xab61('0x20')](_0x2052d9);}return null;};}function patchUpdates(_0x1585f9){return function(_0x1e8217){try{jsonpatch[_0xab61('0x21')](_0x1e8217,_0x1585f9,!![]);}catch(_0x30556f){return BPromise[_0xab61('0x22')](_0x30556f);}return _0x1e8217[_0xab61('0x23')]();};}function saveUpdates(_0x33a5c9,_0x3a70c8){return function(_0x2b80e9){if(_0x2b80e9){return _0x2b80e9[_0xab61('0x24')](_0x33a5c9)[_0xab61('0x25')](function(_0x11b20c){return _0x11b20c;});}return null;};}function removeEntity(_0x335a80,_0x478b72){return function(_0x2832b5){if(_0x2832b5){return _0x2832b5[_0xab61('0x26')]()[_0xab61('0x25')](function(){_0x335a80[_0xab61('0x1a')](0xcc)[_0xab61('0x19')]();});}};}function handleEntityNotFound(_0xb50254,_0x59cd93){return function(_0x4aeb6b){if(!_0x4aeb6b){_0xb50254[_0xab61('0x27')](0x194);}return _0x4aeb6b;};}function handleError(_0x2617a7,_0x8c4143){_0x8c4143=_0x8c4143||0x1f4;return function(_0x49780d){logger['error'](_0x49780d[_0xab61('0x28')]);if(_0x49780d[_0xab61('0x29')]){delete _0x49780d['name'];}_0x2617a7[_0xab61('0x1a')](_0x8c4143)[_0xab61('0x2a')](_0x49780d);};}exports[_0xab61('0x2b')]=function(_0x5c65b3,_0x193683){var _0x388989={},_0x132314={},_0x3800ec={'count':0x0,'rows':[]};var _0x34c2b3=_[_0xab61('0x2c')](db[_0xab61('0x2d')]['rawAttributes'],function(_0x5dc8e4){return{'name':_0x5dc8e4[_0xab61('0x2e')],'type':_0x5dc8e4[_0xab61('0x2f')][_0xab61('0x30')]};});_0x132314['model']=_[_0xab61('0x2c')](_0x34c2b3,'name');_0x132314[_0xab61('0x31')]=_[_0xab61('0x32')](_0x5c65b3[_0xab61('0x31')]);_0x132314[_0xab61('0x33')]=_[_0xab61('0x34')](_0x132314[_0xab61('0x35')],_0x132314[_0xab61('0x31')]);_0x388989[_0xab61('0x36')]=_[_0xab61('0x34')](_0x132314[_0xab61('0x35')],qs[_0xab61('0x37')](_0x5c65b3['query'][_0xab61('0x37')]));_0x388989['attributes']=_0x388989[_0xab61('0x36')][_0xab61('0x38')]?_0x388989['attributes']:_0x132314[_0xab61('0x35')];if(!_0x5c65b3[_0xab61('0x31')][_0xab61('0x39')](_0xab61('0x3a'))){_0x388989[_0xab61('0x1d')]=qs[_0xab61('0x1d')](_0x5c65b3[_0xab61('0x31')][_0xab61('0x1d')]);_0x388989[_0xab61('0x1b')]=qs['offset'](_0x5c65b3[_0xab61('0x31')][_0xab61('0x1b')]);}_0x388989[_0xab61('0x3b')]=qs['sort'](_0x5c65b3[_0xab61('0x31')][_0xab61('0x3c')]);_0x388989['where']=qs[_0xab61('0x33')](_[_0xab61('0x3d')](_0x5c65b3['query'],_0x132314[_0xab61('0x33')]),_0x34c2b3);if(_0x5c65b3['query'][_0xab61('0x3e')]){_0x388989[_0xab61('0x3f')]=_['merge'](_0x388989[_0xab61('0x3f')],{'$or':_[_0xab61('0x2c')](_0x34c2b3,function(_0xf2f8bc){if(_0xf2f8bc[_0xab61('0x2f')]!=='VIRTUAL'){var _0x9c5392={};_0x9c5392[_0xf2f8bc[_0xab61('0x29')]]={'$like':'%'+_0x5c65b3[_0xab61('0x31')]['filter']+'%'};return _0x9c5392;}})});}_0x388989=_[_0xab61('0x40')]({},_0x388989,_0x5c65b3['options']);var _0x2d49a3={'where':_0x388989[_0xab61('0x3f')]};return db['JscriptySessionReport'][_0xab61('0x1e')](_0x2d49a3)[_0xab61('0x25')](function(_0xe2febf){_0x3800ec['count']=_0xe2febf;if(_0x5c65b3[_0xab61('0x31')][_0xab61('0x41')]){_0x388989[_0xab61('0x42')]=[{'all':!![]}];}return db[_0xab61('0x2d')][_0xab61('0x43')](_0x388989);})[_0xab61('0x25')](function(_0x30df93){_0x3800ec[_0xab61('0x44')]=_0x30df93;return _0x3800ec;})[_0xab61('0x25')](respondWithFilteredResult(_0x193683,_0x388989))['catch'](handleError(_0x193683,null));};exports[_0xab61('0x45')]=function(_0xa082b9,_0x5ca2dc){var _0x1d2130={'raw':!![],'where':{'id':_0xa082b9[_0xab61('0x46')]['id']}},_0x5d9255={};_0x5d9255[_0xab61('0x35')]=_[_0xab61('0x32')](db['JscriptySessionReport']['rawAttributes']);_0x5d9255[_0xab61('0x31')]=_[_0xab61('0x32')](_0xa082b9[_0xab61('0x31')]);_0x5d9255[_0xab61('0x33')]=_[_0xab61('0x34')](_0x5d9255[_0xab61('0x35')],_0x5d9255['query']);_0x1d2130[_0xab61('0x36')]=_['intersection'](_0x5d9255['model'],qs['fields'](_0xa082b9[_0xab61('0x31')]['fields']));_0x1d2130[_0xab61('0x36')]=_0x1d2130[_0xab61('0x36')][_0xab61('0x38')]?_0x1d2130['attributes']:_0x5d9255[_0xab61('0x35')];if(_0xa082b9[_0xab61('0x31')][_0xab61('0x41')]){_0x1d2130['include']=[{'all':!![]}];}_0x1d2130=_[_0xab61('0x40')]({},_0x1d2130,_0xa082b9[_0xab61('0x47')]);return db['JscriptySessionReport']['find'](_0x1d2130)[_0xab61('0x25')](handleEntityNotFound(_0x5ca2dc,null))[_0xab61('0x25')](respondWithResult(_0x5ca2dc,null))['catch'](handleError(_0x5ca2dc,null));};exports[_0xab61('0x48')]=function(_0x1c175a,_0x239c8a){return db[_0xab61('0x2d')][_0xab61('0x48')](_0x1c175a['body'],{})[_0xab61('0x25')](respondWithResult(_0x239c8a,0xc9))['catch'](handleError(_0x239c8a,null));};exports[_0xab61('0x24')]=function(_0x1e65fb,_0x1f6f05){if(_0x1e65fb[_0xab61('0x49')]['id']){delete _0x1e65fb[_0xab61('0x49')]['id'];}return db[_0xab61('0x2d')][_0xab61('0x4a')]({'where':{'id':_0x1e65fb['params']['id']}})[_0xab61('0x25')](handleEntityNotFound(_0x1f6f05,null))[_0xab61('0x25')](saveUpdates(_0x1e65fb[_0xab61('0x49')],null))[_0xab61('0x25')](respondWithResult(_0x1f6f05,null))[_0xab61('0x4b')](handleError(_0x1f6f05,null));};exports[_0xab61('0x26')]=function(_0x2e40ef,_0x2e3008){return db[_0xab61('0x2d')]['find']({'where':{'id':_0x2e40ef[_0xab61('0x46')]['id']}})[_0xab61('0x25')](handleEntityNotFound(_0x2e3008,null))[_0xab61('0x25')](removeEntity(_0x2e3008,null))[_0xab61('0x4b')](handleError(_0x2e3008,null));};exports[_0xab61('0x4c')]=function(_0x1a1e49,_0x4c02f8){return db[_0xab61('0x2d')][_0xab61('0x4c')]()['then'](respondWithResult(_0x4c02f8,null))[_0xab61('0x4b')](handleError(_0x4c02f8,null));};exports[_0xab61('0x4d')]=function(_0x422300,_0x238efb,_0x349122){var _0xcc941e={'raw':!![],'where':{}};var _0x48583a={};var _0x19fd9f={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x422300[_0xab61('0x46')]['id']}})['then'](handleEntityNotFound(_0x238efb,null))[_0xab61('0x25')](function(_0x13b8ec){if(_0x13b8ec){_0x48583a[_0xab61('0x35')]=_[_0xab61('0x32')](db[_0xab61('0x4e')][_0xab61('0x4f')]);_0x48583a[_0xab61('0x31')]=_['keys'](_0x422300['query']);_0x48583a[_0xab61('0x33')]=_['intersection'](_0x48583a[_0xab61('0x35')],_0x48583a['query']);_0xcc941e[_0xab61('0x36')]=_[_0xab61('0x34')](_0x48583a[_0xab61('0x35')],qs[_0xab61('0x37')](_0x422300[_0xab61('0x31')][_0xab61('0x37')]));_0xcc941e[_0xab61('0x36')]=_0xcc941e['attributes'][_0xab61('0x38')]?_0xcc941e['attributes']:_0x48583a[_0xab61('0x35')];if(!_0x422300[_0xab61('0x31')][_0xab61('0x39')]('nolimit')){_0xcc941e[_0xab61('0x1d')]=qs[_0xab61('0x1d')](_0x422300['query']['limit']);_0xcc941e[_0xab61('0x1b')]=qs[_0xab61('0x1b')](_0x422300[_0xab61('0x31')][_0xab61('0x1b')]);}_0xcc941e['order']=qs['sort'](_0x422300['query']['sort']);_0xcc941e['where']=qs[_0xab61('0x33')](_[_0xab61('0x3d')](_0x422300[_0xab61('0x31')],_0x48583a[_0xab61('0x33')]));_0xcc941e['where'][_0xab61('0x50')]=_0x13b8ec['id'];if(_0x422300['query'][_0xab61('0x3e')]){_0xcc941e[_0xab61('0x3f')]=_['merge'](_0xcc941e['where'],{'$or':_[_0xab61('0x2c')](_0xcc941e[_0xab61('0x36')],function(_0x2b9e1a){var _0x499c5e={};_0x499c5e[_0x2b9e1a]={'$like':'%'+_0x422300['query'][_0xab61('0x3e')]+'%'};return _0x499c5e;})});}_0xcc941e=_[_0xab61('0x40')]({},_0xcc941e,_0x422300['options']);return db['JscriptyQuestionReport'][_0xab61('0x1e')]({'where':_0xcc941e[_0xab61('0x3f')]})[_0xab61('0x25')](function(_0x32f927){_0x19fd9f['count']=_0x32f927;if(_0x422300[_0xab61('0x31')][_0xab61('0x41')]){_0xcc941e[_0xab61('0x42')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0xcc941e);})[_0xab61('0x25')](function(_0x2c3a64){_0x19fd9f['rows']=_0x2c3a64;return _0x19fd9f;});}})['then'](respondWithFilteredResult(_0x238efb,_0xcc941e))[_0xab61('0x4b')](handleError(_0x238efb,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 3f481da..e4eff47 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 _0xdc97=['path','../../config/environment','./jscriptySessionReport.attributes','exports','define','lodash','util','../../config/logger','moment','request-promise'];(function(_0x1d4fcd,_0x36bc07){var _0x9c44f8=function(_0x1831ec){while(--_0x1831ec){_0x1d4fcd['push'](_0x1d4fcd['shift']());}};_0x9c44f8(++_0x36bc07);}(_0xdc97,0x13b));var _0x7dc9=function(_0x58ba88,_0x4e57c3){_0x58ba88=_0x58ba88-0x0;var _0x51e65a=_0xdc97[_0x58ba88];return _0x51e65a;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var logger=require(_0x7dc9('0x2'))('api');var moment=require(_0x7dc9('0x3'));var BPromise=require('bluebird');var rp=require(_0x7dc9('0x4'));var fs=require('fs');var path=require(_0x7dc9('0x5'));var rimraf=require('rimraf');var config=require(_0x7dc9('0x6'));var attributes=require(_0x7dc9('0x7'));module[_0x7dc9('0x8')]=function(_0x3ba3ca,_0x589f02){return _0x3ba3ca[_0x7dc9('0x9')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7da7=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','report_jscripty_sessions','lodash'];(function(_0x1e512e,_0x4d8efa){var _0x1b5616=function(_0x1afbe0){while(--_0x1afbe0){_0x1e512e['push'](_0x1e512e['shift']());}};_0x1b5616(++_0x4d8efa);}(_0x7da7,0x10d));var _0x77da=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0x7da7[_0xb66df];return _0x42a702;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./jscriptySessionReport.attributes');module[_0x77da('0x7')]=function(_0xc54a12,_0x47da81){return _0xc54a12[_0x77da('0x8')]('JscriptySessionReport',attributes,{'tableName':_0x77da('0x9'),'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 cfbfe4f..f2884d2 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 _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x2a3c0a,_0x163f5c){var _0x1703a2=function(_0x471dfe){while(--_0x471dfe){_0x2a3c0a['push'](_0x2a3c0a['shift']());}};_0x1703a2(++_0x163f5c);}(_0x524e,0x15e));var _0xe524=function(_0x2264c7,_0x4e5803){_0x2264c7=_0x2264c7-0x0;var _0x2b1edc=_0x524e[_0x2264c7];return _0x2b1edc;};'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')]('JscriptySessionReport,\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')]('JscriptySessionReport,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file +var _0xafb9=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x16249a,_0x372f9e){var _0x28cf81=function(_0x54caa4){while(--_0x54caa4){_0x16249a['push'](_0x16249a['shift']());}};_0x28cf81(++_0x372f9e);}(_0xafb9,0x68));var _0x9afb=function(_0x2f23a0,_0x230fd3){_0x2f23a0=_0x2f23a0-0x0;var _0x21a4aa=_0xafb9[_0x2f23a0];return _0x21a4aa;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var moment=require(_0x9afb('0x2'));var BPromise=require(_0x9afb('0x3'));var rs=require(_0x9afb('0x4'));var fs=require('fs');var Redis=require(_0x9afb('0x5'));var db=require(_0x9afb('0x6'))['db'];var utils=require(_0x9afb('0x7'));var logger=require(_0x9afb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9afb('0x9'));var client=jayson['client'][_0x9afb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548b24,_0x556880,_0x4c0e9d){return new BPromise(function(_0x1edf77,_0x20b8c1){return client['request'](_0x548b24,_0x4c0e9d)[_0x9afb('0xb')](function(_0x3e0264){logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x556880,_0x9afb('0xe'),JSON[_0x9afb('0xf')](_0x3e0264));if(_0x3e0264[_0x9afb('0x10')]){if(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x11')]===0x1f4){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);return _0x20b8c1(_0x3e0264[_0x9afb('0x10')]['message']);}logger[_0x9afb('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x556880,_0x3e0264['error'][_0x9afb('0x12')]);return _0x1edf77(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);}else{logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));_0x1edf77(_0x3e0264[_0x9afb('0x13')]['message']);}})[_0x9afb('0x14')](function(_0x2145c2){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x2145c2);_0x20b8c1(_0x2145c2);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 1e0ce9a..574fbf7 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 _0xd814=['isAuthenticated','update','/download_log_file','downloadLogFile','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','put','/:id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd814,0x175));var _0x4d81=function(_0x229e36,_0x2bd037){_0x229e36=_0x229e36-0x0;var _0x7957cb=_0xd814[_0x229e36];return _0x7957cb;};'use strict';var multer=require('multer');var util=require(_0x4d81('0x0'));var path=require(_0x4d81('0x1'));var timeout=require(_0x4d81('0x2'));var express=require(_0x4d81('0x3'));var router=express[_0x4d81('0x4')]();var fs_extra=require(_0x4d81('0x5'));var auth=require(_0x4d81('0x6'));var interaction=require(_0x4d81('0x7'));var config=require('../../config/environment');var controller=require('./license.controller');router['get']('/',controller[_0x4d81('0x8')]);router[_0x4d81('0x9')](_0x4d81('0xa'),auth[_0x4d81('0xb')](),controller[_0x4d81('0xc')]);router['get'](_0x4d81('0xd'),auth[_0x4d81('0xb')](),controller[_0x4d81('0xe')]);module[_0x4d81('0xf')]=router; \ No newline at end of file +var _0x368a=['../../config/environment','./license.controller','get','index','put','/:id','/download_log_file','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x22ddeb,_0x4f8ac9){var _0x372bb7=function(_0x4ccc4c){while(--_0x4ccc4c){_0x22ddeb['push'](_0x22ddeb['shift']());}};_0x372bb7(++_0x4f8ac9);}(_0x368a,0x107));var _0xa368=function(_0xce6f11,_0x3c3137){_0xce6f11=_0xce6f11-0x0;var _0x35b709=_0x368a[_0xce6f11];return _0x35b709;};'use strict';var multer=require('multer');var util=require(_0xa368('0x0'));var path=require(_0xa368('0x1'));var timeout=require(_0xa368('0x2'));var express=require(_0xa368('0x3'));var router=express[_0xa368('0x4')]();var fs_extra=require(_0xa368('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa368('0x6'));var config=require(_0xa368('0x7'));var controller=require(_0xa368('0x8'));router[_0xa368('0x9')]('/',controller[_0xa368('0xa')]);router[_0xa368('0xb')](_0xa368('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa368('0x9')](_0xa368('0xd'),auth['isAuthenticated'](),controller['downloadLogFile']);module[_0xa368('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 1c131b8..99f7915 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 _0x2530=['sequelize','exports','STRING','INTEGER'];(function(_0xbfd74c,_0x3008de){var _0x1b94ff=function(_0x3409f8){while(--_0x3409f8){_0xbfd74c['push'](_0xbfd74c['shift']());}};_0x1b94ff(++_0x3008de);}(_0x2530,0x88));var _0x0253=function(_0x8230b,_0x291de8){_0x8230b=_0x8230b-0x0;var _0x25034b=_0x2530[_0x8230b];return _0x25034b;};'use strict';var Sequelize=require(_0x0253('0x0'));module[_0x0253('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x0253('0x2')]},'data2':{'type':Sequelize[_0x0253('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x0253('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x082f=['INTEGER','sequelize','exports','TEXT','STRING'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x082f,0xa6));var _0xf082=function(_0x17a329,_0x5d2f43){_0x17a329=_0x17a329-0x0;var _0x761387=_0x082f[_0x17a329];return _0x761387;};'use strict';var Sequelize=require(_0xf082('0x0'));module[_0xf082('0x1')]={'license':{'type':Sequelize[_0xf082('0x2')]},'data1':{'type':Sequelize[_0xf082('0x3')]},'data2':{'type':Sequelize[_0xf082('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xf082('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 4ba14c1..9478958 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 _0xd93d=['../../config/logger','api','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','update','then','destroy','sendStatus','error','stack','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','find','params','get','checkLicense','demo','body','downloadLogFile','license-info.log','join','/var','log','Content-disposition','Content-Type','text/plain','download','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x356900,_0x2b0327){var _0x3f4408=function(_0xedfa94){while(--_0xedfa94){_0x356900['push'](_0x356900['shift']());}};_0x3f4408(++_0x2b0327);}(_0xd93d,0xc4));var _0xdd93=function(_0x518f0e,_0x245304){_0x518f0e=_0x518f0e-0x0;var _0x232ce7=_0xd93d[_0x518f0e];return _0x232ce7;};'use strict';var emlformat=require(_0xdd93('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd93('0x1'));var jsonpatch=require(_0xdd93('0x2'));var rp=require('request-promise');var moment=require(_0xdd93('0x3'));var BPromise=require(_0xdd93('0x4'));var Mustache=require(_0xdd93('0x5'));var util=require(_0xdd93('0x6'));var path=require(_0xdd93('0x7'));var sox=require(_0xdd93('0x8'));var csv=require(_0xdd93('0x9'));var ejs=require(_0xdd93('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdd93('0xb'));var crypto=require('crypto');var jsforce=require(_0xdd93('0xc'));var deskjs=require(_0xdd93('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdd93('0xe'));var Papa=require(_0xdd93('0xf'));var Redis=require(_0xdd93('0x10'));var authService=require(_0xdd93('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdd93('0x12'));var hardwareService=require(_0xdd93('0x13'));var logger=require(_0xdd93('0x14'))(_0xdd93('0x15'));var utils=require('../../config/utils');var config=require(_0xdd93('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdd93('0x17'))['db'];function respondWithStatusCode(_0x53cb45,_0x205845){_0x205845=_0x205845||0xcc;return function(_0x8b5dbf){if(_0x8b5dbf){return _0x53cb45['sendStatus'](_0x205845);}return _0x53cb45[_0xdd93('0x18')](_0x205845)[_0xdd93('0x19')]();};}function respondWithResult(_0x19a8a5,_0x91ba20){_0x91ba20=_0x91ba20||0xc8;return function(_0x1b5b4a){if(_0x1b5b4a){return _0x19a8a5[_0xdd93('0x18')](_0x91ba20)['json'](_0x1b5b4a);}};}function respondWithFilteredResult(_0x1c7dbd,_0x5d4921){return function(_0x3490df){if(_0x3490df){var _0x30106b=typeof _0x5d4921[_0xdd93('0x1a')]===_0xdd93('0x1b')&&typeof _0x5d4921['limit']===_0xdd93('0x1b');var _0x36a3f9=_0x3490df['count'];var _0x3c95d8=_0x30106b?0x0:_0x5d4921[_0xdd93('0x1a')];var _0x204a01=_0x30106b?_0x3490df[_0xdd93('0x1c')]:_0x5d4921['offset']+_0x5d4921[_0xdd93('0x1d')];var _0xcfecec;if(_0x204a01>=_0x36a3f9){_0x204a01=_0x36a3f9;_0xcfecec=0xc8;}else{_0xcfecec=0xce;}_0x1c7dbd['status'](_0xcfecec);return _0x1c7dbd[_0xdd93('0x1e')](_0xdd93('0x1f'),_0x3c95d8+'-'+_0x204a01+'/'+_0x36a3f9)[_0xdd93('0x20')](_0x3490df);}return null;};}function patchUpdates(_0x463f4c){return function(_0x15604f){try{jsonpatch['apply'](_0x15604f,_0x463f4c,!![]);}catch(_0x2ed818){return BPromise[_0xdd93('0x21')](_0x2ed818);}return _0x15604f['save']();};}function saveUpdates(_0x111822,_0x47acd9){return function(_0x281c51){if(_0x281c51){return _0x281c51[_0xdd93('0x22')](_0x111822)[_0xdd93('0x23')](function(_0x4ca7bb){return _0x4ca7bb;});}return null;};}function removeEntity(_0x2c9dec,_0x2db18f){return function(_0x5b4eca){if(_0x5b4eca){return _0x5b4eca[_0xdd93('0x24')]()['then'](function(){_0x2c9dec[_0xdd93('0x18')](0xcc)[_0xdd93('0x19')]();});}};}function handleEntityNotFound(_0x386dfd,_0x272455){return function(_0x10677a){if(!_0x10677a){_0x386dfd[_0xdd93('0x25')](0x194);}return _0x10677a;};}function handleError(_0x3854da,_0xc21912){_0xc21912=_0xc21912||0x1f4;return function(_0x30690b){logger[_0xdd93('0x26')](_0x30690b[_0xdd93('0x27')]);if(_0x30690b[_0xdd93('0x28')]){delete _0x30690b[_0xdd93('0x28')];}_0x3854da[_0xdd93('0x18')](_0xc21912)[_0xdd93('0x29')](_0x30690b);};}var utilLicense=require('../../config/license/util');exports[_0xdd93('0x2a')]=function(_0x21dfc2,_0x35d718){var _0x3b112d={'raw':!![],'where':{'id':0x1}},_0x36962f={};_0x36962f[_0xdd93('0x2b')]=_[_0xdd93('0x2c')](db[_0xdd93('0x2d')][_0xdd93('0x2e')]);_0x36962f[_0xdd93('0x2f')]=_[_0xdd93('0x2c')](_0x21dfc2[_0xdd93('0x2f')]);_0x36962f[_0xdd93('0x30')]=_[_0xdd93('0x31')](_0x36962f['model'],_0x36962f[_0xdd93('0x2f')]);_0x3b112d[_0xdd93('0x32')]=_['intersection'](_0x36962f[_0xdd93('0x2b')],qs[_0xdd93('0x33')](_0x21dfc2[_0xdd93('0x2f')][_0xdd93('0x33')]));_0x3b112d['attributes']=_0x3b112d['attributes'][_0xdd93('0x34')]?_0x3b112d[_0xdd93('0x32')]:_0x36962f['model'];_0x3b112d=_[_0xdd93('0x35')]({},_0x3b112d,_0x21dfc2[_0xdd93('0x36')]);return utilLicense[_0xdd93('0x37')](_0x3b112d)[_0xdd93('0x23')](respondWithResult(_0x35d718,null))[_0xdd93('0x38')](handleError(_0x35d718,null));};exports[_0xdd93('0x22')]=function(_0x57bc61,_0x14bd6f){if(_0x57bc61['body']['id']){delete _0x57bc61['body']['id'];}return db[_0xdd93('0x2d')][_0xdd93('0x39')]({'where':{'id':_0x57bc61[_0xdd93('0x3a')]['id']}})['then'](handleEntityNotFound(_0x14bd6f,null))[_0xdd93('0x23')](function(_0x429950){var _0x1501b7=_0x429950[_0xdd93('0x3b')]({'plain':!![]});return utilLicense[_0xdd93('0x3c')](_0x1501b7,_0x57bc61['body']['key']);})[_0xdd93('0x23')](function(_0x2d969b){if(!_0x2d969b[_0xdd93('0x3d')]){return saveUpdates(_0x57bc61[_0xdd93('0x3e')],null);}return _0x2d969b;})[_0xdd93('0x23')](respondWithResult(_0x14bd6f,null))[_0xdd93('0x38')](handleError(_0x14bd6f,null));};exports[_0xdd93('0x3f')]=function(_0x48f21b,_0x4735d5){var _0x45567b=_0xdd93('0x40');var _0x326de6=path[_0xdd93('0x41')](_0xdd93('0x42'),_0xdd93('0x43'),'xcally',_0x45567b);_0x4735d5['setHeader'](_0xdd93('0x44'),'attachment;\x20filename='+_0x45567b);_0x4735d5['set'](_0xdd93('0x45'),_0xdd93('0x46'));_0x4735d5[_0xdd93('0x47')](_0x326de6);}; \ No newline at end of file +var _0xd074=['catch','body','find','get','key','demo','downloadLogFile','license-info.log','join','/var','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','ejs','fs-extra','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/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','model','keys','License','rawAttributes','filters','query','attributes','intersection','fields','merge','getLicense'];(function(_0x1845f4,_0x2033ea){var _0x43d58b=function(_0x531742){while(--_0x531742){_0x1845f4['push'](_0x1845f4['shift']());}};_0x43d58b(++_0x2033ea);}(_0xd074,0xe8));var _0x4d07=function(_0x52aba4,_0x197aa3){_0x52aba4=_0x52aba4-0x0;var _0x48d5b0=_0xd074[_0x52aba4];return _0x48d5b0;};'use strict';var emlformat=require(_0x4d07('0x0'));var rimraf=require(_0x4d07('0x1'));var zipdir=require(_0x4d07('0x2'));var jsonpatch=require(_0x4d07('0x3'));var rp=require(_0x4d07('0x4'));var moment=require(_0x4d07('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4d07('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4d07('0x7'));var fs=require('fs');var fs_extra=require(_0x4d07('0x8'));var _=require('lodash');var squel=require(_0x4d07('0x9'));var crypto=require(_0x4d07('0xa'));var jsforce=require(_0x4d07('0xb'));var deskjs=require(_0x4d07('0xc'));var toCsv=require(_0x4d07('0xd'));var querystring=require(_0x4d07('0xe'));var Papa=require(_0x4d07('0xf'));var Redis=require(_0x4d07('0x10'));var authService=require(_0x4d07('0x11'));var qs=require(_0x4d07('0x12'));var as=require(_0x4d07('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d07('0x14'))(_0x4d07('0x15'));var utils=require(_0x4d07('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4d07('0x17'));var db=require(_0x4d07('0x18'))['db'];function respondWithStatusCode(_0x2b50f7,_0xa6353b){_0xa6353b=_0xa6353b||0xcc;return function(_0x11acb7){if(_0x11acb7){return _0x2b50f7['sendStatus'](_0xa6353b);}return _0x2b50f7[_0x4d07('0x19')](_0xa6353b)[_0x4d07('0x1a')]();};}function respondWithResult(_0x59118a,_0x53de6f){_0x53de6f=_0x53de6f||0xc8;return function(_0x1b0877){if(_0x1b0877){return _0x59118a[_0x4d07('0x19')](_0x53de6f)[_0x4d07('0x1b')](_0x1b0877);}};}function respondWithFilteredResult(_0x5f4de2,_0x12c948){return function(_0x17cd49){if(_0x17cd49){var _0x858f8=typeof _0x12c948[_0x4d07('0x1c')]==='undefined'&&typeof _0x12c948[_0x4d07('0x1d')]===_0x4d07('0x1e');var _0xa5aaf5=_0x17cd49[_0x4d07('0x1f')];var _0x15d09c=_0x858f8?0x0:_0x12c948[_0x4d07('0x1c')];var _0x299221=_0x858f8?_0x17cd49['count']:_0x12c948[_0x4d07('0x1c')]+_0x12c948[_0x4d07('0x1d')];var _0xfae681;if(_0x299221>=_0xa5aaf5){_0x299221=_0xa5aaf5;_0xfae681=0xc8;}else{_0xfae681=0xce;}_0x5f4de2[_0x4d07('0x19')](_0xfae681);return _0x5f4de2[_0x4d07('0x20')](_0x4d07('0x21'),_0x15d09c+'-'+_0x299221+'/'+_0xa5aaf5)[_0x4d07('0x1b')](_0x17cd49);}return null;};}function patchUpdates(_0x5845ec){return function(_0x40327f){try{jsonpatch['apply'](_0x40327f,_0x5845ec,!![]);}catch(_0x41097b){return BPromise[_0x4d07('0x22')](_0x41097b);}return _0x40327f[_0x4d07('0x23')]();};}function saveUpdates(_0x3df728,_0x188bad){return function(_0x3a828a){if(_0x3a828a){return _0x3a828a[_0x4d07('0x24')](_0x3df728)['then'](function(_0x51ac7f){return _0x51ac7f;});}return null;};}function removeEntity(_0x49bcdd,_0x363c3b){return function(_0x3e042f){if(_0x3e042f){return _0x3e042f[_0x4d07('0x25')]()[_0x4d07('0x26')](function(){_0x49bcdd['status'](0xcc)[_0x4d07('0x1a')]();});}};}function handleEntityNotFound(_0x15bfc9,_0x470797){return function(_0x11a10c){if(!_0x11a10c){_0x15bfc9[_0x4d07('0x27')](0x194);}return _0x11a10c;};}function handleError(_0x58313a,_0x40ae1d){_0x40ae1d=_0x40ae1d||0x1f4;return function(_0x26a26c){logger[_0x4d07('0x28')](_0x26a26c[_0x4d07('0x29')]);if(_0x26a26c['name']){delete _0x26a26c[_0x4d07('0x2a')];}_0x58313a[_0x4d07('0x19')](_0x40ae1d)[_0x4d07('0x2b')](_0x26a26c);};}var utilLicense=require(_0x4d07('0x17'));exports[_0x4d07('0x2c')]=function(_0x654ac,_0x30014a){var _0x48f45c={'raw':!![],'where':{'id':0x1}},_0x4e82a0={};_0x4e82a0[_0x4d07('0x2d')]=_[_0x4d07('0x2e')](db[_0x4d07('0x2f')][_0x4d07('0x30')]);_0x4e82a0['query']=_[_0x4d07('0x2e')](_0x654ac['query']);_0x4e82a0[_0x4d07('0x31')]=_['intersection'](_0x4e82a0[_0x4d07('0x2d')],_0x4e82a0[_0x4d07('0x32')]);_0x48f45c[_0x4d07('0x33')]=_[_0x4d07('0x34')](_0x4e82a0[_0x4d07('0x2d')],qs[_0x4d07('0x35')](_0x654ac[_0x4d07('0x32')][_0x4d07('0x35')]));_0x48f45c[_0x4d07('0x33')]=_0x48f45c[_0x4d07('0x33')]['length']?_0x48f45c[_0x4d07('0x33')]:_0x4e82a0[_0x4d07('0x2d')];_0x48f45c=_[_0x4d07('0x36')]({},_0x48f45c,_0x654ac['options']);return utilLicense[_0x4d07('0x37')](_0x48f45c)[_0x4d07('0x26')](respondWithResult(_0x30014a,null))[_0x4d07('0x38')](handleError(_0x30014a,null));};exports[_0x4d07('0x24')]=function(_0x2f0fa0,_0x155440){if(_0x2f0fa0[_0x4d07('0x39')]['id']){delete _0x2f0fa0[_0x4d07('0x39')]['id'];}return db[_0x4d07('0x2f')][_0x4d07('0x3a')]({'where':{'id':_0x2f0fa0['params']['id']}})[_0x4d07('0x26')](handleEntityNotFound(_0x155440,null))[_0x4d07('0x26')](function(_0x49aeaf){var _0x1a4491=_0x49aeaf[_0x4d07('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x1a4491,_0x2f0fa0[_0x4d07('0x39')][_0x4d07('0x3c')]);})[_0x4d07('0x26')](function(_0x3f85ec){if(!_0x3f85ec[_0x4d07('0x3d')]){return saveUpdates(_0x2f0fa0[_0x4d07('0x39')],null);}return _0x3f85ec;})[_0x4d07('0x26')](respondWithResult(_0x155440,null))[_0x4d07('0x38')](handleError(_0x155440,null));};exports[_0x4d07('0x3e')]=function(_0x4b9f7e,_0x1a662e){var _0x418f2f=_0x4d07('0x3f');var _0x1d5261=path[_0x4d07('0x40')](_0x4d07('0x41'),'log',_0x4d07('0x42'),_0x418f2f);_0x1a662e[_0x4d07('0x43')](_0x4d07('0x44'),_0x4d07('0x45')+_0x418f2f);_0x1a662e[_0x4d07('0x20')](_0x4d07('0x46'),_0x4d07('0x47'));_0x1a662e['download'](_0x1d5261);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index a64d6d7..fbd7bb5 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 _0xbdd4=['lodash','util','../../config/logger','api','request-promise','path','rimraf','./license.attributes','exports','define','License'];(function(_0x3daf2f,_0x4b29eb){var _0x4b900a=function(_0x571a49){while(--_0x571a49){_0x3daf2f['push'](_0x3daf2f['shift']());}};_0x4b900a(++_0x4b29eb);}(_0xbdd4,0xfd));var _0x4bdd=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xbdd4[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x4bdd('0x0'));var util=require(_0x4bdd('0x1'));var logger=require(_0x4bdd('0x2'))(_0x4bdd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4bdd('0x4'));var fs=require('fs');var path=require(_0x4bdd('0x5'));var rimraf=require(_0x4bdd('0x6'));var config=require('../../config/environment');var attributes=require(_0x4bdd('0x7'));module[_0x4bdd('0x8')]=function(_0x4c9a29,_0x4940df){return _0x4c9a29[_0x4bdd('0x9')](_0x4bdd('0xa'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b7c=['lodash','api','bluebird','request-promise','path','../../config/environment','./license.attributes','exports','License'];(function(_0x34533,_0x531aeb){var _0x5810ff=function(_0x478ff1){while(--_0x478ff1){_0x34533['push'](_0x34533['shift']());}};_0x5810ff(++_0x531aeb);}(_0x4b7c,0x183));var _0xc4b7=function(_0x4bae27,_0x303a51){_0x4bae27=_0x4bae27-0x0;var _0xd80087=_0x4b7c[_0x4bae27];return _0xd80087;};'use strict';var _=require(_0xc4b7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc4b7('0x1'));var moment=require('moment');var BPromise=require(_0xc4b7('0x2'));var rp=require(_0xc4b7('0x3'));var fs=require('fs');var path=require(_0xc4b7('0x4'));var rimraf=require('rimraf');var config=require(_0xc4b7('0x5'));var attributes=require(_0xc4b7('0x6'));module[_0xc4b7('0x7')]=function(_0x52f790,_0x217f17){return _0x52f790['define'](_0xc4b7('0x8'),attributes,{'tableName':'license','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 899e5f9..284143a 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 _0x793e=['client','http','request','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise'];(function(_0x49bdc8,_0x4cb1d7){var _0x206535=function(_0x383d47){while(--_0x383d47){_0x49bdc8['push'](_0x49bdc8['shift']());}};_0x206535(++_0x4cb1d7);}(_0x793e,0xe0));var _0xe793=function(_0x8cbd17,_0x3913d4){_0x8cbd17=_0x8cbd17-0x0;var _0x35840a=_0x793e[_0x8cbd17];return _0x35840a;};'use strict';var _=require(_0xe793('0x0'));var util=require(_0xe793('0x1'));var moment=require('moment');var BPromise=require(_0xe793('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe793('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe793('0x4'));var logger=require(_0xe793('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe793('0x6'));var client=jayson[_0xe793('0x7')][_0xe793('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c7fdd,_0x13fa17,_0x4fd99a){return new BPromise(function(_0x2ae559,_0x2736cb){return client[_0xe793('0x9')](_0x1c7fdd,_0x4fd99a)['then'](function(_0x20ec66){logger[_0xe793('0xa')](_0xe793('0xb'),_0x13fa17,'request\x20sent');logger[_0xe793('0xc')](_0xe793('0xd'),_0x13fa17,_0xe793('0xe'),JSON[_0xe793('0xf')](_0x20ec66));if(_0x20ec66['error']){if(_0x20ec66[_0xe793('0x10')][_0xe793('0x11')]===0x1f4){logger[_0xe793('0x10')](_0xe793('0xb'),_0x13fa17,_0x20ec66[_0xe793('0x10')]['message']);return _0x2736cb(_0x20ec66['error'][_0xe793('0x12')]);}logger[_0xe793('0x10')]('License,\x20%s,\x20%s',_0x13fa17,_0x20ec66[_0xe793('0x10')][_0xe793('0x12')]);return _0x2ae559(_0x20ec66[_0xe793('0x10')]['message']);}else{logger[_0xe793('0xa')](_0xe793('0xb'),_0x13fa17,_0xe793('0xe'));_0x2ae559(_0x20ec66[_0xe793('0x13')][_0xe793('0x12')]);}})[_0xe793('0x14')](function(_0x1efc17){logger[_0xe793('0x10')](_0xe793('0xb'),_0x13fa17,_0x1efc17);_0x2736cb(_0x1efc17);});});} \ No newline at end of file +var _0x7dbd=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','License,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','randomstring'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x7dbd,0x1d9));var _0xd7db=function(_0x43b5a7,_0xf5e3d6){_0x43b5a7=_0x43b5a7-0x0;var _0x5461fe=_0x7dbd[_0x43b5a7];return _0x5461fe;};'use strict';var _=require(_0xd7db('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd7db('0x1'));var fs=require('fs');var Redis=require(_0xd7db('0x2'));var db=require(_0xd7db('0x3'))['db'];var utils=require(_0xd7db('0x4'));var logger=require(_0xd7db('0x5'))(_0xd7db('0x6'));var config=require(_0xd7db('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd7db('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x341b19,_0x4ebd2e,_0x1a58b9){return new BPromise(function(_0xd5f02d,_0x25054c){return client[_0xd7db('0x9')](_0x341b19,_0x1a58b9)['then'](function(_0x1e8fd1){logger['info'](_0xd7db('0xa'),_0x4ebd2e,_0xd7db('0xb'));logger[_0xd7db('0xc')]('License,\x20%s,\x20%s,\x20%s',_0x4ebd2e,_0xd7db('0xb'),JSON['stringify'](_0x1e8fd1));if(_0x1e8fd1[_0xd7db('0xd')]){if(_0x1e8fd1[_0xd7db('0xd')][_0xd7db('0xe')]===0x1f4){logger[_0xd7db('0xd')](_0xd7db('0xa'),_0x4ebd2e,_0x1e8fd1['error'][_0xd7db('0xf')]);return _0x25054c(_0x1e8fd1[_0xd7db('0xd')][_0xd7db('0xf')]);}logger[_0xd7db('0xd')](_0xd7db('0xa'),_0x4ebd2e,_0x1e8fd1[_0xd7db('0xd')][_0xd7db('0xf')]);return _0xd5f02d(_0x1e8fd1[_0xd7db('0xd')][_0xd7db('0xf')]);}else{logger[_0xd7db('0x10')](_0xd7db('0xa'),_0x4ebd2e,_0xd7db('0xb'));_0xd5f02d(_0x1e8fd1[_0xd7db('0x11')]['message']);}})[_0xd7db('0x12')](function(_0x46aec0){logger[_0xd7db('0xd')](_0xd7db('0xa'),_0x4ebd2e,_0x46aec0);_0x25054c(_0x46aec0);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 7f2b6da..4d1c656 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 _0x3462=['destroy','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','post','addAnswer','create','addImap','addSmtp','addInteraction','/:id/send','send','addAgents','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp'];(function(_0x2499de,_0x2243b5){var _0x21738b=function(_0x20cace){while(--_0x20cace){_0x2499de['push'](_0x2499de['shift']());}};_0x21738b(++_0x2243b5);}(_0x3462,0x96));var _0x2346=function(_0x4f9674,_0x19e6b5){_0x4f9674=_0x4f9674-0x0;var _0x1b1f9e=_0x3462[_0x4f9674];return _0x1b1f9e;};'use strict';var multer=require(_0x2346('0x0'));var util=require(_0x2346('0x1'));var path=require(_0x2346('0x2'));var timeout=require(_0x2346('0x3'));var express=require(_0x2346('0x4'));var router=express['Router']();var fs_extra=require(_0x2346('0x5'));var auth=require(_0x2346('0x6'));var interaction=require(_0x2346('0x7'));var config=require(_0x2346('0x8'));var controller=require(_0x2346('0x9'));router['get']('/',auth[_0x2346('0xa')](),controller['index']);router[_0x2346('0xb')](_0x2346('0xc'),auth[_0x2346('0xa')](),controller[_0x2346('0xd')]);router['get'](_0x2346('0xe'),auth[_0x2346('0xa')](),controller[_0x2346('0xf')]);router[_0x2346('0xb')](_0x2346('0x10'),auth[_0x2346('0xa')](),controller['getDispositions']);router['get'](_0x2346('0x11'),auth[_0x2346('0xa')](),controller['getAnswers']);router[_0x2346('0xb')](_0x2346('0x12'),auth['isAuthenticated'](),controller[_0x2346('0x13')]);router[_0x2346('0xb')](_0x2346('0x14'),auth[_0x2346('0xa')](),controller[_0x2346('0x15')]);router[_0x2346('0xb')](_0x2346('0x16'),auth['isAuthenticated'](),controller[_0x2346('0x17')]);router[_0x2346('0xb')](_0x2346('0x18'),auth[_0x2346('0xa')](),controller[_0x2346('0x19')]);router[_0x2346('0xb')](_0x2346('0x1a'),auth['isAuthenticated'](),controller[_0x2346('0x1b')]);router[_0x2346('0xb')](_0x2346('0x1c'),auth[_0x2346('0xa')](),controller[_0x2346('0x1d')]);router[_0x2346('0xb')](_0x2346('0x1e'),auth[_0x2346('0xa')](),controller['getAgents']);router[_0x2346('0x1f')](_0x2346('0x10'),auth[_0x2346('0xa')](),controller['addDisposition']);router[_0x2346('0x1f')](_0x2346('0x11'),auth[_0x2346('0xa')](),controller[_0x2346('0x20')]);router['post']('/',auth[_0x2346('0xa')](),controller[_0x2346('0x21')]);router[_0x2346('0x1f')](_0x2346('0x12'),auth[_0x2346('0xa')](),controller[_0x2346('0x22')]);router[_0x2346('0x1f')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x2346('0x23')]);router[_0x2346('0x1f')](_0x2346('0x16'),auth[_0x2346('0xa')](),controller[_0x2346('0x24')]);router[_0x2346('0x1f')](_0x2346('0x18'),auth[_0x2346('0xa')](),controller['addApplications']);router['post'](_0x2346('0x25'),auth['isAuthenticated'](),controller[_0x2346('0x26')]);router['post'](_0x2346('0x1e'),auth[_0x2346('0xa')](),controller[_0x2346('0x27')]);router['put']('/:id',auth[_0x2346('0xa')](),controller[_0x2346('0x28')]);router[_0x2346('0x29')](_0x2346('0x10'),auth[_0x2346('0xa')](),controller[_0x2346('0x2a')]);router[_0x2346('0x29')](_0x2346('0x11'),auth['isAuthenticated'](),controller[_0x2346('0x2b')]);router['delete'](_0x2346('0x12'),auth['isAuthenticated'](),controller[_0x2346('0x2c')]);router[_0x2346('0x29')]('/:id/out_servers',auth[_0x2346('0xa')](),controller[_0x2346('0x2d')]);router[_0x2346('0x29')](_0x2346('0xe'),auth[_0x2346('0xa')](),controller[_0x2346('0x2e')]);router[_0x2346('0x29')](_0x2346('0x1e'),auth[_0x2346('0xa')](),controller[_0x2346('0x2f')]);module[_0x2346('0x30')]=router; \ No newline at end of file +var _0x7219=['getAgents','post','/:id/dispositions','addDisposition','/:id/canned_answers','create','addSmtp','addInteraction','/:id/applications','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','/:id/out_servers','removeSmtp','removeAgents','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','describe','/:id','show','getDispositions','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getApplications','/:id/messages','getMessages','/:id/users'];(function(_0x2e26f6,_0x45ef20){var _0x113645=function(_0x1c42aa){while(--_0x1c42aa){_0x2e26f6['push'](_0x2e26f6['shift']());}};_0x113645(++_0x45ef20);}(_0x7219,0x175));var _0x9721=function(_0x54c21a,_0x32fbe1){_0x54c21a=_0x54c21a-0x0;var _0x32395d=_0x7219[_0x54c21a];return _0x32395d;};'use strict';var multer=require(_0x9721('0x0'));var util=require(_0x9721('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9721('0x2'));var router=express[_0x9721('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9721('0x4'));var interaction=require(_0x9721('0x5'));var config=require(_0x9721('0x6'));var controller=require(_0x9721('0x7'));router[_0x9721('0x8')]('/',auth[_0x9721('0x9')](),controller['index']);router[_0x9721('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x9721('0xa')]);router[_0x9721('0x8')](_0x9721('0xb'),auth['isAuthenticated'](),controller[_0x9721('0xc')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x9721('0xd')]);router[_0x9721('0x8')]('/:id/canned_answers',auth[_0x9721('0x9')](),controller[_0x9721('0xe')]);router[_0x9721('0x8')](_0x9721('0xf'),auth[_0x9721('0x9')](),controller[_0x9721('0x10')]);router[_0x9721('0x8')]('/:id/out_servers',auth[_0x9721('0x9')](),controller[_0x9721('0x11')]);router[_0x9721('0x8')](_0x9721('0x12'),auth[_0x9721('0x9')](),controller['getInteractions']);router[_0x9721('0x8')]('/:id/applications',auth[_0x9721('0x9')](),controller[_0x9721('0x13')]);router[_0x9721('0x8')](_0x9721('0x14'),auth[_0x9721('0x9')](),controller[_0x9721('0x15')]);router[_0x9721('0x8')]('/:id/verify',auth[_0x9721('0x9')](),controller['verifySmtp']);router[_0x9721('0x8')](_0x9721('0x16'),auth[_0x9721('0x9')](),controller[_0x9721('0x17')]);router[_0x9721('0x18')](_0x9721('0x19'),auth[_0x9721('0x9')](),controller[_0x9721('0x1a')]);router[_0x9721('0x18')](_0x9721('0x1b'),auth[_0x9721('0x9')](),controller['addAnswer']);router[_0x9721('0x18')]('/',auth[_0x9721('0x9')](),controller[_0x9721('0x1c')]);router[_0x9721('0x18')](_0x9721('0xf'),auth[_0x9721('0x9')](),controller['addImap']);router['post']('/:id/out_servers',auth[_0x9721('0x9')](),controller[_0x9721('0x1d')]);router[_0x9721('0x18')](_0x9721('0x12'),auth[_0x9721('0x9')](),controller[_0x9721('0x1e')]);router[_0x9721('0x18')](_0x9721('0x1f'),auth[_0x9721('0x9')](),controller[_0x9721('0x20')]);router[_0x9721('0x18')](_0x9721('0x21'),auth[_0x9721('0x9')](),controller[_0x9721('0x22')]);router['post'](_0x9721('0x16'),auth[_0x9721('0x9')](),controller[_0x9721('0x23')]);router[_0x9721('0x24')]('/:id',auth[_0x9721('0x9')](),controller[_0x9721('0x25')]);router[_0x9721('0x26')](_0x9721('0x19'),auth['isAuthenticated'](),controller[_0x9721('0x27')]);router[_0x9721('0x26')](_0x9721('0x1b'),auth[_0x9721('0x9')](),controller[_0x9721('0x28')]);router[_0x9721('0x26')](_0x9721('0xf'),auth['isAuthenticated'](),controller['removeImap']);router[_0x9721('0x26')](_0x9721('0x29'),auth[_0x9721('0x9')](),controller[_0x9721('0x2a')]);router[_0x9721('0x26')](_0x9721('0xb'),auth[_0x9721('0x9')](),controller['destroy']);router['delete'](_0x9721('0x16'),auth['isAuthenticated'](),controller[_0x9721('0x2b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 60e9343..8128526 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 _0x6e70=['provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365'];(function(_0x1a547e,_0x5917d3){var _0x5ebdaf=function(_0x158b24){while(--_0x158b24){_0x1a547e['push'](_0x1a547e['shift']());}};_0x5ebdaf(++_0x5917d3);}(_0x6e70,0xde));var _0x06e7=function(_0x35f045,_0x508ca3){_0x35f045=_0x35f045-0x0;var _0x217de7=_0x6e70[_0x35f045];return _0x217de7;};'use strict';var Sequelize=require(_0x06e7('0x0'));module[_0x06e7('0x1')]={'description':{'type':Sequelize[_0x06e7('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x06e7('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x06e7('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x06e7('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x06e7('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x06e7('0x4')]},'markAsUnread':{'type':Sequelize[_0x06e7('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x06e7('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x06e7('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x06e7('0x6');}},'notificationSound':{'type':Sequelize[_0x06e7('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x06e7('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x06e7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x06e7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x06e7('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x06e7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x06e7('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x06e7('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x06e7('0x3')],'defaultValue':![],'comment':_0x06e7('0x9'),'set':function(_0x457730){if(!_0x457730)this[_0x06e7('0xa')](_0x06e7('0xb'),null);this[_0x06e7('0xa')](_0x06e7('0xc'),_0x457730);}},'provider':{'type':Sequelize[_0x06e7('0xd')](_0x06e7('0xe'),_0x06e7('0xf'),_0x06e7('0x10'),_0x06e7('0x11')),'defaultValue':null,'get':function(){var _0x42ddb5=this['getDataValue'](_0x06e7('0x12'));return _0x42ddb5||_0x06e7('0x13');},'set':function(_0x3ce533){if(_0x3ce533===_0x06e7('0x13')){_0x3ce533=null;}return this['setDataValue'](_0x06e7('0x12'),_0x3ce533);}}}; \ No newline at end of file +var _0xdc95=['exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','hotmail','yahoo','outlook365','getDataValue','provider','custom'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xdc95,0x130));var _0x5dc9=function(_0x449863,_0x4226f0){_0x449863=_0x449863-0x0;var _0x456789=_0xdc95[_0x449863];return _0x456789;};'use strict';var Sequelize=require('sequelize');module[_0x5dc9('0x0')]={'description':{'type':Sequelize[_0x5dc9('0x1')]},'name':{'type':Sequelize[_0x5dc9('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x5dc9('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x5dc9('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x5dc9('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x5dc9('0x3')]},'markAsUnread':{'type':Sequelize[_0x5dc9('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5dc9('0x4')},'fontSize':{'type':Sequelize[_0x5dc9('0x5')](0x2)[_0x5dc9('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x5dc9('0x3')],'defaultValue':function(){return _0x5dc9('0x7');}},'notificationSound':{'type':Sequelize[_0x5dc9('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5dc9('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5dc9('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x5dc9('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5dc9('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5dc9('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5dc9('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x5dc9('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x5dc9('0x2')],'defaultValue':![],'comment':_0x5dc9('0x9'),'set':function(_0x5f0b7f){if(!_0x5f0b7f)this[_0x5dc9('0xa')](_0x5dc9('0xb'),null);this[_0x5dc9('0xa')](_0x5dc9('0xc'),_0x5f0b7f);}},'provider':{'type':Sequelize['ENUM']('gmail',_0x5dc9('0xd'),_0x5dc9('0xe'),_0x5dc9('0xf')),'defaultValue':null,'get':function(){var _0x42a600=this[_0x5dc9('0x10')](_0x5dc9('0x11'));return _0x42a600||_0x5dc9('0x12');},'set':function(_0x22a9f5){if(_0x22a9f5===_0x5dc9('0x12')){_0x22a9f5=null;}return this[_0x5dc9('0xa')](_0x5dc9('0x11'),_0x22a9f5);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 3fb6d3a..b0fce9c 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 _0xd958=['verifySmtp','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','util','lodash','juice','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','MailAccounts','UserProfileResource','destroy','stack','name','gmail','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','yahoo','smtp.mail.yahoo.com','hotmail','smtp-mail.outlook.com','user','username','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','Imap','Smtp','index','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','rows','show','params','MailServerIn','find','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','nolimit','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','key','isNil','active','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','MailInteraction','Contact','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','MailApplication','priority','finally','send','getApplications','getMessages','$gte','split','format','MailMessage','inlineCss','CmList','CmContact','Contacts','updatedAt','DESC','CloudProvider','%s\x20<%s>','email','attachments','root','basename','getSmtpOptions','SendMail','sendMail','List','ListId','messageId','from','subject','attach','YYYY-MM-DD\x20HH:mm:ss','out','Interaction','Messages','VerifySmtp'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd958,0xcc));var _0x8d95=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xd958[_0x11c573];return _0x6b72de;};'use strict';var moment=require(_0x8d95('0x0'));var BPromise=require('bluebird');var util=require(_0x8d95('0x1'));var path=require('path');var _=require(_0x8d95('0x2'));var juice=require(_0x8d95('0x3'));var Redis=require(_0x8d95('0x4'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x8d95('0x5'));var config=require(_0x8d95('0x6'));var db=require(_0x8d95('0x7'))['db'];config[_0x8d95('0x8')]=_[_0x8d95('0x9')](config[_0x8d95('0x8')],{'host':_0x8d95('0xa'),'port':0x18eb});var socket=require(_0x8d95('0xb'))(new Redis(config[_0x8d95('0x8')]));require(_0x8d95('0xc'))[_0x8d95('0xd')](socket);var jayson=require(_0x8d95('0xe'));var client=jayson[_0x8d95('0xf')][_0x8d95('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x19302b,_0x469926,_0x1ccfef,_0x307803){return new BPromise(function(_0x16ebdb,_0x2b12ef){var _0x14de97=_0x307803||client;return _0x14de97['request'](_0x19302b,_0x1ccfef)['then'](function(_0x5687e4){logger['info'](_0x8d95('0x11'),_0x469926,'request\x20sent');logger[_0x8d95('0x12')](_0x8d95('0x13'),_0x469926,_0x8d95('0x14'),JSON['stringify'](_0x5687e4));if(_0x5687e4[_0x8d95('0x15')]){if(_0x5687e4[_0x8d95('0x15')][_0x8d95('0x16')]===0x1f4){logger['error'](_0x8d95('0x11'),_0x469926,_0x5687e4['error']['message']);return _0x2b12ef(_0x5687e4[_0x8d95('0x15')][_0x8d95('0x17')]);}logger[_0x8d95('0x15')](_0x8d95('0x11'),_0x469926,_0x5687e4['error']['message']);return _0x16ebdb(_0x5687e4[_0x8d95('0x15')]['message']);}else{logger[_0x8d95('0x18')](_0x8d95('0x11'),_0x469926,_0x8d95('0x14'));_0x16ebdb(_0x5687e4[_0x8d95('0x19')][_0x8d95('0x17')]);}})[_0x8d95('0x1a')](function(_0x3ae1b2){logger['error'](_0x8d95('0x11'),_0x469926,_0x3ae1b2);_0x2b12ef(_0x3ae1b2);});});}function respondWithStatusCode(_0x81d7c6,_0xb6520f){_0xb6520f=_0xb6520f||0xcc;return function(_0x1e86e4){if(_0x1e86e4){return _0x81d7c6[_0x8d95('0x1b')](_0xb6520f);}return _0x81d7c6[_0x8d95('0x1c')](_0xb6520f)[_0x8d95('0x1d')]();};}function respondWithResult(_0x54583f,_0x170d3e){_0x170d3e=_0x170d3e||0xc8;return function(_0x2eb174){if(_0x2eb174){return _0x54583f[_0x8d95('0x1c')](_0x170d3e)[_0x8d95('0x1e')](_0x2eb174);}};}function respondWithFilteredResult(_0x36ade9,_0x11aa7e){return function(_0x2f5da9){if(_0x2f5da9){var _0x502fd8=typeof _0x11aa7e[_0x8d95('0x1f')]===_0x8d95('0x20')&&typeof _0x11aa7e[_0x8d95('0x21')]===_0x8d95('0x20');var _0x2671c0=_0x2f5da9[_0x8d95('0x22')];var _0x3eac77=_0x502fd8?0x0:_0x11aa7e[_0x8d95('0x1f')];var _0x1cb192=_0x502fd8?_0x2f5da9[_0x8d95('0x22')]:_0x11aa7e[_0x8d95('0x1f')]+_0x11aa7e[_0x8d95('0x21')];var _0x1f1ed0;if(_0x1cb192>=_0x2671c0){_0x1cb192=_0x2671c0;_0x1f1ed0=0xc8;}else{_0x1f1ed0=0xce;}_0x36ade9['status'](_0x1f1ed0);return _0x36ade9[_0x8d95('0x23')](_0x8d95('0x24'),_0x3eac77+'-'+_0x1cb192+'/'+_0x2671c0)['json'](_0x2f5da9);}return null;};}function saveUpdates(_0x569058){return function(_0x4a92b4){if(_0x4a92b4){return _0x4a92b4[_0x8d95('0x25')](_0x569058)[_0x8d95('0x26')](function(_0x5373b7){return _0x5373b7;});}return null;};}function removeEntity(_0x5078fa){return function(_0x274ba2){if(_0x274ba2){return _0x274ba2['destroy']()[_0x8d95('0x26')](function(){var _0x5680d9=_0x274ba2['get']({'plain':!![]});var _0x592a6d=_0x8d95('0x27');return db[_0x8d95('0x28')][_0x8d95('0x29')]({'where':{'type':_0x592a6d,'resourceId':_0x5680d9['id']}})[_0x8d95('0x26')](function(){return _0x274ba2;});})[_0x8d95('0x26')](function(){_0x5078fa[_0x8d95('0x1c')](0xcc)[_0x8d95('0x1d')]();});}};}function handleEntityNotFound(_0x3d1b98){return function(_0x10acc8){if(!_0x10acc8){_0x3d1b98[_0x8d95('0x1b')](0x194);}return _0x10acc8;};}function handleError(_0x513714,_0x569eea){_0x569eea=_0x569eea||0x1f4;return function(_0x29fa44){logger[_0x8d95('0x15')](_0x29fa44[_0x8d95('0x2a')]);if(_0x29fa44[_0x8d95('0x2b')]){delete _0x29fa44['name'];}_0x513714[_0x8d95('0x1c')](_0x569eea)['send'](_0x29fa44);};}function getImapHost(_0x3f27ad){switch(_0x3f27ad){case _0x8d95('0x2c'):return'imap.gmail.com';case'yahoo':return _0x8d95('0x2d');case'hotmail':return _0x8d95('0x2e');case _0x8d95('0x2f'):return _0x8d95('0x30');}throw new Error(_0x8d95('0x31'),_0x3f27ad);}function getSmtpHost(_0x294907){switch(_0x294907){case _0x8d95('0x2c'):return _0x8d95('0x32');case _0x8d95('0x33'):return _0x8d95('0x34');case _0x8d95('0x35'):return _0x8d95('0x36');case'outlook365':return'smtp.office365.com';}throw new Error(_0x8d95('0x31'),_0x294907);}function getAuthenticationOptions(_0x345bd7,_0x474f46){var _0x569cd2={};var _0x1b4cb8={};if(_0x345bd7){_0x569cd2[_0x8d95('0x37')]=_0x1b4cb8['user']=_0x474f46[_0x8d95('0x38')];_0x569cd2[_0x8d95('0x39')]=_0x1b4cb8['pass']=_0x474f46[_0x8d95('0x39')];if(_0x474f46[_0x8d95('0x3a')]){_0x569cd2['modernAuthentication']=_0x1b4cb8['modernAuthentication']=!![];_0x569cd2['CloudProviderId']=_0x1b4cb8[_0x8d95('0x3b')]=_0x474f46[_0x8d95('0x3b')];_0x569cd2[_0x8d95('0x39')]=_0x1b4cb8[_0x8d95('0x3c')]=null;}else{_0x569cd2[_0x8d95('0x3b')]=_0x1b4cb8['CloudProviderId']=null;}_0x569cd2['host']=getImapHost(_0x345bd7);_0x569cd2['port']=0x3e1;_0x1b4cb8[_0x8d95('0x3d')]=getSmtpHost(_0x345bd7);_0x1b4cb8[_0x8d95('0x3e')]=0x24b;_0x1b4cb8[_0x8d95('0x3f')]=![];_0x569cd2[_0x8d95('0x40')]=_0x1b4cb8[_0x8d95('0x40')]=null;}else{if(_0x474f46['authentication']){_0x569cd2[_0x8d95('0x37')]=_0x1b4cb8[_0x8d95('0x37')]=_0x474f46[_0x8d95('0x38')];_0x569cd2[_0x8d95('0x39')]=_0x1b4cb8['pass']=_0x474f46[_0x8d95('0x39')];}else{_0x569cd2['authentication']=_0x1b4cb8[_0x8d95('0x41')]=![];_0x569cd2[_0x8d95('0x37')]=_0x1b4cb8[_0x8d95('0x37')]=null;_0x569cd2['password']=_0x1b4cb8[_0x8d95('0x3c')]=null;}_0x569cd2[_0x8d95('0x3d')]=_0x474f46['Imap'][_0x8d95('0x3d')];_0x569cd2[_0x8d95('0x3e')]=_0x474f46[_0x8d95('0x42')][_0x8d95('0x3e')];_0x1b4cb8['host']=_0x474f46[_0x8d95('0x43')][_0x8d95('0x3d')];_0x1b4cb8[_0x8d95('0x3e')]=_0x474f46[_0x8d95('0x43')][_0x8d95('0x3e')];}return{'Imap':_0x569cd2,'Smtp':_0x1b4cb8};}exports[_0x8d95('0x44')]=function(_0x244f80,_0x2b7e23){var _0x101dff={'include':[{'model':db['MailServerIn'],'as':_0x8d95('0x42')},{'model':db[_0x8d95('0x45')],'as':_0x8d95('0x43')},{'model':db[_0x8d95('0x46')],'as':_0x8d95('0x47')}]},_0x469858={},_0x17e2e4={'count':0x0,'rows':[]};var _0x387d0f=_[_0x8d95('0x48')](db[_0x8d95('0x49')][_0x8d95('0x4a')],function(_0x310476){return{'name':_0x310476[_0x8d95('0x4b')],'type':_0x310476['type']['key']};});_0x469858[_0x8d95('0x4c')]=_[_0x8d95('0x48')](_0x387d0f,_0x8d95('0x2b'));_0x469858[_0x8d95('0x4d')]=_[_0x8d95('0x4e')](_0x244f80['query']);_0x469858[_0x8d95('0x4f')]=_[_0x8d95('0x50')](_0x469858[_0x8d95('0x4c')],_0x469858[_0x8d95('0x4d')]);_0x101dff['attributes']=_[_0x8d95('0x50')](_0x469858['model'],qs[_0x8d95('0x51')](_0x244f80[_0x8d95('0x4d')]['fields']));_0x101dff[_0x8d95('0x52')]=_0x101dff['attributes'][_0x8d95('0x53')]?_0x101dff[_0x8d95('0x52')]:_0x469858[_0x8d95('0x4c')];if(!_0x244f80['query'][_0x8d95('0x54')]('nolimit')){_0x101dff[_0x8d95('0x21')]=qs[_0x8d95('0x21')](_0x244f80[_0x8d95('0x4d')]['limit']);_0x101dff[_0x8d95('0x1f')]=qs['offset'](_0x244f80['query']['offset']);}_0x101dff[_0x8d95('0x55')]=qs[_0x8d95('0x56')](_0x244f80[_0x8d95('0x4d')][_0x8d95('0x56')]);_0x101dff[_0x8d95('0x57')]=qs['filters'](_[_0x8d95('0x58')](_0x244f80[_0x8d95('0x4d')],_0x469858['filters']),_0x387d0f);if(_0x244f80[_0x8d95('0x4d')]['filter']){_0x101dff[_0x8d95('0x57')]=_['merge'](_0x101dff[_0x8d95('0x57')],{'$or':_[_0x8d95('0x48')](_0x387d0f,function(_0x45dee3){if(_0x45dee3[_0x8d95('0x59')]!==_0x8d95('0x5a')){var _0x53f232={};_0x53f232[_0x45dee3[_0x8d95('0x2b')]]={'$like':'%'+_0x244f80[_0x8d95('0x4d')][_0x8d95('0x5b')]+'%'};return _0x53f232;}})});}_0x101dff=_[_0x8d95('0x5c')]({},_0x101dff,_0x244f80[_0x8d95('0x5d')]);var _0x4eeef2={'where':_0x101dff[_0x8d95('0x57')]};return db['MailAccount']['count'](_0x4eeef2)[_0x8d95('0x26')](function(_0x50f2a9){_0x17e2e4[_0x8d95('0x22')]=_0x50f2a9;if(_0x244f80[_0x8d95('0x4d')][_0x8d95('0x5e')]){_0x101dff[_0x8d95('0x5f')]=[{'all':!![]}];}return db[_0x8d95('0x49')]['findAll'](_0x101dff);})[_0x8d95('0x26')](function(_0x3b653c){_0x17e2e4[_0x8d95('0x60')]=_0x3b653c;return _0x17e2e4;})['then'](respondWithFilteredResult(_0x2b7e23,_0x101dff))[_0x8d95('0x1a')](handleError(_0x2b7e23,null));};exports[_0x8d95('0x61')]=function(_0x4f5dc2,_0x3ff9ae){var _0x4a62a4={'raw':![],'where':{'id':_0x4f5dc2[_0x8d95('0x62')]['id']},'include':[{'model':db[_0x8d95('0x63')],'as':_0x8d95('0x42')},{'model':db['MailServerOut'],'as':_0x8d95('0x43')},{'model':db[_0x8d95('0x46')],'as':_0x8d95('0x47')}]},_0xf1336a={};_0xf1336a[_0x8d95('0x4c')]=_[_0x8d95('0x4e')](db['MailAccount']['rawAttributes']);_0xf1336a[_0x8d95('0x4d')]=_['keys'](_0x4f5dc2[_0x8d95('0x4d')]);_0xf1336a[_0x8d95('0x4f')]=_[_0x8d95('0x50')](_0xf1336a['model'],_0xf1336a[_0x8d95('0x4d')]);_0x4a62a4[_0x8d95('0x52')]=_[_0x8d95('0x50')](_0xf1336a['model'],qs[_0x8d95('0x51')](_0x4f5dc2[_0x8d95('0x4d')][_0x8d95('0x51')]));_0x4a62a4[_0x8d95('0x52')]=_0x4a62a4[_0x8d95('0x52')][_0x8d95('0x53')]?_0x4a62a4[_0x8d95('0x52')]:_0xf1336a['model'];if(_0x4f5dc2['query'][_0x8d95('0x5e')]){_0x4a62a4['include']=[{'all':!![]}];}_0x4a62a4=_[_0x8d95('0x5c')]({},_0x4a62a4,_0x4f5dc2['options']);return db['MailAccount'][_0x8d95('0x64')](_0x4a62a4)[_0x8d95('0x26')](handleEntityNotFound(_0x3ff9ae,null))[_0x8d95('0x26')](respondWithResult(_0x3ff9ae,null))[_0x8d95('0x1a')](handleError(_0x3ff9ae,null));};exports[_0x8d95('0x25')]=function(_0x351f14,_0x3a8ab0){if(_0x351f14[_0x8d95('0x65')]['id']){delete _0x351f14[_0x8d95('0x65')]['id'];}var _0x6333a4=_0x351f14[_0x8d95('0x65')][_0x8d95('0x66')]===_0x8d95('0x67')?null:_0x351f14[_0x8d95('0x65')][_0x8d95('0x66')];var _0x2fd628=_0x351f14[_0x8d95('0x65')]['Imap']||{};var _0x42db15=_0x351f14[_0x8d95('0x65')][_0x8d95('0x43')]||{};if(_0x6333a4){_0x2fd628[_0x8d95('0x3d')]=getImapHost(_0x6333a4);_0x2fd628['port']=0x3e1;_0x42db15[_0x8d95('0x3d')]=getSmtpHost(_0x6333a4);_0x42db15['port']=0x24b;_0x42db15[_0x8d95('0x3f')]=![];}if(_0x42db15[_0x8d95('0x3a')]){_0x42db15[_0x8d95('0x3f')]=![];}else{_0x42db15['CloudProviderId']=null;}if(!_0x2fd628[_0x8d95('0x3a')])_0x2fd628[_0x8d95('0x3b')]=null;_0x351f14[_0x8d95('0x65')][_0x8d95('0x42')]=_0x2fd628;_0x351f14[_0x8d95('0x65')]['Smtp']=_0x42db15;return db[_0x8d95('0x49')][_0x8d95('0x64')]({'where':{'id':_0x351f14[_0x8d95('0x62')]['id']},'include':[{'model':db[_0x8d95('0x63')],'as':_0x8d95('0x42')},{'model':db['MailServerOut'],'as':_0x8d95('0x43')},{'model':db[_0x8d95('0x46')],'as':_0x8d95('0x47')}]})[_0x8d95('0x26')](handleEntityNotFound(_0x3a8ab0,null))[_0x8d95('0x26')](function(_0x30e544){if(!_0x30e544)throw new Error(_0x8d95('0x68'));if(_0x30e544[_0x8d95('0x40')])delete _0x351f14[_0x8d95('0x65')][_0x8d95('0x42')];return _0x30e544;})[_0x8d95('0x26')](saveUpdates(_0x351f14['body'],null))['then'](function(_0x22098d){if(!_0x351f14[_0x8d95('0x65')]['Imap'])return _0x22098d;return db['MailServerIn'][_0x8d95('0x25')](_0x351f14[_0x8d95('0x65')][_0x8d95('0x42')],{'where':{'MailAccountId':_0x22098d['id']}})['then'](function(){return _0x22098d;});})[_0x8d95('0x26')](function(_0x6edfcc){if(!_0x351f14[_0x8d95('0x65')]['Smtp'])return _0x6edfcc;return db[_0x8d95('0x45')][_0x8d95('0x25')](_0x351f14[_0x8d95('0x65')]['Smtp'],{'where':{'MailAccountId':_0x6edfcc['id']}})['then'](function(){return _0x6edfcc;});})[_0x8d95('0x26')](respondWithResult(_0x3a8ab0,null))[_0x8d95('0x1a')](handleError(_0x3a8ab0,null));};exports[_0x8d95('0x69')]=function(_0x25de88,_0x16c855){return db[_0x8d95('0x49')][_0x8d95('0x69')]()[_0x8d95('0x26')](respondWithResult(_0x16c855,null))['catch'](handleError(_0x16c855,null));};exports[_0x8d95('0x6a')]=function(_0x581e1f,_0x1f9e6d){if(_0x581e1f['body']['id']){delete _0x581e1f[_0x8d95('0x65')]['id'];}return db[_0x8d95('0x49')]['find']({'where':{'id':_0x581e1f[_0x8d95('0x62')]['id']}})[_0x8d95('0x26')](handleEntityNotFound(_0x1f9e6d,null))['then'](function(_0x15e069){if(_0x15e069){_0x581e1f[_0x8d95('0x65')][_0x8d95('0x6b')]=_0x15e069['id'];return db[_0x8d95('0x6c')][_0x8d95('0x6d')](_0x581e1f[_0x8d95('0x65')]);}})[_0x8d95('0x26')](respondWithResult(_0x1f9e6d,null))[_0x8d95('0x1a')](handleError(_0x1f9e6d,null));};exports[_0x8d95('0x6e')]=function(_0x34e801,_0x4a20a1){var _0x21ed15={'raw':![],'where':{}};var _0x4f7a69={};var _0x1c12e8={'count':0x0,'rows':[]};return db[_0x8d95('0x49')][_0x8d95('0x6f')]({'where':{'id':_0x34e801[_0x8d95('0x62')]['id']}})[_0x8d95('0x26')](handleEntityNotFound(_0x4a20a1,null))[_0x8d95('0x26')](function(_0x26b14a){if(_0x26b14a){_0x4f7a69['model']=_[_0x8d95('0x4e')](db[_0x8d95('0x6c')][_0x8d95('0x4a')]);_0x4f7a69['query']=_[_0x8d95('0x4e')](_0x34e801[_0x8d95('0x4d')]);_0x4f7a69[_0x8d95('0x4f')]=_['intersection'](_0x4f7a69[_0x8d95('0x4c')],_0x4f7a69[_0x8d95('0x4d')]);_0x21ed15[_0x8d95('0x52')]=_[_0x8d95('0x50')](_0x4f7a69[_0x8d95('0x4c')],qs[_0x8d95('0x51')](_0x34e801[_0x8d95('0x4d')][_0x8d95('0x51')]));_0x21ed15[_0x8d95('0x52')]=_0x21ed15[_0x8d95('0x52')][_0x8d95('0x53')]?_0x21ed15[_0x8d95('0x52')]:_0x4f7a69[_0x8d95('0x4c')];if(!_0x34e801[_0x8d95('0x4d')][_0x8d95('0x54')](_0x8d95('0x70'))){_0x21ed15['limit']=qs[_0x8d95('0x21')](_0x34e801[_0x8d95('0x4d')]['limit']);_0x21ed15[_0x8d95('0x1f')]=qs[_0x8d95('0x1f')](_0x34e801[_0x8d95('0x4d')][_0x8d95('0x1f')]);}_0x21ed15[_0x8d95('0x55')]=qs[_0x8d95('0x56')](_0x34e801['query'][_0x8d95('0x56')]);_0x21ed15['where']=qs[_0x8d95('0x4f')](_[_0x8d95('0x58')](_0x34e801[_0x8d95('0x4d')],_0x4f7a69[_0x8d95('0x4f')]));_0x21ed15[_0x8d95('0x57')]['MailAccountId']=_0x26b14a['id'];if(_0x34e801[_0x8d95('0x4d')][_0x8d95('0x5b')]){_0x21ed15[_0x8d95('0x57')]=_[_0x8d95('0x5c')](_0x21ed15[_0x8d95('0x57')],{'$or':_[_0x8d95('0x48')](_0x21ed15[_0x8d95('0x52')],function(_0x5a7116){var _0xdb0697={};_0xdb0697[_0x5a7116]={'$like':'%'+_0x34e801['query'][_0x8d95('0x5b')]+'%'};return _0xdb0697;})});}_0x21ed15=_[_0x8d95('0x5c')]({},_0x21ed15,_0x34e801['options']);return db['Disposition']['count']({'where':_0x21ed15[_0x8d95('0x57')]})['then'](function(_0x4721eb){_0x1c12e8['count']=_0x4721eb;if(_0x34e801[_0x8d95('0x4d')][_0x8d95('0x5e')]){_0x21ed15[_0x8d95('0x5f')]=[{'all':!![]}];}return db[_0x8d95('0x6c')][_0x8d95('0x71')](_0x21ed15);})[_0x8d95('0x26')](function(_0xb14b53){_0x1c12e8[_0x8d95('0x60')]=_0xb14b53;return _0x1c12e8;});}})[_0x8d95('0x26')](respondWithFilteredResult(_0x4a20a1,_0x21ed15))[_0x8d95('0x1a')](handleError(_0x4a20a1,null));};exports[_0x8d95('0x72')]=function(_0x7f5870,_0x1c954d){return db[_0x8d95('0x49')][_0x8d95('0x64')]({'where':{'id':_0x7f5870[_0x8d95('0x62')]['id']}})['then'](handleEntityNotFound(_0x1c954d,null))[_0x8d95('0x26')](function(_0x1bd59a){if(_0x1bd59a){return _0x1bd59a[_0x8d95('0x72')](_0x7f5870[_0x8d95('0x4d')][_0x8d95('0x73')]);}})['then'](respondWithStatusCode(_0x1c954d,null))['catch'](handleError(_0x1c954d,null));};exports[_0x8d95('0x74')]=function(_0x1b9bcf,_0x1348a9){if(_0x1b9bcf[_0x8d95('0x65')]['id']){delete _0x1b9bcf[_0x8d95('0x65')]['id'];}return db['MailAccount'][_0x8d95('0x64')]({'where':{'id':_0x1b9bcf['params']['id']}})[_0x8d95('0x26')](handleEntityNotFound(_0x1348a9,null))[_0x8d95('0x26')](function(_0x1ca231){if(_0x1ca231){_0x1b9bcf['body'][_0x8d95('0x6b')]=_0x1ca231['id'];return db['CannedAnswer'][_0x8d95('0x6d')](_0x1b9bcf[_0x8d95('0x65')]);}})[_0x8d95('0x26')](respondWithResult(_0x1348a9,null))[_0x8d95('0x1a')](handleError(_0x1348a9,null));};exports[_0x8d95('0x75')]=function(_0x10f4d5,_0x4a5e56){var _0xc52415={'raw':![],'where':{}};var _0x1aa457={};var _0x41149b={'count':0x0,'rows':[]};return db[_0x8d95('0x49')]['findOne']({'where':{'id':_0x10f4d5[_0x8d95('0x62')]['id']}})[_0x8d95('0x26')](handleEntityNotFound(_0x4a5e56,null))[_0x8d95('0x26')](function(_0x438f4a){if(_0x438f4a){_0x1aa457[_0x8d95('0x4c')]=_[_0x8d95('0x4e')](db[_0x8d95('0x76')][_0x8d95('0x4a')]);_0x1aa457['query']=_[_0x8d95('0x4e')](_0x10f4d5[_0x8d95('0x4d')]);_0x1aa457[_0x8d95('0x4f')]=_[_0x8d95('0x50')](_0x1aa457[_0x8d95('0x4c')],_0x1aa457['query']);_0xc52415['attributes']=_['intersection'](_0x1aa457['model'],qs[_0x8d95('0x51')](_0x10f4d5[_0x8d95('0x4d')][_0x8d95('0x51')]));_0xc52415[_0x8d95('0x52')]=_0xc52415[_0x8d95('0x52')]['length']?_0xc52415['attributes']:_0x1aa457[_0x8d95('0x4c')];if(!_0x10f4d5[_0x8d95('0x4d')]['hasOwnProperty'](_0x8d95('0x70'))){_0xc52415[_0x8d95('0x21')]=qs['limit'](_0x10f4d5[_0x8d95('0x4d')][_0x8d95('0x21')]);_0xc52415[_0x8d95('0x1f')]=qs[_0x8d95('0x1f')](_0x10f4d5['query'][_0x8d95('0x1f')]);}_0xc52415['order']=qs['sort'](_0x10f4d5[_0x8d95('0x4d')]['sort']);_0xc52415['where']=qs[_0x8d95('0x4f')](_['pick'](_0x10f4d5[_0x8d95('0x4d')],_0x1aa457['filters']));_0xc52415[_0x8d95('0x57')][_0x8d95('0x6b')]=_0x438f4a['id'];if(_0x10f4d5[_0x8d95('0x4d')]['filter']){_0xc52415['where']=_[_0x8d95('0x5c')](_0xc52415['where'],{'$or':_[_0x8d95('0x48')](_0xc52415['attributes'],function(_0x784919){var _0x2c2dc9={};_0x2c2dc9[_0x784919]={'$like':'%'+_0x10f4d5[_0x8d95('0x4d')][_0x8d95('0x5b')]+'%'};return _0x2c2dc9;})});}_0xc52415=_[_0x8d95('0x5c')]({},_0xc52415,_0x10f4d5[_0x8d95('0x5d')]);return db['CannedAnswer']['count']({'where':_0xc52415[_0x8d95('0x57')]})['then'](function(_0x7cd722){_0x41149b['count']=_0x7cd722;if(_0x10f4d5['query'][_0x8d95('0x5e')]){_0xc52415[_0x8d95('0x5f')]=[{'all':!![]}];}return db[_0x8d95('0x76')][_0x8d95('0x71')](_0xc52415);})[_0x8d95('0x26')](function(_0x5acebd){_0x41149b[_0x8d95('0x60')]=_0x5acebd;return _0x41149b;});}})['then'](respondWithFilteredResult(_0x4a5e56,_0xc52415))[_0x8d95('0x1a')](handleError(_0x4a5e56,null));};exports[_0x8d95('0x77')]=function(_0x163f89,_0x45b85e){return db['MailAccount'][_0x8d95('0x64')]({'where':{'id':_0x163f89[_0x8d95('0x62')]['id']}})[_0x8d95('0x26')](handleEntityNotFound(_0x45b85e,null))[_0x8d95('0x26')](function(_0x4e07f4){if(_0x4e07f4){return _0x4e07f4[_0x8d95('0x77')](_0x163f89[_0x8d95('0x4d')]['ids']);}})['then'](respondWithStatusCode(_0x45b85e,null))['catch'](handleError(_0x45b85e,null));};exports['create']=function(_0x408360,_0x4e7f6d){var _0x554bcf={'name':_0x408360[_0x8d95('0x65')][_0x8d95('0x2b')],'key':_0x408360[_0x8d95('0x65')][_0x8d95('0x78')],'provider':_0x408360[_0x8d95('0x65')][_0x8d95('0x66')]==='custom'?null:_0x408360[_0x8d95('0x65')][_0x8d95('0x66')],'email':_0x408360[_0x8d95('0x65')]['email'],'ListId':_0x408360[_0x8d95('0x65')]['ListId'],'active':!_[_0x8d95('0x79')](_0x408360[_0x8d95('0x65')]['active'])?_0x408360['body'][_0x8d95('0x7a')]:!![],'description':_0x408360[_0x8d95('0x65')]['description']||null};var _0x678d2b=getAuthenticationOptions(_0x554bcf['provider'],_0x408360['body']);_0x554bcf[_0x8d95('0x42')]=_0x678d2b[_0x8d95('0x42')];_0x554bcf[_0x8d95('0x43')]=_0x678d2b[_0x8d95('0x43')];return db['MailAccount'][_0x8d95('0x6d')](_0x554bcf,{'include':[{'model':db[_0x8d95('0x45')],'as':_0x8d95('0x43')},{'model':db[_0x8d95('0x63')],'as':'Imap'}]})[_0x8d95('0x26')](function(_0x232cd2){var _0x48c35e=_0x408360['user']['get']({'plain':!![]});if(!_0x48c35e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x48c35e['role']===_0x8d95('0x37')){var _0x5ca4ef=_0x232cd2[_0x8d95('0x7b')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x8d95('0x27'),'userProfileId':_0x48c35e['userProfileId']},'raw':!![]})['then'](function(_0x55a365){if(_0x55a365&&_0x55a365[_0x8d95('0x7c')]===0x0){return db['UserProfileResource'][_0x8d95('0x6d')]({'name':_0x5ca4ef[_0x8d95('0x2b')],'resourceId':_0x5ca4ef['id'],'type':_0x55a365['name'],'sectionId':_0x55a365['id']},{})['then'](function(){return _0x232cd2;});}else{return _0x232cd2;}})[_0x8d95('0x1a')](function(_0x359ac7){logger['error'](_0x8d95('0x7d'),_0x359ac7);throw _0x359ac7;});}return _0x232cd2;})['then'](respondWithResult(_0x4e7f6d,0xc9))[_0x8d95('0x1a')](handleError(_0x4e7f6d,null));};exports[_0x8d95('0x7e')]=function(_0x4afba2,_0x54f9ce){return db[_0x8d95('0x49')][_0x8d95('0x6f')]({'where':{'id':_0x4afba2['params']['id']}})['then'](handleEntityNotFound(_0x54f9ce,null))[_0x8d95('0x26')](function(_0x4ba6a6){if(_0x4ba6a6){return _0x4ba6a6[_0x8d95('0x7e')]();}return null;})['then'](respondWithResult(_0x54f9ce,null))[_0x8d95('0x1a')](handleError(_0x54f9ce,null));};exports[_0x8d95('0x7f')]=function(_0x3affc1,_0x26d2de){if(_0x3affc1[_0x8d95('0x65')]['id']){delete _0x3affc1[_0x8d95('0x65')]['id'];}return db['MailAccount'][_0x8d95('0x64')]({'where':{'id':_0x3affc1[_0x8d95('0x62')]['id']}})[_0x8d95('0x26')](handleEntityNotFound(_0x26d2de,null))[_0x8d95('0x26')](function(_0x5642e8){if(_0x5642e8){_0x3affc1['body'][_0x8d95('0x6b')]=_0x5642e8['id'];return db[_0x8d95('0x63')]['create'](_0x3affc1['body']);}})[_0x8d95('0x26')](respondWithResult(_0x26d2de,null))[_0x8d95('0x1a')](handleError(_0x26d2de,null));};exports[_0x8d95('0x80')]=function(_0xcdc179,_0x315fc9){return db[_0x8d95('0x49')][_0x8d95('0x6f')]({'where':{'id':_0xcdc179['params']['id']}})[_0x8d95('0x26')](handleEntityNotFound(_0x315fc9,null))[_0x8d95('0x26')](function(_0x1d2fd0){if(_0x1d2fd0){return _0x1d2fd0[_0x8d95('0x81')](null);}return null;})[_0x8d95('0x26')](respondWithStatusCode(_0x315fc9,null))['catch'](handleError(_0x315fc9,null));};exports['getSmtp']=function(_0x3685be,_0xcde55d){return db[_0x8d95('0x49')]['findOne']({'where':{'id':_0x3685be[_0x8d95('0x62')]['id']}})[_0x8d95('0x26')](handleEntityNotFound(_0xcde55d,null))['then'](function(_0x3d6480){if(_0x3d6480){return _0x3d6480[_0x8d95('0x82')]();}return null;})[_0x8d95('0x26')](respondWithResult(_0xcde55d,null))[_0x8d95('0x1a')](handleError(_0xcde55d,null));};exports[_0x8d95('0x83')]=function(_0x455aa1,_0x574b57){if(_0x455aa1[_0x8d95('0x65')]['id']){delete _0x455aa1[_0x8d95('0x65')]['id'];}return db[_0x8d95('0x49')]['find']({'where':{'id':_0x455aa1[_0x8d95('0x62')]['id']}})[_0x8d95('0x26')](handleEntityNotFound(_0x574b57,null))['then'](function(_0x441498){if(_0x441498){_0x455aa1[_0x8d95('0x65')]['MailAccountId']=_0x441498['id'];return db[_0x8d95('0x45')][_0x8d95('0x6d')](_0x455aa1[_0x8d95('0x65')]);}})['then'](respondWithResult(_0x574b57,null))[_0x8d95('0x1a')](handleError(_0x574b57,null));};exports[_0x8d95('0x84')]=function(_0x49ce91,_0x1cfba9){return db[_0x8d95('0x49')][_0x8d95('0x6f')]({'where':{'id':_0x49ce91[_0x8d95('0x62')]['id']}})[_0x8d95('0x26')](handleEntityNotFound(_0x1cfba9,null))['then'](function(_0x563c9b){if(_0x563c9b){return _0x563c9b[_0x8d95('0x85')](null);}return null;})['then'](respondWithStatusCode(_0x1cfba9,null))[_0x8d95('0x1a')](handleError(_0x1cfba9,null));};exports[_0x8d95('0x86')]=function(_0x12d987,_0x24a2b5){return db['MailInteraction'][_0x8d95('0x64')]({'where':{'id':_0x12d987[_0x8d95('0x62')]['id']}})[_0x8d95('0x26')](handleEntityNotFound(_0x24a2b5,null))[_0x8d95('0x26')](function(_0x208f65){if(_0x208f65){return _0x208f65['addInteraction'](_0x12d987['body']['ids'],_[_0x8d95('0x87')](_0x12d987[_0x8d95('0x65')],['ids','id'])||{});}})[_0x8d95('0x26')](respondWithResult(_0x24a2b5,null))[_0x8d95('0x1a')](handleError(_0x24a2b5,null));};exports['getInteractions']=function(_0xcee7f,_0x3577a9){var _0x5b8a4a={'raw':![],'where':{}};var _0x385254={};var _0x2b86ac={'count':0x0,'rows':[]};return db['MailAccount'][_0x8d95('0x6f')]({'where':{'id':_0xcee7f[_0x8d95('0x62')]['id']}})[_0x8d95('0x26')](handleEntityNotFound(_0x3577a9,null))[_0x8d95('0x26')](function(_0x524d99){if(_0x524d99){_0x385254[_0x8d95('0x4c')]=_[_0x8d95('0x4e')](db[_0x8d95('0x88')]['rawAttributes']);_0x385254['query']=_['keys'](_0xcee7f[_0x8d95('0x4d')]);_0x385254[_0x8d95('0x4f')]=_[_0x8d95('0x50')](_0x385254['model'],_0x385254[_0x8d95('0x4d')]);_0x5b8a4a[_0x8d95('0x52')]=_[_0x8d95('0x50')](_0x385254['model'],qs[_0x8d95('0x51')](_0xcee7f[_0x8d95('0x4d')][_0x8d95('0x51')]));_0x5b8a4a[_0x8d95('0x52')]=_0x5b8a4a[_0x8d95('0x52')][_0x8d95('0x53')]?_0x5b8a4a[_0x8d95('0x52')]:_0x385254[_0x8d95('0x4c')];if(!_0xcee7f['query'][_0x8d95('0x54')]('nolimit')){_0x5b8a4a['limit']=qs[_0x8d95('0x21')](_0xcee7f[_0x8d95('0x4d')][_0x8d95('0x21')]);_0x5b8a4a[_0x8d95('0x1f')]=qs['offset'](_0xcee7f[_0x8d95('0x4d')]['offset']);}_0x5b8a4a[_0x8d95('0x55')]=qs['sort'](_0xcee7f[_0x8d95('0x4d')]['sort']);_0x5b8a4a[_0x8d95('0x57')]=qs[_0x8d95('0x4f')](_['pick'](_0xcee7f[_0x8d95('0x4d')],_0x385254[_0x8d95('0x4f')]));_0x5b8a4a['where']['MailAccountId']=_0x524d99['id'];if(_0xcee7f['query'][_0x8d95('0x5b')]){_0x5b8a4a[_0x8d95('0x57')]=_['merge'](_0x5b8a4a[_0x8d95('0x57')],{'$or':_[_0x8d95('0x48')](_0x5b8a4a['attributes'],function(_0x2b4ea6){var _0x1a7916={};_0x1a7916[_0x2b4ea6]={'$like':'%'+_0xcee7f['query']['filter']+'%'};return _0x1a7916;})});}_0x5b8a4a=_[_0x8d95('0x5c')]({},_0x5b8a4a,_0xcee7f[_0x8d95('0x5d')]);return db['MailInteraction']['count']({'where':_0x5b8a4a[_0x8d95('0x57')]})[_0x8d95('0x26')](function(_0x25830a){_0x2b86ac[_0x8d95('0x22')]=_0x25830a;if(_0xcee7f[_0x8d95('0x4d')][_0x8d95('0x5e')]){_0x5b8a4a[_0x8d95('0x5f')]=[{'model':db['CmContact'],'as':_0x8d95('0x89'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x8d95('0x2b'),_0x8d95('0x8a'),_0x8d95('0x8b')],'required':![]},{'model':db[_0x8d95('0x8c')],'as':_0x8d95('0x8d'),'attributes':['id',_0x8d95('0x2b'),_0x8d95('0x8e')],'where':_0xcee7f[_0x8d95('0x4d')]['tag']?{'id':_0xcee7f[_0x8d95('0x4d')][_0x8d95('0x8f')]}:undefined,'required':_0xcee7f[_0x8d95('0x4d')][_0x8d95('0x8f')]?!![]:![]}];}return db[_0x8d95('0x88')][_0x8d95('0x71')](_0x5b8a4a);})[_0x8d95('0x26')](function(_0x6a2ae7){_0x2b86ac[_0x8d95('0x60')]=_0x6a2ae7;return _0x2b86ac;});}})[_0x8d95('0x26')](respondWithFilteredResult(_0x3577a9,_0x5b8a4a))[_0x8d95('0x1a')](handleError(_0x3577a9,null));};exports[_0x8d95('0x90')]=function addApplications(_0x56cb8c,_0x1c666b){var _0xe81702=_0x56cb8c[_0x8d95('0x62')]['id'];var _0x533fc8=_0x56cb8c[_0x8d95('0x65')];var _0x5aa6f5=0xc8;var _0x44df3f=null;return db['sequelize'][_0x8d95('0x91')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x24ef7e){return db[_0x8d95('0x49')][_0x8d95('0x6f')]({'where':{'id':_0xe81702},'transaction':_0x24ef7e})[_0x8d95('0x26')](function(_0x335585){if(_0x335585){return db[_0x8d95('0x92')][_0x8d95('0x29')]({'where':{'MailAccountId':_0xe81702},'transaction':_0x24ef7e})['then'](function(){var _0x42be85=_['map'](_0x533fc8,function(_0x414cf8){_0x414cf8[_0x8d95('0x6b')]=_0xe81702;return _0x414cf8;});return db[_0x8d95('0x92')]['bulkCreate'](_0x42be85,{'transaction':_0x24ef7e});});}else{_0x5aa6f5=0x194;_0x44df3f=[];}});})[_0x8d95('0x26')](function(){if(_0x5aa6f5!==0x194){return db[_0x8d95('0x92')]['findAndCountAll']({'where':{'MailAccountId':_0xe81702},'order':_0x8d95('0x93')})[_0x8d95('0x26')](function(_0x47c6c1){_0x44df3f=_0x47c6c1;});}})[_0x8d95('0x1a')](function(_0x376695){_0x5aa6f5=0x1f4;logger['error'](_0x376695[_0x8d95('0x2a')]);if(_0x376695[_0x8d95('0x2b')]){delete _0x376695[_0x8d95('0x2b')];}_0x44df3f=_0x376695;})[_0x8d95('0x94')](function(){if(_0x44df3f===null){_0x1c666b['sendStatus'](_0x5aa6f5);}else{if(_0x5aa6f5===0x1f4){_0x1c666b[_0x8d95('0x1c')](_0x5aa6f5)[_0x8d95('0x95')](_0x44df3f);}else{_0x1c666b[_0x8d95('0x1c')](_0x5aa6f5)[_0x8d95('0x1e')](_0x44df3f);}}});};exports['getApplications']=function(_0x593ec1,_0x1a7f0e){var _0x2fd198={};var _0x4dec7a={};var _0x12b69c;var _0x55c293;return db[_0x8d95('0x49')][_0x8d95('0x6f')]({'where':{'id':_0x593ec1['params']['id']}})['then'](handleEntityNotFound(_0x1a7f0e,null))['then'](function(_0x3bfc5){if(_0x3bfc5){_0x12b69c=_0x3bfc5;_0x4dec7a[_0x8d95('0x4c')]=_[_0x8d95('0x4e')](db['MailApplication'][_0x8d95('0x4a')]);_0x4dec7a[_0x8d95('0x4d')]=_[_0x8d95('0x4e')](_0x593ec1['query']);_0x4dec7a['filters']=_[_0x8d95('0x50')](_0x4dec7a[_0x8d95('0x4c')],_0x4dec7a[_0x8d95('0x4d')]);_0x2fd198['attributes']=_[_0x8d95('0x50')](_0x4dec7a[_0x8d95('0x4c')],qs[_0x8d95('0x51')](_0x593ec1[_0x8d95('0x4d')][_0x8d95('0x51')]));_0x2fd198['attributes']=_0x2fd198[_0x8d95('0x52')][_0x8d95('0x53')]?_0x2fd198['attributes']:_0x4dec7a[_0x8d95('0x4c')];_0x2fd198[_0x8d95('0x55')]=qs[_0x8d95('0x56')](_0x593ec1[_0x8d95('0x4d')][_0x8d95('0x56')]);_0x2fd198[_0x8d95('0x57')]=qs['filters'](_['pick'](_0x593ec1[_0x8d95('0x4d')],_0x4dec7a[_0x8d95('0x4f')]));if(_0x593ec1['query'][_0x8d95('0x5b')]){_0x2fd198['where']=_[_0x8d95('0x5c')](_0x2fd198[_0x8d95('0x57')],{'$or':_[_0x8d95('0x48')](_0x2fd198['attributes'],function(_0x52055b){var _0x800b04={};_0x800b04[_0x52055b]={'$like':'%'+_0x593ec1[_0x8d95('0x4d')]['filter']+'%'};return _0x800b04;})});}_0x2fd198=_['merge']({},_0x2fd198,_0x593ec1['options']);return _0x12b69c[_0x8d95('0x96')](_0x2fd198);}})[_0x8d95('0x26')](function(_0x42473e){if(_0x42473e){_0x55c293=_0x42473e['length'];if(!_0x593ec1[_0x8d95('0x4d')][_0x8d95('0x54')](_0x8d95('0x70'))){_0x2fd198[_0x8d95('0x21')]=qs['limit'](_0x593ec1[_0x8d95('0x4d')][_0x8d95('0x21')]);_0x2fd198['offset']=qs['offset'](_0x593ec1[_0x8d95('0x4d')]['offset']);}return _0x12b69c[_0x8d95('0x96')](_0x2fd198);}})[_0x8d95('0x26')](function(_0x7e27a2){if(_0x7e27a2){return _0x7e27a2?{'count':_0x55c293,'rows':_0x7e27a2}:null;}})['then'](respondWithResult(_0x1a7f0e,null))[_0x8d95('0x1a')](handleError(_0x1a7f0e,null));};exports[_0x8d95('0x97')]=function(_0x27d071,_0x280771){var _0x101880={'raw':!![],'where':{}};var _0x5caa3e={};var _0x3f4f39={'count':0x0,'rows':[]};return db['MailAccount'][_0x8d95('0x6f')]({'where':{'id':_0x27d071[_0x8d95('0x62')]['id']}})[_0x8d95('0x26')](handleEntityNotFound(_0x280771,null))[_0x8d95('0x26')](function(_0x31388b){if(_0x31388b){_0x5caa3e['model']=_['keys'](db['MailMessage'][_0x8d95('0x4a')]);_0x5caa3e[_0x8d95('0x4d')]=_['keys'](_0x27d071[_0x8d95('0x4d')]);_0x5caa3e['filters']=_[_0x8d95('0x50')](_0x5caa3e[_0x8d95('0x4c')],_0x5caa3e[_0x8d95('0x4d')]);_0x101880['attributes']=_[_0x8d95('0x50')](_0x5caa3e[_0x8d95('0x4c')],qs[_0x8d95('0x51')](_0x27d071[_0x8d95('0x4d')][_0x8d95('0x51')]));_0x101880[_0x8d95('0x52')]=_0x101880[_0x8d95('0x52')]['length']?_0x101880[_0x8d95('0x52')]:_0x5caa3e[_0x8d95('0x4c')];if(!_0x27d071[_0x8d95('0x4d')][_0x8d95('0x54')](_0x8d95('0x70'))){_0x101880[_0x8d95('0x21')]=qs[_0x8d95('0x21')](_0x27d071[_0x8d95('0x4d')][_0x8d95('0x21')]);_0x101880['offset']=qs[_0x8d95('0x1f')](_0x27d071[_0x8d95('0x4d')]['offset']);}_0x101880[_0x8d95('0x55')]=qs[_0x8d95('0x56')](_0x27d071[_0x8d95('0x4d')]['sort']);_0x101880[_0x8d95('0x57')]=qs[_0x8d95('0x4f')](_[_0x8d95('0x58')](_0x27d071[_0x8d95('0x4d')],_0x5caa3e[_0x8d95('0x4f')]));_0x101880[_0x8d95('0x57')][_0x8d95('0x6b')]=_0x31388b['id'];if(_0x27d071[_0x8d95('0x4d')][_0x8d95('0x5b')]){_0x101880['where']=_['merge'](_0x101880['where'],{'$or':_[_0x8d95('0x48')](_0x101880['attributes'],function(_0x1bd7eb){var _0x50b0ec={};_0x50b0ec[_0x1bd7eb]={'$like':'%'+_0x27d071[_0x8d95('0x4d')][_0x8d95('0x5b')]+'%'};return _0x50b0ec;})});}if(_0x27d071[_0x8d95('0x4d')][_0x8d95('0x98')]){var _0x1a0781=_0x27d071[_0x8d95('0x4d')][_0x8d95('0x98')][_0x8d95('0x99')](',');var _0x5c1b68={};_0x5c1b68[_0x1a0781[0x0]]={'$gte':moment(_0x1a0781[0x1])[_0x8d95('0x9a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x101880[_0x8d95('0x57')]=_[_0x8d95('0x5c')](_0x101880['where'],_0x5c1b68);}_0x101880=_[_0x8d95('0x5c')]({},_0x101880,_0x27d071[_0x8d95('0x5d')]);return db[_0x8d95('0x9b')]['count']({'where':_0x101880['where']})['then'](function(_0x1451a0){_0x3f4f39[_0x8d95('0x22')]=_0x1451a0;if(_0x27d071[_0x8d95('0x4d')][_0x8d95('0x5e')]){_0x101880[_0x8d95('0x5f')]=[{'all':!![]}];}return db[_0x8d95('0x9b')][_0x8d95('0x71')](_0x101880);})[_0x8d95('0x26')](function(_0x1534ec){if(_0x27d071['query'][_0x8d95('0x9c')]==='true'){for(var _0x426b10=0x0;_0x426b10<_0x1534ec['length'];_0x426b10++){_0x1534ec[_0x426b10]['body']=juice(_0x1534ec[_0x426b10]['body']);}}_0x3f4f39['rows']=_0x1534ec;return _0x3f4f39;});}})[_0x8d95('0x26')](respondWithFilteredResult(_0x280771,_0x101880))[_0x8d95('0x1a')](handleError(_0x280771,null));};exports[_0x8d95('0x95')]=function(_0x1f7e14,_0x44bb1d){var _0x5770fc,_0x1e49f1={},_0x151fc8;if(_0x1f7e14[_0x8d95('0x65')]['to']){_0x151fc8=_0x1f7e14[_0x8d95('0x65')]['to']['split'](',')[0x0];}return db[_0x8d95('0x49')]['find']({'where':{'id':_0x1f7e14[_0x8d95('0x62')]['id']},'include':[{'model':db[_0x8d95('0x9d')],'as':'List','include':[{'model':db[_0x8d95('0x9e')],'as':_0x8d95('0x9f'),'where':{'email':_0x151fc8},'limit':0x1,'order':[[_0x8d95('0xa0'),_0x8d95('0xa1')]]}]},{'model':db[_0x8d95('0x45')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x8d95('0xa2'),'raw':!![]}]}]})[_0x8d95('0x26')](handleEntityNotFound(_0x44bb1d,null))[_0x8d95('0x26')](function(_0xf541b3){if(!_0xf541b3)return;_0x5770fc=_0xf541b3;if(!_0xf541b3[_0x8d95('0x43')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_['isNil'](_0x1f7e14[_0x8d95('0x65')]['from'])){_0x1f7e14[_0x8d95('0x65')]['from']=util['format'](_0x8d95('0xa3'),_0xf541b3[_0x8d95('0x2b')],_0xf541b3[_0x8d95('0xa4')]||_0xf541b3['Smtp']['user']);}if(_0x1f7e14[_0x8d95('0x65')][_0x8d95('0xa5')]&&_0x1f7e14['body']['attachments'][_0x8d95('0x53')]){for(var _0x4a5b80=0x0;_0x4a5b80<_0x1f7e14[_0x8d95('0x65')]['attachments'][_0x8d95('0x53')];_0x4a5b80+=0x1){_0x1f7e14[_0x8d95('0x65')]['attachments'][_0x4a5b80]={'filename':_0x1f7e14['body']['attachments'][_0x4a5b80][_0x8d95('0x2b')],'path':path['join'](config[_0x8d95('0xa6')],'server/files/attachments',_0x1f7e14['body'][_0x8d95('0xa5')][_0x4a5b80][_0x8d95('0xa7')])};}}var _0x450876=_0xf541b3[_0x8d95('0xa8')]();return respondWithRpcPromise(_0x8d95('0xa9'),_0x8d95('0xaa'),{'account':_0x450876,'message':_0x1f7e14[_0x8d95('0x65')]});})[_0x8d95('0x26')](function(_0xe78adf){if(!_0xe78adf)return;_0x1e49f1=_0xe78adf;if(!_0x5770fc[_0x8d95('0xab')])throw new Error('List\x20not\x20found');if(_0x5770fc[_0x8d95('0xab')][_0x8d95('0x9f')]['length'])return _0x5770fc[_0x8d95('0xab')][_0x8d95('0x9f')][0x0];return db[_0x8d95('0x9e')][_0x8d95('0x6d')](_[_0x8d95('0x9')](_0x1f7e14[_0x8d95('0x65')],{'firstName':_0x1f7e14[_0x8d95('0x65')]['to'],'email':_0x1f7e14[_0x8d95('0x65')]['to'],'phone':_0x1f7e14['body']['to'],'ListId':_0x5770fc[_0x8d95('0xac')]}));})[_0x8d95('0x26')](function(_0x3b4865){if(!_0x3b4865)return;var _0x56d2={'UserId':_0x1f7e14[_0x8d95('0x37')]['id'],'ContactId':_0x3b4865['id'],'MailAccountId':_0x5770fc['id'],'inReplyTo':_0x1e49f1[_0x8d95('0xad')],'to':_0x1f7e14[_0x8d95('0x65')][_0x8d95('0xae')],'cc':_0x1f7e14[_0x8d95('0x65')]['cc'],'subject':_0x1f7e14[_0x8d95('0x65')][_0x8d95('0xaf')],'attach':_0x1f7e14[_0x8d95('0x65')][_0x8d95('0xb0')],'firstMsgDirection':'out','lastMsgAt':moment()['format'](_0x8d95('0xb1')),'lastMsgDirection':_0x8d95('0xb2'),'Messages':[_[_0x8d95('0x5c')](_0x1f7e14[_0x8d95('0x65')],{'messageId':_0x1e49f1[_0x8d95('0xad')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x5770fc['id'],'UserId':_0x1f7e14[_0x8d95('0x37')]['id'],'ContactId':_0x3b4865['id']})]};if(_0x1f7e14[_0x8d95('0x65')][_0x8d95('0xb3')]){_0x56d2=_[_0x8d95('0x5c')](_0x56d2,_0x1f7e14[_0x8d95('0x65')]['Interaction']);}return db[_0x8d95('0x88')][_0x8d95('0x6d')](_0x56d2,{'include':[{'model':db[_0x8d95('0x9b')],'as':_0x8d95('0xb4')}]});})[_0x8d95('0x26')](respondWithResult(_0x44bb1d,null))[_0x8d95('0x1a')](handleError(_0x44bb1d,null));};exports['verifySmtp']=function(_0x179491,_0x148eed){return db[_0x8d95('0x49')][_0x8d95('0x64')]({'where':{'id':_0x179491['params']['id']},'include':[{'model':db[_0x8d95('0x45')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x8d95('0x26')](handleEntityNotFound(_0x148eed,null))[_0x8d95('0x26')](function(_0x193e02){if(!_0x193e02[_0x8d95('0x43')])return;var _0x2855ca=_0x193e02['getSmtpOptions']();return respondWithRpcPromise(_0x8d95('0xb5'),_0x8d95('0xb6'),{'account':_0x2855ca});})['then'](respondWithResult(_0x148eed,null))[_0x8d95('0x1a')](handleError(_0x148eed,null));};exports[_0x8d95('0x29')]=function(_0xee532c,_0x16077a){return db[_0x8d95('0x49')][_0x8d95('0x64')]({'where':{'id':_0xee532c[_0x8d95('0x62')]['id']}})[_0x8d95('0x26')](handleEntityNotFound(_0x16077a,null))[_0x8d95('0x26')](function(_0x1dc38e){if(_0x1dc38e&&_0x1dc38e['service']){throw new db[(_0x8d95('0xb7'))][(_0x8d95('0xb8'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x1dc38e;})[_0x8d95('0x26')](removeEntity(_0x16077a,null))[_0x8d95('0x1a')](handleError(_0x16077a,null));};exports['addAgents']=function(_0x41a263,_0x28e769){return db[_0x8d95('0x49')][_0x8d95('0x64')]({'where':{'id':_0x41a263['params']['id']}})[_0x8d95('0x26')](handleEntityNotFound(_0x28e769,null))[_0x8d95('0x26')](function(_0x248fb1){if(_0x248fb1){return _0x248fb1[_0x8d95('0xb9')](_0x41a263[_0x8d95('0x65')]['ids'],_['omit'](_0x41a263[_0x8d95('0x65')],[_0x8d95('0x73'),'id'])||{})[_0x8d95('0xba')](function(_0x3c699c){for(var _0x189dd0=0x0;_0x189dd0<_0x41a263[_0x8d95('0x65')][_0x8d95('0x73')][_0x8d95('0x53')];_0x189dd0+=0x1){socket[_0x8d95('0xbb')](_0x8d95('0xbc'),{'UserId':Number(_0x41a263[_0x8d95('0x65')]['ids'][_0x189dd0]),'MailAccountId':Number(_0x41a263[_0x8d95('0x62')]['id'])});}return _0x3c699c;});}})['then'](respondWithResult(_0x28e769,null))[_0x8d95('0x1a')](handleError(_0x28e769,null));};exports[_0x8d95('0xbd')]=function(_0x566a89,_0x3e86b6){return db[_0x8d95('0x49')][_0x8d95('0x64')]({'where':{'id':_0x566a89['params']['id']}})[_0x8d95('0x26')](handleEntityNotFound(_0x3e86b6,null))[_0x8d95('0x26')](function(_0x7df3fa){if(_0x7df3fa){return _0x7df3fa[_0x8d95('0xbd')](_0x566a89[_0x8d95('0x4d')][_0x8d95('0x73')])['then'](function(){if(_[_0x8d95('0xbe')](_0x566a89[_0x8d95('0x4d')]['ids'])){for(var _0x455ece=0x0;_0x455ece<_0x566a89[_0x8d95('0x4d')][_0x8d95('0x73')]['length'];_0x455ece+=0x1){socket[_0x8d95('0xbb')](_0x8d95('0xbf'),{'UserId':Number(_0x566a89[_0x8d95('0x4d')][_0x8d95('0x73')][_0x455ece]),'MailAccountId':Number(_0x566a89[_0x8d95('0x62')]['id'])});}}else{socket[_0x8d95('0xbb')]('userMailAccount:remove',{'UserId':Number(_0x566a89[_0x8d95('0x4d')][_0x8d95('0x73')]),'MailAccountId':Number(_0x566a89[_0x8d95('0x62')]['id'])});}});}})[_0x8d95('0x26')](respondWithStatusCode(_0x3e86b6,null))['catch'](handleError(_0x3e86b6,null));};exports[_0x8d95('0xc0')]=function(_0xfeae87,_0x36275a){var _0x19c803={};var _0x5bb271={};var _0x6c4cc9;var _0x4f3088;return db['MailAccount'][_0x8d95('0x6f')]({'where':{'id':_0xfeae87[_0x8d95('0x62')]['id']}})[_0x8d95('0x26')](handleEntityNotFound(_0x36275a,null))[_0x8d95('0x26')](function(_0x1288c0){if(_0x1288c0){_0x6c4cc9=_0x1288c0;_0x5bb271[_0x8d95('0x4c')]=_[_0x8d95('0x4e')](db['User'][_0x8d95('0x4a')]);_0x5bb271[_0x8d95('0x4d')]=_[_0x8d95('0x4e')](_0xfeae87[_0x8d95('0x4d')]);_0x5bb271[_0x8d95('0x4f')]=_[_0x8d95('0x50')](_0x5bb271[_0x8d95('0x4c')],_0x5bb271['query']);_0x19c803[_0x8d95('0x52')]=_[_0x8d95('0x50')](_0x5bb271[_0x8d95('0x4c')],qs[_0x8d95('0x51')](_0xfeae87[_0x8d95('0x4d')][_0x8d95('0x51')]));_0x19c803[_0x8d95('0x52')]=_0x19c803[_0x8d95('0x52')][_0x8d95('0x53')]?_0x19c803[_0x8d95('0x52')]:_0x5bb271['model'];_0x19c803[_0x8d95('0x55')]=qs[_0x8d95('0x56')](_0xfeae87[_0x8d95('0x4d')][_0x8d95('0x56')]);_0x19c803[_0x8d95('0x57')]=qs['filters'](_[_0x8d95('0x58')](_0xfeae87[_0x8d95('0x4d')],_0x5bb271[_0x8d95('0x4f')]));if(_0xfeae87[_0x8d95('0x4d')]['filter']){_0x19c803[_0x8d95('0x57')]=_[_0x8d95('0x5c')](_0x19c803['where'],{'$or':_[_0x8d95('0x48')](_0x19c803[_0x8d95('0x52')],function(_0x1c567e){var _0x4458dd={};_0x4458dd[_0x1c567e]={'$like':'%'+_0xfeae87[_0x8d95('0x4d')][_0x8d95('0x5b')]+'%'};return _0x4458dd;})});}_0x19c803=_[_0x8d95('0x5c')]({},_0x19c803,_0xfeae87[_0x8d95('0x5d')]);return _0x6c4cc9[_0x8d95('0xc0')](_0x19c803);}})['then'](function(_0x592996){if(_0x592996){_0x4f3088=_0x592996[_0x8d95('0x53')];if(!_0xfeae87[_0x8d95('0x4d')][_0x8d95('0x54')](_0x8d95('0x70'))){_0x19c803[_0x8d95('0x21')]=qs[_0x8d95('0x21')](_0xfeae87[_0x8d95('0x4d')][_0x8d95('0x21')]);_0x19c803[_0x8d95('0x1f')]=qs[_0x8d95('0x1f')](_0xfeae87[_0x8d95('0x4d')][_0x8d95('0x1f')]);}return _0x6c4cc9[_0x8d95('0xc0')](_0x19c803);}})['then'](function(_0x14d75e){if(_0x14d75e){return _0x14d75e?{'count':_0x4f3088,'rows':_0x14d75e}:null;}})[_0x8d95('0x26')](respondWithResult(_0x36275a,null))[_0x8d95('0x1a')](handleError(_0x36275a,null));}; \ No newline at end of file +var _0x5fc4=['error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','update','destroy','MailAccounts','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','username','Imap','Smtp','index','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','model','query','keys','attributes','fields','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','params','MailServerIn','MailServerOut','Pause','intersection','length','include','find','body','custom','provider','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','rawAttributes','hasOwnProperty','rows','removeDispositions','CannedAnswer','getAnswers','nolimit','removeAnswers','ids','email','isNil','active','description','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','Owner','fullname','Tags','color','tag','sequelize','Transaction','bulkCreate','findAndCountAll','priority','finally','MailApplication','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','CmList','List','Contacts','updatedAt','DESC','CloudProvider','from','attachments','join','root','server/files/attachments','basename','SendMail','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','Messages','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','moment','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','jayson/promise','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x42453b,_0x2bb552){var _0x3116a7=function(_0x1b0be4){while(--_0x1b0be4){_0x42453b['push'](_0x42453b['shift']());}};_0x3116a7(++_0x2bb552);}(_0x5fc4,0xa9));var _0x45fc=function(_0x2c4fe0,_0x14b057){_0x2c4fe0=_0x2c4fe0-0x0;var _0x14c95e=_0x5fc4[_0x2c4fe0];return _0x14c95e;};'use strict';var moment=require(_0x45fc('0x0'));var BPromise=require('bluebird');var util=require(_0x45fc('0x1'));var path=require(_0x45fc('0x2'));var _=require(_0x45fc('0x3'));var juice=require(_0x45fc('0x4'));var Redis=require(_0x45fc('0x5'));var qs=require(_0x45fc('0x6'));var logger=require(_0x45fc('0x7'))(_0x45fc('0x8'));var config=require(_0x45fc('0x9'));var db=require(_0x45fc('0xa'))['db'];config[_0x45fc('0xb')]=_[_0x45fc('0xc')](config[_0x45fc('0xb')],{'host':_0x45fc('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x45fc('0xb')]));require(_0x45fc('0xe'))['register'](socket);var jayson=require(_0x45fc('0xf'));var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x239bd0,_0x3b8a81,_0x159135,_0x1ac0f2){return new BPromise(function(_0x4a9887,_0x131dcb){var _0x467669=_0x1ac0f2||client;return _0x467669[_0x45fc('0x10')](_0x239bd0,_0x159135)[_0x45fc('0x11')](function(_0x55ac43){logger[_0x45fc('0x12')]('MailAccount,\x20%s,\x20%s',_0x3b8a81,_0x45fc('0x13'));logger[_0x45fc('0x14')](_0x45fc('0x15'),_0x3b8a81,_0x45fc('0x13'),JSON[_0x45fc('0x16')](_0x55ac43));if(_0x55ac43[_0x45fc('0x17')]){if(_0x55ac43[_0x45fc('0x17')][_0x45fc('0x18')]===0x1f4){logger[_0x45fc('0x17')](_0x45fc('0x19'),_0x3b8a81,_0x55ac43[_0x45fc('0x17')][_0x45fc('0x1a')]);return _0x131dcb(_0x55ac43['error'][_0x45fc('0x1a')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x3b8a81,_0x55ac43[_0x45fc('0x17')][_0x45fc('0x1a')]);return _0x4a9887(_0x55ac43[_0x45fc('0x17')][_0x45fc('0x1a')]);}else{logger[_0x45fc('0x12')]('MailAccount,\x20%s,\x20%s',_0x3b8a81,_0x45fc('0x13'));_0x4a9887(_0x55ac43[_0x45fc('0x1b')]['message']);}})[_0x45fc('0x1c')](function(_0x3519bf){logger[_0x45fc('0x17')](_0x45fc('0x19'),_0x3b8a81,_0x3519bf);_0x131dcb(_0x3519bf);});});}function respondWithStatusCode(_0x4be641,_0x32a620){_0x32a620=_0x32a620||0xcc;return function(_0x4e8a08){if(_0x4e8a08){return _0x4be641[_0x45fc('0x1d')](_0x32a620);}return _0x4be641[_0x45fc('0x1e')](_0x32a620)[_0x45fc('0x1f')]();};}function respondWithResult(_0xacee66,_0x5a2edd){_0x5a2edd=_0x5a2edd||0xc8;return function(_0x6c1fc4){if(_0x6c1fc4){return _0xacee66[_0x45fc('0x1e')](_0x5a2edd)[_0x45fc('0x20')](_0x6c1fc4);}};}function respondWithFilteredResult(_0x3db4c7,_0x419d7e){return function(_0x3cd5ee){if(_0x3cd5ee){var _0x31215c=typeof _0x419d7e[_0x45fc('0x21')]===_0x45fc('0x22')&&typeof _0x419d7e['limit']==='undefined';var _0x58f17=_0x3cd5ee[_0x45fc('0x23')];var _0x55dc0d=_0x31215c?0x0:_0x419d7e[_0x45fc('0x21')];var _0x36eec1=_0x31215c?_0x3cd5ee[_0x45fc('0x23')]:_0x419d7e[_0x45fc('0x21')]+_0x419d7e[_0x45fc('0x24')];var _0x477f38;if(_0x36eec1>=_0x58f17){_0x36eec1=_0x58f17;_0x477f38=0xc8;}else{_0x477f38=0xce;}_0x3db4c7[_0x45fc('0x1e')](_0x477f38);return _0x3db4c7[_0x45fc('0x25')]('Content-Range',_0x55dc0d+'-'+_0x36eec1+'/'+_0x58f17)[_0x45fc('0x20')](_0x3cd5ee);}return null;};}function saveUpdates(_0x43754d){return function(_0x14a9db){if(_0x14a9db){return _0x14a9db[_0x45fc('0x26')](_0x43754d)[_0x45fc('0x11')](function(_0x460b01){return _0x460b01;});}return null;};}function removeEntity(_0x329f37){return function(_0x2ffbc0){if(_0x2ffbc0){return _0x2ffbc0[_0x45fc('0x27')]()[_0x45fc('0x11')](function(){var _0x3b37d6=_0x2ffbc0['get']({'plain':!![]});var _0x2080d4=_0x45fc('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x2080d4,'resourceId':_0x3b37d6['id']}})['then'](function(){return _0x2ffbc0;});})[_0x45fc('0x11')](function(){_0x329f37[_0x45fc('0x1e')](0xcc)[_0x45fc('0x1f')]();});}};}function handleEntityNotFound(_0x59313c){return function(_0x2722f9){if(!_0x2722f9){_0x59313c[_0x45fc('0x1d')](0x194);}return _0x2722f9;};}function handleError(_0x2567f0,_0x10df33){_0x10df33=_0x10df33||0x1f4;return function(_0x57d7d1){logger['error'](_0x57d7d1[_0x45fc('0x29')]);if(_0x57d7d1[_0x45fc('0x2a')]){delete _0x57d7d1[_0x45fc('0x2a')];}_0x2567f0[_0x45fc('0x1e')](_0x10df33)[_0x45fc('0x2b')](_0x57d7d1);};}function getImapHost(_0x182922){switch(_0x182922){case _0x45fc('0x2c'):return _0x45fc('0x2d');case _0x45fc('0x2e'):return _0x45fc('0x2f');case'hotmail':return _0x45fc('0x30');case _0x45fc('0x31'):return _0x45fc('0x32');}throw new Error(_0x45fc('0x33'),_0x182922);}function getSmtpHost(_0xf0666){switch(_0xf0666){case _0x45fc('0x2c'):return _0x45fc('0x34');case _0x45fc('0x2e'):return _0x45fc('0x35');case'hotmail':return _0x45fc('0x36');case _0x45fc('0x31'):return _0x45fc('0x37');}throw new Error(_0x45fc('0x33'),_0xf0666);}function getAuthenticationOptions(_0x20706a,_0x45f2c8){var _0x150f68={};var _0xf30634={};if(_0x20706a){_0x150f68[_0x45fc('0x38')]=_0xf30634[_0x45fc('0x38')]=_0x45f2c8['username'];_0x150f68[_0x45fc('0x39')]=_0xf30634['pass']=_0x45f2c8[_0x45fc('0x39')];if(_0x45f2c8[_0x45fc('0x3a')]){_0x150f68['modernAuthentication']=_0xf30634[_0x45fc('0x3a')]=!![];_0x150f68[_0x45fc('0x3b')]=_0xf30634[_0x45fc('0x3b')]=_0x45f2c8[_0x45fc('0x3b')];_0x150f68[_0x45fc('0x39')]=_0xf30634[_0x45fc('0x3c')]=null;}else{_0x150f68[_0x45fc('0x3b')]=_0xf30634['CloudProviderId']=null;}_0x150f68[_0x45fc('0x3d')]=getImapHost(_0x20706a);_0x150f68[_0x45fc('0x3e')]=0x3e1;_0xf30634[_0x45fc('0x3d')]=getSmtpHost(_0x20706a);_0xf30634['port']=0x24b;_0xf30634[_0x45fc('0x3f')]=![];_0x150f68[_0x45fc('0x40')]=_0xf30634[_0x45fc('0x40')]=null;}else{if(_0x45f2c8[_0x45fc('0x41')]){_0x150f68[_0x45fc('0x38')]=_0xf30634[_0x45fc('0x38')]=_0x45f2c8[_0x45fc('0x42')];_0x150f68[_0x45fc('0x39')]=_0xf30634['pass']=_0x45f2c8[_0x45fc('0x39')];}else{_0x150f68[_0x45fc('0x41')]=_0xf30634[_0x45fc('0x41')]=![];_0x150f68[_0x45fc('0x38')]=_0xf30634['user']=null;_0x150f68[_0x45fc('0x39')]=_0xf30634[_0x45fc('0x3c')]=null;}_0x150f68[_0x45fc('0x3d')]=_0x45f2c8[_0x45fc('0x43')]['host'];_0x150f68[_0x45fc('0x3e')]=_0x45f2c8[_0x45fc('0x43')][_0x45fc('0x3e')];_0xf30634[_0x45fc('0x3d')]=_0x45f2c8[_0x45fc('0x44')][_0x45fc('0x3d')];_0xf30634[_0x45fc('0x3e')]=_0x45f2c8['Smtp'][_0x45fc('0x3e')];}return{'Imap':_0x150f68,'Smtp':_0xf30634};}exports[_0x45fc('0x45')]=function(_0x52701a,_0x2c8857){var _0x2d238a={'include':[{'model':db['MailServerIn'],'as':_0x45fc('0x43')},{'model':db['MailServerOut'],'as':_0x45fc('0x44')},{'model':db['Pause'],'as':_0x45fc('0x46')}]},_0x31a41f={},_0x3ba78b={'count':0x0,'rows':[]};var _0xe06e64=_[_0x45fc('0x47')](db[_0x45fc('0x48')]['rawAttributes'],function(_0x73db0b){return{'name':_0x73db0b[_0x45fc('0x49')],'type':_0x73db0b[_0x45fc('0x4a')][_0x45fc('0x4b')]};});_0x31a41f[_0x45fc('0x4c')]=_[_0x45fc('0x47')](_0xe06e64,_0x45fc('0x2a'));_0x31a41f[_0x45fc('0x4d')]=_[_0x45fc('0x4e')](_0x52701a['query']);_0x31a41f['filters']=_['intersection'](_0x31a41f['model'],_0x31a41f[_0x45fc('0x4d')]);_0x2d238a[_0x45fc('0x4f')]=_['intersection'](_0x31a41f['model'],qs['fields'](_0x52701a[_0x45fc('0x4d')][_0x45fc('0x50')]));_0x2d238a[_0x45fc('0x4f')]=_0x2d238a[_0x45fc('0x4f')]['length']?_0x2d238a['attributes']:_0x31a41f[_0x45fc('0x4c')];if(!_0x52701a['query']['hasOwnProperty']('nolimit')){_0x2d238a['limit']=qs[_0x45fc('0x24')](_0x52701a[_0x45fc('0x4d')][_0x45fc('0x24')]);_0x2d238a[_0x45fc('0x21')]=qs['offset'](_0x52701a['query'][_0x45fc('0x21')]);}_0x2d238a[_0x45fc('0x51')]=qs[_0x45fc('0x52')](_0x52701a[_0x45fc('0x4d')]['sort']);_0x2d238a[_0x45fc('0x53')]=qs[_0x45fc('0x54')](_[_0x45fc('0x55')](_0x52701a['query'],_0x31a41f[_0x45fc('0x54')]),_0xe06e64);if(_0x52701a[_0x45fc('0x4d')][_0x45fc('0x56')]){_0x2d238a[_0x45fc('0x53')]=_[_0x45fc('0x57')](_0x2d238a[_0x45fc('0x53')],{'$or':_[_0x45fc('0x47')](_0xe06e64,function(_0x7c301b){if(_0x7c301b[_0x45fc('0x4a')]!==_0x45fc('0x58')){var _0x5ef8ab={};_0x5ef8ab[_0x7c301b[_0x45fc('0x2a')]]={'$like':'%'+_0x52701a['query'][_0x45fc('0x56')]+'%'};return _0x5ef8ab;}})});}_0x2d238a=_[_0x45fc('0x57')]({},_0x2d238a,_0x52701a[_0x45fc('0x59')]);var _0x4375d4={'where':_0x2d238a[_0x45fc('0x53')]};return db[_0x45fc('0x48')][_0x45fc('0x23')](_0x4375d4)[_0x45fc('0x11')](function(_0x4b91de){_0x3ba78b[_0x45fc('0x23')]=_0x4b91de;if(_0x52701a[_0x45fc('0x4d')][_0x45fc('0x5a')]){_0x2d238a['include']=[{'all':!![]}];}return db['MailAccount'][_0x45fc('0x5b')](_0x2d238a);})[_0x45fc('0x11')](function(_0x28815d){_0x3ba78b['rows']=_0x28815d;return _0x3ba78b;})['then'](respondWithFilteredResult(_0x2c8857,_0x2d238a))[_0x45fc('0x1c')](handleError(_0x2c8857,null));};exports['show']=function(_0x459c09,_0x19d5f8){var _0x278dc5={'raw':![],'where':{'id':_0x459c09[_0x45fc('0x5c')]['id']},'include':[{'model':db[_0x45fc('0x5d')],'as':_0x45fc('0x43')},{'model':db[_0x45fc('0x5e')],'as':_0x45fc('0x44')},{'model':db[_0x45fc('0x5f')],'as':_0x45fc('0x46')}]},_0x25643b={};_0x25643b[_0x45fc('0x4c')]=_[_0x45fc('0x4e')](db[_0x45fc('0x48')]['rawAttributes']);_0x25643b[_0x45fc('0x4d')]=_[_0x45fc('0x4e')](_0x459c09['query']);_0x25643b[_0x45fc('0x54')]=_[_0x45fc('0x60')](_0x25643b[_0x45fc('0x4c')],_0x25643b[_0x45fc('0x4d')]);_0x278dc5[_0x45fc('0x4f')]=_[_0x45fc('0x60')](_0x25643b['model'],qs[_0x45fc('0x50')](_0x459c09['query'][_0x45fc('0x50')]));_0x278dc5[_0x45fc('0x4f')]=_0x278dc5[_0x45fc('0x4f')][_0x45fc('0x61')]?_0x278dc5[_0x45fc('0x4f')]:_0x25643b[_0x45fc('0x4c')];if(_0x459c09[_0x45fc('0x4d')][_0x45fc('0x5a')]){_0x278dc5[_0x45fc('0x62')]=[{'all':!![]}];}_0x278dc5=_[_0x45fc('0x57')]({},_0x278dc5,_0x459c09[_0x45fc('0x59')]);return db[_0x45fc('0x48')][_0x45fc('0x63')](_0x278dc5)[_0x45fc('0x11')](handleEntityNotFound(_0x19d5f8,null))[_0x45fc('0x11')](respondWithResult(_0x19d5f8,null))[_0x45fc('0x1c')](handleError(_0x19d5f8,null));};exports['update']=function(_0x14a30b,_0x4a8ddd){if(_0x14a30b[_0x45fc('0x64')]['id']){delete _0x14a30b['body']['id'];}var _0x12d224=_0x14a30b[_0x45fc('0x64')]['provider']===_0x45fc('0x65')?null:_0x14a30b['body'][_0x45fc('0x66')];var _0x55f5c2=_0x14a30b[_0x45fc('0x64')][_0x45fc('0x43')]||{};var _0x17ecfa=_0x14a30b[_0x45fc('0x64')][_0x45fc('0x44')]||{};if(_0x12d224){_0x55f5c2[_0x45fc('0x3d')]=getImapHost(_0x12d224);_0x55f5c2['port']=0x3e1;_0x17ecfa[_0x45fc('0x3d')]=getSmtpHost(_0x12d224);_0x17ecfa['port']=0x24b;_0x17ecfa['secure']=![];}if(_0x17ecfa[_0x45fc('0x3a')]){_0x17ecfa['secure']=![];}else{_0x17ecfa[_0x45fc('0x3b')]=null;}if(!_0x55f5c2['modernAuthentication'])_0x55f5c2['CloudProviderId']=null;_0x14a30b[_0x45fc('0x64')]['Imap']=_0x55f5c2;_0x14a30b['body'][_0x45fc('0x44')]=_0x17ecfa;return db[_0x45fc('0x48')][_0x45fc('0x63')]({'where':{'id':_0x14a30b['params']['id']},'include':[{'model':db[_0x45fc('0x5d')],'as':_0x45fc('0x43')},{'model':db[_0x45fc('0x5e')],'as':_0x45fc('0x44')},{'model':db[_0x45fc('0x5f')],'as':_0x45fc('0x46')}]})[_0x45fc('0x11')](handleEntityNotFound(_0x4a8ddd,null))[_0x45fc('0x11')](function(_0x1d3f3a){if(!_0x1d3f3a)throw new Error(_0x45fc('0x67'));if(_0x1d3f3a[_0x45fc('0x40')])delete _0x14a30b[_0x45fc('0x64')][_0x45fc('0x43')];return _0x1d3f3a;})[_0x45fc('0x11')](saveUpdates(_0x14a30b[_0x45fc('0x64')],null))['then'](function(_0x2477c6){if(!_0x14a30b[_0x45fc('0x64')][_0x45fc('0x43')])return _0x2477c6;return db[_0x45fc('0x5d')][_0x45fc('0x26')](_0x14a30b['body']['Imap'],{'where':{'MailAccountId':_0x2477c6['id']}})['then'](function(){return _0x2477c6;});})['then'](function(_0x3a4a4c){if(!_0x14a30b[_0x45fc('0x64')][_0x45fc('0x44')])return _0x3a4a4c;return db[_0x45fc('0x5e')][_0x45fc('0x26')](_0x14a30b[_0x45fc('0x64')][_0x45fc('0x44')],{'where':{'MailAccountId':_0x3a4a4c['id']}})[_0x45fc('0x11')](function(){return _0x3a4a4c;});})[_0x45fc('0x11')](respondWithResult(_0x4a8ddd,null))['catch'](handleError(_0x4a8ddd,null));};exports[_0x45fc('0x68')]=function(_0x37ea7d,_0x34dcd7){return db[_0x45fc('0x48')]['describe']()[_0x45fc('0x11')](respondWithResult(_0x34dcd7,null))[_0x45fc('0x1c')](handleError(_0x34dcd7,null));};exports[_0x45fc('0x69')]=function(_0x9d7d31,_0xf76cee){if(_0x9d7d31[_0x45fc('0x64')]['id']){delete _0x9d7d31[_0x45fc('0x64')]['id'];}return db[_0x45fc('0x48')][_0x45fc('0x63')]({'where':{'id':_0x9d7d31[_0x45fc('0x5c')]['id']}})[_0x45fc('0x11')](handleEntityNotFound(_0xf76cee,null))[_0x45fc('0x11')](function(_0x22ab42){if(_0x22ab42){_0x9d7d31['body'][_0x45fc('0x6a')]=_0x22ab42['id'];return db[_0x45fc('0x6b')][_0x45fc('0x6c')](_0x9d7d31[_0x45fc('0x64')]);}})[_0x45fc('0x11')](respondWithResult(_0xf76cee,null))[_0x45fc('0x1c')](handleError(_0xf76cee,null));};exports[_0x45fc('0x6d')]=function(_0x309341,_0x28e265){var _0x366034={'raw':![],'where':{}};var _0x4afb16={};var _0x58a1ff={'count':0x0,'rows':[]};return db[_0x45fc('0x48')][_0x45fc('0x6e')]({'where':{'id':_0x309341['params']['id']}})['then'](handleEntityNotFound(_0x28e265,null))['then'](function(_0x121488){if(_0x121488){_0x4afb16[_0x45fc('0x4c')]=_[_0x45fc('0x4e')](db[_0x45fc('0x6b')][_0x45fc('0x6f')]);_0x4afb16[_0x45fc('0x4d')]=_[_0x45fc('0x4e')](_0x309341['query']);_0x4afb16[_0x45fc('0x54')]=_['intersection'](_0x4afb16[_0x45fc('0x4c')],_0x4afb16[_0x45fc('0x4d')]);_0x366034[_0x45fc('0x4f')]=_['intersection'](_0x4afb16[_0x45fc('0x4c')],qs[_0x45fc('0x50')](_0x309341[_0x45fc('0x4d')][_0x45fc('0x50')]));_0x366034['attributes']=_0x366034[_0x45fc('0x4f')]['length']?_0x366034[_0x45fc('0x4f')]:_0x4afb16[_0x45fc('0x4c')];if(!_0x309341[_0x45fc('0x4d')][_0x45fc('0x70')]('nolimit')){_0x366034['limit']=qs[_0x45fc('0x24')](_0x309341[_0x45fc('0x4d')][_0x45fc('0x24')]);_0x366034[_0x45fc('0x21')]=qs[_0x45fc('0x21')](_0x309341[_0x45fc('0x4d')][_0x45fc('0x21')]);}_0x366034[_0x45fc('0x51')]=qs[_0x45fc('0x52')](_0x309341['query'][_0x45fc('0x52')]);_0x366034[_0x45fc('0x53')]=qs[_0x45fc('0x54')](_['pick'](_0x309341[_0x45fc('0x4d')],_0x4afb16[_0x45fc('0x54')]));_0x366034[_0x45fc('0x53')][_0x45fc('0x6a')]=_0x121488['id'];if(_0x309341[_0x45fc('0x4d')][_0x45fc('0x56')]){_0x366034[_0x45fc('0x53')]=_[_0x45fc('0x57')](_0x366034[_0x45fc('0x53')],{'$or':_[_0x45fc('0x47')](_0x366034[_0x45fc('0x4f')],function(_0x3cb0ec){var _0x30a843={};_0x30a843[_0x3cb0ec]={'$like':'%'+_0x309341[_0x45fc('0x4d')][_0x45fc('0x56')]+'%'};return _0x30a843;})});}_0x366034=_[_0x45fc('0x57')]({},_0x366034,_0x309341[_0x45fc('0x59')]);return db[_0x45fc('0x6b')]['count']({'where':_0x366034['where']})[_0x45fc('0x11')](function(_0x524796){_0x58a1ff[_0x45fc('0x23')]=_0x524796;if(_0x309341[_0x45fc('0x4d')][_0x45fc('0x5a')]){_0x366034[_0x45fc('0x62')]=[{'all':!![]}];}return db[_0x45fc('0x6b')][_0x45fc('0x5b')](_0x366034);})[_0x45fc('0x11')](function(_0x20df29){_0x58a1ff[_0x45fc('0x71')]=_0x20df29;return _0x58a1ff;});}})[_0x45fc('0x11')](respondWithFilteredResult(_0x28e265,_0x366034))[_0x45fc('0x1c')](handleError(_0x28e265,null));};exports[_0x45fc('0x72')]=function(_0x5e5e6e,_0x3052dd){return db[_0x45fc('0x48')][_0x45fc('0x63')]({'where':{'id':_0x5e5e6e[_0x45fc('0x5c')]['id']}})[_0x45fc('0x11')](handleEntityNotFound(_0x3052dd,null))[_0x45fc('0x11')](function(_0x503635){if(_0x503635){return _0x503635[_0x45fc('0x72')](_0x5e5e6e['query']['ids']);}})[_0x45fc('0x11')](respondWithStatusCode(_0x3052dd,null))[_0x45fc('0x1c')](handleError(_0x3052dd,null));};exports['addAnswer']=function(_0x25933e,_0xefc637){if(_0x25933e['body']['id']){delete _0x25933e[_0x45fc('0x64')]['id'];}return db[_0x45fc('0x48')][_0x45fc('0x63')]({'where':{'id':_0x25933e[_0x45fc('0x5c')]['id']}})[_0x45fc('0x11')](handleEntityNotFound(_0xefc637,null))['then'](function(_0x5a8bf0){if(_0x5a8bf0){_0x25933e[_0x45fc('0x64')][_0x45fc('0x6a')]=_0x5a8bf0['id'];return db[_0x45fc('0x73')][_0x45fc('0x6c')](_0x25933e[_0x45fc('0x64')]);}})[_0x45fc('0x11')](respondWithResult(_0xefc637,null))['catch'](handleError(_0xefc637,null));};exports[_0x45fc('0x74')]=function(_0x5a76f6,_0x39e463){var _0x198bc7={'raw':![],'where':{}};var _0x5be793={};var _0x1fed9d={'count':0x0,'rows':[]};return db[_0x45fc('0x48')][_0x45fc('0x6e')]({'where':{'id':_0x5a76f6[_0x45fc('0x5c')]['id']}})[_0x45fc('0x11')](handleEntityNotFound(_0x39e463,null))[_0x45fc('0x11')](function(_0x20e4ba){if(_0x20e4ba){_0x5be793[_0x45fc('0x4c')]=_[_0x45fc('0x4e')](db[_0x45fc('0x73')][_0x45fc('0x6f')]);_0x5be793[_0x45fc('0x4d')]=_[_0x45fc('0x4e')](_0x5a76f6[_0x45fc('0x4d')]);_0x5be793['filters']=_['intersection'](_0x5be793[_0x45fc('0x4c')],_0x5be793[_0x45fc('0x4d')]);_0x198bc7[_0x45fc('0x4f')]=_[_0x45fc('0x60')](_0x5be793['model'],qs[_0x45fc('0x50')](_0x5a76f6[_0x45fc('0x4d')][_0x45fc('0x50')]));_0x198bc7[_0x45fc('0x4f')]=_0x198bc7[_0x45fc('0x4f')][_0x45fc('0x61')]?_0x198bc7[_0x45fc('0x4f')]:_0x5be793[_0x45fc('0x4c')];if(!_0x5a76f6[_0x45fc('0x4d')][_0x45fc('0x70')](_0x45fc('0x75'))){_0x198bc7[_0x45fc('0x24')]=qs[_0x45fc('0x24')](_0x5a76f6[_0x45fc('0x4d')][_0x45fc('0x24')]);_0x198bc7[_0x45fc('0x21')]=qs[_0x45fc('0x21')](_0x5a76f6['query'][_0x45fc('0x21')]);}_0x198bc7[_0x45fc('0x51')]=qs['sort'](_0x5a76f6[_0x45fc('0x4d')][_0x45fc('0x52')]);_0x198bc7[_0x45fc('0x53')]=qs[_0x45fc('0x54')](_[_0x45fc('0x55')](_0x5a76f6[_0x45fc('0x4d')],_0x5be793[_0x45fc('0x54')]));_0x198bc7[_0x45fc('0x53')][_0x45fc('0x6a')]=_0x20e4ba['id'];if(_0x5a76f6['query'][_0x45fc('0x56')]){_0x198bc7[_0x45fc('0x53')]=_[_0x45fc('0x57')](_0x198bc7['where'],{'$or':_[_0x45fc('0x47')](_0x198bc7[_0x45fc('0x4f')],function(_0xa49a97){var _0x1e9866={};_0x1e9866[_0xa49a97]={'$like':'%'+_0x5a76f6[_0x45fc('0x4d')]['filter']+'%'};return _0x1e9866;})});}_0x198bc7=_[_0x45fc('0x57')]({},_0x198bc7,_0x5a76f6['options']);return db['CannedAnswer'][_0x45fc('0x23')]({'where':_0x198bc7['where']})[_0x45fc('0x11')](function(_0x42ec19){_0x1fed9d[_0x45fc('0x23')]=_0x42ec19;if(_0x5a76f6[_0x45fc('0x4d')][_0x45fc('0x5a')]){_0x198bc7[_0x45fc('0x62')]=[{'all':!![]}];}return db[_0x45fc('0x73')][_0x45fc('0x5b')](_0x198bc7);})['then'](function(_0x607b5d){_0x1fed9d[_0x45fc('0x71')]=_0x607b5d;return _0x1fed9d;});}})['then'](respondWithFilteredResult(_0x39e463,_0x198bc7))[_0x45fc('0x1c')](handleError(_0x39e463,null));};exports[_0x45fc('0x76')]=function(_0x5be35b,_0x3a82ce){return db[_0x45fc('0x48')][_0x45fc('0x63')]({'where':{'id':_0x5be35b[_0x45fc('0x5c')]['id']}})[_0x45fc('0x11')](handleEntityNotFound(_0x3a82ce,null))[_0x45fc('0x11')](function(_0x434f60){if(_0x434f60){return _0x434f60[_0x45fc('0x76')](_0x5be35b[_0x45fc('0x4d')][_0x45fc('0x77')]);}})[_0x45fc('0x11')](respondWithStatusCode(_0x3a82ce,null))[_0x45fc('0x1c')](handleError(_0x3a82ce,null));};exports[_0x45fc('0x6c')]=function(_0x23b0e6,_0x7e3095){var _0x2311fa={'name':_0x23b0e6['body'][_0x45fc('0x2a')],'key':_0x23b0e6[_0x45fc('0x64')][_0x45fc('0x4b')],'provider':_0x23b0e6[_0x45fc('0x64')][_0x45fc('0x66')]===_0x45fc('0x65')?null:_0x23b0e6[_0x45fc('0x64')][_0x45fc('0x66')],'email':_0x23b0e6[_0x45fc('0x64')][_0x45fc('0x78')],'ListId':_0x23b0e6['body']['ListId'],'active':!_[_0x45fc('0x79')](_0x23b0e6[_0x45fc('0x64')][_0x45fc('0x7a')])?_0x23b0e6[_0x45fc('0x64')][_0x45fc('0x7a')]:!![],'description':_0x23b0e6[_0x45fc('0x64')][_0x45fc('0x7b')]||null};var _0x55568a=getAuthenticationOptions(_0x2311fa[_0x45fc('0x66')],_0x23b0e6['body']);_0x2311fa['Imap']=_0x55568a[_0x45fc('0x43')];_0x2311fa[_0x45fc('0x44')]=_0x55568a[_0x45fc('0x44')];return db[_0x45fc('0x48')][_0x45fc('0x6c')](_0x2311fa,{'include':[{'model':db[_0x45fc('0x5e')],'as':_0x45fc('0x44')},{'model':db[_0x45fc('0x5d')],'as':'Imap'}]})[_0x45fc('0x11')](function(_0x56bb36){var _0x22d8fc=_0x23b0e6[_0x45fc('0x38')][_0x45fc('0x7c')]({'plain':!![]});if(!_0x22d8fc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22d8fc['role']===_0x45fc('0x38')){var _0x596530=_0x56bb36[_0x45fc('0x7c')]({'plain':!![]});return db[_0x45fc('0x7d')][_0x45fc('0x63')]({'where':{'name':_0x45fc('0x28'),'userProfileId':_0x22d8fc[_0x45fc('0x7e')]},'raw':!![]})[_0x45fc('0x11')](function(_0x283cd3){if(_0x283cd3&&_0x283cd3[_0x45fc('0x7f')]===0x0){return db['UserProfileResource']['create']({'name':_0x596530['name'],'resourceId':_0x596530['id'],'type':_0x283cd3[_0x45fc('0x2a')],'sectionId':_0x283cd3['id']},{})[_0x45fc('0x11')](function(){return _0x56bb36;});}else{return _0x56bb36;}})[_0x45fc('0x1c')](function(_0x42ded9){logger[_0x45fc('0x17')](_0x45fc('0x80'),_0x42ded9);throw _0x42ded9;});}return _0x56bb36;})['then'](respondWithResult(_0x7e3095,0xc9))['catch'](handleError(_0x7e3095,null));};exports[_0x45fc('0x81')]=function(_0x17b0fc,_0x539cfb){return db[_0x45fc('0x48')][_0x45fc('0x6e')]({'where':{'id':_0x17b0fc[_0x45fc('0x5c')]['id']}})[_0x45fc('0x11')](handleEntityNotFound(_0x539cfb,null))[_0x45fc('0x11')](function(_0x3156db){if(_0x3156db){return _0x3156db[_0x45fc('0x81')]();}return null;})[_0x45fc('0x11')](respondWithResult(_0x539cfb,null))[_0x45fc('0x1c')](handleError(_0x539cfb,null));};exports[_0x45fc('0x82')]=function(_0x3bcde7,_0x20102e){if(_0x3bcde7[_0x45fc('0x64')]['id']){delete _0x3bcde7[_0x45fc('0x64')]['id'];}return db[_0x45fc('0x48')]['find']({'where':{'id':_0x3bcde7[_0x45fc('0x5c')]['id']}})[_0x45fc('0x11')](handleEntityNotFound(_0x20102e,null))[_0x45fc('0x11')](function(_0x87e009){if(_0x87e009){_0x3bcde7[_0x45fc('0x64')]['MailAccountId']=_0x87e009['id'];return db[_0x45fc('0x5d')][_0x45fc('0x6c')](_0x3bcde7['body']);}})['then'](respondWithResult(_0x20102e,null))[_0x45fc('0x1c')](handleError(_0x20102e,null));};exports[_0x45fc('0x83')]=function(_0x21271d,_0x5462b1){return db[_0x45fc('0x48')][_0x45fc('0x6e')]({'where':{'id':_0x21271d[_0x45fc('0x5c')]['id']}})[_0x45fc('0x11')](handleEntityNotFound(_0x5462b1,null))['then'](function(_0x23197d){if(_0x23197d){return _0x23197d['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x5462b1,null))['catch'](handleError(_0x5462b1,null));};exports[_0x45fc('0x84')]=function(_0x3f9962,_0x4293c0){return db[_0x45fc('0x48')][_0x45fc('0x6e')]({'where':{'id':_0x3f9962['params']['id']}})['then'](handleEntityNotFound(_0x4293c0,null))['then'](function(_0x375463){if(_0x375463){return _0x375463['getSmtp']();}return null;})[_0x45fc('0x11')](respondWithResult(_0x4293c0,null))['catch'](handleError(_0x4293c0,null));};exports[_0x45fc('0x85')]=function(_0x554286,_0x18d458){if(_0x554286[_0x45fc('0x64')]['id']){delete _0x554286[_0x45fc('0x64')]['id'];}return db['MailAccount'][_0x45fc('0x63')]({'where':{'id':_0x554286[_0x45fc('0x5c')]['id']}})[_0x45fc('0x11')](handleEntityNotFound(_0x18d458,null))[_0x45fc('0x11')](function(_0x25b838){if(_0x25b838){_0x554286[_0x45fc('0x64')]['MailAccountId']=_0x25b838['id'];return db[_0x45fc('0x5e')][_0x45fc('0x6c')](_0x554286[_0x45fc('0x64')]);}})['then'](respondWithResult(_0x18d458,null))[_0x45fc('0x1c')](handleError(_0x18d458,null));};exports['removeSmtp']=function(_0x41882b,_0xb31b37){return db[_0x45fc('0x48')][_0x45fc('0x6e')]({'where':{'id':_0x41882b['params']['id']}})[_0x45fc('0x11')](handleEntityNotFound(_0xb31b37,null))[_0x45fc('0x11')](function(_0x3f7e45){if(_0x3f7e45){return _0x3f7e45[_0x45fc('0x86')](null);}return null;})[_0x45fc('0x11')](respondWithStatusCode(_0xb31b37,null))[_0x45fc('0x1c')](handleError(_0xb31b37,null));};exports['addInteraction']=function(_0x4ddb69,_0x54841a){return db[_0x45fc('0x87')][_0x45fc('0x63')]({'where':{'id':_0x4ddb69[_0x45fc('0x5c')]['id']}})[_0x45fc('0x11')](handleEntityNotFound(_0x54841a,null))[_0x45fc('0x11')](function(_0x302a5e){if(_0x302a5e){return _0x302a5e[_0x45fc('0x88')](_0x4ddb69[_0x45fc('0x64')][_0x45fc('0x77')],_[_0x45fc('0x89')](_0x4ddb69['body'],[_0x45fc('0x77'),'id'])||{});}})['then'](respondWithResult(_0x54841a,null))[_0x45fc('0x1c')](handleError(_0x54841a,null));};exports[_0x45fc('0x8a')]=function(_0x1abf81,_0x239249){var _0x418552={'raw':![],'where':{}};var _0x3c4330={};var _0x2cc206={'count':0x0,'rows':[]};return db[_0x45fc('0x48')][_0x45fc('0x6e')]({'where':{'id':_0x1abf81[_0x45fc('0x5c')]['id']}})['then'](handleEntityNotFound(_0x239249,null))[_0x45fc('0x11')](function(_0x25d44b){if(_0x25d44b){_0x3c4330[_0x45fc('0x4c')]=_[_0x45fc('0x4e')](db[_0x45fc('0x87')][_0x45fc('0x6f')]);_0x3c4330['query']=_[_0x45fc('0x4e')](_0x1abf81['query']);_0x3c4330[_0x45fc('0x54')]=_[_0x45fc('0x60')](_0x3c4330[_0x45fc('0x4c')],_0x3c4330['query']);_0x418552[_0x45fc('0x4f')]=_[_0x45fc('0x60')](_0x3c4330[_0x45fc('0x4c')],qs[_0x45fc('0x50')](_0x1abf81['query'][_0x45fc('0x50')]));_0x418552[_0x45fc('0x4f')]=_0x418552[_0x45fc('0x4f')][_0x45fc('0x61')]?_0x418552[_0x45fc('0x4f')]:_0x3c4330['model'];if(!_0x1abf81[_0x45fc('0x4d')]['hasOwnProperty'](_0x45fc('0x75'))){_0x418552[_0x45fc('0x24')]=qs['limit'](_0x1abf81[_0x45fc('0x4d')][_0x45fc('0x24')]);_0x418552[_0x45fc('0x21')]=qs['offset'](_0x1abf81[_0x45fc('0x4d')][_0x45fc('0x21')]);}_0x418552[_0x45fc('0x51')]=qs[_0x45fc('0x52')](_0x1abf81[_0x45fc('0x4d')][_0x45fc('0x52')]);_0x418552[_0x45fc('0x53')]=qs[_0x45fc('0x54')](_[_0x45fc('0x55')](_0x1abf81[_0x45fc('0x4d')],_0x3c4330[_0x45fc('0x54')]));_0x418552[_0x45fc('0x53')][_0x45fc('0x6a')]=_0x25d44b['id'];if(_0x1abf81['query'][_0x45fc('0x56')]){_0x418552[_0x45fc('0x53')]=_[_0x45fc('0x57')](_0x418552[_0x45fc('0x53')],{'$or':_[_0x45fc('0x47')](_0x418552[_0x45fc('0x4f')],function(_0x19bfa6){var _0x11d612={};_0x11d612[_0x19bfa6]={'$like':'%'+_0x1abf81[_0x45fc('0x4d')][_0x45fc('0x56')]+'%'};return _0x11d612;})});}_0x418552=_['merge']({},_0x418552,_0x1abf81[_0x45fc('0x59')]);return db[_0x45fc('0x87')]['count']({'where':_0x418552[_0x45fc('0x53')]})['then'](function(_0x525f0e){_0x2cc206[_0x45fc('0x23')]=_0x525f0e;if(_0x1abf81[_0x45fc('0x4d')]['includeAll']){_0x418552[_0x45fc('0x62')]=[{'model':db[_0x45fc('0x8b')],'as':_0x45fc('0x8c'),'required':![]},{'model':db['User'],'as':_0x45fc('0x8d'),'attributes':[_0x45fc('0x2a'),_0x45fc('0x8e'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x45fc('0x8f'),'attributes':['id','name',_0x45fc('0x90')],'where':_0x1abf81['query'][_0x45fc('0x91')]?{'id':_0x1abf81['query'][_0x45fc('0x91')]}:undefined,'required':_0x1abf81[_0x45fc('0x4d')][_0x45fc('0x91')]?!![]:![]}];}return db['MailInteraction'][_0x45fc('0x5b')](_0x418552);})[_0x45fc('0x11')](function(_0x58cc2e){_0x2cc206[_0x45fc('0x71')]=_0x58cc2e;return _0x2cc206;});}})[_0x45fc('0x11')](respondWithFilteredResult(_0x239249,_0x418552))['catch'](handleError(_0x239249,null));};exports['addApplications']=function addApplications(_0x1a029e,_0x1e4e2e){var _0x449fef=_0x1a029e[_0x45fc('0x5c')]['id'];var _0x1d06f3=_0x1a029e[_0x45fc('0x64')];var _0x35521d=0xc8;var _0x37cb55=null;return db[_0x45fc('0x92')]['transaction']({'isolationLevel':db[_0x45fc('0x92')][_0x45fc('0x93')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x1cc9b1){return db[_0x45fc('0x48')]['findOne']({'where':{'id':_0x449fef},'transaction':_0x1cc9b1})[_0x45fc('0x11')](function(_0x478b58){if(_0x478b58){return db['MailApplication'][_0x45fc('0x27')]({'where':{'MailAccountId':_0x449fef},'transaction':_0x1cc9b1})[_0x45fc('0x11')](function(){var _0x49bf9f=_[_0x45fc('0x47')](_0x1d06f3,function(_0x32cb14){_0x32cb14[_0x45fc('0x6a')]=_0x449fef;return _0x32cb14;});return db['MailApplication'][_0x45fc('0x94')](_0x49bf9f,{'transaction':_0x1cc9b1});});}else{_0x35521d=0x194;_0x37cb55=[];}});})['then'](function(){if(_0x35521d!==0x194){return db['MailApplication'][_0x45fc('0x95')]({'where':{'MailAccountId':_0x449fef},'order':_0x45fc('0x96')})[_0x45fc('0x11')](function(_0x2745d1){_0x37cb55=_0x2745d1;});}})[_0x45fc('0x1c')](function(_0xc0c194){_0x35521d=0x1f4;logger[_0x45fc('0x17')](_0xc0c194[_0x45fc('0x29')]);if(_0xc0c194[_0x45fc('0x2a')]){delete _0xc0c194[_0x45fc('0x2a')];}_0x37cb55=_0xc0c194;})[_0x45fc('0x97')](function(){if(_0x37cb55===null){_0x1e4e2e['sendStatus'](_0x35521d);}else{if(_0x35521d===0x1f4){_0x1e4e2e[_0x45fc('0x1e')](_0x35521d)[_0x45fc('0x2b')](_0x37cb55);}else{_0x1e4e2e['status'](_0x35521d)[_0x45fc('0x20')](_0x37cb55);}}});};exports['getApplications']=function(_0x7f1293,_0x314ff5){var _0x36b402={};var _0x49fcd8={};var _0x4bbb92;var _0x5286f9;return db[_0x45fc('0x48')][_0x45fc('0x6e')]({'where':{'id':_0x7f1293['params']['id']}})['then'](handleEntityNotFound(_0x314ff5,null))[_0x45fc('0x11')](function(_0x41edbd){if(_0x41edbd){_0x4bbb92=_0x41edbd;_0x49fcd8[_0x45fc('0x4c')]=_[_0x45fc('0x4e')](db[_0x45fc('0x98')][_0x45fc('0x6f')]);_0x49fcd8[_0x45fc('0x4d')]=_[_0x45fc('0x4e')](_0x7f1293['query']);_0x49fcd8['filters']=_[_0x45fc('0x60')](_0x49fcd8[_0x45fc('0x4c')],_0x49fcd8[_0x45fc('0x4d')]);_0x36b402[_0x45fc('0x4f')]=_[_0x45fc('0x60')](_0x49fcd8[_0x45fc('0x4c')],qs[_0x45fc('0x50')](_0x7f1293['query']['fields']));_0x36b402['attributes']=_0x36b402[_0x45fc('0x4f')]['length']?_0x36b402[_0x45fc('0x4f')]:_0x49fcd8[_0x45fc('0x4c')];_0x36b402['order']=qs['sort'](_0x7f1293['query'][_0x45fc('0x52')]);_0x36b402[_0x45fc('0x53')]=qs[_0x45fc('0x54')](_[_0x45fc('0x55')](_0x7f1293[_0x45fc('0x4d')],_0x49fcd8['filters']));if(_0x7f1293[_0x45fc('0x4d')][_0x45fc('0x56')]){_0x36b402[_0x45fc('0x53')]=_[_0x45fc('0x57')](_0x36b402[_0x45fc('0x53')],{'$or':_[_0x45fc('0x47')](_0x36b402[_0x45fc('0x4f')],function(_0x2ff74f){var _0x562dc3={};_0x562dc3[_0x2ff74f]={'$like':'%'+_0x7f1293[_0x45fc('0x4d')][_0x45fc('0x56')]+'%'};return _0x562dc3;})});}_0x36b402=_[_0x45fc('0x57')]({},_0x36b402,_0x7f1293[_0x45fc('0x59')]);return _0x4bbb92[_0x45fc('0x99')](_0x36b402);}})[_0x45fc('0x11')](function(_0x298c73){if(_0x298c73){_0x5286f9=_0x298c73[_0x45fc('0x61')];if(!_0x7f1293[_0x45fc('0x4d')][_0x45fc('0x70')]('nolimit')){_0x36b402['limit']=qs['limit'](_0x7f1293[_0x45fc('0x4d')][_0x45fc('0x24')]);_0x36b402[_0x45fc('0x21')]=qs[_0x45fc('0x21')](_0x7f1293[_0x45fc('0x4d')][_0x45fc('0x21')]);}return _0x4bbb92['getApplications'](_0x36b402);}})[_0x45fc('0x11')](function(_0x357f1c){if(_0x357f1c){return _0x357f1c?{'count':_0x5286f9,'rows':_0x357f1c}:null;}})['then'](respondWithResult(_0x314ff5,null))[_0x45fc('0x1c')](handleError(_0x314ff5,null));};exports[_0x45fc('0x9a')]=function(_0x484fa5,_0x4c8b96){var _0x4a9eed={'raw':!![],'where':{}};var _0x222b44={};var _0x22d803={'count':0x0,'rows':[]};return db[_0x45fc('0x48')][_0x45fc('0x6e')]({'where':{'id':_0x484fa5[_0x45fc('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4c8b96,null))[_0x45fc('0x11')](function(_0x16ad63){if(_0x16ad63){_0x222b44[_0x45fc('0x4c')]=_[_0x45fc('0x4e')](db['MailMessage']['rawAttributes']);_0x222b44[_0x45fc('0x4d')]=_[_0x45fc('0x4e')](_0x484fa5['query']);_0x222b44['filters']=_['intersection'](_0x222b44['model'],_0x222b44[_0x45fc('0x4d')]);_0x4a9eed[_0x45fc('0x4f')]=_[_0x45fc('0x60')](_0x222b44[_0x45fc('0x4c')],qs['fields'](_0x484fa5[_0x45fc('0x4d')][_0x45fc('0x50')]));_0x4a9eed['attributes']=_0x4a9eed[_0x45fc('0x4f')][_0x45fc('0x61')]?_0x4a9eed[_0x45fc('0x4f')]:_0x222b44[_0x45fc('0x4c')];if(!_0x484fa5['query'][_0x45fc('0x70')]('nolimit')){_0x4a9eed[_0x45fc('0x24')]=qs['limit'](_0x484fa5[_0x45fc('0x4d')]['limit']);_0x4a9eed['offset']=qs['offset'](_0x484fa5[_0x45fc('0x4d')][_0x45fc('0x21')]);}_0x4a9eed[_0x45fc('0x51')]=qs[_0x45fc('0x52')](_0x484fa5['query'][_0x45fc('0x52')]);_0x4a9eed['where']=qs[_0x45fc('0x54')](_['pick'](_0x484fa5[_0x45fc('0x4d')],_0x222b44[_0x45fc('0x54')]));_0x4a9eed[_0x45fc('0x53')]['MailAccountId']=_0x16ad63['id'];if(_0x484fa5[_0x45fc('0x4d')][_0x45fc('0x56')]){_0x4a9eed[_0x45fc('0x53')]=_[_0x45fc('0x57')](_0x4a9eed[_0x45fc('0x53')],{'$or':_[_0x45fc('0x47')](_0x4a9eed[_0x45fc('0x4f')],function(_0x4c214c){var _0x30b8ba={};_0x30b8ba[_0x4c214c]={'$like':'%'+_0x484fa5['query']['filter']+'%'};return _0x30b8ba;})});}if(_0x484fa5[_0x45fc('0x4d')][_0x45fc('0x9b')]){var _0x2b9ff4=_0x484fa5['query'][_0x45fc('0x9b')][_0x45fc('0x9c')](',');var _0x93385b={};_0x93385b[_0x2b9ff4[0x0]]={'$gte':moment(_0x2b9ff4[0x1])[_0x45fc('0x9d')](_0x45fc('0x9e'))};_0x4a9eed[_0x45fc('0x53')]=_[_0x45fc('0x57')](_0x4a9eed[_0x45fc('0x53')],_0x93385b);}_0x4a9eed=_[_0x45fc('0x57')]({},_0x4a9eed,_0x484fa5['options']);return db[_0x45fc('0x9f')][_0x45fc('0x23')]({'where':_0x4a9eed[_0x45fc('0x53')]})['then'](function(_0x4f17bf){_0x22d803['count']=_0x4f17bf;if(_0x484fa5[_0x45fc('0x4d')][_0x45fc('0x5a')]){_0x4a9eed[_0x45fc('0x62')]=[{'all':!![]}];}return db[_0x45fc('0x9f')][_0x45fc('0x5b')](_0x4a9eed);})['then'](function(_0x4620a8){if(_0x484fa5[_0x45fc('0x4d')][_0x45fc('0xa0')]==='true'){for(var _0x4a5b61=0x0;_0x4a5b61<_0x4620a8['length'];_0x4a5b61++){_0x4620a8[_0x4a5b61][_0x45fc('0x64')]=juice(_0x4620a8[_0x4a5b61]['body']);}}_0x22d803['rows']=_0x4620a8;return _0x22d803;});}})['then'](respondWithFilteredResult(_0x4c8b96,_0x4a9eed))[_0x45fc('0x1c')](handleError(_0x4c8b96,null));};exports[_0x45fc('0x2b')]=function(_0x5c26e7,_0x476807){var _0x3fae7a,_0xa4df12={},_0x45cff8;if(_0x5c26e7[_0x45fc('0x64')]['to']){_0x45cff8=_0x5c26e7[_0x45fc('0x64')]['to'][_0x45fc('0x9c')](',')[0x0];}return db[_0x45fc('0x48')][_0x45fc('0x63')]({'where':{'id':_0x5c26e7[_0x45fc('0x5c')]['id']},'include':[{'model':db[_0x45fc('0xa1')],'as':_0x45fc('0xa2'),'include':[{'model':db['CmContact'],'as':_0x45fc('0xa3'),'where':{'email':_0x45cff8},'limit':0x1,'order':[[_0x45fc('0xa4'),_0x45fc('0xa5')]]}]},{'model':db['MailServerOut'],'as':_0x45fc('0x44'),'raw':!![],'include':[{'model':db[_0x45fc('0xa6')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x476807,null))[_0x45fc('0x11')](function(_0x2f45c2){if(!_0x2f45c2)return;_0x3fae7a=_0x2f45c2;if(!_0x2f45c2[_0x45fc('0x44')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x45fc('0x79')](_0x5c26e7['body'][_0x45fc('0xa7')])){_0x5c26e7['body']['from']=util['format']('%s\x20<%s>',_0x2f45c2[_0x45fc('0x2a')],_0x2f45c2[_0x45fc('0x78')]||_0x2f45c2[_0x45fc('0x44')][_0x45fc('0x38')]);}if(_0x5c26e7[_0x45fc('0x64')][_0x45fc('0xa8')]&&_0x5c26e7[_0x45fc('0x64')][_0x45fc('0xa8')][_0x45fc('0x61')]){for(var _0x5b9bc5=0x0;_0x5b9bc5<_0x5c26e7['body'][_0x45fc('0xa8')][_0x45fc('0x61')];_0x5b9bc5+=0x1){_0x5c26e7[_0x45fc('0x64')][_0x45fc('0xa8')][_0x5b9bc5]={'filename':_0x5c26e7[_0x45fc('0x64')][_0x45fc('0xa8')][_0x5b9bc5][_0x45fc('0x2a')],'path':path[_0x45fc('0xa9')](config[_0x45fc('0xaa')],_0x45fc('0xab'),_0x5c26e7[_0x45fc('0x64')][_0x45fc('0xa8')][_0x5b9bc5][_0x45fc('0xac')])};}}var _0x37777a=_0x2f45c2['getSmtpOptions']();return respondWithRpcPromise(_0x45fc('0xad'),'sendMail',{'account':_0x37777a,'message':_0x5c26e7[_0x45fc('0x64')]});})[_0x45fc('0x11')](function(_0x47d881){if(!_0x47d881)return;_0xa4df12=_0x47d881;if(!_0x3fae7a[_0x45fc('0xa2')])throw new Error(_0x45fc('0xae'));if(_0x3fae7a[_0x45fc('0xa2')][_0x45fc('0xa3')][_0x45fc('0x61')])return _0x3fae7a[_0x45fc('0xa2')][_0x45fc('0xa3')][0x0];return db[_0x45fc('0x8b')][_0x45fc('0x6c')](_['defaults'](_0x5c26e7[_0x45fc('0x64')],{'firstName':_0x5c26e7[_0x45fc('0x64')]['to'],'email':_0x5c26e7[_0x45fc('0x64')]['to'],'phone':_0x5c26e7[_0x45fc('0x64')]['to'],'ListId':_0x3fae7a[_0x45fc('0xaf')]}));})[_0x45fc('0x11')](function(_0x305ef4){if(!_0x305ef4)return;var _0x3d3e53={'UserId':_0x5c26e7[_0x45fc('0x38')]['id'],'ContactId':_0x305ef4['id'],'MailAccountId':_0x3fae7a['id'],'inReplyTo':_0xa4df12[_0x45fc('0xb0')],'to':_0x5c26e7['body'][_0x45fc('0xa7')],'cc':_0x5c26e7['body']['cc'],'subject':_0x5c26e7[_0x45fc('0x64')][_0x45fc('0xb1')],'attach':_0x5c26e7[_0x45fc('0x64')][_0x45fc('0xb2')],'firstMsgDirection':_0x45fc('0xb3'),'lastMsgAt':moment()[_0x45fc('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x45fc('0xb3'),'Messages':[_[_0x45fc('0x57')](_0x5c26e7[_0x45fc('0x64')],{'messageId':_0xa4df12['messageId'],'sentAt':moment()[_0x45fc('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x3fae7a['id'],'UserId':_0x5c26e7[_0x45fc('0x38')]['id'],'ContactId':_0x305ef4['id']})]};if(_0x5c26e7[_0x45fc('0x64')][_0x45fc('0xb4')]){_0x3d3e53=_[_0x45fc('0x57')](_0x3d3e53,_0x5c26e7[_0x45fc('0x64')][_0x45fc('0xb4')]);}return db[_0x45fc('0x87')][_0x45fc('0x6c')](_0x3d3e53,{'include':[{'model':db[_0x45fc('0x9f')],'as':_0x45fc('0xb5')}]});})[_0x45fc('0x11')](respondWithResult(_0x476807,null))[_0x45fc('0x1c')](handleError(_0x476807,null));};exports[_0x45fc('0xb6')]=function(_0x32143b,_0x1834d1){return db[_0x45fc('0x48')][_0x45fc('0x63')]({'where':{'id':_0x32143b[_0x45fc('0x5c')]['id']},'include':[{'model':db[_0x45fc('0x5e')],'as':_0x45fc('0x44'),'raw':!![],'include':[{'model':db[_0x45fc('0xa6')],'as':_0x45fc('0xa6'),'raw':!![]}]}]})[_0x45fc('0x11')](handleEntityNotFound(_0x1834d1,null))[_0x45fc('0x11')](function(_0x41f8a7){if(!_0x41f8a7['Smtp'])return;var _0x228267=_0x41f8a7['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x228267});})[_0x45fc('0x11')](respondWithResult(_0x1834d1,null))['catch'](handleError(_0x1834d1,null));};exports[_0x45fc('0x27')]=function(_0x30b9cd,_0x441909){return db[_0x45fc('0x48')][_0x45fc('0x63')]({'where':{'id':_0x30b9cd['params']['id']}})[_0x45fc('0x11')](handleEntityNotFound(_0x441909,null))[_0x45fc('0x11')](function(_0x1b9a95){if(_0x1b9a95&&_0x1b9a95[_0x45fc('0x40')]){throw new db[(_0x45fc('0xb7'))]['ValidationError'](_0x45fc('0xb8'));}return _0x1b9a95;})[_0x45fc('0x11')](removeEntity(_0x441909,null))[_0x45fc('0x1c')](handleError(_0x441909,null));};exports[_0x45fc('0xb9')]=function(_0x50303f,_0x1bc762){return db[_0x45fc('0x48')][_0x45fc('0x63')]({'where':{'id':_0x50303f[_0x45fc('0x5c')]['id']}})[_0x45fc('0x11')](handleEntityNotFound(_0x1bc762,null))[_0x45fc('0x11')](function(_0x2bf766){if(_0x2bf766){return _0x2bf766[_0x45fc('0xb9')](_0x50303f[_0x45fc('0x64')][_0x45fc('0x77')],_[_0x45fc('0x89')](_0x50303f[_0x45fc('0x64')],['ids','id'])||{})[_0x45fc('0xba')](function(_0x179aad){for(var _0x3fd737=0x0;_0x3fd737<_0x50303f[_0x45fc('0x64')][_0x45fc('0x77')][_0x45fc('0x61')];_0x3fd737+=0x1){socket[_0x45fc('0xbb')]('userMailAccount:save',{'UserId':Number(_0x50303f[_0x45fc('0x64')][_0x45fc('0x77')][_0x3fd737]),'MailAccountId':Number(_0x50303f[_0x45fc('0x5c')]['id'])});}return _0x179aad;});}})[_0x45fc('0x11')](respondWithResult(_0x1bc762,null))[_0x45fc('0x1c')](handleError(_0x1bc762,null));};exports[_0x45fc('0xbc')]=function(_0x1265f3,_0x2f9ea9){return db['MailAccount']['find']({'where':{'id':_0x1265f3[_0x45fc('0x5c')]['id']}})[_0x45fc('0x11')](handleEntityNotFound(_0x2f9ea9,null))[_0x45fc('0x11')](function(_0xcc0d00){if(_0xcc0d00){return _0xcc0d00[_0x45fc('0xbc')](_0x1265f3[_0x45fc('0x4d')][_0x45fc('0x77')])[_0x45fc('0x11')](function(){if(_[_0x45fc('0xbd')](_0x1265f3[_0x45fc('0x4d')][_0x45fc('0x77')])){for(var _0x299fae=0x0;_0x299fae<_0x1265f3[_0x45fc('0x4d')]['ids'][_0x45fc('0x61')];_0x299fae+=0x1){socket[_0x45fc('0xbb')](_0x45fc('0xbe'),{'UserId':Number(_0x1265f3['query'][_0x45fc('0x77')][_0x299fae]),'MailAccountId':Number(_0x1265f3[_0x45fc('0x5c')]['id'])});}}else{socket[_0x45fc('0xbb')](_0x45fc('0xbe'),{'UserId':Number(_0x1265f3[_0x45fc('0x4d')][_0x45fc('0x77')]),'MailAccountId':Number(_0x1265f3['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2f9ea9,null))[_0x45fc('0x1c')](handleError(_0x2f9ea9,null));};exports[_0x45fc('0xbf')]=function(_0x48b721,_0x3ae446){var _0x378ee6={};var _0x521e42={};var _0x558b6d;var _0x1edc3d;return db[_0x45fc('0x48')][_0x45fc('0x6e')]({'where':{'id':_0x48b721[_0x45fc('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3ae446,null))['then'](function(_0x1521bf){if(_0x1521bf){_0x558b6d=_0x1521bf;_0x521e42[_0x45fc('0x4c')]=_[_0x45fc('0x4e')](db['User'][_0x45fc('0x6f')]);_0x521e42['query']=_[_0x45fc('0x4e')](_0x48b721[_0x45fc('0x4d')]);_0x521e42[_0x45fc('0x54')]=_[_0x45fc('0x60')](_0x521e42[_0x45fc('0x4c')],_0x521e42[_0x45fc('0x4d')]);_0x378ee6[_0x45fc('0x4f')]=_[_0x45fc('0x60')](_0x521e42[_0x45fc('0x4c')],qs[_0x45fc('0x50')](_0x48b721[_0x45fc('0x4d')]['fields']));_0x378ee6[_0x45fc('0x4f')]=_0x378ee6[_0x45fc('0x4f')][_0x45fc('0x61')]?_0x378ee6[_0x45fc('0x4f')]:_0x521e42[_0x45fc('0x4c')];_0x378ee6[_0x45fc('0x51')]=qs[_0x45fc('0x52')](_0x48b721[_0x45fc('0x4d')][_0x45fc('0x52')]);_0x378ee6[_0x45fc('0x53')]=qs[_0x45fc('0x54')](_[_0x45fc('0x55')](_0x48b721[_0x45fc('0x4d')],_0x521e42[_0x45fc('0x54')]));if(_0x48b721[_0x45fc('0x4d')][_0x45fc('0x56')]){_0x378ee6[_0x45fc('0x53')]=_['merge'](_0x378ee6['where'],{'$or':_[_0x45fc('0x47')](_0x378ee6['attributes'],function(_0x33eb0f){var _0x478655={};_0x478655[_0x33eb0f]={'$like':'%'+_0x48b721[_0x45fc('0x4d')][_0x45fc('0x56')]+'%'};return _0x478655;})});}_0x378ee6=_[_0x45fc('0x57')]({},_0x378ee6,_0x48b721[_0x45fc('0x59')]);return _0x558b6d[_0x45fc('0xbf')](_0x378ee6);}})[_0x45fc('0x11')](function(_0x446a50){if(_0x446a50){_0x1edc3d=_0x446a50['length'];if(!_0x48b721[_0x45fc('0x4d')][_0x45fc('0x70')](_0x45fc('0x75'))){_0x378ee6['limit']=qs['limit'](_0x48b721[_0x45fc('0x4d')]['limit']);_0x378ee6[_0x45fc('0x21')]=qs['offset'](_0x48b721['query'][_0x45fc('0x21')]);}return _0x558b6d[_0x45fc('0xbf')](_0x378ee6);}})[_0x45fc('0x11')](function(_0x208f82){if(_0x208f82){return _0x208f82?{'count':_0x1edc3d,'rows':_0x208f82}:null;}})[_0x45fc('0x11')](respondWithResult(_0x3ae446,null))[_0x45fc('0x1c')](handleError(_0x3ae446,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 5bb73d9..21d6fdf 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 _0x86be=['update','remove','hasOwnProperty','hook','exports','events','MailAccount','setMaxListeners','save'];(function(_0x498334,_0x27b6fe){var _0x13bb70=function(_0x4087b1){while(--_0x4087b1){_0x498334['push'](_0x498334['shift']());}};_0x13bb70(++_0x27b6fe);}(_0x86be,0x176));var _0xe86b=function(_0x54e788,_0xcea275){_0x54e788=_0x54e788-0x0;var _0x349a3c=_0x86be[_0x54e788];return _0x349a3c;};'use strict';var EventEmitter=require(_0xe86b('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xe86b('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xe86b('0x2')](0x0);var events={'afterCreate':_0xe86b('0x3'),'afterUpdate':_0xe86b('0x4'),'afterDestroy':_0xe86b('0x5')};function emitEvent(_0x3c3b51){return function(_0x815b97,_0x2ef1e1,_0x47ba5d){MailAccountEvents['emit'](_0x3c3b51+':'+_0x815b97['id'],_0x815b97);MailAccountEvents['emit'](_0x3c3b51,_0x815b97);_0x47ba5d(null);};}for(var e in events){if(events[_0xe86b('0x6')](e)){var event=events[e];MailAccount[_0xe86b('0x7')](e,emitEvent(event));}}module[_0xe86b('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x4d4e=['remove','emit','events','MailAccount','setMaxListeners','update'];(function(_0x546628,_0x2797d3){var _0x3ae92c=function(_0x473210){while(--_0x473210){_0x546628['push'](_0x546628['shift']());}};_0x3ae92c(++_0x2797d3);}(_0x4d4e,0xa4));var _0xe4d4=function(_0x2aee5c,_0x14ddfd){_0x2aee5c=_0x2aee5c-0x0;var _0x5e2363=_0x4d4e[_0x2aee5c];return _0x5e2363;};'use strict';var EventEmitter=require(_0xe4d4('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xe4d4('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xe4d4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe4d4('0x3'),'afterDestroy':_0xe4d4('0x4')};function emitEvent(_0x1fc0de){return function(_0x3ef1fe,_0x49cb69,_0x5e7f97){MailAccountEvents['emit'](_0x1fc0de+':'+_0x3ef1fe['id'],_0x3ef1fe);MailAccountEvents[_0xe4d4('0x5')](_0x1fc0de,_0x3ef1fe);_0x5e7f97(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 1caf126..0abbd62 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 _0x2c9b=['provider','custom','host','port','Smtp','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','data5','user','pass','./mailAccount.attributes','exports','define','mail_accounts'];(function(_0x21e001,_0x247a51){var _0x5aa04b=function(_0x4656f5){while(--_0x4656f5){_0x21e001['push'](_0x21e001['shift']());}};_0x5aa04b(++_0x247a51);}(_0x2c9b,0x19a));var _0xb2c9=function(_0xf19e26,_0x9050e7){_0xf19e26=_0xf19e26-0x0;var _0x6acaba=_0x2c9b[_0xf19e26];return _0x6acaba;};'use strict';var attributes=require(_0xb2c9('0x0'));module[_0xb2c9('0x1')]=function(_0x3985b6){return _0x3985b6[_0xb2c9('0x2')]('MailAccount',attributes,{'tableName':_0xb2c9('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3f1fe6=this;var _0x142d5e={'id':_0x3f1fe6['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3f1fe6[_0xb2c9('0x4')]!==_0xb2c9('0x5')){_0x142d5e['service']=_0x3f1fe6[_0xb2c9('0x4')];}else{_0x142d5e[_0xb2c9('0x6')]=_0x3f1fe6['Smtp'][_0xb2c9('0x6')];_0x142d5e[_0xb2c9('0x7')]=_0x3f1fe6[_0xb2c9('0x8')][_0xb2c9('0x7')];_0x142d5e[_0xb2c9('0x9')]=_0x3f1fe6[_0xb2c9('0x8')][_0xb2c9('0x9')];}if(_0x3f1fe6['Smtp'][_0xb2c9('0xa')]){if(_0x3f1fe6[_0xb2c9('0x8')][_0xb2c9('0xb')]){if(!_0x3f1fe6['Smtp'][_0xb2c9('0xc')])throw new Error(_0xb2c9('0xd'));_0x142d5e[_0xb2c9('0xe')]={'type':'OAuth2','user':_0x3f1fe6[_0xb2c9('0x8')]['user'],'accessToken':_0x3f1fe6[_0xb2c9('0x8')][_0xb2c9('0xc')][_0xb2c9('0xf')]};}else{_0x142d5e[_0xb2c9('0xe')]={'user':_0x3f1fe6[_0xb2c9('0x8')][_0xb2c9('0x10')],'pass':_0x3f1fe6[_0xb2c9('0x8')][_0xb2c9('0x11')]};}}return _0x142d5e;}}});}; \ No newline at end of file +var _0xe15f=['exports','define','MailAccount','mail_accounts','provider','custom','service','host','port','secure','Smtp','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','pass','./mailAccount.attributes'];(function(_0x587d26,_0x1254d9){var _0x4d88f3=function(_0x2ab0a7){while(--_0x2ab0a7){_0x587d26['push'](_0x587d26['shift']());}};_0x4d88f3(++_0x1254d9);}(_0xe15f,0x1b7));var _0xfe15=function(_0x1ca943,_0x5a4327){_0x1ca943=_0x1ca943-0x0;var _0x25202a=_0xe15f[_0x1ca943];return _0x25202a;};'use strict';var attributes=require(_0xfe15('0x0'));module[_0xfe15('0x1')]=function(_0x463438){return _0x463438[_0xfe15('0x2')](_0xfe15('0x3'),attributes,{'tableName':_0xfe15('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x39218b=this;var _0x5e5dcf={'id':_0x39218b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x39218b[_0xfe15('0x5')]!==_0xfe15('0x6')){_0x5e5dcf[_0xfe15('0x7')]=_0x39218b[_0xfe15('0x5')];}else{_0x5e5dcf[_0xfe15('0x8')]=_0x39218b['Smtp']['host'];_0x5e5dcf['port']=_0x39218b['Smtp'][_0xfe15('0x9')];_0x5e5dcf[_0xfe15('0xa')]=_0x39218b[_0xfe15('0xb')][_0xfe15('0xa')];}if(_0x39218b[_0xfe15('0xb')][_0xfe15('0xc')]){if(_0x39218b['Smtp'][_0xfe15('0xd')]){if(!_0x39218b[_0xfe15('0xb')]['CloudProvider'])throw new Error(_0xfe15('0xe'));_0x5e5dcf[_0xfe15('0xf')]={'type':_0xfe15('0x10'),'user':_0x39218b[_0xfe15('0xb')][_0xfe15('0x11')],'accessToken':_0x39218b['Smtp']['CloudProvider'][_0xfe15('0x12')]};}else{_0x5e5dcf[_0xfe15('0xf')]={'user':_0x39218b[_0xfe15('0xb')][_0xfe15('0x11')],'pass':_0x39218b['Smtp'][_0xfe15('0x13')]};}}return _0x5e5dcf;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 4736dcf..c7ea0d8 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 _0x814b=['http','redis','localhost','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','MailAccount','findAll','options','where','attributes','limit','include','map','model','GetMailAccount','ShowMailAccount','find','raw','smtp','smtpOptions','NotifyMailAccount','body','mail','difference','keys','updatedAt','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','List','CmContact','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','omit','getSmtpOptions','applications','list','asc','autoclose','push','length','Contacts','create','generate','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Contact\x20not\x20found','spread','update','interaction','get','created','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','name','UserId','unshift','agent','waitForTheAssignedAgent','queueId','MailQueue','*,*,*,*','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x814b,0x1a2));var _0xb814=function(_0x251fa4,_0x3d5860){_0x251fa4=_0x251fa4-0x0;var _0x453047=_0x814b[_0x251fa4];return _0x453047;};'use strict';var _=require(_0xb814('0x0'));var moment=require(_0xb814('0x1'));var BPromise=require(_0xb814('0x2'));var rs=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var db=require(_0xb814('0x5'))['db'];var logger=require('../../config/logger')(_0xb814('0x6'));var config=require(_0xb814('0x7'));var jayson=require(_0xb814('0x8'));var client=jayson[_0xb814('0x9')][_0xb814('0xa')]({'port':0x232c});config[_0xb814('0xb')]=_['defaults'](config[_0xb814('0xb')],{'host':_0xb814('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb814('0xb')]));require(_0xb814('0xd'))[_0xb814('0xe')](socket);function respondWithRpcPromise(_0x41166c,_0x1fea33,_0x21d4a5){return new BPromise(function(_0x1086f8,_0x19aad8){return client[_0xb814('0xf')](_0x41166c,_0x21d4a5)[_0xb814('0x10')](function(_0x10e4a6){logger['info'](_0xb814('0x11'),_0x1fea33,'request\x20sent');logger[_0xb814('0x12')](_0xb814('0x13'),_0x1fea33,_0xb814('0x14'),JSON[_0xb814('0x15')](_0x10e4a6));if(_0x10e4a6[_0xb814('0x16')]){if(_0x10e4a6[_0xb814('0x16')][_0xb814('0x17')]===0x1f4){logger[_0xb814('0x16')](_0xb814('0x11'),_0x1fea33,_0x10e4a6[_0xb814('0x16')][_0xb814('0x18')]);return _0x19aad8(_0x10e4a6[_0xb814('0x16')][_0xb814('0x18')]);}logger[_0xb814('0x16')](_0xb814('0x11'),_0x1fea33,_0x10e4a6[_0xb814('0x16')][_0xb814('0x18')]);return _0x1086f8(_0x10e4a6[_0xb814('0x16')][_0xb814('0x18')]);}else{logger[_0xb814('0x19')](_0xb814('0x11'),_0x1fea33,'request\x20sent');_0x1086f8(_0x10e4a6[_0xb814('0x1a')]['message']);}})[_0xb814('0x1b')](function(_0xfac75b){logger['error']('MailAccount,\x20%s,\x20%s',_0x1fea33,_0xfac75b);_0x19aad8(_0xfac75b);});});}exports['GetMailAccount']=function(_0x399b43){var _0x4d5276=this;return new Promise(function(_0x57c128,_0xb684ea){return db[_0xb814('0x1c')][_0xb814('0x1d')]({'raw':_0x399b43['options']?_0x399b43[_0xb814('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x399b43[_0xb814('0x1e')]?_0x399b43[_0xb814('0x1e')][_0xb814('0x1f')]||null:null,'attributes':_0x399b43[_0xb814('0x1e')]?_0x399b43[_0xb814('0x1e')][_0xb814('0x20')]||null:null,'limit':_0x399b43[_0xb814('0x1e')]?_0x399b43['options'][_0xb814('0x21')]||null:null,'include':_0x399b43['options']?_0x399b43[_0xb814('0x1e')][_0xb814('0x22')]?_[_0xb814('0x23')](_0x399b43[_0xb814('0x1e')][_0xb814('0x22')],function(_0xb9e57d){return{'model':db[_0xb9e57d[_0xb814('0x24')]],'as':_0xb9e57d['as'],'attributes':_0xb9e57d['attributes'],'include':_0xb9e57d[_0xb814('0x22')]?_[_0xb814('0x23')](_0xb9e57d[_0xb814('0x22')],function(_0x349394){return{'model':db[_0x349394[_0xb814('0x24')]],'as':_0x349394['as'],'attributes':_0x349394[_0xb814('0x20')],'include':_0x349394[_0xb814('0x22')]?_[_0xb814('0x23')](_0x349394['include'],function(_0x271aa8){return{'model':db[_0x271aa8[_0xb814('0x24')]],'as':_0x271aa8['as'],'attributes':_0x271aa8['attributes']};}):[]};}):[]};}):[]:[]})[_0xb814('0x10')](function(_0x37d24d){logger[_0xb814('0x19')]('GetMailAccount',_0x399b43);logger[_0xb814('0x12')](_0xb814('0x25'),_0x399b43,JSON['stringify'](_0x37d24d));_0x57c128(_0x37d24d);})[_0xb814('0x1b')](function(_0x526610){logger[_0xb814('0x16')]('GetMailAccount',_0x526610['message'],_0x399b43);_0xb684ea(_0x4d5276[_0xb814('0x16')](0x1f4,_0x526610['message']));});});};exports[_0xb814('0x26')]=function(_0x19469b){var _0x2b91bd=this;return new Promise(function(_0x599f9f,_0x51d5ae){return db[_0xb814('0x1c')][_0xb814('0x27')]({'raw':_0x19469b['options']?_0x19469b[_0xb814('0x1e')][_0xb814('0x28')]===undefined?!![]:![]:!![],'where':_0x19469b[_0xb814('0x1e')]?_0x19469b[_0xb814('0x1e')][_0xb814('0x1f')]||null:null,'attributes':_0x19469b[_0xb814('0x1e')]?_0x19469b[_0xb814('0x1e')]['attributes']||null:null,'include':_0x19469b[_0xb814('0x1e')]?_0x19469b[_0xb814('0x1e')][_0xb814('0x22')]?_[_0xb814('0x23')](_0x19469b[_0xb814('0x1e')]['include'],function(_0x16ef82){return{'model':db[_0x16ef82['model']],'as':_0x16ef82['as'],'attributes':_0x16ef82[_0xb814('0x20')],'include':_0x16ef82[_0xb814('0x22')]?_[_0xb814('0x23')](_0x16ef82['include'],function(_0x40b885){return{'model':db[_0x40b885[_0xb814('0x24')]],'as':_0x40b885['as'],'attributes':_0x40b885['attributes'],'include':_0x40b885[_0xb814('0x22')]?_[_0xb814('0x23')](_0x40b885[_0xb814('0x22')],function(_0x1f7cd8){return{'model':db[_0x1f7cd8[_0xb814('0x24')]],'as':_0x1f7cd8['as'],'attributes':_0x1f7cd8[_0xb814('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa6ce87){if(_0x19469b['options'][_0xb814('0x29')]===!![])_0xa6ce87['setDataValue'](_0xb814('0x2a'),_0xa6ce87['getSmtpOptions']());logger[_0xb814('0x19')](_0xb814('0x26'),_0x19469b);logger['debug']('ShowMailAccount',_0x19469b,JSON['stringify'](_0xa6ce87));_0x599f9f(_0xa6ce87);})['catch'](function(_0x17549e){logger[_0xb814('0x16')](_0xb814('0x26'),_0x17549e[_0xb814('0x18')],_0x19469b);_0x51d5ae(_0x2b91bd['error'](0x1f4,_0x17549e['message']));});});};exports[_0xb814('0x2b')]=function(_0x5922bb){var _0x2a93da=this;return new Promise(function(_0x1098eb,_0x178823){var _0x3063bf={'body':_0x5922bb[_0xb814('0x2c')],'channel':_0xb814('0x2d')};var _0x3b7f5a=_[_0xb814('0x2e')](_[_0xb814('0x2f')](db['CmContact']['rawAttributes']),['createdAt',_0xb814('0x30'),'CompanyId',_0xb814('0x31')]);var _0x580171=![];if(_0x5922bb[_0xb814('0x2c')]['id']){delete _0x5922bb[_0xb814('0x2c')]['id'];}if(_[_0xb814('0x32')](_0x5922bb[_0xb814('0x2c')]['from'])){return _0x178823(_0x2a93da[_0xb814('0x16')](0x1f4,_0xb814('0x33')));}if(_[_0xb814('0x32')](_0x5922bb[_0xb814('0x2c')][_0xb814('0x2c')])||_0x5922bb[_0xb814('0x2c')]['body']===''){return _0x178823(_0x2a93da[_0xb814('0x16')](0x1f4,_0xb814('0x34')));}if(_[_0xb814('0x32')](_0x5922bb[_0xb814('0x2c')][_0xb814('0x35')])){return _0x178823(_0x2a93da[_0xb814('0x16')](0x1f4,_0xb814('0x36')+_0x3b7f5a));}if(!_['includes'](_0x3b7f5a,_0x5922bb['body'][_0xb814('0x35')])){return _0x178823(_0x2a93da[_0xb814('0x16')](0x1f4,_0xb814('0x37')+_0x3b7f5a));}var _0x2bf906={};_0x2bf906[_0x5922bb[_0xb814('0x2c')][_0xb814('0x35')]]=_0x5922bb[_0xb814('0x2c')][_0xb814('0x38')];return db[_0xb814('0x1c')][_0xb814('0x27')]({'where':{'id':_0x5922bb[_0xb814('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0xb814('0x3a'),'include':[{'model':db[_0xb814('0x3b')],'as':'Contacts','where':_0x2bf906,'limit':0x1,'order':[[_0xb814('0x30'),'DESC']]}]},{'model':db[_0xb814('0x3c')],'as':_0xb814('0x3d')},{'model':db[_0xb814('0x3e')],'as':_0xb814('0x3f'),'include':[{'model':db[_0xb814('0x40')],'as':_0xb814('0x40')}]}]})[_0xb814('0x10')](function(_0x45480e){if(_0x45480e&&_0x45480e[_0xb814('0x3a')]){var _0x2a422a=_0x45480e['get']({'plain':!![]});_0x3063bf['account']=_[_0xb814('0x41')](_0x2a422a,[_0xb814('0x3d'),_0xb814('0x3a')]);_0x3063bf[_0xb814('0x39')][_0xb814('0x2a')]=_0x45480e[_0xb814('0x42')]();_0x3063bf[_0xb814('0x43')]=_0x2a422a['Applications'];_0x3063bf[_0xb814('0x44')]=_0x2a422a[_0xb814('0x3a')];_0x3063bf[_0xb814('0x43')]=_['orderBy'](_0x3063bf[_0xb814('0x43')],['priority'],[_0xb814('0x45')]);if(_0x3063bf['account']&&_0x3063bf[_0xb814('0x39')][_0xb814('0x46')]){_0x3063bf['applications'][_0xb814('0x47')]({'id':0x0,'priority':_0x3063bf[_0xb814('0x43')][_0xb814('0x48')]+0x1,'app':'close','appdata':_0xb814('0x46'),'interval':'*,*,*,*'});}if(_0x3063bf[_0xb814('0x39')][_0xb814('0x3d')]){delete _0x3063bf['account'][_0xb814('0x3d')];}if(_0x3063bf['account']['List']){delete _0x3063bf[_0xb814('0x39')][_0xb814('0x3a')];}if(_0x2a422a[_0xb814('0x3a')]['Contacts'][_0xb814('0x48')]){return _0x2a422a['List'][_0xb814('0x49')][0x0];}var _0x2174e5=_['defaults'](_0x5922bb[_0xb814('0x2c')],{'firstName':_0x5922bb['body'][_0xb814('0x38')],'ListId':_0x2a422a[_0xb814('0x31')]});_0x2174e5[_0x5922bb[_0xb814('0x2c')][_0xb814('0x35')]]=_0x5922bb[_0xb814('0x2c')][_0xb814('0x38')];return db[_0xb814('0x3b')][_0xb814('0x4a')](_0x2174e5);}else{throw new Error('List\x20not\x20found');}})[_0xb814('0x10')](function(_0x5441c5){_0x3063bf['contact']=_0x5441c5;if(_0x5441c5){if(!_0x5922bb[_0xb814('0x2c')][_0xb814('0x18')]['messageId']){_0x5922bb[_0xb814('0x2c')]['message']['messageId']=rs[_0xb814('0x4b')]()+'\x20'+_0x5922bb['body'][_0xb814('0x18')][_0xb814('0x38')];}var _0x2dec52={'ContactId':_0x5441c5['id'],'MailAccountId':_0x5922bb['account']['id'],'inReplyTo':_0x5922bb[_0xb814('0x2c')]['message'][_0xb814('0x4c')],'to':_0x5922bb[_0xb814('0x2c')][_0xb814('0x18')][_0xb814('0x38')],'cc':_0x5922bb[_0xb814('0x2c')][_0xb814('0x18')]['cc'],'subject':_0x5922bb[_0xb814('0x2c')][_0xb814('0x18')][_0xb814('0x4d')],'attach':_0x5922bb['body'][_0xb814('0x18')][_0xb814('0x4e')],'lastMsgAt':moment()[_0xb814('0x4f')](_0xb814('0x50')),'lastMsgDirection':'in'};return db[_0xb814('0x51')][_0xb814('0x27')]({'where':{'closed':![],'MailAccountId':_0x5922bb['account']['id']},'include':[{'model':db[_0xb814('0x52')],'as':'Messages','attributes':[_0xb814('0x4c')],'where':{'messageId':_0x5922bb[_0xb814('0x2c')][_0xb814('0x18')]['inReplyTo']}}]})[_0xb814('0x10')](function(_0x579351){if(_0x579351){return[_0x579351,![]];}return db[_0xb814('0x51')]['create'](_0x2dec52)[_0xb814('0x10')](function(_0x417e45){return[_0x417e45,!![]];});});}else{throw new Error(_0xb814('0x53'));}})[_0xb814('0x54')](function(_0x3377d4,_0x167d82){if(_0x3377d4){_0x580171=_0x167d82;if(!_0x167d82){return _0x3377d4[_0xb814('0x55')]({'inReplyTo':_0x5922bb['body'][_0xb814('0x18')]['messageId'],'to':_0x5922bb[_0xb814('0x2c')][_0xb814('0x18')][_0xb814('0x38')],'cc':_0x5922bb[_0xb814('0x2c')][_0xb814('0x18')]['cc'],'subject':_0x5922bb[_0xb814('0x2c')]['message'][_0xb814('0x4d')],'attach':_0x3377d4[_0xb814('0x4e')]?_0x3377d4['attach']:_0x5922bb[_0xb814('0x2c')][_0xb814('0x18')][_0xb814('0x4e')],'substatus':null,'substatusAt':moment()[_0xb814('0x4f')](_0xb814('0x50')),'lastMsgAt':moment()['format'](_0xb814('0x50')),'lastMsgDirection':'in'});}else{return _0x3377d4;}}})['then'](function(_0x24594a){_0x3063bf[_0xb814('0x56')]=_0x24594a[_0xb814('0x57')]({'plain':!![]});_0x3063bf[_0xb814('0x56')][_0xb814('0x58')]=_0x580171;return db[_0xb814('0x52')]['create']({'body':_0x5922bb['body']['body'],'MailAccountId':_0x5922bb[_0xb814('0x39')]['id'],'MailInteractionId':_0x24594a['id'],'direction':'in','ContactId':_0x3063bf['contact']['id'],'messageId':_0x5922bb[_0xb814('0x2c')][_0xb814('0x18')][_0xb814('0x4c')],'from':_0x5922bb['body'][_0xb814('0x18')][_0xb814('0x38')],'to':_0x5922bb[_0xb814('0x2c')]['message']['to'],'cc':_0x5922bb[_0xb814('0x2c')][_0xb814('0x18')]['cc'],'subject':_0x5922bb[_0xb814('0x2c')][_0xb814('0x18')]['subject'],'attach':_0x5922bb['body'][_0xb814('0x18')][_0xb814('0x4e')],'Attachments':_0x5922bb[_0xb814('0x2c')][_0xb814('0x18')][_0xb814('0x59')],'originTo':_0x5922bb[_0xb814('0x2c')][_0xb814('0x18')][_0xb814('0x5a')],'originCc':_0x5922bb[_0xb814('0x2c')][_0xb814('0x18')][_0xb814('0x5b')],'bcc':_0x5922bb[_0xb814('0x2c')][_0xb814('0x18')][_0xb814('0x5c')],'ChatWebsiteId':_0x5922bb[_0xb814('0x2c')]['message'][_0xb814('0x5d')]||null,'originChannel':_0x5922bb[_0xb814('0x2c')][_0xb814('0x18')][_0xb814('0x5e')]||_0xb814('0x5f'),'ChatOfflineMessageId':_0x5922bb[_0xb814('0x2c')]['message'][_0xb814('0x60')]||null},{'include':[{'model':db['Attachment'],'as':_0xb814('0x61')}]});})[_0xb814('0x10')](function(_0x3c5a58){_0x3063bf[_0xb814('0x18')]=_0x3c5a58;if(!_0x3063bf[_0xb814('0x56')]['UserId']){return;}return db['User'][_0xb814('0x27')]({'attributes':['id',_0xb814('0x62')],'where':{'id':_0x3063bf[_0xb814('0x56')][_0xb814('0x63')]}});})['then'](function(_0x1ee95d){if(_0x1ee95d){_0x3063bf['applications'][_0xb814('0x64')]({'id':0x0,'priority':0x0,'app':_0xb814('0x65'),'appdata':_0x1ee95d['name']+','+(_0x3063bf['account'][_0xb814('0x66')]||0xa),'interval':'*,*,*,*'});}if(!_0x3063bf[_0xb814('0x56')][_0xb814('0x67')]){return;}return db[_0xb814('0x68')][_0xb814('0x27')]({'attributes':['id',_0xb814('0x62')],'where':{'id':_0x3063bf[_0xb814('0x56')][_0xb814('0x67')]}});})['then'](function(_0x1d37ea){if(_0x1d37ea){_0x3063bf['applications'][_0xb814('0x64')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1d37ea[_0xb814('0x62')]+','+(_0x3063bf[_0xb814('0x39')]['waitForTheAssignedQueue']||0x12c),'interval':_0xb814('0x69')});}return respondWithRpcPromise('Start',_0xb814('0x6a'),_0x3063bf);})[_0xb814('0x10')](function(_0x4e15c2){_0x1098eb(_0x4e15c2);})['catch'](function(_0x9e2e16){_0x178823(_0x2a93da[_0xb814('0x16')](0x1f4,_0x9e2e16[_0xb814('0x18')]));});});}; \ No newline at end of file +var _0x9fd4=['generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','inReplyTo','create','spread','update','attach','interaction','created','MailMessage','contact','attachments','originChannel','Email','ChatOfflineMessageId','Attachments','UserId','User','unshift','agent','name','waitForTheAssignedAgent','*,*,*,*','queueId','MailQueue','queue','waitForTheAssignedQueue','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./mailAccount.socket','register','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','MailAccount','options','where','attributes','limit','include','map','model','GetMailAccount','ShowMailAccount','find','raw','smtp','setDataValue','smtpOptions','getSmtpOptions','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','body','isNil','from','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','DESC','MailApplication','MailServerOut','Smtp','CloudProvider','List','get','omit','Applications','applications','list','priority','asc','autoclose','close','length','List\x20not\x20found','messageId'];(function(_0x1274f5,_0x3ddb6b){var _0x5542db=function(_0x225c69){while(--_0x225c69){_0x1274f5['push'](_0x1274f5['shift']());}};_0x5542db(++_0x3ddb6b);}(_0x9fd4,0x16c));var _0x49fd=function(_0x187e24,_0x393e15){_0x187e24=_0x187e24-0x0;var _0x39b658=_0x9fd4[_0x187e24];return _0x39b658;};'use strict';var _=require(_0x49fd('0x0'));var moment=require(_0x49fd('0x1'));var BPromise=require(_0x49fd('0x2'));var rs=require(_0x49fd('0x3'));var Redis=require(_0x49fd('0x4'));var db=require(_0x49fd('0x5'))['db'];var logger=require(_0x49fd('0x6'))(_0x49fd('0x7'));var config=require(_0x49fd('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x49fd('0x9')]({'port':0x232c});config[_0x49fd('0xa')]=_[_0x49fd('0xb')](config[_0x49fd('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x49fd('0xc'))(new Redis(config[_0x49fd('0xa')]));require(_0x49fd('0xd'))[_0x49fd('0xe')](socket);function respondWithRpcPromise(_0x190807,_0x4a1c47,_0x35034c){return new BPromise(function(_0x130c9b,_0x3e1c71){return client[_0x49fd('0xf')](_0x190807,_0x35034c)[_0x49fd('0x10')](function(_0x2c6d77){logger[_0x49fd('0x11')]('MailAccount,\x20%s,\x20%s',_0x4a1c47,_0x49fd('0x12'));logger[_0x49fd('0x13')](_0x49fd('0x14'),_0x4a1c47,_0x49fd('0x12'),JSON[_0x49fd('0x15')](_0x2c6d77));if(_0x2c6d77[_0x49fd('0x16')]){if(_0x2c6d77[_0x49fd('0x16')][_0x49fd('0x17')]===0x1f4){logger[_0x49fd('0x16')](_0x49fd('0x18'),_0x4a1c47,_0x2c6d77[_0x49fd('0x16')][_0x49fd('0x19')]);return _0x3e1c71(_0x2c6d77[_0x49fd('0x16')][_0x49fd('0x19')]);}logger[_0x49fd('0x16')](_0x49fd('0x18'),_0x4a1c47,_0x2c6d77[_0x49fd('0x16')][_0x49fd('0x19')]);return _0x130c9b(_0x2c6d77[_0x49fd('0x16')][_0x49fd('0x19')]);}else{logger[_0x49fd('0x11')](_0x49fd('0x18'),_0x4a1c47,_0x49fd('0x12'));_0x130c9b(_0x2c6d77[_0x49fd('0x1a')][_0x49fd('0x19')]);}})[_0x49fd('0x1b')](function(_0x598793){logger[_0x49fd('0x16')](_0x49fd('0x18'),_0x4a1c47,_0x598793);_0x3e1c71(_0x598793);});});}exports['GetMailAccount']=function(_0x5c323a){var _0x449c9a=this;return new Promise(function(_0x53cbd1,_0x316e7c){return db[_0x49fd('0x1c')]['findAll']({'raw':_0x5c323a[_0x49fd('0x1d')]?_0x5c323a[_0x49fd('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5c323a[_0x49fd('0x1d')]?_0x5c323a[_0x49fd('0x1d')][_0x49fd('0x1e')]||null:null,'attributes':_0x5c323a[_0x49fd('0x1d')]?_0x5c323a[_0x49fd('0x1d')][_0x49fd('0x1f')]||null:null,'limit':_0x5c323a['options']?_0x5c323a[_0x49fd('0x1d')][_0x49fd('0x20')]||null:null,'include':_0x5c323a[_0x49fd('0x1d')]?_0x5c323a['options'][_0x49fd('0x21')]?_[_0x49fd('0x22')](_0x5c323a[_0x49fd('0x1d')]['include'],function(_0x597161){return{'model':db[_0x597161['model']],'as':_0x597161['as'],'attributes':_0x597161[_0x49fd('0x1f')],'include':_0x597161[_0x49fd('0x21')]?_[_0x49fd('0x22')](_0x597161[_0x49fd('0x21')],function(_0x9587b9){return{'model':db[_0x9587b9[_0x49fd('0x23')]],'as':_0x9587b9['as'],'attributes':_0x9587b9[_0x49fd('0x1f')],'include':_0x9587b9[_0x49fd('0x21')]?_['map'](_0x9587b9[_0x49fd('0x21')],function(_0x52b35d){return{'model':db[_0x52b35d[_0x49fd('0x23')]],'as':_0x52b35d['as'],'attributes':_0x52b35d[_0x49fd('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x203038){logger[_0x49fd('0x11')](_0x49fd('0x24'),_0x5c323a);logger[_0x49fd('0x13')](_0x49fd('0x24'),_0x5c323a,JSON[_0x49fd('0x15')](_0x203038));_0x53cbd1(_0x203038);})[_0x49fd('0x1b')](function(_0x242203){logger['error'](_0x49fd('0x24'),_0x242203['message'],_0x5c323a);_0x316e7c(_0x449c9a[_0x49fd('0x16')](0x1f4,_0x242203['message']));});});};exports[_0x49fd('0x25')]=function(_0x3c082c){var _0x390788=this;return new Promise(function(_0x492622,_0x50d304){return db['MailAccount'][_0x49fd('0x26')]({'raw':_0x3c082c[_0x49fd('0x1d')]?_0x3c082c['options'][_0x49fd('0x27')]===undefined?!![]:![]:!![],'where':_0x3c082c['options']?_0x3c082c['options'][_0x49fd('0x1e')]||null:null,'attributes':_0x3c082c[_0x49fd('0x1d')]?_0x3c082c[_0x49fd('0x1d')][_0x49fd('0x1f')]||null:null,'include':_0x3c082c[_0x49fd('0x1d')]?_0x3c082c['options']['include']?_[_0x49fd('0x22')](_0x3c082c[_0x49fd('0x1d')][_0x49fd('0x21')],function(_0x28f88f){return{'model':db[_0x28f88f['model']],'as':_0x28f88f['as'],'attributes':_0x28f88f[_0x49fd('0x1f')],'include':_0x28f88f[_0x49fd('0x21')]?_[_0x49fd('0x22')](_0x28f88f[_0x49fd('0x21')],function(_0x4363b5){return{'model':db[_0x4363b5[_0x49fd('0x23')]],'as':_0x4363b5['as'],'attributes':_0x4363b5[_0x49fd('0x1f')],'include':_0x4363b5[_0x49fd('0x21')]?_[_0x49fd('0x22')](_0x4363b5[_0x49fd('0x21')],function(_0x3762c7){return{'model':db[_0x3762c7['model']],'as':_0x3762c7['as'],'attributes':_0x3762c7[_0x49fd('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x49fd('0x10')](function(_0x8dc5b3){if(_0x3c082c[_0x49fd('0x1d')][_0x49fd('0x28')]===!![])_0x8dc5b3[_0x49fd('0x29')](_0x49fd('0x2a'),_0x8dc5b3[_0x49fd('0x2b')]());logger[_0x49fd('0x11')]('ShowMailAccount',_0x3c082c);logger[_0x49fd('0x13')]('ShowMailAccount',_0x3c082c,JSON[_0x49fd('0x15')](_0x8dc5b3));_0x492622(_0x8dc5b3);})[_0x49fd('0x1b')](function(_0x523ddf){logger[_0x49fd('0x16')](_0x49fd('0x25'),_0x523ddf['message'],_0x3c082c);_0x50d304(_0x390788[_0x49fd('0x16')](0x1f4,_0x523ddf['message']));});});};exports['NotifyMailAccount']=function(_0x5f56f8){var _0x10057b=this;return new Promise(function(_0x32982e,_0x36739b){var _0x3f73d3={'body':_0x5f56f8['body'],'channel':_0x49fd('0x2c')};var _0x2c3b7d=_[_0x49fd('0x2d')](_[_0x49fd('0x2e')](db[_0x49fd('0x2f')][_0x49fd('0x30')]),[_0x49fd('0x31'),_0x49fd('0x32'),'CompanyId',_0x49fd('0x33')]);var _0x2c8ab1=![];if(_0x5f56f8['body']['id']){delete _0x5f56f8[_0x49fd('0x34')]['id'];}if(_[_0x49fd('0x35')](_0x5f56f8['body'][_0x49fd('0x36')])){return _0x36739b(_0x10057b['error'](0x1f4,_0x49fd('0x37')));}if(_[_0x49fd('0x35')](_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x34')])||_0x5f56f8['body']['body']===''){return _0x36739b(_0x10057b[_0x49fd('0x16')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x49fd('0x35')](_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x38')])){return _0x36739b(_0x10057b[_0x49fd('0x16')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2c3b7d));}if(!_[_0x49fd('0x39')](_0x2c3b7d,_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x38')])){return _0x36739b(_0x10057b[_0x49fd('0x16')](0x1f4,_0x49fd('0x3a')+_0x2c3b7d));}var _0x30937f={};_0x30937f[_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x38')]]=_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x36')];return db[_0x49fd('0x1c')][_0x49fd('0x26')]({'where':{'id':_0x5f56f8[_0x49fd('0x3b')]['id']},'include':[{'model':db[_0x49fd('0x3c')],'as':'List','include':[{'model':db['CmContact'],'as':_0x49fd('0x3d'),'where':_0x30937f,'limit':0x1,'order':[[_0x49fd('0x32'),_0x49fd('0x3e')]]}]},{'model':db[_0x49fd('0x3f')],'as':'Applications'},{'model':db[_0x49fd('0x40')],'as':_0x49fd('0x41'),'include':[{'model':db['CloudProvider'],'as':_0x49fd('0x42')}]}]})[_0x49fd('0x10')](function(_0xaac56f){if(_0xaac56f&&_0xaac56f[_0x49fd('0x43')]){var _0x1316cb=_0xaac56f[_0x49fd('0x44')]({'plain':!![]});_0x3f73d3[_0x49fd('0x3b')]=_[_0x49fd('0x45')](_0x1316cb,[_0x49fd('0x46'),_0x49fd('0x43')]);_0x3f73d3[_0x49fd('0x3b')]['smtpOptions']=_0xaac56f[_0x49fd('0x2b')]();_0x3f73d3[_0x49fd('0x47')]=_0x1316cb[_0x49fd('0x46')];_0x3f73d3[_0x49fd('0x48')]=_0x1316cb[_0x49fd('0x43')];_0x3f73d3[_0x49fd('0x47')]=_['orderBy'](_0x3f73d3['applications'],[_0x49fd('0x49')],[_0x49fd('0x4a')]);if(_0x3f73d3[_0x49fd('0x3b')]&&_0x3f73d3['account'][_0x49fd('0x4b')]){_0x3f73d3[_0x49fd('0x47')]['push']({'id':0x0,'priority':_0x3f73d3['applications']['length']+0x1,'app':_0x49fd('0x4c'),'appdata':'autoclose','interval':'*,*,*,*'});}if(_0x3f73d3['account'][_0x49fd('0x46')]){delete _0x3f73d3[_0x49fd('0x3b')][_0x49fd('0x46')];}if(_0x3f73d3[_0x49fd('0x3b')][_0x49fd('0x43')]){delete _0x3f73d3[_0x49fd('0x3b')][_0x49fd('0x43')];}if(_0x1316cb[_0x49fd('0x43')][_0x49fd('0x3d')][_0x49fd('0x4d')]){return _0x1316cb['List'][_0x49fd('0x3d')][0x0];}var _0x202a86=_[_0x49fd('0xb')](_0x5f56f8[_0x49fd('0x34')],{'firstName':_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x36')],'ListId':_0x1316cb['ListId']});_0x202a86[_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x38')]]=_0x5f56f8['body']['from'];return db[_0x49fd('0x2f')]['create'](_0x202a86);}else{throw new Error(_0x49fd('0x4e'));}})['then'](function(_0x24b5a3){_0x3f73d3['contact']=_0x24b5a3;if(_0x24b5a3){if(!_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x19')]['messageId']){_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x19')][_0x49fd('0x4f')]=rs[_0x49fd('0x50')]()+'\x20'+_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x19')][_0x49fd('0x36')];}var _0x138dcc={'ContactId':_0x24b5a3['id'],'MailAccountId':_0x5f56f8['account']['id'],'inReplyTo':_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x19')][_0x49fd('0x4f')],'to':_0x5f56f8['body'][_0x49fd('0x19')][_0x49fd('0x36')],'cc':_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x19')]['cc'],'subject':_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x19')][_0x49fd('0x51')],'attach':_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x19')]['attach'],'lastMsgAt':moment()[_0x49fd('0x52')](_0x49fd('0x53')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x49fd('0x26')]({'where':{'closed':![],'MailAccountId':_0x5f56f8[_0x49fd('0x3b')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x19')][_0x49fd('0x54')]}}]})[_0x49fd('0x10')](function(_0xb1e0f3){if(_0xb1e0f3){return[_0xb1e0f3,![]];}return db['MailInteraction'][_0x49fd('0x55')](_0x138dcc)['then'](function(_0x418673){return[_0x418673,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x49fd('0x56')](function(_0x1a8da2,_0x234e2a){if(_0x1a8da2){_0x2c8ab1=_0x234e2a;if(!_0x234e2a){return _0x1a8da2[_0x49fd('0x57')]({'inReplyTo':_0x5f56f8['body'][_0x49fd('0x19')][_0x49fd('0x4f')],'to':_0x5f56f8['body'][_0x49fd('0x19')][_0x49fd('0x36')],'cc':_0x5f56f8[_0x49fd('0x34')]['message']['cc'],'subject':_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x19')][_0x49fd('0x51')],'attach':_0x1a8da2[_0x49fd('0x58')]?_0x1a8da2[_0x49fd('0x58')]:_0x5f56f8[_0x49fd('0x34')]['message']['attach'],'substatus':null,'substatusAt':moment()[_0x49fd('0x52')](_0x49fd('0x53')),'lastMsgAt':moment()[_0x49fd('0x52')](_0x49fd('0x53')),'lastMsgDirection':'in'});}else{return _0x1a8da2;}}})[_0x49fd('0x10')](function(_0xdc81cf){_0x3f73d3[_0x49fd('0x59')]=_0xdc81cf[_0x49fd('0x44')]({'plain':!![]});_0x3f73d3[_0x49fd('0x59')][_0x49fd('0x5a')]=_0x2c8ab1;return db[_0x49fd('0x5b')][_0x49fd('0x55')]({'body':_0x5f56f8[_0x49fd('0x34')]['body'],'MailAccountId':_0x5f56f8[_0x49fd('0x3b')]['id'],'MailInteractionId':_0xdc81cf['id'],'direction':'in','ContactId':_0x3f73d3[_0x49fd('0x5c')]['id'],'messageId':_0x5f56f8[_0x49fd('0x34')]['message']['messageId'],'from':_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x19')][_0x49fd('0x36')],'to':_0x5f56f8['body'][_0x49fd('0x19')]['to'],'cc':_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x19')]['cc'],'subject':_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x19')][_0x49fd('0x51')],'attach':_0x5f56f8[_0x49fd('0x34')]['message']['attach'],'Attachments':_0x5f56f8[_0x49fd('0x34')]['message'][_0x49fd('0x5d')],'originTo':_0x5f56f8['body']['message']['originTo'],'originCc':_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x19')]['originCc'],'bcc':_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x19')]['bcc'],'ChatWebsiteId':_0x5f56f8[_0x49fd('0x34')][_0x49fd('0x19')]['ChatWebsiteId']||null,'originChannel':_0x5f56f8[_0x49fd('0x34')]['message'][_0x49fd('0x5e')]||_0x49fd('0x5f'),'ChatOfflineMessageId':_0x5f56f8['body'][_0x49fd('0x19')][_0x49fd('0x60')]||null},{'include':[{'model':db['Attachment'],'as':_0x49fd('0x61')}]});})[_0x49fd('0x10')](function(_0x2e4f40){_0x3f73d3[_0x49fd('0x19')]=_0x2e4f40;if(!_0x3f73d3[_0x49fd('0x59')][_0x49fd('0x62')]){return;}return db[_0x49fd('0x63')][_0x49fd('0x26')]({'attributes':['id','name'],'where':{'id':_0x3f73d3['interaction'][_0x49fd('0x62')]}});})[_0x49fd('0x10')](function(_0x555a87){if(_0x555a87){_0x3f73d3[_0x49fd('0x47')][_0x49fd('0x64')]({'id':0x0,'priority':0x0,'app':_0x49fd('0x65'),'appdata':_0x555a87[_0x49fd('0x66')]+','+(_0x3f73d3[_0x49fd('0x3b')][_0x49fd('0x67')]||0xa),'interval':_0x49fd('0x68')});}if(!_0x3f73d3['interaction'][_0x49fd('0x69')]){return;}return db[_0x49fd('0x6a')][_0x49fd('0x26')]({'attributes':['id',_0x49fd('0x66')],'where':{'id':_0x3f73d3[_0x49fd('0x59')][_0x49fd('0x69')]}});})[_0x49fd('0x10')](function(_0x545740){if(_0x545740){_0x3f73d3[_0x49fd('0x47')][_0x49fd('0x64')]({'id':0x0,'priority':0x1,'app':_0x49fd('0x6b'),'appdata':_0x545740[_0x49fd('0x66')]+','+(_0x3f73d3[_0x49fd('0x3b')][_0x49fd('0x6c')]||0x12c),'interval':_0x49fd('0x68')});}return respondWithRpcPromise(_0x49fd('0x6d'),_0x49fd('0x6e'),_0x3f73d3);})[_0x49fd('0x10')](function(_0x41342e){_0x32982e(_0x41342e);})[_0x49fd('0x1b')](function(_0x23a779){_0x36739b(_0x10057b[_0x49fd('0x16')](0x1f4,_0x23a779[_0x49fd('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index c5f2f39..c4afc7f 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 _0xc664=['emit','removeListener','register','length','./mailAccount.events','save','update'];(function(_0x45941e,_0x370c2f){var _0x55dd9f=function(_0x5b5e7b){while(--_0x5b5e7b){_0x45941e['push'](_0x45941e['shift']());}};_0x55dd9f(++_0x370c2f);}(_0xc664,0x90));var _0x4c66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc664[_0x3dd15e];return _0x231fd0;};'use strict';var MailAccountEvents=require(_0x4c66('0x0'));var events=[_0x4c66('0x1'),'remove',_0x4c66('0x2')];function createListener(_0xe20ccb,_0x2afeb8){return function(_0x316288){_0x2afeb8[_0x4c66('0x3')](_0xe20ccb,_0x316288);};}function removeListener(_0x54aa28,_0x138261){return function(){MailAccountEvents[_0x4c66('0x4')](_0x54aa28,_0x138261);};}exports[_0x4c66('0x5')]=function(_0x28a065){for(var _0x4ecac0=0x0,_0x14ceba=events[_0x4c66('0x6')];_0x4ecac0<_0x14ceba;_0x4ecac0++){var _0x406aec=events[_0x4ecac0];var _0x47fb8e=createListener('mailAccount:'+_0x406aec,_0x28a065);MailAccountEvents['on'](_0x406aec,_0x47fb8e);}}; \ No newline at end of file +var _0x213c=['removeListener','register','length','mailAccount:','./mailAccount.events','remove','update','emit'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x213c,0xc4));var _0xc213=function(_0xe628d4,_0x39b1ff){_0xe628d4=_0xe628d4-0x0;var _0x21a58d=_0x213c[_0xe628d4];return _0x21a58d;};'use strict';var MailAccountEvents=require(_0xc213('0x0'));var events=['save',_0xc213('0x1'),_0xc213('0x2')];function createListener(_0x496ac1,_0x2714bb){return function(_0x3e68ee){_0x2714bb[_0xc213('0x3')](_0x496ac1,_0x3e68ee);};}function removeListener(_0x2a25ff,_0x3503de){return function(){MailAccountEvents[_0xc213('0x4')](_0x2a25ff,_0x3503de);};}exports[_0xc213('0x5')]=function(_0x48b853){for(var _0x3a8d56=0x0,_0x296daf=events[_0xc213('0x6')];_0x3a8d56<_0x296daf;_0x3a8d56++){var _0x1718f9=events[_0x3a8d56];var _0x137ff3=createListener(_0xc213('0x7')+_0x1718f9,_0x48b853);MailAccountEvents['on'](_0x1718f9,_0x137ff3);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index db67560..aae730e 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 _0xf7fa=['../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1d4c2e,_0x5531cc){var _0x23c798=function(_0x28c14a){while(--_0x28c14a){_0x1d4c2e['push'](_0x1d4c2e['shift']());}};_0x23c798(++_0x5531cc);}(_0xf7fa,0x1e8));var _0xaf7f=function(_0x13b5bb,_0x28df18){_0x13b5bb=_0x13b5bb-0x0;var _0x49e8c6=_0xf7fa[_0x13b5bb];return _0x49e8c6;};'use strict';var multer=require(_0xaf7f('0x0'));var util=require(_0xaf7f('0x1'));var path=require(_0xaf7f('0x2'));var timeout=require(_0xaf7f('0x3'));var express=require(_0xaf7f('0x4'));var router=express[_0xaf7f('0x5')]();var fs_extra=require(_0xaf7f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xaf7f('0x7'));var config=require(_0xaf7f('0x8'));var controller=require(_0xaf7f('0x9'));router['get'](_0xaf7f('0xa'),auth[_0xaf7f('0xb')](),controller[_0xaf7f('0xc')]);router['put']('/:id',auth[_0xaf7f('0xb')](),controller['update']);router['delete'](_0xaf7f('0xa'),auth[_0xaf7f('0xb')](),controller[_0xaf7f('0xd')]);module[_0xaf7f('0xe')]=router; \ No newline at end of file +var _0x2e59=['destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','delete'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x2e59,0xb1));var _0x92e5=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x2e59[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0x92e5('0x0'));var util=require('util');var path=require(_0x92e5('0x1'));var timeout=require(_0x92e5('0x2'));var express=require(_0x92e5('0x3'));var router=express[_0x92e5('0x4')]();var fs_extra=require(_0x92e5('0x5'));var auth=require(_0x92e5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x92e5('0x7'));var controller=require(_0x92e5('0x8'));router[_0x92e5('0x9')](_0x92e5('0xa'),auth[_0x92e5('0xb')](),controller[_0x92e5('0xc')]);router[_0x92e5('0xd')](_0x92e5('0xa'),auth[_0x92e5('0xb')](),controller['update']);router[_0x92e5('0xe')](_0x92e5('0xa'),auth['isAuthenticated'](),controller[_0x92e5('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 0cdb1f1..1a67143 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 _0x9fcd=['noop','TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x1e271c,_0x8632e1){var _0x547231=function(_0x785f5a){while(--_0x785f5a){_0x1e271c['push'](_0x1e271c['shift']());}};_0x547231(++_0x8632e1);}(_0x9fcd,0x15b));var _0xd9fc=function(_0x35cf0e,_0x2b326a){_0x35cf0e=_0x35cf0e-0x0;var _0x1e2b61=_0x9fcd[_0x35cf0e];return _0x1e2b61;};'use strict';var Sequelize=require(_0xd9fc('0x0'));module[_0xd9fc('0x1')]={'priority':{'type':Sequelize[_0xd9fc('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd9fc('0x3')},'appdata':{'type':Sequelize[_0xd9fc('0x4')]()},'description':{'type':Sequelize[_0xd9fc('0x5')]},'interval':{'type':Sequelize[_0xd9fc('0x5')],'defaultValue':_0xd9fc('0x6')}}; \ No newline at end of file +var _0x383d=['INTEGER','noop','TEXT','STRING','*,*,*,*','exports'];(function(_0x1fade5,_0x4ec84b){var _0x14626c=function(_0x982710){while(--_0x982710){_0x1fade5['push'](_0x1fade5['shift']());}};_0x14626c(++_0x4ec84b);}(_0x383d,0xe9));var _0xd383=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x383d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xd383('0x0')]={'priority':{'type':Sequelize[_0xd383('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd383('0x2')},'appdata':{'type':Sequelize[_0xd383('0x3')]()},'description':{'type':Sequelize[_0xd383('0x4')]},'interval':{'type':Sequelize[_0xd383('0x4')],'defaultValue':_0xd383('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 143e92c..d8c91f7 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 _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','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','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x2aa05c,_0x53ae4c){var _0x424664=function(_0x14c7ac){while(--_0x14c7ac){_0x2aa05c['push'](_0x2aa05c['shift']());}};_0x424664(++_0x53ae4c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0xcb91[_0x4bcf38];return _0x4a89be;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file +var _0xf4eb=['limit','count','Content-Range','json','apply','reject','save','then','destroy','error','name','send','params','keys','MailApplication','rawAttributes','query','filters','intersection','model','fields','attributes','includeAll','include','options','find','catch','body','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined'];(function(_0x110100,_0x43d23b){var _0x4172a8=function(_0x59cc8d){while(--_0x59cc8d){_0x110100['push'](_0x110100['shift']());}};_0x4172a8(++_0x43d23b);}(_0xf4eb,0xec));var _0xbf4e=function(_0x262bab,_0xe70807){_0x262bab=_0x262bab-0x0;var _0x35c381=_0xf4eb[_0x262bab];return _0x35c381;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){_0x51648c[_0xbf4e('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90635e,_0x36688a){return function(_0x3d6863){if(!_0x3d6863){_0x90635e['sendStatus'](0x194);}return _0x3d6863;};}function handleError(_0x2fb490,_0x5e08b1){_0x5e08b1=_0x5e08b1||0x1f4;return function(_0x5bcf71){logger[_0xbf4e('0x21')](_0x5bcf71['stack']);if(_0x5bcf71[_0xbf4e('0x22')]){delete _0x5bcf71[_0xbf4e('0x22')];}_0x2fb490[_0xbf4e('0x14')](_0x5e08b1)[_0xbf4e('0x23')](_0x5bcf71);};}exports['show']=function(_0x2d4686,_0x8e0ab5){var _0x43879d={'raw':!![],'where':{'id':_0x2d4686[_0xbf4e('0x24')]['id']}},_0x4cd4a1={};_0x4cd4a1['model']=_[_0xbf4e('0x25')](db[_0xbf4e('0x26')][_0xbf4e('0x27')]);_0x4cd4a1['query']=_[_0xbf4e('0x25')](_0x2d4686[_0xbf4e('0x28')]);_0x4cd4a1[_0xbf4e('0x29')]=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],_0x4cd4a1[_0xbf4e('0x28')]);_0x43879d['attributes']=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],qs['fields'](_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2c')]));_0x43879d['attributes']=_0x43879d[_0xbf4e('0x2d')]['length']?_0x43879d[_0xbf4e('0x2d')]:_0x4cd4a1['model'];if(_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2e')]){_0x43879d[_0xbf4e('0x2f')]=[{'all':!![]}];}_0x43879d=_['merge']({},_0x43879d,_0x2d4686[_0xbf4e('0x30')]);return db[_0xbf4e('0x26')][_0xbf4e('0x31')](_0x43879d)[_0xbf4e('0x1f')](handleEntityNotFound(_0x8e0ab5,null))[_0xbf4e('0x1f')](respondWithResult(_0x8e0ab5,null))[_0xbf4e('0x32')](handleError(_0x8e0ab5,null));};exports['update']=function(_0x99b320,_0x3dbb2b){if(_0x99b320[_0xbf4e('0x33')]['id']){delete _0x99b320[_0xbf4e('0x33')]['id'];}return db[_0xbf4e('0x26')]['find']({'where':{'id':_0x99b320['params']['id']}})['then'](handleEntityNotFound(_0x3dbb2b,null))['then'](saveUpdates(_0x99b320[_0xbf4e('0x33')],null))[_0xbf4e('0x1f')](respondWithResult(_0x3dbb2b,null))[_0xbf4e('0x32')](handleError(_0x3dbb2b,null));};exports[_0xbf4e('0x20')]=function(_0x22ddde,_0x257b74){return db[_0xbf4e('0x26')][_0xbf4e('0x31')]({'where':{'id':_0x22ddde[_0xbf4e('0x24')]['id']}})['then'](handleEntityNotFound(_0x257b74,null))['then'](removeEntity(_0x257b74,null))[_0xbf4e('0x32')](handleError(_0x257b74,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index bd761f4..61396d4 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 _0x0661=['path','rimraf','../../config/environment','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x28e7e1,_0x45f235){var _0x1d8a9e=function(_0x3e50cc){while(--_0x3e50cc){_0x28e7e1['push'](_0x28e7e1['shift']());}};_0x1d8a9e(++_0x45f235);}(_0x0661,0x9a));var _0x1066=function(_0x268186,_0x4dc3e4){_0x268186=_0x268186-0x0;var _0x3c3d1a=_0x0661[_0x268186];return _0x3c3d1a;};'use strict';var _=require(_0x1066('0x0'));var util=require('util');var logger=require(_0x1066('0x1'))(_0x1066('0x2'));var moment=require(_0x1066('0x3'));var BPromise=require(_0x1066('0x4'));var rp=require(_0x1066('0x5'));var fs=require('fs');var path=require(_0x1066('0x6'));var rimraf=require(_0x1066('0x7'));var config=require(_0x1066('0x8'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0x57ed73,_0x54e51c){return _0x57ed73['define']('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1066('0x9')});}; \ No newline at end of file +var _0x392b=['mail_applications','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./mailApplication.attributes','exports','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x392b,0x182));var _0xb392=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x392b[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0xb392('0x0'));var logger=require(_0xb392('0x1'))(_0xb392('0x2'));var moment=require(_0xb392('0x3'));var BPromise=require(_0xb392('0x4'));var rp=require(_0xb392('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb392('0x6'));var config=require('../../config/environment');var attributes=require(_0xb392('0x7'));module[_0xb392('0x8')]=function(_0x311b2b,_0x270b5b){return _0x311b2b[_0xb392('0x9')]('MailApplication',attributes,{'tableName':_0xb392('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb392('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 6c19cba..20f270b 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 _0xc15c=['MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','UpdateMailApplication','body','options','raw','attributes','limit','moment','bluebird','randomstring','../../mysqldb','rpc','client','http','request','then','info'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xc15c,0xae));var _0xcc15=function(_0x58bfbb,_0x1833e){_0x58bfbb=_0x58bfbb-0x0;var _0x2b3c99=_0xc15c[_0x58bfbb];return _0x2b3c99;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcc15('0x0'));var BPromise=require(_0xcc15('0x1'));var rs=require(_0xcc15('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc15('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcc15('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcc15('0x5')][_0xcc15('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x597a7e,_0x5a5a15,_0x5de043){return new BPromise(function(_0x25fee6,_0x16c0bd){return client[_0xcc15('0x7')](_0x597a7e,_0x5de043)[_0xcc15('0x8')](function(_0x5eafea){logger[_0xcc15('0x9')](_0xcc15('0xa'),_0x5a5a15,_0xcc15('0xb'));logger[_0xcc15('0xc')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x5a5a15,_0xcc15('0xb'),JSON[_0xcc15('0xd')](_0x5eafea));if(_0x5eafea[_0xcc15('0xe')]){if(_0x5eafea['error']['code']===0x1f4){logger[_0xcc15('0xe')]('MailApplication,\x20%s,\x20%s',_0x5a5a15,_0x5eafea[_0xcc15('0xe')]['message']);return _0x16c0bd(_0x5eafea[_0xcc15('0xe')]['message']);}logger[_0xcc15('0xe')]('MailApplication,\x20%s,\x20%s',_0x5a5a15,_0x5eafea[_0xcc15('0xe')][_0xcc15('0xf')]);return _0x25fee6(_0x5eafea[_0xcc15('0xe')][_0xcc15('0xf')]);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x5a5a15,'request\x20sent');_0x25fee6(_0x5eafea['result'][_0xcc15('0xf')]);}})[_0xcc15('0x10')](function(_0x1b1882){logger['error']('MailApplication,\x20%s,\x20%s',_0x5a5a15,_0x1b1882);_0x16c0bd(_0x1b1882);});});}exports[_0xcc15('0x11')]=function(_0x5ca31a){var _0x329fee=this;return new Promise(function(_0x293f7c,_0x385506){return db['MailApplication']['update'](_0x5ca31a[_0xcc15('0x12')],{'raw':_0x5ca31a[_0xcc15('0x13')]?_0x5ca31a['options'][_0xcc15('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ca31a[_0xcc15('0x13')]?_0x5ca31a[_0xcc15('0x13')]['where']||null:null,'attributes':_0x5ca31a[_0xcc15('0x13')]?_0x5ca31a['options'][_0xcc15('0x15')]||null:null,'limit':_0x5ca31a['options']?_0x5ca31a[_0xcc15('0x13')][_0xcc15('0x16')]||null:null})[_0xcc15('0x8')](function(_0xe5a582){logger['info'](_0xcc15('0x11'),_0x5ca31a);logger[_0xcc15('0xc')](_0xcc15('0x11'),_0x5ca31a,JSON[_0xcc15('0xd')](_0xe5a582));_0x293f7c(_0xe5a582);})['catch'](function(_0x2a3e2b){logger[_0xcc15('0xe')]('UpdateMailApplication',_0x2a3e2b['message'],_0x5ca31a);_0x385506(_0x329fee[_0xcc15('0xe')](0x1f4,_0x2a3e2b[_0xcc15('0xf')]));});});}; \ No newline at end of file +var _0x77ff=['util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','MailApplication','update','body','options','raw','attributes','UpdateMailApplication'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0x77ff,0x168));var _0xf77f=function(_0x12aab7,_0x10fa9a){_0x12aab7=_0x12aab7-0x0;var _0x16b408=_0x77ff[_0x12aab7];return _0x16b408;};'use strict';var _=require('lodash');var util=require(_0xf77f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf77f('0x1'))['db'];var utils=require(_0xf77f('0x2'));var logger=require(_0xf77f('0x3'))('rpc');var config=require(_0xf77f('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf77f('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x4f689e,_0x594382,_0x9df472){return new BPromise(function(_0x120174,_0x39b60b){return client['request'](_0x4f689e,_0x9df472)[_0xf77f('0x6')](function(_0xc9bcf7){logger['info'](_0xf77f('0x7'),_0x594382,_0xf77f('0x8'));logger[_0xf77f('0x9')](_0xf77f('0xa'),_0x594382,_0xf77f('0x8'),JSON[_0xf77f('0xb')](_0xc9bcf7));if(_0xc9bcf7[_0xf77f('0xc')]){if(_0xc9bcf7['error']['code']===0x1f4){logger[_0xf77f('0xc')](_0xf77f('0x7'),_0x594382,_0xc9bcf7[_0xf77f('0xc')][_0xf77f('0xd')]);return _0x39b60b(_0xc9bcf7[_0xf77f('0xc')][_0xf77f('0xd')]);}logger['error'](_0xf77f('0x7'),_0x594382,_0xc9bcf7['error']['message']);return _0x120174(_0xc9bcf7[_0xf77f('0xc')][_0xf77f('0xd')]);}else{logger[_0xf77f('0xe')](_0xf77f('0x7'),_0x594382,_0xf77f('0x8'));_0x120174(_0xc9bcf7[_0xf77f('0xf')][_0xf77f('0xd')]);}})[_0xf77f('0x10')](function(_0x350b1b){logger['error'](_0xf77f('0x7'),_0x594382,_0x350b1b);_0x39b60b(_0x350b1b);});});}exports['UpdateMailApplication']=function(_0x2c8447){var _0x384b4a=this;return new Promise(function(_0x11aa2f,_0x7f137){return db[_0xf77f('0x11')][_0xf77f('0x12')](_0x2c8447[_0xf77f('0x13')],{'raw':_0x2c8447[_0xf77f('0x14')]?_0x2c8447[_0xf77f('0x14')][_0xf77f('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c8447[_0xf77f('0x14')]?_0x2c8447['options']['where']||null:null,'attributes':_0x2c8447['options']?_0x2c8447[_0xf77f('0x14')][_0xf77f('0x16')]||null:null,'limit':_0x2c8447['options']?_0x2c8447[_0xf77f('0x14')]['limit']||null:null})[_0xf77f('0x6')](function(_0x4c0854){logger[_0xf77f('0xe')](_0xf77f('0x17'),_0x2c8447);logger[_0xf77f('0x9')](_0xf77f('0x17'),_0x2c8447,JSON[_0xf77f('0xb')](_0x4c0854));_0x11aa2f(_0x4c0854);})[_0xf77f('0x10')](function(_0x4a987b){logger[_0xf77f('0xc')](_0xf77f('0x17'),_0x4a987b[_0xf77f('0xd')],_0x2c8447);_0x7f137(_0x384b4a['error'](0x1f4,_0x4a987b[_0xf77f('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 1645ebe..4da57f2 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 _0xfa9d=['express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/describe','describe','show','/:id/messages','getMessages','download','create','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','put','/:id','mailinteraction:update','update','delete','mailinteraction:destroy','removeTags','exports'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xfa9d,0x17a));var _0xdfa9=function(_0x14fbf9,_0x565494){_0x14fbf9=_0x14fbf9-0x0;var _0x3d37fb=_0xfa9d[_0x14fbf9];return _0x3d37fb;};'use strict';var express=require(_0xdfa9('0x0'));var router=express['Router']();var auth=require(_0xdfa9('0x1'));var interaction=require(_0xdfa9('0x2'));var controller=require(_0xdfa9('0x3'));router[_0xdfa9('0x4')]('/',auth[_0xdfa9('0x5')](),controller['index']);router[_0xdfa9('0x4')](_0xdfa9('0x6'),auth[_0xdfa9('0x5')](),controller[_0xdfa9('0x7')]);router['get']('/:id',auth[_0xdfa9('0x5')](),controller[_0xdfa9('0x8')]);router[_0xdfa9('0x4')](_0xdfa9('0x9'),auth[_0xdfa9('0x5')](),controller[_0xdfa9('0xa')]);router[_0xdfa9('0x4')]('/:id/download',auth[_0xdfa9('0x5')](),controller[_0xdfa9('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdfa9('0xc')]);router[_0xdfa9('0xd')](_0xdfa9('0x9'),auth[_0xdfa9('0x5')](),controller[_0xdfa9('0xe')]);router[_0xdfa9('0xd')](_0xdfa9('0xf'),auth[_0xdfa9('0x5')](),interaction[_0xdfa9('0x10')](_0xdfa9('0x11'),_0xdfa9('0x12')),controller['addTags']);router[_0xdfa9('0x13')](_0xdfa9('0x14'),auth['isAuthenticated'](),interaction[_0xdfa9('0x10')](_0xdfa9('0x11'),_0xdfa9('0x15')),controller[_0xdfa9('0x16')]);router[_0xdfa9('0x17')](_0xdfa9('0x14'),auth[_0xdfa9('0x5')](),interaction['tracked'](_0xdfa9('0x11'),_0xdfa9('0x18')),controller['destroy']);router['delete'](_0xdfa9('0xf'),auth['isAuthenticated'](),controller[_0xdfa9('0x19')]);module[_0xdfa9('0x1a')]=router; \ No newline at end of file +var _0x9a07=['put','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags'];(function(_0x3ef532,_0x23d6a0){var _0x842155=function(_0x56f965){while(--_0x56f965){_0x3ef532['push'](_0x3ef532['shift']());}};_0x842155(++_0x23d6a0);}(_0x9a07,0xc4));var _0x79a0=function(_0xd470e6,_0x3f4d52){_0xd470e6=_0xd470e6-0x0;var _0x46e16b=_0x9a07[_0xd470e6];return _0x46e16b;};'use strict';var express=require(_0x79a0('0x0'));var router=express[_0x79a0('0x1')]();var auth=require(_0x79a0('0x2'));var interaction=require(_0x79a0('0x3'));var controller=require(_0x79a0('0x4'));router['get']('/',auth[_0x79a0('0x5')](),controller['index']);router[_0x79a0('0x6')](_0x79a0('0x7'),auth[_0x79a0('0x5')](),controller[_0x79a0('0x8')]);router[_0x79a0('0x6')](_0x79a0('0x9'),auth[_0x79a0('0x5')](),controller[_0x79a0('0xa')]);router[_0x79a0('0x6')](_0x79a0('0xb'),auth['isAuthenticated'](),controller[_0x79a0('0xc')]);router[_0x79a0('0x6')]('/:id/download',auth[_0x79a0('0x5')](),controller['download']);router[_0x79a0('0xd')]('/',auth[_0x79a0('0x5')](),controller[_0x79a0('0xe')]);router[_0x79a0('0xd')](_0x79a0('0xb'),auth[_0x79a0('0x5')](),controller[_0x79a0('0xf')]);router['post'](_0x79a0('0x10'),auth['isAuthenticated'](),interaction[_0x79a0('0x11')](_0x79a0('0x12'),_0x79a0('0x13')),controller['addTags']);router[_0x79a0('0x14')](_0x79a0('0x9'),auth['isAuthenticated'](),interaction[_0x79a0('0x11')]('mail','mailinteraction:update'),controller[_0x79a0('0x15')]);router[_0x79a0('0x16')]('/:id',auth[_0x79a0('0x5')](),interaction[_0x79a0('0x11')](_0x79a0('0x12'),_0x79a0('0x17')),controller[_0x79a0('0x18')]);router[_0x79a0('0x16')](_0x79a0('0x10'),auth[_0x79a0('0x5')](),controller[_0x79a0('0x19')]);module[_0x79a0('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 47b1e79..f87ba2c 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 _0x18a9=['DATE','STRING','TEXT','long','ENUM','out','INTEGER','iconv','exports','BOOLEAN'];(function(_0x23a2b7,_0x23eb3c){var _0x2b2ff7=function(_0x92eadf){while(--_0x92eadf){_0x23a2b7['push'](_0x23a2b7['shift']());}};_0x2b2ff7(++_0x23eb3c);}(_0x18a9,0x1b5));var _0x918a=function(_0x513e3e,_0x5d8cf1){_0x513e3e=_0x513e3e-0x0;var _0x30cae2=_0x18a9[_0x513e3e];return _0x30cae2;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x918a('0x0'));module[_0x918a('0x1')]={'closed':{'type':Sequelize[_0x918a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x918a('0x3')]},'disposition':{'type':Sequelize[_0x918a('0x4')]},'secondDisposition':{'type':Sequelize[_0x918a('0x4')]},'thirdDisposition':{'type':Sequelize[_0x918a('0x4')]},'note':{'type':Sequelize[_0x918a('0x4')]},'inReplyTo':{'type':Sequelize[_0x918a('0x4')](0x1fe)},'to':{'type':Sequelize[_0x918a('0x4')]},'cc':{'type':Sequelize[_0x918a('0x5')](_0x918a('0x6'))},'subject':{'type':Sequelize[_0x918a('0x5')]()},'attach':{'type':Sequelize[_0x918a('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x918a('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x918a('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x918a('0x7')]('in',_0x918a('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x918a('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x918a('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x918a('0x9')]}}; \ No newline at end of file +var _0x249f=['ENUM','out','iconv','exports','BOOLEAN','DATE','STRING','TEXT'];(function(_0xd47797,_0xd0ef0){var _0x2e8582=function(_0x297d38){while(--_0x297d38){_0xd47797['push'](_0xd47797['shift']());}};_0x2e8582(++_0xd0ef0);}(_0x249f,0xaa));var _0xf249=function(_0x1b948f,_0x2cfbb6){_0x1b948f=_0x1b948f-0x0;var _0x1ca9e4=_0x249f[_0x1b948f];return _0x1ca9e4;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xf249('0x0'));module[_0xf249('0x1')]={'closed':{'type':Sequelize[_0xf249('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf249('0x3')]},'disposition':{'type':Sequelize[_0xf249('0x4')]},'secondDisposition':{'type':Sequelize[_0xf249('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf249('0x4')]},'inReplyTo':{'type':Sequelize[_0xf249('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xf249('0x5')]('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xf249('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xf249('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xf249('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xf249('0x6')]('in',_0xf249('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf249('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xf249('0x6')]('in',_0xf249('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf249('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index ab28bf4..2255b53 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 _0xdf86=['eml-format','zip-dir','moment','bluebird','util','lodash','juice','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','query','show','model','keys','MailInteraction','filters','attributes','intersection','fields','length','includeAll','include','options','find','catch','create','body','params','describe','MailMessage','addMessage','ids','omit','findOne','hasOwnProperty','nolimit','sort','pick','where','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','rows','addTags','setTags','spread','Tag','color','emit','removeTags','unix','toString','join','root','server','files','transcript-%d-%s.zip','attachments','push','Attachment','Messages','from','bcc','subject','createdAt','get','each','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','basename','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xdf86,0xe2));var _0x6df8=function(_0x1c6ef2,_0x8d926a){_0x1c6ef2=_0x1c6ef2-0x0;var _0x404b8c=_0xdf86[_0x1c6ef2];return _0x404b8c;};'use strict';var emlformat=require(_0x6df8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6df8('0x1'));var moment=require(_0x6df8('0x2'));var BPromise=require(_0x6df8('0x3'));var util=require(_0x6df8('0x4'));var path=require('path');var fs=require('fs');var _=require(_0x6df8('0x5'));var juice=require(_0x6df8('0x6'));var Redis=require('ioredis');var interaction=require(_0x6df8('0x7'));var qs=require(_0x6df8('0x8'));var logger=require(_0x6df8('0x9'))('api');var config=require(_0x6df8('0xa'));var db=require(_0x6df8('0xb'))['db'];var htmlEntities=require(_0x6df8('0xc'));config[_0x6df8('0xd')]=_[_0x6df8('0xe')](config[_0x6df8('0xd')],{'host':_0x6df8('0xf'),'port':0x18eb});var socket=require(_0x6df8('0x10'))(new Redis(config[_0x6df8('0xd')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x1827e,_0x140e56){_0x140e56=_0x140e56||0xcc;return function(_0x1a63c2){if(_0x1a63c2){return _0x1827e[_0x6df8('0x11')](_0x140e56);}return _0x1827e['status'](_0x140e56)[_0x6df8('0x12')]();};}function respondWithResult(_0x2f474f,_0x1d2bf4){_0x1d2bf4=_0x1d2bf4||0xc8;return function(_0x47b298){if(_0x47b298){return _0x2f474f['status'](_0x1d2bf4)[_0x6df8('0x13')](_0x47b298);}};}function respondWithFilteredResult(_0x27fa84,_0x3cdc04){return function(_0x5369ee){if(_0x5369ee){var _0xb66ca5=typeof _0x3cdc04[_0x6df8('0x14')]===_0x6df8('0x15')&&typeof _0x3cdc04[_0x6df8('0x16')]===_0x6df8('0x15');var _0x426de2=_0x5369ee[_0x6df8('0x17')];var _0x23ebff=_0xb66ca5?0x0:_0x3cdc04[_0x6df8('0x14')];var _0x274cc8=_0xb66ca5?_0x5369ee[_0x6df8('0x17')]:_0x3cdc04['offset']+_0x3cdc04[_0x6df8('0x16')];var _0x29637f;if(_0x274cc8>=_0x426de2){_0x274cc8=_0x426de2;_0x29637f=0xc8;}else{_0x29637f=0xce;}_0x27fa84['status'](_0x29637f);return _0x27fa84[_0x6df8('0x18')](_0x6df8('0x19'),_0x23ebff+'-'+_0x274cc8+'/'+_0x426de2)[_0x6df8('0x13')](_0x5369ee);}return null;};}function saveUpdates(_0x3763ef){return function(_0x50d64d){if(_0x50d64d){return _0x50d64d[_0x6df8('0x1a')](_0x3763ef)[_0x6df8('0x1b')](function(_0x125214){return _0x125214;});}return null;};}function removeEntity(_0x612d05){return function(_0x3e5827){if(_0x3e5827){return _0x3e5827[_0x6df8('0x1c')]()[_0x6df8('0x1b')](function(){_0x612d05['status'](0xcc)[_0x6df8('0x12')]();});}};}function handleEntityNotFound(_0x10f9c0){return function(_0xc6dee0){if(!_0xc6dee0){_0x10f9c0[_0x6df8('0x11')](0x194);}return _0xc6dee0;};}function handleError(_0x2e8a36,_0x4fe4e1){_0x4fe4e1=_0x4fe4e1||0x1f4;return function(_0x240820){logger[_0x6df8('0x1d')](_0x240820['stack']);if(_0x240820[_0x6df8('0x1e')]){delete _0x240820['name'];}_0x2e8a36['status'](_0x4fe4e1)[_0x6df8('0x1f')](_0x240820);};}exports[_0x6df8('0x20')]=function(_0x4d15d6,_0x217b75){var _0x2d3927={};var _0x43ee6c=_[_0x6df8('0x21')](db['MailInteraction'][_0x6df8('0x22')],function(_0x7184f6){return{'name':_0x7184f6[_0x6df8('0x23')],'type':_0x7184f6[_0x6df8('0x24')][_0x6df8('0x25')]};});_0x2d3927=qs[_0x6df8('0x26')](_0x43ee6c,_0x4d15d6);return interaction[_0x6df8('0x27')]('mail',_0x4d15d6[_0x6df8('0x28')],_0x4d15d6['user'],_0x2d3927,_0x43ee6c)[_0x6df8('0x1b')](respondWithFilteredResult(_0x217b75,_0x2d3927))['catch'](handleError(_0x217b75,null));};exports[_0x6df8('0x29')]=function(_0x2be110,_0x825e7f){var _0xc7eb3a={'raw':![],'where':{'id':_0x2be110['params']['id']}},_0x1377e4={};_0x1377e4[_0x6df8('0x2a')]=_[_0x6df8('0x2b')](db[_0x6df8('0x2c')][_0x6df8('0x22')]);_0x1377e4[_0x6df8('0x28')]=_['keys'](_0x2be110['query']);_0x1377e4[_0x6df8('0x2d')]=_['intersection'](_0x1377e4[_0x6df8('0x2a')],_0x1377e4[_0x6df8('0x28')]);_0xc7eb3a[_0x6df8('0x2e')]=_[_0x6df8('0x2f')](_0x1377e4['model'],qs[_0x6df8('0x30')](_0x2be110['query'][_0x6df8('0x30')]));_0xc7eb3a[_0x6df8('0x2e')]=_0xc7eb3a['attributes'][_0x6df8('0x31')]?_0xc7eb3a[_0x6df8('0x2e')]:_0x1377e4[_0x6df8('0x2a')];if(_0x2be110['query'][_0x6df8('0x32')]){_0xc7eb3a[_0x6df8('0x33')]=[{'all':!![]}];}_0xc7eb3a=_['merge']({},_0xc7eb3a,_0x2be110[_0x6df8('0x34')]);return db[_0x6df8('0x2c')][_0x6df8('0x35')](_0xc7eb3a)[_0x6df8('0x1b')](handleEntityNotFound(_0x825e7f,null))[_0x6df8('0x1b')](respondWithResult(_0x825e7f,null))[_0x6df8('0x36')](handleError(_0x825e7f,null));};exports['create']=function(_0xa6e0d0,_0x200542){return db[_0x6df8('0x2c')][_0x6df8('0x37')](_0xa6e0d0[_0x6df8('0x38')],{})[_0x6df8('0x1b')](respondWithResult(_0x200542,0xc9))[_0x6df8('0x36')](handleError(_0x200542,null));};exports[_0x6df8('0x1a')]=function(_0x41a9ab,_0x51a66a){if(_0x41a9ab[_0x6df8('0x38')]['id']){delete _0x41a9ab[_0x6df8('0x38')]['id'];}return db[_0x6df8('0x2c')][_0x6df8('0x35')]({'where':{'id':_0x41a9ab[_0x6df8('0x39')]['id']}})[_0x6df8('0x1b')](handleEntityNotFound(_0x51a66a,null))[_0x6df8('0x1b')](saveUpdates(_0x41a9ab[_0x6df8('0x38')],null))[_0x6df8('0x1b')](respondWithResult(_0x51a66a,null))[_0x6df8('0x36')](handleError(_0x51a66a,null));};exports[_0x6df8('0x1c')]=function(_0x2d4c30,_0x3be983){return db[_0x6df8('0x2c')][_0x6df8('0x35')]({'where':{'id':_0x2d4c30[_0x6df8('0x39')]['id']}})[_0x6df8('0x1b')](handleEntityNotFound(_0x3be983,null))['then'](removeEntity(_0x3be983,null))[_0x6df8('0x36')](handleError(_0x3be983,null));};exports['describe']=function(_0x408140,_0x1d0ce1){return db[_0x6df8('0x2c')][_0x6df8('0x3a')]()[_0x6df8('0x1b')](respondWithResult(_0x1d0ce1,null))['catch'](handleError(_0x1d0ce1,null));};exports['addMessage']=function(_0x201c30,_0x3b6afc){return db[_0x6df8('0x3b')][_0x6df8('0x35')]({'where':{'id':_0x201c30[_0x6df8('0x39')]['id']}})['then'](handleEntityNotFound(_0x3b6afc,null))[_0x6df8('0x1b')](function(_0x5a500e){if(_0x5a500e){return _0x5a500e[_0x6df8('0x3c')](_0x201c30[_0x6df8('0x38')][_0x6df8('0x3d')],_[_0x6df8('0x3e')](_0x201c30[_0x6df8('0x38')],[_0x6df8('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x3b6afc,null))['catch'](handleError(_0x3b6afc,null));};exports['getMessages']=function(_0x384cbe,_0x1348e4){var _0x2a7ff5={'raw':![],'where':{}};var _0x39f5f7={};var _0x870b03={'count':0x0,'rows':[]};return db['MailInteraction'][_0x6df8('0x3f')]({'where':{'id':_0x384cbe[_0x6df8('0x39')]['id']}})['then'](handleEntityNotFound(_0x1348e4,null))[_0x6df8('0x1b')](function(_0x4334e3){if(_0x4334e3){_0x39f5f7[_0x6df8('0x2a')]=_[_0x6df8('0x2b')](db[_0x6df8('0x3b')]['rawAttributes']);_0x39f5f7['query']=_[_0x6df8('0x2b')](_0x384cbe['query']);_0x39f5f7[_0x6df8('0x2d')]=_[_0x6df8('0x2f')](_0x39f5f7[_0x6df8('0x2a')],_0x39f5f7[_0x6df8('0x28')]);_0x2a7ff5[_0x6df8('0x2e')]=_[_0x6df8('0x2f')](_0x39f5f7['model'],qs[_0x6df8('0x30')](_0x384cbe['query'][_0x6df8('0x30')]));_0x2a7ff5['attributes']=_0x2a7ff5[_0x6df8('0x2e')][_0x6df8('0x31')]?_0x2a7ff5[_0x6df8('0x2e')]:_0x39f5f7[_0x6df8('0x2a')];if(!_0x384cbe[_0x6df8('0x28')][_0x6df8('0x40')](_0x6df8('0x41'))){_0x2a7ff5[_0x6df8('0x16')]=qs[_0x6df8('0x16')](_0x384cbe[_0x6df8('0x28')][_0x6df8('0x16')]);_0x2a7ff5[_0x6df8('0x14')]=qs['offset'](_0x384cbe['query'][_0x6df8('0x14')]);}_0x2a7ff5['order']=qs[_0x6df8('0x42')](_0x384cbe['query']['sort']);_0x2a7ff5['where']=qs['filters'](_[_0x6df8('0x43')](_0x384cbe[_0x6df8('0x28')],_0x39f5f7[_0x6df8('0x2d')]));_0x2a7ff5[_0x6df8('0x44')]['MailInteractionId']=_0x4334e3['id'];if(_0x384cbe['query'][_0x6df8('0x45')]){_0x2a7ff5['where']=_[_0x6df8('0x46')](_0x2a7ff5[_0x6df8('0x44')],{'$or':_[_0x6df8('0x21')](_0x2a7ff5[_0x6df8('0x2e')],function(_0xa8abb9){var _0x324cd4={};_0x324cd4[_0xa8abb9]={'$like':'%'+_0x384cbe['query']['filter']+'%'};return _0x324cd4;})});}if(_0x384cbe[_0x6df8('0x28')][_0x6df8('0x47')]){var _0x43145a=_0x384cbe[_0x6df8('0x28')]['$gte'][_0x6df8('0x48')](',');var _0x4fd31d={};_0x4fd31d[_0x43145a[0x0]]={'$gte':moment(_0x43145a[0x1])[_0x6df8('0x49')](_0x6df8('0x4a'))};_0x2a7ff5[_0x6df8('0x44')]=_[_0x6df8('0x46')](_0x2a7ff5[_0x6df8('0x44')],_0x4fd31d);}_0x2a7ff5=_[_0x6df8('0x46')]({},_0x2a7ff5,_0x384cbe[_0x6df8('0x34')]);return db['MailMessage'][_0x6df8('0x17')]({'where':_0x2a7ff5[_0x6df8('0x44')]})[_0x6df8('0x1b')](function(_0x2b6cfe){_0x870b03[_0x6df8('0x17')]=_0x2b6cfe;if(_0x384cbe['query'][_0x6df8('0x32')]){_0x2a7ff5[_0x6df8('0x33')]=[{'all':!![]}];}return db['MailMessage'][_0x6df8('0x27')](_0x2a7ff5);})[_0x6df8('0x1b')](function(_0x521147){if(_0x384cbe[_0x6df8('0x28')]['inlineCss']===_0x6df8('0x4b')){for(var _0x5c75a3=0x0;_0x5c75a3<_0x521147[_0x6df8('0x31')];_0x5c75a3++){_0x521147[_0x5c75a3][_0x6df8('0x38')]=juice(_0x521147[_0x5c75a3][_0x6df8('0x38')]);}}_0x870b03[_0x6df8('0x4c')]=_0x521147;return _0x870b03;});}})[_0x6df8('0x1b')](respondWithFilteredResult(_0x1348e4,_0x2a7ff5))[_0x6df8('0x36')](handleError(_0x1348e4,null));};exports[_0x6df8('0x4d')]=function(_0x394014,_0x498e75){return db[_0x6df8('0x2c')][_0x6df8('0x35')]({'where':{'id':_0x394014[_0x6df8('0x39')]['id']}})['then'](handleEntityNotFound(_0x498e75,null))[_0x6df8('0x1b')](function(_0x4829cc){if(_0x4829cc){return _0x4829cc[_0x6df8('0x4e')](_0x394014['body']['ids'],_[_0x6df8('0x3e')](_0x394014[_0x6df8('0x38')],[_0x6df8('0x3d'),'id'])||{})[_0x6df8('0x4f')](function(){return db[_0x6df8('0x50')][_0x6df8('0x27')]({'attributes':['id',_0x6df8('0x1e'),_0x6df8('0x51')],'where':{'id':_0x394014[_0x6df8('0x38')][_0x6df8('0x3d')]}});})[_0x6df8('0x1b')](function(_0x228b24){socket[_0x6df8('0x52')]('mailInteractionTags:save',{'id':Number(_0x394014['params']['id']),'tags':_0x228b24||[]});return{'id':Number(_0x394014['params']['id']),'tags':_0x228b24||[]};});}})[_0x6df8('0x1b')](respondWithResult(_0x498e75,null))[_0x6df8('0x36')](handleError(_0x498e75,null));};exports[_0x6df8('0x53')]=function(_0xd55b3b,_0x3f95c3){return db['MailInteraction']['find']({'where':{'id':_0xd55b3b[_0x6df8('0x39')]['id']}})[_0x6df8('0x1b')](handleEntityNotFound(_0x3f95c3,null))[_0x6df8('0x1b')](function(_0x3b38b7){if(_0x3b38b7){return _0x3b38b7[_0x6df8('0x53')](_0xd55b3b[_0x6df8('0x28')][_0x6df8('0x3d')]);}})['then'](respondWithStatusCode(_0x3f95c3,null))[_0x6df8('0x36')](handleError(_0x3f95c3,null));};exports['download']=function(_0x35b309,_0x2d5a2a){var _0x3d739f=moment()[_0x6df8('0x54')]()[_0x6df8('0x55')]();var _0x4a7c63=path[_0x6df8('0x56')](config[_0x6df8('0x57')],_0x6df8('0x58'),_0x6df8('0x59'),'tmp');var _0x213e0b=path['join'](config[_0x6df8('0x57')],'server','files','attachments');var _0xbaa27c=path[_0x6df8('0x56')](_0x4a7c63,_0x3d739f);var _0x35e755=util[_0x6df8('0x49')](_0x6df8('0x5a'),_0x35b309[_0x6df8('0x39')]['id'],_0x3d739f);var _0xe5acb3=path[_0x6df8('0x56')](_0x4a7c63,_0x35e755);var _0x48bbcb=[];if(_0x35b309['query'][_0x6df8('0x5b')]){_0x48bbcb[_0x6df8('0x5c')]({'model':db[_0x6df8('0x5d')],'as':'Attachments','raw':!![]});}var _0x537b41=[{'model':db[_0x6df8('0x3b')],'as':_0x6df8('0x5e'),'attributes':['id',_0x6df8('0x38'),_0x6df8('0x5f'),'to','cc',_0x6df8('0x60'),_0x6df8('0x61'),_0x6df8('0x62')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x48bbcb}];return db[_0x6df8('0x2c')][_0x6df8('0x35')]({'where':{'id':_0x35b309[_0x6df8('0x39')]['id']},'include':_0x537b41})['then'](handleEntityNotFound(_0x2d5a2a,null))[_0x6df8('0x1b')](function(_0x41d8db){if(_0x41d8db&&_0x41d8db['Messages']){var _0x4ae939=_0x41d8db[_0x6df8('0x63')]({'plain':!![]});fs['mkdirSync'](_0xbaa27c);return BPromise[_0x6df8('0x64')](_0x4ae939[_0x6df8('0x5e')],function(_0x3b67a9,_0x1a9635){var _0x594f34={'from':_0x3b67a9['from'],'to':_0x3b67a9['to']||_0x6df8('0x65'),'subject':_0x3b67a9[_0x6df8('0x61')],'html':htmlEntities[_0x6df8('0x66')](_0x3b67a9[_0x6df8('0x38')]),'headers':{'Date':moment(_0x3b67a9[_0x6df8('0x62')])[_0x6df8('0x49')](_0x6df8('0x67'))},'attachments':[]};if(_0x3b67a9['cc']){_0x594f34[_0x6df8('0x68')]['Cc']=_0x3b67a9['cc'];}if(_0x3b67a9[_0x6df8('0x60')]){_0x594f34[_0x6df8('0x68')]['Bcc']=_0x3b67a9[_0x6df8('0x60')];}return new BPromise(function(_0x524da9,_0x294244){if(_0x3b67a9['Attachments']){for(var _0x19be51=0x0;_0x19be51<_0x3b67a9[_0x6df8('0x69')][_0x6df8('0x31')];_0x19be51++){var _0x55333d=_0x3b67a9[_0x6df8('0x69')][_0x19be51];var _0x112984=path[_0x6df8('0x56')](_0x213e0b,_0x55333d[_0x6df8('0x6a')]);if(fs['existsSync'](_0x112984)){_0x594f34['attachments'][_0x6df8('0x5c')]({'name':_0x55333d[_0x6df8('0x1e')],'contentType':_0x55333d[_0x6df8('0x24')],'data':fs[_0x6df8('0x6b')](_0x112984)});}}}emlformat[_0x6df8('0x6c')](_0x594f34,function(_0x252a0a,_0x22fc4d){if(_0x252a0a)return _0x294244(_0x252a0a);fs[_0x6df8('0x6d')](path['join'](_0xbaa27c,util['format'](_0x6df8('0x6e'),_0x1a9635)),_0x22fc4d);return _0x524da9(_0x22fc4d);});});})[_0x6df8('0x1b')](function(){return new BPromise(function(_0x4ac06e,_0x35f3f9){zipdir(_0xbaa27c,{'saveTo':_0xe5acb3},function(_0x1ecb5f,_0x43bc4c){if(_0x1ecb5f)return _0x35f3f9(_0x1ecb5f);return _0x4ac06e(_0x43bc4c);});})['then'](function(){return new BPromise(function(_0x19209c,_0x26f522){rimraf(_0xbaa27c,function(_0x35d1aa){if(_0x35d1aa)_0x26f522(_0x35d1aa);return _0x19209c();});});})['then'](function(){return _0x2d5a2a[_0x6df8('0x6f')](_0xe5acb3,_0x35e755,function(_0x534d6f){if(!_0x534d6f)fs[_0x6df8('0x70')](_0xe5acb3);});});});}else{return _0x2d5a2a[_0x6df8('0x11')](0xc8);}})['catch'](handleError(_0x2d5a2a,null));}; \ No newline at end of file +var _0x9042=['catch','params','model','keys','filters','intersection','attributes','fields','includeAll','include','merge','find','body','destroy','describe','addMessage','MailMessage','ids','getMessages','findOne','rawAttributes','length','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','setTags','spread','Tag','color','emit','removeTags','download','unix','join','root','server','files','tmp','attachments','push','Attachment','Attachments','Messages','bcc','subject','get','each','from','missing.recipient@your.company.com','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','moment','bluebird','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','html-entities','defaults','redis','localhost','./mailInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','stack','name','send','index','map','MailInteraction','fieldName','type','getOptions','findAll','mail','query','user'];(function(_0x1dc193,_0xaf90d6){var _0x347295=function(_0x54c498){while(--_0x54c498){_0x1dc193['push'](_0x1dc193['shift']());}};_0x347295(++_0xaf90d6);}(_0x9042,0x19a));var _0x2904=function(_0x476b00,_0x250877){_0x476b00=_0x476b00-0x0;var _0x44ec8e=_0x9042[_0x476b00];return _0x44ec8e;};'use strict';var emlformat=require(_0x2904('0x0'));var rimraf=require(_0x2904('0x1'));var zipdir=require('zip-dir');var moment=require(_0x2904('0x2'));var BPromise=require(_0x2904('0x3'));var util=require(_0x2904('0x4'));var path=require('path');var fs=require('fs');var _=require(_0x2904('0x5'));var juice=require('juice');var Redis=require(_0x2904('0x6'));var interaction=require(_0x2904('0x7'));var qs=require(_0x2904('0x8'));var logger=require('../../config/logger')(_0x2904('0x9'));var config=require(_0x2904('0xa'));var db=require(_0x2904('0xb'))['db'];var htmlEntities=require(_0x2904('0xc'));config['redis']=_[_0x2904('0xd')](config[_0x2904('0xe')],{'host':_0x2904('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2904('0xe')]));require(_0x2904('0x10'))['register'](socket);function respondWithStatusCode(_0x2b48d0,_0x498f92){_0x498f92=_0x498f92||0xcc;return function(_0x294334){if(_0x294334){return _0x2b48d0[_0x2904('0x11')](_0x498f92);}return _0x2b48d0[_0x2904('0x12')](_0x498f92)[_0x2904('0x13')]();};}function respondWithResult(_0x4e5657,_0x5470cd){_0x5470cd=_0x5470cd||0xc8;return function(_0x2f46eb){if(_0x2f46eb){return _0x4e5657[_0x2904('0x12')](_0x5470cd)[_0x2904('0x14')](_0x2f46eb);}};}function respondWithFilteredResult(_0x33ae5f,_0x5dd324){return function(_0x5c8871){if(_0x5c8871){var _0x220c46=typeof _0x5dd324[_0x2904('0x15')]===_0x2904('0x16')&&typeof _0x5dd324[_0x2904('0x17')]===_0x2904('0x16');var _0x23ffea=_0x5c8871[_0x2904('0x18')];var _0x5002e9=_0x220c46?0x0:_0x5dd324[_0x2904('0x15')];var _0x2a93ce=_0x220c46?_0x5c8871['count']:_0x5dd324[_0x2904('0x15')]+_0x5dd324[_0x2904('0x17')];var _0x3c8b82;if(_0x2a93ce>=_0x23ffea){_0x2a93ce=_0x23ffea;_0x3c8b82=0xc8;}else{_0x3c8b82=0xce;}_0x33ae5f[_0x2904('0x12')](_0x3c8b82);return _0x33ae5f[_0x2904('0x19')](_0x2904('0x1a'),_0x5002e9+'-'+_0x2a93ce+'/'+_0x23ffea)['json'](_0x5c8871);}return null;};}function saveUpdates(_0x39e0ad){return function(_0x5d7cc2){if(_0x5d7cc2){return _0x5d7cc2[_0x2904('0x1b')](_0x39e0ad)[_0x2904('0x1c')](function(_0x205da6){return _0x205da6;});}return null;};}function removeEntity(_0x186dab){return function(_0xe25308){if(_0xe25308){return _0xe25308['destroy']()[_0x2904('0x1c')](function(){_0x186dab[_0x2904('0x12')](0xcc)[_0x2904('0x13')]();});}};}function handleEntityNotFound(_0x55ee26){return function(_0x288c50){if(!_0x288c50){_0x55ee26[_0x2904('0x11')](0x194);}return _0x288c50;};}function handleError(_0x17d89c,_0x5f0076){_0x5f0076=_0x5f0076||0x1f4;return function(_0x3b4d50){logger['error'](_0x3b4d50[_0x2904('0x1d')]);if(_0x3b4d50[_0x2904('0x1e')]){delete _0x3b4d50[_0x2904('0x1e')];}_0x17d89c[_0x2904('0x12')](_0x5f0076)[_0x2904('0x1f')](_0x3b4d50);};}exports[_0x2904('0x20')]=function(_0x4b05a4,_0x28a81f){var _0x4c74fa={};var _0x469d7b=_[_0x2904('0x21')](db[_0x2904('0x22')]['rawAttributes'],function(_0x8b5937){return{'name':_0x8b5937[_0x2904('0x23')],'type':_0x8b5937[_0x2904('0x24')]['key']};});_0x4c74fa=qs[_0x2904('0x25')](_0x469d7b,_0x4b05a4);return interaction[_0x2904('0x26')](_0x2904('0x27'),_0x4b05a4[_0x2904('0x28')],_0x4b05a4[_0x2904('0x29')],_0x4c74fa,_0x469d7b)[_0x2904('0x1c')](respondWithFilteredResult(_0x28a81f,_0x4c74fa))[_0x2904('0x2a')](handleError(_0x28a81f,null));};exports['show']=function(_0x109eb8,_0x46e9b4){var _0x636c85={'raw':![],'where':{'id':_0x109eb8[_0x2904('0x2b')]['id']}},_0x364a73={};_0x364a73[_0x2904('0x2c')]=_[_0x2904('0x2d')](db[_0x2904('0x22')]['rawAttributes']);_0x364a73[_0x2904('0x28')]=_[_0x2904('0x2d')](_0x109eb8[_0x2904('0x28')]);_0x364a73[_0x2904('0x2e')]=_[_0x2904('0x2f')](_0x364a73[_0x2904('0x2c')],_0x364a73[_0x2904('0x28')]);_0x636c85[_0x2904('0x30')]=_['intersection'](_0x364a73[_0x2904('0x2c')],qs[_0x2904('0x31')](_0x109eb8[_0x2904('0x28')][_0x2904('0x31')]));_0x636c85[_0x2904('0x30')]=_0x636c85[_0x2904('0x30')]['length']?_0x636c85[_0x2904('0x30')]:_0x364a73['model'];if(_0x109eb8[_0x2904('0x28')][_0x2904('0x32')]){_0x636c85[_0x2904('0x33')]=[{'all':!![]}];}_0x636c85=_[_0x2904('0x34')]({},_0x636c85,_0x109eb8['options']);return db[_0x2904('0x22')][_0x2904('0x35')](_0x636c85)[_0x2904('0x1c')](handleEntityNotFound(_0x46e9b4,null))[_0x2904('0x1c')](respondWithResult(_0x46e9b4,null))[_0x2904('0x2a')](handleError(_0x46e9b4,null));};exports['create']=function(_0x3c712d,_0x483d8e){return db[_0x2904('0x22')]['create'](_0x3c712d[_0x2904('0x36')],{})[_0x2904('0x1c')](respondWithResult(_0x483d8e,0xc9))[_0x2904('0x2a')](handleError(_0x483d8e,null));};exports[_0x2904('0x1b')]=function(_0x2ee203,_0x5481ce){if(_0x2ee203[_0x2904('0x36')]['id']){delete _0x2ee203[_0x2904('0x36')]['id'];}return db[_0x2904('0x22')][_0x2904('0x35')]({'where':{'id':_0x2ee203[_0x2904('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5481ce,null))['then'](saveUpdates(_0x2ee203[_0x2904('0x36')],null))[_0x2904('0x1c')](respondWithResult(_0x5481ce,null))['catch'](handleError(_0x5481ce,null));};exports[_0x2904('0x37')]=function(_0x5bd7cf,_0x271aa7){return db['MailInteraction'][_0x2904('0x35')]({'where':{'id':_0x5bd7cf[_0x2904('0x2b')]['id']}})['then'](handleEntityNotFound(_0x271aa7,null))[_0x2904('0x1c')](removeEntity(_0x271aa7,null))[_0x2904('0x2a')](handleError(_0x271aa7,null));};exports[_0x2904('0x38')]=function(_0x3cd458,_0x78fea2){return db[_0x2904('0x22')][_0x2904('0x38')]()[_0x2904('0x1c')](respondWithResult(_0x78fea2,null))['catch'](handleError(_0x78fea2,null));};exports[_0x2904('0x39')]=function(_0x24b0e9,_0x3ced55){return db[_0x2904('0x3a')]['find']({'where':{'id':_0x24b0e9[_0x2904('0x2b')]['id']}})[_0x2904('0x1c')](handleEntityNotFound(_0x3ced55,null))[_0x2904('0x1c')](function(_0x282f6f){if(_0x282f6f){return _0x282f6f[_0x2904('0x39')](_0x24b0e9[_0x2904('0x36')][_0x2904('0x3b')],_['omit'](_0x24b0e9[_0x2904('0x36')],[_0x2904('0x3b'),'id'])||{});}})[_0x2904('0x1c')](respondWithResult(_0x3ced55,null))[_0x2904('0x2a')](handleError(_0x3ced55,null));};exports[_0x2904('0x3c')]=function(_0x53d6f0,_0x3dce4f){var _0x2cc972={'raw':![],'where':{}};var _0x323f2f={};var _0x53117f={'count':0x0,'rows':[]};return db[_0x2904('0x22')][_0x2904('0x3d')]({'where':{'id':_0x53d6f0[_0x2904('0x2b')]['id']}})[_0x2904('0x1c')](handleEntityNotFound(_0x3dce4f,null))[_0x2904('0x1c')](function(_0x2b0b1c){if(_0x2b0b1c){_0x323f2f[_0x2904('0x2c')]=_[_0x2904('0x2d')](db['MailMessage'][_0x2904('0x3e')]);_0x323f2f[_0x2904('0x28')]=_['keys'](_0x53d6f0['query']);_0x323f2f[_0x2904('0x2e')]=_['intersection'](_0x323f2f['model'],_0x323f2f['query']);_0x2cc972[_0x2904('0x30')]=_[_0x2904('0x2f')](_0x323f2f['model'],qs['fields'](_0x53d6f0['query'][_0x2904('0x31')]));_0x2cc972['attributes']=_0x2cc972['attributes'][_0x2904('0x3f')]?_0x2cc972[_0x2904('0x30')]:_0x323f2f[_0x2904('0x2c')];if(!_0x53d6f0[_0x2904('0x28')][_0x2904('0x40')](_0x2904('0x41'))){_0x2cc972[_0x2904('0x17')]=qs[_0x2904('0x17')](_0x53d6f0[_0x2904('0x28')]['limit']);_0x2cc972[_0x2904('0x15')]=qs['offset'](_0x53d6f0[_0x2904('0x28')][_0x2904('0x15')]);}_0x2cc972[_0x2904('0x42')]=qs['sort'](_0x53d6f0[_0x2904('0x28')][_0x2904('0x43')]);_0x2cc972[_0x2904('0x44')]=qs[_0x2904('0x2e')](_[_0x2904('0x45')](_0x53d6f0[_0x2904('0x28')],_0x323f2f[_0x2904('0x2e')]));_0x2cc972[_0x2904('0x44')][_0x2904('0x46')]=_0x2b0b1c['id'];if(_0x53d6f0[_0x2904('0x28')][_0x2904('0x47')]){_0x2cc972[_0x2904('0x44')]=_[_0x2904('0x34')](_0x2cc972[_0x2904('0x44')],{'$or':_[_0x2904('0x21')](_0x2cc972[_0x2904('0x30')],function(_0xde99cc){var _0x93b396={};_0x93b396[_0xde99cc]={'$like':'%'+_0x53d6f0[_0x2904('0x28')]['filter']+'%'};return _0x93b396;})});}if(_0x53d6f0['query']['$gte']){var _0x481942=_0x53d6f0[_0x2904('0x28')][_0x2904('0x48')][_0x2904('0x49')](',');var _0x351a58={};_0x351a58[_0x481942[0x0]]={'$gte':moment(_0x481942[0x1])[_0x2904('0x4a')](_0x2904('0x4b'))};_0x2cc972[_0x2904('0x44')]=_[_0x2904('0x34')](_0x2cc972['where'],_0x351a58);}_0x2cc972=_[_0x2904('0x34')]({},_0x2cc972,_0x53d6f0['options']);return db['MailMessage']['count']({'where':_0x2cc972[_0x2904('0x44')]})['then'](function(_0x44d26a){_0x53117f[_0x2904('0x18')]=_0x44d26a;if(_0x53d6f0['query'][_0x2904('0x32')]){_0x2cc972[_0x2904('0x33')]=[{'all':!![]}];}return db[_0x2904('0x3a')][_0x2904('0x26')](_0x2cc972);})[_0x2904('0x1c')](function(_0x48023a){if(_0x53d6f0['query'][_0x2904('0x4c')]===_0x2904('0x4d')){for(var _0x435c8a=0x0;_0x435c8a<_0x48023a['length'];_0x435c8a++){_0x48023a[_0x435c8a][_0x2904('0x36')]=juice(_0x48023a[_0x435c8a][_0x2904('0x36')]);}}_0x53117f[_0x2904('0x4e')]=_0x48023a;return _0x53117f;});}})[_0x2904('0x1c')](respondWithFilteredResult(_0x3dce4f,_0x2cc972))['catch'](handleError(_0x3dce4f,null));};exports['addTags']=function(_0x24627a,_0x58b86d){return db[_0x2904('0x22')]['find']({'where':{'id':_0x24627a[_0x2904('0x2b')]['id']}})['then'](handleEntityNotFound(_0x58b86d,null))[_0x2904('0x1c')](function(_0x5f0d24){if(_0x5f0d24){return _0x5f0d24[_0x2904('0x4f')](_0x24627a[_0x2904('0x36')]['ids'],_['omit'](_0x24627a[_0x2904('0x36')],[_0x2904('0x3b'),'id'])||{})[_0x2904('0x50')](function(){return db[_0x2904('0x51')][_0x2904('0x26')]({'attributes':['id',_0x2904('0x1e'),_0x2904('0x52')],'where':{'id':_0x24627a[_0x2904('0x36')]['ids']}});})[_0x2904('0x1c')](function(_0x5b6d69){socket[_0x2904('0x53')]('mailInteractionTags:save',{'id':Number(_0x24627a[_0x2904('0x2b')]['id']),'tags':_0x5b6d69||[]});return{'id':Number(_0x24627a['params']['id']),'tags':_0x5b6d69||[]};});}})[_0x2904('0x1c')](respondWithResult(_0x58b86d,null))[_0x2904('0x2a')](handleError(_0x58b86d,null));};exports[_0x2904('0x54')]=function(_0xa0075c,_0x36ab2d){return db[_0x2904('0x22')]['find']({'where':{'id':_0xa0075c[_0x2904('0x2b')]['id']}})[_0x2904('0x1c')](handleEntityNotFound(_0x36ab2d,null))[_0x2904('0x1c')](function(_0x1c0b96){if(_0x1c0b96){return _0x1c0b96[_0x2904('0x54')](_0xa0075c[_0x2904('0x28')][_0x2904('0x3b')]);}})[_0x2904('0x1c')](respondWithStatusCode(_0x36ab2d,null))[_0x2904('0x2a')](handleError(_0x36ab2d,null));};exports[_0x2904('0x55')]=function(_0x16d3e1,_0x422a69){var _0x132627=moment()[_0x2904('0x56')]()['toString']();var _0x27b48d=path[_0x2904('0x57')](config[_0x2904('0x58')],_0x2904('0x59'),_0x2904('0x5a'),_0x2904('0x5b'));var _0x374b2e=path[_0x2904('0x57')](config[_0x2904('0x58')],_0x2904('0x59'),'files',_0x2904('0x5c'));var _0x289667=path[_0x2904('0x57')](_0x27b48d,_0x132627);var _0x44e22e=util['format']('transcript-%d-%s.zip',_0x16d3e1['params']['id'],_0x132627);var _0x491902=path[_0x2904('0x57')](_0x27b48d,_0x44e22e);var _0x362198=[];if(_0x16d3e1[_0x2904('0x28')][_0x2904('0x5c')]){_0x362198[_0x2904('0x5d')]({'model':db[_0x2904('0x5e')],'as':_0x2904('0x5f'),'raw':!![]});}var _0x21aeb0=[{'model':db['MailMessage'],'as':_0x2904('0x60'),'attributes':['id',_0x2904('0x36'),'from','to','cc',_0x2904('0x61'),_0x2904('0x62'),'createdAt'],'where':{'secret':![]},'order':qs[_0x2904('0x43')]('id'),'include':_0x362198}];return db[_0x2904('0x22')]['find']({'where':{'id':_0x16d3e1[_0x2904('0x2b')]['id']},'include':_0x21aeb0})[_0x2904('0x1c')](handleEntityNotFound(_0x422a69,null))[_0x2904('0x1c')](function(_0x4ef28c){if(_0x4ef28c&&_0x4ef28c[_0x2904('0x60')]){var _0x550d1c=_0x4ef28c[_0x2904('0x63')]({'plain':!![]});fs['mkdirSync'](_0x289667);return BPromise[_0x2904('0x64')](_0x550d1c[_0x2904('0x60')],function(_0x1a3679,_0x406408){var _0x70fd6c={'from':_0x1a3679[_0x2904('0x65')],'to':_0x1a3679['to']||_0x2904('0x66'),'subject':_0x1a3679['subject'],'html':htmlEntities[_0x2904('0x67')](_0x1a3679[_0x2904('0x36')]),'headers':{'Date':moment(_0x1a3679[_0x2904('0x68')])['format'](_0x2904('0x69'))},'attachments':[]};if(_0x1a3679['cc']){_0x70fd6c[_0x2904('0x6a')]['Cc']=_0x1a3679['cc'];}if(_0x1a3679['bcc']){_0x70fd6c[_0x2904('0x6a')][_0x2904('0x6b')]=_0x1a3679['bcc'];}return new BPromise(function(_0x305e0d,_0x338dd9){if(_0x1a3679[_0x2904('0x5f')]){for(var _0x6e5143=0x0;_0x6e5143<_0x1a3679[_0x2904('0x5f')][_0x2904('0x3f')];_0x6e5143++){var _0x6369df=_0x1a3679[_0x2904('0x5f')][_0x6e5143];var _0x30c4b9=path[_0x2904('0x57')](_0x374b2e,_0x6369df[_0x2904('0x6c')]);if(fs['existsSync'](_0x30c4b9)){_0x70fd6c['attachments'][_0x2904('0x5d')]({'name':_0x6369df[_0x2904('0x1e')],'contentType':_0x6369df[_0x2904('0x24')],'data':fs['readFileSync'](_0x30c4b9)});}}}emlformat[_0x2904('0x6d')](_0x70fd6c,function(_0x57b68f,_0x54d8ea){if(_0x57b68f)return _0x338dd9(_0x57b68f);fs[_0x2904('0x6e')](path['join'](_0x289667,util[_0x2904('0x4a')](_0x2904('0x6f'),_0x406408)),_0x54d8ea);return _0x305e0d(_0x54d8ea);});});})[_0x2904('0x1c')](function(){return new BPromise(function(_0x25c5a5,_0x2b6e07){zipdir(_0x289667,{'saveTo':_0x491902},function(_0x680039,_0x4ca9df){if(_0x680039)return _0x2b6e07(_0x680039);return _0x25c5a5(_0x4ca9df);});})[_0x2904('0x1c')](function(){return new BPromise(function(_0x117c43,_0x3fa949){rimraf(_0x289667,function(_0x74487e){if(_0x74487e)_0x3fa949(_0x74487e);return _0x117c43();});});})[_0x2904('0x1c')](function(){return _0x422a69['download'](_0x491902,_0x44e22e,function(_0x111d99){if(!_0x111d99)fs[_0x2904('0x70')](_0x491902);});});});}else{return _0x422a69['sendStatus'](0xc8);}})[_0x2904('0x2a')](handleError(_0x422a69,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index c509191..f642f56 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 _0xd1d3=['getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update'];(function(_0x56c9a3,_0x99bbd4){var _0x542120=function(_0x752603){while(--_0x752603){_0x56c9a3['push'](_0x56c9a3['shift']());}};_0x542120(++_0x99bbd4);}(_0xd1d3,0x82));var _0x3d1d=function(_0x1be0c2,_0x2cc9aa){_0x1be0c2=_0x1be0c2-0x0;var _0x499cc1=_0xd1d3[_0x1be0c2];return _0x499cc1;};'use strict';var EventEmitter=require(_0x3d1d('0x0'));var MailInteraction=require(_0x3d1d('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x3d1d('0x1'))['db'][_0x3d1d('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x3d1d('0x3')](0x0);var events={'afterCreate':_0x3d1d('0x4'),'afterUpdate':_0x3d1d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4c3e80){return function(_0x15051a,_0x55aef0,_0x845f20){_0x15051a[_0x3d1d('0x6')]({'attributes':['id'],'raw':!![]})[_0x3d1d('0x7')](function(_0x59ae4c){_0x15051a['setDataValue'](_0x3d1d('0x8'),_0x59ae4c[_0x3d1d('0x9')](function(_0x3e5b9c){return{'id':_0x3e5b9c['id']};}));return MailMessage[_0x3d1d('0xa')]({'where':{'MailInteractionId':_0x15051a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3d1d('0x7')](function(_0x1059f7){_0x15051a[_0x3d1d('0xb')](_0x3d1d('0xc'),_0x1059f7['length']);MailInteractionEvents[_0x3d1d('0xd')](_0x4c3e80+':'+_0x15051a['id'],_0x15051a);MailInteractionEvents[_0x3d1d('0xd')](_0x4c3e80,_0x15051a);_0x845f20(null);})[_0x3d1d('0xe')](_0x845f20(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x3d1d('0xf')](e,emitEvent(event));}}module[_0x3d1d('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0xefac=['unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','update','remove','getUsers','then','Users','map','findAll'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0xefac,0x156));var _0xcefa=function(_0x3e9b1e,_0x45f33a){_0x3e9b1e=_0x3e9b1e-0x0;var _0x2fd30b=_0xefac[_0x3e9b1e];return _0x2fd30b;};'use strict';var EventEmitter=require(_0xcefa('0x0'));var MailInteraction=require(_0xcefa('0x1'))['db']['MailInteraction'];var MailMessage=require(_0xcefa('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xcefa('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcefa('0x3'),'afterDestroy':_0xcefa('0x4')};function emitEvent(_0x3b9a7a){return function(_0x813344,_0x5a9ed4,_0x25fc8){_0x813344[_0xcefa('0x5')]({'attributes':['id'],'raw':!![]})[_0xcefa('0x6')](function(_0x5d0f06){_0x813344['setDataValue'](_0xcefa('0x7'),_0x5d0f06[_0xcefa('0x8')](function(_0x4ad0c3){return{'id':_0x4ad0c3['id']};}));return MailMessage[_0xcefa('0x9')]({'where':{'MailInteractionId':_0x813344['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcefa('0x6')](function(_0x290b6e){_0x813344['setDataValue'](_0xcefa('0xa'),_0x290b6e[_0xcefa('0xb')]);MailInteractionEvents[_0xcefa('0xc')](_0x3b9a7a+':'+_0x813344['id'],_0x813344);MailInteractionEvents[_0xcefa('0xc')](_0x3b9a7a,_0x813344);_0x25fc8(null);})[_0xcefa('0xd')](_0x25fc8(null));};}for(var e in events){if(events[_0xcefa('0xe')](e)){var event=events[e];MailInteraction[_0xcefa('0xf')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index dff382b..f8e8f6c 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 _0x7ed9=['./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x288da7,_0x357a94){var _0x313a20=function(_0x427452){while(--_0x427452){_0x288da7['push'](_0x288da7['shift']());}};_0x313a20(++_0x357a94);}(_0x7ed9,0xfe));var _0x97ed=function(_0x4229e6,_0x2f20a0){_0x4229e6=_0x4229e6-0x0;var _0x2c89af=_0x7ed9[_0x4229e6];return _0x2c89af;};'use strict';var _=require(_0x97ed('0x0'));var util=require(_0x97ed('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x97ed('0x2'));var BPromise=require(_0x97ed('0x3'));var rp=require(_0x97ed('0x4'));var fs=require('fs');var path=require(_0x97ed('0x5'));var rimraf=require(_0x97ed('0x6'));var config=require('../../config/environment');var attributes=require(_0x97ed('0x7'));module[_0x97ed('0x8')]=function(_0x51a537,_0xa56fc9){return _0x51a537[_0x97ed('0x9')](_0x97ed('0xa'),attributes,{'tableName':_0x97ed('0xb'),'paranoid':![],'indexes':[{'name':_0x97ed('0xc'),'fields':[_0x97ed('0xd'),'to'],'type':_0x97ed('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1c40c4,_0x530568,_0x3dbf0e){if(_0x1c40c4[_0x97ed('0xf')]){_0x1c40c4[_0x97ed('0x10')]=moment()[_0x97ed('0x11')](_0x97ed('0x12'));}if(_0x1c40c4[_0x97ed('0x13')]){_0x1c40c4[_0x97ed('0x14')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x3dbf0e(null,_0x530568);},'beforeUpdate':function(_0x5a6b15,_0x566826,_0x3dc221){if(_0x5a6b15[_0x97ed('0x15')](_0x97ed('0xf'))){_0x5a6b15[_0x97ed('0x10')]=_0x5a6b15['substatus']?moment()['format'](_0x97ed('0x12')):null;}if(_0x5a6b15[_0x97ed('0x15')](_0x97ed('0x13'))){_0x5a6b15['closedAt']=moment()[_0x97ed('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x5a6b15[_0x97ed('0xf')]=null;_0x5a6b15[_0x97ed('0x10')]=null;}_0x3dc221(null,_0x5a6b15);},'afterUpdate':function(_0x4c2d1d,_0x25099c,_0x5bf098){var _0x353093=_0x51a537[_0x97ed('0x16')];var _0x10f7d9=_0x4c2d1d[_0x97ed('0x17')]({'plain':!![]});if(_0x10f7d9[_0x97ed('0x13')]){return _0x353093['MailMessage'][_0x97ed('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x10f7d9['id']}})[_0x97ed('0x19')](function(){_0x5bf098();})[_0x97ed('0x1a')](function(_0x1bcd94){_0x5bf098(_0x1bcd94);});}else{_0x5bf098();}}},'charset':_0x97ed('0x1b'),'collate':_0x97ed('0x1c')});}; \ No newline at end of file +var _0xf55a=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','substatusAt','substatus','models','get','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','closed'];(function(_0x1e1abe,_0x648e3b){var _0x1f2ae6=function(_0x311058){while(--_0x311058){_0x1e1abe['push'](_0x1e1abe['shift']());}};_0x1f2ae6(++_0x648e3b);}(_0xf55a,0x15c));var _0xaf55=function(_0x139ec0,_0x3e545c){_0x139ec0=_0x139ec0-0x0;var _0x44c78b=_0xf55a[_0x139ec0];return _0x44c78b;};'use strict';var _=require(_0xaf55('0x0'));var util=require(_0xaf55('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaf55('0x2'));var BPromise=require(_0xaf55('0x3'));var rp=require(_0xaf55('0x4'));var fs=require('fs');var path=require(_0xaf55('0x5'));var rimraf=require(_0xaf55('0x6'));var config=require('../../config/environment');var attributes=require(_0xaf55('0x7'));module[_0xaf55('0x8')]=function(_0x305ea2,_0x2fa02f){return _0x305ea2[_0xaf55('0x9')](_0xaf55('0xa'),attributes,{'tableName':_0xaf55('0xb'),'paranoid':![],'indexes':[{'name':_0xaf55('0xc'),'fields':[_0xaf55('0xd'),'to'],'type':_0xaf55('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3c7cea,_0x4ee9a4,_0x5ab2a5){if(_0x3c7cea['substatus']){_0x3c7cea['substatusAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3c7cea[_0xaf55('0xf')]){_0x3c7cea[_0xaf55('0x10')]=moment()[_0xaf55('0x11')](_0xaf55('0x12'));}_0x5ab2a5(null,_0x4ee9a4);},'beforeUpdate':function(_0x2b7d77,_0x5c04d0,_0x12e3fa){if(_0x2b7d77['changed']('substatus')){_0x2b7d77[_0xaf55('0x13')]=_0x2b7d77[_0xaf55('0x14')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x2b7d77['changed']('closed')){_0x2b7d77[_0xaf55('0x10')]=moment()['format'](_0xaf55('0x12'));_0x2b7d77['substatus']=null;_0x2b7d77[_0xaf55('0x13')]=null;}_0x12e3fa(null,_0x2b7d77);},'afterUpdate':function(_0x2df002,_0x3db098,_0xc10503){var _0x2ff006=_0x305ea2[_0xaf55('0x15')];var _0x38198b=_0x2df002[_0xaf55('0x16')]({'plain':!![]});if(_0x38198b[_0xaf55('0xf')]){return _0x2ff006['MailMessage'][_0xaf55('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x38198b['id']}})[_0xaf55('0x18')](function(){_0xc10503();})[_0xaf55('0x19')](function(_0x5d42d0){_0xc10503(_0x5d42d0);});}else{_0xc10503();}}},'charset':_0xaf55('0x1a'),'collate':_0xaf55('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 431609d..0fdd06d 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 _0x47a1=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','AddTagsToMailInteraction','ids','omit','spread','AddTags','lodash'];(function(_0x3abf9a,_0x3d71df){var _0x1de11b=function(_0x593c77){while(--_0x593c77){_0x3abf9a['push'](_0x3abf9a['shift']());}};_0x1de11b(++_0x3d71df);}(_0x47a1,0xbd));var _0x147a=function(_0x2f1408,_0x438ec0){_0x2f1408=_0x2f1408-0x0;var _0x13c4bf=_0x47a1[_0x2f1408];return _0x13c4bf;};'use strict';var _=require(_0x147a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x147a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x147a('0x2'));var db=require(_0x147a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x147a('0x4'))(_0x147a('0x5'));var config=require(_0x147a('0x6'));var jayson=require(_0x147a('0x7'));var client=jayson[_0x147a('0x8')]['http']({'port':0x232a});config[_0x147a('0x9')]=_[_0x147a('0xa')](config[_0x147a('0x9')],{'host':_0x147a('0xb'),'port':0x18eb});var socket=require(_0x147a('0xc'))(new Redis(config[_0x147a('0x9')]));require(_0x147a('0xd'))['register'](socket);function respondWithRpcPromise(_0x30e455,_0x3e59e2,_0x5a39d1){return new BPromise(function(_0x2a2a75,_0x5a4ffb){return client[_0x147a('0xe')](_0x30e455,_0x5a39d1)[_0x147a('0xf')](function(_0x337f06){logger['info'](_0x147a('0x10'),_0x3e59e2,_0x147a('0x11'));logger[_0x147a('0x12')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x3e59e2,_0x147a('0x11'),JSON[_0x147a('0x13')](_0x337f06));if(_0x337f06[_0x147a('0x14')]){if(_0x337f06[_0x147a('0x14')][_0x147a('0x15')]===0x1f4){logger[_0x147a('0x14')](_0x147a('0x10'),_0x3e59e2,_0x337f06[_0x147a('0x14')][_0x147a('0x16')]);return _0x5a4ffb(_0x337f06['error'][_0x147a('0x16')]);}logger['error'](_0x147a('0x10'),_0x3e59e2,_0x337f06[_0x147a('0x14')][_0x147a('0x16')]);return _0x2a2a75(_0x337f06[_0x147a('0x14')][_0x147a('0x16')]);}else{logger[_0x147a('0x17')]('MailInteraction,\x20%s,\x20%s',_0x3e59e2,'request\x20sent');_0x2a2a75(_0x337f06['result'][_0x147a('0x16')]);}})[_0x147a('0x18')](function(_0x59d61d){logger[_0x147a('0x14')]('MailInteraction,\x20%s,\x20%s',_0x3e59e2,_0x59d61d);_0x5a4ffb(_0x59d61d);});});}exports[_0x147a('0x19')]=function(_0x59241){var _0x11230b=this;return new Promise(function(_0x11d87a,_0x2093cf){return db[_0x147a('0x1a')][_0x147a('0x1b')](_0x59241[_0x147a('0x1c')],{'raw':_0x59241[_0x147a('0x1d')]?_0x59241[_0x147a('0x1d')][_0x147a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59241['options']?_0x59241[_0x147a('0x1d')][_0x147a('0x1f')]||null:null,'attributes':_0x59241[_0x147a('0x1d')]?_0x59241[_0x147a('0x1d')][_0x147a('0x20')]||null:null,'limit':_0x59241[_0x147a('0x1d')]?_0x59241[_0x147a('0x1d')]['limit']||null:null})['then'](function(_0x4a0774){logger[_0x147a('0x17')]('UpdateMailInteraction',_0x59241);logger[_0x147a('0x12')]('UpdateMailInteraction',_0x59241,JSON[_0x147a('0x13')](_0x4a0774));_0x11d87a(_0x4a0774);})[_0x147a('0x18')](function(_0x23413a){logger['error']('UpdateMailInteraction',_0x23413a[_0x147a('0x16')],_0x59241);_0x2093cf(_0x11230b[_0x147a('0x14')](0x1f4,_0x23413a[_0x147a('0x16')]));});});};exports[_0x147a('0x21')]=function(_0x34b396){return new Promise(function(_0x32fca2,_0x38fb06){return db[_0x147a('0x1a')]['find']({'where':_0x34b396[_0x147a('0x1d')]?_0x34b396[_0x147a('0x1d')][_0x147a('0x1f')]||null:null})[_0x147a('0xf')](function(_0x5ee503){if(_0x5ee503){return _0x5ee503['addTags'](_0x34b396['body'][_0x147a('0x22')],_[_0x147a('0x23')](_0x34b396['body'],[_0x147a('0x22'),'id'])||{});}})[_0x147a('0x24')](function(_0x3ae3d4){logger[_0x147a('0x17')](_0x147a('0x25'),_0x34b396);logger[_0x147a('0x12')]('AddTags',_0x34b396,JSON['stringify'](_0x3ae3d4));_0x32fca2(_0x3ae3d4);})['catch'](function(_0x2de799){logger[_0x147a('0x14')]('AddTags',_0x2de799[_0x147a('0x16')],_0x34b396);_0x38fb06(_this[_0x147a('0x14')](0x1f4,_0x2de799['message']));});});}; \ No newline at end of file +var _0x2fa9=['debug','catch','find','where','addTags','ids','omit','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateMailInteraction','MailInteraction','body','options','raw','attributes','limit'];(function(_0x2ca91d,_0x4e8413){var _0x4a5dde=function(_0x15af85){while(--_0x15af85){_0x2ca91d['push'](_0x2ca91d['shift']());}};_0x4a5dde(++_0x4e8413);}(_0x2fa9,0x1e9));var _0x92fa=function(_0x375953,_0x57e5bc){_0x375953=_0x375953-0x0;var _0x11d4a5=_0x2fa9[_0x375953];return _0x11d4a5;};'use strict';var _=require(_0x92fa('0x0'));var util=require(_0x92fa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x92fa('0x2'));var fs=require('fs');var Redis=require(_0x92fa('0x3'));var db=require(_0x92fa('0x4'))['db'];var utils=require(_0x92fa('0x5'));var logger=require(_0x92fa('0x6'))(_0x92fa('0x7'));var config=require('../../config/environment');var jayson=require(_0x92fa('0x8'));var client=jayson['client'][_0x92fa('0x9')]({'port':0x232a});config['redis']=_[_0x92fa('0xa')](config[_0x92fa('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x92fa('0xb')]));require(_0x92fa('0xc'))[_0x92fa('0xd')](socket);function respondWithRpcPromise(_0x16dab5,_0xf614f0,_0x32929e){return new BPromise(function(_0x28e4ef,_0x3f2b3d){return client['request'](_0x16dab5,_0x32929e)[_0x92fa('0xe')](function(_0x225db6){logger[_0x92fa('0xf')](_0x92fa('0x10'),_0xf614f0,'request\x20sent');logger['debug'](_0x92fa('0x11'),_0xf614f0,_0x92fa('0x12'),JSON[_0x92fa('0x13')](_0x225db6));if(_0x225db6['error']){if(_0x225db6[_0x92fa('0x14')][_0x92fa('0x15')]===0x1f4){logger[_0x92fa('0x14')](_0x92fa('0x10'),_0xf614f0,_0x225db6['error'][_0x92fa('0x16')]);return _0x3f2b3d(_0x225db6[_0x92fa('0x14')][_0x92fa('0x16')]);}logger['error'](_0x92fa('0x10'),_0xf614f0,_0x225db6[_0x92fa('0x14')][_0x92fa('0x16')]);return _0x28e4ef(_0x225db6[_0x92fa('0x14')]['message']);}else{logger[_0x92fa('0xf')](_0x92fa('0x10'),_0xf614f0,_0x92fa('0x12'));_0x28e4ef(_0x225db6[_0x92fa('0x17')]['message']);}})['catch'](function(_0x3fa803){logger[_0x92fa('0x14')](_0x92fa('0x10'),_0xf614f0,_0x3fa803);_0x3f2b3d(_0x3fa803);});});}exports[_0x92fa('0x18')]=function(_0x4f724e){var _0x3fa0ff=this;return new Promise(function(_0x3d4d58,_0x4cda98){return db[_0x92fa('0x19')]['update'](_0x4f724e[_0x92fa('0x1a')],{'raw':_0x4f724e[_0x92fa('0x1b')]?_0x4f724e['options'][_0x92fa('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f724e[_0x92fa('0x1b')]?_0x4f724e[_0x92fa('0x1b')]['where']||null:null,'attributes':_0x4f724e['options']?_0x4f724e[_0x92fa('0x1b')][_0x92fa('0x1d')]||null:null,'limit':_0x4f724e[_0x92fa('0x1b')]?_0x4f724e[_0x92fa('0x1b')][_0x92fa('0x1e')]||null:null})[_0x92fa('0xe')](function(_0x55ef63){logger['info']('UpdateMailInteraction',_0x4f724e);logger[_0x92fa('0x1f')](_0x92fa('0x18'),_0x4f724e,JSON[_0x92fa('0x13')](_0x55ef63));_0x3d4d58(_0x55ef63);})[_0x92fa('0x20')](function(_0x44c334){logger['error'](_0x92fa('0x18'),_0x44c334['message'],_0x4f724e);_0x4cda98(_0x3fa0ff['error'](0x1f4,_0x44c334[_0x92fa('0x16')]));});});};exports['AddTagsToMailInteraction']=function(_0x186b64){return new Promise(function(_0x52e320,_0x47b327){return db[_0x92fa('0x19')][_0x92fa('0x21')]({'where':_0x186b64['options']?_0x186b64['options'][_0x92fa('0x22')]||null:null})[_0x92fa('0xe')](function(_0x4994ca){if(_0x4994ca){return _0x4994ca[_0x92fa('0x23')](_0x186b64[_0x92fa('0x1a')][_0x92fa('0x24')],_[_0x92fa('0x25')](_0x186b64['body'],[_0x92fa('0x24'),'id'])||{});}})[_0x92fa('0x26')](function(_0x36d663){logger['info']('AddTags',_0x186b64);logger['debug']('AddTags',_0x186b64,JSON[_0x92fa('0x13')](_0x36d663));_0x52e320(_0x36d663);})['catch'](function(_0x54e88d){logger[_0x92fa('0x14')](_0x92fa('0x27'),_0x54e88d['message'],_0x186b64);_0x47b327(_this[_0x92fa('0x14')](0x1f4,_0x54e88d[_0x92fa('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index b60d22e..6b42b57 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 _0x9a80=['emit','removeListener','update'];(function(_0x37b3e5,_0x33b516){var _0x207f20=function(_0x5237fa){while(--_0x5237fa){_0x37b3e5['push'](_0x37b3e5['shift']());}};_0x207f20(++_0x33b516);}(_0x9a80,0x11c));var _0x09a8=function(_0x47de11,_0x2b4026){_0x47de11=_0x47de11-0x0;var _0x3a7015=_0x9a80[_0x47de11];return _0x3a7015;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save','remove',_0x09a8('0x0')];function createListener(_0x31f3f9,_0x1ff451){return function(_0x5a2476){_0x1ff451[_0x09a8('0x1')](_0x31f3f9,_0x5a2476);};}function removeListener(_0x3d53d6,_0x40432e){return function(){MailInteractionEvents[_0x09a8('0x2')](_0x3d53d6,_0x40432e);};}exports['register']=function(_0x473c08){for(var _0x3317d1=0x0,_0x1cefa2=events['length'];_0x3317d1<_0x1cefa2;_0x3317d1++){var _0x56eb8a=events[_0x3317d1];var _0x1538bf=createListener('mailInteraction:'+_0x56eb8a,_0x473c08);MailInteractionEvents['on'](_0x56eb8a,_0x1538bf);}}; \ No newline at end of file +var _0x9aa1=['update','emit','register','length','./mailInteraction.events','save'];(function(_0x31a09b,_0x2f3a0c){var _0x4532e8=function(_0x20bfd0){while(--_0x20bfd0){_0x31a09b['push'](_0x31a09b['shift']());}};_0x4532e8(++_0x2f3a0c);}(_0x9aa1,0x184));var _0x19aa=function(_0x1e06a2,_0x5de447){_0x1e06a2=_0x1e06a2-0x0;var _0x6a0264=_0x9aa1[_0x1e06a2];return _0x6a0264;};'use strict';var MailInteractionEvents=require(_0x19aa('0x0'));var events=[_0x19aa('0x1'),'remove',_0x19aa('0x2')];function createListener(_0x4116c6,_0x30dbb9){return function(_0x4d6ff7){_0x30dbb9[_0x19aa('0x3')](_0x4116c6,_0x4d6ff7);};}function removeListener(_0x14dbb0,_0x374eb6){return function(){MailInteractionEvents['removeListener'](_0x14dbb0,_0x374eb6);};}exports[_0x19aa('0x4')]=function(_0x283f9a){for(var _0x85e040=0x0,_0x37fe3c=events[_0x19aa('0x5')];_0x85e040<_0x37fe3c;_0x85e040++){var _0x23afe8=events[_0x85e040];var _0x374516=createListener('mailInteraction:'+_0x23afe8,_0x283f9a);MailInteractionEvents['on'](_0x23afe8,_0x374516);}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/index.js b/server/api/mailInteractionHasTag/index.js index b7403d9..739baf2 100644 --- a/server/api/mailInteractionHasTag/index.js +++ b/server/api/mailInteractionHasTag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ce1=['isAuthenticated','exports','express','Router','../../components/auth/service','./mailInteractionHasTag.controller','get','/describe'];(function(_0x37688b,_0x22f654){var _0x4092fd=function(_0x2bfe07){while(--_0x2bfe07){_0x37688b['push'](_0x37688b['shift']());}};_0x4092fd(++_0x22f654);}(_0x8ce1,0x152));var _0x18ce=function(_0x148450,_0x8f86db){_0x148450=_0x148450-0x0;var _0x1279ec=_0x8ce1[_0x148450];return _0x1279ec;};'use strict';var express=require(_0x18ce('0x0'));var router=express[_0x18ce('0x1')]();var auth=require(_0x18ce('0x2'));var controller=require(_0x18ce('0x3'));router[_0x18ce('0x4')](_0x18ce('0x5'),auth[_0x18ce('0x6')](),controller['describe']);module[_0x18ce('0x7')]=router; \ No newline at end of file +var _0x8fd4=['./mailInteractionHasTag.controller','get','/describe','isAuthenticated','describe','Router','../../components/auth/service'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x8fd4,0x178));var _0x48fd=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x8fd4[_0x25d386];return _0x857f4a;};'use strict';var express=require('express');var router=express[_0x48fd('0x0')]();var auth=require(_0x48fd('0x1'));var controller=require(_0x48fd('0x2'));router[_0x48fd('0x3')](_0x48fd('0x4'),auth[_0x48fd('0x5')](),controller[_0x48fd('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js index c49a9b3..6a5ee84 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x1775ec,_0x33c4d9){var _0x323da8=function(_0x19fbd4){while(--_0x19fbd4){_0x1775ec['push'](_0x1775ec['shift']());}};_0x323da8(++_0x33c4d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file +var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x34befa,_0x340aa9){var _0x24e70a=function(_0x68a2c9){while(--_0x68a2c9){_0x34befa['push'](_0x34befa['shift']());}};_0x24e70a(++_0x340aa9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.js index 2d07731..34327e1 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e7a=['exports','INTEGER','sequelize'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x5e7a,0x15e));var _0xa5e7=function(_0x5252ce,_0x133319){_0x5252ce=_0x5252ce-0x0;var _0x1f0fec=_0x5e7a[_0x5252ce];return _0x1f0fec;};'use strict';var Sequelize=require(_0xa5e7('0x0'));module[_0xa5e7('0x1')]={'MailInteractionId':{'type':Sequelize[_0xa5e7('0x2')],'primaryKey':!![]},'TagId':{'type':Sequelize[_0xa5e7('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x7f6d=['exports','INTEGER','sequelize'];(function(_0x3ded02,_0x4cd43b){var _0x113344=function(_0x53df68){while(--_0x53df68){_0x3ded02['push'](_0x3ded02['shift']());}};_0x113344(++_0x4cd43b);}(_0x7f6d,0xb0));var _0xd7f6=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x7f6d[_0x1762b4];return _0x29beda;};'use strict';var Sequelize=require(_0xd7f6('0x0'));module[_0xd7f6('0x1')]={'MailInteractionId':{'type':Sequelize[_0xd7f6('0x2')],'primaryKey':!![]},'TagId':{'type':Sequelize['INTEGER'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js index a519a1c..aa08d68 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4969=['define','MailInteractionHasTag','./mailInteractionHasTag','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4969,0x1c2));var _0x9496=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0x4969[_0x23c6f2];return _0x4c270b;};'use strict';var attributes=require(_0x9496('0x0'));module[_0x9496('0x1')]=function(_0xf647ef){return _0xf647ef[_0x9496('0x2')](_0x9496('0x3'),attributes,{'tableName':'mail_interaction_has_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x507c=['mail_interaction_has_tags','exports','define'];(function(_0x566add,_0x399ac9){var _0x152057=function(_0x40afbf){while(--_0x40afbf){_0x566add['push'](_0x566add['shift']());}};_0x152057(++_0x399ac9);}(_0x507c,0x19f));var _0xc507=function(_0x29ce4e,_0x8b864f){_0x29ce4e=_0x29ce4e-0x0;var _0x2e89a7=_0x507c[_0x29ce4e];return _0x2e89a7;};'use strict';var attributes=require('./mailInteractionHasTag');module[_0xc507('0x0')]=function(_0x41ed76){return _0x41ed76[_0xc507('0x1')]('MailInteractionHasTag',attributes,{'tableName':_0xc507('0x2'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 07a5fd6..cd3245c 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 _0xa724=['/describe','describe','/:id','show','/:id/download','download','tracked','mail','mailmessage:create','put','update','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','get'];(function(_0x24ea05,_0x5866ba){var _0x573211=function(_0x5baace){while(--_0x5baace){_0x24ea05['push'](_0x24ea05['shift']());}};_0x573211(++_0x5866ba);}(_0xa724,0xf1));var _0x4a72=function(_0x1f166c,_0x2c1c38){_0x1f166c=_0x1f166c-0x0;var _0x2476c9=_0xa724[_0x1f166c];return _0x2476c9;};'use strict';var multer=require(_0x4a72('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4a72('0x1'));var express=require('express');var router=express[_0x4a72('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4a72('0x3'));var interaction=require(_0x4a72('0x4'));var config=require(_0x4a72('0x5'));var controller=require(_0x4a72('0x6'));router['get']('/',auth[_0x4a72('0x7')](),controller['index']);router[_0x4a72('0x8')](_0x4a72('0x9'),auth[_0x4a72('0x7')](),controller[_0x4a72('0xa')]);router[_0x4a72('0x8')](_0x4a72('0xb'),auth[_0x4a72('0x7')](),controller[_0x4a72('0xc')]);router[_0x4a72('0x8')](_0x4a72('0xd'),auth[_0x4a72('0x7')](),controller[_0x4a72('0xe')]);router['post']('/',auth[_0x4a72('0x7')](),interaction[_0x4a72('0xf')](_0x4a72('0x10'),_0x4a72('0x11')),controller['create']);router[_0x4a72('0x12')](_0x4a72('0xb'),auth[_0x4a72('0x7')](),controller[_0x4a72('0x13')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x4a72('0x12')](_0x4a72('0x14'),auth['isAuthenticated'](),controller[_0x4a72('0x15')]);router[_0x4a72('0x16')]('/:id',auth[_0x4a72('0x7')](),controller[_0x4a72('0x17')]);module[_0x4a72('0x18')]=router; \ No newline at end of file +var _0xe9ad=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xe9ad,0x82));var _0xde9a=function(_0x4940a6,_0x448570){_0x4940a6=_0x4940a6-0x0;var _0x101ffe=_0xe9ad[_0x4940a6];return _0x101ffe;};'use strict';var multer=require(_0xde9a('0x0'));var util=require(_0xde9a('0x1'));var path=require(_0xde9a('0x2'));var timeout=require(_0xde9a('0x3'));var express=require(_0xde9a('0x4'));var router=express[_0xde9a('0x5')]();var fs_extra=require(_0xde9a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xde9a('0x7'));var config=require(_0xde9a('0x8'));var controller=require(_0xde9a('0x9'));router[_0xde9a('0xa')]('/',auth['isAuthenticated'](),controller[_0xde9a('0xb')]);router[_0xde9a('0xa')](_0xde9a('0xc'),auth['isAuthenticated'](),controller[_0xde9a('0xd')]);router[_0xde9a('0xa')](_0xde9a('0xe'),auth[_0xde9a('0xf')](),controller[_0xde9a('0x10')]);router[_0xde9a('0xa')](_0xde9a('0x11'),auth[_0xde9a('0xf')](),controller[_0xde9a('0x12')]);router['post']('/',auth[_0xde9a('0xf')](),interaction[_0xde9a('0x13')](_0xde9a('0x14'),_0xde9a('0x15')),controller[_0xde9a('0x16')]);router[_0xde9a('0x17')](_0xde9a('0xe'),auth[_0xde9a('0xf')](),controller[_0xde9a('0x18')]);router['put'](_0xde9a('0x19'),auth[_0xde9a('0xf')](),controller[_0xde9a('0x1a')]);router[_0xde9a('0x17')](_0xde9a('0x1b'),auth[_0xde9a('0xf')](),controller[_0xde9a('0x1c')]);router[_0xde9a('0x1d')](_0xde9a('0xe'),auth[_0xde9a('0xf')](),controller[_0xde9a('0x1e')]);module[_0xde9a('0x1f')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index b6c9db8..1a1d437 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 _0xd008=['INTEGER','DATE','long','Email','Chat','sequelize','lodash','medium','BOOLEAN','ENUM','out','STRING','TEXT'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xd008,0x1a5));var _0x8d00=function(_0x14ce29,_0x1ec3f0){_0x14ce29=_0x14ce29-0x0;var _0x5132a0=_0xd008[_0x14ce29];return _0x5132a0;};'use strict';var Sequelize=require(_0x8d00('0x0'));var _=require(_0x8d00('0x1'));module['exports']={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8d00('0x2'))},'read':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8d00('0x4')]('in',_0x8d00('0x5')),'defaultValue':_0x8d00('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8d00('0x6')](0x1fe)},'from':{'type':Sequelize[_0x8d00('0x6')]},'to':{'type':Sequelize[_0x8d00('0x7')]('long')},'cc':{'type':Sequelize[_0x8d00('0x7')]('long')},'bcc':{'type':Sequelize[_0x8d00('0x7')]('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x8d00('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x8d00('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x8d00('0x9')]},'originTo':{'type':Sequelize[_0x8d00('0x7')]('long')},'originCc':{'type':Sequelize[_0x8d00('0x7')](_0x8d00('0xa'))},'originChannel':{'type':Sequelize[_0x8d00('0x4')](_0x8d00('0xb'),_0x8d00('0xc')),'defaultValue':_0x8d00('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x4227=['long','DATE','INTEGER','ENUM','Email','sequelize','TEXT','medium','BOOLEAN','out','STRING'];(function(_0x49da57,_0x4f7a76){var _0xc1f3d4=function(_0x2d24c2){while(--_0x2d24c2){_0x49da57['push'](_0x49da57['shift']());}};_0xc1f3d4(++_0x4f7a76);}(_0x4227,0x89));var _0x7422=function(_0x1451fd,_0x184482){_0x1451fd=_0x1451fd-0x0;var _0x1578a7=_0x4227[_0x1451fd];return _0x1578a7;};'use strict';var Sequelize=require(_0x7422('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0x7422('0x1')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x7422('0x1')](_0x7422('0x2'))},'read':{'type':Sequelize[_0x7422('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7422('0x4')),'defaultValue':_0x7422('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7422('0x5')](0x1fe)},'from':{'type':Sequelize[_0x7422('0x5')]},'to':{'type':Sequelize[_0x7422('0x1')](_0x7422('0x6'))},'cc':{'type':Sequelize[_0x7422('0x1')](_0x7422('0x6'))},'bcc':{'type':Sequelize[_0x7422('0x1')]('long')},'subject':{'type':Sequelize[_0x7422('0x1')]},'sentAt':{'type':Sequelize[_0x7422('0x7')]},'attach':{'type':Sequelize[_0x7422('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x7422('0x7')]},'originTo':{'type':Sequelize['TEXT'](_0x7422('0x6'))},'originCc':{'type':Sequelize[_0x7422('0x1')](_0x7422('0x6'))},'originChannel':{'type':Sequelize[_0x7422('0x9')](_0x7422('0xa'),'Chat'),'defaultValue':_0x7422('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 6439839..81de727 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 _0xf6e7=['request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','json','offset','undefined','limit','count','status','update','destroy','end','sendStatus','name','send','index','map','MailMessage','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','show','params','find','body','describe','create','out','secret','split','MailAccount','findOne','MailAccountId','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','getSmtpOptions','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','info','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','SIP/%s','channel','accept','fromString','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','User','internal','motionChannel','reject','rejectmessage','toString','files','server','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','build','writeFileSync','download','unlinkSync','eml-format','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','register','client','http','request','then','MailMessage,\x20%s,\x20%s'];(function(_0x214ff1,_0x26ef77){var _0x2dd3c9=function(_0xff5d64){while(--_0xff5d64){_0x214ff1['push'](_0x214ff1['shift']());}};_0x2dd3c9(++_0x26ef77);}(_0xf6e7,0x122));var _0x7f6e=function(_0x59de95,_0x5aa71c){_0x59de95=_0x59de95-0x0;var _0x1bdae1=_0xf6e7[_0x59de95];return _0x1bdae1;};'use strict';var emlformat=require(_0x7f6e('0x0'));var moment=require(_0x7f6e('0x1'));var BPromise=require(_0x7f6e('0x2'));var util=require(_0x7f6e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x7f6e('0x4'));var Redis=require(_0x7f6e('0x5'));var htmlToText=require('html-to-text');var qs=require(_0x7f6e('0x6'));var logger=require(_0x7f6e('0x7'))('api');var interaction_log=require('../../config/logger')(_0x7f6e('0x8'));var config=require(_0x7f6e('0x9'));var db=require(_0x7f6e('0xa'))['db'];config[_0x7f6e('0xb')]=_[_0x7f6e('0xc')](config['redis'],{'host':_0x7f6e('0xd'),'port':0x18eb});var socket=require(_0x7f6e('0xe'))(new Redis(config[_0x7f6e('0xb')]));var htmlEntities=require(_0x7f6e('0xf'));require('./mailMessage.socket')[_0x7f6e('0x10')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7f6e('0x11')][_0x7f6e('0x12')]({'port':0x232c});var client9003=jayson[_0x7f6e('0x11')][_0x7f6e('0x12')]({'port':0x232b});var client9002=jayson[_0x7f6e('0x11')][_0x7f6e('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x7ffbb3,_0x1019e7,_0x494abb,_0x1357f7){return new BPromise(function(_0xea907e,_0x5c3892){var _0x5b5345=_0x1357f7||client;return _0x5b5345[_0x7f6e('0x13')](_0x7ffbb3,_0x494abb)[_0x7f6e('0x14')](function(_0x38e76a){logger['info'](_0x7f6e('0x15'),_0x1019e7,_0x7f6e('0x16'));logger[_0x7f6e('0x17')](_0x7f6e('0x18'),_0x1019e7,'request\x20sent',JSON[_0x7f6e('0x19')](_0x38e76a));if(_0x38e76a['error']){if(_0x38e76a['error'][_0x7f6e('0x1a')]===0x1f4){logger[_0x7f6e('0x1b')](_0x7f6e('0x15'),_0x1019e7,_0x38e76a[_0x7f6e('0x1b')][_0x7f6e('0x1c')]);return _0x5c3892(_0x38e76a[_0x7f6e('0x1b')][_0x7f6e('0x1c')]);}logger[_0x7f6e('0x1b')](_0x7f6e('0x15'),_0x1019e7,_0x38e76a[_0x7f6e('0x1b')][_0x7f6e('0x1c')]);return _0xea907e(_0x38e76a['error'][_0x7f6e('0x1c')]);}else{logger['info'](_0x7f6e('0x15'),_0x1019e7,_0x7f6e('0x16'));_0xea907e(_0x38e76a['result'][_0x7f6e('0x1c')]);}})[_0x7f6e('0x1d')](function(_0x29e81f){logger[_0x7f6e('0x1b')](_0x7f6e('0x15'),_0x1019e7,_0x29e81f);_0x5c3892(_0x29e81f);});});}function respondWithResult(_0x3aba90,_0x4aa792){_0x4aa792=_0x4aa792||0xc8;return function(_0x262cbd){if(_0x262cbd){return _0x3aba90['status'](_0x4aa792)[_0x7f6e('0x1e')](_0x262cbd);}};}function respondWithFilteredResult(_0xd43fd8,_0x23bc87){return function(_0x477d78){if(_0x477d78){var _0x2674a0=typeof _0x23bc87[_0x7f6e('0x1f')]===_0x7f6e('0x20')&&typeof _0x23bc87[_0x7f6e('0x21')]===_0x7f6e('0x20');var _0x2cf0be=_0x477d78[_0x7f6e('0x22')];var _0x220702=_0x2674a0?0x0:_0x23bc87[_0x7f6e('0x1f')];var _0x5288f7=_0x2674a0?_0x477d78[_0x7f6e('0x22')]:_0x23bc87['offset']+_0x23bc87[_0x7f6e('0x21')];var _0x31d5d2;if(_0x5288f7>=_0x2cf0be){_0x5288f7=_0x2cf0be;_0x31d5d2=0xc8;}else{_0x31d5d2=0xce;}_0xd43fd8[_0x7f6e('0x23')](_0x31d5d2);return _0xd43fd8['set']('Content-Range',_0x220702+'-'+_0x5288f7+'/'+_0x2cf0be)['json'](_0x477d78);}return null;};}function saveUpdates(_0x458640){return function(_0x16bd44){if(_0x16bd44){return _0x16bd44[_0x7f6e('0x24')](_0x458640)[_0x7f6e('0x14')](function(_0x468cbf){return _0x468cbf;});}return null;};}function removeEntity(_0xb8a86e){return function(_0x4e6f7c){if(_0x4e6f7c){return _0x4e6f7c[_0x7f6e('0x25')]()[_0x7f6e('0x14')](function(){_0xb8a86e[_0x7f6e('0x23')](0xcc)[_0x7f6e('0x26')]();});}};}function handleEntityNotFound(_0x902640){return function(_0x4ee568){if(!_0x4ee568){_0x902640[_0x7f6e('0x27')](0x194);}return _0x4ee568;};}function handleError(_0x391755,_0x4354ac){_0x4354ac=_0x4354ac||0x1f4;return function(_0x5cf1ae){logger[_0x7f6e('0x1b')](_0x5cf1ae['stack']);if(_0x5cf1ae[_0x7f6e('0x28')]){delete _0x5cf1ae[_0x7f6e('0x28')];}_0x391755[_0x7f6e('0x23')](_0x4354ac)[_0x7f6e('0x29')](_0x5cf1ae);};}exports[_0x7f6e('0x2a')]=function(_0x22d6b8,_0x3c8926){var _0x46c8a5={},_0x3b8107={},_0x12b8f5={'count':0x0,'rows':[]};var _0x284ae9=_[_0x7f6e('0x2b')](db[_0x7f6e('0x2c')][_0x7f6e('0x2d')],function(_0x461750){return{'name':_0x461750['fieldName'],'type':_0x461750['type']['key']};});_0x3b8107['model']=_[_0x7f6e('0x2b')](_0x284ae9,_0x7f6e('0x28'));_0x3b8107[_0x7f6e('0x2e')]=_[_0x7f6e('0x2f')](_0x22d6b8[_0x7f6e('0x2e')]);_0x3b8107[_0x7f6e('0x30')]=_[_0x7f6e('0x31')](_0x3b8107[_0x7f6e('0x32')],_0x3b8107['query']);_0x46c8a5[_0x7f6e('0x33')]=_[_0x7f6e('0x31')](_0x3b8107[_0x7f6e('0x32')],qs[_0x7f6e('0x34')](_0x22d6b8[_0x7f6e('0x2e')][_0x7f6e('0x34')]));_0x46c8a5[_0x7f6e('0x33')]=_0x46c8a5[_0x7f6e('0x33')][_0x7f6e('0x35')]?_0x46c8a5[_0x7f6e('0x33')]:_0x3b8107[_0x7f6e('0x32')];if(!_0x22d6b8['query'][_0x7f6e('0x36')](_0x7f6e('0x37'))){_0x46c8a5[_0x7f6e('0x21')]=qs['limit'](_0x22d6b8['query']['limit']);_0x46c8a5[_0x7f6e('0x1f')]=qs[_0x7f6e('0x1f')](_0x22d6b8['query'][_0x7f6e('0x1f')]);}_0x46c8a5[_0x7f6e('0x38')]=qs['sort'](_0x22d6b8[_0x7f6e('0x2e')][_0x7f6e('0x39')]);_0x46c8a5[_0x7f6e('0x3a')]=qs['filters'](_[_0x7f6e('0x3b')](_0x22d6b8[_0x7f6e('0x2e')],_0x3b8107[_0x7f6e('0x30')]),_0x284ae9);if(_0x22d6b8[_0x7f6e('0x2e')][_0x7f6e('0x3c')]){_0x46c8a5['where']=_[_0x7f6e('0x3d')](_0x46c8a5[_0x7f6e('0x3a')],{'$or':_[_0x7f6e('0x2b')](_0x284ae9,function(_0x160a42){if(_0x160a42[_0x7f6e('0x3e')]!=='VIRTUAL'){var _0x35350c={};_0x35350c[_0x160a42['name']]={'$like':'%'+_0x22d6b8[_0x7f6e('0x2e')]['filter']+'%'};return _0x35350c;}})});}_0x46c8a5=_['merge']({},_0x46c8a5,_0x22d6b8[_0x7f6e('0x3f')]);var _0x477f97={'where':_0x46c8a5[_0x7f6e('0x3a')]};return db['MailMessage'][_0x7f6e('0x22')](_0x477f97)[_0x7f6e('0x14')](function(_0x221f47){_0x12b8f5['count']=_0x221f47;if(_0x22d6b8[_0x7f6e('0x2e')]['includeAll']){_0x46c8a5[_0x7f6e('0x40')]=[{'all':!![]}];}return db['MailMessage'][_0x7f6e('0x41')](_0x46c8a5);})[_0x7f6e('0x14')](function(_0x3948bb){_0x12b8f5['rows']=_0x3948bb;return _0x12b8f5;})[_0x7f6e('0x14')](respondWithFilteredResult(_0x3c8926,_0x46c8a5))[_0x7f6e('0x1d')](handleError(_0x3c8926,null));};exports[_0x7f6e('0x42')]=function(_0x2692f2,_0x157e85){var _0x362a5b={'raw':!![],'where':{'id':_0x2692f2[_0x7f6e('0x43')]['id']}},_0x208918={};_0x208918[_0x7f6e('0x32')]=_[_0x7f6e('0x2f')](db[_0x7f6e('0x2c')][_0x7f6e('0x2d')]);_0x208918[_0x7f6e('0x2e')]=_[_0x7f6e('0x2f')](_0x2692f2[_0x7f6e('0x2e')]);_0x208918[_0x7f6e('0x30')]=_[_0x7f6e('0x31')](_0x208918[_0x7f6e('0x32')],_0x208918[_0x7f6e('0x2e')]);_0x362a5b[_0x7f6e('0x33')]=_[_0x7f6e('0x31')](_0x208918[_0x7f6e('0x32')],qs[_0x7f6e('0x34')](_0x2692f2['query'][_0x7f6e('0x34')]));_0x362a5b[_0x7f6e('0x33')]=_0x362a5b['attributes']['length']?_0x362a5b['attributes']:_0x208918[_0x7f6e('0x32')];if(_0x2692f2[_0x7f6e('0x2e')]['includeAll']){_0x362a5b[_0x7f6e('0x40')]=[{'all':!![]}];}_0x362a5b=_[_0x7f6e('0x3d')]({},_0x362a5b,_0x2692f2['options']);return db['MailMessage'][_0x7f6e('0x44')](_0x362a5b)[_0x7f6e('0x14')](handleEntityNotFound(_0x157e85,null))[_0x7f6e('0x14')](respondWithResult(_0x157e85,null))[_0x7f6e('0x1d')](handleError(_0x157e85,null));};exports[_0x7f6e('0x24')]=function(_0x33813e,_0x1f836e){if(_0x33813e['body']['id']){delete _0x33813e[_0x7f6e('0x45')]['id'];}return db['MailMessage']['find']({'where':{'id':_0x33813e[_0x7f6e('0x43')]['id']}})[_0x7f6e('0x14')](handleEntityNotFound(_0x1f836e,null))[_0x7f6e('0x14')](saveUpdates(_0x33813e['body'],null))[_0x7f6e('0x14')](respondWithResult(_0x1f836e,null))[_0x7f6e('0x1d')](handleError(_0x1f836e,null));};exports[_0x7f6e('0x25')]=function(_0x1dfb1d,_0x625175){return db['MailMessage']['find']({'where':{'id':_0x1dfb1d['params']['id']}})[_0x7f6e('0x14')](handleEntityNotFound(_0x625175,null))['then'](removeEntity(_0x625175,null))['catch'](handleError(_0x625175,null));};exports[_0x7f6e('0x46')]=function(_0x22377f,_0x775472){return db['MailMessage']['describe']()[_0x7f6e('0x14')](respondWithResult(_0x775472,null))[_0x7f6e('0x1d')](handleError(_0x775472,null));};exports[_0x7f6e('0x47')]=function(_0x4e918a,_0x2eb4ac){return db[_0x7f6e('0x2c')][_0x7f6e('0x47')](_0x4e918a[_0x7f6e('0x45')])['then'](function(_0x3da04b){if(_0x3da04b){if(_0x3da04b['direction']===_0x7f6e('0x48')&&!_0x3da04b[_0x7f6e('0x49')]){var _0x5f2729,_0x53b8c9,_0x266a96;if(_0x4e918a['body']['to']){_0x53b8c9=_0x4e918a['body']['to'][_0x7f6e('0x4a')](',')[0x0];}return db[_0x7f6e('0x4b')][_0x7f6e('0x4c')]({'where':{'id':_0x3da04b[_0x7f6e('0x4d')]},'include':[{'model':db['CmList'],'as':_0x7f6e('0x4e'),'include':[{'model':db[_0x7f6e('0x4f')],'as':_0x7f6e('0x50'),'where':{'email':_0x53b8c9},'limit':0x1,'order':[[_0x7f6e('0x51'),_0x7f6e('0x52')]]}]},{'model':db[_0x7f6e('0x53')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x7f6e('0x14')](function(_0x212b3b){_0x5f2729=_0x212b3b;if(!_0x5f2729||!_0x5f2729[_0x7f6e('0x54')])return;var _0x11368c=_0x5f2729[_0x7f6e('0x55')]();if(_0x4e918a[_0x7f6e('0x45')][_0x7f6e('0x56')]&&_0x4e918a[_0x7f6e('0x45')][_0x7f6e('0x56')]['length']){for(var _0x2b111a=0x0;_0x2b111a<_0x4e918a[_0x7f6e('0x45')][_0x7f6e('0x56')]['length'];_0x2b111a+=0x1){_0x4e918a[_0x7f6e('0x45')]['attachments'][_0x2b111a]={'filename':_0x4e918a['body']['attachments'][_0x2b111a][_0x7f6e('0x28')],'path':path[_0x7f6e('0x57')](config[_0x7f6e('0x58')],_0x7f6e('0x59'),_0x4e918a[_0x7f6e('0x45')][_0x7f6e('0x56')][_0x2b111a][_0x7f6e('0x5a')])};}}_0x266a96={'account':_0x11368c,'message':_0x4e918a[_0x7f6e('0x45')]};return;})['then'](function(){if(_0x5f2729['List']){if(_0x5f2729['List'][_0x7f6e('0x50')][_0x7f6e('0x35')]){return _0x5f2729['List'][_0x7f6e('0x50')][0x0];}else{return db[_0x7f6e('0x4f')][_0x7f6e('0x47')](_[_0x7f6e('0xc')](_0x4e918a[_0x7f6e('0x45')],{'firstName':_0x4e918a[_0x7f6e('0x45')]['to'],'email':_0x4e918a[_0x7f6e('0x45')]['to'],'phone':_0x4e918a[_0x7f6e('0x45')]['to'],'ListId':_0x5f2729[_0x7f6e('0x5b')]}));}}else{throw new Error(_0x7f6e('0x5c'));}})[_0x7f6e('0x14')](function(){if(_0x266a96){return respondWithRpcPromise(_0x7f6e('0x5d'),_0x7f6e('0x5e'),_0x266a96,client9003)[_0x7f6e('0x14')](function(_0x1a1624){return _0x3da04b[_0x7f6e('0x24')]({'read':!![],'messageId':_0x1a1624[_0x7f6e('0x5f')],'sentAt':moment()[_0x7f6e('0x60')](_0x7f6e('0x61'))});})['catch'](function(_0x1a093f){logger[_0x7f6e('0x1b')]('%s',JSON[_0x7f6e('0x19')](_0x1a093f));return _0x3da04b;});}return _0x3da04b;});}return _0x3da04b;}})['then'](respondWithResult(_0x2eb4ac,0xc9))[_0x7f6e('0x1d')](handleError(_0x2eb4ac,null));};exports['accept']=function(_0x4cb651,_0x163c20){var _0x27f8a4={'agent':{},'channel':_0x7f6e('0x62')};if(_0x4cb651['body']['id']){delete _0x4cb651[_0x7f6e('0x45')]['id'];}_0x4cb651['body'][_0x7f6e('0x63')]=!![];_0x4cb651['body'][_0x7f6e('0x64')]=moment()[_0x7f6e('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x4cb651[_0x7f6e('0x45')][_0x7f6e('0x65')]=_0x4cb651[_0x7f6e('0x45')][_0x7f6e('0x65')]||_0x4cb651[_0x7f6e('0x66')]['id'];_0x27f8a4[_0x7f6e('0x67')]['id']=_0x4cb651['body'][_0x7f6e('0x65')];return db['MailMessage'][_0x7f6e('0x44')]({'where':{'id':_0x4cb651[_0x7f6e('0x43')]['id'],'UserId':null}})[_0x7f6e('0x14')](handleEntityNotFound(_0x163c20,null))[_0x7f6e('0x14')](saveUpdates(_0x4cb651[_0x7f6e('0x45')],null))[_0x7f6e('0x14')](function(_0x3d637f){if(_0x3d637f){_0x27f8a4[_0x7f6e('0x1c')]=_0x3d637f[_0x7f6e('0x68')]({'plain':!![]});return db[_0x7f6e('0x69')]['find']({'where':{'id':_0x3d637f[_0x7f6e('0x6a')]}});}return null;})[_0x7f6e('0x14')](handleEntityNotFound(_0x163c20,null))[_0x7f6e('0x14')](function(_0x3cfa6c){if(_0x3cfa6c){return _0x3cfa6c[_0x7f6e('0x24')]({'UserId':_0x4cb651['body'][_0x7f6e('0x65')],'read1stAt':_[_0x7f6e('0x6b')](_0x3cfa6c[_0x7f6e('0x6c')])?moment()['format'](_0x7f6e('0x61')):undefined});}return null;})[_0x7f6e('0x14')](function(_0x17e0df){if(_0x17e0df){_0x27f8a4[_0x7f6e('0x6d')]=_0x17e0df[_0x7f6e('0x68')]({'plain':!![]});interaction_log[_0x7f6e('0x6e')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4cb651[_0x7f6e('0x66')]['id'],_0x4cb651[_0x7f6e('0x66')][_0x7f6e('0x28')],_0x4cb651[_0x7f6e('0x66')]['role'],_0x27f8a4[_0x7f6e('0x6d')]['id'],_0x4cb651[_0x7f6e('0x45')]?JSON[_0x7f6e('0x19')](_0x4cb651[_0x7f6e('0x45')]):_0x7f6e('0x6f'));return respondWithRpcPromise(_0x7f6e('0x70'),_0x7f6e('0x71'),_0x27f8a4);}return null;})[_0x7f6e('0x14')](function(_0x469233){var _0x238f6e=_0x7f6e('0x72')+_0x469233[_0x7f6e('0x1c')][_0x7f6e('0x73')];return db[_0x7f6e('0x74')]['query'](_0x238f6e,{'type':db[_0x7f6e('0x75')][_0x7f6e('0x76')][_0x7f6e('0x77')],'raw':!![]})['then'](function(_0x257256){return _0x257256;});})[_0x7f6e('0x14')](function(_0x4bdca7){if(_0x4bdca7){_0x27f8a4[_0x7f6e('0x1c')][_0x7f6e('0x78')]=_0x4bdca7[0x0];if(!_0x4cb651[_0x7f6e('0x45')][_0x7f6e('0x65')])return;return db['User'][_0x7f6e('0x44')]({'where':{'id':_0x4cb651['body'][_0x7f6e('0x65')],'role':_0x7f6e('0x67')},'attributes':['id',_0x7f6e('0x28'),_0x7f6e('0x79'),_0x7f6e('0x7a'),'internal'],'raw':!![]});}return null;})[_0x7f6e('0x14')](function(_0x18dc3b){if(!_0x18dc3b)return null;_0x27f8a4[_0x7f6e('0x1c')][_0x7f6e('0x67')]=_0x18dc3b;return _0x27f8a4;})[_0x7f6e('0x14')](function(_0x214a8f){if(_0x214a8f){if(_0x4cb651[_0x7f6e('0x45')]['manual']){_0x27f8a4[_0x7f6e('0x1c')]['interface']=util[_0x7f6e('0x60')](_0x7f6e('0x7b'),_0x4cb651['user']['name']);_0x27f8a4[_0x7f6e('0x1c')]['channel']=_0x27f8a4[_0x7f6e('0x7c')];_0x27f8a4[_0x7f6e('0x1c')]['motionChannel']=_0x27f8a4['channel'];_0x27f8a4['message']['event']=_0x7f6e('0x7d');_0x27f8a4[_0x7f6e('0x1c')][_0x7f6e('0x45')]=htmlToText[_0x7f6e('0x7e')](_0x27f8a4[_0x7f6e('0x1c')][_0x7f6e('0x45')]);return respondWithRpcPromise(_0x7f6e('0x7f'),'EventManager',{'event':_0x7f6e('0x80'),'message':_0x27f8a4['message']},client9002)[_0x7f6e('0x14')](function(){return _0x27f8a4;});}return _0x27f8a4;}return null;})['then'](respondWithResult(_0x163c20,null))[_0x7f6e('0x1d')](handleError(_0x163c20,null));};exports['reject']=function(_0x2b58d4,_0x3bceca){var _0x1b3083={'agent':{},'channel':'mail'};if(_0x2b58d4[_0x7f6e('0x45')]['id']){delete _0x2b58d4[_0x7f6e('0x45')]['id'];}_0x2b58d4['body'][_0x7f6e('0x65')]=_0x2b58d4[_0x7f6e('0x45')][_0x7f6e('0x65')]||_0x2b58d4['user']['id'];_0x1b3083['agent']['id']=_0x2b58d4[_0x7f6e('0x45')][_0x7f6e('0x65')];return db[_0x7f6e('0x2c')][_0x7f6e('0x44')]({'where':{'id':_0x2b58d4[_0x7f6e('0x43')]['id'],'UserId':null}})[_0x7f6e('0x14')](handleEntityNotFound(_0x3bceca,null))[_0x7f6e('0x14')](function(_0x47b392){if(_0x47b392){_0x1b3083[_0x7f6e('0x1c')]=_0x47b392[_0x7f6e('0x68')]({'plain':!![]});return db[_0x7f6e('0x69')][_0x7f6e('0x44')]({'where':{'id':_0x47b392[_0x7f6e('0x6a')]}});}return null;})[_0x7f6e('0x14')](handleEntityNotFound(_0x3bceca,null))[_0x7f6e('0x14')](function(_0x16ff29){if(_0x16ff29){_0x1b3083[_0x7f6e('0x6d')]=_0x16ff29[_0x7f6e('0x68')]({'plain':!![]});interaction_log[_0x7f6e('0x6e')](_0x7f6e('0x81'),_0x2b58d4['user']['id'],_0x2b58d4[_0x7f6e('0x66')][_0x7f6e('0x28')],_0x2b58d4[_0x7f6e('0x66')][_0x7f6e('0x82')],_0x1b3083[_0x7f6e('0x6d')]['id'],_0x2b58d4[_0x7f6e('0x45')]?JSON[_0x7f6e('0x19')](_0x2b58d4['body']):'null');return respondWithRpcPromise(_0x7f6e('0x83'),_0x7f6e('0x84'),_0x1b3083);}return null;})['then'](function(_0xa70c40){var _0x3c2786='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xa70c40[_0x7f6e('0x1c')][_0x7f6e('0x73')];return db[_0x7f6e('0x74')]['query'](_0x3c2786,{'type':db['Sequelize']['QueryTypes'][_0x7f6e('0x77')],'raw':!![]})[_0x7f6e('0x14')](function(_0x155702){return _0x155702;});})['then'](function(_0x73863){if(_0x73863){_0x1b3083['message'][_0x7f6e('0x78')]=_0x73863[0x0];if(!_0x2b58d4['body'][_0x7f6e('0x65')])return;return db[_0x7f6e('0x85')][_0x7f6e('0x44')]({'where':{'id':_0x2b58d4['body']['UserId'],'role':_0x7f6e('0x67')},'attributes':['id',_0x7f6e('0x28'),_0x7f6e('0x79'),_0x7f6e('0x7a'),_0x7f6e('0x86')],'raw':!![]});}return null;})['then'](function(_0xfa2abf){if(!_0xfa2abf)return null;_0x1b3083[_0x7f6e('0x1c')][_0x7f6e('0x67')]=_0xfa2abf;return _0x1b3083;})['then'](function(_0x504213){if(_0x504213){_0x504213['message']['interface']=util[_0x7f6e('0x60')](_0x7f6e('0x7b'),_0x2b58d4[_0x7f6e('0x66')][_0x7f6e('0x28')]);_0x504213[_0x7f6e('0x1c')][_0x7f6e('0x7c')]=_0x1b3083[_0x7f6e('0x7c')];_0x504213['message'][_0x7f6e('0x87')]=_0x1b3083[_0x7f6e('0x7c')];_0x504213['message']['event']=_0x7f6e('0x88');_0x504213[_0x7f6e('0x1c')][_0x7f6e('0x45')]=htmlToText[_0x7f6e('0x7e')](_0x1b3083[_0x7f6e('0x1c')][_0x7f6e('0x45')]);respondWithRpcPromise(_0x7f6e('0x7f'),_0x7f6e('0x7f'),{'event':_0x7f6e('0x89'),'message':_0x504213[_0x7f6e('0x1c')]},client9002);return _0x1b3083;}return null;})[_0x7f6e('0x14')](respondWithResult(_0x3bceca,null))[_0x7f6e('0x1d')](handleError(_0x3bceca,null));};exports['download']=function(_0xcb1783,_0x44f1ca){var _0x1b3c7c=moment()['unix']()[_0x7f6e('0x8a')]();var _0x53a801=path['join'](config[_0x7f6e('0x58')],'server',_0x7f6e('0x8b'),'tmp');var _0x2b2846=path[_0x7f6e('0x57')](config[_0x7f6e('0x58')],_0x7f6e('0x8c'),_0x7f6e('0x8b'),_0x7f6e('0x56'));var _0x40a1ad=util[_0x7f6e('0x60')](_0x7f6e('0x8d'),_0x1b3c7c);return db[_0x7f6e('0x2c')][_0x7f6e('0x44')]({'where':{'id':_0xcb1783[_0x7f6e('0x43')]['id']},'attributes':['id','body','from','to','cc',_0x7f6e('0x8e'),_0x7f6e('0x8f'),_0x7f6e('0x90')],'include':_0xcb1783['query']['attachments']?[{'model':db[_0x7f6e('0x91')],'as':_0x7f6e('0x92')}]:undefined})[_0x7f6e('0x14')](handleEntityNotFound(_0x44f1ca,null))[_0x7f6e('0x14')](function(_0x4ab011){if(_0x4ab011){var _0x4e97fe=_0x4ab011;var _0xb8f53e={'from':_0x4e97fe['from'],'to':_0x4e97fe['to'],'subject':_0x4e97fe['subject'],'html':htmlEntities[_0x7f6e('0x93')](_0x4e97fe[_0x7f6e('0x45')]),'headers':{'Date':moment(_0x4e97fe['createdAt'])[_0x7f6e('0x60')](_0x7f6e('0x94'))},'attachments':[]};if(_0x4ab011['cc']){_0xb8f53e['headers']['Cc']=_0x4ab011['cc'];}if(_0x4ab011[_0x7f6e('0x8e')]){_0xb8f53e[_0x7f6e('0x95')]['Bcc']=_0x4ab011[_0x7f6e('0x8e')];}return new BPromise(function(_0x3a14c2,_0x558c92){if(_0x4ab011[_0x7f6e('0x92')]){for(var _0x4908c1=0x0;_0x4908c1<_0x4ab011[_0x7f6e('0x92')]['length'];_0x4908c1++){var _0x5db0e9=_0x4ab011['Attachments'][_0x4908c1];var _0x1f5c75=path['join'](_0x2b2846,_0x5db0e9[_0x7f6e('0x5a')]);if(fs[_0x7f6e('0x96')](_0x1f5c75)){_0xb8f53e[_0x7f6e('0x56')][_0x7f6e('0x97')]({'name':_0x5db0e9['name'],'contentType':_0x5db0e9[_0x7f6e('0x3e')],'data':fs['readFileSync'](_0x1f5c75)});}}}emlformat[_0x7f6e('0x98')](_0xb8f53e,function(_0x157dcc,_0x1780f1){if(_0x157dcc)return _0x558c92(_0x157dcc);fs[_0x7f6e('0x99')](path[_0x7f6e('0x57')](_0x53a801,_0x40a1ad),_0x1780f1);return _0x3a14c2(_0x1780f1);});});}})[_0x7f6e('0x14')](function(_0x5b4970){if(_0x5b4970){return _0x44f1ca[_0x7f6e('0x9a')](path[_0x7f6e('0x57')](_0x53a801,_0x40a1ad),_0x40a1ad,function(_0x34a2e1){if(!_0x34a2e1)fs[_0x7f6e('0x9b')](path[_0x7f6e('0x57')](_0x53a801,_0x40a1ad));});}})[_0x7f6e('0x1d')](handleError(_0x44f1ca,null));}; \ No newline at end of file +var _0xe2d8=['sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','MailMessage','includeAll','findAll','params','options','find','body','create','direction','out','findOne','MailAccountId','CmList','List','Contacts','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','read','readAt','format','UserId','user','agent','get','MailInteractionId','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','mail','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','reject','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','catch','offset','undefined','count','limit','status','Content-Range','json','update','destroy'];(function(_0x1bdb4c,_0x526dbf){var _0x40bfe0=function(_0x3a512c){while(--_0x3a512c){_0x1bdb4c['push'](_0x1bdb4c['shift']());}};_0x40bfe0(++_0x526dbf);}(_0xe2d8,0x115));var _0x8e2d=function(_0x4ed2f1,_0x3623d1){_0x4ed2f1=_0x4ed2f1-0x0;var _0x2b45c1=_0xe2d8[_0x4ed2f1];return _0x2b45c1;};'use strict';var emlformat=require(_0x8e2d('0x0'));var moment=require(_0x8e2d('0x1'));var BPromise=require(_0x8e2d('0x2'));var util=require('util');var path=require(_0x8e2d('0x3'));var fs=require('fs');var _=require(_0x8e2d('0x4'));var Redis=require(_0x8e2d('0x5'));var htmlToText=require(_0x8e2d('0x6'));var qs=require(_0x8e2d('0x7'));var logger=require('../../config/logger')(_0x8e2d('0x8'));var interaction_log=require(_0x8e2d('0x9'))(_0x8e2d('0xa'));var config=require(_0x8e2d('0xb'));var db=require(_0x8e2d('0xc'))['db'];config[_0x8e2d('0xd')]=_[_0x8e2d('0xe')](config[_0x8e2d('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x8e2d('0xf'))(new Redis(config[_0x8e2d('0xd')]));var htmlEntities=require('html-entities');require(_0x8e2d('0x10'))[_0x8e2d('0x11')](socket);var jayson=require(_0x8e2d('0x12'));var client=jayson[_0x8e2d('0x13')][_0x8e2d('0x14')]({'port':0x232c});var client9003=jayson['client'][_0x8e2d('0x14')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x289b75,_0x381c43,_0x4619c8,_0x2fa3ff){return new BPromise(function(_0x390487,_0x149c1a){var _0x2447ed=_0x2fa3ff||client;return _0x2447ed[_0x8e2d('0x15')](_0x289b75,_0x4619c8)[_0x8e2d('0x16')](function(_0x2757ae){logger[_0x8e2d('0x17')]('MailMessage,\x20%s,\x20%s',_0x381c43,_0x8e2d('0x18'));logger[_0x8e2d('0x19')](_0x8e2d('0x1a'),_0x381c43,'request\x20sent',JSON[_0x8e2d('0x1b')](_0x2757ae));if(_0x2757ae[_0x8e2d('0x1c')]){if(_0x2757ae[_0x8e2d('0x1c')][_0x8e2d('0x1d')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x381c43,_0x2757ae[_0x8e2d('0x1c')][_0x8e2d('0x1e')]);return _0x149c1a(_0x2757ae['error'][_0x8e2d('0x1e')]);}logger['error'](_0x8e2d('0x1f'),_0x381c43,_0x2757ae[_0x8e2d('0x1c')][_0x8e2d('0x1e')]);return _0x390487(_0x2757ae['error'][_0x8e2d('0x1e')]);}else{logger[_0x8e2d('0x17')](_0x8e2d('0x1f'),_0x381c43,'request\x20sent');_0x390487(_0x2757ae[_0x8e2d('0x20')][_0x8e2d('0x1e')]);}})[_0x8e2d('0x21')](function(_0x36dd50){logger[_0x8e2d('0x1c')](_0x8e2d('0x1f'),_0x381c43,_0x36dd50);_0x149c1a(_0x36dd50);});});}function respondWithResult(_0x922b2c,_0x564ce2){_0x564ce2=_0x564ce2||0xc8;return function(_0x12a239){if(_0x12a239){return _0x922b2c['status'](_0x564ce2)['json'](_0x12a239);}};}function respondWithFilteredResult(_0x43d88f,_0x9a060d){return function(_0xfc00fb){if(_0xfc00fb){var _0x3d6f15=typeof _0x9a060d[_0x8e2d('0x22')]===_0x8e2d('0x23')&&typeof _0x9a060d['limit']===_0x8e2d('0x23');var _0x382721=_0xfc00fb[_0x8e2d('0x24')];var _0x1c4263=_0x3d6f15?0x0:_0x9a060d[_0x8e2d('0x22')];var _0x3f5c22=_0x3d6f15?_0xfc00fb[_0x8e2d('0x24')]:_0x9a060d[_0x8e2d('0x22')]+_0x9a060d[_0x8e2d('0x25')];var _0x249275;if(_0x3f5c22>=_0x382721){_0x3f5c22=_0x382721;_0x249275=0xc8;}else{_0x249275=0xce;}_0x43d88f[_0x8e2d('0x26')](_0x249275);return _0x43d88f['set'](_0x8e2d('0x27'),_0x1c4263+'-'+_0x3f5c22+'/'+_0x382721)[_0x8e2d('0x28')](_0xfc00fb);}return null;};}function saveUpdates(_0x44a5e7){return function(_0x5affe7){if(_0x5affe7){return _0x5affe7[_0x8e2d('0x29')](_0x44a5e7)[_0x8e2d('0x16')](function(_0x4e4eea){return _0x4e4eea;});}return null;};}function removeEntity(_0x14d4e2){return function(_0x1bd64b){if(_0x1bd64b){return _0x1bd64b[_0x8e2d('0x2a')]()[_0x8e2d('0x16')](function(){_0x14d4e2[_0x8e2d('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1456c3){return function(_0x459c51){if(!_0x459c51){_0x1456c3[_0x8e2d('0x2b')](0x194);}return _0x459c51;};}function handleError(_0x3f7356,_0x1e42f7){_0x1e42f7=_0x1e42f7||0x1f4;return function(_0x5878be){logger[_0x8e2d('0x1c')](_0x5878be[_0x8e2d('0x2c')]);if(_0x5878be[_0x8e2d('0x2d')]){delete _0x5878be[_0x8e2d('0x2d')];}_0x3f7356[_0x8e2d('0x26')](_0x1e42f7)[_0x8e2d('0x2e')](_0x5878be);};}exports['index']=function(_0x409686,_0x4a1a8a){var _0x19c1c1={},_0x8a8f8f={},_0xc40001={'count':0x0,'rows':[]};var _0x49888b=_[_0x8e2d('0x2f')](db['MailMessage'][_0x8e2d('0x30')],function(_0x216f59){return{'name':_0x216f59[_0x8e2d('0x31')],'type':_0x216f59[_0x8e2d('0x32')][_0x8e2d('0x33')]};});_0x8a8f8f[_0x8e2d('0x34')]=_[_0x8e2d('0x2f')](_0x49888b,_0x8e2d('0x2d'));_0x8a8f8f['query']=_[_0x8e2d('0x35')](_0x409686['query']);_0x8a8f8f[_0x8e2d('0x36')]=_[_0x8e2d('0x37')](_0x8a8f8f[_0x8e2d('0x34')],_0x8a8f8f[_0x8e2d('0x38')]);_0x19c1c1['attributes']=_[_0x8e2d('0x37')](_0x8a8f8f[_0x8e2d('0x34')],qs[_0x8e2d('0x39')](_0x409686[_0x8e2d('0x38')]['fields']));_0x19c1c1[_0x8e2d('0x3a')]=_0x19c1c1[_0x8e2d('0x3a')][_0x8e2d('0x3b')]?_0x19c1c1[_0x8e2d('0x3a')]:_0x8a8f8f[_0x8e2d('0x34')];if(!_0x409686[_0x8e2d('0x38')][_0x8e2d('0x3c')](_0x8e2d('0x3d'))){_0x19c1c1['limit']=qs[_0x8e2d('0x25')](_0x409686[_0x8e2d('0x38')][_0x8e2d('0x25')]);_0x19c1c1[_0x8e2d('0x22')]=qs[_0x8e2d('0x22')](_0x409686[_0x8e2d('0x38')]['offset']);}_0x19c1c1[_0x8e2d('0x3e')]=qs['sort'](_0x409686['query'][_0x8e2d('0x3f')]);_0x19c1c1[_0x8e2d('0x40')]=qs[_0x8e2d('0x36')](_[_0x8e2d('0x41')](_0x409686[_0x8e2d('0x38')],_0x8a8f8f['filters']),_0x49888b);if(_0x409686[_0x8e2d('0x38')][_0x8e2d('0x42')]){_0x19c1c1['where']=_[_0x8e2d('0x43')](_0x19c1c1[_0x8e2d('0x40')],{'$or':_[_0x8e2d('0x2f')](_0x49888b,function(_0x1f8ac0){if(_0x1f8ac0[_0x8e2d('0x32')]!==_0x8e2d('0x44')){var _0x5bbfed={};_0x5bbfed[_0x1f8ac0[_0x8e2d('0x2d')]]={'$like':'%'+_0x409686['query'][_0x8e2d('0x42')]+'%'};return _0x5bbfed;}})});}_0x19c1c1=_[_0x8e2d('0x43')]({},_0x19c1c1,_0x409686['options']);var _0xc0043d={'where':_0x19c1c1[_0x8e2d('0x40')]};return db[_0x8e2d('0x45')]['count'](_0xc0043d)[_0x8e2d('0x16')](function(_0xc8e2cc){_0xc40001[_0x8e2d('0x24')]=_0xc8e2cc;if(_0x409686[_0x8e2d('0x38')][_0x8e2d('0x46')]){_0x19c1c1['include']=[{'all':!![]}];}return db[_0x8e2d('0x45')][_0x8e2d('0x47')](_0x19c1c1);})[_0x8e2d('0x16')](function(_0x26402f){_0xc40001['rows']=_0x26402f;return _0xc40001;})[_0x8e2d('0x16')](respondWithFilteredResult(_0x4a1a8a,_0x19c1c1))['catch'](handleError(_0x4a1a8a,null));};exports['show']=function(_0x21f1e8,_0x5d97dc){var _0x32b32f={'raw':!![],'where':{'id':_0x21f1e8[_0x8e2d('0x48')]['id']}},_0x443dfe={};_0x443dfe[_0x8e2d('0x34')]=_[_0x8e2d('0x35')](db[_0x8e2d('0x45')][_0x8e2d('0x30')]);_0x443dfe[_0x8e2d('0x38')]=_[_0x8e2d('0x35')](_0x21f1e8['query']);_0x443dfe['filters']=_[_0x8e2d('0x37')](_0x443dfe[_0x8e2d('0x34')],_0x443dfe[_0x8e2d('0x38')]);_0x32b32f[_0x8e2d('0x3a')]=_[_0x8e2d('0x37')](_0x443dfe[_0x8e2d('0x34')],qs['fields'](_0x21f1e8[_0x8e2d('0x38')][_0x8e2d('0x39')]));_0x32b32f['attributes']=_0x32b32f[_0x8e2d('0x3a')][_0x8e2d('0x3b')]?_0x32b32f[_0x8e2d('0x3a')]:_0x443dfe[_0x8e2d('0x34')];if(_0x21f1e8[_0x8e2d('0x38')][_0x8e2d('0x46')]){_0x32b32f['include']=[{'all':!![]}];}_0x32b32f=_[_0x8e2d('0x43')]({},_0x32b32f,_0x21f1e8[_0x8e2d('0x49')]);return db[_0x8e2d('0x45')][_0x8e2d('0x4a')](_0x32b32f)[_0x8e2d('0x16')](handleEntityNotFound(_0x5d97dc,null))[_0x8e2d('0x16')](respondWithResult(_0x5d97dc,null))[_0x8e2d('0x21')](handleError(_0x5d97dc,null));};exports['update']=function(_0x1f654b,_0x37374d){if(_0x1f654b[_0x8e2d('0x4b')]['id']){delete _0x1f654b[_0x8e2d('0x4b')]['id'];}return db[_0x8e2d('0x45')][_0x8e2d('0x4a')]({'where':{'id':_0x1f654b[_0x8e2d('0x48')]['id']}})[_0x8e2d('0x16')](handleEntityNotFound(_0x37374d,null))[_0x8e2d('0x16')](saveUpdates(_0x1f654b[_0x8e2d('0x4b')],null))[_0x8e2d('0x16')](respondWithResult(_0x37374d,null))[_0x8e2d('0x21')](handleError(_0x37374d,null));};exports[_0x8e2d('0x2a')]=function(_0x4ceecd,_0x627613){return db[_0x8e2d('0x45')][_0x8e2d('0x4a')]({'where':{'id':_0x4ceecd['params']['id']}})[_0x8e2d('0x16')](handleEntityNotFound(_0x627613,null))[_0x8e2d('0x16')](removeEntity(_0x627613,null))['catch'](handleError(_0x627613,null));};exports['describe']=function(_0x5642d5,_0x7473a8){return db['MailMessage']['describe']()['then'](respondWithResult(_0x7473a8,null))[_0x8e2d('0x21')](handleError(_0x7473a8,null));};exports[_0x8e2d('0x4c')]=function(_0x35cb30,_0x236fd1){return db[_0x8e2d('0x45')][_0x8e2d('0x4c')](_0x35cb30['body'])[_0x8e2d('0x16')](function(_0x2faed9){if(_0x2faed9){if(_0x2faed9[_0x8e2d('0x4d')]===_0x8e2d('0x4e')&&!_0x2faed9['secret']){var _0xea09a6,_0x54a86c,_0x4ccaee;if(_0x35cb30['body']['to']){_0x54a86c=_0x35cb30[_0x8e2d('0x4b')]['to']['split'](',')[0x0];}return db['MailAccount'][_0x8e2d('0x4f')]({'where':{'id':_0x2faed9[_0x8e2d('0x50')]},'include':[{'model':db[_0x8e2d('0x51')],'as':_0x8e2d('0x52'),'include':[{'model':db['CmContact'],'as':_0x8e2d('0x53'),'where':{'email':_0x54a86c},'limit':0x1,'order':[['updatedAt',_0x8e2d('0x54')]]}]},{'model':db[_0x8e2d('0x55')],'as':_0x8e2d('0x56'),'raw':!![],'include':[{'model':db[_0x8e2d('0x57')],'as':_0x8e2d('0x57'),'raw':!![]}]}]})[_0x8e2d('0x16')](function(_0x86c4a7){_0xea09a6=_0x86c4a7;if(!_0xea09a6||!_0xea09a6['Smtp'])return;var _0x33b563=_0xea09a6[_0x8e2d('0x58')]();if(_0x35cb30['body']['attachments']&&_0x35cb30[_0x8e2d('0x4b')]['attachments']['length']){for(var _0x376b3e=0x0;_0x376b3e<_0x35cb30[_0x8e2d('0x4b')][_0x8e2d('0x59')]['length'];_0x376b3e+=0x1){_0x35cb30['body'][_0x8e2d('0x59')][_0x376b3e]={'filename':_0x35cb30[_0x8e2d('0x4b')]['attachments'][_0x376b3e][_0x8e2d('0x2d')],'path':path[_0x8e2d('0x5a')](config[_0x8e2d('0x5b')],_0x8e2d('0x5c'),_0x35cb30[_0x8e2d('0x4b')][_0x8e2d('0x59')][_0x376b3e]['basename'])};}}_0x4ccaee={'account':_0x33b563,'message':_0x35cb30[_0x8e2d('0x4b')]};return;})[_0x8e2d('0x16')](function(){if(_0xea09a6[_0x8e2d('0x52')]){if(_0xea09a6[_0x8e2d('0x52')][_0x8e2d('0x53')][_0x8e2d('0x3b')]){return _0xea09a6['List'][_0x8e2d('0x53')][0x0];}else{return db['CmContact'][_0x8e2d('0x4c')](_[_0x8e2d('0xe')](_0x35cb30['body'],{'firstName':_0x35cb30[_0x8e2d('0x4b')]['to'],'email':_0x35cb30[_0x8e2d('0x4b')]['to'],'phone':_0x35cb30[_0x8e2d('0x4b')]['to'],'ListId':_0xea09a6['ListId']}));}}else{throw new Error('List\x20not\x20found');}})[_0x8e2d('0x16')](function(){if(_0x4ccaee){return respondWithRpcPromise('SendMail',_0x8e2d('0x5d'),_0x4ccaee,client9003)[_0x8e2d('0x16')](function(_0x425f9b){return _0x2faed9[_0x8e2d('0x29')]({'read':!![],'messageId':_0x425f9b[_0x8e2d('0x5e')],'sentAt':moment()['format'](_0x8e2d('0x5f'))});})[_0x8e2d('0x21')](function(_0x19df58){logger[_0x8e2d('0x1c')]('%s',JSON[_0x8e2d('0x1b')](_0x19df58));return _0x2faed9;});}return _0x2faed9;});}return _0x2faed9;}})[_0x8e2d('0x16')](respondWithResult(_0x236fd1,0xc9))['catch'](handleError(_0x236fd1,null));};exports['accept']=function(_0x382181,_0x1f413f){var _0x339d8d={'agent':{},'channel':'mail'};if(_0x382181[_0x8e2d('0x4b')]['id']){delete _0x382181['body']['id'];}_0x382181['body'][_0x8e2d('0x60')]=!![];_0x382181['body'][_0x8e2d('0x61')]=moment()[_0x8e2d('0x62')](_0x8e2d('0x5f'));_0x382181[_0x8e2d('0x4b')][_0x8e2d('0x63')]=_0x382181[_0x8e2d('0x4b')][_0x8e2d('0x63')]||_0x382181[_0x8e2d('0x64')]['id'];_0x339d8d[_0x8e2d('0x65')]['id']=_0x382181['body'][_0x8e2d('0x63')];return db[_0x8e2d('0x45')][_0x8e2d('0x4a')]({'where':{'id':_0x382181[_0x8e2d('0x48')]['id'],'UserId':null}})[_0x8e2d('0x16')](handleEntityNotFound(_0x1f413f,null))[_0x8e2d('0x16')](saveUpdates(_0x382181[_0x8e2d('0x4b')],null))[_0x8e2d('0x16')](function(_0x5d260d){if(_0x5d260d){_0x339d8d['message']=_0x5d260d[_0x8e2d('0x66')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x5d260d[_0x8e2d('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x1f413f,null))[_0x8e2d('0x16')](function(_0x2b8167){if(_0x2b8167){return _0x2b8167[_0x8e2d('0x29')]({'UserId':_0x382181[_0x8e2d('0x4b')][_0x8e2d('0x63')],'read1stAt':_[_0x8e2d('0x68')](_0x2b8167[_0x8e2d('0x69')])?moment()[_0x8e2d('0x62')](_0x8e2d('0x5f')):undefined});}return null;})[_0x8e2d('0x16')](function(_0x4f7595){if(_0x4f7595){_0x339d8d['interaction']=_0x4f7595[_0x8e2d('0x66')]({'plain':!![]});interaction_log[_0x8e2d('0x17')](_0x8e2d('0x6a'),_0x382181[_0x8e2d('0x64')]['id'],_0x382181[_0x8e2d('0x64')][_0x8e2d('0x2d')],_0x382181['user']['role'],_0x339d8d[_0x8e2d('0x6b')]['id'],_0x382181[_0x8e2d('0x4b')]?JSON[_0x8e2d('0x1b')](_0x382181[_0x8e2d('0x4b')]):_0x8e2d('0x6c'));return respondWithRpcPromise(_0x8e2d('0x6d'),_0x8e2d('0x6e'),_0x339d8d);}return null;})[_0x8e2d('0x16')](function(_0x412501){var _0x524731=_0x8e2d('0x6f')+_0x412501['message'][_0x8e2d('0x70')];return db[_0x8e2d('0x71')]['query'](_0x524731,{'type':db['Sequelize'][_0x8e2d('0x72')][_0x8e2d('0x73')],'raw':!![]})['then'](function(_0x16adf6){return _0x16adf6;});})[_0x8e2d('0x16')](function(_0x1c27f4){if(_0x1c27f4){_0x339d8d[_0x8e2d('0x1e')][_0x8e2d('0x74')]=_0x1c27f4[0x0];if(!_0x382181['body'][_0x8e2d('0x63')])return;return db[_0x8e2d('0x75')]['find']({'where':{'id':_0x382181[_0x8e2d('0x4b')]['UserId'],'role':_0x8e2d('0x65')},'attributes':['id',_0x8e2d('0x2d'),_0x8e2d('0x76'),_0x8e2d('0x77'),_0x8e2d('0x78')],'raw':!![]});}return null;})['then'](function(_0x44e9fc){if(!_0x44e9fc)return null;_0x339d8d[_0x8e2d('0x1e')][_0x8e2d('0x65')]=_0x44e9fc;return _0x339d8d;})[_0x8e2d('0x16')](function(_0x15f719){if(_0x15f719){if(_0x382181[_0x8e2d('0x4b')][_0x8e2d('0x79')]){_0x339d8d[_0x8e2d('0x1e')][_0x8e2d('0x7a')]=util['format'](_0x8e2d('0x7b'),_0x382181[_0x8e2d('0x64')][_0x8e2d('0x2d')]);_0x339d8d['message'][_0x8e2d('0x7c')]=_0x339d8d[_0x8e2d('0x7c')];_0x339d8d['message'][_0x8e2d('0x7d')]=_0x339d8d[_0x8e2d('0x7c')];_0x339d8d[_0x8e2d('0x1e')][_0x8e2d('0x7e')]='accept';_0x339d8d[_0x8e2d('0x1e')][_0x8e2d('0x4b')]=htmlToText[_0x8e2d('0x7f')](_0x339d8d[_0x8e2d('0x1e')][_0x8e2d('0x4b')]);return respondWithRpcPromise(_0x8e2d('0x80'),_0x8e2d('0x80'),{'event':'acceptmessage','message':_0x339d8d['message']},client9002)[_0x8e2d('0x16')](function(){return _0x339d8d;});}return _0x339d8d;}return null;})[_0x8e2d('0x16')](respondWithResult(_0x1f413f,null))[_0x8e2d('0x21')](handleError(_0x1f413f,null));};exports['reject']=function(_0x3e1b77,_0x4cf89a){var _0x590c6d={'agent':{},'channel':_0x8e2d('0x81')};if(_0x3e1b77[_0x8e2d('0x4b')]['id']){delete _0x3e1b77[_0x8e2d('0x4b')]['id'];}_0x3e1b77[_0x8e2d('0x4b')][_0x8e2d('0x63')]=_0x3e1b77['body']['UserId']||_0x3e1b77[_0x8e2d('0x64')]['id'];_0x590c6d[_0x8e2d('0x65')]['id']=_0x3e1b77[_0x8e2d('0x4b')][_0x8e2d('0x63')];return db['MailMessage']['find']({'where':{'id':_0x3e1b77[_0x8e2d('0x48')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4cf89a,null))[_0x8e2d('0x16')](function(_0x3b2c45){if(_0x3b2c45){_0x590c6d[_0x8e2d('0x1e')]=_0x3b2c45['get']({'plain':!![]});return db[_0x8e2d('0x82')]['find']({'where':{'id':_0x3b2c45[_0x8e2d('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x4cf89a,null))[_0x8e2d('0x16')](function(_0x3e4896){if(_0x3e4896){_0x590c6d[_0x8e2d('0x6b')]=_0x3e4896['get']({'plain':!![]});interaction_log[_0x8e2d('0x17')](_0x8e2d('0x83'),_0x3e1b77[_0x8e2d('0x64')]['id'],_0x3e1b77[_0x8e2d('0x64')]['name'],_0x3e1b77[_0x8e2d('0x64')][_0x8e2d('0x84')],_0x590c6d[_0x8e2d('0x6b')]['id'],_0x3e1b77[_0x8e2d('0x4b')]?JSON[_0x8e2d('0x1b')](_0x3e1b77[_0x8e2d('0x4b')]):_0x8e2d('0x6c'));return respondWithRpcPromise(_0x8e2d('0x85'),_0x8e2d('0x86'),_0x590c6d);}return null;})[_0x8e2d('0x16')](function(_0x1a4832){var _0x47e4be='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1a4832[_0x8e2d('0x1e')][_0x8e2d('0x70')];return db[_0x8e2d('0x71')][_0x8e2d('0x38')](_0x47e4be,{'type':db[_0x8e2d('0x87')][_0x8e2d('0x72')][_0x8e2d('0x73')],'raw':!![]})[_0x8e2d('0x16')](function(_0x45dda0){return _0x45dda0;});})[_0x8e2d('0x16')](function(_0x23617a){if(_0x23617a){_0x590c6d[_0x8e2d('0x1e')][_0x8e2d('0x74')]=_0x23617a[0x0];if(!_0x3e1b77['body'][_0x8e2d('0x63')])return;return db[_0x8e2d('0x75')][_0x8e2d('0x4a')]({'where':{'id':_0x3e1b77[_0x8e2d('0x4b')][_0x8e2d('0x63')],'role':'agent'},'attributes':['id',_0x8e2d('0x2d'),_0x8e2d('0x76'),'email',_0x8e2d('0x78')],'raw':!![]});}return null;})['then'](function(_0x3e9746){if(!_0x3e9746)return null;_0x590c6d[_0x8e2d('0x1e')][_0x8e2d('0x65')]=_0x3e9746;return _0x590c6d;})[_0x8e2d('0x16')](function(_0xa5d3a2){if(_0xa5d3a2){_0xa5d3a2[_0x8e2d('0x1e')][_0x8e2d('0x7a')]=util['format'](_0x8e2d('0x7b'),_0x3e1b77['user'][_0x8e2d('0x2d')]);_0xa5d3a2[_0x8e2d('0x1e')][_0x8e2d('0x7c')]=_0x590c6d[_0x8e2d('0x7c')];_0xa5d3a2[_0x8e2d('0x1e')]['motionChannel']=_0x590c6d['channel'];_0xa5d3a2[_0x8e2d('0x1e')][_0x8e2d('0x7e')]=_0x8e2d('0x88');_0xa5d3a2[_0x8e2d('0x1e')][_0x8e2d('0x4b')]=htmlToText[_0x8e2d('0x7f')](_0x590c6d[_0x8e2d('0x1e')][_0x8e2d('0x4b')]);respondWithRpcPromise(_0x8e2d('0x80'),_0x8e2d('0x80'),{'event':_0x8e2d('0x89'),'message':_0xa5d3a2[_0x8e2d('0x1e')]},client9002);return _0x590c6d;}return null;})['then'](respondWithResult(_0x4cf89a,null))[_0x8e2d('0x21')](handleError(_0x4cf89a,null));};exports[_0x8e2d('0x8a')]=function(_0x2f8da5,_0x256f9a){var _0x8964c1=moment()[_0x8e2d('0x8b')]()[_0x8e2d('0x8c')]();var _0x2588b8=path[_0x8e2d('0x5a')](config[_0x8e2d('0x5b')],_0x8e2d('0x8d'),_0x8e2d('0x8e'),_0x8e2d('0x8f'));var _0x1e7db6=path[_0x8e2d('0x5a')](config[_0x8e2d('0x5b')],'server',_0x8e2d('0x8e'),'attachments');var _0x340950=util[_0x8e2d('0x62')](_0x8e2d('0x90'),_0x8964c1);return db[_0x8e2d('0x45')][_0x8e2d('0x4a')]({'where':{'id':_0x2f8da5['params']['id']},'attributes':['id','body',_0x8e2d('0x91'),'to','cc',_0x8e2d('0x92'),_0x8e2d('0x93'),_0x8e2d('0x94')],'include':_0x2f8da5[_0x8e2d('0x38')][_0x8e2d('0x59')]?[{'model':db['Attachment'],'as':_0x8e2d('0x95')}]:undefined})[_0x8e2d('0x16')](handleEntityNotFound(_0x256f9a,null))[_0x8e2d('0x16')](function(_0x736c10){if(_0x736c10){var _0x434da4=_0x736c10;var _0x220ad0={'from':_0x434da4['from'],'to':_0x434da4['to'],'subject':_0x434da4[_0x8e2d('0x93')],'html':htmlEntities[_0x8e2d('0x96')](_0x434da4[_0x8e2d('0x4b')]),'headers':{'Date':moment(_0x434da4[_0x8e2d('0x94')])[_0x8e2d('0x62')](_0x8e2d('0x97'))},'attachments':[]};if(_0x736c10['cc']){_0x220ad0[_0x8e2d('0x98')]['Cc']=_0x736c10['cc'];}if(_0x736c10[_0x8e2d('0x92')]){_0x220ad0[_0x8e2d('0x98')]['Bcc']=_0x736c10[_0x8e2d('0x92')];}return new BPromise(function(_0xed9607,_0xc80d40){if(_0x736c10[_0x8e2d('0x95')]){for(var _0x474c27=0x0;_0x474c27<_0x736c10['Attachments'][_0x8e2d('0x3b')];_0x474c27++){var _0x54e500=_0x736c10[_0x8e2d('0x95')][_0x474c27];var _0xd487f4=path[_0x8e2d('0x5a')](_0x1e7db6,_0x54e500[_0x8e2d('0x99')]);if(fs[_0x8e2d('0x9a')](_0xd487f4)){_0x220ad0[_0x8e2d('0x59')][_0x8e2d('0x9b')]({'name':_0x54e500[_0x8e2d('0x2d')],'contentType':_0x54e500['type'],'data':fs[_0x8e2d('0x9c')](_0xd487f4)});}}}emlformat[_0x8e2d('0x9d')](_0x220ad0,function(_0x5a560c,_0x3e430b){if(_0x5a560c)return _0xc80d40(_0x5a560c);fs[_0x8e2d('0x9e')](path[_0x8e2d('0x5a')](_0x2588b8,_0x340950),_0x3e430b);return _0xed9607(_0x3e430b);});});}})[_0x8e2d('0x16')](function(_0xbc5428){if(_0xbc5428){return _0x256f9a['download'](path[_0x8e2d('0x5a')](_0x2588b8,_0x340950),_0x340950,function(_0x26fe94){if(!_0x26fe94)fs[_0x8e2d('0x9f')](path[_0x8e2d('0x5a')](_0x2588b8,_0x340950));});}})['catch'](handleError(_0x256f9a,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index e466bab..0184827 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 _0x671d=['exports','MailMessage','save','update','emit'];(function(_0x841883,_0x408e74){var _0x2b4437=function(_0xdeb3a7){while(--_0xdeb3a7){_0x841883['push'](_0x841883['shift']());}};_0x2b4437(++_0x408e74);}(_0x671d,0x74));var _0xd671=function(_0xacb1e2,_0x55e0ab){_0xacb1e2=_0xacb1e2-0x0;var _0x463815=_0x671d[_0xacb1e2];return _0x463815;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0xd671('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd671('0x1'),'afterUpdate':_0xd671('0x2'),'afterDestroy':'remove'};function emitEvent(_0x585704){return function(_0x258099,_0x9a01b8,_0x846e05){MailMessageEvents[_0xd671('0x3')](_0x585704+':'+_0x258099['id'],_0x258099);MailMessageEvents[_0xd671('0x3')](_0x585704,_0x258099);_0x846e05(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xd671('0x4')]=MailMessageEvents; \ No newline at end of file +var _0xa58f=['setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x304e46,_0x54441f){var _0x5b8e13=function(_0x175ff2){while(--_0x175ff2){_0x304e46['push'](_0x304e46['shift']());}};_0x5b8e13(++_0x54441f);}(_0xa58f,0x19c));var _0xfa58=function(_0x2793ed,_0x17a25d){_0x2793ed=_0x2793ed-0x0;var _0x53c0be=_0xa58f[_0x2793ed];return _0x53c0be;};'use strict';var EventEmitter=require(_0xfa58('0x0'));var MailMessage=require(_0xfa58('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xfa58('0x2')](0x0);var events={'afterCreate':_0xfa58('0x3'),'afterUpdate':_0xfa58('0x4'),'afterDestroy':_0xfa58('0x5')};function emitEvent(_0xb9c3ac){return function(_0x4ac377,_0x57446e,_0x262967){MailMessageEvents['emit'](_0xb9c3ac+':'+_0x4ac377['id'],_0x4ac377);MailMessageEvents['emit'](_0xb9c3ac,_0x4ac377);_0x262967(null);};}for(var e in events){if(events[_0xfa58('0x6')](e)){var event=events[e];MailMessage[_0xfa58('0x7')](e,emitEvent(event));}}module[_0xfa58('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 64b76d5..9e91044 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 _0x5994=['secret','isNil','MailInteraction','findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','get','direction','toLowerCase','out'];(function(_0x4808e3,_0x5584e5){var _0x12b162=function(_0x2f2d4a){while(--_0x2f2d4a){_0x4808e3['push'](_0x4808e3['shift']());}};_0x12b162(++_0x5584e5);}(_0x5994,0xa5));var _0x4599=function(_0x32b948,_0x124e64){_0x32b948=_0x32b948-0x0;var _0x57f12b=_0x5994[_0x32b948];return _0x57f12b;};'use strict';var _=require(_0x4599('0x0'));var util=require(_0x4599('0x1'));var logger=require(_0x4599('0x2'))('api');var moment=require(_0x4599('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x4599('0x4'));var rimraf=require('rimraf');var config=require(_0x4599('0x5'));var attributes=require(_0x4599('0x6'));module[_0x4599('0x7')]=function(_0x2cabf6,_0x4d1f44){return _0x2cabf6[_0x4599('0x8')](_0x4599('0x9'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x4599('0xa'),'fields':[_0x4599('0xa')]},{'name':_0x4599('0xb'),'fields':[_0x4599('0xc'),_0x4599('0xd')],'type':_0x4599('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x55d82e,_0x5f283b,_0x10b99c){if(_0x55d82e['body']){_0x55d82e['plainBody']=htmlToText[_0x4599('0xf')](_0x55d82e[_0x4599('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x10b99c(null,_0x5f283b);},'afterCreate':function(_0x5896d6,_0x1327f3,_0x14233c){var _0x4181bb=_0x2cabf6['models'];var _0xdb1ad3=_0x5896d6[_0x4599('0x11')]({'plain':!![]});if(_0xdb1ad3[_0x4599('0x12')][_0x4599('0x13')]()==='in'||_0xdb1ad3[_0x4599('0x12')][_0x4599('0x13')]()===_0x4599('0x14')&&!_0xdb1ad3[_0x4599('0x15')]&&!_[_0x4599('0x16')](_0xdb1ad3['UserId'])){_0x4181bb[_0x4599('0x17')][_0x4599('0x18')]({'where':{'id':_0xdb1ad3['MailInteractionId']}})[_0x4599('0x19')](function(_0x2fc2ef){if(_0x2fc2ef){_0x2fc2ef[_0x4599('0x1a')]({'lastMsgAt':_0xdb1ad3['createdAt'],'lastMsgDirection':_0xdb1ad3[_0x4599('0x12')][_0x4599('0x13')]()});}})[_0x4599('0x1b')](function(_0x440280){console[_0x4599('0x1c')](_0x440280);});}_0x14233c();}},'charset':_0x4599('0x1d'),'collate':_0x4599('0x1e')});}; \ No newline at end of file +var _0xe7bd=['createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','html-to-text','path','rimraf','../../config/environment','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','update'];(function(_0x33c4d3,_0x1ab361){var _0x18197e=function(_0x943b20){while(--_0x943b20){_0x33c4d3['push'](_0x33c4d3['shift']());}};_0x18197e(++_0x1ab361);}(_0xe7bd,0x191));var _0xde7b=function(_0x14477e,_0x44d4da){_0x14477e=_0x14477e-0x0;var _0x5d4a05=_0xe7bd[_0x14477e];return _0x5d4a05;};'use strict';var _=require(_0xde7b('0x0'));var util=require(_0xde7b('0x1'));var logger=require(_0xde7b('0x2'))(_0xde7b('0x3'));var moment=require(_0xde7b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require(_0xde7b('0x5'));var fs=require('fs');var path=require(_0xde7b('0x6'));var rimraf=require(_0xde7b('0x7'));var config=require(_0xde7b('0x8'));var attributes=require('./mailMessage.attributes');module[_0xde7b('0x9')]=function(_0x547baa,_0x13de2b){return _0x547baa[_0xde7b('0xa')]('MailMessage',attributes,{'tableName':_0xde7b('0xb'),'paranoid':![],'indexes':[{'name':_0xde7b('0xc'),'fields':[_0xde7b('0xc')]},{'name':_0xde7b('0xd'),'fields':[_0xde7b('0xe'),_0xde7b('0xf')],'type':_0xde7b('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5fb1a9,_0xb2c076,_0x134640){if(_0x5fb1a9[_0xde7b('0x11')]){_0x5fb1a9[_0xde7b('0xe')]=htmlToText['fromString'](_0x5fb1a9[_0xde7b('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x134640(null,_0xb2c076);},'afterCreate':function(_0x2df774,_0x4f8bb8,_0xc49884){var _0xe57b9=_0x547baa[_0xde7b('0x12')];var _0x387ee2=_0x2df774[_0xde7b('0x13')]({'plain':!![]});if(_0x387ee2[_0xde7b('0x14')]['toLowerCase']()==='in'||_0x387ee2[_0xde7b('0x14')][_0xde7b('0x15')]()===_0xde7b('0x16')&&!_0x387ee2[_0xde7b('0x17')]&&!_[_0xde7b('0x18')](_0x387ee2[_0xde7b('0x19')])){_0xe57b9['MailInteraction'][_0xde7b('0x1a')]({'where':{'id':_0x387ee2['MailInteractionId']}})['then'](function(_0x478c92){if(_0x478c92){_0x478c92[_0xde7b('0x1b')]({'lastMsgAt':_0x387ee2[_0xde7b('0x1c')],'lastMsgDirection':_0x387ee2['direction']['toLowerCase']()});}})[_0xde7b('0x1d')](function(_0x21c915){console[_0xde7b('0x1e')](_0x21c915);});}_0xc49884();}},'charset':_0xde7b('0x1f'),'collate':_0xde7b('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index b66ceac..df31d5a 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 _0xb78e=['http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateMailMessage','MailMessage','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0xa14139,_0x2153ae){var _0xb35476=function(_0x40b6a7){while(--_0x40b6a7){_0xa14139['push'](_0xa14139['shift']());}};_0xb35476(++_0x2153ae);}(_0xb78e,0x1c9));var _0xeb78=function(_0x15cfc4,_0x14c447){_0x15cfc4=_0x15cfc4-0x0;var _0x5c7c80=_0xb78e[_0x15cfc4];return _0x5c7c80;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var moment=require('moment');var BPromise=require(_0xeb78('0x2'));var rs=require(_0xeb78('0x3'));var fs=require('fs');var Redis=require(_0xeb78('0x4'));var db=require(_0xeb78('0x5'))['db'];var utils=require(_0xeb78('0x6'));var logger=require(_0xeb78('0x7'))(_0xeb78('0x8'));var config=require(_0xeb78('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb78('0xa')][_0xeb78('0xb')]({'port':0x232a});config[_0xeb78('0xc')]=_[_0xeb78('0xd')](config[_0xeb78('0xc')],{'host':_0xeb78('0xe'),'port':0x18eb});var socket=require(_0xeb78('0xf'))(new Redis(config['redis']));require(_0xeb78('0x10'))[_0xeb78('0x11')](socket);function respondWithRpcPromise(_0xa1ca82,_0x46fbad,_0x125e97){return new BPromise(function(_0x402680,_0x15137b){return client[_0xeb78('0x12')](_0xa1ca82,_0x125e97)[_0xeb78('0x13')](function(_0x59d8d8){logger[_0xeb78('0x14')](_0xeb78('0x15'),_0x46fbad,_0xeb78('0x16'));logger[_0xeb78('0x17')](_0xeb78('0x18'),_0x46fbad,_0xeb78('0x16'),JSON[_0xeb78('0x19')](_0x59d8d8));if(_0x59d8d8[_0xeb78('0x1a')]){if(_0x59d8d8[_0xeb78('0x1a')][_0xeb78('0x1b')]===0x1f4){logger['error'](_0xeb78('0x15'),_0x46fbad,_0x59d8d8[_0xeb78('0x1a')]['message']);return _0x15137b(_0x59d8d8['error']['message']);}logger[_0xeb78('0x1a')]('MailMessage,\x20%s,\x20%s',_0x46fbad,_0x59d8d8[_0xeb78('0x1a')][_0xeb78('0x1c')]);return _0x402680(_0x59d8d8['error'][_0xeb78('0x1c')]);}else{logger['info'](_0xeb78('0x15'),_0x46fbad,_0xeb78('0x16'));_0x402680(_0x59d8d8['result'][_0xeb78('0x1c')]);}})[_0xeb78('0x1d')](function(_0x1cb338){logger['error'](_0xeb78('0x15'),_0x46fbad,_0x1cb338);_0x15137b(_0x1cb338);});});}exports[_0xeb78('0x1e')]=function(_0x4ab933){var _0x48b106=this;return new Promise(function(_0x455e30,_0x106c5d){return db[_0xeb78('0x1f')][_0xeb78('0x20')](_0x4ab933[_0xeb78('0x21')],{'raw':_0x4ab933[_0xeb78('0x22')]?_0x4ab933[_0xeb78('0x22')][_0xeb78('0x23')]===undefined?!![]:![]:!![]})[_0xeb78('0x13')](function(_0x52b8c1){logger['info']('CreateMailMessage',_0x4ab933);logger['debug'](_0xeb78('0x1e'),_0x4ab933,JSON['stringify'](_0x52b8c1));_0x455e30(_0x52b8c1);})[_0xeb78('0x1d')](function(_0x1fbf2f){logger['error'](_0xeb78('0x1e'),_0x1fbf2f['message'],_0x4ab933);_0x106c5d(_0x48b106[_0xeb78('0x1a')](0x1f4,_0x1fbf2f[_0xeb78('0x1c')]));});});}; \ No newline at end of file +var _0x1a37=['debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','CreateMailMessage','MailMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','register','request','then','request\x20sent'];(function(_0x490c82,_0x4f3395){var _0x49a4a2=function(_0x29cb94){while(--_0x29cb94){_0x490c82['push'](_0x490c82['shift']());}};_0x49a4a2(++_0x4f3395);}(_0x1a37,0xb4));var _0x71a3=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x1a37[_0x58dc25];return _0x21b0a7;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});config[_0x71a3('0xc')]=_[_0x71a3('0xd')](config[_0x71a3('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailMessage.socket')[_0x71a3('0xe')](socket);function respondWithRpcPromise(_0x18320a,_0x3709bc,_0x3aeb48){return new BPromise(function(_0x3a7fc1,_0x2215f2){return client[_0x71a3('0xf')](_0x18320a,_0x3aeb48)[_0x71a3('0x10')](function(_0x5c464c){logger['info']('MailMessage,\x20%s,\x20%s',_0x3709bc,_0x71a3('0x11'));logger[_0x71a3('0x12')](_0x71a3('0x13'),_0x3709bc,_0x71a3('0x11'),JSON[_0x71a3('0x14')](_0x5c464c));if(_0x5c464c[_0x71a3('0x15')]){if(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x16')]===0x1f4){logger[_0x71a3('0x15')](_0x71a3('0x17'),_0x3709bc,_0x5c464c[_0x71a3('0x15')]['message']);return _0x2215f2(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x3709bc,_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);return _0x3a7fc1(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);}else{logger[_0x71a3('0x19')](_0x71a3('0x17'),_0x3709bc,'request\x20sent');_0x3a7fc1(_0x5c464c[_0x71a3('0x1a')][_0x71a3('0x18')]);}})['catch'](function(_0x5f4562){logger[_0x71a3('0x15')](_0x71a3('0x17'),_0x3709bc,_0x5f4562);_0x2215f2(_0x5f4562);});});}exports[_0x71a3('0x1b')]=function(_0x1c4ec2){var _0x4a7980=this;return new Promise(function(_0x596328,_0x1ab947){return db[_0x71a3('0x1c')][_0x71a3('0x1d')](_0x1c4ec2[_0x71a3('0x1e')],{'raw':_0x1c4ec2[_0x71a3('0x1f')]?_0x1c4ec2['options'][_0x71a3('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x3bf78e){logger[_0x71a3('0x19')](_0x71a3('0x1b'),_0x1c4ec2);logger[_0x71a3('0x12')](_0x71a3('0x1b'),_0x1c4ec2,JSON[_0x71a3('0x14')](_0x3bf78e));_0x596328(_0x3bf78e);})['catch'](function(_0x26e6e7){logger[_0x71a3('0x15')](_0x71a3('0x1b'),_0x26e6e7[_0x71a3('0x18')],_0x1c4ec2);_0x1ab947(_0x4a7980[_0x71a3('0x15')](0x1f4,_0x26e6e7['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 8bb7eef..a90c530 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 _0x02ac=['save','update','emit','removeListener','register','length'];(function(_0x52980f,_0x47b3b0){var _0x1f52a1=function(_0x51dd63){while(--_0x51dd63){_0x52980f['push'](_0x52980f['shift']());}};_0x1f52a1(++_0x47b3b0);}(_0x02ac,0x1bc));var _0xc02a=function(_0x471863,_0xdd207){_0x471863=_0x471863-0x0;var _0x45c7ce=_0x02ac[_0x471863];return _0x45c7ce;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xc02a('0x0'),'remove',_0xc02a('0x1')];function createListener(_0x461b3b,_0x11e1ee){return function(_0x1c73a4){_0x11e1ee[_0xc02a('0x2')](_0x461b3b,_0x1c73a4);};}function removeListener(_0x57ec77,_0x5d052c){return function(){MailMessageEvents[_0xc02a('0x3')](_0x57ec77,_0x5d052c);};}exports[_0xc02a('0x4')]=function(_0x4d8164){for(var _0x551ebe=0x0,_0x3e2f1b=events[_0xc02a('0x5')];_0x551ebe<_0x3e2f1b;_0x551ebe++){var _0x2f933f=events[_0x551ebe];var _0x23f22f=createListener('mailMessage:'+_0x2f933f,_0x4d8164);MailMessageEvents['on'](_0x2f933f,_0x23f22f);}}; \ No newline at end of file +var _0x6b7b=['./mailMessage.events','save','remove','update','removeListener','register','mailMessage:'];(function(_0x28db09,_0x47800b){var _0x19fde8=function(_0x5eaaf7){while(--_0x5eaaf7){_0x28db09['push'](_0x28db09['shift']());}};_0x19fde8(++_0x47800b);}(_0x6b7b,0xe7));var _0xb6b7=function(_0x1b3f07,_0x2d7f13){_0x1b3f07=_0x1b3f07-0x0;var _0x3a3eb9=_0x6b7b[_0x1b3f07];return _0x3a3eb9;};'use strict';var MailMessageEvents=require(_0xb6b7('0x0'));var events=[_0xb6b7('0x1'),_0xb6b7('0x2'),_0xb6b7('0x3')];function createListener(_0x143e2e,_0x5af785){return function(_0x20cfc9){_0x5af785['emit'](_0x143e2e,_0x20cfc9);};}function removeListener(_0x35db2d,_0x43a736){return function(){MailMessageEvents[_0xb6b7('0x4')](_0x35db2d,_0x43a736);};}exports[_0xb6b7('0x5')]=function(_0x2839f2){for(var _0x3eff9d=0x0,_0x2c8601=events['length'];_0x3eff9d<_0x2c8601;_0x3eff9d++){var _0x112d0f=events[_0x3eff9d];var _0x246d9d=createListener(_0xb6b7('0x6')+_0x112d0f,_0x2839f2);MailMessageEvents['on'](_0x112d0f,_0x246d9d);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 9e3fa49..c9bcd9c 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 _0x3d9d=['/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','path','express','fs-extra','../../components/auth/service','./mailQueue.controller','get','index','/describe','isAuthenticated','/:id','show'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x3d9d,0x12d));var _0xd3d9=function(_0x279d15,_0x18d443){_0x279d15=_0x279d15-0x0;var _0x3b0413=_0x3d9d[_0x279d15];return _0x3b0413;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd3d9('0x0'));var timeout=require('connect-timeout');var express=require(_0xd3d9('0x1'));var router=express['Router']();var fs_extra=require(_0xd3d9('0x2'));var auth=require(_0xd3d9('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd3d9('0x4'));router[_0xd3d9('0x5')]('/',auth['isAuthenticated'](),controller[_0xd3d9('0x6')]);router[_0xd3d9('0x5')](_0xd3d9('0x7'),auth[_0xd3d9('0x8')](),controller['describe']);router[_0xd3d9('0x5')](_0xd3d9('0x9'),auth[_0xd3d9('0x8')](),controller[_0xd3d9('0xa')]);router[_0xd3d9('0x5')]('/:id/members',auth[_0xd3d9('0x8')](),controller['getMembers']);router[_0xd3d9('0x5')](_0xd3d9('0xb'),auth[_0xd3d9('0x8')](),controller['getTeams']);router[_0xd3d9('0x5')](_0xd3d9('0xc'),auth[_0xd3d9('0x8')](),controller[_0xd3d9('0xd')]);router[_0xd3d9('0xe')]('/',auth[_0xd3d9('0x8')](),controller[_0xd3d9('0xf')]);router[_0xd3d9('0xe')](_0xd3d9('0xb'),auth['isAuthenticated'](),controller[_0xd3d9('0x10')]);router[_0xd3d9('0xe')](_0xd3d9('0xc'),auth[_0xd3d9('0x8')](),controller[_0xd3d9('0x11')]);router[_0xd3d9('0x12')](_0xd3d9('0x9'),auth[_0xd3d9('0x8')](),controller[_0xd3d9('0x13')]);router[_0xd3d9('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xd3d9('0x15')]);router['delete']('/:id/teams',auth[_0xd3d9('0x8')](),controller[_0xd3d9('0x16')]);router[_0xd3d9('0x14')](_0xd3d9('0xc'),auth[_0xd3d9('0x8')](),controller[_0xd3d9('0x17')]);module['exports']=router; \ No newline at end of file +var _0x7187=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/members','getTeams','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','/:id/teams','removeAgents','exports','multer','util'];(function(_0x19159d,_0x3d05c8){var _0x35884a=function(_0xe419f8){while(--_0xe419f8){_0x19159d['push'](_0x19159d['shift']());}};_0x35884a(++_0x3d05c8);}(_0x7187,0x76));var _0x7718=function(_0x13c190,_0x5edc8e){_0x13c190=_0x13c190-0x0;var _0x58d0c1=_0x7187[_0x13c190];return _0x58d0c1;};'use strict';var multer=require(_0x7718('0x0'));var util=require(_0x7718('0x1'));var path=require(_0x7718('0x2'));var timeout=require('connect-timeout');var express=require(_0x7718('0x3'));var router=express['Router']();var fs_extra=require(_0x7718('0x4'));var auth=require(_0x7718('0x5'));var interaction=require(_0x7718('0x6'));var config=require(_0x7718('0x7'));var controller=require(_0x7718('0x8'));router[_0x7718('0x9')]('/',auth['isAuthenticated'](),controller[_0x7718('0xa')]);router['get'](_0x7718('0xb'),auth['isAuthenticated'](),controller[_0x7718('0xc')]);router[_0x7718('0x9')](_0x7718('0xd'),auth[_0x7718('0xe')](),controller[_0x7718('0xf')]);router[_0x7718('0x9')](_0x7718('0x10'),auth[_0x7718('0xe')](),controller['getMembers']);router['get']('/:id/teams',auth[_0x7718('0xe')](),controller[_0x7718('0x11')]);router[_0x7718('0x9')]('/:id/users',auth[_0x7718('0xe')](),controller['getAgents']);router[_0x7718('0x12')]('/',auth[_0x7718('0xe')](),controller[_0x7718('0x13')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x7718('0x14')]);router['post'](_0x7718('0x15'),auth[_0x7718('0xe')](),controller[_0x7718('0x16')]);router[_0x7718('0x17')](_0x7718('0xd'),auth[_0x7718('0xe')](),controller[_0x7718('0x18')]);router[_0x7718('0x19')](_0x7718('0xd'),auth[_0x7718('0xe')](),controller[_0x7718('0x1a')]);router[_0x7718('0x19')](_0x7718('0x1b'),auth[_0x7718('0xe')](),controller['removeTeams']);router[_0x7718('0x19')](_0x7718('0x15'),auth[_0x7718('0xe')](),controller[_0x7718('0x1c')]);module[_0x7718('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 63da4a4..ae49890 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 _0xa289=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','name'];(function(_0xff328d,_0x41598d){var _0x393b6e=function(_0x19cdea){while(--_0x19cdea){_0xff328d['push'](_0xff328d['shift']());}};_0x393b6e(++_0x41598d);}(_0xa289,0x126));var _0x9a28=function(_0xf883f5,_0x58b0a8){_0xf883f5=_0xf883f5-0x0;var _0x51fd4f=_0xa289[_0xf883f5];return _0x51fd4f;};'use strict';var Sequelize=require(_0x9a28('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x9a28('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9a28('0x2')]},'timeout':{'type':Sequelize[_0x9a28('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9a28('0x4')](_0x9a28('0x5'),_0x9a28('0x6'),_0x9a28('0x7'))}}; \ No newline at end of file +var _0x415e=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','name','STRING','INTEGER'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x415e,0x148));var _0xe415=function(_0x3a8551,_0x4c3a72){_0x3a8551=_0x3a8551-0x0;var _0x38fdb7=_0x415e[_0x3a8551];return _0x38fdb7;};'use strict';var Sequelize=require(_0xe415('0x0'));module[_0xe415('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe415('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe415('0x3')]},'timeout':{'type':Sequelize[_0xe415('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe415('0x5')](_0xe415('0x6'),_0xe415('0x7'),_0xe415('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index ad076ba..1369602 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 _0xae27=['MailQueueId','merge','filter','UserMailQueue','findAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','mailPause','getTeams','Team','addTeams','Agents','voicePause','interface','flatMap','sequelize','findOrCreate','forEach','userMailQueue:save','removeTeams','ids','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','transaction','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','User','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','MailQueues','destroy','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','describe','getMembers','findOne','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xae27,0xb2));var _0x7ae2=function(_0x5e709a,_0x1d7975){_0x5e709a=_0x5e709a-0x0;var _0x57401a=_0xae27[_0x5e709a];return _0x57401a;};'use strict';var BPromise=require(_0x7ae2('0x0'));var util=require(_0x7ae2('0x1'));var _=require(_0x7ae2('0x2'));var squel=require(_0x7ae2('0x3'));var Redis=require('ioredis');var qs=require(_0x7ae2('0x4'));var logger=require('../../config/logger')('api');var config=require(_0x7ae2('0x5'));var db=require(_0x7ae2('0x6'))['db'];config[_0x7ae2('0x7')]=_[_0x7ae2('0x8')](config[_0x7ae2('0x7')],{'host':_0x7ae2('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7ae2('0x7')]));require(_0x7ae2('0xa'))[_0x7ae2('0xb')](socket);function respondWithStatusCode(_0x314e1a,_0x222a28){_0x222a28=_0x222a28||0xcc;return function(_0x5e4c06){if(_0x5e4c06){return _0x314e1a[_0x7ae2('0xc')](_0x222a28);}return _0x314e1a[_0x7ae2('0xd')](_0x222a28)[_0x7ae2('0xe')]();};}function respondWithResult(_0x4511d9,_0x2edf0a){_0x2edf0a=_0x2edf0a||0xc8;return function(_0x13fcdf){if(_0x13fcdf){return _0x4511d9[_0x7ae2('0xd')](_0x2edf0a)[_0x7ae2('0xf')](_0x13fcdf);}};}function respondWithFilteredResult(_0x2125ec,_0x47e531){return function(_0x1bbf34){if(_0x1bbf34){var _0x4c8f71=typeof _0x47e531[_0x7ae2('0x10')]==='undefined'&&typeof _0x47e531['limit']===_0x7ae2('0x11');var _0x6b435c=_0x1bbf34[_0x7ae2('0x12')];var _0x5a3149=_0x4c8f71?0x0:_0x47e531['offset'];var _0x3f6aab=_0x4c8f71?_0x1bbf34[_0x7ae2('0x12')]:_0x47e531[_0x7ae2('0x10')]+_0x47e531[_0x7ae2('0x13')];var _0x41186c;if(_0x3f6aab>=_0x6b435c){_0x3f6aab=_0x6b435c;_0x41186c=0xc8;}else{_0x41186c=0xce;}_0x2125ec[_0x7ae2('0xd')](_0x41186c);return _0x2125ec[_0x7ae2('0x14')](_0x7ae2('0x15'),_0x5a3149+'-'+_0x3f6aab+'/'+_0x6b435c)[_0x7ae2('0xf')](_0x1bbf34);}return null;};}function saveUpdates(_0x27bc8a){return function(_0x16d69e){if(_0x16d69e){return _0x16d69e[_0x7ae2('0x16')](_0x27bc8a)['then'](function(_0x4bc454){return _0x4bc454;});}return null;};}function removeEntity(_0x52a76b){return function(_0x300758){if(_0x300758){return _0x300758['destroy']()[_0x7ae2('0x17')](function(){var _0x364f19=_0x300758['get']({'plain':!![]});var _0x422a8a=_0x7ae2('0x18');return db['UserProfileResource'][_0x7ae2('0x19')]({'where':{'type':_0x422a8a,'resourceId':_0x364f19['id']}})[_0x7ae2('0x17')](function(){return _0x300758;});})['then'](function(){_0x52a76b['status'](0xcc)[_0x7ae2('0xe')]();});}};}function handleEntityNotFound(_0x5483b6){return function(_0x2a3bc8){if(!_0x2a3bc8){_0x5483b6[_0x7ae2('0xc')](0x194);}return _0x2a3bc8;};}function handleError(_0x58d584,_0x3205e0){_0x3205e0=_0x3205e0||0x1f4;return function(_0x36bb82){logger[_0x7ae2('0x1a')](_0x36bb82[_0x7ae2('0x1b')]);if(_0x36bb82[_0x7ae2('0x1c')]){delete _0x36bb82['name'];}_0x58d584[_0x7ae2('0xd')](_0x3205e0)[_0x7ae2('0x1d')](_0x36bb82);};}exports[_0x7ae2('0x1e')]=function(_0x4244d3,_0x306af3){var _0x555886={};var _0x201e69={'count':0x0,'rows':[]};var _0x3c9da1=_[_0x7ae2('0x1f')](db[_0x7ae2('0x20')][_0x7ae2('0x21')],function(_0x28b5fb){return{'name':_0x28b5fb[_0x7ae2('0x22')],'type':_0x28b5fb[_0x7ae2('0x23')][_0x7ae2('0x24')]};});_0x555886=qs[_0x7ae2('0x25')](_0x3c9da1,_0x4244d3);var _0x51d083={'where':_0x555886[_0x7ae2('0x26')]};return db[_0x7ae2('0x20')][_0x7ae2('0x12')](_0x51d083)['then'](function(_0x300a41){_0x201e69[_0x7ae2('0x12')]=_0x300a41;_0x555886[_0x7ae2('0x27')]=qs[_0x7ae2('0x27')](_0x4244d3[_0x7ae2('0x28')]);return db[_0x7ae2('0x20')]['findAll'](_0x555886);})[_0x7ae2('0x17')](function(_0x51d8b4){_0x201e69[_0x7ae2('0x29')]=_0x51d8b4;return _0x201e69;})['then'](respondWithFilteredResult(_0x306af3,_0x555886))[_0x7ae2('0x2a')](handleError(_0x306af3,null));};exports[_0x7ae2('0x2b')]=function(_0x5a51b2,_0x41b128){var _0x33f56b={'raw':!![],'where':{'id':_0x5a51b2[_0x7ae2('0x2c')]['id']}},_0x3ce287={};_0x3ce287[_0x7ae2('0x2d')]=_[_0x7ae2('0x2e')](db[_0x7ae2('0x20')][_0x7ae2('0x21')]);_0x3ce287['query']=_[_0x7ae2('0x2e')](_0x5a51b2[_0x7ae2('0x28')]);_0x3ce287[_0x7ae2('0x2f')]=_[_0x7ae2('0x30')](_0x3ce287[_0x7ae2('0x2d')],_0x3ce287[_0x7ae2('0x28')]);_0x33f56b[_0x7ae2('0x31')]=_[_0x7ae2('0x30')](_0x3ce287[_0x7ae2('0x2d')],qs[_0x7ae2('0x32')](_0x5a51b2[_0x7ae2('0x28')][_0x7ae2('0x32')]));_0x33f56b[_0x7ae2('0x31')]=_0x33f56b[_0x7ae2('0x31')][_0x7ae2('0x33')]?_0x33f56b[_0x7ae2('0x31')]:_0x3ce287[_0x7ae2('0x2d')];if(_0x5a51b2[_0x7ae2('0x28')][_0x7ae2('0x34')]){_0x33f56b[_0x7ae2('0x27')]=[{'all':!![]}];}_0x33f56b=_['merge']({},_0x33f56b,_0x5a51b2[_0x7ae2('0x35')]);return db[_0x7ae2('0x20')][_0x7ae2('0x36')](_0x33f56b)[_0x7ae2('0x17')](handleEntityNotFound(_0x41b128,null))[_0x7ae2('0x17')](respondWithResult(_0x41b128,null))['catch'](handleError(_0x41b128,null));};exports[_0x7ae2('0x37')]=function(_0x4c07e7,_0x5c907c){return db['MailQueue'][_0x7ae2('0x37')](_0x4c07e7['body'],{})['then'](function(_0x2614bc){var _0x558528=_0x4c07e7[_0x7ae2('0x38')]['get']({'plain':!![]});if(!_0x558528)throw new Error(_0x7ae2('0x39'));if(_0x558528['role']===_0x7ae2('0x38')){var _0x3511e2=_0x2614bc[_0x7ae2('0x3a')]({'plain':!![]});var _0x33a8d5=_0x7ae2('0x18');return db[_0x7ae2('0x3b')][_0x7ae2('0x36')]({'where':{'name':_0x33a8d5,'userProfileId':_0x558528[_0x7ae2('0x3c')]},'raw':!![]})[_0x7ae2('0x17')](function(_0x44f32b){if(_0x44f32b&&_0x44f32b[_0x7ae2('0x3d')]===0x0){return db[_0x7ae2('0x3e')][_0x7ae2('0x37')]({'name':_0x3511e2[_0x7ae2('0x1c')],'resourceId':_0x3511e2['id'],'type':_0x44f32b[_0x7ae2('0x1c')],'sectionId':_0x44f32b['id']},{})[_0x7ae2('0x17')](function(){return _0x2614bc;});}else{return _0x2614bc;}})[_0x7ae2('0x2a')](function(_0x2a9719){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a9719);throw _0x2a9719;});}return _0x2614bc;})['then'](respondWithResult(_0x5c907c,0xc9))[_0x7ae2('0x2a')](handleError(_0x5c907c,null));};exports[_0x7ae2('0x16')]=function(_0x2d9e55,_0x80f80d){if(_0x2d9e55[_0x7ae2('0x3f')]['id']){delete _0x2d9e55[_0x7ae2('0x3f')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x2d9e55[_0x7ae2('0x2c')]['id']}})[_0x7ae2('0x17')](handleEntityNotFound(_0x80f80d,null))[_0x7ae2('0x17')](saveUpdates(_0x2d9e55[_0x7ae2('0x3f')],null))[_0x7ae2('0x17')](respondWithResult(_0x80f80d,null))[_0x7ae2('0x2a')](handleError(_0x80f80d,null));};exports[_0x7ae2('0x19')]=function(_0x1647e0,_0x1b27b1){return db[_0x7ae2('0x20')][_0x7ae2('0x36')]({'where':{'id':_0x1647e0[_0x7ae2('0x2c')]['id']}})[_0x7ae2('0x17')](handleEntityNotFound(_0x1b27b1,null))[_0x7ae2('0x17')](removeEntity(_0x1b27b1,null))[_0x7ae2('0x2a')](handleError(_0x1b27b1,null));};exports[_0x7ae2('0x40')]=function(_0x442e2e,_0x125b24){return db[_0x7ae2('0x20')][_0x7ae2('0x40')]()[_0x7ae2('0x17')](respondWithResult(_0x125b24,null))[_0x7ae2('0x2a')](handleError(_0x125b24,null));};exports[_0x7ae2('0x41')]=function(_0x56c8c2,_0x1bfb61){var _0x15c387={'raw':!![],'where':{}},_0x3b855e={},_0x4c6632;return db[_0x7ae2('0x20')][_0x7ae2('0x42')]({'where':{'id':_0x56c8c2[_0x7ae2('0x2c')]['id']}})[_0x7ae2('0x17')](handleEntityNotFound(_0x1bfb61,null))[_0x7ae2('0x17')](function(_0x16019a){if(_0x16019a){_0x4c6632=_0x16019a['get']({'plain':!![]});_0x3b855e[_0x7ae2('0x2d')]=_[_0x7ae2('0x2e')](db['UserMailQueue'][_0x7ae2('0x21')]);_0x3b855e[_0x7ae2('0x28')]=_[_0x7ae2('0x2e')](_0x56c8c2[_0x7ae2('0x28')]);_0x3b855e[_0x7ae2('0x2f')]=_['intersection'](_0x3b855e[_0x7ae2('0x2d')],_0x3b855e[_0x7ae2('0x28')]);_0x15c387[_0x7ae2('0x31')]=_[_0x7ae2('0x30')](_0x3b855e[_0x7ae2('0x2d')],qs[_0x7ae2('0x32')](_0x56c8c2[_0x7ae2('0x28')][_0x7ae2('0x32')]));_0x15c387['attributes']=_0x15c387[_0x7ae2('0x31')][_0x7ae2('0x33')]?_0x15c387['attributes']:_0x3b855e['model'];if(!_0x56c8c2[_0x7ae2('0x28')][_0x7ae2('0x43')](_0x7ae2('0x44'))){_0x15c387[_0x7ae2('0x13')]=qs[_0x7ae2('0x13')](_0x56c8c2[_0x7ae2('0x28')][_0x7ae2('0x13')]);_0x15c387['offset']=qs['offset'](_0x56c8c2[_0x7ae2('0x28')][_0x7ae2('0x10')]);}_0x15c387[_0x7ae2('0x45')]=qs['sort'](_0x56c8c2[_0x7ae2('0x28')][_0x7ae2('0x46')]);_0x15c387[_0x7ae2('0x26')]=qs[_0x7ae2('0x2f')](_[_0x7ae2('0x47')](_0x56c8c2[_0x7ae2('0x28')],_0x3b855e[_0x7ae2('0x2f')]));_0x15c387[_0x7ae2('0x26')][_0x7ae2('0x48')]=_0x16019a['id'];if(_0x56c8c2[_0x7ae2('0x28')]['filter']){_0x15c387[_0x7ae2('0x26')]=_[_0x7ae2('0x49')](_0x15c387[_0x7ae2('0x26')],{'$or':_[_0x7ae2('0x1f')](_0x15c387['attributes'],function(_0x275015){var _0x3c4f94={};_0x3c4f94[_0x275015]={'$like':'%'+_0x56c8c2[_0x7ae2('0x28')][_0x7ae2('0x4a')]+'%'};return _0x3c4f94;})});}_0x15c387=_[_0x7ae2('0x49')]({},_0x15c387,_0x56c8c2[_0x7ae2('0x35')]);return db[_0x7ae2('0x4b')][_0x7ae2('0x4c')](_0x15c387);}})[_0x7ae2('0x17')](function(_0x22b584){if(_0x22b584){return db['User']['findAndCountAll']({'where':{'id':_[_0x7ae2('0x1f')](_0x22b584,_0x7ae2('0x4d')),'role':_0x7ae2('0x4e')},'attributes':['id',_0x7ae2('0x1c'),'mailPause',_0x7ae2('0x4f'),_0x7ae2('0x50')]});}})[_0x7ae2('0x17')](function(_0x39f681){if(_0x39f681){return{'count':_0x39f681[_0x7ae2('0x12')],'rows':_[_0x7ae2('0x1f')](_0x39f681[_0x7ae2('0x29')],function(_0x147fb9){return{'membername':_0x147fb9['name'],'UserId':_0x147fb9['id'],'queue_name':_0x4c6632[_0x7ae2('0x1c')],'MailQueueId':_0x4c6632['id'],'interface':util[_0x7ae2('0x51')](_0x7ae2('0x52'),_0x7ae2('0x53'),_0x147fb9[_0x7ae2('0x1c')]),'penalty':0x0,'paused':_0x147fb9[_0x7ae2('0x54')],'createdAt':_0x147fb9[_0x7ae2('0x50')],'updatedAt':_0x147fb9[_0x7ae2('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7ae2('0x17')](respondWithFilteredResult(_0x1bfb61,_0x15c387))[_0x7ae2('0x2a')](handleError(_0x1bfb61,null));};exports[_0x7ae2('0x55')]=function(_0x273f9e,_0x2b6aaa){var _0x3fafbc={};var _0x259c5f={};var _0x29383d;var _0xdbcc8b;return db[_0x7ae2('0x20')][_0x7ae2('0x42')]({'where':{'id':_0x273f9e[_0x7ae2('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2b6aaa,null))['then'](function(_0x1d6eb9){if(_0x1d6eb9){_0x29383d=_0x1d6eb9;_0x259c5f[_0x7ae2('0x2d')]=_[_0x7ae2('0x2e')](db[_0x7ae2('0x56')][_0x7ae2('0x21')]);_0x259c5f[_0x7ae2('0x28')]=_[_0x7ae2('0x2e')](_0x273f9e['query']);_0x259c5f[_0x7ae2('0x2f')]=_[_0x7ae2('0x30')](_0x259c5f['model'],_0x259c5f['query']);_0x3fafbc['attributes']=_[_0x7ae2('0x30')](_0x259c5f[_0x7ae2('0x2d')],qs[_0x7ae2('0x32')](_0x273f9e[_0x7ae2('0x28')][_0x7ae2('0x32')]));_0x3fafbc[_0x7ae2('0x31')]=_0x3fafbc[_0x7ae2('0x31')][_0x7ae2('0x33')]?_0x3fafbc[_0x7ae2('0x31')]:_0x259c5f[_0x7ae2('0x2d')];_0x3fafbc[_0x7ae2('0x45')]=qs[_0x7ae2('0x46')](_0x273f9e[_0x7ae2('0x28')][_0x7ae2('0x46')]);_0x3fafbc['where']=qs[_0x7ae2('0x2f')](_['pick'](_0x273f9e['query'],_0x259c5f[_0x7ae2('0x2f')]));if(_0x273f9e[_0x7ae2('0x28')][_0x7ae2('0x4a')]){_0x3fafbc[_0x7ae2('0x26')]=_[_0x7ae2('0x49')](_0x3fafbc['where'],{'$or':_['map'](_0x3fafbc[_0x7ae2('0x31')],function(_0x3ea7d6){var _0x5a0695={};_0x5a0695[_0x3ea7d6]={'$like':'%'+_0x273f9e[_0x7ae2('0x28')][_0x7ae2('0x4a')]+'%'};return _0x5a0695;})});}_0x3fafbc=_[_0x7ae2('0x49')]({},_0x3fafbc,_0x273f9e[_0x7ae2('0x35')]);return _0x29383d[_0x7ae2('0x55')](_0x3fafbc);}})[_0x7ae2('0x17')](function(_0x4b8ed7){if(_0x4b8ed7){_0xdbcc8b=_0x4b8ed7[_0x7ae2('0x33')];if(!_0x273f9e['query']['hasOwnProperty'](_0x7ae2('0x44'))){_0x3fafbc['limit']=qs[_0x7ae2('0x13')](_0x273f9e['query'][_0x7ae2('0x13')]);_0x3fafbc[_0x7ae2('0x10')]=qs['offset'](_0x273f9e[_0x7ae2('0x28')][_0x7ae2('0x10')]);}return _0x29383d[_0x7ae2('0x55')](_0x3fafbc);}})[_0x7ae2('0x17')](function(_0x3000f6){if(_0x3000f6){return _0x3000f6?{'count':_0xdbcc8b,'rows':_0x3000f6}:null;}})[_0x7ae2('0x17')](respondWithResult(_0x2b6aaa,null))[_0x7ae2('0x2a')](handleError(_0x2b6aaa,null));};exports[_0x7ae2('0x57')]=function(_0x50a080,_0x30b40b){var _0x3f252b=_0x50a080[_0x7ae2('0x3f')]['ids'];return db[_0x7ae2('0x56')][_0x7ae2('0x4c')]({'where':{'id':_0x3f252b},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7ae2('0x58'),'attributes':['id',_0x7ae2('0x1c'),'online',_0x7ae2('0x59'),_0x7ae2('0x5a')],'raw':!![]}]})[_0x7ae2('0x17')](function(_0x3f0ca3){if(_0x3f0ca3){var _0x2646bf=_[_0x7ae2('0x5b')](_0x3f0ca3,function(_0x46b9c3){var _0x3b056f=_0x46b9c3[_0x7ae2('0x3a')]({'plain':!![]});return _0x3b056f['Agents'];});return db['MailQueue'][_0x7ae2('0x36')]({'where':{'id':_0x50a080[_0x7ae2('0x2c')]['id']}})[_0x7ae2('0x17')](function(_0xb2b1a3){return db[_0x7ae2('0x5c')]['transaction'](function(_0x4b8aa7){return _0xb2b1a3[_0x7ae2('0x57')](_0x3f252b,{'transaction':_0x4b8aa7})[_0x7ae2('0x17')](function(){return BPromise['each'](_0x2646bf,function(_0x1ded52){return db[_0x7ae2('0x4b')][_0x7ae2('0x5d')]({'where':{'UserId':_0x1ded52['id'],'MailQueueId':_0x50a080[_0x7ae2('0x2c')]['id']},'transaction':_0x4b8aa7});});})[_0x7ae2('0x17')](function(){_0x2646bf[_0x7ae2('0x5e')](function(_0x590426){socket['emit'](_0x7ae2('0x5f'),{'UserId':_0x590426['id'],'MailQueueId':_0xb2b1a3['id']});});});});});}})['then'](respondWithStatusCode(_0x30b40b,null))[_0x7ae2('0x2a')](handleError(_0x30b40b,null));};exports[_0x7ae2('0x60')]=function(_0x58c1c4,_0x198773){return db[_0x7ae2('0x56')]['findAll']({'where':{'id':_0x58c1c4[_0x7ae2('0x28')][_0x7ae2('0x61')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7ae2('0x58'),'attributes':['id'],'raw':!![]}]})[_0x7ae2('0x17')](handleEntityNotFound(_0x198773,null))[_0x7ae2('0x17')](function(_0x7e3bc){var _0x5ea362=_[_0x7ae2('0x1f')](_0x7e3bc,'id');var _0xb826c9=[];var _0xfbb47=[];var _0x52270c=squel[_0x7ae2('0x62')]();_0x52270c[_0x7ae2('0x63')](_0x7ae2('0x64'))['from']('team_has_mail_queues','tq')[_0x7ae2('0x65')](_0x7ae2('0x66'),'ut',_0x7ae2('0x67'))[_0x7ae2('0x26')](_0x7ae2('0x68'),_0x58c1c4[_0x7ae2('0x2c')]['id']);for(var _0x1500d8=0x0;_0x1500d8<_0x7e3bc[_0x7ae2('0x33')];_0x1500d8+=0x1){let _0x3ed597=_0x7e3bc[_0x1500d8];for(var _0x582699=0x0;_0x582699<_0x3ed597[_0x7ae2('0x58')][_0x7ae2('0x33')];_0x582699+=0x1){let _0x3948b5=_0x3ed597[_0x7ae2('0x58')][_0x582699];var _0x1bca4a=_0x52270c['clone']();_0x1bca4a[_0x7ae2('0x26')](_0x7ae2('0x69'),_0x3948b5['id']);_0xfbb47['push'](db[_0x7ae2('0x5c')][_0x7ae2('0x28')](_0x1bca4a[_0x7ae2('0x6a')](),{'type':db[_0x7ae2('0x5c')][_0x7ae2('0x6b')][_0x7ae2('0x6c')]})[_0x7ae2('0x17')](function(_0x2ea276){if(_0x2ea276[_0x7ae2('0x33')]===0x1){return _0x3948b5['id'];}else{var _0x393e12=_[_0x7ae2('0x6d')](_[_0x7ae2('0x1f')](_0x2ea276,_0x7ae2('0x6e')),function(_0x313d8e){return _['includes'](_0x5ea362,_0x313d8e);});if(_0x393e12){return _0x3948b5['id'];}}}));}}return BPromise[_0x7ae2('0x6f')](_0xfbb47)['then'](function(_0x28f4e1){_0xb826c9=_(_0xb826c9)[_0x7ae2('0x70')](_0x28f4e1)[_0x7ae2('0x71')]()['value']();return db[_0x7ae2('0x20')][_0x7ae2('0x36')]({'where':{'id':_0x58c1c4[_0x7ae2('0x2c')]['id']}})[_0x7ae2('0x17')](function(_0x30ee23){return db[_0x7ae2('0x5c')][_0x7ae2('0x72')](function(_0x3e1911){return _0x30ee23[_0x7ae2('0x60')](_0x58c1c4[_0x7ae2('0x28')][_0x7ae2('0x61')],{'transaction':_0x3e1911})['then'](function(){if(!_[_0x7ae2('0x73')](_0xb826c9)){return _0x30ee23[_0x7ae2('0x74')](_0xb826c9,{'transaction':_0x3e1911});}})[_0x7ae2('0x17')](function(){_0xb826c9[_0x7ae2('0x5e')](function(_0x5e3d69){socket['emit'](_0x7ae2('0x75'),{'UserId':_0x5e3d69,'MailQueueId':_0x30ee23['id']});});});});});});})['then'](respondWithStatusCode(_0x198773,null))[_0x7ae2('0x2a')](handleError(_0x198773,null));};exports['addAgents']=function(_0x2ee855,_0x42c216){return db[_0x7ae2('0x20')]['find']({'where':{'id':_0x2ee855[_0x7ae2('0x2c')]['id']}})[_0x7ae2('0x17')](handleEntityNotFound(_0x42c216,null))['then'](function(_0x3c754e){if(_0x3c754e){return _0x3c754e[_0x7ae2('0x76')](_0x2ee855['body'][_0x7ae2('0x61')],_[_0x7ae2('0x77')](_0x2ee855[_0x7ae2('0x3f')],['ids','id'])||{})[_0x7ae2('0x78')](function(_0x4f12e1){for(var _0x14d318=0x0;_0x14d318<_0x2ee855[_0x7ae2('0x3f')][_0x7ae2('0x61')][_0x7ae2('0x33')];_0x14d318+=0x1){socket[_0x7ae2('0x79')](_0x7ae2('0x5f'),{'UserId':Number(_0x2ee855['body']['ids'][_0x14d318]),'MailQueueId':Number(_0x2ee855[_0x7ae2('0x2c')]['id'])});}return _0x4f12e1;});}})[_0x7ae2('0x17')](respondWithResult(_0x42c216,null))[_0x7ae2('0x2a')](handleError(_0x42c216,null));};exports['removeAgents']=function(_0x4371d0,_0x2e940a){return db[_0x7ae2('0x20')][_0x7ae2('0x36')]({'where':{'id':_0x4371d0[_0x7ae2('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2e940a,null))[_0x7ae2('0x17')](function(_0x13c3fe){if(_0x13c3fe){return _0x13c3fe[_0x7ae2('0x74')](_0x4371d0[_0x7ae2('0x28')][_0x7ae2('0x61')])[_0x7ae2('0x17')](function(){if(_[_0x7ae2('0x7a')](_0x4371d0['query'][_0x7ae2('0x61')])){for(var _0x3d34aa=0x0;_0x3d34aa<_0x4371d0[_0x7ae2('0x28')]['ids'][_0x7ae2('0x33')];_0x3d34aa+=0x1){socket[_0x7ae2('0x79')](_0x7ae2('0x75'),{'UserId':Number(_0x4371d0['query']['ids'][_0x3d34aa]),'MailQueueId':Number(_0x4371d0[_0x7ae2('0x2c')]['id'])});}}else{socket['emit'](_0x7ae2('0x75'),{'UserId':Number(_0x4371d0['query'][_0x7ae2('0x61')]),'MailQueueId':Number(_0x4371d0[_0x7ae2('0x2c')]['id'])});}});}})['then'](respondWithStatusCode(_0x2e940a,null))[_0x7ae2('0x2a')](handleError(_0x2e940a,null));};exports[_0x7ae2('0x7b')]=function(_0x2717c5,_0x2a04b6){var _0x3b8fbe={};var _0x391765={};var _0x20dba2;var _0x499538;return db[_0x7ae2('0x20')]['findOne']({'where':{'id':_0x2717c5['params']['id']}})[_0x7ae2('0x17')](handleEntityNotFound(_0x2a04b6,null))['then'](function(_0xa1dd5b){if(_0xa1dd5b){_0x20dba2=_0xa1dd5b;_0x391765[_0x7ae2('0x2d')]=_[_0x7ae2('0x2e')](db[_0x7ae2('0x7c')][_0x7ae2('0x21')]);_0x391765[_0x7ae2('0x28')]=_[_0x7ae2('0x2e')](_0x2717c5['query']);_0x391765[_0x7ae2('0x2f')]=_[_0x7ae2('0x30')](_0x391765[_0x7ae2('0x2d')],_0x391765[_0x7ae2('0x28')]);_0x3b8fbe['attributes']=_[_0x7ae2('0x30')](_0x391765[_0x7ae2('0x2d')],qs['fields'](_0x2717c5['query'][_0x7ae2('0x32')]));_0x3b8fbe[_0x7ae2('0x31')]=_0x3b8fbe[_0x7ae2('0x31')][_0x7ae2('0x33')]?_0x3b8fbe[_0x7ae2('0x31')]:_0x391765[_0x7ae2('0x2d')];_0x3b8fbe['order']=qs['sort'](_0x2717c5[_0x7ae2('0x28')][_0x7ae2('0x46')]);_0x3b8fbe[_0x7ae2('0x26')]=qs['filters'](_[_0x7ae2('0x47')](_0x2717c5[_0x7ae2('0x28')],_0x391765[_0x7ae2('0x2f')]));if(_0x2717c5[_0x7ae2('0x28')][_0x7ae2('0x4a')]){_0x3b8fbe[_0x7ae2('0x26')]=_['merge'](_0x3b8fbe[_0x7ae2('0x26')],{'$or':_[_0x7ae2('0x1f')](_0x3b8fbe['attributes'],function(_0x5eab32){var _0x1940ef={};_0x1940ef[_0x5eab32]={'$like':'%'+_0x2717c5[_0x7ae2('0x28')][_0x7ae2('0x4a')]+'%'};return _0x1940ef;})});}_0x3b8fbe=_[_0x7ae2('0x49')]({},_0x3b8fbe,_0x2717c5[_0x7ae2('0x35')]);return _0x20dba2[_0x7ae2('0x7b')](_0x3b8fbe);}})[_0x7ae2('0x17')](function(_0x4fcfd4){if(_0x4fcfd4){_0x499538=_0x4fcfd4[_0x7ae2('0x33')];if(!_0x2717c5[_0x7ae2('0x28')]['hasOwnProperty'](_0x7ae2('0x44'))){_0x3b8fbe['limit']=qs['limit'](_0x2717c5[_0x7ae2('0x28')][_0x7ae2('0x13')]);_0x3b8fbe[_0x7ae2('0x10')]=qs[_0x7ae2('0x10')](_0x2717c5[_0x7ae2('0x28')]['offset']);}return _0x20dba2['getAgents'](_0x3b8fbe);}})[_0x7ae2('0x17')](function(_0x45d388){if(_0x45d388){return _0x45d388?{'count':_0x499538,'rows':_0x45d388}:null;}})['then'](respondWithResult(_0x2a04b6,null))[_0x7ae2('0x2a')](handleError(_0x2a04b6,null));}; \ No newline at end of file +var _0xe6a8=['defaults','redis','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','then','get','UserProfileResource','error','name','send','index','map','type','getOptions','where','MailQueue','include','query','findAll','rows','catch','show','params','model','keys','filters','attributes','intersection','fields','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','MailQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','hasOwnProperty','nolimit','order','sort','pick','MailQueueId','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','rawAttributes','filter','length','addTeams','ids','Agents','online','interface','flatMap','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','from','join','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','sequelize','transaction','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api'];(function(_0x3b6652,_0x32486d){var _0x14d39f=function(_0x3a595a){while(--_0x3a595a){_0x3b6652['push'](_0x3b6652['shift']());}};_0x14d39f(++_0x32486d);}(_0xe6a8,0xec));var _0x8e6a=function(_0x35e9f8,_0x1bac4a){_0x35e9f8=_0x35e9f8-0x0;var _0x4e4e79=_0xe6a8[_0x35e9f8];return _0x4e4e79;};'use strict';var BPromise=require(_0x8e6a('0x0'));var util=require(_0x8e6a('0x1'));var _=require(_0x8e6a('0x2'));var squel=require(_0x8e6a('0x3'));var Redis=require(_0x8e6a('0x4'));var qs=require(_0x8e6a('0x5'));var logger=require(_0x8e6a('0x6'))(_0x8e6a('0x7'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x8e6a('0x8')](config[_0x8e6a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8e6a('0xa'))(new Redis(config['redis']));require(_0x8e6a('0xb'))['register'](socket);function respondWithStatusCode(_0x4df992,_0x181db3){_0x181db3=_0x181db3||0xcc;return function(_0x4f889f){if(_0x4f889f){return _0x4df992[_0x8e6a('0xc')](_0x181db3);}return _0x4df992[_0x8e6a('0xd')](_0x181db3)[_0x8e6a('0xe')]();};}function respondWithResult(_0x5b059f,_0x530c8c){_0x530c8c=_0x530c8c||0xc8;return function(_0x488402){if(_0x488402){return _0x5b059f[_0x8e6a('0xd')](_0x530c8c)[_0x8e6a('0xf')](_0x488402);}};}function respondWithFilteredResult(_0x2cdabb,_0x4dd684){return function(_0x2bf2c2){if(_0x2bf2c2){var _0x2cd48f=typeof _0x4dd684['offset']===_0x8e6a('0x10')&&typeof _0x4dd684[_0x8e6a('0x11')]===_0x8e6a('0x10');var _0x90d63b=_0x2bf2c2['count'];var _0xd50d53=_0x2cd48f?0x0:_0x4dd684['offset'];var _0x11e79c=_0x2cd48f?_0x2bf2c2[_0x8e6a('0x12')]:_0x4dd684[_0x8e6a('0x13')]+_0x4dd684[_0x8e6a('0x11')];var _0x10815b;if(_0x11e79c>=_0x90d63b){_0x11e79c=_0x90d63b;_0x10815b=0xc8;}else{_0x10815b=0xce;}_0x2cdabb[_0x8e6a('0xd')](_0x10815b);return _0x2cdabb['set'](_0x8e6a('0x14'),_0xd50d53+'-'+_0x11e79c+'/'+_0x90d63b)[_0x8e6a('0xf')](_0x2bf2c2);}return null;};}function saveUpdates(_0x39da0c){return function(_0x413bd6){if(_0x413bd6){return _0x413bd6['update'](_0x39da0c)['then'](function(_0x560e99){return _0x560e99;});}return null;};}function removeEntity(_0x198dae){return function(_0x19d75b){if(_0x19d75b){return _0x19d75b['destroy']()[_0x8e6a('0x15')](function(){var _0x482085=_0x19d75b[_0x8e6a('0x16')]({'plain':!![]});var _0x4a1e50='MailQueues';return db[_0x8e6a('0x17')]['destroy']({'where':{'type':_0x4a1e50,'resourceId':_0x482085['id']}})['then'](function(){return _0x19d75b;});})[_0x8e6a('0x15')](function(){_0x198dae[_0x8e6a('0xd')](0xcc)[_0x8e6a('0xe')]();});}};}function handleEntityNotFound(_0x4cceb1){return function(_0xad2cb0){if(!_0xad2cb0){_0x4cceb1[_0x8e6a('0xc')](0x194);}return _0xad2cb0;};}function handleError(_0x5cc5b5,_0x4ffeb8){_0x4ffeb8=_0x4ffeb8||0x1f4;return function(_0x3d90d5){logger[_0x8e6a('0x18')](_0x3d90d5['stack']);if(_0x3d90d5[_0x8e6a('0x19')]){delete _0x3d90d5[_0x8e6a('0x19')];}_0x5cc5b5[_0x8e6a('0xd')](_0x4ffeb8)[_0x8e6a('0x1a')](_0x3d90d5);};}exports[_0x8e6a('0x1b')]=function(_0x27368c,_0x750721){var _0x155be2={};var _0x110f93={'count':0x0,'rows':[]};var _0x326fa3=_[_0x8e6a('0x1c')](db['MailQueue']['rawAttributes'],function(_0x45055b){return{'name':_0x45055b['fieldName'],'type':_0x45055b[_0x8e6a('0x1d')]['key']};});_0x155be2=qs[_0x8e6a('0x1e')](_0x326fa3,_0x27368c);var _0x487ee6={'where':_0x155be2[_0x8e6a('0x1f')]};return db[_0x8e6a('0x20')][_0x8e6a('0x12')](_0x487ee6)[_0x8e6a('0x15')](function(_0x175b9c){_0x110f93[_0x8e6a('0x12')]=_0x175b9c;_0x155be2['include']=qs[_0x8e6a('0x21')](_0x27368c[_0x8e6a('0x22')]);return db[_0x8e6a('0x20')][_0x8e6a('0x23')](_0x155be2);})['then'](function(_0x30b16f){_0x110f93[_0x8e6a('0x24')]=_0x30b16f;return _0x110f93;})[_0x8e6a('0x15')](respondWithFilteredResult(_0x750721,_0x155be2))[_0x8e6a('0x25')](handleError(_0x750721,null));};exports[_0x8e6a('0x26')]=function(_0x4e36ec,_0x2e318c){var _0x178839={'raw':!![],'where':{'id':_0x4e36ec[_0x8e6a('0x27')]['id']}},_0x33a627={};_0x33a627[_0x8e6a('0x28')]=_[_0x8e6a('0x29')](db['MailQueue']['rawAttributes']);_0x33a627[_0x8e6a('0x22')]=_[_0x8e6a('0x29')](_0x4e36ec[_0x8e6a('0x22')]);_0x33a627[_0x8e6a('0x2a')]=_['intersection'](_0x33a627[_0x8e6a('0x28')],_0x33a627['query']);_0x178839[_0x8e6a('0x2b')]=_[_0x8e6a('0x2c')](_0x33a627['model'],qs['fields'](_0x4e36ec[_0x8e6a('0x22')][_0x8e6a('0x2d')]));_0x178839[_0x8e6a('0x2b')]=_0x178839[_0x8e6a('0x2b')]['length']?_0x178839[_0x8e6a('0x2b')]:_0x33a627[_0x8e6a('0x28')];if(_0x4e36ec[_0x8e6a('0x22')][_0x8e6a('0x2e')]){_0x178839[_0x8e6a('0x21')]=[{'all':!![]}];}_0x178839=_[_0x8e6a('0x2f')]({},_0x178839,_0x4e36ec[_0x8e6a('0x30')]);return db[_0x8e6a('0x20')][_0x8e6a('0x31')](_0x178839)[_0x8e6a('0x15')](handleEntityNotFound(_0x2e318c,null))[_0x8e6a('0x15')](respondWithResult(_0x2e318c,null))[_0x8e6a('0x25')](handleError(_0x2e318c,null));};exports[_0x8e6a('0x32')]=function(_0x117c92,_0xd4ba8e){return db[_0x8e6a('0x20')]['create'](_0x117c92['body'],{})[_0x8e6a('0x15')](function(_0x1c4f02){var _0x3bc2e2=_0x117c92[_0x8e6a('0x33')][_0x8e6a('0x16')]({'plain':!![]});if(!_0x3bc2e2)throw new Error(_0x8e6a('0x34'));if(_0x3bc2e2['role']==='user'){var _0x3d08b8=_0x1c4f02[_0x8e6a('0x16')]({'plain':!![]});var _0x36f06b=_0x8e6a('0x35');return db[_0x8e6a('0x36')][_0x8e6a('0x31')]({'where':{'name':_0x36f06b,'userProfileId':_0x3bc2e2[_0x8e6a('0x37')]},'raw':!![]})['then'](function(_0x313f8e){if(_0x313f8e&&_0x313f8e['autoAssociation']===0x0){return db[_0x8e6a('0x17')][_0x8e6a('0x32')]({'name':_0x3d08b8['name'],'resourceId':_0x3d08b8['id'],'type':_0x313f8e['name'],'sectionId':_0x313f8e['id']},{})[_0x8e6a('0x15')](function(){return _0x1c4f02;});}else{return _0x1c4f02;}})[_0x8e6a('0x25')](function(_0x4a542a){logger[_0x8e6a('0x18')](_0x8e6a('0x38'),_0x4a542a);throw _0x4a542a;});}return _0x1c4f02;})['then'](respondWithResult(_0xd4ba8e,0xc9))[_0x8e6a('0x25')](handleError(_0xd4ba8e,null));};exports[_0x8e6a('0x39')]=function(_0x460522,_0x25dcf2){if(_0x460522['body']['id']){delete _0x460522['body']['id'];}return db[_0x8e6a('0x20')][_0x8e6a('0x31')]({'where':{'id':_0x460522[_0x8e6a('0x27')]['id']}})[_0x8e6a('0x15')](handleEntityNotFound(_0x25dcf2,null))['then'](saveUpdates(_0x460522[_0x8e6a('0x3a')],null))[_0x8e6a('0x15')](respondWithResult(_0x25dcf2,null))['catch'](handleError(_0x25dcf2,null));};exports['destroy']=function(_0x2d704a,_0x57e923){return db['MailQueue']['find']({'where':{'id':_0x2d704a[_0x8e6a('0x27')]['id']}})['then'](handleEntityNotFound(_0x57e923,null))['then'](removeEntity(_0x57e923,null))[_0x8e6a('0x25')](handleError(_0x57e923,null));};exports[_0x8e6a('0x3b')]=function(_0x1da865,_0x45bbc9){return db[_0x8e6a('0x20')][_0x8e6a('0x3b')]()['then'](respondWithResult(_0x45bbc9,null))[_0x8e6a('0x25')](handleError(_0x45bbc9,null));};exports[_0x8e6a('0x3c')]=function(_0x352787,_0x31cc79){var _0x2b8bb0={'raw':!![],'where':{}},_0x52452d={},_0xf7f54f;return db['MailQueue']['findOne']({'where':{'id':_0x352787[_0x8e6a('0x27')]['id']}})['then'](handleEntityNotFound(_0x31cc79,null))[_0x8e6a('0x15')](function(_0x501693){if(_0x501693){_0xf7f54f=_0x501693[_0x8e6a('0x16')]({'plain':!![]});_0x52452d[_0x8e6a('0x28')]=_[_0x8e6a('0x29')](db['UserMailQueue']['rawAttributes']);_0x52452d[_0x8e6a('0x22')]=_[_0x8e6a('0x29')](_0x352787[_0x8e6a('0x22')]);_0x52452d[_0x8e6a('0x2a')]=_[_0x8e6a('0x2c')](_0x52452d[_0x8e6a('0x28')],_0x52452d['query']);_0x2b8bb0[_0x8e6a('0x2b')]=_[_0x8e6a('0x2c')](_0x52452d[_0x8e6a('0x28')],qs[_0x8e6a('0x2d')](_0x352787[_0x8e6a('0x22')]['fields']));_0x2b8bb0[_0x8e6a('0x2b')]=_0x2b8bb0[_0x8e6a('0x2b')]['length']?_0x2b8bb0['attributes']:_0x52452d[_0x8e6a('0x28')];if(!_0x352787[_0x8e6a('0x22')][_0x8e6a('0x3d')](_0x8e6a('0x3e'))){_0x2b8bb0[_0x8e6a('0x11')]=qs[_0x8e6a('0x11')](_0x352787[_0x8e6a('0x22')][_0x8e6a('0x11')]);_0x2b8bb0['offset']=qs[_0x8e6a('0x13')](_0x352787[_0x8e6a('0x22')][_0x8e6a('0x13')]);}_0x2b8bb0[_0x8e6a('0x3f')]=qs[_0x8e6a('0x40')](_0x352787[_0x8e6a('0x22')][_0x8e6a('0x40')]);_0x2b8bb0[_0x8e6a('0x1f')]=qs[_0x8e6a('0x2a')](_[_0x8e6a('0x41')](_0x352787['query'],_0x52452d['filters']));_0x2b8bb0[_0x8e6a('0x1f')][_0x8e6a('0x42')]=_0x501693['id'];if(_0x352787[_0x8e6a('0x22')]['filter']){_0x2b8bb0[_0x8e6a('0x1f')]=_[_0x8e6a('0x2f')](_0x2b8bb0[_0x8e6a('0x1f')],{'$or':_[_0x8e6a('0x1c')](_0x2b8bb0[_0x8e6a('0x2b')],function(_0x2c11d7){var _0x38532f={};_0x38532f[_0x2c11d7]={'$like':'%'+_0x352787['query']['filter']+'%'};return _0x38532f;})});}_0x2b8bb0=_['merge']({},_0x2b8bb0,_0x352787[_0x8e6a('0x30')]);return db[_0x8e6a('0x43')][_0x8e6a('0x23')](_0x2b8bb0);}})[_0x8e6a('0x15')](function(_0x48d38e){if(_0x48d38e){return db[_0x8e6a('0x44')][_0x8e6a('0x45')]({'where':{'id':_[_0x8e6a('0x1c')](_0x48d38e,_0x8e6a('0x46')),'role':_0x8e6a('0x47')},'attributes':['id',_0x8e6a('0x19'),_0x8e6a('0x48'),_0x8e6a('0x49'),_0x8e6a('0x4a')]});}})[_0x8e6a('0x15')](function(_0x461b34){if(_0x461b34){return{'count':_0x461b34['count'],'rows':_['map'](_0x461b34[_0x8e6a('0x24')],function(_0x3911a6){return{'membername':_0x3911a6[_0x8e6a('0x19')],'UserId':_0x3911a6['id'],'queue_name':_0xf7f54f[_0x8e6a('0x19')],'MailQueueId':_0xf7f54f['id'],'interface':util[_0x8e6a('0x4b')]('%s/%s',_0x8e6a('0x4c'),_0x3911a6[_0x8e6a('0x19')]),'penalty':0x0,'paused':_0x3911a6[_0x8e6a('0x48')],'createdAt':_0x3911a6[_0x8e6a('0x4a')],'updatedAt':_0x3911a6['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8e6a('0x15')](respondWithFilteredResult(_0x31cc79,_0x2b8bb0))[_0x8e6a('0x25')](handleError(_0x31cc79,null));};exports[_0x8e6a('0x4d')]=function(_0x38e30f,_0x307641){var _0x15edcf={};var _0x19247e={};var _0x42ad10;var _0x44efe4;return db[_0x8e6a('0x20')][_0x8e6a('0x4e')]({'where':{'id':_0x38e30f['params']['id']}})[_0x8e6a('0x15')](handleEntityNotFound(_0x307641,null))[_0x8e6a('0x15')](function(_0x5c6d1e){if(_0x5c6d1e){_0x42ad10=_0x5c6d1e;_0x19247e[_0x8e6a('0x28')]=_['keys'](db[_0x8e6a('0x4f')][_0x8e6a('0x50')]);_0x19247e[_0x8e6a('0x22')]=_[_0x8e6a('0x29')](_0x38e30f['query']);_0x19247e[_0x8e6a('0x2a')]=_[_0x8e6a('0x2c')](_0x19247e[_0x8e6a('0x28')],_0x19247e[_0x8e6a('0x22')]);_0x15edcf['attributes']=_[_0x8e6a('0x2c')](_0x19247e[_0x8e6a('0x28')],qs[_0x8e6a('0x2d')](_0x38e30f[_0x8e6a('0x22')][_0x8e6a('0x2d')]));_0x15edcf[_0x8e6a('0x2b')]=_0x15edcf['attributes']['length']?_0x15edcf[_0x8e6a('0x2b')]:_0x19247e[_0x8e6a('0x28')];_0x15edcf[_0x8e6a('0x3f')]=qs['sort'](_0x38e30f[_0x8e6a('0x22')][_0x8e6a('0x40')]);_0x15edcf[_0x8e6a('0x1f')]=qs[_0x8e6a('0x2a')](_['pick'](_0x38e30f[_0x8e6a('0x22')],_0x19247e[_0x8e6a('0x2a')]));if(_0x38e30f[_0x8e6a('0x22')][_0x8e6a('0x51')]){_0x15edcf[_0x8e6a('0x1f')]=_[_0x8e6a('0x2f')](_0x15edcf[_0x8e6a('0x1f')],{'$or':_[_0x8e6a('0x1c')](_0x15edcf[_0x8e6a('0x2b')],function(_0x53f4db){var _0x156b8d={};_0x156b8d[_0x53f4db]={'$like':'%'+_0x38e30f[_0x8e6a('0x22')][_0x8e6a('0x51')]+'%'};return _0x156b8d;})});}_0x15edcf=_[_0x8e6a('0x2f')]({},_0x15edcf,_0x38e30f[_0x8e6a('0x30')]);return _0x42ad10['getTeams'](_0x15edcf);}})[_0x8e6a('0x15')](function(_0xf6a0f3){if(_0xf6a0f3){_0x44efe4=_0xf6a0f3[_0x8e6a('0x52')];if(!_0x38e30f[_0x8e6a('0x22')][_0x8e6a('0x3d')](_0x8e6a('0x3e'))){_0x15edcf[_0x8e6a('0x11')]=qs[_0x8e6a('0x11')](_0x38e30f['query'][_0x8e6a('0x11')]);_0x15edcf[_0x8e6a('0x13')]=qs[_0x8e6a('0x13')](_0x38e30f[_0x8e6a('0x22')][_0x8e6a('0x13')]);}return _0x42ad10[_0x8e6a('0x4d')](_0x15edcf);}})[_0x8e6a('0x15')](function(_0x416150){if(_0x416150){return _0x416150?{'count':_0x44efe4,'rows':_0x416150}:null;}})[_0x8e6a('0x15')](respondWithResult(_0x307641,null))[_0x8e6a('0x25')](handleError(_0x307641,null));};exports[_0x8e6a('0x53')]=function(_0xc05991,_0x114891){var _0x5029a5=_0xc05991[_0x8e6a('0x3a')][_0x8e6a('0x54')];return db['Team'][_0x8e6a('0x23')]({'where':{'id':_0x5029a5},'attributes':['id'],'include':[{'model':db[_0x8e6a('0x44')],'as':_0x8e6a('0x55'),'attributes':['id',_0x8e6a('0x19'),_0x8e6a('0x56'),'voicePause',_0x8e6a('0x57')],'raw':!![]}]})[_0x8e6a('0x15')](function(_0x1c9e06){if(_0x1c9e06){var _0x4f9d6d=_[_0x8e6a('0x58')](_0x1c9e06,function(_0x431db8){var _0x2520d9=_0x431db8[_0x8e6a('0x16')]({'plain':!![]});return _0x2520d9[_0x8e6a('0x55')];});return db[_0x8e6a('0x20')][_0x8e6a('0x31')]({'where':{'id':_0xc05991['params']['id']}})[_0x8e6a('0x15')](function(_0x109b34){return db['sequelize']['transaction'](function(_0x212751){return _0x109b34[_0x8e6a('0x53')](_0x5029a5,{'transaction':_0x212751})[_0x8e6a('0x15')](function(){return BPromise[_0x8e6a('0x59')](_0x4f9d6d,function(_0x5dcd0c){return db[_0x8e6a('0x43')][_0x8e6a('0x5a')]({'where':{'UserId':_0x5dcd0c['id'],'MailQueueId':_0xc05991['params']['id']},'transaction':_0x212751});});})[_0x8e6a('0x15')](function(){_0x4f9d6d[_0x8e6a('0x5b')](function(_0x304482){socket[_0x8e6a('0x5c')](_0x8e6a('0x5d'),{'UserId':_0x304482['id'],'MailQueueId':_0x109b34['id']});});});});});}})['then'](respondWithStatusCode(_0x114891,null))['catch'](handleError(_0x114891,null));};exports[_0x8e6a('0x5e')]=function(_0x1c1f43,_0x4f61ec){return db[_0x8e6a('0x4f')][_0x8e6a('0x23')]({'where':{'id':_0x1c1f43[_0x8e6a('0x22')][_0x8e6a('0x54')]},'attributes':['id'],'include':[{'model':db[_0x8e6a('0x44')],'as':_0x8e6a('0x55'),'attributes':['id'],'raw':!![]}]})[_0x8e6a('0x15')](handleEntityNotFound(_0x4f61ec,null))['then'](function(_0x1b79fb){var _0x13631e=_['map'](_0x1b79fb,'id');var _0xfe2b6d=[];var _0x59f7b2=[];var _0x15a07a=squel[_0x8e6a('0x5f')]();_0x15a07a[_0x8e6a('0x60')]('tq.TeamId')[_0x8e6a('0x61')]('team_has_mail_queues','tq')[_0x8e6a('0x62')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x8e6a('0x1f')](_0x8e6a('0x63'),_0x1c1f43[_0x8e6a('0x27')]['id']);for(var _0xf6dfcb=0x0;_0xf6dfcb<_0x1b79fb[_0x8e6a('0x52')];_0xf6dfcb+=0x1){let _0x3972b3=_0x1b79fb[_0xf6dfcb];for(var _0x5cf1e7=0x0;_0x5cf1e7<_0x3972b3[_0x8e6a('0x55')][_0x8e6a('0x52')];_0x5cf1e7+=0x1){let _0x4a8088=_0x3972b3[_0x8e6a('0x55')][_0x5cf1e7];var _0x1574bc=_0x15a07a['clone']();_0x1574bc[_0x8e6a('0x1f')](_0x8e6a('0x64'),_0x4a8088['id']);_0x59f7b2[_0x8e6a('0x65')](db['sequelize'][_0x8e6a('0x22')](_0x1574bc[_0x8e6a('0x66')](),{'type':db['sequelize'][_0x8e6a('0x67')][_0x8e6a('0x68')]})['then'](function(_0xe7fa67){if(_0xe7fa67[_0x8e6a('0x52')]===0x1){return _0x4a8088['id'];}else{var _0x21f8b6=_[_0x8e6a('0x69')](_[_0x8e6a('0x1c')](_0xe7fa67,_0x8e6a('0x6a')),function(_0x21aa90){return _[_0x8e6a('0x6b')](_0x13631e,_0x21aa90);});if(_0x21f8b6){return _0x4a8088['id'];}}}));}}return BPromise[_0x8e6a('0x6c')](_0x59f7b2)['then'](function(_0x3230b2){_0xfe2b6d=_(_0xfe2b6d)[_0x8e6a('0x6d')](_0x3230b2)[_0x8e6a('0x6e')]()[_0x8e6a('0x6f')]();return db[_0x8e6a('0x20')][_0x8e6a('0x31')]({'where':{'id':_0x1c1f43[_0x8e6a('0x27')]['id']}})[_0x8e6a('0x15')](function(_0x4ad8e2){return db[_0x8e6a('0x70')][_0x8e6a('0x71')](function(_0x384f2e){return _0x4ad8e2[_0x8e6a('0x5e')](_0x1c1f43[_0x8e6a('0x22')][_0x8e6a('0x54')],{'transaction':_0x384f2e})[_0x8e6a('0x15')](function(){if(!_[_0x8e6a('0x72')](_0xfe2b6d)){return _0x4ad8e2[_0x8e6a('0x73')](_0xfe2b6d,{'transaction':_0x384f2e});}})[_0x8e6a('0x15')](function(){_0xfe2b6d[_0x8e6a('0x5b')](function(_0x1f3a68){socket[_0x8e6a('0x5c')](_0x8e6a('0x74'),{'UserId':_0x1f3a68,'MailQueueId':_0x4ad8e2['id']});});});});});});})[_0x8e6a('0x15')](respondWithStatusCode(_0x4f61ec,null))[_0x8e6a('0x25')](handleError(_0x4f61ec,null));};exports[_0x8e6a('0x75')]=function(_0x58a93c,_0x5a511d){return db['MailQueue']['find']({'where':{'id':_0x58a93c[_0x8e6a('0x27')]['id']}})[_0x8e6a('0x15')](handleEntityNotFound(_0x5a511d,null))['then'](function(_0xb6cda6){if(_0xb6cda6){return _0xb6cda6[_0x8e6a('0x75')](_0x58a93c[_0x8e6a('0x3a')][_0x8e6a('0x54')],_[_0x8e6a('0x76')](_0x58a93c['body'],[_0x8e6a('0x54'),'id'])||{})[_0x8e6a('0x77')](function(_0x636215){for(var _0x33428b=0x0;_0x33428b<_0x58a93c[_0x8e6a('0x3a')][_0x8e6a('0x54')]['length'];_0x33428b+=0x1){socket[_0x8e6a('0x5c')](_0x8e6a('0x5d'),{'UserId':Number(_0x58a93c[_0x8e6a('0x3a')][_0x8e6a('0x54')][_0x33428b]),'MailQueueId':Number(_0x58a93c[_0x8e6a('0x27')]['id'])});}return _0x636215;});}})[_0x8e6a('0x15')](respondWithResult(_0x5a511d,null))[_0x8e6a('0x25')](handleError(_0x5a511d,null));};exports[_0x8e6a('0x73')]=function(_0x45d20b,_0x19a609){return db[_0x8e6a('0x20')][_0x8e6a('0x31')]({'where':{'id':_0x45d20b['params']['id']}})[_0x8e6a('0x15')](handleEntityNotFound(_0x19a609,null))[_0x8e6a('0x15')](function(_0x44bf16){if(_0x44bf16){return _0x44bf16[_0x8e6a('0x73')](_0x45d20b[_0x8e6a('0x22')]['ids'])[_0x8e6a('0x15')](function(){if(_[_0x8e6a('0x78')](_0x45d20b[_0x8e6a('0x22')][_0x8e6a('0x54')])){for(var _0x396178=0x0;_0x396178<_0x45d20b[_0x8e6a('0x22')][_0x8e6a('0x54')][_0x8e6a('0x52')];_0x396178+=0x1){socket[_0x8e6a('0x5c')](_0x8e6a('0x74'),{'UserId':Number(_0x45d20b[_0x8e6a('0x22')][_0x8e6a('0x54')][_0x396178]),'MailQueueId':Number(_0x45d20b[_0x8e6a('0x27')]['id'])});}}else{socket[_0x8e6a('0x5c')](_0x8e6a('0x74'),{'UserId':Number(_0x45d20b[_0x8e6a('0x22')][_0x8e6a('0x54')]),'MailQueueId':Number(_0x45d20b['params']['id'])});}});}})[_0x8e6a('0x15')](respondWithStatusCode(_0x19a609,null))['catch'](handleError(_0x19a609,null));};exports[_0x8e6a('0x79')]=function(_0x138eec,_0x1bb5fd){var _0x519d25={};var _0x27a0f={};var _0x3a05de;var _0x575c16;return db[_0x8e6a('0x20')][_0x8e6a('0x4e')]({'where':{'id':_0x138eec[_0x8e6a('0x27')]['id']}})[_0x8e6a('0x15')](handleEntityNotFound(_0x1bb5fd,null))[_0x8e6a('0x15')](function(_0x12761d){if(_0x12761d){_0x3a05de=_0x12761d;_0x27a0f[_0x8e6a('0x28')]=_[_0x8e6a('0x29')](db[_0x8e6a('0x44')][_0x8e6a('0x50')]);_0x27a0f[_0x8e6a('0x22')]=_['keys'](_0x138eec[_0x8e6a('0x22')]);_0x27a0f[_0x8e6a('0x2a')]=_['intersection'](_0x27a0f['model'],_0x27a0f[_0x8e6a('0x22')]);_0x519d25[_0x8e6a('0x2b')]=_['intersection'](_0x27a0f['model'],qs[_0x8e6a('0x2d')](_0x138eec['query']['fields']));_0x519d25[_0x8e6a('0x2b')]=_0x519d25[_0x8e6a('0x2b')][_0x8e6a('0x52')]?_0x519d25[_0x8e6a('0x2b')]:_0x27a0f[_0x8e6a('0x28')];_0x519d25[_0x8e6a('0x3f')]=qs[_0x8e6a('0x40')](_0x138eec[_0x8e6a('0x22')][_0x8e6a('0x40')]);_0x519d25[_0x8e6a('0x1f')]=qs['filters'](_[_0x8e6a('0x41')](_0x138eec[_0x8e6a('0x22')],_0x27a0f[_0x8e6a('0x2a')]));if(_0x138eec['query'][_0x8e6a('0x51')]){_0x519d25[_0x8e6a('0x1f')]=_[_0x8e6a('0x2f')](_0x519d25[_0x8e6a('0x1f')],{'$or':_[_0x8e6a('0x1c')](_0x519d25[_0x8e6a('0x2b')],function(_0x2f4d5c){var _0x1fb476={};_0x1fb476[_0x2f4d5c]={'$like':'%'+_0x138eec[_0x8e6a('0x22')][_0x8e6a('0x51')]+'%'};return _0x1fb476;})});}_0x519d25=_[_0x8e6a('0x2f')]({},_0x519d25,_0x138eec['options']);return _0x3a05de[_0x8e6a('0x79')](_0x519d25);}})[_0x8e6a('0x15')](function(_0x1da2f2){if(_0x1da2f2){_0x575c16=_0x1da2f2[_0x8e6a('0x52')];if(!_0x138eec['query'][_0x8e6a('0x3d')](_0x8e6a('0x3e'))){_0x519d25['limit']=qs['limit'](_0x138eec['query']['limit']);_0x519d25['offset']=qs[_0x8e6a('0x13')](_0x138eec['query'][_0x8e6a('0x13')]);}return _0x3a05de[_0x8e6a('0x79')](_0x519d25);}})[_0x8e6a('0x15')](function(_0x234bd2){if(_0x234bd2){return _0x234bd2?{'count':_0x575c16,'rows':_0x234bd2}:null;}})[_0x8e6a('0x15')](respondWithResult(_0x1bb5fd,null))[_0x8e6a('0x25')](handleError(_0x1bb5fd,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index d0b8469..95155b4 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 _0x3aa2=['setMaxListeners','remove','emit','../../mysqldb'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x3aa2,0x1c3));var _0x23aa=function(_0xa201ee,_0x37da32){_0xa201ee=_0xa201ee-0x0;var _0x3e104d=_0x3aa2[_0xa201ee];return _0x3e104d;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x23aa('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x23aa('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x23aa('0x2')};function emitEvent(_0x136af1){return function(_0x3e5031,_0x4d0995,_0x1045b9){MailQueueEvents[_0x23aa('0x3')](_0x136af1+':'+_0x3e5031['id'],_0x3e5031);MailQueueEvents[_0x23aa('0x3')](_0x136af1,_0x3e5031);_0x1045b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x4917=['save','update','emit','exports','events','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x31d37c,_0x572b1f){var _0x25c904=function(_0x6358f0){while(--_0x6358f0){_0x31d37c['push'](_0x31d37c['shift']());}};_0x25c904(++_0x572b1f);}(_0x4917,0x18c));var _0x7491=function(_0x3dea8b,_0x231a01){_0x3dea8b=_0x3dea8b-0x0;var _0x3a511e=_0x4917[_0x3dea8b];return _0x3a511e;};'use strict';var EventEmitter=require(_0x7491('0x0'));var MailQueue=require(_0x7491('0x1'))['db'][_0x7491('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x7491('0x3')](0x0);var events={'afterCreate':_0x7491('0x4'),'afterUpdate':_0x7491('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2784af){return function(_0x363749,_0x189c2f,_0x1ab3be){MailQueueEvents[_0x7491('0x6')](_0x2784af+':'+_0x363749['id'],_0x363749);MailQueueEvents[_0x7491('0x6')](_0x2784af,_0x363749);_0x1ab3be(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x7491('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index c46e883..b33664f 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 _0xf128=['path','../../config/environment','MailQueue','util','../../config/logger','api','bluebird','request-promise'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xf128,0x1a3));var _0x8f12=function(_0x384b64,_0x4f0784){_0x384b64=_0x384b64-0x0;var _0x3a8f2c=_0xf128[_0x384b64];return _0x3a8f2c;};'use strict';var _=require('lodash');var util=require(_0x8f12('0x0'));var logger=require(_0x8f12('0x1'))(_0x8f12('0x2'));var moment=require('moment');var BPromise=require(_0x8f12('0x3'));var rp=require(_0x8f12('0x4'));var fs=require('fs');var path=require(_0x8f12('0x5'));var rimraf=require('rimraf');var config=require(_0x8f12('0x6'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x46c01a,_0x29c541){return _0x46c01a['define'](_0x8f12('0x7'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7168=['rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x325fab,_0x20b721){var _0x4553c2=function(_0x2d5f5f){while(--_0x2d5f5f){_0x325fab['push'](_0x325fab['shift']());}};_0x4553c2(++_0x20b721);}(_0x7168,0x18d));var _0x8716=function(_0x2463f0,_0x11f4e0){_0x2463f0=_0x2463f0-0x0;var _0x1e6a90=_0x7168[_0x2463f0];return _0x1e6a90;};'use strict';var _=require(_0x8716('0x0'));var util=require(_0x8716('0x1'));var logger=require(_0x8716('0x2'))(_0x8716('0x3'));var moment=require('moment');var BPromise=require(_0x8716('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8716('0x5'));var rimraf=require(_0x8716('0x6'));var config=require(_0x8716('0x7'));var attributes=require(_0x8716('0x8'));module[_0x8716('0x9')]=function(_0xd69cc3,_0x37a96e){return _0xd69cc3[_0x8716('0xa')](_0x8716('0xb'),attributes,{'tableName':_0x8716('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index a731c2f..b96fdf7 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 _0x2c5f=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','limit','include','map','model','attributes','find','then','ShowMailQueue','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2e95a8,_0x4e25fc){var _0x306825=function(_0x4b2f90){while(--_0x4b2f90){_0x2e95a8['push'](_0x2e95a8['shift']());}};_0x306825(++_0x4e25fc);}(_0x2c5f,0x139));var _0xf2c5=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0x2c5f[_0x19159a];return _0xa677f4;};'use strict';var _=require(_0xf2c5('0x0'));var util=require(_0xf2c5('0x1'));var moment=require('moment');var BPromise=require(_0xf2c5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2c5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf2c5('0x4'));var logger=require(_0xf2c5('0x5'))(_0xf2c5('0x6'));var config=require(_0xf2c5('0x7'));var jayson=require(_0xf2c5('0x8'));var client=jayson[_0xf2c5('0x9')][_0xf2c5('0xa')]({'port':0x232a});config[_0xf2c5('0xb')]=_[_0xf2c5('0xc')](config[_0xf2c5('0xb')],{'host':_0xf2c5('0xd'),'port':0x18eb});var socket=require(_0xf2c5('0xe'))(new Redis(config[_0xf2c5('0xb')]));require(_0xf2c5('0xf'))[_0xf2c5('0x10')](socket);function respondWithRpcPromise(_0x1107d2,_0x424ad9,_0x322356){return new BPromise(function(_0x383ff3,_0x4a2ddb){return client['request'](_0x1107d2,_0x322356)['then'](function(_0x482d41){logger['info'](_0xf2c5('0x11'),_0x424ad9,_0xf2c5('0x12'));logger[_0xf2c5('0x13')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x424ad9,_0xf2c5('0x12'),JSON[_0xf2c5('0x14')](_0x482d41));if(_0x482d41[_0xf2c5('0x15')]){if(_0x482d41[_0xf2c5('0x15')]['code']===0x1f4){logger['error'](_0xf2c5('0x11'),_0x424ad9,_0x482d41[_0xf2c5('0x15')][_0xf2c5('0x16')]);return _0x4a2ddb(_0x482d41[_0xf2c5('0x15')][_0xf2c5('0x16')]);}logger[_0xf2c5('0x15')](_0xf2c5('0x11'),_0x424ad9,_0x482d41['error']['message']);return _0x383ff3(_0x482d41[_0xf2c5('0x15')][_0xf2c5('0x16')]);}else{logger[_0xf2c5('0x17')](_0xf2c5('0x11'),_0x424ad9,_0xf2c5('0x12'));_0x383ff3(_0x482d41[_0xf2c5('0x18')]['message']);}})[_0xf2c5('0x19')](function(_0x580699){logger[_0xf2c5('0x15')](_0xf2c5('0x11'),_0x424ad9,_0x580699);_0x4a2ddb(_0x580699);});});}exports[_0xf2c5('0x1a')]=function(_0x4e94b4){var _0x123540=this;return new Promise(function(_0x5bc454,_0x1bd38a){return db[_0xf2c5('0x1b')][_0xf2c5('0x1c')]({'raw':_0x4e94b4[_0xf2c5('0x1d')]?_0x4e94b4[_0xf2c5('0x1d')][_0xf2c5('0x1e')]===undefined?!![]:![]:!![],'where':_0x4e94b4[_0xf2c5('0x1d')]?_0x4e94b4[_0xf2c5('0x1d')][_0xf2c5('0x1f')]||null:null,'attributes':_0x4e94b4[_0xf2c5('0x1d')]?_0x4e94b4['options']['attributes']||null:null,'limit':_0x4e94b4[_0xf2c5('0x1d')]?_0x4e94b4[_0xf2c5('0x1d')][_0xf2c5('0x20')]||null:null,'include':_0x4e94b4[_0xf2c5('0x1d')]?_0x4e94b4[_0xf2c5('0x1d')][_0xf2c5('0x21')]?_[_0xf2c5('0x22')](_0x4e94b4['options'][_0xf2c5('0x21')],function(_0xed4da6){return{'model':db[_0xed4da6[_0xf2c5('0x23')]],'as':_0xed4da6['as'],'attributes':_0xed4da6[_0xf2c5('0x24')],'include':_0xed4da6[_0xf2c5('0x21')]?_[_0xf2c5('0x22')](_0xed4da6[_0xf2c5('0x21')],function(_0x25a452){return{'model':db[_0x25a452['model']],'as':_0x25a452['as'],'attributes':_0x25a452[_0xf2c5('0x24')],'include':_0x25a452['include']?_[_0xf2c5('0x22')](_0x25a452[_0xf2c5('0x21')],function(_0x55968c){return{'model':db[_0x55968c['model']],'as':_0x55968c['as'],'attributes':_0x55968c[_0xf2c5('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f89f0){logger[_0xf2c5('0x17')](_0xf2c5('0x1a'),_0x4e94b4);logger[_0xf2c5('0x13')](_0xf2c5('0x1a'),_0x4e94b4,JSON[_0xf2c5('0x14')](_0x4f89f0));_0x5bc454(_0x4f89f0);})[_0xf2c5('0x19')](function(_0x562127){logger['error'](_0xf2c5('0x1a'),_0x562127['message'],_0x4e94b4);_0x1bd38a(_0x123540[_0xf2c5('0x15')](0x1f4,_0x562127[_0xf2c5('0x16')]));});});};exports['ShowMailQueue']=function(_0xe5b25e){var _0x4f32bc=this;return new Promise(function(_0x24331f,_0x10f41c){return db[_0xf2c5('0x1b')][_0xf2c5('0x25')]({'raw':_0xe5b25e[_0xf2c5('0x1d')]?_0xe5b25e[_0xf2c5('0x1d')][_0xf2c5('0x1e')]===undefined?!![]:![]:!![],'where':_0xe5b25e[_0xf2c5('0x1d')]?_0xe5b25e[_0xf2c5('0x1d')][_0xf2c5('0x1f')]||null:null,'attributes':_0xe5b25e[_0xf2c5('0x1d')]?_0xe5b25e[_0xf2c5('0x1d')][_0xf2c5('0x24')]||null:null,'include':_0xe5b25e[_0xf2c5('0x1d')]?_0xe5b25e[_0xf2c5('0x1d')]['include']?_[_0xf2c5('0x22')](_0xe5b25e[_0xf2c5('0x1d')][_0xf2c5('0x21')],function(_0x46c204){return{'model':db[_0x46c204[_0xf2c5('0x23')]],'as':_0x46c204['as'],'attributes':_0x46c204['attributes'],'include':_0x46c204['include']?_[_0xf2c5('0x22')](_0x46c204[_0xf2c5('0x21')],function(_0x35298a){return{'model':db[_0x35298a[_0xf2c5('0x23')]],'as':_0x35298a['as'],'attributes':_0x35298a[_0xf2c5('0x24')],'include':_0x35298a[_0xf2c5('0x21')]?_[_0xf2c5('0x22')](_0x35298a['include'],function(_0x266049){return{'model':db[_0x266049['model']],'as':_0x266049['as'],'attributes':_0x266049['attributes']};}):[]};}):[]};}):[]:[]})[_0xf2c5('0x26')](function(_0x29e77d){logger[_0xf2c5('0x17')]('ShowMailQueue',_0xe5b25e);logger[_0xf2c5('0x13')]('ShowMailQueue',_0xe5b25e,JSON[_0xf2c5('0x14')](_0x29e77d));_0x24331f(_0x29e77d);})[_0xf2c5('0x19')](function(_0x1831b6){logger[_0xf2c5('0x15')](_0xf2c5('0x27'),_0x1831b6[_0xf2c5('0x16')],_0xe5b25e);_0x10f41c(_0x4f32bc[_0xf2c5('0x15')](0x1f4,_0x1831b6['message']));});});}; \ No newline at end of file +var _0x4fa1=['debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','where','attributes','limit','include','map','model','find','ShowMailQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x4fa1,0xb1));var _0x14fa=function(_0x2441fe,_0x13f1b0){_0x2441fe=_0x2441fe-0x0;var _0x46cb5a=_0x4fa1[_0x2441fe];return _0x46cb5a;};'use strict';var _=require(_0x14fa('0x0'));var util=require(_0x14fa('0x1'));var moment=require(_0x14fa('0x2'));var BPromise=require(_0x14fa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14fa('0x4'));var db=require(_0x14fa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x14fa('0x6'))('rpc');var config=require(_0x14fa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x14fa('0x8')][_0x14fa('0x9')]({'port':0x232a});config[_0x14fa('0xa')]=_[_0x14fa('0xb')](config[_0x14fa('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x14fa('0xa')]));require(_0x14fa('0xc'))[_0x14fa('0xd')](socket);function respondWithRpcPromise(_0x40f550,_0x3c75a3,_0xf51d52){return new BPromise(function(_0x2831cd,_0x57f410){return client[_0x14fa('0xe')](_0x40f550,_0xf51d52)[_0x14fa('0xf')](function(_0x554f5d){logger['info'](_0x14fa('0x10'),_0x3c75a3,_0x14fa('0x11'));logger[_0x14fa('0x12')](_0x14fa('0x13'),_0x3c75a3,_0x14fa('0x11'),JSON[_0x14fa('0x14')](_0x554f5d));if(_0x554f5d['error']){if(_0x554f5d[_0x14fa('0x15')][_0x14fa('0x16')]===0x1f4){logger[_0x14fa('0x15')]('MailQueue,\x20%s,\x20%s',_0x3c75a3,_0x554f5d[_0x14fa('0x15')][_0x14fa('0x17')]);return _0x57f410(_0x554f5d[_0x14fa('0x15')]['message']);}logger[_0x14fa('0x15')](_0x14fa('0x10'),_0x3c75a3,_0x554f5d['error'][_0x14fa('0x17')]);return _0x2831cd(_0x554f5d[_0x14fa('0x15')][_0x14fa('0x17')]);}else{logger[_0x14fa('0x18')](_0x14fa('0x10'),_0x3c75a3,_0x14fa('0x11'));_0x2831cd(_0x554f5d[_0x14fa('0x19')]['message']);}})[_0x14fa('0x1a')](function(_0x117cbc){logger[_0x14fa('0x15')](_0x14fa('0x10'),_0x3c75a3,_0x117cbc);_0x57f410(_0x117cbc);});});}exports[_0x14fa('0x1b')]=function(_0x2aff85){var _0x50aeb0=this;return new Promise(function(_0x47d8a4,_0x18af3f){return db[_0x14fa('0x1c')][_0x14fa('0x1d')]({'raw':_0x2aff85['options']?_0x2aff85[_0x14fa('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2aff85[_0x14fa('0x1e')]?_0x2aff85[_0x14fa('0x1e')][_0x14fa('0x1f')]||null:null,'attributes':_0x2aff85[_0x14fa('0x1e')]?_0x2aff85[_0x14fa('0x1e')][_0x14fa('0x20')]||null:null,'limit':_0x2aff85[_0x14fa('0x1e')]?_0x2aff85['options'][_0x14fa('0x21')]||null:null,'include':_0x2aff85['options']?_0x2aff85[_0x14fa('0x1e')][_0x14fa('0x22')]?_[_0x14fa('0x23')](_0x2aff85[_0x14fa('0x1e')][_0x14fa('0x22')],function(_0x1d6168){return{'model':db[_0x1d6168[_0x14fa('0x24')]],'as':_0x1d6168['as'],'attributes':_0x1d6168[_0x14fa('0x20')],'include':_0x1d6168[_0x14fa('0x22')]?_[_0x14fa('0x23')](_0x1d6168[_0x14fa('0x22')],function(_0x2b779a){return{'model':db[_0x2b779a[_0x14fa('0x24')]],'as':_0x2b779a['as'],'attributes':_0x2b779a[_0x14fa('0x20')],'include':_0x2b779a[_0x14fa('0x22')]?_[_0x14fa('0x23')](_0x2b779a[_0x14fa('0x22')],function(_0x4e20fa){return{'model':db[_0x4e20fa[_0x14fa('0x24')]],'as':_0x4e20fa['as'],'attributes':_0x4e20fa['attributes']};}):[]};}):[]};}):[]:[]})[_0x14fa('0xf')](function(_0xf74036){logger[_0x14fa('0x18')]('GetMailQueue',_0x2aff85);logger[_0x14fa('0x12')](_0x14fa('0x1b'),_0x2aff85,JSON[_0x14fa('0x14')](_0xf74036));_0x47d8a4(_0xf74036);})[_0x14fa('0x1a')](function(_0x101e7f){logger[_0x14fa('0x15')](_0x14fa('0x1b'),_0x101e7f[_0x14fa('0x17')],_0x2aff85);_0x18af3f(_0x50aeb0[_0x14fa('0x15')](0x1f4,_0x101e7f[_0x14fa('0x17')]));});});};exports['ShowMailQueue']=function(_0x54fa3d){var _0xa9d417=this;return new Promise(function(_0x269acb,_0x5d9471){return db[_0x14fa('0x1c')][_0x14fa('0x25')]({'raw':_0x54fa3d[_0x14fa('0x1e')]?_0x54fa3d['options']['raw']===undefined?!![]:![]:!![],'where':_0x54fa3d['options']?_0x54fa3d[_0x14fa('0x1e')][_0x14fa('0x1f')]||null:null,'attributes':_0x54fa3d[_0x14fa('0x1e')]?_0x54fa3d[_0x14fa('0x1e')][_0x14fa('0x20')]||null:null,'include':_0x54fa3d['options']?_0x54fa3d['options']['include']?_[_0x14fa('0x23')](_0x54fa3d['options'][_0x14fa('0x22')],function(_0x3c82b1){return{'model':db[_0x3c82b1['model']],'as':_0x3c82b1['as'],'attributes':_0x3c82b1[_0x14fa('0x20')],'include':_0x3c82b1[_0x14fa('0x22')]?_[_0x14fa('0x23')](_0x3c82b1[_0x14fa('0x22')],function(_0x258ae4){return{'model':db[_0x258ae4['model']],'as':_0x258ae4['as'],'attributes':_0x258ae4[_0x14fa('0x20')],'include':_0x258ae4[_0x14fa('0x22')]?_[_0x14fa('0x23')](_0x258ae4[_0x14fa('0x22')],function(_0x443575){return{'model':db[_0x443575['model']],'as':_0x443575['as'],'attributes':_0x443575[_0x14fa('0x20')]};}):[]};}):[]};}):[]:[]})[_0x14fa('0xf')](function(_0x2f2a60){logger[_0x14fa('0x18')](_0x14fa('0x26'),_0x54fa3d);logger['debug'](_0x14fa('0x26'),_0x54fa3d,JSON[_0x14fa('0x14')](_0x2f2a60));_0x269acb(_0x2f2a60);})['catch'](function(_0x268ba0){logger['error']('ShowMailQueue',_0x268ba0['message'],_0x54fa3d);_0x5d9471(_0xa9d417['error'](0x1f4,_0x268ba0[_0x14fa('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 9901135..44bb656 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 _0x8a08=['./mailQueue.events','save','emit','removeListener','register'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8a08,0x145));var _0x88a0=function(_0x3c2b1b,_0x5f1a0d){_0x3c2b1b=_0x3c2b1b-0x0;var _0x439bc5=_0x8a08[_0x3c2b1b];return _0x439bc5;};'use strict';var MailQueueEvents=require(_0x88a0('0x0'));var events=[_0x88a0('0x1'),'remove','update'];function createListener(_0x3d86f8,_0x34f9ed){return function(_0x374dc7){_0x34f9ed[_0x88a0('0x2')](_0x3d86f8,_0x374dc7);};}function removeListener(_0x521557,_0x4f293b){return function(){MailQueueEvents[_0x88a0('0x3')](_0x521557,_0x4f293b);};}exports[_0x88a0('0x4')]=function(_0x113a6f){for(var _0x59d1bf=0x0,_0x5e2e37=events['length'];_0x59d1bf<_0x5e2e37;_0x59d1bf++){var _0x41e8d0=events[_0x59d1bf];var _0x37a308=createListener('mailQueue:'+_0x41e8d0,_0x113a6f);MailQueueEvents['on'](_0x41e8d0,_0x37a308);}}; \ No newline at end of file +var _0x51f9=['length','mailQueue:','./mailQueue.events','save','update','emit','removeListener','register'];(function(_0x44156d,_0x555ce8){var _0x123f0c=function(_0x2b3721){while(--_0x2b3721){_0x44156d['push'](_0x44156d['shift']());}};_0x123f0c(++_0x555ce8);}(_0x51f9,0x132));var _0x951f=function(_0x2932cf,_0x362fd9){_0x2932cf=_0x2932cf-0x0;var _0x1711dd=_0x51f9[_0x2932cf];return _0x1711dd;};'use strict';var MailQueueEvents=require(_0x951f('0x0'));var events=[_0x951f('0x1'),'remove',_0x951f('0x2')];function createListener(_0x3739ed,_0x3fd3c9){return function(_0x571465){_0x3fd3c9[_0x951f('0x3')](_0x3739ed,_0x571465);};}function removeListener(_0x389886,_0x16fbe1){return function(){MailQueueEvents[_0x951f('0x4')](_0x389886,_0x16fbe1);};}exports[_0x951f('0x5')]=function(_0xd80e8a){for(var _0x2ca4e0=0x0,_0x4aca31=events[_0x951f('0x6')];_0x2ca4e0<_0x4aca31;_0x2ca4e0++){var _0x1ad764=events[_0x2ca4e0];var _0x1c8fc1=createListener(_0x951f('0x7')+_0x1ad764,_0xd80e8a);MailQueueEvents['on'](_0x1ad764,_0x1c8fc1);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 02b38cb..291fef1 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 _0x811f=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','index','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy'];(function(_0x1169e0,_0x568d5e){var _0x1ea9ff=function(_0x5de301){while(--_0x5de301){_0x1169e0['push'](_0x1169e0['shift']());}};_0x1ea9ff(++_0x568d5e);}(_0x811f,0xb0));var _0xf811=function(_0x2f7aa6,_0x2072e5){_0x2f7aa6=_0x2f7aa6-0x0;var _0x18d006=_0x811f[_0x2f7aa6];return _0x18d006;};'use strict';var multer=require(_0xf811('0x0'));var util=require(_0xf811('0x1'));var path=require(_0xf811('0x2'));var timeout=require(_0xf811('0x3'));var express=require(_0xf811('0x4'));var router=express[_0xf811('0x5')]();var fs_extra=require(_0xf811('0x6'));var auth=require(_0xf811('0x7'));var interaction=require(_0xf811('0x8'));var config=require(_0xf811('0x9'));var controller=require(_0xf811('0xa'));router[_0xf811('0xb')]('/',auth['isAuthenticated'](),controller[_0xf811('0xc')]);router[_0xf811('0xb')]('/describe',auth[_0xf811('0xd')](),controller[_0xf811('0xe')]);router[_0xf811('0xb')](_0xf811('0xf'),auth[_0xf811('0xd')](),controller[_0xf811('0x10')]);router[_0xf811('0x11')]('/',auth[_0xf811('0xd')](),controller['create']);router[_0xf811('0x12')](_0xf811('0xf'),auth[_0xf811('0xd')](),controller[_0xf811('0x13')]);router[_0xf811('0x14')](_0xf811('0xf'),auth['isAuthenticated'](),controller[_0xf811('0x15')]);module['exports']=router; \ No newline at end of file +var _0x2ca0=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','get','/describe','describe','post','create','put','/:id','update'];(function(_0x1f5d35,_0x13db91){var _0x27355a=function(_0x1a3932){while(--_0x1a3932){_0x1f5d35['push'](_0x1f5d35['shift']());}};_0x27355a(++_0x13db91);}(_0x2ca0,0x192));var _0x02ca=function(_0x3bc04d,_0x28ab50){_0x3bc04d=_0x3bc04d-0x0;var _0x2a543b=_0x2ca0[_0x3bc04d];return _0x2a543b;};'use strict';var multer=require(_0x02ca('0x0'));var util=require(_0x02ca('0x1'));var path=require('path');var timeout=require(_0x02ca('0x2'));var express=require(_0x02ca('0x3'));var router=express[_0x02ca('0x4')]();var fs_extra=require(_0x02ca('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x02ca('0x6'));var config=require(_0x02ca('0x7'));var controller=require(_0x02ca('0x8'));router['get']('/',auth[_0x02ca('0x9')](),controller['index']);router[_0x02ca('0xa')](_0x02ca('0xb'),auth[_0x02ca('0x9')](),controller[_0x02ca('0xc')]);router[_0x02ca('0xa')]('/:id',auth[_0x02ca('0x9')](),controller['show']);router[_0x02ca('0xd')]('/',auth[_0x02ca('0x9')](),controller[_0x02ca('0xe')]);router[_0x02ca('0xf')](_0x02ca('0x10'),auth[_0x02ca('0x9')](),controller[_0x02ca('0x11')]);router[_0x02ca('0x12')](_0x02ca('0x10'),auth[_0x02ca('0x9')](),controller[_0x02ca('0x13')]);module[_0x02ca('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 6b84931..08c92cc 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 _0x444a=['moment','exports','STRING','DATE'];(function(_0x3bd3d2,_0x413068){var _0x569624=function(_0x117a96){while(--_0x117a96){_0x3bd3d2['push'](_0x3bd3d2['shift']());}};_0x569624(++_0x413068);}(_0x444a,0x170));var _0xa444=function(_0x3b3750,_0x28f3b8){_0x3b3750=_0x3b3750-0x0;var _0x1b9e8b=_0x444a[_0x3b3750];return _0x1b9e8b;};'use strict';var moment=require(_0xa444('0x0'));var Sequelize=require('sequelize');module[_0xa444('0x1')]={'uniqueid':{'type':Sequelize[_0xa444('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa444('0x2')]},'joinAt':{'type':Sequelize[_0xa444('0x3')]},'leaveAt':{'type':Sequelize[_0xa444('0x3')]},'acceptAt':{'type':Sequelize[_0xa444('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa444('0x2')]}}; \ No newline at end of file +var _0xb072=['DATE','moment','sequelize','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb072,0x1cd));var _0x2b07=function(_0x289895,_0x33b3f9){_0x289895=_0x289895-0x0;var _0x2b4dcd=_0xb072[_0x289895];return _0x2b4dcd;};'use strict';var moment=require(_0x2b07('0x0'));var Sequelize=require(_0x2b07('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x2b07('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2b07('0x2')]},'joinAt':{'type':Sequelize[_0x2b07('0x3')]},'leaveAt':{'type':Sequelize[_0x2b07('0x3')]},'acceptAt':{'type':Sequelize[_0x2b07('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x2b07('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 3dc27ce..a71c32d 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 _0x0598=['include','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','json','undefined','limit','count','offset','set','apply','update','destroy','then','end','error','stack','name','index','map','MailQueueReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x0598,0x92));var _0x8059=function(_0x5e9708,_0x55c5d0){_0x5e9708=_0x5e9708-0x0;var _0xef1926=_0x0598[_0x5e9708];return _0xef1926;};'use strict';var emlformat=require(_0x8059('0x0'));var rimraf=require(_0x8059('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8059('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8059('0x3'));var Mustache=require(_0x8059('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8059('0x5'));var ejs=require(_0x8059('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8059('0x7'));var crypto=require(_0x8059('0x8'));var jsforce=require(_0x8059('0x9'));var deskjs=require(_0x8059('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8059('0xb'));var Redis=require(_0x8059('0xc'));var authService=require(_0x8059('0xd'));var qs=require(_0x8059('0xe'));var as=require(_0x8059('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8059('0x10'));var utils=require(_0x8059('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ead10,_0x2d26e2){_0x2d26e2=_0x2d26e2||0xcc;return function(_0x306467){if(_0x306467){return _0x1ead10[_0x8059('0x12')](_0x2d26e2);}return _0x1ead10[_0x8059('0x13')](_0x2d26e2)['end']();};}function respondWithResult(_0x11218f,_0x5480a5){_0x5480a5=_0x5480a5||0xc8;return function(_0x346b23){if(_0x346b23){return _0x11218f['status'](_0x5480a5)[_0x8059('0x14')](_0x346b23);}};}function respondWithFilteredResult(_0x13bf07,_0x4810fd){return function(_0x4d3873){if(_0x4d3873){var _0x516c1f=typeof _0x4810fd['offset']===_0x8059('0x15')&&typeof _0x4810fd[_0x8059('0x16')]===_0x8059('0x15');var _0x246c9d=_0x4d3873[_0x8059('0x17')];var _0x4b6d55=_0x516c1f?0x0:_0x4810fd[_0x8059('0x18')];var _0x2bb670=_0x516c1f?_0x4d3873[_0x8059('0x17')]:_0x4810fd[_0x8059('0x18')]+_0x4810fd['limit'];var _0x5456a9;if(_0x2bb670>=_0x246c9d){_0x2bb670=_0x246c9d;_0x5456a9=0xc8;}else{_0x5456a9=0xce;}_0x13bf07['status'](_0x5456a9);return _0x13bf07[_0x8059('0x19')]('Content-Range',_0x4b6d55+'-'+_0x2bb670+'/'+_0x246c9d)[_0x8059('0x14')](_0x4d3873);}return null;};}function patchUpdates(_0x56d794){return function(_0x466a88){try{jsonpatch[_0x8059('0x1a')](_0x466a88,_0x56d794,!![]);}catch(_0x1e9ac5){return BPromise['reject'](_0x1e9ac5);}return _0x466a88['save']();};}function saveUpdates(_0x21a80f,_0x232f1b){return function(_0x32aeda){if(_0x32aeda){return _0x32aeda[_0x8059('0x1b')](_0x21a80f)['then'](function(_0x3bc226){return _0x3bc226;});}return null;};}function removeEntity(_0x21ac82,_0x3da080){return function(_0x5449d9){if(_0x5449d9){return _0x5449d9[_0x8059('0x1c')]()[_0x8059('0x1d')](function(){_0x21ac82[_0x8059('0x13')](0xcc)[_0x8059('0x1e')]();});}};}function handleEntityNotFound(_0x59d3a6,_0x140f64){return function(_0x2cd179){if(!_0x2cd179){_0x59d3a6[_0x8059('0x12')](0x194);}return _0x2cd179;};}function handleError(_0x3e2d2b,_0x202b30){_0x202b30=_0x202b30||0x1f4;return function(_0x54b88b){logger[_0x8059('0x1f')](_0x54b88b[_0x8059('0x20')]);if(_0x54b88b[_0x8059('0x21')]){delete _0x54b88b['name'];}_0x3e2d2b['status'](_0x202b30)['send'](_0x54b88b);};}exports[_0x8059('0x22')]=function(_0xbebe0e,_0xc32b1f){var _0x1009af={},_0x59abe9={},_0x1eb71b={'count':0x0,'rows':[]};var _0x50b737=_[_0x8059('0x23')](db[_0x8059('0x24')]['rawAttributes'],function(_0x3814f5){return{'name':_0x3814f5[_0x8059('0x25')],'type':_0x3814f5[_0x8059('0x26')][_0x8059('0x27')]};});_0x59abe9[_0x8059('0x28')]=_[_0x8059('0x23')](_0x50b737,_0x8059('0x21'));_0x59abe9[_0x8059('0x29')]=_['keys'](_0xbebe0e[_0x8059('0x29')]);_0x59abe9[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],_0x59abe9[_0x8059('0x29')]);_0x1009af['attributes']=_[_0x8059('0x2b')](_0x59abe9[_0x8059('0x28')],qs[_0x8059('0x2c')](_0xbebe0e[_0x8059('0x29')][_0x8059('0x2c')]));_0x1009af[_0x8059('0x2d')]=_0x1009af[_0x8059('0x2d')][_0x8059('0x2e')]?_0x1009af[_0x8059('0x2d')]:_0x59abe9[_0x8059('0x28')];if(!_0xbebe0e['query'][_0x8059('0x2f')]('nolimit')){_0x1009af[_0x8059('0x16')]=qs['limit'](_0xbebe0e['query'][_0x8059('0x16')]);_0x1009af['offset']=qs[_0x8059('0x18')](_0xbebe0e['query'][_0x8059('0x18')]);}_0x1009af['order']=qs[_0x8059('0x30')](_0xbebe0e[_0x8059('0x29')]['sort']);_0x1009af[_0x8059('0x31')]=qs[_0x8059('0x2a')](_[_0x8059('0x32')](_0xbebe0e['query'],_0x59abe9[_0x8059('0x2a')]),_0x50b737);if(_0xbebe0e['query'][_0x8059('0x33')]){_0x1009af['where']=_[_0x8059('0x34')](_0x1009af[_0x8059('0x31')],{'$or':_[_0x8059('0x23')](_0x50b737,function(_0xb3b3c1){if(_0xb3b3c1['type']!==_0x8059('0x35')){var _0x55aaec={};_0x55aaec[_0xb3b3c1['name']]={'$like':'%'+_0xbebe0e[_0x8059('0x29')][_0x8059('0x33')]+'%'};return _0x55aaec;}})});}_0x1009af=_[_0x8059('0x34')]({},_0x1009af,_0xbebe0e[_0x8059('0x36')]);var _0x2f68b0={'where':_0x1009af['where']};return db['MailQueueReport']['count'](_0x2f68b0)['then'](function(_0x373e10){_0x1eb71b[_0x8059('0x17')]=_0x373e10;if(_0xbebe0e[_0x8059('0x29')]['includeAll']){_0x1009af[_0x8059('0x37')]=[{'all':!![]}];}return db[_0x8059('0x24')]['findAll'](_0x1009af);})[_0x8059('0x1d')](function(_0x2980cb){_0x1eb71b[_0x8059('0x38')]=_0x2980cb;return _0x1eb71b;})['then'](respondWithFilteredResult(_0xc32b1f,_0x1009af))[_0x8059('0x39')](handleError(_0xc32b1f,null));};exports[_0x8059('0x3a')]=function(_0x57eb56,_0x338493){var _0x280047={'raw':!![],'where':{'id':_0x57eb56[_0x8059('0x3b')]['id']}},_0x3f00de={};_0x3f00de[_0x8059('0x28')]=_[_0x8059('0x3c')](db[_0x8059('0x24')][_0x8059('0x3d')]);_0x3f00de[_0x8059('0x29')]=_[_0x8059('0x3c')](_0x57eb56[_0x8059('0x29')]);_0x3f00de[_0x8059('0x2a')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],_0x3f00de[_0x8059('0x29')]);_0x280047[_0x8059('0x2d')]=_[_0x8059('0x2b')](_0x3f00de[_0x8059('0x28')],qs[_0x8059('0x2c')](_0x57eb56[_0x8059('0x29')][_0x8059('0x2c')]));_0x280047[_0x8059('0x2d')]=_0x280047[_0x8059('0x2d')]['length']?_0x280047[_0x8059('0x2d')]:_0x3f00de['model'];if(_0x57eb56['query'][_0x8059('0x3e')]){_0x280047['include']=[{'all':!![]}];}_0x280047=_[_0x8059('0x34')]({},_0x280047,_0x57eb56['options']);return db[_0x8059('0x24')][_0x8059('0x3f')](_0x280047)[_0x8059('0x1d')](handleEntityNotFound(_0x338493,null))[_0x8059('0x1d')](respondWithResult(_0x338493,null))[_0x8059('0x39')](handleError(_0x338493,null));};exports[_0x8059('0x40')]=function(_0x538ab6,_0x301dca){return db['MailQueueReport'][_0x8059('0x40')](_0x538ab6[_0x8059('0x41')],{})[_0x8059('0x1d')](respondWithResult(_0x301dca,0xc9))['catch'](handleError(_0x301dca,null));};exports[_0x8059('0x1b')]=function(_0x120665,_0x46bec8){if(_0x120665[_0x8059('0x41')]['id']){delete _0x120665['body']['id'];}return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x120665[_0x8059('0x3b')]['id']}})['then'](handleEntityNotFound(_0x46bec8,null))[_0x8059('0x1d')](saveUpdates(_0x120665['body'],null))['then'](respondWithResult(_0x46bec8,null))[_0x8059('0x39')](handleError(_0x46bec8,null));};exports['destroy']=function(_0x20caa3,_0x54d2d2){return db[_0x8059('0x24')][_0x8059('0x3f')]({'where':{'id':_0x20caa3['params']['id']}})[_0x8059('0x1d')](handleEntityNotFound(_0x54d2d2,null))['then'](removeEntity(_0x54d2d2,null))[_0x8059('0x39')](handleError(_0x54d2d2,null));};exports[_0x8059('0x42')]=function(_0x429cf0,_0x5d5f16){return db[_0x8059('0x24')]['describe']()[_0x8059('0x1d')](respondWithResult(_0x5d5f16,null))[_0x8059('0x39')](handleError(_0x5d5f16,null));}; \ No newline at end of file +var _0xb145=['includeAll','findAll','rows','catch','show','params','include','options','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','end','error','stack','name','send','index','MailQueueReport','rawAttributes','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL'];(function(_0xfd90c2,_0xef8747){var _0xf2e2af=function(_0x1a18a0){while(--_0x1a18a0){_0xfd90c2['push'](_0xfd90c2['shift']());}};_0xf2e2af(++_0xef8747);}(_0xb145,0xa3));var _0x5b14=function(_0x46717d,_0xacb06f){_0x46717d=_0x46717d-0x0;var _0x56fb02=_0xb145[_0x46717d];return _0x56fb02;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b14('0x0'));var zipdir=require(_0x5b14('0x1'));var jsonpatch=require(_0x5b14('0x2'));var rp=require(_0x5b14('0x3'));var moment=require(_0x5b14('0x4'));var BPromise=require(_0x5b14('0x5'));var Mustache=require(_0x5b14('0x6'));var util=require(_0x5b14('0x7'));var path=require('path');var sox=require(_0x5b14('0x8'));var csv=require(_0x5b14('0x9'));var ejs=require(_0x5b14('0xa'));var fs=require('fs');var fs_extra=require(_0x5b14('0xb'));var _=require('lodash');var squel=require(_0x5b14('0xc'));var crypto=require(_0x5b14('0xd'));var jsforce=require(_0x5b14('0xe'));var deskjs=require(_0x5b14('0xf'));var toCsv=require(_0x5b14('0x9'));var querystring=require('querystring');var Papa=require(_0x5b14('0x10'));var Redis=require(_0x5b14('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5b14('0x12'));var as=require(_0x5b14('0x13'));var hardwareService=require(_0x5b14('0x14'));var logger=require(_0x5b14('0x15'))(_0x5b14('0x16'));var utils=require('../../config/utils');var config=require(_0x5b14('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b14('0x18'))['db'];function respondWithStatusCode(_0x1903a5,_0xc33723){_0xc33723=_0xc33723||0xcc;return function(_0x1cb56b){if(_0x1cb56b){return _0x1903a5[_0x5b14('0x19')](_0xc33723);}return _0x1903a5[_0x5b14('0x1a')](_0xc33723)['end']();};}function respondWithResult(_0x27b34b,_0x16f2a1){_0x16f2a1=_0x16f2a1||0xc8;return function(_0x35fb8b){if(_0x35fb8b){return _0x27b34b[_0x5b14('0x1a')](_0x16f2a1)[_0x5b14('0x1b')](_0x35fb8b);}};}function respondWithFilteredResult(_0x2a8fe5,_0x68f695){return function(_0xe5af75){if(_0xe5af75){var _0x183b0a=typeof _0x68f695[_0x5b14('0x1c')]===_0x5b14('0x1d')&&typeof _0x68f695[_0x5b14('0x1e')]==='undefined';var _0x24cfd0=_0xe5af75['count'];var _0x48d395=_0x183b0a?0x0:_0x68f695['offset'];var _0x3f397d=_0x183b0a?_0xe5af75[_0x5b14('0x1f')]:_0x68f695[_0x5b14('0x1c')]+_0x68f695[_0x5b14('0x1e')];var _0x3786f7;if(_0x3f397d>=_0x24cfd0){_0x3f397d=_0x24cfd0;_0x3786f7=0xc8;}else{_0x3786f7=0xce;}_0x2a8fe5[_0x5b14('0x1a')](_0x3786f7);return _0x2a8fe5[_0x5b14('0x20')]('Content-Range',_0x48d395+'-'+_0x3f397d+'/'+_0x24cfd0)['json'](_0xe5af75);}return null;};}function patchUpdates(_0x4fa079){return function(_0x4f4717){try{jsonpatch[_0x5b14('0x21')](_0x4f4717,_0x4fa079,!![]);}catch(_0x9a9495){return BPromise[_0x5b14('0x22')](_0x9a9495);}return _0x4f4717['save']();};}function saveUpdates(_0x1018d9,_0x1577f7){return function(_0x4857c7){if(_0x4857c7){return _0x4857c7[_0x5b14('0x23')](_0x1018d9)[_0x5b14('0x24')](function(_0x50951f){return _0x50951f;});}return null;};}function removeEntity(_0x33a293,_0x54073f){return function(_0x59282c){if(_0x59282c){return _0x59282c['destroy']()['then'](function(){_0x33a293[_0x5b14('0x1a')](0xcc)[_0x5b14('0x25')]();});}};}function handleEntityNotFound(_0x153a25,_0x5da505){return function(_0x46f86a){if(!_0x46f86a){_0x153a25[_0x5b14('0x19')](0x194);}return _0x46f86a;};}function handleError(_0x2ac7b0,_0x143648){_0x143648=_0x143648||0x1f4;return function(_0xe6851b){logger[_0x5b14('0x26')](_0xe6851b[_0x5b14('0x27')]);if(_0xe6851b[_0x5b14('0x28')]){delete _0xe6851b[_0x5b14('0x28')];}_0x2ac7b0[_0x5b14('0x1a')](_0x143648)[_0x5b14('0x29')](_0xe6851b);};}exports[_0x5b14('0x2a')]=function(_0x1c3c52,_0x266bbe){var _0x4cfd66={},_0x370fcd={},_0x18a76d={'count':0x0,'rows':[]};var _0x53b13d=_['map'](db[_0x5b14('0x2b')][_0x5b14('0x2c')],function(_0x5dca4f){return{'name':_0x5dca4f['fieldName'],'type':_0x5dca4f[_0x5b14('0x2d')]['key']};});_0x370fcd[_0x5b14('0x2e')]=_[_0x5b14('0x2f')](_0x53b13d,'name');_0x370fcd['query']=_[_0x5b14('0x30')](_0x1c3c52[_0x5b14('0x31')]);_0x370fcd[_0x5b14('0x32')]=_['intersection'](_0x370fcd[_0x5b14('0x2e')],_0x370fcd['query']);_0x4cfd66[_0x5b14('0x33')]=_[_0x5b14('0x34')](_0x370fcd[_0x5b14('0x2e')],qs[_0x5b14('0x35')](_0x1c3c52['query'][_0x5b14('0x35')]));_0x4cfd66[_0x5b14('0x33')]=_0x4cfd66[_0x5b14('0x33')][_0x5b14('0x36')]?_0x4cfd66['attributes']:_0x370fcd[_0x5b14('0x2e')];if(!_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x37')]('nolimit')){_0x4cfd66[_0x5b14('0x1e')]=qs['limit'](_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x1e')]);_0x4cfd66['offset']=qs[_0x5b14('0x1c')](_0x1c3c52[_0x5b14('0x31')]['offset']);}_0x4cfd66[_0x5b14('0x38')]=qs['sort'](_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x39')]);_0x4cfd66[_0x5b14('0x3a')]=qs[_0x5b14('0x32')](_['pick'](_0x1c3c52[_0x5b14('0x31')],_0x370fcd[_0x5b14('0x32')]),_0x53b13d);if(_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x3b')]){_0x4cfd66[_0x5b14('0x3a')]=_[_0x5b14('0x3c')](_0x4cfd66[_0x5b14('0x3a')],{'$or':_[_0x5b14('0x2f')](_0x53b13d,function(_0x4f647c){if(_0x4f647c[_0x5b14('0x2d')]!==_0x5b14('0x3d')){var _0x3f9d1d={};_0x3f9d1d[_0x4f647c[_0x5b14('0x28')]]={'$like':'%'+_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x3b')]+'%'};return _0x3f9d1d;}})});}_0x4cfd66=_[_0x5b14('0x3c')]({},_0x4cfd66,_0x1c3c52['options']);var _0x2ebaa8={'where':_0x4cfd66['where']};return db[_0x5b14('0x2b')][_0x5b14('0x1f')](_0x2ebaa8)['then'](function(_0x4c05ac){_0x18a76d['count']=_0x4c05ac;if(_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x3e')]){_0x4cfd66['include']=[{'all':!![]}];}return db[_0x5b14('0x2b')][_0x5b14('0x3f')](_0x4cfd66);})[_0x5b14('0x24')](function(_0x3d0369){_0x18a76d[_0x5b14('0x40')]=_0x3d0369;return _0x18a76d;})['then'](respondWithFilteredResult(_0x266bbe,_0x4cfd66))[_0x5b14('0x41')](handleError(_0x266bbe,null));};exports[_0x5b14('0x42')]=function(_0x4fb46e,_0x996aee){var _0x985e69={'raw':!![],'where':{'id':_0x4fb46e[_0x5b14('0x43')]['id']}},_0x5cc257={};_0x5cc257['model']=_[_0x5b14('0x30')](db[_0x5b14('0x2b')][_0x5b14('0x2c')]);_0x5cc257[_0x5b14('0x31')]=_['keys'](_0x4fb46e[_0x5b14('0x31')]);_0x5cc257[_0x5b14('0x32')]=_[_0x5b14('0x34')](_0x5cc257[_0x5b14('0x2e')],_0x5cc257['query']);_0x985e69['attributes']=_[_0x5b14('0x34')](_0x5cc257[_0x5b14('0x2e')],qs['fields'](_0x4fb46e[_0x5b14('0x31')]['fields']));_0x985e69[_0x5b14('0x33')]=_0x985e69[_0x5b14('0x33')][_0x5b14('0x36')]?_0x985e69[_0x5b14('0x33')]:_0x5cc257[_0x5b14('0x2e')];if(_0x4fb46e['query'][_0x5b14('0x3e')]){_0x985e69[_0x5b14('0x44')]=[{'all':!![]}];}_0x985e69=_[_0x5b14('0x3c')]({},_0x985e69,_0x4fb46e[_0x5b14('0x45')]);return db[_0x5b14('0x2b')]['find'](_0x985e69)['then'](handleEntityNotFound(_0x996aee,null))[_0x5b14('0x24')](respondWithResult(_0x996aee,null))['catch'](handleError(_0x996aee,null));};exports['create']=function(_0x4825b4,_0x35d00d){return db[_0x5b14('0x2b')][_0x5b14('0x46')](_0x4825b4[_0x5b14('0x47')],{})[_0x5b14('0x24')](respondWithResult(_0x35d00d,0xc9))[_0x5b14('0x41')](handleError(_0x35d00d,null));};exports[_0x5b14('0x23')]=function(_0x4d2bee,_0x548e1c){if(_0x4d2bee['body']['id']){delete _0x4d2bee['body']['id'];}return db['MailQueueReport'][_0x5b14('0x48')]({'where':{'id':_0x4d2bee[_0x5b14('0x43')]['id']}})[_0x5b14('0x24')](handleEntityNotFound(_0x548e1c,null))[_0x5b14('0x24')](saveUpdates(_0x4d2bee[_0x5b14('0x47')],null))['then'](respondWithResult(_0x548e1c,null))['catch'](handleError(_0x548e1c,null));};exports[_0x5b14('0x49')]=function(_0xd6ea50,_0x58b18e){return db[_0x5b14('0x2b')][_0x5b14('0x48')]({'where':{'id':_0xd6ea50['params']['id']}})['then'](handleEntityNotFound(_0x58b18e,null))[_0x5b14('0x24')](removeEntity(_0x58b18e,null))[_0x5b14('0x41')](handleError(_0x58b18e,null));};exports[_0x5b14('0x4a')]=function(_0x5d3782,_0x1a51d5){return db[_0x5b14('0x2b')][_0x5b14('0x4a')]()[_0x5b14('0x24')](respondWithResult(_0x1a51d5,null))[_0x5b14('0x41')](handleError(_0x1a51d5,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index d25904a..8ddcb4e 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 _0x5b9e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid'];(function(_0x1588c8,_0x29ce17){var _0x22adb5=function(_0x171c23){while(--_0x171c23){_0x1588c8['push'](_0x1588c8['shift']());}};_0x22adb5(++_0x29ce17);}(_0x5b9e,0x111));var _0xe5b9=function(_0x373000,_0x52d07b){_0x373000=_0x373000-0x0;var _0x236fb7=_0x5b9e[_0x373000];return _0x236fb7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe5b9('0x0'));var moment=require(_0xe5b9('0x1'));var BPromise=require(_0xe5b9('0x2'));var rp=require(_0xe5b9('0x3'));var fs=require('fs');var path=require(_0xe5b9('0x4'));var rimraf=require(_0xe5b9('0x5'));var config=require(_0xe5b9('0x6'));var attributes=require(_0xe5b9('0x7'));module[_0xe5b9('0x8')]=function(_0x8a33cb,_0x28b997){return _0x8a33cb[_0xe5b9('0x9')](_0xe5b9('0xa'),attributes,{'tableName':_0xe5b9('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe5b9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6dd8=['uniqueid','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0x436db1,_0x3866f3){var _0x1493c7=function(_0x3424b8){while(--_0x3424b8){_0x436db1['push'](_0x436db1['shift']());}};_0x1493c7(++_0x3866f3);}(_0x6dd8,0x85));var _0x86dd=function(_0x38d07a,_0x329042){_0x38d07a=_0x38d07a-0x0;var _0x2e97a4=_0x6dd8[_0x38d07a];return _0x2e97a4;};'use strict';var _=require('lodash');var util=require(_0x86dd('0x0'));var logger=require(_0x86dd('0x1'))(_0x86dd('0x2'));var moment=require(_0x86dd('0x3'));var BPromise=require('bluebird');var rp=require(_0x86dd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86dd('0x5'));var config=require(_0x86dd('0x6'));var attributes=require(_0x86dd('0x7'));module[_0x86dd('0x8')]=function(_0x33af51,_0x30c973){return _0x33af51[_0x86dd('0x9')](_0x86dd('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x86dd('0xb'),'fields':[_0x86dd('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 0865a1c..8aa28ad 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 _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x1b473e,_0x2ab8b9){var _0x4811a5=function(_0x25925c){while(--_0x25925c){_0x1b473e['push'](_0x1b473e['shift']());}};_0x4811a5(++_0x2ab8b9);}(_0xadb5,0xad));var _0x5adb=function(_0x5ec876,_0x1857ed){_0x5ec876=_0x5ec876-0x0;var _0x4bd949=_0xadb5[_0x5ec876];return _0x4bd949;};'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']('MailQueueReport,\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);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file +var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x2acbf9,_0x44eba4){var _0x406fe1=function(_0x4ebc3f){while(--_0x4ebc3f){_0x2acbf9['push'](_0x2acbf9['shift']());}};_0x406fe1(++_0x44eba4);}(_0xdb28,0x106));var _0x8db2=function(_0x2577de,_0x2c0d9d){_0x2577de=_0x2577de-0x0;var _0x7a2879=_0xdb28[_0x2577de];return _0x7a2879;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index e54aafd..b82a876 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4be861,_0x438ea3){var _0x28137d=function(_0x4562bb){while(--_0x4562bb){_0x4be861['push'](_0x4be861['shift']());}};_0x28137d(++_0x438ea3);}(_0x70e0,0x17b));var _0x070e=function(_0x523038,_0x56c985){_0x523038=_0x523038-0x0;var _0x1ecbd2=_0x70e0[_0x523038];return _0x1ecbd2;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4c2623,_0x4838bb){var _0x2be431=function(_0x55829d){while(--_0x55829d){_0x4c2623['push'](_0x4c2623['shift']());}};_0x2be431(++_0x4838bb);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 6bcc046..63defa8 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 _0xa417=['INBOX','exports','STRING','BOOLEAN','INTEGER'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xa417,0xf6));var _0x7a41=function(_0x20b4da,_0x53aea0){_0x20b4da=_0x20b4da-0x0;var _0x1f2982=_0xa417[_0x20b4da];return _0x1f2982;};'use strict';var Sequelize=require('sequelize');module[_0x7a41('0x0')]={'description':{'type':Sequelize[_0x7a41('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x7a41('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x7a41('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x7a41('0x1')],'defaultValue':_0x7a41('0x4')},'connTimeout':{'type':Sequelize[_0x7a41('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x7a41('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x7a41('0x1')]},'modernAuthentication':{'type':Sequelize[_0x7a41('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x1799=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1799,0x161));var _0x9179=function(_0x56ee28,_0x135505){_0x56ee28=_0x56ee28-0x0;var _0x4b35a6=_0x1799[_0x56ee28];return _0x4b35a6;};'use strict';var Sequelize=require(_0x9179('0x0'));module['exports']={'description':{'type':Sequelize[_0x9179('0x1')]},'host':{'type':Sequelize[_0x9179('0x1')]},'authentication':{'type':Sequelize[_0x9179('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x9179('0x1')]},'password':{'type':Sequelize[_0x9179('0x1')]},'port':{'type':Sequelize[_0x9179('0x3')]},'tls':{'type':Sequelize[_0x9179('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x9179('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9179('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x9179('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 565c503..7b4fbf5 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 _0x19d0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api'];(function(_0x4cfb7,_0x21108){var _0x8827ca=function(_0x37cc1f){while(--_0x37cc1f){_0x4cfb7['push'](_0x4cfb7['shift']());}};_0x8827ca(++_0x21108);}(_0x19d0,0x7e));var _0x019d=function(_0x567487,_0x46de73){_0x567487=_0x567487-0x0;var _0x26694a=_0x19d0[_0x567487];return _0x26694a;};'use strict';var _=require(_0x019d('0x0'));var util=require(_0x019d('0x1'));var logger=require(_0x019d('0x2'))(_0x019d('0x3'));var moment=require(_0x019d('0x4'));var BPromise=require(_0x019d('0x5'));var rp=require(_0x019d('0x6'));var fs=require('fs');var path=require(_0x019d('0x7'));var rimraf=require(_0x019d('0x8'));var config=require(_0x019d('0x9'));var attributes=require('./mailServerIn.attributes');module[_0x019d('0xa')]=function(_0x2842b3,_0x3deefb){return _0x2842b3['define'](_0x019d('0xb'),attributes,{'tableName':_0x019d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x732c=['moment','request-promise','path','./mailServerIn.attributes','exports','define','mail_servers_in','lodash','util','../../config/logger','api'];(function(_0x4e3d61,_0x5541a3){var _0x59a1b4=function(_0x2858a9){while(--_0x2858a9){_0x4e3d61['push'](_0x4e3d61['shift']());}};_0x59a1b4(++_0x5541a3);}(_0x732c,0x151));var _0xc732=function(_0x5be9ea,_0x37f1fd){_0x5be9ea=_0x5be9ea-0x0;var _0x233613=_0x732c[_0x5be9ea];return _0x233613;};'use strict';var _=require(_0xc732('0x0'));var util=require(_0xc732('0x1'));var logger=require(_0xc732('0x2'))(_0xc732('0x3'));var moment=require(_0xc732('0x4'));var BPromise=require('bluebird');var rp=require(_0xc732('0x5'));var fs=require('fs');var path=require(_0xc732('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc732('0x7'));module[_0xc732('0x8')]=function(_0x154521,_0x46b330){return _0x154521[_0xc732('0x9')]('MailServerIn',attributes,{'tableName':_0xc732('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 e28a710..30cec29 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 _0x9e88=['MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','stringify','GetMailServerIn','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4cdba2,_0x2715d4){var _0xb7ff23=function(_0x8daf2a){while(--_0x8daf2a){_0x4cdba2['push'](_0x4cdba2['shift']());}};_0xb7ff23(++_0x2715d4);}(_0x9e88,0x7e));var _0x89e8=function(_0x1f1079,_0x5c89d8){_0x1f1079=_0x1f1079-0x0;var _0x255dd6=_0x9e88[_0x1f1079];return _0x255dd6;};'use strict';var _=require(_0x89e8('0x0'));var util=require(_0x89e8('0x1'));var moment=require(_0x89e8('0x2'));var BPromise=require('bluebird');var rs=require(_0x89e8('0x3'));var fs=require('fs');var Redis=require(_0x89e8('0x4'));var db=require(_0x89e8('0x5'))['db'];var utils=require(_0x89e8('0x6'));var logger=require(_0x89e8('0x7'))(_0x89e8('0x8'));var config=require(_0x89e8('0x9'));var jayson=require(_0x89e8('0xa'));var client=jayson[_0x89e8('0xb')][_0x89e8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x25a6b0,_0x281991,_0x20ff0e){return new BPromise(function(_0x388249,_0x4a8b21){return client[_0x89e8('0xd')](_0x25a6b0,_0x20ff0e)[_0x89e8('0xe')](function(_0x4c8626){logger['info'](_0x89e8('0xf'),_0x281991,_0x89e8('0x10'));logger[_0x89e8('0x11')](_0x89e8('0x12'),_0x281991,_0x89e8('0x10'),JSON['stringify'](_0x4c8626));if(_0x4c8626[_0x89e8('0x13')]){if(_0x4c8626[_0x89e8('0x13')][_0x89e8('0x14')]===0x1f4){logger[_0x89e8('0x13')](_0x89e8('0xf'),_0x281991,_0x4c8626[_0x89e8('0x13')][_0x89e8('0x15')]);return _0x4a8b21(_0x4c8626[_0x89e8('0x13')]['message']);}logger['error'](_0x89e8('0xf'),_0x281991,_0x4c8626[_0x89e8('0x13')]['message']);return _0x388249(_0x4c8626['error'][_0x89e8('0x15')]);}else{logger[_0x89e8('0x16')](_0x89e8('0xf'),_0x281991,_0x89e8('0x10'));_0x388249(_0x4c8626['result'][_0x89e8('0x15')]);}})[_0x89e8('0x17')](function(_0x2c3982){logger[_0x89e8('0x13')](_0x89e8('0xf'),_0x281991,_0x2c3982);_0x4a8b21(_0x2c3982);});});}exports['GetMailServerIn']=function(_0x404b4b){var _0x2cb9ab=this;return new Promise(function(_0x4e2c0d,_0x51f46c){return db[_0x89e8('0x18')][_0x89e8('0x19')]({'raw':_0x404b4b[_0x89e8('0x1a')]?_0x404b4b['options'][_0x89e8('0x1b')]===undefined?!![]:![]:!![],'where':_0x404b4b['options']?_0x404b4b[_0x89e8('0x1a')][_0x89e8('0x1c')]||null:null,'attributes':_0x404b4b['options']?_0x404b4b[_0x89e8('0x1a')][_0x89e8('0x1d')]||null:null,'limit':_0x404b4b[_0x89e8('0x1a')]?_0x404b4b[_0x89e8('0x1a')][_0x89e8('0x1e')]||null:null,'include':_0x404b4b[_0x89e8('0x1a')]?_0x404b4b[_0x89e8('0x1a')][_0x89e8('0x1f')]?_[_0x89e8('0x20')](_0x404b4b[_0x89e8('0x1a')]['include'],function(_0x171051){return{'model':db[_0x171051[_0x89e8('0x21')]],'as':_0x171051['as'],'attributes':_0x171051[_0x89e8('0x1d')],'include':_0x171051[_0x89e8('0x1f')]?_[_0x89e8('0x20')](_0x171051[_0x89e8('0x1f')],function(_0x315f95){return{'model':db[_0x315f95[_0x89e8('0x21')]],'as':_0x315f95['as'],'attributes':_0x315f95[_0x89e8('0x1d')],'include':_0x315f95[_0x89e8('0x1f')]?_[_0x89e8('0x20')](_0x315f95[_0x89e8('0x1f')],function(_0xb062c5){return{'model':db[_0xb062c5['model']],'as':_0xb062c5['as'],'attributes':_0xb062c5[_0x89e8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ab004){logger[_0x89e8('0x16')]('GetMailServerIn',_0x404b4b);logger[_0x89e8('0x11')]('GetMailServerIn',_0x404b4b,JSON[_0x89e8('0x22')](_0x4ab004));_0x4e2c0d(_0x4ab004);})[_0x89e8('0x17')](function(_0x5374ba){logger[_0x89e8('0x13')](_0x89e8('0x23'),_0x5374ba['message'],_0x404b4b);_0x51f46c(_0x2cb9ab[_0x89e8('0x13')](0x1f4,_0x5374ba[_0x89e8('0x15')]));});});}; \ No newline at end of file +var _0xf2a4=['attributes','limit','include','map','model','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','MailServerIn','findAll','options','where'];(function(_0x595f08,_0x1fea1e){var _0x18db9c=function(_0x38b946){while(--_0x38b946){_0x595f08['push'](_0x595f08['shift']());}};_0x18db9c(++_0x1fea1e);}(_0xf2a4,0xfe));var _0x4f2a=function(_0x51ea2b,_0x4fef86){_0x51ea2b=_0x51ea2b-0x0;var _0x5a2b85=_0xf2a4[_0x51ea2b];return _0x5a2b85;};'use strict';var _=require(_0x4f2a('0x0'));var util=require(_0x4f2a('0x1'));var moment=require('moment');var BPromise=require(_0x4f2a('0x2'));var rs=require(_0x4f2a('0x3'));var fs=require('fs');var Redis=require(_0x4f2a('0x4'));var db=require(_0x4f2a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f2a('0x6'))(_0x4f2a('0x7'));var config=require('../../config/environment');var jayson=require(_0x4f2a('0x8'));var client=jayson[_0x4f2a('0x9')][_0x4f2a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e6757,_0x511463,_0x4bd1a7){return new BPromise(function(_0x465bfb,_0x2e3bd2){return client[_0x4f2a('0xb')](_0x3e6757,_0x4bd1a7)['then'](function(_0x3ab9f0){logger[_0x4f2a('0xc')](_0x4f2a('0xd'),_0x511463,_0x4f2a('0xe'));logger[_0x4f2a('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x511463,_0x4f2a('0xe'),JSON[_0x4f2a('0x10')](_0x3ab9f0));if(_0x3ab9f0[_0x4f2a('0x11')]){if(_0x3ab9f0[_0x4f2a('0x11')][_0x4f2a('0x12')]===0x1f4){logger[_0x4f2a('0x11')]('MailServerIn,\x20%s,\x20%s',_0x511463,_0x3ab9f0[_0x4f2a('0x11')][_0x4f2a('0x13')]);return _0x2e3bd2(_0x3ab9f0[_0x4f2a('0x11')]['message']);}logger[_0x4f2a('0x11')]('MailServerIn,\x20%s,\x20%s',_0x511463,_0x3ab9f0['error'][_0x4f2a('0x13')]);return _0x465bfb(_0x3ab9f0[_0x4f2a('0x11')][_0x4f2a('0x13')]);}else{logger[_0x4f2a('0xc')](_0x4f2a('0xd'),_0x511463,_0x4f2a('0xe'));_0x465bfb(_0x3ab9f0[_0x4f2a('0x14')][_0x4f2a('0x13')]);}})['catch'](function(_0x18980b){logger[_0x4f2a('0x11')](_0x4f2a('0xd'),_0x511463,_0x18980b);_0x2e3bd2(_0x18980b);});});}exports['GetMailServerIn']=function(_0x388f7b){var _0x505a6e=this;return new Promise(function(_0x48573a,_0x4451c2){return db[_0x4f2a('0x15')][_0x4f2a('0x16')]({'raw':_0x388f7b[_0x4f2a('0x17')]?_0x388f7b[_0x4f2a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x388f7b[_0x4f2a('0x17')]?_0x388f7b[_0x4f2a('0x17')][_0x4f2a('0x18')]||null:null,'attributes':_0x388f7b[_0x4f2a('0x17')]?_0x388f7b[_0x4f2a('0x17')][_0x4f2a('0x19')]||null:null,'limit':_0x388f7b[_0x4f2a('0x17')]?_0x388f7b[_0x4f2a('0x17')][_0x4f2a('0x1a')]||null:null,'include':_0x388f7b['options']?_0x388f7b[_0x4f2a('0x17')][_0x4f2a('0x1b')]?_[_0x4f2a('0x1c')](_0x388f7b[_0x4f2a('0x17')][_0x4f2a('0x1b')],function(_0x131ba9){return{'model':db[_0x131ba9[_0x4f2a('0x1d')]],'as':_0x131ba9['as'],'attributes':_0x131ba9['attributes'],'include':_0x131ba9[_0x4f2a('0x1b')]?_['map'](_0x131ba9[_0x4f2a('0x1b')],function(_0x4f4137){return{'model':db[_0x4f4137[_0x4f2a('0x1d')]],'as':_0x4f4137['as'],'attributes':_0x4f4137[_0x4f2a('0x19')],'include':_0x4f4137[_0x4f2a('0x1b')]?_[_0x4f2a('0x1c')](_0x4f4137[_0x4f2a('0x1b')],function(_0x109879){return{'model':db[_0x109879[_0x4f2a('0x1d')]],'as':_0x109879['as'],'attributes':_0x109879['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f4862){logger[_0x4f2a('0xc')]('GetMailServerIn',_0x388f7b);logger[_0x4f2a('0xf')]('GetMailServerIn',_0x388f7b,JSON[_0x4f2a('0x10')](_0x1f4862));_0x48573a(_0x1f4862);})[_0x4f2a('0x1e')](function(_0x518f12){logger[_0x4f2a('0x11')]('GetMailServerIn',_0x518f12[_0x4f2a('0x13')],_0x388f7b);_0x4451c2(_0x505a6e[_0x4f2a('0x11')](0x1f4,_0x518f12['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 8ba7650..b157813 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 699f356..dd009b1 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 _0xd87e=['exports','STRING','BOOLEAN','sequelize'];(function(_0x49c5c9,_0x262475){var _0x1647ef=function(_0x274866){while(--_0x274866){_0x49c5c9['push'](_0x49c5c9['shift']());}};_0x1647ef(++_0x262475);}(_0xd87e,0x1bf));var _0xed87=function(_0x3758dd,_0x3608b9){_0x3758dd=_0x3758dd-0x0;var _0x16ba2f=_0xd87e[_0x3758dd];return _0x16ba2f;};'use strict';var Sequelize=require(_0xed87('0x0'));module[_0xed87('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xed87('0x2')]},'user':{'type':Sequelize[_0xed87('0x2')]},'pass':{'type':Sequelize[_0xed87('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xed87('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xed87('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xed87('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x4213=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0xe719ec,_0x5a280e){var _0x4842a1=function(_0x59b968){while(--_0x59b968){_0xe719ec['push'](_0xe719ec['shift']());}};_0x4842a1(++_0x5a280e);}(_0x4213,0x77));var _0x3421=function(_0x4e5960,_0x5c1bf0){_0x4e5960=_0x4e5960-0x0;var _0x38cf9a=_0x4213[_0x4e5960];return _0x38cf9a;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'description':{'type':Sequelize[_0x3421('0x2')]},'host':{'type':Sequelize[_0x3421('0x2')]},'user':{'type':Sequelize[_0x3421('0x2')]},'pass':{'type':Sequelize[_0x3421('0x2')]},'port':{'type':Sequelize[_0x3421('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x3421('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x3421('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 c3f0d48..6959c22 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 _0xb34f=['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','offset','undefined','count','limit','set','json','apply','reject','save','update','destroy','then','stack','name','send','index','map','MailServerOut','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb34f,0x1c3));var _0xfb34=function(_0x4f4714,_0x3a4df9){_0x4f4714=_0x4f4714-0x0;var _0x486d89=_0xb34f[_0x4f4714];return _0x486d89;};'use strict';var emlformat=require(_0xfb34('0x0'));var rimraf=require(_0xfb34('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfb34('0x2'));var moment=require('moment');var BPromise=require(_0xfb34('0x3'));var Mustache=require(_0xfb34('0x4'));var util=require(_0xfb34('0x5'));var path=require(_0xfb34('0x6'));var sox=require('sox');var csv=require(_0xfb34('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfb34('0x8'));var _=require(_0xfb34('0x9'));var squel=require(_0xfb34('0xa'));var crypto=require('crypto');var jsforce=require(_0xfb34('0xb'));var deskjs=require(_0xfb34('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfb34('0xd'));var Papa=require(_0xfb34('0xe'));var Redis=require(_0xfb34('0xf'));var authService=require(_0xfb34('0x10'));var qs=require(_0xfb34('0x11'));var as=require(_0xfb34('0x12'));var hardwareService=require(_0xfb34('0x13'));var logger=require(_0xfb34('0x14'))(_0xfb34('0x15'));var utils=require(_0xfb34('0x16'));var config=require(_0xfb34('0x17'));var licenseUtil=require(_0xfb34('0x18'));var db=require(_0xfb34('0x19'))['db'];function respondWithStatusCode(_0x1ef27a,_0x17ee74){_0x17ee74=_0x17ee74||0xcc;return function(_0x5151f7){if(_0x5151f7){return _0x1ef27a[_0xfb34('0x1a')](_0x17ee74);}return _0x1ef27a[_0xfb34('0x1b')](_0x17ee74)[_0xfb34('0x1c')]();};}function respondWithResult(_0x4294ac,_0x16dde6){_0x16dde6=_0x16dde6||0xc8;return function(_0xff28d8){if(_0xff28d8){return _0x4294ac['status'](_0x16dde6)['json'](_0xff28d8);}};}function respondWithFilteredResult(_0x14b579,_0x586049){return function(_0x151f08){if(_0x151f08){var _0x159586=typeof _0x586049[_0xfb34('0x1d')]==='undefined'&&typeof _0x586049['limit']===_0xfb34('0x1e');var _0x3c77b0=_0x151f08[_0xfb34('0x1f')];var _0x6bce5d=_0x159586?0x0:_0x586049[_0xfb34('0x1d')];var _0x1e1095=_0x159586?_0x151f08[_0xfb34('0x1f')]:_0x586049[_0xfb34('0x1d')]+_0x586049[_0xfb34('0x20')];var _0xaa9ee7;if(_0x1e1095>=_0x3c77b0){_0x1e1095=_0x3c77b0;_0xaa9ee7=0xc8;}else{_0xaa9ee7=0xce;}_0x14b579[_0xfb34('0x1b')](_0xaa9ee7);return _0x14b579[_0xfb34('0x21')]('Content-Range',_0x6bce5d+'-'+_0x1e1095+'/'+_0x3c77b0)[_0xfb34('0x22')](_0x151f08);}return null;};}function patchUpdates(_0x2cd0f0){return function(_0x43d995){try{jsonpatch[_0xfb34('0x23')](_0x43d995,_0x2cd0f0,!![]);}catch(_0x158af4){return BPromise[_0xfb34('0x24')](_0x158af4);}return _0x43d995[_0xfb34('0x25')]();};}function saveUpdates(_0x59a566,_0x545cdd){return function(_0x1e727b){if(_0x1e727b){return _0x1e727b[_0xfb34('0x26')](_0x59a566)['then'](function(_0x2ab712){return _0x2ab712;});}return null;};}function removeEntity(_0x473ca3,_0x4af6e2){return function(_0x4f97e4){if(_0x4f97e4){return _0x4f97e4[_0xfb34('0x27')]()[_0xfb34('0x28')](function(){_0x473ca3[_0xfb34('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b331d,_0x406d09){return function(_0x38268d){if(!_0x38268d){_0x2b331d['sendStatus'](0x194);}return _0x38268d;};}function handleError(_0x44b46d,_0x40d383){_0x40d383=_0x40d383||0x1f4;return function(_0x511c85){logger['error'](_0x511c85[_0xfb34('0x29')]);if(_0x511c85[_0xfb34('0x2a')]){delete _0x511c85[_0xfb34('0x2a')];}_0x44b46d[_0xfb34('0x1b')](_0x40d383)[_0xfb34('0x2b')](_0x511c85);};}exports[_0xfb34('0x2c')]=function(_0x231085,_0x405590){var _0x89f534={},_0x4cb4fa={},_0xf096e5={'count':0x0,'rows':[]};var _0x5df776=_[_0xfb34('0x2d')](db[_0xfb34('0x2e')]['rawAttributes'],function(_0x23280a){return{'name':_0x23280a[_0xfb34('0x2f')],'type':_0x23280a[_0xfb34('0x30')][_0xfb34('0x31')]};});_0x4cb4fa[_0xfb34('0x32')]=_[_0xfb34('0x2d')](_0x5df776,'name');_0x4cb4fa[_0xfb34('0x33')]=_[_0xfb34('0x34')](_0x231085[_0xfb34('0x33')]);_0x4cb4fa[_0xfb34('0x35')]=_[_0xfb34('0x36')](_0x4cb4fa['model'],_0x4cb4fa[_0xfb34('0x33')]);_0x89f534['attributes']=_[_0xfb34('0x36')](_0x4cb4fa['model'],qs['fields'](_0x231085['query'][_0xfb34('0x37')]));_0x89f534[_0xfb34('0x38')]=_0x89f534['attributes'][_0xfb34('0x39')]?_0x89f534[_0xfb34('0x38')]:_0x4cb4fa[_0xfb34('0x32')];if(!_0x231085[_0xfb34('0x33')]['hasOwnProperty'](_0xfb34('0x3a'))){_0x89f534[_0xfb34('0x20')]=qs[_0xfb34('0x20')](_0x231085[_0xfb34('0x33')]['limit']);_0x89f534[_0xfb34('0x1d')]=qs[_0xfb34('0x1d')](_0x231085[_0xfb34('0x33')]['offset']);}_0x89f534[_0xfb34('0x3b')]=qs[_0xfb34('0x3c')](_0x231085[_0xfb34('0x33')][_0xfb34('0x3c')]);_0x89f534['where']=qs[_0xfb34('0x35')](_['pick'](_0x231085[_0xfb34('0x33')],_0x4cb4fa[_0xfb34('0x35')]),_0x5df776);if(_0x231085[_0xfb34('0x33')][_0xfb34('0x3d')]){_0x89f534[_0xfb34('0x3e')]=_[_0xfb34('0x3f')](_0x89f534[_0xfb34('0x3e')],{'$or':_[_0xfb34('0x2d')](_0x5df776,function(_0x383218){if(_0x383218[_0xfb34('0x30')]!==_0xfb34('0x40')){var _0x67f1c8={};_0x67f1c8[_0x383218[_0xfb34('0x2a')]]={'$like':'%'+_0x231085[_0xfb34('0x33')][_0xfb34('0x3d')]+'%'};return _0x67f1c8;}})});}_0x89f534=_['merge']({},_0x89f534,_0x231085[_0xfb34('0x41')]);var _0x28bb1d={'where':_0x89f534[_0xfb34('0x3e')]};return db[_0xfb34('0x2e')]['count'](_0x28bb1d)[_0xfb34('0x28')](function(_0x6a53a){_0xf096e5['count']=_0x6a53a;if(_0x231085[_0xfb34('0x33')][_0xfb34('0x42')]){_0x89f534[_0xfb34('0x43')]=[{'all':!![]}];}return db['MailServerOut'][_0xfb34('0x44')](_0x89f534);})[_0xfb34('0x28')](function(_0xbd9d5b){_0xf096e5[_0xfb34('0x45')]=_0xbd9d5b;return _0xf096e5;})[_0xfb34('0x28')](respondWithFilteredResult(_0x405590,_0x89f534))['catch'](handleError(_0x405590,null));};exports[_0xfb34('0x46')]=function(_0x5d1d98,_0x24dbc6){var _0xa13d22={'raw':!![],'where':{'id':_0x5d1d98[_0xfb34('0x47')]['id']}},_0x23a9fc={};_0x23a9fc[_0xfb34('0x32')]=_[_0xfb34('0x34')](db[_0xfb34('0x2e')][_0xfb34('0x48')]);_0x23a9fc['query']=_[_0xfb34('0x34')](_0x5d1d98[_0xfb34('0x33')]);_0x23a9fc[_0xfb34('0x35')]=_['intersection'](_0x23a9fc[_0xfb34('0x32')],_0x23a9fc['query']);_0xa13d22[_0xfb34('0x38')]=_[_0xfb34('0x36')](_0x23a9fc[_0xfb34('0x32')],qs[_0xfb34('0x37')](_0x5d1d98[_0xfb34('0x33')][_0xfb34('0x37')]));_0xa13d22[_0xfb34('0x38')]=_0xa13d22[_0xfb34('0x38')][_0xfb34('0x39')]?_0xa13d22[_0xfb34('0x38')]:_0x23a9fc[_0xfb34('0x32')];if(_0x5d1d98[_0xfb34('0x33')][_0xfb34('0x42')]){_0xa13d22['include']=[{'all':!![]}];}_0xa13d22=_[_0xfb34('0x3f')]({},_0xa13d22,_0x5d1d98['options']);return db['MailServerOut'][_0xfb34('0x49')](_0xa13d22)[_0xfb34('0x28')](handleEntityNotFound(_0x24dbc6,null))[_0xfb34('0x28')](respondWithResult(_0x24dbc6,null))[_0xfb34('0x4a')](handleError(_0x24dbc6,null));};exports[_0xfb34('0x4b')]=function(_0x22f2dd,_0x29156e){return db['MailServerOut']['create'](_0x22f2dd[_0xfb34('0x4c')],{})[_0xfb34('0x28')](respondWithResult(_0x29156e,0xc9))['catch'](handleError(_0x29156e,null));};exports[_0xfb34('0x26')]=function(_0x3813bb,_0x226112){if(_0x3813bb[_0xfb34('0x4c')]['id']){delete _0x3813bb['body']['id'];}return db[_0xfb34('0x2e')]['find']({'where':{'id':_0x3813bb[_0xfb34('0x47')]['id']}})[_0xfb34('0x28')](handleEntityNotFound(_0x226112,null))[_0xfb34('0x28')](saveUpdates(_0x3813bb['body'],null))[_0xfb34('0x28')](respondWithResult(_0x226112,null))[_0xfb34('0x4a')](handleError(_0x226112,null));};exports[_0xfb34('0x27')]=function(_0x5cf908,_0x4c09cc){return db[_0xfb34('0x2e')]['find']({'where':{'id':_0x5cf908[_0xfb34('0x47')]['id']}})[_0xfb34('0x28')](handleEntityNotFound(_0x4c09cc,null))['then'](removeEntity(_0x4c09cc,null))[_0xfb34('0x4a')](handleError(_0x4c09cc,null));}; \ No newline at end of file +var _0xca32=['reject','save','update','then','destroy','sendStatus','error','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','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','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x4d0ae5,_0x2546ec){var _0xc26f12=function(_0x36fb67){while(--_0x36fb67){_0x4d0ae5['push'](_0x4d0ae5['shift']());}};_0xc26f12(++_0x2546ec);}(_0xca32,0x1ba));var _0x2ca3=function(_0x57f3bf,_0x8cdffd){_0x57f3bf=_0x57f3bf-0x0;var _0x497b22=_0xca32[_0x57f3bf];return _0x497b22;};'use strict';var emlformat=require(_0x2ca3('0x0'));var rimraf=require(_0x2ca3('0x1'));var zipdir=require(_0x2ca3('0x2'));var jsonpatch=require(_0x2ca3('0x3'));var rp=require(_0x2ca3('0x4'));var moment=require(_0x2ca3('0x5'));var BPromise=require(_0x2ca3('0x6'));var Mustache=require(_0x2ca3('0x7'));var util=require(_0x2ca3('0x8'));var path=require(_0x2ca3('0x9'));var sox=require(_0x2ca3('0xa'));var csv=require(_0x2ca3('0xb'));var ejs=require(_0x2ca3('0xc'));var fs=require('fs');var fs_extra=require(_0x2ca3('0xd'));var _=require('lodash');var squel=require(_0x2ca3('0xe'));var crypto=require(_0x2ca3('0xf'));var jsforce=require(_0x2ca3('0x10'));var deskjs=require(_0x2ca3('0x11'));var toCsv=require(_0x2ca3('0xb'));var querystring=require(_0x2ca3('0x12'));var Papa=require(_0x2ca3('0x13'));var Redis=require(_0x2ca3('0x14'));var authService=require(_0x2ca3('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x2ca3('0x16'));var hardwareService=require(_0x2ca3('0x17'));var logger=require(_0x2ca3('0x18'))('api');var utils=require(_0x2ca3('0x19'));var config=require(_0x2ca3('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x2ca3('0x1b'))['db'];function respondWithStatusCode(_0x4492f5,_0x59fd35){_0x59fd35=_0x59fd35||0xcc;return function(_0x1ee71e){if(_0x1ee71e){return _0x4492f5['sendStatus'](_0x59fd35);}return _0x4492f5[_0x2ca3('0x1c')](_0x59fd35)[_0x2ca3('0x1d')]();};}function respondWithResult(_0x309f2a,_0x573c92){_0x573c92=_0x573c92||0xc8;return function(_0x2b088a){if(_0x2b088a){return _0x309f2a['status'](_0x573c92)[_0x2ca3('0x1e')](_0x2b088a);}};}function respondWithFilteredResult(_0x1c7ec1,_0x67b8bd){return function(_0x564ede){if(_0x564ede){var _0x4ac9f8=typeof _0x67b8bd[_0x2ca3('0x1f')]===_0x2ca3('0x20')&&typeof _0x67b8bd[_0x2ca3('0x21')]===_0x2ca3('0x20');var _0x3ca14d=_0x564ede[_0x2ca3('0x22')];var _0x269680=_0x4ac9f8?0x0:_0x67b8bd[_0x2ca3('0x1f')];var _0x569c36=_0x4ac9f8?_0x564ede[_0x2ca3('0x22')]:_0x67b8bd[_0x2ca3('0x1f')]+_0x67b8bd[_0x2ca3('0x21')];var _0x20e8ad;if(_0x569c36>=_0x3ca14d){_0x569c36=_0x3ca14d;_0x20e8ad=0xc8;}else{_0x20e8ad=0xce;}_0x1c7ec1['status'](_0x20e8ad);return _0x1c7ec1[_0x2ca3('0x23')](_0x2ca3('0x24'),_0x269680+'-'+_0x569c36+'/'+_0x3ca14d)[_0x2ca3('0x1e')](_0x564ede);}return null;};}function patchUpdates(_0x307288){return function(_0x421739){try{jsonpatch[_0x2ca3('0x25')](_0x421739,_0x307288,!![]);}catch(_0x52348f){return BPromise[_0x2ca3('0x26')](_0x52348f);}return _0x421739[_0x2ca3('0x27')]();};}function saveUpdates(_0xab1ccc,_0x38f6f7){return function(_0x5cef32){if(_0x5cef32){return _0x5cef32[_0x2ca3('0x28')](_0xab1ccc)[_0x2ca3('0x29')](function(_0x38d83c){return _0x38d83c;});}return null;};}function removeEntity(_0x5431ac,_0x42a59d){return function(_0x1464d8){if(_0x1464d8){return _0x1464d8[_0x2ca3('0x2a')]()[_0x2ca3('0x29')](function(){_0x5431ac['status'](0xcc)[_0x2ca3('0x1d')]();});}};}function handleEntityNotFound(_0x116036,_0x2aa2d2){return function(_0x252031){if(!_0x252031){_0x116036[_0x2ca3('0x2b')](0x194);}return _0x252031;};}function handleError(_0x44f806,_0x2dcb7b){_0x2dcb7b=_0x2dcb7b||0x1f4;return function(_0x2176d7){logger[_0x2ca3('0x2c')](_0x2176d7['stack']);if(_0x2176d7[_0x2ca3('0x2d')]){delete _0x2176d7[_0x2ca3('0x2d')];}_0x44f806[_0x2ca3('0x1c')](_0x2dcb7b)[_0x2ca3('0x2e')](_0x2176d7);};}exports[_0x2ca3('0x2f')]=function(_0x5d926b,_0x4b863d){var _0x1d326f={},_0x88b10d={},_0x3f42fd={'count':0x0,'rows':[]};var _0x10a097=_[_0x2ca3('0x30')](db[_0x2ca3('0x31')][_0x2ca3('0x32')],function(_0x440ada){return{'name':_0x440ada[_0x2ca3('0x33')],'type':_0x440ada[_0x2ca3('0x34')][_0x2ca3('0x35')]};});_0x88b10d['model']=_[_0x2ca3('0x30')](_0x10a097,_0x2ca3('0x2d'));_0x88b10d['query']=_[_0x2ca3('0x36')](_0x5d926b[_0x2ca3('0x37')]);_0x88b10d[_0x2ca3('0x38')]=_[_0x2ca3('0x39')](_0x88b10d['model'],_0x88b10d[_0x2ca3('0x37')]);_0x1d326f[_0x2ca3('0x3a')]=_[_0x2ca3('0x39')](_0x88b10d['model'],qs[_0x2ca3('0x3b')](_0x5d926b[_0x2ca3('0x37')][_0x2ca3('0x3b')]));_0x1d326f[_0x2ca3('0x3a')]=_0x1d326f['attributes'][_0x2ca3('0x3c')]?_0x1d326f[_0x2ca3('0x3a')]:_0x88b10d[_0x2ca3('0x3d')];if(!_0x5d926b['query'][_0x2ca3('0x3e')]('nolimit')){_0x1d326f[_0x2ca3('0x21')]=qs[_0x2ca3('0x21')](_0x5d926b[_0x2ca3('0x37')][_0x2ca3('0x21')]);_0x1d326f[_0x2ca3('0x1f')]=qs[_0x2ca3('0x1f')](_0x5d926b[_0x2ca3('0x37')][_0x2ca3('0x1f')]);}_0x1d326f[_0x2ca3('0x3f')]=qs[_0x2ca3('0x40')](_0x5d926b[_0x2ca3('0x37')][_0x2ca3('0x40')]);_0x1d326f['where']=qs[_0x2ca3('0x38')](_['pick'](_0x5d926b[_0x2ca3('0x37')],_0x88b10d[_0x2ca3('0x38')]),_0x10a097);if(_0x5d926b[_0x2ca3('0x37')]['filter']){_0x1d326f[_0x2ca3('0x41')]=_[_0x2ca3('0x42')](_0x1d326f[_0x2ca3('0x41')],{'$or':_[_0x2ca3('0x30')](_0x10a097,function(_0x2ee6b6){if(_0x2ee6b6[_0x2ca3('0x34')]!==_0x2ca3('0x43')){var _0x9aaac0={};_0x9aaac0[_0x2ee6b6[_0x2ca3('0x2d')]]={'$like':'%'+_0x5d926b[_0x2ca3('0x37')][_0x2ca3('0x44')]+'%'};return _0x9aaac0;}})});}_0x1d326f=_[_0x2ca3('0x42')]({},_0x1d326f,_0x5d926b[_0x2ca3('0x45')]);var _0x1ce413={'where':_0x1d326f[_0x2ca3('0x41')]};return db[_0x2ca3('0x31')]['count'](_0x1ce413)['then'](function(_0x187b24){_0x3f42fd[_0x2ca3('0x22')]=_0x187b24;if(_0x5d926b['query'][_0x2ca3('0x46')]){_0x1d326f['include']=[{'all':!![]}];}return db[_0x2ca3('0x31')][_0x2ca3('0x47')](_0x1d326f);})[_0x2ca3('0x29')](function(_0x304be2){_0x3f42fd[_0x2ca3('0x48')]=_0x304be2;return _0x3f42fd;})[_0x2ca3('0x29')](respondWithFilteredResult(_0x4b863d,_0x1d326f))[_0x2ca3('0x49')](handleError(_0x4b863d,null));};exports[_0x2ca3('0x4a')]=function(_0x51c708,_0x59cee4){var _0x403deb={'raw':!![],'where':{'id':_0x51c708[_0x2ca3('0x4b')]['id']}},_0x4bc681={};_0x4bc681[_0x2ca3('0x3d')]=_['keys'](db['MailServerOut'][_0x2ca3('0x32')]);_0x4bc681['query']=_[_0x2ca3('0x36')](_0x51c708[_0x2ca3('0x37')]);_0x4bc681[_0x2ca3('0x38')]=_[_0x2ca3('0x39')](_0x4bc681['model'],_0x4bc681['query']);_0x403deb['attributes']=_[_0x2ca3('0x39')](_0x4bc681['model'],qs[_0x2ca3('0x3b')](_0x51c708[_0x2ca3('0x37')][_0x2ca3('0x3b')]));_0x403deb[_0x2ca3('0x3a')]=_0x403deb[_0x2ca3('0x3a')][_0x2ca3('0x3c')]?_0x403deb[_0x2ca3('0x3a')]:_0x4bc681[_0x2ca3('0x3d')];if(_0x51c708[_0x2ca3('0x37')][_0x2ca3('0x46')]){_0x403deb[_0x2ca3('0x4c')]=[{'all':!![]}];}_0x403deb=_[_0x2ca3('0x42')]({},_0x403deb,_0x51c708['options']);return db[_0x2ca3('0x31')][_0x2ca3('0x4d')](_0x403deb)['then'](handleEntityNotFound(_0x59cee4,null))[_0x2ca3('0x29')](respondWithResult(_0x59cee4,null))[_0x2ca3('0x49')](handleError(_0x59cee4,null));};exports[_0x2ca3('0x4e')]=function(_0x2896d2,_0x407a5f){return db['MailServerOut'][_0x2ca3('0x4e')](_0x2896d2['body'],{})['then'](respondWithResult(_0x407a5f,0xc9))['catch'](handleError(_0x407a5f,null));};exports[_0x2ca3('0x28')]=function(_0xf32368,_0x37273d){if(_0xf32368['body']['id']){delete _0xf32368[_0x2ca3('0x4f')]['id'];}return db[_0x2ca3('0x31')][_0x2ca3('0x4d')]({'where':{'id':_0xf32368[_0x2ca3('0x4b')]['id']}})[_0x2ca3('0x29')](handleEntityNotFound(_0x37273d,null))[_0x2ca3('0x29')](saveUpdates(_0xf32368[_0x2ca3('0x4f')],null))[_0x2ca3('0x29')](respondWithResult(_0x37273d,null))[_0x2ca3('0x49')](handleError(_0x37273d,null));};exports[_0x2ca3('0x2a')]=function(_0x3afa29,_0x54a071){return db[_0x2ca3('0x31')][_0x2ca3('0x4d')]({'where':{'id':_0x3afa29[_0x2ca3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x54a071,null))['then'](removeEntity(_0x54a071,null))['catch'](handleError(_0x54a071,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 9a86893..9825e35 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 _0xb228=['api','moment','bluebird','request-promise','rimraf','../../config/environment','define','MailServerOut','mail_servers_out','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb228,0x1f3));var _0x8b22=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xb228[_0x40ac5e];return _0x2839d6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8b22('0x0'))(_0x8b22('0x1'));var moment=require(_0x8b22('0x2'));var BPromise=require(_0x8b22('0x3'));var rp=require(_0x8b22('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b22('0x5'));var config=require(_0x8b22('0x6'));var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x1ff0b7,_0x582de8){return _0x1ff0b7[_0x8b22('0x7')](_0x8b22('0x8'),attributes,{'tableName':_0x8b22('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1bcb=['rimraf','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x19f137,_0x69a6c5){var _0x13021f=function(_0x53e2c5){while(--_0x53e2c5){_0x19f137['push'](_0x19f137['shift']());}};_0x13021f(++_0x69a6c5);}(_0x1bcb,0x1e4));var _0xb1bc=function(_0x127f2b,_0x2a1948){_0x127f2b=_0x127f2b-0x0;var _0x385fe7=_0x1bcb[_0x127f2b];return _0x385fe7;};'use strict';var _=require(_0xb1bc('0x0'));var util=require(_0xb1bc('0x1'));var logger=require(_0xb1bc('0x2'))(_0xb1bc('0x3'));var moment=require(_0xb1bc('0x4'));var BPromise=require(_0xb1bc('0x5'));var rp=require(_0xb1bc('0x6'));var fs=require('fs');var path=require(_0xb1bc('0x7'));var rimraf=require(_0xb1bc('0x8'));var config=require('../../config/environment');var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x493f29,_0x58cb87){return _0x493f29[_0xb1bc('0x9')](_0xb1bc('0xa'),attributes,{'tableName':_0xb1bc('0xb'),'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 4217bca..4d3e56f 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x2ec6e7,_0x2816a2){_0x2ec6e7=_0x2ec6e7-0x0;var _0x31bca3=_0x7a54[_0x2ec6e7];return _0x31bca3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x430e33,_0x287cb7){var _0x5eed76=function(_0x11e13b){while(--_0x11e13b){_0x430e33['push'](_0x430e33['shift']());}};_0x5eed76(++_0x287cb7);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index e053702..0602569 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 _0x1870=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','/:id','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x5b8af0,_0x51492c){var _0x185247=function(_0x3debca){while(--_0x3debca){_0x5b8af0['push'](_0x5b8af0['shift']());}};_0x185247(++_0x51492c);}(_0x1870,0xf4));var _0x0187=function(_0x1d0c6d,_0x34b652){_0x1d0c6d=_0x1d0c6d-0x0;var _0x2b191f=_0x1870[_0x1d0c6d];return _0x2b191f;};'use strict';var multer=require(_0x0187('0x0'));var util=require(_0x0187('0x1'));var path=require(_0x0187('0x2'));var timeout=require(_0x0187('0x3'));var express=require('express');var router=express[_0x0187('0x4')]();var fs_extra=require(_0x0187('0x5'));var auth=require(_0x0187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0187('0x7'));var controller=require(_0x0187('0x8'));router[_0x0187('0x9')]('/',auth[_0x0187('0xa')](),controller['index']);router[_0x0187('0x9')](_0x0187('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x0187('0x9')](_0x0187('0xc'),auth[_0x0187('0xa')](),controller['show']);router[_0x0187('0xd')]('/',auth['isAuthenticated'](),controller[_0x0187('0xe')]);router[_0x0187('0xf')](_0x0187('0xc'),auth[_0x0187('0xa')](),controller['update']);router[_0x0187('0x10')](_0x0187('0xc'),auth[_0x0187('0xa')](),controller[_0x0187('0x11')]);module[_0x0187('0x12')]=router; \ No newline at end of file +var _0xf58d=['../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated','/:id','post','create','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x396936,_0x1979f9){var _0x3844b4=function(_0x53c112){while(--_0x53c112){_0x396936['push'](_0x396936['shift']());}};_0x3844b4(++_0x1979f9);}(_0xf58d,0x189));var _0xdf58=function(_0xa6d4a5,_0x19825b){_0xa6d4a5=_0xa6d4a5-0x0;var _0x3f47aa=_0xf58d[_0xa6d4a5];return _0x3f47aa;};'use strict';var multer=require(_0xdf58('0x0'));var util=require(_0xdf58('0x1'));var path=require('path');var timeout=require(_0xdf58('0x2'));var express=require(_0xdf58('0x3'));var router=express['Router']();var fs_extra=require(_0xdf58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdf58('0x5'));var config=require(_0xdf58('0x6'));var controller=require(_0xdf58('0x7'));router[_0xdf58('0x8')]('/',auth['isAuthenticated'](),controller[_0xdf58('0x9')]);router[_0xdf58('0x8')](_0xdf58('0xa'),auth[_0xdf58('0xb')](),controller['describe']);router[_0xdf58('0x8')](_0xdf58('0xc'),auth[_0xdf58('0xb')](),controller['show']);router[_0xdf58('0xd')]('/',auth['isAuthenticated'](),controller[_0xdf58('0xe')]);router[_0xdf58('0xf')](_0xdf58('0xc'),auth[_0xdf58('0xb')](),controller[_0xdf58('0x10')]);router[_0xdf58('0x11')](_0xdf58('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xdf58('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 721494a..098d6d5 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 _0xbd0a=['STRING','sequelize'];(function(_0x135c7d,_0x4c486b){var _0xd4eed7=function(_0x4976e5){while(--_0x4976e5){_0x135c7d['push'](_0x135c7d['shift']());}};_0xd4eed7(++_0x4c486b);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x200c7e,_0xe34e79){_0x200c7e=_0x200c7e-0x0;var _0x1b45c2=_0xbd0a[_0x200c7e];return _0x1b45c2;};'use strict';var Sequelize=require(_0xabd0('0x0'));module['exports']={'name':{'type':Sequelize[_0xabd0('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd101=['name','sequelize','STRING'];(function(_0x551bc1,_0x47cff3){var _0x12ea5e=function(_0x2d4c10){while(--_0x2d4c10){_0x551bc1['push'](_0x551bc1['shift']());}};_0x12ea5e(++_0x47cff3);}(_0xd101,0xc1));var _0x1d10=function(_0x21a459,_0x1e13f8){_0x21a459=_0x21a459-0x0;var _0x1769be=_0xd101[_0x21a459];return _0x1769be;};'use strict';var Sequelize=require(_0x1d10('0x0'));module['exports']={'name':{'type':Sequelize[_0x1d10('0x1')],'unique':_0x1d10('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1d10('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 5b58adb..0e2e543 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 _0x05f7=['merge','type','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0x5cf43f,_0x29508a){var _0x31eb19=function(_0x3fa05d){while(--_0x3fa05d){_0x5cf43f['push'](_0x5cf43f['shift']());}};_0x31eb19(++_0x29508a);}(_0x05f7,0xf5));var _0x705f=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x05f7[_0x2576d7];return _0x16a08c;};'use strict';var emlformat=require(_0x705f('0x0'));var rimraf=require(_0x705f('0x1'));var zipdir=require(_0x705f('0x2'));var jsonpatch=require(_0x705f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x705f('0x4'));var util=require(_0x705f('0x5'));var path=require(_0x705f('0x6'));var sox=require(_0x705f('0x7'));var csv=require(_0x705f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x705f('0x9'));var _=require(_0x705f('0xa'));var squel=require(_0x705f('0xb'));var crypto=require(_0x705f('0xc'));var jsforce=require(_0x705f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x705f('0x8'));var querystring=require(_0x705f('0xe'));var Papa=require(_0x705f('0xf'));var Redis=require(_0x705f('0x10'));var authService=require(_0x705f('0x11'));var qs=require(_0x705f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x705f('0x13'));var utils=require('../../config/utils');var config=require(_0x705f('0x14'));var licenseUtil=require(_0x705f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x261688,_0x481ed1){_0x481ed1=_0x481ed1||0xcc;return function(_0x438ce8){if(_0x438ce8){return _0x261688[_0x705f('0x16')](_0x481ed1);}return _0x261688[_0x705f('0x17')](_0x481ed1)[_0x705f('0x18')]();};}function respondWithResult(_0x4e539e,_0x209ce7){_0x209ce7=_0x209ce7||0xc8;return function(_0xaeae27){if(_0xaeae27){return _0x4e539e[_0x705f('0x17')](_0x209ce7)[_0x705f('0x19')](_0xaeae27);}};}function respondWithFilteredResult(_0x768d22,_0x1951b6){return function(_0x27217c){if(_0x27217c){var _0x5a5a11=typeof _0x1951b6[_0x705f('0x1a')]===_0x705f('0x1b')&&typeof _0x1951b6[_0x705f('0x1c')]===_0x705f('0x1b');var _0x9a1a07=_0x27217c[_0x705f('0x1d')];var _0x57a42f=_0x5a5a11?0x0:_0x1951b6[_0x705f('0x1a')];var _0x3b3c35=_0x5a5a11?_0x27217c[_0x705f('0x1d')]:_0x1951b6[_0x705f('0x1a')]+_0x1951b6[_0x705f('0x1c')];var _0x2da9ec;if(_0x3b3c35>=_0x9a1a07){_0x3b3c35=_0x9a1a07;_0x2da9ec=0xc8;}else{_0x2da9ec=0xce;}_0x768d22[_0x705f('0x17')](_0x2da9ec);return _0x768d22[_0x705f('0x1e')](_0x705f('0x1f'),_0x57a42f+'-'+_0x3b3c35+'/'+_0x9a1a07)[_0x705f('0x19')](_0x27217c);}return null;};}function patchUpdates(_0x3281f9){return function(_0x2a89b8){try{jsonpatch[_0x705f('0x20')](_0x2a89b8,_0x3281f9,!![]);}catch(_0x2fa042){return BPromise[_0x705f('0x21')](_0x2fa042);}return _0x2a89b8[_0x705f('0x22')]();};}function saveUpdates(_0x1bd9f1,_0x302bc7){return function(_0x41e300){if(_0x41e300){return _0x41e300['update'](_0x1bd9f1)[_0x705f('0x23')](function(_0x5a5eb1){return _0x5a5eb1;});}return null;};}function removeEntity(_0x292e0b,_0x2d59a3){return function(_0x237f54){if(_0x237f54){return _0x237f54[_0x705f('0x24')]()[_0x705f('0x23')](function(){_0x292e0b[_0x705f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4376d6,_0x1c162){return function(_0x3fb6b2){if(!_0x3fb6b2){_0x4376d6[_0x705f('0x16')](0x194);}return _0x3fb6b2;};}function handleError(_0x4fc290,_0x18de69){_0x18de69=_0x18de69||0x1f4;return function(_0x7b2c52){logger[_0x705f('0x25')](_0x7b2c52[_0x705f('0x26')]);if(_0x7b2c52[_0x705f('0x27')]){delete _0x7b2c52[_0x705f('0x27')];}_0x4fc290[_0x705f('0x17')](_0x18de69)[_0x705f('0x28')](_0x7b2c52);};}exports[_0x705f('0x29')]=function(_0x5ddce1,_0x3f770b){var _0x337904={},_0x3fbbc9={},_0x378265={'count':0x0,'rows':[]};var _0x46a1be=_[_0x705f('0x2a')](db[_0x705f('0x2b')][_0x705f('0x2c')],function(_0x489522){return{'name':_0x489522['fieldName'],'type':_0x489522['type'][_0x705f('0x2d')]};});_0x3fbbc9[_0x705f('0x2e')]=_['map'](_0x46a1be,'name');_0x3fbbc9['query']=_['keys'](_0x5ddce1[_0x705f('0x2f')]);_0x3fbbc9['filters']=_[_0x705f('0x30')](_0x3fbbc9[_0x705f('0x2e')],_0x3fbbc9[_0x705f('0x2f')]);_0x337904['attributes']=_['intersection'](_0x3fbbc9[_0x705f('0x2e')],qs[_0x705f('0x31')](_0x5ddce1['query'][_0x705f('0x31')]));_0x337904[_0x705f('0x32')]=_0x337904[_0x705f('0x32')][_0x705f('0x33')]?_0x337904['attributes']:_0x3fbbc9[_0x705f('0x2e')];if(!_0x5ddce1[_0x705f('0x2f')][_0x705f('0x34')](_0x705f('0x35'))){_0x337904[_0x705f('0x1c')]=qs[_0x705f('0x1c')](_0x5ddce1['query'][_0x705f('0x1c')]);_0x337904['offset']=qs[_0x705f('0x1a')](_0x5ddce1['query'][_0x705f('0x1a')]);}_0x337904[_0x705f('0x36')]=qs[_0x705f('0x37')](_0x5ddce1[_0x705f('0x2f')][_0x705f('0x37')]);_0x337904[_0x705f('0x38')]=qs[_0x705f('0x39')](_[_0x705f('0x3a')](_0x5ddce1[_0x705f('0x2f')],_0x3fbbc9['filters']),_0x46a1be);if(_0x5ddce1[_0x705f('0x2f')]['filter']){_0x337904[_0x705f('0x38')]=_[_0x705f('0x3b')](_0x337904['where'],{'$or':_['map'](_0x46a1be,function(_0xf02835){if(_0xf02835[_0x705f('0x3c')]!=='VIRTUAL'){var _0x5f5862={};_0x5f5862[_0xf02835[_0x705f('0x27')]]={'$like':'%'+_0x5ddce1[_0x705f('0x2f')][_0x705f('0x3d')]+'%'};return _0x5f5862;}})});}_0x337904=_[_0x705f('0x3b')]({},_0x337904,_0x5ddce1[_0x705f('0x3e')]);var _0x1239f5={'where':_0x337904[_0x705f('0x38')]};return db[_0x705f('0x2b')][_0x705f('0x1d')](_0x1239f5)[_0x705f('0x23')](function(_0x3cbc9b){_0x378265['count']=_0x3cbc9b;if(_0x5ddce1[_0x705f('0x2f')]['includeAll']){_0x337904[_0x705f('0x3f')]=[{'all':!![]}];}return db['MailSubstatus'][_0x705f('0x40')](_0x337904);})['then'](function(_0x590500){_0x378265[_0x705f('0x41')]=_0x590500;return _0x378265;})['then'](respondWithFilteredResult(_0x3f770b,_0x337904))[_0x705f('0x42')](handleError(_0x3f770b,null));};exports[_0x705f('0x43')]=function(_0x4d023d,_0x95622c){var _0x45a26f={'raw':!![],'where':{'id':_0x4d023d[_0x705f('0x44')]['id']}},_0x5781c2={};_0x5781c2[_0x705f('0x2e')]=_[_0x705f('0x45')](db['MailSubstatus'][_0x705f('0x2c')]);_0x5781c2[_0x705f('0x2f')]=_[_0x705f('0x45')](_0x4d023d['query']);_0x5781c2[_0x705f('0x39')]=_[_0x705f('0x30')](_0x5781c2[_0x705f('0x2e')],_0x5781c2['query']);_0x45a26f[_0x705f('0x32')]=_['intersection'](_0x5781c2[_0x705f('0x2e')],qs[_0x705f('0x31')](_0x4d023d[_0x705f('0x2f')][_0x705f('0x31')]));_0x45a26f['attributes']=_0x45a26f[_0x705f('0x32')][_0x705f('0x33')]?_0x45a26f['attributes']:_0x5781c2[_0x705f('0x2e')];if(_0x4d023d[_0x705f('0x2f')][_0x705f('0x46')]){_0x45a26f['include']=[{'all':!![]}];}_0x45a26f=_[_0x705f('0x3b')]({},_0x45a26f,_0x4d023d['options']);return db[_0x705f('0x2b')][_0x705f('0x47')](_0x45a26f)[_0x705f('0x23')](handleEntityNotFound(_0x95622c,null))[_0x705f('0x23')](respondWithResult(_0x95622c,null))[_0x705f('0x42')](handleError(_0x95622c,null));};exports[_0x705f('0x48')]=function(_0x27603f,_0x325579){return db[_0x705f('0x2b')]['create'](_0x27603f[_0x705f('0x49')],{})[_0x705f('0x23')](respondWithResult(_0x325579,0xc9))[_0x705f('0x42')](handleError(_0x325579,null));};exports[_0x705f('0x4a')]=function(_0x193f0f,_0xfbef84){if(_0x193f0f[_0x705f('0x49')]['id']){delete _0x193f0f[_0x705f('0x49')]['id'];}return db[_0x705f('0x2b')][_0x705f('0x47')]({'where':{'id':_0x193f0f[_0x705f('0x44')]['id']}})['then'](handleEntityNotFound(_0xfbef84,null))[_0x705f('0x23')](saveUpdates(_0x193f0f['body'],null))[_0x705f('0x23')](respondWithResult(_0xfbef84,null))[_0x705f('0x42')](handleError(_0xfbef84,null));};exports[_0x705f('0x24')]=function(_0x34fe81,_0x2c4dd1){return db[_0x705f('0x2b')]['find']({'where':{'id':_0x34fe81[_0x705f('0x44')]['id']}})[_0x705f('0x23')](handleEntityNotFound(_0x2c4dd1,null))[_0x705f('0x23')](removeEntity(_0x2c4dd1,null))[_0x705f('0x42')](handleError(_0x2c4dd1,null));};exports[_0x705f('0x4b')]=function(_0x2cd459,_0x1a4fda){return db[_0x705f('0x2b')][_0x705f('0x4b')]()['then'](respondWithResult(_0x1a4fda,null))[_0x705f('0x42')](handleError(_0x1a4fda,null));}; \ No newline at end of file +var _0xff71=['fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','MailSubstatus','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir'];(function(_0x5a5cad,_0x43ca84){var _0x5437fd=function(_0x58ab10){while(--_0x58ab10){_0x5a5cad['push'](_0x5a5cad['shift']());}};_0x5437fd(++_0x43ca84);}(_0xff71,0x1bf));var _0x1ff7=function(_0xf1a516,_0x4b7594){_0xf1a516=_0xf1a516-0x0;var _0x6792d2=_0xff71[_0xf1a516];return _0x6792d2;};'use strict';var emlformat=require(_0x1ff7('0x0'));var rimraf=require(_0x1ff7('0x1'));var zipdir=require(_0x1ff7('0x2'));var jsonpatch=require(_0x1ff7('0x3'));var rp=require('request-promise');var moment=require(_0x1ff7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1ff7('0x5'));var util=require('util');var path=require(_0x1ff7('0x6'));var sox=require(_0x1ff7('0x7'));var csv=require(_0x1ff7('0x8'));var ejs=require(_0x1ff7('0x9'));var fs=require('fs');var fs_extra=require(_0x1ff7('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1ff7('0xb'));var jsforce=require(_0x1ff7('0xc'));var deskjs=require(_0x1ff7('0xd'));var toCsv=require(_0x1ff7('0x8'));var querystring=require(_0x1ff7('0xe'));var Papa=require(_0x1ff7('0xf'));var Redis=require(_0x1ff7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1ff7('0x11'));var as=require(_0x1ff7('0x12'));var hardwareService=require(_0x1ff7('0x13'));var logger=require(_0x1ff7('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1ff7('0x15'));var licenseUtil=require(_0x1ff7('0x16'));var db=require(_0x1ff7('0x17'))['db'];function respondWithStatusCode(_0x441e3e,_0x228d77){_0x228d77=_0x228d77||0xcc;return function(_0x3cbf37){if(_0x3cbf37){return _0x441e3e[_0x1ff7('0x18')](_0x228d77);}return _0x441e3e[_0x1ff7('0x19')](_0x228d77)[_0x1ff7('0x1a')]();};}function respondWithResult(_0x4702ca,_0x1cc68c){_0x1cc68c=_0x1cc68c||0xc8;return function(_0x1dca9d){if(_0x1dca9d){return _0x4702ca[_0x1ff7('0x19')](_0x1cc68c)[_0x1ff7('0x1b')](_0x1dca9d);}};}function respondWithFilteredResult(_0x1a54ae,_0x411ab2){return function(_0x284065){if(_0x284065){var _0x4e07da=typeof _0x411ab2[_0x1ff7('0x1c')]===_0x1ff7('0x1d')&&typeof _0x411ab2[_0x1ff7('0x1e')]===_0x1ff7('0x1d');var _0x31bf00=_0x284065[_0x1ff7('0x1f')];var _0x4eb959=_0x4e07da?0x0:_0x411ab2[_0x1ff7('0x1c')];var _0x24a1c8=_0x4e07da?_0x284065[_0x1ff7('0x1f')]:_0x411ab2[_0x1ff7('0x1c')]+_0x411ab2[_0x1ff7('0x1e')];var _0x572aa2;if(_0x24a1c8>=_0x31bf00){_0x24a1c8=_0x31bf00;_0x572aa2=0xc8;}else{_0x572aa2=0xce;}_0x1a54ae['status'](_0x572aa2);return _0x1a54ae['set'](_0x1ff7('0x20'),_0x4eb959+'-'+_0x24a1c8+'/'+_0x31bf00)[_0x1ff7('0x1b')](_0x284065);}return null;};}function patchUpdates(_0x518d9f){return function(_0x380317){try{jsonpatch[_0x1ff7('0x21')](_0x380317,_0x518d9f,!![]);}catch(_0x25eabf){return BPromise[_0x1ff7('0x22')](_0x25eabf);}return _0x380317['save']();};}function saveUpdates(_0x1116ab,_0x345156){return function(_0x38d013){if(_0x38d013){return _0x38d013[_0x1ff7('0x23')](_0x1116ab)[_0x1ff7('0x24')](function(_0x448160){return _0x448160;});}return null;};}function removeEntity(_0x548874,_0xaf334f){return function(_0x3e1411){if(_0x3e1411){return _0x3e1411[_0x1ff7('0x25')]()[_0x1ff7('0x24')](function(){_0x548874[_0x1ff7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x560c05,_0x447fd0){return function(_0xcd161){if(!_0xcd161){_0x560c05[_0x1ff7('0x18')](0x194);}return _0xcd161;};}function handleError(_0x7a9f9,_0x20cff5){_0x20cff5=_0x20cff5||0x1f4;return function(_0x456ce3){logger[_0x1ff7('0x26')](_0x456ce3[_0x1ff7('0x27')]);if(_0x456ce3[_0x1ff7('0x28')]){delete _0x456ce3[_0x1ff7('0x28')];}_0x7a9f9['status'](_0x20cff5)[_0x1ff7('0x29')](_0x456ce3);};}exports['index']=function(_0x5b5467,_0x2435c8){var _0x3253f6={},_0x40a3d2={},_0x47547e={'count':0x0,'rows':[]};var _0x5a6780=_[_0x1ff7('0x2a')](db[_0x1ff7('0x2b')][_0x1ff7('0x2c')],function(_0x5595ea){return{'name':_0x5595ea['fieldName'],'type':_0x5595ea['type'][_0x1ff7('0x2d')]};});_0x40a3d2[_0x1ff7('0x2e')]=_['map'](_0x5a6780,_0x1ff7('0x28'));_0x40a3d2['query']=_[_0x1ff7('0x2f')](_0x5b5467[_0x1ff7('0x30')]);_0x40a3d2[_0x1ff7('0x31')]=_[_0x1ff7('0x32')](_0x40a3d2[_0x1ff7('0x2e')],_0x40a3d2[_0x1ff7('0x30')]);_0x3253f6[_0x1ff7('0x33')]=_[_0x1ff7('0x32')](_0x40a3d2[_0x1ff7('0x2e')],qs[_0x1ff7('0x34')](_0x5b5467[_0x1ff7('0x30')]['fields']));_0x3253f6[_0x1ff7('0x33')]=_0x3253f6[_0x1ff7('0x33')][_0x1ff7('0x35')]?_0x3253f6['attributes']:_0x40a3d2[_0x1ff7('0x2e')];if(!_0x5b5467[_0x1ff7('0x30')][_0x1ff7('0x36')](_0x1ff7('0x37'))){_0x3253f6[_0x1ff7('0x1e')]=qs[_0x1ff7('0x1e')](_0x5b5467['query'][_0x1ff7('0x1e')]);_0x3253f6['offset']=qs['offset'](_0x5b5467[_0x1ff7('0x30')][_0x1ff7('0x1c')]);}_0x3253f6[_0x1ff7('0x38')]=qs[_0x1ff7('0x39')](_0x5b5467[_0x1ff7('0x30')][_0x1ff7('0x39')]);_0x3253f6[_0x1ff7('0x3a')]=qs['filters'](_[_0x1ff7('0x3b')](_0x5b5467[_0x1ff7('0x30')],_0x40a3d2[_0x1ff7('0x31')]),_0x5a6780);if(_0x5b5467[_0x1ff7('0x30')][_0x1ff7('0x3c')]){_0x3253f6['where']=_['merge'](_0x3253f6['where'],{'$or':_[_0x1ff7('0x2a')](_0x5a6780,function(_0x48597e){if(_0x48597e['type']!==_0x1ff7('0x3d')){var _0x3310d2={};_0x3310d2[_0x48597e['name']]={'$like':'%'+_0x5b5467['query'][_0x1ff7('0x3c')]+'%'};return _0x3310d2;}})});}_0x3253f6=_[_0x1ff7('0x3e')]({},_0x3253f6,_0x5b5467[_0x1ff7('0x3f')]);var _0x33a19b={'where':_0x3253f6[_0x1ff7('0x3a')]};return db['MailSubstatus'][_0x1ff7('0x1f')](_0x33a19b)['then'](function(_0x22f4fb){_0x47547e[_0x1ff7('0x1f')]=_0x22f4fb;if(_0x5b5467[_0x1ff7('0x30')][_0x1ff7('0x40')]){_0x3253f6[_0x1ff7('0x41')]=[{'all':!![]}];}return db[_0x1ff7('0x2b')][_0x1ff7('0x42')](_0x3253f6);})[_0x1ff7('0x24')](function(_0x1347cd){_0x47547e[_0x1ff7('0x43')]=_0x1347cd;return _0x47547e;})[_0x1ff7('0x24')](respondWithFilteredResult(_0x2435c8,_0x3253f6))[_0x1ff7('0x44')](handleError(_0x2435c8,null));};exports[_0x1ff7('0x45')]=function(_0x5a4cb8,_0x1beae9){var _0x8cbd38={'raw':!![],'where':{'id':_0x5a4cb8[_0x1ff7('0x46')]['id']}},_0x1f043e={};_0x1f043e[_0x1ff7('0x2e')]=_[_0x1ff7('0x2f')](db[_0x1ff7('0x2b')][_0x1ff7('0x2c')]);_0x1f043e[_0x1ff7('0x30')]=_[_0x1ff7('0x2f')](_0x5a4cb8['query']);_0x1f043e[_0x1ff7('0x31')]=_[_0x1ff7('0x32')](_0x1f043e[_0x1ff7('0x2e')],_0x1f043e[_0x1ff7('0x30')]);_0x8cbd38[_0x1ff7('0x33')]=_[_0x1ff7('0x32')](_0x1f043e[_0x1ff7('0x2e')],qs[_0x1ff7('0x34')](_0x5a4cb8[_0x1ff7('0x30')][_0x1ff7('0x34')]));_0x8cbd38[_0x1ff7('0x33')]=_0x8cbd38['attributes'][_0x1ff7('0x35')]?_0x8cbd38[_0x1ff7('0x33')]:_0x1f043e['model'];if(_0x5a4cb8[_0x1ff7('0x30')][_0x1ff7('0x40')]){_0x8cbd38['include']=[{'all':!![]}];}_0x8cbd38=_[_0x1ff7('0x3e')]({},_0x8cbd38,_0x5a4cb8[_0x1ff7('0x3f')]);return db['MailSubstatus'][_0x1ff7('0x47')](_0x8cbd38)[_0x1ff7('0x24')](handleEntityNotFound(_0x1beae9,null))[_0x1ff7('0x24')](respondWithResult(_0x1beae9,null))[_0x1ff7('0x44')](handleError(_0x1beae9,null));};exports['create']=function(_0x5e8196,_0x1a506d){return db[_0x1ff7('0x2b')][_0x1ff7('0x48')](_0x5e8196['body'],{})[_0x1ff7('0x24')](respondWithResult(_0x1a506d,0xc9))['catch'](handleError(_0x1a506d,null));};exports[_0x1ff7('0x23')]=function(_0x1fc6b8,_0x384b96){if(_0x1fc6b8[_0x1ff7('0x49')]['id']){delete _0x1fc6b8['body']['id'];}return db[_0x1ff7('0x2b')][_0x1ff7('0x47')]({'where':{'id':_0x1fc6b8[_0x1ff7('0x46')]['id']}})[_0x1ff7('0x24')](handleEntityNotFound(_0x384b96,null))['then'](saveUpdates(_0x1fc6b8[_0x1ff7('0x49')],null))['then'](respondWithResult(_0x384b96,null))[_0x1ff7('0x44')](handleError(_0x384b96,null));};exports[_0x1ff7('0x25')]=function(_0x22e823,_0x41487c){return db[_0x1ff7('0x2b')][_0x1ff7('0x47')]({'where':{'id':_0x22e823[_0x1ff7('0x46')]['id']}})['then'](handleEntityNotFound(_0x41487c,null))[_0x1ff7('0x24')](removeEntity(_0x41487c,null))[_0x1ff7('0x44')](handleError(_0x41487c,null));};exports[_0x1ff7('0x4a')]=function(_0x53552c,_0x12fee9){return db[_0x1ff7('0x2b')]['describe']()[_0x1ff7('0x24')](respondWithResult(_0x12fee9,null))[_0x1ff7('0x44')](handleError(_0x12fee9,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 2d58599..44970a8 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 _0xe49a=['hook','exports','events','MailSubstatus','setMaxListeners','update','emit'];(function(_0x2a86ac,_0x4ddba6){var _0x51ee24=function(_0x177e1b){while(--_0x177e1b){_0x2a86ac['push'](_0x2a86ac['shift']());}};_0x51ee24(++_0x4ddba6);}(_0xe49a,0x198));var _0xae49=function(_0xf06163,_0x80c74b){_0xf06163=_0xf06163-0x0;var _0x29df4d=_0xe49a[_0xf06163];return _0x29df4d;};'use strict';var EventEmitter=require(_0xae49('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0xae49('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xae49('0x2')](0x0);var events={'afterUpdate':_0xae49('0x3')};function emitEvent(_0x17bd57){return function(_0x5b6319,_0x4c10b5,_0x359449){MailSubstatusEvents[_0xae49('0x4')](_0x17bd57+':'+_0x5b6319['id'],_0x5b6319);MailSubstatusEvents[_0xae49('0x4')](_0x17bd57,_0x5b6319);_0x359449(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xae49('0x5')](e,emitEvent(event));}}module[_0xae49('0x6')]=MailSubstatusEvents; \ No newline at end of file +var _0xdb3f=['exports','events','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x2cc67b,_0x4cffe0){var _0xcdabf2=function(_0x2e0814){while(--_0x2e0814){_0x2cc67b['push'](_0x2cc67b['shift']());}};_0xcdabf2(++_0x4cffe0);}(_0xdb3f,0xc9));var _0xfdb3=function(_0x459527,_0x5504bd){_0x459527=_0x459527-0x0;var _0x11c192=_0xdb3f[_0x459527];return _0x11c192;};'use strict';var EventEmitter=require(_0xfdb3('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0xfdb3('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xfdb3('0x2')](0x0);var events={'afterUpdate':_0xfdb3('0x3')};function emitEvent(_0x27d471){return function(_0x50bc0a,_0x5d2fb8,_0x45d21b){MailSubstatusEvents[_0xfdb3('0x4')](_0x27d471+':'+_0x50bc0a['id'],_0x50bc0a);MailSubstatusEvents[_0xfdb3('0x4')](_0x27d471,_0x50bc0a);_0x45d21b(null);};}for(var e in events){if(events[_0xfdb3('0x5')](e)){var event=events[e];MailSubstatus[_0xfdb3('0x6')](e,emitEvent(event));}}module[_0xfdb3('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index a5681c7..df1fa68 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 _0x8292=['mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','catch','exports','models','define','MailSubstatus'];(function(_0x23ed26,_0x1d2ff4){var _0x545502=function(_0x5bd921){while(--_0x5bd921){_0x23ed26['push'](_0x23ed26['shift']());}};_0x545502(++_0x1d2ff4);}(_0x8292,0x14c));var _0x2829=function(_0xadd855,_0x313dd0){_0xadd855=_0xadd855-0x0;var _0x16a09f=_0x8292[_0xadd855];return _0x16a09f;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x2829('0x0')]=function(_0x2d7b7f){var _0x5b8713=_0x2d7b7f[_0x2829('0x1')];return _0x2d7b7f[_0x2829('0x2')](_0x2829('0x3'),attributes,{'tableName':_0x2829('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x160c78,_0xbae49a,_0x47b425){return _0x5b8713[_0x2829('0x5')][_0x2829('0x6')]({'value':_0x160c78[_0x2829('0x7')]},{'where':{'field':_0x2829('0x8'),'value':_0x160c78[_0x2829('0x9')]['name']}})[_0x2829('0xa')](function(){_0x47b425();})[_0x2829('0xb')](function(_0x3ae278){_0x47b425(_0x3ae278);});}}});}; \ No newline at end of file +var _0x3c57=['Condition','name','mailSubstatus','then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses'];(function(_0x1834e0,_0x30ddba){var _0x52c0ee=function(_0x46a167){while(--_0x46a167){_0x1834e0['push'](_0x1834e0['shift']());}};_0x52c0ee(++_0x30ddba);}(_0x3c57,0x1c8));var _0x73c5=function(_0x260d60,_0x3a021e){_0x260d60=_0x260d60-0x0;var _0x4ea3ca=_0x3c57[_0x260d60];return _0x4ea3ca;};'use strict';var attributes=require(_0x73c5('0x0'));module[_0x73c5('0x1')]=function(_0x1e6436){var _0x1bfc91=_0x1e6436[_0x73c5('0x2')];return _0x1e6436[_0x73c5('0x3')](_0x73c5('0x4'),attributes,{'tableName':_0x73c5('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x50500c,_0x1095e5,_0x1757df){return _0x1bfc91[_0x73c5('0x6')]['update']({'value':_0x50500c[_0x73c5('0x7')]},{'where':{'field':_0x73c5('0x8'),'value':_0x50500c['_previousDataValues'][_0x73c5('0x7')]}})[_0x73c5('0x9')](function(){_0x1757df();})[_0x73c5('0xa')](function(_0x1edaf2){_0x1757df(_0x1edaf2);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index f2f5316..917ffbd 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 _0x4668=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x121912,_0x1cd3be){var _0x297161=function(_0x48c320){while(--_0x48c320){_0x121912['push'](_0x121912['shift']());}};_0x297161(++_0x1cd3be);}(_0x4668,0x138));var _0x8466=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4668[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x8466('0x0'));var util=require(_0x8466('0x1'));var moment=require(_0x8466('0x2'));var BPromise=require(_0x8466('0x3'));var rs=require(_0x8466('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8466('0x5'))['db'];var utils=require(_0x8466('0x6'));var logger=require(_0x8466('0x7'))(_0x8466('0x8'));var config=require(_0x8466('0x9'));var jayson=require(_0x8466('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x494f20,_0x3e42c1,_0x535ec2){return new BPromise(function(_0x42aa4c,_0x36d2aa){return client[_0x8466('0xb')](_0x494f20,_0x535ec2)[_0x8466('0xc')](function(_0x43ae26){logger['info'](_0x8466('0xd'),_0x3e42c1,_0x8466('0xe'));logger['debug'](_0x8466('0xf'),_0x3e42c1,_0x8466('0xe'),JSON[_0x8466('0x10')](_0x43ae26));if(_0x43ae26[_0x8466('0x11')]){if(_0x43ae26[_0x8466('0x11')]['code']===0x1f4){logger[_0x8466('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x3e42c1,_0x43ae26[_0x8466('0x11')][_0x8466('0x12')]);return _0x36d2aa(_0x43ae26[_0x8466('0x11')][_0x8466('0x12')]);}logger[_0x8466('0x11')](_0x8466('0xd'),_0x3e42c1,_0x43ae26[_0x8466('0x11')]['message']);return _0x42aa4c(_0x43ae26[_0x8466('0x11')][_0x8466('0x12')]);}else{logger[_0x8466('0x13')](_0x8466('0xd'),_0x3e42c1,_0x8466('0xe'));_0x42aa4c(_0x43ae26[_0x8466('0x14')]['message']);}})[_0x8466('0x15')](function(_0x471c2b){logger[_0x8466('0x11')](_0x8466('0xd'),_0x3e42c1,_0x471c2b);_0x36d2aa(_0x471c2b);});});} \ No newline at end of file +var _0x908e=['result','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x908e,0x73));var _0xe908=function(_0x3ab5cb,_0x5b9e3d){_0x3ab5cb=_0x3ab5cb-0x0;var _0x46facb=_0x908e[_0x3ab5cb];return _0x46facb;};'use strict';var _=require('lodash');var util=require(_0xe908('0x0'));var moment=require(_0xe908('0x1'));var BPromise=require(_0xe908('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe908('0x3'));var logger=require(_0xe908('0x4'))(_0xe908('0x5'));var config=require(_0xe908('0x6'));var jayson=require(_0xe908('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27ca13,_0x20aa0e,_0x3e5b44){return new BPromise(function(_0x578517,_0x52e1a4){return client[_0xe908('0x8')](_0x27ca13,_0x3e5b44)['then'](function(_0x31e4af){logger[_0xe908('0x9')](_0xe908('0xa'),_0x20aa0e,'request\x20sent');logger[_0xe908('0xb')](_0xe908('0xc'),_0x20aa0e,_0xe908('0xd'),JSON[_0xe908('0xe')](_0x31e4af));if(_0x31e4af[_0xe908('0xf')]){if(_0x31e4af[_0xe908('0xf')][_0xe908('0x10')]===0x1f4){logger[_0xe908('0xf')](_0xe908('0xa'),_0x20aa0e,_0x31e4af[_0xe908('0xf')][_0xe908('0x11')]);return _0x52e1a4(_0x31e4af[_0xe908('0xf')][_0xe908('0x11')]);}logger[_0xe908('0xf')](_0xe908('0xa'),_0x20aa0e,_0x31e4af[_0xe908('0xf')][_0xe908('0x11')]);return _0x578517(_0x31e4af[_0xe908('0xf')][_0xe908('0x11')]);}else{logger[_0xe908('0x9')](_0xe908('0xa'),_0x20aa0e,_0xe908('0xd'));_0x578517(_0x31e4af[_0xe908('0x12')][_0xe908('0x11')]);}})['catch'](function(_0x20ff94){logger[_0xe908('0xf')](_0xe908('0xa'),_0x20aa0e,_0x20ff94);_0x52e1a4(_0x20ff94);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 65b10d2..6077c6d 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 _0x3c56=['create','put','/:id','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','show'];(function(_0x3bbd98,_0x100ea8){var _0x1af896=function(_0x432287){while(--_0x432287){_0x3bbd98['push'](_0x3bbd98['shift']());}};_0x1af896(++_0x100ea8);}(_0x3c56,0xa8));var _0x63c5=function(_0x190175,_0x5ef202){_0x190175=_0x190175-0x0;var _0x196995=_0x3c56[_0x190175];return _0x196995;};'use strict';var multer=require(_0x63c5('0x0'));var util=require('util');var path=require(_0x63c5('0x1'));var timeout=require(_0x63c5('0x2'));var express=require('express');var router=express[_0x63c5('0x3')]();var fs_extra=require(_0x63c5('0x4'));var auth=require(_0x63c5('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x63c5('0x6'));router[_0x63c5('0x7')]('/',auth[_0x63c5('0x8')](),controller['index']);router[_0x63c5('0x7')](_0x63c5('0x9'),auth[_0x63c5('0x8')](),controller[_0x63c5('0xa')]);router[_0x63c5('0x7')]('/:id',auth[_0x63c5('0x8')](),controller[_0x63c5('0xb')]);router['post']('/',auth[_0x63c5('0x8')](),controller[_0x63c5('0xc')]);router[_0x63c5('0xd')](_0x63c5('0xe'),auth[_0x63c5('0x8')](),controller[_0x63c5('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x63c5('0x10')]);module[_0x63c5('0x11')]=router; \ No newline at end of file +var _0xea2c=['/:id','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','put','update','delete'];(function(_0x3ca809,_0x26e315){var _0x587276=function(_0x24f6bb){while(--_0x24f6bb){_0x3ca809['push'](_0x3ca809['shift']());}};_0x587276(++_0x26e315);}(_0xea2c,0x19f));var _0xcea2=function(_0x11afa3,_0x42ab1a){_0x11afa3=_0x11afa3-0x0;var _0x129657=_0xea2c[_0x11afa3];return _0x129657;};'use strict';var multer=require(_0xcea2('0x0'));var util=require(_0xcea2('0x1'));var path=require('path');var timeout=require(_0xcea2('0x2'));var express=require('express');var router=express[_0xcea2('0x3')]();var fs_extra=require(_0xcea2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcea2('0x5'));var config=require(_0xcea2('0x6'));var controller=require(_0xcea2('0x7'));router[_0xcea2('0x8')]('/',auth[_0xcea2('0x9')](),controller[_0xcea2('0xa')]);router[_0xcea2('0x8')](_0xcea2('0xb'),auth[_0xcea2('0x9')](),controller[_0xcea2('0xc')]);router[_0xcea2('0x8')]('/:id',auth[_0xcea2('0x9')](),controller[_0xcea2('0xd')]);router['post']('/',auth[_0xcea2('0x9')](),controller['create']);router[_0xcea2('0xe')]('/:id',auth[_0xcea2('0x9')](),controller[_0xcea2('0xf')]);router[_0xcea2('0x10')](_0xcea2('0x11'),auth[_0xcea2('0x9')](),controller['destroy']);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 8601ef6..37c1aef 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x345c41,_0x2d7cbc){var _0x4c18f1=function(_0x5db7fb){while(--_0x5db7fb){_0x345c41['push'](_0x345c41['shift']());}};_0x4c18f1(++_0x2d7cbc);}(_0xaa88,0x137));var _0x8aa8=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0xaa88[_0x52e363];return _0x3fc2b5;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x38f374,_0x4b1d43){var _0x3c78a0=function(_0x4cbb16){while(--_0x4cbb16){_0x38f374['push'](_0x38f374['shift']());}};_0x3c78a0(++_0x4b1d43);}(_0xaa88,0x137));var _0x8aa8=function(_0x3b19ea,_0x518b6b){_0x3b19ea=_0x3b19ea-0x0;var _0x40ece9=_0xaa88[_0x3b19ea];return _0x40ece9;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index b386a86..02a13a7 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 _0x683c=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','update','then','destroy','error','name','send','map','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','MailTransferReport','includeAll','include','findAll','rows','show','rawAttributes','options','catch','create','body','params','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x23167e,_0x1b38a4){var _0x2282e4=function(_0x28cdaf){while(--_0x28cdaf){_0x23167e['push'](_0x23167e['shift']());}};_0x2282e4(++_0x1b38a4);}(_0x683c,0xc9));var _0xc683=function(_0x470c39,_0x3c7ddb){_0x470c39=_0x470c39-0x0;var _0x162482=_0x683c[_0x470c39];return _0x162482;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc683('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc683('0x1'));var rp=require(_0xc683('0x2'));var moment=require(_0xc683('0x3'));var BPromise=require(_0xc683('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc683('0x5'));var sox=require(_0xc683('0x6'));var csv=require(_0xc683('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc683('0x8'));var _=require('lodash');var squel=require(_0xc683('0x9'));var crypto=require(_0xc683('0xa'));var jsforce=require(_0xc683('0xb'));var deskjs=require(_0xc683('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc683('0xd'));var Papa=require('papaparse');var Redis=require(_0xc683('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc683('0xf'));var as=require(_0xc683('0x10'));var hardwareService=require(_0xc683('0x11'));var logger=require(_0xc683('0x12'))('api');var utils=require(_0xc683('0x13'));var config=require(_0xc683('0x14'));var licenseUtil=require(_0xc683('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b184f,_0x39750a){_0x39750a=_0x39750a||0xcc;return function(_0x28771c){if(_0x28771c){return _0x4b184f[_0xc683('0x16')](_0x39750a);}return _0x4b184f['status'](_0x39750a)[_0xc683('0x17')]();};}function respondWithResult(_0x5645da,_0x3a7d72){_0x3a7d72=_0x3a7d72||0xc8;return function(_0xb24ea1){if(_0xb24ea1){return _0x5645da['status'](_0x3a7d72)[_0xc683('0x18')](_0xb24ea1);}};}function respondWithFilteredResult(_0x5bfa1e,_0x50e08d){return function(_0x3d3ea7){if(_0x3d3ea7){var _0x535229=typeof _0x50e08d[_0xc683('0x19')]==='undefined'&&typeof _0x50e08d[_0xc683('0x1a')]===_0xc683('0x1b');var _0x9e37ec=_0x3d3ea7[_0xc683('0x1c')];var _0x3edb4c=_0x535229?0x0:_0x50e08d[_0xc683('0x19')];var _0x37f55f=_0x535229?_0x3d3ea7[_0xc683('0x1c')]:_0x50e08d[_0xc683('0x19')]+_0x50e08d[_0xc683('0x1a')];var _0x5a513d;if(_0x37f55f>=_0x9e37ec){_0x37f55f=_0x9e37ec;_0x5a513d=0xc8;}else{_0x5a513d=0xce;}_0x5bfa1e[_0xc683('0x1d')](_0x5a513d);return _0x5bfa1e[_0xc683('0x1e')](_0xc683('0x1f'),_0x3edb4c+'-'+_0x37f55f+'/'+_0x9e37ec)[_0xc683('0x18')](_0x3d3ea7);}return null;};}function patchUpdates(_0x559675){return function(_0x16692a){try{jsonpatch[_0xc683('0x20')](_0x16692a,_0x559675,!![]);}catch(_0x26d4fc){return BPromise[_0xc683('0x21')](_0x26d4fc);}return _0x16692a['save']();};}function saveUpdates(_0x4fe2a4,_0x4bd020){return function(_0x461fd9){if(_0x461fd9){return _0x461fd9[_0xc683('0x22')](_0x4fe2a4)[_0xc683('0x23')](function(_0x46e66f){return _0x46e66f;});}return null;};}function removeEntity(_0x3b84c2,_0x5ceb2e){return function(_0x3305af){if(_0x3305af){return _0x3305af[_0xc683('0x24')]()[_0xc683('0x23')](function(){_0x3b84c2['status'](0xcc)[_0xc683('0x17')]();});}};}function handleEntityNotFound(_0x2f4fbc,_0x18d6b9){return function(_0x21b651){if(!_0x21b651){_0x2f4fbc[_0xc683('0x16')](0x194);}return _0x21b651;};}function handleError(_0x581158,_0x3098b7){_0x3098b7=_0x3098b7||0x1f4;return function(_0x255075){logger[_0xc683('0x25')](_0x255075['stack']);if(_0x255075[_0xc683('0x26')]){delete _0x255075[_0xc683('0x26')];}_0x581158['status'](_0x3098b7)[_0xc683('0x27')](_0x255075);};}exports['index']=function(_0x224cb7,_0x3ef1b4){var _0x3a61c9={},_0x18a60a={},_0x1473b7={'count':0x0,'rows':[]};var _0x3095b1=_[_0xc683('0x28')](db['MailTransferReport']['rawAttributes'],function(_0x365a1b){return{'name':_0x365a1b['fieldName'],'type':_0x365a1b[_0xc683('0x29')]['key']};});_0x18a60a[_0xc683('0x2a')]=_['map'](_0x3095b1,_0xc683('0x26'));_0x18a60a[_0xc683('0x2b')]=_[_0xc683('0x2c')](_0x224cb7['query']);_0x18a60a['filters']=_['intersection'](_0x18a60a['model'],_0x18a60a[_0xc683('0x2b')]);_0x3a61c9[_0xc683('0x2d')]=_[_0xc683('0x2e')](_0x18a60a[_0xc683('0x2a')],qs['fields'](_0x224cb7['query'][_0xc683('0x2f')]));_0x3a61c9['attributes']=_0x3a61c9[_0xc683('0x2d')][_0xc683('0x30')]?_0x3a61c9[_0xc683('0x2d')]:_0x18a60a[_0xc683('0x2a')];if(!_0x224cb7[_0xc683('0x2b')][_0xc683('0x31')](_0xc683('0x32'))){_0x3a61c9[_0xc683('0x1a')]=qs[_0xc683('0x1a')](_0x224cb7['query'][_0xc683('0x1a')]);_0x3a61c9[_0xc683('0x19')]=qs['offset'](_0x224cb7[_0xc683('0x2b')][_0xc683('0x19')]);}_0x3a61c9['order']=qs[_0xc683('0x33')](_0x224cb7['query'][_0xc683('0x33')]);_0x3a61c9[_0xc683('0x34')]=qs[_0xc683('0x35')](_[_0xc683('0x36')](_0x224cb7[_0xc683('0x2b')],_0x18a60a['filters']),_0x3095b1);if(_0x224cb7[_0xc683('0x2b')]['filter']){_0x3a61c9[_0xc683('0x34')]=_[_0xc683('0x37')](_0x3a61c9[_0xc683('0x34')],{'$or':_[_0xc683('0x28')](_0x3095b1,function(_0x2e15e4){if(_0x2e15e4[_0xc683('0x29')]!==_0xc683('0x38')){var _0x128abb={};_0x128abb[_0x2e15e4['name']]={'$like':'%'+_0x224cb7[_0xc683('0x2b')][_0xc683('0x39')]+'%'};return _0x128abb;}})});}_0x3a61c9=_['merge']({},_0x3a61c9,_0x224cb7['options']);var _0x4d31e2={'where':_0x3a61c9[_0xc683('0x34')]};return db[_0xc683('0x3a')][_0xc683('0x1c')](_0x4d31e2)['then'](function(_0xa1c421){_0x1473b7[_0xc683('0x1c')]=_0xa1c421;if(_0x224cb7['query'][_0xc683('0x3b')]){_0x3a61c9[_0xc683('0x3c')]=[{'all':!![]}];}return db[_0xc683('0x3a')][_0xc683('0x3d')](_0x3a61c9);})[_0xc683('0x23')](function(_0x30d642){_0x1473b7[_0xc683('0x3e')]=_0x30d642;return _0x1473b7;})[_0xc683('0x23')](respondWithFilteredResult(_0x3ef1b4,_0x3a61c9))['catch'](handleError(_0x3ef1b4,null));};exports[_0xc683('0x3f')]=function(_0x4f3d37,_0x3bafb7){var _0x7c62c9={'raw':!![],'where':{'id':_0x4f3d37['params']['id']}},_0x8ee2dc={};_0x8ee2dc[_0xc683('0x2a')]=_[_0xc683('0x2c')](db[_0xc683('0x3a')][_0xc683('0x40')]);_0x8ee2dc[_0xc683('0x2b')]=_[_0xc683('0x2c')](_0x4f3d37[_0xc683('0x2b')]);_0x8ee2dc[_0xc683('0x35')]=_[_0xc683('0x2e')](_0x8ee2dc['model'],_0x8ee2dc[_0xc683('0x2b')]);_0x7c62c9['attributes']=_['intersection'](_0x8ee2dc[_0xc683('0x2a')],qs['fields'](_0x4f3d37[_0xc683('0x2b')][_0xc683('0x2f')]));_0x7c62c9[_0xc683('0x2d')]=_0x7c62c9[_0xc683('0x2d')][_0xc683('0x30')]?_0x7c62c9['attributes']:_0x8ee2dc[_0xc683('0x2a')];if(_0x4f3d37[_0xc683('0x2b')][_0xc683('0x3b')]){_0x7c62c9['include']=[{'all':!![]}];}_0x7c62c9=_[_0xc683('0x37')]({},_0x7c62c9,_0x4f3d37[_0xc683('0x41')]);return db['MailTransferReport']['find'](_0x7c62c9)[_0xc683('0x23')](handleEntityNotFound(_0x3bafb7,null))[_0xc683('0x23')](respondWithResult(_0x3bafb7,null))[_0xc683('0x42')](handleError(_0x3bafb7,null));};exports[_0xc683('0x43')]=function(_0x378117,_0x5eaec4){return db['MailTransferReport'][_0xc683('0x43')](_0x378117['body'],{})['then'](respondWithResult(_0x5eaec4,0xc9))[_0xc683('0x42')](handleError(_0x5eaec4,null));};exports[_0xc683('0x22')]=function(_0x1e1d82,_0x2cda71){if(_0x1e1d82[_0xc683('0x44')]['id']){delete _0x1e1d82[_0xc683('0x44')]['id'];}return db[_0xc683('0x3a')]['find']({'where':{'id':_0x1e1d82[_0xc683('0x45')]['id']}})[_0xc683('0x23')](handleEntityNotFound(_0x2cda71,null))[_0xc683('0x23')](saveUpdates(_0x1e1d82[_0xc683('0x44')],null))[_0xc683('0x23')](respondWithResult(_0x2cda71,null))[_0xc683('0x42')](handleError(_0x2cda71,null));};exports['destroy']=function(_0x2f1703,_0xbd74f0){return db[_0xc683('0x3a')][_0xc683('0x46')]({'where':{'id':_0x2f1703[_0xc683('0x45')]['id']}})['then'](handleEntityNotFound(_0xbd74f0,null))['then'](removeEntity(_0xbd74f0,null))[_0xc683('0x42')](handleError(_0xbd74f0,null));};exports['describe']=function(_0x190764,_0x2e1632){return db[_0xc683('0x3a')][_0xc683('0x47')]()[_0xc683('0x23')](respondWithResult(_0x2e1632,null))[_0xc683('0x42')](handleError(_0x2e1632,null));}; \ No newline at end of file +var _0xf1bf=['rows','catch','show','params','intersection','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailTransferReport','fieldName','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll'];(function(_0x79b899,_0x271f68){var _0x51ba28=function(_0x4ca677){while(--_0x4ca677){_0x79b899['push'](_0x79b899['shift']());}};_0x51ba28(++_0x271f68);}(_0xf1bf,0x186));var _0xff1b=function(_0x1c695a,_0x186ab4){_0x1c695a=_0x1c695a-0x0;var _0x38b9e0=_0xf1bf[_0x1c695a];return _0x38b9e0;};'use strict';var emlformat=require(_0xff1b('0x0'));var rimraf=require(_0xff1b('0x1'));var zipdir=require(_0xff1b('0x2'));var jsonpatch=require(_0xff1b('0x3'));var rp=require('request-promise');var moment=require(_0xff1b('0x4'));var BPromise=require(_0xff1b('0x5'));var Mustache=require(_0xff1b('0x6'));var util=require(_0xff1b('0x7'));var path=require(_0xff1b('0x8'));var sox=require(_0xff1b('0x9'));var csv=require(_0xff1b('0xa'));var ejs=require(_0xff1b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff1b('0xc'));var squel=require('squel');var crypto=require(_0xff1b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xff1b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xff1b('0xf'));var Redis=require(_0xff1b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xff1b('0x11'));var as=require(_0xff1b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff1b('0x13'))(_0xff1b('0x14'));var utils=require(_0xff1b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xff1b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35bd6b,_0x21fb4d){_0x21fb4d=_0x21fb4d||0xcc;return function(_0x120b22){if(_0x120b22){return _0x35bd6b[_0xff1b('0x17')](_0x21fb4d);}return _0x35bd6b['status'](_0x21fb4d)[_0xff1b('0x18')]();};}function respondWithResult(_0x3e532a,_0x34f8c7){_0x34f8c7=_0x34f8c7||0xc8;return function(_0x353321){if(_0x353321){return _0x3e532a['status'](_0x34f8c7)[_0xff1b('0x19')](_0x353321);}};}function respondWithFilteredResult(_0x5007bf,_0x23c527){return function(_0x4409fe){if(_0x4409fe){var _0x405464=typeof _0x23c527[_0xff1b('0x1a')]===_0xff1b('0x1b')&&typeof _0x23c527[_0xff1b('0x1c')]===_0xff1b('0x1b');var _0x1cd54d=_0x4409fe['count'];var _0x88198d=_0x405464?0x0:_0x23c527[_0xff1b('0x1a')];var _0x5c3e98=_0x405464?_0x4409fe[_0xff1b('0x1d')]:_0x23c527[_0xff1b('0x1a')]+_0x23c527[_0xff1b('0x1c')];var _0x153d78;if(_0x5c3e98>=_0x1cd54d){_0x5c3e98=_0x1cd54d;_0x153d78=0xc8;}else{_0x153d78=0xce;}_0x5007bf[_0xff1b('0x1e')](_0x153d78);return _0x5007bf[_0xff1b('0x1f')]('Content-Range',_0x88198d+'-'+_0x5c3e98+'/'+_0x1cd54d)[_0xff1b('0x19')](_0x4409fe);}return null;};}function patchUpdates(_0x1a0cd1){return function(_0x292a9f){try{jsonpatch[_0xff1b('0x20')](_0x292a9f,_0x1a0cd1,!![]);}catch(_0x455c93){return BPromise[_0xff1b('0x21')](_0x455c93);}return _0x292a9f[_0xff1b('0x22')]();};}function saveUpdates(_0x4a5474,_0x3085b1){return function(_0x14722b){if(_0x14722b){return _0x14722b[_0xff1b('0x23')](_0x4a5474)[_0xff1b('0x24')](function(_0x199d63){return _0x199d63;});}return null;};}function removeEntity(_0x46b020,_0x50cec4){return function(_0x4db675){if(_0x4db675){return _0x4db675[_0xff1b('0x25')]()[_0xff1b('0x24')](function(){_0x46b020[_0xff1b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x402e73,_0x150ee0){return function(_0x24b8b1){if(!_0x24b8b1){_0x402e73['sendStatus'](0x194);}return _0x24b8b1;};}function handleError(_0xef4c32,_0x5d1646){_0x5d1646=_0x5d1646||0x1f4;return function(_0x48aa8a){logger[_0xff1b('0x26')](_0x48aa8a[_0xff1b('0x27')]);if(_0x48aa8a[_0xff1b('0x28')]){delete _0x48aa8a[_0xff1b('0x28')];}_0xef4c32[_0xff1b('0x1e')](_0x5d1646)[_0xff1b('0x29')](_0x48aa8a);};}exports[_0xff1b('0x2a')]=function(_0x5213e7,_0xa02e58){var _0x3d282b={},_0x237321={},_0xd87f3e={'count':0x0,'rows':[]};var _0x5c039d=_[_0xff1b('0x2b')](db[_0xff1b('0x2c')]['rawAttributes'],function(_0x3a13b0){return{'name':_0x3a13b0[_0xff1b('0x2d')],'type':_0x3a13b0['type']['key']};});_0x237321[_0xff1b('0x2e')]=_[_0xff1b('0x2b')](_0x5c039d,'name');_0x237321[_0xff1b('0x2f')]=_[_0xff1b('0x30')](_0x5213e7[_0xff1b('0x2f')]);_0x237321[_0xff1b('0x31')]=_['intersection'](_0x237321[_0xff1b('0x2e')],_0x237321[_0xff1b('0x2f')]);_0x3d282b['attributes']=_['intersection'](_0x237321[_0xff1b('0x2e')],qs['fields'](_0x5213e7[_0xff1b('0x2f')][_0xff1b('0x32')]));_0x3d282b[_0xff1b('0x33')]=_0x3d282b['attributes'][_0xff1b('0x34')]?_0x3d282b[_0xff1b('0x33')]:_0x237321[_0xff1b('0x2e')];if(!_0x5213e7[_0xff1b('0x2f')][_0xff1b('0x35')](_0xff1b('0x36'))){_0x3d282b[_0xff1b('0x1c')]=qs[_0xff1b('0x1c')](_0x5213e7['query']['limit']);_0x3d282b[_0xff1b('0x1a')]=qs[_0xff1b('0x1a')](_0x5213e7[_0xff1b('0x2f')]['offset']);}_0x3d282b[_0xff1b('0x37')]=qs['sort'](_0x5213e7[_0xff1b('0x2f')][_0xff1b('0x38')]);_0x3d282b[_0xff1b('0x39')]=qs[_0xff1b('0x31')](_[_0xff1b('0x3a')](_0x5213e7[_0xff1b('0x2f')],_0x237321[_0xff1b('0x31')]),_0x5c039d);if(_0x5213e7['query'][_0xff1b('0x3b')]){_0x3d282b[_0xff1b('0x39')]=_['merge'](_0x3d282b[_0xff1b('0x39')],{'$or':_['map'](_0x5c039d,function(_0xf969ec){if(_0xf969ec[_0xff1b('0x3c')]!==_0xff1b('0x3d')){var _0x5d6227={};_0x5d6227[_0xf969ec[_0xff1b('0x28')]]={'$like':'%'+_0x5213e7['query'][_0xff1b('0x3b')]+'%'};return _0x5d6227;}})});}_0x3d282b=_['merge']({},_0x3d282b,_0x5213e7[_0xff1b('0x3e')]);var _0x2a6724={'where':_0x3d282b[_0xff1b('0x39')]};return db[_0xff1b('0x2c')][_0xff1b('0x1d')](_0x2a6724)[_0xff1b('0x24')](function(_0xe51e01){_0xd87f3e['count']=_0xe51e01;if(_0x5213e7[_0xff1b('0x2f')][_0xff1b('0x3f')]){_0x3d282b[_0xff1b('0x40')]=[{'all':!![]}];}return db[_0xff1b('0x2c')][_0xff1b('0x41')](_0x3d282b);})[_0xff1b('0x24')](function(_0x8df653){_0xd87f3e[_0xff1b('0x42')]=_0x8df653;return _0xd87f3e;})[_0xff1b('0x24')](respondWithFilteredResult(_0xa02e58,_0x3d282b))[_0xff1b('0x43')](handleError(_0xa02e58,null));};exports[_0xff1b('0x44')]=function(_0x2b56f9,_0xfadc0f){var _0x5bbf24={'raw':!![],'where':{'id':_0x2b56f9[_0xff1b('0x45')]['id']}},_0x32d8a9={};_0x32d8a9[_0xff1b('0x2e')]=_['keys'](db[_0xff1b('0x2c')]['rawAttributes']);_0x32d8a9['query']=_[_0xff1b('0x30')](_0x2b56f9[_0xff1b('0x2f')]);_0x32d8a9[_0xff1b('0x31')]=_[_0xff1b('0x46')](_0x32d8a9[_0xff1b('0x2e')],_0x32d8a9[_0xff1b('0x2f')]);_0x5bbf24[_0xff1b('0x33')]=_[_0xff1b('0x46')](_0x32d8a9[_0xff1b('0x2e')],qs[_0xff1b('0x32')](_0x2b56f9[_0xff1b('0x2f')][_0xff1b('0x32')]));_0x5bbf24['attributes']=_0x5bbf24[_0xff1b('0x33')]['length']?_0x5bbf24[_0xff1b('0x33')]:_0x32d8a9[_0xff1b('0x2e')];if(_0x2b56f9[_0xff1b('0x2f')][_0xff1b('0x3f')]){_0x5bbf24['include']=[{'all':!![]}];}_0x5bbf24=_[_0xff1b('0x47')]({},_0x5bbf24,_0x2b56f9['options']);return db['MailTransferReport'][_0xff1b('0x48')](_0x5bbf24)[_0xff1b('0x24')](handleEntityNotFound(_0xfadc0f,null))[_0xff1b('0x24')](respondWithResult(_0xfadc0f,null))[_0xff1b('0x43')](handleError(_0xfadc0f,null));};exports[_0xff1b('0x49')]=function(_0x2a5dc6,_0x2273b3){return db[_0xff1b('0x2c')]['create'](_0x2a5dc6[_0xff1b('0x4a')],{})['then'](respondWithResult(_0x2273b3,0xc9))['catch'](handleError(_0x2273b3,null));};exports[_0xff1b('0x23')]=function(_0x4932c2,_0x175be7){if(_0x4932c2[_0xff1b('0x4a')]['id']){delete _0x4932c2[_0xff1b('0x4a')]['id'];}return db[_0xff1b('0x2c')][_0xff1b('0x48')]({'where':{'id':_0x4932c2[_0xff1b('0x45')]['id']}})[_0xff1b('0x24')](handleEntityNotFound(_0x175be7,null))[_0xff1b('0x24')](saveUpdates(_0x4932c2[_0xff1b('0x4a')],null))[_0xff1b('0x24')](respondWithResult(_0x175be7,null))[_0xff1b('0x43')](handleError(_0x175be7,null));};exports[_0xff1b('0x25')]=function(_0x4a042a,_0x848246){return db[_0xff1b('0x2c')][_0xff1b('0x48')]({'where':{'id':_0x4a042a['params']['id']}})[_0xff1b('0x24')](handleEntityNotFound(_0x848246,null))[_0xff1b('0x24')](removeEntity(_0x848246,null))[_0xff1b('0x43')](handleError(_0x848246,null));};exports[_0xff1b('0x4b')]=function(_0x4652b7,_0x354f81){return db[_0xff1b('0x2c')]['describe']()[_0xff1b('0x24')](respondWithResult(_0x354f81,null))['catch'](handleError(_0x354f81,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 602e6ce..c41c837 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 _0x7aaf=['rimraf','./mailTransferReport.attributes','exports','MailTransferReport','uniqueid','lodash','../../config/logger','api','request-promise'];(function(_0x5cb4aa,_0x2cfa37){var _0x5039ff=function(_0x53363a){while(--_0x53363a){_0x5cb4aa['push'](_0x5cb4aa['shift']());}};_0x5039ff(++_0x2cfa37);}(_0x7aaf,0x1eb));var _0xf7aa=function(_0x4facb9,_0x5181a0){_0x4facb9=_0x4facb9-0x0;var _0x2d93c9=_0x7aaf[_0x4facb9];return _0x2d93c9;};'use strict';var _=require(_0xf7aa('0x0'));var util=require('util');var logger=require(_0xf7aa('0x1'))(_0xf7aa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf7aa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7aa('0x4'));var config=require('../../config/environment');var attributes=require(_0xf7aa('0x5'));module[_0xf7aa('0x6')]=function(_0x1babcd,_0xf02ed5){return _0x1babcd['define'](_0xf7aa('0x7'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf7aa('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0689=['../../config/environment','./mailTransferReport.attributes','exports','define','uniqueid','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x492f17,_0x522a19){var _0x415c4e=function(_0x4113fb){while(--_0x4113fb){_0x492f17['push'](_0x492f17['shift']());}};_0x415c4e(++_0x522a19);}(_0x0689,0x161));var _0x9068=function(_0x46b832,_0x454e18){_0x46b832=_0x46b832-0x0;var _0x42b328=_0x0689[_0x46b832];return _0x42b328;};'use strict';var _=require('lodash');var util=require(_0x9068('0x0'));var logger=require('../../config/logger')(_0x9068('0x1'));var moment=require(_0x9068('0x2'));var BPromise=require(_0x9068('0x3'));var rp=require(_0x9068('0x4'));var fs=require('fs');var path=require(_0x9068('0x5'));var rimraf=require(_0x9068('0x6'));var config=require(_0x9068('0x7'));var attributes=require(_0x9068('0x8'));module[_0x9068('0x9')]=function(_0x287846,_0x5ce5a7){return _0x287846[_0x9068('0xa')]('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x9068('0xb'),'fields':[_0x9068('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index f5f621f..31d4018 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 _0x339a=['MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','debug'];(function(_0x59a43b,_0x52638e){var _0x1b7ea5=function(_0x6a5a1f){while(--_0x6a5a1f){_0x59a43b['push'](_0x59a43b['shift']());}};_0x1b7ea5(++_0x52638e);}(_0x339a,0xd0));var _0xa339=function(_0x15cf03,_0x45018d){_0x15cf03=_0x15cf03-0x0;var _0xdd675f=_0x339a[_0x15cf03];return _0xdd675f;};'use strict';var _=require(_0xa339('0x0'));var util=require('util');var moment=require(_0xa339('0x1'));var BPromise=require('bluebird');var rs=require(_0xa339('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa339('0x3'))['db'];var utils=require(_0xa339('0x4'));var logger=require(_0xa339('0x5'))('rpc');var config=require(_0xa339('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa339('0x7')][_0xa339('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f3616,_0x257114,_0x15bc55){return new BPromise(function(_0x504d1a,_0x23442d){return client['request'](_0x5f3616,_0x15bc55)[_0xa339('0x9')](function(_0x77cce5){logger[_0xa339('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x257114,'request\x20sent');logger[_0xa339('0xb')](_0xa339('0xc'),_0x257114,_0xa339('0xd'),JSON[_0xa339('0xe')](_0x77cce5));if(_0x77cce5[_0xa339('0xf')]){if(_0x77cce5['error'][_0xa339('0x10')]===0x1f4){logger[_0xa339('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x257114,_0x77cce5[_0xa339('0xf')]['message']);return _0x23442d(_0x77cce5[_0xa339('0xf')]['message']);}logger[_0xa339('0xf')](_0xa339('0x11'),_0x257114,_0x77cce5['error'][_0xa339('0x12')]);return _0x504d1a(_0x77cce5[_0xa339('0xf')][_0xa339('0x12')]);}else{logger[_0xa339('0xa')](_0xa339('0x11'),_0x257114,_0xa339('0xd'));_0x504d1a(_0x77cce5['result'][_0xa339('0x12')]);}})[_0xa339('0x13')](function(_0x2a4f50){logger[_0xa339('0xf')](_0xa339('0x11'),_0x257114,_0x2a4f50);_0x23442d(_0x2a4f50);});});} \ No newline at end of file +var _0xdf17=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring'];(function(_0x5358fd,_0x4a719c){var _0x3adc9e=function(_0x43332c){while(--_0x43332c){_0x5358fd['push'](_0x5358fd['shift']());}};_0x3adc9e(++_0x4a719c);}(_0xdf17,0x96));var _0x7df1=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xdf17[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0x7df1('0x0'));var util=require('util');var moment=require(_0x7df1('0x1'));var BPromise=require(_0x7df1('0x2'));var rs=require(_0x7df1('0x3'));var fs=require('fs');var Redis=require(_0x7df1('0x4'));var db=require(_0x7df1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7df1('0x6'))(_0x7df1('0x7'));var config=require(_0x7df1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7df1('0x9')][_0x7df1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28c44d,_0x13b590,_0x308aaf){return new BPromise(function(_0x3c0d41,_0x34f3f4){return client[_0x7df1('0xb')](_0x28c44d,_0x308aaf)[_0x7df1('0xc')](function(_0x471360){logger[_0x7df1('0xd')](_0x7df1('0xe'),_0x13b590,'request\x20sent');logger['debug'](_0x7df1('0xf'),_0x13b590,_0x7df1('0x10'),JSON[_0x7df1('0x11')](_0x471360));if(_0x471360[_0x7df1('0x12')]){if(_0x471360[_0x7df1('0x12')][_0x7df1('0x13')]===0x1f4){logger[_0x7df1('0x12')](_0x7df1('0xe'),_0x13b590,_0x471360[_0x7df1('0x12')][_0x7df1('0x14')]);return _0x34f3f4(_0x471360[_0x7df1('0x12')][_0x7df1('0x14')]);}logger[_0x7df1('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x13b590,_0x471360['error'][_0x7df1('0x14')]);return _0x3c0d41(_0x471360['error']['message']);}else{logger[_0x7df1('0xd')](_0x7df1('0xe'),_0x13b590,_0x7df1('0x10'));_0x3c0d41(_0x471360[_0x7df1('0x15')]['message']);}})['catch'](function(_0x173afe){logger[_0x7df1('0x12')](_0x7df1('0xe'),_0x13b590,_0x173afe);_0x34f3f4(_0x173afe);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 8b1f213..deddd06 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 _0x441a=['./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x560fe0,_0x36ceb6){var _0x4d3b13=function(_0x1109c5){while(--_0x1109c5){_0x560fe0['push'](_0x560fe0['shift']());}};_0x4d3b13(++_0x36ceb6);}(_0x441a,0xad));var _0xa441=function(_0x1443eb,_0x203408){_0x1443eb=_0x1443eb-0x0;var _0x2b8810=_0x441a[_0x1443eb];return _0x2b8810;};'use strict';var multer=require('multer');var util=require(_0xa441('0x0'));var path=require(_0xa441('0x1'));var timeout=require(_0xa441('0x2'));var express=require(_0xa441('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa441('0x4'));var interaction=require(_0xa441('0x5'));var config=require(_0xa441('0x6'));var controller=require(_0xa441('0x7'));router[_0xa441('0x8')]('/',auth[_0xa441('0x9')](),controller[_0xa441('0xa')]);router[_0xa441('0x8')](_0xa441('0xb'),auth[_0xa441('0x9')](),controller[_0xa441('0xc')]);router[_0xa441('0x8')](_0xa441('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xa441('0xe')]('/',auth['isAuthenticated'](),controller[_0xa441('0xf')]);router[_0xa441('0x10')](_0xa441('0xd'),auth[_0xa441('0x9')](),controller[_0xa441('0x11')]);router[_0xa441('0x12')](_0xa441('0xd'),auth['isAuthenticated'](),controller[_0xa441('0x13')]);module['exports']=router; \ No newline at end of file +var _0xa480=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','update','/:id','destroy','multer','util'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0xa480,0x76));var _0x0a48=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0xa480[_0xbb9dbf];return _0x30223c;};'use strict';var multer=require(_0x0a48('0x0'));var util=require(_0x0a48('0x1'));var path=require(_0x0a48('0x2'));var timeout=require(_0x0a48('0x3'));var express=require('express');var router=express[_0x0a48('0x4')]();var fs_extra=require(_0x0a48('0x5'));var auth=require(_0x0a48('0x6'));var interaction=require(_0x0a48('0x7'));var config=require('../../config/environment');var controller=require(_0x0a48('0x8'));router[_0x0a48('0x9')]('/',auth[_0x0a48('0xa')](),controller[_0x0a48('0xb')]);router[_0x0a48('0x9')](_0x0a48('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x0a48('0x9')]('/:id',auth[_0x0a48('0xa')](),controller[_0x0a48('0xd')]);router[_0x0a48('0xe')]('/',auth[_0x0a48('0xa')](),controller[_0x0a48('0xf')]);router[_0x0a48('0x10')]('/:id',auth[_0x0a48('0xa')](),controller[_0x0a48('0x11')]);router['delete'](_0x0a48('0x12'),auth[_0x0a48('0xa')](),controller[_0x0a48('0x13')]);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 f14efd6..f95582f 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 _0xa50a=['talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]'];(function(_0x534792,_0x3e8cc2){var _0x315662=function(_0x218a4b){while(--_0x218a4b){_0x534792['push'](_0x534792['shift']());}};_0x315662(++_0x3e8cc2);}(_0xa50a,0x88));var _0xaa50=function(_0xe01a2,_0xfd91e){_0xe01a2=_0xe01a2-0x0;var _0x1e8116=_0xa50a[_0xe01a2];return _0x1e8116;};'use strict';var Sequelize=require(_0xaa50('0x0'));var moment=require(_0xaa50('0x1'));module[_0xaa50('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xaa50('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xaa50('0x3')],'defaultValue':_0xaa50('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xaa50('0x5')]},'exitAt':{'type':Sequelize[_0xaa50('0x5')],'set':function(_0x1802cf){var _0x2236bb=moment(_0x1802cf);var _0x3de33e=moment(this[_0xaa50('0x6')](_0xaa50('0x7')));var _0x337243=_0x2236bb[_0xaa50('0x8')](_0x3de33e,_0xaa50('0x9'));this[_0xaa50('0xa')](_0xaa50('0xb'),_0x1802cf);this['setDataValue'](_0xaa50('0xc'),_0x337243>=0x0?_0x337243:null);}},'data1':{'type':Sequelize[_0xaa50('0x3')],'comment':_0xaa50('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0xaa50('0xe')},'data3':{'type':Sequelize[_0xaa50('0x3')],'comment':_0xaa50('0xf')},'data4':{'type':Sequelize[_0xaa50('0x3')],'comment':_0xaa50('0x10')},'data5':{'type':Sequelize['STRING'],'comment':_0xaa50('0x11')},'role':{'type':Sequelize[_0xaa50('0x3')]},'internal':{'type':Sequelize[_0xaa50('0x12')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x08f6=['INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x08f6,0x1d5));var _0x608f=function(_0x326e79,_0x33dc91){_0x326e79=_0x326e79-0x0;var _0x37eb89=_0x08f6[_0x326e79];return _0x37eb89;};'use strict';var Sequelize=require(_0x608f('0x0'));var moment=require(_0x608f('0x1'));module[_0x608f('0x2')]={'channel':{'type':Sequelize[_0x608f('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x608f('0x3')]},'type':{'type':Sequelize[_0x608f('0x3')],'defaultValue':_0x608f('0x4'),'comment':_0x608f('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x608f('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x714a9c){var _0x3e27e7=moment(_0x714a9c);var _0x7d09be=moment(this[_0x608f('0x7')](_0x608f('0x8')));var _0x62d47f=_0x3e27e7[_0x608f('0x9')](_0x7d09be,'seconds');this[_0x608f('0xa')](_0x608f('0xb'),_0x714a9c);this[_0x608f('0xa')](_0x608f('0xc'),_0x62d47f>=0x0?_0x62d47f:null);}},'data1':{'type':Sequelize[_0x608f('0x3')],'comment':_0x608f('0xd')},'data2':{'type':Sequelize[_0x608f('0x3')],'comment':_0x608f('0xe')},'data3':{'type':Sequelize[_0x608f('0x3')],'comment':_0x608f('0xf')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0x608f('0x10')},'role':{'type':Sequelize[_0x608f('0x3')]},'internal':{'type':Sequelize[_0x608f('0x11')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index eec0679..e28556b 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(_0x3146da,_0x277a70){var _0x1070de=function(_0x43a1b1){while(--_0x43a1b1){_0x3146da['push'](_0x3146da['shift']());}};_0x1070de(++_0x277a70);}(_0x008c,0x188));var _0xc008=function(_0x295143,_0x105ade){_0x295143=_0x295143-0x0;var _0x7982e4=_0x008c[_0x295143];return _0x7982e4;};'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 _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(_0x80764,_0x389472){var _0x461709=function(_0x1bbdc1){while(--_0x1bbdc1){_0x80764['push'](_0x80764['shift']());}};_0x461709(++_0x389472);}(_0x008c,0x188));var _0xc008=function(_0x22ea59,_0x387ed1){_0x22ea59=_0x22ea59-0x0;var _0x444611=_0x008c[_0x22ea59];return _0x444611;};'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 diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index feb0e65..1e5fb14 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 _0xcca9=['membername_interface','interface','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','define','MemberReport','report_member'];(function(_0xd03ee1,_0x130340){var _0x6ac93a=function(_0x261aa2){while(--_0x261aa2){_0xd03ee1['push'](_0xd03ee1['shift']());}};_0x6ac93a(++_0x130340);}(_0xcca9,0x1ee));var _0x9cca=function(_0x9b9c46,_0x3997a8){_0x9b9c46=_0x9b9c46-0x0;var _0x47ee52=_0xcca9[_0x9b9c46];return _0x47ee52;};'use strict';var _=require(_0x9cca('0x0'));var util=require('util');var logger=require(_0x9cca('0x1'))(_0x9cca('0x2'));var moment=require('moment');var BPromise=require(_0x9cca('0x3'));var rp=require(_0x9cca('0x4'));var fs=require('fs');var path=require(_0x9cca('0x5'));var rimraf=require('rimraf');var config=require(_0x9cca('0x6'));var attributes=require('./memberReport.attributes');module['exports']=function(_0x1b80c7,_0x52eda9){return _0x1b80c7[_0x9cca('0x7')](_0x9cca('0x8'),attributes,{'tableName':_0x9cca('0x9'),'paranoid':![],'indexes':[{'name':_0x9cca('0xa'),'fields':['membername',_0x9cca('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb209=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','interface','lodash','../../config/logger'];(function(_0x10ea84,_0x31a73d){var _0x1847b3=function(_0x9df7fa){while(--_0x9df7fa){_0x10ea84['push'](_0x10ea84['shift']());}};_0x1847b3(++_0x31a73d);}(_0xb209,0x16e));var _0x9b20=function(_0x227ceb,_0x184cae){_0x227ceb=_0x227ceb-0x0;var _0x2e067e=_0xb209[_0x227ceb];return _0x2e067e;};'use strict';var _=require(_0x9b20('0x0'));var util=require('util');var logger=require(_0x9b20('0x1'))(_0x9b20('0x2'));var moment=require(_0x9b20('0x3'));var BPromise=require(_0x9b20('0x4'));var rp=require(_0x9b20('0x5'));var fs=require('fs');var path=require(_0x9b20('0x6'));var rimraf=require(_0x9b20('0x7'));var config=require(_0x9b20('0x8'));var attributes=require(_0x9b20('0x9'));module[_0x9b20('0xa')]=function(_0x26c338,_0x1e9707){return _0x26c338[_0x9b20('0xb')](_0x9b20('0xc'),attributes,{'tableName':_0x9b20('0xd'),'paranoid':![],'indexes':[{'name':_0x9b20('0xe'),'fields':['membername',_0x9b20('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index a167249..bd07dc8 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 _0x0738=['jayson/promise','client','request','then','info','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MemberReport,\x20%s,\x20%s','message','GetMemberReport','MemberReport','findAll','raw','options','where','attributes','limit','map','include','model','catch','create','CreateMemberReport','update','body','UpdateMemberReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x609cf8,_0x9cb4e5){var _0x357ecb=function(_0x2b0d54){while(--_0x2b0d54){_0x609cf8['push'](_0x609cf8['shift']());}};_0x357ecb(++_0x9cb4e5);}(_0x0738,0x6e));var _0x8073=function(_0x16e9b5,_0x192142){_0x16e9b5=_0x16e9b5-0x0;var _0x206df0=_0x0738[_0x16e9b5];return _0x206df0;};'use strict';var _=require(_0x8073('0x0'));var util=require('util');var moment=require(_0x8073('0x1'));var BPromise=require(_0x8073('0x2'));var rs=require(_0x8073('0x3'));var fs=require('fs');var Redis=require(_0x8073('0x4'));var db=require(_0x8073('0x5'))['db'];var utils=require(_0x8073('0x6'));var logger=require(_0x8073('0x7'))(_0x8073('0x8'));var config=require(_0x8073('0x9'));var jayson=require(_0x8073('0xa'));var client=jayson[_0x8073('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1aad61,_0x16ff8b,_0x2899ce){return new BPromise(function(_0x310f3a,_0x3f7807){return client[_0x8073('0xc')](_0x1aad61,_0x2899ce)[_0x8073('0xd')](function(_0x57b564){logger[_0x8073('0xe')]('MemberReport,\x20%s,\x20%s',_0x16ff8b,'request\x20sent');logger[_0x8073('0xf')](_0x8073('0x10'),_0x16ff8b,_0x8073('0x11'),JSON[_0x8073('0x12')](_0x57b564));if(_0x57b564['error']){if(_0x57b564[_0x8073('0x13')][_0x8073('0x14')]===0x1f4){logger['error'](_0x8073('0x15'),_0x16ff8b,_0x57b564['error'][_0x8073('0x16')]);return _0x3f7807(_0x57b564[_0x8073('0x13')][_0x8073('0x16')]);}logger[_0x8073('0x13')]('MemberReport,\x20%s,\x20%s',_0x16ff8b,_0x57b564[_0x8073('0x13')][_0x8073('0x16')]);return _0x310f3a(_0x57b564[_0x8073('0x13')][_0x8073('0x16')]);}else{logger[_0x8073('0xe')](_0x8073('0x15'),_0x16ff8b,_0x8073('0x11'));_0x310f3a(_0x57b564['result'][_0x8073('0x16')]);}})['catch'](function(_0xe9c222){logger[_0x8073('0x13')](_0x8073('0x15'),_0x16ff8b,_0xe9c222);_0x3f7807(_0xe9c222);});});}exports[_0x8073('0x17')]=function(_0x24cc34){var _0x2bd877=this;return new Promise(function(_0xb20a36,_0x8b8f1a){return db[_0x8073('0x18')][_0x8073('0x19')]({'raw':_0x24cc34['options']?_0x24cc34['options'][_0x8073('0x1a')]===undefined?!![]:![]:!![],'where':_0x24cc34[_0x8073('0x1b')]?_0x24cc34['options'][_0x8073('0x1c')]||null:null,'attributes':_0x24cc34[_0x8073('0x1b')]?_0x24cc34[_0x8073('0x1b')][_0x8073('0x1d')]||null:null,'limit':_0x24cc34[_0x8073('0x1b')]?_0x24cc34[_0x8073('0x1b')][_0x8073('0x1e')]||null:null,'include':_0x24cc34['options']?_0x24cc34[_0x8073('0x1b')]['include']?_[_0x8073('0x1f')](_0x24cc34[_0x8073('0x1b')][_0x8073('0x20')],function(_0x52245a){return{'model':db[_0x52245a[_0x8073('0x21')]],'as':_0x52245a['as'],'attributes':_0x52245a[_0x8073('0x1d')],'include':_0x52245a[_0x8073('0x20')]?_['map'](_0x52245a[_0x8073('0x20')],function(_0x3ff578){return{'model':db[_0x3ff578[_0x8073('0x21')]],'as':_0x3ff578['as'],'attributes':_0x3ff578[_0x8073('0x1d')],'include':_0x3ff578['include']?_[_0x8073('0x1f')](_0x3ff578[_0x8073('0x20')],function(_0x282efe){return{'model':db[_0x282efe[_0x8073('0x21')]],'as':_0x282efe['as'],'attributes':_0x282efe[_0x8073('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8073('0xd')](function(_0x4da7d9){logger[_0x8073('0xe')](_0x8073('0x17'),_0x24cc34);logger[_0x8073('0xf')](_0x8073('0x17'),_0x24cc34,JSON['stringify'](_0x4da7d9));_0xb20a36(_0x4da7d9);})[_0x8073('0x22')](function(_0x51c5d5){logger['error']('GetMemberReport',_0x51c5d5[_0x8073('0x16')],_0x24cc34);_0x8b8f1a(_0x2bd877['error'](0x1f4,_0x51c5d5['message']));});});};exports['CreateMemberReport']=function(_0x2def57){var _0x337135=this;return new Promise(function(_0x5e4ddc,_0x47df3b){return db[_0x8073('0x18')][_0x8073('0x23')](_0x2def57['body'],{'raw':_0x2def57[_0x8073('0x1b')]?_0x2def57[_0x8073('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x8073('0xd')](function(_0x286c7c){logger[_0x8073('0xe')]('CreateMemberReport',_0x2def57);logger[_0x8073('0xf')](_0x8073('0x24'),_0x2def57,JSON['stringify'](_0x286c7c));_0x5e4ddc(_0x286c7c);})[_0x8073('0x22')](function(_0x38b456){logger[_0x8073('0x13')](_0x8073('0x24'),_0x38b456[_0x8073('0x16')],_0x2def57);_0x47df3b(_0x337135[_0x8073('0x13')](0x1f4,_0x38b456['message']));});});};exports['UpdateMemberReport']=function(_0x45c35a){var _0x5f279a=this;return new Promise(function(_0x6dddc1,_0x5f1199){return db['MemberReport'][_0x8073('0x25')](_0x45c35a[_0x8073('0x26')],{'raw':_0x45c35a[_0x8073('0x1b')]?_0x45c35a[_0x8073('0x1b')][_0x8073('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45c35a[_0x8073('0x1b')]?_0x45c35a[_0x8073('0x1b')][_0x8073('0x1c')]||null:null,'attributes':_0x45c35a[_0x8073('0x1b')]?_0x45c35a[_0x8073('0x1b')]['attributes']||null:null,'limit':_0x45c35a[_0x8073('0x1b')]?_0x45c35a['options'][_0x8073('0x1e')]||null:null})[_0x8073('0xd')](function(_0x1e5249){logger['info']('UpdateMemberReport',_0x45c35a);logger[_0x8073('0xf')](_0x8073('0x27'),_0x45c35a,JSON['stringify'](_0x1e5249));_0x6dddc1(_0x1e5249);})['catch'](function(_0x9f17bd){logger[_0x8073('0x13')](_0x8073('0x27'),_0x9f17bd[_0x8073('0x16')],_0x45c35a);_0x5f1199(_0x5f279a[_0x8073('0x13')](0x1f4,_0x9f17bd[_0x8073('0x16')]));});});}; \ No newline at end of file +var _0x86b8=['info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','options','raw','where','attributes','limit','include','map','model','CreateMemberReport','UpdateMemberReport','MemberReport','update','body','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then'];(function(_0x5d7296,_0x3103bd){var _0xadb32a=function(_0x4ad775){while(--_0x4ad775){_0x5d7296['push'](_0x5d7296['shift']());}};_0xadb32a(++_0x3103bd);}(_0x86b8,0x15d));var _0x886b=function(_0x582b4d,_0x5cb8d3){_0x582b4d=_0x582b4d-0x0;var _0x32d285=_0x86b8[_0x582b4d];return _0x32d285;};'use strict';var _=require(_0x886b('0x0'));var util=require(_0x886b('0x1'));var moment=require(_0x886b('0x2'));var BPromise=require('bluebird');var rs=require(_0x886b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x886b('0x4'))['db'];var utils=require(_0x886b('0x5'));var logger=require(_0x886b('0x6'))('rpc');var config=require(_0x886b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x886b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd9d9ac,_0xe888a0,_0x2f8957){return new BPromise(function(_0xbc2d70,_0x238701){return client[_0x886b('0x9')](_0xd9d9ac,_0x2f8957)[_0x886b('0xa')](function(_0x52344d){logger[_0x886b('0xb')](_0x886b('0xc'),_0xe888a0,_0x886b('0xd'));logger[_0x886b('0xe')](_0x886b('0xf'),_0xe888a0,_0x886b('0xd'),JSON[_0x886b('0x10')](_0x52344d));if(_0x52344d[_0x886b('0x11')]){if(_0x52344d['error'][_0x886b('0x12')]===0x1f4){logger[_0x886b('0x11')]('MemberReport,\x20%s,\x20%s',_0xe888a0,_0x52344d[_0x886b('0x11')][_0x886b('0x13')]);return _0x238701(_0x52344d[_0x886b('0x11')][_0x886b('0x13')]);}logger['error']('MemberReport,\x20%s,\x20%s',_0xe888a0,_0x52344d[_0x886b('0x11')][_0x886b('0x13')]);return _0xbc2d70(_0x52344d[_0x886b('0x11')][_0x886b('0x13')]);}else{logger[_0x886b('0xb')](_0x886b('0xc'),_0xe888a0,_0x886b('0xd'));_0xbc2d70(_0x52344d[_0x886b('0x14')]['message']);}})[_0x886b('0x15')](function(_0x44d81a){logger['error'](_0x886b('0xc'),_0xe888a0,_0x44d81a);_0x238701(_0x44d81a);});});}exports[_0x886b('0x16')]=function(_0x3df547){var _0x2232a7=this;return new Promise(function(_0x282a98,_0xe05a77){return db['MemberReport']['findAll']({'raw':_0x3df547[_0x886b('0x17')]?_0x3df547[_0x886b('0x17')][_0x886b('0x18')]===undefined?!![]:![]:!![],'where':_0x3df547['options']?_0x3df547['options'][_0x886b('0x19')]||null:null,'attributes':_0x3df547[_0x886b('0x17')]?_0x3df547[_0x886b('0x17')][_0x886b('0x1a')]||null:null,'limit':_0x3df547[_0x886b('0x17')]?_0x3df547[_0x886b('0x17')][_0x886b('0x1b')]||null:null,'include':_0x3df547['options']?_0x3df547[_0x886b('0x17')][_0x886b('0x1c')]?_[_0x886b('0x1d')](_0x3df547['options'][_0x886b('0x1c')],function(_0x2a5519){return{'model':db[_0x2a5519[_0x886b('0x1e')]],'as':_0x2a5519['as'],'attributes':_0x2a5519[_0x886b('0x1a')],'include':_0x2a5519['include']?_[_0x886b('0x1d')](_0x2a5519[_0x886b('0x1c')],function(_0x18d89e){return{'model':db[_0x18d89e[_0x886b('0x1e')]],'as':_0x18d89e['as'],'attributes':_0x18d89e[_0x886b('0x1a')],'include':_0x18d89e['include']?_[_0x886b('0x1d')](_0x18d89e[_0x886b('0x1c')],function(_0x2e2c80){return{'model':db[_0x2e2c80[_0x886b('0x1e')]],'as':_0x2e2c80['as'],'attributes':_0x2e2c80['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b85a4){logger[_0x886b('0xb')]('GetMemberReport',_0x3df547);logger[_0x886b('0xe')](_0x886b('0x16'),_0x3df547,JSON[_0x886b('0x10')](_0x3b85a4));_0x282a98(_0x3b85a4);})[_0x886b('0x15')](function(_0x1374a1){logger[_0x886b('0x11')]('GetMemberReport',_0x1374a1['message'],_0x3df547);_0xe05a77(_0x2232a7[_0x886b('0x11')](0x1f4,_0x1374a1[_0x886b('0x13')]));});});};exports[_0x886b('0x1f')]=function(_0x634c6){var _0x2a6ecf=this;return new Promise(function(_0x6ffb50,_0x57772b){return db['MemberReport']['create'](_0x634c6['body'],{'raw':_0x634c6[_0x886b('0x17')]?_0x634c6['options'][_0x886b('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x5b9891){logger[_0x886b('0xb')](_0x886b('0x1f'),_0x634c6);logger['debug']('CreateMemberReport',_0x634c6,JSON[_0x886b('0x10')](_0x5b9891));_0x6ffb50(_0x5b9891);})['catch'](function(_0x4c29db){logger[_0x886b('0x11')]('CreateMemberReport',_0x4c29db[_0x886b('0x13')],_0x634c6);_0x57772b(_0x2a6ecf[_0x886b('0x11')](0x1f4,_0x4c29db[_0x886b('0x13')]));});});};exports[_0x886b('0x20')]=function(_0x507fbf){var _0x258c16=this;return new Promise(function(_0x160264,_0x4e257a){return db[_0x886b('0x21')][_0x886b('0x22')](_0x507fbf[_0x886b('0x23')],{'raw':_0x507fbf[_0x886b('0x17')]?_0x507fbf[_0x886b('0x17')][_0x886b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x507fbf['options']?_0x507fbf[_0x886b('0x17')][_0x886b('0x19')]||null:null,'attributes':_0x507fbf[_0x886b('0x17')]?_0x507fbf[_0x886b('0x17')][_0x886b('0x1a')]||null:null,'limit':_0x507fbf[_0x886b('0x17')]?_0x507fbf[_0x886b('0x17')][_0x886b('0x1b')]||null:null})[_0x886b('0xa')](function(_0x4f63cd){logger['info'](_0x886b('0x20'),_0x507fbf);logger[_0x886b('0xe')]('UpdateMemberReport',_0x507fbf,JSON[_0x886b('0x10')](_0x4f63cd));_0x160264(_0x4f63cd);})[_0x886b('0x15')](function(_0x297772){logger[_0x886b('0x11')]('UpdateMemberReport',_0x297772[_0x886b('0x13')],_0x507fbf);_0x4e257a(_0x258c16['error'](0x1f4,_0x297772[_0x886b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 417ef88..a70d29e 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 _0x1bc3=['index','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get'];(function(_0x834837,_0x24c743){var _0x2da716=function(_0x11b98a){while(--_0x11b98a){_0x834837['push'](_0x834837['shift']());}};_0x2da716(++_0x24c743);}(_0x1bc3,0x8d));var _0x31bc=function(_0x5ee736,_0x27c358){_0x5ee736=_0x5ee736-0x0;var _0x2c6851=_0x1bc3[_0x5ee736];return _0x2c6851;};'use strict';var multer=require(_0x31bc('0x0'));var util=require(_0x31bc('0x1'));var path=require('path');var timeout=require(_0x31bc('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x31bc('0x3'));var auth=require(_0x31bc('0x4'));var interaction=require(_0x31bc('0x5'));var config=require(_0x31bc('0x6'));var controller=require(_0x31bc('0x7'));router[_0x31bc('0x8')]('/',controller[_0x31bc('0x9')]);module['exports']=router; \ No newline at end of file +var _0x22c4=['express','Router','fs-extra','../../components/auth/service','./migration.controller','get','index','exports','multer','path','connect-timeout'];(function(_0x551620,_0x3fc442){var _0x54a07c=function(_0x260fed){while(--_0x260fed){_0x551620['push'](_0x551620['shift']());}};_0x54a07c(++_0x3fc442);}(_0x22c4,0x81));var _0x422c=function(_0x1d5714,_0x2fa5f4){_0x1d5714=_0x1d5714-0x0;var _0x1b620e=_0x22c4[_0x1d5714];return _0x1b620e;};'use strict';var multer=require(_0x422c('0x0'));var util=require('util');var path=require(_0x422c('0x1'));var timeout=require(_0x422c('0x2'));var express=require(_0x422c('0x3'));var router=express[_0x422c('0x4')]();var fs_extra=require(_0x422c('0x5'));var auth=require(_0x422c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x422c('0x7'));router[_0x422c('0x8')]('/',controller[_0x422c('0x9')]);module[_0x422c('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 4e6dab6..49d2286 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 _0x5c54=['version','sequelize'];(function(_0x1bd309,_0x1d28e0){var _0x31e3f7=function(_0x4b74c7){while(--_0x4b74c7){_0x1bd309['push'](_0x1bd309['shift']());}};_0x31e3f7(++_0x1d28e0);}(_0x5c54,0xf9));var _0x45c5=function(_0x1c35b4,_0x3d2d9e){_0x1c35b4=_0x1c35b4-0x0;var _0x58f7a8=_0x5c54[_0x1c35b4];return _0x58f7a8;};'use strict';var Sequelize=require(_0x45c5('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0x45c5('0x1')}}; \ No newline at end of file +var _0x1bea=['exports','STRING','version','sequelize'];(function(_0x4c618d,_0x2cb8ed){var _0x9f4245=function(_0x44eb5e){while(--_0x44eb5e){_0x4c618d['push'](_0x4c618d['shift']());}};_0x9f4245(++_0x2cb8ed);}(_0x1bea,0xe7));var _0xa1be=function(_0x4291a2,_0x2ee2e5){_0x4291a2=_0x4291a2-0x0;var _0x235817=_0x1bea[_0x4291a2];return _0x235817;};'use strict';var Sequelize=require(_0xa1be('0x0'));module[_0xa1be('0x1')]={'version':{'type':Sequelize[_0xa1be('0x2')],'unique':_0xa1be('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index fec4841..2402582 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 _0x978b=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x30b2c6,_0x1eafe8){var _0x42052d=function(_0xfeb539){while(--_0xfeb539){_0x30b2c6['push'](_0x30b2c6['shift']());}};_0x42052d(++_0x1eafe8);}(_0x978b,0x1c0));var _0xb978=function(_0x10ca22,_0x401866){_0x10ca22=_0x10ca22-0x0;var _0x18a25d=_0x978b[_0x10ca22];return _0x18a25d;};'use strict';var emlformat=require(_0xb978('0x0'));var rimraf=require(_0xb978('0x1'));var zipdir=require(_0xb978('0x2'));var jsonpatch=require(_0xb978('0x3'));var rp=require('request-promise');var moment=require(_0xb978('0x4'));var BPromise=require(_0xb978('0x5'));var Mustache=require(_0xb978('0x6'));var util=require(_0xb978('0x7'));var path=require('path');var sox=require(_0xb978('0x8'));var csv=require(_0xb978('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb978('0xa'));var squel=require(_0xb978('0xb'));var crypto=require(_0xb978('0xc'));var jsforce=require(_0xb978('0xd'));var deskjs=require(_0xb978('0xe'));var toCsv=require(_0xb978('0x9'));var querystring=require(_0xb978('0xf'));var Papa=require(_0xb978('0x10'));var Redis=require(_0xb978('0x11'));var authService=require(_0xb978('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb978('0x13'));var logger=require(_0xb978('0x14'))(_0xb978('0x15'));var utils=require(_0xb978('0x16'));var config=require(_0xb978('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb978('0x18'))['db'];function respondWithStatusCode(_0x546557,_0x3efa22){_0x3efa22=_0x3efa22||0xcc;return function(_0x23eb93){if(_0x23eb93){return _0x546557[_0xb978('0x19')](_0x3efa22);}return _0x546557[_0xb978('0x1a')](_0x3efa22)[_0xb978('0x1b')]();};}function respondWithResult(_0x18b472,_0x1d4a21){_0x1d4a21=_0x1d4a21||0xc8;return function(_0x122aee){if(_0x122aee){return _0x18b472[_0xb978('0x1a')](_0x1d4a21)[_0xb978('0x1c')](_0x122aee);}};}function respondWithFilteredResult(_0x1d0bed,_0x125928){return function(_0x4a99aa){if(_0x4a99aa){var _0x21b5d2=typeof _0x125928[_0xb978('0x1d')]===_0xb978('0x1e')&&typeof _0x125928[_0xb978('0x1f')]===_0xb978('0x1e');var _0x38a0ee=_0x4a99aa[_0xb978('0x20')];var _0x17d032=_0x21b5d2?0x0:_0x125928[_0xb978('0x1d')];var _0x468b89=_0x21b5d2?_0x4a99aa[_0xb978('0x20')]:_0x125928['offset']+_0x125928['limit'];var _0x4cef79;if(_0x468b89>=_0x38a0ee){_0x468b89=_0x38a0ee;_0x4cef79=0xc8;}else{_0x4cef79=0xce;}_0x1d0bed[_0xb978('0x1a')](_0x4cef79);return _0x1d0bed[_0xb978('0x21')](_0xb978('0x22'),_0x17d032+'-'+_0x468b89+'/'+_0x38a0ee)[_0xb978('0x1c')](_0x4a99aa);}return null;};}function patchUpdates(_0x535954){return function(_0x5a9cdf){try{jsonpatch[_0xb978('0x23')](_0x5a9cdf,_0x535954,!![]);}catch(_0x4bff57){return BPromise[_0xb978('0x24')](_0x4bff57);}return _0x5a9cdf[_0xb978('0x25')]();};}function saveUpdates(_0x23e6d2,_0x39859a){return function(_0x339890){if(_0x339890){return _0x339890['update'](_0x23e6d2)[_0xb978('0x26')](function(_0x73214e){return _0x73214e;});}return null;};}function removeEntity(_0x3dfe70,_0x358041){return function(_0x141f2e){if(_0x141f2e){return _0x141f2e['destroy']()[_0xb978('0x26')](function(){_0x3dfe70[_0xb978('0x1a')](0xcc)[_0xb978('0x1b')]();});}};}function handleEntityNotFound(_0x48b6e7,_0x518aca){return function(_0x4448a9){if(!_0x4448a9){_0x48b6e7[_0xb978('0x19')](0x194);}return _0x4448a9;};}function handleError(_0x2bf491,_0x1e7c4b){_0x1e7c4b=_0x1e7c4b||0x1f4;return function(_0x48cced){logger['error'](_0x48cced[_0xb978('0x27')]);if(_0x48cced[_0xb978('0x28')]){delete _0x48cced['name'];}_0x2bf491['status'](_0x1e7c4b)[_0xb978('0x29')](_0x48cced);};}exports[_0xb978('0x2a')]=function(_0x5479e9,_0x418a60){var _0x442c06={},_0x24fe8e={},_0x5871dc={'count':0x0,'rows':[]};var _0x292103=_[_0xb978('0x2b')](db[_0xb978('0x2c')][_0xb978('0x2d')],function(_0x13c48d){return{'name':_0x13c48d[_0xb978('0x2e')],'type':_0x13c48d[_0xb978('0x2f')][_0xb978('0x30')]};});_0x24fe8e['model']=_[_0xb978('0x2b')](_0x292103,_0xb978('0x28'));_0x24fe8e[_0xb978('0x31')]=_['keys'](_0x5479e9[_0xb978('0x31')]);_0x24fe8e[_0xb978('0x32')]=_[_0xb978('0x33')](_0x24fe8e[_0xb978('0x34')],_0x24fe8e[_0xb978('0x31')]);_0x442c06[_0xb978('0x35')]=_[_0xb978('0x33')](_0x24fe8e['model'],qs[_0xb978('0x36')](_0x5479e9[_0xb978('0x31')][_0xb978('0x36')]));_0x442c06[_0xb978('0x35')]=_0x442c06['attributes'][_0xb978('0x37')]?_0x442c06['attributes']:_0x24fe8e[_0xb978('0x34')];if(!_0x5479e9[_0xb978('0x31')][_0xb978('0x38')](_0xb978('0x39'))){_0x442c06[_0xb978('0x1f')]=qs[_0xb978('0x1f')](_0x5479e9[_0xb978('0x31')][_0xb978('0x1f')]);_0x442c06[_0xb978('0x1d')]=qs[_0xb978('0x1d')](_0x5479e9['query']['offset']);}_0x442c06[_0xb978('0x3a')]=qs[_0xb978('0x3b')](_0x5479e9[_0xb978('0x31')]['sort']);_0x442c06[_0xb978('0x3c')]=qs[_0xb978('0x32')](_[_0xb978('0x3d')](_0x5479e9[_0xb978('0x31')],_0x24fe8e[_0xb978('0x32')]),_0x292103);if(_0x5479e9[_0xb978('0x31')]['filter']){_0x442c06[_0xb978('0x3c')]=_['merge'](_0x442c06['where'],{'$or':_[_0xb978('0x2b')](_0x292103,function(_0x106ceb){if(_0x106ceb[_0xb978('0x2f')]!=='VIRTUAL'){var _0x702d62={};_0x702d62[_0x106ceb[_0xb978('0x28')]]={'$like':'%'+_0x5479e9[_0xb978('0x31')][_0xb978('0x3e')]+'%'};return _0x702d62;}})});}_0x442c06=_[_0xb978('0x3f')]({},_0x442c06,_0x5479e9[_0xb978('0x40')]);var _0x1fa3b3={'where':_0x442c06['where']};return db['Migration'][_0xb978('0x20')](_0x1fa3b3)[_0xb978('0x26')](function(_0x4c332d){_0x5871dc[_0xb978('0x20')]=_0x4c332d;if(_0x5479e9[_0xb978('0x31')]['includeAll']){_0x442c06[_0xb978('0x41')]=[{'all':!![]}];}return db[_0xb978('0x2c')]['findAll'](_0x442c06);})[_0xb978('0x26')](function(_0x205d7e){_0x5871dc[_0xb978('0x42')]=_0x205d7e;return _0x5871dc;})[_0xb978('0x26')](respondWithFilteredResult(_0x418a60,_0x442c06))[_0xb978('0x43')](handleError(_0x418a60,null));}; \ No newline at end of file +var _0xbdf3=['rows','catch','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll'];(function(_0x24a09c,_0x5e54d4){var _0x32d7c2=function(_0x353deb){while(--_0x353deb){_0x24a09c['push'](_0x24a09c['shift']());}};_0x32d7c2(++_0x5e54d4);}(_0xbdf3,0x10a));var _0x3bdf=function(_0x1667df,_0x266940){_0x1667df=_0x1667df-0x0;var _0x341abf=_0xbdf3[_0x1667df];return _0x341abf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bdf('0x0'));var zipdir=require(_0x3bdf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3bdf('0x2'));var moment=require('moment');var BPromise=require(_0x3bdf('0x3'));var Mustache=require(_0x3bdf('0x4'));var util=require('util');var path=require('path');var sox=require(_0x3bdf('0x5'));var csv=require(_0x3bdf('0x6'));var ejs=require(_0x3bdf('0x7'));var fs=require('fs');var fs_extra=require(_0x3bdf('0x8'));var _=require(_0x3bdf('0x9'));var squel=require('squel');var crypto=require(_0x3bdf('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3bdf('0xb'));var toCsv=require(_0x3bdf('0x6'));var querystring=require(_0x3bdf('0xc'));var Papa=require(_0x3bdf('0xd'));var Redis=require(_0x3bdf('0xe'));var authService=require(_0x3bdf('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3bdf('0x10'));var logger=require(_0x3bdf('0x11'))(_0x3bdf('0x12'));var utils=require(_0x3bdf('0x13'));var config=require(_0x3bdf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419fd7,_0x51a88f){_0x51a88f=_0x51a88f||0xcc;return function(_0x4237d1){if(_0x4237d1){return _0x419fd7['sendStatus'](_0x51a88f);}return _0x419fd7['status'](_0x51a88f)[_0x3bdf('0x15')]();};}function respondWithResult(_0x66026b,_0x38a735){_0x38a735=_0x38a735||0xc8;return function(_0x4b3cda){if(_0x4b3cda){return _0x66026b[_0x3bdf('0x16')](_0x38a735)[_0x3bdf('0x17')](_0x4b3cda);}};}function respondWithFilteredResult(_0x2e15a1,_0x373708){return function(_0x2847fd){if(_0x2847fd){var _0x3ca17a=typeof _0x373708[_0x3bdf('0x18')]===_0x3bdf('0x19')&&typeof _0x373708[_0x3bdf('0x1a')]===_0x3bdf('0x19');var _0x38fa8a=_0x2847fd[_0x3bdf('0x1b')];var _0x51b247=_0x3ca17a?0x0:_0x373708[_0x3bdf('0x18')];var _0x16f3aa=_0x3ca17a?_0x2847fd[_0x3bdf('0x1b')]:_0x373708[_0x3bdf('0x18')]+_0x373708['limit'];var _0x3fd8ef;if(_0x16f3aa>=_0x38fa8a){_0x16f3aa=_0x38fa8a;_0x3fd8ef=0xc8;}else{_0x3fd8ef=0xce;}_0x2e15a1[_0x3bdf('0x16')](_0x3fd8ef);return _0x2e15a1[_0x3bdf('0x1c')](_0x3bdf('0x1d'),_0x51b247+'-'+_0x16f3aa+'/'+_0x38fa8a)['json'](_0x2847fd);}return null;};}function patchUpdates(_0x1fe112){return function(_0x1762c4){try{jsonpatch[_0x3bdf('0x1e')](_0x1762c4,_0x1fe112,!![]);}catch(_0x4cefd9){return BPromise[_0x3bdf('0x1f')](_0x4cefd9);}return _0x1762c4[_0x3bdf('0x20')]();};}function saveUpdates(_0x5248ba,_0xd18285){return function(_0x23ab3c){if(_0x23ab3c){return _0x23ab3c[_0x3bdf('0x21')](_0x5248ba)[_0x3bdf('0x22')](function(_0x2900c1){return _0x2900c1;});}return null;};}function removeEntity(_0x48951d,_0x173d2b){return function(_0x2bc07d){if(_0x2bc07d){return _0x2bc07d[_0x3bdf('0x23')]()[_0x3bdf('0x22')](function(){_0x48951d[_0x3bdf('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7495f4,_0x59869d){return function(_0x541f97){if(!_0x541f97){_0x7495f4[_0x3bdf('0x24')](0x194);}return _0x541f97;};}function handleError(_0x14d6c5,_0x3892f8){_0x3892f8=_0x3892f8||0x1f4;return function(_0x453427){logger['error'](_0x453427[_0x3bdf('0x25')]);if(_0x453427[_0x3bdf('0x26')]){delete _0x453427[_0x3bdf('0x26')];}_0x14d6c5['status'](_0x3892f8)[_0x3bdf('0x27')](_0x453427);};}exports[_0x3bdf('0x28')]=function(_0x1298b9,_0x175bd7){var _0x49966f={},_0x40c95b={},_0x511e7b={'count':0x0,'rows':[]};var _0x527bf2=_[_0x3bdf('0x29')](db[_0x3bdf('0x2a')][_0x3bdf('0x2b')],function(_0x56387c){return{'name':_0x56387c[_0x3bdf('0x2c')],'type':_0x56387c[_0x3bdf('0x2d')]['key']};});_0x40c95b[_0x3bdf('0x2e')]=_['map'](_0x527bf2,_0x3bdf('0x26'));_0x40c95b[_0x3bdf('0x2f')]=_['keys'](_0x1298b9[_0x3bdf('0x2f')]);_0x40c95b[_0x3bdf('0x30')]=_['intersection'](_0x40c95b['model'],_0x40c95b[_0x3bdf('0x2f')]);_0x49966f['attributes']=_[_0x3bdf('0x31')](_0x40c95b[_0x3bdf('0x2e')],qs[_0x3bdf('0x32')](_0x1298b9['query'][_0x3bdf('0x32')]));_0x49966f[_0x3bdf('0x33')]=_0x49966f[_0x3bdf('0x33')]['length']?_0x49966f[_0x3bdf('0x33')]:_0x40c95b['model'];if(!_0x1298b9['query'][_0x3bdf('0x34')]('nolimit')){_0x49966f[_0x3bdf('0x1a')]=qs[_0x3bdf('0x1a')](_0x1298b9[_0x3bdf('0x2f')]['limit']);_0x49966f['offset']=qs[_0x3bdf('0x18')](_0x1298b9[_0x3bdf('0x2f')]['offset']);}_0x49966f[_0x3bdf('0x35')]=qs[_0x3bdf('0x36')](_0x1298b9[_0x3bdf('0x2f')][_0x3bdf('0x36')]);_0x49966f[_0x3bdf('0x37')]=qs[_0x3bdf('0x30')](_[_0x3bdf('0x38')](_0x1298b9['query'],_0x40c95b[_0x3bdf('0x30')]),_0x527bf2);if(_0x1298b9['query'][_0x3bdf('0x39')]){_0x49966f['where']=_['merge'](_0x49966f['where'],{'$or':_['map'](_0x527bf2,function(_0x4633c9){if(_0x4633c9[_0x3bdf('0x2d')]!==_0x3bdf('0x3a')){var _0x30e4ae={};_0x30e4ae[_0x4633c9['name']]={'$like':'%'+_0x1298b9['query']['filter']+'%'};return _0x30e4ae;}})});}_0x49966f=_[_0x3bdf('0x3b')]({},_0x49966f,_0x1298b9[_0x3bdf('0x3c')]);var _0x3bde1a={'where':_0x49966f[_0x3bdf('0x37')]};return db[_0x3bdf('0x2a')][_0x3bdf('0x1b')](_0x3bde1a)[_0x3bdf('0x22')](function(_0x44e2a6){_0x511e7b[_0x3bdf('0x1b')]=_0x44e2a6;if(_0x1298b9[_0x3bdf('0x2f')][_0x3bdf('0x3d')]){_0x49966f[_0x3bdf('0x3e')]=[{'all':!![]}];}return db[_0x3bdf('0x2a')][_0x3bdf('0x3f')](_0x49966f);})[_0x3bdf('0x22')](function(_0x1fedfc){_0x511e7b[_0x3bdf('0x40')]=_0x1fedfc;return _0x511e7b;})['then'](respondWithFilteredResult(_0x175bd7,_0x49966f))[_0x3bdf('0x41')](handleError(_0x175bd7,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 36be5b7..7dd0081 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 _0x6c7f=['define','Migration','migrations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0x6c7f,0x1a3));var _0xf6c7=function(_0x526a15,_0x5d2bdf){_0x526a15=_0x526a15-0x0;var _0x408cdf=_0x6c7f[_0x526a15];return _0x408cdf;};'use strict';var _=require(_0xf6c7('0x0'));var util=require(_0xf6c7('0x1'));var logger=require(_0xf6c7('0x2'))('api');var moment=require(_0xf6c7('0x3'));var BPromise=require(_0xf6c7('0x4'));var rp=require(_0xf6c7('0x5'));var fs=require('fs');var path=require(_0xf6c7('0x6'));var rimraf=require(_0xf6c7('0x7'));var config=require(_0xf6c7('0x8'));var attributes=require('./migration.attributes');module[_0xf6c7('0x9')]=function(_0x34d9d4,_0x179f0b){return _0x34d9d4[_0xf6c7('0xa')](_0xf6c7('0xb'),attributes,{'tableName':_0xf6c7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x151d=['exports','define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x4105a8,_0x198324){var _0x553f0c=function(_0x3720f5){while(--_0x3720f5){_0x4105a8['push'](_0x4105a8['shift']());}};_0x553f0c(++_0x198324);}(_0x151d,0x7c));var _0xd151=function(_0x523979,_0x2aacd9){_0x523979=_0x523979-0x0;var _0x3f7423=_0x151d[_0x523979];return _0x3f7423;};'use strict';var _=require(_0xd151('0x0'));var util=require(_0xd151('0x1'));var logger=require(_0xd151('0x2'))(_0xd151('0x3'));var moment=require(_0xd151('0x4'));var BPromise=require(_0xd151('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd151('0x6'));var config=require(_0xd151('0x7'));var attributes=require('./migration.attributes');module[_0xd151('0x8')]=function(_0x73b8fd,_0x4f154c){return _0x73b8fd[_0xd151('0x9')](_0xd151('0xa'),attributes,{'tableName':_0xd151('0xb'),'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 0dcdc6f..8bf2548 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 _0xc0d6=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x4d49ed,_0x46266c){var _0x4ccab7=function(_0x5048b7){while(--_0x5048b7){_0x4d49ed['push'](_0x4d49ed['shift']());}};_0x4ccab7(++_0x46266c);}(_0xc0d6,0x1ce));var _0x6c0d=function(_0x3485a5,_0xc95d52){_0x3485a5=_0x3485a5-0x0;var _0x452993=_0xc0d6[_0x3485a5];return _0x452993;};'use strict';var _=require('lodash');var util=require(_0x6c0d('0x0'));var moment=require('moment');var BPromise=require(_0x6c0d('0x1'));var rs=require(_0x6c0d('0x2'));var fs=require('fs');var Redis=require(_0x6c0d('0x3'));var db=require(_0x6c0d('0x4'))['db'];var utils=require(_0x6c0d('0x5'));var logger=require(_0x6c0d('0x6'))(_0x6c0d('0x7'));var config=require(_0x6c0d('0x8'));var jayson=require(_0x6c0d('0x9'));var client=jayson[_0x6c0d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d7a9c,_0x53088f,_0x987707){return new BPromise(function(_0x266f0c,_0x2fdd21){return client[_0x6c0d('0xb')](_0x4d7a9c,_0x987707)[_0x6c0d('0xc')](function(_0x4fc042){logger[_0x6c0d('0xd')](_0x6c0d('0xe'),_0x53088f,'request\x20sent');logger[_0x6c0d('0xf')](_0x6c0d('0x10'),_0x53088f,'request\x20sent',JSON['stringify'](_0x4fc042));if(_0x4fc042['error']){if(_0x4fc042[_0x6c0d('0x11')][_0x6c0d('0x12')]===0x1f4){logger[_0x6c0d('0x11')](_0x6c0d('0xe'),_0x53088f,_0x4fc042['error']['message']);return _0x2fdd21(_0x4fc042[_0x6c0d('0x11')]['message']);}logger[_0x6c0d('0x11')](_0x6c0d('0xe'),_0x53088f,_0x4fc042[_0x6c0d('0x11')]['message']);return _0x266f0c(_0x4fc042[_0x6c0d('0x11')][_0x6c0d('0x13')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0x53088f,'request\x20sent');_0x266f0c(_0x4fc042[_0x6c0d('0x14')][_0x6c0d('0x13')]);}})[_0x6c0d('0x15')](function(_0x4068a2){logger['error']('Migration,\x20%s,\x20%s',_0x53088f,_0x4068a2);_0x2fdd21(_0x4068a2);});});} \ No newline at end of file +var _0xf958=['then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0xa67d03,_0x19f00f){var _0x672e67=function(_0x480219){while(--_0x480219){_0xa67d03['push'](_0xa67d03['shift']());}};_0x672e67(++_0x19f00f);}(_0xf958,0xe6));var _0x8f95=function(_0x4140f3,_0x1c48b0){_0x4140f3=_0x4140f3-0x0;var _0x1b6378=_0xf958[_0x4140f3];return _0x1b6378;};'use strict';var _=require(_0x8f95('0x0'));var util=require('util');var moment=require(_0x8f95('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f95('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f95('0x3'))['db'];var utils=require(_0x8f95('0x4'));var logger=require(_0x8f95('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8f95('0x6'));var client=jayson[_0x8f95('0x7')][_0x8f95('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c2af8,_0x5cfc04,_0x1ae9c4){return new BPromise(function(_0x109bed,_0x435b5b){return client[_0x8f95('0x9')](_0x5c2af8,_0x1ae9c4)[_0x8f95('0xa')](function(_0x585025){logger[_0x8f95('0xb')](_0x8f95('0xc'),_0x5cfc04,'request\x20sent');logger[_0x8f95('0xd')](_0x8f95('0xe'),_0x5cfc04,_0x8f95('0xf'),JSON['stringify'](_0x585025));if(_0x585025[_0x8f95('0x10')]){if(_0x585025[_0x8f95('0x10')][_0x8f95('0x11')]===0x1f4){logger['error'](_0x8f95('0xc'),_0x5cfc04,_0x585025[_0x8f95('0x10')][_0x8f95('0x12')]);return _0x435b5b(_0x585025['error'][_0x8f95('0x12')]);}logger[_0x8f95('0x10')](_0x8f95('0xc'),_0x5cfc04,_0x585025[_0x8f95('0x10')][_0x8f95('0x12')]);return _0x109bed(_0x585025[_0x8f95('0x10')][_0x8f95('0x12')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0x5cfc04,'request\x20sent');_0x109bed(_0x585025['result']['message']);}})[_0x8f95('0x13')](function(_0x2f01cd){logger[_0x8f95('0x10')](_0x8f95('0xc'),_0x5cfc04,_0x2f01cd);_0x435b5b(_0x2f01cd);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 35aa46a..8c82dbb 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 _0x29b1=['show','post','put','update','destroy','util','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','/:id'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0x29b1,0xbb));var _0x129b=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x29b1[_0x5834bc];return _0x3e183a;};'use strict';var multer=require('multer');var util=require(_0x129b('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x129b('0x1')]();var fs_extra=require(_0x129b('0x2'));var auth=require(_0x129b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x129b('0x4'));var controller=require(_0x129b('0x5'));router[_0x129b('0x6')]('/',auth[_0x129b('0x7')](),controller['index']);router[_0x129b('0x6')](_0x129b('0x8'),auth[_0x129b('0x7')](),controller[_0x129b('0x9')]);router[_0x129b('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x129b('0xb')](_0x129b('0x8'),auth['isAuthenticated'](),controller[_0x129b('0xc')]);router['delete'](_0x129b('0x8'),auth['isAuthenticated'](),controller[_0x129b('0xd')]);module['exports']=router; \ No newline at end of file +var _0x023e=['post','create','put','update','destroy','multer','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1e1ecf,_0x175529){var _0x52be90=function(_0x2da012){while(--_0x2da012){_0x1e1ecf['push'](_0x1e1ecf['shift']());}};_0x52be90(++_0x175529);}(_0x023e,0xc5));var _0xe023=function(_0x36daae,_0x471d49){_0x36daae=_0x36daae-0x0;var _0x21dd26=_0x023e[_0x36daae];return _0x21dd26;};'use strict';var multer=require(_0xe023('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe023('0x1')]();var fs_extra=require(_0xe023('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xe023('0x3'));var config=require(_0xe023('0x4'));var controller=require(_0xe023('0x5'));router[_0xe023('0x6')]('/',auth[_0xe023('0x7')](),controller[_0xe023('0x8')]);router[_0xe023('0x6')](_0xe023('0x9'),auth[_0xe023('0x7')](),controller[_0xe023('0xa')]);router[_0xe023('0xb')]('/',auth[_0xe023('0x7')](),controller[_0xe023('0xc')]);router[_0xe023('0xd')](_0xe023('0x9'),auth[_0xe023('0x7')](),controller[_0xe023('0xe')]);router['delete'](_0xe023('0x9'),auth[_0xe023('0x7')](),controller[_0xe023('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 55928c0..16c00bf 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 _0x4a8a=['localnet','externip','stun','turn','STRING','sequelize','ENUM'];(function(_0x542f1c,_0x45fb7a){var _0x572d34=function(_0x4f3e89){while(--_0x4f3e89){_0x542f1c['push'](_0x542f1c['shift']());}};_0x572d34(++_0x45fb7a);}(_0x4a8a,0x18d));var _0xa4a8=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0x4a8a[_0x4da356];return _0x321b07;};'use strict';var Sequelize=require(_0xa4a8('0x0'));module['exports']={'type':{'type':Sequelize[_0xa4a8('0x1')](_0xa4a8('0x2'),_0xa4a8('0x3'),_0xa4a8('0x4'),_0xa4a8('0x5'))},'value':{'type':Sequelize[_0xa4a8('0x6')]},'username':{'type':Sequelize[_0xa4a8('0x6')]},'password':{'type':Sequelize[_0xa4a8('0x6')]}}; \ No newline at end of file +var _0x6ba3=['externip','stun','turn','STRING','sequelize','exports','ENUM','localnet'];(function(_0x45d5ef,_0x10c29b){var _0x474d19=function(_0xc182bf){while(--_0xc182bf){_0x45d5ef['push'](_0x45d5ef['shift']());}};_0x474d19(++_0x10c29b);}(_0x6ba3,0x164));var _0x36ba=function(_0xfb299e,_0x2ca984){_0xfb299e=_0xfb299e-0x0;var _0x564de9=_0x6ba3[_0xfb299e];return _0x564de9;};'use strict';var Sequelize=require(_0x36ba('0x0'));module[_0x36ba('0x1')]={'type':{'type':Sequelize[_0x36ba('0x2')](_0x36ba('0x3'),_0x36ba('0x4'),_0x36ba('0x5'),_0x36ba('0x6'))},'value':{'type':Sequelize[_0x36ba('0x7')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x36ba('0x7')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 04a23c6..e943cde 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 _0xbfaa=['utf8','render','Reload','res_stun_monitor.so','toUpperCase','TURN','readFileSync','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','find','/etc/asterisk/stun_xcally.conf','destroy','params','util','lodash','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','sendStatus','name','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','includeAll','create','body','STUN','join','root','server/files/templates/stun_multiple.ejs'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xbfaa,0x167));var _0xabfa=function(_0x58c22b,_0x321b6b){_0x58c22b=_0x58c22b-0x0;var _0x4660b5=_0xbfaa[_0x58c22b];return _0x4660b5;};'use strict';var util=require(_0xabfa('0x0'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xabfa('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xabfa('0x2'))(_0xabfa('0x3'));var config=require(_0xabfa('0x4'));var db=require(_0xabfa('0x5'))['db'];var jayson=require(_0xabfa('0x6'));var client=jayson['client'][_0xabfa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x53f642,_0x4b5cf8,_0x3593dc,_0x4e88d2){return new Promise(function(_0x442bca,_0x575b41){var _0x45c985=_0x4e88d2||client;return _0x45c985[_0xabfa('0x8')](_0x53f642,_0x3593dc)[_0xabfa('0x9')](function(_0x2211f0){logger[_0xabfa('0xa')](_0xabfa('0xb'),_0x4b5cf8,_0xabfa('0xc'));logger[_0xabfa('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x4b5cf8,'request\x20sent',JSON[_0xabfa('0xe')](_0x2211f0));if(_0x2211f0['error']){if(_0x2211f0[_0xabfa('0xf')][_0xabfa('0x10')]===0x1f4){logger['error'](_0xabfa('0xb'),_0x4b5cf8,_0x2211f0['error'][_0xabfa('0x11')]);return _0x575b41(_0x2211f0[_0xabfa('0xf')]['message']);}logger['error'](_0xabfa('0xb'),_0x4b5cf8,_0x2211f0[_0xabfa('0xf')][_0xabfa('0x11')]);return _0x442bca(_0x2211f0[_0xabfa('0xf')][_0xabfa('0x11')]);}else{logger[_0xabfa('0xa')]('Network,\x20%s,\x20%s',_0x4b5cf8,_0xabfa('0xc'));_0x442bca(_0x2211f0[_0xabfa('0x12')][_0xabfa('0x11')]);}})[_0xabfa('0x13')](function(_0x18ddc9){logger[_0xabfa('0xf')](_0xabfa('0xb'),_0x4b5cf8,_0x18ddc9);_0x575b41(_0x18ddc9);});});}function respondWithResult(_0xa3a5d0,_0x8513ff){_0x8513ff=_0x8513ff||0xc8;return function(_0x497530){if(_0x497530){return _0xa3a5d0[_0xabfa('0x14')](_0x8513ff)[_0xabfa('0x15')](_0x497530);}};}function respondWithFilteredResult(_0x31823c,_0x57f30d){return function(_0x38b480){if(_0x38b480){var _0x47ccc9=typeof _0x57f30d[_0xabfa('0x16')]===_0xabfa('0x17')&&typeof _0x57f30d[_0xabfa('0x18')]===_0xabfa('0x17');var _0xcf7e98=_0x38b480[_0xabfa('0x19')];var _0x1e6928=_0x47ccc9?0x0:_0x57f30d[_0xabfa('0x16')];var _0x10df43=_0x47ccc9?_0x38b480[_0xabfa('0x19')]:_0x57f30d[_0xabfa('0x16')]+_0x57f30d[_0xabfa('0x18')];var _0x24a5a3;if(_0x10df43>=_0xcf7e98){_0x10df43=_0xcf7e98;_0x24a5a3=0xc8;}else{_0x24a5a3=0xce;}_0x31823c[_0xabfa('0x14')](_0x24a5a3);return _0x31823c[_0xabfa('0x1a')](_0xabfa('0x1b'),_0x1e6928+'-'+_0x10df43+'/'+_0xcf7e98)[_0xabfa('0x15')](_0x38b480);}return null;};}function saveUpdates(_0xc90679){return function(_0x4ed8f6){if(_0x4ed8f6){return _0x4ed8f6[_0xabfa('0x1c')](_0xc90679)[_0xabfa('0x9')](function(_0x4a45cc){return _0x4a45cc;});}return null;};}function removeEntity(_0x3f1900){return function(_0x28b4f3){if(_0x28b4f3){return _0x28b4f3['destroy']()['then'](function(){_0x3f1900[_0xabfa('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54efb3){return function(_0x12c654){if(!_0x12c654){_0x54efb3[_0xabfa('0x1d')](0x194);}return _0x12c654;};}function handleError(_0x4a9c56,_0x56ab96){_0x56ab96=_0x56ab96||0x1f4;return function(_0x58390c){logger[_0xabfa('0xf')](_0x58390c['stack']);if(_0x58390c[_0xabfa('0x1e')]){delete _0x58390c[_0xabfa('0x1e')];}_0x4a9c56['status'](_0x56ab96)['send'](_0x58390c);};}exports[_0xabfa('0x1f')]=function(_0x19243f,_0xfae1d1){var _0x266f38={},_0x210ba3={},_0x3aab6b={'count':0x0,'rows':[]};var _0x1e2e22=_[_0xabfa('0x20')](db[_0xabfa('0x21')][_0xabfa('0x22')],function(_0xdae795){return{'name':_0xdae795[_0xabfa('0x23')],'type':_0xdae795[_0xabfa('0x24')][_0xabfa('0x25')]};});_0x210ba3[_0xabfa('0x26')]=_[_0xabfa('0x20')](_0x1e2e22,_0xabfa('0x1e'));_0x210ba3[_0xabfa('0x27')]=_[_0xabfa('0x28')](_0x19243f[_0xabfa('0x27')]);_0x210ba3[_0xabfa('0x29')]=_[_0xabfa('0x2a')](_0x210ba3[_0xabfa('0x26')],_0x210ba3[_0xabfa('0x27')]);_0x266f38['attributes']=_['intersection'](_0x210ba3[_0xabfa('0x26')],qs[_0xabfa('0x2b')](_0x19243f[_0xabfa('0x27')][_0xabfa('0x2b')]));_0x266f38['attributes']=_0x266f38[_0xabfa('0x2c')][_0xabfa('0x2d')]?_0x266f38[_0xabfa('0x2c')]:_0x210ba3[_0xabfa('0x26')];if(!_0x19243f[_0xabfa('0x27')]['hasOwnProperty'](_0xabfa('0x2e'))){_0x266f38[_0xabfa('0x18')]=qs[_0xabfa('0x18')](_0x19243f['query'][_0xabfa('0x18')]);_0x266f38[_0xabfa('0x16')]=qs[_0xabfa('0x16')](_0x19243f[_0xabfa('0x27')][_0xabfa('0x16')]);}_0x266f38[_0xabfa('0x2f')]=qs[_0xabfa('0x30')](_0x19243f[_0xabfa('0x27')]['sort']);_0x266f38['where']=qs[_0xabfa('0x29')](_[_0xabfa('0x31')](_0x19243f[_0xabfa('0x27')],_0x210ba3[_0xabfa('0x29')]),_0x1e2e22);if(_0x19243f['query'][_0xabfa('0x32')]){_0x266f38[_0xabfa('0x33')]=_[_0xabfa('0x34')](_0x266f38['where'],{'$or':_[_0xabfa('0x20')](_0x1e2e22,function(_0x879cb6){if(_0x879cb6[_0xabfa('0x24')]!==_0xabfa('0x35')){var _0x1995ff={};_0x1995ff[_0x879cb6[_0xabfa('0x1e')]]={'$like':'%'+_0x19243f[_0xabfa('0x27')][_0xabfa('0x32')]+'%'};return _0x1995ff;}})});}_0x266f38=_['merge']({},_0x266f38,_0x19243f[_0xabfa('0x36')]);var _0x3939dd={'where':_0x266f38[_0xabfa('0x33')]};return db[_0xabfa('0x21')][_0xabfa('0x19')](_0x3939dd)[_0xabfa('0x9')](function(_0x1732ce){_0x3aab6b[_0xabfa('0x19')]=_0x1732ce;if(_0x19243f['query']['includeAll']){_0x266f38[_0xabfa('0x37')]=[{'all':!![]}];}return db['Network'][_0xabfa('0x38')](_0x266f38);})[_0xabfa('0x9')](function(_0x2fe614){_0x3aab6b[_0xabfa('0x39')]=_0x2fe614;return _0x3aab6b;})[_0xabfa('0x9')](respondWithFilteredResult(_0xfae1d1,_0x266f38))[_0xabfa('0x13')](handleError(_0xfae1d1,null));};exports[_0xabfa('0x3a')]=function(_0xc3c024,_0x4fc453){var _0x51bfa4={'raw':!![],'where':{'id':_0xc3c024['params']['id']}},_0x3b0112={};_0x3b0112[_0xabfa('0x26')]=_[_0xabfa('0x28')](db[_0xabfa('0x21')]['rawAttributes']);_0x3b0112[_0xabfa('0x27')]=_['keys'](_0xc3c024[_0xabfa('0x27')]);_0x3b0112['filters']=_['intersection'](_0x3b0112['model'],_0x3b0112[_0xabfa('0x27')]);_0x51bfa4[_0xabfa('0x2c')]=_[_0xabfa('0x2a')](_0x3b0112[_0xabfa('0x26')],qs[_0xabfa('0x2b')](_0xc3c024[_0xabfa('0x27')][_0xabfa('0x2b')]));_0x51bfa4[_0xabfa('0x2c')]=_0x51bfa4[_0xabfa('0x2c')][_0xabfa('0x2d')]?_0x51bfa4[_0xabfa('0x2c')]:_0x3b0112['model'];if(_0xc3c024[_0xabfa('0x27')][_0xabfa('0x3b')]){_0x51bfa4[_0xabfa('0x37')]=[{'all':!![]}];}_0x51bfa4=_[_0xabfa('0x34')]({},_0x51bfa4,_0xc3c024[_0xabfa('0x36')]);return db['Network']['find'](_0x51bfa4)[_0xabfa('0x9')](handleEntityNotFound(_0x4fc453,null))[_0xabfa('0x9')](respondWithResult(_0x4fc453,null))[_0xabfa('0x13')](handleError(_0x4fc453,null));};exports['create']=function(_0x33f832,_0x2a9c44){var _0x554ef0;return db[_0xabfa('0x21')][_0xabfa('0x3c')](_0x33f832[_0xabfa('0x3d')],{'raw':!![]})['then'](function(_0x54e0e2){_0x554ef0=_0x54e0e2;return db[_0xabfa('0x21')]['findAll']({'where':{'type':_0x33f832[_0xabfa('0x3d')][_0xabfa('0x24')]},'raw':!![]});})['then'](function(_0x35ad51){if(_0x554ef0[_0xabfa('0x24')]['toUpperCase']()==_0xabfa('0x3e')){var _0x279adf=fs['readFileSync'](path[_0xabfa('0x3f')](config[_0xabfa('0x40')],_0xabfa('0x41')),_0xabfa('0x42'));var _0x561288=ejs[_0xabfa('0x43')](_0x279adf,{'networks':_0x35ad51||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x561288);return respondWithRpcPromise(_0xabfa('0x44'),_0xabfa('0x3c'),{'module':_0xabfa('0x45')});}else if(_0x554ef0[_0xabfa('0x24')][_0xabfa('0x46')]()==_0xabfa('0x47')){var _0x13cf07=fs[_0xabfa('0x48')](path[_0xabfa('0x3f')](config['root'],_0xabfa('0x49')),'utf8');var _0x2c4afc=ejs[_0xabfa('0x43')](_0x13cf07,{'networks':_0x35ad51||[]});fs[_0xabfa('0x4a')](_0xabfa('0x4b'),_0x2c4afc);return respondWithRpcPromise(_0xabfa('0x44'),_0xabfa('0x3c'),{'module':_0xabfa('0x45')});}else{var _0x5725b3=fs[_0xabfa('0x48')](path['join'](config['root'],_0xabfa('0x4c')),_0xabfa('0x42'));var _0x4fe699=ejs['render'](_0x5725b3,{'networks':_0x35ad51||[]});fs[_0xabfa('0x4a')](util[_0xabfa('0x4d')](_0xabfa('0x4e'),_0x33f832[_0xabfa('0x3d')][_0xabfa('0x24')][_0xabfa('0x4f')]()),_0x4fe699);return respondWithRpcPromise('Reload',_0xabfa('0x3c'),{'module':_0xabfa('0x50')});}})[_0xabfa('0x9')](function(){return _0x554ef0;})[_0xabfa('0x9')](respondWithResult(_0x2a9c44,0xc9))[_0xabfa('0x13')](handleError(_0x2a9c44,null));};exports[_0xabfa('0x1c')]=function(_0x72eed0,_0x59a9da){var _0x389945;return db['Network'][_0xabfa('0x51')]({'where':{'id':_0x72eed0['params']['id']}})[_0xabfa('0x9')](handleEntityNotFound(_0x59a9da,null))[_0xabfa('0x9')](saveUpdates(_0x72eed0[_0xabfa('0x3d')],null))[_0xabfa('0x9')](function(_0x3db575){if(_0x3db575){_0x389945=_0x3db575;return db['Network'][_0xabfa('0x38')]({'where':{'type':_0x389945['type']},'raw':!![]});}return null;})[_0xabfa('0x9')](function(_0x1d4c19){if(_0x389945[_0xabfa('0x24')][_0xabfa('0x46')]()==_0xabfa('0x3e')){var _0x3ba48c=fs[_0xabfa('0x48')](path[_0xabfa('0x3f')](config[_0xabfa('0x40')],_0xabfa('0x41')),_0xabfa('0x42'));var _0xc23e60=ejs[_0xabfa('0x43')](_0x3ba48c,{'networks':_0x1d4c19||[]});fs[_0xabfa('0x4a')](_0xabfa('0x52'),_0xc23e60);return respondWithRpcPromise(_0xabfa('0x44'),_0xabfa('0x1c'),{'module':_0xabfa('0x45')});}else if(_0x389945[_0xabfa('0x24')][_0xabfa('0x46')]()=='TURN'){var _0x4f3972=fs[_0xabfa('0x48')](path[_0xabfa('0x3f')](config['root'],_0xabfa('0x49')),_0xabfa('0x42'));var _0x85c26=ejs[_0xabfa('0x43')](_0x4f3972,{'networks':_0x1d4c19||[]});fs['writeFileSync'](_0xabfa('0x4b'),_0x85c26);return respondWithRpcPromise(_0xabfa('0x44'),_0xabfa('0x1c'),{'module':_0xabfa('0x45')});}else{var _0x48050d=fs[_0xabfa('0x48')](path[_0xabfa('0x3f')](config[_0xabfa('0x40')],_0xabfa('0x4c')),_0xabfa('0x42'));var _0x58a562=ejs[_0xabfa('0x43')](_0x48050d,{'networks':_0x1d4c19||[]});fs[_0xabfa('0x4a')](util['format'](_0xabfa('0x4e'),_0x72eed0[_0xabfa('0x3d')][_0xabfa('0x24')][_0xabfa('0x4f')]()),_0x58a562);return respondWithRpcPromise(_0xabfa('0x44'),_0xabfa('0x1c'),{'module':'chan_sip.so'});}})['then'](function(_0x4cad06){if(_0x4cad06){return _0x389945;}return null;})[_0xabfa('0x9')](respondWithResult(_0x59a9da,null))[_0xabfa('0x13')](handleError(_0x59a9da,null));};exports[_0xabfa('0x53')]=function(_0x586947,_0x3e2687){var _0x2223fc;return db['Network'][_0xabfa('0x51')]({'where':{'id':_0x586947[_0xabfa('0x54')]['id']}})['then'](function(_0x3f88f9){_0x2223fc=_0x3f88f9;return _0x3f88f9;})[_0xabfa('0x9')](handleEntityNotFound(_0x3e2687,null))[_0xabfa('0x9')](removeEntity(_0x3e2687,null))[_0xabfa('0x9')](function(){if(_0x2223fc){return db[_0xabfa('0x21')][_0xabfa('0x38')]({'where':{'type':_0x2223fc['type']},'raw':!![]});}})[_0xabfa('0x9')](function(_0x235a6f){if(_0x2223fc['type'][_0xabfa('0x46')]()==_0xabfa('0x3e')){var _0x3b690a=fs[_0xabfa('0x48')](path[_0xabfa('0x3f')](config[_0xabfa('0x40')],_0xabfa('0x41')),_0xabfa('0x42'));var _0x465486=ejs['render'](_0x3b690a,{'networks':_0x235a6f||[]});fs[_0xabfa('0x4a')](_0xabfa('0x52'),_0x465486);return respondWithRpcPromise(_0xabfa('0x44'),_0xabfa('0x53'),{'module':_0xabfa('0x45')});}else if(_0x2223fc[_0xabfa('0x24')][_0xabfa('0x46')]()=='TURN'){var _0x49a4fa=fs[_0xabfa('0x48')](path[_0xabfa('0x3f')](config[_0xabfa('0x40')],_0xabfa('0x49')),_0xabfa('0x42'));var _0x227f1b=ejs[_0xabfa('0x43')](_0x49a4fa,{'networks':_0x235a6f||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x227f1b);return respondWithRpcPromise(_0xabfa('0x44'),_0xabfa('0x53'),{'module':_0xabfa('0x45')});}else{var _0x4f5208=fs[_0xabfa('0x48')](path[_0xabfa('0x3f')](config['root'],_0xabfa('0x4c')),'utf8');var _0x14a446=ejs[_0xabfa('0x43')](_0x4f5208,{'networks':_0x235a6f||[]});fs[_0xabfa('0x4a')](util[_0xabfa('0x4d')](_0xabfa('0x4e'),_0x2223fc['type'][_0xabfa('0x4f')]()),_0x14a446);return respondWithRpcPromise(_0xabfa('0x44'),_0xabfa('0x53'),{'module':_0xabfa('0x50')});}})['catch'](handleError(_0x3e2687,null));}; \ No newline at end of file +var _0x51c4=['Network,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','json','offset','limit','count','set','Content-Range','update','destroy','end','sendStatus','name','send','index','map','Network','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','keys','rawAttributes','find','create','body','toUpperCase','STUN','readFileSync','root','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','writeFileSync','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','join','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','params','server/files/templates/stun_multiple.ejs','TURN','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','path','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x7d5a8b,_0x2aedef){var _0x56ac46=function(_0x55a1ab){while(--_0x55a1ab){_0x7d5a8b['push'](_0x7d5a8b['shift']());}};_0x56ac46(++_0x2aedef);}(_0x51c4,0xec));var _0x451c=function(_0x4466ce,_0x3fe925){_0x4466ce=_0x4466ce-0x0;var _0x38f881=_0x51c4[_0x4466ce];return _0x38f881;};'use strict';var util=require('util');var path=require(_0x451c('0x0'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x451c('0x1'));var qs=require(_0x451c('0x2'));var logger=require(_0x451c('0x3'))('api');var config=require(_0x451c('0x4'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x451c('0x5')][_0x451c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x49df60,_0x51185a,_0x3f7911,_0xd20ab9){return new Promise(function(_0x581abb,_0x368c45){var _0x4cc57c=_0xd20ab9||client;return _0x4cc57c[_0x451c('0x7')](_0x49df60,_0x3f7911)[_0x451c('0x8')](function(_0x39a102){logger[_0x451c('0x9')](_0x451c('0xa'),_0x51185a,_0x451c('0xb'));logger[_0x451c('0xc')](_0x451c('0xd'),_0x51185a,_0x451c('0xb'),JSON['stringify'](_0x39a102));if(_0x39a102[_0x451c('0xe')]){if(_0x39a102['error'][_0x451c('0xf')]===0x1f4){logger['error'](_0x451c('0xa'),_0x51185a,_0x39a102[_0x451c('0xe')][_0x451c('0x10')]);return _0x368c45(_0x39a102[_0x451c('0xe')][_0x451c('0x10')]);}logger[_0x451c('0xe')]('Network,\x20%s,\x20%s',_0x51185a,_0x39a102['error'][_0x451c('0x10')]);return _0x581abb(_0x39a102[_0x451c('0xe')]['message']);}else{logger[_0x451c('0x9')]('Network,\x20%s,\x20%s',_0x51185a,_0x451c('0xb'));_0x581abb(_0x39a102['result'][_0x451c('0x10')]);}})[_0x451c('0x11')](function(_0x2a0c08){logger[_0x451c('0xe')](_0x451c('0xa'),_0x51185a,_0x2a0c08);_0x368c45(_0x2a0c08);});});}function respondWithResult(_0x502d76,_0x506706){_0x506706=_0x506706||0xc8;return function(_0x33f5b2){if(_0x33f5b2){return _0x502d76[_0x451c('0x12')](_0x506706)[_0x451c('0x13')](_0x33f5b2);}};}function respondWithFilteredResult(_0x5d18dc,_0x2d5864){return function(_0x47ad4f){if(_0x47ad4f){var _0x20ad12=typeof _0x2d5864[_0x451c('0x14')]==='undefined'&&typeof _0x2d5864[_0x451c('0x15')]==='undefined';var _0x2dd0cb=_0x47ad4f[_0x451c('0x16')];var _0x3c9948=_0x20ad12?0x0:_0x2d5864[_0x451c('0x14')];var _0x28b063=_0x20ad12?_0x47ad4f[_0x451c('0x16')]:_0x2d5864['offset']+_0x2d5864[_0x451c('0x15')];var _0x1bd8c9;if(_0x28b063>=_0x2dd0cb){_0x28b063=_0x2dd0cb;_0x1bd8c9=0xc8;}else{_0x1bd8c9=0xce;}_0x5d18dc[_0x451c('0x12')](_0x1bd8c9);return _0x5d18dc[_0x451c('0x17')](_0x451c('0x18'),_0x3c9948+'-'+_0x28b063+'/'+_0x2dd0cb)[_0x451c('0x13')](_0x47ad4f);}return null;};}function saveUpdates(_0x2ecde0){return function(_0x2a9815){if(_0x2a9815){return _0x2a9815[_0x451c('0x19')](_0x2ecde0)['then'](function(_0x382631){return _0x382631;});}return null;};}function removeEntity(_0x2b52cb){return function(_0xec7c8a){if(_0xec7c8a){return _0xec7c8a[_0x451c('0x1a')]()[_0x451c('0x8')](function(){_0x2b52cb['status'](0xcc)[_0x451c('0x1b')]();});}};}function handleEntityNotFound(_0x19370b){return function(_0x425a6c){if(!_0x425a6c){_0x19370b[_0x451c('0x1c')](0x194);}return _0x425a6c;};}function handleError(_0x165e6a,_0x517567){_0x517567=_0x517567||0x1f4;return function(_0x21a4a8){logger['error'](_0x21a4a8['stack']);if(_0x21a4a8[_0x451c('0x1d')]){delete _0x21a4a8['name'];}_0x165e6a[_0x451c('0x12')](_0x517567)[_0x451c('0x1e')](_0x21a4a8);};}exports[_0x451c('0x1f')]=function(_0x50dad0,_0x49a28d){var _0x3d20d6={},_0x3d2a26={},_0x1aa35e={'count':0x0,'rows':[]};var _0x2b2556=_[_0x451c('0x20')](db[_0x451c('0x21')]['rawAttributes'],function(_0xe9ba07){return{'name':_0xe9ba07[_0x451c('0x22')],'type':_0xe9ba07[_0x451c('0x23')][_0x451c('0x24')]};});_0x3d2a26[_0x451c('0x25')]=_[_0x451c('0x20')](_0x2b2556,_0x451c('0x1d'));_0x3d2a26['query']=_['keys'](_0x50dad0[_0x451c('0x26')]);_0x3d2a26[_0x451c('0x27')]=_[_0x451c('0x28')](_0x3d2a26['model'],_0x3d2a26[_0x451c('0x26')]);_0x3d20d6[_0x451c('0x29')]=_[_0x451c('0x28')](_0x3d2a26[_0x451c('0x25')],qs[_0x451c('0x2a')](_0x50dad0[_0x451c('0x26')][_0x451c('0x2a')]));_0x3d20d6['attributes']=_0x3d20d6[_0x451c('0x29')][_0x451c('0x2b')]?_0x3d20d6['attributes']:_0x3d2a26['model'];if(!_0x50dad0[_0x451c('0x26')][_0x451c('0x2c')](_0x451c('0x2d'))){_0x3d20d6[_0x451c('0x15')]=qs[_0x451c('0x15')](_0x50dad0[_0x451c('0x26')][_0x451c('0x15')]);_0x3d20d6[_0x451c('0x14')]=qs[_0x451c('0x14')](_0x50dad0[_0x451c('0x26')][_0x451c('0x14')]);}_0x3d20d6[_0x451c('0x2e')]=qs[_0x451c('0x2f')](_0x50dad0[_0x451c('0x26')][_0x451c('0x2f')]);_0x3d20d6[_0x451c('0x30')]=qs['filters'](_['pick'](_0x50dad0['query'],_0x3d2a26[_0x451c('0x27')]),_0x2b2556);if(_0x50dad0[_0x451c('0x26')]['filter']){_0x3d20d6[_0x451c('0x30')]=_[_0x451c('0x31')](_0x3d20d6[_0x451c('0x30')],{'$or':_[_0x451c('0x20')](_0x2b2556,function(_0x2c6585){if(_0x2c6585[_0x451c('0x23')]!==_0x451c('0x32')){var _0x9625={};_0x9625[_0x2c6585[_0x451c('0x1d')]]={'$like':'%'+_0x50dad0[_0x451c('0x26')][_0x451c('0x33')]+'%'};return _0x9625;}})});}_0x3d20d6=_[_0x451c('0x31')]({},_0x3d20d6,_0x50dad0[_0x451c('0x34')]);var _0x89db34={'where':_0x3d20d6[_0x451c('0x30')]};return db['Network'][_0x451c('0x16')](_0x89db34)['then'](function(_0x3ef7da){_0x1aa35e[_0x451c('0x16')]=_0x3ef7da;if(_0x50dad0[_0x451c('0x26')][_0x451c('0x35')]){_0x3d20d6['include']=[{'all':!![]}];}return db[_0x451c('0x21')][_0x451c('0x36')](_0x3d20d6);})[_0x451c('0x8')](function(_0x29bcd1){_0x1aa35e[_0x451c('0x37')]=_0x29bcd1;return _0x1aa35e;})['then'](respondWithFilteredResult(_0x49a28d,_0x3d20d6))[_0x451c('0x11')](handleError(_0x49a28d,null));};exports[_0x451c('0x38')]=function(_0x591fb5,_0x3b7f61){var _0x3ce87e={'raw':!![],'where':{'id':_0x591fb5['params']['id']}},_0x5d12e7={};_0x5d12e7[_0x451c('0x25')]=_[_0x451c('0x39')](db['Network'][_0x451c('0x3a')]);_0x5d12e7[_0x451c('0x26')]=_['keys'](_0x591fb5[_0x451c('0x26')]);_0x5d12e7[_0x451c('0x27')]=_[_0x451c('0x28')](_0x5d12e7[_0x451c('0x25')],_0x5d12e7[_0x451c('0x26')]);_0x3ce87e[_0x451c('0x29')]=_['intersection'](_0x5d12e7[_0x451c('0x25')],qs['fields'](_0x591fb5[_0x451c('0x26')]['fields']));_0x3ce87e[_0x451c('0x29')]=_0x3ce87e[_0x451c('0x29')][_0x451c('0x2b')]?_0x3ce87e['attributes']:_0x5d12e7['model'];if(_0x591fb5['query'][_0x451c('0x35')]){_0x3ce87e['include']=[{'all':!![]}];}_0x3ce87e=_[_0x451c('0x31')]({},_0x3ce87e,_0x591fb5[_0x451c('0x34')]);return db['Network'][_0x451c('0x3b')](_0x3ce87e)[_0x451c('0x8')](handleEntityNotFound(_0x3b7f61,null))[_0x451c('0x8')](respondWithResult(_0x3b7f61,null))[_0x451c('0x11')](handleError(_0x3b7f61,null));};exports[_0x451c('0x3c')]=function(_0x273b8f,_0x3a7d75){var _0x20187f;return db[_0x451c('0x21')][_0x451c('0x3c')](_0x273b8f[_0x451c('0x3d')],{'raw':!![]})['then'](function(_0x4692e8){_0x20187f=_0x4692e8;return db[_0x451c('0x21')][_0x451c('0x36')]({'where':{'type':_0x273b8f[_0x451c('0x3d')]['type']},'raw':!![]});})['then'](function(_0x3bb9a4){if(_0x20187f[_0x451c('0x23')][_0x451c('0x3e')]()==_0x451c('0x3f')){var _0x353ce1=fs[_0x451c('0x40')](path['join'](config[_0x451c('0x41')],'server/files/templates/stun_multiple.ejs'),_0x451c('0x42'));var _0x206fa3=ejs[_0x451c('0x43')](_0x353ce1,{'networks':_0x3bb9a4||[]});fs['writeFileSync'](_0x451c('0x44'),_0x206fa3);return respondWithRpcPromise(_0x451c('0x45'),'create',{'module':'res_stun_monitor.so'});}else if(_0x20187f[_0x451c('0x23')][_0x451c('0x3e')]()=='TURN'){var _0x576f5b=fs[_0x451c('0x40')](path['join'](config[_0x451c('0x41')],'server/files/templates/turn_multiple.ejs'),_0x451c('0x42'));var _0xa9803f=ejs[_0x451c('0x43')](_0x576f5b,{'networks':_0x3bb9a4||[]});fs[_0x451c('0x46')](_0x451c('0x47'),_0xa9803f);return respondWithRpcPromise(_0x451c('0x45'),_0x451c('0x3c'),{'module':_0x451c('0x48')});}else{var _0x5c1dbc=fs[_0x451c('0x40')](path[_0x451c('0x49')](config[_0x451c('0x41')],'server/files/templates/network.ejs'),_0x451c('0x42'));var _0x14df68=ejs[_0x451c('0x43')](_0x5c1dbc,{'networks':_0x3bb9a4||[]});fs['writeFileSync'](util[_0x451c('0x4a')](_0x451c('0x4b'),_0x273b8f[_0x451c('0x3d')][_0x451c('0x23')][_0x451c('0x4c')]()),_0x14df68);return respondWithRpcPromise(_0x451c('0x45'),_0x451c('0x3c'),{'module':_0x451c('0x4d')});}})[_0x451c('0x8')](function(){return _0x20187f;})[_0x451c('0x8')](respondWithResult(_0x3a7d75,0xc9))[_0x451c('0x11')](handleError(_0x3a7d75,null));};exports[_0x451c('0x19')]=function(_0x53c2cb,_0x46518c){var _0x517034;return db['Network'][_0x451c('0x3b')]({'where':{'id':_0x53c2cb[_0x451c('0x4e')]['id']}})[_0x451c('0x8')](handleEntityNotFound(_0x46518c,null))[_0x451c('0x8')](saveUpdates(_0x53c2cb['body'],null))[_0x451c('0x8')](function(_0x5cf668){if(_0x5cf668){_0x517034=_0x5cf668;return db[_0x451c('0x21')]['findAll']({'where':{'type':_0x517034[_0x451c('0x23')]},'raw':!![]});}return null;})[_0x451c('0x8')](function(_0x148355){if(_0x517034['type'][_0x451c('0x3e')]()=='STUN'){var _0x38509d=fs['readFileSync'](path[_0x451c('0x49')](config['root'],_0x451c('0x4f')),_0x451c('0x42'));var _0x48b77b=ejs[_0x451c('0x43')](_0x38509d,{'networks':_0x148355||[]});fs['writeFileSync'](_0x451c('0x44'),_0x48b77b);return respondWithRpcPromise(_0x451c('0x45'),'update',{'module':_0x451c('0x48')});}else if(_0x517034[_0x451c('0x23')][_0x451c('0x3e')]()==_0x451c('0x50')){var _0x107fb0=fs[_0x451c('0x40')](path[_0x451c('0x49')](config['root'],_0x451c('0x51')),'utf8');var _0x314c75=ejs['render'](_0x107fb0,{'networks':_0x148355||[]});fs[_0x451c('0x46')](_0x451c('0x47'),_0x314c75);return respondWithRpcPromise(_0x451c('0x45'),'update',{'module':_0x451c('0x48')});}else{var _0xdc6eb1=fs[_0x451c('0x40')](path[_0x451c('0x49')](config[_0x451c('0x41')],_0x451c('0x52')),_0x451c('0x42'));var _0x44c2e2=ejs[_0x451c('0x43')](_0xdc6eb1,{'networks':_0x148355||[]});fs[_0x451c('0x46')](util[_0x451c('0x4a')](_0x451c('0x4b'),_0x53c2cb[_0x451c('0x3d')]['type'][_0x451c('0x4c')]()),_0x44c2e2);return respondWithRpcPromise(_0x451c('0x45'),_0x451c('0x19'),{'module':_0x451c('0x4d')});}})[_0x451c('0x8')](function(_0x269b35){if(_0x269b35){return _0x517034;}return null;})[_0x451c('0x8')](respondWithResult(_0x46518c,null))[_0x451c('0x11')](handleError(_0x46518c,null));};exports[_0x451c('0x1a')]=function(_0x7d6642,_0xb94dea){var _0x499ecc;return db[_0x451c('0x21')][_0x451c('0x3b')]({'where':{'id':_0x7d6642[_0x451c('0x4e')]['id']}})[_0x451c('0x8')](function(_0x34876e){_0x499ecc=_0x34876e;return _0x34876e;})['then'](handleEntityNotFound(_0xb94dea,null))['then'](removeEntity(_0xb94dea,null))[_0x451c('0x8')](function(){if(_0x499ecc){return db[_0x451c('0x21')][_0x451c('0x36')]({'where':{'type':_0x499ecc['type']},'raw':!![]});}})['then'](function(_0x1eb564){if(_0x499ecc[_0x451c('0x23')][_0x451c('0x3e')]()==_0x451c('0x3f')){var _0x1bc702=fs[_0x451c('0x40')](path[_0x451c('0x49')](config['root'],_0x451c('0x4f')),_0x451c('0x42'));var _0x83ff1c=ejs[_0x451c('0x43')](_0x1bc702,{'networks':_0x1eb564||[]});fs[_0x451c('0x46')]('/etc/asterisk/stun_xcally.conf',_0x83ff1c);return respondWithRpcPromise(_0x451c('0x45'),_0x451c('0x1a'),{'module':_0x451c('0x48')});}else if(_0x499ecc[_0x451c('0x23')][_0x451c('0x3e')]()==_0x451c('0x50')){var _0x2a6503=fs[_0x451c('0x40')](path[_0x451c('0x49')](config['root'],_0x451c('0x51')),_0x451c('0x42'));var _0x32d6b0=ejs[_0x451c('0x43')](_0x2a6503,{'networks':_0x1eb564||[]});fs[_0x451c('0x46')]('/etc/asterisk/turn_xcally.conf',_0x32d6b0);return respondWithRpcPromise('Reload','destroy',{'module':'res_stun_monitor.so'});}else{var _0x2389c1=fs[_0x451c('0x40')](path[_0x451c('0x49')](config[_0x451c('0x41')],_0x451c('0x52')),'utf8');var _0x41158f=ejs[_0x451c('0x43')](_0x2389c1,{'networks':_0x1eb564||[]});fs['writeFileSync'](util[_0x451c('0x4a')](_0x451c('0x4b'),_0x499ecc[_0x451c('0x23')][_0x451c('0x4c')]()),_0x41158f);return respondWithRpcPromise(_0x451c('0x45'),_0x451c('0x1a'),{'module':_0x451c('0x4d')});}})[_0x451c('0x11')](handleError(_0xb94dea,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index f2c32b1..eb4527e 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 _0xd64b=['define','Network','network','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x276015,_0x57eb3d){var _0x385345=function(_0x3c5bb4){while(--_0x3c5bb4){_0x276015['push'](_0x276015['shift']());}};_0x385345(++_0x57eb3d);}(_0xd64b,0xc1));var _0xbd64=function(_0x3a0be9,_0x214ee4){_0x3a0be9=_0x3a0be9-0x0;var _0xc1ec3e=_0xd64b[_0x3a0be9];return _0xc1ec3e;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var logger=require(_0xbd64('0x1'))('api');var moment=require(_0xbd64('0x2'));var BPromise=require(_0xbd64('0x3'));var rp=require(_0xbd64('0x4'));var fs=require('fs');var path=require(_0xbd64('0x5'));var rimraf=require(_0xbd64('0x6'));var config=require('../../config/environment');var attributes=require('./network.attributes');module['exports']=function(_0x51e87d,_0x58e9e7){return _0x51e87d[_0xbd64('0x7')](_0xbd64('0x8'),attributes,{'tableName':_0xbd64('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa25c=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./network.attributes','Network','network'];(function(_0x316662,_0x2956f7){var _0x22dce3=function(_0x23ba10){while(--_0x23ba10){_0x316662['push'](_0x316662['shift']());}};_0x22dce3(++_0x2956f7);}(_0xa25c,0x13f));var _0xca25=function(_0x104c8e,_0x4f26c8){_0x104c8e=_0x104c8e-0x0;var _0x39656b=_0xa25c[_0x104c8e];return _0x39656b;};'use strict';var _=require('lodash');var util=require(_0xca25('0x0'));var logger=require(_0xca25('0x1'))(_0xca25('0x2'));var moment=require(_0xca25('0x3'));var BPromise=require(_0xca25('0x4'));var rp=require(_0xca25('0x5'));var fs=require('fs');var path=require(_0xca25('0x6'));var rimraf=require(_0xca25('0x7'));var config=require('../../config/environment');var attributes=require(_0xca25('0x8'));module['exports']=function(_0x4ec046,_0xae1996){return _0x4ec046['define'](_0xca25('0x9'),attributes,{'tableName':_0xca25('0xa'),'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 396d412..d60594e 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(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x534661,_0x1ee747){_0x534661=_0x534661-0x0;var _0x18b26e=_0x7a54[_0x534661];return _0x18b26e;};'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 _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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x17a655,_0x4d2ba7){_0x17a655=_0x17a655-0x0;var _0x2417c1=_0x7a54[_0x17a655];return _0x2417c1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 9e23397..3d4de81 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 _0x1c7c=['delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','update','destroy'];(function(_0x2808e3,_0x4011cd){var _0x5eb3f1=function(_0x1eb6c9){while(--_0x1eb6c9){_0x2808e3['push'](_0x2808e3['shift']());}};_0x5eb3f1(++_0x4011cd);}(_0x1c7c,0x164));var _0xc1c7=function(_0x49e598,_0x2ada13){_0x49e598=_0x49e598-0x0;var _0x3ecad6=_0x1c7c[_0x49e598];return _0x3ecad6;};'use strict';var multer=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var path=require(_0xc1c7('0x2'));var timeout=require(_0xc1c7('0x3'));var express=require('express');var router=express[_0xc1c7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc1c7('0x5'));var interaction=require(_0xc1c7('0x6'));var config=require(_0xc1c7('0x7'));var controller=require(_0xc1c7('0x8'));router[_0xc1c7('0x9')]('/',auth[_0xc1c7('0xa')](),controller[_0xc1c7('0xb')]);router[_0xc1c7('0x9')](_0xc1c7('0xc'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0xd')]);router[_0xc1c7('0x9')](_0xc1c7('0xe'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0xf')]);router[_0xc1c7('0x9')](_0xc1c7('0x10'),auth['isAuthenticated'](),controller[_0xc1c7('0x11')]);router[_0xc1c7('0x9')]('/:id/canned_answers',auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x12')]);router[_0xc1c7('0x9')]('/:id/applications',auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x13')]);router[_0xc1c7('0x9')](_0xc1c7('0x14'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x15')]);router[_0xc1c7('0x9')](_0xc1c7('0x16'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x17')]);router[_0xc1c7('0x18')]('/',auth[_0xc1c7('0xa')](),controller['create']);router[_0xc1c7('0x18')](_0xc1c7('0x10'),auth[_0xc1c7('0xa')](),controller['addDisposition']);router[_0xc1c7('0x18')](_0xc1c7('0x19'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x1a')]);router[_0xc1c7('0x18')](_0xc1c7('0x1b'),controller[_0xc1c7('0x1c')]);router[_0xc1c7('0x18')]('/:id/applications',auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x1d')]);router[_0xc1c7('0x18')](_0xc1c7('0x16'),auth['isAuthenticated'](),controller[_0xc1c7('0x1e')]);router['post'](_0xc1c7('0x1f'),auth[_0xc1c7('0xa')](),controller['send']);router['put'](_0xc1c7('0xe'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x20')]);router['delete'](_0xc1c7('0xe'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x21')]);router[_0xc1c7('0x22')](_0xc1c7('0x10'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x23')]);router[_0xc1c7('0x22')](_0xc1c7('0x19'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x24')]);router[_0xc1c7('0x22')](_0xc1c7('0x16'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x25')]);module[_0xc1c7('0x26')]=router; \ No newline at end of file +var _0xbbbc=['fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','getInteractions','getAgents','post','/:id/dispositions','addDisposition','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','send','put','update','delete','destroy','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router'];(function(_0x17649d,_0x4e75c7){var _0x36cadd=function(_0x283926){while(--_0x283926){_0x17649d['push'](_0x17649d['shift']());}};_0x36cadd(++_0x4e75c7);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x18e610,_0x161c11){_0x18e610=_0x18e610-0x0;var _0x5041e5=_0xbbbc[_0x18e610];return _0x5041e5;};'use strict';var multer=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var path=require(_0xcbbb('0x2'));var timeout=require(_0xcbbb('0x3'));var express=require(_0xcbbb('0x4'));var router=express[_0xcbbb('0x5')]();var fs_extra=require(_0xcbbb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xcbbb('0x7'));var config=require(_0xcbbb('0x8'));var controller=require(_0xcbbb('0x9'));router[_0xcbbb('0xa')]('/',auth[_0xcbbb('0xb')](),controller['index']);router[_0xcbbb('0xa')](_0xcbbb('0xc'),auth[_0xcbbb('0xb')](),controller[_0xcbbb('0xd')]);router[_0xcbbb('0xa')](_0xcbbb('0xe'),auth[_0xcbbb('0xb')](),controller['show']);router[_0xcbbb('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xcbbb('0xf')]);router['get'](_0xcbbb('0x10'),auth['isAuthenticated'](),controller[_0xcbbb('0x11')]);router[_0xcbbb('0xa')]('/:id/applications',auth[_0xcbbb('0xb')](),controller['getApplications']);router[_0xcbbb('0xa')]('/:id/interactions',auth[_0xcbbb('0xb')](),controller[_0xcbbb('0x12')]);router[_0xcbbb('0xa')]('/:id/users',auth[_0xcbbb('0xb')](),controller[_0xcbbb('0x13')]);router[_0xcbbb('0x14')]('/',auth[_0xcbbb('0xb')](),controller['create']);router['post'](_0xcbbb('0x15'),auth[_0xcbbb('0xb')](),controller[_0xcbbb('0x16')]);router[_0xcbbb('0x14')]('/:id/canned_answers',auth[_0xcbbb('0xb')](),controller['addAnswer']);router[_0xcbbb('0x14')](_0xcbbb('0x17'),controller[_0xcbbb('0x18')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xcbbb('0x19')]);router[_0xcbbb('0x14')](_0xcbbb('0x1a'),auth[_0xcbbb('0xb')](),controller[_0xcbbb('0x1b')]);router[_0xcbbb('0x14')](_0xcbbb('0x1c'),auth[_0xcbbb('0xb')](),controller[_0xcbbb('0x1d')]);router[_0xcbbb('0x1e')]('/:id',auth[_0xcbbb('0xb')](),controller[_0xcbbb('0x1f')]);router[_0xcbbb('0x20')](_0xcbbb('0xe'),auth[_0xcbbb('0xb')](),controller[_0xcbbb('0x21')]);router[_0xcbbb('0x20')](_0xcbbb('0x15'),auth[_0xcbbb('0xb')](),controller['removeDispositions']);router[_0xcbbb('0x20')](_0xcbbb('0x10'),auth['isAuthenticated'](),controller[_0xcbbb('0x22')]);router['delete']('/:id/users',auth[_0xcbbb('0xb')](),controller[_0xcbbb('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 1695d4f..e9d1a00 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 _0x9861=['name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','randomstring','exports','STRING'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9861,0x126));var _0x1986=function(_0x5a4976,_0x1c9eb6){_0x5a4976=_0x5a4976-0x0;var _0x481a52=_0x9861[_0x5a4976];return _0x481a52;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x1986('0x0'));module[_0x1986('0x1')]={'name':{'type':Sequelize[_0x1986('0x2')],'unique':_0x1986('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x1986('0x2')]},'token':{'type':Sequelize[_0x1986('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x1986('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x1986('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1986('0x4')],'defaultValue':function(){return _0x1986('0x5');}},'notificationSound':{'type':Sequelize[_0x1986('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1986('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1986('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x1986('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x1986('0x2')]},'queueTransfer':{'type':Sequelize[_0x1986('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1986('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1986('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1986('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x1986('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x1986('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5cde29){if(!_0x5cde29)this[_0x1986('0x9')]('mandatoryDispositionPauseId',null);this[_0x1986('0x9')](_0x1986('0xa'),_0x5cde29);}}}; \ No newline at end of file +var _0x9c25=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT'];(function(_0x5c3a61,_0x57f501){var _0x5a3850=function(_0x4e2627){while(--_0x4e2627){_0x5c3a61['push'](_0x5c3a61['shift']());}};_0x5a3850(++_0x57f501);}(_0x9c25,0x152));var _0x59c2=function(_0x312c88,_0x183a02){_0x312c88=_0x312c88-0x0;var _0xee5456=_0x9c25[_0x312c88];return _0xee5456;};'use strict';var Sequelize=require(_0x59c2('0x0'));var rs=require(_0x59c2('0x1'));module[_0x59c2('0x2')]={'name':{'type':Sequelize[_0x59c2('0x3')],'unique':_0x59c2('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x59c2('0x5')]();}},'replyUri':{'type':Sequelize[_0x59c2('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x59c2('0x6')],'defaultValue':function(){return _0x59c2('0x7');}},'notificationSound':{'type':Sequelize[_0x59c2('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x59c2('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x59c2('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x59c2('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x59c2('0x3')]},'queueTransfer':{'type':Sequelize[_0x59c2('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x59c2('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x59c2('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x59c2('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x59c2('0x8')],'defaultValue':![],'comment':_0x59c2('0xb'),'set':function(_0x5a2aaf){if(!_0x5a2aaf)this[_0x59c2('0xc')](_0x59c2('0xd'),null);this[_0x59c2('0xc')](_0x59c2('0xe'),_0x5a2aaf);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 42f8681..dc776c0 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 _0x0b9b=['*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','startRouting','EventManager','notify','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','send','getApplications','getInteractions','Contact','User','fullname','internal','Tag','Tags','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','emit','getAgents','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','http','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','get','OpenchannelAccounts','destroy','stack','name','index','map','OpenchannelAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','count','includeAll','include','rows','show','params','Pause','mandatoryDispositionPause','keys','options','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','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','OpenchannelApplication','Applications','account','applications','list','List','orderBy','priority','asc','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','messageId','update','interaction','created','autoclose','push','close','unmanaged'];(function(_0xd692b3,_0x54b077){var _0x4808c6=function(_0x1a3e1f){while(--_0x1a3e1f){_0xd692b3['push'](_0xd692b3['shift']());}};_0x4808c6(++_0x54b077);}(_0x0b9b,0x1b9));var _0xb0b9=function(_0x5aebc5,_0x4fa68f){_0x5aebc5=_0x5aebc5-0x0;var _0x98b8ea=_0x0b9b[_0x5aebc5];return _0x98b8ea;};'use strict';var emlformat=require(_0xb0b9('0x0'));var rimraf=require(_0xb0b9('0x1'));var zipdir=require(_0xb0b9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0b9('0x3'));var moment=require(_0xb0b9('0x4'));var BPromise=require(_0xb0b9('0x5'));var Mustache=require('mustache');var util=require(_0xb0b9('0x6'));var path=require(_0xb0b9('0x7'));var sox=require(_0xb0b9('0x8'));var csv=require(_0xb0b9('0x9'));var ejs=require(_0xb0b9('0xa'));var fs=require('fs');var fs_extra=require(_0xb0b9('0xb'));var _=require('lodash');var squel=require(_0xb0b9('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb0b9('0xd'));var toCsv=require(_0xb0b9('0x9'));var querystring=require('querystring');var Papa=require(_0xb0b9('0xe'));var Redis=require(_0xb0b9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb0b9('0x10'));var as=require(_0xb0b9('0x11'));var hardwareService=require(_0xb0b9('0x12'));var logger=require('../../config/logger')(_0xb0b9('0x13'));var utils=require(_0xb0b9('0x14'));var config=require(_0xb0b9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb0b9('0x16'))['db'];config['redis']=_[_0xb0b9('0x17')](config[_0xb0b9('0x18')],{'host':_0xb0b9('0x19'),'port':0x18eb});var socket=require(_0xb0b9('0x1a'))(new Redis(config[_0xb0b9('0x18')]));require(_0xb0b9('0x1b'))[_0xb0b9('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xb0b9('0x1d')]({'port':0x232c});var client9002=jayson[_0xb0b9('0x1e')][_0xb0b9('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x54b4db,_0x4f9b65,_0x4e8d34,_0x765604){return new BPromise(function(_0x2c146a,_0x4f2f50){var _0x31a23a=_0x765604||client;return _0x31a23a[_0xb0b9('0x1f')](_0x54b4db,_0x4e8d34)[_0xb0b9('0x20')](function(_0x401cf8){logger[_0xb0b9('0x21')](_0xb0b9('0x22'),_0x4f9b65,_0xb0b9('0x23'));logger[_0xb0b9('0x24')](_0xb0b9('0x25'),_0x4f9b65,_0xb0b9('0x23'),JSON[_0xb0b9('0x26')](_0x401cf8));if(_0x401cf8[_0xb0b9('0x27')]){if(_0x401cf8[_0xb0b9('0x27')][_0xb0b9('0x28')]===0x1f4){logger[_0xb0b9('0x27')](_0xb0b9('0x22'),_0x4f9b65,_0x401cf8[_0xb0b9('0x27')][_0xb0b9('0x29')]);return _0x4f2f50(_0x401cf8['error']['message']);}logger[_0xb0b9('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x4f9b65,_0x401cf8[_0xb0b9('0x27')][_0xb0b9('0x29')]);return _0x2c146a(_0x401cf8[_0xb0b9('0x27')][_0xb0b9('0x29')]);}else{logger[_0xb0b9('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x4f9b65,_0xb0b9('0x23'));_0x2c146a(_0x401cf8[_0xb0b9('0x2a')]['message']);}})[_0xb0b9('0x2b')](function(_0x45e7c6){logger[_0xb0b9('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x4f9b65,_0x45e7c6);_0x4f2f50(_0x45e7c6);});});}function respondWithStatusCode(_0x47ad25,_0x120773){_0x120773=_0x120773||0xcc;return function(_0x6c4af6){if(_0x6c4af6){return _0x47ad25[_0xb0b9('0x2c')](_0x120773);}return _0x47ad25[_0xb0b9('0x2d')](_0x120773)[_0xb0b9('0x2e')]();};}function respondWithResult(_0xc6092c,_0x4c2588){_0x4c2588=_0x4c2588||0xc8;return function(_0x8c4aec){if(_0x8c4aec){return _0xc6092c[_0xb0b9('0x2d')](_0x4c2588)[_0xb0b9('0x2f')](_0x8c4aec);}};}function respondWithFilteredResult(_0x3b5fd4,_0xf24747){return function(_0x45c791){if(_0x45c791){var _0x215d41=typeof _0xf24747[_0xb0b9('0x30')]===_0xb0b9('0x31')&&typeof _0xf24747['limit']===_0xb0b9('0x31');var _0x31f8b5=_0x45c791['count'];var _0x26bfda=_0x215d41?0x0:_0xf24747[_0xb0b9('0x30')];var _0x395908=_0x215d41?_0x45c791['count']:_0xf24747['offset']+_0xf24747[_0xb0b9('0x32')];var _0x16bd7a;if(_0x395908>=_0x31f8b5){_0x395908=_0x31f8b5;_0x16bd7a=0xc8;}else{_0x16bd7a=0xce;}_0x3b5fd4[_0xb0b9('0x2d')](_0x16bd7a);return _0x3b5fd4[_0xb0b9('0x33')](_0xb0b9('0x34'),_0x26bfda+'-'+_0x395908+'/'+_0x31f8b5)[_0xb0b9('0x2f')](_0x45c791);}return null;};}function patchUpdates(_0x5c7082){return function(_0x580fad){try{jsonpatch[_0xb0b9('0x35')](_0x580fad,_0x5c7082,!![]);}catch(_0xcbe3b4){return BPromise[_0xb0b9('0x36')](_0xcbe3b4);}return _0x580fad['save']();};}function saveUpdates(_0x70a8b0,_0x768adc){return function(_0x553929){if(_0x553929){return _0x553929['update'](_0x70a8b0)['then'](function(_0x5c87aa){return _0x5c87aa;});}return null;};}function removeEntity(_0x1e7553,_0x173e79){return function(_0x248671){if(_0x248671){return _0x248671['destroy']()[_0xb0b9('0x20')](function(){var _0x11c7e5=_0x248671[_0xb0b9('0x37')]({'plain':!![]});var _0x53b428=_0xb0b9('0x38');return db['UserProfileResource'][_0xb0b9('0x39')]({'where':{'type':_0x53b428,'resourceId':_0x11c7e5['id']}})['then'](function(){return _0x248671;});})['then'](function(){_0x1e7553[_0xb0b9('0x2d')](0xcc)[_0xb0b9('0x2e')]();});}};}function handleEntityNotFound(_0x2dea15,_0x2ffe42){return function(_0x1d7547){if(!_0x1d7547){_0x2dea15[_0xb0b9('0x2c')](0x194);}return _0x1d7547;};}function handleError(_0x30790a,_0x1360b0){_0x1360b0=_0x1360b0||0x1f4;return function(_0x16e6b3){logger[_0xb0b9('0x27')](_0x16e6b3[_0xb0b9('0x3a')]);if(_0x16e6b3[_0xb0b9('0x3b')]){delete _0x16e6b3['name'];}_0x30790a['status'](_0x1360b0)['send'](_0x16e6b3);};}exports[_0xb0b9('0x3c')]=function(_0x335932,_0x1dfbde){var _0x2743bd={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x226944={},_0x29d8f2={'count':0x0,'rows':[]};var _0x3ed4cc=_[_0xb0b9('0x3d')](db[_0xb0b9('0x3e')][_0xb0b9('0x3f')],function(_0x1c869d){return{'name':_0x1c869d[_0xb0b9('0x40')],'type':_0x1c869d['type'][_0xb0b9('0x41')]};});_0x226944[_0xb0b9('0x42')]=_[_0xb0b9('0x3d')](_0x3ed4cc,_0xb0b9('0x3b'));_0x226944[_0xb0b9('0x43')]=_['keys'](_0x335932[_0xb0b9('0x43')]);_0x226944[_0xb0b9('0x44')]=_[_0xb0b9('0x45')](_0x226944['model'],_0x226944[_0xb0b9('0x43')]);_0x2743bd[_0xb0b9('0x46')]=_[_0xb0b9('0x45')](_0x226944[_0xb0b9('0x42')],qs[_0xb0b9('0x47')](_0x335932[_0xb0b9('0x43')][_0xb0b9('0x47')]));_0x2743bd[_0xb0b9('0x46')]=_0x2743bd['attributes'][_0xb0b9('0x48')]?_0x2743bd[_0xb0b9('0x46')]:_0x226944[_0xb0b9('0x42')];if(!_0x335932[_0xb0b9('0x43')][_0xb0b9('0x49')](_0xb0b9('0x4a'))){_0x2743bd[_0xb0b9('0x32')]=qs[_0xb0b9('0x32')](_0x335932[_0xb0b9('0x43')]['limit']);_0x2743bd[_0xb0b9('0x30')]=qs[_0xb0b9('0x30')](_0x335932[_0xb0b9('0x43')][_0xb0b9('0x30')]);}_0x2743bd[_0xb0b9('0x4b')]=qs[_0xb0b9('0x4c')](_0x335932['query']['sort']);_0x2743bd[_0xb0b9('0x4d')]=qs['filters'](_[_0xb0b9('0x4e')](_0x335932[_0xb0b9('0x43')],_0x226944['filters']),_0x3ed4cc);if(_0x335932[_0xb0b9('0x43')][_0xb0b9('0x4f')]){_0x2743bd[_0xb0b9('0x4d')]=_['merge'](_0x2743bd[_0xb0b9('0x4d')],{'$or':_[_0xb0b9('0x3d')](_0x3ed4cc,function(_0x1d0dee){if(_0x1d0dee[_0xb0b9('0x50')]!==_0xb0b9('0x51')){var _0x409f0b={};_0x409f0b[_0x1d0dee['name']]={'$like':'%'+_0x335932['query'][_0xb0b9('0x4f')]+'%'};return _0x409f0b;}})});}_0x2743bd=_[_0xb0b9('0x52')]({},_0x2743bd,_0x335932['options']);var _0x5abd5b={'where':_0x2743bd[_0xb0b9('0x4d')]};return db['OpenchannelAccount'][_0xb0b9('0x53')](_0x5abd5b)[_0xb0b9('0x20')](function(_0x17bba9){_0x29d8f2[_0xb0b9('0x53')]=_0x17bba9;if(_0x335932[_0xb0b9('0x43')][_0xb0b9('0x54')]){_0x2743bd[_0xb0b9('0x55')]=[{'all':!![]}];}return db[_0xb0b9('0x3e')]['findAll'](_0x2743bd);})[_0xb0b9('0x20')](function(_0xaed38e){_0x29d8f2[_0xb0b9('0x56')]=_0xaed38e;return _0x29d8f2;})[_0xb0b9('0x20')](respondWithFilteredResult(_0x1dfbde,_0x2743bd))[_0xb0b9('0x2b')](handleError(_0x1dfbde,null));};exports[_0xb0b9('0x57')]=function(_0x4fda2a,_0x10cba0){var _0x264938={'raw':![],'where':{'id':_0x4fda2a[_0xb0b9('0x58')]['id']},'include':[{'model':db[_0xb0b9('0x59')],'as':_0xb0b9('0x5a')}]},_0x323f8f={};_0x323f8f['model']=_['keys'](db[_0xb0b9('0x3e')][_0xb0b9('0x3f')]);_0x323f8f['query']=_[_0xb0b9('0x5b')](_0x4fda2a[_0xb0b9('0x43')]);_0x323f8f[_0xb0b9('0x44')]=_[_0xb0b9('0x45')](_0x323f8f['model'],_0x323f8f[_0xb0b9('0x43')]);_0x264938[_0xb0b9('0x46')]=_[_0xb0b9('0x45')](_0x323f8f['model'],qs[_0xb0b9('0x47')](_0x4fda2a[_0xb0b9('0x43')][_0xb0b9('0x47')]));_0x264938[_0xb0b9('0x46')]=_0x264938['attributes'][_0xb0b9('0x48')]?_0x264938[_0xb0b9('0x46')]:_0x323f8f[_0xb0b9('0x42')];if(_0x4fda2a['query'][_0xb0b9('0x54')]){_0x264938[_0xb0b9('0x55')]=[{'all':!![]}];}_0x264938=_['merge']({},_0x264938,_0x4fda2a[_0xb0b9('0x5c')]);return db[_0xb0b9('0x3e')][_0xb0b9('0x5d')](_0x264938)['then'](handleEntityNotFound(_0x10cba0,null))[_0xb0b9('0x20')](respondWithResult(_0x10cba0,null))[_0xb0b9('0x2b')](handleError(_0x10cba0,null));};exports[_0xb0b9('0x5e')]=function(_0x1204ff,_0x4280dd){return db[_0xb0b9('0x3e')][_0xb0b9('0x5e')](_0x1204ff[_0xb0b9('0x5f')],{})[_0xb0b9('0x20')](function(_0x40157c){var _0x24d141=_0x1204ff[_0xb0b9('0x60')][_0xb0b9('0x37')]({'plain':!![]});if(!_0x24d141)throw new Error(_0xb0b9('0x61'));if(_0x24d141[_0xb0b9('0x62')]===_0xb0b9('0x60')){var _0x52676d=_0x40157c[_0xb0b9('0x37')]({'plain':!![]});var _0x429202=_0xb0b9('0x38');return db[_0xb0b9('0x63')][_0xb0b9('0x5d')]({'where':{'name':_0x429202,'userProfileId':_0x24d141[_0xb0b9('0x64')]},'raw':!![]})[_0xb0b9('0x20')](function(_0x3cdaf7){if(_0x3cdaf7&&_0x3cdaf7[_0xb0b9('0x65')]===0x0){return db[_0xb0b9('0x66')]['create']({'name':_0x52676d[_0xb0b9('0x3b')],'resourceId':_0x52676d['id'],'type':_0x3cdaf7[_0xb0b9('0x3b')],'sectionId':_0x3cdaf7['id']},{})[_0xb0b9('0x20')](function(){return _0x40157c;});}else{return _0x40157c;}})[_0xb0b9('0x2b')](function(_0x7cdf2a){logger['error'](_0xb0b9('0x67'),_0x7cdf2a);throw _0x7cdf2a;});}return _0x40157c;})[_0xb0b9('0x20')](respondWithResult(_0x4280dd,0xc9))[_0xb0b9('0x2b')](handleError(_0x4280dd,null));};exports['update']=function(_0x230647,_0x49e6be){if(_0x230647[_0xb0b9('0x5f')]['id']){delete _0x230647[_0xb0b9('0x5f')]['id'];}return db[_0xb0b9('0x3e')][_0xb0b9('0x5d')]({'where':{'id':_0x230647['params']['id']},'include':[{'model':db[_0xb0b9('0x59')],'as':_0xb0b9('0x5a')}]})[_0xb0b9('0x20')](handleEntityNotFound(_0x49e6be,null))['then'](saveUpdates(_0x230647[_0xb0b9('0x5f')],null))[_0xb0b9('0x20')](respondWithResult(_0x49e6be,null))[_0xb0b9('0x2b')](handleError(_0x49e6be,null));};exports[_0xb0b9('0x39')]=function(_0x93e1ce,_0x18ff84){return db['OpenchannelAccount'][_0xb0b9('0x5d')]({'where':{'id':_0x93e1ce[_0xb0b9('0x58')]['id']}})[_0xb0b9('0x20')](handleEntityNotFound(_0x18ff84,null))['then'](removeEntity(_0x18ff84,null))['catch'](handleError(_0x18ff84,null));};exports[_0xb0b9('0x68')]=function(_0x1a925a,_0x237406){return db['OpenchannelAccount'][_0xb0b9('0x68')]()[_0xb0b9('0x20')](respondWithResult(_0x237406,null))[_0xb0b9('0x2b')](handleError(_0x237406,null));};exports[_0xb0b9('0x69')]=function(_0x33488f,_0x405a2a,_0x2650b6){if(_0x33488f[_0xb0b9('0x5f')]['id']){delete _0x33488f['body']['id'];}return db[_0xb0b9('0x3e')]['find']({'where':{'id':_0x33488f[_0xb0b9('0x58')]['id']}})[_0xb0b9('0x20')](handleEntityNotFound(_0x405a2a,null))[_0xb0b9('0x20')](function(_0x96bde3){if(_0x96bde3){_0x33488f[_0xb0b9('0x5f')][_0xb0b9('0x6a')]=_0x96bde3['id'];return db[_0xb0b9('0x6b')][_0xb0b9('0x5e')](_0x33488f[_0xb0b9('0x5f')]);}})['then'](respondWithResult(_0x405a2a,null))['catch'](handleError(_0x405a2a,null));};exports['getDispositions']=function(_0x53f16e,_0x15b9f5,_0x42d99d){var _0x185dd6={'raw':![],'where':{}};var _0x9b6b90={};var _0x2907ed={'count':0x0,'rows':[]};return db[_0xb0b9('0x3e')][_0xb0b9('0x6c')]({'where':{'id':_0x53f16e[_0xb0b9('0x58')]['id']}})['then'](handleEntityNotFound(_0x15b9f5,null))[_0xb0b9('0x20')](function(_0x116335){if(_0x116335){_0x9b6b90[_0xb0b9('0x42')]=_[_0xb0b9('0x5b')](db[_0xb0b9('0x6b')][_0xb0b9('0x3f')]);_0x9b6b90['query']=_[_0xb0b9('0x5b')](_0x53f16e[_0xb0b9('0x43')]);_0x9b6b90['filters']=_['intersection'](_0x9b6b90[_0xb0b9('0x42')],_0x9b6b90[_0xb0b9('0x43')]);_0x185dd6[_0xb0b9('0x46')]=_[_0xb0b9('0x45')](_0x9b6b90[_0xb0b9('0x42')],qs[_0xb0b9('0x47')](_0x53f16e[_0xb0b9('0x43')]['fields']));_0x185dd6[_0xb0b9('0x46')]=_0x185dd6['attributes']['length']?_0x185dd6[_0xb0b9('0x46')]:_0x9b6b90['model'];if(!_0x53f16e['query'][_0xb0b9('0x49')](_0xb0b9('0x4a'))){_0x185dd6[_0xb0b9('0x32')]=qs[_0xb0b9('0x32')](_0x53f16e[_0xb0b9('0x43')]['limit']);_0x185dd6[_0xb0b9('0x30')]=qs[_0xb0b9('0x30')](_0x53f16e[_0xb0b9('0x43')][_0xb0b9('0x30')]);}_0x185dd6[_0xb0b9('0x4b')]=qs['sort'](_0x53f16e[_0xb0b9('0x43')]['sort']);_0x185dd6[_0xb0b9('0x4d')]=qs[_0xb0b9('0x44')](_[_0xb0b9('0x4e')](_0x53f16e[_0xb0b9('0x43')],_0x9b6b90[_0xb0b9('0x44')]));_0x185dd6[_0xb0b9('0x4d')]['OpenchannelAccountId']=_0x116335['id'];if(_0x53f16e[_0xb0b9('0x43')][_0xb0b9('0x4f')]){_0x185dd6[_0xb0b9('0x4d')]=_['merge'](_0x185dd6[_0xb0b9('0x4d')],{'$or':_[_0xb0b9('0x3d')](_0x185dd6['attributes'],function(_0x534c0b){var _0x9a398e={};_0x9a398e[_0x534c0b]={'$like':'%'+_0x53f16e[_0xb0b9('0x43')][_0xb0b9('0x4f')]+'%'};return _0x9a398e;})});}_0x185dd6=_[_0xb0b9('0x52')]({},_0x185dd6,_0x53f16e[_0xb0b9('0x5c')]);return db[_0xb0b9('0x6b')][_0xb0b9('0x53')]({'where':_0x185dd6['where']})[_0xb0b9('0x20')](function(_0x460631){_0x2907ed[_0xb0b9('0x53')]=_0x460631;if(_0x53f16e[_0xb0b9('0x43')][_0xb0b9('0x54')]){_0x185dd6[_0xb0b9('0x55')]=[{'all':!![]}];}return db[_0xb0b9('0x6b')][_0xb0b9('0x6d')](_0x185dd6);})['then'](function(_0x4245ad){_0x2907ed[_0xb0b9('0x56')]=_0x4245ad;return _0x2907ed;});}})[_0xb0b9('0x20')](respondWithFilteredResult(_0x15b9f5,_0x185dd6))[_0xb0b9('0x2b')](handleError(_0x15b9f5,null));};exports[_0xb0b9('0x6e')]=function(_0x119025,_0x3f3432,_0x94bb86){return db['OpenchannelAccount']['find']({'where':{'id':_0x119025[_0xb0b9('0x58')]['id']}})[_0xb0b9('0x20')](handleEntityNotFound(_0x3f3432,null))[_0xb0b9('0x20')](function(_0x53b39a){if(_0x53b39a){return _0x53b39a[_0xb0b9('0x6e')](_0x119025['query'][_0xb0b9('0x6f')]);}})[_0xb0b9('0x20')](respondWithStatusCode(_0x3f3432,null))['catch'](handleError(_0x3f3432,null));};exports[_0xb0b9('0x70')]=function(_0x4a28aa,_0x3855f6,_0x10ed9c){if(_0x4a28aa[_0xb0b9('0x5f')]['id']){delete _0x4a28aa['body']['id'];}return db[_0xb0b9('0x3e')][_0xb0b9('0x5d')]({'where':{'id':_0x4a28aa[_0xb0b9('0x58')]['id']}})['then'](handleEntityNotFound(_0x3855f6,null))[_0xb0b9('0x20')](function(_0x2a43ec){if(_0x2a43ec){_0x4a28aa[_0xb0b9('0x5f')][_0xb0b9('0x6a')]=_0x2a43ec['id'];return db[_0xb0b9('0x71')][_0xb0b9('0x5e')](_0x4a28aa[_0xb0b9('0x5f')]);}})['then'](respondWithResult(_0x3855f6,null))[_0xb0b9('0x2b')](handleError(_0x3855f6,null));};exports['getAnswers']=function(_0x106f0a,_0x13c70d,_0x449cb6){var _0x1c0b4b={'raw':![],'where':{}};var _0x45fda1={};var _0x48bbfd={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xb0b9('0x6c')]({'where':{'id':_0x106f0a[_0xb0b9('0x58')]['id']}})[_0xb0b9('0x20')](handleEntityNotFound(_0x13c70d,null))[_0xb0b9('0x20')](function(_0x20307d){if(_0x20307d){_0x45fda1[_0xb0b9('0x42')]=_[_0xb0b9('0x5b')](db[_0xb0b9('0x71')][_0xb0b9('0x3f')]);_0x45fda1['query']=_[_0xb0b9('0x5b')](_0x106f0a['query']);_0x45fda1['filters']=_['intersection'](_0x45fda1['model'],_0x45fda1['query']);_0x1c0b4b['attributes']=_[_0xb0b9('0x45')](_0x45fda1[_0xb0b9('0x42')],qs[_0xb0b9('0x47')](_0x106f0a['query']['fields']));_0x1c0b4b['attributes']=_0x1c0b4b[_0xb0b9('0x46')][_0xb0b9('0x48')]?_0x1c0b4b[_0xb0b9('0x46')]:_0x45fda1[_0xb0b9('0x42')];if(!_0x106f0a[_0xb0b9('0x43')][_0xb0b9('0x49')](_0xb0b9('0x4a'))){_0x1c0b4b[_0xb0b9('0x32')]=qs[_0xb0b9('0x32')](_0x106f0a[_0xb0b9('0x43')][_0xb0b9('0x32')]);_0x1c0b4b[_0xb0b9('0x30')]=qs[_0xb0b9('0x30')](_0x106f0a[_0xb0b9('0x43')][_0xb0b9('0x30')]);}_0x1c0b4b[_0xb0b9('0x4b')]=qs[_0xb0b9('0x4c')](_0x106f0a['query'][_0xb0b9('0x4c')]);_0x1c0b4b[_0xb0b9('0x4d')]=qs[_0xb0b9('0x44')](_[_0xb0b9('0x4e')](_0x106f0a['query'],_0x45fda1['filters']));_0x1c0b4b[_0xb0b9('0x4d')][_0xb0b9('0x6a')]=_0x20307d['id'];if(_0x106f0a[_0xb0b9('0x43')][_0xb0b9('0x4f')]){_0x1c0b4b[_0xb0b9('0x4d')]=_[_0xb0b9('0x52')](_0x1c0b4b[_0xb0b9('0x4d')],{'$or':_[_0xb0b9('0x3d')](_0x1c0b4b[_0xb0b9('0x46')],function(_0x4b3ea9){var _0xd14949={};_0xd14949[_0x4b3ea9]={'$like':'%'+_0x106f0a[_0xb0b9('0x43')]['filter']+'%'};return _0xd14949;})});}_0x1c0b4b=_[_0xb0b9('0x52')]({},_0x1c0b4b,_0x106f0a[_0xb0b9('0x5c')]);return db[_0xb0b9('0x71')][_0xb0b9('0x53')]({'where':_0x1c0b4b[_0xb0b9('0x4d')]})[_0xb0b9('0x20')](function(_0x3d90b7){_0x48bbfd['count']=_0x3d90b7;if(_0x106f0a['query'][_0xb0b9('0x54')]){_0x1c0b4b['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xb0b9('0x6d')](_0x1c0b4b);})['then'](function(_0x3169ae){_0x48bbfd['rows']=_0x3169ae;return _0x48bbfd;});}})['then'](respondWithFilteredResult(_0x13c70d,_0x1c0b4b))[_0xb0b9('0x2b')](handleError(_0x13c70d,null));};exports[_0xb0b9('0x72')]=function(_0x496fda,_0x3205bc,_0x27b308){return db['OpenchannelAccount'][_0xb0b9('0x5d')]({'where':{'id':_0x496fda[_0xb0b9('0x58')]['id']}})[_0xb0b9('0x20')](handleEntityNotFound(_0x3205bc,null))[_0xb0b9('0x20')](function(_0x27da72){if(_0x27da72){return _0x27da72['removeAnswers'](_0x496fda[_0xb0b9('0x43')][_0xb0b9('0x6f')]);}})['then'](respondWithStatusCode(_0x3205bc,null))['catch'](handleError(_0x3205bc,null));};exports['notify']=function(_0x4a7462,_0x4fa4c7,_0x1ae0ba){var _0x3b228f={'body':_0x4a7462[_0xb0b9('0x5f')],'channel':_0xb0b9('0x73')};var _0x297781=[];var _0x161e71=[];var _0x440fe0={};var _0x522cf7=![];return db[_0xb0b9('0x74')]['describe']()[_0xb0b9('0x20')](function(_0x441fa9){if(!_0x441fa9){throw new db[(_0xb0b9('0x75'))][(_0xb0b9('0x76'))](_0xb0b9('0x77'));}_0x297781=_[_0xb0b9('0x78')](_[_0xb0b9('0x5b')](_0x441fa9),[_0xb0b9('0x79'),_0xb0b9('0x7a')]);_0x161e71=_[_0xb0b9('0x78')](_[_0xb0b9('0x5b')](_0x441fa9),[_0xb0b9('0x79'),_0xb0b9('0x7a'),_0xb0b9('0x7b'),_0xb0b9('0x7c')]);if(_0x4a7462[_0xb0b9('0x5f')]['id']){delete _0x4a7462[_0xb0b9('0x5f')]['id'];}if(_[_0xb0b9('0x7d')](_0x4a7462['body'][_0xb0b9('0x7e')])){throw new db[(_0xb0b9('0x75'))]['ValidationError'](_0xb0b9('0x7f'));}if(_[_0xb0b9('0x7d')](_0x4a7462['body']['body'])||_0x4a7462[_0xb0b9('0x5f')][_0xb0b9('0x5f')]===''){throw new db[(_0xb0b9('0x75'))][(_0xb0b9('0x76'))](_0xb0b9('0x80'));}if(_[_0xb0b9('0x7d')](_0x4a7462[_0xb0b9('0x5f')]['mapKey'])){throw new db[(_0xb0b9('0x75'))][(_0xb0b9('0x76'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x161e71);}if(!_[_0xb0b9('0x81')](_0x161e71,_0x4a7462[_0xb0b9('0x5f')]['mapKey'])){throw new db[(_0xb0b9('0x75'))]['ValidationError'](_0xb0b9('0x82')+_0x161e71);}_0x440fe0[_0x4a7462[_0xb0b9('0x5f')][_0xb0b9('0x83')]]=_0x4a7462[_0xb0b9('0x5f')]['from'];})[_0xb0b9('0x20')](function(){return db[_0xb0b9('0x3e')]['find']({'where':{'id':_0x4a7462[_0xb0b9('0x58')]['id']},'include':[{'model':db[_0xb0b9('0x84')],'as':'List','include':[{'model':db[_0xb0b9('0x74')],'as':_0xb0b9('0x85'),'where':_0x440fe0,'limit':0x1,'order':[[_0xb0b9('0x7a'),'DESC']]}]},{'model':db[_0xb0b9('0x86')],'as':_0xb0b9('0x87')}]});})[_0xb0b9('0x20')](handleEntityNotFound(_0x4fa4c7,null))[_0xb0b9('0x20')](function(_0x11afe2){if(_0x11afe2&&_0x11afe2['List']){_0x3b228f[_0xb0b9('0x88')]=_0x11afe2;_0x3b228f[_0xb0b9('0x89')]=_0x11afe2[_0xb0b9('0x87')];_0x3b228f[_0xb0b9('0x8a')]=_0x11afe2[_0xb0b9('0x8b')];_0x3b228f[_0xb0b9('0x89')]=_[_0xb0b9('0x8c')](_0x3b228f[_0xb0b9('0x89')],[_0xb0b9('0x8d')],[_0xb0b9('0x8e')]);if(_0x3b228f[_0xb0b9('0x88')][_0xb0b9('0x87')]){delete _0x3b228f[_0xb0b9('0x88')][_0xb0b9('0x87')];}if(_0x3b228f[_0xb0b9('0x88')][_0xb0b9('0x8b')]&&_0x3b228f['account']['List'][_0xb0b9('0x85')][_0xb0b9('0x48')]){return _0x3b228f[_0xb0b9('0x88')][_0xb0b9('0x8b')][_0xb0b9('0x85')][0x0];}var _0x239d57=_[_0xb0b9('0x17')](_0x4a7462[_0xb0b9('0x5f')],{'firstName':_0x4a7462['body']['from'],'ListId':_0x11afe2[_0xb0b9('0x7c')]});_0x239d57[_0x4a7462[_0xb0b9('0x5f')][_0xb0b9('0x83')]]=_0x4a7462[_0xb0b9('0x5f')][_0xb0b9('0x7e')];return db[_0xb0b9('0x74')][_0xb0b9('0x5e')](_0x239d57,{'fields':_0x297781,'raw':!![]});}})[_0xb0b9('0x20')](handleEntityNotFound(_0x4fa4c7,null))[_0xb0b9('0x20')](function(_0x265d5a){_0x3b228f[_0xb0b9('0x8f')]=_0x265d5a;if(_0x265d5a){var _0xcf05ee={'ContactId':_0x265d5a['id'],'OpenchannelAccountId':_0x4a7462[_0xb0b9('0x58')]['id'],'from':(_0x265d5a['firstName']||'')+'\x20'+(_0x265d5a[_0xb0b9('0x90')]||'')};var _0x2a20d8={'OpenchannelAccountId':_0x4a7462[_0xb0b9('0x58')]['id'],'closed':![]};if(_0x4a7462[_0xb0b9('0x5f')]['threadId']){_0x2a20d8[_0xb0b9('0x91')]=_0x4a7462[_0xb0b9('0x5f')][_0xb0b9('0x91')];return db[_0xb0b9('0x92')][_0xb0b9('0x5d')]({'where':_0x2a20d8})[_0xb0b9('0x20')](function(_0x3f3ce4){if(_0x3f3ce4){return[_0x3f3ce4,![]];}_0xcf05ee[_0xb0b9('0x91')]=_0x4a7462[_0xb0b9('0x5f')][_0xb0b9('0x91')];_0xcf05ee['externalUrl']=_0x4a7462[_0xb0b9('0x5f')][_0xb0b9('0x93')];return db['OpenchannelInteraction']['create'](_0xcf05ee)['then'](function(_0x5192d5){return[_0x5192d5,!![]];});});}else{_0x2a20d8[_0xb0b9('0x91')]=null;}_0x2a20d8[_0xb0b9('0x94')]=_0x265d5a['id'];return db[_0xb0b9('0x92')][_0xb0b9('0x5d')]({'where':_0x2a20d8})[_0xb0b9('0x20')](function(_0x5d3b0f){if(_0x5d3b0f){return[_0x5d3b0f,![]];}return db['OpenchannelInteraction'][_0xb0b9('0x5e')](_0xcf05ee)[_0xb0b9('0x20')](function(_0x5d38e8){return[_0x5d38e8,!![]];});});}})[_0xb0b9('0x95')](function(_0x524756,_0x237d2e){if(_0x524756){_0x522cf7=_0x237d2e;if(!_0x237d2e){var _0x2e1c35={'from':(_0x3b228f['contact'][_0xb0b9('0x96')]||'')+'\x20'+(_0x3b228f[_0xb0b9('0x8f')][_0xb0b9('0x90')]||'')};if(_0x4a7462['body'][_0xb0b9('0x91')]&&_0x4a7462[_0xb0b9('0x5f')]['messageId']&&_0x4a7462[_0xb0b9('0x5f')][_0xb0b9('0x91')]!=_0x4a7462[_0xb0b9('0x5f')][_0xb0b9('0x97')]){_0x2e1c35[_0xb0b9('0x91')]=_0x4a7462[_0xb0b9('0x5f')][_0xb0b9('0x97')];}return _0x524756[_0xb0b9('0x98')](_0x2e1c35);}else{return _0x524756;}}})[_0xb0b9('0x20')](function(_0x5313fb){_0x3b228f[_0xb0b9('0x99')]=_0x5313fb[_0xb0b9('0x37')]({'plain':!![]});_0x3b228f[_0xb0b9('0x99')]['created']=_0x522cf7;if(_0x3b228f[_0xb0b9('0x99')][_0xb0b9('0x9a')]){if(_0x3b228f[_0xb0b9('0x88')][_0xb0b9('0x9b')]){_0x3b228f[_0xb0b9('0x89')][_0xb0b9('0x9c')]({'id':0x0,'priority':_0x3b228f['applications'][_0xb0b9('0x48')]+0x1,'app':_0xb0b9('0x9d'),'appdata':_0xb0b9('0x9e'),'interval':_0xb0b9('0x9f')});}}return db[_0xb0b9('0xa0')][_0xb0b9('0x5e')]({'body':_0x4a7462[_0xb0b9('0x5f')]['body'],'OpenchannelAccountId':_0x4a7462['params']['id'],'OpenchannelInteractionId':_0x5313fb['id'],'direction':'in','ContactId':_0x3b228f['contact']['id'],'AttachmentId':_0x4a7462[_0xb0b9('0x5f')][_0xb0b9('0xa1')]});})[_0xb0b9('0x20')](function(_0x1f4b96){_0x3b228f['message']=_0x1f4b96;if(!_0x3b228f[_0xb0b9('0x99')]['UserId'])return;return db['User'][_0xb0b9('0x5d')]({'attributes':['id',_0xb0b9('0x3b')],'where':{'id':_0x3b228f[_0xb0b9('0x99')][_0xb0b9('0xa2')]}});})[_0xb0b9('0x20')](function(_0x10b9a9){if(_0x10b9a9){_0x3b228f[_0xb0b9('0x89')][_0xb0b9('0xa3')]({'id':0x0,'priority':0x0,'app':_0xb0b9('0xa4'),'appdata':_0x10b9a9['name']+','+(_0x3b228f[_0xb0b9('0x88')][_0xb0b9('0xa5')]||0xa),'interval':_0xb0b9('0x9f')});}if(!_0x3b228f['interaction'][_0xb0b9('0xa6')])return;return db['OpenchannelQueue'][_0xb0b9('0x5d')]({'attributes':['id',_0xb0b9('0x3b')],'where':{'id':_0x3b228f[_0xb0b9('0x99')][_0xb0b9('0xa6')]}});})['then'](function(_0x255b8a){if(_0x255b8a){_0x3b228f['applications'][_0xb0b9('0xa3')]({'id':0x0,'priority':0x1,'app':_0xb0b9('0xa7'),'appdata':_0x255b8a[_0xb0b9('0x3b')]+','+(_0x3b228f[_0xb0b9('0x88')][_0xb0b9('0xa8')]||0x12c),'interval':_0xb0b9('0x9f')});}return respondWithRpcPromise('Start',_0xb0b9('0xa9'),_0x3b228f);})[_0xb0b9('0x20')](function(_0x55ef30){respondWithRpcPromise(_0xb0b9('0xaa'),'EventManager',{'event':_0xb0b9('0xab'),'message':_0x55ef30},client9002);return _0x55ef30;})[_0xb0b9('0x20')](respondWithResult(_0x4fa4c7,null))['catch'](handleError(_0x4fa4c7,null));};exports['addApplications']=function(_0x374659,_0xd4564c){var _0x3c1a27=_0x374659[_0xb0b9('0x58')]['id'];var _0xddde4=_0x374659[_0xb0b9('0x5f')];var _0x4c0814=0xc8;var _0xa85c63=null;return db[_0xb0b9('0xac')]['transaction']({'isolationLevel':db['sequelize'][_0xb0b9('0xad')][_0xb0b9('0xae')][_0xb0b9('0xaf')]},function(_0x5a17b1){return db[_0xb0b9('0x3e')][_0xb0b9('0x6c')]({'where':{'id':_0x3c1a27},'transaction':_0x5a17b1})[_0xb0b9('0x20')](function(_0x24dc96){if(_0x24dc96){return db[_0xb0b9('0x86')]['destroy']({'where':{'OpenchannelAccountId':_0x3c1a27},'transaction':_0x5a17b1})[_0xb0b9('0x20')](function(){var _0x241868=_['map'](_0xddde4,function(_0x369981){_0x369981['OpenchannelAccountId']=_0x3c1a27;return _0x369981;});return db['OpenchannelApplication'][_0xb0b9('0xb0')](_0x241868,{'transaction':_0x5a17b1});});}else{_0x4c0814=0x194;_0xa85c63=[];}});})[_0xb0b9('0x20')](function(){if(_0x4c0814!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x3c1a27},'order':_0xb0b9('0x8d')})[_0xb0b9('0x20')](function(_0x35dfac){_0xa85c63=_0x35dfac;});}})[_0xb0b9('0x2b')](function(_0x112461){_0x4c0814=0x1f4;logger[_0xb0b9('0x27')](_0x112461[_0xb0b9('0x3a')]);if(_0x112461['name']){delete _0x112461[_0xb0b9('0x3b')];}_0xa85c63=_0x112461;})[_0xb0b9('0xb1')](function(){if(_0xa85c63===null){_0xd4564c['sendStatus'](_0x4c0814);}else{if(_0x4c0814===0x1f4){_0xd4564c[_0xb0b9('0x2d')](_0x4c0814)[_0xb0b9('0xb2')](_0xa85c63);}else{_0xd4564c[_0xb0b9('0x2d')](_0x4c0814)[_0xb0b9('0x2f')](_0xa85c63);}}});};exports['getApplications']=function(_0x3156d9,_0x2a7da1,_0x56493e){var _0x54f649={};var _0x131517={};var _0x4b8692;var _0x494c53;return db[_0xb0b9('0x3e')][_0xb0b9('0x6c')]({'where':{'id':_0x3156d9[_0xb0b9('0x58')]['id']}})[_0xb0b9('0x20')](handleEntityNotFound(_0x2a7da1,null))[_0xb0b9('0x20')](function(_0xc21608){if(_0xc21608){_0x4b8692=_0xc21608;_0x131517[_0xb0b9('0x42')]=_[_0xb0b9('0x5b')](db[_0xb0b9('0x86')][_0xb0b9('0x3f')]);_0x131517[_0xb0b9('0x43')]=_[_0xb0b9('0x5b')](_0x3156d9['query']);_0x131517['filters']=_['intersection'](_0x131517[_0xb0b9('0x42')],_0x131517[_0xb0b9('0x43')]);_0x54f649[_0xb0b9('0x46')]=_['intersection'](_0x131517['model'],qs[_0xb0b9('0x47')](_0x3156d9[_0xb0b9('0x43')][_0xb0b9('0x47')]));_0x54f649[_0xb0b9('0x46')]=_0x54f649[_0xb0b9('0x46')][_0xb0b9('0x48')]?_0x54f649[_0xb0b9('0x46')]:_0x131517[_0xb0b9('0x42')];_0x54f649['order']=qs[_0xb0b9('0x4c')](_0x3156d9[_0xb0b9('0x43')][_0xb0b9('0x4c')]);_0x54f649[_0xb0b9('0x4d')]=qs[_0xb0b9('0x44')](_[_0xb0b9('0x4e')](_0x3156d9[_0xb0b9('0x43')],_0x131517[_0xb0b9('0x44')]));if(_0x3156d9['query'][_0xb0b9('0x4f')]){_0x54f649[_0xb0b9('0x4d')]=_['merge'](_0x54f649['where'],{'$or':_[_0xb0b9('0x3d')](_0x54f649[_0xb0b9('0x46')],function(_0x30bb47){var _0x3f5cbd={};_0x3f5cbd[_0x30bb47]={'$like':'%'+_0x3156d9['query'][_0xb0b9('0x4f')]+'%'};return _0x3f5cbd;})});}_0x54f649=_['merge']({},_0x54f649,_0x3156d9[_0xb0b9('0x5c')]);return _0x4b8692['getApplications'](_0x54f649);}})[_0xb0b9('0x20')](function(_0xcd9c91){if(_0xcd9c91){_0x494c53=_0xcd9c91['length'];if(!_0x3156d9['query'][_0xb0b9('0x49')](_0xb0b9('0x4a'))){_0x54f649[_0xb0b9('0x32')]=qs[_0xb0b9('0x32')](_0x3156d9[_0xb0b9('0x43')]['limit']);_0x54f649[_0xb0b9('0x30')]=qs[_0xb0b9('0x30')](_0x3156d9[_0xb0b9('0x43')][_0xb0b9('0x30')]);}return _0x4b8692[_0xb0b9('0xb3')](_0x54f649);}})['then'](function(_0x1368b9){if(_0x1368b9){return _0x1368b9?{'count':_0x494c53,'rows':_0x1368b9}:null;}})[_0xb0b9('0x20')](respondWithResult(_0x2a7da1,null))['catch'](handleError(_0x2a7da1,null));};exports[_0xb0b9('0xb4')]=function(_0x4b129d,_0x41a2a3,_0x492abb){var _0x4b8018={'raw':![],'where':{}};var _0x22e324={};var _0x1903b0={'count':0x0,'rows':[]};return db[_0xb0b9('0x3e')][_0xb0b9('0x6c')]({'where':{'id':_0x4b129d[_0xb0b9('0x58')]['id']}})[_0xb0b9('0x20')](handleEntityNotFound(_0x41a2a3,null))[_0xb0b9('0x20')](function(_0x1ee5f9){if(_0x1ee5f9){_0x22e324[_0xb0b9('0x42')]=_['keys'](db[_0xb0b9('0x92')][_0xb0b9('0x3f')]);_0x22e324['query']=_[_0xb0b9('0x5b')](_0x4b129d[_0xb0b9('0x43')]);_0x22e324['filters']=_[_0xb0b9('0x45')](_0x22e324['model'],_0x22e324['query']);_0x4b8018['attributes']=_[_0xb0b9('0x45')](_0x22e324[_0xb0b9('0x42')],qs['fields'](_0x4b129d[_0xb0b9('0x43')][_0xb0b9('0x47')]));_0x4b8018[_0xb0b9('0x46')]=_0x4b8018['attributes'][_0xb0b9('0x48')]?_0x4b8018[_0xb0b9('0x46')]:_0x22e324[_0xb0b9('0x42')];if(!_0x4b129d[_0xb0b9('0x43')][_0xb0b9('0x49')]('nolimit')){_0x4b8018[_0xb0b9('0x32')]=qs[_0xb0b9('0x32')](_0x4b129d[_0xb0b9('0x43')][_0xb0b9('0x32')]);_0x4b8018[_0xb0b9('0x30')]=qs[_0xb0b9('0x30')](_0x4b129d[_0xb0b9('0x43')][_0xb0b9('0x30')]);}_0x4b8018[_0xb0b9('0x4b')]=qs[_0xb0b9('0x4c')](_0x4b129d['query'][_0xb0b9('0x4c')]);_0x4b8018['where']=qs['filters'](_['pick'](_0x4b129d[_0xb0b9('0x43')],_0x22e324[_0xb0b9('0x44')]));_0x4b8018[_0xb0b9('0x4d')][_0xb0b9('0x6a')]=_0x1ee5f9['id'];if(_0x4b129d[_0xb0b9('0x43')][_0xb0b9('0x4f')]){_0x4b8018['where']=_[_0xb0b9('0x52')](_0x4b8018[_0xb0b9('0x4d')],{'$or':_[_0xb0b9('0x3d')](_0x4b8018[_0xb0b9('0x46')],function(_0x3b4bd){var _0x12d2f0={};_0x12d2f0[_0x3b4bd]={'$like':'%'+_0x4b129d[_0xb0b9('0x43')]['filter']+'%'};return _0x12d2f0;})});}_0x4b8018=_['merge']({},_0x4b8018,_0x4b129d[_0xb0b9('0x5c')]);return db[_0xb0b9('0x92')][_0xb0b9('0x53')]({'where':_0x4b8018[_0xb0b9('0x4d')]})[_0xb0b9('0x20')](function(_0x222eff){_0x1903b0[_0xb0b9('0x53')]=_0x222eff;if(_0x4b129d[_0xb0b9('0x43')][_0xb0b9('0x54')]){_0x4b8018[_0xb0b9('0x55')]=[{'model':db[_0xb0b9('0x74')],'as':_0xb0b9('0xb5'),'required':![]},{'model':db[_0xb0b9('0xb6')],'as':'Owner','attributes':[_0xb0b9('0x3b'),_0xb0b9('0xb7'),_0xb0b9('0xb8')],'required':![]},{'model':db[_0xb0b9('0xb9')],'as':_0xb0b9('0xba'),'attributes':['id',_0xb0b9('0x3b'),'color'],'where':_0x4b129d[_0xb0b9('0x43')][_0xb0b9('0xbb')]?{'id':_0x4b129d[_0xb0b9('0x43')][_0xb0b9('0xbb')]}:undefined,'required':_0x4b129d[_0xb0b9('0x43')][_0xb0b9('0xbb')]?!![]:![]}];}return db[_0xb0b9('0x92')][_0xb0b9('0x6d')](_0x4b8018);})[_0xb0b9('0x20')](function(_0x66f37c){_0x1903b0[_0xb0b9('0x56')]=_0x66f37c;return _0x1903b0;});}})[_0xb0b9('0x20')](respondWithFilteredResult(_0x41a2a3,_0x4b8018))[_0xb0b9('0x2b')](handleError(_0x41a2a3,null));};exports[_0xb0b9('0xbc')]=function(_0x11aab5,_0x3185ef,_0xc7b78a){return db[_0xb0b9('0x3e')][_0xb0b9('0x5d')]({'where':{'id':_0x11aab5[_0xb0b9('0x58')]['id']}})[_0xb0b9('0x20')](handleEntityNotFound(_0x3185ef,null))['then'](function(_0x404f5f){if(_0x404f5f){return _0x404f5f[_0xb0b9('0xbc')](_0x11aab5[_0xb0b9('0x5f')][_0xb0b9('0x6f')],_[_0xb0b9('0xbd')](_0x11aab5[_0xb0b9('0x5f')],[_0xb0b9('0x6f'),'id'])||{})[_0xb0b9('0x95')](function(_0x5c44b3){for(var _0x4f39c7=0x0;_0x4f39c7<_0x11aab5[_0xb0b9('0x5f')][_0xb0b9('0x6f')]['length'];_0x4f39c7+=0x1){socket['emit'](_0xb0b9('0xbe'),{'UserId':Number(_0x11aab5['body'][_0xb0b9('0x6f')][_0x4f39c7]),'OpenchannelAccountId':Number(_0x11aab5['params']['id'])});}return _0x5c44b3;});}})[_0xb0b9('0x20')](respondWithResult(_0x3185ef,null))['catch'](handleError(_0x3185ef,null));};exports[_0xb0b9('0xbf')]=function(_0x5d6dae,_0x51c067,_0x38b7f4){return db['OpenchannelAccount'][_0xb0b9('0x5d')]({'where':{'id':_0x5d6dae['params']['id']}})['then'](handleEntityNotFound(_0x51c067,null))['then'](function(_0x20b944){if(_0x20b944){return _0x20b944['removeAgents'](_0x5d6dae[_0xb0b9('0x43')][_0xb0b9('0x6f')])[_0xb0b9('0x20')](function(){if(_[_0xb0b9('0xc0')](_0x5d6dae[_0xb0b9('0x43')]['ids'])){for(var _0x15b06b=0x0;_0x15b06b<_0x5d6dae['query'][_0xb0b9('0x6f')]['length'];_0x15b06b+=0x1){socket['emit'](_0xb0b9('0xc1'),{'UserId':Number(_0x5d6dae['query'][_0xb0b9('0x6f')][_0x15b06b]),'OpenchannelAccountId':Number(_0x5d6dae[_0xb0b9('0x58')]['id'])});}}else{socket[_0xb0b9('0xc2')](_0xb0b9('0xc1'),{'UserId':Number(_0x5d6dae['query']['ids']),'OpenchannelAccountId':Number(_0x5d6dae['params']['id'])});}});}})[_0xb0b9('0x20')](respondWithStatusCode(_0x51c067,null))[_0xb0b9('0x2b')](handleError(_0x51c067,null));};exports[_0xb0b9('0xc3')]=function(_0x323f78,_0x15a70f,_0x3b277c){var _0x2ba3bc={};var _0x4c6886={};var _0x5b238e;var _0x495c96;return db[_0xb0b9('0x3e')][_0xb0b9('0x6c')]({'where':{'id':_0x323f78[_0xb0b9('0x58')]['id']}})['then'](handleEntityNotFound(_0x15a70f,null))['then'](function(_0x92da37){if(_0x92da37){_0x5b238e=_0x92da37;_0x4c6886[_0xb0b9('0x42')]=_['keys'](db['User'][_0xb0b9('0x3f')]);_0x4c6886['query']=_['keys'](_0x323f78['query']);_0x4c6886[_0xb0b9('0x44')]=_[_0xb0b9('0x45')](_0x4c6886['model'],_0x4c6886[_0xb0b9('0x43')]);_0x2ba3bc['attributes']=_[_0xb0b9('0x45')](_0x4c6886['model'],qs['fields'](_0x323f78[_0xb0b9('0x43')]['fields']));_0x2ba3bc['attributes']=_0x2ba3bc[_0xb0b9('0x46')][_0xb0b9('0x48')]?_0x2ba3bc[_0xb0b9('0x46')]:_0x4c6886[_0xb0b9('0x42')];_0x2ba3bc['order']=qs[_0xb0b9('0x4c')](_0x323f78[_0xb0b9('0x43')]['sort']);_0x2ba3bc[_0xb0b9('0x4d')]=qs[_0xb0b9('0x44')](_[_0xb0b9('0x4e')](_0x323f78[_0xb0b9('0x43')],_0x4c6886[_0xb0b9('0x44')]));if(_0x323f78[_0xb0b9('0x43')]['filter']){_0x2ba3bc['where']=_[_0xb0b9('0x52')](_0x2ba3bc[_0xb0b9('0x4d')],{'$or':_['map'](_0x2ba3bc[_0xb0b9('0x46')],function(_0x2d1bb8){var _0x3f175b={};_0x3f175b[_0x2d1bb8]={'$like':'%'+_0x323f78[_0xb0b9('0x43')]['filter']+'%'};return _0x3f175b;})});}_0x2ba3bc=_[_0xb0b9('0x52')]({},_0x2ba3bc,_0x323f78['options']);return _0x5b238e[_0xb0b9('0xc3')](_0x2ba3bc);}})[_0xb0b9('0x20')](function(_0x565dea){if(_0x565dea){_0x495c96=_0x565dea[_0xb0b9('0x48')];if(!_0x323f78[_0xb0b9('0x43')][_0xb0b9('0x49')]('nolimit')){_0x2ba3bc[_0xb0b9('0x32')]=qs[_0xb0b9('0x32')](_0x323f78[_0xb0b9('0x43')][_0xb0b9('0x32')]);_0x2ba3bc[_0xb0b9('0x30')]=qs['offset'](_0x323f78['query'][_0xb0b9('0x30')]);}return _0x5b238e[_0xb0b9('0xc3')](_0x2ba3bc);}})['then'](function(_0x2ed72a){if(_0x2ed72a){return _0x2ed72a?{'count':_0x495c96,'rows':_0x2ed72a}:null;}})['then'](respondWithResult(_0x15a70f,null))[_0xb0b9('0x2b')](handleError(_0x15a70f,null));};exports[_0xb0b9('0xb2')]=function(_0x51eb6d,_0x5b25e4,_0x16accd){var _0x5462b9,_0x3dabd2,_0x442dc7;if(_['isNil'](_0x51eb6d[_0xb0b9('0x5f')][_0xb0b9('0x5f')])||_0x51eb6d[_0xb0b9('0x5f')][_0xb0b9('0x5f')]===''){throw new db['Sequelize'][(_0xb0b9('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb0b9('0x7d')](_0x51eb6d['body']['to'])){}_0x5462b9=_0x51eb6d['body']['to'];return db['OpenchannelAccount'][_0xb0b9('0x6c')]({'where':{'id':_0x51eb6d['params']['id']}})[_0xb0b9('0x20')](handleEntityNotFound(_0x5b25e4,null))[_0xb0b9('0x20')](function(_0x4a8435){if(_0x4a8435){return db[_0xb0b9('0x3e')][_0xb0b9('0x5d')]({'where':{'id':_0x4a8435['id']},'include':[{'model':db['CmList'],'as':_0xb0b9('0x8b'),'include':[{'model':db['CmContact'],'as':_0xb0b9('0x85'),'where':{[_0x4a8435['mapKey']]:_0x5462b9},'limit':0x1,'order':[[_0xb0b9('0x7a'),_0xb0b9('0xc4')]]}]}]})[_0xb0b9('0x20')](handleEntityNotFound(_0x5b25e4,null))['then'](function(_0xae9e2c){if(_0xae9e2c&&_0xae9e2c[_0xb0b9('0x8b')]){_0x3dabd2=_0xae9e2c[_0xb0b9('0x37')]({'plain':!![]});if(_0x3dabd2[_0xb0b9('0x8b')]&&_0x3dabd2['List'][_0xb0b9('0x85')]['length']){return _0x3dabd2[_0xb0b9('0x8b')]['Contacts'][0x0];}return db['CmContact']['create'](_['defaults'](_0x51eb6d[_0xb0b9('0x5f')],{'firstName':_0x5462b9,[_0xae9e2c['mapKey']]:_0x5462b9,'phone':_0x5462b9,'ListId':_0x3dabd2[_0xb0b9('0x7c')]}));}})['then'](handleEntityNotFound(_0x5b25e4,null))['then'](function(_0x118cd3){if(_0x118cd3){_0x442dc7=_0x118cd3;return db[_0xb0b9('0x92')][_0xb0b9('0x5d')]({'where':{'ContactId':_0x442dc7['id'],'closed':![],'OpenchannelAccountId':_0x3dabd2['id']}})[_0xb0b9('0x20')](function(_0x152d12){if(_0x152d12){return[_0x152d12,![]];}return db[_0xb0b9('0x92')]['create']({'UserId':_0x51eb6d[_0xb0b9('0x60')]['id'],'ContactId':_0x442dc7['id'],'OpenchannelAccountId':_0x3dabd2['id'],'lastMsgDirection':_0xb0b9('0xc5'),'firstMsgDirection':_0xb0b9('0xc5'),'Messages':[_[_0xb0b9('0x52')](_0x51eb6d[_0xb0b9('0x5f')],{'read':![],'body':_0x51eb6d[_0xb0b9('0x5f')][_0xb0b9('0x5f')],'OpenchannelAccountId':_0x3dabd2['id'],'UserId':_0x51eb6d[_0xb0b9('0x60')]['id'],'ContactId':_0x442dc7['id']})]},{'include':[{'model':db[_0xb0b9('0xa0')],'as':'Messages'}]})[_0xb0b9('0x20')](function(_0x5ca68b){return[_0x5ca68b,!![]];});});}})[_0xb0b9('0x95')](function(_0x55d828,_0x141a0e){if(_0x141a0e){return _0x55d828;}return db[_0xb0b9('0xa0')][_0xb0b9('0x5e')](_[_0xb0b9('0x52')](_0x51eb6d[_0xb0b9('0x5f')],{'read':![],'body':_0x51eb6d[_0xb0b9('0x5f')][_0xb0b9('0x5f')],'OpenchannelAccountId':_0x3dabd2['id'],'OpenchannelInteractionId':_0x55d828['id'],'UserId':_0x51eb6d[_0xb0b9('0x60')]['id'],'ContactId':_0x442dc7['id']}))[_0xb0b9('0x20')](function(_0x48b312){_0x55d828['dataValues'][_0xb0b9('0xc6')]=[];_0x55d828[_0xb0b9('0xc7')][_0xb0b9('0xc6')][_0xb0b9('0x9c')](_0x48b312[_0xb0b9('0xc7')]);return _0x55d828;});});}})['then'](respondWithResult(_0x5b25e4,null))['catch'](handleError(_0x5b25e4,null));}; \ No newline at end of file +var _0x27a0=['userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','error','message','info','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','OpenchannelAccounts','end','name','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','notify','openchannel','ValidationError','difference','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','DESC','OpenchannelApplication','Applications','account','applications','orderBy','priority','asc','Contacts','from','CmContact','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','push','close','OpenchannelMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','queueId','OpenchannelQueue','queue','Start','EventManager','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','stack','finally','send','getApplications','getInteractions','Contact','fullname','internal','Tags','color','tag','addAgents','omit'];(function(_0x5bde1d,_0x4a6359){var _0x4d8808=function(_0x6e4704){while(--_0x6e4704){_0x5bde1d['push'](_0x5bde1d['shift']());}};_0x4d8808(++_0x4a6359);}(_0x27a0,0xbf));var _0x027a=function(_0x432cd2,_0x22f9ac){_0x432cd2=_0x432cd2-0x0;var _0x354d8e=_0x27a0[_0x432cd2];return _0x354d8e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x027a('0x0'));var zipdir=require(_0x027a('0x1'));var jsonpatch=require(_0x027a('0x2'));var rp=require(_0x027a('0x3'));var moment=require(_0x027a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x027a('0x5'));var csv=require(_0x027a('0x6'));var ejs=require(_0x027a('0x7'));var fs=require('fs');var fs_extra=require(_0x027a('0x8'));var _=require(_0x027a('0x9'));var squel=require(_0x027a('0xa'));var crypto=require('crypto');var jsforce=require(_0x027a('0xb'));var deskjs=require(_0x027a('0xc'));var toCsv=require(_0x027a('0x6'));var querystring=require('querystring');var Papa=require(_0x027a('0xd'));var Redis=require(_0x027a('0xe'));var authService=require(_0x027a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x027a('0x10'));var hardwareService=require(_0x027a('0x11'));var logger=require(_0x027a('0x12'))(_0x027a('0x13'));var utils=require(_0x027a('0x14'));var config=require(_0x027a('0x15'));var licenseUtil=require(_0x027a('0x16'));var db=require(_0x027a('0x17'))['db'];config[_0x027a('0x18')]=_[_0x027a('0x19')](config[_0x027a('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x027a('0x1a'))(new Redis(config[_0x027a('0x18')]));require(_0x027a('0x1b'))[_0x027a('0x1c')](socket);var jayson=require(_0x027a('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x027a('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b3870,_0x559d13,_0x432007,_0x5a1224){return new BPromise(function(_0x4dc3ab,_0x47ceb7){var _0x588f53=_0x5a1224||client;return _0x588f53[_0x027a('0x1f')](_0x2b3870,_0x432007)[_0x027a('0x20')](function(_0x1fb40b){logger['info'](_0x027a('0x21'),_0x559d13,_0x027a('0x22'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x559d13,_0x027a('0x22'),JSON['stringify'](_0x1fb40b));if(_0x1fb40b[_0x027a('0x23')]){if(_0x1fb40b['error']['code']===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x559d13,_0x1fb40b[_0x027a('0x23')][_0x027a('0x24')]);return _0x47ceb7(_0x1fb40b[_0x027a('0x23')][_0x027a('0x24')]);}logger['error'](_0x027a('0x21'),_0x559d13,_0x1fb40b[_0x027a('0x23')][_0x027a('0x24')]);return _0x4dc3ab(_0x1fb40b[_0x027a('0x23')][_0x027a('0x24')]);}else{logger[_0x027a('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x559d13,_0x027a('0x22'));_0x4dc3ab(_0x1fb40b['result'][_0x027a('0x24')]);}})[_0x027a('0x26')](function(_0x1b1a13){logger[_0x027a('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x559d13,_0x1b1a13);_0x47ceb7(_0x1b1a13);});});}function respondWithStatusCode(_0x559381,_0x18458f){_0x18458f=_0x18458f||0xcc;return function(_0xcc7562){if(_0xcc7562){return _0x559381[_0x027a('0x27')](_0x18458f);}return _0x559381[_0x027a('0x28')](_0x18458f)['end']();};}function respondWithResult(_0x1b5325,_0x55a8cd){_0x55a8cd=_0x55a8cd||0xc8;return function(_0x953887){if(_0x953887){return _0x1b5325['status'](_0x55a8cd)[_0x027a('0x29')](_0x953887);}};}function respondWithFilteredResult(_0x4d5a25,_0x578ea5){return function(_0x31385d){if(_0x31385d){var _0x5782ac=typeof _0x578ea5['offset']===_0x027a('0x2a')&&typeof _0x578ea5['limit']===_0x027a('0x2a');var _0x47c57a=_0x31385d[_0x027a('0x2b')];var _0xc99acc=_0x5782ac?0x0:_0x578ea5['offset'];var _0xe4ea7d=_0x5782ac?_0x31385d['count']:_0x578ea5[_0x027a('0x2c')]+_0x578ea5[_0x027a('0x2d')];var _0x9e0106;if(_0xe4ea7d>=_0x47c57a){_0xe4ea7d=_0x47c57a;_0x9e0106=0xc8;}else{_0x9e0106=0xce;}_0x4d5a25[_0x027a('0x28')](_0x9e0106);return _0x4d5a25[_0x027a('0x2e')](_0x027a('0x2f'),_0xc99acc+'-'+_0xe4ea7d+'/'+_0x47c57a)['json'](_0x31385d);}return null;};}function patchUpdates(_0x3926e8){return function(_0x592350){try{jsonpatch[_0x027a('0x30')](_0x592350,_0x3926e8,!![]);}catch(_0x55d8c5){return BPromise[_0x027a('0x31')](_0x55d8c5);}return _0x592350[_0x027a('0x32')]();};}function saveUpdates(_0x44a10c,_0x307e3c){return function(_0x17f376){if(_0x17f376){return _0x17f376['update'](_0x44a10c)[_0x027a('0x20')](function(_0x26e716){return _0x26e716;});}return null;};}function removeEntity(_0xf89ec4,_0x2aefb7){return function(_0x14cb87){if(_0x14cb87){return _0x14cb87[_0x027a('0x33')]()[_0x027a('0x20')](function(){var _0xd09e6=_0x14cb87[_0x027a('0x34')]({'plain':!![]});var _0x28c008=_0x027a('0x35');return db['UserProfileResource'][_0x027a('0x33')]({'where':{'type':_0x28c008,'resourceId':_0xd09e6['id']}})[_0x027a('0x20')](function(){return _0x14cb87;});})[_0x027a('0x20')](function(){_0xf89ec4[_0x027a('0x28')](0xcc)[_0x027a('0x36')]();});}};}function handleEntityNotFound(_0x163dce,_0x2378b9){return function(_0x48d60b){if(!_0x48d60b){_0x163dce[_0x027a('0x27')](0x194);}return _0x48d60b;};}function handleError(_0x280f46,_0xb646de){_0xb646de=_0xb646de||0x1f4;return function(_0x5e9130){logger[_0x027a('0x23')](_0x5e9130['stack']);if(_0x5e9130[_0x027a('0x37')]){delete _0x5e9130[_0x027a('0x37')];}_0x280f46[_0x027a('0x28')](_0xb646de)['send'](_0x5e9130);};}exports['index']=function(_0x32a44e,_0x2eea3b){var _0x5830f6={'include':[{'model':db[_0x027a('0x38')],'as':_0x027a('0x39')}]},_0x3d36b8={},_0x10ff49={'count':0x0,'rows':[]};var _0x30e5b2=_[_0x027a('0x3a')](db[_0x027a('0x3b')][_0x027a('0x3c')],function(_0x19fc25){return{'name':_0x19fc25[_0x027a('0x3d')],'type':_0x19fc25[_0x027a('0x3e')][_0x027a('0x3f')]};});_0x3d36b8[_0x027a('0x40')]=_[_0x027a('0x3a')](_0x30e5b2,_0x027a('0x37'));_0x3d36b8[_0x027a('0x41')]=_[_0x027a('0x42')](_0x32a44e['query']);_0x3d36b8[_0x027a('0x43')]=_[_0x027a('0x44')](_0x3d36b8[_0x027a('0x40')],_0x3d36b8[_0x027a('0x41')]);_0x5830f6[_0x027a('0x45')]=_[_0x027a('0x44')](_0x3d36b8['model'],qs[_0x027a('0x46')](_0x32a44e[_0x027a('0x41')]['fields']));_0x5830f6[_0x027a('0x45')]=_0x5830f6['attributes']['length']?_0x5830f6[_0x027a('0x45')]:_0x3d36b8['model'];if(!_0x32a44e[_0x027a('0x41')][_0x027a('0x47')](_0x027a('0x48'))){_0x5830f6[_0x027a('0x2d')]=qs[_0x027a('0x2d')](_0x32a44e['query'][_0x027a('0x2d')]);_0x5830f6[_0x027a('0x2c')]=qs[_0x027a('0x2c')](_0x32a44e['query']['offset']);}_0x5830f6['order']=qs['sort'](_0x32a44e[_0x027a('0x41')][_0x027a('0x49')]);_0x5830f6[_0x027a('0x4a')]=qs[_0x027a('0x43')](_[_0x027a('0x4b')](_0x32a44e[_0x027a('0x41')],_0x3d36b8['filters']),_0x30e5b2);if(_0x32a44e['query'][_0x027a('0x4c')]){_0x5830f6[_0x027a('0x4a')]=_[_0x027a('0x4d')](_0x5830f6[_0x027a('0x4a')],{'$or':_[_0x027a('0x3a')](_0x30e5b2,function(_0x6ea84b){if(_0x6ea84b[_0x027a('0x3e')]!==_0x027a('0x4e')){var _0x1fb7ee={};_0x1fb7ee[_0x6ea84b['name']]={'$like':'%'+_0x32a44e[_0x027a('0x41')][_0x027a('0x4c')]+'%'};return _0x1fb7ee;}})});}_0x5830f6=_[_0x027a('0x4d')]({},_0x5830f6,_0x32a44e[_0x027a('0x4f')]);var _0xa3a68d={'where':_0x5830f6[_0x027a('0x4a')]};return db[_0x027a('0x3b')][_0x027a('0x2b')](_0xa3a68d)['then'](function(_0x2e2b76){_0x10ff49[_0x027a('0x2b')]=_0x2e2b76;if(_0x32a44e['query'][_0x027a('0x50')]){_0x5830f6[_0x027a('0x51')]=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0x5830f6);})['then'](function(_0x37048b){_0x10ff49['rows']=_0x37048b;return _0x10ff49;})[_0x027a('0x20')](respondWithFilteredResult(_0x2eea3b,_0x5830f6))['catch'](handleError(_0x2eea3b,null));};exports['show']=function(_0x53dec5,_0x56ef4a){var _0xa75e3a={'raw':![],'where':{'id':_0x53dec5['params']['id']},'include':[{'model':db['Pause'],'as':_0x027a('0x39')}]},_0x352479={};_0x352479[_0x027a('0x40')]=_[_0x027a('0x42')](db[_0x027a('0x3b')]['rawAttributes']);_0x352479[_0x027a('0x41')]=_['keys'](_0x53dec5[_0x027a('0x41')]);_0x352479[_0x027a('0x43')]=_[_0x027a('0x44')](_0x352479[_0x027a('0x40')],_0x352479[_0x027a('0x41')]);_0xa75e3a[_0x027a('0x45')]=_[_0x027a('0x44')](_0x352479[_0x027a('0x40')],qs['fields'](_0x53dec5[_0x027a('0x41')][_0x027a('0x46')]));_0xa75e3a[_0x027a('0x45')]=_0xa75e3a[_0x027a('0x45')][_0x027a('0x52')]?_0xa75e3a[_0x027a('0x45')]:_0x352479[_0x027a('0x40')];if(_0x53dec5['query'][_0x027a('0x50')]){_0xa75e3a[_0x027a('0x51')]=[{'all':!![]}];}_0xa75e3a=_[_0x027a('0x4d')]({},_0xa75e3a,_0x53dec5[_0x027a('0x4f')]);return db[_0x027a('0x3b')][_0x027a('0x53')](_0xa75e3a)[_0x027a('0x20')](handleEntityNotFound(_0x56ef4a,null))[_0x027a('0x20')](respondWithResult(_0x56ef4a,null))[_0x027a('0x26')](handleError(_0x56ef4a,null));};exports[_0x027a('0x54')]=function(_0x3da285,_0x840903){return db[_0x027a('0x3b')][_0x027a('0x54')](_0x3da285[_0x027a('0x55')],{})['then'](function(_0x13f9b9){var _0x3ed56f=_0x3da285[_0x027a('0x56')][_0x027a('0x34')]({'plain':!![]});if(!_0x3ed56f)throw new Error(_0x027a('0x57'));if(_0x3ed56f[_0x027a('0x58')]===_0x027a('0x56')){var _0x23e9cf=_0x13f9b9[_0x027a('0x34')]({'plain':!![]});var _0x514c34='OpenchannelAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x514c34,'userProfileId':_0x3ed56f[_0x027a('0x59')]},'raw':!![]})[_0x027a('0x20')](function(_0x20918e){if(_0x20918e&&_0x20918e[_0x027a('0x5a')]===0x0){return db[_0x027a('0x5b')]['create']({'name':_0x23e9cf['name'],'resourceId':_0x23e9cf['id'],'type':_0x20918e[_0x027a('0x37')],'sectionId':_0x20918e['id']},{})['then'](function(){return _0x13f9b9;});}else{return _0x13f9b9;}})['catch'](function(_0x364a8b){logger[_0x027a('0x23')](_0x027a('0x5c'),_0x364a8b);throw _0x364a8b;});}return _0x13f9b9;})[_0x027a('0x20')](respondWithResult(_0x840903,0xc9))[_0x027a('0x26')](handleError(_0x840903,null));};exports[_0x027a('0x5d')]=function(_0xc28a,_0x3d0e4c){if(_0xc28a[_0x027a('0x55')]['id']){delete _0xc28a['body']['id'];}return db[_0x027a('0x3b')][_0x027a('0x53')]({'where':{'id':_0xc28a[_0x027a('0x5e')]['id']},'include':[{'model':db[_0x027a('0x38')],'as':_0x027a('0x39')}]})[_0x027a('0x20')](handleEntityNotFound(_0x3d0e4c,null))[_0x027a('0x20')](saveUpdates(_0xc28a[_0x027a('0x55')],null))[_0x027a('0x20')](respondWithResult(_0x3d0e4c,null))[_0x027a('0x26')](handleError(_0x3d0e4c,null));};exports[_0x027a('0x33')]=function(_0x12d17d,_0x2a1f73){return db[_0x027a('0x3b')]['find']({'where':{'id':_0x12d17d[_0x027a('0x5e')]['id']}})[_0x027a('0x20')](handleEntityNotFound(_0x2a1f73,null))[_0x027a('0x20')](removeEntity(_0x2a1f73,null))[_0x027a('0x26')](handleError(_0x2a1f73,null));};exports['describe']=function(_0x4cf78b,_0x2c404a){return db[_0x027a('0x3b')][_0x027a('0x5f')]()[_0x027a('0x20')](respondWithResult(_0x2c404a,null))[_0x027a('0x26')](handleError(_0x2c404a,null));};exports[_0x027a('0x60')]=function(_0x36fd58,_0x2b4cbd,_0x3ae1f3){if(_0x36fd58['body']['id']){delete _0x36fd58[_0x027a('0x55')]['id'];}return db[_0x027a('0x3b')][_0x027a('0x53')]({'where':{'id':_0x36fd58['params']['id']}})[_0x027a('0x20')](handleEntityNotFound(_0x2b4cbd,null))[_0x027a('0x20')](function(_0x52dcab){if(_0x52dcab){_0x36fd58[_0x027a('0x55')][_0x027a('0x61')]=_0x52dcab['id'];return db['Disposition']['create'](_0x36fd58[_0x027a('0x55')]);}})[_0x027a('0x20')](respondWithResult(_0x2b4cbd,null))[_0x027a('0x26')](handleError(_0x2b4cbd,null));};exports[_0x027a('0x62')]=function(_0x58a21e,_0xaa3396,_0x36c707){var _0x146543={'raw':![],'where':{}};var _0x57cce6={};var _0x308da5={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x027a('0x63')]({'where':{'id':_0x58a21e['params']['id']}})[_0x027a('0x20')](handleEntityNotFound(_0xaa3396,null))[_0x027a('0x20')](function(_0x17ef27){if(_0x17ef27){_0x57cce6[_0x027a('0x40')]=_['keys'](db['Disposition']['rawAttributes']);_0x57cce6['query']=_['keys'](_0x58a21e['query']);_0x57cce6['filters']=_[_0x027a('0x44')](_0x57cce6['model'],_0x57cce6[_0x027a('0x41')]);_0x146543['attributes']=_[_0x027a('0x44')](_0x57cce6['model'],qs['fields'](_0x58a21e[_0x027a('0x41')][_0x027a('0x46')]));_0x146543[_0x027a('0x45')]=_0x146543['attributes'][_0x027a('0x52')]?_0x146543['attributes']:_0x57cce6[_0x027a('0x40')];if(!_0x58a21e[_0x027a('0x41')][_0x027a('0x47')]('nolimit')){_0x146543[_0x027a('0x2d')]=qs[_0x027a('0x2d')](_0x58a21e[_0x027a('0x41')][_0x027a('0x2d')]);_0x146543[_0x027a('0x2c')]=qs[_0x027a('0x2c')](_0x58a21e['query'][_0x027a('0x2c')]);}_0x146543['order']=qs[_0x027a('0x49')](_0x58a21e[_0x027a('0x41')][_0x027a('0x49')]);_0x146543[_0x027a('0x4a')]=qs['filters'](_[_0x027a('0x4b')](_0x58a21e[_0x027a('0x41')],_0x57cce6[_0x027a('0x43')]));_0x146543[_0x027a('0x4a')]['OpenchannelAccountId']=_0x17ef27['id'];if(_0x58a21e[_0x027a('0x41')][_0x027a('0x4c')]){_0x146543[_0x027a('0x4a')]=_[_0x027a('0x4d')](_0x146543['where'],{'$or':_[_0x027a('0x3a')](_0x146543[_0x027a('0x45')],function(_0x49ba36){var _0x367a36={};_0x367a36[_0x49ba36]={'$like':'%'+_0x58a21e[_0x027a('0x41')]['filter']+'%'};return _0x367a36;})});}_0x146543=_[_0x027a('0x4d')]({},_0x146543,_0x58a21e[_0x027a('0x4f')]);return db[_0x027a('0x64')][_0x027a('0x2b')]({'where':_0x146543[_0x027a('0x4a')]})[_0x027a('0x20')](function(_0xf2d0d9){_0x308da5['count']=_0xf2d0d9;if(_0x58a21e['query']['includeAll']){_0x146543[_0x027a('0x51')]=[{'all':!![]}];}return db[_0x027a('0x64')][_0x027a('0x65')](_0x146543);})[_0x027a('0x20')](function(_0x2d65a9){_0x308da5[_0x027a('0x66')]=_0x2d65a9;return _0x308da5;});}})['then'](respondWithFilteredResult(_0xaa3396,_0x146543))[_0x027a('0x26')](handleError(_0xaa3396,null));};exports[_0x027a('0x67')]=function(_0x2c9d52,_0x2b17e6,_0x5dc689){return db['OpenchannelAccount'][_0x027a('0x53')]({'where':{'id':_0x2c9d52['params']['id']}})[_0x027a('0x20')](handleEntityNotFound(_0x2b17e6,null))[_0x027a('0x20')](function(_0x5e67f0){if(_0x5e67f0){return _0x5e67f0[_0x027a('0x67')](_0x2c9d52[_0x027a('0x41')][_0x027a('0x68')]);}})[_0x027a('0x20')](respondWithStatusCode(_0x2b17e6,null))[_0x027a('0x26')](handleError(_0x2b17e6,null));};exports[_0x027a('0x69')]=function(_0x3daf40,_0x3af905,_0x3379b2){if(_0x3daf40[_0x027a('0x55')]['id']){delete _0x3daf40[_0x027a('0x55')]['id'];}return db[_0x027a('0x3b')][_0x027a('0x53')]({'where':{'id':_0x3daf40[_0x027a('0x5e')]['id']}})[_0x027a('0x20')](handleEntityNotFound(_0x3af905,null))[_0x027a('0x20')](function(_0x33546d){if(_0x33546d){_0x3daf40['body']['OpenchannelAccountId']=_0x33546d['id'];return db[_0x027a('0x6a')][_0x027a('0x54')](_0x3daf40['body']);}})[_0x027a('0x20')](respondWithResult(_0x3af905,null))[_0x027a('0x26')](handleError(_0x3af905,null));};exports[_0x027a('0x6b')]=function(_0x36bb99,_0x1f2f86,_0x5e1c0c){var _0x39ffe1={'raw':![],'where':{}};var _0x218e4f={};var _0x502265={'count':0x0,'rows':[]};return db[_0x027a('0x3b')][_0x027a('0x63')]({'where':{'id':_0x36bb99['params']['id']}})['then'](handleEntityNotFound(_0x1f2f86,null))[_0x027a('0x20')](function(_0x3a72c0){if(_0x3a72c0){_0x218e4f[_0x027a('0x40')]=_[_0x027a('0x42')](db[_0x027a('0x6a')][_0x027a('0x3c')]);_0x218e4f['query']=_[_0x027a('0x42')](_0x36bb99['query']);_0x218e4f[_0x027a('0x43')]=_[_0x027a('0x44')](_0x218e4f[_0x027a('0x40')],_0x218e4f[_0x027a('0x41')]);_0x39ffe1[_0x027a('0x45')]=_[_0x027a('0x44')](_0x218e4f['model'],qs[_0x027a('0x46')](_0x36bb99[_0x027a('0x41')][_0x027a('0x46')]));_0x39ffe1['attributes']=_0x39ffe1[_0x027a('0x45')][_0x027a('0x52')]?_0x39ffe1[_0x027a('0x45')]:_0x218e4f[_0x027a('0x40')];if(!_0x36bb99['query'][_0x027a('0x47')](_0x027a('0x48'))){_0x39ffe1[_0x027a('0x2d')]=qs[_0x027a('0x2d')](_0x36bb99[_0x027a('0x41')][_0x027a('0x2d')]);_0x39ffe1[_0x027a('0x2c')]=qs['offset'](_0x36bb99[_0x027a('0x41')][_0x027a('0x2c')]);}_0x39ffe1[_0x027a('0x6c')]=qs[_0x027a('0x49')](_0x36bb99[_0x027a('0x41')][_0x027a('0x49')]);_0x39ffe1['where']=qs['filters'](_[_0x027a('0x4b')](_0x36bb99[_0x027a('0x41')],_0x218e4f[_0x027a('0x43')]));_0x39ffe1['where'][_0x027a('0x61')]=_0x3a72c0['id'];if(_0x36bb99[_0x027a('0x41')][_0x027a('0x4c')]){_0x39ffe1[_0x027a('0x4a')]=_[_0x027a('0x4d')](_0x39ffe1[_0x027a('0x4a')],{'$or':_[_0x027a('0x3a')](_0x39ffe1[_0x027a('0x45')],function(_0x199ca4){var _0x4fe569={};_0x4fe569[_0x199ca4]={'$like':'%'+_0x36bb99['query'][_0x027a('0x4c')]+'%'};return _0x4fe569;})});}_0x39ffe1=_[_0x027a('0x4d')]({},_0x39ffe1,_0x36bb99[_0x027a('0x4f')]);return db[_0x027a('0x6a')][_0x027a('0x2b')]({'where':_0x39ffe1[_0x027a('0x4a')]})[_0x027a('0x20')](function(_0x2d7779){_0x502265['count']=_0x2d7779;if(_0x36bb99[_0x027a('0x41')][_0x027a('0x50')]){_0x39ffe1[_0x027a('0x51')]=[{'all':!![]}];}return db[_0x027a('0x6a')][_0x027a('0x65')](_0x39ffe1);})[_0x027a('0x20')](function(_0x44d445){_0x502265[_0x027a('0x66')]=_0x44d445;return _0x502265;});}})['then'](respondWithFilteredResult(_0x1f2f86,_0x39ffe1))[_0x027a('0x26')](handleError(_0x1f2f86,null));};exports[_0x027a('0x6d')]=function(_0x44097c,_0x252123,_0x4da23b){return db[_0x027a('0x3b')][_0x027a('0x53')]({'where':{'id':_0x44097c[_0x027a('0x5e')]['id']}})[_0x027a('0x20')](handleEntityNotFound(_0x252123,null))[_0x027a('0x20')](function(_0xee5a46){if(_0xee5a46){return _0xee5a46['removeAnswers'](_0x44097c[_0x027a('0x41')][_0x027a('0x68')]);}})[_0x027a('0x20')](respondWithStatusCode(_0x252123,null))['catch'](handleError(_0x252123,null));};exports[_0x027a('0x6e')]=function(_0x116478,_0x1b76b5,_0x12ad83){var _0x899c18={'body':_0x116478[_0x027a('0x55')],'channel':_0x027a('0x6f')};var _0x536b8f=[];var _0x502874=[];var _0x1cea2a={};var _0x13c07e=![];return db['CmContact'][_0x027a('0x5f')]()[_0x027a('0x20')](function(_0x22f13c){if(!_0x22f13c){throw new db['Sequelize'][(_0x027a('0x70'))]('no\x20available\x20attributes');}_0x536b8f=_[_0x027a('0x71')](_[_0x027a('0x42')](_0x22f13c),['createdAt',_0x027a('0x72')]);_0x502874=_['difference'](_['keys'](_0x22f13c),['createdAt',_0x027a('0x72'),_0x027a('0x73'),_0x027a('0x74')]);if(_0x116478[_0x027a('0x55')]['id']){delete _0x116478[_0x027a('0x55')]['id'];}if(_[_0x027a('0x75')](_0x116478[_0x027a('0x55')]['from'])){throw new db['Sequelize'][(_0x027a('0x70'))](_0x027a('0x76'));}if(_[_0x027a('0x75')](_0x116478[_0x027a('0x55')]['body'])||_0x116478[_0x027a('0x55')]['body']===''){throw new db[(_0x027a('0x77'))]['ValidationError'](_0x027a('0x78'));}if(_[_0x027a('0x75')](_0x116478[_0x027a('0x55')]['mapKey'])){throw new db[(_0x027a('0x77'))][(_0x027a('0x70'))](_0x027a('0x79')+_0x502874);}if(!_['includes'](_0x502874,_0x116478[_0x027a('0x55')]['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x502874);}_0x1cea2a[_0x116478[_0x027a('0x55')][_0x027a('0x7a')]]=_0x116478[_0x027a('0x55')]['from'];})[_0x027a('0x20')](function(){return db[_0x027a('0x3b')][_0x027a('0x53')]({'where':{'id':_0x116478[_0x027a('0x5e')]['id']},'include':[{'model':db[_0x027a('0x7b')],'as':_0x027a('0x7c'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x1cea2a,'limit':0x1,'order':[[_0x027a('0x72'),_0x027a('0x7d')]]}]},{'model':db[_0x027a('0x7e')],'as':_0x027a('0x7f')}]});})[_0x027a('0x20')](handleEntityNotFound(_0x1b76b5,null))[_0x027a('0x20')](function(_0xba71da){if(_0xba71da&&_0xba71da['List']){_0x899c18[_0x027a('0x80')]=_0xba71da;_0x899c18[_0x027a('0x81')]=_0xba71da[_0x027a('0x7f')];_0x899c18['list']=_0xba71da[_0x027a('0x7c')];_0x899c18[_0x027a('0x81')]=_[_0x027a('0x82')](_0x899c18[_0x027a('0x81')],[_0x027a('0x83')],[_0x027a('0x84')]);if(_0x899c18[_0x027a('0x80')][_0x027a('0x7f')]){delete _0x899c18['account'][_0x027a('0x7f')];}if(_0x899c18[_0x027a('0x80')]['List']&&_0x899c18['account'][_0x027a('0x7c')][_0x027a('0x85')][_0x027a('0x52')]){return _0x899c18[_0x027a('0x80')][_0x027a('0x7c')][_0x027a('0x85')][0x0];}var _0x14207a=_[_0x027a('0x19')](_0x116478[_0x027a('0x55')],{'firstName':_0x116478['body'][_0x027a('0x86')],'ListId':_0xba71da[_0x027a('0x74')]});_0x14207a[_0x116478[_0x027a('0x55')][_0x027a('0x7a')]]=_0x116478['body'][_0x027a('0x86')];return db[_0x027a('0x87')][_0x027a('0x54')](_0x14207a,{'fields':_0x536b8f,'raw':!![]});}})['then'](handleEntityNotFound(_0x1b76b5,null))[_0x027a('0x20')](function(_0x4fec7c){_0x899c18['contact']=_0x4fec7c;if(_0x4fec7c){var _0x1cc826={'ContactId':_0x4fec7c['id'],'OpenchannelAccountId':_0x116478[_0x027a('0x5e')]['id'],'from':(_0x4fec7c['firstName']||'')+'\x20'+(_0x4fec7c['lastName']||'')};var _0x43091c={'OpenchannelAccountId':_0x116478['params']['id'],'closed':![]};if(_0x116478['body'][_0x027a('0x88')]){_0x43091c[_0x027a('0x88')]=_0x116478[_0x027a('0x55')][_0x027a('0x88')];return db[_0x027a('0x89')][_0x027a('0x53')]({'where':_0x43091c})['then'](function(_0x108d76){if(_0x108d76){return[_0x108d76,![]];}_0x1cc826['threadId']=_0x116478[_0x027a('0x55')][_0x027a('0x88')];_0x1cc826[_0x027a('0x8a')]=_0x116478[_0x027a('0x55')][_0x027a('0x8a')];return db[_0x027a('0x89')][_0x027a('0x54')](_0x1cc826)[_0x027a('0x20')](function(_0x1311e0){return[_0x1311e0,!![]];});});}else{_0x43091c[_0x027a('0x88')]=null;}_0x43091c[_0x027a('0x8b')]=_0x4fec7c['id'];return db['OpenchannelInteraction'][_0x027a('0x53')]({'where':_0x43091c})['then'](function(_0x4764a3){if(_0x4764a3){return[_0x4764a3,![]];}return db[_0x027a('0x89')]['create'](_0x1cc826)[_0x027a('0x20')](function(_0x1958dc){return[_0x1958dc,!![]];});});}})[_0x027a('0x8c')](function(_0x128819,_0x492f0f){if(_0x128819){_0x13c07e=_0x492f0f;if(!_0x492f0f){var _0x47c5ab={'from':(_0x899c18[_0x027a('0x8d')]['firstName']||'')+'\x20'+(_0x899c18[_0x027a('0x8d')]['lastName']||'')};if(_0x116478[_0x027a('0x55')]['threadId']&&_0x116478[_0x027a('0x55')][_0x027a('0x8e')]&&_0x116478[_0x027a('0x55')]['threadId']!=_0x116478[_0x027a('0x55')][_0x027a('0x8e')]){_0x47c5ab['threadId']=_0x116478[_0x027a('0x55')][_0x027a('0x8e')];}return _0x128819[_0x027a('0x5d')](_0x47c5ab);}else{return _0x128819;}}})[_0x027a('0x20')](function(_0xe7c5ec){_0x899c18[_0x027a('0x8f')]=_0xe7c5ec[_0x027a('0x34')]({'plain':!![]});_0x899c18[_0x027a('0x8f')]['created']=_0x13c07e;if(_0x899c18['interaction']['created']){if(_0x899c18[_0x027a('0x80')]['autoclose']){_0x899c18[_0x027a('0x81')][_0x027a('0x90')]({'id':0x0,'priority':_0x899c18[_0x027a('0x81')][_0x027a('0x52')]+0x1,'app':_0x027a('0x91'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x027a('0x92')][_0x027a('0x54')]({'body':_0x116478[_0x027a('0x55')]['body'],'OpenchannelAccountId':_0x116478[_0x027a('0x5e')]['id'],'OpenchannelInteractionId':_0xe7c5ec['id'],'direction':'in','ContactId':_0x899c18[_0x027a('0x8d')]['id'],'AttachmentId':_0x116478['body']['AttachmentId']});})[_0x027a('0x20')](function(_0x15684e){_0x899c18['message']=_0x15684e;if(!_0x899c18[_0x027a('0x8f')][_0x027a('0x93')])return;return db[_0x027a('0x94')]['find']({'attributes':['id',_0x027a('0x37')],'where':{'id':_0x899c18[_0x027a('0x8f')][_0x027a('0x93')]}});})[_0x027a('0x20')](function(_0x3d232f){if(_0x3d232f){_0x899c18[_0x027a('0x81')][_0x027a('0x95')]({'id':0x0,'priority':0x0,'app':_0x027a('0x96'),'appdata':_0x3d232f['name']+','+(_0x899c18[_0x027a('0x80')][_0x027a('0x97')]||0xa),'interval':_0x027a('0x98')});}if(!_0x899c18[_0x027a('0x8f')][_0x027a('0x99')])return;return db[_0x027a('0x9a')][_0x027a('0x53')]({'attributes':['id',_0x027a('0x37')],'where':{'id':_0x899c18[_0x027a('0x8f')][_0x027a('0x99')]}});})[_0x027a('0x20')](function(_0x54e589){if(_0x54e589){_0x899c18[_0x027a('0x81')][_0x027a('0x95')]({'id':0x0,'priority':0x1,'app':_0x027a('0x9b'),'appdata':_0x54e589['name']+','+(_0x899c18[_0x027a('0x80')]['waitForTheAssignedQueue']||0x12c),'interval':_0x027a('0x98')});}return respondWithRpcPromise(_0x027a('0x9c'),'startRouting',_0x899c18);})[_0x027a('0x20')](function(_0x1a8a84){respondWithRpcPromise('EventManager',_0x027a('0x9d'),{'event':_0x027a('0x6e'),'message':_0x1a8a84},client9002);return _0x1a8a84;})[_0x027a('0x20')](respondWithResult(_0x1b76b5,null))[_0x027a('0x26')](handleError(_0x1b76b5,null));};exports['addApplications']=function(_0x1e89d3,_0x3f9c2){var _0x264556=_0x1e89d3[_0x027a('0x5e')]['id'];var _0x116144=_0x1e89d3['body'];var _0x155294=0xc8;var _0x5dc900=null;return db[_0x027a('0x9e')][_0x027a('0x9f')]({'isolationLevel':db['sequelize']['Transaction'][_0x027a('0xa0')][_0x027a('0xa1')]},function(_0x393ec6){return db[_0x027a('0x3b')][_0x027a('0x63')]({'where':{'id':_0x264556},'transaction':_0x393ec6})['then'](function(_0x3c58a3){if(_0x3c58a3){return db[_0x027a('0x7e')][_0x027a('0x33')]({'where':{'OpenchannelAccountId':_0x264556},'transaction':_0x393ec6})[_0x027a('0x20')](function(){var _0xee0d85=_[_0x027a('0x3a')](_0x116144,function(_0x33de20){_0x33de20[_0x027a('0x61')]=_0x264556;return _0x33de20;});return db['OpenchannelApplication']['bulkCreate'](_0xee0d85,{'transaction':_0x393ec6});});}else{_0x155294=0x194;_0x5dc900=[];}});})[_0x027a('0x20')](function(){if(_0x155294!==0x194){return db[_0x027a('0x7e')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x264556},'order':_0x027a('0x83')})[_0x027a('0x20')](function(_0x4721e5){_0x5dc900=_0x4721e5;});}})[_0x027a('0x26')](function(_0x37d664){_0x155294=0x1f4;logger[_0x027a('0x23')](_0x37d664[_0x027a('0xa2')]);if(_0x37d664['name']){delete _0x37d664['name'];}_0x5dc900=_0x37d664;})[_0x027a('0xa3')](function(){if(_0x5dc900===null){_0x3f9c2[_0x027a('0x27')](_0x155294);}else{if(_0x155294===0x1f4){_0x3f9c2[_0x027a('0x28')](_0x155294)[_0x027a('0xa4')](_0x5dc900);}else{_0x3f9c2['status'](_0x155294)[_0x027a('0x29')](_0x5dc900);}}});};exports[_0x027a('0xa5')]=function(_0x4b1760,_0x4a83f7,_0x593c58){var _0x17b396={};var _0x3c388e={};var _0x23f46c;var _0x2da72b;return db[_0x027a('0x3b')][_0x027a('0x63')]({'where':{'id':_0x4b1760['params']['id']}})[_0x027a('0x20')](handleEntityNotFound(_0x4a83f7,null))[_0x027a('0x20')](function(_0x34594d){if(_0x34594d){_0x23f46c=_0x34594d;_0x3c388e[_0x027a('0x40')]=_[_0x027a('0x42')](db[_0x027a('0x7e')][_0x027a('0x3c')]);_0x3c388e[_0x027a('0x41')]=_[_0x027a('0x42')](_0x4b1760[_0x027a('0x41')]);_0x3c388e[_0x027a('0x43')]=_[_0x027a('0x44')](_0x3c388e['model'],_0x3c388e[_0x027a('0x41')]);_0x17b396['attributes']=_[_0x027a('0x44')](_0x3c388e[_0x027a('0x40')],qs[_0x027a('0x46')](_0x4b1760[_0x027a('0x41')][_0x027a('0x46')]));_0x17b396[_0x027a('0x45')]=_0x17b396[_0x027a('0x45')]['length']?_0x17b396[_0x027a('0x45')]:_0x3c388e[_0x027a('0x40')];_0x17b396['order']=qs[_0x027a('0x49')](_0x4b1760[_0x027a('0x41')]['sort']);_0x17b396[_0x027a('0x4a')]=qs[_0x027a('0x43')](_[_0x027a('0x4b')](_0x4b1760[_0x027a('0x41')],_0x3c388e[_0x027a('0x43')]));if(_0x4b1760[_0x027a('0x41')][_0x027a('0x4c')]){_0x17b396[_0x027a('0x4a')]=_[_0x027a('0x4d')](_0x17b396[_0x027a('0x4a')],{'$or':_['map'](_0x17b396[_0x027a('0x45')],function(_0x1a7aa0){var _0x24552b={};_0x24552b[_0x1a7aa0]={'$like':'%'+_0x4b1760['query'][_0x027a('0x4c')]+'%'};return _0x24552b;})});}_0x17b396=_[_0x027a('0x4d')]({},_0x17b396,_0x4b1760[_0x027a('0x4f')]);return _0x23f46c[_0x027a('0xa5')](_0x17b396);}})['then'](function(_0x44dea0){if(_0x44dea0){_0x2da72b=_0x44dea0[_0x027a('0x52')];if(!_0x4b1760[_0x027a('0x41')][_0x027a('0x47')](_0x027a('0x48'))){_0x17b396['limit']=qs[_0x027a('0x2d')](_0x4b1760[_0x027a('0x41')][_0x027a('0x2d')]);_0x17b396['offset']=qs[_0x027a('0x2c')](_0x4b1760[_0x027a('0x41')][_0x027a('0x2c')]);}return _0x23f46c[_0x027a('0xa5')](_0x17b396);}})[_0x027a('0x20')](function(_0x10092e){if(_0x10092e){return _0x10092e?{'count':_0x2da72b,'rows':_0x10092e}:null;}})[_0x027a('0x20')](respondWithResult(_0x4a83f7,null))['catch'](handleError(_0x4a83f7,null));};exports[_0x027a('0xa6')]=function(_0x4b8f5d,_0x2e73d6,_0x35f234){var _0x374116={'raw':![],'where':{}};var _0x4f22f6={};var _0x1bcc23={'count':0x0,'rows':[]};return db[_0x027a('0x3b')][_0x027a('0x63')]({'where':{'id':_0x4b8f5d['params']['id']}})[_0x027a('0x20')](handleEntityNotFound(_0x2e73d6,null))[_0x027a('0x20')](function(_0x1a7132){if(_0x1a7132){_0x4f22f6[_0x027a('0x40')]=_[_0x027a('0x42')](db[_0x027a('0x89')]['rawAttributes']);_0x4f22f6['query']=_[_0x027a('0x42')](_0x4b8f5d[_0x027a('0x41')]);_0x4f22f6[_0x027a('0x43')]=_['intersection'](_0x4f22f6['model'],_0x4f22f6['query']);_0x374116['attributes']=_[_0x027a('0x44')](_0x4f22f6[_0x027a('0x40')],qs['fields'](_0x4b8f5d['query'][_0x027a('0x46')]));_0x374116[_0x027a('0x45')]=_0x374116[_0x027a('0x45')][_0x027a('0x52')]?_0x374116[_0x027a('0x45')]:_0x4f22f6[_0x027a('0x40')];if(!_0x4b8f5d[_0x027a('0x41')][_0x027a('0x47')](_0x027a('0x48'))){_0x374116[_0x027a('0x2d')]=qs[_0x027a('0x2d')](_0x4b8f5d[_0x027a('0x41')]['limit']);_0x374116['offset']=qs[_0x027a('0x2c')](_0x4b8f5d[_0x027a('0x41')][_0x027a('0x2c')]);}_0x374116[_0x027a('0x6c')]=qs[_0x027a('0x49')](_0x4b8f5d[_0x027a('0x41')][_0x027a('0x49')]);_0x374116[_0x027a('0x4a')]=qs[_0x027a('0x43')](_['pick'](_0x4b8f5d[_0x027a('0x41')],_0x4f22f6[_0x027a('0x43')]));_0x374116[_0x027a('0x4a')][_0x027a('0x61')]=_0x1a7132['id'];if(_0x4b8f5d[_0x027a('0x41')][_0x027a('0x4c')]){_0x374116[_0x027a('0x4a')]=_[_0x027a('0x4d')](_0x374116[_0x027a('0x4a')],{'$or':_[_0x027a('0x3a')](_0x374116[_0x027a('0x45')],function(_0x41edda){var _0x42e3cd={};_0x42e3cd[_0x41edda]={'$like':'%'+_0x4b8f5d['query'][_0x027a('0x4c')]+'%'};return _0x42e3cd;})});}_0x374116=_['merge']({},_0x374116,_0x4b8f5d['options']);return db[_0x027a('0x89')][_0x027a('0x2b')]({'where':_0x374116[_0x027a('0x4a')]})['then'](function(_0x99dc68){_0x1bcc23[_0x027a('0x2b')]=_0x99dc68;if(_0x4b8f5d['query'][_0x027a('0x50')]){_0x374116['include']=[{'model':db['CmContact'],'as':_0x027a('0xa7'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x027a('0x37'),_0x027a('0xa8'),_0x027a('0xa9')],'required':![]},{'model':db['Tag'],'as':_0x027a('0xaa'),'attributes':['id',_0x027a('0x37'),_0x027a('0xab')],'where':_0x4b8f5d[_0x027a('0x41')][_0x027a('0xac')]?{'id':_0x4b8f5d['query'][_0x027a('0xac')]}:undefined,'required':_0x4b8f5d[_0x027a('0x41')][_0x027a('0xac')]?!![]:![]}];}return db[_0x027a('0x89')][_0x027a('0x65')](_0x374116);})[_0x027a('0x20')](function(_0x537ec5){_0x1bcc23['rows']=_0x537ec5;return _0x1bcc23;});}})[_0x027a('0x20')](respondWithFilteredResult(_0x2e73d6,_0x374116))[_0x027a('0x26')](handleError(_0x2e73d6,null));};exports[_0x027a('0xad')]=function(_0x54fec0,_0xe2d24a,_0x27daa7){return db[_0x027a('0x3b')]['find']({'where':{'id':_0x54fec0[_0x027a('0x5e')]['id']}})[_0x027a('0x20')](handleEntityNotFound(_0xe2d24a,null))[_0x027a('0x20')](function(_0x40b8e4){if(_0x40b8e4){return _0x40b8e4[_0x027a('0xad')](_0x54fec0[_0x027a('0x55')][_0x027a('0x68')],_[_0x027a('0xae')](_0x54fec0[_0x027a('0x55')],['ids','id'])||{})[_0x027a('0x8c')](function(_0x5db4a6){for(var _0x2b4fb6=0x0;_0x2b4fb6<_0x54fec0[_0x027a('0x55')][_0x027a('0x68')]['length'];_0x2b4fb6+=0x1){socket['emit'](_0x027a('0xaf'),{'UserId':Number(_0x54fec0[_0x027a('0x55')][_0x027a('0x68')][_0x2b4fb6]),'OpenchannelAccountId':Number(_0x54fec0['params']['id'])});}return _0x5db4a6;});}})[_0x027a('0x20')](respondWithResult(_0xe2d24a,null))['catch'](handleError(_0xe2d24a,null));};exports[_0x027a('0xb0')]=function(_0x385327,_0x48f205,_0x4d84df){return db['OpenchannelAccount'][_0x027a('0x53')]({'where':{'id':_0x385327['params']['id']}})['then'](handleEntityNotFound(_0x48f205,null))[_0x027a('0x20')](function(_0x511be1){if(_0x511be1){return _0x511be1['removeAgents'](_0x385327[_0x027a('0x41')][_0x027a('0x68')])[_0x027a('0x20')](function(){if(_[_0x027a('0xb1')](_0x385327[_0x027a('0x41')][_0x027a('0x68')])){for(var _0x5cf88c=0x0;_0x5cf88c<_0x385327[_0x027a('0x41')][_0x027a('0x68')][_0x027a('0x52')];_0x5cf88c+=0x1){socket[_0x027a('0xb2')](_0x027a('0xb3'),{'UserId':Number(_0x385327['query'][_0x027a('0x68')][_0x5cf88c]),'OpenchannelAccountId':Number(_0x385327[_0x027a('0x5e')]['id'])});}}else{socket[_0x027a('0xb2')]('userOpenchannelAccount:remove',{'UserId':Number(_0x385327['query'][_0x027a('0x68')]),'OpenchannelAccountId':Number(_0x385327[_0x027a('0x5e')]['id'])});}});}})[_0x027a('0x20')](respondWithStatusCode(_0x48f205,null))[_0x027a('0x26')](handleError(_0x48f205,null));};exports['getAgents']=function(_0x4629e5,_0x301a3c,_0x57b387){var _0x2af719={};var _0x188d0a={};var _0x21dd86;var _0x58a136;return db[_0x027a('0x3b')][_0x027a('0x63')]({'where':{'id':_0x4629e5['params']['id']}})['then'](handleEntityNotFound(_0x301a3c,null))[_0x027a('0x20')](function(_0x50fff6){if(_0x50fff6){_0x21dd86=_0x50fff6;_0x188d0a[_0x027a('0x40')]=_[_0x027a('0x42')](db[_0x027a('0x94')][_0x027a('0x3c')]);_0x188d0a[_0x027a('0x41')]=_['keys'](_0x4629e5[_0x027a('0x41')]);_0x188d0a[_0x027a('0x43')]=_['intersection'](_0x188d0a[_0x027a('0x40')],_0x188d0a[_0x027a('0x41')]);_0x2af719[_0x027a('0x45')]=_['intersection'](_0x188d0a[_0x027a('0x40')],qs[_0x027a('0x46')](_0x4629e5[_0x027a('0x41')][_0x027a('0x46')]));_0x2af719[_0x027a('0x45')]=_0x2af719[_0x027a('0x45')][_0x027a('0x52')]?_0x2af719[_0x027a('0x45')]:_0x188d0a[_0x027a('0x40')];_0x2af719[_0x027a('0x6c')]=qs[_0x027a('0x49')](_0x4629e5['query']['sort']);_0x2af719[_0x027a('0x4a')]=qs[_0x027a('0x43')](_[_0x027a('0x4b')](_0x4629e5[_0x027a('0x41')],_0x188d0a[_0x027a('0x43')]));if(_0x4629e5[_0x027a('0x41')]['filter']){_0x2af719['where']=_[_0x027a('0x4d')](_0x2af719['where'],{'$or':_[_0x027a('0x3a')](_0x2af719[_0x027a('0x45')],function(_0x26e0b4){var _0x3dda8f={};_0x3dda8f[_0x26e0b4]={'$like':'%'+_0x4629e5[_0x027a('0x41')]['filter']+'%'};return _0x3dda8f;})});}_0x2af719=_[_0x027a('0x4d')]({},_0x2af719,_0x4629e5[_0x027a('0x4f')]);return _0x21dd86[_0x027a('0xb4')](_0x2af719);}})[_0x027a('0x20')](function(_0x55c1f2){if(_0x55c1f2){_0x58a136=_0x55c1f2[_0x027a('0x52')];if(!_0x4629e5['query'][_0x027a('0x47')]('nolimit')){_0x2af719[_0x027a('0x2d')]=qs[_0x027a('0x2d')](_0x4629e5[_0x027a('0x41')][_0x027a('0x2d')]);_0x2af719[_0x027a('0x2c')]=qs['offset'](_0x4629e5['query']['offset']);}return _0x21dd86[_0x027a('0xb4')](_0x2af719);}})[_0x027a('0x20')](function(_0x2cd650){if(_0x2cd650){return _0x2cd650?{'count':_0x58a136,'rows':_0x2cd650}:null;}})[_0x027a('0x20')](respondWithResult(_0x301a3c,null))[_0x027a('0x26')](handleError(_0x301a3c,null));};exports[_0x027a('0xa4')]=function(_0x479a16,_0x52a3dd,_0x45dcfb){var _0x5a684d,_0x272fba,_0x513e6f;if(_[_0x027a('0x75')](_0x479a16['body'][_0x027a('0x55')])||_0x479a16[_0x027a('0x55')]['body']===''){throw new db[(_0x027a('0x77'))]['ValidationError'](_0x027a('0x78'));}if(_[_0x027a('0x75')](_0x479a16[_0x027a('0x55')]['to'])){}_0x5a684d=_0x479a16['body']['to'];return db['OpenchannelAccount'][_0x027a('0x63')]({'where':{'id':_0x479a16['params']['id']}})[_0x027a('0x20')](handleEntityNotFound(_0x52a3dd,null))[_0x027a('0x20')](function(_0x32d0de){if(_0x32d0de){return db[_0x027a('0x3b')][_0x027a('0x53')]({'where':{'id':_0x32d0de['id']},'include':[{'model':db[_0x027a('0x7b')],'as':_0x027a('0x7c'),'include':[{'model':db[_0x027a('0x87')],'as':_0x027a('0x85'),'where':{[_0x32d0de['mapKey']]:_0x5a684d},'limit':0x1,'order':[[_0x027a('0x72'),_0x027a('0x7d')]]}]}]})[_0x027a('0x20')](handleEntityNotFound(_0x52a3dd,null))[_0x027a('0x20')](function(_0x216478){if(_0x216478&&_0x216478[_0x027a('0x7c')]){_0x272fba=_0x216478[_0x027a('0x34')]({'plain':!![]});if(_0x272fba[_0x027a('0x7c')]&&_0x272fba[_0x027a('0x7c')][_0x027a('0x85')]['length']){return _0x272fba[_0x027a('0x7c')][_0x027a('0x85')][0x0];}return db[_0x027a('0x87')]['create'](_['defaults'](_0x479a16[_0x027a('0x55')],{'firstName':_0x5a684d,[_0x216478[_0x027a('0x7a')]]:_0x5a684d,'phone':_0x5a684d,'ListId':_0x272fba[_0x027a('0x74')]}));}})['then'](handleEntityNotFound(_0x52a3dd,null))[_0x027a('0x20')](function(_0x17fd16){if(_0x17fd16){_0x513e6f=_0x17fd16;return db[_0x027a('0x89')][_0x027a('0x53')]({'where':{'ContactId':_0x513e6f['id'],'closed':![],'OpenchannelAccountId':_0x272fba['id']}})[_0x027a('0x20')](function(_0x3e38a0){if(_0x3e38a0){return[_0x3e38a0,![]];}return db[_0x027a('0x89')][_0x027a('0x54')]({'UserId':_0x479a16[_0x027a('0x56')]['id'],'ContactId':_0x513e6f['id'],'OpenchannelAccountId':_0x272fba['id'],'lastMsgDirection':'out','firstMsgDirection':'out','Messages':[_[_0x027a('0x4d')](_0x479a16[_0x027a('0x55')],{'read':![],'body':_0x479a16['body'][_0x027a('0x55')],'OpenchannelAccountId':_0x272fba['id'],'UserId':_0x479a16[_0x027a('0x56')]['id'],'ContactId':_0x513e6f['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x027a('0xb5')}]})[_0x027a('0x20')](function(_0x35f27d){return[_0x35f27d,!![]];});});}})[_0x027a('0x8c')](function(_0x5e70d0,_0x1444a9){if(_0x1444a9){return _0x5e70d0;}return db[_0x027a('0x92')][_0x027a('0x54')](_[_0x027a('0x4d')](_0x479a16[_0x027a('0x55')],{'read':![],'body':_0x479a16[_0x027a('0x55')][_0x027a('0x55')],'OpenchannelAccountId':_0x272fba['id'],'OpenchannelInteractionId':_0x5e70d0['id'],'UserId':_0x479a16[_0x027a('0x56')]['id'],'ContactId':_0x513e6f['id']}))[_0x027a('0x20')](function(_0x51484b){_0x5e70d0[_0x027a('0xb6')][_0x027a('0xb5')]=[];_0x5e70d0[_0x027a('0xb6')][_0x027a('0xb5')][_0x027a('0x90')](_0x51484b[_0x027a('0xb6')]);return _0x5e70d0;});});}})[_0x027a('0x20')](respondWithResult(_0x52a3dd,null))[_0x027a('0x26')](handleError(_0x52a3dd,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index cf6d024..f260469 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 _0x96cc=['remove','emit','hook','exports','events','OpenchannelAccount','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96cc,0x16c));var _0xc96c=function(_0x352c80,_0x14de6b){_0x352c80=_0x352c80-0x0;var _0xab091b=_0x96cc[_0x352c80];return _0xab091b;};'use strict';var EventEmitter=require(_0xc96c('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xc96c('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc96c('0x2'),'afterUpdate':_0xc96c('0x3'),'afterDestroy':_0xc96c('0x4')};function emitEvent(_0x421701){return function(_0x71140d,_0x29b6f1,_0x377e6c){OpenchannelAccountEvents[_0xc96c('0x5')](_0x421701+':'+_0x71140d['id'],_0x71140d);OpenchannelAccountEvents[_0xc96c('0x5')](_0x421701,_0x71140d);_0x377e6c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xc96c('0x6')](e,emitEvent(event));}}module[_0xc96c('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xac4a=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','emit','hook','events'];(function(_0x37e116,_0x484d8a){var _0x40bd31=function(_0xf367c4){while(--_0xf367c4){_0x37e116['push'](_0x37e116['shift']());}};_0x40bd31(++_0x484d8a);}(_0xac4a,0x13f));var _0xaac4=function(_0xe90269,_0x2376d5){_0xe90269=_0xe90269-0x0;var _0x291ddc=_0xac4a[_0xe90269];return _0x291ddc;};'use strict';var EventEmitter=require(_0xaac4('0x0'));var OpenchannelAccount=require(_0xaac4('0x1'))['db'][_0xaac4('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xaac4('0x3')](0x0);var events={'afterCreate':_0xaac4('0x4'),'afterUpdate':_0xaac4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x58626e){return function(_0x2af0f6,_0x2a5762,_0x32d34c){OpenchannelAccountEvents['emit'](_0x58626e+':'+_0x2af0f6['id'],_0x2af0f6);OpenchannelAccountEvents[_0xaac4('0x6')](_0x58626e,_0x2af0f6);_0x32d34c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xaac4('0x7')](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 eaacaa2..1bebe78 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(_0x54f5a4,_0x336f39){var _0x4fbe69=function(_0x3f060e){while(--_0x3f060e){_0x54f5a4['push'](_0x54f5a4['shift']());}};_0x4fbe69(++_0x336f39);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0xdb58b2,_0x53f173){var _0x1b91a7=function(_0x30bbca){while(--_0x30bbca){_0xdb58b2['push'](_0xdb58b2['shift']());}};_0x1b91a7(++_0x53f173);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 1a859d7..965ea2f 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 _0x153f=['localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x154756,_0xcbf8a7){var _0x2c249f=function(_0x5d29f0){while(--_0x5d29f0){_0x154756['push'](_0x154756['shift']());}};_0x2c249f(++_0xcbf8a7);}(_0x153f,0x15b));var _0xf153=function(_0x48df07,_0x532caa){_0x48df07=_0x48df07-0x0;var _0x372092=_0x153f[_0x48df07];return _0x372092;};'use strict';var _=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var moment=require(_0xf153('0x2'));var BPromise=require(_0xf153('0x3'));var rs=require(_0xf153('0x4'));var fs=require('fs');var Redis=require(_0xf153('0x5'));var db=require(_0xf153('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf153('0x7'))('rpc');var config=require(_0xf153('0x8'));var jayson=require(_0xf153('0x9'));var client=jayson[_0xf153('0xa')][_0xf153('0xb')]({'port':0x232a});config[_0xf153('0xc')]=_['defaults'](config[_0xf153('0xc')],{'host':_0xf153('0xd'),'port':0x18eb});var socket=require(_0xf153('0xe'))(new Redis(config[_0xf153('0xc')]));require(_0xf153('0xf'))[_0xf153('0x10')](socket);function respondWithRpcPromise(_0x44845c,_0x15a18b,_0x4f84b){return new BPromise(function(_0xeaccb0,_0x5c8ae9){return client[_0xf153('0x11')](_0x44845c,_0x4f84b)[_0xf153('0x12')](function(_0x2bea70){logger['info'](_0xf153('0x13'),_0x15a18b,_0xf153('0x14'));logger[_0xf153('0x15')](_0xf153('0x16'),_0x15a18b,_0xf153('0x14'),JSON[_0xf153('0x17')](_0x2bea70));if(_0x2bea70[_0xf153('0x18')]){if(_0x2bea70[_0xf153('0x18')][_0xf153('0x19')]===0x1f4){logger['error'](_0xf153('0x13'),_0x15a18b,_0x2bea70[_0xf153('0x18')][_0xf153('0x1a')]);return _0x5c8ae9(_0x2bea70[_0xf153('0x18')][_0xf153('0x1a')]);}logger[_0xf153('0x18')](_0xf153('0x13'),_0x15a18b,_0x2bea70[_0xf153('0x18')]['message']);return _0xeaccb0(_0x2bea70[_0xf153('0x18')]['message']);}else{logger[_0xf153('0x1b')](_0xf153('0x13'),_0x15a18b,_0xf153('0x14'));_0xeaccb0(_0x2bea70[_0xf153('0x1c')]['message']);}})[_0xf153('0x1d')](function(_0x19122e){logger[_0xf153('0x18')](_0xf153('0x13'),_0x15a18b,_0x19122e);_0x5c8ae9(_0x19122e);});});} \ No newline at end of file +var _0x2f3a=['http','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x20380e,_0x14d546){var _0x51fa7c=function(_0x4262f0){while(--_0x4262f0){_0x20380e['push'](_0x20380e['shift']());}};_0x51fa7c(++_0x14d546);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x20b7e5,_0x24ef33){_0x20b7e5=_0x20b7e5-0x0;var _0x1ba39b=_0x2f3a[_0x20b7e5];return _0x1ba39b;};'use strict';var _=require(_0xa2f3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa2f3('0x1'));var rs=require(_0xa2f3('0x2'));var fs=require('fs');var Redis=require(_0xa2f3('0x3'));var db=require(_0xa2f3('0x4'))['db'];var utils=require(_0xa2f3('0x5'));var logger=require(_0xa2f3('0x6'))('rpc');var config=require(_0xa2f3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa2f3('0x8')][_0xa2f3('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa2f3('0xa')],{'host':_0xa2f3('0xb'),'port':0x18eb});var socket=require(_0xa2f3('0xc'))(new Redis(config[_0xa2f3('0xa')]));require('./openchannelAccount.socket')[_0xa2f3('0xd')](socket);function respondWithRpcPromise(_0x6373f7,_0x1fce68,_0x41a90c){return new BPromise(function(_0x214f68,_0x55ff83){return client[_0xa2f3('0xe')](_0x6373f7,_0x41a90c)[_0xa2f3('0xf')](function(_0x52aabd){logger[_0xa2f3('0x10')](_0xa2f3('0x11'),_0x1fce68,_0xa2f3('0x12'));logger['debug'](_0xa2f3('0x13'),_0x1fce68,_0xa2f3('0x12'),JSON[_0xa2f3('0x14')](_0x52aabd));if(_0x52aabd[_0xa2f3('0x15')]){if(_0x52aabd[_0xa2f3('0x15')][_0xa2f3('0x16')]===0x1f4){logger[_0xa2f3('0x15')](_0xa2f3('0x11'),_0x1fce68,_0x52aabd[_0xa2f3('0x15')]['message']);return _0x55ff83(_0x52aabd[_0xa2f3('0x15')][_0xa2f3('0x17')]);}logger[_0xa2f3('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x1fce68,_0x52aabd[_0xa2f3('0x15')][_0xa2f3('0x17')]);return _0x214f68(_0x52aabd['error']['message']);}else{logger[_0xa2f3('0x10')](_0xa2f3('0x11'),_0x1fce68,_0xa2f3('0x12'));_0x214f68(_0x52aabd[_0xa2f3('0x18')][_0xa2f3('0x17')]);}})[_0xa2f3('0x19')](function(_0x30be69){logger[_0xa2f3('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x1fce68,_0x30be69);_0x55ff83(_0x30be69);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index eb9f089..ea6109a 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 _0x63bb=['./openchannelAccount.events','save','remove','update','removeListener','register','length','openchannelAccount:'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x63bb,0xf8));var _0xb63b=function(_0x1f83a5,_0x59843f){_0x1f83a5=_0x1f83a5-0x0;var _0x45edf0=_0x63bb[_0x1f83a5];return _0x45edf0;};'use strict';var OpenchannelAccountEvents=require(_0xb63b('0x0'));var events=[_0xb63b('0x1'),_0xb63b('0x2'),_0xb63b('0x3')];function createListener(_0x2b0db5,_0x2ad279){return function(_0x3540f2){_0x2ad279['emit'](_0x2b0db5,_0x3540f2);};}function removeListener(_0x48a423,_0x246da0){return function(){OpenchannelAccountEvents[_0xb63b('0x4')](_0x48a423,_0x246da0);};}exports[_0xb63b('0x5')]=function(_0x22be29){for(var _0x4fc464=0x0,_0x3eb1be=events[_0xb63b('0x6')];_0x4fc464<_0x3eb1be;_0x4fc464++){var _0x2aa873=events[_0x4fc464];var _0x544988=createListener(_0xb63b('0x7')+_0x2aa873,_0x22be29);OpenchannelAccountEvents['on'](_0x2aa873,_0x544988);}}; \ No newline at end of file +var _0xca56=['remove','update','emit','removeListener','register','length','./openchannelAccount.events','save'];(function(_0x56f7e2,_0x145392){var _0x36240b=function(_0x216ff7){while(--_0x216ff7){_0x56f7e2['push'](_0x56f7e2['shift']());}};_0x36240b(++_0x145392);}(_0xca56,0xee));var _0x6ca5=function(_0x50573e,_0x18b553){_0x50573e=_0x50573e-0x0;var _0x2c596f=_0xca56[_0x50573e];return _0x2c596f;};'use strict';var OpenchannelAccountEvents=require(_0x6ca5('0x0'));var events=[_0x6ca5('0x1'),_0x6ca5('0x2'),_0x6ca5('0x3')];function createListener(_0x404fb9,_0x17e955){return function(_0x2f20c2){_0x17e955[_0x6ca5('0x4')](_0x404fb9,_0x2f20c2);};}function removeListener(_0x15105e,_0x5456b0){return function(){OpenchannelAccountEvents[_0x6ca5('0x5')](_0x15105e,_0x5456b0);};}exports[_0x6ca5('0x6')]=function(_0x4440bd){for(var _0x2c078a=0x0,_0x529cbe=events[_0x6ca5('0x7')];_0x2c078a<_0x529cbe;_0x2c078a++){var _0x232b31=events[_0x2c078a];var _0x511b48=createListener('openchannelAccount:'+_0x232b31,_0x4440bd);OpenchannelAccountEvents['on'](_0x232b31,_0x511b48);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index d4b89c5..db0d771 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 _0xccc1=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports'];(function(_0x2212d1,_0x483fc8){var _0x15eec5=function(_0x15e6ac){while(--_0x15e6ac){_0x2212d1['push'](_0x2212d1['shift']());}};_0x15eec5(++_0x483fc8);}(_0xccc1,0x198));var _0x1ccc=function(_0x134827,_0x21f6ed){_0x134827=_0x134827-0x0;var _0x366671=_0xccc1[_0x134827];return _0x366671;};'use strict';var multer=require('multer');var util=require(_0x1ccc('0x0'));var path=require(_0x1ccc('0x1'));var timeout=require(_0x1ccc('0x2'));var express=require('express');var router=express[_0x1ccc('0x3')]();var fs_extra=require(_0x1ccc('0x4'));var auth=require(_0x1ccc('0x5'));var interaction=require(_0x1ccc('0x6'));var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0x1ccc('0x7')]('/',auth[_0x1ccc('0x8')](),controller[_0x1ccc('0x9')]);router['get'](_0x1ccc('0xa'),auth[_0x1ccc('0x8')](),controller[_0x1ccc('0xb')]);router['post']('/',auth[_0x1ccc('0x8')](),controller[_0x1ccc('0xc')]);router[_0x1ccc('0xd')]('/:id',auth[_0x1ccc('0x8')](),controller[_0x1ccc('0xe')]);router[_0x1ccc('0xf')]('/:id',auth[_0x1ccc('0x8')](),controller['destroy']);module[_0x1ccc('0x10')]=router; \ No newline at end of file +var _0x2bcd=['put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','get','/:id','show','post'];(function(_0x130574,_0x54f802){var _0x5a6903=function(_0x52aa07){while(--_0x52aa07){_0x130574['push'](_0x130574['shift']());}};_0x5a6903(++_0x54f802);}(_0x2bcd,0x168));var _0xd2bc=function(_0x2fff6b,_0x29752f){_0x2fff6b=_0x2fff6b-0x0;var _0xc562b2=_0x2bcd[_0x2fff6b];return _0xc562b2;};'use strict';var multer=require(_0xd2bc('0x0'));var util=require(_0xd2bc('0x1'));var path=require(_0xd2bc('0x2'));var timeout=require('connect-timeout');var express=require(_0xd2bc('0x3'));var router=express[_0xd2bc('0x4')]();var fs_extra=require(_0xd2bc('0x5'));var auth=require(_0xd2bc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd2bc('0x7'));var controller=require(_0xd2bc('0x8'));router['get']('/',auth[_0xd2bc('0x9')](),controller['index']);router[_0xd2bc('0xa')](_0xd2bc('0xb'),auth[_0xd2bc('0x9')](),controller[_0xd2bc('0xc')]);router[_0xd2bc('0xd')]('/',auth[_0xd2bc('0x9')](),controller['create']);router[_0xd2bc('0xe')](_0xd2bc('0xb'),auth[_0xd2bc('0x9')](),controller['update']);router['delete']('/:id',auth[_0xd2bc('0x9')](),controller[_0xd2bc('0xf')]);module[_0xd2bc('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 5317217..6f1c5ea 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 _0x1b16=['*,*,*,*','sequelize','exports','noop','TEXT','STRING'];(function(_0x463e5b,_0x52feee){var _0x1b5e35=function(_0x4f2f27){while(--_0x4f2f27){_0x463e5b['push'](_0x463e5b['shift']());}};_0x1b5e35(++_0x52feee);}(_0x1b16,0x7f));var _0x61b1=function(_0x4df71e,_0x2b4d63){_0x4df71e=_0x4df71e-0x0;var _0x45539f=_0x1b16[_0x4df71e];return _0x45539f;};'use strict';var Sequelize=require(_0x61b1('0x0'));module[_0x61b1('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x61b1('0x2')},'appdata':{'type':Sequelize[_0x61b1('0x3')]()},'description':{'type':Sequelize[_0x61b1('0x4')]},'interval':{'type':Sequelize[_0x61b1('0x4')],'defaultValue':_0x61b1('0x5')}}; \ No newline at end of file +var _0x9f05=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x4145a8,_0x55e817){var _0x155db0=function(_0x30ad81){while(--_0x30ad81){_0x4145a8['push'](_0x4145a8['shift']());}};_0x155db0(++_0x55e817);}(_0x9f05,0xf9));var _0x59f0=function(_0x248f49,_0x58ddce){_0x248f49=_0x248f49-0x0;var _0x99cb00=_0x9f05[_0x248f49];return _0x99cb00;};'use strict';var Sequelize=require(_0x59f0('0x0'));module[_0x59f0('0x1')]={'priority':{'type':Sequelize[_0x59f0('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x59f0('0x3')],'allowNull':![],'defaultValue':_0x59f0('0x4')},'appdata':{'type':Sequelize[_0x59f0('0x5')]()},'description':{'type':Sequelize[_0x59f0('0x3')]},'interval':{'type':Sequelize[_0x59f0('0x3')],'defaultValue':_0x59f0('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 195f31d..e2e163e 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 _0x233f=['util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','limit','undefined','count','set','json','apply','reject','update','destroy','then','end','error','stack','index','map','OpenchannelApplication','fieldName','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','name','includeAll','include','rows','catch','show','params','rawAttributes','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x37cc52,_0x459a9b){var _0x2b4a90=function(_0xabcfc7){while(--_0xabcfc7){_0x37cc52['push'](_0x37cc52['shift']());}};_0x2b4a90(++_0x459a9b);}(_0x233f,0x8c));var _0xf233=function(_0x3d51e1,_0x403eb4){_0x3d51e1=_0x3d51e1-0x0;var _0x1f7191=_0x233f[_0x3d51e1];return _0x1f7191;};'use strict';var emlformat=require(_0xf233('0x0'));var rimraf=require(_0xf233('0x1'));var zipdir=require(_0xf233('0x2'));var jsonpatch=require(_0xf233('0x3'));var rp=require(_0xf233('0x4'));var moment=require(_0xf233('0x5'));var BPromise=require(_0xf233('0x6'));var Mustache=require(_0xf233('0x7'));var util=require(_0xf233('0x8'));var path=require(_0xf233('0x9'));var sox=require(_0xf233('0xa'));var csv=require(_0xf233('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf233('0xc'));var squel=require('squel');var crypto=require(_0xf233('0xd'));var jsforce=require(_0xf233('0xe'));var deskjs=require(_0xf233('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf233('0x10'));var Papa=require(_0xf233('0x11'));var Redis=require(_0xf233('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf233('0x13'));var as=require(_0xf233('0x14'));var hardwareService=require(_0xf233('0x15'));var logger=require(_0xf233('0x16'))(_0xf233('0x17'));var utils=require(_0xf233('0x18'));var config=require(_0xf233('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xf233('0x1a'))['db'];function respondWithStatusCode(_0x157449,_0x4d5580){_0x4d5580=_0x4d5580||0xcc;return function(_0x5b8b25){if(_0x5b8b25){return _0x157449['sendStatus'](_0x4d5580);}return _0x157449[_0xf233('0x1b')](_0x4d5580)['end']();};}function respondWithResult(_0x10452c,_0x509283){_0x509283=_0x509283||0xc8;return function(_0x11f544){if(_0x11f544){return _0x10452c['status'](_0x509283)['json'](_0x11f544);}};}function respondWithFilteredResult(_0x3491cc,_0x4bb4b0){return function(_0x4704aa){if(_0x4704aa){var _0x160db8=typeof _0x4bb4b0[_0xf233('0x1c')]==='undefined'&&typeof _0x4bb4b0[_0xf233('0x1d')]===_0xf233('0x1e');var _0x55d4b1=_0x4704aa[_0xf233('0x1f')];var _0x26f779=_0x160db8?0x0:_0x4bb4b0[_0xf233('0x1c')];var _0x54ead1=_0x160db8?_0x4704aa['count']:_0x4bb4b0[_0xf233('0x1c')]+_0x4bb4b0[_0xf233('0x1d')];var _0x398f6b;if(_0x54ead1>=_0x55d4b1){_0x54ead1=_0x55d4b1;_0x398f6b=0xc8;}else{_0x398f6b=0xce;}_0x3491cc[_0xf233('0x1b')](_0x398f6b);return _0x3491cc[_0xf233('0x20')]('Content-Range',_0x26f779+'-'+_0x54ead1+'/'+_0x55d4b1)[_0xf233('0x21')](_0x4704aa);}return null;};}function patchUpdates(_0x5189ad){return function(_0x3c54fc){try{jsonpatch[_0xf233('0x22')](_0x3c54fc,_0x5189ad,!![]);}catch(_0x25eaf2){return BPromise[_0xf233('0x23')](_0x25eaf2);}return _0x3c54fc['save']();};}function saveUpdates(_0x490338,_0x55557a){return function(_0x7f247d){if(_0x7f247d){return _0x7f247d[_0xf233('0x24')](_0x490338)['then'](function(_0xb7d4b2){return _0xb7d4b2;});}return null;};}function removeEntity(_0x3954ab,_0x57b2ef){return function(_0x343cba){if(_0x343cba){return _0x343cba[_0xf233('0x25')]()[_0xf233('0x26')](function(){_0x3954ab['status'](0xcc)[_0xf233('0x27')]();});}};}function handleEntityNotFound(_0x3d0cd6,_0x38fe3c){return function(_0x96ac99){if(!_0x96ac99){_0x3d0cd6['sendStatus'](0x194);}return _0x96ac99;};}function handleError(_0x1b9bd7,_0x3a385d){_0x3a385d=_0x3a385d||0x1f4;return function(_0x379815){logger[_0xf233('0x28')](_0x379815[_0xf233('0x29')]);if(_0x379815['name']){delete _0x379815['name'];}_0x1b9bd7[_0xf233('0x1b')](_0x3a385d)['send'](_0x379815);};}exports[_0xf233('0x2a')]=function(_0x1f344a,_0x3bd22a){var _0x512c78={},_0x59b765={},_0x3d602a={'count':0x0,'rows':[]};var _0x1a0068=_[_0xf233('0x2b')](db[_0xf233('0x2c')]['rawAttributes'],function(_0x386623){return{'name':_0x386623[_0xf233('0x2d')],'type':_0x386623['type']['key']};});_0x59b765[_0xf233('0x2e')]=_['map'](_0x1a0068,'name');_0x59b765[_0xf233('0x2f')]=_[_0xf233('0x30')](_0x1f344a[_0xf233('0x2f')]);_0x59b765['filters']=_[_0xf233('0x31')](_0x59b765[_0xf233('0x2e')],_0x59b765[_0xf233('0x2f')]);_0x512c78[_0xf233('0x32')]=_[_0xf233('0x31')](_0x59b765[_0xf233('0x2e')],qs[_0xf233('0x33')](_0x1f344a[_0xf233('0x2f')][_0xf233('0x33')]));_0x512c78['attributes']=_0x512c78['attributes'][_0xf233('0x34')]?_0x512c78[_0xf233('0x32')]:_0x59b765[_0xf233('0x2e')];if(!_0x1f344a[_0xf233('0x2f')]['hasOwnProperty'](_0xf233('0x35'))){_0x512c78[_0xf233('0x1d')]=qs[_0xf233('0x1d')](_0x1f344a[_0xf233('0x2f')]['limit']);_0x512c78[_0xf233('0x1c')]=qs[_0xf233('0x1c')](_0x1f344a[_0xf233('0x2f')][_0xf233('0x1c')]);}_0x512c78[_0xf233('0x36')]=qs[_0xf233('0x37')](_0x1f344a[_0xf233('0x2f')][_0xf233('0x37')]);_0x512c78[_0xf233('0x38')]=qs[_0xf233('0x39')](_['pick'](_0x1f344a[_0xf233('0x2f')],_0x59b765['filters']),_0x1a0068);if(_0x1f344a[_0xf233('0x2f')][_0xf233('0x3a')]){_0x512c78[_0xf233('0x38')]=_[_0xf233('0x3b')](_0x512c78['where'],{'$or':_[_0xf233('0x2b')](_0x1a0068,function(_0x254787){if(_0x254787[_0xf233('0x3c')]!==_0xf233('0x3d')){var _0x1a151f={};_0x1a151f[_0x254787[_0xf233('0x3e')]]={'$like':'%'+_0x1f344a[_0xf233('0x2f')][_0xf233('0x3a')]+'%'};return _0x1a151f;}})});}_0x512c78=_[_0xf233('0x3b')]({},_0x512c78,_0x1f344a['options']);var _0x5d10e0={'where':_0x512c78[_0xf233('0x38')]};return db[_0xf233('0x2c')]['count'](_0x5d10e0)['then'](function(_0x27cdf5){_0x3d602a[_0xf233('0x1f')]=_0x27cdf5;if(_0x1f344a[_0xf233('0x2f')][_0xf233('0x3f')]){_0x512c78[_0xf233('0x40')]=[{'all':!![]}];}return db[_0xf233('0x2c')]['findAll'](_0x512c78);})[_0xf233('0x26')](function(_0x3840b9){_0x3d602a[_0xf233('0x41')]=_0x3840b9;return _0x3d602a;})['then'](respondWithFilteredResult(_0x3bd22a,_0x512c78))[_0xf233('0x42')](handleError(_0x3bd22a,null));};exports[_0xf233('0x43')]=function(_0x3f98ef,_0x3aa1c9){var _0x2d0f62={'raw':!![],'where':{'id':_0x3f98ef[_0xf233('0x44')]['id']}},_0x471604={};_0x471604[_0xf233('0x2e')]=_[_0xf233('0x30')](db[_0xf233('0x2c')][_0xf233('0x45')]);_0x471604[_0xf233('0x2f')]=_[_0xf233('0x30')](_0x3f98ef[_0xf233('0x2f')]);_0x471604[_0xf233('0x39')]=_[_0xf233('0x31')](_0x471604[_0xf233('0x2e')],_0x471604[_0xf233('0x2f')]);_0x2d0f62['attributes']=_[_0xf233('0x31')](_0x471604[_0xf233('0x2e')],qs[_0xf233('0x33')](_0x3f98ef['query'][_0xf233('0x33')]));_0x2d0f62[_0xf233('0x32')]=_0x2d0f62[_0xf233('0x32')][_0xf233('0x34')]?_0x2d0f62[_0xf233('0x32')]:_0x471604[_0xf233('0x2e')];if(_0x3f98ef['query'][_0xf233('0x3f')]){_0x2d0f62[_0xf233('0x40')]=[{'all':!![]}];}_0x2d0f62=_[_0xf233('0x3b')]({},_0x2d0f62,_0x3f98ef[_0xf233('0x46')]);return db[_0xf233('0x2c')]['find'](_0x2d0f62)[_0xf233('0x26')](handleEntityNotFound(_0x3aa1c9,null))[_0xf233('0x26')](respondWithResult(_0x3aa1c9,null))[_0xf233('0x42')](handleError(_0x3aa1c9,null));};exports[_0xf233('0x47')]=function(_0x17519f,_0x5dc2fc){return db[_0xf233('0x2c')][_0xf233('0x47')](_0x17519f[_0xf233('0x48')],{})[_0xf233('0x26')](respondWithResult(_0x5dc2fc,0xc9))[_0xf233('0x42')](handleError(_0x5dc2fc,null));};exports[_0xf233('0x24')]=function(_0x56b23a,_0x3f1cf6){if(_0x56b23a[_0xf233('0x48')]['id']){delete _0x56b23a[_0xf233('0x48')]['id'];}return db[_0xf233('0x2c')][_0xf233('0x49')]({'where':{'id':_0x56b23a[_0xf233('0x44')]['id']}})[_0xf233('0x26')](handleEntityNotFound(_0x3f1cf6,null))[_0xf233('0x26')](saveUpdates(_0x56b23a['body'],null))[_0xf233('0x26')](respondWithResult(_0x3f1cf6,null))[_0xf233('0x42')](handleError(_0x3f1cf6,null));};exports[_0xf233('0x25')]=function(_0x1e6657,_0x3f3c9b){return db[_0xf233('0x2c')][_0xf233('0x49')]({'where':{'id':_0x1e6657[_0xf233('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f3c9b,null))[_0xf233('0x26')](removeEntity(_0x3f3c9b,null))[_0xf233('0x42')](handleError(_0x3f3c9b,null));}; \ No newline at end of file +var _0x5003=['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','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','options','catch','create','body','update','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x44ce91,_0x5f0a9a){var _0x53e0dd=function(_0x2fde80){while(--_0x2fde80){_0x44ce91['push'](_0x44ce91['shift']());}};_0x53e0dd(++_0x5f0a9a);}(_0x5003,0x1db));var _0x3500=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5003[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x3500('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3500('0x1'));var jsonpatch=require(_0x3500('0x2'));var rp=require(_0x3500('0x3'));var moment=require(_0x3500('0x4'));var BPromise=require(_0x3500('0x5'));var Mustache=require(_0x3500('0x6'));var util=require(_0x3500('0x7'));var path=require(_0x3500('0x8'));var sox=require(_0x3500('0x9'));var csv=require(_0x3500('0xa'));var ejs=require(_0x3500('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3500('0xc'));var squel=require(_0x3500('0xd'));var crypto=require(_0x3500('0xe'));var jsforce=require(_0x3500('0xf'));var deskjs=require(_0x3500('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3500('0x11'));var Papa=require(_0x3500('0x12'));var Redis=require(_0x3500('0x13'));var authService=require(_0x3500('0x14'));var qs=require(_0x3500('0x15'));var as=require(_0x3500('0x16'));var hardwareService=require(_0x3500('0x17'));var logger=require(_0x3500('0x18'))(_0x3500('0x19'));var utils=require(_0x3500('0x1a'));var config=require(_0x3500('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b0a1c,_0x73f721){_0x73f721=_0x73f721||0xcc;return function(_0x2163a9){if(_0x2163a9){return _0x5b0a1c[_0x3500('0x1c')](_0x73f721);}return _0x5b0a1c[_0x3500('0x1d')](_0x73f721)[_0x3500('0x1e')]();};}function respondWithResult(_0x39b861,_0x3441cf){_0x3441cf=_0x3441cf||0xc8;return function(_0x145789){if(_0x145789){return _0x39b861['status'](_0x3441cf)['json'](_0x145789);}};}function respondWithFilteredResult(_0x1b0397,_0x656c6c){return function(_0x5d1bbf){if(_0x5d1bbf){var _0x1ba2fd=typeof _0x656c6c[_0x3500('0x1f')]==='undefined'&&typeof _0x656c6c[_0x3500('0x20')]===_0x3500('0x21');var _0x4faa64=_0x5d1bbf[_0x3500('0x22')];var _0x456902=_0x1ba2fd?0x0:_0x656c6c[_0x3500('0x1f')];var _0x4502e5=_0x1ba2fd?_0x5d1bbf[_0x3500('0x22')]:_0x656c6c['offset']+_0x656c6c[_0x3500('0x20')];var _0x56abf0;if(_0x4502e5>=_0x4faa64){_0x4502e5=_0x4faa64;_0x56abf0=0xc8;}else{_0x56abf0=0xce;}_0x1b0397['status'](_0x56abf0);return _0x1b0397[_0x3500('0x23')](_0x3500('0x24'),_0x456902+'-'+_0x4502e5+'/'+_0x4faa64)['json'](_0x5d1bbf);}return null;};}function patchUpdates(_0x556b80){return function(_0x2e6f83){try{jsonpatch[_0x3500('0x25')](_0x2e6f83,_0x556b80,!![]);}catch(_0x1d2088){return BPromise[_0x3500('0x26')](_0x1d2088);}return _0x2e6f83[_0x3500('0x27')]();};}function saveUpdates(_0x52f82b,_0x408f65){return function(_0x49c879){if(_0x49c879){return _0x49c879['update'](_0x52f82b)[_0x3500('0x28')](function(_0xf0ebad){return _0xf0ebad;});}return null;};}function removeEntity(_0x471125,_0x154149){return function(_0x475f6e){if(_0x475f6e){return _0x475f6e[_0x3500('0x29')]()[_0x3500('0x28')](function(){_0x471125[_0x3500('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x451996,_0x5c36e4){return function(_0x249dc0){if(!_0x249dc0){_0x451996[_0x3500('0x1c')](0x194);}return _0x249dc0;};}function handleError(_0x4caeaf,_0x1cd12a){_0x1cd12a=_0x1cd12a||0x1f4;return function(_0x5ac17d){logger[_0x3500('0x2a')](_0x5ac17d[_0x3500('0x2b')]);if(_0x5ac17d[_0x3500('0x2c')]){delete _0x5ac17d[_0x3500('0x2c')];}_0x4caeaf[_0x3500('0x1d')](_0x1cd12a)[_0x3500('0x2d')](_0x5ac17d);};}exports[_0x3500('0x2e')]=function(_0x444011,_0x2f6f79){var _0x42e266={},_0x536102={},_0x2e974f={'count':0x0,'rows':[]};var _0x31a2a9=_[_0x3500('0x2f')](db[_0x3500('0x30')][_0x3500('0x31')],function(_0x2457e2){return{'name':_0x2457e2[_0x3500('0x32')],'type':_0x2457e2[_0x3500('0x33')][_0x3500('0x34')]};});_0x536102[_0x3500('0x35')]=_[_0x3500('0x2f')](_0x31a2a9,_0x3500('0x2c'));_0x536102['query']=_[_0x3500('0x36')](_0x444011[_0x3500('0x37')]);_0x536102[_0x3500('0x38')]=_['intersection'](_0x536102[_0x3500('0x35')],_0x536102[_0x3500('0x37')]);_0x42e266[_0x3500('0x39')]=_[_0x3500('0x3a')](_0x536102[_0x3500('0x35')],qs[_0x3500('0x3b')](_0x444011['query'][_0x3500('0x3b')]));_0x42e266[_0x3500('0x39')]=_0x42e266[_0x3500('0x39')][_0x3500('0x3c')]?_0x42e266['attributes']:_0x536102[_0x3500('0x35')];if(!_0x444011[_0x3500('0x37')][_0x3500('0x3d')](_0x3500('0x3e'))){_0x42e266['limit']=qs[_0x3500('0x20')](_0x444011[_0x3500('0x37')][_0x3500('0x20')]);_0x42e266[_0x3500('0x1f')]=qs[_0x3500('0x1f')](_0x444011['query'][_0x3500('0x1f')]);}_0x42e266[_0x3500('0x3f')]=qs[_0x3500('0x40')](_0x444011[_0x3500('0x37')][_0x3500('0x40')]);_0x42e266['where']=qs['filters'](_['pick'](_0x444011['query'],_0x536102[_0x3500('0x38')]),_0x31a2a9);if(_0x444011[_0x3500('0x37')][_0x3500('0x41')]){_0x42e266[_0x3500('0x42')]=_[_0x3500('0x43')](_0x42e266[_0x3500('0x42')],{'$or':_['map'](_0x31a2a9,function(_0x5e1915){if(_0x5e1915[_0x3500('0x33')]!==_0x3500('0x44')){var _0x26ce29={};_0x26ce29[_0x5e1915[_0x3500('0x2c')]]={'$like':'%'+_0x444011[_0x3500('0x37')][_0x3500('0x41')]+'%'};return _0x26ce29;}})});}_0x42e266=_['merge']({},_0x42e266,_0x444011['options']);var _0x3cec86={'where':_0x42e266[_0x3500('0x42')]};return db[_0x3500('0x30')][_0x3500('0x22')](_0x3cec86)[_0x3500('0x28')](function(_0x798595){_0x2e974f[_0x3500('0x22')]=_0x798595;if(_0x444011[_0x3500('0x37')][_0x3500('0x45')]){_0x42e266[_0x3500('0x46')]=[{'all':!![]}];}return db[_0x3500('0x30')][_0x3500('0x47')](_0x42e266);})[_0x3500('0x28')](function(_0x501d99){_0x2e974f[_0x3500('0x48')]=_0x501d99;return _0x2e974f;})['then'](respondWithFilteredResult(_0x2f6f79,_0x42e266))['catch'](handleError(_0x2f6f79,null));};exports[_0x3500('0x49')]=function(_0x1c5b0c,_0x120401){var _0x14db5c={'raw':!![],'where':{'id':_0x1c5b0c['params']['id']}},_0xed1166={};_0xed1166[_0x3500('0x35')]=_[_0x3500('0x36')](db['OpenchannelApplication']['rawAttributes']);_0xed1166[_0x3500('0x37')]=_['keys'](_0x1c5b0c['query']);_0xed1166[_0x3500('0x38')]=_[_0x3500('0x3a')](_0xed1166[_0x3500('0x35')],_0xed1166[_0x3500('0x37')]);_0x14db5c[_0x3500('0x39')]=_[_0x3500('0x3a')](_0xed1166[_0x3500('0x35')],qs[_0x3500('0x3b')](_0x1c5b0c[_0x3500('0x37')][_0x3500('0x3b')]));_0x14db5c[_0x3500('0x39')]=_0x14db5c[_0x3500('0x39')][_0x3500('0x3c')]?_0x14db5c[_0x3500('0x39')]:_0xed1166[_0x3500('0x35')];if(_0x1c5b0c[_0x3500('0x37')][_0x3500('0x45')]){_0x14db5c[_0x3500('0x46')]=[{'all':!![]}];}_0x14db5c=_[_0x3500('0x43')]({},_0x14db5c,_0x1c5b0c[_0x3500('0x4a')]);return db['OpenchannelApplication']['find'](_0x14db5c)[_0x3500('0x28')](handleEntityNotFound(_0x120401,null))['then'](respondWithResult(_0x120401,null))[_0x3500('0x4b')](handleError(_0x120401,null));};exports[_0x3500('0x4c')]=function(_0x5d2ce3,_0x1e7b57){return db[_0x3500('0x30')]['create'](_0x5d2ce3[_0x3500('0x4d')],{})['then'](respondWithResult(_0x1e7b57,0xc9))[_0x3500('0x4b')](handleError(_0x1e7b57,null));};exports[_0x3500('0x4e')]=function(_0x153ab7,_0x201d70){if(_0x153ab7[_0x3500('0x4d')]['id']){delete _0x153ab7[_0x3500('0x4d')]['id'];}return db[_0x3500('0x30')][_0x3500('0x4f')]({'where':{'id':_0x153ab7[_0x3500('0x50')]['id']}})[_0x3500('0x28')](handleEntityNotFound(_0x201d70,null))[_0x3500('0x28')](saveUpdates(_0x153ab7[_0x3500('0x4d')],null))[_0x3500('0x28')](respondWithResult(_0x201d70,null))['catch'](handleError(_0x201d70,null));};exports[_0x3500('0x29')]=function(_0x1c3037,_0x378676){return db[_0x3500('0x30')][_0x3500('0x4f')]({'where':{'id':_0x1c3037['params']['id']}})[_0x3500('0x28')](handleEntityNotFound(_0x378676,null))[_0x3500('0x28')](removeEntity(_0x378676,null))[_0x3500('0x4b')](handleError(_0x378676,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 5786cef..4b28cd8 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 _0xa262=['bluebird','request-promise','path','../../config/environment','./openchannelApplication.attributes','exports','define','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x3a3c6f,_0x553e8c){var _0x2aa375=function(_0x21f921){while(--_0x21f921){_0x3a3c6f['push'](_0x3a3c6f['shift']());}};_0x2aa375(++_0x553e8c);}(_0xa262,0x15a));var _0x2a26=function(_0x38c1ce,_0xcd42d1){_0x38c1ce=_0x38c1ce-0x0;var _0x1ed817=_0xa262[_0x38c1ce];return _0x1ed817;};'use strict';var _=require('lodash');var util=require(_0x2a26('0x0'));var logger=require(_0x2a26('0x1'))(_0x2a26('0x2'));var moment=require(_0x2a26('0x3'));var BPromise=require(_0x2a26('0x4'));var rp=require(_0x2a26('0x5'));var fs=require('fs');var path=require(_0x2a26('0x6'));var rimraf=require('rimraf');var config=require(_0x2a26('0x7'));var attributes=require(_0x2a26('0x8'));module[_0x2a26('0x9')]=function(_0x270a77,_0x1f779c){return _0x270a77[_0x2a26('0xa')]('OpenchannelApplication',attributes,{'tableName':_0x2a26('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2a26('0xc'),'collate':_0x2a26('0xd')});}; \ No newline at end of file +var _0x297e=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci'];(function(_0xda11f5,_0x502f51){var _0x5ee2d2=function(_0x11017d){while(--_0x11017d){_0xda11f5['push'](_0xda11f5['shift']());}};_0x5ee2d2(++_0x502f51);}(_0x297e,0x193));var _0xe297=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x297e[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xe297('0x0'));var util=require('util');var logger=require(_0xe297('0x1'))(_0xe297('0x2'));var moment=require(_0xe297('0x3'));var BPromise=require('bluebird');var rp=require(_0xe297('0x4'));var fs=require('fs');var path=require(_0xe297('0x5'));var rimraf=require(_0xe297('0x6'));var config=require('../../config/environment');var attributes=require(_0xe297('0x7'));module[_0xe297('0x8')]=function(_0x428e7d,_0x4e48ac){return _0x428e7d[_0xe297('0x9')](_0xe297('0xa'),attributes,{'tableName':_0xe297('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe297('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index abc4e2c..6806cc6 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 _0x0ed9=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','limit','lodash','util','moment'];(function(_0x5c8bbf,_0x5a1c6f){var _0x12d9ec=function(_0x1024a3){while(--_0x1024a3){_0x5c8bbf['push'](_0x5c8bbf['shift']());}};_0x12d9ec(++_0x5a1c6f);}(_0x0ed9,0xbd));var _0x90ed=function(_0x17ebb6,_0x465af7){_0x17ebb6=_0x17ebb6-0x0;var _0x32ec22=_0x0ed9[_0x17ebb6];return _0x32ec22;};'use strict';var _=require(_0x90ed('0x0'));var util=require(_0x90ed('0x1'));var moment=require(_0x90ed('0x2'));var BPromise=require(_0x90ed('0x3'));var rs=require(_0x90ed('0x4'));var fs=require('fs');var Redis=require(_0x90ed('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x90ed('0x6'));var logger=require('../../config/logger')(_0x90ed('0x7'));var config=require(_0x90ed('0x8'));var jayson=require(_0x90ed('0x9'));var client=jayson[_0x90ed('0xa')][_0x90ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x471a07,_0x4cf451,_0x36ee9e){return new BPromise(function(_0x10be70,_0x58b867){return client['request'](_0x471a07,_0x36ee9e)[_0x90ed('0xc')](function(_0x24510e){logger[_0x90ed('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x4cf451,'request\x20sent');logger[_0x90ed('0xe')](_0x90ed('0xf'),_0x4cf451,_0x90ed('0x10'),JSON[_0x90ed('0x11')](_0x24510e));if(_0x24510e['error']){if(_0x24510e[_0x90ed('0x12')][_0x90ed('0x13')]===0x1f4){logger[_0x90ed('0x12')](_0x90ed('0x14'),_0x4cf451,_0x24510e[_0x90ed('0x12')][_0x90ed('0x15')]);return _0x58b867(_0x24510e['error'][_0x90ed('0x15')]);}logger[_0x90ed('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x4cf451,_0x24510e[_0x90ed('0x12')]['message']);return _0x10be70(_0x24510e[_0x90ed('0x12')][_0x90ed('0x15')]);}else{logger['info'](_0x90ed('0x14'),_0x4cf451,_0x90ed('0x10'));_0x10be70(_0x24510e[_0x90ed('0x16')][_0x90ed('0x15')]);}})[_0x90ed('0x17')](function(_0x21bd49){logger[_0x90ed('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x4cf451,_0x21bd49);_0x58b867(_0x21bd49);});});}exports[_0x90ed('0x18')]=function(_0x485ea6){var _0x4fe194=this;return new Promise(function(_0x52816e,_0x307b55){return db[_0x90ed('0x19')][_0x90ed('0x1a')](_0x485ea6[_0x90ed('0x1b')],{'raw':_0x485ea6[_0x90ed('0x1c')]?_0x485ea6[_0x90ed('0x1c')][_0x90ed('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x485ea6[_0x90ed('0x1c')]?_0x485ea6['options'][_0x90ed('0x1e')]||null:null,'attributes':_0x485ea6[_0x90ed('0x1c')]?_0x485ea6[_0x90ed('0x1c')]['attributes']||null:null,'limit':_0x485ea6[_0x90ed('0x1c')]?_0x485ea6[_0x90ed('0x1c')][_0x90ed('0x1f')]||null:null})['then'](function(_0x4f9cbd){logger[_0x90ed('0xd')]('UpdateOpenchannelApplication',_0x485ea6);logger['debug'](_0x90ed('0x18'),_0x485ea6,JSON[_0x90ed('0x11')](_0x4f9cbd));_0x52816e(_0x4f9cbd);})[_0x90ed('0x17')](function(_0x1d9a18){logger[_0x90ed('0x12')]('UpdateOpenchannelApplication',_0x1d9a18['message'],_0x485ea6);_0x307b55(_0x4fe194[_0x90ed('0x12')](0x1f4,_0x1d9a18[_0x90ed('0x15')]));});});}; \ No newline at end of file +var _0x11d1=['OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','where','attributes','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11d1,0x7d));var _0x111d=function(_0x19ab14,_0x51b6f7){_0x19ab14=_0x19ab14-0x0;var _0x112625=_0x11d1[_0x19ab14];return _0x112625;};'use strict';var _=require(_0x111d('0x0'));var util=require('util');var moment=require(_0x111d('0x1'));var BPromise=require(_0x111d('0x2'));var rs=require(_0x111d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x111d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x111d('0x5'))(_0x111d('0x6'));var config=require(_0x111d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x111d('0x8')][_0x111d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c9d90,_0x4dad7a,_0x26210b){return new BPromise(function(_0x46faa9,_0xd0d2e6){return client[_0x111d('0xa')](_0x2c9d90,_0x26210b)['then'](function(_0x42e6a3){logger[_0x111d('0xb')](_0x111d('0xc'),_0x4dad7a,_0x111d('0xd'));logger[_0x111d('0xe')](_0x111d('0xf'),_0x4dad7a,_0x111d('0xd'),JSON['stringify'](_0x42e6a3));if(_0x42e6a3['error']){if(_0x42e6a3['error']['code']===0x1f4){logger[_0x111d('0x10')](_0x111d('0xc'),_0x4dad7a,_0x42e6a3[_0x111d('0x10')][_0x111d('0x11')]);return _0xd0d2e6(_0x42e6a3[_0x111d('0x10')]['message']);}logger[_0x111d('0x10')](_0x111d('0xc'),_0x4dad7a,_0x42e6a3[_0x111d('0x10')][_0x111d('0x11')]);return _0x46faa9(_0x42e6a3[_0x111d('0x10')]['message']);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x4dad7a,_0x111d('0xd'));_0x46faa9(_0x42e6a3[_0x111d('0x12')][_0x111d('0x11')]);}})[_0x111d('0x13')](function(_0x2b79c4){logger['error'](_0x111d('0xc'),_0x4dad7a,_0x2b79c4);_0xd0d2e6(_0x2b79c4);});});}exports[_0x111d('0x14')]=function(_0x354855){var _0x58366e=this;return new Promise(function(_0x14ec30,_0x12fa90){return db[_0x111d('0x15')][_0x111d('0x16')](_0x354855[_0x111d('0x17')],{'raw':_0x354855[_0x111d('0x18')]?_0x354855[_0x111d('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x354855['options']?_0x354855[_0x111d('0x18')][_0x111d('0x19')]||null:null,'attributes':_0x354855[_0x111d('0x18')]?_0x354855[_0x111d('0x18')][_0x111d('0x1a')]||null:null,'limit':_0x354855[_0x111d('0x18')]?_0x354855[_0x111d('0x18')]['limit']||null:null})['then'](function(_0x70028b){logger[_0x111d('0xb')](_0x111d('0x14'),_0x354855);logger[_0x111d('0xe')](_0x111d('0x14'),_0x354855,JSON[_0x111d('0x1b')](_0x70028b));_0x14ec30(_0x70028b);})[_0x111d('0x13')](function(_0x470531){logger[_0x111d('0x10')](_0x111d('0x14'),_0x470531[_0x111d('0x11')],_0x354855);_0x12fa90(_0x58366e[_0x111d('0x10')](0x1f4,_0x470531[_0x111d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index bef1ffe..95df2ea 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 _0xf0e2=['/describe','/:id','show','getMessages','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','tracked','destroy','delete','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index'];(function(_0x50eacf,_0x4c4143){var _0xd4fd93=function(_0x29a7c9){while(--_0x29a7c9){_0x50eacf['push'](_0x50eacf['shift']());}};_0xd4fd93(++_0x4c4143);}(_0xf0e2,0xe1));var _0x2f0e=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xf0e2[_0x17928f];return _0x500b63;};'use strict';var multer=require(_0x2f0e('0x0'));var util=require('util');var path=require(_0x2f0e('0x1'));var timeout=require(_0x2f0e('0x2'));var express=require(_0x2f0e('0x3'));var router=express[_0x2f0e('0x4')]();var fs_extra=require(_0x2f0e('0x5'));var auth=require(_0x2f0e('0x6'));var interaction=require(_0x2f0e('0x7'));var config=require(_0x2f0e('0x8'));var controller=require(_0x2f0e('0x9'));router[_0x2f0e('0xa')]('/',auth[_0x2f0e('0xb')](),controller[_0x2f0e('0xc')]);router[_0x2f0e('0xa')](_0x2f0e('0xd'),auth[_0x2f0e('0xb')](),controller['describe']);router[_0x2f0e('0xa')](_0x2f0e('0xe'),auth[_0x2f0e('0xb')](),controller[_0x2f0e('0xf')]);router['get']('/:id/messages',auth[_0x2f0e('0xb')](),controller[_0x2f0e('0x10')]);router[_0x2f0e('0xa')](_0x2f0e('0x11'),auth[_0x2f0e('0xb')](),controller[_0x2f0e('0x12')]);router[_0x2f0e('0x13')]('/',auth[_0x2f0e('0xb')](),controller['create']);router[_0x2f0e('0x13')](_0x2f0e('0x14'),auth[_0x2f0e('0xb')](),controller[_0x2f0e('0x15')]);router[_0x2f0e('0x13')](_0x2f0e('0x16'),auth['isAuthenticated'](),interaction['tracked'](_0x2f0e('0x17'),_0x2f0e('0x18')),controller[_0x2f0e('0x19')]);router[_0x2f0e('0x1a')](_0x2f0e('0xe'),auth[_0x2f0e('0xb')](),interaction['tracked'](_0x2f0e('0x17'),_0x2f0e('0x1b')),controller[_0x2f0e('0x1c')]);router['delete'](_0x2f0e('0xe'),auth[_0x2f0e('0xb')](),interaction[_0x2f0e('0x1d')](_0x2f0e('0x17'),'openchannelinteraction:destroy'),controller[_0x2f0e('0x1e')]);router[_0x2f0e('0x1f')](_0x2f0e('0x16'),auth[_0x2f0e('0xb')](),controller[_0x2f0e('0x20')]);module[_0x2f0e('0x21')]=router; \ No newline at end of file +var _0xf727=['show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','openchannelinteraction:addtags','addTags','put','openchannel','update','delete','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','get','index','isAuthenticated','describe','/:id'];(function(_0x4e9704,_0x13fb4b){var _0x2e6b6a=function(_0x3d7a6b){while(--_0x3d7a6b){_0x4e9704['push'](_0x4e9704['shift']());}};_0x2e6b6a(++_0x13fb4b);}(_0xf727,0x1f2));var _0x7f72=function(_0x382664,_0x1fdc04){_0x382664=_0x382664-0x0;var _0x56acaa=_0xf727[_0x382664];return _0x56acaa;};'use strict';var multer=require(_0x7f72('0x0'));var util=require(_0x7f72('0x1'));var path=require(_0x7f72('0x2'));var timeout=require(_0x7f72('0x3'));var express=require(_0x7f72('0x4'));var router=express['Router']();var fs_extra=require(_0x7f72('0x5'));var auth=require(_0x7f72('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelInteraction.controller');router[_0x7f72('0x7')]('/',auth['isAuthenticated'](),controller[_0x7f72('0x8')]);router[_0x7f72('0x7')]('/describe',auth[_0x7f72('0x9')](),controller[_0x7f72('0xa')]);router['get'](_0x7f72('0xb'),auth[_0x7f72('0x9')](),controller[_0x7f72('0xc')]);router[_0x7f72('0x7')](_0x7f72('0xd'),auth[_0x7f72('0x9')](),controller[_0x7f72('0xe')]);router[_0x7f72('0x7')](_0x7f72('0xf'),auth['isAuthenticated'](),controller[_0x7f72('0x10')]);router[_0x7f72('0x11')]('/',auth[_0x7f72('0x9')](),controller[_0x7f72('0x12')]);router[_0x7f72('0x11')](_0x7f72('0xd'),auth[_0x7f72('0x9')](),controller[_0x7f72('0x13')]);router[_0x7f72('0x11')]('/:id/tags',auth[_0x7f72('0x9')](),interaction[_0x7f72('0x14')]('openchannel',_0x7f72('0x15')),controller[_0x7f72('0x16')]);router[_0x7f72('0x17')]('/:id',auth[_0x7f72('0x9')](),interaction['tracked'](_0x7f72('0x18'),'openchannelinteraction:update'),controller[_0x7f72('0x19')]);router[_0x7f72('0x1a')](_0x7f72('0xb'),auth[_0x7f72('0x9')](),interaction['tracked'](_0x7f72('0x18'),'openchannelinteraction:destroy'),controller[_0x7f72('0x1b')]);router['delete'](_0x7f72('0x1c'),auth[_0x7f72('0x9')](),controller[_0x7f72('0x1d')]);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 9ef7a70..16dee5f 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 _0xf972=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x177957,_0x390af9){var _0x23d8dd=function(_0x455226){while(--_0x455226){_0x177957['push'](_0x177957['shift']());}};_0x23d8dd(++_0x390af9);}(_0xf972,0x171));var _0x2f97=function(_0x4f2822,_0x20396d){_0x4f2822=_0x4f2822-0x0;var _0x3d1d0d=_0xf972[_0x4f2822];return _0x3d1d0d;};'use strict';var Sequelize=require(_0x2f97('0x0'));module['exports']={'closed':{'type':Sequelize[_0x2f97('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2f97('0x2')]},'disposition':{'type':Sequelize[_0x2f97('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2f97('0x3')]},'note':{'type':Sequelize[_0x2f97('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x2f97('0x3')]},'externalUrl':{'type':Sequelize[_0x2f97('0x3')]},'lastMsgAt':{'type':Sequelize[_0x2f97('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x2f97('0x4')]('in',_0x2f97('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x2f97('0x4')]('in',_0x2f97('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x2f97('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x2f97('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x63ef=['out','INTEGER','sequelize','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x151787,_0x77ec0f){var _0x35f544=function(_0x5c22d4){while(--_0x5c22d4){_0x151787['push'](_0x151787['shift']());}};_0x35f544(++_0x77ec0f);}(_0x63ef,0x11a));var _0xf63e=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0x63ef[_0x5ce15c];return _0x36e4f5;};'use strict';var Sequelize=require(_0xf63e('0x0'));module[_0xf63e('0x1')]={'closed':{'type':Sequelize[_0xf63e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf63e('0x3')]},'secondDisposition':{'type':Sequelize[_0xf63e('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xf63e('0x4')]},'threadId':{'type':Sequelize[_0xf63e('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0xf63e('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xf63e('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xf63e('0x5')]('in',_0xf63e('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xf63e('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xf63e('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xf63e('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index be5b0a2..c1fdf6f 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 _0x45de=['error','stack','name','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','user','catch','query','from','params','model','OpenchannelInteraction','keys','filters','intersection','attributes','fields','length','include','merge','options','find','create','body','describe','addMessage','omit','ids','getMessages','findOne','OpenchannelMessage','hasOwnProperty','order','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','unix','toString','files','tmp','join','root','server','attachments','format','push','User','CmContact','Contact','firstName','Attachment','createdAt','read','OpenchannelAccount','Account','Owner','mkdirSync','Openchannel','fullname','N.A.','closed','closedAt','disposition','threadId','Public','Private','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','direction','lastName','out','secret','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','sendStatus','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy'];(function(_0x5a2d95,_0xb362e5){var _0x2c3986=function(_0x5cce7c){while(--_0x5cce7c){_0x5a2d95['push'](_0x5a2d95['shift']());}};_0x2c3986(++_0xb362e5);}(_0x45de,0xf1));var _0xe45d=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x45de[_0x13e741];return _0x3f8bb3;};'use strict';var rimraf=require(_0xe45d('0x0'));var zipdir=require(_0xe45d('0x1'));var moment=require(_0xe45d('0x2'));var util=require(_0xe45d('0x3'));var path=require(_0xe45d('0x4'));var ejs=require(_0xe45d('0x5'));var fs=require('fs');var _=require(_0xe45d('0x6'));var Redis=require(_0xe45d('0x7'));var interaction=require(_0xe45d('0x8'));var qs=require(_0xe45d('0x9'));var pdf=require(_0xe45d('0xa'));var logger=require(_0xe45d('0xb'))(_0xe45d('0xc'));var config=require(_0xe45d('0xd'));var db=require(_0xe45d('0xe'))['db'];config[_0xe45d('0xf')]=_[_0xe45d('0x10')](config[_0xe45d('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0xe45d('0x11'))(new Redis(config[_0xe45d('0xf')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x3170a8,_0x2f4d75){_0x2f4d75=_0x2f4d75||0xcc;return function(_0x3ee242){if(_0x3ee242){return _0x3170a8['sendStatus'](_0x2f4d75);}return _0x3170a8[_0xe45d('0x12')](_0x2f4d75)['end']();};}function respondWithResult(_0x5924c5,_0x5b0f1d){_0x5b0f1d=_0x5b0f1d||0xc8;return function(_0x1352d4){if(_0x1352d4){return _0x5924c5[_0xe45d('0x12')](_0x5b0f1d)[_0xe45d('0x13')](_0x1352d4);}};}function respondWithFilteredResult(_0x1c9cf0,_0x2ac38f){return function(_0x5d945b){if(_0x5d945b){var _0x56c21b=typeof _0x2ac38f[_0xe45d('0x14')]===_0xe45d('0x15')&&typeof _0x2ac38f[_0xe45d('0x16')]===_0xe45d('0x15');var _0x5e6e22=_0x5d945b[_0xe45d('0x17')];var _0x170869=_0x56c21b?0x0:_0x2ac38f[_0xe45d('0x14')];var _0xcc0b4=_0x56c21b?_0x5d945b[_0xe45d('0x17')]:_0x2ac38f[_0xe45d('0x14')]+_0x2ac38f[_0xe45d('0x16')];var _0x347e71;if(_0xcc0b4>=_0x5e6e22){_0xcc0b4=_0x5e6e22;_0x347e71=0xc8;}else{_0x347e71=0xce;}_0x1c9cf0[_0xe45d('0x12')](_0x347e71);return _0x1c9cf0[_0xe45d('0x18')](_0xe45d('0x19'),_0x170869+'-'+_0xcc0b4+'/'+_0x5e6e22)[_0xe45d('0x13')](_0x5d945b);}return null;};}function saveUpdates(_0x3bb9f4){return function(_0x10ce79){if(_0x10ce79){return _0x10ce79[_0xe45d('0x1a')](_0x3bb9f4)[_0xe45d('0x1b')](function(_0x47d815){return _0x47d815;});}return null;};}function removeEntity(_0x3b4016){return function(_0x296e6b){if(_0x296e6b){return _0x296e6b[_0xe45d('0x1c')]()['then'](function(){_0x3b4016[_0xe45d('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bbafb){return function(_0xba43f5){if(!_0xba43f5){_0x2bbafb['sendStatus'](0x194);}return _0xba43f5;};}function handleError(_0x35e3a0,_0x4826b4){_0x4826b4=_0x4826b4||0x1f4;return function(_0x5689fc){logger[_0xe45d('0x1d')](_0x5689fc[_0xe45d('0x1e')]);if(_0x5689fc['name']){delete _0x5689fc[_0xe45d('0x1f')];}_0x35e3a0[_0xe45d('0x12')](_0x4826b4)['send'](_0x5689fc);};}exports[_0xe45d('0x20')]=function(_0x2d114a,_0x48fe64){var _0xbfd721={};var _0x5b407c=_[_0xe45d('0x21')](db['OpenchannelInteraction'][_0xe45d('0x22')],function(_0x232e78){return{'name':_0x232e78[_0xe45d('0x23')],'type':_0x232e78[_0xe45d('0x24')][_0xe45d('0x25')]};});_0xbfd721=qs[_0xe45d('0x26')](_0x5b407c,_0x2d114a);return interaction[_0xe45d('0x27')](_0xe45d('0x28'),_0x2d114a['query'],_0x2d114a[_0xe45d('0x29')],_0xbfd721,_0x5b407c)['then'](respondWithFilteredResult(_0x48fe64,_0xbfd721))[_0xe45d('0x2a')](handleError(_0x48fe64,null));};exports['show']=function(_0x3d8636,_0x13403b){var _0x3780f1={};if(_0x3d8636[_0xe45d('0x2b')][_0xe45d('0x24')]&&_0x3d8636[_0xe45d('0x2b')][_0xe45d('0x24')]===_0xe45d('0x2c')){_0x3780f1[_0xe45d('0x2c')]=_0x3d8636[_0xe45d('0x2d')]['id'];}else{_0x3780f1['id']=_0x3d8636[_0xe45d('0x2d')]['id'];}var _0x4ff61b={'raw':![],'where':_0x3780f1},_0x5b0434={};_0x5b0434[_0xe45d('0x2e')]=_['keys'](db[_0xe45d('0x2f')]['rawAttributes']);_0x5b0434['query']=_[_0xe45d('0x30')](_0x3d8636[_0xe45d('0x2b')]);_0x5b0434[_0xe45d('0x31')]=_[_0xe45d('0x32')](_0x5b0434[_0xe45d('0x2e')],_0x5b0434[_0xe45d('0x2b')]);_0x4ff61b[_0xe45d('0x33')]=_['intersection'](_0x5b0434[_0xe45d('0x2e')],qs[_0xe45d('0x34')](_0x3d8636[_0xe45d('0x2b')]['fields']));_0x4ff61b[_0xe45d('0x33')]=_0x4ff61b['attributes'][_0xe45d('0x35')]?_0x4ff61b[_0xe45d('0x33')]:_0x5b0434[_0xe45d('0x2e')];if(_0x3d8636[_0xe45d('0x2b')]['includeAll']){_0x4ff61b[_0xe45d('0x36')]=[{'all':!![]}];}_0x4ff61b=_[_0xe45d('0x37')]({},_0x4ff61b,_0x3d8636[_0xe45d('0x38')]);return db[_0xe45d('0x2f')][_0xe45d('0x39')](_0x4ff61b)[_0xe45d('0x1b')](handleEntityNotFound(_0x13403b,null))[_0xe45d('0x1b')](respondWithResult(_0x13403b,null))[_0xe45d('0x2a')](handleError(_0x13403b,null));};exports[_0xe45d('0x3a')]=function(_0x6c442f,_0xf10f98){return db[_0xe45d('0x2f')][_0xe45d('0x3a')](_0x6c442f['body'],{})['then'](respondWithResult(_0xf10f98,0xc9))[_0xe45d('0x2a')](handleError(_0xf10f98,null));};exports[_0xe45d('0x1a')]=function(_0x42d416,_0x5a86e0){if(_0x42d416['body']['id']){delete _0x42d416[_0xe45d('0x3b')]['id'];}return db[_0xe45d('0x2f')]['find']({'where':{'id':_0x42d416['params']['id']}})[_0xe45d('0x1b')](handleEntityNotFound(_0x5a86e0,null))[_0xe45d('0x1b')](saveUpdates(_0x42d416['body'],null))[_0xe45d('0x1b')](respondWithResult(_0x5a86e0,null))[_0xe45d('0x2a')](handleError(_0x5a86e0,null));};exports[_0xe45d('0x1c')]=function(_0x29bef1,_0x2b764a){return db[_0xe45d('0x2f')][_0xe45d('0x39')]({'where':{'id':_0x29bef1[_0xe45d('0x2d')]['id']}})[_0xe45d('0x1b')](handleEntityNotFound(_0x2b764a,null))[_0xe45d('0x1b')](removeEntity(_0x2b764a,null))[_0xe45d('0x2a')](handleError(_0x2b764a,null));};exports[_0xe45d('0x3c')]=function(_0x2695cc,_0xbee42){return db['OpenchannelInteraction'][_0xe45d('0x3c')]()['then'](respondWithResult(_0xbee42,null))[_0xe45d('0x2a')](handleError(_0xbee42,null));};exports[_0xe45d('0x3d')]=function(_0x55e796,_0x393a00){return db['OpenchannelMessage'][_0xe45d('0x39')]({'where':{'id':_0x55e796[_0xe45d('0x2d')]['id']}})[_0xe45d('0x1b')](handleEntityNotFound(_0x393a00,null))[_0xe45d('0x1b')](function(_0x31d1dd){if(_0x31d1dd){return _0x31d1dd[_0xe45d('0x3d')](_0x55e796['body']['ids'],_[_0xe45d('0x3e')](_0x55e796['body'],[_0xe45d('0x3f'),'id'])||{});}})[_0xe45d('0x1b')](respondWithResult(_0x393a00,null))[_0xe45d('0x2a')](handleError(_0x393a00,null));};exports[_0xe45d('0x40')]=function(_0x27d4ca,_0x40ea97){var _0x45ce0b={'raw':![],'where':{}};var _0x41e9a0={};var _0x5c718c={'count':0x0,'rows':[]};return db[_0xe45d('0x2f')][_0xe45d('0x41')]({'where':{'id':_0x27d4ca[_0xe45d('0x2d')]['id']}})['then'](handleEntityNotFound(_0x40ea97,null))['then'](function(_0xc17205){if(_0xc17205){_0x41e9a0[_0xe45d('0x2e')]=_[_0xe45d('0x30')](db[_0xe45d('0x42')][_0xe45d('0x22')]);_0x41e9a0[_0xe45d('0x2b')]=_[_0xe45d('0x30')](_0x27d4ca['query']);_0x41e9a0[_0xe45d('0x31')]=_[_0xe45d('0x32')](_0x41e9a0[_0xe45d('0x2e')],_0x41e9a0[_0xe45d('0x2b')]);_0x45ce0b[_0xe45d('0x33')]=_[_0xe45d('0x32')](_0x41e9a0[_0xe45d('0x2e')],qs[_0xe45d('0x34')](_0x27d4ca[_0xe45d('0x2b')][_0xe45d('0x34')]));_0x45ce0b[_0xe45d('0x33')]=_0x45ce0b['attributes'][_0xe45d('0x35')]?_0x45ce0b[_0xe45d('0x33')]:_0x41e9a0['model'];if(!_0x27d4ca[_0xe45d('0x2b')][_0xe45d('0x43')]('nolimit')){_0x45ce0b[_0xe45d('0x16')]=qs[_0xe45d('0x16')](_0x27d4ca[_0xe45d('0x2b')][_0xe45d('0x16')]);_0x45ce0b[_0xe45d('0x14')]=qs[_0xe45d('0x14')](_0x27d4ca[_0xe45d('0x2b')][_0xe45d('0x14')]);}_0x45ce0b[_0xe45d('0x44')]=qs[_0xe45d('0x45')](_0x27d4ca[_0xe45d('0x2b')][_0xe45d('0x45')]);_0x45ce0b[_0xe45d('0x46')]=qs[_0xe45d('0x31')](_[_0xe45d('0x47')](_0x27d4ca[_0xe45d('0x2b')],_0x41e9a0[_0xe45d('0x31')]));_0x45ce0b[_0xe45d('0x46')]['OpenchannelInteractionId']=_0xc17205['id'];if(_0x27d4ca[_0xe45d('0x2b')][_0xe45d('0x48')]){_0x45ce0b[_0xe45d('0x46')]=_[_0xe45d('0x37')](_0x45ce0b[_0xe45d('0x46')],{'$or':_[_0xe45d('0x21')](_0x45ce0b[_0xe45d('0x33')],function(_0x1f92eb){var _0x5b485={};_0x5b485[_0x1f92eb]={'$like':'%'+_0x27d4ca['query'][_0xe45d('0x48')]+'%'};return _0x5b485;})});}if(_0x27d4ca[_0xe45d('0x2b')][_0xe45d('0x49')]){var _0x487db1=_0x27d4ca[_0xe45d('0x2b')][_0xe45d('0x49')][_0xe45d('0x4a')](',');var _0x445421={};_0x445421[_0x487db1[0x0]]={'$gte':moment(_0x487db1[0x1])['format'](_0xe45d('0x4b'))};_0x45ce0b['where']=_[_0xe45d('0x37')](_0x45ce0b['where'],_0x445421);}_0x45ce0b=_['merge']({},_0x45ce0b,_0x27d4ca[_0xe45d('0x38')]);return db[_0xe45d('0x42')][_0xe45d('0x17')]({'where':_0x45ce0b[_0xe45d('0x46')]})[_0xe45d('0x1b')](function(_0x49ba1b){_0x5c718c['count']=_0x49ba1b;if(_0x27d4ca[_0xe45d('0x2b')][_0xe45d('0x4c')]){_0x45ce0b[_0xe45d('0x36')]=[{'all':!![]}];}return db[_0xe45d('0x42')][_0xe45d('0x27')](_0x45ce0b);})[_0xe45d('0x1b')](function(_0x5dee3d){_0x5c718c[_0xe45d('0x4d')]=_0x5dee3d;return _0x5c718c;});}})[_0xe45d('0x1b')](respondWithFilteredResult(_0x40ea97,_0x45ce0b))['catch'](handleError(_0x40ea97,null));};exports[_0xe45d('0x4e')]=function(_0x4f26ee,_0x34d018){return db[_0xe45d('0x2f')][_0xe45d('0x39')]({'where':{'id':_0x4f26ee[_0xe45d('0x2d')]['id']}})[_0xe45d('0x1b')](handleEntityNotFound(_0x34d018,null))[_0xe45d('0x1b')](function(_0x322710){if(_0x322710){return _0x322710[_0xe45d('0x4f')](_0x4f26ee['body'][_0xe45d('0x3f')],_[_0xe45d('0x3e')](_0x4f26ee['body'],[_0xe45d('0x3f'),'id'])||{})[_0xe45d('0x50')](function(){return db['Tag'][_0xe45d('0x27')]({'attributes':['id',_0xe45d('0x1f'),_0xe45d('0x51')],'where':{'id':_0x4f26ee[_0xe45d('0x3b')][_0xe45d('0x3f')]}});})['then'](function(_0x574974){socket[_0xe45d('0x52')](_0xe45d('0x53'),{'id':Number(_0x4f26ee[_0xe45d('0x2d')]['id']),'tags':_0x574974||[]});return{'id':Number(_0x4f26ee[_0xe45d('0x2d')]['id']),'tags':_0x574974||[]};});}})[_0xe45d('0x1b')](respondWithResult(_0x34d018,null))[_0xe45d('0x2a')](handleError(_0x34d018,null));};exports[_0xe45d('0x54')]=function(_0x29ef5b,_0x5da784){return db[_0xe45d('0x2f')][_0xe45d('0x39')]({'where':{'id':_0x29ef5b[_0xe45d('0x2d')]['id']}})[_0xe45d('0x1b')](handleEntityNotFound(_0x5da784,null))[_0xe45d('0x1b')](function(_0x3df710){if(_0x3df710){return _0x3df710[_0xe45d('0x54')](_0x29ef5b[_0xe45d('0x2b')][_0xe45d('0x3f')]);}})['then'](respondWithStatusCode(_0x5da784,null))['catch'](handleError(_0x5da784,null));};exports['download']=function(_0x11e5e2,_0xedc4f1){var _0x48fcd2=moment()[_0xe45d('0x55')]()[_0xe45d('0x56')]();var _0x3d78ba=path['join'](config['root'],'server',_0xe45d('0x57'),_0xe45d('0x58'));var _0x1a3608=path[_0xe45d('0x59')](config[_0xe45d('0x5a')],_0xe45d('0x5b'),_0xe45d('0x57'),_0xe45d('0x5c'));var _0x2e3445=path[_0xe45d('0x59')](_0x3d78ba,_0x48fcd2);var _0x18e804=util[_0xe45d('0x5d')]('transcript-%d-%s.zip',_0x11e5e2[_0xe45d('0x2d')]['id'],_0x48fcd2);var _0x3ec4fc=path[_0xe45d('0x59')](_0x3d78ba,_0x18e804);var _0x193b02=[];_0x193b02[_0xe45d('0x5e')]({'model':db[_0xe45d('0x5f')],'as':_0xe45d('0x5f'),'attributes':['id','fullname'],'raw':!![]});_0x193b02[_0xe45d('0x5e')]({'model':db[_0xe45d('0x60')],'as':_0xe45d('0x61'),'attributes':['id',_0xe45d('0x62'),'lastName'],'raw':!![]});if(_0x11e5e2['query']['attachments']){_0x193b02[_0xe45d('0x5e')]({'model':db['Attachment'],'as':_0xe45d('0x63'),'raw':!![]});}var _0x35ed82=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id','body',_0xe45d('0x64'),'direction','secret',_0xe45d('0x65')],'include':_0x193b02}];_0x35ed82[_0xe45d('0x5e')]({'model':db[_0xe45d('0x66')],'as':_0xe45d('0x67'),'attributes':['id',_0xe45d('0x1f')]});_0x35ed82['push']({'model':db[_0xe45d('0x5f')],'as':_0xe45d('0x68'),'attributes':['id','fullname']});return db[_0xe45d('0x2f')][_0xe45d('0x39')]({'where':{'id':_0x11e5e2[_0xe45d('0x2d')]['id']},'include':_0x35ed82})[_0xe45d('0x1b')](handleEntityNotFound(_0xedc4f1,null))[_0xe45d('0x1b')](function(_0xb593c8){if(_0xb593c8){var _0x38004c=_0xb593c8['get']({'plain':!![]});fs[_0xe45d('0x69')](_0x2e3445);var _0x5d8827={'channel':_0xe45d('0x6a'),'account':_0x38004c[_0xe45d('0x67')][_0xe45d('0x1f')],'agent':_0x38004c[_0xe45d('0x68')]?_0x38004c[_0xe45d('0x68')][_0xe45d('0x6b')]:_0xe45d('0x6c'),'createdAt':moment(_0x38004c[_0xe45d('0x64')])[_0xe45d('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe45d('0x56')](),'closedAt':_0x38004c[_0xe45d('0x6d')]?moment(_0x38004c[_0xe45d('0x6e')])[_0xe45d('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe45d('0x56')]():'','disposition':_0x38004c[_0xe45d('0x6f')],'visibility':_0x38004c[_0xe45d('0x70')]?_0xe45d('0x71'):_0xe45d('0x72'),'messages':_(_0x38004c[_0xe45d('0x73')])[_0xe45d('0x48')]({'secret':![]})[_0xe45d('0x21')](function(_0x55868f){if(_0x55868f[_0xe45d('0x63')]){var _0x4cd641=path[_0xe45d('0x59')](_0x1a3608,_0x55868f[_0xe45d('0x63')][_0xe45d('0x74')]);if(fs[_0xe45d('0x75')](_0x4cd641)){fs[_0xe45d('0x76')](_0x4cd641)[_0xe45d('0x77')](fs[_0xe45d('0x78')](path['join'](_0x2e3445,_0x55868f[_0xe45d('0x63')][_0xe45d('0x74')])));}}return{'date':moment(_0x55868f[_0xe45d('0x64')])[_0xe45d('0x5d')](_0xe45d('0x4b'))[_0xe45d('0x56')](),'sender':_0x55868f[_0xe45d('0x79')]==='out'?_0x55868f['User']?_0x55868f[_0xe45d('0x5f')][_0xe45d('0x6b')]:'System':_0x55868f[_0xe45d('0x61')][_0xe45d('0x62')]+(_0x55868f[_0xe45d('0x61')]['lastName']?'\x20'+_0x55868f['Contact'][_0xe45d('0x7a')]:''),'body':_0x55868f[_0xe45d('0x63')]?_0x55868f[_0xe45d('0x63')][_0xe45d('0x74')]:_0x55868f['body'],'direction':_0x55868f['direction']===_0xe45d('0x7b')?'A':'C','secret':_0x55868f[_0xe45d('0x7c')],'read':_0x55868f[_0xe45d('0x65')],'attachment':_0x55868f[_0xe45d('0x63')]};})[_0xe45d('0x7d')]()};return ejs[_0xe45d('0x7e')](path[_0xe45d('0x59')](config[_0xe45d('0x5a')],_0xe45d('0x5b'),_0xe45d('0x7f'),_0xe45d('0x80')),{'interaction':_0x5d8827})[_0xe45d('0x1b')](function(_0x37faa1){var _0xd4820a=path['join'](_0x2e3445,'transcript-'+_0x38004c['id']+'-'+_0x48fcd2+_0xe45d('0x81'));var _0x3a8081={'path':_0xd4820a,'channel':_0xe45d('0x6a'),'interactionId':_0x38004c['id']};return pdf[_0xe45d('0x82')](_0x37faa1,_0x3a8081);})[_0xe45d('0x1b')](function(){return new Promise(function(_0x5a4de2,_0x690338){zipdir(_0x2e3445,{'saveTo':_0x3ec4fc},function(_0x1183ef,_0x30824b){if(_0x1183ef)return _0x690338(_0x1183ef);return _0x5a4de2(_0x30824b);});})['then'](function(){return new Promise(function(_0x7ea3ce,_0x22630f){rimraf(_0x2e3445,function(_0x57ca46){if(_0x57ca46)_0x22630f(_0x57ca46);return _0x7ea3ce();});});})[_0xe45d('0x1b')](function(){return _0xedc4f1[_0xe45d('0x83')](_0x3ec4fc,_0x18e804,function(_0x1fe977){if(_0x1fe977){logger[_0xe45d('0x1d')](_0xe45d('0x84'),_0x1fe977);}else{fs[_0xe45d('0x85')](_0x3ec4fc);}});});});}else{return _0xedc4f1[_0xe45d('0x86')](0xc8);}})[_0xe45d('0x2a')](handleError(_0xedc4f1,null));}; \ No newline at end of file +var _0x00bf=['defaults','redis','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','stack','name','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','getOptions','findAll','openchannel','query','catch','from','params','model','keys','intersection','attributes','fields','length','includeAll','merge','create','body','find','describe','addMessage','OpenchannelMessage','ids','getMessages','filters','hasOwnProperty','order','sort','where','OpenchannelInteractionId','filter','split','options','rows','addTags','setTags','omit','color','emit','removeTags','download','unix','toString','root','files','tmp','join','attachments','push','User','fullname','firstName','lastName','Attachment','createdAt','secret','read','Account','get','mkdirSync','Openchannel','Owner','format','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','threadId','Public','Private','Messages','basename','createReadStream','pipe','direction','out','System','Contact','renderFile','server','downloadInteraction.ejs','.pdf','createPdfFromHTML','error','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x00bf,0x15c));var _0xf00b=function(_0x41197a,_0xd1b91d){_0x41197a=_0x41197a-0x0;var _0x5b083e=_0x00bf[_0x41197a];return _0x5b083e;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xf00b('0x0'));var moment=require(_0xf00b('0x1'));var util=require(_0xf00b('0x2'));var path=require(_0xf00b('0x3'));var ejs=require(_0xf00b('0x4'));var fs=require('fs');var _=require(_0xf00b('0x5'));var Redis=require(_0xf00b('0x6'));var interaction=require(_0xf00b('0x7'));var qs=require(_0xf00b('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0xf00b('0x9'))('api');var config=require(_0xf00b('0xa'));var db=require(_0xf00b('0xb'))['db'];config['redis']=_[_0xf00b('0xc')](config[_0xf00b('0xd')],{'host':_0xf00b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf00b('0xd')]));require(_0xf00b('0xf'))[_0xf00b('0x10')](socket);function respondWithStatusCode(_0x4ce85d,_0x208370){_0x208370=_0x208370||0xcc;return function(_0x488727){if(_0x488727){return _0x4ce85d[_0xf00b('0x11')](_0x208370);}return _0x4ce85d[_0xf00b('0x12')](_0x208370)[_0xf00b('0x13')]();};}function respondWithResult(_0xcf7ae0,_0x20d800){_0x20d800=_0x20d800||0xc8;return function(_0x319308){if(_0x319308){return _0xcf7ae0['status'](_0x20d800)['json'](_0x319308);}};}function respondWithFilteredResult(_0x32ad28,_0x11758d){return function(_0x2fe3a6){if(_0x2fe3a6){var _0x27b180=typeof _0x11758d[_0xf00b('0x14')]===_0xf00b('0x15')&&typeof _0x11758d[_0xf00b('0x16')]===_0xf00b('0x15');var _0x37d276=_0x2fe3a6[_0xf00b('0x17')];var _0x2872ae=_0x27b180?0x0:_0x11758d[_0xf00b('0x14')];var _0x47ed46=_0x27b180?_0x2fe3a6['count']:_0x11758d[_0xf00b('0x14')]+_0x11758d[_0xf00b('0x16')];var _0x4c84ae;if(_0x47ed46>=_0x37d276){_0x47ed46=_0x37d276;_0x4c84ae=0xc8;}else{_0x4c84ae=0xce;}_0x32ad28[_0xf00b('0x12')](_0x4c84ae);return _0x32ad28[_0xf00b('0x18')](_0xf00b('0x19'),_0x2872ae+'-'+_0x47ed46+'/'+_0x37d276)[_0xf00b('0x1a')](_0x2fe3a6);}return null;};}function saveUpdates(_0xf0f97){return function(_0x2a4303){if(_0x2a4303){return _0x2a4303[_0xf00b('0x1b')](_0xf0f97)[_0xf00b('0x1c')](function(_0x5bf418){return _0x5bf418;});}return null;};}function removeEntity(_0x2bfedf){return function(_0x3be7d8){if(_0x3be7d8){return _0x3be7d8[_0xf00b('0x1d')]()[_0xf00b('0x1c')](function(){_0x2bfedf[_0xf00b('0x12')](0xcc)[_0xf00b('0x13')]();});}};}function handleEntityNotFound(_0x1c3592){return function(_0x21da28){if(!_0x21da28){_0x1c3592[_0xf00b('0x11')](0x194);}return _0x21da28;};}function handleError(_0xf319bb,_0x37d093){_0x37d093=_0x37d093||0x1f4;return function(_0x938bff){logger['error'](_0x938bff[_0xf00b('0x1e')]);if(_0x938bff[_0xf00b('0x1f')]){delete _0x938bff['name'];}_0xf319bb[_0xf00b('0x12')](_0x37d093)['send'](_0x938bff);};}exports[_0xf00b('0x20')]=function(_0x42e6ff,_0x2e5226){var _0x31664a={};var _0xdbb755=_[_0xf00b('0x21')](db[_0xf00b('0x22')][_0xf00b('0x23')],function(_0x1acbd3){return{'name':_0x1acbd3[_0xf00b('0x24')],'type':_0x1acbd3[_0xf00b('0x25')]['key']};});_0x31664a=qs[_0xf00b('0x26')](_0xdbb755,_0x42e6ff);return interaction[_0xf00b('0x27')](_0xf00b('0x28'),_0x42e6ff[_0xf00b('0x29')],_0x42e6ff['user'],_0x31664a,_0xdbb755)['then'](respondWithFilteredResult(_0x2e5226,_0x31664a))[_0xf00b('0x2a')](handleError(_0x2e5226,null));};exports['show']=function(_0x1cccc1,_0x261310){var _0x433659={};if(_0x1cccc1[_0xf00b('0x29')]['type']&&_0x1cccc1[_0xf00b('0x29')][_0xf00b('0x25')]===_0xf00b('0x2b')){_0x433659['from']=_0x1cccc1[_0xf00b('0x2c')]['id'];}else{_0x433659['id']=_0x1cccc1['params']['id'];}var _0x3cd6f2={'raw':![],'where':_0x433659},_0x1aaa79={};_0x1aaa79[_0xf00b('0x2d')]=_[_0xf00b('0x2e')](db['OpenchannelInteraction']['rawAttributes']);_0x1aaa79['query']=_['keys'](_0x1cccc1[_0xf00b('0x29')]);_0x1aaa79['filters']=_[_0xf00b('0x2f')](_0x1aaa79[_0xf00b('0x2d')],_0x1aaa79[_0xf00b('0x29')]);_0x3cd6f2[_0xf00b('0x30')]=_['intersection'](_0x1aaa79[_0xf00b('0x2d')],qs[_0xf00b('0x31')](_0x1cccc1['query'][_0xf00b('0x31')]));_0x3cd6f2[_0xf00b('0x30')]=_0x3cd6f2['attributes'][_0xf00b('0x32')]?_0x3cd6f2[_0xf00b('0x30')]:_0x1aaa79['model'];if(_0x1cccc1[_0xf00b('0x29')][_0xf00b('0x33')]){_0x3cd6f2['include']=[{'all':!![]}];}_0x3cd6f2=_[_0xf00b('0x34')]({},_0x3cd6f2,_0x1cccc1['options']);return db[_0xf00b('0x22')]['find'](_0x3cd6f2)[_0xf00b('0x1c')](handleEntityNotFound(_0x261310,null))[_0xf00b('0x1c')](respondWithResult(_0x261310,null))[_0xf00b('0x2a')](handleError(_0x261310,null));};exports[_0xf00b('0x35')]=function(_0x3d1f2a,_0x5347e3){return db['OpenchannelInteraction'][_0xf00b('0x35')](_0x3d1f2a[_0xf00b('0x36')],{})['then'](respondWithResult(_0x5347e3,0xc9))[_0xf00b('0x2a')](handleError(_0x5347e3,null));};exports['update']=function(_0x15cb30,_0x119a17){if(_0x15cb30[_0xf00b('0x36')]['id']){delete _0x15cb30[_0xf00b('0x36')]['id'];}return db[_0xf00b('0x22')][_0xf00b('0x37')]({'where':{'id':_0x15cb30[_0xf00b('0x2c')]['id']}})[_0xf00b('0x1c')](handleEntityNotFound(_0x119a17,null))['then'](saveUpdates(_0x15cb30['body'],null))[_0xf00b('0x1c')](respondWithResult(_0x119a17,null))[_0xf00b('0x2a')](handleError(_0x119a17,null));};exports[_0xf00b('0x1d')]=function(_0x40d7c4,_0x45ca0c){return db[_0xf00b('0x22')][_0xf00b('0x37')]({'where':{'id':_0x40d7c4[_0xf00b('0x2c')]['id']}})['then'](handleEntityNotFound(_0x45ca0c,null))['then'](removeEntity(_0x45ca0c,null))[_0xf00b('0x2a')](handleError(_0x45ca0c,null));};exports[_0xf00b('0x38')]=function(_0x260134,_0x12b20){return db['OpenchannelInteraction'][_0xf00b('0x38')]()[_0xf00b('0x1c')](respondWithResult(_0x12b20,null))['catch'](handleError(_0x12b20,null));};exports[_0xf00b('0x39')]=function(_0x1c079d,_0x49fce9){return db[_0xf00b('0x3a')][_0xf00b('0x37')]({'where':{'id':_0x1c079d[_0xf00b('0x2c')]['id']}})[_0xf00b('0x1c')](handleEntityNotFound(_0x49fce9,null))['then'](function(_0x29f7c5){if(_0x29f7c5){return _0x29f7c5['addMessage'](_0x1c079d['body'][_0xf00b('0x3b')],_['omit'](_0x1c079d[_0xf00b('0x36')],[_0xf00b('0x3b'),'id'])||{});}})['then'](respondWithResult(_0x49fce9,null))[_0xf00b('0x2a')](handleError(_0x49fce9,null));};exports[_0xf00b('0x3c')]=function(_0x369a20,_0x14478b){var _0x32d47d={'raw':![],'where':{}};var _0x4dca68={};var _0x120d82={'count':0x0,'rows':[]};return db[_0xf00b('0x22')]['findOne']({'where':{'id':_0x369a20['params']['id']}})[_0xf00b('0x1c')](handleEntityNotFound(_0x14478b,null))[_0xf00b('0x1c')](function(_0xf6a86){if(_0xf6a86){_0x4dca68[_0xf00b('0x2d')]=_[_0xf00b('0x2e')](db['OpenchannelMessage'][_0xf00b('0x23')]);_0x4dca68[_0xf00b('0x29')]=_[_0xf00b('0x2e')](_0x369a20[_0xf00b('0x29')]);_0x4dca68[_0xf00b('0x3d')]=_['intersection'](_0x4dca68[_0xf00b('0x2d')],_0x4dca68['query']);_0x32d47d['attributes']=_['intersection'](_0x4dca68[_0xf00b('0x2d')],qs[_0xf00b('0x31')](_0x369a20[_0xf00b('0x29')]['fields']));_0x32d47d[_0xf00b('0x30')]=_0x32d47d[_0xf00b('0x30')][_0xf00b('0x32')]?_0x32d47d['attributes']:_0x4dca68[_0xf00b('0x2d')];if(!_0x369a20['query'][_0xf00b('0x3e')]('nolimit')){_0x32d47d[_0xf00b('0x16')]=qs['limit'](_0x369a20['query'][_0xf00b('0x16')]);_0x32d47d['offset']=qs[_0xf00b('0x14')](_0x369a20[_0xf00b('0x29')][_0xf00b('0x14')]);}_0x32d47d[_0xf00b('0x3f')]=qs[_0xf00b('0x40')](_0x369a20[_0xf00b('0x29')]['sort']);_0x32d47d[_0xf00b('0x41')]=qs[_0xf00b('0x3d')](_['pick'](_0x369a20[_0xf00b('0x29')],_0x4dca68[_0xf00b('0x3d')]));_0x32d47d[_0xf00b('0x41')][_0xf00b('0x42')]=_0xf6a86['id'];if(_0x369a20['query'][_0xf00b('0x43')]){_0x32d47d[_0xf00b('0x41')]=_[_0xf00b('0x34')](_0x32d47d[_0xf00b('0x41')],{'$or':_['map'](_0x32d47d[_0xf00b('0x30')],function(_0x1e68bd){var _0x3d61dd={};_0x3d61dd[_0x1e68bd]={'$like':'%'+_0x369a20[_0xf00b('0x29')]['filter']+'%'};return _0x3d61dd;})});}if(_0x369a20[_0xf00b('0x29')]['$gte']){var _0x467f58=_0x369a20[_0xf00b('0x29')]['$gte'][_0xf00b('0x44')](',');var _0x55866f={};_0x55866f[_0x467f58[0x0]]={'$gte':moment(_0x467f58[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x32d47d['where']=_['merge'](_0x32d47d[_0xf00b('0x41')],_0x55866f);}_0x32d47d=_[_0xf00b('0x34')]({},_0x32d47d,_0x369a20[_0xf00b('0x45')]);return db[_0xf00b('0x3a')][_0xf00b('0x17')]({'where':_0x32d47d[_0xf00b('0x41')]})[_0xf00b('0x1c')](function(_0x1619ba){_0x120d82[_0xf00b('0x17')]=_0x1619ba;if(_0x369a20[_0xf00b('0x29')][_0xf00b('0x33')]){_0x32d47d['include']=[{'all':!![]}];}return db[_0xf00b('0x3a')][_0xf00b('0x27')](_0x32d47d);})['then'](function(_0x4fca75){_0x120d82[_0xf00b('0x46')]=_0x4fca75;return _0x120d82;});}})[_0xf00b('0x1c')](respondWithFilteredResult(_0x14478b,_0x32d47d))['catch'](handleError(_0x14478b,null));};exports[_0xf00b('0x47')]=function(_0xeb77fa,_0x2899f1){return db[_0xf00b('0x22')]['find']({'where':{'id':_0xeb77fa[_0xf00b('0x2c')]['id']}})[_0xf00b('0x1c')](handleEntityNotFound(_0x2899f1,null))[_0xf00b('0x1c')](function(_0x219afa){if(_0x219afa){return _0x219afa[_0xf00b('0x48')](_0xeb77fa[_0xf00b('0x36')]['ids'],_[_0xf00b('0x49')](_0xeb77fa[_0xf00b('0x36')],[_0xf00b('0x3b'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0xf00b('0x1f'),_0xf00b('0x4a')],'where':{'id':_0xeb77fa[_0xf00b('0x36')]['ids']}});})[_0xf00b('0x1c')](function(_0x3338df){socket[_0xf00b('0x4b')]('openchannelInteractionTags:save',{'id':Number(_0xeb77fa[_0xf00b('0x2c')]['id']),'tags':_0x3338df||[]});return{'id':Number(_0xeb77fa[_0xf00b('0x2c')]['id']),'tags':_0x3338df||[]};});}})['then'](respondWithResult(_0x2899f1,null))[_0xf00b('0x2a')](handleError(_0x2899f1,null));};exports['removeTags']=function(_0x3b84a0,_0x1abfc3){return db[_0xf00b('0x22')][_0xf00b('0x37')]({'where':{'id':_0x3b84a0[_0xf00b('0x2c')]['id']}})[_0xf00b('0x1c')](handleEntityNotFound(_0x1abfc3,null))['then'](function(_0x495472){if(_0x495472){return _0x495472[_0xf00b('0x4c')](_0x3b84a0[_0xf00b('0x29')][_0xf00b('0x3b')]);}})[_0xf00b('0x1c')](respondWithStatusCode(_0x1abfc3,null))[_0xf00b('0x2a')](handleError(_0x1abfc3,null));};exports[_0xf00b('0x4d')]=function(_0x334c7b,_0x462a5f){var _0x3efd7e=moment()[_0xf00b('0x4e')]()[_0xf00b('0x4f')]();var _0x52ac95=path['join'](config[_0xf00b('0x50')],'server',_0xf00b('0x51'),_0xf00b('0x52'));var _0x28cf77=path[_0xf00b('0x53')](config['root'],'server',_0xf00b('0x51'),_0xf00b('0x54'));var _0x19c3b8=path['join'](_0x52ac95,_0x3efd7e);var _0x573608=util['format']('transcript-%d-%s.zip',_0x334c7b[_0xf00b('0x2c')]['id'],_0x3efd7e);var _0x58a98d=path[_0xf00b('0x53')](_0x52ac95,_0x573608);var _0x5f850=[];_0x5f850[_0xf00b('0x55')]({'model':db[_0xf00b('0x56')],'as':_0xf00b('0x56'),'attributes':['id',_0xf00b('0x57')],'raw':!![]});_0x5f850[_0xf00b('0x55')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xf00b('0x58'),_0xf00b('0x59')],'raw':!![]});if(_0x334c7b[_0xf00b('0x29')]['attachments']){_0x5f850[_0xf00b('0x55')]({'model':db[_0xf00b('0x5a')],'as':_0xf00b('0x5a'),'raw':!![]});}var _0x1ed12d=[{'model':db[_0xf00b('0x3a')],'as':'Messages','attributes':['id',_0xf00b('0x36'),_0xf00b('0x5b'),'direction',_0xf00b('0x5c'),_0xf00b('0x5d')],'include':_0x5f850}];_0x1ed12d[_0xf00b('0x55')]({'model':db['OpenchannelAccount'],'as':_0xf00b('0x5e'),'attributes':['id','name']});_0x1ed12d[_0xf00b('0x55')]({'model':db['User'],'as':'Owner','attributes':['id',_0xf00b('0x57')]});return db[_0xf00b('0x22')][_0xf00b('0x37')]({'where':{'id':_0x334c7b[_0xf00b('0x2c')]['id']},'include':_0x1ed12d})[_0xf00b('0x1c')](handleEntityNotFound(_0x462a5f,null))[_0xf00b('0x1c')](function(_0xace3c2){if(_0xace3c2){var _0x6b1299=_0xace3c2[_0xf00b('0x5f')]({'plain':!![]});fs[_0xf00b('0x60')](_0x19c3b8);var _0x2e4b5e={'channel':_0xf00b('0x61'),'account':_0x6b1299[_0xf00b('0x5e')][_0xf00b('0x1f')],'agent':_0x6b1299[_0xf00b('0x62')]?_0x6b1299[_0xf00b('0x62')]['fullname']:'N.A.','createdAt':moment(_0x6b1299[_0xf00b('0x5b')])[_0xf00b('0x63')](_0xf00b('0x64'))[_0xf00b('0x4f')](),'closedAt':_0x6b1299[_0xf00b('0x65')]?moment(_0x6b1299['closedAt'])[_0xf00b('0x63')](_0xf00b('0x64'))[_0xf00b('0x4f')]():'','disposition':_0x6b1299[_0xf00b('0x66')],'visibility':_0x6b1299[_0xf00b('0x67')]?_0xf00b('0x68'):_0xf00b('0x69'),'messages':_(_0x6b1299[_0xf00b('0x6a')])[_0xf00b('0x43')]({'secret':![]})['map'](function(_0x3fde91){if(_0x3fde91['Attachment']){var _0x3f908e=path[_0xf00b('0x53')](_0x28cf77,_0x3fde91[_0xf00b('0x5a')][_0xf00b('0x6b')]);if(fs['existsSync'](_0x3f908e)){fs[_0xf00b('0x6c')](_0x3f908e)[_0xf00b('0x6d')](fs['createWriteStream'](path[_0xf00b('0x53')](_0x19c3b8,_0x3fde91[_0xf00b('0x5a')]['basename'])));}}return{'date':moment(_0x3fde91[_0xf00b('0x5b')])[_0xf00b('0x63')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf00b('0x4f')](),'sender':_0x3fde91[_0xf00b('0x6e')]===_0xf00b('0x6f')?_0x3fde91[_0xf00b('0x56')]?_0x3fde91[_0xf00b('0x56')][_0xf00b('0x57')]:_0xf00b('0x70'):_0x3fde91[_0xf00b('0x71')]['firstName']+(_0x3fde91['Contact']['lastName']?'\x20'+_0x3fde91[_0xf00b('0x71')][_0xf00b('0x59')]:''),'body':_0x3fde91[_0xf00b('0x5a')]?_0x3fde91[_0xf00b('0x5a')][_0xf00b('0x6b')]:_0x3fde91[_0xf00b('0x36')],'direction':_0x3fde91['direction']===_0xf00b('0x6f')?'A':'C','secret':_0x3fde91[_0xf00b('0x5c')],'read':_0x3fde91[_0xf00b('0x5d')],'attachment':_0x3fde91[_0xf00b('0x5a')]};})['value']()};return ejs[_0xf00b('0x72')](path[_0xf00b('0x53')](config[_0xf00b('0x50')],_0xf00b('0x73'),'views',_0xf00b('0x74')),{'interaction':_0x2e4b5e})[_0xf00b('0x1c')](function(_0x149424){var _0x24e61e=path[_0xf00b('0x53')](_0x19c3b8,'transcript-'+_0x6b1299['id']+'-'+_0x3efd7e+_0xf00b('0x75'));var _0x326ead={'path':_0x24e61e,'channel':_0xf00b('0x61'),'interactionId':_0x6b1299['id']};return pdf[_0xf00b('0x76')](_0x149424,_0x326ead);})[_0xf00b('0x1c')](function(){return new Promise(function(_0x210e13,_0x23f156){zipdir(_0x19c3b8,{'saveTo':_0x58a98d},function(_0x5d5aad,_0x523841){if(_0x5d5aad)return _0x23f156(_0x5d5aad);return _0x210e13(_0x523841);});})[_0xf00b('0x1c')](function(){return new Promise(function(_0x3a80c6,_0x8ee5fd){rimraf(_0x19c3b8,function(_0x46c116){if(_0x46c116)_0x8ee5fd(_0x46c116);return _0x3a80c6();});});})['then'](function(){return _0x462a5f['download'](_0x58a98d,_0x573608,function(_0x38cc0f){if(_0x38cc0f){logger[_0xf00b('0x77')]('Unable\x20to\x20delete\x20zip\x20file',_0x38cc0f);}else{fs['unlinkSync'](_0x58a98d);}});});});}else{return _0x462a5f[_0xf00b('0x11')](0xc8);}})[_0xf00b('0x2a')](handleError(_0x462a5f,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 8b93a4b..9375c25 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 _0x2842=['save','update','remove','then','setDataValue','Users','map','length','emit','hasOwnProperty','hook','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x422be2,_0x1c439e){var _0x1b820e=function(_0x513cc8){while(--_0x513cc8){_0x422be2['push'](_0x422be2['shift']());}};_0x1b820e(++_0x1c439e);}(_0x2842,0x1c6));var _0x2284=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2842[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x2284('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x2284('0x1')];var OpenchannelMessage=require(_0x2284('0x2'))['db'][_0x2284('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x2284('0x4')](0x0);var events={'afterCreate':_0x2284('0x5'),'afterUpdate':_0x2284('0x6'),'afterDestroy':_0x2284('0x7')};function emitEvent(_0x23f91c){return function(_0x4a1a95,_0x12c21d,_0x3d1de3){_0x4a1a95['getUsers']({'attributes':['id'],'raw':!![]})[_0x2284('0x8')](function(_0x49b8bf){_0x4a1a95[_0x2284('0x9')](_0x2284('0xa'),_0x49b8bf[_0x2284('0xb')](function(_0x26c941){return{'id':_0x26c941['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x4a1a95['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xceb45b){_0x4a1a95[_0x2284('0x9')]('unreadMessages',_0xceb45b[_0x2284('0xc')]);OpenchannelInteractionEvents[_0x2284('0xd')](_0x23f91c+':'+_0x4a1a95['id'],_0x4a1a95);OpenchannelInteractionEvents[_0x2284('0xd')](_0x23f91c,_0x4a1a95);_0x3d1de3(null);})['catch'](_0x3d1de3(null));};}for(var e in events){if(events[_0x2284('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x2284('0xf')](e,emitEvent(event));}}module[_0x2284('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x3c57=['emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','remove','getUsers','then','Users','map','findAll','unreadMessages'];(function(_0x2fe780,_0x2f3093){var _0x1200a6=function(_0x3748c6){while(--_0x3748c6){_0x2fe780['push'](_0x2fe780['shift']());}};_0x1200a6(++_0x2f3093);}(_0x3c57,0x1f1));var _0x73c5=function(_0x4d5b88,_0x4304bf){_0x4d5b88=_0x4d5b88-0x0;var _0x4a5d44=_0x3c57[_0x4d5b88];return _0x4a5d44;};'use strict';var EventEmitter=require(_0x73c5('0x0'));var OpenchannelInteraction=require(_0x73c5('0x1'))['db'][_0x73c5('0x2')];var OpenchannelMessage=require(_0x73c5('0x1'))['db'][_0x73c5('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x73c5('0x4')](0x0);var events={'afterCreate':_0x73c5('0x5'),'afterUpdate':'update','afterDestroy':_0x73c5('0x6')};function emitEvent(_0x3d0abe){return function(_0x433707,_0x583480,_0x30626d){_0x433707[_0x73c5('0x7')]({'attributes':['id'],'raw':!![]})[_0x73c5('0x8')](function(_0x4cee49){_0x433707['setDataValue'](_0x73c5('0x9'),_0x4cee49[_0x73c5('0xa')](function(_0x1c3ba4){return{'id':_0x1c3ba4['id']};}));return OpenchannelMessage[_0x73c5('0xb')]({'where':{'OpenchannelInteractionId':_0x433707['id'],'direction':'in','read':![]},'raw':!![]});})[_0x73c5('0x8')](function(_0x46bf49){_0x433707['setDataValue'](_0x73c5('0xc'),_0x46bf49['length']);OpenchannelInteractionEvents[_0x73c5('0xd')](_0x3d0abe+':'+_0x433707['id'],_0x433707);OpenchannelInteractionEvents[_0x73c5('0xd')](_0x3d0abe,_0x433707);_0x30626d(null);})[_0x73c5('0xe')](_0x30626d(null));};}for(var e in events){if(events[_0x73c5('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x73c5('0x10')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index dbebda4..82b4bb3 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 _0x78fc=['YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed','closedAt','format'];(function(_0xd2938f,_0x26a2b4){var _0x37df71=function(_0x55f22b){while(--_0x55f22b){_0xd2938f['push'](_0xd2938f['shift']());}};_0x37df71(++_0x26a2b4);}(_0x78fc,0x100));var _0xc78f=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x78fc[_0x46d0c9];return _0x174506;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc78f('0x0'))(_0xc78f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc78f('0x2'));var fs=require('fs');var path=require(_0xc78f('0x3'));var rimraf=require(_0xc78f('0x4'));var config=require(_0xc78f('0x5'));var attributes=require(_0xc78f('0x6'));module[_0xc78f('0x7')]=function(_0x172af2,_0x1a2b21){return _0x172af2[_0xc78f('0x8')](_0xc78f('0x9'),attributes,{'tableName':_0xc78f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc78f('0xb'),'collate':_0xc78f('0xc'),'hooks':{'beforeUpdate':function(_0x198b6f,_0x305461,_0x5156b7){if(_0x198b6f['changed'](_0xc78f('0xd'))){_0x198b6f[_0xc78f('0xe')]=moment()[_0xc78f('0xf')](_0xc78f('0x10'));}_0x5156b7(null,_0x198b6f);}}});}; \ No newline at end of file +var _0x1357=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4_unicode_ci','closed'];(function(_0x4b068a,_0x3cd89f){var _0x4a92e5=function(_0x2cdb5d){while(--_0x2cdb5d){_0x4b068a['push'](_0x4b068a['shift']());}};_0x4a92e5(++_0x3cd89f);}(_0x1357,0x1b3));var _0x7135=function(_0x313b01,_0x3532e5){_0x313b01=_0x313b01-0x0;var _0xa1a400=_0x1357[_0x313b01];return _0xa1a400;};'use strict';var _=require(_0x7135('0x0'));var util=require(_0x7135('0x1'));var logger=require(_0x7135('0x2'))('api');var moment=require(_0x7135('0x3'));var BPromise=require(_0x7135('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7135('0x5'));var rimraf=require(_0x7135('0x6'));var config=require('../../config/environment');var attributes=require(_0x7135('0x7'));module[_0x7135('0x8')]=function(_0x17206b,_0x2e20e5){return _0x17206b[_0x7135('0x9')]('OpenchannelInteraction',attributes,{'tableName':_0x7135('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7135('0xb'),'hooks':{'beforeUpdate':function(_0x47df87,_0x285cd5,_0x13b2d5){if(_0x47df87['changed'](_0x7135('0xc'))){_0x47df87[_0x7135('0xd')]=moment()[_0x7135('0xe')](_0x7135('0xf'));}_0x13b2d5(null,_0x47df87);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 95806b9..86cfa3f 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 _0x95bf=['AddTagsToOpenchannelInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','attributes','limit','debug','stringify'];(function(_0x5746a3,_0x8ef89d){var _0xd22ded=function(_0x508eb8){while(--_0x508eb8){_0x5746a3['push'](_0x5746a3['shift']());}};_0xd22ded(++_0x8ef89d);}(_0x95bf,0x1ac));var _0xf95b=function(_0x5a72b9,_0x149c53){_0x5a72b9=_0x5a72b9-0x0;var _0x4b03f3=_0x95bf[_0x5a72b9];return _0x4b03f3;};'use strict';var _=require(_0xf95b('0x0'));var util=require('util');var moment=require(_0xf95b('0x1'));var BPromise=require(_0xf95b('0x2'));var rs=require(_0xf95b('0x3'));var fs=require('fs');var Redis=require(_0xf95b('0x4'));var db=require(_0xf95b('0x5'))['db'];var utils=require(_0xf95b('0x6'));var logger=require(_0xf95b('0x7'))(_0xf95b('0x8'));var config=require(_0xf95b('0x9'));var jayson=require(_0xf95b('0xa'));var client=jayson[_0xf95b('0xb')]['http']({'port':0x232a});config[_0xf95b('0xc')]=_[_0xf95b('0xd')](config['redis'],{'host':_0xf95b('0xe'),'port':0x18eb});var socket=require(_0xf95b('0xf'))(new Redis(config[_0xf95b('0xc')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x316f53,_0x448ac6,_0x226d71){return new BPromise(function(_0x2685dd,_0xdf2104){return client[_0xf95b('0x10')](_0x316f53,_0x226d71)[_0xf95b('0x11')](function(_0x47d7f1){logger[_0xf95b('0x12')](_0xf95b('0x13'),_0x448ac6,_0xf95b('0x14'));logger['debug'](_0xf95b('0x15'),_0x448ac6,'request\x20sent',JSON['stringify'](_0x47d7f1));if(_0x47d7f1[_0xf95b('0x16')]){if(_0x47d7f1['error']['code']===0x1f4){logger['error'](_0xf95b('0x13'),_0x448ac6,_0x47d7f1[_0xf95b('0x16')][_0xf95b('0x17')]);return _0xdf2104(_0x47d7f1[_0xf95b('0x16')][_0xf95b('0x17')]);}logger[_0xf95b('0x16')](_0xf95b('0x13'),_0x448ac6,_0x47d7f1[_0xf95b('0x16')][_0xf95b('0x17')]);return _0x2685dd(_0x47d7f1[_0xf95b('0x16')]['message']);}else{logger[_0xf95b('0x12')](_0xf95b('0x13'),_0x448ac6,_0xf95b('0x14'));_0x2685dd(_0x47d7f1['result'][_0xf95b('0x17')]);}})[_0xf95b('0x18')](function(_0x3eedf0){logger[_0xf95b('0x16')](_0xf95b('0x13'),_0x448ac6,_0x3eedf0);_0xdf2104(_0x3eedf0);});});}exports[_0xf95b('0x19')]=function(_0x3a2a2e){var _0x454bd1=this;return new Promise(function(_0x1c5261,_0x33ac84){return db[_0xf95b('0x1a')][_0xf95b('0x1b')](_0x3a2a2e[_0xf95b('0x1c')],{'raw':_0x3a2a2e[_0xf95b('0x1d')]?_0x3a2a2e[_0xf95b('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a2a2e['options']?_0x3a2a2e['options']['where']||null:null,'attributes':_0x3a2a2e[_0xf95b('0x1d')]?_0x3a2a2e[_0xf95b('0x1d')][_0xf95b('0x1e')]||null:null,'limit':_0x3a2a2e['options']?_0x3a2a2e[_0xf95b('0x1d')][_0xf95b('0x1f')]||null:null})[_0xf95b('0x11')](function(_0xa89836){logger[_0xf95b('0x12')]('UpdateOpenchannelInteraction',_0x3a2a2e);logger[_0xf95b('0x20')](_0xf95b('0x19'),_0x3a2a2e,JSON[_0xf95b('0x21')](_0xa89836));_0x1c5261(_0xa89836);})[_0xf95b('0x18')](function(_0x5954b8){logger['error'](_0xf95b('0x19'),_0x5954b8[_0xf95b('0x17')],_0x3a2a2e);_0x33ac84(_0x454bd1[_0xf95b('0x16')](0x1f4,_0x5954b8[_0xf95b('0x17')]));});});};exports[_0xf95b('0x22')]=function(_0x4aec9c){return new Promise(function(_0x49c3ca,_0x346664){return db['OpenchannelInteraction'][_0xf95b('0x23')]({'where':_0x4aec9c[_0xf95b('0x1d')]?_0x4aec9c['options'][_0xf95b('0x24')]||null:null})['then'](function(_0x57b30b){if(_0x57b30b){return _0x57b30b[_0xf95b('0x25')](_0x4aec9c[_0xf95b('0x1c')][_0xf95b('0x26')],_[_0xf95b('0x27')](_0x4aec9c[_0xf95b('0x1c')],['ids','id'])||{});}})[_0xf95b('0x28')](function(_0x241029){logger[_0xf95b('0x12')]('AddTags',_0x4aec9c);logger['debug'](_0xf95b('0x29'),_0x4aec9c,JSON[_0xf95b('0x21')](_0x241029));_0x49c3ca(_0x241029);})[_0xf95b('0x18')](function(_0x180cd2){logger['error']('AddTags',_0x180cd2[_0xf95b('0x17')],_0x4aec9c);_0x346664(_this[_0xf95b('0x16')](0x1f4,_0x180cd2[_0xf95b('0x17')]));});});}; \ No newline at end of file +var _0x88b1=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','AddTagsToOpenchannelInteraction','where','addTags','ids','spread','AddTags','util','moment'];(function(_0xd50a2b,_0x3f7e2c){var _0x131344=function(_0x4be738){while(--_0x4be738){_0xd50a2b['push'](_0xd50a2b['shift']());}};_0x131344(++_0x3f7e2c);}(_0x88b1,0x101));var _0x188b=function(_0x369286,_0x566877){_0x369286=_0x369286-0x0;var _0x5e20ff=_0x88b1[_0x369286];return _0x5e20ff;};'use strict';var _=require('lodash');var util=require(_0x188b('0x0'));var moment=require(_0x188b('0x1'));var BPromise=require(_0x188b('0x2'));var rs=require(_0x188b('0x3'));var fs=require('fs');var Redis=require(_0x188b('0x4'));var db=require(_0x188b('0x5'))['db'];var utils=require(_0x188b('0x6'));var logger=require('../../config/logger')(_0x188b('0x7'));var config=require(_0x188b('0x8'));var jayson=require(_0x188b('0x9'));var client=jayson[_0x188b('0xa')][_0x188b('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x188b('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x188b('0xc')]));require(_0x188b('0xd'))[_0x188b('0xe')](socket);function respondWithRpcPromise(_0x3569ae,_0xe9b6d4,_0x1a08e1){return new BPromise(function(_0x10ead6,_0x456937){return client[_0x188b('0xf')](_0x3569ae,_0x1a08e1)[_0x188b('0x10')](function(_0x4ab3c0){logger[_0x188b('0x11')](_0x188b('0x12'),_0xe9b6d4,_0x188b('0x13'));logger[_0x188b('0x14')](_0x188b('0x15'),_0xe9b6d4,'request\x20sent',JSON[_0x188b('0x16')](_0x4ab3c0));if(_0x4ab3c0[_0x188b('0x17')]){if(_0x4ab3c0[_0x188b('0x17')][_0x188b('0x18')]===0x1f4){logger[_0x188b('0x17')](_0x188b('0x12'),_0xe9b6d4,_0x4ab3c0[_0x188b('0x17')]['message']);return _0x456937(_0x4ab3c0[_0x188b('0x17')]['message']);}logger[_0x188b('0x17')](_0x188b('0x12'),_0xe9b6d4,_0x4ab3c0[_0x188b('0x17')][_0x188b('0x19')]);return _0x10ead6(_0x4ab3c0[_0x188b('0x17')][_0x188b('0x19')]);}else{logger['info'](_0x188b('0x12'),_0xe9b6d4,_0x188b('0x13'));_0x10ead6(_0x4ab3c0['result'][_0x188b('0x19')]);}})[_0x188b('0x1a')](function(_0x4babf3){logger[_0x188b('0x17')](_0x188b('0x12'),_0xe9b6d4,_0x4babf3);_0x456937(_0x4babf3);});});}exports[_0x188b('0x1b')]=function(_0x37075b){var _0x2ee91d=this;return new Promise(function(_0x5bc0c3,_0x5df77e){return db[_0x188b('0x1c')]['update'](_0x37075b[_0x188b('0x1d')],{'raw':_0x37075b[_0x188b('0x1e')]?_0x37075b[_0x188b('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37075b[_0x188b('0x1e')]?_0x37075b[_0x188b('0x1e')]['where']||null:null,'attributes':_0x37075b[_0x188b('0x1e')]?_0x37075b['options']['attributes']||null:null,'limit':_0x37075b[_0x188b('0x1e')]?_0x37075b[_0x188b('0x1e')]['limit']||null:null})[_0x188b('0x10')](function(_0x5e730c){logger[_0x188b('0x11')]('UpdateOpenchannelInteraction',_0x37075b);logger[_0x188b('0x14')]('UpdateOpenchannelInteraction',_0x37075b,JSON[_0x188b('0x16')](_0x5e730c));_0x5bc0c3(_0x5e730c);})[_0x188b('0x1a')](function(_0x51fdb3){logger[_0x188b('0x17')]('UpdateOpenchannelInteraction',_0x51fdb3['message'],_0x37075b);_0x5df77e(_0x2ee91d[_0x188b('0x17')](0x1f4,_0x51fdb3[_0x188b('0x19')]));});});};exports[_0x188b('0x1f')]=function(_0x39c731){return new Promise(function(_0x59e0cd,_0x46cf0b){return db[_0x188b('0x1c')]['find']({'where':_0x39c731[_0x188b('0x1e')]?_0x39c731[_0x188b('0x1e')][_0x188b('0x20')]||null:null})[_0x188b('0x10')](function(_0x12cdd1){if(_0x12cdd1){return _0x12cdd1[_0x188b('0x21')](_0x39c731[_0x188b('0x1d')][_0x188b('0x22')],_['omit'](_0x39c731['body'],[_0x188b('0x22'),'id'])||{});}})[_0x188b('0x23')](function(_0x1edba8){logger[_0x188b('0x11')](_0x188b('0x24'),_0x39c731);logger[_0x188b('0x14')](_0x188b('0x24'),_0x39c731,JSON[_0x188b('0x16')](_0x1edba8));_0x59e0cd(_0x1edba8);})['catch'](function(_0x24c467){logger['error'](_0x188b('0x24'),_0x24c467[_0x188b('0x19')],_0x39c731);_0x46cf0b(_this[_0x188b('0x17')](0x1f4,_0x24c467[_0x188b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 22c5e18..91e08cd 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 _0xa38f=['length','save','remove','update','emit','removeListener'];(function(_0x2a96bb,_0x407e84){var _0x16501d=function(_0x299015){while(--_0x299015){_0x2a96bb['push'](_0x2a96bb['shift']());}};_0x16501d(++_0x407e84);}(_0xa38f,0x1e1));var _0xfa38=function(_0x1f272c,_0x33654b){_0x1f272c=_0x1f272c-0x0;var _0x61819a=_0xa38f[_0x1f272c];return _0x61819a;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xfa38('0x0'),_0xfa38('0x1'),_0xfa38('0x2')];function createListener(_0x2a4010,_0x4e0fad){return function(_0x6a310f){_0x4e0fad[_0xfa38('0x3')](_0x2a4010,_0x6a310f);};}function removeListener(_0x2efd28,_0xe2a2b4){return function(){OpenchannelInteractionEvents[_0xfa38('0x4')](_0x2efd28,_0xe2a2b4);};}exports['register']=function(_0x1ed1b4){for(var _0x46aff4=0x0,_0x18c656=events[_0xfa38('0x5')];_0x46aff4<_0x18c656;_0x46aff4++){var _0x572878=events[_0x46aff4];var _0x488276=createListener('openchannelInteraction:'+_0x572878,_0x1ed1b4);OpenchannelInteractionEvents['on'](_0x572878,_0x488276);}}; \ No newline at end of file +var _0x1f8e=['removeListener','./openchannelInteraction.events','save','update','emit'];(function(_0x31b80d,_0x52a4d6){var _0x17127d=function(_0x223928){while(--_0x223928){_0x31b80d['push'](_0x31b80d['shift']());}};_0x17127d(++_0x52a4d6);}(_0x1f8e,0x1cd));var _0xe1f8=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x1f8e[_0x9df060];return _0x338dfe;};'use strict';var OpenchannelInteractionEvents=require(_0xe1f8('0x0'));var events=[_0xe1f8('0x1'),'remove',_0xe1f8('0x2')];function createListener(_0x4e2d17,_0x361102){return function(_0x2f8b9a){_0x361102[_0xe1f8('0x3')](_0x4e2d17,_0x2f8b9a);};}function removeListener(_0x54ea37,_0x72de25){return function(){OpenchannelInteractionEvents[_0xe1f8('0x4')](_0x54ea37,_0x72de25);};}exports['register']=function(_0x5aff5a){for(var _0x48cb1d=0x0,_0x58323a=events['length'];_0x48cb1d<_0x58323a;_0x48cb1d++){var _0x2f1c4c=events[_0x48cb1d];var _0x59de85=createListener('openchannelInteraction:'+_0x2f1c4c,_0x5aff5a);OpenchannelInteractionEvents['on'](_0x2f1c4c,_0x59de85);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index a9fb9fc..a41b911 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 _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_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'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +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(_0x15de11,_0x3cd20d){var _0x4f1c07=function(_0xf74624){while(--_0xf74624){_0x15de11['push'](_0x15de11['shift']());}};_0x4f1c07(++_0x3cd20d);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'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 diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 2dd13ec..225329c 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 _0xeef7=['exports','medium','BOOLEAN','out','DATE','STRING','sequelize'];(function(_0x53d4e6,_0x10344c){var _0x80d345=function(_0x34fad2){while(--_0x34fad2){_0x53d4e6['push'](_0x53d4e6['shift']());}};_0x80d345(++_0x10344c);}(_0xeef7,0x7d));var _0x7eef=function(_0x39f9e8,_0x4edccf){_0x39f9e8=_0x39f9e8-0x0;var _0x2d37f6=_0xeef7[_0x39f9e8];return _0x2d37f6;};'use strict';var Sequelize=require(_0x7eef('0x0'));module[_0x7eef('0x1')]={'body':{'type':Sequelize['TEXT'](_0x7eef('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7eef('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x7eef('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7eef('0x5')]},'providerName':{'type':Sequelize[_0x7eef('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xb846=['STRING','TEXT','sequelize','medium','BOOLEAN','ENUM','DATE'];(function(_0x263204,_0x19286b){var _0xed3987=function(_0x282bf1){while(--_0x282bf1){_0x263204['push'](_0x263204['shift']());}};_0xed3987(++_0x19286b);}(_0xb846,0x1d0));var _0x6b84=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xb846[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require(_0x6b84('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x6b84('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x6b84('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x6b84('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6b84('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x6b84('0x4')]},'providerName':{'type':Sequelize[_0x6b84('0x5')]},'providerResponse':{'type':Sequelize[_0x6b84('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 6551d02..1dbee1d 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 _0x06a7=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','rows','include','find','create','body','params','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','event','RejectMessage','rejectMessage','sequelize','QueryTypes','motionChannel','EventManager','rejectmessage'];(function(_0xe23747,_0x406edd){var _0x4d2517=function(_0x69cbd0){while(--_0x69cbd0){_0xe23747['push'](_0xe23747['shift']());}};_0x4d2517(++_0x406edd);}(_0x06a7,0x18f));var _0x706a=function(_0x458ecf,_0x3847e7){_0x458ecf=_0x458ecf-0x0;var _0x14ae15=_0x06a7[_0x458ecf];return _0x14ae15;};'use strict';var emlformat=require(_0x706a('0x0'));var rimraf=require(_0x706a('0x1'));var zipdir=require(_0x706a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x706a('0x3'));var moment=require(_0x706a('0x4'));var BPromise=require(_0x706a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x706a('0x6'));var sox=require(_0x706a('0x7'));var csv=require(_0x706a('0x8'));var ejs=require(_0x706a('0x9'));var fs=require('fs');var fs_extra=require(_0x706a('0xa'));var _=require(_0x706a('0xb'));var squel=require(_0x706a('0xc'));var crypto=require(_0x706a('0xd'));var jsforce=require(_0x706a('0xe'));var deskjs=require(_0x706a('0xf'));var toCsv=require(_0x706a('0x8'));var querystring=require(_0x706a('0x10'));var Papa=require(_0x706a('0x11'));var Redis=require(_0x706a('0x12'));var authService=require(_0x706a('0x13'));var qs=require(_0x706a('0x14'));var as=require(_0x706a('0x15'));var hardwareService=require(_0x706a('0x16'));var logger=require(_0x706a('0x17'))('api');var utils=require(_0x706a('0x18'));var config=require(_0x706a('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x706a('0x1a'))['db'];config[_0x706a('0x1b')]=_[_0x706a('0x1c')](config[_0x706a('0x1b')],{'host':_0x706a('0x1d'),'port':0x18eb});var socket=require(_0x706a('0x1e'))(new Redis(config[_0x706a('0x1b')]));require('./openchannelMessage.socket')[_0x706a('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x706a('0x20')][_0x706a('0x21')]({'port':0x232c});var client9002=jayson[_0x706a('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x188d55,_0x1a4308,_0x350253,_0x428703){return new BPromise(function(_0x1ede4b,_0x3b688d){var _0x2dfda7=_0x428703||client;return _0x2dfda7['request'](_0x188d55,_0x350253)['then'](function(_0x1eb06d){logger[_0x706a('0x22')](_0x706a('0x23'),_0x1a4308,_0x706a('0x24'));logger[_0x706a('0x25')](_0x706a('0x26'),_0x1a4308,_0x706a('0x24'),JSON[_0x706a('0x27')](_0x1eb06d));if(_0x1eb06d[_0x706a('0x28')]){if(_0x1eb06d[_0x706a('0x28')][_0x706a('0x29')]===0x1f4){logger[_0x706a('0x28')](_0x706a('0x23'),_0x1a4308,_0x1eb06d[_0x706a('0x28')][_0x706a('0x2a')]);return _0x3b688d(_0x1eb06d['error'][_0x706a('0x2a')]);}logger[_0x706a('0x28')](_0x706a('0x23'),_0x1a4308,_0x1eb06d['error'][_0x706a('0x2a')]);return _0x1ede4b(_0x1eb06d['error'][_0x706a('0x2a')]);}else{logger[_0x706a('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x1a4308,_0x706a('0x24'));_0x1ede4b(_0x1eb06d[_0x706a('0x2b')][_0x706a('0x2a')]);}})[_0x706a('0x2c')](function(_0x4ff669){logger['error'](_0x706a('0x23'),_0x1a4308,_0x4ff669);_0x3b688d(_0x4ff669);});});}function respondWithStatusCode(_0x1701fc,_0x522c18){_0x522c18=_0x522c18||0xcc;return function(_0x5a447e){if(_0x5a447e){return _0x1701fc[_0x706a('0x2d')](_0x522c18);}return _0x1701fc['status'](_0x522c18)[_0x706a('0x2e')]();};}function respondWithResult(_0x2ceb57,_0x19f2d2){_0x19f2d2=_0x19f2d2||0xc8;return function(_0x430c3a){if(_0x430c3a){return _0x2ceb57[_0x706a('0x2f')](_0x19f2d2)[_0x706a('0x30')](_0x430c3a);}};}function respondWithFilteredResult(_0x5a6bd4,_0x51a7d0){return function(_0xd2642d){if(_0xd2642d){var _0x58799b=typeof _0x51a7d0[_0x706a('0x31')]===_0x706a('0x32')&&typeof _0x51a7d0['limit']==='undefined';var _0x3e2c5d=_0xd2642d[_0x706a('0x33')];var _0x314de1=_0x58799b?0x0:_0x51a7d0[_0x706a('0x31')];var _0x21ad2c=_0x58799b?_0xd2642d[_0x706a('0x33')]:_0x51a7d0[_0x706a('0x31')]+_0x51a7d0[_0x706a('0x34')];var _0x243511;if(_0x21ad2c>=_0x3e2c5d){_0x21ad2c=_0x3e2c5d;_0x243511=0xc8;}else{_0x243511=0xce;}_0x5a6bd4[_0x706a('0x2f')](_0x243511);return _0x5a6bd4[_0x706a('0x35')](_0x706a('0x36'),_0x314de1+'-'+_0x21ad2c+'/'+_0x3e2c5d)[_0x706a('0x30')](_0xd2642d);}return null;};}function patchUpdates(_0x4c9bd8){return function(_0x28ac72){try{jsonpatch['apply'](_0x28ac72,_0x4c9bd8,!![]);}catch(_0x102853){return BPromise[_0x706a('0x37')](_0x102853);}return _0x28ac72[_0x706a('0x38')]();};}function saveUpdates(_0x10b3e6,_0x3afb03){return function(_0x4e8e87){if(_0x4e8e87){return _0x4e8e87[_0x706a('0x39')](_0x10b3e6)[_0x706a('0x3a')](function(_0xb667a6){return _0xb667a6;});}return null;};}function removeEntity(_0x4eca3b,_0x5245c8){return function(_0x4e9a35){if(_0x4e9a35){return _0x4e9a35[_0x706a('0x3b')]()[_0x706a('0x3a')](function(){_0x4eca3b['status'](0xcc)[_0x706a('0x2e')]();});}};}function handleEntityNotFound(_0x17411a,_0x29dc58){return function(_0x33e94c){if(!_0x33e94c){_0x17411a[_0x706a('0x2d')](0x194);}return _0x33e94c;};}function handleError(_0x59fc96,_0x17bd85){_0x17bd85=_0x17bd85||0x1f4;return function(_0x3b829e){logger[_0x706a('0x28')](_0x3b829e[_0x706a('0x3c')]);if(_0x3b829e[_0x706a('0x3d')]){delete _0x3b829e[_0x706a('0x3d')];}_0x59fc96[_0x706a('0x2f')](_0x17bd85)[_0x706a('0x3e')](_0x3b829e);};}exports[_0x706a('0x3f')]=function(_0x1fd555,_0x161152){var _0x321904={},_0x5b2b7c={},_0x904ba1={'count':0x0,'rows':[]};var _0x4a0fb5=_[_0x706a('0x40')](db[_0x706a('0x41')][_0x706a('0x42')],function(_0x44cfc5){return{'name':_0x44cfc5[_0x706a('0x43')],'type':_0x44cfc5[_0x706a('0x44')][_0x706a('0x45')]};});_0x5b2b7c['model']=_['map'](_0x4a0fb5,_0x706a('0x3d'));_0x5b2b7c[_0x706a('0x46')]=_[_0x706a('0x47')](_0x1fd555[_0x706a('0x46')]);_0x5b2b7c[_0x706a('0x48')]=_['intersection'](_0x5b2b7c[_0x706a('0x49')],_0x5b2b7c['query']);_0x321904[_0x706a('0x4a')]=_[_0x706a('0x4b')](_0x5b2b7c[_0x706a('0x49')],qs[_0x706a('0x4c')](_0x1fd555['query'][_0x706a('0x4c')]));_0x321904[_0x706a('0x4a')]=_0x321904['attributes'][_0x706a('0x4d')]?_0x321904[_0x706a('0x4a')]:_0x5b2b7c[_0x706a('0x49')];if(!_0x1fd555[_0x706a('0x46')][_0x706a('0x4e')](_0x706a('0x4f'))){_0x321904['limit']=qs['limit'](_0x1fd555[_0x706a('0x46')][_0x706a('0x34')]);_0x321904[_0x706a('0x31')]=qs[_0x706a('0x31')](_0x1fd555[_0x706a('0x46')]['offset']);}_0x321904['order']=qs['sort'](_0x1fd555[_0x706a('0x46')][_0x706a('0x50')]);_0x321904[_0x706a('0x51')]=qs[_0x706a('0x48')](_[_0x706a('0x52')](_0x1fd555['query'],_0x5b2b7c[_0x706a('0x48')]),_0x4a0fb5);if(_0x1fd555[_0x706a('0x46')][_0x706a('0x53')]){_0x321904['where']=_['merge'](_0x321904['where'],{'$or':_[_0x706a('0x40')](_0x4a0fb5,function(_0xbe9480){if(_0xbe9480[_0x706a('0x44')]!=='VIRTUAL'){var _0x29ad7a={};_0x29ad7a[_0xbe9480['name']]={'$like':'%'+_0x1fd555[_0x706a('0x46')][_0x706a('0x53')]+'%'};return _0x29ad7a;}})});}_0x321904=_[_0x706a('0x54')]({},_0x321904,_0x1fd555[_0x706a('0x55')]);var _0x56ef54={'where':_0x321904[_0x706a('0x51')]};return db[_0x706a('0x41')]['count'](_0x56ef54)[_0x706a('0x3a')](function(_0x291e71){_0x904ba1[_0x706a('0x33')]=_0x291e71;if(_0x1fd555[_0x706a('0x46')][_0x706a('0x56')]){_0x321904['include']=[{'all':!![]}];}return db[_0x706a('0x41')]['findAll'](_0x321904);})[_0x706a('0x3a')](function(_0x4d645a){_0x904ba1[_0x706a('0x57')]=_0x4d645a;return _0x904ba1;})[_0x706a('0x3a')](respondWithFilteredResult(_0x161152,_0x321904))[_0x706a('0x2c')](handleError(_0x161152,null));};exports['show']=function(_0x1baefb,_0x4e8220){var _0xe1e8e4={'raw':!![],'where':{'id':_0x1baefb['params']['id']}},_0x2525ae={};_0x2525ae[_0x706a('0x49')]=_[_0x706a('0x47')](db['OpenchannelMessage'][_0x706a('0x42')]);_0x2525ae['query']=_[_0x706a('0x47')](_0x1baefb[_0x706a('0x46')]);_0x2525ae[_0x706a('0x48')]=_[_0x706a('0x4b')](_0x2525ae['model'],_0x2525ae[_0x706a('0x46')]);_0xe1e8e4['attributes']=_['intersection'](_0x2525ae[_0x706a('0x49')],qs[_0x706a('0x4c')](_0x1baefb[_0x706a('0x46')][_0x706a('0x4c')]));_0xe1e8e4[_0x706a('0x4a')]=_0xe1e8e4[_0x706a('0x4a')]['length']?_0xe1e8e4[_0x706a('0x4a')]:_0x2525ae['model'];if(_0x1baefb[_0x706a('0x46')][_0x706a('0x56')]){_0xe1e8e4[_0x706a('0x58')]=[{'all':!![]}];}_0xe1e8e4=_['merge']({},_0xe1e8e4,_0x1baefb['options']);return db[_0x706a('0x41')][_0x706a('0x59')](_0xe1e8e4)[_0x706a('0x3a')](handleEntityNotFound(_0x4e8220,null))[_0x706a('0x3a')](respondWithResult(_0x4e8220,null))[_0x706a('0x2c')](handleError(_0x4e8220,null));};exports['create']=function(_0x14f2a2,_0x5c4c7f){return db[_0x706a('0x41')][_0x706a('0x5a')](_0x14f2a2[_0x706a('0x5b')],{})[_0x706a('0x3a')](respondWithResult(_0x5c4c7f,0xc9))[_0x706a('0x2c')](handleError(_0x5c4c7f,null));};exports['update']=function(_0x319b15,_0x4b0d94){if(_0x319b15[_0x706a('0x5b')]['id']){delete _0x319b15[_0x706a('0x5b')]['id'];}return db['OpenchannelMessage'][_0x706a('0x59')]({'where':{'id':_0x319b15[_0x706a('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4b0d94,null))[_0x706a('0x3a')](saveUpdates(_0x319b15[_0x706a('0x5b')],null))[_0x706a('0x3a')](respondWithResult(_0x4b0d94,null))['catch'](handleError(_0x4b0d94,null));};exports['destroy']=function(_0x11a130,_0x1f5b67){return db[_0x706a('0x41')]['find']({'where':{'id':_0x11a130[_0x706a('0x5c')]['id']}})[_0x706a('0x3a')](handleEntityNotFound(_0x1f5b67,null))[_0x706a('0x3a')](removeEntity(_0x1f5b67,null))[_0x706a('0x2c')](handleError(_0x1f5b67,null));};exports[_0x706a('0x5d')]=function(_0x52bac5,_0x12693f){return db['OpenchannelMessage'][_0x706a('0x5d')]()['then'](respondWithResult(_0x12693f,null))[_0x706a('0x2c')](handleError(_0x12693f,null));};var interaction_log=require(_0x706a('0x17'))(_0x706a('0x5e'));exports[_0x706a('0x5f')]=function(_0x3a1c87,_0x3962f8,_0x24d2e2){var _0x21044a={'agent':{},'channel':_0x706a('0x60')};if(_0x3a1c87[_0x706a('0x5b')]['id']){delete _0x3a1c87[_0x706a('0x5b')]['id'];}_0x3a1c87['body'][_0x706a('0x61')]=!![];_0x3a1c87[_0x706a('0x5b')][_0x706a('0x62')]=moment()[_0x706a('0x63')](_0x706a('0x64'));_0x3a1c87[_0x706a('0x5b')][_0x706a('0x65')]=_0x3a1c87[_0x706a('0x5b')][_0x706a('0x65')]||_0x3a1c87['user']['id'];_0x21044a[_0x706a('0x66')]['id']=_0x3a1c87['body'][_0x706a('0x65')];return db[_0x706a('0x41')][_0x706a('0x59')]({'where':{'id':_0x3a1c87[_0x706a('0x5c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3962f8,null))['then'](saveUpdates(_0x3a1c87['body'],null))[_0x706a('0x3a')](function(_0x1a4641){if(_0x1a4641){_0x21044a[_0x706a('0x2a')]=_0x1a4641[_0x706a('0x67')]({'plain':!![]});return db[_0x706a('0x68')][_0x706a('0x59')]({'where':{'id':_0x1a4641[_0x706a('0x69')]}});}return null;})[_0x706a('0x3a')](handleEntityNotFound(_0x3962f8,null))[_0x706a('0x3a')](function(_0x4faa84){if(_0x4faa84){return _0x4faa84[_0x706a('0x39')]({'UserId':_0x3a1c87[_0x706a('0x5b')]['UserId'],'read1stAt':_[_0x706a('0x6a')](_0x4faa84[_0x706a('0x6b')])?moment()['format'](_0x706a('0x64')):undefined});}return null;})[_0x706a('0x3a')](function(_0x187a94){if(_0x187a94){_0x21044a[_0x706a('0x6c')]=_0x187a94[_0x706a('0x67')]({'plain':!![]});interaction_log[_0x706a('0x22')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3a1c87[_0x706a('0x6d')]['id'],_0x3a1c87['user'][_0x706a('0x3d')],_0x3a1c87[_0x706a('0x6d')][_0x706a('0x6e')],_0x21044a[_0x706a('0x6c')]['id'],_0x3a1c87[_0x706a('0x5b')]?JSON[_0x706a('0x27')](_0x3a1c87[_0x706a('0x5b')]):_0x706a('0x6f'));return respondWithRpcPromise(_0x706a('0x70'),_0x706a('0x71'),_0x21044a);}return null;})[_0x706a('0x3a')](function(_0x259bdb){var _0x5759fb=_0x706a('0x72')+_0x259bdb[_0x706a('0x2a')][_0x706a('0x73')];return db['sequelize'][_0x706a('0x46')](_0x5759fb,{'type':db['Sequelize']['QueryTypes'][_0x706a('0x74')],'raw':!![]})[_0x706a('0x3a')](function(_0x255363){return _0x255363;});})['then'](function(_0x26b9d2){if(_0x26b9d2){_0x21044a[_0x706a('0x2a')][_0x706a('0x75')]=_0x26b9d2[0x0];if(!_0x3a1c87[_0x706a('0x5b')]['UserId'])return;return db[_0x706a('0x76')]['find']({'where':{'id':_0x3a1c87[_0x706a('0x5b')][_0x706a('0x65')],'role':'agent'},'attributes':['id',_0x706a('0x3d'),_0x706a('0x77'),_0x706a('0x78'),_0x706a('0x79')],'raw':!![]});}return null;})[_0x706a('0x3a')](function(_0x113cde){if(!_0x113cde)return null;_0x21044a[_0x706a('0x2a')][_0x706a('0x66')]=_0x113cde;return _0x21044a;})['then'](function(_0x21b5e6){if(_0x21b5e6){if(_0x3a1c87[_0x706a('0x5b')]['manual']){_0x21044a[_0x706a('0x2a')][_0x706a('0x7a')]=util[_0x706a('0x63')](_0x706a('0x7b'),_0x3a1c87[_0x706a('0x6d')][_0x706a('0x3d')]);_0x21044a[_0x706a('0x2a')][_0x706a('0x7c')]=_0x21044a[_0x706a('0x7c')];_0x21044a['message']['motionChannel']=_0x21044a[_0x706a('0x7c')];_0x21044a[_0x706a('0x2a')][_0x706a('0x7d')]=_0x706a('0x5f');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x21044a['message']},client9002)[_0x706a('0x3a')](function(){return _0x21044a;});}return _0x21044a;}return null;})['then'](respondWithResult(_0x3962f8,null))[_0x706a('0x2c')](handleError(_0x3962f8,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x706a('0x37')]=function(_0x16acb9,_0x304fb7,_0x28d884){var _0xe9d37b={'agent':{},'channel':_0x706a('0x60')};if(_0x16acb9[_0x706a('0x5b')]['id']){delete _0x16acb9[_0x706a('0x5b')]['id'];}_0x16acb9[_0x706a('0x5b')][_0x706a('0x65')]=_0x16acb9[_0x706a('0x5b')]['UserId']||_0x16acb9[_0x706a('0x6d')]['id'];_0xe9d37b['agent']['id']=_0x16acb9['body'][_0x706a('0x65')];return db[_0x706a('0x41')]['find']({'where':{'id':_0x16acb9[_0x706a('0x5c')]['id'],'UserId':null}})[_0x706a('0x3a')](handleEntityNotFound(_0x304fb7,null))['then'](function(_0x216681){if(_0x216681){_0xe9d37b['message']=_0x216681[_0x706a('0x67')]({'plain':!![]});return db[_0x706a('0x68')][_0x706a('0x59')]({'where':{'id':_0x216681[_0x706a('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x304fb7,null))[_0x706a('0x3a')](function(_0x1adc48){if(_0x1adc48){_0xe9d37b[_0x706a('0x6c')]=_0x1adc48[_0x706a('0x67')]({'plain':!![]});interaction_log[_0x706a('0x22')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x16acb9[_0x706a('0x6d')]['id'],_0x16acb9[_0x706a('0x6d')]['name'],_0x16acb9['user'][_0x706a('0x6e')],_0xe9d37b[_0x706a('0x6c')]['id'],_0x16acb9[_0x706a('0x5b')]?JSON[_0x706a('0x27')](_0x16acb9[_0x706a('0x5b')]):_0x706a('0x6f'));return respondWithRpcPromise(_0x706a('0x7e'),_0x706a('0x7f'),_0xe9d37b);}return null;})[_0x706a('0x3a')](function(_0xd58da5){var _0x17d77f=_0x706a('0x72')+_0xd58da5[_0x706a('0x2a')][_0x706a('0x73')];return db[_0x706a('0x80')][_0x706a('0x46')](_0x17d77f,{'type':db['Sequelize'][_0x706a('0x81')][_0x706a('0x74')],'raw':!![]})[_0x706a('0x3a')](function(_0x159b59){return _0x159b59;});})['then'](function(_0x668ad1){if(_0x668ad1){_0xe9d37b[_0x706a('0x2a')][_0x706a('0x75')]=_0x668ad1[0x0];if(!_0x16acb9[_0x706a('0x5b')][_0x706a('0x65')])return;return db[_0x706a('0x76')]['find']({'where':{'id':_0x16acb9[_0x706a('0x5b')][_0x706a('0x65')],'role':_0x706a('0x66')},'attributes':['id','name',_0x706a('0x77'),'email','internal'],'raw':!![]});}return null;})[_0x706a('0x3a')](function(_0x3ac3e8){if(!_0x3ac3e8)return null;_0xe9d37b[_0x706a('0x2a')][_0x706a('0x66')]=_0x3ac3e8;return _0xe9d37b;})[_0x706a('0x3a')](function(_0x5c9f37){if(_0x5c9f37){_0x5c9f37['message'][_0x706a('0x7a')]=util[_0x706a('0x63')]('SIP/%s',_0x16acb9[_0x706a('0x6d')]['name']);_0x5c9f37['message'][_0x706a('0x7c')]=_0xe9d37b[_0x706a('0x7c')];_0x5c9f37[_0x706a('0x2a')][_0x706a('0x82')]=_0xe9d37b[_0x706a('0x7c')];_0x5c9f37[_0x706a('0x2a')][_0x706a('0x7d')]='reject';respondWithRpcPromise(_0x706a('0x83'),_0x706a('0x83'),{'event':_0x706a('0x84'),'message':_0x5c9f37[_0x706a('0x2a')]},client9002);return _0xe9d37b;}return null;})[_0x706a('0x3a')](respondWithResult(_0x304fb7,null))['catch'](handleError(_0x304fb7,null));}; \ No newline at end of file +var _0xadc5=['openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','fullname','email','internal','manual','interface','SIP/%s','motionChannel','event','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','SELECT','User','channel','rejectmessage','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','message','info','sendStatus','status','end','undefined','count','offset','json','reject','save','update','destroy','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','options','find','catch','create','body','describe','openchannel-interactions','accept'];(function(_0x307018,_0x35373b){var _0x59f892=function(_0x3a8e56){while(--_0x3a8e56){_0x307018['push'](_0x307018['shift']());}};_0x59f892(++_0x35373b);}(_0xadc5,0x1bd));var _0x5adc=function(_0x1e3a62,_0x499aae){_0x1e3a62=_0x1e3a62-0x0;var _0x24a7ba=_0xadc5[_0x1e3a62];return _0x24a7ba;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5adc('0x0'));var jsonpatch=require(_0x5adc('0x1'));var rp=require(_0x5adc('0x2'));var moment=require(_0x5adc('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5adc('0x4'));var path=require(_0x5adc('0x5'));var sox=require(_0x5adc('0x6'));var csv=require(_0x5adc('0x7'));var ejs=require(_0x5adc('0x8'));var fs=require('fs');var fs_extra=require(_0x5adc('0x9'));var _=require(_0x5adc('0xa'));var squel=require(_0x5adc('0xb'));var crypto=require(_0x5adc('0xc'));var jsforce=require(_0x5adc('0xd'));var deskjs=require(_0x5adc('0xe'));var toCsv=require(_0x5adc('0x7'));var querystring=require(_0x5adc('0xf'));var Papa=require(_0x5adc('0x10'));var Redis=require(_0x5adc('0x11'));var authService=require(_0x5adc('0x12'));var qs=require(_0x5adc('0x13'));var as=require(_0x5adc('0x14'));var hardwareService=require(_0x5adc('0x15'));var logger=require(_0x5adc('0x16'))(_0x5adc('0x17'));var utils=require(_0x5adc('0x18'));var config=require(_0x5adc('0x19'));var licenseUtil=require(_0x5adc('0x1a'));var db=require(_0x5adc('0x1b'))['db'];config['redis']=_[_0x5adc('0x1c')](config[_0x5adc('0x1d')],{'host':_0x5adc('0x1e'),'port':0x18eb});var socket=require(_0x5adc('0x1f'))(new Redis(config[_0x5adc('0x1d')]));require('./openchannelMessage.socket')[_0x5adc('0x20')](socket);var jayson=require(_0x5adc('0x21'));var client=jayson['client'][_0x5adc('0x22')]({'port':0x232c});var client9002=jayson[_0x5adc('0x23')][_0x5adc('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2e350b,_0x369ef5,_0x46c059,_0x3717b5){return new BPromise(function(_0x4412d9,_0x142aad){var _0x303be8=_0x3717b5||client;return _0x303be8['request'](_0x2e350b,_0x46c059)[_0x5adc('0x24')](function(_0x26a99f){logger['info'](_0x5adc('0x25'),_0x369ef5,_0x5adc('0x26'));logger[_0x5adc('0x27')](_0x5adc('0x28'),_0x369ef5,_0x5adc('0x26'),JSON['stringify'](_0x26a99f));if(_0x26a99f[_0x5adc('0x29')]){if(_0x26a99f[_0x5adc('0x29')]['code']===0x1f4){logger['error'](_0x5adc('0x25'),_0x369ef5,_0x26a99f[_0x5adc('0x29')][_0x5adc('0x2a')]);return _0x142aad(_0x26a99f[_0x5adc('0x29')][_0x5adc('0x2a')]);}logger[_0x5adc('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x369ef5,_0x26a99f['error'][_0x5adc('0x2a')]);return _0x4412d9(_0x26a99f[_0x5adc('0x29')]['message']);}else{logger[_0x5adc('0x2b')](_0x5adc('0x25'),_0x369ef5,_0x5adc('0x26'));_0x4412d9(_0x26a99f['result'][_0x5adc('0x2a')]);}})['catch'](function(_0x48b984){logger[_0x5adc('0x29')](_0x5adc('0x25'),_0x369ef5,_0x48b984);_0x142aad(_0x48b984);});});}function respondWithStatusCode(_0x221387,_0x20a3cf){_0x20a3cf=_0x20a3cf||0xcc;return function(_0x13cbbb){if(_0x13cbbb){return _0x221387[_0x5adc('0x2c')](_0x20a3cf);}return _0x221387[_0x5adc('0x2d')](_0x20a3cf)[_0x5adc('0x2e')]();};}function respondWithResult(_0xeea440,_0x3aca91){_0x3aca91=_0x3aca91||0xc8;return function(_0x56d1c1){if(_0x56d1c1){return _0xeea440[_0x5adc('0x2d')](_0x3aca91)['json'](_0x56d1c1);}};}function respondWithFilteredResult(_0x455f81,_0x5173f1){return function(_0x5d5f6){if(_0x5d5f6){var _0x8bcd95=typeof _0x5173f1['offset']===_0x5adc('0x2f')&&typeof _0x5173f1['limit']===_0x5adc('0x2f');var _0x2b5139=_0x5d5f6[_0x5adc('0x30')];var _0x54c4cd=_0x8bcd95?0x0:_0x5173f1[_0x5adc('0x31')];var _0x38bdb1=_0x8bcd95?_0x5d5f6[_0x5adc('0x30')]:_0x5173f1[_0x5adc('0x31')]+_0x5173f1['limit'];var _0x1aab3f;if(_0x38bdb1>=_0x2b5139){_0x38bdb1=_0x2b5139;_0x1aab3f=0xc8;}else{_0x1aab3f=0xce;}_0x455f81[_0x5adc('0x2d')](_0x1aab3f);return _0x455f81['set']('Content-Range',_0x54c4cd+'-'+_0x38bdb1+'/'+_0x2b5139)[_0x5adc('0x32')](_0x5d5f6);}return null;};}function patchUpdates(_0x3ded41){return function(_0x1ca5cd){try{jsonpatch['apply'](_0x1ca5cd,_0x3ded41,!![]);}catch(_0x2f1782){return BPromise[_0x5adc('0x33')](_0x2f1782);}return _0x1ca5cd[_0x5adc('0x34')]();};}function saveUpdates(_0x2abd6d,_0x4bd7b0){return function(_0x1021a0){if(_0x1021a0){return _0x1021a0[_0x5adc('0x35')](_0x2abd6d)[_0x5adc('0x24')](function(_0x587534){return _0x587534;});}return null;};}function removeEntity(_0x555563,_0x3b485d){return function(_0x51937c){if(_0x51937c){return _0x51937c[_0x5adc('0x36')]()[_0x5adc('0x24')](function(){_0x555563[_0x5adc('0x2d')](0xcc)[_0x5adc('0x2e')]();});}};}function handleEntityNotFound(_0x49ddfb,_0x375040){return function(_0x4ce418){if(!_0x4ce418){_0x49ddfb[_0x5adc('0x2c')](0x194);}return _0x4ce418;};}function handleError(_0x593c24,_0x40e96c){_0x40e96c=_0x40e96c||0x1f4;return function(_0x282f1d){logger['error'](_0x282f1d[_0x5adc('0x37')]);if(_0x282f1d[_0x5adc('0x38')]){delete _0x282f1d[_0x5adc('0x38')];}_0x593c24[_0x5adc('0x2d')](_0x40e96c)[_0x5adc('0x39')](_0x282f1d);};}exports['index']=function(_0xe1659b,_0x4b1dd4){var _0x14860b={},_0x204682={},_0x30f1c3={'count':0x0,'rows':[]};var _0x2dd92a=_[_0x5adc('0x3a')](db[_0x5adc('0x3b')][_0x5adc('0x3c')],function(_0x608213){return{'name':_0x608213[_0x5adc('0x3d')],'type':_0x608213[_0x5adc('0x3e')][_0x5adc('0x3f')]};});_0x204682[_0x5adc('0x40')]=_[_0x5adc('0x3a')](_0x2dd92a,_0x5adc('0x38'));_0x204682[_0x5adc('0x41')]=_['keys'](_0xe1659b[_0x5adc('0x41')]);_0x204682[_0x5adc('0x42')]=_[_0x5adc('0x43')](_0x204682[_0x5adc('0x40')],_0x204682[_0x5adc('0x41')]);_0x14860b[_0x5adc('0x44')]=_['intersection'](_0x204682[_0x5adc('0x40')],qs[_0x5adc('0x45')](_0xe1659b[_0x5adc('0x41')]['fields']));_0x14860b['attributes']=_0x14860b[_0x5adc('0x44')][_0x5adc('0x46')]?_0x14860b[_0x5adc('0x44')]:_0x204682[_0x5adc('0x40')];if(!_0xe1659b['query'][_0x5adc('0x47')](_0x5adc('0x48'))){_0x14860b['limit']=qs[_0x5adc('0x49')](_0xe1659b[_0x5adc('0x41')]['limit']);_0x14860b[_0x5adc('0x31')]=qs[_0x5adc('0x31')](_0xe1659b[_0x5adc('0x41')][_0x5adc('0x31')]);}_0x14860b[_0x5adc('0x4a')]=qs['sort'](_0xe1659b[_0x5adc('0x41')][_0x5adc('0x4b')]);_0x14860b[_0x5adc('0x4c')]=qs['filters'](_[_0x5adc('0x4d')](_0xe1659b['query'],_0x204682[_0x5adc('0x42')]),_0x2dd92a);if(_0xe1659b['query'][_0x5adc('0x4e')]){_0x14860b[_0x5adc('0x4c')]=_[_0x5adc('0x4f')](_0x14860b[_0x5adc('0x4c')],{'$or':_[_0x5adc('0x3a')](_0x2dd92a,function(_0x14dcec){if(_0x14dcec[_0x5adc('0x3e')]!==_0x5adc('0x50')){var _0x128da5={};_0x128da5[_0x14dcec[_0x5adc('0x38')]]={'$like':'%'+_0xe1659b[_0x5adc('0x41')][_0x5adc('0x4e')]+'%'};return _0x128da5;}})});}_0x14860b=_[_0x5adc('0x4f')]({},_0x14860b,_0xe1659b['options']);var _0x47fe25={'where':_0x14860b[_0x5adc('0x4c')]};return db[_0x5adc('0x3b')][_0x5adc('0x30')](_0x47fe25)[_0x5adc('0x24')](function(_0x540f31){_0x30f1c3['count']=_0x540f31;if(_0xe1659b[_0x5adc('0x41')][_0x5adc('0x51')]){_0x14860b[_0x5adc('0x52')]=[{'all':!![]}];}return db[_0x5adc('0x3b')][_0x5adc('0x53')](_0x14860b);})[_0x5adc('0x24')](function(_0x133ecc){_0x30f1c3[_0x5adc('0x54')]=_0x133ecc;return _0x30f1c3;})[_0x5adc('0x24')](respondWithFilteredResult(_0x4b1dd4,_0x14860b))['catch'](handleError(_0x4b1dd4,null));};exports['show']=function(_0x2e958e,_0x1e1bc6){var _0x344c23={'raw':!![],'where':{'id':_0x2e958e[_0x5adc('0x55')]['id']}},_0x50bf13={};_0x50bf13[_0x5adc('0x40')]=_['keys'](db[_0x5adc('0x3b')][_0x5adc('0x3c')]);_0x50bf13[_0x5adc('0x41')]=_[_0x5adc('0x56')](_0x2e958e[_0x5adc('0x41')]);_0x50bf13[_0x5adc('0x42')]=_[_0x5adc('0x43')](_0x50bf13[_0x5adc('0x40')],_0x50bf13[_0x5adc('0x41')]);_0x344c23[_0x5adc('0x44')]=_[_0x5adc('0x43')](_0x50bf13['model'],qs[_0x5adc('0x45')](_0x2e958e[_0x5adc('0x41')][_0x5adc('0x45')]));_0x344c23[_0x5adc('0x44')]=_0x344c23[_0x5adc('0x44')][_0x5adc('0x46')]?_0x344c23[_0x5adc('0x44')]:_0x50bf13[_0x5adc('0x40')];if(_0x2e958e[_0x5adc('0x41')][_0x5adc('0x51')]){_0x344c23[_0x5adc('0x52')]=[{'all':!![]}];}_0x344c23=_[_0x5adc('0x4f')]({},_0x344c23,_0x2e958e[_0x5adc('0x57')]);return db[_0x5adc('0x3b')][_0x5adc('0x58')](_0x344c23)[_0x5adc('0x24')](handleEntityNotFound(_0x1e1bc6,null))['then'](respondWithResult(_0x1e1bc6,null))[_0x5adc('0x59')](handleError(_0x1e1bc6,null));};exports['create']=function(_0x43e190,_0x6773be){return db[_0x5adc('0x3b')][_0x5adc('0x5a')](_0x43e190[_0x5adc('0x5b')],{})[_0x5adc('0x24')](respondWithResult(_0x6773be,0xc9))['catch'](handleError(_0x6773be,null));};exports[_0x5adc('0x35')]=function(_0x3d5719,_0xee88d2){if(_0x3d5719['body']['id']){delete _0x3d5719['body']['id'];}return db[_0x5adc('0x3b')][_0x5adc('0x58')]({'where':{'id':_0x3d5719[_0x5adc('0x55')]['id']}})[_0x5adc('0x24')](handleEntityNotFound(_0xee88d2,null))[_0x5adc('0x24')](saveUpdates(_0x3d5719[_0x5adc('0x5b')],null))[_0x5adc('0x24')](respondWithResult(_0xee88d2,null))[_0x5adc('0x59')](handleError(_0xee88d2,null));};exports[_0x5adc('0x36')]=function(_0x5790e5,_0x16c222){return db[_0x5adc('0x3b')][_0x5adc('0x58')]({'where':{'id':_0x5790e5[_0x5adc('0x55')]['id']}})[_0x5adc('0x24')](handleEntityNotFound(_0x16c222,null))[_0x5adc('0x24')](removeEntity(_0x16c222,null))[_0x5adc('0x59')](handleError(_0x16c222,null));};exports['describe']=function(_0x51389b,_0x6bb09d){return db[_0x5adc('0x3b')][_0x5adc('0x5c')]()[_0x5adc('0x24')](respondWithResult(_0x6bb09d,null))[_0x5adc('0x59')](handleError(_0x6bb09d,null));};var interaction_log=require(_0x5adc('0x16'))(_0x5adc('0x5d'));exports[_0x5adc('0x5e')]=function(_0x4cf796,_0x24f225,_0xa2a780){var _0x465691={'agent':{},'channel':_0x5adc('0x5f')};if(_0x4cf796[_0x5adc('0x5b')]['id']){delete _0x4cf796['body']['id'];}_0x4cf796[_0x5adc('0x5b')][_0x5adc('0x60')]=!![];_0x4cf796[_0x5adc('0x5b')][_0x5adc('0x61')]=moment()[_0x5adc('0x62')](_0x5adc('0x63'));_0x4cf796[_0x5adc('0x5b')]['UserId']=_0x4cf796['body'][_0x5adc('0x64')]||_0x4cf796[_0x5adc('0x65')]['id'];_0x465691[_0x5adc('0x66')]['id']=_0x4cf796['body']['UserId'];return db['OpenchannelMessage'][_0x5adc('0x58')]({'where':{'id':_0x4cf796[_0x5adc('0x55')]['id'],'UserId':null}})[_0x5adc('0x24')](handleEntityNotFound(_0x24f225,null))[_0x5adc('0x24')](saveUpdates(_0x4cf796[_0x5adc('0x5b')],null))['then'](function(_0x367d7d){if(_0x367d7d){_0x465691['message']=_0x367d7d[_0x5adc('0x67')]({'plain':!![]});return db[_0x5adc('0x68')][_0x5adc('0x58')]({'where':{'id':_0x367d7d[_0x5adc('0x69')]}});}return null;})[_0x5adc('0x24')](handleEntityNotFound(_0x24f225,null))[_0x5adc('0x24')](function(_0x64bc60){if(_0x64bc60){return _0x64bc60[_0x5adc('0x35')]({'UserId':_0x4cf796[_0x5adc('0x5b')]['UserId'],'read1stAt':_['isNil'](_0x64bc60[_0x5adc('0x6a')])?moment()[_0x5adc('0x62')](_0x5adc('0x63')):undefined});}return null;})[_0x5adc('0x24')](function(_0x2a8f03){if(_0x2a8f03){_0x465691[_0x5adc('0x6b')]=_0x2a8f03[_0x5adc('0x67')]({'plain':!![]});interaction_log[_0x5adc('0x2b')](_0x5adc('0x6c'),_0x4cf796[_0x5adc('0x65')]['id'],_0x4cf796[_0x5adc('0x65')]['name'],_0x4cf796['user'][_0x5adc('0x6d')],_0x465691[_0x5adc('0x6b')]['id'],_0x4cf796[_0x5adc('0x5b')]?JSON['stringify'](_0x4cf796[_0x5adc('0x5b')]):_0x5adc('0x6e'));return respondWithRpcPromise(_0x5adc('0x6f'),_0x5adc('0x70'),_0x465691);}return null;})[_0x5adc('0x24')](function(_0x794d0f){var _0x5d30a4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x794d0f[_0x5adc('0x2a')][_0x5adc('0x71')];return db[_0x5adc('0x72')][_0x5adc('0x41')](_0x5d30a4,{'type':db[_0x5adc('0x73')][_0x5adc('0x74')]['SELECT'],'raw':!![]})[_0x5adc('0x24')](function(_0x1cfb89){return _0x1cfb89;});})['then'](function(_0x1f922d){if(_0x1f922d){_0x465691[_0x5adc('0x2a')][_0x5adc('0x75')]=_0x1f922d[0x0];if(!_0x4cf796[_0x5adc('0x5b')][_0x5adc('0x64')])return;return db['User']['find']({'where':{'id':_0x4cf796['body'][_0x5adc('0x64')],'role':_0x5adc('0x66')},'attributes':['id','name',_0x5adc('0x76'),_0x5adc('0x77'),_0x5adc('0x78')],'raw':!![]});}return null;})[_0x5adc('0x24')](function(_0x5d8333){if(!_0x5d8333)return null;_0x465691['message']['agent']=_0x5d8333;return _0x465691;})[_0x5adc('0x24')](function(_0x416d1b){if(_0x416d1b){if(_0x4cf796['body'][_0x5adc('0x79')]){_0x465691[_0x5adc('0x2a')][_0x5adc('0x7a')]=util['format'](_0x5adc('0x7b'),_0x4cf796[_0x5adc('0x65')][_0x5adc('0x38')]);_0x465691[_0x5adc('0x2a')]['channel']=_0x465691['channel'];_0x465691[_0x5adc('0x2a')][_0x5adc('0x7c')]=_0x465691['channel'];_0x465691[_0x5adc('0x2a')][_0x5adc('0x7d')]='accept';return respondWithRpcPromise('EventManager',_0x5adc('0x7e'),{'event':'acceptmessage','message':_0x465691[_0x5adc('0x2a')]},client9002)[_0x5adc('0x24')](function(){return _0x465691;});}return _0x465691;}return null;})[_0x5adc('0x24')](respondWithResult(_0x24f225,null))[_0x5adc('0x59')](handleError(_0x24f225,null));};var interaction_log=require(_0x5adc('0x16'))(_0x5adc('0x5d'));exports['reject']=function(_0x1fb86a,_0x3c928e,_0x1847e7){var _0x232b03={'agent':{},'channel':_0x5adc('0x5f')};if(_0x1fb86a['body']['id']){delete _0x1fb86a['body']['id'];}_0x1fb86a['body'][_0x5adc('0x64')]=_0x1fb86a[_0x5adc('0x5b')][_0x5adc('0x64')]||_0x1fb86a[_0x5adc('0x65')]['id'];_0x232b03[_0x5adc('0x66')]['id']=_0x1fb86a[_0x5adc('0x5b')][_0x5adc('0x64')];return db['OpenchannelMessage']['find']({'where':{'id':_0x1fb86a['params']['id'],'UserId':null}})[_0x5adc('0x24')](handleEntityNotFound(_0x3c928e,null))[_0x5adc('0x24')](function(_0x5f3787){if(_0x5f3787){_0x232b03[_0x5adc('0x2a')]=_0x5f3787[_0x5adc('0x67')]({'plain':!![]});return db[_0x5adc('0x68')][_0x5adc('0x58')]({'where':{'id':_0x5f3787[_0x5adc('0x69')]}});}return null;})[_0x5adc('0x24')](handleEntityNotFound(_0x3c928e,null))[_0x5adc('0x24')](function(_0x32eb1d){if(_0x32eb1d){_0x232b03[_0x5adc('0x6b')]=_0x32eb1d[_0x5adc('0x67')]({'plain':!![]});interaction_log[_0x5adc('0x2b')](_0x5adc('0x7f'),_0x1fb86a[_0x5adc('0x65')]['id'],_0x1fb86a[_0x5adc('0x65')][_0x5adc('0x38')],_0x1fb86a['user'][_0x5adc('0x6d')],_0x232b03[_0x5adc('0x6b')]['id'],_0x1fb86a[_0x5adc('0x5b')]?JSON[_0x5adc('0x80')](_0x1fb86a[_0x5adc('0x5b')]):_0x5adc('0x6e'));return respondWithRpcPromise(_0x5adc('0x81'),_0x5adc('0x82'),_0x232b03);}return null;})[_0x5adc('0x24')](function(_0x160cd9){var _0x2d3487='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x160cd9[_0x5adc('0x2a')][_0x5adc('0x71')];return db['sequelize'][_0x5adc('0x41')](_0x2d3487,{'type':db[_0x5adc('0x73')][_0x5adc('0x74')][_0x5adc('0x83')],'raw':!![]})[_0x5adc('0x24')](function(_0x212a5f){return _0x212a5f;});})[_0x5adc('0x24')](function(_0x406924){if(_0x406924){_0x232b03[_0x5adc('0x2a')][_0x5adc('0x75')]=_0x406924[0x0];if(!_0x1fb86a[_0x5adc('0x5b')][_0x5adc('0x64')])return;return db[_0x5adc('0x84')][_0x5adc('0x58')]({'where':{'id':_0x1fb86a['body'][_0x5adc('0x64')],'role':_0x5adc('0x66')},'attributes':['id',_0x5adc('0x38'),_0x5adc('0x76'),_0x5adc('0x77'),_0x5adc('0x78')],'raw':!![]});}return null;})[_0x5adc('0x24')](function(_0x1e0638){if(!_0x1e0638)return null;_0x232b03[_0x5adc('0x2a')]['agent']=_0x1e0638;return _0x232b03;})[_0x5adc('0x24')](function(_0x456cd5){if(_0x456cd5){_0x456cd5[_0x5adc('0x2a')][_0x5adc('0x7a')]=util[_0x5adc('0x62')]('SIP/%s',_0x1fb86a[_0x5adc('0x65')][_0x5adc('0x38')]);_0x456cd5[_0x5adc('0x2a')][_0x5adc('0x85')]=_0x232b03[_0x5adc('0x85')];_0x456cd5[_0x5adc('0x2a')][_0x5adc('0x7c')]=_0x232b03['channel'];_0x456cd5[_0x5adc('0x2a')][_0x5adc('0x7d')]=_0x5adc('0x33');respondWithRpcPromise(_0x5adc('0x7e'),'EventManager',{'event':_0x5adc('0x86'),'message':_0x456cd5['message']},client9002);return _0x232b03;}return null;})[_0x5adc('0x24')](respondWithResult(_0x3c928e,null))[_0x5adc('0x59')](handleError(_0x3c928e,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 65af279..fbc7a31 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 _0x5aaa=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','update'];(function(_0x157d23,_0x4027b9){var _0x5b93cc=function(_0x18af99){while(--_0x18af99){_0x157d23['push'](_0x157d23['shift']());}};_0x5b93cc(++_0x4027b9);}(_0x5aaa,0xf8));var _0xa5aa=function(_0x3a67e6,_0x478d08){_0x3a67e6=_0x3a67e6-0x0;var _0x56d591=_0x5aaa[_0x3a67e6];return _0x56d591;};'use strict';var EventEmitter=require(_0xa5aa('0x0'));var OpenchannelMessage=require(_0xa5aa('0x1'))['db'][_0xa5aa('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa5aa('0x3'),'afterDestroy':_0xa5aa('0x4')};function emitEvent(_0x232ce2){return function(_0x2491d4,_0x292038,_0xffdbf5){OpenchannelMessageEvents[_0xa5aa('0x5')](_0x232ce2+':'+_0x2491d4['id'],_0x2491d4);OpenchannelMessageEvents[_0xa5aa('0x5')](_0x232ce2,_0x2491d4);_0xffdbf5(null);};}for(var e in events){if(events[_0xa5aa('0x6')](e)){var event=events[e];OpenchannelMessage[_0xa5aa('0x7')](e,emitEvent(event));}}module[_0xa5aa('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xe1ff=['setMaxListeners','update','emit','hook','events','OpenchannelMessage'];(function(_0x18c44d,_0x33976d){var _0x71abcf=function(_0x43072b){while(--_0x43072b){_0x18c44d['push'](_0x18c44d['shift']());}};_0x71abcf(++_0x33976d);}(_0xe1ff,0xdc));var _0xfe1f=function(_0x50be1d,_0x1b947a){_0x50be1d=_0x50be1d-0x0;var _0xa0e02c=_0xe1ff[_0x50be1d];return _0xa0e02c;};'use strict';var EventEmitter=require(_0xfe1f('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0xfe1f('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xfe1f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfe1f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1e31ab){return function(_0xf77eab,_0x36b020,_0x8209aa){OpenchannelMessageEvents[_0xfe1f('0x4')](_0x1e31ab+':'+_0xf77eab['id'],_0xf77eab);OpenchannelMessageEvents['emit'](_0x1e31ab,_0xf77eab);_0x8209aa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xfe1f('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 860eb30..8d1e2e9 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 _0xc625=['then','createdAt','catch','secret','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','keys','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','Interaction','omit','Contact','method','GET','POST','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','error','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','./openchannelMessage.attributes','define','OpenchannelMessage','fti_openchannel_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction'];(function(_0x5745d2,_0x536b58){var _0xd6df54=function(_0xfc4bad){while(--_0xfc4bad){_0x5745d2['push'](_0x5745d2['shift']());}};_0xd6df54(++_0x536b58);}(_0xc625,0x124));var _0x5c62=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0xc625[_0x1e500e];return _0x10dc5e;};'use strict';var _=require(_0x5c62('0x0'));var util=require(_0x5c62('0x1'));var logger=require(_0x5c62('0x2'))(_0x5c62('0x3'));var moment=require('moment');var BPromise=require(_0x5c62('0x4'));var rp=require(_0x5c62('0x5'));var fs=require('fs');var path=require(_0x5c62('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5c62('0x7'));module['exports']=function(_0x36c7c3,_0x1f28c6){return _0x36c7c3[_0x5c62('0x8')](_0x5c62('0x9'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x5c62('0xa'),'fields':[_0x5c62('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2bf004,_0x2c8ee0,_0x3fbc92){var _0x3838ea=_0x36c7c3[_0x5c62('0xc')];var _0xe4a519=_0x2bf004[_0x5c62('0xd')]({'plain':!![]});if(_0xe4a519[_0x5c62('0xe')][_0x5c62('0xf')]()==='in'||_0xe4a519[_0x5c62('0xe')][_0x5c62('0xf')]()===_0x5c62('0x10')&&!_0xe4a519['secret']&&!_[_0x5c62('0x11')](_0xe4a519[_0x5c62('0x12')])){_0x3838ea[_0x5c62('0x13')]['findOne']({'where':{'id':_0xe4a519['OpenchannelInteractionId']}})[_0x5c62('0x14')](function(_0x1fa67e){if(_0x1fa67e){_0x1fa67e['update']({'lastMsgAt':_0xe4a519[_0x5c62('0x15')],'lastMsgDirection':_0xe4a519['direction'][_0x5c62('0xf')]()});}})[_0x5c62('0x16')](function(_0x3be63d){console['error'](_0x3be63d);});}if(_0xe4a519[_0x5c62('0xe')]===_0x5c62('0x10')&&!_0xe4a519[_0x5c62('0x17')]){var _0x22a1ee;_0x3838ea[_0x5c62('0x18')][_0x5c62('0x19')]()[_0x5c62('0x14')](function(_0x2990d1){return _0x3838ea[_0x5c62('0x1a')][_0x5c62('0x1b')]({'where':{'id':_0xe4a519[_0x5c62('0x1c')]},'include':[{'model':_0x3838ea[_0x5c62('0x13')],'as':_0x5c62('0x1d'),'where':{'id':_0xe4a519[_0x5c62('0x1e')]},'limit':0x1,'include':[{'model':_0x3838ea[_0x5c62('0x18')],'as':'Contact','attributes':_[_0x5c62('0x1f')](_0x2990d1)}]}]});})['then'](function(_0x33ff2b){_0x22a1ee=_0x33ff2b['get']({'plain':!![]});if(_0x22a1ee&&_0x22a1ee['replyUri']){logger[_0x5c62('0x20')](_0x5c62('0x21'),'afterCreate',util[_0x5c62('0x22')](_0x5c62('0x23'),_0xe4a519['id'],_0x22a1ee[_0x5c62('0x24')]));if(_0x22a1ee[_0x5c62('0x1d')]&&_0x22a1ee['Interactions']['length']){_0xe4a519[_0x5c62('0x25')]=_[_0x5c62('0x26')](_0x22a1ee['Interactions'][0x0],_0x5c62('0x27'));_0xe4a519[_0x5c62('0x27')]=_0x22a1ee['Interactions'][0x0]['Contact'];}var _0x2c8ee0={'method':'POST','uri':encodeURI(_0x22a1ee['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2c8ee0[_0x5c62('0x28')]){case _0x5c62('0x29'):_0x2c8ee0['qs']=_0xe4a519;break;case _0x5c62('0x2a'):_0x2c8ee0[_0x5c62('0xb')]=_0xe4a519;break;}return rp(_0x2c8ee0)[_0x5c62('0x14')](function(_0x27193e){logger[_0x5c62('0x20')](_0x5c62('0x21'),_0x5c62('0x2b'),util[_0x5c62('0x22')](_0x5c62('0x2c'),_0xe4a519['id'],_0x22a1ee['replyUri']));if(_0x27193e['body'][_0x5c62('0x2d')]&&_0x27193e[_0x5c62('0xb')]['threadId']!=_0xe4a519[_0x5c62('0x25')][_0x5c62('0x2d')]){return _0x3838ea[_0x5c62('0x13')]['update']({'threadId':_0x27193e[_0x5c62('0xb')][_0x5c62('0x2d')]},{'where':{'id':_0xe4a519[_0x5c62('0x25')]['id']}});}else{return;}})['then'](function(){return _0x2bf004[_0x5c62('0x2e')]({'read':!![]});})[_0x5c62('0x16')](function(_0x6ea727){logger[_0x5c62('0x2f')](_0x5c62('0x21'),_0x5c62('0x2b'),util[_0x5c62('0x30')](_0x6ea727,{'showHidden':![],'depth':null}));_0x3fbc92();});}else{_0x3fbc92();}})[_0x5c62('0x31')](function(){_0x3fbc92();});}else{_0x3fbc92();}}},'charset':_0x5c62('0x32'),'collate':_0x5c62('0x33')});}; \ No newline at end of file +var _0x9992=['exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','get','toLowerCase','direction','out','secret','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','OpenchannelAccount','find','Interactions','Contact','keys','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','Interaction','omit','POST','method','GET','body','info','Message\x20%d\x20forwarded\x20to\x20%s','replyUri','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes'];(function(_0x8c5f12,_0x2fbc1d){var _0x41220d=function(_0x1bb566){while(--_0x1bb566){_0x8c5f12['push'](_0x8c5f12['shift']());}};_0x41220d(++_0x2fbc1d);}(_0x9992,0x129));var _0x2999=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0x9992[_0x5b34c0];return _0x242bd3;};'use strict';var _=require('lodash');var util=require(_0x2999('0x0'));var logger=require(_0x2999('0x1'))(_0x2999('0x2'));var moment=require('moment');var BPromise=require(_0x2999('0x3'));var rp=require(_0x2999('0x4'));var fs=require('fs');var path=require(_0x2999('0x5'));var rimraf=require(_0x2999('0x6'));var config=require(_0x2999('0x7'));var attributes=require(_0x2999('0x8'));module[_0x2999('0x9')]=function(_0x160a7c,_0x25d0f6){return _0x160a7c['define'](_0x2999('0xa'),attributes,{'tableName':_0x2999('0xb'),'paranoid':![],'indexes':[{'name':_0x2999('0xc'),'fields':['body'],'type':_0x2999('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3bee88,_0x189049,_0x18ad7d){var _0x44b23a=_0x160a7c['models'];var _0x39053b=_0x3bee88[_0x2999('0xe')]({'plain':!![]});if(_0x39053b['direction'][_0x2999('0xf')]()==='in'||_0x39053b[_0x2999('0x10')][_0x2999('0xf')]()===_0x2999('0x11')&&!_0x39053b[_0x2999('0x12')]&&!_['isNil'](_0x39053b['UserId'])){_0x44b23a[_0x2999('0x13')][_0x2999('0x14')]({'where':{'id':_0x39053b[_0x2999('0x15')]}})[_0x2999('0x16')](function(_0x16c9a7){if(_0x16c9a7){_0x16c9a7[_0x2999('0x17')]({'lastMsgAt':_0x39053b[_0x2999('0x18')],'lastMsgDirection':_0x39053b['direction'][_0x2999('0xf')]()});}})[_0x2999('0x19')](function(_0x568484){console[_0x2999('0x1a')](_0x568484);});}if(_0x39053b['direction']===_0x2999('0x11')&&!_0x39053b[_0x2999('0x12')]){var _0x99e097;_0x44b23a[_0x2999('0x1b')]['describe']()[_0x2999('0x16')](function(_0x19f0a7){return _0x44b23a[_0x2999('0x1c')][_0x2999('0x1d')]({'where':{'id':_0x39053b['OpenchannelAccountId']},'include':[{'model':_0x44b23a['OpenchannelInteraction'],'as':_0x2999('0x1e'),'where':{'id':_0x39053b[_0x2999('0x15')]},'limit':0x1,'include':[{'model':_0x44b23a[_0x2999('0x1b')],'as':_0x2999('0x1f'),'attributes':_[_0x2999('0x20')](_0x19f0a7)}]}]});})[_0x2999('0x16')](function(_0x37a1d2){_0x99e097=_0x37a1d2[_0x2999('0xe')]({'plain':!![]});if(_0x99e097&&_0x99e097['replyUri']){logger['info'](_0x2999('0x21'),_0x2999('0x22'),util[_0x2999('0x23')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x39053b['id'],_0x99e097['replyUri']));if(_0x99e097[_0x2999('0x1e')]&&_0x99e097[_0x2999('0x1e')][_0x2999('0x24')]){_0x39053b[_0x2999('0x25')]=_[_0x2999('0x26')](_0x99e097[_0x2999('0x1e')][0x0],_0x2999('0x1f'));_0x39053b['Contact']=_0x99e097[_0x2999('0x1e')][0x0][_0x2999('0x1f')];}var _0x189049={'method':_0x2999('0x27'),'uri':encodeURI(_0x99e097['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x189049[_0x2999('0x28')]){case _0x2999('0x29'):_0x189049['qs']=_0x39053b;break;case _0x2999('0x27'):_0x189049[_0x2999('0x2a')]=_0x39053b;break;}return rp(_0x189049)['then'](function(_0x4f31bd){logger[_0x2999('0x2b')](_0x2999('0x21'),_0x2999('0x22'),util[_0x2999('0x23')](_0x2999('0x2c'),_0x39053b['id'],_0x99e097[_0x2999('0x2d')]));if(_0x4f31bd[_0x2999('0x2a')][_0x2999('0x2e')]&&_0x4f31bd['body'][_0x2999('0x2e')]!=_0x39053b[_0x2999('0x25')][_0x2999('0x2e')]){return _0x44b23a['OpenchannelInteraction']['update']({'threadId':_0x4f31bd['body'][_0x2999('0x2e')]},{'where':{'id':_0x39053b[_0x2999('0x25')]['id']}});}else{return;}})['then'](function(){return _0x3bee88[_0x2999('0x17')]({'read':!![]});})['catch'](function(_0x5e356d){logger[_0x2999('0x1a')]('OpenchannelMessage,\x20%s,\x20%s',_0x2999('0x22'),util[_0x2999('0x2f')](_0x5e356d,{'showHidden':![],'depth':null}));_0x18ad7d();});}else{_0x18ad7d();}})[_0x2999('0x30')](function(){_0x18ad7d();});}else{_0x18ad7d();}}},'charset':_0x2999('0x31'),'collate':_0x2999('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index b39e64b..ad5f664 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 _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x24cbb9,_0x3a9952){var _0x43670e=function(_0x18c5f3){while(--_0x18c5f3){_0x24cbb9['push'](_0x24cbb9['shift']());}};_0x43670e(++_0x3a9952);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file +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(_0x1f0f95,_0x25ccac){var _0x354f1f=function(_0x2b4841){while(--_0x2b4841){_0x1f0f95['push'](_0x1f0f95['shift']());}};_0x354f1f(++_0x25ccac);}(_0xadb5,0xad));var _0x5adb=function(_0x52f76e,_0x37be73){_0x52f76e=_0x52f76e-0x0;var _0x645303=_0xadb5[_0x52f76e];return _0x645303;};'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 diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 1035dfa..a41b0d9 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 _0x0650=['remove','update','emit','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0x0650,0xed));var _0x0065=function(_0xb89931,_0x461b9e){_0xb89931=_0xb89931-0x0;var _0x324b86=_0x0650[_0xb89931];return _0x324b86;};'use strict';var OpenchannelMessageEvents=require(_0x0065('0x0'));var events=['save',_0x0065('0x1'),_0x0065('0x2')];function createListener(_0x5e6e6c,_0x16f9eb){return function(_0x594d1c){_0x16f9eb[_0x0065('0x3')](_0x5e6e6c,_0x594d1c);};}function removeListener(_0x8260ba,_0x3dd8c6){return function(){OpenchannelMessageEvents['removeListener'](_0x8260ba,_0x3dd8c6);};}exports[_0x0065('0x4')]=function(_0x507ed3){for(var _0x5cf16e=0x0,_0x59f241=events[_0x0065('0x5')];_0x5cf16e<_0x59f241;_0x5cf16e++){var _0x415835=events[_0x5cf16e];var _0xefa3cb=createListener(_0x0065('0x6')+_0x415835,_0x507ed3);OpenchannelMessageEvents['on'](_0x415835,_0xefa3cb);}}; \ No newline at end of file +var _0x1298=['save','update','emit','register','length','openchannelMessage:'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0x1298,0x19e));var _0x8129=function(_0x23a3ff,_0x50b508){_0x23a3ff=_0x23a3ff-0x0;var _0x59b890=_0x1298[_0x23a3ff];return _0x59b890;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x8129('0x0'),'remove',_0x8129('0x1')];function createListener(_0x11c863,_0x5bdd76){return function(_0x3a133f){_0x5bdd76[_0x8129('0x2')](_0x11c863,_0x3a133f);};}function removeListener(_0x31d02a,_0x39e214){return function(){OpenchannelMessageEvents['removeListener'](_0x31d02a,_0x39e214);};}exports[_0x8129('0x3')]=function(_0x193d60){for(var _0x579301=0x0,_0x4f0a40=events[_0x8129('0x4')];_0x579301<_0x4f0a40;_0x579301++){var _0x2d07d5=events[_0x579301];var _0x3ff6e0=createListener(_0x8129('0x5')+_0x2d07d5,_0x193d60);OpenchannelMessageEvents['on'](_0x2d07d5,_0x3ff6e0);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index eeddee3..94185ba 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 _0x6a8f=['index','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','post','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get'];(function(_0x2b5b4b,_0x6c5264){var _0x462741=function(_0x1d1692){while(--_0x1d1692){_0x2b5b4b['push'](_0x2b5b4b['shift']());}};_0x462741(++_0x6c5264);}(_0x6a8f,0x107));var _0xf6a8=function(_0x3f9602,_0x115411){_0x3f9602=_0x3f9602-0x0;var _0xb22e48=_0x6a8f[_0x3f9602];return _0xb22e48;};'use strict';var multer=require(_0xf6a8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf6a8('0x1'));var express=require('express');var router=express[_0xf6a8('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf6a8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf6a8('0x4'));var controller=require(_0xf6a8('0x5'));router[_0xf6a8('0x6')]('/',auth['isAuthenticated'](),controller[_0xf6a8('0x7')]);router['get'](_0xf6a8('0x8'),auth[_0xf6a8('0x9')](),controller['describe']);router[_0xf6a8('0x6')](_0xf6a8('0xa'),auth[_0xf6a8('0x9')](),controller[_0xf6a8('0xb')]);router[_0xf6a8('0x6')](_0xf6a8('0xc'),auth[_0xf6a8('0x9')](),controller[_0xf6a8('0xd')]);router[_0xf6a8('0x6')](_0xf6a8('0xe'),auth['isAuthenticated'](),controller[_0xf6a8('0xf')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xf6a8('0x10')]('/',auth[_0xf6a8('0x9')](),controller['create']);router[_0xf6a8('0x10')]('/:id/teams',auth[_0xf6a8('0x9')](),controller[_0xf6a8('0x11')]);router[_0xf6a8('0x10')](_0xf6a8('0x12'),auth[_0xf6a8('0x9')](),controller[_0xf6a8('0x13')]);router[_0xf6a8('0x14')](_0xf6a8('0xa'),auth[_0xf6a8('0x9')](),controller[_0xf6a8('0x15')]);router[_0xf6a8('0x16')](_0xf6a8('0xa'),auth[_0xf6a8('0x9')](),controller[_0xf6a8('0x17')]);router['delete'](_0xf6a8('0xe'),auth['isAuthenticated'](),controller[_0xf6a8('0x18')]);router[_0xf6a8('0x16')]('/:id/users',auth[_0xf6a8('0x9')](),controller[_0xf6a8('0x19')]);module[_0xf6a8('0x1a')]=router; \ No newline at end of file +var _0x6e38=['create','post','addTeams','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','show','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x34b245,_0xfe65b4){var _0x3a8984=function(_0x12c6a8){while(--_0x12c6a8){_0x34b245['push'](_0x34b245['shift']());}};_0x3a8984(++_0xfe65b4);}(_0x6e38,0x167));var _0x86e3=function(_0x4dcea3,_0x47772e){_0x4dcea3=_0x4dcea3-0x0;var _0x5424bd=_0x6e38[_0x4dcea3];return _0x5424bd;};'use strict';var multer=require(_0x86e3('0x0'));var util=require(_0x86e3('0x1'));var path=require('path');var timeout=require(_0x86e3('0x2'));var express=require(_0x86e3('0x3'));var router=express[_0x86e3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x86e3('0x5'));var interaction=require(_0x86e3('0x6'));var config=require(_0x86e3('0x7'));var controller=require(_0x86e3('0x8'));router[_0x86e3('0x9')]('/',auth[_0x86e3('0xa')](),controller[_0x86e3('0xb')]);router['get'](_0x86e3('0xc'),auth[_0x86e3('0xa')](),controller['describe']);router[_0x86e3('0x9')]('/:id',auth[_0x86e3('0xa')](),controller[_0x86e3('0xd')]);router[_0x86e3('0x9')]('/:id/members',auth[_0x86e3('0xa')](),controller['getMembers']);router[_0x86e3('0x9')](_0x86e3('0xe'),auth[_0x86e3('0xa')](),controller[_0x86e3('0xf')]);router['get'](_0x86e3('0x10'),auth[_0x86e3('0xa')](),controller[_0x86e3('0x11')]);router['post']('/',auth[_0x86e3('0xa')](),controller[_0x86e3('0x12')]);router[_0x86e3('0x13')](_0x86e3('0xe'),auth[_0x86e3('0xa')](),controller[_0x86e3('0x14')]);router[_0x86e3('0x13')](_0x86e3('0x10'),auth['isAuthenticated'](),controller['addAgents']);router[_0x86e3('0x15')](_0x86e3('0x16'),auth['isAuthenticated'](),controller[_0x86e3('0x17')]);router[_0x86e3('0x18')](_0x86e3('0x16'),auth[_0x86e3('0xa')](),controller[_0x86e3('0x19')]);router['delete'](_0x86e3('0xe'),auth[_0x86e3('0xa')](),controller[_0x86e3('0x1a')]);router[_0x86e3('0x18')](_0x86e3('0x10'),auth[_0x86e3('0xa')](),controller[_0x86e3('0x1b')]);module[_0x86e3('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 51446f1..6f00172 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 _0x179b=['INTEGER','rrmemory','beepall','roundrobin','exports','STRING','name'];(function(_0x5373dc,_0x43f393){var _0x3332dc=function(_0x2b706f){while(--_0x2b706f){_0x5373dc['push'](_0x5373dc['shift']());}};_0x3332dc(++_0x43f393);}(_0x179b,0xc1));var _0xb179=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x179b[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');module[_0xb179('0x0')]={'name':{'type':Sequelize[_0xb179('0x1')],'unique':_0xb179('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb179('0x1')]},'timeout':{'type':Sequelize[_0xb179('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb179('0x4'),_0xb179('0x5'),_0xb179('0x6'))}}; \ No newline at end of file +var _0x0f95=['beepall','roundrobin','sequelize','STRING','name','INTEGER','rrmemory'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x0f95,0x1c2));var _0x50f9=function(_0x5d07ff,_0x1f976f){_0x5d07ff=_0x5d07ff-0x0;var _0x5226ad=_0x0f95[_0x5d07ff];return _0x5226ad;};'use strict';var Sequelize=require(_0x50f9('0x0'));module['exports']={'name':{'type':Sequelize[_0x50f9('0x1')],'unique':_0x50f9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x50f9('0x1')]},'timeout':{'type':Sequelize[_0x50f9('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x50f9('0x4'),_0x50f9('0x5'),_0x50f9('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 91b69c9..3f62ebf 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 _0xbfcd=['findOne','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','undefined','count','limit','update','then','get','OpenchannelQueues','UserProfileResource','destroy','error','stack','send','map','OpenchannelQueue','fieldName','type','key','getOptions','where','include','query','catch','show','keys','rawAttributes','filters','model','intersection','fields','attributes','length','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserOpenchannelQueue','order','sort','pick','OpenchannelQueueId','filter','options','findAll','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','hasOwnProperty','nolimit','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','removeTeams','select','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','removeAgents','forEach','emit','userOpenchannelQueue:remove','addAgents','omit','spread'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbfcd,0x7b));var _0xdbfc=function(_0x48c77f,_0x3348e9){_0x48c77f=_0x48c77f-0x0;var _0x584d5c=_0xbfcd[_0x48c77f];return _0x584d5c;};'use strict';var BPromise=require(_0xdbfc('0x0'));var util=require(_0xdbfc('0x1'));var _=require(_0xdbfc('0x2'));var squel=require(_0xdbfc('0x3'));var Redis=require('ioredis');var qs=require(_0xdbfc('0x4'));var logger=require('../../config/logger')(_0xdbfc('0x5'));var config=require(_0xdbfc('0x6'));var db=require(_0xdbfc('0x7'))['db'];config['redis']=_[_0xdbfc('0x8')](config['redis'],{'host':_0xdbfc('0x9'),'port':0x18eb});var socket=require(_0xdbfc('0xa'))(new Redis(config[_0xdbfc('0xb')]));require('./openchannelQueue.socket')[_0xdbfc('0xc')](socket);function respondWithStatusCode(_0x3b97e3,_0x9e1171){_0x9e1171=_0x9e1171||0xcc;return function(_0x5b3691){if(_0x5b3691){return _0x3b97e3[_0xdbfc('0xd')](_0x9e1171);}return _0x3b97e3[_0xdbfc('0xe')](_0x9e1171)[_0xdbfc('0xf')]();};}function respondWithResult(_0x244f07,_0x87f866){_0x87f866=_0x87f866||0xc8;return function(_0x4ba0bc){if(_0x4ba0bc){return _0x244f07[_0xdbfc('0xe')](_0x87f866)[_0xdbfc('0x10')](_0x4ba0bc);}};}function respondWithFilteredResult(_0x4d5720,_0x3d6d40){return function(_0x2af4e7){if(_0x2af4e7){var _0x4058da=typeof _0x3d6d40[_0xdbfc('0x11')]==='undefined'&&typeof _0x3d6d40['limit']===_0xdbfc('0x12');var _0x52c32d=_0x2af4e7['count'];var _0x3a79bc=_0x4058da?0x0:_0x3d6d40[_0xdbfc('0x11')];var _0x3b643d=_0x4058da?_0x2af4e7[_0xdbfc('0x13')]:_0x3d6d40[_0xdbfc('0x11')]+_0x3d6d40[_0xdbfc('0x14')];var _0x462176;if(_0x3b643d>=_0x52c32d){_0x3b643d=_0x52c32d;_0x462176=0xc8;}else{_0x462176=0xce;}_0x4d5720[_0xdbfc('0xe')](_0x462176);return _0x4d5720['set']('Content-Range',_0x3a79bc+'-'+_0x3b643d+'/'+_0x52c32d)[_0xdbfc('0x10')](_0x2af4e7);}return null;};}function saveUpdates(_0x56bc35){return function(_0x1090e8){if(_0x1090e8){return _0x1090e8[_0xdbfc('0x15')](_0x56bc35)['then'](function(_0x3370a4){return _0x3370a4;});}return null;};}function removeEntity(_0x45817b){return function(_0x2ac0fb){if(_0x2ac0fb){return _0x2ac0fb['destroy']()[_0xdbfc('0x16')](function(){var _0x56ec67=_0x2ac0fb[_0xdbfc('0x17')]({'plain':!![]});var _0x518d9c=_0xdbfc('0x18');return db[_0xdbfc('0x19')][_0xdbfc('0x1a')]({'where':{'type':_0x518d9c,'resourceId':_0x56ec67['id']}})[_0xdbfc('0x16')](function(){return _0x2ac0fb;});})['then'](function(){_0x45817b[_0xdbfc('0xe')](0xcc)[_0xdbfc('0xf')]();});}};}function handleEntityNotFound(_0x2b492a){return function(_0x10cfb2){if(!_0x10cfb2){_0x2b492a['sendStatus'](0x194);}return _0x10cfb2;};}function handleError(_0x4171ca,_0x145926){_0x145926=_0x145926||0x1f4;return function(_0x123448){logger[_0xdbfc('0x1b')](_0x123448[_0xdbfc('0x1c')]);if(_0x123448['name']){delete _0x123448['name'];}_0x4171ca[_0xdbfc('0xe')](_0x145926)[_0xdbfc('0x1d')](_0x123448);};}exports['index']=function(_0x17b2bc,_0x17f089){var _0x4ef8f3={};var _0x444a5e={'count':0x0,'rows':[]};var _0x21e262=_[_0xdbfc('0x1e')](db[_0xdbfc('0x1f')]['rawAttributes'],function(_0x46422b){return{'name':_0x46422b[_0xdbfc('0x20')],'type':_0x46422b[_0xdbfc('0x21')][_0xdbfc('0x22')]};});_0x4ef8f3=qs[_0xdbfc('0x23')](_0x21e262,_0x17b2bc);var _0x39b365={'where':_0x4ef8f3[_0xdbfc('0x24')]};return db[_0xdbfc('0x1f')][_0xdbfc('0x13')](_0x39b365)[_0xdbfc('0x16')](function(_0x4715db){_0x444a5e['count']=_0x4715db;_0x4ef8f3[_0xdbfc('0x25')]=qs['include'](_0x17b2bc[_0xdbfc('0x26')]);return db[_0xdbfc('0x1f')]['findAll'](_0x4ef8f3);})['then'](function(_0x391230){_0x444a5e['rows']=_0x391230;return _0x444a5e;})[_0xdbfc('0x16')](respondWithFilteredResult(_0x17f089,_0x4ef8f3))[_0xdbfc('0x27')](handleError(_0x17f089,null));};exports[_0xdbfc('0x28')]=function(_0x1b485a,_0x5adf83){var _0x30810b={'raw':!![],'where':{'id':_0x1b485a['params']['id']}},_0x482bd2={};_0x482bd2['model']=_[_0xdbfc('0x29')](db[_0xdbfc('0x1f')][_0xdbfc('0x2a')]);_0x482bd2[_0xdbfc('0x26')]=_[_0xdbfc('0x29')](_0x1b485a[_0xdbfc('0x26')]);_0x482bd2[_0xdbfc('0x2b')]=_['intersection'](_0x482bd2[_0xdbfc('0x2c')],_0x482bd2[_0xdbfc('0x26')]);_0x30810b['attributes']=_[_0xdbfc('0x2d')](_0x482bd2[_0xdbfc('0x2c')],qs[_0xdbfc('0x2e')](_0x1b485a['query'][_0xdbfc('0x2e')]));_0x30810b[_0xdbfc('0x2f')]=_0x30810b['attributes'][_0xdbfc('0x30')]?_0x30810b[_0xdbfc('0x2f')]:_0x482bd2[_0xdbfc('0x2c')];if(_0x1b485a[_0xdbfc('0x26')]['includeAll']){_0x30810b['include']=[{'all':!![]}];}_0x30810b=_[_0xdbfc('0x31')]({},_0x30810b,_0x1b485a['options']);return db[_0xdbfc('0x1f')][_0xdbfc('0x32')](_0x30810b)[_0xdbfc('0x16')](handleEntityNotFound(_0x5adf83,null))[_0xdbfc('0x16')](respondWithResult(_0x5adf83,null))['catch'](handleError(_0x5adf83,null));};exports[_0xdbfc('0x33')]=function(_0x2879c6,_0x261403){return db['OpenchannelQueue'][_0xdbfc('0x33')](_0x2879c6[_0xdbfc('0x34')],{})[_0xdbfc('0x16')](function(_0x2e20f1){var _0x58a31b=_0x2879c6[_0xdbfc('0x35')][_0xdbfc('0x17')]({'plain':!![]});if(!_0x58a31b)throw new Error(_0xdbfc('0x36'));if(_0x58a31b[_0xdbfc('0x37')]===_0xdbfc('0x35')){var _0x278d25=_0x2e20f1[_0xdbfc('0x17')]({'plain':!![]});var _0x3d339c=_0xdbfc('0x18');return db[_0xdbfc('0x38')]['find']({'where':{'name':_0x3d339c,'userProfileId':_0x58a31b[_0xdbfc('0x39')]},'raw':!![]})['then'](function(_0x29c34f){if(_0x29c34f&&_0x29c34f['autoAssociation']===0x0){return db[_0xdbfc('0x19')][_0xdbfc('0x33')]({'name':_0x278d25[_0xdbfc('0x3a')],'resourceId':_0x278d25['id'],'type':_0x29c34f[_0xdbfc('0x3a')],'sectionId':_0x29c34f['id']},{})[_0xdbfc('0x16')](function(){return _0x2e20f1;});}else{return _0x2e20f1;}})[_0xdbfc('0x27')](function(_0x3fed53){logger['error'](_0xdbfc('0x3b'),_0x3fed53);throw _0x3fed53;});}return _0x2e20f1;})['then'](respondWithResult(_0x261403,0xc9))[_0xdbfc('0x27')](handleError(_0x261403,null));};exports[_0xdbfc('0x15')]=function(_0x2b7899,_0x5447fd){if(_0x2b7899[_0xdbfc('0x34')]['id']){delete _0x2b7899[_0xdbfc('0x34')]['id'];}return db[_0xdbfc('0x1f')][_0xdbfc('0x32')]({'where':{'id':_0x2b7899[_0xdbfc('0x3c')]['id']}})[_0xdbfc('0x16')](handleEntityNotFound(_0x5447fd,null))[_0xdbfc('0x16')](saveUpdates(_0x2b7899[_0xdbfc('0x34')],null))['then'](respondWithResult(_0x5447fd,null))[_0xdbfc('0x27')](handleError(_0x5447fd,null));};exports['destroy']=function(_0x50e1f5,_0x316c39){return db[_0xdbfc('0x1f')]['find']({'where':{'id':_0x50e1f5[_0xdbfc('0x3c')]['id']}})['then'](handleEntityNotFound(_0x316c39,null))[_0xdbfc('0x16')](removeEntity(_0x316c39,null))[_0xdbfc('0x27')](handleError(_0x316c39,null));};exports['describe']=function(_0x1d53d2,_0xa6d103){return db[_0xdbfc('0x1f')][_0xdbfc('0x3d')]()[_0xdbfc('0x16')](respondWithResult(_0xa6d103,null))['catch'](handleError(_0xa6d103,null));};exports[_0xdbfc('0x3e')]=function(_0x3a6dd9,_0x55ec4d){var _0xcc24ff={'raw':!![],'where':{}},_0x6576b8={},_0x1014d2;return db[_0xdbfc('0x1f')]['findOne']({'where':{'id':_0x3a6dd9[_0xdbfc('0x3c')]['id']}})[_0xdbfc('0x16')](handleEntityNotFound(_0x55ec4d,null))[_0xdbfc('0x16')](function(_0x1eb6ec){if(_0x1eb6ec){_0x1014d2=_0x1eb6ec[_0xdbfc('0x17')]({'plain':!![]});_0x6576b8['model']=_['keys'](db[_0xdbfc('0x3f')][_0xdbfc('0x2a')]);_0x6576b8[_0xdbfc('0x26')]=_[_0xdbfc('0x29')](_0x3a6dd9['query']);_0x6576b8[_0xdbfc('0x2b')]=_[_0xdbfc('0x2d')](_0x6576b8[_0xdbfc('0x2c')],_0x6576b8[_0xdbfc('0x26')]);_0xcc24ff[_0xdbfc('0x2f')]=_[_0xdbfc('0x2d')](_0x6576b8[_0xdbfc('0x2c')],qs[_0xdbfc('0x2e')](_0x3a6dd9[_0xdbfc('0x26')]['fields']));_0xcc24ff['attributes']=_0xcc24ff[_0xdbfc('0x2f')]['length']?_0xcc24ff['attributes']:_0x6576b8[_0xdbfc('0x2c')];if(!_0x3a6dd9[_0xdbfc('0x26')]['hasOwnProperty']('nolimit')){_0xcc24ff[_0xdbfc('0x14')]=qs[_0xdbfc('0x14')](_0x3a6dd9[_0xdbfc('0x26')][_0xdbfc('0x14')]);_0xcc24ff['offset']=qs['offset'](_0x3a6dd9['query']['offset']);}_0xcc24ff[_0xdbfc('0x40')]=qs['sort'](_0x3a6dd9['query'][_0xdbfc('0x41')]);_0xcc24ff['where']=qs[_0xdbfc('0x2b')](_[_0xdbfc('0x42')](_0x3a6dd9[_0xdbfc('0x26')],_0x6576b8[_0xdbfc('0x2b')]));_0xcc24ff[_0xdbfc('0x24')][_0xdbfc('0x43')]=_0x1eb6ec['id'];if(_0x3a6dd9[_0xdbfc('0x26')][_0xdbfc('0x44')]){_0xcc24ff[_0xdbfc('0x24')]=_[_0xdbfc('0x31')](_0xcc24ff[_0xdbfc('0x24')],{'$or':_[_0xdbfc('0x1e')](_0xcc24ff['attributes'],function(_0x35d468){var _0x5561c2={};_0x5561c2[_0x35d468]={'$like':'%'+_0x3a6dd9['query']['filter']+'%'};return _0x5561c2;})});}_0xcc24ff=_[_0xdbfc('0x31')]({},_0xcc24ff,_0x3a6dd9[_0xdbfc('0x45')]);return db[_0xdbfc('0x3f')][_0xdbfc('0x46')](_0xcc24ff);}})['then'](function(_0x418c5c){if(_0x418c5c){return db['User'][_0xdbfc('0x47')]({'where':{'id':_[_0xdbfc('0x1e')](_0x418c5c,'UserId'),'role':_0xdbfc('0x48')},'attributes':['id',_0xdbfc('0x3a'),_0xdbfc('0x49'),_0xdbfc('0x4a'),_0xdbfc('0x4b')]});}})['then'](function(_0x1685b9){if(_0x1685b9){return{'count':_0x1685b9['count'],'rows':_[_0xdbfc('0x1e')](_0x1685b9['rows'],function(_0x235082){return{'membername':_0x235082[_0xdbfc('0x3a')],'UserId':_0x235082['id'],'queue_name':_0x1014d2['name'],'OpenchannelQueueId':_0x1014d2['id'],'interface':util[_0xdbfc('0x4c')](_0xdbfc('0x4d'),_0xdbfc('0x4e'),_0x235082[_0xdbfc('0x3a')]),'penalty':0x0,'paused':_0x235082[_0xdbfc('0x49')],'createdAt':_0x235082[_0xdbfc('0x4b')],'updatedAt':_0x235082[_0xdbfc('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x55ec4d,_0xcc24ff))['catch'](handleError(_0x55ec4d,null));};exports[_0xdbfc('0x4f')]=function(_0x276f5e,_0x52e419){var _0x3b706e={};var _0x39ce62={};var _0x3959f2;var _0x4eb368;return db[_0xdbfc('0x1f')]['findOne']({'where':{'id':_0x276f5e['params']['id']}})[_0xdbfc('0x16')](handleEntityNotFound(_0x52e419,null))[_0xdbfc('0x16')](function(_0x50f4cb){if(_0x50f4cb){_0x3959f2=_0x50f4cb;_0x39ce62[_0xdbfc('0x2c')]=_[_0xdbfc('0x29')](db[_0xdbfc('0x50')]['rawAttributes']);_0x39ce62[_0xdbfc('0x26')]=_[_0xdbfc('0x29')](_0x276f5e[_0xdbfc('0x26')]);_0x39ce62[_0xdbfc('0x2b')]=_[_0xdbfc('0x2d')](_0x39ce62[_0xdbfc('0x2c')],_0x39ce62[_0xdbfc('0x26')]);_0x3b706e[_0xdbfc('0x2f')]=_[_0xdbfc('0x2d')](_0x39ce62[_0xdbfc('0x2c')],qs[_0xdbfc('0x2e')](_0x276f5e[_0xdbfc('0x26')][_0xdbfc('0x2e')]));_0x3b706e[_0xdbfc('0x2f')]=_0x3b706e[_0xdbfc('0x2f')][_0xdbfc('0x30')]?_0x3b706e[_0xdbfc('0x2f')]:_0x39ce62['model'];_0x3b706e[_0xdbfc('0x40')]=qs[_0xdbfc('0x41')](_0x276f5e[_0xdbfc('0x26')][_0xdbfc('0x41')]);_0x3b706e[_0xdbfc('0x24')]=qs[_0xdbfc('0x2b')](_[_0xdbfc('0x42')](_0x276f5e[_0xdbfc('0x26')],_0x39ce62['filters']));if(_0x276f5e[_0xdbfc('0x26')][_0xdbfc('0x44')]){_0x3b706e[_0xdbfc('0x24')]=_[_0xdbfc('0x31')](_0x3b706e[_0xdbfc('0x24')],{'$or':_[_0xdbfc('0x1e')](_0x3b706e['attributes'],function(_0x45040d){var _0x3a0d1f={};_0x3a0d1f[_0x45040d]={'$like':'%'+_0x276f5e[_0xdbfc('0x26')][_0xdbfc('0x44')]+'%'};return _0x3a0d1f;})});}_0x3b706e=_[_0xdbfc('0x31')]({},_0x3b706e,_0x276f5e[_0xdbfc('0x45')]);return _0x3959f2[_0xdbfc('0x4f')](_0x3b706e);}})[_0xdbfc('0x16')](function(_0x3e16a9){if(_0x3e16a9){_0x4eb368=_0x3e16a9['length'];if(!_0x276f5e[_0xdbfc('0x26')][_0xdbfc('0x51')](_0xdbfc('0x52'))){_0x3b706e[_0xdbfc('0x14')]=qs[_0xdbfc('0x14')](_0x276f5e[_0xdbfc('0x26')][_0xdbfc('0x14')]);_0x3b706e[_0xdbfc('0x11')]=qs[_0xdbfc('0x11')](_0x276f5e[_0xdbfc('0x26')]['offset']);}return _0x3959f2['getTeams'](_0x3b706e);}})[_0xdbfc('0x16')](function(_0x823172){if(_0x823172){return _0x823172?{'count':_0x4eb368,'rows':_0x823172}:null;}})['then'](respondWithResult(_0x52e419,null))['catch'](handleError(_0x52e419,null));};exports[_0xdbfc('0x53')]=function(_0x3de064,_0x218448){var _0x437b00=_0x3de064[_0xdbfc('0x34')][_0xdbfc('0x54')];return db[_0xdbfc('0x50')][_0xdbfc('0x46')]({'where':{'id':_0x437b00},'attributes':['id'],'include':[{'model':db[_0xdbfc('0x55')],'as':_0xdbfc('0x56'),'attributes':['id','name',_0xdbfc('0x57'),_0xdbfc('0x58'),_0xdbfc('0x59')],'raw':!![]}]})[_0xdbfc('0x16')](function(_0x2ce05d){if(_0x2ce05d){var _0x143da1=_[_0xdbfc('0x5a')](_0x2ce05d,function(_0x294f3a){var _0x717aed=_0x294f3a['get']({'plain':!![]});return _0x717aed[_0xdbfc('0x56')];});return db[_0xdbfc('0x1f')]['find']({'where':{'id':_0x3de064[_0xdbfc('0x3c')]['id']}})[_0xdbfc('0x16')](function(_0x15e603){return db[_0xdbfc('0x5b')][_0xdbfc('0x5c')](function(_0x4e2719){return _0x15e603[_0xdbfc('0x53')](_0x437b00,{'transaction':_0x4e2719})['then'](function(){return BPromise['each'](_0x143da1,function(_0x10fb1e){return db[_0xdbfc('0x3f')]['findOrCreate']({'where':{'UserId':_0x10fb1e['id'],'OpenchannelQueueId':_0x3de064[_0xdbfc('0x3c')]['id']},'transaction':_0x4e2719});});})[_0xdbfc('0x16')](function(){_0x143da1['forEach'](function(_0x23456b){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x23456b['id'],'OpenchannelQueueId':_0x15e603['id']});});});});});}})['then'](respondWithStatusCode(_0x218448,null))[_0xdbfc('0x27')](handleError(_0x218448,null));};exports[_0xdbfc('0x5d')]=function(_0x4448fc,_0x25bc4f){return db[_0xdbfc('0x50')][_0xdbfc('0x46')]({'where':{'id':_0x4448fc[_0xdbfc('0x26')][_0xdbfc('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xdbfc('0x16')](handleEntityNotFound(_0x25bc4f,null))[_0xdbfc('0x16')](function(_0x5a846){var _0xac41b7=_['map'](_0x5a846,'id');var _0xbd47ef=[];var _0x25639e=[];var _0x26cb7a=squel[_0xdbfc('0x5e')]();_0x26cb7a['field'](_0xdbfc('0x5f'))[_0xdbfc('0x60')](_0xdbfc('0x61'),'tq')[_0xdbfc('0x62')]('user_has_teams','ut',_0xdbfc('0x63'))['where'](_0xdbfc('0x64'),_0x4448fc[_0xdbfc('0x3c')]['id']);for(var _0x117779=0x0;_0x117779<_0x5a846['length'];_0x117779+=0x1){let _0x7c3f9a=_0x5a846[_0x117779];for(var _0x179b24=0x0;_0x179b24<_0x7c3f9a[_0xdbfc('0x56')][_0xdbfc('0x30')];_0x179b24+=0x1){let _0x1aee12=_0x7c3f9a[_0xdbfc('0x56')][_0x179b24];var _0x2c09be=_0x26cb7a[_0xdbfc('0x65')]();_0x2c09be['where']('ut.UserId\x20=\x20?',_0x1aee12['id']);_0x25639e[_0xdbfc('0x66')](db[_0xdbfc('0x5b')][_0xdbfc('0x26')](_0x2c09be[_0xdbfc('0x67')](),{'type':db[_0xdbfc('0x5b')][_0xdbfc('0x68')][_0xdbfc('0x69')]})[_0xdbfc('0x16')](function(_0x4ae600){if(_0x4ae600[_0xdbfc('0x30')]===0x1){return _0x1aee12['id'];}else{var _0x4327a1=_[_0xdbfc('0x6a')](_[_0xdbfc('0x1e')](_0x4ae600,'TeamId'),function(_0x145cbb){return _[_0xdbfc('0x6b')](_0xac41b7,_0x145cbb);});if(_0x4327a1){return _0x1aee12['id'];}}}));}}return BPromise[_0xdbfc('0x6c')](_0x25639e)[_0xdbfc('0x16')](function(_0x10ed98){_0xbd47ef=_(_0xbd47ef)[_0xdbfc('0x6d')](_0x10ed98)[_0xdbfc('0x6e')]()[_0xdbfc('0x6f')]();return db['OpenchannelQueue']['find']({'where':{'id':_0x4448fc[_0xdbfc('0x3c')]['id']}})['then'](function(_0x271703){return db[_0xdbfc('0x5b')]['transaction'](function(_0x22025c){return _0x271703[_0xdbfc('0x5d')](_0x4448fc[_0xdbfc('0x26')][_0xdbfc('0x54')],{'transaction':_0x22025c})[_0xdbfc('0x16')](function(){if(!_['isEmpty'](_0xbd47ef)){return _0x271703[_0xdbfc('0x70')](_0xbd47ef,{'transaction':_0x22025c});}})[_0xdbfc('0x16')](function(){_0xbd47ef[_0xdbfc('0x71')](function(_0x4679fc){socket[_0xdbfc('0x72')](_0xdbfc('0x73'),{'UserId':_0x4679fc,'OpenchannelQueueId':_0x271703['id']});});});});});});})[_0xdbfc('0x16')](respondWithStatusCode(_0x25bc4f,null))['catch'](handleError(_0x25bc4f,null));};exports[_0xdbfc('0x74')]=function(_0x3aef97,_0x2a5b5b){return db[_0xdbfc('0x1f')][_0xdbfc('0x32')]({'where':{'id':_0x3aef97[_0xdbfc('0x3c')]['id']}})[_0xdbfc('0x16')](handleEntityNotFound(_0x2a5b5b,null))[_0xdbfc('0x16')](function(_0x5ebdb6){if(_0x5ebdb6){return _0x5ebdb6[_0xdbfc('0x74')](_0x3aef97[_0xdbfc('0x34')][_0xdbfc('0x54')],_[_0xdbfc('0x75')](_0x3aef97['body'],['ids','id'])||{})[_0xdbfc('0x76')](function(_0xdaaead){for(var _0x5d9b50=0x0;_0x5d9b50<_0x3aef97[_0xdbfc('0x34')][_0xdbfc('0x54')][_0xdbfc('0x30')];_0x5d9b50+=0x1){socket[_0xdbfc('0x72')]('userOpenchannelQueue:save',{'UserId':Number(_0x3aef97[_0xdbfc('0x34')][_0xdbfc('0x54')][_0x5d9b50]),'OpenchannelQueueId':Number(_0x3aef97['params']['id'])});}return _0xdaaead;});}})['then'](respondWithResult(_0x2a5b5b,null))[_0xdbfc('0x27')](handleError(_0x2a5b5b,null));};exports[_0xdbfc('0x70')]=function(_0x7b6e52,_0x3b9a4f){return db[_0xdbfc('0x1f')]['find']({'where':{'id':_0x7b6e52[_0xdbfc('0x3c')]['id']}})[_0xdbfc('0x16')](handleEntityNotFound(_0x3b9a4f,null))[_0xdbfc('0x16')](function(_0x20ccca){if(_0x20ccca){return _0x20ccca['removeAgents'](_0x7b6e52[_0xdbfc('0x26')]['ids'])['then'](function(){if(_['isArray'](_0x7b6e52[_0xdbfc('0x26')]['ids'])){for(var _0x13ad3e=0x0;_0x13ad3e<_0x7b6e52[_0xdbfc('0x26')]['ids'][_0xdbfc('0x30')];_0x13ad3e+=0x1){socket[_0xdbfc('0x72')](_0xdbfc('0x73'),{'UserId':Number(_0x7b6e52[_0xdbfc('0x26')]['ids'][_0x13ad3e]),'OpenchannelQueueId':Number(_0x7b6e52['params']['id'])});}}else{socket[_0xdbfc('0x72')](_0xdbfc('0x73'),{'UserId':Number(_0x7b6e52[_0xdbfc('0x26')][_0xdbfc('0x54')]),'OpenchannelQueueId':Number(_0x7b6e52[_0xdbfc('0x3c')]['id'])});}});}})[_0xdbfc('0x16')](respondWithStatusCode(_0x3b9a4f,null))[_0xdbfc('0x27')](handleError(_0x3b9a4f,null));};exports['getAgents']=function(_0x6f4de5,_0x4a32df){var _0x8d36b0={};var _0x36b7f6={};var _0xaa9160;var _0x47b958;return db[_0xdbfc('0x1f')][_0xdbfc('0x77')]({'where':{'id':_0x6f4de5[_0xdbfc('0x3c')]['id']}})[_0xdbfc('0x16')](handleEntityNotFound(_0x4a32df,null))[_0xdbfc('0x16')](function(_0x3d4ee8){if(_0x3d4ee8){_0xaa9160=_0x3d4ee8;_0x36b7f6[_0xdbfc('0x2c')]=_[_0xdbfc('0x29')](db['User'][_0xdbfc('0x2a')]);_0x36b7f6[_0xdbfc('0x26')]=_[_0xdbfc('0x29')](_0x6f4de5[_0xdbfc('0x26')]);_0x36b7f6[_0xdbfc('0x2b')]=_[_0xdbfc('0x2d')](_0x36b7f6[_0xdbfc('0x2c')],_0x36b7f6[_0xdbfc('0x26')]);_0x8d36b0['attributes']=_['intersection'](_0x36b7f6[_0xdbfc('0x2c')],qs[_0xdbfc('0x2e')](_0x6f4de5[_0xdbfc('0x26')]['fields']));_0x8d36b0['attributes']=_0x8d36b0[_0xdbfc('0x2f')]['length']?_0x8d36b0['attributes']:_0x36b7f6['model'];_0x8d36b0[_0xdbfc('0x40')]=qs[_0xdbfc('0x41')](_0x6f4de5[_0xdbfc('0x26')][_0xdbfc('0x41')]);_0x8d36b0[_0xdbfc('0x24')]=qs[_0xdbfc('0x2b')](_[_0xdbfc('0x42')](_0x6f4de5['query'],_0x36b7f6[_0xdbfc('0x2b')]));if(_0x6f4de5[_0xdbfc('0x26')][_0xdbfc('0x44')]){_0x8d36b0['where']=_[_0xdbfc('0x31')](_0x8d36b0[_0xdbfc('0x24')],{'$or':_[_0xdbfc('0x1e')](_0x8d36b0['attributes'],function(_0x26ce35){var _0x33bd9c={};_0x33bd9c[_0x26ce35]={'$like':'%'+_0x6f4de5[_0xdbfc('0x26')]['filter']+'%'};return _0x33bd9c;})});}_0x8d36b0=_[_0xdbfc('0x31')]({},_0x8d36b0,_0x6f4de5[_0xdbfc('0x45')]);return _0xaa9160['getAgents'](_0x8d36b0);}})['then'](function(_0x4978bc){if(_0x4978bc){_0x47b958=_0x4978bc[_0xdbfc('0x30')];if(!_0x6f4de5['query']['hasOwnProperty']('nolimit')){_0x8d36b0[_0xdbfc('0x14')]=qs[_0xdbfc('0x14')](_0x6f4de5[_0xdbfc('0x26')]['limit']);_0x8d36b0['offset']=qs[_0xdbfc('0x11')](_0x6f4de5[_0xdbfc('0x26')][_0xdbfc('0x11')]);}return _0xaa9160[_0xdbfc('0x78')](_0x8d36b0);}})[_0xdbfc('0x16')](function(_0x514bca){if(_0x514bca){return _0x514bca?{'count':_0x47b958,'rows':_0x514bca}:null;}})[_0xdbfc('0x16')](respondWithResult(_0x4a32df,null))[_0xdbfc('0x27')](handleError(_0x4a32df,null));}; \ No newline at end of file +var _0xfda7=['ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','register','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','OpenchannelQueues','error','stack','name','index','OpenchannelQueue','type','key','getOptions','include','query','findAll','rows','catch','show','params','model','keys','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','rawAttributes','filters','order','sort','where','pick','OpenchannelQueueId','filter','map','findAndCountAll','UserId','agent','format','%s/%s','SIP','openchannelPause','createdAt','updatedAt','getTeams','hasOwnProperty','nolimit','ids','Team','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams'];(function(_0x2a83dc,_0x24697a){var _0x18ef39=function(_0x2ca9fe){while(--_0x2ca9fe){_0x2a83dc['push'](_0x2a83dc['shift']());}};_0x18ef39(++_0x24697a);}(_0xfda7,0x18e));var _0x7fda=function(_0x2dd18f,_0x37dc7c){_0x2dd18f=_0x2dd18f-0x0;var _0x46243a=_0xfda7[_0x2dd18f];return _0x46243a;};'use strict';var BPromise=require(_0x7fda('0x0'));var util=require(_0x7fda('0x1'));var _=require(_0x7fda('0x2'));var squel=require(_0x7fda('0x3'));var Redis=require('ioredis');var qs=require(_0x7fda('0x4'));var logger=require(_0x7fda('0x5'))(_0x7fda('0x6'));var config=require(_0x7fda('0x7'));var db=require('../../mysqldb')['db'];config[_0x7fda('0x8')]=_[_0x7fda('0x9')](config[_0x7fda('0x8')],{'host':_0x7fda('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7fda('0x8')]));require('./openchannelQueue.socket')[_0x7fda('0xb')](socket);function respondWithStatusCode(_0xa2d44,_0x42f4f3){_0x42f4f3=_0x42f4f3||0xcc;return function(_0x58d12e){if(_0x58d12e){return _0xa2d44['sendStatus'](_0x42f4f3);}return _0xa2d44[_0x7fda('0xc')](_0x42f4f3)[_0x7fda('0xd')]();};}function respondWithResult(_0xba9718,_0x41f5c7){_0x41f5c7=_0x41f5c7||0xc8;return function(_0x41f5ab){if(_0x41f5ab){return _0xba9718[_0x7fda('0xc')](_0x41f5c7)[_0x7fda('0xe')](_0x41f5ab);}};}function respondWithFilteredResult(_0x37fc00,_0x5b3d85){return function(_0x33f195){if(_0x33f195){var _0x2d08e5=typeof _0x5b3d85[_0x7fda('0xf')]===_0x7fda('0x10')&&typeof _0x5b3d85['limit']==='undefined';var _0x28c935=_0x33f195[_0x7fda('0x11')];var _0x2a10e6=_0x2d08e5?0x0:_0x5b3d85[_0x7fda('0xf')];var _0x2a544a=_0x2d08e5?_0x33f195[_0x7fda('0x11')]:_0x5b3d85[_0x7fda('0xf')]+_0x5b3d85[_0x7fda('0x12')];var _0x135f9e;if(_0x2a544a>=_0x28c935){_0x2a544a=_0x28c935;_0x135f9e=0xc8;}else{_0x135f9e=0xce;}_0x37fc00[_0x7fda('0xc')](_0x135f9e);return _0x37fc00[_0x7fda('0x13')](_0x7fda('0x14'),_0x2a10e6+'-'+_0x2a544a+'/'+_0x28c935)[_0x7fda('0xe')](_0x33f195);}return null;};}function saveUpdates(_0x1f4fa0){return function(_0x2ed0d2){if(_0x2ed0d2){return _0x2ed0d2[_0x7fda('0x15')](_0x1f4fa0)[_0x7fda('0x16')](function(_0xc6312f){return _0xc6312f;});}return null;};}function removeEntity(_0x3f10a2){return function(_0xb43bde){if(_0xb43bde){return _0xb43bde[_0x7fda('0x17')]()[_0x7fda('0x16')](function(){var _0xee1000=_0xb43bde[_0x7fda('0x18')]({'plain':!![]});var _0x412f06=_0x7fda('0x19');return db['UserProfileResource']['destroy']({'where':{'type':_0x412f06,'resourceId':_0xee1000['id']}})[_0x7fda('0x16')](function(){return _0xb43bde;});})['then'](function(){_0x3f10a2[_0x7fda('0xc')](0xcc)[_0x7fda('0xd')]();});}};}function handleEntityNotFound(_0x3c34be){return function(_0x27a823){if(!_0x27a823){_0x3c34be['sendStatus'](0x194);}return _0x27a823;};}function handleError(_0x232147,_0x139ed5){_0x139ed5=_0x139ed5||0x1f4;return function(_0x2f2d35){logger[_0x7fda('0x1a')](_0x2f2d35[_0x7fda('0x1b')]);if(_0x2f2d35[_0x7fda('0x1c')]){delete _0x2f2d35['name'];}_0x232147[_0x7fda('0xc')](_0x139ed5)['send'](_0x2f2d35);};}exports[_0x7fda('0x1d')]=function(_0x4f07c2,_0x3ecba9){var _0x4aa8ae={};var _0x390b33={'count':0x0,'rows':[]};var _0x387da5=_['map'](db[_0x7fda('0x1e')]['rawAttributes'],function(_0xb35bcb){return{'name':_0xb35bcb['fieldName'],'type':_0xb35bcb[_0x7fda('0x1f')][_0x7fda('0x20')]};});_0x4aa8ae=qs[_0x7fda('0x21')](_0x387da5,_0x4f07c2);var _0x4eb99f={'where':_0x4aa8ae['where']};return db[_0x7fda('0x1e')][_0x7fda('0x11')](_0x4eb99f)[_0x7fda('0x16')](function(_0x43d111){_0x390b33['count']=_0x43d111;_0x4aa8ae['include']=qs[_0x7fda('0x22')](_0x4f07c2[_0x7fda('0x23')]);return db[_0x7fda('0x1e')][_0x7fda('0x24')](_0x4aa8ae);})[_0x7fda('0x16')](function(_0x1727b9){_0x390b33[_0x7fda('0x25')]=_0x1727b9;return _0x390b33;})[_0x7fda('0x16')](respondWithFilteredResult(_0x3ecba9,_0x4aa8ae))[_0x7fda('0x26')](handleError(_0x3ecba9,null));};exports[_0x7fda('0x27')]=function(_0x418fab,_0x577808){var _0x44248e={'raw':!![],'where':{'id':_0x418fab[_0x7fda('0x28')]['id']}},_0x394ef3={};_0x394ef3[_0x7fda('0x29')]=_[_0x7fda('0x2a')](db[_0x7fda('0x1e')]['rawAttributes']);_0x394ef3[_0x7fda('0x23')]=_['keys'](_0x418fab[_0x7fda('0x23')]);_0x394ef3['filters']=_[_0x7fda('0x2b')](_0x394ef3['model'],_0x394ef3[_0x7fda('0x23')]);_0x44248e[_0x7fda('0x2c')]=_[_0x7fda('0x2b')](_0x394ef3[_0x7fda('0x29')],qs[_0x7fda('0x2d')](_0x418fab[_0x7fda('0x23')]['fields']));_0x44248e[_0x7fda('0x2c')]=_0x44248e[_0x7fda('0x2c')][_0x7fda('0x2e')]?_0x44248e[_0x7fda('0x2c')]:_0x394ef3[_0x7fda('0x29')];if(_0x418fab[_0x7fda('0x23')][_0x7fda('0x2f')]){_0x44248e[_0x7fda('0x22')]=[{'all':!![]}];}_0x44248e=_[_0x7fda('0x30')]({},_0x44248e,_0x418fab[_0x7fda('0x31')]);return db[_0x7fda('0x1e')][_0x7fda('0x32')](_0x44248e)[_0x7fda('0x16')](handleEntityNotFound(_0x577808,null))[_0x7fda('0x16')](respondWithResult(_0x577808,null))[_0x7fda('0x26')](handleError(_0x577808,null));};exports['create']=function(_0x392568,_0x240a5b){return db[_0x7fda('0x1e')][_0x7fda('0x33')](_0x392568[_0x7fda('0x34')],{})[_0x7fda('0x16')](function(_0x38c9e4){var _0xe918ba=_0x392568[_0x7fda('0x35')][_0x7fda('0x18')]({'plain':!![]});if(!_0xe918ba)throw new Error(_0x7fda('0x36'));if(_0xe918ba['role']===_0x7fda('0x35')){var _0x5205b8=_0x38c9e4[_0x7fda('0x18')]({'plain':!![]});var _0x1f8ed9=_0x7fda('0x19');return db[_0x7fda('0x37')]['find']({'where':{'name':_0x1f8ed9,'userProfileId':_0xe918ba[_0x7fda('0x38')]},'raw':!![]})[_0x7fda('0x16')](function(_0x371ef3){if(_0x371ef3&&_0x371ef3[_0x7fda('0x39')]===0x0){return db[_0x7fda('0x3a')][_0x7fda('0x33')]({'name':_0x5205b8[_0x7fda('0x1c')],'resourceId':_0x5205b8['id'],'type':_0x371ef3['name'],'sectionId':_0x371ef3['id']},{})[_0x7fda('0x16')](function(){return _0x38c9e4;});}else{return _0x38c9e4;}})[_0x7fda('0x26')](function(_0x1fffc4){logger[_0x7fda('0x1a')](_0x7fda('0x3b'),_0x1fffc4);throw _0x1fffc4;});}return _0x38c9e4;})[_0x7fda('0x16')](respondWithResult(_0x240a5b,0xc9))[_0x7fda('0x26')](handleError(_0x240a5b,null));};exports[_0x7fda('0x15')]=function(_0x11f3fc,_0x18a771){if(_0x11f3fc[_0x7fda('0x34')]['id']){delete _0x11f3fc['body']['id'];}return db[_0x7fda('0x1e')][_0x7fda('0x32')]({'where':{'id':_0x11f3fc[_0x7fda('0x28')]['id']}})['then'](handleEntityNotFound(_0x18a771,null))[_0x7fda('0x16')](saveUpdates(_0x11f3fc[_0x7fda('0x34')],null))[_0x7fda('0x16')](respondWithResult(_0x18a771,null))[_0x7fda('0x26')](handleError(_0x18a771,null));};exports['destroy']=function(_0x477a86,_0x4caf2b){return db['OpenchannelQueue'][_0x7fda('0x32')]({'where':{'id':_0x477a86[_0x7fda('0x28')]['id']}})[_0x7fda('0x16')](handleEntityNotFound(_0x4caf2b,null))['then'](removeEntity(_0x4caf2b,null))[_0x7fda('0x26')](handleError(_0x4caf2b,null));};exports[_0x7fda('0x3c')]=function(_0x559549,_0x6e05fc){return db[_0x7fda('0x1e')][_0x7fda('0x3c')]()['then'](respondWithResult(_0x6e05fc,null))[_0x7fda('0x26')](handleError(_0x6e05fc,null));};exports['getMembers']=function(_0x5070d2,_0x1da0b2){var _0x57d1c2={'raw':!![],'where':{}},_0x2a8fdb={},_0xa906b1;return db[_0x7fda('0x1e')][_0x7fda('0x3d')]({'where':{'id':_0x5070d2[_0x7fda('0x28')]['id']}})[_0x7fda('0x16')](handleEntityNotFound(_0x1da0b2,null))['then'](function(_0x9d68ce){if(_0x9d68ce){_0xa906b1=_0x9d68ce[_0x7fda('0x18')]({'plain':!![]});_0x2a8fdb[_0x7fda('0x29')]=_[_0x7fda('0x2a')](db[_0x7fda('0x3e')][_0x7fda('0x3f')]);_0x2a8fdb[_0x7fda('0x23')]=_['keys'](_0x5070d2[_0x7fda('0x23')]);_0x2a8fdb[_0x7fda('0x40')]=_[_0x7fda('0x2b')](_0x2a8fdb[_0x7fda('0x29')],_0x2a8fdb['query']);_0x57d1c2[_0x7fda('0x2c')]=_[_0x7fda('0x2b')](_0x2a8fdb[_0x7fda('0x29')],qs['fields'](_0x5070d2['query'][_0x7fda('0x2d')]));_0x57d1c2[_0x7fda('0x2c')]=_0x57d1c2[_0x7fda('0x2c')][_0x7fda('0x2e')]?_0x57d1c2['attributes']:_0x2a8fdb['model'];if(!_0x5070d2[_0x7fda('0x23')]['hasOwnProperty']('nolimit')){_0x57d1c2[_0x7fda('0x12')]=qs[_0x7fda('0x12')](_0x5070d2['query']['limit']);_0x57d1c2['offset']=qs[_0x7fda('0xf')](_0x5070d2[_0x7fda('0x23')][_0x7fda('0xf')]);}_0x57d1c2[_0x7fda('0x41')]=qs[_0x7fda('0x42')](_0x5070d2[_0x7fda('0x23')][_0x7fda('0x42')]);_0x57d1c2[_0x7fda('0x43')]=qs[_0x7fda('0x40')](_[_0x7fda('0x44')](_0x5070d2[_0x7fda('0x23')],_0x2a8fdb[_0x7fda('0x40')]));_0x57d1c2[_0x7fda('0x43')][_0x7fda('0x45')]=_0x9d68ce['id'];if(_0x5070d2['query'][_0x7fda('0x46')]){_0x57d1c2['where']=_[_0x7fda('0x30')](_0x57d1c2[_0x7fda('0x43')],{'$or':_[_0x7fda('0x47')](_0x57d1c2[_0x7fda('0x2c')],function(_0x8f15d1){var _0x335ce1={};_0x335ce1[_0x8f15d1]={'$like':'%'+_0x5070d2[_0x7fda('0x23')][_0x7fda('0x46')]+'%'};return _0x335ce1;})});}_0x57d1c2=_[_0x7fda('0x30')]({},_0x57d1c2,_0x5070d2[_0x7fda('0x31')]);return db['UserOpenchannelQueue'][_0x7fda('0x24')](_0x57d1c2);}})[_0x7fda('0x16')](function(_0x416123){if(_0x416123){return db['User'][_0x7fda('0x48')]({'where':{'id':_[_0x7fda('0x47')](_0x416123,_0x7fda('0x49')),'role':_0x7fda('0x4a')},'attributes':['id',_0x7fda('0x1c'),'openchannelPause','updatedAt','createdAt']});}})[_0x7fda('0x16')](function(_0x35fdbc){if(_0x35fdbc){return{'count':_0x35fdbc[_0x7fda('0x11')],'rows':_[_0x7fda('0x47')](_0x35fdbc[_0x7fda('0x25')],function(_0x42a83d){return{'membername':_0x42a83d[_0x7fda('0x1c')],'UserId':_0x42a83d['id'],'queue_name':_0xa906b1[_0x7fda('0x1c')],'OpenchannelQueueId':_0xa906b1['id'],'interface':util[_0x7fda('0x4b')](_0x7fda('0x4c'),_0x7fda('0x4d'),_0x42a83d[_0x7fda('0x1c')]),'penalty':0x0,'paused':_0x42a83d[_0x7fda('0x4e')],'createdAt':_0x42a83d[_0x7fda('0x4f')],'updatedAt':_0x42a83d[_0x7fda('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1da0b2,_0x57d1c2))[_0x7fda('0x26')](handleError(_0x1da0b2,null));};exports['getTeams']=function(_0x34b6b9,_0x3991b8){var _0x38a3ac={};var _0x774afe={};var _0x4d6535;var _0x14c48d;return db[_0x7fda('0x1e')][_0x7fda('0x3d')]({'where':{'id':_0x34b6b9[_0x7fda('0x28')]['id']}})[_0x7fda('0x16')](handleEntityNotFound(_0x3991b8,null))[_0x7fda('0x16')](function(_0x404b7f){if(_0x404b7f){_0x4d6535=_0x404b7f;_0x774afe[_0x7fda('0x29')]=_[_0x7fda('0x2a')](db['Team'][_0x7fda('0x3f')]);_0x774afe[_0x7fda('0x23')]=_[_0x7fda('0x2a')](_0x34b6b9[_0x7fda('0x23')]);_0x774afe['filters']=_['intersection'](_0x774afe['model'],_0x774afe[_0x7fda('0x23')]);_0x38a3ac[_0x7fda('0x2c')]=_[_0x7fda('0x2b')](_0x774afe['model'],qs['fields'](_0x34b6b9[_0x7fda('0x23')]['fields']));_0x38a3ac[_0x7fda('0x2c')]=_0x38a3ac[_0x7fda('0x2c')][_0x7fda('0x2e')]?_0x38a3ac[_0x7fda('0x2c')]:_0x774afe[_0x7fda('0x29')];_0x38a3ac[_0x7fda('0x41')]=qs['sort'](_0x34b6b9[_0x7fda('0x23')][_0x7fda('0x42')]);_0x38a3ac['where']=qs[_0x7fda('0x40')](_[_0x7fda('0x44')](_0x34b6b9[_0x7fda('0x23')],_0x774afe['filters']));if(_0x34b6b9[_0x7fda('0x23')][_0x7fda('0x46')]){_0x38a3ac['where']=_['merge'](_0x38a3ac[_0x7fda('0x43')],{'$or':_[_0x7fda('0x47')](_0x38a3ac['attributes'],function(_0x3dde3e){var _0x3a1f3a={};_0x3a1f3a[_0x3dde3e]={'$like':'%'+_0x34b6b9['query'][_0x7fda('0x46')]+'%'};return _0x3a1f3a;})});}_0x38a3ac=_[_0x7fda('0x30')]({},_0x38a3ac,_0x34b6b9[_0x7fda('0x31')]);return _0x4d6535[_0x7fda('0x51')](_0x38a3ac);}})[_0x7fda('0x16')](function(_0x20194d){if(_0x20194d){_0x14c48d=_0x20194d[_0x7fda('0x2e')];if(!_0x34b6b9[_0x7fda('0x23')][_0x7fda('0x52')](_0x7fda('0x53'))){_0x38a3ac[_0x7fda('0x12')]=qs['limit'](_0x34b6b9[_0x7fda('0x23')][_0x7fda('0x12')]);_0x38a3ac['offset']=qs[_0x7fda('0xf')](_0x34b6b9[_0x7fda('0x23')][_0x7fda('0xf')]);}return _0x4d6535[_0x7fda('0x51')](_0x38a3ac);}})[_0x7fda('0x16')](function(_0x3a60c5){if(_0x3a60c5){return _0x3a60c5?{'count':_0x14c48d,'rows':_0x3a60c5}:null;}})[_0x7fda('0x16')](respondWithResult(_0x3991b8,null))[_0x7fda('0x26')](handleError(_0x3991b8,null));};exports['addTeams']=function(_0x521b12,_0x427548){var _0x5e5ba9=_0x521b12[_0x7fda('0x34')][_0x7fda('0x54')];return db[_0x7fda('0x55')][_0x7fda('0x24')]({'where':{'id':_0x5e5ba9},'attributes':['id'],'include':[{'model':db[_0x7fda('0x56')],'as':_0x7fda('0x57'),'attributes':['id',_0x7fda('0x1c'),_0x7fda('0x58'),_0x7fda('0x59'),_0x7fda('0x5a')],'raw':!![]}]})[_0x7fda('0x16')](function(_0x4761c6){if(_0x4761c6){var _0xe53c27=_[_0x7fda('0x5b')](_0x4761c6,function(_0x16ae7e){var _0x373da7=_0x16ae7e[_0x7fda('0x18')]({'plain':!![]});return _0x373da7[_0x7fda('0x57')];});return db[_0x7fda('0x1e')][_0x7fda('0x32')]({'where':{'id':_0x521b12[_0x7fda('0x28')]['id']}})[_0x7fda('0x16')](function(_0x8b37c6){return db[_0x7fda('0x5c')][_0x7fda('0x5d')](function(_0x28f24f){return _0x8b37c6['addTeams'](_0x5e5ba9,{'transaction':_0x28f24f})[_0x7fda('0x16')](function(){return BPromise[_0x7fda('0x5e')](_0xe53c27,function(_0xe3336c){return db[_0x7fda('0x3e')][_0x7fda('0x5f')]({'where':{'UserId':_0xe3336c['id'],'OpenchannelQueueId':_0x521b12[_0x7fda('0x28')]['id']},'transaction':_0x28f24f});});})['then'](function(){_0xe53c27[_0x7fda('0x60')](function(_0x502d32){socket[_0x7fda('0x61')](_0x7fda('0x62'),{'UserId':_0x502d32['id'],'OpenchannelQueueId':_0x8b37c6['id']});});});});});}})[_0x7fda('0x16')](respondWithStatusCode(_0x427548,null))[_0x7fda('0x26')](handleError(_0x427548,null));};exports[_0x7fda('0x63')]=function(_0x179955,_0x54c727){return db[_0x7fda('0x55')][_0x7fda('0x24')]({'where':{'id':_0x179955['query'][_0x7fda('0x54')]},'attributes':['id'],'include':[{'model':db[_0x7fda('0x56')],'as':_0x7fda('0x57'),'attributes':['id'],'raw':!![]}]})[_0x7fda('0x16')](handleEntityNotFound(_0x54c727,null))[_0x7fda('0x16')](function(_0x3678f2){var _0x2d1ba9=_[_0x7fda('0x47')](_0x3678f2,'id');var _0xa7de00=[];var _0x2ddff1=[];var _0x4ed63b=squel[_0x7fda('0x64')]();_0x4ed63b[_0x7fda('0x65')](_0x7fda('0x66'))[_0x7fda('0x67')](_0x7fda('0x68'),'tq')['join'](_0x7fda('0x69'),'ut',_0x7fda('0x6a'))[_0x7fda('0x43')]('OpenchannelQueueId\x20=\x20?',_0x179955[_0x7fda('0x28')]['id']);for(var _0x10e114=0x0;_0x10e114<_0x3678f2[_0x7fda('0x2e')];_0x10e114+=0x1){let _0x5dbba9=_0x3678f2[_0x10e114];for(var _0x5ee5c1=0x0;_0x5ee5c1<_0x5dbba9[_0x7fda('0x57')][_0x7fda('0x2e')];_0x5ee5c1+=0x1){let _0x7bfc3e=_0x5dbba9[_0x7fda('0x57')][_0x5ee5c1];var _0x186ce1=_0x4ed63b[_0x7fda('0x6b')]();_0x186ce1[_0x7fda('0x43')](_0x7fda('0x6c'),_0x7bfc3e['id']);_0x2ddff1['push'](db['sequelize'][_0x7fda('0x23')](_0x186ce1[_0x7fda('0x6d')](),{'type':db[_0x7fda('0x5c')][_0x7fda('0x6e')][_0x7fda('0x6f')]})[_0x7fda('0x16')](function(_0x3e65f0){if(_0x3e65f0[_0x7fda('0x2e')]===0x1){return _0x7bfc3e['id'];}else{var _0xf67cd2=_[_0x7fda('0x70')](_[_0x7fda('0x47')](_0x3e65f0,_0x7fda('0x71')),function(_0x26b375){return _['includes'](_0x2d1ba9,_0x26b375);});if(_0xf67cd2){return _0x7bfc3e['id'];}}}));}}return BPromise[_0x7fda('0x72')](_0x2ddff1)[_0x7fda('0x16')](function(_0x16a4bd){_0xa7de00=_(_0xa7de00)[_0x7fda('0x73')](_0x16a4bd)[_0x7fda('0x74')]()[_0x7fda('0x75')]();return db[_0x7fda('0x1e')][_0x7fda('0x32')]({'where':{'id':_0x179955[_0x7fda('0x28')]['id']}})[_0x7fda('0x16')](function(_0x468ef8){return db[_0x7fda('0x5c')][_0x7fda('0x5d')](function(_0x43822c){return _0x468ef8[_0x7fda('0x63')](_0x179955['query'][_0x7fda('0x54')],{'transaction':_0x43822c})['then'](function(){if(!_[_0x7fda('0x76')](_0xa7de00)){return _0x468ef8[_0x7fda('0x77')](_0xa7de00,{'transaction':_0x43822c});}})[_0x7fda('0x16')](function(){_0xa7de00[_0x7fda('0x60')](function(_0x2af899){socket['emit'](_0x7fda('0x78'),{'UserId':_0x2af899,'OpenchannelQueueId':_0x468ef8['id']});});});});});});})['then'](respondWithStatusCode(_0x54c727,null))['catch'](handleError(_0x54c727,null));};exports[_0x7fda('0x79')]=function(_0x56d602,_0x1c1f7c){return db[_0x7fda('0x1e')]['find']({'where':{'id':_0x56d602[_0x7fda('0x28')]['id']}})[_0x7fda('0x16')](handleEntityNotFound(_0x1c1f7c,null))[_0x7fda('0x16')](function(_0x155fd5){if(_0x155fd5){return _0x155fd5[_0x7fda('0x79')](_0x56d602[_0x7fda('0x34')]['ids'],_[_0x7fda('0x7a')](_0x56d602['body'],[_0x7fda('0x54'),'id'])||{})[_0x7fda('0x7b')](function(_0x26f1e6){for(var _0x4b8cb6=0x0;_0x4b8cb6<_0x56d602[_0x7fda('0x34')]['ids'][_0x7fda('0x2e')];_0x4b8cb6+=0x1){socket[_0x7fda('0x61')](_0x7fda('0x62'),{'UserId':Number(_0x56d602[_0x7fda('0x34')][_0x7fda('0x54')][_0x4b8cb6]),'OpenchannelQueueId':Number(_0x56d602[_0x7fda('0x28')]['id'])});}return _0x26f1e6;});}})[_0x7fda('0x16')](respondWithResult(_0x1c1f7c,null))[_0x7fda('0x26')](handleError(_0x1c1f7c,null));};exports[_0x7fda('0x77')]=function(_0x182070,_0x784f22){return db[_0x7fda('0x1e')]['find']({'where':{'id':_0x182070[_0x7fda('0x28')]['id']}})[_0x7fda('0x16')](handleEntityNotFound(_0x784f22,null))[_0x7fda('0x16')](function(_0x1c1ca9){if(_0x1c1ca9){return _0x1c1ca9[_0x7fda('0x77')](_0x182070[_0x7fda('0x23')][_0x7fda('0x54')])[_0x7fda('0x16')](function(){if(_[_0x7fda('0x7c')](_0x182070[_0x7fda('0x23')]['ids'])){for(var _0x51ad8a=0x0;_0x51ad8a<_0x182070[_0x7fda('0x23')][_0x7fda('0x54')]['length'];_0x51ad8a+=0x1){socket[_0x7fda('0x61')]('userOpenchannelQueue:remove',{'UserId':Number(_0x182070[_0x7fda('0x23')]['ids'][_0x51ad8a]),'OpenchannelQueueId':Number(_0x182070[_0x7fda('0x28')]['id'])});}}else{socket[_0x7fda('0x61')]('userOpenchannelQueue:remove',{'UserId':Number(_0x182070[_0x7fda('0x23')][_0x7fda('0x54')]),'OpenchannelQueueId':Number(_0x182070['params']['id'])});}});}})['then'](respondWithStatusCode(_0x784f22,null))[_0x7fda('0x26')](handleError(_0x784f22,null));};exports[_0x7fda('0x7d')]=function(_0x2ea5bd,_0x3cde9f){var _0x217e44={};var _0x3efba7={};var _0x50b2cb;var _0x50614e;return db[_0x7fda('0x1e')][_0x7fda('0x3d')]({'where':{'id':_0x2ea5bd[_0x7fda('0x28')]['id']}})['then'](handleEntityNotFound(_0x3cde9f,null))['then'](function(_0x2e2ed0){if(_0x2e2ed0){_0x50b2cb=_0x2e2ed0;_0x3efba7[_0x7fda('0x29')]=_[_0x7fda('0x2a')](db[_0x7fda('0x56')][_0x7fda('0x3f')]);_0x3efba7[_0x7fda('0x23')]=_[_0x7fda('0x2a')](_0x2ea5bd[_0x7fda('0x23')]);_0x3efba7[_0x7fda('0x40')]=_['intersection'](_0x3efba7['model'],_0x3efba7[_0x7fda('0x23')]);_0x217e44[_0x7fda('0x2c')]=_[_0x7fda('0x2b')](_0x3efba7[_0x7fda('0x29')],qs['fields'](_0x2ea5bd['query'][_0x7fda('0x2d')]));_0x217e44[_0x7fda('0x2c')]=_0x217e44['attributes'][_0x7fda('0x2e')]?_0x217e44[_0x7fda('0x2c')]:_0x3efba7['model'];_0x217e44[_0x7fda('0x41')]=qs['sort'](_0x2ea5bd[_0x7fda('0x23')]['sort']);_0x217e44['where']=qs[_0x7fda('0x40')](_[_0x7fda('0x44')](_0x2ea5bd[_0x7fda('0x23')],_0x3efba7[_0x7fda('0x40')]));if(_0x2ea5bd[_0x7fda('0x23')]['filter']){_0x217e44[_0x7fda('0x43')]=_['merge'](_0x217e44[_0x7fda('0x43')],{'$or':_['map'](_0x217e44['attributes'],function(_0x2ac3f2){var _0x22251e={};_0x22251e[_0x2ac3f2]={'$like':'%'+_0x2ea5bd[_0x7fda('0x23')][_0x7fda('0x46')]+'%'};return _0x22251e;})});}_0x217e44=_[_0x7fda('0x30')]({},_0x217e44,_0x2ea5bd['options']);return _0x50b2cb[_0x7fda('0x7d')](_0x217e44);}})[_0x7fda('0x16')](function(_0x12ece8){if(_0x12ece8){_0x50614e=_0x12ece8[_0x7fda('0x2e')];if(!_0x2ea5bd[_0x7fda('0x23')][_0x7fda('0x52')](_0x7fda('0x53'))){_0x217e44[_0x7fda('0x12')]=qs['limit'](_0x2ea5bd[_0x7fda('0x23')][_0x7fda('0x12')]);_0x217e44[_0x7fda('0xf')]=qs[_0x7fda('0xf')](_0x2ea5bd[_0x7fda('0x23')][_0x7fda('0xf')]);}return _0x50b2cb[_0x7fda('0x7d')](_0x217e44);}})['then'](function(_0x2cfc54){if(_0x2cfc54){return _0x2cfc54?{'count':_0x50614e,'rows':_0x2cfc54}:null;}})['then'](respondWithResult(_0x3cde9f,null))[_0x7fda('0x26')](handleError(_0x3cde9f,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 5c2bf07..762e00d 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 _0xa7ae=['events','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xa7ae,0x1f4));var _0xea7a=function(_0x4b0796,_0x4f0969){_0x4b0796=_0x4b0796-0x0;var _0x306394=_0xa7ae[_0x4b0796];return _0x306394;};'use strict';var EventEmitter=require(_0xea7a('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xea7a('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xea7a('0x2')](0x0);var events={'afterCreate':_0xea7a('0x3'),'afterUpdate':_0xea7a('0x4'),'afterDestroy':_0xea7a('0x5')};function emitEvent(_0x398f34){return function(_0x3f2e78,_0x1d7b35,_0x5eb839){OpenchannelQueueEvents[_0xea7a('0x6')](_0x398f34+':'+_0x3f2e78['id'],_0x3f2e78);OpenchannelQueueEvents['emit'](_0x398f34,_0x3f2e78);_0x5eb839(null);};}for(var e in events){if(events[_0xea7a('0x7')](e)){var event=events[e];OpenchannelQueue[_0xea7a('0x8')](e,emitEvent(event));}}module[_0xea7a('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xabed=['events','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1d82b2,_0x2dd498){var _0x43436f=function(_0x27f169){while(--_0x27f169){_0x1d82b2['push'](_0x1d82b2['shift']());}};_0x43436f(++_0x2dd498);}(_0xabed,0x1ae));var _0xdabe=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0xabed[_0x26b622];return _0x58a028;};'use strict';var EventEmitter=require(_0xdabe('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xdabe('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xdabe('0x2')](0x0);var events={'afterCreate':_0xdabe('0x3'),'afterUpdate':_0xdabe('0x4'),'afterDestroy':_0xdabe('0x5')};function emitEvent(_0x4f308){return function(_0x3448fb,_0x2fbb90,_0x455d91){OpenchannelQueueEvents[_0xdabe('0x6')](_0x4f308+':'+_0x3448fb['id'],_0x3448fb);OpenchannelQueueEvents[_0xdabe('0x6')](_0x4f308,_0x3448fb);_0x455d91(null);};}for(var e in events){if(events[_0xdabe('0x7')](e)){var event=events[e];OpenchannelQueue[_0xdabe('0x8')](e,emitEvent(event));}}module[_0xdabe('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 6d55356..33acad6 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 _0xb431=['OpenchannelQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5382fe,_0x9b02a){var _0x2c0146=function(_0x9c63f8){while(--_0x9c63f8){_0x5382fe['push'](_0x5382fe['shift']());}};_0x2c0146(++_0x9b02a);}(_0xb431,0x1bb));var _0x1b43=function(_0x2beb93,_0xd2e712){_0x2beb93=_0x2beb93-0x0;var _0xc45b75=_0xb431[_0x2beb93];return _0xc45b75;};'use strict';var _=require(_0x1b43('0x0'));var util=require(_0x1b43('0x1'));var logger=require(_0x1b43('0x2'))(_0x1b43('0x3'));var moment=require(_0x1b43('0x4'));var BPromise=require(_0x1b43('0x5'));var rp=require(_0x1b43('0x6'));var fs=require('fs');var path=require(_0x1b43('0x7'));var rimraf=require(_0x1b43('0x8'));var config=require(_0x1b43('0x9'));var attributes=require('./openchannelQueue.attributes');module[_0x1b43('0xa')]=function(_0x4268a3,_0x242a8a){return _0x4268a3[_0x1b43('0xb')](_0x1b43('0xc'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f45=['./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x6c3a33,_0x5472be){var _0xe545f2=function(_0x30f71b){while(--_0x30f71b){_0x6c3a33['push'](_0x6c3a33['shift']());}};_0xe545f2(++_0x5472be);}(_0x1f45,0x17f));var _0x51f4=function(_0x12c03d,_0x367830){_0x12c03d=_0x12c03d-0x0;var _0x37eaa3=_0x1f45[_0x12c03d];return _0x37eaa3;};'use strict';var _=require(_0x51f4('0x0'));var util=require(_0x51f4('0x1'));var logger=require(_0x51f4('0x2'))(_0x51f4('0x3'));var moment=require(_0x51f4('0x4'));var BPromise=require(_0x51f4('0x5'));var rp=require(_0x51f4('0x6'));var fs=require('fs');var path=require(_0x51f4('0x7'));var rimraf=require('rimraf');var config=require(_0x51f4('0x8'));var attributes=require(_0x51f4('0x9'));module[_0x51f4('0xa')]=function(_0x7d5ece,_0x171d19){return _0x7d5ece[_0x51f4('0xb')](_0x51f4('0xc'),attributes,{'tableName':_0x51f4('0xd'),'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 3cf3bf6..a6c0caf 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 _0xc282=['request\x20sent','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','map','include','model','then','ShowOpenchannelQueue','find','debug','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x55d58f,_0x2bea83){var _0x1ad6e6=function(_0x31447e){while(--_0x31447e){_0x55d58f['push'](_0x55d58f['shift']());}};_0x1ad6e6(++_0x2bea83);}(_0xc282,0x18d));var _0x2c28=function(_0xbc5e4,_0x54799d){_0xbc5e4=_0xbc5e4-0x0;var _0x3c5430=_0xc282[_0xbc5e4];return _0x3c5430;};'use strict';var _=require(_0x2c28('0x0'));var util=require('util');var moment=require(_0x2c28('0x1'));var BPromise=require(_0x2c28('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2c28('0x3'));var logger=require(_0x2c28('0x4'))(_0x2c28('0x5'));var config=require('../../config/environment');var jayson=require(_0x2c28('0x6'));var client=jayson[_0x2c28('0x7')][_0x2c28('0x8')]({'port':0x232a});config[_0x2c28('0x9')]=_['defaults'](config['redis'],{'host':_0x2c28('0xa'),'port':0x18eb});var socket=require(_0x2c28('0xb'))(new Redis(config[_0x2c28('0x9')]));require(_0x2c28('0xc'))[_0x2c28('0xd')](socket);function respondWithRpcPromise(_0x1a31e6,_0x4de46b,_0x3113fb){return new BPromise(function(_0x1aa01e,_0x233e43){return client[_0x2c28('0xe')](_0x1a31e6,_0x3113fb)['then'](function(_0x5715f2){logger[_0x2c28('0xf')](_0x2c28('0x10'),_0x4de46b,'request\x20sent');logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x4de46b,'request\x20sent',JSON[_0x2c28('0x11')](_0x5715f2));if(_0x5715f2[_0x2c28('0x12')]){if(_0x5715f2[_0x2c28('0x12')][_0x2c28('0x13')]===0x1f4){logger[_0x2c28('0x12')](_0x2c28('0x10'),_0x4de46b,_0x5715f2[_0x2c28('0x12')][_0x2c28('0x14')]);return _0x233e43(_0x5715f2[_0x2c28('0x12')][_0x2c28('0x14')]);}logger['error'](_0x2c28('0x10'),_0x4de46b,_0x5715f2[_0x2c28('0x12')][_0x2c28('0x14')]);return _0x1aa01e(_0x5715f2[_0x2c28('0x12')]['message']);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x4de46b,_0x2c28('0x15'));_0x1aa01e(_0x5715f2[_0x2c28('0x16')][_0x2c28('0x14')]);}})[_0x2c28('0x17')](function(_0x3abe2){logger[_0x2c28('0x12')](_0x2c28('0x10'),_0x4de46b,_0x3abe2);_0x233e43(_0x3abe2);});});}exports[_0x2c28('0x18')]=function(_0x2eb4bf){var _0x36dc17=this;return new Promise(function(_0x3ead5b,_0x364743){return db[_0x2c28('0x19')][_0x2c28('0x1a')]({'raw':_0x2eb4bf['options']?_0x2eb4bf[_0x2c28('0x1b')][_0x2c28('0x1c')]===undefined?!![]:![]:!![],'where':_0x2eb4bf[_0x2c28('0x1b')]?_0x2eb4bf[_0x2c28('0x1b')][_0x2c28('0x1d')]||null:null,'attributes':_0x2eb4bf[_0x2c28('0x1b')]?_0x2eb4bf[_0x2c28('0x1b')][_0x2c28('0x1e')]||null:null,'limit':_0x2eb4bf[_0x2c28('0x1b')]?_0x2eb4bf['options']['limit']||null:null,'include':_0x2eb4bf['options']?_0x2eb4bf[_0x2c28('0x1b')]['include']?_[_0x2c28('0x1f')](_0x2eb4bf[_0x2c28('0x1b')][_0x2c28('0x20')],function(_0x32b0b9){return{'model':db[_0x32b0b9['model']],'as':_0x32b0b9['as'],'attributes':_0x32b0b9[_0x2c28('0x1e')],'include':_0x32b0b9[_0x2c28('0x20')]?_['map'](_0x32b0b9['include'],function(_0x30cae7){return{'model':db[_0x30cae7['model']],'as':_0x30cae7['as'],'attributes':_0x30cae7[_0x2c28('0x1e')],'include':_0x30cae7[_0x2c28('0x20')]?_[_0x2c28('0x1f')](_0x30cae7[_0x2c28('0x20')],function(_0x30b545){return{'model':db[_0x30b545[_0x2c28('0x21')]],'as':_0x30b545['as'],'attributes':_0x30b545[_0x2c28('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2c28('0x22')](function(_0x52ec67){logger[_0x2c28('0xf')](_0x2c28('0x18'),_0x2eb4bf);logger['debug']('GetOpenchannelQueue',_0x2eb4bf,JSON[_0x2c28('0x11')](_0x52ec67));_0x3ead5b(_0x52ec67);})[_0x2c28('0x17')](function(_0x34abf9){logger[_0x2c28('0x12')](_0x2c28('0x18'),_0x34abf9[_0x2c28('0x14')],_0x2eb4bf);_0x364743(_0x36dc17[_0x2c28('0x12')](0x1f4,_0x34abf9[_0x2c28('0x14')]));});});};exports[_0x2c28('0x23')]=function(_0x3a4a96){var _0x483d0a=this;return new Promise(function(_0x26c891,_0x59008d){return db[_0x2c28('0x19')][_0x2c28('0x24')]({'raw':_0x3a4a96['options']?_0x3a4a96[_0x2c28('0x1b')][_0x2c28('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a4a96[_0x2c28('0x1b')]?_0x3a4a96[_0x2c28('0x1b')][_0x2c28('0x1d')]||null:null,'attributes':_0x3a4a96['options']?_0x3a4a96[_0x2c28('0x1b')][_0x2c28('0x1e')]||null:null,'include':_0x3a4a96[_0x2c28('0x1b')]?_0x3a4a96[_0x2c28('0x1b')][_0x2c28('0x20')]?_[_0x2c28('0x1f')](_0x3a4a96[_0x2c28('0x1b')][_0x2c28('0x20')],function(_0x578a1f){return{'model':db[_0x578a1f[_0x2c28('0x21')]],'as':_0x578a1f['as'],'attributes':_0x578a1f['attributes'],'include':_0x578a1f['include']?_[_0x2c28('0x1f')](_0x578a1f[_0x2c28('0x20')],function(_0x580cf5){return{'model':db[_0x580cf5['model']],'as':_0x580cf5['as'],'attributes':_0x580cf5[_0x2c28('0x1e')],'include':_0x580cf5['include']?_[_0x2c28('0x1f')](_0x580cf5['include'],function(_0x2a1ece){return{'model':db[_0x2a1ece[_0x2c28('0x21')]],'as':_0x2a1ece['as'],'attributes':_0x2a1ece[_0x2c28('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2c28('0x22')](function(_0x5cf25f){logger[_0x2c28('0xf')](_0x2c28('0x23'),_0x3a4a96);logger[_0x2c28('0x25')](_0x2c28('0x23'),_0x3a4a96,JSON[_0x2c28('0x11')](_0x5cf25f));_0x26c891(_0x5cf25f);})[_0x2c28('0x17')](function(_0x501dad){logger[_0x2c28('0x12')](_0x2c28('0x23'),_0x501dad[_0x2c28('0x14')],_0x3a4a96);_0x59008d(_0x483d0a['error'](0x1f4,_0x501dad[_0x2c28('0x14')]));});});}; \ No newline at end of file +var _0x2668=['http','redis','defaults','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetOpenchannelQueue','options','raw','attributes','include','map','model','debug','ShowOpenchannelQueue','OpenchannelQueue','find','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x346e17,_0x18997c){var _0x20259a=function(_0x5905b7){while(--_0x5905b7){_0x346e17['push'](_0x346e17['shift']());}};_0x20259a(++_0x18997c);}(_0x2668,0xd5));var _0x8266=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x2668[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x8266('0x0'));var util=require(_0x8266('0x1'));var moment=require(_0x8266('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8266('0x3'));var logger=require(_0x8266('0x4'))(_0x8266('0x5'));var config=require(_0x8266('0x6'));var jayson=require(_0x8266('0x7'));var client=jayson[_0x8266('0x8')][_0x8266('0x9')]({'port':0x232a});config[_0x8266('0xa')]=_[_0x8266('0xb')](config[_0x8266('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8266('0xa')]));require(_0x8266('0xc'))[_0x8266('0xd')](socket);function respondWithRpcPromise(_0x2c40dd,_0x239e71,_0x35984f){return new BPromise(function(_0xbca51b,_0xa7ad9f){return client[_0x8266('0xe')](_0x2c40dd,_0x35984f)[_0x8266('0xf')](function(_0x52a6fa){logger[_0x8266('0x10')](_0x8266('0x11'),_0x239e71,'request\x20sent');logger['debug'](_0x8266('0x12'),_0x239e71,_0x8266('0x13'),JSON[_0x8266('0x14')](_0x52a6fa));if(_0x52a6fa[_0x8266('0x15')]){if(_0x52a6fa[_0x8266('0x15')][_0x8266('0x16')]===0x1f4){logger[_0x8266('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x239e71,_0x52a6fa[_0x8266('0x15')][_0x8266('0x17')]);return _0xa7ad9f(_0x52a6fa['error'][_0x8266('0x17')]);}logger['error'](_0x8266('0x11'),_0x239e71,_0x52a6fa[_0x8266('0x15')]['message']);return _0xbca51b(_0x52a6fa[_0x8266('0x15')][_0x8266('0x17')]);}else{logger[_0x8266('0x10')](_0x8266('0x11'),_0x239e71,_0x8266('0x13'));_0xbca51b(_0x52a6fa[_0x8266('0x18')][_0x8266('0x17')]);}})[_0x8266('0x19')](function(_0x2ee0a7){logger[_0x8266('0x15')](_0x8266('0x11'),_0x239e71,_0x2ee0a7);_0xa7ad9f(_0x2ee0a7);});});}exports[_0x8266('0x1a')]=function(_0x4239cc){var _0x29d775=this;return new Promise(function(_0x9f163c,_0x5c7b09){return db['OpenchannelQueue']['findAll']({'raw':_0x4239cc[_0x8266('0x1b')]?_0x4239cc['options'][_0x8266('0x1c')]===undefined?!![]:![]:!![],'where':_0x4239cc[_0x8266('0x1b')]?_0x4239cc[_0x8266('0x1b')]['where']||null:null,'attributes':_0x4239cc[_0x8266('0x1b')]?_0x4239cc['options'][_0x8266('0x1d')]||null:null,'limit':_0x4239cc[_0x8266('0x1b')]?_0x4239cc[_0x8266('0x1b')]['limit']||null:null,'include':_0x4239cc[_0x8266('0x1b')]?_0x4239cc['options'][_0x8266('0x1e')]?_[_0x8266('0x1f')](_0x4239cc['options'][_0x8266('0x1e')],function(_0x64c843){return{'model':db[_0x64c843['model']],'as':_0x64c843['as'],'attributes':_0x64c843['attributes'],'include':_0x64c843[_0x8266('0x1e')]?_[_0x8266('0x1f')](_0x64c843[_0x8266('0x1e')],function(_0x19cc7d){return{'model':db[_0x19cc7d[_0x8266('0x20')]],'as':_0x19cc7d['as'],'attributes':_0x19cc7d[_0x8266('0x1d')],'include':_0x19cc7d[_0x8266('0x1e')]?_[_0x8266('0x1f')](_0x19cc7d['include'],function(_0x1f33c4){return{'model':db[_0x1f33c4[_0x8266('0x20')]],'as':_0x1f33c4['as'],'attributes':_0x1f33c4[_0x8266('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8266('0xf')](function(_0x581560){logger[_0x8266('0x10')](_0x8266('0x1a'),_0x4239cc);logger[_0x8266('0x21')](_0x8266('0x1a'),_0x4239cc,JSON['stringify'](_0x581560));_0x9f163c(_0x581560);})[_0x8266('0x19')](function(_0x187879){logger[_0x8266('0x15')](_0x8266('0x1a'),_0x187879[_0x8266('0x17')],_0x4239cc);_0x5c7b09(_0x29d775[_0x8266('0x15')](0x1f4,_0x187879[_0x8266('0x17')]));});});};exports[_0x8266('0x22')]=function(_0x1a9fdf){var _0x504779=this;return new Promise(function(_0x3b7a73,_0x5f0409){return db[_0x8266('0x23')][_0x8266('0x24')]({'raw':_0x1a9fdf[_0x8266('0x1b')]?_0x1a9fdf[_0x8266('0x1b')][_0x8266('0x1c')]===undefined?!![]:![]:!![],'where':_0x1a9fdf[_0x8266('0x1b')]?_0x1a9fdf['options']['where']||null:null,'attributes':_0x1a9fdf[_0x8266('0x1b')]?_0x1a9fdf[_0x8266('0x1b')][_0x8266('0x1d')]||null:null,'include':_0x1a9fdf[_0x8266('0x1b')]?_0x1a9fdf[_0x8266('0x1b')][_0x8266('0x1e')]?_[_0x8266('0x1f')](_0x1a9fdf[_0x8266('0x1b')][_0x8266('0x1e')],function(_0x1a6206){return{'model':db[_0x1a6206[_0x8266('0x20')]],'as':_0x1a6206['as'],'attributes':_0x1a6206['attributes'],'include':_0x1a6206[_0x8266('0x1e')]?_[_0x8266('0x1f')](_0x1a6206[_0x8266('0x1e')],function(_0xf4ee7e){return{'model':db[_0xf4ee7e['model']],'as':_0xf4ee7e['as'],'attributes':_0xf4ee7e[_0x8266('0x1d')],'include':_0xf4ee7e[_0x8266('0x1e')]?_[_0x8266('0x1f')](_0xf4ee7e[_0x8266('0x1e')],function(_0x3cd517){return{'model':db[_0x3cd517[_0x8266('0x20')]],'as':_0x3cd517['as'],'attributes':_0x3cd517[_0x8266('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8266('0xf')](function(_0x32a942){logger[_0x8266('0x10')]('ShowOpenchannelQueue',_0x1a9fdf);logger['debug'](_0x8266('0x22'),_0x1a9fdf,JSON[_0x8266('0x14')](_0x32a942));_0x3b7a73(_0x32a942);})[_0x8266('0x19')](function(_0x1a8535){logger[_0x8266('0x15')]('ShowOpenchannelQueue',_0x1a8535[_0x8266('0x17')],_0x1a9fdf);_0x5f0409(_0x504779[_0x8266('0x15')](0x1f4,_0x1a8535['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index b5a228d..59e0c80 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 _0x5562=['length','openchannelQueue:','save','remove','update','emit'];(function(_0x566a2f,_0x405c7b){var _0x186c75=function(_0x3293b9){while(--_0x3293b9){_0x566a2f['push'](_0x566a2f['shift']());}};_0x186c75(++_0x405c7b);}(_0x5562,0x86));var _0x2556=function(_0x31c3be,_0x5e540f){_0x31c3be=_0x31c3be-0x0;var _0x48314d=_0x5562[_0x31c3be];return _0x48314d;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x2556('0x0'),_0x2556('0x1'),_0x2556('0x2')];function createListener(_0x1194ec,_0xa9f97f){return function(_0x128703){_0xa9f97f[_0x2556('0x3')](_0x1194ec,_0x128703);};}function removeListener(_0xf010ae,_0x4e1848){return function(){OpenchannelQueueEvents['removeListener'](_0xf010ae,_0x4e1848);};}exports['register']=function(_0x37b9fc){for(var _0x52899d=0x0,_0x2adab8=events[_0x2556('0x4')];_0x52899d<_0x2adab8;_0x52899d++){var _0x367016=events[_0x52899d];var _0x1ed5a7=createListener(_0x2556('0x5')+_0x367016,_0x37b9fc);OpenchannelQueueEvents['on'](_0x367016,_0x1ed5a7);}}; \ No newline at end of file +var _0xf4e9=['emit','register','length','openchannelQueue:','save','remove','update'];(function(_0x120bc0,_0x40e780){var _0x49d52a=function(_0x41c990){while(--_0x41c990){_0x120bc0['push'](_0x120bc0['shift']());}};_0x49d52a(++_0x40e780);}(_0xf4e9,0x1a1));var _0x9f4e=function(_0x52ac12,_0x396ebd){_0x52ac12=_0x52ac12-0x0;var _0x5957b4=_0xf4e9[_0x52ac12];return _0x5957b4;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x9f4e('0x0'),_0x9f4e('0x1'),_0x9f4e('0x2')];function createListener(_0x35e63d,_0x1dd193){return function(_0x5a3bd1){_0x1dd193[_0x9f4e('0x3')](_0x35e63d,_0x5a3bd1);};}function removeListener(_0x31ddc2,_0x2d6987){return function(){OpenchannelQueueEvents['removeListener'](_0x31ddc2,_0x2d6987);};}exports[_0x9f4e('0x4')]=function(_0x3dddc6){for(var _0x35bd56=0x0,_0x4bca86=events[_0x9f4e('0x5')];_0x35bd56<_0x4bca86;_0x35bd56++){var _0x2031f5=events[_0x35bd56];var _0x4d18dc=createListener(_0x9f4e('0x6')+_0x2031f5,_0x3dddc6);OpenchannelQueueEvents['on'](_0x2031f5,_0x4d18dc);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 783e330..79e480f 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 _0x413d=['get','isAuthenticated','/describe','describe','show','post','/:id','update','delete','destroy','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller'];(function(_0x579132,_0x41cfc5){var _0x1e7a47=function(_0x21d5d1){while(--_0x21d5d1){_0x579132['push'](_0x579132['shift']());}};_0x1e7a47(++_0x41cfc5);}(_0x413d,0x6a));var _0xd413=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x413d[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require(_0xd413('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd413('0x1'));var router=express['Router']();var fs_extra=require(_0xd413('0x2'));var auth=require(_0xd413('0x3'));var interaction=require(_0xd413('0x4'));var config=require('../../config/environment');var controller=require(_0xd413('0x5'));router[_0xd413('0x6')]('/',auth[_0xd413('0x7')](),controller['index']);router[_0xd413('0x6')](_0xd413('0x8'),auth['isAuthenticated'](),controller[_0xd413('0x9')]);router[_0xd413('0x6')]('/:id',auth[_0xd413('0x7')](),controller[_0xd413('0xa')]);router[_0xd413('0xb')]('/',auth[_0xd413('0x7')](),controller['create']);router['put'](_0xd413('0xc'),auth[_0xd413('0x7')](),controller[_0xd413('0xd')]);router[_0xd413('0xe')]('/:id',auth[_0xd413('0x7')](),controller[_0xd413('0xf')]);module['exports']=router; \ No newline at end of file +var _0xae30=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','describe','isAuthenticated','show','create','/:id','delete'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xae30,0xbc));var _0x0ae3=function(_0x1a6659,_0xcc8b76){_0x1a6659=_0x1a6659-0x0;var _0x53aeb8=_0xae30[_0x1a6659];return _0x53aeb8;};'use strict';var multer=require('multer');var util=require(_0x0ae3('0x0'));var path=require(_0x0ae3('0x1'));var timeout=require(_0x0ae3('0x2'));var express=require(_0x0ae3('0x3'));var router=express[_0x0ae3('0x4')]();var fs_extra=require(_0x0ae3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0ae3('0x6'));var config=require(_0x0ae3('0x7'));var controller=require('./openchannelQueueReport.controller');router[_0x0ae3('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0ae3('0x8')](_0x0ae3('0x9'),auth['isAuthenticated'](),controller[_0x0ae3('0xa')]);router[_0x0ae3('0x8')]('/:id',auth[_0x0ae3('0xb')](),controller[_0x0ae3('0xc')]);router['post']('/',auth[_0x0ae3('0xb')](),controller[_0x0ae3('0xd')]);router['put'](_0x0ae3('0xe'),auth[_0x0ae3('0xb')](),controller['update']);router[_0x0ae3('0xf')](_0x0ae3('0xe'),auth[_0x0ae3('0xb')](),controller['destroy']);module[_0x0ae3('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 1a650f9..0f90200 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 _0x781c=['DATE','sequelize','exports','STRING'];(function(_0xae41d6,_0x762fc9){var _0x34848f=function(_0x4c67e3){while(--_0x4c67e3){_0xae41d6['push'](_0xae41d6['shift']());}};_0x34848f(++_0x762fc9);}(_0x781c,0x105));var _0xc781=function(_0x4b4ab8,_0x193fa1){_0x4b4ab8=_0x4b4ab8-0x0;var _0x437c00=_0x781c[_0x4b4ab8];return _0x437c00;};'use strict';var moment=require('moment');var Sequelize=require(_0xc781('0x0'));module[_0xc781('0x1')]={'uniqueid':{'type':Sequelize[_0xc781('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc781('0x2')]},'joinAt':{'type':Sequelize[_0xc781('0x3')]},'leaveAt':{'type':Sequelize[_0xc781('0x3')]},'acceptAt':{'type':Sequelize[_0xc781('0x3')]},'exitAt':{'type':Sequelize[_0xc781('0x3')]},'reason':{'type':Sequelize[_0xc781('0x2')]}}; \ No newline at end of file +var _0xe66d=['sequelize','STRING','DATE','moment'];(function(_0x1a3d04,_0x266c48){var _0x4824a2=function(_0x172e6e){while(--_0x172e6e){_0x1a3d04['push'](_0x1a3d04['shift']());}};_0x4824a2(++_0x266c48);}(_0xe66d,0xfb));var _0xde66=function(_0x6171c0,_0x127af3){_0x6171c0=_0x6171c0-0x0;var _0x227390=_0xe66d[_0x6171c0];return _0x227390;};'use strict';var moment=require(_0xde66('0x0'));var Sequelize=require(_0xde66('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xde66('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xde66('0x2')]},'joinAt':{'type':Sequelize[_0xde66('0x3')]},'leaveAt':{'type':Sequelize[_0xde66('0x3')]},'acceptAt':{'type':Sequelize[_0xde66('0x3')]},'exitAt':{'type':Sequelize[_0xde66('0x3')]},'reason':{'type':Sequelize[_0xde66('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index c466c47..ddca28d 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 _0xf049=['../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','OpenchannelQueueReport','includeAll','include','rows','catch','show','params','keys','options','body','find','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3b587d,_0x2f6795){var _0x3ebecf=function(_0xe70e30){while(--_0xe70e30){_0x3b587d['push'](_0x3b587d['shift']());}};_0x3ebecf(++_0x2f6795);}(_0xf049,0x1a2));var _0x9f04=function(_0x33edd6,_0x42e069){_0x33edd6=_0x33edd6-0x0;var _0x44da70=_0xf049[_0x33edd6];return _0x44da70;};'use strict';var emlformat=require(_0x9f04('0x0'));var rimraf=require(_0x9f04('0x1'));var zipdir=require(_0x9f04('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9f04('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9f04('0x4'));var util=require(_0x9f04('0x5'));var path=require(_0x9f04('0x6'));var sox=require('sox');var csv=require(_0x9f04('0x7'));var ejs=require(_0x9f04('0x8'));var fs=require('fs');var fs_extra=require(_0x9f04('0x9'));var _=require(_0x9f04('0xa'));var squel=require('squel');var crypto=require(_0x9f04('0xb'));var jsforce=require(_0x9f04('0xc'));var deskjs=require(_0x9f04('0xd'));var toCsv=require(_0x9f04('0x7'));var querystring=require(_0x9f04('0xe'));var Papa=require(_0x9f04('0xf'));var Redis=require(_0x9f04('0x10'));var authService=require(_0x9f04('0x11'));var qs=require(_0x9f04('0x12'));var as=require(_0x9f04('0x13'));var hardwareService=require(_0x9f04('0x14'));var logger=require(_0x9f04('0x15'))(_0x9f04('0x16'));var utils=require('../../config/utils');var config=require(_0x9f04('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27d580,_0xf52424){_0xf52424=_0xf52424||0xcc;return function(_0x4e302b){if(_0x4e302b){return _0x27d580[_0x9f04('0x18')](_0xf52424);}return _0x27d580[_0x9f04('0x19')](_0xf52424)[_0x9f04('0x1a')]();};}function respondWithResult(_0x2d5a3c,_0x1d49bd){_0x1d49bd=_0x1d49bd||0xc8;return function(_0x274b31){if(_0x274b31){return _0x2d5a3c[_0x9f04('0x19')](_0x1d49bd)['json'](_0x274b31);}};}function respondWithFilteredResult(_0x2f03e5,_0x1e0530){return function(_0x25c6e1){if(_0x25c6e1){var _0x174c88=typeof _0x1e0530[_0x9f04('0x1b')]===_0x9f04('0x1c')&&typeof _0x1e0530[_0x9f04('0x1d')]===_0x9f04('0x1c');var _0xc2622f=_0x25c6e1[_0x9f04('0x1e')];var _0x33fcee=_0x174c88?0x0:_0x1e0530['offset'];var _0x2f473c=_0x174c88?_0x25c6e1[_0x9f04('0x1e')]:_0x1e0530[_0x9f04('0x1b')]+_0x1e0530['limit'];var _0x4ce9fa;if(_0x2f473c>=_0xc2622f){_0x2f473c=_0xc2622f;_0x4ce9fa=0xc8;}else{_0x4ce9fa=0xce;}_0x2f03e5[_0x9f04('0x19')](_0x4ce9fa);return _0x2f03e5[_0x9f04('0x1f')]('Content-Range',_0x33fcee+'-'+_0x2f473c+'/'+_0xc2622f)[_0x9f04('0x20')](_0x25c6e1);}return null;};}function patchUpdates(_0x2eda38){return function(_0x17e2e9){try{jsonpatch['apply'](_0x17e2e9,_0x2eda38,!![]);}catch(_0x55c207){return BPromise[_0x9f04('0x21')](_0x55c207);}return _0x17e2e9[_0x9f04('0x22')]();};}function saveUpdates(_0x4b425c,_0x29dff5){return function(_0x2e7fa9){if(_0x2e7fa9){return _0x2e7fa9[_0x9f04('0x23')](_0x4b425c)[_0x9f04('0x24')](function(_0x5613b8){return _0x5613b8;});}return null;};}function removeEntity(_0x2db589,_0x1872e4){return function(_0x1f7ecd){if(_0x1f7ecd){return _0x1f7ecd[_0x9f04('0x25')]()[_0x9f04('0x24')](function(){_0x2db589['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bdc4e,_0x152b23){return function(_0xe533b3){if(!_0xe533b3){_0x4bdc4e[_0x9f04('0x18')](0x194);}return _0xe533b3;};}function handleError(_0x1c4a6f,_0x24da4e){_0x24da4e=_0x24da4e||0x1f4;return function(_0x40b65e){logger[_0x9f04('0x26')](_0x40b65e['stack']);if(_0x40b65e['name']){delete _0x40b65e[_0x9f04('0x27')];}_0x1c4a6f[_0x9f04('0x19')](_0x24da4e)[_0x9f04('0x28')](_0x40b65e);};}exports[_0x9f04('0x29')]=function(_0x195b37,_0x3fd04b){var _0x135d3a={},_0x3ae358={},_0x42981d={'count':0x0,'rows':[]};var _0x2bb93d=_['map'](db['OpenchannelQueueReport'][_0x9f04('0x2a')],function(_0x291740){return{'name':_0x291740[_0x9f04('0x2b')],'type':_0x291740[_0x9f04('0x2c')]['key']};});_0x3ae358[_0x9f04('0x2d')]=_['map'](_0x2bb93d,'name');_0x3ae358['query']=_['keys'](_0x195b37[_0x9f04('0x2e')]);_0x3ae358['filters']=_[_0x9f04('0x2f')](_0x3ae358['model'],_0x3ae358[_0x9f04('0x2e')]);_0x135d3a[_0x9f04('0x30')]=_[_0x9f04('0x2f')](_0x3ae358[_0x9f04('0x2d')],qs[_0x9f04('0x31')](_0x195b37[_0x9f04('0x2e')]['fields']));_0x135d3a[_0x9f04('0x30')]=_0x135d3a['attributes'][_0x9f04('0x32')]?_0x135d3a[_0x9f04('0x30')]:_0x3ae358[_0x9f04('0x2d')];if(!_0x195b37[_0x9f04('0x2e')][_0x9f04('0x33')](_0x9f04('0x34'))){_0x135d3a[_0x9f04('0x1d')]=qs[_0x9f04('0x1d')](_0x195b37[_0x9f04('0x2e')]['limit']);_0x135d3a[_0x9f04('0x1b')]=qs[_0x9f04('0x1b')](_0x195b37['query'][_0x9f04('0x1b')]);}_0x135d3a[_0x9f04('0x35')]=qs[_0x9f04('0x36')](_0x195b37[_0x9f04('0x2e')][_0x9f04('0x36')]);_0x135d3a[_0x9f04('0x37')]=qs[_0x9f04('0x38')](_['pick'](_0x195b37['query'],_0x3ae358[_0x9f04('0x38')]),_0x2bb93d);if(_0x195b37[_0x9f04('0x2e')][_0x9f04('0x39')]){_0x135d3a[_0x9f04('0x37')]=_[_0x9f04('0x3a')](_0x135d3a[_0x9f04('0x37')],{'$or':_[_0x9f04('0x3b')](_0x2bb93d,function(_0x3135d2){if(_0x3135d2[_0x9f04('0x2c')]!==_0x9f04('0x3c')){var _0x466662={};_0x466662[_0x3135d2['name']]={'$like':'%'+_0x195b37[_0x9f04('0x2e')][_0x9f04('0x39')]+'%'};return _0x466662;}})});}_0x135d3a=_['merge']({},_0x135d3a,_0x195b37['options']);var _0x5380c9={'where':_0x135d3a['where']};return db[_0x9f04('0x3d')][_0x9f04('0x1e')](_0x5380c9)[_0x9f04('0x24')](function(_0x377d6c){_0x42981d[_0x9f04('0x1e')]=_0x377d6c;if(_0x195b37[_0x9f04('0x2e')][_0x9f04('0x3e')]){_0x135d3a[_0x9f04('0x3f')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x135d3a);})[_0x9f04('0x24')](function(_0x1b3160){_0x42981d[_0x9f04('0x40')]=_0x1b3160;return _0x42981d;})[_0x9f04('0x24')](respondWithFilteredResult(_0x3fd04b,_0x135d3a))[_0x9f04('0x41')](handleError(_0x3fd04b,null));};exports[_0x9f04('0x42')]=function(_0x19cb7e,_0x1e0d19){var _0x28693b={'raw':!![],'where':{'id':_0x19cb7e[_0x9f04('0x43')]['id']}},_0x53dbfc={};_0x53dbfc[_0x9f04('0x2d')]=_[_0x9f04('0x44')](db[_0x9f04('0x3d')]['rawAttributes']);_0x53dbfc[_0x9f04('0x2e')]=_[_0x9f04('0x44')](_0x19cb7e[_0x9f04('0x2e')]);_0x53dbfc['filters']=_[_0x9f04('0x2f')](_0x53dbfc[_0x9f04('0x2d')],_0x53dbfc[_0x9f04('0x2e')]);_0x28693b[_0x9f04('0x30')]=_[_0x9f04('0x2f')](_0x53dbfc['model'],qs[_0x9f04('0x31')](_0x19cb7e['query'][_0x9f04('0x31')]));_0x28693b[_0x9f04('0x30')]=_0x28693b['attributes'][_0x9f04('0x32')]?_0x28693b[_0x9f04('0x30')]:_0x53dbfc[_0x9f04('0x2d')];if(_0x19cb7e[_0x9f04('0x2e')]['includeAll']){_0x28693b[_0x9f04('0x3f')]=[{'all':!![]}];}_0x28693b=_[_0x9f04('0x3a')]({},_0x28693b,_0x19cb7e[_0x9f04('0x45')]);return db['OpenchannelQueueReport']['find'](_0x28693b)[_0x9f04('0x24')](handleEntityNotFound(_0x1e0d19,null))[_0x9f04('0x24')](respondWithResult(_0x1e0d19,null))[_0x9f04('0x41')](handleError(_0x1e0d19,null));};exports['create']=function(_0x2ddd4b,_0x3c7087){return db[_0x9f04('0x3d')]['create'](_0x2ddd4b[_0x9f04('0x46')],{})[_0x9f04('0x24')](respondWithResult(_0x3c7087,0xc9))[_0x9f04('0x41')](handleError(_0x3c7087,null));};exports[_0x9f04('0x23')]=function(_0x530e04,_0x147ce6){if(_0x530e04[_0x9f04('0x46')]['id']){delete _0x530e04['body']['id'];}return db[_0x9f04('0x3d')][_0x9f04('0x47')]({'where':{'id':_0x530e04[_0x9f04('0x43')]['id']}})[_0x9f04('0x24')](handleEntityNotFound(_0x147ce6,null))[_0x9f04('0x24')](saveUpdates(_0x530e04[_0x9f04('0x46')],null))[_0x9f04('0x24')](respondWithResult(_0x147ce6,null))[_0x9f04('0x41')](handleError(_0x147ce6,null));};exports[_0x9f04('0x25')]=function(_0x4982fd,_0x3e742f){return db[_0x9f04('0x3d')]['find']({'where':{'id':_0x4982fd[_0x9f04('0x43')]['id']}})[_0x9f04('0x24')](handleEntityNotFound(_0x3e742f,null))[_0x9f04('0x24')](removeEntity(_0x3e742f,null))[_0x9f04('0x41')](handleError(_0x3e742f,null));};exports[_0x9f04('0x48')]=function(_0xcccf0b,_0x31b80f){return db[_0x9f04('0x3d')][_0x9f04('0x48')]()['then'](respondWithResult(_0x31b80f,null))[_0x9f04('0x41')](handleError(_0x31b80f,null));}; \ No newline at end of file +var _0x45a1=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','rows','catch','params','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x45a1,0x8d));var _0x145a=function(_0x560f2f,_0x307f4a){_0x560f2f=_0x560f2f-0x0;var _0x180b0d=_0x45a1[_0x560f2f];return _0x180b0d;};'use strict';var emlformat=require(_0x145a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x145a('0x1'));var jsonpatch=require(_0x145a('0x2'));var rp=require(_0x145a('0x3'));var moment=require(_0x145a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x145a('0x5'));var util=require('util');var path=require('path');var sox=require(_0x145a('0x6'));var csv=require(_0x145a('0x7'));var ejs=require(_0x145a('0x8'));var fs=require('fs');var fs_extra=require(_0x145a('0x9'));var _=require(_0x145a('0xa'));var squel=require(_0x145a('0xb'));var crypto=require('crypto');var jsforce=require(_0x145a('0xc'));var deskjs=require(_0x145a('0xd'));var toCsv=require(_0x145a('0x7'));var querystring=require(_0x145a('0xe'));var Papa=require(_0x145a('0xf'));var Redis=require(_0x145a('0x10'));var authService=require(_0x145a('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x145a('0x12'))(_0x145a('0x13'));var utils=require(_0x145a('0x14'));var config=require(_0x145a('0x15'));var licenseUtil=require(_0x145a('0x16'));var db=require(_0x145a('0x17'))['db'];function respondWithStatusCode(_0x2f7a1a,_0xf51bbc){_0xf51bbc=_0xf51bbc||0xcc;return function(_0x1e6eb9){if(_0x1e6eb9){return _0x2f7a1a[_0x145a('0x18')](_0xf51bbc);}return _0x2f7a1a[_0x145a('0x19')](_0xf51bbc)[_0x145a('0x1a')]();};}function respondWithResult(_0x5177ba,_0x36401a){_0x36401a=_0x36401a||0xc8;return function(_0x56ad78){if(_0x56ad78){return _0x5177ba[_0x145a('0x19')](_0x36401a)[_0x145a('0x1b')](_0x56ad78);}};}function respondWithFilteredResult(_0x17e8b2,_0x4072c6){return function(_0x11ba22){if(_0x11ba22){var _0x5991eb=typeof _0x4072c6['offset']===_0x145a('0x1c')&&typeof _0x4072c6['limit']==='undefined';var _0x542447=_0x11ba22[_0x145a('0x1d')];var _0x1e3d29=_0x5991eb?0x0:_0x4072c6[_0x145a('0x1e')];var _0x5ce60d=_0x5991eb?_0x11ba22['count']:_0x4072c6['offset']+_0x4072c6[_0x145a('0x1f')];var _0x1f1d54;if(_0x5ce60d>=_0x542447){_0x5ce60d=_0x542447;_0x1f1d54=0xc8;}else{_0x1f1d54=0xce;}_0x17e8b2[_0x145a('0x19')](_0x1f1d54);return _0x17e8b2[_0x145a('0x20')]('Content-Range',_0x1e3d29+'-'+_0x5ce60d+'/'+_0x542447)['json'](_0x11ba22);}return null;};}function patchUpdates(_0x3d16bc){return function(_0x1c29e6){try{jsonpatch[_0x145a('0x21')](_0x1c29e6,_0x3d16bc,!![]);}catch(_0x47e714){return BPromise[_0x145a('0x22')](_0x47e714);}return _0x1c29e6['save']();};}function saveUpdates(_0x195810,_0x335c15){return function(_0x3b3128){if(_0x3b3128){return _0x3b3128[_0x145a('0x23')](_0x195810)[_0x145a('0x24')](function(_0xb31892){return _0xb31892;});}return null;};}function removeEntity(_0x333953,_0x55a1f4){return function(_0x26be44){if(_0x26be44){return _0x26be44[_0x145a('0x25')]()[_0x145a('0x24')](function(){_0x333953['status'](0xcc)[_0x145a('0x1a')]();});}};}function handleEntityNotFound(_0x1ae3b8,_0x4d330e){return function(_0x12da8c){if(!_0x12da8c){_0x1ae3b8[_0x145a('0x18')](0x194);}return _0x12da8c;};}function handleError(_0x56df4b,_0x3c56c6){_0x3c56c6=_0x3c56c6||0x1f4;return function(_0x1b3ed5){logger[_0x145a('0x26')](_0x1b3ed5[_0x145a('0x27')]);if(_0x1b3ed5[_0x145a('0x28')]){delete _0x1b3ed5[_0x145a('0x28')];}_0x56df4b[_0x145a('0x19')](_0x3c56c6)[_0x145a('0x29')](_0x1b3ed5);};}exports[_0x145a('0x2a')]=function(_0x1d6d53,_0x11ec90){var _0x46facf={},_0x1f6b5f={},_0x30003d={'count':0x0,'rows':[]};var _0x325f7c=_[_0x145a('0x2b')](db[_0x145a('0x2c')][_0x145a('0x2d')],function(_0x28b7d3){return{'name':_0x28b7d3[_0x145a('0x2e')],'type':_0x28b7d3[_0x145a('0x2f')][_0x145a('0x30')]};});_0x1f6b5f[_0x145a('0x31')]=_[_0x145a('0x2b')](_0x325f7c,_0x145a('0x28'));_0x1f6b5f[_0x145a('0x32')]=_[_0x145a('0x33')](_0x1d6d53['query']);_0x1f6b5f['filters']=_[_0x145a('0x34')](_0x1f6b5f[_0x145a('0x31')],_0x1f6b5f[_0x145a('0x32')]);_0x46facf[_0x145a('0x35')]=_['intersection'](_0x1f6b5f[_0x145a('0x31')],qs['fields'](_0x1d6d53[_0x145a('0x32')][_0x145a('0x36')]));_0x46facf[_0x145a('0x35')]=_0x46facf['attributes']['length']?_0x46facf[_0x145a('0x35')]:_0x1f6b5f[_0x145a('0x31')];if(!_0x1d6d53[_0x145a('0x32')][_0x145a('0x37')](_0x145a('0x38'))){_0x46facf[_0x145a('0x1f')]=qs['limit'](_0x1d6d53[_0x145a('0x32')]['limit']);_0x46facf[_0x145a('0x1e')]=qs[_0x145a('0x1e')](_0x1d6d53[_0x145a('0x32')][_0x145a('0x1e')]);}_0x46facf[_0x145a('0x39')]=qs[_0x145a('0x3a')](_0x1d6d53[_0x145a('0x32')][_0x145a('0x3a')]);_0x46facf[_0x145a('0x3b')]=qs['filters'](_[_0x145a('0x3c')](_0x1d6d53[_0x145a('0x32')],_0x1f6b5f[_0x145a('0x3d')]),_0x325f7c);if(_0x1d6d53[_0x145a('0x32')][_0x145a('0x3e')]){_0x46facf[_0x145a('0x3b')]=_[_0x145a('0x3f')](_0x46facf[_0x145a('0x3b')],{'$or':_[_0x145a('0x2b')](_0x325f7c,function(_0xc188b4){if(_0xc188b4['type']!=='VIRTUAL'){var _0x2a2514={};_0x2a2514[_0xc188b4[_0x145a('0x28')]]={'$like':'%'+_0x1d6d53['query'][_0x145a('0x3e')]+'%'};return _0x2a2514;}})});}_0x46facf=_['merge']({},_0x46facf,_0x1d6d53[_0x145a('0x40')]);var _0x2440a6={'where':_0x46facf[_0x145a('0x3b')]};return db[_0x145a('0x2c')][_0x145a('0x1d')](_0x2440a6)[_0x145a('0x24')](function(_0x1685ce){_0x30003d[_0x145a('0x1d')]=_0x1685ce;if(_0x1d6d53['query'][_0x145a('0x41')]){_0x46facf[_0x145a('0x42')]=[{'all':!![]}];}return db[_0x145a('0x2c')]['findAll'](_0x46facf);})[_0x145a('0x24')](function(_0x166f97){_0x30003d[_0x145a('0x43')]=_0x166f97;return _0x30003d;})[_0x145a('0x24')](respondWithFilteredResult(_0x11ec90,_0x46facf))[_0x145a('0x44')](handleError(_0x11ec90,null));};exports['show']=function(_0x1f8557,_0x1dd32e){var _0x309dde={'raw':!![],'where':{'id':_0x1f8557[_0x145a('0x45')]['id']}},_0x13012f={};_0x13012f[_0x145a('0x31')]=_[_0x145a('0x33')](db['OpenchannelQueueReport'][_0x145a('0x2d')]);_0x13012f[_0x145a('0x32')]=_[_0x145a('0x33')](_0x1f8557[_0x145a('0x32')]);_0x13012f['filters']=_[_0x145a('0x34')](_0x13012f[_0x145a('0x31')],_0x13012f[_0x145a('0x32')]);_0x309dde[_0x145a('0x35')]=_[_0x145a('0x34')](_0x13012f['model'],qs['fields'](_0x1f8557[_0x145a('0x32')]['fields']));_0x309dde[_0x145a('0x35')]=_0x309dde[_0x145a('0x35')]['length']?_0x309dde[_0x145a('0x35')]:_0x13012f[_0x145a('0x31')];if(_0x1f8557[_0x145a('0x32')][_0x145a('0x41')]){_0x309dde[_0x145a('0x42')]=[{'all':!![]}];}_0x309dde=_['merge']({},_0x309dde,_0x1f8557[_0x145a('0x40')]);return db[_0x145a('0x2c')]['find'](_0x309dde)['then'](handleEntityNotFound(_0x1dd32e,null))[_0x145a('0x24')](respondWithResult(_0x1dd32e,null))[_0x145a('0x44')](handleError(_0x1dd32e,null));};exports['create']=function(_0x478a47,_0x104108){return db['OpenchannelQueueReport'][_0x145a('0x46')](_0x478a47[_0x145a('0x47')],{})[_0x145a('0x24')](respondWithResult(_0x104108,0xc9))[_0x145a('0x44')](handleError(_0x104108,null));};exports[_0x145a('0x23')]=function(_0x449478,_0x16e133){if(_0x449478['body']['id']){delete _0x449478['body']['id'];}return db['OpenchannelQueueReport'][_0x145a('0x48')]({'where':{'id':_0x449478[_0x145a('0x45')]['id']}})['then'](handleEntityNotFound(_0x16e133,null))[_0x145a('0x24')](saveUpdates(_0x449478[_0x145a('0x47')],null))[_0x145a('0x24')](respondWithResult(_0x16e133,null))[_0x145a('0x44')](handleError(_0x16e133,null));};exports[_0x145a('0x25')]=function(_0xd6416e,_0x1df228){return db[_0x145a('0x2c')][_0x145a('0x48')]({'where':{'id':_0xd6416e[_0x145a('0x45')]['id']}})['then'](handleEntityNotFound(_0x1df228,null))[_0x145a('0x24')](removeEntity(_0x1df228,null))[_0x145a('0x44')](handleError(_0x1df228,null));};exports[_0x145a('0x49')]=function(_0x442c43,_0x45a882){return db[_0x145a('0x2c')][_0x145a('0x49')]()[_0x145a('0x24')](respondWithResult(_0x45a882,null))[_0x145a('0x44')](handleError(_0x45a882,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index d9bdcdd..9960771 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 _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x285cf1,_0x47e330){var _0x2fea93=function(_0x4129d6){while(--_0x4129d6){_0x285cf1['push'](_0x285cf1['shift']());}};_0x2fea93(++_0x47e330);}(_0x2ef3,0xba));var _0x32ef=function(_0x2269f0,_0x13b80b){_0x2269f0=_0x2269f0-0x0;var _0x1a9ed0=_0x2ef3[_0x2269f0];return _0x1a9ed0;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x4e9566,_0x20b096){var _0x3632d0=function(_0x3a4efe){while(--_0x3a4efe){_0x4e9566['push'](_0x4e9566['shift']());}};_0x3632d0(++_0x20b096);}(_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':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 4696c45..6d86d9a 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 _0x02a7=['raw','UpdateOpenchannelQueueReport','OpenchannelQueueReport','where','attributes','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','create','body','options'];(function(_0x31d849,_0x3db9bc){var _0x1c55b3=function(_0x3b8040){while(--_0x3b8040){_0x31d849['push'](_0x31d849['shift']());}};_0x1c55b3(++_0x3db9bc);}(_0x02a7,0x1a6));var _0x702a=function(_0x3c2903,_0x2efcee){_0x3c2903=_0x3c2903-0x0;var _0x3ffc51=_0x02a7[_0x3c2903];return _0x3ffc51;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var moment=require(_0x702a('0x1'));var BPromise=require(_0x702a('0x2'));var rs=require(_0x702a('0x3'));var fs=require('fs');var Redis=require(_0x702a('0x4'));var db=require(_0x702a('0x5'))['db'];var utils=require(_0x702a('0x6'));var logger=require(_0x702a('0x7'))(_0x702a('0x8'));var config=require(_0x702a('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x702a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b6736,_0x27bfc7,_0x3f5ff8){return new BPromise(function(_0x51bf52,_0x562fdb){return client['request'](_0x4b6736,_0x3f5ff8)['then'](function(_0x3cb569){logger[_0x702a('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x27bfc7,_0x702a('0xc'));logger[_0x702a('0xd')](_0x702a('0xe'),_0x27bfc7,_0x702a('0xc'),JSON[_0x702a('0xf')](_0x3cb569));if(_0x3cb569[_0x702a('0x10')]){if(_0x3cb569[_0x702a('0x10')][_0x702a('0x11')]===0x1f4){logger['error'](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x562fdb(_0x3cb569[_0x702a('0x10')]['message']);}logger[_0x702a('0x10')](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x51bf52(_0x3cb569[_0x702a('0x10')]['message']);}else{logger[_0x702a('0xb')](_0x702a('0x12'),_0x27bfc7,_0x702a('0xc'));_0x51bf52(_0x3cb569[_0x702a('0x14')][_0x702a('0x13')]);}})[_0x702a('0x15')](function(_0x451881){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x27bfc7,_0x451881);_0x562fdb(_0x451881);});});}exports[_0x702a('0x16')]=function(_0x340dc2){var _0x2071ad=this;return new Promise(function(_0x3d1550,_0x1885eb){return db['OpenchannelQueueReport'][_0x702a('0x17')](_0x340dc2[_0x702a('0x18')],{'raw':_0x340dc2[_0x702a('0x19')]?_0x340dc2[_0x702a('0x19')][_0x702a('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5b2998){logger['info'](_0x702a('0x16'),_0x340dc2);logger['debug'](_0x702a('0x16'),_0x340dc2,JSON[_0x702a('0xf')](_0x5b2998));_0x3d1550(_0x5b2998);})['catch'](function(_0x2ca064){logger[_0x702a('0x10')](_0x702a('0x16'),_0x2ca064[_0x702a('0x13')],_0x340dc2);_0x1885eb(_0x2071ad[_0x702a('0x10')](0x1f4,_0x2ca064['message']));});});};exports[_0x702a('0x1b')]=function(_0x544be5){var _0x5e6cce=this;return new Promise(function(_0x57d897,_0xa2be1d){return db[_0x702a('0x1c')]['update'](_0x544be5[_0x702a('0x18')],{'raw':_0x544be5[_0x702a('0x19')]?_0x544be5[_0x702a('0x19')][_0x702a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x544be5[_0x702a('0x19')]?_0x544be5[_0x702a('0x19')][_0x702a('0x1d')]||null:null,'attributes':_0x544be5[_0x702a('0x19')]?_0x544be5[_0x702a('0x19')][_0x702a('0x1e')]||null:null,'limit':_0x544be5['options']?_0x544be5[_0x702a('0x19')]['limit']||null:null})[_0x702a('0x1f')](function(_0x51867d){logger[_0x702a('0xb')](_0x702a('0x1b'),_0x544be5);logger[_0x702a('0xd')]('UpdateOpenchannelQueueReport',_0x544be5,JSON[_0x702a('0xf')](_0x51867d));_0x57d897(_0x51867d);})[_0x702a('0x15')](function(_0x26e1d1){logger['error'](_0x702a('0x1b'),_0x26e1d1['message'],_0x544be5);_0xa2be1d(_0x5e6cce[_0x702a('0x10')](0x1f4,_0x26e1d1[_0x702a('0x13')]));});});}; \ No newline at end of file +var _0xdac7=['client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','update','attributes','limit','UpdateOpenchannelQueueReport','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3ccb15,_0xd231ac){var _0x15b2c7=function(_0x37d865){while(--_0x37d865){_0x3ccb15['push'](_0x3ccb15['shift']());}};_0x15b2c7(++_0xd231ac);}(_0xdac7,0x180));var _0x7dac=function(_0x40bd2b,_0xa329a4){_0x40bd2b=_0x40bd2b-0x0;var _0x5122f8=_0xdac7[_0x40bd2b];return _0x5122f8;};'use strict';var _=require(_0x7dac('0x0'));var util=require(_0x7dac('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7dac('0x2'));var db=require(_0x7dac('0x3'))['db'];var utils=require(_0x7dac('0x4'));var logger=require(_0x7dac('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7dac('0x6')][_0x7dac('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x505705,_0x28cc84,_0x53c460){return new BPromise(function(_0x3b319f,_0x5ccf75){return client[_0x7dac('0x8')](_0x505705,_0x53c460)[_0x7dac('0x9')](function(_0x45fbdc){logger[_0x7dac('0xa')](_0x7dac('0xb'),_0x28cc84,_0x7dac('0xc'));logger[_0x7dac('0xd')](_0x7dac('0xe'),_0x28cc84,_0x7dac('0xc'),JSON[_0x7dac('0xf')](_0x45fbdc));if(_0x45fbdc['error']){if(_0x45fbdc['error']['code']===0x1f4){logger[_0x7dac('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x28cc84,_0x45fbdc[_0x7dac('0x10')]['message']);return _0x5ccf75(_0x45fbdc[_0x7dac('0x10')][_0x7dac('0x11')]);}logger[_0x7dac('0x10')](_0x7dac('0xb'),_0x28cc84,_0x45fbdc[_0x7dac('0x10')][_0x7dac('0x11')]);return _0x3b319f(_0x45fbdc[_0x7dac('0x10')]['message']);}else{logger[_0x7dac('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x28cc84,'request\x20sent');_0x3b319f(_0x45fbdc[_0x7dac('0x12')][_0x7dac('0x11')]);}})[_0x7dac('0x13')](function(_0x2de4ea){logger[_0x7dac('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x28cc84,_0x2de4ea);_0x5ccf75(_0x2de4ea);});});}exports[_0x7dac('0x14')]=function(_0x4c1f4f){var _0x352a77=this;return new Promise(function(_0x4639e2,_0x313615){return db[_0x7dac('0x15')][_0x7dac('0x16')](_0x4c1f4f[_0x7dac('0x17')],{'raw':_0x4c1f4f[_0x7dac('0x18')]?_0x4c1f4f[_0x7dac('0x18')][_0x7dac('0x19')]===undefined?!![]:![]:!![]})[_0x7dac('0x9')](function(_0x18f993){logger[_0x7dac('0xa')](_0x7dac('0x14'),_0x4c1f4f);logger[_0x7dac('0xd')]('CreateOpenchannelQueueReport',_0x4c1f4f,JSON['stringify'](_0x18f993));_0x4639e2(_0x18f993);})[_0x7dac('0x13')](function(_0x4c9fda){logger[_0x7dac('0x10')](_0x7dac('0x14'),_0x4c9fda['message'],_0x4c1f4f);_0x313615(_0x352a77[_0x7dac('0x10')](0x1f4,_0x4c9fda[_0x7dac('0x11')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0xbdabba){var _0x41b3cd=this;return new Promise(function(_0x341cc8,_0x179881){return db[_0x7dac('0x15')][_0x7dac('0x1a')](_0xbdabba[_0x7dac('0x17')],{'raw':_0xbdabba['options']?_0xbdabba[_0x7dac('0x18')][_0x7dac('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbdabba[_0x7dac('0x18')]?_0xbdabba['options']['where']||null:null,'attributes':_0xbdabba[_0x7dac('0x18')]?_0xbdabba[_0x7dac('0x18')][_0x7dac('0x1b')]||null:null,'limit':_0xbdabba[_0x7dac('0x18')]?_0xbdabba[_0x7dac('0x18')][_0x7dac('0x1c')]||null:null})[_0x7dac('0x9')](function(_0x31bbf7){logger[_0x7dac('0xa')](_0x7dac('0x1d'),_0xbdabba);logger[_0x7dac('0xd')]('UpdateOpenchannelQueueReport',_0xbdabba,JSON['stringify'](_0x31bbf7));_0x341cc8(_0x31bbf7);})[_0x7dac('0x13')](function(_0xa92c4b){logger[_0x7dac('0x10')]('UpdateOpenchannelQueueReport',_0xa92c4b[_0x7dac('0x11')],_0xbdabba);_0x179881(_0x41b3cd[_0x7dac('0x10')](0x1f4,_0xa92c4b[_0x7dac('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 1906b54..5997d6d 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 _0x53c1=['multer','util','path','express','fs-extra','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','create','update','delete','destroy'];(function(_0x26937d,_0x26f605){var _0xc887b0=function(_0x1f78cf){while(--_0x1f78cf){_0x26937d['push'](_0x26937d['shift']());}};_0xc887b0(++_0x26f605);}(_0x53c1,0x1c0));var _0x153c=function(_0x20e3d1,_0x56488d){_0x20e3d1=_0x20e3d1-0x0;var _0xb93fc3=_0x53c1[_0x20e3d1];return _0xb93fc3;};'use strict';var multer=require(_0x153c('0x0'));var util=require(_0x153c('0x1'));var path=require(_0x153c('0x2'));var timeout=require('connect-timeout');var express=require(_0x153c('0x3'));var router=express['Router']();var fs_extra=require(_0x153c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x153c('0x5'));var controller=require('./openchannelTransferReport.controller');router['get']('/',auth[_0x153c('0x6')](),controller[_0x153c('0x7')]);router[_0x153c('0x8')](_0x153c('0x9'),auth[_0x153c('0x6')](),controller['describe']);router[_0x153c('0x8')](_0x153c('0xa'),auth[_0x153c('0x6')](),controller[_0x153c('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x153c('0xc')]);router['put'](_0x153c('0xa'),auth['isAuthenticated'](),controller[_0x153c('0xd')]);router[_0x153c('0xe')](_0x153c('0xa'),auth[_0x153c('0x6')](),controller[_0x153c('0xf')]);module['exports']=router; \ No newline at end of file +var _0x775e=['create','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x2aee2f,_0xad9887){var _0x19337f=function(_0x2e62d){while(--_0x2e62d){_0x2aee2f['push'](_0x2aee2f['shift']());}};_0x19337f(++_0xad9887);}(_0x775e,0x169));var _0xe775=function(_0x67343e,_0x2fa00d){_0x67343e=_0x67343e-0x0;var _0x91168f=_0x775e[_0x67343e];return _0x91168f;};'use strict';var multer=require(_0xe775('0x0'));var util=require('util');var path=require(_0xe775('0x1'));var timeout=require(_0xe775('0x2'));var express=require(_0xe775('0x3'));var router=express['Router']();var fs_extra=require(_0xe775('0x4'));var auth=require(_0xe775('0x5'));var interaction=require(_0xe775('0x6'));var config=require(_0xe775('0x7'));var controller=require(_0xe775('0x8'));router[_0xe775('0x9')]('/',auth[_0xe775('0xa')](),controller[_0xe775('0xb')]);router['get'](_0xe775('0xc'),auth[_0xe775('0xa')](),controller[_0xe775('0xd')]);router[_0xe775('0x9')](_0xe775('0xe'),auth[_0xe775('0xa')](),controller[_0xe775('0xf')]);router[_0xe775('0x10')]('/',auth[_0xe775('0xa')](),controller[_0xe775('0x11')]);router['put'](_0xe775('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xe775('0x12')](_0xe775('0xe'),auth[_0xe775('0xa')](),controller[_0xe775('0x13')]);module[_0xe775('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 0a2993c..2762808 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(_0x3b711c,_0x4b22dc){var _0x2685f0=function(_0x3b5ba6){while(--_0x3b5ba6){_0x3b711c['push'](_0x3b711c['shift']());}};_0x2685f0(++_0x4b22dc);}(_0x9bde,0xe1));var _0xe9bd=function(_0x29a17a,_0x13706f){_0x29a17a=_0x29a17a-0x0;var _0x5c1e8d=_0x9bde[_0x29a17a];return _0x5c1e8d;};'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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x113e32,_0x5339f0){var _0x4ff939=function(_0x2be9ca){while(--_0x2be9ca){_0x113e32['push'](_0x113e32['shift']());}};_0x4ff939(++_0x5339f0);}(_0x9bde,0xe1));var _0xe9bd=function(_0x21e745,_0x547d44){_0x21e745=_0x21e745-0x0;var _0x43f2a1=_0x9bde[_0x21e745];return _0x43f2a1;};'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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index cc78e86..21e4854 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 _0x1acb=['reject','save','update','then','destroy','sendStatus','error','name','send','index','map','OpenchannelTransferReport','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','offset','count','set'];(function(_0x2003ff,_0x5f1e44){var _0x754ccc=function(_0x34ce84){while(--_0x34ce84){_0x2003ff['push'](_0x2003ff['shift']());}};_0x754ccc(++_0x5f1e44);}(_0x1acb,0x71));var _0xb1ac=function(_0x288a01,_0x2eb55a){_0x288a01=_0x288a01-0x0;var _0x2d49e5=_0x1acb[_0x288a01];return _0x2d49e5;};'use strict';var emlformat=require(_0xb1ac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb1ac('0x1'));var jsonpatch=require(_0xb1ac('0x2'));var rp=require(_0xb1ac('0x3'));var moment=require(_0xb1ac('0x4'));var BPromise=require(_0xb1ac('0x5'));var Mustache=require(_0xb1ac('0x6'));var util=require(_0xb1ac('0x7'));var path=require(_0xb1ac('0x8'));var sox=require(_0xb1ac('0x9'));var csv=require(_0xb1ac('0xa'));var ejs=require(_0xb1ac('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('jsforce');var deskjs=require(_0xb1ac('0xc'));var toCsv=require(_0xb1ac('0xa'));var querystring=require(_0xb1ac('0xd'));var Papa=require(_0xb1ac('0xe'));var Redis=require('ioredis');var authService=require(_0xb1ac('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb1ac('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1ac('0x11'))(_0xb1ac('0x12'));var utils=require('../../config/utils');var config=require(_0xb1ac('0x13'));var licenseUtil=require(_0xb1ac('0x14'));var db=require(_0xb1ac('0x15'))['db'];function respondWithStatusCode(_0x18355b,_0x57bb39){_0x57bb39=_0x57bb39||0xcc;return function(_0x31f6da){if(_0x31f6da){return _0x18355b['sendStatus'](_0x57bb39);}return _0x18355b[_0xb1ac('0x16')](_0x57bb39)[_0xb1ac('0x17')]();};}function respondWithResult(_0x54f1fb,_0x4b2fd5){_0x4b2fd5=_0x4b2fd5||0xc8;return function(_0x5cdeac){if(_0x5cdeac){return _0x54f1fb[_0xb1ac('0x16')](_0x4b2fd5)['json'](_0x5cdeac);}};}function respondWithFilteredResult(_0x119707,_0x98a29f){return function(_0xe57c){if(_0xe57c){var _0x4fa177=typeof _0x98a29f['offset']===_0xb1ac('0x18')&&typeof _0x98a29f[_0xb1ac('0x19')]===_0xb1ac('0x18');var _0x1ba078=_0xe57c['count'];var _0x17ff59=_0x4fa177?0x0:_0x98a29f[_0xb1ac('0x1a')];var _0x209399=_0x4fa177?_0xe57c[_0xb1ac('0x1b')]:_0x98a29f['offset']+_0x98a29f[_0xb1ac('0x19')];var _0x17cefa;if(_0x209399>=_0x1ba078){_0x209399=_0x1ba078;_0x17cefa=0xc8;}else{_0x17cefa=0xce;}_0x119707[_0xb1ac('0x16')](_0x17cefa);return _0x119707[_0xb1ac('0x1c')]('Content-Range',_0x17ff59+'-'+_0x209399+'/'+_0x1ba078)['json'](_0xe57c);}return null;};}function patchUpdates(_0x5b2452){return function(_0x20c6ac){try{jsonpatch['apply'](_0x20c6ac,_0x5b2452,!![]);}catch(_0x4197e6){return BPromise[_0xb1ac('0x1d')](_0x4197e6);}return _0x20c6ac[_0xb1ac('0x1e')]();};}function saveUpdates(_0x2ed993,_0x55de65){return function(_0x1e419b){if(_0x1e419b){return _0x1e419b[_0xb1ac('0x1f')](_0x2ed993)[_0xb1ac('0x20')](function(_0x444cef){return _0x444cef;});}return null;};}function removeEntity(_0x2bfd2a,_0x4e7d97){return function(_0x1a95ec){if(_0x1a95ec){return _0x1a95ec[_0xb1ac('0x21')]()['then'](function(){_0x2bfd2a[_0xb1ac('0x16')](0xcc)[_0xb1ac('0x17')]();});}};}function handleEntityNotFound(_0x15221d,_0x31d483){return function(_0x1fff03){if(!_0x1fff03){_0x15221d[_0xb1ac('0x22')](0x194);}return _0x1fff03;};}function handleError(_0x58b389,_0x569070){_0x569070=_0x569070||0x1f4;return function(_0x5490c8){logger[_0xb1ac('0x23')](_0x5490c8['stack']);if(_0x5490c8['name']){delete _0x5490c8[_0xb1ac('0x24')];}_0x58b389[_0xb1ac('0x16')](_0x569070)[_0xb1ac('0x25')](_0x5490c8);};}exports[_0xb1ac('0x26')]=function(_0x2fc86b,_0x4d14ff){var _0x2337e0={},_0x6edeba={},_0x47cbd1={'count':0x0,'rows':[]};var _0x3f32e0=_[_0xb1ac('0x27')](db[_0xb1ac('0x28')][_0xb1ac('0x29')],function(_0x437496){return{'name':_0x437496['fieldName'],'type':_0x437496['type']['key']};});_0x6edeba[_0xb1ac('0x2a')]=_[_0xb1ac('0x27')](_0x3f32e0,_0xb1ac('0x24'));_0x6edeba[_0xb1ac('0x2b')]=_['keys'](_0x2fc86b['query']);_0x6edeba[_0xb1ac('0x2c')]=_[_0xb1ac('0x2d')](_0x6edeba['model'],_0x6edeba['query']);_0x2337e0[_0xb1ac('0x2e')]=_[_0xb1ac('0x2d')](_0x6edeba[_0xb1ac('0x2a')],qs[_0xb1ac('0x2f')](_0x2fc86b[_0xb1ac('0x2b')]['fields']));_0x2337e0[_0xb1ac('0x2e')]=_0x2337e0['attributes'][_0xb1ac('0x30')]?_0x2337e0[_0xb1ac('0x2e')]:_0x6edeba[_0xb1ac('0x2a')];if(!_0x2fc86b[_0xb1ac('0x2b')][_0xb1ac('0x31')](_0xb1ac('0x32'))){_0x2337e0[_0xb1ac('0x19')]=qs[_0xb1ac('0x19')](_0x2fc86b['query']['limit']);_0x2337e0[_0xb1ac('0x1a')]=qs[_0xb1ac('0x1a')](_0x2fc86b[_0xb1ac('0x2b')]['offset']);}_0x2337e0[_0xb1ac('0x33')]=qs[_0xb1ac('0x34')](_0x2fc86b[_0xb1ac('0x2b')][_0xb1ac('0x34')]);_0x2337e0[_0xb1ac('0x35')]=qs[_0xb1ac('0x2c')](_['pick'](_0x2fc86b[_0xb1ac('0x2b')],_0x6edeba[_0xb1ac('0x2c')]),_0x3f32e0);if(_0x2fc86b[_0xb1ac('0x2b')]['filter']){_0x2337e0[_0xb1ac('0x35')]=_[_0xb1ac('0x36')](_0x2337e0[_0xb1ac('0x35')],{'$or':_[_0xb1ac('0x27')](_0x3f32e0,function(_0x4b2c68){if(_0x4b2c68[_0xb1ac('0x37')]!==_0xb1ac('0x38')){var _0x2599c6={};_0x2599c6[_0x4b2c68[_0xb1ac('0x24')]]={'$like':'%'+_0x2fc86b[_0xb1ac('0x2b')][_0xb1ac('0x39')]+'%'};return _0x2599c6;}})});}_0x2337e0=_['merge']({},_0x2337e0,_0x2fc86b[_0xb1ac('0x3a')]);var _0x384a47={'where':_0x2337e0[_0xb1ac('0x35')]};return db[_0xb1ac('0x28')][_0xb1ac('0x1b')](_0x384a47)[_0xb1ac('0x20')](function(_0xf7476f){_0x47cbd1[_0xb1ac('0x1b')]=_0xf7476f;if(_0x2fc86b[_0xb1ac('0x2b')]['includeAll']){_0x2337e0[_0xb1ac('0x3b')]=[{'all':!![]}];}return db[_0xb1ac('0x28')][_0xb1ac('0x3c')](_0x2337e0);})[_0xb1ac('0x20')](function(_0x1ab8d8){_0x47cbd1[_0xb1ac('0x3d')]=_0x1ab8d8;return _0x47cbd1;})[_0xb1ac('0x20')](respondWithFilteredResult(_0x4d14ff,_0x2337e0))[_0xb1ac('0x3e')](handleError(_0x4d14ff,null));};exports[_0xb1ac('0x3f')]=function(_0x658065,_0x3ce7e2){var _0x1a8d8d={'raw':!![],'where':{'id':_0x658065[_0xb1ac('0x40')]['id']}},_0x13193f={};_0x13193f[_0xb1ac('0x2a')]=_['keys'](db['OpenchannelTransferReport'][_0xb1ac('0x29')]);_0x13193f['query']=_[_0xb1ac('0x41')](_0x658065['query']);_0x13193f[_0xb1ac('0x2c')]=_[_0xb1ac('0x2d')](_0x13193f[_0xb1ac('0x2a')],_0x13193f[_0xb1ac('0x2b')]);_0x1a8d8d['attributes']=_[_0xb1ac('0x2d')](_0x13193f['model'],qs[_0xb1ac('0x2f')](_0x658065[_0xb1ac('0x2b')]['fields']));_0x1a8d8d[_0xb1ac('0x2e')]=_0x1a8d8d[_0xb1ac('0x2e')]['length']?_0x1a8d8d['attributes']:_0x13193f[_0xb1ac('0x2a')];if(_0x658065[_0xb1ac('0x2b')][_0xb1ac('0x42')]){_0x1a8d8d[_0xb1ac('0x3b')]=[{'all':!![]}];}_0x1a8d8d=_[_0xb1ac('0x36')]({},_0x1a8d8d,_0x658065[_0xb1ac('0x3a')]);return db[_0xb1ac('0x28')]['find'](_0x1a8d8d)[_0xb1ac('0x20')](handleEntityNotFound(_0x3ce7e2,null))[_0xb1ac('0x20')](respondWithResult(_0x3ce7e2,null))[_0xb1ac('0x3e')](handleError(_0x3ce7e2,null));};exports['create']=function(_0x29d96b,_0x2a0902){return db[_0xb1ac('0x28')][_0xb1ac('0x43')](_0x29d96b[_0xb1ac('0x44')],{})['then'](respondWithResult(_0x2a0902,0xc9))[_0xb1ac('0x3e')](handleError(_0x2a0902,null));};exports[_0xb1ac('0x1f')]=function(_0x35100f,_0x2ed3c8){if(_0x35100f[_0xb1ac('0x44')]['id']){delete _0x35100f[_0xb1ac('0x44')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x35100f[_0xb1ac('0x40')]['id']}})[_0xb1ac('0x20')](handleEntityNotFound(_0x2ed3c8,null))['then'](saveUpdates(_0x35100f[_0xb1ac('0x44')],null))[_0xb1ac('0x20')](respondWithResult(_0x2ed3c8,null))['catch'](handleError(_0x2ed3c8,null));};exports[_0xb1ac('0x21')]=function(_0x136c9c,_0x5fbbd9){return db[_0xb1ac('0x28')][_0xb1ac('0x45')]({'where':{'id':_0x136c9c[_0xb1ac('0x40')]['id']}})[_0xb1ac('0x20')](handleEntityNotFound(_0x5fbbd9,null))['then'](removeEntity(_0x5fbbd9,null))[_0xb1ac('0x3e')](handleError(_0x5fbbd9,null));};exports[_0xb1ac('0x46')]=function(_0x4ab150,_0x2a89fc){return db[_0xb1ac('0x28')][_0xb1ac('0x46')]()[_0xb1ac('0x20')](respondWithResult(_0x2a89fc,null))[_0xb1ac('0x3e')](handleError(_0x2a89fc,null));}; \ No newline at end of file +var _0x90ff=['count','Content-Range','apply','save','update','then','error','stack','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','name','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0x323726,_0x7af501){var _0x1b8691=function(_0xbe7b2b){while(--_0xbe7b2b){_0x323726['push'](_0x323726['shift']());}};_0x1b8691(++_0x7af501);}(_0x90ff,0x111));var _0xf90f=function(_0x23a915,_0x48d215){_0x23a915=_0x23a915-0x0;var _0x1e301d=_0x90ff[_0x23a915];return _0x1e301d;};'use strict';var emlformat=require(_0xf90f('0x0'));var rimraf=require(_0xf90f('0x1'));var zipdir=require(_0xf90f('0x2'));var jsonpatch=require(_0xf90f('0x3'));var rp=require(_0xf90f('0x4'));var moment=require(_0xf90f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf90f('0x6'));var util=require(_0xf90f('0x7'));var path=require(_0xf90f('0x8'));var sox=require(_0xf90f('0x9'));var csv=require('to-csv');var ejs=require(_0xf90f('0xa'));var fs=require('fs');var fs_extra=require(_0xf90f('0xb'));var _=require(_0xf90f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf90f('0xd'));var deskjs=require(_0xf90f('0xe'));var toCsv=require(_0xf90f('0xf'));var querystring=require(_0xf90f('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf90f('0x11'));var qs=require(_0xf90f('0x12'));var as=require(_0xf90f('0x13'));var hardwareService=require(_0xf90f('0x14'));var logger=require(_0xf90f('0x15'))('api');var utils=require(_0xf90f('0x16'));var config=require(_0xf90f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf90f('0x18'))['db'];function respondWithStatusCode(_0x15641d,_0x47ea3c){_0x47ea3c=_0x47ea3c||0xcc;return function(_0x1e6ea2){if(_0x1e6ea2){return _0x15641d['sendStatus'](_0x47ea3c);}return _0x15641d[_0xf90f('0x19')](_0x47ea3c)[_0xf90f('0x1a')]();};}function respondWithResult(_0x39769a,_0x4be7ad){_0x4be7ad=_0x4be7ad||0xc8;return function(_0x5a8da2){if(_0x5a8da2){return _0x39769a['status'](_0x4be7ad)[_0xf90f('0x1b')](_0x5a8da2);}};}function respondWithFilteredResult(_0xfb4a45,_0x3d7d34){return function(_0x27c2ff){if(_0x27c2ff){var _0x2c1e99=typeof _0x3d7d34[_0xf90f('0x1c')]===_0xf90f('0x1d')&&typeof _0x3d7d34[_0xf90f('0x1e')]===_0xf90f('0x1d');var _0x4ccddf=_0x27c2ff[_0xf90f('0x1f')];var _0xb68ddd=_0x2c1e99?0x0:_0x3d7d34[_0xf90f('0x1c')];var _0x39c455=_0x2c1e99?_0x27c2ff[_0xf90f('0x1f')]:_0x3d7d34[_0xf90f('0x1c')]+_0x3d7d34[_0xf90f('0x1e')];var _0x3059ff;if(_0x39c455>=_0x4ccddf){_0x39c455=_0x4ccddf;_0x3059ff=0xc8;}else{_0x3059ff=0xce;}_0xfb4a45['status'](_0x3059ff);return _0xfb4a45['set'](_0xf90f('0x20'),_0xb68ddd+'-'+_0x39c455+'/'+_0x4ccddf)[_0xf90f('0x1b')](_0x27c2ff);}return null;};}function patchUpdates(_0x53a9be){return function(_0x4bf4df){try{jsonpatch[_0xf90f('0x21')](_0x4bf4df,_0x53a9be,!![]);}catch(_0x44ff69){return BPromise['reject'](_0x44ff69);}return _0x4bf4df[_0xf90f('0x22')]();};}function saveUpdates(_0x3a0767,_0x512155){return function(_0x46b0c5){if(_0x46b0c5){return _0x46b0c5[_0xf90f('0x23')](_0x3a0767)[_0xf90f('0x24')](function(_0xb84a7f){return _0xb84a7f;});}return null;};}function removeEntity(_0x12ae7c,_0x17835a){return function(_0x614d5f){if(_0x614d5f){return _0x614d5f['destroy']()[_0xf90f('0x24')](function(){_0x12ae7c['status'](0xcc)[_0xf90f('0x1a')]();});}};}function handleEntityNotFound(_0x521e77,_0x41edfc){return function(_0x409e62){if(!_0x409e62){_0x521e77['sendStatus'](0x194);}return _0x409e62;};}function handleError(_0x104d9e,_0x2ac230){_0x2ac230=_0x2ac230||0x1f4;return function(_0x2f448d){logger[_0xf90f('0x25')](_0x2f448d[_0xf90f('0x26')]);if(_0x2f448d['name']){delete _0x2f448d['name'];}_0x104d9e['status'](_0x2ac230)[_0xf90f('0x27')](_0x2f448d);};}exports[_0xf90f('0x28')]=function(_0x4815ef,_0x214ac7){var _0x4cbcfc={},_0x2b7b82={},_0x469307={'count':0x0,'rows':[]};var _0x35d982=_[_0xf90f('0x29')](db[_0xf90f('0x2a')][_0xf90f('0x2b')],function(_0x2bfe61){return{'name':_0x2bfe61[_0xf90f('0x2c')],'type':_0x2bfe61[_0xf90f('0x2d')]['key']};});_0x2b7b82[_0xf90f('0x2e')]=_[_0xf90f('0x29')](_0x35d982,'name');_0x2b7b82[_0xf90f('0x2f')]=_[_0xf90f('0x30')](_0x4815ef[_0xf90f('0x2f')]);_0x2b7b82[_0xf90f('0x31')]=_['intersection'](_0x2b7b82[_0xf90f('0x2e')],_0x2b7b82[_0xf90f('0x2f')]);_0x4cbcfc[_0xf90f('0x32')]=_[_0xf90f('0x33')](_0x2b7b82[_0xf90f('0x2e')],qs['fields'](_0x4815ef[_0xf90f('0x2f')][_0xf90f('0x34')]));_0x4cbcfc[_0xf90f('0x32')]=_0x4cbcfc[_0xf90f('0x32')][_0xf90f('0x35')]?_0x4cbcfc[_0xf90f('0x32')]:_0x2b7b82[_0xf90f('0x2e')];if(!_0x4815ef['query'][_0xf90f('0x36')]('nolimit')){_0x4cbcfc[_0xf90f('0x1e')]=qs[_0xf90f('0x1e')](_0x4815ef[_0xf90f('0x2f')]['limit']);_0x4cbcfc['offset']=qs[_0xf90f('0x1c')](_0x4815ef[_0xf90f('0x2f')][_0xf90f('0x1c')]);}_0x4cbcfc[_0xf90f('0x37')]=qs[_0xf90f('0x38')](_0x4815ef[_0xf90f('0x2f')][_0xf90f('0x38')]);_0x4cbcfc[_0xf90f('0x39')]=qs['filters'](_[_0xf90f('0x3a')](_0x4815ef[_0xf90f('0x2f')],_0x2b7b82[_0xf90f('0x31')]),_0x35d982);if(_0x4815ef['query'][_0xf90f('0x3b')]){_0x4cbcfc[_0xf90f('0x39')]=_['merge'](_0x4cbcfc[_0xf90f('0x39')],{'$or':_[_0xf90f('0x29')](_0x35d982,function(_0x263550){if(_0x263550[_0xf90f('0x2d')]!==_0xf90f('0x3c')){var _0x15d52a={};_0x15d52a[_0x263550[_0xf90f('0x3d')]]={'$like':'%'+_0x4815ef[_0xf90f('0x2f')][_0xf90f('0x3b')]+'%'};return _0x15d52a;}})});}_0x4cbcfc=_[_0xf90f('0x3e')]({},_0x4cbcfc,_0x4815ef[_0xf90f('0x3f')]);var _0x3ba253={'where':_0x4cbcfc['where']};return db[_0xf90f('0x2a')][_0xf90f('0x1f')](_0x3ba253)[_0xf90f('0x24')](function(_0x13ef1a){_0x469307[_0xf90f('0x1f')]=_0x13ef1a;if(_0x4815ef[_0xf90f('0x2f')][_0xf90f('0x40')]){_0x4cbcfc[_0xf90f('0x41')]=[{'all':!![]}];}return db[_0xf90f('0x2a')][_0xf90f('0x42')](_0x4cbcfc);})[_0xf90f('0x24')](function(_0xa110b0){_0x469307[_0xf90f('0x43')]=_0xa110b0;return _0x469307;})[_0xf90f('0x24')](respondWithFilteredResult(_0x214ac7,_0x4cbcfc))[_0xf90f('0x44')](handleError(_0x214ac7,null));};exports[_0xf90f('0x45')]=function(_0x291fbe,_0x1324a9){var _0x19403c={'raw':!![],'where':{'id':_0x291fbe[_0xf90f('0x46')]['id']}},_0x5b13f7={};_0x5b13f7[_0xf90f('0x2e')]=_[_0xf90f('0x30')](db[_0xf90f('0x2a')]['rawAttributes']);_0x5b13f7['query']=_[_0xf90f('0x30')](_0x291fbe[_0xf90f('0x2f')]);_0x5b13f7[_0xf90f('0x31')]=_[_0xf90f('0x33')](_0x5b13f7[_0xf90f('0x2e')],_0x5b13f7[_0xf90f('0x2f')]);_0x19403c[_0xf90f('0x32')]=_[_0xf90f('0x33')](_0x5b13f7[_0xf90f('0x2e')],qs[_0xf90f('0x34')](_0x291fbe[_0xf90f('0x2f')][_0xf90f('0x34')]));_0x19403c[_0xf90f('0x32')]=_0x19403c[_0xf90f('0x32')][_0xf90f('0x35')]?_0x19403c[_0xf90f('0x32')]:_0x5b13f7['model'];if(_0x291fbe[_0xf90f('0x2f')]['includeAll']){_0x19403c['include']=[{'all':!![]}];}_0x19403c=_[_0xf90f('0x3e')]({},_0x19403c,_0x291fbe[_0xf90f('0x3f')]);return db[_0xf90f('0x2a')][_0xf90f('0x47')](_0x19403c)[_0xf90f('0x24')](handleEntityNotFound(_0x1324a9,null))[_0xf90f('0x24')](respondWithResult(_0x1324a9,null))[_0xf90f('0x44')](handleError(_0x1324a9,null));};exports['create']=function(_0x520f60,_0x5361d0){return db[_0xf90f('0x2a')][_0xf90f('0x48')](_0x520f60[_0xf90f('0x49')],{})[_0xf90f('0x24')](respondWithResult(_0x5361d0,0xc9))[_0xf90f('0x44')](handleError(_0x5361d0,null));};exports[_0xf90f('0x23')]=function(_0x2bac92,_0x1d4e47){if(_0x2bac92['body']['id']){delete _0x2bac92[_0xf90f('0x49')]['id'];}return db[_0xf90f('0x2a')][_0xf90f('0x47')]({'where':{'id':_0x2bac92[_0xf90f('0x46')]['id']}})[_0xf90f('0x24')](handleEntityNotFound(_0x1d4e47,null))[_0xf90f('0x24')](saveUpdates(_0x2bac92['body'],null))['then'](respondWithResult(_0x1d4e47,null))['catch'](handleError(_0x1d4e47,null));};exports[_0xf90f('0x4a')]=function(_0x2cb2c1,_0x181d44){return db[_0xf90f('0x2a')][_0xf90f('0x47')]({'where':{'id':_0x2cb2c1['params']['id']}})['then'](handleEntityNotFound(_0x181d44,null))[_0xf90f('0x24')](removeEntity(_0x181d44,null))[_0xf90f('0x44')](handleError(_0x181d44,null));};exports[_0xf90f('0x4b')]=function(_0x1da939,_0x2f3be2){return db['OpenchannelTransferReport'][_0xf90f('0x4b')]()[_0xf90f('0x24')](respondWithResult(_0x2f3be2,null))[_0xf90f('0x44')](handleError(_0x2f3be2,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index f8a2e7a..e93e36d 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 _0x9101=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','uniqueid','lodash'];(function(_0x2650e9,_0xb91cc){var _0x3511c8=function(_0x5069cf){while(--_0x5069cf){_0x2650e9['push'](_0x2650e9['shift']());}};_0x3511c8(++_0xb91cc);}(_0x9101,0x1a3));var _0x1910=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x9101[_0x35885a];return _0xe86249;};'use strict';var _=require(_0x1910('0x0'));var util=require(_0x1910('0x1'));var logger=require(_0x1910('0x2'))('api');var moment=require(_0x1910('0x3'));var BPromise=require(_0x1910('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1910('0x5'));var rimraf=require(_0x1910('0x6'));var config=require(_0x1910('0x7'));var attributes=require(_0x1910('0x8'));module['exports']=function(_0x4dd713,_0x433a38){return _0x4dd713[_0x1910('0x9')](_0x1910('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x1910('0xb'),'fields':[_0x1910('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2750=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid'];(function(_0x23d0b4,_0x245ed5){var _0x4c5562=function(_0x46c707){while(--_0x46c707){_0x23d0b4['push'](_0x23d0b4['shift']());}};_0x4c5562(++_0x245ed5);}(_0x2750,0x188));var _0x0275=function(_0x49dd23,_0x3d87e4){_0x49dd23=_0x49dd23-0x0;var _0x5b9d90=_0x2750[_0x49dd23];return _0x5b9d90;};'use strict';var _=require(_0x0275('0x0'));var util=require(_0x0275('0x1'));var logger=require(_0x0275('0x2'))(_0x0275('0x3'));var moment=require(_0x0275('0x4'));var BPromise=require(_0x0275('0x5'));var rp=require(_0x0275('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var attributes=require(_0x0275('0x9'));module['exports']=function(_0x5c6b46,_0x431e7e){return _0x5c6b46[_0x0275('0xa')](_0x0275('0xb'),attributes,{'tableName':_0x0275('0xc'),'paranoid':![],'indexes':[{'name':_0x0275('0xd'),'fields':[_0x0275('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index bc0a9f7..2e7fcd6 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 _0x0ec6=['client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3fd8c2,_0x42cfdc){var _0x5c8497=function(_0x152087){while(--_0x152087){_0x3fd8c2['push'](_0x3fd8c2['shift']());}};_0x5c8497(++_0x42cfdc);}(_0x0ec6,0x1f1));var _0x60ec=function(_0x3f726c,_0x425c4a){_0x3f726c=_0x3f726c-0x0;var _0x2ca043=_0x0ec6[_0x3f726c];return _0x2ca043;};'use strict';var _=require(_0x60ec('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x60ec('0x1'));var rs=require(_0x60ec('0x2'));var fs=require('fs');var Redis=require(_0x60ec('0x3'));var db=require(_0x60ec('0x4'))['db'];var utils=require(_0x60ec('0x5'));var logger=require(_0x60ec('0x6'))(_0x60ec('0x7'));var config=require('../../config/environment');var jayson=require(_0x60ec('0x8'));var client=jayson[_0x60ec('0x9')][_0x60ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x74adc4,_0x5d4cba,_0xcb974c){return new BPromise(function(_0x488ab8,_0x2c4a14){return client[_0x60ec('0xb')](_0x74adc4,_0xcb974c)[_0x60ec('0xc')](function(_0x1363c2){logger[_0x60ec('0xd')](_0x60ec('0xe'),_0x5d4cba,'request\x20sent');logger['debug'](_0x60ec('0xf'),_0x5d4cba,_0x60ec('0x10'),JSON[_0x60ec('0x11')](_0x1363c2));if(_0x1363c2[_0x60ec('0x12')]){if(_0x1363c2[_0x60ec('0x12')]['code']===0x1f4){logger['error'](_0x60ec('0xe'),_0x5d4cba,_0x1363c2[_0x60ec('0x12')][_0x60ec('0x13')]);return _0x2c4a14(_0x1363c2[_0x60ec('0x12')][_0x60ec('0x13')]);}logger['error'](_0x60ec('0xe'),_0x5d4cba,_0x1363c2[_0x60ec('0x12')][_0x60ec('0x13')]);return _0x488ab8(_0x1363c2[_0x60ec('0x12')][_0x60ec('0x13')]);}else{logger[_0x60ec('0xd')](_0x60ec('0xe'),_0x5d4cba,_0x60ec('0x10'));_0x488ab8(_0x1363c2[_0x60ec('0x14')]['message']);}})[_0x60ec('0x15')](function(_0x2778dd){logger[_0x60ec('0x12')](_0x60ec('0xe'),_0x5d4cba,_0x2778dd);_0x2c4a14(_0x2778dd);});});} \ No newline at end of file +var _0x9576=['client','request','info','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','OpenchannelTransferReport,\x20%s,\x20%s','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x378fa0,_0x2fbd5d){var _0x396270=function(_0x3c610f){while(--_0x3c610f){_0x378fa0['push'](_0x378fa0['shift']());}};_0x396270(++_0x2fbd5d);}(_0x9576,0x182));var _0x6957=function(_0x46a376,_0x29af0b){_0x46a376=_0x46a376-0x0;var _0x2356fd=_0x9576[_0x46a376];return _0x2356fd;};'use strict';var _=require(_0x6957('0x0'));var util=require(_0x6957('0x1'));var moment=require(_0x6957('0x2'));var BPromise=require(_0x6957('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6957('0x4'))['db'];var utils=require(_0x6957('0x5'));var logger=require(_0x6957('0x6'))(_0x6957('0x7'));var config=require(_0x6957('0x8'));var jayson=require(_0x6957('0x9'));var client=jayson[_0x6957('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6d8af8,_0x3425fe,_0x70b8c4){return new BPromise(function(_0x2e5727,_0x6397fe){return client[_0x6957('0xb')](_0x6d8af8,_0x70b8c4)['then'](function(_0x28a4c6){logger[_0x6957('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3425fe,'request\x20sent');logger[_0x6957('0xd')](_0x6957('0xe'),_0x3425fe,_0x6957('0xf'),JSON[_0x6957('0x10')](_0x28a4c6));if(_0x28a4c6[_0x6957('0x11')]){if(_0x28a4c6[_0x6957('0x11')][_0x6957('0x12')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x3425fe,_0x28a4c6['error'][_0x6957('0x13')]);return _0x6397fe(_0x28a4c6[_0x6957('0x11')][_0x6957('0x13')]);}logger[_0x6957('0x11')](_0x6957('0x14'),_0x3425fe,_0x28a4c6[_0x6957('0x11')][_0x6957('0x13')]);return _0x2e5727(_0x28a4c6['error']['message']);}else{logger['info'](_0x6957('0x14'),_0x3425fe,_0x6957('0xf'));_0x2e5727(_0x28a4c6[_0x6957('0x15')][_0x6957('0x13')]);}})['catch'](function(_0x14422d){logger['error'](_0x6957('0x14'),_0x3425fe,_0x14422d);_0x6397fe(_0x14422d);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 16d84ca..20cf8f1 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 _0x8529=['delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id','create'];(function(_0x560448,_0x2c1082){var _0x550276=function(_0x37e949){while(--_0x37e949){_0x560448['push'](_0x560448['shift']());}};_0x550276(++_0x2c1082);}(_0x8529,0x73));var _0x9852=function(_0x1491d9,_0x5823a2){_0x1491d9=_0x1491d9-0x0;var _0x12742c=_0x8529[_0x1491d9];return _0x12742c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9852('0x0'));var timeout=require(_0x9852('0x1'));var express=require(_0x9852('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9852('0x3'));var interaction=require(_0x9852('0x4'));var config=require(_0x9852('0x5'));var controller=require(_0x9852('0x6'));router[_0x9852('0x7')]('/',auth[_0x9852('0x8')](),controller['index']);router['get'](_0x9852('0x9'),auth[_0x9852('0x8')](),controller['show']);router['post']('/',auth[_0x9852('0x8')](),controller[_0x9852('0xa')]);router['put'](_0x9852('0x9'),auth[_0x9852('0x8')](),controller['update']);router[_0x9852('0xb')]('/:id',auth[_0x9852('0x8')](),controller[_0x9852('0xc')]);module[_0x9852('0xd')]=router; \ No newline at end of file +var _0xb522=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x35424f,_0x58b79f){var _0x380a86=function(_0x3ae8c8){while(--_0x3ae8c8){_0x35424f['push'](_0x35424f['shift']());}};_0x380a86(++_0x58b79f);}(_0xb522,0x1ce));var _0x2b52=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb522[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x2b52('0x0'));var util=require('util');var path=require(_0x2b52('0x1'));var timeout=require(_0x2b52('0x2'));var express=require(_0x2b52('0x3'));var router=express[_0x2b52('0x4')]();var fs_extra=require(_0x2b52('0x5'));var auth=require(_0x2b52('0x6'));var interaction=require(_0x2b52('0x7'));var config=require(_0x2b52('0x8'));var controller=require('./pause.controller');router[_0x2b52('0x9')]('/',auth[_0x2b52('0xa')](),controller['index']);router[_0x2b52('0x9')](_0x2b52('0xb'),auth[_0x2b52('0xa')](),controller['show']);router['post']('/',auth[_0x2b52('0xa')](),controller[_0x2b52('0xc')]);router[_0x2b52('0xd')](_0x2b52('0xb'),auth[_0x2b52('0xa')](),controller[_0x2b52('0xe')]);router[_0x2b52('0xf')](_0x2b52('0xb'),auth[_0x2b52('0xa')](),controller[_0x2b52('0x10')]);module[_0x2b52('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index b7d80ed..05df932 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 _0x7f93=['exports','STRING','name','sequelize'];(function(_0x1f55f9,_0xf5c554){var _0x885614=function(_0x9747d3){while(--_0x9747d3){_0x1f55f9['push'](_0x1f55f9['shift']());}};_0x885614(++_0xf5c554);}(_0x7f93,0x157));var _0x37f9=function(_0x20da10,_0x50b31d){_0x20da10=_0x20da10-0x0;var _0x3c175b=_0x7f93[_0x20da10];return _0x3c175b;};'use strict';var Sequelize=require(_0x37f9('0x0'));module[_0x37f9('0x1')]={'name':{'type':Sequelize[_0x37f9('0x2')],'unique':_0x37f9('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb351=['name','sequelize','exports','STRING'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0xb351,0x17d));var _0x1b35=function(_0x296666,_0xc1fb98){_0x296666=_0x296666-0x0;var _0x1278ef=_0xb351[_0x296666];return _0x1278ef;};'use strict';var Sequelize=require(_0x1b35('0x0'));module[_0x1b35('0x1')]={'name':{'type':Sequelize[_0x1b35('0x2')],'unique':_0x1b35('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x1b35('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index ac6b912..b21f336 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 _0xe2a3=['nolimit','limit','order','where','pick','filter','VIRTUAL','merge','include','rows','catch','includeAll','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xe2a3,0xbf));var _0x3e2a=function(_0x209e81,_0x40d7a1){_0x209e81=_0x209e81-0x0;var _0x18ad00=_0xe2a3[_0x209e81];return _0x18ad00;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e2a('0x0'));var zipdir=require(_0x3e2a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3e2a('0x2'));var BPromise=require(_0x3e2a('0x3'));var Mustache=require(_0x3e2a('0x4'));var util=require('util');var path=require(_0x3e2a('0x5'));var sox=require(_0x3e2a('0x6'));var csv=require('to-csv');var ejs=require(_0x3e2a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3e2a('0x8'));var squel=require(_0x3e2a('0x9'));var crypto=require(_0x3e2a('0xa'));var jsforce=require(_0x3e2a('0xb'));var deskjs=require(_0x3e2a('0xc'));var toCsv=require(_0x3e2a('0xd'));var querystring=require('querystring');var Papa=require(_0x3e2a('0xe'));var Redis=require(_0x3e2a('0xf'));var authService=require(_0x3e2a('0x10'));var qs=require(_0x3e2a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e2a('0x12'));var logger=require('../../config/logger')(_0x3e2a('0x13'));var utils=require(_0x3e2a('0x14'));var config=require(_0x3e2a('0x15'));var licenseUtil=require(_0x3e2a('0x16'));var db=require(_0x3e2a('0x17'))['db'];function respondWithStatusCode(_0x5097d6,_0x144bc8){_0x144bc8=_0x144bc8||0xcc;return function(_0x275812){if(_0x275812){return _0x5097d6['sendStatus'](_0x144bc8);}return _0x5097d6[_0x3e2a('0x18')](_0x144bc8)['end']();};}function respondWithResult(_0x36fcb1,_0x729fca){_0x729fca=_0x729fca||0xc8;return function(_0x49d648){if(_0x49d648){return _0x36fcb1[_0x3e2a('0x18')](_0x729fca)['json'](_0x49d648);}};}function respondWithFilteredResult(_0x2e25d0,_0x165e0c){return function(_0x5f5e41){if(_0x5f5e41){var _0x158e67=typeof _0x165e0c[_0x3e2a('0x19')]===_0x3e2a('0x1a')&&typeof _0x165e0c['limit']==='undefined';var _0x2d79fe=_0x5f5e41['count'];var _0x3b1e5b=_0x158e67?0x0:_0x165e0c[_0x3e2a('0x19')];var _0x387e98=_0x158e67?_0x5f5e41[_0x3e2a('0x1b')]:_0x165e0c[_0x3e2a('0x19')]+_0x165e0c['limit'];var _0x22ee32;if(_0x387e98>=_0x2d79fe){_0x387e98=_0x2d79fe;_0x22ee32=0xc8;}else{_0x22ee32=0xce;}_0x2e25d0[_0x3e2a('0x18')](_0x22ee32);return _0x2e25d0[_0x3e2a('0x1c')](_0x3e2a('0x1d'),_0x3b1e5b+'-'+_0x387e98+'/'+_0x2d79fe)[_0x3e2a('0x1e')](_0x5f5e41);}return null;};}function patchUpdates(_0xc9e75b){return function(_0x17c24a){try{jsonpatch[_0x3e2a('0x1f')](_0x17c24a,_0xc9e75b,!![]);}catch(_0x586bf4){return BPromise[_0x3e2a('0x20')](_0x586bf4);}return _0x17c24a[_0x3e2a('0x21')]();};}function saveUpdates(_0x5b9c81,_0x2a8028){return function(_0x73f320){if(_0x73f320){return _0x73f320[_0x3e2a('0x22')](_0x5b9c81)[_0x3e2a('0x23')](function(_0x4b371a){return _0x4b371a;});}return null;};}function removeEntity(_0x315266,_0x132277){return function(_0x2d1cc2){if(_0x2d1cc2){return _0x2d1cc2[_0x3e2a('0x24')]()[_0x3e2a('0x23')](function(){var _0x17ffe5=_0x2d1cc2[_0x3e2a('0x25')]({'plain':!![]});var _0x450085='Pauses';return db[_0x3e2a('0x26')][_0x3e2a('0x24')]({'where':{'type':_0x450085,'resourceId':_0x17ffe5['id']}})[_0x3e2a('0x23')](function(){return _0x2d1cc2;});})['then'](function(){_0x315266[_0x3e2a('0x18')](0xcc)[_0x3e2a('0x27')]();});}};}function handleEntityNotFound(_0x4abd87,_0x2f32cd){return function(_0x16acbf){if(!_0x16acbf){_0x4abd87[_0x3e2a('0x28')](0x194);}return _0x16acbf;};}function handleError(_0x6fb4e,_0x2b847a){_0x2b847a=_0x2b847a||0x1f4;return function(_0x1f4dee){logger[_0x3e2a('0x29')](_0x1f4dee[_0x3e2a('0x2a')]);if(_0x1f4dee[_0x3e2a('0x2b')]){delete _0x1f4dee[_0x3e2a('0x2b')];}_0x6fb4e['status'](_0x2b847a)[_0x3e2a('0x2c')](_0x1f4dee);};}exports[_0x3e2a('0x2d')]=function(_0x4e97d2,_0x43fb20){var _0x4cef5d={},_0x3f2594={},_0x42f00b={'count':0x0,'rows':[]};var _0x189993=_[_0x3e2a('0x2e')](db[_0x3e2a('0x2f')][_0x3e2a('0x30')],function(_0x574031){return{'name':_0x574031[_0x3e2a('0x31')],'type':_0x574031[_0x3e2a('0x32')][_0x3e2a('0x33')]};});_0x3f2594['model']=_[_0x3e2a('0x2e')](_0x189993,'name');_0x3f2594[_0x3e2a('0x34')]=_[_0x3e2a('0x35')](_0x4e97d2[_0x3e2a('0x34')]);_0x3f2594[_0x3e2a('0x36')]=_[_0x3e2a('0x37')](_0x3f2594[_0x3e2a('0x38')],_0x3f2594[_0x3e2a('0x34')]);_0x4cef5d[_0x3e2a('0x39')]=_[_0x3e2a('0x37')](_0x3f2594[_0x3e2a('0x38')],qs[_0x3e2a('0x3a')](_0x4e97d2[_0x3e2a('0x34')]['fields']));_0x4cef5d[_0x3e2a('0x39')]=_0x4cef5d[_0x3e2a('0x39')][_0x3e2a('0x3b')]?_0x4cef5d[_0x3e2a('0x39')]:_0x3f2594[_0x3e2a('0x38')];if(!_0x4e97d2[_0x3e2a('0x34')][_0x3e2a('0x3c')](_0x3e2a('0x3d'))){_0x4cef5d['limit']=qs[_0x3e2a('0x3e')](_0x4e97d2[_0x3e2a('0x34')][_0x3e2a('0x3e')]);_0x4cef5d[_0x3e2a('0x19')]=qs[_0x3e2a('0x19')](_0x4e97d2[_0x3e2a('0x34')][_0x3e2a('0x19')]);}_0x4cef5d[_0x3e2a('0x3f')]=qs['sort'](_0x4e97d2[_0x3e2a('0x34')]['sort']);_0x4cef5d[_0x3e2a('0x40')]=qs[_0x3e2a('0x36')](_[_0x3e2a('0x41')](_0x4e97d2[_0x3e2a('0x34')],_0x3f2594[_0x3e2a('0x36')]),_0x189993);if(_0x4e97d2[_0x3e2a('0x34')][_0x3e2a('0x42')]){_0x4cef5d[_0x3e2a('0x40')]=_['merge'](_0x4cef5d[_0x3e2a('0x40')],{'$or':_[_0x3e2a('0x2e')](_0x189993,function(_0xb72d42){if(_0xb72d42['type']!==_0x3e2a('0x43')){var _0x2b9af1={};_0x2b9af1[_0xb72d42['name']]={'$like':'%'+_0x4e97d2[_0x3e2a('0x34')][_0x3e2a('0x42')]+'%'};return _0x2b9af1;}})});}_0x4cef5d=_[_0x3e2a('0x44')]({},_0x4cef5d,_0x4e97d2['options']);var _0x48a1cc={'where':_0x4cef5d[_0x3e2a('0x40')]};return db[_0x3e2a('0x2f')]['count'](_0x48a1cc)[_0x3e2a('0x23')](function(_0x481b72){_0x42f00b[_0x3e2a('0x1b')]=_0x481b72;if(_0x4e97d2[_0x3e2a('0x34')]['includeAll']){_0x4cef5d[_0x3e2a('0x45')]=[{'all':!![]}];}return db[_0x3e2a('0x2f')]['findAll'](_0x4cef5d);})['then'](function(_0x36e8c4){_0x42f00b[_0x3e2a('0x46')]=_0x36e8c4;return _0x42f00b;})[_0x3e2a('0x23')](respondWithFilteredResult(_0x43fb20,_0x4cef5d))[_0x3e2a('0x47')](handleError(_0x43fb20,null));};exports['show']=function(_0x2d9652,_0x124af0){var _0x1fcc36={'raw':!![],'where':{'id':_0x2d9652['params']['id']}},_0x11cd63={};_0x11cd63[_0x3e2a('0x38')]=_['keys'](db[_0x3e2a('0x2f')][_0x3e2a('0x30')]);_0x11cd63[_0x3e2a('0x34')]=_[_0x3e2a('0x35')](_0x2d9652[_0x3e2a('0x34')]);_0x11cd63[_0x3e2a('0x36')]=_[_0x3e2a('0x37')](_0x11cd63[_0x3e2a('0x38')],_0x11cd63[_0x3e2a('0x34')]);_0x1fcc36['attributes']=_[_0x3e2a('0x37')](_0x11cd63[_0x3e2a('0x38')],qs[_0x3e2a('0x3a')](_0x2d9652[_0x3e2a('0x34')][_0x3e2a('0x3a')]));_0x1fcc36[_0x3e2a('0x39')]=_0x1fcc36[_0x3e2a('0x39')]['length']?_0x1fcc36[_0x3e2a('0x39')]:_0x11cd63[_0x3e2a('0x38')];if(_0x2d9652[_0x3e2a('0x34')][_0x3e2a('0x48')]){_0x1fcc36[_0x3e2a('0x45')]=[{'all':!![]}];}_0x1fcc36=_[_0x3e2a('0x44')]({},_0x1fcc36,_0x2d9652[_0x3e2a('0x49')]);return db[_0x3e2a('0x2f')][_0x3e2a('0x4a')](_0x1fcc36)['then'](handleEntityNotFound(_0x124af0,null))[_0x3e2a('0x23')](respondWithResult(_0x124af0,null))[_0x3e2a('0x47')](handleError(_0x124af0,null));};exports[_0x3e2a('0x4b')]=function(_0x4b222e,_0x14e535){return db[_0x3e2a('0x2f')][_0x3e2a('0x4b')](_0x4b222e[_0x3e2a('0x4c')],{})[_0x3e2a('0x23')](function(_0x19abb2){var _0x2443aa=_0x4b222e[_0x3e2a('0x4d')][_0x3e2a('0x25')]({'plain':!![]});if(!_0x2443aa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2443aa[_0x3e2a('0x4e')]===_0x3e2a('0x4d')){var _0x474985=_0x19abb2[_0x3e2a('0x25')]({'plain':!![]});var _0x269b40='Pauses';return db[_0x3e2a('0x4f')][_0x3e2a('0x4a')]({'where':{'name':_0x269b40,'userProfileId':_0x2443aa[_0x3e2a('0x50')]},'raw':!![]})['then'](function(_0x517659){if(_0x517659&&_0x517659[_0x3e2a('0x51')]===0x0){return db[_0x3e2a('0x26')][_0x3e2a('0x4b')]({'name':_0x474985[_0x3e2a('0x2b')],'resourceId':_0x474985['id'],'type':_0x517659[_0x3e2a('0x2b')],'sectionId':_0x517659['id']},{})[_0x3e2a('0x23')](function(){return _0x19abb2;});}else{return _0x19abb2;}})['catch'](function(_0x450194){logger[_0x3e2a('0x29')](_0x3e2a('0x52'),_0x450194);throw _0x450194;});}return _0x19abb2;})[_0x3e2a('0x23')](respondWithResult(_0x14e535,0xc9))['catch'](handleError(_0x14e535,null));};exports[_0x3e2a('0x22')]=function(_0x3f8da7,_0x1800a7){if(_0x3f8da7[_0x3e2a('0x4c')]['id']){delete _0x3f8da7[_0x3e2a('0x4c')]['id'];}return db['Pause']['find']({'where':{'id':_0x3f8da7[_0x3e2a('0x53')]['id']}})['then'](handleEntityNotFound(_0x1800a7,null))[_0x3e2a('0x23')](saveUpdates(_0x3f8da7['body'],null))[_0x3e2a('0x23')](respondWithResult(_0x1800a7,null))['catch'](handleError(_0x1800a7,null));};exports[_0x3e2a('0x24')]=function(_0x3c6b94,_0x56bcaa){return db[_0x3e2a('0x2f')]['find']({'where':{'id':_0x3c6b94['params']['id']}})['then'](handleEntityNotFound(_0x56bcaa,null))[_0x3e2a('0x23')](removeEntity(_0x56bcaa,null))[_0x3e2a('0x47')](handleError(_0x56bcaa,null));}; \ No newline at end of file +var _0xcc3a=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','Content-Range','apply','save','update','then','destroy','Pauses','error','stack','name','send','index','map','Pause','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','keys','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x294f16,_0x4832d9){var _0x263204=function(_0x346be3){while(--_0x346be3){_0x294f16['push'](_0x294f16['shift']());}};_0x263204(++_0x4832d9);}(_0xcc3a,0x17a));var _0xacc3=function(_0x287a47,_0x2f731c){_0x287a47=_0x287a47-0x0;var _0x3fb726=_0xcc3a[_0x287a47];return _0x3fb726;};'use strict';var emlformat=require(_0xacc3('0x0'));var rimraf=require(_0xacc3('0x1'));var zipdir=require(_0xacc3('0x2'));var jsonpatch=require(_0xacc3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xacc3('0x4'));var sox=require(_0xacc3('0x5'));var csv=require('to-csv');var ejs=require(_0xacc3('0x6'));var fs=require('fs');var fs_extra=require(_0xacc3('0x7'));var _=require('lodash');var squel=require(_0xacc3('0x8'));var crypto=require(_0xacc3('0x9'));var jsforce=require(_0xacc3('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xacc3('0xb'));var Papa=require(_0xacc3('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xacc3('0xd'));var as=require(_0xacc3('0xe'));var hardwareService=require(_0xacc3('0xf'));var logger=require(_0xacc3('0x10'))(_0xacc3('0x11'));var utils=require('../../config/utils');var config=require(_0xacc3('0x12'));var licenseUtil=require(_0xacc3('0x13'));var db=require(_0xacc3('0x14'))['db'];function respondWithStatusCode(_0x498fe5,_0x448dc8){_0x448dc8=_0x448dc8||0xcc;return function(_0x10aa56){if(_0x10aa56){return _0x498fe5[_0xacc3('0x15')](_0x448dc8);}return _0x498fe5['status'](_0x448dc8)[_0xacc3('0x16')]();};}function respondWithResult(_0x2dc031,_0x4f113f){_0x4f113f=_0x4f113f||0xc8;return function(_0x553cb6){if(_0x553cb6){return _0x2dc031['status'](_0x4f113f)[_0xacc3('0x17')](_0x553cb6);}};}function respondWithFilteredResult(_0x2f380f,_0x11adeb){return function(_0x38c364){if(_0x38c364){var _0x5d357f=typeof _0x11adeb['offset']==='undefined'&&typeof _0x11adeb[_0xacc3('0x18')]===_0xacc3('0x19');var _0x3f8fb0=_0x38c364[_0xacc3('0x1a')];var _0x139e89=_0x5d357f?0x0:_0x11adeb['offset'];var _0x24ee4d=_0x5d357f?_0x38c364[_0xacc3('0x1a')]:_0x11adeb[_0xacc3('0x1b')]+_0x11adeb[_0xacc3('0x18')];var _0x4e27a0;if(_0x24ee4d>=_0x3f8fb0){_0x24ee4d=_0x3f8fb0;_0x4e27a0=0xc8;}else{_0x4e27a0=0xce;}_0x2f380f[_0xacc3('0x1c')](_0x4e27a0);return _0x2f380f['set'](_0xacc3('0x1d'),_0x139e89+'-'+_0x24ee4d+'/'+_0x3f8fb0)[_0xacc3('0x17')](_0x38c364);}return null;};}function patchUpdates(_0x3d4827){return function(_0x140ccb){try{jsonpatch[_0xacc3('0x1e')](_0x140ccb,_0x3d4827,!![]);}catch(_0x1fe633){return BPromise['reject'](_0x1fe633);}return _0x140ccb[_0xacc3('0x1f')]();};}function saveUpdates(_0x5a1a28,_0x1560e8){return function(_0x1294e5){if(_0x1294e5){return _0x1294e5[_0xacc3('0x20')](_0x5a1a28)[_0xacc3('0x21')](function(_0x4240ba){return _0x4240ba;});}return null;};}function removeEntity(_0x1badc5,_0x35c409){return function(_0x2f9a67){if(_0x2f9a67){return _0x2f9a67[_0xacc3('0x22')]()['then'](function(){var _0x46e5a1=_0x2f9a67['get']({'plain':!![]});var _0x57e2db=_0xacc3('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x57e2db,'resourceId':_0x46e5a1['id']}})['then'](function(){return _0x2f9a67;});})[_0xacc3('0x21')](function(){_0x1badc5[_0xacc3('0x1c')](0xcc)[_0xacc3('0x16')]();});}};}function handleEntityNotFound(_0x5590ae,_0x284767){return function(_0x545da9){if(!_0x545da9){_0x5590ae['sendStatus'](0x194);}return _0x545da9;};}function handleError(_0x4f3d3e,_0x1520d3){_0x1520d3=_0x1520d3||0x1f4;return function(_0x5c0e27){logger[_0xacc3('0x24')](_0x5c0e27[_0xacc3('0x25')]);if(_0x5c0e27[_0xacc3('0x26')]){delete _0x5c0e27[_0xacc3('0x26')];}_0x4f3d3e['status'](_0x1520d3)[_0xacc3('0x27')](_0x5c0e27);};}exports[_0xacc3('0x28')]=function(_0x2da619,_0x1c41c0){var _0xf32ca1={},_0x53505d={},_0x327087={'count':0x0,'rows':[]};var _0x5c980c=_[_0xacc3('0x29')](db[_0xacc3('0x2a')]['rawAttributes'],function(_0xc68627){return{'name':_0xc68627[_0xacc3('0x2b')],'type':_0xc68627[_0xacc3('0x2c')]['key']};});_0x53505d[_0xacc3('0x2d')]=_[_0xacc3('0x29')](_0x5c980c,_0xacc3('0x26'));_0x53505d['query']=_['keys'](_0x2da619[_0xacc3('0x2e')]);_0x53505d[_0xacc3('0x2f')]=_[_0xacc3('0x30')](_0x53505d[_0xacc3('0x2d')],_0x53505d[_0xacc3('0x2e')]);_0xf32ca1[_0xacc3('0x31')]=_['intersection'](_0x53505d[_0xacc3('0x2d')],qs[_0xacc3('0x32')](_0x2da619[_0xacc3('0x2e')][_0xacc3('0x32')]));_0xf32ca1[_0xacc3('0x31')]=_0xf32ca1[_0xacc3('0x31')]['length']?_0xf32ca1[_0xacc3('0x31')]:_0x53505d['model'];if(!_0x2da619['query'][_0xacc3('0x33')](_0xacc3('0x34'))){_0xf32ca1[_0xacc3('0x18')]=qs[_0xacc3('0x18')](_0x2da619[_0xacc3('0x2e')]['limit']);_0xf32ca1[_0xacc3('0x1b')]=qs[_0xacc3('0x1b')](_0x2da619['query']['offset']);}_0xf32ca1[_0xacc3('0x35')]=qs[_0xacc3('0x36')](_0x2da619[_0xacc3('0x2e')][_0xacc3('0x36')]);_0xf32ca1[_0xacc3('0x37')]=qs[_0xacc3('0x2f')](_[_0xacc3('0x38')](_0x2da619[_0xacc3('0x2e')],_0x53505d[_0xacc3('0x2f')]),_0x5c980c);if(_0x2da619[_0xacc3('0x2e')][_0xacc3('0x39')]){_0xf32ca1[_0xacc3('0x37')]=_[_0xacc3('0x3a')](_0xf32ca1[_0xacc3('0x37')],{'$or':_[_0xacc3('0x29')](_0x5c980c,function(_0x4ef7d1){if(_0x4ef7d1[_0xacc3('0x2c')]!=='VIRTUAL'){var _0x281c3f={};_0x281c3f[_0x4ef7d1[_0xacc3('0x26')]]={'$like':'%'+_0x2da619[_0xacc3('0x2e')][_0xacc3('0x39')]+'%'};return _0x281c3f;}})});}_0xf32ca1=_[_0xacc3('0x3a')]({},_0xf32ca1,_0x2da619[_0xacc3('0x3b')]);var _0x29a8db={'where':_0xf32ca1['where']};return db[_0xacc3('0x2a')][_0xacc3('0x1a')](_0x29a8db)[_0xacc3('0x21')](function(_0x14ddad){_0x327087[_0xacc3('0x1a')]=_0x14ddad;if(_0x2da619['query'][_0xacc3('0x3c')]){_0xf32ca1[_0xacc3('0x3d')]=[{'all':!![]}];}return db[_0xacc3('0x2a')][_0xacc3('0x3e')](_0xf32ca1);})[_0xacc3('0x21')](function(_0x55ec16){_0x327087[_0xacc3('0x3f')]=_0x55ec16;return _0x327087;})['then'](respondWithFilteredResult(_0x1c41c0,_0xf32ca1))['catch'](handleError(_0x1c41c0,null));};exports[_0xacc3('0x40')]=function(_0x334ff4,_0x598a29){var _0x163fa3={'raw':!![],'where':{'id':_0x334ff4['params']['id']}},_0x10c42b={};_0x10c42b[_0xacc3('0x2d')]=_[_0xacc3('0x41')](db[_0xacc3('0x2a')][_0xacc3('0x42')]);_0x10c42b['query']=_['keys'](_0x334ff4['query']);_0x10c42b[_0xacc3('0x2f')]=_[_0xacc3('0x30')](_0x10c42b[_0xacc3('0x2d')],_0x10c42b[_0xacc3('0x2e')]);_0x163fa3['attributes']=_[_0xacc3('0x30')](_0x10c42b[_0xacc3('0x2d')],qs[_0xacc3('0x32')](_0x334ff4[_0xacc3('0x2e')]['fields']));_0x163fa3['attributes']=_0x163fa3[_0xacc3('0x31')]['length']?_0x163fa3['attributes']:_0x10c42b[_0xacc3('0x2d')];if(_0x334ff4[_0xacc3('0x2e')][_0xacc3('0x3c')]){_0x163fa3[_0xacc3('0x3d')]=[{'all':!![]}];}_0x163fa3=_[_0xacc3('0x3a')]({},_0x163fa3,_0x334ff4['options']);return db[_0xacc3('0x2a')]['find'](_0x163fa3)[_0xacc3('0x21')](handleEntityNotFound(_0x598a29,null))['then'](respondWithResult(_0x598a29,null))['catch'](handleError(_0x598a29,null));};exports[_0xacc3('0x43')]=function(_0x36b69f,_0x203f66){return db[_0xacc3('0x2a')]['create'](_0x36b69f[_0xacc3('0x44')],{})[_0xacc3('0x21')](function(_0xe27388){var _0x2c3450=_0x36b69f[_0xacc3('0x45')][_0xacc3('0x46')]({'plain':!![]});if(!_0x2c3450)throw new Error(_0xacc3('0x47'));if(_0x2c3450['role']===_0xacc3('0x45')){var _0x732632=_0xe27388['get']({'plain':!![]});var _0x2d2c8f=_0xacc3('0x23');return db[_0xacc3('0x48')][_0xacc3('0x49')]({'where':{'name':_0x2d2c8f,'userProfileId':_0x2c3450[_0xacc3('0x4a')]},'raw':!![]})[_0xacc3('0x21')](function(_0x84028f){if(_0x84028f&&_0x84028f['autoAssociation']===0x0){return db[_0xacc3('0x4b')]['create']({'name':_0x732632[_0xacc3('0x26')],'resourceId':_0x732632['id'],'type':_0x84028f['name'],'sectionId':_0x84028f['id']},{})[_0xacc3('0x21')](function(){return _0xe27388;});}else{return _0xe27388;}})['catch'](function(_0x2cd5ea){logger[_0xacc3('0x24')](_0xacc3('0x4c'),_0x2cd5ea);throw _0x2cd5ea;});}return _0xe27388;})[_0xacc3('0x21')](respondWithResult(_0x203f66,0xc9))[_0xacc3('0x4d')](handleError(_0x203f66,null));};exports[_0xacc3('0x20')]=function(_0x45407d,_0x5e327c){if(_0x45407d[_0xacc3('0x44')]['id']){delete _0x45407d['body']['id'];}return db[_0xacc3('0x2a')][_0xacc3('0x49')]({'where':{'id':_0x45407d[_0xacc3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5e327c,null))['then'](saveUpdates(_0x45407d[_0xacc3('0x44')],null))[_0xacc3('0x21')](respondWithResult(_0x5e327c,null))[_0xacc3('0x4d')](handleError(_0x5e327c,null));};exports[_0xacc3('0x22')]=function(_0x573b04,_0x2329fd){return db[_0xacc3('0x2a')][_0xacc3('0x49')]({'where':{'id':_0x573b04[_0xacc3('0x4e')]['id']}})[_0xacc3('0x21')](handleEntityNotFound(_0x2329fd,null))[_0xacc3('0x21')](removeEntity(_0x2329fd,null))[_0xacc3('0x4d')](handleError(_0x2329fd,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index df73b12..4bba7e7 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 _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x7217,0x19e));var _0x7721=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x7217[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 8223456..0876ae0 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(_0x59ed0b,_0x41cac3){var _0x542c92=function(_0x314f88){while(--_0x314f88){_0x59ed0b['push'](_0x59ed0b['shift']());}};_0x542c92(++_0x41cac3);}(_0x7a54,0x106));var _0x47a5=function(_0x46bba4,_0x1db7b3){_0x46bba4=_0x46bba4-0x0;var _0x2e3c43=_0x7a54[_0x46bba4];return _0x2e3c43;};'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(_0x3e05d9,_0x269883){var _0x4cdfdd=function(_0x56b820){while(--_0x56b820){_0x3e05d9['push'](_0x3e05d9['shift']());}};_0x4cdfdd(++_0x269883);}(_0xb10b,0x12a));var _0xbb10=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xb10b[_0x6cf19c];return _0xce14f3;};'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 c05bd56..681a87c 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 _0x9f62=['extname','now','post','single','file','upload','put','/:id','delete','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id/download','isAuthenticated','join','root','originalname','replace','format','%s-%s%s','basename'];(function(_0x936928,_0x143cb7){var _0x47cb23=function(_0x4868f8){while(--_0x4868f8){_0x936928['push'](_0x936928['shift']());}};_0x47cb23(++_0x143cb7);}(_0x9f62,0x154));var _0x29f6=function(_0x20ed11,_0x337c2c){_0x20ed11=_0x20ed11-0x0;var _0x5308cc=_0x9f62[_0x20ed11];return _0x5308cc;};'use strict';var multer=require('multer');var util=require(_0x29f6('0x0'));var path=require('path');var timeout=require(_0x29f6('0x1'));var express=require(_0x29f6('0x2'));var router=express[_0x29f6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var controller=require(_0x29f6('0x6'));router[_0x29f6('0x7')]('/',auth['isAuthenticated'](),controller[_0x29f6('0x8')]);router[_0x29f6('0x7')](_0x29f6('0x9'),controller[_0x29f6('0xa')]);router[_0x29f6('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x29f6('0xb'),auth[_0x29f6('0xc')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x29b3f5,_0x442623,_0x4909e0){_0x4909e0(null,path[_0x29f6('0xd')](config[_0x29f6('0xe')],'server/files/plugins'));},'filename':function(_0x5b9b6a,_0x559585,_0x57b2d2){_0x559585[_0x29f6('0xf')]=_0x559585[_0x29f6('0xf')][_0x29f6('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x57b2d2(null,util[_0x29f6('0x11')](_0x29f6('0x12'),path[_0x29f6('0x13')](_0x559585[_0x29f6('0xf')],path[_0x29f6('0x14')](_0x559585[_0x29f6('0xf')])),Date[_0x29f6('0x15')](),path[_0x29f6('0x14')](_0x559585[_0x29f6('0xf')])));}})});router[_0x29f6('0x16')]('/',upload[_0x29f6('0x17')](_0x29f6('0x18')),controller[_0x29f6('0x19')]);router[_0x29f6('0x16')]('/webhook',controller['webhookPost']);router[_0x29f6('0x1a')](_0x29f6('0x1b'),auth[_0x29f6('0xc')](),controller['update']);router[_0x29f6('0x1c')](_0x29f6('0x1b'),auth['isAuthenticated'](),controller[_0x29f6('0x1c')]);module[_0x29f6('0x1d')]=router; \ No newline at end of file +var _0x4c4e=['webhookGet','/:id','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','basename','now','extname','post','single','file','upload','webhookPost','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','index','get','/webhook'];(function(_0x1ba2c0,_0x2f4cc9){var _0x33f8ce=function(_0x284d17){while(--_0x284d17){_0x1ba2c0['push'](_0x1ba2c0['shift']());}};_0x33f8ce(++_0x2f4cc9);}(_0x4c4e,0x152));var _0xe4c4=function(_0xc9eaee,_0x51bb00){_0xc9eaee=_0xc9eaee-0x0;var _0x479b47=_0x4c4e[_0xc9eaee];return _0x479b47;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var fs_extra=require(_0xe4c4('0x4'));var auth=require(_0xe4c4('0x5'));var interaction=require(_0xe4c4('0x6'));var config=require('../../config/environment');var controller=require(_0xe4c4('0x7'));router['get']('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x9')]);router[_0xe4c4('0xa')](_0xe4c4('0xb'),controller[_0xe4c4('0xc')]);router[_0xe4c4('0xa')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller['show']);router['get'](_0xe4c4('0xe'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xf')]);var upload=multer({'storage':multer[_0xe4c4('0x10')]({'destination':function(_0x333c08,_0x2f4d5f,_0x50264f){_0x50264f(null,path[_0xe4c4('0x11')](config[_0xe4c4('0x12')],_0xe4c4('0x13')));},'filename':function(_0x2483d0,_0x50bfab,_0x262083){_0x50bfab[_0xe4c4('0x14')]=_0x50bfab['originalname'][_0xe4c4('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x262083(null,util[_0xe4c4('0x16')]('%s-%s%s',path[_0xe4c4('0x17')](_0x50bfab[_0xe4c4('0x14')],path['extname'](_0x50bfab[_0xe4c4('0x14')])),Date[_0xe4c4('0x18')](),path[_0xe4c4('0x19')](_0x50bfab[_0xe4c4('0x14')])));}})});router[_0xe4c4('0x1a')]('/',upload[_0xe4c4('0x1b')](_0xe4c4('0x1c')),controller[_0xe4c4('0x1d')]);router[_0xe4c4('0x1a')](_0xe4c4('0xb'),controller[_0xe4c4('0x1e')]);router[_0xe4c4('0x1f')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x20')]);router['delete'](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x21')]);module[_0xe4c4('0x22')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index e151cba..ffbaee9 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 _0x9d74=['TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','html'];(function(_0x188371,_0x3029c2){var _0x56d466=function(_0x28f925){while(--_0x28f925){_0x188371['push'](_0x188371['shift']());}};_0x56d466(++_0x3029c2);}(_0x9d74,0x17e));var _0x49d7=function(_0x16e0c8,_0x4861eb){_0x16e0c8=_0x16e0c8-0x0;var _0xe4b5af=_0x9d74[_0x16e0c8];return _0xe4b5af;};'use strict';var Sequelize=require('sequelize');module[_0x49d7('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x49d7('0x1'),'script')},'description':{'type':Sequelize[_0x49d7('0x2')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x49d7('0x3')],'comment':_0x49d7('0x4')},'active':{'type':Sequelize[_0x49d7('0x5')],'defaultValue':0x0,'comment':_0x49d7('0x6')},'sidebar':{'type':Sequelize[_0x49d7('0x7')](_0x49d7('0x8'),_0x49d7('0x9'),_0x49d7('0xa'),'never'),'defaultValue':'always','comment':_0x49d7('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x49d7('0x3')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x49d7('0x3')]}}; \ No newline at end of file +var _0xf17e=['always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly'];(function(_0x97a36e,_0x133ed2){var _0x3b0f44=function(_0x5cdc3b){while(--_0x5cdc3b){_0x97a36e['push'](_0x97a36e['shift']());}};_0x3b0f44(++_0x133ed2);}(_0xf17e,0x117));var _0xef17=function(_0x2cabc7,_0x989644){_0x2cabc7=_0x2cabc7-0x0;var _0x458522=_0xf17e[_0x2cabc7];return _0x458522;};'use strict';var Sequelize=require(_0xef17('0x0'));module['exports']={'name':{'type':Sequelize[_0xef17('0x1')]},'type':{'type':Sequelize['ENUM'](_0xef17('0x2'),_0xef17('0x3'))},'description':{'type':Sequelize[_0xef17('0x4')]},'version':{'type':Sequelize[_0xef17('0x4')]},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xef17('0x5')],'defaultValue':0x0,'comment':_0xef17('0x6')},'sidebar':{'type':Sequelize[_0xef17('0x7')](_0xef17('0x8'),'agentOnly',_0xef17('0x9'),_0xef17('0xa')),'defaultValue':_0xef17('0x9'),'comment':_0xef17('0xb')},'icon':{'type':Sequelize[_0xef17('0x1')]},'adminUrl':{'type':Sequelize[_0xef17('0x1')]},'agentUrl':{'type':Sequelize[_0xef17('0x1')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xef17('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index c314d7e..d3e84e3 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 _0x16cd=['intersection','fields','attributes','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','join','root','server/files/plugins','format','%s.zip','basename','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','dirname','attachments/**/*','close','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','length','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','version','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','autoAssociation','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query'];(function(_0x1d3610,_0x5bc2cf){var _0x5b8719=function(_0x51bba0){while(--_0x51bba0){_0x1d3610['push'](_0x1d3610['shift']());}};_0x5b8719(++_0x5bc2cf);}(_0x16cd,0x6c));var _0xd16c=function(_0x582d0b,_0x28f609){_0x582d0b=_0x582d0b-0x0;var _0x2e93e1=_0x16cd[_0x582d0b];return _0x2e93e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd16c('0x0'));var zipdir=require(_0xd16c('0x1'));var jsonpatch=require(_0xd16c('0x2'));var rp=require(_0xd16c('0x3'));var moment=require(_0xd16c('0x4'));var BPromise=require(_0xd16c('0x5'));var Mustache=require(_0xd16c('0x6'));var util=require('util');var path=require(_0xd16c('0x7'));var sox=require(_0xd16c('0x8'));var csv=require(_0xd16c('0x9'));var ejs=require(_0xd16c('0xa'));var fs=require('fs');var fs_extra=require(_0xd16c('0xb'));var _=require(_0xd16c('0xc'));var squel=require(_0xd16c('0xd'));var crypto=require(_0xd16c('0xe'));var jsforce=require(_0xd16c('0xf'));var deskjs=require(_0xd16c('0x10'));var toCsv=require(_0xd16c('0x9'));var querystring=require(_0xd16c('0x11'));var Papa=require(_0xd16c('0x12'));var extract=require(_0xd16c('0x13'));var rimraf=require('rimraf');var archiver=require(_0xd16c('0x14'));var Redis=require(_0xd16c('0x15'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd16c('0x16'));var logger=require('../../config/logger')(_0xd16c('0x17'));var utils=require(_0xd16c('0x18'));var config=require(_0xd16c('0x19'));var licenseUtil=require(_0xd16c('0x1a'));var db=require(_0xd16c('0x1b'))['db'];config[_0xd16c('0x1c')]=_['defaults'](config[_0xd16c('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xd16c('0x1d'))(new Redis(config[_0xd16c('0x1c')]));require(_0xd16c('0x1e'))[_0xd16c('0x1f')](socket);function respondWithStatusCode(_0x7a9685,_0x4cf945){_0x4cf945=_0x4cf945||0xcc;return function(_0x270f6f){if(_0x270f6f){return _0x7a9685[_0xd16c('0x20')](_0x4cf945);}return _0x7a9685[_0xd16c('0x21')](_0x4cf945)[_0xd16c('0x22')]();};}function respondWithResult(_0x8a7f9,_0x5f58dd){_0x5f58dd=_0x5f58dd||0xc8;return function(_0xdd6519){if(_0xdd6519){return _0x8a7f9[_0xd16c('0x21')](_0x5f58dd)[_0xd16c('0x23')](_0xdd6519);}};}function respondWithFilteredResult(_0x5b7d15,_0x24ebaa){return function(_0x5970ef){if(_0x5970ef){var _0x1bd5d3=typeof _0x24ebaa[_0xd16c('0x24')]===_0xd16c('0x25')&&typeof _0x24ebaa[_0xd16c('0x26')]==='undefined';var _0x49171f=_0x5970ef['count'];var _0x59bcff=_0x1bd5d3?0x0:_0x24ebaa[_0xd16c('0x24')];var _0x3dca51=_0x1bd5d3?_0x5970ef[_0xd16c('0x27')]:_0x24ebaa['offset']+_0x24ebaa[_0xd16c('0x26')];var _0x5502a3;if(_0x3dca51>=_0x49171f){_0x3dca51=_0x49171f;_0x5502a3=0xc8;}else{_0x5502a3=0xce;}_0x5b7d15[_0xd16c('0x21')](_0x5502a3);return _0x5b7d15[_0xd16c('0x28')](_0xd16c('0x29'),_0x59bcff+'-'+_0x3dca51+'/'+_0x49171f)['json'](_0x5970ef);}return null;};}function patchUpdates(_0x4a21c2){return function(_0x513424){try{jsonpatch['apply'](_0x513424,_0x4a21c2,!![]);}catch(_0x115ecf){return BPromise[_0xd16c('0x2a')](_0x115ecf);}return _0x513424[_0xd16c('0x2b')]();};}function saveUpdates(_0x20dd31,_0x35cacd){return function(_0x476397){if(_0x476397){return _0x476397[_0xd16c('0x2c')](_0x20dd31)[_0xd16c('0x2d')](function(_0x20408c){return _0x20408c;});}return null;};}function removeEntity(_0x32d0a5,_0x1065b5){return function(_0x456add){if(_0x456add){return _0x456add[_0xd16c('0x2e')]()[_0xd16c('0x2d')](function(){var _0x5646f6=_0x456add[_0xd16c('0x2f')]({'plain':!![]});var _0x26db4d='Plugins';return db[_0xd16c('0x30')][_0xd16c('0x2e')]({'where':{'type':_0x26db4d,'resourceId':_0x5646f6['id']}})[_0xd16c('0x2d')](function(){return _0x456add;});})[_0xd16c('0x2d')](function(){_0x32d0a5[_0xd16c('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19f5cc,_0xee55c2){return function(_0x46cdea){if(!_0x46cdea){_0x19f5cc['sendStatus'](0x194);}return _0x46cdea;};}function handleError(_0x4e7a1f,_0x3f5e72){_0x3f5e72=_0x3f5e72||0x1f4;return function(_0x25078c){logger[_0xd16c('0x31')](_0x25078c[_0xd16c('0x32')]);if(_0x25078c[_0xd16c('0x33')]){delete _0x25078c[_0xd16c('0x33')];}_0x4e7a1f['status'](_0x3f5e72)[_0xd16c('0x34')](_0x25078c);};}exports[_0xd16c('0x35')]=function(_0x1ba699,_0x56bf71){var _0x58d59b={},_0x574b5d={},_0xc6b808={'count':0x0,'rows':[]};var _0x32cffa=_[_0xd16c('0x36')](db[_0xd16c('0x37')][_0xd16c('0x38')],function(_0x53f9e8){return{'name':_0x53f9e8[_0xd16c('0x39')],'type':_0x53f9e8[_0xd16c('0x3a')][_0xd16c('0x3b')]};});_0x574b5d[_0xd16c('0x3c')]=_[_0xd16c('0x36')](_0x32cffa,_0xd16c('0x33'));_0x574b5d[_0xd16c('0x3d')]=_['keys'](_0x1ba699[_0xd16c('0x3d')]);_0x574b5d['filters']=_[_0xd16c('0x3e')](_0x574b5d[_0xd16c('0x3c')],_0x574b5d[_0xd16c('0x3d')]);_0x58d59b['attributes']=_[_0xd16c('0x3e')](_0x574b5d[_0xd16c('0x3c')],qs[_0xd16c('0x3f')](_0x1ba699[_0xd16c('0x3d')]['fields']));_0x58d59b[_0xd16c('0x40')]=_0x58d59b[_0xd16c('0x40')]['length']?_0x58d59b[_0xd16c('0x40')]:_0x574b5d['model'];if(!_0x1ba699[_0xd16c('0x3d')]['hasOwnProperty'](_0xd16c('0x41'))){_0x58d59b['limit']=qs[_0xd16c('0x26')](_0x1ba699[_0xd16c('0x3d')][_0xd16c('0x26')]);_0x58d59b[_0xd16c('0x24')]=qs[_0xd16c('0x24')](_0x1ba699['query'][_0xd16c('0x24')]);}_0x58d59b[_0xd16c('0x42')]=qs[_0xd16c('0x43')](_0x1ba699['query'][_0xd16c('0x43')]);_0x58d59b[_0xd16c('0x44')]=qs[_0xd16c('0x45')](_[_0xd16c('0x46')](_0x1ba699[_0xd16c('0x3d')],_0x574b5d['filters']),_0x32cffa);if(_0x1ba699[_0xd16c('0x3d')]['filter']){_0x58d59b[_0xd16c('0x44')]=_[_0xd16c('0x47')](_0x58d59b[_0xd16c('0x44')],{'$or':_[_0xd16c('0x36')](_0x32cffa,function(_0x391d6c){if(_0x391d6c[_0xd16c('0x3a')]!==_0xd16c('0x48')){var _0x41ff48={};_0x41ff48[_0x391d6c[_0xd16c('0x33')]]={'$like':'%'+_0x1ba699[_0xd16c('0x3d')]['filter']+'%'};return _0x41ff48;}})});}_0x58d59b=_[_0xd16c('0x47')]({},_0x58d59b,_0x1ba699[_0xd16c('0x49')]);var _0x2e5dfc={'where':_0x58d59b[_0xd16c('0x44')]};return db[_0xd16c('0x37')][_0xd16c('0x27')](_0x2e5dfc)[_0xd16c('0x2d')](function(_0x10c054){_0xc6b808[_0xd16c('0x27')]=_0x10c054;if(_0x1ba699[_0xd16c('0x3d')][_0xd16c('0x4a')]){_0x58d59b[_0xd16c('0x4b')]=[{'all':!![]}];}return db['Plugin'][_0xd16c('0x4c')](_0x58d59b);})['then'](function(_0x49264d){_0xc6b808['rows']=_0x49264d;return _0xc6b808;})[_0xd16c('0x2d')](respondWithFilteredResult(_0x56bf71,_0x58d59b))[_0xd16c('0x4d')](handleError(_0x56bf71,null));};exports[_0xd16c('0x4e')]=function(_0x20d362,_0x7d61b8){var _0xf40fb7={'raw':!![],'where':{'id':_0x20d362[_0xd16c('0x4f')]['id']}},_0x4fff83={};_0x4fff83[_0xd16c('0x3c')]=_[_0xd16c('0x50')](db['Plugin'][_0xd16c('0x38')]);_0x4fff83[_0xd16c('0x3d')]=_[_0xd16c('0x50')](_0x20d362[_0xd16c('0x3d')]);_0x4fff83[_0xd16c('0x45')]=_[_0xd16c('0x3e')](_0x4fff83[_0xd16c('0x3c')],_0x4fff83[_0xd16c('0x3d')]);_0xf40fb7['attributes']=_[_0xd16c('0x3e')](_0x4fff83[_0xd16c('0x3c')],qs[_0xd16c('0x3f')](_0x20d362[_0xd16c('0x3d')]['fields']));_0xf40fb7['attributes']=_0xf40fb7['attributes']['length']?_0xf40fb7[_0xd16c('0x40')]:_0x4fff83[_0xd16c('0x3c')];if(_0x20d362['query'][_0xd16c('0x4a')]){_0xf40fb7[_0xd16c('0x4b')]=[{'all':!![]}];}_0xf40fb7=_[_0xd16c('0x47')]({},_0xf40fb7,_0x20d362[_0xd16c('0x49')]);return db['Plugin'][_0xd16c('0x51')](_0xf40fb7)[_0xd16c('0x2d')](handleEntityNotFound(_0x7d61b8,null))['then'](respondWithResult(_0x7d61b8,null))[_0xd16c('0x4d')](handleError(_0x7d61b8,null));};exports['download']=function(_0x5924bf,_0x271aab,_0x5dbc0b){return db[_0xd16c('0x37')][_0xd16c('0x51')]({'where':{'id':_0x5924bf[_0xd16c('0x4f')]['id']},'attributes':[_0xd16c('0x33'),_0xd16c('0x7')],'raw':!![]})[_0xd16c('0x2d')](handleEntityNotFound(_0x271aab,null))[_0xd16c('0x2d')](function(_0x3ee8d0){if(_0x3ee8d0){var _0x28a4f4=path[_0xd16c('0x52')](config[_0xd16c('0x53')],_0xd16c('0x54'),util[_0xd16c('0x55')](_0xd16c('0x56'),path[_0xd16c('0x57')](_0x3ee8d0['path'])));var _0x1f5938=fs['createWriteStream'](_0x28a4f4);var _0x6431ca=archiver('zip',{'zlib':{'level':0x9}});_0x6431ca['on'](_0xd16c('0x58'),function(_0x5e5f96){if(_0x5e5f96[_0xd16c('0x59')]===_0xd16c('0x5a')){logger[_0xd16c('0x31')](_0x5e5f96);}else{throw new db[(_0xd16c('0x5b'))][(_0xd16c('0x5c'))](_0xd16c('0x5d'));}});_0x6431ca['on']('error',function(_0x16ee28){throw new db[(_0xd16c('0x5b'))][(_0xd16c('0x5c'))](_0xd16c('0x5d'));});_0x6431ca['pipe'](_0x1f5938);_0x6431ca['glob'](_0xd16c('0x5e'),{'cwd':path[_0xd16c('0x52')](config[_0xd16c('0x53')],_0xd16c('0x54'),path[_0xd16c('0x5f')](_0x3ee8d0[_0xd16c('0x7')])),'ignore':[path[_0xd16c('0x52')](path['basename'](_0x3ee8d0[_0xd16c('0x7')]),'node_modules/**/*'),path[_0xd16c('0x52')](path[_0xd16c('0x57')](_0x3ee8d0[_0xd16c('0x7')]),_0xd16c('0x60'))],'nodir':!![]})['finalize']();_0x1f5938['on'](_0xd16c('0x61'),function(){if(!fs[_0xd16c('0x62')](_0x28a4f4)){throw new db[(_0xd16c('0x5b'))]['Error'](_0xd16c('0x63'));}return _0x271aab[_0xd16c('0x64')](_0x28a4f4,util[_0xd16c('0x55')](_0xd16c('0x56'),path[_0xd16c('0x57')](_0x3ee8d0[_0xd16c('0x7')])),function(_0x541efa){if(_0x541efa){throw new db[(_0xd16c('0x5b'))][(_0xd16c('0x5c'))](_0xd16c('0x65'));}fs[_0xd16c('0x66')](_0x28a4f4);logger[_0xd16c('0x67')](_0xd16c('0x68'));logger['info'](_0xd16c('0x69'));});});}return null;})[_0xd16c('0x4d')](handleError(_0x271aab,null));};exports['upload']=function(_0x3a707c,_0x3a74a7,_0x21cf98){var _0x59c5ce=path[_0xd16c('0x57')](_0x3a707c['file'][_0xd16c('0x6a')],path[_0xd16c('0x6b')](_0x3a707c[_0xd16c('0x6c')][_0xd16c('0x6a')]));var _0x521583=path['join'](config[_0xd16c('0x53')],_0xd16c('0x54'),_0x3a707c['file'][_0xd16c('0x6a')]);var _0x375104=path['join'](config[_0xd16c('0x53')],_0xd16c('0x54'),_0x59c5ce);logger[_0xd16c('0x67')](_0xd16c('0x6d'),_0x521583);logger[_0xd16c('0x67')](_0xd16c('0x6e'),_0x375104);try{fs['chmodSync'](_0x521583,parseInt(_0xd16c('0x6f'),0x8));extract(_0x521583,{'dir':_0x375104},function(_0x1eeb16){if(_0x1eeb16){logger[_0xd16c('0x31')](_0x1eeb16);handleError(_0x1eeb16,!![]);};var _0x2ad080=fs['readdirSync'](_0x375104);if(_0x2ad080[_0xd16c('0x70')]>0x1){removeReferences(_0x521583,_0x375104);logger[_0xd16c('0x31')](_0xd16c('0x71'));return _0x21cf98(new Error(_0xd16c('0x71')));}var _0x5d8a5d=fs[_0xd16c('0x72')](path['join'](_0x375104,_0x2ad080[0x0]));if(_0x5d8a5d[_0xd16c('0x73')]()){removeReferences(_0x521583,_0x375104);logger[_0xd16c('0x31')](_0xd16c('0x71'));return _0x21cf98(new Error('Invalid\x20plugin\x20structure'));}if(_0x5d8a5d[_0xd16c('0x74')]()){var _0x4011b3=fs[_0xd16c('0x75')](path['join'](_0x375104,_0x2ad080[0x0]));if(_0x4011b3[_0xd16c('0x70')]===0x0){removeReferences(_0x521583,_0x375104);logger[_0xd16c('0x31')](_0xd16c('0x71'));return _0x21cf98(new Error(_0xd16c('0x71')));}var _0x5d7dbf=_0x4011b3['some'](function(_0x496a0d){return _0x496a0d===_0xd16c('0x76');});if(!_0x5d7dbf){return _0x21cf98(new Error('Plugin\x20manifest\x20missing'));}var _0x544dd1=fs['readFileSync'](path[_0xd16c('0x52')](_0x375104,_0x2ad080[0x0],_0xd16c('0x76')));var _0x18e33b=JSON['parse'](_0x544dd1);if(_0xd16c('0x25')==typeof _0x18e33b[_0xd16c('0x33')]){return _0x21cf98(new Error(_0xd16c('0x77')));}if('undefined'==typeof _0x18e33b[_0xd16c('0x3a')]){return _0x21cf98(new Error(_0xd16c('0x78')));}if('undefined'==typeof _0x18e33b['version']){return _0x21cf98(new Error(_0xd16c('0x79')));}if(_0xd16c('0x25')==typeof _0x18e33b[_0xd16c('0x7a')]){return _0x21cf98(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x18e33b[_0xd16c('0x3a')]==='html'){if('undefined'==typeof _0x18e33b[_0xd16c('0x7a')]['views']){return _0x21cf98(new Error(_0xd16c('0x7b')));}if('undefined'==typeof _0x18e33b[_0xd16c('0x7a')][_0xd16c('0x7c')][_0xd16c('0x7d')]&&'undefined'==typeof _0x18e33b[_0xd16c('0x7a')]['views'][_0xd16c('0x7e')]){return _0x21cf98(new Error(_0xd16c('0x7f')));}}else if(_0x18e33b['type']===_0xd16c('0x80')){if('undefined'==typeof _0x18e33b['parameters'][_0xd16c('0x81')]){return _0x21cf98(new Error(_0xd16c('0x82')));}if(_0xd16c('0x25')==typeof _0x18e33b['parameters'][_0xd16c('0x83')]){return _0x21cf98(new Error(_0xd16c('0x84')));}}else{return _0x21cf98(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x1dc3b4=_0x18e33b[_0xd16c('0x33')];var _0x18d3d2=_0x18e33b[_0xd16c('0x85')];var _0x419acb=_0x18e33b[_0xd16c('0x3a')];var _0x4b320d=_0x18e33b[_0xd16c('0x86')]?_0x18e33b['sidebar']:_0xd16c('0x87');var _0x28e8a9=_0x18e33b['icon']?_0x18e33b[_0xd16c('0x88')]:_0xd16c('0x89');var _0x2c4269='';var _0x4c8830='';var _0x443943='';var _0x4dffc9='';var _0x2965ce=_0x18e33b[_0xd16c('0x8a')];if(_0x419acb==='html'){if(_0xd16c('0x25')!=typeof _0x18e33b[_0xd16c('0x7a')][_0xd16c('0x7c')]['admin']){var _0x2454d9=_0x18e33b[_0xd16c('0x7a')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0xd16c('0x8b')](_0x2454d9)){_0x2c4269=path[_0xd16c('0x52')]('plugins',_0x59c5ce,_0x2ad080[0x0],_0x2454d9);}else{_0x2c4269=_0x2454d9;}}else{logger['info'](_0xd16c('0x8c'));}if(_0xd16c('0x25')!=typeof _0x18e33b[_0xd16c('0x7a')][_0xd16c('0x7c')][_0xd16c('0x7e')]){var _0x26ff4e=_0x18e33b[_0xd16c('0x7a')][_0xd16c('0x7c')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xd16c('0x8b')](_0x26ff4e)){_0x4c8830=path[_0xd16c('0x52')](_0xd16c('0x8d'),_0x59c5ce,_0x2ad080[0x0],_0x26ff4e);}else{_0x4c8830=_0x26ff4e;}}else{logger[_0xd16c('0x67')](_0xd16c('0x8e'));}}else if(_0x419acb===_0xd16c('0x80')){_0x443943=_0x18e33b['parameters'][_0xd16c('0x81')];_0x4dffc9=_0x18e33b[_0xd16c('0x7a')]['scriptPath'];if('undefined'!=typeof _0x18e33b[_0xd16c('0x7a')][_0xd16c('0x7c')]){if(_0xd16c('0x25')!=typeof _0x18e33b[_0xd16c('0x7a')][_0xd16c('0x7c')][_0xd16c('0x7d')]){var _0x2454d9=_0x18e33b[_0xd16c('0x7a')][_0xd16c('0x7c')][_0xd16c('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0xd16c('0x8b')](_0x2454d9)){_0x2c4269=path[_0xd16c('0x52')](_0xd16c('0x8d'),_0x59c5ce,_0x2ad080[0x0],_0x2454d9);}else{_0x2c4269=_0x2454d9;}}if(_0xd16c('0x25')!=typeof _0x18e33b[_0xd16c('0x7a')][_0xd16c('0x7c')]['agent']){var _0x26ff4e=_0x18e33b[_0xd16c('0x7a')]['views'][_0xd16c('0x7e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x26ff4e)){_0x4c8830=path['join']('plugins',_0x59c5ce,_0x2ad080[0x0],_0x26ff4e);}else{_0x4c8830=_0x26ff4e;}}}}var _0x5a6ded={'name':_0x1dc3b4,'description':_0x18d3d2,'path':path[_0xd16c('0x52')](_0x59c5ce,_0x2ad080[0x0]),'type':_0x419acb,'sidebar':_0x4b320d,'icon':_0x28e8a9,'adminUrl':_0x2c4269,'agentUrl':_0x4c8830,'scriptName':_0x443943,'scriptPath':_0x4dffc9,'version':_0x2965ce};removeReferences(_0x521583,null);return db[_0xd16c('0x37')][_0xd16c('0x8f')](_0x5a6ded)[_0xd16c('0x2d')](function(_0x577458){var _0x23ac06={'role':_0x3a707c[_0xd16c('0x90')][_0xd16c('0x91')],'userProfileId':_0x3a707c[_0xd16c('0x90')][_0xd16c('0x92')]};if(!_0x23ac06)throw new Error(_0xd16c('0x93'));if(_0x23ac06['role']===_0xd16c('0x94')){var _0x26bead=_0x577458[_0xd16c('0x2f')]({'plain':!![]});return db[_0xd16c('0x95')][_0xd16c('0x51')]({'where':{'name':_0xd16c('0x96'),'userProfileId':_0x23ac06['userProfileId']},'raw':!![]})[_0xd16c('0x2d')](function(_0x1f2514){if(_0x1f2514&&_0x1f2514[_0xd16c('0x97')]===0x0){return db[_0xd16c('0x30')][_0xd16c('0x8f')]({'name':_0x26bead['name'],'resourceId':_0x26bead['id'],'type':_0x1f2514[_0xd16c('0x33')],'sectionId':_0x1f2514['id']},{})['then'](function(){return _0x577458;});}else{return _0x577458;}})[_0xd16c('0x4d')](function(_0x2b700e){logger[_0xd16c('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b700e);throw _0x2b700e;});}return _0x577458;})['then'](respondWithResult(_0x3a74a7,null))[_0xd16c('0x4d')](handleError(_0x3a74a7,null));}});}catch(_0x51a2c3){_0x3a74a7['status'](0x1f4)[_0xd16c('0x34')](_0x51a2c3);}};function removeReferences(_0x47eb98,_0x84df35){try{if(_0x47eb98){fs[_0xd16c('0x66')](_0x47eb98);logger['info'](_0xd16c('0x98'));}if(_0x84df35){rimraf(_0x84df35,function(){});logger['info'](_0xd16c('0x99'));}}catch(_0x476913){logger[_0xd16c('0x31')](_0x476913);}}exports['update']=function(_0x54726d,_0xaf3e5b,_0x49a92c){return db[_0xd16c('0x37')][_0xd16c('0x51')]({'where':{'id':_0x54726d[_0xd16c('0x4f')]['id']}})[_0xd16c('0x2d')](handleEntityNotFound(_0xaf3e5b,null))[_0xd16c('0x2d')](saveUpdates(_0x54726d[_0xd16c('0x90')],null))[_0xd16c('0x2d')](respondWithResult(_0xaf3e5b,null))['catch'](handleError(_0xaf3e5b,null));};exports[_0xd16c('0x9a')]=function(_0x5f1011,_0x36194f,_0x4df7ad){return db[_0xd16c('0x37')][_0xd16c('0x51')]({'where':{'id':_0x5f1011[_0xd16c('0x4f')]['id']}})[_0xd16c('0x2d')](function(_0x215186){if(_0x215186){return _0x215186[_0xd16c('0x2e')]();}})['then'](function(_0x1adf5c){rimraf(path[_0xd16c('0x52')](config[_0xd16c('0x53')],_0xd16c('0x54'),path['dirname'](_0x1adf5c[_0xd16c('0x7')])),function(){});return _0x1adf5c;})[_0xd16c('0x2d')](handleEntityNotFound(_0x36194f,null))[_0xd16c('0x2d')](respondWithStatusCode(_0x36194f,null))[_0xd16c('0x4d')](handleError(_0x36194f,null));};exports['webhookGet']=function(_0x363b78,_0x3764a4,_0x5e1e5e){return BPromise[_0xd16c('0x9b')]()['then'](function(){if(!_0x363b78[_0xd16c('0x3d')][_0xd16c('0x7')]){throw new Error(_0xd16c('0x9c'));}if(!_0x363b78['query'][_0xd16c('0x9d')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x55fc70=_0x363b78['query'][_0xd16c('0x9e')]?_0x363b78[_0xd16c('0x3d')][_0xd16c('0x9e')]+':'+_0x363b78[_0xd16c('0x3d')][_0xd16c('0x9d')]:_0xd16c('0x9f')+_0x363b78['query']['port'];var _0x57a3be=_0x363b78['query']['json']?_0x363b78[_0xd16c('0x3d')]['json']:!![];var _0x372929=_0x363b78['query'][_0xd16c('0xa0')]?_0x363b78[_0xd16c('0x3d')][_0xd16c('0xa0')]:null;var _0x3d9733={'method':_0x363b78[_0xd16c('0xa1')],'uri':util[_0xd16c('0x55')](_0xd16c('0xa2'),_0x55fc70,_0x363b78[_0xd16c('0x3d')][_0xd16c('0x7')]),'json':_0x57a3be,'resolveWithFullResponse':!![],'encoding':_0x372929,'qs':_0x363b78[_0xd16c('0x3d')]};if(_0x363b78['headers']){_0x3d9733[_0xd16c('0xa3')]=_0x363b78[_0xd16c('0xa3')];if(_0x3d9733[_0xd16c('0xa3')][_0xd16c('0xa4')]){delete _0x3d9733['headers'][_0xd16c('0xa4')];}}if(_0x3d9733[_0xd16c('0xa3')][_0xd16c('0xa5')]){delete _0x3d9733['headers']['content-type'];}return rp(_0x3d9733);})[_0xd16c('0x2d')](function(_0x4109d4){if(_0x4109d4){_0x3764a4[_0xd16c('0x28')](_0x4109d4[_0xd16c('0xa3')]);logger[_0xd16c('0x67')](_0x4109d4[_0xd16c('0x90')]);if(_[_0xd16c('0xa6')](_0x363b78[_0xd16c('0x3d')]['path'],'download')&&_0x4109d4['statusCode']==0x1f4){return _0x3764a4['sendStatus'](_0x4109d4['statusCode']);}else{return _0x3764a4[_0xd16c('0x21')](_0x4109d4[_0xd16c('0xa7')])[_0xd16c('0x34')](_0x4109d4[_0xd16c('0x90')]);}}else{return _0x3764a4[_0xd16c('0x20')](0xc8);}})['catch'](handleError(_0x3764a4,null));};exports[_0xd16c('0xa8')]=function(_0x459b0e,_0x1c87cf,_0x5d6b10){return BPromise[_0xd16c('0x9b')]()[_0xd16c('0x2d')](function(){if(!_0x459b0e[_0xd16c('0x3d')][_0xd16c('0x7')]){throw new Error(_0xd16c('0x9c'));}if(!_0x459b0e[_0xd16c('0x3d')]['port']){throw new Error(_0xd16c('0xa9'));}var _0x577e04=_0x459b0e[_0xd16c('0x3d')]['hostname']?_0x459b0e['query'][_0xd16c('0x9e')]+':'+_0x459b0e['query']['port']:_0xd16c('0x9f')+_0x459b0e[_0xd16c('0x3d')][_0xd16c('0x9d')];var _0x740daf=_0x459b0e[_0xd16c('0x3d')][_0xd16c('0x23')]?_0x459b0e['query'][_0xd16c('0x23')]:!![];var _0x4833c0=_0x459b0e[_0xd16c('0x3d')][_0xd16c('0xa0')]?_0x459b0e[_0xd16c('0x3d')][_0xd16c('0xa0')]:null;var _0x149e63={'method':_0x459b0e[_0xd16c('0xa1')],'uri':util[_0xd16c('0x55')](_0xd16c('0xa2'),_0x577e04,_0x459b0e['query']['path']),'json':_0x740daf,'resolveWithFullResponse':!![],'encoding':_0x4833c0,'body':_0x459b0e[_0xd16c('0x90')]};if(_0x459b0e['headers']){_0x149e63[_0xd16c('0xa3')]=_0x459b0e[_0xd16c('0xa3')];if(_0x149e63[_0xd16c('0xa3')][_0xd16c('0xa4')]){delete _0x149e63[_0xd16c('0xa3')][_0xd16c('0xa4')];}}if(_0x149e63[_0xd16c('0xa3')][_0xd16c('0xa5')]){delete _0x149e63[_0xd16c('0xa3')]['content-type'];}return rp(_0x149e63);})[_0xd16c('0x2d')](function(_0x3bfcb8){if(_0x3bfcb8){_0x1c87cf[_0xd16c('0x28')](_0x3bfcb8[_0xd16c('0xa3')]);logger[_0xd16c('0x67')](_0x3bfcb8[_0xd16c('0x90')]);return _0x1c87cf['status'](_0x3bfcb8[_0xd16c('0xa7')])[_0xd16c('0x34')](_0x3bfcb8[_0xd16c('0x90')]);}else{return _0x1c87cf[_0xd16c('0x20')](0xc8);}})['catch'](handleError(_0x1c87cf,null));}; \ No newline at end of file +var _0xa9e3=['catch','show','params','keys','find','download','path','join','root','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','code','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','Error','pipe','glob','**/*','dirname','basename','node_modules/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','sidebar','always','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','agent','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','create','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','lodash','squel','jsforce','desk.js','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','Plugins','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','Plugin','includeAll','include','rows'];(function(_0x5b9355,_0x57417c){var _0x4d09f4=function(_0x5171ba){while(--_0x5171ba){_0x5b9355['push'](_0x5b9355['shift']());}};_0x4d09f4(++_0x57417c);}(_0xa9e3,0x1ba));var _0x3a9e=function(_0x2bce0b,_0x3b5f2f){_0x2bce0b=_0x2bce0b-0x0;var _0x4e40c9=_0xa9e3[_0x2bce0b];return _0x4e40c9;};'use strict';var emlformat=require(_0x3a9e('0x0'));var rimraf=require(_0x3a9e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a9e('0x2'));var rp=require('request-promise');var moment=require(_0x3a9e('0x3'));var BPromise=require(_0x3a9e('0x4'));var Mustache=require('mustache');var util=require(_0x3a9e('0x5'));var path=require('path');var sox=require(_0x3a9e('0x6'));var csv=require(_0x3a9e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a9e('0x8'));var squel=require(_0x3a9e('0x9'));var crypto=require('crypto');var jsforce=require(_0x3a9e('0xa'));var deskjs=require(_0x3a9e('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0x3a9e('0xc'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0x3a9e('0xd'));var authService=require(_0x3a9e('0xe'));var qs=require(_0x3a9e('0xf'));var as=require(_0x3a9e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a9e('0x11'))(_0x3a9e('0x12'));var utils=require(_0x3a9e('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3a9e('0x14'))['db'];config[_0x3a9e('0x15')]=_[_0x3a9e('0x16')](config[_0x3a9e('0x15')],{'host':_0x3a9e('0x17'),'port':0x18eb});var socket=require(_0x3a9e('0x18'))(new Redis(config[_0x3a9e('0x15')]));require(_0x3a9e('0x19'))[_0x3a9e('0x1a')](socket);function respondWithStatusCode(_0x33fccd,_0x3ec005){_0x3ec005=_0x3ec005||0xcc;return function(_0x5e7e5f){if(_0x5e7e5f){return _0x33fccd['sendStatus'](_0x3ec005);}return _0x33fccd[_0x3a9e('0x1b')](_0x3ec005)[_0x3a9e('0x1c')]();};}function respondWithResult(_0x953a2d,_0x44a43b){_0x44a43b=_0x44a43b||0xc8;return function(_0x207f40){if(_0x207f40){return _0x953a2d[_0x3a9e('0x1b')](_0x44a43b)[_0x3a9e('0x1d')](_0x207f40);}};}function respondWithFilteredResult(_0xf2426d,_0x50a17b){return function(_0x5dc4c3){if(_0x5dc4c3){var _0x1c4390=typeof _0x50a17b[_0x3a9e('0x1e')]==='undefined'&&typeof _0x50a17b[_0x3a9e('0x1f')]===_0x3a9e('0x20');var _0x2462c0=_0x5dc4c3[_0x3a9e('0x21')];var _0x3a73f1=_0x1c4390?0x0:_0x50a17b['offset'];var _0x571077=_0x1c4390?_0x5dc4c3[_0x3a9e('0x21')]:_0x50a17b[_0x3a9e('0x1e')]+_0x50a17b[_0x3a9e('0x1f')];var _0x56d1e4;if(_0x571077>=_0x2462c0){_0x571077=_0x2462c0;_0x56d1e4=0xc8;}else{_0x56d1e4=0xce;}_0xf2426d['status'](_0x56d1e4);return _0xf2426d[_0x3a9e('0x22')](_0x3a9e('0x23'),_0x3a73f1+'-'+_0x571077+'/'+_0x2462c0)['json'](_0x5dc4c3);}return null;};}function patchUpdates(_0x43bb95){return function(_0x1aa2f2){try{jsonpatch[_0x3a9e('0x24')](_0x1aa2f2,_0x43bb95,!![]);}catch(_0x1e8008){return BPromise[_0x3a9e('0x25')](_0x1e8008);}return _0x1aa2f2[_0x3a9e('0x26')]();};}function saveUpdates(_0x30e043,_0xed0e37){return function(_0x41fc2e){if(_0x41fc2e){return _0x41fc2e[_0x3a9e('0x27')](_0x30e043)[_0x3a9e('0x28')](function(_0x7b91c2){return _0x7b91c2;});}return null;};}function removeEntity(_0xb4c3aa,_0x4c16ed){return function(_0x4e89dc){if(_0x4e89dc){return _0x4e89dc['destroy']()['then'](function(){var _0x34bd18=_0x4e89dc[_0x3a9e('0x29')]({'plain':!![]});var _0x28cb04=_0x3a9e('0x2a');return db[_0x3a9e('0x2b')]['destroy']({'where':{'type':_0x28cb04,'resourceId':_0x34bd18['id']}})[_0x3a9e('0x28')](function(){return _0x4e89dc;});})[_0x3a9e('0x28')](function(){_0xb4c3aa[_0x3a9e('0x1b')](0xcc)[_0x3a9e('0x1c')]();});}};}function handleEntityNotFound(_0x327555,_0x39e3b2){return function(_0x4b10db){if(!_0x4b10db){_0x327555[_0x3a9e('0x2c')](0x194);}return _0x4b10db;};}function handleError(_0xf1846b,_0x33867d){_0x33867d=_0x33867d||0x1f4;return function(_0x7fe8b7){logger[_0x3a9e('0x2d')](_0x7fe8b7[_0x3a9e('0x2e')]);if(_0x7fe8b7[_0x3a9e('0x2f')]){delete _0x7fe8b7[_0x3a9e('0x2f')];}_0xf1846b[_0x3a9e('0x1b')](_0x33867d)[_0x3a9e('0x30')](_0x7fe8b7);};}exports[_0x3a9e('0x31')]=function(_0x550a80,_0x1556a4){var _0x45c322={},_0x18ad34={},_0x309ee3={'count':0x0,'rows':[]};var _0x208577=_[_0x3a9e('0x32')](db['Plugin'][_0x3a9e('0x33')],function(_0x251c37){return{'name':_0x251c37['fieldName'],'type':_0x251c37[_0x3a9e('0x34')][_0x3a9e('0x35')]};});_0x18ad34[_0x3a9e('0x36')]=_[_0x3a9e('0x32')](_0x208577,_0x3a9e('0x2f'));_0x18ad34[_0x3a9e('0x37')]=_['keys'](_0x550a80[_0x3a9e('0x37')]);_0x18ad34[_0x3a9e('0x38')]=_['intersection'](_0x18ad34[_0x3a9e('0x36')],_0x18ad34[_0x3a9e('0x37')]);_0x45c322['attributes']=_[_0x3a9e('0x39')](_0x18ad34[_0x3a9e('0x36')],qs[_0x3a9e('0x3a')](_0x550a80[_0x3a9e('0x37')]['fields']));_0x45c322[_0x3a9e('0x3b')]=_0x45c322[_0x3a9e('0x3b')][_0x3a9e('0x3c')]?_0x45c322[_0x3a9e('0x3b')]:_0x18ad34[_0x3a9e('0x36')];if(!_0x550a80['query']['hasOwnProperty'](_0x3a9e('0x3d'))){_0x45c322['limit']=qs[_0x3a9e('0x1f')](_0x550a80[_0x3a9e('0x37')][_0x3a9e('0x1f')]);_0x45c322[_0x3a9e('0x1e')]=qs[_0x3a9e('0x1e')](_0x550a80[_0x3a9e('0x37')][_0x3a9e('0x1e')]);}_0x45c322[_0x3a9e('0x3e')]=qs[_0x3a9e('0x3f')](_0x550a80[_0x3a9e('0x37')][_0x3a9e('0x3f')]);_0x45c322[_0x3a9e('0x40')]=qs[_0x3a9e('0x38')](_[_0x3a9e('0x41')](_0x550a80[_0x3a9e('0x37')],_0x18ad34[_0x3a9e('0x38')]),_0x208577);if(_0x550a80[_0x3a9e('0x37')][_0x3a9e('0x42')]){_0x45c322[_0x3a9e('0x40')]=_['merge'](_0x45c322[_0x3a9e('0x40')],{'$or':_['map'](_0x208577,function(_0x546eba){if(_0x546eba[_0x3a9e('0x34')]!==_0x3a9e('0x43')){var _0x53cafe={};_0x53cafe[_0x546eba['name']]={'$like':'%'+_0x550a80[_0x3a9e('0x37')][_0x3a9e('0x42')]+'%'};return _0x53cafe;}})});}_0x45c322=_[_0x3a9e('0x44')]({},_0x45c322,_0x550a80[_0x3a9e('0x45')]);var _0x6f3476={'where':_0x45c322[_0x3a9e('0x40')]};return db[_0x3a9e('0x46')][_0x3a9e('0x21')](_0x6f3476)[_0x3a9e('0x28')](function(_0x274a4f){_0x309ee3[_0x3a9e('0x21')]=_0x274a4f;if(_0x550a80[_0x3a9e('0x37')][_0x3a9e('0x47')]){_0x45c322[_0x3a9e('0x48')]=[{'all':!![]}];}return db[_0x3a9e('0x46')]['findAll'](_0x45c322);})[_0x3a9e('0x28')](function(_0x2e0b12){_0x309ee3[_0x3a9e('0x49')]=_0x2e0b12;return _0x309ee3;})[_0x3a9e('0x28')](respondWithFilteredResult(_0x1556a4,_0x45c322))[_0x3a9e('0x4a')](handleError(_0x1556a4,null));};exports[_0x3a9e('0x4b')]=function(_0x4361e2,_0x512695){var _0x1d8584={'raw':!![],'where':{'id':_0x4361e2[_0x3a9e('0x4c')]['id']}},_0x12f8ff={};_0x12f8ff[_0x3a9e('0x36')]=_[_0x3a9e('0x4d')](db[_0x3a9e('0x46')]['rawAttributes']);_0x12f8ff[_0x3a9e('0x37')]=_[_0x3a9e('0x4d')](_0x4361e2['query']);_0x12f8ff['filters']=_[_0x3a9e('0x39')](_0x12f8ff['model'],_0x12f8ff[_0x3a9e('0x37')]);_0x1d8584[_0x3a9e('0x3b')]=_[_0x3a9e('0x39')](_0x12f8ff[_0x3a9e('0x36')],qs[_0x3a9e('0x3a')](_0x4361e2[_0x3a9e('0x37')][_0x3a9e('0x3a')]));_0x1d8584[_0x3a9e('0x3b')]=_0x1d8584[_0x3a9e('0x3b')]['length']?_0x1d8584['attributes']:_0x12f8ff[_0x3a9e('0x36')];if(_0x4361e2[_0x3a9e('0x37')][_0x3a9e('0x47')]){_0x1d8584['include']=[{'all':!![]}];}_0x1d8584=_[_0x3a9e('0x44')]({},_0x1d8584,_0x4361e2[_0x3a9e('0x45')]);return db[_0x3a9e('0x46')][_0x3a9e('0x4e')](_0x1d8584)['then'](handleEntityNotFound(_0x512695,null))[_0x3a9e('0x28')](respondWithResult(_0x512695,null))[_0x3a9e('0x4a')](handleError(_0x512695,null));};exports[_0x3a9e('0x4f')]=function(_0x3c4b68,_0x3b6f1d,_0x24940e){return db[_0x3a9e('0x46')][_0x3a9e('0x4e')]({'where':{'id':_0x3c4b68[_0x3a9e('0x4c')]['id']},'attributes':[_0x3a9e('0x2f'),_0x3a9e('0x50')],'raw':!![]})[_0x3a9e('0x28')](handleEntityNotFound(_0x3b6f1d,null))[_0x3a9e('0x28')](function(_0x13548f){if(_0x13548f){var _0xc37260=path[_0x3a9e('0x51')](config[_0x3a9e('0x52')],_0x3a9e('0x53'),util[_0x3a9e('0x54')](_0x3a9e('0x55'),path['basename'](_0x13548f[_0x3a9e('0x50')])));var _0x2b42ed=fs[_0x3a9e('0x56')](_0xc37260);var _0x272b3a=archiver(_0x3a9e('0x57'),{'zlib':{'level':0x9}});_0x272b3a['on'](_0x3a9e('0x58'),function(_0x1cc97f){if(_0x1cc97f[_0x3a9e('0x59')]===_0x3a9e('0x5a')){logger[_0x3a9e('0x2d')](_0x1cc97f);}else{throw new db['Sequelize']['Error'](_0x3a9e('0x5b'));}});_0x272b3a['on'](_0x3a9e('0x2d'),function(_0x5d0048){throw new db[(_0x3a9e('0x5c'))][(_0x3a9e('0x5d'))](_0x3a9e('0x5b'));});_0x272b3a[_0x3a9e('0x5e')](_0x2b42ed);_0x272b3a[_0x3a9e('0x5f')](_0x3a9e('0x60'),{'cwd':path[_0x3a9e('0x51')](config[_0x3a9e('0x52')],'server/files/plugins',path[_0x3a9e('0x61')](_0x13548f[_0x3a9e('0x50')])),'ignore':[path[_0x3a9e('0x51')](path[_0x3a9e('0x62')](_0x13548f[_0x3a9e('0x50')]),_0x3a9e('0x63')),path[_0x3a9e('0x51')](path[_0x3a9e('0x62')](_0x13548f['path']),'attachments/**/*')],'nodir':!![]})[_0x3a9e('0x64')]();_0x2b42ed['on'](_0x3a9e('0x65'),function(){if(!fs[_0x3a9e('0x66')](_0xc37260)){throw new db[(_0x3a9e('0x5c'))][(_0x3a9e('0x5d'))](_0x3a9e('0x67'));}return _0x3b6f1d[_0x3a9e('0x4f')](_0xc37260,util[_0x3a9e('0x54')](_0x3a9e('0x55'),path[_0x3a9e('0x62')](_0x13548f['path'])),function(_0x50e781){if(_0x50e781){throw new db['Sequelize'][(_0x3a9e('0x5d'))](_0x3a9e('0x68'));}fs[_0x3a9e('0x69')](_0xc37260);logger[_0x3a9e('0x6a')]('Download\x20completed');logger['info'](_0x3a9e('0x6b'));});});}return null;})[_0x3a9e('0x4a')](handleError(_0x3b6f1d,null));};exports[_0x3a9e('0x6c')]=function(_0x1f5469,_0xf51368,_0x22699e){var _0x94916=path['basename'](_0x1f5469[_0x3a9e('0x6d')][_0x3a9e('0x6e')],path[_0x3a9e('0x6f')](_0x1f5469['file'][_0x3a9e('0x6e')]));var _0x6cd710=path[_0x3a9e('0x51')](config[_0x3a9e('0x52')],_0x3a9e('0x53'),_0x1f5469['file']['filename']);var _0x11ad50=path[_0x3a9e('0x51')](config[_0x3a9e('0x52')],_0x3a9e('0x53'),_0x94916);logger[_0x3a9e('0x6a')](_0x3a9e('0x70'),_0x6cd710);logger[_0x3a9e('0x6a')](_0x3a9e('0x71'),_0x11ad50);try{fs[_0x3a9e('0x72')](_0x6cd710,parseInt(_0x3a9e('0x73'),0x8));extract(_0x6cd710,{'dir':_0x11ad50},function(_0x483d62){if(_0x483d62){logger['error'](_0x483d62);handleError(_0x483d62,!![]);};var _0x122e30=fs[_0x3a9e('0x74')](_0x11ad50);if(_0x122e30['length']>0x1){removeReferences(_0x6cd710,_0x11ad50);logger[_0x3a9e('0x2d')](_0x3a9e('0x75'));return _0x22699e(new Error('Invalid\x20plugin\x20structure'));}var _0x173a12=fs[_0x3a9e('0x76')](path['join'](_0x11ad50,_0x122e30[0x0]));if(_0x173a12[_0x3a9e('0x77')]()){removeReferences(_0x6cd710,_0x11ad50);logger[_0x3a9e('0x2d')](_0x3a9e('0x75'));return _0x22699e(new Error(_0x3a9e('0x75')));}if(_0x173a12[_0x3a9e('0x78')]()){var _0x47d882=fs['readdirSync'](path[_0x3a9e('0x51')](_0x11ad50,_0x122e30[0x0]));if(_0x47d882[_0x3a9e('0x3c')]===0x0){removeReferences(_0x6cd710,_0x11ad50);logger[_0x3a9e('0x2d')](_0x3a9e('0x75'));return _0x22699e(new Error('Invalid\x20plugin\x20structure'));}var _0x5ab102=_0x47d882[_0x3a9e('0x79')](function(_0x40d463){return _0x40d463===_0x3a9e('0x7a');});if(!_0x5ab102){return _0x22699e(new Error('Plugin\x20manifest\x20missing'));}var _0x5474f5=fs['readFileSync'](path['join'](_0x11ad50,_0x122e30[0x0],_0x3a9e('0x7a')));var _0x820a41=JSON[_0x3a9e('0x7b')](_0x5474f5);if(_0x3a9e('0x20')==typeof _0x820a41[_0x3a9e('0x2f')]){return _0x22699e(new Error(_0x3a9e('0x7c')));}if(_0x3a9e('0x20')==typeof _0x820a41['type']){return _0x22699e(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x3a9e('0x20')==typeof _0x820a41[_0x3a9e('0x7d')]){return _0x22699e(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x3a9e('0x20')==typeof _0x820a41[_0x3a9e('0x7e')]){return _0x22699e(new Error(_0x3a9e('0x7f')));}if(_0x820a41[_0x3a9e('0x34')]===_0x3a9e('0x80')){if(_0x3a9e('0x20')==typeof _0x820a41[_0x3a9e('0x7e')]['views']){return _0x22699e(new Error(_0x3a9e('0x81')));}if(_0x3a9e('0x20')==typeof _0x820a41[_0x3a9e('0x7e')][_0x3a9e('0x82')][_0x3a9e('0x83')]&&_0x3a9e('0x20')==typeof _0x820a41[_0x3a9e('0x7e')][_0x3a9e('0x82')]['agent']){return _0x22699e(new Error(_0x3a9e('0x84')));}}else if(_0x820a41[_0x3a9e('0x34')]===_0x3a9e('0x85')){if(_0x3a9e('0x20')==typeof _0x820a41[_0x3a9e('0x7e')][_0x3a9e('0x86')]){return _0x22699e(new Error(_0x3a9e('0x87')));}if(_0x3a9e('0x20')==typeof _0x820a41[_0x3a9e('0x7e')]['scriptPath']){return _0x22699e(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x22699e(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x2cac70=_0x820a41[_0x3a9e('0x2f')];var _0xc28c96=_0x820a41['description'];var _0x1ec7be=_0x820a41[_0x3a9e('0x34')];var _0x49ba35=_0x820a41['sidebar']?_0x820a41[_0x3a9e('0x88')]:_0x3a9e('0x89');var _0x58d874=_0x820a41[_0x3a9e('0x8a')]?_0x820a41['icon']:_0x3a9e('0x8b');var _0x781105='';var _0xc5c234='';var _0x30d32b='';var _0x2f6b42='';var _0x2ceaf9=_0x820a41[_0x3a9e('0x7d')];if(_0x1ec7be==='html'){if(_0x3a9e('0x20')!=typeof _0x820a41[_0x3a9e('0x7e')][_0x3a9e('0x82')][_0x3a9e('0x83')]){var _0x4bf60f=_0x820a41[_0x3a9e('0x7e')][_0x3a9e('0x82')][_0x3a9e('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x3a9e('0x8c')](_0x4bf60f)){_0x781105=path[_0x3a9e('0x51')]('plugins',_0x94916,_0x122e30[0x0],_0x4bf60f);}else{_0x781105=_0x4bf60f;}}else{logger[_0x3a9e('0x6a')](_0x3a9e('0x8d'));}if(_0x3a9e('0x20')!=typeof _0x820a41[_0x3a9e('0x7e')][_0x3a9e('0x82')]['agent']){var _0x249f85=_0x820a41[_0x3a9e('0x7e')][_0x3a9e('0x82')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x3a9e('0x8c')](_0x249f85)){_0xc5c234=path['join'](_0x3a9e('0x8e'),_0x94916,_0x122e30[0x0],_0x249f85);}else{_0xc5c234=_0x249f85;}}else{logger[_0x3a9e('0x6a')](_0x3a9e('0x8f'));}}else if(_0x1ec7be===_0x3a9e('0x85')){_0x30d32b=_0x820a41[_0x3a9e('0x7e')][_0x3a9e('0x86')];_0x2f6b42=_0x820a41[_0x3a9e('0x7e')][_0x3a9e('0x90')];if(_0x3a9e('0x20')!=typeof _0x820a41[_0x3a9e('0x7e')][_0x3a9e('0x82')]){if('undefined'!=typeof _0x820a41[_0x3a9e('0x7e')]['views']['admin']){var _0x4bf60f=_0x820a41[_0x3a9e('0x7e')][_0x3a9e('0x82')][_0x3a9e('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x3a9e('0x8c')](_0x4bf60f)){_0x781105=path['join']('plugins',_0x94916,_0x122e30[0x0],_0x4bf60f);}else{_0x781105=_0x4bf60f;}}if(_0x3a9e('0x20')!=typeof _0x820a41[_0x3a9e('0x7e')][_0x3a9e('0x82')][_0x3a9e('0x91')]){var _0x249f85=_0x820a41[_0x3a9e('0x7e')][_0x3a9e('0x82')][_0x3a9e('0x91')];if(!/^(f|ht)tps?:\/\//i[_0x3a9e('0x8c')](_0x249f85)){_0xc5c234=path[_0x3a9e('0x51')](_0x3a9e('0x8e'),_0x94916,_0x122e30[0x0],_0x249f85);}else{_0xc5c234=_0x249f85;}}}}var _0x435364={'name':_0x2cac70,'description':_0xc28c96,'path':path[_0x3a9e('0x51')](_0x94916,_0x122e30[0x0]),'type':_0x1ec7be,'sidebar':_0x49ba35,'icon':_0x58d874,'adminUrl':_0x781105,'agentUrl':_0xc5c234,'scriptName':_0x30d32b,'scriptPath':_0x2f6b42,'version':_0x2ceaf9};removeReferences(_0x6cd710,null);return db[_0x3a9e('0x46')]['create'](_0x435364)['then'](function(_0x302a6b){var _0x3f7b6b={'role':_0x1f5469[_0x3a9e('0x92')]['role'],'userProfileId':_0x1f5469[_0x3a9e('0x92')][_0x3a9e('0x93')]};if(!_0x3f7b6b)throw new Error(_0x3a9e('0x94'));if(_0x3f7b6b[_0x3a9e('0x95')]===_0x3a9e('0x96')){var _0x171aa6=_0x302a6b[_0x3a9e('0x29')]({'plain':!![]});return db[_0x3a9e('0x97')][_0x3a9e('0x4e')]({'where':{'name':_0x3a9e('0x2a'),'userProfileId':_0x3f7b6b[_0x3a9e('0x93')]},'raw':!![]})[_0x3a9e('0x28')](function(_0x4c35a9){if(_0x4c35a9&&_0x4c35a9[_0x3a9e('0x98')]===0x0){return db[_0x3a9e('0x2b')][_0x3a9e('0x99')]({'name':_0x171aa6['name'],'resourceId':_0x171aa6['id'],'type':_0x4c35a9['name'],'sectionId':_0x4c35a9['id']},{})[_0x3a9e('0x28')](function(){return _0x302a6b;});}else{return _0x302a6b;}})['catch'](function(_0x3f3a84){logger[_0x3a9e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f3a84);throw _0x3f3a84;});}return _0x302a6b;})['then'](respondWithResult(_0xf51368,null))[_0x3a9e('0x4a')](handleError(_0xf51368,null));}});}catch(_0x48352c){_0xf51368[_0x3a9e('0x1b')](0x1f4)[_0x3a9e('0x30')](_0x48352c);}};function removeReferences(_0x1d6edf,_0x4c74df){try{if(_0x1d6edf){fs['unlinkSync'](_0x1d6edf);logger[_0x3a9e('0x6a')](_0x3a9e('0x9a'));}if(_0x4c74df){rimraf(_0x4c74df,function(){});logger[_0x3a9e('0x6a')](_0x3a9e('0x9b'));}}catch(_0x9190aa){logger['error'](_0x9190aa);}}exports[_0x3a9e('0x27')]=function(_0x682d02,_0x5d20f8,_0x4ab557){return db[_0x3a9e('0x46')]['find']({'where':{'id':_0x682d02[_0x3a9e('0x4c')]['id']}})[_0x3a9e('0x28')](handleEntityNotFound(_0x5d20f8,null))['then'](saveUpdates(_0x682d02[_0x3a9e('0x92')],null))[_0x3a9e('0x28')](respondWithResult(_0x5d20f8,null))[_0x3a9e('0x4a')](handleError(_0x5d20f8,null));};exports['delete']=function(_0x39f1b4,_0xcfa11f,_0x5d5467){return db[_0x3a9e('0x46')]['find']({'where':{'id':_0x39f1b4[_0x3a9e('0x4c')]['id']}})[_0x3a9e('0x28')](function(_0x42dce6){if(_0x42dce6){return _0x42dce6['destroy']();}})[_0x3a9e('0x28')](function(_0xab9e84){rimraf(path[_0x3a9e('0x51')](config[_0x3a9e('0x52')],_0x3a9e('0x53'),path[_0x3a9e('0x61')](_0xab9e84[_0x3a9e('0x50')])),function(){});return _0xab9e84;})['then'](handleEntityNotFound(_0xcfa11f,null))[_0x3a9e('0x28')](respondWithStatusCode(_0xcfa11f,null))[_0x3a9e('0x4a')](handleError(_0xcfa11f,null));};exports[_0x3a9e('0x9c')]=function(_0x2b2766,_0x2ddc32,_0x5974a3){return BPromise[_0x3a9e('0x9d')]()[_0x3a9e('0x28')](function(){if(!_0x2b2766[_0x3a9e('0x37')][_0x3a9e('0x50')]){throw new Error(_0x3a9e('0x9e'));}if(!_0x2b2766[_0x3a9e('0x37')][_0x3a9e('0x9f')]){throw new Error(_0x3a9e('0xa0'));}var _0x1e7129=_0x2b2766['query'][_0x3a9e('0xa1')]?_0x2b2766[_0x3a9e('0x37')]['hostname']+':'+_0x2b2766[_0x3a9e('0x37')]['port']:_0x3a9e('0xa2')+_0x2b2766[_0x3a9e('0x37')][_0x3a9e('0x9f')];var _0x1d9afe=_0x2b2766[_0x3a9e('0x37')][_0x3a9e('0x1d')]?_0x2b2766['query']['json']:!![];var _0x130059=_0x2b2766[_0x3a9e('0x37')][_0x3a9e('0xa3')]?_0x2b2766['query'][_0x3a9e('0xa3')]:null;var _0x436e83={'method':_0x2b2766[_0x3a9e('0xa4')],'uri':util['format'](_0x3a9e('0xa5'),_0x1e7129,_0x2b2766['query'][_0x3a9e('0x50')]),'json':_0x1d9afe,'resolveWithFullResponse':!![],'encoding':_0x130059,'qs':_0x2b2766[_0x3a9e('0x37')]};if(_0x2b2766[_0x3a9e('0xa6')]){_0x436e83[_0x3a9e('0xa6')]=_0x2b2766[_0x3a9e('0xa6')];if(_0x436e83[_0x3a9e('0xa6')][_0x3a9e('0xa7')]){delete _0x436e83[_0x3a9e('0xa6')]['content-length'];}}if(_0x436e83[_0x3a9e('0xa6')]['content-type']){delete _0x436e83['headers'][_0x3a9e('0xa8')];}return rp(_0x436e83);})[_0x3a9e('0x28')](function(_0xe41f52){if(_0xe41f52){_0x2ddc32[_0x3a9e('0x22')](_0xe41f52['headers']);logger[_0x3a9e('0x6a')](_0xe41f52[_0x3a9e('0x92')]);if(_[_0x3a9e('0xa9')](_0x2b2766['query']['path'],_0x3a9e('0x4f'))&&_0xe41f52['statusCode']==0x1f4){return _0x2ddc32['sendStatus'](_0xe41f52['statusCode']);}else{return _0x2ddc32['status'](_0xe41f52[_0x3a9e('0xaa')])[_0x3a9e('0x30')](_0xe41f52[_0x3a9e('0x92')]);}}else{return _0x2ddc32[_0x3a9e('0x2c')](0xc8);}})['catch'](handleError(_0x2ddc32,null));};exports[_0x3a9e('0xab')]=function(_0x5dbf53,_0x57fb7e,_0x29db42){return BPromise['resolve']()[_0x3a9e('0x28')](function(){if(!_0x5dbf53[_0x3a9e('0x37')][_0x3a9e('0x50')]){throw new Error(_0x3a9e('0x9e'));}if(!_0x5dbf53[_0x3a9e('0x37')][_0x3a9e('0x9f')]){throw new Error(_0x3a9e('0xa0'));}var _0x4e81c7=_0x5dbf53[_0x3a9e('0x37')]['hostname']?_0x5dbf53[_0x3a9e('0x37')][_0x3a9e('0xa1')]+':'+_0x5dbf53[_0x3a9e('0x37')][_0x3a9e('0x9f')]:_0x3a9e('0xa2')+_0x5dbf53[_0x3a9e('0x37')][_0x3a9e('0x9f')];var _0x50e04d=_0x5dbf53[_0x3a9e('0x37')][_0x3a9e('0x1d')]?_0x5dbf53[_0x3a9e('0x37')][_0x3a9e('0x1d')]:!![];var _0x1ce17d=_0x5dbf53[_0x3a9e('0x37')][_0x3a9e('0xa3')]?_0x5dbf53[_0x3a9e('0x37')]['encoding']:null;var _0x18725f={'method':_0x5dbf53[_0x3a9e('0xa4')],'uri':util['format']('%s%s',_0x4e81c7,_0x5dbf53[_0x3a9e('0x37')][_0x3a9e('0x50')]),'json':_0x50e04d,'resolveWithFullResponse':!![],'encoding':_0x1ce17d,'body':_0x5dbf53['body']};if(_0x5dbf53[_0x3a9e('0xa6')]){_0x18725f[_0x3a9e('0xa6')]=_0x5dbf53['headers'];if(_0x18725f[_0x3a9e('0xa6')][_0x3a9e('0xa7')]){delete _0x18725f[_0x3a9e('0xa6')][_0x3a9e('0xa7')];}}if(_0x18725f[_0x3a9e('0xa6')]['content-type']){delete _0x18725f['headers'][_0x3a9e('0xa8')];}return rp(_0x18725f);})[_0x3a9e('0x28')](function(_0x1313ba){if(_0x1313ba){_0x57fb7e[_0x3a9e('0x22')](_0x1313ba[_0x3a9e('0xa6')]);logger['info'](_0x1313ba[_0x3a9e('0x92')]);return _0x57fb7e[_0x3a9e('0x1b')](_0x1313ba[_0x3a9e('0xaa')])['send'](_0x1313ba['body']);}else{return _0x57fb7e[_0x3a9e('0x2c')](0xc8);}})['catch'](handleError(_0x57fb7e,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 06a24ef..8aaba03 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 _0x1af5=['emit','hasOwnProperty','hook','events','Plugin','setMaxListeners','save','update','remove'];(function(_0x217605,_0x347798){var _0x13b50e=function(_0x462e40){while(--_0x462e40){_0x217605['push'](_0x217605['shift']());}};_0x13b50e(++_0x347798);}(_0x1af5,0x17d));var _0x51af=function(_0x2689aa,_0x1793f9){_0x2689aa=_0x2689aa-0x0;var _0x1e4d03=_0x1af5[_0x2689aa];return _0x1e4d03;};'use strict';var EventEmitter=require(_0x51af('0x0'));var Plugin=require('../../mysqldb')['db'][_0x51af('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x51af('0x2')](0x0);var events={'afterCreate':_0x51af('0x3'),'afterUpdate':_0x51af('0x4'),'afterDestroy':_0x51af('0x5')};function emitEvent(_0x3fa933){return function(_0x3e09ac,_0x1ef226,_0x115556){PluginEvents[_0x51af('0x6')](_0x3fa933+':'+_0x3e09ac['id'],_0x3e09ac);PluginEvents[_0x51af('0x6')](_0x3fa933,_0x3e09ac);_0x115556(null);};}for(var e in events){if(events[_0x51af('0x7')](e)){var event=events[e];Plugin[_0x51af('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0xf072=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','save','remove'];(function(_0x35edd0,_0x44533c){var _0x33177b=function(_0x5a3089){while(--_0x5a3089){_0x35edd0['push'](_0x35edd0['shift']());}};_0x33177b(++_0x44533c);}(_0xf072,0x1cf));var _0x2f07=function(_0x5d6554,_0x4cd082){_0x5d6554=_0x5d6554-0x0;var _0x4a6e98=_0xf072[_0x5d6554];return _0x4a6e98;};'use strict';var EventEmitter=require(_0x2f07('0x0'));var Plugin=require(_0x2f07('0x1'))['db'][_0x2f07('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2f07('0x3'),'afterUpdate':'update','afterDestroy':_0x2f07('0x4')};function emitEvent(_0x432696){return function(_0x1536c3,_0x48d7b6,_0x1d5a33){PluginEvents[_0x2f07('0x5')](_0x432696+':'+_0x1536c3['id'],_0x1536c3);PluginEvents[_0x2f07('0x5')](_0x432696,_0x1536c3);_0x1d5a33(null);};}for(var e in events){if(events[_0x2f07('0x6')](e)){var event=events[e];Plugin[_0x2f07('0x7')](e,emitEvent(event));}}module[_0x2f07('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index e792c70..86ccc88 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 _0x141d=['bluebird','request-promise','path','../../config/environment','./plugin.attributes','exports','Plugin','plugins','lodash','util','../../config/logger','api','moment'];(function(_0x3044ae,_0x3a76d6){var _0x27e7ea=function(_0x119757){while(--_0x119757){_0x3044ae['push'](_0x3044ae['shift']());}};_0x27e7ea(++_0x3a76d6);}(_0x141d,0xe5));var _0xd141=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x141d[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xd141('0x0'));var util=require(_0xd141('0x1'));var logger=require(_0xd141('0x2'))(_0xd141('0x3'));var moment=require(_0xd141('0x4'));var BPromise=require(_0xd141('0x5'));var rp=require(_0xd141('0x6'));var fs=require('fs');var path=require(_0xd141('0x7'));var rimraf=require('rimraf');var config=require(_0xd141('0x8'));var attributes=require(_0xd141('0x9'));module[_0xd141('0xa')]=function(_0x1470d5,_0x1e9e41){return _0x1470d5['define'](_0xd141('0xb'),attributes,{'tableName':_0xd141('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7bb8=['api','moment','request-promise','path','../../config/environment','./plugin.attributes','plugins','util','../../config/logger'];(function(_0x50f58f,_0x374f99){var _0x252978=function(_0x21d87a){while(--_0x21d87a){_0x50f58f['push'](_0x50f58f['shift']());}};_0x252978(++_0x374f99);}(_0x7bb8,0xe8));var _0x87bb=function(_0x3d690c,_0x38577d){_0x3d690c=_0x3d690c-0x0;var _0x5db67c=_0x7bb8[_0x3d690c];return _0x5db67c;};'use strict';var _=require('lodash');var util=require(_0x87bb('0x0'));var logger=require(_0x87bb('0x1'))(_0x87bb('0x2'));var moment=require(_0x87bb('0x3'));var BPromise=require('bluebird');var rp=require(_0x87bb('0x4'));var fs=require('fs');var path=require(_0x87bb('0x5'));var rimraf=require('rimraf');var config=require(_0x87bb('0x6'));var attributes=require(_0x87bb('0x7'));module['exports']=function(_0x38b56d,_0x46622e){return _0x38b56d['define']('Plugin',attributes,{'tableName':_0x87bb('0x8'),'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 533f08d..39645c6 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 _0x5d3a=['Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Plugin','create','options','raw','CreatePlugin','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','defaults','redis','localhost','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3e6e59,_0x21ea9d){var _0x1b1ae8=function(_0x435d3c){while(--_0x435d3c){_0x3e6e59['push'](_0x3e6e59['shift']());}};_0x1b1ae8(++_0x21ea9d);}(_0x5d3a,0xbf));var _0xa5d3=function(_0x5e462b,_0x187b06){_0x5e462b=_0x5e462b-0x0;var _0xb01a65=_0x5d3a[_0x5e462b];return _0xb01a65;};'use strict';var _=require(_0xa5d3('0x0'));var util=require(_0xa5d3('0x1'));var moment=require(_0xa5d3('0x2'));var BPromise=require('bluebird');var rs=require(_0xa5d3('0x3'));var fs=require('fs');var Redis=require(_0xa5d3('0x4'));var db=require(_0xa5d3('0x5'))['db'];var utils=require(_0xa5d3('0x6'));var logger=require('../../config/logger')(_0xa5d3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa5d3('0x8')][_0xa5d3('0x9')]({'port':0x232a});config['redis']=_[_0xa5d3('0xa')](config[_0xa5d3('0xb')],{'host':_0xa5d3('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./plugin.socket')[_0xa5d3('0xd')](socket);function respondWithRpcPromise(_0x2dfe73,_0x3c44fc,_0x381fc2){return new BPromise(function(_0x323dbf,_0x44a47b){return client['request'](_0x2dfe73,_0x381fc2)[_0xa5d3('0xe')](function(_0x1556b9){logger[_0xa5d3('0xf')](_0xa5d3('0x10'),_0x3c44fc,_0xa5d3('0x11'));logger[_0xa5d3('0x12')](_0xa5d3('0x13'),_0x3c44fc,_0xa5d3('0x11'),JSON['stringify'](_0x1556b9));if(_0x1556b9[_0xa5d3('0x14')]){if(_0x1556b9[_0xa5d3('0x14')][_0xa5d3('0x15')]===0x1f4){logger[_0xa5d3('0x14')](_0xa5d3('0x10'),_0x3c44fc,_0x1556b9[_0xa5d3('0x14')][_0xa5d3('0x16')]);return _0x44a47b(_0x1556b9[_0xa5d3('0x14')][_0xa5d3('0x16')]);}logger['error'](_0xa5d3('0x10'),_0x3c44fc,_0x1556b9[_0xa5d3('0x14')]['message']);return _0x323dbf(_0x1556b9['error']['message']);}else{logger[_0xa5d3('0xf')](_0xa5d3('0x10'),_0x3c44fc,_0xa5d3('0x11'));_0x323dbf(_0x1556b9[_0xa5d3('0x17')][_0xa5d3('0x16')]);}})[_0xa5d3('0x18')](function(_0x13f602){logger[_0xa5d3('0x14')](_0xa5d3('0x10'),_0x3c44fc,_0x13f602);_0x44a47b(_0x13f602);});});}exports['CreatePlugin']=function(_0x552fb0){var _0xf905e6=this;return new Promise(function(_0xc2c2f2,_0x511e0e){return db[_0xa5d3('0x19')][_0xa5d3('0x1a')](_0x552fb0['body'],{'raw':_0x552fb0[_0xa5d3('0x1b')]?_0x552fb0[_0xa5d3('0x1b')][_0xa5d3('0x1c')]===undefined?!![]:![]:!![]})[_0xa5d3('0xe')](function(_0xbaf12){logger[_0xa5d3('0xf')](_0xa5d3('0x1d'),_0x552fb0);logger[_0xa5d3('0x12')]('CreatePlugin',_0x552fb0,JSON['stringify'](_0xbaf12));_0xc2c2f2(_0xbaf12);})[_0xa5d3('0x18')](function(_0x399e61){logger['error']('CreatePlugin',_0x399e61[_0xa5d3('0x16')],_0x552fb0);_0x511e0e(_0xf905e6['error'](0x1f4,_0x399e61['message']));});});}; \ No newline at end of file +var _0x6306=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','CreatePlugin','Plugin','body','options','raw','stringify','catch','util'];(function(_0x1e64bf,_0x29167f){var _0x4487ee=function(_0x4027b5){while(--_0x4027b5){_0x1e64bf['push'](_0x1e64bf['shift']());}};_0x4487ee(++_0x29167f);}(_0x6306,0xcb));var _0x6630=function(_0x5a2a77,_0x2c6e06){_0x5a2a77=_0x5a2a77-0x0;var _0x113570=_0x6306[_0x5a2a77];return _0x113570;};'use strict';var _=require('lodash');var util=require(_0x6630('0x0'));var moment=require(_0x6630('0x1'));var BPromise=require(_0x6630('0x2'));var rs=require(_0x6630('0x3'));var fs=require('fs');var Redis=require(_0x6630('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6630('0x5'));var logger=require(_0x6630('0x6'))(_0x6630('0x7'));var config=require(_0x6630('0x8'));var jayson=require(_0x6630('0x9'));var client=jayson[_0x6630('0xa')][_0x6630('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6630('0xc')],{'host':_0x6630('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6630('0xc')]));require(_0x6630('0xe'))[_0x6630('0xf')](socket);function respondWithRpcPromise(_0x519ed2,_0x1e8686,_0x4a6036){return new BPromise(function(_0x2f8242,_0x1c41e2){return client[_0x6630('0x10')](_0x519ed2,_0x4a6036)[_0x6630('0x11')](function(_0x4040b0){logger[_0x6630('0x12')](_0x6630('0x13'),_0x1e8686,_0x6630('0x14'));logger[_0x6630('0x15')](_0x6630('0x16'),_0x1e8686,_0x6630('0x14'),JSON['stringify'](_0x4040b0));if(_0x4040b0[_0x6630('0x17')]){if(_0x4040b0[_0x6630('0x17')][_0x6630('0x18')]===0x1f4){logger[_0x6630('0x17')](_0x6630('0x13'),_0x1e8686,_0x4040b0['error']['message']);return _0x1c41e2(_0x4040b0['error'][_0x6630('0x19')]);}logger['error'](_0x6630('0x13'),_0x1e8686,_0x4040b0[_0x6630('0x17')][_0x6630('0x19')]);return _0x2f8242(_0x4040b0['error'][_0x6630('0x19')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x1e8686,_0x6630('0x14'));_0x2f8242(_0x4040b0[_0x6630('0x1a')][_0x6630('0x19')]);}})['catch'](function(_0x275c13){logger[_0x6630('0x17')](_0x6630('0x13'),_0x1e8686,_0x275c13);_0x1c41e2(_0x275c13);});});}exports[_0x6630('0x1b')]=function(_0x47f0c1){var _0x2b9085=this;return new Promise(function(_0x50f187,_0x20309e){return db[_0x6630('0x1c')]['create'](_0x47f0c1[_0x6630('0x1d')],{'raw':_0x47f0c1[_0x6630('0x1e')]?_0x47f0c1[_0x6630('0x1e')][_0x6630('0x1f')]===undefined?!![]:![]:!![]})[_0x6630('0x11')](function(_0x81c809){logger['info'](_0x6630('0x1b'),_0x47f0c1);logger[_0x6630('0x15')](_0x6630('0x1b'),_0x47f0c1,JSON[_0x6630('0x20')](_0x81c809));_0x50f187(_0x81c809);})[_0x6630('0x21')](function(_0x2a114d){logger['error'](_0x6630('0x1b'),_0x2a114d['message'],_0x47f0c1);_0x20309e(_0x2b9085[_0x6630('0x17')](0x1f4,_0x2a114d[_0x6630('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 714b516..4b6781a 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 _0x6627=['length','plugin:','./plugin.events','save','update','emit','removeListener'];(function(_0x49e2b8,_0x5cf700){var _0x1f2213=function(_0x51f2bb){while(--_0x51f2bb){_0x49e2b8['push'](_0x49e2b8['shift']());}};_0x1f2213(++_0x5cf700);}(_0x6627,0x1a6));var _0x7662=function(_0x228540,_0x5bfa12){_0x228540=_0x228540-0x0;var _0xdae303=_0x6627[_0x228540];return _0xdae303;};'use strict';var PluginEvents=require(_0x7662('0x0'));var events=[_0x7662('0x1'),'remove',_0x7662('0x2')];function createListener(_0x5bf734,_0x5f1371){return function(_0x9c9059){_0x5f1371[_0x7662('0x3')](_0x5bf734,_0x9c9059);};}function removeListener(_0x41a7b7,_0x44ba62){return function(){PluginEvents[_0x7662('0x4')](_0x41a7b7,_0x44ba62);};}exports['register']=function(_0x502f83){for(var _0x4d93be=0x0,_0x5d389a=events[_0x7662('0x5')];_0x4d93be<_0x5d389a;_0x4d93be++){var _0x4af9a6=events[_0x4d93be];var _0x1f1629=createListener(_0x7662('0x6')+_0x4af9a6,_0x502f83);PluginEvents['on'](_0x4af9a6,_0x1f1629);}}; \ No newline at end of file +var _0x3b33=['remove','emit','removeListener','register','length','plugin:','save'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x3b33,0x1b8));var _0x33b3=function(_0x221338,_0x5b6482){_0x221338=_0x221338-0x0;var _0x7953e4=_0x3b33[_0x221338];return _0x7953e4;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x33b3('0x0'),_0x33b3('0x1'),'update'];function createListener(_0x514cc8,_0x1e5ad4){return function(_0x516ddc){_0x1e5ad4[_0x33b3('0x2')](_0x514cc8,_0x516ddc);};}function removeListener(_0x2051a7,_0x288bce){return function(){PluginEvents[_0x33b3('0x3')](_0x2051a7,_0x288bce);};}exports[_0x33b3('0x4')]=function(_0x5411da){for(var _0xa1f3e6=0x0,_0x1d9083=events[_0x33b3('0x5')];_0xa1f3e6<_0x1d9083;_0xa1f3e6++){var _0x47957d=events[_0xa1f3e6];var _0x3d8449=createListener(_0x33b3('0x6')+_0x47957d,_0x5411da);PluginEvents['on'](_0x47957d,_0x3d8449);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 4f152d0..651af59 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(_0x3ae327,_0x5d0df3){var _0x3c11ce=function(_0x469c15){while(--_0x469c15){_0x3ae327['push'](_0x3ae327['shift']());}};_0x3c11ce(++_0x5d0df3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x216d2c,_0x46e0a2){var _0xf7577c=function(_0x2063d3){while(--_0x2063d3){_0x216d2c['push'](_0x216d2c['shift']());}};_0xf7577c(++_0x46e0a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 30d29c9..f74a759 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 _0x1339=['body','params','delete','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','then','reject','motion2','catch','show','describe','create','../../files/plugins','cwd','chdir','start','dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x1339,0x1ed));var _0x9133=function(_0x5da207,_0x27bee2){_0x5da207=_0x5da207-0x0;var _0x193ba0=_0x1339[_0x5da207];return _0x193ba0;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var path=require(_0x9133('0x2'));var exec=require(_0x9133('0x3'))[_0x9133('0x4')];var BPromise=require(_0x9133('0x5'));function handleEntityNotFound(_0x176e80,_0x110c51){return function(_0x558345){if(!_0x558345){_0x176e80[_0x9133('0x6')](0x194);;}return _0x558345;};}function respondWithResult(_0x855473,_0x379915){_0x379915=_0x379915||0xc8;return function(_0x539af6){if(_0x539af6){return _0x855473[_0x9133('0x7')](_0x379915)[_0x9133('0x8')](_0x539af6);}return null;};}function handleError(_0x3059c4,_0x431a55){_0x431a55=_0x431a55||0x1f4;return function(_0x261698){logger[_0x9133('0x9')](_0x261698[_0x9133('0xa')]);if(_0x261698[_0x9133('0xb')]){delete _0x261698[_0x9133('0xb')];}_0x3059c4[_0x9133('0x7')](_0x431a55)['send'](_0x261698);};}function execChildProcess(){return new BPromise(function(_0x3f9650,_0x3533fa){exec(_0x9133('0xc'),function(_0x452481,_0x3b8f89,_0x244ced){logger['info'](_0x3b8f89);logger[_0x9133('0xd')](_0x244ced);if(_0x452481){logger[_0x9133('0x9')](_0x452481);return _0x3533fa(_0x452481);}return _0x3f9650(_0x3b8f89);});});}exports['index']=function(_0x5283a3,_0x10475c){return pm2['list']()[_0x9133('0xe')](function(_0x439e1a){if(_0x439e1a){var _0x17dfd1=_[_0x9133('0xf')](_0x439e1a,function(_0x31847a){return _0x31847a[_0x9133('0xb')]==='express'||_0x31847a[_0x9133('0xb')]===_0x9133('0x10');});return{'rows':_0x17dfd1,'count':_0x17dfd1['length']};}return null;})[_0x9133('0xe')](respondWithResult(_0x10475c,null))[_0x9133('0x11')](handleError(_0x10475c,null));};exports[_0x9133('0x12')]=function(_0x427663,_0x4a2c4f){return pm2[_0x9133('0x13')](_0x427663['params']['id'])[_0x9133('0xe')](respondWithResult(_0x4a2c4f,null))['then'](handleEntityNotFound(_0x4a2c4f,null))[_0x9133('0x11')](handleError(_0x4a2c4f,null));};exports[_0x9133('0x14')]=function(_0x5e8620,_0x38dd60){if(_0x5e8620['body'][_0x9133('0xb')]&&_0x5e8620['body']['script']){var _0x2f7354=path['join'](__dirname,_0x9133('0x15'),_0x5e8620['body']['script']);var _0x4c846e=process[_0x9133('0x16')]();process[_0x9133('0x17')](path['dirname'](_0x2f7354));return execChildProcess()[_0x9133('0xe')](function(_0x3f5d0e){process[_0x9133('0x17')](_0x4c846e);return pm2[_0x9133('0x18')]({'name':_0x5e8620['body'][_0x9133('0xb')],'script':_0x2f7354});})['then'](function(_0x187e32){pm2[_0x9133('0x19')]();return _0x187e32[0x0];})[_0x9133('0xe')](respondWithResult(_0x38dd60,0xc9))[_0x9133('0x11')](handleError(_0x38dd60,null));}else{return _0x38dd60[_0x9133('0x7')](0x1f4)[_0x9133('0x1a')]({'message':_0x9133('0x1b')});}};exports[_0x9133('0x1c')]=function(_0x1b6b3e,_0x46050b){if(_0x1b6b3e['body']['id']){delete _0x1b6b3e['body']['id'];}var _0x477bf1={'online':_0x9133('0x1d'),'stopped':_0x9133('0x1e')};if(_0x477bf1[_0x9133('0x1f')](_0x1b6b3e['body']['status'])){return pm2[_0x477bf1[_0x1b6b3e[_0x9133('0x20')][_0x9133('0x7')]]](_0x1b6b3e[_0x9133('0x21')]['id'])[_0x9133('0xe')](respondWithResult(_0x46050b,0xc8))[_0x9133('0x11')](handleError(_0x46050b,null));}else{return _0x46050b[_0x9133('0x7')](0x1f4)['send']({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x1ad222,_0x4a4a8e){if(_0x1ad222[_0x9133('0x20')]['id']){delete _0x1ad222[_0x9133('0x20')]['id'];}if(_0x1ad222['params']['id']){return pm2[_0x9133('0x22')](_0x1ad222['params']['id'])[_0x9133('0xe')](function(_0x26ca56){pm2[_0x9133('0x19')]();return _0x26ca56[0x0];})['then'](respondWithResult(_0x4a4a8e,null))[_0x9133('0x11')](handleError(_0x4a4a8e,null));}else{return _0x4a4a8e[_0x9133('0x7')](0x1f4)[_0x9133('0x1a')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x984b=['reject','express','motion2','catch','show','describe','params','create','body','script','../../files/plugins','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','destroy','delete','Unknown\x20id','api','path','child_process','status','json','error','stack','name','send','npm\x20install','info','index','list','then'];(function(_0x5c7cff,_0x229de9){var _0x48f729=function(_0x4d4428){while(--_0x4d4428){_0x5c7cff['push'](_0x5c7cff['shift']());}};_0x48f729(++_0x229de9);}(_0x984b,0xee));var _0xb984=function(_0xc1d361,_0x437f53){_0xc1d361=_0xc1d361-0x0;var _0x3eacfc=_0x984b[_0xc1d361];return _0x3eacfc;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0xb984('0x0'));var path=require(_0xb984('0x1'));var exec=require(_0xb984('0x2'))['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x8384b0,_0x340f2c){return function(_0x4d8f6a){if(!_0x4d8f6a){_0x8384b0['sendStatus'](0x194);;}return _0x4d8f6a;};}function respondWithResult(_0x2cca53,_0x46c541){_0x46c541=_0x46c541||0xc8;return function(_0x5a605a){if(_0x5a605a){return _0x2cca53[_0xb984('0x3')](_0x46c541)[_0xb984('0x4')](_0x5a605a);}return null;};}function handleError(_0x4d72b7,_0x37fd36){_0x37fd36=_0x37fd36||0x1f4;return function(_0x4e6b9a){logger[_0xb984('0x5')](_0x4e6b9a[_0xb984('0x6')]);if(_0x4e6b9a[_0xb984('0x7')]){delete _0x4e6b9a[_0xb984('0x7')];}_0x4d72b7[_0xb984('0x3')](_0x37fd36)[_0xb984('0x8')](_0x4e6b9a);};}function execChildProcess(){return new BPromise(function(_0x11525c,_0xfca315){exec(_0xb984('0x9'),function(_0x3c3e8a,_0x1f107f,_0x39e612){logger['info'](_0x1f107f);logger[_0xb984('0xa')](_0x39e612);if(_0x3c3e8a){logger['error'](_0x3c3e8a);return _0xfca315(_0x3c3e8a);}return _0x11525c(_0x1f107f);});});}exports[_0xb984('0xb')]=function(_0x2dba22,_0x594a5e){return pm2[_0xb984('0xc')]()[_0xb984('0xd')](function(_0x564d24){if(_0x564d24){var _0x203dba=_[_0xb984('0xe')](_0x564d24,function(_0x549791){return _0x549791[_0xb984('0x7')]===_0xb984('0xf')||_0x549791['name']===_0xb984('0x10');});return{'rows':_0x203dba,'count':_0x203dba['length']};}return null;})[_0xb984('0xd')](respondWithResult(_0x594a5e,null))[_0xb984('0x11')](handleError(_0x594a5e,null));};exports[_0xb984('0x12')]=function(_0x3f7cff,_0x59dcb7){return pm2[_0xb984('0x13')](_0x3f7cff[_0xb984('0x14')]['id'])[_0xb984('0xd')](respondWithResult(_0x59dcb7,null))[_0xb984('0xd')](handleEntityNotFound(_0x59dcb7,null))[_0xb984('0x11')](handleError(_0x59dcb7,null));};exports[_0xb984('0x15')]=function(_0x5c2e25,_0x2492f4){if(_0x5c2e25[_0xb984('0x16')][_0xb984('0x7')]&&_0x5c2e25[_0xb984('0x16')][_0xb984('0x17')]){var _0xcf9365=path['join'](__dirname,_0xb984('0x18'),_0x5c2e25[_0xb984('0x16')]['script']);var _0x44b570=process[_0xb984('0x19')]();process[_0xb984('0x1a')](path[_0xb984('0x1b')](_0xcf9365));return execChildProcess()[_0xb984('0xd')](function(_0x286033){process[_0xb984('0x1a')](_0x44b570);return pm2['start']({'name':_0x5c2e25[_0xb984('0x16')][_0xb984('0x7')],'script':_0xcf9365});})[_0xb984('0xd')](function(_0x5d4d38){pm2[_0xb984('0x1c')]();return _0x5d4d38[0x0];})[_0xb984('0xd')](respondWithResult(_0x2492f4,0xc9))[_0xb984('0x11')](handleError(_0x2492f4,null));}else{return _0x2492f4[_0xb984('0x3')](0x1f4)[_0xb984('0x8')]({'message':_0xb984('0x1d')});}};exports[_0xb984('0x1e')]=function(_0x4b3da0,_0x5d93d9){if(_0x4b3da0[_0xb984('0x16')]['id']){delete _0x4b3da0[_0xb984('0x16')]['id'];}var _0x3e254b={'online':_0xb984('0x1f'),'stopped':'stop'};if(_0x3e254b[_0xb984('0x20')](_0x4b3da0[_0xb984('0x16')][_0xb984('0x3')])){return pm2[_0x3e254b[_0x4b3da0['body'][_0xb984('0x3')]]](_0x4b3da0[_0xb984('0x14')]['id'])[_0xb984('0xd')](respondWithResult(_0x5d93d9,0xc8))[_0xb984('0x11')](handleError(_0x5d93d9,null));}else{return _0x5d93d9['status'](0x1f4)['send']({'message':'Unknown\x20status'});}};exports[_0xb984('0x21')]=function(_0x23ecf6,_0x58a98c){if(_0x23ecf6[_0xb984('0x16')]['id']){delete _0x23ecf6[_0xb984('0x16')]['id'];}if(_0x23ecf6[_0xb984('0x14')]['id']){return pm2[_0xb984('0x22')](_0x23ecf6['params']['id'])['then'](function(_0x315f70){pm2[_0xb984('0x1c')]();return _0x315f70[0x0];})[_0xb984('0xd')](respondWithResult(_0x58a98c,null))[_0xb984('0x11')](handleError(_0x58a98c,null));}else{return _0x58a98c['status'](0x1f4)[_0xb984('0x8')]({'message':_0xb984('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index a6ebf4a..54df354 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 _0x911c=['express','Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents','getQueues','exports'];(function(_0x13524e,_0x50af06){var _0x24f731=function(_0x524743){while(--_0x524743){_0x13524e['push'](_0x13524e['shift']());}};_0x24f731(++_0x50af06);}(_0x911c,0x1f4));var _0xc911=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0x911c[_0x235482];return _0x5f5bea;};'use strict';var express=require(_0xc911('0x0'));var router=express[_0xc911('0x1')]();var auth=require(_0xc911('0x2'));var controller=require(_0xc911('0x3'));router[_0xc911('0x4')](_0xc911('0x5'),auth[_0xc911('0x6')](),controller[_0xc911('0x7')]);router[_0xc911('0x4')]('/queues',auth[_0xc911('0x6')](),controller[_0xc911('0x8')]);module[_0xc911('0x9')]=router; \ No newline at end of file +var _0xf592=['get','getQueues','exports','express','../../components/auth/service','/agents','isAuthenticated','getAgents'];(function(_0xc67084,_0x3e2efc){var _0x4d06c6=function(_0x2eb951){while(--_0x2eb951){_0xc67084['push'](_0xc67084['shift']());}};_0x4d06c6(++_0x3e2efc);}(_0xf592,0xc3));var _0x2f59=function(_0x536e31,_0x4467df){_0x536e31=_0x536e31-0x0;var _0x160e26=_0xf592[_0x536e31];return _0x160e26;};'use strict';var express=require(_0x2f59('0x0'));var router=express['Router']();var auth=require(_0x2f59('0x1'));var controller=require('./realtime.controller');router['get'](_0x2f59('0x2'),auth[_0x2f59('0x3')](),controller[_0x2f59('0x4')]);router[_0x2f59('0x5')]('/queues',auth[_0x2f59('0x3')](),controller[_0x2f59('0x6')]);module[_0x2f59('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 322cb96..a467094 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 _0x79ba=['pause','*pause','resolve','then','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','length','map','User','rawAttributes','fieldName','type','raw','push','sequelize','literal','forEach','Pause','where','merge','user','role','userProfileId','agent','online','extraQueryConditions','assign','omit','UserProfile','findAndCountAll','find','getAgentStatus','voice','voiceStatus','getRealtimeAgentsQueryFields','catch','isValidChannel','name','dialActive','dialMethod','outbound','QueueCampaigns','startCase','Queues','filter','getResources','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','handleError','offset','undefined','limit','count','status','set','Content-Range','json','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter'];(function(_0x3395b1,_0x3cf57c){var _0x1391b8=function(_0x176eff){while(--_0x176eff){_0x3395b1['push'](_0x3395b1['shift']());}};_0x1391b8(++_0x3cf57c);}(_0x79ba,0x189));var _0xa79b=function(_0x4e6090,_0x50fa28){_0x4e6090=_0x4e6090-0x0;var _0x108ca1=_0x79ba[_0x4e6090];return _0x108ca1;};'use strict';var _=require(_0xa79b('0x0'));var util=require(_0xa79b('0x1'));var rta=require(_0xa79b('0x2'));var rtq=require(_0xa79b('0x3'));var qs=require(_0xa79b('0x4'));var utils=require(_0xa79b('0x5'));var db=require(_0xa79b('0x6'))['db'];var APIBadRequestError=require(_0xa79b('0x7'))['APIBadRequestError'];var APIHandleError=require('../../errors/api')[_0xa79b('0x8')];function respondWithFilteredResult(_0x2f366b,_0x1d7fae){return function(_0x40b387){if(_0x40b387){var _0x5414e2=typeof _0x1d7fae[_0xa79b('0x9')]===_0xa79b('0xa')&&typeof _0x1d7fae[_0xa79b('0xb')]===_0xa79b('0xa');var _0xdfd2b0=_0x40b387[_0xa79b('0xc')];var _0x285334=_0x5414e2?0x0:_0x1d7fae['offset'];var _0x1d9c5d=_0x5414e2?_0x40b387['count']:_0x1d7fae['offset']+_0x1d7fae[_0xa79b('0xb')];var _0x2bae00;if(_0x1d9c5d>=_0xdfd2b0){_0x1d9c5d=_0xdfd2b0;_0x2bae00=0xc8;}else{_0x2bae00=0xce;}_0x2f366b[_0xa79b('0xd')](_0x2bae00);return _0x2f366b[_0xa79b('0xe')](_0xa79b('0xf'),_0x285334+'-'+_0x1d9c5d+'/'+_0xdfd2b0)[_0xa79b('0x10')](_0x40b387);}return null;};}exports[_0xa79b('0x11')]=function(_0x4de132,_0x4d763f){var _0x39d977={'count':0x0,'rows':[]};var _0x31e145={};var _0x3f8ce1;var _0x51a916=utils[_0xa79b('0x12')]();var _0x1edaa6;var _0x5b8f9d;var _0x263e61=_0x4de132[_0xa79b('0x13')]['globalQueueFilter'];var _0x372965=_0x4de132[_0xa79b('0x13')][_0xa79b('0x14')];var _0x3e5458=_0x4de132[_0xa79b('0x13')][_0xa79b('0x15')];var _0x28d1c9=_0x372965===_0xa79b('0x16')||_0x372965===_0xa79b('0x17')?!![]:![];var _0x45ad36=[];var _0x59826c;var _0x2ca75c;Promise[_0xa79b('0x18')]()[_0xa79b('0x19')](function(){if(_0x4de132[_0xa79b('0x13')][_0xa79b('0x1a')]){if(!utils['isValidChannel'](_0x4de132[_0xa79b('0x13')][_0xa79b('0x1a')])){throw new APIBadRequestError(util[_0xa79b('0x1b')](_0xa79b('0x1c'),_0x4de132[_0xa79b('0x13')][_0xa79b('0x1a')]));}_0x3f8ce1=_0x4de132[_0xa79b('0x13')][_0xa79b('0x1a')][_0xa79b('0x1d')]();}if(!_0x4de132['query'][_0xa79b('0x1e')]||!_0x4de132[_0xa79b('0x13')]['sort'][_0xa79b('0x1f')](_0xa79b('0x20'))){_0x4de132[_0xa79b('0x13')][_0xa79b('0x1e')]=rta[_0xa79b('0x21')](_0x4de132[_0xa79b('0x13')][_0xa79b('0x1e')]);return;}var _0x18dacc=rta[_0xa79b('0x22')](_0x4de132[_0xa79b('0x13')][_0xa79b('0x1e')]);_0x4de132['query']['sort']=_0x18dacc[_0xa79b('0x23')][_0xa79b('0x24')](',');_0x59826c=_0x18dacc[_0xa79b('0x25')];})[_0xa79b('0x19')](function(){if(!_0x263e61){return[];}return rta[_0xa79b('0x26')](_0x263e61,_0x3f8ce1);})[_0xa79b('0x19')](function(_0x1ac6fa){_0x45ad36=_0x1ac6fa;return rta['getRealtimeAgents']();})[_0xa79b('0x19')](function(_0x3a0d0a){_0x5b8f9d=_0x3a0d0a[_0xa79b('0x27')];if((!_0x372965||_0x28d1c9)&&!_0x59826c){return _0x45ad36;}if(_0x59826c&&!_0x372965){return rta[_0xa79b('0x28')](_0x5b8f9d,_0x45ad36,_0x59826c);}else{return rta['getAgentIdsByStatus'](_0x5b8f9d,_0x45ad36,_0x372965);}})[_0xa79b('0x19')](function(_0x40ee26){_0x45ad36=_0x40ee26;var _0x5157fb=![];if(_0x45ad36[_0xa79b('0x29')]===0x0){if(_0x263e61||_0x372965){_0x5157fb=!![];}if(_0x28d1c9){_0x5157fb=![];}}if(_0x5157fb){return _0x39d977;}var _0x786c45=_[_0xa79b('0x2a')](db[_0xa79b('0x2b')][_0xa79b('0x2c')],function(_0x5ae95d){return{'name':_0x5ae95d[_0xa79b('0x2d')],'type':_0x5ae95d[_0xa79b('0x2e')]['key']};});_0x4de132[_0xa79b('0x13')]['role']='agent';_0x31e145=qs['getOptions'](_0x786c45,_0x4de132);_0x31e145[_0xa79b('0x2f')]=!![];var _0x3ac6e1=[];if(_0x45ad36[_0xa79b('0x29')]>0x0){_0x3ac6e1[_0xa79b('0x30')]({'id':{'$in':_0x45ad36}});if(_0x59826c&&!_0x372965){_0x2ca75c=[db[_0xa79b('0x31')][_0xa79b('0x32')]('FIELD(id,'+_0x45ad36+')')];_0x31e145[_0xa79b('0x25')]=_0x2ca75c;}}if(_0x28d1c9){_0x51a916[_0xa79b('0x33')](function(_0x14f7d9){var _0x3522e6=!![];if(_0x372965==='*pause'&&_0x3f8ce1!==_0x14f7d9){_0x3522e6=![];}_0x3ac6e1[_0xa79b('0x30')]({[_0x14f7d9+'Pause']:_0x3522e6});});if(_0x3e5458){_0x3ac6e1[_0xa79b('0x30')]({'pauseType':_0x3e5458});}}else if(_0x372965){_0x51a916[_0xa79b('0x33')](function(_0xcd69ac){_0x3ac6e1['push']({[_0xcd69ac+_0xa79b('0x34')]:![]});});}_0x31e145[_0xa79b('0x35')]=_[_0xa79b('0x36')](_0x31e145[_0xa79b('0x35')],{'$and':_0x3ac6e1});if(_0x4de132[_0xa79b('0x37')][_0xa79b('0x38')]===_0xa79b('0x37')){var _0x3d1cee={'params':{'id':_0x4de132[_0xa79b('0x37')][_0xa79b('0x39')]},'query':{'section':'Agents','role':_0xa79b('0x3a'),'raw':!![],'ids':_0x45ad36,'customSorting':_0x2ca75c}};if(_0x4de132[_0xa79b('0x13')]['online']){_0x3d1cee['query'][_0xa79b('0x3b')]=!![];}if(_0x28d1c9){_0x3d1cee[_0xa79b('0x13')][_0xa79b('0x3c')]=_0x3ac6e1;}_0x3d1cee[_0xa79b('0x13')]=Object[_0xa79b('0x3d')](_0x3d1cee[_0xa79b('0x13')],_[_0xa79b('0x3e')](_0x4de132['query'],'id'));return db[_0xa79b('0x3f')]['getResources'](_0x3d1cee);}return db[_0xa79b('0x2b')][_0xa79b('0x40')](_0x31e145);})[_0xa79b('0x19')](function(_0x2c42d4){_0x39d977[_0xa79b('0xc')]=_0x2c42d4['count'];_0x1edaa6=_0x2c42d4[_0xa79b('0x27')];return _0x1edaa6[_0xa79b('0x2a')](function(_0x397624){var _0x2fda84=_[_0xa79b('0x41')](_0x5b8f9d,['id',_0x397624['id']]);if(_0x2fda84){var _0x30db8a=rta['filterAgentAttributes'](_0x2fda84);_[_0xa79b('0x36')](_0x397624,_0x30db8a);}_0x397624[_0xa79b('0x20')]=rta[_0xa79b('0x42')](_0x397624);if(_0x397624[_0xa79b('0x20')][_0xa79b('0x1f')](_0xa79b('0x16'))){_0x51a916[_0xa79b('0x33')](function(_0x218055){if(_0x397624[_0x218055+_0xa79b('0x34')]){if(_0x218055===_0xa79b('0x43')){if(_0x397624[_0xa79b('0x44')]!=='talking'){_0x397624[_0xa79b('0x44')]='pause';}}else{_0x397624[_0x218055+'Status']=_0xa79b('0x16');}}});}return _0x397624;});})['then'](function(_0x35cf20){if(!_0x59826c||_0x2ca75c){return _0x35cf20;}return rta['sortAgentsByStatus'](_0x35cf20,_0x59826c);})[_0xa79b('0x19')](function(_0x5dc92b){var _0x3fe13c=rta[_0xa79b('0x45')]();_0x39d977['rows']=_0x5dc92b[_0xa79b('0x2a')](function(_0x3921d1){return _['pick'](_0x3921d1,_0x3fe13c);});return _0x39d977;})[_0xa79b('0x19')](respondWithFilteredResult(_0x4d763f,_0x31e145))[_0xa79b('0x46')](APIHandleError(_0x4d763f));};exports['getQueues']=function(_0x3e8acc,_0x5947d0){var _0x54c725={'count':0x0,'rows':[]};var _0x5227d3={};var _0xd4d80a;var _0x1832b7;var _0x4d06d2;Promise[_0xa79b('0x18')]()[_0xa79b('0x19')](function(){if(_0x3e8acc[_0xa79b('0x13')]['channel']){if(!utils[_0xa79b('0x47')](_0x3e8acc['query']['channel'])){throw new APIBadRequestError(util[_0xa79b('0x1b')](_0xa79b('0x1c'),_0x3e8acc[_0xa79b('0x13')][_0xa79b('0x1a')]));}_0xd4d80a=_0x3e8acc['query']['channel'][_0xa79b('0x1d')]();}var _0x8e1a75=_['startCase'](_0xd4d80a)+'Queue';var _0x2e68a2=_[_0xa79b('0x2a')](db[_0x8e1a75][_0xa79b('0x2c')],function(_0x1fc0c5){return{'name':_0x1fc0c5[_0xa79b('0x2d')],'type':_0x1fc0c5[_0xa79b('0x2e')]['key']};});if(!_0x3e8acc[_0xa79b('0x13')][_0xa79b('0x23')]){var _0x2fd886=['id',_0xa79b('0x48')];if(_0xd4d80a===_0xa79b('0x43')){_0x2fd886[_0xa79b('0x30')](_0xa79b('0x2e'));if(_0x3e8acc[_0xa79b('0x13')]['type']==='outbound'){_0x2fd886[_0xa79b('0x30')]([_0xa79b('0x49'),_0xa79b('0x4a')]);}}_0x3e8acc[_0xa79b('0x13')][_0xa79b('0x23')]=_0x2fd886[_0xa79b('0x24')](',');}_0x5227d3=qs['getOptions'](_0x2e68a2,_0x3e8acc);if(_0x3e8acc[_0xa79b('0x37')][_0xa79b('0x38')]===_0xa79b('0x37')){var _0x179296={'params':{'id':_0x3e8acc[_0xa79b('0x37')]['userProfileId']},'query':{'section':_0xd4d80a===_0xa79b('0x43')&&_0x3e8acc['query'][_0xa79b('0x2e')]===_0xa79b('0x4b')?_0xa79b('0x4c'):_[_0xa79b('0x4d')](_0xd4d80a)+_0xa79b('0x4e'),'type':_0x3e8acc[_0xa79b('0x13')][_0xa79b('0x2e')],'nolimit':!![],'sort':'name','filter':_0x3e8acc[_0xa79b('0x13')][_0xa79b('0x4f')]}};_0x179296[_0xa79b('0x13')]=Object[_0xa79b('0x3d')](_0x179296[_0xa79b('0x13')],_0x3e8acc['query']);delete _0x179296[_0xa79b('0x13')]['id'];return db[_0xa79b('0x3f')][_0xa79b('0x50')](_0x179296);}return db[_0x8e1a75][_0xa79b('0x40')](_0x5227d3);})[_0xa79b('0x19')](function(_0xd18b65){_0x54c725['count']=_0xd18b65[_0xa79b('0xc')];_0x1832b7=_0xd18b65['rows'];return rtq[_0xa79b('0x51')](_0x3e8acc,_0xd4d80a);})['then'](function(_0x3b2f9a){_0x4d06d2=_0x3b2f9a['rows'];return rtq[_0xa79b('0x52')](_0x1832b7,_0x4d06d2,_0xd4d80a,_0x3e8acc['query'][_0xa79b('0x2e')]);})[_0xa79b('0x19')](function(_0x428238){_0x54c725[_0xa79b('0x27')]=_0x428238;return _0x54c725;})[_0xa79b('0x19')](respondWithFilteredResult(_0x5947d0,_0x5227d3))[_0xa79b('0x46')](APIHandleError(_0x5947d0));}; \ No newline at end of file +var _0xf853=['getAgentIdsByQueues','getRealtimeAgents','length','map','User','fieldName','type','key','role','agent','raw','push','FIELD(id,','forEach','*pause','Pause','where','merge','user','userProfileId','extraQueryConditions','assign','omit','UserProfile','getResources','findAndCountAll','rows','find','getAgentStatus','voice','voiceStatus','talking','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','getQueues','resolve','startCase','Queue','rawAttributes','fields','name','dialActive','dialMethod','outbound','QueueCampaigns','Queues','lodash','util','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','Content-Range','getAgents','getChannels','query','globalQueueFilter','pauseTypeFilter','pause','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','join','order'];(function(_0x46111d,_0x5d286b){var _0xe82586=function(_0x39551b){while(--_0x39551b){_0x46111d['push'](_0x46111d['shift']());}};_0xe82586(++_0x5d286b);}(_0xf853,0x124));var _0x3f85=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0xf853[_0x562f3b];return _0x1edd55;};'use strict';var _=require(_0x3f85('0x0'));var util=require(_0x3f85('0x1'));var rta=require('../../components/realtime/agents');var rtq=require(_0x3f85('0x2'));var qs=require(_0x3f85('0x3'));var utils=require(_0x3f85('0x4'));var db=require(_0x3f85('0x5'))['db'];var APIBadRequestError=require(_0x3f85('0x6'))[_0x3f85('0x7')];var APIHandleError=require('../../errors/api')[_0x3f85('0x8')];function respondWithFilteredResult(_0x5ef182,_0x526a4c){return function(_0x98011f){if(_0x98011f){var _0x333865=typeof _0x526a4c[_0x3f85('0x9')]===_0x3f85('0xa')&&typeof _0x526a4c['limit']===_0x3f85('0xa');var _0x1566cf=_0x98011f[_0x3f85('0xb')];var _0x2cc98f=_0x333865?0x0:_0x526a4c['offset'];var _0x208cc5=_0x333865?_0x98011f[_0x3f85('0xb')]:_0x526a4c[_0x3f85('0x9')]+_0x526a4c[_0x3f85('0xc')];var _0x3105cd;if(_0x208cc5>=_0x1566cf){_0x208cc5=_0x1566cf;_0x3105cd=0xc8;}else{_0x3105cd=0xce;}_0x5ef182['status'](_0x3105cd);return _0x5ef182['set'](_0x3f85('0xd'),_0x2cc98f+'-'+_0x208cc5+'/'+_0x1566cf)['json'](_0x98011f);}return null;};}exports[_0x3f85('0xe')]=function(_0x3d9e8d,_0x239daf){var _0xcaa69={'count':0x0,'rows':[]};var _0x260f3f={};var _0x4ea760;var _0xf22b89=utils[_0x3f85('0xf')]();var _0x55927a;var _0x31eef1;var _0x2123b8=_0x3d9e8d[_0x3f85('0x10')][_0x3f85('0x11')];var _0x3d1fa8=_0x3d9e8d[_0x3f85('0x10')]['globalStatusFilter'];var _0x59f284=_0x3d9e8d[_0x3f85('0x10')][_0x3f85('0x12')];var _0x23171c=_0x3d1fa8===_0x3f85('0x13')||_0x3d1fa8==='*pause'?!![]:![];var _0x48ee99=[];var _0x5a44f6;var _0x4cb0e8;Promise['resolve']()[_0x3f85('0x14')](function(){if(_0x3d9e8d[_0x3f85('0x10')][_0x3f85('0x15')]){if(!utils[_0x3f85('0x16')](_0x3d9e8d[_0x3f85('0x10')][_0x3f85('0x15')])){throw new APIBadRequestError(util[_0x3f85('0x17')](_0x3f85('0x18'),_0x3d9e8d[_0x3f85('0x10')][_0x3f85('0x15')]));}_0x4ea760=_0x3d9e8d[_0x3f85('0x10')][_0x3f85('0x15')][_0x3f85('0x19')]();}if(!_0x3d9e8d[_0x3f85('0x10')][_0x3f85('0x1a')]||!_0x3d9e8d[_0x3f85('0x10')][_0x3f85('0x1a')]['includes'](_0x3f85('0x1b'))){_0x3d9e8d[_0x3f85('0x10')][_0x3f85('0x1a')]=rta[_0x3f85('0x1c')](_0x3d9e8d[_0x3f85('0x10')][_0x3f85('0x1a')]);return;}var _0xfa39a7=rta[_0x3f85('0x1d')](_0x3d9e8d[_0x3f85('0x10')][_0x3f85('0x1a')]);_0x3d9e8d['query']['sort']=_0xfa39a7['fields'][_0x3f85('0x1e')](',');_0x5a44f6=_0xfa39a7[_0x3f85('0x1f')];})[_0x3f85('0x14')](function(){if(!_0x2123b8){return[];}return rta[_0x3f85('0x20')](_0x2123b8,_0x4ea760);})[_0x3f85('0x14')](function(_0xd453a8){_0x48ee99=_0xd453a8;return rta[_0x3f85('0x21')]();})[_0x3f85('0x14')](function(_0x40fb0a){_0x31eef1=_0x40fb0a['rows'];if((!_0x3d1fa8||_0x23171c)&&!_0x5a44f6){return _0x48ee99;}if(_0x5a44f6&&!_0x3d1fa8){return rta['getSortedAgentsIdsByStatus'](_0x31eef1,_0x48ee99,_0x5a44f6);}else{return rta['getAgentIdsByStatus'](_0x31eef1,_0x48ee99,_0x3d1fa8);}})[_0x3f85('0x14')](function(_0x2fc162){_0x48ee99=_0x2fc162;var _0x233525=![];if(_0x48ee99[_0x3f85('0x22')]===0x0){if(_0x2123b8||_0x3d1fa8){_0x233525=!![];}if(_0x23171c){_0x233525=![];}}if(_0x233525){return _0xcaa69;}var _0x34f393=_[_0x3f85('0x23')](db[_0x3f85('0x24')]['rawAttributes'],function(_0x2c07e3){return{'name':_0x2c07e3[_0x3f85('0x25')],'type':_0x2c07e3[_0x3f85('0x26')][_0x3f85('0x27')]};});_0x3d9e8d['query'][_0x3f85('0x28')]=_0x3f85('0x29');_0x260f3f=qs['getOptions'](_0x34f393,_0x3d9e8d);_0x260f3f[_0x3f85('0x2a')]=!![];var _0x46ea02=[];if(_0x48ee99[_0x3f85('0x22')]>0x0){_0x46ea02[_0x3f85('0x2b')]({'id':{'$in':_0x48ee99}});if(_0x5a44f6&&!_0x3d1fa8){_0x4cb0e8=[db['sequelize']['literal'](_0x3f85('0x2c')+_0x48ee99+')')];_0x260f3f[_0x3f85('0x1f')]=_0x4cb0e8;}}if(_0x23171c){_0xf22b89[_0x3f85('0x2d')](function(_0x30d4ef){var _0x51e2df=!![];if(_0x3d1fa8===_0x3f85('0x2e')&&_0x4ea760!==_0x30d4ef){_0x51e2df=![];}_0x46ea02[_0x3f85('0x2b')]({[_0x30d4ef+'Pause']:_0x51e2df});});if(_0x59f284){_0x46ea02[_0x3f85('0x2b')]({'pauseType':_0x59f284});}}else if(_0x3d1fa8){_0xf22b89[_0x3f85('0x2d')](function(_0x2a999e){_0x46ea02[_0x3f85('0x2b')]({[_0x2a999e+_0x3f85('0x2f')]:![]});});}_0x260f3f[_0x3f85('0x30')]=_[_0x3f85('0x31')](_0x260f3f[_0x3f85('0x30')],{'$and':_0x46ea02});if(_0x3d9e8d[_0x3f85('0x32')][_0x3f85('0x28')]==='user'){var _0x51a6da={'params':{'id':_0x3d9e8d[_0x3f85('0x32')][_0x3f85('0x33')]},'query':{'section':'Agents','role':_0x3f85('0x29'),'raw':!![],'ids':_0x48ee99,'customSorting':_0x4cb0e8}};if(_0x3d9e8d[_0x3f85('0x10')]['online']){_0x51a6da[_0x3f85('0x10')]['online']=!![];}if(_0x23171c){_0x51a6da[_0x3f85('0x10')][_0x3f85('0x34')]=_0x46ea02;}_0x51a6da['query']=Object[_0x3f85('0x35')](_0x51a6da[_0x3f85('0x10')],_[_0x3f85('0x36')](_0x3d9e8d[_0x3f85('0x10')],'id'));return db[_0x3f85('0x37')][_0x3f85('0x38')](_0x51a6da);}return db[_0x3f85('0x24')][_0x3f85('0x39')](_0x260f3f);})[_0x3f85('0x14')](function(_0x21c982){_0xcaa69[_0x3f85('0xb')]=_0x21c982['count'];_0x55927a=_0x21c982[_0x3f85('0x3a')];return _0x55927a[_0x3f85('0x23')](function(_0x1c383a){var _0x1fac13=_[_0x3f85('0x3b')](_0x31eef1,['id',_0x1c383a['id']]);if(_0x1fac13){var _0x34067d=rta['filterAgentAttributes'](_0x1fac13);_['merge'](_0x1c383a,_0x34067d);}_0x1c383a['globalStatus']=rta[_0x3f85('0x3c')](_0x1c383a);if(_0x1c383a[_0x3f85('0x1b')]['includes']('pause')){_0xf22b89[_0x3f85('0x2d')](function(_0xef0595){if(_0x1c383a[_0xef0595+'Pause']){if(_0xef0595===_0x3f85('0x3d')){if(_0x1c383a[_0x3f85('0x3e')]!==_0x3f85('0x3f')){_0x1c383a[_0x3f85('0x3e')]=_0x3f85('0x13');}}else{_0x1c383a[_0xef0595+_0x3f85('0x40')]='pause';}}});}return _0x1c383a;});})[_0x3f85('0x14')](function(_0x145be5){if(!_0x5a44f6||_0x4cb0e8){return _0x145be5;}return rta[_0x3f85('0x41')](_0x145be5,_0x5a44f6);})[_0x3f85('0x14')](function(_0x1bc10a){var _0x16003f=rta[_0x3f85('0x42')]();_0xcaa69[_0x3f85('0x3a')]=_0x1bc10a[_0x3f85('0x23')](function(_0x370991){return _[_0x3f85('0x43')](_0x370991,_0x16003f);});return _0xcaa69;})[_0x3f85('0x14')](respondWithFilteredResult(_0x239daf,_0x260f3f))[_0x3f85('0x44')](APIHandleError(_0x239daf));};exports[_0x3f85('0x45')]=function(_0x268c81,_0xd3547a){var _0x1db751={'count':0x0,'rows':[]};var _0x27d98c={};var _0x22f0ae;var _0xb64271;var _0x16edfa;Promise[_0x3f85('0x46')]()[_0x3f85('0x14')](function(){if(_0x268c81[_0x3f85('0x10')][_0x3f85('0x15')]){if(!utils[_0x3f85('0x16')](_0x268c81['query'][_0x3f85('0x15')])){throw new APIBadRequestError(util['format'](_0x3f85('0x18'),_0x268c81[_0x3f85('0x10')][_0x3f85('0x15')]));}_0x22f0ae=_0x268c81[_0x3f85('0x10')][_0x3f85('0x15')][_0x3f85('0x19')]();}var _0x368217=_[_0x3f85('0x47')](_0x22f0ae)+_0x3f85('0x48');var _0x31ec6a=_[_0x3f85('0x23')](db[_0x368217][_0x3f85('0x49')],function(_0x2ce30d){return{'name':_0x2ce30d[_0x3f85('0x25')],'type':_0x2ce30d[_0x3f85('0x26')][_0x3f85('0x27')]};});if(!_0x268c81['query'][_0x3f85('0x4a')]){var _0x1d9c88=['id',_0x3f85('0x4b')];if(_0x22f0ae==='voice'){_0x1d9c88[_0x3f85('0x2b')](_0x3f85('0x26'));if(_0x268c81[_0x3f85('0x10')]['type']==='outbound'){_0x1d9c88[_0x3f85('0x2b')]([_0x3f85('0x4c'),_0x3f85('0x4d')]);}}_0x268c81[_0x3f85('0x10')][_0x3f85('0x4a')]=_0x1d9c88['join'](',');}_0x27d98c=qs['getOptions'](_0x31ec6a,_0x268c81);if(_0x268c81[_0x3f85('0x32')][_0x3f85('0x28')]===_0x3f85('0x32')){var _0x4d5fd6={'params':{'id':_0x268c81[_0x3f85('0x32')][_0x3f85('0x33')]},'query':{'section':_0x22f0ae===_0x3f85('0x3d')&&_0x268c81['query'][_0x3f85('0x26')]===_0x3f85('0x4e')?_0x3f85('0x4f'):_['startCase'](_0x22f0ae)+_0x3f85('0x50'),'type':_0x268c81[_0x3f85('0x10')][_0x3f85('0x26')],'nolimit':!![],'sort':_0x3f85('0x4b'),'filter':_0x268c81[_0x3f85('0x10')]['filter']}};_0x4d5fd6[_0x3f85('0x10')]=Object[_0x3f85('0x35')](_0x4d5fd6[_0x3f85('0x10')],_0x268c81[_0x3f85('0x10')]);delete _0x4d5fd6[_0x3f85('0x10')]['id'];return db['UserProfile'][_0x3f85('0x38')](_0x4d5fd6);}return db[_0x368217][_0x3f85('0x39')](_0x27d98c);})[_0x3f85('0x14')](function(_0x5a4615){_0x1db751['count']=_0x5a4615[_0x3f85('0xb')];_0xb64271=_0x5a4615['rows'];return rtq['getRealtimeQueues'](_0x268c81,_0x22f0ae);})[_0x3f85('0x14')](function(_0x170836){_0x16edfa=_0x170836[_0x3f85('0x3a')];return rtq['initializeQueues'](_0xb64271,_0x16edfa,_0x22f0ae,_0x268c81[_0x3f85('0x10')][_0x3f85('0x26')]);})['then'](function(_0x2d4f5e){_0x1db751[_0x3f85('0x3a')]=_0x2d4f5e;return _0x1db751;})['then'](respondWithFilteredResult(_0xd3547a,_0x27d98c))[_0x3f85('0x44')](APIHandleError(_0xd3547a));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 1dc1bea..9c2bf8d 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1b2dc2,_0x59365d){var _0x2af070=function(_0x54c846){while(--_0x54c846){_0x1b2dc2['push'](_0x1b2dc2['shift']());}};_0x2af070(++_0x59365d);}(_0x70e0,0x17b));var _0x070e=function(_0x83f5c,_0x59cc30){_0x83f5c=_0x83f5c-0x0;var _0x2b6234=_0x70e0[_0x83f5c];return _0x2b6234;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3f6c31,_0x376055){var _0x44c7e6=function(_0x4cae45){while(--_0x4cae45){_0x3f6c31['push'](_0x3f6c31['shift']());}};_0x44c7e6(++_0x376055);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 9778f7a..feacc36 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 _0x2706=['INTEGER','STRING','DATE','exports'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x2706,0x107));var _0x6270=function(_0xcfada,_0x99c567){_0xcfada=_0xcfada-0x0;var _0x21307a=_0x2706[_0xcfada];return _0x21307a;};'use strict';var Sequelize=require('sequelize');module[_0x6270('0x0')]={'state':{'type':Sequelize[_0x6270('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x6270('0x2')]},'scheduledat':{'type':Sequelize[_0x6270('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x6270('0x3')]},'responsetime':{'type':Sequelize[_0x6270('0x3')]},'ringtime':{'type':Sequelize[_0x6270('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x6270('0x2')]},'campaigntype':{'type':Sequelize[_0x6270('0x2')]},'membername':{'type':Sequelize[_0x6270('0x2')]}}; \ No newline at end of file +var _0xe829=['STRING','DATE','exports','INTEGER'];(function(_0x3d9080,_0x5d31b3){var _0x224bd8=function(_0x55cb38){while(--_0x55cb38){_0x3d9080['push'](_0x3d9080['shift']());}};_0x224bd8(++_0x5d31b3);}(_0xe829,0xde));var _0x9e82=function(_0x893787,_0x2ecfe4){_0x893787=_0x893787-0x0;var _0x4d2cb0=_0xe829[_0x893787];return _0x4d2cb0;};'use strict';var Sequelize=require('sequelize');module[_0x9e82('0x0')]={'state':{'type':Sequelize[_0x9e82('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x9e82('0x2')]},'scheduledat':{'type':Sequelize[_0x9e82('0x3')]},'uniqueid':{'type':Sequelize[_0x9e82('0x2')]},'starttime':{'type':Sequelize[_0x9e82('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x9e82('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x9e82('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 62a0d16..154347c 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 _0x40c4=['exports','define','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x40c4,0xba));var _0x440c=function(_0x128561,_0x3f5e94){_0x128561=_0x128561-0x0;var _0x58efaa=_0x40c4[_0x128561];return _0x58efaa;};'use strict';var _=require(_0x440c('0x0'));var util=require('util');var logger=require(_0x440c('0x1'))(_0x440c('0x2'));var moment=require(_0x440c('0x3'));var BPromise=require(_0x440c('0x4'));var rp=require(_0x440c('0x5'));var fs=require('fs');var path=require(_0x440c('0x6'));var rimraf=require(_0x440c('0x7'));var config=require(_0x440c('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0x440c('0x9')]=function(_0x54cf39,_0x28bf57){return _0x54cf39[_0x440c('0xa')](_0x440c('0xb'),attributes,{'tableName':_0x440c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa897=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','report_agent_preview'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa897,0xc6));var _0x7a89=function(_0x133df9,_0x53e081){_0x133df9=_0x133df9-0x0;var _0x5225f6=_0xa897[_0x133df9];return _0x5225f6;};'use strict';var _=require(_0x7a89('0x0'));var util=require(_0x7a89('0x1'));var logger=require(_0x7a89('0x2'))('api');var moment=require(_0x7a89('0x3'));var BPromise=require('bluebird');var rp=require(_0x7a89('0x4'));var fs=require('fs');var path=require(_0x7a89('0x5'));var rimraf=require(_0x7a89('0x6'));var config=require(_0x7a89('0x7'));var attributes=require(_0x7a89('0x8'));module[_0x7a89('0x9')]=function(_0x2c5523,_0x465b2a){return _0x2c5523['define']('ReportAgentPreview',attributes,{'tableName':_0x7a89('0xa'),'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 9355d5a..69446b1 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 _0x7a61=['../../config/environment','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x47137a,_0x5322a7){var _0x573b0a=function(_0x59b375){while(--_0x59b375){_0x47137a['push'](_0x47137a['shift']());}};_0x573b0a(++_0x5322a7);}(_0x7a61,0x89));var _0x17a6=function(_0x4a27de,_0x55635d){_0x4a27de=_0x4a27de-0x0;var _0x5dfd4e=_0x7a61[_0x4a27de];return _0x5dfd4e;};'use strict';var _=require(_0x17a6('0x0'));var util=require(_0x17a6('0x1'));var moment=require(_0x17a6('0x2'));var BPromise=require(_0x17a6('0x3'));var rs=require(_0x17a6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x17a6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x17a6('0x6'))(_0x17a6('0x7'));var config=require(_0x17a6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x17a6('0x9')][_0x17a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58ae73,_0x656213,_0x587840){return new BPromise(function(_0x337fa0,_0x39b9fe){return client[_0x17a6('0xb')](_0x58ae73,_0x587840)[_0x17a6('0xc')](function(_0x4cf968){logger['info'](_0x17a6('0xd'),_0x656213,'request\x20sent');logger[_0x17a6('0xe')](_0x17a6('0xf'),_0x656213,_0x17a6('0x10'),JSON[_0x17a6('0x11')](_0x4cf968));if(_0x4cf968['error']){if(_0x4cf968[_0x17a6('0x12')][_0x17a6('0x13')]===0x1f4){logger[_0x17a6('0x12')](_0x17a6('0xd'),_0x656213,_0x4cf968[_0x17a6('0x12')]['message']);return _0x39b9fe(_0x4cf968[_0x17a6('0x12')][_0x17a6('0x14')]);}logger['error'](_0x17a6('0xd'),_0x656213,_0x4cf968[_0x17a6('0x12')][_0x17a6('0x14')]);return _0x337fa0(_0x4cf968['error'][_0x17a6('0x14')]);}else{logger[_0x17a6('0x15')](_0x17a6('0xd'),_0x656213,'request\x20sent');_0x337fa0(_0x4cf968[_0x17a6('0x16')][_0x17a6('0x14')]);}})[_0x17a6('0x17')](function(_0xebcc2d){logger[_0x17a6('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x656213,_0xebcc2d);_0x39b9fe(_0xebcc2d);});});}exports[_0x17a6('0x18')]=function(_0x596e65){var _0x32aace=this;return new Promise(function(_0x43f4f3,_0x20898a){return db[_0x17a6('0x19')][_0x17a6('0x1a')](_0x596e65['body'],{'raw':_0x596e65[_0x17a6('0x1b')]?_0x596e65[_0x17a6('0x1b')][_0x17a6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x38e6fd){logger[_0x17a6('0x15')](_0x17a6('0x18'),_0x596e65);logger[_0x17a6('0xe')](_0x17a6('0x18'),_0x596e65,JSON['stringify'](_0x38e6fd));_0x43f4f3(_0x38e6fd);})[_0x17a6('0x17')](function(_0x5dbed0){logger[_0x17a6('0x12')](_0x17a6('0x18'),_0x5dbed0[_0x17a6('0x14')],_0x596e65);_0x20898a(_0x32aace[_0x17a6('0x12')](0x1f4,_0x5dbed0[_0x17a6('0x14')]));});});}; \ No newline at end of file +var _0x828d=['rpc','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2e7a81,_0x304327){var _0x1f3de3=function(_0xff8f70){while(--_0xff8f70){_0x2e7a81['push'](_0x2e7a81['shift']());}};_0x1f3de3(++_0x304327);}(_0x828d,0x12c));var _0xd828=function(_0x32ca2e,_0x49e777){_0x32ca2e=_0x32ca2e-0x0;var _0x446941=_0x828d[_0x32ca2e];return _0x446941;};'use strict';var _=require(_0xd828('0x0'));var util=require(_0xd828('0x1'));var moment=require(_0xd828('0x2'));var BPromise=require(_0xd828('0x3'));var rs=require(_0xd828('0x4'));var fs=require('fs');var Redis=require(_0xd828('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd828('0x6'));var logger=require(_0xd828('0x7'))(_0xd828('0x8'));var config=require('../../config/environment');var jayson=require(_0xd828('0x9'));var client=jayson[_0xd828('0xa')][_0xd828('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x563135,_0x5b3847,_0x482dfc){return new BPromise(function(_0x44fea5,_0x2e24a2){return client['request'](_0x563135,_0x482dfc)[_0xd828('0xc')](function(_0x6c1f68){logger[_0xd828('0xd')](_0xd828('0xe'),_0x5b3847,'request\x20sent');logger[_0xd828('0xf')](_0xd828('0x10'),_0x5b3847,'request\x20sent',JSON['stringify'](_0x6c1f68));if(_0x6c1f68['error']){if(_0x6c1f68['error'][_0xd828('0x11')]===0x1f4){logger[_0xd828('0x12')](_0xd828('0xe'),_0x5b3847,_0x6c1f68['error']['message']);return _0x2e24a2(_0x6c1f68[_0xd828('0x12')]['message']);}logger[_0xd828('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x5b3847,_0x6c1f68[_0xd828('0x12')][_0xd828('0x13')]);return _0x44fea5(_0x6c1f68[_0xd828('0x12')]['message']);}else{logger['info'](_0xd828('0xe'),_0x5b3847,_0xd828('0x14'));_0x44fea5(_0x6c1f68[_0xd828('0x15')][_0xd828('0x13')]);}})[_0xd828('0x16')](function(_0x5850a0){logger[_0xd828('0x12')](_0xd828('0xe'),_0x5b3847,_0x5850a0);_0x2e24a2(_0x5850a0);});});}exports[_0xd828('0x17')]=function(_0x137a2b){var _0x3a38d4=this;return new Promise(function(_0x59833b,_0x1ca60c){return db[_0xd828('0x18')][_0xd828('0x19')](_0x137a2b['body'],{'raw':_0x137a2b['options']?_0x137a2b[_0xd828('0x1a')][_0xd828('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x1a1613){logger[_0xd828('0xd')](_0xd828('0x17'),_0x137a2b);logger[_0xd828('0xf')](_0xd828('0x17'),_0x137a2b,JSON['stringify'](_0x1a1613));_0x59833b(_0x1a1613);})[_0xd828('0x16')](function(_0x249372){logger[_0xd828('0x12')](_0xd828('0x17'),_0x249372['message'],_0x137a2b);_0x1ca60c(_0x3a38d4['error'](0x1f4,_0x249372[_0xd828('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 10a2646..d674730 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 _0x35bc=['/chat/queues','/mail/queues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','outboundChannels','/agents','agents','put','/agents/:id/capacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','showMailQueues','chat','/chat/queues/:id','showChatQueues','fax','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','multer','path','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues'];(function(_0x4b2aba,_0x553608){var _0x2a7ce4=function(_0x22f519){while(--_0x22f519){_0x4b2aba['push'](_0x4b2aba['shift']());}};_0x2a7ce4(++_0x553608);}(_0x35bc,0xd7));var _0xc35b=function(_0x1306f3,_0x1da761){_0x1306f3=_0x1306f3-0x0;var _0xc1c7bf=_0x35bc[_0x1306f3];return _0xc1c7bf;};'use strict';var multer=require(_0xc35b('0x0'));var util=require('util');var path=require(_0xc35b('0x1'));var express=require('express');var router=express[_0xc35b('0x2')]();var auth=require(_0xc35b('0x3'));var controller=require(_0xc35b('0x4'));router[_0xc35b('0x5')](_0xc35b('0x6'),auth[_0xc35b('0x7')](),controller[_0xc35b('0x8')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0xc35b('0x7')](),controller['voiceChannelMixMonitor']);router[_0xc35b('0x5')](_0xc35b('0x9'),auth['isAuthenticated'](),controller[_0xc35b('0xa')]);router['get'](_0xc35b('0xb'),auth['isAuthenticated'](),controller[_0xc35b('0xc')]);router[_0xc35b('0x5')](_0xc35b('0xd'),auth['isAuthenticated'](),controller['chatQueues']);router[_0xc35b('0x5')](_0xc35b('0xe'),auth[_0xc35b('0x7')](),controller['mailQueues']);router[_0xc35b('0x5')]('/mail/accounts',auth['isAuthenticated'](),controller[_0xc35b('0xf')]);router[_0xc35b('0x5')](_0xc35b('0x10'),auth['isAuthenticated'](),controller[_0xc35b('0x11')]);router['get'](_0xc35b('0x12'),auth[_0xc35b('0x7')](),controller['smsQueues']);router[_0xc35b('0x5')](_0xc35b('0x13'),auth[_0xc35b('0x7')](),controller[_0xc35b('0x14')]);router[_0xc35b('0x5')](_0xc35b('0x15'),auth['isAuthenticated'](),controller[_0xc35b('0x16')]);router[_0xc35b('0x5')]('/voice/queues/preview/:id',auth[_0xc35b('0x7')](),controller[_0xc35b('0x17')]);router[_0xc35b('0x5')](_0xc35b('0x18'),auth[_0xc35b('0x7')](),controller[_0xc35b('0x19')]);router[_0xc35b('0x5')](_0xc35b('0x1a'),auth[_0xc35b('0x7')](),controller[_0xc35b('0x1b')]);router[_0xc35b('0x5')](_0xc35b('0x1c'),auth[_0xc35b('0x7')](),controller['voiceQueuesChannelHangup']);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller[_0xc35b('0x1d')]);router[_0xc35b('0x5')](_0xc35b('0x1e'),auth[_0xc35b('0x7')](),controller[_0xc35b('0x1f')]);router['put'](_0xc35b('0x1e'),auth['isAuthenticated'](),controller['updateVoiceQueue']);router[_0xc35b('0x5')](_0xc35b('0x20'),auth['isAuthenticated'](),controller[_0xc35b('0x21')]);router[_0xc35b('0x5')]('/outbound/channels',auth['isAuthenticated'](),controller[_0xc35b('0x22')]);router['get'](_0xc35b('0x23'),auth[_0xc35b('0x7')](),controller[_0xc35b('0x24')]);router[_0xc35b('0x25')](_0xc35b('0x26'),auth[_0xc35b('0x7')](),controller['agentCapacity']);router[_0xc35b('0x5')](_0xc35b('0x27'),auth[_0xc35b('0x7')](),controller['telephones']);router[_0xc35b('0x5')](_0xc35b('0x28'),auth['isAuthenticated'](),controller[_0xc35b('0x29')]);router['get'](_0xc35b('0x2a'),auth[_0xc35b('0x7')](),controller[_0xc35b('0x2b')]);router['get'](_0xc35b('0x2c'),auth[_0xc35b('0x7')](),controller[_0xc35b('0x2d')]);router[_0xc35b('0x5')](_0xc35b('0x2e'),auth[_0xc35b('0x7')](),controller['chatQueuesWaitingInteractions']);router[_0xc35b('0x5')](_0xc35b('0x2f'),auth[_0xc35b('0x7')](),controller[_0xc35b('0x30')]);router[_0xc35b('0x5')](_0xc35b('0x31'),auth[_0xc35b('0x7')](),controller['openchannelQueuesWaitingInteractions']);router[_0xc35b('0x5')](_0xc35b('0x32'),auth[_0xc35b('0x7')](),controller[_0xc35b('0x33')]);router[_0xc35b('0x5')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xc35b('0x34')]);router['get'](_0xc35b('0x35'),auth[_0xc35b('0x7')](),controller[_0xc35b('0x36')]);router[_0xc35b('0x5')](_0xc35b('0x37'),auth['isAuthenticated'](),controller[_0xc35b('0x38')]);router[_0xc35b('0x39')]('/mail/queues/:id/notify',auth[_0xc35b('0x7')](),controller[_0xc35b('0x3a')](_0xc35b('0x3b')));router[_0xc35b('0x5')]('/mail/queues/:id',auth[_0xc35b('0x7')](),controller[_0xc35b('0x3c')]);router['post']('/chat/queues/:id/notify',auth[_0xc35b('0x7')](),controller['queueNotify'](_0xc35b('0x3d')));router[_0xc35b('0x5')](_0xc35b('0x3e'),auth[_0xc35b('0x7')](),controller[_0xc35b('0x3f')]);router['post']('/fax/queues/:id/notify',auth['isAuthenticated'](),controller[_0xc35b('0x3a')](_0xc35b('0x40')));router['get']('/fax/queues/:id',auth[_0xc35b('0x7')](),controller['showFaxQueues']);router['post'](_0xc35b('0x41'),auth[_0xc35b('0x7')](),controller[_0xc35b('0x3a')](_0xc35b('0x42')));router[_0xc35b('0x5')](_0xc35b('0x43'),auth[_0xc35b('0x7')](),controller[_0xc35b('0x44')]);router[_0xc35b('0x39')](_0xc35b('0x45'),auth['isAuthenticated'](),controller[_0xc35b('0x3a')]('sms'));router['post']('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller[_0xc35b('0x3a')](_0xc35b('0x46')));router[_0xc35b('0x5')]('/sms/queues/:id',auth[_0xc35b('0x7')](),controller[_0xc35b('0x47')]);router['get'](_0xc35b('0x48'),auth[_0xc35b('0x7')](),controller[_0xc35b('0x49')]);router[_0xc35b('0x39')](_0xc35b('0x4a'),auth[_0xc35b('0x7')](),controller['agentNotify']);module[_0xc35b('0x4b')]=router; \ No newline at end of file +var _0x5968=['mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','/sms/queues/:id','/whatsapp/queues/:id','agentNotify','util','path','express','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','/mail/queues','mailQueues'];(function(_0x1fc18b,_0x13d27d){var _0x16a351=function(_0x54a799){while(--_0x54a799){_0x1fc18b['push'](_0x1fc18b['shift']());}};_0x16a351(++_0x13d27d);}(_0x5968,0x1c1));var _0x8596=function(_0xc312e3,_0x2ecd5a){_0xc312e3=_0xc312e3-0x0;var _0x2cbcde=_0x5968[_0xc312e3];return _0x2cbcde;};'use strict';var multer=require('multer');var util=require(_0x8596('0x0'));var path=require(_0x8596('0x1'));var express=require(_0x8596('0x2'));var router=express[_0x8596('0x3')]();var auth=require(_0x8596('0x4'));var controller=require(_0x8596('0x5'));router[_0x8596('0x6')]('/voice/channels',auth[_0x8596('0x7')](),controller['voiceChannels']);router[_0x8596('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x8596('0x7')](),controller['voiceChannelMixMonitor']);router[_0x8596('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0x8596('0x8')]);router[_0x8596('0x6')](_0x8596('0x9'),auth[_0x8596('0x7')](),controller['voiceQueues']);router[_0x8596('0x6')](_0x8596('0xa'),auth[_0x8596('0x7')](),controller['chatQueues']);router[_0x8596('0x6')](_0x8596('0xb'),auth[_0x8596('0x7')](),controller[_0x8596('0xc')]);router['get']('/mail/accounts',auth[_0x8596('0x7')](),controller[_0x8596('0xd')]);router[_0x8596('0x6')](_0x8596('0xe'),auth[_0x8596('0x7')](),controller[_0x8596('0xf')]);router[_0x8596('0x6')](_0x8596('0x10'),auth[_0x8596('0x7')](),controller[_0x8596('0x11')]);router[_0x8596('0x6')](_0x8596('0x12'),auth[_0x8596('0x7')](),controller[_0x8596('0x13')]);router['get'](_0x8596('0x14'),auth['isAuthenticated'](),controller['faxQueues']);router['get']('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0x8596('0x15')]);router[_0x8596('0x6')](_0x8596('0x16'),auth[_0x8596('0x7')](),controller[_0x8596('0x17')]);router[_0x8596('0x6')](_0x8596('0x18'),auth[_0x8596('0x7')](),controller[_0x8596('0x19')]);router[_0x8596('0x6')](_0x8596('0x1a'),auth[_0x8596('0x7')](),controller[_0x8596('0x1b')]);router[_0x8596('0x6')](_0x8596('0x1c'),auth[_0x8596('0x7')](),controller[_0x8596('0x1d')]);router[_0x8596('0x6')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x8596('0x1e')]);router[_0x8596('0x1f')](_0x8596('0x20'),auth[_0x8596('0x7')](),controller[_0x8596('0x21')]);router['get'](_0x8596('0x22'),auth[_0x8596('0x7')](),controller[_0x8596('0x23')]);router[_0x8596('0x6')](_0x8596('0x24'),auth[_0x8596('0x7')](),controller[_0x8596('0x25')]);router['get'](_0x8596('0x26'),auth[_0x8596('0x7')](),controller[_0x8596('0x27')]);router[_0x8596('0x1f')](_0x8596('0x28'),auth[_0x8596('0x7')](),controller['agentCapacity']);router['get']('/telephones',auth['isAuthenticated'](),controller[_0x8596('0x29')]);router[_0x8596('0x6')](_0x8596('0x2a'),auth[_0x8596('0x7')](),controller[_0x8596('0x2b')]);router[_0x8596('0x6')]('/campaigns',auth[_0x8596('0x7')](),controller[_0x8596('0x2c')]);router[_0x8596('0x6')](_0x8596('0x2d'),auth[_0x8596('0x7')](),controller[_0x8596('0x2e')]);router[_0x8596('0x6')](_0x8596('0x2f'),auth[_0x8596('0x7')](),controller[_0x8596('0x30')]);router[_0x8596('0x6')](_0x8596('0x31'),auth['isAuthenticated'](),controller[_0x8596('0x32')]);router[_0x8596('0x6')]('/openchannel/queues/waitinginteractions',auth[_0x8596('0x7')](),controller[_0x8596('0x33')]);router[_0x8596('0x6')](_0x8596('0x34'),auth[_0x8596('0x7')](),controller[_0x8596('0x35')]);router[_0x8596('0x6')](_0x8596('0x36'),auth['isAuthenticated'](),controller[_0x8596('0x37')]);router['get']('/whatsapp/queues/waitinginteractions',auth[_0x8596('0x7')](),controller[_0x8596('0x38')]);router[_0x8596('0x6')](_0x8596('0x39'),auth['isAuthenticated'](),controller[_0x8596('0x3a')]);router[_0x8596('0x3b')](_0x8596('0x3c'),auth[_0x8596('0x7')](),controller[_0x8596('0x3d')](_0x8596('0x3e')));router['get'](_0x8596('0x3f'),auth['isAuthenticated'](),controller[_0x8596('0x40')]);router['post']('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0x8596('0x3d')](_0x8596('0x41')));router[_0x8596('0x6')](_0x8596('0x42'),auth['isAuthenticated'](),controller['showChatQueues']);router['post'](_0x8596('0x43'),auth[_0x8596('0x7')](),controller[_0x8596('0x3d')](_0x8596('0x44')));router[_0x8596('0x6')](_0x8596('0x45'),auth[_0x8596('0x7')](),controller[_0x8596('0x46')]);router['post']('/openchannel/queues/:id/notify',auth[_0x8596('0x7')](),controller[_0x8596('0x3d')]('openchannel'));router[_0x8596('0x6')](_0x8596('0x47'),auth[_0x8596('0x7')](),controller['showOpenchannelQueues']);router[_0x8596('0x3b')](_0x8596('0x48'),auth['isAuthenticated'](),controller['queueNotify']('sms'));router[_0x8596('0x3b')](_0x8596('0x49'),auth[_0x8596('0x7')](),controller['queueNotify']('whatsapp'));router[_0x8596('0x6')](_0x8596('0x4a'),auth['isAuthenticated'](),controller['showSmsQueues']);router['get'](_0x8596('0x4b'),auth[_0x8596('0x7')](),controller['showWhatsappQueues']);router['post']('/agents/:id/notify',auth['isAuthenticated'](),controller[_0x8596('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 cade0db..75b800a 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 _0xbaf0=['MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','InteractionId','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','status','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions'];(function(_0x419909,_0x4d797b){var _0x588bf3=function(_0xc6d05b){while(--_0xc6d05b){_0x419909['push'](_0x419909['shift']());}};_0x588bf3(++_0x4d797b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var db=require(_0x0baf('0x3'))['db'];var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232a});var mailClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232b});var routingClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){var _0x5f20aa=_0x1d0a0d?_0x1d0a0d:amiClient;return _0x5f20aa[_0x0baf('0x8')](_0x1a10b1,_0x2dcaac)[_0x0baf('0x9')](function(_0x465528){if(_0x465528[_0x0baf('0xa')]){if(_0x465528[_0x0baf('0xa')][_0x0baf('0xb')]===0x1f4){return _0x11b947(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}return _0x5f5030(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}else{_0x5f5030(_0x465528[_0x0baf('0xd')]);}})['catch'](function(_0x5a53e2){_0x11b947(_0x5a53e2);});});}function respondWithResult(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xc8;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0xe')](_0xe4378c)['json'](_0x5db689);}return _0x465dd7[_0x0baf('0xf')](0x194);};}function handleError(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0x1f4;return function(_0x1f50c3){logger[_0x0baf('0xa')](_0x1f50c3[_0x0baf('0x10')]);if(_0x1f50c3[_0x0baf('0x11')]){delete _0x1f50c3[_0x0baf('0x11')];}_0x49e44b['status'](_0x1c76a8)['send'](_0x1f50c3);};}function findById(_0x2312c7){return function(_0x38395b){if(!_[_0x0baf('0x12')](_0x2312c7)&&!_[_0x0baf('0x12')](_0x38395b)&&!_[_0x0baf('0x12')](_0x38395b[_0x0baf('0x13')])){return _['find'](_0x38395b[_0x0baf('0x13')],function(_0xfbecec){return _0xfbecec['id']==_0x2312c7;});}return null;};}exports[_0x0baf('0x14')]=function(_0x3e9cb4,_0x47070d){return respondWithRpcPromise(_0x0baf('0x15'),_0x3e9cb4['query'])['then'](respondWithResult(_0x47070d,null))[_0x0baf('0x16')](handleError(_0x47070d,null));};exports[_0x0baf('0x17')]=function(_0x32e839,_0x1848e8){return respondWithRpcPromise(_0x0baf('0x18'),_[_0x0baf('0x19')](_0x32e839[_0x0baf('0x1a')],_0x32e839[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1848e8,null))[_0x0baf('0x16')](handleError(_0x1848e8,null));};exports['voiceChannelStopMixMonitor']=function(_0x334bd6,_0x482522){return respondWithRpcPromise(_0x0baf('0x1c'),_['merge'](_0x334bd6['query'],_0x334bd6[_0x0baf('0x1b')]))['then'](respondWithResult(_0x482522,null))['catch'](handleError(_0x482522,null));};exports[_0x0baf('0x1d')]=function(_0x27b59c,_0x34e264){return respondWithRpcPromise(_0x0baf('0x1e'),_0x27b59c[_0x0baf('0x1a')])['then'](respondWithResult(_0x34e264,null))[_0x0baf('0x16')](handleError(_0x34e264,null));};exports[_0x0baf('0x1f')]=function(_0x1ca35a,_0x366e71){return respondWithRpcPromise(_0x0baf('0x1e'),_0x1ca35a[_0x0baf('0x1a')])[_0x0baf('0x9')](findById(_0x1ca35a['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x366e71,null))[_0x0baf('0x16')](handleError(_0x366e71,null));};exports[_0x0baf('0x20')]=function(_0x265915,_0x55c715){return respondWithRpcPromise(_0x0baf('0x21'),_[_0x0baf('0x19')](_0x265915['body'],_0x265915[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x55c715,null))[_0x0baf('0x16')](handleError(_0x55c715,null));};exports[_0x0baf('0x22')]=function(_0xd14f0f,_0x366924){return respondWithRpcPromise(_0x0baf('0x23'),_['merge'](_0xd14f0f[_0x0baf('0x1a')],_0xd14f0f[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x366924,null))[_0x0baf('0x16')](handleError(_0x366924,null));};exports[_0x0baf('0x24')]=function(_0x275ea1,_0x2fc983){return respondWithRpcPromise(_0x0baf('0x25'),_0x275ea1[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x2fc983,null))[_0x0baf('0x16')](handleError(_0x2fc983,null));};exports[_0x0baf('0x26')]=function(_0x45294a,_0x3a3353){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0baf('0x19')](_0x45294a['query'],_0x45294a[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x3a3353,null))[_0x0baf('0x16')](handleError(_0x3a3353,null));};exports[_0x0baf('0x27')]=function(_0x5300a5,_0x1a2b03){return respondWithRpcPromise(_0x0baf('0x28'),_['merge'](_0x5300a5[_0x0baf('0x1a')],_0x5300a5[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1a2b03,null))[_0x0baf('0x16')](handleError(_0x1a2b03,null));};exports[_0x0baf('0x29')]=function(_0x1b0991,_0xe03d82){return respondWithRpcPromise(_0x0baf('0x2a'),_['merge'](_0x1b0991[_0x0baf('0x1a')],_0x1b0991[_0x0baf('0x1b')]))['then'](respondWithResult(_0xe03d82,null))[_0x0baf('0x16')](handleError(_0xe03d82,null));};exports['outbound']=function(_0x5c545f,_0x11bc49){return respondWithRpcPromise(_0x0baf('0x2b'),_0x5c545f['query'])['then'](respondWithResult(_0x11bc49,null))[_0x0baf('0x16')](handleError(_0x11bc49,null));};exports[_0x0baf('0x2c')]=function(_0x3412bc,_0xb2d9ab){return respondWithRpcPromise(_0x0baf('0x2d'),_0x3412bc[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0xb2d9ab,null))[_0x0baf('0x16')](handleError(_0xb2d9ab,null));};exports[_0x0baf('0x2e')]=function(_0x36c6d2,_0x200864){var _0x148540;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2[_0x0baf('0x1a')])['then'](function(_0x3573ce){_0x148540=_0x3573ce;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2['query'],routingClient);})[_0x0baf('0x9')](function(_0x324369){return _[_0x0baf('0x19')]({},_0x324369,_0x148540);})[_0x0baf('0x9')](respondWithResult(_0x200864,null))[_0x0baf('0x16')](handleError(_0x200864,null));};exports[_0x0baf('0x30')]=function(_0x57b581,_0x23ad34){if(_0x57b581[_0x0baf('0x31')]&&_0x57b581['body'][_0x0baf('0x32')]&&_0x57b581[_0x0baf('0x33')]&&_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]){for(var _0x504031 in _0x57b581[_0x0baf('0x31')][_0x0baf('0x32')]){if(_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x0baf('0x34')](_0x504031)){db[_0x0baf('0x35')][_0x0baf('0x36')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':_0x0baf('0x37'),'exitAt':null,'uniqueid':_0x57b581['body'][_0x0baf('0x32')][_0x504031]&&_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')]?{'$notIn':_0x57b581[_0x0baf('0x31')]['interaction'][_0x504031]}:{'$ne':null}}})[_0x0baf('0x9')](function(_0x310240){var _0x27c3ee=moment()[_0x0baf('0x39')](_0x0baf('0x3a'));for(var _0x54ed41=0x0,_0x2a0924=_0x310240[_0x0baf('0x38')];_0x54ed41<_0x2a0924;_0x54ed41+=0x1){_0x310240[_0x54ed41][_0x0baf('0x3b')]({'exitAt':_0x27c3ee});}});for(var _0x1522b0=0x0;_0x1522b0<_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')];_0x1522b0+=0x1){db['MemberReport'][_0x0baf('0x3c')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':'INTERACTION','uniqueid':_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x1522b0],'exitAt':null},'defaults':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'interface':_[_0x0baf('0x12')](_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')])?util['format'](_0x0baf('0x3e'),_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]):_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')],'type':_0x0baf('0x37'),'enterAt':moment()[_0x0baf('0x39')](_0x0baf('0x3a')),'role':_0x0baf('0x3f'),'internal':_0x57b581[_0x0baf('0x33')][_0x0baf('0x40')],'uniqueid':_0x57b581['body']['interaction'][_0x504031][_0x1522b0]}});}}}}return respondWithRpcPromise(_0x0baf('0x41'),{'id':_0x57b581[_0x0baf('0x1b')]['id'],'capacity':_0x57b581[_0x0baf('0x31')][_0x0baf('0x42')]},routingClient)[_0x0baf('0x9')](respondWithResult(_0x23ad34,null))[_0x0baf('0x16')](handleError(_0x23ad34,null));};exports[_0x0baf('0x43')]=function(_0x4b492c,_0x3fe534){return respondWithRpcPromise(_0x0baf('0x44'),_0x4b492c[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x3fe534,null))[_0x0baf('0x16')](handleError(_0x3fe534,null));};exports[_0x0baf('0x45')]=function(_0x5e1849,_0x3eebe5){return respondWithRpcPromise('Trunks',_0x5e1849[_0x0baf('0x1a')])['then'](respondWithResult(_0x3eebe5,null))[_0x0baf('0x16')](handleError(_0x3eebe5,null));};exports['campaigns']=function(_0x35b1a5,_0x4c035b){return respondWithRpcPromise(_0x0baf('0x46'),_0x35b1a5[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x4c035b,null))[_0x0baf('0x16')](handleError(_0x4c035b,null));};exports[_0x0baf('0x47')]=function(_0x576475,_0x21f179){return respondWithRpcPromise(_0x0baf('0x48'),_0x576475[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21f179,null))[_0x0baf('0x16')](handleError(_0x21f179,null));};exports[_0x0baf('0x49')]=function(_0x480834,_0x402f4d){return respondWithRpcPromise(_0x0baf('0x48'),_0x480834[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x480834[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x402f4d,null))[_0x0baf('0x16')](handleError(_0x402f4d,null));};exports['mailQueues']=function(_0x48e855,_0x23f6ea){return respondWithRpcPromise(_0x0baf('0x4a'),_0x48e855[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x23f6ea,null))[_0x0baf('0x16')](handleError(_0x23f6ea,null));};exports[_0x0baf('0x4b')]=function(_0xaa4293,_0x14a667){return respondWithRpcPromise(_0x0baf('0x4a'),_0xaa4293['query'],routingClient)[_0x0baf('0x9')](findById(_0xaa4293[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x14a667,null))[_0x0baf('0x16')](handleError(_0x14a667,null));};exports[_0x0baf('0x4c')]=function(_0xebfc0c,_0x26f5c9){return respondWithRpcPromise('MailAccounts',_0xebfc0c[_0x0baf('0x1a')],mailClient)[_0x0baf('0x9')](respondWithResult(_0x26f5c9,null))[_0x0baf('0x16')](handleError(_0x26f5c9,null));};exports[_0x0baf('0x4d')]=function(_0x1c7d88,_0x1a6d22){return respondWithRpcPromise(_0x0baf('0x4e'),_0x1c7d88[_0x0baf('0x1a')],routingClient)['then'](respondWithResult(_0x1a6d22,null))[_0x0baf('0x16')](handleError(_0x1a6d22,null));};exports['showOpenchannelQueues']=function(_0x3c00e7,_0x5f2fbe){return respondWithRpcPromise('OpenchannelQueues',_0x3c00e7[_0x0baf('0x1a')],routingClient)['then'](findById(_0x3c00e7[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x5f2fbe,null))['catch'](handleError(_0x5f2fbe,null));};exports[_0x0baf('0x4f')]=function(_0xfb6708,_0x156572){return respondWithRpcPromise('SmsQueues',_0xfb6708['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x156572,null))[_0x0baf('0x16')](handleError(_0x156572,null));};exports[_0x0baf('0x50')]=function(_0x7f49e,_0x784e1a){return respondWithRpcPromise('SmsQueues',_0x7f49e[_0x0baf('0x1a')],routingClient)['then'](findById(_0x7f49e['params']['id']))['then'](respondWithResult(_0x784e1a,null))[_0x0baf('0x16')](handleError(_0x784e1a,null));};exports['whatsappQueues']=function(_0x4946d4,_0x11a81e){return respondWithRpcPromise(_0x0baf('0x51'),_0x4946d4[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x11a81e,null))[_0x0baf('0x16')](handleError(_0x11a81e,null));};exports[_0x0baf('0x52')]=function(_0x4c05d6,_0xec3b32){return respondWithRpcPromise(_0x0baf('0x51'),_0x4c05d6[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x4c05d6[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0xec3b32,null))['catch'](handleError(_0xec3b32,null));};exports[_0x0baf('0x53')]=function(_0x468363,_0x29fd46){return respondWithRpcPromise('FaxQueues',_0x468363[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x29fd46,null))[_0x0baf('0x16')](handleError(_0x29fd46,null));};exports[_0x0baf('0x54')]=function(_0x125906,_0x27a959){return respondWithRpcPromise(_0x0baf('0x55'),_0x125906['query'],routingClient)['then'](findById(_0x125906['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x27a959,null))[_0x0baf('0x16')](handleError(_0x27a959,null));};exports[_0x0baf('0x56')]=function(_0x12b9b5,_0x3e65d4){return respondWithRpcPromise(_0x0baf('0x57'),_0x12b9b5['query'])['then'](respondWithResult(_0x3e65d4,null))[_0x0baf('0x16')](handleError(_0x3e65d4,null));};exports['chatQueuesWaitingInteractions']=function(_0x22cd07,_0x3e9b79){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x22cd07[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x3e9b79,null))[_0x0baf('0x16')](handleError(_0x3e9b79,null));};exports[_0x0baf('0x58')]=function(_0x115ff5,_0x33a5af){return respondWithRpcPromise(_0x0baf('0x59'),_0x115ff5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x33a5af,null))['catch'](handleError(_0x33a5af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x58a079,_0x493784){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x58a079[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x493784,null))[_0x0baf('0x16')](handleError(_0x493784,null));};exports[_0x0baf('0x5a')]=function(_0x5093f5,_0x1be7f2){return respondWithRpcPromise(_0x0baf('0x5b'),_0x5093f5['query'],routingClient)['then'](function(_0x43aecd){if(_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')]!==undefined){var _0x442e5f=_(_0x43aecd[_0x0baf('0x13')])[_0x0baf('0x5d')]([_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')],_0x5093f5['params']['id']])[_0x0baf('0x5e')](_0x0baf('0x5f'))['uniq']()[_0x0baf('0x60')]();return _0x43aecd[_0x0baf('0x13')]['filter'](function(_0x97d385){return _0x442e5f[_0x0baf('0x61')](_0x97d385[_0x0baf('0x5f')])>-0x1;});}else{return _0x43aecd[_0x0baf('0x13')][_0x0baf('0x5d')](function(_0x4fc5af){return _0x4fc5af['queue_id']===parseInt(_0x5093f5[_0x0baf('0x1b')]['id']);});}})[_0x0baf('0x9')](respondWithResult(_0x1be7f2,null))['catch'](handleError(_0x1be7f2,null));};exports[_0x0baf('0x62')]=function(_0x59dad5,_0x21ad25){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x59dad5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21ad25,null))[_0x0baf('0x16')](handleError(_0x21ad25,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3c2bc1,_0x5008c5){return respondWithRpcPromise(_0x0baf('0x63'),_0x3c2bc1[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x5008c5,null))[_0x0baf('0x16')](handleError(_0x5008c5,null));};exports[_0x0baf('0x64')]=function(_0x52e845,_0x866e6e){return respondWithRpcPromise(_0x0baf('0x65'),_0x52e845['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x866e6e,null))[_0x0baf('0x16')](handleError(_0x866e6e,null));};exports[_0x0baf('0x66')]=function(_0x379c54){return function(_0x1cbbcc,_0x250df2){var _0xa4fd1b,_0x1cda78;var _0x44ef57=_[_0x0baf('0x67')](_0x379c54);var _0x3b7abf=_0x379c54===_0x0baf('0x68')?'Website':'Account';return db[_0x44ef57+_0x0baf('0x69')][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1cbbcc[_0x0baf('0x1b')]['id']}})['then'](function(_0x507783){if(_[_0x0baf('0x12')](_0x507783)){throw new Error(_0x44ef57+_0x0baf('0x6b'));}_0xa4fd1b=_0x507783;return db[_0x44ef57+_0x0baf('0x6c')][_0x0baf('0x6a')]({'where':{'id':_0x1cbbcc[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x44ef57+_0x0baf('0x6e')],'as':_0x0baf('0x6e')},{'model':db[_0x44ef57+_0x3b7abf],'as':_0x0baf('0x6f')}]});})['then'](function(_0x1590a5){if(_[_0x0baf('0x12')](_0x1590a5)){throw new Error(_0x44ef57+_0x0baf('0x70'));}_0x1cda78=_0x1590a5;return _0x1590a5[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5d26e6={'uniqueid':_0x379c54+'.'+_0x1cda78['id']+'.'+_0x1cda78['Interaction']['id'],'FromUserId':_0x1cbbcc[_0x0baf('0x33')]['id'],'type':_0x0baf('0x72')};_0x5d26e6[_0x44ef57+'MessageId']=_0x1cda78['id'];_0x5d26e6[_0x44ef57+'InteractionId']=_0x1cda78[_0x0baf('0x6e')]['id'];_0x5d26e6[_0x0baf('0x73')+_0x44ef57+_0x3b7abf+'Id']=_0x1cda78['Account']['id'];_0x5d26e6['To'+_0x44ef57+_0x0baf('0x74')]=_0xa4fd1b['id'];return db[_0x44ef57+_0x0baf('0x75')][_0x0baf('0x76')](_0x5d26e6);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x379c54,'interaction':_0x1cda78[_0x0baf('0x6e')],'message':_0x1cda78,'account':_0x1cda78[_0x0baf('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0baf('0x72'),'appdata':_0xa4fd1b[_0x0baf('0x11')]+','+(_0x1cda78[_0x0baf('0x6f')][_0x0baf('0x78')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x250df2,null))[_0x0baf('0x16')](handleError(_0x250df2,null));};};exports[_0x0baf('0x7a')]=function(_0x1e1adb,_0x3bd15b){var _0x3c37b4,_0x195303;if(_['isNil'](_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x7b')])){throw new Error(_0x0baf('0x7c'));}var _0x457ae8=_0x1e1adb[_0x0baf('0x31')]['channel'];var _0x3761b5=_[_0x0baf('0x67')](_0x457ae8);var _0x2eae1b=_0x457ae8===_0x0baf('0x68')?_0x0baf('0x7d'):'Account';return db['User'][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1e1adb['params']['id'],'role':_0x0baf('0x3f')}})['then'](function(_0x32d8b6){if(_[_0x0baf('0x12')](_0x32d8b6)){throw new Error(_0x0baf('0x7e'));}_0x3c37b4=_0x32d8b6;return db[_0x3761b5+_0x0baf('0x6c')]['findOne']({'where':{'id':_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x3761b5+_0x0baf('0x6e')],'as':'Interaction'},{'model':db[_0x3761b5+_0x2eae1b],'as':'Account'}]});})['then'](function(_0x4d4884){if(_[_0x0baf('0x12')](_0x4d4884)){throw new Error(_0x3761b5+_0x0baf('0x70'));}_0x195303=_0x4d4884;return _0x4d4884[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0baf('0x9')](function(){var _0x597830={'uniqueid':_0x457ae8+'.'+_0x195303['id']+'.'+_0x195303[_0x0baf('0x6e')]['id'],'FromUserId':_0x1e1adb[_0x0baf('0x33')]['id'],'type':_0x0baf('0x3f'),'ToUserId':_0x3c37b4['id']};_0x597830[_0x3761b5+'MessageId']=_0x195303['id'];_0x597830[_0x3761b5+_0x0baf('0x7f')]=_0x195303[_0x0baf('0x6e')]['id'];_0x597830['From'+_0x3761b5+_0x2eae1b+'Id']=_0x195303[_0x0baf('0x6f')]['id'];return db[_0x3761b5+'TransferReport'][_0x0baf('0x76')](_0x597830);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x457ae8,'interaction':_0x195303[_0x0baf('0x6e')],'message':_0x195303,'account':_0x195303['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3c37b4[_0x0baf('0x11')]+','+(_0x195303['Account'][_0x0baf('0x80')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})[_0x0baf('0x9')](respondWithResult(_0x3bd15b,null))[_0x0baf('0x16')](handleError(_0x3bd15b,null));}; \ No newline at end of file +var _0xbaf0=['MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','InteractionId','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','status','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions'];(function(_0x6f770a,_0x48ed35){var _0x19af88=function(_0x1ab1cc){while(--_0x1ab1cc){_0x6f770a['push'](_0x6f770a['shift']());}};_0x19af88(++_0x48ed35);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var db=require(_0x0baf('0x3'))['db'];var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232a});var mailClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232b});var routingClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){var _0x5f20aa=_0x1d0a0d?_0x1d0a0d:amiClient;return _0x5f20aa[_0x0baf('0x8')](_0x1a10b1,_0x2dcaac)[_0x0baf('0x9')](function(_0x465528){if(_0x465528[_0x0baf('0xa')]){if(_0x465528[_0x0baf('0xa')][_0x0baf('0xb')]===0x1f4){return _0x11b947(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}return _0x5f5030(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}else{_0x5f5030(_0x465528[_0x0baf('0xd')]);}})['catch'](function(_0x5a53e2){_0x11b947(_0x5a53e2);});});}function respondWithResult(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xc8;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0xe')](_0xe4378c)['json'](_0x5db689);}return _0x465dd7[_0x0baf('0xf')](0x194);};}function handleError(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0x1f4;return function(_0x1f50c3){logger[_0x0baf('0xa')](_0x1f50c3[_0x0baf('0x10')]);if(_0x1f50c3[_0x0baf('0x11')]){delete _0x1f50c3[_0x0baf('0x11')];}_0x49e44b['status'](_0x1c76a8)['send'](_0x1f50c3);};}function findById(_0x2312c7){return function(_0x38395b){if(!_[_0x0baf('0x12')](_0x2312c7)&&!_[_0x0baf('0x12')](_0x38395b)&&!_[_0x0baf('0x12')](_0x38395b[_0x0baf('0x13')])){return _['find'](_0x38395b[_0x0baf('0x13')],function(_0xfbecec){return _0xfbecec['id']==_0x2312c7;});}return null;};}exports[_0x0baf('0x14')]=function(_0x3e9cb4,_0x47070d){return respondWithRpcPromise(_0x0baf('0x15'),_0x3e9cb4['query'])['then'](respondWithResult(_0x47070d,null))[_0x0baf('0x16')](handleError(_0x47070d,null));};exports[_0x0baf('0x17')]=function(_0x32e839,_0x1848e8){return respondWithRpcPromise(_0x0baf('0x18'),_[_0x0baf('0x19')](_0x32e839[_0x0baf('0x1a')],_0x32e839[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1848e8,null))[_0x0baf('0x16')](handleError(_0x1848e8,null));};exports['voiceChannelStopMixMonitor']=function(_0x334bd6,_0x482522){return respondWithRpcPromise(_0x0baf('0x1c'),_['merge'](_0x334bd6['query'],_0x334bd6[_0x0baf('0x1b')]))['then'](respondWithResult(_0x482522,null))['catch'](handleError(_0x482522,null));};exports[_0x0baf('0x1d')]=function(_0x27b59c,_0x34e264){return respondWithRpcPromise(_0x0baf('0x1e'),_0x27b59c[_0x0baf('0x1a')])['then'](respondWithResult(_0x34e264,null))[_0x0baf('0x16')](handleError(_0x34e264,null));};exports[_0x0baf('0x1f')]=function(_0x1ca35a,_0x366e71){return respondWithRpcPromise(_0x0baf('0x1e'),_0x1ca35a[_0x0baf('0x1a')])[_0x0baf('0x9')](findById(_0x1ca35a['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x366e71,null))[_0x0baf('0x16')](handleError(_0x366e71,null));};exports[_0x0baf('0x20')]=function(_0x265915,_0x55c715){return respondWithRpcPromise(_0x0baf('0x21'),_[_0x0baf('0x19')](_0x265915['body'],_0x265915[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x55c715,null))[_0x0baf('0x16')](handleError(_0x55c715,null));};exports[_0x0baf('0x22')]=function(_0xd14f0f,_0x366924){return respondWithRpcPromise(_0x0baf('0x23'),_['merge'](_0xd14f0f[_0x0baf('0x1a')],_0xd14f0f[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x366924,null))[_0x0baf('0x16')](handleError(_0x366924,null));};exports[_0x0baf('0x24')]=function(_0x275ea1,_0x2fc983){return respondWithRpcPromise(_0x0baf('0x25'),_0x275ea1[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x2fc983,null))[_0x0baf('0x16')](handleError(_0x2fc983,null));};exports[_0x0baf('0x26')]=function(_0x45294a,_0x3a3353){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0baf('0x19')](_0x45294a['query'],_0x45294a[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x3a3353,null))[_0x0baf('0x16')](handleError(_0x3a3353,null));};exports[_0x0baf('0x27')]=function(_0x5300a5,_0x1a2b03){return respondWithRpcPromise(_0x0baf('0x28'),_['merge'](_0x5300a5[_0x0baf('0x1a')],_0x5300a5[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1a2b03,null))[_0x0baf('0x16')](handleError(_0x1a2b03,null));};exports[_0x0baf('0x29')]=function(_0x1b0991,_0xe03d82){return respondWithRpcPromise(_0x0baf('0x2a'),_['merge'](_0x1b0991[_0x0baf('0x1a')],_0x1b0991[_0x0baf('0x1b')]))['then'](respondWithResult(_0xe03d82,null))[_0x0baf('0x16')](handleError(_0xe03d82,null));};exports['outbound']=function(_0x5c545f,_0x11bc49){return respondWithRpcPromise(_0x0baf('0x2b'),_0x5c545f['query'])['then'](respondWithResult(_0x11bc49,null))[_0x0baf('0x16')](handleError(_0x11bc49,null));};exports[_0x0baf('0x2c')]=function(_0x3412bc,_0xb2d9ab){return respondWithRpcPromise(_0x0baf('0x2d'),_0x3412bc[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0xb2d9ab,null))[_0x0baf('0x16')](handleError(_0xb2d9ab,null));};exports[_0x0baf('0x2e')]=function(_0x36c6d2,_0x200864){var _0x148540;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2[_0x0baf('0x1a')])['then'](function(_0x3573ce){_0x148540=_0x3573ce;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2['query'],routingClient);})[_0x0baf('0x9')](function(_0x324369){return _[_0x0baf('0x19')]({},_0x324369,_0x148540);})[_0x0baf('0x9')](respondWithResult(_0x200864,null))[_0x0baf('0x16')](handleError(_0x200864,null));};exports[_0x0baf('0x30')]=function(_0x57b581,_0x23ad34){if(_0x57b581[_0x0baf('0x31')]&&_0x57b581['body'][_0x0baf('0x32')]&&_0x57b581[_0x0baf('0x33')]&&_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]){for(var _0x504031 in _0x57b581[_0x0baf('0x31')][_0x0baf('0x32')]){if(_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x0baf('0x34')](_0x504031)){db[_0x0baf('0x35')][_0x0baf('0x36')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':_0x0baf('0x37'),'exitAt':null,'uniqueid':_0x57b581['body'][_0x0baf('0x32')][_0x504031]&&_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')]?{'$notIn':_0x57b581[_0x0baf('0x31')]['interaction'][_0x504031]}:{'$ne':null}}})[_0x0baf('0x9')](function(_0x310240){var _0x27c3ee=moment()[_0x0baf('0x39')](_0x0baf('0x3a'));for(var _0x54ed41=0x0,_0x2a0924=_0x310240[_0x0baf('0x38')];_0x54ed41<_0x2a0924;_0x54ed41+=0x1){_0x310240[_0x54ed41][_0x0baf('0x3b')]({'exitAt':_0x27c3ee});}});for(var _0x1522b0=0x0;_0x1522b0<_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')];_0x1522b0+=0x1){db['MemberReport'][_0x0baf('0x3c')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':'INTERACTION','uniqueid':_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x1522b0],'exitAt':null},'defaults':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'interface':_[_0x0baf('0x12')](_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')])?util['format'](_0x0baf('0x3e'),_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]):_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')],'type':_0x0baf('0x37'),'enterAt':moment()[_0x0baf('0x39')](_0x0baf('0x3a')),'role':_0x0baf('0x3f'),'internal':_0x57b581[_0x0baf('0x33')][_0x0baf('0x40')],'uniqueid':_0x57b581['body']['interaction'][_0x504031][_0x1522b0]}});}}}}return respondWithRpcPromise(_0x0baf('0x41'),{'id':_0x57b581[_0x0baf('0x1b')]['id'],'capacity':_0x57b581[_0x0baf('0x31')][_0x0baf('0x42')]},routingClient)[_0x0baf('0x9')](respondWithResult(_0x23ad34,null))[_0x0baf('0x16')](handleError(_0x23ad34,null));};exports[_0x0baf('0x43')]=function(_0x4b492c,_0x3fe534){return respondWithRpcPromise(_0x0baf('0x44'),_0x4b492c[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x3fe534,null))[_0x0baf('0x16')](handleError(_0x3fe534,null));};exports[_0x0baf('0x45')]=function(_0x5e1849,_0x3eebe5){return respondWithRpcPromise('Trunks',_0x5e1849[_0x0baf('0x1a')])['then'](respondWithResult(_0x3eebe5,null))[_0x0baf('0x16')](handleError(_0x3eebe5,null));};exports['campaigns']=function(_0x35b1a5,_0x4c035b){return respondWithRpcPromise(_0x0baf('0x46'),_0x35b1a5[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x4c035b,null))[_0x0baf('0x16')](handleError(_0x4c035b,null));};exports[_0x0baf('0x47')]=function(_0x576475,_0x21f179){return respondWithRpcPromise(_0x0baf('0x48'),_0x576475[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21f179,null))[_0x0baf('0x16')](handleError(_0x21f179,null));};exports[_0x0baf('0x49')]=function(_0x480834,_0x402f4d){return respondWithRpcPromise(_0x0baf('0x48'),_0x480834[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x480834[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x402f4d,null))[_0x0baf('0x16')](handleError(_0x402f4d,null));};exports['mailQueues']=function(_0x48e855,_0x23f6ea){return respondWithRpcPromise(_0x0baf('0x4a'),_0x48e855[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x23f6ea,null))[_0x0baf('0x16')](handleError(_0x23f6ea,null));};exports[_0x0baf('0x4b')]=function(_0xaa4293,_0x14a667){return respondWithRpcPromise(_0x0baf('0x4a'),_0xaa4293['query'],routingClient)[_0x0baf('0x9')](findById(_0xaa4293[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x14a667,null))[_0x0baf('0x16')](handleError(_0x14a667,null));};exports[_0x0baf('0x4c')]=function(_0xebfc0c,_0x26f5c9){return respondWithRpcPromise('MailAccounts',_0xebfc0c[_0x0baf('0x1a')],mailClient)[_0x0baf('0x9')](respondWithResult(_0x26f5c9,null))[_0x0baf('0x16')](handleError(_0x26f5c9,null));};exports[_0x0baf('0x4d')]=function(_0x1c7d88,_0x1a6d22){return respondWithRpcPromise(_0x0baf('0x4e'),_0x1c7d88[_0x0baf('0x1a')],routingClient)['then'](respondWithResult(_0x1a6d22,null))[_0x0baf('0x16')](handleError(_0x1a6d22,null));};exports['showOpenchannelQueues']=function(_0x3c00e7,_0x5f2fbe){return respondWithRpcPromise('OpenchannelQueues',_0x3c00e7[_0x0baf('0x1a')],routingClient)['then'](findById(_0x3c00e7[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x5f2fbe,null))['catch'](handleError(_0x5f2fbe,null));};exports[_0x0baf('0x4f')]=function(_0xfb6708,_0x156572){return respondWithRpcPromise('SmsQueues',_0xfb6708['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x156572,null))[_0x0baf('0x16')](handleError(_0x156572,null));};exports[_0x0baf('0x50')]=function(_0x7f49e,_0x784e1a){return respondWithRpcPromise('SmsQueues',_0x7f49e[_0x0baf('0x1a')],routingClient)['then'](findById(_0x7f49e['params']['id']))['then'](respondWithResult(_0x784e1a,null))[_0x0baf('0x16')](handleError(_0x784e1a,null));};exports['whatsappQueues']=function(_0x4946d4,_0x11a81e){return respondWithRpcPromise(_0x0baf('0x51'),_0x4946d4[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x11a81e,null))[_0x0baf('0x16')](handleError(_0x11a81e,null));};exports[_0x0baf('0x52')]=function(_0x4c05d6,_0xec3b32){return respondWithRpcPromise(_0x0baf('0x51'),_0x4c05d6[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x4c05d6[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0xec3b32,null))['catch'](handleError(_0xec3b32,null));};exports[_0x0baf('0x53')]=function(_0x468363,_0x29fd46){return respondWithRpcPromise('FaxQueues',_0x468363[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x29fd46,null))[_0x0baf('0x16')](handleError(_0x29fd46,null));};exports[_0x0baf('0x54')]=function(_0x125906,_0x27a959){return respondWithRpcPromise(_0x0baf('0x55'),_0x125906['query'],routingClient)['then'](findById(_0x125906['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x27a959,null))[_0x0baf('0x16')](handleError(_0x27a959,null));};exports[_0x0baf('0x56')]=function(_0x12b9b5,_0x3e65d4){return respondWithRpcPromise(_0x0baf('0x57'),_0x12b9b5['query'])['then'](respondWithResult(_0x3e65d4,null))[_0x0baf('0x16')](handleError(_0x3e65d4,null));};exports['chatQueuesWaitingInteractions']=function(_0x22cd07,_0x3e9b79){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x22cd07[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x3e9b79,null))[_0x0baf('0x16')](handleError(_0x3e9b79,null));};exports[_0x0baf('0x58')]=function(_0x115ff5,_0x33a5af){return respondWithRpcPromise(_0x0baf('0x59'),_0x115ff5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x33a5af,null))['catch'](handleError(_0x33a5af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x58a079,_0x493784){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x58a079[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x493784,null))[_0x0baf('0x16')](handleError(_0x493784,null));};exports[_0x0baf('0x5a')]=function(_0x5093f5,_0x1be7f2){return respondWithRpcPromise(_0x0baf('0x5b'),_0x5093f5['query'],routingClient)['then'](function(_0x43aecd){if(_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')]!==undefined){var _0x442e5f=_(_0x43aecd[_0x0baf('0x13')])[_0x0baf('0x5d')]([_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')],_0x5093f5['params']['id']])[_0x0baf('0x5e')](_0x0baf('0x5f'))['uniq']()[_0x0baf('0x60')]();return _0x43aecd[_0x0baf('0x13')]['filter'](function(_0x97d385){return _0x442e5f[_0x0baf('0x61')](_0x97d385[_0x0baf('0x5f')])>-0x1;});}else{return _0x43aecd[_0x0baf('0x13')][_0x0baf('0x5d')](function(_0x4fc5af){return _0x4fc5af['queue_id']===parseInt(_0x5093f5[_0x0baf('0x1b')]['id']);});}})[_0x0baf('0x9')](respondWithResult(_0x1be7f2,null))['catch'](handleError(_0x1be7f2,null));};exports[_0x0baf('0x62')]=function(_0x59dad5,_0x21ad25){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x59dad5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21ad25,null))[_0x0baf('0x16')](handleError(_0x21ad25,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3c2bc1,_0x5008c5){return respondWithRpcPromise(_0x0baf('0x63'),_0x3c2bc1[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x5008c5,null))[_0x0baf('0x16')](handleError(_0x5008c5,null));};exports[_0x0baf('0x64')]=function(_0x52e845,_0x866e6e){return respondWithRpcPromise(_0x0baf('0x65'),_0x52e845['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x866e6e,null))[_0x0baf('0x16')](handleError(_0x866e6e,null));};exports[_0x0baf('0x66')]=function(_0x379c54){return function(_0x1cbbcc,_0x250df2){var _0xa4fd1b,_0x1cda78;var _0x44ef57=_[_0x0baf('0x67')](_0x379c54);var _0x3b7abf=_0x379c54===_0x0baf('0x68')?'Website':'Account';return db[_0x44ef57+_0x0baf('0x69')][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1cbbcc[_0x0baf('0x1b')]['id']}})['then'](function(_0x507783){if(_[_0x0baf('0x12')](_0x507783)){throw new Error(_0x44ef57+_0x0baf('0x6b'));}_0xa4fd1b=_0x507783;return db[_0x44ef57+_0x0baf('0x6c')][_0x0baf('0x6a')]({'where':{'id':_0x1cbbcc[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x44ef57+_0x0baf('0x6e')],'as':_0x0baf('0x6e')},{'model':db[_0x44ef57+_0x3b7abf],'as':_0x0baf('0x6f')}]});})['then'](function(_0x1590a5){if(_[_0x0baf('0x12')](_0x1590a5)){throw new Error(_0x44ef57+_0x0baf('0x70'));}_0x1cda78=_0x1590a5;return _0x1590a5[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5d26e6={'uniqueid':_0x379c54+'.'+_0x1cda78['id']+'.'+_0x1cda78['Interaction']['id'],'FromUserId':_0x1cbbcc[_0x0baf('0x33')]['id'],'type':_0x0baf('0x72')};_0x5d26e6[_0x44ef57+'MessageId']=_0x1cda78['id'];_0x5d26e6[_0x44ef57+'InteractionId']=_0x1cda78[_0x0baf('0x6e')]['id'];_0x5d26e6[_0x0baf('0x73')+_0x44ef57+_0x3b7abf+'Id']=_0x1cda78['Account']['id'];_0x5d26e6['To'+_0x44ef57+_0x0baf('0x74')]=_0xa4fd1b['id'];return db[_0x44ef57+_0x0baf('0x75')][_0x0baf('0x76')](_0x5d26e6);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x379c54,'interaction':_0x1cda78[_0x0baf('0x6e')],'message':_0x1cda78,'account':_0x1cda78[_0x0baf('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0baf('0x72'),'appdata':_0xa4fd1b[_0x0baf('0x11')]+','+(_0x1cda78[_0x0baf('0x6f')][_0x0baf('0x78')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x250df2,null))[_0x0baf('0x16')](handleError(_0x250df2,null));};};exports[_0x0baf('0x7a')]=function(_0x1e1adb,_0x3bd15b){var _0x3c37b4,_0x195303;if(_['isNil'](_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x7b')])){throw new Error(_0x0baf('0x7c'));}var _0x457ae8=_0x1e1adb[_0x0baf('0x31')]['channel'];var _0x3761b5=_[_0x0baf('0x67')](_0x457ae8);var _0x2eae1b=_0x457ae8===_0x0baf('0x68')?_0x0baf('0x7d'):'Account';return db['User'][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1e1adb['params']['id'],'role':_0x0baf('0x3f')}})['then'](function(_0x32d8b6){if(_[_0x0baf('0x12')](_0x32d8b6)){throw new Error(_0x0baf('0x7e'));}_0x3c37b4=_0x32d8b6;return db[_0x3761b5+_0x0baf('0x6c')]['findOne']({'where':{'id':_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x3761b5+_0x0baf('0x6e')],'as':'Interaction'},{'model':db[_0x3761b5+_0x2eae1b],'as':'Account'}]});})['then'](function(_0x4d4884){if(_[_0x0baf('0x12')](_0x4d4884)){throw new Error(_0x3761b5+_0x0baf('0x70'));}_0x195303=_0x4d4884;return _0x4d4884[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0baf('0x9')](function(){var _0x597830={'uniqueid':_0x457ae8+'.'+_0x195303['id']+'.'+_0x195303[_0x0baf('0x6e')]['id'],'FromUserId':_0x1e1adb[_0x0baf('0x33')]['id'],'type':_0x0baf('0x3f'),'ToUserId':_0x3c37b4['id']};_0x597830[_0x3761b5+'MessageId']=_0x195303['id'];_0x597830[_0x3761b5+_0x0baf('0x7f')]=_0x195303[_0x0baf('0x6e')]['id'];_0x597830['From'+_0x3761b5+_0x2eae1b+'Id']=_0x195303[_0x0baf('0x6f')]['id'];return db[_0x3761b5+'TransferReport'][_0x0baf('0x76')](_0x597830);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x457ae8,'interaction':_0x195303[_0x0baf('0x6e')],'message':_0x195303,'account':_0x195303['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3c37b4[_0x0baf('0x11')]+','+(_0x195303['Account'][_0x0baf('0x80')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})[_0x0baf('0x9')](respondWithResult(_0x3bd15b,null))[_0x0baf('0x16')](handleError(_0x3bd15b,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 9778c39..df40d0a 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 _0xc682=['isAuthenticated','index','/:id','show','get','/:id/run','post','create','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0xc682,0x1c6));var _0x2c68=function(_0x577103,_0x33f378){_0x577103=_0x577103-0x0;var _0x273936=_0xc682[_0x577103];return _0x273936;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2c68('0x0'));var timeout=require('connect-timeout');var express=require(_0x2c68('0x1'));var router=express[_0x2c68('0x2')]();var fs_extra=require(_0x2c68('0x3'));var auth=require(_0x2c68('0x4'));var interaction=require(_0x2c68('0x5'));var config=require(_0x2c68('0x6'));var controller=require(_0x2c68('0x7'));router['get']('/',auth[_0x2c68('0x8')](),controller[_0x2c68('0x9')]);router['get'](_0x2c68('0xa'),auth[_0x2c68('0x8')](),controller[_0x2c68('0xb')]);router[_0x2c68('0xc')](_0x2c68('0xd'),auth[_0x2c68('0x8')](),controller['run']);router[_0x2c68('0xe')]('/',auth[_0x2c68('0x8')](),controller[_0x2c68('0xf')]);router[_0x2c68('0x10')]('/:id',auth[_0x2c68('0x8')](),controller[_0x2c68('0x11')]);router[_0x2c68('0x12')](_0x2c68('0xa'),auth['isAuthenticated'](),controller[_0x2c68('0x13')]);module[_0x2c68('0x14')]=router; \ No newline at end of file +var _0x92d2=['../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','/:id/run','run','post','create','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x3b3399,_0x992e2c){var _0x1f9b01=function(_0x3876ef){while(--_0x3876ef){_0x3b3399['push'](_0x3b3399['shift']());}};_0x1f9b01(++_0x992e2c);}(_0x92d2,0x1c2));var _0x292d=function(_0xa03603,_0x5d7ec4){_0xa03603=_0xa03603-0x0;var _0x284472=_0x92d2[_0xa03603];return _0x284472;};'use strict';var multer=require(_0x292d('0x0'));var util=require(_0x292d('0x1'));var path=require(_0x292d('0x2'));var timeout=require('connect-timeout');var express=require(_0x292d('0x3'));var router=express[_0x292d('0x4')]();var fs_extra=require(_0x292d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x292d('0x6'));var controller=require(_0x292d('0x7'));router[_0x292d('0x8')]('/',auth[_0x292d('0x9')](),controller[_0x292d('0xa')]);router['get'](_0x292d('0xb'),auth[_0x292d('0x9')](),controller['show']);router['get'](_0x292d('0xc'),auth[_0x292d('0x9')](),controller[_0x292d('0xd')]);router[_0x292d('0xe')]('/',auth['isAuthenticated'](),controller[_0x292d('0xf')]);router['put'](_0x292d('0xb'),auth[_0x292d('0x9')](),controller['update']);router[_0x292d('0x10')]('/:id',auth[_0x292d('0x9')](),controller[_0x292d('0x11')]);module[_0x292d('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 1bc3204..fd41bb3 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 _0x67b6=['0\x200\x20*\x20*\x20*','INTEGER','ENUM','years','quarters','hours','days','csv','pdf','xlsx','custom','default','TEXT','exports','STRING','BOOLEAN'];(function(_0x2b7a5f,_0x38fdff){var _0x2fb52a=function(_0x464554){while(--_0x464554){_0x2b7a5f['push'](_0x2b7a5f['shift']());}};_0x2fb52a(++_0x38fdff);}(_0x67b6,0x17d));var _0x667b=function(_0x53afd5,_0x5d5023){_0x53afd5=_0x53afd5-0x0;var _0x196370=_0x67b6[_0x53afd5];return _0x196370;};'use strict';var Sequelize=require('sequelize');module[_0x667b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x667b('0x1')]},'active':{'type':Sequelize[_0x667b('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x667b('0x1')],'allowNull':![],'defaultValue':_0x667b('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x667b('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x667b('0x5')](_0x667b('0x6'),_0x667b('0x7'),'months','weeks','days',_0x667b('0x8'),'minutes'),'allowNull':![],'defaultValue':_0x667b('0x9')},'output':{'type':Sequelize['ENUM'](_0x667b('0xa'),_0x667b('0xb'),_0x667b('0xc')),'allowNull':![],'defaultValue':_0x667b('0xa')},'type':{'type':Sequelize[_0x667b('0x5')](_0x667b('0xd'),_0x667b('0xe')),'allowNull':![],'defaultValue':_0x667b('0xd')},'sendMail':{'type':Sequelize[_0x667b('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x667b('0xf')]},'bcc':{'type':Sequelize[_0x667b('0xf')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x6661=['default','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','quarters','months','weeks','hours','minutes','days','csv','pdf','xlsx','custom'];(function(_0x59e5cf,_0x506693){var _0x5a8839=function(_0x6ed328){while(--_0x6ed328){_0x59e5cf['push'](_0x59e5cf['shift']());}};_0x5a8839(++_0x506693);}(_0x6661,0xb5));var _0x1666=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x6661[_0x2555d0];return _0x3bb486;};'use strict';var Sequelize=require(_0x1666('0x0'));module[_0x1666('0x1')]={'name':{'type':Sequelize[_0x1666('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1666('0x2')]},'active':{'type':Sequelize[_0x1666('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x1666('0x2')],'allowNull':![],'defaultValue':_0x1666('0x4')},'startAt':{'type':Sequelize[_0x1666('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x1666('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x1666('0x6')]('years',_0x1666('0x7'),_0x1666('0x8'),_0x1666('0x9'),'days',_0x1666('0xa'),_0x1666('0xb')),'allowNull':![],'defaultValue':_0x1666('0xc')},'output':{'type':Sequelize[_0x1666('0x6')](_0x1666('0xd'),_0x1666('0xe'),_0x1666('0xf')),'allowNull':![],'defaultValue':_0x1666('0xd')},'type':{'type':Sequelize[_0x1666('0x6')](_0x1666('0x10'),_0x1666('0x11')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 5503ec4..9a0214a 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 _0x76b4=['UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','update','then','get','UserProfileResource','destroy','error','stack','name','send','map','Schedule','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','role','user','Scheduler'];(function(_0x1c1679,_0x4a84df){var _0x36671c=function(_0x5200d9){while(--_0x5200d9){_0x1c1679['push'](_0x1c1679['shift']());}};_0x36671c(++_0x4a84df);}(_0x76b4,0xaf));var _0x476b=function(_0x302770,_0x5c4b2b){_0x302770=_0x302770-0x0;var _0x5c40f9=_0x76b4[_0x302770];return _0x5c40f9;};'use strict';var emlformat=require(_0x476b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x476b('0x1'));var rp=require(_0x476b('0x2'));var moment=require('moment');var BPromise=require(_0x476b('0x3'));var Mustache=require(_0x476b('0x4'));var util=require(_0x476b('0x5'));var path=require(_0x476b('0x6'));var sox=require(_0x476b('0x7'));var csv=require('to-csv');var ejs=require(_0x476b('0x8'));var fs=require('fs');var fs_extra=require(_0x476b('0x9'));var _=require(_0x476b('0xa'));var squel=require(_0x476b('0xb'));var crypto=require(_0x476b('0xc'));var jsforce=require(_0x476b('0xd'));var deskjs=require(_0x476b('0xe'));var toCsv=require(_0x476b('0xf'));var querystring=require(_0x476b('0x10'));var Papa=require(_0x476b('0x11'));var Redis=require('ioredis');var authService=require(_0x476b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x476b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x476b('0x14'));var utils=require(_0x476b('0x15'));var config=require(_0x476b('0x16'));var licenseUtil=require(_0x476b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4184a6,_0x31dc94){_0x31dc94=_0x31dc94||0xcc;return function(_0xb8a178){if(_0xb8a178){return _0x4184a6[_0x476b('0x18')](_0x31dc94);}return _0x4184a6[_0x476b('0x19')](_0x31dc94)[_0x476b('0x1a')]();};}function respondWithResult(_0x5a68b6,_0x3741a8){_0x3741a8=_0x3741a8||0xc8;return function(_0x38d0a8){if(_0x38d0a8){return _0x5a68b6[_0x476b('0x19')](_0x3741a8)[_0x476b('0x1b')](_0x38d0a8);}};}function respondWithFilteredResult(_0x216d34,_0x42dafd){return function(_0x1b8173){if(_0x1b8173){var _0x5bc3d9=typeof _0x42dafd['offset']===_0x476b('0x1c')&&typeof _0x42dafd[_0x476b('0x1d')]==='undefined';var _0x568633=_0x1b8173['count'];var _0x2494c3=_0x5bc3d9?0x0:_0x42dafd[_0x476b('0x1e')];var _0x2ce90f=_0x5bc3d9?_0x1b8173[_0x476b('0x1f')]:_0x42dafd[_0x476b('0x1e')]+_0x42dafd[_0x476b('0x1d')];var _0x64f953;if(_0x2ce90f>=_0x568633){_0x2ce90f=_0x568633;_0x64f953=0xc8;}else{_0x64f953=0xce;}_0x216d34[_0x476b('0x19')](_0x64f953);return _0x216d34[_0x476b('0x20')]('Content-Range',_0x2494c3+'-'+_0x2ce90f+'/'+_0x568633)[_0x476b('0x1b')](_0x1b8173);}return null;};}function patchUpdates(_0x361eec){return function(_0x58d885){try{jsonpatch[_0x476b('0x21')](_0x58d885,_0x361eec,!![]);}catch(_0x5625ad){return BPromise[_0x476b('0x22')](_0x5625ad);}return _0x58d885['save']();};}function saveUpdates(_0x481023,_0x1134cb){return function(_0x520053){if(_0x520053){return _0x520053[_0x476b('0x23')](_0x481023)[_0x476b('0x24')](function(_0x25857b){return _0x25857b;});}return null;};}function removeEntity(_0x4150bc,_0x5851e5){return function(_0x4640d5){if(_0x4640d5){return _0x4640d5['destroy']()[_0x476b('0x24')](function(){var _0x4d5630=_0x4640d5[_0x476b('0x25')]({'plain':!![]});var _0xfbe1c9='Scheduler';return db[_0x476b('0x26')][_0x476b('0x27')]({'where':{'type':_0xfbe1c9,'resourceId':_0x4d5630['id']}})[_0x476b('0x24')](function(){return _0x4640d5;});})[_0x476b('0x24')](function(){_0x4150bc['status'](0xcc)[_0x476b('0x1a')]();});}};}function handleEntityNotFound(_0x129df8,_0x2b118d){return function(_0xf8fcef){if(!_0xf8fcef){_0x129df8[_0x476b('0x18')](0x194);}return _0xf8fcef;};}function handleError(_0x452c85,_0x495703){_0x495703=_0x495703||0x1f4;return function(_0xdaceda){logger[_0x476b('0x28')](_0xdaceda[_0x476b('0x29')]);if(_0xdaceda[_0x476b('0x2a')]){delete _0xdaceda[_0x476b('0x2a')];}_0x452c85[_0x476b('0x19')](_0x495703)[_0x476b('0x2b')](_0xdaceda);};}exports['index']=function(_0x5a9775,_0x56d238){var _0xa6b7e={},_0x39a0de={},_0x51f454={'count':0x0,'rows':[]};var _0x1d3502=_[_0x476b('0x2c')](db[_0x476b('0x2d')][_0x476b('0x2e')],function(_0x28dd99){return{'name':_0x28dd99[_0x476b('0x2f')],'type':_0x28dd99['type'][_0x476b('0x30')]};});_0x39a0de[_0x476b('0x31')]=_['map'](_0x1d3502,_0x476b('0x2a'));_0x39a0de[_0x476b('0x32')]=_['keys'](_0x5a9775[_0x476b('0x32')]);_0x39a0de['filters']=_[_0x476b('0x33')](_0x39a0de[_0x476b('0x31')],_0x39a0de['query']);_0xa6b7e[_0x476b('0x34')]=_[_0x476b('0x33')](_0x39a0de[_0x476b('0x31')],qs[_0x476b('0x35')](_0x5a9775[_0x476b('0x32')][_0x476b('0x35')]));_0xa6b7e[_0x476b('0x34')]=_0xa6b7e[_0x476b('0x34')][_0x476b('0x36')]?_0xa6b7e['attributes']:_0x39a0de[_0x476b('0x31')];if(!_0x5a9775['query'][_0x476b('0x37')](_0x476b('0x38'))){_0xa6b7e[_0x476b('0x1d')]=qs[_0x476b('0x1d')](_0x5a9775[_0x476b('0x32')][_0x476b('0x1d')]);_0xa6b7e['offset']=qs['offset'](_0x5a9775[_0x476b('0x32')][_0x476b('0x1e')]);}_0xa6b7e[_0x476b('0x39')]=qs[_0x476b('0x3a')](_0x5a9775[_0x476b('0x32')][_0x476b('0x3a')]);_0xa6b7e['where']=qs[_0x476b('0x3b')](_[_0x476b('0x3c')](_0x5a9775[_0x476b('0x32')],_0x39a0de['filters']),_0x1d3502);if(_0x5a9775[_0x476b('0x32')][_0x476b('0x3d')]){_0xa6b7e[_0x476b('0x3e')]=_[_0x476b('0x3f')](_0xa6b7e[_0x476b('0x3e')],{'$or':_[_0x476b('0x2c')](_0x1d3502,function(_0x97ec14){if(_0x97ec14[_0x476b('0x40')]!==_0x476b('0x41')){var _0x1b347a={};_0x1b347a[_0x97ec14[_0x476b('0x2a')]]={'$like':'%'+_0x5a9775[_0x476b('0x32')]['filter']+'%'};return _0x1b347a;}})});}_0xa6b7e=_[_0x476b('0x3f')]({},_0xa6b7e,_0x5a9775[_0x476b('0x42')]);var _0x35f14a={'where':_0xa6b7e[_0x476b('0x3e')]};return db[_0x476b('0x2d')][_0x476b('0x1f')](_0x35f14a)[_0x476b('0x24')](function(_0x51c1d9){_0x51f454[_0x476b('0x1f')]=_0x51c1d9;if(_0x5a9775['query'][_0x476b('0x43')]){_0xa6b7e[_0x476b('0x44')]=[{'all':!![]}];}return db[_0x476b('0x2d')][_0x476b('0x45')](_0xa6b7e);})[_0x476b('0x24')](function(_0x490b7f){_0x51f454[_0x476b('0x46')]=_0x490b7f;return _0x51f454;})[_0x476b('0x24')](respondWithFilteredResult(_0x56d238,_0xa6b7e))[_0x476b('0x47')](handleError(_0x56d238,null));};exports[_0x476b('0x48')]=function(_0x3d2b78,_0x1a0534){var _0x56986b={'raw':![],'where':{'id':_0x3d2b78[_0x476b('0x49')]['id']}},_0x30f4f9={};_0x30f4f9[_0x476b('0x31')]=_[_0x476b('0x4a')](db[_0x476b('0x2d')][_0x476b('0x2e')]);_0x30f4f9['query']=_[_0x476b('0x4a')](_0x3d2b78[_0x476b('0x32')]);_0x30f4f9[_0x476b('0x3b')]=_[_0x476b('0x33')](_0x30f4f9[_0x476b('0x31')],_0x30f4f9[_0x476b('0x32')]);_0x56986b['attributes']=_['intersection'](_0x30f4f9[_0x476b('0x31')],qs[_0x476b('0x35')](_0x3d2b78[_0x476b('0x32')][_0x476b('0x35')]));_0x56986b[_0x476b('0x34')]=_0x56986b['attributes']['length']?_0x56986b[_0x476b('0x34')]:_0x30f4f9[_0x476b('0x31')];if(_0x3d2b78[_0x476b('0x32')]['includeAll']){_0x56986b[_0x476b('0x44')]=[{'all':!![]}];}_0x56986b=_[_0x476b('0x3f')]({},_0x56986b,_0x3d2b78['options']);return db[_0x476b('0x2d')][_0x476b('0x4b')](_0x56986b)[_0x476b('0x24')](handleEntityNotFound(_0x1a0534,null))['then'](respondWithResult(_0x1a0534,null))[_0x476b('0x47')](handleError(_0x1a0534,null));};exports[_0x476b('0x4c')]=function(_0x2d706d,_0x3e0fdf){return db[_0x476b('0x2d')][_0x476b('0x4c')](_0x2d706d['body'],{})[_0x476b('0x24')](function(_0x26d573){var _0x11daa3=_0x2d706d['user']['get']({'plain':!![]});if(!_0x11daa3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11daa3[_0x476b('0x4d')]===_0x476b('0x4e')){var _0x5994f0=_0x26d573[_0x476b('0x25')]({'plain':!![]});var _0x23602a=_0x476b('0x4f');return db[_0x476b('0x50')][_0x476b('0x4b')]({'where':{'name':_0x23602a,'userProfileId':_0x11daa3[_0x476b('0x51')]},'raw':!![]})['then'](function(_0x19995a){if(_0x19995a&&_0x19995a['autoAssociation']===0x0){return db['UserProfileResource'][_0x476b('0x4c')]({'name':_0x5994f0['name'],'resourceId':_0x5994f0['id'],'type':_0x19995a[_0x476b('0x2a')],'sectionId':_0x19995a['id']},{})['then'](function(){return _0x26d573;});}else{return _0x26d573;}})['catch'](function(_0x3fa24c){logger[_0x476b('0x28')](_0x476b('0x52'),_0x3fa24c);throw _0x3fa24c;});}return _0x26d573;})[_0x476b('0x24')](respondWithResult(_0x3e0fdf,0xc9))[_0x476b('0x47')](handleError(_0x3e0fdf,null));};exports['update']=function(_0x48f1e5,_0x2c794a){if(_0x48f1e5[_0x476b('0x53')]['id']){delete _0x48f1e5[_0x476b('0x53')]['id'];}return db[_0x476b('0x2d')][_0x476b('0x4b')]({'where':{'id':_0x48f1e5[_0x476b('0x49')]['id']}})[_0x476b('0x24')](handleEntityNotFound(_0x2c794a,null))[_0x476b('0x24')](saveUpdates(_0x48f1e5[_0x476b('0x53')],null))[_0x476b('0x24')](respondWithResult(_0x2c794a,null))[_0x476b('0x47')](handleError(_0x2c794a,null));};exports[_0x476b('0x27')]=function(_0x102d07,_0x18dc26){return db[_0x476b('0x2d')]['find']({'where':{'id':_0x102d07[_0x476b('0x49')]['id']}})[_0x476b('0x24')](handleEntityNotFound(_0x18dc26,null))[_0x476b('0x24')](removeEntity(_0x18dc26,null))['catch'](handleError(_0x18dc26,null));};exports[_0x476b('0x54')]=function(_0x11e093,_0x5e42cd,_0x2ac60f){var _0x402d72=require('../../config/schedule');return db[_0x476b('0x2d')][_0x476b('0x4b')]({'where':{'id':_0x11e093[_0x476b('0x49')]['id']},'raw':!![]})[_0x476b('0x24')](handleEntityNotFound(_0x5e42cd,null))['then'](function(){_0x402d72['run'](_0x11e093[_0x476b('0x49')]['id']);})[_0x476b('0x24')](respondWithStatusCode(_0x5e42cd,null))[_0x476b('0x47')](handleError(_0x5e42cd,null));}; \ No newline at end of file +var _0x9fb4=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','end','sendStatus','error','stack','name','index','map','Schedule','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','include','rows','catch','show','params','keys','find','create','body','user','role','Scheduler','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x286ee4,_0x255a92){var _0x300e4c=function(_0x21637b){while(--_0x21637b){_0x286ee4['push'](_0x286ee4['shift']());}};_0x300e4c(++_0x255a92);}(_0x9fb4,0x1c6));var _0x49fb=function(_0x4a7193,_0x556c6a){_0x4a7193=_0x4a7193-0x0;var _0xc33d94=_0x9fb4[_0x4a7193];return _0xc33d94;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49fb('0x0'));var jsonpatch=require(_0x49fb('0x1'));var rp=require(_0x49fb('0x2'));var moment=require(_0x49fb('0x3'));var BPromise=require(_0x49fb('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x49fb('0x5'));var csv=require(_0x49fb('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x49fb('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x49fb('0x8'));var jsforce=require(_0x49fb('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x49fb('0x6'));var querystring=require('querystring');var Papa=require(_0x49fb('0xa'));var Redis=require('ioredis');var authService=require(_0x49fb('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x49fb('0xc'));var hardwareService=require(_0x49fb('0xd'));var logger=require(_0x49fb('0xe'))(_0x49fb('0xf'));var utils=require(_0x49fb('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x49fb('0x11'));var db=require(_0x49fb('0x12'))['db'];function respondWithStatusCode(_0x547501,_0x3a7ac){_0x3a7ac=_0x3a7ac||0xcc;return function(_0xc05d5d){if(_0xc05d5d){return _0x547501['sendStatus'](_0x3a7ac);}return _0x547501[_0x49fb('0x13')](_0x3a7ac)['end']();};}function respondWithResult(_0x1d00af,_0xf7aa7d){_0xf7aa7d=_0xf7aa7d||0xc8;return function(_0x40802f){if(_0x40802f){return _0x1d00af['status'](_0xf7aa7d)[_0x49fb('0x14')](_0x40802f);}};}function respondWithFilteredResult(_0x2afa60,_0x175248){return function(_0x7682b6){if(_0x7682b6){var _0x5a6496=typeof _0x175248[_0x49fb('0x15')]===_0x49fb('0x16')&&typeof _0x175248['limit']===_0x49fb('0x16');var _0x4c9ede=_0x7682b6['count'];var _0x44e1e9=_0x5a6496?0x0:_0x175248['offset'];var _0x3af98e=_0x5a6496?_0x7682b6['count']:_0x175248[_0x49fb('0x15')]+_0x175248['limit'];var _0x453cb5;if(_0x3af98e>=_0x4c9ede){_0x3af98e=_0x4c9ede;_0x453cb5=0xc8;}else{_0x453cb5=0xce;}_0x2afa60[_0x49fb('0x13')](_0x453cb5);return _0x2afa60['set'](_0x49fb('0x17'),_0x44e1e9+'-'+_0x3af98e+'/'+_0x4c9ede)['json'](_0x7682b6);}return null;};}function patchUpdates(_0x3568df){return function(_0x10118a){try{jsonpatch[_0x49fb('0x18')](_0x10118a,_0x3568df,!![]);}catch(_0x1632b6){return BPromise[_0x49fb('0x19')](_0x1632b6);}return _0x10118a[_0x49fb('0x1a')]();};}function saveUpdates(_0x256eec,_0x3148ea){return function(_0x11e787){if(_0x11e787){return _0x11e787[_0x49fb('0x1b')](_0x256eec)['then'](function(_0x483db9){return _0x483db9;});}return null;};}function removeEntity(_0x3c64a9,_0x270ba6){return function(_0x3b99c0){if(_0x3b99c0){return _0x3b99c0[_0x49fb('0x1c')]()[_0x49fb('0x1d')](function(){var _0x13658a=_0x3b99c0[_0x49fb('0x1e')]({'plain':!![]});var _0x4205eb='Scheduler';return db[_0x49fb('0x1f')]['destroy']({'where':{'type':_0x4205eb,'resourceId':_0x13658a['id']}})[_0x49fb('0x1d')](function(){return _0x3b99c0;});})['then'](function(){_0x3c64a9['status'](0xcc)[_0x49fb('0x20')]();});}};}function handleEntityNotFound(_0x473ba7,_0x187372){return function(_0x102db2){if(!_0x102db2){_0x473ba7[_0x49fb('0x21')](0x194);}return _0x102db2;};}function handleError(_0x1dc428,_0x5184da){_0x5184da=_0x5184da||0x1f4;return function(_0x132a7e){logger[_0x49fb('0x22')](_0x132a7e[_0x49fb('0x23')]);if(_0x132a7e[_0x49fb('0x24')]){delete _0x132a7e[_0x49fb('0x24')];}_0x1dc428[_0x49fb('0x13')](_0x5184da)['send'](_0x132a7e);};}exports[_0x49fb('0x25')]=function(_0x12bc64,_0x107565){var _0x55e635={},_0x2c5326={},_0x31442e={'count':0x0,'rows':[]};var _0x211cc7=_[_0x49fb('0x26')](db[_0x49fb('0x27')][_0x49fb('0x28')],function(_0x2e71a5){return{'name':_0x2e71a5[_0x49fb('0x29')],'type':_0x2e71a5['type']['key']};});_0x2c5326[_0x49fb('0x2a')]=_[_0x49fb('0x26')](_0x211cc7,_0x49fb('0x24'));_0x2c5326[_0x49fb('0x2b')]=_['keys'](_0x12bc64['query']);_0x2c5326[_0x49fb('0x2c')]=_['intersection'](_0x2c5326['model'],_0x2c5326['query']);_0x55e635['attributes']=_[_0x49fb('0x2d')](_0x2c5326[_0x49fb('0x2a')],qs[_0x49fb('0x2e')](_0x12bc64[_0x49fb('0x2b')][_0x49fb('0x2e')]));_0x55e635[_0x49fb('0x2f')]=_0x55e635['attributes'][_0x49fb('0x30')]?_0x55e635['attributes']:_0x2c5326[_0x49fb('0x2a')];if(!_0x12bc64[_0x49fb('0x2b')]['hasOwnProperty'](_0x49fb('0x31'))){_0x55e635[_0x49fb('0x32')]=qs[_0x49fb('0x32')](_0x12bc64[_0x49fb('0x2b')][_0x49fb('0x32')]);_0x55e635[_0x49fb('0x15')]=qs['offset'](_0x12bc64['query'][_0x49fb('0x15')]);}_0x55e635[_0x49fb('0x33')]=qs[_0x49fb('0x34')](_0x12bc64['query']['sort']);_0x55e635[_0x49fb('0x35')]=qs['filters'](_[_0x49fb('0x36')](_0x12bc64[_0x49fb('0x2b')],_0x2c5326[_0x49fb('0x2c')]),_0x211cc7);if(_0x12bc64[_0x49fb('0x2b')][_0x49fb('0x37')]){_0x55e635[_0x49fb('0x35')]=_[_0x49fb('0x38')](_0x55e635[_0x49fb('0x35')],{'$or':_['map'](_0x211cc7,function(_0x439335){if(_0x439335[_0x49fb('0x39')]!==_0x49fb('0x3a')){var _0x54a140={};_0x54a140[_0x439335[_0x49fb('0x24')]]={'$like':'%'+_0x12bc64['query']['filter']+'%'};return _0x54a140;}})});}_0x55e635=_[_0x49fb('0x38')]({},_0x55e635,_0x12bc64[_0x49fb('0x3b')]);var _0xa4f5f8={'where':_0x55e635[_0x49fb('0x35')]};return db[_0x49fb('0x27')]['count'](_0xa4f5f8)[_0x49fb('0x1d')](function(_0x541d30){_0x31442e[_0x49fb('0x3c')]=_0x541d30;if(_0x12bc64[_0x49fb('0x2b')]['includeAll']){_0x55e635[_0x49fb('0x3d')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x55e635);})[_0x49fb('0x1d')](function(_0xa84e32){_0x31442e[_0x49fb('0x3e')]=_0xa84e32;return _0x31442e;})[_0x49fb('0x1d')](respondWithFilteredResult(_0x107565,_0x55e635))[_0x49fb('0x3f')](handleError(_0x107565,null));};exports[_0x49fb('0x40')]=function(_0x54a300,_0x2d9c26){var _0x51fc66={'raw':![],'where':{'id':_0x54a300[_0x49fb('0x41')]['id']}},_0x341694={};_0x341694[_0x49fb('0x2a')]=_[_0x49fb('0x42')](db[_0x49fb('0x27')][_0x49fb('0x28')]);_0x341694[_0x49fb('0x2b')]=_[_0x49fb('0x42')](_0x54a300['query']);_0x341694[_0x49fb('0x2c')]=_['intersection'](_0x341694[_0x49fb('0x2a')],_0x341694[_0x49fb('0x2b')]);_0x51fc66[_0x49fb('0x2f')]=_[_0x49fb('0x2d')](_0x341694[_0x49fb('0x2a')],qs['fields'](_0x54a300[_0x49fb('0x2b')][_0x49fb('0x2e')]));_0x51fc66[_0x49fb('0x2f')]=_0x51fc66[_0x49fb('0x2f')][_0x49fb('0x30')]?_0x51fc66[_0x49fb('0x2f')]:_0x341694[_0x49fb('0x2a')];if(_0x54a300[_0x49fb('0x2b')]['includeAll']){_0x51fc66[_0x49fb('0x3d')]=[{'all':!![]}];}_0x51fc66=_[_0x49fb('0x38')]({},_0x51fc66,_0x54a300['options']);return db[_0x49fb('0x27')][_0x49fb('0x43')](_0x51fc66)[_0x49fb('0x1d')](handleEntityNotFound(_0x2d9c26,null))[_0x49fb('0x1d')](respondWithResult(_0x2d9c26,null))[_0x49fb('0x3f')](handleError(_0x2d9c26,null));};exports[_0x49fb('0x44')]=function(_0x5e914b,_0x4ef9f3){return db[_0x49fb('0x27')][_0x49fb('0x44')](_0x5e914b[_0x49fb('0x45')],{})['then'](function(_0xee50a5){var _0x214ac7=_0x5e914b[_0x49fb('0x46')][_0x49fb('0x1e')]({'plain':!![]});if(!_0x214ac7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x214ac7[_0x49fb('0x47')]==='user'){var _0x31eb5d=_0xee50a5[_0x49fb('0x1e')]({'plain':!![]});var _0x173c7a=_0x49fb('0x48');return db[_0x49fb('0x49')][_0x49fb('0x43')]({'where':{'name':_0x173c7a,'userProfileId':_0x214ac7[_0x49fb('0x4a')]},'raw':!![]})['then'](function(_0x12bda1){if(_0x12bda1&&_0x12bda1[_0x49fb('0x4b')]===0x0){return db['UserProfileResource'][_0x49fb('0x44')]({'name':_0x31eb5d[_0x49fb('0x24')],'resourceId':_0x31eb5d['id'],'type':_0x12bda1[_0x49fb('0x24')],'sectionId':_0x12bda1['id']},{})[_0x49fb('0x1d')](function(){return _0xee50a5;});}else{return _0xee50a5;}})[_0x49fb('0x3f')](function(_0x56fdae){logger['error'](_0x49fb('0x4c'),_0x56fdae);throw _0x56fdae;});}return _0xee50a5;})[_0x49fb('0x1d')](respondWithResult(_0x4ef9f3,0xc9))[_0x49fb('0x3f')](handleError(_0x4ef9f3,null));};exports[_0x49fb('0x1b')]=function(_0x7df199,_0x5b1baf){if(_0x7df199[_0x49fb('0x45')]['id']){delete _0x7df199[_0x49fb('0x45')]['id'];}return db[_0x49fb('0x27')][_0x49fb('0x43')]({'where':{'id':_0x7df199[_0x49fb('0x41')]['id']}})['then'](handleEntityNotFound(_0x5b1baf,null))['then'](saveUpdates(_0x7df199[_0x49fb('0x45')],null))['then'](respondWithResult(_0x5b1baf,null))[_0x49fb('0x3f')](handleError(_0x5b1baf,null));};exports[_0x49fb('0x1c')]=function(_0x52c4d1,_0x3b27ff){return db[_0x49fb('0x27')][_0x49fb('0x43')]({'where':{'id':_0x52c4d1[_0x49fb('0x41')]['id']}})[_0x49fb('0x1d')](handleEntityNotFound(_0x3b27ff,null))[_0x49fb('0x1d')](removeEntity(_0x3b27ff,null))['catch'](handleError(_0x3b27ff,null));};exports['run']=function(_0x29bad2,_0x373f6c,_0x56da81){var _0x2bd823=require('../../config/schedule');return db[_0x49fb('0x27')]['find']({'where':{'id':_0x29bad2[_0x49fb('0x41')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x373f6c,null))[_0x49fb('0x1d')](function(){_0x2bd823[_0x49fb('0x4d')](_0x29bad2['params']['id']);})[_0x49fb('0x1d')](respondWithStatusCode(_0x373f6c,null))['catch'](handleError(_0x373f6c,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index f13e929..1fbb16f 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 _0x7630=['Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define'];(function(_0x20f288,_0x42b564){var _0x800caf=function(_0x47aa1e){while(--_0x47aa1e){_0x20f288['push'](_0x20f288['shift']());}};_0x800caf(++_0x42b564);}(_0x7630,0x16e));var _0x0763=function(_0x3a5600,_0x4cd296){_0x3a5600=_0x3a5600-0x0;var _0x533aae=_0x7630[_0x3a5600];return _0x533aae;};'use strict';var _=require(_0x0763('0x0'));var util=require(_0x0763('0x1'));var logger=require(_0x0763('0x2'))(_0x0763('0x3'));var moment=require(_0x0763('0x4'));var BPromise=require('bluebird');var rp=require(_0x0763('0x5'));var fs=require('fs');var path=require(_0x0763('0x6'));var rimraf=require(_0x0763('0x7'));var config=require(_0x0763('0x8'));var attributes=require(_0x0763('0x9'));module[_0x0763('0xa')]=function(_0x7435db,_0x53a91f){return _0x7435db[_0x0763('0xb')](_0x0763('0xc'),attributes,{'tableName':_0x0763('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf40d=['rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x186e95,_0x2fbad4){var _0x2c75d1=function(_0x371933){while(--_0x371933){_0x186e95['push'](_0x186e95['shift']());}};_0x2c75d1(++_0x2fbad4);}(_0xf40d,0x19d));var _0xdf40=function(_0x162b9e,_0x4bea8c){_0x162b9e=_0x162b9e-0x0;var _0x3b32b1=_0xf40d[_0x162b9e];return _0x3b32b1;};'use strict';var _=require(_0xdf40('0x0'));var util=require(_0xdf40('0x1'));var logger=require(_0xdf40('0x2'))(_0xdf40('0x3'));var moment=require('moment');var BPromise=require(_0xdf40('0x4'));var rp=require(_0xdf40('0x5'));var fs=require('fs');var path=require(_0xdf40('0x6'));var rimraf=require(_0xdf40('0x7'));var config=require(_0xdf40('0x8'));var attributes=require(_0xdf40('0x9'));module[_0xdf40('0xa')]=function(_0xda8931,_0x49c96a){return _0xda8931[_0xdf40('0xb')](_0xdf40('0xc'),attributes,{'tableName':_0xdf40('0xd'),'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 abe64f6..32e1b93 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 _0x207e=['code','error','Schedule,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0xb2028c,_0x1cd6e5){var _0x1c684c=function(_0x4fcd15){while(--_0x4fcd15){_0xb2028c['push'](_0xb2028c['shift']());}};_0x1c684c(++_0x1cd6e5);}(_0x207e,0xf5));var _0xe207=function(_0x295be9,_0x185e40){_0x295be9=_0x295be9-0x0;var _0x44a0fe=_0x207e[_0x295be9];return _0x44a0fe;};'use strict';var _=require(_0xe207('0x0'));var util=require('util');var moment=require(_0xe207('0x1'));var BPromise=require(_0xe207('0x2'));var rs=require(_0xe207('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe207('0x4'))['db'];var utils=require(_0xe207('0x5'));var logger=require(_0xe207('0x6'))(_0xe207('0x7'));var config=require(_0xe207('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe207('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b7ec9,_0x395b26,_0x139883){return new BPromise(function(_0x1527e2,_0x22e587){return client['request'](_0x5b7ec9,_0x139883)[_0xe207('0xa')](function(_0x3373ec){logger[_0xe207('0xb')]('Schedule,\x20%s,\x20%s',_0x395b26,_0xe207('0xc'));logger[_0xe207('0xd')](_0xe207('0xe'),_0x395b26,_0xe207('0xc'),JSON['stringify'](_0x3373ec));if(_0x3373ec['error']){if(_0x3373ec['error'][_0xe207('0xf')]===0x1f4){logger[_0xe207('0x10')](_0xe207('0x11'),_0x395b26,_0x3373ec['error'][_0xe207('0x12')]);return _0x22e587(_0x3373ec['error'][_0xe207('0x12')]);}logger['error'](_0xe207('0x11'),_0x395b26,_0x3373ec['error']['message']);return _0x1527e2(_0x3373ec[_0xe207('0x10')]['message']);}else{logger[_0xe207('0xb')](_0xe207('0x11'),_0x395b26,_0xe207('0xc'));_0x1527e2(_0x3373ec[_0xe207('0x13')][_0xe207('0x12')]);}})['catch'](function(_0x9bec59){logger[_0xe207('0x10')](_0xe207('0x11'),_0x395b26,_0x9bec59);_0x22e587(_0x9bec59);});});} \ No newline at end of file +var _0xcf0f=['Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info'];(function(_0x24eb13,_0x9bf446){var _0x36d230=function(_0x5308a7){while(--_0x5308a7){_0x24eb13['push'](_0x24eb13['shift']());}};_0x36d230(++_0x9bf446);}(_0xcf0f,0xef));var _0xfcf0=function(_0x5f360b,_0x14753e){_0x5f360b=_0x5f360b-0x0;var _0x217f89=_0xcf0f[_0x5f360b];return _0x217f89;};'use strict';var _=require(_0xfcf0('0x0'));var util=require(_0xfcf0('0x1'));var moment=require(_0xfcf0('0x2'));var BPromise=require(_0xfcf0('0x3'));var rs=require(_0xfcf0('0x4'));var fs=require('fs');var Redis=require(_0xfcf0('0x5'));var db=require(_0xfcf0('0x6'))['db'];var utils=require(_0xfcf0('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xfcf0('0x8'));var jayson=require(_0xfcf0('0x9'));var client=jayson['client'][_0xfcf0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bacb6,_0x4b5104,_0x1e8f15){return new BPromise(function(_0xa57425,_0x446acf){return client[_0xfcf0('0xb')](_0x3bacb6,_0x1e8f15)['then'](function(_0x432f4a){logger[_0xfcf0('0xc')](_0xfcf0('0xd'),_0x4b5104,_0xfcf0('0xe'));logger['debug'](_0xfcf0('0xf'),_0x4b5104,_0xfcf0('0xe'),JSON[_0xfcf0('0x10')](_0x432f4a));if(_0x432f4a[_0xfcf0('0x11')]){if(_0x432f4a[_0xfcf0('0x11')]['code']===0x1f4){logger[_0xfcf0('0x11')]('Schedule,\x20%s,\x20%s',_0x4b5104,_0x432f4a[_0xfcf0('0x11')][_0xfcf0('0x12')]);return _0x446acf(_0x432f4a[_0xfcf0('0x11')][_0xfcf0('0x12')]);}logger[_0xfcf0('0x11')](_0xfcf0('0xd'),_0x4b5104,_0x432f4a[_0xfcf0('0x11')][_0xfcf0('0x12')]);return _0xa57425(_0x432f4a[_0xfcf0('0x11')][_0xfcf0('0x12')]);}else{logger[_0xfcf0('0xc')](_0xfcf0('0xd'),_0x4b5104,'request\x20sent');_0xa57425(_0x432f4a[_0xfcf0('0x13')][_0xfcf0('0x12')]);}})[_0xfcf0('0x14')](function(_0x427a6b){logger[_0xfcf0('0x11')](_0xfcf0('0xd'),_0x4b5104,_0x427a6b);_0x446acf(_0x427a6b);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index b6aa604..9e3cc5f 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 _0x11fb=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./screenRecording.controller','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','post','create','put'];(function(_0x42c903,_0x5c81bc){var _0xcfd717=function(_0x34fd31){while(--_0x34fd31){_0x42c903['push'](_0x42c903['shift']());}};_0xcfd717(++_0x5c81bc);}(_0x11fb,0x93));var _0xb11f=function(_0x508acd,_0x441448){_0x508acd=_0x508acd-0x0;var _0x364271=_0x11fb[_0x508acd];return _0x364271;};'use strict';var multer=require(_0xb11f('0x0'));var util=require(_0xb11f('0x1'));var path=require(_0xb11f('0x2'));var timeout=require(_0xb11f('0x3'));var express=require(_0xb11f('0x4'));var router=express[_0xb11f('0x5')]();var fs_extra=require(_0xb11f('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb11f('0x7'));var controller=require(_0xb11f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xb11f('0x9')]);router[_0xb11f('0xa')](_0xb11f('0xb'),auth['isAuthenticated'](),controller[_0xb11f('0xc')]);router['get'](_0xb11f('0xd'),auth[_0xb11f('0xe')](),controller[_0xb11f('0xf')]);router[_0xb11f('0xa')](_0xb11f('0x10'),auth[_0xb11f('0xe')](),controller[_0xb11f('0x11')]);router[_0xb11f('0x12')]('/',auth[_0xb11f('0xe')](),controller[_0xb11f('0x13')]);router[_0xb11f('0x14')](_0xb11f('0xd'),auth[_0xb11f('0xe')](),controller[_0xb11f('0x15')]);router[_0xb11f('0x16')](_0xb11f('0xd'),auth['isAuthenticated'](),controller[_0xb11f('0x17')]);module['exports']=router; \ No newline at end of file +var _0x6c71=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','create','put','destroy','multer','util','path','express','Router','fs-extra'];(function(_0xe0076,_0x3c039a){var _0x1f9f88=function(_0x35caa6){while(--_0x35caa6){_0xe0076['push'](_0xe0076['shift']());}};_0x1f9f88(++_0x3c039a);}(_0x6c71,0x72));var _0x16c7=function(_0x5766b0,_0xbba441){_0x5766b0=_0x5766b0-0x0;var _0x346211=_0x6c71[_0x5766b0];return _0x346211;};'use strict';var multer=require(_0x16c7('0x0'));var util=require(_0x16c7('0x1'));var path=require(_0x16c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x16c7('0x3'));var router=express[_0x16c7('0x4')]();var fs_extra=require(_0x16c7('0x5'));var auth=require(_0x16c7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x16c7('0x7'));var controller=require('./screenRecording.controller');router[_0x16c7('0x8')]('/',auth[_0x16c7('0x9')](),controller[_0x16c7('0xa')]);router[_0x16c7('0x8')](_0x16c7('0xb'),auth['isAuthenticated'](),controller[_0x16c7('0xc')]);router['get'](_0x16c7('0xd'),auth[_0x16c7('0x9')](),controller[_0x16c7('0xe')]);router[_0x16c7('0x8')](_0x16c7('0xf'),auth[_0x16c7('0x9')](),controller[_0x16c7('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x16c7('0x11')]);router[_0x16c7('0x12')](_0x16c7('0xd'),auth[_0x16c7('0x9')](),controller['update']);router['delete'](_0x16c7('0xd'),auth[_0x16c7('0x9')](),controller[_0x16c7('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 6454eea..ea1cd12 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 _0xebcd=['value','getDataValue','STRING','replace','INTEGER','setDataValue','startedAt','subtract','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt','updatedAt','sequelize','path','VIRTUAL'];(function(_0x2a7d79,_0x230977){var _0x16a5a7=function(_0x97e2da){while(--_0x97e2da){_0x2a7d79['push'](_0x2a7d79['shift']());}};_0x16a5a7(++_0x230977);}(_0xebcd,0x18c));var _0xdebc=function(_0x19babd,_0x1d4ef7){_0x19babd=_0x19babd-0x0;var _0x314eaf=_0xebcd[_0x19babd];return _0x314eaf;};'use strict';var Sequelize=require(_0xdebc('0x0'));var moment=require('moment');var path=require(_0xdebc('0x1'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0xdebc('0x2')],'get':function(){return this['getDataValue'](_0xdebc('0x3'))?path['extname'](this[_0xdebc('0x4')](_0xdebc('0x3'))):undefined;}},'interactionid':{'type':Sequelize[_0xdebc('0x5')]},'channel':{'type':Sequelize[_0xdebc('0x5')]},'value':{'type':Sequelize[_0xdebc('0x5')],'set':function(_0x435862){var _0x54956e=_0x435862[_0xdebc('0x6')](/\\/g,'/');this['setDataValue']('value',_0x54956e);}},'rating':{'type':Sequelize[_0xdebc('0x7')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdebc('0x7')],'set':function(_0x4ce9ba){this[_0xdebc('0x8')](_0xdebc('0x9'),moment()[_0xdebc('0xa')](_0x4ce9ba,'ms'));this[_0xdebc('0x8')]('closedAt',moment());this['setDataValue'](_0xdebc('0xb'),_0x4ce9ba);}},'startedAt':{'type':Sequelize[_0xdebc('0xc')],'get':function(){return moment(this[_0xdebc('0x4')](_0xdebc('0x9')))[_0xdebc('0xd')](_0xdebc('0xe'))[_0xdebc('0xf')]();}},'closedAt':{'type':Sequelize[_0xdebc('0xc')],'get':function(){return moment(this[_0xdebc('0x4')](_0xdebc('0x10')))[_0xdebc('0xd')](_0xdebc('0xe'))[_0xdebc('0xf')]();}},'createdAt':{'type':Sequelize[_0xdebc('0xc')],'get':function(){return moment(this[_0xdebc('0x4')](_0xdebc('0x11')))[_0xdebc('0xd')](_0xdebc('0xe'))[_0xdebc('0xf')]();}},'updatedAt':{'type':Sequelize[_0xdebc('0xc')],'get':function(){return moment(this[_0xdebc('0x4')](_0xdebc('0x12')))[_0xdebc('0xd')](_0xdebc('0xe'))[_0xdebc('0xf')]();}}}; \ No newline at end of file +var _0xda2d=['replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','toString','format','MM-DD-YYYY\x20HH:mm','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING'];(function(_0x17723c,_0x1ea81d){var _0x1ffbf3=function(_0x5276cd){while(--_0x5276cd){_0x17723c['push'](_0x17723c['shift']());}};_0x1ffbf3(++_0x1ea81d);}(_0xda2d,0x102));var _0xdda2=function(_0x3ea0fc,_0x52c750){_0x3ea0fc=_0x3ea0fc-0x0;var _0x40bf04=_0xda2d[_0x3ea0fc];return _0x40bf04;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var config=require(_0xdda2('0x2'));module[_0xdda2('0x3')]={'format':{'type':Sequelize[_0xdda2('0x4')],'get':function(){return this['getDataValue']('value')?path['extname'](this[_0xdda2('0x5')](_0xdda2('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xdda2('0x7')]},'channel':{'type':Sequelize[_0xdda2('0x7')]},'value':{'type':Sequelize[_0xdda2('0x7')],'set':function(_0xf38e58){var _0x2f55dc=_0xf38e58[_0xdda2('0x8')](/\\/g,'/');this[_0xdda2('0x9')](_0xdda2('0x6'),_0x2f55dc);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdda2('0xa')],'set':function(_0x22c6e5){this['setDataValue'](_0xdda2('0xb'),moment()[_0xdda2('0xc')](_0x22c6e5,'ms'));this[_0xdda2('0x9')](_0xdda2('0xd'),moment());this[_0xdda2('0x9')](_0xdda2('0xe'),_0x22c6e5);}},'startedAt':{'type':Sequelize[_0xdda2('0xf')],'get':function(){return moment(this[_0xdda2('0x5')]('startedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0xdda2('0x10')]();}},'closedAt':{'type':Sequelize[_0xdda2('0xf')],'get':function(){return moment(this[_0xdda2('0x5')](_0xdda2('0xd')))[_0xdda2('0x11')](_0xdda2('0x12'))[_0xdda2('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xdda2('0x5')]('createdAt'))[_0xdda2('0x11')](_0xdda2('0x12'))[_0xdda2('0x10')]();}},'updatedAt':{'type':Sequelize[_0xdda2('0xf')],'get':function(){return moment(this[_0xdda2('0x5')]('updatedAt'))['format'](_0xdda2('0x12'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 737abab..21e426b 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 _0x0e85=['duration','createdAt','closedAt','params','describe','download','uniqueid','join','root','value','existsSync','secrets','recording','server/files/screen_recordings','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','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','key','model','format','query','filters','intersection','attributes','length','nolimit','sort','filter','where','merge','type','options','include','findAll','rows','catch','keys','fields','find','create','body'];(function(_0xc87d08,_0x59c9be){var _0x30a714=function(_0x437c0d){while(--_0x437c0d){_0xc87d08['push'](_0xc87d08['shift']());}};_0x30a714(++_0x59c9be);}(_0x0e85,0x7c));var _0x50e8=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x0e85[_0x38ced4];return _0x547c07;};'use strict';var emlformat=require(_0x50e8('0x0'));var rimraf=require(_0x50e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50e8('0x2'));var rp=require(_0x50e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x50e8('0x4'));var path=require('path');var sox=require(_0x50e8('0x5'));var csv=require(_0x50e8('0x6'));var ejs=require(_0x50e8('0x7'));var fs=require('fs');var fs_extra=require(_0x50e8('0x8'));var _=require('lodash');var squel=require(_0x50e8('0x9'));var crypto=require(_0x50e8('0xa'));var jsforce=require(_0x50e8('0xb'));var deskjs=require(_0x50e8('0xc'));var toCsv=require(_0x50e8('0x6'));var querystring=require(_0x50e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x50e8('0xe'));var authService=require(_0x50e8('0xf'));var qs=require(_0x50e8('0x10'));var as=require(_0x50e8('0x11'));var hardwareService=require(_0x50e8('0x12'));var logger=require(_0x50e8('0x13'))(_0x50e8('0x14'));var utils=require(_0x50e8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x50e8('0x16'))['db'];function respondWithStatusCode(_0x24d381,_0x508377){_0x508377=_0x508377||0xcc;return function(_0x49e02f){if(_0x49e02f){return _0x24d381[_0x50e8('0x17')](_0x508377);}return _0x24d381[_0x50e8('0x18')](_0x508377)[_0x50e8('0x19')]();};}function respondWithResult(_0x473aa7,_0x54efd3){_0x54efd3=_0x54efd3||0xc8;return function(_0x18596f){if(_0x18596f){return _0x473aa7[_0x50e8('0x18')](_0x54efd3)[_0x50e8('0x1a')](_0x18596f);}};}function respondWithFilteredResult(_0x5c3baa,_0x5524a3){return function(_0x30a872){if(_0x30a872){var _0xf02b48=typeof _0x5524a3[_0x50e8('0x1b')]===_0x50e8('0x1c')&&typeof _0x5524a3[_0x50e8('0x1d')]===_0x50e8('0x1c');var _0x5642bf=_0x30a872['count'];var _0x441f25=_0xf02b48?0x0:_0x5524a3[_0x50e8('0x1b')];var _0x40d060=_0xf02b48?_0x30a872[_0x50e8('0x1e')]:_0x5524a3[_0x50e8('0x1b')]+_0x5524a3[_0x50e8('0x1d')];var _0x1a451d;if(_0x40d060>=_0x5642bf){_0x40d060=_0x5642bf;_0x1a451d=0xc8;}else{_0x1a451d=0xce;}_0x5c3baa['status'](_0x1a451d);return _0x5c3baa[_0x50e8('0x1f')]('Content-Range',_0x441f25+'-'+_0x40d060+'/'+_0x5642bf)[_0x50e8('0x1a')](_0x30a872);}return null;};}function patchUpdates(_0xe04a5c){return function(_0xd263d){try{jsonpatch[_0x50e8('0x20')](_0xd263d,_0xe04a5c,!![]);}catch(_0x46af8e){return BPromise['reject'](_0x46af8e);}return _0xd263d[_0x50e8('0x21')]();};}function saveUpdates(_0x1e4e0d,_0x58110d){return function(_0x31d23c){if(_0x31d23c){return _0x31d23c[_0x50e8('0x22')](_0x1e4e0d)['then'](function(_0x1ce7fc){return _0x1ce7fc;});}return null;};}function removeEntity(_0xe7e56c,_0x4f56b7){return function(_0x47a3d8){if(_0x47a3d8){return _0x47a3d8['destroy']()[_0x50e8('0x23')](function(){_0xe7e56c[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();});}};}function handleEntityNotFound(_0x371a1f,_0xc2f832){return function(_0x13b6e9){if(!_0x13b6e9){_0x371a1f['sendStatus'](0x194);}return _0x13b6e9;};}function handleError(_0x3a6442,_0x396611){_0x396611=_0x396611||0x1f4;return function(_0x4b3a09){logger[_0x50e8('0x24')](_0x4b3a09[_0x50e8('0x25')]);if(_0x4b3a09[_0x50e8('0x26')]){delete _0x4b3a09[_0x50e8('0x26')];}_0x3a6442['status'](_0x396611)[_0x50e8('0x27')](_0x4b3a09);};}exports['index']=function(_0x30fedf,_0x39c0c6){var _0x42bbef={},_0x4f0b88={},_0x1041b9={'count':0x0,'rows':[]};var _0x126c99=_[_0x50e8('0x28')](db[_0x50e8('0x29')][_0x50e8('0x2a')],function(_0x18aa31){return{'name':_0x18aa31[_0x50e8('0x2b')],'type':_0x18aa31['type'][_0x50e8('0x2c')]};});_0x4f0b88[_0x50e8('0x2d')]=_['differenceBy'](_['map'](_0x126c99,_0x50e8('0x26')),[_0x50e8('0x2e')]);_0x4f0b88[_0x50e8('0x2f')]=_['keys'](_0x30fedf['query']);_0x4f0b88[_0x50e8('0x30')]=_[_0x50e8('0x31')](_0x4f0b88['model'],_0x4f0b88[_0x50e8('0x2f')]);_0x42bbef[_0x50e8('0x32')]=_[_0x50e8('0x31')](_0x4f0b88[_0x50e8('0x2d')],qs['fields'](_0x30fedf[_0x50e8('0x2f')]['fields']));_0x42bbef[_0x50e8('0x32')]=_0x42bbef[_0x50e8('0x32')][_0x50e8('0x33')]?_0x42bbef['attributes']:_0x4f0b88[_0x50e8('0x2d')];if(!_0x30fedf[_0x50e8('0x2f')]['hasOwnProperty'](_0x50e8('0x34'))){_0x42bbef[_0x50e8('0x1d')]=qs[_0x50e8('0x1d')](_0x30fedf[_0x50e8('0x2f')]['limit']);_0x42bbef[_0x50e8('0x1b')]=qs[_0x50e8('0x1b')](_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x1b')]);}_0x42bbef['order']=qs[_0x50e8('0x35')](_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x35')]);_0x42bbef['where']=qs['filters'](_['pick'](_0x30fedf[_0x50e8('0x2f')],_0x4f0b88[_0x50e8('0x30')]),_0x126c99);if(_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x36')]){_0x42bbef[_0x50e8('0x37')]=_[_0x50e8('0x38')](_0x42bbef[_0x50e8('0x37')],{'$or':_[_0x50e8('0x28')](_0x126c99,function(_0x35f802){if(_0x35f802[_0x50e8('0x39')]!=='VIRTUAL'){var _0x3371a4={};_0x3371a4[_0x35f802[_0x50e8('0x26')]]={'$like':'%'+_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x36')]+'%'};return _0x3371a4;}})});}_0x42bbef=_['merge']({},_0x42bbef,_0x30fedf[_0x50e8('0x3a')]);var _0x944e46={'where':_0x42bbef[_0x50e8('0x37')]};return db[_0x50e8('0x29')][_0x50e8('0x1e')](_0x944e46)['then'](function(_0x53b198){_0x1041b9[_0x50e8('0x1e')]=_0x53b198;if(_0x30fedf[_0x50e8('0x2f')]['includeAll']){_0x42bbef[_0x50e8('0x3b')]=[{'all':!![]}];}return db[_0x50e8('0x29')][_0x50e8('0x3c')](_0x42bbef);})[_0x50e8('0x23')](function(_0x251e1c){_0x1041b9[_0x50e8('0x3d')]=_0x251e1c;return _0x1041b9;})[_0x50e8('0x23')](respondWithFilteredResult(_0x39c0c6,_0x42bbef))[_0x50e8('0x3e')](handleError(_0x39c0c6,null));};exports['show']=function(_0x3d26bd,_0x44e0ca){var _0x3ea251={'raw':![],'where':{'id':_0x3d26bd['params']['id']}},_0x2adae0={};_0x2adae0[_0x50e8('0x2d')]=_[_0x50e8('0x3f')](db[_0x50e8('0x29')][_0x50e8('0x2a')]);_0x2adae0['query']=_[_0x50e8('0x3f')](_0x3d26bd['query']);_0x2adae0['filters']=_['intersection'](_0x2adae0[_0x50e8('0x2d')],_0x2adae0[_0x50e8('0x2f')]);_0x3ea251['attributes']=_[_0x50e8('0x31')](_0x2adae0[_0x50e8('0x2d')],qs[_0x50e8('0x40')](_0x3d26bd[_0x50e8('0x2f')][_0x50e8('0x40')]));_0x3ea251[_0x50e8('0x32')]=_0x3ea251['attributes'][_0x50e8('0x33')]?_0x3ea251['attributes']:_0x2adae0[_0x50e8('0x2d')];if(_0x3d26bd[_0x50e8('0x2f')]['includeAll']){_0x3ea251[_0x50e8('0x3b')]=[{'all':!![]}];}_0x3ea251=_['merge']({},_0x3ea251,_0x3d26bd[_0x50e8('0x3a')]);return db[_0x50e8('0x29')][_0x50e8('0x41')](_0x3ea251)[_0x50e8('0x23')](handleEntityNotFound(_0x44e0ca,null))[_0x50e8('0x23')](respondWithResult(_0x44e0ca,null))[_0x50e8('0x3e')](handleError(_0x44e0ca,null));};exports[_0x50e8('0x42')]=function(_0x3e52b3,_0x141bd4){return db[_0x50e8('0x29')][_0x50e8('0x42')](_0x3e52b3['body'],{})[_0x50e8('0x23')](respondWithResult(_0x141bd4,0xc9))[_0x50e8('0x3e')](handleError(_0x141bd4,null));};exports['update']=function(_0x3692ba,_0x58f14e){if(_0x3692ba[_0x50e8('0x43')]['id']){delete _0x3692ba['body']['id'];}delete _0x3692ba[_0x50e8('0x43')][_0x50e8('0x44')];delete _0x3692ba[_0x50e8('0x43')][_0x50e8('0x45')];delete _0x3692ba[_0x50e8('0x43')][_0x50e8('0x46')];delete _0x3692ba[_0x50e8('0x43')]['value'];return db[_0x50e8('0x29')][_0x50e8('0x41')]({'where':{'id':_0x3692ba[_0x50e8('0x47')]['id']}})[_0x50e8('0x23')](handleEntityNotFound(_0x58f14e,null))[_0x50e8('0x23')](saveUpdates(_0x3692ba[_0x50e8('0x43')],null))['then'](respondWithResult(_0x58f14e,null))[_0x50e8('0x3e')](handleError(_0x58f14e,null));};exports[_0x50e8('0x48')]=function(_0xff2e24,_0x27c80a){return db['ScreenRecording'][_0x50e8('0x48')]()[_0x50e8('0x23')](respondWithResult(_0x27c80a,null))[_0x50e8('0x3e')](handleError(_0x27c80a,null));};exports[_0x50e8('0x49')]=function(_0x207f06,_0x1372e3,_0x320b00){var _0x5f5220=require('../../components/encryptor');var _0x55083e=![];var _0x2b54ad={};if(_0x207f06[_0x50e8('0x2f')][_0x50e8('0x39')]&&_0x207f06[_0x50e8('0x2f')][_0x50e8('0x39')]===_0x50e8('0x4a')){_0x2b54ad['uniqueid']=_0x207f06[_0x50e8('0x47')]['id'];}else{_0x2b54ad['id']=_0x207f06[_0x50e8('0x47')]['id'];}return db[_0x50e8('0x29')][_0x50e8('0x41')]({'where':_0x2b54ad,'attributes':['id','value'],'raw':!![]})[_0x50e8('0x23')](handleEntityNotFound(_0x1372e3,null))[_0x50e8('0x23')](function(_0x373b41){if(_0x373b41){var _0x1cc5ba=path[_0x50e8('0x4b')](config[_0x50e8('0x4c')],'server/files/screen_recordings',_0x373b41[_0x50e8('0x4d')]);var _0x5d0d54=util['format']('%s.cypher',_0x1cc5ba);if(fs[_0x50e8('0x4e')](_0x5d0d54)){_0x55083e=!![];return _0x5f5220['decryptFile'](_0x5d0d54,_0x1cc5ba,config[_0x50e8('0x4f')][_0x50e8('0x50')])[_0x50e8('0x23')](function(){return _0x373b41;});}return _0x373b41;}})[_0x50e8('0x23')](function(_0x279cf4){if(_0x279cf4){var _0x12224d=path[_0x50e8('0x4b')](config['root'],_0x50e8('0x51'),_0x279cf4[_0x50e8('0x4d')]);if(!fs[_0x50e8('0x4e')](_0x12224d)){throw new db['Sequelize']['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x279cf4[_0x50e8('0x52')]){return _0x1372e3[_0x50e8('0x49')](_0x12224d,_0x279cf4[_0x50e8('0x52')]+path[_0x50e8('0x53')](_0x12224d),function(){if(_0x55083e){fs[_0x50e8('0x54')](_0x12224d);}});}else{return _0x1372e3[_0x50e8('0x49')](_0x12224d,function(_0x583d6a){if(_0x55083e){fs[_0x50e8('0x54')](_0x12224d);}});}}})['catch'](function(_0x255b48){if(_0x255b48[_0x50e8('0x55')]==='ScreenRecording\x20not\x20found'){_0x1372e3['status'](0x194)['send'](_0x50e8('0x56'));}else{return handleError(_0x1372e3,null);}});};exports[_0x50e8('0x57')]=function(_0x5d1fc8,_0x351047){return db[_0x50e8('0x29')][_0x50e8('0x41')]({'where':{'id':_0x5d1fc8[_0x50e8('0x47')]['id']}})[_0x50e8('0x23')](function(_0x47b428){if(_[_0x50e8('0x58')](_0x47b428)){throw new ReferenceError(_0x50e8('0x59'));}return _0x47b428;})[_0x50e8('0x23')](function(_0x4b80ac){var _0x583e58=path[_0x50e8('0x4b')](config[_0x50e8('0x4c')],_0x50e8('0x51'),_0x4b80ac[_0x50e8('0x4d')]);logger[_0x50e8('0x5a')](_0x50e8('0x5b'),_0x583e58);if(!_['isNil'](_0x4b80ac['value'])&&fs[_0x50e8('0x4e')](_0x583e58)){logger['info'](_0x50e8('0x5c')+_0x583e58+_0x50e8('0x5d'));fs['unlinkSync'](_0x583e58);}_0x583e58=_0x583e58+_0x50e8('0x5e');if(!_['isNil'](_0x4b80ac['value'])&&fs['existsSync'](_0x583e58)){logger[_0x50e8('0x5a')](_0x50e8('0x5c')+_0x583e58+_0x50e8('0x5d'));fs[_0x50e8('0x5f')](_0x583e58);}return _0x4b80ac;})['then'](function(_0x480362){if(!_0x480362)throw new InternalError();return _0x480362[_0x50e8('0x57')]();})[_0x50e8('0x23')](function(){_0x351047[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();})[_0x50e8('0x3e')](handleError(_0x351047,null));}; \ No newline at end of file +var _0x00bb=['json','undefined','limit','offset','apply','reject','update','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ScreenRecording','count','then','includeAll','include','rows','catch','show','params','length','options','find','body','createdAt','closedAt','value','describe','download','uniqueid','join','root','format','%s.cypher','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status'];(function(_0x105fab,_0x13db00){var _0x55e880=function(_0x102062){while(--_0x102062){_0x105fab['push'](_0x105fab['shift']());}};_0x55e880(++_0x13db00);}(_0x00bb,0x1d8));var _0xb00b=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x00bb[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){_0x2896d1[_0xb00b('0x16')](0xcc)[_0xb00b('0x1f')]();});}};}function handleEntityNotFound(_0x3c9500,_0x8caadf){return function(_0x520e55){if(!_0x520e55){_0x3c9500['sendStatus'](0x194);}return _0x520e55;};}function handleError(_0x3785e9,_0x490380){_0x490380=_0x490380||0x1f4;return function(_0x550587){logger['error'](_0x550587[_0xb00b('0x20')]);if(_0x550587[_0xb00b('0x21')]){delete _0x550587[_0xb00b('0x21')];}_0x3785e9[_0xb00b('0x16')](_0x490380)[_0xb00b('0x22')](_0x550587);};}exports[_0xb00b('0x23')]=function(_0x15d3b9,_0x4a8d2b){var _0x22c22d={},_0x503c9c={},_0x450129={'count':0x0,'rows':[]};var _0x348165=_[_0xb00b('0x24')](db['ScreenRecording'][_0xb00b('0x25')],function(_0x280ed3){return{'name':_0x280ed3[_0xb00b('0x26')],'type':_0x280ed3[_0xb00b('0x27')][_0xb00b('0x28')]};});_0x503c9c[_0xb00b('0x29')]=_[_0xb00b('0x2a')](_[_0xb00b('0x24')](_0x348165,_0xb00b('0x21')),['format']);_0x503c9c[_0xb00b('0x2b')]=_[_0xb00b('0x2c')](_0x15d3b9['query']);_0x503c9c[_0xb00b('0x2d')]=_[_0xb00b('0x2e')](_0x503c9c['model'],_0x503c9c[_0xb00b('0x2b')]);_0x22c22d['attributes']=_[_0xb00b('0x2e')](_0x503c9c[_0xb00b('0x29')],qs[_0xb00b('0x2f')](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x2f')]));_0x22c22d[_0xb00b('0x30')]=_0x22c22d[_0xb00b('0x30')]['length']?_0x22c22d['attributes']:_0x503c9c['model'];if(!_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x22c22d[_0xb00b('0x19')]=qs['limit'](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x22c22d[_0xb00b('0x1a')]=qs[_0xb00b('0x1a')](_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x1a')]);}_0x22c22d[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x15d3b9['query']['sort']);_0x22c22d[_0xb00b('0x35')]=qs['filters'](_[_0xb00b('0x36')](_0x15d3b9[_0xb00b('0x2b')],_0x503c9c[_0xb00b('0x2d')]),_0x348165);if(_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x22c22d[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x22c22d['where'],{'$or':_[_0xb00b('0x24')](_0x348165,function(_0x25578e){if(_0x25578e[_0xb00b('0x27')]!==_0xb00b('0x39')){var _0x2496e2={};_0x2496e2[_0x25578e[_0xb00b('0x21')]]={'$like':'%'+_0x15d3b9['query'][_0xb00b('0x37')]+'%'};return _0x2496e2;}})});}_0x22c22d=_[_0xb00b('0x38')]({},_0x22c22d,_0x15d3b9['options']);var _0x17ff34={'where':_0x22c22d[_0xb00b('0x35')]};return db[_0xb00b('0x3a')][_0xb00b('0x3b')](_0x17ff34)[_0xb00b('0x3c')](function(_0x5636b1){_0x450129[_0xb00b('0x3b')]=_0x5636b1;if(_0x15d3b9[_0xb00b('0x2b')][_0xb00b('0x3d')]){_0x22c22d[_0xb00b('0x3e')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x22c22d);})[_0xb00b('0x3c')](function(_0xf6ae0c){_0x450129[_0xb00b('0x3f')]=_0xf6ae0c;return _0x450129;})[_0xb00b('0x3c')](respondWithFilteredResult(_0x4a8d2b,_0x22c22d))[_0xb00b('0x40')](handleError(_0x4a8d2b,null));};exports[_0xb00b('0x41')]=function(_0x275664,_0x493841){var _0x36200d={'raw':![],'where':{'id':_0x275664[_0xb00b('0x42')]['id']}},_0x3b72c4={};_0x3b72c4[_0xb00b('0x29')]=_[_0xb00b('0x2c')](db[_0xb00b('0x3a')][_0xb00b('0x25')]);_0x3b72c4[_0xb00b('0x2b')]=_[_0xb00b('0x2c')](_0x275664[_0xb00b('0x2b')]);_0x3b72c4[_0xb00b('0x2d')]=_[_0xb00b('0x2e')](_0x3b72c4['model'],_0x3b72c4[_0xb00b('0x2b')]);_0x36200d[_0xb00b('0x30')]=_[_0xb00b('0x2e')](_0x3b72c4[_0xb00b('0x29')],qs[_0xb00b('0x2f')](_0x275664[_0xb00b('0x2b')][_0xb00b('0x2f')]));_0x36200d[_0xb00b('0x30')]=_0x36200d[_0xb00b('0x30')][_0xb00b('0x43')]?_0x36200d[_0xb00b('0x30')]:_0x3b72c4[_0xb00b('0x29')];if(_0x275664['query']['includeAll']){_0x36200d['include']=[{'all':!![]}];}_0x36200d=_[_0xb00b('0x38')]({},_0x36200d,_0x275664[_0xb00b('0x44')]);return db['ScreenRecording'][_0xb00b('0x45')](_0x36200d)[_0xb00b('0x3c')](handleEntityNotFound(_0x493841,null))[_0xb00b('0x3c')](respondWithResult(_0x493841,null))[_0xb00b('0x40')](handleError(_0x493841,null));};exports['create']=function(_0x58e9cb,_0x172729){return db[_0xb00b('0x3a')]['create'](_0x58e9cb['body'],{})[_0xb00b('0x3c')](respondWithResult(_0x172729,0xc9))[_0xb00b('0x40')](handleError(_0x172729,null));};exports['update']=function(_0x2228e9,_0x47a814){if(_0x2228e9['body']['id']){delete _0x2228e9['body']['id'];}delete _0x2228e9[_0xb00b('0x46')]['duration'];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x47')];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x48')];delete _0x2228e9[_0xb00b('0x46')][_0xb00b('0x49')];return db['ScreenRecording']['find']({'where':{'id':_0x2228e9[_0xb00b('0x42')]['id']}})[_0xb00b('0x3c')](handleEntityNotFound(_0x47a814,null))['then'](saveUpdates(_0x2228e9[_0xb00b('0x46')],null))[_0xb00b('0x3c')](respondWithResult(_0x47a814,null))['catch'](handleError(_0x47a814,null));};exports[_0xb00b('0x4a')]=function(_0x10e066,_0x3b5d82){return db['ScreenRecording']['describe']()[_0xb00b('0x3c')](respondWithResult(_0x3b5d82,null))[_0xb00b('0x40')](handleError(_0x3b5d82,null));};exports[_0xb00b('0x4b')]=function(_0xde3cc1,_0x489b49,_0x380acb){var _0x3f31e5=require('../../components/encryptor');var _0x4cd9fd=![];var _0x160965={};if(_0xde3cc1['query'][_0xb00b('0x27')]&&_0xde3cc1[_0xb00b('0x2b')][_0xb00b('0x27')]===_0xb00b('0x4c')){_0x160965[_0xb00b('0x4c')]=_0xde3cc1[_0xb00b('0x42')]['id'];}else{_0x160965['id']=_0xde3cc1['params']['id'];}return db[_0xb00b('0x3a')]['find']({'where':_0x160965,'attributes':['id',_0xb00b('0x49')],'raw':!![]})[_0xb00b('0x3c')](handleEntityNotFound(_0x489b49,null))[_0xb00b('0x3c')](function(_0x5ac79e){if(_0x5ac79e){var _0x248335=path[_0xb00b('0x4d')](config[_0xb00b('0x4e')],'server/files/screen_recordings',_0x5ac79e[_0xb00b('0x49')]);var _0x309ae6=util[_0xb00b('0x4f')](_0xb00b('0x50'),_0x248335);if(fs[_0xb00b('0x51')](_0x309ae6)){_0x4cd9fd=!![];return _0x3f31e5[_0xb00b('0x52')](_0x309ae6,_0x248335,config[_0xb00b('0x53')][_0xb00b('0x54')])['then'](function(){return _0x5ac79e;});}return _0x5ac79e;}})[_0xb00b('0x3c')](function(_0x2cbe80){if(_0x2cbe80){var _0x1b4860=path['join'](config[_0xb00b('0x4e')],_0xb00b('0x55'),_0x2cbe80[_0xb00b('0x49')]);if(!fs[_0xb00b('0x51')](_0x1b4860)){throw new db[(_0xb00b('0x56'))]['ValidationError'](_0xb00b('0x57'));}if(_0x2cbe80[_0xb00b('0x58')]){return _0x489b49[_0xb00b('0x4b')](_0x1b4860,_0x2cbe80[_0xb00b('0x58')]+path['extname'](_0x1b4860),function(){if(_0x4cd9fd){fs[_0xb00b('0x59')](_0x1b4860);}});}else{return _0x489b49[_0xb00b('0x4b')](_0x1b4860,function(_0x2c93db){if(_0x4cd9fd){fs[_0xb00b('0x59')](_0x1b4860);}});}}})[_0xb00b('0x40')](function(_0x1e5ed8){if(_0x1e5ed8[_0xb00b('0x5a')]==='ScreenRecording\x20not\x20found'){_0x489b49[_0xb00b('0x16')](0x194)['send'](_0xb00b('0x5b'));}else{return handleError(_0x489b49,null);}});};exports['destroy']=function(_0x3b3272,_0x530d4a){return db[_0xb00b('0x3a')]['find']({'where':{'id':_0x3b3272[_0xb00b('0x42')]['id']}})[_0xb00b('0x3c')](function(_0x3bae02){if(_['isNil'](_0x3bae02)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3bae02;})['then'](function(_0x21a53d){var _0x3126be=path[_0xb00b('0x4d')](config['root'],_0xb00b('0x55'),_0x21a53d[_0xb00b('0x49')]);logger[_0xb00b('0x5c')](_0xb00b('0x5d'),_0x3126be);if(!_[_0xb00b('0x5e')](_0x21a53d['value'])&&fs[_0xb00b('0x51')](_0x3126be)){logger[_0xb00b('0x5c')]('File:\x20\x22'+_0x3126be+_0xb00b('0x5f'));fs[_0xb00b('0x60')](_0x3126be);}_0x3126be=_0x3126be+_0xb00b('0x61');if(!_['isNil'](_0x21a53d['value'])&&fs[_0xb00b('0x51')](_0x3126be)){logger[_0xb00b('0x5c')](_0xb00b('0x62')+_0x3126be+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x3126be);}return _0x21a53d;})['then'](function(_0x5e9677){if(!_0x5e9677)throw new InternalError();return _0x5e9677[_0xb00b('0x1e')]();})['then'](function(){_0x530d4a[_0xb00b('0x16')](0xcc)[_0xb00b('0x1f')]();})['catch'](handleError(_0x530d4a,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 0fdc5d9..6ad16fb 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 _0xf2d0=['screen_recordings','interactionid','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording'];(function(_0x9a5042,_0x191062){var _0x33e7e3=function(_0x2ac10e){while(--_0x2ac10e){_0x9a5042['push'](_0x9a5042['shift']());}};_0x33e7e3(++_0x191062);}(_0xf2d0,0x12d));var _0x0f2d=function(_0x3ff5b8,_0x2d5b0f){_0x3ff5b8=_0x3ff5b8-0x0;var _0x451177=_0xf2d0[_0x3ff5b8];return _0x451177;};'use strict';var _=require(_0x0f2d('0x0'));var util=require('util');var logger=require(_0x0f2d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0f2d('0x2'));var rp=require(_0x0f2d('0x3'));var fs=require('fs');var path=require(_0x0f2d('0x4'));var rimraf=require(_0x0f2d('0x5'));var config=require(_0x0f2d('0x6'));var attributes=require(_0x0f2d('0x7'));module[_0x0f2d('0x8')]=function(_0x3276a9,_0x2c37ce){return _0x3276a9[_0x0f2d('0x9')](_0x0f2d('0xa'),attributes,{'tableName':_0x0f2d('0xb'),'paranoid':![],'indexes':[{'name':_0x0f2d('0xc'),'fields':[_0x0f2d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x658d=['interactionid','lodash','util','../../config/logger','bluebird','request-promise','rimraf','./screenRecording.attributes','exports','define'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x658d,0xc9));var _0xd658=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x658d[_0x4a7631];return _0x1a5a6f;};'use strict';var _=require(_0xd658('0x0'));var util=require(_0xd658('0x1'));var logger=require(_0xd658('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd658('0x3'));var rp=require(_0xd658('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd658('0x5'));var config=require('../../config/environment');var attributes=require(_0xd658('0x6'));module[_0xd658('0x7')]=function(_0x3ee4a7,_0x1c2a61){return _0x3ee4a7[_0xd658('0x8')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xd658('0x9'),'fields':[_0xd658('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 026caad..2b755ae 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 _0x0bb5=['stringify','error','code','message','result','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0bb5,0x1bd));var _0x50bb=function(_0x1ef76a,_0x8ae460){_0x1ef76a=_0x1ef76a-0x0;var _0x5c9531=_0x0bb5[_0x1ef76a];return _0x5c9531;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var moment=require(_0x50bb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x50bb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x50bb('0x4'));var logger=require(_0x50bb('0x5'))(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var jayson=require(_0x50bb('0x8'));var client=jayson['client'][_0x50bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d91dc,_0x52cd74,_0x44bcf2){return new BPromise(function(_0x31e09c,_0x23babe){return client['request'](_0x3d91dc,_0x44bcf2)[_0x50bb('0xa')](function(_0x25ce23){logger[_0x50bb('0xb')](_0x50bb('0xc'),_0x52cd74,_0x50bb('0xd'));logger[_0x50bb('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x52cd74,_0x50bb('0xd'),JSON[_0x50bb('0xf')](_0x25ce23));if(_0x25ce23[_0x50bb('0x10')]){if(_0x25ce23['error'][_0x50bb('0x11')]===0x1f4){logger[_0x50bb('0x10')](_0x50bb('0xc'),_0x52cd74,_0x25ce23[_0x50bb('0x10')][_0x50bb('0x12')]);return _0x23babe(_0x25ce23[_0x50bb('0x10')][_0x50bb('0x12')]);}logger[_0x50bb('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x52cd74,_0x25ce23[_0x50bb('0x10')][_0x50bb('0x12')]);return _0x31e09c(_0x25ce23[_0x50bb('0x10')][_0x50bb('0x12')]);}else{logger[_0x50bb('0xb')](_0x50bb('0xc'),_0x52cd74,_0x50bb('0xd'));_0x31e09c(_0x25ce23[_0x50bb('0x13')][_0x50bb('0x12')]);}})['catch'](function(_0x147b32){logger[_0x50bb('0x10')](_0x50bb('0xc'),_0x52cd74,_0x147b32);_0x23babe(_0x147b32);});});} \ No newline at end of file +var _0xfae3=['../../mysqldb','rpc','client','http','request','then','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x31662e,_0x3476b2){var _0x4e1ff9=function(_0x3e1d8d){while(--_0x3e1d8d){_0x31662e['push'](_0x31662e['shift']());}};_0x4e1ff9(++_0x3476b2);}(_0xfae3,0x1de));var _0x3fae=function(_0x258257,_0x32042d){_0x258257=_0x258257-0x0;var _0xafb58a=_0xfae3[_0x258257];return _0xafb58a;};'use strict';var _=require(_0x3fae('0x0'));var util=require(_0x3fae('0x1'));var moment=require(_0x3fae('0x2'));var BPromise=require(_0x3fae('0x3'));var rs=require(_0x3fae('0x4'));var fs=require('fs');var Redis=require(_0x3fae('0x5'));var db=require(_0x3fae('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3fae('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3fae('0x8')][_0x3fae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe513f1,_0x3ad75e,_0x3c2096){return new BPromise(function(_0x195538,_0x4c5536){return client[_0x3fae('0xa')](_0xe513f1,_0x3c2096)[_0x3fae('0xb')](function(_0x162aca){logger['info'](_0x3fae('0xc'),_0x3ad75e,'request\x20sent');logger[_0x3fae('0xd')](_0x3fae('0xe'),_0x3ad75e,'request\x20sent',JSON[_0x3fae('0xf')](_0x162aca));if(_0x162aca[_0x3fae('0x10')]){if(_0x162aca[_0x3fae('0x10')][_0x3fae('0x11')]===0x1f4){logger[_0x3fae('0x10')](_0x3fae('0xc'),_0x3ad75e,_0x162aca[_0x3fae('0x10')][_0x3fae('0x12')]);return _0x4c5536(_0x162aca[_0x3fae('0x10')][_0x3fae('0x12')]);}logger[_0x3fae('0x10')](_0x3fae('0xc'),_0x3ad75e,_0x162aca[_0x3fae('0x10')][_0x3fae('0x12')]);return _0x195538(_0x162aca[_0x3fae('0x10')]['message']);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x3ad75e,_0x3fae('0x13'));_0x195538(_0x162aca[_0x3fae('0x14')][_0x3fae('0x12')]);}})[_0x3fae('0x15')](function(_0x12bcdb){logger[_0x3fae('0x10')](_0x3fae('0xc'),_0x3ad75e,_0x12bcdb);_0x4c5536(_0x12bcdb);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 93a2a4c..5e19d94 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 _0x5c53=['favicon','addFavicon','put','update','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','server/files/images/logos/','format','logo','extname','post','file','addLogo','%s%s','logologin','originalname','single','addLogoLogin','diskStorage','root','preferred','addPreferred'];(function(_0x19d588,_0x3f92f0){var _0x3450ea=function(_0x472f75){while(--_0x472f75){_0x19d588['push'](_0x19d588['shift']());}};_0x3450ea(++_0x3f92f0);}(_0x5c53,0xe6));var _0x35c5=function(_0x23bec9,_0x54ce18){_0x23bec9=_0x23bec9-0x0;var _0x1a1f49=_0x5c53[_0x23bec9];return _0x1a1f49;};'use strict';var multer=require(_0x35c5('0x0'));var util=require('util');var path=require(_0x35c5('0x1'));var timeout=require(_0x35c5('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x35c5('0x3'));var auth=require(_0x35c5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x35c5('0x5'));var controller=require(_0x35c5('0x6'));router[_0x35c5('0x7')]('/',auth[_0x35c5('0x8')](),controller[_0x35c5('0x9')]);router[_0x35c5('0x7')](_0x35c5('0xa'),controller[_0x35c5('0xb')]);router['get'](_0x35c5('0xc'),controller[_0x35c5('0xd')]);router[_0x35c5('0x7')](_0x35c5('0xe'),controller[_0x35c5('0xf')]);router['get'](_0x35c5('0x10'),controller['getLogoLogin']);router[_0x35c5('0x7')](_0x35c5('0x11'),controller[_0x35c5('0x12')]);router[_0x35c5('0x7')](_0x35c5('0x13'),controller[_0x35c5('0x14')]);router['get'](_0x35c5('0x15'),controller[_0x35c5('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x115e1f,_0x3c5d83,_0x309117){_0x309117(null,path[_0x35c5('0x17')](config['root'],_0x35c5('0x18')));},'filename':function(_0x3b65b9,_0x8f14e2,_0x695a0f){_0x695a0f(null,util[_0x35c5('0x19')]('%s%s',_0x35c5('0x1a'),path[_0x35c5('0x1b')](_0x8f14e2['originalname'])));}})});router[_0x35c5('0x1c')](_0x35c5('0xe'),upload['single'](_0x35c5('0x1d')),controller[_0x35c5('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb70bcc,_0x193bb7,_0x43359c){_0x43359c(null,path[_0x35c5('0x17')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5677a8,_0xbe11a5,_0x3146b4){_0x3146b4(null,util['format'](_0x35c5('0x1f'),_0x35c5('0x20'),path[_0x35c5('0x1b')](_0xbe11a5[_0x35c5('0x21')])));}})});router[_0x35c5('0x1c')](_0x35c5('0x10'),upload[_0x35c5('0x22')]('file'),controller[_0x35c5('0x23')]);var upload=multer({'storage':multer[_0x35c5('0x24')]({'destination':function(_0x42ab92,_0x32bf7a,_0x1c89ef){_0x1c89ef(null,path['join'](config[_0x35c5('0x25')],_0x35c5('0x18')));},'filename':function(_0x59903c,_0x44841c,_0x25fc1c){_0x25fc1c(null,util[_0x35c5('0x19')]('%s%s',_0x35c5('0x26'),path[_0x35c5('0x1b')](_0x44841c[_0x35c5('0x21')])));}})});router[_0x35c5('0x1c')](_0x35c5('0x13'),upload[_0x35c5('0x22')](_0x35c5('0x1d')),controller[_0x35c5('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5f3279,_0x7700a3,_0x55907c){_0x55907c(null,path[_0x35c5('0x17')](config[_0x35c5('0x25')],_0x35c5('0x18')));},'filename':function(_0x24228d,_0x32eec5,_0x5b8860){_0x5b8860(null,util[_0x35c5('0x19')](_0x35c5('0x1f'),_0x35c5('0x28'),path[_0x35c5('0x1b')](_0x32eec5['originalname'])));}})});router[_0x35c5('0x1c')]('/:id/favicon',upload[_0x35c5('0x22')](_0x35c5('0x1d')),controller[_0x35c5('0x29')]);router[_0x35c5('0x2a')](_0x35c5('0xc'),auth['isAuthenticated'](),controller[_0x35c5('0x2b')]);module[_0x35c5('0x2c')]=router; \ No newline at end of file +var _0x861e=['get','/now','getDate','/:id','show','/:id/logo','/:id/logo_login','/:id/gdpr','/:id/preferred','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','single','file','addLogo','logologin','post','addLogoLogin','preferred','/:id/favicon','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index'];(function(_0x3ae561,_0x539245){var _0xfc5149=function(_0x3863eb){while(--_0x3863eb){_0x3ae561['push'](_0x3ae561['shift']());}};_0xfc5149(++_0x539245);}(_0x861e,0xb0));var _0xe861=function(_0x5f0389,_0x1ff3d4){_0x5f0389=_0x5f0389-0x0;var _0x4538dd=_0x861e[_0x5f0389];return _0x4538dd;};'use strict';var multer=require(_0xe861('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe861('0x1'));var express=require(_0xe861('0x2'));var router=express[_0xe861('0x3')]();var fs_extra=require(_0xe861('0x4'));var auth=require(_0xe861('0x5'));var interaction=require(_0xe861('0x6'));var config=require('../../config/environment');var controller=require('./setting.controller');router['get']('/',auth[_0xe861('0x7')](),controller[_0xe861('0x8')]);router[_0xe861('0x9')](_0xe861('0xa'),controller[_0xe861('0xb')]);router[_0xe861('0x9')](_0xe861('0xc'),controller[_0xe861('0xd')]);router['get'](_0xe861('0xe'),controller['getLogo']);router[_0xe861('0x9')](_0xe861('0xf'),controller['getLogoLogin']);router['get'](_0xe861('0x10'),controller['gdpr']);router[_0xe861('0x9')](_0xe861('0x11'),controller['getPreferred']);router[_0xe861('0x9')]('/:id/favicon',controller[_0xe861('0x12')]);var upload=multer({'storage':multer[_0xe861('0x13')]({'destination':function(_0x503b1c,_0x432a6f,_0x3fe315){_0x3fe315(null,path[_0xe861('0x14')](config[_0xe861('0x15')],_0xe861('0x16')));},'filename':function(_0x4a4bd3,_0x587a2c,_0x34174a){_0x34174a(null,util[_0xe861('0x17')](_0xe861('0x18'),_0xe861('0x19'),path[_0xe861('0x1a')](_0x587a2c[_0xe861('0x1b')])));}})});router['post'](_0xe861('0xe'),upload[_0xe861('0x1c')](_0xe861('0x1d')),controller[_0xe861('0x1e')]);var upload=multer({'storage':multer[_0xe861('0x13')]({'destination':function(_0x394bd8,_0x3deb78,_0x35a879){_0x35a879(null,path[_0xe861('0x14')](config[_0xe861('0x15')],_0xe861('0x16')));},'filename':function(_0x49cb98,_0xf148bf,_0x47450d){_0x47450d(null,util[_0xe861('0x17')](_0xe861('0x18'),_0xe861('0x1f'),path[_0xe861('0x1a')](_0xf148bf['originalname'])));}})});router[_0xe861('0x20')]('/:id/logo_login',upload[_0xe861('0x1c')](_0xe861('0x1d')),controller[_0xe861('0x21')]);var upload=multer({'storage':multer[_0xe861('0x13')]({'destination':function(_0x4089a4,_0x2b99b0,_0x5f1f0a){_0x5f1f0a(null,path[_0xe861('0x14')](config['root'],_0xe861('0x16')));},'filename':function(_0x30a825,_0x4bd3ae,_0x275c50){_0x275c50(null,util[_0xe861('0x17')](_0xe861('0x18'),_0xe861('0x22'),path[_0xe861('0x1a')](_0x4bd3ae[_0xe861('0x1b')])));}})});router[_0xe861('0x20')](_0xe861('0x11'),upload[_0xe861('0x1c')](_0xe861('0x1d')),controller['addPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x333d5,_0x2930f2,_0x56b697){_0x56b697(null,path[_0xe861('0x14')](config['root'],_0xe861('0x16')));},'filename':function(_0x454e4c,_0x4893f7,_0x15de13){_0x15de13(null,util[_0xe861('0x17')](_0xe861('0x18'),'favicon',path['extname'](_0x4893f7[_0xe861('0x1b')])));}})});router[_0xe861('0x20')](_0xe861('0x23'),upload[_0xe861('0x1c')]('file'),controller['addFavicon']);router['put'](_0xe861('0xc'),auth['isAuthenticated'](),controller['update']);module[_0xe861('0x24')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 7ee1be7..5d8f086 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 _0x4e74=['/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','INTEGER','min_internal','min_mailbox','STRING'];(function(_0x3b78f6,_0x42088e){var _0x23f599=function(_0x52d484){while(--_0x52d484){_0x3b78f6['push'](_0x3b78f6['shift']());}};_0x23f599(++_0x42088e);}(_0x4e74,0x131));var _0x44e7=function(_0x4cf8d4,_0x5aee73){_0x4cf8d4=_0x4cf8d4-0x0;var _0x2c1beb=_0x4e74[_0x4cf8d4];return _0x2c1beb;};'use strict';var Sequelize=require(_0x44e7('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0x44e7('0x1')](0xb),'unique':_0x44e7('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x44e7('0x1')](0xb),'unique':_0x44e7('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x44e7('0x4')],'defaultValue':_0x44e7('0x5')},'logo':{'type':Sequelize[_0x44e7('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x44e7('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x44e7('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x44e7('0x4')]},'turnaddr':{'type':Sequelize[_0x44e7('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x44e7('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x44e7('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x44e7('0x4')],'defaultValue':_0x44e7('0x7')},'enableEmailPreview':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x44e7('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x44e7('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x44e7('0x8')},'chatTimeout':{'type':Sequelize[_0x44e7('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x44e7('0x4')]},'defaultPreferred':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x44e7('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x44e7('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x44e7('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x44e7('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x44e7('0x4')]},'sentiment':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x44e7('0x1')]},'sentimentRegion':{'type':Sequelize[_0x44e7('0x4')]},'language':{'type':Sequelize[_0x44e7('0x4')]},'bucket':{'type':Sequelize[_0x44e7('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x44e7('0x1')](0x2)[_0x44e7('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x44e7('0x1')](0x2)[_0x44e7('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x44e7('0x1')](0x2)[_0x44e7('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x44e7('0x1')](0x2)[_0x44e7('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x44e7('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x44e7('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x44e7('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x44e7('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x44e7('0x1')],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0x44e7('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xae12=['STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','exports','INTEGER','min_internal','/var/opt/motion2/server/files/sounds/converted'];(function(_0x49b721,_0xe862a5){var _0xb5348d=function(_0xc0e846){while(--_0xc0e846){_0x49b721['push'](_0x49b721['shift']());}};_0xb5348d(++_0xe862a5);}(_0xae12,0xef));var _0x2ae1=function(_0x4404ff,_0x13d7a9){_0x4404ff=_0x4404ff-0x0;var _0x5e7b19=_0xae12[_0x4404ff];return _0x5e7b19;};'use strict';var Sequelize=require('sequelize');module[_0x2ae1('0x0')]={'min_internal':{'type':Sequelize[_0x2ae1('0x1')](0xb),'unique':_0x2ae1('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x2ae1('0x1')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x2ae1('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x2ae1('0x3')},'logo':{'type':Sequelize[_0x2ae1('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x2ae1('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x2ae1('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x2ae1('0x4')]},'pageTitle':{'type':Sequelize[_0x2ae1('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x2ae1('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x2ae1('0x4')],'defaultValue':_0x2ae1('0x6')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x2ae1('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x2ae1('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x2ae1('0x4')],'defaultValue':_0x2ae1('0x7')},'chatTimeout':{'type':Sequelize[_0x2ae1('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x2ae1('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x2ae1('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x2ae1('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x2ae1('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x2ae1('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x2ae1('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x2ae1('0x1')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x2ae1('0x1')](0x2)[_0x2ae1('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x2ae1('0x1')](0x2)[_0x2ae1('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x2ae1('0x1')](0x2)[_0x2ae1('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x2ae1('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x2ae1('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x2ae1('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x2ae1('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x2ae1('0x1')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x2ae1('0x1')],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0x2ae1('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 983ff5c..be9b152 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 _0x594d=['getDate','now','utcOffset','format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','client','http','request','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','Setting,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','stack','name','send','index','Setting','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','rows','show','params','find','body','addLogo','file','filename','getLogo','server/files/images/logos','getLicense','logo','loginLogo','preferred','favicon','defaultLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','ValidationError','\x20not\x20found','download','../../config/license/util','getLogoLogin','defaultLoginLogo','defaultPreferred','default_loginLogo.svg','Sequelize','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico'];(function(_0x1feb65,_0x59d59b){var _0xb2dbb3=function(_0x13c353){while(--_0x13c353){_0x1feb65['push'](_0x1feb65['shift']());}};_0xb2dbb3(++_0x59d59b);}(_0x594d,0x172));var _0xd594=function(_0x19562d,_0x16d6a2){_0x19562d=_0x19562d-0x0;var _0x3afbdc=_0x594d[_0x19562d];return _0x3afbdc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd594('0x0'));var jsonpatch=require(_0xd594('0x1'));var rp=require(_0xd594('0x2'));var moment=require(_0xd594('0x3'));var BPromise=require(_0xd594('0x4'));var Mustache=require('mustache');var util=require(_0xd594('0x5'));var path=require(_0xd594('0x6'));var sox=require(_0xd594('0x7'));var csv=require(_0xd594('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd594('0x9'));var crypto=require(_0xd594('0xa'));var jsforce=require(_0xd594('0xb'));var deskjs=require(_0xd594('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd594('0xd'));var Redis=require(_0xd594('0xe'));var authService=require(_0xd594('0xf'));var qs=require(_0xd594('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd594('0x11'));var logger=require(_0xd594('0x12'))(_0xd594('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd594('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xd594('0x15')][_0xd594('0x16')]({'port':0x232a});function respondWithRpcPromise(_0xd6b968,_0x567805,_0x299dc8,_0x5c4845){return new BPromise(function(_0x2afeb9,_0x382d53){var _0x50c79a=_0x5c4845||client;return _0x50c79a[_0xd594('0x17')](_0xd6b968,_0x299dc8)[_0xd594('0x18')](function(_0x1b5a8e){logger[_0xd594('0x19')]('Setting,\x20%s,\x20%s',_0x567805,_0xd594('0x1a'));logger['debug'](_0xd594('0x1b'),_0x567805,_0xd594('0x1a'),JSON[_0xd594('0x1c')](_0x1b5a8e));if(_0x1b5a8e['error']){if(_0x1b5a8e[_0xd594('0x1d')]['code']===0x1f4){logger[_0xd594('0x1d')]('Setting,\x20%s,\x20%s',_0x567805,_0x1b5a8e['error'][_0xd594('0x1e')]);return _0x382d53(_0x1b5a8e[_0xd594('0x1d')]['message']);}logger['error']('Setting,\x20%s,\x20%s',_0x567805,_0x1b5a8e['error']['message']);return _0x2afeb9(_0x1b5a8e[_0xd594('0x1d')][_0xd594('0x1e')]);}else{logger[_0xd594('0x19')](_0xd594('0x1f'),_0x567805,_0xd594('0x1a'));_0x2afeb9(_0x1b5a8e[_0xd594('0x20')][_0xd594('0x1e')]);}})[_0xd594('0x21')](function(_0x44f3b1){logger[_0xd594('0x1d')]('Setting,\x20%s,\x20%s',_0x567805,_0x44f3b1);_0x382d53(_0x44f3b1);});});}function respondWithStatusCode(_0x3c9cdd,_0x3414d6){_0x3414d6=_0x3414d6||0xcc;return function(_0x4bdaa5){if(_0x4bdaa5){return _0x3c9cdd[_0xd594('0x22')](_0x3414d6);}return _0x3c9cdd[_0xd594('0x23')](_0x3414d6)[_0xd594('0x24')]();};}function respondWithResult(_0xbe46d3,_0x19e9bf){_0x19e9bf=_0x19e9bf||0xc8;return function(_0x55e9f0){if(_0x55e9f0){return _0xbe46d3['status'](_0x19e9bf)[_0xd594('0x25')](_0x55e9f0);}};}function respondWithFilteredResult(_0x863291,_0x8ce6d0){return function(_0x348ea6){if(_0x348ea6){var _0x5cb20b=typeof _0x8ce6d0['offset']===_0xd594('0x26')&&typeof _0x8ce6d0[_0xd594('0x27')]===_0xd594('0x26');var _0x1dbe82=_0x348ea6[_0xd594('0x28')];var _0xe27623=_0x5cb20b?0x0:_0x8ce6d0[_0xd594('0x29')];var _0x1d784a=_0x5cb20b?_0x348ea6['count']:_0x8ce6d0[_0xd594('0x29')]+_0x8ce6d0[_0xd594('0x27')];var _0x3831d2;if(_0x1d784a>=_0x1dbe82){_0x1d784a=_0x1dbe82;_0x3831d2=0xc8;}else{_0x3831d2=0xce;}_0x863291[_0xd594('0x23')](_0x3831d2);return _0x863291[_0xd594('0x2a')](_0xd594('0x2b'),_0xe27623+'-'+_0x1d784a+'/'+_0x1dbe82)[_0xd594('0x25')](_0x348ea6);}return null;};}function patchUpdates(_0x29ff1e){return function(_0x31271a){try{jsonpatch[_0xd594('0x2c')](_0x31271a,_0x29ff1e,!![]);}catch(_0x216824){return BPromise['reject'](_0x216824);}return _0x31271a[_0xd594('0x2d')]();};}function saveUpdates(_0x641fbe,_0x3f1ca3){return function(_0x2b44ab){if(_0x2b44ab){return _0x2b44ab[_0xd594('0x2e')](_0x641fbe)[_0xd594('0x18')](function(_0x390a4c){return _0x390a4c;});}return null;};}function removeEntity(_0x3a843e,_0x50386a){return function(_0x5663f5){if(_0x5663f5){return _0x5663f5[_0xd594('0x2f')]()['then'](function(){_0x3a843e[_0xd594('0x23')](0xcc)[_0xd594('0x24')]();});}};}function handleEntityNotFound(_0x587cfb,_0x47adae){return function(_0x3d761f){if(!_0x3d761f){_0x587cfb[_0xd594('0x22')](0x194);}return _0x3d761f;};}function handleError(_0x42835f,_0x309200){_0x309200=_0x309200||0x1f4;return function(_0x3bfd6d){logger['error'](_0x3bfd6d[_0xd594('0x30')]);if(_0x3bfd6d[_0xd594('0x31')]){delete _0x3bfd6d[_0xd594('0x31')];}_0x42835f[_0xd594('0x23')](_0x309200)[_0xd594('0x32')](_0x3bfd6d);};}exports[_0xd594('0x33')]=function(_0x26dac3,_0x4f9858){var _0x4f55de={},_0x466a94={},_0x54ebd9={'count':0x0,'rows':[]};var _0x40dcfb=_['map'](db[_0xd594('0x34')][_0xd594('0x35')],function(_0x198520){return{'name':_0x198520[_0xd594('0x36')],'type':_0x198520[_0xd594('0x37')][_0xd594('0x38')]};});_0x466a94['model']=_[_0xd594('0x39')](_0x40dcfb,_0xd594('0x31'));_0x466a94['query']=_[_0xd594('0x3a')](_0x26dac3[_0xd594('0x3b')]);_0x466a94[_0xd594('0x3c')]=_[_0xd594('0x3d')](_0x466a94['model'],_0x466a94[_0xd594('0x3b')]);_0x4f55de[_0xd594('0x3e')]=_[_0xd594('0x3d')](_0x466a94[_0xd594('0x3f')],qs['fields'](_0x26dac3[_0xd594('0x3b')][_0xd594('0x40')]));_0x4f55de[_0xd594('0x3e')]=_0x4f55de[_0xd594('0x3e')][_0xd594('0x41')]?_0x4f55de[_0xd594('0x3e')]:_0x466a94[_0xd594('0x3f')];if(!_0x26dac3['query'][_0xd594('0x42')](_0xd594('0x43'))){_0x4f55de['limit']=qs[_0xd594('0x27')](_0x26dac3[_0xd594('0x3b')][_0xd594('0x27')]);_0x4f55de['offset']=qs[_0xd594('0x29')](_0x26dac3[_0xd594('0x3b')][_0xd594('0x29')]);}_0x4f55de[_0xd594('0x44')]=qs[_0xd594('0x45')](_0x26dac3['query'][_0xd594('0x45')]);_0x4f55de[_0xd594('0x46')]=qs[_0xd594('0x3c')](_[_0xd594('0x47')](_0x26dac3['query'],_0x466a94[_0xd594('0x3c')]),_0x40dcfb);if(_0x26dac3[_0xd594('0x3b')]['filter']){_0x4f55de[_0xd594('0x46')]=_['merge'](_0x4f55de[_0xd594('0x46')],{'$or':_[_0xd594('0x39')](_0x40dcfb,function(_0x10d496){if(_0x10d496[_0xd594('0x37')]!==_0xd594('0x48')){var _0x353baa={};_0x353baa[_0x10d496[_0xd594('0x31')]]={'$like':'%'+_0x26dac3[_0xd594('0x3b')][_0xd594('0x49')]+'%'};return _0x353baa;}})});}_0x4f55de=_['merge']({},_0x4f55de,_0x26dac3[_0xd594('0x4a')]);var _0x4cad2a={'where':_0x4f55de[_0xd594('0x46')]};return db['Setting'][_0xd594('0x28')](_0x4cad2a)[_0xd594('0x18')](function(_0xf260f4){_0x54ebd9[_0xd594('0x28')]=_0xf260f4;if(_0x26dac3[_0xd594('0x3b')][_0xd594('0x4b')]){_0x4f55de[_0xd594('0x4c')]=[{'all':!![]}];}return db['Setting']['findAll'](_0x4f55de);})[_0xd594('0x18')](function(_0x1b0a3e){_0x54ebd9[_0xd594('0x4d')]=_0x1b0a3e;return _0x54ebd9;})[_0xd594('0x18')](respondWithFilteredResult(_0x4f9858,_0x4f55de))[_0xd594('0x21')](handleError(_0x4f9858,null));};exports[_0xd594('0x4e')]=function(_0x393d15,_0x3ffb1b){var _0xc94665={'raw':![],'where':{'id':_0x393d15[_0xd594('0x4f')]['id']}},_0x22a20a={};_0x22a20a['model']=_[_0xd594('0x3a')](db[_0xd594('0x34')][_0xd594('0x35')]);_0x22a20a[_0xd594('0x3b')]=_['keys'](_0x393d15[_0xd594('0x3b')]);_0x22a20a[_0xd594('0x3c')]=_[_0xd594('0x3d')](_0x22a20a[_0xd594('0x3f')],_0x22a20a[_0xd594('0x3b')]);_0xc94665[_0xd594('0x3e')]=_[_0xd594('0x3d')](_0x22a20a[_0xd594('0x3f')],qs['fields'](_0x393d15[_0xd594('0x3b')][_0xd594('0x40')]));_0xc94665[_0xd594('0x3e')]=_0xc94665[_0xd594('0x3e')]['length']?_0xc94665[_0xd594('0x3e')]:_0x22a20a[_0xd594('0x3f')];if(_0x393d15[_0xd594('0x3b')][_0xd594('0x4b')]){_0xc94665[_0xd594('0x4c')]=[{'all':!![]}];}_0xc94665=_['merge']({},_0xc94665,_0x393d15[_0xd594('0x4a')]);return db[_0xd594('0x34')][_0xd594('0x50')](_0xc94665)[_0xd594('0x18')](handleEntityNotFound(_0x3ffb1b,null))[_0xd594('0x18')](respondWithResult(_0x3ffb1b,null))[_0xd594('0x21')](handleError(_0x3ffb1b,null));};exports['update']=function(_0x35f6a7,_0xe092c0){if(_0x35f6a7['body']['id']){delete _0x35f6a7['body']['id'];}return db[_0xd594('0x34')][_0xd594('0x50')]({'where':{'id':_0x35f6a7[_0xd594('0x4f')]['id']}})[_0xd594('0x18')](handleEntityNotFound(_0xe092c0,null))[_0xd594('0x18')](saveUpdates(_0x35f6a7[_0xd594('0x51')],null))['then'](respondWithResult(_0xe092c0,null))[_0xd594('0x21')](handleError(_0xe092c0,null));};exports[_0xd594('0x52')]=function(_0x583d73,_0x4e5a4b,_0x5765d8){if(_0x583d73[_0xd594('0x53')]&&_0x583d73[_0xd594('0x53')][_0xd594('0x54')]){_0x583d73[_0xd594('0x51')]['logo']=_0x583d73[_0xd594('0x53')]['filename'];}return db['Setting']['find']({'where':{'id':_0x583d73[_0xd594('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4e5a4b,null))[_0xd594('0x18')](saveUpdates(_0x583d73['body'],null))[_0xd594('0x18')](respondWithResult(_0x4e5a4b,null))[_0xd594('0x21')](handleError(_0x4e5a4b,null));};exports['addLogoLogin']=function(_0xe96f88,_0x2160b1,_0x589115){if(_0xe96f88['file']&&_0xe96f88[_0xd594('0x53')][_0xd594('0x54')]){_0xe96f88[_0xd594('0x51')]['loginLogo']=_0xe96f88[_0xd594('0x53')][_0xd594('0x54')];}return db[_0xd594('0x34')][_0xd594('0x50')]({'where':{'id':_0xe96f88[_0xd594('0x4f')]['id']}})[_0xd594('0x18')](handleEntityNotFound(_0x2160b1,null))[_0xd594('0x18')](saveUpdates(_0xe96f88['body'],null))[_0xd594('0x18')](respondWithResult(_0x2160b1,null))[_0xd594('0x21')](handleError(_0x2160b1,null));};var utilLicense=require('../../config/license/util');exports[_0xd594('0x55')]=function(_0x115925,_0x344989,_0x3c34f9){var _0x4ef6d2=_0xd594('0x56');var _0xdf0231={'custom':![]};return utilLicense[_0xd594('0x57')]()['then'](function(_0x1a1b2d){if(_0x1a1b2d){_0xdf0231=_0x1a1b2d;}return db[_0xd594('0x34')]['find']({'where':{'id':_0x115925['params']['id']},'attributes':[_0xd594('0x58'),_0xd594('0x59'),_0xd594('0x5a'),_0xd594('0x5b'),_0xd594('0x5c'),'defaultLoginLogo','defaultPreferred',_0xd594('0x5d')],'raw':!![]});})[_0xd594('0x18')](handleEntityNotFound(_0x344989,null))[_0xd594('0x18')](function(_0x3314d1){if(_0x3314d1){var _0x1390ed=_0x3314d1[_0xd594('0x58')]&&fs[_0xd594('0x5e')](path[_0xd594('0x5f')](config['root'],_0x4ef6d2,_['toLower'](_0x3314d1[_0xd594('0x58')])))?path[_0xd594('0x5f')](config[_0xd594('0x60')],_0x4ef6d2,_[_0xd594('0x61')](_0x3314d1[_0xd594('0x58')])):path[_0xd594('0x5f')](config[_0xd594('0x60')],_0x4ef6d2,_[_0xd594('0x61')](_0xd594('0x62')));var _0x4c0046=_0xd594('0x63')+_[_0xd594('0x64')]('logo');if(_0x3314d1[_0x4c0046]||!_0xdf0231[_0xd594('0x65')]){_0x1390ed=path['join'](config[_0xd594('0x60')],_0x4ef6d2,_[_0xd594('0x61')]('default_logo.svg'));}if(!fs['existsSync'](_0x1390ed)){throw new db['Sequelize'][(_0xd594('0x66'))](_[_0xd594('0x64')](_0xd594('0x58'))+_0xd594('0x67'));}return _0x344989[_0xd594('0x68')](_0x1390ed);}})[_0xd594('0x21')](handleError(_0x344989,null));};var utilLicense=require(_0xd594('0x69'));exports[_0xd594('0x6a')]=function(_0x2e8291,_0x100d14,_0x428951){var _0x1f9d10=_0xd594('0x56');var _0x134d09={'custom':![]};return utilLicense[_0xd594('0x57')]()[_0xd594('0x18')](function(_0x414b48){if(_0x414b48){_0x134d09=_0x414b48;}return db[_0xd594('0x34')][_0xd594('0x50')]({'where':{'id':_0x2e8291[_0xd594('0x4f')]['id']},'attributes':['logo','loginLogo',_0xd594('0x5a'),'favicon',_0xd594('0x5c'),_0xd594('0x6b'),_0xd594('0x6c'),_0xd594('0x5d')],'raw':!![]});})[_0xd594('0x18')](handleEntityNotFound(_0x100d14,null))[_0xd594('0x18')](function(_0x3e137a){if(_0x3e137a){var _0x143032=_0x3e137a['loginLogo']&&fs[_0xd594('0x5e')](path['join'](config[_0xd594('0x60')],_0x1f9d10,_[_0xd594('0x61')](_0x3e137a[_0xd594('0x59')])))?path[_0xd594('0x5f')](config['root'],_0x1f9d10,_[_0xd594('0x61')](_0x3e137a[_0xd594('0x59')])):path[_0xd594('0x5f')](config[_0xd594('0x60')],_0x1f9d10,_[_0xd594('0x61')](_0xd594('0x6d')));var _0x2ede54=_0xd594('0x63')+_[_0xd594('0x64')]('loginLogo');if(_0x3e137a[_0x2ede54]||!_0x134d09[_0xd594('0x65')]){_0x143032=path[_0xd594('0x5f')](config['root'],_0x1f9d10,_['toLower']('default_loginLogo.svg'));}if(!fs[_0xd594('0x5e')](_0x143032)){throw new db[(_0xd594('0x6e'))][(_0xd594('0x66'))](_['upperFirst'](_0xd594('0x59'))+'\x20not\x20found');}return _0x100d14[_0xd594('0x68')](_0x143032);}})[_0xd594('0x21')](handleError(_0x100d14,null));};exports[_0xd594('0x6f')]=function(_0x5c79fd,_0x54eb33){return db['Setting']['find']({'where':{'id':_0x5c79fd['params']['id']},'attributes':[_0xd594('0x70')]})[_0xd594('0x18')](respondWithResult(_0x54eb33,null))[_0xd594('0x21')](handleError(_0x54eb33,null));};exports[_0xd594('0x71')]=function(_0x26f364,_0x2d7428,_0x13a802){if(_0x26f364['file']&&_0x26f364[_0xd594('0x53')][_0xd594('0x54')]){_0x26f364[_0xd594('0x51')]['preferred']=_0x26f364[_0xd594('0x53')]['filename'];}return db[_0xd594('0x34')][_0xd594('0x50')]({'where':{'id':_0x26f364[_0xd594('0x4f')]['id']}})[_0xd594('0x18')](handleEntityNotFound(_0x2d7428,null))['then'](saveUpdates(_0x26f364[_0xd594('0x51')],null))[_0xd594('0x18')](respondWithResult(_0x2d7428,null))['catch'](handleError(_0x2d7428,null));};var utilLicense=require('../../config/license/util');exports[_0xd594('0x72')]=function(_0xb09744,_0x202422,_0x1f3e63){var _0x4dff25=_0xd594('0x56');var _0x464144={'custom':![]};return utilLicense[_0xd594('0x57')]()['then'](function(_0xb58760){if(_0xb58760){_0x464144=_0xb58760;}return db['Setting']['find']({'where':{'id':_0xb09744[_0xd594('0x4f')]['id']},'attributes':[_0xd594('0x58'),_0xd594('0x59'),_0xd594('0x5a'),_0xd594('0x5b'),_0xd594('0x5c'),_0xd594('0x6b'),_0xd594('0x6c'),_0xd594('0x5d')],'raw':!![]});})[_0xd594('0x18')](handleEntityNotFound(_0x202422,null))['then'](function(_0x386734){if(_0x386734){var _0x575285=_0x386734['preferred']&&fs['existsSync'](path[_0xd594('0x5f')](config['root'],_0x4dff25,_['toLower'](_0x386734[_0xd594('0x5a')])))?path[_0xd594('0x5f')](config[_0xd594('0x60')],_0x4dff25,_[_0xd594('0x61')](_0x386734[_0xd594('0x5a')])):path[_0xd594('0x5f')](config[_0xd594('0x60')],_0x4dff25,_['toLower'](_0xd594('0x73')));var _0x5b7b10=_0xd594('0x63')+_[_0xd594('0x64')](_0xd594('0x5a'));if(_0x386734[_0x5b7b10]||!_0x464144[_0xd594('0x65')]||!_0x464144[_0xd594('0x5a')]){_0x575285=path[_0xd594('0x5f')](config['root'],_0x4dff25,_[_0xd594('0x61')](_0xd594('0x73')));}if(!fs['existsSync'](_0x575285)){throw new db['Sequelize']['ValidationError'](_[_0xd594('0x64')](_0xd594('0x5a'))+'\x20not\x20found');}return _0x202422[_0xd594('0x68')](_0x575285);}})[_0xd594('0x21')](handleError(_0x202422,null));};exports[_0xd594('0x74')]=function(_0x4845ba,_0x28e362,_0x305243){if(_0x4845ba[_0xd594('0x53')]&&_0x4845ba[_0xd594('0x53')][_0xd594('0x54')]){_0x4845ba[_0xd594('0x51')][_0xd594('0x5b')]=_0x4845ba[_0xd594('0x53')][_0xd594('0x54')];}return db[_0xd594('0x34')][_0xd594('0x50')]({'where':{'id':_0x4845ba['params']['id']}})[_0xd594('0x18')](handleEntityNotFound(_0x28e362,null))['then'](saveUpdates(_0x4845ba[_0xd594('0x51')],null))[_0xd594('0x18')](respondWithResult(_0x28e362,null))[_0xd594('0x21')](handleError(_0x28e362,null));};var utilLicense=require(_0xd594('0x69'));exports['getFavicon']=function(_0x5ec264,_0x4879a4,_0x1cf83e){var _0x4150e6=_0xd594('0x56');var _0x3680bb={'custom':![]};return utilLicense[_0xd594('0x57')]()[_0xd594('0x18')](function(_0xb020b3){if(_0xb020b3){_0x3680bb=_0xb020b3;}return db[_0xd594('0x34')][_0xd594('0x50')]({'where':{'id':_0x5ec264['params']['id']},'attributes':['logo',_0xd594('0x59'),'preferred',_0xd594('0x5b'),'defaultLogo',_0xd594('0x6b'),_0xd594('0x6c'),_0xd594('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x4879a4,null))[_0xd594('0x18')](function(_0x2d0e6e){if(_0x2d0e6e){var _0x4f0f40=_0x2d0e6e[_0xd594('0x5b')]&&fs[_0xd594('0x5e')](path['join'](config[_0xd594('0x60')],_0x4150e6,_['toLower'](_0x2d0e6e['favicon'])))?path[_0xd594('0x5f')](config['root'],_0x4150e6,_[_0xd594('0x61')](_0x2d0e6e[_0xd594('0x5b')])):path['join'](config['root'],_0x4150e6,_['toLower'](_0xd594('0x75')));var _0x49926a=_0xd594('0x63')+_[_0xd594('0x64')](_0xd594('0x5b'));if(_0x2d0e6e[_0x49926a]||!_0x3680bb['custom']){_0x4f0f40=path[_0xd594('0x5f')](config['root'],_0x4150e6,_[_0xd594('0x61')](_0xd594('0x75')));}if(!fs[_0xd594('0x5e')](_0x4f0f40)){throw new db['Sequelize'][(_0xd594('0x66'))](_[_0xd594('0x64')](_0xd594('0x5b'))+'\x20not\x20found');}return _0x4879a4[_0xd594('0x68')](_0x4f0f40);}})[_0xd594('0x21')](handleError(_0x4879a4,null));};exports[_0xd594('0x76')]=function(_0x17e687,_0x1256dc){var _0xcc8258={'offset':moment()['utcOffset']()};_0xcc8258[_0xd594('0x77')]=moment()[_0xd594('0x78')](_0xcc8258[_0xd594('0x29')])[_0xd594('0x79')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x1256dc['status'](0xc8)[_0xd594('0x32')](_0xcc8258);}; \ No newline at end of file +var _0xce50=['moment','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','stack','name','send','index','map','Setting','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','findAll','rows','show','params','keys','includeAll','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','Sequelize','download','getLicense','default_loginLogo.svg','ValidationError','\x20not\x20found','gdpr','securePassword','addPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce50,0x1d8));var _0x0ce5=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xce50[_0xbd08b4];return _0x314f1e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0ce5('0x0'));var zipdir=require(_0x0ce5('0x1'));var jsonpatch=require(_0x0ce5('0x2'));var rp=require(_0x0ce5('0x3'));var moment=require(_0x0ce5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0ce5('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0ce5('0x6'));var ejs=require(_0x0ce5('0x7'));var fs=require('fs');var fs_extra=require(_0x0ce5('0x8'));var _=require(_0x0ce5('0x9'));var squel=require('squel');var crypto=require(_0x0ce5('0xa'));var jsforce=require(_0x0ce5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0ce5('0x6'));var querystring=require('querystring');var Papa=require(_0x0ce5('0xc'));var Redis=require(_0x0ce5('0xd'));var authService=require(_0x0ce5('0xe'));var qs=require(_0x0ce5('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0ce5('0x10'));var logger=require(_0x0ce5('0x11'))(_0x0ce5('0x12'));var utils=require(_0x0ce5('0x13'));var config=require(_0x0ce5('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x0ce5('0x15')][_0x0ce5('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x352865,_0x282453,_0x4f4a14,_0x85bbb){return new BPromise(function(_0x117fa9,_0x5f4317){var _0x45dacd=_0x85bbb||client;return _0x45dacd['request'](_0x352865,_0x4f4a14)[_0x0ce5('0x17')](function(_0x1dd856){logger[_0x0ce5('0x18')](_0x0ce5('0x19'),_0x282453,_0x0ce5('0x1a'));logger[_0x0ce5('0x1b')](_0x0ce5('0x1c'),_0x282453,_0x0ce5('0x1a'),JSON['stringify'](_0x1dd856));if(_0x1dd856[_0x0ce5('0x1d')]){if(_0x1dd856[_0x0ce5('0x1d')]['code']===0x1f4){logger['error'](_0x0ce5('0x19'),_0x282453,_0x1dd856['error'][_0x0ce5('0x1e')]);return _0x5f4317(_0x1dd856[_0x0ce5('0x1d')][_0x0ce5('0x1e')]);}logger[_0x0ce5('0x1d')](_0x0ce5('0x19'),_0x282453,_0x1dd856[_0x0ce5('0x1d')]['message']);return _0x117fa9(_0x1dd856[_0x0ce5('0x1d')][_0x0ce5('0x1e')]);}else{logger[_0x0ce5('0x18')](_0x0ce5('0x19'),_0x282453,'request\x20sent');_0x117fa9(_0x1dd856[_0x0ce5('0x1f')]['message']);}})[_0x0ce5('0x20')](function(_0x3c59d1){logger[_0x0ce5('0x1d')](_0x0ce5('0x19'),_0x282453,_0x3c59d1);_0x5f4317(_0x3c59d1);});});}function respondWithStatusCode(_0x334e7d,_0xbb1a2c){_0xbb1a2c=_0xbb1a2c||0xcc;return function(_0x3ca9de){if(_0x3ca9de){return _0x334e7d[_0x0ce5('0x21')](_0xbb1a2c);}return _0x334e7d[_0x0ce5('0x22')](_0xbb1a2c)[_0x0ce5('0x23')]();};}function respondWithResult(_0x5adffe,_0x5392a4){_0x5392a4=_0x5392a4||0xc8;return function(_0x2332d4){if(_0x2332d4){return _0x5adffe['status'](_0x5392a4)['json'](_0x2332d4);}};}function respondWithFilteredResult(_0x73f240,_0x564276){return function(_0x2c7414){if(_0x2c7414){var _0x1c0731=typeof _0x564276['offset']==='undefined'&&typeof _0x564276[_0x0ce5('0x24')]===_0x0ce5('0x25');var _0x565295=_0x2c7414[_0x0ce5('0x26')];var _0x470fb6=_0x1c0731?0x0:_0x564276[_0x0ce5('0x27')];var _0x54a385=_0x1c0731?_0x2c7414['count']:_0x564276[_0x0ce5('0x27')]+_0x564276[_0x0ce5('0x24')];var _0x295402;if(_0x54a385>=_0x565295){_0x54a385=_0x565295;_0x295402=0xc8;}else{_0x295402=0xce;}_0x73f240[_0x0ce5('0x22')](_0x295402);return _0x73f240[_0x0ce5('0x28')](_0x0ce5('0x29'),_0x470fb6+'-'+_0x54a385+'/'+_0x565295)[_0x0ce5('0x2a')](_0x2c7414);}return null;};}function patchUpdates(_0xf5d353){return function(_0x34612a){try{jsonpatch[_0x0ce5('0x2b')](_0x34612a,_0xf5d353,!![]);}catch(_0x2f392c){return BPromise[_0x0ce5('0x2c')](_0x2f392c);}return _0x34612a[_0x0ce5('0x2d')]();};}function saveUpdates(_0xfef4a3,_0x733d8a){return function(_0x143960){if(_0x143960){return _0x143960[_0x0ce5('0x2e')](_0xfef4a3)[_0x0ce5('0x17')](function(_0x15712d){return _0x15712d;});}return null;};}function removeEntity(_0x40dcf8,_0x1d7351){return function(_0x441ff1){if(_0x441ff1){return _0x441ff1['destroy']()[_0x0ce5('0x17')](function(){_0x40dcf8[_0x0ce5('0x22')](0xcc)[_0x0ce5('0x23')]();});}};}function handleEntityNotFound(_0x510021,_0x37a303){return function(_0x14cceb){if(!_0x14cceb){_0x510021[_0x0ce5('0x21')](0x194);}return _0x14cceb;};}function handleError(_0x92c9c7,_0x530707){_0x530707=_0x530707||0x1f4;return function(_0x3ec9c2){logger[_0x0ce5('0x1d')](_0x3ec9c2[_0x0ce5('0x2f')]);if(_0x3ec9c2[_0x0ce5('0x30')]){delete _0x3ec9c2[_0x0ce5('0x30')];}_0x92c9c7[_0x0ce5('0x22')](_0x530707)[_0x0ce5('0x31')](_0x3ec9c2);};}exports[_0x0ce5('0x32')]=function(_0x454101,_0x19c9a4){var _0x163541={},_0x453ee4={},_0x4d5a1d={'count':0x0,'rows':[]};var _0x13d73e=_[_0x0ce5('0x33')](db[_0x0ce5('0x34')]['rawAttributes'],function(_0x15cbde){return{'name':_0x15cbde[_0x0ce5('0x35')],'type':_0x15cbde[_0x0ce5('0x36')][_0x0ce5('0x37')]};});_0x453ee4['model']=_[_0x0ce5('0x33')](_0x13d73e,'name');_0x453ee4[_0x0ce5('0x38')]=_['keys'](_0x454101['query']);_0x453ee4[_0x0ce5('0x39')]=_[_0x0ce5('0x3a')](_0x453ee4[_0x0ce5('0x3b')],_0x453ee4['query']);_0x163541[_0x0ce5('0x3c')]=_[_0x0ce5('0x3a')](_0x453ee4[_0x0ce5('0x3b')],qs[_0x0ce5('0x3d')](_0x454101['query'][_0x0ce5('0x3d')]));_0x163541[_0x0ce5('0x3c')]=_0x163541[_0x0ce5('0x3c')][_0x0ce5('0x3e')]?_0x163541[_0x0ce5('0x3c')]:_0x453ee4[_0x0ce5('0x3b')];if(!_0x454101['query'][_0x0ce5('0x3f')](_0x0ce5('0x40'))){_0x163541[_0x0ce5('0x24')]=qs[_0x0ce5('0x24')](_0x454101[_0x0ce5('0x38')][_0x0ce5('0x24')]);_0x163541[_0x0ce5('0x27')]=qs[_0x0ce5('0x27')](_0x454101[_0x0ce5('0x38')]['offset']);}_0x163541['order']=qs[_0x0ce5('0x41')](_0x454101[_0x0ce5('0x38')]['sort']);_0x163541['where']=qs[_0x0ce5('0x39')](_[_0x0ce5('0x42')](_0x454101[_0x0ce5('0x38')],_0x453ee4[_0x0ce5('0x39')]),_0x13d73e);if(_0x454101[_0x0ce5('0x38')][_0x0ce5('0x43')]){_0x163541[_0x0ce5('0x44')]=_[_0x0ce5('0x45')](_0x163541[_0x0ce5('0x44')],{'$or':_[_0x0ce5('0x33')](_0x13d73e,function(_0x4f218b){if(_0x4f218b['type']!=='VIRTUAL'){var _0x3b0caf={};_0x3b0caf[_0x4f218b[_0x0ce5('0x30')]]={'$like':'%'+_0x454101[_0x0ce5('0x38')][_0x0ce5('0x43')]+'%'};return _0x3b0caf;}})});}_0x163541=_[_0x0ce5('0x45')]({},_0x163541,_0x454101[_0x0ce5('0x46')]);var _0x525c20={'where':_0x163541[_0x0ce5('0x44')]};return db[_0x0ce5('0x34')][_0x0ce5('0x26')](_0x525c20)[_0x0ce5('0x17')](function(_0x48e6c8){_0x4d5a1d[_0x0ce5('0x26')]=_0x48e6c8;if(_0x454101['query']['includeAll']){_0x163541[_0x0ce5('0x47')]=[{'all':!![]}];}return db[_0x0ce5('0x34')][_0x0ce5('0x48')](_0x163541);})[_0x0ce5('0x17')](function(_0x3a3ec5){_0x4d5a1d[_0x0ce5('0x49')]=_0x3a3ec5;return _0x4d5a1d;})[_0x0ce5('0x17')](respondWithFilteredResult(_0x19c9a4,_0x163541))[_0x0ce5('0x20')](handleError(_0x19c9a4,null));};exports[_0x0ce5('0x4a')]=function(_0x41607c,_0x3eded5){var _0x40e47c={'raw':![],'where':{'id':_0x41607c[_0x0ce5('0x4b')]['id']}},_0x5629f4={};_0x5629f4['model']=_[_0x0ce5('0x4c')](db['Setting']['rawAttributes']);_0x5629f4['query']=_[_0x0ce5('0x4c')](_0x41607c['query']);_0x5629f4['filters']=_['intersection'](_0x5629f4[_0x0ce5('0x3b')],_0x5629f4[_0x0ce5('0x38')]);_0x40e47c[_0x0ce5('0x3c')]=_[_0x0ce5('0x3a')](_0x5629f4['model'],qs['fields'](_0x41607c[_0x0ce5('0x38')][_0x0ce5('0x3d')]));_0x40e47c[_0x0ce5('0x3c')]=_0x40e47c[_0x0ce5('0x3c')][_0x0ce5('0x3e')]?_0x40e47c[_0x0ce5('0x3c')]:_0x5629f4[_0x0ce5('0x3b')];if(_0x41607c[_0x0ce5('0x38')][_0x0ce5('0x4d')]){_0x40e47c[_0x0ce5('0x47')]=[{'all':!![]}];}_0x40e47c=_[_0x0ce5('0x45')]({},_0x40e47c,_0x41607c[_0x0ce5('0x46')]);return db[_0x0ce5('0x34')][_0x0ce5('0x4e')](_0x40e47c)[_0x0ce5('0x17')](handleEntityNotFound(_0x3eded5,null))[_0x0ce5('0x17')](respondWithResult(_0x3eded5,null))[_0x0ce5('0x20')](handleError(_0x3eded5,null));};exports[_0x0ce5('0x2e')]=function(_0x1be40d,_0x5462bf){if(_0x1be40d[_0x0ce5('0x4f')]['id']){delete _0x1be40d['body']['id'];}return db[_0x0ce5('0x34')][_0x0ce5('0x4e')]({'where':{'id':_0x1be40d[_0x0ce5('0x4b')]['id']}})[_0x0ce5('0x17')](handleEntityNotFound(_0x5462bf,null))[_0x0ce5('0x17')](saveUpdates(_0x1be40d[_0x0ce5('0x4f')],null))[_0x0ce5('0x17')](respondWithResult(_0x5462bf,null))[_0x0ce5('0x20')](handleError(_0x5462bf,null));};exports[_0x0ce5('0x50')]=function(_0x17d713,_0x847e99,_0x3d8a48){if(_0x17d713[_0x0ce5('0x51')]&&_0x17d713[_0x0ce5('0x51')][_0x0ce5('0x52')]){_0x17d713[_0x0ce5('0x4f')][_0x0ce5('0x53')]=_0x17d713[_0x0ce5('0x51')][_0x0ce5('0x52')];}return db[_0x0ce5('0x34')][_0x0ce5('0x4e')]({'where':{'id':_0x17d713[_0x0ce5('0x4b')]['id']}})[_0x0ce5('0x17')](handleEntityNotFound(_0x847e99,null))[_0x0ce5('0x17')](saveUpdates(_0x17d713[_0x0ce5('0x4f')],null))[_0x0ce5('0x17')](respondWithResult(_0x847e99,null))[_0x0ce5('0x20')](handleError(_0x847e99,null));};exports[_0x0ce5('0x54')]=function(_0x517ea0,_0x8554bc,_0x579300){if(_0x517ea0[_0x0ce5('0x51')]&&_0x517ea0[_0x0ce5('0x51')][_0x0ce5('0x52')]){_0x517ea0[_0x0ce5('0x4f')][_0x0ce5('0x55')]=_0x517ea0[_0x0ce5('0x51')]['filename'];}return db['Setting']['find']({'where':{'id':_0x517ea0['params']['id']}})['then'](handleEntityNotFound(_0x8554bc,null))[_0x0ce5('0x17')](saveUpdates(_0x517ea0[_0x0ce5('0x4f')],null))[_0x0ce5('0x17')](respondWithResult(_0x8554bc,null))[_0x0ce5('0x20')](handleError(_0x8554bc,null));};var utilLicense=require(_0x0ce5('0x56'));exports[_0x0ce5('0x57')]=function(_0x2080a3,_0x4573cf,_0x2abab1){var _0x2cff86=_0x0ce5('0x58');var _0xe34980={'custom':![]};return utilLicense['getLicense']()[_0x0ce5('0x17')](function(_0x1f7405){if(_0x1f7405){_0xe34980=_0x1f7405;}return db['Setting'][_0x0ce5('0x4e')]({'where':{'id':_0x2080a3[_0x0ce5('0x4b')]['id']},'attributes':[_0x0ce5('0x53'),_0x0ce5('0x55'),_0x0ce5('0x59'),_0x0ce5('0x5a'),_0x0ce5('0x5b'),_0x0ce5('0x5c'),_0x0ce5('0x5d'),_0x0ce5('0x5e')],'raw':!![]});})['then'](handleEntityNotFound(_0x4573cf,null))[_0x0ce5('0x17')](function(_0x42efa9){if(_0x42efa9){var _0x43a734=_0x42efa9[_0x0ce5('0x53')]&&fs[_0x0ce5('0x5f')](path[_0x0ce5('0x60')](config['root'],_0x2cff86,_[_0x0ce5('0x61')](_0x42efa9[_0x0ce5('0x53')])))?path[_0x0ce5('0x60')](config[_0x0ce5('0x62')],_0x2cff86,_[_0x0ce5('0x61')](_0x42efa9[_0x0ce5('0x53')])):path['join'](config[_0x0ce5('0x62')],_0x2cff86,_[_0x0ce5('0x61')](_0x0ce5('0x63')));var _0x4b5076=_0x0ce5('0x64')+_[_0x0ce5('0x65')]('logo');if(_0x42efa9[_0x4b5076]||!_0xe34980[_0x0ce5('0x66')]){_0x43a734=path[_0x0ce5('0x60')](config['root'],_0x2cff86,_[_0x0ce5('0x61')](_0x0ce5('0x63')));}if(!fs[_0x0ce5('0x5f')](_0x43a734)){throw new db[(_0x0ce5('0x67'))]['ValidationError'](_[_0x0ce5('0x65')](_0x0ce5('0x53'))+'\x20not\x20found');}return _0x4573cf[_0x0ce5('0x68')](_0x43a734);}})[_0x0ce5('0x20')](handleError(_0x4573cf,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x329ec4,_0x1ea4c7,_0x1a2e55){var _0x5c2f23=_0x0ce5('0x58');var _0x3b0db5={'custom':![]};return utilLicense[_0x0ce5('0x69')]()['then'](function(_0x2302dd){if(_0x2302dd){_0x3b0db5=_0x2302dd;}return db[_0x0ce5('0x34')]['find']({'where':{'id':_0x329ec4[_0x0ce5('0x4b')]['id']},'attributes':[_0x0ce5('0x53'),'loginLogo',_0x0ce5('0x59'),_0x0ce5('0x5a'),_0x0ce5('0x5b'),_0x0ce5('0x5c'),'defaultPreferred',_0x0ce5('0x5e')],'raw':!![]});})[_0x0ce5('0x17')](handleEntityNotFound(_0x1ea4c7,null))[_0x0ce5('0x17')](function(_0x2c8448){if(_0x2c8448){var _0x58738a=_0x2c8448[_0x0ce5('0x55')]&&fs[_0x0ce5('0x5f')](path[_0x0ce5('0x60')](config[_0x0ce5('0x62')],_0x5c2f23,_[_0x0ce5('0x61')](_0x2c8448['loginLogo'])))?path['join'](config[_0x0ce5('0x62')],_0x5c2f23,_[_0x0ce5('0x61')](_0x2c8448[_0x0ce5('0x55')])):path['join'](config[_0x0ce5('0x62')],_0x5c2f23,_[_0x0ce5('0x61')](_0x0ce5('0x6a')));var _0x1741c6=_0x0ce5('0x64')+_[_0x0ce5('0x65')](_0x0ce5('0x55'));if(_0x2c8448[_0x1741c6]||!_0x3b0db5[_0x0ce5('0x66')]){_0x58738a=path['join'](config[_0x0ce5('0x62')],_0x5c2f23,_[_0x0ce5('0x61')](_0x0ce5('0x6a')));}if(!fs[_0x0ce5('0x5f')](_0x58738a)){throw new db[(_0x0ce5('0x67'))][(_0x0ce5('0x6b'))](_[_0x0ce5('0x65')]('loginLogo')+_0x0ce5('0x6c'));}return _0x1ea4c7['download'](_0x58738a);}})['catch'](handleError(_0x1ea4c7,null));};exports[_0x0ce5('0x6d')]=function(_0x415068,_0x19e56e){return db['Setting'][_0x0ce5('0x4e')]({'where':{'id':_0x415068[_0x0ce5('0x4b')]['id']},'attributes':[_0x0ce5('0x6e')]})[_0x0ce5('0x17')](respondWithResult(_0x19e56e,null))[_0x0ce5('0x20')](handleError(_0x19e56e,null));};exports[_0x0ce5('0x6f')]=function(_0xe05298,_0x1c0a74,_0xf5ed5a){if(_0xe05298[_0x0ce5('0x51')]&&_0xe05298[_0x0ce5('0x51')][_0x0ce5('0x52')]){_0xe05298[_0x0ce5('0x4f')][_0x0ce5('0x59')]=_0xe05298[_0x0ce5('0x51')]['filename'];}return db[_0x0ce5('0x34')]['find']({'where':{'id':_0xe05298[_0x0ce5('0x4b')]['id']}})[_0x0ce5('0x17')](handleEntityNotFound(_0x1c0a74,null))[_0x0ce5('0x17')](saveUpdates(_0xe05298['body'],null))[_0x0ce5('0x17')](respondWithResult(_0x1c0a74,null))[_0x0ce5('0x20')](handleError(_0x1c0a74,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x4659fb,_0xf83749,_0x598c3a){var _0x499c20=_0x0ce5('0x58');var _0x4c3686={'custom':![]};return utilLicense[_0x0ce5('0x69')]()[_0x0ce5('0x17')](function(_0x5928fc){if(_0x5928fc){_0x4c3686=_0x5928fc;}return db[_0x0ce5('0x34')]['find']({'where':{'id':_0x4659fb[_0x0ce5('0x4b')]['id']},'attributes':[_0x0ce5('0x53'),_0x0ce5('0x55'),_0x0ce5('0x59'),_0x0ce5('0x5a'),'defaultLogo',_0x0ce5('0x5c'),'defaultPreferred',_0x0ce5('0x5e')],'raw':!![]});})[_0x0ce5('0x17')](handleEntityNotFound(_0xf83749,null))['then'](function(_0x34322e){if(_0x34322e){var _0x4ccf66=_0x34322e['preferred']&&fs[_0x0ce5('0x5f')](path[_0x0ce5('0x60')](config[_0x0ce5('0x62')],_0x499c20,_[_0x0ce5('0x61')](_0x34322e[_0x0ce5('0x59')])))?path[_0x0ce5('0x60')](config[_0x0ce5('0x62')],_0x499c20,_[_0x0ce5('0x61')](_0x34322e[_0x0ce5('0x59')])):path[_0x0ce5('0x60')](config[_0x0ce5('0x62')],_0x499c20,_[_0x0ce5('0x61')](_0x0ce5('0x70')));var _0x355b71=_0x0ce5('0x64')+_[_0x0ce5('0x65')](_0x0ce5('0x59'));if(_0x34322e[_0x355b71]||!_0x4c3686[_0x0ce5('0x66')]||!_0x4c3686[_0x0ce5('0x59')]){_0x4ccf66=path[_0x0ce5('0x60')](config['root'],_0x499c20,_[_0x0ce5('0x61')]('default_preferred.png'));}if(!fs[_0x0ce5('0x5f')](_0x4ccf66)){throw new db[(_0x0ce5('0x67'))][(_0x0ce5('0x6b'))](_[_0x0ce5('0x65')]('preferred')+_0x0ce5('0x6c'));}return _0xf83749[_0x0ce5('0x68')](_0x4ccf66);}})[_0x0ce5('0x20')](handleError(_0xf83749,null));};exports[_0x0ce5('0x71')]=function(_0x22e286,_0x518b07,_0x11abd6){if(_0x22e286[_0x0ce5('0x51')]&&_0x22e286[_0x0ce5('0x51')]['filename']){_0x22e286[_0x0ce5('0x4f')]['favicon']=_0x22e286[_0x0ce5('0x51')][_0x0ce5('0x52')];}return db[_0x0ce5('0x34')][_0x0ce5('0x4e')]({'where':{'id':_0x22e286[_0x0ce5('0x4b')]['id']}})[_0x0ce5('0x17')](handleEntityNotFound(_0x518b07,null))['then'](saveUpdates(_0x22e286['body'],null))[_0x0ce5('0x17')](respondWithResult(_0x518b07,null))[_0x0ce5('0x20')](handleError(_0x518b07,null));};var utilLicense=require(_0x0ce5('0x56'));exports[_0x0ce5('0x72')]=function(_0x1be385,_0x22a122,_0x27a36c){var _0x102d81='server/files/images/logos';var _0x37dc41={'custom':![]};return utilLicense['getLicense']()[_0x0ce5('0x17')](function(_0x3ad112){if(_0x3ad112){_0x37dc41=_0x3ad112;}return db[_0x0ce5('0x34')][_0x0ce5('0x4e')]({'where':{'id':_0x1be385[_0x0ce5('0x4b')]['id']},'attributes':[_0x0ce5('0x53'),_0x0ce5('0x55'),_0x0ce5('0x59'),_0x0ce5('0x5a'),_0x0ce5('0x5b'),'defaultLoginLogo',_0x0ce5('0x5d'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x22a122,null))[_0x0ce5('0x17')](function(_0x3ca695){if(_0x3ca695){var _0x12e646=_0x3ca695['favicon']&&fs[_0x0ce5('0x5f')](path[_0x0ce5('0x60')](config[_0x0ce5('0x62')],_0x102d81,_[_0x0ce5('0x61')](_0x3ca695['favicon'])))?path[_0x0ce5('0x60')](config['root'],_0x102d81,_[_0x0ce5('0x61')](_0x3ca695[_0x0ce5('0x5a')])):path['join'](config['root'],_0x102d81,_[_0x0ce5('0x61')](_0x0ce5('0x73')));var _0x4abfb5=_0x0ce5('0x64')+_[_0x0ce5('0x65')](_0x0ce5('0x5a'));if(_0x3ca695[_0x4abfb5]||!_0x37dc41[_0x0ce5('0x66')]){_0x12e646=path[_0x0ce5('0x60')](config[_0x0ce5('0x62')],_0x102d81,_[_0x0ce5('0x61')](_0x0ce5('0x73')));}if(!fs[_0x0ce5('0x5f')](_0x12e646)){throw new db['Sequelize'][(_0x0ce5('0x6b'))](_[_0x0ce5('0x65')](_0x0ce5('0x5a'))+_0x0ce5('0x6c'));}return _0x22a122[_0x0ce5('0x68')](_0x12e646);}})[_0x0ce5('0x20')](handleError(_0x22a122,null));};exports['getDate']=function(_0x2b4dfc,_0x17ba87){var _0x1447aa={'offset':moment()['utcOffset']()};_0x1447aa[_0x0ce5('0x74')]=moment()['utcOffset'](_0x1447aa[_0x0ce5('0x27')])[_0x0ce5('0x75')](_0x0ce5('0x76'));return _0x17ba87[_0x0ce5('0x22')](0xc8)[_0x0ce5('0x31')](_0x1447aa);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 87f1d5b..a1a422e 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 _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x46b538,_0x30d0ca){var _0x28f458=function(_0x4e8db8){while(--_0x4e8db8){_0x46b538['push'](_0x46b538['shift']());}};_0x28f458(++_0x30d0ca);}(_0xe14b,0x93));var _0xbe14=function(_0x5e6fc4,_0x1b401c){_0x5e6fc4=_0x5e6fc4-0x0;var _0x3f2441=_0xe14b[_0x5e6fc4];return _0x3f2441;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 0207037..078b8dc 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 _0xfff5=['Setting,\x20%s,\x20%s','message','result','catch','Setting','find','options','raw','where','include','map','model','attributes','ShowSetting','stringify','lodash','util','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','code'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xfff5,0x1ef));var _0x5fff=function(_0x1ef9ae,_0x112789){_0x1ef9ae=_0x1ef9ae-0x0;var _0x835fd0=_0xfff5[_0x1ef9ae];return _0x835fd0;};'use strict';var _=require(_0x5fff('0x0'));var util=require(_0x5fff('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fff('0x2'));var db=require(_0x5fff('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5fff('0x4'))('rpc');var config=require(_0x5fff('0x5'));var jayson=require(_0x5fff('0x6'));var client=jayson['client'][_0x5fff('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x51392a,_0x5b11b3,_0x4953c5){return new BPromise(function(_0x392530,_0x48316c){return client[_0x5fff('0x8')](_0x51392a,_0x4953c5)[_0x5fff('0x9')](function(_0x1f89bf){logger[_0x5fff('0xa')]('Setting,\x20%s,\x20%s',_0x5b11b3,_0x5fff('0xb'));logger[_0x5fff('0xc')]('Setting,\x20%s,\x20%s,\x20%s',_0x5b11b3,'request\x20sent',JSON['stringify'](_0x1f89bf));if(_0x1f89bf['error']){if(_0x1f89bf[_0x5fff('0xd')][_0x5fff('0xe')]===0x1f4){logger[_0x5fff('0xd')](_0x5fff('0xf'),_0x5b11b3,_0x1f89bf[_0x5fff('0xd')][_0x5fff('0x10')]);return _0x48316c(_0x1f89bf[_0x5fff('0xd')][_0x5fff('0x10')]);}logger[_0x5fff('0xd')](_0x5fff('0xf'),_0x5b11b3,_0x1f89bf['error'][_0x5fff('0x10')]);return _0x392530(_0x1f89bf[_0x5fff('0xd')][_0x5fff('0x10')]);}else{logger[_0x5fff('0xa')](_0x5fff('0xf'),_0x5b11b3,_0x5fff('0xb'));_0x392530(_0x1f89bf[_0x5fff('0x11')][_0x5fff('0x10')]);}})[_0x5fff('0x12')](function(_0x31d7b2){logger[_0x5fff('0xd')](_0x5fff('0xf'),_0x5b11b3,_0x31d7b2);_0x48316c(_0x31d7b2);});});}exports['ShowSetting']=function(_0x8bc0ea){var _0x56e684=this;return new Promise(function(_0x460b2b,_0x1b7379){return db[_0x5fff('0x13')][_0x5fff('0x14')]({'raw':_0x8bc0ea['options']?_0x8bc0ea[_0x5fff('0x15')][_0x5fff('0x16')]===undefined?!![]:![]:!![],'where':_0x8bc0ea['options']?_0x8bc0ea['options'][_0x5fff('0x17')]||null:null,'attributes':_0x8bc0ea[_0x5fff('0x15')]?_0x8bc0ea['options']['attributes']||null:null,'include':_0x8bc0ea[_0x5fff('0x15')]?_0x8bc0ea[_0x5fff('0x15')][_0x5fff('0x18')]?_[_0x5fff('0x19')](_0x8bc0ea[_0x5fff('0x15')][_0x5fff('0x18')],function(_0x3cad0c){return{'model':db[_0x3cad0c[_0x5fff('0x1a')]],'as':_0x3cad0c['as'],'attributes':_0x3cad0c[_0x5fff('0x1b')],'include':_0x3cad0c[_0x5fff('0x18')]?_['map'](_0x3cad0c[_0x5fff('0x18')],function(_0x55196f){return{'model':db[_0x55196f['model']],'as':_0x55196f['as'],'attributes':_0x55196f[_0x5fff('0x1b')],'include':_0x55196f[_0x5fff('0x18')]?_[_0x5fff('0x19')](_0x55196f['include'],function(_0x5fe653){return{'model':db[_0x5fe653['model']],'as':_0x5fe653['as'],'attributes':_0x5fe653[_0x5fff('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5fff('0x9')](function(_0x179559){logger[_0x5fff('0xa')]('ShowSetting',_0x8bc0ea);logger[_0x5fff('0xc')](_0x5fff('0x1c'),_0x8bc0ea,JSON[_0x5fff('0x1d')](_0x179559));_0x460b2b(_0x179559);})[_0x5fff('0x12')](function(_0x27713a){logger[_0x5fff('0xd')](_0x5fff('0x1c'),_0x27713a[_0x5fff('0x10')],_0x8bc0ea);_0x1b7379(_0x56e684['error'](0x1f4,_0x27713a['message']));});});}; \ No newline at end of file +var _0x68d9=['code','message','result','catch','ShowSetting','Setting','find','options','raw','attributes','include','model','map','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5545d7,_0x23ac3d){var _0x500cfa=function(_0x3596f4){while(--_0x3596f4){_0x5545d7['push'](_0x5545d7['shift']());}};_0x500cfa(++_0x23ac3d);}(_0x68d9,0x139));var _0x968d=function(_0x252343,_0x30ff75){_0x252343=_0x252343-0x0;var _0x5691c4=_0x68d9[_0x252343];return _0x5691c4;};'use strict';var _=require(_0x968d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x968d('0x1'));var rs=require(_0x968d('0x2'));var fs=require('fs');var Redis=require(_0x968d('0x3'));var db=require(_0x968d('0x4'))['db'];var utils=require(_0x968d('0x5'));var logger=require('../../config/logger')(_0x968d('0x6'));var config=require(_0x968d('0x7'));var jayson=require(_0x968d('0x8'));var client=jayson['client'][_0x968d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9b6819,_0x5ad41e,_0x42496a){return new BPromise(function(_0x4f6980,_0xeddf35){return client['request'](_0x9b6819,_0x42496a)[_0x968d('0xa')](function(_0x262c4b){logger[_0x968d('0xb')](_0x968d('0xc'),_0x5ad41e,_0x968d('0xd'));logger[_0x968d('0xe')]('Setting,\x20%s,\x20%s,\x20%s',_0x5ad41e,'request\x20sent',JSON[_0x968d('0xf')](_0x262c4b));if(_0x262c4b['error']){if(_0x262c4b[_0x968d('0x10')][_0x968d('0x11')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x5ad41e,_0x262c4b['error'][_0x968d('0x12')]);return _0xeddf35(_0x262c4b[_0x968d('0x10')][_0x968d('0x12')]);}logger['error'](_0x968d('0xc'),_0x5ad41e,_0x262c4b[_0x968d('0x10')][_0x968d('0x12')]);return _0x4f6980(_0x262c4b[_0x968d('0x10')][_0x968d('0x12')]);}else{logger[_0x968d('0xb')](_0x968d('0xc'),_0x5ad41e,_0x968d('0xd'));_0x4f6980(_0x262c4b[_0x968d('0x13')][_0x968d('0x12')]);}})[_0x968d('0x14')](function(_0x4de2e2){logger['error'](_0x968d('0xc'),_0x5ad41e,_0x4de2e2);_0xeddf35(_0x4de2e2);});});}exports[_0x968d('0x15')]=function(_0xaab02d){var _0x5bbdef=this;return new Promise(function(_0x3a823f,_0x42e86e){return db[_0x968d('0x16')][_0x968d('0x17')]({'raw':_0xaab02d[_0x968d('0x18')]?_0xaab02d[_0x968d('0x18')][_0x968d('0x19')]===undefined?!![]:![]:!![],'where':_0xaab02d[_0x968d('0x18')]?_0xaab02d[_0x968d('0x18')]['where']||null:null,'attributes':_0xaab02d[_0x968d('0x18')]?_0xaab02d[_0x968d('0x18')][_0x968d('0x1a')]||null:null,'include':_0xaab02d[_0x968d('0x18')]?_0xaab02d[_0x968d('0x18')]['include']?_['map'](_0xaab02d[_0x968d('0x18')][_0x968d('0x1b')],function(_0x37416f){return{'model':db[_0x37416f[_0x968d('0x1c')]],'as':_0x37416f['as'],'attributes':_0x37416f[_0x968d('0x1a')],'include':_0x37416f['include']?_[_0x968d('0x1d')](_0x37416f[_0x968d('0x1b')],function(_0x4e3411){return{'model':db[_0x4e3411['model']],'as':_0x4e3411['as'],'attributes':_0x4e3411[_0x968d('0x1a')],'include':_0x4e3411[_0x968d('0x1b')]?_[_0x968d('0x1d')](_0x4e3411[_0x968d('0x1b')],function(_0x52d88b){return{'model':db[_0x52d88b['model']],'as':_0x52d88b['as'],'attributes':_0x52d88b[_0x968d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x279fa2){logger[_0x968d('0xb')](_0x968d('0x15'),_0xaab02d);logger['debug']('ShowSetting',_0xaab02d,JSON[_0x968d('0xf')](_0x279fa2));_0x3a823f(_0x279fa2);})[_0x968d('0x14')](function(_0x371850){logger[_0x968d('0x10')]('ShowSetting',_0x371850[_0x968d('0x12')],_0xaab02d);_0x42e86e(_0x5bbdef['error'](0x1f4,_0x371850[_0x968d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 4bd71d9..84b891c 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 _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(_0xc6adb7,_0x283d55){var _0x37c606=function(_0x2cf29e){while(--_0x2cf29e){_0xc6adb7['push'](_0xc6adb7['shift']());}};_0x37c606(++_0x283d55);}(_0x7a54,0x106));var _0x47a5=function(_0x3cedf5,_0x1635e7){_0x3cedf5=_0x3cedf5-0x0;var _0x360fd3=_0x7a54[_0x3cedf5];return _0x360fd3;};'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 +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(_0x29311d,_0x3f9e23){var _0xa29b8f=function(_0x2bb490){while(--_0x2bb490){_0x29311d['push'](_0x29311d['shift']());}};_0xa29b8f(++_0x3f9e23);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 1779037..8ca9dc9 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 _0x82c5=['bandwidth','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','ENUM','twilio','skebby','connectel','clicksend','clickatell'];(function(_0xffd8b0,_0x12c51f){var _0x301ba0=function(_0x103c05){while(--_0x103c05){_0xffd8b0['push'](_0xffd8b0['shift']());}};_0x301ba0(++_0x12c51f);}(_0x82c5,0x1ad));var _0x582c=function(_0x2e5c54,_0x88372d){_0x2e5c54=_0x2e5c54-0x0;var _0xf4131b=_0x82c5[_0x2e5c54];return _0xf4131b;};'use strict';var Sequelize=require(_0x582c('0x0'));var rs=require(_0x582c('0x1'));module[_0x582c('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x582c('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x582c('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x582c('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x582c('0x4')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x582c('0x4')]},'type':{'type':Sequelize[_0x582c('0x5')](_0x582c('0x6'),_0x582c('0x7'),_0x582c('0x8'),_0x582c('0x9'),'plivo',_0x582c('0xa'),_0x582c('0xb'),'csc',_0x582c('0xc'),_0x582c('0xd'))},'accountSid':{'type':Sequelize[_0x582c('0x4')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x582c('0x4')]},'smsMethod':{'type':Sequelize[_0x582c('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x582c('0x4')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x582c('0x4')]},'applicationId':{'type':Sequelize[_0x582c('0x4')]},'accountId':{'type':Sequelize[_0x582c('0x4')]},'senderString':{'type':Sequelize[_0x582c('0x4')]},'deliveryReport':{'type':Sequelize[_0x582c('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x582c('0x4')]},'notificationTemplate':{'type':Sequelize[_0x582c('0xf')],'defaultValue':function(){return _0x582c('0x10');}},'notificationSound':{'type':Sequelize[_0x582c('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x582c('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x582c('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x582c('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x582c('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x582c('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x582c('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x582c('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x582c('0xe')],'defaultValue':![],'comment':_0x582c('0x13'),'set':function(_0x5047a7){if(!_0x5047a7)this[_0x582c('0x14')]('mandatoryDispositionPauseId',null);this[_0x582c('0x14')](_0x582c('0x15'),_0x5047a7);}}}; \ No newline at end of file +var _0x1cc0=['setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x1cc0,0xba));var _0x01cc=function(_0x3caa18,_0x59ceff){_0x3caa18=_0x3caa18-0x0;var _0x545ff7=_0x1cc0[_0x3caa18];return _0x545ff7;};'use strict';var Sequelize=require(_0x01cc('0x0'));var rs=require(_0x01cc('0x1'));module[_0x01cc('0x2')]={'name':{'type':Sequelize[_0x01cc('0x3')],'unique':_0x01cc('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x01cc('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x01cc('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x01cc('0x3')],'defaultValue':function(){return rs[_0x01cc('0x5')]();}},'phone':{'type':Sequelize[_0x01cc('0x3')]},'type':{'type':Sequelize[_0x01cc('0x6')](_0x01cc('0x7'),_0x01cc('0x8'),'connectel',_0x01cc('0x9'),_0x01cc('0xa'),_0x01cc('0xb'),_0x01cc('0xc'),_0x01cc('0xd'),_0x01cc('0xe'),_0x01cc('0xf'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x01cc('0x3')]},'authToken':{'type':Sequelize[_0x01cc('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x01cc('0x3')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x01cc('0x3')]},'accountId':{'type':Sequelize[_0x01cc('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x01cc('0x10')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x01cc('0x11')],'defaultValue':function(){return _0x01cc('0x12');}},'notificationSound':{'type':Sequelize[_0x01cc('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x01cc('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x01cc('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x01cc('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x01cc('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x01cc('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x01cc('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x01cc('0x13')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x01cc('0x10')],'defaultValue':![],'comment':_0x01cc('0x14'),'set':function(_0x3552d9){if(!_0x3552d9)this[_0x01cc('0x15')](_0x01cc('0x16'),null);this[_0x01cc('0x15')]('mandatoryDisposition',_0x3552d9);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 1d54f39..61f753a 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 _0x66f5=['Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','type','model','query','intersection','attributes','fields','length','nolimit','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','hasOwnProperty','sort','removeDispositions','ids','CannedAnswer','getAnswers','order','removeAnswers','notify','sms','SmsApplication','Applications','orderBy','priority','asc','account','CmContact','Sequelize','ValidationError','createdAt','updatedAt','CompanyId','ListId','mobile','from','Body','messageId','skebby','sender','text','connectel','clicksend','message_id','plivo','From','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','omit','contact','SmsInteraction','spread','interaction','created','autoclose','applications','push','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','User','unshift','agent','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','dataValues','Messages','inspect','skebby_dispatch_id','requestid','groupName','clickatell','redif','DELIVERED','DELIVERED_TO_GATEWAY','message-delivered','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','then','request\x20sent','debug','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','get','SmsAccounts','UserProfileResource','end','name','send','index'];(function(_0x258ad8,_0x5f3a73){var _0x222a20=function(_0x544cd3){while(--_0x544cd3){_0x258ad8['push'](_0x258ad8['shift']());}};_0x222a20(++_0x5f3a73);}(_0x66f5,0x18a));var _0x566f=function(_0x4e9458,_0x1d3467){_0x4e9458=_0x4e9458-0x0;var _0x21bf3c=_0x66f5[_0x4e9458];return _0x21bf3c;};'use strict';var emlformat=require(_0x566f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x566f('0x1'));var jsonpatch=require(_0x566f('0x2'));var rp=require(_0x566f('0x3'));var moment=require(_0x566f('0x4'));var BPromise=require(_0x566f('0x5'));var Mustache=require('mustache');var util=require(_0x566f('0x6'));var path=require(_0x566f('0x7'));var sox=require(_0x566f('0x8'));var csv=require(_0x566f('0x9'));var ejs=require(_0x566f('0xa'));var fs=require('fs');var fs_extra=require(_0x566f('0xb'));var _=require('lodash');var squel=require(_0x566f('0xc'));var crypto=require(_0x566f('0xd'));var jsforce=require(_0x566f('0xe'));var deskjs=require(_0x566f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x566f('0x10'));var Papa=require('papaparse');var Redis=require(_0x566f('0x11'));var authService=require(_0x566f('0x12'));var qs=require(_0x566f('0x13'));var as=require(_0x566f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x566f('0x15'))('api');var utils=require(_0x566f('0x16'));var config=require(_0x566f('0x17'));var licenseUtil=require(_0x566f('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x566f('0x19')](config[_0x566f('0x1a')],{'host':_0x566f('0x1b'),'port':0x18eb});var socket=require(_0x566f('0x1c'))(new Redis(config[_0x566f('0x1a')]));require(_0x566f('0x1d'))[_0x566f('0x1e')](socket);var jayson=require(_0x566f('0x1f'));var client=jayson[_0x566f('0x20')][_0x566f('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x1918b8,_0x5d8bd3,_0x1c8d92,_0x45779b){return new BPromise(function(_0xfb30c9,_0x303944){var _0x1b61a9=_0x45779b||client;return _0x1b61a9['request'](_0x1918b8,_0x1c8d92)[_0x566f('0x22')](function(_0x4579e4){logger['info']('SmsAccount,\x20%s,\x20%s',_0x5d8bd3,_0x566f('0x23'));logger[_0x566f('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5d8bd3,_0x566f('0x23'),JSON[_0x566f('0x25')](_0x4579e4));if(_0x4579e4[_0x566f('0x26')]){if(_0x4579e4[_0x566f('0x26')][_0x566f('0x27')]===0x1f4){logger[_0x566f('0x26')](_0x566f('0x28'),_0x5d8bd3,_0x4579e4['error'][_0x566f('0x29')]);return _0x303944(_0x4579e4['error'][_0x566f('0x29')]);}logger[_0x566f('0x26')](_0x566f('0x28'),_0x5d8bd3,_0x4579e4['error']['message']);return _0xfb30c9(_0x4579e4[_0x566f('0x26')][_0x566f('0x29')]);}else{logger[_0x566f('0x2a')](_0x566f('0x28'),_0x5d8bd3,_0x566f('0x23'));_0xfb30c9(_0x4579e4[_0x566f('0x2b')]['message']);}})[_0x566f('0x2c')](function(_0x3f6ecc){logger[_0x566f('0x26')]('SmsAccount,\x20%s,\x20%s',_0x5d8bd3,_0x3f6ecc);_0x303944(_0x3f6ecc);});});}function respondWithStatusCode(_0x5ce207,_0x35a993){_0x35a993=_0x35a993||0xcc;return function(_0x5b7fde){if(_0x5b7fde){return _0x5ce207[_0x566f('0x2d')](_0x35a993);}return _0x5ce207[_0x566f('0x2e')](_0x35a993)['end']();};}function respondWithResult(_0x507ecb,_0x2f7f51){_0x2f7f51=_0x2f7f51||0xc8;return function(_0x90e652){if(_0x90e652){return _0x507ecb[_0x566f('0x2e')](_0x2f7f51)[_0x566f('0x2f')](_0x90e652);}};}function respondWithFilteredResult(_0x451993,_0x52d8c7){return function(_0x2c5e46){if(_0x2c5e46){var _0x4d14b9=typeof _0x52d8c7[_0x566f('0x30')]===_0x566f('0x31')&&typeof _0x52d8c7[_0x566f('0x32')]==='undefined';var _0x3f0145=_0x2c5e46[_0x566f('0x33')];var _0x35e8a1=_0x4d14b9?0x0:_0x52d8c7[_0x566f('0x30')];var _0x23862d=_0x4d14b9?_0x2c5e46['count']:_0x52d8c7[_0x566f('0x30')]+_0x52d8c7[_0x566f('0x32')];var _0x122a79;if(_0x23862d>=_0x3f0145){_0x23862d=_0x3f0145;_0x122a79=0xc8;}else{_0x122a79=0xce;}_0x451993[_0x566f('0x2e')](_0x122a79);return _0x451993[_0x566f('0x34')]('Content-Range',_0x35e8a1+'-'+_0x23862d+'/'+_0x3f0145)[_0x566f('0x2f')](_0x2c5e46);}return null;};}function patchUpdates(_0x248658){return function(_0x225a81){try{jsonpatch[_0x566f('0x35')](_0x225a81,_0x248658,!![]);}catch(_0x33511c){return BPromise[_0x566f('0x36')](_0x33511c);}return _0x225a81['save']();};}function saveUpdates(_0x299ef1,_0x12bfff){return function(_0x4c2420){if(_0x4c2420){return _0x4c2420[_0x566f('0x37')](_0x299ef1)['then'](function(_0x5b59ff){return _0x5b59ff;});}return null;};}function removeEntity(_0x4cddc6,_0x51844e){return function(_0x4daafc){if(_0x4daafc){return _0x4daafc[_0x566f('0x38')]()['then'](function(){var _0x74f09c=_0x4daafc[_0x566f('0x39')]({'plain':!![]});var _0x34d91e=_0x566f('0x3a');return db[_0x566f('0x3b')][_0x566f('0x38')]({'where':{'type':_0x34d91e,'resourceId':_0x74f09c['id']}})['then'](function(){return _0x4daafc;});})[_0x566f('0x22')](function(){_0x4cddc6['status'](0xcc)[_0x566f('0x3c')]();});}};}function handleEntityNotFound(_0x31f3d0,_0x59f702){return function(_0x143ca9){if(!_0x143ca9){_0x31f3d0[_0x566f('0x2d')](0x194);}return _0x143ca9;};}function handleError(_0x3845ad,_0x46e4fb){_0x46e4fb=_0x46e4fb||0x1f4;return function(_0x48bb7f){logger['error'](_0x48bb7f['stack']);if(_0x48bb7f[_0x566f('0x3d')]){delete _0x48bb7f[_0x566f('0x3d')];}_0x3845ad['status'](_0x46e4fb)[_0x566f('0x3e')](_0x48bb7f);};}exports[_0x566f('0x3f')]=function(_0xd1010,_0x38c600){var _0x4c88d1={'include':[{'model':db[_0x566f('0x40')],'as':_0x566f('0x41')}]},_0x544666={},_0x406398={'count':0x0,'rows':[]};var _0x363be7=_[_0x566f('0x42')](db[_0x566f('0x43')][_0x566f('0x44')],function(_0xf549ac){return{'name':_0xf549ac['fieldName'],'type':_0xf549ac[_0x566f('0x45')]['key']};});_0x544666[_0x566f('0x46')]=_[_0x566f('0x42')](_0x363be7,_0x566f('0x3d'));_0x544666['query']=_['keys'](_0xd1010[_0x566f('0x47')]);_0x544666['filters']=_[_0x566f('0x48')](_0x544666[_0x566f('0x46')],_0x544666[_0x566f('0x47')]);_0x4c88d1[_0x566f('0x49')]=_[_0x566f('0x48')](_0x544666[_0x566f('0x46')],qs[_0x566f('0x4a')](_0xd1010['query'][_0x566f('0x4a')]));_0x4c88d1[_0x566f('0x49')]=_0x4c88d1[_0x566f('0x49')][_0x566f('0x4b')]?_0x4c88d1[_0x566f('0x49')]:_0x544666[_0x566f('0x46')];if(!_0xd1010[_0x566f('0x47')]['hasOwnProperty'](_0x566f('0x4c'))){_0x4c88d1[_0x566f('0x32')]=qs[_0x566f('0x32')](_0xd1010[_0x566f('0x47')][_0x566f('0x32')]);_0x4c88d1['offset']=qs[_0x566f('0x30')](_0xd1010[_0x566f('0x47')]['offset']);}_0x4c88d1['order']=qs['sort'](_0xd1010[_0x566f('0x47')]['sort']);_0x4c88d1['where']=qs[_0x566f('0x4d')](_[_0x566f('0x4e')](_0xd1010['query'],_0x544666[_0x566f('0x4d')]),_0x363be7);if(_0xd1010[_0x566f('0x47')][_0x566f('0x4f')]){_0x4c88d1[_0x566f('0x50')]=_[_0x566f('0x51')](_0x4c88d1[_0x566f('0x50')],{'$or':_[_0x566f('0x42')](_0x363be7,function(_0x31267b){if(_0x31267b[_0x566f('0x45')]!==_0x566f('0x52')){var _0x60f719={};_0x60f719[_0x31267b[_0x566f('0x3d')]]={'$like':'%'+_0xd1010[_0x566f('0x47')]['filter']+'%'};return _0x60f719;}})});}_0x4c88d1=_['merge']({},_0x4c88d1,_0xd1010[_0x566f('0x53')]);var _0x44316d={'where':_0x4c88d1[_0x566f('0x50')]};return db[_0x566f('0x43')]['count'](_0x44316d)[_0x566f('0x22')](function(_0x1ed1b5){_0x406398['count']=_0x1ed1b5;if(_0xd1010[_0x566f('0x47')]['includeAll']){_0x4c88d1[_0x566f('0x54')]=[{'all':!![]}];}return db['SmsAccount'][_0x566f('0x55')](_0x4c88d1);})['then'](function(_0x55710d){_0x406398[_0x566f('0x56')]=_0x55710d;return _0x406398;})[_0x566f('0x22')](respondWithFilteredResult(_0x38c600,_0x4c88d1))['catch'](handleError(_0x38c600,null));};exports[_0x566f('0x57')]=function(_0x1f3b62,_0x47779f){var _0x3ed160={'raw':![],'where':{'id':_0x1f3b62[_0x566f('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x566f('0x41')}]},_0x4f7314={};_0x4f7314['model']=_[_0x566f('0x59')](db[_0x566f('0x43')][_0x566f('0x44')]);_0x4f7314[_0x566f('0x47')]=_[_0x566f('0x59')](_0x1f3b62[_0x566f('0x47')]);_0x4f7314[_0x566f('0x4d')]=_[_0x566f('0x48')](_0x4f7314[_0x566f('0x46')],_0x4f7314[_0x566f('0x47')]);_0x3ed160[_0x566f('0x49')]=_[_0x566f('0x48')](_0x4f7314['model'],qs['fields'](_0x1f3b62[_0x566f('0x47')]['fields']));_0x3ed160[_0x566f('0x49')]=_0x3ed160[_0x566f('0x49')][_0x566f('0x4b')]?_0x3ed160[_0x566f('0x49')]:_0x4f7314[_0x566f('0x46')];if(_0x1f3b62[_0x566f('0x47')][_0x566f('0x5a')]){_0x3ed160['include']=[{'all':!![]}];}_0x3ed160=_['merge']({},_0x3ed160,_0x1f3b62[_0x566f('0x53')]);return db[_0x566f('0x43')][_0x566f('0x5b')](_0x3ed160)['then'](handleEntityNotFound(_0x47779f,null))[_0x566f('0x22')](respondWithResult(_0x47779f,null))['catch'](handleError(_0x47779f,null));};exports[_0x566f('0x5c')]=function(_0xdf152a,_0x12e2b9){return db[_0x566f('0x43')][_0x566f('0x5c')](_0xdf152a[_0x566f('0x5d')],{})[_0x566f('0x22')](function(_0x5857cc){var _0x140568=_0xdf152a[_0x566f('0x5e')][_0x566f('0x39')]({'plain':!![]});if(!_0x140568)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x140568[_0x566f('0x5f')]===_0x566f('0x5e')){var _0x1dce9a=_0x5857cc['get']({'plain':!![]});var _0x58baa0=_0x566f('0x3a');return db[_0x566f('0x60')][_0x566f('0x5b')]({'where':{'name':_0x58baa0,'userProfileId':_0x140568[_0x566f('0x61')]},'raw':!![]})[_0x566f('0x22')](function(_0x170391){if(_0x170391&&_0x170391[_0x566f('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x1dce9a[_0x566f('0x3d')],'resourceId':_0x1dce9a['id'],'type':_0x170391[_0x566f('0x3d')],'sectionId':_0x170391['id']},{})[_0x566f('0x22')](function(){return _0x5857cc;});}else{return _0x5857cc;}})[_0x566f('0x2c')](function(_0x40ecea){logger[_0x566f('0x26')](_0x566f('0x63'),_0x40ecea);throw _0x40ecea;});}return _0x5857cc;})['then'](respondWithResult(_0x12e2b9,0xc9))[_0x566f('0x2c')](handleError(_0x12e2b9,null));};exports[_0x566f('0x37')]=function(_0x4555a,_0x2e4b01){if(_0x4555a[_0x566f('0x5d')]['id']){delete _0x4555a[_0x566f('0x5d')]['id'];}return db[_0x566f('0x43')][_0x566f('0x5b')]({'where':{'id':_0x4555a['params']['id']},'include':[{'model':db['Pause'],'as':_0x566f('0x41')}]})['then'](handleEntityNotFound(_0x2e4b01,null))[_0x566f('0x22')](saveUpdates(_0x4555a[_0x566f('0x5d')],null))[_0x566f('0x22')](respondWithResult(_0x2e4b01,null))[_0x566f('0x2c')](handleError(_0x2e4b01,null));};exports[_0x566f('0x38')]=function(_0x3133be,_0x26a5bd){return db[_0x566f('0x43')]['find']({'where':{'id':_0x3133be['params']['id']}})[_0x566f('0x22')](handleEntityNotFound(_0x26a5bd,null))[_0x566f('0x22')](removeEntity(_0x26a5bd,null))[_0x566f('0x2c')](handleError(_0x26a5bd,null));};exports[_0x566f('0x64')]=function(_0xfa65f8,_0x5c776b){return db['SmsAccount'][_0x566f('0x64')]()[_0x566f('0x22')](respondWithResult(_0x5c776b,null))['catch'](handleError(_0x5c776b,null));};exports[_0x566f('0x65')]=function(_0x5a6675,_0x1f291f,_0x406fe1){if(_0x5a6675[_0x566f('0x5d')]['id']){delete _0x5a6675['body']['id'];}return db[_0x566f('0x43')]['find']({'where':{'id':_0x5a6675[_0x566f('0x58')]['id']}})[_0x566f('0x22')](handleEntityNotFound(_0x1f291f,null))[_0x566f('0x22')](function(_0x4b0fc9){if(_0x4b0fc9){_0x5a6675['body'][_0x566f('0x66')]=_0x4b0fc9['id'];return db[_0x566f('0x67')]['create'](_0x5a6675[_0x566f('0x5d')]);}})[_0x566f('0x22')](respondWithResult(_0x1f291f,null))[_0x566f('0x2c')](handleError(_0x1f291f,null));};exports[_0x566f('0x68')]=function(_0x45faad,_0x575b85,_0x4027d3){var _0x2e2057={'raw':![],'where':{}};var _0x1e569c={};var _0x21dd22={'count':0x0,'rows':[]};return db['SmsAccount'][_0x566f('0x69')]({'where':{'id':_0x45faad[_0x566f('0x58')]['id']}})[_0x566f('0x22')](handleEntityNotFound(_0x575b85,null))[_0x566f('0x22')](function(_0x4e8afd){if(_0x4e8afd){_0x1e569c[_0x566f('0x46')]=_[_0x566f('0x59')](db[_0x566f('0x67')][_0x566f('0x44')]);_0x1e569c[_0x566f('0x47')]=_[_0x566f('0x59')](_0x45faad[_0x566f('0x47')]);_0x1e569c[_0x566f('0x4d')]=_[_0x566f('0x48')](_0x1e569c[_0x566f('0x46')],_0x1e569c[_0x566f('0x47')]);_0x2e2057[_0x566f('0x49')]=_[_0x566f('0x48')](_0x1e569c[_0x566f('0x46')],qs['fields'](_0x45faad[_0x566f('0x47')][_0x566f('0x4a')]));_0x2e2057[_0x566f('0x49')]=_0x2e2057[_0x566f('0x49')][_0x566f('0x4b')]?_0x2e2057[_0x566f('0x49')]:_0x1e569c[_0x566f('0x46')];if(!_0x45faad[_0x566f('0x47')][_0x566f('0x6a')]('nolimit')){_0x2e2057[_0x566f('0x32')]=qs[_0x566f('0x32')](_0x45faad[_0x566f('0x47')][_0x566f('0x32')]);_0x2e2057[_0x566f('0x30')]=qs[_0x566f('0x30')](_0x45faad[_0x566f('0x47')][_0x566f('0x30')]);}_0x2e2057['order']=qs[_0x566f('0x6b')](_0x45faad[_0x566f('0x47')][_0x566f('0x6b')]);_0x2e2057[_0x566f('0x50')]=qs[_0x566f('0x4d')](_['pick'](_0x45faad[_0x566f('0x47')],_0x1e569c[_0x566f('0x4d')]));_0x2e2057['where'][_0x566f('0x66')]=_0x4e8afd['id'];if(_0x45faad[_0x566f('0x47')][_0x566f('0x4f')]){_0x2e2057[_0x566f('0x50')]=_[_0x566f('0x51')](_0x2e2057[_0x566f('0x50')],{'$or':_[_0x566f('0x42')](_0x2e2057[_0x566f('0x49')],function(_0x14e5bc){var _0xf24c5b={};_0xf24c5b[_0x14e5bc]={'$like':'%'+_0x45faad['query']['filter']+'%'};return _0xf24c5b;})});}_0x2e2057=_['merge']({},_0x2e2057,_0x45faad[_0x566f('0x53')]);return db[_0x566f('0x67')]['count']({'where':_0x2e2057['where']})[_0x566f('0x22')](function(_0x2f143e){_0x21dd22[_0x566f('0x33')]=_0x2f143e;if(_0x45faad['query'][_0x566f('0x5a')]){_0x2e2057[_0x566f('0x54')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2e2057);})['then'](function(_0x1a3584){_0x21dd22[_0x566f('0x56')]=_0x1a3584;return _0x21dd22;});}})['then'](respondWithFilteredResult(_0x575b85,_0x2e2057))[_0x566f('0x2c')](handleError(_0x575b85,null));};exports['removeDispositions']=function(_0x1043d9,_0x1d5a9f,_0x13b416){return db[_0x566f('0x43')]['find']({'where':{'id':_0x1043d9[_0x566f('0x58')]['id']}})[_0x566f('0x22')](handleEntityNotFound(_0x1d5a9f,null))[_0x566f('0x22')](function(_0x2636f0){if(_0x2636f0){return _0x2636f0[_0x566f('0x6c')](_0x1043d9[_0x566f('0x47')][_0x566f('0x6d')]);}})[_0x566f('0x22')](respondWithStatusCode(_0x1d5a9f,null))[_0x566f('0x2c')](handleError(_0x1d5a9f,null));};exports['addAnswer']=function(_0x13ed44,_0x13b9a6,_0x21b930){if(_0x13ed44['body']['id']){delete _0x13ed44[_0x566f('0x5d')]['id'];}return db[_0x566f('0x43')][_0x566f('0x5b')]({'where':{'id':_0x13ed44[_0x566f('0x58')]['id']}})[_0x566f('0x22')](handleEntityNotFound(_0x13b9a6,null))['then'](function(_0x4759f2){if(_0x4759f2){_0x13ed44['body'][_0x566f('0x66')]=_0x4759f2['id'];return db[_0x566f('0x6e')]['create'](_0x13ed44[_0x566f('0x5d')]);}})[_0x566f('0x22')](respondWithResult(_0x13b9a6,null))[_0x566f('0x2c')](handleError(_0x13b9a6,null));};exports[_0x566f('0x6f')]=function(_0x591a1a,_0x327973,_0x3612e0){var _0x389886={'raw':![],'where':{}};var _0x354147={};var _0x1b31c5={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x591a1a[_0x566f('0x58')]['id']}})['then'](handleEntityNotFound(_0x327973,null))['then'](function(_0x18fd9a){if(_0x18fd9a){_0x354147['model']=_[_0x566f('0x59')](db[_0x566f('0x6e')][_0x566f('0x44')]);_0x354147[_0x566f('0x47')]=_['keys'](_0x591a1a[_0x566f('0x47')]);_0x354147['filters']=_[_0x566f('0x48')](_0x354147[_0x566f('0x46')],_0x354147[_0x566f('0x47')]);_0x389886[_0x566f('0x49')]=_[_0x566f('0x48')](_0x354147[_0x566f('0x46')],qs[_0x566f('0x4a')](_0x591a1a[_0x566f('0x47')][_0x566f('0x4a')]));_0x389886[_0x566f('0x49')]=_0x389886[_0x566f('0x49')][_0x566f('0x4b')]?_0x389886['attributes']:_0x354147['model'];if(!_0x591a1a[_0x566f('0x47')][_0x566f('0x6a')](_0x566f('0x4c'))){_0x389886[_0x566f('0x32')]=qs[_0x566f('0x32')](_0x591a1a[_0x566f('0x47')]['limit']);_0x389886[_0x566f('0x30')]=qs['offset'](_0x591a1a[_0x566f('0x47')][_0x566f('0x30')]);}_0x389886[_0x566f('0x70')]=qs['sort'](_0x591a1a[_0x566f('0x47')][_0x566f('0x6b')]);_0x389886[_0x566f('0x50')]=qs[_0x566f('0x4d')](_[_0x566f('0x4e')](_0x591a1a[_0x566f('0x47')],_0x354147['filters']));_0x389886[_0x566f('0x50')]['SmsAccountId']=_0x18fd9a['id'];if(_0x591a1a[_0x566f('0x47')][_0x566f('0x4f')]){_0x389886[_0x566f('0x50')]=_[_0x566f('0x51')](_0x389886[_0x566f('0x50')],{'$or':_['map'](_0x389886[_0x566f('0x49')],function(_0xd2efb8){var _0x29c060={};_0x29c060[_0xd2efb8]={'$like':'%'+_0x591a1a[_0x566f('0x47')]['filter']+'%'};return _0x29c060;})});}_0x389886=_[_0x566f('0x51')]({},_0x389886,_0x591a1a['options']);return db[_0x566f('0x6e')]['count']({'where':_0x389886[_0x566f('0x50')]})[_0x566f('0x22')](function(_0x3378dd){_0x1b31c5[_0x566f('0x33')]=_0x3378dd;if(_0x591a1a[_0x566f('0x47')][_0x566f('0x5a')]){_0x389886[_0x566f('0x54')]=[{'all':!![]}];}return db[_0x566f('0x6e')][_0x566f('0x55')](_0x389886);})[_0x566f('0x22')](function(_0x5396e8){_0x1b31c5['rows']=_0x5396e8;return _0x1b31c5;});}})[_0x566f('0x22')](respondWithFilteredResult(_0x327973,_0x389886))['catch'](handleError(_0x327973,null));};exports['removeAnswers']=function(_0x35d352,_0x3c1857,_0x596ed1){return db[_0x566f('0x43')][_0x566f('0x5b')]({'where':{'id':_0x35d352[_0x566f('0x58')]['id']}})[_0x566f('0x22')](handleEntityNotFound(_0x3c1857,null))[_0x566f('0x22')](function(_0x2bd574){if(_0x2bd574){return _0x2bd574[_0x566f('0x71')](_0x35d352[_0x566f('0x47')][_0x566f('0x6d')]);}})[_0x566f('0x22')](respondWithStatusCode(_0x3c1857,null))[_0x566f('0x2c')](handleError(_0x3c1857,null));};exports[_0x566f('0x72')]=function(_0x5c38dd,_0x4899b7,_0x3c41c3){var _0x11c951={'channel':_0x566f('0x73')};var _0x2b0d63=[];var _0x579e4e=[];var _0xe1033b={};return db['SmsAccount'][_0x566f('0x5b')]({'where':{'id':_0x5c38dd[_0x566f('0x58')]['id']},'include':[{'model':db[_0x566f('0x74')],'as':_0x566f('0x75')}]})[_0x566f('0x22')](handleEntityNotFound(_0x4899b7,null))['then'](function(_0xfd3046){_0x11c951['account']=_0xfd3046;_0x11c951['applications']=_[_0x566f('0x76')](_0xfd3046[_0x566f('0x75')],[_0x566f('0x77')],[_0x566f('0x78')]);if(_0x11c951['account'][_0x566f('0x75')]){delete _0x11c951[_0x566f('0x79')][_0x566f('0x75')];}return db[_0x566f('0x7a')][_0x566f('0x64')]();})[_0x566f('0x22')](function(_0x47dd78){if(!_0x47dd78){throw new db[(_0x566f('0x7b'))][(_0x566f('0x7c'))]('no\x20available\x20attributes');}_0x2b0d63=_['difference'](_[_0x566f('0x59')](_0x47dd78),[_0x566f('0x7d'),'updatedAt']);_0x579e4e=_['difference'](_['keys'](_0x47dd78),[_0x566f('0x7d'),_0x566f('0x7e'),_0x566f('0x7f'),_0x566f('0x80')]);_0x11c951['body']={'mapKey':_0x566f('0x81')};if(_0x11c951[_0x566f('0x79')][_0x566f('0x45')]){switch(_0x11c951[_0x566f('0x79')][_0x566f('0x45')]){case'twilio':_0x11c951[_0x566f('0x5d')][_0x566f('0x82')]=_0x5c38dd['body']['From'];_0x11c951[_0x566f('0x5d')]['body']=_0x5c38dd['body'][_0x566f('0x83')];_0x11c951[_0x566f('0x5d')][_0x566f('0x84')]=_0x5c38dd[_0x566f('0x5d')]['MessageSid'];break;case _0x566f('0x85'):_0x11c951[_0x566f('0x5d')][_0x566f('0x82')]='+'+_0x5c38dd[_0x566f('0x5d')][_0x566f('0x86')];_0x11c951[_0x566f('0x5d')][_0x566f('0x5d')]=_0x5c38dd[_0x566f('0x5d')][_0x566f('0x87')];break;case _0x566f('0x88'):_0x11c951[_0x566f('0x5d')][_0x566f('0x82')]=_0x5c38dd[_0x566f('0x5d')][_0x566f('0x82')];_0x11c951[_0x566f('0x5d')][_0x566f('0x5d')]=_0x5c38dd[_0x566f('0x5d')]['message'];break;case _0x566f('0x89'):_0x11c951['body'][_0x566f('0x82')]=_0x5c38dd[_0x566f('0x5d')][_0x566f('0x82')];_0x11c951[_0x566f('0x5d')]['body']=_0x5c38dd[_0x566f('0x5d')][_0x566f('0x5d')];_0x11c951[_0x566f('0x5d')][_0x566f('0x84')]=_0x5c38dd[_0x566f('0x5d')][_0x566f('0x8a')];break;case _0x566f('0x8b'):_0x11c951[_0x566f('0x5d')]['from']=_0x5c38dd[_0x566f('0x5d')][_0x566f('0x8c')];_0x11c951[_0x566f('0x5d')]['body']=_0x5c38dd[_0x566f('0x5d')][_0x566f('0x8d')];_0x11c951[_0x566f('0x5d')][_0x566f('0x84')]=_0x5c38dd[_0x566f('0x5d')][_0x566f('0x8e')];break;case _0x566f('0x8f'):_0x11c951[_0x566f('0x5d')][_0x566f('0x82')]='+'+_0x5c38dd[_0x566f('0x5d')][_0x566f('0x90')][0x0]['from'];_0x11c951[_0x566f('0x5d')][_0x566f('0x5d')]=_0x5c38dd['body'][_0x566f('0x90')][0x0][_0x566f('0x87')];_0x11c951[_0x566f('0x5d')]['messageId']=_0x5c38dd[_0x566f('0x5d')][_0x566f('0x90')][0x0][_0x566f('0x84')];break;case _0x566f('0x91'):_0x11c951[_0x566f('0x5d')][_0x566f('0x82')]=_0x5c38dd[_0x566f('0x5d')][_0x566f('0x92')];_0x11c951['body'][_0x566f('0x5d')]=_0x5c38dd['body'][_0x566f('0x93')]['message'];break;case'clickatell':_0x11c951[_0x566f('0x5d')]['from']=_0x5c38dd[_0x566f('0x5d')][_0x566f('0x94')];_0x11c951[_0x566f('0x5d')]['body']=_0x5c38dd[_0x566f('0x5d')]['text'];_0x11c951['body'][_0x566f('0x84')]=_0x5c38dd[_0x566f('0x5d')][_0x566f('0x95')];break;case _0x566f('0x96'):_0x11c951['body']['messageId']=_0x5c38dd[_0x566f('0x5d')][0x0][_0x566f('0x29')]['id'];_0x11c951[_0x566f('0x5d')][_0x566f('0x82')]=_0x5c38dd['body'][0x0][_0x566f('0x29')][_0x566f('0x82')];_0x11c951['body']['body']=_0x5c38dd[_0x566f('0x5d')][0x0][_0x566f('0x29')][_0x566f('0x87')];break;case _0x566f('0x97'):_0x11c951[_0x566f('0x5d')]['from']=_0x5c38dd[_0x566f('0x5d')][_0x566f('0x82')];_0x11c951[_0x566f('0x5d')][_0x566f('0x5d')]=_0x5c38dd[_0x566f('0x5d')]['message'];_0x11c951[_0x566f('0x5d')][_0x566f('0x84')]=_0x5c38dd[_0x566f('0x5d')][_0x566f('0x98')];break;}}if(_0x11c951[_0x566f('0x5d')]['id']){delete _0x11c951[_0x566f('0x5d')]['id'];}if(_[_0x566f('0x99')](_0x11c951[_0x566f('0x5d')][_0x566f('0x82')])){throw new db[(_0x566f('0x7b'))][(_0x566f('0x7c'))]('from\x20is\x20mandatory');}if(_[_0x566f('0x99')](_0x11c951[_0x566f('0x5d')][_0x566f('0x5d')])||_0x11c951[_0x566f('0x5d')]['body']===''){throw new db[(_0x566f('0x7b'))][(_0x566f('0x7c'))](_0x566f('0x9a'));}if(_[_0x566f('0x99')](_0x11c951[_0x566f('0x5d')][_0x566f('0x9b')])){throw new db[(_0x566f('0x7b'))][(_0x566f('0x7c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x579e4e);}if(!_[_0x566f('0x9c')](_0x579e4e,_0x11c951[_0x566f('0x5d')]['mapKey'])){throw new db[(_0x566f('0x7b'))][(_0x566f('0x7c'))](_0x566f('0x9d')+_0x579e4e);}_0xe1033b[_0x11c951[_0x566f('0x5d')][_0x566f('0x9b')]]=_0x11c951[_0x566f('0x5d')][_0x566f('0x82')];return db[_0x566f('0x9e')][_0x566f('0x5b')]({'where':{'id':_0x11c951[_0x566f('0x79')][_0x566f('0x80')]},'include':[{'model':db[_0x566f('0x7a')],'as':_0x566f('0x9f'),'where':_0xe1033b,'limit':0x1,'order':[['updatedAt',_0x566f('0xa0')]]}]});})[_0x566f('0x22')](handleEntityNotFound(_0x4899b7,null))[_0x566f('0x22')](function(_0x236357){if(_0x236357){_0x11c951['list']=_[_0x566f('0xa1')](_0x236357,['Contacts']);if(_0x236357['Contacts'][_0x566f('0x4b')]){return _0x236357[_0x566f('0x9f')][0x0];}var _0xffddda=_[_0x566f('0x19')](_0x11c951[_0x566f('0x5d')],{'firstName':_0x11c951[_0x566f('0x5d')][_0x566f('0x82')],'ListId':_0x236357['id']});_0xffddda[_0x11c951[_0x566f('0x5d')][_0x566f('0x9b')]]=_0x11c951['body'][_0x566f('0x82')];return db['CmContact'][_0x566f('0x5c')](_0xffddda,{'fields':_0x2b0d63,'raw':!![]});}})[_0x566f('0x22')](handleEntityNotFound(_0x4899b7,null))['then'](function(_0x5406a7){if(_0x5406a7){_0x11c951[_0x566f('0xa2')]=_0x5406a7;var _0x146c6f={'ContactId':_0x5406a7['id'],'phone':_0x11c951[_0x566f('0x5d')][_0x566f('0x82')],'SmsAccountId':_0x5c38dd[_0x566f('0x58')]['id']};var _0x42d727={'ContactId':_0x5406a7['id'],'SmsAccountId':_0x5c38dd[_0x566f('0x58')]['id'],'closed':![]};return db[_0x566f('0xa3')][_0x566f('0x5b')]({'where':_0x42d727})[_0x566f('0x22')](function(_0x1c6baf){if(_0x1c6baf){return[_0x1c6baf,![]];}return db[_0x566f('0xa3')]['create'](_0x146c6f)[_0x566f('0x22')](function(_0x4e63f0){return[_0x4e63f0,!![]];});});}})[_0x566f('0xa4')](function(_0x5497f8,_0x507b72){_0x11c951[_0x566f('0xa5')]=_0x5497f8[_0x566f('0x39')]({'plain':!![]});_0x11c951[_0x566f('0xa5')][_0x566f('0xa6')]=![];if(_0x507b72){if(_0x11c951['account'][_0x566f('0xa7')]){_0x11c951[_0x566f('0xa8')][_0x566f('0xa9')]({'id':0x0,'priority':_0x11c951[_0x566f('0xa8')][_0x566f('0x4b')]+0x1,'app':_0x566f('0xaa'),'appdata':_0x566f('0xab'),'interval':_0x566f('0xac')});}_0x11c951[_0x566f('0xa5')]['created']=!![];}return db[_0x566f('0xad')][_0x566f('0x5c')]({'phone':_0x11c951[_0x566f('0x5d')]['from'],'messageId':_0x11c951[_0x566f('0x5d')][_0x566f('0x84')],'body':_0x11c951[_0x566f('0x5d')][_0x566f('0x5d')],'SmsAccountId':_0x5c38dd[_0x566f('0x58')]['id'],'SmsInteractionId':_0x5497f8['id'],'direction':'in','ContactId':_0x5497f8['ContactId'],'AttachmentId':_0x11c951[_0x566f('0x5d')][_0x566f('0xae')]});})[_0x566f('0x22')](function(_0x17b06a){_0x11c951[_0x566f('0x29')]=_0x17b06a;if(!_0x11c951[_0x566f('0xa5')][_0x566f('0xaf')])return;return db[_0x566f('0xb0')][_0x566f('0x5b')]({'attributes':['id',_0x566f('0x3d')],'where':{'id':_0x11c951[_0x566f('0xa5')][_0x566f('0xaf')]}});})[_0x566f('0x22')](function(_0x54c217){if(_0x54c217){_0x11c951['applications'][_0x566f('0xb1')]({'id':0x0,'priority':0x0,'app':_0x566f('0xb2'),'appdata':_0x54c217[_0x566f('0x3d')]+','+(_0x11c951[_0x566f('0x79')]['waitForTheAssignedAgent']||0xa),'interval':_0x566f('0xac')});}if(!_0x11c951[_0x566f('0xa5')][_0x566f('0xb3')])return;return db[_0x566f('0xb4')][_0x566f('0x5b')]({'attributes':['id','name'],'where':{'id':_0x11c951[_0x566f('0xa5')][_0x566f('0xb3')]}});})['then'](function(_0x32ff0e){if(_0x32ff0e){_0x11c951[_0x566f('0xa8')][_0x566f('0xb1')]({'id':0x0,'priority':0x1,'app':_0x566f('0xb5'),'appdata':_0x32ff0e[_0x566f('0x3d')]+','+(_0x11c951[_0x566f('0x79')][_0x566f('0xb6')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x566f('0xb7'),_0x566f('0xb8'),_0x11c951);})['then'](function(_0x56465d){if(_0x56465d){var _0x29c978=0xc8;var _0x2fe7f7='receiveMessage';logger[_0x566f('0x2a')](_0x566f('0xb9'),_0x2fe7f7,_0x29c978,'entity\x20found');logger[_0x566f('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x2fe7f7,_0x29c978,'entity\x20found',JSON['stringify'](_0x56465d));if(_0x11c951[_0x566f('0x79')][_0x566f('0x45')]===_0x566f('0xba')){return _0x4899b7['status'](_0x29c978)[_0x566f('0x34')](_0x566f('0xbb'),_0x566f('0xbc'))[_0x566f('0x3e')](_0x566f('0xbd'));}else{return _0x4899b7[_0x566f('0x2e')](_0x29c978)[_0x566f('0x2f')](_0x56465d);}}})[_0x566f('0x2c')](handleError(_0x4899b7,null));};exports[_0x566f('0xbe')]=function(_0x234a5a,_0x55eb72){var _0x23d41a=_0x234a5a[_0x566f('0x58')]['id'];var _0x29e219=_0x234a5a[_0x566f('0x5d')];var _0x2d8cfa=0xc8;var _0x26ee8f=null;return db[_0x566f('0xbf')]['transaction']({'isolationLevel':db[_0x566f('0xbf')][_0x566f('0xc0')][_0x566f('0xc1')][_0x566f('0xc2')]},function(_0x1aa297){return db[_0x566f('0x43')][_0x566f('0x69')]({'where':{'id':_0x23d41a},'transaction':_0x1aa297})[_0x566f('0x22')](function(_0x33cdfa){if(_0x33cdfa){return db[_0x566f('0x74')][_0x566f('0x38')]({'where':{'SmsAccountId':_0x23d41a},'transaction':_0x1aa297})[_0x566f('0x22')](function(){var _0x194af6=_[_0x566f('0x42')](_0x29e219,function(_0x44ae61){_0x44ae61[_0x566f('0x66')]=_0x23d41a;return _0x44ae61;});return db[_0x566f('0x74')]['bulkCreate'](_0x194af6,{'transaction':_0x1aa297});});}else{_0x2d8cfa=0x194;_0x26ee8f=[];}});})[_0x566f('0x22')](function(){if(_0x2d8cfa!==0x194){return db[_0x566f('0x74')][_0x566f('0xc3')]({'where':{'SmsAccountId':_0x23d41a},'order':_0x566f('0x77')})[_0x566f('0x22')](function(_0x34f9e0){_0x26ee8f=_0x34f9e0;});}})[_0x566f('0x2c')](function(_0x38d17a){_0x2d8cfa=0x1f4;logger[_0x566f('0x26')](_0x38d17a[_0x566f('0xc4')]);if(_0x38d17a[_0x566f('0x3d')]){delete _0x38d17a[_0x566f('0x3d')];}_0x26ee8f=_0x38d17a;})['finally'](function(){if(_0x26ee8f===null){_0x55eb72[_0x566f('0x2d')](_0x2d8cfa);}else{if(_0x2d8cfa===0x1f4){_0x55eb72[_0x566f('0x2e')](_0x2d8cfa)[_0x566f('0x3e')](_0x26ee8f);}else{_0x55eb72[_0x566f('0x2e')](_0x2d8cfa)[_0x566f('0x2f')](_0x26ee8f);}}});};exports['getApplications']=function(_0x49868e,_0x202548,_0x529807){var _0x2ac700={};var _0x586c39={};var _0x71efa5;var _0x2e9e84;return db['SmsAccount']['findOne']({'where':{'id':_0x49868e[_0x566f('0x58')]['id']}})[_0x566f('0x22')](handleEntityNotFound(_0x202548,null))['then'](function(_0x4f57d1){if(_0x4f57d1){_0x71efa5=_0x4f57d1;_0x586c39[_0x566f('0x46')]=_['keys'](db[_0x566f('0x74')][_0x566f('0x44')]);_0x586c39['query']=_[_0x566f('0x59')](_0x49868e[_0x566f('0x47')]);_0x586c39[_0x566f('0x4d')]=_[_0x566f('0x48')](_0x586c39[_0x566f('0x46')],_0x586c39['query']);_0x2ac700[_0x566f('0x49')]=_['intersection'](_0x586c39[_0x566f('0x46')],qs['fields'](_0x49868e[_0x566f('0x47')][_0x566f('0x4a')]));_0x2ac700['attributes']=_0x2ac700[_0x566f('0x49')][_0x566f('0x4b')]?_0x2ac700['attributes']:_0x586c39[_0x566f('0x46')];_0x2ac700[_0x566f('0x70')]=qs[_0x566f('0x6b')](_0x49868e[_0x566f('0x47')][_0x566f('0x6b')]);_0x2ac700[_0x566f('0x50')]=qs[_0x566f('0x4d')](_[_0x566f('0x4e')](_0x49868e[_0x566f('0x47')],_0x586c39[_0x566f('0x4d')]));if(_0x49868e[_0x566f('0x47')][_0x566f('0x4f')]){_0x2ac700[_0x566f('0x50')]=_[_0x566f('0x51')](_0x2ac700[_0x566f('0x50')],{'$or':_[_0x566f('0x42')](_0x2ac700['attributes'],function(_0x44e6cd){var _0x214e82={};_0x214e82[_0x44e6cd]={'$like':'%'+_0x49868e['query'][_0x566f('0x4f')]+'%'};return _0x214e82;})});}_0x2ac700=_[_0x566f('0x51')]({},_0x2ac700,_0x49868e[_0x566f('0x53')]);return _0x71efa5['getApplications'](_0x2ac700);}})['then'](function(_0x5d218e){if(_0x5d218e){_0x2e9e84=_0x5d218e[_0x566f('0x4b')];if(!_0x49868e[_0x566f('0x47')]['hasOwnProperty'](_0x566f('0x4c'))){_0x2ac700['limit']=qs[_0x566f('0x32')](_0x49868e['query']['limit']);_0x2ac700['offset']=qs[_0x566f('0x30')](_0x49868e[_0x566f('0x47')][_0x566f('0x30')]);}return _0x71efa5[_0x566f('0xc5')](_0x2ac700);}})[_0x566f('0x22')](function(_0x64051c){if(_0x64051c){return _0x64051c?{'count':_0x2e9e84,'rows':_0x64051c}:null;}})[_0x566f('0x22')](respondWithResult(_0x202548,null))[_0x566f('0x2c')](handleError(_0x202548,null));};exports[_0x566f('0xc6')]=function(_0x42aca7,_0x21155d,_0x377724){var _0x1ff48a={'raw':![],'where':{}};var _0x7e8841={};var _0xce1175={'count':0x0,'rows':[]};return db[_0x566f('0x43')][_0x566f('0x69')]({'where':{'id':_0x42aca7[_0x566f('0x58')]['id']}})[_0x566f('0x22')](handleEntityNotFound(_0x21155d,null))[_0x566f('0x22')](function(_0x1a9edc){if(_0x1a9edc){_0x7e8841[_0x566f('0x46')]=_[_0x566f('0x59')](db['SmsInteraction'][_0x566f('0x44')]);_0x7e8841[_0x566f('0x47')]=_[_0x566f('0x59')](_0x42aca7[_0x566f('0x47')]);_0x7e8841[_0x566f('0x4d')]=_['intersection'](_0x7e8841[_0x566f('0x46')],_0x7e8841['query']);_0x1ff48a['attributes']=_[_0x566f('0x48')](_0x7e8841[_0x566f('0x46')],qs[_0x566f('0x4a')](_0x42aca7[_0x566f('0x47')][_0x566f('0x4a')]));_0x1ff48a[_0x566f('0x49')]=_0x1ff48a[_0x566f('0x49')]['length']?_0x1ff48a['attributes']:_0x7e8841[_0x566f('0x46')];if(!_0x42aca7['query'][_0x566f('0x6a')](_0x566f('0x4c'))){_0x1ff48a[_0x566f('0x32')]=qs[_0x566f('0x32')](_0x42aca7[_0x566f('0x47')]['limit']);_0x1ff48a[_0x566f('0x30')]=qs['offset'](_0x42aca7['query']['offset']);}_0x1ff48a[_0x566f('0x70')]=qs[_0x566f('0x6b')](_0x42aca7['query'][_0x566f('0x6b')]);_0x1ff48a[_0x566f('0x50')]=qs[_0x566f('0x4d')](_[_0x566f('0x4e')](_0x42aca7[_0x566f('0x47')],_0x7e8841[_0x566f('0x4d')]));_0x1ff48a[_0x566f('0x50')]['SmsAccountId']=_0x1a9edc['id'];if(_0x42aca7[_0x566f('0x47')][_0x566f('0x4f')]){_0x1ff48a[_0x566f('0x50')]=_[_0x566f('0x51')](_0x1ff48a[_0x566f('0x50')],{'$or':_[_0x566f('0x42')](_0x1ff48a[_0x566f('0x49')],function(_0x3260a6){var _0x267ad2={};_0x267ad2[_0x3260a6]={'$like':'%'+_0x42aca7[_0x566f('0x47')]['filter']+'%'};return _0x267ad2;})});}_0x1ff48a=_[_0x566f('0x51')]({},_0x1ff48a,_0x42aca7[_0x566f('0x53')]);return db[_0x566f('0xa3')]['count']({'where':_0x1ff48a['where']})['then'](function(_0x30dfd5){_0xce1175['count']=_0x30dfd5;if(_0x42aca7[_0x566f('0x47')][_0x566f('0x5a')]){_0x1ff48a[_0x566f('0x54')]=[{'model':db[_0x566f('0x7a')],'as':_0x566f('0xc7'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x566f('0x3d'),_0x566f('0xc8'),_0x566f('0xc9')],'required':![]},{'model':db[_0x566f('0xca')],'as':_0x566f('0xcb'),'attributes':['id',_0x566f('0x3d'),_0x566f('0xcc')],'where':_0x42aca7[_0x566f('0x47')]['tag']?{'id':_0x42aca7['query'][_0x566f('0xcd')]}:undefined,'required':_0x42aca7[_0x566f('0x47')]['tag']?!![]:![]}];}return db['SmsInteraction'][_0x566f('0x55')](_0x1ff48a);})[_0x566f('0x22')](function(_0x29c4b7){_0xce1175['rows']=_0x29c4b7;return _0xce1175;});}})[_0x566f('0x22')](respondWithFilteredResult(_0x21155d,_0x1ff48a))[_0x566f('0x2c')](handleError(_0x21155d,null));};exports['send']=function(_0x32abb5,_0x45932f,_0x5c5336){var _0x276264,_0x4d76a0,_0xc92ac7;if(_[_0x566f('0x99')](_0x32abb5['body'][_0x566f('0x5d')])||_0x32abb5[_0x566f('0x5d')][_0x566f('0x5d')]===''){throw new db[(_0x566f('0x7b'))]['ValidationError'](_0x566f('0x9a'));}if(_[_0x566f('0x99')](_0x32abb5['body']['to'])){throw new db['Sequelize'][(_0x566f('0x7c'))](_0x566f('0xce'));}_0x276264=_0x32abb5[_0x566f('0x5d')]['to'];return db['SmsAccount'][_0x566f('0x5b')]({'where':{'id':_0x32abb5[_0x566f('0x58')]['id']},'include':[{'model':db[_0x566f('0x9e')],'as':_0x566f('0xcf'),'include':[{'model':db[_0x566f('0x7a')],'as':_0x566f('0x9f'),'where':{'mobile':_0x276264},'limit':0x1,'order':[[_0x566f('0x7e'),_0x566f('0xa0')]]}]}]})[_0x566f('0x22')](handleEntityNotFound(_0x45932f,null))['then'](function(_0x38ada6){if(_0x38ada6&&_0x38ada6[_0x566f('0xcf')]){_0x4d76a0=_0x38ada6[_0x566f('0x39')]({'plain':!![]});if(_0x4d76a0[_0x566f('0xcf')]&&_0x4d76a0[_0x566f('0xcf')][_0x566f('0x9f')][_0x566f('0x4b')]){return _0x4d76a0['List'][_0x566f('0x9f')][0x0];}return db[_0x566f('0x7a')][_0x566f('0x5c')](_[_0x566f('0x19')](_0x32abb5[_0x566f('0x5d')],{'firstName':_0x276264,'mobile':_0x276264,'phone':_0x276264,'ListId':_0x4d76a0[_0x566f('0x80')]}));}})[_0x566f('0x22')](handleEntityNotFound(_0x45932f,null))[_0x566f('0x22')](function(_0x139e36){if(_0x139e36){_0xc92ac7=_0x139e36;return db[_0x566f('0xa3')]['find']({'where':{'ContactId':_0xc92ac7['id'],'closed':![],'SmsAccountId':_0x4d76a0['id']}})['then'](function(_0x3fbe0f){if(_0x3fbe0f){return[_0x3fbe0f,![]];}return db[_0x566f('0xa3')]['create']({'UserId':_0x32abb5[_0x566f('0x5e')]['id'],'ContactId':_0xc92ac7['id'],'SmsAccountId':_0x4d76a0['id'],'phone':_0x276264,'firstMsgDirection':'out','Messages':[_[_0x566f('0x51')](_0x32abb5[_0x566f('0x5d')],{'read':![],'body':_0x32abb5[_0x566f('0x5d')]['body'],'phone':_0x276264,'SmsAccountId':_0x4d76a0['id'],'UserId':_0x32abb5[_0x566f('0x5e')]['id'],'ContactId':_0xc92ac7['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})['then'](function(_0x51ca33){return[_0x51ca33,!![]];});});}})['spread'](function(_0x304bcb,_0x96472f){if(_0x96472f){return _0x304bcb;}return db[_0x566f('0xad')][_0x566f('0x5c')](_[_0x566f('0x51')](_0x32abb5['body'],{'read':![],'body':_0x32abb5[_0x566f('0x5d')][_0x566f('0x5d')],'phone':_0x276264,'SmsAccountId':_0x4d76a0['id'],'SmsInteractionId':_0x304bcb['id'],'UserId':_0x32abb5[_0x566f('0x5e')]['id'],'ContactId':_0xc92ac7['id']}))[_0x566f('0x22')](function(_0x16d6d1){_0x304bcb[_0x566f('0xd0')][_0x566f('0xd1')]=[];_0x304bcb[_0x566f('0xd0')][_0x566f('0xd1')][_0x566f('0xa9')](_0x16d6d1['dataValues']);return _0x304bcb;});})['then'](respondWithResult(_0x45932f,null))[_0x566f('0x2c')](handleError(_0x45932f,null));};exports['status']=function(_0x43af67,_0x43959d,_0x2130aa){if(_0x43af67[_0x566f('0x5d')]['id']){delete _0x43af67[_0x566f('0x5d')]['id'];}var _0xdfbc25,_0x4ef7a3,_0x225084;return db[_0x566f('0x43')][_0x566f('0x5b')]({'where':{'id':_0x43af67[_0x566f('0x58')]['id']}})[_0x566f('0x22')](handleEntityNotFound(_0x43959d,null))['then'](function(_0x2d209b){if(_0x2d209b){_0x225084=_0x2d209b;logger[_0x566f('0x24')](_0x566f('0xb9'),_0x566f('0x2e'),'received\x20delivery\x20report\x20from',_0x2d209b[_0x566f('0x45')],util[_0x566f('0xd2')](_0x43af67[_0x566f('0x5d')],{'showHidden':![],'depth':null}));switch(_0x2d209b['type']){case'skebby':if(_0x43af67[_0x566f('0x5d')][_0x566f('0xd3')]&&_0x43af67['body'][_0x566f('0x2e')]){_0x4ef7a3=_0x43af67[_0x566f('0x5d')][_0x566f('0x2e')];return db[_0x566f('0xad')][_0x566f('0x5b')]({'where':{'messageId':_0x43af67[_0x566f('0x5d')][_0x566f('0xd3')]}});}break;case _0x566f('0x88'):if(_0x43af67[_0x566f('0x5d')][_0x566f('0xd4')]&&_0x43af67['body']['statusInt']){_0x4ef7a3=_0x43af67[_0x566f('0x5d')]['statusInt'];return db['SmsMessage'][_0x566f('0x5b')]({'where':{'messageId':_0x43af67[_0x566f('0x5d')][_0x566f('0xd4')]}});}break;case _0x566f('0x89'):if(_0x43af67[_0x566f('0x5d')][_0x566f('0x8a')]&&_0x43af67[_0x566f('0x5d')]['status_code']){_0x4ef7a3=_0x43af67[_0x566f('0x5d')]['status_code'];return db[_0x566f('0xad')]['find']({'where':{'messageId':_0x43af67[_0x566f('0x5d')][_0x566f('0x8a')]}});}break;case _0x566f('0x8f'):var _0x4301ca=_0x43af67[_0x566f('0x5d')][_0x566f('0x90')][0x0];if(_0x4301ca['messageId']&&_0x4301ca[_0x566f('0x2e')][_0x566f('0xd5')]==='DELIVERED'){_0x4ef7a3=_0x4301ca['status'][_0x566f('0xd5')];return db['SmsMessage']['find']({'where':{'messageId':_0x4301ca[_0x566f('0x84')]}});}break;case _0x566f('0xd6'):if(_0x43af67['body'][_0x566f('0x84')]&&_0x43af67[_0x566f('0x5d')]['status']){_0x4ef7a3=_0x43af67[_0x566f('0x5d')][_0x566f('0x2e')];return db[_0x566f('0xad')][_0x566f('0x5b')]({'where':{'messageId':_0x43af67[_0x566f('0x5d')][_0x566f('0x84')]}});}break;case'bandwidth':if(_0x43af67[_0x566f('0x5d')][0x0][_0x566f('0x29')]['id']){_0x4ef7a3=_0x43af67['body'][0x0][_0x566f('0x45')];return db[_0x566f('0xad')][_0x566f('0x5b')]({'where':{'messageId':_0x43af67[_0x566f('0x5d')][0x0][_0x566f('0x29')]['id']}});}break;case'intelepeer':if(_0x43af67[_0x566f('0x5d')][_0x566f('0xd7')]&&_0x43af67[_0x566f('0x5d')][_0x566f('0x2e')]){_0x4ef7a3=_0x43af67['body'][_0x566f('0x2e')];return db[_0x566f('0xad')]['find']({'where':{'messageId':_0x43af67[_0x566f('0x5d')][_0x566f('0xd7')]}});}break;}}})['then'](handleEntityNotFound(_0x43959d,null))[_0x566f('0x22')](function(_0x4975f7){if(_0x4975f7){_0xdfbc25=_0x4975f7;switch(_0x225084['type']){case _0x566f('0x85'):if(_0x4ef7a3==='DELIVERED'){return _0xdfbc25[_0x566f('0x37')]({'read':!![]});}else{logger[_0x566f('0x26')](_0x566f('0xb9'),_0x566f('0x2e'),_0x566f('0x85'),util['inspect'](_0x43af67['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x4ef7a3==='1'){return _0xdfbc25[_0x566f('0x37')]({'read':!![]});}else{logger[_0x566f('0x26')](_0x566f('0xb9'),_0x566f('0x2e'),'skebby',util['inspect'](_0x43af67[_0x566f('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x566f('0x89'):if(!_0x43af67[_0x566f('0x5d')]['error_code']&&_0x4ef7a3>=0xc8&&_0x4ef7a3<=0xce){return _0xdfbc25[_0x566f('0x37')]({'read':!![]});}else{logger['error'](_0x566f('0xb9'),_0x566f('0x2e'),_0x566f('0x89'),util['inspect'](_0x43af67['body'],{'showHidden':![],'depth':null}));}break;case _0x566f('0x8f'):var _0x120b9d=_0x43af67[_0x566f('0x5d')][_0x566f('0x90')][0x0];if(_0x120b9d[_0x566f('0x2e')][_0x566f('0xd5')]===_0x566f('0xd8')){return _0xdfbc25[_0x566f('0x37')]({'read':!![]});}else{logger[_0x566f('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x566f('0x2e'),_0x566f('0x8f'),util[_0x566f('0xd2')](_0x43af67[_0x566f('0x5d')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4ef7a3==_0x566f('0xd9')||_0x4ef7a3=='RECEIVED_BY_RECIPIENT'){return _0xdfbc25[_0x566f('0x37')]({'read':!![]});}else{logger[_0x566f('0x26')](_0x566f('0xb9'),_0x566f('0x2e'),_0x566f('0xd6'),util['inspect'](_0x43af67[_0x566f('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x566f('0x96'):if(_0x4ef7a3==_0x566f('0xda')){return _0xdfbc25['update']({'read':!![]});}else{logger[_0x566f('0x26')](_0x566f('0xb9'),_0x566f('0x2e'),_0x566f('0x96'),util['inspect'](_0x43af67[_0x566f('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x566f('0x97'):if(_0x4ef7a3==='DELIVRD'||_0x4ef7a3===_0x566f('0xdb')){return _0xdfbc25[_0x566f('0x37')]({'read':!![]});}else{logger[_0x566f('0x26')](_0x566f('0xb9'),_0x566f('0x2e'),_0x566f('0x97'),util[_0x566f('0xd2')](_0x43af67[_0x566f('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0xdfbc25;}})[_0x566f('0x22')](respondWithResult(_0x43959d,null))[_0x566f('0x2c')](handleError(_0x43959d,null));};exports[_0x566f('0xdc')]=function(_0x27c85a,_0x3b148c,_0x21ab75){var _0x6fca4a,_0x1bcd0e,_0x3f6864;return db[_0x566f('0x43')]['find']({'where':{'id':_0x27c85a[_0x566f('0x58')]['id']}})[_0x566f('0x22')](handleEntityNotFound(_0x3b148c,null))['then'](function(_0x52f90a){if(_0x52f90a){_0x3f6864=_0x52f90a;logger[_0x566f('0x24')](_0x566f('0xb9'),_0x566f('0x2e'),_0x566f('0xdd'),_0x52f90a[_0x566f('0x45')],util[_0x566f('0xd2')](_0x27c85a[_0x566f('0x47')],{'showHidden':![],'depth':null}));switch(_0x52f90a[_0x566f('0x45')]){case'csc':if(_0x27c85a['query'][_0x566f('0xde')]&&_0x27c85a[_0x566f('0x47')][_0x566f('0xdf')]){_0x1bcd0e=_0x27c85a[_0x566f('0x47')][_0x566f('0xdf')];return db[_0x566f('0xad')][_0x566f('0x5b')]({'where':{'messageId':_0x27c85a['query'][_0x566f('0xde')]}});}break;}}})['then'](handleEntityNotFound(_0x3b148c,null))[_0x566f('0x22')](function(_0x5707ef){if(_0x5707ef){_0x6fca4a=_0x5707ef;switch(_0x3f6864['type']){case'csc':if(_0x1bcd0e==='2'||_0x1bcd0e==='6'){return _0x6fca4a[_0x566f('0x37')]({'read':!![]});}else{logger[_0x566f('0x26')](_0x566f('0xb9'),'status',_0x566f('0x91'),util[_0x566f('0xd2')](_0x27c85a[_0x566f('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x6fca4a;}})[_0x566f('0x22')](respondWithResult(_0x3b148c,null))['catch'](handleError(_0x3b148c,null));};exports[_0x566f('0xe0')]=function(_0x24a70e,_0x1d4abd,_0x1527c0){return db[_0x566f('0x43')][_0x566f('0x5b')]({'where':{'id':_0x24a70e['params']['id']}})[_0x566f('0x22')](handleEntityNotFound(_0x1d4abd,null))[_0x566f('0x22')](function(_0x189320){if(_0x189320){return _0x189320['addAgents'](_0x24a70e[_0x566f('0x5d')]['ids'],_[_0x566f('0xa1')](_0x24a70e[_0x566f('0x5d')],[_0x566f('0x6d'),'id'])||{})[_0x566f('0xa4')](function(_0x4de52c){for(var _0x10cf50=0x0;_0x10cf50<_0x24a70e['body'][_0x566f('0x6d')][_0x566f('0x4b')];_0x10cf50+=0x1){socket[_0x566f('0xe1')]('userSmsAccount:save',{'UserId':Number(_0x24a70e['body'][_0x566f('0x6d')][_0x10cf50]),'SmsAccountId':Number(_0x24a70e[_0x566f('0x58')]['id'])});}return _0x4de52c;});}})[_0x566f('0x22')](respondWithResult(_0x1d4abd,null))[_0x566f('0x2c')](handleError(_0x1d4abd,null));};exports[_0x566f('0xe2')]=function(_0x3d3a55,_0x5a9d1b,_0x4ace92){return db[_0x566f('0x43')][_0x566f('0x5b')]({'where':{'id':_0x3d3a55[_0x566f('0x58')]['id']}})[_0x566f('0x22')](handleEntityNotFound(_0x5a9d1b,null))[_0x566f('0x22')](function(_0x573f50){if(_0x573f50){return _0x573f50['removeAgents'](_0x3d3a55[_0x566f('0x47')]['ids'])[_0x566f('0x22')](function(){if(_['isArray'](_0x3d3a55[_0x566f('0x47')][_0x566f('0x6d')])){for(var _0x331fd1=0x0;_0x331fd1<_0x3d3a55[_0x566f('0x47')]['ids'][_0x566f('0x4b')];_0x331fd1+=0x1){socket[_0x566f('0xe1')](_0x566f('0xe3'),{'UserId':Number(_0x3d3a55['query'][_0x566f('0x6d')][_0x331fd1]),'SmsAccountId':Number(_0x3d3a55[_0x566f('0x58')]['id'])});}}else{socket[_0x566f('0xe1')](_0x566f('0xe3'),{'UserId':Number(_0x3d3a55['query']['ids']),'SmsAccountId':Number(_0x3d3a55[_0x566f('0x58')]['id'])});}});}})[_0x566f('0x22')](respondWithStatusCode(_0x5a9d1b,null))[_0x566f('0x2c')](handleError(_0x5a9d1b,null));};exports[_0x566f('0xe4')]=function(_0x361e47,_0x22a32c,_0x1c45a2){var _0x33b2fd={};var _0x44522f={};var _0x28c9db;var _0x4560be;return db[_0x566f('0x43')]['findOne']({'where':{'id':_0x361e47[_0x566f('0x58')]['id']}})[_0x566f('0x22')](handleEntityNotFound(_0x22a32c,null))[_0x566f('0x22')](function(_0x44e085){if(_0x44e085){_0x28c9db=_0x44e085;_0x44522f[_0x566f('0x46')]=_[_0x566f('0x59')](db['User'][_0x566f('0x44')]);_0x44522f['query']=_[_0x566f('0x59')](_0x361e47[_0x566f('0x47')]);_0x44522f[_0x566f('0x4d')]=_['intersection'](_0x44522f[_0x566f('0x46')],_0x44522f['query']);_0x33b2fd[_0x566f('0x49')]=_[_0x566f('0x48')](_0x44522f[_0x566f('0x46')],qs['fields'](_0x361e47[_0x566f('0x47')]['fields']));_0x33b2fd[_0x566f('0x49')]=_0x33b2fd[_0x566f('0x49')][_0x566f('0x4b')]?_0x33b2fd[_0x566f('0x49')]:_0x44522f['model'];_0x33b2fd[_0x566f('0x70')]=qs[_0x566f('0x6b')](_0x361e47[_0x566f('0x47')]['sort']);_0x33b2fd[_0x566f('0x50')]=qs[_0x566f('0x4d')](_[_0x566f('0x4e')](_0x361e47['query'],_0x44522f[_0x566f('0x4d')]));if(_0x361e47[_0x566f('0x47')][_0x566f('0x4f')]){_0x33b2fd[_0x566f('0x50')]=_[_0x566f('0x51')](_0x33b2fd[_0x566f('0x50')],{'$or':_[_0x566f('0x42')](_0x33b2fd[_0x566f('0x49')],function(_0x304680){var _0x4b73fe={};_0x4b73fe[_0x304680]={'$like':'%'+_0x361e47[_0x566f('0x47')][_0x566f('0x4f')]+'%'};return _0x4b73fe;})});}_0x33b2fd=_[_0x566f('0x51')]({},_0x33b2fd,_0x361e47[_0x566f('0x53')]);return _0x28c9db[_0x566f('0xe4')](_0x33b2fd);}})[_0x566f('0x22')](function(_0x4897fe){if(_0x4897fe){_0x4560be=_0x4897fe[_0x566f('0x4b')];if(!_0x361e47['query'][_0x566f('0x6a')](_0x566f('0x4c'))){_0x33b2fd[_0x566f('0x32')]=qs['limit'](_0x361e47['query'][_0x566f('0x32')]);_0x33b2fd[_0x566f('0x30')]=qs[_0x566f('0x30')](_0x361e47[_0x566f('0x47')][_0x566f('0x30')]);}return _0x28c9db[_0x566f('0xe4')](_0x33b2fd);}})[_0x566f('0x22')](function(_0x4d3399){if(_0x4d3399){return _0x4d3399?{'count':_0x4560be,'rows':_0x4d3399}:null;}})[_0x566f('0x22')](respondWithResult(_0x22a32c,null))['catch'](handleError(_0x22a32c,null));}; \ No newline at end of file +var _0x2eb5=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','get','SmsAccounts','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','SmsAccount','includeAll','include','findAll','rows','show','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','SmsAccountId','Disposition','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','SmsApplication','Applications','account','applications','priority','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','type','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','Text','results','csc','segmentedMessage','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','omit','defaults','contact','SmsInteraction','interaction','autoclose','close','*,*,*,*','created','SmsMessage','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','stringify','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','DESC','out','spread','dataValues','Messages','push','skebby_dispatch_id','requestid','clicksend','message_id','status_code','infobip','groupName','DELIVERED','redif','error_code','inspect','DELIVERED_TO_GATEWAY','clickatell','DELIVRD','ACCEPTD','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x404370,_0x51a1cc){var _0x47ce6c=function(_0x108a03){while(--_0x108a03){_0x404370['push'](_0x404370['shift']());}};_0x47ce6c(++_0x51a1cc);}(_0x2eb5,0x1c3));var _0x52eb=function(_0x291e86,_0x492bfd){_0x291e86=_0x291e86-0x0;var _0x5553da=_0x2eb5[_0x291e86];return _0x5553da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x52eb('0x0'));var zipdir=require(_0x52eb('0x1'));var jsonpatch=require(_0x52eb('0x2'));var rp=require(_0x52eb('0x3'));var moment=require(_0x52eb('0x4'));var BPromise=require(_0x52eb('0x5'));var Mustache=require(_0x52eb('0x6'));var util=require(_0x52eb('0x7'));var path=require(_0x52eb('0x8'));var sox=require(_0x52eb('0x9'));var csv=require(_0x52eb('0xa'));var ejs=require(_0x52eb('0xb'));var fs=require('fs');var fs_extra=require(_0x52eb('0xc'));var _=require(_0x52eb('0xd'));var squel=require(_0x52eb('0xe'));var crypto=require('crypto');var jsforce=require(_0x52eb('0xf'));var deskjs=require(_0x52eb('0x10'));var toCsv=require(_0x52eb('0xa'));var querystring=require(_0x52eb('0x11'));var Papa=require(_0x52eb('0x12'));var Redis=require(_0x52eb('0x13'));var authService=require(_0x52eb('0x14'));var qs=require(_0x52eb('0x15'));var as=require(_0x52eb('0x16'));var hardwareService=require(_0x52eb('0x17'));var logger=require(_0x52eb('0x18'))(_0x52eb('0x19'));var utils=require(_0x52eb('0x1a'));var config=require(_0x52eb('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x52eb('0x1c')]=_['defaults'](config[_0x52eb('0x1c')],{'host':_0x52eb('0x1d'),'port':0x18eb});var socket=require(_0x52eb('0x1e'))(new Redis(config['redis']));require(_0x52eb('0x1f'))[_0x52eb('0x20')](socket);var jayson=require(_0x52eb('0x21'));var client=jayson[_0x52eb('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x471b20,_0x1397e4,_0x2e7fe5,_0xae651c){return new BPromise(function(_0x2c89b4,_0x19cd76){var _0x3a8a44=_0xae651c||client;return _0x3a8a44[_0x52eb('0x23')](_0x471b20,_0x2e7fe5)[_0x52eb('0x24')](function(_0x3aa7a5){logger[_0x52eb('0x25')]('SmsAccount,\x20%s,\x20%s',_0x1397e4,_0x52eb('0x26'));logger[_0x52eb('0x27')](_0x52eb('0x28'),_0x1397e4,_0x52eb('0x26'),JSON['stringify'](_0x3aa7a5));if(_0x3aa7a5[_0x52eb('0x29')]){if(_0x3aa7a5[_0x52eb('0x29')]['code']===0x1f4){logger['error'](_0x52eb('0x2a'),_0x1397e4,_0x3aa7a5[_0x52eb('0x29')][_0x52eb('0x2b')]);return _0x19cd76(_0x3aa7a5[_0x52eb('0x29')][_0x52eb('0x2b')]);}logger[_0x52eb('0x29')]('SmsAccount,\x20%s,\x20%s',_0x1397e4,_0x3aa7a5['error'][_0x52eb('0x2b')]);return _0x2c89b4(_0x3aa7a5[_0x52eb('0x29')][_0x52eb('0x2b')]);}else{logger[_0x52eb('0x25')](_0x52eb('0x2a'),_0x1397e4,'request\x20sent');_0x2c89b4(_0x3aa7a5[_0x52eb('0x2c')]['message']);}})[_0x52eb('0x2d')](function(_0x2c8b10){logger[_0x52eb('0x29')](_0x52eb('0x2a'),_0x1397e4,_0x2c8b10);_0x19cd76(_0x2c8b10);});});}function respondWithStatusCode(_0x53bea8,_0xa4a38){_0xa4a38=_0xa4a38||0xcc;return function(_0x566848){if(_0x566848){return _0x53bea8[_0x52eb('0x2e')](_0xa4a38);}return _0x53bea8['status'](_0xa4a38)['end']();};}function respondWithResult(_0x711ac7,_0x3fa5a3){_0x3fa5a3=_0x3fa5a3||0xc8;return function(_0x5bcc59){if(_0x5bcc59){return _0x711ac7[_0x52eb('0x2f')](_0x3fa5a3)[_0x52eb('0x30')](_0x5bcc59);}};}function respondWithFilteredResult(_0x12d2dc,_0x5dbcd1){return function(_0x576e2a){if(_0x576e2a){var _0x2965e8=typeof _0x5dbcd1['offset']===_0x52eb('0x31')&&typeof _0x5dbcd1[_0x52eb('0x32')]===_0x52eb('0x31');var _0x53bf4c=_0x576e2a[_0x52eb('0x33')];var _0x82b21c=_0x2965e8?0x0:_0x5dbcd1[_0x52eb('0x34')];var _0x1f41e5=_0x2965e8?_0x576e2a[_0x52eb('0x33')]:_0x5dbcd1[_0x52eb('0x34')]+_0x5dbcd1[_0x52eb('0x32')];var _0x25e799;if(_0x1f41e5>=_0x53bf4c){_0x1f41e5=_0x53bf4c;_0x25e799=0xc8;}else{_0x25e799=0xce;}_0x12d2dc['status'](_0x25e799);return _0x12d2dc[_0x52eb('0x35')](_0x52eb('0x36'),_0x82b21c+'-'+_0x1f41e5+'/'+_0x53bf4c)[_0x52eb('0x30')](_0x576e2a);}return null;};}function patchUpdates(_0x9a4e35){return function(_0x1c6c9d){try{jsonpatch[_0x52eb('0x37')](_0x1c6c9d,_0x9a4e35,!![]);}catch(_0x767948){return BPromise[_0x52eb('0x38')](_0x767948);}return _0x1c6c9d['save']();};}function saveUpdates(_0x39c79d,_0x4d8561){return function(_0x58d638){if(_0x58d638){return _0x58d638['update'](_0x39c79d)[_0x52eb('0x24')](function(_0x16dc5e){return _0x16dc5e;});}return null;};}function removeEntity(_0x28e0c3,_0x420169){return function(_0xc05012){if(_0xc05012){return _0xc05012[_0x52eb('0x39')]()[_0x52eb('0x24')](function(){var _0x5a73d1=_0xc05012[_0x52eb('0x3a')]({'plain':!![]});var _0x3dfe4f=_0x52eb('0x3b');return db['UserProfileResource']['destroy']({'where':{'type':_0x3dfe4f,'resourceId':_0x5a73d1['id']}})[_0x52eb('0x24')](function(){return _0xc05012;});})['then'](function(){_0x28e0c3[_0x52eb('0x2f')](0xcc)[_0x52eb('0x3c')]();});}};}function handleEntityNotFound(_0x28c7f0,_0x6f6b05){return function(_0x1ce80a){if(!_0x1ce80a){_0x28c7f0[_0x52eb('0x2e')](0x194);}return _0x1ce80a;};}function handleError(_0x491e24,_0x2ba9b2){_0x2ba9b2=_0x2ba9b2||0x1f4;return function(_0xb0bfce){logger['error'](_0xb0bfce[_0x52eb('0x3d')]);if(_0xb0bfce['name']){delete _0xb0bfce[_0x52eb('0x3e')];}_0x491e24[_0x52eb('0x2f')](_0x2ba9b2)[_0x52eb('0x3f')](_0xb0bfce);};}exports[_0x52eb('0x40')]=function(_0x3478fc,_0x43c3ef){var _0x4dd385={'include':[{'model':db[_0x52eb('0x41')],'as':_0x52eb('0x42')}]},_0x347b18={},_0x9a5491={'count':0x0,'rows':[]};var _0x25cbca=_[_0x52eb('0x43')](db['SmsAccount']['rawAttributes'],function(_0x4f799a){return{'name':_0x4f799a[_0x52eb('0x44')],'type':_0x4f799a['type']['key']};});_0x347b18['model']=_[_0x52eb('0x43')](_0x25cbca,_0x52eb('0x3e'));_0x347b18[_0x52eb('0x45')]=_[_0x52eb('0x46')](_0x3478fc['query']);_0x347b18[_0x52eb('0x47')]=_[_0x52eb('0x48')](_0x347b18[_0x52eb('0x49')],_0x347b18[_0x52eb('0x45')]);_0x4dd385[_0x52eb('0x4a')]=_[_0x52eb('0x48')](_0x347b18[_0x52eb('0x49')],qs[_0x52eb('0x4b')](_0x3478fc[_0x52eb('0x45')][_0x52eb('0x4b')]));_0x4dd385[_0x52eb('0x4a')]=_0x4dd385[_0x52eb('0x4a')][_0x52eb('0x4c')]?_0x4dd385[_0x52eb('0x4a')]:_0x347b18[_0x52eb('0x49')];if(!_0x3478fc[_0x52eb('0x45')]['hasOwnProperty'](_0x52eb('0x4d'))){_0x4dd385[_0x52eb('0x32')]=qs[_0x52eb('0x32')](_0x3478fc['query'][_0x52eb('0x32')]);_0x4dd385[_0x52eb('0x34')]=qs[_0x52eb('0x34')](_0x3478fc['query'][_0x52eb('0x34')]);}_0x4dd385[_0x52eb('0x4e')]=qs[_0x52eb('0x4f')](_0x3478fc[_0x52eb('0x45')][_0x52eb('0x4f')]);_0x4dd385[_0x52eb('0x50')]=qs['filters'](_[_0x52eb('0x51')](_0x3478fc[_0x52eb('0x45')],_0x347b18[_0x52eb('0x47')]),_0x25cbca);if(_0x3478fc[_0x52eb('0x45')]['filter']){_0x4dd385[_0x52eb('0x50')]=_[_0x52eb('0x52')](_0x4dd385[_0x52eb('0x50')],{'$or':_['map'](_0x25cbca,function(_0x37eec6){if(_0x37eec6['type']!=='VIRTUAL'){var _0x5c2f8d={};_0x5c2f8d[_0x37eec6[_0x52eb('0x3e')]]={'$like':'%'+_0x3478fc['query'][_0x52eb('0x53')]+'%'};return _0x5c2f8d;}})});}_0x4dd385=_[_0x52eb('0x52')]({},_0x4dd385,_0x3478fc[_0x52eb('0x54')]);var _0x112ab5={'where':_0x4dd385[_0x52eb('0x50')]};return db[_0x52eb('0x55')][_0x52eb('0x33')](_0x112ab5)[_0x52eb('0x24')](function(_0xdd8ff8){_0x9a5491[_0x52eb('0x33')]=_0xdd8ff8;if(_0x3478fc[_0x52eb('0x45')][_0x52eb('0x56')]){_0x4dd385[_0x52eb('0x57')]=[{'all':!![]}];}return db[_0x52eb('0x55')][_0x52eb('0x58')](_0x4dd385);})[_0x52eb('0x24')](function(_0x29104b){_0x9a5491[_0x52eb('0x59')]=_0x29104b;return _0x9a5491;})[_0x52eb('0x24')](respondWithFilteredResult(_0x43c3ef,_0x4dd385))[_0x52eb('0x2d')](handleError(_0x43c3ef,null));};exports[_0x52eb('0x5a')]=function(_0x477843,_0x48ee1b){var _0xc5b9ce={'raw':![],'where':{'id':_0x477843['params']['id']},'include':[{'model':db[_0x52eb('0x41')],'as':_0x52eb('0x42')}]},_0x2dd84c={};_0x2dd84c[_0x52eb('0x49')]=_[_0x52eb('0x46')](db[_0x52eb('0x55')][_0x52eb('0x5b')]);_0x2dd84c['query']=_[_0x52eb('0x46')](_0x477843[_0x52eb('0x45')]);_0x2dd84c[_0x52eb('0x47')]=_[_0x52eb('0x48')](_0x2dd84c[_0x52eb('0x49')],_0x2dd84c['query']);_0xc5b9ce[_0x52eb('0x4a')]=_['intersection'](_0x2dd84c[_0x52eb('0x49')],qs[_0x52eb('0x4b')](_0x477843[_0x52eb('0x45')]['fields']));_0xc5b9ce[_0x52eb('0x4a')]=_0xc5b9ce[_0x52eb('0x4a')][_0x52eb('0x4c')]?_0xc5b9ce['attributes']:_0x2dd84c[_0x52eb('0x49')];if(_0x477843[_0x52eb('0x45')]['includeAll']){_0xc5b9ce[_0x52eb('0x57')]=[{'all':!![]}];}_0xc5b9ce=_[_0x52eb('0x52')]({},_0xc5b9ce,_0x477843['options']);return db[_0x52eb('0x55')][_0x52eb('0x5c')](_0xc5b9ce)[_0x52eb('0x24')](handleEntityNotFound(_0x48ee1b,null))[_0x52eb('0x24')](respondWithResult(_0x48ee1b,null))['catch'](handleError(_0x48ee1b,null));};exports['create']=function(_0x56fce9,_0x4dced1){return db['SmsAccount']['create'](_0x56fce9[_0x52eb('0x5d')],{})[_0x52eb('0x24')](function(_0x2f5907){var _0x4294a3=_0x56fce9[_0x52eb('0x5e')]['get']({'plain':!![]});if(!_0x4294a3)throw new Error(_0x52eb('0x5f'));if(_0x4294a3[_0x52eb('0x60')]===_0x52eb('0x5e')){var _0x3f2f68=_0x2f5907[_0x52eb('0x3a')]({'plain':!![]});var _0x45cb6c=_0x52eb('0x3b');return db['UserProfileSection'][_0x52eb('0x5c')]({'where':{'name':_0x45cb6c,'userProfileId':_0x4294a3['userProfileId']},'raw':!![]})['then'](function(_0x4ff030){if(_0x4ff030&&_0x4ff030['autoAssociation']===0x0){return db['UserProfileResource'][_0x52eb('0x61')]({'name':_0x3f2f68['name'],'resourceId':_0x3f2f68['id'],'type':_0x4ff030[_0x52eb('0x3e')],'sectionId':_0x4ff030['id']},{})[_0x52eb('0x24')](function(){return _0x2f5907;});}else{return _0x2f5907;}})[_0x52eb('0x2d')](function(_0xc4f010){logger[_0x52eb('0x29')](_0x52eb('0x62'),_0xc4f010);throw _0xc4f010;});}return _0x2f5907;})['then'](respondWithResult(_0x4dced1,0xc9))[_0x52eb('0x2d')](handleError(_0x4dced1,null));};exports[_0x52eb('0x63')]=function(_0x4266fc,_0x26d1c4){if(_0x4266fc[_0x52eb('0x5d')]['id']){delete _0x4266fc[_0x52eb('0x5d')]['id'];}return db[_0x52eb('0x55')][_0x52eb('0x5c')]({'where':{'id':_0x4266fc[_0x52eb('0x64')]['id']},'include':[{'model':db[_0x52eb('0x41')],'as':_0x52eb('0x42')}]})['then'](handleEntityNotFound(_0x26d1c4,null))['then'](saveUpdates(_0x4266fc[_0x52eb('0x5d')],null))[_0x52eb('0x24')](respondWithResult(_0x26d1c4,null))[_0x52eb('0x2d')](handleError(_0x26d1c4,null));};exports[_0x52eb('0x39')]=function(_0x529c0e,_0x2cafc2){return db[_0x52eb('0x55')]['find']({'where':{'id':_0x529c0e[_0x52eb('0x64')]['id']}})[_0x52eb('0x24')](handleEntityNotFound(_0x2cafc2,null))[_0x52eb('0x24')](removeEntity(_0x2cafc2,null))['catch'](handleError(_0x2cafc2,null));};exports[_0x52eb('0x65')]=function(_0xe47d8a,_0x1ae064){return db[_0x52eb('0x55')][_0x52eb('0x65')]()[_0x52eb('0x24')](respondWithResult(_0x1ae064,null))[_0x52eb('0x2d')](handleError(_0x1ae064,null));};exports[_0x52eb('0x66')]=function(_0x293d37,_0x521b2b,_0x25d526){if(_0x293d37[_0x52eb('0x5d')]['id']){delete _0x293d37[_0x52eb('0x5d')]['id'];}return db[_0x52eb('0x55')][_0x52eb('0x5c')]({'where':{'id':_0x293d37[_0x52eb('0x64')]['id']}})[_0x52eb('0x24')](handleEntityNotFound(_0x521b2b,null))[_0x52eb('0x24')](function(_0x4c8c55){if(_0x4c8c55){_0x293d37[_0x52eb('0x5d')][_0x52eb('0x67')]=_0x4c8c55['id'];return db[_0x52eb('0x68')][_0x52eb('0x61')](_0x293d37[_0x52eb('0x5d')]);}})['then'](respondWithResult(_0x521b2b,null))[_0x52eb('0x2d')](handleError(_0x521b2b,null));};exports['getDispositions']=function(_0x3497be,_0x41cb40,_0xdafa17){var _0xc7be9c={'raw':![],'where':{}};var _0x51ff8b={};var _0x3980ba={'count':0x0,'rows':[]};return db[_0x52eb('0x55')][_0x52eb('0x69')]({'where':{'id':_0x3497be[_0x52eb('0x64')]['id']}})[_0x52eb('0x24')](handleEntityNotFound(_0x41cb40,null))[_0x52eb('0x24')](function(_0x57b5cc){if(_0x57b5cc){_0x51ff8b[_0x52eb('0x49')]=_[_0x52eb('0x46')](db[_0x52eb('0x68')][_0x52eb('0x5b')]);_0x51ff8b[_0x52eb('0x45')]=_[_0x52eb('0x46')](_0x3497be[_0x52eb('0x45')]);_0x51ff8b[_0x52eb('0x47')]=_[_0x52eb('0x48')](_0x51ff8b[_0x52eb('0x49')],_0x51ff8b['query']);_0xc7be9c[_0x52eb('0x4a')]=_[_0x52eb('0x48')](_0x51ff8b['model'],qs[_0x52eb('0x4b')](_0x3497be[_0x52eb('0x45')]['fields']));_0xc7be9c[_0x52eb('0x4a')]=_0xc7be9c[_0x52eb('0x4a')][_0x52eb('0x4c')]?_0xc7be9c[_0x52eb('0x4a')]:_0x51ff8b[_0x52eb('0x49')];if(!_0x3497be[_0x52eb('0x45')][_0x52eb('0x6a')]('nolimit')){_0xc7be9c[_0x52eb('0x32')]=qs[_0x52eb('0x32')](_0x3497be[_0x52eb('0x45')][_0x52eb('0x32')]);_0xc7be9c[_0x52eb('0x34')]=qs[_0x52eb('0x34')](_0x3497be[_0x52eb('0x45')]['offset']);}_0xc7be9c['order']=qs[_0x52eb('0x4f')](_0x3497be[_0x52eb('0x45')]['sort']);_0xc7be9c['where']=qs[_0x52eb('0x47')](_['pick'](_0x3497be[_0x52eb('0x45')],_0x51ff8b[_0x52eb('0x47')]));_0xc7be9c[_0x52eb('0x50')]['SmsAccountId']=_0x57b5cc['id'];if(_0x3497be[_0x52eb('0x45')][_0x52eb('0x53')]){_0xc7be9c[_0x52eb('0x50')]=_[_0x52eb('0x52')](_0xc7be9c['where'],{'$or':_[_0x52eb('0x43')](_0xc7be9c[_0x52eb('0x4a')],function(_0x3b81a3){var _0x284ba9={};_0x284ba9[_0x3b81a3]={'$like':'%'+_0x3497be['query'][_0x52eb('0x53')]+'%'};return _0x284ba9;})});}_0xc7be9c=_[_0x52eb('0x52')]({},_0xc7be9c,_0x3497be[_0x52eb('0x54')]);return db[_0x52eb('0x68')]['count']({'where':_0xc7be9c[_0x52eb('0x50')]})[_0x52eb('0x24')](function(_0x5a2644){_0x3980ba[_0x52eb('0x33')]=_0x5a2644;if(_0x3497be[_0x52eb('0x45')][_0x52eb('0x56')]){_0xc7be9c[_0x52eb('0x57')]=[{'all':!![]}];}return db[_0x52eb('0x68')][_0x52eb('0x58')](_0xc7be9c);})[_0x52eb('0x24')](function(_0x48ee85){_0x3980ba[_0x52eb('0x59')]=_0x48ee85;return _0x3980ba;});}})[_0x52eb('0x24')](respondWithFilteredResult(_0x41cb40,_0xc7be9c))[_0x52eb('0x2d')](handleError(_0x41cb40,null));};exports['removeDispositions']=function(_0x40e3ab,_0x2972a1,_0x49c0cd){return db[_0x52eb('0x55')]['find']({'where':{'id':_0x40e3ab['params']['id']}})[_0x52eb('0x24')](handleEntityNotFound(_0x2972a1,null))[_0x52eb('0x24')](function(_0x3b2fb1){if(_0x3b2fb1){return _0x3b2fb1[_0x52eb('0x6b')](_0x40e3ab[_0x52eb('0x45')][_0x52eb('0x6c')]);}})['then'](respondWithStatusCode(_0x2972a1,null))[_0x52eb('0x2d')](handleError(_0x2972a1,null));};exports[_0x52eb('0x6d')]=function(_0x4c629b,_0x128f64,_0x5672ad){if(_0x4c629b[_0x52eb('0x5d')]['id']){delete _0x4c629b[_0x52eb('0x5d')]['id'];}return db[_0x52eb('0x55')][_0x52eb('0x5c')]({'where':{'id':_0x4c629b[_0x52eb('0x64')]['id']}})[_0x52eb('0x24')](handleEntityNotFound(_0x128f64,null))[_0x52eb('0x24')](function(_0x333c92){if(_0x333c92){_0x4c629b['body']['SmsAccountId']=_0x333c92['id'];return db[_0x52eb('0x6e')]['create'](_0x4c629b['body']);}})['then'](respondWithResult(_0x128f64,null))['catch'](handleError(_0x128f64,null));};exports[_0x52eb('0x6f')]=function(_0x2f35a7,_0x51a675,_0x3da04c){var _0x256974={'raw':![],'where':{}};var _0x2eb0ca={};var _0x869571={'count':0x0,'rows':[]};return db[_0x52eb('0x55')][_0x52eb('0x69')]({'where':{'id':_0x2f35a7[_0x52eb('0x64')]['id']}})['then'](handleEntityNotFound(_0x51a675,null))[_0x52eb('0x24')](function(_0x50dde7){if(_0x50dde7){_0x2eb0ca[_0x52eb('0x49')]=_[_0x52eb('0x46')](db[_0x52eb('0x6e')][_0x52eb('0x5b')]);_0x2eb0ca[_0x52eb('0x45')]=_['keys'](_0x2f35a7['query']);_0x2eb0ca[_0x52eb('0x47')]=_[_0x52eb('0x48')](_0x2eb0ca[_0x52eb('0x49')],_0x2eb0ca[_0x52eb('0x45')]);_0x256974[_0x52eb('0x4a')]=_[_0x52eb('0x48')](_0x2eb0ca[_0x52eb('0x49')],qs[_0x52eb('0x4b')](_0x2f35a7[_0x52eb('0x45')]['fields']));_0x256974[_0x52eb('0x4a')]=_0x256974[_0x52eb('0x4a')][_0x52eb('0x4c')]?_0x256974[_0x52eb('0x4a')]:_0x2eb0ca[_0x52eb('0x49')];if(!_0x2f35a7[_0x52eb('0x45')][_0x52eb('0x6a')]('nolimit')){_0x256974[_0x52eb('0x32')]=qs[_0x52eb('0x32')](_0x2f35a7[_0x52eb('0x45')][_0x52eb('0x32')]);_0x256974[_0x52eb('0x34')]=qs[_0x52eb('0x34')](_0x2f35a7[_0x52eb('0x45')][_0x52eb('0x34')]);}_0x256974[_0x52eb('0x4e')]=qs[_0x52eb('0x4f')](_0x2f35a7[_0x52eb('0x45')]['sort']);_0x256974[_0x52eb('0x50')]=qs[_0x52eb('0x47')](_['pick'](_0x2f35a7['query'],_0x2eb0ca[_0x52eb('0x47')]));_0x256974['where']['SmsAccountId']=_0x50dde7['id'];if(_0x2f35a7['query'][_0x52eb('0x53')]){_0x256974[_0x52eb('0x50')]=_[_0x52eb('0x52')](_0x256974['where'],{'$or':_[_0x52eb('0x43')](_0x256974[_0x52eb('0x4a')],function(_0x5d3950){var _0x3cea7b={};_0x3cea7b[_0x5d3950]={'$like':'%'+_0x2f35a7['query'][_0x52eb('0x53')]+'%'};return _0x3cea7b;})});}_0x256974=_['merge']({},_0x256974,_0x2f35a7[_0x52eb('0x54')]);return db['CannedAnswer'][_0x52eb('0x33')]({'where':_0x256974['where']})['then'](function(_0xee72f0){_0x869571[_0x52eb('0x33')]=_0xee72f0;if(_0x2f35a7[_0x52eb('0x45')][_0x52eb('0x56')]){_0x256974[_0x52eb('0x57')]=[{'all':!![]}];}return db[_0x52eb('0x6e')][_0x52eb('0x58')](_0x256974);})[_0x52eb('0x24')](function(_0x225c34){_0x869571['rows']=_0x225c34;return _0x869571;});}})[_0x52eb('0x24')](respondWithFilteredResult(_0x51a675,_0x256974))[_0x52eb('0x2d')](handleError(_0x51a675,null));};exports[_0x52eb('0x70')]=function(_0x5e62ca,_0x1bbcee,_0x1617cb){return db[_0x52eb('0x55')][_0x52eb('0x5c')]({'where':{'id':_0x5e62ca[_0x52eb('0x64')]['id']}})['then'](handleEntityNotFound(_0x1bbcee,null))[_0x52eb('0x24')](function(_0x557eb4){if(_0x557eb4){return _0x557eb4[_0x52eb('0x70')](_0x5e62ca['query'][_0x52eb('0x6c')]);}})[_0x52eb('0x24')](respondWithStatusCode(_0x1bbcee,null))[_0x52eb('0x2d')](handleError(_0x1bbcee,null));};exports[_0x52eb('0x71')]=function(_0x2528b6,_0x3afec2,_0x56bc31){var _0x3f3883={'channel':'sms'};var _0xd1517f=[];var _0x3e170a=[];var _0x585ec8={};return db['SmsAccount'][_0x52eb('0x5c')]({'where':{'id':_0x2528b6[_0x52eb('0x64')]['id']},'include':[{'model':db[_0x52eb('0x72')],'as':_0x52eb('0x73')}]})['then'](handleEntityNotFound(_0x3afec2,null))[_0x52eb('0x24')](function(_0x25f2a6){_0x3f3883[_0x52eb('0x74')]=_0x25f2a6;_0x3f3883[_0x52eb('0x75')]=_['orderBy'](_0x25f2a6['Applications'],[_0x52eb('0x76')],[_0x52eb('0x77')]);if(_0x3f3883['account'][_0x52eb('0x73')]){delete _0x3f3883['account'][_0x52eb('0x73')];}return db[_0x52eb('0x78')][_0x52eb('0x65')]();})[_0x52eb('0x24')](function(_0x211f93){if(!_0x211f93){throw new db[(_0x52eb('0x79'))][(_0x52eb('0x7a'))]('no\x20available\x20attributes');}_0xd1517f=_[_0x52eb('0x7b')](_[_0x52eb('0x46')](_0x211f93),[_0x52eb('0x7c'),_0x52eb('0x7d')]);_0x3e170a=_[_0x52eb('0x7b')](_[_0x52eb('0x46')](_0x211f93),[_0x52eb('0x7c'),_0x52eb('0x7d'),_0x52eb('0x7e'),_0x52eb('0x7f')]);_0x3f3883[_0x52eb('0x5d')]={'mapKey':_0x52eb('0x80')};if(_0x3f3883[_0x52eb('0x74')][_0x52eb('0x81')]){switch(_0x3f3883['account'][_0x52eb('0x81')]){case _0x52eb('0x82'):_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x83')]=_0x2528b6[_0x52eb('0x5d')][_0x52eb('0x84')];_0x3f3883['body'][_0x52eb('0x5d')]=_0x2528b6[_0x52eb('0x5d')][_0x52eb('0x85')];_0x3f3883['body'][_0x52eb('0x86')]=_0x2528b6[_0x52eb('0x5d')][_0x52eb('0x87')];break;case _0x52eb('0x88'):_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x83')]='+'+_0x2528b6[_0x52eb('0x5d')][_0x52eb('0x89')];_0x3f3883['body'][_0x52eb('0x5d')]=_0x2528b6[_0x52eb('0x5d')][_0x52eb('0x8a')];break;case _0x52eb('0x8b'):_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x83')]=_0x2528b6[_0x52eb('0x5d')]['from'];_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x5d')]=_0x2528b6[_0x52eb('0x5d')][_0x52eb('0x2b')];break;case'clicksend':_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x83')]=_0x2528b6[_0x52eb('0x5d')][_0x52eb('0x83')];_0x3f3883['body'][_0x52eb('0x5d')]=_0x2528b6[_0x52eb('0x5d')][_0x52eb('0x5d')];_0x3f3883['body']['messageId']=_0x2528b6['body']['message_id'];break;case'plivo':_0x3f3883['body'][_0x52eb('0x83')]=_0x2528b6['body'][_0x52eb('0x84')];_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x5d')]=_0x2528b6[_0x52eb('0x5d')][_0x52eb('0x8c')];_0x3f3883[_0x52eb('0x5d')]['messageId']=_0x2528b6[_0x52eb('0x5d')]['MessageUUID'];break;case'infobip':_0x3f3883['body'][_0x52eb('0x83')]='+'+_0x2528b6[_0x52eb('0x5d')][_0x52eb('0x8d')][0x0][_0x52eb('0x83')];_0x3f3883['body']['body']=_0x2528b6[_0x52eb('0x5d')][_0x52eb('0x8d')][0x0]['text'];_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x86')]=_0x2528b6['body'][_0x52eb('0x8d')][0x0][_0x52eb('0x86')];break;case _0x52eb('0x8e'):_0x3f3883['body'][_0x52eb('0x83')]=_0x2528b6[_0x52eb('0x5d')]['originatingAddress'];_0x3f3883['body'][_0x52eb('0x5d')]=_0x2528b6[_0x52eb('0x5d')][_0x52eb('0x8f')]['message'];break;case'clickatell':_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x83')]=_0x2528b6['body']['fromNumber'];_0x3f3883[_0x52eb('0x5d')]['body']=_0x2528b6[_0x52eb('0x5d')]['text'];_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x86')]=_0x2528b6[_0x52eb('0x5d')][_0x52eb('0x90')];break;case _0x52eb('0x91'):_0x3f3883['body'][_0x52eb('0x86')]=_0x2528b6[_0x52eb('0x5d')][0x0][_0x52eb('0x2b')]['id'];_0x3f3883['body']['from']=_0x2528b6['body'][0x0][_0x52eb('0x2b')][_0x52eb('0x83')];_0x3f3883[_0x52eb('0x5d')]['body']=_0x2528b6['body'][0x0]['message'][_0x52eb('0x8a')];break;case _0x52eb('0x92'):_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x83')]=_0x2528b6[_0x52eb('0x5d')]['from'];_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x5d')]=_0x2528b6[_0x52eb('0x5d')]['message'];_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x86')]=_0x2528b6[_0x52eb('0x5d')][_0x52eb('0x93')];break;}}if(_0x3f3883[_0x52eb('0x5d')]['id']){delete _0x3f3883[_0x52eb('0x5d')]['id'];}if(_[_0x52eb('0x94')](_0x3f3883['body']['from'])){throw new db[(_0x52eb('0x79'))][(_0x52eb('0x7a'))](_0x52eb('0x95'));}if(_[_0x52eb('0x94')](_0x3f3883['body']['body'])||_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x5d')]===''){throw new db[(_0x52eb('0x79'))]['ValidationError'](_0x52eb('0x96'));}if(_['isNil'](_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x97')])){throw new db[(_0x52eb('0x79'))]['ValidationError'](_0x52eb('0x98')+_0x3e170a);}if(!_['includes'](_0x3e170a,_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x97')])){throw new db[(_0x52eb('0x79'))][(_0x52eb('0x7a'))](_0x52eb('0x99')+_0x3e170a);}_0x585ec8[_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x97')]]=_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x83')];return db[_0x52eb('0x9a')][_0x52eb('0x5c')]({'where':{'id':_0x3f3883[_0x52eb('0x74')]['ListId']},'include':[{'model':db[_0x52eb('0x78')],'as':_0x52eb('0x9b'),'where':_0x585ec8,'limit':0x1,'order':[[_0x52eb('0x7d'),'DESC']]}]});})[_0x52eb('0x24')](handleEntityNotFound(_0x3afec2,null))[_0x52eb('0x24')](function(_0x5dd083){if(_0x5dd083){_0x3f3883[_0x52eb('0x9c')]=_[_0x52eb('0x9d')](_0x5dd083,[_0x52eb('0x9b')]);if(_0x5dd083['Contacts'][_0x52eb('0x4c')]){return _0x5dd083['Contacts'][0x0];}var _0xacf146=_[_0x52eb('0x9e')](_0x3f3883[_0x52eb('0x5d')],{'firstName':_0x3f3883['body'][_0x52eb('0x83')],'ListId':_0x5dd083['id']});_0xacf146[_0x3f3883['body'][_0x52eb('0x97')]]=_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x83')];return db[_0x52eb('0x78')][_0x52eb('0x61')](_0xacf146,{'fields':_0xd1517f,'raw':!![]});}})[_0x52eb('0x24')](handleEntityNotFound(_0x3afec2,null))[_0x52eb('0x24')](function(_0x1c7b0c){if(_0x1c7b0c){_0x3f3883[_0x52eb('0x9f')]=_0x1c7b0c;var _0x16588f={'ContactId':_0x1c7b0c['id'],'phone':_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x83')],'SmsAccountId':_0x2528b6[_0x52eb('0x64')]['id']};var _0x2a46f2={'ContactId':_0x1c7b0c['id'],'SmsAccountId':_0x2528b6['params']['id'],'closed':![]};return db[_0x52eb('0xa0')][_0x52eb('0x5c')]({'where':_0x2a46f2})['then'](function(_0x172640){if(_0x172640){return[_0x172640,![]];}return db['SmsInteraction'][_0x52eb('0x61')](_0x16588f)[_0x52eb('0x24')](function(_0xbbab0){return[_0xbbab0,!![]];});});}})['spread'](function(_0xf81d42,_0x16b99b){_0x3f3883[_0x52eb('0xa1')]=_0xf81d42[_0x52eb('0x3a')]({'plain':!![]});_0x3f3883['interaction']['created']=![];if(_0x16b99b){if(_0x3f3883[_0x52eb('0x74')][_0x52eb('0xa2')]){_0x3f3883['applications']['push']({'id':0x0,'priority':_0x3f3883['applications'][_0x52eb('0x4c')]+0x1,'app':_0x52eb('0xa3'),'appdata':'unmanaged','interval':_0x52eb('0xa4')});}_0x3f3883[_0x52eb('0xa1')][_0x52eb('0xa5')]=!![];}return db[_0x52eb('0xa6')]['create']({'phone':_0x3f3883[_0x52eb('0x5d')][_0x52eb('0x83')],'messageId':_0x3f3883['body'][_0x52eb('0x86')],'body':_0x3f3883['body']['body'],'SmsAccountId':_0x2528b6[_0x52eb('0x64')]['id'],'SmsInteractionId':_0xf81d42['id'],'direction':'in','ContactId':_0xf81d42['ContactId'],'AttachmentId':_0x3f3883[_0x52eb('0x5d')][_0x52eb('0xa7')]});})[_0x52eb('0x24')](function(_0x4e614f){_0x3f3883[_0x52eb('0x2b')]=_0x4e614f;if(!_0x3f3883[_0x52eb('0xa1')]['UserId'])return;return db[_0x52eb('0xa8')][_0x52eb('0x5c')]({'attributes':['id','name'],'where':{'id':_0x3f3883[_0x52eb('0xa1')][_0x52eb('0xa9')]}});})[_0x52eb('0x24')](function(_0x75708f){if(_0x75708f){_0x3f3883[_0x52eb('0x75')][_0x52eb('0xaa')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x75708f[_0x52eb('0x3e')]+','+(_0x3f3883['account'][_0x52eb('0xab')]||0xa),'interval':_0x52eb('0xa4')});}if(!_0x3f3883[_0x52eb('0xa1')][_0x52eb('0xac')])return;return db[_0x52eb('0xad')][_0x52eb('0x5c')]({'attributes':['id',_0x52eb('0x3e')],'where':{'id':_0x3f3883[_0x52eb('0xa1')][_0x52eb('0xac')]}});})[_0x52eb('0x24')](function(_0xbae6ce){if(_0xbae6ce){_0x3f3883[_0x52eb('0x75')]['unshift']({'id':0x0,'priority':0x1,'app':_0x52eb('0xae'),'appdata':_0xbae6ce['name']+','+(_0x3f3883[_0x52eb('0x74')][_0x52eb('0xaf')]||0x12c),'interval':_0x52eb('0xa4')});}return respondWithRpcPromise(_0x52eb('0xb0'),_0x52eb('0xb1'),_0x3f3883);})['then'](function(_0x30bea0){if(_0x30bea0){var _0x195764=0xc8;var _0x4d5884=_0x52eb('0xb2');logger[_0x52eb('0x25')](_0x52eb('0x28'),_0x4d5884,_0x195764,_0x52eb('0xb3'));logger[_0x52eb('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x4d5884,_0x195764,_0x52eb('0xb3'),JSON[_0x52eb('0xb4')](_0x30bea0));if(_0x3f3883[_0x52eb('0x74')][_0x52eb('0x81')]==='twilio'){return _0x3afec2[_0x52eb('0x2f')](_0x195764)[_0x52eb('0x35')](_0x52eb('0xb5'),_0x52eb('0xb6'))[_0x52eb('0x3f')](_0x52eb('0xb7'));}else{return _0x3afec2['status'](_0x195764)[_0x52eb('0x30')](_0x30bea0);}}})['catch'](handleError(_0x3afec2,null));};exports[_0x52eb('0xb8')]=function(_0x5a12fd,_0x4c9168){var _0x5b04df=_0x5a12fd[_0x52eb('0x64')]['id'];var _0x54539c=_0x5a12fd['body'];var _0x46a72f=0xc8;var _0x5650cf=null;return db[_0x52eb('0xb9')][_0x52eb('0xba')]({'isolationLevel':db['sequelize']['Transaction'][_0x52eb('0xbb')]['READ_COMMITTED']},function(_0x4ab1ba){return db['SmsAccount'][_0x52eb('0x69')]({'where':{'id':_0x5b04df},'transaction':_0x4ab1ba})[_0x52eb('0x24')](function(_0x1cbb1f){if(_0x1cbb1f){return db[_0x52eb('0x72')][_0x52eb('0x39')]({'where':{'SmsAccountId':_0x5b04df},'transaction':_0x4ab1ba})[_0x52eb('0x24')](function(){var _0x2d6c9a=_['map'](_0x54539c,function(_0x4547c6){_0x4547c6['SmsAccountId']=_0x5b04df;return _0x4547c6;});return db[_0x52eb('0x72')][_0x52eb('0xbc')](_0x2d6c9a,{'transaction':_0x4ab1ba});});}else{_0x46a72f=0x194;_0x5650cf=[];}});})[_0x52eb('0x24')](function(){if(_0x46a72f!==0x194){return db['SmsApplication'][_0x52eb('0xbd')]({'where':{'SmsAccountId':_0x5b04df},'order':_0x52eb('0x76')})[_0x52eb('0x24')](function(_0x397113){_0x5650cf=_0x397113;});}})['catch'](function(_0x1503b8){_0x46a72f=0x1f4;logger[_0x52eb('0x29')](_0x1503b8[_0x52eb('0x3d')]);if(_0x1503b8['name']){delete _0x1503b8['name'];}_0x5650cf=_0x1503b8;})['finally'](function(){if(_0x5650cf===null){_0x4c9168[_0x52eb('0x2e')](_0x46a72f);}else{if(_0x46a72f===0x1f4){_0x4c9168[_0x52eb('0x2f')](_0x46a72f)[_0x52eb('0x3f')](_0x5650cf);}else{_0x4c9168[_0x52eb('0x2f')](_0x46a72f)[_0x52eb('0x30')](_0x5650cf);}}});};exports[_0x52eb('0xbe')]=function(_0x33ef26,_0x2dd5d9,_0x4030fe){var _0x40465b={};var _0x361c4b={};var _0x4450cd;var _0x1196f7;return db[_0x52eb('0x55')][_0x52eb('0x69')]({'where':{'id':_0x33ef26[_0x52eb('0x64')]['id']}})[_0x52eb('0x24')](handleEntityNotFound(_0x2dd5d9,null))[_0x52eb('0x24')](function(_0x345000){if(_0x345000){_0x4450cd=_0x345000;_0x361c4b[_0x52eb('0x49')]=_[_0x52eb('0x46')](db['SmsApplication'][_0x52eb('0x5b')]);_0x361c4b['query']=_['keys'](_0x33ef26[_0x52eb('0x45')]);_0x361c4b['filters']=_['intersection'](_0x361c4b[_0x52eb('0x49')],_0x361c4b[_0x52eb('0x45')]);_0x40465b[_0x52eb('0x4a')]=_['intersection'](_0x361c4b[_0x52eb('0x49')],qs['fields'](_0x33ef26[_0x52eb('0x45')][_0x52eb('0x4b')]));_0x40465b[_0x52eb('0x4a')]=_0x40465b[_0x52eb('0x4a')][_0x52eb('0x4c')]?_0x40465b[_0x52eb('0x4a')]:_0x361c4b[_0x52eb('0x49')];_0x40465b[_0x52eb('0x4e')]=qs[_0x52eb('0x4f')](_0x33ef26[_0x52eb('0x45')][_0x52eb('0x4f')]);_0x40465b[_0x52eb('0x50')]=qs[_0x52eb('0x47')](_[_0x52eb('0x51')](_0x33ef26[_0x52eb('0x45')],_0x361c4b[_0x52eb('0x47')]));if(_0x33ef26['query'][_0x52eb('0x53')]){_0x40465b[_0x52eb('0x50')]=_[_0x52eb('0x52')](_0x40465b['where'],{'$or':_['map'](_0x40465b[_0x52eb('0x4a')],function(_0x4745b9){var _0x37adc9={};_0x37adc9[_0x4745b9]={'$like':'%'+_0x33ef26[_0x52eb('0x45')][_0x52eb('0x53')]+'%'};return _0x37adc9;})});}_0x40465b=_['merge']({},_0x40465b,_0x33ef26[_0x52eb('0x54')]);return _0x4450cd[_0x52eb('0xbe')](_0x40465b);}})[_0x52eb('0x24')](function(_0x41b81f){if(_0x41b81f){_0x1196f7=_0x41b81f[_0x52eb('0x4c')];if(!_0x33ef26[_0x52eb('0x45')][_0x52eb('0x6a')](_0x52eb('0x4d'))){_0x40465b[_0x52eb('0x32')]=qs[_0x52eb('0x32')](_0x33ef26['query'][_0x52eb('0x32')]);_0x40465b['offset']=qs[_0x52eb('0x34')](_0x33ef26[_0x52eb('0x45')]['offset']);}return _0x4450cd['getApplications'](_0x40465b);}})[_0x52eb('0x24')](function(_0x5507e2){if(_0x5507e2){return _0x5507e2?{'count':_0x1196f7,'rows':_0x5507e2}:null;}})['then'](respondWithResult(_0x2dd5d9,null))['catch'](handleError(_0x2dd5d9,null));};exports[_0x52eb('0xbf')]=function(_0x4a9511,_0x584bf8,_0x548f79){var _0x3aa913={'raw':![],'where':{}};var _0x50500d={};var _0x34cd6f={'count':0x0,'rows':[]};return db[_0x52eb('0x55')][_0x52eb('0x69')]({'where':{'id':_0x4a9511[_0x52eb('0x64')]['id']}})[_0x52eb('0x24')](handleEntityNotFound(_0x584bf8,null))['then'](function(_0x557942){if(_0x557942){_0x50500d[_0x52eb('0x49')]=_[_0x52eb('0x46')](db[_0x52eb('0xa0')][_0x52eb('0x5b')]);_0x50500d[_0x52eb('0x45')]=_[_0x52eb('0x46')](_0x4a9511[_0x52eb('0x45')]);_0x50500d[_0x52eb('0x47')]=_[_0x52eb('0x48')](_0x50500d[_0x52eb('0x49')],_0x50500d[_0x52eb('0x45')]);_0x3aa913[_0x52eb('0x4a')]=_[_0x52eb('0x48')](_0x50500d[_0x52eb('0x49')],qs[_0x52eb('0x4b')](_0x4a9511[_0x52eb('0x45')][_0x52eb('0x4b')]));_0x3aa913[_0x52eb('0x4a')]=_0x3aa913[_0x52eb('0x4a')]['length']?_0x3aa913[_0x52eb('0x4a')]:_0x50500d['model'];if(!_0x4a9511[_0x52eb('0x45')][_0x52eb('0x6a')](_0x52eb('0x4d'))){_0x3aa913[_0x52eb('0x32')]=qs[_0x52eb('0x32')](_0x4a9511[_0x52eb('0x45')][_0x52eb('0x32')]);_0x3aa913['offset']=qs[_0x52eb('0x34')](_0x4a9511['query'][_0x52eb('0x34')]);}_0x3aa913[_0x52eb('0x4e')]=qs[_0x52eb('0x4f')](_0x4a9511[_0x52eb('0x45')][_0x52eb('0x4f')]);_0x3aa913['where']=qs['filters'](_[_0x52eb('0x51')](_0x4a9511['query'],_0x50500d[_0x52eb('0x47')]));_0x3aa913[_0x52eb('0x50')]['SmsAccountId']=_0x557942['id'];if(_0x4a9511[_0x52eb('0x45')][_0x52eb('0x53')]){_0x3aa913['where']=_[_0x52eb('0x52')](_0x3aa913[_0x52eb('0x50')],{'$or':_[_0x52eb('0x43')](_0x3aa913[_0x52eb('0x4a')],function(_0x204e2c){var _0x48eb9b={};_0x48eb9b[_0x204e2c]={'$like':'%'+_0x4a9511[_0x52eb('0x45')][_0x52eb('0x53')]+'%'};return _0x48eb9b;})});}_0x3aa913=_[_0x52eb('0x52')]({},_0x3aa913,_0x4a9511[_0x52eb('0x54')]);return db[_0x52eb('0xa0')][_0x52eb('0x33')]({'where':_0x3aa913[_0x52eb('0x50')]})['then'](function(_0x204d4a){_0x34cd6f['count']=_0x204d4a;if(_0x4a9511['query'][_0x52eb('0x56')]){_0x3aa913['include']=[{'model':db[_0x52eb('0x78')],'as':_0x52eb('0xc0'),'required':![]},{'model':db[_0x52eb('0xa8')],'as':_0x52eb('0xc1'),'attributes':[_0x52eb('0x3e'),_0x52eb('0xc2'),_0x52eb('0xc3')],'required':![]},{'model':db[_0x52eb('0xc4')],'as':_0x52eb('0xc5'),'attributes':['id','name','color'],'where':_0x4a9511[_0x52eb('0x45')]['tag']?{'id':_0x4a9511['query']['tag']}:undefined,'required':_0x4a9511[_0x52eb('0x45')][_0x52eb('0xc6')]?!![]:![]}];}return db[_0x52eb('0xa0')][_0x52eb('0x58')](_0x3aa913);})[_0x52eb('0x24')](function(_0x59fd78){_0x34cd6f[_0x52eb('0x59')]=_0x59fd78;return _0x34cd6f;});}})[_0x52eb('0x24')](respondWithFilteredResult(_0x584bf8,_0x3aa913))[_0x52eb('0x2d')](handleError(_0x584bf8,null));};exports[_0x52eb('0x3f')]=function(_0x4f57e7,_0x379f2f,_0x31963c){var _0x3805e9,_0x33ba60,_0x48e1d0;if(_[_0x52eb('0x94')](_0x4f57e7[_0x52eb('0x5d')][_0x52eb('0x5d')])||_0x4f57e7[_0x52eb('0x5d')][_0x52eb('0x5d')]===''){throw new db[(_0x52eb('0x79'))][(_0x52eb('0x7a'))](_0x52eb('0x96'));}if(_[_0x52eb('0x94')](_0x4f57e7['body']['to'])){throw new db[(_0x52eb('0x79'))][(_0x52eb('0x7a'))](_0x52eb('0xc7'));}_0x3805e9=_0x4f57e7[_0x52eb('0x5d')]['to'];return db[_0x52eb('0x55')][_0x52eb('0x5c')]({'where':{'id':_0x4f57e7[_0x52eb('0x64')]['id']},'include':[{'model':db[_0x52eb('0x9a')],'as':_0x52eb('0xc8'),'include':[{'model':db[_0x52eb('0x78')],'as':_0x52eb('0x9b'),'where':{'mobile':_0x3805e9},'limit':0x1,'order':[[_0x52eb('0x7d'),_0x52eb('0xc9')]]}]}]})['then'](handleEntityNotFound(_0x379f2f,null))[_0x52eb('0x24')](function(_0x21723d){if(_0x21723d&&_0x21723d[_0x52eb('0xc8')]){_0x33ba60=_0x21723d['get']({'plain':!![]});if(_0x33ba60['List']&&_0x33ba60[_0x52eb('0xc8')]['Contacts'][_0x52eb('0x4c')]){return _0x33ba60[_0x52eb('0xc8')][_0x52eb('0x9b')][0x0];}return db[_0x52eb('0x78')][_0x52eb('0x61')](_[_0x52eb('0x9e')](_0x4f57e7[_0x52eb('0x5d')],{'firstName':_0x3805e9,'mobile':_0x3805e9,'phone':_0x3805e9,'ListId':_0x33ba60[_0x52eb('0x7f')]}));}})[_0x52eb('0x24')](handleEntityNotFound(_0x379f2f,null))['then'](function(_0x2c6b93){if(_0x2c6b93){_0x48e1d0=_0x2c6b93;return db[_0x52eb('0xa0')][_0x52eb('0x5c')]({'where':{'ContactId':_0x48e1d0['id'],'closed':![],'SmsAccountId':_0x33ba60['id']}})[_0x52eb('0x24')](function(_0x139bb9){if(_0x139bb9){return[_0x139bb9,![]];}return db[_0x52eb('0xa0')][_0x52eb('0x61')]({'UserId':_0x4f57e7[_0x52eb('0x5e')]['id'],'ContactId':_0x48e1d0['id'],'SmsAccountId':_0x33ba60['id'],'phone':_0x3805e9,'firstMsgDirection':_0x52eb('0xca'),'Messages':[_[_0x52eb('0x52')](_0x4f57e7['body'],{'read':![],'body':_0x4f57e7[_0x52eb('0x5d')]['body'],'phone':_0x3805e9,'SmsAccountId':_0x33ba60['id'],'UserId':_0x4f57e7[_0x52eb('0x5e')]['id'],'ContactId':_0x48e1d0['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0x52eb('0x24')](function(_0x21ca48){return[_0x21ca48,!![]];});});}})[_0x52eb('0xcb')](function(_0x39d4ad,_0x100bb8){if(_0x100bb8){return _0x39d4ad;}return db[_0x52eb('0xa6')][_0x52eb('0x61')](_[_0x52eb('0x52')](_0x4f57e7[_0x52eb('0x5d')],{'read':![],'body':_0x4f57e7[_0x52eb('0x5d')]['body'],'phone':_0x3805e9,'SmsAccountId':_0x33ba60['id'],'SmsInteractionId':_0x39d4ad['id'],'UserId':_0x4f57e7[_0x52eb('0x5e')]['id'],'ContactId':_0x48e1d0['id']}))['then'](function(_0x1231e8){_0x39d4ad[_0x52eb('0xcc')][_0x52eb('0xcd')]=[];_0x39d4ad[_0x52eb('0xcc')][_0x52eb('0xcd')][_0x52eb('0xce')](_0x1231e8[_0x52eb('0xcc')]);return _0x39d4ad;});})[_0x52eb('0x24')](respondWithResult(_0x379f2f,null))['catch'](handleError(_0x379f2f,null));};exports['status']=function(_0x5bffcb,_0x4b9c45,_0x354d95){if(_0x5bffcb[_0x52eb('0x5d')]['id']){delete _0x5bffcb['body']['id'];}var _0x33893f,_0x5a4813,_0x5da4f1;return db[_0x52eb('0x55')][_0x52eb('0x5c')]({'where':{'id':_0x5bffcb['params']['id']}})[_0x52eb('0x24')](handleEntityNotFound(_0x4b9c45,null))[_0x52eb('0x24')](function(_0x1e3582){if(_0x1e3582){_0x5da4f1=_0x1e3582;logger['debug'](_0x52eb('0x28'),'status','received\x20delivery\x20report\x20from',_0x1e3582['type'],util['inspect'](_0x5bffcb[_0x52eb('0x5d')],{'showHidden':![],'depth':null}));switch(_0x1e3582[_0x52eb('0x81')]){case _0x52eb('0x88'):if(_0x5bffcb[_0x52eb('0x5d')][_0x52eb('0xcf')]&&_0x5bffcb['body'][_0x52eb('0x2f')]){_0x5a4813=_0x5bffcb[_0x52eb('0x5d')][_0x52eb('0x2f')];return db[_0x52eb('0xa6')][_0x52eb('0x5c')]({'where':{'messageId':_0x5bffcb[_0x52eb('0x5d')][_0x52eb('0xcf')]}});}break;case'connectel':if(_0x5bffcb[_0x52eb('0x5d')][_0x52eb('0xd0')]&&_0x5bffcb['body']['statusInt']){_0x5a4813=_0x5bffcb[_0x52eb('0x5d')]['statusInt'];return db[_0x52eb('0xa6')][_0x52eb('0x5c')]({'where':{'messageId':_0x5bffcb[_0x52eb('0x5d')][_0x52eb('0xd0')]}});}break;case _0x52eb('0xd1'):if(_0x5bffcb[_0x52eb('0x5d')][_0x52eb('0xd2')]&&_0x5bffcb[_0x52eb('0x5d')][_0x52eb('0xd3')]){_0x5a4813=_0x5bffcb[_0x52eb('0x5d')][_0x52eb('0xd3')];return db[_0x52eb('0xa6')][_0x52eb('0x5c')]({'where':{'messageId':_0x5bffcb[_0x52eb('0x5d')]['message_id']}});}break;case _0x52eb('0xd4'):var _0x3e2d52=_0x5bffcb[_0x52eb('0x5d')][_0x52eb('0x8d')][0x0];if(_0x3e2d52[_0x52eb('0x86')]&&_0x3e2d52[_0x52eb('0x2f')][_0x52eb('0xd5')]===_0x52eb('0xd6')){_0x5a4813=_0x3e2d52['status'][_0x52eb('0xd5')];return db[_0x52eb('0xa6')][_0x52eb('0x5c')]({'where':{'messageId':_0x3e2d52[_0x52eb('0x86')]}});}break;case'clickatell':if(_0x5bffcb[_0x52eb('0x5d')][_0x52eb('0x86')]&&_0x5bffcb[_0x52eb('0x5d')][_0x52eb('0x2f')]){_0x5a4813=_0x5bffcb['body'][_0x52eb('0x2f')];return db[_0x52eb('0xa6')][_0x52eb('0x5c')]({'where':{'messageId':_0x5bffcb['body'][_0x52eb('0x86')]}});}break;case _0x52eb('0x91'):if(_0x5bffcb[_0x52eb('0x5d')][0x0][_0x52eb('0x2b')]['id']){_0x5a4813=_0x5bffcb[_0x52eb('0x5d')][0x0][_0x52eb('0x81')];return db[_0x52eb('0xa6')]['find']({'where':{'messageId':_0x5bffcb[_0x52eb('0x5d')][0x0][_0x52eb('0x2b')]['id']}});}break;case _0x52eb('0x92'):if(_0x5bffcb[_0x52eb('0x5d')]['redif']&&_0x5bffcb['body'][_0x52eb('0x2f')]){_0x5a4813=_0x5bffcb[_0x52eb('0x5d')]['status'];return db[_0x52eb('0xa6')]['find']({'where':{'messageId':_0x5bffcb['body'][_0x52eb('0xd7')]}});}break;}}})['then'](handleEntityNotFound(_0x4b9c45,null))[_0x52eb('0x24')](function(_0x16c787){if(_0x16c787){_0x33893f=_0x16c787;switch(_0x5da4f1[_0x52eb('0x81')]){case'skebby':if(_0x5a4813==='DELIVERED'){return _0x33893f[_0x52eb('0x63')]({'read':!![]});}else{logger[_0x52eb('0x29')](_0x52eb('0x28'),_0x52eb('0x2f'),_0x52eb('0x88'),util['inspect'](_0x5bffcb[_0x52eb('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x52eb('0x8b'):if(_0x5a4813==='1'){return _0x33893f[_0x52eb('0x63')]({'read':!![]});}else{logger[_0x52eb('0x29')](_0x52eb('0x28'),_0x52eb('0x2f'),_0x52eb('0x88'),util['inspect'](_0x5bffcb[_0x52eb('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x52eb('0xd1'):if(!_0x5bffcb[_0x52eb('0x5d')][_0x52eb('0xd8')]&&_0x5a4813>=0xc8&&_0x5a4813<=0xce){return _0x33893f[_0x52eb('0x63')]({'read':!![]});}else{logger[_0x52eb('0x29')](_0x52eb('0x28'),_0x52eb('0x2f'),_0x52eb('0xd1'),util[_0x52eb('0xd9')](_0x5bffcb['body'],{'showHidden':![],'depth':null}));}break;case _0x52eb('0xd4'):var _0x4a5128=_0x5bffcb[_0x52eb('0x5d')]['results'][0x0];if(_0x4a5128['status'][_0x52eb('0xd5')]===_0x52eb('0xd6')){return _0x33893f['update']({'read':!![]});}else{logger[_0x52eb('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x52eb('0x2f'),'infobip',util[_0x52eb('0xd9')](_0x5bffcb[_0x52eb('0x5d')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x5a4813==_0x52eb('0xda')||_0x5a4813=='RECEIVED_BY_RECIPIENT'){return _0x33893f[_0x52eb('0x63')]({'read':!![]});}else{logger[_0x52eb('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x52eb('0x2f'),_0x52eb('0xdb'),util[_0x52eb('0xd9')](_0x5bffcb['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x5a4813=='message-delivered'){return _0x33893f[_0x52eb('0x63')]({'read':!![]});}else{logger[_0x52eb('0x29')](_0x52eb('0x28'),_0x52eb('0x2f'),_0x52eb('0x91'),util[_0x52eb('0xd9')](_0x5bffcb[_0x52eb('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x52eb('0x92'):if(_0x5a4813===_0x52eb('0xdc')||_0x5a4813===_0x52eb('0xdd')){return _0x33893f[_0x52eb('0x63')]({'read':!![]});}else{logger[_0x52eb('0x29')](_0x52eb('0x28'),_0x52eb('0x2f'),_0x52eb('0x92'),util['inspect'](_0x5bffcb[_0x52eb('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x33893f;}})[_0x52eb('0x24')](respondWithResult(_0x4b9c45,null))['catch'](handleError(_0x4b9c45,null));};exports['statusGet']=function(_0x50db6f,_0x7dd678,_0x2fd92f){var _0x5a263a,_0x57eae5,_0x30aca5;return db[_0x52eb('0x55')][_0x52eb('0x5c')]({'where':{'id':_0x50db6f[_0x52eb('0x64')]['id']}})[_0x52eb('0x24')](handleEntityNotFound(_0x7dd678,null))[_0x52eb('0x24')](function(_0x400d24){if(_0x400d24){_0x30aca5=_0x400d24;logger[_0x52eb('0x27')](_0x52eb('0x28'),_0x52eb('0x2f'),_0x52eb('0xde'),_0x400d24[_0x52eb('0x81')],util[_0x52eb('0xd9')](_0x50db6f[_0x52eb('0x45')],{'showHidden':![],'depth':null}));switch(_0x400d24[_0x52eb('0x81')]){case _0x52eb('0x8e'):if(_0x50db6f['query'][_0x52eb('0xdf')]&&_0x50db6f[_0x52eb('0x45')][_0x52eb('0xe0')]){_0x57eae5=_0x50db6f[_0x52eb('0x45')][_0x52eb('0xe0')];return db[_0x52eb('0xa6')][_0x52eb('0x5c')]({'where':{'messageId':_0x50db6f[_0x52eb('0x45')][_0x52eb('0xdf')]}});}break;}}})[_0x52eb('0x24')](handleEntityNotFound(_0x7dd678,null))[_0x52eb('0x24')](function(_0xd503f1){if(_0xd503f1){_0x5a263a=_0xd503f1;switch(_0x30aca5['type']){case _0x52eb('0x8e'):if(_0x57eae5==='2'||_0x57eae5==='6'){return _0x5a263a[_0x52eb('0x63')]({'read':!![]});}else{logger[_0x52eb('0x29')](_0x52eb('0x28'),_0x52eb('0x2f'),_0x52eb('0x8e'),util[_0x52eb('0xd9')](_0x50db6f['query'],{'showHidden':![],'depth':null}));};break;}return _0x5a263a;}})[_0x52eb('0x24')](respondWithResult(_0x7dd678,null))['catch'](handleError(_0x7dd678,null));};exports[_0x52eb('0xe1')]=function(_0x256eb8,_0x58b02e,_0x1092ab){return db[_0x52eb('0x55')][_0x52eb('0x5c')]({'where':{'id':_0x256eb8[_0x52eb('0x64')]['id']}})['then'](handleEntityNotFound(_0x58b02e,null))['then'](function(_0x5a8065){if(_0x5a8065){return _0x5a8065[_0x52eb('0xe1')](_0x256eb8[_0x52eb('0x5d')]['ids'],_[_0x52eb('0x9d')](_0x256eb8[_0x52eb('0x5d')],[_0x52eb('0x6c'),'id'])||{})[_0x52eb('0xcb')](function(_0x5ae8ad){for(var _0x1caa09=0x0;_0x1caa09<_0x256eb8['body'][_0x52eb('0x6c')][_0x52eb('0x4c')];_0x1caa09+=0x1){socket[_0x52eb('0xe2')](_0x52eb('0xe3'),{'UserId':Number(_0x256eb8[_0x52eb('0x5d')][_0x52eb('0x6c')][_0x1caa09]),'SmsAccountId':Number(_0x256eb8['params']['id'])});}return _0x5ae8ad;});}})[_0x52eb('0x24')](respondWithResult(_0x58b02e,null))[_0x52eb('0x2d')](handleError(_0x58b02e,null));};exports['removeAgents']=function(_0x127dba,_0x5d31ca,_0x1bab3c){return db[_0x52eb('0x55')]['find']({'where':{'id':_0x127dba[_0x52eb('0x64')]['id']}})[_0x52eb('0x24')](handleEntityNotFound(_0x5d31ca,null))[_0x52eb('0x24')](function(_0x493cff){if(_0x493cff){return _0x493cff[_0x52eb('0xe4')](_0x127dba[_0x52eb('0x45')][_0x52eb('0x6c')])['then'](function(){if(_[_0x52eb('0xe5')](_0x127dba[_0x52eb('0x45')][_0x52eb('0x6c')])){for(var _0x5a1ee2=0x0;_0x5a1ee2<_0x127dba[_0x52eb('0x45')][_0x52eb('0x6c')][_0x52eb('0x4c')];_0x5a1ee2+=0x1){socket[_0x52eb('0xe2')]('userSmsAccount:remove',{'UserId':Number(_0x127dba['query'][_0x52eb('0x6c')][_0x5a1ee2]),'SmsAccountId':Number(_0x127dba[_0x52eb('0x64')]['id'])});}}else{socket['emit'](_0x52eb('0xe6'),{'UserId':Number(_0x127dba['query'][_0x52eb('0x6c')]),'SmsAccountId':Number(_0x127dba[_0x52eb('0x64')]['id'])});}});}})[_0x52eb('0x24')](respondWithStatusCode(_0x5d31ca,null))[_0x52eb('0x2d')](handleError(_0x5d31ca,null));};exports['getAgents']=function(_0x23a490,_0x456f74,_0x3affbb){var _0x3dba7f={};var _0x1e9b38={};var _0x4b371d;var _0x1ef85e;return db[_0x52eb('0x55')][_0x52eb('0x69')]({'where':{'id':_0x23a490['params']['id']}})['then'](handleEntityNotFound(_0x456f74,null))[_0x52eb('0x24')](function(_0x21f3ca){if(_0x21f3ca){_0x4b371d=_0x21f3ca;_0x1e9b38[_0x52eb('0x49')]=_[_0x52eb('0x46')](db[_0x52eb('0xa8')][_0x52eb('0x5b')]);_0x1e9b38[_0x52eb('0x45')]=_['keys'](_0x23a490[_0x52eb('0x45')]);_0x1e9b38[_0x52eb('0x47')]=_[_0x52eb('0x48')](_0x1e9b38[_0x52eb('0x49')],_0x1e9b38[_0x52eb('0x45')]);_0x3dba7f[_0x52eb('0x4a')]=_[_0x52eb('0x48')](_0x1e9b38['model'],qs[_0x52eb('0x4b')](_0x23a490[_0x52eb('0x45')][_0x52eb('0x4b')]));_0x3dba7f[_0x52eb('0x4a')]=_0x3dba7f[_0x52eb('0x4a')][_0x52eb('0x4c')]?_0x3dba7f[_0x52eb('0x4a')]:_0x1e9b38['model'];_0x3dba7f[_0x52eb('0x4e')]=qs[_0x52eb('0x4f')](_0x23a490['query'][_0x52eb('0x4f')]);_0x3dba7f[_0x52eb('0x50')]=qs[_0x52eb('0x47')](_['pick'](_0x23a490[_0x52eb('0x45')],_0x1e9b38[_0x52eb('0x47')]));if(_0x23a490[_0x52eb('0x45')][_0x52eb('0x53')]){_0x3dba7f[_0x52eb('0x50')]=_[_0x52eb('0x52')](_0x3dba7f[_0x52eb('0x50')],{'$or':_[_0x52eb('0x43')](_0x3dba7f[_0x52eb('0x4a')],function(_0x2a6eb9){var _0x3aa126={};_0x3aa126[_0x2a6eb9]={'$like':'%'+_0x23a490[_0x52eb('0x45')][_0x52eb('0x53')]+'%'};return _0x3aa126;})});}_0x3dba7f=_[_0x52eb('0x52')]({},_0x3dba7f,_0x23a490[_0x52eb('0x54')]);return _0x4b371d[_0x52eb('0xe7')](_0x3dba7f);}})[_0x52eb('0x24')](function(_0x53d028){if(_0x53d028){_0x1ef85e=_0x53d028[_0x52eb('0x4c')];if(!_0x23a490[_0x52eb('0x45')][_0x52eb('0x6a')]('nolimit')){_0x3dba7f[_0x52eb('0x32')]=qs[_0x52eb('0x32')](_0x23a490[_0x52eb('0x45')]['limit']);_0x3dba7f[_0x52eb('0x34')]=qs[_0x52eb('0x34')](_0x23a490[_0x52eb('0x45')][_0x52eb('0x34')]);}return _0x4b371d[_0x52eb('0xe7')](_0x3dba7f);}})['then'](function(_0x516772){if(_0x516772){return _0x516772?{'count':_0x1ef85e,'rows':_0x516772}:null;}})[_0x52eb('0x24')](respondWithResult(_0x456f74,null))['catch'](handleError(_0x456f74,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 619575c..4cfdae1 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 _0xea1a=['events','../../mysqldb','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x53da6c,_0x5930d4){var _0x33c828=function(_0x4f8960){while(--_0x4f8960){_0x53da6c['push'](_0x53da6c['shift']());}};_0x33c828(++_0x5930d4);}(_0xea1a,0xa8));var _0xaea1=function(_0x3b4347,_0x213a36){_0x3b4347=_0x3b4347-0x0;var _0x4f0e69=_0xea1a[_0x3b4347];return _0x4f0e69;};'use strict';var EventEmitter=require(_0xaea1('0x0'));var SmsAccount=require(_0xaea1('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xaea1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaea1('0x3'),'afterDestroy':_0xaea1('0x4')};function emitEvent(_0x3c5f13){return function(_0x46a072,_0x1c9239,_0x2ea871){SmsAccountEvents['emit'](_0x3c5f13+':'+_0x46a072['id'],_0x46a072);SmsAccountEvents[_0xaea1('0x5')](_0x3c5f13,_0x46a072);_0x2ea871(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xaea1('0x6')](e,emitEvent(event));}}module[_0xaea1('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x0e75=['setMaxListeners','remove','emit','exports','events','../../mysqldb','SmsAccount'];(function(_0x30b710,_0x4477d1){var _0x205edf=function(_0x4e02cc){while(--_0x4e02cc){_0x30b710['push'](_0x30b710['shift']());}};_0x205edf(++_0x4477d1);}(_0x0e75,0x162));var _0x50e7=function(_0x1ad93b,_0x56bee2){_0x1ad93b=_0x1ad93b-0x0;var _0x5c83a3=_0x0e75[_0x1ad93b];return _0x5c83a3;};'use strict';var EventEmitter=require(_0x50e7('0x0'));var SmsAccount=require(_0x50e7('0x1'))['db'][_0x50e7('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x50e7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x50e7('0x4')};function emitEvent(_0x182f1f){return function(_0xd96ca8,_0x367f84,_0x1b180c){SmsAccountEvents['emit'](_0x182f1f+':'+_0xd96ca8['id'],_0xd96ca8);SmsAccountEvents[_0x50e7('0x5')](_0x182f1f,_0xd96ca8);_0x1b180c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x50e7('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 8a52c49..7769f0e 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 _0xec5d=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api'];(function(_0x15f315,_0x4606cf){var _0x5489cb=function(_0x133918){while(--_0x133918){_0x15f315['push'](_0x15f315['shift']());}};_0x5489cb(++_0x4606cf);}(_0xec5d,0x1e6));var _0xdec5=function(_0xe1c1b,_0x336364){_0xe1c1b=_0xe1c1b-0x0;var _0x332f61=_0xec5d[_0xe1c1b];return _0x332f61;};'use strict';var _=require(_0xdec5('0x0'));var util=require(_0xdec5('0x1'));var logger=require(_0xdec5('0x2'))(_0xdec5('0x3'));var moment=require(_0xdec5('0x4'));var BPromise=require(_0xdec5('0x5'));var rp=require(_0xdec5('0x6'));var fs=require('fs');var path=require(_0xdec5('0x7'));var rimraf=require(_0xdec5('0x8'));var config=require(_0xdec5('0x9'));var attributes=require(_0xdec5('0xa'));module['exports']=function(_0x4e795c,_0x5947f4){return _0x4e795c[_0xdec5('0xb')](_0xdec5('0xc'),attributes,{'tableName':_0xdec5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1afa=['../../config/environment','define','SmsAccount','sms_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x1afa,0xe0));var _0xa1af=function(_0x58a928,_0x32d56d){_0x58a928=_0x58a928-0x0;var _0x4226db=_0x1afa[_0x58a928];return _0x4226db;};'use strict';var _=require('lodash');var util=require(_0xa1af('0x0'));var logger=require(_0xa1af('0x1'))(_0xa1af('0x2'));var moment=require(_0xa1af('0x3'));var BPromise=require(_0xa1af('0x4'));var rp=require(_0xa1af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa1af('0x6'));var attributes=require('./smsAccount.attributes');module['exports']=function(_0x416c94,_0x1fd4ab){return _0x416c94[_0xa1af('0x7')](_0xa1af('0x8'),attributes,{'tableName':_0xa1af('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 858848c..722bcb7 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 _0x043b=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSmsAccount','find','options','raw','where','attributes','include','map','model','stringify','lodash','util','moment','ioredis'];(function(_0x3cca47,_0x4733c1){var _0x4db28d=function(_0x390663){while(--_0x390663){_0x3cca47['push'](_0x3cca47['shift']());}};_0x4db28d(++_0x4733c1);}(_0x043b,0x1dd));var _0xb043=function(_0x145ce7,_0xbfd866){_0x145ce7=_0x145ce7-0x0;var _0x58d08f=_0x043b[_0x145ce7];return _0x58d08f;};'use strict';var _=require(_0xb043('0x0'));var util=require(_0xb043('0x1'));var moment=require(_0xb043('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb043('0x3'));var db=require(_0xb043('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb043('0x5'));var config=require(_0xb043('0x6'));var jayson=require(_0xb043('0x7'));var client=jayson[_0xb043('0x8')][_0xb043('0x9')]({'port':0x232a});config[_0xb043('0xa')]=_[_0xb043('0xb')](config[_0xb043('0xa')],{'host':_0xb043('0xc'),'port':0x18eb});var socket=require(_0xb043('0xd'))(new Redis(config[_0xb043('0xa')]));require(_0xb043('0xe'))[_0xb043('0xf')](socket);function respondWithRpcPromise(_0x5efaa3,_0x19f463,_0x58b3da){return new BPromise(function(_0x37154c,_0x4d2ee5){return client['request'](_0x5efaa3,_0x58b3da)[_0xb043('0x10')](function(_0x243f4a){logger[_0xb043('0x11')](_0xb043('0x12'),_0x19f463,_0xb043('0x13'));logger[_0xb043('0x14')](_0xb043('0x15'),_0x19f463,'request\x20sent',JSON['stringify'](_0x243f4a));if(_0x243f4a[_0xb043('0x16')]){if(_0x243f4a[_0xb043('0x16')][_0xb043('0x17')]===0x1f4){logger[_0xb043('0x16')](_0xb043('0x12'),_0x19f463,_0x243f4a['error'][_0xb043('0x18')]);return _0x4d2ee5(_0x243f4a[_0xb043('0x16')]['message']);}logger[_0xb043('0x16')](_0xb043('0x12'),_0x19f463,_0x243f4a[_0xb043('0x16')][_0xb043('0x18')]);return _0x37154c(_0x243f4a['error'][_0xb043('0x18')]);}else{logger[_0xb043('0x11')](_0xb043('0x12'),_0x19f463,_0xb043('0x13'));_0x37154c(_0x243f4a[_0xb043('0x19')][_0xb043('0x18')]);}})[_0xb043('0x1a')](function(_0x52de6b){logger[_0xb043('0x16')](_0xb043('0x12'),_0x19f463,_0x52de6b);_0x4d2ee5(_0x52de6b);});});}exports[_0xb043('0x1b')]=function(_0x47879d){var _0x335d08=this;return new Promise(function(_0xb68934,_0x12923c){return db['SmsAccount'][_0xb043('0x1c')]({'raw':_0x47879d[_0xb043('0x1d')]?_0x47879d[_0xb043('0x1d')][_0xb043('0x1e')]===undefined?!![]:![]:!![],'where':_0x47879d['options']?_0x47879d[_0xb043('0x1d')][_0xb043('0x1f')]||null:null,'attributes':_0x47879d[_0xb043('0x1d')]?_0x47879d[_0xb043('0x1d')][_0xb043('0x20')]||null:null,'include':_0x47879d[_0xb043('0x1d')]?_0x47879d[_0xb043('0x1d')][_0xb043('0x21')]?_[_0xb043('0x22')](_0x47879d[_0xb043('0x1d')][_0xb043('0x21')],function(_0x17f0e0){return{'model':db[_0x17f0e0[_0xb043('0x23')]],'as':_0x17f0e0['as'],'attributes':_0x17f0e0['attributes'],'include':_0x17f0e0[_0xb043('0x21')]?_['map'](_0x17f0e0[_0xb043('0x21')],function(_0x376612){return{'model':db[_0x376612[_0xb043('0x23')]],'as':_0x376612['as'],'attributes':_0x376612[_0xb043('0x20')],'include':_0x376612['include']?_['map'](_0x376612[_0xb043('0x21')],function(_0x1f4152){return{'model':db[_0x1f4152['model']],'as':_0x1f4152['as'],'attributes':_0x1f4152['attributes']};}):[]};}):[]};}):[]:[]})[_0xb043('0x10')](function(_0x99e705){logger[_0xb043('0x11')](_0xb043('0x1b'),_0x47879d);logger[_0xb043('0x14')](_0xb043('0x1b'),_0x47879d,JSON[_0xb043('0x24')](_0x99e705));_0xb68934(_0x99e705);})[_0xb043('0x1a')](function(_0x1adf34){logger[_0xb043('0x16')]('ShowSmsAccount',_0x1adf34[_0xb043('0x18')],_0x47879d);_0x12923c(_0x335d08['error'](0x1f4,_0x1adf34['message']));});});}; \ No newline at end of file +var _0x8dc2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','localhost','socket.io-emitter','redis','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSmsAccount','options','raw','where','attributes','map','include','model','stringify','lodash','util','moment'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x8dc2,0x141));var _0x28dc=function(_0x576422,_0x1ff4d2){_0x576422=_0x576422-0x0;var _0x33f6f5=_0x8dc2[_0x576422];return _0x33f6f5;};'use strict';var _=require(_0x28dc('0x0'));var util=require(_0x28dc('0x1'));var moment=require(_0x28dc('0x2'));var BPromise=require(_0x28dc('0x3'));var rs=require(_0x28dc('0x4'));var fs=require('fs');var Redis=require(_0x28dc('0x5'));var db=require(_0x28dc('0x6'))['db'];var utils=require(_0x28dc('0x7'));var logger=require(_0x28dc('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x28dc('0x9'));var client=jayson['client'][_0x28dc('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x28dc('0xb'),'port':0x18eb});var socket=require(_0x28dc('0xc'))(new Redis(config[_0x28dc('0xd')]));require(_0x28dc('0xe'))[_0x28dc('0xf')](socket);function respondWithRpcPromise(_0x1c63a0,_0x548faa,_0x2ecaa0){return new BPromise(function(_0x4885ad,_0x20c30e){return client['request'](_0x1c63a0,_0x2ecaa0)[_0x28dc('0x10')](function(_0x378ac8){logger[_0x28dc('0x11')](_0x28dc('0x12'),_0x548faa,_0x28dc('0x13'));logger[_0x28dc('0x14')](_0x28dc('0x15'),_0x548faa,'request\x20sent',JSON['stringify'](_0x378ac8));if(_0x378ac8[_0x28dc('0x16')]){if(_0x378ac8[_0x28dc('0x16')][_0x28dc('0x17')]===0x1f4){logger[_0x28dc('0x16')](_0x28dc('0x12'),_0x548faa,_0x378ac8[_0x28dc('0x16')][_0x28dc('0x18')]);return _0x20c30e(_0x378ac8['error'][_0x28dc('0x18')]);}logger[_0x28dc('0x16')](_0x28dc('0x12'),_0x548faa,_0x378ac8[_0x28dc('0x16')][_0x28dc('0x18')]);return _0x4885ad(_0x378ac8['error']['message']);}else{logger[_0x28dc('0x11')](_0x28dc('0x12'),_0x548faa,'request\x20sent');_0x4885ad(_0x378ac8[_0x28dc('0x19')][_0x28dc('0x18')]);}})[_0x28dc('0x1a')](function(_0x49f4a5){logger[_0x28dc('0x16')](_0x28dc('0x12'),_0x548faa,_0x49f4a5);_0x20c30e(_0x49f4a5);});});}exports[_0x28dc('0x1b')]=function(_0x45cf9b){var _0x4368e8=this;return new Promise(function(_0x2b07bd,_0x3ca314){return db['SmsAccount']['find']({'raw':_0x45cf9b[_0x28dc('0x1c')]?_0x45cf9b[_0x28dc('0x1c')][_0x28dc('0x1d')]===undefined?!![]:![]:!![],'where':_0x45cf9b['options']?_0x45cf9b[_0x28dc('0x1c')][_0x28dc('0x1e')]||null:null,'attributes':_0x45cf9b[_0x28dc('0x1c')]?_0x45cf9b['options'][_0x28dc('0x1f')]||null:null,'include':_0x45cf9b[_0x28dc('0x1c')]?_0x45cf9b[_0x28dc('0x1c')]['include']?_[_0x28dc('0x20')](_0x45cf9b['options'][_0x28dc('0x21')],function(_0x59f9d1){return{'model':db[_0x59f9d1[_0x28dc('0x22')]],'as':_0x59f9d1['as'],'attributes':_0x59f9d1[_0x28dc('0x1f')],'include':_0x59f9d1[_0x28dc('0x21')]?_['map'](_0x59f9d1[_0x28dc('0x21')],function(_0x16f7b6){return{'model':db[_0x16f7b6[_0x28dc('0x22')]],'as':_0x16f7b6['as'],'attributes':_0x16f7b6[_0x28dc('0x1f')],'include':_0x16f7b6['include']?_['map'](_0x16f7b6[_0x28dc('0x21')],function(_0x151c1c){return{'model':db[_0x151c1c[_0x28dc('0x22')]],'as':_0x151c1c['as'],'attributes':_0x151c1c[_0x28dc('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x28dc('0x10')](function(_0x4a7702){logger[_0x28dc('0x11')](_0x28dc('0x1b'),_0x45cf9b);logger[_0x28dc('0x14')](_0x28dc('0x1b'),_0x45cf9b,JSON[_0x28dc('0x23')](_0x4a7702));_0x2b07bd(_0x4a7702);})[_0x28dc('0x1a')](function(_0x2bcf93){logger[_0x28dc('0x16')](_0x28dc('0x1b'),_0x2bcf93[_0x28dc('0x18')],_0x45cf9b);_0x3ca314(_0x4368e8[_0x28dc('0x16')](0x1f4,_0x2bcf93[_0x28dc('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index ec19949..61cc010 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 1f00d90..8d937d2 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 _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x38651d,_0x5ca1bc){var _0x3f4c9b=function(_0x553aa1){while(--_0x553aa1){_0x38651d['push'](_0x38651d['shift']());}};_0x3f4c9b(++_0x5ca1bc);}(_0x34e8,0x12c));var _0x834e=function(_0x5ba3f0,_0x22ae45){_0x5ba3f0=_0x5ba3f0-0x0;var _0x4b4e77=_0x34e8[_0x5ba3f0];return _0x4b4e77;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x4dd1a3,_0x3e5c8c){var _0x27c911=function(_0x56852f){while(--_0x56852f){_0x4dd1a3['push'](_0x4dd1a3['shift']());}};_0x27c911(++_0x3e5c8c);}(_0x55ca,0x126));var _0xa55c=function(_0x287059,_0x499940){_0x287059=_0x287059-0x0;var _0x225c79=_0x55ca[_0x287059];return _0x225c79;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index e65bc3e..f2b443c 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 _0x1d60=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x5eef6f,_0x343610){var _0x3347d9=function(_0x3c0f31){while(--_0x3c0f31){_0x5eef6f['push'](_0x5eef6f['shift']());}};_0x3347d9(++_0x343610);}(_0x1d60,0x6c));var _0x01d6=function(_0x50796a,_0x1cf988){_0x50796a=_0x50796a-0x0;var _0x50b6eb=_0x1d60[_0x50796a];return _0x50b6eb;};'use strict';var Sequelize=require(_0x01d6('0x0'));module[_0x01d6('0x1')]={'priority':{'type':Sequelize[_0x01d6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x01d6('0x3')],'allowNull':![],'defaultValue':_0x01d6('0x4')},'appdata':{'type':Sequelize[_0x01d6('0x5')]()},'description':{'type':Sequelize[_0x01d6('0x3')]},'interval':{'type':Sequelize[_0x01d6('0x3')],'defaultValue':_0x01d6('0x6')}}; \ No newline at end of file +var _0x81be=['exports','STRING','noop','sequelize'];(function(_0x3c9838,_0x1d2d2b){var _0xe7b5a7=function(_0x3a295a){while(--_0x3a295a){_0x3c9838['push'](_0x3c9838['shift']());}};_0xe7b5a7(++_0x1d2d2b);}(_0x81be,0xc3));var _0xe81b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x81be[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xe81b('0x0'));module[_0xe81b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xe81b('0x2')],'allowNull':![],'defaultValue':_0xe81b('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe81b('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 5be73be..b16cfec 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 _0xe957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','SmsApplication','includeAll','include','findAll','rows','show','params','keys','options','find','catch','create','body'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe957,0x1c2));var _0x7e95=function(_0x231e8d,_0x4e04a7){_0x231e8d=_0x231e8d-0x0;var _0xb41b84=_0xe957[_0x231e8d];return _0xb41b84;};'use strict';var emlformat=require(_0x7e95('0x0'));var rimraf=require(_0x7e95('0x1'));var zipdir=require(_0x7e95('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e95('0x3'));var moment=require(_0x7e95('0x4'));var BPromise=require(_0x7e95('0x5'));var Mustache=require(_0x7e95('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7e95('0x7'));var csv=require(_0x7e95('0x8'));var ejs=require(_0x7e95('0x9'));var fs=require('fs');var fs_extra=require(_0x7e95('0xa'));var _=require(_0x7e95('0xb'));var squel=require(_0x7e95('0xc'));var crypto=require(_0x7e95('0xd'));var jsforce=require(_0x7e95('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7e95('0xf'));var Redis=require(_0x7e95('0x10'));var authService=require(_0x7e95('0x11'));var qs=require(_0x7e95('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e95('0x13'));var logger=require(_0x7e95('0x14'))(_0x7e95('0x15'));var utils=require(_0x7e95('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7e95('0x17'));var db=require(_0x7e95('0x18'))['db'];function respondWithStatusCode(_0x564e74,_0xf4a10c){_0xf4a10c=_0xf4a10c||0xcc;return function(_0xe9a465){if(_0xe9a465){return _0x564e74[_0x7e95('0x19')](_0xf4a10c);}return _0x564e74[_0x7e95('0x1a')](_0xf4a10c)[_0x7e95('0x1b')]();};}function respondWithResult(_0x1fcdfa,_0x1eb7ad){_0x1eb7ad=_0x1eb7ad||0xc8;return function(_0x270cb2){if(_0x270cb2){return _0x1fcdfa['status'](_0x1eb7ad)[_0x7e95('0x1c')](_0x270cb2);}};}function respondWithFilteredResult(_0x57abe3,_0x879360){return function(_0x289372){if(_0x289372){var _0x9270c7=typeof _0x879360['offset']===_0x7e95('0x1d')&&typeof _0x879360['limit']==='undefined';var _0x2df38f=_0x289372[_0x7e95('0x1e')];var _0x28af9a=_0x9270c7?0x0:_0x879360['offset'];var _0x1c45f6=_0x9270c7?_0x289372[_0x7e95('0x1e')]:_0x879360[_0x7e95('0x1f')]+_0x879360[_0x7e95('0x20')];var _0x41a32c;if(_0x1c45f6>=_0x2df38f){_0x1c45f6=_0x2df38f;_0x41a32c=0xc8;}else{_0x41a32c=0xce;}_0x57abe3['status'](_0x41a32c);return _0x57abe3[_0x7e95('0x21')](_0x7e95('0x22'),_0x28af9a+'-'+_0x1c45f6+'/'+_0x2df38f)[_0x7e95('0x1c')](_0x289372);}return null;};}function patchUpdates(_0x4f3790){return function(_0x21e026){try{jsonpatch[_0x7e95('0x23')](_0x21e026,_0x4f3790,!![]);}catch(_0x21841f){return BPromise[_0x7e95('0x24')](_0x21841f);}return _0x21e026[_0x7e95('0x25')]();};}function saveUpdates(_0x384be0,_0x270d9b){return function(_0x5003aa){if(_0x5003aa){return _0x5003aa[_0x7e95('0x26')](_0x384be0)[_0x7e95('0x27')](function(_0x55d5c7){return _0x55d5c7;});}return null;};}function removeEntity(_0x4f2141,_0x2f4efe){return function(_0x376394){if(_0x376394){return _0x376394[_0x7e95('0x28')]()['then'](function(){_0x4f2141[_0x7e95('0x1a')](0xcc)[_0x7e95('0x1b')]();});}};}function handleEntityNotFound(_0x5d6262,_0xe05233){return function(_0x4f94cb){if(!_0x4f94cb){_0x5d6262['sendStatus'](0x194);}return _0x4f94cb;};}function handleError(_0x530135,_0x303d3d){_0x303d3d=_0x303d3d||0x1f4;return function(_0x4bbd9e){logger['error'](_0x4bbd9e[_0x7e95('0x29')]);if(_0x4bbd9e[_0x7e95('0x2a')]){delete _0x4bbd9e[_0x7e95('0x2a')];}_0x530135[_0x7e95('0x1a')](_0x303d3d)['send'](_0x4bbd9e);};}exports[_0x7e95('0x2b')]=function(_0x1ab039,_0x41f4c3){var _0x21ec0f={},_0x373743={},_0x3fb476={'count':0x0,'rows':[]};var _0x313fae=_[_0x7e95('0x2c')](db['SmsApplication'][_0x7e95('0x2d')],function(_0x5a0d6c){return{'name':_0x5a0d6c['fieldName'],'type':_0x5a0d6c[_0x7e95('0x2e')][_0x7e95('0x2f')]};});_0x373743[_0x7e95('0x30')]=_[_0x7e95('0x2c')](_0x313fae,_0x7e95('0x2a'));_0x373743[_0x7e95('0x31')]=_['keys'](_0x1ab039[_0x7e95('0x31')]);_0x373743[_0x7e95('0x32')]=_[_0x7e95('0x33')](_0x373743[_0x7e95('0x30')],_0x373743['query']);_0x21ec0f[_0x7e95('0x34')]=_[_0x7e95('0x33')](_0x373743['model'],qs[_0x7e95('0x35')](_0x1ab039[_0x7e95('0x31')][_0x7e95('0x35')]));_0x21ec0f[_0x7e95('0x34')]=_0x21ec0f[_0x7e95('0x34')][_0x7e95('0x36')]?_0x21ec0f['attributes']:_0x373743[_0x7e95('0x30')];if(!_0x1ab039[_0x7e95('0x31')][_0x7e95('0x37')](_0x7e95('0x38'))){_0x21ec0f[_0x7e95('0x20')]=qs[_0x7e95('0x20')](_0x1ab039['query'][_0x7e95('0x20')]);_0x21ec0f[_0x7e95('0x1f')]=qs[_0x7e95('0x1f')](_0x1ab039[_0x7e95('0x31')]['offset']);}_0x21ec0f[_0x7e95('0x39')]=qs[_0x7e95('0x3a')](_0x1ab039[_0x7e95('0x31')][_0x7e95('0x3a')]);_0x21ec0f[_0x7e95('0x3b')]=qs[_0x7e95('0x32')](_['pick'](_0x1ab039[_0x7e95('0x31')],_0x373743[_0x7e95('0x32')]),_0x313fae);if(_0x1ab039[_0x7e95('0x31')][_0x7e95('0x3c')]){_0x21ec0f[_0x7e95('0x3b')]=_[_0x7e95('0x3d')](_0x21ec0f[_0x7e95('0x3b')],{'$or':_[_0x7e95('0x2c')](_0x313fae,function(_0x1529e4){if(_0x1529e4[_0x7e95('0x2e')]!=='VIRTUAL'){var _0x348ad1={};_0x348ad1[_0x1529e4[_0x7e95('0x2a')]]={'$like':'%'+_0x1ab039[_0x7e95('0x31')][_0x7e95('0x3c')]+'%'};return _0x348ad1;}})});}_0x21ec0f=_[_0x7e95('0x3d')]({},_0x21ec0f,_0x1ab039['options']);var _0x34251a={'where':_0x21ec0f[_0x7e95('0x3b')]};return db[_0x7e95('0x3e')]['count'](_0x34251a)['then'](function(_0x56a592){_0x3fb476[_0x7e95('0x1e')]=_0x56a592;if(_0x1ab039['query'][_0x7e95('0x3f')]){_0x21ec0f[_0x7e95('0x40')]=[{'all':!![]}];}return db[_0x7e95('0x3e')][_0x7e95('0x41')](_0x21ec0f);})[_0x7e95('0x27')](function(_0x4b2b9a){_0x3fb476[_0x7e95('0x42')]=_0x4b2b9a;return _0x3fb476;})[_0x7e95('0x27')](respondWithFilteredResult(_0x41f4c3,_0x21ec0f))['catch'](handleError(_0x41f4c3,null));};exports[_0x7e95('0x43')]=function(_0x21a47f,_0x155d74){var _0x524903={'raw':!![],'where':{'id':_0x21a47f[_0x7e95('0x44')]['id']}},_0x3dbc11={};_0x3dbc11['model']=_['keys'](db[_0x7e95('0x3e')][_0x7e95('0x2d')]);_0x3dbc11[_0x7e95('0x31')]=_[_0x7e95('0x45')](_0x21a47f[_0x7e95('0x31')]);_0x3dbc11[_0x7e95('0x32')]=_[_0x7e95('0x33')](_0x3dbc11[_0x7e95('0x30')],_0x3dbc11[_0x7e95('0x31')]);_0x524903[_0x7e95('0x34')]=_[_0x7e95('0x33')](_0x3dbc11[_0x7e95('0x30')],qs[_0x7e95('0x35')](_0x21a47f['query'][_0x7e95('0x35')]));_0x524903[_0x7e95('0x34')]=_0x524903[_0x7e95('0x34')][_0x7e95('0x36')]?_0x524903[_0x7e95('0x34')]:_0x3dbc11[_0x7e95('0x30')];if(_0x21a47f[_0x7e95('0x31')][_0x7e95('0x3f')]){_0x524903['include']=[{'all':!![]}];}_0x524903=_[_0x7e95('0x3d')]({},_0x524903,_0x21a47f[_0x7e95('0x46')]);return db[_0x7e95('0x3e')][_0x7e95('0x47')](_0x524903)[_0x7e95('0x27')](handleEntityNotFound(_0x155d74,null))['then'](respondWithResult(_0x155d74,null))[_0x7e95('0x48')](handleError(_0x155d74,null));};exports[_0x7e95('0x49')]=function(_0x3aceae,_0x2a9a83){return db[_0x7e95('0x3e')]['create'](_0x3aceae[_0x7e95('0x4a')],{})['then'](respondWithResult(_0x2a9a83,0xc9))[_0x7e95('0x48')](handleError(_0x2a9a83,null));};exports[_0x7e95('0x26')]=function(_0x30fb0e,_0x9212ed){if(_0x30fb0e['body']['id']){delete _0x30fb0e['body']['id'];}return db[_0x7e95('0x3e')]['find']({'where':{'id':_0x30fb0e[_0x7e95('0x44')]['id']}})['then'](handleEntityNotFound(_0x9212ed,null))['then'](saveUpdates(_0x30fb0e['body'],null))[_0x7e95('0x27')](respondWithResult(_0x9212ed,null))[_0x7e95('0x48')](handleError(_0x9212ed,null));};exports['destroy']=function(_0x5b5bbd,_0x1688a0){return db[_0x7e95('0x3e')][_0x7e95('0x47')]({'where':{'id':_0x5b5bbd[_0x7e95('0x44')]['id']}})[_0x7e95('0x27')](handleEntityNotFound(_0x1688a0,null))[_0x7e95('0x27')](removeEntity(_0x1688a0,null))[_0x7e95('0x48')](handleError(_0x1688a0,null));}; \ No newline at end of file +var _0x0182=['squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','update','then','destroy','end','error','stack','name','index','map','SmsApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','find','create','params','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash'];(function(_0x3fd073,_0x32931f){var _0x40d7b1=function(_0x379467){while(--_0x379467){_0x3fd073['push'](_0x3fd073['shift']());}};_0x40d7b1(++_0x32931f);}(_0x0182,0x7d));var _0x2018=function(_0x23895f,_0x43e4a9){_0x23895f=_0x23895f-0x0;var _0x39cfc9=_0x0182[_0x23895f];return _0x39cfc9;};'use strict';var emlformat=require(_0x2018('0x0'));var rimraf=require(_0x2018('0x1'));var zipdir=require(_0x2018('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2018('0x3'));var moment=require('moment');var BPromise=require(_0x2018('0x4'));var Mustache=require(_0x2018('0x5'));var util=require('util');var path=require(_0x2018('0x6'));var sox=require(_0x2018('0x7'));var csv=require(_0x2018('0x8'));var ejs=require(_0x2018('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2018('0xa'));var squel=require(_0x2018('0xb'));var crypto=require('crypto');var jsforce=require(_0x2018('0xc'));var deskjs=require(_0x2018('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2018('0xe'));var Redis=require('ioredis');var authService=require(_0x2018('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2018('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2018('0x11'));var config=require(_0x2018('0x12'));var licenseUtil=require(_0x2018('0x13'));var db=require(_0x2018('0x14'))['db'];function respondWithStatusCode(_0x41dc03,_0x31645c){_0x31645c=_0x31645c||0xcc;return function(_0xe9a0){if(_0xe9a0){return _0x41dc03[_0x2018('0x15')](_0x31645c);}return _0x41dc03['status'](_0x31645c)['end']();};}function respondWithResult(_0x472ea1,_0x3e1575){_0x3e1575=_0x3e1575||0xc8;return function(_0x8dc48e){if(_0x8dc48e){return _0x472ea1[_0x2018('0x16')](_0x3e1575)['json'](_0x8dc48e);}};}function respondWithFilteredResult(_0x39001e,_0x51c8eb){return function(_0x2b0ccf){if(_0x2b0ccf){var _0x36d72a=typeof _0x51c8eb[_0x2018('0x17')]===_0x2018('0x18')&&typeof _0x51c8eb['limit']==='undefined';var _0x812c49=_0x2b0ccf[_0x2018('0x19')];var _0x493489=_0x36d72a?0x0:_0x51c8eb['offset'];var _0x1e191a=_0x36d72a?_0x2b0ccf[_0x2018('0x19')]:_0x51c8eb[_0x2018('0x17')]+_0x51c8eb[_0x2018('0x1a')];var _0x3dc661;if(_0x1e191a>=_0x812c49){_0x1e191a=_0x812c49;_0x3dc661=0xc8;}else{_0x3dc661=0xce;}_0x39001e['status'](_0x3dc661);return _0x39001e['set'](_0x2018('0x1b'),_0x493489+'-'+_0x1e191a+'/'+_0x812c49)[_0x2018('0x1c')](_0x2b0ccf);}return null;};}function patchUpdates(_0x3561b1){return function(_0x340325){try{jsonpatch[_0x2018('0x1d')](_0x340325,_0x3561b1,!![]);}catch(_0x3114a7){return BPromise['reject'](_0x3114a7);}return _0x340325['save']();};}function saveUpdates(_0x401106,_0x225ed9){return function(_0xfd98a5){if(_0xfd98a5){return _0xfd98a5[_0x2018('0x1e')](_0x401106)[_0x2018('0x1f')](function(_0x7996fe){return _0x7996fe;});}return null;};}function removeEntity(_0x4cf11e,_0x12cee1){return function(_0x573d5c){if(_0x573d5c){return _0x573d5c[_0x2018('0x20')]()['then'](function(){_0x4cf11e[_0x2018('0x16')](0xcc)[_0x2018('0x21')]();});}};}function handleEntityNotFound(_0x1100c9,_0x1c35d5){return function(_0x4e6fd8){if(!_0x4e6fd8){_0x1100c9[_0x2018('0x15')](0x194);}return _0x4e6fd8;};}function handleError(_0x4da453,_0x3c99b8){_0x3c99b8=_0x3c99b8||0x1f4;return function(_0x2abd53){logger[_0x2018('0x22')](_0x2abd53[_0x2018('0x23')]);if(_0x2abd53[_0x2018('0x24')]){delete _0x2abd53['name'];}_0x4da453['status'](_0x3c99b8)['send'](_0x2abd53);};}exports[_0x2018('0x25')]=function(_0x1e921f,_0x51088b){var _0x5c65fc={},_0x49d889={},_0x424138={'count':0x0,'rows':[]};var _0x516773=_[_0x2018('0x26')](db[_0x2018('0x27')][_0x2018('0x28')],function(_0x35d6fa){return{'name':_0x35d6fa[_0x2018('0x29')],'type':_0x35d6fa[_0x2018('0x2a')]['key']};});_0x49d889[_0x2018('0x2b')]=_['map'](_0x516773,_0x2018('0x24'));_0x49d889[_0x2018('0x2c')]=_[_0x2018('0x2d')](_0x1e921f[_0x2018('0x2c')]);_0x49d889[_0x2018('0x2e')]=_[_0x2018('0x2f')](_0x49d889[_0x2018('0x2b')],_0x49d889[_0x2018('0x2c')]);_0x5c65fc[_0x2018('0x30')]=_['intersection'](_0x49d889[_0x2018('0x2b')],qs[_0x2018('0x31')](_0x1e921f[_0x2018('0x2c')][_0x2018('0x31')]));_0x5c65fc[_0x2018('0x30')]=_0x5c65fc['attributes'][_0x2018('0x32')]?_0x5c65fc[_0x2018('0x30')]:_0x49d889[_0x2018('0x2b')];if(!_0x1e921f['query'][_0x2018('0x33')](_0x2018('0x34'))){_0x5c65fc['limit']=qs[_0x2018('0x1a')](_0x1e921f['query'][_0x2018('0x1a')]);_0x5c65fc['offset']=qs[_0x2018('0x17')](_0x1e921f[_0x2018('0x2c')][_0x2018('0x17')]);}_0x5c65fc['order']=qs['sort'](_0x1e921f['query'][_0x2018('0x35')]);_0x5c65fc[_0x2018('0x36')]=qs[_0x2018('0x2e')](_[_0x2018('0x37')](_0x1e921f['query'],_0x49d889[_0x2018('0x2e')]),_0x516773);if(_0x1e921f[_0x2018('0x2c')][_0x2018('0x38')]){_0x5c65fc[_0x2018('0x36')]=_[_0x2018('0x39')](_0x5c65fc[_0x2018('0x36')],{'$or':_[_0x2018('0x26')](_0x516773,function(_0x159b0e){if(_0x159b0e[_0x2018('0x2a')]!==_0x2018('0x3a')){var _0x164f1a={};_0x164f1a[_0x159b0e['name']]={'$like':'%'+_0x1e921f[_0x2018('0x2c')][_0x2018('0x38')]+'%'};return _0x164f1a;}})});}_0x5c65fc=_['merge']({},_0x5c65fc,_0x1e921f[_0x2018('0x3b')]);var _0xf60a72={'where':_0x5c65fc[_0x2018('0x36')]};return db[_0x2018('0x27')][_0x2018('0x19')](_0xf60a72)[_0x2018('0x1f')](function(_0x11e6a6){_0x424138['count']=_0x11e6a6;if(_0x1e921f[_0x2018('0x2c')][_0x2018('0x3c')]){_0x5c65fc[_0x2018('0x3d')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x5c65fc);})[_0x2018('0x1f')](function(_0x53ad6b){_0x424138[_0x2018('0x3e')]=_0x53ad6b;return _0x424138;})[_0x2018('0x1f')](respondWithFilteredResult(_0x51088b,_0x5c65fc))[_0x2018('0x3f')](handleError(_0x51088b,null));};exports['show']=function(_0x144482,_0x2fe93b){var _0x4e4f77={'raw':!![],'where':{'id':_0x144482['params']['id']}},_0x356e48={};_0x356e48['model']=_[_0x2018('0x2d')](db[_0x2018('0x27')][_0x2018('0x28')]);_0x356e48[_0x2018('0x2c')]=_[_0x2018('0x2d')](_0x144482['query']);_0x356e48['filters']=_[_0x2018('0x2f')](_0x356e48[_0x2018('0x2b')],_0x356e48['query']);_0x4e4f77[_0x2018('0x30')]=_[_0x2018('0x2f')](_0x356e48[_0x2018('0x2b')],qs[_0x2018('0x31')](_0x144482[_0x2018('0x2c')]['fields']));_0x4e4f77[_0x2018('0x30')]=_0x4e4f77['attributes'][_0x2018('0x32')]?_0x4e4f77['attributes']:_0x356e48[_0x2018('0x2b')];if(_0x144482[_0x2018('0x2c')][_0x2018('0x3c')]){_0x4e4f77[_0x2018('0x3d')]=[{'all':!![]}];}_0x4e4f77=_['merge']({},_0x4e4f77,_0x144482[_0x2018('0x3b')]);return db['SmsApplication'][_0x2018('0x40')](_0x4e4f77)[_0x2018('0x1f')](handleEntityNotFound(_0x2fe93b,null))[_0x2018('0x1f')](respondWithResult(_0x2fe93b,null))[_0x2018('0x3f')](handleError(_0x2fe93b,null));};exports['create']=function(_0x5600b2,_0xb81595){return db[_0x2018('0x27')][_0x2018('0x41')](_0x5600b2['body'],{})[_0x2018('0x1f')](respondWithResult(_0xb81595,0xc9))['catch'](handleError(_0xb81595,null));};exports['update']=function(_0x224f2c,_0x1e4f00){if(_0x224f2c['body']['id']){delete _0x224f2c['body']['id'];}return db[_0x2018('0x27')][_0x2018('0x40')]({'where':{'id':_0x224f2c[_0x2018('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e4f00,null))[_0x2018('0x1f')](saveUpdates(_0x224f2c[_0x2018('0x43')],null))['then'](respondWithResult(_0x1e4f00,null))[_0x2018('0x3f')](handleError(_0x1e4f00,null));};exports[_0x2018('0x20')]=function(_0x84aae8,_0x1ab90a){return db[_0x2018('0x27')][_0x2018('0x40')]({'where':{'id':_0x84aae8['params']['id']}})[_0x2018('0x1f')](handleEntityNotFound(_0x1ab90a,null))['then'](removeEntity(_0x1ab90a,null))[_0x2018('0x3f')](handleError(_0x1ab90a,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index aea63c4..5ded373 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 _0x438d=['utf8mb4_unicode_ci','lodash','bluebird','request-promise','path','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4'];(function(_0xc38ae4,_0x1fb505){var _0x2661fc=function(_0xf81253){while(--_0xf81253){_0xc38ae4['push'](_0xc38ae4['shift']());}};_0x2661fc(++_0x1fb505);}(_0x438d,0x161));var _0xd438=function(_0x31c0d2,_0x3f0c53){_0x31c0d2=_0x31c0d2-0x0;var _0xf003dd=_0x438d[_0x31c0d2];return _0xf003dd;};'use strict';var _=require(_0xd438('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd438('0x1'));var rp=require(_0xd438('0x2'));var fs=require('fs');var path=require(_0xd438('0x3'));var rimraf=require('rimraf');var config=require(_0xd438('0x4'));var attributes=require(_0xd438('0x5'));module['exports']=function(_0x3a3e3d,_0x222f12){return _0x3a3e3d[_0xd438('0x6')](_0xd438('0x7'),attributes,{'tableName':_0xd438('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd438('0x9'),'collate':_0xd438('0xa')});}; \ No newline at end of file +var _0x44ca=['path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x44ca,0xe6));var _0xa44c=function(_0xb6a965,_0x5c5ace){_0xb6a965=_0xb6a965-0x0;var _0x51d37d=_0x44ca[_0xb6a965];return _0x51d37d;};'use strict';var _=require(_0xa44c('0x0'));var util=require(_0xa44c('0x1'));var logger=require(_0xa44c('0x2'))('api');var moment=require(_0xa44c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa44c('0x4'));var rimraf=require(_0xa44c('0x5'));var config=require(_0xa44c('0x6'));var attributes=require(_0xa44c('0x7'));module[_0xa44c('0x8')]=function(_0x4c69ba,_0x214fca){return _0x4c69ba[_0xa44c('0x9')](_0xa44c('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa44c('0xb'),'collate':_0xa44c('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index bc25e72..065cf5b 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 _0x32b6=['SmsApplication,\x20%s,\x20%s','message','info','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code'];(function(_0x1cdff2,_0x40b29d){var _0x51c9c2=function(_0x1edf98){while(--_0x1edf98){_0x1cdff2['push'](_0x1cdff2['shift']());}};_0x51c9c2(++_0x40b29d);}(_0x32b6,0x1d1));var _0x632b=function(_0x171789,_0x36ca18){_0x171789=_0x171789-0x0;var _0x1d81ac=_0x32b6[_0x171789];return _0x1d81ac;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('SmsApplication,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('SmsApplication,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});} \ No newline at end of file +var _0xd506=['catch','lodash','../../config/logger','client','http','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','code','error','message'];(function(_0x506c10,_0x4e7b53){var _0x4c91c4=function(_0x1b8860){while(--_0x1b8860){_0x506c10['push'](_0x506c10['shift']());}};_0x4c91c4(++_0x4e7b53);}(_0xd506,0x197));var _0x6d50=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd506[_0x432682];return _0x463d05;};'use strict';var _=require(_0x6d50('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6d50('0x1'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6d50('0x2')][_0x6d50('0x3')]({'port':0x232a});function respondWithRpcPromise(_0x1b0af3,_0x4cf512,_0x9565b6){return new BPromise(function(_0xce67b6,_0x2dacde){return client['request'](_0x1b0af3,_0x9565b6)[_0x6d50('0x4')](function(_0x5012ed){logger[_0x6d50('0x5')](_0x6d50('0x6'),_0x4cf512,_0x6d50('0x7'));logger[_0x6d50('0x8')](_0x6d50('0x9'),_0x4cf512,_0x6d50('0x7'),JSON['stringify'](_0x5012ed));if(_0x5012ed['error']){if(_0x5012ed['error'][_0x6d50('0xa')]===0x1f4){logger[_0x6d50('0xb')](_0x6d50('0x6'),_0x4cf512,_0x5012ed[_0x6d50('0xb')]['message']);return _0x2dacde(_0x5012ed[_0x6d50('0xb')]['message']);}logger[_0x6d50('0xb')]('SmsApplication,\x20%s,\x20%s',_0x4cf512,_0x5012ed['error']['message']);return _0xce67b6(_0x5012ed[_0x6d50('0xb')]['message']);}else{logger[_0x6d50('0x5')](_0x6d50('0x6'),_0x4cf512,'request\x20sent');_0xce67b6(_0x5012ed['result'][_0x6d50('0xc')]);}})[_0x6d50('0xd')](function(_0x38068e){logger['error'](_0x6d50('0x6'),_0x4cf512,_0x38068e);_0x2dacde(_0x38068e);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index ad9a1e7..947caf3 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 _0xefda=['../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','/:id','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','sms','addTags','put','smsinteraction:update','update','smsinteraction:destroy','destroy','removeTags','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3c865a,_0x31f6f4){var _0x564da2=function(_0x33f8e4){while(--_0x33f8e4){_0x3c865a['push'](_0x3c865a['shift']());}};_0x564da2(++_0x31f6f4);}(_0xefda,0x96));var _0xaefd=function(_0x1c7d23,_0x3e5209){_0x1c7d23=_0x1c7d23-0x0;var _0x5b0127=_0xefda[_0x1c7d23];return _0x5b0127;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['describe']);router[_0xaefd('0x8')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),controller['show']);router['get']('/:id/messages',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router[_0xaefd('0x8')](_0xaefd('0xe'),auth[_0xaefd('0xb')](),controller[_0xaefd('0xf')]);router[_0xaefd('0x10')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0x11')]);router[_0xaefd('0x10')](_0xaefd('0x12'),auth['isAuthenticated'](),controller[_0xaefd('0x13')]);router['post'](_0xaefd('0x14'),auth[_0xaefd('0xb')](),interaction[_0xaefd('0x15')](_0xaefd('0x16'),'smsinteraction:addtags'),controller[_0xaefd('0x17')]);router[_0xaefd('0x18')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),interaction[_0xaefd('0x15')](_0xaefd('0x16'),_0xaefd('0x19')),controller[_0xaefd('0x1a')]);router['delete'](_0xaefd('0xc'),auth[_0xaefd('0xb')](),interaction[_0xaefd('0x15')](_0xaefd('0x16'),_0xaefd('0x1b')),controller[_0xaefd('0x1c')]);router['delete'](_0xaefd('0x14'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x1d')]);module[_0xaefd('0x1e')]=router; \ No newline at end of file +var _0xf7b4=['/describe','describe','/:id','show','getMessages','/:id/download','post','/:id/messages','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index'];(function(_0x2e535d,_0x1365c1){var _0x3e8891=function(_0x2f088a){while(--_0x2f088a){_0x2e535d['push'](_0x2e535d['shift']());}};_0x3e8891(++_0x1365c1);}(_0xf7b4,0x152));var _0x4f7b=function(_0x2f1823,_0x2ab6e5){_0x2f1823=_0x2f1823-0x0;var _0x544f66=_0xf7b4[_0x2f1823];return _0x544f66;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f7b('0x3'));var interaction=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var controller=require(_0x4f7b('0x6'));router[_0x4f7b('0x7')]('/',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x9')]);router[_0x4f7b('0x7')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xb')]);router[_0x4f7b('0x7')](_0x4f7b('0xc'),auth['isAuthenticated'](),controller[_0x4f7b('0xd')]);router[_0x4f7b('0x7')]('/:id/messages',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0x7')](_0x4f7b('0xf'),auth[_0x4f7b('0x8')](),controller['download']);router[_0x4f7b('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f7b('0x10')](_0x4f7b('0x11'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x12')]);router['post'](_0x4f7b('0x13'),auth[_0x4f7b('0x8')](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),_0x4f7b('0x16')),controller[_0x4f7b('0x17')]);router[_0x4f7b('0x18')](_0x4f7b('0xc'),auth[_0x4f7b('0x8')](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),_0x4f7b('0x19')),controller['update']);router[_0x4f7b('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),'smsinteraction:destroy'),controller[_0x4f7b('0x1b')]);router[_0x4f7b('0x1a')](_0x4f7b('0x13'),auth[_0x4f7b('0x8')](),controller['removeTags']);module[_0x4f7b('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 6dbccc0..c6a4492 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 _0x9a1b=['INTEGER','sequelize','DATE','STRING','out','ENUM','BOOLEAN'];(function(_0x3ecacd,_0x3d420f){var _0x226f61=function(_0x3be493){while(--_0x3be493){_0x3ecacd['push'](_0x3ecacd['shift']());}};_0x226f61(++_0x3d420f);}(_0x9a1b,0x1ba));var _0xb9a1=function(_0x5ccf7a,_0x420f79){_0x5ccf7a=_0x5ccf7a-0x0;var _0x3397df=_0x9a1b[_0x5ccf7a];return _0x3397df;};'use strict';var Sequelize=require(_0xb9a1('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb9a1('0x1')]},'disposition':{'type':Sequelize[_0xb9a1('0x2')]},'secondDisposition':{'type':Sequelize[_0xb9a1('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb9a1('0x2')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xb9a1('0x2')]},'read1stAt':{'type':Sequelize[_0xb9a1('0x1')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xb9a1('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb9a1('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xb9a1('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb9a1('0x5')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xb9a1('0x6')]}}; \ No newline at end of file +var _0x1c63=['DATE','ENUM','out','INTEGER','sequelize','moment','exports','BOOLEAN','STRING'];(function(_0x398676,_0xbb2c3e){var _0x18ac21=function(_0x5081cb){while(--_0x5081cb){_0x398676['push'](_0x398676['shift']());}};_0x18ac21(++_0xbb2c3e);}(_0x1c63,0xdc));var _0x31c6=function(_0x420745,_0x1a6314){_0x420745=_0x420745-0x0;var _0x153a1a=_0x1c63[_0x420745];return _0x153a1a;};'use strict';var Sequelize=require(_0x31c6('0x0'));var moment=require(_0x31c6('0x1'));module[_0x31c6('0x2')]={'closed':{'type':Sequelize[_0x31c6('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x31c6('0x4')]},'secondDisposition':{'type':Sequelize[_0x31c6('0x4')]},'thirdDisposition':{'type':Sequelize[_0x31c6('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x31c6('0x4')]},'read1stAt':{'type':Sequelize[_0x31c6('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x31c6('0x6')]('in',_0x31c6('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x31c6('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x31c6('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x31c6('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 5ef4b60..6e42a3c 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 _0xa61e=['lastName','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','then','destroy','stack','name','send','index','map','fieldName','type','key','getOptions','findAll','sms','query','catch','show','params','keys','SmsInteraction','rawAttributes','filters','model','intersection','fields','attributes','length','includeAll','include','merge','body','find','describe','addMessage','ids','getMessages','findOne','SmsMessage','hasOwnProperty','nolimit','order','sort','where','pick','SmsInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','toString','join','root','server','tmp','format','transcript-%d-%s.zip','User','fullname','push','Contact','Messages','createdAt','direction','secret','read','SmsAccount','Owner','get','Sms','Account','N.A.','closed','closedAt','disposition','System','firstName'];(function(_0x45c032,_0x21df23){var _0x1faa28=function(_0x419573){while(--_0x419573){_0x45c032['push'](_0x45c032['shift']());}};_0x1faa28(++_0x21df23);}(_0xa61e,0x103));var _0xea61=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa61e[_0x4fc9e6];return _0x551d28;};'use strict';var rimraf=require(_0xea61('0x0'));var zipdir=require(_0xea61('0x1'));var moment=require(_0xea61('0x2'));var BPromise=require(_0xea61('0x3'));var util=require(_0xea61('0x4'));var path=require(_0xea61('0x5'));var ejs=require(_0xea61('0x6'));var fs=require('fs');var _=require(_0xea61('0x7'));var Redis=require(_0xea61('0x8'));var interaction=require(_0xea61('0x9'));var qs=require(_0xea61('0xa'));var pdf=require(_0xea61('0xb'));var logger=require(_0xea61('0xc'))(_0xea61('0xd'));var config=require(_0xea61('0xe'));var db=require('../../mysqldb')['db'];config[_0xea61('0xf')]=_[_0xea61('0x10')](config[_0xea61('0xf')],{'host':_0xea61('0x11'),'port':0x18eb});var socket=require(_0xea61('0x12'))(new Redis(config[_0xea61('0xf')]));require(_0xea61('0x13'))[_0xea61('0x14')](socket);function respondWithStatusCode(_0x2cdb30,_0x398212){_0x398212=_0x398212||0xcc;return function(_0x4c02bf){if(_0x4c02bf){return _0x2cdb30[_0xea61('0x15')](_0x398212);}return _0x2cdb30[_0xea61('0x16')](_0x398212)[_0xea61('0x17')]();};}function respondWithResult(_0x56e9dd,_0x321cdb){_0x321cdb=_0x321cdb||0xc8;return function(_0x7c3ac8){if(_0x7c3ac8){return _0x56e9dd[_0xea61('0x16')](_0x321cdb)['json'](_0x7c3ac8);}};}function respondWithFilteredResult(_0x18ae4e,_0x45953c){return function(_0x328600){if(_0x328600){var _0x42b1a0=typeof _0x45953c[_0xea61('0x18')]==='undefined'&&typeof _0x45953c['limit']===_0xea61('0x19');var _0x1da1b4=_0x328600[_0xea61('0x1a')];var _0x2c6311=_0x42b1a0?0x0:_0x45953c[_0xea61('0x18')];var _0x233c7c=_0x42b1a0?_0x328600['count']:_0x45953c['offset']+_0x45953c[_0xea61('0x1b')];var _0x346be9;if(_0x233c7c>=_0x1da1b4){_0x233c7c=_0x1da1b4;_0x346be9=0xc8;}else{_0x346be9=0xce;}_0x18ae4e['status'](_0x346be9);return _0x18ae4e['set'](_0xea61('0x1c'),_0x2c6311+'-'+_0x233c7c+'/'+_0x1da1b4)[_0xea61('0x1d')](_0x328600);}return null;};}function saveUpdates(_0x1e7b9b){return function(_0x4a4ef5){if(_0x4a4ef5){return _0x4a4ef5['update'](_0x1e7b9b)[_0xea61('0x1e')](function(_0x56da6d){return _0x56da6d;});}return null;};}function removeEntity(_0x579a3e){return function(_0x5205d8){if(_0x5205d8){return _0x5205d8[_0xea61('0x1f')]()['then'](function(){_0x579a3e[_0xea61('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x183f06){return function(_0x4dad6e){if(!_0x4dad6e){_0x183f06['sendStatus'](0x194);}return _0x4dad6e;};}function handleError(_0x1c3d43,_0x3e399d){_0x3e399d=_0x3e399d||0x1f4;return function(_0x427857){logger['error'](_0x427857[_0xea61('0x20')]);if(_0x427857[_0xea61('0x21')]){delete _0x427857[_0xea61('0x21')];}_0x1c3d43[_0xea61('0x16')](_0x3e399d)[_0xea61('0x22')](_0x427857);};}exports[_0xea61('0x23')]=function(_0xd464bf,_0x3a5a1d){var _0x1465f7={};var _0x4b219f=_[_0xea61('0x24')](db['SmsInteraction']['rawAttributes'],function(_0x6f0275){return{'name':_0x6f0275[_0xea61('0x25')],'type':_0x6f0275[_0xea61('0x26')][_0xea61('0x27')]};});_0x1465f7=qs[_0xea61('0x28')](_0x4b219f,_0xd464bf);return interaction[_0xea61('0x29')](_0xea61('0x2a'),_0xd464bf[_0xea61('0x2b')],_0xd464bf['user'],_0x1465f7,_0x4b219f)['then'](respondWithFilteredResult(_0x3a5a1d,_0x1465f7))[_0xea61('0x2c')](handleError(_0x3a5a1d,null));};exports[_0xea61('0x2d')]=function(_0x5c481b,_0x4316b3){var _0x742c38={'raw':![],'where':{'id':_0x5c481b[_0xea61('0x2e')]['id']}},_0x5394d7={};_0x5394d7['model']=_[_0xea61('0x2f')](db[_0xea61('0x30')][_0xea61('0x31')]);_0x5394d7[_0xea61('0x2b')]=_[_0xea61('0x2f')](_0x5c481b[_0xea61('0x2b')]);_0x5394d7[_0xea61('0x32')]=_['intersection'](_0x5394d7[_0xea61('0x33')],_0x5394d7['query']);_0x742c38['attributes']=_[_0xea61('0x34')](_0x5394d7[_0xea61('0x33')],qs[_0xea61('0x35')](_0x5c481b['query'][_0xea61('0x35')]));_0x742c38[_0xea61('0x36')]=_0x742c38['attributes'][_0xea61('0x37')]?_0x742c38[_0xea61('0x36')]:_0x5394d7[_0xea61('0x33')];if(_0x5c481b['query'][_0xea61('0x38')]){_0x742c38[_0xea61('0x39')]=[{'all':!![]}];}_0x742c38=_[_0xea61('0x3a')]({},_0x742c38,_0x5c481b['options']);return db[_0xea61('0x30')]['find'](_0x742c38)[_0xea61('0x1e')](handleEntityNotFound(_0x4316b3,null))[_0xea61('0x1e')](respondWithResult(_0x4316b3,null))[_0xea61('0x2c')](handleError(_0x4316b3,null));};exports['create']=function(_0x351b46,_0x2b5118){return db['SmsInteraction']['create'](_0x351b46['body'],{})[_0xea61('0x1e')](respondWithResult(_0x2b5118,0xc9))['catch'](handleError(_0x2b5118,null));};exports['update']=function(_0x378e32,_0x440854){if(_0x378e32['body']['id']){delete _0x378e32[_0xea61('0x3b')]['id'];}return db[_0xea61('0x30')][_0xea61('0x3c')]({'where':{'id':_0x378e32[_0xea61('0x2e')]['id']}})[_0xea61('0x1e')](handleEntityNotFound(_0x440854,null))[_0xea61('0x1e')](saveUpdates(_0x378e32[_0xea61('0x3b')],null))[_0xea61('0x1e')](respondWithResult(_0x440854,null))[_0xea61('0x2c')](handleError(_0x440854,null));};exports[_0xea61('0x1f')]=function(_0x3c87d2,_0x6481a5){return db['SmsInteraction'][_0xea61('0x3c')]({'where':{'id':_0x3c87d2[_0xea61('0x2e')]['id']}})[_0xea61('0x1e')](handleEntityNotFound(_0x6481a5,null))[_0xea61('0x1e')](removeEntity(_0x6481a5,null))[_0xea61('0x2c')](handleError(_0x6481a5,null));};exports[_0xea61('0x3d')]=function(_0x30db4b,_0x4090e8){return db['SmsInteraction'][_0xea61('0x3d')]()[_0xea61('0x1e')](respondWithResult(_0x4090e8,null))[_0xea61('0x2c')](handleError(_0x4090e8,null));};exports[_0xea61('0x3e')]=function(_0x428649,_0x272434){return db['SmsMessage'][_0xea61('0x3c')]({'where':{'id':_0x428649['params']['id']}})[_0xea61('0x1e')](handleEntityNotFound(_0x272434,null))[_0xea61('0x1e')](function(_0x47b36e){if(_0x47b36e){return _0x47b36e[_0xea61('0x3e')](_0x428649[_0xea61('0x3b')][_0xea61('0x3f')],_['omit'](_0x428649[_0xea61('0x3b')],[_0xea61('0x3f'),'id'])||{});}})[_0xea61('0x1e')](respondWithResult(_0x272434,null))['catch'](handleError(_0x272434,null));};exports[_0xea61('0x40')]=function(_0x3a3fe7,_0x4d148a){var _0x5c706a={'raw':![],'where':{}};var _0x11c69c={};var _0x2994ff={'count':0x0,'rows':[]};return db[_0xea61('0x30')][_0xea61('0x41')]({'where':{'id':_0x3a3fe7[_0xea61('0x2e')]['id']}})[_0xea61('0x1e')](handleEntityNotFound(_0x4d148a,null))[_0xea61('0x1e')](function(_0x484c34){if(_0x484c34){_0x11c69c[_0xea61('0x33')]=_[_0xea61('0x2f')](db[_0xea61('0x42')][_0xea61('0x31')]);_0x11c69c[_0xea61('0x2b')]=_[_0xea61('0x2f')](_0x3a3fe7[_0xea61('0x2b')]);_0x11c69c[_0xea61('0x32')]=_[_0xea61('0x34')](_0x11c69c[_0xea61('0x33')],_0x11c69c[_0xea61('0x2b')]);_0x5c706a['attributes']=_[_0xea61('0x34')](_0x11c69c['model'],qs[_0xea61('0x35')](_0x3a3fe7[_0xea61('0x2b')][_0xea61('0x35')]));_0x5c706a[_0xea61('0x36')]=_0x5c706a[_0xea61('0x36')][_0xea61('0x37')]?_0x5c706a['attributes']:_0x11c69c[_0xea61('0x33')];if(!_0x3a3fe7[_0xea61('0x2b')][_0xea61('0x43')](_0xea61('0x44'))){_0x5c706a[_0xea61('0x1b')]=qs['limit'](_0x3a3fe7[_0xea61('0x2b')][_0xea61('0x1b')]);_0x5c706a[_0xea61('0x18')]=qs['offset'](_0x3a3fe7[_0xea61('0x2b')][_0xea61('0x18')]);}_0x5c706a[_0xea61('0x45')]=qs[_0xea61('0x46')](_0x3a3fe7[_0xea61('0x2b')][_0xea61('0x46')]);_0x5c706a[_0xea61('0x47')]=qs['filters'](_[_0xea61('0x48')](_0x3a3fe7[_0xea61('0x2b')],_0x11c69c[_0xea61('0x32')]));_0x5c706a['where'][_0xea61('0x49')]=_0x484c34['id'];if(_0x3a3fe7[_0xea61('0x2b')]['filter']){_0x5c706a['where']=_['merge'](_0x5c706a[_0xea61('0x47')],{'$or':_[_0xea61('0x24')](_0x5c706a[_0xea61('0x36')],function(_0x1b7bf4){var _0xbcda99={};_0xbcda99[_0x1b7bf4]={'$like':'%'+_0x3a3fe7[_0xea61('0x2b')][_0xea61('0x4a')]+'%'};return _0xbcda99;})});}if(_0x3a3fe7[_0xea61('0x2b')][_0xea61('0x4b')]){var _0x453df8=_0x3a3fe7[_0xea61('0x2b')][_0xea61('0x4b')][_0xea61('0x4c')](',');var _0x16f2c1={};_0x16f2c1[_0x453df8[0x0]]={'$gte':moment(_0x453df8[0x1])['format'](_0xea61('0x4d'))};_0x5c706a[_0xea61('0x47')]=_[_0xea61('0x3a')](_0x5c706a['where'],_0x16f2c1);}_0x5c706a=_[_0xea61('0x3a')]({},_0x5c706a,_0x3a3fe7['options']);return db[_0xea61('0x42')]['count']({'where':_0x5c706a['where']})[_0xea61('0x1e')](function(_0x1adfd4){_0x2994ff['count']=_0x1adfd4;if(_0x3a3fe7[_0xea61('0x2b')][_0xea61('0x38')]){_0x5c706a[_0xea61('0x39')]=[{'all':!![]}];}return db[_0xea61('0x42')]['findAll'](_0x5c706a);})[_0xea61('0x1e')](function(_0x10c6bd){_0x2994ff[_0xea61('0x4e')]=_0x10c6bd;return _0x2994ff;});}})[_0xea61('0x1e')](respondWithFilteredResult(_0x4d148a,_0x5c706a))['catch'](handleError(_0x4d148a,null));};exports['addTags']=function(_0x59ce26,_0x49a1ed){return db[_0xea61('0x30')][_0xea61('0x3c')]({'where':{'id':_0x59ce26[_0xea61('0x2e')]['id']}})['then'](handleEntityNotFound(_0x49a1ed,null))[_0xea61('0x1e')](function(_0x3e38b8){if(_0x3e38b8){return _0x3e38b8['setTags'](_0x59ce26[_0xea61('0x3b')][_0xea61('0x3f')],_['omit'](_0x59ce26[_0xea61('0x3b')],[_0xea61('0x3f'),'id'])||{})[_0xea61('0x4f')](function(){return db[_0xea61('0x50')][_0xea61('0x29')]({'attributes':['id','name',_0xea61('0x51')],'where':{'id':_0x59ce26[_0xea61('0x3b')][_0xea61('0x3f')]}});})[_0xea61('0x1e')](function(_0x2cd754){socket[_0xea61('0x52')](_0xea61('0x53'),{'id':Number(_0x59ce26[_0xea61('0x2e')]['id']),'tags':_0x2cd754||[]});return{'id':Number(_0x59ce26[_0xea61('0x2e')]['id']),'tags':_0x2cd754||[]};});}})['then'](respondWithResult(_0x49a1ed,null))['catch'](handleError(_0x49a1ed,null));};exports['removeTags']=function(_0x6f060f,_0x1b820f){return db[_0xea61('0x30')][_0xea61('0x3c')]({'where':{'id':_0x6f060f[_0xea61('0x2e')]['id']}})[_0xea61('0x1e')](handleEntityNotFound(_0x1b820f,null))[_0xea61('0x1e')](function(_0x59b0b0){if(_0x59b0b0){return _0x59b0b0[_0xea61('0x54')](_0x6f060f[_0xea61('0x2b')][_0xea61('0x3f')]);}})[_0xea61('0x1e')](respondWithStatusCode(_0x1b820f,null))[_0xea61('0x2c')](handleError(_0x1b820f,null));};exports[_0xea61('0x55')]=function(_0x3fe420,_0x10c288){var _0x1314e9=moment()['unix']()[_0xea61('0x56')]();var _0x5766eb=path[_0xea61('0x57')](config[_0xea61('0x58')],_0xea61('0x59'),'files',_0xea61('0x5a'));var _0x1d1fdd=path[_0xea61('0x57')](_0x5766eb,_0x1314e9);var _0x4126da=util[_0xea61('0x5b')](_0xea61('0x5c'),_0x3fe420[_0xea61('0x2e')]['id'],_0x1314e9);var _0x3ff799=path[_0xea61('0x57')](_0x5766eb,_0x4126da);var _0x5ae7b0=[];_0x5ae7b0['push']({'model':db[_0xea61('0x5d')],'as':_0xea61('0x5d'),'attributes':['id',_0xea61('0x5e')],'raw':!![]});_0x5ae7b0[_0xea61('0x5f')]({'model':db['CmContact'],'as':_0xea61('0x60'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x4b0392=[{'model':db[_0xea61('0x42')],'as':_0xea61('0x61'),'attributes':['id',_0xea61('0x3b'),_0xea61('0x62'),_0xea61('0x63'),_0xea61('0x64'),_0xea61('0x65')],'include':_0x5ae7b0}];_0x4b0392[_0xea61('0x5f')]({'model':db[_0xea61('0x66')],'as':'Account','attributes':['id',_0xea61('0x21')]});_0x4b0392[_0xea61('0x5f')]({'model':db[_0xea61('0x5d')],'as':_0xea61('0x67'),'attributes':['id',_0xea61('0x5e')]});return db['SmsInteraction'][_0xea61('0x3c')]({'where':{'id':_0x3fe420[_0xea61('0x2e')]['id']},'include':_0x4b0392})[_0xea61('0x1e')](handleEntityNotFound(_0x10c288,null))[_0xea61('0x1e')](function(_0x52db90){if(_0x52db90){var _0x3c941c=_0x52db90[_0xea61('0x68')]({'plain':!![]});fs['mkdirSync'](_0x1d1fdd);var _0x4ebfbb={'channel':_0xea61('0x69'),'account':_0x3c941c[_0xea61('0x6a')][_0xea61('0x21')],'agent':_0x3c941c['Owner']?_0x3c941c['Owner'][_0xea61('0x5e')]:_0xea61('0x6b'),'createdAt':moment(_0x3c941c[_0xea61('0x62')])['format'](_0xea61('0x4d'))[_0xea61('0x56')](),'closedAt':_0x3c941c[_0xea61('0x6c')]?moment(_0x3c941c[_0xea61('0x6d')])['format'](_0xea61('0x4d'))[_0xea61('0x56')]():'','disposition':_0x3c941c[_0xea61('0x6e')],'messages':_(_0x3c941c['Messages'])[_0xea61('0x4a')]({'secret':![]})[_0xea61('0x24')](function(_0x940219){return{'date':moment(_0x940219[_0xea61('0x62')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xea61('0x56')](),'sender':_0x940219[_0xea61('0x63')]==='out'?_0x940219[_0xea61('0x5d')]?_0x940219[_0xea61('0x5d')][_0xea61('0x5e')]:_0xea61('0x6f'):_0x940219[_0xea61('0x60')][_0xea61('0x70')]+(_0x940219['Contact'][_0xea61('0x71')]?'\x20'+_0x940219[_0xea61('0x60')]['lastName']:''),'body':_0x940219[_0xea61('0x3b')],'direction':_0x940219[_0xea61('0x63')]===_0xea61('0x72')?'A':'C','secret':_0x940219['secret'],'read':_0x940219[_0xea61('0x65')]};})[_0xea61('0x73')]()};return ejs[_0xea61('0x74')](path['join'](config[_0xea61('0x58')],_0xea61('0x59'),_0xea61('0x75'),_0xea61('0x76')),{'interaction':_0x4ebfbb})[_0xea61('0x1e')](function(_0x1e8694){var _0x4b91a2=path[_0xea61('0x57')](_0x1d1fdd,_0xea61('0x77')+_0x3c941c['id']+'-'+_0x1314e9+_0xea61('0x78'));var _0x12a260={'path':_0x4b91a2,'channel':_0xea61('0x69'),'interactionId':_0x3c941c['id']};return pdf[_0xea61('0x79')](_0x1e8694,_0x12a260);})[_0xea61('0x1e')](function(){return new BPromise(function(_0x301a75,_0x3785f0){zipdir(_0x1d1fdd,{'saveTo':_0x3ff799},function(_0x12dbd2,_0x1909f4){if(_0x12dbd2)return _0x3785f0(_0x12dbd2);return _0x301a75(_0x1909f4);});})['then'](function(){return new BPromise(function(_0x49d10f,_0x488033){rimraf(_0x1d1fdd,function(_0x19b665){if(_0x19b665)_0x488033(_0x19b665);return _0x49d10f();});});})[_0xea61('0x1e')](function(){return _0x10c288[_0xea61('0x55')](_0x3ff799,_0x4126da,function(_0x488d6b){if(_0x488d6b){console['log'](_0xea61('0x7a'),_0x488d6b);}else{fs[_0xea61('0x7b')](_0x3ff799);}});});});}else{return _0x10c288[_0xea61('0x15')](0xc8);}})[_0xea61('0x2c')](handleError(_0x10c288,null));}; \ No newline at end of file +var _0x5dfb=['value','renderFile','views','transcript-','.pdf','Sms','createPdfFromHTML','log','err','unlinkSync','sendStatus','rimraf','moment','bluebird','path','ejs','lodash','../../components/interaction/service','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','status','end','limit','undefined','offset','count','set','Content-Range','update','then','destroy','error','stack','name','index','SmsInteraction','rawAttributes','key','getOptions','query','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','SmsMessage','ids','omit','hasOwnProperty','nolimit','order','sort','where','pick','SmsInteractionId','filter','map','$gte','format','findAll','rows','addTags','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','push','User','lastName','direction','secret','read','Account','Owner','get','mkdirSync','fullname','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','Messages','System','Contact','firstName'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5dfb,0x170));var _0xb5df=function(_0x1b3a72,_0x3a1f98){_0x1b3a72=_0x1b3a72-0x0;var _0x8b247f=_0x5dfb[_0x1b3a72];return _0x8b247f;};'use strict';var rimraf=require(_0xb5df('0x0'));var zipdir=require('zip-dir');var moment=require(_0xb5df('0x1'));var BPromise=require(_0xb5df('0x2'));var util=require('util');var path=require(_0xb5df('0x3'));var ejs=require(_0xb5df('0x4'));var fs=require('fs');var _=require(_0xb5df('0x5'));var Redis=require('ioredis');var interaction=require(_0xb5df('0x6'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0xb5df('0x7'));var config=require(_0xb5df('0x8'));var db=require(_0xb5df('0x9'))['db'];config['redis']=_['defaults'](config[_0xb5df('0xa')],{'host':_0xb5df('0xb'),'port':0x18eb});var socket=require(_0xb5df('0xc'))(new Redis(config[_0xb5df('0xa')]));require(_0xb5df('0xd'))[_0xb5df('0xe')](socket);function respondWithStatusCode(_0x1afe60,_0x43e625){_0x43e625=_0x43e625||0xcc;return function(_0x4fb59d){if(_0x4fb59d){return _0x1afe60['sendStatus'](_0x43e625);}return _0x1afe60[_0xb5df('0xf')](_0x43e625)[_0xb5df('0x10')]();};}function respondWithResult(_0x4d2580,_0x2aaf91){_0x2aaf91=_0x2aaf91||0xc8;return function(_0x5cfbeb){if(_0x5cfbeb){return _0x4d2580[_0xb5df('0xf')](_0x2aaf91)['json'](_0x5cfbeb);}};}function respondWithFilteredResult(_0x56d18b,_0x962d03){return function(_0x57b0c6){if(_0x57b0c6){var _0x40bedc=typeof _0x962d03['offset']==='undefined'&&typeof _0x962d03[_0xb5df('0x11')]===_0xb5df('0x12');var _0x52162d=_0x57b0c6['count'];var _0x41c76e=_0x40bedc?0x0:_0x962d03[_0xb5df('0x13')];var _0x593da7=_0x40bedc?_0x57b0c6[_0xb5df('0x14')]:_0x962d03[_0xb5df('0x13')]+_0x962d03[_0xb5df('0x11')];var _0x54ff4a;if(_0x593da7>=_0x52162d){_0x593da7=_0x52162d;_0x54ff4a=0xc8;}else{_0x54ff4a=0xce;}_0x56d18b[_0xb5df('0xf')](_0x54ff4a);return _0x56d18b[_0xb5df('0x15')](_0xb5df('0x16'),_0x41c76e+'-'+_0x593da7+'/'+_0x52162d)['json'](_0x57b0c6);}return null;};}function saveUpdates(_0x6846f1){return function(_0x124b78){if(_0x124b78){return _0x124b78[_0xb5df('0x17')](_0x6846f1)[_0xb5df('0x18')](function(_0x25e6d9){return _0x25e6d9;});}return null;};}function removeEntity(_0x197231){return function(_0x23de67){if(_0x23de67){return _0x23de67[_0xb5df('0x19')]()[_0xb5df('0x18')](function(){_0x197231['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf1ce85){return function(_0x28d435){if(!_0x28d435){_0xf1ce85['sendStatus'](0x194);}return _0x28d435;};}function handleError(_0x4dd349,_0x5d0831){_0x5d0831=_0x5d0831||0x1f4;return function(_0x12d177){logger[_0xb5df('0x1a')](_0x12d177[_0xb5df('0x1b')]);if(_0x12d177[_0xb5df('0x1c')]){delete _0x12d177['name'];}_0x4dd349[_0xb5df('0xf')](_0x5d0831)['send'](_0x12d177);};}exports[_0xb5df('0x1d')]=function(_0x2536bc,_0x334063){var _0xb73c4a={};var _0x369626=_['map'](db[_0xb5df('0x1e')][_0xb5df('0x1f')],function(_0x169a00){return{'name':_0x169a00['fieldName'],'type':_0x169a00['type'][_0xb5df('0x20')]};});_0xb73c4a=qs[_0xb5df('0x21')](_0x369626,_0x2536bc);return interaction['findAll']('sms',_0x2536bc[_0xb5df('0x22')],_0x2536bc['user'],_0xb73c4a,_0x369626)[_0xb5df('0x18')](respondWithFilteredResult(_0x334063,_0xb73c4a))[_0xb5df('0x23')](handleError(_0x334063,null));};exports[_0xb5df('0x24')]=function(_0x2513cd,_0x955d70){var _0x47b708={'raw':![],'where':{'id':_0x2513cd[_0xb5df('0x25')]['id']}},_0x56aba0={};_0x56aba0[_0xb5df('0x26')]=_['keys'](db['SmsInteraction'][_0xb5df('0x1f')]);_0x56aba0['query']=_[_0xb5df('0x27')](_0x2513cd[_0xb5df('0x22')]);_0x56aba0[_0xb5df('0x28')]=_[_0xb5df('0x29')](_0x56aba0[_0xb5df('0x26')],_0x56aba0[_0xb5df('0x22')]);_0x47b708[_0xb5df('0x2a')]=_[_0xb5df('0x29')](_0x56aba0['model'],qs[_0xb5df('0x2b')](_0x2513cd['query']['fields']));_0x47b708['attributes']=_0x47b708[_0xb5df('0x2a')][_0xb5df('0x2c')]?_0x47b708[_0xb5df('0x2a')]:_0x56aba0[_0xb5df('0x26')];if(_0x2513cd[_0xb5df('0x22')][_0xb5df('0x2d')]){_0x47b708[_0xb5df('0x2e')]=[{'all':!![]}];}_0x47b708=_[_0xb5df('0x2f')]({},_0x47b708,_0x2513cd[_0xb5df('0x30')]);return db[_0xb5df('0x1e')][_0xb5df('0x31')](_0x47b708)[_0xb5df('0x18')](handleEntityNotFound(_0x955d70,null))[_0xb5df('0x18')](respondWithResult(_0x955d70,null))['catch'](handleError(_0x955d70,null));};exports[_0xb5df('0x32')]=function(_0x3476c2,_0x108a08){return db[_0xb5df('0x1e')][_0xb5df('0x32')](_0x3476c2[_0xb5df('0x33')],{})[_0xb5df('0x18')](respondWithResult(_0x108a08,0xc9))['catch'](handleError(_0x108a08,null));};exports['update']=function(_0x14906f,_0x4505b3){if(_0x14906f[_0xb5df('0x33')]['id']){delete _0x14906f['body']['id'];}return db[_0xb5df('0x1e')]['find']({'where':{'id':_0x14906f[_0xb5df('0x25')]['id']}})[_0xb5df('0x18')](handleEntityNotFound(_0x4505b3,null))[_0xb5df('0x18')](saveUpdates(_0x14906f[_0xb5df('0x33')],null))[_0xb5df('0x18')](respondWithResult(_0x4505b3,null))[_0xb5df('0x23')](handleError(_0x4505b3,null));};exports['destroy']=function(_0x2da901,_0xcf83c3){return db['SmsInteraction'][_0xb5df('0x31')]({'where':{'id':_0x2da901[_0xb5df('0x25')]['id']}})[_0xb5df('0x18')](handleEntityNotFound(_0xcf83c3,null))[_0xb5df('0x18')](removeEntity(_0xcf83c3,null))['catch'](handleError(_0xcf83c3,null));};exports[_0xb5df('0x34')]=function(_0x356eb1,_0x25985c){return db[_0xb5df('0x1e')]['describe']()['then'](respondWithResult(_0x25985c,null))['catch'](handleError(_0x25985c,null));};exports[_0xb5df('0x35')]=function(_0x133dc0,_0x4248b2){return db[_0xb5df('0x36')]['find']({'where':{'id':_0x133dc0[_0xb5df('0x25')]['id']}})[_0xb5df('0x18')](handleEntityNotFound(_0x4248b2,null))[_0xb5df('0x18')](function(_0x43d7ff){if(_0x43d7ff){return _0x43d7ff[_0xb5df('0x35')](_0x133dc0[_0xb5df('0x33')][_0xb5df('0x37')],_[_0xb5df('0x38')](_0x133dc0[_0xb5df('0x33')],[_0xb5df('0x37'),'id'])||{});}})[_0xb5df('0x18')](respondWithResult(_0x4248b2,null))['catch'](handleError(_0x4248b2,null));};exports['getMessages']=function(_0x2f9429,_0x4999cf){var _0x34a9f2={'raw':![],'where':{}};var _0x978e36={};var _0x4b814e={'count':0x0,'rows':[]};return db[_0xb5df('0x1e')]['findOne']({'where':{'id':_0x2f9429[_0xb5df('0x25')]['id']}})[_0xb5df('0x18')](handleEntityNotFound(_0x4999cf,null))[_0xb5df('0x18')](function(_0x3626c1){if(_0x3626c1){_0x978e36[_0xb5df('0x26')]=_[_0xb5df('0x27')](db['SmsMessage']['rawAttributes']);_0x978e36[_0xb5df('0x22')]=_[_0xb5df('0x27')](_0x2f9429['query']);_0x978e36['filters']=_['intersection'](_0x978e36[_0xb5df('0x26')],_0x978e36[_0xb5df('0x22')]);_0x34a9f2[_0xb5df('0x2a')]=_['intersection'](_0x978e36[_0xb5df('0x26')],qs['fields'](_0x2f9429[_0xb5df('0x22')][_0xb5df('0x2b')]));_0x34a9f2[_0xb5df('0x2a')]=_0x34a9f2[_0xb5df('0x2a')][_0xb5df('0x2c')]?_0x34a9f2['attributes']:_0x978e36[_0xb5df('0x26')];if(!_0x2f9429[_0xb5df('0x22')][_0xb5df('0x39')](_0xb5df('0x3a'))){_0x34a9f2['limit']=qs['limit'](_0x2f9429['query']['limit']);_0x34a9f2['offset']=qs['offset'](_0x2f9429[_0xb5df('0x22')][_0xb5df('0x13')]);}_0x34a9f2[_0xb5df('0x3b')]=qs[_0xb5df('0x3c')](_0x2f9429['query'][_0xb5df('0x3c')]);_0x34a9f2[_0xb5df('0x3d')]=qs[_0xb5df('0x28')](_[_0xb5df('0x3e')](_0x2f9429[_0xb5df('0x22')],_0x978e36[_0xb5df('0x28')]));_0x34a9f2[_0xb5df('0x3d')][_0xb5df('0x3f')]=_0x3626c1['id'];if(_0x2f9429[_0xb5df('0x22')][_0xb5df('0x40')]){_0x34a9f2[_0xb5df('0x3d')]=_['merge'](_0x34a9f2[_0xb5df('0x3d')],{'$or':_[_0xb5df('0x41')](_0x34a9f2[_0xb5df('0x2a')],function(_0xe218cd){var _0x1a2619={};_0x1a2619[_0xe218cd]={'$like':'%'+_0x2f9429['query']['filter']+'%'};return _0x1a2619;})});}if(_0x2f9429['query'][_0xb5df('0x42')]){var _0x182025=_0x2f9429[_0xb5df('0x22')][_0xb5df('0x42')]['split'](',');var _0x382635={};_0x382635[_0x182025[0x0]]={'$gte':moment(_0x182025[0x1])[_0xb5df('0x43')]('YYYY-MM-DD\x20HH:mm:ss')};_0x34a9f2['where']=_[_0xb5df('0x2f')](_0x34a9f2[_0xb5df('0x3d')],_0x382635);}_0x34a9f2=_[_0xb5df('0x2f')]({},_0x34a9f2,_0x2f9429[_0xb5df('0x30')]);return db['SmsMessage'][_0xb5df('0x14')]({'where':_0x34a9f2[_0xb5df('0x3d')]})[_0xb5df('0x18')](function(_0x46dd02){_0x4b814e['count']=_0x46dd02;if(_0x2f9429['query'][_0xb5df('0x2d')]){_0x34a9f2[_0xb5df('0x2e')]=[{'all':!![]}];}return db['SmsMessage'][_0xb5df('0x44')](_0x34a9f2);})[_0xb5df('0x18')](function(_0x388604){_0x4b814e[_0xb5df('0x45')]=_0x388604;return _0x4b814e;});}})[_0xb5df('0x18')](respondWithFilteredResult(_0x4999cf,_0x34a9f2))[_0xb5df('0x23')](handleError(_0x4999cf,null));};exports[_0xb5df('0x46')]=function(_0x51d539,_0x729a22){return db[_0xb5df('0x1e')][_0xb5df('0x31')]({'where':{'id':_0x51d539[_0xb5df('0x25')]['id']}})[_0xb5df('0x18')](handleEntityNotFound(_0x729a22,null))[_0xb5df('0x18')](function(_0xddce14){if(_0xddce14){return _0xddce14[_0xb5df('0x47')](_0x51d539[_0xb5df('0x33')][_0xb5df('0x37')],_['omit'](_0x51d539['body'],[_0xb5df('0x37'),'id'])||{})[_0xb5df('0x48')](function(){return db[_0xb5df('0x49')][_0xb5df('0x44')]({'attributes':['id',_0xb5df('0x1c'),_0xb5df('0x4a')],'where':{'id':_0x51d539[_0xb5df('0x33')][_0xb5df('0x37')]}});})[_0xb5df('0x18')](function(_0x17084f){socket[_0xb5df('0x4b')](_0xb5df('0x4c'),{'id':Number(_0x51d539[_0xb5df('0x25')]['id']),'tags':_0x17084f||[]});return{'id':Number(_0x51d539[_0xb5df('0x25')]['id']),'tags':_0x17084f||[]};});}})['then'](respondWithResult(_0x729a22,null))[_0xb5df('0x23')](handleError(_0x729a22,null));};exports['removeTags']=function(_0x11ad5d,_0x1d7791){return db[_0xb5df('0x1e')][_0xb5df('0x31')]({'where':{'id':_0x11ad5d[_0xb5df('0x25')]['id']}})[_0xb5df('0x18')](handleEntityNotFound(_0x1d7791,null))[_0xb5df('0x18')](function(_0x2dd0d2){if(_0x2dd0d2){return _0x2dd0d2[_0xb5df('0x4d')](_0x11ad5d[_0xb5df('0x22')][_0xb5df('0x37')]);}})[_0xb5df('0x18')](respondWithStatusCode(_0x1d7791,null))['catch'](handleError(_0x1d7791,null));};exports[_0xb5df('0x4e')]=function(_0x3cb5db,_0x402168){var _0x4420ad=moment()[_0xb5df('0x4f')]()[_0xb5df('0x50')]();var _0x7e77a9=path[_0xb5df('0x51')](config[_0xb5df('0x52')],_0xb5df('0x53'),_0xb5df('0x54'),_0xb5df('0x55'));var _0xf405f5=path[_0xb5df('0x51')](_0x7e77a9,_0x4420ad);var _0x49cce0=util['format'](_0xb5df('0x56'),_0x3cb5db['params']['id'],_0x4420ad);var _0x3b24e5=path['join'](_0x7e77a9,_0x49cce0);var _0x49bf9c=[];_0x49bf9c[_0xb5df('0x57')]({'model':db[_0xb5df('0x58')],'as':_0xb5df('0x58'),'attributes':['id','fullname'],'raw':!![]});_0x49bf9c['push']({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName',_0xb5df('0x59')],'raw':!![]});var _0x2d9270=[{'model':db[_0xb5df('0x36')],'as':'Messages','attributes':['id','body','createdAt',_0xb5df('0x5a'),_0xb5df('0x5b'),_0xb5df('0x5c')],'include':_0x49bf9c}];_0x2d9270[_0xb5df('0x57')]({'model':db['SmsAccount'],'as':_0xb5df('0x5d'),'attributes':['id',_0xb5df('0x1c')]});_0x2d9270[_0xb5df('0x57')]({'model':db[_0xb5df('0x58')],'as':_0xb5df('0x5e'),'attributes':['id','fullname']});return db['SmsInteraction'][_0xb5df('0x31')]({'where':{'id':_0x3cb5db['params']['id']},'include':_0x2d9270})[_0xb5df('0x18')](handleEntityNotFound(_0x402168,null))[_0xb5df('0x18')](function(_0x24f2c5){if(_0x24f2c5){var _0x2745e9=_0x24f2c5[_0xb5df('0x5f')]({'plain':!![]});fs[_0xb5df('0x60')](_0xf405f5);var _0x3285fb={'channel':'Sms','account':_0x2745e9[_0xb5df('0x5d')]['name'],'agent':_0x2745e9[_0xb5df('0x5e')]?_0x2745e9[_0xb5df('0x5e')][_0xb5df('0x61')]:_0xb5df('0x62'),'createdAt':moment(_0x2745e9[_0xb5df('0x63')])[_0xb5df('0x43')](_0xb5df('0x64'))[_0xb5df('0x50')](),'closedAt':_0x2745e9[_0xb5df('0x65')]?moment(_0x2745e9[_0xb5df('0x66')])[_0xb5df('0x43')](_0xb5df('0x64'))[_0xb5df('0x50')]():'','disposition':_0x2745e9[_0xb5df('0x67')],'messages':_(_0x2745e9[_0xb5df('0x68')])[_0xb5df('0x40')]({'secret':![]})[_0xb5df('0x41')](function(_0x25362e){return{'date':moment(_0x25362e[_0xb5df('0x63')])[_0xb5df('0x43')](_0xb5df('0x64'))[_0xb5df('0x50')](),'sender':_0x25362e['direction']==='out'?_0x25362e[_0xb5df('0x58')]?_0x25362e[_0xb5df('0x58')][_0xb5df('0x61')]:_0xb5df('0x69'):_0x25362e[_0xb5df('0x6a')][_0xb5df('0x6b')]+(_0x25362e[_0xb5df('0x6a')]['lastName']?'\x20'+_0x25362e['Contact'][_0xb5df('0x59')]:''),'body':_0x25362e[_0xb5df('0x33')],'direction':_0x25362e[_0xb5df('0x5a')]==='out'?'A':'C','secret':_0x25362e[_0xb5df('0x5b')],'read':_0x25362e[_0xb5df('0x5c')]};})[_0xb5df('0x6c')]()};return ejs[_0xb5df('0x6d')](path[_0xb5df('0x51')](config['root'],_0xb5df('0x53'),_0xb5df('0x6e'),'downloadInteraction.ejs'),{'interaction':_0x3285fb})['then'](function(_0x19ffc4){var _0x3af35a=path[_0xb5df('0x51')](_0xf405f5,_0xb5df('0x6f')+_0x2745e9['id']+'-'+_0x4420ad+_0xb5df('0x70'));var _0x40a1c9={'path':_0x3af35a,'channel':_0xb5df('0x71'),'interactionId':_0x2745e9['id']};return pdf[_0xb5df('0x72')](_0x19ffc4,_0x40a1c9);})[_0xb5df('0x18')](function(){return new BPromise(function(_0xd35e91,_0x1d1839){zipdir(_0xf405f5,{'saveTo':_0x3b24e5},function(_0x4ffdfd,_0x5a53a4){if(_0x4ffdfd)return _0x1d1839(_0x4ffdfd);return _0xd35e91(_0x5a53a4);});})[_0xb5df('0x18')](function(){return new BPromise(function(_0x33dcc9,_0x511ed1){rimraf(_0xf405f5,function(_0x17a7e2){if(_0x17a7e2)_0x511ed1(_0x17a7e2);return _0x33dcc9();});});})[_0xb5df('0x18')](function(){return _0x402168['download'](_0x3b24e5,_0x49cce0,function(_0x57cc3a){if(_0x57cc3a){console[_0xb5df('0x73')](_0xb5df('0x74'),_0x57cc3a);}else{fs[_0xb5df('0x75')](_0x3b24e5);}});});});}else{return _0x402168[_0xb5df('0x76')](0xc8);}})[_0xb5df('0x23')](handleError(_0x402168,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 772a734..ca3be4e 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 _0x5c3c=['events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','getUsers','Users','map','findAll','then','setDataValue','unreadMessages','emit','catch','hook','exports'];(function(_0x56ae0e,_0x1ffb1f){var _0x38bb7e=function(_0x5d2411){while(--_0x5d2411){_0x56ae0e['push'](_0x56ae0e['shift']());}};_0x38bb7e(++_0x1ffb1f);}(_0x5c3c,0x132));var _0xc5c3=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x5c3c[_0x24259d];return _0x5a701;};'use strict';var EventEmitter=require(_0xc5c3('0x0'));var SmsInteraction=require(_0xc5c3('0x1'))['db'][_0xc5c3('0x2')];var SmsMessage=require(_0xc5c3('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc5c3('0x3')](0x0);var events={'afterCreate':_0xc5c3('0x4'),'afterUpdate':_0xc5c3('0x5'),'afterDestroy':_0xc5c3('0x6')};function emitEvent(_0x2535e0){return function(_0x36525d,_0xe85098,_0x23a6b5){_0x36525d[_0xc5c3('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4b8404){_0x36525d['setDataValue'](_0xc5c3('0x8'),_0x4b8404[_0xc5c3('0x9')](function(_0x593b35){return{'id':_0x593b35['id']};}));return SmsMessage[_0xc5c3('0xa')]({'where':{'SmsInteractionId':_0x36525d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc5c3('0xb')](function(_0x52f3eb){_0x36525d[_0xc5c3('0xc')](_0xc5c3('0xd'),_0x52f3eb['length']);SmsInteractionEvents[_0xc5c3('0xe')](_0x2535e0+':'+_0x36525d['id'],_0x36525d);SmsInteractionEvents[_0xc5c3('0xe')](_0x2535e0,_0x36525d);_0x23a6b5(null);})[_0xc5c3('0xf')](_0x23a6b5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0xc5c3('0x10')](e,emitEvent(event));}}module[_0xc5c3('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0xf4f4=['findAll','unreadMessages','length','emit','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x154b4c,_0xa38e2){_0x154b4c=_0x154b4c-0x0;var _0x100586=_0xf4f4[_0x154b4c];return _0x100586;};'use strict';var EventEmitter=require(_0x4f4f('0x0'));var SmsInteraction=require(_0x4f4f('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x4f4f('0x1'))['db'][_0x4f4f('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4f4f('0x3')](0x0);var events={'afterCreate':_0x4f4f('0x4'),'afterUpdate':_0x4f4f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5a752b){return function(_0x593952,_0x3f274d,_0x132d5c){_0x593952[_0x4f4f('0x6')]({'attributes':['id'],'raw':!![]})[_0x4f4f('0x7')](function(_0x3c4877){_0x593952[_0x4f4f('0x8')](_0x4f4f('0x9'),_0x3c4877[_0x4f4f('0xa')](function(_0x48f6b9){return{'id':_0x48f6b9['id']};}));return SmsMessage[_0x4f4f('0xb')]({'where':{'SmsInteractionId':_0x593952['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4f4f('0x7')](function(_0x39e36b){_0x593952[_0x4f4f('0x8')](_0x4f4f('0xc'),_0x39e36b[_0x4f4f('0xd')]);SmsInteractionEvents[_0x4f4f('0xe')](_0x5a752b+':'+_0x593952['id'],_0x593952);SmsInteractionEvents[_0x4f4f('0xe')](_0x5a752b,_0x593952);_0x132d5c(null);})['catch'](_0x132d5c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x4f4f('0xf')](e,emitEvent(event));}}module[_0x4f4f('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 6bf7f4c..697c3d2 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 _0x5836=['path','rimraf','../../config/environment','./smsInteraction.attributes','define','sms_interactions','changed','closed','closedAt','format','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4be30f,_0x5cded5){var _0x2a49dc=function(_0x302c6c){while(--_0x302c6c){_0x4be30f['push'](_0x4be30f['shift']());}};_0x2a49dc(++_0x5cded5);}(_0x5836,0x10a));var _0x6583=function(_0x1ce92b,_0x12fe42){_0x1ce92b=_0x1ce92b-0x0;var _0x3ff61a=_0x5836[_0x1ce92b];return _0x3ff61a;};'use strict';var _=require(_0x6583('0x0'));var util=require('util');var logger=require(_0x6583('0x1'))(_0x6583('0x2'));var moment=require(_0x6583('0x3'));var BPromise=require(_0x6583('0x4'));var rp=require(_0x6583('0x5'));var fs=require('fs');var path=require(_0x6583('0x6'));var rimraf=require(_0x6583('0x7'));var config=require(_0x6583('0x8'));var attributes=require(_0x6583('0x9'));module['exports']=function(_0x50099f,_0x222be9){return _0x50099f[_0x6583('0xa')]('SmsInteraction',attributes,{'tableName':_0x6583('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x552c55,_0x13d5f9,_0x2fd9d4){if(_0x552c55[_0x6583('0xc')](_0x6583('0xd'))){_0x552c55[_0x6583('0xe')]=moment()[_0x6583('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2fd9d4(null,_0x552c55);}}});}; \ No newline at end of file +var _0x91a2=['../../config/environment','exports','define','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x91a2,0x117));var _0x291a=function(_0x1e6659,_0x1f860c){_0x1e6659=_0x1e6659-0x0;var _0x4d16e4=_0x91a2[_0x1e6659];return _0x4d16e4;};'use strict';var _=require(_0x291a('0x0'));var util=require('util');var logger=require(_0x291a('0x1'))(_0x291a('0x2'));var moment=require('moment');var BPromise=require(_0x291a('0x3'));var rp=require(_0x291a('0x4'));var fs=require('fs');var path=require(_0x291a('0x5'));var rimraf=require('rimraf');var config=require(_0x291a('0x6'));var attributes=require('./smsInteraction.attributes');module[_0x291a('0x7')]=function(_0x3255f1,_0x4c99ea){return _0x3255f1[_0x291a('0x8')]('SmsInteraction',attributes,{'tableName':_0x291a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x189b8f,_0x221a7f,_0x445c8b){if(_0x189b8f[_0x291a('0xa')](_0x291a('0xb'))){_0x189b8f[_0x291a('0xc')]=moment()[_0x291a('0xd')](_0x291a('0xe'));}_0x445c8b(null,_0x189b8f);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 4f7048e..be566c5 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 _0x3f22=['SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToSmsInteraction','find','then','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','info'];(function(_0x3e1b58,_0x4eeafe){var _0x1d7bc7=function(_0x18f55a){while(--_0x18f55a){_0x3e1b58['push'](_0x3e1b58['shift']());}};_0x1d7bc7(++_0x4eeafe);}(_0x3f22,0xb4));var _0x23f2=function(_0x3edf96,_0x529bc0){_0x3edf96=_0x3edf96-0x0;var _0x30bd21=_0x3f22[_0x3edf96];return _0x30bd21;};'use strict';var _=require(_0x23f2('0x0'));var util=require(_0x23f2('0x1'));var moment=require('moment');var BPromise=require(_0x23f2('0x2'));var rs=require(_0x23f2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x23f2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x23f2('0x5'))(_0x23f2('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x23f2('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x23f2('0x8')],{'host':_0x23f2('0x9'),'port':0x18eb});var socket=require(_0x23f2('0xa'))(new Redis(config[_0x23f2('0x8')]));require(_0x23f2('0xb'))[_0x23f2('0xc')](socket);function respondWithRpcPromise(_0x528e32,_0x360dcd,_0x4739fa){return new BPromise(function(_0x4bb45a,_0x1d3915){return client[_0x23f2('0xd')](_0x528e32,_0x4739fa)['then'](function(_0x465d22){logger[_0x23f2('0xe')](_0x23f2('0xf'),_0x360dcd,'request\x20sent');logger[_0x23f2('0x10')](_0x23f2('0x11'),_0x360dcd,_0x23f2('0x12'),JSON['stringify'](_0x465d22));if(_0x465d22[_0x23f2('0x13')]){if(_0x465d22[_0x23f2('0x13')]['code']===0x1f4){logger['error'](_0x23f2('0xf'),_0x360dcd,_0x465d22[_0x23f2('0x13')][_0x23f2('0x14')]);return _0x1d3915(_0x465d22['error'][_0x23f2('0x14')]);}logger['error'](_0x23f2('0xf'),_0x360dcd,_0x465d22[_0x23f2('0x13')]['message']);return _0x4bb45a(_0x465d22['error'][_0x23f2('0x14')]);}else{logger[_0x23f2('0xe')](_0x23f2('0xf'),_0x360dcd,'request\x20sent');_0x4bb45a(_0x465d22['result'][_0x23f2('0x14')]);}})[_0x23f2('0x15')](function(_0x1ef485){logger[_0x23f2('0x13')](_0x23f2('0xf'),_0x360dcd,_0x1ef485);_0x1d3915(_0x1ef485);});});}exports[_0x23f2('0x16')]=function(_0xe5d37c){var _0x1944ef=this;return new Promise(function(_0x1d4939,_0xa74f7c){return db[_0x23f2('0x17')][_0x23f2('0x18')](_0xe5d37c[_0x23f2('0x19')],{'raw':_0xe5d37c[_0x23f2('0x1a')]?_0xe5d37c[_0x23f2('0x1a')][_0x23f2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe5d37c[_0x23f2('0x1a')]?_0xe5d37c[_0x23f2('0x1a')][_0x23f2('0x1c')]||null:null,'attributes':_0xe5d37c[_0x23f2('0x1a')]?_0xe5d37c[_0x23f2('0x1a')][_0x23f2('0x1d')]||null:null,'limit':_0xe5d37c[_0x23f2('0x1a')]?_0xe5d37c[_0x23f2('0x1a')][_0x23f2('0x1e')]||null:null})['then'](function(_0x1953ba){logger['info'](_0x23f2('0x16'),_0xe5d37c);logger[_0x23f2('0x10')](_0x23f2('0x16'),_0xe5d37c,JSON[_0x23f2('0x1f')](_0x1953ba));_0x1d4939(_0x1953ba);})[_0x23f2('0x15')](function(_0x3c1ff4){logger[_0x23f2('0x13')](_0x23f2('0x16'),_0x3c1ff4[_0x23f2('0x14')],_0xe5d37c);_0xa74f7c(_0x1944ef['error'](0x1f4,_0x3c1ff4['message']));});});};exports[_0x23f2('0x20')]=function(_0x418450){return new Promise(function(_0x3b0127,_0xce62fb){return db['SmsInteraction'][_0x23f2('0x21')]({'where':_0x418450[_0x23f2('0x1a')]?_0x418450['options'][_0x23f2('0x1c')]||null:null})[_0x23f2('0x22')](function(_0x3b4567){if(_0x3b4567){return _0x3b4567['addTags'](_0x418450['body'][_0x23f2('0x23')],_[_0x23f2('0x24')](_0x418450[_0x23f2('0x19')],[_0x23f2('0x23'),'id'])||{});}})[_0x23f2('0x25')](function(_0x38a838){logger[_0x23f2('0xe')](_0x23f2('0x26'),_0x418450);logger[_0x23f2('0x10')](_0x23f2('0x26'),_0x418450,JSON[_0x23f2('0x1f')](_0x38a838));_0x3b0127(_0x38a838);})[_0x23f2('0x15')](function(_0x1ac163){logger[_0x23f2('0x13')](_0x23f2('0x26'),_0x1ac163[_0x23f2('0x14')],_0x418450);_0xce62fb(_this[_0x23f2('0x13')](0x1f4,_0x1ac163[_0x23f2('0x14')]));});});}; \ No newline at end of file +var _0xb63f=['then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','where','attributes','limit','stringify','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./smsInteraction.socket','register','request'];(function(_0x5adc26,_0x4ada89){var _0x20d039=function(_0x495b5e){while(--_0x495b5e){_0x5adc26['push'](_0x5adc26['shift']());}};_0x20d039(++_0x4ada89);}(_0xb63f,0xc1));var _0xfb63=function(_0x21d36e,_0x5dc096){_0x21d36e=_0x21d36e-0x0;var _0x4cc307=_0xb63f[_0x21d36e];return _0x4cc307;};'use strict';var _=require(_0xfb63('0x0'));var util=require(_0xfb63('0x1'));var moment=require(_0xfb63('0x2'));var BPromise=require(_0xfb63('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb63('0x4'));var db=require(_0xfb63('0x5'))['db'];var utils=require(_0xfb63('0x6'));var logger=require(_0xfb63('0x7'))(_0xfb63('0x8'));var config=require(_0xfb63('0x9'));var jayson=require(_0xfb63('0xa'));var client=jayson[_0xfb63('0xb')]['http']({'port':0x232a});config[_0xfb63('0xc')]=_[_0xfb63('0xd')](config[_0xfb63('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfb63('0xc')]));require(_0xfb63('0xe'))[_0xfb63('0xf')](socket);function respondWithRpcPromise(_0x4d3fae,_0x2ef8cd,_0x16760f){return new BPromise(function(_0x484a5a,_0x598a68){return client[_0xfb63('0x10')](_0x4d3fae,_0x16760f)[_0xfb63('0x11')](function(_0x452d77){logger[_0xfb63('0x12')](_0xfb63('0x13'),_0x2ef8cd,_0xfb63('0x14'));logger[_0xfb63('0x15')](_0xfb63('0x16'),_0x2ef8cd,_0xfb63('0x14'),JSON['stringify'](_0x452d77));if(_0x452d77[_0xfb63('0x17')]){if(_0x452d77[_0xfb63('0x17')][_0xfb63('0x18')]===0x1f4){logger['error'](_0xfb63('0x13'),_0x2ef8cd,_0x452d77[_0xfb63('0x17')][_0xfb63('0x19')]);return _0x598a68(_0x452d77[_0xfb63('0x17')][_0xfb63('0x19')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x2ef8cd,_0x452d77[_0xfb63('0x17')][_0xfb63('0x19')]);return _0x484a5a(_0x452d77['error'][_0xfb63('0x19')]);}else{logger[_0xfb63('0x12')](_0xfb63('0x13'),_0x2ef8cd,_0xfb63('0x14'));_0x484a5a(_0x452d77[_0xfb63('0x1a')][_0xfb63('0x19')]);}})[_0xfb63('0x1b')](function(_0x9ce80f){logger[_0xfb63('0x17')](_0xfb63('0x13'),_0x2ef8cd,_0x9ce80f);_0x598a68(_0x9ce80f);});});}exports[_0xfb63('0x1c')]=function(_0x1364d9){var _0x10fcc7=this;return new Promise(function(_0x2df470,_0x5ad5b1){return db[_0xfb63('0x1d')][_0xfb63('0x1e')](_0x1364d9[_0xfb63('0x1f')],{'raw':_0x1364d9['options']?_0x1364d9[_0xfb63('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1364d9[_0xfb63('0x20')]?_0x1364d9[_0xfb63('0x20')][_0xfb63('0x21')]||null:null,'attributes':_0x1364d9[_0xfb63('0x20')]?_0x1364d9[_0xfb63('0x20')][_0xfb63('0x22')]||null:null,'limit':_0x1364d9['options']?_0x1364d9[_0xfb63('0x20')][_0xfb63('0x23')]||null:null})[_0xfb63('0x11')](function(_0x4170c2){logger[_0xfb63('0x12')]('UpdateSmsInteraction',_0x1364d9);logger[_0xfb63('0x15')](_0xfb63('0x1c'),_0x1364d9,JSON[_0xfb63('0x24')](_0x4170c2));_0x2df470(_0x4170c2);})[_0xfb63('0x1b')](function(_0x43c8f2){logger['error'](_0xfb63('0x1c'),_0x43c8f2[_0xfb63('0x19')],_0x1364d9);_0x5ad5b1(_0x10fcc7['error'](0x1f4,_0x43c8f2[_0xfb63('0x19')]));});});};exports['AddTagsToSmsInteraction']=function(_0x2754ac){return new Promise(function(_0x343f28,_0x290309){return db['SmsInteraction']['find']({'where':_0x2754ac[_0xfb63('0x20')]?_0x2754ac['options'][_0xfb63('0x21')]||null:null})['then'](function(_0x398b7b){if(_0x398b7b){return _0x398b7b[_0xfb63('0x25')](_0x2754ac['body'][_0xfb63('0x26')],_[_0xfb63('0x27')](_0x2754ac[_0xfb63('0x1f')],['ids','id'])||{});}})[_0xfb63('0x28')](function(_0x374460){logger['info']('AddTags',_0x2754ac);logger[_0xfb63('0x15')](_0xfb63('0x29'),_0x2754ac,JSON[_0xfb63('0x24')](_0x374460));_0x343f28(_0x374460);})[_0xfb63('0x1b')](function(_0x1156e8){logger[_0xfb63('0x17')](_0xfb63('0x29'),_0x1156e8['message'],_0x2754ac);_0x290309(_this[_0xfb63('0x17')](0x1f4,_0x1156e8[_0xfb63('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 1dcaf7e..52e0c80 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 _0xb788=['smsInteraction:','./smsInteraction.events','remove','emit','removeListener','register','length'];(function(_0x4780ac,_0x5b96ee){var _0x29e58e=function(_0x5c042d){while(--_0x5c042d){_0x4780ac['push'](_0x4780ac['shift']());}};_0x29e58e(++_0x5b96ee);}(_0xb788,0x9b));var _0x8b78=function(_0x20dd9b,_0x3c0fb8){_0x20dd9b=_0x20dd9b-0x0;var _0x2de3b0=_0xb788[_0x20dd9b];return _0x2de3b0;};'use strict';var SmsInteractionEvents=require(_0x8b78('0x0'));var events=['save',_0x8b78('0x1'),'update'];function createListener(_0x2788c3,_0xd1b97f){return function(_0x56e006){_0xd1b97f[_0x8b78('0x2')](_0x2788c3,_0x56e006);};}function removeListener(_0x2d51fa,_0x2dc03c){return function(){SmsInteractionEvents[_0x8b78('0x3')](_0x2d51fa,_0x2dc03c);};}exports[_0x8b78('0x4')]=function(_0x29f191){for(var _0x13c212=0x0,_0x4cf305=events[_0x8b78('0x5')];_0x13c212<_0x4cf305;_0x13c212++){var _0x27292e=events[_0x13c212];var _0x3f0473=createListener(_0x8b78('0x6')+_0x27292e,_0x29f191);SmsInteractionEvents['on'](_0x27292e,_0x3f0473);}}; \ No newline at end of file +var _0xc715=['save','update','emit','removeListener','register','./smsInteraction.events'];(function(_0xd9f102,_0x5a0d28){var _0x2652e4=function(_0x5021a1){while(--_0x5021a1){_0xd9f102['push'](_0xd9f102['shift']());}};_0x2652e4(++_0x5a0d28);}(_0xc715,0x15b));var _0x5c71=function(_0x34ce8c,_0x526c3c){_0x34ce8c=_0x34ce8c-0x0;var _0x31bde5=_0xc715[_0x34ce8c];return _0x31bde5;};'use strict';var SmsInteractionEvents=require(_0x5c71('0x0'));var events=[_0x5c71('0x1'),'remove',_0x5c71('0x2')];function createListener(_0x5b6093,_0x4e6839){return function(_0x12db4d){_0x4e6839[_0x5c71('0x3')](_0x5b6093,_0x12db4d);};}function removeListener(_0x3afac4,_0x7f4ab8){return function(){SmsInteractionEvents[_0x5c71('0x4')](_0x3afac4,_0x7f4ab8);};}exports[_0x5c71('0x5')]=function(_0x5dad50){for(var _0x3d6423=0x0,_0x3812f7=events['length'];_0x3d6423<_0x3812f7;_0x3d6423++){var _0x490c8c=events[_0x3d6423];var _0x382406=createListener('smsInteraction:'+_0x490c8c,_0x5dad50);SmsInteractionEvents['on'](_0x490c8c,_0x382406);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index b25806c..0534853 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 _0xc3d4=['post','tracked','sms','status','put','update','/:id/accept','accept','delete','/:id','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','show'];(function(_0x57e4aa,_0x482b33){var _0x203e32=function(_0xf03c77){while(--_0xf03c77){_0x57e4aa['push'](_0x57e4aa['shift']());}};_0x203e32(++_0x482b33);}(_0xc3d4,0xd3));var _0x4c3d=function(_0x12f2c2,_0x9e8677){_0x12f2c2=_0x12f2c2-0x0;var _0x3ea4d7=_0xc3d4[_0x12f2c2];return _0x3ea4d7;};'use strict';var multer=require(_0x4c3d('0x0'));var util=require(_0x4c3d('0x1'));var path=require(_0x4c3d('0x2'));var timeout=require(_0x4c3d('0x3'));var express=require('express');var router=express[_0x4c3d('0x4')]();var fs_extra=require(_0x4c3d('0x5'));var auth=require(_0x4c3d('0x6'));var interaction=require(_0x4c3d('0x7'));var config=require('../../config/environment');var controller=require(_0x4c3d('0x8'));router[_0x4c3d('0x9')]('/',auth[_0x4c3d('0xa')](),controller[_0x4c3d('0xb')]);router[_0x4c3d('0x9')](_0x4c3d('0xc'),auth[_0x4c3d('0xa')](),controller['describe']);router[_0x4c3d('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4c3d('0xd')]);router[_0x4c3d('0xe')]('/',auth[_0x4c3d('0xa')](),interaction[_0x4c3d('0xf')](_0x4c3d('0x10'),'smsmessage:create'),controller['create']);router[_0x4c3d('0xe')]('/:id/status',controller[_0x4c3d('0x11')]);router[_0x4c3d('0x12')]('/:id',auth[_0x4c3d('0xa')](),controller[_0x4c3d('0x13')]);router[_0x4c3d('0x12')](_0x4c3d('0x14'),auth['isAuthenticated'](),controller[_0x4c3d('0x15')]);router[_0x4c3d('0x12')]('/:id/reject',auth[_0x4c3d('0xa')](),controller['reject']);router[_0x4c3d('0x16')](_0x4c3d('0x17'),auth[_0x4c3d('0xa')](),controller[_0x4c3d('0x18')]);module['exports']=router; \ No newline at end of file +var _0x2baf=['isAuthenticated','index','describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./smsMessage.controller','get'];(function(_0x2335bd,_0x54e892){var _0x2aac2c=function(_0x3194dc){while(--_0x3194dc){_0x2335bd['push'](_0x2335bd['shift']());}};_0x2aac2c(++_0x54e892);}(_0x2baf,0xc8));var _0xf2ba=function(_0x102b0c,_0x33dee4){_0x102b0c=_0x102b0c-0x0;var _0x9b15ca=_0x2baf[_0x102b0c];return _0x9b15ca;};'use strict';var multer=require('multer');var util=require(_0xf2ba('0x0'));var path=require(_0xf2ba('0x1'));var timeout=require(_0xf2ba('0x2'));var express=require(_0xf2ba('0x3'));var router=express[_0xf2ba('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf2ba('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf2ba('0x6'));router[_0xf2ba('0x7')]('/',auth[_0xf2ba('0x8')](),controller[_0xf2ba('0x9')]);router[_0xf2ba('0x7')]('/describe',auth[_0xf2ba('0x8')](),controller[_0xf2ba('0xa')]);router[_0xf2ba('0x7')](_0xf2ba('0xb'),auth[_0xf2ba('0x8')](),controller[_0xf2ba('0xc')]);router[_0xf2ba('0xd')]('/',auth[_0xf2ba('0x8')](),interaction[_0xf2ba('0xe')](_0xf2ba('0xf'),_0xf2ba('0x10')),controller[_0xf2ba('0x11')]);router[_0xf2ba('0xd')](_0xf2ba('0x12'),controller['status']);router['put'](_0xf2ba('0xb'),auth[_0xf2ba('0x8')](),controller['update']);router[_0xf2ba('0x13')](_0xf2ba('0x14'),auth[_0xf2ba('0x8')](),controller['accept']);router[_0xf2ba('0x13')](_0xf2ba('0x15'),auth[_0xf2ba('0x8')](),controller[_0xf2ba('0x16')]);router[_0xf2ba('0x17')](_0xf2ba('0xb'),auth[_0xf2ba('0x8')](),controller[_0xf2ba('0x18')]);module[_0xf2ba('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 3d90fe9..9a0f9e7 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 _0x8d4c=['BOOLEAN','sequelize','exports','TEXT','medium','ENUM','out','STRING','DATE'];(function(_0x84b6b4,_0x12b8a7){var _0x5ee765=function(_0x584939){while(--_0x584939){_0x84b6b4['push'](_0x84b6b4['shift']());}};_0x5ee765(++_0x12b8a7);}(_0x8d4c,0x133));var _0xc8d4=function(_0x464838,_0x28c910){_0x464838=_0x464838-0x0;var _0x2ca654=_0x8d4c[_0x464838];return _0x2ca654;};'use strict';var Sequelize=require(_0xc8d4('0x0'));module[_0xc8d4('0x1')]={'body':{'type':Sequelize[_0xc8d4('0x2')](_0xc8d4('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xc8d4('0x4')]('in','out'),'defaultValue':_0xc8d4('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc8d4('0x6')](0xbe)},'phone':{'type':Sequelize[_0xc8d4('0x6')]},'readAt':{'type':Sequelize[_0xc8d4('0x7')]},'secret':{'type':Sequelize[_0xc8d4('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc8d4('0x6')]},'providerResponse':{'type':Sequelize[_0xc8d4('0x2')]}}; \ No newline at end of file +var _0x2755=['STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x2f33b8,_0x2da652){var _0x568856=function(_0x5e5481){while(--_0x5e5481){_0x2f33b8['push'](_0x2f33b8['shift']());}};_0x568856(++_0x2da652);}(_0x2755,0x80));var _0x5275=function(_0x3709fa,_0x39871d){_0x3709fa=_0x3709fa-0x0;var _0x1b7d87=_0x2755[_0x3709fa];return _0x1b7d87;};'use strict';var Sequelize=require(_0x5275('0x0'));module[_0x5275('0x1')]={'body':{'type':Sequelize[_0x5275('0x2')](_0x5275('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5275('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5275('0x5')]('in',_0x5275('0x6')),'defaultValue':_0x5275('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x5275('0x7')]},'readAt':{'type':Sequelize[_0x5275('0x8')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x5275('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index da0a39f..28f3fe0 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 _0xd4ad=['user','agent','get','SmsInteraction','update','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','channel','event','EventManager','reject','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','internal','SIP/%s','motionChannel','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','Status','plivio','results','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','destroy','stack','name','send','map','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','where','merge','filter','options','SmsMessage','includeAll','include','rows','show','params','keys','find','create','body','describe','../../config/logger','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId'];(function(_0x2e591e,_0x24a94d){var _0x38d745=function(_0x47ec18){while(--_0x47ec18){_0x2e591e['push'](_0x2e591e['shift']());}};_0x38d745(++_0x24a94d);}(_0xd4ad,0x1e4));var _0xdd4a=function(_0x1bd9df,_0x5d9272){_0x1bd9df=_0x1bd9df-0x0;var _0x1d543a=_0xd4ad[_0x1bd9df];return _0x1d543a;};'use strict';var emlformat=require(_0xdd4a('0x0'));var rimraf=require(_0xdd4a('0x1'));var zipdir=require(_0xdd4a('0x2'));var jsonpatch=require(_0xdd4a('0x3'));var rp=require(_0xdd4a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdd4a('0x5'));var util=require(_0xdd4a('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(_0xdd4a('0x7'));var _=require('lodash');var squel=require(_0xdd4a('0x8'));var crypto=require('crypto');var jsforce=require(_0xdd4a('0x9'));var deskjs=require(_0xdd4a('0xa'));var toCsv=require(_0xdd4a('0xb'));var querystring=require(_0xdd4a('0xc'));var Papa=require(_0xdd4a('0xd'));var Redis=require(_0xdd4a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdd4a('0xf'));var as=require(_0xdd4a('0x10'));var hardwareService=require(_0xdd4a('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xdd4a('0x12'));var config=require(_0xdd4a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xdd4a('0x14'))['db'];config['redis']=_[_0xdd4a('0x15')](config[_0xdd4a('0x16')],{'host':_0xdd4a('0x17'),'port':0x18eb});var socket=require(_0xdd4a('0x18'))(new Redis(config[_0xdd4a('0x16')]));require(_0xdd4a('0x19'))[_0xdd4a('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdd4a('0x1b')][_0xdd4a('0x1c')]({'port':0x232c});var client9002=jayson[_0xdd4a('0x1b')][_0xdd4a('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x229a65,_0xe59be3,_0x5d72a1,_0x31551d){return new BPromise(function(_0x42bc93,_0x1154f1){var _0x3f8c5e=_0x31551d||client;return _0x3f8c5e[_0xdd4a('0x1d')](_0x229a65,_0x5d72a1)[_0xdd4a('0x1e')](function(_0xdf7dd6){logger[_0xdd4a('0x1f')](_0xdd4a('0x20'),_0xe59be3,_0xdd4a('0x21'));logger['debug'](_0xdd4a('0x22'),_0xe59be3,'request\x20sent',JSON['stringify'](_0xdf7dd6));if(_0xdf7dd6[_0xdd4a('0x23')]){if(_0xdf7dd6['error'][_0xdd4a('0x24')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0xe59be3,_0xdf7dd6[_0xdd4a('0x23')][_0xdd4a('0x25')]);return _0x1154f1(_0xdf7dd6[_0xdd4a('0x23')][_0xdd4a('0x25')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0xe59be3,_0xdf7dd6[_0xdd4a('0x23')][_0xdd4a('0x25')]);return _0x42bc93(_0xdf7dd6['error']['message']);}else{logger[_0xdd4a('0x1f')]('SmsMessage,\x20%s,\x20%s',_0xe59be3,_0xdd4a('0x21'));_0x42bc93(_0xdf7dd6[_0xdd4a('0x26')][_0xdd4a('0x25')]);}})[_0xdd4a('0x27')](function(_0x3527d1){logger[_0xdd4a('0x23')](_0xdd4a('0x20'),_0xe59be3,_0x3527d1);_0x1154f1(_0x3527d1);});});}function respondWithStatusCode(_0x29304a,_0x49a49f){_0x49a49f=_0x49a49f||0xcc;return function(_0x37c585){if(_0x37c585){return _0x29304a[_0xdd4a('0x28')](_0x49a49f);}return _0x29304a[_0xdd4a('0x29')](_0x49a49f)[_0xdd4a('0x2a')]();};}function respondWithResult(_0x561da7,_0x40c8cf){_0x40c8cf=_0x40c8cf||0xc8;return function(_0x56a2ae){if(_0x56a2ae){return _0x561da7['status'](_0x40c8cf)['json'](_0x56a2ae);}};}function respondWithFilteredResult(_0x1e62d1,_0x233119){return function(_0x154d3c){if(_0x154d3c){var _0x3a5033=typeof _0x233119[_0xdd4a('0x2b')]===_0xdd4a('0x2c')&&typeof _0x233119[_0xdd4a('0x2d')]===_0xdd4a('0x2c');var _0x585459=_0x154d3c[_0xdd4a('0x2e')];var _0x2c574f=_0x3a5033?0x0:_0x233119[_0xdd4a('0x2b')];var _0x33c767=_0x3a5033?_0x154d3c['count']:_0x233119[_0xdd4a('0x2b')]+_0x233119[_0xdd4a('0x2d')];var _0x345e43;if(_0x33c767>=_0x585459){_0x33c767=_0x585459;_0x345e43=0xc8;}else{_0x345e43=0xce;}_0x1e62d1[_0xdd4a('0x29')](_0x345e43);return _0x1e62d1[_0xdd4a('0x2f')]('Content-Range',_0x2c574f+'-'+_0x33c767+'/'+_0x585459)[_0xdd4a('0x30')](_0x154d3c);}return null;};}function patchUpdates(_0x16d211){return function(_0x3f995c){try{jsonpatch[_0xdd4a('0x31')](_0x3f995c,_0x16d211,!![]);}catch(_0x52492e){return BPromise['reject'](_0x52492e);}return _0x3f995c['save']();};}function saveUpdates(_0x3d5a84,_0x2be602){return function(_0x58bf09){if(_0x58bf09){return _0x58bf09['update'](_0x3d5a84)[_0xdd4a('0x1e')](function(_0xaf013a){return _0xaf013a;});}return null;};}function removeEntity(_0x16a396,_0x4a0234){return function(_0x4c0049){if(_0x4c0049){return _0x4c0049[_0xdd4a('0x32')]()['then'](function(){_0x16a396[_0xdd4a('0x29')](0xcc)[_0xdd4a('0x2a')]();});}};}function handleEntityNotFound(_0x538b3c,_0x157fc7){return function(_0x5e6668){if(!_0x5e6668){_0x538b3c['sendStatus'](0x194);}return _0x5e6668;};}function handleError(_0x4d67cb,_0x241e56){_0x241e56=_0x241e56||0x1f4;return function(_0x2a6dec){logger[_0xdd4a('0x23')](_0x2a6dec[_0xdd4a('0x33')]);if(_0x2a6dec[_0xdd4a('0x34')]){delete _0x2a6dec[_0xdd4a('0x34')];}_0x4d67cb[_0xdd4a('0x29')](_0x241e56)[_0xdd4a('0x35')](_0x2a6dec);};}exports['index']=function(_0x2db628,_0x5be758){var _0x57bfd4={},_0x2636a7={},_0x234576={'count':0x0,'rows':[]};var _0x46107e=_[_0xdd4a('0x36')](db['SmsMessage'][_0xdd4a('0x37')],function(_0xb99a1c){return{'name':_0xb99a1c['fieldName'],'type':_0xb99a1c[_0xdd4a('0x38')][_0xdd4a('0x39')]};});_0x2636a7['model']=_[_0xdd4a('0x36')](_0x46107e,'name');_0x2636a7[_0xdd4a('0x3a')]=_['keys'](_0x2db628['query']);_0x2636a7[_0xdd4a('0x3b')]=_[_0xdd4a('0x3c')](_0x2636a7[_0xdd4a('0x3d')],_0x2636a7[_0xdd4a('0x3a')]);_0x57bfd4[_0xdd4a('0x3e')]=_[_0xdd4a('0x3c')](_0x2636a7[_0xdd4a('0x3d')],qs[_0xdd4a('0x3f')](_0x2db628[_0xdd4a('0x3a')][_0xdd4a('0x3f')]));_0x57bfd4[_0xdd4a('0x3e')]=_0x57bfd4[_0xdd4a('0x3e')][_0xdd4a('0x40')]?_0x57bfd4[_0xdd4a('0x3e')]:_0x2636a7[_0xdd4a('0x3d')];if(!_0x2db628[_0xdd4a('0x3a')]['hasOwnProperty']('nolimit')){_0x57bfd4['limit']=qs['limit'](_0x2db628[_0xdd4a('0x3a')][_0xdd4a('0x2d')]);_0x57bfd4[_0xdd4a('0x2b')]=qs['offset'](_0x2db628[_0xdd4a('0x3a')][_0xdd4a('0x2b')]);}_0x57bfd4['order']=qs['sort'](_0x2db628[_0xdd4a('0x3a')]['sort']);_0x57bfd4['where']=qs[_0xdd4a('0x3b')](_['pick'](_0x2db628[_0xdd4a('0x3a')],_0x2636a7['filters']),_0x46107e);if(_0x2db628[_0xdd4a('0x3a')]['filter']){_0x57bfd4[_0xdd4a('0x41')]=_[_0xdd4a('0x42')](_0x57bfd4[_0xdd4a('0x41')],{'$or':_['map'](_0x46107e,function(_0x229275){if(_0x229275[_0xdd4a('0x38')]!=='VIRTUAL'){var _0x15573b={};_0x15573b[_0x229275['name']]={'$like':'%'+_0x2db628[_0xdd4a('0x3a')][_0xdd4a('0x43')]+'%'};return _0x15573b;}})});}_0x57bfd4=_['merge']({},_0x57bfd4,_0x2db628[_0xdd4a('0x44')]);var _0x3bdc8c={'where':_0x57bfd4[_0xdd4a('0x41')]};return db[_0xdd4a('0x45')][_0xdd4a('0x2e')](_0x3bdc8c)[_0xdd4a('0x1e')](function(_0x5f2d8d){_0x234576['count']=_0x5f2d8d;if(_0x2db628[_0xdd4a('0x3a')][_0xdd4a('0x46')]){_0x57bfd4[_0xdd4a('0x47')]=[{'all':!![]}];}return db[_0xdd4a('0x45')]['findAll'](_0x57bfd4);})['then'](function(_0x2ea5e1){_0x234576[_0xdd4a('0x48')]=_0x2ea5e1;return _0x234576;})[_0xdd4a('0x1e')](respondWithFilteredResult(_0x5be758,_0x57bfd4))['catch'](handleError(_0x5be758,null));};exports[_0xdd4a('0x49')]=function(_0x1e8178,_0x2c2f7a){var _0x40a6b4={'raw':!![],'where':{'id':_0x1e8178[_0xdd4a('0x4a')]['id']}},_0xb0e493={};_0xb0e493[_0xdd4a('0x3d')]=_['keys'](db['SmsMessage'][_0xdd4a('0x37')]);_0xb0e493['query']=_[_0xdd4a('0x4b')](_0x1e8178[_0xdd4a('0x3a')]);_0xb0e493[_0xdd4a('0x3b')]=_[_0xdd4a('0x3c')](_0xb0e493[_0xdd4a('0x3d')],_0xb0e493['query']);_0x40a6b4[_0xdd4a('0x3e')]=_[_0xdd4a('0x3c')](_0xb0e493[_0xdd4a('0x3d')],qs['fields'](_0x1e8178['query'][_0xdd4a('0x3f')]));_0x40a6b4[_0xdd4a('0x3e')]=_0x40a6b4[_0xdd4a('0x3e')][_0xdd4a('0x40')]?_0x40a6b4[_0xdd4a('0x3e')]:_0xb0e493['model'];if(_0x1e8178[_0xdd4a('0x3a')][_0xdd4a('0x46')]){_0x40a6b4[_0xdd4a('0x47')]=[{'all':!![]}];}_0x40a6b4=_[_0xdd4a('0x42')]({},_0x40a6b4,_0x1e8178[_0xdd4a('0x44')]);return db[_0xdd4a('0x45')][_0xdd4a('0x4c')](_0x40a6b4)[_0xdd4a('0x1e')](handleEntityNotFound(_0x2c2f7a,null))[_0xdd4a('0x1e')](respondWithResult(_0x2c2f7a,null))[_0xdd4a('0x27')](handleError(_0x2c2f7a,null));};exports[_0xdd4a('0x4d')]=function(_0x35888f,_0x3fb52d){return db[_0xdd4a('0x45')][_0xdd4a('0x4d')](_0x35888f[_0xdd4a('0x4e')],{})['then'](respondWithResult(_0x3fb52d,0xc9))['catch'](handleError(_0x3fb52d,null));};exports['update']=function(_0x691c39,_0x17bc36){if(_0x691c39[_0xdd4a('0x4e')]['id']){delete _0x691c39[_0xdd4a('0x4e')]['id'];}return db[_0xdd4a('0x45')][_0xdd4a('0x4c')]({'where':{'id':_0x691c39['params']['id']}})[_0xdd4a('0x1e')](handleEntityNotFound(_0x17bc36,null))[_0xdd4a('0x1e')](saveUpdates(_0x691c39['body'],null))[_0xdd4a('0x1e')](respondWithResult(_0x17bc36,null))['catch'](handleError(_0x17bc36,null));};exports['destroy']=function(_0x1289dc,_0x18891c){return db['SmsMessage'][_0xdd4a('0x4c')]({'where':{'id':_0x1289dc['params']['id']}})[_0xdd4a('0x1e')](handleEntityNotFound(_0x18891c,null))['then'](removeEntity(_0x18891c,null))[_0xdd4a('0x27')](handleError(_0x18891c,null));};exports[_0xdd4a('0x4f')]=function(_0x2ffe49,_0x4f6751){return db[_0xdd4a('0x45')][_0xdd4a('0x4f')]()[_0xdd4a('0x1e')](respondWithResult(_0x4f6751,null))[_0xdd4a('0x27')](handleError(_0x4f6751,null));};var interaction_log=require(_0xdd4a('0x50'))(_0xdd4a('0x51'));exports[_0xdd4a('0x52')]=function(_0x52fe9f,_0x489388,_0x47ceb7){var _0x4b63b4={'agent':{},'channel':_0xdd4a('0x53')};if(_0x52fe9f['body']['id']){delete _0x52fe9f[_0xdd4a('0x4e')]['id'];}_0x52fe9f[_0xdd4a('0x4e')][_0xdd4a('0x54')]=!![];_0x52fe9f['body']['readAt']=moment()[_0xdd4a('0x55')](_0xdd4a('0x56'));_0x52fe9f[_0xdd4a('0x4e')]['UserId']=_0x52fe9f[_0xdd4a('0x4e')][_0xdd4a('0x57')]||_0x52fe9f[_0xdd4a('0x58')]['id'];_0x4b63b4[_0xdd4a('0x59')]['id']=_0x52fe9f[_0xdd4a('0x4e')][_0xdd4a('0x57')];return db[_0xdd4a('0x45')][_0xdd4a('0x4c')]({'where':{'id':_0x52fe9f[_0xdd4a('0x4a')]['id'],'UserId':null}})[_0xdd4a('0x1e')](handleEntityNotFound(_0x489388,null))['then'](saveUpdates(_0x52fe9f['body'],null))[_0xdd4a('0x1e')](function(_0x2858ed){if(_0x2858ed){_0x4b63b4['message']=_0x2858ed[_0xdd4a('0x5a')]({'plain':!![]});return db[_0xdd4a('0x5b')]['find']({'where':{'id':_0x2858ed['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x489388,null))[_0xdd4a('0x1e')](function(_0x39c084){if(_0x39c084){return _0x39c084[_0xdd4a('0x5c')]({'UserId':_0x52fe9f[_0xdd4a('0x4e')]['UserId'],'read1stAt':_[_0xdd4a('0x5d')](_0x39c084[_0xdd4a('0x5e')])?moment()['format'](_0xdd4a('0x56')):undefined});}return null;})[_0xdd4a('0x1e')](function(_0x3c89e8){if(_0x3c89e8){_0x4b63b4[_0xdd4a('0x5f')]=_0x3c89e8[_0xdd4a('0x5a')]({'plain':!![]});interaction_log[_0xdd4a('0x1f')](_0xdd4a('0x60'),_0x52fe9f[_0xdd4a('0x58')]['id'],_0x52fe9f[_0xdd4a('0x58')][_0xdd4a('0x34')],_0x52fe9f[_0xdd4a('0x58')][_0xdd4a('0x61')],_0x4b63b4[_0xdd4a('0x5f')]['id'],_0x52fe9f['body']?JSON[_0xdd4a('0x62')](_0x52fe9f[_0xdd4a('0x4e')]):_0xdd4a('0x63'));return respondWithRpcPromise(_0xdd4a('0x64'),_0xdd4a('0x65'),_0x4b63b4);}return null;})['then'](function(_0xacfb8a){var _0x48226b=_0xdd4a('0x66')+_0xacfb8a[_0xdd4a('0x25')][_0xdd4a('0x67')];return db[_0xdd4a('0x68')][_0xdd4a('0x3a')](_0x48226b,{'type':db['Sequelize'][_0xdd4a('0x69')][_0xdd4a('0x6a')],'raw':!![]})[_0xdd4a('0x1e')](function(_0x55e549){return _0x55e549;});})[_0xdd4a('0x1e')](function(_0x269266){if(_0x269266){_0x4b63b4['message'][_0xdd4a('0x6b')]=_0x269266[0x0];if(!_0x52fe9f[_0xdd4a('0x4e')][_0xdd4a('0x57')])return;return db[_0xdd4a('0x6c')][_0xdd4a('0x4c')]({'where':{'id':_0x52fe9f[_0xdd4a('0x4e')][_0xdd4a('0x57')],'role':_0xdd4a('0x59')},'attributes':['id',_0xdd4a('0x34'),_0xdd4a('0x6d'),_0xdd4a('0x6e'),'internal'],'raw':!![]});}return null;})[_0xdd4a('0x1e')](function(_0x2428e3){if(!_0x2428e3)return null;_0x4b63b4['message'][_0xdd4a('0x59')]=_0x2428e3;return _0x4b63b4;})[_0xdd4a('0x1e')](function(_0x5df996){if(_0x5df996){if(_0x52fe9f[_0xdd4a('0x4e')]['manual']){_0x4b63b4['message'][_0xdd4a('0x6f')]=util['format']('SIP/%s',_0x52fe9f[_0xdd4a('0x58')][_0xdd4a('0x34')]);_0x4b63b4[_0xdd4a('0x25')]['channel']=_0x4b63b4[_0xdd4a('0x70')];_0x4b63b4[_0xdd4a('0x25')]['motionChannel']=_0x4b63b4[_0xdd4a('0x70')];_0x4b63b4[_0xdd4a('0x25')][_0xdd4a('0x71')]=_0xdd4a('0x52');return respondWithRpcPromise(_0xdd4a('0x72'),_0xdd4a('0x72'),{'event':'acceptmessage','message':_0x4b63b4[_0xdd4a('0x25')]},client9002)[_0xdd4a('0x1e')](function(){return _0x4b63b4;});}return _0x4b63b4;}return null;})[_0xdd4a('0x1e')](respondWithResult(_0x489388,null))['catch'](handleError(_0x489388,null));};var interaction_log=require('../../config/logger')(_0xdd4a('0x51'));exports[_0xdd4a('0x73')]=function(_0x1fecd7,_0x3afa87,_0x33e569){var _0x270413={'agent':{},'channel':_0xdd4a('0x53')};if(_0x1fecd7['body']['id']){delete _0x1fecd7[_0xdd4a('0x4e')]['id'];}_0x1fecd7[_0xdd4a('0x4e')][_0xdd4a('0x57')]=_0x1fecd7[_0xdd4a('0x4e')][_0xdd4a('0x57')]||_0x1fecd7['user']['id'];_0x270413[_0xdd4a('0x59')]['id']=_0x1fecd7[_0xdd4a('0x4e')][_0xdd4a('0x57')];return db[_0xdd4a('0x45')][_0xdd4a('0x4c')]({'where':{'id':_0x1fecd7[_0xdd4a('0x4a')]['id'],'UserId':null}})[_0xdd4a('0x1e')](handleEntityNotFound(_0x3afa87,null))[_0xdd4a('0x1e')](function(_0x3567da){if(_0x3567da){_0x270413[_0xdd4a('0x25')]=_0x3567da[_0xdd4a('0x5a')]({'plain':!![]});return db[_0xdd4a('0x5b')][_0xdd4a('0x4c')]({'where':{'id':_0x3567da[_0xdd4a('0x74')]}});}return null;})[_0xdd4a('0x1e')](handleEntityNotFound(_0x3afa87,null))[_0xdd4a('0x1e')](function(_0x14ff53){if(_0x14ff53){_0x270413[_0xdd4a('0x5f')]=_0x14ff53['get']({'plain':!![]});interaction_log[_0xdd4a('0x1f')](_0xdd4a('0x75'),_0x1fecd7[_0xdd4a('0x58')]['id'],_0x1fecd7['user'][_0xdd4a('0x34')],_0x1fecd7[_0xdd4a('0x58')][_0xdd4a('0x61')],_0x270413[_0xdd4a('0x5f')]['id'],_0x1fecd7[_0xdd4a('0x4e')]?JSON[_0xdd4a('0x62')](_0x1fecd7[_0xdd4a('0x4e')]):_0xdd4a('0x63'));return respondWithRpcPromise(_0xdd4a('0x76'),_0xdd4a('0x77'),_0x270413);}return null;})[_0xdd4a('0x1e')](function(_0x9cc3ab){var _0x4c6b4e=_0xdd4a('0x66')+_0x9cc3ab[_0xdd4a('0x25')][_0xdd4a('0x67')];return db[_0xdd4a('0x68')]['query'](_0x4c6b4e,{'type':db[_0xdd4a('0x78')]['QueryTypes'][_0xdd4a('0x6a')],'raw':!![]})['then'](function(_0x1dd39b){return _0x1dd39b;});})[_0xdd4a('0x1e')](function(_0x4c95ea){if(_0x4c95ea){_0x270413[_0xdd4a('0x25')]['contact']=_0x4c95ea[0x0];if(!_0x1fecd7[_0xdd4a('0x4e')]['UserId'])return;return db[_0xdd4a('0x6c')][_0xdd4a('0x4c')]({'where':{'id':_0x1fecd7[_0xdd4a('0x4e')][_0xdd4a('0x57')],'role':'agent'},'attributes':['id','name',_0xdd4a('0x6d'),'email',_0xdd4a('0x79')],'raw':!![]});}return null;})[_0xdd4a('0x1e')](function(_0x24a2a6){if(!_0x24a2a6)return null;_0x270413[_0xdd4a('0x25')][_0xdd4a('0x59')]=_0x24a2a6;return _0x270413;})[_0xdd4a('0x1e')](function(_0x27b83a){if(_0x27b83a){_0x27b83a[_0xdd4a('0x25')][_0xdd4a('0x6f')]=util[_0xdd4a('0x55')](_0xdd4a('0x7a'),_0x1fecd7['user'][_0xdd4a('0x34')]);_0x27b83a['message']['channel']=_0x270413[_0xdd4a('0x70')];_0x27b83a[_0xdd4a('0x25')][_0xdd4a('0x7b')]=_0x270413[_0xdd4a('0x70')];_0x27b83a['message']['event']=_0xdd4a('0x73');respondWithRpcPromise(_0xdd4a('0x72'),'EventManager',{'event':_0xdd4a('0x7c'),'message':_0x27b83a[_0xdd4a('0x25')]},client9002);return _0x270413;}return null;})[_0xdd4a('0x1e')](respondWithResult(_0x3afa87,null))[_0xdd4a('0x27')](handleError(_0x3afa87,null));};exports[_0xdd4a('0x29')]=function(_0xe6b2bc,_0x4a110b,_0x5aad31){if(_0xe6b2bc[_0xdd4a('0x4e')]['id']){delete _0xe6b2bc['body']['id'];}var _0x39fc87;return db[_0xdd4a('0x45')][_0xdd4a('0x4c')]({'where':{'id':_0xe6b2bc[_0xdd4a('0x4a')]['id']}})[_0xdd4a('0x1e')](handleEntityNotFound(_0x4a110b,null))[_0xdd4a('0x1e')](function(_0x3d0524){if(_0x3d0524){_0x39fc87=_0x3d0524;return db[_0xdd4a('0x7d')][_0xdd4a('0x4c')]({'where':{'id':_0x3d0524[_0xdd4a('0x7e')]}});}})['then'](handleEntityNotFound(_0x4a110b,null))[_0xdd4a('0x1e')](function(_0x328484){if(_0x328484){logger['debug'](_0xdd4a('0x22'),'status',_0xdd4a('0x7f'),_0x328484['type'],util['inspect'](_0xe6b2bc[_0xdd4a('0x4e')],{'showHidden':![],'depth':null}));switch(_0x328484[_0xdd4a('0x38')]){case _0xdd4a('0x80'):if(_0xe6b2bc[_0xdd4a('0x4e')][_0xdd4a('0x81')]&&_0xe6b2bc['body'][_0xdd4a('0x81')]===_0x39fc87[_0xdd4a('0x82')]){return _0x39fc87[_0xdd4a('0x5c')]({'read':!![]});}else{logger[_0xdd4a('0x23')](_0xdd4a('0x83'),_0xdd4a('0x29'),_0xdd4a('0x80'),util[_0xdd4a('0x84')](_0xe6b2bc[_0xdd4a('0x4e')],{'showHidden':![],'depth':null}));}break;case _0xdd4a('0x85'):if(_0xe6b2bc[_0xdd4a('0x4e')][_0xdd4a('0x86')]&&_0xe6b2bc[_0xdd4a('0x4e')]['MessageUUID']===_0x39fc87[_0xdd4a('0x82')]&&_[_0xdd4a('0x87')]([_0xdd4a('0x88'),'delivered'],_0xe6b2bc[_0xdd4a('0x4e')][_0xdd4a('0x89')])>=0x0){return _0x39fc87[_0xdd4a('0x5c')]({'read':!![]});}else{logger[_0xdd4a('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdd4a('0x29'),_0xdd4a('0x8a'),util[_0xdd4a('0x84')](_0xe6b2bc[_0xdd4a('0x4e')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x357bf2=_0xe6b2bc[_0xdd4a('0x4e')][_0xdd4a('0x8b')][0x0];if(_0x357bf2[_0xdd4a('0x29')][_0xdd4a('0x8c')]===_0xdd4a('0x8d')){return _0x39fc87['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xdd4a('0x29'),_0xdd4a('0x8e'),util['inspect'](_0xe6b2bc[_0xdd4a('0x4e')],{'showHidden':![],'depth':null}));}break;}return _0x39fc87;}})[_0xdd4a('0x1e')](respondWithResult(_0x4a110b,null))['catch'](handleError(_0x4a110b,null));}; \ No newline at end of file +var _0xc6d7=['info','SmsMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','sendStatus','status','json','undefined','limit','count','offset','set','apply','update','destroy','end','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','filter','type','VIRTUAL','options','includeAll','findAll','rows','show','params','include','merge','find','create','body','describe','../../config/logger','sms-interactions','sms','readAt','format','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE: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','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','delivered','Status','inspect','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then'];(function(_0x1dcf37,_0x150062){var _0x4323ea=function(_0x1743e3){while(--_0x1743e3){_0x1dcf37['push'](_0x1dcf37['shift']());}};_0x4323ea(++_0x150062);}(_0xc6d7,0x71));var _0x7c6d=function(_0x16454c,_0x47b7bc){_0x16454c=_0x16454c-0x0;var _0x3136f9=_0xc6d7[_0x16454c];return _0x3136f9;};'use strict';var emlformat=require(_0x7c6d('0x0'));var rimraf=require(_0x7c6d('0x1'));var zipdir=require(_0x7c6d('0x2'));var jsonpatch=require(_0x7c6d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7c6d('0x4'));var Mustache=require(_0x7c6d('0x5'));var util=require(_0x7c6d('0x6'));var path=require(_0x7c6d('0x7'));var sox=require(_0x7c6d('0x8'));var csv=require(_0x7c6d('0x9'));var ejs=require(_0x7c6d('0xa'));var fs=require('fs');var fs_extra=require(_0x7c6d('0xb'));var _=require(_0x7c6d('0xc'));var squel=require(_0x7c6d('0xd'));var crypto=require(_0x7c6d('0xe'));var jsforce=require(_0x7c6d('0xf'));var deskjs=require(_0x7c6d('0x10'));var toCsv=require(_0x7c6d('0x9'));var querystring=require('querystring');var Papa=require(_0x7c6d('0x11'));var Redis=require('ioredis');var authService=require(_0x7c6d('0x12'));var qs=require(_0x7c6d('0x13'));var as=require(_0x7c6d('0x14'));var hardwareService=require(_0x7c6d('0x15'));var logger=require('../../config/logger')(_0x7c6d('0x16'));var utils=require(_0x7c6d('0x17'));var config=require(_0x7c6d('0x18'));var licenseUtil=require(_0x7c6d('0x19'));var db=require(_0x7c6d('0x1a'))['db'];config[_0x7c6d('0x1b')]=_[_0x7c6d('0x1c')](config['redis'],{'host':_0x7c6d('0x1d'),'port':0x18eb});var socket=require(_0x7c6d('0x1e'))(new Redis(config[_0x7c6d('0x1b')]));require(_0x7c6d('0x1f'))[_0x7c6d('0x20')](socket);var jayson=require(_0x7c6d('0x21'));var client=jayson[_0x7c6d('0x22')][_0x7c6d('0x23')]({'port':0x232c});var client9002=jayson[_0x7c6d('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25c8aa,_0x54f2a7,_0x57d8b2,_0x398007){return new BPromise(function(_0x220bae,_0x279ab2){var _0x1b71e2=_0x398007||client;return _0x1b71e2[_0x7c6d('0x24')](_0x25c8aa,_0x57d8b2)[_0x7c6d('0x25')](function(_0x33f097){logger[_0x7c6d('0x26')](_0x7c6d('0x27'),_0x54f2a7,'request\x20sent');logger[_0x7c6d('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x54f2a7,_0x7c6d('0x29'),JSON[_0x7c6d('0x2a')](_0x33f097));if(_0x33f097['error']){if(_0x33f097[_0x7c6d('0x2b')][_0x7c6d('0x2c')]===0x1f4){logger[_0x7c6d('0x2b')](_0x7c6d('0x27'),_0x54f2a7,_0x33f097[_0x7c6d('0x2b')]['message']);return _0x279ab2(_0x33f097[_0x7c6d('0x2b')][_0x7c6d('0x2d')]);}logger[_0x7c6d('0x2b')](_0x7c6d('0x27'),_0x54f2a7,_0x33f097['error'][_0x7c6d('0x2d')]);return _0x220bae(_0x33f097[_0x7c6d('0x2b')][_0x7c6d('0x2d')]);}else{logger[_0x7c6d('0x26')](_0x7c6d('0x27'),_0x54f2a7,_0x7c6d('0x29'));_0x220bae(_0x33f097['result'][_0x7c6d('0x2d')]);}})[_0x7c6d('0x2e')](function(_0x31ce3e){logger[_0x7c6d('0x2b')]('SmsMessage,\x20%s,\x20%s',_0x54f2a7,_0x31ce3e);_0x279ab2(_0x31ce3e);});});}function respondWithStatusCode(_0x53461a,_0x57c4c9){_0x57c4c9=_0x57c4c9||0xcc;return function(_0x1d9b92){if(_0x1d9b92){return _0x53461a[_0x7c6d('0x2f')](_0x57c4c9);}return _0x53461a['status'](_0x57c4c9)['end']();};}function respondWithResult(_0x4f9e80,_0x3766cb){_0x3766cb=_0x3766cb||0xc8;return function(_0x4378a4){if(_0x4378a4){return _0x4f9e80[_0x7c6d('0x30')](_0x3766cb)[_0x7c6d('0x31')](_0x4378a4);}};}function respondWithFilteredResult(_0x194276,_0x162efb){return function(_0x5ccd7b){if(_0x5ccd7b){var _0x5a88ee=typeof _0x162efb['offset']===_0x7c6d('0x32')&&typeof _0x162efb[_0x7c6d('0x33')]==='undefined';var _0x152225=_0x5ccd7b[_0x7c6d('0x34')];var _0x435b52=_0x5a88ee?0x0:_0x162efb[_0x7c6d('0x35')];var _0x6775d6=_0x5a88ee?_0x5ccd7b['count']:_0x162efb['offset']+_0x162efb['limit'];var _0x6dfef6;if(_0x6775d6>=_0x152225){_0x6775d6=_0x152225;_0x6dfef6=0xc8;}else{_0x6dfef6=0xce;}_0x194276['status'](_0x6dfef6);return _0x194276[_0x7c6d('0x36')]('Content-Range',_0x435b52+'-'+_0x6775d6+'/'+_0x152225)['json'](_0x5ccd7b);}return null;};}function patchUpdates(_0x212642){return function(_0x21c827){try{jsonpatch[_0x7c6d('0x37')](_0x21c827,_0x212642,!![]);}catch(_0x147c0b){return BPromise['reject'](_0x147c0b);}return _0x21c827['save']();};}function saveUpdates(_0x132b00,_0x51e5d6){return function(_0x41848e){if(_0x41848e){return _0x41848e[_0x7c6d('0x38')](_0x132b00)[_0x7c6d('0x25')](function(_0x23a8e9){return _0x23a8e9;});}return null;};}function removeEntity(_0xb92090,_0x3587b3){return function(_0x802aa3){if(_0x802aa3){return _0x802aa3[_0x7c6d('0x39')]()[_0x7c6d('0x25')](function(){_0xb92090[_0x7c6d('0x30')](0xcc)[_0x7c6d('0x3a')]();});}};}function handleEntityNotFound(_0x3bea20,_0x3cebed){return function(_0x5d9a4a){if(!_0x5d9a4a){_0x3bea20[_0x7c6d('0x2f')](0x194);}return _0x5d9a4a;};}function handleError(_0x4af647,_0x26115a){_0x26115a=_0x26115a||0x1f4;return function(_0x55b673){logger['error'](_0x55b673[_0x7c6d('0x3b')]);if(_0x55b673[_0x7c6d('0x3c')]){delete _0x55b673[_0x7c6d('0x3c')];}_0x4af647[_0x7c6d('0x30')](_0x26115a)[_0x7c6d('0x3d')](_0x55b673);};}exports[_0x7c6d('0x3e')]=function(_0x32a267,_0x1398f9){var _0x244e2c={},_0x1a5235={},_0x2b890e={'count':0x0,'rows':[]};var _0x486a72=_[_0x7c6d('0x3f')](db[_0x7c6d('0x40')][_0x7c6d('0x41')],function(_0x18c19d){return{'name':_0x18c19d[_0x7c6d('0x42')],'type':_0x18c19d['type']['key']};});_0x1a5235[_0x7c6d('0x43')]=_[_0x7c6d('0x3f')](_0x486a72,_0x7c6d('0x3c'));_0x1a5235[_0x7c6d('0x44')]=_[_0x7c6d('0x45')](_0x32a267[_0x7c6d('0x44')]);_0x1a5235[_0x7c6d('0x46')]=_[_0x7c6d('0x47')](_0x1a5235[_0x7c6d('0x43')],_0x1a5235[_0x7c6d('0x44')]);_0x244e2c['attributes']=_['intersection'](_0x1a5235[_0x7c6d('0x43')],qs[_0x7c6d('0x48')](_0x32a267['query'][_0x7c6d('0x48')]));_0x244e2c[_0x7c6d('0x49')]=_0x244e2c[_0x7c6d('0x49')][_0x7c6d('0x4a')]?_0x244e2c[_0x7c6d('0x49')]:_0x1a5235[_0x7c6d('0x43')];if(!_0x32a267['query'][_0x7c6d('0x4b')]('nolimit')){_0x244e2c[_0x7c6d('0x33')]=qs['limit'](_0x32a267['query'][_0x7c6d('0x33')]);_0x244e2c['offset']=qs[_0x7c6d('0x35')](_0x32a267['query'][_0x7c6d('0x35')]);}_0x244e2c[_0x7c6d('0x4c')]=qs['sort'](_0x32a267['query']['sort']);_0x244e2c[_0x7c6d('0x4d')]=qs['filters'](_['pick'](_0x32a267['query'],_0x1a5235[_0x7c6d('0x46')]),_0x486a72);if(_0x32a267['query'][_0x7c6d('0x4e')]){_0x244e2c['where']=_['merge'](_0x244e2c[_0x7c6d('0x4d')],{'$or':_['map'](_0x486a72,function(_0x4786b0){if(_0x4786b0[_0x7c6d('0x4f')]!==_0x7c6d('0x50')){var _0x249552={};_0x249552[_0x4786b0[_0x7c6d('0x3c')]]={'$like':'%'+_0x32a267[_0x7c6d('0x44')]['filter']+'%'};return _0x249552;}})});}_0x244e2c=_['merge']({},_0x244e2c,_0x32a267[_0x7c6d('0x51')]);var _0x31dee6={'where':_0x244e2c[_0x7c6d('0x4d')]};return db[_0x7c6d('0x40')][_0x7c6d('0x34')](_0x31dee6)['then'](function(_0x3be4f3){_0x2b890e[_0x7c6d('0x34')]=_0x3be4f3;if(_0x32a267[_0x7c6d('0x44')][_0x7c6d('0x52')]){_0x244e2c['include']=[{'all':!![]}];}return db[_0x7c6d('0x40')][_0x7c6d('0x53')](_0x244e2c);})['then'](function(_0x54a14d){_0x2b890e[_0x7c6d('0x54')]=_0x54a14d;return _0x2b890e;})[_0x7c6d('0x25')](respondWithFilteredResult(_0x1398f9,_0x244e2c))[_0x7c6d('0x2e')](handleError(_0x1398f9,null));};exports[_0x7c6d('0x55')]=function(_0x578679,_0x7fab08){var _0x3bbf3d={'raw':!![],'where':{'id':_0x578679[_0x7c6d('0x56')]['id']}},_0x3a6f31={};_0x3a6f31[_0x7c6d('0x43')]=_[_0x7c6d('0x45')](db[_0x7c6d('0x40')][_0x7c6d('0x41')]);_0x3a6f31[_0x7c6d('0x44')]=_[_0x7c6d('0x45')](_0x578679['query']);_0x3a6f31[_0x7c6d('0x46')]=_[_0x7c6d('0x47')](_0x3a6f31[_0x7c6d('0x43')],_0x3a6f31['query']);_0x3bbf3d['attributes']=_[_0x7c6d('0x47')](_0x3a6f31['model'],qs[_0x7c6d('0x48')](_0x578679[_0x7c6d('0x44')][_0x7c6d('0x48')]));_0x3bbf3d[_0x7c6d('0x49')]=_0x3bbf3d[_0x7c6d('0x49')]['length']?_0x3bbf3d[_0x7c6d('0x49')]:_0x3a6f31[_0x7c6d('0x43')];if(_0x578679[_0x7c6d('0x44')][_0x7c6d('0x52')]){_0x3bbf3d[_0x7c6d('0x57')]=[{'all':!![]}];}_0x3bbf3d=_[_0x7c6d('0x58')]({},_0x3bbf3d,_0x578679[_0x7c6d('0x51')]);return db[_0x7c6d('0x40')][_0x7c6d('0x59')](_0x3bbf3d)['then'](handleEntityNotFound(_0x7fab08,null))['then'](respondWithResult(_0x7fab08,null))[_0x7c6d('0x2e')](handleError(_0x7fab08,null));};exports[_0x7c6d('0x5a')]=function(_0x48521e,_0x7ede70){return db[_0x7c6d('0x40')][_0x7c6d('0x5a')](_0x48521e[_0x7c6d('0x5b')],{})[_0x7c6d('0x25')](respondWithResult(_0x7ede70,0xc9))['catch'](handleError(_0x7ede70,null));};exports[_0x7c6d('0x38')]=function(_0x3b0c52,_0x3f83f7){if(_0x3b0c52[_0x7c6d('0x5b')]['id']){delete _0x3b0c52[_0x7c6d('0x5b')]['id'];}return db[_0x7c6d('0x40')][_0x7c6d('0x59')]({'where':{'id':_0x3b0c52['params']['id']}})[_0x7c6d('0x25')](handleEntityNotFound(_0x3f83f7,null))[_0x7c6d('0x25')](saveUpdates(_0x3b0c52['body'],null))['then'](respondWithResult(_0x3f83f7,null))['catch'](handleError(_0x3f83f7,null));};exports[_0x7c6d('0x39')]=function(_0xd375bb,_0x2f3a6b){return db[_0x7c6d('0x40')][_0x7c6d('0x59')]({'where':{'id':_0xd375bb[_0x7c6d('0x56')]['id']}})[_0x7c6d('0x25')](handleEntityNotFound(_0x2f3a6b,null))[_0x7c6d('0x25')](removeEntity(_0x2f3a6b,null))[_0x7c6d('0x2e')](handleError(_0x2f3a6b,null));};exports[_0x7c6d('0x5c')]=function(_0x200c86,_0x38a9f3){return db['SmsMessage'][_0x7c6d('0x5c')]()['then'](respondWithResult(_0x38a9f3,null))[_0x7c6d('0x2e')](handleError(_0x38a9f3,null));};var interaction_log=require(_0x7c6d('0x5d'))(_0x7c6d('0x5e'));exports['accept']=function(_0x38bfa6,_0x1fb03b,_0x3866d9){var _0x204a97={'agent':{},'channel':_0x7c6d('0x5f')};if(_0x38bfa6[_0x7c6d('0x5b')]['id']){delete _0x38bfa6['body']['id'];}_0x38bfa6[_0x7c6d('0x5b')]['read']=!![];_0x38bfa6['body'][_0x7c6d('0x60')]=moment()[_0x7c6d('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x38bfa6[_0x7c6d('0x5b')]['UserId']=_0x38bfa6['body'][_0x7c6d('0x62')]||_0x38bfa6[_0x7c6d('0x63')]['id'];_0x204a97[_0x7c6d('0x64')]['id']=_0x38bfa6[_0x7c6d('0x5b')][_0x7c6d('0x62')];return db[_0x7c6d('0x40')][_0x7c6d('0x59')]({'where':{'id':_0x38bfa6[_0x7c6d('0x56')]['id'],'UserId':null}})[_0x7c6d('0x25')](handleEntityNotFound(_0x1fb03b,null))[_0x7c6d('0x25')](saveUpdates(_0x38bfa6[_0x7c6d('0x5b')],null))[_0x7c6d('0x25')](function(_0xfd71b8){if(_0xfd71b8){_0x204a97[_0x7c6d('0x2d')]=_0xfd71b8[_0x7c6d('0x65')]({'plain':!![]});return db[_0x7c6d('0x66')][_0x7c6d('0x59')]({'where':{'id':_0xfd71b8[_0x7c6d('0x67')]}});}return null;})[_0x7c6d('0x25')](handleEntityNotFound(_0x1fb03b,null))['then'](function(_0x1bfdf1){if(_0x1bfdf1){return _0x1bfdf1['update']({'UserId':_0x38bfa6[_0x7c6d('0x5b')]['UserId'],'read1stAt':_[_0x7c6d('0x68')](_0x1bfdf1[_0x7c6d('0x69')])?moment()[_0x7c6d('0x61')](_0x7c6d('0x6a')):undefined});}return null;})['then'](function(_0xb7a9c2){if(_0xb7a9c2){_0x204a97[_0x7c6d('0x6b')]=_0xb7a9c2[_0x7c6d('0x65')]({'plain':!![]});interaction_log[_0x7c6d('0x26')](_0x7c6d('0x6c'),_0x38bfa6[_0x7c6d('0x63')]['id'],_0x38bfa6[_0x7c6d('0x63')][_0x7c6d('0x3c')],_0x38bfa6[_0x7c6d('0x63')]['role'],_0x204a97[_0x7c6d('0x6b')]['id'],_0x38bfa6[_0x7c6d('0x5b')]?JSON[_0x7c6d('0x2a')](_0x38bfa6['body']):_0x7c6d('0x6d'));return respondWithRpcPromise('AcceptMessage',_0x7c6d('0x6e'),_0x204a97);}return null;})['then'](function(_0x4543b2){var _0x3696ab=_0x7c6d('0x6f')+_0x4543b2[_0x7c6d('0x2d')][_0x7c6d('0x70')];return db[_0x7c6d('0x71')][_0x7c6d('0x44')](_0x3696ab,{'type':db[_0x7c6d('0x72')][_0x7c6d('0x73')][_0x7c6d('0x74')],'raw':!![]})['then'](function(_0x28897a){return _0x28897a;});})[_0x7c6d('0x25')](function(_0x274129){if(_0x274129){_0x204a97[_0x7c6d('0x2d')][_0x7c6d('0x75')]=_0x274129[0x0];if(!_0x38bfa6['body']['UserId'])return;return db[_0x7c6d('0x76')][_0x7c6d('0x59')]({'where':{'id':_0x38bfa6[_0x7c6d('0x5b')][_0x7c6d('0x62')],'role':_0x7c6d('0x64')},'attributes':['id',_0x7c6d('0x3c'),_0x7c6d('0x77'),_0x7c6d('0x78'),_0x7c6d('0x79')],'raw':!![]});}return null;})['then'](function(_0x383fec){if(!_0x383fec)return null;_0x204a97[_0x7c6d('0x2d')]['agent']=_0x383fec;return _0x204a97;})['then'](function(_0x2a6124){if(_0x2a6124){if(_0x38bfa6['body'][_0x7c6d('0x7a')]){_0x204a97[_0x7c6d('0x2d')][_0x7c6d('0x7b')]=util[_0x7c6d('0x61')](_0x7c6d('0x7c'),_0x38bfa6['user']['name']);_0x204a97[_0x7c6d('0x2d')][_0x7c6d('0x7d')]=_0x204a97[_0x7c6d('0x7d')];_0x204a97['message'][_0x7c6d('0x7e')]=_0x204a97[_0x7c6d('0x7d')];_0x204a97[_0x7c6d('0x2d')][_0x7c6d('0x7f')]=_0x7c6d('0x80');return respondWithRpcPromise(_0x7c6d('0x81'),'EventManager',{'event':_0x7c6d('0x82'),'message':_0x204a97[_0x7c6d('0x2d')]},client9002)[_0x7c6d('0x25')](function(){return _0x204a97;});}return _0x204a97;}return null;})['then'](respondWithResult(_0x1fb03b,null))['catch'](handleError(_0x1fb03b,null));};var interaction_log=require(_0x7c6d('0x5d'))(_0x7c6d('0x5e'));exports[_0x7c6d('0x83')]=function(_0x269170,_0x25ae92,_0x1d78e1){var _0x53ab6={'agent':{},'channel':_0x7c6d('0x5f')};if(_0x269170[_0x7c6d('0x5b')]['id']){delete _0x269170[_0x7c6d('0x5b')]['id'];}_0x269170['body'][_0x7c6d('0x62')]=_0x269170[_0x7c6d('0x5b')][_0x7c6d('0x62')]||_0x269170['user']['id'];_0x53ab6['agent']['id']=_0x269170['body'][_0x7c6d('0x62')];return db[_0x7c6d('0x40')][_0x7c6d('0x59')]({'where':{'id':_0x269170[_0x7c6d('0x56')]['id'],'UserId':null}})[_0x7c6d('0x25')](handleEntityNotFound(_0x25ae92,null))['then'](function(_0x4c2281){if(_0x4c2281){_0x53ab6[_0x7c6d('0x2d')]=_0x4c2281[_0x7c6d('0x65')]({'plain':!![]});return db[_0x7c6d('0x66')][_0x7c6d('0x59')]({'where':{'id':_0x4c2281[_0x7c6d('0x67')]}});}return null;})[_0x7c6d('0x25')](handleEntityNotFound(_0x25ae92,null))[_0x7c6d('0x25')](function(_0x12e7ef){if(_0x12e7ef){_0x53ab6[_0x7c6d('0x6b')]=_0x12e7ef[_0x7c6d('0x65')]({'plain':!![]});interaction_log[_0x7c6d('0x26')](_0x7c6d('0x84'),_0x269170[_0x7c6d('0x63')]['id'],_0x269170[_0x7c6d('0x63')][_0x7c6d('0x3c')],_0x269170['user']['role'],_0x53ab6[_0x7c6d('0x6b')]['id'],_0x269170['body']?JSON['stringify'](_0x269170['body']):_0x7c6d('0x6d'));return respondWithRpcPromise(_0x7c6d('0x85'),_0x7c6d('0x86'),_0x53ab6);}return null;})[_0x7c6d('0x25')](function(_0x4d54da){var _0x4acd86='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4d54da[_0x7c6d('0x2d')]['ContactId'];return db[_0x7c6d('0x71')][_0x7c6d('0x44')](_0x4acd86,{'type':db['Sequelize']['QueryTypes'][_0x7c6d('0x74')],'raw':!![]})[_0x7c6d('0x25')](function(_0x1503d4){return _0x1503d4;});})[_0x7c6d('0x25')](function(_0x4f5224){if(_0x4f5224){_0x53ab6['message'][_0x7c6d('0x75')]=_0x4f5224[0x0];if(!_0x269170[_0x7c6d('0x5b')][_0x7c6d('0x62')])return;return db['User']['find']({'where':{'id':_0x269170[_0x7c6d('0x5b')]['UserId'],'role':'agent'},'attributes':['id',_0x7c6d('0x3c'),_0x7c6d('0x77'),_0x7c6d('0x78'),_0x7c6d('0x79')],'raw':!![]});}return null;})[_0x7c6d('0x25')](function(_0x1dab0e){if(!_0x1dab0e)return null;_0x53ab6[_0x7c6d('0x2d')][_0x7c6d('0x64')]=_0x1dab0e;return _0x53ab6;})[_0x7c6d('0x25')](function(_0x2da28a){if(_0x2da28a){_0x2da28a['message'][_0x7c6d('0x7b')]=util[_0x7c6d('0x61')](_0x7c6d('0x7c'),_0x269170[_0x7c6d('0x63')]['name']);_0x2da28a[_0x7c6d('0x2d')][_0x7c6d('0x7d')]=_0x53ab6[_0x7c6d('0x7d')];_0x2da28a[_0x7c6d('0x2d')][_0x7c6d('0x7e')]=_0x53ab6[_0x7c6d('0x7d')];_0x2da28a[_0x7c6d('0x2d')][_0x7c6d('0x7f')]=_0x7c6d('0x83');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x2da28a[_0x7c6d('0x2d')]},client9002);return _0x53ab6;}return null;})[_0x7c6d('0x25')](respondWithResult(_0x25ae92,null))['catch'](handleError(_0x25ae92,null));};exports[_0x7c6d('0x30')]=function(_0x393466,_0x47e431,_0x4b6563){if(_0x393466[_0x7c6d('0x5b')]['id']){delete _0x393466['body']['id'];}var _0x2edaac;return db[_0x7c6d('0x40')][_0x7c6d('0x59')]({'where':{'id':_0x393466[_0x7c6d('0x56')]['id']}})['then'](handleEntityNotFound(_0x47e431,null))['then'](function(_0x55890c){if(_0x55890c){_0x2edaac=_0x55890c;return db[_0x7c6d('0x87')]['find']({'where':{'id':_0x55890c[_0x7c6d('0x88')]}});}})[_0x7c6d('0x25')](handleEntityNotFound(_0x47e431,null))[_0x7c6d('0x25')](function(_0x6495b0){if(_0x6495b0){logger[_0x7c6d('0x28')](_0x7c6d('0x89'),_0x7c6d('0x30'),'received\x20delivery\x20report\x20from',_0x6495b0[_0x7c6d('0x4f')],util['inspect'](_0x393466['body'],{'showHidden':![],'depth':null}));switch(_0x6495b0[_0x7c6d('0x4f')]){case _0x7c6d('0x8a'):if(_0x393466[_0x7c6d('0x5b')][_0x7c6d('0x8b')]&&_0x393466['body']['MessageSid']===_0x2edaac[_0x7c6d('0x8c')]){return _0x2edaac[_0x7c6d('0x38')]({'read':!![]});}else{logger['error'](_0x7c6d('0x8d'),_0x7c6d('0x30'),_0x7c6d('0x8a'),util['inspect'](_0x393466[_0x7c6d('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x7c6d('0x8e'):if(_0x393466[_0x7c6d('0x5b')]['MessageUUID']&&_0x393466[_0x7c6d('0x5b')][_0x7c6d('0x8f')]===_0x2edaac['messageId']&&_[_0x7c6d('0x90')](['sent',_0x7c6d('0x91')],_0x393466['body'][_0x7c6d('0x92')])>=0x0){return _0x2edaac[_0x7c6d('0x38')]({'read':!![]});}else{logger[_0x7c6d('0x2b')](_0x7c6d('0x8d'),_0x7c6d('0x30'),'plivio',util[_0x7c6d('0x93')](_0x393466[_0x7c6d('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x7c6d('0x94'):var _0x516d84=_0x393466[_0x7c6d('0x5b')]['results'][0x0];if(_0x516d84['status'][_0x7c6d('0x95')]===_0x7c6d('0x96')){return _0x2edaac[_0x7c6d('0x38')]({'read':!![]});}else{logger[_0x7c6d('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7c6d('0x30'),_0x7c6d('0x94'),util[_0x7c6d('0x93')](_0x393466[_0x7c6d('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x2edaac;}})[_0x7c6d('0x25')](respondWithResult(_0x47e431,null))[_0x7c6d('0x2e')](handleError(_0x47e431,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 2735695..187fcfe 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 _0x560a=['events','../../mysqldb','SmsMessage','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5cae60,_0x5eef37){var _0x1c909e=function(_0x28cf16){while(--_0x28cf16){_0x5cae60['push'](_0x5cae60['shift']());}};_0x1c909e(++_0x5eef37);}(_0x560a,0x110));var _0xa560=function(_0x1cee2b,_0x1dcd83){_0x1cee2b=_0x1cee2b-0x0;var _0x2c67e2=_0x560a[_0x1cee2b];return _0x2c67e2;};'use strict';var EventEmitter=require(_0xa560('0x0'));var SmsMessage=require(_0xa560('0x1'))['db'][_0xa560('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa560('0x3')};function emitEvent(_0x57903f){return function(_0x294704,_0xd2c2ad,_0x223ce6){SmsMessageEvents[_0xa560('0x4')](_0x57903f+':'+_0x294704['id'],_0x294704);SmsMessageEvents[_0xa560('0x4')](_0x57903f,_0x294704);_0x223ce6(null);};}for(var e in events){if(events[_0xa560('0x5')](e)){var event=events[e];SmsMessage[_0xa560('0x6')](e,emitEvent(event));}}module[_0xa560('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0xf581=['save','update','remove','hasOwnProperty','hook','../../mysqldb','SmsMessage'];(function(_0x13977c,_0x21ceac){var _0x184062=function(_0x50554c){while(--_0x50554c){_0x13977c['push'](_0x13977c['shift']());}};_0x184062(++_0x21ceac);}(_0xf581,0xbb));var _0x1f58=function(_0x41765d,_0xb2208a){_0x41765d=_0x41765d-0x0;var _0x537535=_0xf581[_0x41765d];return _0x537535;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x1f58('0x0'))['db'][_0x1f58('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1f58('0x2'),'afterUpdate':_0x1f58('0x3'),'afterDestroy':_0x1f58('0x4')};function emitEvent(_0x45ad49){return function(_0x210612,_0x1d5520,_0x45a5f1){SmsMessageEvents['emit'](_0x45ad49+':'+_0x210612['id'],_0x210612);SmsMessageEvents['emit'](_0x45ad49,_0x210612);_0x45a5f1(null);};}for(var e in events){if(events[_0x1f58('0x5')](e)){var event=events[e];SmsMessage[_0x1f58('0x6')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index a3323be..f7bd8eb 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 _0x6346=['utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','secret','UserId','isNil','SmsInteractionId','SmsInteraction','createdAt','catch','error','out','find','then','type','twilio','accountSid','phone','authToken','messages','remote','/api/sms/messages/','/status?token=','token','update','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','username','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','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','queued_count','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','keys','sort','length','createHash','digest','signature=','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','intelepeer','Token\x20not\x20received','finally'];(function(_0xf48bee,_0x115451){var _0x10f6ac=function(_0x25e54b){while(--_0x25e54b){_0xf48bee['push'](_0xf48bee['shift']());}};_0x10f6ac(++_0x115451);}(_0x6346,0x1f2));var _0x6634=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x6346[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x6634('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6634('0x1'));var BPromise=require(_0x6634('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6634('0x3'));var rimraf=require(_0x6634('0x4'));var config=require(_0x6634('0x5'));var attributes=require('./smsMessage.attributes');module[_0x6634('0x6')]=function(_0x427ecf,_0x1fa49e){return _0x427ecf[_0x6634('0x7')](_0x6634('0x8'),attributes,{'tableName':_0x6634('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x6634('0xa')]},{'name':_0x6634('0xb'),'fields':[_0x6634('0xc')],'type':_0x6634('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ffc44,_0x4be957,_0x4053f2){var _0x88fdd2=_0x427ecf[_0x6634('0xe')];var _0x51162a=_0x2ffc44['get']({'plain':!![]});if(_0x51162a[_0x6634('0xf')][_0x6634('0x10')]()==='in'||_0x51162a[_0x6634('0xf')][_0x6634('0x10')]()==='out'&&!_0x51162a[_0x6634('0x11')]&&!_['isNil'](_0x51162a[_0x6634('0x12')])&&!_[_0x6634('0x13')](_0x51162a[_0x6634('0x14')])){_0x88fdd2[_0x6634('0x15')]['findOne']({'where':{'id':_0x51162a[_0x6634('0x14')]}})['then'](function(_0x39248e){if(_0x39248e){_0x39248e['update']({'lastMsgAt':_0x51162a[_0x6634('0x16')],'lastMsgDirection':_0x51162a[_0x6634('0xf')][_0x6634('0x10')]()});}})[_0x6634('0x17')](function(_0x494dd8){console[_0x6634('0x18')](_0x494dd8);});}if(_0x51162a[_0x6634('0xf')]===_0x6634('0x19')&&!_0x51162a[_0x6634('0x11')]){var _0x2b6491;_0x88fdd2['SmsAccount'][_0x6634('0x1a')]({'where':{'id':_0x51162a['SmsAccountId']},'raw':!![]})[_0x6634('0x1b')](function(_0x303c5a){_0x2b6491=_0x303c5a;if(_0x2b6491&&_0x2b6491['type']){switch(_0x2b6491[_0x6634('0x1c')]){case _0x6634('0x1d'):var _0xc9695f=require('twilio');if(_0x2b6491[_0x6634('0x1e')]&&_0x2b6491['authToken']&&_0x2b6491[_0x6634('0x1f')]){var _0x30b043=new _0xc9695f(_0x2b6491[_0x6634('0x1e')],_0x2b6491[_0x6634('0x20')]);_0x30b043[_0x6634('0x21')]['create']({'body':_0x51162a[_0x6634('0xc')],'to':_0x51162a[_0x6634('0x1f')],'from':_0x2b6491[_0x6634('0x1f')],'statusCallback':_0x2b6491[_0x6634('0x22')]+_0x6634('0x23')+_0x51162a['id']+_0x6634('0x24')+_0x2b6491[_0x6634('0x25')]})[_0x6634('0x1b')](function(_0x1520b0){if(_0x1520b0['sid']){return _0x2ffc44[_0x6634('0x26')]({'messageId':_0x1520b0[_0x6634('0x27')]});}})['catch'](function(_0x17c180){logger[_0x6634('0x18')](_0x6634('0x28'),_0x6634('0x29'),_0x6634('0x1d'),util['inspect'](_0x17c180,{'showHidden':![],'depth':null}));});}else{logger[_0x6634('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x6634('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x6634('0x2a'):var _0x14e659=_0x6634('0x2b');if(_0x2b6491['username']&&_0x2b6491[_0x6634('0x2c')]){var _0x2e3e13={'recipient':[_0x51162a[_0x6634('0x1f')]],'message':_0x51162a[_0x6634('0xc')],'message_type':_0x2b6491[_0x6634('0x2d')]};if(_0x2b6491[_0x6634('0x2d')]&&_0x2b6491[_0x6634('0x2d')]!=='SI'){_0x2e3e13[_0x6634('0x2e')]=_0x2b6491['phone'];}var _0x4bcd5f={'url':_0x14e659+_0x6634('0x2f')+_0x2b6491[_0x6634('0x30')]+_0x6634('0x31')+_0x2b6491[_0x6634('0x2c')],'method':_0x6634('0x32')};rp(_0x4bcd5f)[_0x6634('0x1b')](function(_0x1d148e){var _0x11df24=_0x1d148e[_0x6634('0x33')](';');var _0x55c066={'user_key':_0x11df24[0x0],'session_key':_0x11df24[0x1]};_0x4bcd5f={'url':_0x14e659+_0x6634('0x34'),'method':_0x6634('0x35'),'headers':{'user_key':_0x55c066[_0x6634('0x36')],'Session_key':_0x55c066[_0x6634('0x37')]},'json':!![],'body':_0x2e3e13};return rp(_0x4bcd5f);})[_0x6634('0x1b')](function(_0x3802a0){if(_0x3802a0[_0x6634('0x38')]>=0x1){var _0x29fa3c={'messageId':_0x3802a0[_0x6634('0x39')]};if(_0x2b6491['smsMethod']!=='GP'||!_0x2b6491[_0x6634('0x3a')]){_0x29fa3c[_0x6634('0x3b')]=!![];}return _0x2ffc44[_0x6634('0x26')](_0x29fa3c);}else{return logger[_0x6634('0x18')](_0x6634('0x28'),'afterCreate',_0x6634('0x2a'),util[_0x6634('0x3c')](_0x3802a0,{'showHidden':![],'depth':null}));}})[_0x6634('0x17')](function(_0x27a540){return logger[_0x6634('0x18')](_0x6634('0x28'),_0x6634('0x29'),'skebby',util['inspect'](_0x27a540,{'showHidden':![],'depth':null}));});}else{logger[_0x6634('0x18')](_0x6634('0x28'),_0x6634('0x29'),'skebby',_0x6634('0x3d'));}break;case _0x6634('0x3e'):if(_0x2b6491[_0x6634('0x20')]){var _0x4a980c={'recipient':_0x51162a[_0x6634('0x1f')],'message':_0x51162a['body'],'sender':_0x2b6491[_0x6634('0x3f')]||_0x2b6491[_0x6634('0x1f')],'authorization':_0x2b6491[_0x6634('0x20')]};var _0x4be957={'method':_0x6634('0x35'),'uri':_0x6634('0x40'),'body':_0x4a980c,'json':!![]};rp(_0x4be957)['then'](function(_0x1df835){var _0x15227f={'messageId':_0x1df835[_0x6634('0x41')]};if(!_0x2b6491[_0x6634('0x3a')]){_0x15227f['read']=!![];}return _0x2ffc44[_0x6634('0x26')](_0x15227f);})['catch'](function(_0x26c630){logger[_0x6634('0x18')](_0x6634('0x28'),_0x6634('0x29'),'connectel',util[_0x6634('0x3c')](_0x26c630,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x6634('0x28'),_0x6634('0x29'),'connectel',_0x6634('0x42'));}break;case _0x6634('0x43'):if(_0x2b6491[_0x6634('0x30')]&&_0x2b6491['password']){var _0x4a980c={'messages':[{'source':_0x6634('0x44'),'to':_0x51162a['phone'],'body':_0x51162a['body'],'from':_0x2b6491[_0x6634('0x3f')]||_0x2b6491['phone']}]};var _0x360fea=util[_0x6634('0x45')](_0x6634('0x46'),_0x2b6491[_0x6634('0x30')],_0x2b6491[_0x6634('0x2c')]);var _0x4be957={'method':_0x6634('0x35'),'uri':_0x6634('0x47'),'body':_0x4a980c,'headers':{'Authorization':util[_0x6634('0x45')](_0x6634('0x48'),new Buffer(_0x360fea)[_0x6634('0x49')](_0x6634('0x4a')))},'json':!![]};rp(_0x4be957)['then'](function(_0x91696e){if(_0x91696e[_0x6634('0x4b')]>=0xc8&&_0x91696e[_0x6634('0x4b')]<=0xce){if(_0x91696e[_0x6634('0x4c')]&&_0x91696e[_0x6634('0x4c')][_0x6634('0x4d')]>0x0){var _0x3b5cea=_['head'](_0x91696e[_0x6634('0x4c')]['messages']);var _0x27ba6f={'messageId':_0x3b5cea['message_id']};if(!_0x2b6491[_0x6634('0x3a')]){_0x27ba6f[_0x6634('0x3b')]=!![];}return _0x2ffc44[_0x6634('0x26')](_0x27ba6f);}else{logger[_0x6634('0x18')](_0x6634('0x28'),'afterCreate','clickSend',util[_0x6634('0x3c')](_0x91696e,{'showHidden':![],'depth':null}));}}else{logger[_0x6634('0x18')](_0x6634('0x28'),_0x6634('0x29'),'clickSend',util['inspect'](_0x91696e,{'showHidden':![],'depth':null}));}})[_0x6634('0x17')](function(_0x3e1bd7){logger[_0x6634('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6634('0x29'),_0x6634('0x4e'),util[_0x6634('0x3c')](_0x3e1bd7,{'showHidden':![],'depth':null}));});}else{logger[_0x6634('0x18')](_0x6634('0x28'),_0x6634('0x29'),_0x6634('0x4e'),_0x6634('0x3d'));}break;case _0x6634('0x4f'):if(_0x2b6491[_0x6634('0x50')]&&_0x2b6491['authToken']){var _0x4a980c={'dst':_0x51162a['phone'],'text':_0x51162a[_0x6634('0xc')],'src':_0x2b6491['senderString']||_0x2b6491['phone'],'url':_0x2b6491['remote']+_0x6634('0x23')+_0x51162a['id']+_0x6634('0x24')+_0x2b6491['token']};var _0x360fea=util[_0x6634('0x45')](_0x6634('0x46'),_0x2b6491[_0x6634('0x50')],_0x2b6491[_0x6634('0x20')]);var _0x4be957={'method':_0x6634('0x35'),'uri':util[_0x6634('0x45')](_0x6634('0x51'),_0x2b6491['authId']),'body':_0x4a980c,'headers':{'Authorization':util[_0x6634('0x45')](_0x6634('0x48'),new Buffer(_0x360fea)[_0x6634('0x49')](_0x6634('0x4a')))},'json':!![]};rp(_0x4be957)['then'](function(_0x1c5e93){var _0x2ad18e={'messageId':_0x1c5e93[_0x6634('0x52')][0x0]};return _0x2ffc44[_0x6634('0x26')](_0x2ad18e);})[_0x6634('0x17')](function(_0x3c8caa){logger['error'](_0x6634('0x28'),_0x6634('0x29'),_0x6634('0x4f'),util[_0x6634('0x3c')](_0x3c8caa,{'showHidden':![],'depth':null}));});}else{logger[_0x6634('0x18')](_0x6634('0x28'),_0x6634('0x29'),_0x6634('0x4f'),_0x6634('0x53'));}break;case _0x6634('0x54'):if(_0x2b6491['username']&&_0x2b6491['password']){if(_0x2b6491[_0x6634('0x55')]){var _0xf6724d={'method':_0x6634('0x35'),'uri':_0x2b6491[_0x6634('0x55')]+_0x6634('0x56'),'body':{'username':_0x2b6491[_0x6634('0x30')],'password':_0x2b6491[_0x6634('0x2c')]},'json':!![]};return rp(_0xf6724d)['then'](function(_0x2c8200){var _0x280699={'method':'POST','uri':_0x2b6491[_0x6634('0x55')]+_0x6634('0x57'),'body':{'messages':[{'from':_0x2b6491[_0x6634('0x1f')],'destinations':[{'to':_0x51162a[_0x6634('0x1f')]}],'text':_0x51162a[_0x6634('0xc')],'notifyUrl':_0x2b6491[_0x6634('0x22')]+'/api/sms/messages/'+_0x51162a['id']+_0x6634('0x24')+_0x2b6491[_0x6634('0x25')],'notifyContentType':_0x6634('0x58'),'callbackData':_0x2b6491[_0x6634('0x1f')]+';'+_0x51162a['body']}]},'headers':{'Authorization':_0x6634('0x59')+_0x2c8200[_0x6634('0x25')]},'json':!![]};return rp(_0x280699)[_0x6634('0x1b')](function(_0x17f1c6){if(_0x17f1c6['messages']){var _0x1308a7={'messageId':_0x17f1c6['messages'][0x0][_0x6634('0xa')]};if(!_0x2b6491['deliveryReport']){_0x1308a7[_0x6634('0x3b')]=!![];}return _0x2ffc44[_0x6634('0x26')](_0x1308a7);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x6634('0x54'),util['inspect'](_0x17f1c6,{'showHidden':![],'depth':null}));}});})[_0x6634('0x17')](function(_0x431d02){return logger[_0x6634('0x18')](_0x6634('0x28'),_0x6634('0x29'),_0x6634('0x54'),util[_0x6634('0x3c')](_0x431d02,{'showHidden':![],'depth':null}));});}else{logger[_0x6634('0x18')](_0x6634('0x28'),_0x6634('0x29'),_0x6634('0x54'),_0x6634('0x5a'));}}else{logger['error'](_0x6634('0x28'),'afterCreate',_0x6634('0x54'),_0x6634('0x3d'));}break;case _0x6634('0x5b'):var _0x168eab=require(_0x6634('0x5c'));if(_0x2b6491[_0x6634('0x5d')]){var _0x586207={};_0x586207[_0x6634('0x5e')]=_0x2b6491[_0x6634('0x30')];_0x586207[_0x6634('0x1f')]=_0x51162a[_0x6634('0x1f')];_0x586207[_0x6634('0x2e')]=_0x2b6491['phone'];_0x586207[_0x6634('0x5f')]=_0x51162a[_0x6634('0xc')];_0x586207['timestamp']=+new Date();var _0x35cc6b='';var _0x5acdd1='';var _0x2d89e8=Object[_0x6634('0x60')](_0x586207);_0x2d89e8[_0x6634('0x61')]();for(var _0x1dcb5c=0x0;_0x1dcb5c<_0x2d89e8[_0x6634('0x62')];_0x1dcb5c++){if(_0x35cc6b!=''){_0x35cc6b+='&';}_0x35cc6b+=_0x2d89e8[_0x1dcb5c]+'='+encodeURIComponent(_0x586207[_0x2d89e8[_0x1dcb5c]]);_0x5acdd1+=_0x586207[_0x2d89e8[_0x1dcb5c]];}_0x5acdd1+=_0x2b6491[_0x6634('0x5d')];_0x5acdd1=_0x168eab[_0x6634('0x63')]('md5')[_0x6634('0x26')](_0x5acdd1)[_0x6634('0x64')]('hex');if(_0x35cc6b!==''){_0x35cc6b+='&';}_0x35cc6b+=_0x6634('0x65')+_0x5acdd1;var _0x4bcd5f={'method':_0x6634('0x32'),'uri':_0x2b6491[_0x6634('0x55')]+'/external/get/send.php?'+_0x35cc6b,'json':!![]};return rp(_0x4bcd5f)[_0x6634('0x1b')](function(_0x111d69){var _0x57ba31=Object[_0x6634('0x60')](_0x111d69);if(_0x111d69[_0x57ba31[0x0]][_0x6634('0x18')]&&parseInt(_0x111d69[_0x57ba31[0x0]][_0x6634('0x18')])===0x0){var _0x5b51a9={'messageId':_0x111d69[_0x57ba31[0x0]][_0x6634('0x66')]};if(!_0x2b6491['deliveryReport']){_0x5b51a9[_0x6634('0x3b')]=!![];}return _0x2ffc44['update'](_0x5b51a9);}else{return logger[_0x6634('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6634('0x29'),_0x6634('0x5b'),util[_0x6634('0x3c')](_0x111d69[_0x6634('0x18')],{'showHidden':![],'depth':null}));}})[_0x6634('0x17')](function(_0x1436a7){return logger[_0x6634('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6634('0x29'),_0x6634('0x5b'),util[_0x6634('0x3c')](_0x1436a7,{'showHidden':![],'depth':null}));});}else{logger[_0x6634('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6634('0x29'),_0x6634('0x5b'),_0x6634('0x67'));}break;case _0x6634('0x68'):if(_0x2b6491[_0x6634('0x5d')]){var _0x23546b={'method':_0x6634('0x35'),'uri':_0x6634('0x69'),'headers':{'Authorization':_0x2b6491[_0x6634('0x5d')]},'body':{'content':_0x51162a[_0x6634('0xc')],'to':[_0x51162a[_0x6634('0x1f')]],'from':_0x2b6491['phone'],'binary':![],'clientMessageId':_0x6634('0x6a'),'charset':_0x6634('0x6b')},'json':!![]};rp(_0x23546b)[_0x6634('0x1b')](function(_0x12d537){if(!_0x12d537[_0x6634('0x18')]){var _0xa43fbe={'messageId':_0x12d537[_0x6634('0x21')][0x0][_0x6634('0x6c')]};if(!_0x2b6491[_0x6634('0x3a')]){_0xa43fbe['read']=!![];}return _0x2ffc44[_0x6634('0x26')](_0xa43fbe);}else{return logger[_0x6634('0x18')](_0x6634('0x28'),'afterCreate',_0x6634('0x68'),util[_0x6634('0x3c')](_0x12d537[_0x6634('0x18')],{'showHidden':![],'depth':null}));}})[_0x6634('0x17')](function(_0xb67d5f){return logger[_0x6634('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6634('0x29'),_0x6634('0x68'),util['inspect'](_0xb67d5f,{'showHidden':![],'depth':null}));});}else{logger[_0x6634('0x18')](_0x6634('0x28'),_0x6634('0x29'),_0x6634('0x68'),_0x6634('0x67'));}break;case _0x6634('0x6d'):if(_0x2b6491['username']&&_0x2b6491['password']){var _0x360fea=util['format'](_0x6634('0x46'),_0x2b6491['username'],_0x2b6491[_0x6634('0x2c')]);var _0x4be957={'method':_0x6634('0x35'),'uri':_0x6634('0x6e')+_0x2b6491[_0x6634('0x6f')]+_0x6634('0x70'),'body':{'to':[_0x51162a[_0x6634('0x1f')]],'text':_0x51162a[_0x6634('0xc')],'from':_0x2b6491[_0x6634('0x1f')],'applicationId':_0x2b6491['applicationId']},'headers':{'Authorization':util[_0x6634('0x45')]('Basic\x20%s',new Buffer(_0x360fea)['toString'](_0x6634('0x4a')))},'json':!![]};rp(_0x4be957)[_0x6634('0x1b')](function(_0xfbac03){if(_0xfbac03['id']){var _0x419ce5={'messageId':_0xfbac03['id']};return _0x2ffc44['update'](_0x419ce5);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6634('0x29'),_0x6634('0x6d'),util[_0x6634('0x3c')](_0xfbac03,{'showHidden':![],'depth':null}));}})[_0x6634('0x17')](function(_0x3b4955){logger[_0x6634('0x18')](_0x6634('0x28'),_0x6634('0x29'),_0x6634('0x6d'),util[_0x6634('0x3c')](_0x3b4955,{'showHidden':![],'depth':null}));});}else{logger[_0x6634('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6634('0x29'),_0x6634('0x6d'),_0x6634('0x3d'));}break;case'intelepeer':if(_0x2b6491[_0x6634('0x5d')]){var _0x5e5ebe={};var _0x4bcd5f={'method':_0x6634('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x6634('0x71')+_0x2b6491[_0x6634('0x5d')],'Content-Type':_0x6634('0x58')},'body':{'from':_0x2b6491['phone'],'to':_0x51162a[_0x6634('0x1f')],'text':_0x51162a[_0x6634('0xc')]},'json':!![]};return rp(_0x4bcd5f)[_0x6634('0x1b')](function(_0x244673){if(_0x244673[_0x6634('0x72')]==0xca){_0x5e5ebe[_0x6634('0x73')]=_0x244673;var _0x5361e6={'method':'POST','uri':_0x6634('0x74'),'headers':{'Authorization':_0x6634('0x71')+_0x2b6491[_0x6634('0x5d')],'Content-Type':_0x6634('0x58')},'body':{'refid':_0x5e5ebe[_0x6634('0x73')]['refid']},'json':!![]};return rp(_0x5361e6)[_0x6634('0x1b')](function(_0x4f3434){_0x5e5ebe[_0x6634('0x75')]=_0x4f3434;var _0x11505b={'messageId':_0x5e5ebe[_0x6634('0x73')][_0x6634('0x76')],'read':!![]};return _0x2ffc44[_0x6634('0x26')](_0x11505b);});}else{return logger[_0x6634('0x18')](_0x6634('0x28'),'afterCreate',_0x6634('0x77'),util['inspect'](_0x244673,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5eb012){return logger[_0x6634('0x18')](_0x6634('0x28'),_0x6634('0x29'),'intelepeer',util[_0x6634('0x3c')](_0x5eb012,{'showHidden':![],'depth':null}));});}else{return logger[_0x6634('0x18')](_0x6634('0x28'),_0x6634('0x29'),_0x6634('0x77'),_0x6634('0x78'));}break;}}})[_0x6634('0x79')](function(){_0x4053f2();});}else{_0x4053f2();}}},'charset':_0x6634('0x7a'),'collate':_0x6634('0x7b')});}; \ No newline at end of file +var _0x204f=['/messages','applicationId','bandwidth','intelepeer','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','direction','error','find','SmsAccountId','type','accountSid','authToken','phone','messages','remote','/api/sms/messages/','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','sms','user_key','session_key','deliveryReport','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','POST','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','text','timestamp','keys','sort','apiKey','createHash','md5','digest','hex','signature=','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','apiMessageId','clickatell','https://messaging.bandwidth.com/api/v2/users/','accountId'];(function(_0x195764,_0x2d7739){var _0xd02ca8=function(_0x17bc90){while(--_0x17bc90){_0x195764['push'](_0x195764['shift']());}};_0xd02ca8(++_0x2d7739);}(_0x204f,0x8c));var _0xf204=function(_0x227859,_0x58688e){_0x227859=_0x227859-0x0;var _0x1a3ca9=_0x204f[_0x227859];return _0x1a3ca9;};'use strict';var _=require(_0xf204('0x0'));var util=require(_0xf204('0x1'));var logger=require(_0xf204('0x2'))('api');var moment=require(_0xf204('0x3'));var BPromise=require(_0xf204('0x4'));var rp=require(_0xf204('0x5'));var fs=require('fs');var path=require(_0xf204('0x6'));var rimraf=require(_0xf204('0x7'));var config=require(_0xf204('0x8'));var attributes=require(_0xf204('0x9'));module[_0xf204('0xa')]=function(_0x46c001,_0x4dc70c){return _0x46c001['define'](_0xf204('0xb'),attributes,{'tableName':_0xf204('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xf204('0xd')]},{'name':_0xf204('0xe'),'fields':[_0xf204('0xf')],'type':_0xf204('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x265caa,_0x170d48,_0x255616){var _0x43d769=_0x46c001[_0xf204('0x11')];var _0x3aca32=_0x265caa[_0xf204('0x12')]({'plain':!![]});if(_0x3aca32['direction'][_0xf204('0x13')]()==='in'||_0x3aca32['direction'][_0xf204('0x13')]()===_0xf204('0x14')&&!_0x3aca32[_0xf204('0x15')]&&!_[_0xf204('0x16')](_0x3aca32[_0xf204('0x17')])&&!_[_0xf204('0x16')](_0x3aca32[_0xf204('0x18')])){_0x43d769[_0xf204('0x19')][_0xf204('0x1a')]({'where':{'id':_0x3aca32[_0xf204('0x18')]}})[_0xf204('0x1b')](function(_0x2f65b4){if(_0x2f65b4){_0x2f65b4[_0xf204('0x1c')]({'lastMsgAt':_0x3aca32['createdAt'],'lastMsgDirection':_0x3aca32[_0xf204('0x1d')][_0xf204('0x13')]()});}})['catch'](function(_0xda2077){console[_0xf204('0x1e')](_0xda2077);});}if(_0x3aca32['direction']===_0xf204('0x14')&&!_0x3aca32[_0xf204('0x15')]){var _0x43a00f;_0x43d769['SmsAccount'][_0xf204('0x1f')]({'where':{'id':_0x3aca32[_0xf204('0x20')]},'raw':!![]})[_0xf204('0x1b')](function(_0x4868aa){_0x43a00f=_0x4868aa;if(_0x43a00f&&_0x43a00f['type']){switch(_0x43a00f[_0xf204('0x21')]){case'twilio':var _0x59b214=require('twilio');if(_0x43a00f[_0xf204('0x22')]&&_0x43a00f[_0xf204('0x23')]&&_0x43a00f[_0xf204('0x24')]){var _0x2b7fa3=new _0x59b214(_0x43a00f['accountSid'],_0x43a00f['authToken']);_0x2b7fa3[_0xf204('0x25')]['create']({'body':_0x3aca32[_0xf204('0xf')],'to':_0x3aca32[_0xf204('0x24')],'from':_0x43a00f[_0xf204('0x24')],'statusCallback':_0x43a00f[_0xf204('0x26')]+_0xf204('0x27')+_0x3aca32['id']+_0xf204('0x28')+_0x43a00f[_0xf204('0x29')]})[_0xf204('0x1b')](function(_0x3e1160){if(_0x3e1160[_0xf204('0x2a')]){return _0x265caa[_0xf204('0x1c')]({'messageId':_0x3e1160['sid']});}})[_0xf204('0x2b')](function(_0x36cbe7){logger['error'](_0xf204('0x2c'),'afterCreate','twilio',util[_0xf204('0x2d')](_0x36cbe7,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf204('0x2e'),'twilio',_0xf204('0x2f'));}break;case _0xf204('0x30'):var _0x35508e=_0xf204('0x31');if(_0x43a00f[_0xf204('0x32')]&&_0x43a00f[_0xf204('0x33')]){var _0x2385c0={'recipient':[_0x3aca32['phone']],'message':_0x3aca32[_0xf204('0xf')],'message_type':_0x43a00f[_0xf204('0x34')]};if(_0x43a00f[_0xf204('0x34')]&&_0x43a00f[_0xf204('0x34')]!=='SI'){_0x2385c0[_0xf204('0x35')]=_0x43a00f[_0xf204('0x24')];}var _0x2e3ae0={'url':_0x35508e+_0xf204('0x36')+_0x43a00f[_0xf204('0x32')]+_0xf204('0x37')+_0x43a00f['password'],'method':_0xf204('0x38')};rp(_0x2e3ae0)[_0xf204('0x1b')](function(_0xa45c92){var _0x439ca5=_0xa45c92['split'](';');var _0x48cdb7={'user_key':_0x439ca5[0x0],'session_key':_0x439ca5[0x1]};_0x2e3ae0={'url':_0x35508e+_0xf204('0x39'),'method':'POST','headers':{'user_key':_0x48cdb7[_0xf204('0x3a')],'Session_key':_0x48cdb7[_0xf204('0x3b')]},'json':!![],'body':_0x2385c0};return rp(_0x2e3ae0);})[_0xf204('0x1b')](function(_0x47ec81){if(_0x47ec81['total_sent']>=0x1){var _0x4aa5fc={'messageId':_0x47ec81['internal_order_id']};if(_0x43a00f[_0xf204('0x34')]!=='GP'||!_0x43a00f[_0xf204('0x3c')]){_0x4aa5fc['read']=!![];}return _0x265caa['update'](_0x4aa5fc);}else{return logger['error'](_0xf204('0x2c'),_0xf204('0x2e'),_0xf204('0x30'),util[_0xf204('0x2d')](_0x47ec81,{'showHidden':![],'depth':null}));}})[_0xf204('0x2b')](function(_0xf04def){return logger[_0xf204('0x1e')](_0xf204('0x2c'),_0xf204('0x2e'),_0xf204('0x30'),util[_0xf204('0x2d')](_0xf04def,{'showHidden':![],'depth':null}));});}else{logger[_0xf204('0x1e')](_0xf204('0x2c'),_0xf204('0x2e'),_0xf204('0x30'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xf204('0x3d'):if(_0x43a00f[_0xf204('0x23')]){var _0x31aa25={'recipient':_0x3aca32[_0xf204('0x24')],'message':_0x3aca32[_0xf204('0xf')],'sender':_0x43a00f[_0xf204('0x3e')]||_0x43a00f['phone'],'authorization':_0x43a00f[_0xf204('0x23')]};var _0x170d48={'method':'POST','uri':_0xf204('0x3f'),'body':_0x31aa25,'json':!![]};rp(_0x170d48)[_0xf204('0x1b')](function(_0x2ed822){var _0x5973a2={'messageId':_0x2ed822[_0xf204('0x40')]};if(!_0x43a00f[_0xf204('0x3c')]){_0x5973a2[_0xf204('0x41')]=!![];}return _0x265caa['update'](_0x5973a2);})[_0xf204('0x2b')](function(_0xd6de3){logger[_0xf204('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf204('0x2e'),_0xf204('0x3d'),util[_0xf204('0x2d')](_0xd6de3,{'showHidden':![],'depth':null}));});}else{logger[_0xf204('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf204('0x2e'),'connectel',_0xf204('0x42'));}break;case _0xf204('0x43'):if(_0x43a00f[_0xf204('0x32')]&&_0x43a00f[_0xf204('0x33')]){var _0x31aa25={'messages':[{'source':_0xf204('0x44'),'to':_0x3aca32[_0xf204('0x24')],'body':_0x3aca32[_0xf204('0xf')],'from':_0x43a00f[_0xf204('0x3e')]||_0x43a00f[_0xf204('0x24')]}]};var _0x42192a=util['format']('%s:%s',_0x43a00f[_0xf204('0x32')],_0x43a00f[_0xf204('0x33')]);var _0x170d48={'method':_0xf204('0x45'),'uri':_0xf204('0x46'),'body':_0x31aa25,'headers':{'Authorization':util[_0xf204('0x47')](_0xf204('0x48'),new Buffer(_0x42192a)['toString'](_0xf204('0x49')))},'json':!![]};rp(_0x170d48)['then'](function(_0x263966){if(_0x263966[_0xf204('0x4a')]>=0xc8&&_0x263966[_0xf204('0x4a')]<=0xce){if(_0x263966[_0xf204('0x4b')]&&_0x263966[_0xf204('0x4b')][_0xf204('0x4c')]>0x0){var _0x53d1e6=_[_0xf204('0x4d')](_0x263966[_0xf204('0x4b')][_0xf204('0x25')]);var _0x1dae7e={'messageId':_0x53d1e6[_0xf204('0x4e')]};if(!_0x43a00f['deliveryReport']){_0x1dae7e['read']=!![];}return _0x265caa[_0xf204('0x1c')](_0x1dae7e);}else{logger[_0xf204('0x1e')](_0xf204('0x2c'),_0xf204('0x2e'),'clickSend',util[_0xf204('0x2d')](_0x263966,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xf204('0x2c'),_0xf204('0x2e'),_0xf204('0x4f'),util[_0xf204('0x2d')](_0x263966,{'showHidden':![],'depth':null}));}})[_0xf204('0x2b')](function(_0x2346dd){logger[_0xf204('0x1e')](_0xf204('0x2c'),_0xf204('0x2e'),_0xf204('0x4f'),util['inspect'](_0x2346dd,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf204('0x2c'),_0xf204('0x2e'),_0xf204('0x4f'),_0xf204('0x50'));}break;case _0xf204('0x51'):if(_0x43a00f[_0xf204('0x52')]&&_0x43a00f[_0xf204('0x23')]){var _0x31aa25={'dst':_0x3aca32['phone'],'text':_0x3aca32[_0xf204('0xf')],'src':_0x43a00f[_0xf204('0x3e')]||_0x43a00f[_0xf204('0x24')],'url':_0x43a00f[_0xf204('0x26')]+'/api/sms/messages/'+_0x3aca32['id']+_0xf204('0x28')+_0x43a00f[_0xf204('0x29')]};var _0x42192a=util[_0xf204('0x47')](_0xf204('0x53'),_0x43a00f[_0xf204('0x52')],_0x43a00f[_0xf204('0x23')]);var _0x170d48={'method':'POST','uri':util[_0xf204('0x47')](_0xf204('0x54'),_0x43a00f['authId']),'body':_0x31aa25,'headers':{'Authorization':util[_0xf204('0x47')]('Basic\x20%s',new Buffer(_0x42192a)[_0xf204('0x55')]('base64'))},'json':!![]};rp(_0x170d48)[_0xf204('0x1b')](function(_0x454111){var _0x40684a={'messageId':_0x454111[_0xf204('0x56')][0x0]};return _0x265caa['update'](_0x40684a);})[_0xf204('0x2b')](function(_0x399bc4){logger[_0xf204('0x1e')](_0xf204('0x2c'),'afterCreate',_0xf204('0x51'),util[_0xf204('0x2d')](_0x399bc4,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf204('0x51'),_0xf204('0x57'));}break;case'infobip':if(_0x43a00f[_0xf204('0x32')]&&_0x43a00f[_0xf204('0x33')]){if(_0x43a00f[_0xf204('0x58')]){var _0x39bd8e={'method':_0xf204('0x45'),'uri':_0x43a00f[_0xf204('0x58')]+_0xf204('0x59'),'body':{'username':_0x43a00f['username'],'password':_0x43a00f[_0xf204('0x33')]},'json':!![]};return rp(_0x39bd8e)[_0xf204('0x1b')](function(_0x597592){var _0x3d588d={'method':_0xf204('0x45'),'uri':_0x43a00f[_0xf204('0x58')]+_0xf204('0x5a'),'body':{'messages':[{'from':_0x43a00f[_0xf204('0x24')],'destinations':[{'to':_0x3aca32[_0xf204('0x24')]}],'text':_0x3aca32[_0xf204('0xf')],'notifyUrl':_0x43a00f['remote']+_0xf204('0x27')+_0x3aca32['id']+_0xf204('0x28')+_0x43a00f[_0xf204('0x29')],'notifyContentType':_0xf204('0x5b'),'callbackData':_0x43a00f[_0xf204('0x24')]+';'+_0x3aca32[_0xf204('0xf')]}]},'headers':{'Authorization':_0xf204('0x5c')+_0x597592[_0xf204('0x29')]},'json':!![]};return rp(_0x3d588d)[_0xf204('0x1b')](function(_0x1199a1){if(_0x1199a1[_0xf204('0x25')]){var _0x46b6d3={'messageId':_0x1199a1[_0xf204('0x25')][0x0][_0xf204('0xd')]};if(!_0x43a00f[_0xf204('0x3c')]){_0x46b6d3['read']=!![];}return _0x265caa['update'](_0x46b6d3);}else{return logger[_0xf204('0x1e')](_0xf204('0x2c'),_0xf204('0x2e'),_0xf204('0x5d'),util['inspect'](_0x1199a1,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x5b6035){return logger['error'](_0xf204('0x2c'),_0xf204('0x2e'),'infobip',util['inspect'](_0x5b6035,{'showHidden':![],'depth':null}));});}else{logger[_0xf204('0x1e')](_0xf204('0x2c'),_0xf204('0x2e'),_0xf204('0x5d'),_0xf204('0x5e'));}}else{logger[_0xf204('0x1e')](_0xf204('0x2c'),_0xf204('0x2e'),'infobip',_0xf204('0x50'));}break;case _0xf204('0x5f'):var _0x526e0a=require(_0xf204('0x60'));if(_0x43a00f['apiKey']){var _0x50185a={};_0x50185a['login']=_0x43a00f['username'];_0x50185a[_0xf204('0x24')]=_0x3aca32['phone'];_0x50185a[_0xf204('0x35')]=_0x43a00f['phone'];_0x50185a[_0xf204('0x61')]=_0x3aca32[_0xf204('0xf')];_0x50185a[_0xf204('0x62')]=+new Date();var _0x59c697='';var _0x29ef8='';var _0x25736a=Object[_0xf204('0x63')](_0x50185a);_0x25736a[_0xf204('0x64')]();for(var _0x382ee0=0x0;_0x382ee0<_0x25736a['length'];_0x382ee0++){if(_0x59c697!=''){_0x59c697+='&';}_0x59c697+=_0x25736a[_0x382ee0]+'='+encodeURIComponent(_0x50185a[_0x25736a[_0x382ee0]]);_0x29ef8+=_0x50185a[_0x25736a[_0x382ee0]];}_0x29ef8+=_0x43a00f[_0xf204('0x65')];_0x29ef8=_0x526e0a[_0xf204('0x66')](_0xf204('0x67'))['update'](_0x29ef8)[_0xf204('0x68')](_0xf204('0x69'));if(_0x59c697!==''){_0x59c697+='&';}_0x59c697+=_0xf204('0x6a')+_0x29ef8;var _0x2e3ae0={'method':_0xf204('0x38'),'uri':_0x43a00f[_0xf204('0x58')]+'/external/get/send.php?'+_0x59c697,'json':!![]};return rp(_0x2e3ae0)['then'](function(_0x52b2b1){var _0x36db17=Object[_0xf204('0x63')](_0x52b2b1);if(_0x52b2b1[_0x36db17[0x0]]['error']&&parseInt(_0x52b2b1[_0x36db17[0x0]][_0xf204('0x1e')])===0x0){var _0xde8009={'messageId':_0x52b2b1[_0x36db17[0x0]][_0xf204('0x6b')]};if(!_0x43a00f['deliveryReport']){_0xde8009[_0xf204('0x41')]=!![];}return _0x265caa[_0xf204('0x1c')](_0xde8009);}else{return logger[_0xf204('0x1e')](_0xf204('0x2c'),_0xf204('0x2e'),_0xf204('0x5f'),util[_0xf204('0x2d')](_0x52b2b1[_0xf204('0x1e')],{'showHidden':![],'depth':null}));}})[_0xf204('0x2b')](function(_0x3d013f){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf204('0x2e'),_0xf204('0x5f'),util[_0xf204('0x2d')](_0x3d013f,{'showHidden':![],'depth':null}));});}else{logger[_0xf204('0x1e')](_0xf204('0x2c'),_0xf204('0x2e'),_0xf204('0x5f'),_0xf204('0x6c'));}break;case'clickatell':if(_0x43a00f['apiKey']){var _0xc3b31b={'method':_0xf204('0x45'),'uri':_0xf204('0x6d'),'headers':{'Authorization':_0x43a00f[_0xf204('0x65')]},'body':{'content':_0x3aca32['body'],'to':[_0x3aca32[_0xf204('0x24')]],'from':_0x43a00f[_0xf204('0x24')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0xc3b31b)['then'](function(_0x5c8fc5){if(!_0x5c8fc5[_0xf204('0x1e')]){var _0x1ec5cc={'messageId':_0x5c8fc5[_0xf204('0x25')][0x0][_0xf204('0x6e')]};if(!_0x43a00f['deliveryReport']){_0x1ec5cc[_0xf204('0x41')]=!![];}return _0x265caa[_0xf204('0x1c')](_0x1ec5cc);}else{return logger[_0xf204('0x1e')](_0xf204('0x2c'),_0xf204('0x2e'),_0xf204('0x6f'),util['inspect'](_0x5c8fc5[_0xf204('0x1e')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x3342af){return logger[_0xf204('0x1e')](_0xf204('0x2c'),_0xf204('0x2e'),_0xf204('0x6f'),util[_0xf204('0x2d')](_0x3342af,{'showHidden':![],'depth':null}));});}else{logger[_0xf204('0x1e')](_0xf204('0x2c'),'afterCreate',_0xf204('0x6f'),_0xf204('0x6c'));}break;case'bandwidth':if(_0x43a00f[_0xf204('0x32')]&&_0x43a00f['password']){var _0x42192a=util[_0xf204('0x47')]('%s:%s',_0x43a00f[_0xf204('0x32')],_0x43a00f[_0xf204('0x33')]);var _0x170d48={'method':_0xf204('0x45'),'uri':_0xf204('0x70')+_0x43a00f[_0xf204('0x71')]+_0xf204('0x72'),'body':{'to':[_0x3aca32[_0xf204('0x24')]],'text':_0x3aca32['body'],'from':_0x43a00f[_0xf204('0x24')],'applicationId':_0x43a00f[_0xf204('0x73')]},'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x42192a)[_0xf204('0x55')](_0xf204('0x49')))},'json':!![]};rp(_0x170d48)[_0xf204('0x1b')](function(_0x27d8d6){if(_0x27d8d6['id']){var _0x45c667={'messageId':_0x27d8d6['id']};return _0x265caa[_0xf204('0x1c')](_0x45c667);}else{logger[_0xf204('0x1e')](_0xf204('0x2c'),'afterCreate',_0xf204('0x74'),util[_0xf204('0x2d')](_0x27d8d6,{'showHidden':![],'depth':null}));}})[_0xf204('0x2b')](function(_0x1393ba){logger[_0xf204('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf204('0x2e'),_0xf204('0x74'),util[_0xf204('0x2d')](_0x1393ba,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf204('0x2c'),'afterCreate','bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0xf204('0x75'):if(_0x43a00f['apiKey']){var _0x2ba9a8={};var _0x2e3ae0={'method':_0xf204('0x45'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xf204('0x76')+_0x43a00f[_0xf204('0x65')],'Content-Type':'application/json'},'body':{'from':_0x43a00f[_0xf204('0x24')],'to':_0x3aca32[_0xf204('0x24')],'text':_0x3aca32[_0xf204('0xf')]},'json':!![]};return rp(_0x2e3ae0)[_0xf204('0x1b')](function(_0x4525c1){if(_0x4525c1[_0xf204('0x77')]==0xca){_0x2ba9a8['message']=_0x4525c1;var _0x135dde={'method':_0xf204('0x45'),'uri':_0xf204('0x78'),'headers':{'Authorization':_0xf204('0x76')+_0x43a00f[_0xf204('0x65')],'Content-Type':_0xf204('0x5b')},'body':{'refid':_0x2ba9a8[_0xf204('0x79')][_0xf204('0x7a')]},'json':!![]};return rp(_0x135dde)['then'](function(_0x1ac409){_0x2ba9a8[_0xf204('0x7b')]=_0x1ac409;var _0x5e1fbc={'messageId':_0x2ba9a8[_0xf204('0x79')][_0xf204('0x7a')],'read':!![]};return _0x265caa['update'](_0x5e1fbc);});}else{return logger['error'](_0xf204('0x2c'),_0xf204('0x2e'),_0xf204('0x75'),util[_0xf204('0x2d')](_0x4525c1,{'showHidden':![],'depth':null}));}})[_0xf204('0x2b')](function(_0x10b446){return logger[_0xf204('0x1e')](_0xf204('0x2c'),_0xf204('0x2e'),'intelepeer',util[_0xf204('0x2d')](_0x10b446,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xf204('0x2c'),_0xf204('0x2e'),_0xf204('0x75'),'Token\x20not\x20received');}break;}}})[_0xf204('0x7c')](function(){_0x255616();});}else{_0x255616();}}},'charset':_0xf204('0x7d'),'collate':_0xf204('0x7e')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 44b1346..dff2bfc 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 _0x5a5a=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','localhost','socket.io-emitter','redis','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','CreateSmsMessage','create','body','options','raw','debug','stringify'];(function(_0x28f32c,_0x4cc342){var _0x355402=function(_0xdb5032){while(--_0xdb5032){_0x28f32c['push'](_0x28f32c['shift']());}};_0x355402(++_0x4cc342);}(_0x5a5a,0x1a0));var _0xa5a5=function(_0x575057,_0x14baf3){_0x575057=_0x575057-0x0;var _0x49dbc8=_0x5a5a[_0x575057];return _0x49dbc8;};'use strict';var _=require(_0xa5a5('0x0'));var util=require(_0xa5a5('0x1'));var moment=require(_0xa5a5('0x2'));var BPromise=require(_0xa5a5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa5a5('0x4'));var db=require(_0xa5a5('0x5'))['db'];var utils=require(_0xa5a5('0x6'));var logger=require(_0xa5a5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa5a5('0x8'));var client=jayson[_0xa5a5('0x9')][_0xa5a5('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xa5a5('0xb'),'port':0x18eb});var socket=require(_0xa5a5('0xc'))(new Redis(config[_0xa5a5('0xd')]));require(_0xa5a5('0xe'))['register'](socket);function respondWithRpcPromise(_0x1eb738,_0x1054fb,_0x46d99d){return new BPromise(function(_0xb45d38,_0x2826b4){return client[_0xa5a5('0xf')](_0x1eb738,_0x46d99d)[_0xa5a5('0x10')](function(_0x1cf30d){logger[_0xa5a5('0x11')](_0xa5a5('0x12'),_0x1054fb,'request\x20sent');logger['debug'](_0xa5a5('0x13'),_0x1054fb,'request\x20sent',JSON['stringify'](_0x1cf30d));if(_0x1cf30d[_0xa5a5('0x14')]){if(_0x1cf30d[_0xa5a5('0x14')]['code']===0x1f4){logger[_0xa5a5('0x14')](_0xa5a5('0x12'),_0x1054fb,_0x1cf30d[_0xa5a5('0x14')][_0xa5a5('0x15')]);return _0x2826b4(_0x1cf30d[_0xa5a5('0x14')][_0xa5a5('0x15')]);}logger[_0xa5a5('0x14')](_0xa5a5('0x12'),_0x1054fb,_0x1cf30d[_0xa5a5('0x14')]['message']);return _0xb45d38(_0x1cf30d[_0xa5a5('0x14')][_0xa5a5('0x15')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x1054fb,_0xa5a5('0x16'));_0xb45d38(_0x1cf30d[_0xa5a5('0x17')][_0xa5a5('0x15')]);}})[_0xa5a5('0x18')](function(_0x286cec){logger[_0xa5a5('0x14')](_0xa5a5('0x12'),_0x1054fb,_0x286cec);_0x2826b4(_0x286cec);});});}exports[_0xa5a5('0x19')]=function(_0x1f1747){var _0x35c090=this;return new Promise(function(_0x2e20d2,_0x1fa469){return db['SmsMessage'][_0xa5a5('0x1a')](_0x1f1747[_0xa5a5('0x1b')],{'raw':_0x1f1747['options']?_0x1f1747[_0xa5a5('0x1c')][_0xa5a5('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x1c1c65){logger[_0xa5a5('0x11')](_0xa5a5('0x19'),_0x1f1747);logger[_0xa5a5('0x1e')]('CreateSmsMessage',_0x1f1747,JSON[_0xa5a5('0x1f')](_0x1c1c65));_0x2e20d2(_0x1c1c65);})[_0xa5a5('0x18')](function(_0x4d0a15){logger[_0xa5a5('0x14')](_0xa5a5('0x19'),_0x4d0a15[_0xa5a5('0x15')],_0x1f1747);_0x1fa469(_0x35c090[_0xa5a5('0x14')](0x1f4,_0x4d0a15[_0xa5a5('0x15')]));});});}; \ No newline at end of file +var _0x2417=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','moment','bluebird'];(function(_0x2b7474,_0x12bbec){var _0x365141=function(_0x2d80dd){while(--_0x2d80dd){_0x2b7474['push'](_0x2b7474['shift']());}};_0x365141(++_0x12bbec);}(_0x2417,0x1eb));var _0x7241=function(_0x480cca,_0x33709f){_0x480cca=_0x480cca-0x0;var _0x22bcdb=_0x2417[_0x480cca];return _0x22bcdb;};'use strict';var _=require(_0x7241('0x0'));var util=require(_0x7241('0x1'));var moment=require(_0x7241('0x2'));var BPromise=require(_0x7241('0x3'));var rs=require(_0x7241('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7241('0x5'))['db'];var utils=require(_0x7241('0x6'));var logger=require('../../config/logger')(_0x7241('0x7'));var config=require(_0x7241('0x8'));var jayson=require(_0x7241('0x9'));var client=jayson[_0x7241('0xa')][_0x7241('0xb')]({'port':0x232a});config[_0x7241('0xc')]=_['defaults'](config[_0x7241('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7241('0xd'))(new Redis(config[_0x7241('0xc')]));require('./smsMessage.socket')[_0x7241('0xe')](socket);function respondWithRpcPromise(_0x37818a,_0x373200,_0x316208){return new BPromise(function(_0x2c6035,_0x4ac8f8){return client[_0x7241('0xf')](_0x37818a,_0x316208)[_0x7241('0x10')](function(_0x5dbec9){logger['info'](_0x7241('0x11'),_0x373200,_0x7241('0x12'));logger[_0x7241('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x373200,_0x7241('0x12'),JSON[_0x7241('0x14')](_0x5dbec9));if(_0x5dbec9['error']){if(_0x5dbec9[_0x7241('0x15')][_0x7241('0x16')]===0x1f4){logger[_0x7241('0x15')](_0x7241('0x11'),_0x373200,_0x5dbec9[_0x7241('0x15')][_0x7241('0x17')]);return _0x4ac8f8(_0x5dbec9[_0x7241('0x15')][_0x7241('0x17')]);}logger['error'](_0x7241('0x11'),_0x373200,_0x5dbec9[_0x7241('0x15')]['message']);return _0x2c6035(_0x5dbec9['error']['message']);}else{logger[_0x7241('0x18')](_0x7241('0x11'),_0x373200,_0x7241('0x12'));_0x2c6035(_0x5dbec9[_0x7241('0x19')][_0x7241('0x17')]);}})[_0x7241('0x1a')](function(_0x57e798){logger[_0x7241('0x15')](_0x7241('0x11'),_0x373200,_0x57e798);_0x4ac8f8(_0x57e798);});});}exports[_0x7241('0x1b')]=function(_0x30de73){var _0xeaa757=this;return new Promise(function(_0x4646fa,_0x2cac73){return db[_0x7241('0x1c')][_0x7241('0x1d')](_0x30de73[_0x7241('0x1e')],{'raw':_0x30de73['options']?_0x30de73[_0x7241('0x1f')][_0x7241('0x20')]===undefined?!![]:![]:!![]})[_0x7241('0x10')](function(_0x4501f7){logger[_0x7241('0x18')](_0x7241('0x1b'),_0x30de73);logger[_0x7241('0x13')](_0x7241('0x1b'),_0x30de73,JSON[_0x7241('0x14')](_0x4501f7));_0x4646fa(_0x4501f7);})[_0x7241('0x1a')](function(_0x2edf9b){logger[_0x7241('0x15')](_0x7241('0x1b'),_0x2edf9b['message'],_0x30de73);_0x2cac73(_0xeaa757[_0x7241('0x15')](0x1f4,_0x2edf9b[_0x7241('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index ffa643f..d0153dd 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 _0xb4d6=['length','smsMessage:','./smsMessage.events','save','remove','update','removeListener'];(function(_0x32c7a3,_0x50ec09){var _0x56a96f=function(_0x4d6688){while(--_0x4d6688){_0x32c7a3['push'](_0x32c7a3['shift']());}};_0x56a96f(++_0x50ec09);}(_0xb4d6,0x159));var _0x6b4d=function(_0x5a3e3b,_0x7e6c4a){_0x5a3e3b=_0x5a3e3b-0x0;var _0x38cf15=_0xb4d6[_0x5a3e3b];return _0x38cf15;};'use strict';var SmsMessageEvents=require(_0x6b4d('0x0'));var events=[_0x6b4d('0x1'),_0x6b4d('0x2'),_0x6b4d('0x3')];function createListener(_0x536d73,_0x5c3761){return function(_0xb16031){_0x5c3761['emit'](_0x536d73,_0xb16031);};}function removeListener(_0x524621,_0x46f191){return function(){SmsMessageEvents[_0x6b4d('0x4')](_0x524621,_0x46f191);};}exports['register']=function(_0x304c37){for(var _0x227068=0x0,_0x13625b=events[_0x6b4d('0x5')];_0x227068<_0x13625b;_0x227068++){var _0x3d5011=events[_0x227068];var _0x203274=createListener(_0x6b4d('0x6')+_0x3d5011,_0x304c37);SmsMessageEvents['on'](_0x3d5011,_0x203274);}}; \ No newline at end of file +var _0x5b25=['save','remove','update','emit','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x5562ba,_0x472817){var _0x2b359d=function(_0x15ef53){while(--_0x15ef53){_0x5562ba['push'](_0x5562ba['shift']());}};_0x2b359d(++_0x472817);}(_0x5b25,0x131));var _0x55b2=function(_0xd8bdab,_0x33f8a0){_0xd8bdab=_0xd8bdab-0x0;var _0x39b6b5=_0x5b25[_0xd8bdab];return _0x39b6b5;};'use strict';var SmsMessageEvents=require(_0x55b2('0x0'));var events=[_0x55b2('0x1'),_0x55b2('0x2'),_0x55b2('0x3')];function createListener(_0x172424,_0x1ff17a){return function(_0x4086ce){_0x1ff17a[_0x55b2('0x4')](_0x172424,_0x4086ce);};}function removeListener(_0xb1fe59,_0x5388b4){return function(){SmsMessageEvents[_0x55b2('0x5')](_0xb1fe59,_0x5388b4);};}exports[_0x55b2('0x6')]=function(_0x52f976){for(var _0x1f3d31=0x0,_0xb294f8=events[_0x55b2('0x7')];_0x1f3d31<_0xb294f8;_0x1f3d31++){var _0x4f701b=events[_0x1f3d31];var _0x1c0027=createListener(_0x55b2('0x8')+_0x4f701b,_0x52f976);SmsMessageEvents['on'](_0x4f701b,_0x1c0027);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index b593385..62ace59 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 _0x84f3=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getTeams','/:id/users','getAgents','post','/:id/teams','addAgents','put','delete','removeTeams','exports','util','path','connect-timeout','express','Router'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x84f3,0xaa));var _0x384f=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x84f3[_0xa148b7];return _0x51efd3;};'use strict';var multer=require('multer');var util=require(_0x384f('0x0'));var path=require(_0x384f('0x1'));var timeout=require(_0x384f('0x2'));var express=require(_0x384f('0x3'));var router=express[_0x384f('0x4')]();var fs_extra=require(_0x384f('0x5'));var auth=require(_0x384f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x384f('0x7'));var controller=require('./smsQueue.controller');router[_0x384f('0x8')]('/',auth[_0x384f('0x9')](),controller[_0x384f('0xa')]);router[_0x384f('0x8')](_0x384f('0xb'),auth[_0x384f('0x9')](),controller[_0x384f('0xc')]);router[_0x384f('0x8')](_0x384f('0xd'),auth[_0x384f('0x9')](),controller['show']);router[_0x384f('0x8')](_0x384f('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0x384f('0x8')]('/:id/teams',auth[_0x384f('0x9')](),controller[_0x384f('0xf')]);router[_0x384f('0x8')](_0x384f('0x10'),auth[_0x384f('0x9')](),controller[_0x384f('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x384f('0x12')](_0x384f('0x13'),auth[_0x384f('0x9')](),controller['addTeams']);router[_0x384f('0x12')](_0x384f('0x10'),auth[_0x384f('0x9')](),controller[_0x384f('0x14')]);router[_0x384f('0x15')](_0x384f('0xd'),auth[_0x384f('0x9')](),controller['update']);router['delete'](_0x384f('0xd'),auth[_0x384f('0x9')](),controller['destroy']);router[_0x384f('0x16')](_0x384f('0x13'),auth[_0x384f('0x9')](),controller[_0x384f('0x17')]);router['delete'](_0x384f('0x10'),auth[_0x384f('0x9')](),controller['removeAgents']);module[_0x384f('0x18')]=router; \ No newline at end of file +var _0x76f1=['isAuthenticated','index','show','get','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addAgents','put','delete','/:id','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x76f1,0x83));var _0x176f=function(_0x37c1d6,_0x22189b){_0x37c1d6=_0x37c1d6-0x0;var _0x34be0f=_0x76f1[_0x37c1d6];return _0x34be0f;};'use strict';var multer=require(_0x176f('0x0'));var util=require(_0x176f('0x1'));var path=require('path');var timeout=require(_0x176f('0x2'));var express=require(_0x176f('0x3'));var router=express[_0x176f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x176f('0x5'));var interaction=require(_0x176f('0x6'));var config=require(_0x176f('0x7'));var controller=require(_0x176f('0x8'));router['get']('/',auth[_0x176f('0x9')](),controller[_0x176f('0xa')]);router['get']('/describe',auth[_0x176f('0x9')](),controller['describe']);router['get']('/:id',auth[_0x176f('0x9')](),controller[_0x176f('0xb')]);router[_0x176f('0xc')](_0x176f('0xd'),auth[_0x176f('0x9')](),controller[_0x176f('0xe')]);router[_0x176f('0xc')](_0x176f('0xf'),auth[_0x176f('0x9')](),controller[_0x176f('0x10')]);router[_0x176f('0xc')](_0x176f('0x11'),auth[_0x176f('0x9')](),controller[_0x176f('0x12')]);router['post']('/',auth[_0x176f('0x9')](),controller[_0x176f('0x13')]);router[_0x176f('0x14')](_0x176f('0xf'),auth[_0x176f('0x9')](),controller['addTeams']);router[_0x176f('0x14')](_0x176f('0x11'),auth[_0x176f('0x9')](),controller[_0x176f('0x15')]);router[_0x176f('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x176f('0x17')](_0x176f('0x18'),auth[_0x176f('0x9')](),controller[_0x176f('0x19')]);router[_0x176f('0x17')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0x176f('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0x176f('0x1a')]);module[_0x176f('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 6359734..e3d8c75 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 _0x093d=['exports','STRING','name','INTEGER','ENUM','roundrobin'];(function(_0x521132,_0x35c8cb){var _0x21cbc5=function(_0x4b208c){while(--_0x4b208c){_0x521132['push'](_0x521132['shift']());}};_0x21cbc5(++_0x35c8cb);}(_0x093d,0xa2));var _0xd093=function(_0x4bb2b9,_0x459c78){_0x4bb2b9=_0x4bb2b9-0x0;var _0x40e2a2=_0x093d[_0x4bb2b9];return _0x40e2a2;};'use strict';var Sequelize=require('sequelize');module[_0xd093('0x0')]={'name':{'type':Sequelize[_0xd093('0x1')],'unique':_0xd093('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd093('0x1')]},'timeout':{'type':Sequelize[_0xd093('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd093('0x4')]('rrmemory','beepall',_0xd093('0x5'))}}; \ No newline at end of file +var _0x5cfb=['roundrobin','beepall'];(function(_0x1f1ea8,_0x87f022){var _0x257b12=function(_0x200015){while(--_0x200015){_0x1f1ea8['push'](_0x1f1ea8['shift']());}};_0x257b12(++_0x87f022);}(_0x5cfb,0x15f));var _0xb5cf=function(_0x5660f6,_0x5646db){_0x5660f6=_0x5660f6-0x0;var _0x4bf573=_0x5cfb[_0x5660f6];return _0x4bf573;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xb5cf('0x0'),_0xb5cf('0x1'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 3730237..0d2630a 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 _0x0b0e=['userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','union','value','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','hasOwnProperty','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','update','SmsQueues','destroy','then','error','stack','name','send','SmsQueue','fieldName','type','key','getOptions','include','query','findAll','rows','show','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','merge','options','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','params','nolimit','order','sort','where','SmsQueueId','filter','map','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','findOne','Team','pick','getTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','emit'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x0b0e,0x187));var _0xe0b0=function(_0xf31767,_0x381746){_0xf31767=_0xf31767-0x0;var _0x24bd0c=_0x0b0e[_0xf31767];return _0x24bd0c;};'use strict';var BPromise=require(_0xe0b0('0x0'));var util=require('util');var _=require(_0xe0b0('0x1'));var squel=require('squel');var Redis=require(_0xe0b0('0x2'));var qs=require(_0xe0b0('0x3'));var logger=require(_0xe0b0('0x4'))(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var db=require(_0xe0b0('0x7'))['db'];config[_0xe0b0('0x8')]=_[_0xe0b0('0x9')](config[_0xe0b0('0x8')],{'host':_0xe0b0('0xa'),'port':0x18eb});var socket=require(_0xe0b0('0xb'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xe0b0('0xc')](socket);function respondWithStatusCode(_0x435060,_0xc4a085){_0xc4a085=_0xc4a085||0xcc;return function(_0x2ac27e){if(_0x2ac27e){return _0x435060['sendStatus'](_0xc4a085);}return _0x435060[_0xe0b0('0xd')](_0xc4a085)[_0xe0b0('0xe')]();};}function respondWithResult(_0x553d4f,_0x1fef28){_0x1fef28=_0x1fef28||0xc8;return function(_0x2f32b6){if(_0x2f32b6){return _0x553d4f['status'](_0x1fef28)[_0xe0b0('0xf')](_0x2f32b6);}};}function respondWithFilteredResult(_0x2cdad2,_0x39b1c2){return function(_0x585615){if(_0x585615){var _0x3068c0=typeof _0x39b1c2[_0xe0b0('0x10')]===_0xe0b0('0x11')&&typeof _0x39b1c2[_0xe0b0('0x12')]===_0xe0b0('0x11');var _0x4d2bf7=_0x585615[_0xe0b0('0x13')];var _0x154de6=_0x3068c0?0x0:_0x39b1c2[_0xe0b0('0x10')];var _0x24babd=_0x3068c0?_0x585615[_0xe0b0('0x13')]:_0x39b1c2['offset']+_0x39b1c2[_0xe0b0('0x12')];var _0x5adb01;if(_0x24babd>=_0x4d2bf7){_0x24babd=_0x4d2bf7;_0x5adb01=0xc8;}else{_0x5adb01=0xce;}_0x2cdad2[_0xe0b0('0xd')](_0x5adb01);return _0x2cdad2[_0xe0b0('0x14')]('Content-Range',_0x154de6+'-'+_0x24babd+'/'+_0x4d2bf7)[_0xe0b0('0xf')](_0x585615);}return null;};}function saveUpdates(_0x4a4cc0){return function(_0x2d6fb6){if(_0x2d6fb6){return _0x2d6fb6[_0xe0b0('0x15')](_0x4a4cc0)['then'](function(_0x54a3eb){return _0x54a3eb;});}return null;};}function removeEntity(_0x46bb44){return function(_0x50a441){if(_0x50a441){return _0x50a441['destroy']()['then'](function(){var _0x1920ee=_0x50a441['get']({'plain':!![]});var _0x52598b=_0xe0b0('0x16');return db['UserProfileResource'][_0xe0b0('0x17')]({'where':{'type':_0x52598b,'resourceId':_0x1920ee['id']}})['then'](function(){return _0x50a441;});})[_0xe0b0('0x18')](function(){_0x46bb44[_0xe0b0('0xd')](0xcc)[_0xe0b0('0xe')]();});}};}function handleEntityNotFound(_0x310a6d){return function(_0x2cf6a1){if(!_0x2cf6a1){_0x310a6d['sendStatus'](0x194);}return _0x2cf6a1;};}function handleError(_0x4cae54,_0x2fa820){_0x2fa820=_0x2fa820||0x1f4;return function(_0x5512bb){logger[_0xe0b0('0x19')](_0x5512bb[_0xe0b0('0x1a')]);if(_0x5512bb['name']){delete _0x5512bb[_0xe0b0('0x1b')];}_0x4cae54['status'](_0x2fa820)[_0xe0b0('0x1c')](_0x5512bb);};}exports['index']=function(_0x28586d,_0x576352){var _0x3e5c88={};var _0x4de537={'count':0x0,'rows':[]};var _0x4700cc=_['map'](db[_0xe0b0('0x1d')]['rawAttributes'],function(_0x362aba){return{'name':_0x362aba[_0xe0b0('0x1e')],'type':_0x362aba[_0xe0b0('0x1f')][_0xe0b0('0x20')]};});_0x3e5c88=qs[_0xe0b0('0x21')](_0x4700cc,_0x28586d);var _0x10745d={'where':_0x3e5c88['where']};return db[_0xe0b0('0x1d')][_0xe0b0('0x13')](_0x10745d)['then'](function(_0x15e13b){_0x4de537[_0xe0b0('0x13')]=_0x15e13b;_0x3e5c88[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x28586d[_0xe0b0('0x23')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x24')](_0x3e5c88);})['then'](function(_0x1854b8){_0x4de537[_0xe0b0('0x25')]=_0x1854b8;return _0x4de537;})['then'](respondWithFilteredResult(_0x576352,_0x3e5c88))['catch'](handleError(_0x576352,null));};exports[_0xe0b0('0x26')]=function(_0x33e672,_0x422575){var _0x3f81d5={'raw':!![],'where':{'id':_0x33e672['params']['id']}},_0x2ab1b1={};_0x2ab1b1[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db[_0xe0b0('0x1d')][_0xe0b0('0x29')]);_0x2ab1b1[_0xe0b0('0x23')]=_['keys'](_0x33e672[_0xe0b0('0x23')]);_0x2ab1b1[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],_0x2ab1b1[_0xe0b0('0x23')]);_0x3f81d5[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3f81d5[_0xe0b0('0x2c')]=_0x3f81d5[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x3f81d5[_0xe0b0('0x2c')]:_0x2ab1b1['model'];if(_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2f')]){_0x3f81d5[_0xe0b0('0x22')]=[{'all':!![]}];}_0x3f81d5=_[_0xe0b0('0x30')]({},_0x3f81d5,_0x33e672[_0xe0b0('0x31')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x32')](_0x3f81d5)['then'](handleEntityNotFound(_0x422575,null))['then'](respondWithResult(_0x422575,null))['catch'](handleError(_0x422575,null));};exports['create']=function(_0x26137c,_0xc3d967){return db[_0xe0b0('0x1d')]['create'](_0x26137c[_0xe0b0('0x33')],{})[_0xe0b0('0x18')](function(_0x1cd705){var _0x297c64=_0x26137c['user'][_0xe0b0('0x34')]({'plain':!![]});if(!_0x297c64)throw new Error(_0xe0b0('0x35'));if(_0x297c64[_0xe0b0('0x36')]===_0xe0b0('0x37')){var _0x4265e3=_0x1cd705[_0xe0b0('0x34')]({'plain':!![]});var _0x8b745=_0xe0b0('0x16');return db[_0xe0b0('0x38')]['find']({'where':{'name':_0x8b745,'userProfileId':_0x297c64[_0xe0b0('0x39')]},'raw':!![]})['then'](function(_0x34178d){if(_0x34178d&&_0x34178d[_0xe0b0('0x3a')]===0x0){return db[_0xe0b0('0x3b')][_0xe0b0('0x3c')]({'name':_0x4265e3['name'],'resourceId':_0x4265e3['id'],'type':_0x34178d[_0xe0b0('0x1b')],'sectionId':_0x34178d['id']},{})[_0xe0b0('0x18')](function(){return _0x1cd705;});}else{return _0x1cd705;}})[_0xe0b0('0x3d')](function(_0x402a0e){logger[_0xe0b0('0x19')](_0xe0b0('0x3e'),_0x402a0e);throw _0x402a0e;});}return _0x1cd705;})[_0xe0b0('0x18')](respondWithResult(_0xc3d967,0xc9))[_0xe0b0('0x3d')](handleError(_0xc3d967,null));};exports['update']=function(_0x2aad80,_0x309bbf){if(_0x2aad80['body']['id']){delete _0x2aad80['body']['id'];}return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x2aad80['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x309bbf,null))[_0xe0b0('0x18')](saveUpdates(_0x2aad80[_0xe0b0('0x33')],null))[_0xe0b0('0x18')](respondWithResult(_0x309bbf,null))[_0xe0b0('0x3d')](handleError(_0x309bbf,null));};exports['destroy']=function(_0x5d2fa2,_0x51c580){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x5d2fa2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x51c580,null))[_0xe0b0('0x18')](removeEntity(_0x51c580,null))[_0xe0b0('0x3d')](handleError(_0x51c580,null));};exports[_0xe0b0('0x3f')]=function(_0x16ccca,_0x5c6f94){return db['SmsQueue'][_0xe0b0('0x3f')]()[_0xe0b0('0x18')](respondWithResult(_0x5c6f94,null))[_0xe0b0('0x3d')](handleError(_0x5c6f94,null));};exports[_0xe0b0('0x40')]=function(_0x1bf77d,_0x575c7d){var _0x3b1474={'raw':!![],'where':{}},_0x11d4fd={},_0x534340;return db['SmsQueue']['findOne']({'where':{'id':_0x1bf77d[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x575c7d,null))[_0xe0b0('0x18')](function(_0x364877){if(_0x364877){_0x534340=_0x364877['get']({'plain':!![]});_0x11d4fd[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db['UserSmsQueue']['rawAttributes']);_0x11d4fd[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x1bf77d['query']);_0x11d4fd[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x11d4fd['model'],_0x11d4fd['query']);_0x3b1474[_0xe0b0('0x2c')]=_['intersection'](_0x11d4fd[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3b1474[_0xe0b0('0x2c')]=_0x3b1474[_0xe0b0('0x2c')]['length']?_0x3b1474['attributes']:_0x11d4fd[_0xe0b0('0x27')];if(!_0x1bf77d['query']['hasOwnProperty'](_0xe0b0('0x42'))){_0x3b1474[_0xe0b0('0x12')]=qs['limit'](_0x1bf77d['query'][_0xe0b0('0x12')]);_0x3b1474[_0xe0b0('0x10')]=qs[_0xe0b0('0x10')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x10')]);}_0x3b1474[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x1bf77d['query'][_0xe0b0('0x44')]);_0x3b1474['where']=qs[_0xe0b0('0x2a')](_['pick'](_0x1bf77d['query'],_0x11d4fd[_0xe0b0('0x2a')]));_0x3b1474[_0xe0b0('0x45')][_0xe0b0('0x46')]=_0x364877['id'];if(_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x3b1474[_0xe0b0('0x45')]=_[_0xe0b0('0x30')](_0x3b1474[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x3b1474['attributes'],function(_0x253ab0){var _0x57ccc9={};_0x57ccc9[_0x253ab0]={'$like':'%'+_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x57ccc9;})});}_0x3b1474=_[_0xe0b0('0x30')]({},_0x3b1474,_0x1bf77d[_0xe0b0('0x31')]);return db[_0xe0b0('0x49')][_0xe0b0('0x24')](_0x3b1474);}})['then'](function(_0x1a057c){if(_0x1a057c){return db[_0xe0b0('0x4a')][_0xe0b0('0x4b')]({'where':{'id':_[_0xe0b0('0x48')](_0x1a057c,_0xe0b0('0x4c')),'role':_0xe0b0('0x4d')},'attributes':['id',_0xe0b0('0x1b'),_0xe0b0('0x4e'),_0xe0b0('0x4f'),_0xe0b0('0x50')]});}})[_0xe0b0('0x18')](function(_0x18ab99){if(_0x18ab99){return{'count':_0x18ab99[_0xe0b0('0x13')],'rows':_[_0xe0b0('0x48')](_0x18ab99[_0xe0b0('0x25')],function(_0x34c642){return{'membername':_0x34c642[_0xe0b0('0x1b')],'UserId':_0x34c642['id'],'queue_name':_0x534340[_0xe0b0('0x1b')],'SmsQueueId':_0x534340['id'],'interface':util['format'](_0xe0b0('0x51'),_0xe0b0('0x52'),_0x34c642[_0xe0b0('0x1b')]),'penalty':0x0,'paused':_0x34c642[_0xe0b0('0x4e')],'createdAt':_0x34c642[_0xe0b0('0x50')],'updatedAt':_0x34c642[_0xe0b0('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe0b0('0x18')](respondWithFilteredResult(_0x575c7d,_0x3b1474))['catch'](handleError(_0x575c7d,null));};exports['getTeams']=function(_0x139014,_0x2a0415){var _0x157556={};var _0x47ecc1={};var _0x117d20;var _0x13fb4b;return db[_0xe0b0('0x1d')][_0xe0b0('0x53')]({'where':{'id':_0x139014[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x2a0415,null))[_0xe0b0('0x18')](function(_0x242120){if(_0x242120){_0x117d20=_0x242120;_0x47ecc1[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x54')][_0xe0b0('0x29')]);_0x47ecc1['query']=_[_0xe0b0('0x28')](_0x139014['query']);_0x47ecc1['filters']=_[_0xe0b0('0x2b')](_0x47ecc1['model'],_0x47ecc1['query']);_0x157556[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x47ecc1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x139014['query'][_0xe0b0('0x2d')]));_0x157556[_0xe0b0('0x2c')]=_0x157556[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x157556[_0xe0b0('0x2c')]:_0x47ecc1[_0xe0b0('0x27')];_0x157556[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x139014['query']['sort']);_0x157556[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x139014['query'],_0x47ecc1['filters']));if(_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x157556['where']=_['merge'](_0x157556[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x157556[_0xe0b0('0x2c')],function(_0x29175a){var _0x3b263f={};_0x3b263f[_0x29175a]={'$like':'%'+_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3b263f;})});}_0x157556=_[_0xe0b0('0x30')]({},_0x157556,_0x139014['options']);return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0x1673bc){if(_0x1673bc){_0x13fb4b=_0x1673bc['length'];if(!_0x139014['query']['hasOwnProperty']('nolimit')){_0x157556['limit']=qs['limit'](_0x139014[_0xe0b0('0x23')]['limit']);_0x157556['offset']=qs[_0xe0b0('0x10')](_0x139014[_0xe0b0('0x23')][_0xe0b0('0x10')]);}return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0xd0629e){if(_0xd0629e){return _0xd0629e?{'count':_0x13fb4b,'rows':_0xd0629e}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x2a0415,null))[_0xe0b0('0x3d')](handleError(_0x2a0415,null));};exports['addTeams']=function(_0x3097fb,_0x5da8fd){var _0x86e90=_0x3097fb[_0xe0b0('0x33')][_0xe0b0('0x57')];return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x86e90},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe0b0('0x58'),'attributes':['id','name',_0xe0b0('0x59'),_0xe0b0('0x5a'),_0xe0b0('0x5b')],'raw':!![]}]})[_0xe0b0('0x18')](function(_0x4a78f8){if(_0x4a78f8){var _0x311f79=_[_0xe0b0('0x5c')](_0x4a78f8,function(_0x49deef){var _0x4cf60a=_0x49deef[_0xe0b0('0x34')]({'plain':!![]});return _0x4cf60a[_0xe0b0('0x58')];});return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x3097fb[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](function(_0x34f4ff){return db[_0xe0b0('0x5d')][_0xe0b0('0x5e')](function(_0x24571b){return _0x34f4ff['addTeams'](_0x86e90,{'transaction':_0x24571b})['then'](function(){return BPromise[_0xe0b0('0x5f')](_0x311f79,function(_0x4880d5){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x4880d5['id'],'SmsQueueId':_0x3097fb['params']['id']},'transaction':_0x24571b});});})[_0xe0b0('0x18')](function(){_0x311f79['forEach'](function(_0x654d2b){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':_0x654d2b['id'],'SmsQueueId':_0x34f4ff['id']});});});});});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x5da8fd,null))['catch'](handleError(_0x5da8fd,null));};exports[_0xe0b0('0x62')]=function(_0x948708,_0x5a0817){return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')]},'attributes':['id'],'include':[{'model':db[_0xe0b0('0x4a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5a0817,null))['then'](function(_0x545694){var _0x5c258b=_[_0xe0b0('0x48')](_0x545694,'id');var _0x567e1a=[];var _0x3c09af=[];var _0x5f4aaf=squel[_0xe0b0('0x63')]();_0x5f4aaf[_0xe0b0('0x64')](_0xe0b0('0x65'))[_0xe0b0('0x66')](_0xe0b0('0x67'),'tq')[_0xe0b0('0x68')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('SmsQueueId\x20=\x20?',_0x948708[_0xe0b0('0x41')]['id']);for(var _0x261381=0x0;_0x261381<_0x545694[_0xe0b0('0x2e')];_0x261381+=0x1){let _0x4377f7=_0x545694[_0x261381];for(var _0x2c1149=0x0;_0x2c1149<_0x4377f7['Agents'][_0xe0b0('0x2e')];_0x2c1149+=0x1){let _0x39a07b=_0x4377f7[_0xe0b0('0x58')][_0x2c1149];var _0xc6090e=_0x5f4aaf[_0xe0b0('0x69')]();_0xc6090e[_0xe0b0('0x45')](_0xe0b0('0x6a'),_0x39a07b['id']);_0x3c09af[_0xe0b0('0x6b')](db[_0xe0b0('0x5d')]['query'](_0xc6090e['toString'](),{'type':db[_0xe0b0('0x5d')][_0xe0b0('0x6c')]['SELECT']})[_0xe0b0('0x18')](function(_0x4593f1){if(_0x4593f1[_0xe0b0('0x2e')]===0x1){return _0x39a07b['id'];}else{var _0x3fcffd=_[_0xe0b0('0x6d')](_[_0xe0b0('0x48')](_0x4593f1,_0xe0b0('0x6e')),function(_0xc8eba3){return _['includes'](_0x5c258b,_0xc8eba3);});if(_0x3fcffd){return _0x39a07b['id'];}}}));}}return BPromise['all'](_0x3c09af)['then'](function(_0xc19743){_0x567e1a=_(_0x567e1a)[_0xe0b0('0x6f')](_0xc19743)['compact']()[_0xe0b0('0x70')]();return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x948708[_0xe0b0('0x41')]['id']}})['then'](function(_0x56c4b9){return db['sequelize'][_0xe0b0('0x5e')](function(_0x266835){return _0x56c4b9['removeTeams'](_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')],{'transaction':_0x266835})['then'](function(){if(!_['isEmpty'](_0x567e1a)){return _0x56c4b9[_0xe0b0('0x71')](_0x567e1a,{'transaction':_0x266835});}})['then'](function(){_0x567e1a[_0xe0b0('0x72')](function(_0x5f06c0){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':_0x5f06c0,'SmsQueueId':_0x56c4b9['id']});});});});});});})[_0xe0b0('0x18')](respondWithStatusCode(_0x5a0817,null))[_0xe0b0('0x3d')](handleError(_0x5a0817,null));};exports[_0xe0b0('0x74')]=function(_0x1ec7c2,_0x434dfa){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x1ec7c2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x434dfa,null))[_0xe0b0('0x18')](function(_0x2b40eb){if(_0x2b40eb){return _0x2b40eb['addAgents'](_0x1ec7c2[_0xe0b0('0x33')]['ids'],_[_0xe0b0('0x75')](_0x1ec7c2[_0xe0b0('0x33')],['ids','id'])||{})[_0xe0b0('0x76')](function(_0x4e4b45){for(var _0x528932=0x0;_0x528932<_0x1ec7c2[_0xe0b0('0x33')]['ids']['length'];_0x528932+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':Number(_0x1ec7c2[_0xe0b0('0x33')][_0xe0b0('0x57')][_0x528932]),'SmsQueueId':Number(_0x1ec7c2[_0xe0b0('0x41')]['id'])});}return _0x4e4b45;});}})[_0xe0b0('0x18')](respondWithResult(_0x434dfa,null))['catch'](handleError(_0x434dfa,null));};exports[_0xe0b0('0x71')]=function(_0x4609d5,_0x421b3b){return db['SmsQueue'][_0xe0b0('0x32')]({'where':{'id':_0x4609d5[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x421b3b,null))['then'](function(_0x33f89a){if(_0x33f89a){return _0x33f89a['removeAgents'](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])[_0xe0b0('0x18')](function(){if(_[_0xe0b0('0x77')](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])){for(var _0x3d70d7=0x0;_0x3d70d7<_0x4609d5['query'][_0xe0b0('0x57')][_0xe0b0('0x2e')];_0x3d70d7+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')]['ids'][_0x3d70d7]),'SmsQueueId':Number(_0x4609d5['params']['id'])});}}else{socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')]),'SmsQueueId':Number(_0x4609d5[_0xe0b0('0x41')]['id'])});}});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x421b3b,null))[_0xe0b0('0x3d')](handleError(_0x421b3b,null));};exports[_0xe0b0('0x78')]=function(_0x932e,_0x1b3f4d){var _0x4fe048={};var _0xac45e6={};var _0x401c4b;var _0x3e18a3;return db[_0xe0b0('0x1d')]['findOne']({'where':{'id':_0x932e[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x1b3f4d,null))[_0xe0b0('0x18')](function(_0x116c16){if(_0x116c16){_0x401c4b=_0x116c16;_0xac45e6[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x4a')]['rawAttributes']);_0xac45e6[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x932e[_0xe0b0('0x23')]);_0xac45e6[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0xac45e6['model'],_0xac45e6['query']);_0x4fe048[_0xe0b0('0x2c')]=_['intersection'](_0xac45e6[_0xe0b0('0x27')],qs['fields'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x4fe048[_0xe0b0('0x2c')]=_0x4fe048[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x4fe048[_0xe0b0('0x2c')]:_0xac45e6[_0xe0b0('0x27')];_0x4fe048['order']=qs['sort'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x44')]);_0x4fe048[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x932e[_0xe0b0('0x23')],_0xac45e6[_0xe0b0('0x2a')]));if(_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x4fe048[_0xe0b0('0x45')]=_['merge'](_0x4fe048['where'],{'$or':_[_0xe0b0('0x48')](_0x4fe048[_0xe0b0('0x2c')],function(_0x187465){var _0x3f9e6b={};_0x3f9e6b[_0x187465]={'$like':'%'+_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3f9e6b;})});}_0x4fe048=_[_0xe0b0('0x30')]({},_0x4fe048,_0x932e['options']);return _0x401c4b['getAgents'](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x1ea4d5){if(_0x1ea4d5){_0x3e18a3=_0x1ea4d5[_0xe0b0('0x2e')];if(!_0x932e[_0xe0b0('0x23')][_0xe0b0('0x79')](_0xe0b0('0x42'))){_0x4fe048[_0xe0b0('0x12')]=qs[_0xe0b0('0x12')](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x12')]);_0x4fe048['offset']=qs[_0xe0b0('0x10')](_0x932e[_0xe0b0('0x23')]['offset']);}return _0x401c4b[_0xe0b0('0x78')](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x3615f9){if(_0x3615f9){return _0x3615f9?{'count':_0x3e18a3,'rows':_0x3615f9}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x1b3f4d,null))[_0xe0b0('0x3d')](handleError(_0x1b3f4d,null));}; \ No newline at end of file +var _0xdb28=['userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','update','then','get','SmsQueues','destroy','error','stack','name','map','SmsQueue','fieldName','type','key','where','include','rows','show','keys','query','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','body','params','describe','getMembers','findOne','UserSmsQueue','rawAttributes','hasOwnProperty','nolimit','order','sort','SmsQueueId','filter','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','pick','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','emit'];(function(_0x5ed9ed,_0x4ebd49){var _0xb64dc2=function(_0x1b23f9){while(--_0x1b23f9){_0x5ed9ed['push'](_0x5ed9ed['shift']());}};_0xb64dc2(++_0x4ebd49);}(_0xdb28,0x106));var _0x8db2=function(_0x189434,_0x4c7e20){_0x189434=_0x189434-0x0;var _0x2bd839=_0xdb28[_0x189434];return _0x2bd839;};'use strict';var BPromise=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var _=require(_0x8db2('0x2'));var squel=require(_0x8db2('0x3'));var Redis=require('ioredis');var qs=require(_0x8db2('0x4'));var logger=require(_0x8db2('0x5'))(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var db=require(_0x8db2('0x8'))['db'];config['redis']=_[_0x8db2('0x9')](config[_0x8db2('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8db2('0xa')]));require(_0x8db2('0xb'))[_0x8db2('0xc')](socket);function respondWithStatusCode(_0x29f698,_0x2f3f2f){_0x2f3f2f=_0x2f3f2f||0xcc;return function(_0x1ff362){if(_0x1ff362){return _0x29f698[_0x8db2('0xd')](_0x2f3f2f);}return _0x29f698['status'](_0x2f3f2f)[_0x8db2('0xe')]();};}function respondWithResult(_0x476216,_0x1f62af){_0x1f62af=_0x1f62af||0xc8;return function(_0x57015f){if(_0x57015f){return _0x476216[_0x8db2('0xf')](_0x1f62af)[_0x8db2('0x10')](_0x57015f);}};}function respondWithFilteredResult(_0x576475,_0x41beda){return function(_0x3b2faa){if(_0x3b2faa){var _0x1349f6=typeof _0x41beda[_0x8db2('0x11')]===_0x8db2('0x12')&&typeof _0x41beda['limit']==='undefined';var _0x15070d=_0x3b2faa[_0x8db2('0x13')];var _0x350d61=_0x1349f6?0x0:_0x41beda[_0x8db2('0x11')];var _0x227355=_0x1349f6?_0x3b2faa[_0x8db2('0x13')]:_0x41beda[_0x8db2('0x11')]+_0x41beda[_0x8db2('0x14')];var _0x131252;if(_0x227355>=_0x15070d){_0x227355=_0x15070d;_0x131252=0xc8;}else{_0x131252=0xce;}_0x576475[_0x8db2('0xf')](_0x131252);return _0x576475['set'](_0x8db2('0x15'),_0x350d61+'-'+_0x227355+'/'+_0x15070d)[_0x8db2('0x10')](_0x3b2faa);}return null;};}function saveUpdates(_0x48101e){return function(_0x2b3f73){if(_0x2b3f73){return _0x2b3f73[_0x8db2('0x16')](_0x48101e)[_0x8db2('0x17')](function(_0x3fddc2){return _0x3fddc2;});}return null;};}function removeEntity(_0x2efd06){return function(_0x46ce14){if(_0x46ce14){return _0x46ce14['destroy']()['then'](function(){var _0x77789=_0x46ce14[_0x8db2('0x18')]({'plain':!![]});var _0x1310d3=_0x8db2('0x19');return db['UserProfileResource'][_0x8db2('0x1a')]({'where':{'type':_0x1310d3,'resourceId':_0x77789['id']}})[_0x8db2('0x17')](function(){return _0x46ce14;});})[_0x8db2('0x17')](function(){_0x2efd06[_0x8db2('0xf')](0xcc)[_0x8db2('0xe')]();});}};}function handleEntityNotFound(_0x597260){return function(_0x124467){if(!_0x124467){_0x597260[_0x8db2('0xd')](0x194);}return _0x124467;};}function handleError(_0x18f69c,_0x125be2){_0x125be2=_0x125be2||0x1f4;return function(_0x2260d8){logger[_0x8db2('0x1b')](_0x2260d8[_0x8db2('0x1c')]);if(_0x2260d8['name']){delete _0x2260d8[_0x8db2('0x1d')];}_0x18f69c['status'](_0x125be2)['send'](_0x2260d8);};}exports['index']=function(_0x4d923c,_0xec8cd2){var _0x29b5cd={};var _0x3be281={'count':0x0,'rows':[]};var _0x2baed0=_[_0x8db2('0x1e')](db[_0x8db2('0x1f')]['rawAttributes'],function(_0x3544ba){return{'name':_0x3544ba[_0x8db2('0x20')],'type':_0x3544ba[_0x8db2('0x21')][_0x8db2('0x22')]};});_0x29b5cd=qs['getOptions'](_0x2baed0,_0x4d923c);var _0x2e0691={'where':_0x29b5cd[_0x8db2('0x23')]};return db[_0x8db2('0x1f')][_0x8db2('0x13')](_0x2e0691)[_0x8db2('0x17')](function(_0x21bae5){_0x3be281[_0x8db2('0x13')]=_0x21bae5;_0x29b5cd[_0x8db2('0x24')]=qs[_0x8db2('0x24')](_0x4d923c['query']);return db[_0x8db2('0x1f')]['findAll'](_0x29b5cd);})['then'](function(_0x302188){_0x3be281[_0x8db2('0x25')]=_0x302188;return _0x3be281;})[_0x8db2('0x17')](respondWithFilteredResult(_0xec8cd2,_0x29b5cd))['catch'](handleError(_0xec8cd2,null));};exports[_0x8db2('0x26')]=function(_0x56b71a,_0x3f7aac){var _0x2b653b={'raw':!![],'where':{'id':_0x56b71a['params']['id']}},_0x14bd12={};_0x14bd12['model']=_[_0x8db2('0x27')](db[_0x8db2('0x1f')]['rawAttributes']);_0x14bd12['query']=_[_0x8db2('0x27')](_0x56b71a[_0x8db2('0x28')]);_0x14bd12[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],_0x14bd12[_0x8db2('0x28')]);_0x2b653b[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x56b71a['query'][_0x8db2('0x2d')]));_0x2b653b[_0x8db2('0x2c')]=_0x2b653b['attributes'][_0x8db2('0x2e')]?_0x2b653b[_0x8db2('0x2c')]:_0x14bd12['model'];if(_0x56b71a['query'][_0x8db2('0x2f')]){_0x2b653b['include']=[{'all':!![]}];}_0x2b653b=_[_0x8db2('0x30')]({},_0x2b653b,_0x56b71a[_0x8db2('0x31')]);return db[_0x8db2('0x1f')][_0x8db2('0x32')](_0x2b653b)['then'](handleEntityNotFound(_0x3f7aac,null))[_0x8db2('0x17')](respondWithResult(_0x3f7aac,null))['catch'](handleError(_0x3f7aac,null));};exports[_0x8db2('0x33')]=function(_0xd550ae,_0x2c8bc9){return db[_0x8db2('0x1f')]['create'](_0xd550ae['body'],{})[_0x8db2('0x17')](function(_0x2c0507){var _0x5dc2b4=_0xd550ae[_0x8db2('0x34')][_0x8db2('0x18')]({'plain':!![]});if(!_0x5dc2b4)throw new Error(_0x8db2('0x35'));if(_0x5dc2b4['role']===_0x8db2('0x34')){var _0x149186=_0x2c0507[_0x8db2('0x18')]({'plain':!![]});var _0x279e74=_0x8db2('0x19');return db[_0x8db2('0x36')][_0x8db2('0x32')]({'where':{'name':_0x279e74,'userProfileId':_0x5dc2b4[_0x8db2('0x37')]},'raw':!![]})[_0x8db2('0x17')](function(_0x63c561){if(_0x63c561&&_0x63c561[_0x8db2('0x38')]===0x0){return db[_0x8db2('0x39')][_0x8db2('0x33')]({'name':_0x149186['name'],'resourceId':_0x149186['id'],'type':_0x63c561[_0x8db2('0x1d')],'sectionId':_0x63c561['id']},{})[_0x8db2('0x17')](function(){return _0x2c0507;});}else{return _0x2c0507;}})['catch'](function(_0x49a7ae){logger[_0x8db2('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a7ae);throw _0x49a7ae;});}return _0x2c0507;})[_0x8db2('0x17')](respondWithResult(_0x2c8bc9,0xc9))[_0x8db2('0x3a')](handleError(_0x2c8bc9,null));};exports[_0x8db2('0x16')]=function(_0x307783,_0xb4fe2c){if(_0x307783[_0x8db2('0x3b')]['id']){delete _0x307783[_0x8db2('0x3b')]['id'];}return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x307783[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0xb4fe2c,null))[_0x8db2('0x17')](saveUpdates(_0x307783['body'],null))[_0x8db2('0x17')](respondWithResult(_0xb4fe2c,null))[_0x8db2('0x3a')](handleError(_0xb4fe2c,null));};exports[_0x8db2('0x1a')]=function(_0x2c47cc,_0x5427af){return db[_0x8db2('0x1f')]['find']({'where':{'id':_0x2c47cc[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5427af,null))[_0x8db2('0x17')](removeEntity(_0x5427af,null))['catch'](handleError(_0x5427af,null));};exports['describe']=function(_0x1ec3d0,_0x47c556){return db[_0x8db2('0x1f')][_0x8db2('0x3d')]()[_0x8db2('0x17')](respondWithResult(_0x47c556,null))[_0x8db2('0x3a')](handleError(_0x47c556,null));};exports[_0x8db2('0x3e')]=function(_0x40c6e6,_0x4355e2){var _0xab6bdd={'raw':!![],'where':{}},_0x4291e3={},_0x12a1ef;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x40c6e6['params']['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4355e2,null))[_0x8db2('0x17')](function(_0xdbba64){if(_0xdbba64){_0x12a1ef=_0xdbba64[_0x8db2('0x18')]({'plain':!![]});_0x4291e3['model']=_['keys'](db[_0x8db2('0x40')][_0x8db2('0x41')]);_0x4291e3[_0x8db2('0x28')]=_['keys'](_0x40c6e6['query']);_0x4291e3['filters']=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],_0x4291e3[_0x8db2('0x28')]);_0xab6bdd[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x40c6e6['query']['fields']));_0xab6bdd[_0x8db2('0x2c')]=_0xab6bdd[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0xab6bdd[_0x8db2('0x2c')]:_0x4291e3[_0x8db2('0x2b')];if(!_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x42')](_0x8db2('0x43'))){_0xab6bdd[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x14')]);_0xab6bdd[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x40c6e6[_0x8db2('0x28')]['offset']);}_0xab6bdd[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x40c6e6['query'][_0x8db2('0x45')]);_0xab6bdd[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x40c6e6[_0x8db2('0x28')],_0x4291e3[_0x8db2('0x29')]));_0xab6bdd[_0x8db2('0x23')][_0x8db2('0x46')]=_0xdbba64['id'];if(_0x40c6e6[_0x8db2('0x28')]['filter']){_0xab6bdd[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0xab6bdd[_0x8db2('0x23')],{'$or':_['map'](_0xab6bdd[_0x8db2('0x2c')],function(_0x18cc13){var _0x33dddd={};_0x33dddd[_0x18cc13]={'$like':'%'+_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x33dddd;})});}_0xab6bdd=_[_0x8db2('0x30')]({},_0xab6bdd,_0x40c6e6[_0x8db2('0x31')]);return db['UserSmsQueue'][_0x8db2('0x48')](_0xab6bdd);}})[_0x8db2('0x17')](function(_0x4d3c19){if(_0x4d3c19){return db[_0x8db2('0x49')][_0x8db2('0x4a')]({'where':{'id':_['map'](_0x4d3c19,_0x8db2('0x4b')),'role':_0x8db2('0x4c')},'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x4d'),_0x8db2('0x4e'),_0x8db2('0x4f')]});}})[_0x8db2('0x17')](function(_0x33a600){if(_0x33a600){return{'count':_0x33a600[_0x8db2('0x13')],'rows':_[_0x8db2('0x1e')](_0x33a600[_0x8db2('0x25')],function(_0x447a47){return{'membername':_0x447a47[_0x8db2('0x1d')],'UserId':_0x447a47['id'],'queue_name':_0x12a1ef[_0x8db2('0x1d')],'SmsQueueId':_0x12a1ef['id'],'interface':util[_0x8db2('0x50')](_0x8db2('0x51'),'SIP',_0x447a47[_0x8db2('0x1d')]),'penalty':0x0,'paused':_0x447a47[_0x8db2('0x4d')],'createdAt':_0x447a47[_0x8db2('0x4f')],'updatedAt':_0x447a47[_0x8db2('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8db2('0x17')](respondWithFilteredResult(_0x4355e2,_0xab6bdd))['catch'](handleError(_0x4355e2,null));};exports[_0x8db2('0x52')]=function(_0x2c3087,_0x3ab670){var _0x1e1c0d={};var _0x2ad70f={};var _0x348da8;var _0x17341d;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x2c3087[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x3ab670,null))[_0x8db2('0x17')](function(_0x170a72){if(_0x170a72){_0x348da8=_0x170a72;_0x2ad70f[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x53')][_0x8db2('0x41')]);_0x2ad70f[_0x8db2('0x28')]=_['keys'](_0x2c3087[_0x8db2('0x28')]);_0x2ad70f['filters']=_[_0x8db2('0x2a')](_0x2ad70f['model'],_0x2ad70f[_0x8db2('0x28')]);_0x1e1c0d[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x2ad70f[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x2c3087['query']['fields']));_0x1e1c0d[_0x8db2('0x2c')]=_0x1e1c0d[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0x1e1c0d[_0x8db2('0x2c')]:_0x2ad70f[_0x8db2('0x2b')];_0x1e1c0d[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2c3087[_0x8db2('0x28')]['sort']);_0x1e1c0d[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_[_0x8db2('0x54')](_0x2c3087[_0x8db2('0x28')],_0x2ad70f[_0x8db2('0x29')]));if(_0x2c3087[_0x8db2('0x28')][_0x8db2('0x47')]){_0x1e1c0d[_0x8db2('0x23')]=_['merge'](_0x1e1c0d['where'],{'$or':_[_0x8db2('0x1e')](_0x1e1c0d[_0x8db2('0x2c')],function(_0x1d2dfc){var _0x27f4cd={};_0x27f4cd[_0x1d2dfc]={'$like':'%'+_0x2c3087[_0x8db2('0x28')]['filter']+'%'};return _0x27f4cd;})});}_0x1e1c0d=_['merge']({},_0x1e1c0d,_0x2c3087[_0x8db2('0x31')]);return _0x348da8[_0x8db2('0x52')](_0x1e1c0d);}})['then'](function(_0xa698bd){if(_0xa698bd){_0x17341d=_0xa698bd[_0x8db2('0x2e')];if(!_0x2c3087[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x1e1c0d[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2c3087['query'][_0x8db2('0x14')]);_0x1e1c0d[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2c3087[_0x8db2('0x28')][_0x8db2('0x11')]);}return _0x348da8['getTeams'](_0x1e1c0d);}})[_0x8db2('0x17')](function(_0x3023fe){if(_0x3023fe){return _0x3023fe?{'count':_0x17341d,'rows':_0x3023fe}:null;}})[_0x8db2('0x17')](respondWithResult(_0x3ab670,null))['catch'](handleError(_0x3ab670,null));};exports['addTeams']=function(_0x2cdf3c,_0xbe05ca){var _0x487dcb=_0x2cdf3c[_0x8db2('0x3b')][_0x8db2('0x55')];return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x487dcb},'attributes':['id'],'include':[{'model':db[_0x8db2('0x49')],'as':_0x8db2('0x56'),'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x57'),_0x8db2('0x58'),_0x8db2('0x59')],'raw':!![]}]})[_0x8db2('0x17')](function(_0x3e1478){if(_0x3e1478){var _0x24a52d=_['flatMap'](_0x3e1478,function(_0x2ba42d){var _0x4f29f1=_0x2ba42d[_0x8db2('0x18')]({'plain':!![]});return _0x4f29f1[_0x8db2('0x56')];});return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x2cdf3c[_0x8db2('0x3c')]['id']}})['then'](function(_0x2159c4){return db[_0x8db2('0x5a')][_0x8db2('0x5b')](function(_0x25a3ab){return _0x2159c4[_0x8db2('0x5c')](_0x487dcb,{'transaction':_0x25a3ab})[_0x8db2('0x17')](function(){return BPromise[_0x8db2('0x5d')](_0x24a52d,function(_0x3ac0fa){return db[_0x8db2('0x40')]['findOrCreate']({'where':{'UserId':_0x3ac0fa['id'],'SmsQueueId':_0x2cdf3c['params']['id']},'transaction':_0x25a3ab});});})[_0x8db2('0x17')](function(){_0x24a52d['forEach'](function(_0xf8afa5){socket[_0x8db2('0x5e')](_0x8db2('0x5f'),{'UserId':_0xf8afa5['id'],'SmsQueueId':_0x2159c4['id']});});});});});}})['then'](respondWithStatusCode(_0xbe05ca,null))[_0x8db2('0x3a')](handleError(_0xbe05ca,null));};exports[_0x8db2('0x60')]=function(_0x3e37e7,_0x591c5d){return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8db2('0x56'),'attributes':['id'],'raw':!![]}]})[_0x8db2('0x17')](handleEntityNotFound(_0x591c5d,null))[_0x8db2('0x17')](function(_0x1edb1a){var _0xcf1c42=_[_0x8db2('0x1e')](_0x1edb1a,'id');var _0x1aadfb=[];var _0x3682bf=[];var _0x358f48=squel[_0x8db2('0x61')]();_0x358f48[_0x8db2('0x62')]('tq.TeamId')[_0x8db2('0x63')](_0x8db2('0x64'),'tq')[_0x8db2('0x65')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8db2('0x66'),_0x3e37e7[_0x8db2('0x3c')]['id']);for(var _0x3191c8=0x0;_0x3191c8<_0x1edb1a[_0x8db2('0x2e')];_0x3191c8+=0x1){let _0x2ad024=_0x1edb1a[_0x3191c8];for(var _0x313918=0x0;_0x313918<_0x2ad024[_0x8db2('0x56')][_0x8db2('0x2e')];_0x313918+=0x1){let _0x3b1929=_0x2ad024[_0x8db2('0x56')][_0x313918];var _0x46eb80=_0x358f48['clone']();_0x46eb80[_0x8db2('0x23')](_0x8db2('0x67'),_0x3b1929['id']);_0x3682bf[_0x8db2('0x68')](db[_0x8db2('0x5a')]['query'](_0x46eb80['toString'](),{'type':db[_0x8db2('0x5a')][_0x8db2('0x69')]['SELECT']})[_0x8db2('0x17')](function(_0x121f31){if(_0x121f31[_0x8db2('0x2e')]===0x1){return _0x3b1929['id'];}else{var _0x5f2ece=_['every'](_['map'](_0x121f31,_0x8db2('0x6a')),function(_0x18b4a6){return _[_0x8db2('0x6b')](_0xcf1c42,_0x18b4a6);});if(_0x5f2ece){return _0x3b1929['id'];}}}));}}return BPromise[_0x8db2('0x6c')](_0x3682bf)[_0x8db2('0x17')](function(_0x4e8aac){_0x1aadfb=_(_0x1aadfb)[_0x8db2('0x6d')](_0x4e8aac)['compact']()[_0x8db2('0x6e')]();return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x3e37e7[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](function(_0x5d5380){return db['sequelize'][_0x8db2('0x5b')](function(_0x51afcf){return _0x5d5380[_0x8db2('0x60')](_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')],{'transaction':_0x51afcf})[_0x8db2('0x17')](function(){if(!_[_0x8db2('0x6f')](_0x1aadfb)){return _0x5d5380[_0x8db2('0x70')](_0x1aadfb,{'transaction':_0x51afcf});}})['then'](function(){_0x1aadfb[_0x8db2('0x71')](function(_0x222ea2){socket[_0x8db2('0x5e')]('userSmsQueue:remove',{'UserId':_0x222ea2,'SmsQueueId':_0x5d5380['id']});});});});});});})[_0x8db2('0x17')](respondWithStatusCode(_0x591c5d,null))[_0x8db2('0x3a')](handleError(_0x591c5d,null));};exports['addAgents']=function(_0x2d7abf,_0x7cb97d){return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x2d7abf[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x7cb97d,null))[_0x8db2('0x17')](function(_0x19e25b){if(_0x19e25b){return _0x19e25b[_0x8db2('0x72')](_0x2d7abf['body'][_0x8db2('0x55')],_[_0x8db2('0x73')](_0x2d7abf[_0x8db2('0x3b')],[_0x8db2('0x55'),'id'])||{})[_0x8db2('0x74')](function(_0x345ff9){for(var _0x16d1c5=0x0;_0x16d1c5<_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x8db2('0x2e')];_0x16d1c5+=0x1){socket['emit'](_0x8db2('0x5f'),{'UserId':Number(_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x16d1c5]),'SmsQueueId':Number(_0x2d7abf[_0x8db2('0x3c')]['id'])});}return _0x345ff9;});}})['then'](respondWithResult(_0x7cb97d,null))[_0x8db2('0x3a')](handleError(_0x7cb97d,null));};exports[_0x8db2('0x70')]=function(_0x46476e,_0x4f653e){return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x46476e[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4f653e,null))[_0x8db2('0x17')](function(_0x4f9ce4){if(_0x4f9ce4){return _0x4f9ce4[_0x8db2('0x70')](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])[_0x8db2('0x17')](function(){if(_['isArray'](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])){for(var _0x3e7b24=0x0;_0x3e7b24<_0x46476e['query']['ids']['length'];_0x3e7b24+=0x1){socket[_0x8db2('0x5e')](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')][_0x3e7b24]),'SmsQueueId':Number(_0x46476e['params']['id'])});}}else{socket['emit'](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')]),'SmsQueueId':Number(_0x46476e[_0x8db2('0x3c')]['id'])});}});}})[_0x8db2('0x17')](respondWithStatusCode(_0x4f653e,null))[_0x8db2('0x3a')](handleError(_0x4f653e,null));};exports['getAgents']=function(_0x2942eb,_0x5f32ce){var _0x432780={};var _0x23457b={};var _0x1ef898;var _0x39f2d3;return db[_0x8db2('0x1f')]['findOne']({'where':{'id':_0x2942eb[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5f32ce,null))['then'](function(_0x28beec){if(_0x28beec){_0x1ef898=_0x28beec;_0x23457b[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x49')]['rawAttributes']);_0x23457b[_0x8db2('0x28')]=_['keys'](_0x2942eb['query']);_0x23457b[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],_0x23457b[_0x8db2('0x28')]);_0x432780[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],qs['fields'](_0x2942eb[_0x8db2('0x28')]['fields']));_0x432780['attributes']=_0x432780[_0x8db2('0x2c')]['length']?_0x432780['attributes']:_0x23457b[_0x8db2('0x2b')];_0x432780[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2942eb['query'][_0x8db2('0x45')]);_0x432780[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x2942eb[_0x8db2('0x28')],_0x23457b[_0x8db2('0x29')]));if(_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]){_0x432780[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0x432780[_0x8db2('0x23')],{'$or':_[_0x8db2('0x1e')](_0x432780['attributes'],function(_0xa7b208){var _0x3cb456={};_0x3cb456[_0xa7b208]={'$like':'%'+_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x3cb456;})});}_0x432780=_[_0x8db2('0x30')]({},_0x432780,_0x2942eb[_0x8db2('0x31')]);return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x3a53e2){if(_0x3a53e2){_0x39f2d3=_0x3a53e2[_0x8db2('0x2e')];if(!_0x2942eb[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x432780[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2942eb['query'][_0x8db2('0x14')]);_0x432780[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2942eb['query']['offset']);}return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x296966){if(_0x296966){return _0x296966?{'count':_0x39f2d3,'rows':_0x296966}:null;}})[_0x8db2('0x17')](respondWithResult(_0x5f32ce,null))[_0x8db2('0x3a')](handleError(_0x5f32ce,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index fc81c40..9490a5f 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 _0xcaf2=['events','../../mysqldb','SmsQueue','setMaxListeners','remove','hook','exports'];(function(_0x5633c3,_0x5d5b2a){var _0x331bc8=function(_0x5da65d){while(--_0x5da65d){_0x5633c3['push'](_0x5633c3['shift']());}};_0x331bc8(++_0x5d5b2a);}(_0xcaf2,0x12d));var _0x2caf=function(_0x25c398,_0x13284b){_0x25c398=_0x25c398-0x0;var _0x3311bc=_0xcaf2[_0x25c398];return _0x3311bc;};'use strict';var EventEmitter=require(_0x2caf('0x0'));var SmsQueue=require(_0x2caf('0x1'))['db'][_0x2caf('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x2caf('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2caf('0x4')};function emitEvent(_0x1c171e){return function(_0x4ee5cf,_0x1b9a82,_0x47a865){SmsQueueEvents['emit'](_0x1c171e+':'+_0x4ee5cf['id'],_0x4ee5cf);SmsQueueEvents['emit'](_0x1c171e,_0x4ee5cf);_0x47a865(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x2caf('0x5')](e,emitEvent(event));}}module[_0x2caf('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0x84f4=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x1dcefc,_0x377c95){var _0xc92c86=function(_0x2fd4d8){while(--_0x2fd4d8){_0x1dcefc['push'](_0x1dcefc['shift']());}};_0xc92c86(++_0x377c95);}(_0x84f4,0x1a2));var _0x484f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x84f4[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x484f('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x484f('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x484f('0x2'),'afterDestroy':'remove'};function emitEvent(_0x200fa0){return function(_0x178082,_0x1a4a83,_0x22cec5){SmsQueueEvents[_0x484f('0x3')](_0x200fa0+':'+_0x178082['id'],_0x178082);SmsQueueEvents[_0x484f('0x3')](_0x200fa0,_0x178082);_0x22cec5(null);};}for(var e in events){if(events[_0x484f('0x4')](e)){var event=events[e];SmsQueue[_0x484f('0x5')](e,emitEvent(event));}}module[_0x484f('0x6')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 1462386..9da22eb 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 _0xa9a5=['SmsQueue','sms_queues','lodash','util','../../config/logger','api','bluebird','path','exports'];(function(_0xf080c0,_0x261f16){var _0x12351e=function(_0x470672){while(--_0x470672){_0xf080c0['push'](_0xf080c0['shift']());}};_0x12351e(++_0x261f16);}(_0xa9a5,0x1a0));var _0x5a9a=function(_0x5d2543,_0xa0a4d6){_0x5d2543=_0x5d2543-0x0;var _0x420a20=_0xa9a5[_0x5d2543];return _0x420a20;};'use strict';var _=require(_0x5a9a('0x0'));var util=require(_0x5a9a('0x1'));var logger=require(_0x5a9a('0x2'))(_0x5a9a('0x3'));var moment=require('moment');var BPromise=require(_0x5a9a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a9a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0x5a9a('0x6')]=function(_0x3389fc,_0x1e9ff9){return _0x3389fc['define'](_0x5a9a('0x7'),attributes,{'tableName':_0x5a9a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd55=['api','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','util','../../config/logger'];(function(_0xcebe2b,_0x3971af){var _0x38d672=function(_0x4f7f79){while(--_0x4f7f79){_0xcebe2b['push'](_0xcebe2b['shift']());}};_0x38d672(++_0x3971af);}(_0xcd55,0x14e));var _0x5cd5=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xcd55[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0x5cd5('0x0'));var logger=require(_0x5cd5('0x1'))(_0x5cd5('0x2'));var moment=require('moment');var BPromise=require(_0x5cd5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5cd5('0x4'));var rimraf=require(_0x5cd5('0x5'));var config=require(_0x5cd5('0x6'));var attributes=require(_0x5cd5('0x7'));module[_0x5cd5('0x8')]=function(_0x20d209,_0x3b2211){return _0x20d209[_0x5cd5('0x9')](_0x5cd5('0xa'),attributes,{'tableName':_0x5cd5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 014ab93..84d5cf0 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 _0xb3f9=['redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetSmsQueue','SmsQueue','options','where','attributes','limit','include','map','model','ShowSmsQueue','find','raw','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','client','http','defaults'];(function(_0x49f38c,_0x2e1793){var _0x2e4559=function(_0x22a545){while(--_0x22a545){_0x49f38c['push'](_0x49f38c['shift']());}};_0x2e4559(++_0x2e1793);}(_0xb3f9,0x186));var _0x9b3f=function(_0x55325e,_0x4ea1fa){_0x55325e=_0x55325e-0x0;var _0x6241b4=_0xb3f9[_0x55325e];return _0x6241b4;};'use strict';var _=require(_0x9b3f('0x0'));var util=require(_0x9b3f('0x1'));var moment=require(_0x9b3f('0x2'));var BPromise=require('bluebird');var rs=require(_0x9b3f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9b3f('0x4'))(_0x9b3f('0x5'));var config=require(_0x9b3f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9b3f('0x7')][_0x9b3f('0x8')]({'port':0x232a});config['redis']=_[_0x9b3f('0x9')](config[_0x9b3f('0xa')],{'host':_0x9b3f('0xb'),'port':0x18eb});var socket=require(_0x9b3f('0xc'))(new Redis(config[_0x9b3f('0xa')]));require(_0x9b3f('0xd'))[_0x9b3f('0xe')](socket);function respondWithRpcPromise(_0xf6992a,_0x2bae79,_0x1e2527){return new BPromise(function(_0x4b7e6c,_0x374f68){return client[_0x9b3f('0xf')](_0xf6992a,_0x1e2527)[_0x9b3f('0x10')](function(_0x50287e){logger[_0x9b3f('0x11')](_0x9b3f('0x12'),_0x2bae79,_0x9b3f('0x13'));logger[_0x9b3f('0x14')](_0x9b3f('0x15'),_0x2bae79,_0x9b3f('0x13'),JSON[_0x9b3f('0x16')](_0x50287e));if(_0x50287e['error']){if(_0x50287e['error'][_0x9b3f('0x17')]===0x1f4){logger[_0x9b3f('0x18')](_0x9b3f('0x12'),_0x2bae79,_0x50287e['error'][_0x9b3f('0x19')]);return _0x374f68(_0x50287e[_0x9b3f('0x18')]['message']);}logger[_0x9b3f('0x18')]('SmsQueue,\x20%s,\x20%s',_0x2bae79,_0x50287e['error'][_0x9b3f('0x19')]);return _0x4b7e6c(_0x50287e[_0x9b3f('0x18')]['message']);}else{logger[_0x9b3f('0x11')](_0x9b3f('0x12'),_0x2bae79,'request\x20sent');_0x4b7e6c(_0x50287e[_0x9b3f('0x1a')][_0x9b3f('0x19')]);}})[_0x9b3f('0x1b')](function(_0x5e909a){logger[_0x9b3f('0x18')](_0x9b3f('0x12'),_0x2bae79,_0x5e909a);_0x374f68(_0x5e909a);});});}exports[_0x9b3f('0x1c')]=function(_0x152aac){var _0x3ed50e=this;return new Promise(function(_0x5272c2,_0xe380b7){return db[_0x9b3f('0x1d')]['findAll']({'raw':_0x152aac[_0x9b3f('0x1e')]?_0x152aac[_0x9b3f('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x152aac['options']?_0x152aac['options'][_0x9b3f('0x1f')]||null:null,'attributes':_0x152aac['options']?_0x152aac['options'][_0x9b3f('0x20')]||null:null,'limit':_0x152aac[_0x9b3f('0x1e')]?_0x152aac[_0x9b3f('0x1e')][_0x9b3f('0x21')]||null:null,'include':_0x152aac[_0x9b3f('0x1e')]?_0x152aac[_0x9b3f('0x1e')][_0x9b3f('0x22')]?_[_0x9b3f('0x23')](_0x152aac[_0x9b3f('0x1e')][_0x9b3f('0x22')],function(_0xbb8809){return{'model':db[_0xbb8809[_0x9b3f('0x24')]],'as':_0xbb8809['as'],'attributes':_0xbb8809['attributes'],'include':_0xbb8809[_0x9b3f('0x22')]?_[_0x9b3f('0x23')](_0xbb8809['include'],function(_0x5e7348){return{'model':db[_0x5e7348[_0x9b3f('0x24')]],'as':_0x5e7348['as'],'attributes':_0x5e7348[_0x9b3f('0x20')],'include':_0x5e7348[_0x9b3f('0x22')]?_[_0x9b3f('0x23')](_0x5e7348['include'],function(_0x45780e){return{'model':db[_0x45780e[_0x9b3f('0x24')]],'as':_0x45780e['as'],'attributes':_0x45780e['attributes']};}):[]};}):[]};}):[]:[]})[_0x9b3f('0x10')](function(_0x50ba06){logger['info'](_0x9b3f('0x1c'),_0x152aac);logger[_0x9b3f('0x14')](_0x9b3f('0x1c'),_0x152aac,JSON['stringify'](_0x50ba06));_0x5272c2(_0x50ba06);})[_0x9b3f('0x1b')](function(_0x3e63f5){logger[_0x9b3f('0x18')](_0x9b3f('0x1c'),_0x3e63f5[_0x9b3f('0x19')],_0x152aac);_0xe380b7(_0x3ed50e['error'](0x1f4,_0x3e63f5[_0x9b3f('0x19')]));});});};exports[_0x9b3f('0x25')]=function(_0x115aec){var _0x192c2d=this;return new Promise(function(_0x41731b,_0x5ace2b){return db[_0x9b3f('0x1d')][_0x9b3f('0x26')]({'raw':_0x115aec[_0x9b3f('0x1e')]?_0x115aec[_0x9b3f('0x1e')][_0x9b3f('0x27')]===undefined?!![]:![]:!![],'where':_0x115aec['options']?_0x115aec[_0x9b3f('0x1e')]['where']||null:null,'attributes':_0x115aec[_0x9b3f('0x1e')]?_0x115aec[_0x9b3f('0x1e')][_0x9b3f('0x20')]||null:null,'include':_0x115aec['options']?_0x115aec[_0x9b3f('0x1e')]['include']?_[_0x9b3f('0x23')](_0x115aec['options'][_0x9b3f('0x22')],function(_0xda7cf3){return{'model':db[_0xda7cf3['model']],'as':_0xda7cf3['as'],'attributes':_0xda7cf3[_0x9b3f('0x20')],'include':_0xda7cf3[_0x9b3f('0x22')]?_[_0x9b3f('0x23')](_0xda7cf3[_0x9b3f('0x22')],function(_0x3e00ca){return{'model':db[_0x3e00ca[_0x9b3f('0x24')]],'as':_0x3e00ca['as'],'attributes':_0x3e00ca[_0x9b3f('0x20')],'include':_0x3e00ca[_0x9b3f('0x22')]?_[_0x9b3f('0x23')](_0x3e00ca[_0x9b3f('0x22')],function(_0x4733a7){return{'model':db[_0x4733a7['model']],'as':_0x4733a7['as'],'attributes':_0x4733a7[_0x9b3f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9b3f('0x10')](function(_0x285728){logger[_0x9b3f('0x11')](_0x9b3f('0x25'),_0x115aec);logger[_0x9b3f('0x14')](_0x9b3f('0x25'),_0x115aec,JSON['stringify'](_0x285728));_0x41731b(_0x285728);})[_0x9b3f('0x1b')](function(_0x3a87a9){logger[_0x9b3f('0x18')](_0x9b3f('0x25'),_0x3a87a9['message'],_0x115aec);_0x5ace2b(_0x192c2d[_0x9b3f('0x18')](0x1f4,_0x3a87a9[_0x9b3f('0x19')]));});});}; \ No newline at end of file +var _0x36b5=['ShowSmsQueue','find','debug','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','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','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x11c00c,_0x60a3f7){var _0x2ec559=function(_0x272b16){while(--_0x272b16){_0x11c00c['push'](_0x11c00c['shift']());}};_0x2ec559(++_0x60a3f7);}(_0x36b5,0x1ef));var _0x536b=function(_0x1263cc,_0x34b0a6){_0x1263cc=_0x1263cc-0x0;var _0x4132a0=_0x36b5[_0x1263cc];return _0x4132a0;};'use strict';var _=require(_0x536b('0x0'));var util=require('util');var moment=require(_0x536b('0x1'));var BPromise=require(_0x536b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x536b('0x3'))['db'];var utils=require(_0x536b('0x4'));var logger=require(_0x536b('0x5'))(_0x536b('0x6'));var config=require(_0x536b('0x7'));var jayson=require(_0x536b('0x8'));var client=jayson[_0x536b('0x9')][_0x536b('0xa')]({'port':0x232a});config[_0x536b('0xb')]=_['defaults'](config[_0x536b('0xb')],{'host':_0x536b('0xc'),'port':0x18eb});var socket=require(_0x536b('0xd'))(new Redis(config[_0x536b('0xb')]));require(_0x536b('0xe'))[_0x536b('0xf')](socket);function respondWithRpcPromise(_0x442057,_0x4ef01d,_0x2b5055){return new BPromise(function(_0x2931ac,_0x2083f6){return client[_0x536b('0x10')](_0x442057,_0x2b5055)[_0x536b('0x11')](function(_0x4f3fe6){logger[_0x536b('0x12')](_0x536b('0x13'),_0x4ef01d,_0x536b('0x14'));logger['debug'](_0x536b('0x15'),_0x4ef01d,'request\x20sent',JSON[_0x536b('0x16')](_0x4f3fe6));if(_0x4f3fe6[_0x536b('0x17')]){if(_0x4f3fe6[_0x536b('0x17')][_0x536b('0x18')]===0x1f4){logger[_0x536b('0x17')](_0x536b('0x13'),_0x4ef01d,_0x4f3fe6['error']['message']);return _0x2083f6(_0x4f3fe6['error']['message']);}logger[_0x536b('0x17')](_0x536b('0x13'),_0x4ef01d,_0x4f3fe6[_0x536b('0x17')][_0x536b('0x19')]);return _0x2931ac(_0x4f3fe6['error'][_0x536b('0x19')]);}else{logger[_0x536b('0x12')](_0x536b('0x13'),_0x4ef01d,_0x536b('0x14'));_0x2931ac(_0x4f3fe6['result']['message']);}})[_0x536b('0x1a')](function(_0x44e954){logger['error'](_0x536b('0x13'),_0x4ef01d,_0x44e954);_0x2083f6(_0x44e954);});});}exports[_0x536b('0x1b')]=function(_0x406989){var _0x2c2879=this;return new Promise(function(_0x3178a1,_0x367c62){return db[_0x536b('0x1c')][_0x536b('0x1d')]({'raw':_0x406989['options']?_0x406989[_0x536b('0x1e')][_0x536b('0x1f')]===undefined?!![]:![]:!![],'where':_0x406989[_0x536b('0x1e')]?_0x406989[_0x536b('0x1e')][_0x536b('0x20')]||null:null,'attributes':_0x406989[_0x536b('0x1e')]?_0x406989[_0x536b('0x1e')][_0x536b('0x21')]||null:null,'limit':_0x406989[_0x536b('0x1e')]?_0x406989[_0x536b('0x1e')][_0x536b('0x22')]||null:null,'include':_0x406989[_0x536b('0x1e')]?_0x406989[_0x536b('0x1e')][_0x536b('0x23')]?_[_0x536b('0x24')](_0x406989[_0x536b('0x1e')]['include'],function(_0x1a4d76){return{'model':db[_0x1a4d76[_0x536b('0x25')]],'as':_0x1a4d76['as'],'attributes':_0x1a4d76[_0x536b('0x21')],'include':_0x1a4d76[_0x536b('0x23')]?_[_0x536b('0x24')](_0x1a4d76['include'],function(_0x71e149){return{'model':db[_0x71e149['model']],'as':_0x71e149['as'],'attributes':_0x71e149[_0x536b('0x21')],'include':_0x71e149[_0x536b('0x23')]?_['map'](_0x71e149['include'],function(_0x39663a){return{'model':db[_0x39663a[_0x536b('0x25')]],'as':_0x39663a['as'],'attributes':_0x39663a[_0x536b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x536b('0x11')](function(_0x5a3d14){logger[_0x536b('0x12')](_0x536b('0x1b'),_0x406989);logger['debug'](_0x536b('0x1b'),_0x406989,JSON['stringify'](_0x5a3d14));_0x3178a1(_0x5a3d14);})[_0x536b('0x1a')](function(_0x20d2d7){logger[_0x536b('0x17')]('GetSmsQueue',_0x20d2d7[_0x536b('0x19')],_0x406989);_0x367c62(_0x2c2879[_0x536b('0x17')](0x1f4,_0x20d2d7[_0x536b('0x19')]));});});};exports[_0x536b('0x26')]=function(_0x2520b3){var _0x3de2f8=this;return new Promise(function(_0xd7a307,_0x10cddd){return db[_0x536b('0x1c')][_0x536b('0x27')]({'raw':_0x2520b3[_0x536b('0x1e')]?_0x2520b3[_0x536b('0x1e')][_0x536b('0x1f')]===undefined?!![]:![]:!![],'where':_0x2520b3[_0x536b('0x1e')]?_0x2520b3[_0x536b('0x1e')][_0x536b('0x20')]||null:null,'attributes':_0x2520b3['options']?_0x2520b3[_0x536b('0x1e')]['attributes']||null:null,'include':_0x2520b3[_0x536b('0x1e')]?_0x2520b3[_0x536b('0x1e')][_0x536b('0x23')]?_[_0x536b('0x24')](_0x2520b3[_0x536b('0x1e')]['include'],function(_0x432d6c){return{'model':db[_0x432d6c[_0x536b('0x25')]],'as':_0x432d6c['as'],'attributes':_0x432d6c[_0x536b('0x21')],'include':_0x432d6c['include']?_['map'](_0x432d6c[_0x536b('0x23')],function(_0xef22c2){return{'model':db[_0xef22c2['model']],'as':_0xef22c2['as'],'attributes':_0xef22c2[_0x536b('0x21')],'include':_0xef22c2[_0x536b('0x23')]?_[_0x536b('0x24')](_0xef22c2[_0x536b('0x23')],function(_0xcf65ff){return{'model':db[_0xcf65ff[_0x536b('0x25')]],'as':_0xcf65ff['as'],'attributes':_0xcf65ff[_0x536b('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4070f2){logger[_0x536b('0x12')](_0x536b('0x26'),_0x2520b3);logger[_0x536b('0x28')]('ShowSmsQueue',_0x2520b3,JSON[_0x536b('0x16')](_0x4070f2));_0xd7a307(_0x4070f2);})[_0x536b('0x1a')](function(_0x25cd17){logger[_0x536b('0x17')](_0x536b('0x26'),_0x25cd17[_0x536b('0x19')],_0x2520b3);_0x10cddd(_0x3de2f8[_0x536b('0x17')](0x1f4,_0x25cd17[_0x536b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index e7fa630..0cc8b53 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 _0x4f95=['removeListener','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x4f95,0x19a));var _0x54f9=function(_0x56392c,_0x29ce7c){_0x56392c=_0x56392c-0x0;var _0x232573=_0x4f95[_0x56392c];return _0x232573;};'use strict';var SmsQueueEvents=require(_0x54f9('0x0'));var events=[_0x54f9('0x1'),_0x54f9('0x2'),_0x54f9('0x3')];function createListener(_0x257560,_0x2b04ff){return function(_0x222436){_0x2b04ff['emit'](_0x257560,_0x222436);};}function removeListener(_0x243332,_0x3f7496){return function(){SmsQueueEvents[_0x54f9('0x4')](_0x243332,_0x3f7496);};}exports['register']=function(_0x401ad4){for(var _0xf99c54=0x0,_0x2ae699=events['length'];_0xf99c54<_0x2ae699;_0xf99c54++){var _0x596049=events[_0xf99c54];var _0xc8428a=createListener(_0x54f9('0x5')+_0x596049,_0x401ad4);SmsQueueEvents['on'](_0x596049,_0xc8428a);}}; \ No newline at end of file +var _0xd313=['./smsQueue.events','save','update','emit','register','length','smsQueue:'];(function(_0x2a988b,_0x10f43c){var _0x161e23=function(_0x4c5765){while(--_0x4c5765){_0x2a988b['push'](_0x2a988b['shift']());}};_0x161e23(++_0x10f43c);}(_0xd313,0xa8));var _0x3d31=function(_0x289541,_0x507837){_0x289541=_0x289541-0x0;var _0x28de6e=_0xd313[_0x289541];return _0x28de6e;};'use strict';var SmsQueueEvents=require(_0x3d31('0x0'));var events=[_0x3d31('0x1'),'remove',_0x3d31('0x2')];function createListener(_0x420a46,_0x135012){return function(_0x241971){_0x135012[_0x3d31('0x3')](_0x420a46,_0x241971);};}function removeListener(_0x3a658a,_0x43e496){return function(){SmsQueueEvents['removeListener'](_0x3a658a,_0x43e496);};}exports[_0x3d31('0x4')]=function(_0x29e0fb){for(var _0x5b1a7b=0x0,_0x2d5e67=events[_0x3d31('0x5')];_0x5b1a7b<_0x2d5e67;_0x5b1a7b++){var _0x460678=events[_0x5b1a7b];var _0x19d440=createListener(_0x3d31('0x6')+_0x460678,_0x29e0fb);SmsQueueEvents['on'](_0x460678,_0x19d440);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 6ab81a6..93f12db 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 _0xc838=['../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x10c354,_0x2459f2){var _0x571712=function(_0x26d3a3){while(--_0x26d3a3){_0x10c354['push'](_0x10c354['shift']());}};_0x571712(++_0x2459f2);}(_0xc838,0xbd));var _0x8c83=function(_0xb8897c,_0x335770){_0xb8897c=_0xb8897c-0x0;var _0x151340=_0xc838[_0xb8897c];return _0x151340;};'use strict';var multer=require(_0x8c83('0x0'));var util=require(_0x8c83('0x1'));var path=require(_0x8c83('0x2'));var timeout=require(_0x8c83('0x3'));var express=require(_0x8c83('0x4'));var router=express[_0x8c83('0x5')]();var fs_extra=require(_0x8c83('0x6'));var auth=require(_0x8c83('0x7'));var interaction=require(_0x8c83('0x8'));var config=require(_0x8c83('0x9'));var controller=require(_0x8c83('0xa'));router[_0x8c83('0xb')]('/',auth[_0x8c83('0xc')](),controller[_0x8c83('0xd')]);router[_0x8c83('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x8c83('0xe')]);router['get'](_0x8c83('0xf'),auth[_0x8c83('0xc')](),controller[_0x8c83('0x10')]);router[_0x8c83('0x11')]('/',auth[_0x8c83('0xc')](),controller[_0x8c83('0x12')]);router[_0x8c83('0x13')](_0x8c83('0xf'),auth[_0x8c83('0xc')](),controller[_0x8c83('0x14')]);router[_0x8c83('0x15')]('/:id',auth[_0x8c83('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x805b=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4c566a,_0x317001){var _0x33a0b5=function(_0x24178a){while(--_0x24178a){_0x4c566a['push'](_0x4c566a['shift']());}};_0x33a0b5(++_0x317001);}(_0x805b,0xad));var _0xb805=function(_0x5b9256,_0x1eed86){_0x5b9256=_0x5b9256-0x0;var _0x1da886=_0x805b[_0x5b9256];return _0x1da886;};'use strict';var multer=require(_0xb805('0x0'));var util=require(_0xb805('0x1'));var path=require(_0xb805('0x2'));var timeout=require(_0xb805('0x3'));var express=require(_0xb805('0x4'));var router=express[_0xb805('0x5')]();var fs_extra=require(_0xb805('0x6'));var auth=require(_0xb805('0x7'));var interaction=require(_0xb805('0x8'));var config=require(_0xb805('0x9'));var controller=require('./smsQueueReport.controller');router[_0xb805('0xa')]('/',auth[_0xb805('0xb')](),controller['index']);router[_0xb805('0xa')](_0xb805('0xc'),auth['isAuthenticated'](),controller[_0xb805('0xd')]);router[_0xb805('0xa')](_0xb805('0xe'),auth[_0xb805('0xb')](),controller[_0xb805('0xf')]);router[_0xb805('0x10')]('/',auth[_0xb805('0xb')](),controller['create']);router['put']('/:id',auth[_0xb805('0xb')](),controller['update']);router[_0xb805('0x11')](_0xb805('0xe'),auth[_0xb805('0xb')](),controller[_0xb805('0x12')]);module[_0xb805('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index fe33753..b0ace7f 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 _0x99b8=['DATE','moment','sequelize','exports','STRING'];(function(_0x4854d6,_0x2f1264){var _0x3885c0=function(_0x4d564d){while(--_0x4d564d){_0x4854d6['push'](_0x4854d6['shift']());}};_0x3885c0(++_0x2f1264);}(_0x99b8,0xb5));var _0x899b=function(_0x524d94,_0x3f745f){_0x524d94=_0x524d94-0x0;var _0x447825=_0x99b8[_0x524d94];return _0x447825;};'use strict';var moment=require(_0x899b('0x0'));var Sequelize=require(_0x899b('0x1'));module[_0x899b('0x2')]={'uniqueid':{'type':Sequelize[_0x899b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x899b('0x3')]},'joinAt':{'type':Sequelize[_0x899b('0x4')]},'leaveAt':{'type':Sequelize[_0x899b('0x4')]},'acceptAt':{'type':Sequelize[_0x899b('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x899b('0x3')]}}; \ No newline at end of file +var _0xa009=['sequelize','exports','STRING','DATE','moment'];(function(_0x5eadc9,_0x579811){var _0x1895f1=function(_0x447ae0){while(--_0x447ae0){_0x5eadc9['push'](_0x5eadc9['shift']());}};_0x1895f1(++_0x579811);}(_0xa009,0x13a));var _0x9a00=function(_0x4238f1,_0x40e962){_0x4238f1=_0x4238f1-0x0;var _0x5924ac=_0xa009[_0x4238f1];return _0x5924ac;};'use strict';var moment=require(_0x9a00('0x0'));var Sequelize=require(_0x9a00('0x1'));module[_0x9a00('0x2')]={'uniqueid':{'type':Sequelize[_0x9a00('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9a00('0x3')]},'joinAt':{'type':Sequelize[_0x9a00('0x4')]},'leaveAt':{'type':Sequelize[_0x9a00('0x4')]},'acceptAt':{'type':Sequelize[_0x9a00('0x4')]},'exitAt':{'type':Sequelize[_0x9a00('0x4')]},'reason':{'type':Sequelize[_0x9a00('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 3045255..936611e 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 _0xda03=['status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','name','index','map','SmsQueueReport','fieldName','key','model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','fields','length','find','create','body','params','describe','rimraf','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus'];(function(_0x182c6c,_0x48d0ec){var _0x35d0da=function(_0x3ca0d8){while(--_0x3ca0d8){_0x182c6c['push'](_0x182c6c['shift']());}};_0x35d0da(++_0x48d0ec);}(_0xda03,0x102));var _0x3da0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda03[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3da0('0x0'));var zipdir=require(_0x3da0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3da0('0x2'));var moment=require(_0x3da0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3da0('0x4'));var util=require('util');var path=require('path');var sox=require(_0x3da0('0x5'));var csv=require(_0x3da0('0x6'));var ejs=require(_0x3da0('0x7'));var fs=require('fs');var fs_extra=require(_0x3da0('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3da0('0x9'));var jsforce=require(_0x3da0('0xa'));var deskjs=require(_0x3da0('0xb'));var toCsv=require(_0x3da0('0x6'));var querystring=require(_0x3da0('0xc'));var Papa=require(_0x3da0('0xd'));var Redis=require(_0x3da0('0xe'));var authService=require(_0x3da0('0xf'));var qs=require(_0x3da0('0x10'));var as=require(_0x3da0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3da0('0x12'))('api');var utils=require(_0x3da0('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3da0('0x14'))['db'];function respondWithStatusCode(_0x3dcf95,_0x29558d){_0x29558d=_0x29558d||0xcc;return function(_0xedf618){if(_0xedf618){return _0x3dcf95[_0x3da0('0x15')](_0x29558d);}return _0x3dcf95[_0x3da0('0x16')](_0x29558d)[_0x3da0('0x17')]();};}function respondWithResult(_0x4b948f,_0x5bb3f7){_0x5bb3f7=_0x5bb3f7||0xc8;return function(_0x116197){if(_0x116197){return _0x4b948f[_0x3da0('0x16')](_0x5bb3f7)[_0x3da0('0x18')](_0x116197);}};}function respondWithFilteredResult(_0x22300d,_0x2c3131){return function(_0x53938e){if(_0x53938e){var _0x56644e=typeof _0x2c3131['offset']==='undefined'&&typeof _0x2c3131['limit']===_0x3da0('0x19');var _0x3e0208=_0x53938e[_0x3da0('0x1a')];var _0x11cc52=_0x56644e?0x0:_0x2c3131[_0x3da0('0x1b')];var _0x3ab7c=_0x56644e?_0x53938e[_0x3da0('0x1a')]:_0x2c3131[_0x3da0('0x1b')]+_0x2c3131[_0x3da0('0x1c')];var _0x2a44ab;if(_0x3ab7c>=_0x3e0208){_0x3ab7c=_0x3e0208;_0x2a44ab=0xc8;}else{_0x2a44ab=0xce;}_0x22300d[_0x3da0('0x16')](_0x2a44ab);return _0x22300d[_0x3da0('0x1d')](_0x3da0('0x1e'),_0x11cc52+'-'+_0x3ab7c+'/'+_0x3e0208)['json'](_0x53938e);}return null;};}function patchUpdates(_0x1361cb){return function(_0x5069eb){try{jsonpatch[_0x3da0('0x1f')](_0x5069eb,_0x1361cb,!![]);}catch(_0x4ef418){return BPromise['reject'](_0x4ef418);}return _0x5069eb[_0x3da0('0x20')]();};}function saveUpdates(_0x384deb,_0x148898){return function(_0x1ef5cc){if(_0x1ef5cc){return _0x1ef5cc[_0x3da0('0x21')](_0x384deb)[_0x3da0('0x22')](function(_0xd5064d){return _0xd5064d;});}return null;};}function removeEntity(_0x33dd9d,_0x321fab){return function(_0x7646d1){if(_0x7646d1){return _0x7646d1[_0x3da0('0x23')]()[_0x3da0('0x22')](function(){_0x33dd9d[_0x3da0('0x16')](0xcc)[_0x3da0('0x17')]();});}};}function handleEntityNotFound(_0x3b55ca,_0x58d277){return function(_0x1caf9c){if(!_0x1caf9c){_0x3b55ca['sendStatus'](0x194);}return _0x1caf9c;};}function handleError(_0x2abbfb,_0x9630d3){_0x9630d3=_0x9630d3||0x1f4;return function(_0x5a0ed5){logger[_0x3da0('0x24')](_0x5a0ed5['stack']);if(_0x5a0ed5[_0x3da0('0x25')]){delete _0x5a0ed5[_0x3da0('0x25')];}_0x2abbfb[_0x3da0('0x16')](_0x9630d3)['send'](_0x5a0ed5);};}exports[_0x3da0('0x26')]=function(_0x29bd51,_0x213336){var _0x3632dc={},_0x578cb8={},_0x5edca5={'count':0x0,'rows':[]};var _0x3cc474=_[_0x3da0('0x27')](db[_0x3da0('0x28')]['rawAttributes'],function(_0x1eeec7){return{'name':_0x1eeec7[_0x3da0('0x29')],'type':_0x1eeec7['type'][_0x3da0('0x2a')]};});_0x578cb8[_0x3da0('0x2b')]=_[_0x3da0('0x27')](_0x3cc474,_0x3da0('0x25'));_0x578cb8[_0x3da0('0x2c')]=_[_0x3da0('0x2d')](_0x29bd51[_0x3da0('0x2c')]);_0x578cb8[_0x3da0('0x2e')]=_[_0x3da0('0x2f')](_0x578cb8[_0x3da0('0x2b')],_0x578cb8['query']);_0x3632dc[_0x3da0('0x30')]=_[_0x3da0('0x2f')](_0x578cb8[_0x3da0('0x2b')],qs['fields'](_0x29bd51[_0x3da0('0x2c')]['fields']));_0x3632dc[_0x3da0('0x30')]=_0x3632dc['attributes']['length']?_0x3632dc[_0x3da0('0x30')]:_0x578cb8[_0x3da0('0x2b')];if(!_0x29bd51[_0x3da0('0x2c')]['hasOwnProperty'](_0x3da0('0x31'))){_0x3632dc['limit']=qs[_0x3da0('0x1c')](_0x29bd51[_0x3da0('0x2c')][_0x3da0('0x1c')]);_0x3632dc[_0x3da0('0x1b')]=qs['offset'](_0x29bd51[_0x3da0('0x2c')][_0x3da0('0x1b')]);}_0x3632dc[_0x3da0('0x32')]=qs[_0x3da0('0x33')](_0x29bd51[_0x3da0('0x2c')][_0x3da0('0x33')]);_0x3632dc[_0x3da0('0x34')]=qs[_0x3da0('0x2e')](_['pick'](_0x29bd51[_0x3da0('0x2c')],_0x578cb8['filters']),_0x3cc474);if(_0x29bd51[_0x3da0('0x2c')]['filter']){_0x3632dc[_0x3da0('0x34')]=_[_0x3da0('0x35')](_0x3632dc[_0x3da0('0x34')],{'$or':_[_0x3da0('0x27')](_0x3cc474,function(_0x184f55){if(_0x184f55['type']!==_0x3da0('0x36')){var _0x5573de={};_0x5573de[_0x184f55[_0x3da0('0x25')]]={'$like':'%'+_0x29bd51[_0x3da0('0x2c')][_0x3da0('0x37')]+'%'};return _0x5573de;}})});}_0x3632dc=_['merge']({},_0x3632dc,_0x29bd51[_0x3da0('0x38')]);var _0x314279={'where':_0x3632dc[_0x3da0('0x34')]};return db[_0x3da0('0x28')][_0x3da0('0x1a')](_0x314279)['then'](function(_0x58610d){_0x5edca5['count']=_0x58610d;if(_0x29bd51[_0x3da0('0x2c')][_0x3da0('0x39')]){_0x3632dc[_0x3da0('0x3a')]=[{'all':!![]}];}return db[_0x3da0('0x28')][_0x3da0('0x3b')](_0x3632dc);})[_0x3da0('0x22')](function(_0x40fd89){_0x5edca5[_0x3da0('0x3c')]=_0x40fd89;return _0x5edca5;})[_0x3da0('0x22')](respondWithFilteredResult(_0x213336,_0x3632dc))[_0x3da0('0x3d')](handleError(_0x213336,null));};exports[_0x3da0('0x3e')]=function(_0x4ba621,_0x365510){var _0x8ab21e={'raw':!![],'where':{'id':_0x4ba621['params']['id']}},_0x406df0={};_0x406df0[_0x3da0('0x2b')]=_[_0x3da0('0x2d')](db[_0x3da0('0x28')]['rawAttributes']);_0x406df0[_0x3da0('0x2c')]=_[_0x3da0('0x2d')](_0x4ba621[_0x3da0('0x2c')]);_0x406df0['filters']=_[_0x3da0('0x2f')](_0x406df0[_0x3da0('0x2b')],_0x406df0[_0x3da0('0x2c')]);_0x8ab21e[_0x3da0('0x30')]=_['intersection'](_0x406df0[_0x3da0('0x2b')],qs[_0x3da0('0x3f')](_0x4ba621[_0x3da0('0x2c')][_0x3da0('0x3f')]));_0x8ab21e['attributes']=_0x8ab21e['attributes'][_0x3da0('0x40')]?_0x8ab21e[_0x3da0('0x30')]:_0x406df0[_0x3da0('0x2b')];if(_0x4ba621[_0x3da0('0x2c')][_0x3da0('0x39')]){_0x8ab21e['include']=[{'all':!![]}];}_0x8ab21e=_['merge']({},_0x8ab21e,_0x4ba621[_0x3da0('0x38')]);return db[_0x3da0('0x28')][_0x3da0('0x41')](_0x8ab21e)[_0x3da0('0x22')](handleEntityNotFound(_0x365510,null))[_0x3da0('0x22')](respondWithResult(_0x365510,null))[_0x3da0('0x3d')](handleError(_0x365510,null));};exports['create']=function(_0x21dd47,_0x8e59c1){return db[_0x3da0('0x28')][_0x3da0('0x42')](_0x21dd47['body'],{})[_0x3da0('0x22')](respondWithResult(_0x8e59c1,0xc9))['catch'](handleError(_0x8e59c1,null));};exports[_0x3da0('0x21')]=function(_0xa0cc95,_0xc97e59){if(_0xa0cc95[_0x3da0('0x43')]['id']){delete _0xa0cc95[_0x3da0('0x43')]['id'];}return db[_0x3da0('0x28')]['find']({'where':{'id':_0xa0cc95[_0x3da0('0x44')]['id']}})[_0x3da0('0x22')](handleEntityNotFound(_0xc97e59,null))[_0x3da0('0x22')](saveUpdates(_0xa0cc95[_0x3da0('0x43')],null))['then'](respondWithResult(_0xc97e59,null))['catch'](handleError(_0xc97e59,null));};exports['destroy']=function(_0x2aa90c,_0x2848c9){return db[_0x3da0('0x28')][_0x3da0('0x41')]({'where':{'id':_0x2aa90c[_0x3da0('0x44')]['id']}})[_0x3da0('0x22')](handleEntityNotFound(_0x2848c9,null))[_0x3da0('0x22')](removeEntity(_0x2848c9,null))[_0x3da0('0x3d')](handleError(_0x2848c9,null));};exports[_0x3da0('0x45')]=function(_0x59cef6,_0x380295){return db[_0x3da0('0x28')]['describe']()[_0x3da0('0x22')](respondWithResult(_0x380295,null))[_0x3da0('0x3d')](handleError(_0x380295,null));}; \ No newline at end of file +var _0x3642=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','SmsQueueReport','rawAttributes','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto'];(function(_0x4e12ef,_0x5916c8){var _0x486512=function(_0xc43f91){while(--_0xc43f91){_0x4e12ef['push'](_0x4e12ef['shift']());}};_0x486512(++_0x5916c8);}(_0x3642,0x166));var _0x2364=function(_0x3f9584,_0x5ab12c){_0x3f9584=_0x3f9584-0x0;var _0x9d54c=_0x3642[_0x3f9584];return _0x9d54c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2364('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2364('0x1'));var rp=require(_0x2364('0x2'));var moment=require('moment');var BPromise=require(_0x2364('0x3'));var Mustache=require(_0x2364('0x4'));var util=require(_0x2364('0x5'));var path=require(_0x2364('0x6'));var sox=require(_0x2364('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2364('0x8'));var _=require(_0x2364('0x9'));var squel=require(_0x2364('0xa'));var crypto=require(_0x2364('0xb'));var jsforce=require(_0x2364('0xc'));var deskjs=require(_0x2364('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2364('0xe'));var Redis=require(_0x2364('0xf'));var authService=require(_0x2364('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2364('0x11'));var hardwareService=require(_0x2364('0x12'));var logger=require(_0x2364('0x13'))(_0x2364('0x14'));var utils=require('../../config/utils');var config=require(_0x2364('0x15'));var licenseUtil=require(_0x2364('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x157eb7,_0x6623b){_0x6623b=_0x6623b||0xcc;return function(_0x5b97b9){if(_0x5b97b9){return _0x157eb7[_0x2364('0x17')](_0x6623b);}return _0x157eb7[_0x2364('0x18')](_0x6623b)[_0x2364('0x19')]();};}function respondWithResult(_0x4dab7a,_0x5b884c){_0x5b884c=_0x5b884c||0xc8;return function(_0x3bd932){if(_0x3bd932){return _0x4dab7a[_0x2364('0x18')](_0x5b884c)[_0x2364('0x1a')](_0x3bd932);}};}function respondWithFilteredResult(_0x4c7c9d,_0x149630){return function(_0x360cc3){if(_0x360cc3){var _0x19598b=typeof _0x149630['offset']===_0x2364('0x1b')&&typeof _0x149630['limit']===_0x2364('0x1b');var _0x3a3afe=_0x360cc3[_0x2364('0x1c')];var _0x16bb40=_0x19598b?0x0:_0x149630['offset'];var _0x1345cc=_0x19598b?_0x360cc3[_0x2364('0x1c')]:_0x149630[_0x2364('0x1d')]+_0x149630[_0x2364('0x1e')];var _0x2a0813;if(_0x1345cc>=_0x3a3afe){_0x1345cc=_0x3a3afe;_0x2a0813=0xc8;}else{_0x2a0813=0xce;}_0x4c7c9d[_0x2364('0x18')](_0x2a0813);return _0x4c7c9d[_0x2364('0x1f')](_0x2364('0x20'),_0x16bb40+'-'+_0x1345cc+'/'+_0x3a3afe)[_0x2364('0x1a')](_0x360cc3);}return null;};}function patchUpdates(_0x4faea2){return function(_0x163cc4){try{jsonpatch['apply'](_0x163cc4,_0x4faea2,!![]);}catch(_0x3b12bf){return BPromise[_0x2364('0x21')](_0x3b12bf);}return _0x163cc4['save']();};}function saveUpdates(_0x4768f5,_0x43cb6f){return function(_0x3238de){if(_0x3238de){return _0x3238de[_0x2364('0x22')](_0x4768f5)[_0x2364('0x23')](function(_0x3895e3){return _0x3895e3;});}return null;};}function removeEntity(_0x4969c7,_0x59f2d3){return function(_0x4dfa9b){if(_0x4dfa9b){return _0x4dfa9b[_0x2364('0x24')]()['then'](function(){_0x4969c7[_0x2364('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x422460,_0x481ac4){return function(_0x149b38){if(!_0x149b38){_0x422460[_0x2364('0x17')](0x194);}return _0x149b38;};}function handleError(_0x100989,_0x309ae2){_0x309ae2=_0x309ae2||0x1f4;return function(_0x46131c){logger[_0x2364('0x25')](_0x46131c[_0x2364('0x26')]);if(_0x46131c['name']){delete _0x46131c[_0x2364('0x27')];}_0x100989[_0x2364('0x18')](_0x309ae2)[_0x2364('0x28')](_0x46131c);};}exports[_0x2364('0x29')]=function(_0xa0fe4d,_0x56c33e){var _0xf3c425={},_0x51f4bb={},_0x7e0538={'count':0x0,'rows':[]};var _0x3dffae=_['map'](db[_0x2364('0x2a')][_0x2364('0x2b')],function(_0xd2f961){return{'name':_0xd2f961['fieldName'],'type':_0xd2f961['type']['key']};});_0x51f4bb[_0x2364('0x2c')]=_[_0x2364('0x2d')](_0x3dffae,'name');_0x51f4bb[_0x2364('0x2e')]=_[_0x2364('0x2f')](_0xa0fe4d[_0x2364('0x2e')]);_0x51f4bb[_0x2364('0x30')]=_[_0x2364('0x31')](_0x51f4bb[_0x2364('0x2c')],_0x51f4bb[_0x2364('0x2e')]);_0xf3c425[_0x2364('0x32')]=_[_0x2364('0x31')](_0x51f4bb[_0x2364('0x2c')],qs[_0x2364('0x33')](_0xa0fe4d[_0x2364('0x2e')]['fields']));_0xf3c425[_0x2364('0x32')]=_0xf3c425['attributes'][_0x2364('0x34')]?_0xf3c425[_0x2364('0x32')]:_0x51f4bb[_0x2364('0x2c')];if(!_0xa0fe4d['query'][_0x2364('0x35')](_0x2364('0x36'))){_0xf3c425[_0x2364('0x1e')]=qs[_0x2364('0x1e')](_0xa0fe4d['query'][_0x2364('0x1e')]);_0xf3c425[_0x2364('0x1d')]=qs[_0x2364('0x1d')](_0xa0fe4d[_0x2364('0x2e')]['offset']);}_0xf3c425[_0x2364('0x37')]=qs[_0x2364('0x38')](_0xa0fe4d[_0x2364('0x2e')][_0x2364('0x38')]);_0xf3c425[_0x2364('0x39')]=qs[_0x2364('0x30')](_[_0x2364('0x3a')](_0xa0fe4d[_0x2364('0x2e')],_0x51f4bb['filters']),_0x3dffae);if(_0xa0fe4d[_0x2364('0x2e')][_0x2364('0x3b')]){_0xf3c425['where']=_[_0x2364('0x3c')](_0xf3c425['where'],{'$or':_[_0x2364('0x2d')](_0x3dffae,function(_0x5468d6){if(_0x5468d6[_0x2364('0x3d')]!==_0x2364('0x3e')){var _0x22b9ed={};_0x22b9ed[_0x5468d6['name']]={'$like':'%'+_0xa0fe4d[_0x2364('0x2e')][_0x2364('0x3b')]+'%'};return _0x22b9ed;}})});}_0xf3c425=_[_0x2364('0x3c')]({},_0xf3c425,_0xa0fe4d[_0x2364('0x3f')]);var _0x4917e8={'where':_0xf3c425['where']};return db[_0x2364('0x2a')][_0x2364('0x1c')](_0x4917e8)[_0x2364('0x23')](function(_0x5b182a){_0x7e0538[_0x2364('0x1c')]=_0x5b182a;if(_0xa0fe4d[_0x2364('0x2e')][_0x2364('0x40')]){_0xf3c425[_0x2364('0x41')]=[{'all':!![]}];}return db[_0x2364('0x2a')][_0x2364('0x42')](_0xf3c425);})[_0x2364('0x23')](function(_0x1c50d7){_0x7e0538[_0x2364('0x43')]=_0x1c50d7;return _0x7e0538;})[_0x2364('0x23')](respondWithFilteredResult(_0x56c33e,_0xf3c425))[_0x2364('0x44')](handleError(_0x56c33e,null));};exports['show']=function(_0x2401cf,_0x35dfeb){var _0x5d7833={'raw':!![],'where':{'id':_0x2401cf['params']['id']}},_0x2462c1={};_0x2462c1['model']=_['keys'](db[_0x2364('0x2a')][_0x2364('0x2b')]);_0x2462c1[_0x2364('0x2e')]=_[_0x2364('0x2f')](_0x2401cf[_0x2364('0x2e')]);_0x2462c1[_0x2364('0x30')]=_[_0x2364('0x31')](_0x2462c1['model'],_0x2462c1[_0x2364('0x2e')]);_0x5d7833[_0x2364('0x32')]=_[_0x2364('0x31')](_0x2462c1[_0x2364('0x2c')],qs[_0x2364('0x33')](_0x2401cf[_0x2364('0x2e')]['fields']));_0x5d7833['attributes']=_0x5d7833[_0x2364('0x32')][_0x2364('0x34')]?_0x5d7833[_0x2364('0x32')]:_0x2462c1[_0x2364('0x2c')];if(_0x2401cf[_0x2364('0x2e')]['includeAll']){_0x5d7833['include']=[{'all':!![]}];}_0x5d7833=_['merge']({},_0x5d7833,_0x2401cf['options']);return db[_0x2364('0x2a')][_0x2364('0x45')](_0x5d7833)[_0x2364('0x23')](handleEntityNotFound(_0x35dfeb,null))[_0x2364('0x23')](respondWithResult(_0x35dfeb,null))[_0x2364('0x44')](handleError(_0x35dfeb,null));};exports[_0x2364('0x46')]=function(_0x15a524,_0x480260){return db['SmsQueueReport'][_0x2364('0x46')](_0x15a524['body'],{})[_0x2364('0x23')](respondWithResult(_0x480260,0xc9))['catch'](handleError(_0x480260,null));};exports[_0x2364('0x22')]=function(_0x34635f,_0x4eb13c){if(_0x34635f[_0x2364('0x47')]['id']){delete _0x34635f[_0x2364('0x47')]['id'];}return db[_0x2364('0x2a')]['find']({'where':{'id':_0x34635f[_0x2364('0x48')]['id']}})[_0x2364('0x23')](handleEntityNotFound(_0x4eb13c,null))['then'](saveUpdates(_0x34635f['body'],null))[_0x2364('0x23')](respondWithResult(_0x4eb13c,null))[_0x2364('0x44')](handleError(_0x4eb13c,null));};exports[_0x2364('0x24')]=function(_0x10e946,_0x3223c1){return db[_0x2364('0x2a')]['find']({'where':{'id':_0x10e946[_0x2364('0x48')]['id']}})[_0x2364('0x23')](handleEntityNotFound(_0x3223c1,null))[_0x2364('0x23')](removeEntity(_0x3223c1,null))['catch'](handleError(_0x3223c1,null));};exports[_0x2364('0x49')]=function(_0x4c00e0,_0x5b1e65){return db[_0x2364('0x2a')][_0x2364('0x49')]()[_0x2364('0x23')](respondWithResult(_0x5b1e65,null))[_0x2364('0x44')](handleError(_0x5b1e65,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index bcf0724..5b491c1 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 _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x523a8f,_0x5f0cfc){var _0x26062a=function(_0x50bb0d){while(--_0x50bb0d){_0x523a8f['push'](_0x523a8f['shift']());}};_0x26062a(++_0x5f0cfc);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'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(_0x479509,_0x1daf8a){var _0x382da8=function(_0x39d77c){while(--_0x39d77c){_0x479509['push'](_0x479509['shift']());}};_0x382da8(++_0x1daf8a);}(_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 ded3d96..8bee4f4 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 _0x5b84=['raw','UpdateSmsQueueReport','update','body','where','attributes','limit','util','randomstring','ioredis','../../config/environment','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options'];(function(_0x363b81,_0x81e6ca){var _0x1d92fb=function(_0x129644){while(--_0x129644){_0x363b81['push'](_0x363b81['shift']());}};_0x1d92fb(++_0x81e6ca);}(_0x5b84,0xd2));var _0x45b8=function(_0x7db9a9,_0x2926b4){_0x7db9a9=_0x7db9a9-0x0;var _0x3ebc80=_0x5b84[_0x7db9a9];return _0x3ebc80;};'use strict';var _=require('lodash');var util=require(_0x45b8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x45b8('0x1'));var fs=require('fs');var Redis=require(_0x45b8('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x45b8('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x45b8('0x4')][_0x45b8('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x3ad141,_0x539dd0,_0x2c3967){return new BPromise(function(_0x51d5cb,_0x511906){return client[_0x45b8('0x6')](_0x3ad141,_0x2c3967)[_0x45b8('0x7')](function(_0x18ebc9){logger[_0x45b8('0x8')](_0x45b8('0x9'),_0x539dd0,_0x45b8('0xa'));logger[_0x45b8('0xb')](_0x45b8('0xc'),_0x539dd0,_0x45b8('0xa'),JSON[_0x45b8('0xd')](_0x18ebc9));if(_0x18ebc9[_0x45b8('0xe')]){if(_0x18ebc9[_0x45b8('0xe')]['code']===0x1f4){logger['error'](_0x45b8('0x9'),_0x539dd0,_0x18ebc9[_0x45b8('0xe')][_0x45b8('0xf')]);return _0x511906(_0x18ebc9[_0x45b8('0xe')][_0x45b8('0xf')]);}logger[_0x45b8('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x539dd0,_0x18ebc9[_0x45b8('0xe')][_0x45b8('0xf')]);return _0x51d5cb(_0x18ebc9[_0x45b8('0xe')][_0x45b8('0xf')]);}else{logger['info'](_0x45b8('0x9'),_0x539dd0,'request\x20sent');_0x51d5cb(_0x18ebc9[_0x45b8('0x10')][_0x45b8('0xf')]);}})[_0x45b8('0x11')](function(_0x4bf604){logger[_0x45b8('0xe')](_0x45b8('0x9'),_0x539dd0,_0x4bf604);_0x511906(_0x4bf604);});});}exports[_0x45b8('0x12')]=function(_0xb09477){var _0x17391=this;return new Promise(function(_0xbec46d,_0x638664){return db[_0x45b8('0x13')][_0x45b8('0x14')](_0xb09477['body'],{'raw':_0xb09477[_0x45b8('0x15')]?_0xb09477[_0x45b8('0x15')][_0x45b8('0x16')]===undefined?!![]:![]:!![]})[_0x45b8('0x7')](function(_0x27752d){logger[_0x45b8('0x8')]('CreateSmsQueueReport',_0xb09477);logger[_0x45b8('0xb')](_0x45b8('0x12'),_0xb09477,JSON[_0x45b8('0xd')](_0x27752d));_0xbec46d(_0x27752d);})['catch'](function(_0x3329f1){logger[_0x45b8('0xe')](_0x45b8('0x12'),_0x3329f1[_0x45b8('0xf')],_0xb09477);_0x638664(_0x17391[_0x45b8('0xe')](0x1f4,_0x3329f1['message']));});});};exports[_0x45b8('0x17')]=function(_0x1a88e6){var _0x32bf2a=this;return new Promise(function(_0x3bbecc,_0x3ef718){return db['SmsQueueReport'][_0x45b8('0x18')](_0x1a88e6[_0x45b8('0x19')],{'raw':_0x1a88e6['options']?_0x1a88e6[_0x45b8('0x15')][_0x45b8('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a88e6['options']?_0x1a88e6['options'][_0x45b8('0x1a')]||null:null,'attributes':_0x1a88e6[_0x45b8('0x15')]?_0x1a88e6[_0x45b8('0x15')][_0x45b8('0x1b')]||null:null,'limit':_0x1a88e6[_0x45b8('0x15')]?_0x1a88e6[_0x45b8('0x15')][_0x45b8('0x1c')]||null:null})[_0x45b8('0x7')](function(_0x3c3fca){logger[_0x45b8('0x8')](_0x45b8('0x17'),_0x1a88e6);logger[_0x45b8('0xb')](_0x45b8('0x17'),_0x1a88e6,JSON[_0x45b8('0xd')](_0x3c3fca));_0x3bbecc(_0x3c3fca);})[_0x45b8('0x11')](function(_0x203aec){logger[_0x45b8('0xe')](_0x45b8('0x17'),_0x203aec['message'],_0x1a88e6);_0x3ef718(_0x32bf2a[_0x45b8('0xe')](0x1f4,_0x203aec[_0x45b8('0xf')]));});});}; \ No newline at end of file +var _0x1906=['options','raw','UpdateSmsQueueReport','SmsQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSmsQueueReport','create','body'];(function(_0x1f45bd,_0x26b063){var _0x34b552=function(_0x3e8c15){while(--_0x3e8c15){_0x1f45bd['push'](_0x1f45bd['shift']());}};_0x34b552(++_0x26b063);}(_0x1906,0x6d));var _0x6190=function(_0x14fd10,_0x207b9a){_0x14fd10=_0x14fd10-0x0;var _0x323483=_0x1906[_0x14fd10];return _0x323483;};'use strict';var _=require(_0x6190('0x0'));var util=require(_0x6190('0x1'));var moment=require(_0x6190('0x2'));var BPromise=require(_0x6190('0x3'));var rs=require(_0x6190('0x4'));var fs=require('fs');var Redis=require(_0x6190('0x5'));var db=require(_0x6190('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6190('0x7'))(_0x6190('0x8'));var config=require('../../config/environment');var jayson=require(_0x6190('0x9'));var client=jayson['client'][_0x6190('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a9876,_0x4f9bce,_0x3175be){return new BPromise(function(_0x3826df,_0x2246d4){return client[_0x6190('0xb')](_0x4a9876,_0x3175be)[_0x6190('0xc')](function(_0x16f8b2){logger['info'](_0x6190('0xd'),_0x4f9bce,_0x6190('0xe'));logger[_0x6190('0xf')](_0x6190('0x10'),_0x4f9bce,_0x6190('0xe'),JSON[_0x6190('0x11')](_0x16f8b2));if(_0x16f8b2['error']){if(_0x16f8b2[_0x6190('0x12')][_0x6190('0x13')]===0x1f4){logger['error'](_0x6190('0xd'),_0x4f9bce,_0x16f8b2[_0x6190('0x12')][_0x6190('0x14')]);return _0x2246d4(_0x16f8b2['error'][_0x6190('0x14')]);}logger[_0x6190('0x12')](_0x6190('0xd'),_0x4f9bce,_0x16f8b2['error']['message']);return _0x3826df(_0x16f8b2['error'][_0x6190('0x14')]);}else{logger[_0x6190('0x15')](_0x6190('0xd'),_0x4f9bce,_0x6190('0xe'));_0x3826df(_0x16f8b2[_0x6190('0x16')][_0x6190('0x14')]);}})[_0x6190('0x17')](function(_0x51b3cf){logger[_0x6190('0x12')](_0x6190('0xd'),_0x4f9bce,_0x51b3cf);_0x2246d4(_0x51b3cf);});});}exports[_0x6190('0x18')]=function(_0x5183cf){var _0x2d31f9=this;return new Promise(function(_0x7087f8,_0x47770e){return db['SmsQueueReport'][_0x6190('0x19')](_0x5183cf[_0x6190('0x1a')],{'raw':_0x5183cf[_0x6190('0x1b')]?_0x5183cf[_0x6190('0x1b')][_0x6190('0x1c')]===undefined?!![]:![]:!![]})[_0x6190('0xc')](function(_0x5f4ef3){logger[_0x6190('0x15')](_0x6190('0x18'),_0x5183cf);logger[_0x6190('0xf')](_0x6190('0x18'),_0x5183cf,JSON[_0x6190('0x11')](_0x5f4ef3));_0x7087f8(_0x5f4ef3);})[_0x6190('0x17')](function(_0x3378ff){logger[_0x6190('0x12')](_0x6190('0x18'),_0x3378ff['message'],_0x5183cf);_0x47770e(_0x2d31f9[_0x6190('0x12')](0x1f4,_0x3378ff[_0x6190('0x14')]));});});};exports[_0x6190('0x1d')]=function(_0xcd6d37){var _0x5610d9=this;return new Promise(function(_0xb0ffc6,_0x20fdfb){return db[_0x6190('0x1e')]['update'](_0xcd6d37[_0x6190('0x1a')],{'raw':_0xcd6d37[_0x6190('0x1b')]?_0xcd6d37[_0x6190('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcd6d37[_0x6190('0x1b')]?_0xcd6d37[_0x6190('0x1b')][_0x6190('0x1f')]||null:null,'attributes':_0xcd6d37[_0x6190('0x1b')]?_0xcd6d37[_0x6190('0x1b')][_0x6190('0x20')]||null:null,'limit':_0xcd6d37[_0x6190('0x1b')]?_0xcd6d37[_0x6190('0x1b')][_0x6190('0x21')]||null:null})[_0x6190('0xc')](function(_0x3969dc){logger['info'](_0x6190('0x1d'),_0xcd6d37);logger['debug'](_0x6190('0x1d'),_0xcd6d37,JSON[_0x6190('0x11')](_0x3969dc));_0xb0ffc6(_0x3969dc);})['catch'](function(_0x39af56){logger[_0x6190('0x12')](_0x6190('0x1d'),_0x39af56[_0x6190('0x14')],_0xcd6d37);_0x20fdfb(_0x5610d9[_0x6190('0x12')](0x1f4,_0x39af56[_0x6190('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 9ed4012..05bc3c5 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 _0x1224=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x50a8ed,_0x31207f){var _0x5af466=function(_0x191b93){while(--_0x191b93){_0x50a8ed['push'](_0x50a8ed['shift']());}};_0x5af466(++_0x31207f);}(_0x1224,0x10d));var _0x4122=function(_0xd066c8,_0x46b223){_0xd066c8=_0xd066c8-0x0;var _0x369df2=_0x1224[_0xd066c8];return _0x369df2;};'use strict';var multer=require(_0x4122('0x0'));var util=require(_0x4122('0x1'));var path=require(_0x4122('0x2'));var timeout=require(_0x4122('0x3'));var express=require(_0x4122('0x4'));var router=express[_0x4122('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4122('0x6'));var interaction=require(_0x4122('0x7'));var config=require(_0x4122('0x8'));var controller=require('./smsTransferReport.controller');router[_0x4122('0x9')]('/',auth[_0x4122('0xa')](),controller[_0x4122('0xb')]);router[_0x4122('0x9')](_0x4122('0xc'),auth[_0x4122('0xa')](),controller[_0x4122('0xd')]);router[_0x4122('0x9')](_0x4122('0xe'),auth[_0x4122('0xa')](),controller[_0x4122('0xf')]);router[_0x4122('0x10')]('/',auth[_0x4122('0xa')](),controller[_0x4122('0x11')]);router[_0x4122('0x12')](_0x4122('0xe'),auth[_0x4122('0xa')](),controller[_0x4122('0x13')]);router[_0x4122('0x14')](_0x4122('0xe'),auth[_0x4122('0xa')](),controller[_0x4122('0x15')]);module[_0x4122('0x16')]=router; \ No newline at end of file +var _0x2d17=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','show','post','create','put','/:id','update','delete'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x2d17,0x17e));var _0x72d1=function(_0x31f52d,_0x5e84f5){_0x31f52d=_0x31f52d-0x0;var _0x1f2b67=_0x2d17[_0x31f52d];return _0x1f2b67;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var fs_extra=require(_0x72d1('0x4'));var auth=require(_0x72d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72d1('0x6'));var controller=require('./smsTransferReport.controller');router[_0x72d1('0x7')]('/',auth['isAuthenticated'](),controller[_0x72d1('0x8')]);router[_0x72d1('0x7')]('/describe',auth[_0x72d1('0x9')](),controller[_0x72d1('0xa')]);router[_0x72d1('0x7')]('/:id',auth[_0x72d1('0x9')](),controller[_0x72d1('0xb')]);router[_0x72d1('0xc')]('/',auth['isAuthenticated'](),controller[_0x72d1('0xd')]);router[_0x72d1('0xe')](_0x72d1('0xf'),auth[_0x72d1('0x9')](),controller[_0x72d1('0x10')]);router[_0x72d1('0x11')](_0x72d1('0xf'),auth[_0x72d1('0x9')](),controller[_0x72d1('0x12')]);module[_0x72d1('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 4c1af29..e59c4d0 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x13992d,_0x3029ea){var _0x3d15bf=function(_0x3444f7){while(--_0x3444f7){_0x13992d['push'](_0x13992d['shift']());}};_0x3d15bf(++_0x3029ea);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4f958,_0x161980){_0x4f958=_0x4f958-0x0;var _0x2c80b0=_0xb43b[_0x4f958];return _0x2c80b0;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x52ac91,_0x5e1bfc){var _0x5abb38=function(_0x2ca78a){while(--_0x2ca78a){_0x52ac91['push'](_0x52ac91['shift']());}};_0x5abb38(++_0x5e1bfc);}(_0x008c,0x188));var _0xc008=function(_0x26c12e,_0x55ef42){_0x26c12e=_0x26c12e-0x0;var _0xbab0c7=_0x008c[_0x26c12e];return _0xbab0c7;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 224de40..7ae4a6d 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 _0xded9=['json','apply','reject','save','update','then','error','stack','name','rawAttributes','type','key','model','map','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','rows','catch','show','params','SmsTransferReport','intersection','find','create','body','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xded9,0x15f));var _0x9ded=function(_0x14bc4f,_0x3bc74d){_0x14bc4f=_0x14bc4f-0x0;var _0x748dbb=_0xded9[_0x14bc4f];return _0x748dbb;};'use strict';var emlformat=require(_0x9ded('0x0'));var rimraf=require(_0x9ded('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9ded('0x2'));var moment=require('moment');var BPromise=require(_0x9ded('0x3'));var Mustache=require(_0x9ded('0x4'));var util=require(_0x9ded('0x5'));var path=require('path');var sox=require(_0x9ded('0x6'));var csv=require(_0x9ded('0x7'));var ejs=require(_0x9ded('0x8'));var fs=require('fs');var fs_extra=require(_0x9ded('0x9'));var _=require(_0x9ded('0xa'));var squel=require(_0x9ded('0xb'));var crypto=require(_0x9ded('0xc'));var jsforce=require(_0x9ded('0xd'));var deskjs=require(_0x9ded('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9ded('0xf'));var Papa=require(_0x9ded('0x10'));var Redis=require('ioredis');var authService=require(_0x9ded('0x11'));var qs=require(_0x9ded('0x12'));var as=require(_0x9ded('0x13'));var hardwareService=require(_0x9ded('0x14'));var logger=require(_0x9ded('0x15'))('api');var utils=require(_0x9ded('0x16'));var config=require(_0x9ded('0x17'));var licenseUtil=require(_0x9ded('0x18'));var db=require(_0x9ded('0x19'))['db'];function respondWithStatusCode(_0xcb0799,_0x5e0dea){_0x5e0dea=_0x5e0dea||0xcc;return function(_0xe199da){if(_0xe199da){return _0xcb0799[_0x9ded('0x1a')](_0x5e0dea);}return _0xcb0799[_0x9ded('0x1b')](_0x5e0dea)[_0x9ded('0x1c')]();};}function respondWithResult(_0x718763,_0x1f5cfc){_0x1f5cfc=_0x1f5cfc||0xc8;return function(_0x15985f){if(_0x15985f){return _0x718763['status'](_0x1f5cfc)['json'](_0x15985f);}};}function respondWithFilteredResult(_0x4f0ee9,_0x35e3d2){return function(_0x41b8ab){if(_0x41b8ab){var _0x5e485a=typeof _0x35e3d2['offset']===_0x9ded('0x1d')&&typeof _0x35e3d2[_0x9ded('0x1e')]===_0x9ded('0x1d');var _0x25323b=_0x41b8ab['count'];var _0x1a7570=_0x5e485a?0x0:_0x35e3d2[_0x9ded('0x1f')];var _0x1ab82b=_0x5e485a?_0x41b8ab['count']:_0x35e3d2[_0x9ded('0x1f')]+_0x35e3d2[_0x9ded('0x1e')];var _0x2ff4d6;if(_0x1ab82b>=_0x25323b){_0x1ab82b=_0x25323b;_0x2ff4d6=0xc8;}else{_0x2ff4d6=0xce;}_0x4f0ee9[_0x9ded('0x1b')](_0x2ff4d6);return _0x4f0ee9[_0x9ded('0x20')](_0x9ded('0x21'),_0x1a7570+'-'+_0x1ab82b+'/'+_0x25323b)[_0x9ded('0x22')](_0x41b8ab);}return null;};}function patchUpdates(_0x2b5759){return function(_0x644c79){try{jsonpatch[_0x9ded('0x23')](_0x644c79,_0x2b5759,!![]);}catch(_0x444bea){return BPromise[_0x9ded('0x24')](_0x444bea);}return _0x644c79[_0x9ded('0x25')]();};}function saveUpdates(_0x381f47,_0x3324bb){return function(_0x2db93a){if(_0x2db93a){return _0x2db93a[_0x9ded('0x26')](_0x381f47)[_0x9ded('0x27')](function(_0x2fd49a){return _0x2fd49a;});}return null;};}function removeEntity(_0x1ac21a,_0x29d4ac){return function(_0x42bafd){if(_0x42bafd){return _0x42bafd['destroy']()[_0x9ded('0x27')](function(){_0x1ac21a[_0x9ded('0x1b')](0xcc)[_0x9ded('0x1c')]();});}};}function handleEntityNotFound(_0x1b581b,_0x15635a){return function(_0x46a988){if(!_0x46a988){_0x1b581b[_0x9ded('0x1a')](0x194);}return _0x46a988;};}function handleError(_0x449321,_0x156ce0){_0x156ce0=_0x156ce0||0x1f4;return function(_0x473e66){logger[_0x9ded('0x28')](_0x473e66[_0x9ded('0x29')]);if(_0x473e66['name']){delete _0x473e66[_0x9ded('0x2a')];}_0x449321[_0x9ded('0x1b')](_0x156ce0)['send'](_0x473e66);};}exports['index']=function(_0x497fb4,_0x409d0b){var _0x4b7941={},_0x1a3d05={},_0x4d8c62={'count':0x0,'rows':[]};var _0x1cbee4=_['map'](db['SmsTransferReport'][_0x9ded('0x2b')],function(_0x1dbc8d){return{'name':_0x1dbc8d['fieldName'],'type':_0x1dbc8d[_0x9ded('0x2c')][_0x9ded('0x2d')]};});_0x1a3d05[_0x9ded('0x2e')]=_[_0x9ded('0x2f')](_0x1cbee4,_0x9ded('0x2a'));_0x1a3d05['query']=_[_0x9ded('0x30')](_0x497fb4[_0x9ded('0x31')]);_0x1a3d05[_0x9ded('0x32')]=_['intersection'](_0x1a3d05[_0x9ded('0x2e')],_0x1a3d05[_0x9ded('0x31')]);_0x4b7941['attributes']=_['intersection'](_0x1a3d05[_0x9ded('0x2e')],qs[_0x9ded('0x33')](_0x497fb4[_0x9ded('0x31')]['fields']));_0x4b7941[_0x9ded('0x34')]=_0x4b7941[_0x9ded('0x34')][_0x9ded('0x35')]?_0x4b7941[_0x9ded('0x34')]:_0x1a3d05[_0x9ded('0x2e')];if(!_0x497fb4['query'][_0x9ded('0x36')](_0x9ded('0x37'))){_0x4b7941[_0x9ded('0x1e')]=qs['limit'](_0x497fb4[_0x9ded('0x31')][_0x9ded('0x1e')]);_0x4b7941[_0x9ded('0x1f')]=qs[_0x9ded('0x1f')](_0x497fb4['query'][_0x9ded('0x1f')]);}_0x4b7941[_0x9ded('0x38')]=qs[_0x9ded('0x39')](_0x497fb4[_0x9ded('0x31')]['sort']);_0x4b7941['where']=qs[_0x9ded('0x32')](_[_0x9ded('0x3a')](_0x497fb4[_0x9ded('0x31')],_0x1a3d05['filters']),_0x1cbee4);if(_0x497fb4[_0x9ded('0x31')][_0x9ded('0x3b')]){_0x4b7941[_0x9ded('0x3c')]=_['merge'](_0x4b7941[_0x9ded('0x3c')],{'$or':_[_0x9ded('0x2f')](_0x1cbee4,function(_0x549b28){if(_0x549b28[_0x9ded('0x2c')]!==_0x9ded('0x3d')){var _0xc1c0a7={};_0xc1c0a7[_0x549b28[_0x9ded('0x2a')]]={'$like':'%'+_0x497fb4[_0x9ded('0x31')][_0x9ded('0x3b')]+'%'};return _0xc1c0a7;}})});}_0x4b7941=_[_0x9ded('0x3e')]({},_0x4b7941,_0x497fb4[_0x9ded('0x3f')]);var _0x4df655={'where':_0x4b7941[_0x9ded('0x3c')]};return db['SmsTransferReport']['count'](_0x4df655)[_0x9ded('0x27')](function(_0x5b8321){_0x4d8c62[_0x9ded('0x40')]=_0x5b8321;if(_0x497fb4[_0x9ded('0x31')][_0x9ded('0x41')]){_0x4b7941[_0x9ded('0x42')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x4b7941);})['then'](function(_0xdc8584){_0x4d8c62[_0x9ded('0x43')]=_0xdc8584;return _0x4d8c62;})['then'](respondWithFilteredResult(_0x409d0b,_0x4b7941))[_0x9ded('0x44')](handleError(_0x409d0b,null));};exports[_0x9ded('0x45')]=function(_0x474010,_0x4afdc1){var _0x12d3a0={'raw':!![],'where':{'id':_0x474010[_0x9ded('0x46')]['id']}},_0x38403a={};_0x38403a[_0x9ded('0x2e')]=_['keys'](db[_0x9ded('0x47')][_0x9ded('0x2b')]);_0x38403a[_0x9ded('0x31')]=_[_0x9ded('0x30')](_0x474010['query']);_0x38403a[_0x9ded('0x32')]=_[_0x9ded('0x48')](_0x38403a['model'],_0x38403a[_0x9ded('0x31')]);_0x12d3a0['attributes']=_[_0x9ded('0x48')](_0x38403a['model'],qs[_0x9ded('0x33')](_0x474010[_0x9ded('0x31')][_0x9ded('0x33')]));_0x12d3a0[_0x9ded('0x34')]=_0x12d3a0[_0x9ded('0x34')][_0x9ded('0x35')]?_0x12d3a0['attributes']:_0x38403a['model'];if(_0x474010[_0x9ded('0x31')]['includeAll']){_0x12d3a0[_0x9ded('0x42')]=[{'all':!![]}];}_0x12d3a0=_['merge']({},_0x12d3a0,_0x474010[_0x9ded('0x3f')]);return db[_0x9ded('0x47')][_0x9ded('0x49')](_0x12d3a0)[_0x9ded('0x27')](handleEntityNotFound(_0x4afdc1,null))[_0x9ded('0x27')](respondWithResult(_0x4afdc1,null))[_0x9ded('0x44')](handleError(_0x4afdc1,null));};exports[_0x9ded('0x4a')]=function(_0x2dea0b,_0x36b346){return db[_0x9ded('0x47')][_0x9ded('0x4a')](_0x2dea0b[_0x9ded('0x4b')],{})[_0x9ded('0x27')](respondWithResult(_0x36b346,0xc9))[_0x9ded('0x44')](handleError(_0x36b346,null));};exports[_0x9ded('0x26')]=function(_0x1fa7f8,_0x37aba2){if(_0x1fa7f8[_0x9ded('0x4b')]['id']){delete _0x1fa7f8[_0x9ded('0x4b')]['id'];}return db[_0x9ded('0x47')]['find']({'where':{'id':_0x1fa7f8[_0x9ded('0x46')]['id']}})[_0x9ded('0x27')](handleEntityNotFound(_0x37aba2,null))[_0x9ded('0x27')](saveUpdates(_0x1fa7f8['body'],null))[_0x9ded('0x27')](respondWithResult(_0x37aba2,null))[_0x9ded('0x44')](handleError(_0x37aba2,null));};exports['destroy']=function(_0x25f0af,_0x2bd90f){return db['SmsTransferReport']['find']({'where':{'id':_0x25f0af[_0x9ded('0x46')]['id']}})[_0x9ded('0x27')](handleEntityNotFound(_0x2bd90f,null))['then'](removeEntity(_0x2bd90f,null))[_0x9ded('0x44')](handleError(_0x2bd90f,null));};exports[_0x9ded('0x4c')]=function(_0x20eeae,_0x16f8d7){return db['SmsTransferReport']['describe']()[_0x9ded('0x27')](respondWithResult(_0x16f8d7,null))['catch'](handleError(_0x16f8d7,null));}; \ No newline at end of file +var _0x1e3f=['type','map','query','keys','filters','fields','attributes','model','nolimit','order','sort','where','merge','filter','options','SmsTransferReport','findAll','rows','catch','show','params','intersection','create','body','update','find','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','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','index','rawAttributes','fieldName'];(function(_0x59603d,_0x194217){var _0x7d3482=function(_0x1fd14c){while(--_0x1fd14c){_0x59603d['push'](_0x59603d['shift']());}};_0x7d3482(++_0x194217);}(_0x1e3f,0xad));var _0xf1e3=function(_0x20be28,_0x24b925){_0x20be28=_0x20be28-0x0;var _0x8ab067=_0x1e3f[_0x20be28];return _0x8ab067;};'use strict';var emlformat=require(_0xf1e3('0x0'));var rimraf=require(_0xf1e3('0x1'));var zipdir=require(_0xf1e3('0x2'));var jsonpatch=require(_0xf1e3('0x3'));var rp=require(_0xf1e3('0x4'));var moment=require(_0xf1e3('0x5'));var BPromise=require(_0xf1e3('0x6'));var Mustache=require(_0xf1e3('0x7'));var util=require(_0xf1e3('0x8'));var path=require(_0xf1e3('0x9'));var sox=require(_0xf1e3('0xa'));var csv=require(_0xf1e3('0xb'));var ejs=require(_0xf1e3('0xc'));var fs=require('fs');var fs_extra=require(_0xf1e3('0xd'));var _=require(_0xf1e3('0xe'));var squel=require(_0xf1e3('0xf'));var crypto=require(_0xf1e3('0x10'));var jsforce=require(_0xf1e3('0x11'));var deskjs=require(_0xf1e3('0x12'));var toCsv=require(_0xf1e3('0xb'));var querystring=require(_0xf1e3('0x13'));var Papa=require(_0xf1e3('0x14'));var Redis=require(_0xf1e3('0x15'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf1e3('0x16'));var logger=require('../../config/logger')(_0xf1e3('0x17'));var utils=require(_0xf1e3('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf1e3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e2f9b,_0x2aecd1){_0x2aecd1=_0x2aecd1||0xcc;return function(_0x87322b){if(_0x87322b){return _0x3e2f9b[_0xf1e3('0x1a')](_0x2aecd1);}return _0x3e2f9b[_0xf1e3('0x1b')](_0x2aecd1)['end']();};}function respondWithResult(_0x5de9cf,_0x558caa){_0x558caa=_0x558caa||0xc8;return function(_0x2b2bb0){if(_0x2b2bb0){return _0x5de9cf[_0xf1e3('0x1b')](_0x558caa)[_0xf1e3('0x1c')](_0x2b2bb0);}};}function respondWithFilteredResult(_0x4af9ea,_0x5f0677){return function(_0x1cecf7){if(_0x1cecf7){var _0x17a688=typeof _0x5f0677[_0xf1e3('0x1d')]===_0xf1e3('0x1e')&&typeof _0x5f0677[_0xf1e3('0x1f')]==='undefined';var _0x493f2f=_0x1cecf7['count'];var _0x3cf53a=_0x17a688?0x0:_0x5f0677[_0xf1e3('0x1d')];var _0x15b37d=_0x17a688?_0x1cecf7[_0xf1e3('0x20')]:_0x5f0677['offset']+_0x5f0677['limit'];var _0x39ecf0;if(_0x15b37d>=_0x493f2f){_0x15b37d=_0x493f2f;_0x39ecf0=0xc8;}else{_0x39ecf0=0xce;}_0x4af9ea[_0xf1e3('0x1b')](_0x39ecf0);return _0x4af9ea['set'](_0xf1e3('0x21'),_0x3cf53a+'-'+_0x15b37d+'/'+_0x493f2f)[_0xf1e3('0x1c')](_0x1cecf7);}return null;};}function patchUpdates(_0x50fee6){return function(_0x48143c){try{jsonpatch[_0xf1e3('0x22')](_0x48143c,_0x50fee6,!![]);}catch(_0x5b5973){return BPromise[_0xf1e3('0x23')](_0x5b5973);}return _0x48143c[_0xf1e3('0x24')]();};}function saveUpdates(_0x264522,_0x149c73){return function(_0x1c9679){if(_0x1c9679){return _0x1c9679['update'](_0x264522)[_0xf1e3('0x25')](function(_0x591385){return _0x591385;});}return null;};}function removeEntity(_0x5d2283,_0x259a71){return function(_0x2fa07d){if(_0x2fa07d){return _0x2fa07d[_0xf1e3('0x26')]()[_0xf1e3('0x25')](function(){_0x5d2283[_0xf1e3('0x1b')](0xcc)[_0xf1e3('0x27')]();});}};}function handleEntityNotFound(_0x10d75c,_0x266992){return function(_0x2fd304){if(!_0x2fd304){_0x10d75c[_0xf1e3('0x1a')](0x194);}return _0x2fd304;};}function handleError(_0x19aa76,_0xe5ffff){_0xe5ffff=_0xe5ffff||0x1f4;return function(_0x12f397){logger['error'](_0x12f397[_0xf1e3('0x28')]);if(_0x12f397[_0xf1e3('0x29')]){delete _0x12f397[_0xf1e3('0x29')];}_0x19aa76[_0xf1e3('0x1b')](_0xe5ffff)[_0xf1e3('0x2a')](_0x12f397);};}exports[_0xf1e3('0x2b')]=function(_0x1aecbb,_0x21755a){var _0x28136d={},_0x537a48={},_0x4b1bb0={'count':0x0,'rows':[]};var _0x5e5884=_['map'](db['SmsTransferReport'][_0xf1e3('0x2c')],function(_0x398cd0){return{'name':_0x398cd0[_0xf1e3('0x2d')],'type':_0x398cd0[_0xf1e3('0x2e')]['key']};});_0x537a48['model']=_[_0xf1e3('0x2f')](_0x5e5884,'name');_0x537a48[_0xf1e3('0x30')]=_[_0xf1e3('0x31')](_0x1aecbb[_0xf1e3('0x30')]);_0x537a48[_0xf1e3('0x32')]=_['intersection'](_0x537a48['model'],_0x537a48[_0xf1e3('0x30')]);_0x28136d['attributes']=_['intersection'](_0x537a48['model'],qs[_0xf1e3('0x33')](_0x1aecbb[_0xf1e3('0x30')][_0xf1e3('0x33')]));_0x28136d['attributes']=_0x28136d[_0xf1e3('0x34')]['length']?_0x28136d[_0xf1e3('0x34')]:_0x537a48[_0xf1e3('0x35')];if(!_0x1aecbb['query']['hasOwnProperty'](_0xf1e3('0x36'))){_0x28136d['limit']=qs[_0xf1e3('0x1f')](_0x1aecbb[_0xf1e3('0x30')][_0xf1e3('0x1f')]);_0x28136d['offset']=qs[_0xf1e3('0x1d')](_0x1aecbb[_0xf1e3('0x30')][_0xf1e3('0x1d')]);}_0x28136d[_0xf1e3('0x37')]=qs[_0xf1e3('0x38')](_0x1aecbb[_0xf1e3('0x30')][_0xf1e3('0x38')]);_0x28136d[_0xf1e3('0x39')]=qs[_0xf1e3('0x32')](_['pick'](_0x1aecbb[_0xf1e3('0x30')],_0x537a48[_0xf1e3('0x32')]),_0x5e5884);if(_0x1aecbb[_0xf1e3('0x30')]['filter']){_0x28136d[_0xf1e3('0x39')]=_[_0xf1e3('0x3a')](_0x28136d[_0xf1e3('0x39')],{'$or':_[_0xf1e3('0x2f')](_0x5e5884,function(_0x290f42){if(_0x290f42[_0xf1e3('0x2e')]!=='VIRTUAL'){var _0x1e32ad={};_0x1e32ad[_0x290f42[_0xf1e3('0x29')]]={'$like':'%'+_0x1aecbb[_0xf1e3('0x30')][_0xf1e3('0x3b')]+'%'};return _0x1e32ad;}})});}_0x28136d=_['merge']({},_0x28136d,_0x1aecbb[_0xf1e3('0x3c')]);var _0x268ebe={'where':_0x28136d[_0xf1e3('0x39')]};return db['SmsTransferReport'][_0xf1e3('0x20')](_0x268ebe)['then'](function(_0x342d9d){_0x4b1bb0[_0xf1e3('0x20')]=_0x342d9d;if(_0x1aecbb[_0xf1e3('0x30')]['includeAll']){_0x28136d['include']=[{'all':!![]}];}return db[_0xf1e3('0x3d')][_0xf1e3('0x3e')](_0x28136d);})[_0xf1e3('0x25')](function(_0x12036b){_0x4b1bb0[_0xf1e3('0x3f')]=_0x12036b;return _0x4b1bb0;})[_0xf1e3('0x25')](respondWithFilteredResult(_0x21755a,_0x28136d))[_0xf1e3('0x40')](handleError(_0x21755a,null));};exports[_0xf1e3('0x41')]=function(_0x93e3ca,_0x3cbc2e){var _0x4dff61={'raw':!![],'where':{'id':_0x93e3ca[_0xf1e3('0x42')]['id']}},_0x314d33={};_0x314d33[_0xf1e3('0x35')]=_[_0xf1e3('0x31')](db[_0xf1e3('0x3d')]['rawAttributes']);_0x314d33[_0xf1e3('0x30')]=_[_0xf1e3('0x31')](_0x93e3ca[_0xf1e3('0x30')]);_0x314d33[_0xf1e3('0x32')]=_[_0xf1e3('0x43')](_0x314d33[_0xf1e3('0x35')],_0x314d33[_0xf1e3('0x30')]);_0x4dff61[_0xf1e3('0x34')]=_['intersection'](_0x314d33[_0xf1e3('0x35')],qs['fields'](_0x93e3ca[_0xf1e3('0x30')][_0xf1e3('0x33')]));_0x4dff61['attributes']=_0x4dff61[_0xf1e3('0x34')]['length']?_0x4dff61[_0xf1e3('0x34')]:_0x314d33['model'];if(_0x93e3ca[_0xf1e3('0x30')]['includeAll']){_0x4dff61['include']=[{'all':!![]}];}_0x4dff61=_[_0xf1e3('0x3a')]({},_0x4dff61,_0x93e3ca['options']);return db['SmsTransferReport']['find'](_0x4dff61)['then'](handleEntityNotFound(_0x3cbc2e,null))[_0xf1e3('0x25')](respondWithResult(_0x3cbc2e,null))[_0xf1e3('0x40')](handleError(_0x3cbc2e,null));};exports[_0xf1e3('0x44')]=function(_0x6771c5,_0x242777){return db[_0xf1e3('0x3d')][_0xf1e3('0x44')](_0x6771c5[_0xf1e3('0x45')],{})[_0xf1e3('0x25')](respondWithResult(_0x242777,0xc9))[_0xf1e3('0x40')](handleError(_0x242777,null));};exports[_0xf1e3('0x46')]=function(_0x29d0cf,_0x142923){if(_0x29d0cf[_0xf1e3('0x45')]['id']){delete _0x29d0cf['body']['id'];}return db[_0xf1e3('0x3d')][_0xf1e3('0x47')]({'where':{'id':_0x29d0cf[_0xf1e3('0x42')]['id']}})[_0xf1e3('0x25')](handleEntityNotFound(_0x142923,null))[_0xf1e3('0x25')](saveUpdates(_0x29d0cf[_0xf1e3('0x45')],null))[_0xf1e3('0x25')](respondWithResult(_0x142923,null))[_0xf1e3('0x40')](handleError(_0x142923,null));};exports['destroy']=function(_0x1acc48,_0x35ff40){return db['SmsTransferReport'][_0xf1e3('0x47')]({'where':{'id':_0x1acc48['params']['id']}})['then'](handleEntityNotFound(_0x35ff40,null))['then'](removeEntity(_0x35ff40,null))[_0xf1e3('0x40')](handleError(_0x35ff40,null));};exports[_0xf1e3('0x48')]=function(_0x34950f,_0x1ae5ec){return db[_0xf1e3('0x3d')][_0xf1e3('0x48')]()[_0xf1e3('0x25')](respondWithResult(_0x1ae5ec,null))[_0xf1e3('0x40')](handleError(_0x1ae5ec,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index c380065..5ee02d6 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 _0xd24f=['./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','path'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xd24f,0x16e));var _0xfd24=function(_0x37d9b1,_0x358b0d){_0x37d9b1=_0x37d9b1-0x0;var _0x580044=_0xd24f[_0x37d9b1];return _0x580044;};'use strict';var _=require(_0xfd24('0x0'));var util=require(_0xfd24('0x1'));var logger=require(_0xfd24('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd24('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfd24('0x4'));module[_0xfd24('0x5')]=function(_0x17d388,_0x1447d9){return _0x17d388[_0xfd24('0x6')](_0xfd24('0x7'),attributes,{'tableName':_0xfd24('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xfd24('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x31ee=['api','moment','request-promise','path','../../config/environment','./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x17516a,_0x2824c1){var _0x22e61f=function(_0x5f0226){while(--_0x5f0226){_0x17516a['push'](_0x17516a['shift']());}};_0x22e61f(++_0x2824c1);}(_0x31ee,0xf4));var _0xe31e=function(_0x3c7d67,_0x23ebb5){_0x3c7d67=_0x3c7d67-0x0;var _0x18ece1=_0x31ee[_0x3c7d67];return _0x18ece1;};'use strict';var _=require(_0xe31e('0x0'));var util=require(_0xe31e('0x1'));var logger=require(_0xe31e('0x2'))(_0xe31e('0x3'));var moment=require(_0xe31e('0x4'));var BPromise=require('bluebird');var rp=require(_0xe31e('0x5'));var fs=require('fs');var path=require(_0xe31e('0x6'));var rimraf=require('rimraf');var config=require(_0xe31e('0x7'));var attributes=require(_0xe31e('0x8'));module[_0xe31e('0x9')]=function(_0x1483aa,_0x10de21){return _0x1483aa[_0xe31e('0xa')]('SmsTransferReport',attributes,{'tableName':_0xe31e('0xb'),'paranoid':![],'indexes':[{'name':_0xe31e('0xc'),'fields':[_0xe31e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 2e4588c..5ef33db 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 _0x861a=['stringify','error','SmsTransferReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug'];(function(_0x4bfe4e,_0x50f78b){var _0x276dac=function(_0x4710cc){while(--_0x4710cc){_0x4bfe4e['push'](_0x4bfe4e['shift']());}};_0x276dac(++_0x50f78b);}(_0x861a,0x194));var _0xa861=function(_0x313a67,_0x464af0){_0x313a67=_0x313a67-0x0;var _0x1f0a7b=_0x861a[_0x313a67];return _0x1f0a7b;};'use strict';var _=require(_0xa861('0x0'));var util=require('util');var moment=require(_0xa861('0x1'));var BPromise=require(_0xa861('0x2'));var rs=require(_0xa861('0x3'));var fs=require('fs');var Redis=require(_0xa861('0x4'));var db=require(_0xa861('0x5'))['db'];var utils=require(_0xa861('0x6'));var logger=require('../../config/logger')(_0xa861('0x7'));var config=require(_0xa861('0x8'));var jayson=require(_0xa861('0x9'));var client=jayson[_0xa861('0xa')][_0xa861('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bc6cb,_0x2c9016,_0x410918){return new BPromise(function(_0x46e2ce,_0x300ab7){return client[_0xa861('0xc')](_0x5bc6cb,_0x410918)[_0xa861('0xd')](function(_0x24e3ad){logger[_0xa861('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x2c9016,'request\x20sent');logger[_0xa861('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x2c9016,'request\x20sent',JSON[_0xa861('0x10')](_0x24e3ad));if(_0x24e3ad[_0xa861('0x11')]){if(_0x24e3ad[_0xa861('0x11')]['code']===0x1f4){logger[_0xa861('0x11')](_0xa861('0x12'),_0x2c9016,_0x24e3ad[_0xa861('0x11')][_0xa861('0x13')]);return _0x300ab7(_0x24e3ad[_0xa861('0x11')]['message']);}logger['error'](_0xa861('0x12'),_0x2c9016,_0x24e3ad['error']['message']);return _0x46e2ce(_0x24e3ad[_0xa861('0x11')][_0xa861('0x13')]);}else{logger[_0xa861('0xe')](_0xa861('0x12'),_0x2c9016,'request\x20sent');_0x46e2ce(_0x24e3ad[_0xa861('0x14')]['message']);}})['catch'](function(_0x5503fd){logger[_0xa861('0x11')](_0xa861('0x12'),_0x2c9016,_0x5503fd);_0x300ab7(_0x5503fd);});});} \ No newline at end of file +var _0x14f5=['SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x201d19,_0x41595b){var _0x25d546=function(_0x2b4a95){while(--_0x2b4a95){_0x201d19['push'](_0x201d19['shift']());}};_0x25d546(++_0x41595b);}(_0x14f5,0xae));var _0x514f=function(_0x5c24e2,_0x14aa2e){_0x5c24e2=_0x5c24e2-0x0;var _0x3be752=_0x14f5[_0x5c24e2];return _0x3be752;};'use strict';var _=require('lodash');var util=require(_0x514f('0x0'));var moment=require('moment');var BPromise=require(_0x514f('0x1'));var rs=require(_0x514f('0x2'));var fs=require('fs');var Redis=require(_0x514f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x514f('0x4'));var logger=require(_0x514f('0x5'))('rpc');var config=require(_0x514f('0x6'));var jayson=require(_0x514f('0x7'));var client=jayson[_0x514f('0x8')][_0x514f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x463985,_0x43ec42,_0xdb9614){return new BPromise(function(_0x4a5497,_0x203b02){return client['request'](_0x463985,_0xdb9614)[_0x514f('0xa')](function(_0x1e3fa7){logger[_0x514f('0xb')](_0x514f('0xc'),_0x43ec42,_0x514f('0xd'));logger[_0x514f('0xe')](_0x514f('0xf'),_0x43ec42,'request\x20sent',JSON['stringify'](_0x1e3fa7));if(_0x1e3fa7['error']){if(_0x1e3fa7[_0x514f('0x10')][_0x514f('0x11')]===0x1f4){logger[_0x514f('0x10')](_0x514f('0xc'),_0x43ec42,_0x1e3fa7[_0x514f('0x10')][_0x514f('0x12')]);return _0x203b02(_0x1e3fa7[_0x514f('0x10')][_0x514f('0x12')]);}logger[_0x514f('0x10')](_0x514f('0xc'),_0x43ec42,_0x1e3fa7[_0x514f('0x10')][_0x514f('0x12')]);return _0x4a5497(_0x1e3fa7[_0x514f('0x10')][_0x514f('0x12')]);}else{logger[_0x514f('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x43ec42,_0x514f('0xd'));_0x4a5497(_0x1e3fa7[_0x514f('0x13')]['message']);}})[_0x514f('0x14')](function(_0x53851d){logger[_0x514f('0x10')](_0x514f('0xc'),_0x43ec42,_0x53851d);_0x203b02(_0x53851d);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 98886ab..559685d 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 _0xbb2b=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','originalname','format','%s-%s%s','basename','extname','post','single','file','create','put','update','delete'];(function(_0x3a58a9,_0x4a2476){var _0x47e112=function(_0x204b91){while(--_0x204b91){_0x3a58a9['push'](_0x3a58a9['shift']());}};_0x47e112(++_0x4a2476);}(_0xbb2b,0x1d1));var _0xbbb2=function(_0x56e7f3,_0x145d85){_0x56e7f3=_0x56e7f3-0x0;var _0x4b813=_0xbb2b[_0x56e7f3];return _0x4b813;};'use strict';var multer=require(_0xbbb2('0x0'));var util=require('util');var path=require(_0xbbb2('0x1'));var timeout=require(_0xbbb2('0x2'));var express=require(_0xbbb2('0x3'));var router=express[_0xbbb2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbbb2('0x5'));var interaction=require(_0xbbb2('0x6'));var config=require(_0xbbb2('0x7'));var controller=require(_0xbbb2('0x8'));router[_0xbbb2('0x9')]('/',auth[_0xbbb2('0xa')](),controller[_0xbbb2('0xb')]);router[_0xbbb2('0x9')](_0xbbb2('0xc'),auth[_0xbbb2('0xa')](),controller[_0xbbb2('0xd')]);router[_0xbbb2('0x9')](_0xbbb2('0xe'),auth[_0xbbb2('0xa')](),controller[_0xbbb2('0xf')]);var upload=multer({'storage':multer[_0xbbb2('0x10')]({'destination':function(_0x1543a4,_0x368ba6,_0x49bcf1){_0x49bcf1(null,path[_0xbbb2('0x11')](config[_0xbbb2('0x12')],'server/files/sounds/original/'));},'filename':function(_0x5e9348,_0x36bfe2,_0x326310){_0x36bfe2[_0xbbb2('0x13')]=_0x36bfe2[_0xbbb2('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x326310(null,util[_0xbbb2('0x14')](_0xbbb2('0x15'),path[_0xbbb2('0x16')](_0x36bfe2[_0xbbb2('0x13')],path[_0xbbb2('0x17')](_0x36bfe2[_0xbbb2('0x13')])),Date['now'](),path[_0xbbb2('0x17')](_0x36bfe2['originalname'])));}})});router[_0xbbb2('0x18')]('/',upload[_0xbbb2('0x19')](_0xbbb2('0x1a')),controller[_0xbbb2('0x1b')]);router[_0xbbb2('0x1c')](_0xbbb2('0xc'),auth[_0xbbb2('0xa')](),controller[_0xbbb2('0x1d')]);router[_0xbbb2('0x1e')](_0xbbb2('0xc'),auth[_0xbbb2('0xa')](),controller[_0xbbb2('0x1e')]);module['exports']=router; \ No newline at end of file +var _0xa791=['single','file','create','put','update','delete','exports','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','now','extname','post'];(function(_0x5f4515,_0x504df2){var _0x329dd9=function(_0x29b10d){while(--_0x29b10d){_0x5f4515['push'](_0x5f4515['shift']());}};_0x329dd9(++_0x504df2);}(_0xa791,0x18f));var _0x1a79=function(_0x511b98,_0x3eddfe){_0x511b98=_0x511b98-0x0;var _0x4198f8=_0xa791[_0x511b98];return _0x4198f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1a79('0x0'));var timeout=require(_0x1a79('0x1'));var express=require(_0x1a79('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1a79('0x3'));var config=require(_0x1a79('0x4'));var controller=require('./sound.controller');router[_0x1a79('0x5')]('/',auth[_0x1a79('0x6')](),controller['index']);router[_0x1a79('0x5')](_0x1a79('0x7'),auth['isAuthenticated'](),controller[_0x1a79('0x8')]);router[_0x1a79('0x5')]('/:id/download',auth[_0x1a79('0x6')](),controller[_0x1a79('0x9')]);var upload=multer({'storage':multer[_0x1a79('0xa')]({'destination':function(_0x8cc842,_0x3a78b4,_0x337b82){_0x337b82(null,path[_0x1a79('0xb')](config[_0x1a79('0xc')],_0x1a79('0xd')));},'filename':function(_0x3b5ac6,_0x59d8b4,_0x484026){_0x59d8b4[_0x1a79('0xe')]=_0x59d8b4[_0x1a79('0xe')][_0x1a79('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x484026(null,util[_0x1a79('0x10')](_0x1a79('0x11'),path['basename'](_0x59d8b4[_0x1a79('0xe')],path['extname'](_0x59d8b4[_0x1a79('0xe')])),Date[_0x1a79('0x12')](),path[_0x1a79('0x13')](_0x59d8b4[_0x1a79('0xe')])));}})});router[_0x1a79('0x14')]('/',upload[_0x1a79('0x15')](_0x1a79('0x16')),controller[_0x1a79('0x17')]);router[_0x1a79('0x18')]('/:id',auth[_0x1a79('0x6')](),controller[_0x1a79('0x19')]);router['delete'](_0x1a79('0x7'),auth[_0x1a79('0x6')](),controller[_0x1a79('0x1a')]);module[_0x1a79('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index b6c223f..fc1547e 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 _0xa2ba=['exports','STRING','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x4d68e1,_0x49904c){var _0x8a2802=function(_0x20e7ad){while(--_0x20e7ad){_0x4d68e1['push'](_0x4d68e1['shift']());}};_0x8a2802(++_0x49904c);}(_0xa2ba,0x16d));var _0xaa2b=function(_0x3772c1,_0x108d72){_0x3772c1=_0x3772c1-0x0;var _0x38bbd0=_0xa2ba[_0x3772c1];return _0x38bbd0;};'use strict';var Sequelize=require(_0xaa2b('0x0'));module[_0xaa2b('0x1')]={'name':{'type':Sequelize[_0xaa2b('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xaa2b('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xaa2b('0x2')]},'original_duration':{'type':Sequelize[_0xaa2b('0x3')]},'original_sampleCount':{'type':Sequelize[_0xaa2b('0x4')]},'original_channelCount':{'type':Sequelize[_0xaa2b('0x5')]},'original_bitRate':{'type':Sequelize[_0xaa2b('0x4')]},'original_sampleRate':{'type':Sequelize[_0xaa2b('0x5')]},'converted_format':{'type':Sequelize[_0xaa2b('0x2')]},'converted_duration':{'type':Sequelize[_0xaa2b('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xaa2b('0x4')]},'converted_channelCount':{'type':Sequelize[_0xaa2b('0x5')]},'converted_bitRate':{'type':Sequelize[_0xaa2b('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xaa2b('0x5')]}}; \ No newline at end of file +var _0xca26=['BIGINT','sequelize','exports','STRING','name','FLOAT','INTEGER'];(function(_0x47d6e2,_0x3071cb){var _0x1d406d=function(_0x33abb6){while(--_0x33abb6){_0x47d6e2['push'](_0x47d6e2['shift']());}};_0x1d406d(++_0x3071cb);}(_0xca26,0x1b3));var _0x6ca2=function(_0x19beab,_0x2c9e3e){_0x19beab=_0x19beab-0x0;var _0x14d7fe=_0xca26[_0x19beab];return _0x14d7fe;};'use strict';var Sequelize=require(_0x6ca2('0x0'));module[_0x6ca2('0x1')]={'name':{'type':Sequelize[_0x6ca2('0x2')],'unique':_0x6ca2('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x6ca2('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x6ca2('0x2')]},'original_format':{'type':Sequelize[_0x6ca2('0x2')]},'original_duration':{'type':Sequelize[_0x6ca2('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x6ca2('0x5')]},'original_bitRate':{'type':Sequelize[_0x6ca2('0x6')]},'original_sampleRate':{'type':Sequelize[_0x6ca2('0x5')]},'converted_format':{'type':Sequelize[_0x6ca2('0x2')]},'converted_duration':{'type':Sequelize[_0x6ca2('0x4')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x6ca2('0x5')]},'converted_bitRate':{'type':Sequelize[_0x6ca2('0x6')]},'converted_sampleRate':{'type':Sequelize[_0x6ca2('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 93ec049..0746ddf 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 _0x15ab=['original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','original_format','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','sendStatus','status','end','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','index','map','Sound','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','server/files/sounds/converted','format','%s.%s','create','basename','file','originalname','extname','substring','server/files/sounds/original','filename','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount'];(function(_0xb4745d,_0x7cc344){var _0x4617b2=function(_0x3839f0){while(--_0x3839f0){_0xb4745d['push'](_0xb4745d['shift']());}};_0x4617b2(++_0x7cc344);}(_0x15ab,0x90));var _0xb15a=function(_0x2aa499,_0xa9e241){_0x2aa499=_0x2aa499-0x0;var _0x4c8fa0=_0x15ab[_0x2aa499];return _0x4c8fa0;};'use strict';var emlformat=require(_0xb15a('0x0'));var rimraf=require(_0xb15a('0x1'));var zipdir=require(_0xb15a('0x2'));var jsonpatch=require(_0xb15a('0x3'));var rp=require('request-promise');var moment=require(_0xb15a('0x4'));var BPromise=require(_0xb15a('0x5'));var Mustache=require(_0xb15a('0x6'));var util=require(_0xb15a('0x7'));var path=require(_0xb15a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb15a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb15a('0xa'));var crypto=require(_0xb15a('0xb'));var jsforce=require(_0xb15a('0xc'));var deskjs=require(_0xb15a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb15a('0xe'));var Papa=require(_0xb15a('0xf'));var Redis=require(_0xb15a('0x10'));var authService=require(_0xb15a('0x11'));var qs=require(_0xb15a('0x12'));var as=require(_0xb15a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb15a('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb15a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19415b,_0xb70048){_0xb70048=_0xb70048||0xcc;return function(_0x13bb62){if(_0x13bb62){return _0x19415b[_0xb15a('0x16')](_0xb70048);}return _0x19415b[_0xb15a('0x17')](_0xb70048)[_0xb15a('0x18')]();};}function respondWithResult(_0x4fa5c3,_0x2b63fc){_0x2b63fc=_0x2b63fc||0xc8;return function(_0x515a6d){if(_0x515a6d){return _0x4fa5c3[_0xb15a('0x17')](_0x2b63fc)['json'](_0x515a6d);}};}function respondWithFilteredResult(_0x27fa13,_0x5b7ebf){return function(_0x4aa703){if(_0x4aa703){var _0x2b1629=typeof _0x5b7ebf[_0xb15a('0x19')]==='undefined'&&typeof _0x5b7ebf[_0xb15a('0x1a')]==='undefined';var _0x4bcc7f=_0x4aa703['count'];var _0xd1ff14=_0x2b1629?0x0:_0x5b7ebf[_0xb15a('0x19')];var _0x197da8=_0x2b1629?_0x4aa703[_0xb15a('0x1b')]:_0x5b7ebf[_0xb15a('0x19')]+_0x5b7ebf[_0xb15a('0x1a')];var _0xc7c461;if(_0x197da8>=_0x4bcc7f){_0x197da8=_0x4bcc7f;_0xc7c461=0xc8;}else{_0xc7c461=0xce;}_0x27fa13['status'](_0xc7c461);return _0x27fa13[_0xb15a('0x1c')](_0xb15a('0x1d'),_0xd1ff14+'-'+_0x197da8+'/'+_0x4bcc7f)[_0xb15a('0x1e')](_0x4aa703);}return null;};}function patchUpdates(_0x172658){return function(_0x2dbbdd){try{jsonpatch['apply'](_0x2dbbdd,_0x172658,!![]);}catch(_0x16594f){return BPromise[_0xb15a('0x1f')](_0x16594f);}return _0x2dbbdd[_0xb15a('0x20')]();};}function saveUpdates(_0x4826bf,_0x28064a){return function(_0x4bddb9){if(_0x4bddb9){return _0x4bddb9[_0xb15a('0x21')](_0x4826bf)[_0xb15a('0x22')](function(_0xb31b27){return _0xb31b27;});}return null;};}function removeEntity(_0x24769e,_0x104557){return function(_0x410dd0){if(_0x410dd0){return _0x410dd0[_0xb15a('0x23')]()[_0xb15a('0x22')](function(){var _0x3baefd=_0x410dd0[_0xb15a('0x24')]({'plain':!![]});var _0x4a6030=_0xb15a('0x25');return db[_0xb15a('0x26')][_0xb15a('0x23')]({'where':{'type':_0x4a6030,'resourceId':_0x3baefd['id']}})[_0xb15a('0x22')](function(){return _0x410dd0;});})['then'](function(){_0x24769e['status'](0xcc)[_0xb15a('0x18')]();});}};}function handleEntityNotFound(_0x319981,_0x36b567){return function(_0x541fd8){if(!_0x541fd8){_0x319981['sendStatus'](0x194);}return _0x541fd8;};}function handleError(_0x11ce00,_0x6f2278){_0x6f2278=_0x6f2278||0x1f4;return function(_0x486cf5){logger[_0xb15a('0x27')](_0x486cf5[_0xb15a('0x28')]);if(_0x486cf5['name']){delete _0x486cf5[_0xb15a('0x29')];}_0x11ce00[_0xb15a('0x17')](_0x6f2278)[_0xb15a('0x2a')](_0x486cf5);};}exports[_0xb15a('0x2b')]=function(_0x34a502,_0x56eb4f){var _0x3dc385={},_0xb1caf9={},_0x47a4cc={'count':0x0,'rows':[]};var _0x4ef715=_[_0xb15a('0x2c')](db[_0xb15a('0x2d')]['rawAttributes'],function(_0x2995f4){return{'name':_0x2995f4['fieldName'],'type':_0x2995f4[_0xb15a('0x2e')][_0xb15a('0x2f')]};});_0xb1caf9['model']=_['map'](_0x4ef715,_0xb15a('0x29'));_0xb1caf9[_0xb15a('0x30')]=_[_0xb15a('0x31')](_0x34a502[_0xb15a('0x30')]);_0xb1caf9[_0xb15a('0x32')]=_[_0xb15a('0x33')](_0xb1caf9['model'],_0xb1caf9[_0xb15a('0x30')]);_0x3dc385[_0xb15a('0x34')]=_['intersection'](_0xb1caf9[_0xb15a('0x35')],qs[_0xb15a('0x36')](_0x34a502[_0xb15a('0x30')][_0xb15a('0x36')]));_0x3dc385[_0xb15a('0x34')]=_0x3dc385['attributes'][_0xb15a('0x37')]?_0x3dc385[_0xb15a('0x34')]:_0xb1caf9['model'];if(!_0x34a502[_0xb15a('0x30')][_0xb15a('0x38')](_0xb15a('0x39'))){_0x3dc385[_0xb15a('0x1a')]=qs['limit'](_0x34a502['query'][_0xb15a('0x1a')]);_0x3dc385['offset']=qs[_0xb15a('0x19')](_0x34a502['query']['offset']);}_0x3dc385['order']=qs[_0xb15a('0x3a')](_0x34a502[_0xb15a('0x30')][_0xb15a('0x3a')]);_0x3dc385[_0xb15a('0x3b')]=qs['filters'](_[_0xb15a('0x3c')](_0x34a502[_0xb15a('0x30')],_0xb1caf9[_0xb15a('0x32')]),_0x4ef715);if(_0x34a502[_0xb15a('0x30')][_0xb15a('0x3d')]){_0x3dc385[_0xb15a('0x3b')]=_[_0xb15a('0x3e')](_0x3dc385[_0xb15a('0x3b')],{'$or':_[_0xb15a('0x2c')](_0x4ef715,function(_0x20ec9c){if(_0x20ec9c['type']!=='VIRTUAL'){var _0x4b4f34={};_0x4b4f34[_0x20ec9c[_0xb15a('0x29')]]={'$like':'%'+_0x34a502['query']['filter']+'%'};return _0x4b4f34;}})});}_0x3dc385=_[_0xb15a('0x3e')]({},_0x3dc385,_0x34a502[_0xb15a('0x3f')]);var _0x2972df={'where':_0x3dc385['where']};return db[_0xb15a('0x2d')]['count'](_0x2972df)[_0xb15a('0x22')](function(_0x2bdfdb){_0x47a4cc[_0xb15a('0x1b')]=_0x2bdfdb;if(_0x34a502['query'][_0xb15a('0x40')]){_0x3dc385[_0xb15a('0x41')]=[{'all':!![]}];}return db[_0xb15a('0x2d')][_0xb15a('0x42')](_0x3dc385);})[_0xb15a('0x22')](function(_0x1454a9){_0x47a4cc[_0xb15a('0x43')]=_0x1454a9;return _0x47a4cc;})[_0xb15a('0x22')](respondWithFilteredResult(_0x56eb4f,_0x3dc385))[_0xb15a('0x44')](handleError(_0x56eb4f,null));};exports['show']=function(_0x43a4d8,_0x4eb7e6){var _0x1afc4c={'raw':!![],'where':{'id':_0x43a4d8[_0xb15a('0x45')]['id']}},_0x173018={};_0x173018[_0xb15a('0x35')]=_[_0xb15a('0x31')](db['Sound'][_0xb15a('0x46')]);_0x173018['query']=_[_0xb15a('0x31')](_0x43a4d8['query']);_0x173018[_0xb15a('0x32')]=_[_0xb15a('0x33')](_0x173018[_0xb15a('0x35')],_0x173018[_0xb15a('0x30')]);_0x1afc4c[_0xb15a('0x34')]=_[_0xb15a('0x33')](_0x173018[_0xb15a('0x35')],qs[_0xb15a('0x36')](_0x43a4d8[_0xb15a('0x30')]['fields']));_0x1afc4c['attributes']=_0x1afc4c['attributes'][_0xb15a('0x37')]?_0x1afc4c[_0xb15a('0x34')]:_0x173018['model'];if(_0x43a4d8[_0xb15a('0x30')]['includeAll']){_0x1afc4c['include']=[{'all':!![]}];}_0x1afc4c=_[_0xb15a('0x3e')]({},_0x1afc4c,_0x43a4d8[_0xb15a('0x3f')]);return db[_0xb15a('0x2d')]['find'](_0x1afc4c)['then'](handleEntityNotFound(_0x4eb7e6,null))[_0xb15a('0x22')](respondWithResult(_0x4eb7e6,null))[_0xb15a('0x44')](handleError(_0x4eb7e6,null));};exports['download']=function(_0x5a77a1,_0x17602d,_0x18f5e1){return db['Sound']['find']({'where':{'id':_0x5a77a1[_0xb15a('0x45')]['id']},'attributes':['name',_0xb15a('0x47'),_0xb15a('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x17602d,null))[_0xb15a('0x22')](function(_0x45b4ae){if(_0x45b4ae){if(!fs[_0xb15a('0x49')](path[_0xb15a('0x4a')](config[_0xb15a('0x4b')],'server/files/sounds/converted',_0x45b4ae['save_name']+'.'+_0x45b4ae['converted_format']))){throw new db[(_0xb15a('0x4c'))][(_0xb15a('0x4d'))]('Sound\x20not\x20found');}return _0x17602d['download'](path[_0xb15a('0x4a')](config['root'],_0xb15a('0x4e'),util[_0xb15a('0x4f')](_0xb15a('0x50'),_0x45b4ae['save_name'],_0x45b4ae[_0xb15a('0x48')])),util[_0xb15a('0x4f')](_0xb15a('0x50'),_0x45b4ae[_0xb15a('0x29')],_0x45b4ae[_0xb15a('0x48')]));}return null;})['catch'](handleError(_0x17602d,null));};exports[_0xb15a('0x51')]=function(_0x5811c4,_0x413e7c,_0x5f539a){var _0xb5c980={'name':path[_0xb15a('0x52')](_0x5811c4[_0xb15a('0x53')][_0xb15a('0x54')],path['extname'](_0x5811c4['file'][_0xb15a('0x54')])),'save_name':path['basename'](_0x5811c4['file']['filename'],path[_0xb15a('0x55')](_0x5811c4[_0xb15a('0x53')]['filename'])),'original_format':path[_0xb15a('0x55')](_0x5811c4[_0xb15a('0x53')]['originalname'])[_0xb15a('0x56')](0x1),'converted_format':'wav'};var _0x8d0dbb=path[_0xb15a('0x4a')](config[_0xb15a('0x4b')],_0xb15a('0x57'),_0x5811c4[_0xb15a('0x53')][_0xb15a('0x58')]);var _0x589762=path[_0xb15a('0x4a')](config[_0xb15a('0x4b')],_0xb15a('0x4e'),util[_0xb15a('0x4f')](_0xb15a('0x50'),path[_0xb15a('0x52')](_0x5811c4[_0xb15a('0x53')]['filename'],path[_0xb15a('0x55')](_0x5811c4[_0xb15a('0x53')][_0xb15a('0x58')])),_0xb5c980[_0xb15a('0x48')]));logger[_0xb15a('0x59')]('Sound\x20upload\x20filepath:\x20%s',_0x8d0dbb);logger['info'](_0xb15a('0x5a'),_0x589762);try{fs[_0xb15a('0x5b')](_0x8d0dbb,parseInt(_0xb15a('0x5c'),0x8));var _0x373564=sox[_0xb15a('0x5d')](_0x8d0dbb,_0x589762,{'sampleRate':0x1f40,'format':_0xb15a('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x373564['on'](_0xb15a('0x27'),function(_0x2f5785){fs['unlinkSync'](_0x8d0dbb);_0x413e7c['status'](0x1f4)['send'](_0x2f5785);});_0x373564['on'](_0xb15a('0x5f'),function(_0x3b2c05){_0xb5c980[_0xb15a('0x60')]=isNaN(_0x3b2c05[_0xb15a('0x61')])?null:_0x3b2c05['duration']*0x3e8;_0xb5c980[_0xb15a('0x62')]=isNaN(_0x3b2c05[_0xb15a('0x63')])?null:_0x3b2c05['sampleCount'];_0xb5c980[_0xb15a('0x64')]=isNaN(_0x3b2c05[_0xb15a('0x65')])?null:_0x3b2c05['channelCount'];_0xb5c980[_0xb15a('0x66')]=isNaN(_0x3b2c05[_0xb15a('0x67')])?null:_0x3b2c05['bitRate'];_0xb5c980[_0xb15a('0x68')]=isNaN(_0x3b2c05[_0xb15a('0x69')])?null:_0x3b2c05[_0xb15a('0x69')];});_0x373564['on'](_0xb15a('0x6a'),function(_0x58b685){_0xb5c980[_0xb15a('0x6b')]=isNaN(_0x58b685[_0xb15a('0x61')])?null:_0x58b685['duration']*0x3e8;_0xb5c980[_0xb15a('0x6c')]=isNaN(_0x58b685[_0xb15a('0x63')])?null:_0x58b685['sampleCount'];_0xb5c980[_0xb15a('0x6d')]=isNaN(_0x58b685[_0xb15a('0x65')])?null:_0x58b685[_0xb15a('0x65')];_0xb5c980[_0xb15a('0x6e')]=isNaN(_0x58b685[_0xb15a('0x67')])?null:_0x58b685[_0xb15a('0x67')];_0xb5c980[_0xb15a('0x6f')]=isNaN(_0x58b685[_0xb15a('0x69')])?null:_0x58b685['sampleRate'];});_0x373564['on']('end',function(){fs[_0xb15a('0x5b')](_0x589762,parseInt(_0xb15a('0x5c'),0x8));return db[_0xb15a('0x2d')][_0xb15a('0x51')](_0xb5c980)[_0xb15a('0x22')](function(_0x24db4d){var _0x5c518a={'role':_0x5811c4['body'][_0xb15a('0x70')],'userProfileId':_0x5811c4[_0xb15a('0x71')][_0xb15a('0x72')]};if(!_0x5c518a)throw new Error(_0xb15a('0x73'));if(_0x5c518a[_0xb15a('0x70')]===_0xb15a('0x74')){var _0x280dd9=_0x24db4d[_0xb15a('0x24')]({'plain':!![]});return db['UserProfileSection'][_0xb15a('0x75')]({'where':{'name':'Sounds','userProfileId':_0x5c518a[_0xb15a('0x72')]},'raw':!![]})['then'](function(_0x4cc9c2){if(_0x4cc9c2&&_0x4cc9c2['autoAssociation']===0x0){return db[_0xb15a('0x26')][_0xb15a('0x51')]({'name':_0x280dd9[_0xb15a('0x29')],'resourceId':_0x280dd9['id'],'type':_0x4cc9c2[_0xb15a('0x29')],'sectionId':_0x4cc9c2['id']},{})['then'](function(){return _0x24db4d;});}else{return _0x24db4d;}})[_0xb15a('0x44')](function(_0xf7e27d){logger[_0xb15a('0x27')](_0xb15a('0x76'),_0xf7e27d);throw _0xf7e27d;});}return _0x24db4d;})[_0xb15a('0x22')](respondWithResult(_0x413e7c,null))[_0xb15a('0x44')](handleError(_0x413e7c,null));});_0x373564[_0xb15a('0x77')]();}catch(_0x27eff2){_0x413e7c[_0xb15a('0x17')](0x1f4)[_0xb15a('0x2a')](_0x27eff2);}};exports[_0xb15a('0x21')]=function(_0x120b5f,_0x48c182,_0x28ae67){return db['Sound'][_0xb15a('0x75')]({'where':{'id':_0x120b5f[_0xb15a('0x45')]['id']}})[_0xb15a('0x22')](handleEntityNotFound(_0x48c182,null))['then'](saveUpdates(_[_0xb15a('0x3c')](_0x120b5f[_0xb15a('0x71')],['name','description']),null))['then'](respondWithResult(_0x48c182,null))[_0xb15a('0x44')](handleError(_0x48c182,null));};exports[_0xb15a('0x78')]=function(_0x4c8492,_0x1a3868,_0x5c9a36){return db[_0xb15a('0x2d')][_0xb15a('0x75')]({'where':{'id':_0x4c8492['params']['id']}})['then'](function(_0x47a202){if(_0x47a202){return _0x47a202['destroy']();}})[_0xb15a('0x22')](function(_0x355d41){var _0x15778a=path[_0xb15a('0x4a')](config['root'],_0xb15a('0x57'),util[_0xb15a('0x4f')](_0xb15a('0x50'),_0x355d41[_0xb15a('0x47')],_0x355d41[_0xb15a('0x79')]));var _0x338fb4=path[_0xb15a('0x4a')](config[_0xb15a('0x4b')],_0xb15a('0x4e'),util[_0xb15a('0x4f')](_0xb15a('0x50'),_0x355d41[_0xb15a('0x47')],_0x355d41[_0xb15a('0x48')]));fs[_0xb15a('0x7a')](_0x15778a);fs[_0xb15a('0x7a')](_0x338fb4);return _0x355d41;})[_0xb15a('0x22')](function(_0x2f1db4){if(_0x2f1db4){return _0x1a3868[_0xb15a('0x17')](0xcc)[_0xb15a('0x18')]();}})['then'](handleEntityNotFound(_0x1a3868,null))['catch'](handleError(_0x1a3868,null));}; \ No newline at end of file +var _0xabc5=['ValidationError','Sound\x20not\x20found','join','format','%s.%s','file','originalname','extname','filename','substring','wav','basename','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','transcode','unlinkSync','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','0777','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','userProfileId','autoAssociation','delete','server/files/sounds/original','original_format','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','params','keys','catch','download','find','save_name','converted_format','existsSync','root','server/files/sounds/converted'];(function(_0x9e505f,_0x103e40){var _0x16895d=function(_0x437218){while(--_0x437218){_0x9e505f['push'](_0x9e505f['shift']());}};_0x16895d(++_0x103e40);}(_0xabc5,0x1a7));var _0x5abc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xabc5[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x5abc('0x0'));var rimraf=require(_0x5abc('0x1'));var zipdir=require(_0x5abc('0x2'));var jsonpatch=require(_0x5abc('0x3'));var rp=require('request-promise');var moment=require(_0x5abc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5abc('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5abc('0x6'));var csv=require(_0x5abc('0x7'));var ejs=require(_0x5abc('0x8'));var fs=require('fs');var fs_extra=require(_0x5abc('0x9'));var _=require(_0x5abc('0xa'));var squel=require('squel');var crypto=require(_0x5abc('0xb'));var jsforce=require(_0x5abc('0xc'));var deskjs=require(_0x5abc('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5abc('0xe'));var Redis=require(_0x5abc('0xf'));var authService=require(_0x5abc('0x10'));var qs=require(_0x5abc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5abc('0x12'));var logger=require(_0x5abc('0x13'))(_0x5abc('0x14'));var utils=require('../../config/utils');var config=require(_0x5abc('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5abc('0x16'))['db'];function respondWithStatusCode(_0x280783,_0x487e4d){_0x487e4d=_0x487e4d||0xcc;return function(_0xb7ef27){if(_0xb7ef27){return _0x280783[_0x5abc('0x17')](_0x487e4d);}return _0x280783['status'](_0x487e4d)[_0x5abc('0x18')]();};}function respondWithResult(_0x4665b0,_0x2213cd){_0x2213cd=_0x2213cd||0xc8;return function(_0x12464a){if(_0x12464a){return _0x4665b0[_0x5abc('0x19')](_0x2213cd)['json'](_0x12464a);}};}function respondWithFilteredResult(_0x82d356,_0x445c2b){return function(_0xa23490){if(_0xa23490){var _0x4ab537=typeof _0x445c2b[_0x5abc('0x1a')]===_0x5abc('0x1b')&&typeof _0x445c2b[_0x5abc('0x1c')]==='undefined';var _0x13a488=_0xa23490[_0x5abc('0x1d')];var _0x7034d0=_0x4ab537?0x0:_0x445c2b[_0x5abc('0x1a')];var _0x2a9cdf=_0x4ab537?_0xa23490[_0x5abc('0x1d')]:_0x445c2b[_0x5abc('0x1a')]+_0x445c2b['limit'];var _0x52a208;if(_0x2a9cdf>=_0x13a488){_0x2a9cdf=_0x13a488;_0x52a208=0xc8;}else{_0x52a208=0xce;}_0x82d356[_0x5abc('0x19')](_0x52a208);return _0x82d356[_0x5abc('0x1e')](_0x5abc('0x1f'),_0x7034d0+'-'+_0x2a9cdf+'/'+_0x13a488)[_0x5abc('0x20')](_0xa23490);}return null;};}function patchUpdates(_0x389ccd){return function(_0x5eb53b){try{jsonpatch[_0x5abc('0x21')](_0x5eb53b,_0x389ccd,!![]);}catch(_0x4281bb){return BPromise[_0x5abc('0x22')](_0x4281bb);}return _0x5eb53b[_0x5abc('0x23')]();};}function saveUpdates(_0x2cf6f3,_0xaf7ff3){return function(_0x3e4a68){if(_0x3e4a68){return _0x3e4a68[_0x5abc('0x24')](_0x2cf6f3)[_0x5abc('0x25')](function(_0x280a21){return _0x280a21;});}return null;};}function removeEntity(_0x2e4485,_0x14965b){return function(_0x883093){if(_0x883093){return _0x883093[_0x5abc('0x26')]()[_0x5abc('0x25')](function(){var _0x2feed0=_0x883093[_0x5abc('0x27')]({'plain':!![]});var _0xbb5847='Sounds';return db[_0x5abc('0x28')]['destroy']({'where':{'type':_0xbb5847,'resourceId':_0x2feed0['id']}})[_0x5abc('0x25')](function(){return _0x883093;});})['then'](function(){_0x2e4485['status'](0xcc)[_0x5abc('0x18')]();});}};}function handleEntityNotFound(_0x132b80,_0x3c8313){return function(_0xb315c1){if(!_0xb315c1){_0x132b80['sendStatus'](0x194);}return _0xb315c1;};}function handleError(_0xc5c22a,_0xcb42e7){_0xcb42e7=_0xcb42e7||0x1f4;return function(_0x5acdbf){logger[_0x5abc('0x29')](_0x5acdbf[_0x5abc('0x2a')]);if(_0x5acdbf[_0x5abc('0x2b')]){delete _0x5acdbf[_0x5abc('0x2b')];}_0xc5c22a[_0x5abc('0x19')](_0xcb42e7)[_0x5abc('0x2c')](_0x5acdbf);};}exports[_0x5abc('0x2d')]=function(_0x877c02,_0x12c0c2){var _0x16f54e={},_0x1b6186={},_0x3452cc={'count':0x0,'rows':[]};var _0x4dcef9=_[_0x5abc('0x2e')](db[_0x5abc('0x2f')][_0x5abc('0x30')],function(_0x176f16){return{'name':_0x176f16[_0x5abc('0x31')],'type':_0x176f16[_0x5abc('0x32')][_0x5abc('0x33')]};});_0x1b6186['model']=_[_0x5abc('0x2e')](_0x4dcef9,'name');_0x1b6186[_0x5abc('0x34')]=_['keys'](_0x877c02[_0x5abc('0x34')]);_0x1b6186[_0x5abc('0x35')]=_['intersection'](_0x1b6186[_0x5abc('0x36')],_0x1b6186['query']);_0x16f54e['attributes']=_[_0x5abc('0x37')](_0x1b6186[_0x5abc('0x36')],qs['fields'](_0x877c02[_0x5abc('0x34')][_0x5abc('0x38')]));_0x16f54e[_0x5abc('0x39')]=_0x16f54e['attributes'][_0x5abc('0x3a')]?_0x16f54e[_0x5abc('0x39')]:_0x1b6186[_0x5abc('0x36')];if(!_0x877c02[_0x5abc('0x34')][_0x5abc('0x3b')](_0x5abc('0x3c'))){_0x16f54e[_0x5abc('0x1c')]=qs[_0x5abc('0x1c')](_0x877c02[_0x5abc('0x34')][_0x5abc('0x1c')]);_0x16f54e[_0x5abc('0x1a')]=qs['offset'](_0x877c02[_0x5abc('0x34')][_0x5abc('0x1a')]);}_0x16f54e[_0x5abc('0x3d')]=qs[_0x5abc('0x3e')](_0x877c02['query']['sort']);_0x16f54e[_0x5abc('0x3f')]=qs['filters'](_[_0x5abc('0x40')](_0x877c02[_0x5abc('0x34')],_0x1b6186['filters']),_0x4dcef9);if(_0x877c02[_0x5abc('0x34')][_0x5abc('0x41')]){_0x16f54e[_0x5abc('0x3f')]=_[_0x5abc('0x42')](_0x16f54e['where'],{'$or':_['map'](_0x4dcef9,function(_0x46ed61){if(_0x46ed61[_0x5abc('0x32')]!==_0x5abc('0x43')){var _0x5e7c68={};_0x5e7c68[_0x46ed61['name']]={'$like':'%'+_0x877c02[_0x5abc('0x34')][_0x5abc('0x41')]+'%'};return _0x5e7c68;}})});}_0x16f54e=_[_0x5abc('0x42')]({},_0x16f54e,_0x877c02[_0x5abc('0x44')]);var _0x119b41={'where':_0x16f54e[_0x5abc('0x3f')]};return db[_0x5abc('0x2f')][_0x5abc('0x1d')](_0x119b41)[_0x5abc('0x25')](function(_0x3c564a){_0x3452cc[_0x5abc('0x1d')]=_0x3c564a;if(_0x877c02[_0x5abc('0x34')][_0x5abc('0x45')]){_0x16f54e['include']=[{'all':!![]}];}return db['Sound']['findAll'](_0x16f54e);})[_0x5abc('0x25')](function(_0x4a9b97){_0x3452cc[_0x5abc('0x46')]=_0x4a9b97;return _0x3452cc;})[_0x5abc('0x25')](respondWithFilteredResult(_0x12c0c2,_0x16f54e))['catch'](handleError(_0x12c0c2,null));};exports['show']=function(_0xb63bf4,_0x34312a){var _0x7017b9={'raw':!![],'where':{'id':_0xb63bf4[_0x5abc('0x47')]['id']}},_0x44690a={};_0x44690a[_0x5abc('0x36')]=_['keys'](db[_0x5abc('0x2f')][_0x5abc('0x30')]);_0x44690a['query']=_[_0x5abc('0x48')](_0xb63bf4[_0x5abc('0x34')]);_0x44690a[_0x5abc('0x35')]=_[_0x5abc('0x37')](_0x44690a[_0x5abc('0x36')],_0x44690a[_0x5abc('0x34')]);_0x7017b9['attributes']=_['intersection'](_0x44690a[_0x5abc('0x36')],qs[_0x5abc('0x38')](_0xb63bf4[_0x5abc('0x34')][_0x5abc('0x38')]));_0x7017b9[_0x5abc('0x39')]=_0x7017b9[_0x5abc('0x39')][_0x5abc('0x3a')]?_0x7017b9[_0x5abc('0x39')]:_0x44690a[_0x5abc('0x36')];if(_0xb63bf4['query']['includeAll']){_0x7017b9['include']=[{'all':!![]}];}_0x7017b9=_['merge']({},_0x7017b9,_0xb63bf4[_0x5abc('0x44')]);return db['Sound']['find'](_0x7017b9)[_0x5abc('0x25')](handleEntityNotFound(_0x34312a,null))[_0x5abc('0x25')](respondWithResult(_0x34312a,null))[_0x5abc('0x49')](handleError(_0x34312a,null));};exports[_0x5abc('0x4a')]=function(_0x421631,_0x4e1565,_0x281a5c){return db['Sound'][_0x5abc('0x4b')]({'where':{'id':_0x421631[_0x5abc('0x47')]['id']},'attributes':[_0x5abc('0x2b'),_0x5abc('0x4c'),_0x5abc('0x4d')],'raw':!![]})[_0x5abc('0x25')](handleEntityNotFound(_0x4e1565,null))[_0x5abc('0x25')](function(_0x57589a){if(_0x57589a){if(!fs[_0x5abc('0x4e')](path['join'](config[_0x5abc('0x4f')],_0x5abc('0x50'),_0x57589a[_0x5abc('0x4c')]+'.'+_0x57589a[_0x5abc('0x4d')]))){throw new db['Sequelize'][(_0x5abc('0x51'))](_0x5abc('0x52'));}return _0x4e1565[_0x5abc('0x4a')](path[_0x5abc('0x53')](config[_0x5abc('0x4f')],'server/files/sounds/converted',util[_0x5abc('0x54')](_0x5abc('0x55'),_0x57589a[_0x5abc('0x4c')],_0x57589a[_0x5abc('0x4d')])),util['format'](_0x5abc('0x55'),_0x57589a[_0x5abc('0x2b')],_0x57589a[_0x5abc('0x4d')]));}return null;})['catch'](handleError(_0x4e1565,null));};exports['create']=function(_0x33e11e,_0x3112c4,_0x383903){var _0xdc98d1={'name':path['basename'](_0x33e11e[_0x5abc('0x56')][_0x5abc('0x57')],path[_0x5abc('0x58')](_0x33e11e[_0x5abc('0x56')][_0x5abc('0x57')])),'save_name':path['basename'](_0x33e11e['file'][_0x5abc('0x59')],path[_0x5abc('0x58')](_0x33e11e['file'][_0x5abc('0x59')])),'original_format':path['extname'](_0x33e11e['file'][_0x5abc('0x57')])[_0x5abc('0x5a')](0x1),'converted_format':_0x5abc('0x5b')};var _0x66ab0=path['join'](config[_0x5abc('0x4f')],'server/files/sounds/original',_0x33e11e[_0x5abc('0x56')][_0x5abc('0x59')]);var _0x37589c=path['join'](config['root'],_0x5abc('0x50'),util[_0x5abc('0x54')](_0x5abc('0x55'),path[_0x5abc('0x5c')](_0x33e11e[_0x5abc('0x56')][_0x5abc('0x59')],path[_0x5abc('0x58')](_0x33e11e[_0x5abc('0x56')]['filename'])),_0xdc98d1[_0x5abc('0x4d')]));logger[_0x5abc('0x5d')](_0x5abc('0x5e'),_0x66ab0);logger[_0x5abc('0x5d')](_0x5abc('0x5f'),_0x37589c);try{fs['chmodSync'](_0x66ab0,parseInt('0777',0x8));var _0x4ac3bc=sox[_0x5abc('0x60')](_0x66ab0,_0x37589c,{'sampleRate':0x1f40,'format':_0x5abc('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4ac3bc['on'](_0x5abc('0x29'),function(_0x4a7628){fs[_0x5abc('0x61')](_0x66ab0);_0x3112c4[_0x5abc('0x19')](0x1f4)[_0x5abc('0x2c')](_0x4a7628);});_0x4ac3bc['on']('src',function(_0x253420){_0xdc98d1['original_duration']=isNaN(_0x253420[_0x5abc('0x62')])?null:_0x253420[_0x5abc('0x62')]*0x3e8;_0xdc98d1[_0x5abc('0x63')]=isNaN(_0x253420[_0x5abc('0x64')])?null:_0x253420['sampleCount'];_0xdc98d1[_0x5abc('0x65')]=isNaN(_0x253420['channelCount'])?null:_0x253420[_0x5abc('0x66')];_0xdc98d1['original_bitRate']=isNaN(_0x253420[_0x5abc('0x67')])?null:_0x253420[_0x5abc('0x67')];_0xdc98d1[_0x5abc('0x68')]=isNaN(_0x253420[_0x5abc('0x69')])?null:_0x253420[_0x5abc('0x69')];});_0x4ac3bc['on'](_0x5abc('0x6a'),function(_0xcebdc7){_0xdc98d1[_0x5abc('0x6b')]=isNaN(_0xcebdc7['duration'])?null:_0xcebdc7[_0x5abc('0x62')]*0x3e8;_0xdc98d1[_0x5abc('0x6c')]=isNaN(_0xcebdc7[_0x5abc('0x64')])?null:_0xcebdc7[_0x5abc('0x64')];_0xdc98d1[_0x5abc('0x6d')]=isNaN(_0xcebdc7[_0x5abc('0x66')])?null:_0xcebdc7[_0x5abc('0x66')];_0xdc98d1[_0x5abc('0x6e')]=isNaN(_0xcebdc7[_0x5abc('0x67')])?null:_0xcebdc7[_0x5abc('0x67')];_0xdc98d1[_0x5abc('0x6f')]=isNaN(_0xcebdc7[_0x5abc('0x69')])?null:_0xcebdc7[_0x5abc('0x69')];});_0x4ac3bc['on'](_0x5abc('0x18'),function(){fs[_0x5abc('0x70')](_0x37589c,parseInt(_0x5abc('0x71'),0x8));return db[_0x5abc('0x2f')][_0x5abc('0x72')](_0xdc98d1)[_0x5abc('0x25')](function(_0x37db6e){var _0x28ac67={'role':_0x33e11e[_0x5abc('0x73')][_0x5abc('0x74')],'userProfileId':_0x33e11e[_0x5abc('0x73')]['userProfileId']};if(!_0x28ac67)throw new Error(_0x5abc('0x75'));if(_0x28ac67[_0x5abc('0x74')]===_0x5abc('0x76')){var _0x2571f3=_0x37db6e[_0x5abc('0x27')]({'plain':!![]});return db[_0x5abc('0x77')][_0x5abc('0x4b')]({'where':{'name':_0x5abc('0x78'),'userProfileId':_0x28ac67[_0x5abc('0x79')]},'raw':!![]})['then'](function(_0x534c6b){if(_0x534c6b&&_0x534c6b[_0x5abc('0x7a')]===0x0){return db['UserProfileResource'][_0x5abc('0x72')]({'name':_0x2571f3[_0x5abc('0x2b')],'resourceId':_0x2571f3['id'],'type':_0x534c6b[_0x5abc('0x2b')],'sectionId':_0x534c6b['id']},{})[_0x5abc('0x25')](function(){return _0x37db6e;});}else{return _0x37db6e;}})[_0x5abc('0x49')](function(_0x41db39){logger[_0x5abc('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41db39);throw _0x41db39;});}return _0x37db6e;})[_0x5abc('0x25')](respondWithResult(_0x3112c4,null))[_0x5abc('0x49')](handleError(_0x3112c4,null));});_0x4ac3bc['start']();}catch(_0x103610){_0x3112c4[_0x5abc('0x19')](0x1f4)[_0x5abc('0x2c')](_0x103610);}};exports[_0x5abc('0x24')]=function(_0x2d17e4,_0x13186f,_0x2feea4){return db[_0x5abc('0x2f')]['find']({'where':{'id':_0x2d17e4[_0x5abc('0x47')]['id']}})[_0x5abc('0x25')](handleEntityNotFound(_0x13186f,null))[_0x5abc('0x25')](saveUpdates(_[_0x5abc('0x40')](_0x2d17e4[_0x5abc('0x73')],[_0x5abc('0x2b'),'description']),null))[_0x5abc('0x25')](respondWithResult(_0x13186f,null))[_0x5abc('0x49')](handleError(_0x13186f,null));};exports[_0x5abc('0x7b')]=function(_0x1d9af4,_0xeb0ceb,_0xbf95a3){return db['Sound']['find']({'where':{'id':_0x1d9af4['params']['id']}})[_0x5abc('0x25')](function(_0x484eba){if(_0x484eba){return _0x484eba[_0x5abc('0x26')]();}})[_0x5abc('0x25')](function(_0x610f89){var _0x1b2b75=path[_0x5abc('0x53')](config[_0x5abc('0x4f')],_0x5abc('0x7c'),util[_0x5abc('0x54')]('%s.%s',_0x610f89[_0x5abc('0x4c')],_0x610f89[_0x5abc('0x7d')]));var _0x4686b1=path['join'](config[_0x5abc('0x4f')],_0x5abc('0x50'),util[_0x5abc('0x54')](_0x5abc('0x55'),_0x610f89[_0x5abc('0x4c')],_0x610f89['converted_format']));fs['unlinkSync'](_0x1b2b75);fs[_0x5abc('0x61')](_0x4686b1);return _0x610f89;})[_0x5abc('0x25')](function(_0x482f17){if(_0x482f17){return _0xeb0ceb['status'](0xcc)[_0x5abc('0x18')]();}})[_0x5abc('0x25')](handleEntityNotFound(_0xeb0ceb,null))[_0x5abc('0x49')](handleError(_0xeb0ceb,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 421fb14..4699afc 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 _0x8c3e=['tools_sounds','util','../../config/logger','api','bluebird','path','rimraf','exports','define','Sound'];(function(_0x18c660,_0x1d57ed){var _0x176f6d=function(_0x3e92ce){while(--_0x3e92ce){_0x18c660['push'](_0x18c660['shift']());}};_0x176f6d(++_0x1d57ed);}(_0x8c3e,0x187));var _0xe8c3=function(_0x1a8192,_0x3453f2){_0x1a8192=_0x1a8192-0x0;var _0x131de2=_0x8c3e[_0x1a8192];return _0x131de2;};'use strict';var _=require('lodash');var util=require(_0xe8c3('0x0'));var logger=require(_0xe8c3('0x1'))(_0xe8c3('0x2'));var moment=require('moment');var BPromise=require(_0xe8c3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8c3('0x4'));var rimraf=require(_0xe8c3('0x5'));var config=require('../../config/environment');var attributes=require('./sound.attributes');module[_0xe8c3('0x6')]=function(_0x19f313,_0x47a29d){return _0x19f313[_0xe8c3('0x7')](_0xe8c3('0x8'),attributes,{'tableName':_0xe8c3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9206=['Sound','tools_sounds','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x129184,_0x374390){var _0x502d8d=function(_0x19ca79){while(--_0x19ca79){_0x129184['push'](_0x129184['shift']());}};_0x502d8d(++_0x374390);}(_0x9206,0x152));var _0x6920=function(_0x4c2c7d,_0x43d8da){_0x4c2c7d=_0x4c2c7d-0x0;var _0x36e976=_0x9206[_0x4c2c7d];return _0x36e976;};'use strict';var _=require(_0x6920('0x0'));var util=require('util');var logger=require(_0x6920('0x1'))(_0x6920('0x2'));var moment=require(_0x6920('0x3'));var BPromise=require(_0x6920('0x4'));var rp=require(_0x6920('0x5'));var fs=require('fs');var path=require(_0x6920('0x6'));var rimraf=require(_0x6920('0x7'));var config=require(_0x6920('0x8'));var attributes=require('./sound.attributes');module[_0x6920('0x9')]=function(_0x29a334,_0x5c7b02){return _0x29a334['define'](_0x6920('0xa'),attributes,{'tableName':_0x6920('0xb'),'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 5f24671..93e7076 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 _0x4f74=['then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSound','Sound','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x1b913d,_0x37e32e){var _0x15c743=function(_0x2bcf2a){while(--_0x2bcf2a){_0x1b913d['push'](_0x1b913d['shift']());}};_0x15c743(++_0x37e32e);}(_0x4f74,0xdb));var _0x44f7=function(_0x263b0e,_0xc6479f){_0x263b0e=_0x263b0e-0x0;var _0x113fee=_0x4f74[_0x263b0e];return _0x113fee;};'use strict';var _=require(_0x44f7('0x0'));var util=require(_0x44f7('0x1'));var moment=require(_0x44f7('0x2'));var BPromise=require('bluebird');var rs=require(_0x44f7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x44f7('0x4'))['db'];var utils=require(_0x44f7('0x5'));var logger=require(_0x44f7('0x6'))(_0x44f7('0x7'));var config=require(_0x44f7('0x8'));var jayson=require(_0x44f7('0x9'));var client=jayson[_0x44f7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e8631,_0x535472,_0x3c4bb0){return new BPromise(function(_0x5a6d33,_0x507c02){return client[_0x44f7('0xb')](_0x4e8631,_0x3c4bb0)[_0x44f7('0xc')](function(_0x5ddcad){logger[_0x44f7('0xd')](_0x44f7('0xe'),_0x535472,_0x44f7('0xf'));logger[_0x44f7('0x10')](_0x44f7('0x11'),_0x535472,_0x44f7('0xf'),JSON['stringify'](_0x5ddcad));if(_0x5ddcad[_0x44f7('0x12')]){if(_0x5ddcad[_0x44f7('0x12')][_0x44f7('0x13')]===0x1f4){logger[_0x44f7('0x12')](_0x44f7('0xe'),_0x535472,_0x5ddcad[_0x44f7('0x12')][_0x44f7('0x14')]);return _0x507c02(_0x5ddcad['error'][_0x44f7('0x14')]);}logger[_0x44f7('0x12')](_0x44f7('0xe'),_0x535472,_0x5ddcad[_0x44f7('0x12')]['message']);return _0x5a6d33(_0x5ddcad['error'][_0x44f7('0x14')]);}else{logger[_0x44f7('0xd')](_0x44f7('0xe'),_0x535472,_0x44f7('0xf'));_0x5a6d33(_0x5ddcad['result']['message']);}})[_0x44f7('0x15')](function(_0x1e0be3){logger[_0x44f7('0x12')](_0x44f7('0xe'),_0x535472,_0x1e0be3);_0x507c02(_0x1e0be3);});});}exports[_0x44f7('0x16')]=function(_0x749d3e){var _0x485000=this;return new Promise(function(_0xb6a337,_0x1389d3){return db[_0x44f7('0x17')][_0x44f7('0x18')]({'raw':_0x749d3e[_0x44f7('0x19')]?_0x749d3e[_0x44f7('0x19')][_0x44f7('0x1a')]===undefined?!![]:![]:!![],'where':_0x749d3e[_0x44f7('0x19')]?_0x749d3e['options'][_0x44f7('0x1b')]||null:null,'attributes':_0x749d3e['options']?_0x749d3e[_0x44f7('0x19')][_0x44f7('0x1c')]||null:null,'include':_0x749d3e[_0x44f7('0x19')]?_0x749d3e[_0x44f7('0x19')]['include']?_[_0x44f7('0x1d')](_0x749d3e[_0x44f7('0x19')][_0x44f7('0x1e')],function(_0x266a1e){return{'model':db[_0x266a1e[_0x44f7('0x1f')]],'as':_0x266a1e['as'],'attributes':_0x266a1e['attributes'],'include':_0x266a1e[_0x44f7('0x1e')]?_[_0x44f7('0x1d')](_0x266a1e['include'],function(_0x58719d){return{'model':db[_0x58719d[_0x44f7('0x1f')]],'as':_0x58719d['as'],'attributes':_0x58719d['attributes'],'include':_0x58719d[_0x44f7('0x1e')]?_[_0x44f7('0x1d')](_0x58719d[_0x44f7('0x1e')],function(_0x5da3b3){return{'model':db[_0x5da3b3['model']],'as':_0x5da3b3['as'],'attributes':_0x5da3b3[_0x44f7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x44f7('0xc')](function(_0x2a8dc7){logger['info'](_0x44f7('0x16'),_0x749d3e);logger[_0x44f7('0x10')](_0x44f7('0x16'),_0x749d3e,JSON[_0x44f7('0x20')](_0x2a8dc7));_0xb6a337(_0x2a8dc7);})[_0x44f7('0x15')](function(_0x3166dc){logger[_0x44f7('0x12')](_0x44f7('0x16'),_0x3166dc['message'],_0x749d3e);_0x1389d3(_0x485000[_0x44f7('0x12')](0x1f4,_0x3166dc[_0x44f7('0x14')]));});});}; \ No newline at end of file +var _0x90ec=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Sound,\x20%s,\x20%s','message','result','catch','ShowSound','Sound','find','options','where','include','map','model','attributes','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x18147e,_0x1d8690){var _0x178987=function(_0x195a5b){while(--_0x195a5b){_0x18147e['push'](_0x18147e['shift']());}};_0x178987(++_0x1d8690);}(_0x90ec,0x139));var _0xc90e=function(_0x14113e,_0x496ecc){_0x14113e=_0x14113e-0x0;var _0x3fcca4=_0x90ec[_0x14113e];return _0x3fcca4;};'use strict';var _=require(_0xc90e('0x0'));var util=require(_0xc90e('0x1'));var moment=require(_0xc90e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc90e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc90e('0x4'));var logger=require(_0xc90e('0x5'))(_0xc90e('0x6'));var config=require(_0xc90e('0x7'));var jayson=require(_0xc90e('0x8'));var client=jayson[_0xc90e('0x9')][_0xc90e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f08d3,_0x51c558,_0x1ca13b){return new BPromise(function(_0x3d8b3a,_0x515f4b){return client[_0xc90e('0xb')](_0x5f08d3,_0x1ca13b)[_0xc90e('0xc')](function(_0x4fbe18){logger[_0xc90e('0xd')]('Sound,\x20%s,\x20%s',_0x51c558,_0xc90e('0xe'));logger[_0xc90e('0xf')]('Sound,\x20%s,\x20%s,\x20%s',_0x51c558,_0xc90e('0xe'),JSON[_0xc90e('0x10')](_0x4fbe18));if(_0x4fbe18[_0xc90e('0x11')]){if(_0x4fbe18['error'][_0xc90e('0x12')]===0x1f4){logger[_0xc90e('0x11')](_0xc90e('0x13'),_0x51c558,_0x4fbe18[_0xc90e('0x11')][_0xc90e('0x14')]);return _0x515f4b(_0x4fbe18[_0xc90e('0x11')][_0xc90e('0x14')]);}logger[_0xc90e('0x11')](_0xc90e('0x13'),_0x51c558,_0x4fbe18[_0xc90e('0x11')][_0xc90e('0x14')]);return _0x3d8b3a(_0x4fbe18[_0xc90e('0x11')][_0xc90e('0x14')]);}else{logger[_0xc90e('0xd')](_0xc90e('0x13'),_0x51c558,'request\x20sent');_0x3d8b3a(_0x4fbe18[_0xc90e('0x15')][_0xc90e('0x14')]);}})[_0xc90e('0x16')](function(_0xe5bac0){logger['error']('Sound,\x20%s,\x20%s',_0x51c558,_0xe5bac0);_0x515f4b(_0xe5bac0);});});}exports[_0xc90e('0x17')]=function(_0x5c426c){var _0x149948=this;return new Promise(function(_0x151402,_0x82ece0){return db[_0xc90e('0x18')][_0xc90e('0x19')]({'raw':_0x5c426c['options']?_0x5c426c[_0xc90e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5c426c['options']?_0x5c426c['options'][_0xc90e('0x1b')]||null:null,'attributes':_0x5c426c[_0xc90e('0x1a')]?_0x5c426c['options']['attributes']||null:null,'include':_0x5c426c['options']?_0x5c426c['options'][_0xc90e('0x1c')]?_[_0xc90e('0x1d')](_0x5c426c[_0xc90e('0x1a')][_0xc90e('0x1c')],function(_0x2202ed){return{'model':db[_0x2202ed[_0xc90e('0x1e')]],'as':_0x2202ed['as'],'attributes':_0x2202ed[_0xc90e('0x1f')],'include':_0x2202ed[_0xc90e('0x1c')]?_[_0xc90e('0x1d')](_0x2202ed[_0xc90e('0x1c')],function(_0x5e52c2){return{'model':db[_0x5e52c2[_0xc90e('0x1e')]],'as':_0x5e52c2['as'],'attributes':_0x5e52c2[_0xc90e('0x1f')],'include':_0x5e52c2[_0xc90e('0x1c')]?_[_0xc90e('0x1d')](_0x5e52c2['include'],function(_0x304d34){return{'model':db[_0x304d34[_0xc90e('0x1e')]],'as':_0x304d34['as'],'attributes':_0x304d34[_0xc90e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc90e('0xc')](function(_0x4a7053){logger[_0xc90e('0xd')](_0xc90e('0x17'),_0x5c426c);logger[_0xc90e('0xf')](_0xc90e('0x17'),_0x5c426c,JSON[_0xc90e('0x10')](_0x4a7053));_0x151402(_0x4a7053);})[_0xc90e('0x16')](function(_0x395b8f){logger[_0xc90e('0x11')](_0xc90e('0x17'),_0x395b8f[_0xc90e('0x14')],_0x5c426c);_0x82ece0(_0x149948[_0xc90e('0x11')](0x1f4,_0x395b8f['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index f61f7fc..e781fba 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 _0xbaf0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0xe94913,_0x471896){var _0x261831=function(_0x9303b7){while(--_0x9303b7){_0xe94913['push'](_0xe94913['shift']());}};_0x261831(++_0x471896);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'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['show']);router[_0x0baf('0xd')]('/',auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);module[_0x0baf('0x13')]=router; \ No newline at end of file +var _0x14a0=['get','isAuthenticated','/:id','show','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareMessage.controller'];(function(_0x36a947,_0x1f0510){var _0x34e818=function(_0x117bca){while(--_0x117bca){_0x36a947['push'](_0x36a947['shift']());}};_0x34e818(++_0x1f0510);}(_0x14a0,0x8e));var _0x014a=function(_0x11c584,_0x21bc3a){_0x11c584=_0x11c584-0x0;var _0x3d0954=_0x14a0[_0x11c584];return _0x3d0954;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x014a('0xd')]('/:id',auth[_0x014a('0x9')](),controller[_0x014a('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 91cf1f4..8a4a9cc 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 _0xa26c=['medium','sequelize','STRING','TEXT'];(function(_0x49aa99,_0x4ef618){var _0x1786d7=function(_0x302531){while(--_0x302531){_0x49aa99['push'](_0x49aa99['shift']());}};_0x1786d7(++_0x4ef618);}(_0xa26c,0x10d));var _0xca26=function(_0x14c173,_0x398037){_0x14c173=_0x14c173-0x0;var _0x1cb68d=_0xa26c[_0x14c173];return _0x1cb68d;};'use strict';var Sequelize=require(_0xca26('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xca26('0x1')]},'body':{'type':Sequelize[_0xca26('0x2')](_0xca26('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xca26('0x1')]},'providerResponse':{'type':Sequelize[_0xca26('0x2')]}}; \ No newline at end of file +var _0x7903=['STRING','sequelize','exports','TEXT','medium','out'];(function(_0x57cea5,_0x4776a0){var _0x25d64e=function(_0x1b8f2b){while(--_0x1b8f2b){_0x57cea5['push'](_0x57cea5['shift']());}};_0x25d64e(++_0x4776a0);}(_0x7903,0xd9));var _0x3790=function(_0x4eed00,_0x3349dd){_0x4eed00=_0x4eed00-0x0;var _0xfcb43b=_0x7903[_0x4eed00];return _0xfcb43b;};'use strict';var Sequelize=require(_0x3790('0x0'));module[_0x3790('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x3790('0x2')](_0x3790('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3790('0x4')),'defaultValue':_0x3790('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x3790('0x5')]},'providerResponse':{'type':Sequelize[_0x3790('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index a2965c6..ad61f7c 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 _0xbff2=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SquareMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','eml-format','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbff2,0x10e));var _0x2bff=function(_0x1e0517,_0x496b54){_0x1e0517=_0x1e0517-0x0;var _0xc11305=_0xbff2[_0x1e0517];return _0xc11305;};'use strict';var emlformat=require(_0x2bff('0x0'));var rimraf=require(_0x2bff('0x1'));var zipdir=require(_0x2bff('0x2'));var jsonpatch=require(_0x2bff('0x3'));var rp=require(_0x2bff('0x4'));var moment=require(_0x2bff('0x5'));var BPromise=require(_0x2bff('0x6'));var Mustache=require(_0x2bff('0x7'));var util=require(_0x2bff('0x8'));var path=require('path');var sox=require(_0x2bff('0x9'));var csv=require(_0x2bff('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2bff('0xb'));var crypto=require(_0x2bff('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2bff('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2bff('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2bff('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2bff('0x10'))(_0x2bff('0x11'));var utils=require('../../config/utils');var config=require(_0x2bff('0x12'));var licenseUtil=require(_0x2bff('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47f83e,_0x1498e0){_0x1498e0=_0x1498e0||0xcc;return function(_0x2ff7ec){if(_0x2ff7ec){return _0x47f83e['sendStatus'](_0x1498e0);}return _0x47f83e[_0x2bff('0x14')](_0x1498e0)[_0x2bff('0x15')]();};}function respondWithResult(_0x48f9f8,_0x3d3e90){_0x3d3e90=_0x3d3e90||0xc8;return function(_0x3e8399){if(_0x3e8399){return _0x48f9f8[_0x2bff('0x14')](_0x3d3e90)[_0x2bff('0x16')](_0x3e8399);}};}function respondWithFilteredResult(_0x5cf3c1,_0x34b079){return function(_0x348105){if(_0x348105){var _0x25f978=typeof _0x34b079[_0x2bff('0x17')]===_0x2bff('0x18')&&typeof _0x34b079[_0x2bff('0x19')]==='undefined';var _0x19ff4a=_0x348105[_0x2bff('0x1a')];var _0xf7b7b6=_0x25f978?0x0:_0x34b079['offset'];var _0x3886d0=_0x25f978?_0x348105[_0x2bff('0x1a')]:_0x34b079['offset']+_0x34b079[_0x2bff('0x19')];var _0x13406a;if(_0x3886d0>=_0x19ff4a){_0x3886d0=_0x19ff4a;_0x13406a=0xc8;}else{_0x13406a=0xce;}_0x5cf3c1[_0x2bff('0x14')](_0x13406a);return _0x5cf3c1['set']('Content-Range',_0xf7b7b6+'-'+_0x3886d0+'/'+_0x19ff4a)[_0x2bff('0x16')](_0x348105);}return null;};}function patchUpdates(_0x1f3bd9){return function(_0x52d07d){try{jsonpatch[_0x2bff('0x1b')](_0x52d07d,_0x1f3bd9,!![]);}catch(_0x49e763){return BPromise['reject'](_0x49e763);}return _0x52d07d[_0x2bff('0x1c')]();};}function saveUpdates(_0x26c836,_0xd751ab){return function(_0x2a446b){if(_0x2a446b){return _0x2a446b[_0x2bff('0x1d')](_0x26c836)[_0x2bff('0x1e')](function(_0x33ab51){return _0x33ab51;});}return null;};}function removeEntity(_0x429fb5,_0x290933){return function(_0x42c9c2){if(_0x42c9c2){return _0x42c9c2[_0x2bff('0x1f')]()[_0x2bff('0x1e')](function(){_0x429fb5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x29062d,_0x314717){return function(_0x4c6a91){if(!_0x4c6a91){_0x29062d[_0x2bff('0x20')](0x194);}return _0x4c6a91;};}function handleError(_0x52768a,_0x11f5b8){_0x11f5b8=_0x11f5b8||0x1f4;return function(_0x59147b){logger[_0x2bff('0x21')](_0x59147b[_0x2bff('0x22')]);if(_0x59147b['name']){delete _0x59147b[_0x2bff('0x23')];}_0x52768a[_0x2bff('0x14')](_0x11f5b8)[_0x2bff('0x24')](_0x59147b);};}exports[_0x2bff('0x25')]=function(_0x2204ad,_0x354d1c){var _0x5a93fa={},_0x5c2b38={},_0x5e8c69={'count':0x0,'rows':[]};var _0x3e4b7e=_[_0x2bff('0x26')](db[_0x2bff('0x27')][_0x2bff('0x28')],function(_0x3558e4){return{'name':_0x3558e4['fieldName'],'type':_0x3558e4['type']['key']};});_0x5c2b38[_0x2bff('0x29')]=_['map'](_0x3e4b7e,'name');_0x5c2b38['query']=_[_0x2bff('0x2a')](_0x2204ad[_0x2bff('0x2b')]);_0x5c2b38[_0x2bff('0x2c')]=_[_0x2bff('0x2d')](_0x5c2b38[_0x2bff('0x29')],_0x5c2b38[_0x2bff('0x2b')]);_0x5a93fa[_0x2bff('0x2e')]=_[_0x2bff('0x2d')](_0x5c2b38[_0x2bff('0x29')],qs[_0x2bff('0x2f')](_0x2204ad[_0x2bff('0x2b')][_0x2bff('0x2f')]));_0x5a93fa[_0x2bff('0x2e')]=_0x5a93fa[_0x2bff('0x2e')]['length']?_0x5a93fa[_0x2bff('0x2e')]:_0x5c2b38[_0x2bff('0x29')];if(!_0x2204ad[_0x2bff('0x2b')]['hasOwnProperty'](_0x2bff('0x30'))){_0x5a93fa['limit']=qs[_0x2bff('0x19')](_0x2204ad[_0x2bff('0x2b')][_0x2bff('0x19')]);_0x5a93fa[_0x2bff('0x17')]=qs[_0x2bff('0x17')](_0x2204ad['query'][_0x2bff('0x17')]);}_0x5a93fa[_0x2bff('0x31')]=qs[_0x2bff('0x32')](_0x2204ad[_0x2bff('0x2b')]['sort']);_0x5a93fa[_0x2bff('0x33')]=qs['filters'](_['pick'](_0x2204ad[_0x2bff('0x2b')],_0x5c2b38['filters']),_0x3e4b7e);if(_0x2204ad['query'][_0x2bff('0x34')]){_0x5a93fa[_0x2bff('0x33')]=_[_0x2bff('0x35')](_0x5a93fa[_0x2bff('0x33')],{'$or':_['map'](_0x3e4b7e,function(_0x1bb782){if(_0x1bb782[_0x2bff('0x36')]!==_0x2bff('0x37')){var _0x557b74={};_0x557b74[_0x1bb782[_0x2bff('0x23')]]={'$like':'%'+_0x2204ad[_0x2bff('0x2b')][_0x2bff('0x34')]+'%'};return _0x557b74;}})});}_0x5a93fa=_[_0x2bff('0x35')]({},_0x5a93fa,_0x2204ad['options']);var _0x1e0b34={'where':_0x5a93fa[_0x2bff('0x33')]};return db['SquareMessage'][_0x2bff('0x1a')](_0x1e0b34)[_0x2bff('0x1e')](function(_0x45c2b2){_0x5e8c69[_0x2bff('0x1a')]=_0x45c2b2;if(_0x2204ad[_0x2bff('0x2b')][_0x2bff('0x38')]){_0x5a93fa[_0x2bff('0x39')]=[{'all':!![]}];}return db[_0x2bff('0x27')][_0x2bff('0x3a')](_0x5a93fa);})[_0x2bff('0x1e')](function(_0x15d8d8){_0x5e8c69[_0x2bff('0x3b')]=_0x15d8d8;return _0x5e8c69;})[_0x2bff('0x1e')](respondWithFilteredResult(_0x354d1c,_0x5a93fa))[_0x2bff('0x3c')](handleError(_0x354d1c,null));};exports[_0x2bff('0x3d')]=function(_0x3cd61c,_0x1c53c2){var _0x800a76={'raw':!![],'where':{'id':_0x3cd61c[_0x2bff('0x3e')]['id']}},_0x14be36={};_0x14be36[_0x2bff('0x29')]=_['keys'](db[_0x2bff('0x27')][_0x2bff('0x28')]);_0x14be36[_0x2bff('0x2b')]=_[_0x2bff('0x2a')](_0x3cd61c[_0x2bff('0x2b')]);_0x14be36[_0x2bff('0x2c')]=_[_0x2bff('0x2d')](_0x14be36[_0x2bff('0x29')],_0x14be36[_0x2bff('0x2b')]);_0x800a76['attributes']=_['intersection'](_0x14be36[_0x2bff('0x29')],qs[_0x2bff('0x2f')](_0x3cd61c[_0x2bff('0x2b')][_0x2bff('0x2f')]));_0x800a76['attributes']=_0x800a76[_0x2bff('0x2e')][_0x2bff('0x3f')]?_0x800a76[_0x2bff('0x2e')]:_0x14be36[_0x2bff('0x29')];if(_0x3cd61c[_0x2bff('0x2b')]['includeAll']){_0x800a76[_0x2bff('0x39')]=[{'all':!![]}];}_0x800a76=_['merge']({},_0x800a76,_0x3cd61c[_0x2bff('0x40')]);return db[_0x2bff('0x27')][_0x2bff('0x41')](_0x800a76)[_0x2bff('0x1e')](handleEntityNotFound(_0x1c53c2,null))['then'](respondWithResult(_0x1c53c2,null))['catch'](handleError(_0x1c53c2,null));};exports['create']=function(_0x5d5cda,_0xc5663c){return db[_0x2bff('0x27')][_0x2bff('0x42')](_0x5d5cda['body'],{})[_0x2bff('0x1e')](respondWithResult(_0xc5663c,0xc9))[_0x2bff('0x3c')](handleError(_0xc5663c,null));};exports[_0x2bff('0x1d')]=function(_0x286beb,_0x30fbb0){if(_0x286beb[_0x2bff('0x43')]['id']){delete _0x286beb['body']['id'];}return db[_0x2bff('0x27')][_0x2bff('0x41')]({'where':{'id':_0x286beb[_0x2bff('0x3e')]['id']}})[_0x2bff('0x1e')](handleEntityNotFound(_0x30fbb0,null))[_0x2bff('0x1e')](saveUpdates(_0x286beb[_0x2bff('0x43')],null))[_0x2bff('0x1e')](respondWithResult(_0x30fbb0,null))['catch'](handleError(_0x30fbb0,null));};exports[_0x2bff('0x1f')]=function(_0x5d681b,_0x36b298){return db[_0x2bff('0x27')][_0x2bff('0x41')]({'where':{'id':_0x5d681b['params']['id']}})[_0x2bff('0x1e')](handleEntityNotFound(_0x36b298,null))['then'](removeEntity(_0x36b298,null))['catch'](handleError(_0x36b298,null));}; \ No newline at end of file +var _0xa49b=['fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','status','end','json','offset','undefined','count','set','apply','reject','save','then','sendStatus','error','stack','name','send','map','SquareMessage','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','update','destroy','rimraf','zip-dir'];(function(_0x2962b4,_0x4b0786){var _0x411b7d=function(_0x363aad){while(--_0x363aad){_0x2962b4['push'](_0x2962b4['shift']());}};_0x411b7d(++_0x4b0786);}(_0xa49b,0x126));var _0xba49=function(_0x3c4e56,_0xf3e167){_0x3c4e56=_0x3c4e56-0x0;var _0x2216b5=_0xa49b[_0x3c4e56];return _0x2216b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba49('0x0'));var zipdir=require(_0xba49('0x1'));var jsonpatch=require(_0xba49('0x2'));var rp=require(_0xba49('0x3'));var moment=require('moment');var BPromise=require(_0xba49('0x4'));var Mustache=require(_0xba49('0x5'));var util=require(_0xba49('0x6'));var path=require('path');var sox=require(_0xba49('0x7'));var csv=require(_0xba49('0x8'));var ejs=require(_0xba49('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba49('0xa'));var squel=require('squel');var crypto=require(_0xba49('0xb'));var jsforce=require(_0xba49('0xc'));var deskjs=require(_0xba49('0xd'));var toCsv=require('to-csv');var querystring=require(_0xba49('0xe'));var Papa=require(_0xba49('0xf'));var Redis=require(_0xba49('0x10'));var authService=require(_0xba49('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xba49('0x12'));var hardwareService=require(_0xba49('0x13'));var logger=require(_0xba49('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xba49('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5249cd,_0x324539){_0x324539=_0x324539||0xcc;return function(_0x498a91){if(_0x498a91){return _0x5249cd['sendStatus'](_0x324539);}return _0x5249cd[_0xba49('0x16')](_0x324539)[_0xba49('0x17')]();};}function respondWithResult(_0x1ad55f,_0x33b1c8){_0x33b1c8=_0x33b1c8||0xc8;return function(_0x5cc5b2){if(_0x5cc5b2){return _0x1ad55f[_0xba49('0x16')](_0x33b1c8)[_0xba49('0x18')](_0x5cc5b2);}};}function respondWithFilteredResult(_0x483d0e,_0x51979b){return function(_0xc1053a){if(_0xc1053a){var _0x1e11e4=typeof _0x51979b[_0xba49('0x19')]===_0xba49('0x1a')&&typeof _0x51979b['limit']===_0xba49('0x1a');var _0x38c584=_0xc1053a[_0xba49('0x1b')];var _0x5cc0fe=_0x1e11e4?0x0:_0x51979b[_0xba49('0x19')];var _0x3a0854=_0x1e11e4?_0xc1053a[_0xba49('0x1b')]:_0x51979b[_0xba49('0x19')]+_0x51979b['limit'];var _0x2dc548;if(_0x3a0854>=_0x38c584){_0x3a0854=_0x38c584;_0x2dc548=0xc8;}else{_0x2dc548=0xce;}_0x483d0e['status'](_0x2dc548);return _0x483d0e[_0xba49('0x1c')]('Content-Range',_0x5cc0fe+'-'+_0x3a0854+'/'+_0x38c584)[_0xba49('0x18')](_0xc1053a);}return null;};}function patchUpdates(_0x36b21b){return function(_0x4524e2){try{jsonpatch[_0xba49('0x1d')](_0x4524e2,_0x36b21b,!![]);}catch(_0x11cb39){return BPromise[_0xba49('0x1e')](_0x11cb39);}return _0x4524e2[_0xba49('0x1f')]();};}function saveUpdates(_0x331ec2,_0x2abc3b){return function(_0x4f1f1d){if(_0x4f1f1d){return _0x4f1f1d['update'](_0x331ec2)[_0xba49('0x20')](function(_0x42670c){return _0x42670c;});}return null;};}function removeEntity(_0x479f81,_0x54c9cd){return function(_0x5711ed){if(_0x5711ed){return _0x5711ed['destroy']()[_0xba49('0x20')](function(){_0x479f81[_0xba49('0x16')](0xcc)[_0xba49('0x17')]();});}};}function handleEntityNotFound(_0x14a43c,_0x81f0aa){return function(_0x34c92b){if(!_0x34c92b){_0x14a43c[_0xba49('0x21')](0x194);}return _0x34c92b;};}function handleError(_0x216e1e,_0x51345d){_0x51345d=_0x51345d||0x1f4;return function(_0x437357){logger[_0xba49('0x22')](_0x437357[_0xba49('0x23')]);if(_0x437357['name']){delete _0x437357[_0xba49('0x24')];}_0x216e1e[_0xba49('0x16')](_0x51345d)[_0xba49('0x25')](_0x437357);};}exports['index']=function(_0x214e20,_0x15f9ac){var _0x529415={},_0x2c0854={},_0x3d62af={'count':0x0,'rows':[]};var _0x18e661=_[_0xba49('0x26')](db[_0xba49('0x27')][_0xba49('0x28')],function(_0x5ea525){return{'name':_0x5ea525[_0xba49('0x29')],'type':_0x5ea525['type'][_0xba49('0x2a')]};});_0x2c0854[_0xba49('0x2b')]=_[_0xba49('0x26')](_0x18e661,'name');_0x2c0854[_0xba49('0x2c')]=_[_0xba49('0x2d')](_0x214e20[_0xba49('0x2c')]);_0x2c0854['filters']=_[_0xba49('0x2e')](_0x2c0854[_0xba49('0x2b')],_0x2c0854['query']);_0x529415[_0xba49('0x2f')]=_[_0xba49('0x2e')](_0x2c0854[_0xba49('0x2b')],qs['fields'](_0x214e20['query'][_0xba49('0x30')]));_0x529415[_0xba49('0x2f')]=_0x529415[_0xba49('0x2f')][_0xba49('0x31')]?_0x529415[_0xba49('0x2f')]:_0x2c0854[_0xba49('0x2b')];if(!_0x214e20['query'][_0xba49('0x32')](_0xba49('0x33'))){_0x529415['limit']=qs[_0xba49('0x34')](_0x214e20['query']['limit']);_0x529415[_0xba49('0x19')]=qs['offset'](_0x214e20[_0xba49('0x2c')][_0xba49('0x19')]);}_0x529415[_0xba49('0x35')]=qs[_0xba49('0x36')](_0x214e20[_0xba49('0x2c')][_0xba49('0x36')]);_0x529415[_0xba49('0x37')]=qs[_0xba49('0x38')](_[_0xba49('0x39')](_0x214e20[_0xba49('0x2c')],_0x2c0854['filters']),_0x18e661);if(_0x214e20[_0xba49('0x2c')][_0xba49('0x3a')]){_0x529415[_0xba49('0x37')]=_[_0xba49('0x3b')](_0x529415[_0xba49('0x37')],{'$or':_[_0xba49('0x26')](_0x18e661,function(_0x1a438f){if(_0x1a438f['type']!==_0xba49('0x3c')){var _0x500fd2={};_0x500fd2[_0x1a438f[_0xba49('0x24')]]={'$like':'%'+_0x214e20['query']['filter']+'%'};return _0x500fd2;}})});}_0x529415=_[_0xba49('0x3b')]({},_0x529415,_0x214e20[_0xba49('0x3d')]);var _0x28e5fa={'where':_0x529415['where']};return db['SquareMessage']['count'](_0x28e5fa)[_0xba49('0x20')](function(_0x567c33){_0x3d62af[_0xba49('0x1b')]=_0x567c33;if(_0x214e20[_0xba49('0x2c')]['includeAll']){_0x529415[_0xba49('0x3e')]=[{'all':!![]}];}return db[_0xba49('0x27')][_0xba49('0x3f')](_0x529415);})[_0xba49('0x20')](function(_0x1911d1){_0x3d62af[_0xba49('0x40')]=_0x1911d1;return _0x3d62af;})['then'](respondWithFilteredResult(_0x15f9ac,_0x529415))['catch'](handleError(_0x15f9ac,null));};exports[_0xba49('0x41')]=function(_0x265c3c,_0x3810d1){var _0x1d61af={'raw':!![],'where':{'id':_0x265c3c[_0xba49('0x42')]['id']}},_0x3c2a61={};_0x3c2a61[_0xba49('0x2b')]=_[_0xba49('0x2d')](db[_0xba49('0x27')][_0xba49('0x28')]);_0x3c2a61[_0xba49('0x2c')]=_[_0xba49('0x2d')](_0x265c3c[_0xba49('0x2c')]);_0x3c2a61[_0xba49('0x38')]=_['intersection'](_0x3c2a61[_0xba49('0x2b')],_0x3c2a61[_0xba49('0x2c')]);_0x1d61af[_0xba49('0x2f')]=_['intersection'](_0x3c2a61[_0xba49('0x2b')],qs[_0xba49('0x30')](_0x265c3c['query']['fields']));_0x1d61af[_0xba49('0x2f')]=_0x1d61af['attributes'][_0xba49('0x31')]?_0x1d61af[_0xba49('0x2f')]:_0x3c2a61[_0xba49('0x2b')];if(_0x265c3c[_0xba49('0x2c')][_0xba49('0x43')]){_0x1d61af[_0xba49('0x3e')]=[{'all':!![]}];}_0x1d61af=_['merge']({},_0x1d61af,_0x265c3c[_0xba49('0x3d')]);return db[_0xba49('0x27')][_0xba49('0x44')](_0x1d61af)[_0xba49('0x20')](handleEntityNotFound(_0x3810d1,null))['then'](respondWithResult(_0x3810d1,null))[_0xba49('0x45')](handleError(_0x3810d1,null));};exports[_0xba49('0x46')]=function(_0xd899bb,_0x5a811e){return db['SquareMessage'][_0xba49('0x46')](_0xd899bb[_0xba49('0x47')],{})[_0xba49('0x20')](respondWithResult(_0x5a811e,0xc9))['catch'](handleError(_0x5a811e,null));};exports[_0xba49('0x48')]=function(_0x21a49b,_0xd94990){if(_0x21a49b['body']['id']){delete _0x21a49b[_0xba49('0x47')]['id'];}return db[_0xba49('0x27')][_0xba49('0x44')]({'where':{'id':_0x21a49b[_0xba49('0x42')]['id']}})[_0xba49('0x20')](handleEntityNotFound(_0xd94990,null))[_0xba49('0x20')](saveUpdates(_0x21a49b['body'],null))['then'](respondWithResult(_0xd94990,null))['catch'](handleError(_0xd94990,null));};exports[_0xba49('0x49')]=function(_0x34aed7,_0x529fe6){return db[_0xba49('0x27')][_0xba49('0x44')]({'where':{'id':_0x34aed7[_0xba49('0x42')]['id']}})[_0xba49('0x20')](handleEntityNotFound(_0x529fe6,null))['then'](removeEntity(_0x529fe6,null))[_0xba49('0x45')](handleError(_0x529fe6,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 7a5e9c4..4495944 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 _0xc69b=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages'];(function(_0x549629,_0x3d108e){var _0xeea646=function(_0x510ca5){while(--_0x510ca5){_0x549629['push'](_0x549629['shift']());}};_0xeea646(++_0x3d108e);}(_0xc69b,0x1ad));var _0xbc69=function(_0x5e709a,_0x1d7975){_0x5e709a=_0x5e709a-0x0;var _0x57401a=_0xc69b[_0x5e709a];return _0x57401a;};'use strict';var _=require('lodash');var util=require(_0xbc69('0x0'));var logger=require(_0xbc69('0x1'))(_0xbc69('0x2'));var moment=require(_0xbc69('0x3'));var BPromise=require(_0xbc69('0x4'));var rp=require(_0xbc69('0x5'));var fs=require('fs');var path=require(_0xbc69('0x6'));var rimraf=require('rimraf');var config=require(_0xbc69('0x7'));var attributes=require(_0xbc69('0x8'));module[_0xbc69('0x9')]=function(_0x287b50,_0x2b1b53){return _0x287b50[_0xbc69('0xa')](_0xbc69('0xb'),attributes,{'tableName':_0xbc69('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd75d=['lodash','util','../../config/logger','api','bluebird','request-promise','path','exports','define','SquareMessage','square_messages'];(function(_0x2a3a1e,_0x23c7e7){var _0x3fb157=function(_0x329123){while(--_0x329123){_0x2a3a1e['push'](_0x2a3a1e['shift']());}};_0x3fb157(++_0x23c7e7);}(_0xd75d,0xe7));var _0xdd75=function(_0xd75381,_0x557296){_0xd75381=_0xd75381-0x0;var _0x20463a=_0xd75d[_0xd75381];return _0x20463a;};'use strict';var _=require(_0xdd75('0x0'));var util=require(_0xdd75('0x1'));var logger=require(_0xdd75('0x2'))(_0xdd75('0x3'));var moment=require('moment');var BPromise=require(_0xdd75('0x4'));var rp=require(_0xdd75('0x5'));var fs=require('fs');var path=require(_0xdd75('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0xdd75('0x7')]=function(_0x29f641,_0x14ad7d){return _0x29f641[_0xdd75('0x8')](_0xdd75('0x9'),attributes,{'tableName':_0xdd75('0xa'),'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 f97c352..851e8c8 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 _0x36b8=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','then','SquareMessage,\x20%s,\x20%s','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','CreateSquareMessage','create','body','options','raw','debug','lodash','util'];(function(_0x5becd6,_0x13e651){var _0x3b7b78=function(_0x2193b3){while(--_0x2193b3){_0x5becd6['push'](_0x5becd6['shift']());}};_0x3b7b78(++_0x13e651);}(_0x36b8,0x15c));var _0x836b=function(_0x3b03f4,_0xcc7c2a){_0x3b03f4=_0x3b03f4-0x0;var _0x219e0f=_0x36b8[_0x3b03f4];return _0x219e0f;};'use strict';var _=require(_0x836b('0x0'));var util=require(_0x836b('0x1'));var moment=require(_0x836b('0x2'));var BPromise=require('bluebird');var rs=require(_0x836b('0x3'));var fs=require('fs');var Redis=require(_0x836b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x836b('0x5'));var logger=require(_0x836b('0x6'))(_0x836b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x836b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c26d4,_0x351dc4,_0x38e4f8){return new BPromise(function(_0x4662c5,_0x557072){return client['request'](_0x2c26d4,_0x38e4f8)[_0x836b('0x9')](function(_0x2832a5){logger['info'](_0x836b('0xa'),_0x351dc4,'request\x20sent');logger['debug'](_0x836b('0xb'),_0x351dc4,_0x836b('0xc'),JSON[_0x836b('0xd')](_0x2832a5));if(_0x2832a5[_0x836b('0xe')]){if(_0x2832a5[_0x836b('0xe')][_0x836b('0xf')]===0x1f4){logger['error'](_0x836b('0xa'),_0x351dc4,_0x2832a5[_0x836b('0xe')][_0x836b('0x10')]);return _0x557072(_0x2832a5[_0x836b('0xe')][_0x836b('0x10')]);}logger[_0x836b('0xe')]('SquareMessage,\x20%s,\x20%s',_0x351dc4,_0x2832a5[_0x836b('0xe')][_0x836b('0x10')]);return _0x4662c5(_0x2832a5['error'][_0x836b('0x10')]);}else{logger[_0x836b('0x11')](_0x836b('0xa'),_0x351dc4,_0x836b('0xc'));_0x4662c5(_0x2832a5['result'][_0x836b('0x10')]);}})[_0x836b('0x12')](function(_0x33d5de){logger[_0x836b('0xe')]('SquareMessage,\x20%s,\x20%s',_0x351dc4,_0x33d5de);_0x557072(_0x33d5de);});});}exports[_0x836b('0x13')]=function(_0x3adf6f){var _0xed22c4=this;return new Promise(function(_0x34b3ff,_0x21a94d){return db['SquareMessage'][_0x836b('0x14')](_0x3adf6f[_0x836b('0x15')],{'raw':_0x3adf6f[_0x836b('0x16')]?_0x3adf6f[_0x836b('0x16')][_0x836b('0x17')]===undefined?!![]:![]:!![]})[_0x836b('0x9')](function(_0x291ae6){logger[_0x836b('0x11')](_0x836b('0x13'),_0x3adf6f);logger[_0x836b('0x18')](_0x836b('0x13'),_0x3adf6f,JSON[_0x836b('0xd')](_0x291ae6));_0x34b3ff(_0x291ae6);})[_0x836b('0x12')](function(_0x15c68d){logger[_0x836b('0xe')]('CreateSquareMessage',_0x15c68d['message'],_0x3adf6f);_0x21a94d(_0xed22c4[_0x836b('0xe')](0x1f4,_0x15c68d[_0x836b('0x10')]));});});}; \ No newline at end of file +var _0x42ea=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','SquareMessage','create','body','options','raw','CreateSquareMessage','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x15123f,_0x1522ea){var _0x17a280=function(_0x5a8c4){while(--_0x5a8c4){_0x15123f['push'](_0x15123f['shift']());}};_0x17a280(++_0x1522ea);}(_0x42ea,0x6e));var _0xa42e=function(_0x3a78e2,_0x4dbe20){_0x3a78e2=_0x3a78e2-0x0;var _0x2f80ea=_0x42ea[_0x3a78e2];return _0x2f80ea;};'use strict';var _=require(_0xa42e('0x0'));var util=require(_0xa42e('0x1'));var moment=require(_0xa42e('0x2'));var BPromise=require(_0xa42e('0x3'));var rs=require(_0xa42e('0x4'));var fs=require('fs');var Redis=require(_0xa42e('0x5'));var db=require(_0xa42e('0x6'))['db'];var utils=require(_0xa42e('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xa42e('0x8'));var jayson=require(_0xa42e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a98ac,_0x51cc74,_0x49770b){return new BPromise(function(_0x3cb995,_0x57bf07){return client[_0xa42e('0xa')](_0x1a98ac,_0x49770b)[_0xa42e('0xb')](function(_0x3a0408){logger[_0xa42e('0xc')](_0xa42e('0xd'),_0x51cc74,'request\x20sent');logger[_0xa42e('0xe')](_0xa42e('0xf'),_0x51cc74,_0xa42e('0x10'),JSON[_0xa42e('0x11')](_0x3a0408));if(_0x3a0408[_0xa42e('0x12')]){if(_0x3a0408[_0xa42e('0x12')][_0xa42e('0x13')]===0x1f4){logger[_0xa42e('0x12')](_0xa42e('0xd'),_0x51cc74,_0x3a0408[_0xa42e('0x12')][_0xa42e('0x14')]);return _0x57bf07(_0x3a0408[_0xa42e('0x12')]['message']);}logger[_0xa42e('0x12')](_0xa42e('0xd'),_0x51cc74,_0x3a0408[_0xa42e('0x12')][_0xa42e('0x14')]);return _0x3cb995(_0x3a0408['error'][_0xa42e('0x14')]);}else{logger[_0xa42e('0xc')]('SquareMessage,\x20%s,\x20%s',_0x51cc74,'request\x20sent');_0x3cb995(_0x3a0408[_0xa42e('0x15')][_0xa42e('0x14')]);}})['catch'](function(_0xd4b384){logger[_0xa42e('0x12')]('SquareMessage,\x20%s,\x20%s',_0x51cc74,_0xd4b384);_0x57bf07(_0xd4b384);});});}exports['CreateSquareMessage']=function(_0x4caf89){var _0x359c63=this;return new Promise(function(_0x42000c,_0x58d1dd){return db[_0xa42e('0x16')][_0xa42e('0x17')](_0x4caf89[_0xa42e('0x18')],{'raw':_0x4caf89[_0xa42e('0x19')]?_0x4caf89[_0xa42e('0x19')][_0xa42e('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4a7b43){logger[_0xa42e('0xc')](_0xa42e('0x1b'),_0x4caf89);logger[_0xa42e('0xe')](_0xa42e('0x1b'),_0x4caf89,JSON[_0xa42e('0x11')](_0x4a7b43));_0x42000c(_0x4a7b43);})[_0xa42e('0x1c')](function(_0x1348e2){logger[_0xa42e('0x12')](_0xa42e('0x1b'),_0x1348e2['message'],_0x4caf89);_0x58d1dd(_0x359c63[_0xa42e('0x12')](0x1f4,_0x1348e2[_0xa42e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 8be4263..a89ced1 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 _0x08bd=['isAuthenticated','index','/:id','show','/:id/test','15s','test','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get'];(function(_0x36d646,_0x50ecc5){var _0x2b37d6=function(_0x28e207){while(--_0x28e207){_0x36d646['push'](_0x36d646['shift']());}};_0x2b37d6(++_0x50ecc5);}(_0x08bd,0x166));var _0xd08b=function(_0x54930e,_0x20c135){_0x54930e=_0x54930e-0x0;var _0x3620b9=_0x08bd[_0x54930e];return _0x3620b9;};'use strict';var multer=require('multer');var util=require(_0xd08b('0x0'));var path=require(_0xd08b('0x1'));var timeout=require(_0xd08b('0x2'));var express=require(_0xd08b('0x3'));var router=express[_0xd08b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd08b('0x5'));var interaction=require(_0xd08b('0x6'));var config=require(_0xd08b('0x7'));var controller=require(_0xd08b('0x8'));router[_0xd08b('0x9')]('/',auth[_0xd08b('0xa')](),controller[_0xd08b('0xb')]);router[_0xd08b('0x9')](_0xd08b('0xc'),auth[_0xd08b('0xa')](),controller[_0xd08b('0xd')]);router[_0xd08b('0x9')](_0xd08b('0xe'),auth['isAuthenticated'](),timeout(_0xd08b('0xf')),controller[_0xd08b('0x10')]);router[_0xd08b('0x11')]('/',auth[_0xd08b('0xa')](),controller[_0xd08b('0x12')]);router['put']('/:id',auth[_0xd08b('0xa')](),controller[_0xd08b('0x13')]);router[_0xd08b('0x14')](_0xd08b('0xc'),auth[_0xd08b('0xa')](),controller[_0xd08b('0x15')]);module[_0xd08b('0x16')]=router; \ No newline at end of file +var _0x184d=['test','create','put','delete','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index','/:id','isAuthenticated','show','15s'];(function(_0xecefa6,_0x57a405){var _0x4b2147=function(_0x40baca){while(--_0x40baca){_0xecefa6['push'](_0xecefa6['shift']());}};_0x4b2147(++_0x57a405);}(_0x184d,0x191));var _0xd184=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x184d[_0x1589dd];return _0x1bddd1;};'use strict';var multer=require(_0xd184('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd184('0x1'));var express=require('express');var router=express[_0xd184('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd184('0x3'));var interaction=require(_0xd184('0x4'));var config=require(_0xd184('0x5'));var controller=require(_0xd184('0x6'));router[_0xd184('0x7')]('/',auth['isAuthenticated'](),controller[_0xd184('0x8')]);router[_0xd184('0x7')](_0xd184('0x9'),auth[_0xd184('0xa')](),controller[_0xd184('0xb')]);router[_0xd184('0x7')]('/:id/test',auth[_0xd184('0xa')](),timeout(_0xd184('0xc')),controller[_0xd184('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd184('0xe')]);router[_0xd184('0xf')]('/:id',auth[_0xd184('0xa')](),controller['update']);router[_0xd184('0x10')](_0xd184('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xd184('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 c0924ca..1083b8d 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 _0x539f=['sequelize','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x539f,0x19a));var _0xf539=function(_0x303c0d,_0xa898db){_0x303c0d=_0x303c0d-0x0;var _0x2d6dd5=_0x539f[_0x303c0d];return _0x2d6dd5;};'use strict';var Sequelize=require(_0xf539('0x0'));module['exports']={'name':{'type':Sequelize[_0xf539('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xf539('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd87c=['exports','STRING','name','sequelize'];(function(_0x272d8a,_0x45184b){var _0x26286e=function(_0x93beaa){while(--_0x93beaa){_0x272d8a['push'](_0x272d8a['shift']());}};_0x26286e(++_0x45184b);}(_0xd87c,0x18f));var _0xcd87=function(_0x1230f3,_0xd566cb){_0x1230f3=_0x1230f3-0x0;var _0x1b6b1f=_0xd87c[_0x1230f3];return _0x1b6b1f;};'use strict';var Sequelize=require(_0xcd87('0x0'));module[_0xcd87('0x1')]={'name':{'type':Sequelize[_0xcd87('0x2')],'unique':_0xcd87('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xcd87('0x2')]},'description':{'type':Sequelize[_0xcd87('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index c0146c3..11a3639 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 _0xb784=['model','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','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','test','dsn','odbc','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','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','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','get','ODBC','UserProfileResource','sendStatus','stack','name','index','map','SquareOdbc','fieldName','type','key','query','keys','filters','intersection','attributes'];(function(_0x15ab1e,_0x25be41){var _0x32e341=function(_0xdc2350){while(--_0xdc2350){_0x15ab1e['push'](_0x15ab1e['shift']());}};_0x32e341(++_0x25be41);}(_0xb784,0x189));var _0x4b78=function(_0x408eb3,_0x2fa671){_0x408eb3=_0x408eb3-0x0;var _0x4c7f39=_0xb784[_0x408eb3];return _0x4c7f39;};'use strict';var emlformat=require(_0x4b78('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b78('0x1'));var jsonpatch=require(_0x4b78('0x2'));var rp=require(_0x4b78('0x3'));var moment=require(_0x4b78('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4b78('0x5'));var util=require(_0x4b78('0x6'));var path=require(_0x4b78('0x7'));var sox=require('sox');var csv=require(_0x4b78('0x8'));var ejs=require(_0x4b78('0x9'));var fs=require('fs');var fs_extra=require(_0x4b78('0xa'));var _=require(_0x4b78('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4b78('0xc'));var deskjs=require(_0x4b78('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4b78('0xe'));var Papa=require(_0x4b78('0xf'));var Redis=require(_0x4b78('0x10'));var authService=require(_0x4b78('0x11'));var qs=require(_0x4b78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4b78('0x13'));var logger=require(_0x4b78('0x14'))(_0x4b78('0x15'));var utils=require(_0x4b78('0x16'));var config=require(_0x4b78('0x17'));var licenseUtil=require(_0x4b78('0x18'));var db=require(_0x4b78('0x19'))['db'];function respondWithStatusCode(_0x556ad1,_0x1ddb49){_0x1ddb49=_0x1ddb49||0xcc;return function(_0x45e623){if(_0x45e623){return _0x556ad1['sendStatus'](_0x1ddb49);}return _0x556ad1[_0x4b78('0x1a')](_0x1ddb49)[_0x4b78('0x1b')]();};}function respondWithResult(_0xfbb69,_0x550502){_0x550502=_0x550502||0xc8;return function(_0x3746be){if(_0x3746be){return _0xfbb69[_0x4b78('0x1a')](_0x550502)[_0x4b78('0x1c')](_0x3746be);}};}function respondWithFilteredResult(_0x26b551,_0x578c94){return function(_0x16428b){if(_0x16428b){var _0x5d6c4a=typeof _0x578c94['offset']==='undefined'&&typeof _0x578c94[_0x4b78('0x1d')]===_0x4b78('0x1e');var _0x72a4b6=_0x16428b[_0x4b78('0x1f')];var _0x35a3e6=_0x5d6c4a?0x0:_0x578c94['offset'];var _0x29fc43=_0x5d6c4a?_0x16428b[_0x4b78('0x1f')]:_0x578c94[_0x4b78('0x20')]+_0x578c94[_0x4b78('0x1d')];var _0x39370e;if(_0x29fc43>=_0x72a4b6){_0x29fc43=_0x72a4b6;_0x39370e=0xc8;}else{_0x39370e=0xce;}_0x26b551[_0x4b78('0x1a')](_0x39370e);return _0x26b551[_0x4b78('0x21')](_0x4b78('0x22'),_0x35a3e6+'-'+_0x29fc43+'/'+_0x72a4b6)['json'](_0x16428b);}return null;};}function patchUpdates(_0x459d35){return function(_0x2ad702){try{jsonpatch[_0x4b78('0x23')](_0x2ad702,_0x459d35,!![]);}catch(_0x4000eb){return BPromise['reject'](_0x4000eb);}return _0x2ad702[_0x4b78('0x24')]();};}function saveUpdates(_0x50256a,_0x56d72b){return function(_0x5874bd){if(_0x5874bd){return _0x5874bd[_0x4b78('0x25')](_0x50256a)[_0x4b78('0x26')](function(_0x2b4d26){return _0x2b4d26;});}return null;};}function removeEntity(_0x23c3ef,_0x525032){return function(_0x9ead2b){if(_0x9ead2b){return _0x9ead2b[_0x4b78('0x27')]()['then'](function(){var _0x8ebd0e=_0x9ead2b[_0x4b78('0x28')]({'plain':!![]});var _0x39d21c=_0x4b78('0x29');return db[_0x4b78('0x2a')][_0x4b78('0x27')]({'where':{'type':_0x39d21c,'resourceId':_0x8ebd0e['id']}})[_0x4b78('0x26')](function(){return _0x9ead2b;});})['then'](function(){_0x23c3ef['status'](0xcc)[_0x4b78('0x1b')]();});}};}function handleEntityNotFound(_0x208f7e,_0x320dd1){return function(_0x2ed26c){if(!_0x2ed26c){_0x208f7e[_0x4b78('0x2b')](0x194);}return _0x2ed26c;};}function handleError(_0x2a9cc7,_0x295bff){_0x295bff=_0x295bff||0x1f4;return function(_0x4d7d9e){logger['error'](_0x4d7d9e[_0x4b78('0x2c')]);if(_0x4d7d9e[_0x4b78('0x2d')]){delete _0x4d7d9e[_0x4b78('0x2d')];}_0x2a9cc7[_0x4b78('0x1a')](_0x295bff)['send'](_0x4d7d9e);};}exports[_0x4b78('0x2e')]=function(_0x59bf24,_0x6c3eae){var _0x271532={},_0x43138b={},_0x18a10b={'count':0x0,'rows':[]};var _0x1b25fe=_[_0x4b78('0x2f')](db[_0x4b78('0x30')]['rawAttributes'],function(_0x2a7395){return{'name':_0x2a7395[_0x4b78('0x31')],'type':_0x2a7395[_0x4b78('0x32')][_0x4b78('0x33')]};});_0x43138b['model']=_[_0x4b78('0x2f')](_0x1b25fe,_0x4b78('0x2d'));_0x43138b[_0x4b78('0x34')]=_[_0x4b78('0x35')](_0x59bf24[_0x4b78('0x34')]);_0x43138b[_0x4b78('0x36')]=_[_0x4b78('0x37')](_0x43138b['model'],_0x43138b[_0x4b78('0x34')]);_0x271532[_0x4b78('0x38')]=_[_0x4b78('0x37')](_0x43138b[_0x4b78('0x39')],qs[_0x4b78('0x3a')](_0x59bf24[_0x4b78('0x34')][_0x4b78('0x3a')]));_0x271532[_0x4b78('0x38')]=_0x271532[_0x4b78('0x38')][_0x4b78('0x3b')]?_0x271532[_0x4b78('0x38')]:_0x43138b[_0x4b78('0x39')];if(!_0x59bf24[_0x4b78('0x34')]['hasOwnProperty'](_0x4b78('0x3c'))){_0x271532[_0x4b78('0x1d')]=qs['limit'](_0x59bf24['query'][_0x4b78('0x1d')]);_0x271532[_0x4b78('0x20')]=qs[_0x4b78('0x20')](_0x59bf24[_0x4b78('0x34')][_0x4b78('0x20')]);}_0x271532[_0x4b78('0x3d')]=qs[_0x4b78('0x3e')](_0x59bf24[_0x4b78('0x34')][_0x4b78('0x3e')]);_0x271532[_0x4b78('0x3f')]=qs[_0x4b78('0x36')](_[_0x4b78('0x40')](_0x59bf24[_0x4b78('0x34')],_0x43138b[_0x4b78('0x36')]),_0x1b25fe);if(_0x59bf24[_0x4b78('0x34')][_0x4b78('0x41')]){_0x271532[_0x4b78('0x3f')]=_[_0x4b78('0x42')](_0x271532[_0x4b78('0x3f')],{'$or':_[_0x4b78('0x2f')](_0x1b25fe,function(_0x452bc9){if(_0x452bc9[_0x4b78('0x32')]!==_0x4b78('0x43')){var _0x2c50f2={};_0x2c50f2[_0x452bc9[_0x4b78('0x2d')]]={'$like':'%'+_0x59bf24[_0x4b78('0x34')]['filter']+'%'};return _0x2c50f2;}})});}_0x271532=_[_0x4b78('0x42')]({},_0x271532,_0x59bf24[_0x4b78('0x44')]);var _0x227de3={'where':_0x271532['where']};return db[_0x4b78('0x30')]['count'](_0x227de3)[_0x4b78('0x26')](function(_0x152525){_0x18a10b[_0x4b78('0x1f')]=_0x152525;if(_0x59bf24[_0x4b78('0x34')][_0x4b78('0x45')]){_0x271532[_0x4b78('0x46')]=[{'all':!![]}];}return db[_0x4b78('0x30')][_0x4b78('0x47')](_0x271532);})[_0x4b78('0x26')](function(_0x28af55){_0x18a10b[_0x4b78('0x48')]=_0x28af55;return _0x18a10b;})[_0x4b78('0x26')](respondWithFilteredResult(_0x6c3eae,_0x271532))[_0x4b78('0x49')](handleError(_0x6c3eae,null));};exports[_0x4b78('0x4a')]=function(_0x522b9f,_0x340ba1){var _0x53b6ce={'raw':!![],'where':{'id':_0x522b9f['params']['id']}},_0x1547ed={};_0x1547ed[_0x4b78('0x39')]=_['keys'](db['SquareOdbc'][_0x4b78('0x4b')]);_0x1547ed['query']=_[_0x4b78('0x35')](_0x522b9f['query']);_0x1547ed[_0x4b78('0x36')]=_[_0x4b78('0x37')](_0x1547ed['model'],_0x1547ed['query']);_0x53b6ce[_0x4b78('0x38')]=_[_0x4b78('0x37')](_0x1547ed[_0x4b78('0x39')],qs['fields'](_0x522b9f[_0x4b78('0x34')][_0x4b78('0x3a')]));_0x53b6ce[_0x4b78('0x38')]=_0x53b6ce[_0x4b78('0x38')][_0x4b78('0x3b')]?_0x53b6ce[_0x4b78('0x38')]:_0x1547ed[_0x4b78('0x39')];if(_0x522b9f['query'][_0x4b78('0x45')]){_0x53b6ce[_0x4b78('0x46')]=[{'all':!![]}];}_0x53b6ce=_[_0x4b78('0x42')]({},_0x53b6ce,_0x522b9f[_0x4b78('0x44')]);return db[_0x4b78('0x30')][_0x4b78('0x4c')](_0x53b6ce)[_0x4b78('0x26')](handleEntityNotFound(_0x340ba1,null))['then'](respondWithResult(_0x340ba1,null))[_0x4b78('0x49')](handleError(_0x340ba1,null));};exports[_0x4b78('0x4d')]=function(_0x27b076,_0x16ff5f){return db[_0x4b78('0x30')]['create'](_0x27b076[_0x4b78('0x4e')],{})['then'](function(_0x47c55f){var _0x243e0a=_0x27b076[_0x4b78('0x4f')][_0x4b78('0x28')]({'plain':!![]});if(!_0x243e0a)throw new Error(_0x4b78('0x50'));if(_0x243e0a[_0x4b78('0x51')]===_0x4b78('0x4f')){var _0x1c21a6=_0x47c55f[_0x4b78('0x28')]({'plain':!![]});var _0x3bda30=_0x4b78('0x29');return db[_0x4b78('0x52')][_0x4b78('0x4c')]({'where':{'name':_0x3bda30,'userProfileId':_0x243e0a[_0x4b78('0x53')]},'raw':!![]})['then'](function(_0x3d59ca){if(_0x3d59ca&&_0x3d59ca['autoAssociation']===0x0){return db['UserProfileResource'][_0x4b78('0x4d')]({'name':_0x1c21a6[_0x4b78('0x2d')],'resourceId':_0x1c21a6['id'],'type':_0x3d59ca[_0x4b78('0x2d')],'sectionId':_0x3d59ca['id']},{})['then'](function(){return _0x47c55f;});}else{return _0x47c55f;}})['catch'](function(_0x2e0574){logger['error'](_0x4b78('0x54'),_0x2e0574);throw _0x2e0574;});}return _0x47c55f;})['then'](respondWithResult(_0x16ff5f,0xc9))[_0x4b78('0x49')](handleError(_0x16ff5f,null));};exports[_0x4b78('0x25')]=function(_0x47db1a,_0x5158c3){if(_0x47db1a[_0x4b78('0x4e')]['id']){delete _0x47db1a[_0x4b78('0x4e')]['id'];}return db[_0x4b78('0x30')][_0x4b78('0x4c')]({'where':{'id':_0x47db1a[_0x4b78('0x55')]['id']}})[_0x4b78('0x26')](handleEntityNotFound(_0x5158c3,null))[_0x4b78('0x26')](saveUpdates(_0x47db1a[_0x4b78('0x4e')],null))[_0x4b78('0x26')](respondWithResult(_0x5158c3,null))['catch'](handleError(_0x5158c3,null));};exports['destroy']=function(_0x2954d0,_0x42ba7b){return db[_0x4b78('0x30')][_0x4b78('0x4c')]({'where':{'id':_0x2954d0[_0x4b78('0x55')]['id']}})[_0x4b78('0x26')](handleEntityNotFound(_0x42ba7b,null))[_0x4b78('0x26')](removeEntity(_0x42ba7b,null))[_0x4b78('0x49')](handleError(_0x42ba7b,null));};exports[_0x4b78('0x56')]=function(_0x20a238,_0x20f96e,_0x142fe2){var _0x10ec0f;return db[_0x4b78('0x30')][_0x4b78('0x4c')]({'where':{'id':_0x20a238[_0x4b78('0x55')]['id']},'attributes':['id',_0x4b78('0x57')]})[_0x4b78('0x26')](handleEntityNotFound(_0x20f96e,null))[_0x4b78('0x26')](function(_0x6cf01b){if(_0x6cf01b){var _0x382f11=require(_0x4b78('0x58'))();_0x382f11['openSync'](_0x6cf01b[_0x4b78('0x57')]);_0x382f11[_0x4b78('0x59')]();return _0x6cf01b;}})[_0x4b78('0x26')](respondWithResult(_0x20f96e,null))['catch'](handleError(_0x20f96e,null));}; \ No newline at end of file +var _0xa9ab=['update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','SquareOdbc','findAll','catch','params','keys','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','find','userProfileId','autoAssociation','dsn','odbc','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject'];(function(_0x79031b,_0x227b18){var _0x4f962a=function(_0x1a26ec){while(--_0x1a26ec){_0x79031b['push'](_0x79031b['shift']());}};_0x4f962a(++_0x227b18);}(_0xa9ab,0x81));var _0xba9a=function(_0x51b362,_0x2a3af3){_0x51b362=_0x51b362-0x0;var _0x18bd6=_0xa9ab[_0x51b362];return _0x18bd6;};'use strict';var emlformat=require(_0xba9a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba9a('0x1'));var jsonpatch=require(_0xba9a('0x2'));var rp=require(_0xba9a('0x3'));var moment=require('moment');var BPromise=require(_0xba9a('0x4'));var Mustache=require(_0xba9a('0x5'));var util=require(_0xba9a('0x6'));var path=require(_0xba9a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xba9a('0x8'));var fs=require('fs');var fs_extra=require(_0xba9a('0x9'));var _=require(_0xba9a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xba9a('0xb'));var deskjs=require(_0xba9a('0xc'));var toCsv=require(_0xba9a('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xba9a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xba9a('0xf'));var hardwareService=require(_0xba9a('0x10'));var logger=require(_0xba9a('0x11'))('api');var utils=require(_0xba9a('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xba9a('0x13'));var db=require(_0xba9a('0x14'))['db'];function respondWithStatusCode(_0x56634d,_0x24da91){_0x24da91=_0x24da91||0xcc;return function(_0x191359){if(_0x191359){return _0x56634d['sendStatus'](_0x24da91);}return _0x56634d[_0xba9a('0x15')](_0x24da91)[_0xba9a('0x16')]();};}function respondWithResult(_0x5fb1e5,_0x8ba5a7){_0x8ba5a7=_0x8ba5a7||0xc8;return function(_0x3de36a){if(_0x3de36a){return _0x5fb1e5[_0xba9a('0x15')](_0x8ba5a7)[_0xba9a('0x17')](_0x3de36a);}};}function respondWithFilteredResult(_0x2c7a73,_0x2687e0){return function(_0x131e70){if(_0x131e70){var _0x1de922=typeof _0x2687e0[_0xba9a('0x18')]===_0xba9a('0x19')&&typeof _0x2687e0['limit']===_0xba9a('0x19');var _0x1795ba=_0x131e70[_0xba9a('0x1a')];var _0x3d5eca=_0x1de922?0x0:_0x2687e0[_0xba9a('0x18')];var _0x1f6fe4=_0x1de922?_0x131e70[_0xba9a('0x1a')]:_0x2687e0['offset']+_0x2687e0[_0xba9a('0x1b')];var _0x5a6f32;if(_0x1f6fe4>=_0x1795ba){_0x1f6fe4=_0x1795ba;_0x5a6f32=0xc8;}else{_0x5a6f32=0xce;}_0x2c7a73[_0xba9a('0x15')](_0x5a6f32);return _0x2c7a73[_0xba9a('0x1c')](_0xba9a('0x1d'),_0x3d5eca+'-'+_0x1f6fe4+'/'+_0x1795ba)['json'](_0x131e70);}return null;};}function patchUpdates(_0x49f4ba){return function(_0x9d1bb4){try{jsonpatch['apply'](_0x9d1bb4,_0x49f4ba,!![]);}catch(_0x447263){return BPromise[_0xba9a('0x1e')](_0x447263);}return _0x9d1bb4['save']();};}function saveUpdates(_0x737eb7,_0x3a7c54){return function(_0x1d258c){if(_0x1d258c){return _0x1d258c[_0xba9a('0x1f')](_0x737eb7)[_0xba9a('0x20')](function(_0x4a5b8d){return _0x4a5b8d;});}return null;};}function removeEntity(_0x93a7f7,_0x2bbeb1){return function(_0x857048){if(_0x857048){return _0x857048[_0xba9a('0x21')]()[_0xba9a('0x20')](function(){var _0x5edfa5=_0x857048[_0xba9a('0x22')]({'plain':!![]});var _0x297164='ODBC';return db[_0xba9a('0x23')][_0xba9a('0x21')]({'where':{'type':_0x297164,'resourceId':_0x5edfa5['id']}})[_0xba9a('0x20')](function(){return _0x857048;});})[_0xba9a('0x20')](function(){_0x93a7f7[_0xba9a('0x15')](0xcc)[_0xba9a('0x16')]();});}};}function handleEntityNotFound(_0x3c824c,_0x18890e){return function(_0x5ad889){if(!_0x5ad889){_0x3c824c[_0xba9a('0x24')](0x194);}return _0x5ad889;};}function handleError(_0x4005bb,_0x1da085){_0x1da085=_0x1da085||0x1f4;return function(_0xc12989){logger[_0xba9a('0x25')](_0xc12989[_0xba9a('0x26')]);if(_0xc12989[_0xba9a('0x27')]){delete _0xc12989[_0xba9a('0x27')];}_0x4005bb[_0xba9a('0x15')](_0x1da085)[_0xba9a('0x28')](_0xc12989);};}exports[_0xba9a('0x29')]=function(_0x255c30,_0x23443c){var _0x554c7c={},_0x4da1d2={},_0x5617ff={'count':0x0,'rows':[]};var _0x194306=_[_0xba9a('0x2a')](db['SquareOdbc']['rawAttributes'],function(_0x115105){return{'name':_0x115105[_0xba9a('0x2b')],'type':_0x115105[_0xba9a('0x2c')][_0xba9a('0x2d')]};});_0x4da1d2[_0xba9a('0x2e')]=_[_0xba9a('0x2a')](_0x194306,_0xba9a('0x27'));_0x4da1d2[_0xba9a('0x2f')]=_['keys'](_0x255c30['query']);_0x4da1d2[_0xba9a('0x30')]=_[_0xba9a('0x31')](_0x4da1d2[_0xba9a('0x2e')],_0x4da1d2[_0xba9a('0x2f')]);_0x554c7c['attributes']=_['intersection'](_0x4da1d2[_0xba9a('0x2e')],qs[_0xba9a('0x32')](_0x255c30['query'][_0xba9a('0x32')]));_0x554c7c[_0xba9a('0x33')]=_0x554c7c['attributes'][_0xba9a('0x34')]?_0x554c7c['attributes']:_0x4da1d2[_0xba9a('0x2e')];if(!_0x255c30[_0xba9a('0x2f')]['hasOwnProperty'](_0xba9a('0x35'))){_0x554c7c[_0xba9a('0x1b')]=qs[_0xba9a('0x1b')](_0x255c30['query'][_0xba9a('0x1b')]);_0x554c7c[_0xba9a('0x18')]=qs[_0xba9a('0x18')](_0x255c30[_0xba9a('0x2f')]['offset']);}_0x554c7c[_0xba9a('0x36')]=qs['sort'](_0x255c30[_0xba9a('0x2f')]['sort']);_0x554c7c[_0xba9a('0x37')]=qs[_0xba9a('0x30')](_[_0xba9a('0x38')](_0x255c30[_0xba9a('0x2f')],_0x4da1d2[_0xba9a('0x30')]),_0x194306);if(_0x255c30[_0xba9a('0x2f')][_0xba9a('0x39')]){_0x554c7c['where']=_[_0xba9a('0x3a')](_0x554c7c['where'],{'$or':_[_0xba9a('0x2a')](_0x194306,function(_0x292b81){if(_0x292b81['type']!==_0xba9a('0x3b')){var _0x3c75f8={};_0x3c75f8[_0x292b81[_0xba9a('0x27')]]={'$like':'%'+_0x255c30[_0xba9a('0x2f')][_0xba9a('0x39')]+'%'};return _0x3c75f8;}})});}_0x554c7c=_['merge']({},_0x554c7c,_0x255c30['options']);var _0x252d3a={'where':_0x554c7c[_0xba9a('0x37')]};return db['SquareOdbc']['count'](_0x252d3a)['then'](function(_0x50c765){_0x5617ff['count']=_0x50c765;if(_0x255c30[_0xba9a('0x2f')][_0xba9a('0x3c')]){_0x554c7c[_0xba9a('0x3d')]=[{'all':!![]}];}return db[_0xba9a('0x3e')][_0xba9a('0x3f')](_0x554c7c);})[_0xba9a('0x20')](function(_0xb2b2f0){_0x5617ff['rows']=_0xb2b2f0;return _0x5617ff;})[_0xba9a('0x20')](respondWithFilteredResult(_0x23443c,_0x554c7c))[_0xba9a('0x40')](handleError(_0x23443c,null));};exports['show']=function(_0x19bfe1,_0x2ab95){var _0x2eac23={'raw':!![],'where':{'id':_0x19bfe1[_0xba9a('0x41')]['id']}},_0x1ee1c7={};_0x1ee1c7[_0xba9a('0x2e')]=_[_0xba9a('0x42')](db[_0xba9a('0x3e')][_0xba9a('0x43')]);_0x1ee1c7['query']=_[_0xba9a('0x42')](_0x19bfe1['query']);_0x1ee1c7[_0xba9a('0x30')]=_[_0xba9a('0x31')](_0x1ee1c7[_0xba9a('0x2e')],_0x1ee1c7[_0xba9a('0x2f')]);_0x2eac23[_0xba9a('0x33')]=_[_0xba9a('0x31')](_0x1ee1c7[_0xba9a('0x2e')],qs['fields'](_0x19bfe1[_0xba9a('0x2f')][_0xba9a('0x32')]));_0x2eac23['attributes']=_0x2eac23[_0xba9a('0x33')][_0xba9a('0x34')]?_0x2eac23['attributes']:_0x1ee1c7[_0xba9a('0x2e')];if(_0x19bfe1[_0xba9a('0x2f')]['includeAll']){_0x2eac23[_0xba9a('0x3d')]=[{'all':!![]}];}_0x2eac23=_[_0xba9a('0x3a')]({},_0x2eac23,_0x19bfe1[_0xba9a('0x44')]);return db[_0xba9a('0x3e')]['find'](_0x2eac23)[_0xba9a('0x20')](handleEntityNotFound(_0x2ab95,null))['then'](respondWithResult(_0x2ab95,null))[_0xba9a('0x40')](handleError(_0x2ab95,null));};exports[_0xba9a('0x45')]=function(_0x3fb774,_0x39948d){return db[_0xba9a('0x3e')][_0xba9a('0x45')](_0x3fb774[_0xba9a('0x46')],{})[_0xba9a('0x20')](function(_0x1bcbc9){var _0x321a35=_0x3fb774[_0xba9a('0x47')][_0xba9a('0x22')]({'plain':!![]});if(!_0x321a35)throw new Error(_0xba9a('0x48'));if(_0x321a35[_0xba9a('0x49')]===_0xba9a('0x47')){var _0x19dc61=_0x1bcbc9[_0xba9a('0x22')]({'plain':!![]});var _0x3fcd32=_0xba9a('0x4a');return db['UserProfileSection'][_0xba9a('0x4b')]({'where':{'name':_0x3fcd32,'userProfileId':_0x321a35[_0xba9a('0x4c')]},'raw':!![]})['then'](function(_0x5d6e6f){if(_0x5d6e6f&&_0x5d6e6f[_0xba9a('0x4d')]===0x0){return db['UserProfileResource'][_0xba9a('0x45')]({'name':_0x19dc61['name'],'resourceId':_0x19dc61['id'],'type':_0x5d6e6f[_0xba9a('0x27')],'sectionId':_0x5d6e6f['id']},{})['then'](function(){return _0x1bcbc9;});}else{return _0x1bcbc9;}})[_0xba9a('0x40')](function(_0x225e62){logger[_0xba9a('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x225e62);throw _0x225e62;});}return _0x1bcbc9;})['then'](respondWithResult(_0x39948d,0xc9))[_0xba9a('0x40')](handleError(_0x39948d,null));};exports[_0xba9a('0x1f')]=function(_0x1afada,_0x4d9224){if(_0x1afada[_0xba9a('0x46')]['id']){delete _0x1afada[_0xba9a('0x46')]['id'];}return db['SquareOdbc'][_0xba9a('0x4b')]({'where':{'id':_0x1afada['params']['id']}})[_0xba9a('0x20')](handleEntityNotFound(_0x4d9224,null))[_0xba9a('0x20')](saveUpdates(_0x1afada[_0xba9a('0x46')],null))[_0xba9a('0x20')](respondWithResult(_0x4d9224,null))[_0xba9a('0x40')](handleError(_0x4d9224,null));};exports[_0xba9a('0x21')]=function(_0x3e58d6,_0x3fcf78){return db['SquareOdbc']['find']({'where':{'id':_0x3e58d6[_0xba9a('0x41')]['id']}})[_0xba9a('0x20')](handleEntityNotFound(_0x3fcf78,null))[_0xba9a('0x20')](removeEntity(_0x3fcf78,null))[_0xba9a('0x40')](handleError(_0x3fcf78,null));};exports['test']=function(_0x2fce3b,_0x3b5f9e,_0x1ab5a2){var _0x4ffe5b;return db[_0xba9a('0x3e')][_0xba9a('0x4b')]({'where':{'id':_0x2fce3b['params']['id']},'attributes':['id',_0xba9a('0x4e')]})[_0xba9a('0x20')](handleEntityNotFound(_0x3b5f9e,null))[_0xba9a('0x20')](function(_0x1a27f9){if(_0x1a27f9){var _0x1b2708=require(_0xba9a('0x4f'))();_0x1b2708['openSync'](_0x1a27f9['dsn']);_0x1b2708['closeSync']();return _0x1a27f9;}})[_0xba9a('0x20')](respondWithResult(_0x3b5f9e,null))['catch'](handleError(_0x3b5f9e,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 974033b..f3ef3d1 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 _0x01c9=['request-promise','rimraf','../../config/environment','./squareOdbc.attributes','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3a04ab,_0x31b9fd){var _0x4bff6d=function(_0x125f7e){while(--_0x125f7e){_0x3a04ab['push'](_0x3a04ab['shift']());}};_0x4bff6d(++_0x31b9fd);}(_0x01c9,0x7f));var _0x901c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x01c9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x901c('0x0'));var util=require(_0x901c('0x1'));var logger=require(_0x901c('0x2'))('api');var moment=require(_0x901c('0x3'));var BPromise=require(_0x901c('0x4'));var rp=require(_0x901c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x901c('0x6'));var config=require(_0x901c('0x7'));var attributes=require(_0x901c('0x8'));module['exports']=function(_0x566824,_0x1505d9){return _0x566824[_0x901c('0x9')](_0x901c('0xa'),attributes,{'tableName':_0x901c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b1f=['lodash','../../config/logger','api','path','rimraf','../../config/environment','exports','define'];(function(_0x1c43aa,_0xff2696){var _0x514c3c=function(_0x3afbf0){while(--_0x3afbf0){_0x1c43aa['push'](_0x1c43aa['shift']());}};_0x514c3c(++_0xff2696);}(_0x2b1f,0x1b8));var _0xf2b1=function(_0x30bd01,_0x557a2c){_0x30bd01=_0x30bd01-0x0;var _0x44cdc3=_0x2b1f[_0x30bd01];return _0x44cdc3;};'use strict';var _=require(_0xf2b1('0x0'));var util=require('util');var logger=require(_0xf2b1('0x1'))(_0xf2b1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2b1('0x3'));var rimraf=require(_0xf2b1('0x4'));var config=require(_0xf2b1('0x5'));var attributes=require('./squareOdbc.attributes');module[_0xf2b1('0x6')]=function(_0x4bd417,_0x59d086){return _0x4bd417[_0xf2b1('0x7')]('SquareOdbc',attributes,{'tableName':'square_odbc','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 3ae9430..7e1fb64 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 _0x6463=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','options','raw','where','attributes','include','map','model','stringify','lodash','util','moment'];(function(_0x2bb813,_0x111e9a){var _0x32d126=function(_0x142e51){while(--_0x142e51){_0x2bb813['push'](_0x2bb813['shift']());}};_0x32d126(++_0x111e9a);}(_0x6463,0xbd));var _0x3646=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6463[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3646('0x0'));var util=require(_0x3646('0x1'));var moment=require(_0x3646('0x2'));var BPromise=require(_0x3646('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3646('0x4'));var db=require(_0x3646('0x5'))['db'];var utils=require(_0x3646('0x6'));var logger=require('../../config/logger')(_0x3646('0x7'));var config=require('../../config/environment');var jayson=require(_0x3646('0x8'));var client=jayson[_0x3646('0x9')][_0x3646('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50b6e5,_0x48efdb,_0x595304){return new BPromise(function(_0x1c1ad3,_0x2526c5){return client[_0x3646('0xb')](_0x50b6e5,_0x595304)[_0x3646('0xc')](function(_0x456431){logger[_0x3646('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x48efdb,_0x3646('0xe'));logger[_0x3646('0xf')](_0x3646('0x10'),_0x48efdb,_0x3646('0xe'),JSON['stringify'](_0x456431));if(_0x456431['error']){if(_0x456431[_0x3646('0x11')][_0x3646('0x12')]===0x1f4){logger[_0x3646('0x11')](_0x3646('0x13'),_0x48efdb,_0x456431[_0x3646('0x11')][_0x3646('0x14')]);return _0x2526c5(_0x456431['error']['message']);}logger[_0x3646('0x11')](_0x3646('0x13'),_0x48efdb,_0x456431[_0x3646('0x11')]['message']);return _0x1c1ad3(_0x456431[_0x3646('0x11')]['message']);}else{logger[_0x3646('0xd')](_0x3646('0x13'),_0x48efdb,'request\x20sent');_0x1c1ad3(_0x456431[_0x3646('0x15')][_0x3646('0x14')]);}})[_0x3646('0x16')](function(_0x2ec02c){logger[_0x3646('0x11')](_0x3646('0x13'),_0x48efdb,_0x2ec02c);_0x2526c5(_0x2ec02c);});});}exports[_0x3646('0x17')]=function(_0x49f120){var _0x26986f=this;return new Promise(function(_0x1108ca,_0x39165d){return db['SquareOdbc']['find']({'raw':_0x49f120[_0x3646('0x18')]?_0x49f120[_0x3646('0x18')][_0x3646('0x19')]===undefined?!![]:![]:!![],'where':_0x49f120['options']?_0x49f120[_0x3646('0x18')][_0x3646('0x1a')]||null:null,'attributes':_0x49f120[_0x3646('0x18')]?_0x49f120[_0x3646('0x18')][_0x3646('0x1b')]||null:null,'include':_0x49f120['options']?_0x49f120[_0x3646('0x18')][_0x3646('0x1c')]?_[_0x3646('0x1d')](_0x49f120[_0x3646('0x18')][_0x3646('0x1c')],function(_0x3c0ea8){return{'model':db[_0x3c0ea8[_0x3646('0x1e')]],'as':_0x3c0ea8['as'],'attributes':_0x3c0ea8[_0x3646('0x1b')],'include':_0x3c0ea8[_0x3646('0x1c')]?_[_0x3646('0x1d')](_0x3c0ea8['include'],function(_0x4ccc6c){return{'model':db[_0x4ccc6c['model']],'as':_0x4ccc6c['as'],'attributes':_0x4ccc6c[_0x3646('0x1b')],'include':_0x4ccc6c[_0x3646('0x1c')]?_[_0x3646('0x1d')](_0x4ccc6c['include'],function(_0x3e524b){return{'model':db[_0x3e524b['model']],'as':_0x3e524b['as'],'attributes':_0x3e524b[_0x3646('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3646('0xc')](function(_0x35c8cf){logger[_0x3646('0xd')]('ShowSquareOdbc',_0x49f120);logger[_0x3646('0xf')]('ShowSquareOdbc',_0x49f120,JSON[_0x3646('0x1f')](_0x35c8cf));_0x1108ca(_0x35c8cf);})[_0x3646('0x16')](function(_0xe30c60){logger[_0x3646('0x11')](_0x3646('0x17'),_0xe30c60[_0x3646('0x14')],_0x49f120);_0x39165d(_0x26986f['error'](0x1f4,_0xe30c60['message']));});});}; \ No newline at end of file +var _0xd8d6=['message','catch','SquareOdbc','options','where','include','map','model','attributes','ShowSquareOdbc','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1eb9fa,_0x18abb6){var _0x5780da=function(_0x36ccfe){while(--_0x36ccfe){_0x1eb9fa['push'](_0x1eb9fa['shift']());}};_0x5780da(++_0x18abb6);}(_0xd8d6,0xb2));var _0x6d8d=function(_0x104d4d,_0x59a530){_0x104d4d=_0x104d4d-0x0;var _0x450b41=_0xd8d6[_0x104d4d];return _0x450b41;};'use strict';var _=require(_0x6d8d('0x0'));var util=require('util');var moment=require(_0x6d8d('0x1'));var BPromise=require('bluebird');var rs=require(_0x6d8d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d8d('0x3'))['db'];var utils=require(_0x6d8d('0x4'));var logger=require(_0x6d8d('0x5'))(_0x6d8d('0x6'));var config=require(_0x6d8d('0x7'));var jayson=require(_0x6d8d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x261e49,_0x38b69d,_0x4b5b79){return new BPromise(function(_0x1f41ae,_0x4d5cbc){return client[_0x6d8d('0x9')](_0x261e49,_0x4b5b79)[_0x6d8d('0xa')](function(_0x2f48d2){logger[_0x6d8d('0xb')](_0x6d8d('0xc'),_0x38b69d,_0x6d8d('0xd'));logger[_0x6d8d('0xe')](_0x6d8d('0xf'),_0x38b69d,_0x6d8d('0xd'),JSON[_0x6d8d('0x10')](_0x2f48d2));if(_0x2f48d2[_0x6d8d('0x11')]){if(_0x2f48d2[_0x6d8d('0x11')]['code']===0x1f4){logger[_0x6d8d('0x11')](_0x6d8d('0xc'),_0x38b69d,_0x2f48d2[_0x6d8d('0x11')]['message']);return _0x4d5cbc(_0x2f48d2[_0x6d8d('0x11')][_0x6d8d('0x12')]);}logger['error'](_0x6d8d('0xc'),_0x38b69d,_0x2f48d2[_0x6d8d('0x11')][_0x6d8d('0x12')]);return _0x1f41ae(_0x2f48d2[_0x6d8d('0x11')]['message']);}else{logger[_0x6d8d('0xb')](_0x6d8d('0xc'),_0x38b69d,_0x6d8d('0xd'));_0x1f41ae(_0x2f48d2['result'][_0x6d8d('0x12')]);}})[_0x6d8d('0x13')](function(_0x2e2e9f){logger[_0x6d8d('0x11')](_0x6d8d('0xc'),_0x38b69d,_0x2e2e9f);_0x4d5cbc(_0x2e2e9f);});});}exports['ShowSquareOdbc']=function(_0x9def22){var _0x5e1740=this;return new Promise(function(_0x16b590,_0x4a50b8){return db[_0x6d8d('0x14')]['find']({'raw':_0x9def22[_0x6d8d('0x15')]?_0x9def22['options']['raw']===undefined?!![]:![]:!![],'where':_0x9def22[_0x6d8d('0x15')]?_0x9def22[_0x6d8d('0x15')][_0x6d8d('0x16')]||null:null,'attributes':_0x9def22[_0x6d8d('0x15')]?_0x9def22[_0x6d8d('0x15')]['attributes']||null:null,'include':_0x9def22[_0x6d8d('0x15')]?_0x9def22['options'][_0x6d8d('0x17')]?_[_0x6d8d('0x18')](_0x9def22[_0x6d8d('0x15')][_0x6d8d('0x17')],function(_0x89d7d1){return{'model':db[_0x89d7d1[_0x6d8d('0x19')]],'as':_0x89d7d1['as'],'attributes':_0x89d7d1[_0x6d8d('0x1a')],'include':_0x89d7d1[_0x6d8d('0x17')]?_[_0x6d8d('0x18')](_0x89d7d1[_0x6d8d('0x17')],function(_0x1bc9c9){return{'model':db[_0x1bc9c9[_0x6d8d('0x19')]],'as':_0x1bc9c9['as'],'attributes':_0x1bc9c9[_0x6d8d('0x1a')],'include':_0x1bc9c9['include']?_[_0x6d8d('0x18')](_0x1bc9c9[_0x6d8d('0x17')],function(_0x288b95){return{'model':db[_0x288b95[_0x6d8d('0x19')]],'as':_0x288b95['as'],'attributes':_0x288b95['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e1dfb){logger[_0x6d8d('0xb')](_0x6d8d('0x1b'),_0x9def22);logger[_0x6d8d('0xe')]('ShowSquareOdbc',_0x9def22,JSON[_0x6d8d('0x10')](_0x2e1dfb));_0x16b590(_0x2e1dfb);})[_0x6d8d('0x13')](function(_0x3c1e61){logger[_0x6d8d('0x11')](_0x6d8d('0x1b'),_0x3c1e61[_0x6d8d('0x12')],_0x9def22);_0x4a50b8(_0x5e1740[_0x6d8d('0x11')](0x1f4,_0x3c1e61['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 060f6fb..2b56610 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 _0xbda2=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x30228c,_0x39a8f3){var _0x4a4c1d=function(_0x1aaec8){while(--_0x1aaec8){_0x30228c['push'](_0x30228c['shift']());}};_0x4a4c1d(++_0x39a8f3);}(_0xbda2,0x1d8));var _0x2bda=function(_0x4761af,_0x1ffd8d){_0x4761af=_0x4761af-0x0;var _0x1ad254=_0xbda2[_0x4761af];return _0x1ad254;};'use strict';var multer=require(_0x2bda('0x0'));var util=require(_0x2bda('0x1'));var path=require('path');var timeout=require(_0x2bda('0x2'));var express=require(_0x2bda('0x3'));var router=express[_0x2bda('0x4')]();var fs_extra=require(_0x2bda('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2bda('0x6'));var config=require(_0x2bda('0x7'));var controller=require('./squareProject.controller');router[_0x2bda('0x8')]('/',auth[_0x2bda('0x9')](),controller[_0x2bda('0xa')]);router[_0x2bda('0x8')](_0x2bda('0xb'),auth[_0x2bda('0x9')](),controller[_0x2bda('0xc')]);router[_0x2bda('0xd')]('/',auth[_0x2bda('0x9')](),controller[_0x2bda('0xe')]);router[_0x2bda('0xf')]('/:id',auth[_0x2bda('0x9')](),controller[_0x2bda('0x10')]);router[_0x2bda('0x11')](_0x2bda('0xb'),auth['isAuthenticated'](),controller[_0x2bda('0x12')]);module[_0x2bda('0x13')]=router; \ No newline at end of file +var _0x5d3b=['../../components/interaction/service','../../config/environment','./squareProject.controller','get','index','isAuthenticated','show','post','create','put','/:id','exports','multer','util','path','express','fs-extra'];(function(_0x542688,_0x1033e5){var _0x5b1273=function(_0x34fb5a){while(--_0x34fb5a){_0x542688['push'](_0x542688['shift']());}};_0x5b1273(++_0x1033e5);}(_0x5d3b,0xa5));var _0xb5d3=function(_0x5ec9db,_0x4f051e){_0x5ec9db=_0x5ec9db-0x0;var _0xfc7061=_0x5d3b[_0x5ec9db];return _0xfc7061;};'use strict';var multer=require(_0xb5d3('0x0'));var util=require(_0xb5d3('0x1'));var path=require(_0xb5d3('0x2'));var timeout=require('connect-timeout');var express=require(_0xb5d3('0x3'));var router=express['Router']();var fs_extra=require(_0xb5d3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb5d3('0x5'));var config=require(_0xb5d3('0x6'));var controller=require(_0xb5d3('0x7'));router[_0xb5d3('0x8')]('/',auth['isAuthenticated'](),controller[_0xb5d3('0x9')]);router[_0xb5d3('0x8')]('/:id',auth[_0xb5d3('0xa')](),controller[_0xb5d3('0xb')]);router[_0xb5d3('0xc')]('/',auth[_0xb5d3('0xa')](),controller[_0xb5d3('0xd')]);router[_0xb5d3('0xe')](_0xb5d3('0xf'),auth[_0xb5d3('0xa')](),controller['update']);router['delete'](_0xb5d3('0xf'),auth[_0xb5d3('0xa')](),controller['destroy']);module[_0xb5d3('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index e320d6a..4527e4b 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 _0x251b=['sequelize','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE'];(function(_0x1bf99a,_0x3ed9c0){var _0x3aa1ab=function(_0x457a15){while(--_0x457a15){_0x1bf99a['push'](_0x1bf99a['shift']());}};_0x3aa1ab(++_0x3ed9c0);}(_0x251b,0xcc));var _0xb251=function(_0x5e6bec,_0x1eb54d){_0x5e6bec=_0x5e6bec-0x0;var _0x5dc5cf=_0x251b[_0x5e6bec];return _0x5dc5cf;};'use strict';var Sequelize=require(_0xb251('0x0'));module['exports']={'name':{'type':Sequelize[_0xb251('0x1')],'unique':_0xb251('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xb251('0x1')]},'notes':{'type':Sequelize[_0xb251('0x3')]},'preproduction':{'type':Sequelize[_0xb251('0x4')](_0xb251('0x5')),'get':function(){if(this[_0xb251('0x6')](_0xb251('0x7'))){return this[_0xb251('0x6')](_0xb251('0x7'))[_0xb251('0x8')](_0xb251('0x9'));}}},'production':{'type':Sequelize[_0xb251('0x4')](_0xb251('0x5')),'get':function(){if(this[_0xb251('0x6')](_0xb251('0xa'))){return this[_0xb251('0x6')](_0xb251('0xa'))[_0xb251('0x8')](_0xb251('0x9'));}}},'savedAt':{'type':Sequelize[_0xb251('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xcfb8=['toString','BLOB','production','utf8','DATE','sequelize','exports','name','STRING','long','preproduction','getDataValue'];(function(_0x49b74f,_0x259681){var _0x52fdb1=function(_0x27047c){while(--_0x27047c){_0x49b74f['push'](_0x49b74f['shift']());}};_0x52fdb1(++_0x259681);}(_0xcfb8,0x1c1));var _0x8cfb=function(_0x506d28,_0xaff916){_0x506d28=_0x506d28-0x0;var _0x20145f=_0xcfb8[_0x506d28];return _0x20145f;};'use strict';var Sequelize=require(_0x8cfb('0x0'));module[_0x8cfb('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8cfb('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x8cfb('0x3')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB'](_0x8cfb('0x4')),'get':function(){if(this['getDataValue'](_0x8cfb('0x5'))){return this[_0x8cfb('0x6')](_0x8cfb('0x5'))[_0x8cfb('0x7')]('utf8');}}},'production':{'type':Sequelize[_0x8cfb('0x8')](_0x8cfb('0x4')),'get':function(){if(this['getDataValue'](_0x8cfb('0x9'))){return this[_0x8cfb('0x6')]('production')[_0x8cfb('0x7')](_0x8cfb('0xa'));}}},'savedAt':{'type':Sequelize[_0x8cfb('0xb')]},'publishedAt':{'type':Sequelize[_0x8cfb('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 47da385..5493792 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 _0x198d=['include','findAll','rows','catch','rawAttributes','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','lodash','ioredis','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','json','undefined','limit','offset','count','set','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','stringify','error','stack','name','send','index','map','SquareProject','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll'];(function(_0x19a74b,_0x4cd4f2){var _0x436d29=function(_0x426574){while(--_0x426574){_0x19a74b['push'](_0x19a74b['shift']());}};_0x436d29(++_0x4cd4f2);}(_0x198d,0x114));var _0xd198=function(_0x40dfc1,_0x240d44){_0x40dfc1=_0x40dfc1-0x0;var _0x401d35=_0x198d[_0x40dfc1];return _0x401d35;};'use strict';var _=require(_0xd198('0x0'));var Redis=require(_0xd198('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0xd198('0x2'));var db=require(_0xd198('0x3'))['db'];config[_0xd198('0x4')]=_['defaults'](config[_0xd198('0x4')],{'host':_0xd198('0x5'),'port':0x18eb});var socket=require(_0xd198('0x6'))(new Redis(config[_0xd198('0x4')]));require(_0xd198('0x7'))[_0xd198('0x8')](socket);function respondWithResult(_0x188cbd,_0x1058be){_0x1058be=_0x1058be||0xc8;return function(_0x33a21e){if(_0x33a21e){return _0x188cbd[_0xd198('0x9')](_0x1058be)[_0xd198('0xa')](_0x33a21e);}};}function respondWithFilteredResult(_0x16a367,_0x48db94){return function(_0xe46bdc){if(_0xe46bdc){var _0x5656a3=typeof _0x48db94['offset']===_0xd198('0xb')&&typeof _0x48db94[_0xd198('0xc')]===_0xd198('0xb');var _0x749706=_0xe46bdc['count'];var _0x4a55c5=_0x5656a3?0x0:_0x48db94[_0xd198('0xd')];var _0x341085=_0x5656a3?_0xe46bdc[_0xd198('0xe')]:_0x48db94[_0xd198('0xd')]+_0x48db94['limit'];var _0x1f676b;if(_0x341085>=_0x749706){_0x341085=_0x749706;_0x1f676b=0xc8;}else{_0x1f676b=0xce;}_0x16a367['status'](_0x1f676b);return _0x16a367[_0xd198('0xf')]('Content-Range',_0x4a55c5+'-'+_0x341085+'/'+_0x749706)[_0xd198('0xa')](_0xe46bdc);}return null;};}function saveUpdates(_0x40ecd9){return function(_0x2e6d7f){if(_0x2e6d7f){return _0x2e6d7f[_0xd198('0x10')](_0x40ecd9)[_0xd198('0x11')](function(_0x32eba3){return _0x32eba3;});}return null;};}function removeEntity(_0xaab4c6){return function(_0x3cee7d){if(_0x3cee7d){return _0x3cee7d[_0xd198('0x12')]()['then'](function(){var _0x3d71f7=_0x3cee7d[_0xd198('0x13')]({'plain':!![]});var _0x3f7671=_0xd198('0x14');return db[_0xd198('0x15')][_0xd198('0x12')]({'where':{'type':_0x3f7671,'resourceId':_0x3d71f7['id']}})[_0xd198('0x11')](function(){return _0x3cee7d;});})['then'](function(){var _0x5483c4=new Redis(config[_0xd198('0x4')]);_0x5483c4[_0xd198('0x16')](_0xd198('0x17'),JSON[_0xd198('0x18')]({'id':_0x3cee7d['id'],'deleted':!![]}));})['then'](function(){_0xaab4c6[_0xd198('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a3214){return function(_0x51d476){if(!_0x51d476){_0x4a3214['sendStatus'](0x194);}return _0x51d476;};}function handleError(_0x3ce890,_0x12890e){_0x12890e=_0x12890e||0x1f4;return function(_0x1af791){logger[_0xd198('0x19')](_0x1af791[_0xd198('0x1a')]);if(_0x1af791[_0xd198('0x1b')]){delete _0x1af791[_0xd198('0x1b')];}_0x3ce890[_0xd198('0x9')](_0x12890e)[_0xd198('0x1c')](_0x1af791);};}exports[_0xd198('0x1d')]=function(_0x4b0d74,_0x311d2a){var _0x478257={},_0x3e4cce={},_0x2a155f={'count':0x0,'rows':[]};var _0x57a0a4=_[_0xd198('0x1e')](db[_0xd198('0x1f')]['rawAttributes'],function(_0x4d8468){return{'name':_0x4d8468['fieldName'],'type':_0x4d8468[_0xd198('0x20')][_0xd198('0x21')]};});_0x3e4cce[_0xd198('0x22')]=_[_0xd198('0x1e')](_0x57a0a4,_0xd198('0x1b'));_0x3e4cce[_0xd198('0x23')]=_[_0xd198('0x24')](_0x4b0d74['query']);_0x3e4cce[_0xd198('0x25')]=_[_0xd198('0x26')](_0x3e4cce[_0xd198('0x22')],_0x3e4cce[_0xd198('0x23')]);_0x478257[_0xd198('0x27')]=_[_0xd198('0x26')](_0x3e4cce['model'],qs[_0xd198('0x28')](_0x4b0d74[_0xd198('0x23')][_0xd198('0x28')]));_0x478257[_0xd198('0x27')]=_0x478257[_0xd198('0x27')]['length']?_0x478257[_0xd198('0x27')]:_0x3e4cce[_0xd198('0x22')];if(!_0x4b0d74[_0xd198('0x23')]['hasOwnProperty'](_0xd198('0x29'))){_0x478257['limit']=qs[_0xd198('0xc')](_0x4b0d74[_0xd198('0x23')][_0xd198('0xc')]);_0x478257[_0xd198('0xd')]=qs[_0xd198('0xd')](_0x4b0d74['query']['offset']);}_0x478257['order']=qs[_0xd198('0x2a')](_0x4b0d74[_0xd198('0x23')][_0xd198('0x2a')]);_0x478257[_0xd198('0x2b')]=qs[_0xd198('0x25')](_[_0xd198('0x2c')](_0x4b0d74[_0xd198('0x23')],_0x3e4cce[_0xd198('0x25')]),_0x57a0a4);if(_0x4b0d74['query']['filter']){_0x478257[_0xd198('0x2b')]=_[_0xd198('0x2d')](_0x478257['where'],{'$or':_[_0xd198('0x1e')](_0x57a0a4,function(_0x3a53c0){if(_0x3a53c0[_0xd198('0x20')]!==_0xd198('0x2e')){var _0xaf43d7={};_0xaf43d7[_0x3a53c0['name']]={'$like':'%'+_0x4b0d74[_0xd198('0x23')][_0xd198('0x2f')]+'%'};return _0xaf43d7;}})});}_0x478257=_[_0xd198('0x2d')]({},_0x478257,_0x4b0d74['options']);var _0x4aca7b={'where':_0x478257[_0xd198('0x2b')]};return db[_0xd198('0x1f')]['count'](_0x4aca7b)[_0xd198('0x11')](function(_0x169e0c){_0x2a155f['count']=_0x169e0c;if(_0x4b0d74['query'][_0xd198('0x30')]){_0x478257[_0xd198('0x31')]=[{'all':!![]}];}return db[_0xd198('0x1f')][_0xd198('0x32')](_0x478257);})[_0xd198('0x11')](function(_0x14c072){_0x2a155f[_0xd198('0x33')]=_0x14c072;return _0x2a155f;})['then'](respondWithFilteredResult(_0x311d2a,_0x478257))[_0xd198('0x34')](handleError(_0x311d2a,null));};exports['show']=function(_0xe272e4,_0x3e8ca0){var _0x4f6912={'raw':![],'where':{'id':_0xe272e4['params']['id']}},_0x391ec2={};_0x391ec2[_0xd198('0x22')]=_[_0xd198('0x24')](db[_0xd198('0x1f')][_0xd198('0x35')]);_0x391ec2['query']=_[_0xd198('0x24')](_0xe272e4[_0xd198('0x23')]);_0x391ec2[_0xd198('0x25')]=_[_0xd198('0x26')](_0x391ec2[_0xd198('0x22')],_0x391ec2['query']);_0x4f6912[_0xd198('0x27')]=_[_0xd198('0x26')](_0x391ec2[_0xd198('0x22')],qs[_0xd198('0x28')](_0xe272e4[_0xd198('0x23')]['fields']));_0x4f6912[_0xd198('0x27')]=_0x4f6912[_0xd198('0x27')][_0xd198('0x36')]?_0x4f6912['attributes']:_0x391ec2[_0xd198('0x22')];if(_0xe272e4['query']['includeAll']){_0x4f6912[_0xd198('0x31')]=[{'all':!![]}];}_0x4f6912=_[_0xd198('0x2d')]({},_0x4f6912,_0xe272e4[_0xd198('0x37')]);return db[_0xd198('0x1f')]['find'](_0x4f6912)[_0xd198('0x11')](handleEntityNotFound(_0x3e8ca0,null))[_0xd198('0x11')](respondWithResult(_0x3e8ca0,null))['catch'](handleError(_0x3e8ca0,null));};exports[_0xd198('0x38')]=function(_0x11833f,_0x52899d){return db['SquareProject'][_0xd198('0x38')](_0x11833f[_0xd198('0x39')],{})[_0xd198('0x11')](function(_0x2058d5){var _0x4e1efa=_0x11833f[_0xd198('0x3a')][_0xd198('0x13')]({'plain':!![]});if(!_0x4e1efa)throw new Error(_0xd198('0x3b'));if(_0x4e1efa['role']==='user'){var _0x469169=_0x2058d5[_0xd198('0x13')]({'plain':!![]});var _0x197039=_0xd198('0x14');return db[_0xd198('0x3c')][_0xd198('0x3d')]({'where':{'name':_0x197039,'userProfileId':_0x4e1efa[_0xd198('0x3e')]},'raw':!![]})['then'](function(_0x52df78){if(_0x52df78&&_0x52df78['autoAssociation']===0x0){return db[_0xd198('0x15')]['create']({'name':_0x469169[_0xd198('0x1b')],'resourceId':_0x469169['id'],'type':_0x52df78[_0xd198('0x1b')],'sectionId':_0x52df78['id']},{})['then'](function(){return _0x2058d5;});}else{return _0x2058d5;}})[_0xd198('0x34')](function(_0x3b065d){logger[_0xd198('0x19')](_0xd198('0x3f'),_0x3b065d);throw _0x3b065d;});}return _0x2058d5;})[_0xd198('0x11')](respondWithResult(_0x52899d,0xc9))[_0xd198('0x34')](handleError(_0x52899d,null));};exports[_0xd198('0x10')]=function(_0x112739,_0x19e0eb){if(_0x112739[_0xd198('0x39')]['id']){delete _0x112739[_0xd198('0x39')]['id'];}return db[_0xd198('0x1f')][_0xd198('0x3d')]({'where':{'id':_0x112739[_0xd198('0x40')]['id']}})[_0xd198('0x11')](handleEntityNotFound(_0x19e0eb,null))[_0xd198('0x11')](saveUpdates(_0x112739[_0xd198('0x39')],null))[_0xd198('0x11')](function(_0x31c920){if(!_0x31c920)return;var _0x184e4a=_0x31c920[_0xd198('0x13')]({'plain':!![]});return _0x184e4a;})[_0xd198('0x11')](function(_0x3db4af){var _0x218990=new Redis(config[_0xd198('0x4')]);_0x218990['publish'](_0xd198('0x17'),JSON[_0xd198('0x18')](_[_0xd198('0x2c')](_0x3db4af,['id',_0xd198('0x1b'),'production'])));return _0x3db4af;})['then'](respondWithResult(_0x19e0eb,null))['catch'](handleError(_0x19e0eb,null));};exports[_0xd198('0x12')]=function(_0xd00f2b,_0x3ff773){return db['SquareProject'][_0xd198('0x3d')]({'where':{'id':_0xd00f2b[_0xd198('0x40')]['id']}})['then'](handleEntityNotFound(_0x3ff773,null))[_0xd198('0x11')](removeEntity(_0x3ff773,null))['catch'](handleError(_0x3ff773,null));}; \ No newline at end of file +var _0xee19=['SquareProjects','publish','agi','stringify','end','sendStatus','stack','name','send','map','SquareProject','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','order','sort','where','filter','VIRTUAL','merge','options','findAll','rows','catch','show','keys','includeAll','include','find','create','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','get','pick','production','params','lodash','ioredis','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','json','offset','limit','undefined','count','status','set','update','then','destroy'];(function(_0x3b6bab,_0x4dd853){var _0x3f6478=function(_0x43f887){while(--_0x43f887){_0x3b6bab['push'](_0x3b6bab['shift']());}};_0x3f6478(++_0x4dd853);}(_0xee19,0x1cf));var _0x9ee1=function(_0x51971a,_0x3fb54a){_0x51971a=_0x51971a-0x0;var _0x1897ce=_0xee19[_0x51971a];return _0x1897ce;};'use strict';var _=require(_0x9ee1('0x0'));var Redis=require(_0x9ee1('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x9ee1('0x2'))(_0x9ee1('0x3'));var config=require('../../config/environment');var db=require(_0x9ee1('0x4'))['db'];config['redis']=_['defaults'](config[_0x9ee1('0x5')],{'host':_0x9ee1('0x6'),'port':0x18eb});var socket=require(_0x9ee1('0x7'))(new Redis(config[_0x9ee1('0x5')]));require(_0x9ee1('0x8'))[_0x9ee1('0x9')](socket);function respondWithResult(_0x255d8a,_0x130adc){_0x130adc=_0x130adc||0xc8;return function(_0x16d17e){if(_0x16d17e){return _0x255d8a['status'](_0x130adc)[_0x9ee1('0xa')](_0x16d17e);}};}function respondWithFilteredResult(_0x5a25c2,_0x54cf2d){return function(_0x24dd8d){if(_0x24dd8d){var _0x403a17=typeof _0x54cf2d[_0x9ee1('0xb')]==='undefined'&&typeof _0x54cf2d[_0x9ee1('0xc')]===_0x9ee1('0xd');var _0x36782c=_0x24dd8d[_0x9ee1('0xe')];var _0xf5e351=_0x403a17?0x0:_0x54cf2d[_0x9ee1('0xb')];var _0x4324e9=_0x403a17?_0x24dd8d[_0x9ee1('0xe')]:_0x54cf2d[_0x9ee1('0xb')]+_0x54cf2d[_0x9ee1('0xc')];var _0x24f417;if(_0x4324e9>=_0x36782c){_0x4324e9=_0x36782c;_0x24f417=0xc8;}else{_0x24f417=0xce;}_0x5a25c2[_0x9ee1('0xf')](_0x24f417);return _0x5a25c2[_0x9ee1('0x10')]('Content-Range',_0xf5e351+'-'+_0x4324e9+'/'+_0x36782c)[_0x9ee1('0xa')](_0x24dd8d);}return null;};}function saveUpdates(_0x289d51){return function(_0x27c2f8){if(_0x27c2f8){return _0x27c2f8[_0x9ee1('0x11')](_0x289d51)[_0x9ee1('0x12')](function(_0x5e2f96){return _0x5e2f96;});}return null;};}function removeEntity(_0x35cf55){return function(_0x3ade6f){if(_0x3ade6f){return _0x3ade6f[_0x9ee1('0x13')]()[_0x9ee1('0x12')](function(){var _0x2f8e3e=_0x3ade6f['get']({'plain':!![]});var _0x48bfae=_0x9ee1('0x14');return db['UserProfileResource']['destroy']({'where':{'type':_0x48bfae,'resourceId':_0x2f8e3e['id']}})['then'](function(){return _0x3ade6f;});})[_0x9ee1('0x12')](function(){var _0x574876=new Redis(config[_0x9ee1('0x5')]);_0x574876[_0x9ee1('0x15')](_0x9ee1('0x16'),JSON[_0x9ee1('0x17')]({'id':_0x3ade6f['id'],'deleted':!![]}));})[_0x9ee1('0x12')](function(){_0x35cf55[_0x9ee1('0xf')](0xcc)[_0x9ee1('0x18')]();});}};}function handleEntityNotFound(_0x3a35e){return function(_0x3d932b){if(!_0x3d932b){_0x3a35e[_0x9ee1('0x19')](0x194);}return _0x3d932b;};}function handleError(_0x23eec5,_0x156fab){_0x156fab=_0x156fab||0x1f4;return function(_0x4053c9){logger['error'](_0x4053c9[_0x9ee1('0x1a')]);if(_0x4053c9[_0x9ee1('0x1b')]){delete _0x4053c9[_0x9ee1('0x1b')];}_0x23eec5[_0x9ee1('0xf')](_0x156fab)[_0x9ee1('0x1c')](_0x4053c9);};}exports['index']=function(_0x1f42b8,_0x105322){var _0x465bf8={},_0x48746b={},_0x45cca3={'count':0x0,'rows':[]};var _0x4ae4ec=_[_0x9ee1('0x1d')](db[_0x9ee1('0x1e')][_0x9ee1('0x1f')],function(_0x4d0a83){return{'name':_0x4d0a83[_0x9ee1('0x20')],'type':_0x4d0a83[_0x9ee1('0x21')][_0x9ee1('0x22')]};});_0x48746b[_0x9ee1('0x23')]=_[_0x9ee1('0x1d')](_0x4ae4ec,_0x9ee1('0x1b'));_0x48746b[_0x9ee1('0x24')]=_['keys'](_0x1f42b8[_0x9ee1('0x24')]);_0x48746b[_0x9ee1('0x25')]=_['intersection'](_0x48746b[_0x9ee1('0x23')],_0x48746b[_0x9ee1('0x24')]);_0x465bf8['attributes']=_[_0x9ee1('0x26')](_0x48746b['model'],qs[_0x9ee1('0x27')](_0x1f42b8[_0x9ee1('0x24')][_0x9ee1('0x27')]));_0x465bf8['attributes']=_0x465bf8[_0x9ee1('0x28')][_0x9ee1('0x29')]?_0x465bf8[_0x9ee1('0x28')]:_0x48746b[_0x9ee1('0x23')];if(!_0x1f42b8[_0x9ee1('0x24')]['hasOwnProperty']('nolimit')){_0x465bf8[_0x9ee1('0xc')]=qs['limit'](_0x1f42b8[_0x9ee1('0x24')][_0x9ee1('0xc')]);_0x465bf8[_0x9ee1('0xb')]=qs[_0x9ee1('0xb')](_0x1f42b8[_0x9ee1('0x24')][_0x9ee1('0xb')]);}_0x465bf8[_0x9ee1('0x2a')]=qs['sort'](_0x1f42b8['query'][_0x9ee1('0x2b')]);_0x465bf8[_0x9ee1('0x2c')]=qs['filters'](_['pick'](_0x1f42b8['query'],_0x48746b[_0x9ee1('0x25')]),_0x4ae4ec);if(_0x1f42b8[_0x9ee1('0x24')][_0x9ee1('0x2d')]){_0x465bf8[_0x9ee1('0x2c')]=_['merge'](_0x465bf8['where'],{'$or':_['map'](_0x4ae4ec,function(_0x27cb03){if(_0x27cb03[_0x9ee1('0x21')]!==_0x9ee1('0x2e')){var _0x547513={};_0x547513[_0x27cb03[_0x9ee1('0x1b')]]={'$like':'%'+_0x1f42b8[_0x9ee1('0x24')][_0x9ee1('0x2d')]+'%'};return _0x547513;}})});}_0x465bf8=_[_0x9ee1('0x2f')]({},_0x465bf8,_0x1f42b8[_0x9ee1('0x30')]);var _0x5a7266={'where':_0x465bf8[_0x9ee1('0x2c')]};return db[_0x9ee1('0x1e')][_0x9ee1('0xe')](_0x5a7266)['then'](function(_0x458d89){_0x45cca3[_0x9ee1('0xe')]=_0x458d89;if(_0x1f42b8[_0x9ee1('0x24')]['includeAll']){_0x465bf8['include']=[{'all':!![]}];}return db[_0x9ee1('0x1e')][_0x9ee1('0x31')](_0x465bf8);})['then'](function(_0x2576cd){_0x45cca3[_0x9ee1('0x32')]=_0x2576cd;return _0x45cca3;})[_0x9ee1('0x12')](respondWithFilteredResult(_0x105322,_0x465bf8))[_0x9ee1('0x33')](handleError(_0x105322,null));};exports[_0x9ee1('0x34')]=function(_0x37f56d,_0x44573a){var _0x200a06={'raw':![],'where':{'id':_0x37f56d['params']['id']}},_0x148ff7={};_0x148ff7[_0x9ee1('0x23')]=_['keys'](db[_0x9ee1('0x1e')][_0x9ee1('0x1f')]);_0x148ff7['query']=_[_0x9ee1('0x35')](_0x37f56d[_0x9ee1('0x24')]);_0x148ff7[_0x9ee1('0x25')]=_[_0x9ee1('0x26')](_0x148ff7[_0x9ee1('0x23')],_0x148ff7[_0x9ee1('0x24')]);_0x200a06[_0x9ee1('0x28')]=_['intersection'](_0x148ff7[_0x9ee1('0x23')],qs[_0x9ee1('0x27')](_0x37f56d[_0x9ee1('0x24')][_0x9ee1('0x27')]));_0x200a06[_0x9ee1('0x28')]=_0x200a06[_0x9ee1('0x28')]['length']?_0x200a06['attributes']:_0x148ff7[_0x9ee1('0x23')];if(_0x37f56d[_0x9ee1('0x24')][_0x9ee1('0x36')]){_0x200a06[_0x9ee1('0x37')]=[{'all':!![]}];}_0x200a06=_[_0x9ee1('0x2f')]({},_0x200a06,_0x37f56d[_0x9ee1('0x30')]);return db['SquareProject'][_0x9ee1('0x38')](_0x200a06)[_0x9ee1('0x12')](handleEntityNotFound(_0x44573a,null))['then'](respondWithResult(_0x44573a,null))['catch'](handleError(_0x44573a,null));};exports[_0x9ee1('0x39')]=function(_0xaf5d73,_0x195038){return db[_0x9ee1('0x1e')][_0x9ee1('0x39')](_0xaf5d73['body'],{})[_0x9ee1('0x12')](function(_0x23ec95){var _0x336be6=_0xaf5d73['user']['get']({'plain':!![]});if(!_0x336be6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x336be6['role']===_0x9ee1('0x3a')){var _0xc92a78=_0x23ec95['get']({'plain':!![]});var _0x9e8a2d='SquareProjects';return db[_0x9ee1('0x3b')]['find']({'where':{'name':_0x9e8a2d,'userProfileId':_0x336be6[_0x9ee1('0x3c')]},'raw':!![]})['then'](function(_0x5106a5){if(_0x5106a5&&_0x5106a5[_0x9ee1('0x3d')]===0x0){return db[_0x9ee1('0x3e')][_0x9ee1('0x39')]({'name':_0xc92a78[_0x9ee1('0x1b')],'resourceId':_0xc92a78['id'],'type':_0x5106a5[_0x9ee1('0x1b')],'sectionId':_0x5106a5['id']},{})[_0x9ee1('0x12')](function(){return _0x23ec95;});}else{return _0x23ec95;}})[_0x9ee1('0x33')](function(_0xdfd887){logger['error'](_0x9ee1('0x3f'),_0xdfd887);throw _0xdfd887;});}return _0x23ec95;})[_0x9ee1('0x12')](respondWithResult(_0x195038,0xc9))[_0x9ee1('0x33')](handleError(_0x195038,null));};exports[_0x9ee1('0x11')]=function(_0x1bb9a2,_0x3039eb){if(_0x1bb9a2[_0x9ee1('0x40')]['id']){delete _0x1bb9a2[_0x9ee1('0x40')]['id'];}return db[_0x9ee1('0x1e')][_0x9ee1('0x38')]({'where':{'id':_0x1bb9a2['params']['id']}})[_0x9ee1('0x12')](handleEntityNotFound(_0x3039eb,null))[_0x9ee1('0x12')](saveUpdates(_0x1bb9a2[_0x9ee1('0x40')],null))[_0x9ee1('0x12')](function(_0x2d1826){if(!_0x2d1826)return;var _0x25884f=_0x2d1826[_0x9ee1('0x41')]({'plain':!![]});return _0x25884f;})['then'](function(_0x168caa){var _0x2e43c5=new Redis(config['redis']);_0x2e43c5[_0x9ee1('0x15')](_0x9ee1('0x16'),JSON[_0x9ee1('0x17')](_[_0x9ee1('0x42')](_0x168caa,['id',_0x9ee1('0x1b'),_0x9ee1('0x43')])));return _0x168caa;})[_0x9ee1('0x12')](respondWithResult(_0x3039eb,null))[_0x9ee1('0x33')](handleError(_0x3039eb,null));};exports[_0x9ee1('0x13')]=function(_0x345956,_0x3903ef){return db['SquareProject']['find']({'where':{'id':_0x345956[_0x9ee1('0x44')]['id']}})[_0x9ee1('0x12')](handleEntityNotFound(_0x3903ef,null))['then'](removeEntity(_0x3903ef,null))['catch'](handleError(_0x3903ef,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index f55a6c0..062eb93 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 _0xa1f1=['SquareProject','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x992d5a,_0x349eac){var _0x584708=function(_0x555252){while(--_0x555252){_0x992d5a['push'](_0x992d5a['shift']());}};_0x584708(++_0x349eac);}(_0xa1f1,0x77));var _0x1a1f=function(_0x34c063,_0x11d3d7){_0x34c063=_0x34c063-0x0;var _0x2c63a3=_0xa1f1[_0x34c063];return _0x2c63a3;};'use strict';var EventEmitter=require(_0x1a1f('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x1a1f('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1a1f('0x2'),'afterDestroy':_0x1a1f('0x3')};function emitEvent(_0xb5e2de){return function(_0x20e83a,_0x3b5a9a,_0xc3965a){SquareProjectEvents[_0x1a1f('0x4')](_0xb5e2de+':'+_0x20e83a['id'],_0x20e83a);SquareProjectEvents[_0x1a1f('0x4')](_0xb5e2de,_0x20e83a);_0xc3965a(null);};}for(var e in events){if(events[_0x1a1f('0x5')](e)){var event=events[e];SquareProject[_0x1a1f('0x6')](e,emitEvent(event));}}module[_0x1a1f('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x9cd7=['hasOwnProperty','hook','exports','events','SquareProject','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9cd7,0x10b));var _0x79cd=function(_0x34bd34,_0x1444f7){_0x34bd34=_0x34bd34-0x0;var _0x4e36d6=_0x9cd7[_0x34bd34];return _0x4e36d6;};'use strict';var EventEmitter=require(_0x79cd('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x79cd('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x79cd('0x2'),'afterDestroy':_0x79cd('0x3')};function emitEvent(_0x23d00e){return function(_0x23d58d,_0x4d581f,_0x4df77d){SquareProjectEvents[_0x79cd('0x4')](_0x23d00e+':'+_0x23d58d['id'],_0x23d58d);SquareProjectEvents[_0x79cd('0x4')](_0x23d00e,_0x23d58d);_0x4df77d(null);};}for(var e in events){if(events[_0x79cd('0x5')](e)){var event=events[e];SquareProject[_0x79cd('0x6')](e,emitEvent(event));}}module[_0x79cd('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 1d76539..a99600c 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 _0x12d5=['rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x12d5,0xf0));var _0x512d=function(_0xca3883,_0x339e8c){_0xca3883=_0xca3883-0x0;var _0x3450e1=_0x12d5[_0xca3883];return _0x3450e1;};'use strict';var _=require(_0x512d('0x0'));var util=require(_0x512d('0x1'));var logger=require(_0x512d('0x2'))(_0x512d('0x3'));var moment=require(_0x512d('0x4'));var BPromise=require(_0x512d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x512d('0x6'));var rimraf=require(_0x512d('0x7'));var config=require(_0x512d('0x8'));var attributes=require(_0x512d('0x9'));module[_0x512d('0xa')]=function(_0xf18253,_0x158719){return _0xf18253[_0x512d('0xb')](_0x512d('0xc'),attributes,{'tableName':_0x512d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51110c,_0x199a7f,_0x290857){if(_0x51110c[_0x512d('0xe')](_0x512d('0xf'))){_0x51110c[_0x512d('0x10')]=moment()[_0x512d('0x11')](_0x512d('0x12'));}if(_0x51110c[_0x512d('0xe')]('production')){_0x51110c['publishedAt']=moment()[_0x512d('0x11')](_0x512d('0x12'));}_0x290857(null,_0x51110c);}}});}; \ No newline at end of file +var _0xa3e5=['preproduction','savedAt','format','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','changed'];(function(_0x1e36fd,_0x47d470){var _0x588503=function(_0x1642d1){while(--_0x1642d1){_0x1e36fd['push'](_0x1e36fd['shift']());}};_0x588503(++_0x47d470);}(_0xa3e5,0x181));var _0x5a3e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa3e5[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x5a3e('0x0'));var util=require(_0x5a3e('0x1'));var logger=require(_0x5a3e('0x2'))(_0x5a3e('0x3'));var moment=require(_0x5a3e('0x4'));var BPromise=require(_0x5a3e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a3e('0x6'));var rimraf=require(_0x5a3e('0x7'));var config=require(_0x5a3e('0x8'));var attributes=require(_0x5a3e('0x9'));module['exports']=function(_0x29faf6,_0x1899e5){return _0x29faf6[_0x5a3e('0xa')](_0x5a3e('0xb'),attributes,{'tableName':_0x5a3e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29660d,_0x1e397e,_0x527831){if(_0x29660d[_0x5a3e('0xd')](_0x5a3e('0xe'))){_0x29660d[_0x5a3e('0xf')]=moment()[_0x5a3e('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x29660d[_0x5a3e('0xd')](_0x5a3e('0x11'))){_0x29660d[_0x5a3e('0x12')]=moment()[_0x5a3e('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x527831(null,_0x29660d);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 820330c..23b0bde 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 _0xda17=['defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','options','raw','where','attributes','limit','include','map','model','debug','stringify','message','find','then','info','ShowSquareProject','catch','error','lodash','ioredis','../../config/logger','rpc','../../config/environment','redis'];(function(_0x160248,_0x2a57e6){var _0x4e589d=function(_0x1ba722){while(--_0x1ba722){_0x160248['push'](_0x160248['shift']());}};_0x4e589d(++_0x2a57e6);}(_0xda17,0x1da));var _0x7da1=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xda17[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7da1('0x0'));var Redis=require(_0x7da1('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0x7da1('0x2'))(_0x7da1('0x3'));var config=require(_0x7da1('0x4'));config[_0x7da1('0x5')]=_[_0x7da1('0x6')](config[_0x7da1('0x5')],{'host':_0x7da1('0x7'),'port':0x18eb});var socket=require(_0x7da1('0x8'))(new Redis(config[_0x7da1('0x5')]));require(_0x7da1('0x9'))[_0x7da1('0xa')](socket);exports[_0x7da1('0xb')]=function(_0x28a95a){var _0x2b1908=this;return new Promise(function(_0x48297f,_0x130e97){return db[_0x7da1('0xc')]['findAll']({'raw':_0x28a95a[_0x7da1('0xd')]?_0x28a95a['options'][_0x7da1('0xe')]===undefined?!![]:![]:!![],'where':_0x28a95a['options']?_0x28a95a[_0x7da1('0xd')][_0x7da1('0xf')]||null:null,'attributes':_0x28a95a[_0x7da1('0xd')]?_0x28a95a['options'][_0x7da1('0x10')]||null:null,'limit':_0x28a95a[_0x7da1('0xd')]?_0x28a95a[_0x7da1('0xd')][_0x7da1('0x11')]||null:null,'include':_0x28a95a[_0x7da1('0xd')]?_0x28a95a[_0x7da1('0xd')][_0x7da1('0x12')]?_[_0x7da1('0x13')](_0x28a95a[_0x7da1('0xd')]['include'],function(_0x149198){return{'model':db[_0x149198['model']],'as':_0x149198['as'],'attributes':_0x149198[_0x7da1('0x10')],'include':_0x149198[_0x7da1('0x12')]?_[_0x7da1('0x13')](_0x149198['include'],function(_0x1defca){return{'model':db[_0x1defca['model']],'as':_0x1defca['as'],'attributes':_0x1defca[_0x7da1('0x10')],'include':_0x1defca[_0x7da1('0x12')]?_[_0x7da1('0x13')](_0x1defca[_0x7da1('0x12')],function(_0x1c9d2d){return{'model':db[_0x1c9d2d[_0x7da1('0x14')]],'as':_0x1c9d2d['as'],'attributes':_0x1c9d2d[_0x7da1('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x397d67){logger['info'](_0x7da1('0xb'),_0x28a95a);logger[_0x7da1('0x15')](_0x7da1('0xb'),_0x28a95a,JSON[_0x7da1('0x16')](_0x397d67));_0x48297f(_0x397d67);})['catch'](function(_0x22b5df){logger['error']('GetSquareProjects',_0x22b5df[_0x7da1('0x17')],_0x28a95a);_0x130e97(_0x2b1908['error'](0x1f4,_0x22b5df['message']));});});};exports['ShowSquareProject']=function(_0x37cf91){var _0x56fc6d=this;return new Promise(function(_0x52353c,_0x1e2df4){return db[_0x7da1('0xc')][_0x7da1('0x18')]({'raw':_0x37cf91['options']?_0x37cf91[_0x7da1('0xd')][_0x7da1('0xe')]===undefined?!![]:![]:!![],'where':_0x37cf91[_0x7da1('0xd')]?_0x37cf91[_0x7da1('0xd')][_0x7da1('0xf')]||null:null,'attributes':_0x37cf91['options']?_0x37cf91[_0x7da1('0xd')][_0x7da1('0x10')]||null:null,'include':_0x37cf91[_0x7da1('0xd')]?_0x37cf91[_0x7da1('0xd')][_0x7da1('0x12')]?_[_0x7da1('0x13')](_0x37cf91[_0x7da1('0xd')]['include'],function(_0x167338){return{'model':db[_0x167338['model']],'as':_0x167338['as'],'attributes':_0x167338[_0x7da1('0x10')],'include':_0x167338[_0x7da1('0x12')]?_[_0x7da1('0x13')](_0x167338[_0x7da1('0x12')],function(_0x450992){return{'model':db[_0x450992[_0x7da1('0x14')]],'as':_0x450992['as'],'attributes':_0x450992[_0x7da1('0x10')],'include':_0x450992[_0x7da1('0x12')]?_[_0x7da1('0x13')](_0x450992[_0x7da1('0x12')],function(_0x37bffa){return{'model':db[_0x37bffa['model']],'as':_0x37bffa['as'],'attributes':_0x37bffa[_0x7da1('0x10')]};}):[]};}):[]};}):[]:[]})[_0x7da1('0x19')](function(_0x388dec){logger[_0x7da1('0x1a')](_0x7da1('0x1b'),_0x37cf91);logger['debug'](_0x7da1('0x1b'),_0x37cf91,JSON[_0x7da1('0x16')](_0x388dec));_0x52353c(_0x388dec);})[_0x7da1('0x1c')](function(_0x572720){logger[_0x7da1('0x1d')](_0x7da1('0x1b'),_0x572720[_0x7da1('0x17')],_0x37cf91);_0x1e2df4(_0x56fc6d[_0x7da1('0x1d')](0x1f4,_0x572720[_0x7da1('0x17')]));});});}; \ No newline at end of file +var _0x8b93=['debug','stringify','catch','error','message','ShowSquareProject','SquareProject','find','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','findAll','options','raw','where','attributes','limit','map','model','include','then','info'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x8b93,0x17c));var _0x38b9=function(_0x5ce18b,_0x2efeeb){_0x5ce18b=_0x5ce18b-0x0;var _0x492352=_0x8b93[_0x5ce18b];return _0x492352;};'use strict';var _=require(_0x38b9('0x0'));var Redis=require(_0x38b9('0x1'));var db=require(_0x38b9('0x2'))['db'];var logger=require(_0x38b9('0x3'))(_0x38b9('0x4'));var config=require(_0x38b9('0x5'));config[_0x38b9('0x6')]=_[_0x38b9('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x38b9('0x8'))(new Redis(config[_0x38b9('0x6')]));require(_0x38b9('0x9'))[_0x38b9('0xa')](socket);exports[_0x38b9('0xb')]=function(_0x5af796){var _0x1c2964=this;return new Promise(function(_0x5cd56b,_0x46a7bd){return db['SquareProject'][_0x38b9('0xc')]({'raw':_0x5af796['options']?_0x5af796[_0x38b9('0xd')][_0x38b9('0xe')]===undefined?!![]:![]:!![],'where':_0x5af796[_0x38b9('0xd')]?_0x5af796[_0x38b9('0xd')][_0x38b9('0xf')]||null:null,'attributes':_0x5af796[_0x38b9('0xd')]?_0x5af796[_0x38b9('0xd')][_0x38b9('0x10')]||null:null,'limit':_0x5af796[_0x38b9('0xd')]?_0x5af796[_0x38b9('0xd')][_0x38b9('0x11')]||null:null,'include':_0x5af796[_0x38b9('0xd')]?_0x5af796[_0x38b9('0xd')]['include']?_[_0x38b9('0x12')](_0x5af796['options']['include'],function(_0x5eab28){return{'model':db[_0x5eab28[_0x38b9('0x13')]],'as':_0x5eab28['as'],'attributes':_0x5eab28['attributes'],'include':_0x5eab28[_0x38b9('0x14')]?_[_0x38b9('0x12')](_0x5eab28[_0x38b9('0x14')],function(_0x49debd){return{'model':db[_0x49debd[_0x38b9('0x13')]],'as':_0x49debd['as'],'attributes':_0x49debd[_0x38b9('0x10')],'include':_0x49debd['include']?_['map'](_0x49debd[_0x38b9('0x14')],function(_0x4878f9){return{'model':db[_0x4878f9['model']],'as':_0x4878f9['as'],'attributes':_0x4878f9[_0x38b9('0x10')]};}):[]};}):[]};}):[]:[]})[_0x38b9('0x15')](function(_0x5c43cc){logger[_0x38b9('0x16')](_0x38b9('0xb'),_0x5af796);logger[_0x38b9('0x17')](_0x38b9('0xb'),_0x5af796,JSON[_0x38b9('0x18')](_0x5c43cc));_0x5cd56b(_0x5c43cc);})[_0x38b9('0x19')](function(_0x16755d){logger[_0x38b9('0x1a')](_0x38b9('0xb'),_0x16755d[_0x38b9('0x1b')],_0x5af796);_0x46a7bd(_0x1c2964['error'](0x1f4,_0x16755d['message']));});});};exports[_0x38b9('0x1c')]=function(_0x45f598){var _0x557163=this;return new Promise(function(_0x36b513,_0x4b77f4){return db[_0x38b9('0x1d')][_0x38b9('0x1e')]({'raw':_0x45f598['options']?_0x45f598[_0x38b9('0xd')][_0x38b9('0xe')]===undefined?!![]:![]:!![],'where':_0x45f598[_0x38b9('0xd')]?_0x45f598[_0x38b9('0xd')][_0x38b9('0xf')]||null:null,'attributes':_0x45f598[_0x38b9('0xd')]?_0x45f598['options'][_0x38b9('0x10')]||null:null,'include':_0x45f598[_0x38b9('0xd')]?_0x45f598[_0x38b9('0xd')][_0x38b9('0x14')]?_[_0x38b9('0x12')](_0x45f598[_0x38b9('0xd')][_0x38b9('0x14')],function(_0x19d5ba){return{'model':db[_0x19d5ba[_0x38b9('0x13')]],'as':_0x19d5ba['as'],'attributes':_0x19d5ba['attributes'],'include':_0x19d5ba[_0x38b9('0x14')]?_[_0x38b9('0x12')](_0x19d5ba[_0x38b9('0x14')],function(_0x11758a){return{'model':db[_0x11758a[_0x38b9('0x13')]],'as':_0x11758a['as'],'attributes':_0x11758a[_0x38b9('0x10')],'include':_0x11758a['include']?_[_0x38b9('0x12')](_0x11758a[_0x38b9('0x14')],function(_0x5462ad){return{'model':db[_0x5462ad[_0x38b9('0x13')]],'as':_0x5462ad['as'],'attributes':_0x5462ad[_0x38b9('0x10')]};}):[]};}):[]};}):[]:[]})[_0x38b9('0x15')](function(_0x4fb015){logger[_0x38b9('0x16')](_0x38b9('0x1c'),_0x45f598);logger[_0x38b9('0x17')](_0x38b9('0x1c'),_0x45f598,JSON[_0x38b9('0x18')](_0x4fb015));_0x36b513(_0x4fb015);})[_0x38b9('0x19')](function(_0x3f7ee3){logger[_0x38b9('0x1a')](_0x38b9('0x1c'),_0x3f7ee3[_0x38b9('0x1b')],_0x45f598);_0x4b77f4(_0x557163['error'](0x1f4,_0x3f7ee3[_0x38b9('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index deaa9ed..3537f4a 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 _0xc08b=['length','squareProject:','./squareProject.events','save','remove','update','emit','removeListener'];(function(_0x4db91c,_0x346f91){var _0x27e5c6=function(_0x58b5bc){while(--_0x58b5bc){_0x4db91c['push'](_0x4db91c['shift']());}};_0x27e5c6(++_0x346f91);}(_0xc08b,0xe2));var _0xbc08=function(_0x393af8,_0x316e07){_0x393af8=_0x393af8-0x0;var _0x8f777c=_0xc08b[_0x393af8];return _0x8f777c;};'use strict';var SquareProjectEvents=require(_0xbc08('0x0'));var events=[_0xbc08('0x1'),_0xbc08('0x2'),_0xbc08('0x3')];function createListener(_0x4eaeac,_0x2c7ce9){return function(_0x30bc8a){_0x2c7ce9[_0xbc08('0x4')](_0x4eaeac,_0x30bc8a);};}function removeListener(_0xa83392,_0x270040){return function(){SquareProjectEvents[_0xbc08('0x5')](_0xa83392,_0x270040);};}exports['register']=function(_0x17e8e5){for(var _0x28af27=0x0,_0x117d26=events[_0xbc08('0x6')];_0x28af27<_0x117d26;_0x28af27++){var _0x24bcb9=events[_0x28af27];var _0x2a4f2d=createListener(_0xbc08('0x7')+_0x24bcb9,_0x17e8e5);SquareProjectEvents['on'](_0x24bcb9,_0x2a4f2d);}}; \ No newline at end of file +var _0x534b=['emit','removeListener','register','length','squareProject:','./squareProject.events','save','remove','update'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x534b,0x101));var _0xb534=function(_0x1905c2,_0x4893aa){_0x1905c2=_0x1905c2-0x0;var _0x31c8fd=_0x534b[_0x1905c2];return _0x31c8fd;};'use strict';var SquareProjectEvents=require(_0xb534('0x0'));var events=[_0xb534('0x1'),_0xb534('0x2'),_0xb534('0x3')];function createListener(_0x2aa465,_0x3bb845){return function(_0xbfdeb0){_0x3bb845[_0xb534('0x4')](_0x2aa465,_0xbfdeb0);};}function removeListener(_0x1e358d,_0x49547a){return function(){SquareProjectEvents[_0xb534('0x5')](_0x1e358d,_0x49547a);};}exports[_0xb534('0x6')]=function(_0x12590f){for(var _0x3a2daf=0x0,_0x32f68b=events[_0xb534('0x7')];_0x3a2daf<_0x32f68b;_0x3a2daf++){var _0x229f65=events[_0x3a2daf];var _0x1c3740=createListener(_0xb534('0x8')+_0x229f65,_0x12590f);SquareProjectEvents['on'](_0x229f65,_0x1c3740);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index dea3846..bf41789 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 _0x1261=['isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','index','get'];(function(_0x3f511a,_0x478eed){var _0x387e5e=function(_0x2da662){while(--_0x2da662){_0x3f511a['push'](_0x3f511a['shift']());}};_0x387e5e(++_0x478eed);}(_0x1261,0x144));var _0x1126=function(_0x1d664a,_0x149a34){_0x1d664a=_0x1d664a-0x0;var _0x335345=_0x1261[_0x1d664a];return _0x335345;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['download']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=router; \ No newline at end of file +var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x436116,_0x19b30e){var _0x31852e=function(_0x43cfc6){while(--_0x43cfc6){_0x436116['push'](_0x436116['shift']());}};_0x31852e(++_0x19b30e);}(_0x1cb9,0x14e));var _0x91cb=function(_0x18840e,_0x401ea5){_0x18840e=_0x18840e-0x0;var _0xaf8f05=_0x1cb9[_0x18840e];return _0xaf8f05;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index b559fa8..8797277 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 _0x8ef6=['VIRTUAL','savePath','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x3f70bb,_0x329d02){var _0x865b97=function(_0x21374b){while(--_0x21374b){_0x3f70bb['push'](_0x3f70bb['shift']());}};_0x865b97(++_0x329d02);}(_0x8ef6,0xf2));var _0x68ef=function(_0x537233,_0x275d9e){_0x537233=_0x537233-0x0;var _0x3ada7d=_0x8ef6[_0x537233];return _0x3ada7d;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'uniqueid':{'type':Sequelize[_0x68ef('0x2')]},'callerid':{'type':Sequelize[_0x68ef('0x2')]},'calleridname':{'type':Sequelize[_0x68ef('0x2')]},'context':{'type':Sequelize[_0x68ef('0x2')]},'extension':{'type':Sequelize[_0x68ef('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x68ef('0x2')]},'dnid':{'type':Sequelize[_0x68ef('0x2')]},'projectName':{'type':Sequelize[_0x68ef('0x2')]},'saveName':{'type':Sequelize[_0x68ef('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x68ef('0x3')],'get':function(){var _0x4740e8='';var _0x2de776=this['getDataValue'](_0x68ef('0x4'));if(_0x2de776){_0x4740e8=_0x2de776[_0x68ef('0x5')](_0x2de776[_0x68ef('0x6')]('.'));}return _0x4740e8;}}}; \ No newline at end of file +var _0x814b=['substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x90de2c,_0x3c1ece){var _0x1fd42c=function(_0x245c74){while(--_0x245c74){_0x90de2c['push'](_0x90de2c['shift']());}};_0x1fd42c(++_0x3c1ece);}(_0x814b,0x1a2));var _0xb814=function(_0x1dd2cc,_0x36ddfe){_0x1dd2cc=_0x1dd2cc-0x0;var _0x305d8e=_0x814b[_0x1dd2cc];return _0x305d8e;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'uniqueid':{'type':Sequelize[_0xb814('0x2')]},'callerid':{'type':Sequelize[_0xb814('0x2')]},'calleridname':{'type':Sequelize[_0xb814('0x2')]},'context':{'type':Sequelize[_0xb814('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb814('0x2')]},'accountcode':{'type':Sequelize[_0xb814('0x2')]},'dnid':{'type':Sequelize[_0xb814('0x2')]},'projectName':{'type':Sequelize[_0xb814('0x2')]},'saveName':{'type':Sequelize[_0xb814('0x2')]},'filename':{'type':Sequelize[_0xb814('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xb814('0x3')],'get':function(){var _0x2e6272='';var _0x5c8539=this[_0xb814('0x4')](_0xb814('0x5'));if(_0x5c8539){_0x2e6272=_0x5c8539[_0xb814('0x6')](_0x5c8539[_0xb814('0x7')]('.'));}return _0x2e6272;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 5bcaa2f..6218323 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 _0xde17=['end','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','map','SquareRecording','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','download','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','send','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xde17,0xc5));var _0x7de1=function(_0x2bf8f7,_0x245253){_0x2bf8f7=_0x2bf8f7-0x0;var _0x22f7f5=_0xde17[_0x2bf8f7];return _0x22f7f5;};'use strict';var emlformat=require(_0x7de1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7de1('0x1'));var jsonpatch=require(_0x7de1('0x2'));var rp=require(_0x7de1('0x3'));var moment=require(_0x7de1('0x4'));var BPromise=require(_0x7de1('0x5'));var Mustache=require('mustache');var util=require(_0x7de1('0x6'));var path=require(_0x7de1('0x7'));var sox=require(_0x7de1('0x8'));var csv=require(_0x7de1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7de1('0xa'));var _=require('lodash');var squel=require(_0x7de1('0xb'));var crypto=require('crypto');var jsforce=require(_0x7de1('0xc'));var deskjs=require(_0x7de1('0xd'));var toCsv=require(_0x7de1('0x9'));var querystring=require(_0x7de1('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7de1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7de1('0x10'));var hardwareService=require(_0x7de1('0x11'));var logger=require(_0x7de1('0x12'))('api');var utils=require(_0x7de1('0x13'));var config=require(_0x7de1('0x14'));var licenseUtil=require(_0x7de1('0x15'));var db=require(_0x7de1('0x16'))['db'];function respondWithStatusCode(_0x553aea,_0x100b7b){_0x100b7b=_0x100b7b||0xcc;return function(_0x4b9548){if(_0x4b9548){return _0x553aea[_0x7de1('0x17')](_0x100b7b);}return _0x553aea[_0x7de1('0x18')](_0x100b7b)['end']();};}function respondWithResult(_0x145e69,_0x13eda2){_0x13eda2=_0x13eda2||0xc8;return function(_0x2dbaaa){if(_0x2dbaaa){return _0x145e69[_0x7de1('0x18')](_0x13eda2)[_0x7de1('0x19')](_0x2dbaaa);}};}function respondWithFilteredResult(_0x5b4c17,_0x1455d2){return function(_0x114db8){if(_0x114db8){var _0x1894de=typeof _0x1455d2[_0x7de1('0x1a')]===_0x7de1('0x1b')&&typeof _0x1455d2['limit']==='undefined';var _0x39c7e6=_0x114db8['count'];var _0x5da4b7=_0x1894de?0x0:_0x1455d2[_0x7de1('0x1a')];var _0x589a0b=_0x1894de?_0x114db8[_0x7de1('0x1c')]:_0x1455d2[_0x7de1('0x1a')]+_0x1455d2[_0x7de1('0x1d')];var _0x456dbe;if(_0x589a0b>=_0x39c7e6){_0x589a0b=_0x39c7e6;_0x456dbe=0xc8;}else{_0x456dbe=0xce;}_0x5b4c17[_0x7de1('0x18')](_0x456dbe);return _0x5b4c17[_0x7de1('0x1e')](_0x7de1('0x1f'),_0x5da4b7+'-'+_0x589a0b+'/'+_0x39c7e6)[_0x7de1('0x19')](_0x114db8);}return null;};}function patchUpdates(_0x2d60ca){return function(_0x25ae41){try{jsonpatch[_0x7de1('0x20')](_0x25ae41,_0x2d60ca,!![]);}catch(_0x1a3913){return BPromise['reject'](_0x1a3913);}return _0x25ae41[_0x7de1('0x21')]();};}function saveUpdates(_0x3ac3f5,_0x2cfcde){return function(_0x568365){if(_0x568365){return _0x568365[_0x7de1('0x22')](_0x3ac3f5)[_0x7de1('0x23')](function(_0x53ee34){return _0x53ee34;});}return null;};}function removeEntity(_0x34f8de,_0x5b43fb){return function(_0x45e59c){if(_0x45e59c){return _0x45e59c[_0x7de1('0x24')]()[_0x7de1('0x23')](function(){_0x34f8de[_0x7de1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4eaf2c,_0x20d818){return function(_0x5192cb){if(!_0x5192cb){_0x4eaf2c['sendStatus'](0x194);}return _0x5192cb;};}function handleError(_0x23f203,_0x3f2eb1){_0x3f2eb1=_0x3f2eb1||0x1f4;return function(_0x27c188){logger[_0x7de1('0x25')](_0x27c188[_0x7de1('0x26')]);if(_0x27c188[_0x7de1('0x27')]){delete _0x27c188[_0x7de1('0x27')];}_0x23f203['status'](_0x3f2eb1)['send'](_0x27c188);};}exports['index']=function(_0x88e7f9,_0x4b667e){var _0x3d0348={},_0x46a575={},_0x9ad084={'count':0x0,'rows':[]};var _0x2b3ebf=_[_0x7de1('0x28')](db[_0x7de1('0x29')]['rawAttributes'],function(_0x345678){return{'name':_0x345678[_0x7de1('0x2a')],'type':_0x345678[_0x7de1('0x2b')]['key']};});_0x46a575['model']=_['map'](_0x2b3ebf,_0x7de1('0x27'));_0x46a575[_0x7de1('0x2c')]=_[_0x7de1('0x2d')](_0x88e7f9[_0x7de1('0x2c')]);_0x46a575[_0x7de1('0x2e')]=_[_0x7de1('0x2f')](_0x46a575['model'],_0x46a575[_0x7de1('0x2c')]);_0x3d0348['attributes']=_[_0x7de1('0x2f')](_0x46a575[_0x7de1('0x30')],qs[_0x7de1('0x31')](_0x88e7f9['query'][_0x7de1('0x31')]));_0x3d0348['attributes']=_0x3d0348[_0x7de1('0x32')][_0x7de1('0x33')]?_0x3d0348['attributes']:_0x46a575['model'];if(!_0x88e7f9['query'][_0x7de1('0x34')](_0x7de1('0x35'))){_0x3d0348[_0x7de1('0x1d')]=qs['limit'](_0x88e7f9[_0x7de1('0x2c')][_0x7de1('0x1d')]);_0x3d0348[_0x7de1('0x1a')]=qs[_0x7de1('0x1a')](_0x88e7f9[_0x7de1('0x2c')][_0x7de1('0x1a')]);}_0x3d0348[_0x7de1('0x36')]=qs[_0x7de1('0x37')](_0x88e7f9[_0x7de1('0x2c')][_0x7de1('0x37')]);_0x3d0348[_0x7de1('0x38')]=qs['filters'](_[_0x7de1('0x39')](_0x88e7f9['query'],_0x46a575[_0x7de1('0x2e')]),_0x2b3ebf);if(_0x88e7f9[_0x7de1('0x2c')]['filter']){_0x3d0348['where']=_[_0x7de1('0x3a')](_0x3d0348[_0x7de1('0x38')],{'$or':_['map'](_0x2b3ebf,function(_0x4b0fa1){if(_0x4b0fa1['type']!==_0x7de1('0x3b')){var _0x58feef={};_0x58feef[_0x4b0fa1['name']]={'$like':'%'+_0x88e7f9[_0x7de1('0x2c')][_0x7de1('0x3c')]+'%'};return _0x58feef;}})});}_0x3d0348=_['merge']({},_0x3d0348,_0x88e7f9[_0x7de1('0x3d')]);var _0x55e3f5={'where':_0x3d0348[_0x7de1('0x38')]};return db[_0x7de1('0x29')][_0x7de1('0x1c')](_0x55e3f5)[_0x7de1('0x23')](function(_0x2cfea9){_0x9ad084['count']=_0x2cfea9;if(_0x88e7f9[_0x7de1('0x2c')][_0x7de1('0x3e')]){_0x3d0348[_0x7de1('0x3f')]=[{'all':!![]}];}return db[_0x7de1('0x29')]['findAll'](_0x3d0348);})[_0x7de1('0x23')](function(_0x22007c){_0x9ad084[_0x7de1('0x40')]=_0x22007c;return _0x9ad084;})[_0x7de1('0x23')](respondWithFilteredResult(_0x4b667e,_0x3d0348))[_0x7de1('0x41')](handleError(_0x4b667e,null));};exports[_0x7de1('0x42')]=function(_0x3d1d02,_0x10b429){var _0x2ed9d1={'raw':!![],'where':{'id':_0x3d1d02[_0x7de1('0x43')]['id']}},_0x197b96={};_0x197b96['model']=_[_0x7de1('0x2d')](db[_0x7de1('0x29')][_0x7de1('0x44')]);_0x197b96[_0x7de1('0x2c')]=_[_0x7de1('0x2d')](_0x3d1d02[_0x7de1('0x2c')]);_0x197b96[_0x7de1('0x2e')]=_[_0x7de1('0x2f')](_0x197b96[_0x7de1('0x30')],_0x197b96[_0x7de1('0x2c')]);_0x2ed9d1[_0x7de1('0x32')]=_[_0x7de1('0x2f')](_0x197b96[_0x7de1('0x30')],qs[_0x7de1('0x31')](_0x3d1d02[_0x7de1('0x2c')][_0x7de1('0x31')]));_0x2ed9d1[_0x7de1('0x32')]=_0x2ed9d1['attributes'][_0x7de1('0x33')]?_0x2ed9d1[_0x7de1('0x32')]:_0x197b96['model'];if(_0x3d1d02[_0x7de1('0x2c')][_0x7de1('0x3e')]){_0x2ed9d1[_0x7de1('0x3f')]=[{'all':!![]}];}_0x2ed9d1=_['merge']({},_0x2ed9d1,_0x3d1d02[_0x7de1('0x3d')]);return db[_0x7de1('0x29')][_0x7de1('0x45')](_0x2ed9d1)[_0x7de1('0x23')](handleEntityNotFound(_0x10b429,null))[_0x7de1('0x23')](respondWithResult(_0x10b429,null))[_0x7de1('0x41')](handleError(_0x10b429,null));};exports[_0x7de1('0x46')]=function(_0x13ba19,_0x387ea3){return db[_0x7de1('0x29')][_0x7de1('0x46')](_0x13ba19[_0x7de1('0x47')],{})['then'](respondWithResult(_0x387ea3,0xc9))['catch'](handleError(_0x387ea3,null));};exports[_0x7de1('0x22')]=function(_0x5a0f47,_0x667e38){if(_0x5a0f47[_0x7de1('0x47')]['id']){delete _0x5a0f47[_0x7de1('0x47')]['id'];}return db[_0x7de1('0x29')][_0x7de1('0x45')]({'where':{'id':_0x5a0f47[_0x7de1('0x43')]['id']}})[_0x7de1('0x23')](handleEntityNotFound(_0x667e38,null))[_0x7de1('0x23')](saveUpdates(_0x5a0f47[_0x7de1('0x47')],null))[_0x7de1('0x23')](respondWithResult(_0x667e38,null))['catch'](handleError(_0x667e38,null));};exports[_0x7de1('0x48')]=function(_0x1457d9,_0x2f2f6b,_0x1a8f34){var _0x51f77b=require(_0x7de1('0x49'));var _0x76c1ce=![];var _0x287ee9={};if(_0x1457d9[_0x7de1('0x2c')][_0x7de1('0x2b')]&&_0x1457d9['query'][_0x7de1('0x2b')]===_0x7de1('0x4a')){_0x287ee9['uniqueid']=_0x1457d9[_0x7de1('0x43')]['id'];}else{_0x287ee9['id']=_0x1457d9[_0x7de1('0x43')]['id'];}return db[_0x7de1('0x29')][_0x7de1('0x45')]({'where':_0x287ee9,'attributes':['id',_0x7de1('0x4b'),'filename'],'raw':!![]})[_0x7de1('0x23')](handleEntityNotFound(_0x2f2f6b,null))[_0x7de1('0x23')](function(_0xd28aa8){if(_0xd28aa8){var _0x3f3d0f=_0xd28aa8[_0x7de1('0x4b')];var _0x3109e5=util[_0x7de1('0x4c')](_0x7de1('0x4d'),_0x3f3d0f);if(fs[_0x7de1('0x4e')](_0x3109e5)){_0x76c1ce=!![];return _0x51f77b[_0x7de1('0x4f')](_0x3109e5,_0x3f3d0f,config[_0x7de1('0x50')][_0x7de1('0x51')])[_0x7de1('0x23')](function(){return _0xd28aa8;});}return _0xd28aa8;}})[_0x7de1('0x23')](function(_0x35f9a4){if(_0x35f9a4){var _0x5cc1e8=_0x35f9a4['savePath'];if(!fs[_0x7de1('0x4e')](_0x5cc1e8)){throw new db[(_0x7de1('0x52'))]['ValidationError'](_0x7de1('0x53'));}if(_0x35f9a4['filename']){return _0x2f2f6b[_0x7de1('0x48')](_0x5cc1e8,_0x35f9a4['filename']+path[_0x7de1('0x54')](_0x5cc1e8),function(){if(_0x76c1ce){fs[_0x7de1('0x55')](_0x5cc1e8);}});}else{return _0x2f2f6b[_0x7de1('0x48')](_0x5cc1e8,function(_0x3a5f31){if(_0x76c1ce){fs[_0x7de1('0x55')](_0x5cc1e8);}});}}})[_0x7de1('0x41')](function(_0x48d1af){if(_0x48d1af[_0x7de1('0x56')]===_0x7de1('0x53')){_0x2f2f6b['status'](0x194)[_0x7de1('0x57')](_0x7de1('0x58'));}else{return handleError(_0x2f2f6b,null);}});};exports['destroy']=function(_0x4da0cd,_0x625db4){return db[_0x7de1('0x29')][_0x7de1('0x45')]({'where':{'id':_0x4da0cd[_0x7de1('0x43')]['id']}})[_0x7de1('0x23')](function(_0x4d69c3){if(_[_0x7de1('0x59')](_0x4d69c3)){throw new ReferenceError(_0x7de1('0x5a'));}return _0x4d69c3;})[_0x7de1('0x23')](function(_0x526d14){var _0x3eafa5=_0x526d14[_0x7de1('0x4b')];logger[_0x7de1('0x5b')](_0x7de1('0x5c'),_0x3eafa5);if(!_['isNil'](_0x526d14[_0x7de1('0x4b')])&&fs[_0x7de1('0x4e')](_0x3eafa5)){logger[_0x7de1('0x5b')](_0x7de1('0x5d')+_0x3eafa5+_0x7de1('0x5e'));fs[_0x7de1('0x5f')](_0x3eafa5);}_0x3eafa5=_0x3eafa5+_0x7de1('0x60');if(!_['isNil'](_0x526d14[_0x7de1('0x4b')])&&fs['existsSync'](_0x3eafa5)){logger[_0x7de1('0x5b')](_0x7de1('0x5d')+_0x3eafa5+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x7de1('0x5f')](_0x3eafa5);}return _0x526d14;})[_0x7de1('0x23')](function(_0x4f8899){if(!_0x4f8899)throw new InternalError();return _0x4f8899[_0x7de1('0x24')]();})[_0x7de1('0x23')](function(){_0x625db4['status'](0xcc)[_0x7de1('0x61')]();})[_0x7de1('0x41')](handleError(_0x625db4,null));}; \ No newline at end of file +var _0x3d96=['model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','includeAll','find','create','body','download','../../components/encryptor','uniqueid','savePath','format','existsSync','decryptFile','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','SquareRecording','rawAttributes','fieldName','type','key'];(function(_0x3a6cca,_0x217c1){var _0x20134b=function(_0x1f3b69){while(--_0x1f3b69){_0x3a6cca['push'](_0x3a6cca['shift']());}};_0x20134b(++_0x217c1);}(_0x3d96,0xf3));var _0x63d9=function(_0x285845,_0xd706b4){_0x285845=_0x285845-0x0;var _0xae20f3=_0x3d96[_0x285845];return _0xae20f3;};'use strict';var emlformat=require(_0x63d9('0x0'));var rimraf=require(_0x63d9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x63d9('0x2'));var rp=require(_0x63d9('0x3'));var moment=require(_0x63d9('0x4'));var BPromise=require(_0x63d9('0x5'));var Mustache=require(_0x63d9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x63d9('0x7'));var csv=require(_0x63d9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x63d9('0x9'));var _=require(_0x63d9('0xa'));var squel=require(_0x63d9('0xb'));var crypto=require(_0x63d9('0xc'));var jsforce=require(_0x63d9('0xd'));var deskjs=require(_0x63d9('0xe'));var toCsv=require(_0x63d9('0x8'));var querystring=require(_0x63d9('0xf'));var Papa=require(_0x63d9('0x10'));var Redis=require(_0x63d9('0x11'));var authService=require(_0x63d9('0x12'));var qs=require(_0x63d9('0x13'));var as=require(_0x63d9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x63d9('0x15'));var config=require(_0x63d9('0x16'));var licenseUtil=require(_0x63d9('0x17'));var db=require(_0x63d9('0x18'))['db'];function respondWithStatusCode(_0x2b98d3,_0x58ff13){_0x58ff13=_0x58ff13||0xcc;return function(_0x4028b4){if(_0x4028b4){return _0x2b98d3[_0x63d9('0x19')](_0x58ff13);}return _0x2b98d3[_0x63d9('0x1a')](_0x58ff13)[_0x63d9('0x1b')]();};}function respondWithResult(_0x25d53c,_0x149288){_0x149288=_0x149288||0xc8;return function(_0x13a4c0){if(_0x13a4c0){return _0x25d53c['status'](_0x149288)[_0x63d9('0x1c')](_0x13a4c0);}};}function respondWithFilteredResult(_0x5bb18c,_0x596378){return function(_0x505c0a){if(_0x505c0a){var _0x2ea5de=typeof _0x596378[_0x63d9('0x1d')]===_0x63d9('0x1e')&&typeof _0x596378['limit']===_0x63d9('0x1e');var _0x5af553=_0x505c0a[_0x63d9('0x1f')];var _0x3faf8f=_0x2ea5de?0x0:_0x596378[_0x63d9('0x1d')];var _0x68a313=_0x2ea5de?_0x505c0a[_0x63d9('0x1f')]:_0x596378['offset']+_0x596378[_0x63d9('0x20')];var _0x3b353f;if(_0x68a313>=_0x5af553){_0x68a313=_0x5af553;_0x3b353f=0xc8;}else{_0x3b353f=0xce;}_0x5bb18c[_0x63d9('0x1a')](_0x3b353f);return _0x5bb18c['set'](_0x63d9('0x21'),_0x3faf8f+'-'+_0x68a313+'/'+_0x5af553)['json'](_0x505c0a);}return null;};}function patchUpdates(_0x1cd4d6){return function(_0x18a795){try{jsonpatch[_0x63d9('0x22')](_0x18a795,_0x1cd4d6,!![]);}catch(_0x15b65f){return BPromise[_0x63d9('0x23')](_0x15b65f);}return _0x18a795[_0x63d9('0x24')]();};}function saveUpdates(_0x3afb6b,_0x46ec62){return function(_0x2a2529){if(_0x2a2529){return _0x2a2529[_0x63d9('0x25')](_0x3afb6b)[_0x63d9('0x26')](function(_0x58458e){return _0x58458e;});}return null;};}function removeEntity(_0xbdd13a,_0x751395){return function(_0x1b1ff9){if(_0x1b1ff9){return _0x1b1ff9[_0x63d9('0x27')]()['then'](function(){_0xbdd13a[_0x63d9('0x1a')](0xcc)[_0x63d9('0x1b')]();});}};}function handleEntityNotFound(_0x3a6124,_0x3ceecf){return function(_0x2afb85){if(!_0x2afb85){_0x3a6124[_0x63d9('0x19')](0x194);}return _0x2afb85;};}function handleError(_0x12ddcd,_0x5a4cea){_0x5a4cea=_0x5a4cea||0x1f4;return function(_0x1a059c){logger['error'](_0x1a059c[_0x63d9('0x28')]);if(_0x1a059c[_0x63d9('0x29')]){delete _0x1a059c[_0x63d9('0x29')];}_0x12ddcd[_0x63d9('0x1a')](_0x5a4cea)['send'](_0x1a059c);};}exports[_0x63d9('0x2a')]=function(_0x28d3b1,_0x2d140f){var _0x2352c3={},_0x408951={},_0x364b1d={'count':0x0,'rows':[]};var _0xd0c2d4=_['map'](db[_0x63d9('0x2b')][_0x63d9('0x2c')],function(_0x3fbf3f){return{'name':_0x3fbf3f[_0x63d9('0x2d')],'type':_0x3fbf3f[_0x63d9('0x2e')][_0x63d9('0x2f')]};});_0x408951[_0x63d9('0x30')]=_[_0x63d9('0x31')](_0xd0c2d4,_0x63d9('0x29'));_0x408951[_0x63d9('0x32')]=_['keys'](_0x28d3b1[_0x63d9('0x32')]);_0x408951[_0x63d9('0x33')]=_[_0x63d9('0x34')](_0x408951[_0x63d9('0x30')],_0x408951['query']);_0x2352c3[_0x63d9('0x35')]=_[_0x63d9('0x34')](_0x408951[_0x63d9('0x30')],qs[_0x63d9('0x36')](_0x28d3b1[_0x63d9('0x32')]['fields']));_0x2352c3[_0x63d9('0x35')]=_0x2352c3[_0x63d9('0x35')][_0x63d9('0x37')]?_0x2352c3[_0x63d9('0x35')]:_0x408951[_0x63d9('0x30')];if(!_0x28d3b1['query'][_0x63d9('0x38')]('nolimit')){_0x2352c3[_0x63d9('0x20')]=qs[_0x63d9('0x20')](_0x28d3b1[_0x63d9('0x32')]['limit']);_0x2352c3['offset']=qs[_0x63d9('0x1d')](_0x28d3b1['query']['offset']);}_0x2352c3[_0x63d9('0x39')]=qs[_0x63d9('0x3a')](_0x28d3b1['query'][_0x63d9('0x3a')]);_0x2352c3[_0x63d9('0x3b')]=qs['filters'](_[_0x63d9('0x3c')](_0x28d3b1[_0x63d9('0x32')],_0x408951['filters']),_0xd0c2d4);if(_0x28d3b1[_0x63d9('0x32')][_0x63d9('0x3d')]){_0x2352c3[_0x63d9('0x3b')]=_[_0x63d9('0x3e')](_0x2352c3[_0x63d9('0x3b')],{'$or':_[_0x63d9('0x31')](_0xd0c2d4,function(_0x105fdb){if(_0x105fdb['type']!==_0x63d9('0x3f')){var _0x1e9e60={};_0x1e9e60[_0x105fdb['name']]={'$like':'%'+_0x28d3b1[_0x63d9('0x32')][_0x63d9('0x3d')]+'%'};return _0x1e9e60;}})});}_0x2352c3=_['merge']({},_0x2352c3,_0x28d3b1[_0x63d9('0x40')]);var _0x34306d={'where':_0x2352c3['where']};return db[_0x63d9('0x2b')][_0x63d9('0x1f')](_0x34306d)[_0x63d9('0x26')](function(_0x1cd850){_0x364b1d[_0x63d9('0x1f')]=_0x1cd850;if(_0x28d3b1[_0x63d9('0x32')]['includeAll']){_0x2352c3[_0x63d9('0x41')]=[{'all':!![]}];}return db[_0x63d9('0x2b')][_0x63d9('0x42')](_0x2352c3);})['then'](function(_0x511a90){_0x364b1d['rows']=_0x511a90;return _0x364b1d;})[_0x63d9('0x26')](respondWithFilteredResult(_0x2d140f,_0x2352c3))[_0x63d9('0x43')](handleError(_0x2d140f,null));};exports[_0x63d9('0x44')]=function(_0x5089e6,_0x26c7c4){var _0x2a54ae={'raw':!![],'where':{'id':_0x5089e6[_0x63d9('0x45')]['id']}},_0x43c844={};_0x43c844['model']=_[_0x63d9('0x46')](db[_0x63d9('0x2b')][_0x63d9('0x2c')]);_0x43c844[_0x63d9('0x32')]=_['keys'](_0x5089e6[_0x63d9('0x32')]);_0x43c844[_0x63d9('0x33')]=_[_0x63d9('0x34')](_0x43c844[_0x63d9('0x30')],_0x43c844[_0x63d9('0x32')]);_0x2a54ae[_0x63d9('0x35')]=_['intersection'](_0x43c844[_0x63d9('0x30')],qs['fields'](_0x5089e6['query']['fields']));_0x2a54ae[_0x63d9('0x35')]=_0x2a54ae[_0x63d9('0x35')][_0x63d9('0x37')]?_0x2a54ae[_0x63d9('0x35')]:_0x43c844[_0x63d9('0x30')];if(_0x5089e6[_0x63d9('0x32')][_0x63d9('0x47')]){_0x2a54ae[_0x63d9('0x41')]=[{'all':!![]}];}_0x2a54ae=_['merge']({},_0x2a54ae,_0x5089e6[_0x63d9('0x40')]);return db[_0x63d9('0x2b')][_0x63d9('0x48')](_0x2a54ae)[_0x63d9('0x26')](handleEntityNotFound(_0x26c7c4,null))[_0x63d9('0x26')](respondWithResult(_0x26c7c4,null))['catch'](handleError(_0x26c7c4,null));};exports[_0x63d9('0x49')]=function(_0x328527,_0x497b26){return db[_0x63d9('0x2b')][_0x63d9('0x49')](_0x328527['body'],{})['then'](respondWithResult(_0x497b26,0xc9))[_0x63d9('0x43')](handleError(_0x497b26,null));};exports[_0x63d9('0x25')]=function(_0x23daa8,_0x46e489){if(_0x23daa8[_0x63d9('0x4a')]['id']){delete _0x23daa8[_0x63d9('0x4a')]['id'];}return db[_0x63d9('0x2b')][_0x63d9('0x48')]({'where':{'id':_0x23daa8[_0x63d9('0x45')]['id']}})[_0x63d9('0x26')](handleEntityNotFound(_0x46e489,null))[_0x63d9('0x26')](saveUpdates(_0x23daa8['body'],null))['then'](respondWithResult(_0x46e489,null))[_0x63d9('0x43')](handleError(_0x46e489,null));};exports[_0x63d9('0x4b')]=function(_0x570007,_0x46f06b,_0xfe5a0e){var _0x553061=require(_0x63d9('0x4c'));var _0x32d40c=![];var _0x3ac892={};if(_0x570007['query'][_0x63d9('0x2e')]&&_0x570007[_0x63d9('0x32')][_0x63d9('0x2e')]===_0x63d9('0x4d')){_0x3ac892['uniqueid']=_0x570007[_0x63d9('0x45')]['id'];}else{_0x3ac892['id']=_0x570007[_0x63d9('0x45')]['id'];}return db[_0x63d9('0x2b')][_0x63d9('0x48')]({'where':_0x3ac892,'attributes':['id',_0x63d9('0x4e'),'filename'],'raw':!![]})[_0x63d9('0x26')](handleEntityNotFound(_0x46f06b,null))['then'](function(_0x4de7c9){if(_0x4de7c9){var _0x32aa61=_0x4de7c9['savePath'];var _0x1590d4=util[_0x63d9('0x4f')]('%s.cypher',_0x32aa61);if(fs[_0x63d9('0x50')](_0x1590d4)){_0x32d40c=!![];return _0x553061[_0x63d9('0x51')](_0x1590d4,_0x32aa61,config['secrets']['recording'])['then'](function(){return _0x4de7c9;});}return _0x4de7c9;}})[_0x63d9('0x26')](function(_0x575ceb){if(_0x575ceb){var _0x237ff9=_0x575ceb[_0x63d9('0x4e')];if(!fs[_0x63d9('0x50')](_0x237ff9)){throw new db[(_0x63d9('0x52'))][(_0x63d9('0x53'))](_0x63d9('0x54'));}if(_0x575ceb[_0x63d9('0x55')]){return _0x46f06b[_0x63d9('0x4b')](_0x237ff9,_0x575ceb[_0x63d9('0x55')]+path[_0x63d9('0x56')](_0x237ff9),function(){if(_0x32d40c){fs['unlink'](_0x237ff9);}});}else{return _0x46f06b[_0x63d9('0x4b')](_0x237ff9,function(_0x48d382){if(_0x32d40c){fs[_0x63d9('0x57')](_0x237ff9);}});}}})[_0x63d9('0x43')](function(_0xf33474){if(_0xf33474['message']===_0x63d9('0x54')){_0x46f06b['status'](0x194)['send'](_0x63d9('0x58'));}else{return handleError(_0x46f06b,null);}});};exports[_0x63d9('0x27')]=function(_0x53af07,_0x224ad4){return db[_0x63d9('0x2b')][_0x63d9('0x48')]({'where':{'id':_0x53af07[_0x63d9('0x45')]['id']}})['then'](function(_0x1432a7){if(_['isNil'](_0x1432a7)){throw new ReferenceError(_0x63d9('0x59'));}return _0x1432a7;})[_0x63d9('0x26')](function(_0x3f9711){var _0x373e50=_0x3f9711[_0x63d9('0x4e')];logger[_0x63d9('0x5a')](_0x63d9('0x5b'),_0x373e50);if(!_['isNil'](_0x3f9711[_0x63d9('0x4e')])&&fs[_0x63d9('0x50')](_0x373e50)){logger[_0x63d9('0x5a')](_0x63d9('0x5c')+_0x373e50+_0x63d9('0x5d'));fs[_0x63d9('0x5e')](_0x373e50);}_0x373e50=_0x373e50+_0x63d9('0x5f');if(!_[_0x63d9('0x60')](_0x3f9711[_0x63d9('0x4e')])&&fs[_0x63d9('0x50')](_0x373e50)){logger['info'](_0x63d9('0x5c')+_0x373e50+_0x63d9('0x5d'));fs[_0x63d9('0x5e')](_0x373e50);}return _0x3f9711;})[_0x63d9('0x26')](function(_0x3a2577){if(!_0x3a2577)throw new InternalError();return _0x3a2577[_0x63d9('0x27')]();})[_0x63d9('0x26')](function(){_0x224ad4[_0x63d9('0x1a')](0xcc)['end']();})[_0x63d9('0x43')](handleError(_0x224ad4,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 1a2b1f1..fb83255 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 _0xb89c=['SquareRecording','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./squareRecording.attributes','define'];(function(_0x39b465,_0x27ad9d){var _0x4c931b=function(_0x2d7d57){while(--_0x2d7d57){_0x39b465['push'](_0x39b465['shift']());}};_0x4c931b(++_0x27ad9d);}(_0xb89c,0x198));var _0xcb89=function(_0x1d974a,_0xb9648f){_0x1d974a=_0x1d974a-0x0;var _0x528993=_0xb89c[_0x1d974a];return _0x528993;};'use strict';var _=require(_0xcb89('0x0'));var util=require(_0xcb89('0x1'));var logger=require(_0xcb89('0x2'))(_0xcb89('0x3'));var moment=require('moment');var BPromise=require(_0xcb89('0x4'));var rp=require(_0xcb89('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb89('0x6'));var config=require(_0xcb89('0x7'));var attributes=require(_0xcb89('0x8'));module['exports']=function(_0x503a2b,_0xd820d7){return _0x503a2b[_0xcb89('0x9')](_0xcb89('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06ae=['path','rimraf','../../config/environment','define','SquareRecording','square_recordings','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1a8207,_0x576621){var _0x4bc774=function(_0x228d2e){while(--_0x228d2e){_0x1a8207['push'](_0x1a8207['shift']());}};_0x4bc774(++_0x576621);}(_0x06ae,0x16e));var _0xe06a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x06ae[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xe06a('0x0'));var logger=require(_0xe06a('0x1'))(_0xe06a('0x2'));var moment=require(_0xe06a('0x3'));var BPromise=require(_0xe06a('0x4'));var rp=require(_0xe06a('0x5'));var fs=require('fs');var path=require(_0xe06a('0x6'));var rimraf=require(_0xe06a('0x7'));var config=require(_0xe06a('0x8'));var attributes=require('./squareRecording.attributes');module['exports']=function(_0x50e6cf,_0x1df79f){return _0x50e6cf[_0xe06a('0x9')](_0xe06a('0xa'),attributes,{'tableName':_0xe06a('0xb'),'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 9fed9f1..8c9b47e 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 _0xabae=['debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','SquareRecording','body','options','raw','CreateSquareRecording','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareRecording,\x20%s,\x20%s'];(function(_0x124df3,_0x2438d2){var _0x70f62a=function(_0x10ef9f){while(--_0x10ef9f){_0x124df3['push'](_0x124df3['shift']());}};_0x70f62a(++_0x2438d2);}(_0xabae,0xe0));var _0xeaba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xabae[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xeaba('0x0'));var util=require(_0xeaba('0x1'));var moment=require(_0xeaba('0x2'));var BPromise=require(_0xeaba('0x3'));var rs=require(_0xeaba('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeaba('0x5'))['db'];var utils=require(_0xeaba('0x6'));var logger=require(_0xeaba('0x7'))(_0xeaba('0x8'));var config=require(_0xeaba('0x9'));var jayson=require(_0xeaba('0xa'));var client=jayson[_0xeaba('0xb')][_0xeaba('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a9957,_0x51fa38,_0x313bcc){return new BPromise(function(_0x4909e2,_0x3ff34c){return client[_0xeaba('0xd')](_0x3a9957,_0x313bcc)[_0xeaba('0xe')](function(_0x28529d){logger['info'](_0xeaba('0xf'),_0x51fa38,'request\x20sent');logger[_0xeaba('0x10')](_0xeaba('0x11'),_0x51fa38,_0xeaba('0x12'),JSON[_0xeaba('0x13')](_0x28529d));if(_0x28529d[_0xeaba('0x14')]){if(_0x28529d[_0xeaba('0x14')][_0xeaba('0x15')]===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x51fa38,_0x28529d[_0xeaba('0x14')][_0xeaba('0x16')]);return _0x3ff34c(_0x28529d[_0xeaba('0x14')][_0xeaba('0x16')]);}logger['error'](_0xeaba('0xf'),_0x51fa38,_0x28529d['error']['message']);return _0x4909e2(_0x28529d[_0xeaba('0x14')][_0xeaba('0x16')]);}else{logger[_0xeaba('0x17')](_0xeaba('0xf'),_0x51fa38,_0xeaba('0x12'));_0x4909e2(_0x28529d['result'][_0xeaba('0x16')]);}})[_0xeaba('0x18')](function(_0x18248f){logger[_0xeaba('0x14')](_0xeaba('0xf'),_0x51fa38,_0x18248f);_0x3ff34c(_0x18248f);});});}exports['CreateSquareRecording']=function(_0xd9e8bd){var _0x4def23=this;return new Promise(function(_0xa0268,_0x4b9f80){return db[_0xeaba('0x19')]['create'](_0xd9e8bd[_0xeaba('0x1a')],{'raw':_0xd9e8bd[_0xeaba('0x1b')]?_0xd9e8bd[_0xeaba('0x1b')][_0xeaba('0x1c')]===undefined?!![]:![]:!![]})[_0xeaba('0xe')](function(_0x5e166c){logger[_0xeaba('0x17')](_0xeaba('0x1d'),_0xd9e8bd);logger[_0xeaba('0x10')](_0xeaba('0x1d'),_0xd9e8bd,JSON[_0xeaba('0x13')](_0x5e166c));_0xa0268(_0x5e166c);})[_0xeaba('0x18')](function(_0x23ec6e){logger[_0xeaba('0x14')](_0xeaba('0x1d'),_0x23ec6e['message'],_0xd9e8bd);_0x4b9f80(_0x4def23[_0xeaba('0x14')](0x1f4,_0x23ec6e[_0xeaba('0x16')]));});});}; \ No newline at end of file +var _0x444f=['message','result','catch','CreateSquareRecording','SquareRecording','create','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x20e702,_0x37eafd){var _0x4cd3a0=function(_0x90105a){while(--_0x90105a){_0x20e702['push'](_0x20e702['shift']());}};_0x4cd3a0(++_0x37eafd);}(_0x444f,0x116));var _0xf444=function(_0x573ea2,_0x1517e4){_0x573ea2=_0x573ea2-0x0;var _0x2dc6ab=_0x444f[_0x573ea2];return _0x2dc6ab;};'use strict';var _=require(_0xf444('0x0'));var util=require(_0xf444('0x1'));var moment=require('moment');var BPromise=require(_0xf444('0x2'));var rs=require(_0xf444('0x3'));var fs=require('fs');var Redis=require(_0xf444('0x4'));var db=require(_0xf444('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf444('0x6'))(_0xf444('0x7'));var config=require(_0xf444('0x8'));var jayson=require(_0xf444('0x9'));var client=jayson[_0xf444('0xa')][_0xf444('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f948a,_0x3311df,_0x4f973d){return new BPromise(function(_0x133682,_0x402d57){return client[_0xf444('0xc')](_0x1f948a,_0x4f973d)[_0xf444('0xd')](function(_0x324e30){logger[_0xf444('0xe')](_0xf444('0xf'),_0x3311df,_0xf444('0x10'));logger[_0xf444('0x11')](_0xf444('0x12'),_0x3311df,'request\x20sent',JSON[_0xf444('0x13')](_0x324e30));if(_0x324e30[_0xf444('0x14')]){if(_0x324e30[_0xf444('0x14')][_0xf444('0x15')]===0x1f4){logger[_0xf444('0x14')](_0xf444('0xf'),_0x3311df,_0x324e30['error'][_0xf444('0x16')]);return _0x402d57(_0x324e30[_0xf444('0x14')]['message']);}logger[_0xf444('0x14')](_0xf444('0xf'),_0x3311df,_0x324e30[_0xf444('0x14')]['message']);return _0x133682(_0x324e30[_0xf444('0x14')][_0xf444('0x16')]);}else{logger[_0xf444('0xe')](_0xf444('0xf'),_0x3311df,'request\x20sent');_0x133682(_0x324e30[_0xf444('0x17')][_0xf444('0x16')]);}})[_0xf444('0x18')](function(_0x2d65a3){logger[_0xf444('0x14')](_0xf444('0xf'),_0x3311df,_0x2d65a3);_0x402d57(_0x2d65a3);});});}exports[_0xf444('0x19')]=function(_0x553d14){var _0x4e3aeb=this;return new Promise(function(_0xef0b34,_0x32e650){return db[_0xf444('0x1a')][_0xf444('0x1b')](_0x553d14['body'],{'raw':_0x553d14[_0xf444('0x1c')]?_0x553d14[_0xf444('0x1c')][_0xf444('0x1d')]===undefined?!![]:![]:!![]})[_0xf444('0xd')](function(_0x39f6f2){logger[_0xf444('0xe')](_0xf444('0x19'),_0x553d14);logger[_0xf444('0x11')](_0xf444('0x19'),_0x553d14,JSON[_0xf444('0x13')](_0x39f6f2));_0xef0b34(_0x39f6f2);})[_0xf444('0x18')](function(_0xc5c517){logger[_0xf444('0x14')](_0xf444('0x19'),_0xc5c517[_0xf444('0x16')],_0x553d14);_0x32e650(_0x4e3aeb['error'](0x1f4,_0xc5c517[_0xf444('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index fe51737..d69bd48 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x5980bd,_0xfe89b1){var _0x2031e9=function(_0x5259b9){while(--_0x5259b9){_0x5980bd['push'](_0x5980bd['shift']());}};_0x2031e9(++_0xfe89b1);}(_0xe706,0xa3));var _0x6e70=function(_0x461c41,_0x2e6d1c){_0x461c41=_0x461c41-0x0;var _0x509e12=_0xe706[_0x461c41];return _0x509e12;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _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(_0x32edac,_0x4520ce){var _0x45a78a=function(_0x1453fd){while(--_0x1453fd){_0x32edac['push'](_0x32edac['shift']());}};_0x45a78a(++_0x4520ce);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'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 54cc66f..52bae5f 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 _0x1b1d=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x243301,_0xf06ab0){var _0x4a55f1=function(_0x19b91e){while(--_0x19b91e){_0x243301['push'](_0x243301['shift']());}};_0x4a55f1(++_0xf06ab0);}(_0x1b1d,0x19c));var _0xd1b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b1d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd1b1('0x0'));module[_0xd1b1('0x1')]={'network':{'type':Sequelize[_0xd1b1('0x2')]},'network_script':{'type':Sequelize[_0xd1b1('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd1b1('0x2')]},'language':{'type':Sequelize[_0xd1b1('0x2')]},'type':{'type':Sequelize[_0xd1b1('0x2')]},'uniqueid':{'type':Sequelize[_0xd1b1('0x2')]},'version':{'type':Sequelize[_0xd1b1('0x2')]},'callerid':{'type':Sequelize[_0xd1b1('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xd1b1('0x2')]},'callingani2':{'type':Sequelize[_0xd1b1('0x2')]},'callington':{'type':Sequelize[_0xd1b1('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd1b1('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd1b1('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xd1b1('0x2')]},'threadid':{'type':Sequelize[_0xd1b1('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd1b1('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xd1b1('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xeb26=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x38a530,_0x59a169){var _0x247238=function(_0x25316d){while(--_0x25316d){_0x38a530['push'](_0x38a530['shift']());}};_0x247238(++_0x59a169);}(_0xeb26,0xbb));var _0x6eb2=function(_0x5c2ee9,_0xa81b37){_0x5c2ee9=_0x5c2ee9-0x0;var _0x103687=_0xeb26[_0x5c2ee9];return _0x103687;};'use strict';var Sequelize=require(_0x6eb2('0x0'));module[_0x6eb2('0x1')]={'network':{'type':Sequelize[_0x6eb2('0x2')]},'network_script':{'type':Sequelize[_0x6eb2('0x2')]},'request':{'type':Sequelize[_0x6eb2('0x2')]},'channel':{'type':Sequelize[_0x6eb2('0x2')]},'language':{'type':Sequelize[_0x6eb2('0x2')]},'type':{'type':Sequelize[_0x6eb2('0x2')]},'uniqueid':{'type':Sequelize[_0x6eb2('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x6eb2('0x2')]},'calleridname':{'type':Sequelize[_0x6eb2('0x2')]},'callingpres':{'type':Sequelize[_0x6eb2('0x2')]},'callingani2':{'type':Sequelize[_0x6eb2('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x6eb2('0x2')]},'dnid':{'type':Sequelize[_0x6eb2('0x2')]},'rdnis':{'type':Sequelize[_0x6eb2('0x2')]},'context':{'type':Sequelize[_0x6eb2('0x2')]},'extension':{'type':Sequelize[_0x6eb2('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x6eb2('0x2')]},'accountcode':{'type':Sequelize[_0x6eb2('0x2')]},'threadid':{'type':Sequelize[_0x6eb2('0x2')]},'project_name':{'type':Sequelize[_0x6eb2('0x2')]},'joinAt':{'type':Sequelize[_0x6eb2('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x6eb2('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 eba83b5..fee9b1c 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 _0x8c24=['keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','find','catch','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','json','apply','save','update','then','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','query'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x8c24,0x67));var _0x48c2=function(_0x459527,_0x5504bd){_0x459527=_0x459527-0x0;var _0x11c192=_0x8c24[_0x459527];return _0x11c192;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x48c2('0x0'));var jsonpatch=require(_0x48c2('0x1'));var rp=require(_0x48c2('0x2'));var moment=require(_0x48c2('0x3'));var BPromise=require(_0x48c2('0x4'));var Mustache=require(_0x48c2('0x5'));var util=require('util');var path=require(_0x48c2('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x48c2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x48c2('0x8'));var jsforce=require(_0x48c2('0x9'));var deskjs=require(_0x48c2('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x48c2('0xb'));var Redis=require(_0x48c2('0xc'));var authService=require(_0x48c2('0xd'));var qs=require(_0x48c2('0xe'));var as=require(_0x48c2('0xf'));var hardwareService=require(_0x48c2('0x10'));var logger=require(_0x48c2('0x11'))(_0x48c2('0x12'));var utils=require('../../config/utils');var config=require(_0x48c2('0x13'));var licenseUtil=require(_0x48c2('0x14'));var db=require(_0x48c2('0x15'))['db'];function respondWithStatusCode(_0x398209,_0x5e322d){_0x5e322d=_0x5e322d||0xcc;return function(_0x23e7c5){if(_0x23e7c5){return _0x398209[_0x48c2('0x16')](_0x5e322d);}return _0x398209['status'](_0x5e322d)['end']();};}function respondWithResult(_0x5cb6da,_0x5ca364){_0x5ca364=_0x5ca364||0xc8;return function(_0x5879c6){if(_0x5879c6){return _0x5cb6da[_0x48c2('0x17')](_0x5ca364)['json'](_0x5879c6);}};}function respondWithFilteredResult(_0xb80d84,_0x3384c5){return function(_0x2b016b){if(_0x2b016b){var _0x4b7caf=typeof _0x3384c5[_0x48c2('0x18')]==='undefined'&&typeof _0x3384c5['limit']===_0x48c2('0x19');var _0x199ec0=_0x2b016b[_0x48c2('0x1a')];var _0xc290c=_0x4b7caf?0x0:_0x3384c5['offset'];var _0x4c0fbb=_0x4b7caf?_0x2b016b[_0x48c2('0x1a')]:_0x3384c5['offset']+_0x3384c5['limit'];var _0x37a7c4;if(_0x4c0fbb>=_0x199ec0){_0x4c0fbb=_0x199ec0;_0x37a7c4=0xc8;}else{_0x37a7c4=0xce;}_0xb80d84['status'](_0x37a7c4);return _0xb80d84[_0x48c2('0x1b')](_0x48c2('0x1c'),_0xc290c+'-'+_0x4c0fbb+'/'+_0x199ec0)[_0x48c2('0x1d')](_0x2b016b);}return null;};}function patchUpdates(_0x265697){return function(_0x43b1f1){try{jsonpatch[_0x48c2('0x1e')](_0x43b1f1,_0x265697,!![]);}catch(_0x397e24){return BPromise['reject'](_0x397e24);}return _0x43b1f1[_0x48c2('0x1f')]();};}function saveUpdates(_0x36f544,_0x47bb3c){return function(_0x11550f){if(_0x11550f){return _0x11550f[_0x48c2('0x20')](_0x36f544)['then'](function(_0xdc897b){return _0xdc897b;});}return null;};}function removeEntity(_0x25ba6f,_0x2ee529){return function(_0x5321ba){if(_0x5321ba){return _0x5321ba['destroy']()[_0x48c2('0x21')](function(){_0x25ba6f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e48a5,_0x3b804b){return function(_0x5d6544){if(!_0x5d6544){_0x3e48a5[_0x48c2('0x16')](0x194);}return _0x5d6544;};}function handleError(_0x2517ec,_0x1b4d17){_0x1b4d17=_0x1b4d17||0x1f4;return function(_0x1d5c6f){logger['error'](_0x1d5c6f[_0x48c2('0x22')]);if(_0x1d5c6f[_0x48c2('0x23')]){delete _0x1d5c6f[_0x48c2('0x23')];}_0x2517ec[_0x48c2('0x17')](_0x1b4d17)[_0x48c2('0x24')](_0x1d5c6f);};}exports[_0x48c2('0x25')]=function(_0x33400a,_0x4f66bf){var _0x501e6f={},_0xc7f471={},_0x2ae02e={'count':0x0,'rows':[]};var _0x62ca62=_[_0x48c2('0x26')](db[_0x48c2('0x27')][_0x48c2('0x28')],function(_0x2b13f0){return{'name':_0x2b13f0[_0x48c2('0x29')],'type':_0x2b13f0[_0x48c2('0x2a')][_0x48c2('0x2b')]};});_0xc7f471['model']=_[_0x48c2('0x26')](_0x62ca62,_0x48c2('0x23'));_0xc7f471[_0x48c2('0x2c')]=_[_0x48c2('0x2d')](_0x33400a[_0x48c2('0x2c')]);_0xc7f471[_0x48c2('0x2e')]=_[_0x48c2('0x2f')](_0xc7f471['model'],_0xc7f471[_0x48c2('0x2c')]);_0x501e6f[_0x48c2('0x30')]=_[_0x48c2('0x2f')](_0xc7f471[_0x48c2('0x31')],qs['fields'](_0x33400a[_0x48c2('0x2c')][_0x48c2('0x32')]));_0x501e6f['attributes']=_0x501e6f[_0x48c2('0x30')][_0x48c2('0x33')]?_0x501e6f[_0x48c2('0x30')]:_0xc7f471[_0x48c2('0x31')];if(!_0x33400a['query'][_0x48c2('0x34')](_0x48c2('0x35'))){_0x501e6f[_0x48c2('0x36')]=qs['limit'](_0x33400a[_0x48c2('0x2c')][_0x48c2('0x36')]);_0x501e6f['offset']=qs[_0x48c2('0x18')](_0x33400a[_0x48c2('0x2c')][_0x48c2('0x18')]);}_0x501e6f[_0x48c2('0x37')]=qs['sort'](_0x33400a[_0x48c2('0x2c')][_0x48c2('0x38')]);_0x501e6f[_0x48c2('0x39')]=qs['filters'](_[_0x48c2('0x3a')](_0x33400a[_0x48c2('0x2c')],_0xc7f471[_0x48c2('0x2e')]),_0x62ca62);if(_0x33400a[_0x48c2('0x2c')][_0x48c2('0x3b')]){_0x501e6f['where']=_[_0x48c2('0x3c')](_0x501e6f['where'],{'$or':_[_0x48c2('0x26')](_0x62ca62,function(_0x40e362){if(_0x40e362[_0x48c2('0x2a')]!==_0x48c2('0x3d')){var _0x5f2d15={};_0x5f2d15[_0x40e362[_0x48c2('0x23')]]={'$like':'%'+_0x33400a[_0x48c2('0x2c')]['filter']+'%'};return _0x5f2d15;}})});}_0x501e6f=_['merge']({},_0x501e6f,_0x33400a[_0x48c2('0x3e')]);var _0x4db6ed={'where':_0x501e6f[_0x48c2('0x39')]};return db[_0x48c2('0x27')][_0x48c2('0x1a')](_0x4db6ed)[_0x48c2('0x21')](function(_0x46f6f4){_0x2ae02e[_0x48c2('0x1a')]=_0x46f6f4;if(_0x33400a[_0x48c2('0x2c')]['includeAll']){_0x501e6f[_0x48c2('0x3f')]=[{'all':!![]}];}return db['SquareReport'][_0x48c2('0x40')](_0x501e6f);})[_0x48c2('0x21')](function(_0x561134){_0x2ae02e[_0x48c2('0x41')]=_0x561134;return _0x2ae02e;})['then'](respondWithFilteredResult(_0x4f66bf,_0x501e6f))['catch'](handleError(_0x4f66bf,null));};exports[_0x48c2('0x42')]=function(_0x248d92,_0x2dcd40){var _0x253c0b={'raw':!![],'where':{'id':_0x248d92[_0x48c2('0x43')]['id']}},_0x3c79c1={};_0x3c79c1[_0x48c2('0x31')]=_['keys'](db['SquareReport'][_0x48c2('0x28')]);_0x3c79c1['query']=_[_0x48c2('0x2d')](_0x248d92['query']);_0x3c79c1[_0x48c2('0x2e')]=_[_0x48c2('0x2f')](_0x3c79c1[_0x48c2('0x31')],_0x3c79c1[_0x48c2('0x2c')]);_0x253c0b[_0x48c2('0x30')]=_[_0x48c2('0x2f')](_0x3c79c1['model'],qs[_0x48c2('0x32')](_0x248d92[_0x48c2('0x2c')]['fields']));_0x253c0b[_0x48c2('0x30')]=_0x253c0b[_0x48c2('0x30')][_0x48c2('0x33')]?_0x253c0b[_0x48c2('0x30')]:_0x3c79c1['model'];if(_0x248d92[_0x48c2('0x2c')]['includeAll']){_0x253c0b[_0x48c2('0x3f')]=[{'all':!![]}];}_0x253c0b=_['merge']({},_0x253c0b,_0x248d92['options']);return db[_0x48c2('0x27')][_0x48c2('0x44')](_0x253c0b)[_0x48c2('0x21')](handleEntityNotFound(_0x2dcd40,null))[_0x48c2('0x21')](respondWithResult(_0x2dcd40,null))[_0x48c2('0x45')](handleError(_0x2dcd40,null));};exports['create']=function(_0x4def8b,_0x2e1f49){return db[_0x48c2('0x27')][_0x48c2('0x46')](_0x4def8b['body'],{})[_0x48c2('0x21')](respondWithResult(_0x2e1f49,0xc9))[_0x48c2('0x45')](handleError(_0x2e1f49,null));};exports['update']=function(_0x39dbb8,_0x16dba8){if(_0x39dbb8[_0x48c2('0x47')]['id']){delete _0x39dbb8[_0x48c2('0x47')]['id'];}return db[_0x48c2('0x27')][_0x48c2('0x44')]({'where':{'id':_0x39dbb8['params']['id']}})[_0x48c2('0x21')](handleEntityNotFound(_0x16dba8,null))[_0x48c2('0x21')](saveUpdates(_0x39dbb8['body'],null))[_0x48c2('0x21')](respondWithResult(_0x16dba8,null))['catch'](handleError(_0x16dba8,null));};exports[_0x48c2('0x48')]=function(_0x6ecb41,_0x7ba3f0){return db[_0x48c2('0x27')][_0x48c2('0x44')]({'where':{'id':_0x6ecb41[_0x48c2('0x43')]['id']}})[_0x48c2('0x21')](handleEntityNotFound(_0x7ba3f0,null))[_0x48c2('0x21')](removeEntity(_0x7ba3f0,null))[_0x48c2('0x45')](handleError(_0x7ba3f0,null));};exports[_0x48c2('0x49')]=function(_0x1af5ff,_0x78d059){return db[_0x48c2('0x27')][_0x48c2('0x49')]()[_0x48c2('0x21')](respondWithResult(_0x78d059,null))[_0x48c2('0x45')](handleError(_0x78d059,null));}; \ No newline at end of file +var _0x4408=['../../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','save','update','then','destroy','error','stack','name','send','map','SquareReport','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0xe21db6,_0x324d33){var _0x3b45f8=function(_0x36ad38){while(--_0x36ad38){_0xe21db6['push'](_0xe21db6['shift']());}};_0x3b45f8(++_0x324d33);}(_0x4408,0xd9));var _0x8440=function(_0x370ab8,_0x9491f7){_0x370ab8=_0x370ab8-0x0;var _0x3f0209=_0x4408[_0x370ab8];return _0x3f0209;};'use strict';var emlformat=require(_0x8440('0x0'));var rimraf=require(_0x8440('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8440('0x2'));var rp=require(_0x8440('0x3'));var moment=require(_0x8440('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8440('0x5'));var util=require(_0x8440('0x6'));var path=require(_0x8440('0x7'));var sox=require(_0x8440('0x8'));var csv=require(_0x8440('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8440('0xa'));var _=require('lodash');var squel=require(_0x8440('0xb'));var crypto=require(_0x8440('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8440('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8440('0xe'));var Papa=require(_0x8440('0xf'));var Redis=require(_0x8440('0x10'));var authService=require(_0x8440('0x11'));var qs=require(_0x8440('0x12'));var as=require(_0x8440('0x13'));var hardwareService=require(_0x8440('0x14'));var logger=require(_0x8440('0x15'))(_0x8440('0x16'));var utils=require(_0x8440('0x17'));var config=require(_0x8440('0x18'));var licenseUtil=require(_0x8440('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f8bf1,_0x330d3b){_0x330d3b=_0x330d3b||0xcc;return function(_0x36274b){if(_0x36274b){return _0x1f8bf1[_0x8440('0x1a')](_0x330d3b);}return _0x1f8bf1[_0x8440('0x1b')](_0x330d3b)[_0x8440('0x1c')]();};}function respondWithResult(_0x3f8327,_0x36d484){_0x36d484=_0x36d484||0xc8;return function(_0x172c30){if(_0x172c30){return _0x3f8327[_0x8440('0x1b')](_0x36d484)[_0x8440('0x1d')](_0x172c30);}};}function respondWithFilteredResult(_0x93da6b,_0x511c4d){return function(_0x591587){if(_0x591587){var _0x2d6664=typeof _0x511c4d[_0x8440('0x1e')]===_0x8440('0x1f')&&typeof _0x511c4d[_0x8440('0x20')]===_0x8440('0x1f');var _0x26fce9=_0x591587[_0x8440('0x21')];var _0x479ec2=_0x2d6664?0x0:_0x511c4d['offset'];var _0x169611=_0x2d6664?_0x591587[_0x8440('0x21')]:_0x511c4d[_0x8440('0x1e')]+_0x511c4d[_0x8440('0x20')];var _0x3376b8;if(_0x169611>=_0x26fce9){_0x169611=_0x26fce9;_0x3376b8=0xc8;}else{_0x3376b8=0xce;}_0x93da6b[_0x8440('0x1b')](_0x3376b8);return _0x93da6b[_0x8440('0x22')](_0x8440('0x23'),_0x479ec2+'-'+_0x169611+'/'+_0x26fce9)['json'](_0x591587);}return null;};}function patchUpdates(_0x3df83d){return function(_0x224192){try{jsonpatch['apply'](_0x224192,_0x3df83d,!![]);}catch(_0x224d4c){return BPromise[_0x8440('0x24')](_0x224d4c);}return _0x224192[_0x8440('0x25')]();};}function saveUpdates(_0x35e0fb,_0x58c0a5){return function(_0x58d0ad){if(_0x58d0ad){return _0x58d0ad[_0x8440('0x26')](_0x35e0fb)[_0x8440('0x27')](function(_0x48c64e){return _0x48c64e;});}return null;};}function removeEntity(_0x52af19,_0x28e87c){return function(_0x1bbdf6){if(_0x1bbdf6){return _0x1bbdf6[_0x8440('0x28')]()[_0x8440('0x27')](function(){_0x52af19[_0x8440('0x1b')](0xcc)[_0x8440('0x1c')]();});}};}function handleEntityNotFound(_0x530ff2,_0x19d066){return function(_0xafa3ab){if(!_0xafa3ab){_0x530ff2['sendStatus'](0x194);}return _0xafa3ab;};}function handleError(_0x197763,_0x41044a){_0x41044a=_0x41044a||0x1f4;return function(_0x18dce2){logger[_0x8440('0x29')](_0x18dce2[_0x8440('0x2a')]);if(_0x18dce2[_0x8440('0x2b')]){delete _0x18dce2[_0x8440('0x2b')];}_0x197763[_0x8440('0x1b')](_0x41044a)[_0x8440('0x2c')](_0x18dce2);};}exports['index']=function(_0x4f0829,_0x58b46a){var _0x3979f8={},_0x33d552={},_0x53a371={'count':0x0,'rows':[]};var _0x371523=_[_0x8440('0x2d')](db[_0x8440('0x2e')][_0x8440('0x2f')],function(_0x3b0dcc){return{'name':_0x3b0dcc['fieldName'],'type':_0x3b0dcc['type']['key']};});_0x33d552[_0x8440('0x30')]=_[_0x8440('0x2d')](_0x371523,_0x8440('0x2b'));_0x33d552[_0x8440('0x31')]=_[_0x8440('0x32')](_0x4f0829[_0x8440('0x31')]);_0x33d552[_0x8440('0x33')]=_['intersection'](_0x33d552[_0x8440('0x30')],_0x33d552[_0x8440('0x31')]);_0x3979f8[_0x8440('0x34')]=_[_0x8440('0x35')](_0x33d552[_0x8440('0x30')],qs[_0x8440('0x36')](_0x4f0829[_0x8440('0x31')][_0x8440('0x36')]));_0x3979f8['attributes']=_0x3979f8[_0x8440('0x34')][_0x8440('0x37')]?_0x3979f8['attributes']:_0x33d552[_0x8440('0x30')];if(!_0x4f0829[_0x8440('0x31')][_0x8440('0x38')](_0x8440('0x39'))){_0x3979f8['limit']=qs[_0x8440('0x20')](_0x4f0829['query']['limit']);_0x3979f8['offset']=qs['offset'](_0x4f0829[_0x8440('0x31')][_0x8440('0x1e')]);}_0x3979f8[_0x8440('0x3a')]=qs[_0x8440('0x3b')](_0x4f0829[_0x8440('0x31')][_0x8440('0x3b')]);_0x3979f8[_0x8440('0x3c')]=qs[_0x8440('0x33')](_[_0x8440('0x3d')](_0x4f0829[_0x8440('0x31')],_0x33d552[_0x8440('0x33')]),_0x371523);if(_0x4f0829[_0x8440('0x31')][_0x8440('0x3e')]){_0x3979f8[_0x8440('0x3c')]=_[_0x8440('0x3f')](_0x3979f8[_0x8440('0x3c')],{'$or':_['map'](_0x371523,function(_0x5acc50){if(_0x5acc50[_0x8440('0x40')]!==_0x8440('0x41')){var _0x2a7976={};_0x2a7976[_0x5acc50[_0x8440('0x2b')]]={'$like':'%'+_0x4f0829['query'][_0x8440('0x3e')]+'%'};return _0x2a7976;}})});}_0x3979f8=_[_0x8440('0x3f')]({},_0x3979f8,_0x4f0829[_0x8440('0x42')]);var _0x5ea43c={'where':_0x3979f8[_0x8440('0x3c')]};return db[_0x8440('0x2e')][_0x8440('0x21')](_0x5ea43c)[_0x8440('0x27')](function(_0x45c8fd){_0x53a371['count']=_0x45c8fd;if(_0x4f0829[_0x8440('0x31')]['includeAll']){_0x3979f8[_0x8440('0x43')]=[{'all':!![]}];}return db[_0x8440('0x2e')][_0x8440('0x44')](_0x3979f8);})[_0x8440('0x27')](function(_0x21b256){_0x53a371[_0x8440('0x45')]=_0x21b256;return _0x53a371;})['then'](respondWithFilteredResult(_0x58b46a,_0x3979f8))[_0x8440('0x46')](handleError(_0x58b46a,null));};exports[_0x8440('0x47')]=function(_0x24f289,_0x22252f){var _0x115e0f={'raw':!![],'where':{'id':_0x24f289[_0x8440('0x48')]['id']}},_0x57a65c={};_0x57a65c[_0x8440('0x30')]=_[_0x8440('0x32')](db[_0x8440('0x2e')][_0x8440('0x2f')]);_0x57a65c[_0x8440('0x31')]=_[_0x8440('0x32')](_0x24f289[_0x8440('0x31')]);_0x57a65c[_0x8440('0x33')]=_['intersection'](_0x57a65c[_0x8440('0x30')],_0x57a65c['query']);_0x115e0f[_0x8440('0x34')]=_[_0x8440('0x35')](_0x57a65c[_0x8440('0x30')],qs[_0x8440('0x36')](_0x24f289[_0x8440('0x31')][_0x8440('0x36')]));_0x115e0f[_0x8440('0x34')]=_0x115e0f[_0x8440('0x34')][_0x8440('0x37')]?_0x115e0f[_0x8440('0x34')]:_0x57a65c[_0x8440('0x30')];if(_0x24f289['query'][_0x8440('0x49')]){_0x115e0f[_0x8440('0x43')]=[{'all':!![]}];}_0x115e0f=_[_0x8440('0x3f')]({},_0x115e0f,_0x24f289[_0x8440('0x42')]);return db[_0x8440('0x2e')][_0x8440('0x4a')](_0x115e0f)[_0x8440('0x27')](handleEntityNotFound(_0x22252f,null))[_0x8440('0x27')](respondWithResult(_0x22252f,null))[_0x8440('0x46')](handleError(_0x22252f,null));};exports[_0x8440('0x4b')]=function(_0x3bf7b8,_0x3e3fcf){return db['SquareReport'][_0x8440('0x4b')](_0x3bf7b8[_0x8440('0x4c')],{})[_0x8440('0x27')](respondWithResult(_0x3e3fcf,0xc9))[_0x8440('0x46')](handleError(_0x3e3fcf,null));};exports[_0x8440('0x26')]=function(_0x2d9608,_0x251cc9){if(_0x2d9608['body']['id']){delete _0x2d9608[_0x8440('0x4c')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x2d9608[_0x8440('0x48')]['id']}})[_0x8440('0x27')](handleEntityNotFound(_0x251cc9,null))[_0x8440('0x27')](saveUpdates(_0x2d9608[_0x8440('0x4c')],null))[_0x8440('0x27')](respondWithResult(_0x251cc9,null))[_0x8440('0x46')](handleError(_0x251cc9,null));};exports['destroy']=function(_0xbaad46,_0x368d31){return db[_0x8440('0x2e')][_0x8440('0x4a')]({'where':{'id':_0xbaad46[_0x8440('0x48')]['id']}})[_0x8440('0x27')](handleEntityNotFound(_0x368d31,null))[_0x8440('0x27')](removeEntity(_0x368d31,null))[_0x8440('0x46')](handleError(_0x368d31,null));};exports['describe']=function(_0x1640fd,_0x229091){return db[_0x8440('0x2e')][_0x8440('0x4d')]()['then'](respondWithResult(_0x229091,null))[_0x8440('0x46')](handleError(_0x229091,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index cf877af..aee4c5d 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 _0x937d=['path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','leaveAt','util','../../config/logger','api','bluebird','request-promise'];(function(_0x485422,_0x2f8317){var _0x5165de=function(_0x66f04d){while(--_0x66f04d){_0x485422['push'](_0x485422['shift']());}};_0x5165de(++_0x2f8317);}(_0x937d,0x16b));var _0xd937=function(_0x3ddb70,_0x39fe5e){_0x3ddb70=_0x3ddb70-0x0;var _0x110e62=_0x937d[_0x3ddb70];return _0x110e62;};'use strict';var _=require('lodash');var util=require(_0xd937('0x0'));var logger=require(_0xd937('0x1'))(_0xd937('0x2'));var moment=require('moment');var BPromise=require(_0xd937('0x3'));var rp=require(_0xd937('0x4'));var fs=require('fs');var path=require(_0xd937('0x5'));var rimraf=require(_0xd937('0x6'));var config=require(_0xd937('0x7'));var attributes=require(_0xd937('0x8'));module[_0xd937('0x9')]=function(_0x155904,_0x366c8b){return _0x155904[_0xd937('0xa')](_0xd937('0xb'),attributes,{'tableName':_0xd937('0xc'),'paranoid':![],'indexes':[{'name':_0xd937('0xd'),'fields':[_0xd937('0xe'),'project_name']},{'name':_0xd937('0xf'),'fields':[_0xd937('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5b20=['SquareReport','report_square','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./squareReport.attributes','exports','define'];(function(_0x4c05da,_0x414720){var _0x1614db=function(_0xa19cf6){while(--_0xa19cf6){_0x4c05da['push'](_0x4c05da['shift']());}};_0x1614db(++_0x414720);}(_0x5b20,0xe5));var _0x05b2=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5b20[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x05b2('0x0'));var util=require(_0x05b2('0x1'));var logger=require(_0x05b2('0x2'))(_0x05b2('0x3'));var moment=require(_0x05b2('0x4'));var BPromise=require('bluebird');var rp=require(_0x05b2('0x5'));var fs=require('fs');var path=require(_0x05b2('0x6'));var rimraf=require('rimraf');var config=require(_0x05b2('0x7'));var attributes=require(_0x05b2('0x8'));module[_0x05b2('0x9')]=function(_0x486996,_0x248ed2){return _0x486996[_0x05b2('0xa')](_0x05b2('0xb'),attributes,{'tableName':_0x05b2('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x05b2('0xd'),_0x05b2('0xe')]},{'name':'leaveAt','fields':[_0x05b2('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index bf651cd..4cfa230 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 _0x3579=['request','then','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','SquareReport','options','raw','debug','CreateSquareReport','UpdateSquareReport','update','body','where','attributes','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1e2bec,_0x1f5951){var _0x2e2109=function(_0xf5594c){while(--_0xf5594c){_0x1e2bec['push'](_0x1e2bec['shift']());}};_0x2e2109(++_0x1f5951);}(_0x3579,0x18e));var _0x9357=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x3579[_0x34843e];return _0x598f7f;};'use strict';var _=require('lodash');var util=require(_0x9357('0x0'));var moment=require(_0x9357('0x1'));var BPromise=require(_0x9357('0x2'));var rs=require(_0x9357('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9357('0x4'));var logger=require('../../config/logger')(_0x9357('0x5'));var config=require(_0x9357('0x6'));var jayson=require(_0x9357('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc3d96,_0x193022,_0x50f570){return new BPromise(function(_0x254a95,_0x44a873){return client[_0x9357('0x8')](_0xc3d96,_0x50f570)[_0x9357('0x9')](function(_0x1e4030){logger['info'](_0x9357('0xa'),_0x193022,_0x9357('0xb'));logger['debug'](_0x9357('0xc'),_0x193022,_0x9357('0xb'),JSON[_0x9357('0xd')](_0x1e4030));if(_0x1e4030['error']){if(_0x1e4030[_0x9357('0xe')]['code']===0x1f4){logger[_0x9357('0xe')](_0x9357('0xa'),_0x193022,_0x1e4030[_0x9357('0xe')][_0x9357('0xf')]);return _0x44a873(_0x1e4030[_0x9357('0xe')][_0x9357('0xf')]);}logger[_0x9357('0xe')](_0x9357('0xa'),_0x193022,_0x1e4030['error'][_0x9357('0xf')]);return _0x254a95(_0x1e4030[_0x9357('0xe')][_0x9357('0xf')]);}else{logger[_0x9357('0x10')](_0x9357('0xa'),_0x193022,_0x9357('0xb'));_0x254a95(_0x1e4030[_0x9357('0x11')][_0x9357('0xf')]);}})[_0x9357('0x12')](function(_0x3a5b28){logger['error'](_0x9357('0xa'),_0x193022,_0x3a5b28);_0x44a873(_0x3a5b28);});});}exports['CreateSquareReport']=function(_0xbc8139){var _0x32d17b=this;return new Promise(function(_0x204f12,_0x5a3009){return db[_0x9357('0x13')]['create'](_0xbc8139['body'],{'raw':_0xbc8139[_0x9357('0x14')]?_0xbc8139[_0x9357('0x14')][_0x9357('0x15')]===undefined?!![]:![]:!![]})[_0x9357('0x9')](function(_0x444999){logger[_0x9357('0x10')]('CreateSquareReport',_0xbc8139);logger[_0x9357('0x16')](_0x9357('0x17'),_0xbc8139,JSON[_0x9357('0xd')](_0x444999));_0x204f12(_0x444999);})[_0x9357('0x12')](function(_0x2b4fd8){logger[_0x9357('0xe')](_0x9357('0x17'),_0x2b4fd8[_0x9357('0xf')],_0xbc8139);_0x5a3009(_0x32d17b[_0x9357('0xe')](0x1f4,_0x2b4fd8['message']));});});};exports[_0x9357('0x18')]=function(_0x9e579d){var _0x2a5f5c=this;return new Promise(function(_0x401442,_0x1944b9){return db[_0x9357('0x13')][_0x9357('0x19')](_0x9e579d[_0x9357('0x1a')],{'raw':_0x9e579d[_0x9357('0x14')]?_0x9e579d['options'][_0x9357('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9e579d[_0x9357('0x14')]?_0x9e579d[_0x9357('0x14')][_0x9357('0x1b')]||null:null,'attributes':_0x9e579d[_0x9357('0x14')]?_0x9e579d[_0x9357('0x14')][_0x9357('0x1c')]||null:null,'limit':_0x9e579d['options']?_0x9e579d[_0x9357('0x14')]['limit']||null:null})[_0x9357('0x9')](function(_0x2cbc33){logger[_0x9357('0x10')](_0x9357('0x18'),_0x9e579d);logger['debug'](_0x9357('0x18'),_0x9e579d,JSON['stringify'](_0x2cbc33));_0x401442(_0x2cbc33);})[_0x9357('0x12')](function(_0x579c61){logger['error'](_0x9357('0x18'),_0x579c61['message'],_0x9e579d);_0x1944b9(_0x2a5f5c[_0x9357('0xe')](0x1f4,_0x579c61[_0x9357('0xf')]));});});}; \ No newline at end of file +var _0x3f60=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','info','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','create','body','options','then','SquareReport','raw','where','attributes','limit','UpdateSquareReport','lodash','util','moment','bluebird'];(function(_0x373b82,_0xc66d54){var _0x3e134b=function(_0x197179){while(--_0x197179){_0x373b82['push'](_0x373b82['shift']());}};_0x3e134b(++_0xc66d54);}(_0x3f60,0x80));var _0x03f6=function(_0x44b827,_0x1bb1aa){_0x44b827=_0x44b827-0x0;var _0x527342=_0x3f60[_0x44b827];return _0x527342;};'use strict';var _=require(_0x03f6('0x0'));var util=require(_0x03f6('0x1'));var moment=require(_0x03f6('0x2'));var BPromise=require(_0x03f6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03f6('0x4'));var db=require(_0x03f6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x03f6('0x6'))(_0x03f6('0x7'));var config=require('../../config/environment');var jayson=require(_0x03f6('0x8'));var client=jayson[_0x03f6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28f84a,_0x102afd,_0x3c256e){return new BPromise(function(_0x36bf65,_0x13ed8b){return client[_0x03f6('0xa')](_0x28f84a,_0x3c256e)['then'](function(_0x3471aa){logger[_0x03f6('0xb')]('SquareReport,\x20%s,\x20%s',_0x102afd,'request\x20sent');logger[_0x03f6('0xc')](_0x03f6('0xd'),_0x102afd,_0x03f6('0xe'),JSON[_0x03f6('0xf')](_0x3471aa));if(_0x3471aa[_0x03f6('0x10')]){if(_0x3471aa[_0x03f6('0x10')][_0x03f6('0x11')]===0x1f4){logger[_0x03f6('0x10')](_0x03f6('0x12'),_0x102afd,_0x3471aa[_0x03f6('0x10')]['message']);return _0x13ed8b(_0x3471aa[_0x03f6('0x10')][_0x03f6('0x13')]);}logger[_0x03f6('0x10')](_0x03f6('0x12'),_0x102afd,_0x3471aa['error']['message']);return _0x36bf65(_0x3471aa[_0x03f6('0x10')][_0x03f6('0x13')]);}else{logger[_0x03f6('0xb')]('SquareReport,\x20%s,\x20%s',_0x102afd,_0x03f6('0xe'));_0x36bf65(_0x3471aa[_0x03f6('0x14')][_0x03f6('0x13')]);}})[_0x03f6('0x15')](function(_0x20481){logger['error']('SquareReport,\x20%s,\x20%s',_0x102afd,_0x20481);_0x13ed8b(_0x20481);});});}exports[_0x03f6('0x16')]=function(_0x43dc94){var _0x4760bf=this;return new Promise(function(_0x8c9f58,_0x5949eb){return db['SquareReport'][_0x03f6('0x17')](_0x43dc94[_0x03f6('0x18')],{'raw':_0x43dc94[_0x03f6('0x19')]?_0x43dc94[_0x03f6('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x03f6('0x1a')](function(_0x10d860){logger[_0x03f6('0xb')](_0x03f6('0x16'),_0x43dc94);logger[_0x03f6('0xc')](_0x03f6('0x16'),_0x43dc94,JSON['stringify'](_0x10d860));_0x8c9f58(_0x10d860);})['catch'](function(_0x25b786){logger[_0x03f6('0x10')](_0x03f6('0x16'),_0x25b786[_0x03f6('0x13')],_0x43dc94);_0x5949eb(_0x4760bf['error'](0x1f4,_0x25b786[_0x03f6('0x13')]));});});};exports['UpdateSquareReport']=function(_0x37e326){var _0x6fd0ce=this;return new Promise(function(_0x2f4371,_0x53da59){return db[_0x03f6('0x1b')]['update'](_0x37e326[_0x03f6('0x18')],{'raw':_0x37e326['options']?_0x37e326[_0x03f6('0x19')][_0x03f6('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37e326[_0x03f6('0x19')]?_0x37e326[_0x03f6('0x19')][_0x03f6('0x1d')]||null:null,'attributes':_0x37e326[_0x03f6('0x19')]?_0x37e326[_0x03f6('0x19')][_0x03f6('0x1e')]||null:null,'limit':_0x37e326[_0x03f6('0x19')]?_0x37e326['options'][_0x03f6('0x1f')]||null:null})['then'](function(_0x26c502){logger[_0x03f6('0xb')](_0x03f6('0x20'),_0x37e326);logger['debug'](_0x03f6('0x20'),_0x37e326,JSON['stringify'](_0x26c502));_0x2f4371(_0x26c502);})[_0x03f6('0x15')](function(_0x25b4a4){logger[_0x03f6('0x10')]('UpdateSquareReport',_0x25b4a4[_0x03f6('0x13')],_0x37e326);_0x53da59(_0x6fd0ce[_0x03f6('0x10')](0x1f4,_0x25b4a4[_0x03f6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index f69c6ef..714c904 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 _0xbd37=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x331746,_0x2543f7){var _0x57dc5d=function(_0x31b3d0){while(--_0x31b3d0){_0x331746['push'](_0x331746['shift']());}};_0x57dc5d(++_0x2543f7);}(_0xbd37,0x1b6));var _0x7bd3=function(_0xa3ffc1,_0x17f690){_0xa3ffc1=_0xa3ffc1-0x0;var _0x3d7ed6=_0xbd37[_0xa3ffc1];return _0x3d7ed6;};'use strict';var multer=require(_0x7bd3('0x0'));var util=require(_0x7bd3('0x1'));var path=require(_0x7bd3('0x2'));var timeout=require(_0x7bd3('0x3'));var express=require('express');var router=express[_0x7bd3('0x4')]();var fs_extra=require(_0x7bd3('0x5'));var auth=require(_0x7bd3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7bd3('0x7'));var controller=require(_0x7bd3('0x8'));router['get']('/',auth[_0x7bd3('0x9')](),controller[_0x7bd3('0xa')]);router[_0x7bd3('0xb')](_0x7bd3('0xc'),auth[_0x7bd3('0x9')](),controller[_0x7bd3('0xd')]);router['get'](_0x7bd3('0xe'),auth[_0x7bd3('0x9')](),controller['show']);router[_0x7bd3('0xf')]('/',auth[_0x7bd3('0x9')](),controller[_0x7bd3('0x10')]);router[_0x7bd3('0x11')](_0x7bd3('0xe'),auth[_0x7bd3('0x9')](),controller[_0x7bd3('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7bd3('0x13')]);module[_0x7bd3('0x14')]=router; \ No newline at end of file +var _0x558e=['create','put','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x558e,0x193));var _0xe558=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x558e[_0x1bbc08];return _0x5d825b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe558('0x0'));var timeout=require(_0xe558('0x1'));var express=require(_0xe558('0x2'));var router=express[_0xe558('0x3')]();var fs_extra=require(_0xe558('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe558('0x5'));var config=require(_0xe558('0x6'));var controller=require(_0xe558('0x7'));router[_0xe558('0x8')]('/',auth[_0xe558('0x9')](),controller[_0xe558('0xa')]);router[_0xe558('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xe558('0xb')]);router[_0xe558('0x8')](_0xe558('0xc'),auth[_0xe558('0x9')](),controller[_0xe558('0xd')]);router[_0xe558('0xe')]('/',auth[_0xe558('0x9')](),controller[_0xe558('0xf')]);router[_0xe558('0x10')](_0xe558('0xc'),auth[_0xe558('0x9')](),controller['update']);router[_0xe558('0x11')]('/:id',auth[_0xe558('0x9')](),controller[_0xe558('0x12')]);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 21a8d4d..37002b5 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 _0x1176=['TEXT','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x1176,0xd9));var _0x6117=function(_0x28ccb1,_0x30ab8e){_0x28ccb1=_0x28ccb1-0x0;var _0x1d7255=_0x1176[_0x28ccb1];return _0x1d7255;};'use strict';var Sequelize=require('sequelize');module[_0x6117('0x0')]={'uniqueid':{'type':Sequelize[_0x6117('0x1')]},'node':{'type':Sequelize[_0x6117('0x1')]},'application':{'type':Sequelize[_0x6117('0x1')]},'data':{'type':Sequelize[_0x6117('0x2')]},'project_name':{'type':Sequelize[_0x6117('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9b10=['exports','STRING','TEXT','sequelize'];(function(_0x2db3a5,_0xa63093){var _0x537340=function(_0x155108){while(--_0x155108){_0x2db3a5['push'](_0x2db3a5['shift']());}};_0x537340(++_0xa63093);}(_0x9b10,0x137));var _0x09b1=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x9b10[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0x09b1('0x0'));module[_0x09b1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x09b1('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x09b1('0x3')]},'project_name':{'type':Sequelize[_0x09b1('0x2')]},'callerid':{'type':Sequelize[_0x09b1('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index b7e2937..00c7e71 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 _0x2110=['fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','set','apply','reject','save','then','destroy','error','stack','name','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','filter','options','SquareDetailsReport','includeAll','findAll','catch','show','params','rawAttributes','keys','length','include','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv'];(function(_0x5d8096,_0x725a4a){var _0x44a609=function(_0x613176){while(--_0x613176){_0x5d8096['push'](_0x5d8096['shift']());}};_0x44a609(++_0x725a4a);}(_0x2110,0x160));var _0x0211=function(_0x44e2b8,_0x36ce4c){_0x44e2b8=_0x44e2b8-0x0;var _0x12b406=_0x2110[_0x44e2b8];return _0x12b406;};'use strict';var emlformat=require(_0x0211('0x0'));var rimraf=require(_0x0211('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0211('0x2'));var rp=require(_0x0211('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0211('0x4'));var util=require(_0x0211('0x5'));var path=require(_0x0211('0x6'));var sox=require('sox');var csv=require(_0x0211('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0211('0x8'));var _=require(_0x0211('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0211('0xa'));var deskjs=require(_0x0211('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0211('0xc'));var Redis=require(_0x0211('0xd'));var authService=require(_0x0211('0xe'));var qs=require(_0x0211('0xf'));var as=require(_0x0211('0x10'));var hardwareService=require(_0x0211('0x11'));var logger=require(_0x0211('0x12'))(_0x0211('0x13'));var utils=require(_0x0211('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0211('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10045d,_0x535022){_0x535022=_0x535022||0xcc;return function(_0x9073a1){if(_0x9073a1){return _0x10045d[_0x0211('0x16')](_0x535022);}return _0x10045d['status'](_0x535022)[_0x0211('0x17')]();};}function respondWithResult(_0xc1c8a6,_0x4817c9){_0x4817c9=_0x4817c9||0xc8;return function(_0x28d8d0){if(_0x28d8d0){return _0xc1c8a6[_0x0211('0x18')](_0x4817c9)['json'](_0x28d8d0);}};}function respondWithFilteredResult(_0x4131e3,_0xa5cabe){return function(_0x29c560){if(_0x29c560){var _0x49b817=typeof _0xa5cabe[_0x0211('0x19')]===_0x0211('0x1a')&&typeof _0xa5cabe['limit']===_0x0211('0x1a');var _0x4734af=_0x29c560[_0x0211('0x1b')];var _0x45cb8e=_0x49b817?0x0:_0xa5cabe[_0x0211('0x19')];var _0x1876ba=_0x49b817?_0x29c560[_0x0211('0x1b')]:_0xa5cabe[_0x0211('0x19')]+_0xa5cabe[_0x0211('0x1c')];var _0xfb47bc;if(_0x1876ba>=_0x4734af){_0x1876ba=_0x4734af;_0xfb47bc=0xc8;}else{_0xfb47bc=0xce;}_0x4131e3['status'](_0xfb47bc);return _0x4131e3[_0x0211('0x1d')]('Content-Range',_0x45cb8e+'-'+_0x1876ba+'/'+_0x4734af)['json'](_0x29c560);}return null;};}function patchUpdates(_0xde5caf){return function(_0x1c77a7){try{jsonpatch[_0x0211('0x1e')](_0x1c77a7,_0xde5caf,!![]);}catch(_0x32aafc){return BPromise[_0x0211('0x1f')](_0x32aafc);}return _0x1c77a7[_0x0211('0x20')]();};}function saveUpdates(_0x30078d,_0x4aa9ff){return function(_0x437f97){if(_0x437f97){return _0x437f97['update'](_0x30078d)[_0x0211('0x21')](function(_0x43ef49){return _0x43ef49;});}return null;};}function removeEntity(_0x414da7,_0x3bae5f){return function(_0x516063){if(_0x516063){return _0x516063[_0x0211('0x22')]()[_0x0211('0x21')](function(){_0x414da7['status'](0xcc)[_0x0211('0x17')]();});}};}function handleEntityNotFound(_0x4de62e,_0x2d9086){return function(_0x138744){if(!_0x138744){_0x4de62e[_0x0211('0x16')](0x194);}return _0x138744;};}function handleError(_0x1c260b,_0x5c59d2){_0x5c59d2=_0x5c59d2||0x1f4;return function(_0x3dd27e){logger[_0x0211('0x23')](_0x3dd27e[_0x0211('0x24')]);if(_0x3dd27e['name']){delete _0x3dd27e[_0x0211('0x25')];}_0x1c260b['status'](_0x5c59d2)['send'](_0x3dd27e);};}exports[_0x0211('0x26')]=function(_0x1d9682,_0x3f2468){var _0x3b9e38={},_0x20683a={},_0x3cfaf4={'count':0x0,'rows':[]};var _0x490f34=_[_0x0211('0x27')](db['SquareDetailsReport']['rawAttributes'],function(_0x3e2f9d){return{'name':_0x3e2f9d[_0x0211('0x28')],'type':_0x3e2f9d[_0x0211('0x29')][_0x0211('0x2a')]};});_0x20683a[_0x0211('0x2b')]=_[_0x0211('0x27')](_0x490f34,_0x0211('0x25'));_0x20683a[_0x0211('0x2c')]=_['keys'](_0x1d9682[_0x0211('0x2c')]);_0x20683a[_0x0211('0x2d')]=_[_0x0211('0x2e')](_0x20683a['model'],_0x20683a[_0x0211('0x2c')]);_0x3b9e38['attributes']=_[_0x0211('0x2e')](_0x20683a[_0x0211('0x2b')],qs[_0x0211('0x2f')](_0x1d9682[_0x0211('0x2c')][_0x0211('0x2f')]));_0x3b9e38[_0x0211('0x30')]=_0x3b9e38[_0x0211('0x30')]['length']?_0x3b9e38[_0x0211('0x30')]:_0x20683a['model'];if(!_0x1d9682[_0x0211('0x2c')][_0x0211('0x31')]('nolimit')){_0x3b9e38[_0x0211('0x1c')]=qs['limit'](_0x1d9682['query'][_0x0211('0x1c')]);_0x3b9e38['offset']=qs[_0x0211('0x19')](_0x1d9682[_0x0211('0x2c')][_0x0211('0x19')]);}_0x3b9e38[_0x0211('0x32')]=qs[_0x0211('0x33')](_0x1d9682[_0x0211('0x2c')][_0x0211('0x33')]);_0x3b9e38[_0x0211('0x34')]=qs[_0x0211('0x2d')](_[_0x0211('0x35')](_0x1d9682[_0x0211('0x2c')],_0x20683a[_0x0211('0x2d')]),_0x490f34);if(_0x1d9682[_0x0211('0x2c')]['filter']){_0x3b9e38['where']=_[_0x0211('0x36')](_0x3b9e38[_0x0211('0x34')],{'$or':_[_0x0211('0x27')](_0x490f34,function(_0x84966f){if(_0x84966f[_0x0211('0x29')]!=='VIRTUAL'){var _0x4c9b7e={};_0x4c9b7e[_0x84966f[_0x0211('0x25')]]={'$like':'%'+_0x1d9682['query'][_0x0211('0x37')]+'%'};return _0x4c9b7e;}})});}_0x3b9e38=_[_0x0211('0x36')]({},_0x3b9e38,_0x1d9682[_0x0211('0x38')]);var _0x26262b={'where':_0x3b9e38[_0x0211('0x34')]};return db[_0x0211('0x39')]['count'](_0x26262b)[_0x0211('0x21')](function(_0x5cf183){_0x3cfaf4['count']=_0x5cf183;if(_0x1d9682[_0x0211('0x2c')][_0x0211('0x3a')]){_0x3b9e38['include']=[{'all':!![]}];}return db[_0x0211('0x39')][_0x0211('0x3b')](_0x3b9e38);})[_0x0211('0x21')](function(_0x587f90){_0x3cfaf4['rows']=_0x587f90;return _0x3cfaf4;})[_0x0211('0x21')](respondWithFilteredResult(_0x3f2468,_0x3b9e38))[_0x0211('0x3c')](handleError(_0x3f2468,null));};exports[_0x0211('0x3d')]=function(_0x1e642b,_0x396b2a){var _0xb5619b={'raw':!![],'where':{'id':_0x1e642b[_0x0211('0x3e')]['id']}},_0x409f64={};_0x409f64[_0x0211('0x2b')]=_['keys'](db[_0x0211('0x39')][_0x0211('0x3f')]);_0x409f64[_0x0211('0x2c')]=_[_0x0211('0x40')](_0x1e642b['query']);_0x409f64[_0x0211('0x2d')]=_['intersection'](_0x409f64[_0x0211('0x2b')],_0x409f64[_0x0211('0x2c')]);_0xb5619b[_0x0211('0x30')]=_[_0x0211('0x2e')](_0x409f64[_0x0211('0x2b')],qs[_0x0211('0x2f')](_0x1e642b[_0x0211('0x2c')][_0x0211('0x2f')]));_0xb5619b[_0x0211('0x30')]=_0xb5619b['attributes'][_0x0211('0x41')]?_0xb5619b['attributes']:_0x409f64[_0x0211('0x2b')];if(_0x1e642b['query'][_0x0211('0x3a')]){_0xb5619b[_0x0211('0x42')]=[{'all':!![]}];}_0xb5619b=_[_0x0211('0x36')]({},_0xb5619b,_0x1e642b[_0x0211('0x38')]);return db[_0x0211('0x39')][_0x0211('0x43')](_0xb5619b)[_0x0211('0x21')](handleEntityNotFound(_0x396b2a,null))[_0x0211('0x21')](respondWithResult(_0x396b2a,null))[_0x0211('0x3c')](handleError(_0x396b2a,null));};exports[_0x0211('0x44')]=function(_0x31b1ce,_0x5566d5){return db['SquareDetailsReport'][_0x0211('0x44')](_0x31b1ce[_0x0211('0x45')],{})['then'](respondWithResult(_0x5566d5,0xc9))[_0x0211('0x3c')](handleError(_0x5566d5,null));};exports[_0x0211('0x46')]=function(_0x3c24d0,_0x252223){if(_0x3c24d0['body']['id']){delete _0x3c24d0[_0x0211('0x45')]['id'];}return db[_0x0211('0x39')][_0x0211('0x43')]({'where':{'id':_0x3c24d0[_0x0211('0x3e')]['id']}})[_0x0211('0x21')](handleEntityNotFound(_0x252223,null))[_0x0211('0x21')](saveUpdates(_0x3c24d0[_0x0211('0x45')],null))[_0x0211('0x21')](respondWithResult(_0x252223,null))['catch'](handleError(_0x252223,null));};exports[_0x0211('0x22')]=function(_0x1d47b3,_0x19e960){return db[_0x0211('0x39')][_0x0211('0x43')]({'where':{'id':_0x1d47b3[_0x0211('0x3e')]['id']}})[_0x0211('0x21')](handleEntityNotFound(_0x19e960,null))[_0x0211('0x21')](removeEntity(_0x19e960,null))[_0x0211('0x3c')](handleError(_0x19e960,null));};exports[_0x0211('0x47')]=function(_0x23b178,_0x1d7627){return db[_0x0211('0x39')][_0x0211('0x47')]()['then'](respondWithResult(_0x1d7627,null))[_0x0211('0x3c')](handleError(_0x1d7627,null));}; \ No newline at end of file +var _0x7912=['rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','fields','options','find','create','body','describe'];(function(_0x3c99e8,_0x56fedb){var _0x2edee5=function(_0x417d88){while(--_0x417d88){_0x3c99e8['push'](_0x3c99e8['shift']());}};_0x2edee5(++_0x56fedb);}(_0x7912,0x9a));var _0x2791=function(_0x34664d,_0x5a9943){_0x34664d=_0x34664d-0x0;var _0x2865cf=_0x7912[_0x34664d];return _0x2865cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2791('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2791('0x1'));var rp=require(_0x2791('0x2'));var moment=require(_0x2791('0x3'));var BPromise=require(_0x2791('0x4'));var Mustache=require('mustache');var util=require(_0x2791('0x5'));var path=require(_0x2791('0x6'));var sox=require(_0x2791('0x7'));var csv=require('to-csv');var ejs=require(_0x2791('0x8'));var fs=require('fs');var fs_extra=require(_0x2791('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2791('0xa'));var toCsv=require(_0x2791('0xb'));var querystring=require(_0x2791('0xc'));var Papa=require(_0x2791('0xd'));var Redis=require(_0x2791('0xe'));var authService=require(_0x2791('0xf'));var qs=require(_0x2791('0x10'));var as=require(_0x2791('0x11'));var hardwareService=require(_0x2791('0x12'));var logger=require(_0x2791('0x13'))(_0x2791('0x14'));var utils=require(_0x2791('0x15'));var config=require(_0x2791('0x16'));var licenseUtil=require(_0x2791('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43e605,_0x51d550){_0x51d550=_0x51d550||0xcc;return function(_0x507926){if(_0x507926){return _0x43e605['sendStatus'](_0x51d550);}return _0x43e605[_0x2791('0x18')](_0x51d550)[_0x2791('0x19')]();};}function respondWithResult(_0x55e2d6,_0x26dbe0){_0x26dbe0=_0x26dbe0||0xc8;return function(_0x9544da){if(_0x9544da){return _0x55e2d6[_0x2791('0x18')](_0x26dbe0)[_0x2791('0x1a')](_0x9544da);}};}function respondWithFilteredResult(_0x1c1d43,_0x10bc3e){return function(_0x447d80){if(_0x447d80){var _0x48ed0b=typeof _0x10bc3e['offset']==='undefined'&&typeof _0x10bc3e[_0x2791('0x1b')]===_0x2791('0x1c');var _0x3252b8=_0x447d80[_0x2791('0x1d')];var _0x3360aa=_0x48ed0b?0x0:_0x10bc3e[_0x2791('0x1e')];var _0x504a80=_0x48ed0b?_0x447d80[_0x2791('0x1d')]:_0x10bc3e['offset']+_0x10bc3e[_0x2791('0x1b')];var _0x7b0014;if(_0x504a80>=_0x3252b8){_0x504a80=_0x3252b8;_0x7b0014=0xc8;}else{_0x7b0014=0xce;}_0x1c1d43['status'](_0x7b0014);return _0x1c1d43[_0x2791('0x1f')](_0x2791('0x20'),_0x3360aa+'-'+_0x504a80+'/'+_0x3252b8)['json'](_0x447d80);}return null;};}function patchUpdates(_0x4612f3){return function(_0x184ebc){try{jsonpatch[_0x2791('0x21')](_0x184ebc,_0x4612f3,!![]);}catch(_0x1f1497){return BPromise[_0x2791('0x22')](_0x1f1497);}return _0x184ebc[_0x2791('0x23')]();};}function saveUpdates(_0x40ddce,_0xf6fc1a){return function(_0x4f47a2){if(_0x4f47a2){return _0x4f47a2[_0x2791('0x24')](_0x40ddce)[_0x2791('0x25')](function(_0x1596be){return _0x1596be;});}return null;};}function removeEntity(_0x1f82c0,_0x879d4c){return function(_0x2fea67){if(_0x2fea67){return _0x2fea67[_0x2791('0x26')]()[_0x2791('0x25')](function(){_0x1f82c0[_0x2791('0x18')](0xcc)[_0x2791('0x19')]();});}};}function handleEntityNotFound(_0x1956cf,_0x21045e){return function(_0x2691c2){if(!_0x2691c2){_0x1956cf['sendStatus'](0x194);}return _0x2691c2;};}function handleError(_0x392f29,_0x28816d){_0x28816d=_0x28816d||0x1f4;return function(_0xa27b84){logger[_0x2791('0x27')](_0xa27b84[_0x2791('0x28')]);if(_0xa27b84[_0x2791('0x29')]){delete _0xa27b84[_0x2791('0x29')];}_0x392f29[_0x2791('0x18')](_0x28816d)['send'](_0xa27b84);};}exports[_0x2791('0x2a')]=function(_0x44403b,_0x39e7f4){var _0x1d062a={},_0x4b9f94={},_0x2ec58d={'count':0x0,'rows':[]};var _0x128ee7=_[_0x2791('0x2b')](db[_0x2791('0x2c')][_0x2791('0x2d')],function(_0x5bfec0){return{'name':_0x5bfec0[_0x2791('0x2e')],'type':_0x5bfec0[_0x2791('0x2f')][_0x2791('0x30')]};});_0x4b9f94[_0x2791('0x31')]=_[_0x2791('0x2b')](_0x128ee7,_0x2791('0x29'));_0x4b9f94['query']=_[_0x2791('0x32')](_0x44403b[_0x2791('0x33')]);_0x4b9f94[_0x2791('0x34')]=_['intersection'](_0x4b9f94['model'],_0x4b9f94[_0x2791('0x33')]);_0x1d062a['attributes']=_[_0x2791('0x35')](_0x4b9f94[_0x2791('0x31')],qs['fields'](_0x44403b[_0x2791('0x33')]['fields']));_0x1d062a[_0x2791('0x36')]=_0x1d062a[_0x2791('0x36')][_0x2791('0x37')]?_0x1d062a[_0x2791('0x36')]:_0x4b9f94[_0x2791('0x31')];if(!_0x44403b['query'][_0x2791('0x38')](_0x2791('0x39'))){_0x1d062a['limit']=qs[_0x2791('0x1b')](_0x44403b[_0x2791('0x33')]['limit']);_0x1d062a[_0x2791('0x1e')]=qs['offset'](_0x44403b['query']['offset']);}_0x1d062a[_0x2791('0x3a')]=qs[_0x2791('0x3b')](_0x44403b['query'][_0x2791('0x3b')]);_0x1d062a['where']=qs[_0x2791('0x34')](_[_0x2791('0x3c')](_0x44403b['query'],_0x4b9f94[_0x2791('0x34')]),_0x128ee7);if(_0x44403b[_0x2791('0x33')][_0x2791('0x3d')]){_0x1d062a[_0x2791('0x3e')]=_['merge'](_0x1d062a[_0x2791('0x3e')],{'$or':_[_0x2791('0x2b')](_0x128ee7,function(_0x995b9e){if(_0x995b9e[_0x2791('0x2f')]!==_0x2791('0x3f')){var _0x265d54={};_0x265d54[_0x995b9e[_0x2791('0x29')]]={'$like':'%'+_0x44403b[_0x2791('0x33')][_0x2791('0x3d')]+'%'};return _0x265d54;}})});}_0x1d062a=_[_0x2791('0x40')]({},_0x1d062a,_0x44403b['options']);var _0x387a0d={'where':_0x1d062a[_0x2791('0x3e')]};return db[_0x2791('0x2c')]['count'](_0x387a0d)[_0x2791('0x25')](function(_0x4f674c){_0x2ec58d[_0x2791('0x1d')]=_0x4f674c;if(_0x44403b[_0x2791('0x33')][_0x2791('0x41')]){_0x1d062a[_0x2791('0x42')]=[{'all':!![]}];}return db[_0x2791('0x2c')][_0x2791('0x43')](_0x1d062a);})['then'](function(_0x3975b8){_0x2ec58d['rows']=_0x3975b8;return _0x2ec58d;})['then'](respondWithFilteredResult(_0x39e7f4,_0x1d062a))[_0x2791('0x44')](handleError(_0x39e7f4,null));};exports[_0x2791('0x45')]=function(_0x505f98,_0x32551f){var _0x406dd1={'raw':!![],'where':{'id':_0x505f98[_0x2791('0x46')]['id']}},_0x5ae070={};_0x5ae070['model']=_[_0x2791('0x32')](db[_0x2791('0x2c')][_0x2791('0x2d')]);_0x5ae070[_0x2791('0x33')]=_[_0x2791('0x32')](_0x505f98[_0x2791('0x33')]);_0x5ae070[_0x2791('0x34')]=_['intersection'](_0x5ae070[_0x2791('0x31')],_0x5ae070[_0x2791('0x33')]);_0x406dd1['attributes']=_[_0x2791('0x35')](_0x5ae070[_0x2791('0x31')],qs['fields'](_0x505f98[_0x2791('0x33')][_0x2791('0x47')]));_0x406dd1[_0x2791('0x36')]=_0x406dd1[_0x2791('0x36')][_0x2791('0x37')]?_0x406dd1[_0x2791('0x36')]:_0x5ae070[_0x2791('0x31')];if(_0x505f98[_0x2791('0x33')][_0x2791('0x41')]){_0x406dd1[_0x2791('0x42')]=[{'all':!![]}];}_0x406dd1=_['merge']({},_0x406dd1,_0x505f98[_0x2791('0x48')]);return db[_0x2791('0x2c')][_0x2791('0x49')](_0x406dd1)[_0x2791('0x25')](handleEntityNotFound(_0x32551f,null))[_0x2791('0x25')](respondWithResult(_0x32551f,null))[_0x2791('0x44')](handleError(_0x32551f,null));};exports[_0x2791('0x4a')]=function(_0x47273a,_0x298045){return db[_0x2791('0x2c')][_0x2791('0x4a')](_0x47273a[_0x2791('0x4b')],{})[_0x2791('0x25')](respondWithResult(_0x298045,0xc9))['catch'](handleError(_0x298045,null));};exports[_0x2791('0x24')]=function(_0x18b618,_0x1b2545){if(_0x18b618[_0x2791('0x4b')]['id']){delete _0x18b618[_0x2791('0x4b')]['id'];}return db[_0x2791('0x2c')][_0x2791('0x49')]({'where':{'id':_0x18b618['params']['id']}})['then'](handleEntityNotFound(_0x1b2545,null))[_0x2791('0x25')](saveUpdates(_0x18b618[_0x2791('0x4b')],null))[_0x2791('0x25')](respondWithResult(_0x1b2545,null))['catch'](handleError(_0x1b2545,null));};exports['destroy']=function(_0x51fa74,_0x45f976){return db[_0x2791('0x2c')][_0x2791('0x49')]({'where':{'id':_0x51fa74[_0x2791('0x46')]['id']}})['then'](handleEntityNotFound(_0x45f976,null))[_0x2791('0x25')](removeEntity(_0x45f976,null))[_0x2791('0x44')](handleError(_0x45f976,null));};exports[_0x2791('0x4c')]=function(_0xfbc7e5,_0x1d5468){return db[_0x2791('0x2c')]['describe']()[_0x2791('0x25')](respondWithResult(_0x1d5468,null))[_0x2791('0x44')](handleError(_0x1d5468,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 33844f7..d8abfb0 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 _0x44e9=['./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','bluebird','rimraf','../../config/environment'];(function(_0x32b122,_0x1ad490){var _0x4ad25a=function(_0x590ee6){while(--_0x590ee6){_0x32b122['push'](_0x32b122['shift']());}};_0x4ad25a(++_0x1ad490);}(_0x44e9,0x11d));var _0x944e=function(_0x28ba0c,_0x4b5291){_0x28ba0c=_0x28ba0c-0x0;var _0x4e5591=_0x44e9[_0x28ba0c];return _0x4e5591;};'use strict';var _=require(_0x944e('0x0'));var util=require(_0x944e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x944e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x944e('0x3'));var config=require(_0x944e('0x4'));var attributes=require(_0x944e('0x5'));module[_0x944e('0x6')]=function(_0x5a9f53,_0x357439){return _0x5a9f53[_0x944e('0x7')](_0x944e('0x8'),attributes,{'tableName':_0x944e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51f3=['../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','SquareDetailsReport','lodash','util'];(function(_0x345fc5,_0x5a577c){var _0x1ce605=function(_0x1e75a7){while(--_0x1e75a7){_0x345fc5['push'](_0x345fc5['shift']());}};_0x1ce605(++_0x5a577c);}(_0x51f3,0x152));var _0x351f=function(_0x37d438,_0x3bfbbc){_0x37d438=_0x37d438-0x0;var _0x5cd81f=_0x51f3[_0x37d438];return _0x5cd81f;};'use strict';var _=require(_0x351f('0x0'));var util=require(_0x351f('0x1'));var logger=require(_0x351f('0x2'))(_0x351f('0x3'));var moment=require('moment');var BPromise=require(_0x351f('0x4'));var rp=require(_0x351f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x351f('0x6'));var attributes=require('./squareReportDetail.attributes');module[_0x351f('0x7')]=function(_0x4f114f,_0x3d3f6f){return _0x4f114f[_0x351f('0x8')](_0x351f('0x9'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index d77ef71..526e9ce 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 _0xdb94=['info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','request','then'];(function(_0x35d86a,_0xe552bb){var _0x585d10=function(_0x316ecf){while(--_0x316ecf){_0x35d86a['push'](_0x35d86a['shift']());}};_0x585d10(++_0xe552bb);}(_0xdb94,0xab));var _0x4db9=function(_0x13cc6c,_0xb99ad4){_0x13cc6c=_0x13cc6c-0x0;var _0x1163e1=_0xdb94[_0x13cc6c];return _0x1163e1;};'use strict';var _=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var moment=require(_0x4db9('0x2'));var BPromise=require(_0x4db9('0x3'));var rs=require(_0x4db9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4db9('0x5'))['db'];var utils=require(_0x4db9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4db9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4db9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d1f45,_0x196ede,_0x50c27a){return new BPromise(function(_0x14deb9,_0x26248b){return client[_0x4db9('0x9')](_0x5d1f45,_0x50c27a)[_0x4db9('0xa')](function(_0x2cacca){logger[_0x4db9('0xb')](_0x4db9('0xc'),_0x196ede,_0x4db9('0xd'));logger[_0x4db9('0xe')](_0x4db9('0xf'),_0x196ede,_0x4db9('0xd'),JSON['stringify'](_0x2cacca));if(_0x2cacca[_0x4db9('0x10')]){if(_0x2cacca[_0x4db9('0x10')]['code']===0x1f4){logger['error'](_0x4db9('0xc'),_0x196ede,_0x2cacca['error']['message']);return _0x26248b(_0x2cacca[_0x4db9('0x10')][_0x4db9('0x11')]);}logger['error'](_0x4db9('0xc'),_0x196ede,_0x2cacca[_0x4db9('0x10')][_0x4db9('0x11')]);return _0x14deb9(_0x2cacca[_0x4db9('0x10')]['message']);}else{logger['info'](_0x4db9('0xc'),_0x196ede,_0x4db9('0xd'));_0x14deb9(_0x2cacca['result'][_0x4db9('0x11')]);}})[_0x4db9('0x12')](function(_0x5d6471){logger['error'](_0x4db9('0xc'),_0x196ede,_0x5d6471);_0x26248b(_0x5d6471);});});}exports[_0x4db9('0x13')]=function(_0x462af3){var _0xa693c4=this;return new Promise(function(_0x1d3c33,_0x55494a){return db[_0x4db9('0x14')][_0x4db9('0x15')](_0x462af3[_0x4db9('0x16')],{'raw':_0x462af3['options']?_0x462af3[_0x4db9('0x17')][_0x4db9('0x18')]===undefined?!![]:![]:!![]})[_0x4db9('0xa')](function(_0x4c92e8){logger[_0x4db9('0xb')](_0x4db9('0x13'),_0x462af3);logger[_0x4db9('0xe')](_0x4db9('0x13'),_0x462af3,JSON[_0x4db9('0x19')](_0x4c92e8));_0x1d3c33(_0x4c92e8);})[_0x4db9('0x12')](function(_0x3585d5){logger['error'](_0x4db9('0x13'),_0x3585d5[_0x4db9('0x11')],_0x462af3);_0x55494a(_0xa693c4[_0x4db9('0x10')](0x1f4,_0x3585d5[_0x4db9('0x11')]));});});}; \ No newline at end of file +var _0x0b7f=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','SquareDetailsReport,\x20%s,\x20%s','message','request\x20sent','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','debug','stringify','catch','lodash','util','bluebird'];(function(_0x57b316,_0x2c79d5){var _0x344987=function(_0x2fad5f){while(--_0x2fad5f){_0x57b316['push'](_0x57b316['shift']());}};_0x344987(++_0x2c79d5);}(_0x0b7f,0x115));var _0xf0b7=function(_0x129b6b,_0x4faf08){_0x129b6b=_0x129b6b-0x0;var _0x24d8df=_0x0b7f[_0x129b6b];return _0x24d8df;};'use strict';var _=require(_0xf0b7('0x0'));var util=require(_0xf0b7('0x1'));var moment=require('moment');var BPromise=require(_0xf0b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0b7('0x3'));var db=require(_0xf0b7('0x4'))['db'];var utils=require(_0xf0b7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0b7('0x6'));var jayson=require(_0xf0b7('0x7'));var client=jayson[_0xf0b7('0x8')][_0xf0b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b2de8,_0x5e449a,_0x1408ee){return new BPromise(function(_0x276f09,_0x275a13){return client[_0xf0b7('0xa')](_0x2b2de8,_0x1408ee)[_0xf0b7('0xb')](function(_0x588b46){logger[_0xf0b7('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x5e449a,'request\x20sent');logger['debug'](_0xf0b7('0xd'),_0x5e449a,'request\x20sent',JSON['stringify'](_0x588b46));if(_0x588b46[_0xf0b7('0xe')]){if(_0x588b46[_0xf0b7('0xe')][_0xf0b7('0xf')]===0x1f4){logger[_0xf0b7('0xe')](_0xf0b7('0x10'),_0x5e449a,_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);return _0x275a13(_0x588b46[_0xf0b7('0xe')]['message']);}logger['error'](_0xf0b7('0x10'),_0x5e449a,_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);return _0x276f09(_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);}else{logger['info'](_0xf0b7('0x10'),_0x5e449a,_0xf0b7('0x12'));_0x276f09(_0x588b46[_0xf0b7('0x13')][_0xf0b7('0x11')]);}})['catch'](function(_0x303db6){logger[_0xf0b7('0xe')](_0xf0b7('0x10'),_0x5e449a,_0x303db6);_0x275a13(_0x303db6);});});}exports[_0xf0b7('0x14')]=function(_0x52b27e){var _0x1e5fc9=this;return new Promise(function(_0x153d23,_0x28fd36){return db[_0xf0b7('0x15')][_0xf0b7('0x16')](_0x52b27e['body'],{'raw':_0x52b27e[_0xf0b7('0x17')]?_0x52b27e['options'][_0xf0b7('0x18')]===undefined?!![]:![]:!![]})[_0xf0b7('0xb')](function(_0x374496){logger['info']('CreateSquareDetailsReport',_0x52b27e);logger[_0xf0b7('0x19')](_0xf0b7('0x14'),_0x52b27e,JSON[_0xf0b7('0x1a')](_0x374496));_0x153d23(_0x374496);})[_0xf0b7('0x1b')](function(_0xb90b3c){logger[_0xf0b7('0xe')](_0xf0b7('0x14'),_0xb90b3c[_0xf0b7('0x11')],_0x52b27e);_0x28fd36(_0x1e5fc9[_0xf0b7('0xe')](0x1f4,_0xb90b3c['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index f9d171a..4ae723e 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 _0xe310=['express','../../components/auth/service','./system.controller','get','index','isAuthenticated','killProcess','exports'];(function(_0x31854f,_0x2c09fd){var _0x2cb805=function(_0x370eae){while(--_0x370eae){_0x31854f['push'](_0x31854f['shift']());}};_0x2cb805(++_0x2c09fd);}(_0xe310,0x198));var _0x0e31=function(_0x258823,_0x10024d){_0x258823=_0x258823-0x0;var _0x204b47=_0xe310[_0x258823];return _0x204b47;};'use strict';var express=require(_0x0e31('0x0'));var router=express['Router']();var auth=require(_0x0e31('0x1'));var controller=require(_0x0e31('0x2'));router[_0x0e31('0x3')]('/',auth['isAuthenticated'](),controller[_0x0e31('0x4')]);router[_0x0e31('0x3')]('/process/:pid/kill',auth[_0x0e31('0x5')](),controller[_0x0e31('0x6')]);module[_0x0e31('0x7')]=router; \ No newline at end of file +var _0xb658=['get','index','isAuthenticated','express','../../components/auth/service'];(function(_0x581332,_0x588a7b){var _0xfa58b4=function(_0x1c58a6){while(--_0x1c58a6){_0x581332['push'](_0x581332['shift']());}};_0xfa58b4(++_0x588a7b);}(_0xb658,0x166));var _0x8b65=function(_0x2b0c7f,_0x311567){_0x2b0c7f=_0x2b0c7f-0x0;var _0x548837=_0xb658[_0x2b0c7f];return _0x548837;};'use strict';var express=require(_0x8b65('0x0'));var router=express['Router']();var auth=require(_0x8b65('0x1'));var controller=require('./system.controller');router[_0x8b65('0x2')]('/',auth['isAuthenticated'](),controller[_0x8b65('0x3')]);router[_0x8b65('0x2')]('/process/:pid/kill',auth[_0x8b65('0x4')](),controller['killProcess']);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index df6634b..f10594e 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 _0xdf2e=['split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0xdf2e,0xcc));var _0xedf2=function(_0x171fdc,_0x16ae91){_0x171fdc=_0x171fdc-0x0;var _0x3782ea=_0xdf2e[_0x171fdc];return _0x3782ea;};'use strict';var info=require('systeminformation');var exec=require(_0xedf2('0x0'))[_0xedf2('0x1')];var logger=require('../../config/logger')(_0xedf2('0x2'));var util=require(_0xedf2('0x3'));var BPromise=require(_0xedf2('0x4'));var _=require(_0xedf2('0x5'));function handleError(_0x1270e0,_0x3da20e,_0x490f4){_0x3da20e=_0x3da20e||0x1f4;return function(_0x5e3aa9){logger[_0xedf2('0x6')](_0xedf2('0x7'),_0x490f4,_0x3da20e,util[_0xedf2('0x8')](_0x5e3aa9,{'showHidden':![],'depth':null}));delete _0x5e3aa9[_0xedf2('0x9')];_0x1270e0[_0xedf2('0xa')](_0x3da20e)['send'](_0x5e3aa9);};}exports['index']=function(_0x16023f,_0x33d747){return info[_0xedf2('0xb')]()[_0xedf2('0xc')](function(_0x5bd49f){return _0x33d747[_0xedf2('0xa')](0xc8)[_0xedf2('0xd')](_0x5bd49f);})[_0xedf2('0xe')](function(_0x566d9a){return _0x33d747[_0xedf2('0xa')](0x1f4)[_0xedf2('0xd')](_0x566d9a);});};exports[_0xedf2('0xf')]=function(_0x133b69,_0x785413){var _0x50208e=[_0xedf2('0x10')];return new BPromise(function(_0x89b86,_0x28fbab){return exec(util[_0xedf2('0x11')](_0xedf2('0x12'),_0x133b69['params'][_0xedf2('0x13')]),function(_0x200b81,_0x5c01bc,_0x4800ab){if(_0x200b81){return _0x28fbab(_0x200b81);}return _0x89b86(_0x5c01bc);});})[_0xedf2('0xc')](function(_0x243cb9){var _0x5207d9=![];var _0x450ca8=_0x243cb9[_0xedf2('0x14')](/\n/);for(var _0x4f4100=0x0,_0x4c5821=_0x50208e[_0xedf2('0x15')];_0x4f4100<_0x4c5821,_0x5207d9===![];_0x4f4100+=0x1){if(_0x243cb9[_0xedf2('0x16')](_0x50208e[_0x4f4100])>=0x0){_0x5207d9=!![];}}if(!_0x5207d9){throw new Error(util['format'](_0xedf2('0x17'),_0x133b69[_0xedf2('0x18')][_0xedf2('0x13')]));}process[_0xedf2('0x19')](_0x133b69[_0xedf2('0x18')]['pid'],_0xedf2('0x1a'));return _0x785413['status'](0xc8)[_0xedf2('0xd')]({'message':util[_0xedf2('0x11')](_0xedf2('0x1b'),_0x133b69[_0xedf2('0x18')][_0xedf2('0x13')])});})[_0xedf2('0xe')](handleError(_0x785413,null,_0xedf2('0xf')));}; \ No newline at end of file +var _0x698a=['api','util','error','inspect','name','status','send','getAllData','then','catch','json','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger'];(function(_0x401ad6,_0x392d17){var _0x159ef3=function(_0x33151c){while(--_0x33151c){_0x401ad6['push'](_0x401ad6['shift']());}};_0x159ef3(++_0x392d17);}(_0x698a,0x10a));var _0xa698=function(_0x1f2d5e,_0x3957e0){_0x1f2d5e=_0x1f2d5e-0x0;var _0x19207f=_0x698a[_0x1f2d5e];return _0x19207f;};'use strict';var info=require(_0xa698('0x0'));var exec=require(_0xa698('0x1'))[_0xa698('0x2')];var logger=require(_0xa698('0x3'))(_0xa698('0x4'));var util=require(_0xa698('0x5'));var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x29c2b8,_0x33c713,_0x5d3816){_0x33c713=_0x33c713||0x1f4;return function(_0x2923b5){logger[_0xa698('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x5d3816,_0x33c713,util[_0xa698('0x7')](_0x2923b5,{'showHidden':![],'depth':null}));delete _0x2923b5[_0xa698('0x8')];_0x29c2b8[_0xa698('0x9')](_0x33c713)[_0xa698('0xa')](_0x2923b5);};}exports['index']=function(_0x2bd8b0,_0x39937b){return info[_0xa698('0xb')]()[_0xa698('0xc')](function(_0x7689a9){return _0x39937b[_0xa698('0x9')](0xc8)['json'](_0x7689a9);})[_0xa698('0xd')](function(_0x4e3182){return _0x39937b[_0xa698('0x9')](0x1f4)[_0xa698('0xe')](_0x4e3182);});};exports[_0xa698('0xf')]=function(_0x24bb52,_0x2a459a){var _0x35ccb5=[_0xa698('0x10')];return new BPromise(function(_0x40889e,_0x4991d8){return exec(util['format'](_0xa698('0x11'),_0x24bb52[_0xa698('0x12')][_0xa698('0x13')]),function(_0x3b5473,_0x11b44b,_0x1ed66f){if(_0x3b5473){return _0x4991d8(_0x3b5473);}return _0x40889e(_0x11b44b);});})['then'](function(_0x3ed690){var _0x9097c9=![];var _0x2e79d2=_0x3ed690[_0xa698('0x14')](/\n/);for(var _0x100412=0x0,_0x258262=_0x35ccb5['length'];_0x100412<_0x258262,_0x9097c9===![];_0x100412+=0x1){if(_0x3ed690[_0xa698('0x15')](_0x35ccb5[_0x100412])>=0x0){_0x9097c9=!![];}}if(!_0x9097c9){throw new Error(util[_0xa698('0x16')](_0xa698('0x17'),_0x24bb52[_0xa698('0x12')][_0xa698('0x13')]));}process[_0xa698('0x18')](_0x24bb52[_0xa698('0x12')][_0xa698('0x13')],_0xa698('0x19'));return _0x2a459a[_0xa698('0x9')](0xc8)[_0xa698('0xe')]({'message':util[_0xa698('0x16')](_0xa698('0x1a'),_0x24bb52[_0xa698('0x12')][_0xa698('0x13')])});})[_0xa698('0xd')](handleError(_0x2a459a,null,_0xa698('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 8780412..9a290c3 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 _0xac31=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','show','post','create','put','/:id'];(function(_0xf1ba4d,_0x29f1ae){var _0x42c156=function(_0x194dde){while(--_0x194dde){_0xf1ba4d['push'](_0xf1ba4d['shift']());}};_0x42c156(++_0x29f1ae);}(_0xac31,0xca));var _0x1ac3=function(_0x1780f8,_0x4a0fe7){_0x1780f8=_0x1780f8-0x0;var _0x23e94b=_0xac31[_0x1780f8];return _0x23e94b;};'use strict';var multer=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var path=require(_0x1ac3('0x2'));var timeout=require(_0x1ac3('0x3'));var express=require(_0x1ac3('0x4'));var router=express[_0x1ac3('0x5')]();var fs_extra=require(_0x1ac3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1ac3('0x7'));var config=require(_0x1ac3('0x8'));var controller=require('./tag.controller');router['get']('/',auth[_0x1ac3('0x9')](),controller[_0x1ac3('0xa')]);router[_0x1ac3('0xb')](_0x1ac3('0xc'),auth[_0x1ac3('0x9')](),controller['describe']);router[_0x1ac3('0xb')]('/:id',auth[_0x1ac3('0x9')](),controller[_0x1ac3('0xd')]);router[_0x1ac3('0xe')]('/',auth['isAuthenticated'](),controller[_0x1ac3('0xf')]);router[_0x1ac3('0x10')](_0x1ac3('0x11'),auth[_0x1ac3('0x9')](),controller[_0x1ac3('0x12')]);router[_0x1ac3('0x13')]('/:id',auth[_0x1ac3('0x9')](),controller[_0x1ac3('0x14')]);module[_0x1ac3('0x15')]=router; \ No newline at end of file +var _0x34e8=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete'];(function(_0x5f4ba7,_0x18868c){var _0x122ebd=function(_0xfa9d20){while(--_0xfa9d20){_0x5f4ba7['push'](_0x5f4ba7['shift']());}};_0x122ebd(++_0x18868c);}(_0x34e8,0x12c));var _0x834e=function(_0x44eb57,_0x195081){_0x44eb57=_0x44eb57-0x0;var _0x335439=_0x34e8[_0x44eb57];return _0x335439;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0x15')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x16')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index ad5c0f1..52ca2f2 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 _0x530f=['STRING','#0091EA','exports'];(function(_0x33f9c6,_0x50acf5){var _0x44851a=function(_0x3c3521){while(--_0x3c3521){_0x33f9c6['push'](_0x33f9c6['shift']());}};_0x44851a(++_0x50acf5);}(_0x530f,0x167));var _0xf530=function(_0x245545,_0x4983b3){_0x245545=_0x245545-0x0;var _0x106a5f=_0x530f[_0x245545];return _0x106a5f;};'use strict';var Sequelize=require('sequelize');module[_0xf530('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf530('0x1')],'defaultValue':_0xf530('0x2')},'description':{'type':Sequelize[_0xf530('0x1')]}}; \ No newline at end of file +var _0x3c81=['name','STRING','sequelize','exports'];(function(_0x2b9971,_0x4f116f){var _0x4eae53=function(_0x5820b3){while(--_0x5820b3){_0x2b9971['push'](_0x2b9971['shift']());}};_0x4eae53(++_0x4f116f);}(_0x3c81,0x102));var _0x13c8=function(_0x523fd4,_0x10ddba){_0x523fd4=_0x523fd4-0x0;var _0x132e2e=_0x3c81[_0x523fd4];return _0x132e2e;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x13c8('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x13c8('0x3')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index d7bc0da..b5e7736 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 _0x310b=['show','includeAll','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','util','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','Tags','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','filter','merge','where','type','VIRTUAL','options','Tag','include','findAll','rows'];(function(_0x33ac6b,_0x1ed895){var _0x34cffe=function(_0x17d762){while(--_0x17d762){_0x33ac6b['push'](_0x33ac6b['shift']());}};_0x34cffe(++_0x1ed895);}(_0x310b,0x19e));var _0xb310=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x310b[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require(_0xb310('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb310('0x1'));var jsonpatch=require(_0xb310('0x2'));var rp=require(_0xb310('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb310('0x4'));var path=require(_0xb310('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb310('0x6'));var fs=require('fs');var fs_extra=require(_0xb310('0x7'));var _=require(_0xb310('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb310('0x9'));var deskjs=require(_0xb310('0xa'));var toCsv=require(_0xb310('0xb'));var querystring=require(_0xb310('0xc'));var Papa=require(_0xb310('0xd'));var Redis=require(_0xb310('0xe'));var authService=require(_0xb310('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb310('0x10'));var hardwareService=require(_0xb310('0x11'));var logger=require('../../config/logger')(_0xb310('0x12'));var utils=require('../../config/utils');var config=require(_0xb310('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xb310('0x14'))['db'];function respondWithStatusCode(_0x20dee7,_0x4fd8ad){_0x4fd8ad=_0x4fd8ad||0xcc;return function(_0x3994e1){if(_0x3994e1){return _0x20dee7[_0xb310('0x15')](_0x4fd8ad);}return _0x20dee7[_0xb310('0x16')](_0x4fd8ad)[_0xb310('0x17')]();};}function respondWithResult(_0x46fb40,_0x2ed3c4){_0x2ed3c4=_0x2ed3c4||0xc8;return function(_0x658a0b){if(_0x658a0b){return _0x46fb40[_0xb310('0x16')](_0x2ed3c4)[_0xb310('0x18')](_0x658a0b);}};}function respondWithFilteredResult(_0xa6714c,_0x4b68ba){return function(_0x42f183){if(_0x42f183){var _0xdf1bda=typeof _0x4b68ba[_0xb310('0x19')]===_0xb310('0x1a')&&typeof _0x4b68ba[_0xb310('0x1b')]===_0xb310('0x1a');var _0x54aabb=_0x42f183['count'];var _0x3a2493=_0xdf1bda?0x0:_0x4b68ba['offset'];var _0x531aa3=_0xdf1bda?_0x42f183[_0xb310('0x1c')]:_0x4b68ba[_0xb310('0x19')]+_0x4b68ba['limit'];var _0x5e9038;if(_0x531aa3>=_0x54aabb){_0x531aa3=_0x54aabb;_0x5e9038=0xc8;}else{_0x5e9038=0xce;}_0xa6714c[_0xb310('0x16')](_0x5e9038);return _0xa6714c[_0xb310('0x1d')]('Content-Range',_0x3a2493+'-'+_0x531aa3+'/'+_0x54aabb)[_0xb310('0x18')](_0x42f183);}return null;};}function patchUpdates(_0x54056c){return function(_0x325f84){try{jsonpatch[_0xb310('0x1e')](_0x325f84,_0x54056c,!![]);}catch(_0x35881c){return BPromise[_0xb310('0x1f')](_0x35881c);}return _0x325f84[_0xb310('0x20')]();};}function saveUpdates(_0x46fe7b,_0x45b9c4){return function(_0x2f8a78){if(_0x2f8a78){return _0x2f8a78[_0xb310('0x21')](_0x46fe7b)[_0xb310('0x22')](function(_0xd1c165){return _0xd1c165;});}return null;};}function removeEntity(_0x3c8dea,_0x59530a){return function(_0x2e5b09){if(_0x2e5b09){return _0x2e5b09['destroy']()[_0xb310('0x22')](function(){var _0x333925=_0x2e5b09[_0xb310('0x23')]({'plain':!![]});var _0x2b6d81=_0xb310('0x24');return db['UserProfileResource'][_0xb310('0x25')]({'where':{'type':_0x2b6d81,'resourceId':_0x333925['id']}})[_0xb310('0x22')](function(){return _0x2e5b09;});})[_0xb310('0x22')](function(){_0x3c8dea[_0xb310('0x16')](0xcc)[_0xb310('0x17')]();});}};}function handleEntityNotFound(_0x55c9b0,_0x51ee33){return function(_0x440c1b){if(!_0x440c1b){_0x55c9b0['sendStatus'](0x194);}return _0x440c1b;};}function handleError(_0xdcd04b,_0x9eb7fd){_0x9eb7fd=_0x9eb7fd||0x1f4;return function(_0x1ff16e){logger[_0xb310('0x26')](_0x1ff16e[_0xb310('0x27')]);if(_0x1ff16e[_0xb310('0x28')]){delete _0x1ff16e[_0xb310('0x28')];}_0xdcd04b[_0xb310('0x16')](_0x9eb7fd)[_0xb310('0x29')](_0x1ff16e);};}exports[_0xb310('0x2a')]=function(_0x59d53c,_0x480285){var _0x3fe98d={},_0x23dcb8={},_0x127490={'count':0x0,'rows':[]};var _0x39e637=_[_0xb310('0x2b')](db['Tag'][_0xb310('0x2c')],function(_0x388eda){return{'name':_0x388eda[_0xb310('0x2d')],'type':_0x388eda['type']['key']};});_0x23dcb8['model']=_[_0xb310('0x2b')](_0x39e637,'name');_0x23dcb8[_0xb310('0x2e')]=_[_0xb310('0x2f')](_0x59d53c['query']);_0x23dcb8[_0xb310('0x30')]=_[_0xb310('0x31')](_0x23dcb8[_0xb310('0x32')],_0x23dcb8['query']);_0x3fe98d[_0xb310('0x33')]=_[_0xb310('0x31')](_0x23dcb8[_0xb310('0x32')],qs[_0xb310('0x34')](_0x59d53c[_0xb310('0x2e')][_0xb310('0x34')]));_0x3fe98d['attributes']=_0x3fe98d[_0xb310('0x33')][_0xb310('0x35')]?_0x3fe98d[_0xb310('0x33')]:_0x23dcb8[_0xb310('0x32')];if(!_0x59d53c[_0xb310('0x2e')]['hasOwnProperty'](_0xb310('0x36'))){_0x3fe98d[_0xb310('0x1b')]=qs[_0xb310('0x1b')](_0x59d53c[_0xb310('0x2e')][_0xb310('0x1b')]);_0x3fe98d[_0xb310('0x19')]=qs[_0xb310('0x19')](_0x59d53c[_0xb310('0x2e')]['offset']);}_0x3fe98d['order']=qs[_0xb310('0x37')](_0x59d53c[_0xb310('0x2e')][_0xb310('0x37')]);_0x3fe98d['where']=qs[_0xb310('0x30')](_['pick'](_0x59d53c[_0xb310('0x2e')],_0x23dcb8['filters']),_0x39e637);if(_0x59d53c[_0xb310('0x2e')][_0xb310('0x38')]){_0x3fe98d['where']=_[_0xb310('0x39')](_0x3fe98d[_0xb310('0x3a')],{'$or':_[_0xb310('0x2b')](_0x39e637,function(_0x6cfb11){if(_0x6cfb11[_0xb310('0x3b')]!==_0xb310('0x3c')){var _0x293dc1={};_0x293dc1[_0x6cfb11[_0xb310('0x28')]]={'$like':'%'+_0x59d53c[_0xb310('0x2e')]['filter']+'%'};return _0x293dc1;}})});}_0x3fe98d=_[_0xb310('0x39')]({},_0x3fe98d,_0x59d53c[_0xb310('0x3d')]);var _0x451bdc={'where':_0x3fe98d['where']};return db[_0xb310('0x3e')][_0xb310('0x1c')](_0x451bdc)[_0xb310('0x22')](function(_0x2d3d00){_0x127490['count']=_0x2d3d00;if(_0x59d53c[_0xb310('0x2e')]['includeAll']){_0x3fe98d[_0xb310('0x3f')]=[{'all':!![]}];}return db[_0xb310('0x3e')][_0xb310('0x40')](_0x3fe98d);})['then'](function(_0x3ac1d2){_0x127490[_0xb310('0x41')]=_0x3ac1d2;return _0x127490;})[_0xb310('0x22')](respondWithFilteredResult(_0x480285,_0x3fe98d))['catch'](handleError(_0x480285,null));};exports[_0xb310('0x42')]=function(_0x56d4b1,_0x297e1b){var _0x58466a={'raw':!![],'where':{'id':_0x56d4b1['params']['id']}},_0x240a4b={};_0x240a4b['model']=_[_0xb310('0x2f')](db[_0xb310('0x3e')]['rawAttributes']);_0x240a4b[_0xb310('0x2e')]=_[_0xb310('0x2f')](_0x56d4b1[_0xb310('0x2e')]);_0x240a4b[_0xb310('0x30')]=_[_0xb310('0x31')](_0x240a4b[_0xb310('0x32')],_0x240a4b[_0xb310('0x2e')]);_0x58466a[_0xb310('0x33')]=_[_0xb310('0x31')](_0x240a4b[_0xb310('0x32')],qs[_0xb310('0x34')](_0x56d4b1['query'][_0xb310('0x34')]));_0x58466a[_0xb310('0x33')]=_0x58466a[_0xb310('0x33')][_0xb310('0x35')]?_0x58466a['attributes']:_0x240a4b[_0xb310('0x32')];if(_0x56d4b1['query'][_0xb310('0x43')]){_0x58466a[_0xb310('0x3f')]=[{'all':!![]}];}_0x58466a=_[_0xb310('0x39')]({},_0x58466a,_0x56d4b1[_0xb310('0x3d')]);return db[_0xb310('0x3e')][_0xb310('0x44')](_0x58466a)[_0xb310('0x22')](handleEntityNotFound(_0x297e1b,null))[_0xb310('0x22')](respondWithResult(_0x297e1b,null))[_0xb310('0x45')](handleError(_0x297e1b,null));};exports['create']=function(_0x20c70f,_0x5e778f){return db[_0xb310('0x3e')]['create'](_0x20c70f[_0xb310('0x46')],{})['then'](function(_0x423a3e){var _0x264de5=_0x20c70f[_0xb310('0x47')]['get']({'plain':!![]});if(!_0x264de5)throw new Error(_0xb310('0x48'));if(_0x264de5['role']===_0xb310('0x47')){var _0x2d7318=_0x423a3e[_0xb310('0x23')]({'plain':!![]});var _0x10d5c9=_0xb310('0x24');return db[_0xb310('0x49')][_0xb310('0x44')]({'where':{'name':_0x10d5c9,'userProfileId':_0x264de5[_0xb310('0x4a')]},'raw':!![]})['then'](function(_0x520ac5){if(_0x520ac5&&_0x520ac5[_0xb310('0x4b')]===0x0){return db[_0xb310('0x4c')][_0xb310('0x4d')]({'name':_0x2d7318[_0xb310('0x28')],'resourceId':_0x2d7318['id'],'type':_0x520ac5[_0xb310('0x28')],'sectionId':_0x520ac5['id']},{})[_0xb310('0x22')](function(){return _0x423a3e;});}else{return _0x423a3e;}})[_0xb310('0x45')](function(_0x1882db){logger[_0xb310('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1882db);throw _0x1882db;});}return _0x423a3e;})['then'](respondWithResult(_0x5e778f,0xc9))[_0xb310('0x45')](handleError(_0x5e778f,null));};exports[_0xb310('0x21')]=function(_0x252741,_0x146a55){if(_0x252741[_0xb310('0x46')]['id']){delete _0x252741['body']['id'];}return db['Tag'][_0xb310('0x44')]({'where':{'id':_0x252741[_0xb310('0x4e')]['id']}})['then'](handleEntityNotFound(_0x146a55,null))[_0xb310('0x22')](saveUpdates(_0x252741[_0xb310('0x46')],null))[_0xb310('0x22')](respondWithResult(_0x146a55,null))['catch'](handleError(_0x146a55,null));};exports[_0xb310('0x25')]=function(_0x4b92b9,_0x21b54a){return db[_0xb310('0x3e')][_0xb310('0x44')]({'where':{'id':_0x4b92b9[_0xb310('0x4e')]['id']}})['then'](handleEntityNotFound(_0x21b54a,null))[_0xb310('0x22')](removeEntity(_0x21b54a,null))[_0xb310('0x45')](handleError(_0x21b54a,null));};exports[_0xb310('0x4f')]=function(_0x1ea64d,_0x100b0f){return db[_0xb310('0x3e')][_0xb310('0x4f')]()[_0xb310('0x22')](respondWithResult(_0x100b0f,null))[_0xb310('0x45')](handleError(_0x100b0f,null));}; \ No newline at end of file +var _0x59cd=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','get','Tags','stack','send','index','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','VIRTUAL','name','options','includeAll','findAll','rows','catch','show','include','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource'];(function(_0x1495bb,_0x107e01){var _0x598c2f=function(_0x14313e){while(--_0x14313e){_0x1495bb['push'](_0x1495bb['shift']());}};_0x598c2f(++_0x107e01);}(_0x59cd,0x108));var _0xd59c=function(_0x4a367f,_0x4e05f2){_0x4a367f=_0x4a367f-0x0;var _0x2bedd5=_0x59cd[_0x4a367f];return _0x2bedd5;};'use strict';var emlformat=require(_0xd59c('0x0'));var rimraf=require(_0xd59c('0x1'));var zipdir=require(_0xd59c('0x2'));var jsonpatch=require(_0xd59c('0x3'));var rp=require(_0xd59c('0x4'));var moment=require(_0xd59c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd59c('0x6'));var util=require(_0xd59c('0x7'));var path=require(_0xd59c('0x8'));var sox=require(_0xd59c('0x9'));var csv=require(_0xd59c('0xa'));var ejs=require(_0xd59c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd59c('0xc'));var squel=require(_0xd59c('0xd'));var crypto=require(_0xd59c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd59c('0xf'));var toCsv=require(_0xd59c('0xa'));var querystring=require(_0xd59c('0x10'));var Papa=require(_0xd59c('0x11'));var Redis=require(_0xd59c('0x12'));var authService=require(_0xd59c('0x13'));var qs=require(_0xd59c('0x14'));var as=require(_0xd59c('0x15'));var hardwareService=require(_0xd59c('0x16'));var logger=require(_0xd59c('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd59c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56a7b9,_0x433b62){_0x433b62=_0x433b62||0xcc;return function(_0x136ba7){if(_0x136ba7){return _0x56a7b9[_0xd59c('0x19')](_0x433b62);}return _0x56a7b9[_0xd59c('0x1a')](_0x433b62)[_0xd59c('0x1b')]();};}function respondWithResult(_0x32edfd,_0x371f61){_0x371f61=_0x371f61||0xc8;return function(_0x527589){if(_0x527589){return _0x32edfd['status'](_0x371f61)[_0xd59c('0x1c')](_0x527589);}};}function respondWithFilteredResult(_0x220616,_0xdb02dd){return function(_0x24efe1){if(_0x24efe1){var _0x53962c=typeof _0xdb02dd['offset']===_0xd59c('0x1d')&&typeof _0xdb02dd['limit']==='undefined';var _0x3be561=_0x24efe1['count'];var _0x1b0ec7=_0x53962c?0x0:_0xdb02dd[_0xd59c('0x1e')];var _0xa7c4de=_0x53962c?_0x24efe1[_0xd59c('0x1f')]:_0xdb02dd[_0xd59c('0x1e')]+_0xdb02dd[_0xd59c('0x20')];var _0x44f247;if(_0xa7c4de>=_0x3be561){_0xa7c4de=_0x3be561;_0x44f247=0xc8;}else{_0x44f247=0xce;}_0x220616[_0xd59c('0x1a')](_0x44f247);return _0x220616[_0xd59c('0x21')](_0xd59c('0x22'),_0x1b0ec7+'-'+_0xa7c4de+'/'+_0x3be561)[_0xd59c('0x1c')](_0x24efe1);}return null;};}function patchUpdates(_0x5b266f){return function(_0xbffaad){try{jsonpatch[_0xd59c('0x23')](_0xbffaad,_0x5b266f,!![]);}catch(_0x43ed3a){return BPromise[_0xd59c('0x24')](_0x43ed3a);}return _0xbffaad[_0xd59c('0x25')]();};}function saveUpdates(_0x21f2c7,_0x12b850){return function(_0x2dbd5e){if(_0x2dbd5e){return _0x2dbd5e[_0xd59c('0x26')](_0x21f2c7)[_0xd59c('0x27')](function(_0x438643){return _0x438643;});}return null;};}function removeEntity(_0x3c30e7,_0x1259cb){return function(_0x3ca915){if(_0x3ca915){return _0x3ca915['destroy']()['then'](function(){var _0x56a1b7=_0x3ca915[_0xd59c('0x28')]({'plain':!![]});var _0x146ecf=_0xd59c('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x146ecf,'resourceId':_0x56a1b7['id']}})[_0xd59c('0x27')](function(){return _0x3ca915;});})[_0xd59c('0x27')](function(){_0x3c30e7['status'](0xcc)[_0xd59c('0x1b')]();});}};}function handleEntityNotFound(_0x56526,_0x50dc58){return function(_0x5d7ea1){if(!_0x5d7ea1){_0x56526[_0xd59c('0x19')](0x194);}return _0x5d7ea1;};}function handleError(_0x56fcf9,_0x5e44ac){_0x5e44ac=_0x5e44ac||0x1f4;return function(_0x1e159d){logger['error'](_0x1e159d[_0xd59c('0x2a')]);if(_0x1e159d['name']){delete _0x1e159d['name'];}_0x56fcf9['status'](_0x5e44ac)[_0xd59c('0x2b')](_0x1e159d);};}exports[_0xd59c('0x2c')]=function(_0x4e2b2d,_0x18b8ff){var _0x497e33={},_0x26f579={},_0x1723d9={'count':0x0,'rows':[]};var _0x565f86=_[_0xd59c('0x2d')](db[_0xd59c('0x2e')][_0xd59c('0x2f')],function(_0x4625ef){return{'name':_0x4625ef[_0xd59c('0x30')],'type':_0x4625ef[_0xd59c('0x31')][_0xd59c('0x32')]};});_0x26f579[_0xd59c('0x33')]=_[_0xd59c('0x2d')](_0x565f86,'name');_0x26f579[_0xd59c('0x34')]=_[_0xd59c('0x35')](_0x4e2b2d[_0xd59c('0x34')]);_0x26f579['filters']=_[_0xd59c('0x36')](_0x26f579['model'],_0x26f579[_0xd59c('0x34')]);_0x497e33[_0xd59c('0x37')]=_['intersection'](_0x26f579['model'],qs['fields'](_0x4e2b2d[_0xd59c('0x34')][_0xd59c('0x38')]));_0x497e33[_0xd59c('0x37')]=_0x497e33[_0xd59c('0x37')]['length']?_0x497e33[_0xd59c('0x37')]:_0x26f579['model'];if(!_0x4e2b2d[_0xd59c('0x34')][_0xd59c('0x39')](_0xd59c('0x3a'))){_0x497e33['limit']=qs[_0xd59c('0x20')](_0x4e2b2d[_0xd59c('0x34')][_0xd59c('0x20')]);_0x497e33[_0xd59c('0x1e')]=qs[_0xd59c('0x1e')](_0x4e2b2d[_0xd59c('0x34')][_0xd59c('0x1e')]);}_0x497e33['order']=qs[_0xd59c('0x3b')](_0x4e2b2d[_0xd59c('0x34')][_0xd59c('0x3b')]);_0x497e33['where']=qs['filters'](_[_0xd59c('0x3c')](_0x4e2b2d[_0xd59c('0x34')],_0x26f579[_0xd59c('0x3d')]),_0x565f86);if(_0x4e2b2d[_0xd59c('0x34')][_0xd59c('0x3e')]){_0x497e33['where']=_[_0xd59c('0x3f')](_0x497e33[_0xd59c('0x40')],{'$or':_[_0xd59c('0x2d')](_0x565f86,function(_0x266d40){if(_0x266d40[_0xd59c('0x31')]!==_0xd59c('0x41')){var _0x557ee3={};_0x557ee3[_0x266d40[_0xd59c('0x42')]]={'$like':'%'+_0x4e2b2d[_0xd59c('0x34')]['filter']+'%'};return _0x557ee3;}})});}_0x497e33=_[_0xd59c('0x3f')]({},_0x497e33,_0x4e2b2d[_0xd59c('0x43')]);var _0x1f2be0={'where':_0x497e33['where']};return db[_0xd59c('0x2e')]['count'](_0x1f2be0)[_0xd59c('0x27')](function(_0x342f37){_0x1723d9[_0xd59c('0x1f')]=_0x342f37;if(_0x4e2b2d[_0xd59c('0x34')][_0xd59c('0x44')]){_0x497e33['include']=[{'all':!![]}];}return db['Tag'][_0xd59c('0x45')](_0x497e33);})['then'](function(_0x3b19b3){_0x1723d9[_0xd59c('0x46')]=_0x3b19b3;return _0x1723d9;})[_0xd59c('0x27')](respondWithFilteredResult(_0x18b8ff,_0x497e33))[_0xd59c('0x47')](handleError(_0x18b8ff,null));};exports[_0xd59c('0x48')]=function(_0x51f651,_0x1a2ad0){var _0x1547ad={'raw':!![],'where':{'id':_0x51f651['params']['id']}},_0x2c4931={};_0x2c4931[_0xd59c('0x33')]=_[_0xd59c('0x35')](db[_0xd59c('0x2e')]['rawAttributes']);_0x2c4931[_0xd59c('0x34')]=_['keys'](_0x51f651[_0xd59c('0x34')]);_0x2c4931[_0xd59c('0x3d')]=_[_0xd59c('0x36')](_0x2c4931[_0xd59c('0x33')],_0x2c4931[_0xd59c('0x34')]);_0x1547ad[_0xd59c('0x37')]=_[_0xd59c('0x36')](_0x2c4931[_0xd59c('0x33')],qs['fields'](_0x51f651['query'][_0xd59c('0x38')]));_0x1547ad[_0xd59c('0x37')]=_0x1547ad[_0xd59c('0x37')]['length']?_0x1547ad['attributes']:_0x2c4931['model'];if(_0x51f651[_0xd59c('0x34')]['includeAll']){_0x1547ad[_0xd59c('0x49')]=[{'all':!![]}];}_0x1547ad=_[_0xd59c('0x3f')]({},_0x1547ad,_0x51f651[_0xd59c('0x43')]);return db[_0xd59c('0x2e')][_0xd59c('0x4a')](_0x1547ad)[_0xd59c('0x27')](handleEntityNotFound(_0x1a2ad0,null))['then'](respondWithResult(_0x1a2ad0,null))['catch'](handleError(_0x1a2ad0,null));};exports['create']=function(_0x4486df,_0x4b7245){return db[_0xd59c('0x2e')]['create'](_0x4486df['body'],{})[_0xd59c('0x27')](function(_0x5b534b){var _0x342e0e=_0x4486df[_0xd59c('0x4b')][_0xd59c('0x28')]({'plain':!![]});if(!_0x342e0e)throw new Error(_0xd59c('0x4c'));if(_0x342e0e[_0xd59c('0x4d')]===_0xd59c('0x4b')){var _0x39aae2=_0x5b534b[_0xd59c('0x28')]({'plain':!![]});var _0x142842=_0xd59c('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x142842,'userProfileId':_0x342e0e['userProfileId']},'raw':!![]})[_0xd59c('0x27')](function(_0x377bd1){if(_0x377bd1&&_0x377bd1[_0xd59c('0x4e')]===0x0){return db[_0xd59c('0x4f')]['create']({'name':_0x39aae2[_0xd59c('0x42')],'resourceId':_0x39aae2['id'],'type':_0x377bd1[_0xd59c('0x42')],'sectionId':_0x377bd1['id']},{})[_0xd59c('0x27')](function(){return _0x5b534b;});}else{return _0x5b534b;}})[_0xd59c('0x47')](function(_0xde893c){logger[_0xd59c('0x50')](_0xd59c('0x51'),_0xde893c);throw _0xde893c;});}return _0x5b534b;})[_0xd59c('0x27')](respondWithResult(_0x4b7245,0xc9))[_0xd59c('0x47')](handleError(_0x4b7245,null));};exports['update']=function(_0x26bc4d,_0x32d08d){if(_0x26bc4d[_0xd59c('0x52')]['id']){delete _0x26bc4d[_0xd59c('0x52')]['id'];}return db[_0xd59c('0x2e')][_0xd59c('0x4a')]({'where':{'id':_0x26bc4d[_0xd59c('0x53')]['id']}})['then'](handleEntityNotFound(_0x32d08d,null))[_0xd59c('0x27')](saveUpdates(_0x26bc4d[_0xd59c('0x52')],null))[_0xd59c('0x27')](respondWithResult(_0x32d08d,null))[_0xd59c('0x47')](handleError(_0x32d08d,null));};exports[_0xd59c('0x54')]=function(_0x3a1377,_0x5a18ba){return db[_0xd59c('0x2e')][_0xd59c('0x4a')]({'where':{'id':_0x3a1377[_0xd59c('0x53')]['id']}})[_0xd59c('0x27')](handleEntityNotFound(_0x5a18ba,null))['then'](removeEntity(_0x5a18ba,null))[_0xd59c('0x47')](handleError(_0x5a18ba,null));};exports[_0xd59c('0x55')]=function(_0x6b4f66,_0xbe16ae){return db[_0xd59c('0x2e')][_0xd59c('0x55')]()['then'](respondWithResult(_0xbe16ae,null))[_0xd59c('0x47')](handleError(_0xbe16ae,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 78847ba..f93c887 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 _0xdb78=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','Tag','tools_tags','lodash'];(function(_0x14f67e,_0x290e22){var _0x34316f=function(_0xf9fa81){while(--_0xf9fa81){_0x14f67e['push'](_0x14f67e['shift']());}};_0x34316f(++_0x290e22);}(_0xdb78,0x1ed));var _0x8db7=function(_0x357f9d,_0x1ba8f9){_0x357f9d=_0x357f9d-0x0;var _0x541581=_0xdb78[_0x357f9d];return _0x541581;};'use strict';var _=require(_0x8db7('0x0'));var util=require(_0x8db7('0x1'));var logger=require(_0x8db7('0x2'))(_0x8db7('0x3'));var moment=require('moment');var BPromise=require(_0x8db7('0x4'));var rp=require(_0x8db7('0x5'));var fs=require('fs');var path=require(_0x8db7('0x6'));var rimraf=require(_0x8db7('0x7'));var config=require(_0x8db7('0x8'));var attributes=require(_0x8db7('0x9'));module[_0x8db7('0xa')]=function(_0x222fb3,_0x5f13ae){return _0x222fb3['define'](_0x8db7('0xb'),attributes,{'tableName':_0x8db7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe58a=['moment','path','./tag.attributes','define','Tag','tools_tags','lodash','util','../../config/logger'];(function(_0x3a0b7f,_0x550d3b){var _0x551562=function(_0x2f7817){while(--_0x2f7817){_0x3a0b7f['push'](_0x3a0b7f['shift']());}};_0x551562(++_0x550d3b);}(_0xe58a,0x9f));var _0xae58=function(_0x166ec5,_0x73d15e){_0x166ec5=_0x166ec5-0x0;var _0x22be48=_0xe58a[_0x166ec5];return _0x22be48;};'use strict';var _=require(_0xae58('0x0'));var util=require(_0xae58('0x1'));var logger=require(_0xae58('0x2'))('api');var moment=require(_0xae58('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xae58('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xae58('0x5'));module['exports']=function(_0x198e0c,_0x29749a){return _0x198e0c[_0xae58('0x6')](_0xae58('0x7'),attributes,{'tableName':_0xae58('0x8'),'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 9bea29a..b59d894 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 _0xd13e=['Tag,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','request','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x34910a,_0x5f2b8d){var _0x218710=function(_0xe2dbbd){while(--_0xe2dbbd){_0x34910a['push'](_0x34910a['shift']());}};_0x218710(++_0x5f2b8d);}(_0xd13e,0x193));var _0xed13=function(_0x539214,_0xb3fce6){_0x539214=_0x539214-0x0;var _0x49e944=_0xd13e[_0x539214];return _0x49e944;};'use strict';var _=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var moment=require(_0xed13('0x2'));var BPromise=require(_0xed13('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed13('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed13('0x5'));var logger=require('../../config/logger')(_0xed13('0x6'));var config=require(_0xed13('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x95ff4c,_0x134929,_0xab0fff){return new BPromise(function(_0x3b3984,_0x369798){return client[_0xed13('0x8')](_0x95ff4c,_0xab0fff)[_0xed13('0x9')](function(_0x9bc191){logger[_0xed13('0xa')]('Tag,\x20%s,\x20%s',_0x134929,_0xed13('0xb'));logger[_0xed13('0xc')](_0xed13('0xd'),_0x134929,_0xed13('0xb'),JSON[_0xed13('0xe')](_0x9bc191));if(_0x9bc191['error']){if(_0x9bc191[_0xed13('0xf')][_0xed13('0x10')]===0x1f4){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x9bc191[_0xed13('0xf')][_0xed13('0x12')]);return _0x369798(_0x9bc191['error'][_0xed13('0x12')]);}logger['error'](_0xed13('0x11'),_0x134929,_0x9bc191['error'][_0xed13('0x12')]);return _0x3b3984(_0x9bc191['error'][_0xed13('0x12')]);}else{logger['info'](_0xed13('0x11'),_0x134929,_0xed13('0xb'));_0x3b3984(_0x9bc191[_0xed13('0x13')][_0xed13('0x12')]);}})[_0xed13('0x14')](function(_0x1f8585){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x1f8585);_0x369798(_0x1f8585);});});} \ No newline at end of file +var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x51d068,_0x309292){var _0x94f736=function(_0x45321d){while(--_0x45321d){_0x51d068['push'](_0x51d068['shift']());}};_0x94f736(++_0x309292);}(_0x6aa7,0x178));var _0x76aa=function(_0x3d0120,_0x2cb75a){_0x3d0120=_0x3d0120-0x0;var _0x210a3d=_0x6aa7[_0x3d0120];return _0x210a3d;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 07d451b..323d6f4 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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 b1ef920..b010c75 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(_0x25d88a,_0x42ffe7){var _0x3ad9ce=function(_0x57316e){while(--_0x57316e){_0x25d88a['push'](_0x25d88a['shift']());}};_0x3ad9ce(++_0x42ffe7);}(_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 _0x2032=['name','exports','STRING'];(function(_0x27df53,_0x81d0d2){var _0x4cb1cf=function(_0x38869f){while(--_0x38869f){_0x27df53['push'](_0x27df53['shift']());}};_0x4cb1cf(++_0x81d0d2);}(_0x2032,0xd9));var _0x2203=function(_0x48f146,_0x77c316){_0x48f146=_0x48f146-0x0;var _0x4472f5=_0x2032[_0x48f146];return _0x4472f5;};'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 diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 87db124..3f18ad2 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 _0x6bb6=['eml-format','zip-dir','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','error','stack','name','index','map','Team','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','then','includeAll','include','findAll','catch','show','params','merge','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','SmsQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','UserProfileResource','Teams','send','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','add','ids','ValidationError','remove','isArray','Voice','Mail','Sms','Fax','Whatsapp','through','penalty','User','findOrCreate','emit','Queue:save','QueueId','online','interface','UserVoiceQueueRt','isNil','format','voicePause','all','upsert','addAgents','spread','removeAgents','Chat','Openchannel','Queue:remove','UserVoicePrefix','getAgents','nolimit'];(function(_0xf1440c,_0x2b1b87){var _0x40bee8=function(_0x259332){while(--_0x259332){_0xf1440c['push'](_0xf1440c['shift']());}};_0x40bee8(++_0x2b1b87);}(_0x6bb6,0x134));var _0x66bb=function(_0x444b50,_0x1b65dd){_0x444b50=_0x444b50-0x0;var _0x52fdab=_0x6bb6[_0x444b50];return _0x52fdab;};'use strict';var emlformat=require(_0x66bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x66bb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x66bb('0x2'));var BPromise=require(_0x66bb('0x3'));var Mustache=require('mustache');var util=require(_0x66bb('0x4'));var path=require('path');var sox=require(_0x66bb('0x5'));var csv=require('to-csv');var ejs=require(_0x66bb('0x6'));var fs=require('fs');var fs_extra=require(_0x66bb('0x7'));var _=require(_0x66bb('0x8'));var squel=require(_0x66bb('0x9'));var crypto=require(_0x66bb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x66bb('0xb'));var toCsv=require(_0x66bb('0xc'));var querystring=require(_0x66bb('0xd'));var Papa=require(_0x66bb('0xe'));var Redis=require('ioredis');var authService=require(_0x66bb('0xf'));var qs=require(_0x66bb('0x10'));var as=require(_0x66bb('0x11'));var hardwareService=require(_0x66bb('0x12'));var logger=require(_0x66bb('0x13'))('api');var utils=require(_0x66bb('0x14'));var config=require(_0x66bb('0x15'));var licenseUtil=require(_0x66bb('0x16'));var db=require('../../mysqldb')['db'];config[_0x66bb('0x17')]=_[_0x66bb('0x18')](config[_0x66bb('0x17')],{'host':_0x66bb('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x66bb('0x17')]));require(_0x66bb('0x1a'))[_0x66bb('0x1b')](socket);function respondWithStatusCode(_0x4838ec,_0x5e3213){_0x5e3213=_0x5e3213||0xcc;return function(_0xe3d58f){if(_0xe3d58f){return _0x4838ec[_0x66bb('0x1c')](_0x5e3213);}return _0x4838ec[_0x66bb('0x1d')](_0x5e3213)[_0x66bb('0x1e')]();};}function respondWithResult(_0x381065,_0x190c4b){_0x190c4b=_0x190c4b||0xc8;return function(_0x527e78){if(_0x527e78){return _0x381065[_0x66bb('0x1d')](_0x190c4b)[_0x66bb('0x1f')](_0x527e78);}};}function respondWithFilteredResult(_0x443924,_0x400bd5){return function(_0x508e8c){if(_0x508e8c){var _0x1f3a7e=typeof _0x400bd5['offset']==='undefined'&&typeof _0x400bd5['limit']==='undefined';var _0x304fb9=_0x508e8c[_0x66bb('0x20')];var _0x1c5ea2=_0x1f3a7e?0x0:_0x400bd5[_0x66bb('0x21')];var _0x20e4e9=_0x1f3a7e?_0x508e8c[_0x66bb('0x20')]:_0x400bd5[_0x66bb('0x21')]+_0x400bd5[_0x66bb('0x22')];var _0x1a74b1;if(_0x20e4e9>=_0x304fb9){_0x20e4e9=_0x304fb9;_0x1a74b1=0xc8;}else{_0x1a74b1=0xce;}_0x443924[_0x66bb('0x1d')](_0x1a74b1);return _0x443924['set'](_0x66bb('0x23'),_0x1c5ea2+'-'+_0x20e4e9+'/'+_0x304fb9)[_0x66bb('0x1f')](_0x508e8c);}return null;};}function patchUpdates(_0x2a3496){return function(_0x371033){try{jsonpatch[_0x66bb('0x24')](_0x371033,_0x2a3496,!![]);}catch(_0x389b5a){return BPromise['reject'](_0x389b5a);}return _0x371033['save']();};}function saveUpdates(_0x254252,_0x46910e){return function(_0x4424c8){if(_0x4424c8){return _0x4424c8[_0x66bb('0x25')](_0x254252)['then'](function(_0x37ccbf){return _0x37ccbf;});}return null;};}function handleEntityNotFound(_0x38e8b8,_0x4883bc){return function(_0xabd7d6){if(!_0xabd7d6){_0x38e8b8['sendStatus'](0x194);}return _0xabd7d6;};}function handleError(_0x5cda41,_0x16a662){_0x16a662=_0x16a662||0x1f4;return function(_0x41ecd7){logger[_0x66bb('0x26')](_0x41ecd7[_0x66bb('0x27')]);if(_0x41ecd7[_0x66bb('0x28')]){delete _0x41ecd7['name'];}_0x5cda41[_0x66bb('0x1d')](_0x16a662)['send'](_0x41ecd7);};}exports[_0x66bb('0x29')]=function(_0x5971a1,_0x57da3e){var _0x570756={},_0x2f09fe={},_0x414146={'count':0x0,'rows':[]};var _0x50d8b6=_[_0x66bb('0x2a')](db[_0x66bb('0x2b')][_0x66bb('0x2c')],function(_0x3092a7){return{'name':_0x3092a7[_0x66bb('0x2d')],'type':_0x3092a7[_0x66bb('0x2e')]['key']};});_0x2f09fe[_0x66bb('0x2f')]=_[_0x66bb('0x2a')](_0x50d8b6,_0x66bb('0x28'));_0x2f09fe[_0x66bb('0x30')]=_[_0x66bb('0x31')](_0x5971a1[_0x66bb('0x30')]);_0x2f09fe[_0x66bb('0x32')]=_['intersection'](_0x2f09fe[_0x66bb('0x2f')],_0x2f09fe[_0x66bb('0x30')]);_0x570756[_0x66bb('0x33')]=_[_0x66bb('0x34')](_0x2f09fe[_0x66bb('0x2f')],qs['fields'](_0x5971a1['query'][_0x66bb('0x35')]));_0x570756[_0x66bb('0x33')]=_0x570756[_0x66bb('0x33')][_0x66bb('0x36')]?_0x570756[_0x66bb('0x33')]:_0x2f09fe['model'];if(!_0x5971a1[_0x66bb('0x30')][_0x66bb('0x37')]('nolimit')){_0x570756[_0x66bb('0x22')]=qs['limit'](_0x5971a1[_0x66bb('0x30')][_0x66bb('0x22')]);_0x570756[_0x66bb('0x21')]=qs[_0x66bb('0x21')](_0x5971a1['query'][_0x66bb('0x21')]);}_0x570756[_0x66bb('0x38')]=qs[_0x66bb('0x39')](_0x5971a1[_0x66bb('0x30')][_0x66bb('0x39')]);_0x570756[_0x66bb('0x3a')]=qs[_0x66bb('0x32')](_[_0x66bb('0x3b')](_0x5971a1[_0x66bb('0x30')],_0x2f09fe[_0x66bb('0x32')]),_0x50d8b6);if(_0x5971a1[_0x66bb('0x30')][_0x66bb('0x3c')]){_0x570756[_0x66bb('0x3a')]=_['merge'](_0x570756[_0x66bb('0x3a')],{'$or':_['map'](_0x50d8b6,function(_0x52407f){if(_0x52407f['type']!==_0x66bb('0x3d')){var _0x57e182={};_0x57e182[_0x52407f['name']]={'$like':'%'+_0x5971a1[_0x66bb('0x30')][_0x66bb('0x3c')]+'%'};return _0x57e182;}})});}_0x570756=_['merge']({},_0x570756,_0x5971a1['options']);var _0x43c616={'where':_0x570756['where']};return db[_0x66bb('0x2b')][_0x66bb('0x20')](_0x43c616)[_0x66bb('0x3e')](function(_0x23ee8c){_0x414146[_0x66bb('0x20')]=_0x23ee8c;if(_0x5971a1[_0x66bb('0x30')][_0x66bb('0x3f')]){_0x570756[_0x66bb('0x40')]=[{'all':!![]}];}return db[_0x66bb('0x2b')][_0x66bb('0x41')](_0x570756);})['then'](function(_0x1bfc0d){_0x414146['rows']=_0x1bfc0d;return _0x414146;})[_0x66bb('0x3e')](respondWithFilteredResult(_0x57da3e,_0x570756))[_0x66bb('0x42')](handleError(_0x57da3e,null));};exports[_0x66bb('0x43')]=function(_0x41daf6,_0x3335b7){var _0x1ac593={'raw':![],'where':{'id':_0x41daf6[_0x66bb('0x44')]['id']}},_0x47365a={};_0x47365a[_0x66bb('0x2f')]=_[_0x66bb('0x31')](db[_0x66bb('0x2b')][_0x66bb('0x2c')]);_0x47365a['query']=_[_0x66bb('0x31')](_0x41daf6[_0x66bb('0x30')]);_0x47365a['filters']=_['intersection'](_0x47365a['model'],_0x47365a[_0x66bb('0x30')]);_0x1ac593[_0x66bb('0x33')]=_[_0x66bb('0x34')](_0x47365a[_0x66bb('0x2f')],qs[_0x66bb('0x35')](_0x41daf6[_0x66bb('0x30')][_0x66bb('0x35')]));_0x1ac593[_0x66bb('0x33')]=_0x1ac593[_0x66bb('0x33')][_0x66bb('0x36')]?_0x1ac593[_0x66bb('0x33')]:_0x47365a[_0x66bb('0x2f')];if(_0x41daf6[_0x66bb('0x30')][_0x66bb('0x3f')]){_0x1ac593[_0x66bb('0x40')]=[{'all':!![]}];}_0x1ac593=_[_0x66bb('0x45')]({},_0x1ac593,_0x41daf6[_0x66bb('0x46')]);return db['Team'][_0x66bb('0x47')](_0x1ac593)['then'](handleEntityNotFound(_0x3335b7,null))[_0x66bb('0x3e')](respondWithResult(_0x3335b7,null))[_0x66bb('0x42')](handleError(_0x3335b7,null));};exports['create']=function(_0x2999d1,_0x56f3ac){return db[_0x66bb('0x2b')][_0x66bb('0x48')](_0x2999d1[_0x66bb('0x49')],{})[_0x66bb('0x3e')](function(_0xbb8c7f){var _0x71908d=_0x2999d1[_0x66bb('0x4a')][_0x66bb('0x4b')]({'plain':!![]});if(!_0x71908d)throw new Error(_0x66bb('0x4c'));if(_0x71908d['role']==='user'){var _0x2d9fc4=_0xbb8c7f[_0x66bb('0x4b')]({'plain':!![]});var _0x166042='Teams';return db[_0x66bb('0x4d')][_0x66bb('0x47')]({'where':{'name':_0x166042,'userProfileId':_0x71908d[_0x66bb('0x4e')]},'raw':!![]})[_0x66bb('0x3e')](function(_0x59d760){if(_0x59d760&&_0x59d760[_0x66bb('0x4f')]===0x0){return db['UserProfileResource'][_0x66bb('0x48')]({'name':_0x2d9fc4[_0x66bb('0x28')],'resourceId':_0x2d9fc4['id'],'type':_0x59d760[_0x66bb('0x28')],'sectionId':_0x59d760['id']},{})[_0x66bb('0x3e')](function(){return _0xbb8c7f;});}else{return _0xbb8c7f;}})['catch'](function(_0x94f4c4){logger[_0x66bb('0x26')](_0x66bb('0x50'),_0x94f4c4);throw _0x94f4c4;});}return _0xbb8c7f;})[_0x66bb('0x3e')](respondWithResult(_0x56f3ac,0xc9))[_0x66bb('0x42')](handleError(_0x56f3ac,null));};exports[_0x66bb('0x25')]=function(_0x3919e1,_0x3cc588){if(_0x3919e1[_0x66bb('0x49')]['id']){delete _0x3919e1[_0x66bb('0x49')]['id'];}return db['Team'][_0x66bb('0x47')]({'where':{'id':_0x3919e1['params']['id']}})[_0x66bb('0x3e')](handleEntityNotFound(_0x3cc588,null))[_0x66bb('0x3e')](saveUpdates(_0x3919e1[_0x66bb('0x49')],null))['then'](respondWithResult(_0x3cc588,null))['catch'](handleError(_0x3cc588,null));};exports[_0x66bb('0x51')]=function(_0x2f78c3,_0x3057a1){var _0x4164b9=_0x2f78c3['params']['id'];var _0x3da03e=[];return db[_0x66bb('0x52')][_0x66bb('0x53')](function(_0xf68a65){var _0x4dc9bf=_0x66bb('0x54')+_0x4164b9;return db[_0x66bb('0x52')]['query'](_0x4dc9bf,{'type':db['Sequelize'][_0x66bb('0x55')][_0x66bb('0x56')],'raw':!![],'transaction':_0xf68a65})[_0x66bb('0x3e')](function(_0x5de0f9){_0x3da03e=_[_0x66bb('0x2a')](_0x5de0f9,function(_0x58deb2){return Number(_0x58deb2[_0x66bb('0x57')]);});})[_0x66bb('0x3e')](function(){var _0x429082=_0x66bb('0x58')+_0x4164b9;return db[_0x66bb('0x52')][_0x66bb('0x30')](_0x429082,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0xf68a65});})['then'](function(_0xe7f509){var _0x307b84=_['map'](_0xe7f509,function(_0x84cf13){return Number(_0x84cf13[_0x66bb('0x59')]);});return db[_0x66bb('0x5a')][_0x66bb('0x51')]({'where':{'UserId':{'$in':_0x3da03e},'VoiceQueueId':{'$in':_0x307b84}},'transaction':_0xf68a65});})['then'](function(){var _0x1db772=_0x66bb('0x5b')+_0x4164b9;return db[_0x66bb('0x52')][_0x66bb('0x30')](_0x1db772,{'type':db['Sequelize'][_0x66bb('0x55')][_0x66bb('0x56')],'raw':!![],'transaction':_0xf68a65});})['then'](function(_0x151441){var _0x43626a=_[_0x66bb('0x2a')](_0x151441,function(_0x582ab9){return Number(_0x582ab9[_0x66bb('0x5c')]);});return db[_0x66bb('0x5d')][_0x66bb('0x51')]({'where':{'UserId':{'$in':_0x3da03e},'MailQueueId':{'$in':_0x43626a}},'transaction':_0xf68a65});})['then'](function(){var _0x59060b=_0x66bb('0x5e')+_0x4164b9;return db[_0x66bb('0x52')][_0x66bb('0x30')](_0x59060b,{'type':db[_0x66bb('0x5f')][_0x66bb('0x55')][_0x66bb('0x56')],'raw':!![],'transaction':_0xf68a65});})[_0x66bb('0x3e')](function(_0x380bd4){var _0x5d1239=_[_0x66bb('0x2a')](_0x380bd4,function(_0x165046){return Number(_0x165046[_0x66bb('0x60')]);});return db['UserSmsQueue'][_0x66bb('0x51')]({'where':{'UserId':{'$in':_0x3da03e},'SmsQueueId':{'$in':_0x5d1239}},'transaction':_0xf68a65});})[_0x66bb('0x3e')](function(){var _0x2a380d='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4164b9;return db[_0x66bb('0x52')][_0x66bb('0x30')](_0x2a380d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0xf68a65});})[_0x66bb('0x3e')](function(_0x192084){var _0x287971=_[_0x66bb('0x2a')](_0x192084,function(_0x530863){return Number(_0x530863['ChatQueueId']);});return db[_0x66bb('0x61')]['destroy']({'where':{'UserId':{'$in':_0x3da03e},'ChatQueueId':{'$in':_0x287971}},'transaction':_0xf68a65});})[_0x66bb('0x3e')](function(){var _0x5c620f=_0x66bb('0x62')+_0x4164b9;return db[_0x66bb('0x52')][_0x66bb('0x30')](_0x5c620f,{'type':db['Sequelize'][_0x66bb('0x55')][_0x66bb('0x56')],'raw':!![],'transaction':_0xf68a65});})[_0x66bb('0x3e')](function(_0x3ad597){var _0x515fff=_[_0x66bb('0x2a')](_0x3ad597,function(_0x829548){return Number(_0x829548[_0x66bb('0x63')]);});return db['UserFaxQueue']['destroy']({'where':{'UserId':{'$in':_0x3da03e},'FaxQueueId':{'$in':_0x515fff}},'transaction':_0xf68a65});})[_0x66bb('0x3e')](function(){var _0x5cc697=_0x66bb('0x64')+_0x4164b9;return db[_0x66bb('0x52')][_0x66bb('0x30')](_0x5cc697,{'type':db['Sequelize'][_0x66bb('0x55')][_0x66bb('0x56')],'raw':!![],'transaction':_0xf68a65});})[_0x66bb('0x3e')](function(_0x5a8669){var _0x5e286d=_[_0x66bb('0x2a')](_0x5a8669,function(_0x214da6){return Number(_0x214da6[_0x66bb('0x65')]);});return db[_0x66bb('0x66')][_0x66bb('0x51')]({'where':{'UserId':{'$in':_0x3da03e},'OpenchannelQueueId':{'$in':_0x5e286d}},'transaction':_0xf68a65});})['then'](function(){var _0xcbf13a=_0x66bb('0x67')+_0x4164b9;return db['sequelize'][_0x66bb('0x30')](_0xcbf13a,{'type':db['Sequelize']['QueryTypes'][_0x66bb('0x56')],'raw':!![],'transaction':_0xf68a65});})[_0x66bb('0x3e')](function(_0x20eb30){var _0x53640c=_[_0x66bb('0x2a')](_0x20eb30,function(_0x2d05c0){return Number(_0x2d05c0[_0x66bb('0x68')]);});return db[_0x66bb('0x69')][_0x66bb('0x51')]({'where':{'UserId':{'$in':_0x3da03e},'WhatsappQueueId':{'$in':_0x53640c}},'transaction':_0xf68a65});})[_0x66bb('0x3e')](function(){return db[_0x66bb('0x6a')]['find']({'where':{'TeamId':_0x4164b9}});})[_0x66bb('0x3e')](function(_0x1ff810){if(_0x1ff810===null){return;}return db['UserVoicePrefix'][_0x66bb('0x51')]({'where':{'UserId':{'$in':_0x3da03e},'VoicePrefixId':_0x1ff810[_0x66bb('0x6b')]},'transaction':_0xf68a65});})[_0x66bb('0x3e')](function(){return db[_0x66bb('0x2b')]['destroy']({'where':{'id':_0x4164b9},'cascade':!![],'transaction':_0xf68a65});})[_0x66bb('0x3e')](function(_0x3f4c00){if(_0x3f4c00===0x0){_0x3057a1[_0x66bb('0x1c')](0x194);}else{return db[_0x66bb('0x6c')][_0x66bb('0x51')]({'where':{'type':_0x66bb('0x6d'),'resourceId':_0x4164b9},'cascade':!![],'transaction':_0xf68a65})[_0x66bb('0x3e')](function(){_0x3057a1[_0x66bb('0x1d')](0xcc)[_0x66bb('0x1e')]();});}})[_0x66bb('0x42')](function(_0x46816a){_0x3057a1[_0x66bb('0x1d')](0x1f4)[_0x66bb('0x6e')](_0x46816a);});});};exports['getQueues']=function(_0x43042f,_0x4a71d9,_0x5b1119){return db[_0x66bb('0x2b')][_0x66bb('0x6f')]({'where':{'id':_0x43042f['params']['id']}})[_0x66bb('0x3e')](handleEntityNotFound(_0x4a71d9,null))[_0x66bb('0x3e')](function(_0x1b0f3f){if(!_0x43042f[_0x66bb('0x30')][_0x66bb('0x70')]||!utils[_0x66bb('0x71')](_0x43042f[_0x66bb('0x30')]['channel'])){throw new db[(_0x66bb('0x5f'))]['ValidationError'](_0x66bb('0x72'));}var _0x22ee6b={};var _0x13f9ef={};_0x13f9ef[_0x66bb('0x2f')]=_['keys'](db[_[_0x66bb('0x73')](_0x43042f['query'][_0x66bb('0x70')][_0x66bb('0x74')]())+_0x66bb('0x75')][_0x66bb('0x2c')]);_0x13f9ef[_0x66bb('0x30')]=_[_0x66bb('0x31')](_0x43042f[_0x66bb('0x30')]);_0x13f9ef[_0x66bb('0x32')]=_['intersection'](_0x13f9ef['model'],_0x13f9ef[_0x66bb('0x30')]);_0x22ee6b[_0x66bb('0x33')]=_[_0x66bb('0x34')](_0x13f9ef[_0x66bb('0x2f')],qs[_0x66bb('0x35')](_0x43042f['query'][_0x66bb('0x35')]));_0x22ee6b['attributes']=_0x22ee6b[_0x66bb('0x33')][_0x66bb('0x36')]?_0x22ee6b[_0x66bb('0x33')]:_0x13f9ef['model'];_0x22ee6b[_0x66bb('0x22')]=qs[_0x66bb('0x22')](_0x43042f[_0x66bb('0x30')][_0x66bb('0x22')]);_0x22ee6b[_0x66bb('0x21')]=qs[_0x66bb('0x21')](_0x43042f[_0x66bb('0x30')][_0x66bb('0x21')]);_0x22ee6b['order']=qs[_0x66bb('0x39')](_0x43042f[_0x66bb('0x30')][_0x66bb('0x39')]);_0x22ee6b[_0x66bb('0x3a')]=qs[_0x66bb('0x32')](_[_0x66bb('0x3b')](_0x43042f[_0x66bb('0x30')],_0x13f9ef[_0x66bb('0x32')]));_0x22ee6b=_['merge']({},_0x22ee6b,_0x43042f['options']);return _0x1b0f3f[_0x66bb('0x4b')+_[_0x66bb('0x73')](_0x43042f[_0x66bb('0x30')][_0x66bb('0x70')][_0x66bb('0x74')]())+_0x66bb('0x76')](_0x22ee6b);})[_0x66bb('0x3e')](respondWithResult(_0x4a71d9,null))[_0x66bb('0x42')](handleError(_0x4a71d9,null));};exports[_0x66bb('0x77')]=function(_0x4a8eb9,_0x32d059,_0x380d00){return db[_0x66bb('0x2b')]['findOne']({'where':{'id':_0x4a8eb9[_0x66bb('0x44')]['id']}})[_0x66bb('0x3e')](function(_0x3dbbaa){if(_0x3dbbaa){if(!_0x4a8eb9[_0x66bb('0x49')][_0x66bb('0x70')]||!utils['isValidChannel'](_0x4a8eb9[_0x66bb('0x49')]['channel'])){throw new db[(_0x66bb('0x5f'))]['ValidationError']('Unknown\x20channel');}return _0x3dbbaa[_0x66bb('0x78')+_[_0x66bb('0x73')](_0x4a8eb9[_0x66bb('0x49')]['channel'][_0x66bb('0x74')]())+_0x66bb('0x76')](_0x4a8eb9['body'][_0x66bb('0x79')]);}return null;})[_0x66bb('0x3e')](handleEntityNotFound(_0x32d059,null))[_0x66bb('0x3e')](respondWithStatusCode(_0x32d059,null))[_0x66bb('0x42')](handleError(_0x32d059,null));};exports['removeQueues']=function(_0x18194f,_0x5abcaf,_0x2b2805){return db['Team'][_0x66bb('0x6f')]({'where':{'id':_0x18194f['params']['id']}})['then'](function(_0x468fce){if(_0x468fce){if(!_0x18194f[_0x66bb('0x30')][_0x66bb('0x70')]||!utils[_0x66bb('0x71')](_0x18194f[_0x66bb('0x30')]['channel'])){throw new db[(_0x66bb('0x5f'))][(_0x66bb('0x7a'))](_0x66bb('0x72'));}return _0x468fce[_0x66bb('0x7b')+_[_0x66bb('0x73')](_0x18194f[_0x66bb('0x30')][_0x66bb('0x70')][_0x66bb('0x74')]())+_0x66bb('0x76')](_0x18194f['query'][_0x66bb('0x79')]);}return null;})[_0x66bb('0x3e')](handleEntityNotFound(_0x5abcaf,null))[_0x66bb('0x3e')](respondWithStatusCode(_0x5abcaf,null))['catch'](handleError(_0x5abcaf,null));};exports['addAgents']=function(_0x96487d,_0x45dbee){var _0x2a3f69=_[_0x66bb('0x7c')](_0x96487d[_0x66bb('0x49')]['ids'])?_0x96487d['body']['ids']:[_0x96487d[_0x66bb('0x49')][_0x66bb('0x79')]];var _0x42f496=_0x96487d[_0x66bb('0x44')]['id'];return db[_0x66bb('0x2b')]['find']({'where':{'id':_0x42f496}})[_0x66bb('0x3e')](handleEntityNotFound(_0x45dbee,null))['then'](function(_0x27aefb){if(_0x27aefb){var _0x4822b1=[_0x66bb('0x7d'),'Chat',_0x66bb('0x7e'),_0x66bb('0x7f'),_0x66bb('0x80'),'Openchannel',_0x66bb('0x81')];return db['sequelize'][_0x66bb('0x53')](function(_0x3b3bae){var _0x49c3d8=_[_0x66bb('0x2a')](_0x4822b1,function(_0x29c7c2){var _0x13b3ba={'attributes':['id',_0x66bb('0x28')]};if(_0x29c7c2==='Voice'){_0x13b3ba[_0x66bb('0x82')]={'attributes':[_0x66bb('0x83')]};}return _0x27aefb[_0x66bb('0x4b')+_0x29c7c2+_0x66bb('0x76')](_0x13b3ba)[_0x66bb('0x3e')](function(_0x3da89e){var _0x44c782=_[_0x66bb('0x2a')](_0x3da89e,function(_0x45dcc0){var _0x4d8068=_['map'](_0x2a3f69,function(_0x4639ab){var _0x4fd6f7={'where':{'UserId':_0x4639ab,[_0x29c7c2+'QueueId']:_0x45dcc0['id']},'transaction':_0x3b3bae};if(_0x29c7c2==='Voice'){_0x4fd6f7[_0x66bb('0x18')]={'penalty':_0x45dcc0['TeamVoiceQueue'][_0x66bb('0x83')]};}return db[_0x66bb('0x84')+_0x29c7c2+_0x66bb('0x75')][_0x66bb('0x85')](_0x4fd6f7)[_0x66bb('0x3e')](function(){socket[_0x66bb('0x86')](_0x66bb('0x4a')+_0x29c7c2+_0x66bb('0x87'),{'UserId':_0x4639ab,[_0x29c7c2+_0x66bb('0x88')]:_0x45dcc0['id']});if(_0x29c7c2!==_0x66bb('0x7d')){return;}return db[_0x66bb('0x84')][_0x66bb('0x41')]({'where':{'id':_0x2a3f69,'online':0x1},'attributes':['id','name',_0x66bb('0x89'),'voicePause',_0x66bb('0x8a')],'raw':!![]})['then'](function(_0x5a03c0){var _0x1a6930=_[_0x66bb('0x2a')](_0x5a03c0,function(_0x1193ca){return db[_0x66bb('0x8b')]['upsert']({'membername':_0x1193ca[_0x66bb('0x28')],'UserId':_0x1193ca['id'],'queue_name':_0x45dcc0[_0x66bb('0x28')],'VoiceQueueId':_0x45dcc0['id'],'interface':_[_0x66bb('0x8c')](_0x1193ca[_0x66bb('0x8a')])?util[_0x66bb('0x8d')]('SIP/%s',_0x1193ca[_0x66bb('0x28')]):_0x1193ca[_0x66bb('0x8a')],'paused':_0x1193ca[_0x66bb('0x8e')]||![],'penalty':_0x45dcc0['TeamVoiceQueue'][_0x66bb('0x83')]},{'transaction':_0x3b3bae});});return Promise[_0x66bb('0x8f')](_0x1a6930);});});});return Promise[_0x66bb('0x8f')](_0x4d8068);});return Promise[_0x66bb('0x8f')](_0x44c782);})[_0x66bb('0x3e')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x42f496}})['then'](function(_0x57e972){if(_0x57e972){var _0x26673d=_[_0x66bb('0x2a')](_0x2a3f69,function(_0x5dbede){db['UserVoicePrefix'][_0x66bb('0x90')]({'UserId':_0x5dbede,'VoicePrefixId':_0x57e972['VoicePrefixId']});});return Promise[_0x66bb('0x8f')](_0x26673d);}});});});return Promise['all'](_0x49c3d8)[_0x66bb('0x3e')](function(){return _0x27aefb[_0x66bb('0x91')](_0x2a3f69,{'transaction':_0x3b3bae})[_0x66bb('0x92')](function(_0x5a6188){return _0x5a6188;});});});}})[_0x66bb('0x3e')](respondWithResult(_0x45dbee,null))[_0x66bb('0x42')](handleError(_0x45dbee,null));};exports[_0x66bb('0x93')]=function(_0x4b1543,_0x2f1237){var _0x36aef2=_[_0x66bb('0x7c')](_0x4b1543[_0x66bb('0x30')][_0x66bb('0x79')])?_0x4b1543[_0x66bb('0x30')][_0x66bb('0x79')]:[_0x4b1543['query'][_0x66bb('0x79')]];var _0x4e22ed=_0x4b1543[_0x66bb('0x44')]['id'];return db[_0x66bb('0x2b')][_0x66bb('0x47')]({'where':{'id':_0x4e22ed}})['then'](handleEntityNotFound(_0x2f1237,null))['then'](function(_0x873043){if(_0x873043){var _0x3f3845=[_0x66bb('0x7d'),_0x66bb('0x94'),_0x66bb('0x7e'),_0x66bb('0x7f'),_0x66bb('0x80'),_0x66bb('0x95'),_0x66bb('0x81')];return db[_0x66bb('0x52')][_0x66bb('0x53')](function(_0x5eefbc){var _0x369434=_[_0x66bb('0x2a')](_0x3f3845,function(_0x1f2ab1){var _0x1b50c9={'attributes':['id',_0x66bb('0x28')]};return _0x873043[_0x66bb('0x4b')+_0x1f2ab1+_0x66bb('0x76')](_0x1b50c9)[_0x66bb('0x3e')](function(_0x2f2bd6){var _0x4c0ba0=_[_0x66bb('0x2a')](_0x2f2bd6,function(_0x4744cc){return _0x4744cc[_0x66bb('0x93')](_0x36aef2,{'transaction':_0x5eefbc})['then'](function(){var _0x4343d6=_['map'](_0x36aef2,function(_0x1bed95){socket[_0x66bb('0x86')](_0x66bb('0x4a')+_0x1f2ab1+_0x66bb('0x96'),{'UserId':Number(_0x1bed95),[_0x1f2ab1+_0x66bb('0x88')]:_0x4744cc['id']});if(_0x1f2ab1!=='Voice'){return;}return db[_0x66bb('0x8b')]['destroy']({'where':{'VoiceQueueId':_0x4744cc['id'],'UserId':_0x1bed95},'transaction':_0x5eefbc});});return Promise['all'](_0x4343d6);});});return Promise[_0x66bb('0x8f')](_0x4c0ba0);});});return Promise['all'](_0x369434)[_0x66bb('0x3e')](function(){return _0x873043['removeAgents'](_0x36aef2,{'transaction':_0x5eefbc});})[_0x66bb('0x3e')](function(){return db[_0x66bb('0x6a')]['findOne']({'where':{'teamId':_0x4e22ed}})[_0x66bb('0x3e')](function(_0x27d372){if(_0x27d372){var _0x578188=_[_0x66bb('0x2a')](_0x36aef2,function(_0x559762){db[_0x66bb('0x97')][_0x66bb('0x51')]({'where':{'UserId':_0x559762,'VoicePrefixId':_0x27d372[_0x66bb('0x6b')]}});});return Promise[_0x66bb('0x8f')](_0x578188);}});});});}})[_0x66bb('0x3e')](respondWithStatusCode(_0x2f1237,null))[_0x66bb('0x42')](handleError(_0x2f1237,null));};exports[_0x66bb('0x98')]=function(_0x4bf9ac,_0x189bb5,_0x1981dd){var _0x454eef={};var _0x548c04={};var _0x5812eb;var _0x51a2a5;return db[_0x66bb('0x2b')][_0x66bb('0x6f')]({'where':{'id':_0x4bf9ac[_0x66bb('0x44')]['id']}})[_0x66bb('0x3e')](handleEntityNotFound(_0x189bb5,null))[_0x66bb('0x3e')](function(_0x2174d0){if(_0x2174d0){_0x5812eb=_0x2174d0;_0x548c04[_0x66bb('0x2f')]=_[_0x66bb('0x31')](db[_0x66bb('0x84')][_0x66bb('0x2c')]);_0x548c04[_0x66bb('0x30')]=_[_0x66bb('0x31')](_0x4bf9ac[_0x66bb('0x30')]);_0x548c04[_0x66bb('0x32')]=_[_0x66bb('0x34')](_0x548c04[_0x66bb('0x2f')],_0x548c04[_0x66bb('0x30')]);_0x454eef[_0x66bb('0x33')]=_['intersection'](_0x548c04[_0x66bb('0x2f')],qs[_0x66bb('0x35')](_0x4bf9ac[_0x66bb('0x30')]['fields']));_0x454eef[_0x66bb('0x33')]=_0x454eef[_0x66bb('0x33')][_0x66bb('0x36')]?_0x454eef['attributes']:_0x548c04['model'];_0x454eef[_0x66bb('0x38')]=qs[_0x66bb('0x39')](_0x4bf9ac[_0x66bb('0x30')][_0x66bb('0x39')]);_0x454eef[_0x66bb('0x3a')]=qs[_0x66bb('0x32')](_[_0x66bb('0x3b')](_0x4bf9ac[_0x66bb('0x30')],_0x548c04[_0x66bb('0x32')]));if(_0x4bf9ac[_0x66bb('0x30')][_0x66bb('0x3c')]){_0x454eef[_0x66bb('0x3a')]=_[_0x66bb('0x45')](_0x454eef[_0x66bb('0x3a')],{'$or':_[_0x66bb('0x2a')](_0x454eef['attributes'],function(_0x4afd2b){var _0x35901f={};_0x35901f[_0x4afd2b]={'$like':'%'+_0x4bf9ac['query'][_0x66bb('0x3c')]+'%'};return _0x35901f;})});}_0x454eef=_[_0x66bb('0x45')]({},_0x454eef,_0x4bf9ac[_0x66bb('0x46')]);return _0x5812eb[_0x66bb('0x98')](_0x454eef);}})[_0x66bb('0x3e')](function(_0x11fc7e){if(_0x11fc7e){_0x51a2a5=_0x11fc7e[_0x66bb('0x36')];if(!_0x4bf9ac['query'][_0x66bb('0x37')](_0x66bb('0x99'))){_0x454eef[_0x66bb('0x22')]=qs[_0x66bb('0x22')](_0x4bf9ac[_0x66bb('0x30')]['limit']);_0x454eef[_0x66bb('0x21')]=qs[_0x66bb('0x21')](_0x4bf9ac[_0x66bb('0x30')][_0x66bb('0x21')]);}return _0x5812eb['getAgents'](_0x454eef);}})[_0x66bb('0x3e')](function(_0x25e61a){if(_0x25e61a){return _0x25e61a?{'count':_0x51a2a5,'rows':_0x25e61a}:null;}})[_0x66bb('0x3e')](respondWithResult(_0x189bb5,null))[_0x66bb('0x42')](handleError(_0x189bb5,null));}; \ No newline at end of file +var _0xd6fb=['../../config/license/util','../../mysqldb','redis','defaults','localhost','register','status','end','json','offset','undefined','limit','count','set','reject','update','sendStatus','stack','name','send','index','map','Team','rawAttributes','fieldName','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','then','catch','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','UserFaxQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserVoicePrefix','UserProfileResource','getQueues','findOne','isValidChannel','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','ids','Voice','Chat','Mail','Fax','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','findAll','online','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','all','VoicePrefixId','addAgents','spread','isArray','Openchannel','removeAgents','Queue:remove','TeamVoicePrefix','getAgents','rimraf','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd6fb,0x1a1));var _0xbd6f=function(_0x2c95ff,_0x2ec2f9){_0x2c95ff=_0x2c95ff-0x0;var _0x3a1dc7=_0xd6fb[_0x2c95ff];return _0x3a1dc7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd6f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbd6f('0x1'));var BPromise=require(_0xbd6f('0x2'));var Mustache=require(_0xbd6f('0x3'));var util=require(_0xbd6f('0x4'));var path=require(_0xbd6f('0x5'));var sox=require('sox');var csv=require(_0xbd6f('0x6'));var ejs=require(_0xbd6f('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbd6f('0x8'));var squel=require(_0xbd6f('0x9'));var crypto=require(_0xbd6f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xbd6f('0xb'));var toCsv=require(_0xbd6f('0x6'));var querystring=require(_0xbd6f('0xc'));var Papa=require('papaparse');var Redis=require(_0xbd6f('0xd'));var authService=require(_0xbd6f('0xe'));var qs=require(_0xbd6f('0xf'));var as=require(_0xbd6f('0x10'));var hardwareService=require(_0xbd6f('0x11'));var logger=require(_0xbd6f('0x12'))('api');var utils=require(_0xbd6f('0x13'));var config=require(_0xbd6f('0x14'));var licenseUtil=require(_0xbd6f('0x15'));var db=require(_0xbd6f('0x16'))['db'];config[_0xbd6f('0x17')]=_[_0xbd6f('0x18')](config[_0xbd6f('0x17')],{'host':_0xbd6f('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbd6f('0x17')]));require('./team.socket')[_0xbd6f('0x1a')](socket);function respondWithStatusCode(_0x1f30d4,_0xf44944){_0xf44944=_0xf44944||0xcc;return function(_0x5d2dbb){if(_0x5d2dbb){return _0x1f30d4['sendStatus'](_0xf44944);}return _0x1f30d4[_0xbd6f('0x1b')](_0xf44944)[_0xbd6f('0x1c')]();};}function respondWithResult(_0x6a40e0,_0x22ae55){_0x22ae55=_0x22ae55||0xc8;return function(_0x33712a){if(_0x33712a){return _0x6a40e0[_0xbd6f('0x1b')](_0x22ae55)[_0xbd6f('0x1d')](_0x33712a);}};}function respondWithFilteredResult(_0x5a9fef,_0x3d6dad){return function(_0x5c3095){if(_0x5c3095){var _0x48cd5b=typeof _0x3d6dad[_0xbd6f('0x1e')]===_0xbd6f('0x1f')&&typeof _0x3d6dad[_0xbd6f('0x20')]===_0xbd6f('0x1f');var _0x52a8d5=_0x5c3095[_0xbd6f('0x21')];var _0x2d1103=_0x48cd5b?0x0:_0x3d6dad[_0xbd6f('0x1e')];var _0x2ec97d=_0x48cd5b?_0x5c3095[_0xbd6f('0x21')]:_0x3d6dad['offset']+_0x3d6dad[_0xbd6f('0x20')];var _0x3b7684;if(_0x2ec97d>=_0x52a8d5){_0x2ec97d=_0x52a8d5;_0x3b7684=0xc8;}else{_0x3b7684=0xce;}_0x5a9fef['status'](_0x3b7684);return _0x5a9fef[_0xbd6f('0x22')]('Content-Range',_0x2d1103+'-'+_0x2ec97d+'/'+_0x52a8d5)[_0xbd6f('0x1d')](_0x5c3095);}return null;};}function patchUpdates(_0xb7b8e8){return function(_0xd706be){try{jsonpatch['apply'](_0xd706be,_0xb7b8e8,!![]);}catch(_0x4bd0e3){return BPromise[_0xbd6f('0x23')](_0x4bd0e3);}return _0xd706be['save']();};}function saveUpdates(_0x4ec07f,_0x428f4c){return function(_0x10d077){if(_0x10d077){return _0x10d077[_0xbd6f('0x24')](_0x4ec07f)['then'](function(_0x3714cf){return _0x3714cf;});}return null;};}function handleEntityNotFound(_0x294dab,_0xc09a4f){return function(_0x5199e1){if(!_0x5199e1){_0x294dab[_0xbd6f('0x25')](0x194);}return _0x5199e1;};}function handleError(_0x5024fa,_0x4539dd){_0x4539dd=_0x4539dd||0x1f4;return function(_0x113b7e){logger['error'](_0x113b7e[_0xbd6f('0x26')]);if(_0x113b7e[_0xbd6f('0x27')]){delete _0x113b7e[_0xbd6f('0x27')];}_0x5024fa[_0xbd6f('0x1b')](_0x4539dd)[_0xbd6f('0x28')](_0x113b7e);};}exports[_0xbd6f('0x29')]=function(_0x24337f,_0x29c1a5){var _0x2ab19e={},_0x407d76={},_0x43525a={'count':0x0,'rows':[]};var _0x42d0f1=_[_0xbd6f('0x2a')](db[_0xbd6f('0x2b')][_0xbd6f('0x2c')],function(_0x5b288c){return{'name':_0x5b288c[_0xbd6f('0x2d')],'type':_0x5b288c['type'][_0xbd6f('0x2e')]};});_0x407d76['model']=_[_0xbd6f('0x2a')](_0x42d0f1,'name');_0x407d76[_0xbd6f('0x2f')]=_[_0xbd6f('0x30')](_0x24337f[_0xbd6f('0x2f')]);_0x407d76['filters']=_['intersection'](_0x407d76[_0xbd6f('0x31')],_0x407d76[_0xbd6f('0x2f')]);_0x2ab19e[_0xbd6f('0x32')]=_[_0xbd6f('0x33')](_0x407d76[_0xbd6f('0x31')],qs[_0xbd6f('0x34')](_0x24337f['query']['fields']));_0x2ab19e['attributes']=_0x2ab19e[_0xbd6f('0x32')][_0xbd6f('0x35')]?_0x2ab19e[_0xbd6f('0x32')]:_0x407d76['model'];if(!_0x24337f[_0xbd6f('0x2f')][_0xbd6f('0x36')]('nolimit')){_0x2ab19e['limit']=qs[_0xbd6f('0x20')](_0x24337f['query']['limit']);_0x2ab19e['offset']=qs[_0xbd6f('0x1e')](_0x24337f[_0xbd6f('0x2f')][_0xbd6f('0x1e')]);}_0x2ab19e[_0xbd6f('0x37')]=qs[_0xbd6f('0x38')](_0x24337f['query']['sort']);_0x2ab19e[_0xbd6f('0x39')]=qs[_0xbd6f('0x3a')](_[_0xbd6f('0x3b')](_0x24337f[_0xbd6f('0x2f')],_0x407d76[_0xbd6f('0x3a')]),_0x42d0f1);if(_0x24337f['query'][_0xbd6f('0x3c')]){_0x2ab19e['where']=_[_0xbd6f('0x3d')](_0x2ab19e[_0xbd6f('0x39')],{'$or':_[_0xbd6f('0x2a')](_0x42d0f1,function(_0x3109d2){if(_0x3109d2['type']!==_0xbd6f('0x3e')){var _0x495cd9={};_0x495cd9[_0x3109d2['name']]={'$like':'%'+_0x24337f[_0xbd6f('0x2f')]['filter']+'%'};return _0x495cd9;}})});}_0x2ab19e=_['merge']({},_0x2ab19e,_0x24337f['options']);var _0x2fa9fe={'where':_0x2ab19e[_0xbd6f('0x39')]};return db[_0xbd6f('0x2b')][_0xbd6f('0x21')](_0x2fa9fe)['then'](function(_0x25adb2){_0x43525a[_0xbd6f('0x21')]=_0x25adb2;if(_0x24337f['query'][_0xbd6f('0x3f')]){_0x2ab19e[_0xbd6f('0x40')]=[{'all':!![]}];}return db[_0xbd6f('0x2b')]['findAll'](_0x2ab19e);})['then'](function(_0x3b6f0e){_0x43525a[_0xbd6f('0x41')]=_0x3b6f0e;return _0x43525a;})[_0xbd6f('0x42')](respondWithFilteredResult(_0x29c1a5,_0x2ab19e))[_0xbd6f('0x43')](handleError(_0x29c1a5,null));};exports[_0xbd6f('0x44')]=function(_0x539a8d,_0x51bea4){var _0x530822={'raw':![],'where':{'id':_0x539a8d['params']['id']}},_0x5c3ec1={};_0x5c3ec1['model']=_['keys'](db['Team'][_0xbd6f('0x2c')]);_0x5c3ec1['query']=_['keys'](_0x539a8d[_0xbd6f('0x2f')]);_0x5c3ec1[_0xbd6f('0x3a')]=_[_0xbd6f('0x33')](_0x5c3ec1[_0xbd6f('0x31')],_0x5c3ec1['query']);_0x530822[_0xbd6f('0x32')]=_[_0xbd6f('0x33')](_0x5c3ec1['model'],qs['fields'](_0x539a8d['query'][_0xbd6f('0x34')]));_0x530822[_0xbd6f('0x32')]=_0x530822[_0xbd6f('0x32')]['length']?_0x530822[_0xbd6f('0x32')]:_0x5c3ec1[_0xbd6f('0x31')];if(_0x539a8d[_0xbd6f('0x2f')]['includeAll']){_0x530822[_0xbd6f('0x40')]=[{'all':!![]}];}_0x530822=_[_0xbd6f('0x3d')]({},_0x530822,_0x539a8d[_0xbd6f('0x45')]);return db[_0xbd6f('0x2b')][_0xbd6f('0x46')](_0x530822)[_0xbd6f('0x42')](handleEntityNotFound(_0x51bea4,null))[_0xbd6f('0x42')](respondWithResult(_0x51bea4,null))[_0xbd6f('0x43')](handleError(_0x51bea4,null));};exports[_0xbd6f('0x47')]=function(_0x5a8ced,_0x3ba127){return db[_0xbd6f('0x2b')][_0xbd6f('0x47')](_0x5a8ced[_0xbd6f('0x48')],{})[_0xbd6f('0x42')](function(_0x236b10){var _0x138427=_0x5a8ced[_0xbd6f('0x49')]['get']({'plain':!![]});if(!_0x138427)throw new Error(_0xbd6f('0x4a'));if(_0x138427[_0xbd6f('0x4b')]===_0xbd6f('0x49')){var _0xc11a40=_0x236b10[_0xbd6f('0x4c')]({'plain':!![]});var _0x49ef12=_0xbd6f('0x4d');return db[_0xbd6f('0x4e')][_0xbd6f('0x46')]({'where':{'name':_0x49ef12,'userProfileId':_0x138427[_0xbd6f('0x4f')]},'raw':!![]})['then'](function(_0x4508a4){if(_0x4508a4&&_0x4508a4[_0xbd6f('0x50')]===0x0){return db['UserProfileResource'][_0xbd6f('0x47')]({'name':_0xc11a40[_0xbd6f('0x27')],'resourceId':_0xc11a40['id'],'type':_0x4508a4[_0xbd6f('0x27')],'sectionId':_0x4508a4['id']},{})[_0xbd6f('0x42')](function(){return _0x236b10;});}else{return _0x236b10;}})[_0xbd6f('0x43')](function(_0x2668fd){logger[_0xbd6f('0x51')](_0xbd6f('0x52'),_0x2668fd);throw _0x2668fd;});}return _0x236b10;})[_0xbd6f('0x42')](respondWithResult(_0x3ba127,0xc9))[_0xbd6f('0x43')](handleError(_0x3ba127,null));};exports[_0xbd6f('0x24')]=function(_0x4e22ab,_0x1932ae){if(_0x4e22ab[_0xbd6f('0x48')]['id']){delete _0x4e22ab[_0xbd6f('0x48')]['id'];}return db[_0xbd6f('0x2b')]['find']({'where':{'id':_0x4e22ab['params']['id']}})[_0xbd6f('0x42')](handleEntityNotFound(_0x1932ae,null))[_0xbd6f('0x42')](saveUpdates(_0x4e22ab['body'],null))[_0xbd6f('0x42')](respondWithResult(_0x1932ae,null))[_0xbd6f('0x43')](handleError(_0x1932ae,null));};exports[_0xbd6f('0x53')]=function(_0x1ec562,_0x139249){var _0x2715c7=_0x1ec562[_0xbd6f('0x54')]['id'];var _0x3f766d=[];return db['sequelize'][_0xbd6f('0x55')](function(_0xf29f95){var _0x1d1e24=_0xbd6f('0x56')+_0x2715c7;return db[_0xbd6f('0x57')][_0xbd6f('0x2f')](_0x1d1e24,{'type':db[_0xbd6f('0x58')][_0xbd6f('0x59')][_0xbd6f('0x5a')],'raw':!![],'transaction':_0xf29f95})[_0xbd6f('0x42')](function(_0x109b94){_0x3f766d=_[_0xbd6f('0x2a')](_0x109b94,function(_0x4f814f){return Number(_0x4f814f[_0xbd6f('0x5b')]);});})[_0xbd6f('0x42')](function(){var _0x29e7e0=_0xbd6f('0x5c')+_0x2715c7;return db[_0xbd6f('0x57')]['query'](_0x29e7e0,{'type':db[_0xbd6f('0x58')][_0xbd6f('0x59')][_0xbd6f('0x5a')],'raw':!![],'transaction':_0xf29f95});})[_0xbd6f('0x42')](function(_0x5918e0){var _0x4bf653=_[_0xbd6f('0x2a')](_0x5918e0,function(_0x519acf){return Number(_0x519acf['VoiceQueueId']);});return db['UserVoiceQueue'][_0xbd6f('0x53')]({'where':{'UserId':{'$in':_0x3f766d},'VoiceQueueId':{'$in':_0x4bf653}},'transaction':_0xf29f95});})[_0xbd6f('0x42')](function(){var _0x5bf5ac=_0xbd6f('0x5d')+_0x2715c7;return db[_0xbd6f('0x57')][_0xbd6f('0x2f')](_0x5bf5ac,{'type':db[_0xbd6f('0x58')][_0xbd6f('0x59')][_0xbd6f('0x5a')],'raw':!![],'transaction':_0xf29f95});})[_0xbd6f('0x42')](function(_0x166d9e){var _0x1cc15a=_[_0xbd6f('0x2a')](_0x166d9e,function(_0x303a7e){return Number(_0x303a7e[_0xbd6f('0x5e')]);});return db[_0xbd6f('0x5f')][_0xbd6f('0x53')]({'where':{'UserId':{'$in':_0x3f766d},'MailQueueId':{'$in':_0x1cc15a}},'transaction':_0xf29f95});})[_0xbd6f('0x42')](function(){var _0x5ab0a2='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2715c7;return db['sequelize'][_0xbd6f('0x2f')](_0x5ab0a2,{'type':db[_0xbd6f('0x58')][_0xbd6f('0x59')][_0xbd6f('0x5a')],'raw':!![],'transaction':_0xf29f95});})['then'](function(_0x275352){var _0x151277=_[_0xbd6f('0x2a')](_0x275352,function(_0x57830f){return Number(_0x57830f['SmsQueueId']);});return db[_0xbd6f('0x60')]['destroy']({'where':{'UserId':{'$in':_0x3f766d},'SmsQueueId':{'$in':_0x151277}},'transaction':_0xf29f95});})[_0xbd6f('0x42')](function(){var _0xf7fb48=_0xbd6f('0x61')+_0x2715c7;return db[_0xbd6f('0x57')][_0xbd6f('0x2f')](_0xf7fb48,{'type':db[_0xbd6f('0x58')][_0xbd6f('0x59')]['SELECT'],'raw':!![],'transaction':_0xf29f95});})[_0xbd6f('0x42')](function(_0x25752b){var _0xaf8862=_[_0xbd6f('0x2a')](_0x25752b,function(_0x1d6ba0){return Number(_0x1d6ba0[_0xbd6f('0x62')]);});return db[_0xbd6f('0x63')]['destroy']({'where':{'UserId':{'$in':_0x3f766d},'ChatQueueId':{'$in':_0xaf8862}},'transaction':_0xf29f95});})[_0xbd6f('0x42')](function(){var _0x38806b='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2715c7;return db[_0xbd6f('0x57')][_0xbd6f('0x2f')](_0x38806b,{'type':db[_0xbd6f('0x58')]['QueryTypes'][_0xbd6f('0x5a')],'raw':!![],'transaction':_0xf29f95});})[_0xbd6f('0x42')](function(_0x33bdf3){var _0x36531f=_[_0xbd6f('0x2a')](_0x33bdf3,function(_0xbb654e){return Number(_0xbb654e['FaxQueueId']);});return db[_0xbd6f('0x64')][_0xbd6f('0x53')]({'where':{'UserId':{'$in':_0x3f766d},'FaxQueueId':{'$in':_0x36531f}},'transaction':_0xf29f95});})[_0xbd6f('0x42')](function(){var _0x1c48d2='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2715c7;return db[_0xbd6f('0x57')]['query'](_0x1c48d2,{'type':db[_0xbd6f('0x58')][_0xbd6f('0x59')][_0xbd6f('0x5a')],'raw':!![],'transaction':_0xf29f95});})['then'](function(_0x7f57b2){var _0x55ef9b=_['map'](_0x7f57b2,function(_0x2c2b63){return Number(_0x2c2b63['OpenchannelQueueId']);});return db['UserOpenchannelQueue']['destroy']({'where':{'UserId':{'$in':_0x3f766d},'OpenchannelQueueId':{'$in':_0x55ef9b}},'transaction':_0xf29f95});})[_0xbd6f('0x42')](function(){var _0x5d5f65=_0xbd6f('0x65')+_0x2715c7;return db['sequelize'][_0xbd6f('0x2f')](_0x5d5f65,{'type':db[_0xbd6f('0x58')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0xf29f95});})[_0xbd6f('0x42')](function(_0x3b0b1f){var _0x44f855=_[_0xbd6f('0x2a')](_0x3b0b1f,function(_0x5070d9){return Number(_0x5070d9[_0xbd6f('0x66')]);});return db['UserWhatsappQueue'][_0xbd6f('0x53')]({'where':{'UserId':{'$in':_0x3f766d},'WhatsappQueueId':{'$in':_0x44f855}},'transaction':_0xf29f95});})[_0xbd6f('0x42')](function(){return db['TeamVoicePrefix'][_0xbd6f('0x46')]({'where':{'TeamId':_0x2715c7}});})[_0xbd6f('0x42')](function(_0x5adb4d){if(_0x5adb4d===null){return;}return db[_0xbd6f('0x67')][_0xbd6f('0x53')]({'where':{'UserId':{'$in':_0x3f766d},'VoicePrefixId':_0x5adb4d['VoicePrefixId']},'transaction':_0xf29f95});})[_0xbd6f('0x42')](function(){return db[_0xbd6f('0x2b')][_0xbd6f('0x53')]({'where':{'id':_0x2715c7},'cascade':!![],'transaction':_0xf29f95});})[_0xbd6f('0x42')](function(_0x112a20){if(_0x112a20===0x0){_0x139249[_0xbd6f('0x25')](0x194);}else{return db[_0xbd6f('0x68')]['destroy']({'where':{'type':_0xbd6f('0x4d'),'resourceId':_0x2715c7},'cascade':!![],'transaction':_0xf29f95})[_0xbd6f('0x42')](function(){_0x139249[_0xbd6f('0x1b')](0xcc)[_0xbd6f('0x1c')]();});}})['catch'](function(_0x5b5588){_0x139249[_0xbd6f('0x1b')](0x1f4)[_0xbd6f('0x28')](_0x5b5588);});});};exports[_0xbd6f('0x69')]=function(_0x10e572,_0x9916e5,_0x17bbf7){return db[_0xbd6f('0x2b')][_0xbd6f('0x6a')]({'where':{'id':_0x10e572[_0xbd6f('0x54')]['id']}})[_0xbd6f('0x42')](handleEntityNotFound(_0x9916e5,null))['then'](function(_0x3ad48e){if(!_0x10e572[_0xbd6f('0x2f')]['channel']||!utils[_0xbd6f('0x6b')](_0x10e572['query'][_0xbd6f('0x6c')])){throw new db[(_0xbd6f('0x58'))][(_0xbd6f('0x6d'))](_0xbd6f('0x6e'));}var _0x3bfd6c={};var _0x3bc220={};_0x3bc220[_0xbd6f('0x31')]=_[_0xbd6f('0x30')](db[_[_0xbd6f('0x6f')](_0x10e572[_0xbd6f('0x2f')][_0xbd6f('0x6c')][_0xbd6f('0x70')]())+_0xbd6f('0x71')][_0xbd6f('0x2c')]);_0x3bc220[_0xbd6f('0x2f')]=_[_0xbd6f('0x30')](_0x10e572[_0xbd6f('0x2f')]);_0x3bc220[_0xbd6f('0x3a')]=_[_0xbd6f('0x33')](_0x3bc220[_0xbd6f('0x31')],_0x3bc220[_0xbd6f('0x2f')]);_0x3bfd6c[_0xbd6f('0x32')]=_[_0xbd6f('0x33')](_0x3bc220[_0xbd6f('0x31')],qs[_0xbd6f('0x34')](_0x10e572['query'][_0xbd6f('0x34')]));_0x3bfd6c[_0xbd6f('0x32')]=_0x3bfd6c['attributes']['length']?_0x3bfd6c[_0xbd6f('0x32')]:_0x3bc220[_0xbd6f('0x31')];_0x3bfd6c[_0xbd6f('0x20')]=qs[_0xbd6f('0x20')](_0x10e572['query']['limit']);_0x3bfd6c[_0xbd6f('0x1e')]=qs[_0xbd6f('0x1e')](_0x10e572[_0xbd6f('0x2f')]['offset']);_0x3bfd6c[_0xbd6f('0x37')]=qs[_0xbd6f('0x38')](_0x10e572[_0xbd6f('0x2f')]['sort']);_0x3bfd6c[_0xbd6f('0x39')]=qs['filters'](_[_0xbd6f('0x3b')](_0x10e572[_0xbd6f('0x2f')],_0x3bc220[_0xbd6f('0x3a')]));_0x3bfd6c=_['merge']({},_0x3bfd6c,_0x10e572['options']);return _0x3ad48e['get'+_['capitalize'](_0x10e572[_0xbd6f('0x2f')][_0xbd6f('0x6c')][_0xbd6f('0x70')]())+_0xbd6f('0x72')](_0x3bfd6c);})[_0xbd6f('0x42')](respondWithResult(_0x9916e5,null))[_0xbd6f('0x43')](handleError(_0x9916e5,null));};exports['addQueues']=function(_0x5ed771,_0x516e6a,_0x5dbf0d){return db[_0xbd6f('0x2b')]['findOne']({'where':{'id':_0x5ed771[_0xbd6f('0x54')]['id']}})['then'](function(_0xa8e4ce){if(_0xa8e4ce){if(!_0x5ed771[_0xbd6f('0x48')]['channel']||!utils['isValidChannel'](_0x5ed771[_0xbd6f('0x48')][_0xbd6f('0x6c')])){throw new db[(_0xbd6f('0x58'))][(_0xbd6f('0x6d'))](_0xbd6f('0x6e'));}return _0xa8e4ce['add'+_[_0xbd6f('0x6f')](_0x5ed771[_0xbd6f('0x48')][_0xbd6f('0x6c')][_0xbd6f('0x70')]())+_0xbd6f('0x72')](_0x5ed771['body']['ids']);}return null;})['then'](handleEntityNotFound(_0x516e6a,null))[_0xbd6f('0x42')](respondWithStatusCode(_0x516e6a,null))['catch'](handleError(_0x516e6a,null));};exports['removeQueues']=function(_0x5e32e2,_0x5e7799,_0x4368ac){return db[_0xbd6f('0x2b')][_0xbd6f('0x6a')]({'where':{'id':_0x5e32e2[_0xbd6f('0x54')]['id']}})[_0xbd6f('0x42')](function(_0xa1d834){if(_0xa1d834){if(!_0x5e32e2[_0xbd6f('0x2f')]['channel']||!utils[_0xbd6f('0x6b')](_0x5e32e2[_0xbd6f('0x2f')]['channel'])){throw new db[(_0xbd6f('0x58'))]['ValidationError'](_0xbd6f('0x6e'));}return _0xa1d834['remove'+_['capitalize'](_0x5e32e2[_0xbd6f('0x2f')]['channel'][_0xbd6f('0x70')]())+_0xbd6f('0x72')](_0x5e32e2['query'][_0xbd6f('0x73')]);}return null;})[_0xbd6f('0x42')](handleEntityNotFound(_0x5e7799,null))['then'](respondWithStatusCode(_0x5e7799,null))[_0xbd6f('0x43')](handleError(_0x5e7799,null));};exports['addAgents']=function(_0x4cc2d7,_0x2255a6){var _0x412c92=_['isArray'](_0x4cc2d7[_0xbd6f('0x48')][_0xbd6f('0x73')])?_0x4cc2d7[_0xbd6f('0x48')][_0xbd6f('0x73')]:[_0x4cc2d7[_0xbd6f('0x48')][_0xbd6f('0x73')]];var _0x819a57=_0x4cc2d7[_0xbd6f('0x54')]['id'];return db[_0xbd6f('0x2b')][_0xbd6f('0x46')]({'where':{'id':_0x819a57}})[_0xbd6f('0x42')](handleEntityNotFound(_0x2255a6,null))[_0xbd6f('0x42')](function(_0x4cb1da){if(_0x4cb1da){var _0x2b4f3e=[_0xbd6f('0x74'),_0xbd6f('0x75'),_0xbd6f('0x76'),'Sms',_0xbd6f('0x77'),'Openchannel',_0xbd6f('0x78')];return db[_0xbd6f('0x57')]['transaction'](function(_0x19b10e){var _0xf1525d=_['map'](_0x2b4f3e,function(_0xdc4466){var _0xc598af={'attributes':['id',_0xbd6f('0x27')]};if(_0xdc4466===_0xbd6f('0x74')){_0xc598af[_0xbd6f('0x79')]={'attributes':[_0xbd6f('0x7a')]};}return _0x4cb1da[_0xbd6f('0x4c')+_0xdc4466+_0xbd6f('0x72')](_0xc598af)[_0xbd6f('0x42')](function(_0x4784d6){var _0xbe2794=_[_0xbd6f('0x2a')](_0x4784d6,function(_0x301dac){var _0x5468cb=_[_0xbd6f('0x2a')](_0x412c92,function(_0x50f9d7){var _0x1e423a={'where':{'UserId':_0x50f9d7,[_0xdc4466+_0xbd6f('0x7b')]:_0x301dac['id']},'transaction':_0x19b10e};if(_0xdc4466===_0xbd6f('0x74')){_0x1e423a[_0xbd6f('0x18')]={'penalty':_0x301dac[_0xbd6f('0x7c')][_0xbd6f('0x7a')]};}return db[_0xbd6f('0x7d')+_0xdc4466+_0xbd6f('0x71')][_0xbd6f('0x7e')](_0x1e423a)['then'](function(){socket['emit'](_0xbd6f('0x49')+_0xdc4466+'Queue:save',{'UserId':_0x50f9d7,[_0xdc4466+_0xbd6f('0x7b')]:_0x301dac['id']});if(_0xdc4466!==_0xbd6f('0x74')){return;}return db[_0xbd6f('0x7d')][_0xbd6f('0x7f')]({'where':{'id':_0x412c92,'online':0x1},'attributes':['id','name',_0xbd6f('0x80'),'voicePause',_0xbd6f('0x81')],'raw':!![]})[_0xbd6f('0x42')](function(_0x4a4aea){var _0x6fbd2e=_[_0xbd6f('0x2a')](_0x4a4aea,function(_0x16fa26){return db[_0xbd6f('0x82')][_0xbd6f('0x83')]({'membername':_0x16fa26['name'],'UserId':_0x16fa26['id'],'queue_name':_0x301dac[_0xbd6f('0x27')],'VoiceQueueId':_0x301dac['id'],'interface':_[_0xbd6f('0x84')](_0x16fa26[_0xbd6f('0x81')])?util[_0xbd6f('0x85')](_0xbd6f('0x86'),_0x16fa26['name']):_0x16fa26['interface'],'paused':_0x16fa26[_0xbd6f('0x87')]||![],'penalty':_0x301dac[_0xbd6f('0x7c')][_0xbd6f('0x7a')]},{'transaction':_0x19b10e});});return Promise[_0xbd6f('0x88')](_0x6fbd2e);});});});return Promise[_0xbd6f('0x88')](_0x5468cb);});return Promise[_0xbd6f('0x88')](_0xbe2794);})[_0xbd6f('0x42')](function(){return db['TeamVoicePrefix'][_0xbd6f('0x6a')]({'where':{'teamId':_0x819a57}})[_0xbd6f('0x42')](function(_0x446a53){if(_0x446a53){var _0x20118b=_['map'](_0x412c92,function(_0x41f094){db[_0xbd6f('0x67')][_0xbd6f('0x83')]({'UserId':_0x41f094,'VoicePrefixId':_0x446a53[_0xbd6f('0x89')]});});return Promise[_0xbd6f('0x88')](_0x20118b);}});});});return Promise[_0xbd6f('0x88')](_0xf1525d)['then'](function(){return _0x4cb1da[_0xbd6f('0x8a')](_0x412c92,{'transaction':_0x19b10e})[_0xbd6f('0x8b')](function(_0xe50f24){return _0xe50f24;});});});}})[_0xbd6f('0x42')](respondWithResult(_0x2255a6,null))['catch'](handleError(_0x2255a6,null));};exports['removeAgents']=function(_0x4b681a,_0x481844){var _0x26965f=_[_0xbd6f('0x8c')](_0x4b681a[_0xbd6f('0x2f')][_0xbd6f('0x73')])?_0x4b681a[_0xbd6f('0x2f')]['ids']:[_0x4b681a['query'][_0xbd6f('0x73')]];var _0x3c132c=_0x4b681a[_0xbd6f('0x54')]['id'];return db['Team'][_0xbd6f('0x46')]({'where':{'id':_0x3c132c}})[_0xbd6f('0x42')](handleEntityNotFound(_0x481844,null))[_0xbd6f('0x42')](function(_0x1c74be){if(_0x1c74be){var _0x438c74=['Voice',_0xbd6f('0x75'),'Mail','Sms',_0xbd6f('0x77'),_0xbd6f('0x8d'),_0xbd6f('0x78')];return db[_0xbd6f('0x57')]['transaction'](function(_0x1c5019){var _0x112898=_[_0xbd6f('0x2a')](_0x438c74,function(_0x2e16a2){var _0x1aaebc={'attributes':['id',_0xbd6f('0x27')]};return _0x1c74be['get'+_0x2e16a2+_0xbd6f('0x72')](_0x1aaebc)[_0xbd6f('0x42')](function(_0x359804){var _0x105bf4=_[_0xbd6f('0x2a')](_0x359804,function(_0x3f1d83){return _0x3f1d83[_0xbd6f('0x8e')](_0x26965f,{'transaction':_0x1c5019})[_0xbd6f('0x42')](function(){var _0x3f2cfb=_[_0xbd6f('0x2a')](_0x26965f,function(_0x266002){socket['emit'](_0xbd6f('0x49')+_0x2e16a2+_0xbd6f('0x8f'),{'UserId':Number(_0x266002),[_0x2e16a2+_0xbd6f('0x7b')]:_0x3f1d83['id']});if(_0x2e16a2!==_0xbd6f('0x74')){return;}return db[_0xbd6f('0x82')]['destroy']({'where':{'VoiceQueueId':_0x3f1d83['id'],'UserId':_0x266002},'transaction':_0x1c5019});});return Promise[_0xbd6f('0x88')](_0x3f2cfb);});});return Promise[_0xbd6f('0x88')](_0x105bf4);});});return Promise[_0xbd6f('0x88')](_0x112898)[_0xbd6f('0x42')](function(){return _0x1c74be[_0xbd6f('0x8e')](_0x26965f,{'transaction':_0x1c5019});})['then'](function(){return db[_0xbd6f('0x90')]['findOne']({'where':{'teamId':_0x3c132c}})[_0xbd6f('0x42')](function(_0x11ef7b){if(_0x11ef7b){var _0x5016c7=_[_0xbd6f('0x2a')](_0x26965f,function(_0x696767){db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x696767,'VoicePrefixId':_0x11ef7b[_0xbd6f('0x89')]}});});return Promise[_0xbd6f('0x88')](_0x5016c7);}});});});}})['then'](respondWithStatusCode(_0x481844,null))[_0xbd6f('0x43')](handleError(_0x481844,null));};exports[_0xbd6f('0x91')]=function(_0x1a7489,_0x15c6d1,_0x4c8fc9){var _0x211122={};var _0xeac48a={};var _0x58db90;var _0x190ba8;return db[_0xbd6f('0x2b')][_0xbd6f('0x6a')]({'where':{'id':_0x1a7489[_0xbd6f('0x54')]['id']}})['then'](handleEntityNotFound(_0x15c6d1,null))[_0xbd6f('0x42')](function(_0x31bd1b){if(_0x31bd1b){_0x58db90=_0x31bd1b;_0xeac48a['model']=_['keys'](db[_0xbd6f('0x7d')]['rawAttributes']);_0xeac48a[_0xbd6f('0x2f')]=_['keys'](_0x1a7489['query']);_0xeac48a['filters']=_[_0xbd6f('0x33')](_0xeac48a['model'],_0xeac48a['query']);_0x211122[_0xbd6f('0x32')]=_[_0xbd6f('0x33')](_0xeac48a[_0xbd6f('0x31')],qs[_0xbd6f('0x34')](_0x1a7489['query']['fields']));_0x211122[_0xbd6f('0x32')]=_0x211122['attributes'][_0xbd6f('0x35')]?_0x211122[_0xbd6f('0x32')]:_0xeac48a[_0xbd6f('0x31')];_0x211122['order']=qs[_0xbd6f('0x38')](_0x1a7489['query'][_0xbd6f('0x38')]);_0x211122[_0xbd6f('0x39')]=qs['filters'](_[_0xbd6f('0x3b')](_0x1a7489[_0xbd6f('0x2f')],_0xeac48a[_0xbd6f('0x3a')]));if(_0x1a7489[_0xbd6f('0x2f')][_0xbd6f('0x3c')]){_0x211122[_0xbd6f('0x39')]=_[_0xbd6f('0x3d')](_0x211122['where'],{'$or':_[_0xbd6f('0x2a')](_0x211122[_0xbd6f('0x32')],function(_0x3c4f34){var _0x57ddd2={};_0x57ddd2[_0x3c4f34]={'$like':'%'+_0x1a7489[_0xbd6f('0x2f')]['filter']+'%'};return _0x57ddd2;})});}_0x211122=_['merge']({},_0x211122,_0x1a7489[_0xbd6f('0x45')]);return _0x58db90[_0xbd6f('0x91')](_0x211122);}})['then'](function(_0x582bca){if(_0x582bca){_0x190ba8=_0x582bca['length'];if(!_0x1a7489[_0xbd6f('0x2f')][_0xbd6f('0x36')]('nolimit')){_0x211122[_0xbd6f('0x20')]=qs[_0xbd6f('0x20')](_0x1a7489['query'][_0xbd6f('0x20')]);_0x211122[_0xbd6f('0x1e')]=qs[_0xbd6f('0x1e')](_0x1a7489[_0xbd6f('0x2f')][_0xbd6f('0x1e')]);}return _0x58db90[_0xbd6f('0x91')](_0x211122);}})[_0xbd6f('0x42')](function(_0x1d017b){if(_0x1d017b){return _0x1d017b?{'count':_0x190ba8,'rows':_0x1d017b}:null;}})[_0xbd6f('0x42')](respondWithResult(_0x15c6d1,null))['catch'](handleError(_0x15c6d1,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 29c081d..f1e8c20 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 _0xa7fd=['save','remove','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0xa7fd,0x147));var _0xda7f=function(_0x2999bb,_0x564537){_0x2999bb=_0x2999bb-0x0;var _0x4e3e96=_0xa7fd[_0x2999bb];return _0x4e3e96;};'use strict';var EventEmitter=require('events');var Team=require(_0xda7f('0x0'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xda7f('0x1')](0x0);var events={'afterCreate':_0xda7f('0x2'),'afterUpdate':'update','afterDestroy':_0xda7f('0x3')};function emitEvent(_0x448cee){return function(_0x1bb45c,_0x487a11,_0x1bf03c){TeamEvents[_0xda7f('0x4')](_0x448cee+':'+_0x1bb45c['id'],_0x1bb45c);TeamEvents[_0xda7f('0x4')](_0x448cee,_0x1bb45c);_0x1bf03c(null);};}for(var e in events){if(events[_0xda7f('0x5')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xda7f('0x6')]=TeamEvents; \ No newline at end of file +var _0x5eb0=['hook','exports','events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit'];(function(_0x141f88,_0x2db303){var _0x436d8a=function(_0x487bc0){while(--_0x487bc0){_0x141f88['push'](_0x141f88['shift']());}};_0x436d8a(++_0x2db303);}(_0x5eb0,0x66));var _0x05eb=function(_0x4ac0c4,_0x150917){_0x4ac0c4=_0x4ac0c4-0x0;var _0xb23ee6=_0x5eb0[_0x4ac0c4];return _0xb23ee6;};'use strict';var EventEmitter=require(_0x05eb('0x0'));var Team=require(_0x05eb('0x1'))['db'][_0x05eb('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x05eb('0x3')](0x0);var events={'afterCreate':_0x05eb('0x4'),'afterUpdate':_0x05eb('0x5'),'afterDestroy':_0x05eb('0x6')};function emitEvent(_0x1fa8c5){return function(_0x5c8161,_0x3ffde4,_0x4e7757){TeamEvents['emit'](_0x1fa8c5+':'+_0x5c8161['id'],_0x5c8161);TeamEvents[_0x05eb('0x7')](_0x1fa8c5,_0x5c8161);_0x4e7757(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x05eb('0x8')](e,emitEvent(event));}}module[_0x05eb('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 19b95b5..45523de 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 _0x4bf7=['catch','exports','define','Team','teams','Chat','Mail','Openchannel','Sms','Voice','resolve','get','Queues','then','map'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x4bf7,0x191));var _0x74bf=function(_0x371129,_0x27a064){_0x371129=_0x371129-0x0;var _0x322915=_0x4bf7[_0x371129];return _0x322915;};'use strict';var _=require('lodash');var attributes=require('./team.attributes');function getQueuesByChannel(_0x3e9885,_0x5e8b62){var _0x1bd7f3=_0x74bf('0x0')+_0x5e8b62+_0x74bf('0x1');return _0x3e9885[_0x1bd7f3]()[_0x74bf('0x2')](function(_0x1f91cd){return _[_0x74bf('0x3')](_0x1f91cd,function(_0x9ee39f){_0x9ee39f['setDataValue']('channel',_0x5e8b62);return _0x9ee39f;});})[_0x74bf('0x4')](function(_0x5d20d4){throw _0x5d20d4;});}module[_0x74bf('0x5')]=function(_0x20b56b){return _0x20b56b[_0x74bf('0x6')](_0x74bf('0x7'),attributes,{'tableName':_0x74bf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x4b0655=this;var _0x12e41c=[_0x74bf('0x9'),'Fax',_0x74bf('0xa'),_0x74bf('0xb'),_0x74bf('0xc'),_0x74bf('0xd'),'Whatsapp'];return Promise[_0x74bf('0xe')]()[_0x74bf('0x2')](function(){var _0x4b807b=_[_0x74bf('0x3')](_0x12e41c,function(_0x400ea5){return getQueuesByChannel(_0x4b0655,_0x400ea5);});return Promise['all'](_0x4b807b);})[_0x74bf('0x4')](function(_0x20a3bc){throw _0x20a3bc;});}}});}; \ No newline at end of file +var _0xa046=['Openchannel','Sms','Voice','resolve','all','lodash','get','then','map','setDataValue','catch','teams','Chat'];(function(_0x586e32,_0x154e9e){var _0x42f8b1=function(_0x31b758){while(--_0x31b758){_0x586e32['push'](_0x586e32['shift']());}};_0x42f8b1(++_0x154e9e);}(_0xa046,0x14a));var _0x6a04=function(_0x4604e1,_0x2d7cb2){_0x4604e1=_0x4604e1-0x0;var _0x3b2b80=_0xa046[_0x4604e1];return _0x3b2b80;};'use strict';var _=require(_0x6a04('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x1d80ee,_0x12be59){var _0x2288cf=_0x6a04('0x1')+_0x12be59+'Queues';return _0x1d80ee[_0x2288cf]()[_0x6a04('0x2')](function(_0x5f20cf){return _[_0x6a04('0x3')](_0x5f20cf,function(_0x3927e8){_0x3927e8[_0x6a04('0x4')]('channel',_0x12be59);return _0x3927e8;});})[_0x6a04('0x5')](function(_0x42075c){throw _0x42075c;});}module['exports']=function(_0x5dcfb6){return _0x5dcfb6['define']('Team',attributes,{'tableName':_0x6a04('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x53acdf=this;var _0x24892d=[_0x6a04('0x7'),'Fax','Mail',_0x6a04('0x8'),_0x6a04('0x9'),_0x6a04('0xa'),'Whatsapp'];return Promise[_0x6a04('0xb')]()[_0x6a04('0x2')](function(){var _0x4b404c=_['map'](_0x24892d,function(_0x5ed853){return getQueuesByChannel(_0x53acdf,_0x5ed853);});return Promise[_0x6a04('0xc')](_0x4b404c);})['catch'](function(_0x17cd21){throw _0x17cd21;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index e9ae3e1..d50b628 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 _0xf188=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./team.socket','then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x54d6a5,_0x33861c){var _0x13e945=function(_0x488fda){while(--_0x488fda){_0x54d6a5['push'](_0x54d6a5['shift']());}};_0x13e945(++_0x33861c);}(_0xf188,0x1b5));var _0x8f18=function(_0x3b9b9a,_0xad54d1){_0x3b9b9a=_0x3b9b9a-0x0;var _0x5ab926=_0xf188[_0x3b9b9a];return _0x5ab926;};'use strict';var _=require(_0x8f18('0x0'));var util=require(_0x8f18('0x1'));var moment=require(_0x8f18('0x2'));var BPromise=require(_0x8f18('0x3'));var rs=require(_0x8f18('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8f18('0x5'));var jayson=require(_0x8f18('0x6'));var client=jayson[_0x8f18('0x7')]['http']({'port':0x232a});config[_0x8f18('0x8')]=_[_0x8f18('0x9')](config[_0x8f18('0x8')],{'host':_0x8f18('0xa'),'port':0x18eb});var socket=require(_0x8f18('0xb'))(new Redis(config['redis']));require(_0x8f18('0xc'))['register'](socket);function respondWithRpcPromise(_0x8964db,_0x1869f5,_0x36b7a7){return new BPromise(function(_0x519cea,_0x3f1325){return client['request'](_0x8964db,_0x36b7a7)[_0x8f18('0xd')](function(_0x50b373){logger[_0x8f18('0xe')](_0x8f18('0xf'),_0x1869f5,_0x8f18('0x10'));logger['debug'](_0x8f18('0x11'),_0x1869f5,_0x8f18('0x10'),JSON[_0x8f18('0x12')](_0x50b373));if(_0x50b373['error']){if(_0x50b373[_0x8f18('0x13')][_0x8f18('0x14')]===0x1f4){logger['error'](_0x8f18('0xf'),_0x1869f5,_0x50b373[_0x8f18('0x13')][_0x8f18('0x15')]);return _0x3f1325(_0x50b373[_0x8f18('0x13')]['message']);}logger[_0x8f18('0x13')](_0x8f18('0xf'),_0x1869f5,_0x50b373[_0x8f18('0x13')][_0x8f18('0x15')]);return _0x519cea(_0x50b373[_0x8f18('0x13')][_0x8f18('0x15')]);}else{logger[_0x8f18('0xe')](_0x8f18('0xf'),_0x1869f5,_0x8f18('0x10'));_0x519cea(_0x50b373[_0x8f18('0x16')][_0x8f18('0x15')]);}})[_0x8f18('0x17')](function(_0x3efa57){logger[_0x8f18('0x13')](_0x8f18('0xf'),_0x1869f5,_0x3efa57);_0x3f1325(_0x3efa57);});});} \ No newline at end of file +var _0x2454=['../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./team.socket','register','then','info','request\x20sent','debug','stringify','error','Team,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x2454,0xd1));var _0x4245=function(_0xa2c960,_0xfd47ac){_0xa2c960=_0xa2c960-0x0;var _0x1f91d1=_0x2454[_0xa2c960];return _0x1f91d1;};'use strict';var _=require(_0x4245('0x0'));var util=require(_0x4245('0x1'));var moment=require(_0x4245('0x2'));var BPromise=require(_0x4245('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4245('0x4'));var db=require(_0x4245('0x5'))['db'];var utils=require(_0x4245('0x6'));var logger=require(_0x4245('0x7'))(_0x4245('0x8'));var config=require(_0x4245('0x9'));var jayson=require(_0x4245('0xa'));var client=jayson[_0x4245('0xb')]['http']({'port':0x232a});config['redis']=_[_0x4245('0xc')](config[_0x4245('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x4245('0xe'))(new Redis(config['redis']));require(_0x4245('0xf'))[_0x4245('0x10')](socket);function respondWithRpcPromise(_0x31ad83,_0x44f755,_0x2544b5){return new BPromise(function(_0x237cc8,_0x5e365d){return client['request'](_0x31ad83,_0x2544b5)[_0x4245('0x11')](function(_0x10cf5b){logger[_0x4245('0x12')]('Team,\x20%s,\x20%s',_0x44f755,_0x4245('0x13'));logger[_0x4245('0x14')]('Team,\x20%s,\x20%s,\x20%s',_0x44f755,_0x4245('0x13'),JSON[_0x4245('0x15')](_0x10cf5b));if(_0x10cf5b[_0x4245('0x16')]){if(_0x10cf5b['error']['code']===0x1f4){logger['error'](_0x4245('0x17'),_0x44f755,_0x10cf5b[_0x4245('0x16')][_0x4245('0x18')]);return _0x5e365d(_0x10cf5b[_0x4245('0x16')][_0x4245('0x18')]);}logger[_0x4245('0x16')](_0x4245('0x17'),_0x44f755,_0x10cf5b[_0x4245('0x16')][_0x4245('0x18')]);return _0x237cc8(_0x10cf5b[_0x4245('0x16')][_0x4245('0x18')]);}else{logger[_0x4245('0x12')](_0x4245('0x17'),_0x44f755,_0x4245('0x13'));_0x237cc8(_0x10cf5b[_0x4245('0x19')][_0x4245('0x18')]);}})[_0x4245('0x1a')](function(_0x315198){logger[_0x4245('0x16')](_0x4245('0x17'),_0x44f755,_0x315198);_0x5e365d(_0x315198);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 98ccf16..53a6275 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 _0xbd7b=['length','team:','save','emit','register'];(function(_0x1edb07,_0x48d868){var _0x2828cd=function(_0x44fc26){while(--_0x44fc26){_0x1edb07['push'](_0x1edb07['shift']());}};_0x2828cd(++_0x48d868);}(_0xbd7b,0x1ec));var _0xbbd7=function(_0x2bf5c0,_0x116255){_0x2bf5c0=_0x2bf5c0-0x0;var _0x36c63c=_0xbd7b[_0x2bf5c0];return _0x36c63c;};'use strict';var TeamEvents=require('./team.events');var events=[_0xbbd7('0x0'),'remove','update'];function createListener(_0x2feaf7,_0x1eb2d0){return function(_0x1d0839){_0x1eb2d0[_0xbbd7('0x1')](_0x2feaf7,_0x1d0839);};}function removeListener(_0x2162e1,_0x2993a6){return function(){TeamEvents['removeListener'](_0x2162e1,_0x2993a6);};}exports[_0xbbd7('0x2')]=function(_0x26bfbc){for(var _0x2f12bf=0x0,_0x41d1f3=events[_0xbbd7('0x3')];_0x2f12bf<_0x41d1f3;_0x2f12bf++){var _0x13a6f6=events[_0x2f12bf];var _0x2846e4=createListener(_0xbbd7('0x4')+_0x13a6f6,_0x26bfbc);TeamEvents['on'](_0x13a6f6,_0x2846e4);}}; \ No newline at end of file +var _0x43b7=['register','length','./team.events','update','removeListener'];(function(_0x387fe4,_0x186656){var _0x43c1c1=function(_0x19ab90){while(--_0x19ab90){_0x387fe4['push'](_0x387fe4['shift']());}};_0x43c1c1(++_0x186656);}(_0x43b7,0x183));var _0x743b=function(_0x3a2bbc,_0x2e77e1){_0x3a2bbc=_0x3a2bbc-0x0;var _0xb4fb2d=_0x43b7[_0x3a2bbc];return _0xb4fb2d;};'use strict';var TeamEvents=require(_0x743b('0x0'));var events=['save','remove',_0x743b('0x1')];function createListener(_0x56d9c3,_0x2e177a){return function(_0x320b11){_0x2e177a['emit'](_0x56d9c3,_0x320b11);};}function removeListener(_0x5f0319,_0x45a9a7){return function(){TeamEvents[_0x743b('0x2')](_0x5f0319,_0x45a9a7);};}exports[_0x743b('0x3')]=function(_0x2e8cd2){for(var _0x8d405=0x0,_0x1b25ec=events[_0x743b('0x4')];_0x8d405<_0x1b25ec;_0x8d405++){var _0x515ed3=events[_0x8d405];var _0x542c29=createListener('team:'+_0x515ed3,_0x2e8cd2);TeamEvents['on'](_0x515ed3,_0x542c29);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 5dca299..f528c94 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 _0x4c58=['INTEGER','sequelize'];(function(_0x315205,_0x3420bd){var _0x384f8f=function(_0x29117c){while(--_0x29117c){_0x315205['push'](_0x315205['shift']());}};_0x384f8f(++_0x3420bd);}(_0x4c58,0xed));var _0x84c5=function(_0x4ae950,_0x4e8962){_0x4ae950=_0x4ae950-0x0;var _0x4c7a70=_0x4c58[_0x4ae950];return _0x4c7a70;};'use strict';var Sequelize=require(_0x84c5('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x84c5('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x84c5('0x1')]}}; \ No newline at end of file +var _0xe3db=['exports','INTEGER','sequelize'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0xe3db,0xc8));var _0xbe3d=function(_0x2467a6,_0x358a29){_0x2467a6=_0x2467a6-0x0;var _0x1c37c3=_0xe3db[_0x2467a6];return _0x1c37c3;};'use strict';var Sequelize=require(_0xbe3d('0x0'));module[_0xbe3d('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xbe3d('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 4dfa4c8..095c421 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 _0xb9e7=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','TeamVoicePrefix','team_has_voice_prefixes','util'];(function(_0x5466e0,_0x586206){var _0xf32c89=function(_0x68e0e9){while(--_0x68e0e9){_0x5466e0['push'](_0x5466e0['shift']());}};_0xf32c89(++_0x586206);}(_0xb9e7,0x1df));var _0x7b9e=function(_0x2a2166,_0x3a077f){_0x2a2166=_0x2a2166-0x0;var _0x3bcf50=_0xb9e7[_0x2a2166];return _0x3bcf50;};'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('./teamVoicePrefix.attributes');module[_0x7b9e('0x8')]=function(_0x51a0ca,_0x3a9c5e){return _0x51a0ca[_0x7b9e('0x9')](_0x7b9e('0xa'),attributes,{'tableName':_0x7b9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9af1=['../../config/environment','exports','define','TeamVoicePrefix','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x31c222,_0x5eb2d4){var _0x442b04=function(_0x13dd73){while(--_0x13dd73){_0x31c222['push'](_0x31c222['shift']());}};_0x442b04(++_0x5eb2d4);}(_0x9af1,0x68));var _0x19af=function(_0x5878aa,_0x32bf6a){_0x5878aa=_0x5878aa-0x0;var _0x1243fd=_0x9af1[_0x5878aa];return _0x1243fd;};'use strict';var _=require(_0x19af('0x0'));var util=require(_0x19af('0x1'));var logger=require(_0x19af('0x2'))('api');var moment=require(_0x19af('0x3'));var BPromise=require(_0x19af('0x4'));var rp=require(_0x19af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x19af('0x6'));var attributes=require('./teamVoicePrefix.attributes');module[_0x19af('0x7')]=function(_0x157fc9,_0x41a50f){return _0x157fc9[_0x19af('0x8')](_0x19af('0x9'),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 2c950bb..c3bdb38 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x375de5,_0x474675){var _0x5cb54e=function(_0x130331){while(--_0x130331){_0x375de5['push'](_0x375de5['shift']());}};_0x5cb54e(++_0x474675);}(_0xe706,0xa3));var _0x6e70=function(_0x1903aa,_0x343458){_0x1903aa=_0x1903aa-0x0;var _0x51fe28=_0xe706[_0x1903aa];return _0x51fe28;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 117a080..2ddf13e 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 _0x7314=['exports','sequelize'];(function(_0x31729c,_0x42cd04){var _0x1c98c8=function(_0x14e31a){while(--_0x14e31a){_0x31729c['push'](_0x31729c['shift']());}};_0x1c98c8(++_0x42cd04);}(_0x7314,0xc1));var _0x4731=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7314[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x4731('0x0'));module[_0x4731('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6b60=['exports'];(function(_0x3818c0,_0x542521){var _0x55ec33=function(_0x2be9ea){while(--_0x2be9ea){_0x3818c0['push'](_0x3818c0['shift']());}};_0x55ec33(++_0x542521);}(_0x6b60,0xe9));var _0x06b6=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x6b60[_0x3fba9f];return _0x192cf1;};'use strict';var Sequelize=require('sequelize');module[_0x06b6('0x0')]={'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 22c2daf..8707ef3 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 _0xe79a=['../../config/environment','./teamVoiceQueue.attributes','exports','define','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x32ce3c,_0xf05ba6){var _0x4ae03f=function(_0x1a02df){while(--_0x1a02df){_0x32ce3c['push'](_0x32ce3c['shift']());}};_0x4ae03f(++_0xf05ba6);}(_0xe79a,0x70));var _0xae79=function(_0x4cf628,_0x56c30f){_0x4cf628=_0x4cf628-0x0;var _0x44d7f3=_0xe79a[_0x4cf628];return _0x44d7f3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xae79('0x0'))('api');var moment=require(_0xae79('0x1'));var BPromise=require(_0xae79('0x2'));var rp=require(_0xae79('0x3'));var fs=require('fs');var path=require(_0xae79('0x4'));var rimraf=require('rimraf');var config=require(_0xae79('0x5'));var attributes=require(_0xae79('0x6'));module[_0xae79('0x7')]=function(_0x590be7,_0x1a9185){return _0x590be7[_0xae79('0x8')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf95=['TeamVoiceQueue','lodash','util','bluebird','request-promise','path','rimraf','./teamVoiceQueue.attributes','exports','define'];(function(_0x367a3d,_0x452717){var _0x460539=function(_0x1e8beb){while(--_0x1e8beb){_0x367a3d['push'](_0x367a3d['shift']());}};_0x460539(++_0x452717);}(_0xcf95,0xa1));var _0x5cf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf95[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5cf9('0x0'));var util=require(_0x5cf9('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5cf9('0x2'));var rp=require(_0x5cf9('0x3'));var fs=require('fs');var path=require(_0x5cf9('0x4'));var rimraf=require(_0x5cf9('0x5'));var config=require('../../config/environment');var attributes=require(_0x5cf9('0x6'));module[_0x5cf9('0x7')]=function(_0x5b060f,_0x498d14){return _0x5b060f[_0x5cf9('0x8')](_0x5cf9('0x9'),attributes,{'tableName':'team_has_voice_queues','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 a365384..7f28d12 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 _0xdfaa=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x127908,_0x24d139){var _0x5598a0=function(_0x521f7e){while(--_0x521f7e){_0x127908['push'](_0x127908['shift']());}};_0x5598a0(++_0x24d139);}(_0xdfaa,0x14a));var _0xadfa=function(_0x339a43,_0x57b2f6){_0x339a43=_0x339a43-0x0;var _0x50f300=_0xdfaa[_0x339a43];return _0x50f300;};'use strict';var _=require(_0xadfa('0x0'));var util=require(_0xadfa('0x1'));var moment=require(_0xadfa('0x2'));var BPromise=require(_0xadfa('0x3'));var rs=require(_0xadfa('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xadfa('0x5'))['db'];var utils=require(_0xadfa('0x6'));var logger=require(_0xadfa('0x7'))(_0xadfa('0x8'));var config=require(_0xadfa('0x9'));var jayson=require(_0xadfa('0xa'));var client=jayson[_0xadfa('0xb')][_0xadfa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10d8f0,_0x24537d,_0x2b453b){return new BPromise(function(_0x402d66,_0x5a39ec){return client['request'](_0x10d8f0,_0x2b453b)['then'](function(_0x578899){logger[_0xadfa('0xd')](_0xadfa('0xe'),_0x24537d,_0xadfa('0xf'));logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x24537d,'request\x20sent',JSON[_0xadfa('0x10')](_0x578899));if(_0x578899[_0xadfa('0x11')]){if(_0x578899[_0xadfa('0x11')][_0xadfa('0x12')]===0x1f4){logger[_0xadfa('0x11')](_0xadfa('0xe'),_0x24537d,_0x578899[_0xadfa('0x11')]['message']);return _0x5a39ec(_0x578899[_0xadfa('0x11')][_0xadfa('0x13')]);}logger[_0xadfa('0x11')](_0xadfa('0xe'),_0x24537d,_0x578899[_0xadfa('0x11')][_0xadfa('0x13')]);return _0x402d66(_0x578899[_0xadfa('0x11')][_0xadfa('0x13')]);}else{logger['info'](_0xadfa('0xe'),_0x24537d,_0xadfa('0xf'));_0x402d66(_0x578899[_0xadfa('0x14')][_0xadfa('0x13')]);}})[_0xadfa('0x15')](function(_0xb7c712){logger[_0xadfa('0x11')](_0xadfa('0xe'),_0x24537d,_0xb7c712);_0x5a39ec(_0xb7c712);});});} \ No newline at end of file +var _0x87e6=['stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x320f49,_0x3a28d9){var _0x5c5e1a=function(_0x2398ca){while(--_0x2398ca){_0x320f49['push'](_0x320f49['shift']());}};_0x5c5e1a(++_0x3a28d9);}(_0x87e6,0x1a3));var _0x687e=function(_0x24cbb7,_0xf71bbd){_0x24cbb7=_0x24cbb7-0x0;var _0x22ddd2=_0x87e6[_0x24cbb7];return _0x22ddd2;};'use strict';var _=require(_0x687e('0x0'));var util=require(_0x687e('0x1'));var moment=require(_0x687e('0x2'));var BPromise=require(_0x687e('0x3'));var rs=require(_0x687e('0x4'));var fs=require('fs');var Redis=require(_0x687e('0x5'));var db=require(_0x687e('0x6'))['db'];var utils=require(_0x687e('0x7'));var logger=require(_0x687e('0x8'))(_0x687e('0x9'));var config=require('../../config/environment');var jayson=require(_0x687e('0xa'));var client=jayson[_0x687e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d5eec,_0xf19ed2,_0x2b50f0){return new BPromise(function(_0x2f074a,_0x7cf8cb){return client[_0x687e('0xc')](_0x4d5eec,_0x2b50f0)[_0x687e('0xd')](function(_0x61b4c3){logger[_0x687e('0xe')](_0x687e('0xf'),_0xf19ed2,_0x687e('0x10'));logger['debug'](_0x687e('0x11'),_0xf19ed2,_0x687e('0x10'),JSON[_0x687e('0x12')](_0x61b4c3));if(_0x61b4c3[_0x687e('0x13')]){if(_0x61b4c3['error'][_0x687e('0x14')]===0x1f4){logger[_0x687e('0x13')](_0x687e('0xf'),_0xf19ed2,_0x61b4c3[_0x687e('0x13')][_0x687e('0x15')]);return _0x7cf8cb(_0x61b4c3[_0x687e('0x13')]['message']);}logger['error'](_0x687e('0xf'),_0xf19ed2,_0x61b4c3['error']['message']);return _0x2f074a(_0x61b4c3[_0x687e('0x13')][_0x687e('0x15')]);}else{logger[_0x687e('0xe')](_0x687e('0xf'),_0xf19ed2,_0x687e('0x10'));_0x2f074a(_0x61b4c3['result'][_0x687e('0x15')]);}})[_0x687e('0x16')](function(_0x445942){logger[_0x687e('0x13')](_0x687e('0xf'),_0xf19ed2,_0x445942);_0x7cf8cb(_0x445942);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index aa7fc3a..dfe2dda 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 _0xd509=['post','create','/:id','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','show'];(function(_0x418cc6,_0x7cff44){var _0x2a530f=function(_0xf9f930){while(--_0xf9f930){_0x418cc6['push'](_0x418cc6['shift']());}};_0x2a530f(++_0x7cff44);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9d50('0x0'));var timeout=require(_0x9d50('0x1'));var express=require(_0x9d50('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9d50('0x3'));var interaction=require(_0x9d50('0x4'));var config=require('../../config/environment');var controller=require(_0x9d50('0x5'));router[_0x9d50('0x6')]('/',auth[_0x9d50('0x7')](),controller['index']);router[_0x9d50('0x6')]('/:id',auth[_0x9d50('0x7')](),controller[_0x9d50('0x8')]);router[_0x9d50('0x9')]('/',auth[_0x9d50('0x7')](),controller[_0x9d50('0xa')]);router['put'](_0x9d50('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x9d50('0xc')]('/:id',auth[_0x9d50('0x7')](),controller[_0x9d50('0xd')]);module[_0x9d50('0xe')]=router; \ No newline at end of file +var _0x297f=['delete','/:id','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','create','put'];(function(_0x2b3825,_0x41bb86){var _0x4734be=function(_0x41a0cc){while(--_0x41a0cc){_0x2b3825['push'](_0x2b3825['shift']());}};_0x4734be(++_0x41bb86);}(_0x297f,0x1f0));var _0xf297=function(_0x557d8b,_0x1cc9c1){_0x557d8b=_0x557d8b-0x0;var _0x416d86=_0x297f[_0x557d8b];return _0x416d86;};'use strict';var multer=require(_0xf297('0x0'));var util=require(_0xf297('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf297('0x2'));var router=express[_0xf297('0x3')]();var fs_extra=require(_0xf297('0x4'));var auth=require(_0xf297('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf297('0x6'));var controller=require('./template.controller');router[_0xf297('0x7')]('/',auth[_0xf297('0x8')](),controller[_0xf297('0x9')]);router['get']('/:id',auth[_0xf297('0x8')](),controller[_0xf297('0xa')]);router[_0xf297('0xb')]('/',auth['isAuthenticated'](),controller[_0xf297('0xc')]);router[_0xf297('0xd')]('/:id',auth[_0xf297('0x8')](),controller['update']);router[_0xf297('0xe')](_0xf297('0xf'),auth[_0xf297('0x8')](),controller['destroy']);module[_0xf297('0x10')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 73f2534..5344126 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 _0x02ff=['sequelize','STRING','TEXT'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x02ff,0x126));var _0xf02f=function(_0x356743,_0x1753a1){_0x356743=_0x356743-0x0;var _0x3a8647=_0x02ff[_0x356743];return _0x3a8647;};'use strict';var Sequelize=require(_0xf02f('0x0'));module['exports']={'name':{'type':Sequelize[_0xf02f('0x1')]},'description':{'type':Sequelize[_0xf02f('0x1')]},'html':{'type':Sequelize[_0xf02f('0x2')]}}; \ No newline at end of file +var _0xc0c7=['sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc0c7,0x166));var _0x7c0c=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xc0c7[_0x455c6c];return _0x488242;};'use strict';var Sequelize=require(_0x7c0c('0x0'));module[_0x7c0c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 43e6816..3900b99 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 _0xeb14=['UserProfileResource','error','name','index','map','rawAttributes','fieldName','type','key','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Template','includeAll','include','findAll','rows','catch','keys','intersection','length','find','create','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','update','then','destroy','get','Templates'];(function(_0x31af74,_0x290ba8){var _0x283684=function(_0x2fd042){while(--_0x2fd042){_0x31af74['push'](_0x31af74['shift']());}};_0x283684(++_0x290ba8);}(_0xeb14,0x11c));var _0x4eb1=function(_0xfab2b,_0x1f4d48){_0xfab2b=_0xfab2b-0x0;var _0x26af02=_0xeb14[_0xfab2b];return _0x26af02;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4eb1('0x0'));var zipdir=require(_0x4eb1('0x1'));var jsonpatch=require(_0x4eb1('0x2'));var rp=require(_0x4eb1('0x3'));var moment=require(_0x4eb1('0x4'));var BPromise=require(_0x4eb1('0x5'));var Mustache=require(_0x4eb1('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4eb1('0x7'));var csv=require(_0x4eb1('0x8'));var ejs=require(_0x4eb1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb1('0xa'));var squel=require(_0x4eb1('0xb'));var crypto=require(_0x4eb1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4eb1('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4eb1('0xe'));var Redis=require(_0x4eb1('0xf'));var authService=require(_0x4eb1('0x10'));var qs=require(_0x4eb1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4eb1('0x12'));var logger=require(_0x4eb1('0x13'))('api');var utils=require(_0x4eb1('0x14'));var config=require(_0x4eb1('0x15'));var licenseUtil=require(_0x4eb1('0x16'));var db=require(_0x4eb1('0x17'))['db'];function respondWithStatusCode(_0x1810f8,_0x1a0a37){_0x1a0a37=_0x1a0a37||0xcc;return function(_0x560a35){if(_0x560a35){return _0x1810f8[_0x4eb1('0x18')](_0x1a0a37);}return _0x1810f8['status'](_0x1a0a37)[_0x4eb1('0x19')]();};}function respondWithResult(_0x49a749,_0x26e5fb){_0x26e5fb=_0x26e5fb||0xc8;return function(_0xb4cba0){if(_0xb4cba0){return _0x49a749[_0x4eb1('0x1a')](_0x26e5fb)['json'](_0xb4cba0);}};}function respondWithFilteredResult(_0x54a792,_0x573107){return function(_0x55d300){if(_0x55d300){var _0x34855d=typeof _0x573107[_0x4eb1('0x1b')]===_0x4eb1('0x1c')&&typeof _0x573107['limit']===_0x4eb1('0x1c');var _0x30031f=_0x55d300[_0x4eb1('0x1d')];var _0x455d8c=_0x34855d?0x0:_0x573107[_0x4eb1('0x1b')];var _0x2b310d=_0x34855d?_0x55d300[_0x4eb1('0x1d')]:_0x573107[_0x4eb1('0x1b')]+_0x573107[_0x4eb1('0x1e')];var _0x1426cd;if(_0x2b310d>=_0x30031f){_0x2b310d=_0x30031f;_0x1426cd=0xc8;}else{_0x1426cd=0xce;}_0x54a792[_0x4eb1('0x1a')](_0x1426cd);return _0x54a792[_0x4eb1('0x1f')](_0x4eb1('0x20'),_0x455d8c+'-'+_0x2b310d+'/'+_0x30031f)[_0x4eb1('0x21')](_0x55d300);}return null;};}function patchUpdates(_0x54c125){return function(_0x3967f0){try{jsonpatch[_0x4eb1('0x22')](_0x3967f0,_0x54c125,!![]);}catch(_0x494fcd){return BPromise['reject'](_0x494fcd);}return _0x3967f0['save']();};}function saveUpdates(_0x592d28,_0x25644f){return function(_0xe39fb7){if(_0xe39fb7){return _0xe39fb7[_0x4eb1('0x23')](_0x592d28)[_0x4eb1('0x24')](function(_0x279186){return _0x279186;});}return null;};}function removeEntity(_0x59d0a1,_0x2843f7){return function(_0x438fd1){if(_0x438fd1){return _0x438fd1[_0x4eb1('0x25')]()['then'](function(){var _0x3c7612=_0x438fd1[_0x4eb1('0x26')]({'plain':!![]});var _0x36733d=_0x4eb1('0x27');return db[_0x4eb1('0x28')][_0x4eb1('0x25')]({'where':{'type':_0x36733d,'resourceId':_0x3c7612['id']}})['then'](function(){return _0x438fd1;});})[_0x4eb1('0x24')](function(){_0x59d0a1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bf074,_0x7674c2){return function(_0x26db4b){if(!_0x26db4b){_0x1bf074['sendStatus'](0x194);}return _0x26db4b;};}function handleError(_0x23692f,_0x224a53){_0x224a53=_0x224a53||0x1f4;return function(_0x30ba1b){logger[_0x4eb1('0x29')](_0x30ba1b['stack']);if(_0x30ba1b[_0x4eb1('0x2a')]){delete _0x30ba1b['name'];}_0x23692f[_0x4eb1('0x1a')](_0x224a53)['send'](_0x30ba1b);};}exports[_0x4eb1('0x2b')]=function(_0x294acd,_0x1bf3c0){var _0x40143e={},_0x409f86={},_0x19c4ea={'count':0x0,'rows':[]};var _0x46cfaa=_[_0x4eb1('0x2c')](db['Template'][_0x4eb1('0x2d')],function(_0x2f99c0){return{'name':_0x2f99c0[_0x4eb1('0x2e')],'type':_0x2f99c0[_0x4eb1('0x2f')][_0x4eb1('0x30')]};});_0x409f86[_0x4eb1('0x31')]=_[_0x4eb1('0x2c')](_0x46cfaa,_0x4eb1('0x2a'));_0x409f86[_0x4eb1('0x32')]=_['keys'](_0x294acd[_0x4eb1('0x32')]);_0x409f86['filters']=_['intersection'](_0x409f86[_0x4eb1('0x31')],_0x409f86['query']);_0x40143e[_0x4eb1('0x33')]=_['intersection'](_0x409f86[_0x4eb1('0x31')],qs[_0x4eb1('0x34')](_0x294acd[_0x4eb1('0x32')][_0x4eb1('0x34')]));_0x40143e[_0x4eb1('0x33')]=_0x40143e[_0x4eb1('0x33')]['length']?_0x40143e['attributes']:_0x409f86['model'];if(!_0x294acd[_0x4eb1('0x32')][_0x4eb1('0x35')](_0x4eb1('0x36'))){_0x40143e[_0x4eb1('0x1e')]=qs[_0x4eb1('0x1e')](_0x294acd[_0x4eb1('0x32')][_0x4eb1('0x1e')]);_0x40143e[_0x4eb1('0x1b')]=qs[_0x4eb1('0x1b')](_0x294acd[_0x4eb1('0x32')]['offset']);}_0x40143e[_0x4eb1('0x37')]=qs[_0x4eb1('0x38')](_0x294acd[_0x4eb1('0x32')][_0x4eb1('0x38')]);_0x40143e[_0x4eb1('0x39')]=qs[_0x4eb1('0x3a')](_[_0x4eb1('0x3b')](_0x294acd[_0x4eb1('0x32')],_0x409f86['filters']),_0x46cfaa);if(_0x294acd[_0x4eb1('0x32')][_0x4eb1('0x3c')]){_0x40143e[_0x4eb1('0x39')]=_[_0x4eb1('0x3d')](_0x40143e[_0x4eb1('0x39')],{'$or':_[_0x4eb1('0x2c')](_0x46cfaa,function(_0x17d651){if(_0x17d651[_0x4eb1('0x2f')]!==_0x4eb1('0x3e')){var _0x36edef={};_0x36edef[_0x17d651[_0x4eb1('0x2a')]]={'$like':'%'+_0x294acd[_0x4eb1('0x32')][_0x4eb1('0x3c')]+'%'};return _0x36edef;}})});}_0x40143e=_[_0x4eb1('0x3d')]({},_0x40143e,_0x294acd[_0x4eb1('0x3f')]);var _0x5065e2={'where':_0x40143e['where']};return db[_0x4eb1('0x40')]['count'](_0x5065e2)['then'](function(_0x4eb17d){_0x19c4ea[_0x4eb1('0x1d')]=_0x4eb17d;if(_0x294acd[_0x4eb1('0x32')][_0x4eb1('0x41')]){_0x40143e[_0x4eb1('0x42')]=[{'all':!![]}];}return db[_0x4eb1('0x40')][_0x4eb1('0x43')](_0x40143e);})['then'](function(_0x4d376e){_0x19c4ea[_0x4eb1('0x44')]=_0x4d376e;return _0x19c4ea;})[_0x4eb1('0x24')](respondWithFilteredResult(_0x1bf3c0,_0x40143e))[_0x4eb1('0x45')](handleError(_0x1bf3c0,null));};exports['show']=function(_0x49c93f,_0x37fb93){var _0x41a7e5={'raw':!![],'where':{'id':_0x49c93f['params']['id']}},_0x3d1d4c={};_0x3d1d4c[_0x4eb1('0x31')]=_[_0x4eb1('0x46')](db['Template']['rawAttributes']);_0x3d1d4c[_0x4eb1('0x32')]=_['keys'](_0x49c93f['query']);_0x3d1d4c[_0x4eb1('0x3a')]=_[_0x4eb1('0x47')](_0x3d1d4c[_0x4eb1('0x31')],_0x3d1d4c[_0x4eb1('0x32')]);_0x41a7e5[_0x4eb1('0x33')]=_['intersection'](_0x3d1d4c[_0x4eb1('0x31')],qs[_0x4eb1('0x34')](_0x49c93f[_0x4eb1('0x32')][_0x4eb1('0x34')]));_0x41a7e5[_0x4eb1('0x33')]=_0x41a7e5[_0x4eb1('0x33')][_0x4eb1('0x48')]?_0x41a7e5[_0x4eb1('0x33')]:_0x3d1d4c[_0x4eb1('0x31')];if(_0x49c93f[_0x4eb1('0x32')]['includeAll']){_0x41a7e5['include']=[{'all':!![]}];}_0x41a7e5=_[_0x4eb1('0x3d')]({},_0x41a7e5,_0x49c93f['options']);return db[_0x4eb1('0x40')][_0x4eb1('0x49')](_0x41a7e5)[_0x4eb1('0x24')](handleEntityNotFound(_0x37fb93,null))[_0x4eb1('0x24')](respondWithResult(_0x37fb93,null))[_0x4eb1('0x45')](handleError(_0x37fb93,null));};exports['create']=function(_0x6256f0,_0x1e1670){return db[_0x4eb1('0x40')][_0x4eb1('0x4a')](_0x6256f0['body'],{})[_0x4eb1('0x24')](function(_0x24c3fc){var _0x53a26d=_0x6256f0['user'][_0x4eb1('0x26')]({'plain':!![]});if(!_0x53a26d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53a26d['role']===_0x4eb1('0x4b')){var _0x40133c=_0x24c3fc[_0x4eb1('0x26')]({'plain':!![]});var _0x5c1004=_0x4eb1('0x27');return db[_0x4eb1('0x4c')][_0x4eb1('0x49')]({'where':{'name':_0x5c1004,'userProfileId':_0x53a26d[_0x4eb1('0x4d')]},'raw':!![]})[_0x4eb1('0x24')](function(_0x42b77a){if(_0x42b77a&&_0x42b77a['autoAssociation']===0x0){return db[_0x4eb1('0x28')][_0x4eb1('0x4a')]({'name':_0x40133c[_0x4eb1('0x2a')],'resourceId':_0x40133c['id'],'type':_0x42b77a['name'],'sectionId':_0x42b77a['id']},{})[_0x4eb1('0x24')](function(){return _0x24c3fc;});}else{return _0x24c3fc;}})[_0x4eb1('0x45')](function(_0x2f8c6a){logger[_0x4eb1('0x29')](_0x4eb1('0x4e'),_0x2f8c6a);throw _0x2f8c6a;});}return _0x24c3fc;})[_0x4eb1('0x24')](respondWithResult(_0x1e1670,0xc9))[_0x4eb1('0x45')](handleError(_0x1e1670,null));};exports[_0x4eb1('0x23')]=function(_0x54cf62,_0x5d81a5){if(_0x54cf62[_0x4eb1('0x4f')]['id']){delete _0x54cf62['body']['id'];}return db[_0x4eb1('0x40')][_0x4eb1('0x49')]({'where':{'id':_0x54cf62['params']['id']}})[_0x4eb1('0x24')](handleEntityNotFound(_0x5d81a5,null))[_0x4eb1('0x24')](saveUpdates(_0x54cf62[_0x4eb1('0x4f')],null))[_0x4eb1('0x24')](respondWithResult(_0x5d81a5,null))[_0x4eb1('0x45')](handleError(_0x5d81a5,null));};exports[_0x4eb1('0x25')]=function(_0x47bdb2,_0x3ea3dc){return db[_0x4eb1('0x40')][_0x4eb1('0x49')]({'where':{'id':_0x47bdb2[_0x4eb1('0x50')]['id']}})['then'](handleEntityNotFound(_0x3ea3dc,null))[_0x4eb1('0x24')](removeEntity(_0x3ea3dc,null))[_0x4eb1('0x45')](handleError(_0x3ea3dc,null));}; \ No newline at end of file +var _0x61c2=['Template','rawAttributes','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','include','find','create','body','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Templates','UserProfileResource','error','stack','name','send','index','map'];(function(_0xbf23b4,_0x14c39c){var _0x24dfb2=function(_0x5abaac){while(--_0x5abaac){_0xbf23b4['push'](_0xbf23b4['shift']());}};_0x24dfb2(++_0x14c39c);}(_0x61c2,0x72));var _0x261c=function(_0x2fa835,_0x3eb916){_0x2fa835=_0x2fa835-0x0;var _0x327121=_0x61c2[_0x2fa835];return _0x327121;};'use strict';var emlformat=require(_0x261c('0x0'));var rimraf=require(_0x261c('0x1'));var zipdir=require(_0x261c('0x2'));var jsonpatch=require(_0x261c('0x3'));var rp=require('request-promise');var moment=require(_0x261c('0x4'));var BPromise=require(_0x261c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x261c('0x6'));var sox=require('sox');var csv=require(_0x261c('0x7'));var ejs=require(_0x261c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x261c('0x9'));var squel=require(_0x261c('0xa'));var crypto=require(_0x261c('0xb'));var jsforce=require(_0x261c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x261c('0x7'));var querystring=require(_0x261c('0xd'));var Papa=require(_0x261c('0xe'));var Redis=require(_0x261c('0xf'));var authService=require(_0x261c('0x10'));var qs=require(_0x261c('0x11'));var as=require(_0x261c('0x12'));var hardwareService=require(_0x261c('0x13'));var logger=require(_0x261c('0x14'))(_0x261c('0x15'));var utils=require('../../config/utils');var config=require(_0x261c('0x16'));var licenseUtil=require(_0x261c('0x17'));var db=require(_0x261c('0x18'))['db'];function respondWithStatusCode(_0x209a73,_0x9a1ba4){_0x9a1ba4=_0x9a1ba4||0xcc;return function(_0x5ae3d9){if(_0x5ae3d9){return _0x209a73[_0x261c('0x19')](_0x9a1ba4);}return _0x209a73[_0x261c('0x1a')](_0x9a1ba4)[_0x261c('0x1b')]();};}function respondWithResult(_0x52d738,_0x345b8a){_0x345b8a=_0x345b8a||0xc8;return function(_0x7b9195){if(_0x7b9195){return _0x52d738[_0x261c('0x1a')](_0x345b8a)['json'](_0x7b9195);}};}function respondWithFilteredResult(_0x5d7737,_0x39a4e3){return function(_0x53f570){if(_0x53f570){var _0x18d8f2=typeof _0x39a4e3[_0x261c('0x1c')]==='undefined'&&typeof _0x39a4e3[_0x261c('0x1d')]===_0x261c('0x1e');var _0x2f401f=_0x53f570['count'];var _0x117a6f=_0x18d8f2?0x0:_0x39a4e3['offset'];var _0x176230=_0x18d8f2?_0x53f570[_0x261c('0x1f')]:_0x39a4e3[_0x261c('0x1c')]+_0x39a4e3['limit'];var _0x2b12e1;if(_0x176230>=_0x2f401f){_0x176230=_0x2f401f;_0x2b12e1=0xc8;}else{_0x2b12e1=0xce;}_0x5d7737[_0x261c('0x1a')](_0x2b12e1);return _0x5d7737[_0x261c('0x20')](_0x261c('0x21'),_0x117a6f+'-'+_0x176230+'/'+_0x2f401f)[_0x261c('0x22')](_0x53f570);}return null;};}function patchUpdates(_0x563c3d){return function(_0x4709d2){try{jsonpatch[_0x261c('0x23')](_0x4709d2,_0x563c3d,!![]);}catch(_0x440147){return BPromise[_0x261c('0x24')](_0x440147);}return _0x4709d2[_0x261c('0x25')]();};}function saveUpdates(_0x4cf6e9,_0xa18919){return function(_0x1547af){if(_0x1547af){return _0x1547af[_0x261c('0x26')](_0x4cf6e9)['then'](function(_0x531138){return _0x531138;});}return null;};}function removeEntity(_0xecd334,_0x338ee5){return function(_0x25e498){if(_0x25e498){return _0x25e498[_0x261c('0x27')]()[_0x261c('0x28')](function(){var _0x5c760a=_0x25e498[_0x261c('0x29')]({'plain':!![]});var _0x38acee=_0x261c('0x2a');return db[_0x261c('0x2b')][_0x261c('0x27')]({'where':{'type':_0x38acee,'resourceId':_0x5c760a['id']}})['then'](function(){return _0x25e498;});})[_0x261c('0x28')](function(){_0xecd334['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x309697,_0x465fb0){return function(_0xf1e802){if(!_0xf1e802){_0x309697['sendStatus'](0x194);}return _0xf1e802;};}function handleError(_0x473323,_0xf85e1f){_0xf85e1f=_0xf85e1f||0x1f4;return function(_0x3cb55e){logger[_0x261c('0x2c')](_0x3cb55e[_0x261c('0x2d')]);if(_0x3cb55e[_0x261c('0x2e')]){delete _0x3cb55e[_0x261c('0x2e')];}_0x473323[_0x261c('0x1a')](_0xf85e1f)[_0x261c('0x2f')](_0x3cb55e);};}exports[_0x261c('0x30')]=function(_0x5a8faf,_0x7e01e6){var _0x34e742={},_0x5db8f5={},_0x3437cd={'count':0x0,'rows':[]};var _0x23153d=_[_0x261c('0x31')](db[_0x261c('0x32')][_0x261c('0x33')],function(_0x4766b5){return{'name':_0x4766b5['fieldName'],'type':_0x4766b5[_0x261c('0x34')]['key']};});_0x5db8f5[_0x261c('0x35')]=_['map'](_0x23153d,_0x261c('0x2e'));_0x5db8f5['query']=_[_0x261c('0x36')](_0x5a8faf[_0x261c('0x37')]);_0x5db8f5['filters']=_[_0x261c('0x38')](_0x5db8f5['model'],_0x5db8f5['query']);_0x34e742[_0x261c('0x39')]=_['intersection'](_0x5db8f5[_0x261c('0x35')],qs[_0x261c('0x3a')](_0x5a8faf['query'][_0x261c('0x3a')]));_0x34e742['attributes']=_0x34e742[_0x261c('0x39')][_0x261c('0x3b')]?_0x34e742[_0x261c('0x39')]:_0x5db8f5[_0x261c('0x35')];if(!_0x5a8faf[_0x261c('0x37')][_0x261c('0x3c')]('nolimit')){_0x34e742[_0x261c('0x1d')]=qs[_0x261c('0x1d')](_0x5a8faf['query'][_0x261c('0x1d')]);_0x34e742[_0x261c('0x1c')]=qs[_0x261c('0x1c')](_0x5a8faf[_0x261c('0x37')][_0x261c('0x1c')]);}_0x34e742[_0x261c('0x3d')]=qs[_0x261c('0x3e')](_0x5a8faf[_0x261c('0x37')][_0x261c('0x3e')]);_0x34e742[_0x261c('0x3f')]=qs[_0x261c('0x40')](_[_0x261c('0x41')](_0x5a8faf[_0x261c('0x37')],_0x5db8f5['filters']),_0x23153d);if(_0x5a8faf[_0x261c('0x37')][_0x261c('0x42')]){_0x34e742[_0x261c('0x3f')]=_[_0x261c('0x43')](_0x34e742[_0x261c('0x3f')],{'$or':_[_0x261c('0x31')](_0x23153d,function(_0x143768){if(_0x143768[_0x261c('0x34')]!==_0x261c('0x44')){var _0x5cdf48={};_0x5cdf48[_0x143768['name']]={'$like':'%'+_0x5a8faf[_0x261c('0x37')][_0x261c('0x42')]+'%'};return _0x5cdf48;}})});}_0x34e742=_[_0x261c('0x43')]({},_0x34e742,_0x5a8faf['options']);var _0x1c136e={'where':_0x34e742['where']};return db['Template']['count'](_0x1c136e)[_0x261c('0x28')](function(_0x43fde7){_0x3437cd['count']=_0x43fde7;if(_0x5a8faf[_0x261c('0x37')]['includeAll']){_0x34e742['include']=[{'all':!![]}];}return db['Template'][_0x261c('0x45')](_0x34e742);})[_0x261c('0x28')](function(_0x4c2d6b){_0x3437cd[_0x261c('0x46')]=_0x4c2d6b;return _0x3437cd;})[_0x261c('0x28')](respondWithFilteredResult(_0x7e01e6,_0x34e742))[_0x261c('0x47')](handleError(_0x7e01e6,null));};exports[_0x261c('0x48')]=function(_0x42f10d,_0x38eb5c){var _0x4528ec={'raw':!![],'where':{'id':_0x42f10d[_0x261c('0x49')]['id']}},_0x137641={};_0x137641[_0x261c('0x35')]=_['keys'](db[_0x261c('0x32')][_0x261c('0x33')]);_0x137641['query']=_[_0x261c('0x36')](_0x42f10d[_0x261c('0x37')]);_0x137641[_0x261c('0x40')]=_['intersection'](_0x137641[_0x261c('0x35')],_0x137641[_0x261c('0x37')]);_0x4528ec[_0x261c('0x39')]=_[_0x261c('0x38')](_0x137641[_0x261c('0x35')],qs[_0x261c('0x3a')](_0x42f10d['query']['fields']));_0x4528ec['attributes']=_0x4528ec[_0x261c('0x39')][_0x261c('0x3b')]?_0x4528ec['attributes']:_0x137641[_0x261c('0x35')];if(_0x42f10d[_0x261c('0x37')]['includeAll']){_0x4528ec[_0x261c('0x4a')]=[{'all':!![]}];}_0x4528ec=_[_0x261c('0x43')]({},_0x4528ec,_0x42f10d['options']);return db[_0x261c('0x32')][_0x261c('0x4b')](_0x4528ec)['then'](handleEntityNotFound(_0x38eb5c,null))['then'](respondWithResult(_0x38eb5c,null))[_0x261c('0x47')](handleError(_0x38eb5c,null));};exports[_0x261c('0x4c')]=function(_0x6bd6d9,_0x472e55){return db[_0x261c('0x32')][_0x261c('0x4c')](_0x6bd6d9[_0x261c('0x4d')],{})['then'](function(_0x457075){var _0x41fa71=_0x6bd6d9['user'][_0x261c('0x29')]({'plain':!![]});if(!_0x41fa71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41fa71['role']==='user'){var _0x569a50=_0x457075[_0x261c('0x29')]({'plain':!![]});var _0x1ff731=_0x261c('0x2a');return db[_0x261c('0x4e')]['find']({'where':{'name':_0x1ff731,'userProfileId':_0x41fa71[_0x261c('0x4f')]},'raw':!![]})[_0x261c('0x28')](function(_0x305458){if(_0x305458&&_0x305458[_0x261c('0x50')]===0x0){return db[_0x261c('0x2b')][_0x261c('0x4c')]({'name':_0x569a50[_0x261c('0x2e')],'resourceId':_0x569a50['id'],'type':_0x305458[_0x261c('0x2e')],'sectionId':_0x305458['id']},{})['then'](function(){return _0x457075;});}else{return _0x457075;}})[_0x261c('0x47')](function(_0x1933f3){logger[_0x261c('0x2c')](_0x261c('0x51'),_0x1933f3);throw _0x1933f3;});}return _0x457075;})[_0x261c('0x28')](respondWithResult(_0x472e55,0xc9))[_0x261c('0x47')](handleError(_0x472e55,null));};exports[_0x261c('0x26')]=function(_0x71d9e5,_0x4a2825){if(_0x71d9e5[_0x261c('0x4d')]['id']){delete _0x71d9e5[_0x261c('0x4d')]['id'];}return db[_0x261c('0x32')][_0x261c('0x4b')]({'where':{'id':_0x71d9e5['params']['id']}})['then'](handleEntityNotFound(_0x4a2825,null))['then'](saveUpdates(_0x71d9e5[_0x261c('0x4d')],null))['then'](respondWithResult(_0x4a2825,null))['catch'](handleError(_0x4a2825,null));};exports[_0x261c('0x27')]=function(_0x19dacb,_0x2f1ce2){return db[_0x261c('0x32')][_0x261c('0x4b')]({'where':{'id':_0x19dacb[_0x261c('0x49')]['id']}})[_0x261c('0x28')](handleEntityNotFound(_0x2f1ce2,null))[_0x261c('0x28')](removeEntity(_0x2f1ce2,null))[_0x261c('0x47')](handleError(_0x2f1ce2,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 5b1460b..60a782f 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 _0x658b=['path','../../config/environment','./template.attributes','exports','define','Template','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x45502d,_0x5ca8b7){var _0x8813c9=function(_0xa53455){while(--_0xa53455){_0x45502d['push'](_0x45502d['shift']());}};_0x8813c9(++_0x5ca8b7);}(_0x658b,0xa0));var _0xb658=function(_0x123e78,_0x419041){_0x123e78=_0x123e78-0x0;var _0x371f64=_0x658b[_0x123e78];return _0x371f64;};'use strict';var _=require('lodash');var util=require(_0xb658('0x0'));var logger=require(_0xb658('0x1'))('api');var moment=require(_0xb658('0x2'));var BPromise=require(_0xb658('0x3'));var rp=require(_0xb658('0x4'));var fs=require('fs');var path=require(_0xb658('0x5'));var rimraf=require('rimraf');var config=require(_0xb658('0x6'));var attributes=require(_0xb658('0x7'));module[_0xb658('0x8')]=function(_0x568c81,_0x4b9a7d){return _0x568c81[_0xb658('0x9')](_0xb658('0xa'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb69=['bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','tools_templates','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb69,0xe5));var _0x9db6=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xdb69[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x9db6('0x0'));var util=require(_0x9db6('0x1'));var logger=require(_0x9db6('0x2'))(_0x9db6('0x3'));var moment=require(_0x9db6('0x4'));var BPromise=require(_0x9db6('0x5'));var rp=require(_0x9db6('0x6'));var fs=require('fs');var path=require(_0x9db6('0x7'));var rimraf=require(_0x9db6('0x8'));var config=require(_0x9db6('0x9'));var attributes=require(_0x9db6('0xa'));module[_0x9db6('0xb')]=function(_0x5b7316,_0x3eef67){return _0x5b7316['define']('Template',attributes,{'tableName':_0x9db6('0xc'),'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 4bde9be..95047c3 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 _0x51bd=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','Template,\x20%s,\x20%s','result','GetTemplate','Template','findAll','options','where','attributes','include','map','model','catch','lodash','moment','bluebird'];(function(_0x514363,_0x5aedf2){var _0x54d200=function(_0x4b05be){while(--_0x4b05be){_0x514363['push'](_0x514363['shift']());}};_0x54d200(++_0x5aedf2);}(_0x51bd,0x1af));var _0xd51b=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x51bd[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xd51b('0x0'));var util=require('util');var moment=require(_0xd51b('0x1'));var BPromise=require(_0xd51b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd51b('0x3'));var db=require(_0xd51b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd51b('0x5'));var config=require(_0xd51b('0x6'));var jayson=require(_0xd51b('0x7'));var client=jayson[_0xd51b('0x8')][_0xd51b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42282f,_0xc85e58,_0x263dbf){return new BPromise(function(_0x2919b9,_0x223d90){return client[_0xd51b('0xa')](_0x42282f,_0x263dbf)[_0xd51b('0xb')](function(_0x2ff4ac){logger[_0xd51b('0xc')]('Template,\x20%s,\x20%s',_0xc85e58,_0xd51b('0xd'));logger[_0xd51b('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0xc85e58,_0xd51b('0xd'),JSON[_0xd51b('0xf')](_0x2ff4ac));if(_0x2ff4ac[_0xd51b('0x10')]){if(_0x2ff4ac['error'][_0xd51b('0x11')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0xc85e58,_0x2ff4ac[_0xd51b('0x10')][_0xd51b('0x12')]);return _0x223d90(_0x2ff4ac[_0xd51b('0x10')][_0xd51b('0x12')]);}logger[_0xd51b('0x10')](_0xd51b('0x13'),_0xc85e58,_0x2ff4ac[_0xd51b('0x10')][_0xd51b('0x12')]);return _0x2919b9(_0x2ff4ac[_0xd51b('0x10')][_0xd51b('0x12')]);}else{logger[_0xd51b('0xc')](_0xd51b('0x13'),_0xc85e58,'request\x20sent');_0x2919b9(_0x2ff4ac[_0xd51b('0x14')][_0xd51b('0x12')]);}})['catch'](function(_0x3ad0fc){logger[_0xd51b('0x10')](_0xd51b('0x13'),_0xc85e58,_0x3ad0fc);_0x223d90(_0x3ad0fc);});});}exports[_0xd51b('0x15')]=function(_0x821eae){var _0x3d4e06=this;return new Promise(function(_0x5db8cd,_0x41994f){return db[_0xd51b('0x16')][_0xd51b('0x17')]({'raw':_0x821eae[_0xd51b('0x18')]?_0x821eae['options']['raw']===undefined?!![]:![]:!![],'where':_0x821eae[_0xd51b('0x18')]?_0x821eae[_0xd51b('0x18')][_0xd51b('0x19')]||null:null,'attributes':_0x821eae['options']?_0x821eae[_0xd51b('0x18')][_0xd51b('0x1a')]||null:null,'limit':_0x821eae['options']?_0x821eae[_0xd51b('0x18')]['limit']||null:null,'include':_0x821eae[_0xd51b('0x18')]?_0x821eae[_0xd51b('0x18')][_0xd51b('0x1b')]?_[_0xd51b('0x1c')](_0x821eae[_0xd51b('0x18')][_0xd51b('0x1b')],function(_0x58b92d){return{'model':db[_0x58b92d[_0xd51b('0x1d')]],'as':_0x58b92d['as'],'attributes':_0x58b92d[_0xd51b('0x1a')],'include':_0x58b92d[_0xd51b('0x1b')]?_[_0xd51b('0x1c')](_0x58b92d['include'],function(_0x43b325){return{'model':db[_0x43b325[_0xd51b('0x1d')]],'as':_0x43b325['as'],'attributes':_0x43b325[_0xd51b('0x1a')],'include':_0x43b325[_0xd51b('0x1b')]?_['map'](_0x43b325[_0xd51b('0x1b')],function(_0x184e05){return{'model':db[_0x184e05[_0xd51b('0x1d')]],'as':_0x184e05['as'],'attributes':_0x184e05[_0xd51b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd51b('0xb')](function(_0x40d2a0){logger[_0xd51b('0xc')](_0xd51b('0x15'),_0x821eae);logger['debug']('GetTemplate',_0x821eae,JSON['stringify'](_0x40d2a0));_0x5db8cd(_0x40d2a0);})[_0xd51b('0x1e')](function(_0x172610){logger[_0xd51b('0x10')](_0xd51b('0x15'),_0x172610[_0xd51b('0x12')],_0x821eae);_0x41994f(_0x3d4e06['error'](0x1f4,_0x172610[_0xd51b('0x12')]));});});}; \ No newline at end of file +var _0x45d2=['Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message','result','GetTemplate','Template','findAll','options','raw','attributes','limit','include','map','model','then','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','http','request','info','request\x20sent','debug'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x45d2,0xec));var _0x245d=function(_0x508716,_0x4909ba){_0x508716=_0x508716-0x0;var _0x2c771e=_0x45d2[_0x508716];return _0x2c771e;};'use strict';var _=require(_0x245d('0x0'));var util=require(_0x245d('0x1'));var moment=require(_0x245d('0x2'));var BPromise=require(_0x245d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x245d('0x4'));var db=require(_0x245d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x245d('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x245d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x44078e,_0xbecb61,_0xadce94){return new BPromise(function(_0x56cab4,_0x2977af){return client[_0x245d('0x8')](_0x44078e,_0xadce94)['then'](function(_0x26db53){logger[_0x245d('0x9')]('Template,\x20%s,\x20%s',_0xbecb61,_0x245d('0xa'));logger[_0x245d('0xb')](_0x245d('0xc'),_0xbecb61,'request\x20sent',JSON[_0x245d('0xd')](_0x26db53));if(_0x26db53[_0x245d('0xe')]){if(_0x26db53[_0x245d('0xe')][_0x245d('0xf')]===0x1f4){logger[_0x245d('0xe')](_0x245d('0x10'),_0xbecb61,_0x26db53['error'][_0x245d('0x11')]);return _0x2977af(_0x26db53[_0x245d('0xe')][_0x245d('0x11')]);}logger[_0x245d('0xe')](_0x245d('0x10'),_0xbecb61,_0x26db53[_0x245d('0xe')][_0x245d('0x11')]);return _0x56cab4(_0x26db53[_0x245d('0xe')]['message']);}else{logger[_0x245d('0x9')](_0x245d('0x10'),_0xbecb61,'request\x20sent');_0x56cab4(_0x26db53[_0x245d('0x12')][_0x245d('0x11')]);}})['catch'](function(_0x25e476){logger[_0x245d('0xe')](_0x245d('0x10'),_0xbecb61,_0x25e476);_0x2977af(_0x25e476);});});}exports[_0x245d('0x13')]=function(_0x39777e){var _0x4168b4=this;return new Promise(function(_0x22b08a,_0x34b8e1){return db[_0x245d('0x14')][_0x245d('0x15')]({'raw':_0x39777e[_0x245d('0x16')]?_0x39777e[_0x245d('0x16')][_0x245d('0x17')]===undefined?!![]:![]:!![],'where':_0x39777e['options']?_0x39777e['options']['where']||null:null,'attributes':_0x39777e[_0x245d('0x16')]?_0x39777e['options'][_0x245d('0x18')]||null:null,'limit':_0x39777e[_0x245d('0x16')]?_0x39777e[_0x245d('0x16')][_0x245d('0x19')]||null:null,'include':_0x39777e['options']?_0x39777e[_0x245d('0x16')][_0x245d('0x1a')]?_[_0x245d('0x1b')](_0x39777e[_0x245d('0x16')][_0x245d('0x1a')],function(_0xec4862){return{'model':db[_0xec4862['model']],'as':_0xec4862['as'],'attributes':_0xec4862[_0x245d('0x18')],'include':_0xec4862[_0x245d('0x1a')]?_[_0x245d('0x1b')](_0xec4862[_0x245d('0x1a')],function(_0x5727e4){return{'model':db[_0x5727e4[_0x245d('0x1c')]],'as':_0x5727e4['as'],'attributes':_0x5727e4[_0x245d('0x18')],'include':_0x5727e4[_0x245d('0x1a')]?_[_0x245d('0x1b')](_0x5727e4['include'],function(_0x29ef3e){return{'model':db[_0x29ef3e[_0x245d('0x1c')]],'as':_0x29ef3e['as'],'attributes':_0x29ef3e[_0x245d('0x18')]};}):[]};}):[]};}):[]:[]})[_0x245d('0x1d')](function(_0x341aa2){logger['info']('GetTemplate',_0x39777e);logger[_0x245d('0xb')](_0x245d('0x13'),_0x39777e,JSON[_0x245d('0xd')](_0x341aa2));_0x22b08a(_0x341aa2);})[_0x245d('0x1e')](function(_0x268b15){logger[_0x245d('0xe')](_0x245d('0x13'),_0x268b15[_0x245d('0x11')],_0x39777e);_0x34b8e1(_0x4168b4[_0x245d('0xe')](0x1f4,_0x268b15[_0x245d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 508f08c..781db52 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 _0x5c36=['isAuthenticated','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','getActions','create','post','addAllCondition','addAnyCondition','addAction','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get','/:id'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x5c36,0x1d1));var _0x65c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c36[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x65c3('0x0'));var timeout=require(_0x65c3('0x1'));var express=require(_0x65c3('0x2'));var router=express[_0x65c3('0x3')]();var fs_extra=require(_0x65c3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x65c3('0x5'));var config=require(_0x65c3('0x6'));var controller=require(_0x65c3('0x7'));router[_0x65c3('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x65c3('0x8')](_0x65c3('0x9'),auth[_0x65c3('0xa')](),controller['show']);router['get'](_0x65c3('0xb'),auth[_0x65c3('0xa')](),controller[_0x65c3('0xc')]);router[_0x65c3('0x8')]('/:id/any_conditions',auth[_0x65c3('0xa')](),controller[_0x65c3('0xd')]);router[_0x65c3('0x8')](_0x65c3('0xe'),auth[_0x65c3('0xa')](),controller[_0x65c3('0xf')]);router['post']('/',auth[_0x65c3('0xa')](),controller[_0x65c3('0x10')]);router[_0x65c3('0x11')]('/:id/all_conditions',auth[_0x65c3('0xa')](),controller[_0x65c3('0x12')]);router[_0x65c3('0x11')]('/:id/any_conditions',auth[_0x65c3('0xa')](),controller[_0x65c3('0x13')]);router[_0x65c3('0x11')]('/:id/actions',auth['isAuthenticated'](),controller[_0x65c3('0x14')]);router[_0x65c3('0x15')](_0x65c3('0x9'),auth['isAuthenticated'](),controller[_0x65c3('0x16')]);router[_0x65c3('0x17')](_0x65c3('0x9'),auth[_0x65c3('0xa')](),controller['destroy']);module[_0x65c3('0x18')]=router; \ No newline at end of file +var _0x2d07=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','/:id/any_conditions','isAuthenticated','getAnyConditions','getActions','post','create','addAllCondition','addAnyCondition','/:id/actions','addAction','update','delete'];(function(_0x356005,_0x411466){var _0x2bb35b=function(_0x449cfb){while(--_0x449cfb){_0x356005['push'](_0x356005['shift']());}};_0x2bb35b(++_0x411466);}(_0x2d07,0x13a));var _0x72d0=function(_0x37fcda,_0x2f5aa1){_0x37fcda=_0x37fcda-0x0;var _0xf5ed91=_0x2d07[_0x37fcda];return _0xf5ed91;};'use strict';var multer=require(_0x72d0('0x0'));var util=require(_0x72d0('0x1'));var path=require('path');var timeout=require(_0x72d0('0x2'));var express=require(_0x72d0('0x3'));var router=express['Router']();var fs_extra=require(_0x72d0('0x4'));var auth=require(_0x72d0('0x5'));var interaction=require(_0x72d0('0x6'));var config=require(_0x72d0('0x7'));var controller=require(_0x72d0('0x8'));router[_0x72d0('0x9')]('/',auth['isAuthenticated'](),controller[_0x72d0('0xa')]);router[_0x72d0('0x9')](_0x72d0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x72d0('0x9')]('/:id/all_conditions',auth['isAuthenticated'](),controller['getAllConditions']);router[_0x72d0('0x9')](_0x72d0('0xc'),auth[_0x72d0('0xd')](),controller[_0x72d0('0xe')]);router['get']('/:id/actions',auth['isAuthenticated'](),controller[_0x72d0('0xf')]);router[_0x72d0('0x10')]('/',auth[_0x72d0('0xd')](),controller[_0x72d0('0x11')]);router[_0x72d0('0x10')]('/:id/all_conditions',auth[_0x72d0('0xd')](),controller[_0x72d0('0x12')]);router[_0x72d0('0x10')]('/:id/any_conditions',auth[_0x72d0('0xd')](),controller[_0x72d0('0x13')]);router[_0x72d0('0x10')](_0x72d0('0x14'),auth[_0x72d0('0xd')](),controller[_0x72d0('0x15')]);router['put'](_0x72d0('0xb'),auth[_0x72d0('0xd')](),controller[_0x72d0('0x16')]);router[_0x72d0('0x17')](_0x72d0('0xb'),auth[_0x72d0('0xd')](),controller[_0x72d0('0x18')]);module[_0x72d0('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index d0aa7e0..438f6c7 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 _0xabbe=['STRING','BOOLEAN','exports'];(function(_0x3eeebe,_0x5f232f){var _0x266657=function(_0xdd8fa4){while(--_0xdd8fa4){_0x3eeebe['push'](_0x3eeebe['shift']());}};_0x266657(++_0x5f232f);}(_0xabbe,0xb9));var _0xeabb=function(_0x1551f5,_0x114cdd){_0x1551f5=_0x1551f5-0x0;var _0x17197a=_0xabbe[_0x1551f5];return _0x17197a;};'use strict';var Sequelize=require('sequelize');module[_0xeabb('0x0')]={'name':{'type':Sequelize[_0xeabb('0x1')]},'channel':{'type':Sequelize[_0xeabb('0x1')]},'description':{'type':Sequelize[_0xeabb('0x1')]},'status':{'type':Sequelize[_0xeabb('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xca9e=['STRING','sequelize'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xca9e,0x127));var _0xeca9=function(_0x40eeb1,_0x25506f){_0x40eeb1=_0x40eeb1-0x0;var _0x1d7cac=_0xca9e[_0x40eeb1];return _0x1d7cac;};'use strict';var Sequelize=require(_0xeca9('0x0'));module['exports']={'name':{'type':Sequelize[_0xeca9('0x1')]},'channel':{'type':Sequelize[_0xeca9('0x1')]},'description':{'type':Sequelize[_0xeca9('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 627151c..3d46d44 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 _0x58ab=['fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','rawAttributes','keys','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','order','addAction','TriggerId','getActions','Action','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','get','Triggers','UserProfileResource','destroy','error','stack','name','send','map','Trigger','fieldName','type','key','query','filters','intersection','model'];(function(_0x3626e2,_0x291167){var _0xabfde6=function(_0x105dc4){while(--_0x105dc4){_0x3626e2['push'](_0x3626e2['shift']());}};_0xabfde6(++_0x291167);}(_0x58ab,0x1f4));var _0xb58a=function(_0x44b2c5,_0x4c73ce){_0x44b2c5=_0x44b2c5-0x0;var _0x2fc058=_0x58ab[_0x44b2c5];return _0x2fc058;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb58a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb58a('0x1'));var rp=require(_0xb58a('0x2'));var moment=require(_0xb58a('0x3'));var BPromise=require(_0xb58a('0x4'));var Mustache=require(_0xb58a('0x5'));var util=require(_0xb58a('0x6'));var path=require(_0xb58a('0x7'));var sox=require('sox');var csv=require(_0xb58a('0x8'));var ejs=require(_0xb58a('0x9'));var fs=require('fs');var fs_extra=require(_0xb58a('0xa'));var _=require('lodash');var squel=require(_0xb58a('0xb'));var crypto=require(_0xb58a('0xc'));var jsforce=require(_0xb58a('0xd'));var deskjs=require(_0xb58a('0xe'));var toCsv=require(_0xb58a('0x8'));var querystring=require(_0xb58a('0xf'));var Papa=require(_0xb58a('0x10'));var Redis=require(_0xb58a('0x11'));var authService=require(_0xb58a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb58a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb58a('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xb58a('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4956a3,_0x122fd2){_0x122fd2=_0x122fd2||0xcc;return function(_0x57bab5){if(_0x57bab5){return _0x4956a3[_0xb58a('0x16')](_0x122fd2);}return _0x4956a3[_0xb58a('0x17')](_0x122fd2)[_0xb58a('0x18')]();};}function respondWithResult(_0x2b1792,_0x501a80){_0x501a80=_0x501a80||0xc8;return function(_0x151111){if(_0x151111){return _0x2b1792[_0xb58a('0x17')](_0x501a80)[_0xb58a('0x19')](_0x151111);}};}function respondWithFilteredResult(_0x2bc011,_0x268678){return function(_0x456033){if(_0x456033){var _0x371ccc=typeof _0x268678[_0xb58a('0x1a')]==='undefined'&&typeof _0x268678[_0xb58a('0x1b')]===_0xb58a('0x1c');var _0x54ad24=_0x456033[_0xb58a('0x1d')];var _0x243b84=_0x371ccc?0x0:_0x268678[_0xb58a('0x1a')];var _0x496b5f=_0x371ccc?_0x456033[_0xb58a('0x1d')]:_0x268678[_0xb58a('0x1a')]+_0x268678['limit'];var _0x238b98;if(_0x496b5f>=_0x54ad24){_0x496b5f=_0x54ad24;_0x238b98=0xc8;}else{_0x238b98=0xce;}_0x2bc011[_0xb58a('0x17')](_0x238b98);return _0x2bc011['set'](_0xb58a('0x1e'),_0x243b84+'-'+_0x496b5f+'/'+_0x54ad24)[_0xb58a('0x19')](_0x456033);}return null;};}function patchUpdates(_0xfc9d48){return function(_0x17819f){try{jsonpatch['apply'](_0x17819f,_0xfc9d48,!![]);}catch(_0x321aad){return BPromise[_0xb58a('0x1f')](_0x321aad);}return _0x17819f[_0xb58a('0x20')]();};}function saveUpdates(_0x1ee2d5,_0x909f4){return function(_0x215d29){if(_0x215d29){return _0x215d29[_0xb58a('0x21')](_0x1ee2d5)['then'](function(_0x374840){return _0x374840;});}return null;};}function removeEntity(_0x13eecf,_0x4aa042){return function(_0x1c9b1a){if(_0x1c9b1a){return _0x1c9b1a['destroy']()[_0xb58a('0x22')](function(){var _0x277f01=_0x1c9b1a[_0xb58a('0x23')]({'plain':!![]});var _0x798793=_0xb58a('0x24');return db[_0xb58a('0x25')][_0xb58a('0x26')]({'where':{'type':_0x798793,'resourceId':_0x277f01['id']}})[_0xb58a('0x22')](function(){return _0x1c9b1a;});})[_0xb58a('0x22')](function(){_0x13eecf['status'](0xcc)[_0xb58a('0x18')]();});}};}function handleEntityNotFound(_0x1a40bc,_0x431a65){return function(_0x8e86c2){if(!_0x8e86c2){_0x1a40bc[_0xb58a('0x16')](0x194);}return _0x8e86c2;};}function handleError(_0x40c8bb,_0x542c39){_0x542c39=_0x542c39||0x1f4;return function(_0x3b721a){logger[_0xb58a('0x27')](_0x3b721a[_0xb58a('0x28')]);if(_0x3b721a[_0xb58a('0x29')]){delete _0x3b721a['name'];}_0x40c8bb[_0xb58a('0x17')](_0x542c39)[_0xb58a('0x2a')](_0x3b721a);};}exports['index']=function(_0x5e5b41,_0x4b7718){var _0x565169={},_0x4ff861={},_0x3c9f0d={'count':0x0,'rows':[]};var _0x3dde5a=_[_0xb58a('0x2b')](db[_0xb58a('0x2c')]['rawAttributes'],function(_0x190be2){return{'name':_0x190be2[_0xb58a('0x2d')],'type':_0x190be2[_0xb58a('0x2e')][_0xb58a('0x2f')]};});_0x4ff861['model']=_[_0xb58a('0x2b')](_0x3dde5a,_0xb58a('0x29'));_0x4ff861[_0xb58a('0x30')]=_['keys'](_0x5e5b41[_0xb58a('0x30')]);_0x4ff861[_0xb58a('0x31')]=_[_0xb58a('0x32')](_0x4ff861[_0xb58a('0x33')],_0x4ff861[_0xb58a('0x30')]);_0x565169['attributes']=_[_0xb58a('0x32')](_0x4ff861[_0xb58a('0x33')],qs['fields'](_0x5e5b41['query'][_0xb58a('0x34')]));_0x565169[_0xb58a('0x35')]=_0x565169['attributes'][_0xb58a('0x36')]?_0x565169[_0xb58a('0x35')]:_0x4ff861[_0xb58a('0x33')];if(!_0x5e5b41[_0xb58a('0x30')][_0xb58a('0x37')](_0xb58a('0x38'))){_0x565169['limit']=qs[_0xb58a('0x1b')](_0x5e5b41[_0xb58a('0x30')]['limit']);_0x565169[_0xb58a('0x1a')]=qs[_0xb58a('0x1a')](_0x5e5b41[_0xb58a('0x30')][_0xb58a('0x1a')]);}_0x565169['order']=qs[_0xb58a('0x39')](_0x5e5b41['query'][_0xb58a('0x39')]);_0x565169[_0xb58a('0x3a')]=qs[_0xb58a('0x31')](_[_0xb58a('0x3b')](_0x5e5b41[_0xb58a('0x30')],_0x4ff861[_0xb58a('0x31')]),_0x3dde5a);if(_0x5e5b41[_0xb58a('0x30')]['filter']){_0x565169[_0xb58a('0x3a')]=_[_0xb58a('0x3c')](_0x565169[_0xb58a('0x3a')],{'$or':_['map'](_0x3dde5a,function(_0x5ba9dd){if(_0x5ba9dd[_0xb58a('0x2e')]!==_0xb58a('0x3d')){var _0x2c205c={};_0x2c205c[_0x5ba9dd['name']]={'$like':'%'+_0x5e5b41[_0xb58a('0x30')][_0xb58a('0x3e')]+'%'};return _0x2c205c;}})});}_0x565169=_['merge']({},_0x565169,_0x5e5b41[_0xb58a('0x3f')]);var _0x704a20={'where':_0x565169[_0xb58a('0x3a')]};return db[_0xb58a('0x2c')][_0xb58a('0x1d')](_0x704a20)[_0xb58a('0x22')](function(_0x283d10){_0x3c9f0d[_0xb58a('0x1d')]=_0x283d10;if(_0x5e5b41[_0xb58a('0x30')][_0xb58a('0x40')]){_0x565169[_0xb58a('0x41')]=[{'all':!![]}];}return db[_0xb58a('0x2c')][_0xb58a('0x42')](_0x565169);})[_0xb58a('0x22')](function(_0x5d6e1b){_0x3c9f0d['rows']=_0x5d6e1b;return _0x3c9f0d;})[_0xb58a('0x22')](respondWithFilteredResult(_0x4b7718,_0x565169))[_0xb58a('0x43')](handleError(_0x4b7718,null));};exports['show']=function(_0x586bbf,_0x10fe6c){var _0x109591={'raw':![],'where':{'id':_0x586bbf['params']['id']}},_0x26fc57={};_0x26fc57['model']=_['keys'](db[_0xb58a('0x2c')][_0xb58a('0x44')]);_0x26fc57[_0xb58a('0x30')]=_[_0xb58a('0x45')](_0x586bbf['query']);_0x26fc57[_0xb58a('0x31')]=_[_0xb58a('0x32')](_0x26fc57[_0xb58a('0x33')],_0x26fc57[_0xb58a('0x30')]);_0x109591[_0xb58a('0x35')]=_['intersection'](_0x26fc57[_0xb58a('0x33')],qs[_0xb58a('0x34')](_0x586bbf[_0xb58a('0x30')][_0xb58a('0x34')]));_0x109591[_0xb58a('0x35')]=_0x109591[_0xb58a('0x35')][_0xb58a('0x36')]?_0x109591[_0xb58a('0x35')]:_0x26fc57[_0xb58a('0x33')];if(_0x586bbf[_0xb58a('0x30')][_0xb58a('0x40')]){_0x109591[_0xb58a('0x41')]=[{'all':!![]}];}_0x109591=_[_0xb58a('0x3c')]({},_0x109591,_0x586bbf['options']);return db[_0xb58a('0x2c')][_0xb58a('0x46')](_0x109591)[_0xb58a('0x22')](handleEntityNotFound(_0x10fe6c,null))['then'](respondWithResult(_0x10fe6c,null))[_0xb58a('0x43')](handleError(_0x10fe6c,null));};exports[_0xb58a('0x47')]=function(_0x318922,_0x444cee){return db[_0xb58a('0x2c')][_0xb58a('0x47')](_0x318922[_0xb58a('0x48')],{})[_0xb58a('0x22')](function(_0x26a1c9){var _0x36ec69=_0x318922[_0xb58a('0x49')][_0xb58a('0x23')]({'plain':!![]});if(!_0x36ec69)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x36ec69[_0xb58a('0x4a')]===_0xb58a('0x49')){var _0x2f2e82=_0x26a1c9['get']({'plain':!![]});var _0x2c8b61=_0xb58a('0x24');return db[_0xb58a('0x4b')][_0xb58a('0x46')]({'where':{'name':_0x2c8b61,'userProfileId':_0x36ec69[_0xb58a('0x4c')]},'raw':!![]})[_0xb58a('0x22')](function(_0x5c56b8){if(_0x5c56b8&&_0x5c56b8['autoAssociation']===0x0){return db[_0xb58a('0x25')][_0xb58a('0x47')]({'name':_0x2f2e82[_0xb58a('0x29')],'resourceId':_0x2f2e82['id'],'type':_0x5c56b8[_0xb58a('0x29')],'sectionId':_0x5c56b8['id']},{})[_0xb58a('0x22')](function(){return _0x26a1c9;});}else{return _0x26a1c9;}})['catch'](function(_0x472093){logger['error'](_0xb58a('0x4d'),_0x472093);throw _0x472093;});}return _0x26a1c9;})[_0xb58a('0x22')](respondWithResult(_0x444cee,0xc9))[_0xb58a('0x43')](handleError(_0x444cee,null));};exports[_0xb58a('0x21')]=function(_0x45393b,_0x2cb08d){if(_0x45393b[_0xb58a('0x48')]['id']){delete _0x45393b[_0xb58a('0x48')]['id'];}return db[_0xb58a('0x2c')]['find']({'where':{'id':_0x45393b['params']['id']}})[_0xb58a('0x22')](handleEntityNotFound(_0x2cb08d,null))[_0xb58a('0x22')](saveUpdates(_0x45393b[_0xb58a('0x48')],null))[_0xb58a('0x22')](respondWithResult(_0x2cb08d,null))['catch'](handleError(_0x2cb08d,null));};exports[_0xb58a('0x26')]=function(_0x2fdaac,_0x5c691){return db[_0xb58a('0x2c')][_0xb58a('0x46')]({'where':{'id':_0x2fdaac[_0xb58a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5c691,null))[_0xb58a('0x22')](removeEntity(_0x5c691,null))['catch'](handleError(_0x5c691,null));};exports[_0xb58a('0x4f')]=function(_0xba328d,_0xc469b,_0x5eb32d){if(_0xba328d[_0xb58a('0x48')]['id']){delete _0xba328d[_0xb58a('0x48')]['id'];}return db[_0xb58a('0x2c')][_0xb58a('0x46')]({'where':{'id':_0xba328d[_0xb58a('0x4e')]['id']}})['then'](handleEntityNotFound(_0xc469b,null))[_0xb58a('0x22')](function(_0x581fde){if(_0x581fde){_0xba328d['body'][_0xb58a('0x50')]=_0x581fde['id'];return db[_0xb58a('0x51')][_0xb58a('0x47')](_0xba328d[_0xb58a('0x48')]);}})[_0xb58a('0x22')](respondWithResult(_0xc469b,null))['catch'](handleError(_0xc469b,null));};exports[_0xb58a('0x52')]=function(_0x57e268,_0x1d6705,_0x217d61){if(_0x57e268[_0xb58a('0x48')]['id']){delete _0x57e268[_0xb58a('0x48')]['id'];}return db[_0xb58a('0x2c')][_0xb58a('0x46')]({'where':{'id':_0x57e268[_0xb58a('0x4e')]['id']}})[_0xb58a('0x22')](handleEntityNotFound(_0x1d6705,null))[_0xb58a('0x22')](function(_0x2b286a){if(_0x2b286a){_0x57e268[_0xb58a('0x48')][_0xb58a('0x53')]=_0x2b286a['id'];return db[_0xb58a('0x51')][_0xb58a('0x47')](_0x57e268[_0xb58a('0x48')]);}})[_0xb58a('0x22')](respondWithResult(_0x1d6705,null))[_0xb58a('0x43')](handleError(_0x1d6705,null));};exports[_0xb58a('0x54')]=function(_0x2cbefe,_0x175752,_0x248e1e){var _0xb5f73b={};var _0x117581={};var _0x5d5d33;var _0x7e74f6;return db[_0xb58a('0x2c')][_0xb58a('0x55')]({'where':{'id':_0x2cbefe['params']['id']}})[_0xb58a('0x22')](handleEntityNotFound(_0x175752,null))[_0xb58a('0x22')](function(_0x2937a4){if(_0x2937a4){_0x5d5d33=_0x2937a4;_0x117581[_0xb58a('0x33')]=_[_0xb58a('0x45')](db[_0xb58a('0x51')][_0xb58a('0x44')]);_0x117581[_0xb58a('0x30')]=_[_0xb58a('0x45')](_0x2cbefe['query']);_0x117581[_0xb58a('0x31')]=_[_0xb58a('0x32')](_0x117581['model'],_0x117581['query']);_0xb5f73b['attributes']=_[_0xb58a('0x32')](_0x117581['model'],qs[_0xb58a('0x34')](_0x2cbefe['query'][_0xb58a('0x34')]));_0xb5f73b[_0xb58a('0x35')]=_0xb5f73b[_0xb58a('0x35')][_0xb58a('0x36')]?_0xb5f73b[_0xb58a('0x35')]:_0x117581[_0xb58a('0x33')];_0xb5f73b['order']=qs['sort'](_0x2cbefe[_0xb58a('0x30')][_0xb58a('0x39')]);_0xb5f73b[_0xb58a('0x3a')]=qs[_0xb58a('0x31')](_['pick'](_0x2cbefe[_0xb58a('0x30')],_0x117581['filters']));if(_0x2cbefe['query']['filter']){_0xb5f73b['where']=_[_0xb58a('0x3c')](_0xb5f73b[_0xb58a('0x3a')],{'$or':_[_0xb58a('0x2b')](_0xb5f73b[_0xb58a('0x35')],function(_0x49490e){var _0x383184={};_0x383184[_0x49490e]={'$like':'%'+_0x2cbefe[_0xb58a('0x30')][_0xb58a('0x3e')]+'%'};return _0x383184;})});}_0xb5f73b=_['merge']({},_0xb5f73b,_0x2cbefe['options']);return _0x5d5d33[_0xb58a('0x54')](_0xb5f73b);}})['then'](function(_0x553168){if(_0x553168){_0x7e74f6=_0x553168[_0xb58a('0x36')];if(!_0x2cbefe[_0xb58a('0x30')][_0xb58a('0x37')](_0xb58a('0x38'))){_0xb5f73b[_0xb58a('0x1b')]=qs['limit'](_0x2cbefe[_0xb58a('0x30')]['limit']);_0xb5f73b[_0xb58a('0x1a')]=qs['offset'](_0x2cbefe[_0xb58a('0x30')][_0xb58a('0x1a')]);}return _0x5d5d33['getAllConditions'](_0xb5f73b);}})[_0xb58a('0x22')](function(_0x57fe24){if(_0x57fe24){return _0x57fe24?{'count':_0x7e74f6,'rows':_0x57fe24}:null;}})[_0xb58a('0x22')](respondWithResult(_0x175752,null))[_0xb58a('0x43')](handleError(_0x175752,null));};exports[_0xb58a('0x56')]=function(_0x1e8083,_0x2e53f4,_0x4b2fe1){var _0x513e19={};var _0x31c583={};var _0x25f3bb;var _0x3b28e6;return db[_0xb58a('0x2c')][_0xb58a('0x55')]({'where':{'id':_0x1e8083[_0xb58a('0x4e')]['id']}})[_0xb58a('0x22')](handleEntityNotFound(_0x2e53f4,null))[_0xb58a('0x22')](function(_0x6625b8){if(_0x6625b8){_0x25f3bb=_0x6625b8;_0x31c583['model']=_[_0xb58a('0x45')](db[_0xb58a('0x51')][_0xb58a('0x44')]);_0x31c583[_0xb58a('0x30')]=_[_0xb58a('0x45')](_0x1e8083['query']);_0x31c583[_0xb58a('0x31')]=_['intersection'](_0x31c583['model'],_0x31c583['query']);_0x513e19[_0xb58a('0x35')]=_[_0xb58a('0x32')](_0x31c583[_0xb58a('0x33')],qs[_0xb58a('0x34')](_0x1e8083[_0xb58a('0x30')][_0xb58a('0x34')]));_0x513e19[_0xb58a('0x35')]=_0x513e19[_0xb58a('0x35')][_0xb58a('0x36')]?_0x513e19['attributes']:_0x31c583['model'];_0x513e19[_0xb58a('0x57')]=qs[_0xb58a('0x39')](_0x1e8083['query'][_0xb58a('0x39')]);_0x513e19[_0xb58a('0x3a')]=qs[_0xb58a('0x31')](_[_0xb58a('0x3b')](_0x1e8083[_0xb58a('0x30')],_0x31c583[_0xb58a('0x31')]));if(_0x1e8083['query'][_0xb58a('0x3e')]){_0x513e19[_0xb58a('0x3a')]=_[_0xb58a('0x3c')](_0x513e19[_0xb58a('0x3a')],{'$or':_[_0xb58a('0x2b')](_0x513e19[_0xb58a('0x35')],function(_0x4a55ab){var _0x32037c={};_0x32037c[_0x4a55ab]={'$like':'%'+_0x1e8083[_0xb58a('0x30')][_0xb58a('0x3e')]+'%'};return _0x32037c;})});}_0x513e19=_[_0xb58a('0x3c')]({},_0x513e19,_0x1e8083[_0xb58a('0x3f')]);return _0x25f3bb[_0xb58a('0x56')](_0x513e19);}})[_0xb58a('0x22')](function(_0x21f309){if(_0x21f309){_0x3b28e6=_0x21f309['length'];if(!_0x1e8083[_0xb58a('0x30')][_0xb58a('0x37')](_0xb58a('0x38'))){_0x513e19[_0xb58a('0x1b')]=qs['limit'](_0x1e8083['query'][_0xb58a('0x1b')]);_0x513e19[_0xb58a('0x1a')]=qs[_0xb58a('0x1a')](_0x1e8083[_0xb58a('0x30')][_0xb58a('0x1a')]);}return _0x25f3bb[_0xb58a('0x56')](_0x513e19);}})['then'](function(_0x1b5286){if(_0x1b5286){return _0x1b5286?{'count':_0x3b28e6,'rows':_0x1b5286}:null;}})['then'](respondWithResult(_0x2e53f4,null))[_0xb58a('0x43')](handleError(_0x2e53f4,null));};exports[_0xb58a('0x58')]=function(_0x2d4749,_0x49c835,_0x5e9d97){if(_0x2d4749[_0xb58a('0x48')]['id']){delete _0x2d4749[_0xb58a('0x48')]['id'];}return db['Trigger'][_0xb58a('0x46')]({'where':{'id':_0x2d4749[_0xb58a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x49c835,null))['then'](function(_0x115baa){if(_0x115baa){_0x2d4749[_0xb58a('0x48')][_0xb58a('0x59')]=_0x115baa['id'];return db['Action'][_0xb58a('0x47')](_0x2d4749[_0xb58a('0x48')]);}})[_0xb58a('0x22')](respondWithResult(_0x49c835,null))[_0xb58a('0x43')](handleError(_0x49c835,null));};exports[_0xb58a('0x5a')]=function(_0x2e36dc,_0x3928a9,_0xfc6fd3){var _0x5955b3={};var _0x1145bc={};var _0x307171;var _0x12f7d2;return db['Trigger']['findOne']({'where':{'id':_0x2e36dc[_0xb58a('0x4e')]['id']}})[_0xb58a('0x22')](handleEntityNotFound(_0x3928a9,null))[_0xb58a('0x22')](function(_0x32ce4e){if(_0x32ce4e){_0x307171=_0x32ce4e;_0x1145bc[_0xb58a('0x33')]=_['keys'](db[_0xb58a('0x5b')][_0xb58a('0x44')]);_0x1145bc['query']=_[_0xb58a('0x45')](_0x2e36dc[_0xb58a('0x30')]);_0x1145bc[_0xb58a('0x31')]=_[_0xb58a('0x32')](_0x1145bc['model'],_0x1145bc[_0xb58a('0x30')]);_0x5955b3['attributes']=_['intersection'](_0x1145bc[_0xb58a('0x33')],qs[_0xb58a('0x34')](_0x2e36dc[_0xb58a('0x30')]['fields']));_0x5955b3[_0xb58a('0x35')]=_0x5955b3[_0xb58a('0x35')]['length']?_0x5955b3[_0xb58a('0x35')]:_0x1145bc[_0xb58a('0x33')];_0x5955b3[_0xb58a('0x57')]=qs[_0xb58a('0x39')](_0x2e36dc[_0xb58a('0x30')][_0xb58a('0x39')]);_0x5955b3['where']=qs[_0xb58a('0x31')](_[_0xb58a('0x3b')](_0x2e36dc[_0xb58a('0x30')],_0x1145bc[_0xb58a('0x31')]));if(_0x2e36dc['query'][_0xb58a('0x3e')]){_0x5955b3[_0xb58a('0x3a')]=_[_0xb58a('0x3c')](_0x5955b3[_0xb58a('0x3a')],{'$or':_[_0xb58a('0x2b')](_0x5955b3[_0xb58a('0x35')],function(_0x584707){var _0x5e1c95={};_0x5e1c95[_0x584707]={'$like':'%'+_0x2e36dc[_0xb58a('0x30')]['filter']+'%'};return _0x5e1c95;})});}_0x5955b3=_[_0xb58a('0x3c')]({},_0x5955b3,_0x2e36dc['options']);return _0x307171[_0xb58a('0x5a')](_0x5955b3);}})[_0xb58a('0x22')](function(_0x22a2ec){if(_0x22a2ec){_0x12f7d2=_0x22a2ec[_0xb58a('0x36')];if(!_0x2e36dc[_0xb58a('0x30')]['hasOwnProperty'](_0xb58a('0x38'))){_0x5955b3['limit']=qs[_0xb58a('0x1b')](_0x2e36dc['query']['limit']);_0x5955b3[_0xb58a('0x1a')]=qs['offset'](_0x2e36dc[_0xb58a('0x30')][_0xb58a('0x1a')]);}return _0x307171['getActions'](_0x5955b3);}})['then'](function(_0x3848b0){if(_0x3848b0){return _0x3848b0?{'count':_0x12f7d2,'rows':_0x3848b0}:null;}})[_0xb58a('0x22')](respondWithResult(_0x3928a9,null))[_0xb58a('0x43')](handleError(_0x3928a9,null));}; \ No newline at end of file +var _0xc90f=['fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','catch','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','rimraf','zip-dir','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','Triggers','destroy','name','send','index','map','Trigger','rawAttributes','fieldName','key','model','query','keys','intersection','attributes'];(function(_0x11b9be,_0x3a8373){var _0x32057d=function(_0x4da603){while(--_0x4da603){_0x11b9be['push'](_0x11b9be['shift']());}};_0x32057d(++_0x3a8373);}(_0xc90f,0x1a1));var _0xfc90=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xc90f[_0x580576];return _0x3f55a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfc90('0x0'));var zipdir=require(_0xfc90('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfc90('0x2'));var BPromise=require(_0xfc90('0x3'));var Mustache=require(_0xfc90('0x4'));var util=require(_0xfc90('0x5'));var path=require('path');var sox=require(_0xfc90('0x6'));var csv=require('to-csv');var ejs=require(_0xfc90('0x7'));var fs=require('fs');var fs_extra=require(_0xfc90('0x8'));var _=require(_0xfc90('0x9'));var squel=require('squel');var crypto=require(_0xfc90('0xa'));var jsforce=require(_0xfc90('0xb'));var deskjs=require(_0xfc90('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfc90('0xd'));var Redis=require(_0xfc90('0xe'));var authService=require(_0xfc90('0xf'));var qs=require(_0xfc90('0x10'));var as=require(_0xfc90('0x11'));var hardwareService=require(_0xfc90('0x12'));var logger=require(_0xfc90('0x13'))(_0xfc90('0x14'));var utils=require('../../config/utils');var config=require(_0xfc90('0x15'));var licenseUtil=require(_0xfc90('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16f8ee,_0x42d824){_0x42d824=_0x42d824||0xcc;return function(_0x214e1c){if(_0x214e1c){return _0x16f8ee[_0xfc90('0x17')](_0x42d824);}return _0x16f8ee['status'](_0x42d824)[_0xfc90('0x18')]();};}function respondWithResult(_0x221759,_0x39b22c){_0x39b22c=_0x39b22c||0xc8;return function(_0x4c1f3f){if(_0x4c1f3f){return _0x221759[_0xfc90('0x19')](_0x39b22c)[_0xfc90('0x1a')](_0x4c1f3f);}};}function respondWithFilteredResult(_0x3b28f4,_0x49e2ca){return function(_0x1bf613){if(_0x1bf613){var _0xf77e2e=typeof _0x49e2ca[_0xfc90('0x1b')]===_0xfc90('0x1c')&&typeof _0x49e2ca[_0xfc90('0x1d')]===_0xfc90('0x1c');var _0x49931f=_0x1bf613[_0xfc90('0x1e')];var _0x45e522=_0xf77e2e?0x0:_0x49e2ca[_0xfc90('0x1b')];var _0x4981ff=_0xf77e2e?_0x1bf613[_0xfc90('0x1e')]:_0x49e2ca[_0xfc90('0x1b')]+_0x49e2ca[_0xfc90('0x1d')];var _0x5b2e9c;if(_0x4981ff>=_0x49931f){_0x4981ff=_0x49931f;_0x5b2e9c=0xc8;}else{_0x5b2e9c=0xce;}_0x3b28f4[_0xfc90('0x19')](_0x5b2e9c);return _0x3b28f4[_0xfc90('0x1f')](_0xfc90('0x20'),_0x45e522+'-'+_0x4981ff+'/'+_0x49931f)['json'](_0x1bf613);}return null;};}function patchUpdates(_0x5d2089){return function(_0x57b0ff){try{jsonpatch[_0xfc90('0x21')](_0x57b0ff,_0x5d2089,!![]);}catch(_0x2810fe){return BPromise[_0xfc90('0x22')](_0x2810fe);}return _0x57b0ff['save']();};}function saveUpdates(_0x3e4091,_0x49dff0){return function(_0x328b66){if(_0x328b66){return _0x328b66[_0xfc90('0x23')](_0x3e4091)[_0xfc90('0x24')](function(_0x3cc2c9){return _0x3cc2c9;});}return null;};}function removeEntity(_0x42607e,_0x16a054){return function(_0x36bf30){if(_0x36bf30){return _0x36bf30['destroy']()['then'](function(){var _0x3fcdb2=_0x36bf30[_0xfc90('0x25')]({'plain':!![]});var _0x6dd651=_0xfc90('0x26');return db['UserProfileResource'][_0xfc90('0x27')]({'where':{'type':_0x6dd651,'resourceId':_0x3fcdb2['id']}})[_0xfc90('0x24')](function(){return _0x36bf30;});})[_0xfc90('0x24')](function(){_0x42607e[_0xfc90('0x19')](0xcc)[_0xfc90('0x18')]();});}};}function handleEntityNotFound(_0x32f134,_0x192604){return function(_0x5491fe){if(!_0x5491fe){_0x32f134[_0xfc90('0x17')](0x194);}return _0x5491fe;};}function handleError(_0xeb3b54,_0xdc3c3b){_0xdc3c3b=_0xdc3c3b||0x1f4;return function(_0x6fd14b){logger['error'](_0x6fd14b['stack']);if(_0x6fd14b[_0xfc90('0x28')]){delete _0x6fd14b[_0xfc90('0x28')];}_0xeb3b54[_0xfc90('0x19')](_0xdc3c3b)[_0xfc90('0x29')](_0x6fd14b);};}exports[_0xfc90('0x2a')]=function(_0x4e0c93,_0x3a67a2){var _0x2ea493={},_0x100c8d={},_0x2bbf46={'count':0x0,'rows':[]};var _0x3ce7d4=_[_0xfc90('0x2b')](db[_0xfc90('0x2c')][_0xfc90('0x2d')],function(_0x11a7b9){return{'name':_0x11a7b9[_0xfc90('0x2e')],'type':_0x11a7b9['type'][_0xfc90('0x2f')]};});_0x100c8d[_0xfc90('0x30')]=_['map'](_0x3ce7d4,'name');_0x100c8d[_0xfc90('0x31')]=_[_0xfc90('0x32')](_0x4e0c93[_0xfc90('0x31')]);_0x100c8d['filters']=_[_0xfc90('0x33')](_0x100c8d[_0xfc90('0x30')],_0x100c8d['query']);_0x2ea493[_0xfc90('0x34')]=_[_0xfc90('0x33')](_0x100c8d[_0xfc90('0x30')],qs[_0xfc90('0x35')](_0x4e0c93[_0xfc90('0x31')][_0xfc90('0x35')]));_0x2ea493[_0xfc90('0x34')]=_0x2ea493[_0xfc90('0x34')][_0xfc90('0x36')]?_0x2ea493[_0xfc90('0x34')]:_0x100c8d[_0xfc90('0x30')];if(!_0x4e0c93[_0xfc90('0x31')][_0xfc90('0x37')](_0xfc90('0x38'))){_0x2ea493[_0xfc90('0x1d')]=qs[_0xfc90('0x1d')](_0x4e0c93[_0xfc90('0x31')][_0xfc90('0x1d')]);_0x2ea493[_0xfc90('0x1b')]=qs[_0xfc90('0x1b')](_0x4e0c93['query'][_0xfc90('0x1b')]);}_0x2ea493[_0xfc90('0x39')]=qs['sort'](_0x4e0c93[_0xfc90('0x31')][_0xfc90('0x3a')]);_0x2ea493['where']=qs['filters'](_[_0xfc90('0x3b')](_0x4e0c93['query'],_0x100c8d[_0xfc90('0x3c')]),_0x3ce7d4);if(_0x4e0c93[_0xfc90('0x31')][_0xfc90('0x3d')]){_0x2ea493[_0xfc90('0x3e')]=_[_0xfc90('0x3f')](_0x2ea493[_0xfc90('0x3e')],{'$or':_[_0xfc90('0x2b')](_0x3ce7d4,function(_0x158175){if(_0x158175[_0xfc90('0x40')]!==_0xfc90('0x41')){var _0x522183={};_0x522183[_0x158175[_0xfc90('0x28')]]={'$like':'%'+_0x4e0c93['query'][_0xfc90('0x3d')]+'%'};return _0x522183;}})});}_0x2ea493=_[_0xfc90('0x3f')]({},_0x2ea493,_0x4e0c93[_0xfc90('0x42')]);var _0x468c86={'where':_0x2ea493[_0xfc90('0x3e')]};return db[_0xfc90('0x2c')][_0xfc90('0x1e')](_0x468c86)['then'](function(_0x4b295f){_0x2bbf46[_0xfc90('0x1e')]=_0x4b295f;if(_0x4e0c93[_0xfc90('0x31')][_0xfc90('0x43')]){_0x2ea493['include']=[{'all':!![]}];}return db[_0xfc90('0x2c')][_0xfc90('0x44')](_0x2ea493);})[_0xfc90('0x24')](function(_0x4124c3){_0x2bbf46['rows']=_0x4124c3;return _0x2bbf46;})['then'](respondWithFilteredResult(_0x3a67a2,_0x2ea493))[_0xfc90('0x45')](handleError(_0x3a67a2,null));};exports['show']=function(_0x1ef84a,_0x2fe027){var _0x578e92={'raw':![],'where':{'id':_0x1ef84a[_0xfc90('0x46')]['id']}},_0x5082a0={};_0x5082a0['model']=_['keys'](db[_0xfc90('0x2c')][_0xfc90('0x2d')]);_0x5082a0['query']=_[_0xfc90('0x32')](_0x1ef84a[_0xfc90('0x31')]);_0x5082a0[_0xfc90('0x3c')]=_[_0xfc90('0x33')](_0x5082a0[_0xfc90('0x30')],_0x5082a0[_0xfc90('0x31')]);_0x578e92[_0xfc90('0x34')]=_['intersection'](_0x5082a0[_0xfc90('0x30')],qs[_0xfc90('0x35')](_0x1ef84a['query']['fields']));_0x578e92[_0xfc90('0x34')]=_0x578e92[_0xfc90('0x34')]['length']?_0x578e92[_0xfc90('0x34')]:_0x5082a0['model'];if(_0x1ef84a['query']['includeAll']){_0x578e92[_0xfc90('0x47')]=[{'all':!![]}];}_0x578e92=_[_0xfc90('0x3f')]({},_0x578e92,_0x1ef84a[_0xfc90('0x42')]);return db[_0xfc90('0x2c')][_0xfc90('0x48')](_0x578e92)[_0xfc90('0x24')](handleEntityNotFound(_0x2fe027,null))['then'](respondWithResult(_0x2fe027,null))[_0xfc90('0x45')](handleError(_0x2fe027,null));};exports[_0xfc90('0x49')]=function(_0x3233ff,_0xbddc8a){return db[_0xfc90('0x2c')]['create'](_0x3233ff[_0xfc90('0x4a')],{})[_0xfc90('0x24')](function(_0x1ae4b1){var _0x40a9ef=_0x3233ff[_0xfc90('0x4b')]['get']({'plain':!![]});if(!_0x40a9ef)throw new Error(_0xfc90('0x4c'));if(_0x40a9ef[_0xfc90('0x4d')]===_0xfc90('0x4b')){var _0x1552bc=_0x1ae4b1['get']({'plain':!![]});var _0x433705=_0xfc90('0x26');return db[_0xfc90('0x4e')]['find']({'where':{'name':_0x433705,'userProfileId':_0x40a9ef['userProfileId']},'raw':!![]})[_0xfc90('0x24')](function(_0x2c7ff6){if(_0x2c7ff6&&_0x2c7ff6[_0xfc90('0x4f')]===0x0){return db[_0xfc90('0x50')][_0xfc90('0x49')]({'name':_0x1552bc[_0xfc90('0x28')],'resourceId':_0x1552bc['id'],'type':_0x2c7ff6[_0xfc90('0x28')],'sectionId':_0x2c7ff6['id']},{})['then'](function(){return _0x1ae4b1;});}else{return _0x1ae4b1;}})['catch'](function(_0x42e835){logger[_0xfc90('0x51')](_0xfc90('0x52'),_0x42e835);throw _0x42e835;});}return _0x1ae4b1;})[_0xfc90('0x24')](respondWithResult(_0xbddc8a,0xc9))[_0xfc90('0x45')](handleError(_0xbddc8a,null));};exports['update']=function(_0x110dc2,_0x136aa0){if(_0x110dc2['body']['id']){delete _0x110dc2[_0xfc90('0x4a')]['id'];}return db[_0xfc90('0x2c')][_0xfc90('0x48')]({'where':{'id':_0x110dc2[_0xfc90('0x46')]['id']}})[_0xfc90('0x24')](handleEntityNotFound(_0x136aa0,null))[_0xfc90('0x24')](saveUpdates(_0x110dc2[_0xfc90('0x4a')],null))['then'](respondWithResult(_0x136aa0,null))[_0xfc90('0x45')](handleError(_0x136aa0,null));};exports[_0xfc90('0x27')]=function(_0x2b5202,_0x530297){return db[_0xfc90('0x2c')][_0xfc90('0x48')]({'where':{'id':_0x2b5202[_0xfc90('0x46')]['id']}})[_0xfc90('0x24')](handleEntityNotFound(_0x530297,null))[_0xfc90('0x24')](removeEntity(_0x530297,null))['catch'](handleError(_0x530297,null));};exports[_0xfc90('0x53')]=function(_0x30bb5f,_0x21ebf6,_0x12f269){if(_0x30bb5f['body']['id']){delete _0x30bb5f['body']['id'];}return db[_0xfc90('0x2c')]['find']({'where':{'id':_0x30bb5f['params']['id']}})['then'](handleEntityNotFound(_0x21ebf6,null))['then'](function(_0x39c6ae){if(_0x39c6ae){_0x30bb5f[_0xfc90('0x4a')][_0xfc90('0x54')]=_0x39c6ae['id'];return db[_0xfc90('0x55')]['create'](_0x30bb5f[_0xfc90('0x4a')]);}})[_0xfc90('0x24')](respondWithResult(_0x21ebf6,null))[_0xfc90('0x45')](handleError(_0x21ebf6,null));};exports[_0xfc90('0x56')]=function(_0x1226f3,_0x3bb090,_0x2b0687){if(_0x1226f3[_0xfc90('0x4a')]['id']){delete _0x1226f3[_0xfc90('0x4a')]['id'];}return db[_0xfc90('0x2c')][_0xfc90('0x48')]({'where':{'id':_0x1226f3[_0xfc90('0x46')]['id']}})['then'](handleEntityNotFound(_0x3bb090,null))[_0xfc90('0x24')](function(_0x23498d){if(_0x23498d){_0x1226f3[_0xfc90('0x4a')]['TriggerAnyId']=_0x23498d['id'];return db[_0xfc90('0x55')]['create'](_0x1226f3['body']);}})[_0xfc90('0x24')](respondWithResult(_0x3bb090,null))[_0xfc90('0x45')](handleError(_0x3bb090,null));};exports[_0xfc90('0x57')]=function(_0x12b71e,_0x3411a8,_0x2d49b6){var _0x320329={};var _0x981ea3={};var _0x296b91;var _0x1cdeef;return db['Trigger'][_0xfc90('0x58')]({'where':{'id':_0x12b71e[_0xfc90('0x46')]['id']}})[_0xfc90('0x24')](handleEntityNotFound(_0x3411a8,null))[_0xfc90('0x24')](function(_0x1fb9a4){if(_0x1fb9a4){_0x296b91=_0x1fb9a4;_0x981ea3[_0xfc90('0x30')]=_['keys'](db['Condition'][_0xfc90('0x2d')]);_0x981ea3[_0xfc90('0x31')]=_[_0xfc90('0x32')](_0x12b71e['query']);_0x981ea3[_0xfc90('0x3c')]=_[_0xfc90('0x33')](_0x981ea3['model'],_0x981ea3[_0xfc90('0x31')]);_0x320329['attributes']=_[_0xfc90('0x33')](_0x981ea3['model'],qs[_0xfc90('0x35')](_0x12b71e[_0xfc90('0x31')][_0xfc90('0x35')]));_0x320329[_0xfc90('0x34')]=_0x320329[_0xfc90('0x34')][_0xfc90('0x36')]?_0x320329['attributes']:_0x981ea3['model'];_0x320329[_0xfc90('0x39')]=qs[_0xfc90('0x3a')](_0x12b71e['query']['sort']);_0x320329['where']=qs[_0xfc90('0x3c')](_[_0xfc90('0x3b')](_0x12b71e['query'],_0x981ea3[_0xfc90('0x3c')]));if(_0x12b71e[_0xfc90('0x31')][_0xfc90('0x3d')]){_0x320329[_0xfc90('0x3e')]=_[_0xfc90('0x3f')](_0x320329['where'],{'$or':_[_0xfc90('0x2b')](_0x320329[_0xfc90('0x34')],function(_0x1add71){var _0x3fb5b9={};_0x3fb5b9[_0x1add71]={'$like':'%'+_0x12b71e['query'][_0xfc90('0x3d')]+'%'};return _0x3fb5b9;})});}_0x320329=_[_0xfc90('0x3f')]({},_0x320329,_0x12b71e['options']);return _0x296b91[_0xfc90('0x57')](_0x320329);}})[_0xfc90('0x24')](function(_0x122578){if(_0x122578){_0x1cdeef=_0x122578[_0xfc90('0x36')];if(!_0x12b71e['query'][_0xfc90('0x37')](_0xfc90('0x38'))){_0x320329[_0xfc90('0x1d')]=qs[_0xfc90('0x1d')](_0x12b71e[_0xfc90('0x31')][_0xfc90('0x1d')]);_0x320329[_0xfc90('0x1b')]=qs[_0xfc90('0x1b')](_0x12b71e[_0xfc90('0x31')][_0xfc90('0x1b')]);}return _0x296b91[_0xfc90('0x57')](_0x320329);}})[_0xfc90('0x24')](function(_0x3d61f2){if(_0x3d61f2){return _0x3d61f2?{'count':_0x1cdeef,'rows':_0x3d61f2}:null;}})[_0xfc90('0x24')](respondWithResult(_0x3411a8,null))['catch'](handleError(_0x3411a8,null));};exports[_0xfc90('0x59')]=function(_0x41f24a,_0x55fdb1,_0x12144c){var _0x26daf9={};var _0x3c1628={};var _0x5099bc;var _0x148e82;return db[_0xfc90('0x2c')][_0xfc90('0x58')]({'where':{'id':_0x41f24a[_0xfc90('0x46')]['id']}})[_0xfc90('0x24')](handleEntityNotFound(_0x55fdb1,null))[_0xfc90('0x24')](function(_0x3d9633){if(_0x3d9633){_0x5099bc=_0x3d9633;_0x3c1628[_0xfc90('0x30')]=_[_0xfc90('0x32')](db['Condition'][_0xfc90('0x2d')]);_0x3c1628[_0xfc90('0x31')]=_[_0xfc90('0x32')](_0x41f24a[_0xfc90('0x31')]);_0x3c1628[_0xfc90('0x3c')]=_[_0xfc90('0x33')](_0x3c1628[_0xfc90('0x30')],_0x3c1628[_0xfc90('0x31')]);_0x26daf9[_0xfc90('0x34')]=_[_0xfc90('0x33')](_0x3c1628['model'],qs['fields'](_0x41f24a[_0xfc90('0x31')][_0xfc90('0x35')]));_0x26daf9['attributes']=_0x26daf9[_0xfc90('0x34')][_0xfc90('0x36')]?_0x26daf9[_0xfc90('0x34')]:_0x3c1628[_0xfc90('0x30')];_0x26daf9[_0xfc90('0x39')]=qs[_0xfc90('0x3a')](_0x41f24a['query'][_0xfc90('0x3a')]);_0x26daf9[_0xfc90('0x3e')]=qs[_0xfc90('0x3c')](_[_0xfc90('0x3b')](_0x41f24a[_0xfc90('0x31')],_0x3c1628[_0xfc90('0x3c')]));if(_0x41f24a[_0xfc90('0x31')][_0xfc90('0x3d')]){_0x26daf9[_0xfc90('0x3e')]=_[_0xfc90('0x3f')](_0x26daf9[_0xfc90('0x3e')],{'$or':_[_0xfc90('0x2b')](_0x26daf9[_0xfc90('0x34')],function(_0x4a461c){var _0x52df59={};_0x52df59[_0x4a461c]={'$like':'%'+_0x41f24a['query'][_0xfc90('0x3d')]+'%'};return _0x52df59;})});}_0x26daf9=_[_0xfc90('0x3f')]({},_0x26daf9,_0x41f24a[_0xfc90('0x42')]);return _0x5099bc[_0xfc90('0x59')](_0x26daf9);}})[_0xfc90('0x24')](function(_0x13da49){if(_0x13da49){_0x148e82=_0x13da49[_0xfc90('0x36')];if(!_0x41f24a['query'][_0xfc90('0x37')](_0xfc90('0x38'))){_0x26daf9[_0xfc90('0x1d')]=qs[_0xfc90('0x1d')](_0x41f24a[_0xfc90('0x31')][_0xfc90('0x1d')]);_0x26daf9[_0xfc90('0x1b')]=qs['offset'](_0x41f24a[_0xfc90('0x31')][_0xfc90('0x1b')]);}return _0x5099bc[_0xfc90('0x59')](_0x26daf9);}})[_0xfc90('0x24')](function(_0x1c1fcd){if(_0x1c1fcd){return _0x1c1fcd?{'count':_0x148e82,'rows':_0x1c1fcd}:null;}})['then'](respondWithResult(_0x55fdb1,null))[_0xfc90('0x45')](handleError(_0x55fdb1,null));};exports[_0xfc90('0x5a')]=function(_0x3b2855,_0x24408b,_0x4e3d1f){if(_0x3b2855[_0xfc90('0x4a')]['id']){delete _0x3b2855['body']['id'];}return db[_0xfc90('0x2c')][_0xfc90('0x48')]({'where':{'id':_0x3b2855[_0xfc90('0x46')]['id']}})[_0xfc90('0x24')](handleEntityNotFound(_0x24408b,null))[_0xfc90('0x24')](function(_0x4daa2b){if(_0x4daa2b){_0x3b2855['body'][_0xfc90('0x5b')]=_0x4daa2b['id'];return db[_0xfc90('0x5c')]['create'](_0x3b2855[_0xfc90('0x4a')]);}})[_0xfc90('0x24')](respondWithResult(_0x24408b,null))[_0xfc90('0x45')](handleError(_0x24408b,null));};exports[_0xfc90('0x5d')]=function(_0x18208e,_0x113e55,_0x5a8881){var _0x30955b={};var _0x5ab890={};var _0x300477;var _0x15c6a0;return db[_0xfc90('0x2c')][_0xfc90('0x58')]({'where':{'id':_0x18208e[_0xfc90('0x46')]['id']}})['then'](handleEntityNotFound(_0x113e55,null))[_0xfc90('0x24')](function(_0x3bba2a){if(_0x3bba2a){_0x300477=_0x3bba2a;_0x5ab890[_0xfc90('0x30')]=_[_0xfc90('0x32')](db[_0xfc90('0x5c')][_0xfc90('0x2d')]);_0x5ab890['query']=_['keys'](_0x18208e['query']);_0x5ab890['filters']=_[_0xfc90('0x33')](_0x5ab890[_0xfc90('0x30')],_0x5ab890[_0xfc90('0x31')]);_0x30955b[_0xfc90('0x34')]=_[_0xfc90('0x33')](_0x5ab890[_0xfc90('0x30')],qs['fields'](_0x18208e[_0xfc90('0x31')][_0xfc90('0x35')]));_0x30955b[_0xfc90('0x34')]=_0x30955b[_0xfc90('0x34')]['length']?_0x30955b[_0xfc90('0x34')]:_0x5ab890['model'];_0x30955b[_0xfc90('0x39')]=qs[_0xfc90('0x3a')](_0x18208e['query'][_0xfc90('0x3a')]);_0x30955b[_0xfc90('0x3e')]=qs[_0xfc90('0x3c')](_[_0xfc90('0x3b')](_0x18208e['query'],_0x5ab890[_0xfc90('0x3c')]));if(_0x18208e['query'][_0xfc90('0x3d')]){_0x30955b['where']=_[_0xfc90('0x3f')](_0x30955b['where'],{'$or':_[_0xfc90('0x2b')](_0x30955b['attributes'],function(_0x2c97bf){var _0x3b850c={};_0x3b850c[_0x2c97bf]={'$like':'%'+_0x18208e['query'][_0xfc90('0x3d')]+'%'};return _0x3b850c;})});}_0x30955b=_['merge']({},_0x30955b,_0x18208e[_0xfc90('0x42')]);return _0x300477[_0xfc90('0x5d')](_0x30955b);}})['then'](function(_0x12077a){if(_0x12077a){_0x15c6a0=_0x12077a[_0xfc90('0x36')];if(!_0x18208e['query'][_0xfc90('0x37')]('nolimit')){_0x30955b[_0xfc90('0x1d')]=qs[_0xfc90('0x1d')](_0x18208e[_0xfc90('0x31')]['limit']);_0x30955b['offset']=qs[_0xfc90('0x1b')](_0x18208e[_0xfc90('0x31')][_0xfc90('0x1b')]);}return _0x300477['getActions'](_0x30955b);}})['then'](function(_0x1d8275){if(_0x1d8275){return _0x1d8275?{'count':_0x15c6a0,'rows':_0x1d8275}:null;}})[_0xfc90('0x24')](respondWithResult(_0x113e55,null))[_0xfc90('0x45')](handleError(_0x113e55,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 158a33d..24cc6f0 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 _0xb13b=['api','moment','request-promise','path','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger'];(function(_0x4b8b3d,_0x252c12){var _0x4498f3=function(_0x42f758){while(--_0x42f758){_0x4b8b3d['push'](_0x4b8b3d['shift']());}};_0x4498f3(++_0x252c12);}(_0xb13b,0x1de));var _0xbb13=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xb13b[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xbb13('0x0'));var util=require(_0xbb13('0x1'));var logger=require(_0xbb13('0x2'))(_0xbb13('0x3'));var moment=require(_0xbb13('0x4'));var BPromise=require('bluebird');var rp=require(_0xbb13('0x5'));var fs=require('fs');var path=require(_0xbb13('0x6'));var rimraf=require('rimraf');var config=require(_0xbb13('0x7'));var attributes=require(_0xbb13('0x8'));module[_0xbb13('0x9')]=function(_0x464c50,_0x296632){return _0x464c50[_0xbb13('0xa')](_0xbb13('0xb'),attributes,{'tableName':_0xbb13('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x165d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define'];(function(_0x10d914,_0x57bc1f){var _0x40f437=function(_0x3e3275){while(--_0x3e3275){_0x10d914['push'](_0x10d914['shift']());}};_0x40f437(++_0x57bc1f);}(_0x165d,0x14a));var _0xd165=function(_0x3567a1,_0x28aed2){_0x3567a1=_0x3567a1-0x0;var _0x5dba0f=_0x165d[_0x3567a1];return _0x5dba0f;};'use strict';var _=require(_0xd165('0x0'));var util=require(_0xd165('0x1'));var logger=require(_0xd165('0x2'))(_0xd165('0x3'));var moment=require(_0xd165('0x4'));var BPromise=require(_0xd165('0x5'));var rp=require(_0xd165('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd165('0x7'));var config=require(_0xd165('0x8'));var attributes=require('./trigger.attributes');module['exports']=function(_0x5435f9,_0x42d256){return _0x5435f9[_0xd165('0x9')]('Trigger',attributes,{'tableName':'tools_triggers','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 db8afeb..27bca6d 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 _0x9023=['model','attributes','catch','ShowTrigger','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','GetTrigger','Trigger','findAll','options','where','limit','include','map'];(function(_0x3816c2,_0xb221e1){var _0x144669=function(_0x149c29){while(--_0x149c29){_0x3816c2['push'](_0x3816c2['shift']());}};_0x144669(++_0xb221e1);}(_0x9023,0x115));var _0x3902=function(_0x12c989,_0x53fee1){_0x12c989=_0x12c989-0x0;var _0x27777e=_0x9023[_0x12c989];return _0x27777e;};'use strict';var _=require(_0x3902('0x0'));var util=require(_0x3902('0x1'));var moment=require(_0x3902('0x2'));var BPromise=require(_0x3902('0x3'));var rs=require(_0x3902('0x4'));var fs=require('fs');var Redis=require(_0x3902('0x5'));var db=require(_0x3902('0x6'))['db'];var utils=require(_0x3902('0x7'));var logger=require('../../config/logger')(_0x3902('0x8'));var config=require(_0x3902('0x9'));var jayson=require(_0x3902('0xa'));var client=jayson[_0x3902('0xb')][_0x3902('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x491836,_0x3d4def,_0x2d03bf){return new BPromise(function(_0x4e40e1,_0x320d48){return client['request'](_0x491836,_0x2d03bf)[_0x3902('0xd')](function(_0x3cf703){logger['info'](_0x3902('0xe'),_0x3d4def,_0x3902('0xf'));logger[_0x3902('0x10')]('Trigger,\x20%s,\x20%s,\x20%s',_0x3d4def,'request\x20sent',JSON[_0x3902('0x11')](_0x3cf703));if(_0x3cf703['error']){if(_0x3cf703['error']['code']===0x1f4){logger[_0x3902('0x12')]('Trigger,\x20%s,\x20%s',_0x3d4def,_0x3cf703[_0x3902('0x12')]['message']);return _0x320d48(_0x3cf703[_0x3902('0x12')][_0x3902('0x13')]);}logger[_0x3902('0x12')]('Trigger,\x20%s,\x20%s',_0x3d4def,_0x3cf703['error'][_0x3902('0x13')]);return _0x4e40e1(_0x3cf703[_0x3902('0x12')][_0x3902('0x13')]);}else{logger[_0x3902('0x14')](_0x3902('0xe'),_0x3d4def,_0x3902('0xf'));_0x4e40e1(_0x3cf703['result'][_0x3902('0x13')]);}})['catch'](function(_0x3a3c7e){logger[_0x3902('0x12')](_0x3902('0xe'),_0x3d4def,_0x3a3c7e);_0x320d48(_0x3a3c7e);});});}exports[_0x3902('0x15')]=function(_0x445a10){var _0xdd44d6=this;return new Promise(function(_0x3974fd,_0x3ce78e){return db[_0x3902('0x16')][_0x3902('0x17')]({'raw':_0x445a10[_0x3902('0x18')]?_0x445a10['options']['raw']===undefined?!![]:![]:!![],'where':_0x445a10[_0x3902('0x18')]?_0x445a10[_0x3902('0x18')][_0x3902('0x19')]||null:null,'attributes':_0x445a10[_0x3902('0x18')]?_0x445a10[_0x3902('0x18')]['attributes']||null:null,'limit':_0x445a10[_0x3902('0x18')]?_0x445a10['options'][_0x3902('0x1a')]||null:null,'include':_0x445a10['options']?_0x445a10['options'][_0x3902('0x1b')]?_[_0x3902('0x1c')](_0x445a10[_0x3902('0x18')][_0x3902('0x1b')],function(_0x485b37){return{'model':db[_0x485b37[_0x3902('0x1d')]],'as':_0x485b37['as'],'attributes':_0x485b37[_0x3902('0x1e')],'include':_0x485b37[_0x3902('0x1b')]?_['map'](_0x485b37[_0x3902('0x1b')],function(_0x5efa39){return{'model':db[_0x5efa39[_0x3902('0x1d')]],'as':_0x5efa39['as'],'attributes':_0x5efa39[_0x3902('0x1e')],'include':_0x5efa39[_0x3902('0x1b')]?_['map'](_0x5efa39[_0x3902('0x1b')],function(_0x45012d){return{'model':db[_0x45012d[_0x3902('0x1d')]],'as':_0x45012d['as'],'attributes':_0x45012d[_0x3902('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3902('0xd')](function(_0x3bc1f2){logger['info'](_0x3902('0x15'),_0x445a10);logger[_0x3902('0x10')]('GetTrigger',_0x445a10,JSON['stringify'](_0x3bc1f2));_0x3974fd(_0x3bc1f2);})[_0x3902('0x1f')](function(_0x26d90c){logger[_0x3902('0x12')](_0x3902('0x15'),_0x26d90c[_0x3902('0x13')],_0x445a10);_0x3ce78e(_0xdd44d6[_0x3902('0x12')](0x1f4,_0x26d90c['message']));});});};exports[_0x3902('0x20')]=function(_0x37334c){var _0x4b5c67=this;return new Promise(function(_0x3dc43d,_0x29714f){return db[_0x3902('0x16')]['find']({'raw':_0x37334c[_0x3902('0x18')]?_0x37334c[_0x3902('0x18')][_0x3902('0x21')]===undefined?!![]:![]:!![],'where':_0x37334c[_0x3902('0x18')]?_0x37334c[_0x3902('0x18')][_0x3902('0x19')]||null:null,'attributes':_0x37334c['options']?_0x37334c['options'][_0x3902('0x1e')]||null:null,'include':_0x37334c[_0x3902('0x18')]?_0x37334c[_0x3902('0x18')][_0x3902('0x1b')]?_[_0x3902('0x1c')](_0x37334c[_0x3902('0x18')][_0x3902('0x1b')],function(_0xed3a43){return{'model':db[_0xed3a43[_0x3902('0x1d')]],'as':_0xed3a43['as'],'attributes':_0xed3a43[_0x3902('0x1e')],'include':_0xed3a43[_0x3902('0x1b')]?_['map'](_0xed3a43['include'],function(_0x3d7734){return{'model':db[_0x3d7734[_0x3902('0x1d')]],'as':_0x3d7734['as'],'attributes':_0x3d7734[_0x3902('0x1e')],'include':_0x3d7734[_0x3902('0x1b')]?_[_0x3902('0x1c')](_0x3d7734[_0x3902('0x1b')],function(_0x198aa3){return{'model':db[_0x198aa3['model']],'as':_0x198aa3['as'],'attributes':_0x198aa3[_0x3902('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4998d5){logger[_0x3902('0x14')](_0x3902('0x20'),_0x37334c);logger[_0x3902('0x10')](_0x3902('0x20'),_0x37334c,JSON[_0x3902('0x11')](_0x4998d5));_0x3dc43d(_0x4998d5);})['catch'](function(_0x33f95a){logger[_0x3902('0x12')](_0x3902('0x20'),_0x33f95a['message'],_0x37334c);_0x29714f(_0x4b5c67['error'](0x1f4,_0x33f95a['message']));});});}; \ No newline at end of file +var _0x39f7=['info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetTrigger','Trigger','options','raw','where','limit','include','map','model','attributes','stringify','ShowTrigger','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x53f402,_0x326920){var _0x45a76d=function(_0x51f590){while(--_0x51f590){_0x53f402['push'](_0x53f402['shift']());}};_0x45a76d(++_0x326920);}(_0x39f7,0xcf));var _0x739f=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0x39f7[_0x4f2c3a];return _0x17d91c;};'use strict';var _=require(_0x739f('0x0'));var util=require(_0x739f('0x1'));var moment=require(_0x739f('0x2'));var BPromise=require(_0x739f('0x3'));var rs=require(_0x739f('0x4'));var fs=require('fs');var Redis=require(_0x739f('0x5'));var db=require(_0x739f('0x6'))['db'];var utils=require(_0x739f('0x7'));var logger=require(_0x739f('0x8'))(_0x739f('0x9'));var config=require('../../config/environment');var jayson=require(_0x739f('0xa'));var client=jayson[_0x739f('0xb')][_0x739f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xcf0655,_0x5b2f7a,_0x3d69f0){return new BPromise(function(_0x1f749f,_0x4b1883){return client[_0x739f('0xd')](_0xcf0655,_0x3d69f0)[_0x739f('0xe')](function(_0x3b0971){logger[_0x739f('0xf')](_0x739f('0x10'),_0x5b2f7a,_0x739f('0x11'));logger[_0x739f('0x12')](_0x739f('0x13'),_0x5b2f7a,_0x739f('0x11'),JSON['stringify'](_0x3b0971));if(_0x3b0971['error']){if(_0x3b0971[_0x739f('0x14')][_0x739f('0x15')]===0x1f4){logger[_0x739f('0x14')](_0x739f('0x10'),_0x5b2f7a,_0x3b0971['error'][_0x739f('0x16')]);return _0x4b1883(_0x3b0971[_0x739f('0x14')][_0x739f('0x16')]);}logger[_0x739f('0x14')](_0x739f('0x10'),_0x5b2f7a,_0x3b0971[_0x739f('0x14')]['message']);return _0x1f749f(_0x3b0971[_0x739f('0x14')]['message']);}else{logger[_0x739f('0xf')]('Trigger,\x20%s,\x20%s',_0x5b2f7a,'request\x20sent');_0x1f749f(_0x3b0971['result'][_0x739f('0x16')]);}})[_0x739f('0x17')](function(_0x4301ee){logger[_0x739f('0x14')]('Trigger,\x20%s,\x20%s',_0x5b2f7a,_0x4301ee);_0x4b1883(_0x4301ee);});});}exports[_0x739f('0x18')]=function(_0x5bf985){var _0x3c4ce9=this;return new Promise(function(_0x97e35a,_0x3abb70){return db[_0x739f('0x19')]['findAll']({'raw':_0x5bf985[_0x739f('0x1a')]?_0x5bf985[_0x739f('0x1a')][_0x739f('0x1b')]===undefined?!![]:![]:!![],'where':_0x5bf985[_0x739f('0x1a')]?_0x5bf985['options'][_0x739f('0x1c')]||null:null,'attributes':_0x5bf985[_0x739f('0x1a')]?_0x5bf985[_0x739f('0x1a')]['attributes']||null:null,'limit':_0x5bf985[_0x739f('0x1a')]?_0x5bf985[_0x739f('0x1a')][_0x739f('0x1d')]||null:null,'include':_0x5bf985[_0x739f('0x1a')]?_0x5bf985[_0x739f('0x1a')][_0x739f('0x1e')]?_[_0x739f('0x1f')](_0x5bf985['options'][_0x739f('0x1e')],function(_0x32a012){return{'model':db[_0x32a012[_0x739f('0x20')]],'as':_0x32a012['as'],'attributes':_0x32a012[_0x739f('0x21')],'include':_0x32a012[_0x739f('0x1e')]?_[_0x739f('0x1f')](_0x32a012[_0x739f('0x1e')],function(_0x23f57f){return{'model':db[_0x23f57f['model']],'as':_0x23f57f['as'],'attributes':_0x23f57f[_0x739f('0x21')],'include':_0x23f57f[_0x739f('0x1e')]?_[_0x739f('0x1f')](_0x23f57f['include'],function(_0x130dd2){return{'model':db[_0x130dd2[_0x739f('0x20')]],'as':_0x130dd2['as'],'attributes':_0x130dd2[_0x739f('0x21')]};}):[]};}):[]};}):[]:[]})[_0x739f('0xe')](function(_0x2c335){logger[_0x739f('0xf')](_0x739f('0x18'),_0x5bf985);logger[_0x739f('0x12')]('GetTrigger',_0x5bf985,JSON[_0x739f('0x22')](_0x2c335));_0x97e35a(_0x2c335);})[_0x739f('0x17')](function(_0x281508){logger[_0x739f('0x14')](_0x739f('0x18'),_0x281508[_0x739f('0x16')],_0x5bf985);_0x3abb70(_0x3c4ce9[_0x739f('0x14')](0x1f4,_0x281508['message']));});});};exports[_0x739f('0x23')]=function(_0x584b93){var _0x5793c7=this;return new Promise(function(_0xf6fb52,_0x16ff7f){return db['Trigger'][_0x739f('0x24')]({'raw':_0x584b93[_0x739f('0x1a')]?_0x584b93[_0x739f('0x1a')][_0x739f('0x1b')]===undefined?!![]:![]:!![],'where':_0x584b93[_0x739f('0x1a')]?_0x584b93[_0x739f('0x1a')][_0x739f('0x1c')]||null:null,'attributes':_0x584b93[_0x739f('0x1a')]?_0x584b93[_0x739f('0x1a')][_0x739f('0x21')]||null:null,'include':_0x584b93['options']?_0x584b93[_0x739f('0x1a')][_0x739f('0x1e')]?_[_0x739f('0x1f')](_0x584b93[_0x739f('0x1a')]['include'],function(_0x4cbe5a){return{'model':db[_0x4cbe5a[_0x739f('0x20')]],'as':_0x4cbe5a['as'],'attributes':_0x4cbe5a[_0x739f('0x21')],'include':_0x4cbe5a['include']?_[_0x739f('0x1f')](_0x4cbe5a[_0x739f('0x1e')],function(_0x39de51){return{'model':db[_0x39de51[_0x739f('0x20')]],'as':_0x39de51['as'],'attributes':_0x39de51['attributes'],'include':_0x39de51['include']?_[_0x739f('0x1f')](_0x39de51[_0x739f('0x1e')],function(_0x429932){return{'model':db[_0x429932['model']],'as':_0x429932['as'],'attributes':_0x429932[_0x739f('0x21')]};}):[]};}):[]};}):[]:[]})[_0x739f('0xe')](function(_0x39d473){logger['info'](_0x739f('0x23'),_0x584b93);logger['debug']('ShowTrigger',_0x584b93,JSON[_0x739f('0x22')](_0x39d473));_0xf6fb52(_0x39d473);})[_0x739f('0x17')](function(_0xc57746){logger[_0x739f('0x14')](_0x739f('0x23'),_0xc57746[_0x739f('0x16')],_0x584b93);_0x16ff7f(_0x5793c7[_0x739f('0x14')](0x1f4,_0xc57746['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index dba1f2b..29ae99d 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 _0xc061=['create','put','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','get','index','isAuthenticated','show','post','/:id/clone','clone'];(function(_0x4ca944,_0x220f4a){var _0x395523=function(_0xbc09b7){while(--_0xbc09b7){_0x4ca944['push'](_0x4ca944['shift']());}};_0x395523(++_0x220f4a);}(_0xc061,0x7c));var _0x1c06=function(_0x36c11f,_0x4d3b80){_0x36c11f=_0x36c11f-0x0;var _0x5ee46f=_0xc061[_0x36c11f];return _0x5ee46f;};'use strict';var multer=require(_0x1c06('0x0'));var util=require(_0x1c06('0x1'));var path=require(_0x1c06('0x2'));var timeout=require(_0x1c06('0x3'));var express=require('express');var router=express[_0x1c06('0x4')]();var fs_extra=require(_0x1c06('0x5'));var auth=require(_0x1c06('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1c06('0x7'));var controller=require(_0x1c06('0x8'));router[_0x1c06('0x9')]('/',auth['isAuthenticated'](),controller[_0x1c06('0xa')]);router[_0x1c06('0x9')]('/:id',auth[_0x1c06('0xb')](),controller[_0x1c06('0xc')]);router[_0x1c06('0xd')](_0x1c06('0xe'),auth['isAuthenticated'](),controller[_0x1c06('0xf')]);router[_0x1c06('0xd')]('/',auth[_0x1c06('0xb')](),controller[_0x1c06('0x10')]);router[_0x1c06('0x11')](_0x1c06('0x12'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x1c06('0x12'),auth[_0x1c06('0xb')](),controller['destroy']);module[_0x1c06('0x13')]=router; \ No newline at end of file +var _0xe2f1=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./trunk.controller','isAuthenticated','index','get','/:id','post','clone','create'];(function(_0x43ef0e,_0x5c8c64){var _0x4d7032=function(_0x540a4c){while(--_0x540a4c){_0x43ef0e['push'](_0x43ef0e['shift']());}};_0x4d7032(++_0x5c8c64);}(_0xe2f1,0xcd));var _0x1e2f=function(_0xc0d9bc,_0x2bd6be){_0xc0d9bc=_0xc0d9bc-0x0;var _0x32ff73=_0xe2f1[_0xc0d9bc];return _0x32ff73;};'use strict';var multer=require('multer');var util=require(_0x1e2f('0x0'));var path=require(_0x1e2f('0x1'));var timeout=require(_0x1e2f('0x2'));var express=require(_0x1e2f('0x3'));var router=express[_0x1e2f('0x4')]();var fs_extra=require(_0x1e2f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1e2f('0x6'));var config=require('../../config/environment');var controller=require(_0x1e2f('0x7'));router['get']('/',auth[_0x1e2f('0x8')](),controller[_0x1e2f('0x9')]);router[_0x1e2f('0xa')](_0x1e2f('0xb'),auth[_0x1e2f('0x8')](),controller['show']);router[_0x1e2f('0xc')]('/:id/clone',auth[_0x1e2f('0x8')](),controller[_0x1e2f('0xd')]);router[_0x1e2f('0xc')]('/',auth[_0x1e2f('0x8')](),controller[_0x1e2f('0xe')]);router[_0x1e2f('0xf')]('/:id',auth[_0x1e2f('0x8')](),controller[_0x1e2f('0x10')]);router[_0x1e2f('0x11')](_0x1e2f('0xb'),auth[_0x1e2f('0x8')](),controller[_0x1e2f('0x12')]);module[_0x1e2f('0x13')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 7e900cf..034a652 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 _0x898e=['certificate','active','actpass','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','INTEGER','always','accept','refuse','originate','uas','pai','fingerprint'];(function(_0x29ef06,_0x3e54b7){var _0x57bd49=function(_0x21e644){while(--_0x21e644){_0x29ef06['push'](_0x29ef06['shift']());}};_0x57bd49(++_0x3e54b7);}(_0x898e,0x131));var _0xe898=function(_0x2be315,_0x3b2f90){_0x2be315=_0x2be315-0x0;var _0x4d47fc=_0x898e[_0x2be315];return _0x4d47fc;};'use strict';var Sequelize=require(_0xe898('0x0'));module[_0xe898('0x1')]={'name':{'type':Sequelize[_0xe898('0x2')],'allowNull':![],'unique':_0xe898('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe898('0x4')](_0xe898('0x5'),_0xe898('0x6'),_0xe898('0x7')),'allowNull':![],'defaultValue':_0xe898('0x5')},'context':{'type':Sequelize[_0xe898('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0xe898('0x4')]('ALLOWED_NOT_SCREENED',_0xe898('0x8'),_0xe898('0x9'),'ALLOWED',_0xe898('0xa'),_0xe898('0xb'),'PROHIB_FAILED_SCREEN',_0xe898('0xc'))},'deny':{'type':Sequelize[_0xe898('0x2')]},'permit':{'type':Sequelize[_0xe898('0x2')]},'secret':{'type':Sequelize[_0xe898('0x2')]},'md5secret':{'type':Sequelize[_0xe898('0x2')]},'remotesecret':{'type':Sequelize[_0xe898('0x2')]},'transport':{'type':Sequelize[_0xe898('0x2')],'defaultValue':_0xe898('0xd'),'set':function(_0x2d8303){this[_0xe898('0xe')](_0xe898('0xf'),_0x2d8303?_0x2d8303[_0xe898('0x10')](','):null);},'get':function(){return this[_0xe898('0x11')](_0xe898('0xf'))?this['getDataValue'](_0xe898('0xf'))[_0xe898('0x12')](','):null;},'comment':_0xe898('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0xe898('0x14'),_0xe898('0x15'),_0xe898('0x16'),_0xe898('0x17'),_0xe898('0x18')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xe898('0x4')](_0xe898('0x19'),'no',_0xe898('0x1a'),_0xe898('0x1b'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xe898('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0xe898('0x2')]},'nat':{'type':Sequelize[_0xe898('0x2')],'defaultValue':_0xe898('0x1c'),'set':function(_0x20f96b){this['setDataValue'](_0xe898('0x1d'),_0x20f96b?_0x20f96b[_0xe898('0x10')](','):null);},'get':function(){return this[_0xe898('0x11')]('nat')?this[_0xe898('0x11')](_0xe898('0x1d'))[_0xe898('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xe898('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xe898('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xe898('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe898('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xe898('0x2')],'defaultValue':_0xe898('0x1e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe898('0x1f'),'set':function(_0x2f3e1b){this[_0xe898('0xe')](_0xe898('0x20'),_0x2f3e1b?_0x2f3e1b[_0xe898('0x10')](';'):_0xe898('0x1f'));},'get':function(){return this[_0xe898('0x11')](_0xe898('0x20'))?this[_0xe898('0x11')](_0xe898('0x20'))[_0xe898('0x12')](';'):null;},'comment':_0xe898('0x21')},'autoframing':{'type':Sequelize[_0xe898('0x4')](_0xe898('0x19'),'no')},'insecure':{'type':Sequelize[_0xe898('0x2')],'defaultValue':_0xe898('0x22'),'set':function(_0x4d0214){this[_0xe898('0xe')](_0xe898('0x23'),_0x4d0214?_0x4d0214[_0xe898('0x10')](','):null);},'get':function(){return this[_0xe898('0x11')](_0xe898('0x23'))?this[_0xe898('0x11')](_0xe898('0x23'))[_0xe898('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0xe898('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe898('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xe898('0x19'),'no',_0xe898('0x24'))},'promiscredir':{'type':Sequelize[_0xe898('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0xe898('0x4')]('yes','no')},'accountcode':{'type':Sequelize[_0xe898('0x25')](0xb)},'setvar':{'type':Sequelize[_0xe898('0x2')]},'callerid':{'type':Sequelize[_0xe898('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0xe898('0x19'),'no'),'defaultValue':_0xe898('0x19')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xe898('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0xe898('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xe898('0x4')](_0xe898('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0xe898('0x4')](_0xe898('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0xe898('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0xe898('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xe898('0x4')](_0xe898('0x19'),'no')},'mailbox':{'type':Sequelize[_0xe898('0x2')]},'session_timers':{'type':Sequelize[_0xe898('0x4')](_0xe898('0x27'),_0xe898('0x28'),_0xe898('0x29'))},'session_expires':{'type':Sequelize[_0xe898('0x25')](0xb)},'session_minse':{'type':Sequelize[_0xe898('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0xe898('0x4')]('uac',_0xe898('0x2a')),'defaultValue':_0xe898('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0xe898('0x2')]},'regexten':{'type':Sequelize[_0xe898('0x2')]},'fromdomain':{'type':Sequelize[_0xe898('0x2')]},'fromuser':{'type':Sequelize[_0xe898('0x2')]},'port':{'type':Sequelize[_0xe898('0x25')](0x5)},'qualify':{'type':Sequelize[_0xe898('0x4')](_0xe898('0x19'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xe898('0x25')](0xb)},'defaultip':{'type':Sequelize[_0xe898('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xe898('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0xe898('0x4')](_0xe898('0x19'),'no',_0xe898('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xe898('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xe898('0x25')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xe898('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xe898('0x2')]},'use_q850_reason':{'type':Sequelize[_0xe898('0x2')]},'maxforwards':{'type':Sequelize[_0xe898('0x25')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xe898('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe898('0x4')](_0xe898('0x19'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xe898('0x19'),'no')},'icesupport':{'type':Sequelize[_0xe898('0x4')](_0xe898('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0xe898('0x4')](_0xe898('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0xe898('0x4')]('yes','no',_0xe898('0x2c'),_0xe898('0x2d'))},'dtlsrekey':{'type':Sequelize[_0xe898('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0xe898('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xe898('0x2')]},'dtlscafile':{'type':Sequelize[_0xe898('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0xe898('0x2e'),'passive',_0xe898('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xe898('0x2')]},'usereqphone':{'type':Sequelize[_0xe898('0x4')](_0xe898('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xe898('0x2')]},'call_limit':{'type':Sequelize[_0xe898('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xe898('0x4')](_0xe898('0x19'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xe898('0x19'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xe898('0x2')]},'mohsuggest':{'type':Sequelize[_0xe898('0x2')]},'parkinglot':{'type':Sequelize[_0xe898('0x2')]},'description':{'type':Sequelize[_0xe898('0x2')]},'host':{'type':Sequelize[_0xe898('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xe898('0x4')](_0xe898('0x19'),'no','nonat','update',_0xe898('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xe898('0x2')]},'active':{'type':Sequelize[_0xe898('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x69e4=['ulaw;alaw;gsm','setDataValue','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','uac','uas','pai','certificate','active','passive','dynamic','update','update,nonat','BOOLEAN','sequelize','STRING','name','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','join','getDataValue','rfc2833','info','shortinfo','inband','yes','nonat','outgoing','force_rport,comedia','nat','split'];(function(_0x635e28,_0x4eecc1){var _0x5bb9dc=function(_0x4e4486){while(--_0x4e4486){_0x635e28['push'](_0x635e28['shift']());}};_0x5bb9dc(++_0x4eecc1);}(_0x69e4,0xd4));var _0x469e=function(_0x4a1327,_0x3642ab){_0x4a1327=_0x4a1327-0x0;var _0x2fcd03=_0x69e4[_0x4a1327];return _0x2fcd03;};'use strict';var Sequelize=require(_0x469e('0x0'));module['exports']={'name':{'type':Sequelize[_0x469e('0x1')],'allowNull':![],'unique':_0x469e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x4'),_0x469e('0x5'),_0x469e('0x6')),'allowNull':![],'defaultValue':_0x469e('0x4')},'context':{'type':Sequelize[_0x469e('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x7'),_0x469e('0x8'),_0x469e('0x9'),_0x469e('0xa'),_0x469e('0xb'),_0x469e('0xc'),_0x469e('0xd'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x469e('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x469e('0x1')]},'remotesecret':{'type':Sequelize[_0x469e('0x1')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x469e('0xe'),'set':function(_0x1c18f7){this['setDataValue'](_0x469e('0xf'),_0x1c18f7?_0x1c18f7[_0x469e('0x10')](','):null);},'get':function(){return this[_0x469e('0x11')](_0x469e('0xf'))?this[_0x469e('0x11')](_0x469e('0xf'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x469e('0x12'),_0x469e('0x13'),_0x469e('0x14'),_0x469e('0x15'),'auto'),'defaultValue':_0x469e('0x12')},'directmedia':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no',_0x469e('0x17'),'update',_0x469e('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x469e('0x1')]},'nat':{'type':Sequelize[_0x469e('0x1')],'defaultValue':_0x469e('0x19'),'set':function(_0x25e588){this['setDataValue']('nat',_0x25e588?_0x25e588[_0x469e('0x10')](','):null);},'get':function(){return this[_0x469e('0x11')](_0x469e('0x1a'))?this[_0x469e('0x11')]('nat')[_0x469e('0x1b')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x469e('0x1')]},'namedcallgroup':{'type':Sequelize[_0x469e('0x1')]},'pickupgroup':{'type':Sequelize[_0x469e('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x469e('0x1')]},'language':{'type':Sequelize[_0x469e('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x469e('0x1')],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x469e('0x1c'),'set':function(_0x352b45){this[_0x469e('0x1d')]('allow',_0x352b45?_0x352b45['join'](';'):_0x469e('0x1c'));},'get':function(){return this['getDataValue'](_0x469e('0x1e'))?this[_0x469e('0x11')](_0x469e('0x1e'))['split'](';'):null;},'comment':_0x469e('0x1f')},'autoframing':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no')},'insecure':{'type':Sequelize[_0x469e('0x1')],'defaultValue':_0x469e('0x20'),'set':function(_0x190da9){this[_0x469e('0x1d')]('insecure',_0x190da9?_0x190da9[_0x469e('0x10')](','):null);},'get':function(){return this[_0x469e('0x11')](_0x469e('0x21'))?this['getDataValue'](_0x469e('0x21'))[_0x469e('0x1b')](','):null;},'comment':_0x469e('0x22')},'trustrpid':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x469e('0x23'))},'promiscredir':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x469e('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x469e('0x24')},'amaflags':{'type':Sequelize[_0x469e('0x1')]},'callcounter':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x469e('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize[_0x469e('0x1')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x469e('0x16'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x469e('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no')},'mailbox':{'type':Sequelize[_0x469e('0x1')]},'session_timers':{'type':Sequelize[_0x469e('0x3')]('accept','refuse','originate')},'session_expires':{'type':Sequelize[_0x469e('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x469e('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x26'),'uas'),'defaultValue':_0x469e('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x469e('0x1')]},'regexten':{'type':Sequelize[_0x469e('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x469e('0x25')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x469e('0x16')},'keepalive':{'type':Sequelize[_0x469e('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x469e('0x1')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x469e('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x469e('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x469e('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x469e('0x3')]('yes','no',_0x469e('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x469e('0x1')]},'callbackextension':{'type':Sequelize[_0x469e('0x1')]},'timert1':{'type':Sequelize[_0x469e('0x25')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x469e('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x469e('0x1')]},'contactdeny':{'type':Sequelize[_0x469e('0x1')]},'contactacl':{'type':Sequelize[_0x469e('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x469e('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x469e('0x25')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no')},'force_avp':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no')},'icesupport':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no','fingerprint',_0x469e('0x29'))},'dtlsrekey':{'type':Sequelize[_0x469e('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x469e('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x469e('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x469e('0x1')]},'dtlssetup':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x2a'),_0x469e('0x2b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x469e('0x1')]},'usereqphone':{'type':Sequelize[_0x469e('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x469e('0x1')]},'recordofffeature':{'type':Sequelize[_0x469e('0x1')]},'call_limit':{'type':Sequelize[_0x469e('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x469e('0x3')](_0x469e('0x16'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x469e('0x16'),'no')},'vmexten':{'type':Sequelize[_0x469e('0x1')]},'mohinterpret':{'type':Sequelize[_0x469e('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0x469e('0x2c')},'canreinvite':{'type':Sequelize[_0x469e('0x3')]('yes','no',_0x469e('0x17'),_0x469e('0x2d'),_0x469e('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x469e('0x1')]},'otherFields':{'type':Sequelize[_0x469e('0x1')]},'active':{'type':Sequelize[_0x469e('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x469e('0x1')],'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 a923101..5d7affb 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 _0xbec5=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','Trunks','UserProfileResource','destroy','stack','name','send','map','Trunk','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','attributes','find','clone','get','omit','updatedAt','body','createdAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','join','server/files/templates/trunk.ejs','utf8'];(function(_0x348352,_0x54c188){var _0x400611=function(_0x75c239){while(--_0x75c239){_0x348352['push'](_0x348352['shift']());}};_0x400611(++_0x54c188);}(_0xbec5,0xe5));var _0x5bec=function(_0x38c632,_0x14e8e6){_0x38c632=_0x38c632-0x0;var _0x12737e=_0xbec5[_0x38c632];return _0x12737e;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];var jayson=require(_0x5bec('0x19'));var client=jayson['client'][_0x5bec('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xaa984d,_0x35393a,_0x6888a4,_0x3198e0){return new BPromise(function(_0xcd6d90,_0x24dcd6){var _0x43fd2a=_0x3198e0||client;return _0x43fd2a[_0x5bec('0x1b')](_0xaa984d,_0x6888a4)[_0x5bec('0x1c')](function(_0x31b9e4){logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,'request\x20sent');logger['debug'](_0x5bec('0x1f'),_0x35393a,_0x5bec('0x20'),JSON[_0x5bec('0x21')](_0x31b9e4));if(_0x31b9e4[_0x5bec('0x22')]){if(_0x31b9e4['error']['code']===0x1f4){logger[_0x5bec('0x22')](_0x5bec('0x1e'),_0x35393a,_0x31b9e4['error'][_0x5bec('0x23')]);return _0x24dcd6(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x31b9e4[_0x5bec('0x22')]['message']);return _0xcd6d90(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}else{logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,_0x5bec('0x20'));_0xcd6d90(_0x31b9e4['result'][_0x5bec('0x23')]);}})['catch'](function(_0x2b2d26){logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x2b2d26);_0x24dcd6(_0x2b2d26);});});}function respondWithStatusCode(_0xa414f8,_0xbef70b){_0xbef70b=_0xbef70b||0xcc;return function(_0x4e0ca2){if(_0x4e0ca2){return _0xa414f8[_0x5bec('0x24')](_0xbef70b);}return _0xa414f8[_0x5bec('0x25')](_0xbef70b)[_0x5bec('0x26')]();};}function respondWithResult(_0x20da89,_0x226d55){_0x226d55=_0x226d55||0xc8;return function(_0x131143){if(_0x131143){return _0x20da89[_0x5bec('0x25')](_0x226d55)['json'](_0x131143);}};}function respondWithFilteredResult(_0x5b63ab,_0x5e44b3){return function(_0x2961bd){if(_0x2961bd){var _0x2cdd2f=typeof _0x5e44b3[_0x5bec('0x27')]==='undefined'&&typeof _0x5e44b3[_0x5bec('0x28')]===_0x5bec('0x29');var _0x57331b=_0x2961bd[_0x5bec('0x2a')];var _0x63ac8=_0x2cdd2f?0x0:_0x5e44b3['offset'];var _0x5336b3=_0x2cdd2f?_0x2961bd[_0x5bec('0x2a')]:_0x5e44b3[_0x5bec('0x27')]+_0x5e44b3[_0x5bec('0x28')];var _0x2c7a7b;if(_0x5336b3>=_0x57331b){_0x5336b3=_0x57331b;_0x2c7a7b=0xc8;}else{_0x2c7a7b=0xce;}_0x5b63ab[_0x5bec('0x25')](_0x2c7a7b);return _0x5b63ab[_0x5bec('0x2b')]('Content-Range',_0x63ac8+'-'+_0x5336b3+'/'+_0x57331b)[_0x5bec('0x2c')](_0x2961bd);}return null;};}function patchUpdates(_0x59b5b6){return function(_0x45863b){try{jsonpatch[_0x5bec('0x2d')](_0x45863b,_0x59b5b6,!![]);}catch(_0x3034c9){return BPromise[_0x5bec('0x2e')](_0x3034c9);}return _0x45863b['save']();};}function saveUpdates(_0x2b42c8,_0x1aba46){return function(_0xfc7d41){if(_0xfc7d41){return _0xfc7d41['update'](_0x2b42c8)[_0x5bec('0x1c')](function(_0x4cfb89){return _0x4cfb89;});}return null;};}function removeEntity(_0x14cdbf,_0x207192){return function(_0x29df14){if(_0x29df14){return _0x29df14['destroy']()[_0x5bec('0x1c')](function(){var _0x420ad4=_0x29df14['get']({'plain':!![]});var _0x34b441=_0x5bec('0x2f');return db[_0x5bec('0x30')][_0x5bec('0x31')]({'where':{'type':_0x34b441,'resourceId':_0x420ad4['id']}})[_0x5bec('0x1c')](function(){return _0x29df14;});})['then'](function(){_0x14cdbf[_0x5bec('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3793,_0x384f04){return function(_0x182b86){if(!_0x182b86){_0x2d3793[_0x5bec('0x24')](0x194);}return _0x182b86;};}function handleError(_0x2e421e,_0x1923fc){_0x1923fc=_0x1923fc||0x1f4;return function(_0x49c8ef){logger[_0x5bec('0x22')](_0x49c8ef[_0x5bec('0x32')]);if(_0x49c8ef[_0x5bec('0x33')]){delete _0x49c8ef['name'];}_0x2e421e[_0x5bec('0x25')](_0x1923fc)[_0x5bec('0x34')](_0x49c8ef);};}exports['index']=function(_0xdb0430,_0x58c34e){var _0x400e22={},_0x2c0b08={},_0x402e5d={'count':0x0,'rows':[]};var _0x49cdfa=_[_0x5bec('0x35')](db[_0x5bec('0x36')][_0x5bec('0x37')],function(_0x139859){return{'name':_0x139859[_0x5bec('0x38')],'type':_0x139859[_0x5bec('0x39')][_0x5bec('0x3a')]};});_0x2c0b08['model']=_[_0x5bec('0x35')](_0x49cdfa,_0x5bec('0x33'));_0x2c0b08[_0x5bec('0x3b')]=_[_0x5bec('0x3c')](_0xdb0430['query']);_0x2c0b08[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],_0x2c0b08['query']);_0x400e22['attributes']=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x40')]));_0x400e22['attributes']=_0x400e22['attributes'][_0x5bec('0x41')]?_0x400e22['attributes']:_0x2c0b08[_0x5bec('0x3f')];if(!_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x42')]('nolimit')){_0x400e22[_0x5bec('0x28')]=qs[_0x5bec('0x28')](_0xdb0430['query'][_0x5bec('0x28')]);_0x400e22[_0x5bec('0x27')]=qs[_0x5bec('0x27')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x27')]);}_0x400e22[_0x5bec('0x43')]=qs[_0x5bec('0x44')](_0xdb0430['query']['sort']);_0x400e22[_0x5bec('0x45')]=qs['filters'](_['pick'](_0xdb0430[_0x5bec('0x3b')],_0x2c0b08['filters']),_0x49cdfa);if(_0xdb0430['query']['filter']){_0x400e22[_0x5bec('0x45')]=_[_0x5bec('0x46')](_0x400e22[_0x5bec('0x45')],{'$or':_[_0x5bec('0x35')](_0x49cdfa,function(_0x48858a){if(_0x48858a[_0x5bec('0x39')]!==_0x5bec('0x47')){var _0xa4d32={};_0xa4d32[_0x48858a[_0x5bec('0x33')]]={'$like':'%'+_0xdb0430['query'][_0x5bec('0x48')]+'%'};return _0xa4d32;}})});}_0x400e22=_[_0x5bec('0x46')]({},_0x400e22,_0xdb0430[_0x5bec('0x49')]);var _0x51a3f9={'where':_0x400e22[_0x5bec('0x45')]};return db['Trunk'][_0x5bec('0x2a')](_0x51a3f9)[_0x5bec('0x1c')](function(_0x133d5c){_0x402e5d[_0x5bec('0x2a')]=_0x133d5c;if(_0xdb0430['query'][_0x5bec('0x4a')]){_0x400e22[_0x5bec('0x4b')]=[{'all':!![]}];}return db[_0x5bec('0x36')][_0x5bec('0x4c')](_0x400e22);})[_0x5bec('0x1c')](function(_0x123758){_0x402e5d[_0x5bec('0x4d')]=_0x123758;return _0x402e5d;})['then'](respondWithFilteredResult(_0x58c34e,_0x400e22))[_0x5bec('0x4e')](handleError(_0x58c34e,null));};exports[_0x5bec('0x4f')]=function(_0x5775ca,_0x273e09){var _0x3e6180={'raw':![],'where':{'id':_0x5775ca[_0x5bec('0x50')]['id']}},_0x34ee24={};_0x34ee24[_0x5bec('0x3f')]=_[_0x5bec('0x3c')](db[_0x5bec('0x36')]['rawAttributes']);_0x34ee24[_0x5bec('0x3b')]=_['keys'](_0x5775ca[_0x5bec('0x3b')]);_0x34ee24[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],_0x34ee24[_0x5bec('0x3b')]);_0x3e6180[_0x5bec('0x51')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0x5775ca[_0x5bec('0x3b')]['fields']));_0x3e6180[_0x5bec('0x51')]=_0x3e6180['attributes']['length']?_0x3e6180[_0x5bec('0x51')]:_0x34ee24['model'];if(_0x5775ca['query'][_0x5bec('0x4a')]){_0x3e6180[_0x5bec('0x4b')]=[{'all':!![]}];}_0x3e6180=_[_0x5bec('0x46')]({},_0x3e6180,_0x5775ca['options']);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0x3e6180)[_0x5bec('0x1c')](handleEntityNotFound(_0x273e09,null))[_0x5bec('0x1c')](respondWithResult(_0x273e09,null))['catch'](handleError(_0x273e09,null));};exports[_0x5bec('0x53')]=function(_0x209da3,_0x9cae50){var _0xc8563a={'where':{'id':_0x209da3[_0x5bec('0x50')]['id']}},_0x2f736c={};_0x2f736c[_0x5bec('0x3f')]=_['keys'](db['Trunk'][_0x5bec('0x37')]);_0xc8563a['attributes']=_[_0x5bec('0x3e')](_0x2f736c[_0x5bec('0x3f')],qs['fields'](_0x209da3[_0x5bec('0x3b')]['fields']));_0xc8563a[_0x5bec('0x51')]=_0xc8563a[_0x5bec('0x51')][_0x5bec('0x41')]?_0xc8563a[_0x5bec('0x51')]:_0x2f736c[_0x5bec('0x3f')];if(_0x209da3[_0x5bec('0x3b')][_0x5bec('0x4a')]){_0xc8563a[_0x5bec('0x4b')]=[{'all':!![]}];}_0xc8563a=_[_0x5bec('0x46')]({},_0xc8563a,_0x209da3[_0x5bec('0x49')]);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0xc8563a)[_0x5bec('0x1c')](handleEntityNotFound(_0x9cae50,null))[_0x5bec('0x1c')](function(_0x51b25d){if(_0x51b25d){var _0x2e33a7=_0x51b25d[_0x5bec('0x54')]({'plain':!![]});_0x2e33a7=qs[_0x5bec('0x55')](_0x2e33a7,['id','createdAt',_0x5bec('0x56')]);_0x209da3[_0x5bec('0x57')]=_[_0x5bec('0x55')](_0x209da3[_0x5bec('0x57')],['id',_0x5bec('0x58'),'updatedAt']);return db[_0x5bec('0x36')][_0x5bec('0x59')](_[_0x5bec('0x46')](_0x2e33a7,_0x209da3[_0x5bec('0x57')]),{'include':_0x209da3['query'][_0x5bec('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2b701f){var _0x38deb0=_0x209da3[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0x38deb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38deb0[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x1b3c40=_0x2b701f[_0x5bec('0x54')]({'plain':!![]});var _0xc3e3df=_0x5bec('0x2f');return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0xc3e3df,'userProfileId':_0x38deb0[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0xfa751f){if(_0xfa751f&&_0xfa751f[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x1b3c40[_0x5bec('0x33')],'resourceId':_0x1b3c40['id'],'type':_0xfa751f['name'],'sectionId':_0xfa751f['id']},{})[_0x5bec('0x1c')](function(){return _0x2b701f;});}else{return _0x2b701f;}})[_0x5bec('0x4e')](function(_0x4e899c){logger[_0x5bec('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e899c);throw _0x4e899c;});}return _0x2b701f;});}})[_0x5bec('0x1c')](respondWithResult(_0x9cae50,0xc9))[_0x5bec('0x4e')](handleError(_0x9cae50,null));};exports['create']=function(_0x5a2a85,_0xd54be0,_0xcac51d){var _0xb6cf85;return db[_0x5bec('0x36')][_0x5bec('0x59')](_0x5a2a85['body'],{'raw':!![]})[_0x5bec('0x1c')](function(_0x39cb06){_0xb6cf85=_0x39cb06;return db['Trunk'][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x44a945){var _0x34f31c=fs['readFileSync'](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),_0x5bec('0x61'));var _0x3ede1d=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x1ee139=ejs[_0x5bec('0x65')](_0x34f31c,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ee139);if(_0xb6cf85['registry']){var _0x3c305e=ejs[_0x5bec('0x65')](_0x3ede1d,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0x3c305e);}})[_0x5bec('0x1c')](function(){return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x59'),{'module':'chan_sip.so'});})['then'](function(){var _0xc81e8f=_0x5a2a85[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0xc81e8f)throw new Error(_0x5bec('0x69'));if(_0xc81e8f[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x17cd00=_0xb6cf85[_0x5bec('0x54')]({'plain':!![]});return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0x5bec('0x2f'),'userProfileId':_0xc81e8f[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0x325044){if(_0x325044&&_0x325044[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x17cd00[_0x5bec('0x33')],'resourceId':_0x17cd00['id'],'type':_0x325044[_0x5bec('0x33')],'sectionId':_0x325044['id']},{})[_0x5bec('0x1c')](function(){return _0xb6cf85;});}else{return _0xb6cf85;}})['catch'](function(_0x2e76c0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e76c0);throw _0x2e76c0;});}return _0xb6cf85;})[_0x5bec('0x1c')](respondWithResult(_0xd54be0,0xc9))['catch'](handleError(_0xd54be0,null));};exports[_0x5bec('0x6a')]=function(_0x5d6af3,_0x5ca280,_0x2e849b){var _0x1b5ec0;return db['Trunk'][_0x5bec('0x52')]({'where':{'id':_0x5d6af3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x5ca280,null))[_0x5bec('0x1c')](saveUpdates(_0x5d6af3[_0x5bec('0x57')],null))[_0x5bec('0x1c')](function(_0xb76af2){if(_0xb76af2){_0x1b5ec0=_0xb76af2;return db[_0x5bec('0x36')]['findAll']({'raw':!![]});}})['then'](function(_0x2e8cd3){if(_0x2e8cd3){var _0x122c7f=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),'utf8');var _0x44ceec=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x38be2d=ejs[_0x5bec('0x65')](_0x122c7f,{'trunks':_0x2e8cd3||[]});fs['writeFileSync'](_0x5bec('0x6b'),_0x38be2d);var _0xe5f9e5=ejs[_0x5bec('0x65')](_0x44ceec,{'trunks':_0x2e8cd3||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0xe5f9e5);return respondWithRpcPromise('Reload',_0x5bec('0x6a'),{'module':_0x5bec('0x6c')});}return null;})['then'](function(_0x195c12){if(_0x195c12){return _0x1b5ec0;}})['then'](respondWithResult(_0x5ca280,null))[_0x5bec('0x4e')](handleError(_0x5ca280,null));};exports[_0x5bec('0x31')]=function(_0x4646a3,_0x313e1c,_0x437c3e){var _0x3d7600;return db[_0x5bec('0x36')][_0x5bec('0x52')]({'where':{'id':_0x4646a3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x313e1c,null))[_0x5bec('0x1c')](removeEntity(_0x313e1c,null))[_0x5bec('0x1c')](function(){return db[_0x5bec('0x36')][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x1eaf2f){var _0x317e2a=fs[_0x5bec('0x62')](path['join'](config[_0x5bec('0x63')],'server/files/templates/trunk.ejs'),_0x5bec('0x61'));var _0xfcef92=fs['readFileSync'](path['join'](config[_0x5bec('0x63')],'server/files/templates/registry.ejs'),_0x5bec('0x61'));var _0x4b70df=ejs[_0x5bec('0x65')](_0x317e2a,{'trunks':_0x1eaf2f});var _0x27b40b=ejs['render'](_0xfcef92,{'trunks':_0x1eaf2f});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4b70df);fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_registers.conf',_0x27b40b);return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x31'),{'module':'chan_sip.so'});})[_0x5bec('0x4e')](handleError(_0x313e1c,null));}; \ No newline at end of file +var _0xbec5=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','Trunks','UserProfileResource','destroy','stack','name','send','map','Trunk','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','attributes','find','clone','get','omit','updatedAt','body','createdAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','join','server/files/templates/trunk.ejs','utf8'];(function(_0x3ac83e,_0x5e584e){var _0x1fc751=function(_0x198920){while(--_0x198920){_0x3ac83e['push'](_0x3ac83e['shift']());}};_0x1fc751(++_0x5e584e);}(_0xbec5,0xe5));var _0x5bec=function(_0x284a61,_0x231686){_0x284a61=_0x284a61-0x0;var _0x220e3c=_0xbec5[_0x284a61];return _0x220e3c;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];var jayson=require(_0x5bec('0x19'));var client=jayson['client'][_0x5bec('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xaa984d,_0x35393a,_0x6888a4,_0x3198e0){return new BPromise(function(_0xcd6d90,_0x24dcd6){var _0x43fd2a=_0x3198e0||client;return _0x43fd2a[_0x5bec('0x1b')](_0xaa984d,_0x6888a4)[_0x5bec('0x1c')](function(_0x31b9e4){logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,'request\x20sent');logger['debug'](_0x5bec('0x1f'),_0x35393a,_0x5bec('0x20'),JSON[_0x5bec('0x21')](_0x31b9e4));if(_0x31b9e4[_0x5bec('0x22')]){if(_0x31b9e4['error']['code']===0x1f4){logger[_0x5bec('0x22')](_0x5bec('0x1e'),_0x35393a,_0x31b9e4['error'][_0x5bec('0x23')]);return _0x24dcd6(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x31b9e4[_0x5bec('0x22')]['message']);return _0xcd6d90(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}else{logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,_0x5bec('0x20'));_0xcd6d90(_0x31b9e4['result'][_0x5bec('0x23')]);}})['catch'](function(_0x2b2d26){logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x2b2d26);_0x24dcd6(_0x2b2d26);});});}function respondWithStatusCode(_0xa414f8,_0xbef70b){_0xbef70b=_0xbef70b||0xcc;return function(_0x4e0ca2){if(_0x4e0ca2){return _0xa414f8[_0x5bec('0x24')](_0xbef70b);}return _0xa414f8[_0x5bec('0x25')](_0xbef70b)[_0x5bec('0x26')]();};}function respondWithResult(_0x20da89,_0x226d55){_0x226d55=_0x226d55||0xc8;return function(_0x131143){if(_0x131143){return _0x20da89[_0x5bec('0x25')](_0x226d55)['json'](_0x131143);}};}function respondWithFilteredResult(_0x5b63ab,_0x5e44b3){return function(_0x2961bd){if(_0x2961bd){var _0x2cdd2f=typeof _0x5e44b3[_0x5bec('0x27')]==='undefined'&&typeof _0x5e44b3[_0x5bec('0x28')]===_0x5bec('0x29');var _0x57331b=_0x2961bd[_0x5bec('0x2a')];var _0x63ac8=_0x2cdd2f?0x0:_0x5e44b3['offset'];var _0x5336b3=_0x2cdd2f?_0x2961bd[_0x5bec('0x2a')]:_0x5e44b3[_0x5bec('0x27')]+_0x5e44b3[_0x5bec('0x28')];var _0x2c7a7b;if(_0x5336b3>=_0x57331b){_0x5336b3=_0x57331b;_0x2c7a7b=0xc8;}else{_0x2c7a7b=0xce;}_0x5b63ab[_0x5bec('0x25')](_0x2c7a7b);return _0x5b63ab[_0x5bec('0x2b')]('Content-Range',_0x63ac8+'-'+_0x5336b3+'/'+_0x57331b)[_0x5bec('0x2c')](_0x2961bd);}return null;};}function patchUpdates(_0x59b5b6){return function(_0x45863b){try{jsonpatch[_0x5bec('0x2d')](_0x45863b,_0x59b5b6,!![]);}catch(_0x3034c9){return BPromise[_0x5bec('0x2e')](_0x3034c9);}return _0x45863b['save']();};}function saveUpdates(_0x2b42c8,_0x1aba46){return function(_0xfc7d41){if(_0xfc7d41){return _0xfc7d41['update'](_0x2b42c8)[_0x5bec('0x1c')](function(_0x4cfb89){return _0x4cfb89;});}return null;};}function removeEntity(_0x14cdbf,_0x207192){return function(_0x29df14){if(_0x29df14){return _0x29df14['destroy']()[_0x5bec('0x1c')](function(){var _0x420ad4=_0x29df14['get']({'plain':!![]});var _0x34b441=_0x5bec('0x2f');return db[_0x5bec('0x30')][_0x5bec('0x31')]({'where':{'type':_0x34b441,'resourceId':_0x420ad4['id']}})[_0x5bec('0x1c')](function(){return _0x29df14;});})['then'](function(){_0x14cdbf[_0x5bec('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3793,_0x384f04){return function(_0x182b86){if(!_0x182b86){_0x2d3793[_0x5bec('0x24')](0x194);}return _0x182b86;};}function handleError(_0x2e421e,_0x1923fc){_0x1923fc=_0x1923fc||0x1f4;return function(_0x49c8ef){logger[_0x5bec('0x22')](_0x49c8ef[_0x5bec('0x32')]);if(_0x49c8ef[_0x5bec('0x33')]){delete _0x49c8ef['name'];}_0x2e421e[_0x5bec('0x25')](_0x1923fc)[_0x5bec('0x34')](_0x49c8ef);};}exports['index']=function(_0xdb0430,_0x58c34e){var _0x400e22={},_0x2c0b08={},_0x402e5d={'count':0x0,'rows':[]};var _0x49cdfa=_[_0x5bec('0x35')](db[_0x5bec('0x36')][_0x5bec('0x37')],function(_0x139859){return{'name':_0x139859[_0x5bec('0x38')],'type':_0x139859[_0x5bec('0x39')][_0x5bec('0x3a')]};});_0x2c0b08['model']=_[_0x5bec('0x35')](_0x49cdfa,_0x5bec('0x33'));_0x2c0b08[_0x5bec('0x3b')]=_[_0x5bec('0x3c')](_0xdb0430['query']);_0x2c0b08[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],_0x2c0b08['query']);_0x400e22['attributes']=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x40')]));_0x400e22['attributes']=_0x400e22['attributes'][_0x5bec('0x41')]?_0x400e22['attributes']:_0x2c0b08[_0x5bec('0x3f')];if(!_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x42')]('nolimit')){_0x400e22[_0x5bec('0x28')]=qs[_0x5bec('0x28')](_0xdb0430['query'][_0x5bec('0x28')]);_0x400e22[_0x5bec('0x27')]=qs[_0x5bec('0x27')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x27')]);}_0x400e22[_0x5bec('0x43')]=qs[_0x5bec('0x44')](_0xdb0430['query']['sort']);_0x400e22[_0x5bec('0x45')]=qs['filters'](_['pick'](_0xdb0430[_0x5bec('0x3b')],_0x2c0b08['filters']),_0x49cdfa);if(_0xdb0430['query']['filter']){_0x400e22[_0x5bec('0x45')]=_[_0x5bec('0x46')](_0x400e22[_0x5bec('0x45')],{'$or':_[_0x5bec('0x35')](_0x49cdfa,function(_0x48858a){if(_0x48858a[_0x5bec('0x39')]!==_0x5bec('0x47')){var _0xa4d32={};_0xa4d32[_0x48858a[_0x5bec('0x33')]]={'$like':'%'+_0xdb0430['query'][_0x5bec('0x48')]+'%'};return _0xa4d32;}})});}_0x400e22=_[_0x5bec('0x46')]({},_0x400e22,_0xdb0430[_0x5bec('0x49')]);var _0x51a3f9={'where':_0x400e22[_0x5bec('0x45')]};return db['Trunk'][_0x5bec('0x2a')](_0x51a3f9)[_0x5bec('0x1c')](function(_0x133d5c){_0x402e5d[_0x5bec('0x2a')]=_0x133d5c;if(_0xdb0430['query'][_0x5bec('0x4a')]){_0x400e22[_0x5bec('0x4b')]=[{'all':!![]}];}return db[_0x5bec('0x36')][_0x5bec('0x4c')](_0x400e22);})[_0x5bec('0x1c')](function(_0x123758){_0x402e5d[_0x5bec('0x4d')]=_0x123758;return _0x402e5d;})['then'](respondWithFilteredResult(_0x58c34e,_0x400e22))[_0x5bec('0x4e')](handleError(_0x58c34e,null));};exports[_0x5bec('0x4f')]=function(_0x5775ca,_0x273e09){var _0x3e6180={'raw':![],'where':{'id':_0x5775ca[_0x5bec('0x50')]['id']}},_0x34ee24={};_0x34ee24[_0x5bec('0x3f')]=_[_0x5bec('0x3c')](db[_0x5bec('0x36')]['rawAttributes']);_0x34ee24[_0x5bec('0x3b')]=_['keys'](_0x5775ca[_0x5bec('0x3b')]);_0x34ee24[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],_0x34ee24[_0x5bec('0x3b')]);_0x3e6180[_0x5bec('0x51')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0x5775ca[_0x5bec('0x3b')]['fields']));_0x3e6180[_0x5bec('0x51')]=_0x3e6180['attributes']['length']?_0x3e6180[_0x5bec('0x51')]:_0x34ee24['model'];if(_0x5775ca['query'][_0x5bec('0x4a')]){_0x3e6180[_0x5bec('0x4b')]=[{'all':!![]}];}_0x3e6180=_[_0x5bec('0x46')]({},_0x3e6180,_0x5775ca['options']);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0x3e6180)[_0x5bec('0x1c')](handleEntityNotFound(_0x273e09,null))[_0x5bec('0x1c')](respondWithResult(_0x273e09,null))['catch'](handleError(_0x273e09,null));};exports[_0x5bec('0x53')]=function(_0x209da3,_0x9cae50){var _0xc8563a={'where':{'id':_0x209da3[_0x5bec('0x50')]['id']}},_0x2f736c={};_0x2f736c[_0x5bec('0x3f')]=_['keys'](db['Trunk'][_0x5bec('0x37')]);_0xc8563a['attributes']=_[_0x5bec('0x3e')](_0x2f736c[_0x5bec('0x3f')],qs['fields'](_0x209da3[_0x5bec('0x3b')]['fields']));_0xc8563a[_0x5bec('0x51')]=_0xc8563a[_0x5bec('0x51')][_0x5bec('0x41')]?_0xc8563a[_0x5bec('0x51')]:_0x2f736c[_0x5bec('0x3f')];if(_0x209da3[_0x5bec('0x3b')][_0x5bec('0x4a')]){_0xc8563a[_0x5bec('0x4b')]=[{'all':!![]}];}_0xc8563a=_[_0x5bec('0x46')]({},_0xc8563a,_0x209da3[_0x5bec('0x49')]);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0xc8563a)[_0x5bec('0x1c')](handleEntityNotFound(_0x9cae50,null))[_0x5bec('0x1c')](function(_0x51b25d){if(_0x51b25d){var _0x2e33a7=_0x51b25d[_0x5bec('0x54')]({'plain':!![]});_0x2e33a7=qs[_0x5bec('0x55')](_0x2e33a7,['id','createdAt',_0x5bec('0x56')]);_0x209da3[_0x5bec('0x57')]=_[_0x5bec('0x55')](_0x209da3[_0x5bec('0x57')],['id',_0x5bec('0x58'),'updatedAt']);return db[_0x5bec('0x36')][_0x5bec('0x59')](_[_0x5bec('0x46')](_0x2e33a7,_0x209da3[_0x5bec('0x57')]),{'include':_0x209da3['query'][_0x5bec('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2b701f){var _0x38deb0=_0x209da3[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0x38deb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38deb0[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x1b3c40=_0x2b701f[_0x5bec('0x54')]({'plain':!![]});var _0xc3e3df=_0x5bec('0x2f');return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0xc3e3df,'userProfileId':_0x38deb0[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0xfa751f){if(_0xfa751f&&_0xfa751f[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x1b3c40[_0x5bec('0x33')],'resourceId':_0x1b3c40['id'],'type':_0xfa751f['name'],'sectionId':_0xfa751f['id']},{})[_0x5bec('0x1c')](function(){return _0x2b701f;});}else{return _0x2b701f;}})[_0x5bec('0x4e')](function(_0x4e899c){logger[_0x5bec('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e899c);throw _0x4e899c;});}return _0x2b701f;});}})[_0x5bec('0x1c')](respondWithResult(_0x9cae50,0xc9))[_0x5bec('0x4e')](handleError(_0x9cae50,null));};exports['create']=function(_0x5a2a85,_0xd54be0,_0xcac51d){var _0xb6cf85;return db[_0x5bec('0x36')][_0x5bec('0x59')](_0x5a2a85['body'],{'raw':!![]})[_0x5bec('0x1c')](function(_0x39cb06){_0xb6cf85=_0x39cb06;return db['Trunk'][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x44a945){var _0x34f31c=fs['readFileSync'](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),_0x5bec('0x61'));var _0x3ede1d=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x1ee139=ejs[_0x5bec('0x65')](_0x34f31c,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ee139);if(_0xb6cf85['registry']){var _0x3c305e=ejs[_0x5bec('0x65')](_0x3ede1d,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0x3c305e);}})[_0x5bec('0x1c')](function(){return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x59'),{'module':'chan_sip.so'});})['then'](function(){var _0xc81e8f=_0x5a2a85[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0xc81e8f)throw new Error(_0x5bec('0x69'));if(_0xc81e8f[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x17cd00=_0xb6cf85[_0x5bec('0x54')]({'plain':!![]});return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0x5bec('0x2f'),'userProfileId':_0xc81e8f[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0x325044){if(_0x325044&&_0x325044[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x17cd00[_0x5bec('0x33')],'resourceId':_0x17cd00['id'],'type':_0x325044[_0x5bec('0x33')],'sectionId':_0x325044['id']},{})[_0x5bec('0x1c')](function(){return _0xb6cf85;});}else{return _0xb6cf85;}})['catch'](function(_0x2e76c0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e76c0);throw _0x2e76c0;});}return _0xb6cf85;})[_0x5bec('0x1c')](respondWithResult(_0xd54be0,0xc9))['catch'](handleError(_0xd54be0,null));};exports[_0x5bec('0x6a')]=function(_0x5d6af3,_0x5ca280,_0x2e849b){var _0x1b5ec0;return db['Trunk'][_0x5bec('0x52')]({'where':{'id':_0x5d6af3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x5ca280,null))[_0x5bec('0x1c')](saveUpdates(_0x5d6af3[_0x5bec('0x57')],null))[_0x5bec('0x1c')](function(_0xb76af2){if(_0xb76af2){_0x1b5ec0=_0xb76af2;return db[_0x5bec('0x36')]['findAll']({'raw':!![]});}})['then'](function(_0x2e8cd3){if(_0x2e8cd3){var _0x122c7f=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),'utf8');var _0x44ceec=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x38be2d=ejs[_0x5bec('0x65')](_0x122c7f,{'trunks':_0x2e8cd3||[]});fs['writeFileSync'](_0x5bec('0x6b'),_0x38be2d);var _0xe5f9e5=ejs[_0x5bec('0x65')](_0x44ceec,{'trunks':_0x2e8cd3||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0xe5f9e5);return respondWithRpcPromise('Reload',_0x5bec('0x6a'),{'module':_0x5bec('0x6c')});}return null;})['then'](function(_0x195c12){if(_0x195c12){return _0x1b5ec0;}})['then'](respondWithResult(_0x5ca280,null))[_0x5bec('0x4e')](handleError(_0x5ca280,null));};exports[_0x5bec('0x31')]=function(_0x4646a3,_0x313e1c,_0x437c3e){var _0x3d7600;return db[_0x5bec('0x36')][_0x5bec('0x52')]({'where':{'id':_0x4646a3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x313e1c,null))[_0x5bec('0x1c')](removeEntity(_0x313e1c,null))[_0x5bec('0x1c')](function(){return db[_0x5bec('0x36')][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x1eaf2f){var _0x317e2a=fs[_0x5bec('0x62')](path['join'](config[_0x5bec('0x63')],'server/files/templates/trunk.ejs'),_0x5bec('0x61'));var _0xfcef92=fs['readFileSync'](path['join'](config[_0x5bec('0x63')],'server/files/templates/registry.ejs'),_0x5bec('0x61'));var _0x4b70df=ejs[_0x5bec('0x65')](_0x317e2a,{'trunks':_0x1eaf2f});var _0x27b40b=ejs['render'](_0xfcef92,{'trunks':_0x1eaf2f});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4b70df);fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_registers.conf',_0x27b40b);return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x31'),{'module':'chan_sip.so'});})[_0x5bec('0x4e')](handleError(_0x313e1c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index d794280..971af7d 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 _0x88af=['path','rimraf','./trunk.attributes','tools_trunks','lodash','util','moment','request-promise'];(function(_0x17828e,_0x14ab36){var _0x18e249=function(_0x57e8e4){while(--_0x57e8e4){_0x17828e['push'](_0x17828e['shift']());}};_0x18e249(++_0x14ab36);}(_0x88af,0x14c));var _0xf88a=function(_0x6978c0,_0x1f6765){_0x6978c0=_0x6978c0-0x0;var _0x361377=_0x88af[_0x6978c0];return _0x361377;};'use strict';var _=require(_0xf88a('0x0'));var util=require(_0xf88a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf88a('0x2'));var BPromise=require('bluebird');var rp=require(_0xf88a('0x3'));var fs=require('fs');var path=require(_0xf88a('0x4'));var rimraf=require(_0xf88a('0x5'));var config=require('../../config/environment');var attributes=require(_0xf88a('0x6'));module['exports']=function(_0x2d0d48,_0x4af07f){return _0x2d0d48['define']('Trunk',attributes,{'tableName':_0xf88a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf886=['Trunk','tools_trunks','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define'];(function(_0x1ea332,_0x190a9c){var _0x23e291=function(_0x3f6e65){while(--_0x3f6e65){_0x1ea332['push'](_0x1ea332['shift']());}};_0x23e291(++_0x190a9c);}(_0xf886,0x64));var _0x6f88=function(_0x13f980,_0x1e1c56){_0x13f980=_0x13f980-0x0;var _0x27153c=_0xf886[_0x13f980];return _0x27153c;};'use strict';var _=require(_0x6f88('0x0'));var util=require(_0x6f88('0x1'));var logger=require(_0x6f88('0x2'))('api');var moment=require(_0x6f88('0x3'));var BPromise=require(_0x6f88('0x4'));var rp=require(_0x6f88('0x5'));var fs=require('fs');var path=require(_0x6f88('0x6'));var rimraf=require(_0x6f88('0x7'));var config=require(_0x6f88('0x8'));var attributes=require(_0x6f88('0x9'));module[_0x6f88('0xa')]=function(_0x5d0a94,_0x5c0921){return _0x5d0a94[_0x6f88('0xb')](_0x6f88('0xc'),attributes,{'tableName':_0x6f88('0xd'),'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 fe7c887..dc7a60c 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 _0x802c=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetTrunk','options','raw','where','map','include','model','attributes','ShowTrunk','Trunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x802c,0xd1));var _0xc802=function(_0x230282,_0x120a70){_0x230282=_0x230282-0x0;var _0x52f047=_0x802c[_0x230282];return _0x52f047;};'use strict';var _=require(_0xc802('0x0'));var util=require(_0xc802('0x1'));var moment=require(_0xc802('0x2'));var BPromise=require(_0xc802('0x3'));var rs=require(_0xc802('0x4'));var fs=require('fs');var Redis=require(_0xc802('0x5'));var db=require(_0xc802('0x6'))['db'];var utils=require(_0xc802('0x7'));var logger=require(_0xc802('0x8'))('rpc');var config=require(_0xc802('0x9'));var jayson=require(_0xc802('0xa'));var client=jayson[_0xc802('0xb')][_0xc802('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5aeb37,_0x231a01,_0x300985){return new BPromise(function(_0x144b78,_0x8b96c0){return client[_0xc802('0xd')](_0x5aeb37,_0x300985)[_0xc802('0xe')](function(_0x1720b1){logger[_0xc802('0xf')](_0xc802('0x10'),_0x231a01,_0xc802('0x11'));logger[_0xc802('0x12')]('Trunk,\x20%s,\x20%s,\x20%s',_0x231a01,_0xc802('0x11'),JSON[_0xc802('0x13')](_0x1720b1));if(_0x1720b1[_0xc802('0x14')]){if(_0x1720b1['error'][_0xc802('0x15')]===0x1f4){logger[_0xc802('0x14')](_0xc802('0x10'),_0x231a01,_0x1720b1[_0xc802('0x14')][_0xc802('0x16')]);return _0x8b96c0(_0x1720b1[_0xc802('0x14')][_0xc802('0x16')]);}logger['error'](_0xc802('0x10'),_0x231a01,_0x1720b1[_0xc802('0x14')][_0xc802('0x16')]);return _0x144b78(_0x1720b1[_0xc802('0x14')]['message']);}else{logger[_0xc802('0xf')]('Trunk,\x20%s,\x20%s',_0x231a01,_0xc802('0x11'));_0x144b78(_0x1720b1[_0xc802('0x17')][_0xc802('0x16')]);}})[_0xc802('0x18')](function(_0x266a12){logger[_0xc802('0x14')](_0xc802('0x10'),_0x231a01,_0x266a12);_0x8b96c0(_0x266a12);});});}exports[_0xc802('0x19')]=function(_0x1c93d5){var _0x57d6af=this;return new Promise(function(_0x3a5bc6,_0x415efb){return db['Trunk']['findAll']({'raw':_0x1c93d5[_0xc802('0x1a')]?_0x1c93d5[_0xc802('0x1a')][_0xc802('0x1b')]===undefined?!![]:![]:!![],'where':_0x1c93d5[_0xc802('0x1a')]?_0x1c93d5[_0xc802('0x1a')][_0xc802('0x1c')]||null:null,'attributes':_0x1c93d5[_0xc802('0x1a')]?_0x1c93d5[_0xc802('0x1a')]['attributes']||null:null,'limit':_0x1c93d5[_0xc802('0x1a')]?_0x1c93d5['options']['limit']||null:null,'include':_0x1c93d5[_0xc802('0x1a')]?_0x1c93d5[_0xc802('0x1a')]['include']?_[_0xc802('0x1d')](_0x1c93d5[_0xc802('0x1a')][_0xc802('0x1e')],function(_0x160201){return{'model':db[_0x160201[_0xc802('0x1f')]],'as':_0x160201['as'],'attributes':_0x160201['attributes'],'include':_0x160201[_0xc802('0x1e')]?_[_0xc802('0x1d')](_0x160201[_0xc802('0x1e')],function(_0x1cd2d5){return{'model':db[_0x1cd2d5['model']],'as':_0x1cd2d5['as'],'attributes':_0x1cd2d5['attributes'],'include':_0x1cd2d5[_0xc802('0x1e')]?_[_0xc802('0x1d')](_0x1cd2d5[_0xc802('0x1e')],function(_0x53ce48){return{'model':db[_0x53ce48['model']],'as':_0x53ce48['as'],'attributes':_0x53ce48[_0xc802('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc802('0xe')](function(_0x9a86e7){logger[_0xc802('0xf')]('GetTrunk',_0x1c93d5);logger[_0xc802('0x12')]('GetTrunk',_0x1c93d5,JSON[_0xc802('0x13')](_0x9a86e7));_0x3a5bc6(_0x9a86e7);})[_0xc802('0x18')](function(_0x43aab1){logger[_0xc802('0x14')](_0xc802('0x19'),_0x43aab1['message'],_0x1c93d5);_0x415efb(_0x57d6af[_0xc802('0x14')](0x1f4,_0x43aab1[_0xc802('0x16')]));});});};exports[_0xc802('0x21')]=function(_0x3a0e2f){var _0xb1f9=this;return new Promise(function(_0x5ef95c,_0x4b1ddd){return db[_0xc802('0x22')][_0xc802('0x23')]({'raw':_0x3a0e2f[_0xc802('0x1a')]?_0x3a0e2f[_0xc802('0x1a')][_0xc802('0x1b')]===undefined?!![]:![]:!![],'where':_0x3a0e2f[_0xc802('0x1a')]?_0x3a0e2f[_0xc802('0x1a')][_0xc802('0x1c')]||null:null,'attributes':_0x3a0e2f[_0xc802('0x1a')]?_0x3a0e2f['options'][_0xc802('0x20')]||null:null,'include':_0x3a0e2f[_0xc802('0x1a')]?_0x3a0e2f[_0xc802('0x1a')][_0xc802('0x1e')]?_[_0xc802('0x1d')](_0x3a0e2f[_0xc802('0x1a')][_0xc802('0x1e')],function(_0x2788a0){return{'model':db[_0x2788a0['model']],'as':_0x2788a0['as'],'attributes':_0x2788a0['attributes'],'include':_0x2788a0[_0xc802('0x1e')]?_[_0xc802('0x1d')](_0x2788a0['include'],function(_0x1fe53a){return{'model':db[_0x1fe53a[_0xc802('0x1f')]],'as':_0x1fe53a['as'],'attributes':_0x1fe53a[_0xc802('0x20')],'include':_0x1fe53a['include']?_[_0xc802('0x1d')](_0x1fe53a[_0xc802('0x1e')],function(_0x8f6e30){return{'model':db[_0x8f6e30[_0xc802('0x1f')]],'as':_0x8f6e30['as'],'attributes':_0x8f6e30[_0xc802('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18bb71){logger['info']('ShowTrunk',_0x3a0e2f);logger[_0xc802('0x12')](_0xc802('0x21'),_0x3a0e2f,JSON[_0xc802('0x13')](_0x18bb71));_0x5ef95c(_0x18bb71);})[_0xc802('0x18')](function(_0x3df963){logger[_0xc802('0x14')](_0xc802('0x21'),_0x3df963[_0xc802('0x16')],_0x3a0e2f);_0x4b1ddd(_0xb1f9['error'](0x1f4,_0x3df963[_0xc802('0x16')]));});});}; \ No newline at end of file +var _0x0994=['result','catch','GetTrunk','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','Trunk','ShowTrunk','debug','util','moment','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','error','code','Trunk,\x20%s,\x20%s','message'];(function(_0x2967f7,_0x4f9bff){var _0x205198=function(_0x18e46f){while(--_0x18e46f){_0x2967f7['push'](_0x2967f7['shift']());}};_0x205198(++_0x4f9bff);}(_0x0994,0xb1));var _0x4099=function(_0x22a96e,_0x100624){_0x22a96e=_0x22a96e-0x0;var _0xfbb257=_0x0994[_0x22a96e];return _0xfbb257;};'use strict';var _=require('lodash');var util=require(_0x4099('0x0'));var moment=require(_0x4099('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4099('0x2'));var logger=require(_0x4099('0x3'))('rpc');var config=require(_0x4099('0x4'));var jayson=require(_0x4099('0x5'));var client=jayson[_0x4099('0x6')][_0x4099('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x17f8b9,_0x39fbae,_0x5504d2){return new BPromise(function(_0x5cb272,_0x1fee97){return client['request'](_0x17f8b9,_0x5504d2)['then'](function(_0x359540){logger[_0x4099('0x8')]('Trunk,\x20%s,\x20%s',_0x39fbae,_0x4099('0x9'));logger['debug'](_0x4099('0xa'),_0x39fbae,'request\x20sent',JSON['stringify'](_0x359540));if(_0x359540[_0x4099('0xb')]){if(_0x359540['error'][_0x4099('0xc')]===0x1f4){logger[_0x4099('0xb')](_0x4099('0xd'),_0x39fbae,_0x359540['error'][_0x4099('0xe')]);return _0x1fee97(_0x359540['error'][_0x4099('0xe')]);}logger[_0x4099('0xb')](_0x4099('0xd'),_0x39fbae,_0x359540[_0x4099('0xb')][_0x4099('0xe')]);return _0x5cb272(_0x359540[_0x4099('0xb')]['message']);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x39fbae,'request\x20sent');_0x5cb272(_0x359540[_0x4099('0xf')][_0x4099('0xe')]);}})[_0x4099('0x10')](function(_0x4eed47){logger[_0x4099('0xb')](_0x4099('0xd'),_0x39fbae,_0x4eed47);_0x1fee97(_0x4eed47);});});}exports[_0x4099('0x11')]=function(_0x4977c6){var _0x41aefe=this;return new Promise(function(_0x582cd2,_0x4845a6){return db['Trunk'][_0x4099('0x12')]({'raw':_0x4977c6[_0x4099('0x13')]?_0x4977c6[_0x4099('0x13')][_0x4099('0x14')]===undefined?!![]:![]:!![],'where':_0x4977c6[_0x4099('0x13')]?_0x4977c6['options'][_0x4099('0x15')]||null:null,'attributes':_0x4977c6[_0x4099('0x13')]?_0x4977c6[_0x4099('0x13')][_0x4099('0x16')]||null:null,'limit':_0x4977c6['options']?_0x4977c6[_0x4099('0x13')][_0x4099('0x17')]||null:null,'include':_0x4977c6[_0x4099('0x13')]?_0x4977c6[_0x4099('0x13')][_0x4099('0x18')]?_[_0x4099('0x19')](_0x4977c6[_0x4099('0x13')][_0x4099('0x18')],function(_0x3498b2){return{'model':db[_0x3498b2[_0x4099('0x1a')]],'as':_0x3498b2['as'],'attributes':_0x3498b2[_0x4099('0x16')],'include':_0x3498b2[_0x4099('0x18')]?_[_0x4099('0x19')](_0x3498b2['include'],function(_0x3ddd65){return{'model':db[_0x3ddd65['model']],'as':_0x3ddd65['as'],'attributes':_0x3ddd65['attributes'],'include':_0x3ddd65['include']?_['map'](_0x3ddd65['include'],function(_0x4b37bf){return{'model':db[_0x4b37bf[_0x4099('0x1a')]],'as':_0x4b37bf['as'],'attributes':_0x4b37bf[_0x4099('0x16')]};}):[]};}):[]};}):[]:[]})[_0x4099('0x1b')](function(_0x1d0124){logger[_0x4099('0x8')](_0x4099('0x11'),_0x4977c6);logger['debug'](_0x4099('0x11'),_0x4977c6,JSON[_0x4099('0x1c')](_0x1d0124));_0x582cd2(_0x1d0124);})[_0x4099('0x10')](function(_0x4dbaa8){logger[_0x4099('0xb')](_0x4099('0x11'),_0x4dbaa8['message'],_0x4977c6);_0x4845a6(_0x41aefe[_0x4099('0xb')](0x1f4,_0x4dbaa8[_0x4099('0xe')]));});});};exports['ShowTrunk']=function(_0x2efd6d){var _0x32460f=this;return new Promise(function(_0xd9ffe5,_0x5a3cc9){return db[_0x4099('0x1d')]['find']({'raw':_0x2efd6d[_0x4099('0x13')]?_0x2efd6d[_0x4099('0x13')][_0x4099('0x14')]===undefined?!![]:![]:!![],'where':_0x2efd6d[_0x4099('0x13')]?_0x2efd6d[_0x4099('0x13')][_0x4099('0x15')]||null:null,'attributes':_0x2efd6d[_0x4099('0x13')]?_0x2efd6d[_0x4099('0x13')][_0x4099('0x16')]||null:null,'include':_0x2efd6d[_0x4099('0x13')]?_0x2efd6d[_0x4099('0x13')]['include']?_[_0x4099('0x19')](_0x2efd6d[_0x4099('0x13')][_0x4099('0x18')],function(_0x3a0613){return{'model':db[_0x3a0613[_0x4099('0x1a')]],'as':_0x3a0613['as'],'attributes':_0x3a0613[_0x4099('0x16')],'include':_0x3a0613[_0x4099('0x18')]?_['map'](_0x3a0613[_0x4099('0x18')],function(_0x5ae6db){return{'model':db[_0x5ae6db['model']],'as':_0x5ae6db['as'],'attributes':_0x5ae6db[_0x4099('0x16')],'include':_0x5ae6db['include']?_[_0x4099('0x19')](_0x5ae6db[_0x4099('0x18')],function(_0x436571){return{'model':db[_0x436571[_0x4099('0x1a')]],'as':_0x436571['as'],'attributes':_0x436571[_0x4099('0x16')]};}):[]};}):[]};}):[]:[]})[_0x4099('0x1b')](function(_0x3bbeb4){logger[_0x4099('0x8')](_0x4099('0x1e'),_0x2efd6d);logger[_0x4099('0x1f')](_0x4099('0x1e'),_0x2efd6d,JSON['stringify'](_0x3bbeb4));_0xd9ffe5(_0x3bbeb4);})[_0x4099('0x10')](function(_0x339376){logger['error']('ShowTrunk',_0x339376[_0x4099('0xe')],_0x2efd6d);_0x5a3cc9(_0x32460f[_0x4099('0xb')](0x1f4,_0x339376['message']));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 5a0ede4..057819a 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 _0xda11=['./user-setting.controller','put','/:id','isAuthenticated','express','../../components/auth/service'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xda11,0xb8));var _0x1da1=function(_0xa88b3c,_0x3c3980){_0xa88b3c=_0xa88b3c-0x0;var _0x40f9af=_0xda11[_0xa88b3c];return _0x40f9af;};'use strict';var express=require(_0x1da1('0x0'));var router=express['Router']();var auth=require(_0x1da1('0x1'));var controller=require(_0x1da1('0x2'));router[_0x1da1('0x3')](_0x1da1('0x4'),auth[_0x1da1('0x5')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x6f75=['express','Router','../../components/auth/service','/:id','isAuthenticated','update'];(function(_0x290b22,_0x307bd6){var _0x4ca772=function(_0x1c3200){while(--_0x1c3200){_0x290b22['push'](_0x290b22['shift']());}};_0x4ca772(++_0x307bd6);}(_0x6f75,0x8a));var _0x56f7=function(_0x51b34b,_0x49bfd8){_0x51b34b=_0x51b34b-0x0;var _0x267fd1=_0x6f75[_0x51b34b];return _0x267fd1;};'use strict';var express=require(_0x56f7('0x0'));var router=express[_0x56f7('0x1')]();var auth=require(_0x56f7('0x2'));var controller=require('./user-setting.controller');router['put'](_0x56f7('0x3'),auth[_0x56f7('0x4')](),controller[_0x56f7('0x5')]);module['exports']=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 0703f3f..df3c357 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 _0xb376=['warning','info','exports','ENUM','error','BOOLEAN','TEXT','sequelize'];(function(_0x208128,_0x9e2557){var _0x213a02=function(_0x29fc57){while(--_0x29fc57){_0x208128['push'](_0x208128['shift']());}};_0x213a02(++_0x9e2557);}(_0xb376,0x107));var _0x6b37=function(_0x218789,_0x56d952){_0x218789=_0x218789-0x0;var _0x577b11=_0xb376[_0x218789];return _0x577b11;};'use strict';var Sequelize=require(_0x6b37('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x6b37('0x1'),_0x6b37('0x2'),'debug'];module[_0x6b37('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x6b37('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x6b37('0x5'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x6b37('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x6b37('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ No newline at end of file +var _0x692e=['DATE','INTEGER','UserId','error','warning','info','exports','BOOLEAN','TEXT'];(function(_0xb18ed,_0x10a675){var _0x4ee4a7=function(_0x5e0ba7){while(--_0x5e0ba7){_0xb18ed['push'](_0xb18ed['shift']());}};_0x4ee4a7(++_0x10a675);}(_0x692e,0x12c));var _0xe692=function(_0x9d4500,_0x3283bc){_0x9d4500=_0x9d4500-0x0;var _0x3b64a1=_0x692e[_0x9d4500];return _0x3b64a1;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0xe692('0x0'),_0xe692('0x1'),_0xe692('0x2'),'debug'];module[_0xe692('0x3')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xe692('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xe692('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xe692('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xe692('0x7')],'unique':_0xe692('0x8')}}; \ 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 7903953..53c5179 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 _0xf9bc=['catch','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','localhost','status','json','update','sendStatus','error','name','send','user','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','then','body'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0xf9bc,0x7e));var _0xcf9b=function(_0x4f1cef,_0x54015c){_0x4f1cef=_0x4f1cef-0x0;var _0x42a616=_0xf9bc[_0x4f1cef];return _0x42a616;};'use strict';var _=require('lodash');var Redis=require(_0xcf9b('0x0'));var logger=require(_0xcf9b('0x1'))(_0xcf9b('0x2'));var config=require(_0xcf9b('0x3'));var db=require(_0xcf9b('0x4'))['db'];var socket=require(_0xcf9b('0x5'))(new Redis(config[_0xcf9b('0x6')]));require(_0xcf9b('0x7'))[_0xcf9b('0x8')](socket);config[_0xcf9b('0x6')]=_['defaults'](config['redis'],{'host':_0xcf9b('0x9'),'port':0x18eb});function respondWithResult(_0x2ba407,_0xbf765c){_0xbf765c=_0xbf765c||0xc8;return function(_0x2493f0){if(_0x2493f0){return _0x2ba407[_0xcf9b('0xa')](_0xbf765c)[_0xcf9b('0xb')](_0x2493f0);}};}function saveUpdates(_0x182df7){return function(_0x198807){if(_0x198807){return _0x198807[_0xcf9b('0xc')](_0x182df7)['then'](function(_0x415d49){return _0x415d49;});}return null;};}function handleEntityNotFound(_0x1c0b8a){return function(_0x5563d1){if(!_0x5563d1){_0x1c0b8a[_0xcf9b('0xd')](0x194);}return _0x5563d1;};}function handleError(_0x4c1db2,_0x546d46){_0x546d46=_0x546d46||0x1f4;return function(_0x56e384){logger[_0xcf9b('0xe')](_0x56e384['stack']);if(_0x56e384[_0xcf9b('0xf')]){delete _0x56e384[_0xcf9b('0xf')];}_0x4c1db2['status'](_0x546d46)[_0xcf9b('0x10')](_0x56e384);};}exports[_0xcf9b('0xc')]=function(_0x3851c3,_0x24e525){if(_0x3851c3[_0xcf9b('0x11')]['role']!==_0xcf9b('0x12'))throw new Error(_0xcf9b('0x13'));if(isNaN(Number(_0x3851c3[_0xcf9b('0x14')]['id'])))throw new Error(_0xcf9b('0x15'));return db['UserSetting']['find']({'where':{'id':_0x3851c3[_0xcf9b('0x14')]['id']}})[_0xcf9b('0x16')](handleEntityNotFound(_0x24e525,null))[_0xcf9b('0x16')](saveUpdates(_0x3851c3[_0xcf9b('0x17')],null))[_0xcf9b('0x16')](respondWithResult(_0x24e525,null))[_0xcf9b('0x18')](handleError(_0x24e525,null));}; \ No newline at end of file +var _0xd0b5=['../../config/logger','api','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','status','then','sendStatus','error','stack','name','send','update','role','admin','params','find','catch'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0xd0b5,0x1b8));var _0x5d0b=function(_0x598489,_0x246ab6){_0x598489=_0x598489-0x0;var _0x48f6b9=_0xd0b5[_0x598489];return _0x48f6b9;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0x5d0b('0x0'))(_0x5d0b('0x1'));var config=require('../../config/environment');var db=require(_0x5d0b('0x2'))['db'];var socket=require(_0x5d0b('0x3'))(new Redis(config[_0x5d0b('0x4')]));require(_0x5d0b('0x5'))[_0x5d0b('0x6')](socket);config[_0x5d0b('0x4')]=_[_0x5d0b('0x7')](config[_0x5d0b('0x4')],{'host':_0x5d0b('0x8'),'port':0x18eb});function respondWithResult(_0x1db3b1,_0x2582f3){_0x2582f3=_0x2582f3||0xc8;return function(_0x1407d6){if(_0x1407d6){return _0x1db3b1[_0x5d0b('0x9')](_0x2582f3)['json'](_0x1407d6);}};}function saveUpdates(_0x270b84){return function(_0x48a3cf){if(_0x48a3cf){return _0x48a3cf['update'](_0x270b84)[_0x5d0b('0xa')](function(_0x2a21e2){return _0x2a21e2;});}return null;};}function handleEntityNotFound(_0x4f885a){return function(_0x164716){if(!_0x164716){_0x4f885a[_0x5d0b('0xb')](0x194);}return _0x164716;};}function handleError(_0x5e30dd,_0x13e95b){_0x13e95b=_0x13e95b||0x1f4;return function(_0x1c16d5){logger[_0x5d0b('0xc')](_0x1c16d5[_0x5d0b('0xd')]);if(_0x1c16d5[_0x5d0b('0xe')]){delete _0x1c16d5[_0x5d0b('0xe')];}_0x5e30dd['status'](_0x13e95b)[_0x5d0b('0xf')](_0x1c16d5);};}exports[_0x5d0b('0x10')]=function(_0x10d9aa,_0x263300){if(_0x10d9aa['user'][_0x5d0b('0x11')]!==_0x5d0b('0x12'))throw new Error('Unauthorized');if(isNaN(Number(_0x10d9aa[_0x5d0b('0x13')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db['UserSetting'][_0x5d0b('0x14')]({'where':{'id':_0x10d9aa[_0x5d0b('0x13')]['id']}})[_0x5d0b('0xa')](handleEntityNotFound(_0x263300,null))[_0x5d0b('0xa')](saveUpdates(_0x10d9aa['body'],null))[_0x5d0b('0xa')](respondWithResult(_0x263300,null))[_0x5d0b('0x15')](handleError(_0x263300,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 b412951..1083717 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 _0x98b0=['UserSetting','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x98b0,0x167));var _0x098b=function(_0x305486,_0x24acd4){_0x305486=_0x305486-0x0;var _0xa04940=_0x98b0[_0x305486];return _0xa04940;};'use strict';var EventEmitter=require(_0x098b('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x098b('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x098b('0x2')](0x0);var events={'afterCreate':_0x098b('0x3'),'afterUpdate':_0x098b('0x4'),'afterDestroy':_0x098b('0x5')};function emitEvent(_0x1b36c3){return function(_0x38db96,_0x147f15,_0x5dde78){UserSettingEvents[_0x098b('0x6')](_0x1b36c3+':'+_0x38db96['id'],_0x38db96);UserSettingEvents[_0x098b('0x6')](_0x1b36c3,_0x38db96);_0x5dde78(null);};}for(var e in events){if(events[_0x098b('0x7')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0x6501=['UserSetting','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xb9a1b9,_0x4678bc){var _0x248d6e=function(_0x4c2085){while(--_0x4c2085){_0xb9a1b9['push'](_0xb9a1b9['shift']());}};_0x248d6e(++_0x4678bc);}(_0x6501,0x8e));var _0x1650=function(_0x1b720a,_0x495792){_0x1b720a=_0x1b720a-0x0;var _0x4978d5=_0x6501[_0x1b720a];return _0x4978d5;};'use strict';var EventEmitter=require(_0x1650('0x0'));var UserSetting=require(_0x1650('0x1'))['db'][_0x1650('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1650('0x3'),'afterUpdate':_0x1650('0x4'),'afterDestroy':'remove'};function emitEvent(_0x8826cc){return function(_0x2def7a,_0x3ffcd8,_0xc3f0ae){UserSettingEvents[_0x1650('0x5')](_0x8826cc+':'+_0x2def7a['id'],_0x2def7a);UserSettingEvents['emit'](_0x8826cc,_0x2def7a);_0xc3f0ae(null);};}for(var e in events){if(events[_0x1650('0x6')](e)){var event=events[e];UserSetting[_0x1650('0x7')](e,emitEvent(event));}}module[_0x1650('0x8')]=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 a24e2dc..41e529e 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 _0x593e=['./user-setting.attributes','exports','define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x6c3df8,_0x57e22e){var _0x492833=function(_0x27afad){while(--_0x27afad){_0x6c3df8['push'](_0x6c3df8['shift']());}};_0x492833(++_0x57e22e);}(_0x593e,0xcb));var _0xe593=function(_0x5f3163,_0x506616){_0x5f3163=_0x5f3163-0x0;var _0x5ee639=_0x593e[_0x5f3163];return _0x5ee639;};'use strict';var attributes=require(_0xe593('0x0'));module[_0xe593('0x1')]=function(_0x12f6de){return _0x12f6de[_0xe593('0x2')](_0xe593('0x3'),attributes,{'tableName':_0xe593('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c7c48){if(!_0x2c7c48[_0xe593('0x5')])_0x2c7c48['clientSideLoggingEnabledSince']=null;else if(_0x2c7c48[_0xe593('0x6')]===null)_0x2c7c48[_0xe593('0x6')]=new Date();}}});}; \ No newline at end of file +var _0x4c71=['define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x566f77,_0x275098){var _0x1e94a6=function(_0x571676){while(--_0x571676){_0x566f77['push'](_0x566f77['shift']());}};_0x1e94a6(++_0x275098);}(_0x4c71,0x12b));var _0x14c7=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x4c71[_0x5d2803];return _0xdcad2c;};'use strict';var attributes=require(_0x14c7('0x0'));module[_0x14c7('0x1')]=function(_0x581a30){return _0x581a30[_0x14c7('0x2')](_0x14c7('0x3'),attributes,{'tableName':_0x14c7('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b1786){if(!_0x2b1786[_0x14c7('0x5')])_0x2b1786['clientSideLoggingEnabledSince']=null;else if(_0x2b1786[_0x14c7('0x6')]===null)_0x2b1786[_0x14c7('0x6')]=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 36f4aea..23bf37f 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 _0x8c91=['length','user-setting:','save','remove','emit','user-setting:update:user-','UserId','register'];(function(_0x3a607e,_0x54d530){var _0x37b106=function(_0x1becae){while(--_0x1becae){_0x3a607e['push'](_0x3a607e['shift']());}};_0x37b106(++_0x54d530);}(_0x8c91,0xaa));var _0x18c9=function(_0x3732f1,_0x4d8664){_0x3732f1=_0x3732f1-0x0;var _0x5ca6c2=_0x8c91[_0x3732f1];return _0x5ca6c2;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x18c9('0x0'),_0x18c9('0x1'),'update'];function createListener(_0x136bf0,_0x13b0e7){return function(_0x7db7c7){_0x13b0e7['emit'](_0x136bf0,_0x7db7c7);if(_0x136bf0==='user-setting:update'){_0x13b0e7[_0x18c9('0x2')](_0x18c9('0x3')+_0x7db7c7[_0x18c9('0x4')],_0x7db7c7);}};}exports[_0x18c9('0x5')]=function(_0x56c0b8){for(var _0x5002d7=0x0,_0x19faa6=events[_0x18c9('0x6')];_0x5002d7<_0x19faa6;_0x5002d7++){var _0x37160d=events[_0x5002d7];var _0x2ee650=createListener(_0x18c9('0x7')+_0x37160d,_0x56c0b8);UserSettingEvents['on'](_0x37160d,_0x2ee650);}}; \ No newline at end of file +var _0x2b98=['UserId','length','user-setting:','save','remove','update','emit','user-setting:update'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2b98,0x1f3));var _0x82b9=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x2b98[_0x75f869];return _0x10af8b;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x82b9('0x0'),_0x82b9('0x1'),_0x82b9('0x2')];function createListener(_0x2f2cf9,_0x40f1aa){return function(_0x5e8e0b){_0x40f1aa[_0x82b9('0x3')](_0x2f2cf9,_0x5e8e0b);if(_0x2f2cf9===_0x82b9('0x4')){_0x40f1aa[_0x82b9('0x3')]('user-setting:update:user-'+_0x5e8e0b[_0x82b9('0x5')],_0x5e8e0b);}};}exports['register']=function(_0x14548d){for(var _0x55314f=0x0,_0x461888=events[_0x82b9('0x6')];_0x55314f<_0x461888;_0x55314f++){var _0x367cae=events[_0x55314f];var _0x3be5a4=createListener(_0x82b9('0x7')+_0x367cae,_0x14548d);UserSettingEvents['on'](_0x367cae,_0x3be5a4);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 6030f63..1ef7b67 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 _0xbac1=['getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/fax_accounts','/:id/mail_accounts','/:id/openchannel_accounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','getScheduledCalls','/:id/api_key','post','addContacts','/create_many','bulkCreate','diskStorage','root','server/files/images/','format','%s-%s','now','originalname','file','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addWhatsappInteractions','addFaxAccounts','addSmsAccounts','addWhatsappAccounts','createApiKey','delete','removeQueues','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','messengerSoundNotification','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','/describe','describe','/whoami','whoami','/presence','isAuthenticated','/:id','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xbac1,0x17f));var _0x1bac=function(_0x7b153,_0x3b83cc){_0x7b153=_0x7b153-0x0;var _0x13fd7b=_0xbac1[_0x7b153];return _0x13fd7b;};'use strict';var multer=require('multer');var util=require(_0x1bac('0x0'));var path=require(_0x1bac('0x1'));var timeout=require(_0x1bac('0x2'));var express=require(_0x1bac('0x3'));var router=express[_0x1bac('0x4')]();var fs_extra=require(_0x1bac('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1bac('0x6'));var config=require(_0x1bac('0x7'));var controller=require(_0x1bac('0x8'));router[_0x1bac('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1bac('0x9')](_0x1bac('0xa'),auth['isAuthenticated'](),controller[_0x1bac('0xb')]);router[_0x1bac('0x9')](_0x1bac('0xc'),auth['isAuthenticated'](),controller[_0x1bac('0xd')]);router[_0x1bac('0x9')](_0x1bac('0xe'),auth[_0x1bac('0xf')](),controller['getPresence']);router[_0x1bac('0x9')](_0x1bac('0x10'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x11')]);router[_0x1bac('0x9')](_0x1bac('0x12'),controller[_0x1bac('0x13')]);router[_0x1bac('0x9')]('/:id/open_tabs',auth[_0x1bac('0xf')](),controller['getOpenTabs']);router['get'](_0x1bac('0x14'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x15')]);router[_0x1bac('0x9')](_0x1bac('0x16'),auth['isAuthenticated'](),controller[_0x1bac('0x17')]);router['get'](_0x1bac('0x18'),auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router[_0x1bac('0x9')]('/:id/groups',auth['isAuthenticated'](),controller[_0x1bac('0x19')]);router[_0x1bac('0x9')](_0x1bac('0x1a'),auth[_0x1bac('0xf')](),controller['getRecordings']);router['get'](_0x1bac('0x1b'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x1c')]);router[_0x1bac('0x9')](_0x1bac('0x1d'),auth['isAuthenticated'](),controller[_0x1bac('0x1e')]);router[_0x1bac('0x9')](_0x1bac('0x1f'),auth['isAuthenticated'](),controller[_0x1bac('0x20')]);router[_0x1bac('0x9')](_0x1bac('0x21'),auth['isAuthenticated'](),controller[_0x1bac('0x22')]);router['get'](_0x1bac('0x23'),auth[_0x1bac('0xf')](),controller['getSmsInteractions']);router[_0x1bac('0x9')](_0x1bac('0x24'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x25')]);router[_0x1bac('0x9')](_0x1bac('0x26'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x27')]);router[_0x1bac('0x9')](_0x1bac('0x28'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x29')]);router[_0x1bac('0x9')](_0x1bac('0x2a'),auth[_0x1bac('0xf')](),controller['getLists']);router[_0x1bac('0x9')](_0x1bac('0x2b'),auth['isAuthenticated'](),controller[_0x1bac('0x2c')]);router[_0x1bac('0x9')]('/:id/prefixes',auth[_0x1bac('0xf')](),controller['getVoicePrefixes']);router[_0x1bac('0x9')](_0x1bac('0x2d'),auth[_0x1bac('0xf')](),controller['getFaxAccounts']);router[_0x1bac('0x9')](_0x1bac('0x2e'),auth[_0x1bac('0xf')](),controller['getMailAccounts']);router['get'](_0x1bac('0x2f'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0x1bac('0x9')](_0x1bac('0x30'),auth[_0x1bac('0xf')](),controller['getSmsAccounts']);router[_0x1bac('0x9')](_0x1bac('0x31'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x32')]);router['get']('/:id/whatsapp_accounts',auth[_0x1bac('0xf')](),controller['getWhatsappAccounts']);router[_0x1bac('0x9')]('/:id/scheduled_calls',auth[_0x1bac('0xf')](),controller[_0x1bac('0x33')]);router[_0x1bac('0x9')](_0x1bac('0x34'),auth[_0x1bac('0xf')](),controller['getApiKey']);router[_0x1bac('0x35')]('/:id/contacts',auth[_0x1bac('0xf')](),controller[_0x1bac('0x36')]);router[_0x1bac('0x35')]('/',auth[_0x1bac('0xf')](),controller['create']);router[_0x1bac('0x35')](_0x1bac('0x37'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x38')]);router[_0x1bac('0x35')](_0x1bac('0x16'),auth[_0x1bac('0xf')](),controller['addQueues']);var upload=multer({'storage':multer[_0x1bac('0x39')]({'destination':function(_0x323103,_0x1d0ea9,_0xb67159){_0xb67159(null,path['join'](config[_0x1bac('0x3a')],_0x1bac('0x3b')));},'filename':function(_0xedce6c,_0x2389fc,_0x13e3f2){_0x13e3f2(null,util[_0x1bac('0x3c')](_0x1bac('0x3d'),Date[_0x1bac('0x3e')](),_0x2389fc[_0x1bac('0x3f')]));}})});router[_0x1bac('0x35')](_0x1bac('0x12'),upload['single'](_0x1bac('0x40')),controller['addAvatar']);router[_0x1bac('0x35')](_0x1bac('0x41'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x42')]);router[_0x1bac('0x35')](_0x1bac('0x43'),auth['isAuthenticated'](),controller['logout']);router['post'](_0x1bac('0x44'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x45')]);router[_0x1bac('0x35')](_0x1bac('0x46'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x47')]);router[_0x1bac('0x35')](_0x1bac('0x28'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x48')]);router[_0x1bac('0x35')](_0x1bac('0x49'),auth['isAuthenticated'](),controller[_0x1bac('0x4a')]);router[_0x1bac('0x35')](_0x1bac('0x4b'),auth['isAuthenticated'](),controller[_0x1bac('0x4c')]);router['post']('/:id/fax_interactions',auth[_0x1bac('0xf')](),controller['addFaxInteractions']);router[_0x1bac('0x35')](_0x1bac('0x4d'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x4e')]);router['post'](_0x1bac('0x4f'),auth[_0x1bac('0xf')](),controller['addOpenchannelInteractions']);router['post']('/:id/whatsapp_interactions',auth[_0x1bac('0xf')](),controller[_0x1bac('0x50')]);router[_0x1bac('0x35')](_0x1bac('0x2d'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x51')]);router[_0x1bac('0x35')](_0x1bac('0x2e'),auth['isAuthenticated'](),controller['addMailAccounts']);router['post']('/:id/openchannel_accounts',auth[_0x1bac('0xf')](),controller['addOpenchannelAccounts']);router[_0x1bac('0x35')](_0x1bac('0x30'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x52')]);router['post']('/:id/chat_websites',auth[_0x1bac('0xf')](),controller['addChatWebsites']);router['post']('/:id/whatsapp_accounts',auth[_0x1bac('0xf')](),controller[_0x1bac('0x53')]);router[_0x1bac('0x35')](_0x1bac('0x34'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x54')]);router['put'](_0x1bac('0x10'),auth[_0x1bac('0xf')](),controller['update']);router['put']('/:id/password',auth[_0x1bac('0xf')](),controller['changePassword']);router[_0x1bac('0x55')](_0x1bac('0x16'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x56')]);router[_0x1bac('0x55')](_0x1bac('0x28'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x1bac('0x10'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x57')]);router['delete'](_0x1bac('0x49'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x58')]);router[_0x1bac('0x55')]('/:id/mail_interactions',auth[_0x1bac('0xf')](),controller[_0x1bac('0x59')]);router[_0x1bac('0x55')](_0x1bac('0x5a'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x5b')]);router[_0x1bac('0x55')](_0x1bac('0x4d'),auth['isAuthenticated'](),controller[_0x1bac('0x5c')]);router[_0x1bac('0x55')](_0x1bac('0x4f'),auth[_0x1bac('0xf')](),controller[_0x1bac('0x5d')]);router[_0x1bac('0x55')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x1bac('0x5e')]);router[_0x1bac('0x55')]('/:id/fax_accounts',auth[_0x1bac('0xf')](),controller[_0x1bac('0x5f')]);router['delete'](_0x1bac('0x2e'),auth[_0x1bac('0xf')](),controller['removeMailAccounts']);router[_0x1bac('0x55')](_0x1bac('0x2f'),auth['isAuthenticated'](),controller[_0x1bac('0x60')]);router[_0x1bac('0x55')](_0x1bac('0x30'),auth[_0x1bac('0xf')](),controller['removeSmsAccounts']);router[_0x1bac('0x55')](_0x1bac('0x31'),auth['isAuthenticated'](),controller[_0x1bac('0x61')]);router[_0x1bac('0x55')]('/:id/whatsapp_accounts',auth[_0x1bac('0xf')](),controller[_0x1bac('0x62')]);router[_0x1bac('0x55')]('/:id/api_key',auth[_0x1bac('0xf')](),controller[_0x1bac('0x63')]);router[_0x1bac('0x35')]('/:id/messengerSoundNotification',auth['isAuthenticated'](),controller[_0x1bac('0x64')]);module[_0x1bac('0x65')]=router; \ No newline at end of file +var _0x8d04=['/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','/:id/prefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','addContacts','create','/create_many','/:id/queues','addQueues','join','root','server/files/images/','format','%s-%s','originalname','single','file','/:id/login','login','/:id/logout','logout','/:id/pause','pause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','changePassword','removeQueues','delete','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeOpenchannelInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','messengerSoundNotification','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/groups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions'];(function(_0x9df3a0,_0x575fda){var _0x50a335=function(_0x17dc1d){while(--_0x17dc1d){_0x9df3a0['push'](_0x9df3a0['shift']());}};_0x50a335(++_0x575fda);}(_0x8d04,0xc2));var _0x48d0=function(_0x5a454a,_0x3880bb){_0x5a454a=_0x5a454a-0x0;var _0x274ada=_0x8d04[_0x5a454a];return _0x274ada;};'use strict';var multer=require(_0x48d0('0x0'));var util=require(_0x48d0('0x1'));var path=require('path');var timeout=require(_0x48d0('0x2'));var express=require(_0x48d0('0x3'));var router=express[_0x48d0('0x4')]();var fs_extra=require(_0x48d0('0x5'));var auth=require(_0x48d0('0x6'));var interaction=require(_0x48d0('0x7'));var config=require('../../config/environment');var controller=require('./user.controller');router[_0x48d0('0x8')]('/',auth[_0x48d0('0x9')](),controller[_0x48d0('0xa')]);router[_0x48d0('0x8')](_0x48d0('0xb'),auth[_0x48d0('0x9')](),controller[_0x48d0('0xc')]);router[_0x48d0('0x8')](_0x48d0('0xd'),auth[_0x48d0('0x9')](),controller[_0x48d0('0xe')]);router[_0x48d0('0x8')](_0x48d0('0xf'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x10')]);router['get'](_0x48d0('0x11'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x12')]);router[_0x48d0('0x8')](_0x48d0('0x13'),controller[_0x48d0('0x14')]);router[_0x48d0('0x8')]('/:id/open_tabs',auth[_0x48d0('0x9')](),controller[_0x48d0('0x15')]);router['get'](_0x48d0('0x16'),auth['isAuthenticated'](),controller[_0x48d0('0x17')]);router[_0x48d0('0x8')]('/:id/queues',auth['isAuthenticated'](),controller['getQueues']);router['get']('/:id/queues_rt',auth[_0x48d0('0x9')](),controller['getVoiceQueuesRt']);router[_0x48d0('0x8')](_0x48d0('0x18'),auth[_0x48d0('0x9')](),controller['getGroups']);router[_0x48d0('0x8')]('/:id/recordings',auth['isAuthenticated'](),controller[_0x48d0('0x19')]);router[_0x48d0('0x8')](_0x48d0('0x1a'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x1b')]);router[_0x48d0('0x8')](_0x48d0('0x1c'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x1d')]);router[_0x48d0('0x8')](_0x48d0('0x1e'),auth[_0x48d0('0x9')](),controller['getOpenchannelInteractions']);router['get'](_0x48d0('0x1f'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x20')]);router[_0x48d0('0x8')](_0x48d0('0x21'),auth['isAuthenticated'](),controller['getSmsInteractions']);router['get'](_0x48d0('0x22'),auth['isAuthenticated'](),controller[_0x48d0('0x23')]);router[_0x48d0('0x8')](_0x48d0('0x24'),auth['isAuthenticated'](),controller[_0x48d0('0x25')]);router[_0x48d0('0x8')](_0x48d0('0x26'),auth['isAuthenticated'](),controller['getTeams']);router[_0x48d0('0x8')](_0x48d0('0x27'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x28')]);router[_0x48d0('0x8')](_0x48d0('0x29'),auth[_0x48d0('0x9')](),controller['getAgents']);router[_0x48d0('0x8')](_0x48d0('0x2a'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router['get'](_0x48d0('0x2b'),auth[_0x48d0('0x9')](),controller['getFaxAccounts']);router[_0x48d0('0x8')](_0x48d0('0x2c'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x2d')]);router['get'](_0x48d0('0x2e'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x2f')]);router['get'](_0x48d0('0x30'),auth['isAuthenticated'](),controller[_0x48d0('0x31')]);router[_0x48d0('0x8')](_0x48d0('0x32'),auth['isAuthenticated'](),controller[_0x48d0('0x33')]);router['get'](_0x48d0('0x34'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x35')]);router[_0x48d0('0x8')](_0x48d0('0x36'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x37')]);router[_0x48d0('0x8')](_0x48d0('0x38'),auth[_0x48d0('0x9')](),controller['getApiKey']);router[_0x48d0('0x39')](_0x48d0('0x16'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x3a')]);router[_0x48d0('0x39')]('/',auth[_0x48d0('0x9')](),controller[_0x48d0('0x3b')]);router[_0x48d0('0x39')](_0x48d0('0x3c'),auth['isAuthenticated'](),controller['bulkCreate']);router['post'](_0x48d0('0x3d'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x3e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x444dbf,_0x267c33,_0x5bc744){_0x5bc744(null,path[_0x48d0('0x3f')](config[_0x48d0('0x40')],_0x48d0('0x41')));},'filename':function(_0x4471fd,_0x1cf01d,_0x48e7a7){_0x48e7a7(null,util[_0x48d0('0x42')](_0x48d0('0x43'),Date['now'](),_0x1cf01d[_0x48d0('0x44')]));}})});router[_0x48d0('0x39')](_0x48d0('0x13'),upload[_0x48d0('0x45')](_0x48d0('0x46')),controller['addAvatar']);router[_0x48d0('0x39')](_0x48d0('0x47'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x48')]);router[_0x48d0('0x39')](_0x48d0('0x49'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x4a')]);router[_0x48d0('0x39')](_0x48d0('0x4b'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x4c')]);router[_0x48d0('0x39')]('/:id/unpause',auth[_0x48d0('0x9')](),controller[_0x48d0('0x4d')]);router['post'](_0x48d0('0x26'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x4e')]);router['post']('/:id/chat_interactions',auth[_0x48d0('0x9')](),controller[_0x48d0('0x4f')]);router[_0x48d0('0x39')](_0x48d0('0x50'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x51')]);router[_0x48d0('0x39')](_0x48d0('0x52'),auth[_0x48d0('0x9')](),controller['addFaxInteractions']);router[_0x48d0('0x39')]('/:id/sms_interactions',auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0x48d0('0x39')](_0x48d0('0x53'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x54')]);router[_0x48d0('0x39')](_0x48d0('0x55'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x56')]);router['post'](_0x48d0('0x2b'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x57')]);router[_0x48d0('0x39')](_0x48d0('0x2c'),auth[_0x48d0('0x9')](),controller['addMailAccounts']);router['post'](_0x48d0('0x2e'),auth[_0x48d0('0x9')](),controller['addOpenchannelAccounts']);router[_0x48d0('0x39')](_0x48d0('0x30'),auth['isAuthenticated'](),controller[_0x48d0('0x58')]);router['post']('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x48d0('0x59')]);router[_0x48d0('0x39')](_0x48d0('0x34'),auth['isAuthenticated'](),controller[_0x48d0('0x5a')]);router[_0x48d0('0x39')](_0x48d0('0x38'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x5b')]);router[_0x48d0('0x5c')](_0x48d0('0x11'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x5d')]);router[_0x48d0('0x5c')](_0x48d0('0x5e'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x5f')]);router['delete'](_0x48d0('0x3d'),auth['isAuthenticated'](),controller[_0x48d0('0x60')]);router[_0x48d0('0x61')](_0x48d0('0x26'),auth[_0x48d0('0x9')](),controller['removeTeams']);router[_0x48d0('0x61')](_0x48d0('0x11'),auth[_0x48d0('0x9')](),controller['destroy']);router[_0x48d0('0x61')](_0x48d0('0x62'),auth['isAuthenticated'](),controller[_0x48d0('0x63')]);router['delete'](_0x48d0('0x50'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x64')]);router[_0x48d0('0x61')](_0x48d0('0x52'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x65')]);router[_0x48d0('0x61')](_0x48d0('0x66'),auth[_0x48d0('0x9')](),controller['removeSmsInteractions']);router[_0x48d0('0x61')](_0x48d0('0x53'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x67')]);router[_0x48d0('0x61')](_0x48d0('0x55'),auth[_0x48d0('0x9')](),controller['removeWhatsappInteractions']);router[_0x48d0('0x61')]('/:id/fax_accounts',auth['isAuthenticated'](),controller['removeFaxAccounts']);router['delete'](_0x48d0('0x2c'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x68')]);router['delete']('/:id/openchannel_accounts',auth[_0x48d0('0x9')](),controller[_0x48d0('0x69')]);router['delete'](_0x48d0('0x30'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x6a')]);router[_0x48d0('0x61')](_0x48d0('0x32'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x6b')]);router[_0x48d0('0x61')](_0x48d0('0x34'),auth[_0x48d0('0x9')](),controller[_0x48d0('0x6c')]);router[_0x48d0('0x61')](_0x48d0('0x38'),auth['isAuthenticated'](),controller[_0x48d0('0x6d')]);router[_0x48d0('0x39')]('/:id/messengerSoundNotification',auth[_0x48d0('0x9')](),controller[_0x48d0('0x6e')]);module[_0x48d0('0x6f')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index fae8480..8b59fd7 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 _0xc2f9=['local','INTEGER','accountcode','\x22%s\x22\x20<%s>','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','user','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','force_rport,comedia','nat','join','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]','always','accept','originate','uac','uas','fingerprint','active','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','icesupport','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','avpf','force_avp','dtlsenable','actpass','dtlsprivatekey','permissions','map','phoneBarEnableScreenRecordingByAgent','true','false','blocked','loginAttempts','blockedAt','UNSIGNED','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','format','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone'];(function(_0xa3db,_0x5484b5){var _0xbd2310=function(_0x5e485f){while(--_0x5e485f){_0xa3db['push'](_0xa3db['shift']());}};_0xbd2310(++_0x5484b5);}(_0xc2f9,0x9f));var _0x9c2f=function(_0x432c1d,_0x224238){_0x432c1d=_0x432c1d-0x0;var _0x1cfc47=_0xc2f9[_0x432c1d];return _0x1cfc47;};'use strict';var Sequelize=require(_0x9c2f('0x0'));var moment=require(_0x9c2f('0x1'));var util=require(_0x9c2f('0x2'));var _=require(_0x9c2f('0x3'));module['exports']={'name':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':![],'unique':_0x9c2f('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x12433d){this['setDataValue'](_0x9c2f('0x5'),_0x12433d);this[_0x9c2f('0x6')](_0x9c2f('0x7'),_0x12433d);},'comment':_0x9c2f('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4b8612){this['setDataValue'](_0x9c2f('0x9'),_0x4b8612);this['setDataValue']('callerid',util[_0x9c2f('0xa')]('\x22%s\x22\x20<%s>',_0x4b8612,this[_0x9c2f('0xb')](_0x9c2f('0xc'))));}},'alias':{'type':Sequelize[_0x9c2f('0x4')]},'email':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':![],'unique':_0x9c2f('0xd'),'validate':{'isEmail':!![]},'set':function(_0x12fb2f){if(_0x12fb2f){this[_0x9c2f('0x6')](_0x9c2f('0xd'),_0x12fb2f[_0x9c2f('0xe')]());}}},'role':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x10'),'user',_0x9c2f('0x11'),_0x9c2f('0x12')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x9c2f('0x4')],'defaultValue':_0x9c2f('0x13')},'internal':{'type':Sequelize[_0x9c2f('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x27de5b){this[_0x9c2f('0x6')](_0x9c2f('0xc'),_0x27de5b);this[_0x9c2f('0x6')](_0x9c2f('0x15'),_0x27de5b);this[_0x9c2f('0x6')]('callerid',util[_0x9c2f('0xa')](_0x9c2f('0x16'),this[_0x9c2f('0xb')](_0x9c2f('0x9')),_0x27de5b));}},'salt':{'type':Sequelize[_0x9c2f('0x4')]},'phone':{'type':Sequelize[_0x9c2f('0x4')]},'mobile':{'type':Sequelize[_0x9c2f('0x4')]},'address':{'type':Sequelize[_0x9c2f('0x4')]},'zipcode':{'type':Sequelize[_0x9c2f('0x4')]},'userpic':{'type':Sequelize[_0x9c2f('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x9c2f('0x4')]},'online':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x9c2f('0x18')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9c2f('0x4')],'defaultValue':_0x9c2f('0x19')},'lastPauseAt':{'type':Sequelize[_0x9c2f('0x18')]},'chatCapacity':{'type':Sequelize[_0x9c2f('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x9c2f('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x9c2f('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x9c2f('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9c2f('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x9c2f('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x9c2f('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![],'defaultValue':_0x9c2f('0x1a')},'ipaddr':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x9c2f('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9c2f('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x9c2f('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x9c2f('0x1b'),_0x9c2f('0x1c'),_0x9c2f('0x1d')),'allowNull':!![],'defaultValue':_0x9c2f('0x1b')},'context':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![],'defaultValue':_0x9c2f('0x1e')},'callingpres':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x1f'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x9c2f('0x20'),_0x9c2f('0x21'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x9c2f('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![],'defaultValue':_0x9c2f('0x23'),'set':function(_0x2d5f24){this[_0x9c2f('0x6')](_0x9c2f('0x24'),_0x2d5f24?_0x2d5f24['join'](','):null);},'get':function(){return this[_0x9c2f('0xb')](_0x9c2f('0x24'))?this[_0x9c2f('0xb')]('transport')[_0x9c2f('0x25')](','):null;},'comment':_0x9c2f('0x26')},'dtmfmode':{'type':Sequelize[_0x9c2f('0xf')]('rfc2833',_0x9c2f('0x27'),_0x9c2f('0x28'),_0x9c2f('0x29'),_0x9c2f('0x2a')),'allowNull':!![],'defaultValue':_0x9c2f('0x2b')},'directmedia':{'type':Sequelize['ENUM'](_0x9c2f('0x2c'),'no',_0x9c2f('0x2d'),_0x9c2f('0x2e'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9c2f('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![],'defaultValue':_0x9c2f('0x2f'),'set':function(_0x599c21){this['setDataValue'](_0x9c2f('0x30'),_0x599c21?_0x599c21[_0x9c2f('0x31')](','):null);},'get':function(){return this[_0x9c2f('0xb')](_0x9c2f('0x30'))?this[_0x9c2f('0xb')]('nat')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x9c2f('0x4')]},'namedcallgroup':{'type':Sequelize[_0x9c2f('0x4')]},'pickupgroup':{'type':Sequelize[_0x9c2f('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9c2f('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9c2f('0x4')]},'disallow':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':![],'defaultValue':_0x9c2f('0x32')},'allow':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':![],'defaultValue':_0x9c2f('0x33'),'set':function(_0x111667){this[_0x9c2f('0x6')](_0x9c2f('0x34'),_0x111667?_0x111667[_0x9c2f('0x31')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9c2f('0xb')](_0x9c2f('0x34'))?this[_0x9c2f('0xb')]('allow')[_0x9c2f('0x25')](';'):null;},'comment':_0x9c2f('0x35')},'autoframing':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![],'set':function(_0xed5282){this['setDataValue'](_0x9c2f('0x36'),_0xed5282?_0xed5282['join'](','):null);},'get':function(){return this[_0x9c2f('0xb')]('insecure')?this[_0x9c2f('0xb')]('insecure')['split'](','):null;},'comment':_0x9c2f('0x37')},'trustrpid':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x2c'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9c2f('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x9c2f('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x9c2f('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x9c2f('0xf')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x9c2f('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x9c2f('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x2c'),'no',_0x9c2f('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x39'),'refuse',_0x9c2f('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x9c2f('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x9c2f('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x9c2f('0x3b'),_0x9c2f('0x3c')),'allowNull':!![],'defaultValue':_0x9c2f('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x9c2f('0x2c'),'no'),'allowNull':!![],'defaultValue':_0x9c2f('0x2c')},'keepalive':{'type':Sequelize[_0x9c2f('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x9c2f('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9c2f('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x9c2f('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9c2f('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x9c2f('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9c2f('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x9c2f('0xf')]('yes','no',_0x9c2f('0x3d'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9c2f('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x3e'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x9c2f('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9c2f('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9c2f('0xf')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x2c'),'no','nonat',_0x9c2f('0x2e'),_0x9c2f('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x9c2f('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x9c2f('0x18')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x9c2f('0x40')]},'showWebBar':{'type':Sequelize[_0x9c2f('0x14')],'defaultValue':0x0,'set':function(_0x4686e6){this[_0x9c2f('0x6')](_0x9c2f('0x41'),_0x4686e6);var _0x2c1fe6=this[_0x9c2f('0x42')]({'plain':!![]});switch(_0x4686e6){case 0x0:case 0x1:var _0x5badd8=_0x2c1fe6[_0x9c2f('0x24')]?_[_0x9c2f('0x43')](_0x2c1fe6[_0x9c2f('0x24')])?_0x2c1fe6[_0x9c2f('0x24')][_0x9c2f('0x31')]():_0x2c1fe6[_0x9c2f('0x24')]:_0x9c2f('0x23');if(_0x5badd8===_0x9c2f('0x44')){_0x5badd8=_0x9c2f('0x23');}this[_0x9c2f('0x6')](_0x9c2f('0x24'),_0x5badd8);this[_0x9c2f('0x6')](_0x9c2f('0x45'),'no');this[_0x9c2f('0x6')]('avpf',null);this['setDataValue']('force_avp',null);this[_0x9c2f('0x6')](_0x9c2f('0x46'),null);this[_0x9c2f('0x6')]('dtlsenable',null);this[_0x9c2f('0x6')](_0x9c2f('0x47'),null);this[_0x9c2f('0x6')](_0x9c2f('0x48'),null);this[_0x9c2f('0x6')](_0x9c2f('0x49'),null);this[_0x9c2f('0x6')]('dtlsprivatekey',null);this[_0x9c2f('0x6')](_0x9c2f('0x4a'),'no');break;case 0x2:this[_0x9c2f('0x6')](_0x9c2f('0x24'),_0x9c2f('0x44'));this[_0x9c2f('0x6')](_0x9c2f('0x45'),_0x9c2f('0x2c'));this[_0x9c2f('0x6')](_0x9c2f('0x4b'),_0x9c2f('0x2c'));this[_0x9c2f('0x6')](_0x9c2f('0x4c'),_0x9c2f('0x2c'));this[_0x9c2f('0x6')](_0x9c2f('0x46'),'yes');this['setDataValue'](_0x9c2f('0x4d'),'yes');this[_0x9c2f('0x6')](_0x9c2f('0x47'),'no');this[_0x9c2f('0x6')](_0x9c2f('0x48'),_0x9c2f('0x4e'));this['setDataValue']('dtlscertfile',_0x2c1fe6['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0x9c2f('0x6')](_0x9c2f('0x4f'),_0x2c1fe6[_0x9c2f('0x4f')]||'/etc/pki/tls/private/motion.key');this[_0x9c2f('0x6')](_0x9c2f('0x4a'),_0x9c2f('0x2c'));break;default:}}},'permissions':{'type':Sequelize[_0x9c2f('0x40')],'set':function(_0x1297b5){this['setDataValue'](_0x9c2f('0x50'),_0x1297b5?_0x1297b5[_0x9c2f('0x31')](','):[]);},'get':function(){return this[_0x9c2f('0xb')]('permissions')?_[_0x9c2f('0x51')](this[_0x9c2f('0xb')](_0x9c2f('0x50'))['split'](','),function(_0x1c9340){return parseInt(_0x1c9340,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x9c2f('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x9c2f('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9c2f('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x9c2f('0xf')](_0x9c2f('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9c2f('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x9c2f('0xb')](_0x9c2f('0x52'))?this[_0x9c2f('0xb')](_0x9c2f('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x9c2f('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x9c2f('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x44cf2f){if(typeof _0x44cf2f==='string'){var _0x5aae50=_0x44cf2f==='1'?!![]:_0x44cf2f==='0'?![]:_0x44cf2f===_0x9c2f('0x53')?!![]:_0x44cf2f===_0x9c2f('0x54')?![]:![];this[_0x9c2f('0x6')]('screenrecording',_0x5aae50);}else{this[_0x9c2f('0x6')]('screenrecording',_0x44cf2f);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x39c641){this['setDataValue'](_0x9c2f('0x55'),_0x39c641);if(_0x39c641===!![]){this[_0x9c2f('0x6')]('blockedAt',moment());this[_0x9c2f('0x6')](_0x9c2f('0x56'),0x0);}else{this[_0x9c2f('0x6')](_0x9c2f('0x57'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9c2f('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x9c2f('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x9c2f('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x9c2f('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x9c2f('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x9c2f('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x9c2f('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x9c2f('0x14')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x9c2f('0x17')],'defaultValue':![]}}; \ No newline at end of file +var _0x47a1=['moment','util','lodash','exports','name','setDataValue','defaultuser','STRING','fullname','callerid','format','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','local','INTEGER','\x22%s\x22\x20<%s>','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','update','force_rport,comedia','nat','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','active','passive','actpass','nonat','TEXT','showWebBar','get','wss','avpf','force_avp','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','dtlsenable','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x47a1,0x1bd));var _0x147a=function(_0x19ddc2,_0x4ba44a){_0x19ddc2=_0x19ddc2-0x0;var _0x926bd4=_0x47a1[_0x19ddc2];return _0x926bd4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x147a('0x0'));var util=require(_0x147a('0x1'));var _=require(_0x147a('0x2'));module[_0x147a('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x147a('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x193ed4){this[_0x147a('0x5')](_0x147a('0x4'),_0x193ed4);this[_0x147a('0x5')](_0x147a('0x6'),_0x193ed4);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x147a('0x7')],'allowNull':![],'set':function(_0x1366ee){this[_0x147a('0x5')](_0x147a('0x8'),_0x1366ee);this[_0x147a('0x5')](_0x147a('0x9'),util[_0x147a('0xa')]('\x22%s\x22\x20<%s>',_0x1366ee,this[_0x147a('0xb')](_0x147a('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x147a('0x7')],'allowNull':![],'unique':_0x147a('0xd'),'validate':{'isEmail':!![]},'set':function(_0x38c50e){if(_0x38c50e){this[_0x147a('0x5')](_0x147a('0xd'),_0x38c50e[_0x147a('0xe')]());}}},'role':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x10'),_0x147a('0x11'),_0x147a('0x12'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x147a('0x7')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x147a('0x7')],'defaultValue':_0x147a('0x13')},'internal':{'type':Sequelize[_0x147a('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x2b8f32){this[_0x147a('0x5')](_0x147a('0xc'),_0x2b8f32);this[_0x147a('0x5')]('accountcode',_0x2b8f32);this[_0x147a('0x5')](_0x147a('0x9'),util[_0x147a('0xa')](_0x147a('0x15'),this['getDataValue'](_0x147a('0x8')),_0x2b8f32));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x147a('0x7')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x147a('0x16')]},'voicePause':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x147a('0x7')],'defaultValue':_0x147a('0x18')},'lastPauseAt':{'type':Sequelize[_0x147a('0x16')]},'chatCapacity':{'type':Sequelize[_0x147a('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x147a('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x147a('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x147a('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x147a('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x147a('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x147a('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x147a('0x19')},'ipaddr':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'port':{'type':Sequelize[_0x147a('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x147a('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x1a'),'user',_0x147a('0x1b')),'allowNull':!![],'defaultValue':_0x147a('0x1a')},'context':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![],'defaultValue':_0x147a('0x1c')},'callingpres':{'type':Sequelize[_0x147a('0xf')]('ALLOWED_NOT_SCREENED',_0x147a('0x1d'),_0x147a('0x1e'),_0x147a('0x1f'),'PROHIB_NOT_SCREENED',_0x147a('0x20'),_0x147a('0x21'),_0x147a('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'transport':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![],'defaultValue':_0x147a('0x23'),'set':function(_0x119742){this[_0x147a('0x5')]('transport',_0x119742?_0x119742[_0x147a('0x24')](','):null);},'get':function(){return this[_0x147a('0xb')]('transport')?this[_0x147a('0xb')](_0x147a('0x25'))[_0x147a('0x26')](','):null;},'comment':_0x147a('0x27')},'dtmfmode':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x28'),_0x147a('0x29'),'shortinfo',_0x147a('0x2a'),_0x147a('0x2b')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no','nonat',_0x147a('0x2d'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'nat':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![],'defaultValue':_0x147a('0x2e'),'set':function(_0x4f022f){this['setDataValue'](_0x147a('0x2f'),_0x4f022f?_0x4f022f['join'](','):null);},'get':function(){return this[_0x147a('0xb')](_0x147a('0x2f'))?this['getDataValue'](_0x147a('0x2f'))[_0x147a('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x147a('0x7')]},'namedcallgroup':{'type':Sequelize[_0x147a('0x7')]},'pickupgroup':{'type':Sequelize[_0x147a('0x7')]},'namedpickupgroup':{'type':Sequelize[_0x147a('0x7')]},'language':{'type':Sequelize[_0x147a('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x147a('0x7')],'allowNull':![],'defaultValue':_0x147a('0x30'),'set':function(_0x2b57d3){this[_0x147a('0x5')](_0x147a('0x31'),_0x2b57d3?_0x2b57d3[_0x147a('0x24')](';'):_0x147a('0x30'));},'get':function(){return this[_0x147a('0xb')](_0x147a('0x31'))?this['getDataValue'](_0x147a('0x31'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![],'set':function(_0x1a780c){this[_0x147a('0x5')]('insecure',_0x1a780c?_0x1a780c[_0x147a('0x24')](','):null);},'get':function(){return this[_0x147a('0xb')](_0x147a('0x32'))?this[_0x147a('0xb')](_0x147a('0x32'))[_0x147a('0x26')](','):null;},'comment':_0x147a('0x33')},'trustrpid':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no',_0x147a('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x147a('0xf')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x147a('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![],'defaultValue':_0x147a('0x35')},'amaflags':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no'),'allowNull':!![],'defaultValue':_0x147a('0x2c')},'busylevel':{'type':Sequelize[_0x147a('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'template':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x147a('0x2c'),'no',_0x147a('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x147a('0x37'),_0x147a('0x38'),_0x147a('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x147a('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x147a('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x3a'),_0x147a('0x3b')),'allowNull':!![],'defaultValue':_0x147a('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no'),'allowNull':!![],'defaultValue':_0x147a('0x2c')},'keepalive':{'type':Sequelize[_0x147a('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x147a('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x147a('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x147a('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x147a('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x147a('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x147a('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x147a('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x147a('0xf')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x147a('0x2c'),'no',_0x147a('0x3c'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x147a('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x3d'),_0x147a('0x3e'),_0x147a('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x147a('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x147a('0xf')](_0x147a('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x147a('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x147a('0xf')]('yes','no',_0x147a('0x40'),_0x147a('0x2d'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x147a('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x147a('0x41')]},'showWebBar':{'type':Sequelize[_0x147a('0x14')],'defaultValue':0x0,'set':function(_0x6710df){this[_0x147a('0x5')](_0x147a('0x42'),_0x6710df);var _0xc78034=this[_0x147a('0x43')]({'plain':!![]});switch(_0x6710df){case 0x0:case 0x1:var _0x16a49b=_0xc78034['transport']?_['isArray'](_0xc78034['transport'])?_0xc78034[_0x147a('0x25')][_0x147a('0x24')]():_0xc78034[_0x147a('0x25')]:'udp';if(_0x16a49b===_0x147a('0x44')){_0x16a49b=_0x147a('0x23');}this[_0x147a('0x5')](_0x147a('0x25'),_0x16a49b);this[_0x147a('0x5')]('encryption','no');this[_0x147a('0x5')](_0x147a('0x45'),null);this[_0x147a('0x5')](_0x147a('0x46'),null);this['setDataValue'](_0x147a('0x47'),null);this[_0x147a('0x5')]('dtlsenable',null);this['setDataValue'](_0x147a('0x48'),null);this['setDataValue'](_0x147a('0x49'),null);this['setDataValue'](_0x147a('0x4a'),null);this['setDataValue'](_0x147a('0x4b'),null);this[_0x147a('0x5')](_0x147a('0x4c'),'no');break;case 0x2:this[_0x147a('0x5')]('transport',_0x147a('0x44'));this['setDataValue']('encryption',_0x147a('0x2c'));this[_0x147a('0x5')](_0x147a('0x45'),_0x147a('0x2c'));this[_0x147a('0x5')](_0x147a('0x46'),_0x147a('0x2c'));this[_0x147a('0x5')](_0x147a('0x47'),_0x147a('0x2c'));this[_0x147a('0x5')](_0x147a('0x4d'),_0x147a('0x2c'));this[_0x147a('0x5')](_0x147a('0x48'),'no');this[_0x147a('0x5')](_0x147a('0x49'),_0x147a('0x3f'));this[_0x147a('0x5')]('dtlscertfile',_0xc78034[_0x147a('0x4a')]||_0x147a('0x4e'));this['setDataValue'](_0x147a('0x4b'),_0xc78034['dtlsprivatekey']||_0x147a('0x4f'));this[_0x147a('0x5')](_0x147a('0x4c'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x147a('0x41')],'set':function(_0x176d9a){this[_0x147a('0x5')](_0x147a('0x50'),_0x176d9a?_0x176d9a[_0x147a('0x24')](','):[]);},'get':function(){return this[_0x147a('0xb')]('permissions')?_['map'](this['getDataValue'](_0x147a('0x50'))[_0x147a('0x26')](','),function(_0x25f9de){return parseInt(_0x25f9de,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x147a('0x7')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x147a('0x7')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x147a('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x147a('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x147a('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x147a('0x7')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x147a('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x147a('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x147a('0x7')]},'phoneBarEnableJaws':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x147a('0xb')](_0x147a('0x51'))?this['getDataValue'](_0x147a('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x147a('0x7')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x147a('0x7')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![],'set':function(_0x383653){if(typeof _0x383653==='string'){var _0x433984=_0x383653==='1'?!![]:_0x383653==='0'?![]:_0x383653===_0x147a('0x52')?!![]:_0x383653===_0x147a('0x53')?![]:![];this[_0x147a('0x5')](_0x147a('0x54'),_0x433984);}else{this[_0x147a('0x5')](_0x147a('0x54'),_0x383653);}}},'blocked':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![],'set':function(_0x598e99){this[_0x147a('0x5')](_0x147a('0x55'),_0x598e99);if(_0x598e99===!![]){this['setDataValue'](_0x147a('0x56'),moment());this['setDataValue'](_0x147a('0x57'),0x0);}else{this['setDataValue'](_0x147a('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0x147a('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x147a('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x147a('0x14')](0x5)[_0x147a('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x147a('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x147a('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x147a('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x147a('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x147a('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x147a('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x147a('0x14')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 9c844e4..40350ce 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 _0x776e=['Agents','Telephones','ignore','map','value','includes','find','name','UserProfileResource','destroy','stack','send','rawAttributes','filter','salt','resetPasswordExpires','md5secret','where','includeAll','include','query','userSetting','true','UserSetting','attributes','findAll','rows','openTabs','chat','dataValues','push','sms','fax','openchannel','whatsapp','all','catch','show','getOptions','merge','options','User','mail','body','params','describe','addContacts','ids','omit','Setting','securePassword','validatePasswordPattern','password','isNil','min_internal','internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','102','103','113','110','104','105','106','107','109','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','length','telephone','UserProfileSection','isEmpty','compact','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','validatePasswordHistory','updatePasswordsHistory','channel','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queues','QueueId','voice','format','SIP/%s','penalty','UserVoiceQueueRt','upsert','removeQueues','isArray','Queue:remove','addAvatar','file','filename','getAvatar','server/files/images/logos/default_profile.png','userpic','download','join','root','getOpenTabs','CHAT','FaxOpenTabs','createdAt','SmsOpenTabs','SMS','WHATSAPP','concat','getContacts','CmList','List','Tags','color','tag','getQueues','model','keys','intersection','fields','order','sort','filters','pick','Unknown\x20role','Queue','getVoiceQueuesRt','nolimit','ChatGroup','getGroups','hasOwnProperty','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','WhatsappInteraction','getWhatsappInteractions','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','LOGININPAUSE','isMiddleware','logout','MemberReport','forEach','pause','online','QueuePause','PAUSE','updateAttributes','type','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','chatPause','faxPause','openchannelPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','Team','getAssociatedQueues','flattenDeep','addAgent','TeamVoicePrefix','VoicePrefixId','Queue:save','removeTeams','resolve','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeAgent','getDataValue','Voice','getLists','getAgents','values','CmHopper','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','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','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','$or','$gt','$lt','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','firstName','lastName','CmContact','dialActive','VoiceQueue','getApiKey','token','No\x20API\x20access\x20key\x20found!','json','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','idle','unknown','ringing','teams','queues','inbound','toString','col','asc','substring','uniqBy','orderBy','getRealtimeAgents','offline','voiceStatus','unavailable','busy','slice','charAt','select','ui.','field','user_has_','_interactions','messengerSoundNotification','enabled','moment','path','squel','jayson/promise','../../components/auth/service','../../components/contacts','../../components/parsers/qs','../../components/realtime/agents','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APIForbiddenrror','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','defaults','localhost','client','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','update','role','agent','emit','userNotification:recalc:','get','admin','Users','user'];(function(_0x24fdd7,_0xe598bf){var _0x38931b=function(_0x114027){while(--_0x114027){_0x24fdd7['push'](_0x24fdd7['shift']());}};_0x38931b(++_0xe598bf);}(_0x776e,0x15e));var _0xe776=function(_0x746888,_0x4d90e3){_0x746888=_0x746888-0x0;var _0x3f4186=_0x776e[_0x746888];return _0x3f4186;};'use strict';var moment=require(_0xe776('0x0'));var util=require('util');var path=require(_0xe776('0x1'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe776('0x2'));var Redis=require('ioredis');var jayson=require(_0xe776('0x3'));var authService=require(_0xe776('0x4'));var contacts=require(_0xe776('0x5'));var qs=require(_0xe776('0x6'));var rta=require(_0xe776('0x7'));var logger=require(_0xe776('0x8'))(_0xe776('0x9'));var utils=require(_0xe776('0xa'));var config=require(_0xe776('0xb'));var licenseUtil=require(_0xe776('0xc'));var APIBadRequestError=require(_0xe776('0xd'))[_0xe776('0xe')];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIForbiddenError=require(_0xe776('0xd'))[_0xe776('0xf')];var APIHandleError=require(_0xe776('0xd'))[_0xe776('0x10')];var db=require(_0xe776('0x11'))['db'];var socket=require(_0xe776('0x12'))(new Redis(config[_0xe776('0x13')]));require(_0xe776('0x14'))['register'](socket);config[_0xe776('0x13')]=_[_0xe776('0x15')](config[_0xe776('0x13')],{'host':_0xe776('0x16'),'port':0x18eb});var amiClient=jayson[_0xe776('0x17')]['http']({'port':0x232a});var values;function respondWithStatusCode(_0x3985a0,_0x2b9e4d){_0x2b9e4d=_0x2b9e4d||0xcc;return function(_0x4cef80){if(_0x4cef80){return _0x3985a0[_0xe776('0x18')](_0x2b9e4d);}return _0x3985a0['status'](_0x2b9e4d)[_0xe776('0x19')]();};}function respondWithResult(_0x53c901,_0x1d03ed){_0x1d03ed=_0x1d03ed||0xc8;return function(_0x5b7ec2){if(_0x5b7ec2){return _0x53c901['status'](_0x1d03ed)['json'](_0x5b7ec2);}};}function respondWithFilteredResult(_0x1d102a,_0x3ddae6){return function(_0x106bd2){if(_0x106bd2){var _0x229416=typeof _0x3ddae6[_0xe776('0x1a')]===_0xe776('0x1b')&&typeof _0x3ddae6['limit']==='undefined';var _0xcaa8e3=_0x106bd2[_0xe776('0x1c')];var _0x105712=_0x229416?0x0:_0x3ddae6['offset'];var _0x33fa46=_0x229416?_0x106bd2[_0xe776('0x1c')]:_0x3ddae6[_0xe776('0x1a')]+_0x3ddae6[_0xe776('0x1d')];var _0x127e67;if(_0x33fa46>=_0xcaa8e3){_0x33fa46=_0xcaa8e3;_0x127e67=0xc8;}else{_0x127e67=0xce;}_0x1d102a[_0xe776('0x1e')](_0x127e67);return _0x1d102a[_0xe776('0x1f')](_0xe776('0x20'),_0x105712+'-'+_0x33fa46+'/'+_0xcaa8e3)['json'](_0x106bd2);}return null;};}function respondWithRpcPromise(_0x2a2eaa,_0x3759a6,_0x42cdc5,_0x84c39a){return new Promise(function(_0x13cfa4,_0x391f75){var _0x59d84d=_0x84c39a||amiClient;return _0x59d84d[_0xe776('0x21')](_0x2a2eaa,_0x42cdc5)[_0xe776('0x22')](function(_0x467f03){logger[_0xe776('0x23')]('User,\x20%s,\x20%s',_0x3759a6,_0xe776('0x24'));logger[_0xe776('0x25')](_0xe776('0x26'),_0x3759a6,_0xe776('0x24'),JSON[_0xe776('0x27')](_0x467f03));if(_0x467f03[_0xe776('0x28')]){if(_0x467f03[_0xe776('0x28')][_0xe776('0x29')]===0x1f4){logger[_0xe776('0x28')](_0xe776('0x2a'),_0x3759a6,_0x467f03[_0xe776('0x28')][_0xe776('0x2b')]);return _0x391f75(_0x467f03[_0xe776('0x28')][_0xe776('0x2b')]);}logger[_0xe776('0x28')](_0xe776('0x2a'),_0x3759a6,_0x467f03[_0xe776('0x28')]['message']);return _0x13cfa4(_0x467f03[_0xe776('0x28')]['message']);}else{logger[_0xe776('0x23')](_0xe776('0x2a'),_0x3759a6,_0xe776('0x24'));_0x13cfa4(_0x467f03[_0xe776('0x2c')][_0xe776('0x2b')]);}})['catch'](function(_0x4d51ae){logger[_0xe776('0x28')](_0xe776('0x2a'),_0x3759a6,_0x4d51ae);_0x391f75(_0x4d51ae);});});}function saveUpdates(_0x26e05c){return function(_0x8a8de6){if(_0x8a8de6){return _0x8a8de6[_0xe776('0x2d')](_0x26e05c)[_0xe776('0x22')](function(_0x59a36a){if(_0x59a36a[_0xe776('0x2e')]===_0xe776('0x2f')){socket[_0xe776('0x30')](_0xe776('0x31')+_0x59a36a['id'],_0x59a36a);}return _0x59a36a;});}return null;};}function removeEntity(_0x1a534e,_0x224a66){return function(_0x472a1e){if(_0x472a1e){return _0x472a1e['destroy']({'transaction':_0x224a66})[_0xe776('0x22')](function(){var _0x1ef1cf=_0x472a1e[_0xe776('0x32')]({'plain':!![]});if(_0x1ef1cf['role']===_0xe776('0x33'))return;var _0x5e1977=[{'name':_0xe776('0x34'),'value':_0xe776('0x35'),'ignore':!![]},{'name':_0xe776('0x36'),'value':_0xe776('0x2f'),'ignore':![]},{'name':_0xe776('0x37'),'value':'telephone','ignore':![]}];var _0x16a66d=_(_0x5e1977)['filter'](_0xe776('0x38'))[_0xe776('0x39')](_0xe776('0x3a'))[_0xe776('0x3a')]();if(_[_0xe776('0x3b')](_0x16a66d,_0x1ef1cf[_0xe776('0x2e')])){return;}var _0x27449c=_[_0xe776('0x3c')](_0x5e1977,[_0xe776('0x3a'),_0x1ef1cf[_0xe776('0x2e')]])[_0xe776('0x3d')];return db[_0xe776('0x3e')][_0xe776('0x3f')]({'where':{'type':_0x27449c,'resourceId':_0x1ef1cf['id']},'transaction':_0x224a66})[_0xe776('0x22')](function(){return _0x472a1e;});})[_0xe776('0x22')](function(){_0x1a534e[_0xe776('0x1e')](0xcc)[_0xe776('0x19')]();});}};}function handleEntityNotFound(_0x4293fc){return function(_0x429b34){if(!_0x429b34){_0x4293fc['sendStatus'](0x194);}return _0x429b34;};}function handleError(_0x98619a,_0x222373){_0x222373=_0x222373||0x1f4;return function(_0x27dd8c){logger[_0xe776('0x28')](_0x27dd8c[_0xe776('0x40')]);if(_0x27dd8c['name']){delete _0x27dd8c[_0xe776('0x3d')];}_0x98619a[_0xe776('0x1e')](_0x222373)[_0xe776('0x41')](_0x27dd8c);};}function getUserAttributes(){return _(db['User'][_0xe776('0x42')])[_0xe776('0x39')](function(_0x3ab6fd){return{'name':_0x3ab6fd['fieldName'],'type':_0x3ab6fd['type']['key']};})[_0xe776('0x43')](function(_0x3a2335){return!['password',_0xe776('0x44'),'previousPasswords','resetPasswordToken',_0xe776('0x45'),_0xe776('0x46')][_0xe776('0x3b')](_0x3a2335['name']);})[_0xe776('0x3a')]();}exports['index']=function(_0x21c8e6,_0x3d8f22){var _0x322205={},_0x293fd2={'count':0x0,'rows':[]};var _0x160297=getUserAttributes();_0x322205=qs['getOptions'](_0x160297,_0x21c8e6);var _0x40797c={'where':_0x322205[_0xe776('0x47')]};return db['User'][_0xe776('0x1c')](_0x40797c)['then'](function(_0x3a869c){_0x293fd2[_0xe776('0x1c')]=_0x3a869c;if(_0x21c8e6['query'][_0xe776('0x48')]){_0x322205[_0xe776('0x49')]=[{'all':!![]}];}if(_0x21c8e6[_0xe776('0x4a')][_0xe776('0x4b')]===_0xe776('0x4c')){_0x322205[_0xe776('0x49')]=[{'model':db[_0xe776('0x4d')],'as':_0xe776('0x4b')}];}if(!_[_0xe776('0x3b')](_0x322205[_0xe776('0x4e')],'id')){_0x322205[_0xe776('0x4e')]['push']('id');}return db['User'][_0xe776('0x4f')](_0x322205);})[_0xe776('0x22')](function(_0x3f6783){_0x293fd2[_0xe776('0x50')]=_0x3f6783;if(_0x21c8e6[_0xe776('0x4a')][_0xe776('0x51')]===_0xe776('0x4c')){var _0x205892=[];for(var _0x37e377=0x0;_0x37e377<_0x293fd2[_0xe776('0x50')]['length'];_0x37e377++){_0x205892['push'](get_open_tabs(_0xe776('0x52'),_0x293fd2[_0xe776('0x50')][_0x37e377][_0xe776('0x53')]));_0x205892[_0xe776('0x54')](get_open_tabs(_0xe776('0x55'),_0x293fd2[_0xe776('0x50')][_0x37e377][_0xe776('0x53')]));_0x205892['push'](get_open_tabs(_0xe776('0x56'),_0x293fd2[_0xe776('0x50')][_0x37e377]['dataValues']));_0x205892[_0xe776('0x54')](get_open_tabs('mail',_0x293fd2[_0xe776('0x50')][_0x37e377][_0xe776('0x53')]));_0x205892[_0xe776('0x54')](get_open_tabs(_0xe776('0x57'),_0x293fd2[_0xe776('0x50')][_0x37e377][_0xe776('0x53')]));_0x205892[_0xe776('0x54')](get_open_tabs(_0xe776('0x58'),_0x293fd2[_0xe776('0x50')][_0x37e377][_0xe776('0x53')]));}return Promise[_0xe776('0x59')](_0x205892)['then'](function(){return _0x293fd2;});}else{return _0x293fd2;}})[_0xe776('0x22')](respondWithFilteredResult(_0x3d8f22,_0x322205))[_0xe776('0x5a')](handleError(_0x3d8f22,null));};exports[_0xe776('0x5b')]=function(_0x2a0a8f,_0x173793){var _0x4df6ec=getUserAttributes();_0x2a0a8f[_0xe776('0x4a')]['id']=_0x2a0a8f['params']['id'];var _0x5442e1=qs[_0xe776('0x5c')](_0x4df6ec,_0x2a0a8f);if(_0x2a0a8f[_0xe776('0x4a')][_0xe776('0x48')]){_0x5442e1['include']=[{'all':!![]}];}if(_0x2a0a8f['query'][_0xe776('0x4b')]===_0xe776('0x4c')){_0x5442e1[_0xe776('0x49')]=[{'model':db[_0xe776('0x4d')],'as':_0xe776('0x4b')}];}_0x5442e1=_[_0xe776('0x5d')]({},_0x5442e1,_0x2a0a8f[_0xe776('0x5e')]);if(!_['includes'](_0x5442e1['attributes'],'id')){_0x5442e1['attributes']['push']('id');}return db[_0xe776('0x5f')][_0xe776('0x3c')](_0x5442e1)[_0xe776('0x22')](handleEntityNotFound(_0x173793,null))[_0xe776('0x22')](function(_0x187085){var _0x55ea70=[];values=_0x187085;if(_0x2a0a8f[_0xe776('0x4a')][_0xe776('0x51')]==='true'){_0x55ea70['push'](get_open_tabs(_0xe776('0x52'),_0x187085[_0xe776('0x53')]));_0x55ea70['push'](get_open_tabs(_0xe776('0x55'),_0x187085[_0xe776('0x53')]));_0x55ea70[_0xe776('0x54')](get_open_tabs('openchannel',_0x187085[_0xe776('0x53')]));_0x55ea70[_0xe776('0x54')](get_open_tabs('whatsapp',_0x187085['dataValues']));_0x55ea70[_0xe776('0x54')](get_open_tabs('fax',_0x187085[_0xe776('0x53')]));_0x55ea70[_0xe776('0x54')](get_open_tabs(_0xe776('0x60'),_0x187085[_0xe776('0x53')]));return Promise[_0xe776('0x59')](_0x55ea70);}else{return values;}})['then'](function(){return values;})[_0xe776('0x22')](respondWithResult(_0x173793,null))[_0xe776('0x5a')](handleError(_0x173793,null));};exports[_0xe776('0x2d')]=function(_0x2f52ae,_0x4cf72f){if(_0x2f52ae[_0xe776('0x61')]['id']){delete _0x2f52ae[_0xe776('0x61')]['id'];}delete _0x2f52ae[_0xe776('0x61')][_0xe776('0x2e')];return db['User']['find']({'where':{'id':_0x2f52ae[_0xe776('0x62')]['id']}})['then'](handleEntityNotFound(_0x4cf72f,null))[_0xe776('0x22')](saveUpdates(_0x2f52ae['body'],null))[_0xe776('0x22')](respondWithResult(_0x4cf72f,null))['catch'](handleError(_0x4cf72f,null));};exports['describe']=function(_0x225573,_0x1f6554){return db['User'][_0xe776('0x63')]()['then'](respondWithResult(_0x1f6554,null))[_0xe776('0x5a')](handleError(_0x1f6554,null));};exports[_0xe776('0x64')]=function(_0x45a8ab,_0x3d900a){return db[_0xe776('0x5f')][_0xe776('0x3c')]({'where':{'id':_0x45a8ab[_0xe776('0x62')]['id']}})[_0xe776('0x22')](handleEntityNotFound(_0x3d900a,null))['then'](function(_0x54d013){if(_0x54d013){return _0x54d013['addContacts'](_0x45a8ab[_0xe776('0x61')][_0xe776('0x65')],_[_0xe776('0x66')](_0x45a8ab['body'],[_0xe776('0x65'),'id'])||{});}})[_0xe776('0x22')](respondWithResult(_0x3d900a,null))['catch'](handleError(_0x3d900a,null));};function validateUser(_0x4be04d){return new Promise(function(_0x3d2c5a,_0x17d1aa){if(_0x4be04d['internal'])return _0x3d2c5a(_0x4be04d);return db[_0xe776('0x67')]['findById'](0x1)['then'](function(_0x66e512){if(_0x66e512[_0xe776('0x68')])authService[_0xe776('0x69')](_0x4be04d[_0xe776('0x6a')]);db[_0xe776('0x5f')]['max']('internal')[_0xe776('0x22')](function(_0x2687ba){if(_[_0xe776('0x6b')](_0x2687ba)){_0x4be04d['internal']=_0x66e512[_0xe776('0x6c')]||0x1;return;}if(_[_0xe776('0x6b')](_0x66e512['min_internal'])||_0x66e512[_0xe776('0x6c')]===_0x2687ba){_0x4be04d[_0xe776('0x6d')]=_0x2687ba+0x1;return;}if(_0x66e512[_0xe776('0x6c')]>_0x2687ba){_0x4be04d[_0xe776('0x6d')]=_0x66e512[_0xe776('0x6c')];return;}return db[_0xe776('0x6e')][_0xe776('0x4a')](_0xe776('0x6f'),{'type':db['sequelize'][_0xe776('0x70')][_0xe776('0x71')]})['then'](function(_0x382935){if(_0x382935&&_0x382935['length']){for(var _0x1423e5=0x0,_0x347ceb=_0x382935['length'];_0x1423e5<_0x347ceb&&_[_0xe776('0x6b')](_0x4be04d[_0xe776('0x6d')]);_0x1423e5++){if(_0x66e512[_0xe776('0x6c')]<=_0x382935[_0x1423e5]['from']){_0x4be04d['internal']=_0x382935[_0x1423e5][_0xe776('0x72')];}else if(_0x66e512[_0xe776('0x6c')]>_0x382935[_0x1423e5][_0xe776('0x72')]&&_0x66e512[_0xe776('0x6c')]<=_0x382935[_0x1423e5]['to']){_0x4be04d[_0xe776('0x6d')]=_0x66e512[_0xe776('0x6c')];}}}if(_[_0xe776('0x6b')](_0x4be04d['internal'])){_0x4be04d[_0xe776('0x6d')]=_0x2687ba+0x1;}return _0x3d2c5a(_0x4be04d);});});})[_0xe776('0x5a')](function(_0x380b41){_0x17d1aa(_0x380b41);});});}function updateUser(_0x6a5ac){return new Promise(function(_0x50ad91,_0x126de5){try{if(_0x6a5ac[_0xe776('0x73')]){_0x6a5ac[_0xe776('0x74')]=_0x6a5ac[_0xe776('0x6d')];_0x6a5ac[_0xe776('0x75')]={'mailbox':_0x6a5ac[_0xe776('0x6d')],'password':_0x6a5ac['password'],'fullname':_0x6a5ac[_0xe776('0x76')],'email':_0x6a5ac[_0xe776('0x77')]};}if(_0x6a5ac[_0xe776('0x2e')]===_0xe776('0x2f')){if(!_0x6a5ac[_0xe776('0x78')])_0x6a5ac['permissions']=['101',_0xe776('0x79'),_0xe776('0x7a'),_0xe776('0x7b'),_0xe776('0x7c'),_0xe776('0x7d'),_0xe776('0x7e'),_0xe776('0x7f'),_0xe776('0x80'),'108',_0xe776('0x81'),_0xe776('0x82'),_0xe776('0x83'),_0xe776('0x84'),_0xe776('0x85')];}_0x50ad91(_0x6a5ac);}catch(_0x37d2fc){_0x126de5(_0x37d2fc);}});}exports[_0xe776('0x86')]=function(_0x25ea4e,_0x515dfd){if(_0x25ea4e[_0xe776('0x35')][_0xe776('0x2e')]===_0xe776('0x2f'))throw new Error(_0xe776('0x87'));if(_0x25ea4e[_0xe776('0x61')][_0xe776('0x2e')]===_0xe776('0x35')&&_0x25ea4e['user'][_0xe776('0x2e')]!==_0xe776('0x33')){throw new Error(_0xe776('0x88'));}if(_0x25ea4e[_0xe776('0x61')][_0xe776('0x2e')]===_0xe776('0x33')&&_0x25ea4e[_0xe776('0x35')][_0xe776('0x2e')]!==_0xe776('0x33')){throw new Error(_0xe776('0x89'));}return licenseUtil['checkUserLimits']([_0x25ea4e[_0xe776('0x61')]])[_0xe776('0x22')](function(){return validateUser(_0x25ea4e[_0xe776('0x61')]);})[_0xe776('0x22')](function(_0xf7dc1a){return updateUser(_0xf7dc1a)[_0xe776('0x22')](function(_0x346338){if(_0x346338[_0xe776('0x2e')]===_0xe776('0x33')){_0x346338[_0xe776('0x8a')]=_0x25ea4e[_0xe776('0x35')]['settingsEnabled'];delete _0x346338[_0xe776('0x8b')];}return _0x346338;});})[_0xe776('0x22')](function(_0x57683b){return db[_0xe776('0x5f')][_0xe776('0x86')](_0x57683b,{'include':[{'model':db[_0xe776('0x75')],'as':_0xe776('0x75')}]});})['then'](function(_0xfbca00){if(_0x25ea4e['body'][_0xe776('0x2e')]===_0xe776('0x35'))return _0xfbca00;if(_0x25ea4e[_0xe776('0x35')]['role']!==_0xe776('0x35'))return _0xfbca00;return db['UserProfileSection'][_0xe776('0x3c')]({'where':{'name':_0xfbca00[_0xe776('0x2e')]===_0xe776('0x2f')?'Agents':'Telephones','userProfileId':_0x25ea4e['user'][_0xe776('0x8b')]},'raw':!![]})['then'](function(_0x58f87c){if(!_0x58f87c||_0x58f87c[_0xe776('0x8c')]!=0x0)return _0xfbca00;return db[_0xe776('0x3e')][_0xe776('0x86')]({'name':_0xfbca00[_0xe776('0x3d')],'resourceId':_0xfbca00['id'],'type':_0x58f87c[_0xe776('0x3d')],'sectionId':_0x58f87c['id']},{})['then'](function(){return _0xfbca00;});})[_0xe776('0x5a')](function(_0xb07f41){logger[_0xe776('0x28')](_0xe776('0x8d'),_0xb07f41);throw _0xb07f41;});})[_0xe776('0x22')](respondWithResult(_0x515dfd,0xc9))[_0xe776('0x5a')](handleError(_0x515dfd,null));};exports['bulkCreate']=function(_0x4b8405,_0xe9e120){var _0x26571d=_0x4b8405['body'];var _0x5f297d=[];if(_0x4b8405[_0xe776('0x35')][_0xe776('0x2e')]===_0xe776('0x2f'))throw new Error(_0xe776('0x87'));if(_[_0xe776('0x8e')](_0x26571d,[_0xe776('0x2e'),'user'])&&_0x4b8405[_0xe776('0x35')]['role']!==_0xe776('0x33')){throw new Error(_0xe776('0x88'));}if(_['some'](_0x26571d,[_0xe776('0x2e'),_0xe776('0x33')])&&_0x4b8405[_0xe776('0x35')]['role']!==_0xe776('0x33')){throw new Error(_0xe776('0x8f'));}return licenseUtil[_0xe776('0x90')](_0x26571d)['then'](function(){return validateUser(_0x26571d[0x0]);})[_0xe776('0x22')](function(){for(var _0x4c580c=0x1;_0x4c580c<_0x26571d['length'];_0x4c580c++){var _0x1ef5e7=_0x26571d[_0x4c580c-0x1][_0xe776('0x6d')];if(!_0x26571d[_0x4c580c][_0xe776('0x6d')])_0x26571d[_0x4c580c][_0xe776('0x6d')]=_0x1ef5e7+0x1;_0x5f297d['push'](validateUser(_0x26571d[_0x4c580c]));}return Promise[_0xe776('0x59')](_0x5f297d);})[_0xe776('0x22')](function(){_0x5f297d=[];for(var _0x15d90e=0x0;_0x15d90e<_0x26571d[_0xe776('0x91')];_0x15d90e++){_0x5f297d['push'](updateUser(_0x26571d[_0x15d90e]));}return Promise[_0xe776('0x59')](_0x5f297d);})[_0xe776('0x22')](function(){_0x5f297d=_0x26571d[_0xe776('0x39')](function(_0xc2830e){return db[_0xe776('0x5f')][_0xe776('0x86')](_0xc2830e,{'include':[{'model':db['VoiceMail'],'as':_0xe776('0x75')}]})[_0xe776('0x22')](function(_0x2fa4d2){_0xc2830e['id']=_0x2fa4d2['id'];return _0xc2830e;});});return Promise[_0xe776('0x59')](_0x5f297d);})[_0xe776('0x22')](function(_0x2bb52e){if(_0x4b8405[_0xe776('0x61')]['role']===_0xe776('0x35'))return _0x2bb52e;if(_0x4b8405['user'][_0xe776('0x2e')]!==_0xe776('0x35'))return _0x2bb52e;var _0xf29503=_[_0xe776('0x8e')](_0x2bb52e,function(_0x551a3b){return _0x551a3b[_0xe776('0x2e')]===_0xe776('0x2f')||_0x551a3b['role']===_0xe776('0x92');});if(!_0xf29503)return _0x2bb52e;return db[_0xe776('0x93')][_0xe776('0x4f')]({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x4b8405['user'][_0xe776('0x8b')]},'raw':!![]})[_0xe776('0x22')](function(_0x41873d){if(_[_0xe776('0x94')](_0x41873d)||!_[_0xe776('0x8e')](_0x41873d,[_0xe776('0x8c'),0x0]))return _0x2bb52e;_0x5f297d=[];var _0x266098=_(_0x41873d)[_0xe776('0x39')](function(_0x2a2cd7){if(_0x2a2cd7[_0xe776('0x8c')]===0x1)return;return _0x2a2cd7['name']===_0xe776('0x36')?_0xe776('0x2f'):_0xe776('0x92');})[_0xe776('0x95')]()[_0xe776('0x3a')]();for(var _0x1e396e=0x0;_0x1e396e<_0x2bb52e[_0xe776('0x91')];_0x1e396e++){if(!_[_0xe776('0x3b')](_0x266098,_0x2bb52e[_0x1e396e]['role']))return;var _0x53db21=_0x2bb52e[_0x1e396e][_0xe776('0x2e')]===_0xe776('0x2f')?'Agents':'Telephones';_0x5f297d['push'](db['UserProfileResource'][_0xe776('0x86')]({'name':_0x2bb52e[_0x1e396e]['name'],'resourceId':_0x2bb52e[_0x1e396e]['id'],'type':_0x53db21,'sectionId':_[_0xe776('0x3c')](_0x41873d,[_0xe776('0x3d'),_0x53db21])['id']},{}));}return Promise[_0xe776('0x59')](_0x5f297d);});})[_0xe776('0x22')](respondWithResult(_0xe9e120,0xc9))['catch'](handleError(_0xe9e120,null));};exports[_0xe776('0x96')]=function(_0x4eac20,_0x1d51c7){if(_0x4eac20[_0xe776('0x61')]['id']){delete _0x4eac20[_0xe776('0x61')]['id'];}return db['User'][_0xe776('0x3c')]({'where':{'id':_0x4eac20[_0xe776('0x62')]['id']}})[_0xe776('0x22')](function(_0x407c3d){if(!_0x407c3d)return null;if(_0x407c3d['id']===_0x4eac20['user']['id']){if(!_0x4eac20[_0xe776('0x61')][_0xe776('0x97')]||!_0x4eac20[_0xe776('0x61')][_0xe776('0x98')]){throw new db[(_0xe776('0x99'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x407c3d['authenticate'](_0x4eac20[_0xe776('0x61')]['oldPassword'])){throw new db[(_0xe776('0x99'))][(_0xe776('0x9a'))](_0xe776('0x9b'));}if(_0x4eac20['body'][_0xe776('0x97')]===_0x4eac20[_0xe776('0x61')][_0xe776('0x98')]){throw new db['Sequelize'][(_0xe776('0x9a'))](_0xe776('0x9c'));}}else if(_0x4eac20[_0xe776('0x35')]['role']==='admin'){if(!_0x4eac20[_0xe776('0x61')][_0xe776('0x98')]){throw new db['Sequelize']['ValidationError'](_0xe776('0x9d'));}}else if(_0x4eac20[_0xe776('0x35')][_0xe776('0x2e')]===_0xe776('0x35')){if(!_0x4eac20[_0xe776('0x61')][_0xe776('0x98')]){throw new db['Sequelize']['ValidationError'](_0xe776('0x9d'));}if(_0x407c3d['role']!==_0xe776('0x2f')){throw new db[(_0xe776('0x99'))]['ValidationError'](_0xe776('0x87'));}}else{throw new db['Sequelize'][(_0xe776('0x9a'))](_0xe776('0x87'));}return _0x407c3d;})[_0xe776('0x22')](handleEntityNotFound(_0x1d51c7,null))[_0xe776('0x22')](function(_0xaf3540){return db[_0xe776('0x67')][_0xe776('0x9e')]({'attributes':['id',_0xe776('0x68'),'enforcePasswordHistory','passwordHistoryLimit']})[_0xe776('0x22')](function(_0x16af91){if(_0x16af91['securePassword'])authService[_0xe776('0x69')](_0x4eac20[_0xe776('0x61')][_0xe776('0x98')]);if(!_0x16af91[_0xe776('0x9f')]||!_0xaf3540['previousPasswords'])return _0xaf3540;authService[_0xe776('0xa0')](_0x4eac20[_0xe776('0x61')][_0xe776('0x98')],_0xaf3540['previousPasswords'],_0x16af91['passwordHistoryLimit']);return _0xaf3540;})[_0xe776('0x22')](saveUpdates({'password':_0x4eac20[_0xe776('0x61')][_0xe776('0x98')],'passwordResetAt':_0x4eac20[_0xe776('0x35')]['id']==_0x4eac20[_0xe776('0x62')]['id']?moment():null,'previousPasswords':authService[_0xe776('0xa1')](_0x4eac20[_0xe776('0x61')][_0xe776('0x98')],_0xaf3540['previousPasswords'])},null));})[_0xe776('0x22')](respondWithResult(_0x1d51c7,null))[_0xe776('0x5a')](handleError(_0x1d51c7,null));};exports['addQueues']=function(_0x4bd12e,_0x5cedff){var _0xbd7a4b=_0x4bd12e[_0xe776('0x61')][_0xe776('0xa2')];return db['User'][_0xe776('0x3c')]({'where':{'id':_0x4bd12e['params']['id']},'attributes':['id',_0xe776('0x3d'),_0xe776('0x2e'),'online',_0xe776('0xa3'),_0xe776('0xa4'),_0xe776('0xa5')]})['then'](handleEntityNotFound(_0x5cedff,null))[_0xe776('0x22')](function(_0x5402c2){if(_0x5402c2){if(!utils[_0xe776('0xa6')](_0xbd7a4b)){throw new db[(_0xe776('0x99'))][(_0xe776('0x9a'))](_0xe776('0xa7'));}return _0x5402c2['add'+_[_0xe776('0xa8')](_0xbd7a4b[_0xe776('0xa9')]())+_0xe776('0xaa')](_0x4bd12e['body']['ids'],{'penalty':_0x4bd12e[_0xe776('0x61')]['penalty']||0x0})['spread'](function(_0x362f7b){for(var _0xad89cd=0x0;_0xad89cd<_0x4bd12e['body'][_0xe776('0x65')]['length'];_0xad89cd+=0x1){var _0x109e2f={'UserId':Number(_0x4bd12e['params']['id'])};_0x109e2f[_['capitalize'](_0xbd7a4b['toLowerCase']())+_0xe776('0xab')]=Number(_0x4bd12e[_0xe776('0x61')][_0xe776('0x65')][_0xad89cd]);socket[_0xe776('0x30')](_0xe776('0x35')+_['capitalize'](_0xbd7a4b['toLowerCase']())+'Queue:save',_0x109e2f);}return _0x362f7b;})[_0xe776('0x22')](function(){if(_0xbd7a4b===_0xe776('0xac')){return db['VoiceQueue'][_0xe776('0x4f')]({'where':{'id':_0x4bd12e[_0xe776('0x61')][_0xe776('0x65')]||[]},'raw':!![],'attributes':['id','name']});}})[_0xe776('0x22')](function(_0xf2e4ff){var _0x5b9080=_0x5402c2[_0xe776('0x32')]({'plain':!![]});var _0x2b6026=[];if(_0xbd7a4b===_0xe776('0xac')&&_0x5b9080[_0xe776('0x2e')]===_0xe776('0x2f')&&_0x5b9080['online']){for(let _0x21e899=0x0;_0x21e899<_0xf2e4ff[_0xe776('0x91')];_0x21e899+=0x1){_0x2b6026['push']({'membername':_0x5b9080[_0xe776('0x3d')],'UserId':_0x5b9080['id'],'queue_name':_0xf2e4ff[_0x21e899]['name'],'VoiceQueueId':_0xf2e4ff[_0x21e899]['id'],'interface':_[_0xe776('0x6b')](_0x5b9080[_0xe776('0xa5')])?util[_0xe776('0xad')](_0xe776('0xae'),_0x5b9080[_0xe776('0x3d')]):_0x5b9080[_0xe776('0xa5')],'paused':_0x5b9080[_0xe776('0xa4')]||![],'penalty':_0x4bd12e[_0xe776('0x61')][_0xe776('0xaf')]||0x0});}return Promise[_0xe776('0x59')](_0x2b6026[_0xe776('0x39')](function(_0x2bb228){return db[_0xe776('0xb0')][_0xe776('0xb1')](_0x2bb228);}));}return _0x5402c2;});}})[_0xe776('0x22')](respondWithStatusCode(_0x5cedff,null))['catch'](handleError(_0x5cedff,null));};exports[_0xe776('0xb2')]=function(_0x2a6c1e,_0x22e84a){var _0x2e22b5,_0x2c47b6;return db[_0xe776('0x5f')][_0xe776('0x3c')]({'where':{'id':_0x2a6c1e[_0xe776('0x62')]['id']},'attributes':['id',_0xe776('0x3d'),'role']})[_0xe776('0x22')](handleEntityNotFound(_0x22e84a,null))[_0xe776('0x22')](function(_0x32ae91){if(_0x32ae91){_0x2e22b5=_0x32ae91;if(!_0x2a6c1e[_0xe776('0x4a')][_0xe776('0xa2')]||!utils[_0xe776('0xa6')](_0x2a6c1e[_0xe776('0x4a')][_0xe776('0xa2')])){throw new db[(_0xe776('0x99'))][(_0xe776('0x9a'))]('Unknown\x20channel');}return _0x32ae91['remove'+_[_0xe776('0xa8')](_0x2a6c1e[_0xe776('0x4a')][_0xe776('0xa2')][_0xe776('0xa9')]())+_0xe776('0xaa')](_0x2a6c1e[_0xe776('0x4a')][_0xe776('0x65')]);}})['then'](function(_0xb3c154){if(_[_0xe776('0xb3')](_0x2a6c1e[_0xe776('0x4a')][_0xe776('0x65')])){for(var _0x300942=0x0;_0x300942<_0x2a6c1e[_0xe776('0x4a')][_0xe776('0x65')][_0xe776('0x91')];_0x300942+=0x1){_0x2c47b6={'UserId':Number(_0x2a6c1e[_0xe776('0x62')]['id'])};_0x2c47b6[_[_0xe776('0xa8')](_0x2a6c1e[_0xe776('0x4a')][_0xe776('0xa2')][_0xe776('0xa9')]())+_0xe776('0xab')]=Number(_0x2a6c1e[_0xe776('0x4a')][_0xe776('0x65')][_0x300942]);socket['emit'](_0xe776('0x35')+_[_0xe776('0xa8')](_0x2a6c1e['query'][_0xe776('0xa2')][_0xe776('0xa9')]())+_0xe776('0xb4'),_0x2c47b6);}}else{_0x2c47b6={'UserId':Number(_0x2a6c1e[_0xe776('0x62')]['id'])};_0x2c47b6[_['capitalize'](_0x2a6c1e[_0xe776('0x4a')][_0xe776('0xa2')][_0xe776('0xa9')]())+_0xe776('0xab')]=Number(_0x2a6c1e[_0xe776('0x4a')][_0xe776('0x65')]);socket['emit'](_0xe776('0x35')+_[_0xe776('0xa8')](_0x2a6c1e[_0xe776('0x4a')]['channel'][_0xe776('0xa9')]())+'Queue:remove',_0x2c47b6);}return _0xb3c154;})['then'](function(){if(_0x2a6c1e['query'][_0xe776('0xa2')]===_0xe776('0xac')){return db[_0xe776('0xb0')][_0xe776('0x3f')]({'where':{'UserId':_0x2a6c1e[_0xe776('0x62')]['id'],'VoiceQueueId':_0x2a6c1e[_0xe776('0x4a')][_0xe776('0x65')]},'individualHooks':!![]})[_0xe776('0x22')](function(){return _0x2e22b5;});}return _0x2e22b5;})[_0xe776('0x22')](respondWithStatusCode(_0x22e84a,null))[_0xe776('0x5a')](handleError(_0x22e84a,null));};exports[_0xe776('0xb5')]=function(_0x5a872c,_0x117661){_0x5a872c['body']['userpic']=_0x5a872c[_0xe776('0xb6')][_0xe776('0xb7')];return db['User'][_0xe776('0x3c')]({'where':{'id':_0x5a872c[_0xe776('0x62')]['id']}})[_0xe776('0x22')](handleEntityNotFound(_0x117661,null))[_0xe776('0x22')](saveUpdates(_0x5a872c[_0xe776('0x61')],null))['then'](respondWithResult(_0x117661,null))[_0xe776('0x5a')](handleError(_0x117661,null));};exports[_0xe776('0xb8')]=function(_0x3a9d4a,_0x3a642e){var _0x10599b=path['join'](config['root'],_0xe776('0xb9'));return db[_0xe776('0x5f')][_0xe776('0x3c')]({'where':{'id':_0x3a9d4a[_0xe776('0x62')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xe776('0x22')](handleEntityNotFound(_0x3a642e,null))[_0xe776('0x22')](function(_0x4bebc0){if(_0x4bebc0){if(_[_0xe776('0x6b')](_0x4bebc0[_0xe776('0xba')])){return _0x3a642e[_0xe776('0xbb')](_0x10599b);}else{if(!fs['existsSync'](path[_0xe776('0xbc')](config[_0xe776('0xbd')],'server/files/images/',_0x4bebc0['userpic']))){return _0x3a642e['download'](_0x10599b);}return _0x3a642e[_0xe776('0xbb')](path[_0xe776('0xbc')](config['root'],'server/files/images/',_0x4bebc0[_0xe776('0xba')]));}}})[_0xe776('0x5a')](handleError(_0x3a642e,null));};exports[_0xe776('0xbe')]=function(_0xc04f45,_0x4bfde0){return db['User']['find']({'where':{'id':_0xc04f45[_0xe776('0x62')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x4bfde0,null))[_0xe776('0x22')](function(_0x147399){var _0x3580b2=[];values=_0x147399[_0xe776('0x53')];_0x3580b2['push'](get_open_tabs('chat',_0x147399[_0xe776('0x53')]));_0x3580b2[_0xe776('0x54')](get_open_tabs('sms',_0x147399['dataValues']));_0x3580b2[_0xe776('0x54')](get_open_tabs(_0xe776('0x57'),_0x147399[_0xe776('0x53')]));_0x3580b2['push'](get_open_tabs('whatsapp',_0x147399[_0xe776('0x53')]));_0x3580b2[_0xe776('0x54')](get_open_tabs(_0xe776('0x56'),_0x147399[_0xe776('0x53')]));_0x3580b2[_0xe776('0x54')](get_open_tabs('mail',_0x147399[_0xe776('0x53')]));return Promise[_0xe776('0x59')](_0x3580b2);})[_0xe776('0x22')](function(_0x2132ed){if(_0x2132ed){var _0x4f95a9=_[_0xe776('0x39')](values['ChatOpenTabs'],function(_0x5ef1a3){return{'channel':_0xe776('0xbf'),'id':_0x5ef1a3['id'],'createdAt':_0x5ef1a3['createdAt']};});var _0x2e1961=_[_0xe776('0x39')](values[_0xe776('0xc0')],function(_0x50cf77){return{'channel':'FAX','id':_0x50cf77['id'],'createdAt':_0x50cf77[_0xe776('0xc1')]};});var _0x3c0f3f=_['map'](values['OpenchannelOpenTabs'],function(_0x570125){return{'channel':'OPENCHANNEL','id':_0x570125['id'],'createdAt':_0x570125[_0xe776('0xc1')]};});var _0x55545e=_['map'](values['MailOpenTabs'],function(_0x49a463){return{'channel':'MAIL','id':_0x49a463['id'],'createdAt':_0x49a463[_0xe776('0xc1')]};});var _0x60ef16=_[_0xe776('0x39')](values[_0xe776('0xc2')],function(_0x4cfd69){return{'channel':_0xe776('0xc3'),'id':_0x4cfd69['id'],'createdAt':_0x4cfd69[_0xe776('0xc1')]};});var _0x5dbc5a=_[_0xe776('0x39')](values['WhatsappOpenTabs'],function(_0x49a6f5){return{'channel':_0xe776('0xc4'),'id':_0x49a6f5['id'],'createdAt':_0x49a6f5[_0xe776('0xc1')]};});var _0x5a279a=_[_0xe776('0xc5')](_0x4f95a9,_0x2e1961,_0x3c0f3f,_0x55545e,_0x60ef16,_0x5dbc5a);var _0xa7e2b7={'count':_0x5a279a['length'],'rows':_0x5a279a};return _0xa7e2b7;}else return null;})['then'](respondWithResult(_0x4bfde0,null))[_0xe776('0x5a')](handleError(_0x4bfde0,null));};exports[_0xe776('0xc6')]=function(_0x318c59,_0x525013){var _0x375ca6={};return db['User']['findOne']({'where':{'id':_0x318c59[_0xe776('0x62')]['id']}})[_0xe776('0x22')](function(_0x3cc60c){if(!_0x3cc60c){throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x318c59['params']['id']));}return contacts['describe']();})['then'](function(_0x4ed0a6){_0x318c59[_0xe776('0x4a')][_0xe776('0x5f')]=_0x318c59[_0xe776('0x62')]['id'];_0x375ca6=qs[_0xe776('0x5c')](_0x4ed0a6,_0x318c59);if(_0x318c59['query']['hasOwnProperty']('includeAll')){_0x375ca6[_0xe776('0x49')]=[{'model':db[_0xe776('0xc7')],'as':_0xe776('0xc8'),'required':![]},{'model':db['Tag'],'as':_0xe776('0xc9'),'attributes':['id','name',_0xe776('0xca')],'where':_0x318c59[_0xe776('0x4a')][_0xe776('0xcb')]?{'id':_0x318c59[_0xe776('0x4a')][_0xe776('0xcb')]}:undefined,'required':_0x318c59[_0xe776('0x4a')][_0xe776('0xcb')]?!![]:![]}];}return contacts[_0xe776('0x4f')](_0x318c59[_0xe776('0x4a')],_0x318c59[_0xe776('0x35')],_0x375ca6,_0x4ed0a6);})['then'](respondWithFilteredResult(_0x525013,_0x375ca6))[_0xe776('0x5a')](APIHandleError(_0x525013));};exports[_0xe776('0xcc')]=function(_0x3e045e,_0x208883){var _0xf06990;var _0x460fd2={};var _0x3548f6;return db[_0xe776('0x5f')]['findOne']({'where':{'id':_0x3e045e[_0xe776('0x62')]['id']},'attributes':['id',_0xe776('0x3d'),'role']})['then'](handleEntityNotFound(_0x208883,null))[_0xe776('0x22')](function(_0x2cd22a){if(!utils[_0xe776('0xa6')](_0x3e045e['query'][_0xe776('0xa2')])){throw new db[(_0xe776('0x99'))][(_0xe776('0x9a'))]('Unknown\x20channel');}_0xf06990=_0x2cd22a;var _0x1c1d78={};_0x1c1d78[_0xe776('0xcd')]=_[_0xe776('0xce')](db[_[_0xe776('0xa8')](_0x3e045e[_0xe776('0x4a')]['channel'])+'Queue'][_0xe776('0x42')]);_0x1c1d78[_0xe776('0x4a')]=_[_0xe776('0xce')](_0x3e045e[_0xe776('0x4a')]);_0x1c1d78['filters']=_[_0xe776('0xcf')](_0x1c1d78[_0xe776('0xcd')],_0x1c1d78[_0xe776('0x4a')]);_0x460fd2[_0xe776('0x4e')]=_[_0xe776('0xcf')](_0x1c1d78[_0xe776('0xcd')],qs['fields'](_0x3e045e[_0xe776('0x4a')][_0xe776('0xd0')]));_0x460fd2[_0xe776('0x4e')]=_0x460fd2[_0xe776('0x4e')]['length']?_0x460fd2[_0xe776('0x4e')]:_0x1c1d78['model'];_0x460fd2[_0xe776('0xd1')]=qs[_0xe776('0xd2')](_0x3e045e[_0xe776('0x4a')][_0xe776('0xd2')]);_0x460fd2[_0xe776('0x47')]=qs[_0xe776('0xd3')](_[_0xe776('0xd4')](_0x3e045e[_0xe776('0x4a')],_0x1c1d78[_0xe776('0xd3')]));if(_0x3e045e[_0xe776('0x4a')][_0xe776('0x43')]){_0x460fd2[_0xe776('0x47')]=_[_0xe776('0x5d')](_0x460fd2[_0xe776('0x47')],{'$or':_['map'](_0x460fd2[_0xe776('0x4e')],function(_0x5a9c0f){var _0x4ec161={};_0x4ec161[_0x5a9c0f]={'$like':'%'+_0x3e045e['query'][_0xe776('0x43')]+'%'};return _0x4ec161;})});}_0x460fd2=_[_0xe776('0x5d')]({},_0x460fd2,_0x3e045e[_0xe776('0x5e')]);switch(_0xf06990[_0xe776('0x2e')]){case _0xe776('0x33'):return db[_[_0xe776('0xa8')](_0x3e045e['query'][_0xe776('0xa2')])+'Queue'][_0xe776('0x4f')](_0x460fd2);case _0xe776('0x35'):case _0xe776('0x2f'):return _0xf06990[_0xe776('0x32')+_[_0xe776('0xa8')](_0x3e045e[_0xe776('0x4a')][_0xe776('0xa2')])+'Queues'](_0x460fd2);default:throw new db[(_0xe776('0x99'))]['ValidationError'](_0xe776('0xd5'));}})[_0xe776('0x22')](function(_0x1cfaf5){_0x3548f6=_0x1cfaf5['length'];if(!_0x3e045e['query']['hasOwnProperty']('nolimit')){_0x460fd2[_0xe776('0x1d')]=qs[_0xe776('0x1d')](_0x3e045e[_0xe776('0x4a')][_0xe776('0x1d')]);_0x460fd2['offset']=qs[_0xe776('0x1a')](_0x3e045e[_0xe776('0x4a')]['offset']);}switch(_0xf06990['role']){case _0xe776('0x33'):return db[_[_0xe776('0xa8')](_0x3e045e[_0xe776('0x4a')]['channel'])+_0xe776('0xd6')][_0xe776('0x4f')](_0x460fd2);case _0xe776('0x35'):case _0xe776('0x2f'):return _0xf06990[_0xe776('0x32')+_[_0xe776('0xa8')](_0x3e045e[_0xe776('0x4a')]['channel'])+_0xe776('0xaa')](_0x460fd2);}})[_0xe776('0x22')](function(_0x13f56d){return{'count':_0x3548f6,'rows':_0x13f56d};})['then'](respondWithResult(_0x208883,null))['catch'](handleError(_0x208883,null));};exports[_0xe776('0xd7')]=function(_0x8b7d04,_0x2e8935){var _0xf2054c={};var _0x2c66a8={};var _0x2e3f51;var _0x163978;return db[_0xe776('0x5f')]['findOne']({'where':{'id':_0x8b7d04['params']['id']}})[_0xe776('0x22')](handleEntityNotFound(_0x2e8935,null))['then'](function(_0x588835){if(_0x588835){_0x2e3f51=_0x588835;_0x2c66a8[_0xe776('0xcd')]=_[_0xe776('0xce')](db[_0xe776('0xb0')][_0xe776('0x42')]);_0x2c66a8[_0xe776('0x4a')]=_['keys'](_0x8b7d04[_0xe776('0x4a')]);_0x2c66a8[_0xe776('0xd3')]=_[_0xe776('0xcf')](_0x2c66a8['model'],_0x2c66a8[_0xe776('0x4a')]);_0xf2054c[_0xe776('0x4e')]=_[_0xe776('0xcf')](_0x2c66a8[_0xe776('0xcd')],qs[_0xe776('0xd0')](_0x8b7d04['query']['fields']));_0xf2054c[_0xe776('0x4e')]=_0xf2054c[_0xe776('0x4e')][_0xe776('0x91')]?_0xf2054c['attributes']:_0x2c66a8[_0xe776('0xcd')];_0xf2054c[_0xe776('0xd1')]=qs['sort'](_0x8b7d04[_0xe776('0x4a')][_0xe776('0xd2')]);_0xf2054c[_0xe776('0x47')]=qs[_0xe776('0xd3')](_['pick'](_0x8b7d04[_0xe776('0x4a')],_0x2c66a8[_0xe776('0xd3')]));if(_0x8b7d04[_0xe776('0x4a')]['filter']){_0xf2054c['where']=_[_0xe776('0x5d')](_0xf2054c['where'],{'$or':_[_0xe776('0x39')](_0xf2054c[_0xe776('0x4e')],function(_0x5cd05c){var _0x42c3dd={};_0x42c3dd[_0x5cd05c]={'$like':'%'+_0x8b7d04[_0xe776('0x4a')][_0xe776('0x43')]+'%'};return _0x42c3dd;})});}_0xf2054c=_[_0xe776('0x5d')]({},_0xf2054c,_0x8b7d04[_0xe776('0x5e')]);return _0x2e3f51[_0xe776('0xd7')](_0xf2054c);}})[_0xe776('0x22')](function(_0x11b0d1){if(_0x11b0d1){_0x163978=_0x11b0d1['length'];if(!_0x8b7d04['query']['hasOwnProperty'](_0xe776('0xd8'))){_0xf2054c[_0xe776('0x1d')]=qs[_0xe776('0x1d')](_0x8b7d04['query']['limit']);_0xf2054c[_0xe776('0x1a')]=qs[_0xe776('0x1a')](_0x8b7d04[_0xe776('0x4a')][_0xe776('0x1a')]);}return _0x2e3f51[_0xe776('0xd7')](_0xf2054c);}})['then'](function(_0x13825a){if(_0x13825a){return _0x13825a?{'count':_0x163978,'rows':_0x13825a}:null;}})[_0xe776('0x22')](respondWithResult(_0x2e8935,null))[_0xe776('0x5a')](handleError(_0x2e8935,null));};exports['getGroups']=function(_0xcfa3b1,_0x1b8f9d){var _0x4bfc6c={};var _0x70fbe1={};var _0x2f46da;var _0x3add6e;return db[_0xe776('0x5f')][_0xe776('0x9e')]({'where':{'id':_0xcfa3b1['params']['id']}})[_0xe776('0x22')](handleEntityNotFound(_0x1b8f9d,null))[_0xe776('0x22')](function(_0xbeacb8){if(_0xbeacb8){_0x2f46da=_0xbeacb8;_0x70fbe1[_0xe776('0xcd')]=_['keys'](db[_0xe776('0xd9')]['rawAttributes']);_0x70fbe1[_0xe776('0x4a')]=_[_0xe776('0xce')](_0xcfa3b1[_0xe776('0x4a')]);_0x70fbe1[_0xe776('0xd3')]=_[_0xe776('0xcf')](_0x70fbe1[_0xe776('0xcd')],_0x70fbe1['query']);_0x4bfc6c[_0xe776('0x4e')]=_[_0xe776('0xcf')](_0x70fbe1[_0xe776('0xcd')],qs['fields'](_0xcfa3b1[_0xe776('0x4a')][_0xe776('0xd0')]));_0x4bfc6c[_0xe776('0x4e')]=_0x4bfc6c[_0xe776('0x4e')][_0xe776('0x91')]?_0x4bfc6c[_0xe776('0x4e')]:_0x70fbe1[_0xe776('0xcd')];_0x4bfc6c[_0xe776('0xd1')]=qs[_0xe776('0xd2')](_0xcfa3b1[_0xe776('0x4a')][_0xe776('0xd2')]);_0x4bfc6c[_0xe776('0x47')]=qs[_0xe776('0xd3')](_[_0xe776('0xd4')](_0xcfa3b1[_0xe776('0x4a')],_0x70fbe1['filters']));if(_0xcfa3b1['query'][_0xe776('0x43')]){_0x4bfc6c[_0xe776('0x47')]=_[_0xe776('0x5d')](_0x4bfc6c[_0xe776('0x47')],{'$or':_['map'](_0x4bfc6c['attributes'],function(_0x3e4ad5){var _0x39335d={};_0x39335d[_0x3e4ad5]={'$like':'%'+_0xcfa3b1[_0xe776('0x4a')][_0xe776('0x43')]+'%'};return _0x39335d;})});}_0x4bfc6c=_[_0xe776('0x5d')]({},_0x4bfc6c,_0xcfa3b1['options']);return _0x2f46da[_0xe776('0xda')](_0x4bfc6c);}})[_0xe776('0x22')](function(_0x15a164){if(_0x15a164){_0x3add6e=_0x15a164['length'];if(!_0xcfa3b1[_0xe776('0x4a')][_0xe776('0xdb')](_0xe776('0xd8'))){_0x4bfc6c['limit']=qs['limit'](_0xcfa3b1['query'][_0xe776('0x1d')]);_0x4bfc6c[_0xe776('0x1a')]=qs['offset'](_0xcfa3b1[_0xe776('0x4a')][_0xe776('0x1a')]);}return _0x2f46da['getGroups'](_0x4bfc6c);}})[_0xe776('0x22')](function(_0x3d9647){if(_0x3d9647){return _0x3d9647?{'count':_0x3add6e,'rows':_0x3d9647}:null;}})[_0xe776('0x22')](respondWithResult(_0x1b8f9d,null))['catch'](handleError(_0x1b8f9d,null));};exports['getRecordings']=function(_0x5b0647,_0x360a51){var _0x5273c1={'raw':!![],'where':{}};var _0x28b618={};var _0x2a3fe8={'count':0x0,'rows':[]};return db['User'][_0xe776('0x9e')]({'where':{'id':_0x5b0647[_0xe776('0x62')]['id']}})[_0xe776('0x22')](handleEntityNotFound(_0x360a51,null))[_0xe776('0x22')](function(_0x1c75a3){if(_0x1c75a3){_0x28b618[_0xe776('0xcd')]=_['keys'](db[_0xe776('0xdc')][_0xe776('0x42')]);_0x28b618[_0xe776('0x4a')]=_[_0xe776('0xce')](_0x5b0647[_0xe776('0x4a')]);_0x28b618[_0xe776('0xd3')]=_[_0xe776('0xcf')](_0x28b618[_0xe776('0xcd')],_0x28b618[_0xe776('0x4a')]);_0x5273c1['attributes']=_[_0xe776('0xcf')](_0x28b618[_0xe776('0xcd')],qs[_0xe776('0xd0')](_0x5b0647[_0xe776('0x4a')][_0xe776('0xd0')]));_0x5273c1['attributes']=_0x5273c1['attributes']['length']?_0x5273c1[_0xe776('0x4e')]:_0x28b618[_0xe776('0xcd')];if(!_0x5b0647[_0xe776('0x4a')][_0xe776('0xdb')](_0xe776('0xd8'))){_0x5273c1['limit']=qs['limit'](_0x5b0647['query'][_0xe776('0x1d')]);_0x5273c1['offset']=qs[_0xe776('0x1a')](_0x5b0647[_0xe776('0x4a')][_0xe776('0x1a')]);}_0x5273c1['order']=qs['sort'](_0x5b0647['query'][_0xe776('0xd2')]);_0x5273c1[_0xe776('0x47')]=qs[_0xe776('0xd3')](_[_0xe776('0xd4')](_0x5b0647[_0xe776('0x4a')],_0x28b618['filters']));_0x5273c1[_0xe776('0x47')][_0xe776('0xdd')]=_0x1c75a3['id'];if(_0x5b0647['query'][_0xe776('0x43')]){_0x5273c1[_0xe776('0x47')]=_[_0xe776('0x5d')](_0x5273c1[_0xe776('0x47')],{'$or':_[_0xe776('0x39')](_0x5273c1['attributes'],function(_0x1f4ecf){var _0x449e38={};_0x449e38[_0x1f4ecf]={'$like':'%'+_0x5b0647['query'][_0xe776('0x43')]+'%'};return _0x449e38;})});}_0x5273c1=_[_0xe776('0x5d')]({},_0x5273c1,_0x5b0647[_0xe776('0x5e')]);return db[_0xe776('0xdc')][_0xe776('0x1c')]({'where':_0x5273c1[_0xe776('0x47')]})[_0xe776('0x22')](function(_0xc1e5db){_0x2a3fe8[_0xe776('0x1c')]=_0xc1e5db;if(_0x5b0647[_0xe776('0x4a')][_0xe776('0x48')]){_0x5273c1[_0xe776('0x49')]=[{'all':!![]}];}return db[_0xe776('0xdc')][_0xe776('0x4f')](_0x5273c1);})[_0xe776('0x22')](function(_0x4f1a35){_0x2a3fe8[_0xe776('0x50')]=_0x4f1a35;return _0x2a3fe8;});}})['then'](respondWithFilteredResult(_0x360a51,_0x5273c1))[_0xe776('0x5a')](handleError(_0x360a51,null));};exports[_0xe776('0xde')]=function(_0x24cdef,_0x1f9643){var _0x2a5226={'raw':!![],'where':{}};var _0x44e83b={};var _0x2ea54a={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x24cdef[_0xe776('0x62')]['id']}})[_0xe776('0x22')](handleEntityNotFound(_0x1f9643,null))['then'](function(_0x507de5){if(_0x507de5){_0x44e83b['model']=_['keys'](db['ScreenRecording'][_0xe776('0x42')]);_0x44e83b[_0xe776('0x4a')]=_[_0xe776('0xce')](_0x24cdef['query']);_0x44e83b[_0xe776('0xd3')]=_['intersection'](_0x44e83b[_0xe776('0xcd')],_0x44e83b['query']);_0x2a5226[_0xe776('0x4e')]=_[_0xe776('0xcf')](_0x44e83b[_0xe776('0xcd')],qs['fields'](_0x24cdef[_0xe776('0x4a')]['fields']));_0x2a5226[_0xe776('0x4e')]=_0x2a5226[_0xe776('0x4e')]['length']?_0x2a5226[_0xe776('0x4e')]:_0x44e83b['model'];if(!_0x24cdef[_0xe776('0x4a')][_0xe776('0xdb')](_0xe776('0xd8'))){_0x2a5226['limit']=qs[_0xe776('0x1d')](_0x24cdef[_0xe776('0x4a')][_0xe776('0x1d')]);_0x2a5226['offset']=qs[_0xe776('0x1a')](_0x24cdef[_0xe776('0x4a')]['offset']);}_0x2a5226['order']=qs[_0xe776('0xd2')](_0x24cdef[_0xe776('0x4a')][_0xe776('0xd2')]);_0x2a5226[_0xe776('0x47')]=qs[_0xe776('0xd3')](_[_0xe776('0xd4')](_0x24cdef[_0xe776('0x4a')],_0x44e83b['filters']));_0x2a5226[_0xe776('0x47')][_0xe776('0xdd')]=_0x507de5['id'];if(_0x24cdef[_0xe776('0x4a')][_0xe776('0x43')]){_0x2a5226[_0xe776('0x47')]=_['merge'](_0x2a5226[_0xe776('0x47')],{'$or':_['map'](_0x2a5226[_0xe776('0x4e')],function(_0x5d3f76){var _0x1a89a7={};_0x1a89a7[_0x5d3f76]={'$like':'%'+_0x24cdef[_0xe776('0x4a')]['filter']+'%'};return _0x1a89a7;})});}_0x2a5226=_[_0xe776('0x5d')]({},_0x2a5226,_0x24cdef[_0xe776('0x5e')]);return db[_0xe776('0xdf')][_0xe776('0x1c')]({'where':_0x2a5226[_0xe776('0x47')]})[_0xe776('0x22')](function(_0x12d9e2){_0x2ea54a[_0xe776('0x1c')]=_0x12d9e2;if(_0x24cdef['query'][_0xe776('0x48')]){_0x2a5226[_0xe776('0x49')]=[{'all':!![]}];}return db[_0xe776('0xdf')][_0xe776('0x4f')](_0x2a5226);})[_0xe776('0x22')](function(_0x3ff143){_0x2ea54a[_0xe776('0x50')]=_0x3ff143;return _0x2ea54a;});}})[_0xe776('0x22')](respondWithFilteredResult(_0x1f9643,_0x2a5226))[_0xe776('0x5a')](handleError(_0x1f9643,null));};exports[_0xe776('0xe0')]=function(_0x14504a,_0x4f6faa){var _0x1c937a={};var _0x3d0d34={};var _0x42a464;var _0x48ef9f;return db[_0xe776('0x5f')][_0xe776('0x9e')]({'where':{'id':_0x14504a['params']['id']}})[_0xe776('0x22')](handleEntityNotFound(_0x4f6faa,null))[_0xe776('0x22')](function(_0x14a3aa){if(_0x14a3aa){_0x42a464=_0x14a3aa;_0x3d0d34[_0xe776('0xcd')]=_[_0xe776('0xce')](db[_0xe776('0xe1')][_0xe776('0x42')]);_0x3d0d34[_0xe776('0x4a')]=_[_0xe776('0xce')](_0x14504a[_0xe776('0x4a')]);_0x3d0d34['filters']=_[_0xe776('0xcf')](_0x3d0d34['model'],_0x3d0d34[_0xe776('0x4a')]);_0x1c937a[_0xe776('0x4e')]=_['intersection'](_0x3d0d34[_0xe776('0xcd')],qs[_0xe776('0xd0')](_0x14504a[_0xe776('0x4a')][_0xe776('0xd0')]));_0x1c937a['attributes']=_0x1c937a[_0xe776('0x4e')][_0xe776('0x91')]?_0x1c937a[_0xe776('0x4e')]:_0x3d0d34[_0xe776('0xcd')];_0x1c937a[_0xe776('0xd1')]=qs[_0xe776('0xd2')](_0x14504a[_0xe776('0x4a')][_0xe776('0xd2')]);_0x1c937a[_0xe776('0x47')]=qs[_0xe776('0xd3')](_[_0xe776('0xd4')](_0x14504a[_0xe776('0x4a')],_0x3d0d34[_0xe776('0xd3')]));if(_0x14504a['query'][_0xe776('0x43')]){_0x1c937a['where']=_['merge'](_0x1c937a[_0xe776('0x47')],{'$or':_[_0xe776('0x39')](_0x1c937a['attributes'],function(_0x1dcce5){var _0x174a65={};_0x174a65[_0x1dcce5]={'$like':'%'+_0x14504a['query'][_0xe776('0x43')]+'%'};return _0x174a65;})});}_0x1c937a=_[_0xe776('0x5d')]({},_0x1c937a,_0x14504a[_0xe776('0x5e')]);return _0x42a464[_0xe776('0xe0')](_0x1c937a);}})[_0xe776('0x22')](function(_0x26eda7){if(_0x26eda7){_0x48ef9f=_0x26eda7[_0xe776('0x91')];if(!_0x14504a[_0xe776('0x4a')][_0xe776('0xdb')](_0xe776('0xd8'))){_0x1c937a['limit']=qs['limit'](_0x14504a[_0xe776('0x4a')]['limit']);_0x1c937a[_0xe776('0x1a')]=qs['offset'](_0x14504a[_0xe776('0x4a')][_0xe776('0x1a')]);}return _0x42a464['getChatInteractions'](_0x1c937a);}})['then'](function(_0x93d9d4){if(_0x93d9d4){return _0x93d9d4?{'count':_0x48ef9f,'rows':_0x93d9d4}:null;}})['then'](respondWithResult(_0x4f6faa,null))[_0xe776('0x5a')](handleError(_0x4f6faa,null));};exports['getOpenchannelInteractions']=function(_0x781bde,_0x3e0016){var _0x538267={};var _0x522620={};var _0x21e9c8;var _0x2c154e;return db[_0xe776('0x5f')][_0xe776('0x9e')]({'where':{'id':_0x781bde[_0xe776('0x62')]['id']}})[_0xe776('0x22')](handleEntityNotFound(_0x3e0016,null))[_0xe776('0x22')](function(_0x5ca510){if(_0x5ca510){_0x21e9c8=_0x5ca510;_0x522620[_0xe776('0xcd')]=_[_0xe776('0xce')](db[_0xe776('0xe2')][_0xe776('0x42')]);_0x522620['query']=_[_0xe776('0xce')](_0x781bde['query']);_0x522620[_0xe776('0xd3')]=_['intersection'](_0x522620[_0xe776('0xcd')],_0x522620[_0xe776('0x4a')]);_0x538267[_0xe776('0x4e')]=_[_0xe776('0xcf')](_0x522620['model'],qs[_0xe776('0xd0')](_0x781bde[_0xe776('0x4a')][_0xe776('0xd0')]));_0x538267[_0xe776('0x4e')]=_0x538267[_0xe776('0x4e')]['length']?_0x538267[_0xe776('0x4e')]:_0x522620[_0xe776('0xcd')];_0x538267[_0xe776('0xd1')]=qs[_0xe776('0xd2')](_0x781bde[_0xe776('0x4a')][_0xe776('0xd2')]);_0x538267[_0xe776('0x47')]=qs[_0xe776('0xd3')](_[_0xe776('0xd4')](_0x781bde[_0xe776('0x4a')],_0x522620[_0xe776('0xd3')]));if(_0x781bde['query'][_0xe776('0x43')]){_0x538267['where']=_['merge'](_0x538267[_0xe776('0x47')],{'$or':_[_0xe776('0x39')](_0x538267[_0xe776('0x4e')],function(_0x195490){var _0x4e5fd6={};_0x4e5fd6[_0x195490]={'$like':'%'+_0x781bde[_0xe776('0x4a')][_0xe776('0x43')]+'%'};return _0x4e5fd6;})});}_0x538267=_[_0xe776('0x5d')]({},_0x538267,_0x781bde[_0xe776('0x5e')]);return _0x21e9c8[_0xe776('0xe3')](_0x538267);}})[_0xe776('0x22')](function(_0xd29a68){if(_0xd29a68){_0x2c154e=_0xd29a68[_0xe776('0x91')];if(!_0x781bde[_0xe776('0x4a')][_0xe776('0xdb')](_0xe776('0xd8'))){_0x538267[_0xe776('0x1d')]=qs[_0xe776('0x1d')](_0x781bde[_0xe776('0x4a')][_0xe776('0x1d')]);_0x538267[_0xe776('0x1a')]=qs[_0xe776('0x1a')](_0x781bde[_0xe776('0x4a')][_0xe776('0x1a')]);}return _0x21e9c8[_0xe776('0xe3')](_0x538267);}})['then'](function(_0x2dcfc1){if(_0x2dcfc1){return _0x2dcfc1?{'count':_0x2c154e,'rows':_0x2dcfc1}:null;}})[_0xe776('0x22')](respondWithResult(_0x3e0016,null))[_0xe776('0x5a')](handleError(_0x3e0016,null));};exports[_0xe776('0xe4')]=function(_0xafcb00,_0x17fb0e){var _0x4d9501={'raw':!![],'where':{}};var _0x1985f8={};var _0x330892={'count':0x0,'rows':[]};return db[_0xe776('0x5f')][_0xe776('0x9e')]({'where':{'id':_0xafcb00['params']['id']}})[_0xe776('0x22')](handleEntityNotFound(_0x17fb0e,null))[_0xe776('0x22')](function(_0x3f1c28){if(_0x3f1c28){_0x1985f8[_0xe776('0xcd')]=_['keys'](db[_0xe776('0xe5')]['rawAttributes']);_0x1985f8[_0xe776('0x4a')]=_[_0xe776('0xce')](_0xafcb00[_0xe776('0x4a')]);_0x1985f8[_0xe776('0xd3')]=_['intersection'](_0x1985f8['model'],_0x1985f8[_0xe776('0x4a')]);_0x4d9501[_0xe776('0x4e')]=_['intersection'](_0x1985f8['model'],qs[_0xe776('0xd0')](_0xafcb00['query'][_0xe776('0xd0')]));_0x4d9501[_0xe776('0x4e')]=_0x4d9501[_0xe776('0x4e')][_0xe776('0x91')]?_0x4d9501[_0xe776('0x4e')]:_0x1985f8['model'];if(!_0xafcb00['query'][_0xe776('0xdb')](_0xe776('0xd8'))){_0x4d9501['limit']=qs[_0xe776('0x1d')](_0xafcb00[_0xe776('0x4a')][_0xe776('0x1d')]);_0x4d9501[_0xe776('0x1a')]=qs[_0xe776('0x1a')](_0xafcb00[_0xe776('0x4a')][_0xe776('0x1a')]);}_0x4d9501[_0xe776('0xd1')]=qs[_0xe776('0xd2')](_0xafcb00[_0xe776('0x4a')][_0xe776('0xd2')]);_0x4d9501['where']=qs['filters'](_['pick'](_0xafcb00[_0xe776('0x4a')],_0x1985f8[_0xe776('0xd3')]));_0x4d9501[_0xe776('0x47')][_0xe776('0xdd')]=_0x3f1c28['id'];if(_0xafcb00[_0xe776('0x4a')][_0xe776('0x43')]){_0x4d9501[_0xe776('0x47')]=_[_0xe776('0x5d')](_0x4d9501[_0xe776('0x47')],{'$or':_[_0xe776('0x39')](_0x4d9501['attributes'],function(_0x3c4a5c){var _0x726e1e={};_0x726e1e[_0x3c4a5c]={'$like':'%'+_0xafcb00[_0xe776('0x4a')][_0xe776('0x43')]+'%'};return _0x726e1e;})});}_0x4d9501=_['merge']({},_0x4d9501,_0xafcb00['options']);return db[_0xe776('0xe5')][_0xe776('0x1c')]({'where':_0x4d9501[_0xe776('0x47')]})[_0xe776('0x22')](function(_0x3a3d71){_0x330892[_0xe776('0x1c')]=_0x3a3d71;if(_0xafcb00[_0xe776('0x4a')][_0xe776('0x48')]){_0x4d9501[_0xe776('0x49')]=[{'all':!![]}];}return db[_0xe776('0xe5')][_0xe776('0x4f')](_0x4d9501);})[_0xe776('0x22')](function(_0xa9d63c){_0x330892[_0xe776('0x50')]=_0xa9d63c;return _0x330892;});}})[_0xe776('0x22')](respondWithFilteredResult(_0x17fb0e,_0x4d9501))[_0xe776('0x5a')](handleError(_0x17fb0e,null));};exports[_0xe776('0xe6')]=function(_0x32fb94,_0x5bee54){var _0x45b7a2={};var _0x1adeda={};var _0x38bcdf;var _0x5d7be0;return db['User'][_0xe776('0x9e')]({'where':{'id':_0x32fb94[_0xe776('0x62')]['id']}})[_0xe776('0x22')](handleEntityNotFound(_0x5bee54,null))[_0xe776('0x22')](function(_0x47f072){if(_0x47f072){_0x38bcdf=_0x47f072;_0x1adeda[_0xe776('0xcd')]=_[_0xe776('0xce')](db[_0xe776('0xe7')][_0xe776('0x42')]);_0x1adeda['query']=_[_0xe776('0xce')](_0x32fb94[_0xe776('0x4a')]);_0x1adeda[_0xe776('0xd3')]=_[_0xe776('0xcf')](_0x1adeda['model'],_0x1adeda[_0xe776('0x4a')]);_0x45b7a2[_0xe776('0x4e')]=_[_0xe776('0xcf')](_0x1adeda[_0xe776('0xcd')],qs['fields'](_0x32fb94['query'][_0xe776('0xd0')]));_0x45b7a2[_0xe776('0x4e')]=_0x45b7a2[_0xe776('0x4e')][_0xe776('0x91')]?_0x45b7a2[_0xe776('0x4e')]:_0x1adeda[_0xe776('0xcd')];_0x45b7a2[_0xe776('0xd1')]=qs[_0xe776('0xd2')](_0x32fb94[_0xe776('0x4a')][_0xe776('0xd2')]);_0x45b7a2[_0xe776('0x47')]=qs[_0xe776('0xd3')](_['pick'](_0x32fb94[_0xe776('0x4a')],_0x1adeda[_0xe776('0xd3')]));if(_0x32fb94[_0xe776('0x4a')][_0xe776('0x43')]){_0x45b7a2[_0xe776('0x47')]=_['merge'](_0x45b7a2[_0xe776('0x47')],{'$or':_['map'](_0x45b7a2[_0xe776('0x4e')],function(_0x41d678){var _0x526ee8={};_0x526ee8[_0x41d678]={'$like':'%'+_0x32fb94[_0xe776('0x4a')][_0xe776('0x43')]+'%'};return _0x526ee8;})});}_0x45b7a2=_[_0xe776('0x5d')]({},_0x45b7a2,_0x32fb94[_0xe776('0x5e')]);return _0x38bcdf['getSmsInteractions'](_0x45b7a2);}})[_0xe776('0x22')](function(_0xb7188a){if(_0xb7188a){_0x5d7be0=_0xb7188a['length'];if(!_0x32fb94[_0xe776('0x4a')]['hasOwnProperty'](_0xe776('0xd8'))){_0x45b7a2[_0xe776('0x1d')]=qs[_0xe776('0x1d')](_0x32fb94[_0xe776('0x4a')][_0xe776('0x1d')]);_0x45b7a2[_0xe776('0x1a')]=qs[_0xe776('0x1a')](_0x32fb94[_0xe776('0x4a')]['offset']);}return _0x38bcdf[_0xe776('0xe6')](_0x45b7a2);}})[_0xe776('0x22')](function(_0x429d85){if(_0x429d85){return _0x429d85?{'count':_0x5d7be0,'rows':_0x429d85}:null;}})['then'](respondWithResult(_0x5bee54,null))[_0xe776('0x5a')](handleError(_0x5bee54,null));};exports[_0xe776('0xe8')]=function(_0x2e5abe,_0x6c2b2){var _0x1c4107={};var _0x4a2867={};var _0x557e70;var _0x183a98;return db['User'][_0xe776('0x9e')]({'where':{'id':_0x2e5abe[_0xe776('0x62')]['id']}})[_0xe776('0x22')](handleEntityNotFound(_0x6c2b2,null))[_0xe776('0x22')](function(_0x101349){if(_0x101349){_0x557e70=_0x101349;_0x4a2867[_0xe776('0xcd')]=_['keys'](db[_0xe776('0xe9')][_0xe776('0x42')]);_0x4a2867[_0xe776('0x4a')]=_[_0xe776('0xce')](_0x2e5abe[_0xe776('0x4a')]);_0x4a2867[_0xe776('0xd3')]=_[_0xe776('0xcf')](_0x4a2867[_0xe776('0xcd')],_0x4a2867[_0xe776('0x4a')]);_0x1c4107[_0xe776('0x4e')]=_[_0xe776('0xcf')](_0x4a2867[_0xe776('0xcd')],qs[_0xe776('0xd0')](_0x2e5abe[_0xe776('0x4a')][_0xe776('0xd0')]));_0x1c4107[_0xe776('0x4e')]=_0x1c4107['attributes']['length']?_0x1c4107['attributes']:_0x4a2867['model'];_0x1c4107['order']=qs['sort'](_0x2e5abe['query'][_0xe776('0xd2')]);_0x1c4107[_0xe776('0x47')]=qs[_0xe776('0xd3')](_[_0xe776('0xd4')](_0x2e5abe['query'],_0x4a2867[_0xe776('0xd3')]));if(_0x2e5abe[_0xe776('0x4a')]['filter']){_0x1c4107['where']=_[_0xe776('0x5d')](_0x1c4107[_0xe776('0x47')],{'$or':_[_0xe776('0x39')](_0x1c4107['attributes'],function(_0xda887e){var _0x18a54a={};_0x18a54a[_0xda887e]={'$like':'%'+_0x2e5abe[_0xe776('0x4a')][_0xe776('0x43')]+'%'};return _0x18a54a;})});}_0x1c4107=_[_0xe776('0x5d')]({},_0x1c4107,_0x2e5abe['options']);return _0x557e70[_0xe776('0xe8')](_0x1c4107);}})[_0xe776('0x22')](function(_0x48700e){if(_0x48700e){_0x183a98=_0x48700e['length'];if(!_0x2e5abe[_0xe776('0x4a')][_0xe776('0xdb')](_0xe776('0xd8'))){_0x1c4107[_0xe776('0x1d')]=qs[_0xe776('0x1d')](_0x2e5abe['query'][_0xe776('0x1d')]);_0x1c4107[_0xe776('0x1a')]=qs[_0xe776('0x1a')](_0x2e5abe['query'][_0xe776('0x1a')]);}return _0x557e70[_0xe776('0xe8')](_0x1c4107);}})[_0xe776('0x22')](function(_0x417d04){if(_0x417d04){return _0x417d04?{'count':_0x183a98,'rows':_0x417d04}:null;}})[_0xe776('0x22')](respondWithResult(_0x6c2b2,null))[_0xe776('0x5a')](handleError(_0x6c2b2,null));};exports['getWhatsappInteractions']=function(_0x4b7f8d,_0x3d485f){var _0x484643={};var _0x5b029e={};var _0x3f0a80;var _0x4bd181;return db['User'][_0xe776('0x9e')]({'where':{'id':_0x4b7f8d[_0xe776('0x62')]['id']}})[_0xe776('0x22')](handleEntityNotFound(_0x3d485f,null))[_0xe776('0x22')](function(_0x2c70f5){if(_0x2c70f5){_0x3f0a80=_0x2c70f5;_0x5b029e[_0xe776('0xcd')]=_['keys'](db[_0xe776('0xea')][_0xe776('0x42')]);_0x5b029e['query']=_[_0xe776('0xce')](_0x4b7f8d[_0xe776('0x4a')]);_0x5b029e[_0xe776('0xd3')]=_[_0xe776('0xcf')](_0x5b029e[_0xe776('0xcd')],_0x5b029e[_0xe776('0x4a')]);_0x484643[_0xe776('0x4e')]=_['intersection'](_0x5b029e['model'],qs[_0xe776('0xd0')](_0x4b7f8d[_0xe776('0x4a')][_0xe776('0xd0')]));_0x484643[_0xe776('0x4e')]=_0x484643[_0xe776('0x4e')][_0xe776('0x91')]?_0x484643[_0xe776('0x4e')]:_0x5b029e[_0xe776('0xcd')];_0x484643[_0xe776('0xd1')]=qs['sort'](_0x4b7f8d['query'][_0xe776('0xd2')]);_0x484643[_0xe776('0x47')]=qs[_0xe776('0xd3')](_[_0xe776('0xd4')](_0x4b7f8d[_0xe776('0x4a')],_0x5b029e[_0xe776('0xd3')]));if(_0x4b7f8d[_0xe776('0x4a')][_0xe776('0x43')]){_0x484643[_0xe776('0x47')]=_[_0xe776('0x5d')](_0x484643[_0xe776('0x47')],{'$or':_[_0xe776('0x39')](_0x484643[_0xe776('0x4e')],function(_0x4561be){var _0x2ff938={};_0x2ff938[_0x4561be]={'$like':'%'+_0x4b7f8d[_0xe776('0x4a')][_0xe776('0x43')]+'%'};return _0x2ff938;})});}_0x484643=_['merge']({},_0x484643,_0x4b7f8d[_0xe776('0x5e')]);return _0x3f0a80[_0xe776('0xeb')](_0x484643);}})[_0xe776('0x22')](function(_0x4271b3){if(_0x4271b3){_0x4bd181=_0x4271b3[_0xe776('0x91')];if(!_0x4b7f8d[_0xe776('0x4a')][_0xe776('0xdb')](_0xe776('0xd8'))){_0x484643[_0xe776('0x1d')]=qs[_0xe776('0x1d')](_0x4b7f8d[_0xe776('0x4a')][_0xe776('0x1d')]);_0x484643[_0xe776('0x1a')]=qs['offset'](_0x4b7f8d['query']['offset']);}return _0x3f0a80['getWhatsappInteractions'](_0x484643);}})[_0xe776('0x22')](function(_0x1ac0b0){if(_0x1ac0b0){return _0x1ac0b0?{'count':_0x4bd181,'rows':_0x1ac0b0}:null;}})['then'](respondWithResult(_0x3d485f,null))[_0xe776('0x5a')](handleError(_0x3d485f,null));};exports['login']=function(_0xfb5b1c,_0x5c44d9,_0x5702c4){var _0x51e4a1;var _0x4f5578;var _0x5c8b98;var _0x8089ff=!_[_0xe776('0x6b')](_0xfb5b1c[_0xe776('0x62')]['id'])?_0xfb5b1c['params']['id']:!_[_0xe776('0x6b')](_0xfb5b1c[_0xe776('0x35')]['id'])?_0xfb5b1c[_0xe776('0x35')]['id']:null;return db[_0xe776('0x5f')]['find']({'where':{'id':_0x8089ff,'role':{'$or':[_0xe776('0x33'),'user',_0xe776('0x2f')]}},'attributes':['id','name',_0xe776('0xec'),_0xe776('0xed'),_0xe776('0x2e'),_0xe776('0x6d'),_0xe776('0xa3')]})[_0xe776('0x22')](function(_0x131e99){if(_0x131e99){if(_0x131e99[_0xe776('0x2e')]===_0xe776('0x2f')){_0x51e4a1=_0x131e99;if(_0xfb5b1c['body'][_0xe776('0xa5')]){_0x5c8b98=util[_0xe776('0xad')](_0xe776('0xee'),_0x51e4a1[_0xfb5b1c[_0xe776('0x61')][_0xe776('0xa5')]]);}else if(_0xfb5b1c['body'][_0xe776('0xef')]){_0x5c8b98=util[_0xe776('0xad')](_0xe776('0xae'),_0xfb5b1c[_0xe776('0x61')]['intrf']);}else{_0x5c8b98=util[_0xe776('0xad')](_0xe776('0xae'),_0x51e4a1[_0xe776('0x3d')]);}socket['to'](util[_0xe776('0xad')](_0xe776('0xf0'),_0x51e4a1[_0xe776('0x3d')]))['emit'](_0xe776('0xf1'),{'user':{'id':_0x51e4a1['id'],'name':_0x51e4a1[_0xe776('0x3d')]},'ip':_0xfb5b1c[_0xe776('0xf2')]['x-forwarded-for']||_0xfb5b1c[_0xe776('0xf3')]['remoteAddress']||_0xfb5b1c[_0xe776('0xf4')]['remoteAddress']||_0xfb5b1c[_0xe776('0xf3')][_0xe776('0xf4')][_0xe776('0xf5')]});return db['UserVoiceQueueRt'][_0xe776('0x3f')]({'where':{'membername':_0x51e4a1[_0xe776('0x3d')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0xe776('0x9a'))](_0xe776('0xf6'));}})[_0xe776('0x22')](function(){if(_0x51e4a1){return _0x51e4a1[_0xe776('0xf7')]({'raw':!![]});}})[_0xe776('0x22')](function(_0x192e24){if(_0x51e4a1){if(_0x192e24){_0x4f5578=_0x192e24;if(_0x4f5578[_0xe776('0x91')]){var _0x5644ab=_0x4f5578[_0xe776('0x39')](function(_0x2c4c4b){var _0x207b94={'membername':_0x51e4a1[_0xe776('0x3d')],'UserId':_0x51e4a1['id'],'queue_name':_0x2c4c4b[_0xe776('0x3d')],'VoiceQueueId':_0x2c4c4b['id'],'interface':_0x5c8b98,'paused':_0x51e4a1['loginInPause']||![],'penalty':_0x2c4c4b[_0xe776('0xf8')]||0x0};return db['UserVoiceQueueRt'][_0xe776('0xb1')](_0x207b94);});return Promise[_0xe776('0x59')](_0x5644ab);}}}})[_0xe776('0x22')](function(){if(_0x51e4a1){return db['MemberReport']['findAll']({'where':{'membername':_0x51e4a1[_0xe776('0x3d')],'exitAt':null}});}})[_0xe776('0x22')](function(_0x2f6276){if(_0x51e4a1){var _0x492101=[];_0x2f6276['forEach'](function(_0x9a7dc){_0x492101[_0xe776('0x54')](_0x9a7dc[_0xe776('0x2d')]({'exitAt':moment()[_0xe776('0xad')](_0xe776('0xf9'))}));});return Promise[_0xe776('0x59')](_0x492101);}})['then'](function(){if(_0x51e4a1){var _0x50090e=[];var _0xbd8faf=[];var _0x396d8e=utils[_0xe776('0xfa')]();var _0x4890d9={'membername':_0x51e4a1[_0xe776('0x3d')],'interface':_0x5c8b98,'enterAt':moment()[_0xe776('0xad')](_0xe776('0xf9')),'role':_0x51e4a1[_0xe776('0x2e')],'internal':_0x51e4a1['internal']};_0x396d8e['forEach'](function(_0xad14cf){_0x50090e[_0xe776('0x54')](_[_0xe776('0x5d')]({'channel':_0xad14cf,'type':_0xe776('0xfb'),'data1':_0xfb5b1c[_0xe776('0x61')][_0xe776('0xfc')],'data2':_0x5c8b98},_0x4890d9));if(_0x51e4a1[_0xe776('0xa3')]){_0xbd8faf[_0xe776('0x54')](_['merge']({'channel':_0xad14cf,'type':'PAUSE','data1':_0xe776('0xfd')},_0x4890d9));}});return db['MemberReport']['bulkCreate'](_0x50090e[_0xe776('0xc5')](_0xbd8faf),{'individualHooks':!![]});}})[_0xe776('0x22')](function(){if(_0x51e4a1){return _0x51e4a1['update']({'online':!![],'lastLoginAt':moment()[_0xe776('0xad')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x51e4a1['loginInPause']||![],'mailPause':_0x51e4a1[_0xe776('0xa3')]||![],'chatPause':_0x51e4a1[_0xe776('0xa3')]||![],'faxPause':_0x51e4a1[_0xe776('0xa3')]||![],'smsPause':_0x51e4a1[_0xe776('0xa3')]||![],'openchannelPause':_0x51e4a1[_0xe776('0xa3')]||![],'whatsappPause':_0x51e4a1[_0xe776('0xa3')]||![],'pauseType':_0x51e4a1[_0xe776('0xa3')]?'LOGININPAUSE':null,'interface':_0x5c8b98,'lastPauseAt':moment()[_0xe776('0xad')](_0xe776('0xf9'))});}})[_0xe776('0x22')](function(_0x3eeebc){if(_0xfb5b1c[_0xe776('0xfe')]){return _0x5702c4();}else{return Promise['resolve'](_0x3eeebc)[_0xe776('0x22')](respondWithResult(_0x5c44d9,null));}})[_0xe776('0x5a')](handleError(_0x5c44d9,null));};exports[_0xe776('0xff')]=function(_0x3a4df9,_0x5d14fc){var _0x159a68;return db[_0xe776('0x5f')]['find']({'where':{'id':_0x3a4df9[_0xe776('0x62')]['id'],'role':_0xe776('0x2f')},'attributes':['id',_0xe776('0x3d'),_0xe776('0x2e')]})[_0xe776('0x22')](handleEntityNotFound(_0x5d14fc,null))[_0xe776('0x22')](function(_0x3675ae){if(_0x3675ae){_0x159a68=_0x3675ae;return db['UserVoiceQueueRt'][_0xe776('0x3f')]({'where':{'membername':_0x159a68[_0xe776('0x3d')]},'individualHooks':!![]});}})[_0xe776('0x22')](function(){return db[_0xe776('0x100')][_0xe776('0x4f')]({'where':{'membername':_0x159a68[_0xe776('0x3d')],'exitAt':null}});})[_0xe776('0x22')](function(_0x47d00c){var _0x2a5f2c=[];_0x47d00c[_0xe776('0x101')](function(_0x2d0687){_0x2a5f2c['push'](_0x2d0687[_0xe776('0x2d')]({'exitAt':moment()[_0xe776('0xad')](_0xe776('0xf9'))}));});return Promise['all'](_0x2a5f2c);})[_0xe776('0x22')](function(){return _0x159a68['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xe776('0x22')](respondWithResult(_0x5d14fc,null))['catch'](handleError(_0x5d14fc,null));};exports[_0xe776('0x102')]=function(_0x55fae1,_0x586a96){var _0x500f6a;return db['UserVoiceQueueRt'][_0xe776('0x2d')]({'paused':0x1},{'where':{'UserId':_0x55fae1[_0xe776('0x62')]['id']},'individualHooks':!![]})[_0xe776('0x22')](function(){return db['User'][_0xe776('0x3c')]({'where':{'id':_0x55fae1['params']['id'],'role':_0xe776('0x2f')},'attributes':['id',_0xe776('0x3d'),'role',_0xe776('0x6d'),'interface',_0xe776('0x103')]});})['then'](handleEntityNotFound(_0x586a96,null))[_0xe776('0x22')](function(_0x861e74){if(_0x861e74){_0x500f6a=_0x861e74;return respondWithRpcPromise(_0xe776('0x104'),_0xe776('0x102'),{'id':_0x500f6a['id'],'name':_0x500f6a['name'],'pause':!![]});}})[_0xe776('0x22')](function(){if(_0x500f6a){return db[_0xe776('0x100')][_0xe776('0x4f')]({'where':{'membername':_0x500f6a[_0xe776('0x3d')],'type':_0xe776('0x105'),'exitAt':null}});}})[_0xe776('0x22')](function(_0x301240){if(_0x301240[_0xe776('0x91')]){var _0x309504=moment()['format'](_0xe776('0xf9'));for(var _0x3a1e8a=0x0,_0x328f75=_0x301240[_0xe776('0x91')];_0x3a1e8a<_0x328f75;_0x3a1e8a++){_0x301240[_0x3a1e8a][_0xe776('0x106')]({'exitAt':_0x309504});}}})['then'](function(){var _0x5f29fa=[];var _0x559c74=utils['getChannels']();_0x559c74[_0xe776('0x101')](function(_0x1719df){_0x5f29fa['push']({'channel':_0x1719df,'membername':_0x500f6a[_0xe776('0x3d')],'interface':_[_0xe776('0x6b')](_0x500f6a[_0xe776('0xa5')])?util['format'](_0xe776('0xae'),_0x500f6a[_0xe776('0x3d')]):_0x500f6a['interface'],'type':'PAUSE','enterAt':moment()[_0xe776('0xad')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x55fae1[_0xe776('0x61')][_0xe776('0x107')]||_0xe776('0x108'),'role':_0x500f6a[_0xe776('0x2e')],'internal':_0x500f6a[_0xe776('0x6d')]});});return db['MemberReport']['bulkCreate'](_0x5f29fa,{'individualHooks':!![]});})[_0xe776('0x22')](function(){return _0x500f6a['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x55fae1[_0xe776('0x61')][_0xe776('0x107')]||_0xe776('0x108'),'lastPauseAt':moment()[_0xe776('0xad')](_0xe776('0xf9'))});})[_0xe776('0x22')](respondWithResult(_0x586a96,null))[_0xe776('0x5a')](handleError(_0x586a96,null));};exports[_0xe776('0x109')]=function(_0x3ec3b7,_0x487549){if(_0x3ec3b7[_0xe776('0x61')][_0xe776('0xa2')]&&!utils[_0xe776('0xa6')](_0x3ec3b7[_0xe776('0x61')][_0xe776('0xa2')])){throw new APIBadRequestError(util[_0xe776('0xad')](_0xe776('0x10a'),_0x3ec3b7[_0xe776('0x61')]['channel']));}return db[_0xe776('0x5f')][_0xe776('0x3c')]({'where':{'id':_0x3ec3b7[_0xe776('0x62')]['id']},'attributes':['id',_0xe776('0x3d'),_0xe776('0x2e'),_0xe776('0x6d'),_0xe776('0xa5'),_0xe776('0x103'),'voicePause','mailPause',_0xe776('0x10b'),_0xe776('0x10c'),_0xe776('0x10d'),'smsPause',_0xe776('0x10e'),_0xe776('0x10f'),_0xe776('0x110')]})['then'](function(_0x45e0ee){if(!_0x45e0ee){throw new APINotFoundError(util[_0xe776('0xad')](_0xe776('0x111'),_0x3ec3b7[_0xe776('0x62')]['id']));}return _0x45e0ee[_0xe776('0x109')](_0x3ec3b7['body'][_0xe776('0xa2')]);})[_0xe776('0x22')](respondWithResult(_0x487549,null))[_0xe776('0x5a')](APIHandleError(_0x487549));};exports[_0xe776('0x112')]=function(_0xa9e3e5,_0x4d1802){var _0xe31498={};var _0x3cc60b={};var _0x448561;var _0x1bb16c;return db['User'][_0xe776('0x9e')]({'where':{'id':_0xa9e3e5[_0xe776('0x62')]['id']}})[_0xe776('0x22')](handleEntityNotFound(_0x4d1802,null))['then'](function(_0x3d25c1){if(_0x3d25c1){_0x448561=_0x3d25c1;_0x3cc60b[_0xe776('0xcd')]=_[_0xe776('0xce')](db['Team']['rawAttributes']);_0x3cc60b[_0xe776('0x4a')]=_['keys'](_0xa9e3e5[_0xe776('0x4a')]);_0x3cc60b[_0xe776('0xd3')]=_['intersection'](_0x3cc60b[_0xe776('0xcd')],_0x3cc60b[_0xe776('0x4a')]);_0xe31498['attributes']=_[_0xe776('0xcf')](_0x3cc60b[_0xe776('0xcd')],qs[_0xe776('0xd0')](_0xa9e3e5[_0xe776('0x4a')][_0xe776('0xd0')]));_0xe31498[_0xe776('0x4e')]=_0xe31498[_0xe776('0x4e')]['length']?_0xe31498[_0xe776('0x4e')]:_0x3cc60b['model'];_0xe31498['order']=qs[_0xe776('0xd2')](_0xa9e3e5['query'][_0xe776('0xd2')]);_0xe31498[_0xe776('0x47')]=qs[_0xe776('0xd3')](_[_0xe776('0xd4')](_0xa9e3e5[_0xe776('0x4a')],_0x3cc60b[_0xe776('0xd3')]));if(_0xa9e3e5[_0xe776('0x4a')][_0xe776('0x43')]){_0xe31498[_0xe776('0x47')]=_['merge'](_0xe31498[_0xe776('0x47')],{'$or':_['map'](_0xe31498['attributes'],function(_0x45f863){var _0x505dc1={};_0x505dc1[_0x45f863]={'$like':'%'+_0xa9e3e5[_0xe776('0x4a')][_0xe776('0x43')]+'%'};return _0x505dc1;})});}_0xe31498=_['merge']({},_0xe31498,_0xa9e3e5['options']);return _0x448561[_0xe776('0x112')](_0xe31498);}})[_0xe776('0x22')](function(_0x309eab){if(_0x309eab){_0x1bb16c=_0x309eab[_0xe776('0x91')];if(!_0xa9e3e5[_0xe776('0x4a')][_0xe776('0xdb')](_0xe776('0xd8'))){_0xe31498[_0xe776('0x1d')]=qs[_0xe776('0x1d')](_0xa9e3e5[_0xe776('0x4a')][_0xe776('0x1d')]);_0xe31498[_0xe776('0x1a')]=qs[_0xe776('0x1a')](_0xa9e3e5['query'][_0xe776('0x1a')]);}return _0x448561[_0xe776('0x112')](_0xe31498);}})[_0xe776('0x22')](function(_0x52681c){if(_0x52681c){return _0x52681c?{'count':_0x1bb16c,'rows':_0x52681c}:null;}})[_0xe776('0x22')](respondWithResult(_0x4d1802,null))['catch'](handleError(_0x4d1802,null));};exports[_0xe776('0x113')]=function(_0x3208d5,_0xce37a5){var _0xda250e=_0x3208d5['params']['id'];var _0x42824e=_0x3208d5[_0xe776('0x61')]?_0x3208d5[_0xe776('0x61')][_0xe776('0x65')]:null;var _0x22ce82=[];return Promise['resolve']()[_0xe776('0x22')](function(){if(!_0x42824e)throw new APIBadRequestError(_0xe776('0x114'));})[_0xe776('0x22')](function(){return db['User'][_0xe776('0x9e')]({'where':{'id':_0xda250e}});})[_0xe776('0x22')](function(_0x31736f){if(!_0x31736f)throw new APINotFoundError(util[_0xe776('0xad')](_0xe776('0x111'),_0x3208d5['params']['id']));return db[_0xe776('0x6e')][_0xe776('0x115')](function(_0x33bb6e){return _0x31736f[_0xe776('0x113')](_0x42824e,{'transaction':_0x33bb6e})[_0xe776('0x22')](function(){return db[_0xe776('0x116')][_0xe776('0x4f')]({'where':{'id':{'$in':_0x42824e}}});})[_0xe776('0x22')](function(_0x5ef0d2){var _0x3e9954=_[_0xe776('0x39')](_0x5ef0d2,function(_0x4e0f10){return _0x4e0f10[_0xe776('0x117')]();});return Promise[_0xe776('0x59')](_0x3e9954);})[_0xe776('0x22')](function(_0x196597){_0x22ce82=_[_0xe776('0x118')](_0x196597);var _0x3a4502=_[_0xe776('0x39')](_0x22ce82,function(_0x4be413){return _0x4be413[_0xe776('0x119')](_0x31736f['id'],{'transaction':_0x33bb6e});});return Promise['all'](_0x3a4502);})[_0xe776('0x22')](function(){if(!_0x31736f['online'])return;var _0x1a9e5f=_[_0xe776('0x43')](_0x22ce82,function(_0x2f2c2e){return _0x2f2c2e['getDataValue'](_0xe776('0xa2'))==='Voice';});var _0x1d0973=_[_0xe776('0x39')](_0x1a9e5f,function(_0x2030df){return db['UserVoiceQueueRt'][_0xe776('0xb1')]({'membername':_0x31736f['name'],'UserId':_0x31736f['id'],'queue_name':_0x2030df[_0xe776('0x3d')],'VoiceQueueId':_0x2030df['id'],'interface':_[_0xe776('0x6b')](_0x31736f[_0xe776('0xa5')])?util[_0xe776('0xad')](_0xe776('0xae'),_0x31736f[_0xe776('0x3d')]):_0x31736f[_0xe776('0xa5')],'paused':_0x31736f[_0xe776('0xa4')]||![],'penalty':_0x31736f[_0xe776('0xaf')]},{'transaction':_0x33bb6e});});return Promise['all'](_0x1d0973);})[_0xe776('0x22')](function(){return db[_0xe776('0x11a')][_0xe776('0x4f')]({'where':{'teamId':{'$in':_0x42824e}}});})[_0xe776('0x22')](function(_0x36c044){var _0x1ded70=_[_0xe776('0x39')](_0x36c044,function(_0x595627){return db['UserVoicePrefix'][_0xe776('0x86')]({'UserId':_0x31736f['id'],'VoicePrefixId':_0x595627[_0xe776('0x11b')]},{'transaction':_0x33bb6e});});return Promise[_0xe776('0x59')](_0x1ded70);});});})[_0xe776('0x22')](function(){for(var _0x4a3221=0x0;_0x4a3221<_0x22ce82['length'];_0x4a3221++){var _0x3ef974=_0x22ce82[_0x4a3221]['getDataValue']('channel');var _0x2fdfb7=_0x3ef974+_0xe776('0xab');socket['emit'](_0xe776('0x35')+_0x3ef974+_0xe776('0x11c'),{'UserId':_0xda250e,['queueField']:_0x22ce82[_0x4a3221]['id']});}})[_0xe776('0x22')](respondWithStatusCode(_0xce37a5,null))[_0xe776('0x5a')](APIHandleError(_0xce37a5));};exports[_0xe776('0x11d')]=function(_0x21ed5a,_0x1fa057){var _0x5ec734=_0x21ed5a[_0xe776('0x62')]['id'];var _0x2a945d=null;if(_0x21ed5a['query'][_0xe776('0x65')]){_0x2a945d=_[_0xe776('0xb3')](_0x21ed5a['query'][_0xe776('0x65')])?_0x21ed5a[_0xe776('0x4a')][_0xe776('0x65')]:[_0x21ed5a[_0xe776('0x4a')]['ids']];}var _0x29ca2f=[];return Promise[_0xe776('0x11e')]()['then'](function(){if(!_0x2a945d)throw new APIBadRequestError(_0xe776('0x11f'));})[_0xe776('0x22')](function(){return db['User']['findOne']({'where':{'id':_0x5ec734}});})['then'](function(_0x160adc){if(!_0x160adc)throw new APINotFoundError(util[_0xe776('0xad')]('User\x20with\x20id\x20%s\x20not\x20found',_0x21ed5a[_0xe776('0x62')]['id']));return db['sequelize']['transaction'](function(_0x557af2){return _0x160adc[_0xe776('0x11d')](_0x2a945d,{'transaction':_0x557af2})[_0xe776('0x22')](function(){return db[_0xe776('0x116')][_0xe776('0x4f')]({'where':{'id':{'$in':_0x2a945d}}});})[_0xe776('0x22')](function(_0x3db6bf){var _0x5de0b5=_[_0xe776('0x39')](_0x3db6bf,function(_0x4720d6){return _0x4720d6[_0xe776('0x117')]();});return Promise[_0xe776('0x59')](_0x5de0b5);})[_0xe776('0x22')](function(_0x5b006b){_0x29ca2f=_['flattenDeep'](_0x5b006b);var _0xfa5632=_[_0xe776('0x39')](_0x29ca2f,function(_0x279f67){return _0x279f67[_0xe776('0x120')](_0x160adc['id'],{'transaction':_0x557af2});});return Promise['all'](_0xfa5632);})[_0xe776('0x22')](function(){if(!_0x160adc[_0xe776('0x103')])return;var _0x363113=_['filter'](_0x29ca2f,function(_0x7f17e9){return _0x7f17e9[_0xe776('0x121')]('channel')===_0xe776('0x122');});var _0x13aabd=_[_0xe776('0x39')](_0x363113,function(_0x1d0f28){return db[_0xe776('0xb0')]['destroy']({'where':{'VoiceQueueId':_0x1d0f28['id'],'UserId':_0x160adc['id']},'transaction':_0x557af2});});return Promise[_0xe776('0x59')](_0x13aabd);})[_0xe776('0x22')](function(){return db[_0xe776('0x11a')][_0xe776('0x4f')]({'where':{'teamId':{'$in':_0x2a945d}}});})['then'](function(_0x3ee660){var _0x504197=_[_0xe776('0x39')](_0x3ee660,function(_0x27cc33){return db['UserVoicePrefix'][_0xe776('0x3f')]({'where':{'UserId':_0x160adc['id'],'VoicePrefixId':_0x27cc33['VoicePrefixId']}},{'transaction':_0x557af2});});return Promise[_0xe776('0x59')](_0x504197);});});})['then'](function(){for(var _0x2cc823=0x0;_0x2cc823<_0x29ca2f['length'];_0x2cc823++){var _0x6e3e69=_0x29ca2f[_0x2cc823]['getDataValue']('channel');var _0x489b46=_0x6e3e69+_0xe776('0xab');socket[_0xe776('0x30')](_0xe776('0x35')+_0x6e3e69+'Queue:remove',{'UserId':_0x5ec734,['queueField']:_0x29ca2f[_0x2cc823]['id']});}})['then'](respondWithStatusCode(_0x1fa057,null))[_0xe776('0x5a')](APIHandleError(_0x1fa057));};exports[_0xe776('0x123')]=function(_0x48a5f0,_0x3a8033){var _0x1cbb0c={};var _0x27e841={};var _0x3d4860;var _0x23a141;return db[_0xe776('0x5f')][_0xe776('0x9e')]({'where':{'id':_0x48a5f0['params']['id']}})['then'](handleEntityNotFound(_0x3a8033,null))[_0xe776('0x22')](function(_0x59c270){if(_0x59c270){_0x3d4860=_0x59c270;_0x27e841[_0xe776('0xcd')]=_[_0xe776('0xce')](db['CmList'][_0xe776('0x42')]);_0x27e841['query']=_[_0xe776('0xce')](_0x48a5f0[_0xe776('0x4a')]);_0x27e841['filters']=_[_0xe776('0xcf')](_0x27e841[_0xe776('0xcd')],_0x27e841[_0xe776('0x4a')]);_0x1cbb0c['attributes']=_[_0xe776('0xcf')](_0x27e841[_0xe776('0xcd')],qs[_0xe776('0xd0')](_0x48a5f0[_0xe776('0x4a')]['fields']));_0x1cbb0c['attributes']=_0x1cbb0c['attributes']['length']?_0x1cbb0c[_0xe776('0x4e')]:_0x27e841[_0xe776('0xcd')];_0x1cbb0c[_0xe776('0xd1')]=qs[_0xe776('0xd2')](_0x48a5f0[_0xe776('0x4a')][_0xe776('0xd2')]);_0x1cbb0c[_0xe776('0x47')]=qs[_0xe776('0xd3')](_['pick'](_0x48a5f0[_0xe776('0x4a')],_0x27e841[_0xe776('0xd3')]));if(_0x48a5f0[_0xe776('0x4a')][_0xe776('0x43')]){_0x1cbb0c[_0xe776('0x47')]=_[_0xe776('0x5d')](_0x1cbb0c['where'],{'$or':_['map'](_0x1cbb0c[_0xe776('0x4e')],function(_0x26788f){var _0x1a08e6={};_0x1a08e6[_0x26788f]={'$like':'%'+_0x48a5f0['query']['filter']+'%'};return _0x1a08e6;})});}_0x1cbb0c=_[_0xe776('0x5d')]({},_0x1cbb0c,_0x48a5f0['options']);return _0x3d4860[_0xe776('0x123')](_0x1cbb0c);}})[_0xe776('0x22')](function(_0x523528){if(_0x523528){_0x23a141=_0x523528['length'];if(!_0x48a5f0[_0xe776('0x4a')][_0xe776('0xdb')](_0xe776('0xd8'))){_0x1cbb0c[_0xe776('0x1d')]=qs['limit'](_0x48a5f0[_0xe776('0x4a')][_0xe776('0x1d')]);_0x1cbb0c[_0xe776('0x1a')]=qs[_0xe776('0x1a')](_0x48a5f0[_0xe776('0x4a')]['offset']);}return _0x3d4860[_0xe776('0x123')](_0x1cbb0c);}})[_0xe776('0x22')](function(_0x28f7cc){if(_0x28f7cc){return _0x28f7cc?{'count':_0x23a141,'rows':_0x28f7cc}:null;}})['then'](respondWithResult(_0x3a8033,null))[_0xe776('0x5a')](handleError(_0x3a8033,null));};exports[_0xe776('0x124')]=function(_0xfbd26e,_0x10db1c){var _0x41ee3d={};var _0x235e54={};var _0x21ee37;return db['User'][_0xe776('0x9e')]({'where':{'id':_0xfbd26e[_0xe776('0x62')]['id']}})[_0xe776('0x22')](handleEntityNotFound(_0x10db1c,null))['then'](function(_0xd9d5b3){if(_0xd9d5b3){_0x21ee37=_0xd9d5b3;_0x235e54['model']=_['keys'](db['User'][_0xe776('0x42')]);_0x235e54[_0xe776('0x4a')]=_[_0xe776('0xce')](_0xfbd26e[_0xe776('0x4a')]);_0x235e54[_0xe776('0xd3')]=_[_0xe776('0xcf')](_0x235e54[_0xe776('0xcd')],_0x235e54[_0xe776('0x4a')]);_0x41ee3d['attributes']=_[_0xe776('0xcf')](_0x235e54[_0xe776('0xcd')],qs[_0xe776('0xd0')](_0xfbd26e[_0xe776('0x4a')][_0xe776('0xd0')]));_0x41ee3d['attributes']=_0x41ee3d[_0xe776('0x4e')][_0xe776('0x91')]?_0x41ee3d['attributes']:_0x235e54[_0xe776('0xcd')];_0x41ee3d[_0xe776('0xd1')]=qs['sort'](_0xfbd26e[_0xe776('0x4a')]['sort']);_0x41ee3d['where']=qs[_0xe776('0xd3')](_[_0xe776('0xd4')](_0xfbd26e[_0xe776('0x4a')],_0x235e54[_0xe776('0xd3')]));if(_0xfbd26e[_0xe776('0x4a')]['filter']){_0x41ee3d[_0xe776('0x47')]=_[_0xe776('0x5d')](_0x41ee3d[_0xe776('0x47')],{'$or':_[_0xe776('0x39')](_0x41ee3d[_0xe776('0x4e')],function(_0x199dfd){var _0x5b1176={};_0x5b1176[_0x199dfd]={'$like':'%'+_0xfbd26e[_0xe776('0x4a')][_0xe776('0x43')]+'%'};return _0x5b1176;})});}_0x41ee3d[_0xe776('0xcd')]=db[_0xe776('0x5f')];_0x41ee3d['as']='Agents';_0x41ee3d=_[_0xe776('0x5d')]({},_0x41ee3d,_0xfbd26e[_0xe776('0x5e')]);return _0x21ee37[_0xe776('0xf7')]({'include':[_0x41ee3d]});}})[_0xe776('0x22')](function(_0x4b678d){if(_0x4b678d){var _0x9c385e={},_0xb9dbcc=[];for(var _0x2dfb8c=0x0;_0x2dfb8c<_0x4b678d[_0xe776('0x91')];_0x2dfb8c+=0x1){for(var _0x21cedf=0x0,_0x1acaaf;_0x21cedf<_0x4b678d[_0x2dfb8c][_0xe776('0x36')]['length'];_0x21cedf+=0x1){_0x1acaaf=_0x4b678d[_0x2dfb8c][_0xe776('0x36')][_0x21cedf][_0xe776('0x32')]({'plain':!![]});_0x9c385e[_0x1acaaf['id']]=_0x1acaaf;}}_0x9c385e=_[_0xe776('0x125')](_0x9c385e);for(var _0x8fd89b=qs[_0xe776('0x1a')](_0xfbd26e['query'][_0xe776('0x1a')]);_0x8fd89b<_0x9c385e[_0xe776('0x91')]&&_0xb9dbcc[_0xe776('0x91')]=_0x1f6455){_0x4a88bd=_0x1f6455;_0x339856=0xc8;}else{_0x339856=0xce;}_0x3ac2b9[_0x89dc('0x16')](_0x339856);return _0x3ac2b9[_0x89dc('0x1b')](_0x89dc('0x1c'),_0x166eaf+'-'+_0x4a88bd+'/'+_0x1f6455)[_0x89dc('0x1d')](_0x362b93);}return null;};}function respondWithRpcPromise(_0xd3048f,_0x276709,_0x53645a,_0x39d8f6){return new Promise(function(_0x1aeaa3,_0x13731b){var _0x6b052c=_0x39d8f6||amiClient;return _0x6b052c[_0x89dc('0x1e')](_0xd3048f,_0x53645a)[_0x89dc('0x1f')](function(_0x574696){logger[_0x89dc('0x20')](_0x89dc('0x21'),_0x276709,'request\x20sent');logger[_0x89dc('0x22')](_0x89dc('0x23'),_0x276709,_0x89dc('0x24'),JSON[_0x89dc('0x25')](_0x574696));if(_0x574696['error']){if(_0x574696[_0x89dc('0x26')][_0x89dc('0x27')]===0x1f4){logger[_0x89dc('0x26')]('User,\x20%s,\x20%s',_0x276709,_0x574696[_0x89dc('0x26')][_0x89dc('0x28')]);return _0x13731b(_0x574696[_0x89dc('0x26')][_0x89dc('0x28')]);}logger[_0x89dc('0x26')]('User,\x20%s,\x20%s',_0x276709,_0x574696[_0x89dc('0x26')]['message']);return _0x1aeaa3(_0x574696[_0x89dc('0x26')][_0x89dc('0x28')]);}else{logger[_0x89dc('0x20')]('User,\x20%s,\x20%s',_0x276709,_0x89dc('0x24'));_0x1aeaa3(_0x574696[_0x89dc('0x29')]['message']);}})[_0x89dc('0x2a')](function(_0x42312a){logger[_0x89dc('0x26')](_0x89dc('0x21'),_0x276709,_0x42312a);_0x13731b(_0x42312a);});});}function saveUpdates(_0x299976){return function(_0x4c5598){if(_0x4c5598){return _0x4c5598[_0x89dc('0x2b')](_0x299976)[_0x89dc('0x1f')](function(_0x337aff){if(_0x337aff[_0x89dc('0x2c')]==='agent'){socket[_0x89dc('0x2d')](_0x89dc('0x2e')+_0x337aff['id'],_0x337aff);}return _0x337aff;});}return null;};}function removeEntity(_0xbc4fba,_0x1b62ce){return function(_0x5bb76e){if(_0x5bb76e){return _0x5bb76e[_0x89dc('0x2f')]({'transaction':_0x1b62ce})[_0x89dc('0x1f')](function(){var _0xd78ffd=_0x5bb76e[_0x89dc('0x30')]({'plain':!![]});if(_0xd78ffd[_0x89dc('0x2c')]==='admin')return;var _0x3110a1=[{'name':_0x89dc('0x31'),'value':'user','ignore':!![]},{'name':_0x89dc('0x32'),'value':_0x89dc('0x33'),'ignore':![]},{'name':_0x89dc('0x34'),'value':'telephone','ignore':![]}];var _0x129311=_(_0x3110a1)[_0x89dc('0x35')]('ignore')[_0x89dc('0x36')](_0x89dc('0x37'))[_0x89dc('0x37')]();if(_[_0x89dc('0x38')](_0x129311,_0xd78ffd[_0x89dc('0x2c')])){return;}var _0x245d1f=_[_0x89dc('0x39')](_0x3110a1,[_0x89dc('0x37'),_0xd78ffd[_0x89dc('0x2c')]])[_0x89dc('0x3a')];return db[_0x89dc('0x3b')][_0x89dc('0x2f')]({'where':{'type':_0x245d1f,'resourceId':_0xd78ffd['id']},'transaction':_0x1b62ce})[_0x89dc('0x1f')](function(){return _0x5bb76e;});})[_0x89dc('0x1f')](function(){_0xbc4fba[_0x89dc('0x16')](0xcc)[_0x89dc('0x3c')]();});}};}function handleEntityNotFound(_0x1ce94c){return function(_0x326857){if(!_0x326857){_0x1ce94c[_0x89dc('0x15')](0x194);}return _0x326857;};}function handleError(_0x28723f,_0x46484e){_0x46484e=_0x46484e||0x1f4;return function(_0x504a10){logger[_0x89dc('0x26')](_0x504a10['stack']);if(_0x504a10[_0x89dc('0x3a')]){delete _0x504a10[_0x89dc('0x3a')];}_0x28723f[_0x89dc('0x16')](_0x46484e)[_0x89dc('0x3d')](_0x504a10);};}function getUserAttributes(){return _(db['User']['rawAttributes'])[_0x89dc('0x36')](function(_0x408fe1){return{'name':_0x408fe1[_0x89dc('0x3e')],'type':_0x408fe1['type'][_0x89dc('0x3f')]};})['filter'](function(_0x1a81cc){return![_0x89dc('0x40'),'salt',_0x89dc('0x41'),_0x89dc('0x42'),_0x89dc('0x43'),_0x89dc('0x44')][_0x89dc('0x38')](_0x1a81cc[_0x89dc('0x3a')]);})[_0x89dc('0x37')]();}exports[_0x89dc('0x45')]=function(_0x31d1a7,_0x164431){var _0x4d3919={},_0xdfe279={'count':0x0,'rows':[]};var _0x1c412f=getUserAttributes();_0x4d3919=qs[_0x89dc('0x46')](_0x1c412f,_0x31d1a7);var _0x28789a={'where':_0x4d3919[_0x89dc('0x47')]};return db[_0x89dc('0x48')][_0x89dc('0x18')](_0x28789a)[_0x89dc('0x1f')](function(_0x1ec80c){_0xdfe279[_0x89dc('0x18')]=_0x1ec80c;if(_0x31d1a7[_0x89dc('0x49')][_0x89dc('0x4a')]){_0x4d3919[_0x89dc('0x4b')]=[{'all':!![]}];}if(_0x31d1a7[_0x89dc('0x49')][_0x89dc('0x4c')]===_0x89dc('0x4d')){_0x4d3919[_0x89dc('0x4b')]=[{'model':db[_0x89dc('0x4e')],'as':'userSetting'}];}if(!_[_0x89dc('0x38')](_0x4d3919[_0x89dc('0x4f')],'id')){_0x4d3919[_0x89dc('0x4f')]['push']('id');}return db[_0x89dc('0x48')]['findAll'](_0x4d3919);})[_0x89dc('0x1f')](function(_0x511b03){_0xdfe279[_0x89dc('0x50')]=_0x511b03;if(_0x31d1a7[_0x89dc('0x49')][_0x89dc('0x51')]===_0x89dc('0x4d')){var _0x1c35c5=[];for(var _0x453778=0x0;_0x453778<_0xdfe279[_0x89dc('0x50')][_0x89dc('0x52')];_0x453778++){_0x1c35c5[_0x89dc('0x53')](get_open_tabs(_0x89dc('0x54'),_0xdfe279['rows'][_0x453778][_0x89dc('0x55')]));_0x1c35c5[_0x89dc('0x53')](get_open_tabs('sms',_0xdfe279[_0x89dc('0x50')][_0x453778][_0x89dc('0x55')]));_0x1c35c5['push'](get_open_tabs(_0x89dc('0x56'),_0xdfe279[_0x89dc('0x50')][_0x453778]['dataValues']));_0x1c35c5[_0x89dc('0x53')](get_open_tabs(_0x89dc('0x57'),_0xdfe279[_0x89dc('0x50')][_0x453778][_0x89dc('0x55')]));_0x1c35c5[_0x89dc('0x53')](get_open_tabs(_0x89dc('0x58'),_0xdfe279[_0x89dc('0x50')][_0x453778][_0x89dc('0x55')]));_0x1c35c5[_0x89dc('0x53')](get_open_tabs(_0x89dc('0x59'),_0xdfe279[_0x89dc('0x50')][_0x453778][_0x89dc('0x55')]));}return Promise[_0x89dc('0x5a')](_0x1c35c5)['then'](function(){return _0xdfe279;});}else{return _0xdfe279;}})['then'](respondWithFilteredResult(_0x164431,_0x4d3919))['catch'](handleError(_0x164431,null));};exports[_0x89dc('0x5b')]=function(_0x37eb2f,_0x5c837d){var _0x946813=getUserAttributes();_0x37eb2f[_0x89dc('0x49')]['id']=_0x37eb2f[_0x89dc('0x5c')]['id'];var _0x548b28=qs['getOptions'](_0x946813,_0x37eb2f);if(_0x37eb2f[_0x89dc('0x49')][_0x89dc('0x4a')]){_0x548b28[_0x89dc('0x4b')]=[{'all':!![]}];}if(_0x37eb2f[_0x89dc('0x49')][_0x89dc('0x4c')]===_0x89dc('0x4d')){_0x548b28[_0x89dc('0x4b')]=[{'model':db[_0x89dc('0x4e')],'as':_0x89dc('0x4c')}];}_0x548b28=_[_0x89dc('0x5d')]({},_0x548b28,_0x37eb2f[_0x89dc('0x5e')]);if(!_['includes'](_0x548b28[_0x89dc('0x4f')],'id')){_0x548b28[_0x89dc('0x4f')][_0x89dc('0x53')]('id');}return db[_0x89dc('0x48')][_0x89dc('0x39')](_0x548b28)[_0x89dc('0x1f')](handleEntityNotFound(_0x5c837d,null))[_0x89dc('0x1f')](function(_0xa62071){var _0x13387d=[];values=_0xa62071;if(_0x37eb2f['query'][_0x89dc('0x51')]===_0x89dc('0x4d')){_0x13387d[_0x89dc('0x53')](get_open_tabs(_0x89dc('0x54'),_0xa62071[_0x89dc('0x55')]));_0x13387d[_0x89dc('0x53')](get_open_tabs('sms',_0xa62071['dataValues']));_0x13387d[_0x89dc('0x53')](get_open_tabs(_0x89dc('0x58'),_0xa62071[_0x89dc('0x55')]));_0x13387d[_0x89dc('0x53')](get_open_tabs(_0x89dc('0x59'),_0xa62071['dataValues']));_0x13387d[_0x89dc('0x53')](get_open_tabs(_0x89dc('0x56'),_0xa62071[_0x89dc('0x55')]));_0x13387d[_0x89dc('0x53')](get_open_tabs(_0x89dc('0x57'),_0xa62071[_0x89dc('0x55')]));return Promise['all'](_0x13387d);}else{return values;}})[_0x89dc('0x1f')](function(){return values;})['then'](respondWithResult(_0x5c837d,null))[_0x89dc('0x2a')](handleError(_0x5c837d,null));};exports[_0x89dc('0x2b')]=function(_0x210b1d,_0x21e0e7){if(_0x210b1d[_0x89dc('0x5f')]['id']){delete _0x210b1d[_0x89dc('0x5f')]['id'];}delete _0x210b1d['body'][_0x89dc('0x2c')];return db[_0x89dc('0x48')][_0x89dc('0x39')]({'where':{'id':_0x210b1d[_0x89dc('0x5c')]['id']}})[_0x89dc('0x1f')](handleEntityNotFound(_0x21e0e7,null))[_0x89dc('0x1f')](saveUpdates(_0x210b1d[_0x89dc('0x5f')],null))[_0x89dc('0x1f')](respondWithResult(_0x21e0e7,null))[_0x89dc('0x2a')](handleError(_0x21e0e7,null));};exports[_0x89dc('0x60')]=function(_0xd1b22f,_0x575f68){return db[_0x89dc('0x48')][_0x89dc('0x60')]()[_0x89dc('0x1f')](respondWithResult(_0x575f68,null))[_0x89dc('0x2a')](handleError(_0x575f68,null));};exports[_0x89dc('0x61')]=function(_0x399a1f,_0x3875c4){return db['User'][_0x89dc('0x39')]({'where':{'id':_0x399a1f['params']['id']}})[_0x89dc('0x1f')](handleEntityNotFound(_0x3875c4,null))[_0x89dc('0x1f')](function(_0x3de616){if(_0x3de616){return _0x3de616[_0x89dc('0x61')](_0x399a1f[_0x89dc('0x5f')][_0x89dc('0x62')],_[_0x89dc('0x63')](_0x399a1f[_0x89dc('0x5f')],[_0x89dc('0x62'),'id'])||{});}})[_0x89dc('0x1f')](respondWithResult(_0x3875c4,null))[_0x89dc('0x2a')](handleError(_0x3875c4,null));};function validateUser(_0x303c3e){return new Promise(function(_0x8971b1,_0x3e65df){if(_0x303c3e[_0x89dc('0x64')])return _0x8971b1(_0x303c3e);return db['Setting'][_0x89dc('0x65')](0x1)[_0x89dc('0x1f')](function(_0x269dc3){if(_0x269dc3[_0x89dc('0x66')])authService[_0x89dc('0x67')](_0x303c3e[_0x89dc('0x40')]);db[_0x89dc('0x48')][_0x89dc('0x68')](_0x89dc('0x64'))[_0x89dc('0x1f')](function(_0x4c560f){if(_[_0x89dc('0x69')](_0x4c560f)){_0x303c3e[_0x89dc('0x64')]=_0x269dc3[_0x89dc('0x6a')]||0x1;return;}if(_[_0x89dc('0x69')](_0x269dc3[_0x89dc('0x6a')])||_0x269dc3[_0x89dc('0x6a')]===_0x4c560f){_0x303c3e[_0x89dc('0x64')]=_0x4c560f+0x1;return;}if(_0x269dc3[_0x89dc('0x6a')]>_0x4c560f){_0x303c3e[_0x89dc('0x64')]=_0x269dc3['min_internal'];return;}return db[_0x89dc('0x6b')][_0x89dc('0x49')](_0x89dc('0x6c'),{'type':db[_0x89dc('0x6b')][_0x89dc('0x6d')][_0x89dc('0x6e')]})[_0x89dc('0x1f')](function(_0xedbfd1){if(_0xedbfd1&&_0xedbfd1[_0x89dc('0x52')]){for(var _0x56044c=0x0,_0x4ef3bb=_0xedbfd1[_0x89dc('0x52')];_0x56044c<_0x4ef3bb&&_[_0x89dc('0x69')](_0x303c3e[_0x89dc('0x64')]);_0x56044c++){if(_0x269dc3['min_internal']<=_0xedbfd1[_0x56044c][_0x89dc('0x6f')]){_0x303c3e[_0x89dc('0x64')]=_0xedbfd1[_0x56044c][_0x89dc('0x6f')];}else if(_0x269dc3['min_internal']>_0xedbfd1[_0x56044c][_0x89dc('0x6f')]&&_0x269dc3[_0x89dc('0x6a')]<=_0xedbfd1[_0x56044c]['to']){_0x303c3e[_0x89dc('0x64')]=_0x269dc3[_0x89dc('0x6a')];}}}if(_[_0x89dc('0x69')](_0x303c3e[_0x89dc('0x64')])){_0x303c3e['internal']=_0x4c560f+0x1;}return _0x8971b1(_0x303c3e);});});})[_0x89dc('0x2a')](function(_0xa0461e){_0x3e65df(_0xa0461e);});});}function updateUser(_0x20ebae){return new Promise(function(_0x39fd5f,_0x104773){try{if(_0x20ebae[_0x89dc('0x70')]){_0x20ebae[_0x89dc('0x71')]=_0x20ebae[_0x89dc('0x64')];_0x20ebae[_0x89dc('0x72')]={'mailbox':_0x20ebae[_0x89dc('0x64')],'password':_0x20ebae[_0x89dc('0x40')],'fullname':_0x20ebae[_0x89dc('0x73')],'email':_0x20ebae[_0x89dc('0x74')]};}if(_0x20ebae[_0x89dc('0x2c')]==='agent'){if(!_0x20ebae[_0x89dc('0x75')])_0x20ebae[_0x89dc('0x75')]=['101',_0x89dc('0x76'),_0x89dc('0x77'),_0x89dc('0x78'),_0x89dc('0x79'),_0x89dc('0x7a'),_0x89dc('0x7b'),_0x89dc('0x7c'),_0x89dc('0x7d'),'108','109',_0x89dc('0x7e'),_0x89dc('0x7f'),_0x89dc('0x80'),_0x89dc('0x81')];}_0x39fd5f(_0x20ebae);}catch(_0x4789e0){_0x104773(_0x4789e0);}});}exports['create']=function(_0xfd24dc,_0x2b3ba6){if(_0xfd24dc['user']['role']===_0x89dc('0x33'))throw new Error(_0x89dc('0x82'));if(_0xfd24dc[_0x89dc('0x5f')][_0x89dc('0x2c')]===_0x89dc('0x83')&&_0xfd24dc['user'][_0x89dc('0x2c')]!==_0x89dc('0x84')){throw new Error(_0x89dc('0x85'));}if(_0xfd24dc[_0x89dc('0x5f')]['role']===_0x89dc('0x84')&&_0xfd24dc['user']['role']!==_0x89dc('0x84')){throw new Error(_0x89dc('0x86'));}return licenseUtil[_0x89dc('0x87')]([_0xfd24dc[_0x89dc('0x5f')]])[_0x89dc('0x1f')](function(){return validateUser(_0xfd24dc[_0x89dc('0x5f')]);})[_0x89dc('0x1f')](function(_0x438f0f){return updateUser(_0x438f0f)[_0x89dc('0x1f')](function(_0x2b29d2){if(_0x2b29d2[_0x89dc('0x2c')]===_0x89dc('0x84')){_0x2b29d2['settingsEnabled']=_0xfd24dc[_0x89dc('0x83')][_0x89dc('0x88')];delete _0x2b29d2[_0x89dc('0x89')];}return _0x2b29d2;});})[_0x89dc('0x1f')](function(_0x369b2b){return db[_0x89dc('0x48')]['create'](_0x369b2b,{'include':[{'model':db[_0x89dc('0x72')],'as':_0x89dc('0x72')}]});})[_0x89dc('0x1f')](function(_0x5bc671){if(_0xfd24dc[_0x89dc('0x5f')]['role']===_0x89dc('0x83'))return _0x5bc671;if(_0xfd24dc['user'][_0x89dc('0x2c')]!==_0x89dc('0x83'))return _0x5bc671;return db[_0x89dc('0x8a')][_0x89dc('0x39')]({'where':{'name':_0x5bc671[_0x89dc('0x2c')]===_0x89dc('0x33')?_0x89dc('0x32'):_0x89dc('0x34'),'userProfileId':_0xfd24dc[_0x89dc('0x83')]['userProfileId']},'raw':!![]})[_0x89dc('0x1f')](function(_0x20b6c7){if(!_0x20b6c7||_0x20b6c7[_0x89dc('0x8b')]!=0x0)return _0x5bc671;return db['UserProfileResource']['create']({'name':_0x5bc671[_0x89dc('0x3a')],'resourceId':_0x5bc671['id'],'type':_0x20b6c7['name'],'sectionId':_0x20b6c7['id']},{})[_0x89dc('0x1f')](function(){return _0x5bc671;});})[_0x89dc('0x2a')](function(_0x8cda02){logger[_0x89dc('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8cda02);throw _0x8cda02;});})[_0x89dc('0x1f')](respondWithResult(_0x2b3ba6,0xc9))[_0x89dc('0x2a')](handleError(_0x2b3ba6,null));};exports[_0x89dc('0x8c')]=function(_0x566559,_0x273dfc){var _0x2b64c3=_0x566559['body'];var _0x323800=[];if(_0x566559[_0x89dc('0x83')][_0x89dc('0x2c')]===_0x89dc('0x33'))throw new Error(_0x89dc('0x82'));if(_[_0x89dc('0x8d')](_0x2b64c3,['role',_0x89dc('0x83')])&&_0x566559[_0x89dc('0x83')][_0x89dc('0x2c')]!=='admin'){throw new Error(_0x89dc('0x85'));}if(_[_0x89dc('0x8d')](_0x2b64c3,['role',_0x89dc('0x84')])&&_0x566559[_0x89dc('0x83')][_0x89dc('0x2c')]!==_0x89dc('0x84')){throw new Error(_0x89dc('0x8e'));}return licenseUtil[_0x89dc('0x87')](_0x2b64c3)[_0x89dc('0x1f')](function(){return validateUser(_0x2b64c3[0x0]);})[_0x89dc('0x1f')](function(){for(var _0x124f32=0x1;_0x124f32<_0x2b64c3[_0x89dc('0x52')];_0x124f32++){var _0xbf19a0=_0x2b64c3[_0x124f32-0x1][_0x89dc('0x64')];if(!_0x2b64c3[_0x124f32][_0x89dc('0x64')])_0x2b64c3[_0x124f32][_0x89dc('0x64')]=_0xbf19a0+0x1;_0x323800['push'](validateUser(_0x2b64c3[_0x124f32]));}return Promise[_0x89dc('0x5a')](_0x323800);})[_0x89dc('0x1f')](function(){_0x323800=[];for(var _0x2d1352=0x0;_0x2d1352<_0x2b64c3['length'];_0x2d1352++){_0x323800[_0x89dc('0x53')](updateUser(_0x2b64c3[_0x2d1352]));}return Promise[_0x89dc('0x5a')](_0x323800);})['then'](function(){_0x323800=_0x2b64c3[_0x89dc('0x36')](function(_0x39bc51){return db[_0x89dc('0x48')][_0x89dc('0x8f')](_0x39bc51,{'include':[{'model':db[_0x89dc('0x72')],'as':_0x89dc('0x72')}]})[_0x89dc('0x1f')](function(_0x36e984){_0x39bc51['id']=_0x36e984['id'];return _0x39bc51;});});return Promise[_0x89dc('0x5a')](_0x323800);})[_0x89dc('0x1f')](function(_0x5b0df7){if(_0x566559[_0x89dc('0x5f')][_0x89dc('0x2c')]===_0x89dc('0x83'))return _0x5b0df7;if(_0x566559[_0x89dc('0x83')][_0x89dc('0x2c')]!=='user')return _0x5b0df7;var _0x5c5590=_[_0x89dc('0x8d')](_0x5b0df7,function(_0x48bd73){return _0x48bd73[_0x89dc('0x2c')]===_0x89dc('0x33')||_0x48bd73[_0x89dc('0x2c')]===_0x89dc('0x90');});if(!_0x5c5590)return _0x5b0df7;return db[_0x89dc('0x8a')][_0x89dc('0x91')]({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x566559[_0x89dc('0x83')][_0x89dc('0x89')]},'raw':!![]})['then'](function(_0x34b56b){if(_[_0x89dc('0x92')](_0x34b56b)||!_[_0x89dc('0x8d')](_0x34b56b,[_0x89dc('0x8b'),0x0]))return _0x5b0df7;_0x323800=[];var _0x160547=_(_0x34b56b)[_0x89dc('0x36')](function(_0x14845b){if(_0x14845b[_0x89dc('0x8b')]===0x1)return;return _0x14845b['name']===_0x89dc('0x32')?_0x89dc('0x33'):'telephone';})['compact']()[_0x89dc('0x37')]();for(var _0x172d83=0x0;_0x172d83<_0x5b0df7[_0x89dc('0x52')];_0x172d83++){if(!_[_0x89dc('0x38')](_0x160547,_0x5b0df7[_0x172d83]['role']))return;var _0x4342dd=_0x5b0df7[_0x172d83][_0x89dc('0x2c')]==='agent'?_0x89dc('0x32'):_0x89dc('0x34');_0x323800[_0x89dc('0x53')](db['UserProfileResource'][_0x89dc('0x8f')]({'name':_0x5b0df7[_0x172d83][_0x89dc('0x3a')],'resourceId':_0x5b0df7[_0x172d83]['id'],'type':_0x4342dd,'sectionId':_[_0x89dc('0x39')](_0x34b56b,[_0x89dc('0x3a'),_0x4342dd])['id']},{}));}return Promise['all'](_0x323800);});})[_0x89dc('0x1f')](respondWithResult(_0x273dfc,0xc9))['catch'](handleError(_0x273dfc,null));};exports[_0x89dc('0x93')]=function(_0x5ddba1,_0x3e0200){if(_0x5ddba1[_0x89dc('0x5f')]['id']){delete _0x5ddba1[_0x89dc('0x5f')]['id'];}return db[_0x89dc('0x48')][_0x89dc('0x39')]({'where':{'id':_0x5ddba1['params']['id']}})['then'](function(_0x49ad88){if(!_0x49ad88)return null;if(_0x49ad88['id']===_0x5ddba1[_0x89dc('0x83')]['id']){if(!_0x5ddba1[_0x89dc('0x5f')]['oldPassword']||!_0x5ddba1['body'][_0x89dc('0x94')]){throw new db[(_0x89dc('0x95'))][(_0x89dc('0x96'))](_0x89dc('0x97'));}if(!_0x49ad88[_0x89dc('0x98')](_0x5ddba1[_0x89dc('0x5f')][_0x89dc('0x99')])){throw new db[(_0x89dc('0x95'))][(_0x89dc('0x96'))]('Wrong\x20credentials');}if(_0x5ddba1[_0x89dc('0x5f')]['oldPassword']===_0x5ddba1[_0x89dc('0x5f')][_0x89dc('0x94')]){throw new db['Sequelize']['ValidationError'](_0x89dc('0x9a'));}}else if(_0x5ddba1[_0x89dc('0x83')][_0x89dc('0x2c')]===_0x89dc('0x84')){if(!_0x5ddba1[_0x89dc('0x5f')][_0x89dc('0x94')]){throw new db[(_0x89dc('0x95'))][(_0x89dc('0x96'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x5ddba1['user'][_0x89dc('0x2c')]===_0x89dc('0x83')){if(!_0x5ddba1['body'][_0x89dc('0x94')]){throw new db[(_0x89dc('0x95'))][(_0x89dc('0x96'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x49ad88['role']!==_0x89dc('0x33')){throw new db[(_0x89dc('0x95'))][(_0x89dc('0x96'))]('Unauthorized');}}else{throw new db[(_0x89dc('0x95'))][(_0x89dc('0x96'))](_0x89dc('0x82'));}return _0x49ad88;})[_0x89dc('0x1f')](handleEntityNotFound(_0x3e0200,null))[_0x89dc('0x1f')](function(_0x2b85d3){return db[_0x89dc('0x9b')]['findOne']({'attributes':['id','securePassword',_0x89dc('0x9c'),_0x89dc('0x9d')]})[_0x89dc('0x1f')](function(_0x858470){if(_0x858470['securePassword'])authService[_0x89dc('0x67')](_0x5ddba1['body'][_0x89dc('0x94')]);if(!_0x858470[_0x89dc('0x9c')]||!_0x2b85d3[_0x89dc('0x41')])return _0x2b85d3;authService[_0x89dc('0x9e')](_0x5ddba1[_0x89dc('0x5f')]['newPassword'],_0x2b85d3[_0x89dc('0x41')],_0x858470[_0x89dc('0x9d')]);return _0x2b85d3;})[_0x89dc('0x1f')](saveUpdates({'password':_0x5ddba1[_0x89dc('0x5f')][_0x89dc('0x94')],'passwordResetAt':_0x5ddba1[_0x89dc('0x83')]['id']==_0x5ddba1[_0x89dc('0x5c')]['id']?moment():null,'previousPasswords':authService[_0x89dc('0x9f')](_0x5ddba1[_0x89dc('0x5f')]['newPassword'],_0x2b85d3[_0x89dc('0x41')])},null));})['then'](respondWithResult(_0x3e0200,null))['catch'](handleError(_0x3e0200,null));};exports[_0x89dc('0xa0')]=function(_0x3d4277,_0x2c76ea){var _0xce88d1=_0x3d4277[_0x89dc('0x5f')][_0x89dc('0xa1')];return db[_0x89dc('0x48')][_0x89dc('0x39')]({'where':{'id':_0x3d4277[_0x89dc('0x5c')]['id']},'attributes':['id',_0x89dc('0x3a'),_0x89dc('0x2c'),_0x89dc('0xa2'),_0x89dc('0xa3'),'voicePause',_0x89dc('0xa4')]})[_0x89dc('0x1f')](handleEntityNotFound(_0x2c76ea,null))[_0x89dc('0x1f')](function(_0x4c8f02){if(_0x4c8f02){if(!utils[_0x89dc('0xa5')](_0xce88d1)){throw new db[(_0x89dc('0x95'))][(_0x89dc('0x96'))](_0x89dc('0xa6'));}return _0x4c8f02[_0x89dc('0xa7')+_[_0x89dc('0xa8')](_0xce88d1['toLowerCase']())+'Queues'](_0x3d4277[_0x89dc('0x5f')][_0x89dc('0x62')],{'penalty':_0x3d4277['body'][_0x89dc('0xa9')]||0x0})[_0x89dc('0xaa')](function(_0x11b41a){for(var _0xd223d6=0x0;_0xd223d6<_0x3d4277['body'][_0x89dc('0x62')][_0x89dc('0x52')];_0xd223d6+=0x1){var _0xb6aae1={'UserId':Number(_0x3d4277[_0x89dc('0x5c')]['id'])};_0xb6aae1[_[_0x89dc('0xa8')](_0xce88d1['toLowerCase']())+_0x89dc('0xab')]=Number(_0x3d4277['body'][_0x89dc('0x62')][_0xd223d6]);socket[_0x89dc('0x2d')](_0x89dc('0x83')+_['capitalize'](_0xce88d1[_0x89dc('0xac')]())+_0x89dc('0xad'),_0xb6aae1);}return _0x11b41a;})[_0x89dc('0x1f')](function(){if(_0xce88d1===_0x89dc('0xae')){return db[_0x89dc('0xaf')][_0x89dc('0x91')]({'where':{'id':_0x3d4277[_0x89dc('0x5f')][_0x89dc('0x62')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x89dc('0x1f')](function(_0x11876b){var _0x5dd6ad=_0x4c8f02[_0x89dc('0x30')]({'plain':!![]});var _0x3de636=[];if(_0xce88d1===_0x89dc('0xae')&&_0x5dd6ad[_0x89dc('0x2c')]===_0x89dc('0x33')&&_0x5dd6ad[_0x89dc('0xa2')]){for(let _0x2dc7eb=0x0;_0x2dc7eb<_0x11876b[_0x89dc('0x52')];_0x2dc7eb+=0x1){_0x3de636[_0x89dc('0x53')]({'membername':_0x5dd6ad['name'],'UserId':_0x5dd6ad['id'],'queue_name':_0x11876b[_0x2dc7eb][_0x89dc('0x3a')],'VoiceQueueId':_0x11876b[_0x2dc7eb]['id'],'interface':_['isNil'](_0x5dd6ad[_0x89dc('0xa4')])?util[_0x89dc('0xb0')](_0x89dc('0xb1'),_0x5dd6ad['name']):_0x5dd6ad[_0x89dc('0xa4')],'paused':_0x5dd6ad[_0x89dc('0xb2')]||![],'penalty':_0x3d4277[_0x89dc('0x5f')][_0x89dc('0xa9')]||0x0});}return Promise[_0x89dc('0x5a')](_0x3de636[_0x89dc('0x36')](function(_0x103d4c){return db[_0x89dc('0xb3')][_0x89dc('0xb4')](_0x103d4c);}));}return _0x4c8f02;});}})[_0x89dc('0x1f')](respondWithStatusCode(_0x2c76ea,null))[_0x89dc('0x2a')](handleError(_0x2c76ea,null));};exports[_0x89dc('0xb5')]=function(_0x1afac1,_0x3440df){var _0xab391a,_0x422ee0;return db['User'][_0x89dc('0x39')]({'where':{'id':_0x1afac1[_0x89dc('0x5c')]['id']},'attributes':['id',_0x89dc('0x3a'),'role']})['then'](handleEntityNotFound(_0x3440df,null))[_0x89dc('0x1f')](function(_0x543f57){if(_0x543f57){_0xab391a=_0x543f57;if(!_0x1afac1['query']['channel']||!utils[_0x89dc('0xa5')](_0x1afac1[_0x89dc('0x49')][_0x89dc('0xa1')])){throw new db[(_0x89dc('0x95'))]['ValidationError']('Unknown\x20channel');}return _0x543f57[_0x89dc('0xb6')+_[_0x89dc('0xa8')](_0x1afac1[_0x89dc('0x49')][_0x89dc('0xa1')][_0x89dc('0xac')]())+_0x89dc('0xb7')](_0x1afac1[_0x89dc('0x49')][_0x89dc('0x62')]);}})['then'](function(_0x2ec2b7){if(_['isArray'](_0x1afac1['query'][_0x89dc('0x62')])){for(var _0x11a039=0x0;_0x11a039<_0x1afac1[_0x89dc('0x49')][_0x89dc('0x62')]['length'];_0x11a039+=0x1){_0x422ee0={'UserId':Number(_0x1afac1['params']['id'])};_0x422ee0[_['capitalize'](_0x1afac1[_0x89dc('0x49')][_0x89dc('0xa1')]['toLowerCase']())+_0x89dc('0xab')]=Number(_0x1afac1['query']['ids'][_0x11a039]);socket[_0x89dc('0x2d')](_0x89dc('0x83')+_['capitalize'](_0x1afac1['query']['channel']['toLowerCase']())+_0x89dc('0xb8'),_0x422ee0);}}else{_0x422ee0={'UserId':Number(_0x1afac1[_0x89dc('0x5c')]['id'])};_0x422ee0[_[_0x89dc('0xa8')](_0x1afac1['query'][_0x89dc('0xa1')][_0x89dc('0xac')]())+_0x89dc('0xab')]=Number(_0x1afac1[_0x89dc('0x49')][_0x89dc('0x62')]);socket[_0x89dc('0x2d')](_0x89dc('0x83')+_[_0x89dc('0xa8')](_0x1afac1[_0x89dc('0x49')][_0x89dc('0xa1')][_0x89dc('0xac')]())+_0x89dc('0xb8'),_0x422ee0);}return _0x2ec2b7;})[_0x89dc('0x1f')](function(){if(_0x1afac1['query'][_0x89dc('0xa1')]===_0x89dc('0xae')){return db[_0x89dc('0xb3')][_0x89dc('0x2f')]({'where':{'UserId':_0x1afac1['params']['id'],'VoiceQueueId':_0x1afac1[_0x89dc('0x49')][_0x89dc('0x62')]},'individualHooks':!![]})[_0x89dc('0x1f')](function(){return _0xab391a;});}return _0xab391a;})[_0x89dc('0x1f')](respondWithStatusCode(_0x3440df,null))[_0x89dc('0x2a')](handleError(_0x3440df,null));};exports[_0x89dc('0xb9')]=function(_0x5a875d,_0x1f3d0b){_0x5a875d[_0x89dc('0x5f')][_0x89dc('0xba')]=_0x5a875d[_0x89dc('0xbb')][_0x89dc('0xbc')];return db['User'][_0x89dc('0x39')]({'where':{'id':_0x5a875d[_0x89dc('0x5c')]['id']}})[_0x89dc('0x1f')](handleEntityNotFound(_0x1f3d0b,null))[_0x89dc('0x1f')](saveUpdates(_0x5a875d[_0x89dc('0x5f')],null))[_0x89dc('0x1f')](respondWithResult(_0x1f3d0b,null))[_0x89dc('0x2a')](handleError(_0x1f3d0b,null));};exports[_0x89dc('0xbd')]=function(_0x1c7dce,_0x3defda){var _0x575d17=path['join'](config[_0x89dc('0xbe')],_0x89dc('0xbf'));return db[_0x89dc('0x48')]['find']({'where':{'id':_0x1c7dce[_0x89dc('0x5c')]['id']},'attributes':['id',_0x89dc('0xba')],'raw':!![]})[_0x89dc('0x1f')](handleEntityNotFound(_0x3defda,null))['then'](function(_0x10e04f){if(_0x10e04f){if(_[_0x89dc('0x69')](_0x10e04f['userpic'])){return _0x3defda[_0x89dc('0xc0')](_0x575d17);}else{if(!fs[_0x89dc('0xc1')](path[_0x89dc('0xc2')](config[_0x89dc('0xbe')],'server/files/images/',_0x10e04f['userpic']))){return _0x3defda[_0x89dc('0xc0')](_0x575d17);}return _0x3defda[_0x89dc('0xc0')](path['join'](config[_0x89dc('0xbe')],'server/files/images/',_0x10e04f['userpic']));}}})[_0x89dc('0x2a')](handleError(_0x3defda,null));};exports['getOpenTabs']=function(_0x3c9ab3,_0x1cbcc4){return db[_0x89dc('0x48')]['find']({'where':{'id':_0x3c9ab3[_0x89dc('0x5c')]['id']},'attributes':['id']})[_0x89dc('0x1f')](handleEntityNotFound(_0x1cbcc4,null))[_0x89dc('0x1f')](function(_0xa7830e){var _0x126402=[];values=_0xa7830e[_0x89dc('0x55')];_0x126402['push'](get_open_tabs(_0x89dc('0x54'),_0xa7830e['dataValues']));_0x126402['push'](get_open_tabs(_0x89dc('0xc3'),_0xa7830e[_0x89dc('0x55')]));_0x126402[_0x89dc('0x53')](get_open_tabs(_0x89dc('0x58'),_0xa7830e[_0x89dc('0x55')]));_0x126402[_0x89dc('0x53')](get_open_tabs('whatsapp',_0xa7830e[_0x89dc('0x55')]));_0x126402[_0x89dc('0x53')](get_open_tabs(_0x89dc('0x56'),_0xa7830e[_0x89dc('0x55')]));_0x126402[_0x89dc('0x53')](get_open_tabs('mail',_0xa7830e['dataValues']));return Promise[_0x89dc('0x5a')](_0x126402);})[_0x89dc('0x1f')](function(_0x96a5f6){if(_0x96a5f6){var _0x4e360=_[_0x89dc('0x36')](values[_0x89dc('0xc4')],function(_0xe9343a){return{'channel':_0x89dc('0xc5'),'id':_0xe9343a['id'],'createdAt':_0xe9343a[_0x89dc('0xc6')]};});var _0x76f517=_[_0x89dc('0x36')](values[_0x89dc('0xc7')],function(_0x31353c){return{'channel':'FAX','id':_0x31353c['id'],'createdAt':_0x31353c[_0x89dc('0xc6')]};});var _0x4f5848=_[_0x89dc('0x36')](values[_0x89dc('0xc8')],function(_0x29c211){return{'channel':_0x89dc('0xc9'),'id':_0x29c211['id'],'createdAt':_0x29c211[_0x89dc('0xc6')]};});var _0xa95337=_['map'](values[_0x89dc('0xca')],function(_0x394049){return{'channel':'MAIL','id':_0x394049['id'],'createdAt':_0x394049[_0x89dc('0xc6')]};});var _0x19a9e2=_[_0x89dc('0x36')](values[_0x89dc('0xcb')],function(_0x5f12f6){return{'channel':_0x89dc('0xcc'),'id':_0x5f12f6['id'],'createdAt':_0x5f12f6['createdAt']};});var _0x212812=_[_0x89dc('0x36')](values[_0x89dc('0xcd')],function(_0x55c9b2){return{'channel':_0x89dc('0xce'),'id':_0x55c9b2['id'],'createdAt':_0x55c9b2[_0x89dc('0xc6')]};});var _0x5ecc3c=_[_0x89dc('0xcf')](_0x4e360,_0x76f517,_0x4f5848,_0xa95337,_0x19a9e2,_0x212812);var _0x42dca8={'count':_0x5ecc3c['length'],'rows':_0x5ecc3c};return _0x42dca8;}else return null;})[_0x89dc('0x1f')](respondWithResult(_0x1cbcc4,null))['catch'](handleError(_0x1cbcc4,null));};exports[_0x89dc('0xd0')]=function(_0x96d255,_0x5f51eb){var _0x558aa2={};return db[_0x89dc('0x48')][_0x89dc('0xd1')]({'where':{'id':_0x96d255[_0x89dc('0x5c')]['id']}})[_0x89dc('0x1f')](function(_0x187656){if(!_0x187656){throw new APINotFoundError(util[_0x89dc('0xb0')](_0x89dc('0xd2'),_0x96d255['params']['id']));}return contacts['describe']();})[_0x89dc('0x1f')](function(_0x3bccc5){_0x96d255['query']['User']=_0x96d255[_0x89dc('0x5c')]['id'];_0x558aa2=qs[_0x89dc('0x46')](_0x3bccc5,_0x96d255);if(_0x96d255[_0x89dc('0x49')][_0x89dc('0xd3')]('includeAll')){_0x558aa2['include']=[{'model':db[_0x89dc('0xd4')],'as':'List','required':![]},{'model':db['Tag'],'as':_0x89dc('0xd5'),'attributes':['id',_0x89dc('0x3a'),_0x89dc('0xd6')],'where':_0x96d255['query']['tag']?{'id':_0x96d255[_0x89dc('0x49')][_0x89dc('0xd7')]}:undefined,'required':_0x96d255['query']['tag']?!![]:![]}];}return contacts[_0x89dc('0x91')](_0x96d255[_0x89dc('0x49')],_0x96d255[_0x89dc('0x83')],_0x558aa2,_0x3bccc5);})[_0x89dc('0x1f')](respondWithFilteredResult(_0x5f51eb,_0x558aa2))[_0x89dc('0x2a')](APIHandleError(_0x5f51eb));};exports[_0x89dc('0xd8')]=function(_0xbe14fd,_0x186d53){var _0x148e15;var _0x20ba5e={};var _0x2e93bd;return db[_0x89dc('0x48')]['findOne']({'where':{'id':_0xbe14fd[_0x89dc('0x5c')]['id']},'attributes':['id',_0x89dc('0x3a'),_0x89dc('0x2c')]})[_0x89dc('0x1f')](handleEntityNotFound(_0x186d53,null))['then'](function(_0x18e17f){if(!utils[_0x89dc('0xa5')](_0xbe14fd[_0x89dc('0x49')]['channel'])){throw new db['Sequelize'][(_0x89dc('0x96'))](_0x89dc('0xa6'));}_0x148e15=_0x18e17f;var _0x14294a={};_0x14294a[_0x89dc('0xd9')]=_[_0x89dc('0xda')](db[_[_0x89dc('0xa8')](_0xbe14fd[_0x89dc('0x49')][_0x89dc('0xa1')])+_0x89dc('0xdb')][_0x89dc('0xdc')]);_0x14294a['query']=_['keys'](_0xbe14fd[_0x89dc('0x49')]);_0x14294a['filters']=_[_0x89dc('0xdd')](_0x14294a[_0x89dc('0xd9')],_0x14294a[_0x89dc('0x49')]);_0x20ba5e['attributes']=_['intersection'](_0x14294a['model'],qs['fields'](_0xbe14fd[_0x89dc('0x49')]['fields']));_0x20ba5e[_0x89dc('0x4f')]=_0x20ba5e['attributes'][_0x89dc('0x52')]?_0x20ba5e[_0x89dc('0x4f')]:_0x14294a[_0x89dc('0xd9')];_0x20ba5e[_0x89dc('0xde')]=qs[_0x89dc('0xdf')](_0xbe14fd[_0x89dc('0x49')][_0x89dc('0xdf')]);_0x20ba5e[_0x89dc('0x47')]=qs[_0x89dc('0xe0')](_[_0x89dc('0xe1')](_0xbe14fd[_0x89dc('0x49')],_0x14294a['filters']));if(_0xbe14fd['query'][_0x89dc('0x35')]){_0x20ba5e[_0x89dc('0x47')]=_['merge'](_0x20ba5e[_0x89dc('0x47')],{'$or':_[_0x89dc('0x36')](_0x20ba5e[_0x89dc('0x4f')],function(_0xb2a842){var _0x550030={};_0x550030[_0xb2a842]={'$like':'%'+_0xbe14fd[_0x89dc('0x49')]['filter']+'%'};return _0x550030;})});}_0x20ba5e=_[_0x89dc('0x5d')]({},_0x20ba5e,_0xbe14fd[_0x89dc('0x5e')]);switch(_0x148e15['role']){case _0x89dc('0x84'):return db[_[_0x89dc('0xa8')](_0xbe14fd[_0x89dc('0x49')][_0x89dc('0xa1')])+'Queue'][_0x89dc('0x91')](_0x20ba5e);case _0x89dc('0x83'):case _0x89dc('0x33'):return _0x148e15[_0x89dc('0x30')+_['capitalize'](_0xbe14fd['query'][_0x89dc('0xa1')])+_0x89dc('0xb7')](_0x20ba5e);default:throw new db[(_0x89dc('0x95'))][(_0x89dc('0x96'))]('Unknown\x20role');}})[_0x89dc('0x1f')](function(_0x46c9be){_0x2e93bd=_0x46c9be[_0x89dc('0x52')];if(!_0xbe14fd[_0x89dc('0x49')][_0x89dc('0xd3')](_0x89dc('0xe2'))){_0x20ba5e['limit']=qs['limit'](_0xbe14fd['query'][_0x89dc('0x1a')]);_0x20ba5e[_0x89dc('0x19')]=qs[_0x89dc('0x19')](_0xbe14fd['query'][_0x89dc('0x19')]);}switch(_0x148e15['role']){case'admin':return db[_[_0x89dc('0xa8')](_0xbe14fd[_0x89dc('0x49')]['channel'])+_0x89dc('0xdb')][_0x89dc('0x91')](_0x20ba5e);case _0x89dc('0x83'):case _0x89dc('0x33'):return _0x148e15[_0x89dc('0x30')+_[_0x89dc('0xa8')](_0xbe14fd['query'][_0x89dc('0xa1')])+_0x89dc('0xb7')](_0x20ba5e);}})[_0x89dc('0x1f')](function(_0xcd117c){return{'count':_0x2e93bd,'rows':_0xcd117c};})[_0x89dc('0x1f')](respondWithResult(_0x186d53,null))[_0x89dc('0x2a')](handleError(_0x186d53,null));};exports[_0x89dc('0xe3')]=function(_0x3a85cc,_0x1622da){var _0xaa84f6={};var _0x400ec4={};var _0x361d3c;var _0xdf9b21;return db['User'][_0x89dc('0xd1')]({'where':{'id':_0x3a85cc[_0x89dc('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1622da,null))[_0x89dc('0x1f')](function(_0x4095a5){if(_0x4095a5){_0x361d3c=_0x4095a5;_0x400ec4['model']=_[_0x89dc('0xda')](db['UserVoiceQueueRt']['rawAttributes']);_0x400ec4[_0x89dc('0x49')]=_[_0x89dc('0xda')](_0x3a85cc[_0x89dc('0x49')]);_0x400ec4['filters']=_[_0x89dc('0xdd')](_0x400ec4['model'],_0x400ec4['query']);_0xaa84f6[_0x89dc('0x4f')]=_['intersection'](_0x400ec4[_0x89dc('0xd9')],qs[_0x89dc('0xe4')](_0x3a85cc[_0x89dc('0x49')]['fields']));_0xaa84f6[_0x89dc('0x4f')]=_0xaa84f6[_0x89dc('0x4f')]['length']?_0xaa84f6[_0x89dc('0x4f')]:_0x400ec4['model'];_0xaa84f6[_0x89dc('0xde')]=qs[_0x89dc('0xdf')](_0x3a85cc[_0x89dc('0x49')][_0x89dc('0xdf')]);_0xaa84f6[_0x89dc('0x47')]=qs[_0x89dc('0xe0')](_[_0x89dc('0xe1')](_0x3a85cc[_0x89dc('0x49')],_0x400ec4[_0x89dc('0xe0')]));if(_0x3a85cc['query'][_0x89dc('0x35')]){_0xaa84f6[_0x89dc('0x47')]=_[_0x89dc('0x5d')](_0xaa84f6[_0x89dc('0x47')],{'$or':_[_0x89dc('0x36')](_0xaa84f6[_0x89dc('0x4f')],function(_0x31be7a){var _0x3f4974={};_0x3f4974[_0x31be7a]={'$like':'%'+_0x3a85cc[_0x89dc('0x49')][_0x89dc('0x35')]+'%'};return _0x3f4974;})});}_0xaa84f6=_['merge']({},_0xaa84f6,_0x3a85cc['options']);return _0x361d3c['getVoiceQueuesRt'](_0xaa84f6);}})['then'](function(_0x2db045){if(_0x2db045){_0xdf9b21=_0x2db045[_0x89dc('0x52')];if(!_0x3a85cc[_0x89dc('0x49')][_0x89dc('0xd3')](_0x89dc('0xe2'))){_0xaa84f6['limit']=qs[_0x89dc('0x1a')](_0x3a85cc[_0x89dc('0x49')][_0x89dc('0x1a')]);_0xaa84f6[_0x89dc('0x19')]=qs[_0x89dc('0x19')](_0x3a85cc[_0x89dc('0x49')][_0x89dc('0x19')]);}return _0x361d3c[_0x89dc('0xe3')](_0xaa84f6);}})[_0x89dc('0x1f')](function(_0x3d495d){if(_0x3d495d){return _0x3d495d?{'count':_0xdf9b21,'rows':_0x3d495d}:null;}})[_0x89dc('0x1f')](respondWithResult(_0x1622da,null))[_0x89dc('0x2a')](handleError(_0x1622da,null));};exports['getGroups']=function(_0x15b7c2,_0x384a8e){var _0x28f823={};var _0x511812={};var _0x5f0d64;var _0x5a3db6;return db[_0x89dc('0x48')][_0x89dc('0xd1')]({'where':{'id':_0x15b7c2['params']['id']}})['then'](handleEntityNotFound(_0x384a8e,null))[_0x89dc('0x1f')](function(_0x483b0a){if(_0x483b0a){_0x5f0d64=_0x483b0a;_0x511812[_0x89dc('0xd9')]=_[_0x89dc('0xda')](db[_0x89dc('0xe5')][_0x89dc('0xdc')]);_0x511812[_0x89dc('0x49')]=_[_0x89dc('0xda')](_0x15b7c2['query']);_0x511812[_0x89dc('0xe0')]=_[_0x89dc('0xdd')](_0x511812[_0x89dc('0xd9')],_0x511812[_0x89dc('0x49')]);_0x28f823[_0x89dc('0x4f')]=_[_0x89dc('0xdd')](_0x511812[_0x89dc('0xd9')],qs['fields'](_0x15b7c2[_0x89dc('0x49')][_0x89dc('0xe4')]));_0x28f823[_0x89dc('0x4f')]=_0x28f823[_0x89dc('0x4f')]['length']?_0x28f823[_0x89dc('0x4f')]:_0x511812[_0x89dc('0xd9')];_0x28f823['order']=qs[_0x89dc('0xdf')](_0x15b7c2[_0x89dc('0x49')][_0x89dc('0xdf')]);_0x28f823[_0x89dc('0x47')]=qs['filters'](_['pick'](_0x15b7c2[_0x89dc('0x49')],_0x511812[_0x89dc('0xe0')]));if(_0x15b7c2[_0x89dc('0x49')][_0x89dc('0x35')]){_0x28f823[_0x89dc('0x47')]=_['merge'](_0x28f823[_0x89dc('0x47')],{'$or':_['map'](_0x28f823['attributes'],function(_0x23c064){var _0xee05c5={};_0xee05c5[_0x23c064]={'$like':'%'+_0x15b7c2[_0x89dc('0x49')][_0x89dc('0x35')]+'%'};return _0xee05c5;})});}_0x28f823=_[_0x89dc('0x5d')]({},_0x28f823,_0x15b7c2[_0x89dc('0x5e')]);return _0x5f0d64[_0x89dc('0xe6')](_0x28f823);}})['then'](function(_0x7019bc){if(_0x7019bc){_0x5a3db6=_0x7019bc[_0x89dc('0x52')];if(!_0x15b7c2[_0x89dc('0x49')][_0x89dc('0xd3')]('nolimit')){_0x28f823[_0x89dc('0x1a')]=qs[_0x89dc('0x1a')](_0x15b7c2[_0x89dc('0x49')][_0x89dc('0x1a')]);_0x28f823[_0x89dc('0x19')]=qs[_0x89dc('0x19')](_0x15b7c2[_0x89dc('0x49')][_0x89dc('0x19')]);}return _0x5f0d64[_0x89dc('0xe6')](_0x28f823);}})[_0x89dc('0x1f')](function(_0x2061af){if(_0x2061af){return _0x2061af?{'count':_0x5a3db6,'rows':_0x2061af}:null;}})[_0x89dc('0x1f')](respondWithResult(_0x384a8e,null))[_0x89dc('0x2a')](handleError(_0x384a8e,null));};exports['getRecordings']=function(_0x1c5aa1,_0x176d2e){var _0x2c5e1e={'raw':!![],'where':{}};var _0x558692={};var _0x2a1b51={'count':0x0,'rows':[]};return db[_0x89dc('0x48')]['findOne']({'where':{'id':_0x1c5aa1[_0x89dc('0x5c')]['id']}})['then'](handleEntityNotFound(_0x176d2e,null))['then'](function(_0x45b75d){if(_0x45b75d){_0x558692[_0x89dc('0xd9')]=_['keys'](db[_0x89dc('0xe7')][_0x89dc('0xdc')]);_0x558692['query']=_[_0x89dc('0xda')](_0x1c5aa1[_0x89dc('0x49')]);_0x558692[_0x89dc('0xe0')]=_[_0x89dc('0xdd')](_0x558692[_0x89dc('0xd9')],_0x558692[_0x89dc('0x49')]);_0x2c5e1e[_0x89dc('0x4f')]=_[_0x89dc('0xdd')](_0x558692[_0x89dc('0xd9')],qs['fields'](_0x1c5aa1['query'][_0x89dc('0xe4')]));_0x2c5e1e[_0x89dc('0x4f')]=_0x2c5e1e[_0x89dc('0x4f')][_0x89dc('0x52')]?_0x2c5e1e[_0x89dc('0x4f')]:_0x558692[_0x89dc('0xd9')];if(!_0x1c5aa1['query'][_0x89dc('0xd3')](_0x89dc('0xe2'))){_0x2c5e1e[_0x89dc('0x1a')]=qs[_0x89dc('0x1a')](_0x1c5aa1[_0x89dc('0x49')][_0x89dc('0x1a')]);_0x2c5e1e['offset']=qs['offset'](_0x1c5aa1[_0x89dc('0x49')][_0x89dc('0x19')]);}_0x2c5e1e[_0x89dc('0xde')]=qs['sort'](_0x1c5aa1['query'][_0x89dc('0xdf')]);_0x2c5e1e['where']=qs[_0x89dc('0xe0')](_[_0x89dc('0xe1')](_0x1c5aa1[_0x89dc('0x49')],_0x558692[_0x89dc('0xe0')]));_0x2c5e1e[_0x89dc('0x47')][_0x89dc('0xe8')]=_0x45b75d['id'];if(_0x1c5aa1[_0x89dc('0x49')][_0x89dc('0x35')]){_0x2c5e1e[_0x89dc('0x47')]=_[_0x89dc('0x5d')](_0x2c5e1e[_0x89dc('0x47')],{'$or':_[_0x89dc('0x36')](_0x2c5e1e[_0x89dc('0x4f')],function(_0x3aaa97){var _0x84450={};_0x84450[_0x3aaa97]={'$like':'%'+_0x1c5aa1[_0x89dc('0x49')]['filter']+'%'};return _0x84450;})});}_0x2c5e1e=_[_0x89dc('0x5d')]({},_0x2c5e1e,_0x1c5aa1[_0x89dc('0x5e')]);return db['VoiceRecording'][_0x89dc('0x18')]({'where':_0x2c5e1e['where']})['then'](function(_0x4d66d9){_0x2a1b51[_0x89dc('0x18')]=_0x4d66d9;if(_0x1c5aa1[_0x89dc('0x49')][_0x89dc('0x4a')]){_0x2c5e1e['include']=[{'all':!![]}];}return db[_0x89dc('0xe7')][_0x89dc('0x91')](_0x2c5e1e);})[_0x89dc('0x1f')](function(_0x54bafe){_0x2a1b51['rows']=_0x54bafe;return _0x2a1b51;});}})[_0x89dc('0x1f')](respondWithFilteredResult(_0x176d2e,_0x2c5e1e))[_0x89dc('0x2a')](handleError(_0x176d2e,null));};exports[_0x89dc('0xe9')]=function(_0x41b46f,_0x4209ee){var _0x1a6d46={'raw':!![],'where':{}};var _0xf407c5={};var _0x4b248d={'count':0x0,'rows':[]};return db[_0x89dc('0x48')][_0x89dc('0xd1')]({'where':{'id':_0x41b46f['params']['id']}})[_0x89dc('0x1f')](handleEntityNotFound(_0x4209ee,null))['then'](function(_0x1b8512){if(_0x1b8512){_0xf407c5[_0x89dc('0xd9')]=_['keys'](db[_0x89dc('0xea')][_0x89dc('0xdc')]);_0xf407c5[_0x89dc('0x49')]=_[_0x89dc('0xda')](_0x41b46f[_0x89dc('0x49')]);_0xf407c5['filters']=_[_0x89dc('0xdd')](_0xf407c5['model'],_0xf407c5[_0x89dc('0x49')]);_0x1a6d46[_0x89dc('0x4f')]=_[_0x89dc('0xdd')](_0xf407c5['model'],qs['fields'](_0x41b46f[_0x89dc('0x49')]['fields']));_0x1a6d46[_0x89dc('0x4f')]=_0x1a6d46[_0x89dc('0x4f')][_0x89dc('0x52')]?_0x1a6d46[_0x89dc('0x4f')]:_0xf407c5[_0x89dc('0xd9')];if(!_0x41b46f[_0x89dc('0x49')]['hasOwnProperty']('nolimit')){_0x1a6d46[_0x89dc('0x1a')]=qs[_0x89dc('0x1a')](_0x41b46f[_0x89dc('0x49')]['limit']);_0x1a6d46[_0x89dc('0x19')]=qs[_0x89dc('0x19')](_0x41b46f[_0x89dc('0x49')][_0x89dc('0x19')]);}_0x1a6d46[_0x89dc('0xde')]=qs[_0x89dc('0xdf')](_0x41b46f['query'][_0x89dc('0xdf')]);_0x1a6d46[_0x89dc('0x47')]=qs[_0x89dc('0xe0')](_[_0x89dc('0xe1')](_0x41b46f[_0x89dc('0x49')],_0xf407c5[_0x89dc('0xe0')]));_0x1a6d46[_0x89dc('0x47')][_0x89dc('0xe8')]=_0x1b8512['id'];if(_0x41b46f[_0x89dc('0x49')][_0x89dc('0x35')]){_0x1a6d46[_0x89dc('0x47')]=_[_0x89dc('0x5d')](_0x1a6d46[_0x89dc('0x47')],{'$or':_[_0x89dc('0x36')](_0x1a6d46[_0x89dc('0x4f')],function(_0x52238a){var _0x2fb93c={};_0x2fb93c[_0x52238a]={'$like':'%'+_0x41b46f[_0x89dc('0x49')][_0x89dc('0x35')]+'%'};return _0x2fb93c;})});}_0x1a6d46=_[_0x89dc('0x5d')]({},_0x1a6d46,_0x41b46f[_0x89dc('0x5e')]);return db[_0x89dc('0xea')][_0x89dc('0x18')]({'where':_0x1a6d46['where']})['then'](function(_0x53e268){_0x4b248d[_0x89dc('0x18')]=_0x53e268;if(_0x41b46f[_0x89dc('0x49')]['includeAll']){_0x1a6d46[_0x89dc('0x4b')]=[{'all':!![]}];}return db[_0x89dc('0xea')][_0x89dc('0x91')](_0x1a6d46);})[_0x89dc('0x1f')](function(_0x2505ab){_0x4b248d[_0x89dc('0x50')]=_0x2505ab;return _0x4b248d;});}})[_0x89dc('0x1f')](respondWithFilteredResult(_0x4209ee,_0x1a6d46))[_0x89dc('0x2a')](handleError(_0x4209ee,null));};exports[_0x89dc('0xeb')]=function(_0x2985a7,_0x13c686){var _0x22f1c3={};var _0x10512f={};var _0x1b1898;var _0x2e5d83;return db['User']['findOne']({'where':{'id':_0x2985a7['params']['id']}})[_0x89dc('0x1f')](handleEntityNotFound(_0x13c686,null))[_0x89dc('0x1f')](function(_0x34415a){if(_0x34415a){_0x1b1898=_0x34415a;_0x10512f[_0x89dc('0xd9')]=_[_0x89dc('0xda')](db[_0x89dc('0xec')][_0x89dc('0xdc')]);_0x10512f['query']=_[_0x89dc('0xda')](_0x2985a7['query']);_0x10512f[_0x89dc('0xe0')]=_[_0x89dc('0xdd')](_0x10512f['model'],_0x10512f[_0x89dc('0x49')]);_0x22f1c3[_0x89dc('0x4f')]=_['intersection'](_0x10512f[_0x89dc('0xd9')],qs[_0x89dc('0xe4')](_0x2985a7['query'][_0x89dc('0xe4')]));_0x22f1c3[_0x89dc('0x4f')]=_0x22f1c3[_0x89dc('0x4f')]['length']?_0x22f1c3[_0x89dc('0x4f')]:_0x10512f['model'];_0x22f1c3[_0x89dc('0xde')]=qs[_0x89dc('0xdf')](_0x2985a7['query'][_0x89dc('0xdf')]);_0x22f1c3[_0x89dc('0x47')]=qs['filters'](_[_0x89dc('0xe1')](_0x2985a7[_0x89dc('0x49')],_0x10512f[_0x89dc('0xe0')]));if(_0x2985a7[_0x89dc('0x49')][_0x89dc('0x35')]){_0x22f1c3[_0x89dc('0x47')]=_[_0x89dc('0x5d')](_0x22f1c3[_0x89dc('0x47')],{'$or':_['map'](_0x22f1c3[_0x89dc('0x4f')],function(_0x89ffee){var _0x556de1={};_0x556de1[_0x89ffee]={'$like':'%'+_0x2985a7[_0x89dc('0x49')]['filter']+'%'};return _0x556de1;})});}_0x22f1c3=_['merge']({},_0x22f1c3,_0x2985a7[_0x89dc('0x5e')]);return _0x1b1898['getChatInteractions'](_0x22f1c3);}})[_0x89dc('0x1f')](function(_0x5aa61d){if(_0x5aa61d){_0x2e5d83=_0x5aa61d['length'];if(!_0x2985a7[_0x89dc('0x49')][_0x89dc('0xd3')](_0x89dc('0xe2'))){_0x22f1c3[_0x89dc('0x1a')]=qs[_0x89dc('0x1a')](_0x2985a7[_0x89dc('0x49')][_0x89dc('0x1a')]);_0x22f1c3[_0x89dc('0x19')]=qs[_0x89dc('0x19')](_0x2985a7[_0x89dc('0x49')][_0x89dc('0x19')]);}return _0x1b1898['getChatInteractions'](_0x22f1c3);}})[_0x89dc('0x1f')](function(_0x4097f1){if(_0x4097f1){return _0x4097f1?{'count':_0x2e5d83,'rows':_0x4097f1}:null;}})[_0x89dc('0x1f')](respondWithResult(_0x13c686,null))['catch'](handleError(_0x13c686,null));};exports[_0x89dc('0xed')]=function(_0x7bf630,_0x3b07fb){var _0x251392={};var _0x1abcdf={};var _0xa8ba2f;var _0x553a50;return db[_0x89dc('0x48')][_0x89dc('0xd1')]({'where':{'id':_0x7bf630['params']['id']}})['then'](handleEntityNotFound(_0x3b07fb,null))[_0x89dc('0x1f')](function(_0x4ec25e){if(_0x4ec25e){_0xa8ba2f=_0x4ec25e;_0x1abcdf['model']=_[_0x89dc('0xda')](db[_0x89dc('0xee')][_0x89dc('0xdc')]);_0x1abcdf['query']=_[_0x89dc('0xda')](_0x7bf630[_0x89dc('0x49')]);_0x1abcdf[_0x89dc('0xe0')]=_[_0x89dc('0xdd')](_0x1abcdf[_0x89dc('0xd9')],_0x1abcdf[_0x89dc('0x49')]);_0x251392[_0x89dc('0x4f')]=_[_0x89dc('0xdd')](_0x1abcdf[_0x89dc('0xd9')],qs[_0x89dc('0xe4')](_0x7bf630['query'][_0x89dc('0xe4')]));_0x251392['attributes']=_0x251392[_0x89dc('0x4f')]['length']?_0x251392[_0x89dc('0x4f')]:_0x1abcdf['model'];_0x251392[_0x89dc('0xde')]=qs['sort'](_0x7bf630[_0x89dc('0x49')][_0x89dc('0xdf')]);_0x251392['where']=qs['filters'](_[_0x89dc('0xe1')](_0x7bf630[_0x89dc('0x49')],_0x1abcdf[_0x89dc('0xe0')]));if(_0x7bf630[_0x89dc('0x49')][_0x89dc('0x35')]){_0x251392[_0x89dc('0x47')]=_[_0x89dc('0x5d')](_0x251392[_0x89dc('0x47')],{'$or':_['map'](_0x251392['attributes'],function(_0x596926){var _0x48abf0={};_0x48abf0[_0x596926]={'$like':'%'+_0x7bf630['query'][_0x89dc('0x35')]+'%'};return _0x48abf0;})});}_0x251392=_['merge']({},_0x251392,_0x7bf630[_0x89dc('0x5e')]);return _0xa8ba2f[_0x89dc('0xed')](_0x251392);}})[_0x89dc('0x1f')](function(_0x12c509){if(_0x12c509){_0x553a50=_0x12c509['length'];if(!_0x7bf630[_0x89dc('0x49')][_0x89dc('0xd3')](_0x89dc('0xe2'))){_0x251392[_0x89dc('0x1a')]=qs['limit'](_0x7bf630['query'][_0x89dc('0x1a')]);_0x251392[_0x89dc('0x19')]=qs[_0x89dc('0x19')](_0x7bf630['query'][_0x89dc('0x19')]);}return _0xa8ba2f[_0x89dc('0xed')](_0x251392);}})[_0x89dc('0x1f')](function(_0x491180){if(_0x491180){return _0x491180?{'count':_0x553a50,'rows':_0x491180}:null;}})['then'](respondWithResult(_0x3b07fb,null))[_0x89dc('0x2a')](handleError(_0x3b07fb,null));};exports[_0x89dc('0xef')]=function(_0x441d00,_0x5968c8){var _0x19f0a1={'raw':!![],'where':{}};var _0x1e7800={};var _0x5499cb={'count':0x0,'rows':[]};return db[_0x89dc('0x48')][_0x89dc('0xd1')]({'where':{'id':_0x441d00[_0x89dc('0x5c')]['id']}})[_0x89dc('0x1f')](handleEntityNotFound(_0x5968c8,null))[_0x89dc('0x1f')](function(_0x6a728f){if(_0x6a728f){_0x1e7800['model']=_[_0x89dc('0xda')](db[_0x89dc('0xf0')][_0x89dc('0xdc')]);_0x1e7800['query']=_['keys'](_0x441d00[_0x89dc('0x49')]);_0x1e7800[_0x89dc('0xe0')]=_[_0x89dc('0xdd')](_0x1e7800[_0x89dc('0xd9')],_0x1e7800[_0x89dc('0x49')]);_0x19f0a1['attributes']=_[_0x89dc('0xdd')](_0x1e7800[_0x89dc('0xd9')],qs[_0x89dc('0xe4')](_0x441d00['query'][_0x89dc('0xe4')]));_0x19f0a1[_0x89dc('0x4f')]=_0x19f0a1[_0x89dc('0x4f')]['length']?_0x19f0a1['attributes']:_0x1e7800['model'];if(!_0x441d00['query'][_0x89dc('0xd3')](_0x89dc('0xe2'))){_0x19f0a1[_0x89dc('0x1a')]=qs[_0x89dc('0x1a')](_0x441d00[_0x89dc('0x49')][_0x89dc('0x1a')]);_0x19f0a1['offset']=qs[_0x89dc('0x19')](_0x441d00[_0x89dc('0x49')][_0x89dc('0x19')]);}_0x19f0a1['order']=qs['sort'](_0x441d00[_0x89dc('0x49')][_0x89dc('0xdf')]);_0x19f0a1[_0x89dc('0x47')]=qs[_0x89dc('0xe0')](_['pick'](_0x441d00[_0x89dc('0x49')],_0x1e7800[_0x89dc('0xe0')]));_0x19f0a1[_0x89dc('0x47')][_0x89dc('0xe8')]=_0x6a728f['id'];if(_0x441d00[_0x89dc('0x49')][_0x89dc('0x35')]){_0x19f0a1[_0x89dc('0x47')]=_[_0x89dc('0x5d')](_0x19f0a1[_0x89dc('0x47')],{'$or':_[_0x89dc('0x36')](_0x19f0a1['attributes'],function(_0x3807a2){var _0x5a2faa={};_0x5a2faa[_0x3807a2]={'$like':'%'+_0x441d00['query'][_0x89dc('0x35')]+'%'};return _0x5a2faa;})});}_0x19f0a1=_[_0x89dc('0x5d')]({},_0x19f0a1,_0x441d00['options']);return db[_0x89dc('0xf0')][_0x89dc('0x18')]({'where':_0x19f0a1[_0x89dc('0x47')]})['then'](function(_0x8a8b73){_0x5499cb[_0x89dc('0x18')]=_0x8a8b73;if(_0x441d00[_0x89dc('0x49')][_0x89dc('0x4a')]){_0x19f0a1[_0x89dc('0x4b')]=[{'all':!![]}];}return db['MailInteraction'][_0x89dc('0x91')](_0x19f0a1);})[_0x89dc('0x1f')](function(_0x3fe222){_0x5499cb[_0x89dc('0x50')]=_0x3fe222;return _0x5499cb;});}})[_0x89dc('0x1f')](respondWithFilteredResult(_0x5968c8,_0x19f0a1))[_0x89dc('0x2a')](handleError(_0x5968c8,null));};exports[_0x89dc('0xf1')]=function(_0x553c55,_0x801f65){var _0x1a5d78={};var _0x5060a7={};var _0x3b3cf8;var _0x460cbe;return db[_0x89dc('0x48')]['findOne']({'where':{'id':_0x553c55[_0x89dc('0x5c')]['id']}})[_0x89dc('0x1f')](handleEntityNotFound(_0x801f65,null))['then'](function(_0x2c76be){if(_0x2c76be){_0x3b3cf8=_0x2c76be;_0x5060a7[_0x89dc('0xd9')]=_['keys'](db[_0x89dc('0xf2')][_0x89dc('0xdc')]);_0x5060a7['query']=_[_0x89dc('0xda')](_0x553c55[_0x89dc('0x49')]);_0x5060a7[_0x89dc('0xe0')]=_['intersection'](_0x5060a7[_0x89dc('0xd9')],_0x5060a7['query']);_0x1a5d78[_0x89dc('0x4f')]=_[_0x89dc('0xdd')](_0x5060a7[_0x89dc('0xd9')],qs[_0x89dc('0xe4')](_0x553c55[_0x89dc('0x49')][_0x89dc('0xe4')]));_0x1a5d78[_0x89dc('0x4f')]=_0x1a5d78[_0x89dc('0x4f')]['length']?_0x1a5d78[_0x89dc('0x4f')]:_0x5060a7[_0x89dc('0xd9')];_0x1a5d78['order']=qs[_0x89dc('0xdf')](_0x553c55[_0x89dc('0x49')][_0x89dc('0xdf')]);_0x1a5d78[_0x89dc('0x47')]=qs[_0x89dc('0xe0')](_[_0x89dc('0xe1')](_0x553c55[_0x89dc('0x49')],_0x5060a7[_0x89dc('0xe0')]));if(_0x553c55[_0x89dc('0x49')][_0x89dc('0x35')]){_0x1a5d78[_0x89dc('0x47')]=_[_0x89dc('0x5d')](_0x1a5d78[_0x89dc('0x47')],{'$or':_[_0x89dc('0x36')](_0x1a5d78[_0x89dc('0x4f')],function(_0x380d6b){var _0xcf4b84={};_0xcf4b84[_0x380d6b]={'$like':'%'+_0x553c55[_0x89dc('0x49')]['filter']+'%'};return _0xcf4b84;})});}_0x1a5d78=_['merge']({},_0x1a5d78,_0x553c55['options']);return _0x3b3cf8['getSmsInteractions'](_0x1a5d78);}})[_0x89dc('0x1f')](function(_0x1434ac){if(_0x1434ac){_0x460cbe=_0x1434ac['length'];if(!_0x553c55['query'][_0x89dc('0xd3')](_0x89dc('0xe2'))){_0x1a5d78[_0x89dc('0x1a')]=qs[_0x89dc('0x1a')](_0x553c55[_0x89dc('0x49')][_0x89dc('0x1a')]);_0x1a5d78['offset']=qs[_0x89dc('0x19')](_0x553c55[_0x89dc('0x49')][_0x89dc('0x19')]);}return _0x3b3cf8[_0x89dc('0xf1')](_0x1a5d78);}})[_0x89dc('0x1f')](function(_0x233859){if(_0x233859){return _0x233859?{'count':_0x460cbe,'rows':_0x233859}:null;}})[_0x89dc('0x1f')](respondWithResult(_0x801f65,null))[_0x89dc('0x2a')](handleError(_0x801f65,null));};exports[_0x89dc('0xf3')]=function(_0x19718e,_0x17cdfe){var _0x44c623={};var _0x1bbd7b={};var _0x3ba64b;var _0x4f52c0;return db[_0x89dc('0x48')][_0x89dc('0xd1')]({'where':{'id':_0x19718e[_0x89dc('0x5c')]['id']}})[_0x89dc('0x1f')](handleEntityNotFound(_0x17cdfe,null))[_0x89dc('0x1f')](function(_0x183034){if(_0x183034){_0x3ba64b=_0x183034;_0x1bbd7b[_0x89dc('0xd9')]=_[_0x89dc('0xda')](db[_0x89dc('0xf4')][_0x89dc('0xdc')]);_0x1bbd7b[_0x89dc('0x49')]=_['keys'](_0x19718e[_0x89dc('0x49')]);_0x1bbd7b[_0x89dc('0xe0')]=_[_0x89dc('0xdd')](_0x1bbd7b['model'],_0x1bbd7b[_0x89dc('0x49')]);_0x44c623['attributes']=_['intersection'](_0x1bbd7b['model'],qs[_0x89dc('0xe4')](_0x19718e[_0x89dc('0x49')][_0x89dc('0xe4')]));_0x44c623[_0x89dc('0x4f')]=_0x44c623[_0x89dc('0x4f')][_0x89dc('0x52')]?_0x44c623[_0x89dc('0x4f')]:_0x1bbd7b[_0x89dc('0xd9')];_0x44c623[_0x89dc('0xde')]=qs[_0x89dc('0xdf')](_0x19718e['query']['sort']);_0x44c623[_0x89dc('0x47')]=qs['filters'](_[_0x89dc('0xe1')](_0x19718e['query'],_0x1bbd7b[_0x89dc('0xe0')]));if(_0x19718e[_0x89dc('0x49')][_0x89dc('0x35')]){_0x44c623[_0x89dc('0x47')]=_[_0x89dc('0x5d')](_0x44c623['where'],{'$or':_[_0x89dc('0x36')](_0x44c623[_0x89dc('0x4f')],function(_0x292dd2){var _0x172202={};_0x172202[_0x292dd2]={'$like':'%'+_0x19718e[_0x89dc('0x49')][_0x89dc('0x35')]+'%'};return _0x172202;})});}_0x44c623=_[_0x89dc('0x5d')]({},_0x44c623,_0x19718e[_0x89dc('0x5e')]);return _0x3ba64b['getFaxInteractions'](_0x44c623);}})[_0x89dc('0x1f')](function(_0x216599){if(_0x216599){_0x4f52c0=_0x216599['length'];if(!_0x19718e[_0x89dc('0x49')][_0x89dc('0xd3')](_0x89dc('0xe2'))){_0x44c623[_0x89dc('0x1a')]=qs[_0x89dc('0x1a')](_0x19718e['query'][_0x89dc('0x1a')]);_0x44c623['offset']=qs['offset'](_0x19718e[_0x89dc('0x49')]['offset']);}return _0x3ba64b[_0x89dc('0xf3')](_0x44c623);}})[_0x89dc('0x1f')](function(_0x57bf7e){if(_0x57bf7e){return _0x57bf7e?{'count':_0x4f52c0,'rows':_0x57bf7e}:null;}})[_0x89dc('0x1f')](respondWithResult(_0x17cdfe,null))[_0x89dc('0x2a')](handleError(_0x17cdfe,null));};exports['getWhatsappInteractions']=function(_0x156cc2,_0x37552d){var _0x3bb690={};var _0x539bdd={};var _0x736336;var _0xc8d352;return db[_0x89dc('0x48')][_0x89dc('0xd1')]({'where':{'id':_0x156cc2[_0x89dc('0x5c')]['id']}})[_0x89dc('0x1f')](handleEntityNotFound(_0x37552d,null))[_0x89dc('0x1f')](function(_0xa086a1){if(_0xa086a1){_0x736336=_0xa086a1;_0x539bdd[_0x89dc('0xd9')]=_[_0x89dc('0xda')](db[_0x89dc('0xf5')]['rawAttributes']);_0x539bdd[_0x89dc('0x49')]=_['keys'](_0x156cc2['query']);_0x539bdd[_0x89dc('0xe0')]=_[_0x89dc('0xdd')](_0x539bdd['model'],_0x539bdd['query']);_0x3bb690[_0x89dc('0x4f')]=_['intersection'](_0x539bdd[_0x89dc('0xd9')],qs[_0x89dc('0xe4')](_0x156cc2[_0x89dc('0x49')][_0x89dc('0xe4')]));_0x3bb690[_0x89dc('0x4f')]=_0x3bb690[_0x89dc('0x4f')]['length']?_0x3bb690[_0x89dc('0x4f')]:_0x539bdd[_0x89dc('0xd9')];_0x3bb690[_0x89dc('0xde')]=qs[_0x89dc('0xdf')](_0x156cc2[_0x89dc('0x49')]['sort']);_0x3bb690['where']=qs[_0x89dc('0xe0')](_[_0x89dc('0xe1')](_0x156cc2['query'],_0x539bdd[_0x89dc('0xe0')]));if(_0x156cc2[_0x89dc('0x49')][_0x89dc('0x35')]){_0x3bb690['where']=_[_0x89dc('0x5d')](_0x3bb690['where'],{'$or':_[_0x89dc('0x36')](_0x3bb690[_0x89dc('0x4f')],function(_0x7203b6){var _0x576040={};_0x576040[_0x7203b6]={'$like':'%'+_0x156cc2[_0x89dc('0x49')][_0x89dc('0x35')]+'%'};return _0x576040;})});}_0x3bb690=_['merge']({},_0x3bb690,_0x156cc2[_0x89dc('0x5e')]);return _0x736336[_0x89dc('0xf6')](_0x3bb690);}})[_0x89dc('0x1f')](function(_0x22992e){if(_0x22992e){_0xc8d352=_0x22992e[_0x89dc('0x52')];if(!_0x156cc2[_0x89dc('0x49')][_0x89dc('0xd3')](_0x89dc('0xe2'))){_0x3bb690[_0x89dc('0x1a')]=qs[_0x89dc('0x1a')](_0x156cc2[_0x89dc('0x49')]['limit']);_0x3bb690[_0x89dc('0x19')]=qs[_0x89dc('0x19')](_0x156cc2[_0x89dc('0x49')][_0x89dc('0x19')]);}return _0x736336[_0x89dc('0xf6')](_0x3bb690);}})[_0x89dc('0x1f')](function(_0x516890){if(_0x516890){return _0x516890?{'count':_0xc8d352,'rows':_0x516890}:null;}})['then'](respondWithResult(_0x37552d,null))['catch'](handleError(_0x37552d,null));};exports[_0x89dc('0xf7')]=function(_0x407b87,_0x266b2c,_0x407df0){var _0x2d1fc4;var _0x437d49;var _0x6277bf;var _0x9a96c2=!_['isNil'](_0x407b87[_0x89dc('0x5c')]['id'])?_0x407b87['params']['id']:!_[_0x89dc('0x69')](_0x407b87[_0x89dc('0x83')]['id'])?_0x407b87['user']['id']:null;return db[_0x89dc('0x48')][_0x89dc('0x39')]({'where':{'id':_0x9a96c2,'role':{'$or':[_0x89dc('0x84'),'user',_0x89dc('0x33')]}},'attributes':['id',_0x89dc('0x3a'),_0x89dc('0xf8'),'mobile',_0x89dc('0x2c'),_0x89dc('0x64'),_0x89dc('0xa3')]})[_0x89dc('0x1f')](function(_0xdcae16){if(_0xdcae16){if(_0xdcae16[_0x89dc('0x2c')]===_0x89dc('0x33')){_0x2d1fc4=_0xdcae16;if(_0x407b87[_0x89dc('0x5f')][_0x89dc('0xa4')]){_0x6277bf=util['format'](_0x89dc('0xf9'),_0x2d1fc4[_0x407b87[_0x89dc('0x5f')][_0x89dc('0xa4')]]);}else if(_0x407b87['body']['intrf']){_0x6277bf=util[_0x89dc('0xb0')](_0x89dc('0xb1'),_0x407b87[_0x89dc('0x5f')][_0x89dc('0xfa')]);}else{_0x6277bf=util[_0x89dc('0xb0')](_0x89dc('0xb1'),_0x2d1fc4[_0x89dc('0x3a')]);}socket['to'](util[_0x89dc('0xb0')]('user:%s',_0x2d1fc4[_0x89dc('0x3a')]))[_0x89dc('0x2d')](_0x89dc('0xfb'),{'user':{'id':_0x2d1fc4['id'],'name':_0x2d1fc4[_0x89dc('0x3a')]},'ip':_0x407b87[_0x89dc('0xfc')][_0x89dc('0xfd')]||_0x407b87[_0x89dc('0xfe')]['remoteAddress']||_0x407b87[_0x89dc('0xff')][_0x89dc('0x100')]||_0x407b87[_0x89dc('0xfe')][_0x89dc('0xff')][_0x89dc('0x100')]});return db[_0x89dc('0xb3')][_0x89dc('0x2f')]({'where':{'membername':_0x2d1fc4[_0x89dc('0x3a')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x89dc('0x96'))](_0x89dc('0x101'));}})[_0x89dc('0x1f')](function(){if(_0x2d1fc4){return _0x2d1fc4[_0x89dc('0x102')]({'raw':!![]});}})[_0x89dc('0x1f')](function(_0x1b6509){if(_0x2d1fc4){if(_0x1b6509){_0x437d49=_0x1b6509;if(_0x437d49[_0x89dc('0x52')]){var _0x4c9d65=_0x437d49[_0x89dc('0x36')](function(_0x3fae37){var _0x32af75={'membername':_0x2d1fc4['name'],'UserId':_0x2d1fc4['id'],'queue_name':_0x3fae37[_0x89dc('0x3a')],'VoiceQueueId':_0x3fae37['id'],'interface':_0x6277bf,'paused':_0x2d1fc4[_0x89dc('0xa3')]||![],'penalty':_0x3fae37[_0x89dc('0x103')]||0x0};return db[_0x89dc('0xb3')][_0x89dc('0xb4')](_0x32af75);});return Promise['all'](_0x4c9d65);}}}})[_0x89dc('0x1f')](function(){if(_0x2d1fc4){return db[_0x89dc('0x104')]['findAll']({'where':{'membername':_0x2d1fc4[_0x89dc('0x3a')],'exitAt':null}});}})[_0x89dc('0x1f')](function(_0x5e592e){if(_0x2d1fc4){var _0x5bc4a8=[];_0x5e592e[_0x89dc('0x105')](function(_0x14b27a){_0x5bc4a8[_0x89dc('0x53')](_0x14b27a[_0x89dc('0x2b')]({'exitAt':moment()[_0x89dc('0xb0')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x89dc('0x5a')](_0x5bc4a8);}})[_0x89dc('0x1f')](function(){if(_0x2d1fc4){var _0x25aa55=[];var _0x1fcb9d=[];var _0x5a3cb4=utils[_0x89dc('0x106')]();var _0x178e77={'membername':_0x2d1fc4['name'],'interface':_0x6277bf,'enterAt':moment()[_0x89dc('0xb0')](_0x89dc('0x107')),'role':_0x2d1fc4[_0x89dc('0x2c')],'internal':_0x2d1fc4[_0x89dc('0x64')]};_0x5a3cb4[_0x89dc('0x105')](function(_0x45a5e7){_0x25aa55[_0x89dc('0x53')](_['merge']({'channel':_0x45a5e7,'type':_0x89dc('0x108'),'data1':_0x407b87['body'][_0x89dc('0x109')],'data2':_0x6277bf},_0x178e77));if(_0x2d1fc4[_0x89dc('0xa3')]){_0x1fcb9d[_0x89dc('0x53')](_[_0x89dc('0x5d')]({'channel':_0x45a5e7,'type':_0x89dc('0x10a'),'data1':'LOGININPAUSE'},_0x178e77));}});return db['MemberReport'][_0x89dc('0x8c')](_0x25aa55[_0x89dc('0xcf')](_0x1fcb9d),{'individualHooks':!![]});}})[_0x89dc('0x1f')](function(){if(_0x2d1fc4){return _0x2d1fc4[_0x89dc('0x2b')]({'online':!![],'lastLoginAt':moment()[_0x89dc('0xb0')](_0x89dc('0x107')),'voicePause':_0x2d1fc4[_0x89dc('0xa3')]||![],'mailPause':_0x2d1fc4[_0x89dc('0xa3')]||![],'chatPause':_0x2d1fc4['loginInPause']||![],'faxPause':_0x2d1fc4[_0x89dc('0xa3')]||![],'smsPause':_0x2d1fc4[_0x89dc('0xa3')]||![],'openchannelPause':_0x2d1fc4[_0x89dc('0xa3')]||![],'whatsappPause':_0x2d1fc4[_0x89dc('0xa3')]||![],'pauseType':_0x2d1fc4[_0x89dc('0xa3')]?_0x89dc('0x10b'):null,'interface':_0x6277bf,'lastPauseAt':moment()['format'](_0x89dc('0x107'))});}})[_0x89dc('0x1f')](function(_0xd04e70){if(_0x407b87[_0x89dc('0x10c')]){return _0x407df0();}else{return Promise[_0x89dc('0x10d')](_0xd04e70)[_0x89dc('0x1f')](respondWithResult(_0x266b2c,null));}})['catch'](handleError(_0x266b2c,null));};exports[_0x89dc('0x10e')]=function(_0x30e8a2,_0x2d6cd0){var _0x59b235;return db['User'][_0x89dc('0x39')]({'where':{'id':_0x30e8a2[_0x89dc('0x5c')]['id'],'role':'agent'},'attributes':['id',_0x89dc('0x3a'),_0x89dc('0x2c')]})[_0x89dc('0x1f')](handleEntityNotFound(_0x2d6cd0,null))[_0x89dc('0x1f')](function(_0xc75b58){if(_0xc75b58){_0x59b235=_0xc75b58;return db[_0x89dc('0xb3')]['destroy']({'where':{'membername':_0x59b235[_0x89dc('0x3a')]},'individualHooks':!![]});}})[_0x89dc('0x1f')](function(){return db['MemberReport'][_0x89dc('0x91')]({'where':{'membername':_0x59b235[_0x89dc('0x3a')],'exitAt':null}});})[_0x89dc('0x1f')](function(_0x37f84c){var _0x2d474a=[];_0x37f84c['forEach'](function(_0x40f942){_0x2d474a['push'](_0x40f942[_0x89dc('0x2b')]({'exitAt':moment()[_0x89dc('0xb0')](_0x89dc('0x107'))}));});return Promise['all'](_0x2d474a);})[_0x89dc('0x1f')](function(){return _0x59b235['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x2d6cd0,null))[_0x89dc('0x2a')](handleError(_0x2d6cd0,null));};exports[_0x89dc('0x10f')]=function(_0x431c22,_0x56af56){var _0x455ab6;return db[_0x89dc('0xb3')][_0x89dc('0x2b')]({'paused':0x1},{'where':{'UserId':_0x431c22['params']['id']},'individualHooks':!![]})[_0x89dc('0x1f')](function(){return db[_0x89dc('0x48')][_0x89dc('0x39')]({'where':{'id':_0x431c22['params']['id'],'role':_0x89dc('0x33')},'attributes':['id',_0x89dc('0x3a'),_0x89dc('0x2c'),_0x89dc('0x64'),_0x89dc('0xa4'),_0x89dc('0xa2')]});})[_0x89dc('0x1f')](handleEntityNotFound(_0x56af56,null))['then'](function(_0x2d6fc8){if(_0x2d6fc8){_0x455ab6=_0x2d6fc8;return respondWithRpcPromise(_0x89dc('0x110'),'pause',{'id':_0x455ab6['id'],'name':_0x455ab6[_0x89dc('0x3a')],'pause':!![]});}})[_0x89dc('0x1f')](function(){if(_0x455ab6){return db[_0x89dc('0x104')]['findAll']({'where':{'membername':_0x455ab6[_0x89dc('0x3a')],'type':'PAUSE','exitAt':null}});}})[_0x89dc('0x1f')](function(_0x751d5a){if(_0x751d5a[_0x89dc('0x52')]){var _0x42c9ad=moment()[_0x89dc('0xb0')](_0x89dc('0x107'));for(var _0x5a5500=0x0,_0x18f42b=_0x751d5a[_0x89dc('0x52')];_0x5a5500<_0x18f42b;_0x5a5500++){_0x751d5a[_0x5a5500][_0x89dc('0x111')]({'exitAt':_0x42c9ad});}}})[_0x89dc('0x1f')](function(){var _0x4be42f=[];var _0x464e6b=utils[_0x89dc('0x106')]();_0x464e6b[_0x89dc('0x105')](function(_0x52f78e){_0x4be42f['push']({'channel':_0x52f78e,'membername':_0x455ab6[_0x89dc('0x3a')],'interface':_['isNil'](_0x455ab6[_0x89dc('0xa4')])?util[_0x89dc('0xb0')](_0x89dc('0xb1'),_0x455ab6[_0x89dc('0x3a')]):_0x455ab6[_0x89dc('0xa4')],'type':_0x89dc('0x10a'),'enterAt':moment()['format'](_0x89dc('0x107')),'data1':_0x431c22[_0x89dc('0x5f')][_0x89dc('0x112')]||_0x89dc('0x113'),'role':_0x455ab6['role'],'internal':_0x455ab6[_0x89dc('0x64')]});});return db[_0x89dc('0x104')][_0x89dc('0x8c')](_0x4be42f,{'individualHooks':!![]});})['then'](function(){return _0x455ab6[_0x89dc('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x431c22[_0x89dc('0x5f')][_0x89dc('0x112')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x89dc('0xb0')](_0x89dc('0x107'))});})[_0x89dc('0x1f')](respondWithResult(_0x56af56,null))[_0x89dc('0x2a')](handleError(_0x56af56,null));};exports[_0x89dc('0x114')]=function(_0x20504c,_0x267c4e){if(_0x20504c['body'][_0x89dc('0xa1')]&&!utils[_0x89dc('0xa5')](_0x20504c[_0x89dc('0x5f')]['channel'])){throw new APIBadRequestError(util[_0x89dc('0xb0')](_0x89dc('0x115'),_0x20504c[_0x89dc('0x5f')][_0x89dc('0xa1')]));}return db[_0x89dc('0x48')]['find']({'where':{'id':_0x20504c[_0x89dc('0x5c')]['id']},'attributes':['id',_0x89dc('0x3a'),_0x89dc('0x2c'),_0x89dc('0x64'),'interface',_0x89dc('0xa2'),_0x89dc('0xb2'),_0x89dc('0x116'),'chatPause',_0x89dc('0x117'),_0x89dc('0x118'),_0x89dc('0x119'),'whatsappPause','pauseType','lastPauseAt']})[_0x89dc('0x1f')](function(_0x34b679){if(!_0x34b679){throw new APINotFoundError(util[_0x89dc('0xb0')](_0x89dc('0xd2'),_0x20504c[_0x89dc('0x5c')]['id']));}return _0x34b679[_0x89dc('0x114')](_0x20504c[_0x89dc('0x5f')]['channel']);})[_0x89dc('0x1f')](respondWithResult(_0x267c4e,null))[_0x89dc('0x2a')](APIHandleError(_0x267c4e));};exports[_0x89dc('0x11a')]=function(_0x19582a,_0x1e683c){var _0x175b0b={};var _0x4d2b56={};var _0x53ddbb;var _0x21add3;return db[_0x89dc('0x48')][_0x89dc('0xd1')]({'where':{'id':_0x19582a[_0x89dc('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1e683c,null))[_0x89dc('0x1f')](function(_0x31dcca){if(_0x31dcca){_0x53ddbb=_0x31dcca;_0x4d2b56['model']=_['keys'](db[_0x89dc('0x11b')][_0x89dc('0xdc')]);_0x4d2b56[_0x89dc('0x49')]=_['keys'](_0x19582a['query']);_0x4d2b56['filters']=_[_0x89dc('0xdd')](_0x4d2b56['model'],_0x4d2b56[_0x89dc('0x49')]);_0x175b0b['attributes']=_[_0x89dc('0xdd')](_0x4d2b56[_0x89dc('0xd9')],qs['fields'](_0x19582a[_0x89dc('0x49')][_0x89dc('0xe4')]));_0x175b0b[_0x89dc('0x4f')]=_0x175b0b['attributes'][_0x89dc('0x52')]?_0x175b0b[_0x89dc('0x4f')]:_0x4d2b56['model'];_0x175b0b['order']=qs[_0x89dc('0xdf')](_0x19582a['query'][_0x89dc('0xdf')]);_0x175b0b[_0x89dc('0x47')]=qs['filters'](_[_0x89dc('0xe1')](_0x19582a[_0x89dc('0x49')],_0x4d2b56[_0x89dc('0xe0')]));if(_0x19582a[_0x89dc('0x49')][_0x89dc('0x35')]){_0x175b0b[_0x89dc('0x47')]=_['merge'](_0x175b0b[_0x89dc('0x47')],{'$or':_[_0x89dc('0x36')](_0x175b0b['attributes'],function(_0x20b3eb){var _0xd2d1c={};_0xd2d1c[_0x20b3eb]={'$like':'%'+_0x19582a[_0x89dc('0x49')][_0x89dc('0x35')]+'%'};return _0xd2d1c;})});}_0x175b0b=_[_0x89dc('0x5d')]({},_0x175b0b,_0x19582a['options']);return _0x53ddbb['getTeams'](_0x175b0b);}})[_0x89dc('0x1f')](function(_0x4a3677){if(_0x4a3677){_0x21add3=_0x4a3677[_0x89dc('0x52')];if(!_0x19582a['query'][_0x89dc('0xd3')](_0x89dc('0xe2'))){_0x175b0b[_0x89dc('0x1a')]=qs[_0x89dc('0x1a')](_0x19582a[_0x89dc('0x49')][_0x89dc('0x1a')]);_0x175b0b['offset']=qs['offset'](_0x19582a[_0x89dc('0x49')][_0x89dc('0x19')]);}return _0x53ddbb[_0x89dc('0x11a')](_0x175b0b);}})[_0x89dc('0x1f')](function(_0x4f3717){if(_0x4f3717){return _0x4f3717?{'count':_0x21add3,'rows':_0x4f3717}:null;}})[_0x89dc('0x1f')](respondWithResult(_0x1e683c,null))[_0x89dc('0x2a')](handleError(_0x1e683c,null));};exports[_0x89dc('0x11c')]=function(_0x504f12,_0x1ebc5f){var _0x101dbb=_0x504f12[_0x89dc('0x5c')]['id'];var _0x1c592a=_0x504f12[_0x89dc('0x5f')]?_0x504f12[_0x89dc('0x5f')][_0x89dc('0x62')]:null;var _0x583bf4=[];return Promise['resolve']()['then'](function(){if(!_0x1c592a)throw new APIBadRequestError(_0x89dc('0x11d'));})[_0x89dc('0x1f')](function(){return db[_0x89dc('0x48')]['findOne']({'where':{'id':_0x101dbb}});})[_0x89dc('0x1f')](function(_0x326cb2){if(!_0x326cb2)throw new APINotFoundError(util[_0x89dc('0xb0')](_0x89dc('0xd2'),_0x504f12['params']['id']));return db[_0x89dc('0x6b')][_0x89dc('0x11e')](function(_0x1df5c8){return _0x326cb2[_0x89dc('0x11c')](_0x1c592a,{'transaction':_0x1df5c8})['then'](function(){return db['Team'][_0x89dc('0x91')]({'where':{'id':{'$in':_0x1c592a}}});})[_0x89dc('0x1f')](function(_0x44462f){var _0x478612=_[_0x89dc('0x36')](_0x44462f,function(_0x15b505){return _0x15b505[_0x89dc('0x11f')]();});return Promise[_0x89dc('0x5a')](_0x478612);})['then'](function(_0x4dd152){_0x583bf4=_[_0x89dc('0x120')](_0x4dd152);var _0x5da2c8=_[_0x89dc('0x36')](_0x583bf4,function(_0x48ea33){return _0x48ea33[_0x89dc('0x121')](_0x326cb2['id'],{'transaction':_0x1df5c8});});return Promise['all'](_0x5da2c8);})[_0x89dc('0x1f')](function(){if(!_0x326cb2['online'])return;var _0x327512=_[_0x89dc('0x35')](_0x583bf4,function(_0x1d7844){return _0x1d7844[_0x89dc('0x122')](_0x89dc('0xa1'))===_0x89dc('0x123');});var _0x25e8b6=_[_0x89dc('0x36')](_0x327512,function(_0x17cf0f){return db[_0x89dc('0xb3')][_0x89dc('0xb4')]({'membername':_0x326cb2[_0x89dc('0x3a')],'UserId':_0x326cb2['id'],'queue_name':_0x17cf0f[_0x89dc('0x3a')],'VoiceQueueId':_0x17cf0f['id'],'interface':_['isNil'](_0x326cb2[_0x89dc('0xa4')])?util[_0x89dc('0xb0')](_0x89dc('0xb1'),_0x326cb2[_0x89dc('0x3a')]):_0x326cb2[_0x89dc('0xa4')],'paused':_0x326cb2[_0x89dc('0xb2')]||![],'penalty':_0x326cb2[_0x89dc('0xa9')]},{'transaction':_0x1df5c8});});return Promise['all'](_0x25e8b6);})[_0x89dc('0x1f')](function(){return db[_0x89dc('0x124')][_0x89dc('0x91')]({'where':{'teamId':{'$in':_0x1c592a}}});})[_0x89dc('0x1f')](function(_0x216bfa){var _0xe79db8=_['map'](_0x216bfa,function(_0x354f30){return db[_0x89dc('0x125')][_0x89dc('0x8f')]({'UserId':_0x326cb2['id'],'VoicePrefixId':_0x354f30[_0x89dc('0x126')]},{'transaction':_0x1df5c8});});return Promise[_0x89dc('0x5a')](_0xe79db8);});});})[_0x89dc('0x1f')](function(){for(var _0x438897=0x0;_0x438897<_0x583bf4[_0x89dc('0x52')];_0x438897++){var _0x37ac13=_0x583bf4[_0x438897][_0x89dc('0x122')](_0x89dc('0xa1'));var _0x5bd3ef=_0x37ac13+_0x89dc('0xab');socket[_0x89dc('0x2d')](_0x89dc('0x83')+_0x37ac13+_0x89dc('0xad'),{'UserId':_0x101dbb,['queueField']:_0x583bf4[_0x438897]['id']});}})[_0x89dc('0x1f')](respondWithStatusCode(_0x1ebc5f,null))[_0x89dc('0x2a')](APIHandleError(_0x1ebc5f));};exports['removeTeams']=function(_0x185931,_0x48d67d){var _0x285a89=_0x185931[_0x89dc('0x5c')]['id'];var _0x41ddd9=null;if(_0x185931[_0x89dc('0x49')][_0x89dc('0x62')]){_0x41ddd9=_[_0x89dc('0x127')](_0x185931['query'][_0x89dc('0x62')])?_0x185931['query'][_0x89dc('0x62')]:[_0x185931[_0x89dc('0x49')][_0x89dc('0x62')]];}var _0x16951d=[];return Promise[_0x89dc('0x10d')]()[_0x89dc('0x1f')](function(){if(!_0x41ddd9)throw new APIBadRequestError(_0x89dc('0x128'));})['then'](function(){return db['User'][_0x89dc('0xd1')]({'where':{'id':_0x285a89}});})[_0x89dc('0x1f')](function(_0x6f8eed){if(!_0x6f8eed)throw new APINotFoundError(util['format'](_0x89dc('0xd2'),_0x185931[_0x89dc('0x5c')]['id']));return db[_0x89dc('0x6b')][_0x89dc('0x11e')](function(_0x206ce8){return _0x6f8eed[_0x89dc('0x129')](_0x41ddd9,{'transaction':_0x206ce8})[_0x89dc('0x1f')](function(){return db[_0x89dc('0x11b')][_0x89dc('0x91')]({'where':{'id':{'$in':_0x41ddd9}}});})[_0x89dc('0x1f')](function(_0x34edda){var _0x5cb5f1=_[_0x89dc('0x36')](_0x34edda,function(_0x497dc2){return _0x497dc2['getAssociatedQueues']();});return Promise[_0x89dc('0x5a')](_0x5cb5f1);})[_0x89dc('0x1f')](function(_0x487760){_0x16951d=_['flattenDeep'](_0x487760);var _0x4efb7d=_[_0x89dc('0x36')](_0x16951d,function(_0x4f6aa2){return _0x4f6aa2[_0x89dc('0x12a')](_0x6f8eed['id'],{'transaction':_0x206ce8});});return Promise['all'](_0x4efb7d);})['then'](function(){if(!_0x6f8eed[_0x89dc('0xa2')])return;var _0x368e0a=_[_0x89dc('0x35')](_0x16951d,function(_0x1fd39f){return _0x1fd39f[_0x89dc('0x122')](_0x89dc('0xa1'))===_0x89dc('0x123');});var _0x546f21=_['map'](_0x368e0a,function(_0x2ebcfe){return db[_0x89dc('0xb3')]['destroy']({'where':{'VoiceQueueId':_0x2ebcfe['id'],'UserId':_0x6f8eed['id']},'transaction':_0x206ce8});});return Promise[_0x89dc('0x5a')](_0x546f21);})['then'](function(){return db['TeamVoicePrefix'][_0x89dc('0x91')]({'where':{'teamId':{'$in':_0x41ddd9}}});})[_0x89dc('0x1f')](function(_0x4c968e){var _0x1c8d30=_[_0x89dc('0x36')](_0x4c968e,function(_0x1aa226){return db[_0x89dc('0x125')][_0x89dc('0x2f')]({'where':{'UserId':_0x6f8eed['id'],'VoicePrefixId':_0x1aa226[_0x89dc('0x126')]}},{'transaction':_0x206ce8});});return Promise[_0x89dc('0x5a')](_0x1c8d30);});});})['then'](function(){for(var _0xea6e32=0x0;_0xea6e32<_0x16951d[_0x89dc('0x52')];_0xea6e32++){var _0x5e6969=_0x16951d[_0xea6e32][_0x89dc('0x122')](_0x89dc('0xa1'));var _0x4c71ef=_0x5e6969+'QueueId';socket[_0x89dc('0x2d')](_0x89dc('0x83')+_0x5e6969+_0x89dc('0xb8'),{'UserId':_0x285a89,['queueField']:_0x16951d[_0xea6e32]['id']});}})[_0x89dc('0x1f')](respondWithStatusCode(_0x48d67d,null))[_0x89dc('0x2a')](APIHandleError(_0x48d67d));};exports['getLists']=function(_0xddc342,_0x565aee){var _0x1d3803={};var _0x3f34c3={};var _0x550a7c;var _0x5a15d4;return db[_0x89dc('0x48')][_0x89dc('0xd1')]({'where':{'id':_0xddc342[_0x89dc('0x5c')]['id']}})[_0x89dc('0x1f')](handleEntityNotFound(_0x565aee,null))['then'](function(_0x329398){if(_0x329398){_0x550a7c=_0x329398;_0x3f34c3[_0x89dc('0xd9')]=_[_0x89dc('0xda')](db[_0x89dc('0xd4')][_0x89dc('0xdc')]);_0x3f34c3['query']=_[_0x89dc('0xda')](_0xddc342['query']);_0x3f34c3[_0x89dc('0xe0')]=_[_0x89dc('0xdd')](_0x3f34c3[_0x89dc('0xd9')],_0x3f34c3['query']);_0x1d3803['attributes']=_['intersection'](_0x3f34c3[_0x89dc('0xd9')],qs[_0x89dc('0xe4')](_0xddc342[_0x89dc('0x49')][_0x89dc('0xe4')]));_0x1d3803['attributes']=_0x1d3803[_0x89dc('0x4f')][_0x89dc('0x52')]?_0x1d3803[_0x89dc('0x4f')]:_0x3f34c3['model'];_0x1d3803[_0x89dc('0xde')]=qs[_0x89dc('0xdf')](_0xddc342[_0x89dc('0x49')][_0x89dc('0xdf')]);_0x1d3803['where']=qs[_0x89dc('0xe0')](_[_0x89dc('0xe1')](_0xddc342[_0x89dc('0x49')],_0x3f34c3['filters']));if(_0xddc342['query'][_0x89dc('0x35')]){_0x1d3803['where']=_['merge'](_0x1d3803[_0x89dc('0x47')],{'$or':_[_0x89dc('0x36')](_0x1d3803[_0x89dc('0x4f')],function(_0x162e77){var _0x10973a={};_0x10973a[_0x162e77]={'$like':'%'+_0xddc342['query'][_0x89dc('0x35')]+'%'};return _0x10973a;})});}_0x1d3803=_[_0x89dc('0x5d')]({},_0x1d3803,_0xddc342[_0x89dc('0x5e')]);return _0x550a7c[_0x89dc('0x12b')](_0x1d3803);}})[_0x89dc('0x1f')](function(_0x1d823f){if(_0x1d823f){_0x5a15d4=_0x1d823f[_0x89dc('0x52')];if(!_0xddc342[_0x89dc('0x49')]['hasOwnProperty'](_0x89dc('0xe2'))){_0x1d3803[_0x89dc('0x1a')]=qs[_0x89dc('0x1a')](_0xddc342[_0x89dc('0x49')][_0x89dc('0x1a')]);_0x1d3803[_0x89dc('0x19')]=qs[_0x89dc('0x19')](_0xddc342[_0x89dc('0x49')][_0x89dc('0x19')]);}return _0x550a7c[_0x89dc('0x12b')](_0x1d3803);}})['then'](function(_0x4e4be0){if(_0x4e4be0){return _0x4e4be0?{'count':_0x5a15d4,'rows':_0x4e4be0}:null;}})[_0x89dc('0x1f')](respondWithResult(_0x565aee,null))[_0x89dc('0x2a')](handleError(_0x565aee,null));};exports[_0x89dc('0x12c')]=function(_0x273013,_0x4d5af9){var _0x57175d={};var _0x542023={};var _0x4372fb;return db[_0x89dc('0x48')][_0x89dc('0xd1')]({'where':{'id':_0x273013[_0x89dc('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4d5af9,null))[_0x89dc('0x1f')](function(_0x296d43){if(_0x296d43){_0x4372fb=_0x296d43;_0x542023[_0x89dc('0xd9')]=_[_0x89dc('0xda')](db[_0x89dc('0x48')][_0x89dc('0xdc')]);_0x542023[_0x89dc('0x49')]=_[_0x89dc('0xda')](_0x273013[_0x89dc('0x49')]);_0x542023[_0x89dc('0xe0')]=_[_0x89dc('0xdd')](_0x542023[_0x89dc('0xd9')],_0x542023['query']);_0x57175d['attributes']=_['intersection'](_0x542023['model'],qs['fields'](_0x273013[_0x89dc('0x49')]['fields']));_0x57175d[_0x89dc('0x4f')]=_0x57175d['attributes'][_0x89dc('0x52')]?_0x57175d[_0x89dc('0x4f')]:_0x542023[_0x89dc('0xd9')];_0x57175d[_0x89dc('0xde')]=qs[_0x89dc('0xdf')](_0x273013['query'][_0x89dc('0xdf')]);_0x57175d[_0x89dc('0x47')]=qs[_0x89dc('0xe0')](_[_0x89dc('0xe1')](_0x273013[_0x89dc('0x49')],_0x542023[_0x89dc('0xe0')]));if(_0x273013['query']['filter']){_0x57175d[_0x89dc('0x47')]=_[_0x89dc('0x5d')](_0x57175d[_0x89dc('0x47')],{'$or':_[_0x89dc('0x36')](_0x57175d[_0x89dc('0x4f')],function(_0x3207ba){var _0x571502={};_0x571502[_0x3207ba]={'$like':'%'+_0x273013[_0x89dc('0x49')]['filter']+'%'};return _0x571502;})});}_0x57175d[_0x89dc('0xd9')]=db[_0x89dc('0x48')];_0x57175d['as']=_0x89dc('0x32');_0x57175d=_[_0x89dc('0x5d')]({},_0x57175d,_0x273013[_0x89dc('0x5e')]);return _0x4372fb[_0x89dc('0x102')]({'include':[_0x57175d]});}})['then'](function(_0x14d523){if(_0x14d523){var _0x41f120={},_0xa174cb=[];for(var _0x46949b=0x0;_0x46949b<_0x14d523[_0x89dc('0x52')];_0x46949b+=0x1){for(var _0x226441=0x0,_0x3af944;_0x226441<_0x14d523[_0x46949b]['Agents'][_0x89dc('0x52')];_0x226441+=0x1){_0x3af944=_0x14d523[_0x46949b][_0x89dc('0x32')][_0x226441][_0x89dc('0x30')]({'plain':!![]});_0x41f120[_0x3af944['id']]=_0x3af944;}}_0x41f120=_[_0x89dc('0x12d')](_0x41f120);for(var _0x26e257=qs[_0x89dc('0x19')](_0x273013['query']['offset']);_0x26e257<_0x41f120['length']&&_0xa174cb['length']=_0x3db0cf[_0xbc60('0x51')]){throw new Error(_0xbc60('0x52'));}})[_0xbc60('0x24')](function(){if(_0x523cef){return db['UserVoiceQueueRt'][_0xbc60('0x46')]({'where':{'membername':_0x523cef[_0xbc60('0x20')]},'individualHooks':!![]});}})[_0xbc60('0x24')](function(){if(_0x523cef){return _0x523cef['getVoiceQueues']({'raw':!![]});}})[_0xbc60('0x24')](function(_0x183556){if(_0x523cef){if(_0x183556){var _0xf1857a=[];_0x434097=_0x183556;if(_0x434097[_0xbc60('0x2c')]){for(var _0x3bcd5e=0x0;_0x3bcd5e<_0x434097[_0xbc60('0x2c')];_0x3bcd5e++){_0xf1857a[_0xbc60('0x2f')](db['UserVoiceQueueRt'][_0xbc60('0x53')]({'membername':_0x523cef[_0xbc60('0x20')],'UserId':_0x523cef['id'],'queue_name':_0x434097[_0x3bcd5e][_0xbc60('0x20')],'VoiceQueueId':_0x434097[_0x3bcd5e]['id'],'interface':_0x4e4f77,'paused':_0x523cef[_0xbc60('0x4b')]||![],'penalty':_0x434097[_0x3bcd5e]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xbc60('0x47')](_0xf1857a);}}}})['then'](function(){if(_0x523cef){return db['MemberReport']['findAll']({'where':{'membername':_0x523cef['name'],'exitAt':null}});}})[_0xbc60('0x24')](function(_0x11aae4){if(_0x523cef){if(_0x11aae4&&_0x11aae4[_0xbc60('0x2c')]){var _0x2a4501=[];_0x11aae4[_0xbc60('0x2e')](function(_0x2e0014){_0x2a4501[_0xbc60('0x2f')](_0x2e0014[_0xbc60('0x35')]({'exitAt':moment()[_0xbc60('0x25')](_0xbc60('0x31'))}));});return BPromise['all'](_0x2a4501);}}})[_0xbc60('0x24')](function(){if(_0x523cef){var _0x55435=[];var _0x2ee45a=[];var _0x295504=utils[_0xbc60('0x2d')]();var _0x8a368={'membername':_0x523cef[_0xbc60('0x20')],'interface':_0x4e4f77,'enterAt':moment()[_0xbc60('0x25')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x523cef['role'],'internal':_0x523cef[_0xbc60('0x22')]};_0x295504[_0xbc60('0x2e')](function(_0x5f1ffa){_0x55435[_0xbc60('0x2f')](_[_0xbc60('0x54')]({'channel':_0x5f1ffa,'type':_0xbc60('0x55'),'data1':_0xbc60('0x56'),'data2':_0x4e4f77},_0x8a368));if(_0x523cef[_0xbc60('0x4b')]){_0x2ee45a[_0xbc60('0x2f')](_[_0xbc60('0x54')]({'channel':_0x5f1ffa,'type':'PAUSE','data1':_0xbc60('0x57')},_0x8a368));}});return db['MemberReport']['bulkCreate'](_0x55435[_0xbc60('0x58')](_0x2ee45a),{'individualHooks':!![]});}})['then'](function(){if(_0x523cef){return _0x523cef[_0xbc60('0x35')]({'online':!![],'lastLoginAt':moment()[_0xbc60('0x25')](_0xbc60('0x31')),'voicePause':_0x523cef[_0xbc60('0x4b')]||![],'mailPause':_0x523cef[_0xbc60('0x4b')]||![],'chatPause':_0x523cef[_0xbc60('0x4b')]||![],'faxPause':_0x523cef['loginInPause']||![],'smsPause':_0x523cef[_0xbc60('0x4b')]||![],'openchannelPause':_0x523cef['loginInPause']||![],'pauseType':_0x523cef[_0xbc60('0x4b')]?_0xbc60('0x57'):null,'lastPauseAt':moment()[_0xbc60('0x25')](_0xbc60('0x31')),'interface':_0x4e4f77});}})[_0xbc60('0x24')](function(_0x49c56b){_0x17d500(_0x49c56b);})[_0xbc60('0x1d')](function(_0x37d60b){_0x132e2e(_0xd1129d[_0xbc60('0x1a')](0x1f4,_0x37d60b[_0xbc60('0x19')]));});});}; \ No newline at end of file +var _0x0efd=['DEFAULT\x20PAUSE','role','internal','uniqueid','bulkCreate','UnpauseUser','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','online','chatPause','faxPause','smsPause','whatsappPause','pauseType','lastPauseAt','unpause','system','LogoutUser','findOne','destroy','forEach','push','all','LoginUser','mobile','phone','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','length','UserVoiceQueue.penalty','merge','LOGIN','callysquare','loginInPause','concat','LOGININPAUSE','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','register','GetUser','User','options','where','attributes','limit','include','map','model','info','stringify','error','message','ShowUser','raw','then','debug','catch','PauseUser','find','name','User\x20with\x20id\x20%s\x20not\x20found','UserVoiceQueueRt','update','MemberReport','findAll','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','isNil','interface','SIP/%s','body','type'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0efd,0x1ec));var _0xd0ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0efd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd0ef('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var Redis=require(_0xd0ef('0x1'));var db=require(_0xd0ef('0x2'))['db'];var utils=require(_0xd0ef('0x3'));var logger=require(_0xd0ef('0x4'))('rpc');var config=require(_0xd0ef('0x5'));config[_0xd0ef('0x6')]=_[_0xd0ef('0x7')](config[_0xd0ef('0x6')],{'host':_0xd0ef('0x8'),'port':0x18eb});var socket=require(_0xd0ef('0x9'))(new Redis(config['redis']));require(_0xd0ef('0xa'))[_0xd0ef('0xb')](socket);exports[_0xd0ef('0xc')]=function(_0x679653){var _0x4e4a1a=this;return new Promise(function(_0x589fee,_0x4269e3){return db[_0xd0ef('0xd')]['findAll']({'raw':_0x679653[_0xd0ef('0xe')]?_0x679653[_0xd0ef('0xe')]['raw']===undefined?!![]:![]:!![],'where':_0x679653[_0xd0ef('0xe')]?_0x679653[_0xd0ef('0xe')][_0xd0ef('0xf')]||null:null,'attributes':_0x679653[_0xd0ef('0xe')]?_0x679653[_0xd0ef('0xe')][_0xd0ef('0x10')]||null:null,'limit':_0x679653[_0xd0ef('0xe')]?_0x679653[_0xd0ef('0xe')][_0xd0ef('0x11')]||null:null,'include':_0x679653['options']?_0x679653[_0xd0ef('0xe')][_0xd0ef('0x12')]?_[_0xd0ef('0x13')](_0x679653[_0xd0ef('0xe')]['include'],function(_0x21b475){return{'model':db[_0x21b475[_0xd0ef('0x14')]],'as':_0x21b475['as'],'attributes':_0x21b475[_0xd0ef('0x10')],'include':_0x21b475[_0xd0ef('0x12')]?_[_0xd0ef('0x13')](_0x21b475[_0xd0ef('0x12')],function(_0x196d61){return{'model':db[_0x196d61[_0xd0ef('0x14')]],'as':_0x196d61['as'],'attributes':_0x196d61[_0xd0ef('0x10')],'include':_0x196d61['include']?_[_0xd0ef('0x13')](_0x196d61['include'],function(_0x3047c2){return{'model':db[_0x3047c2['model']],'as':_0x3047c2['as'],'attributes':_0x3047c2[_0xd0ef('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c1f33){logger[_0xd0ef('0x15')](_0xd0ef('0xc'),_0x679653);logger['debug'](_0xd0ef('0xc'),_0x679653,JSON[_0xd0ef('0x16')](_0x4c1f33));_0x589fee(_0x4c1f33);})['catch'](function(_0x43329f){logger[_0xd0ef('0x17')]('GetUser',_0x43329f[_0xd0ef('0x18')],_0x679653);_0x4269e3(_0x4e4a1a[_0xd0ef('0x17')](0x1f4,_0x43329f[_0xd0ef('0x18')]));});});};exports[_0xd0ef('0x19')]=function(_0x52475e){var _0x3e4852=this;return new Promise(function(_0x1ad8a3,_0x123e29){return db[_0xd0ef('0xd')]['find']({'raw':_0x52475e[_0xd0ef('0xe')]?_0x52475e[_0xd0ef('0xe')][_0xd0ef('0x1a')]===undefined?!![]:![]:!![],'where':_0x52475e[_0xd0ef('0xe')]?_0x52475e[_0xd0ef('0xe')][_0xd0ef('0xf')]||null:null,'attributes':_0x52475e['options']?_0x52475e[_0xd0ef('0xe')]['attributes']||null:null,'include':_0x52475e['options']?_0x52475e['options'][_0xd0ef('0x12')]?_[_0xd0ef('0x13')](_0x52475e[_0xd0ef('0xe')][_0xd0ef('0x12')],function(_0x1ea92f){return{'model':db[_0x1ea92f[_0xd0ef('0x14')]],'as':_0x1ea92f['as'],'attributes':_0x1ea92f[_0xd0ef('0x10')],'include':_0x1ea92f[_0xd0ef('0x12')]?_['map'](_0x1ea92f['include'],function(_0x4f34c7){return{'model':db[_0x4f34c7['model']],'as':_0x4f34c7['as'],'attributes':_0x4f34c7[_0xd0ef('0x10')],'include':_0x4f34c7[_0xd0ef('0x12')]?_['map'](_0x4f34c7[_0xd0ef('0x12')],function(_0x43c223){return{'model':db[_0x43c223['model']],'as':_0x43c223['as'],'attributes':_0x43c223[_0xd0ef('0x10')]};}):[]};}):[]};}):[]:[]})[_0xd0ef('0x1b')](function(_0x2400d8){logger[_0xd0ef('0x15')](_0xd0ef('0x19'),_0x52475e);logger[_0xd0ef('0x1c')]('ShowUser',_0x52475e,JSON[_0xd0ef('0x16')](_0x2400d8));_0x1ad8a3(_0x2400d8);})[_0xd0ef('0x1d')](function(_0x3948d8){logger[_0xd0ef('0x17')]('ShowUser',_0x3948d8['message'],_0x52475e);_0x123e29(_0x3e4852['error'](0x1f4,_0x3948d8[_0xd0ef('0x18')]));});});};exports[_0xd0ef('0x1e')]=function(_0x185540){var _0x4dce32;return db[_0xd0ef('0xd')][_0xd0ef('0x1f')]({'where':_0x185540[_0xd0ef('0xe')]['where']||{},'attributes':['id',_0xd0ef('0x20'),'role','internal','interface']})[_0xd0ef('0x1b')](function(_0x3fc032){if(!_0x3fc032){throw new Error(util['format'](_0xd0ef('0x21'),_0x185540['params']['id']));}_0x4dce32=_0x3fc032;return db[_0xd0ef('0x22')][_0xd0ef('0x23')]({'paused':0x1},{'where':{'UserId':_0x4dce32['id']},'individualHooks':!![]});})[_0xd0ef('0x1b')](function(){return db[_0xd0ef('0x24')][_0xd0ef('0x25')]({'where':{'membername':_0x4dce32['name'],'type':_0xd0ef('0x26'),'exitAt':null}});})['then'](function(_0x3ccd40){if(_0x3ccd40&&_0x3ccd40['length']){var _0x545389=moment()[_0xd0ef('0x27')](_0xd0ef('0x28'));for(var _0x1b7ad9=0x0,_0x5a12a7=_0x3ccd40['length'];_0x1b7ad9<_0x5a12a7;_0x1b7ad9++){_0x3ccd40[_0x1b7ad9][_0xd0ef('0x29')]({'exitAt':_0x545389});}}})[_0xd0ef('0x1b')](function(){var _0x53afc1=[];var _0xa12189=utils[_0xd0ef('0x2a')]();_0xa12189['forEach'](function(_0x443312){_0x53afc1['push']({'channel':_0x443312,'membername':_0x4dce32[_0xd0ef('0x20')],'interface':_[_0xd0ef('0x2b')](_0x4dce32[_0xd0ef('0x2c')])?util[_0xd0ef('0x27')](_0xd0ef('0x2d'),_0x4dce32[_0xd0ef('0x20')]):_0x4dce32[_0xd0ef('0x2c')],'type':_0xd0ef('0x26'),'enterAt':moment()['format'](_0xd0ef('0x28')),'data1':_0x185540[_0xd0ef('0x2e')][_0xd0ef('0x2f')]||_0xd0ef('0x30'),'role':_0x4dce32[_0xd0ef('0x31')],'internal':_0x4dce32[_0xd0ef('0x32')],'uniqueid':_0x185540[_0xd0ef('0x2e')][_0xd0ef('0x33')]||null});});return db[_0xd0ef('0x24')][_0xd0ef('0x34')](_0x53afc1,{'individualHooks':!![]});})[_0xd0ef('0x1b')](function(){return _0x4dce32['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x185540[_0xd0ef('0x2e')][_0xd0ef('0x2f')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xd0ef('0x27')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xd0ef('0x1d')](function(_0xe5827c){throw _0xe5827c;});};exports[_0xd0ef('0x35')]=function(_0x27e4fd){return Promise[_0xd0ef('0x36')]()[_0xd0ef('0x1b')](function(){if(_0x27e4fd[_0xd0ef('0x2e')][_0xd0ef('0x37')]&&!utils[_0xd0ef('0x38')](_0x27e4fd['body']['channel'])){throw new Error(util[_0xd0ef('0x27')](_0xd0ef('0x39'),_0x27e4fd[_0xd0ef('0x2e')]['channel']));}return db['User']['findOne']({'where':_0x27e4fd['options'][_0xd0ef('0xf')]||{},'attributes':['id',_0xd0ef('0x20'),'role',_0xd0ef('0x32'),'interface',_0xd0ef('0x3a'),'voicePause','mailPause',_0xd0ef('0x3b'),_0xd0ef('0x3c'),'openchannelPause',_0xd0ef('0x3d'),_0xd0ef('0x3e'),_0xd0ef('0x3f'),_0xd0ef('0x40')]});})[_0xd0ef('0x1b')](function(_0x271f06){if(!_0x271f06){throw new Error(util[_0xd0ef('0x27')](_0xd0ef('0x21'),_0x27e4fd['params']['id']));}return _0x271f06[_0xd0ef('0x41')](_0x27e4fd['body']['channel'],_0xd0ef('0x42'));})[_0xd0ef('0x1d')](function(_0x4478ac){throw _0x4478ac;});};exports[_0xd0ef('0x43')]=function(_0x1b38d8){var _0x1257c9=this;return new Promise(function(_0x378429,_0x353582){var _0x411535;return db[_0xd0ef('0xd')][_0xd0ef('0x44')]({'where':_0x1b38d8[_0xd0ef('0xe')][_0xd0ef('0xf')]||{},'attributes':['id',_0xd0ef('0x20')]})[_0xd0ef('0x1b')](function(_0x3eb58b){if(_0x3eb58b){_0x411535=_0x3eb58b;return db[_0xd0ef('0x22')][_0xd0ef('0x45')]({'where':{'membername':_0x411535[_0xd0ef('0x20')]},'individualHooks':!![]});}})[_0xd0ef('0x1b')](function(){if(_0x411535){return db['MemberReport'][_0xd0ef('0x25')]({'where':{'membername':_0x411535[_0xd0ef('0x20')],'exitAt':null}});}})['then'](function(_0x148e26){if(_0x411535){if(_0x148e26&&_0x148e26['length']){var _0xb46465=[];_0x148e26[_0xd0ef('0x46')](function(_0x4814f9){_0xb46465[_0xd0ef('0x47')](_0x4814f9[_0xd0ef('0x23')]({'exitAt':moment()[_0xd0ef('0x27')](_0xd0ef('0x28'))}));});return BPromise[_0xd0ef('0x48')](_0xb46465);}}})['then'](function(){if(_0x411535){return _0x411535['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xd0ef('0x1b')](function(_0xd9d86d){_0x378429(_0xd9d86d);})[_0xd0ef('0x1d')](function(_0x3755a1){_0x353582(_0x1257c9[_0xd0ef('0x17')](0x1f4,_0x3755a1[_0xd0ef('0x18')]));});});};exports[_0xd0ef('0x49')]=function(_0xea8f1c){var _0x1c3f07=this;return new Promise(function(_0x29894b,_0x54615f){var _0x54e21b;var _0x2ae68c;var _0x5db438;var _0x5ccdda;return db[_0xd0ef('0xd')][_0xd0ef('0x44')]({'where':_0xea8f1c[_0xd0ef('0xe')][_0xd0ef('0xf')]||{},'attributes':['id','name','role',_0xd0ef('0x4a'),_0xd0ef('0x4b'),_0xd0ef('0x32'),'loginInPause',_0xd0ef('0x2c')]})[_0xd0ef('0x1b')](function(_0x23ce85){if(_0x23ce85){_0x54e21b=_0x23ce85;_0x5ccdda=_0xea8f1c[_0xd0ef('0x2e')][_0xd0ef('0x2c')]?_0xea8f1c[_0xd0ef('0x2e')][_0xd0ef('0x2c')]:util['format'](_0xd0ef('0x2d'),_0x54e21b['name']);return db[_0xd0ef('0xd')][_0xd0ef('0x4c')]({'where':{'role':_0xd0ef('0x4d'),'online':!![],'id':{'$ne':_0x54e21b['id']}}});}})['then'](function(_0x55f4e7){if(_0x55f4e7){_0x5db438=_0x55f4e7;return require('../../config/license/util')[_0xd0ef('0x4e')]();}})[_0xd0ef('0x1b')](function(_0x49fd65){if(_0x49fd65&&_0x49fd65[_0xd0ef('0x4f')]&&_0x5db438>=_0x49fd65[_0xd0ef('0x4f')]){throw new Error(_0xd0ef('0x50'));}})['then'](function(){if(_0x54e21b){return db[_0xd0ef('0x22')][_0xd0ef('0x45')]({'where':{'membername':_0x54e21b[_0xd0ef('0x20')]},'individualHooks':!![]});}})[_0xd0ef('0x1b')](function(){if(_0x54e21b){return _0x54e21b[_0xd0ef('0x51')]({'raw':!![]});}})['then'](function(_0x38a313){if(_0x54e21b){if(_0x38a313){var _0x280426=[];_0x2ae68c=_0x38a313;if(_0x2ae68c['length']){for(var _0x481e77=0x0;_0x481e77<_0x2ae68c[_0xd0ef('0x52')];_0x481e77++){_0x280426[_0xd0ef('0x47')](db[_0xd0ef('0x22')]['upsert']({'membername':_0x54e21b['name'],'UserId':_0x54e21b['id'],'queue_name':_0x2ae68c[_0x481e77]['name'],'VoiceQueueId':_0x2ae68c[_0x481e77]['id'],'interface':_0x5ccdda,'paused':_0x54e21b['loginInPause']||![],'penalty':_0x2ae68c[_0x481e77][_0xd0ef('0x53')]||0x0}));}return BPromise[_0xd0ef('0x48')](_0x280426);}}}})[_0xd0ef('0x1b')](function(){if(_0x54e21b){return db[_0xd0ef('0x24')][_0xd0ef('0x25')]({'where':{'membername':_0x54e21b[_0xd0ef('0x20')],'exitAt':null}});}})[_0xd0ef('0x1b')](function(_0x1efa6f){if(_0x54e21b){if(_0x1efa6f&&_0x1efa6f[_0xd0ef('0x52')]){var _0x40542f=[];_0x1efa6f['forEach'](function(_0x319a59){_0x40542f[_0xd0ef('0x47')](_0x319a59[_0xd0ef('0x23')]({'exitAt':moment()[_0xd0ef('0x27')](_0xd0ef('0x28'))}));});return BPromise[_0xd0ef('0x48')](_0x40542f);}}})['then'](function(){if(_0x54e21b){var _0x46798c=[];var _0x255f14=[];var _0x41c46c=utils[_0xd0ef('0x2a')]();var _0x25ab95={'membername':_0x54e21b[_0xd0ef('0x20')],'interface':_0x5ccdda,'enterAt':moment()['format'](_0xd0ef('0x28')),'role':_0x54e21b[_0xd0ef('0x31')],'internal':_0x54e21b[_0xd0ef('0x32')]};_0x41c46c[_0xd0ef('0x46')](function(_0x54077c){_0x46798c[_0xd0ef('0x47')](_[_0xd0ef('0x54')]({'channel':_0x54077c,'type':_0xd0ef('0x55'),'data1':_0xd0ef('0x56'),'data2':_0x5ccdda},_0x25ab95));if(_0x54e21b[_0xd0ef('0x57')]){_0x255f14[_0xd0ef('0x47')](_['merge']({'channel':_0x54077c,'type':'PAUSE','data1':'LOGININPAUSE'},_0x25ab95));}});return db['MemberReport'][_0xd0ef('0x34')](_0x46798c[_0xd0ef('0x58')](_0x255f14),{'individualHooks':!![]});}})[_0xd0ef('0x1b')](function(){if(_0x54e21b){return _0x54e21b[_0xd0ef('0x23')]({'online':!![],'lastLoginAt':moment()[_0xd0ef('0x27')](_0xd0ef('0x28')),'voicePause':_0x54e21b[_0xd0ef('0x57')]||![],'mailPause':_0x54e21b['loginInPause']||![],'chatPause':_0x54e21b[_0xd0ef('0x57')]||![],'faxPause':_0x54e21b[_0xd0ef('0x57')]||![],'smsPause':_0x54e21b[_0xd0ef('0x57')]||![],'openchannelPause':_0x54e21b['loginInPause']||![],'pauseType':_0x54e21b[_0xd0ef('0x57')]?_0xd0ef('0x59'):null,'lastPauseAt':moment()[_0xd0ef('0x27')](_0xd0ef('0x28')),'interface':_0x5ccdda});}})['then'](function(_0xe2f831){_0x29894b(_0xe2f831);})['catch'](function(_0x1bd11b){_0x54615f(_0x1c3f07[_0xd0ef('0x17')](0x1f4,_0x1bd11b[_0xd0ef('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 32eb6d4..38586f1 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 _0x0f1a=['save','remove','update','removeListener','register','length','user:'];(function(_0x4b8bbe,_0x5437c0){var _0x3c189e=function(_0x51413a){while(--_0x51413a){_0x4b8bbe['push'](_0x4b8bbe['shift']());}};_0x3c189e(++_0x5437c0);}(_0x0f1a,0x70));var _0xa0f1=function(_0x5bcdb9,_0x2bef44){_0x5bcdb9=_0x5bcdb9-0x0;var _0x4f0dda=_0x0f1a[_0x5bcdb9];return _0x4f0dda;};'use strict';var UserEvents=require('./user.events');var events=[_0xa0f1('0x0'),_0xa0f1('0x1'),_0xa0f1('0x2')];function createListener(_0x4903bd,_0x3d2c47){return function(_0x3082bc){_0x3d2c47['emit'](_0x4903bd,_0x3082bc);};}function removeListener(_0x2634d0,_0x3a4350){return function(){UserEvents[_0xa0f1('0x3')](_0x2634d0,_0x3a4350);};}exports[_0xa0f1('0x4')]=function(_0x787668){for(var _0x1e5c5e=0x0,_0x266d56=events[_0xa0f1('0x5')];_0x1e5c5e<_0x266d56;_0x1e5c5e++){var _0x5eb3cb=events[_0x1e5c5e];var _0x546900=createListener(_0xa0f1('0x6')+_0x5eb3cb,_0x787668);UserEvents['on'](_0x5eb3cb,_0x546900);}}; \ No newline at end of file +var _0x50c0=['register','length','./user.events','save','remove','update','emit','removeListener'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x50c0,0x15a));var _0x050c=function(_0x133804,_0x46eafb){_0x133804=_0x133804-0x0;var _0x45b070=_0x50c0[_0x133804];return _0x45b070;};'use strict';var UserEvents=require(_0x050c('0x0'));var events=[_0x050c('0x1'),_0x050c('0x2'),_0x050c('0x3')];function createListener(_0x664e59,_0x172c11){return function(_0xd6d89b){_0x172c11[_0x050c('0x4')](_0x664e59,_0xd6d89b);};}function removeListener(_0x1dc5a6,_0xab8d6a){return function(){UserEvents[_0x050c('0x5')](_0x1dc5a6,_0xab8d6a);};}exports[_0x050c('0x6')]=function(_0x24f279){for(var _0x216098=0x0,_0x4c6aca=events[_0x050c('0x7')];_0x216098<_0x4c6aca;_0x216098++){var _0x49b9c5=events[_0x216098];var _0x1c48f0=createListener('user:'+_0x49b9c5,_0x24f279);UserEvents['on'](_0x49b9c5,_0x1c48f0);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 9a81e63..2aa9ee8 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x31dd97,_0x40afe3){var _0x2ee9ed=function(_0xa2ce6e){while(--_0xa2ce6e){_0x31dd97['push'](_0x31dd97['shift']());}};_0x2ee9ed(++_0x40afe3);}(_0xedd9,0xfc));var _0x9edd=function(_0x4e25a4,_0x4ae480){_0x4e25a4=_0x4e25a4-0x0;var _0xe23ff1=_0xedd9[_0x4e25a4];return _0xe23ff1;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x39ff9c,_0x35d13a){var _0x4ff2d2=function(_0x4017d4){while(--_0x4017d4){_0x39ff9c['push'](_0x39ff9c['shift']());}};_0x4ff2d2(++_0x35d13a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index a466096..4af7cd6 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 _0xacf9=['sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xacf9,0x1ef));var _0x9acf=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xacf9[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require(_0x9acf('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa26d=['INTEGER','sequelize'];(function(_0x405344,_0xf16b4e){var _0x457580=function(_0x30f125){while(--_0x30f125){_0x405344['push'](_0x405344['shift']());}};_0x457580(++_0xf16b4e);}(_0xa26d,0x1d7));var _0xda26=function(_0x521157,_0x4ba61d){_0x521157=_0x521157-0x0;var _0x4c57b9=_0xa26d[_0x521157];return _0x4c57b9;};'use strict';var Sequelize=require(_0xda26('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xda26('0x1')],'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 d72f00c..dbf5a3f 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 _0x8299=['path','rimraf','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','lodash','util','moment','bluebird'];(function(_0x24a470,_0x5a1d49){var _0x3a0b54=function(_0x15867e){while(--_0x15867e){_0x24a470['push'](_0x24a470['shift']());}};_0x3a0b54(++_0x5a1d49);}(_0x8299,0x15c));var _0x9829=function(_0xb855be,_0x2eecb7){_0xb855be=_0xb855be-0x0;var _0x308420=_0x8299[_0xb855be];return _0x308420;};'use strict';var _=require(_0x9829('0x0'));var util=require(_0x9829('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9829('0x2'));var BPromise=require(_0x9829('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9829('0x4'));var rimraf=require(_0x9829('0x5'));var config=require(_0x9829('0x6'));var attributes=require(_0x9829('0x7'));module[_0x9829('0x8')]=function(_0x451e4f,_0x452747){return _0x451e4f['define'](_0x9829('0x9'),attributes,{'tableName':_0x9829('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf376=['../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','request-promise','path','rimraf'];(function(_0x392a0c,_0x54e824){var _0x1fc019=function(_0x2c68d6){while(--_0x2c68d6){_0x392a0c['push'](_0x392a0c['shift']());}};_0x1fc019(++_0x54e824);}(_0xf376,0x195));var _0x6f37=function(_0x3cc6f9,_0x371571){_0x3cc6f9=_0x3cc6f9-0x0;var _0x706501=_0xf376[_0x3cc6f9];return _0x706501;};'use strict';var _=require(_0x6f37('0x0'));var util=require('util');var logger=require(_0x6f37('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6f37('0x2'));var fs=require('fs');var path=require(_0x6f37('0x3'));var rimraf=require(_0x6f37('0x4'));var config=require(_0x6f37('0x5'));var attributes=require(_0x6f37('0x6'));module['exports']=function(_0x42c7d9,_0xbb35a4){return _0x42c7d9[_0x6f37('0x7')](_0x6f37('0x8'),attributes,{'tableName':_0x6f37('0x9'),'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 2f31a37..9441971 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 _0xdad5=['message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdad5,0x1d0));var _0x5dad=function(_0x5ea57d,_0x6d03ef){_0x5ea57d=_0x5ea57d-0x0;var _0x314bee=_0xdad5[_0x5ea57d];return _0x314bee;};'use strict';var _=require(_0x5dad('0x0'));var util=require('util');var moment=require(_0x5dad('0x1'));var BPromise=require(_0x5dad('0x2'));var rs=require(_0x5dad('0x3'));var fs=require('fs');var Redis=require(_0x5dad('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5dad('0x5'));var logger=require(_0x5dad('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5dad('0x7'));var client=jayson[_0x5dad('0x8')][_0x5dad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x966e3,_0x5afa43,_0x2526f4){return new BPromise(function(_0x13b72b,_0xe52316){return client[_0x5dad('0xa')](_0x966e3,_0x2526f4)[_0x5dad('0xb')](function(_0x2da92a){logger['info'](_0x5dad('0xc'),_0x5afa43,_0x5dad('0xd'));logger[_0x5dad('0xe')](_0x5dad('0xf'),_0x5afa43,_0x5dad('0xd'),JSON[_0x5dad('0x10')](_0x2da92a));if(_0x2da92a[_0x5dad('0x11')]){if(_0x2da92a[_0x5dad('0x11')][_0x5dad('0x12')]===0x1f4){logger[_0x5dad('0x11')](_0x5dad('0xc'),_0x5afa43,_0x2da92a[_0x5dad('0x11')][_0x5dad('0x13')]);return _0xe52316(_0x2da92a['error'][_0x5dad('0x13')]);}logger[_0x5dad('0x11')](_0x5dad('0xc'),_0x5afa43,_0x2da92a[_0x5dad('0x11')][_0x5dad('0x13')]);return _0x13b72b(_0x2da92a[_0x5dad('0x11')][_0x5dad('0x13')]);}else{logger[_0x5dad('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x5afa43,_0x5dad('0xd'));_0x13b72b(_0x2da92a[_0x5dad('0x15')][_0x5dad('0x13')]);}})[_0x5dad('0x16')](function(_0x3c2c56){logger[_0x5dad('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x5afa43,_0x3c2c56);_0xe52316(_0x3c2c56);});});} \ No newline at end of file +var _0x0be6=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x16120a,_0x160670){var _0x2604e6=function(_0x83764e){while(--_0x83764e){_0x16120a['push'](_0x16120a['shift']());}};_0x2604e6(++_0x160670);}(_0x0be6,0x197));var _0x60be=function(_0x9e1bde,_0x3a35db){_0x9e1bde=_0x9e1bde-0x0;var _0x5e27d6=_0x0be6[_0x9e1bde];return _0x5e27d6;};'use strict';var _=require(_0x60be('0x0'));var util=require(_0x60be('0x1'));var moment=require(_0x60be('0x2'));var BPromise=require(_0x60be('0x3'));var rs=require(_0x60be('0x4'));var fs=require('fs');var Redis=require(_0x60be('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x60be('0x6'));var logger=require(_0x60be('0x7'))(_0x60be('0x8'));var config=require(_0x60be('0x9'));var jayson=require(_0x60be('0xa'));var client=jayson[_0x60be('0xb')][_0x60be('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x15ba45,_0x39675f,_0x33202a){return new BPromise(function(_0x2cdd14,_0x21def3){return client[_0x60be('0xd')](_0x15ba45,_0x33202a)[_0x60be('0xe')](function(_0x50219c){logger['info'](_0x60be('0xf'),_0x39675f,_0x60be('0x10'));logger[_0x60be('0x11')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x39675f,_0x60be('0x10'),JSON[_0x60be('0x12')](_0x50219c));if(_0x50219c['error']){if(_0x50219c[_0x60be('0x13')][_0x60be('0x14')]===0x1f4){logger[_0x60be('0x13')](_0x60be('0xf'),_0x39675f,_0x50219c['error'][_0x60be('0x15')]);return _0x21def3(_0x50219c[_0x60be('0x13')][_0x60be('0x15')]);}logger[_0x60be('0x13')](_0x60be('0xf'),_0x39675f,_0x50219c[_0x60be('0x13')][_0x60be('0x15')]);return _0x2cdd14(_0x50219c[_0x60be('0x13')]['message']);}else{logger[_0x60be('0x16')](_0x60be('0xf'),_0x39675f,_0x60be('0x10'));_0x2cdd14(_0x50219c[_0x60be('0x17')][_0x60be('0x15')]);}})[_0x60be('0x18')](function(_0x596180){logger[_0x60be('0x13')](_0x60be('0xf'),_0x39675f,_0x596180);_0x21def3(_0x596180);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index d1fd71b..c873a0d 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x45c8e0,_0x1e6a5c){var _0x51d990=function(_0x1abd76){while(--_0x1abd76){_0x45c8e0['push'](_0x45c8e0['shift']());}};_0x51d990(++_0x1e6a5c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0xcb91[_0x593564];return _0x211a89;};'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(_0x2e4ac8,_0x5cd8a1){var _0x196018=function(_0x4d52a6){while(--_0x4d52a6){_0x2e4ac8['push'](_0x2e4ac8['shift']());}};_0x196018(++_0x5cd8a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index b7d98c7..315a52c 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 _0x0917=['STRING','sequelize','exports','INTEGER'];(function(_0x14b1b2,_0x1f17c8){var _0x46f920=function(_0x46016b){while(--_0x46016b){_0x14b1b2['push'](_0x14b1b2['shift']());}};_0x46f920(++_0x1f17c8);}(_0x0917,0x1ed));var _0x7091=function(_0x15d18f,_0x126b0e){_0x15d18f=_0x15d18f-0x0;var _0xd12bf7=_0x0917[_0x15d18f];return _0xd12bf7;};'use strict';var Sequelize=require(_0x7091('0x0'));module[_0x7091('0x1')]={'penalty':{'type':Sequelize[_0x7091('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x7091('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x7091('0x3')]}}; \ No newline at end of file +var _0x6fca=['exports','INTEGER','sequelize'];(function(_0x1444fa,_0x55feb3){var _0x2d8802=function(_0x38d7c7){while(--_0x38d7c7){_0x1444fa['push'](_0x1444fa['shift']());}};_0x2d8802(++_0x55feb3);}(_0x6fca,0x10d));var _0xa6fc=function(_0x568a4d,_0x441a16){_0x568a4d=_0x568a4d-0x0;var _0xffa4b3=_0x6fca[_0x568a4d];return _0xffa4b3;};'use strict';var Sequelize=require(_0xa6fc('0x0'));module[_0xa6fc('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa6fc('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 561fcdb..137dfbd 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 _0xfa12=['api','moment','request-promise','path','rimraf','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger'];(function(_0x45a094,_0x47d066){var _0x557a1f=function(_0x5d7318){while(--_0x5d7318){_0x45a094['push'](_0x45a094['shift']());}};_0x557a1f(++_0x47d066);}(_0xfa12,0xcd));var _0x2fa1=function(_0x1ca4fc,_0x292296){_0x1ca4fc=_0x1ca4fc-0x0;var _0x159709=_0xfa12[_0x1ca4fc];return _0x159709;};'use strict';var _=require(_0x2fa1('0x0'));var util=require(_0x2fa1('0x1'));var logger=require(_0x2fa1('0x2'))(_0x2fa1('0x3'));var moment=require(_0x2fa1('0x4'));var BPromise=require('bluebird');var rp=require(_0x2fa1('0x5'));var fs=require('fs');var path=require(_0x2fa1('0x6'));var rimraf=require(_0x2fa1('0x7'));var config=require('../../config/environment');var attributes=require(_0x2fa1('0x8'));module[_0x2fa1('0x9')]=function(_0x543278,_0x5bbbfd){return _0x543278[_0x2fa1('0xa')](_0x2fa1('0xb'),attributes,{'tableName':_0x2fa1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb98a=['../../config/logger','moment','request-promise','path','rimraf','./userFaxQueue.attributes','define','user_has_fax_queues','util'];(function(_0x4e6179,_0x298b88){var _0xc742d3=function(_0x480ff6){while(--_0x480ff6){_0x4e6179['push'](_0x4e6179['shift']());}};_0xc742d3(++_0x298b88);}(_0xb98a,0x104));var _0xab98=function(_0x748f64,_0x1ab840){_0x748f64=_0x748f64-0x0;var _0x50a19c=_0xb98a[_0x748f64];return _0x50a19c;};'use strict';var _=require('lodash');var util=require(_0xab98('0x0'));var logger=require(_0xab98('0x1'))('api');var moment=require(_0xab98('0x2'));var BPromise=require('bluebird');var rp=require(_0xab98('0x3'));var fs=require('fs');var path=require(_0xab98('0x4'));var rimraf=require(_0xab98('0x5'));var config=require('../../config/environment');var attributes=require(_0xab98('0x6'));module['exports']=function(_0x1a6d0e,_0x1bdb55){return _0x1a6d0e[_0xab98('0x7')]('UserFaxQueue',attributes,{'tableName':_0xab98('0x8'),'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 9f7d42c..fe07fc5 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 _0xbd88=['../../config/utils','rpc','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xe65473,_0x420080){var _0x4b8d57=function(_0x5110e6){while(--_0x5110e6){_0xe65473['push'](_0xe65473['shift']());}};_0x4b8d57(++_0x420080);}(_0xbd88,0x8c));var _0x8bd8=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xbd88[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8bd8('0x0'));var rs=require(_0x8bd8('0x1'));var fs=require('fs');var Redis=require(_0x8bd8('0x2'));var db=require(_0x8bd8('0x3'))['db'];var utils=require(_0x8bd8('0x4'));var logger=require('../../config/logger')(_0x8bd8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8bd8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1179bd,_0x71850f,_0x3a2287){return new BPromise(function(_0x510047,_0x559997){return client[_0x8bd8('0x7')](_0x1179bd,_0x3a2287)['then'](function(_0x48c327){logger[_0x8bd8('0x8')](_0x8bd8('0x9'),_0x71850f,_0x8bd8('0xa'));logger[_0x8bd8('0xb')](_0x8bd8('0xc'),_0x71850f,_0x8bd8('0xa'),JSON[_0x8bd8('0xd')](_0x48c327));if(_0x48c327[_0x8bd8('0xe')]){if(_0x48c327[_0x8bd8('0xe')][_0x8bd8('0xf')]===0x1f4){logger[_0x8bd8('0xe')](_0x8bd8('0x9'),_0x71850f,_0x48c327['error'][_0x8bd8('0x10')]);return _0x559997(_0x48c327[_0x8bd8('0xe')][_0x8bd8('0x10')]);}logger['error'](_0x8bd8('0x9'),_0x71850f,_0x48c327[_0x8bd8('0xe')][_0x8bd8('0x10')]);return _0x510047(_0x48c327['error'][_0x8bd8('0x10')]);}else{logger[_0x8bd8('0x8')]('UserFaxQueue,\x20%s,\x20%s',_0x71850f,_0x8bd8('0xa'));_0x510047(_0x48c327['result'][_0x8bd8('0x10')]);}})[_0x8bd8('0x11')](function(_0x35585d){logger['error'](_0x8bd8('0x9'),_0x71850f,_0x35585d);_0x559997(_0x35585d);});});} \ No newline at end of file +var _0x812a=['request\x20sent','stringify','error','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','UserFaxQueue,\x20%s,\x20%s','debug'];(function(_0x5596ec,_0x4aa524){var _0x508a30=function(_0xdd9f3e){while(--_0xdd9f3e){_0x5596ec['push'](_0x5596ec['shift']());}};_0x508a30(++_0x4aa524);}(_0x812a,0xc4));var _0xa812=function(_0x41e264,_0x3baf9a){_0x41e264=_0x41e264-0x0;var _0x42ac0c=_0x812a[_0x41e264];return _0x42ac0c;};'use strict';var _=require(_0xa812('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa812('0x1'));var rs=require(_0xa812('0x2'));var fs=require('fs');var Redis=require(_0xa812('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa812('0x4'));var logger=require(_0xa812('0x5'))('rpc');var config=require(_0xa812('0x6'));var jayson=require(_0xa812('0x7'));var client=jayson[_0xa812('0x8')][_0xa812('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x64571c,_0x639a23,_0x3e8ae6){return new BPromise(function(_0x317b99,_0x3b77bd){return client[_0xa812('0xa')](_0x64571c,_0x3e8ae6)[_0xa812('0xb')](function(_0x17dc03){logger['info'](_0xa812('0xc'),_0x639a23,'request\x20sent');logger[_0xa812('0xd')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x639a23,_0xa812('0xe'),JSON[_0xa812('0xf')](_0x17dc03));if(_0x17dc03['error']){if(_0x17dc03['error']['code']===0x1f4){logger[_0xa812('0x10')](_0xa812('0xc'),_0x639a23,_0x17dc03[_0xa812('0x10')]['message']);return _0x3b77bd(_0x17dc03['error']['message']);}logger[_0xa812('0x10')](_0xa812('0xc'),_0x639a23,_0x17dc03[_0xa812('0x10')]['message']);return _0x317b99(_0x17dc03['error'][_0xa812('0x11')]);}else{logger[_0xa812('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x639a23,'request\x20sent');_0x317b99(_0x17dc03[_0xa812('0x13')]['message']);}})[_0xa812('0x14')](function(_0x1914d5){logger[_0xa812('0x10')](_0xa812('0xc'),_0x639a23,_0x1914d5);_0x3b77bd(_0x1914d5);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index fd54b22..dd00be9 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1315eb,_0x16d7b4){var _0x2338b6=function(_0x5f71ae){while(--_0x5f71ae){_0x1315eb['push'](_0x1315eb['shift']());}};_0x2338b6(++_0x16d7b4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3c9c2e,_0x1e7d40){var _0x269196=function(_0x1cb3c7){while(--_0x1cb3c7){_0x3c9c2e['push'](_0x3c9c2e['shift']());}};_0x269196(++_0x1e7d40);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 44498aa..eb80f53 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 _0xd819=['sequelize','exports','INTEGER'];(function(_0x4a3104,_0x4b1c89){var _0x2df5e0=function(_0x2f691d){while(--_0x2f691d){_0x4a3104['push'](_0x4a3104['shift']());}};_0x2df5e0(++_0x4b1c89);}(_0xd819,0x1d1));var _0x9d81=function(_0x8e9597,_0x2aa555){_0x8e9597=_0x8e9597-0x0;var _0x3be06a=_0xd819[_0x8e9597];return _0x3be06a;};'use strict';var Sequelize=require(_0x9d81('0x0'));module[_0x9d81('0x1')]={'penalty':{'type':Sequelize[_0x9d81('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5f98=['sequelize','INTEGER'];(function(_0x34d171,_0x2dca17){var _0x35612a=function(_0x385f80){while(--_0x385f80){_0x34d171['push'](_0x34d171['shift']());}};_0x35612a(++_0x2dca17);}(_0x5f98,0x164));var _0x85f9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f98[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x85f9('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x85f9('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index b175be5..72316aa 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 _0xde12=['./userMailQueue.attributes','exports','define','user_has_mail_queues','util','../../config/logger','path','../../config/environment'];(function(_0x7d40e6,_0x9c81fa){var _0x4134a7=function(_0x238789){while(--_0x238789){_0x7d40e6['push'](_0x7d40e6['shift']());}};_0x4134a7(++_0x9c81fa);}(_0xde12,0x6c));var _0x2de1=function(_0x4820d5,_0x30753b){_0x4820d5=_0x4820d5-0x0;var _0x1cf4c0=_0xde12[_0x4820d5];return _0x1cf4c0;};'use strict';var _=require('lodash');var util=require(_0x2de1('0x0'));var logger=require(_0x2de1('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2de1('0x2'));var rimraf=require('rimraf');var config=require(_0x2de1('0x3'));var attributes=require(_0x2de1('0x4'));module[_0x2de1('0x5')]=function(_0x2176f6,_0x514a5d){return _0x2176f6[_0x2de1('0x6')]('UserMailQueue',attributes,{'tableName':_0x2de1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a97=['api','moment','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0x6a97,0x7f));var _0x76a9=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0x6a97[_0x2d8d69];return _0x39ae22;};'use strict';var _=require(_0x76a9('0x0'));var util=require(_0x76a9('0x1'));var logger=require(_0x76a9('0x2'))(_0x76a9('0x3'));var moment=require(_0x76a9('0x4'));var BPromise=require('bluebird');var rp=require(_0x76a9('0x5'));var fs=require('fs');var path=require(_0x76a9('0x6'));var rimraf=require(_0x76a9('0x7'));var config=require(_0x76a9('0x8'));var attributes=require(_0x76a9('0x9'));module[_0x76a9('0xa')]=function(_0x3d097c,_0x2cec9e){return _0x3d097c['define'](_0x76a9('0xb'),attributes,{'tableName':_0x76a9('0xc'),'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 18b4144..8b67edc 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 _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x008c,0x188));var _0xc008=function(_0x36a3d1,_0x4a32cd){_0x36a3d1=_0x36a3d1-0x0;var _0x821ef4=_0x008c[_0x36a3d1];return _0x821ef4;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file +var _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x5e048b,_0xd45d8f){var _0x2fe688=function(_0x56080b){while(--_0x56080b){_0x5e048b['push'](_0x5e048b['shift']());}};_0x2fe688(++_0xd45d8f);}(_0x3e74,0x175));var _0x43e7=function(_0x4ebab2,_0x168b93){_0x4ebab2=_0x4ebab2-0x0;var _0x1d15c9=_0x3e74[_0x4ebab2];return _0x1d15c9;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index b62b468..d676d16 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 _0xa500=['post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x93f50a,_0x537f8b){var _0x2d5139=function(_0x20bf30){while(--_0x20bf30){_0x93f50a['push'](_0x93f50a['shift']());}};_0x2d5139(++_0x537f8b);}(_0xa500,0x115));var _0x0a50=function(_0x30a0ea,_0x157f9c){_0x30a0ea=_0x30a0ea-0x0;var _0x40a91c=_0xa500[_0x30a0ea];return _0x40a91c;};'use strict';var multer=require(_0x0a50('0x0'));var util=require(_0x0a50('0x1'));var path=require(_0x0a50('0x2'));var timeout=require(_0x0a50('0x3'));var express=require(_0x0a50('0x4'));var router=express[_0x0a50('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0a50('0x6'));var interaction=require(_0x0a50('0x7'));var config=require(_0x0a50('0x8'));var controller=require('./userNotification.controller');router[_0x0a50('0x9')]('/',auth[_0x0a50('0xa')](),controller[_0x0a50('0xb')]);module[_0x0a50('0xc')]=router; \ No newline at end of file +var _0xaad4=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path'];(function(_0x526f2d,_0x43b673){var _0x362a0a=function(_0x4f15f2){while(--_0x4f15f2){_0x526f2d['push'](_0x526f2d['shift']());}};_0x362a0a(++_0x43b673);}(_0xaad4,0x169));var _0x4aad=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xaad4[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x4aad('0x0'));var util=require(_0x4aad('0x1'));var path=require(_0x4aad('0x2'));var timeout=require('connect-timeout');var express=require(_0x4aad('0x3'));var router=express[_0x4aad('0x4')]();var fs_extra=require(_0x4aad('0x5'));var auth=require(_0x4aad('0x6'));var interaction=require(_0x4aad('0x7'));var config=require(_0x4aad('0x8'));var controller=require(_0x4aad('0x9'));router[_0x4aad('0xa')]('/',auth[_0x4aad('0xb')](),controller[_0x4aad('0xc')]);module[_0x4aad('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 ead8761..77b94dd 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 _0xf36f=['sequelize','exports','TEXT','STRING'];(function(_0x3d0ae6,_0x4ced2c){var _0x16a82b=function(_0x5c2917){while(--_0x5c2917){_0x3d0ae6['push'](_0x3d0ae6['shift']());}};_0x16a82b(++_0x4ced2c);}(_0xf36f,0x1c0));var _0xff36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf36f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xff36('0x0'));module[_0xff36('0x1')]={'body':{'type':Sequelize[_0xff36('0x2')]},'senderName':{'type':Sequelize[_0xff36('0x3')]},'recipientsId':{'type':Sequelize[_0xff36('0x2')]},'recipientsDescription':{'type':Sequelize[_0xff36('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x7437=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x7437,0x1bb));var _0x7743=function(_0x311f44,_0x1d7f5b){_0x311f44=_0x311f44-0x0;var _0x46f1e6=_0x7437[_0x311f44];return _0x46f1e6;};'use strict';var Sequelize=require(_0x7743('0x0'));module['exports']={'body':{'type':Sequelize[_0x7743('0x1')]},'senderName':{'type':Sequelize[_0x7743('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x7743('0x2')]},'beep':{'type':Sequelize[_0x7743('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 90db876..5f4fd0b 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 _0x6407=['flatten','getAgents','map','eml-format','rimraf','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','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./userNotification.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Invalid\x20\x27recipients\x27\x20object','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','isEmpty','recipientsDescription','beep','sortBy','join','sequelize','UserNotification','create','forEach','recipient','userNotification:send','catch','findOne','html','User','union','replace','Queue','ids','push','all'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x6407,0x67));var _0x7640=function(_0x5de390,_0x3b9908){_0x5de390=_0x5de390-0x0;var _0x12bf75=_0x6407[_0x5de390];return _0x12bf75;};'use strict';var emlformat=require(_0x7640('0x0'));var rimraf=require(_0x7640('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7640('0x2'));var rp=require(_0x7640('0x3'));var moment=require(_0x7640('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7640('0x5'));var util=require(_0x7640('0x6'));var path=require(_0x7640('0x7'));var sox=require(_0x7640('0x8'));var csv=require(_0x7640('0x9'));var ejs=require(_0x7640('0xa'));var fs=require('fs');var fs_extra=require(_0x7640('0xb'));var _=require(_0x7640('0xc'));var squel=require(_0x7640('0xd'));var crypto=require(_0x7640('0xe'));var jsforce=require(_0x7640('0xf'));var deskjs=require(_0x7640('0x10'));var toCsv=require(_0x7640('0x9'));var querystring=require(_0x7640('0x11'));var Papa=require(_0x7640('0x12'));var Redis=require(_0x7640('0x13'));var authService=require(_0x7640('0x14'));var qs=require(_0x7640('0x15'));var as=require(_0x7640('0x16'));var hardwareService=require(_0x7640('0x17'));var logger=require('../../config/logger')(_0x7640('0x18'));var utils=require(_0x7640('0x19'));var config=require(_0x7640('0x1a'));var licenseUtil=require(_0x7640('0x1b'));var db=require(_0x7640('0x1c'))['db'];config[_0x7640('0x1d')]=_['defaults'](config[_0x7640('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7640('0x1d')]));require(_0x7640('0x1e'))[_0x7640('0x1f')](socket);function respondWithStatusCode(_0x301aed,_0x37a707){_0x37a707=_0x37a707||0xcc;return function(_0x45d79b){if(_0x45d79b){return _0x301aed['sendStatus'](_0x37a707);}return _0x301aed['status'](_0x37a707)[_0x7640('0x20')]();};}function respondWithResult(_0x23b5ac,_0x13070e){_0x13070e=_0x13070e||0xc8;return function(_0x3e9371){if(_0x3e9371){return _0x23b5ac[_0x7640('0x21')](_0x13070e)[_0x7640('0x22')](_0x3e9371);}};}function respondWithFilteredResult(_0x2ab7a0,_0x808d09){return function(_0x114660){if(_0x114660){var _0x2a3fc2=typeof _0x808d09[_0x7640('0x23')]===_0x7640('0x24')&&typeof _0x808d09[_0x7640('0x25')]===_0x7640('0x24');var _0x5834c1=_0x114660[_0x7640('0x26')];var _0xb9c1ca=_0x2a3fc2?0x0:_0x808d09[_0x7640('0x23')];var _0x57782e=_0x2a3fc2?_0x114660[_0x7640('0x26')]:_0x808d09['offset']+_0x808d09[_0x7640('0x25')];var _0x4b7377;if(_0x57782e>=_0x5834c1){_0x57782e=_0x5834c1;_0x4b7377=0xc8;}else{_0x4b7377=0xce;}_0x2ab7a0['status'](_0x4b7377);return _0x2ab7a0[_0x7640('0x27')](_0x7640('0x28'),_0xb9c1ca+'-'+_0x57782e+'/'+_0x5834c1)[_0x7640('0x22')](_0x114660);}return null;};}function patchUpdates(_0x4b6d22){return function(_0x4bbbda){try{jsonpatch[_0x7640('0x29')](_0x4bbbda,_0x4b6d22,!![]);}catch(_0x5678f2){return BPromise[_0x7640('0x2a')](_0x5678f2);}return _0x4bbbda[_0x7640('0x2b')]();};}function saveUpdates(_0x4f28aa,_0x50d924){return function(_0x3658a2){if(_0x3658a2){return _0x3658a2[_0x7640('0x2c')](_0x4f28aa)[_0x7640('0x2d')](function(_0x264c2a){return _0x264c2a;});}return null;};}function removeEntity(_0x16164,_0x2babcd){return function(_0x104381){if(_0x104381){return _0x104381[_0x7640('0x2e')]()[_0x7640('0x2d')](function(){_0x16164[_0x7640('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5716fd,_0x184e57){return function(_0x2be55b){if(!_0x2be55b){_0x5716fd[_0x7640('0x2f')](0x194);}return _0x2be55b;};}function handleError(_0x15837f,_0x554381){_0x554381=_0x554381||0x1f4;return function(_0x43f785){logger[_0x7640('0x30')](_0x43f785[_0x7640('0x31')]);if(_0x43f785['name']){delete _0x43f785[_0x7640('0x32')];}_0x15837f['status'](_0x554381)[_0x7640('0x33')](_0x43f785);};}exports['sendUserNotification']=function(_0x32cdfc,_0x441ea3,_0x1a48e7){if(!_0x32cdfc['body']['hasOwnProperty']('text')&&!_0x32cdfc[_0x7640('0x34')][_0x7640('0x35')](_0x7640('0x36'))){throw new db[(_0x7640('0x37'))][(_0x7640('0x38'))](_0x7640('0x39'));}else{if(_0x32cdfc[_0x7640('0x34')][_0x7640('0x35')](_0x7640('0x36'))&&!_0x32cdfc[_0x7640('0x34')][_0x7640('0x35')](_0x7640('0x3a'))){throw new db[(_0x7640('0x37'))][(_0x7640('0x38'))](_0x7640('0x3b'));}if(!_0x32cdfc[_0x7640('0x34')]['hasOwnProperty'](_0x7640('0x3c'))){throw new db[(_0x7640('0x37'))][(_0x7640('0x38'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x211a24=JSON['parse'](_0x32cdfc['body'][_0x7640('0x3c')]);}catch(_0x52c009){logger[_0x7640('0x30')](_0x52c009);throw new db[(_0x7640('0x37'))][(_0x7640('0x38'))](_0x7640('0x3d'));}var _0x2e12f3=['chatqueue','faxqueue',_0x7640('0x3e'),_0x7640('0x3f'),_0x7640('0x40'),_0x7640('0x41'),_0x7640('0x42'),_0x7640('0x43'),'user'];if(_[_0x7640('0x44')](_0x211a24,function(_0x3958db){return!_[_0x7640('0x45')](_0x2e12f3,_0x3958db[_0x7640('0x46')][_0x7640('0x47')]());})){throw new db[(_0x7640('0x37'))][(_0x7640('0x38'))](_0x7640('0x48'));}}}var _0x27eb08={};_0x27eb08[_0x7640('0x49')]=_0x32cdfc['body']['hasOwnProperty'](_0x7640('0x49'))?_0x32cdfc['body']['senderName']:_0x32cdfc[_0x7640('0x4a')][_0x7640('0x4b')];_0x27eb08['recipientsDescription']=_[_0x7640('0x4c')](_0x32cdfc['body'][_0x7640('0x4d')])?null:_0x32cdfc[_0x7640('0x34')][_0x7640('0x4d')];_0x27eb08['beep']=_0x32cdfc[_0x7640('0x34')][_0x7640('0x4e')]||![];_0x27eb08['SenderId']=_0x32cdfc[_0x7640('0x4a')]['id'];return getContent(_0x32cdfc[_0x7640('0x34')])[_0x7640('0x2d')](function(_0x535eb4){_0x27eb08[_0x7640('0x34')]=_0x535eb4;return getRecipients(_0x211a24);})['then'](function(_0x1d0adb){_0x27eb08['recipientsId']=_[_0x7640('0x4f')](_0x1d0adb)[_0x7640('0x50')](',');return db[_0x7640('0x51')]['transaction'](function(_0x3db6cd){return db[_0x7640('0x52')][_0x7640('0x53')](_0x27eb08,{'raw':!![],'transaction':_0x3db6cd})[_0x7640('0x2d')](function(_0x8b8355){var _0x4f8d55={'sender':_0x27eb08['senderName'],'description':_0x27eb08[_0x7640('0x4d')],'content':_0x27eb08['body'],'beep':_0x27eb08[_0x7640('0x4e')]};_0x1d0adb[_0x7640('0x54')](function(_0x466e35){_0x4f8d55[_0x7640('0x55')]=_0x466e35;socket['emit'](_0x7640('0x56'),_0x4f8d55);});return _0x8b8355;});});})['then'](respondWithResult(_0x441ea3,0xc9))[_0x7640('0x57')](handleError(_0x441ea3,null));};function getContent(_0x5abd6d){return new BPromise(function(_0x34ab6f,_0x869b44){if(_0x5abd6d['text']){_0x34ab6f(_0x5abd6d['text']);return;}return db['Template'][_0x7640('0x58')]({'attributes':['html'],'where':{'id':_0x5abd6d[_0x7640('0x36')]},'raw':!![]})['then'](function(_0xce0aac){if(!_0xce0aac)throw new db['Sequelize']['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x1ba878=Mustache['render'](_0xce0aac[_0x7640('0x59')],_0x5abd6d['view']);_0x34ab6f(_0x1ba878);})[_0x7640('0x57')](function(_0x28a782){_0x869b44(_0x28a782);});});}function getRecipients(_0x31581f){return new BPromise(function(_0x37ffd8,_0x4db13b){var _0x160818=[];var _0x48f67f=[];_0x31581f['forEach'](function(_0x524b6d){var _0x2b2ba5=_['startCase'](_0x524b6d['model'][_0x7640('0x47')]());if(_0x2b2ba5===_0x7640('0x5a')){_0x160818=_[_0x7640('0x5b')](_0x160818,_0x524b6d['ids']);}else{if(_[_0x7640('0x45')](_0x2b2ba5,'queue'))_0x2b2ba5=_0x2b2ba5[_0x7640('0x5c')]('queue',_0x7640('0x5d'));_0x524b6d[_0x7640('0x5e')]['forEach'](function(_0xfff719){_0x48f67f[_0x7640('0x5f')](getAgents(_0x2b2ba5,_0xfff719));});}});return BPromise[_0x7640('0x60')](_0x48f67f)[_0x7640('0x2d')](function(_0x4de03e){_0x160818=_[_0x7640('0x5b')](_0x160818,_[_0x7640('0x61')](_0x4de03e));_0x37ffd8(_0x160818);})[_0x7640('0x57')](function(_0x17e550){_0x4db13b(_0x17e550);});});}function getAgents(_0x2dce4b,_0x48f2d2){return new BPromise(function(_0x343e77,_0x2ae155){return db[_0x2dce4b][_0x7640('0x58')]({'where':{'id':_0x48f2d2}})[_0x7640('0x2d')](function(_0x13fd3c){return _0x13fd3c[_0x7640('0x62')]({'attributes':['id'],'raw':!![]})[_0x7640('0x2d')](function(_0x1a08c9){var _0x21da41=_[_0x7640('0x63')](_0x1a08c9,'id');_0x343e77(_0x21da41);});})['catch'](function(_0xce5abb){_0x2ae155(_0xce5abb);});});} \ No newline at end of file +var _0x02a3=['html','Invalid\x20\x27TemplateId\x27\x20parameter','render','User','ids','replace','Queue','push','union','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Sequelize','Missing\x20\x27recipients\x27\x20parameter','parse','error','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','sortBy','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0x02a3,0xcc));var _0x302a=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x02a3[_0x616290];return _0x453879;};'use strict';var emlformat=require(_0x302a('0x0'));var rimraf=require(_0x302a('0x1'));var zipdir=require(_0x302a('0x2'));var jsonpatch=require(_0x302a('0x3'));var rp=require('request-promise');var moment=require(_0x302a('0x4'));var BPromise=require(_0x302a('0x5'));var Mustache=require('mustache');var util=require(_0x302a('0x6'));var path=require(_0x302a('0x7'));var sox=require(_0x302a('0x8'));var csv=require(_0x302a('0x9'));var ejs=require(_0x302a('0xa'));var fs=require('fs');var fs_extra=require(_0x302a('0xb'));var _=require(_0x302a('0xc'));var squel=require('squel');var crypto=require(_0x302a('0xd'));var jsforce=require(_0x302a('0xe'));var deskjs=require(_0x302a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x302a('0x10'));var Papa=require(_0x302a('0x11'));var Redis=require(_0x302a('0x12'));var authService=require(_0x302a('0x13'));var qs=require(_0x302a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x302a('0x15'));var utils=require(_0x302a('0x16'));var config=require(_0x302a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x302a('0x18'))['db'];config[_0x302a('0x19')]=_['defaults'](config[_0x302a('0x19')],{'host':_0x302a('0x1a'),'port':0x18eb});var socket=require(_0x302a('0x1b'))(new Redis(config['redis']));require('./userNotification.socket')[_0x302a('0x1c')](socket);function respondWithStatusCode(_0x54a3e1,_0x564e79){_0x564e79=_0x564e79||0xcc;return function(_0x2d0269){if(_0x2d0269){return _0x54a3e1[_0x302a('0x1d')](_0x564e79);}return _0x54a3e1[_0x302a('0x1e')](_0x564e79)[_0x302a('0x1f')]();};}function respondWithResult(_0x49959a,_0x4f21dc){_0x4f21dc=_0x4f21dc||0xc8;return function(_0x52d8d1){if(_0x52d8d1){return _0x49959a[_0x302a('0x1e')](_0x4f21dc)[_0x302a('0x20')](_0x52d8d1);}};}function respondWithFilteredResult(_0x320c8a,_0x3665fa){return function(_0x1064cf){if(_0x1064cf){var _0x324296=typeof _0x3665fa[_0x302a('0x21')]===_0x302a('0x22')&&typeof _0x3665fa['limit']===_0x302a('0x22');var _0xedf98e=_0x1064cf[_0x302a('0x23')];var _0x48294e=_0x324296?0x0:_0x3665fa[_0x302a('0x21')];var _0x101ff4=_0x324296?_0x1064cf[_0x302a('0x23')]:_0x3665fa[_0x302a('0x21')]+_0x3665fa[_0x302a('0x24')];var _0x24ea2a;if(_0x101ff4>=_0xedf98e){_0x101ff4=_0xedf98e;_0x24ea2a=0xc8;}else{_0x24ea2a=0xce;}_0x320c8a[_0x302a('0x1e')](_0x24ea2a);return _0x320c8a[_0x302a('0x25')]('Content-Range',_0x48294e+'-'+_0x101ff4+'/'+_0xedf98e)['json'](_0x1064cf);}return null;};}function patchUpdates(_0x2a192a){return function(_0xda103f){try{jsonpatch[_0x302a('0x26')](_0xda103f,_0x2a192a,!![]);}catch(_0x30ff93){return BPromise[_0x302a('0x27')](_0x30ff93);}return _0xda103f[_0x302a('0x28')]();};}function saveUpdates(_0xc717d9,_0x3615ab){return function(_0x45659f){if(_0x45659f){return _0x45659f['update'](_0xc717d9)[_0x302a('0x29')](function(_0x407a5a){return _0x407a5a;});}return null;};}function removeEntity(_0x5a88a1,_0x3d01e8){return function(_0x347ee6){if(_0x347ee6){return _0x347ee6['destroy']()['then'](function(){_0x5a88a1['status'](0xcc)[_0x302a('0x1f')]();});}};}function handleEntityNotFound(_0x25216b,_0x43f475){return function(_0x1feaed){if(!_0x1feaed){_0x25216b[_0x302a('0x1d')](0x194);}return _0x1feaed;};}function handleError(_0xd10165,_0x23b2d3){_0x23b2d3=_0x23b2d3||0x1f4;return function(_0x3db011){logger['error'](_0x3db011[_0x302a('0x2a')]);if(_0x3db011[_0x302a('0x2b')]){delete _0x3db011[_0x302a('0x2b')];}_0xd10165[_0x302a('0x1e')](_0x23b2d3)[_0x302a('0x2c')](_0x3db011);};}exports[_0x302a('0x2d')]=function(_0x16ba4d,_0x321f6b,_0x510202){if(!_0x16ba4d[_0x302a('0x2e')][_0x302a('0x2f')](_0x302a('0x30'))&&!_0x16ba4d['body'][_0x302a('0x2f')](_0x302a('0x31'))){throw new db['Sequelize'][(_0x302a('0x32'))](_0x302a('0x33'));}else{if(_0x16ba4d[_0x302a('0x2e')][_0x302a('0x2f')](_0x302a('0x31'))&&!_0x16ba4d[_0x302a('0x2e')]['hasOwnProperty'](_0x302a('0x34'))){throw new db['Sequelize'][(_0x302a('0x32'))](_0x302a('0x35'));}if(!_0x16ba4d[_0x302a('0x2e')][_0x302a('0x2f')](_0x302a('0x36'))){throw new db[(_0x302a('0x37'))][(_0x302a('0x32'))](_0x302a('0x38'));}else{try{var _0x3efdb1=JSON[_0x302a('0x39')](_0x16ba4d[_0x302a('0x2e')][_0x302a('0x36')]);}catch(_0x23a1dd){logger[_0x302a('0x3a')](_0x23a1dd);throw new db[(_0x302a('0x37'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0xdd2535=['chatqueue','faxqueue',_0x302a('0x3b'),_0x302a('0x3c'),_0x302a('0x3d'),_0x302a('0x3e'),_0x302a('0x3f'),'team',_0x302a('0x40')];if(_['some'](_0x3efdb1,function(_0x11472c){return!_[_0x302a('0x41')](_0xdd2535,_0x11472c[_0x302a('0x42')][_0x302a('0x43')]());})){throw new db[(_0x302a('0x37'))][(_0x302a('0x32'))](_0x302a('0x44'));}}}var _0x1aed22={};_0x1aed22[_0x302a('0x45')]=_0x16ba4d[_0x302a('0x2e')][_0x302a('0x2f')](_0x302a('0x45'))?_0x16ba4d[_0x302a('0x2e')][_0x302a('0x45')]:_0x16ba4d['user'][_0x302a('0x46')];_0x1aed22['recipientsDescription']=_[_0x302a('0x47')](_0x16ba4d[_0x302a('0x2e')][_0x302a('0x48')])?null:_0x16ba4d['body'][_0x302a('0x48')];_0x1aed22[_0x302a('0x49')]=_0x16ba4d['body'][_0x302a('0x49')]||![];_0x1aed22[_0x302a('0x4a')]=_0x16ba4d['user']['id'];return getContent(_0x16ba4d[_0x302a('0x2e')])[_0x302a('0x29')](function(_0x107ca3){_0x1aed22[_0x302a('0x2e')]=_0x107ca3;return getRecipients(_0x3efdb1);})['then'](function(_0x4540c5){_0x1aed22['recipientsId']=_[_0x302a('0x4b')](_0x4540c5)['join'](',');return db['sequelize']['transaction'](function(_0x1e1aad){return db[_0x302a('0x4c')][_0x302a('0x4d')](_0x1aed22,{'raw':!![],'transaction':_0x1e1aad})[_0x302a('0x29')](function(_0x1d3390){var _0x45a2c9={'sender':_0x1aed22[_0x302a('0x45')],'description':_0x1aed22[_0x302a('0x48')],'content':_0x1aed22[_0x302a('0x2e')],'beep':_0x1aed22[_0x302a('0x49')]};_0x4540c5[_0x302a('0x4e')](function(_0x39fee3){_0x45a2c9[_0x302a('0x4f')]=_0x39fee3;socket[_0x302a('0x50')](_0x302a('0x51'),_0x45a2c9);});return _0x1d3390;});});})[_0x302a('0x29')](respondWithResult(_0x321f6b,0xc9))[_0x302a('0x52')](handleError(_0x321f6b,null));};function getContent(_0x156176){return new BPromise(function(_0x35ddce,_0x181c76){if(_0x156176[_0x302a('0x30')]){_0x35ddce(_0x156176[_0x302a('0x30')]);return;}return db[_0x302a('0x53')]['findOne']({'attributes':[_0x302a('0x54')],'where':{'id':_0x156176[_0x302a('0x31')]},'raw':!![]})[_0x302a('0x29')](function(_0x1520c2){if(!_0x1520c2)throw new db[(_0x302a('0x37'))][(_0x302a('0x32'))](_0x302a('0x55'));var _0x1fb663=Mustache[_0x302a('0x56')](_0x1520c2[_0x302a('0x54')],_0x156176[_0x302a('0x34')]);_0x35ddce(_0x1fb663);})['catch'](function(_0x2740d3){_0x181c76(_0x2740d3);});});}function getRecipients(_0x1e291e){return new BPromise(function(_0x4569f4,_0x117645){var _0x579704=[];var _0x3a9aaa=[];_0x1e291e['forEach'](function(_0x3bb72b){var _0xd1b1aa=_['startCase'](_0x3bb72b[_0x302a('0x42')][_0x302a('0x43')]());if(_0xd1b1aa===_0x302a('0x57')){_0x579704=_['union'](_0x579704,_0x3bb72b[_0x302a('0x58')]);}else{if(_[_0x302a('0x41')](_0xd1b1aa,'queue'))_0xd1b1aa=_0xd1b1aa[_0x302a('0x59')]('queue',_0x302a('0x5a'));_0x3bb72b[_0x302a('0x58')][_0x302a('0x4e')](function(_0x8207fa){_0x3a9aaa[_0x302a('0x5b')](getAgents(_0xd1b1aa,_0x8207fa));});}});return BPromise['all'](_0x3a9aaa)[_0x302a('0x29')](function(_0x590616){_0x579704=_[_0x302a('0x5c')](_0x579704,_['flatten'](_0x590616));_0x4569f4(_0x579704);})[_0x302a('0x52')](function(_0x3c270c){_0x117645(_0x3c270c);});});}function getAgents(_0x234d86,_0x41c24b){return new BPromise(function(_0x1fe37a,_0x48c98c){return db[_0x234d86][_0x302a('0x5d')]({'where':{'id':_0x41c24b}})[_0x302a('0x29')](function(_0x3b5d4d){return _0x3b5d4d[_0x302a('0x5e')]({'attributes':['id'],'raw':!![]})[_0x302a('0x29')](function(_0x4f7f20){var _0x456b92=_[_0x302a('0x5f')](_0x4f7f20,'id');_0x1fe37a(_0x456b92);});})[_0x302a('0x52')](function(_0x4dda50){_0x48c98c(_0x4dda50);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 27937a4..84ea052 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 _0x1576=['exports','UserNotification','save','emit','hasOwnProperty'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x1576,0x10f));var _0x6157=function(_0x3d064a,_0x12cf18){_0x3d064a=_0x3d064a-0x0;var _0x5b2a83=_0x1576[_0x3d064a];return _0x5b2a83;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0x6157('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6157('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x59c915){return function(_0x188b22,_0x2a6bd8,_0x24857d){UserNotificationEvents[_0x6157('0x2')](_0x59c915+':'+_0x188b22['id'],_0x188b22);UserNotificationEvents['emit'](_0x59c915,_0x188b22);_0x24857d(null);};}for(var e in events){if(events[_0x6157('0x3')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x6157('0x4')]=UserNotificationEvents; \ No newline at end of file +var _0x1067=['hook','exports','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x3b76e9,_0x39efb2){var _0x43489c=function(_0x1040a9){while(--_0x1040a9){_0x3b76e9['push'](_0x3b76e9['shift']());}};_0x43489c(++_0x39efb2);}(_0x1067,0x6a));var _0x7106=function(_0x185f94,_0x216238){_0x185f94=_0x185f94-0x0;var _0x34a698=_0x1067[_0x185f94];return _0x34a698;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x7106('0x0'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x7106('0x1')](0x0);var events={'afterCreate':_0x7106('0x2'),'afterUpdate':_0x7106('0x3'),'afterDestroy':_0x7106('0x4')};function emitEvent(_0x1378a0){return function(_0x115416,_0x360ab7,_0x1e7345){UserNotificationEvents[_0x7106('0x5')](_0x1378a0+':'+_0x115416['id'],_0x115416);UserNotificationEvents['emit'](_0x1378a0,_0x115416);_0x1e7345(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x7106('0x6')](e,emitEvent(event));}}module[_0x7106('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 32e314a..4001545 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 _0xf447=['UserNotification','userNotifications','utf8mb4_unicode_ci','lodash','bluebird','request-promise','path','./userNotification.attributes','define'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf447,0x1b3));var _0x7f44=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xf447[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0x7f44('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7f44('0x1'));var rp=require(_0x7f44('0x2'));var fs=require('fs');var path=require(_0x7f44('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7f44('0x4'));module['exports']=function(_0x4491f0,_0x65b829){return _0x4491f0[_0x7f44('0x5')](_0x7f44('0x6'),attributes,{'tableName':_0x7f44('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7f44('0x8')});}; \ No newline at end of file +var _0x0274=['utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path','exports','UserNotification','userNotifications','utf8mb4'];(function(_0x50d9b3,_0x4f5865){var _0x9f69c1=function(_0x117dd3){while(--_0x117dd3){_0x50d9b3['push'](_0x50d9b3['shift']());}};_0x9f69c1(++_0x4f5865);}(_0x0274,0x1e1));var _0x4027=function(_0x34e6c2,_0x57a7f0){_0x34e6c2=_0x34e6c2-0x0;var _0x299fbf=_0x0274[_0x34e6c2];return _0x299fbf;};'use strict';var _=require(_0x4027('0x0'));var util=require('util');var logger=require(_0x4027('0x1'))('api');var moment=require(_0x4027('0x2'));var BPromise=require(_0x4027('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4027('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module[_0x4027('0x5')]=function(_0x44c8be,_0x580079){return _0x44c8be['define'](_0x4027('0x6'),attributes,{'tableName':_0x4027('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4027('0x8'),'collate':_0x4027('0x9')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 9d0b1fd..2e4ba1b 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 _0x52bf=['then','info','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','request'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x52bf,0xb9));var _0xf52b=function(_0x1917df,_0x3ae53b){_0x1917df=_0x1917df-0x0;var _0x5c092f=_0x52bf[_0x1917df];return _0x5c092f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf52b('0x0'));var BPromise=require(_0xf52b('0x1'));var rs=require(_0xf52b('0x2'));var fs=require('fs');var Redis=require(_0xf52b('0x3'));var db=require(_0xf52b('0x4'))['db'];var utils=require(_0xf52b('0x5'));var logger=require('../../config/logger')(_0xf52b('0x6'));var config=require(_0xf52b('0x7'));var jayson=require(_0xf52b('0x8'));var client=jayson[_0xf52b('0x9')][_0xf52b('0xa')]({'port':0x232a});config['redis']=_[_0xf52b('0xb')](config[_0xf52b('0xc')],{'host':_0xf52b('0xd'),'port':0x18eb});var socket=require(_0xf52b('0xe'))(new Redis(config['redis']));require(_0xf52b('0xf'))[_0xf52b('0x10')](socket);function respondWithRpcPromise(_0x59a67e,_0x4d71ee,_0x51b6f9){return new BPromise(function(_0x582753,_0x60447b){return client[_0xf52b('0x11')](_0x59a67e,_0x51b6f9)[_0xf52b('0x12')](function(_0x1a2f66){logger[_0xf52b('0x13')]('UserNotification,\x20%s,\x20%s',_0x4d71ee,'request\x20sent');logger[_0xf52b('0x14')](_0xf52b('0x15'),_0x4d71ee,_0xf52b('0x16'),JSON[_0xf52b('0x17')](_0x1a2f66));if(_0x1a2f66[_0xf52b('0x18')]){if(_0x1a2f66['error'][_0xf52b('0x19')]===0x1f4){logger[_0xf52b('0x18')](_0xf52b('0x1a'),_0x4d71ee,_0x1a2f66[_0xf52b('0x18')][_0xf52b('0x1b')]);return _0x60447b(_0x1a2f66[_0xf52b('0x18')][_0xf52b('0x1b')]);}logger[_0xf52b('0x18')]('UserNotification,\x20%s,\x20%s',_0x4d71ee,_0x1a2f66[_0xf52b('0x18')][_0xf52b('0x1b')]);return _0x582753(_0x1a2f66[_0xf52b('0x18')][_0xf52b('0x1b')]);}else{logger[_0xf52b('0x13')](_0xf52b('0x1a'),_0x4d71ee,_0xf52b('0x16'));_0x582753(_0x1a2f66[_0xf52b('0x1c')][_0xf52b('0x1b')]);}})['catch'](function(_0x552988){logger[_0xf52b('0x18')](_0xf52b('0x1a'),_0x4d71ee,_0x552988);_0x60447b(_0x552988);});});} \ No newline at end of file +var _0x9974=['register','then','info','request\x20sent','debug','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','./userNotification.socket'];(function(_0x3e0d44,_0xc4f9ff){var _0x297f42=function(_0xb5a246){while(--_0xb5a246){_0x3e0d44['push'](_0x3e0d44['shift']());}};_0x297f42(++_0xc4f9ff);}(_0x9974,0x165));var _0x4997=function(_0xf71a04,_0x5ded86){_0xf71a04=_0xf71a04-0x0;var _0x4890fd=_0x9974[_0xf71a04];return _0x4890fd;};'use strict';var _=require(_0x4997('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4997('0x1'));var db=require(_0x4997('0x2'))['db'];var utils=require(_0x4997('0x3'));var logger=require(_0x4997('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4997('0x5'));var client=jayson[_0x4997('0x6')][_0x4997('0x7')]({'port':0x232a});config[_0x4997('0x8')]=_[_0x4997('0x9')](config[_0x4997('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4997('0x8')]));require(_0x4997('0xa'))[_0x4997('0xb')](socket);function respondWithRpcPromise(_0xbf4a4f,_0x16039c,_0x11bf40){return new BPromise(function(_0x2d0e87,_0x35eb40){return client['request'](_0xbf4a4f,_0x11bf40)[_0x4997('0xc')](function(_0x30ae13){logger[_0x4997('0xd')]('UserNotification,\x20%s,\x20%s',_0x16039c,_0x4997('0xe'));logger[_0x4997('0xf')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x16039c,_0x4997('0xe'),JSON[_0x4997('0x10')](_0x30ae13));if(_0x30ae13[_0x4997('0x11')]){if(_0x30ae13['error'][_0x4997('0x12')]===0x1f4){logger[_0x4997('0x11')](_0x4997('0x13'),_0x16039c,_0x30ae13[_0x4997('0x11')]['message']);return _0x35eb40(_0x30ae13['error'][_0x4997('0x14')]);}logger['error'](_0x4997('0x13'),_0x16039c,_0x30ae13['error']['message']);return _0x2d0e87(_0x30ae13[_0x4997('0x11')][_0x4997('0x14')]);}else{logger[_0x4997('0xd')](_0x4997('0x13'),_0x16039c,_0x4997('0xe'));_0x2d0e87(_0x30ae13[_0x4997('0x15')][_0x4997('0x14')]);}})[_0x4997('0x16')](function(_0x8db8f5){logger[_0x4997('0x11')](_0x4997('0x13'),_0x16039c,_0x8db8f5);_0x35eb40(_0x8db8f5);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index ca3123b..61e94aa 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 _0xff32=['removeListener','register','length','userNotification:','save','remove','update','emit'];(function(_0x56bc1c,_0x1368f5){var _0x2461bd=function(_0x2b963b){while(--_0x2b963b){_0x56bc1c['push'](_0x56bc1c['shift']());}};_0x2461bd(++_0x1368f5);}(_0xff32,0xec));var _0x2ff3=function(_0xbcd604,_0x5c6862){_0xbcd604=_0xbcd604-0x0;var _0x16a71e=_0xff32[_0xbcd604];return _0x16a71e;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x2ff3('0x0'),_0x2ff3('0x1'),_0x2ff3('0x2')];function createListener(_0x2fd59d,_0x1bb6d8){return function(_0x344f99){_0x1bb6d8[_0x2ff3('0x3')](_0x2fd59d,_0x344f99);};}function removeListener(_0x58238d,_0x53f03d){return function(){UserNotificationEvents[_0x2ff3('0x4')](_0x58238d,_0x53f03d);};}exports[_0x2ff3('0x5')]=function(_0x1960a5){for(var _0x2652f4=0x0,_0x3465b5=events[_0x2ff3('0x6')];_0x2652f4<_0x3465b5;_0x2652f4++){var _0xd67cea=events[_0x2652f4];var _0x1d81b9=createListener(_0x2ff3('0x7')+_0xd67cea,_0x1960a5);UserNotificationEvents['on'](_0xd67cea,_0x1d81b9);}}; \ No newline at end of file +var _0x80e2=['register','length','userNotification:','./userNotification.events','save','remove','update','emit','removeListener'];(function(_0x462753,_0x18db45){var _0x241048=function(_0x165ef6){while(--_0x165ef6){_0x462753['push'](_0x462753['shift']());}};_0x241048(++_0x18db45);}(_0x80e2,0x1e0));var _0x280e=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0x80e2[_0x51b0dc];return _0x13fa89;};'use strict';var UserNotificationEvents=require(_0x280e('0x0'));var events=[_0x280e('0x1'),_0x280e('0x2'),_0x280e('0x3')];function createListener(_0x50b99c,_0x3ffe78){return function(_0x8ab651){_0x3ffe78[_0x280e('0x4')](_0x50b99c,_0x8ab651);};}function removeListener(_0x4efec4,_0x60830e){return function(){UserNotificationEvents[_0x280e('0x5')](_0x4efec4,_0x60830e);};}exports[_0x280e('0x6')]=function(_0x2fa600){for(var _0x57a717=0x0,_0x4f4f6a=events[_0x280e('0x7')];_0x57a717<_0x4f4f6a;_0x57a717++){var _0x2e4c1d=events[_0x57a717];var _0x352a4a=createListener(_0x280e('0x8')+_0x2e4c1d,_0x2fa600);UserNotificationEvents['on'](_0x2e4c1d,_0x352a4a);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 2904c9a..d24ba83 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x325276,_0x3ec4fc){var _0x2667ac=function(_0x4d792e){while(--_0x4d792e){_0x325276['push'](_0x325276['shift']());}};_0x2667ac(++_0x3ec4fc);}(_0xe706,0xa3));var _0x6e70=function(_0x9d58e0,_0x5ee515){_0x9d58e0=_0x9d58e0-0x0;var _0x5eab07=_0xe706[_0x9d58e0];return _0x5eab07;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3735ac,_0x5e09fe){var _0x5299bb=function(_0x19d895){while(--_0x19d895){_0x3735ac['push'](_0x3735ac['shift']());}};_0x5299bb(++_0x5e09fe);}(_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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index e2c84ba..22dbeec 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 _0x2bae=['exports','INTEGER','sequelize'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x2bae,0x164));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe2ba('0x0'));module[_0xe2ba('0x1')]={'penalty':{'type':Sequelize[_0xe2ba('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa149=['INTEGER','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa149,0xb5));var _0x9a14=function(_0x1ac4a4,_0x446c14){_0x1ac4a4=_0x1ac4a4-0x0;var _0x2c613b=_0xa149[_0x1ac4a4];return _0x2c613b;};'use strict';var Sequelize=require(_0x9a14('0x0'));module[_0x9a14('0x1')]={'penalty':{'type':Sequelize[_0x9a14('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index b49dbbc..f01ed42 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 _0x5e99=['exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x5e99,0x1f1));var _0x95e9=function(_0x12dac1,_0x1fa2d1){_0x12dac1=_0x12dac1-0x0;var _0x29a747=_0x5e99[_0x12dac1];return _0x29a747;};'use strict';var _=require(_0x95e9('0x0'));var util=require(_0x95e9('0x1'));var logger=require(_0x95e9('0x2'))(_0x95e9('0x3'));var moment=require(_0x95e9('0x4'));var BPromise=require(_0x95e9('0x5'));var rp=require(_0x95e9('0x6'));var fs=require('fs');var path=require(_0x95e9('0x7'));var rimraf=require('rimraf');var config=require(_0x95e9('0x8'));var attributes=require(_0x95e9('0x9'));module[_0x95e9('0xa')]=function(_0x4e56f1,_0x4dee36){return _0x4e56f1['define'](_0x95e9('0xb'),attributes,{'tableName':_0x95e9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe806=['moment','bluebird','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xe806,0x1dd));var _0x6e80=function(_0xc984b4,_0x26487c){_0xc984b4=_0xc984b4-0x0;var _0x2af115=_0xe806[_0xc984b4];return _0x2af115;};'use strict';var _=require(_0x6e80('0x0'));var util=require(_0x6e80('0x1'));var logger=require('../../config/logger')(_0x6e80('0x2'));var moment=require(_0x6e80('0x3'));var BPromise=require(_0x6e80('0x4'));var rp=require(_0x6e80('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e80('0x6'));var config=require(_0x6e80('0x7'));var attributes=require(_0x6e80('0x8'));module[_0x6e80('0x9')]=function(_0x242675,_0x1d6209){return _0x242675['define'](_0x6e80('0xa'),attributes,{'tableName':_0x6e80('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 0c37168..c020602 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 _0xcd3f=['then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x1ddf9a,_0x2e40b5){var _0xde6e79=function(_0xb1ebe){while(--_0xb1ebe){_0x1ddf9a['push'](_0x1ddf9a['shift']());}};_0xde6e79(++_0x2e40b5);}(_0xcd3f,0x114));var _0xfcd3=function(_0x159b6b,_0x52d23f){_0x159b6b=_0x159b6b-0x0;var _0x2dceb3=_0xcd3f[_0x159b6b];return _0x2dceb3;};'use strict';var _=require(_0xfcd3('0x0'));var util=require(_0xfcd3('0x1'));var moment=require(_0xfcd3('0x2'));var BPromise=require('bluebird');var rs=require(_0xfcd3('0x3'));var fs=require('fs');var Redis=require(_0xfcd3('0x4'));var db=require(_0xfcd3('0x5'))['db'];var utils=require(_0xfcd3('0x6'));var logger=require(_0xfcd3('0x7'))('rpc');var config=require(_0xfcd3('0x8'));var jayson=require(_0xfcd3('0x9'));var client=jayson[_0xfcd3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x298027,_0x458663,_0x5f0429){return new BPromise(function(_0x535a33,_0x5b5b28){return client[_0xfcd3('0xb')](_0x298027,_0x5f0429)[_0xfcd3('0xc')](function(_0x2c32a0){logger[_0xfcd3('0xd')](_0xfcd3('0xe'),_0x458663,_0xfcd3('0xf'));logger[_0xfcd3('0x10')](_0xfcd3('0x11'),_0x458663,_0xfcd3('0xf'),JSON[_0xfcd3('0x12')](_0x2c32a0));if(_0x2c32a0[_0xfcd3('0x13')]){if(_0x2c32a0[_0xfcd3('0x13')][_0xfcd3('0x14')]===0x1f4){logger[_0xfcd3('0x13')](_0xfcd3('0xe'),_0x458663,_0x2c32a0[_0xfcd3('0x13')][_0xfcd3('0x15')]);return _0x5b5b28(_0x2c32a0['error']['message']);}logger[_0xfcd3('0x13')](_0xfcd3('0xe'),_0x458663,_0x2c32a0[_0xfcd3('0x13')][_0xfcd3('0x15')]);return _0x535a33(_0x2c32a0['error']['message']);}else{logger[_0xfcd3('0xd')](_0xfcd3('0xe'),_0x458663,_0xfcd3('0xf'));_0x535a33(_0x2c32a0[_0xfcd3('0x16')]['message']);}})[_0xfcd3('0x17')](function(_0x5d3ead){logger[_0xfcd3('0x13')](_0xfcd3('0xe'),_0x458663,_0x5d3ead);_0x5b5b28(_0x5d3ead);});});} \ No newline at end of file +var _0x7df1=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x7df1,0x1c4));var _0x17df=function(_0x2c77f9,_0x403ab6){_0x2c77f9=_0x2c77f9-0x0;var _0x288757=_0x7df1[_0x2c77f9];return _0x288757;};'use strict';var _=require(_0x17df('0x0'));var util=require(_0x17df('0x1'));var moment=require('moment');var BPromise=require(_0x17df('0x2'));var rs=require(_0x17df('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x17df('0x4'))['db'];var utils=require(_0x17df('0x5'));var logger=require(_0x17df('0x6'))(_0x17df('0x7'));var config=require(_0x17df('0x8'));var jayson=require(_0x17df('0x9'));var client=jayson[_0x17df('0xa')][_0x17df('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x549ea2,_0x3e4969,_0x4e0683){return new BPromise(function(_0x556b7c,_0x399f4a){return client[_0x17df('0xc')](_0x549ea2,_0x4e0683)[_0x17df('0xd')](function(_0x363ea0){logger[_0x17df('0xe')](_0x17df('0xf'),_0x3e4969,_0x17df('0x10'));logger[_0x17df('0x11')](_0x17df('0x12'),_0x3e4969,_0x17df('0x10'),JSON['stringify'](_0x363ea0));if(_0x363ea0['error']){if(_0x363ea0[_0x17df('0x13')][_0x17df('0x14')]===0x1f4){logger[_0x17df('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x3e4969,_0x363ea0[_0x17df('0x13')][_0x17df('0x15')]);return _0x399f4a(_0x363ea0[_0x17df('0x13')][_0x17df('0x15')]);}logger['error'](_0x17df('0xf'),_0x3e4969,_0x363ea0[_0x17df('0x13')][_0x17df('0x15')]);return _0x556b7c(_0x363ea0[_0x17df('0x13')][_0x17df('0x15')]);}else{logger[_0x17df('0xe')](_0x17df('0xf'),_0x3e4969,_0x17df('0x10'));_0x556b7c(_0x363ea0[_0x17df('0x16')][_0x17df('0x15')]);}})[_0x17df('0x17')](function(_0x1c4f74){logger[_0x17df('0x13')](_0x17df('0xf'),_0x3e4969,_0x1c4f74);_0x399f4a(_0x1c4f74);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 3d16d0d..5d94d37 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 _0x2e8f=['put','update','destroy','delete','/:id/sections','removeSections','removeResources','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/:id','show','getSections','/:id/resources','getResources','/:id/clone','addSections','addResources'];(function(_0x143c8a,_0x5b7419){var _0x32f977=function(_0x55da30){while(--_0x55da30){_0x143c8a['push'](_0x143c8a['shift']());}};_0x32f977(++_0x5b7419);}(_0x2e8f,0x159));var _0xf2e8=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0x2e8f[_0x5c3ae9];return _0x3f5950;};'use strict';var multer=require(_0xf2e8('0x0'));var util=require(_0xf2e8('0x1'));var path=require(_0xf2e8('0x2'));var timeout=require('connect-timeout');var express=require(_0xf2e8('0x3'));var router=express['Router']();var fs_extra=require(_0xf2e8('0x4'));var auth=require(_0xf2e8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf2e8('0x6'));var controller=require(_0xf2e8('0x7'));router[_0xf2e8('0x8')]('/',auth[_0xf2e8('0x9')](),controller[_0xf2e8('0xa')]);router[_0xf2e8('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xf2e8('0x8')](_0xf2e8('0xb'),auth[_0xf2e8('0x9')](),controller[_0xf2e8('0xc')]);router[_0xf2e8('0x8')]('/:id/sections',auth[_0xf2e8('0x9')](),controller[_0xf2e8('0xd')]);router[_0xf2e8('0x8')](_0xf2e8('0xe'),auth[_0xf2e8('0x9')](),controller[_0xf2e8('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xf2e8('0x10'),auth[_0xf2e8('0x9')](),controller['clone']);router['post']('/:id/sections',auth[_0xf2e8('0x9')](),controller[_0xf2e8('0x11')]);router['post'](_0xf2e8('0xe'),auth[_0xf2e8('0x9')](),controller[_0xf2e8('0x12')]);router[_0xf2e8('0x13')](_0xf2e8('0xb'),auth['isAuthenticated'](),controller[_0xf2e8('0x14')]);router['delete']('/:id',auth[_0xf2e8('0x9')](),controller[_0xf2e8('0x15')]);router[_0xf2e8('0x16')](_0xf2e8('0x17'),auth[_0xf2e8('0x9')](),controller[_0xf2e8('0x18')]);router[_0xf2e8('0x16')]('/:id/resources',auth[_0xf2e8('0x9')](),controller[_0xf2e8('0x19')]);module['exports']=router; \ No newline at end of file +var _0x6bf2=['post','/:id/clone','addSections','put','update','delete','destroy','removeSections','removeResources','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','index','isAuthenticated','describe','/:id','show','/:id/sections','/:id/resources','getResources'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x6bf2,0x1e6));var _0x26bf=function(_0x5a9d94,_0x2c9dd1){_0x5a9d94=_0x5a9d94-0x0;var _0x395979=_0x6bf2[_0x5a9d94];return _0x395979;};'use strict';var multer=require(_0x26bf('0x0'));var util=require('util');var path=require(_0x26bf('0x1'));var timeout=require(_0x26bf('0x2'));var express=require(_0x26bf('0x3'));var router=express['Router']();var fs_extra=require(_0x26bf('0x4'));var auth=require(_0x26bf('0x5'));var interaction=require(_0x26bf('0x6'));var config=require(_0x26bf('0x7'));var controller=require(_0x26bf('0x8'));router[_0x26bf('0x9')]('/',auth['isAuthenticated'](),controller[_0x26bf('0xa')]);router[_0x26bf('0x9')]('/describe',auth[_0x26bf('0xb')](),controller[_0x26bf('0xc')]);router[_0x26bf('0x9')](_0x26bf('0xd'),auth[_0x26bf('0xb')](),controller[_0x26bf('0xe')]);router['get'](_0x26bf('0xf'),auth[_0x26bf('0xb')](),controller['getSections']);router['get'](_0x26bf('0x10'),auth[_0x26bf('0xb')](),controller[_0x26bf('0x11')]);router[_0x26bf('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x26bf('0x13'),auth[_0x26bf('0xb')](),controller['clone']);router['post'](_0x26bf('0xf'),auth[_0x26bf('0xb')](),controller[_0x26bf('0x14')]);router['post'](_0x26bf('0x10'),auth[_0x26bf('0xb')](),controller['addResources']);router[_0x26bf('0x15')](_0x26bf('0xd'),auth[_0x26bf('0xb')](),controller[_0x26bf('0x16')]);router[_0x26bf('0x17')](_0x26bf('0xd'),auth['isAuthenticated'](),controller[_0x26bf('0x18')]);router['delete']('/:id/sections',auth[_0x26bf('0xb')](),controller[_0x26bf('0x19')]);router[_0x26bf('0x17')](_0x26bf('0x10'),auth[_0x26bf('0xb')](),controller[_0x26bf('0x1a')]);module[_0x26bf('0x1b')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 14ea723..2076af9 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 _0xbb28=['join','getDataValue','split','BOOLEAN','STRING','setDataValue','crudPermissions'];(function(_0x173db5,_0x10ef78){var _0x114036=function(_0x2f7adc){while(--_0x2f7adc){_0x173db5['push'](_0x173db5['shift']());}};_0x114036(++_0x10ef78);}(_0xbb28,0x89));var _0x8bb2=function(_0x81d42,_0x1c5100){_0x81d42=_0x81d42-0x0;var _0x1577c6=_0xbb28[_0x81d42];return _0x1577c6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8bb2('0x0')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x8bb2('0x0')],'set':function(_0xae9e49){this[_0x8bb2('0x1')](_0x8bb2('0x2'),_0xae9e49?_0xae9e49[_0x8bb2('0x3')](''):[]);},'get':function(){return this[_0x8bb2('0x4')](_0x8bb2('0x2'))?this[_0x8bb2('0x4')]('crudPermissions')[_0x8bb2('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8bb2('0x0')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x8bb2('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x8bb2('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x8bb2('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x8bb2('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8bb2('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x8bb2('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8bb2('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x08a4=['name','getDataValue','crudPermissions','split','BOOLEAN','sequelize','STRING'];(function(_0x34b939,_0x4fc8c0){var _0x1d6eff=function(_0x4c5cbc){while(--_0x4c5cbc){_0x34b939['push'](_0x34b939['shift']());}};_0x1d6eff(++_0x4fc8c0);}(_0x08a4,0xbb));var _0x408a=function(_0x3188bd,_0x119115){_0x3188bd=_0x3188bd-0x0;var _0x292df7=_0x08a4[_0x3188bd];return _0x292df7;};'use strict';var Sequelize=require(_0x408a('0x0'));module['exports']={'name':{'type':Sequelize[_0x408a('0x1')],'allowNull':![],'unique':_0x408a('0x2')},'crudPermissions':{'type':Sequelize[_0x408a('0x1')],'set':function(_0x57cc98){this['setDataValue']('crudPermissions',_0x57cc98?_0x57cc98['join'](''):[]);},'get':function(){return this[_0x408a('0x3')](_0x408a('0x4'))?this['getDataValue'](_0x408a('0x4'))[_0x408a('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x408a('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x408a('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x408a('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x408a('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x408a('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x408a('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 9423752..e8bc9a6 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 _0x704f=['addSections','each','ids','getSections','includes','isEmpty','subsections','enabled','push','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','update','then','error','stack','send','index','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','map','VIRTUAL','filter','merge','options','includeAll','include','UserProfile','findAll','rows','show','params','length','find','catch','create','body','clone','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','get','autoAssociation','sectionId','userProfileId','Resources','UserProfileSection','UserProfileResource','destroy','describe'];(function(_0xfc508,_0x551505){var _0x35bfba=function(_0x561d20){while(--_0x561d20){_0xfc508['push'](_0xfc508['shift']());}};_0x35bfba(++_0x551505);}(_0x704f,0x1df));var _0xf704=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0x704f[_0x175e89];return _0x2ed996;};'use strict';var emlformat=require(_0xf704('0x0'));var rimraf=require(_0xf704('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf704('0x2'));var rp=require(_0xf704('0x3'));var moment=require(_0xf704('0x4'));var BPromise=require(_0xf704('0x5'));var Mustache=require(_0xf704('0x6'));var util=require('util');var path=require(_0xf704('0x7'));var sox=require(_0xf704('0x8'));var csv=require(_0xf704('0x9'));var ejs=require(_0xf704('0xa'));var fs=require('fs');var fs_extra=require(_0xf704('0xb'));var _=require(_0xf704('0xc'));var squel=require('squel');var crypto=require(_0xf704('0xd'));var jsforce=require(_0xf704('0xe'));var deskjs=require(_0xf704('0xf'));var toCsv=require(_0xf704('0x9'));var querystring=require(_0xf704('0x10'));var Papa=require(_0xf704('0x11'));var Redis=require(_0xf704('0x12'));var authService=require(_0xf704('0x13'));var qs=require(_0xf704('0x14'));var as=require(_0xf704('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf704('0x16'));var utils=require(_0xf704('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf704('0x18'));var db=require(_0xf704('0x19'))['db'];config[_0xf704('0x1a')]=_[_0xf704('0x1b')](config[_0xf704('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xf704('0x1c'))(new Redis(config[_0xf704('0x1a')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x558b15,_0x298ed5){_0x298ed5=_0x298ed5||0xcc;return function(_0x5d1ddc){if(_0x5d1ddc){return _0x558b15[_0xf704('0x1d')](_0x298ed5);}return _0x558b15[_0xf704('0x1e')](_0x298ed5)['end']();};}function respondWithResult(_0x4ddfa1,_0x10fc1c){_0x10fc1c=_0x10fc1c||0xc8;return function(_0xbba3ec){if(_0xbba3ec){return _0x4ddfa1[_0xf704('0x1e')](_0x10fc1c)[_0xf704('0x1f')](_0xbba3ec);}};}function respondWithFilteredResult(_0x57b824,_0xe8db31){return function(_0x3f8875){if(_0x3f8875){var _0x10d07f=typeof _0xe8db31[_0xf704('0x20')]==='undefined'&&typeof _0xe8db31[_0xf704('0x21')]===_0xf704('0x22');var _0xd966ec=_0x3f8875[_0xf704('0x23')];var _0xd1fee2=_0x10d07f?0x0:_0xe8db31[_0xf704('0x20')];var _0x1d0c12=_0x10d07f?_0x3f8875['count']:_0xe8db31['offset']+_0xe8db31[_0xf704('0x21')];var _0x5f3663;if(_0x1d0c12>=_0xd966ec){_0x1d0c12=_0xd966ec;_0x5f3663=0xc8;}else{_0x5f3663=0xce;}_0x57b824[_0xf704('0x1e')](_0x5f3663);return _0x57b824['set']('Content-Range',_0xd1fee2+'-'+_0x1d0c12+'/'+_0xd966ec)[_0xf704('0x1f')](_0x3f8875);}return null;};}function patchUpdates(_0x504873){return function(_0x18a779){try{jsonpatch[_0xf704('0x24')](_0x18a779,_0x504873,!![]);}catch(_0x3ff4be){return BPromise[_0xf704('0x25')](_0x3ff4be);}return _0x18a779[_0xf704('0x26')]();};}function saveUpdates(_0x414cfd,_0x40b908){return function(_0x56d07c){if(_0x56d07c){return _0x56d07c[_0xf704('0x27')](_0x414cfd)[_0xf704('0x28')](function(_0x3066f7){return _0x3066f7;});}return null;};}function removeEntity(_0x1a090c,_0x48282f){return function(_0xa6f1f6){if(_0xa6f1f6){return _0xa6f1f6['destroy']()['then'](function(){_0x1a090c[_0xf704('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39be21,_0x11e89d){return function(_0x3a6c01){if(!_0x3a6c01){_0x39be21[_0xf704('0x1d')](0x194);}return _0x3a6c01;};}function handleError(_0x4161bc,_0x411a62){_0x411a62=_0x411a62||0x1f4;return function(_0x259e70){logger[_0xf704('0x29')](_0x259e70[_0xf704('0x2a')]);if(_0x259e70['name']){delete _0x259e70['name'];}_0x4161bc[_0xf704('0x1e')](_0x411a62)[_0xf704('0x2b')](_0x259e70);};}exports[_0xf704('0x2c')]=function(_0x5102c7,_0xed3ef1){var _0x4e65eb={},_0x43c4ac={},_0xa4a029={'count':0x0,'rows':[]};var _0xc8f9a3=_['map'](db['UserProfile'][_0xf704('0x2d')],function(_0x59b4c4){return{'name':_0x59b4c4[_0xf704('0x2e')],'type':_0x59b4c4[_0xf704('0x2f')][_0xf704('0x30')]};});_0x43c4ac[_0xf704('0x31')]=_['map'](_0xc8f9a3,_0xf704('0x32'));_0x43c4ac[_0xf704('0x33')]=_[_0xf704('0x34')](_0x5102c7[_0xf704('0x33')]);_0x43c4ac['filters']=_[_0xf704('0x35')](_0x43c4ac['model'],_0x43c4ac[_0xf704('0x33')]);_0x4e65eb[_0xf704('0x36')]=_[_0xf704('0x35')](_0x43c4ac['model'],qs['fields'](_0x5102c7[_0xf704('0x33')][_0xf704('0x37')]));_0x4e65eb[_0xf704('0x36')]=_0x4e65eb[_0xf704('0x36')]['length']?_0x4e65eb[_0xf704('0x36')]:_0x43c4ac['model'];if(!_0x5102c7[_0xf704('0x33')][_0xf704('0x38')](_0xf704('0x39'))){_0x4e65eb[_0xf704('0x21')]=qs[_0xf704('0x21')](_0x5102c7[_0xf704('0x33')][_0xf704('0x21')]);_0x4e65eb[_0xf704('0x20')]=qs[_0xf704('0x20')](_0x5102c7['query'][_0xf704('0x20')]);}_0x4e65eb[_0xf704('0x3a')]=qs['sort'](_0x5102c7[_0xf704('0x33')][_0xf704('0x3b')]);_0x4e65eb[_0xf704('0x3c')]=qs[_0xf704('0x3d')](_[_0xf704('0x3e')](_0x5102c7[_0xf704('0x33')],_0x43c4ac[_0xf704('0x3d')]),_0xc8f9a3);if(_0x5102c7[_0xf704('0x33')]['filter']){_0x4e65eb[_0xf704('0x3c')]=_['merge'](_0x4e65eb[_0xf704('0x3c')],{'$or':_[_0xf704('0x3f')](_0xc8f9a3,function(_0xc15b73){if(_0xc15b73[_0xf704('0x2f')]!==_0xf704('0x40')){var _0x2875bf={};_0x2875bf[_0xc15b73[_0xf704('0x32')]]={'$like':'%'+_0x5102c7[_0xf704('0x33')][_0xf704('0x41')]+'%'};return _0x2875bf;}})});}_0x4e65eb=_[_0xf704('0x42')]({},_0x4e65eb,_0x5102c7[_0xf704('0x43')]);var _0x2d8d44={'where':_0x4e65eb[_0xf704('0x3c')]};return db['UserProfile'][_0xf704('0x23')](_0x2d8d44)[_0xf704('0x28')](function(_0x1031bd){_0xa4a029['count']=_0x1031bd;if(_0x5102c7[_0xf704('0x33')][_0xf704('0x44')]){_0x4e65eb[_0xf704('0x45')]=[{'all':!![]}];}return db[_0xf704('0x46')][_0xf704('0x47')](_0x4e65eb);})[_0xf704('0x28')](function(_0x2bac16){_0xa4a029[_0xf704('0x48')]=_0x2bac16;return _0xa4a029;})[_0xf704('0x28')](respondWithFilteredResult(_0xed3ef1,_0x4e65eb))['catch'](handleError(_0xed3ef1,null));};exports[_0xf704('0x49')]=function(_0x20e30c,_0x60ca2d){var _0x201e01={'raw':![],'where':{'id':_0x20e30c[_0xf704('0x4a')]['id']}},_0x1632c4={};_0x1632c4[_0xf704('0x31')]=_[_0xf704('0x34')](db['UserProfile'][_0xf704('0x2d')]);_0x1632c4[_0xf704('0x33')]=_[_0xf704('0x34')](_0x20e30c['query']);_0x1632c4[_0xf704('0x3d')]=_[_0xf704('0x35')](_0x1632c4[_0xf704('0x31')],_0x1632c4[_0xf704('0x33')]);_0x201e01[_0xf704('0x36')]=_[_0xf704('0x35')](_0x1632c4['model'],qs[_0xf704('0x37')](_0x20e30c['query']['fields']));_0x201e01['attributes']=_0x201e01[_0xf704('0x36')][_0xf704('0x4b')]?_0x201e01['attributes']:_0x1632c4[_0xf704('0x31')];if(_0x20e30c['query'][_0xf704('0x44')]){_0x201e01['include']=[{'all':!![]}];}_0x201e01=_['merge']({},_0x201e01,_0x20e30c[_0xf704('0x43')]);return db[_0xf704('0x46')][_0xf704('0x4c')](_0x201e01)[_0xf704('0x28')](handleEntityNotFound(_0x60ca2d,null))[_0xf704('0x28')](respondWithResult(_0x60ca2d,null))[_0xf704('0x4d')](handleError(_0x60ca2d,null));};exports[_0xf704('0x4e')]=function(_0x2f7815,_0x200020){return db[_0xf704('0x46')][_0xf704('0x4e')](_0x2f7815[_0xf704('0x4f')],{})[_0xf704('0x28')](respondWithResult(_0x200020,0xc9))[_0xf704('0x4d')](handleError(_0x200020,null));};exports[_0xf704('0x50')]=function(_0x16ffb9,_0x5aefb4){var _0x93c688={'where':{'id':_0x16ffb9[_0xf704('0x4a')]['id']}},_0x224f47={};_0x224f47['model']=_[_0xf704('0x34')](db[_0xf704('0x46')][_0xf704('0x2d')]);_0x93c688[_0xf704('0x36')]=_[_0xf704('0x35')](_0x224f47[_0xf704('0x31')],qs['fields'](_0x16ffb9[_0xf704('0x33')][_0xf704('0x37')]));_0x93c688[_0xf704('0x36')]=_0x93c688[_0xf704('0x36')]['length']?_0x93c688[_0xf704('0x36')]:_0x224f47[_0xf704('0x31')];if(_0x16ffb9[_0xf704('0x33')][_0xf704('0x44')]){_0x93c688[_0xf704('0x45')]=[{'all':!![]}];}_0x93c688=_['merge']({},_0x93c688,_0x16ffb9[_0xf704('0x43')]);return db[_0xf704('0x46')][_0xf704('0x4c')](_0x93c688)[_0xf704('0x28')](handleEntityNotFound(_0x5aefb4,null))['then'](function(_0xb095d6){if(_0xb095d6){var _0x4cad8c=_0xb095d6['get']({'plain':!![]});_0x4cad8c=qs[_0xf704('0x51')](_0x4cad8c,['id',_0xf704('0x52'),_0xf704('0x53'),_0xf704('0x54')]);_0x16ffb9[_0xf704('0x4f')]=_['omit'](_0x16ffb9[_0xf704('0x4f')],['id',_0xf704('0x52'),'updatedAt']);return db[_0xf704('0x55')][_0xf704('0x56')](function(_0x25d561){return db[_0xf704('0x46')][_0xf704('0x4e')](_[_0xf704('0x42')](_0x4cad8c,_0x16ffb9[_0xf704('0x4f')]),{'include':_0x16ffb9[_0xf704('0x33')][_0xf704('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x25d561})[_0xf704('0x28')](function(_0x58f3be){var _0x1294e7=_0x58f3be[_0xf704('0x57')]({'plain':!![]});return db['UserProfileSection'][_0xf704('0x47')]({'where':{'userProfileId':_0x16ffb9[_0xf704('0x4a')]['id']},'raw':!![]})['then'](function(_0x4d8bed){if(_0x4d8bed){return BPromise['each'](_0x4d8bed,function(_0x1bfc15){return new BPromise(function(_0x1816f3,_0x4fa648){if(_0x1bfc15[_0xf704('0x58')]===null||_0x1bfc15['autoAssociation']===0x1)_0x1816f3(null);return db['UserProfileResource'][_0xf704('0x47')]({'where':{'sectionId':_0x1bfc15['id']},'raw':!![]})[_0xf704('0x28')](function(_0x1a58b4){var _0x335740=_[_0xf704('0x3f')](_0x1a58b4,function(_0xd635e3){return qs[_0xf704('0x51')](_0xd635e3,['id',_0xf704('0x52'),_0xf704('0x53'),_0xf704('0x59')]);});_0x1816f3(_0x335740);})[_0xf704('0x4d')](function(_0x28df47){_0x4fa648(_0x28df47);});})[_0xf704('0x28')](function(_0x3ca27f){var _0x261769=qs['omit'](_0x1bfc15,['id',_0xf704('0x52'),_0xf704('0x53')]);_0x261769[_0xf704('0x5a')]=_0x1294e7['id'];if(_0x3ca27f)_0x261769[_0xf704('0x5b')]=_0x3ca27f;return _0x261769;})[_0xf704('0x28')](function(_0x30b65d){return db[_0xf704('0x5c')][_0xf704('0x4e')](_0x30b65d,{'include':[{'model':db[_0xf704('0x5d')],'as':_0xf704('0x5b')}],'raw':!![],'transaction':_0x25d561});});})[_0xf704('0x28')](function(){return _0x1294e7;});}});});});}})[_0xf704('0x28')](respondWithResult(_0x5aefb4,0xc9))[_0xf704('0x4d')](handleError(_0x5aefb4,null));};exports[_0xf704('0x27')]=function(_0x4fca53,_0x2cc219){if(_0x4fca53[_0xf704('0x4f')]['id']){delete _0x4fca53[_0xf704('0x4f')]['id'];}return db[_0xf704('0x46')][_0xf704('0x4c')]({'where':{'id':_0x4fca53[_0xf704('0x4a')]['id']}})[_0xf704('0x28')](handleEntityNotFound(_0x2cc219,null))[_0xf704('0x28')](saveUpdates(_0x4fca53['body'],null))[_0xf704('0x28')](respondWithResult(_0x2cc219,null))[_0xf704('0x4d')](handleError(_0x2cc219,null));};exports[_0xf704('0x5e')]=function(_0x7f05e3,_0x42005f){return db[_0xf704('0x46')][_0xf704('0x4c')]({'where':{'id':_0x7f05e3[_0xf704('0x4a')]['id']}})[_0xf704('0x28')](handleEntityNotFound(_0x42005f,null))['then'](removeEntity(_0x42005f,null))[_0xf704('0x4d')](handleError(_0x42005f,null));};exports[_0xf704('0x5f')]=function(_0x2398b2,_0x591c73){return db[_0xf704('0x46')]['describe']()[_0xf704('0x28')](respondWithResult(_0x591c73,null))['catch'](handleError(_0x591c73,null));};exports[_0xf704('0x60')]=function(_0x239d7f,_0x4d82b2){var _0x55ba0d=_0x239d7f[_0xf704('0x4f')];return db[_0xf704('0x46')][_0xf704('0x4c')]({'where':{'id':_0x239d7f['params']['id']}})[_0xf704('0x28')](handleEntityNotFound(_0x4d82b2,null))['then'](function(_0x4ab285){if(_0x4ab285){return db['sequelize'][_0xf704('0x56')](function(_0x24bd4a){return db[_0xf704('0x5c')][_0xf704('0x5e')]({'where':{'userProfileId':_0x239d7f[_0xf704('0x4a')]['id'],'sectionId':_[_0xf704('0x3f')](_0x55ba0d,function(_0x499b85){return _0x499b85[_0xf704('0x59')];})},'transaction':_0x24bd4a})[_0xf704('0x28')](function(){var _0xbf555e=_[_0xf704('0x3f')](_0x55ba0d,function(_0xf209a6){_0xf209a6[_0xf704('0x5a')]=_0x239d7f[_0xf704('0x4a')]['id'];return _0xf209a6;});var _0x29f8fa=[];return BPromise[_0xf704('0x61')](_0xbf555e,function(_0x1089fe){return db[_0xf704('0x5c')][_0xf704('0x4e')](_0x1089fe,{'include':[{'model':db['UserProfileResource'],'as':_0xf704('0x5b')}],'raw':!![],'transaction':_0x24bd4a})[_0xf704('0x28')](function(_0x4a5939){_0x29f8fa['push'](_0x4a5939[_0xf704('0x57')]({'plain':!![]}));});})[_0xf704('0x28')](function(){return _0x29f8fa;});});});}})[_0xf704('0x28')](function(_0x5cb6e9){return _0x5cb6e9;})['then'](respondWithResult(_0x4d82b2,null))[_0xf704('0x4d')](handleError(_0x4d82b2,null));};exports['removeSections']=function(_0x341625,_0x440808){var _0xfb9aa8;return db['UserProfile'][_0xf704('0x4c')]({'where':{'id':_0x341625[_0xf704('0x4a')]['id']},'attributes':['id','name']})[_0xf704('0x28')](handleEntityNotFound(_0x440808,null))['then'](function(_0x13f25b){if(_0x13f25b){_0xfb9aa8=_0x13f25b;return db[_0xf704('0x5c')][_0xf704('0x5e')]({'where':{'userProfileId':_0x341625['params']['id'],'sectionId':_0x341625['query'][_0xf704('0x62')]}});}})[_0xf704('0x28')](function(){return _0xfb9aa8;})['then'](respondWithStatusCode(_0x440808,null))[_0xf704('0x4d')](handleError(_0x440808,null));};exports[_0xf704('0x63')]=function(_0x4232ea,_0xe48104){var _0x5cd205=[];var _0x2c3308=[];return db[_0xf704('0x5c')][_0xf704('0x47')]({'where':{'userProfileId':_0x4232ea[_0xf704('0x4a')]['id']},'raw':!![]})['then'](function(_0x41bbc2){_0x5cd205=_[_0xf704('0x41')](_0x41bbc2,function(_0x122df8){return _0x122df8['enabled']===0x1||_[_0xf704('0x64')]([0x3eb,0x709],_0x122df8[_0xf704('0x59')]);});if(!_[_0xf704('0x65')](_0x5cd205)){return _[_0xf704('0x3f')](_0x5cd205,function(_0x563c8b){return _0x563c8b[_0xf704('0x59')];});}else{return;}})[_0xf704('0x28')](function(_0x34ef4e){if(_0x34ef4e)_0x2c3308=_0x34ef4e;if(_[_0xf704('0x64')](_0x2c3308,0x64)){var _0x216e96=_['find'](_0x5cd205,{'sectionId':0x64});return hasDefaultDashboard(_0x216e96)[_0xf704('0x28')](function(_0x37188e){return _[_0xf704('0x3f')](_0x5cd205,function(_0x16cf5f){if(_0x16cf5f[_0xf704('0x59')]===0x64){_0x16cf5f[_0xf704('0x66')]=_0x37188e;}return _0x16cf5f;});});}else{return;}})[_0xf704('0x28')](function(_0x493ec8){if(_0x493ec8)_0x5cd205=_0x493ec8;if(_[_0xf704('0x64')](_0x2c3308,0x3eb)){var _0x254fed=_[_0xf704('0x4c')](_0x5cd205,{'sectionId':0x3eb});return getCustomDashboards(_0x254fed)[_0xf704('0x28')](function(_0x3e682e){return _[_0xf704('0x3f')](_0x5cd205,function(_0x3aca2c){if(_0x254fed[_0xf704('0x67')]){if(_0x3aca2c['sectionId']===0x3eb){_0x3aca2c[_0xf704('0x66')]=_0x3e682e;}}else{if(_0x3aca2c[_0xf704('0x59')]===0x64){if(!_0x3aca2c[_0xf704('0x66')]){_0x3aca2c[_0xf704('0x66')]=[];}_0x3aca2c[_0xf704('0x66')]=_0x3aca2c[_0xf704('0x66')]['concat'](_0x3e682e);}}return _0x3aca2c;});});}else{return;}})[_0xf704('0x28')](function(_0x51d23a){if(_0x51d23a)_0x5cd205=_0x51d23a;if(_[_0xf704('0x64')](_0x2c3308,0x709)){var _0x26e57d=_[_0xf704('0x4c')](_0x5cd205,{'sectionId':0x709});return getPlugins(_0x26e57d)[_0xf704('0x28')](function(_0x3f9ade){if(_0x26e57d[_0xf704('0x67')]){return _[_0xf704('0x3f')](_0x5cd205,function(_0x5af858){if(_0x5af858['sectionId']===0x709){_0x5af858['subsections']=_0x3f9ade;}return _0x5af858;});}else{var _0x9add3e={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3f9ade};var _0x34b4dd=_[_0xf704('0x3f')](_0x5cd205);_0x34b4dd[_0xf704('0x68')](_0x9add3e);return _0x34b4dd;}});}else{return;}})['then'](function(_0x4b0e4c){if(_0x4b0e4c)_0x5cd205=_0x4b0e4c;return _['filter'](_0x5cd205,[_0xf704('0x67'),0x1]);})[_0xf704('0x28')](respondWithResult(_0xe48104,null))[_0xf704('0x4d')](handleError(_0xe48104,null));};function hasDefaultDashboard(_0x23b5ea){var _0xebfbd7=[0x65];return new BPromise(function(_0x38e060,_0xd206db){try{if(_0x23b5ea['autoAssociation']){_0x38e060(_0xebfbd7);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x23b5ea['id']},'raw':!![]})[_0xf704('0x28')](function(_0x502fa5){_0x502fa5?_0x38e060(_0xebfbd7):_0x38e060();});}}catch(_0x525a2a){_0xd206db(_0x525a2a);}});}function getCustomDashboards(_0x48c38e){var _0x181dfe=[];return new BPromise(function(_0x12dc4f,_0x13b278){try{if(_0x48c38e['autoAssociation']){return db[_0xf704('0x69')][_0xf704('0x47')]({'raw':!![]})[_0xf704('0x28')](function(_0x76ec78){_0x76ec78[_0xf704('0x6a')](function(_0x2e1c29){_0x181dfe[_0xf704('0x68')](_0x2e1c29['id']+0x1869f);});_0x12dc4f(_0x181dfe);});}else{return db[_0xf704('0x5d')][_0xf704('0x47')]({'where':{'sectionId':_0x48c38e['id']},'raw':!![]})[_0xf704('0x28')](function(_0x3dd032){_0x3dd032[_0xf704('0x6a')](function(_0xec969b){_0x181dfe[_0xf704('0x68')](_0xec969b[_0xf704('0x6b')]+0x1869f);});_0x12dc4f(_0x181dfe);});}}catch(_0x3fcdbc){_0x13b278(_0x3fcdbc);}});}function getPlugins(_0x1ca4b8){var _0x5c5998=[];return new BPromise(function(_0x283a79,_0x3f7cca){try{if(_0x1ca4b8['autoAssociation']){return db['Plugin']['findAll']({'raw':!![]})['then'](function(_0xf96220){_0xf96220['forEach'](function(_0x26c7cc){_0x5c5998['push'](_0x26c7cc['id']+0x15b38);});_0x283a79(_0x5c5998);});}else{return db[_0xf704('0x5d')][_0xf704('0x47')]({'where':{'sectionId':_0x1ca4b8['id']},'raw':!![]})['then'](function(_0x5d4780){_0x5d4780[_0xf704('0x6a')](function(_0x9c1690){_0x5c5998[_0xf704('0x68')](_0x9c1690[_0xf704('0x6b')]+0x15b38);});_0x283a79(_0x5c5998);});}}catch(_0x214eae){_0x3f7cca(_0x214eae);}});}exports[_0xf704('0x6c')]=function(_0x5eaae2,_0x4ff16a){return db[_0xf704('0x46')][_0xf704('0x4c')]({'where':{'id':_0x5eaae2[_0xf704('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ff16a,null))[_0xf704('0x28')](function(_0x36e472){if(_0x36e472){return db[_0xf704('0x55')]['transaction'](function(_0x589338){return db[_0xf704('0x5c')][_0xf704('0x47')]({'where':{'userProfileId':_0x5eaae2[_0xf704('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0xf704('0x28')](function(_0x335842){if(_0x335842){return db[_0xf704('0x5c')]['destroy']({'where':{'userProfileId':_0x5eaae2[_0xf704('0x4a')]['id'],'id':_[_0xf704('0x3f')](_0x335842,function(_0x5544cb){return _0x5544cb['id'];})},'transaction':_0x589338});}})[_0xf704('0x28')](function(_0x5d7e5f){var _0x279fa9=_[_0xf704('0x3f')](_0x5eaae2[_0xf704('0x4f')],function(_0x41b2bf){_0x41b2bf['userProfileId']=_0x5eaae2[_0xf704('0x4a')]['id'];return _0x41b2bf;});return db[_0xf704('0x5c')][_0xf704('0x6d')](_0x279fa9,{'raw':!![],'transaction':_0x589338});})[_0xf704('0x28')](function(_0xb0e538){var _0x36a986=_[_0xf704('0x41')](_[_0xf704('0x3f')](_0xb0e538,function(_0x5ce55e){return _0x5ce55e[_0xf704('0x57')]({'plain':!![]});}),{'includeAll':![]});if(_0x36a986){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x5eaae2[_0xf704('0x4a')]['id'],'sectionId':_[_0xf704('0x3f')](_0x36a986,function(_0x50330a){return _0x50330a[_0xf704('0x59')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xf704('0x28')](function(_0x259e72){var _0x12c656=_[_0xf704('0x3f')](_0x5eaae2[_0xf704('0x4f')],function(_0x5055a8){_0x5055a8['userProfileId']=_0x5eaae2['params']['id'];return _0x5055a8;});return db[_0xf704('0x5d')][_0xf704('0x6d')](_0x12c656,{'raw':!![],'transaction':_0x589338});});}})[_0xf704('0x4d')](handleError(_0x4ff16a,null));});}})['then'](function(_0x324580){var _0x199e2e=_[_0xf704('0x3f')](_0x324580,function(_0x3c32da){return _0x3c32da[_0xf704('0x57')]({'plain':!![]});});})[_0xf704('0x28')](respondWithResult(_0x4ff16a,null))[_0xf704('0x4d')](handleError(_0x4ff16a,null));};exports['removeResources']=function(_0x4a55ec,_0x6a2f3b,_0x2417ae){return db[_0xf704('0x46')]['find']({'where':{'id':_0x4a55ec[_0xf704('0x4a')]['id']}})[_0xf704('0x28')](handleEntityNotFound(_0x6a2f3b,null))['then'](function(_0x4ac745){if(_0x4ac745){return _0x4ac745[_0xf704('0x6e')](_0x4a55ec[_0xf704('0x33')][_0xf704('0x62')]);}})[_0xf704('0x28')](respondWithStatusCode(_0x6a2f3b,null))['catch'](handleError(_0x6a2f3b,null));};exports[_0xf704('0x6f')]=function(_0x2ca407,_0x199f3c){var _0x24f3b0={};if(!_0x2ca407[_0xf704('0x33')][_0xf704('0x70')])throw new Error(_0xf704('0x71'));if(!_0x2ca407[_0xf704('0x33')][_0xf704('0x38')]('nolimit')){_0x24f3b0[_0xf704('0x21')]=qs[_0xf704('0x21')](_0x2ca407[_0xf704('0x33')][_0xf704('0x21')]);_0x24f3b0['offset']=qs[_0xf704('0x20')](_0x2ca407[_0xf704('0x33')][_0xf704('0x20')]);}return db[_0xf704('0x46')][_0xf704('0x4c')]({'where':{'id':_0x2ca407['params']['id']}})[_0xf704('0x28')](function(_0x4e302d){if(!_0x4e302d)throw new Error(_0xf704('0x72')+_0x2ca407['params']['id']);return db[_0xf704('0x46')]['getResources'](_0x2ca407);})['then'](respondWithFilteredResult(_0x199f3c,_0x24f3b0))[_0xf704('0x4d')](handleError(_0x199f3c,null));}; \ No newline at end of file +var _0xbcb6=['UserProfileSection','each','autoAssociation','UserProfileResource','createdAt','userProfileId','Resources','describe','addSections','sectionId','push','removeSections','includes','isEmpty','subsections','enabled','concat','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','ids','getResources','section','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','sendStatus','error','name','map','UserProfile','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','get','omit','updatedAt','crudPermissions','sequelize','transaction'];(function(_0x576c6c,_0x216e0a){var _0x4b1248=function(_0x5dd989){while(--_0x5dd989){_0x576c6c['push'](_0x576c6c['shift']());}};_0x4b1248(++_0x216e0a);}(_0xbcb6,0x8c));var _0x6bcb=function(_0x3db0ba,_0x2be65c){_0x3db0ba=_0x3db0ba-0x0;var _0x2d8e9a=_0xbcb6[_0x3db0ba];return _0x2d8e9a;};'use strict';var emlformat=require(_0x6bcb('0x0'));var rimraf=require(_0x6bcb('0x1'));var zipdir=require(_0x6bcb('0x2'));var jsonpatch=require(_0x6bcb('0x3'));var rp=require(_0x6bcb('0x4'));var moment=require('moment');var BPromise=require(_0x6bcb('0x5'));var Mustache=require(_0x6bcb('0x6'));var util=require(_0x6bcb('0x7'));var path=require('path');var sox=require(_0x6bcb('0x8'));var csv=require(_0x6bcb('0x9'));var ejs=require(_0x6bcb('0xa'));var fs=require('fs');var fs_extra=require(_0x6bcb('0xb'));var _=require(_0x6bcb('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6bcb('0xd'));var toCsv=require(_0x6bcb('0x9'));var querystring=require(_0x6bcb('0xe'));var Papa=require(_0x6bcb('0xf'));var Redis=require('ioredis');var authService=require(_0x6bcb('0x10'));var qs=require(_0x6bcb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6bcb('0x12'))(_0x6bcb('0x13'));var utils=require(_0x6bcb('0x14'));var config=require(_0x6bcb('0x15'));var licenseUtil=require(_0x6bcb('0x16'));var db=require(_0x6bcb('0x17'))['db'];config[_0x6bcb('0x18')]=_['defaults'](config['redis'],{'host':_0x6bcb('0x19'),'port':0x18eb});var socket=require(_0x6bcb('0x1a'))(new Redis(config[_0x6bcb('0x18')]));require(_0x6bcb('0x1b'))[_0x6bcb('0x1c')](socket);function respondWithStatusCode(_0x18eeea,_0x3d2520){_0x3d2520=_0x3d2520||0xcc;return function(_0x4b24a5){if(_0x4b24a5){return _0x18eeea['sendStatus'](_0x3d2520);}return _0x18eeea[_0x6bcb('0x1d')](_0x3d2520)[_0x6bcb('0x1e')]();};}function respondWithResult(_0x538dda,_0xa7108a){_0xa7108a=_0xa7108a||0xc8;return function(_0x6be56){if(_0x6be56){return _0x538dda['status'](_0xa7108a)[_0x6bcb('0x1f')](_0x6be56);}};}function respondWithFilteredResult(_0x2d9f7a,_0x1a60e4){return function(_0x5cb5cc){if(_0x5cb5cc){var _0x23b5a5=typeof _0x1a60e4[_0x6bcb('0x20')]===_0x6bcb('0x21')&&typeof _0x1a60e4[_0x6bcb('0x22')]===_0x6bcb('0x21');var _0x1b44c0=_0x5cb5cc[_0x6bcb('0x23')];var _0x343470=_0x23b5a5?0x0:_0x1a60e4[_0x6bcb('0x20')];var _0x170fbf=_0x23b5a5?_0x5cb5cc[_0x6bcb('0x23')]:_0x1a60e4['offset']+_0x1a60e4[_0x6bcb('0x22')];var _0x317540;if(_0x170fbf>=_0x1b44c0){_0x170fbf=_0x1b44c0;_0x317540=0xc8;}else{_0x317540=0xce;}_0x2d9f7a[_0x6bcb('0x1d')](_0x317540);return _0x2d9f7a[_0x6bcb('0x24')](_0x6bcb('0x25'),_0x343470+'-'+_0x170fbf+'/'+_0x1b44c0)['json'](_0x5cb5cc);}return null;};}function patchUpdates(_0x5d1409){return function(_0x35f5d1){try{jsonpatch['apply'](_0x35f5d1,_0x5d1409,!![]);}catch(_0x5c4f97){return BPromise['reject'](_0x5c4f97);}return _0x35f5d1[_0x6bcb('0x26')]();};}function saveUpdates(_0xb30071,_0x139307){return function(_0x1c8ad0){if(_0x1c8ad0){return _0x1c8ad0[_0x6bcb('0x27')](_0xb30071)[_0x6bcb('0x28')](function(_0xdad56a){return _0xdad56a;});}return null;};}function removeEntity(_0x40711a,_0x2cf408){return function(_0x3eb783){if(_0x3eb783){return _0x3eb783[_0x6bcb('0x29')]()[_0x6bcb('0x28')](function(){_0x40711a[_0x6bcb('0x1d')](0xcc)[_0x6bcb('0x1e')]();});}};}function handleEntityNotFound(_0x50567d,_0x3833f1){return function(_0x4bf402){if(!_0x4bf402){_0x50567d[_0x6bcb('0x2a')](0x194);}return _0x4bf402;};}function handleError(_0x2f1004,_0x12653c){_0x12653c=_0x12653c||0x1f4;return function(_0x346f8c){logger[_0x6bcb('0x2b')](_0x346f8c['stack']);if(_0x346f8c[_0x6bcb('0x2c')]){delete _0x346f8c[_0x6bcb('0x2c')];}_0x2f1004[_0x6bcb('0x1d')](_0x12653c)['send'](_0x346f8c);};}exports['index']=function(_0x15b4ea,_0x34d60e){var _0x11efac={},_0x258641={},_0x1c615e={'count':0x0,'rows':[]};var _0x3ae46d=_[_0x6bcb('0x2d')](db[_0x6bcb('0x2e')][_0x6bcb('0x2f')],function(_0x1d56e4){return{'name':_0x1d56e4[_0x6bcb('0x30')],'type':_0x1d56e4[_0x6bcb('0x31')][_0x6bcb('0x32')]};});_0x258641[_0x6bcb('0x33')]=_[_0x6bcb('0x2d')](_0x3ae46d,_0x6bcb('0x2c'));_0x258641['query']=_[_0x6bcb('0x34')](_0x15b4ea['query']);_0x258641['filters']=_['intersection'](_0x258641[_0x6bcb('0x33')],_0x258641[_0x6bcb('0x35')]);_0x11efac[_0x6bcb('0x36')]=_[_0x6bcb('0x37')](_0x258641['model'],qs[_0x6bcb('0x38')](_0x15b4ea[_0x6bcb('0x35')][_0x6bcb('0x38')]));_0x11efac['attributes']=_0x11efac[_0x6bcb('0x36')][_0x6bcb('0x39')]?_0x11efac['attributes']:_0x258641['model'];if(!_0x15b4ea['query'][_0x6bcb('0x3a')]('nolimit')){_0x11efac['limit']=qs['limit'](_0x15b4ea[_0x6bcb('0x35')][_0x6bcb('0x22')]);_0x11efac[_0x6bcb('0x20')]=qs[_0x6bcb('0x20')](_0x15b4ea['query'][_0x6bcb('0x20')]);}_0x11efac[_0x6bcb('0x3b')]=qs['sort'](_0x15b4ea[_0x6bcb('0x35')]['sort']);_0x11efac[_0x6bcb('0x3c')]=qs[_0x6bcb('0x3d')](_['pick'](_0x15b4ea[_0x6bcb('0x35')],_0x258641['filters']),_0x3ae46d);if(_0x15b4ea[_0x6bcb('0x35')][_0x6bcb('0x3e')]){_0x11efac[_0x6bcb('0x3c')]=_[_0x6bcb('0x3f')](_0x11efac[_0x6bcb('0x3c')],{'$or':_[_0x6bcb('0x2d')](_0x3ae46d,function(_0x9bd279){if(_0x9bd279[_0x6bcb('0x31')]!==_0x6bcb('0x40')){var _0x31ada1={};_0x31ada1[_0x9bd279[_0x6bcb('0x2c')]]={'$like':'%'+_0x15b4ea['query'][_0x6bcb('0x3e')]+'%'};return _0x31ada1;}})});}_0x11efac=_['merge']({},_0x11efac,_0x15b4ea[_0x6bcb('0x41')]);var _0x2303e1={'where':_0x11efac[_0x6bcb('0x3c')]};return db[_0x6bcb('0x2e')]['count'](_0x2303e1)[_0x6bcb('0x28')](function(_0x3fd5f1){_0x1c615e[_0x6bcb('0x23')]=_0x3fd5f1;if(_0x15b4ea[_0x6bcb('0x35')]['includeAll']){_0x11efac[_0x6bcb('0x42')]=[{'all':!![]}];}return db[_0x6bcb('0x2e')][_0x6bcb('0x43')](_0x11efac);})[_0x6bcb('0x28')](function(_0x420d1a){_0x1c615e[_0x6bcb('0x44')]=_0x420d1a;return _0x1c615e;})['then'](respondWithFilteredResult(_0x34d60e,_0x11efac))['catch'](handleError(_0x34d60e,null));};exports[_0x6bcb('0x45')]=function(_0x47790c,_0x2f117e){var _0x826ec2={'raw':![],'where':{'id':_0x47790c[_0x6bcb('0x46')]['id']}},_0x1ab6f5={};_0x1ab6f5[_0x6bcb('0x33')]=_[_0x6bcb('0x34')](db[_0x6bcb('0x2e')]['rawAttributes']);_0x1ab6f5['query']=_[_0x6bcb('0x34')](_0x47790c[_0x6bcb('0x35')]);_0x1ab6f5[_0x6bcb('0x3d')]=_[_0x6bcb('0x37')](_0x1ab6f5[_0x6bcb('0x33')],_0x1ab6f5[_0x6bcb('0x35')]);_0x826ec2[_0x6bcb('0x36')]=_[_0x6bcb('0x37')](_0x1ab6f5[_0x6bcb('0x33')],qs[_0x6bcb('0x38')](_0x47790c[_0x6bcb('0x35')]['fields']));_0x826ec2[_0x6bcb('0x36')]=_0x826ec2[_0x6bcb('0x36')]['length']?_0x826ec2[_0x6bcb('0x36')]:_0x1ab6f5[_0x6bcb('0x33')];if(_0x47790c[_0x6bcb('0x35')][_0x6bcb('0x47')]){_0x826ec2[_0x6bcb('0x42')]=[{'all':!![]}];}_0x826ec2=_[_0x6bcb('0x3f')]({},_0x826ec2,_0x47790c[_0x6bcb('0x41')]);return db[_0x6bcb('0x2e')][_0x6bcb('0x48')](_0x826ec2)[_0x6bcb('0x28')](handleEntityNotFound(_0x2f117e,null))[_0x6bcb('0x28')](respondWithResult(_0x2f117e,null))[_0x6bcb('0x49')](handleError(_0x2f117e,null));};exports['create']=function(_0x5bff7a,_0x35e9c){return db['UserProfile'][_0x6bcb('0x4a')](_0x5bff7a[_0x6bcb('0x4b')],{})[_0x6bcb('0x28')](respondWithResult(_0x35e9c,0xc9))[_0x6bcb('0x49')](handleError(_0x35e9c,null));};exports['clone']=function(_0x5ef666,_0x1ae1d8){var _0xaac7b={'where':{'id':_0x5ef666[_0x6bcb('0x46')]['id']}},_0x5f52ba={};_0x5f52ba[_0x6bcb('0x33')]=_[_0x6bcb('0x34')](db[_0x6bcb('0x2e')][_0x6bcb('0x2f')]);_0xaac7b['attributes']=_[_0x6bcb('0x37')](_0x5f52ba[_0x6bcb('0x33')],qs[_0x6bcb('0x38')](_0x5ef666['query'][_0x6bcb('0x38')]));_0xaac7b[_0x6bcb('0x36')]=_0xaac7b[_0x6bcb('0x36')][_0x6bcb('0x39')]?_0xaac7b[_0x6bcb('0x36')]:_0x5f52ba[_0x6bcb('0x33')];if(_0x5ef666['query'][_0x6bcb('0x47')]){_0xaac7b[_0x6bcb('0x42')]=[{'all':!![]}];}_0xaac7b=_[_0x6bcb('0x3f')]({},_0xaac7b,_0x5ef666[_0x6bcb('0x41')]);return db['UserProfile'][_0x6bcb('0x48')](_0xaac7b)['then'](handleEntityNotFound(_0x1ae1d8,null))['then'](function(_0xa0542){if(_0xa0542){var _0x313f69=_0xa0542[_0x6bcb('0x4c')]({'plain':!![]});_0x313f69=qs[_0x6bcb('0x4d')](_0x313f69,['id','createdAt',_0x6bcb('0x4e'),_0x6bcb('0x4f')]);_0x5ef666[_0x6bcb('0x4b')]=_[_0x6bcb('0x4d')](_0x5ef666['body'],['id','createdAt',_0x6bcb('0x4e')]);return db[_0x6bcb('0x50')][_0x6bcb('0x51')](function(_0x4ad19a){return db[_0x6bcb('0x2e')]['create'](_[_0x6bcb('0x3f')](_0x313f69,_0x5ef666['body']),{'include':_0x5ef666[_0x6bcb('0x35')][_0x6bcb('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x4ad19a})[_0x6bcb('0x28')](function(_0x5dbb20){var _0x1e8104=_0x5dbb20[_0x6bcb('0x4c')]({'plain':!![]});return db[_0x6bcb('0x52')]['findAll']({'where':{'userProfileId':_0x5ef666[_0x6bcb('0x46')]['id']},'raw':!![]})['then'](function(_0x32cd73){if(_0x32cd73){return BPromise[_0x6bcb('0x53')](_0x32cd73,function(_0x2d7b2f){return new BPromise(function(_0x40f33f,_0x84bbbd){if(_0x2d7b2f['autoAssociation']===null||_0x2d7b2f[_0x6bcb('0x54')]===0x1)_0x40f33f(null);return db[_0x6bcb('0x55')][_0x6bcb('0x43')]({'where':{'sectionId':_0x2d7b2f['id']},'raw':!![]})[_0x6bcb('0x28')](function(_0x159819){var _0x27699a=_[_0x6bcb('0x2d')](_0x159819,function(_0x2a8618){return qs['omit'](_0x2a8618,['id',_0x6bcb('0x56'),_0x6bcb('0x4e'),'sectionId']);});_0x40f33f(_0x27699a);})[_0x6bcb('0x49')](function(_0x1c7e73){_0x84bbbd(_0x1c7e73);});})[_0x6bcb('0x28')](function(_0xdc9015){var _0x503378=qs[_0x6bcb('0x4d')](_0x2d7b2f,['id','createdAt',_0x6bcb('0x4e')]);_0x503378[_0x6bcb('0x57')]=_0x1e8104['id'];if(_0xdc9015)_0x503378[_0x6bcb('0x58')]=_0xdc9015;return _0x503378;})['then'](function(_0x4d16ed){return db[_0x6bcb('0x52')][_0x6bcb('0x4a')](_0x4d16ed,{'include':[{'model':db[_0x6bcb('0x55')],'as':_0x6bcb('0x58')}],'raw':!![],'transaction':_0x4ad19a});});})[_0x6bcb('0x28')](function(){return _0x1e8104;});}});});});}})[_0x6bcb('0x28')](respondWithResult(_0x1ae1d8,0xc9))[_0x6bcb('0x49')](handleError(_0x1ae1d8,null));};exports[_0x6bcb('0x27')]=function(_0x5e7204,_0x525265){if(_0x5e7204[_0x6bcb('0x4b')]['id']){delete _0x5e7204[_0x6bcb('0x4b')]['id'];}return db['UserProfile'][_0x6bcb('0x48')]({'where':{'id':_0x5e7204[_0x6bcb('0x46')]['id']}})['then'](handleEntityNotFound(_0x525265,null))[_0x6bcb('0x28')](saveUpdates(_0x5e7204[_0x6bcb('0x4b')],null))[_0x6bcb('0x28')](respondWithResult(_0x525265,null))[_0x6bcb('0x49')](handleError(_0x525265,null));};exports[_0x6bcb('0x29')]=function(_0x2c5e7b,_0x402e3b){return db['UserProfile'][_0x6bcb('0x48')]({'where':{'id':_0x2c5e7b[_0x6bcb('0x46')]['id']}})[_0x6bcb('0x28')](handleEntityNotFound(_0x402e3b,null))['then'](removeEntity(_0x402e3b,null))[_0x6bcb('0x49')](handleError(_0x402e3b,null));};exports[_0x6bcb('0x59')]=function(_0x54191e,_0x483b39){return db['UserProfile'][_0x6bcb('0x59')]()[_0x6bcb('0x28')](respondWithResult(_0x483b39,null))[_0x6bcb('0x49')](handleError(_0x483b39,null));};exports[_0x6bcb('0x5a')]=function(_0x3de0dd,_0x4c5a02){var _0x2803b4=_0x3de0dd[_0x6bcb('0x4b')];return db[_0x6bcb('0x2e')]['find']({'where':{'id':_0x3de0dd[_0x6bcb('0x46')]['id']}})[_0x6bcb('0x28')](handleEntityNotFound(_0x4c5a02,null))[_0x6bcb('0x28')](function(_0x204fea){if(_0x204fea){return db[_0x6bcb('0x50')][_0x6bcb('0x51')](function(_0x536eb8){return db[_0x6bcb('0x52')][_0x6bcb('0x29')]({'where':{'userProfileId':_0x3de0dd[_0x6bcb('0x46')]['id'],'sectionId':_[_0x6bcb('0x2d')](_0x2803b4,function(_0xaad930){return _0xaad930[_0x6bcb('0x5b')];})},'transaction':_0x536eb8})[_0x6bcb('0x28')](function(){var _0x4ff0e7=_['map'](_0x2803b4,function(_0x33e399){_0x33e399[_0x6bcb('0x57')]=_0x3de0dd[_0x6bcb('0x46')]['id'];return _0x33e399;});var _0x5b74da=[];return BPromise[_0x6bcb('0x53')](_0x4ff0e7,function(_0x2dc360){return db['UserProfileSection'][_0x6bcb('0x4a')](_0x2dc360,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x536eb8})[_0x6bcb('0x28')](function(_0x26432d){_0x5b74da[_0x6bcb('0x5c')](_0x26432d['get']({'plain':!![]}));});})[_0x6bcb('0x28')](function(){return _0x5b74da;});});});}})[_0x6bcb('0x28')](function(_0x2e7a4c){return _0x2e7a4c;})[_0x6bcb('0x28')](respondWithResult(_0x4c5a02,null))[_0x6bcb('0x49')](handleError(_0x4c5a02,null));};exports[_0x6bcb('0x5d')]=function(_0x67992f,_0x1022fd){var _0x3a566e;return db[_0x6bcb('0x2e')][_0x6bcb('0x48')]({'where':{'id':_0x67992f[_0x6bcb('0x46')]['id']},'attributes':['id',_0x6bcb('0x2c')]})[_0x6bcb('0x28')](handleEntityNotFound(_0x1022fd,null))[_0x6bcb('0x28')](function(_0x5a5eed){if(_0x5a5eed){_0x3a566e=_0x5a5eed;return db[_0x6bcb('0x52')][_0x6bcb('0x29')]({'where':{'userProfileId':_0x67992f[_0x6bcb('0x46')]['id'],'sectionId':_0x67992f[_0x6bcb('0x35')]['ids']}});}})[_0x6bcb('0x28')](function(){return _0x3a566e;})[_0x6bcb('0x28')](respondWithStatusCode(_0x1022fd,null))[_0x6bcb('0x49')](handleError(_0x1022fd,null));};exports['getSections']=function(_0x486947,_0x13ebf3){var _0x2a67f3=[];var _0x369145=[];return db[_0x6bcb('0x52')][_0x6bcb('0x43')]({'where':{'userProfileId':_0x486947['params']['id']},'raw':!![]})['then'](function(_0x2fda37){_0x2a67f3=_[_0x6bcb('0x3e')](_0x2fda37,function(_0x13001e){return _0x13001e['enabled']===0x1||_[_0x6bcb('0x5e')]([0x3eb,0x709],_0x13001e[_0x6bcb('0x5b')]);});if(!_[_0x6bcb('0x5f')](_0x2a67f3)){return _[_0x6bcb('0x2d')](_0x2a67f3,function(_0x1afee2){return _0x1afee2[_0x6bcb('0x5b')];});}else{return;}})[_0x6bcb('0x28')](function(_0x3711d8){if(_0x3711d8)_0x369145=_0x3711d8;if(_[_0x6bcb('0x5e')](_0x369145,0x64)){var _0x40026f=_[_0x6bcb('0x48')](_0x2a67f3,{'sectionId':0x64});return hasDefaultDashboard(_0x40026f)[_0x6bcb('0x28')](function(_0x80cf7f){return _['map'](_0x2a67f3,function(_0x3d27b9){if(_0x3d27b9[_0x6bcb('0x5b')]===0x64){_0x3d27b9[_0x6bcb('0x60')]=_0x80cf7f;}return _0x3d27b9;});});}else{return;}})[_0x6bcb('0x28')](function(_0x35c2c8){if(_0x35c2c8)_0x2a67f3=_0x35c2c8;if(_[_0x6bcb('0x5e')](_0x369145,0x3eb)){var _0x304e2d=_[_0x6bcb('0x48')](_0x2a67f3,{'sectionId':0x3eb});return getCustomDashboards(_0x304e2d)[_0x6bcb('0x28')](function(_0x150985){return _[_0x6bcb('0x2d')](_0x2a67f3,function(_0x23de37){if(_0x304e2d[_0x6bcb('0x61')]){if(_0x23de37[_0x6bcb('0x5b')]===0x3eb){_0x23de37[_0x6bcb('0x60')]=_0x150985;}}else{if(_0x23de37[_0x6bcb('0x5b')]===0x64){if(!_0x23de37[_0x6bcb('0x60')]){_0x23de37['subsections']=[];}_0x23de37[_0x6bcb('0x60')]=_0x23de37['subsections'][_0x6bcb('0x62')](_0x150985);}}return _0x23de37;});});}else{return;}})[_0x6bcb('0x28')](function(_0x2691b7){if(_0x2691b7)_0x2a67f3=_0x2691b7;if(_[_0x6bcb('0x5e')](_0x369145,0x709)){var _0x5a1b17=_[_0x6bcb('0x48')](_0x2a67f3,{'sectionId':0x709});return getPlugins(_0x5a1b17)[_0x6bcb('0x28')](function(_0x4dd71c){if(_0x5a1b17[_0x6bcb('0x61')]){return _[_0x6bcb('0x2d')](_0x2a67f3,function(_0x5f18e1){if(_0x5f18e1[_0x6bcb('0x5b')]===0x709){_0x5f18e1['subsections']=_0x4dd71c;}return _0x5f18e1;});}else{var _0x546ba8={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4dd71c};var _0x582494=_[_0x6bcb('0x2d')](_0x2a67f3);_0x582494['push'](_0x546ba8);return _0x582494;}});}else{return;}})[_0x6bcb('0x28')](function(_0x3b4646){if(_0x3b4646)_0x2a67f3=_0x3b4646;return _[_0x6bcb('0x3e')](_0x2a67f3,[_0x6bcb('0x61'),0x1]);})['then'](respondWithResult(_0x13ebf3,null))['catch'](handleError(_0x13ebf3,null));};function hasDefaultDashboard(_0x2969f5){var _0x569b6e=[0x65];return new BPromise(function(_0x1a22d1,_0x14bdec){try{if(_0x2969f5[_0x6bcb('0x54')]){_0x1a22d1(_0x569b6e);}else{return db[_0x6bcb('0x55')]['findOne']({'where':{'sectionId':_0x2969f5['id']},'raw':!![]})[_0x6bcb('0x28')](function(_0x54b070){_0x54b070?_0x1a22d1(_0x569b6e):_0x1a22d1();});}}catch(_0x26d3a1){_0x14bdec(_0x26d3a1);}});}function getCustomDashboards(_0x348bc2){var _0x4c1022=[];return new BPromise(function(_0x21b744,_0x48f266){try{if(_0x348bc2[_0x6bcb('0x54')]){return db[_0x6bcb('0x63')][_0x6bcb('0x43')]({'raw':!![]})['then'](function(_0x38cc64){_0x38cc64[_0x6bcb('0x64')](function(_0x4fcaf6){_0x4c1022[_0x6bcb('0x5c')](_0x4fcaf6['id']+0x1869f);});_0x21b744(_0x4c1022);});}else{return db[_0x6bcb('0x55')][_0x6bcb('0x43')]({'where':{'sectionId':_0x348bc2['id']},'raw':!![]})[_0x6bcb('0x28')](function(_0x308e43){_0x308e43[_0x6bcb('0x64')](function(_0x3fb53a){_0x4c1022[_0x6bcb('0x5c')](_0x3fb53a[_0x6bcb('0x65')]+0x1869f);});_0x21b744(_0x4c1022);});}}catch(_0x27121f){_0x48f266(_0x27121f);}});}function getPlugins(_0x52d94b){var _0x103ca4=[];return new BPromise(function(_0x3a51a5,_0x11ff05){try{if(_0x52d94b['autoAssociation']){return db[_0x6bcb('0x66')][_0x6bcb('0x43')]({'raw':!![]})['then'](function(_0x5a0625){_0x5a0625[_0x6bcb('0x64')](function(_0xa60301){_0x103ca4[_0x6bcb('0x5c')](_0xa60301['id']+0x15b38);});_0x3a51a5(_0x103ca4);});}else{return db[_0x6bcb('0x55')][_0x6bcb('0x43')]({'where':{'sectionId':_0x52d94b['id']},'raw':!![]})['then'](function(_0x2a253b){_0x2a253b['forEach'](function(_0x40222d){_0x103ca4[_0x6bcb('0x5c')](_0x40222d[_0x6bcb('0x65')]+0x15b38);});_0x3a51a5(_0x103ca4);});}}catch(_0x4e7c56){_0x11ff05(_0x4e7c56);}});}exports[_0x6bcb('0x67')]=function(_0x388246,_0x1bf744){return db[_0x6bcb('0x2e')]['find']({'where':{'id':_0x388246['params']['id']}})['then'](handleEntityNotFound(_0x1bf744,null))[_0x6bcb('0x28')](function(_0x2af78a){if(_0x2af78a){return db[_0x6bcb('0x50')]['transaction'](function(_0x41c308){return db['UserProfileSection'][_0x6bcb('0x43')]({'where':{'userProfileId':_0x388246['params']['id']},'attributes':['id'],'raw':!![]})[_0x6bcb('0x28')](function(_0x436d3c){if(_0x436d3c){return db['UserProfileSection'][_0x6bcb('0x29')]({'where':{'userProfileId':_0x388246[_0x6bcb('0x46')]['id'],'id':_[_0x6bcb('0x2d')](_0x436d3c,function(_0x345d2c){return _0x345d2c['id'];})},'transaction':_0x41c308});}})['then'](function(_0x23d185){var _0x2c8a3e=_[_0x6bcb('0x2d')](_0x388246[_0x6bcb('0x4b')],function(_0x1a1bce){_0x1a1bce[_0x6bcb('0x57')]=_0x388246['params']['id'];return _0x1a1bce;});return db[_0x6bcb('0x52')]['bulkCreate'](_0x2c8a3e,{'raw':!![],'transaction':_0x41c308});})[_0x6bcb('0x28')](function(_0x551680){var _0x350e27=_['filter'](_['map'](_0x551680,function(_0x289b0b){return _0x289b0b[_0x6bcb('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x350e27){return db[_0x6bcb('0x52')][_0x6bcb('0x43')]({'where':{'userProfileId':_0x388246['params']['id'],'sectionId':_[_0x6bcb('0x2d')](_0x350e27,function(_0x2ae111){return _0x2ae111[_0x6bcb('0x5b')];})},'attributes':['id',_0x6bcb('0x5b')],'raw':!![]})[_0x6bcb('0x28')](function(_0x57983a){var _0x462035=_['map'](_0x388246[_0x6bcb('0x4b')],function(_0x3e6f2c){_0x3e6f2c[_0x6bcb('0x57')]=_0x388246[_0x6bcb('0x46')]['id'];return _0x3e6f2c;});return db['UserProfileResource'][_0x6bcb('0x68')](_0x462035,{'raw':!![],'transaction':_0x41c308});});}})[_0x6bcb('0x49')](handleError(_0x1bf744,null));});}})['then'](function(_0x8afcf5){var _0xd14c23=_[_0x6bcb('0x2d')](_0x8afcf5,function(_0x35e7fb){return _0x35e7fb[_0x6bcb('0x4c')]({'plain':!![]});});})[_0x6bcb('0x28')](respondWithResult(_0x1bf744,null))[_0x6bcb('0x49')](handleError(_0x1bf744,null));};exports[_0x6bcb('0x69')]=function(_0x587b2a,_0x287bd8,_0xf0ae0c){return db[_0x6bcb('0x2e')][_0x6bcb('0x48')]({'where':{'id':_0x587b2a[_0x6bcb('0x46')]['id']}})['then'](handleEntityNotFound(_0x287bd8,null))[_0x6bcb('0x28')](function(_0xd5d6f1){if(_0xd5d6f1){return _0xd5d6f1[_0x6bcb('0x69')](_0x587b2a[_0x6bcb('0x35')][_0x6bcb('0x6a')]);}})[_0x6bcb('0x28')](respondWithStatusCode(_0x287bd8,null))[_0x6bcb('0x49')](handleError(_0x287bd8,null));};exports[_0x6bcb('0x6b')]=function(_0x55b29b,_0x4da5a4){var _0xa82d4f={};if(!_0x55b29b[_0x6bcb('0x35')][_0x6bcb('0x6c')])throw new Error('Missing\x20section\x20parameter');if(!_0x55b29b['query'][_0x6bcb('0x3a')](_0x6bcb('0x6d'))){_0xa82d4f[_0x6bcb('0x22')]=qs[_0x6bcb('0x22')](_0x55b29b[_0x6bcb('0x35')]['limit']);_0xa82d4f[_0x6bcb('0x20')]=qs[_0x6bcb('0x20')](_0x55b29b[_0x6bcb('0x35')][_0x6bcb('0x20')]);}return db[_0x6bcb('0x2e')]['find']({'where':{'id':_0x55b29b[_0x6bcb('0x46')]['id']}})[_0x6bcb('0x28')](function(_0x348d26){if(!_0x348d26)throw new Error(_0x6bcb('0x6e')+_0x55b29b['params']['id']);return db[_0x6bcb('0x2e')][_0x6bcb('0x6b')](_0x55b29b);})[_0x6bcb('0x28')](respondWithFilteredResult(_0x4da5a4,_0xa82d4f))[_0x6bcb('0x49')](handleError(_0x4da5a4,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index fc4d5a8..e4ce06e 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 _0x8af6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8af6,0x76));var _0x68af=function(_0x713fbe,_0x2872e7){_0x713fbe=_0x713fbe-0x0;var _0x1477aa=_0x8af6[_0x713fbe];return _0x1477aa;};'use strict';var EventEmitter=require(_0x68af('0x0'));var UserProfile=require(_0x68af('0x1'))['db'][_0x68af('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x68af('0x3')](0x0);var events={'afterCreate':_0x68af('0x4'),'afterUpdate':_0x68af('0x5'),'afterDestroy':_0x68af('0x6')};function emitEvent(_0xe2ba54){return function(_0x1f8b3a,_0x3d1c16,_0x52bd87){UserProfileEvents[_0x68af('0x7')](_0xe2ba54+':'+_0x1f8b3a['id'],_0x1f8b3a);UserProfileEvents['emit'](_0xe2ba54,_0x1f8b3a);_0x52bd87(null);};}for(var e in events){if(events[_0x68af('0x8')](e)){var event=events[e];UserProfile[_0x68af('0x9')](e,emitEvent(event));}}module[_0x68af('0xa')]=UserProfileEvents; \ No newline at end of file +var _0xc14a=['UserProfile','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0xc498b3,_0x5610b4){var _0x1e2530=function(_0x5c6e08){while(--_0x5c6e08){_0xc498b3['push'](_0xc498b3['shift']());}};_0x1e2530(++_0x5610b4);}(_0xc14a,0xa9));var _0xac14=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc14a[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0xac14('0x0'));var UserProfile=require(_0xac14('0x1'))['db'][_0xac14('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xac14('0x3')](0x0);var events={'afterCreate':_0xac14('0x4'),'afterUpdate':'update','afterDestroy':_0xac14('0x5')};function emitEvent(_0x21c4da){return function(_0x53f3d1,_0x412485,_0x525320){UserProfileEvents[_0xac14('0x6')](_0x21c4da+':'+_0x53f3d1['id'],_0x53f3d1);UserProfileEvents[_0xac14('0x6')](_0x21c4da,_0x53f3d1);_0x525320(null);};}for(var e in events){if(events[_0xac14('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xac14('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 96560f9..3b1fc1b 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 _0xc142=['voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','Telephones','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','intervals','Interval','pauses','Pause','sounds','tags','templates','triggers','Trigger','trunks','Trunk','plugins','Plugin','extractedreports','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','select','InteractionId','ui.createdAt','from','user_has_','where','query','toString','OpenTabs','user_profiles','../../components/parsers/qs','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','params','all','ignore','union','length','find','rawAttributes','keys','intersection','attributes','fields','nolimit','limit','offset','order','sort','filters','merge','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','reportId','CustomReports','count','ids','customSorting','extraQueryConditions','Tag','Tags','color','ThroughTags','tag','rows','openTabs','true','chat','sms','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','models','filter','field','value','associatedResources','catch','model','then','map','name','resolve','UserProfileResource','findAll','AnalyticExtractedReport','type','resourceId','toLowerCase','SquareProject','odbc','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatWebsite','faxqueues','FaxAccount','inboundroutes','internalroutes','contexts','VoiceContext','VoiceMail','voicerecordings','Agents','role','agent','User','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy'];(function(_0x4f6c8c,_0x432530){var _0x3fc3e2=function(_0x22d74d){while(--_0x22d74d){_0x4f6c8c['push'](_0x4f6c8c['shift']());}};_0x3fc3e2(++_0x432530);}(_0xc142,0x144));var _0x2c14=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0xc142[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0x2c14('0x0'));var attributes=require(_0x2c14('0x1'));var squel=require(_0x2c14('0x2'));module['exports']=function(_0x3f17cc){var _0x3d41f6=_0x3f17cc[_0x2c14('0x3')];function _0xf095d4(_0x108324,_0x16185d){return new Promise(function(_0x4b4283,_0x3c0631){if(!_0x16185d)return _0x4b4283(null);var _0x3f7de3=_0x16185d[_0x2c14('0x4')]?{[_0x16185d[_0x2c14('0x4')][_0x2c14('0x5')]]:_0x16185d[_0x2c14('0x4')][_0x2c14('0x6')]}:undefined;return _0x3d41f6[_0x108324]['findAll']({'where':_0x3f7de3,'raw':!![]})['then'](function(_0x5aab02){_0x16185d[_0x2c14('0x7')]=_['map'](_0x5aab02,'id');_0x4b4283(_0x16185d);})[_0x2c14('0x8')](function(_0x35ae4e){_0x3c0631(_0x35ae4e);});});}function _0x50444a(_0x38a4aa,_0x177e3c){return new Promise(function(_0x430967,_0xd306a){var _0x187173=_0x38a4aa[_0x2c14('0x4')]?{[_0x38a4aa[_0x2c14('0x4')][_0x2c14('0x5')]]:_0x38a4aa[_0x2c14('0x4')][_0x2c14('0x6')]}:undefined;return _0x3d41f6[_0x38a4aa[_0x2c14('0x9')]]['findAll']({'where':_0x187173,'raw':!![]})[_0x2c14('0xa')](function(_0x4ce5e4){_0x177e3c['associatedResources']=_[_0x2c14('0xb')](_0x4ce5e4,function(_0x49c4bf){return _0x49c4bf[_0x2c14('0xc')];});_0x430967(_0x177e3c);})[_0x2c14('0x8')](function(_0x4215a2){_0xd306a(_0x4215a2);});});}function _0x32bee1(_0xa7d0fa,_0x4ef8d7,_0x5e06b6){if(!_0x4ef8d7)return Promise[_0x2c14('0xd')](null);return new Promise(function(_0x33a482,_0x1adf93){return _0x3d41f6[_0x2c14('0xe')][_0x2c14('0xf')]({'where':{'sectionId':_0x4ef8d7['id']},'raw':!![]})[_0x2c14('0xa')](function(_0x314d76){if(_0xa7d0fa['field']&&_0xa7d0fa[_0x2c14('0x5')]!=='id'){_0x4ef8d7[_0x2c14('0x7')]=_[_0x2c14('0xb')](_0x314d76,function(_0x543f8c){return _0x543f8c[_0xa7d0fa[_0x2c14('0x5')]];});}else{if(_0x5e06b6===_0x2c14('0x10')){_0x4ef8d7[_0x2c14('0x7')]=_['map'](_0x314d76,function(_0x2c8a00){return{'id':_0x2c8a00['resourceId'],'type':_0x2c8a00[_0x2c14('0x11')]};});}else{_0x4ef8d7[_0x2c14('0x7')]=_['map'](_0x314d76,function(_0x388416){return _0x388416[_0x2c14('0x12')];});}}_0x33a482(_0x4ef8d7);})[_0x2c14('0x8')](function(_0xc54e9c){_0x1adf93(_0xc54e9c);});});}function _0x75c8c3(_0x286e5e,_0x1a59a4){var _0x19a75a={'parentSections':[]};switch(_0x286e5e[_0x2c14('0x13')]()){case'squareprojects':_0x19a75a['childModel']=_0x2c14('0x14');break;case _0x2c14('0x15'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x17');break;case _0x2c14('0x18'):_0x19a75a['childModel']=_0x2c14('0x19');_0x19a75a[_0x2c14('0x1a')]=[{'name':_0x2c14('0x1b'),'field':'name','foreignKey':_0x2c14('0x1c')}];break;case _0x2c14('0x1d'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x1e');break;case _0x2c14('0x1f'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x20');_0x19a75a[_0x2c14('0x1a')]=[{'name':_0x2c14('0x21'),'field':'id','foreignKey':'ListId'}];break;case _0x2c14('0x22'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x23');break;case _0x2c14('0x24'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x25');break;case _0x2c14('0x26'):_0x19a75a['childModel']='CmCustomField';break;case _0x2c14('0x27'):_0x19a75a['childModel']='ChatQueue';break;case'chatwebsites':_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x28');break;case _0x2c14('0x29'):_0x19a75a[_0x2c14('0x16')]='FaxQueue';break;case'faxaccounts':_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x2a');break;case _0x2c14('0x2b'):case _0x2c14('0x2c'):case'outboundroutes':_0x19a75a[_0x2c14('0x16')]='VoiceExtension';break;case _0x2c14('0x2d'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x2e');break;case'voicemails':_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x2f');break;case _0x2c14('0x30'):_0x19a75a[_0x2c14('0x16')]='VoiceRecording';_0x19a75a[_0x2c14('0x1a')]=[{'name':_0x2c14('0x31'),'field':_0x2c14('0xc'),'foreignKey':'membername','model':'User','filter':{'field':_0x2c14('0x32'),'value':[_0x2c14('0x33')]}},{'name':'Telephones','field':_0x2c14('0xc'),'foreignKey':'membername','model':_0x2c14('0x34'),'filter':{'field':_0x2c14('0x32'),'value':[_0x2c14('0x35')]}},{'name':_0x2c14('0x36'),'field':_0x2c14('0xc'),'foreignKey':_0x2c14('0x37'),'model':_0x2c14('0x38'),'filter':{'field':_0x2c14('0x11'),'value':['inbound']}},{'name':_0x2c14('0x39'),'field':_0x2c14('0xc'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':'type','value':[_0x2c14('0x3a')]}}];break;case'musiconholds':_0x19a75a['childModel']=_0x2c14('0x3b');break;case _0x2c14('0x3c'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x3d');break;case _0x2c14('0x3e'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x3f');break;case _0x2c14('0x40'):_0x19a75a['childModel']=_0x2c14('0x41');break;case'mailqueues':_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x42');break;case _0x2c14('0x43'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x44');break;case _0x2c14('0x45'):_0x19a75a['childModel']=_0x2c14('0x46');break;case'openchannelqueues':_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x47');break;case'openchannelaccounts':_0x19a75a[_0x2c14('0x16')]='OpenchannelAccount';break;case'smsqueues':_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x48');break;case _0x2c14('0x49'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x4a');break;case _0x2c14('0x4b'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x4c');break;case _0x2c14('0x4d'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x4e');break;case _0x2c14('0x4f'):_0x19a75a[_0x2c14('0x16')]='Team';break;case _0x2c14('0x50'):case _0x2c14('0x51'):_0x19a75a['childModel']=_0x2c14('0x38');if(_0x1a59a4){_0x19a75a[_0x2c14('0x1a')]=[{'name':_0x2c14('0x36')},{'name':_0x2c14('0x39')}];}break;case _0x2c14('0x52'):case _0x2c14('0x53'):case _0x2c14('0x54'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x34');if(_0x1a59a4){_0x19a75a[_0x2c14('0x1a')]=[{'name':_0x2c14('0x55'),'filter':{'field':_0x2c14('0x32'),'value':[_0x2c14('0x56'),_0x2c14('0x57')]},'ignore':!![]},{'name':_0x2c14('0x31')},{'name':_0x2c14('0x58')}];}break;case _0x2c14('0x59'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x5a');break;case'salesforceaccounts':_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x5b');break;case _0x2c14('0x5c'):_0x19a75a[_0x2c14('0x16')]='FreshdeskAccount';break;case _0x2c14('0x5d'):_0x19a75a['childModel']=_0x2c14('0x5e');break;case _0x2c14('0x5f'):_0x19a75a['childModel']=_0x2c14('0x60');break;case _0x2c14('0x61'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x62');break;case _0x2c14('0x63'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x34');break;case _0x2c14('0x64'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x65');break;case _0x2c14('0x66'):_0x19a75a[_0x2c14('0x16')]='Disposition';break;case _0x2c14('0x67'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x68');break;case _0x2c14('0x69'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x6a');break;case _0x2c14('0x6b'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x6c');break;case'scheduler':_0x19a75a['childModel']='Schedule';break;case _0x2c14('0x6d'):_0x19a75a['childModel']='Sound';break;case _0x2c14('0x6e'):_0x19a75a['childModel']='Tag';break;case _0x2c14('0x6f'):_0x19a75a[_0x2c14('0x16')]='Template';break;case _0x2c14('0x70'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x71');break;case _0x2c14('0x72'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x73');break;case'variables':_0x19a75a['childModel']='Variable';break;case _0x2c14('0x74'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x75');break;case _0x2c14('0x76'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x10');_0x19a75a[_0x2c14('0x1a')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0x2c14('0x77'):_0x19a75a[_0x2c14('0x16')]=_0x2c14('0x78');break;}return _0x19a75a;}function _0x2675dc(_0x54643c,_0x1e4e89){var _0x3c2b09=_0x54643c[_0x2c14('0x79')](0x0)[_0x2c14('0x7a')]()+_0x54643c['slice'](0x1);var _0x55a1de={'type':_0x3d41f6[_0x2c14('0x7b')][_0x2c14('0x7c')][_0x2c14('0x7d')],'raw':!![]};return new Promise(function(_0xc2f323,_0x4c66be){var _0x32e6f4=squel[_0x2c14('0x7e')]()[_0x2c14('0x5')]('ui.'+_0x3c2b09+_0x2c14('0x7f'),'id')[_0x2c14('0x5')](_0x2c14('0x80'))[_0x2c14('0x81')](_0x2c14('0x82')+_0x54643c+'_interactions','ui')[_0x2c14('0x83')]('ui.UserId\x20=\x20?',_0x1e4e89['id']);return _0x3d41f6['sequelize'][_0x2c14('0x84')](_0x32e6f4[_0x2c14('0x85')](),_0x55a1de)[_0x2c14('0xa')](function(_0x17e0f0){_0x1e4e89[_0x3c2b09+_0x2c14('0x86')]=_0x17e0f0;_0xc2f323(_0x17e0f0);})['catch'](function(_0xa2b5b6){_0x4c66be(_0xa2b5b6);});});}return _0x3f17cc['define']('UserProfile',attributes,{'tableName':_0x2c14('0x87'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x58753d){var _0x3e0d29=require(_0x2c14('0x88'));var _0x392861={'raw':_0x58753d[_0x2c14('0x84')][_0x2c14('0x89')],'where':{}};var _0x13b5ef={};var _0xbc0385={'count':0x0,'rows':[]};var _0x482df5=_0x58753d[_0x2c14('0x84')][_0x2c14('0x8a')];var _0x34d2db=_0x58753d[_0x2c14('0x84')][_0x2c14('0x8b')]||![];var _0x528dde=_0x75c8c3(_0x482df5,_0x34d2db);if(!_0x528dde[_0x2c14('0x16')])throw new Error(_0x2c14('0x8c')+_0x482df5+'\x27');var _0x3cd7b4=[{'name':_0x482df5}];if(!_[_0x2c14('0x8d')](_0x528dde[_0x2c14('0x1a')]))_0x3cd7b4=_0x528dde[_0x2c14('0x1a')];var _0x179c25=[];for(var _0x3525a5=0x0;_0x3525a5<_0x3cd7b4['length'];_0x3525a5++){_0x179c25[_0x2c14('0x8e')](_0x3d41f6[_0x2c14('0x8f')]['find']({'where':{'userProfileId':_0x58753d[_0x2c14('0x90')]['id'],'name':_0x3cd7b4[_0x3525a5][_0x2c14('0xc')]},'raw':!![]}));}return Promise[_0x2c14('0x91')](_0x179c25)[_0x2c14('0xa')](function(_0x360d3b){var _0x31a800=_['filter'](_0x360d3b,function(_0x130816){return _0x130816?_0x130816:undefined;});var _0x23aae7=_[_0x2c14('0x4')](_0x3cd7b4,[_0x2c14('0x92'),!![]]);var _0x52051f=_[_0x2c14('0x8d')](_0x31a800)&&_[_0x2c14('0x8d')](_0x23aae7)?null:_[_0x2c14('0x93')](_0x23aae7,_0x31a800);if(!_0x52051f)return null;var _0x286464=[];for(var _0x30998a=0x0;_0x30998a<_0x52051f[_0x2c14('0x94')];_0x30998a++){var _0x4c16ee=_[_0x2c14('0x95')](_0x3cd7b4,function(_0x423a3a){return _0x52051f[_0x30998a]?_0x423a3a[_0x2c14('0xc')]===_0x52051f[_0x30998a][_0x2c14('0xc')]:null;});if(_0x4c16ee){if(_0x52051f[_0x30998a][_0x2c14('0x92')]){_0x286464[_0x2c14('0x8e')](_0xf095d4(_0x528dde[_0x2c14('0x16')],_0x52051f[_0x30998a]));}else{if(!_0x52051f[_0x30998a]['autoAssociation']){_0x286464['push'](_0x32bee1(_0x4c16ee,_0x52051f[_0x30998a],_0x528dde[_0x2c14('0x16')]));}else{if(_0x4c16ee[_0x2c14('0x9')]){_0x286464[_0x2c14('0x8e')](_0x50444a(_0x4c16ee,_0x52051f[_0x30998a]));}}}}}return Promise[_0x2c14('0x91')](_0x286464);})[_0x2c14('0xa')](function(_0x3fa5ec){var _0x28c0c6=_0x3fa5ec;var _0x186783=null;if(_0x28c0c6){_0x186783=_0x28c0c6[_0x2c14('0x94')]===0x1?_0x28c0c6[0x0]:null;}if(!_0x186783&&!_0x28c0c6)return _0xbc0385;var _0x2cd013=_0x3d41f6[_0x528dde[_0x2c14('0x16')]][_0x2c14('0x96')];_0x13b5ef['model']=_[_0x2c14('0x97')](_0x2cd013);_0x13b5ef[_0x2c14('0x84')]=_[_0x2c14('0x97')](_0x58753d['query']);_0x13b5ef['filters']=_[_0x2c14('0x98')](_0x13b5ef[_0x2c14('0x9')],_0x13b5ef[_0x2c14('0x84')]);_0x392861[_0x2c14('0x99')]=_['intersection'](_0x13b5ef[_0x2c14('0x9')],_0x3e0d29[_0x2c14('0x9a')](_0x58753d[_0x2c14('0x84')]['fields']));_0x392861[_0x2c14('0x99')]=_0x392861['attributes'][_0x2c14('0x94')]?_0x392861[_0x2c14('0x99')]:_0x13b5ef['model'];if(!_0x58753d[_0x2c14('0x84')]['hasOwnProperty'](_0x2c14('0x9b'))){_0x392861[_0x2c14('0x9c')]=_0x3e0d29['limit'](_0x58753d[_0x2c14('0x84')][_0x2c14('0x9c')]);_0x392861[_0x2c14('0x9d')]=_0x3e0d29['offset'](_0x58753d[_0x2c14('0x84')][_0x2c14('0x9d')]);}_0x392861[_0x2c14('0x9e')]=_0x3e0d29[_0x2c14('0x9f')](_0x58753d[_0x2c14('0x84')][_0x2c14('0x9f')]);_0x392861[_0x2c14('0x83')]=_0x3e0d29[_0x2c14('0xa0')](_['pick'](_0x58753d[_0x2c14('0x84')],_0x13b5ef[_0x2c14('0xa0')]));if(_0x58753d[_0x2c14('0x84')][_0x2c14('0x4')]){_0x392861['where']=_[_0x2c14('0xa1')](_0x392861[_0x2c14('0x83')],{'$or':_[_0x2c14('0xb')](_0x2cd013,function(_0x5cdd68){if(_0x5cdd68[_0x2c14('0x11')]['key']!==_0x2c14('0xa2')){var _0x15527b={};_0x15527b[_0x5cdd68[_0x2c14('0x5')]]={'$like':'%'+_0x58753d[_0x2c14('0x84')][_0x2c14('0x4')]+'%'};return _0x15527b;}})});}var _0xb4b377=[];var _0x25bfa1=null;var _0xbe2b27={};if(_0x186783){_0x25bfa1=_['find'](_0x3cd7b4,[_0x2c14('0xc'),_0x186783['name']]);if(_0x25bfa1[_0x2c14('0x5')]){_0xbe2b27={};if(_0x528dde[_0x2c14('0x16')]==='AnalyticExtractedReport'){_0xbe2b27[_0x25bfa1[_0x2c14('0xa3')]]=_[_0x2c14('0xb')](_0x186783[_0x2c14('0x7')],'id');}else{_0xbe2b27[_0x25bfa1[_0x2c14('0xa3')]]=_0x186783['associatedResources'];}_0xb4b377['push'](_0xbe2b27);}else{_0x392861[_0x2c14('0x83')]['id']=_0x186783['associatedResources'];}}else{for(var _0x5916b6=0x0;_0x5916b6<_0x28c0c6[_0x2c14('0x94')];_0x5916b6++){_0x25bfa1=_[_0x2c14('0x95')](_0x3cd7b4,[_0x2c14('0xc'),_0x28c0c6[_0x5916b6][_0x2c14('0xc')]]);if(_0x25bfa1[_0x2c14('0x5')]){_0xbe2b27={};_0xbe2b27[_0x25bfa1[_0x2c14('0xa3')]]=_0x28c0c6[_0x5916b6][_0x2c14('0x7')];_0xb4b377[_0x2c14('0x8e')](_0xbe2b27);}else{if(!_0x392861[_0x2c14('0x83')]['id'])_0x392861[_0x2c14('0x83')]['id']=[];_0x28c0c6[_0x5916b6][_0x2c14('0x7')][_0x2c14('0xa4')](function(_0x1c9501){_0x392861[_0x2c14('0x83')]['id']['push'](_0x1c9501);});}}}if(!_['isEmpty'](_0xb4b377)){_0x392861['where']=_[_0x2c14('0xa1')](_0x392861[_0x2c14('0x83')],{'$and':{'$or':_0xb4b377}});}_0x392861=_[_0x2c14('0xa1')]({},_0x392861,_0x58753d[_0x2c14('0xa5')]);if(_0x186783&&!_0x186783['autoAssociation']&&_0x528dde[_0x2c14('0x16')]===_0x2c14('0x10')){if(_0x58753d[_0x2c14('0x84')][_0x2c14('0xa6')]){_0x392861[_0x2c14('0xa7')]=[{'all':!![]}];}return _0x3d41f6[_0x528dde[_0x2c14('0x16')]][_0x2c14('0xf')](_0x392861)[_0x2c14('0xa')](function(_0x23e64e){var _0x54307a=[];_0x23e64e['forEach'](function(_0x5aaa72){var _0xc0daba;switch(_0x5aaa72[_0x2c14('0xa8')]){case _0x2c14('0xa9'):_0xc0daba=_['find'](_0x186783[_0x2c14('0x7')],function(_0x467781){return _0x467781['id']===_0x5aaa72['reportId']&&_0x467781[_0x2c14('0x11')]===_0x2c14('0xaa');});break;case _0x2c14('0xab'):_0xc0daba=_[_0x2c14('0x95')](_0x186783[_0x2c14('0x7')],function(_0x4bc6db){return _0x4bc6db['id']===_0x5aaa72[_0x2c14('0xac')]&&_0x4bc6db[_0x2c14('0x11')]===_0x2c14('0xad');});break;}if(_0xc0daba)_0x54307a[_0x2c14('0x8e')](_0x5aaa72);});_0xbc0385[_0x2c14('0xae')]=_0x54307a[_0x2c14('0x94')];_0xbc0385['rows']=_0x54307a;return _0xbc0385;});}else{if(!_[_0x2c14('0x8d')](_0x58753d[_0x2c14('0x84')][_0x2c14('0xaf')])){_0x392861[_0x2c14('0x83')]['id']=_0x392861['where']['id']?_[_0x2c14('0x98')](_0x392861[_0x2c14('0x83')]['id'],_0x58753d[_0x2c14('0x84')]['ids']):_0x58753d[_0x2c14('0x84')][_0x2c14('0xaf')];if(_0x58753d[_0x2c14('0x84')][_0x2c14('0xb0')]){_0x392861[_0x2c14('0x9e')]=_0x58753d[_0x2c14('0x84')][_0x2c14('0xb0')];}}if(_0x58753d[_0x2c14('0x84')][_0x2c14('0xb1')]){_0x392861[_0x2c14('0x83')]=_[_0x2c14('0xa1')](_0x392861[_0x2c14('0x83')],{'$and':_0x58753d[_0x2c14('0x84')][_0x2c14('0xb1')]});}return _0x3d41f6[_0x528dde['childModel']][_0x2c14('0xae')]({'where':_0x392861['where']})[_0x2c14('0xa')](function(_0x480425){_0xbc0385['count']=_0x480425;if(_0x58753d[_0x2c14('0x84')][_0x2c14('0xa6')]){if(_0x528dde['childModel']===_0x2c14('0x20')){_0x392861[_0x2c14('0xa7')]=[{'model':_0x3d41f6[_0x2c14('0xb2')],'as':_0x2c14('0xb3'),'attributes':['id',_0x2c14('0xc'),_0x2c14('0xb4')],'required':_0x58753d[_0x2c14('0x84')]['tag']?!![]:![]},{'model':_0x3d41f6[_0x2c14('0xb2')],'as':_0x2c14('0xb5'),'attributes':['id',_0x2c14('0xc'),_0x2c14('0xb4')],'through':_0x58753d[_0x2c14('0x84')][_0x2c14('0xb6')]?{'attributes':[],'where':{'TagId':_0x58753d[_0x2c14('0x84')][_0x2c14('0xb6')]||undefined}}:{},'required':_0x58753d['query']['tag']?!![]:![]}];}else{_0x392861[_0x2c14('0xa7')]=[{'all':!![]}];}}return _0x3d41f6[_0x528dde[_0x2c14('0x16')]][_0x2c14('0xf')](_0x392861);})[_0x2c14('0xa')](function(_0x25a828){_0xbc0385[_0x2c14('0xb7')]=_0x25a828;if(_0x482df5===_0x2c14('0x31')&&_0x58753d[_0x2c14('0x84')][_0x2c14('0xb8')]===_0x2c14('0xb9')){var _0x39981f=[];for(var _0x25fb7a=0x0;_0x25fb7a<_0xbc0385[_0x2c14('0xb7')][_0x2c14('0x94')];_0x25fb7a++){_0x39981f[_0x2c14('0x8e')](_0x2675dc(_0x2c14('0xba'),_0xbc0385['rows'][_0x25fb7a]['dataValues']));_0x39981f['push'](_0x2675dc(_0x2c14('0xbb'),_0xbc0385[_0x2c14('0xb7')][_0x25fb7a][_0x2c14('0xbc')]));_0x39981f[_0x2c14('0x8e')](_0x2675dc(_0x2c14('0xbd'),_0xbc0385['rows'][_0x25fb7a][_0x2c14('0xbc')]));_0x39981f[_0x2c14('0x8e')](_0x2675dc(_0x2c14('0xbe'),_0xbc0385['rows'][_0x25fb7a]['dataValues']));_0x39981f['push'](_0x2675dc(_0x2c14('0xbf'),_0xbc0385['rows'][_0x25fb7a]['dataValues']));_0x39981f[_0x2c14('0x8e')](_0x2675dc(_0x2c14('0xc0'),_0xbc0385['rows'][_0x25fb7a][_0x2c14('0xbc')]));}return Promise[_0x2c14('0x91')](_0x39981f)[_0x2c14('0xa')](function(){return _0xbc0385;});}return _0xbc0385;});}});}}});}; \ No newline at end of file +var _0x5e37=['rows','ids','extraQueryConditions','CmContact','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','models','filter','field','value','then','map','catch','model','findAll','associatedResources','resolve','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','SquareProject','odbc','childModel','squarerecordings','SquareRecording','SquareProjects','name','projectName','projects','JscriptyProject','contacts','parentSections','ListId','lists','companies','CmCompany','globalcustomfields','chatqueues','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','agent','VoiceQueues','queue','inbound','QueueCampaigns','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','WhatsappAccount','Team','voicequeues','queuecampaigns','VoiceQueue','users','agents','Users','role','admin','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','intervals','Interval','Pause','Schedule','sounds','Sound','tags','templates','Template','triggers','variables','Variable','Plugin','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','SELECT','ui.','InteractionId','from','_interactions','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','raw','section','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','merge','key','VIRTUAL','foreignKey','forEach','options','autoAssociation','includeAll','include','reportType','default','reportId','DefaultReports','CustomReports','count'];(function(_0x338894,_0x5d3e45){var _0x17544e=function(_0x4a6918){while(--_0x4a6918){_0x338894['push'](_0x338894['shift']());}};_0x17544e(++_0x5d3e45);}(_0x5e37,0x196));var _0x75e3=function(_0x5af97c,_0x24a49f){_0x5af97c=_0x5af97c-0x0;var _0x3472ae=_0x5e37[_0x5af97c];return _0x3472ae;};'use strict';var _=require(_0x75e3('0x0'));var attributes=require(_0x75e3('0x1'));var squel=require('squel');module['exports']=function(_0x41ae0b){var _0x486ca9=_0x41ae0b[_0x75e3('0x2')];function _0x107d89(_0x58b5cb,_0x429eb3){return new Promise(function(_0x2a1960,_0x17c540){if(!_0x429eb3)return _0x2a1960(null);var _0x2c3a74=_0x429eb3[_0x75e3('0x3')]?{[_0x429eb3[_0x75e3('0x3')][_0x75e3('0x4')]]:_0x429eb3[_0x75e3('0x3')][_0x75e3('0x5')]}:undefined;return _0x486ca9[_0x58b5cb]['findAll']({'where':_0x2c3a74,'raw':!![]})[_0x75e3('0x6')](function(_0x165076){_0x429eb3['associatedResources']=_[_0x75e3('0x7')](_0x165076,'id');_0x2a1960(_0x429eb3);})[_0x75e3('0x8')](function(_0x4b4fa3){_0x17c540(_0x4b4fa3);});});}function _0x3f2be4(_0x54fbae,_0x27f8f6){return new Promise(function(_0x352a23,_0x3f4018){var _0x5492d3=_0x54fbae['filter']?{[_0x54fbae[_0x75e3('0x3')][_0x75e3('0x4')]]:_0x54fbae[_0x75e3('0x3')]['value']}:undefined;return _0x486ca9[_0x54fbae[_0x75e3('0x9')]][_0x75e3('0xa')]({'where':_0x5492d3,'raw':!![]})[_0x75e3('0x6')](function(_0x57ed1a){_0x27f8f6[_0x75e3('0xb')]=_[_0x75e3('0x7')](_0x57ed1a,function(_0x365632){return _0x365632['name'];});_0x352a23(_0x27f8f6);})[_0x75e3('0x8')](function(_0x4b8814){_0x3f4018(_0x4b8814);});});}function _0x14fafb(_0x4f76cf,_0x43081e,_0x5dc6d8){if(!_0x43081e)return Promise[_0x75e3('0xc')](null);return new Promise(function(_0x527868,_0x244fd6){return _0x486ca9['UserProfileResource']['findAll']({'where':{'sectionId':_0x43081e['id']},'raw':!![]})[_0x75e3('0x6')](function(_0xb2310){if(_0x4f76cf[_0x75e3('0x4')]&&_0x4f76cf[_0x75e3('0x4')]!=='id'){_0x43081e['associatedResources']=_[_0x75e3('0x7')](_0xb2310,function(_0x31bcbf){return _0x31bcbf[_0x4f76cf['field']];});}else{if(_0x5dc6d8===_0x75e3('0xd')){_0x43081e[_0x75e3('0xb')]=_[_0x75e3('0x7')](_0xb2310,function(_0x1c7430){return{'id':_0x1c7430[_0x75e3('0xe')],'type':_0x1c7430[_0x75e3('0xf')]};});}else{_0x43081e[_0x75e3('0xb')]=_[_0x75e3('0x7')](_0xb2310,function(_0x15c35e){return _0x15c35e[_0x75e3('0xe')];});}}_0x527868(_0x43081e);})['catch'](function(_0x387f8b){_0x244fd6(_0x387f8b);});});}function _0x3e6d57(_0x4a4ec9,_0x2f046d){var _0x518bb1={'parentSections':[]};switch(_0x4a4ec9[_0x75e3('0x10')]()){case _0x75e3('0x11'):_0x518bb1['childModel']=_0x75e3('0x12');break;case _0x75e3('0x13'):_0x518bb1[_0x75e3('0x14')]='SquareOdbc';break;case _0x75e3('0x15'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x16');_0x518bb1['parentSections']=[{'name':_0x75e3('0x17'),'field':_0x75e3('0x18'),'foreignKey':_0x75e3('0x19')}];break;case _0x75e3('0x1a'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x1b');break;case _0x75e3('0x1c'):_0x518bb1[_0x75e3('0x14')]='CmContact';_0x518bb1[_0x75e3('0x1d')]=[{'name':'Lists','field':'id','foreignKey':_0x75e3('0x1e')}];break;case _0x75e3('0x1f'):_0x518bb1[_0x75e3('0x14')]='CmList';break;case _0x75e3('0x20'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x21');break;case _0x75e3('0x22'):_0x518bb1['childModel']='CmCustomField';break;case _0x75e3('0x23'):_0x518bb1['childModel']='ChatQueue';break;case _0x75e3('0x24'):_0x518bb1[_0x75e3('0x14')]='ChatWebsite';break;case _0x75e3('0x25'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x26');break;case _0x75e3('0x27'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x28');break;case _0x75e3('0x29'):case'internalroutes':case _0x75e3('0x2a'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x2b');break;case'contexts':_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x2c');break;case _0x75e3('0x2d'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x2e');break;case _0x75e3('0x2f'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x30');_0x518bb1[_0x75e3('0x1d')]=[{'name':_0x75e3('0x31'),'field':_0x75e3('0x18'),'foreignKey':_0x75e3('0x32'),'model':_0x75e3('0x33'),'filter':{'field':'role','value':[_0x75e3('0x34')]}},{'name':'Telephones','field':'name','foreignKey':_0x75e3('0x32'),'model':'User','filter':{'field':'role','value':['telephone']}},{'name':_0x75e3('0x35'),'field':_0x75e3('0x18'),'foreignKey':_0x75e3('0x36'),'model':'VoiceQueue','filter':{'field':_0x75e3('0xf'),'value':[_0x75e3('0x37')]}},{'name':_0x75e3('0x38'),'field':'name','foreignKey':_0x75e3('0x36'),'model':'VoiceQueue','filter':{'field':_0x75e3('0xf'),'value':[_0x75e3('0x39')]}}];break;case _0x75e3('0x3a'):_0x518bb1[_0x75e3('0x14')]='VoiceMusicOnHold';break;case _0x75e3('0x3b'):_0x518bb1['childModel']=_0x75e3('0x3c');break;case _0x75e3('0x3d'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x3e');break;case _0x75e3('0x3f'):_0x518bb1['childModel']=_0x75e3('0x40');break;case _0x75e3('0x41'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x42');break;case'mailaccounts':_0x518bb1['childModel']=_0x75e3('0x43');break;case'mailsubstatuses':_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x44');break;case _0x75e3('0x45'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x46');break;case _0x75e3('0x47'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x48');break;case'smsqueues':_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x49');break;case _0x75e3('0x4a'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x4b');break;case'whatsappqueues':_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x4c');break;case'whatsappaccounts':_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x4d');break;case'teams':_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x4e');break;case _0x75e3('0x4f'):case _0x75e3('0x50'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x51');if(_0x2f046d){_0x518bb1[_0x75e3('0x1d')]=[{'name':_0x75e3('0x35')},{'name':_0x75e3('0x38')}];}break;case _0x75e3('0x52'):case _0x75e3('0x53'):case'telephones':_0x518bb1['childModel']='User';if(_0x2f046d){_0x518bb1[_0x75e3('0x1d')]=[{'name':_0x75e3('0x54'),'filter':{'field':_0x75e3('0x55'),'value':[_0x75e3('0x56'),_0x75e3('0x57')]},'ignore':!![]},{'name':_0x75e3('0x31')},{'name':_0x75e3('0x58')}];}break;case _0x75e3('0x59'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x5a');break;case _0x75e3('0x5b'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x5c');break;case _0x75e3('0x5d'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x5e');break;case _0x75e3('0x5f'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x60');break;case _0x75e3('0x61'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x62');break;case _0x75e3('0x63'):_0x518bb1[_0x75e3('0x14')]='ZohoAccount';break;case _0x75e3('0x64'):_0x518bb1['childModel']='User';break;case _0x75e3('0x65'):_0x518bb1['childModel']=_0x75e3('0x66');break;case _0x75e3('0x67'):_0x518bb1[_0x75e3('0x14')]='Disposition';break;case _0x75e3('0x68'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x69');break;case _0x75e3('0x6a'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x6b');break;case'pauses':_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x6c');break;case'scheduler':_0x518bb1['childModel']=_0x75e3('0x6d');break;case _0x75e3('0x6e'):_0x518bb1['childModel']=_0x75e3('0x6f');break;case _0x75e3('0x70'):_0x518bb1['childModel']='Tag';break;case _0x75e3('0x71'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x72');break;case _0x75e3('0x73'):_0x518bb1[_0x75e3('0x14')]='Trigger';break;case'trunks':_0x518bb1['childModel']='Trunk';break;case _0x75e3('0x74'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x75');break;case'plugins':_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x76');break;case'extractedreports':_0x518bb1[_0x75e3('0x14')]=_0x75e3('0xd');_0x518bb1['parentSections']=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0x75e3('0x77'):_0x518bb1[_0x75e3('0x14')]=_0x75e3('0x78');break;}return _0x518bb1;}function _0x2c59f4(_0x3739be,_0x28da4d){var _0x311adf=_0x3739be[_0x75e3('0x79')](0x0)[_0x75e3('0x7a')]()+_0x3739be[_0x75e3('0x7b')](0x1);var _0x22104d={'type':_0x486ca9[_0x75e3('0x7c')]['QueryTypes'][_0x75e3('0x7d')],'raw':!![]};return new Promise(function(_0x2e2bd3,_0x3dd6e3){var _0x489bb5=squel['select']()[_0x75e3('0x4')](_0x75e3('0x7e')+_0x311adf+_0x75e3('0x7f'),'id')[_0x75e3('0x4')]('ui.createdAt')[_0x75e3('0x80')]('user_has_'+_0x3739be+_0x75e3('0x81'),'ui')['where']('ui.UserId\x20=\x20?',_0x28da4d['id']);return _0x486ca9[_0x75e3('0x82')][_0x75e3('0x83')](_0x489bb5[_0x75e3('0x84')](),_0x22104d)[_0x75e3('0x6')](function(_0x3f20b8){_0x28da4d[_0x311adf+_0x75e3('0x85')]=_0x3f20b8;_0x2e2bd3(_0x3f20b8);})[_0x75e3('0x8')](function(_0x5216be){_0x3dd6e3(_0x5216be);});});}return _0x41ae0b[_0x75e3('0x86')](_0x75e3('0x87'),attributes,{'tableName':_0x75e3('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x12297a){var _0x1053e0=require(_0x75e3('0x89'));var _0x4453a9={'raw':_0x12297a[_0x75e3('0x83')][_0x75e3('0x8a')],'where':{}};var _0x4c3b38={};var _0x4b2f6d={'count':0x0,'rows':[]};var _0x2ac0f8=_0x12297a[_0x75e3('0x83')][_0x75e3('0x8b')];var _0x428e27=_0x12297a[_0x75e3('0x83')]['mergeResources']||![];var _0x486db3=_0x3e6d57(_0x2ac0f8,_0x428e27);if(!_0x486db3[_0x75e3('0x14')])throw new Error(_0x75e3('0x8c')+_0x2ac0f8+'\x27');var _0x3768bf=[{'name':_0x2ac0f8}];if(!_[_0x75e3('0x8d')](_0x486db3[_0x75e3('0x1d')]))_0x3768bf=_0x486db3[_0x75e3('0x1d')];var _0xc136b8=[];for(var _0x32aa6d=0x0;_0x32aa6d<_0x3768bf[_0x75e3('0x8e')];_0x32aa6d++){_0xc136b8[_0x75e3('0x8f')](_0x486ca9[_0x75e3('0x90')][_0x75e3('0x91')]({'where':{'userProfileId':_0x12297a[_0x75e3('0x92')]['id'],'name':_0x3768bf[_0x32aa6d][_0x75e3('0x18')]},'raw':!![]}));}return Promise[_0x75e3('0x93')](_0xc136b8)[_0x75e3('0x6')](function(_0x141636){var _0x4fa693=_[_0x75e3('0x3')](_0x141636,function(_0x273966){return _0x273966?_0x273966:undefined;});var _0x4450c7=_[_0x75e3('0x3')](_0x3768bf,[_0x75e3('0x94'),!![]]);var _0x2507b7=_[_0x75e3('0x8d')](_0x4fa693)&&_[_0x75e3('0x8d')](_0x4450c7)?null:_[_0x75e3('0x95')](_0x4450c7,_0x4fa693);if(!_0x2507b7)return null;var _0x191ad1=[];for(var _0x58dbf2=0x0;_0x58dbf2<_0x2507b7['length'];_0x58dbf2++){var _0x3e5530=_['find'](_0x3768bf,function(_0x242428){return _0x2507b7[_0x58dbf2]?_0x242428[_0x75e3('0x18')]===_0x2507b7[_0x58dbf2][_0x75e3('0x18')]:null;});if(_0x3e5530){if(_0x2507b7[_0x58dbf2][_0x75e3('0x94')]){_0x191ad1['push'](_0x107d89(_0x486db3[_0x75e3('0x14')],_0x2507b7[_0x58dbf2]));}else{if(!_0x2507b7[_0x58dbf2]['autoAssociation']){_0x191ad1[_0x75e3('0x8f')](_0x14fafb(_0x3e5530,_0x2507b7[_0x58dbf2],_0x486db3[_0x75e3('0x14')]));}else{if(_0x3e5530[_0x75e3('0x9')]){_0x191ad1[_0x75e3('0x8f')](_0x3f2be4(_0x3e5530,_0x2507b7[_0x58dbf2]));}}}}}return Promise['all'](_0x191ad1);})['then'](function(_0x4799b5){var _0x1eb480=_0x4799b5;var _0x35536d=null;if(_0x1eb480){_0x35536d=_0x1eb480[_0x75e3('0x8e')]===0x1?_0x1eb480[0x0]:null;}if(!_0x35536d&&!_0x1eb480)return _0x4b2f6d;var _0x5db3ef=_0x486ca9[_0x486db3[_0x75e3('0x14')]][_0x75e3('0x96')];_0x4c3b38[_0x75e3('0x9')]=_[_0x75e3('0x97')](_0x5db3ef);_0x4c3b38[_0x75e3('0x83')]=_[_0x75e3('0x97')](_0x12297a[_0x75e3('0x83')]);_0x4c3b38[_0x75e3('0x98')]=_[_0x75e3('0x99')](_0x4c3b38[_0x75e3('0x9')],_0x4c3b38[_0x75e3('0x83')]);_0x4453a9[_0x75e3('0x9a')]=_[_0x75e3('0x99')](_0x4c3b38[_0x75e3('0x9')],_0x1053e0[_0x75e3('0x9b')](_0x12297a['query'][_0x75e3('0x9b')]));_0x4453a9['attributes']=_0x4453a9[_0x75e3('0x9a')][_0x75e3('0x8e')]?_0x4453a9[_0x75e3('0x9a')]:_0x4c3b38[_0x75e3('0x9')];if(!_0x12297a['query'][_0x75e3('0x9c')](_0x75e3('0x9d'))){_0x4453a9[_0x75e3('0x9e')]=_0x1053e0[_0x75e3('0x9e')](_0x12297a[_0x75e3('0x83')][_0x75e3('0x9e')]);_0x4453a9[_0x75e3('0x9f')]=_0x1053e0[_0x75e3('0x9f')](_0x12297a[_0x75e3('0x83')][_0x75e3('0x9f')]);}_0x4453a9[_0x75e3('0xa0')]=_0x1053e0['sort'](_0x12297a[_0x75e3('0x83')][_0x75e3('0xa1')]);_0x4453a9[_0x75e3('0xa2')]=_0x1053e0[_0x75e3('0x98')](_[_0x75e3('0xa3')](_0x12297a['query'],_0x4c3b38['filters']));if(_0x12297a[_0x75e3('0x83')]['filter']){_0x4453a9[_0x75e3('0xa2')]=_[_0x75e3('0xa4')](_0x4453a9['where'],{'$or':_['map'](_0x5db3ef,function(_0x15aaec){if(_0x15aaec[_0x75e3('0xf')][_0x75e3('0xa5')]!==_0x75e3('0xa6')){var _0x51ad1a={};_0x51ad1a[_0x15aaec[_0x75e3('0x4')]]={'$like':'%'+_0x12297a['query'][_0x75e3('0x3')]+'%'};return _0x51ad1a;}})});}var _0xe57894=[];var _0x3a744a=null;var _0x2a3a94={};if(_0x35536d){_0x3a744a=_[_0x75e3('0x91')](_0x3768bf,[_0x75e3('0x18'),_0x35536d['name']]);if(_0x3a744a['field']){_0x2a3a94={};if(_0x486db3[_0x75e3('0x14')]===_0x75e3('0xd')){_0x2a3a94[_0x3a744a[_0x75e3('0xa7')]]=_['map'](_0x35536d[_0x75e3('0xb')],'id');}else{_0x2a3a94[_0x3a744a[_0x75e3('0xa7')]]=_0x35536d[_0x75e3('0xb')];}_0xe57894[_0x75e3('0x8f')](_0x2a3a94);}else{_0x4453a9[_0x75e3('0xa2')]['id']=_0x35536d[_0x75e3('0xb')];}}else{for(var _0x40cc33=0x0;_0x40cc33<_0x1eb480[_0x75e3('0x8e')];_0x40cc33++){_0x3a744a=_['find'](_0x3768bf,[_0x75e3('0x18'),_0x1eb480[_0x40cc33][_0x75e3('0x18')]]);if(_0x3a744a[_0x75e3('0x4')]){_0x2a3a94={};_0x2a3a94[_0x3a744a[_0x75e3('0xa7')]]=_0x1eb480[_0x40cc33]['associatedResources'];_0xe57894['push'](_0x2a3a94);}else{if(!_0x4453a9[_0x75e3('0xa2')]['id'])_0x4453a9[_0x75e3('0xa2')]['id']=[];_0x1eb480[_0x40cc33]['associatedResources'][_0x75e3('0xa8')](function(_0x36e1e2){_0x4453a9[_0x75e3('0xa2')]['id'][_0x75e3('0x8f')](_0x36e1e2);});}}}if(!_[_0x75e3('0x8d')](_0xe57894)){_0x4453a9[_0x75e3('0xa2')]=_['merge'](_0x4453a9[_0x75e3('0xa2')],{'$and':{'$or':_0xe57894}});}_0x4453a9=_[_0x75e3('0xa4')]({},_0x4453a9,_0x12297a[_0x75e3('0xa9')]);if(_0x35536d&&!_0x35536d[_0x75e3('0xaa')]&&_0x486db3['childModel']===_0x75e3('0xd')){if(_0x12297a[_0x75e3('0x83')][_0x75e3('0xab')]){_0x4453a9[_0x75e3('0xac')]=[{'all':!![]}];}return _0x486ca9[_0x486db3[_0x75e3('0x14')]][_0x75e3('0xa')](_0x4453a9)['then'](function(_0x24198f){var _0x43f8f3=[];_0x24198f[_0x75e3('0xa8')](function(_0x49368a){var _0x10b234;switch(_0x49368a[_0x75e3('0xad')]){case _0x75e3('0xae'):_0x10b234=_[_0x75e3('0x91')](_0x35536d[_0x75e3('0xb')],function(_0xa019ca){return _0xa019ca['id']===_0x49368a[_0x75e3('0xaf')]&&_0xa019ca['type']===_0x75e3('0xb0');});break;case'custom':_0x10b234=_[_0x75e3('0x91')](_0x35536d[_0x75e3('0xb')],function(_0x10bfaf){return _0x10bfaf['id']===_0x49368a['reportId']&&_0x10bfaf[_0x75e3('0xf')]===_0x75e3('0xb1');});break;}if(_0x10b234)_0x43f8f3[_0x75e3('0x8f')](_0x49368a);});_0x4b2f6d[_0x75e3('0xb2')]=_0x43f8f3[_0x75e3('0x8e')];_0x4b2f6d[_0x75e3('0xb3')]=_0x43f8f3;return _0x4b2f6d;});}else{if(!_['isEmpty'](_0x12297a[_0x75e3('0x83')][_0x75e3('0xb4')])){_0x4453a9[_0x75e3('0xa2')]['id']=_0x4453a9[_0x75e3('0xa2')]['id']?_['intersection'](_0x4453a9[_0x75e3('0xa2')]['id'],_0x12297a['query'][_0x75e3('0xb4')]):_0x12297a[_0x75e3('0x83')][_0x75e3('0xb4')];if(_0x12297a[_0x75e3('0x83')]['customSorting']){_0x4453a9['order']=_0x12297a[_0x75e3('0x83')]['customSorting'];}}if(_0x12297a[_0x75e3('0x83')][_0x75e3('0xb5')]){_0x4453a9['where']=_[_0x75e3('0xa4')](_0x4453a9['where'],{'$and':_0x12297a[_0x75e3('0x83')]['extraQueryConditions']});}return _0x486ca9[_0x486db3[_0x75e3('0x14')]][_0x75e3('0xb2')]({'where':_0x4453a9[_0x75e3('0xa2')]})[_0x75e3('0x6')](function(_0x3264ba){_0x4b2f6d[_0x75e3('0xb2')]=_0x3264ba;if(_0x12297a[_0x75e3('0x83')][_0x75e3('0xab')]){if(_0x486db3[_0x75e3('0x14')]===_0x75e3('0xb6')){_0x4453a9[_0x75e3('0xac')]=[{'model':_0x486ca9['Tag'],'as':_0x75e3('0xb7'),'attributes':['id',_0x75e3('0x18'),_0x75e3('0xb8')],'required':_0x12297a[_0x75e3('0x83')][_0x75e3('0xb9')]?!![]:![]},{'model':_0x486ca9['Tag'],'as':_0x75e3('0xba'),'attributes':['id',_0x75e3('0x18'),_0x75e3('0xb8')],'through':_0x12297a[_0x75e3('0x83')]['tag']?{'attributes':[],'where':{'TagId':_0x12297a[_0x75e3('0x83')][_0x75e3('0xb9')]||undefined}}:{},'required':_0x12297a['query'][_0x75e3('0xb9')]?!![]:![]}];}else{_0x4453a9['include']=[{'all':!![]}];}}return _0x486ca9[_0x486db3['childModel']][_0x75e3('0xa')](_0x4453a9);})[_0x75e3('0x6')](function(_0x592f61){_0x4b2f6d[_0x75e3('0xb3')]=_0x592f61;if(_0x2ac0f8===_0x75e3('0x31')&&_0x12297a[_0x75e3('0x83')][_0x75e3('0xbb')]===_0x75e3('0xbc')){var _0x2c8bfd=[];for(var _0x34d816=0x0;_0x34d816<_0x4b2f6d[_0x75e3('0xb3')][_0x75e3('0x8e')];_0x34d816++){_0x2c8bfd[_0x75e3('0x8f')](_0x2c59f4(_0x75e3('0xbd'),_0x4b2f6d['rows'][_0x34d816]['dataValues']));_0x2c8bfd[_0x75e3('0x8f')](_0x2c59f4('sms',_0x4b2f6d['rows'][_0x34d816][_0x75e3('0xbe')]));_0x2c8bfd[_0x75e3('0x8f')](_0x2c59f4(_0x75e3('0xbf'),_0x4b2f6d[_0x75e3('0xb3')][_0x34d816][_0x75e3('0xbe')]));_0x2c8bfd[_0x75e3('0x8f')](_0x2c59f4(_0x75e3('0xc0'),_0x4b2f6d[_0x75e3('0xb3')][_0x34d816][_0x75e3('0xbe')]));_0x2c8bfd[_0x75e3('0x8f')](_0x2c59f4(_0x75e3('0xc1'),_0x4b2f6d['rows'][_0x34d816][_0x75e3('0xbe')]));_0x2c8bfd['push'](_0x2c59f4(_0x75e3('0xc2'),_0x4b2f6d[_0x75e3('0xb3')][_0x34d816][_0x75e3('0xbe')]));}return Promise['all'](_0x2c8bfd)[_0x75e3('0x6')](function(){return _0x4b2f6d;});}return _0x4b2f6d;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index b975be8..5b34034 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 _0x0424=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./userProfile.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','UserProfile,\x20%s,\x20%s','message'];(function(_0x2f4c1c,_0x5a3dd4){var _0x25e0f2=function(_0x46ea31){while(--_0x46ea31){_0x2f4c1c['push'](_0x2f4c1c['shift']());}};_0x25e0f2(++_0x5a3dd4);}(_0x0424,0x159));var _0x4042=function(_0x12b449,_0x2b8a36){_0x12b449=_0x12b449-0x0;var _0x4e3784=_0x0424[_0x12b449];return _0x4e3784;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4042('0x0'));var BPromise=require(_0x4042('0x1'));var rs=require(_0x4042('0x2'));var fs=require('fs');var Redis=require(_0x4042('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4042('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4042('0x5'));var jayson=require(_0x4042('0x6'));var client=jayson[_0x4042('0x7')][_0x4042('0x8')]({'port':0x232a});config[_0x4042('0x9')]=_[_0x4042('0xa')](config[_0x4042('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4042('0x9')]));require(_0x4042('0xb'))[_0x4042('0xc')](socket);function respondWithRpcPromise(_0x4b92d2,_0x341152,_0x11c0f7){return new BPromise(function(_0x2376a4,_0x2cbc75){return client[_0x4042('0xd')](_0x4b92d2,_0x11c0f7)[_0x4042('0xe')](function(_0x380aa0){logger[_0x4042('0xf')]('UserProfile,\x20%s,\x20%s',_0x341152,_0x4042('0x10'));logger[_0x4042('0x11')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x341152,_0x4042('0x10'),JSON[_0x4042('0x12')](_0x380aa0));if(_0x380aa0[_0x4042('0x13')]){if(_0x380aa0[_0x4042('0x13')][_0x4042('0x14')]===0x1f4){logger[_0x4042('0x13')](_0x4042('0x15'),_0x341152,_0x380aa0['error'][_0x4042('0x16')]);return _0x2cbc75(_0x380aa0[_0x4042('0x13')]['message']);}logger[_0x4042('0x13')](_0x4042('0x15'),_0x341152,_0x380aa0[_0x4042('0x13')][_0x4042('0x16')]);return _0x2376a4(_0x380aa0[_0x4042('0x13')][_0x4042('0x16')]);}else{logger[_0x4042('0xf')](_0x4042('0x15'),_0x341152,_0x4042('0x10'));_0x2376a4(_0x380aa0['result'][_0x4042('0x16')]);}})['catch'](function(_0x9c8357){logger['error'](_0x4042('0x15'),_0x341152,_0x9c8357);_0x2cbc75(_0x9c8357);});});} \ No newline at end of file +var _0x1d63=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2f0d21,_0x337d41){var _0x3e47c0=function(_0x29be1){while(--_0x29be1){_0x2f0d21['push'](_0x2f0d21['shift']());}};_0x3e47c0(++_0x337d41);}(_0x1d63,0xa4));var _0x31d6=function(_0x4cade2,_0x14a2ae){_0x4cade2=_0x4cade2-0x0;var _0x42dd0c=_0x1d63[_0x4cade2];return _0x42dd0c;};'use strict';var _=require(_0x31d6('0x0'));var util=require(_0x31d6('0x1'));var moment=require(_0x31d6('0x2'));var BPromise=require(_0x31d6('0x3'));var rs=require(_0x31d6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31d6('0x5'))['db'];var utils=require(_0x31d6('0x6'));var logger=require(_0x31d6('0x7'))(_0x31d6('0x8'));var config=require(_0x31d6('0x9'));var jayson=require(_0x31d6('0xa'));var client=jayson[_0x31d6('0xb')]['http']({'port':0x232a});config[_0x31d6('0xc')]=_[_0x31d6('0xd')](config['redis'],{'host':_0x31d6('0xe'),'port':0x18eb});var socket=require(_0x31d6('0xf'))(new Redis(config['redis']));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x2962d5,_0x341424,_0x309039){return new BPromise(function(_0x5f00b8,_0x12d5cc){return client[_0x31d6('0x10')](_0x2962d5,_0x309039)[_0x31d6('0x11')](function(_0x2e79f9){logger[_0x31d6('0x12')]('UserProfile,\x20%s,\x20%s',_0x341424,_0x31d6('0x13'));logger[_0x31d6('0x14')](_0x31d6('0x15'),_0x341424,_0x31d6('0x13'),JSON[_0x31d6('0x16')](_0x2e79f9));if(_0x2e79f9[_0x31d6('0x17')]){if(_0x2e79f9['error'][_0x31d6('0x18')]===0x1f4){logger[_0x31d6('0x17')](_0x31d6('0x19'),_0x341424,_0x2e79f9[_0x31d6('0x17')]['message']);return _0x12d5cc(_0x2e79f9[_0x31d6('0x17')]['message']);}logger[_0x31d6('0x17')](_0x31d6('0x19'),_0x341424,_0x2e79f9[_0x31d6('0x17')][_0x31d6('0x1a')]);return _0x5f00b8(_0x2e79f9[_0x31d6('0x17')][_0x31d6('0x1a')]);}else{logger['info'](_0x31d6('0x19'),_0x341424,_0x31d6('0x13'));_0x5f00b8(_0x2e79f9[_0x31d6('0x1b')][_0x31d6('0x1a')]);}})[_0x31d6('0x1c')](function(_0x19a279){logger['error'](_0x31d6('0x19'),_0x341424,_0x19a279);_0x12d5cc(_0x19a279);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 649da26..288a572 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 _0x5e84=['removeListener','register','length','userProfile:','./userProfile.events','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e84,0x15b));var _0x45e8=function(_0x1d1dfd,_0x31ff66){_0x1d1dfd=_0x1d1dfd-0x0;var _0x1eaa5a=_0x5e84[_0x1d1dfd];return _0x1eaa5a;};'use strict';var UserProfileEvents=require(_0x45e8('0x0'));var events=[_0x45e8('0x1'),'remove',_0x45e8('0x2')];function createListener(_0x366df2,_0x5b1349){return function(_0x2ccef8){_0x5b1349['emit'](_0x366df2,_0x2ccef8);};}function removeListener(_0x43e86f,_0x187c9e){return function(){UserProfileEvents[_0x45e8('0x3')](_0x43e86f,_0x187c9e);};}exports[_0x45e8('0x4')]=function(_0x2f2d85){for(var _0x4079e2=0x0,_0x1a3986=events[_0x45e8('0x5')];_0x4079e2<_0x1a3986;_0x4079e2++){var _0x47cee6=events[_0x4079e2];var _0x4653a8=createListener(_0x45e8('0x6')+_0x47cee6,_0x2f2d85);UserProfileEvents['on'](_0x47cee6,_0x4653a8);}}; \ No newline at end of file +var _0x9dbc=['emit','removeListener','register','length','./userProfile.events','remove','update'];(function(_0x31c6b6,_0x2f484c){var _0x2d994a=function(_0x52cc63){while(--_0x52cc63){_0x31c6b6['push'](_0x31c6b6['shift']());}};_0x2d994a(++_0x2f484c);}(_0x9dbc,0x6d));var _0xc9db=function(_0x3db4df,_0x1e53fe){_0x3db4df=_0x3db4df-0x0;var _0x4c6ec4=_0x9dbc[_0x3db4df];return _0x4c6ec4;};'use strict';var UserProfileEvents=require(_0xc9db('0x0'));var events=['save',_0xc9db('0x1'),_0xc9db('0x2')];function createListener(_0x385795,_0x13142d){return function(_0x3d61b4){_0x13142d[_0xc9db('0x3')](_0x385795,_0x3d61b4);};}function removeListener(_0x293d20,_0x102c79){return function(){UserProfileEvents[_0xc9db('0x4')](_0x293d20,_0x102c79);};}exports[_0xc9db('0x5')]=function(_0x509bc7){for(var _0x13b6d6=0x0,_0x2f30eb=events[_0xc9db('0x6')];_0x13b6d6<_0x2f30eb;_0x13b6d6++){var _0x6f110a=events[_0x13b6d6];var _0x455326=createListener('userProfile:'+_0x6f110a,_0x509bc7);UserProfileEvents['on'](_0x6f110a,_0x455326);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index dcb3c1d..5fd0d45 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 _0x4c73=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4ce34b,_0x79ecec){var _0x408d1d=function(_0x4acc45){while(--_0x4acc45){_0x4ce34b['push'](_0x4ce34b['shift']());}};_0x408d1d(++_0x79ecec);}(_0x4c73,0x14c));var _0x34c7=function(_0x114942,_0x3bae7f){_0x114942=_0x114942-0x0;var _0x4b409a=_0x4c73[_0x114942];return _0x4b409a;};'use strict';var multer=require(_0x34c7('0x0'));var util=require(_0x34c7('0x1'));var path=require(_0x34c7('0x2'));var timeout=require(_0x34c7('0x3'));var express=require(_0x34c7('0x4'));var router=express[_0x34c7('0x5')]();var fs_extra=require(_0x34c7('0x6'));var auth=require(_0x34c7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x34c7('0x8'));var controller=require(_0x34c7('0x9'));router[_0x34c7('0xa')]('/',auth[_0x34c7('0xb')](),controller[_0x34c7('0xc')]);router[_0x34c7('0xa')]('/describe',auth[_0x34c7('0xb')](),controller['describe']);router[_0x34c7('0xa')](_0x34c7('0xd'),auth['isAuthenticated'](),controller[_0x34c7('0xe')]);router['post']('/',auth[_0x34c7('0xb')](),controller[_0x34c7('0xf')]);router[_0x34c7('0x10')](_0x34c7('0xd'),auth[_0x34c7('0xb')](),controller[_0x34c7('0x11')]);router[_0x34c7('0x12')](_0x34c7('0xd'),auth[_0x34c7('0xb')](),controller[_0x34c7('0x13')]);module[_0x34c7('0x14')]=router; \ No newline at end of file +var _0x5871=['/describe','/:id','show','create','update','delete','exports','path','connect-timeout','Router','../../components/auth/service','./userProfileResource.controller','isAuthenticated','get'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x5871,0x173));var _0x1587=function(_0x84316,_0x2cf428){_0x84316=_0x84316-0x0;var _0x5bced7=_0x5871[_0x84316];return _0x5bced7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1587('0x0'));var timeout=require(_0x1587('0x1'));var express=require('express');var router=express[_0x1587('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1587('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1587('0x4'));router['get']('/',auth[_0x1587('0x5')](),controller['index']);router[_0x1587('0x6')](_0x1587('0x7'),auth[_0x1587('0x5')](),controller['describe']);router[_0x1587('0x6')](_0x1587('0x8'),auth[_0x1587('0x5')](),controller[_0x1587('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1587('0xa')]);router['put'](_0x1587('0x8'),auth['isAuthenticated'](),controller[_0x1587('0xb')]);router[_0x1587('0xc')](_0x1587('0x8'),auth[_0x1587('0x5')](),controller['destroy']);module[_0x1587('0xd')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 155461f..7a7a366 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 _0x8348=['STRING','INTEGER','sequelize','exports'];(function(_0xd9f651,_0x32fcbe){var _0x1f3d94=function(_0xa5e386){while(--_0xa5e386){_0xd9f651['push'](_0xd9f651['shift']());}};_0x1f3d94(++_0x32fcbe);}(_0x8348,0x1b6));var _0x8834=function(_0x222815,_0x21f839){_0x222815=_0x222815-0x0;var _0x31830a=_0x8348[_0x222815];return _0x31830a;};'use strict';var Sequelize=require(_0x8834('0x0'));module[_0x8834('0x1')]={'name':{'type':Sequelize[_0x8834('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x8834('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8834('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x893d=['exports','STRING','sequelize'];(function(_0xf39b7d,_0x4a9dc2){var _0x29e7de=function(_0x5a5584){while(--_0x5a5584){_0xf39b7d['push'](_0xf39b7d['shift']());}};_0x29e7de(++_0x4a9dc2);}(_0x893d,0x1f4));var _0xd893=function(_0xbfdbf,_0x306bda){_0xbfdbf=_0xbfdbf-0x0;var _0x409398=_0x893d[_0xbfdbf];return _0x409398;};'use strict';var Sequelize=require(_0xd893('0x0'));module[_0xd893('0x1')]={'name':{'type':Sequelize[_0xd893('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xd893('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index ac75f09..2db5c41 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 _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(_0x293221,_0x20268e){var _0x54bd3d=function(_0x2aa164){while(--_0x2aa164){_0x293221['push'](_0x293221['shift']());}};_0x54bd3d(++_0x20268e);}(_0x4975,0x86));var _0x5497=function(_0x425a98,_0x3c026e){_0x425a98=_0x425a98-0x0;var _0x2b9675=_0x4975[_0x425a98];return _0x2b9675;};'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 +var _0x2ef3=['name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','UserProfileResource','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack'];(function(_0x5ed7f1,_0xaa2a4){var _0x432629=function(_0x103732){while(--_0x103732){_0x5ed7f1['push'](_0x5ed7f1['shift']());}};_0x432629(++_0xaa2a4);}(_0x2ef3,0xba));var _0x32ef=function(_0xd4928b,_0x1d0518){_0xd4928b=_0xd4928b-0x0;var _0x4451ee=_0x2ef3[_0xd4928b];return _0x4451ee;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['UserProfileResource'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['UserProfileResource'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['UserProfileResource']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};exports['describe']=function(_0x179c2f,_0x259c32){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]()[_0x32ef('0x3e')](respondWithResult(_0x259c32,null))[_0x32ef('0x42')](handleError(_0x259c32,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 540bbaa..a43d9da 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 _0xe22b=['exports','define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x35eb6d,_0x5f62ea){var _0x332e7f=function(_0x284b1e){while(--_0x284b1e){_0x35eb6d['push'](_0x35eb6d['shift']());}};_0x332e7f(++_0x5f62ea);}(_0xe22b,0x165));var _0xbe22=function(_0x402955,_0x3ce138){_0x402955=_0x402955-0x0;var _0x4251c6=_0xe22b[_0x402955];return _0x4251c6;};'use strict';var _=require(_0xbe22('0x0'));var util=require('util');var logger=require(_0xbe22('0x1'))(_0xbe22('0x2'));var moment=require(_0xbe22('0x3'));var BPromise=require(_0xbe22('0x4'));var rp=require(_0xbe22('0x5'));var fs=require('fs');var path=require(_0xbe22('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0xbe22('0x7')]=function(_0xc0ea25,_0x581e47){return _0xc0ea25[_0xbe22('0x8')](_0xbe22('0x9'),attributes,{'tableName':_0xbe22('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xbe22('0xb'),_0xbe22('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc0b7=['../../config/logger','moment','bluebird','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','resourceId','lodash','util'];(function(_0x141604,_0x891222){var _0x47faa8=function(_0x155956){while(--_0x155956){_0x141604['push'](_0x141604['shift']());}};_0x47faa8(++_0x891222);}(_0xc0b7,0xca));var _0x7c0b=function(_0x1d143d,_0x50f94b){_0x1d143d=_0x1d143d-0x0;var _0x2e6458=_0xc0b7[_0x1d143d];return _0x2e6458;};'use strict';var _=require(_0x7c0b('0x0'));var util=require(_0x7c0b('0x1'));var logger=require(_0x7c0b('0x2'))('api');var moment=require(_0x7c0b('0x3'));var BPromise=require(_0x7c0b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7c0b('0x5'));var config=require(_0x7c0b('0x6'));var attributes=require(_0x7c0b('0x7'));module[_0x7c0b('0x8')]=function(_0x3972e1,_0x4f737c){return _0x3972e1['define'](_0x7c0b('0x9'),attributes,{'tableName':_0x7c0b('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x7c0b('0xb'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 96393bf..fc6f3b7 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 _0xc25a=['UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','request','then','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x12c2dd,_0x3fb931){var _0x2f8f7b=function(_0x503c6f){while(--_0x503c6f){_0x12c2dd['push'](_0x12c2dd['shift']());}};_0x2f8f7b(++_0x3fb931);}(_0xc25a,0xeb));var _0xac25=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xc25a[_0x24f31b];return _0x488401;};'use strict';var _=require(_0xac25('0x0'));var util=require(_0xac25('0x1'));var moment=require(_0xac25('0x2'));var BPromise=require(_0xac25('0x3'));var rs=require(_0xac25('0x4'));var fs=require('fs');var Redis=require(_0xac25('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xac25('0x6'));var logger=require(_0xac25('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f3d48,_0x476dac,_0x3aeda1){return new BPromise(function(_0x56b25d,_0x2aab4f){return client[_0xac25('0x8')](_0x1f3d48,_0x3aeda1)[_0xac25('0x9')](function(_0x377c3d){logger[_0xac25('0xa')](_0xac25('0xb'),_0x476dac,'request\x20sent');logger['debug'](_0xac25('0xc'),_0x476dac,'request\x20sent',JSON[_0xac25('0xd')](_0x377c3d));if(_0x377c3d['error']){if(_0x377c3d[_0xac25('0xe')][_0xac25('0xf')]===0x1f4){logger[_0xac25('0xe')](_0xac25('0xb'),_0x476dac,_0x377c3d['error'][_0xac25('0x10')]);return _0x2aab4f(_0x377c3d[_0xac25('0xe')][_0xac25('0x10')]);}logger[_0xac25('0xe')](_0xac25('0xb'),_0x476dac,_0x377c3d[_0xac25('0xe')][_0xac25('0x10')]);return _0x56b25d(_0x377c3d[_0xac25('0xe')]['message']);}else{logger[_0xac25('0xa')](_0xac25('0xb'),_0x476dac,'request\x20sent');_0x56b25d(_0x377c3d[_0xac25('0x11')]['message']);}})[_0xac25('0x12')](function(_0x1653f8){logger[_0xac25('0xe')](_0xac25('0xb'),_0x476dac,_0x1653f8);_0x2aab4f(_0x1653f8);});});} \ No newline at end of file +var _0xcd6e=['http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4f8f3b,_0x43281b){var _0x4c250c=function(_0x19a7ff){while(--_0x19a7ff){_0x4f8f3b['push'](_0x4f8f3b['shift']());}};_0x4c250c(++_0x43281b);}(_0xcd6e,0x198));var _0xecd6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd6e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xecd6('0x0'));var util=require(_0xecd6('0x1'));var moment=require(_0xecd6('0x2'));var BPromise=require(_0xecd6('0x3'));var rs=require(_0xecd6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xecd6('0x5'));var logger=require(_0xecd6('0x6'))(_0xecd6('0x7'));var config=require(_0xecd6('0x8'));var jayson=require(_0xecd6('0x9'));var client=jayson['client'][_0xecd6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x347ea3,_0x353f07,_0xbbafe0){return new BPromise(function(_0x1af632,_0x1f7e96){return client[_0xecd6('0xb')](_0x347ea3,_0xbbafe0)[_0xecd6('0xc')](function(_0xc1c93){logger[_0xecd6('0xd')](_0xecd6('0xe'),_0x353f07,_0xecd6('0xf'));logger[_0xecd6('0x10')](_0xecd6('0x11'),_0x353f07,_0xecd6('0xf'),JSON[_0xecd6('0x12')](_0xc1c93));if(_0xc1c93[_0xecd6('0x13')]){if(_0xc1c93[_0xecd6('0x13')][_0xecd6('0x14')]===0x1f4){logger[_0xecd6('0x13')](_0xecd6('0xe'),_0x353f07,_0xc1c93[_0xecd6('0x13')][_0xecd6('0x15')]);return _0x1f7e96(_0xc1c93[_0xecd6('0x13')]['message']);}logger[_0xecd6('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x353f07,_0xc1c93['error']['message']);return _0x1af632(_0xc1c93['error']['message']);}else{logger[_0xecd6('0xd')](_0xecd6('0xe'),_0x353f07,_0xecd6('0xf'));_0x1af632(_0xc1c93['result']['message']);}})['catch'](function(_0x1a2c83){logger[_0xecd6('0x13')](_0xecd6('0xe'),_0x353f07,_0x1a2c83);_0x1f7e96(_0x1a2c83);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 9fc1086..3dd89d5 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 _0xdd03=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x1645fb,_0x6ad68c){var _0x171ce7=function(_0x4a0689){while(--_0x4a0689){_0x1645fb['push'](_0x1645fb['shift']());}};_0x171ce7(++_0x6ad68c);}(_0xdd03,0xfb));var _0x3dd0=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xdd03[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x3dd0('0x0'));var util=require(_0x3dd0('0x1'));var path=require(_0x3dd0('0x2'));var timeout=require(_0x3dd0('0x3'));var express=require(_0x3dd0('0x4'));var router=express[_0x3dd0('0x5')]();var fs_extra=require(_0x3dd0('0x6'));var auth=require(_0x3dd0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3dd0('0x8'));var controller=require('./userProfileSection.controller');router[_0x3dd0('0x9')]('/',auth[_0x3dd0('0xa')](),controller[_0x3dd0('0xb')]);router[_0x3dd0('0x9')](_0x3dd0('0xc'),auth[_0x3dd0('0xa')](),controller[_0x3dd0('0xd')]);router[_0x3dd0('0x9')](_0x3dd0('0xe'),auth[_0x3dd0('0xa')](),controller[_0x3dd0('0xf')]);router[_0x3dd0('0x10')]('/',auth[_0x3dd0('0xa')](),controller[_0x3dd0('0x11')]);router[_0x3dd0('0x12')](_0x3dd0('0xe'),auth[_0x3dd0('0xa')](),controller[_0x3dd0('0x13')]);router[_0x3dd0('0x14')](_0x3dd0('0xe'),auth[_0x3dd0('0xa')](),controller[_0x3dd0('0x15')]);module[_0x3dd0('0x16')]=router; \ No newline at end of file +var _0x9867=['isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get'];(function(_0x617b52,_0x460e19){var _0x447bb4=function(_0x55885a){while(--_0x55885a){_0x617b52['push'](_0x617b52['shift']());}};_0x447bb4(++_0x460e19);}(_0x9867,0x75));var _0x7986=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9867[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x7986('0x0'));var util=require(_0x7986('0x1'));var path=require('path');var timeout=require(_0x7986('0x2'));var express=require('express');var router=express[_0x7986('0x3')]();var fs_extra=require(_0x7986('0x4'));var auth=require(_0x7986('0x5'));var interaction=require(_0x7986('0x6'));var config=require('../../config/environment');var controller=require(_0x7986('0x7'));router[_0x7986('0x8')]('/',auth[_0x7986('0x9')](),controller[_0x7986('0xa')]);router['get']('/describe',auth[_0x7986('0x9')](),controller[_0x7986('0xb')]);router[_0x7986('0x8')](_0x7986('0xc'),auth[_0x7986('0x9')](),controller[_0x7986('0xd')]);router[_0x7986('0xe')]('/',auth[_0x7986('0x9')](),controller[_0x7986('0xf')]);router[_0x7986('0x10')](_0x7986('0xc'),auth[_0x7986('0x9')](),controller[_0x7986('0x11')]);router[_0x7986('0x12')](_0x7986('0xc'),auth[_0x7986('0x9')](),controller[_0x7986('0x13')]);module[_0x7986('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 0d55ee6..93a726a 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 _0x4cf8=['split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x3e8e5f,_0x2d8824){var _0x4c6e94=function(_0x29924f){while(--_0x29924f){_0x3e8e5f['push'](_0x3e8e5f['shift']());}};_0x4c6e94(++_0x2d8824);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0x4cf8[_0x15ca1a];return _0x507626;};'use strict';var Sequelize=require(_0x84cf('0x0'));module[_0x84cf('0x1')]={'name':{'type':Sequelize[_0x84cf('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x84cf('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x84cf('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x84cf('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x84cf('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x84cf('0x2')],'set':function(_0x3bbbc3){this[_0x84cf('0x5')](_0x84cf('0x6'),_0x3bbbc3?_0x3bbbc3[_0x84cf('0x7')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x84cf('0x8')]('crudPermissions')[_0x84cf('0x9')](''):[];}}}; \ No newline at end of file +var _0xb9a7=['getDataValue','split','exports','BOOLEAN','STRING','setDataValue','crudPermissions','join'];(function(_0x1e0bee,_0x62f689){var _0x266289=function(_0x1dce7f){while(--_0x1dce7f){_0x1e0bee['push'](_0x1e0bee['shift']());}};_0x266289(++_0x62f689);}(_0xb9a7,0x112));var _0x7b9a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xb9a7[_0x255d5b];return _0x3e141a;};'use strict';var Sequelize=require('sequelize');module[_0x7b9a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x7b9a('0x1')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x7b9a('0x2')],'set':function(_0x40ef7d){this[_0x7b9a('0x3')](_0x7b9a('0x4'),_0x40ef7d?_0x40ef7d[_0x7b9a('0x5')](''):[]);},'get':function(){return this[_0x7b9a('0x6')](_0x7b9a('0x4'))?this[_0x7b9a('0x6')](_0x7b9a('0x4'))[_0x7b9a('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index d2002be..6f74d7b 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 _0xff69=['name','send','index','map','UserProfileSection','rawAttributes','fieldName','model','query','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','keys','intersection','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','count','offset','apply','reject','save','update','then','destroy','error','stack'];(function(_0x458363,_0x1675db){var _0x4d0290=function(_0x22960f){while(--_0x22960f){_0x458363['push'](_0x458363['shift']());}};_0x4d0290(++_0x1675db);}(_0xff69,0x6b));var _0x9ff6=function(_0x256422,_0x367394){_0x256422=_0x256422-0x0;var _0x55dddc=_0xff69[_0x256422];return _0x55dddc;};'use strict';var emlformat=require(_0x9ff6('0x0'));var rimraf=require(_0x9ff6('0x1'));var zipdir=require(_0x9ff6('0x2'));var jsonpatch=require(_0x9ff6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9ff6('0x4'));var Mustache=require(_0x9ff6('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9ff6('0x6'));var ejs=require(_0x9ff6('0x7'));var fs=require('fs');var fs_extra=require(_0x9ff6('0x8'));var _=require(_0x9ff6('0x9'));var squel=require(_0x9ff6('0xa'));var crypto=require('crypto');var jsforce=require(_0x9ff6('0xb'));var deskjs=require(_0x9ff6('0xc'));var toCsv=require(_0x9ff6('0x6'));var querystring=require(_0x9ff6('0xd'));var Papa=require(_0x9ff6('0xe'));var Redis=require(_0x9ff6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9ff6('0x10'));var as=require(_0x9ff6('0x11'));var hardwareService=require(_0x9ff6('0x12'));var logger=require(_0x9ff6('0x13'))('api');var utils=require(_0x9ff6('0x14'));var config=require(_0x9ff6('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ab181,_0x117fe2){_0x117fe2=_0x117fe2||0xcc;return function(_0x40a2b2){if(_0x40a2b2){return _0x3ab181[_0x9ff6('0x16')](_0x117fe2);}return _0x3ab181[_0x9ff6('0x17')](_0x117fe2)[_0x9ff6('0x18')]();};}function respondWithResult(_0x111551,_0x56b4c7){_0x56b4c7=_0x56b4c7||0xc8;return function(_0xf1cf9b){if(_0xf1cf9b){return _0x111551['status'](_0x56b4c7)['json'](_0xf1cf9b);}};}function respondWithFilteredResult(_0x8580ba,_0x26a47b){return function(_0x22229c){if(_0x22229c){var _0x236537=typeof _0x26a47b['offset']===_0x9ff6('0x19')&&typeof _0x26a47b[_0x9ff6('0x1a')]==='undefined';var _0x4358ed=_0x22229c[_0x9ff6('0x1b')];var _0x456d9b=_0x236537?0x0:_0x26a47b[_0x9ff6('0x1c')];var _0x1b292c=_0x236537?_0x22229c['count']:_0x26a47b['offset']+_0x26a47b[_0x9ff6('0x1a')];var _0x16b4c6;if(_0x1b292c>=_0x4358ed){_0x1b292c=_0x4358ed;_0x16b4c6=0xc8;}else{_0x16b4c6=0xce;}_0x8580ba[_0x9ff6('0x17')](_0x16b4c6);return _0x8580ba['set']('Content-Range',_0x456d9b+'-'+_0x1b292c+'/'+_0x4358ed)['json'](_0x22229c);}return null;};}function patchUpdates(_0xf01224){return function(_0x4626d6){try{jsonpatch[_0x9ff6('0x1d')](_0x4626d6,_0xf01224,!![]);}catch(_0x37250d){return BPromise[_0x9ff6('0x1e')](_0x37250d);}return _0x4626d6[_0x9ff6('0x1f')]();};}function saveUpdates(_0x3a1100,_0x3fb84e){return function(_0x1a387b){if(_0x1a387b){return _0x1a387b[_0x9ff6('0x20')](_0x3a1100)[_0x9ff6('0x21')](function(_0xec2f4d){return _0xec2f4d;});}return null;};}function removeEntity(_0x1eb9a4,_0x40a43f){return function(_0x5219ca){if(_0x5219ca){return _0x5219ca[_0x9ff6('0x22')]()[_0x9ff6('0x21')](function(){_0x1eb9a4[_0x9ff6('0x17')](0xcc)[_0x9ff6('0x18')]();});}};}function handleEntityNotFound(_0x18f8ea,_0x2b49c3){return function(_0x1b4e16){if(!_0x1b4e16){_0x18f8ea[_0x9ff6('0x16')](0x194);}return _0x1b4e16;};}function handleError(_0x2c8f83,_0x335827){_0x335827=_0x335827||0x1f4;return function(_0x387901){logger[_0x9ff6('0x23')](_0x387901[_0x9ff6('0x24')]);if(_0x387901[_0x9ff6('0x25')]){delete _0x387901[_0x9ff6('0x25')];}_0x2c8f83[_0x9ff6('0x17')](_0x335827)[_0x9ff6('0x26')](_0x387901);};}exports[_0x9ff6('0x27')]=function(_0x5d71ea,_0x422138){var _0x398119={},_0xdb81={},_0x3121de={'count':0x0,'rows':[]};var _0x42ba22=_[_0x9ff6('0x28')](db[_0x9ff6('0x29')][_0x9ff6('0x2a')],function(_0x53fda2){return{'name':_0x53fda2[_0x9ff6('0x2b')],'type':_0x53fda2['type']['key']};});_0xdb81[_0x9ff6('0x2c')]=_[_0x9ff6('0x28')](_0x42ba22,_0x9ff6('0x25'));_0xdb81[_0x9ff6('0x2d')]=_['keys'](_0x5d71ea[_0x9ff6('0x2d')]);_0xdb81[_0x9ff6('0x2e')]=_['intersection'](_0xdb81[_0x9ff6('0x2c')],_0xdb81['query']);_0x398119[_0x9ff6('0x2f')]=_['intersection'](_0xdb81[_0x9ff6('0x2c')],qs['fields'](_0x5d71ea[_0x9ff6('0x2d')][_0x9ff6('0x30')]));_0x398119[_0x9ff6('0x2f')]=_0x398119['attributes'][_0x9ff6('0x31')]?_0x398119[_0x9ff6('0x2f')]:_0xdb81[_0x9ff6('0x2c')];if(!_0x5d71ea[_0x9ff6('0x2d')]['hasOwnProperty'](_0x9ff6('0x32'))){_0x398119[_0x9ff6('0x1a')]=qs['limit'](_0x5d71ea[_0x9ff6('0x2d')][_0x9ff6('0x1a')]);_0x398119['offset']=qs[_0x9ff6('0x1c')](_0x5d71ea['query']['offset']);}_0x398119[_0x9ff6('0x33')]=qs[_0x9ff6('0x34')](_0x5d71ea[_0x9ff6('0x2d')]['sort']);_0x398119[_0x9ff6('0x35')]=qs[_0x9ff6('0x2e')](_[_0x9ff6('0x36')](_0x5d71ea[_0x9ff6('0x2d')],_0xdb81['filters']),_0x42ba22);if(_0x5d71ea[_0x9ff6('0x2d')][_0x9ff6('0x37')]){_0x398119[_0x9ff6('0x35')]=_[_0x9ff6('0x38')](_0x398119[_0x9ff6('0x35')],{'$or':_[_0x9ff6('0x28')](_0x42ba22,function(_0x281aa4){if(_0x281aa4[_0x9ff6('0x39')]!==_0x9ff6('0x3a')){var _0x2c0f3e={};_0x2c0f3e[_0x281aa4['name']]={'$like':'%'+_0x5d71ea[_0x9ff6('0x2d')][_0x9ff6('0x37')]+'%'};return _0x2c0f3e;}})});}_0x398119=_[_0x9ff6('0x38')]({},_0x398119,_0x5d71ea['options']);var _0x266129={'where':_0x398119[_0x9ff6('0x35')]};return db[_0x9ff6('0x29')][_0x9ff6('0x1b')](_0x266129)[_0x9ff6('0x21')](function(_0x3dcf89){_0x3121de[_0x9ff6('0x1b')]=_0x3dcf89;if(_0x5d71ea['query'][_0x9ff6('0x3b')]){_0x398119[_0x9ff6('0x3c')]=[{'all':!![]}];}return db[_0x9ff6('0x29')][_0x9ff6('0x3d')](_0x398119);})[_0x9ff6('0x21')](function(_0x54d6ec){_0x3121de[_0x9ff6('0x3e')]=_0x54d6ec;return _0x3121de;})[_0x9ff6('0x21')](respondWithFilteredResult(_0x422138,_0x398119))[_0x9ff6('0x3f')](handleError(_0x422138,null));};exports['show']=function(_0x1ef4e0,_0x558b67){var _0x18d247={'raw':![],'where':{'id':_0x1ef4e0['params']['id']}},_0x267a43={};_0x267a43[_0x9ff6('0x2c')]=_['keys'](db[_0x9ff6('0x29')][_0x9ff6('0x2a')]);_0x267a43[_0x9ff6('0x2d')]=_[_0x9ff6('0x40')](_0x1ef4e0['query']);_0x267a43['filters']=_[_0x9ff6('0x41')](_0x267a43[_0x9ff6('0x2c')],_0x267a43[_0x9ff6('0x2d')]);_0x18d247[_0x9ff6('0x2f')]=_['intersection'](_0x267a43[_0x9ff6('0x2c')],qs[_0x9ff6('0x30')](_0x1ef4e0[_0x9ff6('0x2d')][_0x9ff6('0x30')]));_0x18d247['attributes']=_0x18d247['attributes'][_0x9ff6('0x31')]?_0x18d247[_0x9ff6('0x2f')]:_0x267a43[_0x9ff6('0x2c')];if(_0x1ef4e0[_0x9ff6('0x2d')][_0x9ff6('0x3b')]){_0x18d247['include']=[{'all':!![]}];}_0x18d247=_[_0x9ff6('0x38')]({},_0x18d247,_0x1ef4e0[_0x9ff6('0x42')]);return db[_0x9ff6('0x29')][_0x9ff6('0x43')](_0x18d247)['then'](handleEntityNotFound(_0x558b67,null))['then'](respondWithResult(_0x558b67,null))[_0x9ff6('0x3f')](handleError(_0x558b67,null));};exports[_0x9ff6('0x44')]=function(_0x4a74fa,_0x566245){return db['UserProfileSection'][_0x9ff6('0x44')](_0x4a74fa[_0x9ff6('0x45')],{})[_0x9ff6('0x21')](respondWithResult(_0x566245,0xc9))[_0x9ff6('0x3f')](handleError(_0x566245,null));};exports[_0x9ff6('0x20')]=function(_0x352798,_0x484779){if(_0x352798[_0x9ff6('0x45')]['id']){delete _0x352798[_0x9ff6('0x45')]['id'];}return db['UserProfileSection'][_0x9ff6('0x43')]({'where':{'id':_0x352798[_0x9ff6('0x46')]['id']}})[_0x9ff6('0x21')](handleEntityNotFound(_0x484779,null))[_0x9ff6('0x21')](saveUpdates(_0x352798[_0x9ff6('0x45')],null))[_0x9ff6('0x21')](respondWithResult(_0x484779,null))[_0x9ff6('0x3f')](handleError(_0x484779,null));};exports['destroy']=function(_0x18c780,_0x4fa7b4){return db[_0x9ff6('0x29')][_0x9ff6('0x43')]({'where':{'id':_0x18c780['params']['id']}})['then'](handleEntityNotFound(_0x4fa7b4,null))['then'](removeEntity(_0x4fa7b4,null))['catch'](handleError(_0x4fa7b4,null));};exports['describe']=function(_0x3eeb62,_0x29fdbc){return db['UserProfileSection'][_0x9ff6('0x47')]()[_0x9ff6('0x21')](respondWithResult(_0x29fdbc,null))[_0x9ff6('0x3f')](handleError(_0x29fdbc,null));}; \ No newline at end of file +var _0x719f=['name','index','map','rawAttributes','fieldName','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','type','VIRTUAL','filter','options','UserProfileSection','findAll','rows','catch','show','includeAll','create','body','find','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','stack'];(function(_0x2b7ddf,_0x2496af){var _0x4c0378=function(_0x188558){while(--_0x188558){_0x2b7ddf['push'](_0x2b7ddf['shift']());}};_0x4c0378(++_0x2496af);}(_0x719f,0x1ba));var _0xf719=function(_0x16337a,_0x4789a1){_0x16337a=_0x16337a-0x0;var _0x422365=_0x719f[_0x16337a];return _0x422365;};'use strict';var emlformat=require(_0xf719('0x0'));var rimraf=require(_0xf719('0x1'));var zipdir=require(_0xf719('0x2'));var jsonpatch=require(_0xf719('0x3'));var rp=require('request-promise');var moment=require(_0xf719('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf719('0x5'));var util=require('util');var path=require(_0xf719('0x6'));var sox=require(_0xf719('0x7'));var csv=require(_0xf719('0x8'));var ejs=require(_0xf719('0x9'));var fs=require('fs');var fs_extra=require(_0xf719('0xa'));var _=require(_0xf719('0xb'));var squel=require('squel');var crypto=require(_0xf719('0xc'));var jsforce=require(_0xf719('0xd'));var deskjs=require(_0xf719('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf719('0xf'));var Papa=require(_0xf719('0x10'));var Redis=require(_0xf719('0x11'));var authService=require(_0xf719('0x12'));var qs=require(_0xf719('0x13'));var as=require(_0xf719('0x14'));var hardwareService=require(_0xf719('0x15'));var logger=require(_0xf719('0x16'))(_0xf719('0x17'));var utils=require(_0xf719('0x18'));var config=require(_0xf719('0x19'));var licenseUtil=require(_0xf719('0x1a'));var db=require(_0xf719('0x1b'))['db'];function respondWithStatusCode(_0x29415f,_0x1351f4){_0x1351f4=_0x1351f4||0xcc;return function(_0x264fab){if(_0x264fab){return _0x29415f[_0xf719('0x1c')](_0x1351f4);}return _0x29415f[_0xf719('0x1d')](_0x1351f4)[_0xf719('0x1e')]();};}function respondWithResult(_0x6762af,_0x1d600d){_0x1d600d=_0x1d600d||0xc8;return function(_0x15c9a7){if(_0x15c9a7){return _0x6762af[_0xf719('0x1d')](_0x1d600d)[_0xf719('0x1f')](_0x15c9a7);}};}function respondWithFilteredResult(_0x1a70fd,_0x2f2815){return function(_0x3d6f5e){if(_0x3d6f5e){var _0x9ce4c7=typeof _0x2f2815[_0xf719('0x20')]===_0xf719('0x21')&&typeof _0x2f2815['limit']===_0xf719('0x21');var _0x5431e3=_0x3d6f5e[_0xf719('0x22')];var _0x57663c=_0x9ce4c7?0x0:_0x2f2815[_0xf719('0x20')];var _0x4bdedc=_0x9ce4c7?_0x3d6f5e['count']:_0x2f2815[_0xf719('0x20')]+_0x2f2815[_0xf719('0x23')];var _0x3c390b;if(_0x4bdedc>=_0x5431e3){_0x4bdedc=_0x5431e3;_0x3c390b=0xc8;}else{_0x3c390b=0xce;}_0x1a70fd[_0xf719('0x1d')](_0x3c390b);return _0x1a70fd[_0xf719('0x24')](_0xf719('0x25'),_0x57663c+'-'+_0x4bdedc+'/'+_0x5431e3)['json'](_0x3d6f5e);}return null;};}function patchUpdates(_0x1f2012){return function(_0x57b2d2){try{jsonpatch[_0xf719('0x26')](_0x57b2d2,_0x1f2012,!![]);}catch(_0x44f7a7){return BPromise['reject'](_0x44f7a7);}return _0x57b2d2[_0xf719('0x27')]();};}function saveUpdates(_0x32412a,_0x266328){return function(_0x515029){if(_0x515029){return _0x515029[_0xf719('0x28')](_0x32412a)[_0xf719('0x29')](function(_0x3d4685){return _0x3d4685;});}return null;};}function removeEntity(_0x322f6b,_0x482e03){return function(_0x4991f5){if(_0x4991f5){return _0x4991f5['destroy']()[_0xf719('0x29')](function(){_0x322f6b[_0xf719('0x1d')](0xcc)[_0xf719('0x1e')]();});}};}function handleEntityNotFound(_0x4d2236,_0x7ba153){return function(_0x21cc27){if(!_0x21cc27){_0x4d2236[_0xf719('0x1c')](0x194);}return _0x21cc27;};}function handleError(_0x2871d2,_0x3a1dfc){_0x3a1dfc=_0x3a1dfc||0x1f4;return function(_0x5e49b3){logger[_0xf719('0x2a')](_0x5e49b3[_0xf719('0x2b')]);if(_0x5e49b3[_0xf719('0x2c')]){delete _0x5e49b3['name'];}_0x2871d2['status'](_0x3a1dfc)['send'](_0x5e49b3);};}exports[_0xf719('0x2d')]=function(_0x1f2b87,_0x535d88){var _0x5ca2cc={},_0xa6cc73={},_0x2a99c4={'count':0x0,'rows':[]};var _0x2d48f5=_[_0xf719('0x2e')](db['UserProfileSection'][_0xf719('0x2f')],function(_0x77920b){return{'name':_0x77920b[_0xf719('0x30')],'type':_0x77920b['type'][_0xf719('0x31')]};});_0xa6cc73[_0xf719('0x32')]=_[_0xf719('0x2e')](_0x2d48f5,_0xf719('0x2c'));_0xa6cc73['query']=_[_0xf719('0x33')](_0x1f2b87[_0xf719('0x34')]);_0xa6cc73['filters']=_['intersection'](_0xa6cc73['model'],_0xa6cc73[_0xf719('0x34')]);_0x5ca2cc[_0xf719('0x35')]=_[_0xf719('0x36')](_0xa6cc73['model'],qs['fields'](_0x1f2b87['query'][_0xf719('0x37')]));_0x5ca2cc['attributes']=_0x5ca2cc[_0xf719('0x35')][_0xf719('0x38')]?_0x5ca2cc['attributes']:_0xa6cc73[_0xf719('0x32')];if(!_0x1f2b87[_0xf719('0x34')][_0xf719('0x39')](_0xf719('0x3a'))){_0x5ca2cc[_0xf719('0x23')]=qs[_0xf719('0x23')](_0x1f2b87[_0xf719('0x34')]['limit']);_0x5ca2cc[_0xf719('0x20')]=qs[_0xf719('0x20')](_0x1f2b87[_0xf719('0x34')][_0xf719('0x20')]);}_0x5ca2cc[_0xf719('0x3b')]=qs[_0xf719('0x3c')](_0x1f2b87[_0xf719('0x34')][_0xf719('0x3c')]);_0x5ca2cc['where']=qs['filters'](_[_0xf719('0x3d')](_0x1f2b87[_0xf719('0x34')],_0xa6cc73[_0xf719('0x3e')]),_0x2d48f5);if(_0x1f2b87[_0xf719('0x34')]['filter']){_0x5ca2cc[_0xf719('0x3f')]=_[_0xf719('0x40')](_0x5ca2cc[_0xf719('0x3f')],{'$or':_[_0xf719('0x2e')](_0x2d48f5,function(_0x1a055c){if(_0x1a055c[_0xf719('0x41')]!==_0xf719('0x42')){var _0x5b8bad={};_0x5b8bad[_0x1a055c[_0xf719('0x2c')]]={'$like':'%'+_0x1f2b87[_0xf719('0x34')][_0xf719('0x43')]+'%'};return _0x5b8bad;}})});}_0x5ca2cc=_[_0xf719('0x40')]({},_0x5ca2cc,_0x1f2b87[_0xf719('0x44')]);var _0x360b19={'where':_0x5ca2cc[_0xf719('0x3f')]};return db[_0xf719('0x45')][_0xf719('0x22')](_0x360b19)[_0xf719('0x29')](function(_0x91a8ad){_0x2a99c4[_0xf719('0x22')]=_0x91a8ad;if(_0x1f2b87[_0xf719('0x34')]['includeAll']){_0x5ca2cc['include']=[{'all':!![]}];}return db[_0xf719('0x45')][_0xf719('0x46')](_0x5ca2cc);})[_0xf719('0x29')](function(_0x29ef7a){_0x2a99c4[_0xf719('0x47')]=_0x29ef7a;return _0x2a99c4;})['then'](respondWithFilteredResult(_0x535d88,_0x5ca2cc))[_0xf719('0x48')](handleError(_0x535d88,null));};exports[_0xf719('0x49')]=function(_0x1facab,_0x47afbb){var _0x26fbe9={'raw':![],'where':{'id':_0x1facab['params']['id']}},_0x435c05={};_0x435c05['model']=_[_0xf719('0x33')](db['UserProfileSection']['rawAttributes']);_0x435c05[_0xf719('0x34')]=_[_0xf719('0x33')](_0x1facab[_0xf719('0x34')]);_0x435c05['filters']=_[_0xf719('0x36')](_0x435c05[_0xf719('0x32')],_0x435c05[_0xf719('0x34')]);_0x26fbe9[_0xf719('0x35')]=_[_0xf719('0x36')](_0x435c05[_0xf719('0x32')],qs[_0xf719('0x37')](_0x1facab[_0xf719('0x34')][_0xf719('0x37')]));_0x26fbe9['attributes']=_0x26fbe9[_0xf719('0x35')][_0xf719('0x38')]?_0x26fbe9[_0xf719('0x35')]:_0x435c05['model'];if(_0x1facab[_0xf719('0x34')][_0xf719('0x4a')]){_0x26fbe9['include']=[{'all':!![]}];}_0x26fbe9=_[_0xf719('0x40')]({},_0x26fbe9,_0x1facab['options']);return db[_0xf719('0x45')]['find'](_0x26fbe9)['then'](handleEntityNotFound(_0x47afbb,null))[_0xf719('0x29')](respondWithResult(_0x47afbb,null))[_0xf719('0x48')](handleError(_0x47afbb,null));};exports['create']=function(_0x38e61d,_0x12f97b){return db[_0xf719('0x45')][_0xf719('0x4b')](_0x38e61d[_0xf719('0x4c')],{})[_0xf719('0x29')](respondWithResult(_0x12f97b,0xc9))[_0xf719('0x48')](handleError(_0x12f97b,null));};exports[_0xf719('0x28')]=function(_0x2be033,_0x4d1920){if(_0x2be033[_0xf719('0x4c')]['id']){delete _0x2be033['body']['id'];}return db[_0xf719('0x45')][_0xf719('0x4d')]({'where':{'id':_0x2be033[_0xf719('0x4e')]['id']}})[_0xf719('0x29')](handleEntityNotFound(_0x4d1920,null))[_0xf719('0x29')](saveUpdates(_0x2be033[_0xf719('0x4c')],null))['then'](respondWithResult(_0x4d1920,null))['catch'](handleError(_0x4d1920,null));};exports[_0xf719('0x4f')]=function(_0x95bd83,_0x4ff11e){return db['UserProfileSection'][_0xf719('0x4d')]({'where':{'id':_0x95bd83[_0xf719('0x4e')]['id']}})[_0xf719('0x29')](handleEntityNotFound(_0x4ff11e,null))[_0xf719('0x29')](removeEntity(_0x4ff11e,null))[_0xf719('0x48')](handleError(_0x4ff11e,null));};exports[_0xf719('0x50')]=function(_0x19894a,_0x3b81ea){return db[_0xf719('0x45')][_0xf719('0x50')]()[_0xf719('0x29')](respondWithResult(_0x3b81ea,null))[_0xf719('0x48')](handleError(_0x3b81ea,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index d3781bf..da2c8d0 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 _0x2f7f=['bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','compositeIndex','sectionId','lodash','../../config/logger','api'];(function(_0x2d4544,_0x4051ed){var _0x144d20=function(_0x5d8129){while(--_0x5d8129){_0x2d4544['push'](_0x2d4544['shift']());}};_0x144d20(++_0x4051ed);}(_0x2f7f,0x1ad));var _0xf2f7=function(_0x5528c3,_0x35a416){_0x5528c3=_0x5528c3-0x0;var _0x47ec1b=_0x2f7f[_0x5528c3];return _0x47ec1b;};'use strict';var _=require(_0xf2f7('0x0'));var util=require('util');var logger=require(_0xf2f7('0x1'))(_0xf2f7('0x2'));var moment=require('moment');var BPromise=require(_0xf2f7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2f7('0x4'));var rimraf=require(_0xf2f7('0x5'));var config=require(_0xf2f7('0x6'));var attributes=require(_0xf2f7('0x7'));module['exports']=function(_0x5d6687,_0x3651a2){return _0x5d6687[_0xf2f7('0x8')](_0xf2f7('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xf2f7('0xa'),'fields':[_0xf2f7('0xb'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1a37=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserProfileSection','user_profile_has_sections','lodash','util'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x1a37,0xb4));var _0x71a3=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x1a37[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var logger=require(_0x71a3('0x2'))(_0x71a3('0x3'));var moment=require(_0x71a3('0x4'));var BPromise=require(_0x71a3('0x5'));var rp=require(_0x71a3('0x6'));var fs=require('fs');var path=require(_0x71a3('0x7'));var rimraf=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var attributes=require('./userProfileSection.attributes');module[_0x71a3('0xa')]=function(_0x4f6b7a,_0xd09f7){return _0x4f6b7a[_0x71a3('0xb')](_0x71a3('0xc'),attributes,{'tableName':_0x71a3('0xd'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 52fe2f3..c56ca2d 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 _0x7d7f=['error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/environment','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x48eb7b,_0x228df1){var _0x5c6dc6=function(_0x29e65d){while(--_0x29e65d){_0x48eb7b['push'](_0x48eb7b['shift']());}};_0x5c6dc6(++_0x228df1);}(_0x7d7f,0xa3));var _0xf7d7=function(_0xb79531,_0x169229){_0xb79531=_0xb79531-0x0;var _0x5c9c69=_0x7d7f[_0xb79531];return _0x5c9c69;};'use strict';var _=require(_0xf7d7('0x0'));var util=require(_0xf7d7('0x1'));var moment=require('moment');var BPromise=require(_0xf7d7('0x2'));var rs=require(_0xf7d7('0x3'));var fs=require('fs');var Redis=require(_0xf7d7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf7d7('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf7d7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xa46787,_0x3c8e45,_0x1a1d70){return new BPromise(function(_0x25989c,_0x54e740){return client['request'](_0xa46787,_0x1a1d70)[_0xf7d7('0x7')](function(_0x496bab){logger[_0xf7d7('0x8')](_0xf7d7('0x9'),_0x3c8e45,_0xf7d7('0xa'));logger[_0xf7d7('0xb')](_0xf7d7('0xc'),_0x3c8e45,_0xf7d7('0xa'),JSON['stringify'](_0x496bab));if(_0x496bab['error']){if(_0x496bab[_0xf7d7('0xd')]['code']===0x1f4){logger[_0xf7d7('0xd')](_0xf7d7('0x9'),_0x3c8e45,_0x496bab[_0xf7d7('0xd')][_0xf7d7('0xe')]);return _0x54e740(_0x496bab[_0xf7d7('0xd')][_0xf7d7('0xe')]);}logger[_0xf7d7('0xd')](_0xf7d7('0x9'),_0x3c8e45,_0x496bab[_0xf7d7('0xd')][_0xf7d7('0xe')]);return _0x25989c(_0x496bab['error'][_0xf7d7('0xe')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x3c8e45,_0xf7d7('0xa'));_0x25989c(_0x496bab['result'][_0xf7d7('0xe')]);}})[_0xf7d7('0xf')](function(_0x48533e){logger[_0xf7d7('0xd')](_0xf7d7('0x9'),_0x3c8e45,_0x48533e);_0x54e740(_0x48533e);});});} \ No newline at end of file +var _0x0ef2=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0xbbeaac,_0x2da9a0){var _0x11ca51=function(_0x5e7eb4){while(--_0x5e7eb4){_0xbbeaac['push'](_0xbbeaac['shift']());}};_0x11ca51(++_0x2da9a0);}(_0x0ef2,0x169));var _0x20ef=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0x0ef2[_0x16de68];return _0x1c277e;};'use strict';var _=require(_0x20ef('0x0'));var util=require(_0x20ef('0x1'));var moment=require(_0x20ef('0x2'));var BPromise=require(_0x20ef('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20ef('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x20ef('0x5'));var logger=require(_0x20ef('0x6'))(_0x20ef('0x7'));var config=require(_0x20ef('0x8'));var jayson=require(_0x20ef('0x9'));var client=jayson[_0x20ef('0xa')][_0x20ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c99f6,_0x13d704,_0xcc0a0){return new BPromise(function(_0x3908da,_0x516667){return client[_0x20ef('0xc')](_0x1c99f6,_0xcc0a0)[_0x20ef('0xd')](function(_0x2c0c00){logger[_0x20ef('0xe')](_0x20ef('0xf'),_0x13d704,_0x20ef('0x10'));logger[_0x20ef('0x11')](_0x20ef('0x12'),_0x13d704,'request\x20sent',JSON['stringify'](_0x2c0c00));if(_0x2c0c00[_0x20ef('0x13')]){if(_0x2c0c00[_0x20ef('0x13')][_0x20ef('0x14')]===0x1f4){logger[_0x20ef('0x13')](_0x20ef('0xf'),_0x13d704,_0x2c0c00[_0x20ef('0x13')]['message']);return _0x516667(_0x2c0c00[_0x20ef('0x13')]['message']);}logger[_0x20ef('0x13')](_0x20ef('0xf'),_0x13d704,_0x2c0c00[_0x20ef('0x13')][_0x20ef('0x15')]);return _0x3908da(_0x2c0c00['error'][_0x20ef('0x15')]);}else{logger[_0x20ef('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x13d704,_0x20ef('0x10'));_0x3908da(_0x2c0c00[_0x20ef('0x16')]['message']);}})['catch'](function(_0x2497ac){logger['error'](_0x20ef('0xf'),_0x13d704,_0x2497ac);_0x516667(_0x2497ac);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 0ae5ecf..fadbe53 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5823f4,_0x52844b){var _0x119b48=function(_0x6d94c4){while(--_0x6d94c4){_0x5823f4['push'](_0x5823f4['shift']());}};_0x119b48(++_0x52844b);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1f2f61,_0x586f2f){var _0x10dabc=function(_0x3233b5){while(--_0x3233b5){_0x1f2f61['push'](_0x1f2f61['shift']());}};_0x10dabc(++_0x586f2f);}(_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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 2f2c56c..1381ef5 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 _0x6d25=['sequelize','INTEGER'];(function(_0x26eecf,_0x105f4e){var _0x437bb9=function(_0x4392c3){while(--_0x4392c3){_0x26eecf['push'](_0x26eecf['shift']());}};_0x437bb9(++_0x105f4e);}(_0x6d25,0x11c));var _0x56d2=function(_0x2affd2,_0x599151){_0x2affd2=_0x2affd2-0x0;var _0x4e685e=_0x6d25[_0x2affd2];return _0x4e685e;};'use strict';var Sequelize=require(_0x56d2('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x56d2('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7d55=['sequelize','exports','INTEGER'];(function(_0x3e5a32,_0x3cc871){var _0x375d0f=function(_0x412032){while(--_0x412032){_0x3e5a32['push'](_0x3e5a32['shift']());}};_0x375d0f(++_0x3cc871);}(_0x7d55,0x1bc));var _0x57d5=function(_0x2ae973,_0x339da3){_0x2ae973=_0x2ae973-0x0;var _0x6813bf=_0x7d55[_0x2ae973];return _0x6813bf;};'use strict';var Sequelize=require(_0x57d5('0x0'));module[_0x57d5('0x1')]={'penalty':{'type':Sequelize[_0x57d5('0x2')],'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 a27afb2..db87c07 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 _0xa6b0=['rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','moment','bluebird','request-promise'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x519b33,_0xf48903){_0x519b33=_0x519b33-0x0;var _0x2d1755=_0xa6b0[_0x519b33];return _0x2d1755;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a6b('0x2'));var BPromise=require(_0x0a6b('0x3'));var rp=require(_0x0a6b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var attributes=require(_0x0a6b('0x7'));module[_0x0a6b('0x8')]=function(_0x3dc2b0,_0x3b6967){return _0x3dc2b0[_0x0a6b('0x9')](_0x0a6b('0xa'),attributes,{'tableName':_0x0a6b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2eba=['user_has_sms_queues','util','../../config/logger','api','moment','path','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x208961,_0x5e6cf6){var _0x4236f5=function(_0x28856f){while(--_0x28856f){_0x208961['push'](_0x208961['shift']());}};_0x4236f5(++_0x5e6cf6);}(_0x2eba,0xc7));var _0xa2eb=function(_0x1f55f7,_0x4f8eef){_0x1f55f7=_0x1f55f7-0x0;var _0x47cc15=_0x2eba[_0x1f55f7];return _0x47cc15;};'use strict';var _=require('lodash');var util=require(_0xa2eb('0x0'));var logger=require(_0xa2eb('0x1'))(_0xa2eb('0x2'));var moment=require(_0xa2eb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2eb('0x4'));var rimraf=require('rimraf');var config=require(_0xa2eb('0x5'));var attributes=require(_0xa2eb('0x6'));module[_0xa2eb('0x7')]=function(_0x1e6fa2,_0x575a5c){return _0x1e6fa2['define']('UserSmsQueue',attributes,{'tableName':_0xa2eb('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 74480f5..25f2222 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 _0xb8b6=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xb8b6,0x1b9));var _0x6b8b=function(_0xdee14,_0x3e9d10){_0xdee14=_0xdee14-0x0;var _0x4f2217=_0xb8b6[_0xdee14];return _0x4f2217;};'use strict';var _=require(_0x6b8b('0x0'));var util=require('util');var moment=require(_0x6b8b('0x1'));var BPromise=require('bluebird');var rs=require(_0x6b8b('0x2'));var fs=require('fs');var Redis=require(_0x6b8b('0x3'));var db=require(_0x6b8b('0x4'))['db'];var utils=require(_0x6b8b('0x5'));var logger=require('../../config/logger')(_0x6b8b('0x6'));var config=require(_0x6b8b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6b8b('0x8')][_0x6b8b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cb1fe,_0x342718,_0x36f3f4){return new BPromise(function(_0x223565,_0x3dca05){return client[_0x6b8b('0xa')](_0x5cb1fe,_0x36f3f4)[_0x6b8b('0xb')](function(_0x3375c8){logger[_0x6b8b('0xc')](_0x6b8b('0xd'),_0x342718,_0x6b8b('0xe'));logger['debug'](_0x6b8b('0xf'),_0x342718,'request\x20sent',JSON[_0x6b8b('0x10')](_0x3375c8));if(_0x3375c8[_0x6b8b('0x11')]){if(_0x3375c8['error'][_0x6b8b('0x12')]===0x1f4){logger[_0x6b8b('0x11')](_0x6b8b('0xd'),_0x342718,_0x3375c8[_0x6b8b('0x11')][_0x6b8b('0x13')]);return _0x3dca05(_0x3375c8[_0x6b8b('0x11')][_0x6b8b('0x13')]);}logger[_0x6b8b('0x11')](_0x6b8b('0xd'),_0x342718,_0x3375c8['error'][_0x6b8b('0x13')]);return _0x223565(_0x3375c8['error'][_0x6b8b('0x13')]);}else{logger[_0x6b8b('0xc')](_0x6b8b('0xd'),_0x342718,'request\x20sent');_0x223565(_0x3375c8[_0x6b8b('0x14')]['message']);}})[_0x6b8b('0x15')](function(_0x296338){logger[_0x6b8b('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x342718,_0x296338);_0x3dca05(_0x296338);});});} \ No newline at end of file +var _0x05a4=['UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5bd4f6,_0xf4e45c){var _0x33a165=function(_0x37eef6){while(--_0x37eef6){_0x5bd4f6['push'](_0x5bd4f6['shift']());}};_0x33a165(++_0xf4e45c);}(_0x05a4,0x12e));var _0x405a=function(_0x35a592,_0x205618){_0x35a592=_0x35a592-0x0;var _0x477175=_0x05a4[_0x35a592];return _0x477175;};'use strict';var _=require(_0x405a('0x0'));var util=require(_0x405a('0x1'));var moment=require('moment');var BPromise=require(_0x405a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x405a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x405a('0x4'));var logger=require('../../config/logger')(_0x405a('0x5'));var config=require(_0x405a('0x6'));var jayson=require(_0x405a('0x7'));var client=jayson[_0x405a('0x8')][_0x405a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b54e6,_0x19678e,_0x597431){return new BPromise(function(_0x4e7024,_0x2ae104){return client[_0x405a('0xa')](_0x3b54e6,_0x597431)[_0x405a('0xb')](function(_0x480e1a){logger[_0x405a('0xc')](_0x405a('0xd'),_0x19678e,_0x405a('0xe'));logger['debug'](_0x405a('0xf'),_0x19678e,_0x405a('0xe'),JSON['stringify'](_0x480e1a));if(_0x480e1a[_0x405a('0x10')]){if(_0x480e1a[_0x405a('0x10')][_0x405a('0x11')]===0x1f4){logger[_0x405a('0x10')](_0x405a('0xd'),_0x19678e,_0x480e1a[_0x405a('0x10')][_0x405a('0x12')]);return _0x2ae104(_0x480e1a['error'][_0x405a('0x12')]);}logger[_0x405a('0x10')](_0x405a('0xd'),_0x19678e,_0x480e1a[_0x405a('0x10')][_0x405a('0x12')]);return _0x4e7024(_0x480e1a['error'][_0x405a('0x12')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x19678e,'request\x20sent');_0x4e7024(_0x480e1a[_0x405a('0x13')][_0x405a('0x12')]);}})[_0x405a('0x14')](function(_0x5e0c5f){logger[_0x405a('0x10')](_0x405a('0xd'),_0x19678e,_0x5e0c5f);_0x2ae104(_0x5e0c5f);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 05d6e08..930e2f1 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 _0x277b=['exports','INTEGER','sequelize'];(function(_0x50b886,_0x20b4b4){var _0xd21688=function(_0xe85120){while(--_0xe85120){_0x50b886['push'](_0x50b886['shift']());}};_0xd21688(++_0x20b4b4);}(_0x277b,0x173));var _0xb277=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x277b[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require(_0xb277('0x0'));module[_0xb277('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xb277('0x2')]}}; \ No newline at end of file +var _0xb517=['INTEGER','sequelize','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb517,0x124));var _0x7b51=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0xb517[_0x96f74c];return _0x379222;};'use strict';var Sequelize=require(_0x7b51('0x0'));module[_0x7b51('0x1')]={'UserId':{'type':Sequelize[_0x7b51('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x7b51('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index e999b7d..1d2c739 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(_0x36a14c,_0x22b2dc){var _0x3f9f9a=function(_0x3a185a){while(--_0x3a185a){_0x36a14c['push'](_0x36a14c['shift']());}};_0x3f9f9a(++_0x22b2dc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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(_0x272ec5,_0x399bd6){var _0x4d878c=function(_0x354701){while(--_0x354701){_0x272ec5['push'](_0x272ec5['shift']());}};_0x4d878c(++_0x399bd6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 84fec3f..baa8448 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4cdecc,_0x321d1a){var _0x3948a9=function(_0x2a247d){while(--_0x2a247d){_0x4cdecc['push'](_0x4cdecc['shift']());}};_0x3948a9(++_0x321d1a);}(_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(_0x44a159,_0x4e375f){var _0x260613=function(_0x2ca964){while(--_0x2ca964){_0x44a159['push'](_0x44a159['shift']());}};_0x260613(++_0x4e375f);}(_0x70e0,0x17b));var _0x070e=function(_0x474619,_0x124b80){_0x474619=_0x474619-0x0;var _0x17d5ea=_0x70e0[_0x474619];return _0x17d5ea;};'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 0b8aa5e..7d07cc6 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 _0x7433=['INTEGER','sequelize','exports'];(function(_0x20f624,_0x4501fe){var _0x11bb77=function(_0x101029){while(--_0x101029){_0x20f624['push'](_0x20f624['shift']());}};_0x11bb77(++_0x4501fe);}(_0x7433,0x1ba));var _0x3743=function(_0x375f55,_0x2a53ce){_0x375f55=_0x375f55-0x0;var _0x1c0b23=_0x7433[_0x375f55];return _0x1c0b23;};'use strict';var Sequelize=require(_0x3743('0x0'));module[_0x3743('0x1')]={'penalty':{'type':Sequelize[_0x3743('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5c87=['INTEGER','sequelize'];(function(_0x427627,_0x1d9f73){var _0xcaac7b=function(_0x684084){while(--_0x684084){_0x427627['push'](_0x427627['shift']());}};_0xcaac7b(++_0x1d9f73);}(_0x5c87,0x77));var _0x75c8=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x5c87[_0x2fc012];return _0x2891f9;};'use strict';var Sequelize=require(_0x75c8('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x75c8('0x1')],'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 d368415..f6c36e7 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 _0x8fd8=['bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0xf42399,_0x3b587c){var _0x1e2a94=function(_0x2c3351){while(--_0x2c3351){_0xf42399['push'](_0xf42399['shift']());}};_0x1e2a94(++_0x3b587c);}(_0x8fd8,0x126));var _0x88fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8fd8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x88fd('0x0'));var util=require(_0x88fd('0x1'));var logger=require(_0x88fd('0x2'))(_0x88fd('0x3'));var moment=require(_0x88fd('0x4'));var BPromise=require(_0x88fd('0x5'));var rp=require(_0x88fd('0x6'));var fs=require('fs');var path=require(_0x88fd('0x7'));var rimraf=require(_0x88fd('0x8'));var config=require(_0x88fd('0x9'));var attributes=require(_0x88fd('0xa'));module[_0x88fd('0xb')]=function(_0x488e39,_0xe2c397){return _0x488e39[_0x88fd('0xc')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdce9=['path','rimraf','./userVoiceQueue.attributes','define','UserVoiceQueue','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4df449,_0x44892c){var _0x546aa8=function(_0x257af7){while(--_0x257af7){_0x4df449['push'](_0x4df449['shift']());}};_0x546aa8(++_0x44892c);}(_0xdce9,0x89));var _0x9dce=function(_0x21c618,_0x58390c){_0x21c618=_0x21c618-0x0;var _0x4f6d0f=_0xdce9[_0x21c618];return _0x4f6d0f;};'use strict';var _=require(_0x9dce('0x0'));var util=require(_0x9dce('0x1'));var logger=require(_0x9dce('0x2'))('api');var moment=require(_0x9dce('0x3'));var BPromise=require(_0x9dce('0x4'));var rp=require(_0x9dce('0x5'));var fs=require('fs');var path=require(_0x9dce('0x6'));var rimraf=require(_0x9dce('0x7'));var config=require('../../config/environment');var attributes=require(_0x9dce('0x8'));module['exports']=function(_0x2b4be8,_0x4fd226){return _0x2b4be8[_0x9dce('0x9')](_0x9dce('0xa'),attributes,{'tableName':'user_has_voice_queues','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 73a720c..3eced76 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 _0x01d6=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x24875d,_0x4fb24d){var _0x181471=function(_0x4ecd6d){while(--_0x4ecd6d){_0x24875d['push'](_0x24875d['shift']());}};_0x181471(++_0x4fb24d);}(_0x01d6,0xf2));var _0x601d=function(_0x175434,_0x19c10e){_0x175434=_0x175434-0x0;var _0x43723a=_0x01d6[_0x175434];return _0x43723a;};'use strict';var _=require(_0x601d('0x0'));var util=require(_0x601d('0x1'));var moment=require(_0x601d('0x2'));var BPromise=require(_0x601d('0x3'));var rs=require(_0x601d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x601d('0x5'))['db'];var utils=require(_0x601d('0x6'));var logger=require(_0x601d('0x7'))(_0x601d('0x8'));var config=require(_0x601d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x601d('0xa')][_0x601d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb8195d,_0x872ef9,_0x4412f2){return new BPromise(function(_0x3b3f51,_0x4652c6){return client['request'](_0xb8195d,_0x4412f2)['then'](function(_0x28eb1c){logger[_0x601d('0xc')](_0x601d('0xd'),_0x872ef9,_0x601d('0xe'));logger['debug'](_0x601d('0xf'),_0x872ef9,_0x601d('0xe'),JSON['stringify'](_0x28eb1c));if(_0x28eb1c[_0x601d('0x10')]){if(_0x28eb1c['error']['code']===0x1f4){logger[_0x601d('0x10')](_0x601d('0xd'),_0x872ef9,_0x28eb1c[_0x601d('0x10')][_0x601d('0x11')]);return _0x4652c6(_0x28eb1c[_0x601d('0x10')][_0x601d('0x11')]);}logger['error'](_0x601d('0xd'),_0x872ef9,_0x28eb1c['error'][_0x601d('0x11')]);return _0x3b3f51(_0x28eb1c['error'][_0x601d('0x11')]);}else{logger[_0x601d('0xc')](_0x601d('0xd'),_0x872ef9,'request\x20sent');_0x3b3f51(_0x28eb1c[_0x601d('0x12')][_0x601d('0x11')]);}})[_0x601d('0x13')](function(_0xadba76){logger[_0x601d('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x872ef9,_0xadba76);_0x4652c6(_0xadba76);});});} \ No newline at end of file +var _0x4122=['UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x37ab79,_0x2b5f2b){var _0x3afcc6=function(_0x2e1d93){while(--_0x2e1d93){_0x37ab79['push'](_0x37ab79['shift']());}};_0x3afcc6(++_0x2b5f2b);}(_0x4122,0x1aa));var _0x2412=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4122[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x2412('0x0'));var moment=require('moment');var BPromise=require(_0x2412('0x1'));var rs=require(_0x2412('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2412('0x3'))['db'];var utils=require(_0x2412('0x4'));var logger=require(_0x2412('0x5'))('rpc');var config=require(_0x2412('0x6'));var jayson=require(_0x2412('0x7'));var client=jayson[_0x2412('0x8')][_0x2412('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10b793,_0x29678a,_0x5b812b){return new BPromise(function(_0x56e4dc,_0x203bf6){return client[_0x2412('0xa')](_0x10b793,_0x5b812b)['then'](function(_0xb06d41){logger['info'](_0x2412('0xb'),_0x29678a,_0x2412('0xc'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x29678a,_0x2412('0xc'),JSON[_0x2412('0xd')](_0xb06d41));if(_0xb06d41[_0x2412('0xe')]){if(_0xb06d41['error'][_0x2412('0xf')]===0x1f4){logger['error'](_0x2412('0xb'),_0x29678a,_0xb06d41['error'][_0x2412('0x10')]);return _0x203bf6(_0xb06d41[_0x2412('0xe')][_0x2412('0x10')]);}logger['error'](_0x2412('0xb'),_0x29678a,_0xb06d41[_0x2412('0xe')][_0x2412('0x10')]);return _0x56e4dc(_0xb06d41[_0x2412('0xe')][_0x2412('0x10')]);}else{logger['info'](_0x2412('0xb'),_0x29678a,_0x2412('0xc'));_0x56e4dc(_0xb06d41[_0x2412('0x11')][_0x2412('0x10')]);}})[_0x2412('0x12')](function(_0x5b2535){logger[_0x2412('0xe')](_0x2412('0xb'),_0x29678a,_0x5b2535);_0x203bf6(_0x5b2535);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index ca1336a..7e56a2f 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xa24789,_0x22c747){var _0xce5198=function(_0x354049){while(--_0x354049){_0xa24789['push'](_0xa24789['shift']());}};_0xce5198(++_0x22c747);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1f773e,_0x180c80){var _0x38217f=function(_0x134aef){while(--_0x134aef){_0x1f773e['push'](_0x1f773e['shift']());}};_0x38217f(++_0x180c80);}(_0x70e0,0x17b));var _0x070e=function(_0x6001e0,_0x3abc09){_0x6001e0=_0x6001e0-0x0;var _0x5bd5d2=_0x70e0[_0x6001e0];return _0x5bd5d2;};'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 b02dd8e..5ba81ef 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 _0x6f8a=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x1cf78f,_0x1d6605){var _0x51e5b1=function(_0x276c9f){while(--_0x276c9f){_0x1cf78f['push'](_0x1cf78f['shift']());}};_0x51e5b1(++_0x1d6605);}(_0x6f8a,0x1e0));var _0xa6f8=function(_0x48ec80,_0x4693e8){_0x48ec80=_0x48ec80-0x0;var _0x555531=_0x6f8a[_0x48ec80];return _0x555531;};'use strict';var Sequelize=require(_0xa6f8('0x0'));module[_0xa6f8('0x1')]={'uniqueid':{'type':Sequelize[_0xa6f8('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xa6f8('0x3')},'membername':{'type':Sequelize[_0xa6f8('0x4')],'allowNull':![],'comment':_0xa6f8('0x3')},'UserId':{'type':Sequelize[_0xa6f8('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xa6f8('0x4')],'allowNull':![],'unique':_0xa6f8('0x5'),'comment':_0xa6f8('0x3')},'VoiceQueueId':{'type':Sequelize[_0xa6f8('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xa6f8('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0xa6f8('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xa6f8('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x8ac0=['queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x30e375,_0x1d460d){var _0x4c1f5e=function(_0x5df863){while(--_0x5df863){_0x30e375['push'](_0x30e375['shift']());}};_0x4c1f5e(++_0x1d460d);}(_0x8ac0,0x1d5));var _0x08ac=function(_0x14bb40,_0xf1abe3){_0x14bb40=_0x14bb40-0x0;var _0x5881a0=_0x8ac0[_0x14bb40];return _0x5881a0;};'use strict';var Sequelize=require(_0x08ac('0x0'));module[_0x08ac('0x1')]={'uniqueid':{'type':Sequelize[_0x08ac('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x08ac('0x3')},'membername':{'type':Sequelize[_0x08ac('0x4')],'allowNull':![],'comment':_0x08ac('0x3')},'UserId':{'type':Sequelize[_0x08ac('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x08ac('0x5'),'comment':_0x08ac('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x08ac('0x4')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x08ac('0x2')](0xb),'defaultValue':0x0,'comment':_0x08ac('0x3')},'paused':{'type':Sequelize[_0x08ac('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 7b3a3e0..a0af43c 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 _0xf678=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove'];(function(_0x217d47,_0x416827){var _0x255ebe=function(_0x3c9555){while(--_0x3c9555){_0x217d47['push'](_0x217d47['shift']());}};_0x255ebe(++_0x416827);}(_0xf678,0xbf));var _0x8f67=function(_0x2f2caf,_0x5549d9){_0x2f2caf=_0x2f2caf-0x0;var _0x790f27=_0xf678[_0x2f2caf];return _0x790f27;};'use strict';var EventEmitter=require(_0x8f67('0x0'));var UserVoiceQueueRt=require(_0x8f67('0x1'))['db'][_0x8f67('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x8f67('0x3')](0x0);var events={'afterCreate':_0x8f67('0x4'),'afterUpdate':_0x8f67('0x5'),'afterDestroy':_0x8f67('0x6')};function emitEvent(_0x2805bb){return function(_0x28109c,_0x4e34bd,_0x2ef11a){UserVoiceQueueRtEvents[_0x8f67('0x7')](_0x2805bb+':'+_0x28109c['id'],_0x28109c);UserVoiceQueueRtEvents['emit'](_0x2805bb,_0x28109c);_0x2ef11a(null);};}for(var e in events){if(events[_0x8f67('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0x8f67('0x9')](e,emitEvent(event));}}module[_0x8f67('0xa')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xc095=['../../mysqldb','UserVoiceQueueRt','save','update','remove','emit','hook','exports','events'];(function(_0x35c5a8,_0x8ecb48){var _0x34782c=function(_0x1b23ec){while(--_0x1b23ec){_0x35c5a8['push'](_0x35c5a8['shift']());}};_0x34782c(++_0x8ecb48);}(_0xc095,0x179));var _0x5c09=function(_0xda852a,_0x2fc3f5){_0xda852a=_0xda852a-0x0;var _0x3e322f=_0xc095[_0xda852a];return _0x3e322f;};'use strict';var EventEmitter=require(_0x5c09('0x0'));var UserVoiceQueueRt=require(_0x5c09('0x1'))['db'][_0x5c09('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5c09('0x3'),'afterUpdate':_0x5c09('0x4'),'afterDestroy':_0x5c09('0x5')};function emitEvent(_0x517ad6){return function(_0x39c5a5,_0x294396,_0x2e3a83){UserVoiceQueueRtEvents[_0x5c09('0x6')](_0x517ad6+':'+_0x39c5a5['id'],_0x39c5a5);UserVoiceQueueRtEvents['emit'](_0x517ad6,_0x39c5a5);_0x2e3a83(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x5c09('0x7')](e,emitEvent(event));}}module[_0x5c09('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 26eef63..99c652c 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 _0x5fcc=['UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','define'];(function(_0x5682d0,_0x45c554){var _0x5f5b14=function(_0x400a78){while(--_0x400a78){_0x5682d0['push'](_0x5682d0['shift']());}};_0x5f5b14(++_0x45c554);}(_0x5fcc,0x91));var _0xc5fc=function(_0xfd1d1e,_0x4abef6){_0xfd1d1e=_0xfd1d1e-0x0;var _0x5ce33f=_0x5fcc[_0xfd1d1e];return _0x5ce33f;};'use strict';var _=require('lodash');var util=require(_0xc5fc('0x0'));var logger=require(_0xc5fc('0x1'))('api');var moment=require(_0xc5fc('0x2'));var BPromise=require(_0xc5fc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc5fc('0x4'));var rimraf=require(_0xc5fc('0x5'));var config=require(_0xc5fc('0x6'));var attributes=require(_0xc5fc('0x7'));module['exports']=function(_0x4f4e5a,_0x1c9f6c){return _0x4f4e5a[_0xc5fc('0x8')](_0xc5fc('0x9'),attributes,{'tableName':_0xc5fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b74=['define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0xd7c76f,_0x1aacb0){var _0x23b7e2=function(_0x2fc43e){while(--_0x2fc43e){_0xd7c76f['push'](_0xd7c76f['shift']());}};_0x23b7e2(++_0x1aacb0);}(_0x9b74,0x18b));var _0x49b7=function(_0x59507a,_0x1dd92d){_0x59507a=_0x59507a-0x0;var _0x29b9b6=_0x9b74[_0x59507a];return _0x29b9b6;};'use strict';var _=require(_0x49b7('0x0'));var util=require(_0x49b7('0x1'));var logger=require(_0x49b7('0x2'))(_0x49b7('0x3'));var moment=require(_0x49b7('0x4'));var BPromise=require(_0x49b7('0x5'));var rp=require(_0x49b7('0x6'));var fs=require('fs');var path=require(_0x49b7('0x7'));var rimraf=require(_0x49b7('0x8'));var config=require(_0x49b7('0x9'));var attributes=require(_0x49b7('0xa'));module['exports']=function(_0x1805f5,_0xbfeb28){return _0x1805f5[_0x49b7('0xb')](_0x49b7('0xc'),attributes,{'tableName':_0x49b7('0xd'),'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 2800b96..1902f4e 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 _0xeffc=['rpc','../../config/environment','jayson/promise','client','redis','defaults','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','debug','moment','randomstring','../../config/logger'];(function(_0x1c3370,_0xf617e8){var _0xa9b358=function(_0x39cb44){while(--_0x39cb44){_0x1c3370['push'](_0x1c3370['shift']());}};_0xa9b358(++_0xf617e8);}(_0xeffc,0x147));var _0xceff=function(_0xe44fa9,_0x2bfd6d){_0xe44fa9=_0xe44fa9-0x0;var _0x313641=_0xeffc[_0xe44fa9];return _0x313641;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xceff('0x0'));var BPromise=require('bluebird');var rs=require(_0xceff('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xceff('0x2'))(_0xceff('0x3'));var config=require(_0xceff('0x4'));var jayson=require(_0xceff('0x5'));var client=jayson[_0xceff('0x6')]['http']({'port':0x232a});config[_0xceff('0x7')]=_[_0xceff('0x8')](config[_0xceff('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xceff('0x7')]));require(_0xceff('0x9'))[_0xceff('0xa')](socket);function respondWithRpcPromise(_0xecb5fb,_0x34688e,_0x46db01){return new BPromise(function(_0x3136b3,_0x1b1521){return client[_0xceff('0xb')](_0xecb5fb,_0x46db01)[_0xceff('0xc')](function(_0x2df65a){logger[_0xceff('0xd')](_0xceff('0xe'),_0x34688e,_0xceff('0xf'));logger['debug'](_0xceff('0x10'),_0x34688e,_0xceff('0xf'),JSON[_0xceff('0x11')](_0x2df65a));if(_0x2df65a[_0xceff('0x12')]){if(_0x2df65a[_0xceff('0x12')][_0xceff('0x13')]===0x1f4){logger[_0xceff('0x12')](_0xceff('0xe'),_0x34688e,_0x2df65a[_0xceff('0x12')][_0xceff('0x14')]);return _0x1b1521(_0x2df65a[_0xceff('0x12')][_0xceff('0x14')]);}logger[_0xceff('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x34688e,_0x2df65a['error']['message']);return _0x3136b3(_0x2df65a[_0xceff('0x12')][_0xceff('0x14')]);}else{logger[_0xceff('0xd')](_0xceff('0xe'),_0x34688e,_0xceff('0xf'));_0x3136b3(_0x2df65a[_0xceff('0x15')][_0xceff('0x14')]);}})['catch'](function(_0x897a31){logger[_0xceff('0x12')](_0xceff('0xe'),_0x34688e,_0x897a31);_0x1b1521(_0x897a31);});});}exports['GetVoiceQueueRtPauses']=function(_0x372101){var _0x1fe4f9=this;return new Promise(function(_0x502d5f,_0x4db97a){return db[_0xceff('0x16')]['findAll']({'raw':_0x372101[_0xceff('0x17')]?_0x372101['options'][_0xceff('0x18')]===undefined?!![]:![]:!![],'where':_0x372101[_0xceff('0x17')]?_0x372101[_0xceff('0x17')][_0xceff('0x19')]||null:null,'attributes':[[db[_0xceff('0x1a')]['fn'](_0xceff('0x1b'),db[_0xceff('0x1a')]['fn']('IF',db['sequelize'][_0xceff('0x1c')](_0xceff('0x1d')))),_0xceff('0x1e')]]})[_0xceff('0xc')](function(_0x52b07d){logger[_0xceff('0xd')](_0xceff('0x1f'),_0x372101);logger[_0xceff('0x20')](_0xceff('0x1f'),_0x372101,JSON[_0xceff('0x11')](_0x52b07d));_0x502d5f(_0x52b07d);})['catch'](function(_0xf29ae0){logger[_0xceff('0x12')](_0xceff('0x1f'),_0xf29ae0[_0xceff('0x14')],_0x372101);_0x4db97a(_0x1fe4f9['error'](0x1f4,_0xf29ae0['message']));});});}; \ No newline at end of file +var _0x8d4c=['literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./userVoiceQueueRt.socket','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT'];(function(_0x502de4,_0x1ed8b5){var _0x2d0130=function(_0x1a68b2){while(--_0x1a68b2){_0x502de4['push'](_0x502de4['shift']());}};_0x2d0130(++_0x1ed8b5);}(_0x8d4c,0x133));var _0xc8d4=function(_0x29e2af,_0x15e2b1){_0x29e2af=_0x29e2af-0x0;var _0x1ea06a=_0x8d4c[_0x29e2af];return _0x1ea06a;};'use strict';var _=require(_0xc8d4('0x0'));var util=require(_0xc8d4('0x1'));var moment=require(_0xc8d4('0x2'));var BPromise=require(_0xc8d4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8d4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8d4('0x5'));var logger=require(_0xc8d4('0x6'))(_0xc8d4('0x7'));var config=require(_0xc8d4('0x8'));var jayson=require(_0xc8d4('0x9'));var client=jayson[_0xc8d4('0xa')][_0xc8d4('0xb')]({'port':0x232a});config['redis']=_[_0xc8d4('0xc')](config['redis'],{'host':_0xc8d4('0xd'),'port':0x18eb});var socket=require(_0xc8d4('0xe'))(new Redis(config[_0xc8d4('0xf')]));require(_0xc8d4('0x10'))['register'](socket);function respondWithRpcPromise(_0x120a29,_0x2b67c0,_0x9c8377){return new BPromise(function(_0x18902b,_0x560a23){return client['request'](_0x120a29,_0x9c8377)[_0xc8d4('0x11')](function(_0x4f2339){logger[_0xc8d4('0x12')](_0xc8d4('0x13'),_0x2b67c0,_0xc8d4('0x14'));logger[_0xc8d4('0x15')](_0xc8d4('0x16'),_0x2b67c0,_0xc8d4('0x14'),JSON[_0xc8d4('0x17')](_0x4f2339));if(_0x4f2339[_0xc8d4('0x18')]){if(_0x4f2339[_0xc8d4('0x18')][_0xc8d4('0x19')]===0x1f4){logger['error'](_0xc8d4('0x13'),_0x2b67c0,_0x4f2339[_0xc8d4('0x18')][_0xc8d4('0x1a')]);return _0x560a23(_0x4f2339[_0xc8d4('0x18')]['message']);}logger['error'](_0xc8d4('0x13'),_0x2b67c0,_0x4f2339[_0xc8d4('0x18')][_0xc8d4('0x1a')]);return _0x18902b(_0x4f2339[_0xc8d4('0x18')][_0xc8d4('0x1a')]);}else{logger[_0xc8d4('0x12')](_0xc8d4('0x13'),_0x2b67c0,_0xc8d4('0x14'));_0x18902b(_0x4f2339['result']['message']);}})[_0xc8d4('0x1b')](function(_0x5116d9){logger[_0xc8d4('0x18')](_0xc8d4('0x13'),_0x2b67c0,_0x5116d9);_0x560a23(_0x5116d9);});});}exports[_0xc8d4('0x1c')]=function(_0x46cbae){var _0x244c82=this;return new Promise(function(_0x17f297,_0x563a22){return db[_0xc8d4('0x1d')][_0xc8d4('0x1e')]({'raw':_0x46cbae['options']?_0x46cbae[_0xc8d4('0x1f')][_0xc8d4('0x20')]===undefined?!![]:![]:!![],'where':_0x46cbae[_0xc8d4('0x1f')]?_0x46cbae[_0xc8d4('0x1f')]['where']||null:null,'attributes':[[db[_0xc8d4('0x21')]['fn'](_0xc8d4('0x22'),db[_0xc8d4('0x21')]['fn']('IF',db[_0xc8d4('0x21')][_0xc8d4('0x23')](_0xc8d4('0x24')))),_0xc8d4('0x25')]]})['then'](function(_0x29686f){logger[_0xc8d4('0x12')](_0xc8d4('0x1c'),_0x46cbae);logger[_0xc8d4('0x15')](_0xc8d4('0x1c'),_0x46cbae,JSON['stringify'](_0x29686f));_0x17f297(_0x29686f);})[_0xc8d4('0x1b')](function(_0x466534){logger[_0xc8d4('0x18')]('GetVoiceQueueRtPauses',_0x466534[_0xc8d4('0x1a')],_0x46cbae);_0x563a22(_0x244c82['error'](0x1f4,_0x466534['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 72d3c3c..62189df 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 _0xd6d2=['save','update','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0xa4d6ae,_0x516961){var _0x5e7673=function(_0xd0a346){while(--_0xd0a346){_0xa4d6ae['push'](_0xa4d6ae['shift']());}};_0x5e7673(++_0x516961);}(_0xd6d2,0xcb));var _0x2d6d=function(_0xde14ba,_0x5b1aab){_0xde14ba=_0xde14ba-0x0;var _0x4b09e6=_0xd6d2[_0xde14ba];return _0x4b09e6;};'use strict';var UserVoiceQueueRtEvents=require(_0x2d6d('0x0'));var events=[_0x2d6d('0x1'),'remove',_0x2d6d('0x2')];function createListener(_0x224caa,_0x5b4a5b){return function(_0x2c2dd9){_0x5b4a5b['emit'](_0x224caa,_0x2c2dd9);};}function removeListener(_0x1c5e54,_0x3ee519){return function(){UserVoiceQueueRtEvents[_0x2d6d('0x3')](_0x1c5e54,_0x3ee519);};}exports['register']=function(_0xfcdb1d){for(var _0x132361=0x0,_0xf59b20=events[_0x2d6d('0x4')];_0x132361<_0xf59b20;_0x132361++){var _0x4002b7=events[_0x132361];var _0x42d802=createListener(_0x2d6d('0x5')+_0x4002b7,_0xfcdb1d);UserVoiceQueueRtEvents['on'](_0x4002b7,_0x42d802);}}; \ No newline at end of file +var _0xfc9b=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update'];(function(_0x33b892,_0x546e55){var _0x59e599=function(_0x67b8f5){while(--_0x67b8f5){_0x33b892['push'](_0x33b892['shift']());}};_0x59e599(++_0x546e55);}(_0xfc9b,0x74));var _0xbfc9=function(_0x52a4fd,_0xc0044c){_0x52a4fd=_0x52a4fd-0x0;var _0x26da5f=_0xfc9b[_0x52a4fd];return _0x26da5f;};'use strict';var UserVoiceQueueRtEvents=require(_0xbfc9('0x0'));var events=[_0xbfc9('0x1'),_0xbfc9('0x2'),_0xbfc9('0x3')];function createListener(_0x29639e,_0x4618f9){return function(_0x397d76){_0x4618f9['emit'](_0x29639e,_0x397d76);};}function removeListener(_0x2eedb4,_0x49e470){return function(){UserVoiceQueueRtEvents[_0xbfc9('0x4')](_0x2eedb4,_0x49e470);};}exports[_0xbfc9('0x5')]=function(_0x523ff1){for(var _0x1dbece=0x0,_0x266c05=events[_0xbfc9('0x6')];_0x1dbece<_0x266c05;_0x1dbece++){var _0xe288d1=events[_0x1dbece];var _0x4e0f74=createListener(_0xbfc9('0x7')+_0xe288d1,_0x523ff1);UserVoiceQueueRtEvents['on'](_0xe288d1,_0x4e0f74);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 7dc03fd..9e1573f 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4c61b6,_0x526009){var _0x3e5d75=function(_0x2d9f7f){while(--_0x2d9f7f){_0x4c61b6['push'](_0x4c61b6['shift']());}};_0x3e5d75(++_0x526009);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x106866,_0x101c9a){var _0x3a050b=function(_0x329b53){while(--_0x329b53){_0x106866['push'](_0x106866['shift']());}};_0x3a050b(++_0x101c9a);}(_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 b27f204..1b2ecac 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 _0x7bd3=['exports','sequelize'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x7bd3,0x1c3));var _0x37bd=function(_0x188cce,_0x44e556){_0x188cce=_0x188cce-0x0;var _0x2597f2=_0x7bd3[_0x188cce];return _0x2597f2;};'use strict';var Sequelize=require(_0x37bd('0x0'));module[_0x37bd('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x56f3=['INTEGER','exports'];(function(_0x4564f9,_0x2253d0){var _0x5b5f1f=function(_0x2a4212){while(--_0x2a4212){_0x4564f9['push'](_0x4564f9['shift']());}};_0x5b5f1f(++_0x2253d0);}(_0x56f3,0x87));var _0x356f=function(_0x2c84a7,_0x4864f7){_0x2c84a7=_0x2c84a7-0x0;var _0x236fc6=_0x56f3[_0x2c84a7];return _0x236fc6;};'use strict';var Sequelize=require('sequelize');module[_0x356f('0x0')]={'penalty':{'type':Sequelize[_0x356f('0x1')],'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 a067f7f..15784ab 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 _0x2d0e=['../../config/logger','request-promise','path','rimraf','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util'];(function(_0x5a6ee4,_0x2e1727){var _0x5906fa=function(_0x3aacb5){while(--_0x3aacb5){_0x5a6ee4['push'](_0x5a6ee4['shift']());}};_0x5906fa(++_0x2e1727);}(_0x2d0e,0xd0));var _0xe2d0=function(_0x14de6c,_0x122728){_0x14de6c=_0x14de6c-0x0;var _0x12b9da=_0x2d0e[_0x14de6c];return _0x12b9da;};'use strict';var _=require(_0xe2d0('0x0'));var util=require(_0xe2d0('0x1'));var logger=require(_0xe2d0('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe2d0('0x3'));var fs=require('fs');var path=require(_0xe2d0('0x4'));var rimraf=require(_0xe2d0('0x5'));var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0xe2d0('0x6')]=function(_0xc6b576,_0x58ce56){return _0xc6b576[_0xe2d0('0x7')](_0xe2d0('0x8'),attributes,{'tableName':_0xe2d0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89f2=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','lodash'];(function(_0x375325,_0x57a850){var _0x228f57=function(_0x2ad744){while(--_0x2ad744){_0x375325['push'](_0x375325['shift']());}};_0x228f57(++_0x57a850);}(_0x89f2,0x81));var _0x289f=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x89f2[_0x1abb09];return _0xea1c07;};'use strict';var _=require(_0x289f('0x0'));var util=require(_0x289f('0x1'));var logger=require(_0x289f('0x2'))(_0x289f('0x3'));var moment=require(_0x289f('0x4'));var BPromise=require(_0x289f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x289f('0x6'));var rimraf=require(_0x289f('0x7'));var config=require(_0x289f('0x8'));var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x32f915,_0x19f109){return _0x32f915[_0x289f('0x9')]('UserWhatsappQueue',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 af3a6f1..5be00c0 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 _0xa628=['code','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xa628,0xf6));var _0x8a62=function(_0xea35d1,_0x302471){_0xea35d1=_0xea35d1-0x0;var _0x1d7a7c=_0xa628[_0xea35d1];return _0x1d7a7c;};'use strict';var _=require(_0x8a62('0x0'));var util=require('util');var moment=require(_0x8a62('0x1'));var BPromise=require(_0x8a62('0x2'));var rs=require(_0x8a62('0x3'));var fs=require('fs');var Redis=require(_0x8a62('0x4'));var db=require(_0x8a62('0x5'))['db'];var utils=require(_0x8a62('0x6'));var logger=require(_0x8a62('0x7'))(_0x8a62('0x8'));var config=require(_0x8a62('0x9'));var jayson=require(_0x8a62('0xa'));var client=jayson['client'][_0x8a62('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37bd4c,_0x4cfc88,_0x2167ec){return new BPromise(function(_0x95bf26,_0x52f43f){return client['request'](_0x37bd4c,_0x2167ec)[_0x8a62('0xc')](function(_0x5efb04){logger['info'](_0x8a62('0xd'),_0x4cfc88,_0x8a62('0xe'));logger[_0x8a62('0xf')](_0x8a62('0x10'),_0x4cfc88,_0x8a62('0xe'),JSON[_0x8a62('0x11')](_0x5efb04));if(_0x5efb04['error']){if(_0x5efb04['error'][_0x8a62('0x12')]===0x1f4){logger[_0x8a62('0x13')](_0x8a62('0xd'),_0x4cfc88,_0x5efb04[_0x8a62('0x13')][_0x8a62('0x14')]);return _0x52f43f(_0x5efb04['error']['message']);}logger[_0x8a62('0x13')](_0x8a62('0xd'),_0x4cfc88,_0x5efb04[_0x8a62('0x13')][_0x8a62('0x14')]);return _0x95bf26(_0x5efb04[_0x8a62('0x13')][_0x8a62('0x14')]);}else{logger[_0x8a62('0x15')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4cfc88,_0x8a62('0xe'));_0x95bf26(_0x5efb04[_0x8a62('0x16')][_0x8a62('0x14')]);}})[_0x8a62('0x17')](function(_0x204a97){logger[_0x8a62('0x13')](_0x8a62('0xd'),_0x4cfc88,_0x204a97);_0x52f43f(_0x204a97);});});} \ No newline at end of file +var _0xf3d2=['info','UserWhatsappQueue,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xf3d2,0x13e));var _0x2f3d=function(_0x405022,_0x2377a8){_0x405022=_0x405022-0x0;var _0x3b29e7=_0xf3d2[_0x405022];return _0x3b29e7;};'use strict';var _=require('lodash');var util=require(_0x2f3d('0x0'));var moment=require(_0x2f3d('0x1'));var BPromise=require(_0x2f3d('0x2'));var rs=require(_0x2f3d('0x3'));var fs=require('fs');var Redis=require(_0x2f3d('0x4'));var db=require(_0x2f3d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f3d('0x6'))(_0x2f3d('0x7'));var config=require(_0x2f3d('0x8'));var jayson=require(_0x2f3d('0x9'));var client=jayson['client'][_0x2f3d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20a44f,_0x793e10,_0x49d67b){return new BPromise(function(_0x32dc1d,_0x1aee7e){return client[_0x2f3d('0xb')](_0x20a44f,_0x49d67b)['then'](function(_0x339791){logger[_0x2f3d('0xc')](_0x2f3d('0xd'),_0x793e10,'request\x20sent');logger[_0x2f3d('0xe')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x793e10,'request\x20sent',JSON[_0x2f3d('0xf')](_0x339791));if(_0x339791[_0x2f3d('0x10')]){if(_0x339791['error'][_0x2f3d('0x11')]===0x1f4){logger['error'](_0x2f3d('0xd'),_0x793e10,_0x339791['error'][_0x2f3d('0x12')]);return _0x1aee7e(_0x339791[_0x2f3d('0x10')][_0x2f3d('0x12')]);}logger[_0x2f3d('0x10')](_0x2f3d('0xd'),_0x793e10,_0x339791['error'][_0x2f3d('0x12')]);return _0x32dc1d(_0x339791['error']['message']);}else{logger[_0x2f3d('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x793e10,_0x2f3d('0x13'));_0x32dc1d(_0x339791[_0x2f3d('0x14')][_0x2f3d('0x12')]);}})[_0x2f3d('0x15')](function(_0x3c5adb){logger[_0x2f3d('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x793e10,_0x3c5adb);_0x1aee7e(_0x3c5adb);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 12a56b7..a8cc16a 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 _0xae79=['put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show','post','create'];(function(_0x41fed9,_0x177598){var _0x29c435=function(_0x2a5932){while(--_0x2a5932){_0x41fed9['push'](_0x41fed9['shift']());}};_0x29c435(++_0x177598);}(_0xae79,0x1d3));var _0x9ae7=function(_0x44ca75,_0x547ee4){_0x44ca75=_0x44ca75-0x0;var _0x59ea3a=_0xae79[_0x44ca75];return _0x59ea3a;};'use strict';var multer=require(_0x9ae7('0x0'));var util=require(_0x9ae7('0x1'));var path=require(_0x9ae7('0x2'));var timeout=require(_0x9ae7('0x3'));var express=require(_0x9ae7('0x4'));var router=express[_0x9ae7('0x5')]();var fs_extra=require(_0x9ae7('0x6'));var auth=require(_0x9ae7('0x7'));var interaction=require(_0x9ae7('0x8'));var config=require(_0x9ae7('0x9'));var controller=require(_0x9ae7('0xa'));router[_0x9ae7('0xb')]('/',auth[_0x9ae7('0xc')](),controller[_0x9ae7('0xd')]);router[_0x9ae7('0xb')]('/:id',auth[_0x9ae7('0xc')](),controller[_0x9ae7('0xe')]);router[_0x9ae7('0xf')]('/',auth[_0x9ae7('0xc')](),controller[_0x9ae7('0x10')]);router[_0x9ae7('0x11')]('/:id',auth[_0x9ae7('0xc')](),controller['update']);router[_0x9ae7('0x12')](_0x9ae7('0x13'),auth[_0x9ae7('0xc')](),controller[_0x9ae7('0x14')]);module[_0x9ae7('0x15')]=router; \ No newline at end of file +var _0x8ece=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x4f0e26,_0x451f27){var _0x4cf962=function(_0x57496c){while(--_0x57496c){_0x4f0e26['push'](_0x4f0e26['shift']());}};_0x4cf962(++_0x451f27);}(_0x8ece,0x195));var _0xe8ec=function(_0x201aca,_0x21c20d){_0x201aca=_0x201aca-0x0;var _0xd08049=_0x8ece[_0x201aca];return _0xd08049;};'use strict';var multer=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var path=require(_0xe8ec('0x2'));var timeout=require(_0xe8ec('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe8ec('0x4'));var auth=require(_0xe8ec('0x5'));var interaction=require(_0xe8ec('0x6'));var config=require(_0xe8ec('0x7'));var controller=require(_0xe8ec('0x8'));router['get']('/',auth[_0xe8ec('0x9')](),controller[_0xe8ec('0xa')]);router[_0xe8ec('0xb')](_0xe8ec('0xc'),auth[_0xe8ec('0x9')](),controller[_0xe8ec('0xd')]);router[_0xe8ec('0xe')]('/',auth['isAuthenticated'](),controller[_0xe8ec('0xf')]);router['put'](_0xe8ec('0xc'),auth['isAuthenticated'](),controller[_0xe8ec('0x10')]);router[_0xe8ec('0x11')](_0xe8ec('0xc'),auth[_0xe8ec('0x9')](),controller[_0xe8ec('0x12')]);module[_0xe8ec('0x13')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index aaf593e..dc9bc39 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 _0x28c8=['name','STRING'];(function(_0x8f77fe,_0x9d64ed){var _0x5354e6=function(_0x10a06d){while(--_0x10a06d){_0x8f77fe['push'](_0x8f77fe['shift']());}};_0x5354e6(++_0x9d64ed);}(_0x28c8,0x119));var _0x828c=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0x28c8[_0x4e1a49];return _0x136aae;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x828c('0x0')],'unique':_0x828c('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x828c('0x0')]}}; \ No newline at end of file +var _0x2365=['name','sequelize','exports','STRING'];(function(_0x1da5e7,_0x4f8daf){var _0x248832=function(_0x1649e3){while(--_0x1649e3){_0x1da5e7['push'](_0x1da5e7['shift']());}};_0x248832(++_0x4f8daf);}(_0x2365,0x111));var _0x5236=function(_0x1ed20f,_0x16d891){_0x1ed20f=_0x1ed20f-0x0;var _0x47599e=_0x2365[_0x1ed20f];return _0x47599e;};'use strict';var Sequelize=require(_0x5236('0x0'));module[_0x5236('0x1')]={'name':{'type':Sequelize[_0x5236('0x2')],'unique':_0x5236('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5236('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 77607b7..496a7f4 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 _0x48cd=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x4e9e0d,_0xd86384){var _0x514622=function(_0xe6b57b){while(--_0xe6b57b){_0x4e9e0d['push'](_0x4e9e0d['shift']());}};_0x514622(++_0xd86384);}(_0x48cd,0x12f));var _0xd48c=function(_0x1ccc95,_0x41d6ca){_0x1ccc95=_0x1ccc95-0x0;var _0x43cf7c=_0x48cd[_0x1ccc95];return _0x43cf7c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd48c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd48c('0x1'));var moment=require(_0xd48c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xd48c('0x3'));var util=require('util');var path=require(_0xd48c('0x4'));var sox=require(_0xd48c('0x5'));var csv=require(_0xd48c('0x6'));var ejs=require(_0xd48c('0x7'));var fs=require('fs');var fs_extra=require(_0xd48c('0x8'));var _=require(_0xd48c('0x9'));var squel=require(_0xd48c('0xa'));var crypto=require(_0xd48c('0xb'));var jsforce=require(_0xd48c('0xc'));var deskjs=require(_0xd48c('0xd'));var toCsv=require(_0xd48c('0x6'));var querystring=require(_0xd48c('0xe'));var Papa=require(_0xd48c('0xf'));var Redis=require(_0xd48c('0x10'));var authService=require(_0xd48c('0x11'));var qs=require(_0xd48c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd48c('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd48c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a2182,_0x262501){_0x262501=_0x262501||0xcc;return function(_0x4d8cf2){if(_0x4d8cf2){return _0x1a2182['sendStatus'](_0x262501);}return _0x1a2182[_0xd48c('0x15')](_0x262501)[_0xd48c('0x16')]();};}function respondWithResult(_0x18ceb2,_0x525e8c){_0x525e8c=_0x525e8c||0xc8;return function(_0xa83ea9){if(_0xa83ea9){return _0x18ceb2['status'](_0x525e8c)[_0xd48c('0x17')](_0xa83ea9);}};}function respondWithFilteredResult(_0x278463,_0x19b36e){return function(_0x495ab5){if(_0x495ab5){var _0x1f2001=typeof _0x19b36e[_0xd48c('0x18')]===_0xd48c('0x19')&&typeof _0x19b36e['limit']===_0xd48c('0x19');var _0x83c9b1=_0x495ab5['count'];var _0xea681e=_0x1f2001?0x0:_0x19b36e[_0xd48c('0x18')];var _0x16d87b=_0x1f2001?_0x495ab5[_0xd48c('0x1a')]:_0x19b36e[_0xd48c('0x18')]+_0x19b36e['limit'];var _0x176eb2;if(_0x16d87b>=_0x83c9b1){_0x16d87b=_0x83c9b1;_0x176eb2=0xc8;}else{_0x176eb2=0xce;}_0x278463[_0xd48c('0x15')](_0x176eb2);return _0x278463['set'](_0xd48c('0x1b'),_0xea681e+'-'+_0x16d87b+'/'+_0x83c9b1)[_0xd48c('0x17')](_0x495ab5);}return null;};}function patchUpdates(_0x4446b8){return function(_0x2853ac){try{jsonpatch[_0xd48c('0x1c')](_0x2853ac,_0x4446b8,!![]);}catch(_0xfba16d){return BPromise[_0xd48c('0x1d')](_0xfba16d);}return _0x2853ac[_0xd48c('0x1e')]();};}function saveUpdates(_0x280a20,_0x4d8c68){return function(_0x231f3b){if(_0x231f3b){return _0x231f3b[_0xd48c('0x1f')](_0x280a20)[_0xd48c('0x20')](function(_0x3dfd77){return _0x3dfd77;});}return null;};}function removeEntity(_0x28e3c5,_0x2e18c9){return function(_0x2ca6ec){if(_0x2ca6ec){return _0x2ca6ec[_0xd48c('0x21')]()['then'](function(){var _0x839177=_0x2ca6ec[_0xd48c('0x22')]({'plain':!![]});var _0x5cfdb0='Variables';return db[_0xd48c('0x23')][_0xd48c('0x21')]({'where':{'type':_0x5cfdb0,'resourceId':_0x839177['id']}})['then'](function(){return _0x2ca6ec;});})[_0xd48c('0x20')](function(){_0x28e3c5[_0xd48c('0x15')](0xcc)[_0xd48c('0x16')]();});}};}function handleEntityNotFound(_0x4b06f3,_0x2f6a47){return function(_0x879dd5){if(!_0x879dd5){_0x4b06f3[_0xd48c('0x24')](0x194);}return _0x879dd5;};}function handleError(_0x12fb42,_0x232ddd){_0x232ddd=_0x232ddd||0x1f4;return function(_0x4778a4){logger[_0xd48c('0x25')](_0x4778a4[_0xd48c('0x26')]);if(_0x4778a4[_0xd48c('0x27')]){delete _0x4778a4[_0xd48c('0x27')];}_0x12fb42['status'](_0x232ddd)[_0xd48c('0x28')](_0x4778a4);};}exports[_0xd48c('0x29')]=function(_0x340091,_0x4c7d69){var _0x2f2171={},_0x1983d5={},_0x2ba723={'count':0x0,'rows':[]};var _0x3259fd=_[_0xd48c('0x2a')](db[_0xd48c('0x2b')][_0xd48c('0x2c')],function(_0x54f41a){return{'name':_0x54f41a[_0xd48c('0x2d')],'type':_0x54f41a[_0xd48c('0x2e')]['key']};});_0x1983d5[_0xd48c('0x2f')]=_[_0xd48c('0x2a')](_0x3259fd,_0xd48c('0x27'));_0x1983d5['query']=_[_0xd48c('0x30')](_0x340091['query']);_0x1983d5[_0xd48c('0x31')]=_['intersection'](_0x1983d5[_0xd48c('0x2f')],_0x1983d5[_0xd48c('0x32')]);_0x2f2171[_0xd48c('0x33')]=_[_0xd48c('0x34')](_0x1983d5[_0xd48c('0x2f')],qs[_0xd48c('0x35')](_0x340091[_0xd48c('0x32')]['fields']));_0x2f2171[_0xd48c('0x33')]=_0x2f2171['attributes'][_0xd48c('0x36')]?_0x2f2171['attributes']:_0x1983d5[_0xd48c('0x2f')];if(!_0x340091[_0xd48c('0x32')][_0xd48c('0x37')](_0xd48c('0x38'))){_0x2f2171[_0xd48c('0x39')]=qs['limit'](_0x340091[_0xd48c('0x32')][_0xd48c('0x39')]);_0x2f2171[_0xd48c('0x18')]=qs[_0xd48c('0x18')](_0x340091[_0xd48c('0x32')]['offset']);}_0x2f2171[_0xd48c('0x3a')]=qs[_0xd48c('0x3b')](_0x340091['query']['sort']);_0x2f2171[_0xd48c('0x3c')]=qs[_0xd48c('0x31')](_['pick'](_0x340091[_0xd48c('0x32')],_0x1983d5['filters']),_0x3259fd);if(_0x340091[_0xd48c('0x32')][_0xd48c('0x3d')]){_0x2f2171[_0xd48c('0x3c')]=_['merge'](_0x2f2171[_0xd48c('0x3c')],{'$or':_[_0xd48c('0x2a')](_0x3259fd,function(_0x2a6ccd){if(_0x2a6ccd[_0xd48c('0x2e')]!==_0xd48c('0x3e')){var _0xd698a4={};_0xd698a4[_0x2a6ccd['name']]={'$like':'%'+_0x340091[_0xd48c('0x32')][_0xd48c('0x3d')]+'%'};return _0xd698a4;}})});}_0x2f2171=_[_0xd48c('0x3f')]({},_0x2f2171,_0x340091[_0xd48c('0x40')]);var _0x4fc6df={'where':_0x2f2171[_0xd48c('0x3c')]};return db[_0xd48c('0x2b')][_0xd48c('0x1a')](_0x4fc6df)[_0xd48c('0x20')](function(_0x5c2e99){_0x2ba723[_0xd48c('0x1a')]=_0x5c2e99;if(_0x340091['query'][_0xd48c('0x41')]){_0x2f2171['include']=[{'all':!![]}];}return db[_0xd48c('0x2b')][_0xd48c('0x42')](_0x2f2171);})[_0xd48c('0x20')](function(_0x472475){_0x2ba723[_0xd48c('0x43')]=_0x472475;return _0x2ba723;})['then'](respondWithFilteredResult(_0x4c7d69,_0x2f2171))[_0xd48c('0x44')](handleError(_0x4c7d69,null));};exports['show']=function(_0x32071c,_0x28465c){var _0x10f07b={'raw':!![],'where':{'id':_0x32071c[_0xd48c('0x45')]['id']}},_0x495ee1={};_0x495ee1[_0xd48c('0x2f')]=_[_0xd48c('0x30')](db[_0xd48c('0x2b')][_0xd48c('0x2c')]);_0x495ee1[_0xd48c('0x32')]=_[_0xd48c('0x30')](_0x32071c[_0xd48c('0x32')]);_0x495ee1['filters']=_[_0xd48c('0x34')](_0x495ee1['model'],_0x495ee1[_0xd48c('0x32')]);_0x10f07b['attributes']=_[_0xd48c('0x34')](_0x495ee1[_0xd48c('0x2f')],qs[_0xd48c('0x35')](_0x32071c[_0xd48c('0x32')]['fields']));_0x10f07b[_0xd48c('0x33')]=_0x10f07b[_0xd48c('0x33')][_0xd48c('0x36')]?_0x10f07b[_0xd48c('0x33')]:_0x495ee1['model'];if(_0x32071c['query'][_0xd48c('0x41')]){_0x10f07b['include']=[{'all':!![]}];}_0x10f07b=_[_0xd48c('0x3f')]({},_0x10f07b,_0x32071c[_0xd48c('0x40')]);return db[_0xd48c('0x2b')][_0xd48c('0x46')](_0x10f07b)[_0xd48c('0x20')](handleEntityNotFound(_0x28465c,null))[_0xd48c('0x20')](respondWithResult(_0x28465c,null))[_0xd48c('0x44')](handleError(_0x28465c,null));};exports[_0xd48c('0x47')]=function(_0x1344f1,_0x48f58c){return db[_0xd48c('0x2b')][_0xd48c('0x47')](_0x1344f1['body'],{})['then'](function(_0x38f142){var _0x1d2845=_0x1344f1[_0xd48c('0x48')][_0xd48c('0x22')]({'plain':!![]});if(!_0x1d2845)throw new Error(_0xd48c('0x49'));if(_0x1d2845[_0xd48c('0x4a')]===_0xd48c('0x48')){var _0x30f43f=_0x38f142[_0xd48c('0x22')]({'plain':!![]});var _0x267844=_0xd48c('0x4b');return db['UserProfileSection'][_0xd48c('0x46')]({'where':{'name':_0x267844,'userProfileId':_0x1d2845[_0xd48c('0x4c')]},'raw':!![]})[_0xd48c('0x20')](function(_0x4f7ea3){if(_0x4f7ea3&&_0x4f7ea3[_0xd48c('0x4d')]===0x0){return db[_0xd48c('0x23')]['create']({'name':_0x30f43f[_0xd48c('0x27')],'resourceId':_0x30f43f['id'],'type':_0x4f7ea3[_0xd48c('0x27')],'sectionId':_0x4f7ea3['id']},{})[_0xd48c('0x20')](function(){return _0x38f142;});}else{return _0x38f142;}})[_0xd48c('0x44')](function(_0x399b82){logger[_0xd48c('0x25')](_0xd48c('0x4e'),_0x399b82);throw _0x399b82;});}return _0x38f142;})[_0xd48c('0x20')](respondWithResult(_0x48f58c,0xc9))[_0xd48c('0x44')](handleError(_0x48f58c,null));};exports[_0xd48c('0x1f')]=function(_0x4a1660,_0xbc1ca3){if(_0x4a1660[_0xd48c('0x4f')]['id']){delete _0x4a1660[_0xd48c('0x4f')]['id'];}return db[_0xd48c('0x2b')][_0xd48c('0x46')]({'where':{'id':_0x4a1660[_0xd48c('0x45')]['id']}})['then'](handleEntityNotFound(_0xbc1ca3,null))[_0xd48c('0x20')](saveUpdates(_0x4a1660[_0xd48c('0x4f')],null))[_0xd48c('0x20')](respondWithResult(_0xbc1ca3,null))['catch'](handleError(_0xbc1ca3,null));};exports[_0xd48c('0x21')]=function(_0x21ce58,_0x322fe6){return db[_0xd48c('0x2b')][_0xd48c('0x46')]({'where':{'id':_0x21ce58[_0xd48c('0x45')]['id']}})['then'](handleEntityNotFound(_0x322fe6,null))[_0xd48c('0x20')](removeEntity(_0x322fe6,null))[_0xd48c('0x44')](handleError(_0x322fe6,null));}; \ No newline at end of file +var _0x1406=['undefined','limit','count','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','pick','merge','where','type','VIRTUAL','options','Variable','includeAll','include','catch','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','userProfileId','body','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x5664ea,_0x4cb50b){var _0x23152c=function(_0x5625a9){while(--_0x5625a9){_0x5664ea['push'](_0x5664ea['shift']());}};_0x23152c(++_0x4cb50b);}(_0x1406,0xc4));var _0x6140=function(_0x58fc6f,_0x30e851){_0x58fc6f=_0x58fc6f-0x0;var _0x1186db=_0x1406[_0x58fc6f];return _0x1186db;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6140('0x0'));var jsonpatch=require(_0x6140('0x1'));var rp=require(_0x6140('0x2'));var moment=require(_0x6140('0x3'));var BPromise=require(_0x6140('0x4'));var Mustache=require('mustache');var util=require(_0x6140('0x5'));var path=require('path');var sox=require(_0x6140('0x6'));var csv=require(_0x6140('0x7'));var ejs=require(_0x6140('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6140('0x9'));var jsforce=require(_0x6140('0xa'));var deskjs=require(_0x6140('0xb'));var toCsv=require(_0x6140('0x7'));var querystring=require(_0x6140('0xc'));var Papa=require('papaparse');var Redis=require(_0x6140('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x6140('0xe'));var as=require(_0x6140('0xf'));var hardwareService=require(_0x6140('0x10'));var logger=require(_0x6140('0x11'))(_0x6140('0x12'));var utils=require(_0x6140('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6140('0x14'));var db=require(_0x6140('0x15'))['db'];function respondWithStatusCode(_0x47c600,_0x3e65da){_0x3e65da=_0x3e65da||0xcc;return function(_0xfc2bba){if(_0xfc2bba){return _0x47c600[_0x6140('0x16')](_0x3e65da);}return _0x47c600[_0x6140('0x17')](_0x3e65da)[_0x6140('0x18')]();};}function respondWithResult(_0x56833c,_0x141c9e){_0x141c9e=_0x141c9e||0xc8;return function(_0x349cd9){if(_0x349cd9){return _0x56833c['status'](_0x141c9e)['json'](_0x349cd9);}};}function respondWithFilteredResult(_0x254eca,_0x3b27e7){return function(_0x411f7d){if(_0x411f7d){var _0x4385b2=typeof _0x3b27e7[_0x6140('0x19')]===_0x6140('0x1a')&&typeof _0x3b27e7[_0x6140('0x1b')]===_0x6140('0x1a');var _0x1f0e09=_0x411f7d[_0x6140('0x1c')];var _0x259a82=_0x4385b2?0x0:_0x3b27e7[_0x6140('0x19')];var _0x23128c=_0x4385b2?_0x411f7d[_0x6140('0x1c')]:_0x3b27e7[_0x6140('0x19')]+_0x3b27e7[_0x6140('0x1b')];var _0x228416;if(_0x23128c>=_0x1f0e09){_0x23128c=_0x1f0e09;_0x228416=0xc8;}else{_0x228416=0xce;}_0x254eca['status'](_0x228416);return _0x254eca['set'](_0x6140('0x1d'),_0x259a82+'-'+_0x23128c+'/'+_0x1f0e09)['json'](_0x411f7d);}return null;};}function patchUpdates(_0x236994){return function(_0x5be1e9){try{jsonpatch['apply'](_0x5be1e9,_0x236994,!![]);}catch(_0x153e6a){return BPromise[_0x6140('0x1e')](_0x153e6a);}return _0x5be1e9[_0x6140('0x1f')]();};}function saveUpdates(_0x2482d9,_0x50db53){return function(_0x466dfd){if(_0x466dfd){return _0x466dfd[_0x6140('0x20')](_0x2482d9)[_0x6140('0x21')](function(_0x171cb9){return _0x171cb9;});}return null;};}function removeEntity(_0x482fa3,_0x6265ab){return function(_0x56c07a){if(_0x56c07a){return _0x56c07a['destroy']()[_0x6140('0x21')](function(){var _0x589589=_0x56c07a[_0x6140('0x22')]({'plain':!![]});var _0x167046='Variables';return db[_0x6140('0x23')][_0x6140('0x24')]({'where':{'type':_0x167046,'resourceId':_0x589589['id']}})['then'](function(){return _0x56c07a;});})['then'](function(){_0x482fa3[_0x6140('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10560c,_0x829ee3){return function(_0x59299e){if(!_0x59299e){_0x10560c[_0x6140('0x16')](0x194);}return _0x59299e;};}function handleError(_0x4575ba,_0x5616bc){_0x5616bc=_0x5616bc||0x1f4;return function(_0x1e1dbc){logger[_0x6140('0x25')](_0x1e1dbc[_0x6140('0x26')]);if(_0x1e1dbc['name']){delete _0x1e1dbc[_0x6140('0x27')];}_0x4575ba[_0x6140('0x17')](_0x5616bc)[_0x6140('0x28')](_0x1e1dbc);};}exports['index']=function(_0x4f94a2,_0x4df2d4){var _0x362749={},_0x10e460={},_0x4b3485={'count':0x0,'rows':[]};var _0x14799f=_[_0x6140('0x29')](db['Variable'][_0x6140('0x2a')],function(_0x390417){return{'name':_0x390417['fieldName'],'type':_0x390417['type'][_0x6140('0x2b')]};});_0x10e460[_0x6140('0x2c')]=_[_0x6140('0x29')](_0x14799f,_0x6140('0x27'));_0x10e460[_0x6140('0x2d')]=_[_0x6140('0x2e')](_0x4f94a2[_0x6140('0x2d')]);_0x10e460['filters']=_[_0x6140('0x2f')](_0x10e460['model'],_0x10e460[_0x6140('0x2d')]);_0x362749[_0x6140('0x30')]=_[_0x6140('0x2f')](_0x10e460[_0x6140('0x2c')],qs['fields'](_0x4f94a2[_0x6140('0x2d')][_0x6140('0x31')]));_0x362749['attributes']=_0x362749[_0x6140('0x30')][_0x6140('0x32')]?_0x362749[_0x6140('0x30')]:_0x10e460[_0x6140('0x2c')];if(!_0x4f94a2[_0x6140('0x2d')]['hasOwnProperty'](_0x6140('0x33'))){_0x362749[_0x6140('0x1b')]=qs[_0x6140('0x1b')](_0x4f94a2['query']['limit']);_0x362749[_0x6140('0x19')]=qs['offset'](_0x4f94a2[_0x6140('0x2d')]['offset']);}_0x362749[_0x6140('0x34')]=qs[_0x6140('0x35')](_0x4f94a2[_0x6140('0x2d')][_0x6140('0x35')]);_0x362749['where']=qs['filters'](_[_0x6140('0x36')](_0x4f94a2[_0x6140('0x2d')],_0x10e460['filters']),_0x14799f);if(_0x4f94a2['query']['filter']){_0x362749['where']=_[_0x6140('0x37')](_0x362749[_0x6140('0x38')],{'$or':_['map'](_0x14799f,function(_0x3d2d63){if(_0x3d2d63[_0x6140('0x39')]!==_0x6140('0x3a')){var _0x29627f={};_0x29627f[_0x3d2d63[_0x6140('0x27')]]={'$like':'%'+_0x4f94a2[_0x6140('0x2d')]['filter']+'%'};return _0x29627f;}})});}_0x362749=_[_0x6140('0x37')]({},_0x362749,_0x4f94a2[_0x6140('0x3b')]);var _0x5c368d={'where':_0x362749[_0x6140('0x38')]};return db[_0x6140('0x3c')][_0x6140('0x1c')](_0x5c368d)['then'](function(_0x4bae71){_0x4b3485[_0x6140('0x1c')]=_0x4bae71;if(_0x4f94a2[_0x6140('0x2d')][_0x6140('0x3d')]){_0x362749[_0x6140('0x3e')]=[{'all':!![]}];}return db['Variable']['findAll'](_0x362749);})[_0x6140('0x21')](function(_0x2e5147){_0x4b3485['rows']=_0x2e5147;return _0x4b3485;})[_0x6140('0x21')](respondWithFilteredResult(_0x4df2d4,_0x362749))[_0x6140('0x3f')](handleError(_0x4df2d4,null));};exports['show']=function(_0x6747bd,_0x469518){var _0xd025f2={'raw':!![],'where':{'id':_0x6747bd[_0x6140('0x40')]['id']}},_0x3e1122={};_0x3e1122[_0x6140('0x2c')]=_['keys'](db['Variable'][_0x6140('0x2a')]);_0x3e1122[_0x6140('0x2d')]=_[_0x6140('0x2e')](_0x6747bd[_0x6140('0x2d')]);_0x3e1122['filters']=_[_0x6140('0x2f')](_0x3e1122[_0x6140('0x2c')],_0x3e1122[_0x6140('0x2d')]);_0xd025f2['attributes']=_[_0x6140('0x2f')](_0x3e1122['model'],qs[_0x6140('0x31')](_0x6747bd['query'][_0x6140('0x31')]));_0xd025f2['attributes']=_0xd025f2[_0x6140('0x30')][_0x6140('0x32')]?_0xd025f2['attributes']:_0x3e1122[_0x6140('0x2c')];if(_0x6747bd['query'][_0x6140('0x3d')]){_0xd025f2[_0x6140('0x3e')]=[{'all':!![]}];}_0xd025f2=_[_0x6140('0x37')]({},_0xd025f2,_0x6747bd[_0x6140('0x3b')]);return db['Variable']['find'](_0xd025f2)[_0x6140('0x21')](handleEntityNotFound(_0x469518,null))[_0x6140('0x21')](respondWithResult(_0x469518,null))[_0x6140('0x3f')](handleError(_0x469518,null));};exports['create']=function(_0x326c58,_0xb3aac2){return db['Variable'][_0x6140('0x41')](_0x326c58['body'],{})[_0x6140('0x21')](function(_0x5bbae2){var _0x5385d3=_0x326c58[_0x6140('0x42')][_0x6140('0x22')]({'plain':!![]});if(!_0x5385d3)throw new Error(_0x6140('0x43'));if(_0x5385d3[_0x6140('0x44')]===_0x6140('0x42')){var _0x31d32f=_0x5bbae2[_0x6140('0x22')]({'plain':!![]});var _0x3bf196=_0x6140('0x45');return db[_0x6140('0x46')]['find']({'where':{'name':_0x3bf196,'userProfileId':_0x5385d3[_0x6140('0x47')]},'raw':!![]})[_0x6140('0x21')](function(_0x5de35e){if(_0x5de35e&&_0x5de35e['autoAssociation']===0x0){return db[_0x6140('0x23')][_0x6140('0x41')]({'name':_0x31d32f[_0x6140('0x27')],'resourceId':_0x31d32f['id'],'type':_0x5de35e['name'],'sectionId':_0x5de35e['id']},{})[_0x6140('0x21')](function(){return _0x5bbae2;});}else{return _0x5bbae2;}})[_0x6140('0x3f')](function(_0x39b7d1){logger[_0x6140('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39b7d1);throw _0x39b7d1;});}return _0x5bbae2;})[_0x6140('0x21')](respondWithResult(_0xb3aac2,0xc9))[_0x6140('0x3f')](handleError(_0xb3aac2,null));};exports[_0x6140('0x20')]=function(_0x361248,_0x1b4b0d){if(_0x361248['body']['id']){delete _0x361248[_0x6140('0x48')]['id'];}return db[_0x6140('0x3c')][_0x6140('0x49')]({'where':{'id':_0x361248[_0x6140('0x40')]['id']}})[_0x6140('0x21')](handleEntityNotFound(_0x1b4b0d,null))['then'](saveUpdates(_0x361248[_0x6140('0x48')],null))['then'](respondWithResult(_0x1b4b0d,null))[_0x6140('0x3f')](handleError(_0x1b4b0d,null));};exports[_0x6140('0x24')]=function(_0x2953a8,_0x166b6a){return db[_0x6140('0x3c')][_0x6140('0x49')]({'where':{'id':_0x2953a8['params']['id']}})[_0x6140('0x21')](handleEntityNotFound(_0x166b6a,null))[_0x6140('0x21')](removeEntity(_0x166b6a,null))[_0x6140('0x3f')](handleError(_0x166b6a,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index ba55ac6..24dd7d6 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 _0x2282=['exports','define','Variable','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes'];(function(_0x4bc743,_0x465f94){var _0x5edaaa=function(_0x3e3b5e){while(--_0x3e3b5e){_0x4bc743['push'](_0x4bc743['shift']());}};_0x5edaaa(++_0x465f94);}(_0x2282,0x18b));var _0x2228=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x2282[_0x38537f];return _0x141e23;};'use strict';var _=require(_0x2228('0x0'));var util=require(_0x2228('0x1'));var logger=require(_0x2228('0x2'))(_0x2228('0x3'));var moment=require(_0x2228('0x4'));var BPromise=require(_0x2228('0x5'));var rp=require(_0x2228('0x6'));var fs=require('fs');var path=require(_0x2228('0x7'));var rimraf=require(_0x2228('0x8'));var config=require(_0x2228('0x9'));var attributes=require(_0x2228('0xa'));module[_0x2228('0xb')]=function(_0x1f7578,_0x213908){return _0x1f7578[_0x2228('0xc')](_0x2228('0xd'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cd1=['rimraf','../../config/environment','./variable.attributes','define','Variable','tools_variables','lodash','util','../../config/logger','api','moment','path'];(function(_0x1f15bb,_0x4663fb){var _0x3a49ef=function(_0x5aa13c){while(--_0x5aa13c){_0x1f15bb['push'](_0x1f15bb['shift']());}};_0x3a49ef(++_0x4663fb);}(_0x5cd1,0xd2));var _0x15cd=function(_0x401523,_0x21e3fa){_0x401523=_0x401523-0x0;var _0x1da839=_0x5cd1[_0x401523];return _0x1da839;};'use strict';var _=require(_0x15cd('0x0'));var util=require(_0x15cd('0x1'));var logger=require(_0x15cd('0x2'))(_0x15cd('0x3'));var moment=require(_0x15cd('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x15cd('0x5'));var rimraf=require(_0x15cd('0x6'));var config=require(_0x15cd('0x7'));var attributes=require(_0x15cd('0x8'));module['exports']=function(_0x2dd106,_0x43d513){return _0x2dd106[_0x15cd('0x9')](_0x15cd('0xa'),attributes,{'tableName':_0x15cd('0xb'),'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 839d83c..5fc174b 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 _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0xd49fef,_0x23f01e){var _0x304be8=function(_0x59698b){while(--_0x59698b){_0xd49fef['push'](_0xd49fef['shift']());}};_0x304be8(++_0x23f01e);}(_0xe14b,0x93));var _0xbe14=function(_0x5d72f3,_0x593e51){_0x5d72f3=_0x5d72f3-0x0;var _0xf34690=_0xe14b[_0x5d72f3];return _0xf34690;};'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);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file +var _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x21aa5b,_0x2c808f){var _0x2ca4c8=function(_0x5819e5){while(--_0x5819e5){_0x21aa5b['push'](_0x21aa5b['shift']());}};_0x2ca4c8(++_0x2c808f);}(_0x3e74,0x175));var _0x43e7=function(_0x220845,_0x48cfb5){_0x220845=_0x220845-0x0;var _0x10afb1=_0x3e74[_0x220845];return _0x10afb1;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index e391a0e..0525138 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 _0xe9c6=['reset','/pull','pull','migrations','exports','express','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/reset'];(function(_0x5e7a43,_0x43862a){var _0x3889f1=function(_0x120597){while(--_0x120597){_0x5e7a43['push'](_0x5e7a43['shift']());}};_0x3889f1(++_0x43862a);}(_0xe9c6,0x18d));var _0x6e9c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe9c6[_0x321bb2];return _0x9c12ed;};'use strict';var express=require(_0x6e9c('0x0'));var router=express['Router']();var auth=require(_0x6e9c('0x1'));var controller=require(_0x6e9c('0x2'));router[_0x6e9c('0x3')]('/',controller[_0x6e9c('0x4')]);router[_0x6e9c('0x3')](_0x6e9c('0x5'),auth[_0x6e9c('0x6')](),auth[_0x6e9c('0x7')](),controller['fetch']);router[_0x6e9c('0x3')](_0x6e9c('0x8'),auth[_0x6e9c('0x6')](),auth['canUpdate'](),controller[_0x6e9c('0x9')]);router[_0x6e9c('0x3')](_0x6e9c('0xa'),auth[_0x6e9c('0x6')](),auth[_0x6e9c('0x7')](),controller[_0x6e9c('0xb')]);router[_0x6e9c('0x3')]('/restart',auth[_0x6e9c('0x6')](),controller['restart']);router[_0x6e9c('0x3')]('/migrations',controller[_0x6e9c('0xc')]);module[_0x6e9c('0xd')]=router; \ No newline at end of file +var _0xe983=['/pull','pull','/restart','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','canUpdate','fetch','/reset','isAuthenticated','reset'];(function(_0x2a0abb,_0x44e097){var _0x5b90fb=function(_0x2276e6){while(--_0x2276e6){_0x2a0abb['push'](_0x2a0abb['shift']());}};_0x5b90fb(++_0x44e097);}(_0xe983,0x1e3));var _0x3e98=function(_0xc32c0b,_0x323bd3){_0xc32c0b=_0xc32c0b-0x0;var _0x1216b4=_0xe983[_0xc32c0b];return _0x1216b4;};'use strict';var express=require(_0x3e98('0x0'));var router=express[_0x3e98('0x1')]();var auth=require(_0x3e98('0x2'));var controller=require(_0x3e98('0x3'));router[_0x3e98('0x4')]('/',controller['index']);router[_0x3e98('0x4')]('/fetch',auth['isAuthenticated'](),auth[_0x3e98('0x5')](),controller[_0x3e98('0x6')]);router[_0x3e98('0x4')](_0x3e98('0x7'),auth[_0x3e98('0x8')](),auth['canUpdate'](),controller[_0x3e98('0x9')]);router['get'](_0x3e98('0xa'),auth['isAuthenticated'](),auth[_0x3e98('0x5')](),controller[_0x3e98('0xb')]);router[_0x3e98('0x4')](_0x3e98('0xc'),auth[_0x3e98('0x8')](),controller[_0x3e98('0xd')]);router[_0x3e98('0x4')](_0x3e98('0xe'),controller[_0x3e98('0xf')]);module[_0x3e98('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index be68c29..b39690c 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 _0xb9a6=['map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','Database\x20already\x20up-to-date','umzug','lodash','version','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','update','simple-git','root','index','exports','query','latest','fetch','tags','json','status','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','pull','restart','motion2','then','catch','migrations','readdirSync','push','length','sort','Migration','sequelize','getQueryInterface','join','server'];(function(_0x509d11,_0x41204d){var _0x419244=function(_0x3e4ba3){while(--_0x3e4ba3){_0x509d11['push'](_0x509d11['shift']());}};_0x419244(++_0x41204d);}(_0xb9a6,0x1be));var _0x6b9a=function(_0x4d9ea8,_0x1dc61d){_0x4d9ea8=_0x4d9ea8-0x0;var _0x10948c=_0xb9a6[_0x4d9ea8];return _0x10948c;};'use strict';var Umzug=require(_0x6b9a('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x6b9a('0x1'));var pkginfo=require('pkginfo')(module,_0x6b9a('0x2'));var compareVersions=require(_0x6b9a('0x3'));var exec=require(_0x6b9a('0x4'))[_0x6b9a('0x5')];var db=require(_0x6b9a('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0x6b9a('0x7'));var logger=require('../../config/logger')(_0x6b9a('0x8'));var git=require(_0x6b9a('0x9'))(config[_0x6b9a('0xa')]);exports[_0x6b9a('0xb')]=function(_0x665c21,_0x32baa5){var _0x4b7d04={'current':module[_0x6b9a('0xc')]['version'],'phonebar':0x2};if(_0x665c21[_0x6b9a('0xd')]&&_0x665c21[_0x6b9a('0xd')][_0x6b9a('0xe')]){return git[_0x6b9a('0xf')]()[_0x6b9a('0x10')](function(_0x4328df,_0x2480ee){_0x4b7d04[_0x6b9a('0xe')]=(_0x4328df?module[_0x6b9a('0xc')][_0x6b9a('0x2')]:_0x2480ee[_0x6b9a('0xe')])||'2.0.0';return _0x32baa5['status'](0xc8)[_0x6b9a('0x11')](_0x4b7d04);});}else{return _0x32baa5[_0x6b9a('0x12')](0xc8)['json'](_0x4b7d04);}};exports['fetch']=function(_0x49d38c,_0x314240){return git['fetch']([_0x6b9a('0x13'),_0x6b9a('0x14')],function(_0x68a214){if(_0x68a214){logger[_0x6b9a('0x15')](_0x68a214);return _0x314240[_0x6b9a('0x12')](0x1f4)[_0x6b9a('0x11')](_0x68a214);}logger['info'](_0x6b9a('0x16'));return _0x314240[_0x6b9a('0x12')](0xc8)[_0x6b9a('0x11')]({'output':_0x6b9a('0x17')});});};exports[_0x6b9a('0x18')]=function(_0x215087,_0x3443cc){return git['reset']([_0x6b9a('0x19'),_0x6b9a('0x1a')],function(_0x26f510){if(_0x26f510){logger[_0x6b9a('0x15')](_0x26f510);return _0x3443cc[_0x6b9a('0x12')](0x1f4)[_0x6b9a('0x11')](_0x26f510);}logger[_0x6b9a('0x1b')](_0x6b9a('0x1c'));return _0x3443cc['status'](0xc8)[_0x6b9a('0x11')]({'output':'git\x20reset\x20--hard'});});};exports[_0x6b9a('0x1d')]=function(_0x11447d,_0x310396){exec('npm\x20install\x20--production',function(_0x585413,_0x423bd1,_0x3b036c){logger['info'](_0x423bd1);logger['info'](_0x3b036c);if(_0x585413){logger[_0x6b9a('0x15')](_0x585413);return _0x310396[_0x6b9a('0x12')](0x1f4)[_0x6b9a('0x11')](_0x585413);}return _0x310396[_0x6b9a('0x12')](0xc8)['json']({'output':_0x423bd1});});};exports[_0x6b9a('0x1e')]=function(_0x1f5227,_0x229c88){return pm2[_0x6b9a('0x1e')](_0x6b9a('0x1f'))[_0x6b9a('0x20')](function(_0x140e81){logger[_0x6b9a('0x1b')]('pm2\x20restart\x20motion\x20%s',_0x140e81);return _0x229c88[_0x6b9a('0x12')](0xc8)[_0x6b9a('0x11')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x6b9a('0x21')](function(_0xf74d42){logger[_0x6b9a('0x15')](_0xf74d42);return _0x229c88['status'](0x1f4)[_0x6b9a('0x11')](_0xf74d42);});};exports[_0x6b9a('0x22')]=function(_0xa455d3,_0x14b1ce){var _0x5999bb=fs[_0x6b9a('0x23')](path['join'](config['root'],'server',_0x6b9a('0x22')));var _0x1d59bd=[];for(var _0x21ecf5=0x0;_0x21ecf5<_0x5999bb['length'];_0x21ecf5++){var _0x156984=_0x5999bb[_0x21ecf5]['replace']('.js','');if(compareVersions(module[_0x6b9a('0xc')]['version'],_0x156984)===-0x1){_0x1d59bd[_0x6b9a('0x24')](_0x156984);}}if(_0x1d59bd[_0x6b9a('0x25')]){var _0x3d9592=_0x1d59bd[_0x6b9a('0x26')](compareVersions);var _0x7bbff7=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x6b9a('0x27')],'modelName':_0x6b9a('0x27'),'columnName':'version'},'migrations':{'params':[db[_0x6b9a('0x28')][_0x6b9a('0x29')](),db[_0x6b9a('0x28')]['constructor'],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[_0x6b9a('0x2a')](config['root'],_0x6b9a('0x2b'),_0x6b9a('0x22')),'pattern':/\.js$/}});_0x7bbff7['up']({'migrations':_[_0x6b9a('0x2c')](_0x3d9592,function(_0x3299ca){return _0x3299ca+_0x6b9a('0x2d');})})[_0x6b9a('0x20')](function(){return _0x14b1ce[_0x6b9a('0x12')](0xc8)[_0x6b9a('0x11')]({'output':_0x6b9a('0x2e')+module[_0x6b9a('0xc')][_0x6b9a('0x2')]+_0x6b9a('0x2f')+_['last'](_0x3d9592),'migrations':_[_0x6b9a('0x2a')](_0x3d9592)});})[_0x6b9a('0x21')](function(_0x5c8218){if(_0x5c8218 instanceof db[_0x6b9a('0x28')]['UniqueConstraintError']){return _0x14b1ce[_0x6b9a('0x12')](0xc8)[_0x6b9a('0x11')]({'output':_0x6b9a('0x30')});}else{return _0x14b1ce[_0x6b9a('0x12')](0x1f4)[_0x6b9a('0x11')](_0x5c8218);}});}else{return _0x14b1ce[_0x6b9a('0x12')](0xc8)[_0x6b9a('0x11')]({'output':_0x6b9a('0x30')});}}; \ No newline at end of file +var _0xdece=['root','migrations','length','replace','.js','exports','Migration','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','query','latest','fetch','tags','2.0.0','status','json','origin','master','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','readdirSync','join'];(function(_0x1d39f6,_0x146f4a){var _0x3dbd7a=function(_0x4486f2){while(--_0x4486f2){_0x1d39f6['push'](_0x1d39f6['shift']());}};_0x3dbd7a(++_0x146f4a);}(_0xdece,0x1a8));var _0xedec=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xdece[_0x4e676e];return _0x336a3c;};'use strict';var Umzug=require(_0xedec('0x0'));var path=require(_0xedec('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,_0xedec('0x2'));var compareVersions=require(_0xedec('0x3'));var exec=require(_0xedec('0x4'))[_0xedec('0x5')];var db=require(_0xedec('0x6'))['db'];var config=require(_0xedec('0x7'));var pm2=require('../../config/pm2');var logger=require(_0xedec('0x8'))('update');var git=require('simple-git')(config['root']);exports['index']=function(_0x9969eb,_0x23d8cd){var _0x2fb9e5={'current':module['exports'][_0xedec('0x2')],'phonebar':0x2};if(_0x9969eb[_0xedec('0x9')]&&_0x9969eb[_0xedec('0x9')][_0xedec('0xa')]){return git[_0xedec('0xb')]()[_0xedec('0xc')](function(_0x4e3a3f,_0x31f8e9){_0x2fb9e5[_0xedec('0xa')]=(_0x4e3a3f?module['exports'][_0xedec('0x2')]:_0x31f8e9[_0xedec('0xa')])||_0xedec('0xd');return _0x23d8cd[_0xedec('0xe')](0xc8)[_0xedec('0xf')](_0x2fb9e5);});}else{return _0x23d8cd['status'](0xc8)[_0xedec('0xf')](_0x2fb9e5);}};exports[_0xedec('0xb')]=function(_0x16fc20,_0xbe4d47){return git[_0xedec('0xb')]([_0xedec('0x10'),_0xedec('0x11')],function(_0x13c7f4){if(_0x13c7f4){logger['error'](_0x13c7f4);return _0xbe4d47[_0xedec('0xe')](0x1f4)['json'](_0x13c7f4);}logger[_0xedec('0x12')](_0xedec('0x13'));return _0xbe4d47[_0xedec('0xe')](0xc8)[_0xedec('0xf')]({'output':_0xedec('0x14')});});};exports[_0xedec('0x15')]=function(_0x526abb,_0x492024){return git[_0xedec('0x15')]([_0xedec('0x16'),_0xedec('0x17')],function(_0x282a9b){if(_0x282a9b){logger[_0xedec('0x18')](_0x282a9b);return _0x492024[_0xedec('0xe')](0x1f4)['json'](_0x282a9b);}logger[_0xedec('0x12')](_0xedec('0x19'));return _0x492024[_0xedec('0xe')](0xc8)[_0xedec('0xf')]({'output':_0xedec('0x1a')});});};exports['pull']=function(_0x289e51,_0x56b3c0){exec(_0xedec('0x1b'),function(_0x9c7f19,_0x127dc8,_0x5255db){logger['info'](_0x127dc8);logger[_0xedec('0x12')](_0x5255db);if(_0x9c7f19){logger[_0xedec('0x18')](_0x9c7f19);return _0x56b3c0['status'](0x1f4)[_0xedec('0xf')](_0x9c7f19);}return _0x56b3c0[_0xedec('0xe')](0xc8)[_0xedec('0xf')]({'output':_0x127dc8});});};exports[_0xedec('0x1c')]=function(_0x10b9a1,_0x346897){return pm2[_0xedec('0x1c')](_0xedec('0x1d'))[_0xedec('0x1e')](function(_0x4c032b){logger['info'](_0xedec('0x1f'),_0x4c032b);return _0x346897[_0xedec('0xe')](0xc8)[_0xedec('0xf')]({'output':_0xedec('0x20')});})['catch'](function(_0x2fbac8){logger[_0xedec('0x18')](_0x2fbac8);return _0x346897[_0xedec('0xe')](0x1f4)[_0xedec('0xf')](_0x2fbac8);});};exports['migrations']=function(_0x50e450,_0x2a5fde){var _0x42560b=fs[_0xedec('0x21')](path[_0xedec('0x22')](config[_0xedec('0x23')],'server',_0xedec('0x24')));var _0x9110f=[];for(var _0x522267=0x0;_0x522267<_0x42560b[_0xedec('0x25')];_0x522267++){var _0x3382f3=_0x42560b[_0x522267][_0xedec('0x26')](_0xedec('0x27'),'');if(compareVersions(module[_0xedec('0x28')][_0xedec('0x2')],_0x3382f3)===-0x1){_0x9110f['push'](_0x3382f3);}}if(_0x9110f[_0xedec('0x25')]){var _0x3072d6=_0x9110f['sort'](compareVersions);var _0x3bf58d=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xedec('0x29')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0xedec('0x2a')]['getQueryInterface'](),db[_0xedec('0x2a')][_0xedec('0x2b')],function(){throw new Error(_0xedec('0x2c'));}],'path':path[_0xedec('0x22')](config[_0xedec('0x23')],_0xedec('0x2d'),_0xedec('0x24')),'pattern':/\.js$/}});_0x3bf58d['up']({'migrations':_[_0xedec('0x2e')](_0x3072d6,function(_0x21085a){return _0x21085a+'.js';})})[_0xedec('0x1e')](function(){return _0x2a5fde['status'](0xc8)[_0xedec('0xf')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0xedec('0x2')]+'\x20to\x20'+_[_0xedec('0x2f')](_0x3072d6),'migrations':_[_0xedec('0x22')](_0x3072d6)});})[_0xedec('0x30')](function(_0x1fb2b4){if(_0x1fb2b4 instanceof db[_0xedec('0x2a')][_0xedec('0x31')]){return _0x2a5fde['status'](0xc8)[_0xedec('0xf')]({'output':_0xedec('0x32')});}else{return _0x2a5fde[_0xedec('0xe')](0x1f4)[_0xedec('0xf')](_0x1fb2b4);}});}else{return _0x2a5fde[_0xedec('0xe')](0xc8)[_0xedec('0xf')]({'output':_0xedec('0x32')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 2ee21ad..ab62052 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 _0xc359=['describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','express','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe'];(function(_0x1e2ad7,_0x5caded){var _0x584cda=function(_0x31af6a){while(--_0x31af6a){_0x1e2ad7['push'](_0x1e2ad7['shift']());}};_0x584cda(++_0x5caded);}(_0xc359,0x99));var _0x9c35=function(_0x4d2ed7,_0x1999e5){_0x4d2ed7=_0x4d2ed7-0x0;var _0x12af27=_0xc359[_0x4d2ed7];return _0x12af27;};'use strict';var multer=require(_0x9c35('0x0'));var util=require(_0x9c35('0x1'));var path=require(_0x9c35('0x2'));var timeout=require('connect-timeout');var express=require(_0x9c35('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9c35('0x4'));var controller=require(_0x9c35('0x5'));router[_0x9c35('0x6')]('/',auth[_0x9c35('0x7')](),controller['index']);router[_0x9c35('0x6')](_0x9c35('0x8'),auth[_0x9c35('0x7')](),controller[_0x9c35('0x9')]);router[_0x9c35('0x6')](_0x9c35('0xa'),auth[_0x9c35('0x7')](),controller[_0x9c35('0xb')]);router[_0x9c35('0xc')]('/',auth[_0x9c35('0x7')](),controller[_0x9c35('0xd')]);router[_0x9c35('0xe')](_0x9c35('0xa'),auth['isAuthenticated'](),controller[_0x9c35('0xf')]);router[_0x9c35('0x10')]('/:id',auth[_0x9c35('0x7')](),controller['destroy']);module[_0x9c35('0x11')]=router; \ No newline at end of file +var _0x400b=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x400b,0x15a));var _0xb400=function(_0xcd8c7a,_0x3ef9ea){_0xcd8c7a=_0xcd8c7a-0x0;var _0x58d7a1=_0x400b[_0xcd8c7a];return _0x58d7a1;};'use strict';var multer=require(_0xb400('0x0'));var util=require(_0xb400('0x1'));var path=require(_0xb400('0x2'));var timeout=require(_0xb400('0x3'));var express=require(_0xb400('0x4'));var router=express[_0xb400('0x5')]();var fs_extra=require(_0xb400('0x6'));var auth=require(_0xb400('0x7'));var interaction=require(_0xb400('0x8'));var config=require('../../config/environment');var controller=require(_0xb400('0x9'));router[_0xb400('0xa')]('/',auth[_0xb400('0xb')](),controller[_0xb400('0xc')]);router['get'](_0xb400('0xd'),auth[_0xb400('0xb')](),controller[_0xb400('0xe')]);router[_0xb400('0xa')](_0xb400('0xf'),auth['isAuthenticated'](),controller[_0xb400('0x10')]);router[_0xb400('0x11')]('/',auth['isAuthenticated'](),controller[_0xb400('0x12')]);router['put'](_0xb400('0xf'),auth['isAuthenticated'](),controller[_0xb400('0x13')]);router[_0xb400('0x14')](_0xb400('0xf'),auth[_0xb400('0xb')](),controller['destroy']);module[_0xb400('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index c750d19..75c4bdb 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 _0x056b=['INTEGER','BOOLEAN','exports','STRING','DATE'];(function(_0x5b5ffe,_0xa8bf6e){var _0x4c2fb0=function(_0x48ca31){while(--_0x48ca31){_0x5b5ffe['push'](_0x5b5ffe['shift']());}};_0x4c2fb0(++_0xa8bf6e);}(_0x056b,0xb6));var _0xb056=function(_0x6f8972,_0x343da7){_0x6f8972=_0x6f8972-0x0;var _0x5677d9=_0x056b[_0x6f8972];return _0x5677d9;};'use strict';var Sequelize=require('sequelize');module[_0xb056('0x0')]={'type':{'type':Sequelize[_0xb056('0x1')]},'uniqueid':{'type':Sequelize[_0xb056('0x1')]},'calleridnum':{'type':Sequelize[_0xb056('0x1')]},'calleridname':{'type':Sequelize[_0xb056('0x1')]},'queue':{'type':Sequelize[_0xb056('0x1')]},'interface':{'type':Sequelize[_0xb056('0x1')]},'membername':{'type':Sequelize[_0xb056('0x1')]},'agentcalledAt':{'type':Sequelize[_0xb056('0x2')]},'agentconnectAt':{'type':Sequelize[_0xb056('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xb056('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xb056('0x2')]},'holdtime':{'type':Sequelize[_0xb056('0x3')]},'agentcomplete':{'type':Sequelize[_0xb056('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xb056('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xb056('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xb056('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xb056('0x1')]},'lastevent':{'type':Sequelize[_0xb056('0x1')]},'channel':{'type':Sequelize[_0xb056('0x1')]},'channelstate':{'type':Sequelize[_0xb056('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xb056('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xb056('0x1')]},'accountcode':{'type':Sequelize[_0xb056('0x1')]},'context':{'type':Sequelize[_0xb056('0x1')]},'exten':{'type':Sequelize[_0xb056('0x1')]},'priority':{'type':Sequelize[_0xb056('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xb056('0x1')]},'destcalleridnum':{'type':Sequelize[_0xb056('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb056('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xb056('0x1')]},'destlanguage':{'type':Sequelize[_0xb056('0x1')]},'destaccountcode':{'type':Sequelize[_0xb056('0x1')]},'destcontext':{'type':Sequelize[_0xb056('0x1')]},'destexten':{'type':Sequelize[_0xb056('0x1')]},'destpriority':{'type':Sequelize[_0xb056('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xb056('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xb056('0x1')]},'transfer':{'type':Sequelize[_0xb056('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb056('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xb056('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xb056('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xda2d=['DATE','INTEGER','BOOLEAN','exports','STRING'];(function(_0x13146c,_0x2b49fd){var _0x401e88=function(_0x10a605){while(--_0x10a605){_0x13146c['push'](_0x13146c['shift']());}};_0x401e88(++_0x2b49fd);}(_0xda2d,0x102));var _0xdda2=function(_0x4db55c,_0x5928d3){_0x4db55c=_0x4db55c-0x0;var _0x294a02=_0xda2d[_0x4db55c];return _0x294a02;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'type':{'type':Sequelize[_0xdda2('0x1')]},'uniqueid':{'type':Sequelize[_0xdda2('0x1')]},'calleridnum':{'type':Sequelize[_0xdda2('0x1')]},'calleridname':{'type':Sequelize[_0xdda2('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xdda2('0x2')]},'agentconnectAt':{'type':Sequelize[_0xdda2('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xdda2('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xdda2('0x2')]},'agentdumpAt':{'type':Sequelize[_0xdda2('0x2')]},'holdtime':{'type':Sequelize[_0xdda2('0x3')]},'agentcomplete':{'type':Sequelize[_0xdda2('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xdda2('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xdda2('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xdda2('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xdda2('0x3')]},'reason':{'type':Sequelize[_0xdda2('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xdda2('0x1')]},'channelstate':{'type':Sequelize[_0xdda2('0x3')]},'channelstatedesc':{'type':Sequelize[_0xdda2('0x1')]},'connectedlinenum':{'type':Sequelize[_0xdda2('0x1')]},'connectedlinename':{'type':Sequelize[_0xdda2('0x1')]},'language':{'type':Sequelize[_0xdda2('0x1')]},'accountcode':{'type':Sequelize[_0xdda2('0x1')]},'context':{'type':Sequelize[_0xdda2('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdda2('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xdda2('0x1')]},'destcalleridnum':{'type':Sequelize[_0xdda2('0x1')]},'destcalleridname':{'type':Sequelize[_0xdda2('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xdda2('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xdda2('0x1')]},'destlanguage':{'type':Sequelize[_0xdda2('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xdda2('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xdda2('0x1')]},'destuniqueid':{'type':Sequelize[_0xdda2('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xdda2('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xdda2('0x1')]},'transfer':{'type':Sequelize[_0xdda2('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xdda2('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xdda2('0x3')],'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 e29ff44..6e1393f 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(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 e97e03a..99be7a6 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 _0x4491=['path','rimraf','../../config/environment','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x2a4c2b,_0x1ce4a3){var _0x5c5cd1=function(_0x2f65e4){while(--_0x2f65e4){_0x2a4c2b['push'](_0x2a4c2b['shift']());}};_0x5c5cd1(++_0x1ce4a3);}(_0x4491,0x1bb));var _0x1449=function(_0x6d0b69,_0xe1e6b2){_0x6d0b69=_0x6d0b69-0x0;var _0x3f013f=_0x4491[_0x6d0b69];return _0x3f013f;};'use strict';var _=require(_0x1449('0x0'));var util=require('util');var logger=require(_0x1449('0x1'))('api');var moment=require(_0x1449('0x2'));var BPromise=require(_0x1449('0x3'));var rp=require(_0x1449('0x4'));var fs=require('fs');var path=require(_0x1449('0x5'));var rimraf=require(_0x1449('0x6'));var config=require(_0x1449('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0x1449('0x8')]=function(_0x557482,_0x1d45eb){return _0x557482[_0x1449('0x9')](_0x1449('0xa'),attributes,{'tableName':_0x1449('0xb'),'paranoid':![],'indexes':[{'fields':[_0x1449('0xc'),_0x1449('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x861c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util'];(function(_0x167d8c,_0x4fac6b){var _0x427618=function(_0x552724){while(--_0x552724){_0x167d8c['push'](_0x167d8c['shift']());}};_0x427618(++_0x4fac6b);}(_0x861c,0xdb));var _0xc861=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x861c[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xc861('0x0'));var util=require(_0xc861('0x1'));var logger=require(_0xc861('0x2'))(_0xc861('0x3'));var moment=require(_0xc861('0x4'));var BPromise=require(_0xc861('0x5'));var rp=require(_0xc861('0x6'));var fs=require('fs');var path=require(_0xc861('0x7'));var rimraf=require(_0xc861('0x8'));var config=require(_0xc861('0x9'));var attributes=require(_0xc861('0xa'));module[_0xc861('0xb')]=function(_0x562f12,_0xc3b5fd){return _0x562f12[_0xc861('0xc')](_0xc861('0xd'),attributes,{'tableName':_0xc861('0xe'),'paranoid':![],'indexes':[{'fields':[_0xc861('0xf'),_0xc861('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 45c0703..9084238 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 _0x9d4a=['body','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','options','stringify','UpdateVoiceAgentReport','VoiceAgentReport'];(function(_0x3acb0f,_0x422e6f){var _0x5bdb4f=function(_0x424444){while(--_0x424444){_0x3acb0f['push'](_0x3acb0f['shift']());}};_0x5bdb4f(++_0x422e6f);}(_0x9d4a,0xb4));var _0xa9d4=function(_0x28877d,_0x5eef50){_0x28877d=_0x28877d-0x0;var _0x31b577=_0x9d4a[_0x28877d];return _0x31b577;};'use strict';var _=require(_0xa9d4('0x0'));var util=require(_0xa9d4('0x1'));var moment=require(_0xa9d4('0x2'));var BPromise=require(_0xa9d4('0x3'));var rs=require(_0xa9d4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9d4('0x5'))['db'];var utils=require(_0xa9d4('0x6'));var logger=require(_0xa9d4('0x7'))(_0xa9d4('0x8'));var config=require(_0xa9d4('0x9'));var jayson=require(_0xa9d4('0xa'));var client=jayson[_0xa9d4('0xb')][_0xa9d4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ee981,_0x122fcb,_0x1dcf05){return new BPromise(function(_0x2b65b3,_0x504da2){return client[_0xa9d4('0xd')](_0x4ee981,_0x1dcf05)[_0xa9d4('0xe')](function(_0x1d0a82){logger[_0xa9d4('0xf')](_0xa9d4('0x10'),_0x122fcb,_0xa9d4('0x11'));logger[_0xa9d4('0x12')](_0xa9d4('0x13'),_0x122fcb,_0xa9d4('0x11'),JSON['stringify'](_0x1d0a82));if(_0x1d0a82[_0xa9d4('0x14')]){if(_0x1d0a82['error'][_0xa9d4('0x15')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x122fcb,_0x1d0a82['error'][_0xa9d4('0x16')]);return _0x504da2(_0x1d0a82[_0xa9d4('0x14')][_0xa9d4('0x16')]);}logger['error'](_0xa9d4('0x10'),_0x122fcb,_0x1d0a82[_0xa9d4('0x14')]['message']);return _0x2b65b3(_0x1d0a82['error']['message']);}else{logger[_0xa9d4('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x122fcb,_0xa9d4('0x11'));_0x2b65b3(_0x1d0a82[_0xa9d4('0x17')]['message']);}})[_0xa9d4('0x18')](function(_0x5a2ff6){logger[_0xa9d4('0x14')](_0xa9d4('0x10'),_0x122fcb,_0x5a2ff6);_0x504da2(_0x5a2ff6);});});}exports[_0xa9d4('0x19')]=function(_0x5c447f){var _0x363fc3=this;return new Promise(function(_0xc6d4ea,_0x3b5601){return db['VoiceAgentReport']['create'](_0x5c447f['body'],{'raw':_0x5c447f[_0xa9d4('0x1a')]?_0x5c447f[_0xa9d4('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xa9d4('0xe')](function(_0x3e8427){logger['info']('CreateVoiceAgentReport',_0x5c447f);logger['debug']('CreateVoiceAgentReport',_0x5c447f,JSON[_0xa9d4('0x1b')](_0x3e8427));_0xc6d4ea(_0x3e8427);})[_0xa9d4('0x18')](function(_0x18ce84){logger['error'](_0xa9d4('0x19'),_0x18ce84[_0xa9d4('0x16')],_0x5c447f);_0x3b5601(_0x363fc3[_0xa9d4('0x14')](0x1f4,_0x18ce84['message']));});});};exports[_0xa9d4('0x1c')]=function(_0x5691d6){var _0x32d611=this;return new Promise(function(_0x4f0ff3,_0x1c6264){return db[_0xa9d4('0x1d')]['update'](_0x5691d6[_0xa9d4('0x1e')],{'raw':_0x5691d6[_0xa9d4('0x1a')]?_0x5691d6[_0xa9d4('0x1a')][_0xa9d4('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5691d6[_0xa9d4('0x1a')]?_0x5691d6[_0xa9d4('0x1a')][_0xa9d4('0x20')]||null:null,'attributes':_0x5691d6[_0xa9d4('0x1a')]?_0x5691d6[_0xa9d4('0x1a')][_0xa9d4('0x21')]||null:null,'limit':_0x5691d6[_0xa9d4('0x1a')]?_0x5691d6[_0xa9d4('0x1a')][_0xa9d4('0x22')]||null:null})[_0xa9d4('0xe')](function(_0x37b11e){logger[_0xa9d4('0xf')]('UpdateVoiceAgentReport',_0x5691d6);logger[_0xa9d4('0x12')](_0xa9d4('0x1c'),_0x5691d6,JSON[_0xa9d4('0x1b')](_0x37b11e));_0x4f0ff3(_0x37b11e);})[_0xa9d4('0x18')](function(_0x5abaec){logger[_0xa9d4('0x14')](_0xa9d4('0x1c'),_0x5abaec[_0xa9d4('0x16')],_0x5691d6);_0x1c6264(_0x32d611['error'](0x1f4,_0x5abaec[_0xa9d4('0x16')]));});});}; \ No newline at end of file +var _0xf1fa=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','then','update','attributes','limit','UpdateVoiceAgentReport','util','moment','bluebird'];(function(_0x3c121a,_0x128f23){var _0x1108b5=function(_0x1ca55e){while(--_0x1ca55e){_0x3c121a['push'](_0x3c121a['shift']());}};_0x1108b5(++_0x128f23);}(_0xf1fa,0xa7));var _0xaf1f=function(_0x1a2063,_0x28b76c){_0x1a2063=_0x1a2063-0x0;var _0x478854=_0xf1fa[_0x1a2063];return _0x478854;};'use strict';var _=require('lodash');var util=require(_0xaf1f('0x0'));var moment=require(_0xaf1f('0x1'));var BPromise=require(_0xaf1f('0x2'));var rs=require(_0xaf1f('0x3'));var fs=require('fs');var Redis=require(_0xaf1f('0x4'));var db=require(_0xaf1f('0x5'))['db'];var utils=require(_0xaf1f('0x6'));var logger=require(_0xaf1f('0x7'))('rpc');var config=require(_0xaf1f('0x8'));var jayson=require(_0xaf1f('0x9'));var client=jayson[_0xaf1f('0xa')][_0xaf1f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36f834,_0x586ae7,_0x2b918b){return new BPromise(function(_0x2b125c,_0xa1c0a8){return client['request'](_0x36f834,_0x2b918b)['then'](function(_0x387f1b){logger[_0xaf1f('0xc')](_0xaf1f('0xd'),_0x586ae7,_0xaf1f('0xe'));logger[_0xaf1f('0xf')](_0xaf1f('0x10'),_0x586ae7,_0xaf1f('0xe'),JSON[_0xaf1f('0x11')](_0x387f1b));if(_0x387f1b[_0xaf1f('0x12')]){if(_0x387f1b[_0xaf1f('0x12')][_0xaf1f('0x13')]===0x1f4){logger[_0xaf1f('0x12')](_0xaf1f('0xd'),_0x586ae7,_0x387f1b[_0xaf1f('0x12')][_0xaf1f('0x14')]);return _0xa1c0a8(_0x387f1b[_0xaf1f('0x12')][_0xaf1f('0x14')]);}logger[_0xaf1f('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x586ae7,_0x387f1b[_0xaf1f('0x12')][_0xaf1f('0x14')]);return _0x2b125c(_0x387f1b[_0xaf1f('0x12')][_0xaf1f('0x14')]);}else{logger[_0xaf1f('0xc')](_0xaf1f('0xd'),_0x586ae7,_0xaf1f('0xe'));_0x2b125c(_0x387f1b[_0xaf1f('0x15')][_0xaf1f('0x14')]);}})[_0xaf1f('0x16')](function(_0x5d8c9a){logger['error'](_0xaf1f('0xd'),_0x586ae7,_0x5d8c9a);_0xa1c0a8(_0x5d8c9a);});});}exports[_0xaf1f('0x17')]=function(_0x4596d9){var _0xcd3f9d=this;return new Promise(function(_0x48873f,_0x3f44c3){return db[_0xaf1f('0x18')][_0xaf1f('0x19')](_0x4596d9[_0xaf1f('0x1a')],{'raw':_0x4596d9[_0xaf1f('0x1b')]?_0x4596d9['options'][_0xaf1f('0x1c')]===undefined?!![]:![]:!![]})[_0xaf1f('0x1d')](function(_0x404666){logger['info'](_0xaf1f('0x17'),_0x4596d9);logger['debug'](_0xaf1f('0x17'),_0x4596d9,JSON['stringify'](_0x404666));_0x48873f(_0x404666);})[_0xaf1f('0x16')](function(_0x2f1ded){logger[_0xaf1f('0x12')](_0xaf1f('0x17'),_0x2f1ded[_0xaf1f('0x14')],_0x4596d9);_0x3f44c3(_0xcd3f9d['error'](0x1f4,_0x2f1ded[_0xaf1f('0x14')]));});});};exports['UpdateVoiceAgentReport']=function(_0x34f00){var _0x1663cf=this;return new Promise(function(_0x3330db,_0xc8658e){return db[_0xaf1f('0x18')][_0xaf1f('0x1e')](_0x34f00['body'],{'raw':_0x34f00[_0xaf1f('0x1b')]?_0x34f00[_0xaf1f('0x1b')][_0xaf1f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34f00['options']?_0x34f00[_0xaf1f('0x1b')]['where']||null:null,'attributes':_0x34f00[_0xaf1f('0x1b')]?_0x34f00[_0xaf1f('0x1b')][_0xaf1f('0x1f')]||null:null,'limit':_0x34f00['options']?_0x34f00[_0xaf1f('0x1b')][_0xaf1f('0x20')]||null:null})[_0xaf1f('0x1d')](function(_0x96def7){logger[_0xaf1f('0xc')](_0xaf1f('0x21'),_0x34f00);logger[_0xaf1f('0xf')](_0xaf1f('0x21'),_0x34f00,JSON[_0xaf1f('0x11')](_0x96def7));_0x3330db(_0x96def7);})[_0xaf1f('0x16')](function(_0x5c1c90){logger[_0xaf1f('0x12')](_0xaf1f('0x21'),_0x5c1c90[_0xaf1f('0x14')],_0x34f00);_0xc8658e(_0x1663cf[_0xaf1f('0x12')](0x1f4,_0x5c1c90[_0xaf1f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index b4335b2..54d0a45 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 _0x6b8f=['destroy','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put'];(function(_0x26aee4,_0x530ead){var _0x2e1048=function(_0x2e92db){while(--_0x2e92db){_0x26aee4['push'](_0x26aee4['shift']());}};_0x2e1048(++_0x530ead);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x508fdf,_0xde29f4){_0x508fdf=_0x508fdf-0x0;var _0x39291d=_0x6b8f[_0x508fdf];return _0x39291d;};'use strict';var multer=require('multer');var util=require(_0xf6b8('0x0'));var path=require('path');var timeout=require(_0xf6b8('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf6b8('0x2'));var auth=require(_0xf6b8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf6b8('0x4'));var controller=require(_0xf6b8('0x5'));router[_0xf6b8('0x6')]('/',auth['isAuthenticated'](),controller[_0xf6b8('0x7')]);router[_0xf6b8('0x6')](_0xf6b8('0x8'),auth[_0xf6b8('0x9')](),controller['describe']);router['get'](_0xf6b8('0xa'),auth['isAuthenticated'](),controller[_0xf6b8('0xb')]);router[_0xf6b8('0xc')]('/',auth[_0xf6b8('0x9')](),controller[_0xf6b8('0xd')]);router[_0xf6b8('0xe')](_0xf6b8('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xf6b8('0xa'),auth[_0xf6b8('0x9')](),controller[_0xf6b8('0xf')]);module[_0xf6b8('0x10')]=router; \ No newline at end of file +var _0x5178=['/describe','isAuthenticated','describe','/:id','post','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index'];(function(_0x35ed15,_0x4256f9){var _0x5e9001=function(_0x4570ef){while(--_0x4570ef){_0x35ed15['push'](_0x35ed15['shift']());}};_0x5e9001(++_0x4256f9);}(_0x5178,0x171));var _0x8517=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x5178[_0x1ac595];return _0x455fff;};'use strict';var multer=require('multer');var util=require(_0x8517('0x0'));var path=require(_0x8517('0x1'));var timeout=require(_0x8517('0x2'));var express=require(_0x8517('0x3'));var router=express[_0x8517('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8517('0x5'));var config=require(_0x8517('0x6'));var controller=require('./voiceCallReport.controller');router[_0x8517('0x7')]('/',auth['isAuthenticated'](),controller[_0x8517('0x8')]);router[_0x8517('0x7')](_0x8517('0x9'),auth[_0x8517('0xa')](),controller[_0x8517('0xb')]);router['get'](_0x8517('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x8517('0xd')]('/',auth[_0x8517('0xa')](),controller['create']);router[_0x8517('0xe')](_0x8517('0xc'),auth[_0x8517('0xa')](),controller[_0x8517('0xf')]);router[_0x8517('0x10')](_0x8517('0xc'),auth[_0x8517('0xa')](),controller[_0x8517('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 633e939..0969ca3 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 _0x1760=['inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','STRING','ENUM','inbound','internal','outbound'];(function(_0x1c0dc4,_0x439dff){var _0x48c477=function(_0x1d3b98){while(--_0x1d3b98){_0x1c0dc4['push'](_0x1c0dc4['shift']());}};_0x48c477(++_0x439dff);}(_0x1760,0x11a));var _0x0176=function(_0x1af45a,_0x25cda2){_0x1af45a=_0x1af45a-0x0;var _0x4b911f=_0x1760[_0x1af45a];return _0x4b911f;};'use strict';var Sequelize=require(_0x0176('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x0176('0x1')]},'type':{'type':Sequelize[_0x0176('0x2')](_0x0176('0x3'),_0x0176('0x4'),_0x0176('0x5'),_0x0176('0x6'),_0x0176('0x7'),_0x0176('0x8'))},'tag':{'type':Sequelize[_0x0176('0x1')]},'accountcode':{'type':Sequelize[_0x0176('0x1')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0176('0x1')]},'destinationcontext':{'type':Sequelize[_0x0176('0x1')]},'callerid':{'type':Sequelize[_0x0176('0x1')]},'channel':{'type':Sequelize[_0x0176('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0176('0x1')]},'lastdata':{'type':Sequelize[_0x0176('0x9')]},'starttime':{'type':Sequelize[_0x0176('0xa')]},'systemanswertime':{'type':Sequelize[_0x0176('0xa')]},'answertime':{'type':Sequelize[_0x0176('0xa')]},'endtime':{'type':Sequelize[_0x0176('0xa')]},'duration':{'type':Sequelize[_0x0176('0xb')]},'billableseconds':{'type':Sequelize[_0x0176('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x0176('0x1')]},'userfield':{'type':Sequelize[_0x0176('0x1')]},'userDisposition':{'type':Sequelize[_0x0176('0x1')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0176('0x1')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x0176('0xb')]},'sipcallid':{'type':Sequelize[_0x0176('0x1')]}}; \ No newline at end of file +var _0x68ee=['DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','dialer'];(function(_0x330414,_0x4f3207){var _0x99dbff=function(_0x166f85){while(--_0x166f85){_0x330414['push'](_0x330414['shift']());}};_0x99dbff(++_0x4f3207);}(_0x68ee,0xd3));var _0xe68e=function(_0x132282,_0x463665){_0x132282=_0x132282-0x0;var _0x4cc233=_0x68ee[_0x132282];return _0x4cc233;};'use strict';var Sequelize=require(_0xe68e('0x0'));module[_0xe68e('0x1')]={'uniqueid':{'type':Sequelize[_0xe68e('0x2')]},'type':{'type':Sequelize[_0xe68e('0x3')](_0xe68e('0x4'),_0xe68e('0x5'),_0xe68e('0x6'),_0xe68e('0x7'),'outbound-fax',_0xe68e('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xe68e('0x2')]},'source':{'type':Sequelize[_0xe68e('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xe68e('0x2')]},'callerid':{'type':Sequelize[_0xe68e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xe68e('0x2')]},'lastapplication':{'type':Sequelize[_0xe68e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xe68e('0x9')]},'systemanswertime':{'type':Sequelize[_0xe68e('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xe68e('0x9')]},'duration':{'type':Sequelize[_0xe68e('0xa')]},'billableseconds':{'type':Sequelize[_0xe68e('0xa')]},'mohtime':{'type':Sequelize[_0xe68e('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe68e('0x2')]},'amaflags':{'type':Sequelize[_0xe68e('0x2')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xe68e('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xe68e('0x2')]},'note':{'type':Sequelize[_0xe68e('0x2')]},'prefix':{'type':Sequelize[_0xe68e('0x2')]},'routeid':{'type':Sequelize[_0xe68e('0xa')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 2e556c3..16a63eb 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 _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(_0x430f44,_0x4ae21b){var _0x1f6b0f=function(_0x35968f){while(--_0x35968f){_0x430f44['push'](_0x430f44['shift']());}};_0x1f6b0f(++_0x4ae21b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2053b8,_0x28b11b){_0x2053b8=_0x2053b8-0x0;var _0x25ee70=_0x5f2f[_0x2053b8];return _0x25ee70;};'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 +var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x2ef3,0xba));var _0x32ef=function(_0x2dff3f,_0x56419f){_0x2dff3f=_0x2dff3f-0x0;var _0x474093=_0x2ef3[_0x2dff3f];return _0x474093;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 199effe..2094eb7 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 _0x24ce=['request-promise','path','rimraf','../../config/environment','define','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x24ce,0x159));var _0xe24c=function(_0xe59d3,_0x210cbb){_0xe59d3=_0xe59d3-0x0;var _0x50cd25=_0x24ce[_0xe59d3];return _0x50cd25;};'use strict';var _=require(_0xe24c('0x0'));var util=require(_0xe24c('0x1'));var logger=require(_0xe24c('0x2'))(_0xe24c('0x3'));var moment=require(_0xe24c('0x4'));var BPromise=require(_0xe24c('0x5'));var rp=require(_0xe24c('0x6'));var fs=require('fs');var path=require(_0xe24c('0x7'));var rimraf=require(_0xe24c('0x8'));var config=require(_0xe24c('0x9'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x3f1be1,_0x5bdaf4){return _0x3f1be1[_0xe24c('0xa')]('VoiceCallReport',attributes,{'tableName':_0xe24c('0xb'),'paranoid':![],'indexes':[{'fields':[_0xe24c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6611=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','VoiceCallReport','report_call'];(function(_0x19e6dd,_0x1f7da6){var _0x494352=function(_0x1a6c35){while(--_0x1a6c35){_0x19e6dd['push'](_0x19e6dd['shift']());}};_0x494352(++_0x1f7da6);}(_0x6611,0xdd));var _0x1661=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6611[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x1661('0x0'));var logger=require(_0x1661('0x1'))(_0x1661('0x2'));var moment=require(_0x1661('0x3'));var BPromise=require(_0x1661('0x4'));var rp=require(_0x1661('0x5'));var fs=require('fs');var path=require(_0x1661('0x6'));var rimraf=require(_0x1661('0x7'));var config=require(_0x1661('0x8'));var attributes=require(_0x1661('0x9'));module[_0x1661('0xa')]=function(_0x1e5dab,_0x58781d){return _0x1e5dab['define'](_0x1661('0xb'),attributes,{'tableName':_0x1661('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index d2eb44d..9a84aaf 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 _0x618c=['limit','map','model','include','CreateVoiceCallReport','create','body','update','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes'];(function(_0x104d11,_0x7a2a97){var _0x311c54=function(_0x5a8b7a){while(--_0x5a8b7a){_0x104d11['push'](_0x104d11['shift']());}};_0x311c54(++_0x7a2a97);}(_0x618c,0x18f));var _0xc618=function(_0x23e2c5,_0x2091aa){_0x23e2c5=_0x23e2c5-0x0;var _0x4e74ce=_0x618c[_0x23e2c5];return _0x4e74ce;};'use strict';var _=require(_0xc618('0x0'));var util=require(_0xc618('0x1'));var moment=require(_0xc618('0x2'));var BPromise=require(_0xc618('0x3'));var rs=require(_0xc618('0x4'));var fs=require('fs');var Redis=require(_0xc618('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc618('0x6'));var logger=require(_0xc618('0x7'))(_0xc618('0x8'));var config=require(_0xc618('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc618('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b5bce,_0x49a5e4,_0x4151d2){return new BPromise(function(_0x21dc4b,_0x1daa62){return client[_0xc618('0xb')](_0x3b5bce,_0x4151d2)[_0xc618('0xc')](function(_0x3b08c7){logger[_0xc618('0xd')](_0xc618('0xe'),_0x49a5e4,'request\x20sent');logger[_0xc618('0xf')](_0xc618('0x10'),_0x49a5e4,'request\x20sent',JSON[_0xc618('0x11')](_0x3b08c7));if(_0x3b08c7['error']){if(_0x3b08c7[_0xc618('0x12')][_0xc618('0x13')]===0x1f4){logger[_0xc618('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x49a5e4,_0x3b08c7[_0xc618('0x12')][_0xc618('0x14')]);return _0x1daa62(_0x3b08c7[_0xc618('0x12')][_0xc618('0x14')]);}logger[_0xc618('0x12')](_0xc618('0xe'),_0x49a5e4,_0x3b08c7[_0xc618('0x12')][_0xc618('0x14')]);return _0x21dc4b(_0x3b08c7['error'][_0xc618('0x14')]);}else{logger[_0xc618('0xd')](_0xc618('0xe'),_0x49a5e4,_0xc618('0x15'));_0x21dc4b(_0x3b08c7['result']['message']);}})[_0xc618('0x16')](function(_0xd8008b){logger[_0xc618('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x49a5e4,_0xd8008b);_0x1daa62(_0xd8008b);});});}exports[_0xc618('0x17')]=function(_0x13901b){var _0x23b796=this;return new Promise(function(_0x41cf82,_0x5ec9b5){return db[_0xc618('0x18')][_0xc618('0x19')]({'raw':_0x13901b['options']?_0x13901b[_0xc618('0x1a')][_0xc618('0x1b')]===undefined?!![]:![]:!![],'where':_0x13901b['options']?_0x13901b[_0xc618('0x1a')][_0xc618('0x1c')]||null:null,'attributes':_0x13901b[_0xc618('0x1a')]?_0x13901b[_0xc618('0x1a')][_0xc618('0x1d')]||null:null,'limit':_0x13901b[_0xc618('0x1a')]?_0x13901b['options'][_0xc618('0x1e')]||null:null,'include':_0x13901b[_0xc618('0x1a')]?_0x13901b[_0xc618('0x1a')]['include']?_[_0xc618('0x1f')](_0x13901b[_0xc618('0x1a')]['include'],function(_0x5a55a3){return{'model':db[_0x5a55a3[_0xc618('0x20')]],'as':_0x5a55a3['as'],'attributes':_0x5a55a3[_0xc618('0x1d')],'include':_0x5a55a3[_0xc618('0x21')]?_['map'](_0x5a55a3[_0xc618('0x21')],function(_0x5f5a10){return{'model':db[_0x5f5a10[_0xc618('0x20')]],'as':_0x5f5a10['as'],'attributes':_0x5f5a10[_0xc618('0x1d')],'include':_0x5f5a10[_0xc618('0x21')]?_[_0xc618('0x1f')](_0x5f5a10['include'],function(_0x3b0abd){return{'model':db[_0x3b0abd[_0xc618('0x20')]],'as':_0x3b0abd['as'],'attributes':_0x3b0abd['attributes']};}):[]};}):[]};}):[]:[]})[_0xc618('0xc')](function(_0x14b7c8){logger[_0xc618('0xd')](_0xc618('0x17'),_0x13901b);logger['debug'](_0xc618('0x17'),_0x13901b,JSON[_0xc618('0x11')](_0x14b7c8));_0x41cf82(_0x14b7c8);})[_0xc618('0x16')](function(_0x3b5f53){logger[_0xc618('0x12')](_0xc618('0x17'),_0x3b5f53[_0xc618('0x14')],_0x13901b);_0x5ec9b5(_0x23b796[_0xc618('0x12')](0x1f4,_0x3b5f53[_0xc618('0x14')]));});});};exports[_0xc618('0x22')]=function(_0x2fea64){var _0x2c4fca=this;return new Promise(function(_0x319d31,_0x4d4ec4){return db[_0xc618('0x18')][_0xc618('0x23')](_0x2fea64[_0xc618('0x24')],{'raw':_0x2fea64['options']?_0x2fea64['options']['raw']===undefined?!![]:![]:!![]})[_0xc618('0xc')](function(_0x14eccd){logger[_0xc618('0xd')](_0xc618('0x22'),_0x2fea64);logger[_0xc618('0xf')](_0xc618('0x22'),_0x2fea64,JSON[_0xc618('0x11')](_0x14eccd));_0x319d31(_0x14eccd);})['catch'](function(_0x432286){logger[_0xc618('0x12')](_0xc618('0x22'),_0x432286['message'],_0x2fea64);_0x4d4ec4(_0x2c4fca['error'](0x1f4,_0x432286[_0xc618('0x14')]));});});};exports['UpdateVoiceCallReport']=function(_0x3eab01){var _0x4fb80d=this;return new Promise(function(_0x26c9bd,_0x3519f0){return db[_0xc618('0x18')][_0xc618('0x25')](_0x3eab01[_0xc618('0x24')],{'raw':_0x3eab01[_0xc618('0x1a')]?_0x3eab01[_0xc618('0x1a')][_0xc618('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3eab01['options']?_0x3eab01[_0xc618('0x1a')][_0xc618('0x1c')]||null:null,'attributes':_0x3eab01[_0xc618('0x1a')]?_0x3eab01[_0xc618('0x1a')][_0xc618('0x1d')]||null:null,'limit':_0x3eab01[_0xc618('0x1a')]?_0x3eab01[_0xc618('0x1a')]['limit']||null:null})['then'](function(_0x335ecb){logger[_0xc618('0xd')](_0xc618('0x26'),_0x3eab01);logger[_0xc618('0xf')](_0xc618('0x26'),_0x3eab01,JSON[_0xc618('0x11')](_0x335ecb));_0x26c9bd(_0x335ecb);})[_0xc618('0x16')](function(_0x345147){logger['error'](_0xc618('0x26'),_0x345147[_0xc618('0x14')],_0x3eab01);_0x3519f0(_0x4fb80d[_0xc618('0x12')](0x1f4,_0x345147[_0xc618('0x14')]));});});}; \ No newline at end of file +var _0xbc5c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','options','raw','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','VoiceCallReport','create','then','stringify','UpdateVoiceCallReport','body','where','bluebird'];(function(_0x41e3ae,_0x1fa1fc){var _0x31c1d2=function(_0x44eda4){while(--_0x44eda4){_0x41e3ae['push'](_0x41e3ae['shift']());}};_0x31c1d2(++_0x1fa1fc);}(_0xbc5c,0x93));var _0xcbc5=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xbc5c[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xcbc5('0x0'));var rs=require(_0xcbc5('0x1'));var fs=require('fs');var Redis=require(_0xcbc5('0x2'));var db=require(_0xcbc5('0x3'))['db'];var utils=require(_0xcbc5('0x4'));var logger=require(_0xcbc5('0x5'))(_0xcbc5('0x6'));var config=require(_0xcbc5('0x7'));var jayson=require(_0xcbc5('0x8'));var client=jayson[_0xcbc5('0x9')][_0xcbc5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28438c,_0x255197,_0x2b0c0f){return new BPromise(function(_0x38c695,_0x26ee90){return client[_0xcbc5('0xb')](_0x28438c,_0x2b0c0f)['then'](function(_0x43c997){logger[_0xcbc5('0xc')](_0xcbc5('0xd'),_0x255197,_0xcbc5('0xe'));logger[_0xcbc5('0xf')](_0xcbc5('0x10'),_0x255197,'request\x20sent',JSON['stringify'](_0x43c997));if(_0x43c997['error']){if(_0x43c997[_0xcbc5('0x11')]['code']===0x1f4){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x255197,_0x43c997[_0xcbc5('0x11')]['message']);return _0x26ee90(_0x43c997[_0xcbc5('0x11')]['message']);}logger[_0xcbc5('0x11')](_0xcbc5('0xd'),_0x255197,_0x43c997['error'][_0xcbc5('0x12')]);return _0x38c695(_0x43c997[_0xcbc5('0x11')][_0xcbc5('0x12')]);}else{logger[_0xcbc5('0xc')](_0xcbc5('0xd'),_0x255197,_0xcbc5('0xe'));_0x38c695(_0x43c997[_0xcbc5('0x13')][_0xcbc5('0x12')]);}})[_0xcbc5('0x14')](function(_0x13cbdc){logger[_0xcbc5('0x11')](_0xcbc5('0xd'),_0x255197,_0x13cbdc);_0x26ee90(_0x13cbdc);});});}exports['GetVoiceCallReport']=function(_0x552e6c){var _0x35f0ae=this;return new Promise(function(_0x2db21a,_0x5894b9){return db['VoiceCallReport']['findAll']({'raw':_0x552e6c[_0xcbc5('0x15')]?_0x552e6c[_0xcbc5('0x15')][_0xcbc5('0x16')]===undefined?!![]:![]:!![],'where':_0x552e6c[_0xcbc5('0x15')]?_0x552e6c[_0xcbc5('0x15')]['where']||null:null,'attributes':_0x552e6c[_0xcbc5('0x15')]?_0x552e6c[_0xcbc5('0x15')][_0xcbc5('0x17')]||null:null,'limit':_0x552e6c[_0xcbc5('0x15')]?_0x552e6c['options'][_0xcbc5('0x18')]||null:null,'include':_0x552e6c[_0xcbc5('0x15')]?_0x552e6c[_0xcbc5('0x15')][_0xcbc5('0x19')]?_[_0xcbc5('0x1a')](_0x552e6c['options'][_0xcbc5('0x19')],function(_0x3de7ac){return{'model':db[_0x3de7ac['model']],'as':_0x3de7ac['as'],'attributes':_0x3de7ac['attributes'],'include':_0x3de7ac[_0xcbc5('0x19')]?_[_0xcbc5('0x1a')](_0x3de7ac[_0xcbc5('0x19')],function(_0x58ed1e){return{'model':db[_0x58ed1e[_0xcbc5('0x1b')]],'as':_0x58ed1e['as'],'attributes':_0x58ed1e[_0xcbc5('0x17')],'include':_0x58ed1e[_0xcbc5('0x19')]?_['map'](_0x58ed1e[_0xcbc5('0x19')],function(_0x341576){return{'model':db[_0x341576[_0xcbc5('0x1b')]],'as':_0x341576['as'],'attributes':_0x341576[_0xcbc5('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x116780){logger[_0xcbc5('0xc')](_0xcbc5('0x1c'),_0x552e6c);logger['debug']('GetVoiceCallReport',_0x552e6c,JSON['stringify'](_0x116780));_0x2db21a(_0x116780);})[_0xcbc5('0x14')](function(_0x15f8d2){logger[_0xcbc5('0x11')](_0xcbc5('0x1c'),_0x15f8d2[_0xcbc5('0x12')],_0x552e6c);_0x5894b9(_0x35f0ae['error'](0x1f4,_0x15f8d2[_0xcbc5('0x12')]));});});};exports[_0xcbc5('0x1d')]=function(_0x4c9dcb){var _0x501c8d=this;return new Promise(function(_0x2400d0,_0x3e4eea){return db[_0xcbc5('0x1e')][_0xcbc5('0x1f')](_0x4c9dcb['body'],{'raw':_0x4c9dcb['options']?_0x4c9dcb['options']['raw']===undefined?!![]:![]:!![]})[_0xcbc5('0x20')](function(_0x5964dc){logger[_0xcbc5('0xc')](_0xcbc5('0x1d'),_0x4c9dcb);logger[_0xcbc5('0xf')]('CreateVoiceCallReport',_0x4c9dcb,JSON[_0xcbc5('0x21')](_0x5964dc));_0x2400d0(_0x5964dc);})[_0xcbc5('0x14')](function(_0xd5f646){logger[_0xcbc5('0x11')](_0xcbc5('0x1d'),_0xd5f646['message'],_0x4c9dcb);_0x3e4eea(_0x501c8d[_0xcbc5('0x11')](0x1f4,_0xd5f646['message']));});});};exports[_0xcbc5('0x22')]=function(_0xaa5e75){var _0x3a310a=this;return new Promise(function(_0x31a387,_0x236b62){return db[_0xcbc5('0x1e')]['update'](_0xaa5e75[_0xcbc5('0x23')],{'raw':_0xaa5e75[_0xcbc5('0x15')]?_0xaa5e75[_0xcbc5('0x15')][_0xcbc5('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xaa5e75[_0xcbc5('0x15')]?_0xaa5e75['options'][_0xcbc5('0x24')]||null:null,'attributes':_0xaa5e75[_0xcbc5('0x15')]?_0xaa5e75[_0xcbc5('0x15')][_0xcbc5('0x17')]||null:null,'limit':_0xaa5e75[_0xcbc5('0x15')]?_0xaa5e75[_0xcbc5('0x15')][_0xcbc5('0x18')]||null:null})[_0xcbc5('0x20')](function(_0x189227){logger[_0xcbc5('0xc')](_0xcbc5('0x22'),_0xaa5e75);logger[_0xcbc5('0xf')](_0xcbc5('0x22'),_0xaa5e75,JSON[_0xcbc5('0x21')](_0x189227));_0x31a387(_0x189227);})[_0xcbc5('0x14')](function(_0x3d7b6b){logger[_0xcbc5('0x11')](_0xcbc5('0x22'),_0x3d7b6b[_0xcbc5('0x12')],_0xaa5e75);_0x236b62(_0x3a310a['error'](0x1f4,_0x3d7b6b['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 366d57a..1a68d4b 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 _0xc1a8=['../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5e6ea3,_0x9addd2){var _0x4048b5=function(_0x9092e4){while(--_0x9092e4){_0x5e6ea3['push'](_0x5e6ea3['shift']());}};_0x4048b5(++_0x9addd2);}(_0xc1a8,0xcb));var _0x8c1a=function(_0x45f4e9,_0x5246fd){_0x45f4e9=_0x45f4e9-0x0;var _0x559d8f=_0xc1a8[_0x45f4e9];return _0x559d8f;};'use strict';var multer=require(_0x8c1a('0x0'));var util=require(_0x8c1a('0x1'));var path=require(_0x8c1a('0x2'));var timeout=require('connect-timeout');var express=require(_0x8c1a('0x3'));var router=express[_0x8c1a('0x4')]();var fs_extra=require(_0x8c1a('0x5'));var auth=require(_0x8c1a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8c1a('0x7'));var controller=require(_0x8c1a('0x8'));router[_0x8c1a('0x9')]('/',auth[_0x8c1a('0xa')](),controller[_0x8c1a('0xb')]);router['get'](_0x8c1a('0xc'),auth[_0x8c1a('0xa')](),controller[_0x8c1a('0xd')]);router[_0x8c1a('0xe')]('/',auth[_0x8c1a('0xa')](),controller[_0x8c1a('0xf')]);router[_0x8c1a('0x10')](_0x8c1a('0xc'),auth[_0x8c1a('0xa')](),controller[_0x8c1a('0x11')]);router[_0x8c1a('0x12')](_0x8c1a('0xc'),auth[_0x8c1a('0xa')](),controller[_0x8c1a('0x13')]);module[_0x8c1a('0x14')]=router; \ No newline at end of file +var _0xa35f=['exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete'];(function(_0x174c66,_0x119100){var _0x447e3a=function(_0xbe3feb){while(--_0xbe3feb){_0x174c66['push'](_0x174c66['shift']());}};_0x447e3a(++_0x119100);}(_0xa35f,0xa3));var _0xfa35=function(_0x562faa,_0x23adc7){_0x562faa=_0x562faa-0x0;var _0xc70f59=_0xa35f[_0x562faa];return _0xc70f59;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfa35('0x0'));var timeout=require('connect-timeout');var express=require(_0xfa35('0x1'));var router=express[_0xfa35('0x2')]();var fs_extra=require(_0xfa35('0x3'));var auth=require(_0xfa35('0x4'));var interaction=require(_0xfa35('0x5'));var config=require(_0xfa35('0x6'));var controller=require(_0xfa35('0x7'));router[_0xfa35('0x8')]('/',auth[_0xfa35('0x9')](),controller[_0xfa35('0xa')]);router[_0xfa35('0x8')](_0xfa35('0xb'),auth[_0xfa35('0x9')](),controller['show']);router[_0xfa35('0xc')]('/',auth[_0xfa35('0x9')](),controller[_0xfa35('0xd')]);router[_0xfa35('0xe')](_0xfa35('0xb'),auth[_0xfa35('0x9')](),controller[_0xfa35('0xf')]);router[_0xfa35('0x10')](_0xfa35('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xfa35('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 157016b..5bc3a47 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 _0xa368=['BOOLEAN','exports','STRING','name','options','getDataValue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa368,0x6d));var _0x8a36=function(_0x29231e,_0x1a347f){_0x29231e=_0x29231e-0x0;var _0x605515=_0xa368[_0x29231e];return _0x605515;};'use strict';var Sequelize=require('sequelize');module[_0x8a36('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x8a36('0x1')],'unique':_0x8a36('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x8a36('0x1')],'set':function(_0x5ecb61){this['setDataValue'](_0x8a36('0x3'),_0x5ecb61?_0x5ecb61['join'](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0x8a36('0x4')](_0x8a36('0x3'))['split'](''):[];}},'auth':{'type':Sequelize[_0x8a36('0x5')],'defaultValue':![]},'password':{'type':Sequelize[_0x8a36('0x1')]},'record':{'type':Sequelize[_0x8a36('0x5')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x8a36('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd6e0=['name','setDataValue','options','getDataValue','BOOLEAN','sequelize','exports','STRING'];(function(_0x1efb37,_0x36569f){var _0x154cb0=function(_0x575ea4){while(--_0x575ea4){_0x1efb37['push'](_0x1efb37['shift']());}};_0x154cb0(++_0x36569f);}(_0xd6e0,0x19d));var _0x0d6e=function(_0x34232c,_0x18e61d){_0x34232c=_0x34232c-0x0;var _0x4d4f4e=_0xd6e0[_0x34232c];return _0x4d4f4e;};'use strict';var Sequelize=require(_0x0d6e('0x0'));module[_0x0d6e('0x1')]={'name':{'type':Sequelize[_0x0d6e('0x2')]},'prefix':{'type':Sequelize[_0x0d6e('0x2')],'unique':_0x0d6e('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x0d6e('0x2')],'set':function(_0x53d638){this[_0x0d6e('0x4')](_0x0d6e('0x5'),_0x53d638?_0x53d638['join'](''):[]);},'get':function(){return this[_0x0d6e('0x6')](_0x0d6e('0x5'))?this[_0x0d6e('0x6')](_0x0d6e('0x5'))['split'](''):[];}},'auth':{'type':Sequelize[_0x0d6e('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x0d6e('0x2')]},'record':{'type':Sequelize[_0x0d6e('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0d6e('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 82721bf..28e8c6d 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 _0x8ba2=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','reject','save','update','then','get','ChanSpies','UserProfileResource','error','stack','name','send','index','map','VoiceChanSpy','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x7032f1,_0x8c3678){var _0x244031=function(_0x2554b4){while(--_0x2554b4){_0x7032f1['push'](_0x7032f1['shift']());}};_0x244031(++_0x8c3678);}(_0x8ba2,0x13f));var _0x28ba=function(_0x46dc7b,_0x44e18a){_0x46dc7b=_0x46dc7b-0x0;var _0x11b971=_0x8ba2[_0x46dc7b];return _0x11b971;};'use strict';var emlformat=require(_0x28ba('0x0'));var rimraf=require(_0x28ba('0x1'));var zipdir=require(_0x28ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28ba('0x3'));var moment=require(_0x28ba('0x4'));var BPromise=require(_0x28ba('0x5'));var Mustache=require('mustache');var util=require(_0x28ba('0x6'));var path=require(_0x28ba('0x7'));var sox=require(_0x28ba('0x8'));var csv=require(_0x28ba('0x9'));var ejs=require(_0x28ba('0xa'));var fs=require('fs');var fs_extra=require(_0x28ba('0xb'));var _=require('lodash');var squel=require(_0x28ba('0xc'));var crypto=require(_0x28ba('0xd'));var jsforce=require(_0x28ba('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x28ba('0x9'));var querystring=require(_0x28ba('0xf'));var Papa=require(_0x28ba('0x10'));var Redis=require(_0x28ba('0x11'));var authService=require(_0x28ba('0x12'));var qs=require(_0x28ba('0x13'));var as=require(_0x28ba('0x14'));var hardwareService=require(_0x28ba('0x15'));var logger=require(_0x28ba('0x16'))(_0x28ba('0x17'));var utils=require('../../config/utils');var config=require(_0x28ba('0x18'));var licenseUtil=require(_0x28ba('0x19'));var db=require(_0x28ba('0x1a'))['db'];function respondWithStatusCode(_0x299f63,_0x1204af){_0x1204af=_0x1204af||0xcc;return function(_0x3a9644){if(_0x3a9644){return _0x299f63[_0x28ba('0x1b')](_0x1204af);}return _0x299f63['status'](_0x1204af)[_0x28ba('0x1c')]();};}function respondWithResult(_0x3cf923,_0x4ebcd6){_0x4ebcd6=_0x4ebcd6||0xc8;return function(_0x29cd51){if(_0x29cd51){return _0x3cf923[_0x28ba('0x1d')](_0x4ebcd6)[_0x28ba('0x1e')](_0x29cd51);}};}function respondWithFilteredResult(_0x1c5998,_0x563797){return function(_0x24b3f3){if(_0x24b3f3){var _0x38df4f=typeof _0x563797[_0x28ba('0x1f')]===_0x28ba('0x20')&&typeof _0x563797[_0x28ba('0x21')]==='undefined';var _0x571c92=_0x24b3f3[_0x28ba('0x22')];var _0x182824=_0x38df4f?0x0:_0x563797[_0x28ba('0x1f')];var _0x2cf1cf=_0x38df4f?_0x24b3f3[_0x28ba('0x22')]:_0x563797[_0x28ba('0x1f')]+_0x563797[_0x28ba('0x21')];var _0x31a45b;if(_0x2cf1cf>=_0x571c92){_0x2cf1cf=_0x571c92;_0x31a45b=0xc8;}else{_0x31a45b=0xce;}_0x1c5998[_0x28ba('0x1d')](_0x31a45b);return _0x1c5998['set']('Content-Range',_0x182824+'-'+_0x2cf1cf+'/'+_0x571c92)[_0x28ba('0x1e')](_0x24b3f3);}return null;};}function patchUpdates(_0x4352a4){return function(_0x5d3d33){try{jsonpatch['apply'](_0x5d3d33,_0x4352a4,!![]);}catch(_0xf9e0f4){return BPromise[_0x28ba('0x23')](_0xf9e0f4);}return _0x5d3d33[_0x28ba('0x24')]();};}function saveUpdates(_0x17b1f4,_0x425732){return function(_0x4ff05c){if(_0x4ff05c){return _0x4ff05c[_0x28ba('0x25')](_0x17b1f4)[_0x28ba('0x26')](function(_0x1684af){return _0x1684af;});}return null;};}function removeEntity(_0x3eec5d,_0x27a579){return function(_0x256892){if(_0x256892){return _0x256892['destroy']()[_0x28ba('0x26')](function(){var _0x46969a=_0x256892[_0x28ba('0x27')]({'plain':!![]});var _0x1d3fd1=_0x28ba('0x28');return db[_0x28ba('0x29')]['destroy']({'where':{'type':_0x1d3fd1,'resourceId':_0x46969a['id']}})[_0x28ba('0x26')](function(){return _0x256892;});})[_0x28ba('0x26')](function(){_0x3eec5d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36dc29,_0x3e1ce7){return function(_0x5b9237){if(!_0x5b9237){_0x36dc29['sendStatus'](0x194);}return _0x5b9237;};}function handleError(_0x4267b4,_0x3638c5){_0x3638c5=_0x3638c5||0x1f4;return function(_0x39cd83){logger[_0x28ba('0x2a')](_0x39cd83[_0x28ba('0x2b')]);if(_0x39cd83[_0x28ba('0x2c')]){delete _0x39cd83[_0x28ba('0x2c')];}_0x4267b4[_0x28ba('0x1d')](_0x3638c5)[_0x28ba('0x2d')](_0x39cd83);};}exports[_0x28ba('0x2e')]=function(_0x296b66,_0x32ab4b){var _0x27737d={},_0x2c712e={},_0x5f0202={'count':0x0,'rows':[]};var _0x13dfd4=_[_0x28ba('0x2f')](db[_0x28ba('0x30')]['rawAttributes'],function(_0x2c32f3){return{'name':_0x2c32f3[_0x28ba('0x31')],'type':_0x2c32f3[_0x28ba('0x32')]['key']};});_0x2c712e[_0x28ba('0x33')]=_[_0x28ba('0x2f')](_0x13dfd4,_0x28ba('0x2c'));_0x2c712e[_0x28ba('0x34')]=_[_0x28ba('0x35')](_0x296b66[_0x28ba('0x34')]);_0x2c712e[_0x28ba('0x36')]=_[_0x28ba('0x37')](_0x2c712e[_0x28ba('0x33')],_0x2c712e[_0x28ba('0x34')]);_0x27737d['attributes']=_[_0x28ba('0x37')](_0x2c712e[_0x28ba('0x33')],qs[_0x28ba('0x38')](_0x296b66['query'][_0x28ba('0x38')]));_0x27737d[_0x28ba('0x39')]=_0x27737d[_0x28ba('0x39')][_0x28ba('0x3a')]?_0x27737d[_0x28ba('0x39')]:_0x2c712e[_0x28ba('0x33')];if(!_0x296b66[_0x28ba('0x34')][_0x28ba('0x3b')](_0x28ba('0x3c'))){_0x27737d[_0x28ba('0x21')]=qs[_0x28ba('0x21')](_0x296b66[_0x28ba('0x34')]['limit']);_0x27737d['offset']=qs['offset'](_0x296b66[_0x28ba('0x34')][_0x28ba('0x1f')]);}_0x27737d['order']=qs[_0x28ba('0x3d')](_0x296b66[_0x28ba('0x34')]['sort']);_0x27737d['where']=qs[_0x28ba('0x36')](_[_0x28ba('0x3e')](_0x296b66['query'],_0x2c712e['filters']),_0x13dfd4);if(_0x296b66[_0x28ba('0x34')][_0x28ba('0x3f')]){_0x27737d[_0x28ba('0x40')]=_[_0x28ba('0x41')](_0x27737d[_0x28ba('0x40')],{'$or':_[_0x28ba('0x2f')](_0x13dfd4,function(_0x241a4a){if(_0x241a4a[_0x28ba('0x32')]!==_0x28ba('0x42')){var _0x5b0174={};_0x5b0174[_0x241a4a['name']]={'$like':'%'+_0x296b66['query'][_0x28ba('0x3f')]+'%'};return _0x5b0174;}})});}_0x27737d=_[_0x28ba('0x41')]({},_0x27737d,_0x296b66[_0x28ba('0x43')]);var _0x2f5ce4={'where':_0x27737d[_0x28ba('0x40')]};return db['VoiceChanSpy']['count'](_0x2f5ce4)['then'](function(_0x424f73){_0x5f0202[_0x28ba('0x22')]=_0x424f73;if(_0x296b66[_0x28ba('0x34')][_0x28ba('0x44')]){_0x27737d[_0x28ba('0x45')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x28ba('0x46')](_0x27737d);})[_0x28ba('0x26')](function(_0x364b7a){_0x5f0202[_0x28ba('0x47')]=_0x364b7a;return _0x5f0202;})[_0x28ba('0x26')](respondWithFilteredResult(_0x32ab4b,_0x27737d))[_0x28ba('0x48')](handleError(_0x32ab4b,null));};exports[_0x28ba('0x49')]=function(_0x1c12f4,_0x213497){var _0x4c550c={'raw':![],'where':{'id':_0x1c12f4[_0x28ba('0x4a')]['id']}},_0x53f882={};_0x53f882[_0x28ba('0x33')]=_[_0x28ba('0x35')](db[_0x28ba('0x30')][_0x28ba('0x4b')]);_0x53f882['query']=_['keys'](_0x1c12f4['query']);_0x53f882['filters']=_[_0x28ba('0x37')](_0x53f882[_0x28ba('0x33')],_0x53f882[_0x28ba('0x34')]);_0x4c550c[_0x28ba('0x39')]=_[_0x28ba('0x37')](_0x53f882[_0x28ba('0x33')],qs['fields'](_0x1c12f4[_0x28ba('0x34')][_0x28ba('0x38')]));_0x4c550c['attributes']=_0x4c550c['attributes'][_0x28ba('0x3a')]?_0x4c550c['attributes']:_0x53f882[_0x28ba('0x33')];if(_0x1c12f4[_0x28ba('0x34')]['includeAll']){_0x4c550c[_0x28ba('0x45')]=[{'all':!![]}];}_0x4c550c=_['merge']({},_0x4c550c,_0x1c12f4[_0x28ba('0x43')]);return db['VoiceChanSpy'][_0x28ba('0x4c')](_0x4c550c)[_0x28ba('0x26')](handleEntityNotFound(_0x213497,null))[_0x28ba('0x26')](respondWithResult(_0x213497,null))[_0x28ba('0x48')](handleError(_0x213497,null));};exports[_0x28ba('0x4d')]=function(_0x4047c1,_0x5ccfab){return db[_0x28ba('0x30')]['create'](_0x4047c1['body'],{})[_0x28ba('0x26')](function(_0xd327ac){var _0x21931b=_0x4047c1[_0x28ba('0x4e')]['get']({'plain':!![]});if(!_0x21931b)throw new Error(_0x28ba('0x4f'));if(_0x21931b['role']==='user'){var _0x38bf5b=_0xd327ac[_0x28ba('0x27')]({'plain':!![]});var _0xf0938f=_0x28ba('0x28');return db[_0x28ba('0x50')][_0x28ba('0x4c')]({'where':{'name':_0xf0938f,'userProfileId':_0x21931b[_0x28ba('0x51')]},'raw':!![]})[_0x28ba('0x26')](function(_0x5aac05){if(_0x5aac05&&_0x5aac05[_0x28ba('0x52')]===0x0){return db[_0x28ba('0x29')][_0x28ba('0x4d')]({'name':_0x38bf5b[_0x28ba('0x2c')],'resourceId':_0x38bf5b['id'],'type':_0x5aac05[_0x28ba('0x2c')],'sectionId':_0x5aac05['id']},{})['then'](function(){return _0xd327ac;});}else{return _0xd327ac;}})[_0x28ba('0x48')](function(_0x2ec307){logger[_0x28ba('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ec307);throw _0x2ec307;});}return _0xd327ac;})[_0x28ba('0x26')](respondWithResult(_0x5ccfab,0xc9))[_0x28ba('0x48')](handleError(_0x5ccfab,null));};exports[_0x28ba('0x25')]=function(_0x4f5a05,_0x23e1fc){if(_0x4f5a05['body']['id']){delete _0x4f5a05[_0x28ba('0x53')]['id'];}return db[_0x28ba('0x30')]['find']({'where':{'id':_0x4f5a05[_0x28ba('0x4a')]['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x23e1fc,null))[_0x28ba('0x26')](saveUpdates(_0x4f5a05[_0x28ba('0x53')],null))[_0x28ba('0x26')](respondWithResult(_0x23e1fc,null))[_0x28ba('0x48')](handleError(_0x23e1fc,null));};exports[_0x28ba('0x54')]=function(_0x2131b8,_0x24bdd6){return db[_0x28ba('0x30')][_0x28ba('0x4c')]({'where':{'id':_0x2131b8['params']['id']}})[_0x28ba('0x26')](handleEntityNotFound(_0x24bdd6,null))[_0x28ba('0x26')](removeEntity(_0x24bdd6,null))[_0x28ba('0x48')](handleError(_0x24bdd6,null));}; \ No newline at end of file +var _0xe205=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','ChanSpies','UserProfileResource','destroy','error','stack','name','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format'];(function(_0x2fe959,_0x351d77){var _0x2f6ace=function(_0x4ede54){while(--_0x4ede54){_0x2fe959['push'](_0x2fe959['shift']());}};_0x2f6ace(++_0x351d77);}(_0xe205,0xa7));var _0x5e20=function(_0x20bcea,_0x3bd892){_0x20bcea=_0x20bcea-0x0;var _0x5eaaca=_0xe205[_0x20bcea];return _0x5eaaca;};'use strict';var emlformat=require(_0x5e20('0x0'));var rimraf=require(_0x5e20('0x1'));var zipdir=require(_0x5e20('0x2'));var jsonpatch=require(_0x5e20('0x3'));var rp=require(_0x5e20('0x4'));var moment=require(_0x5e20('0x5'));var BPromise=require(_0x5e20('0x6'));var Mustache=require(_0x5e20('0x7'));var util=require(_0x5e20('0x8'));var path=require('path');var sox=require(_0x5e20('0x9'));var csv=require(_0x5e20('0xa'));var ejs=require(_0x5e20('0xb'));var fs=require('fs');var fs_extra=require(_0x5e20('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e20('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5e20('0xa'));var querystring=require(_0x5e20('0xe'));var Papa=require('papaparse');var Redis=require(_0x5e20('0xf'));var authService=require(_0x5e20('0x10'));var qs=require(_0x5e20('0x11'));var as=require(_0x5e20('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e20('0x13'))(_0x5e20('0x14'));var utils=require(_0x5e20('0x15'));var config=require(_0x5e20('0x16'));var licenseUtil=require(_0x5e20('0x17'));var db=require(_0x5e20('0x18'))['db'];function respondWithStatusCode(_0x54deee,_0x19eacf){_0x19eacf=_0x19eacf||0xcc;return function(_0x29b7a2){if(_0x29b7a2){return _0x54deee[_0x5e20('0x19')](_0x19eacf);}return _0x54deee['status'](_0x19eacf)[_0x5e20('0x1a')]();};}function respondWithResult(_0x5d827e,_0x1f47f3){_0x1f47f3=_0x1f47f3||0xc8;return function(_0x5ba833){if(_0x5ba833){return _0x5d827e[_0x5e20('0x1b')](_0x1f47f3)[_0x5e20('0x1c')](_0x5ba833);}};}function respondWithFilteredResult(_0x275026,_0x148ada){return function(_0x294df8){if(_0x294df8){var _0x542b3c=typeof _0x148ada[_0x5e20('0x1d')]===_0x5e20('0x1e')&&typeof _0x148ada[_0x5e20('0x1f')]===_0x5e20('0x1e');var _0x2f194b=_0x294df8[_0x5e20('0x20')];var _0x1cc706=_0x542b3c?0x0:_0x148ada[_0x5e20('0x1d')];var _0x4d3e4a=_0x542b3c?_0x294df8[_0x5e20('0x20')]:_0x148ada[_0x5e20('0x1d')]+_0x148ada['limit'];var _0x295eb3;if(_0x4d3e4a>=_0x2f194b){_0x4d3e4a=_0x2f194b;_0x295eb3=0xc8;}else{_0x295eb3=0xce;}_0x275026[_0x5e20('0x1b')](_0x295eb3);return _0x275026[_0x5e20('0x21')](_0x5e20('0x22'),_0x1cc706+'-'+_0x4d3e4a+'/'+_0x2f194b)['json'](_0x294df8);}return null;};}function patchUpdates(_0x2954fc){return function(_0x50f222){try{jsonpatch['apply'](_0x50f222,_0x2954fc,!![]);}catch(_0x57c7c5){return BPromise['reject'](_0x57c7c5);}return _0x50f222[_0x5e20('0x23')]();};}function saveUpdates(_0x5cca90,_0x3d89e4){return function(_0x29b111){if(_0x29b111){return _0x29b111[_0x5e20('0x24')](_0x5cca90)[_0x5e20('0x25')](function(_0x3ef7fa){return _0x3ef7fa;});}return null;};}function removeEntity(_0x2d4614,_0x4c5732){return function(_0x15705f){if(_0x15705f){return _0x15705f['destroy']()['then'](function(){var _0x33993a=_0x15705f[_0x5e20('0x26')]({'plain':!![]});var _0x2bae08=_0x5e20('0x27');return db[_0x5e20('0x28')][_0x5e20('0x29')]({'where':{'type':_0x2bae08,'resourceId':_0x33993a['id']}})[_0x5e20('0x25')](function(){return _0x15705f;});})['then'](function(){_0x2d4614[_0x5e20('0x1b')](0xcc)[_0x5e20('0x1a')]();});}};}function handleEntityNotFound(_0x238758,_0x3032ef){return function(_0x4c799d){if(!_0x4c799d){_0x238758[_0x5e20('0x19')](0x194);}return _0x4c799d;};}function handleError(_0x2c5d80,_0x37f09a){_0x37f09a=_0x37f09a||0x1f4;return function(_0x222e7a){logger[_0x5e20('0x2a')](_0x222e7a[_0x5e20('0x2b')]);if(_0x222e7a['name']){delete _0x222e7a[_0x5e20('0x2c')];}_0x2c5d80[_0x5e20('0x1b')](_0x37f09a)['send'](_0x222e7a);};}exports[_0x5e20('0x2d')]=function(_0x21d1d8,_0x335f1e){var _0x4196a3={},_0x1548c8={},_0x395a27={'count':0x0,'rows':[]};var _0x4ff715=_[_0x5e20('0x2e')](db[_0x5e20('0x2f')][_0x5e20('0x30')],function(_0x5f2f1d){return{'name':_0x5f2f1d[_0x5e20('0x31')],'type':_0x5f2f1d[_0x5e20('0x32')][_0x5e20('0x33')]};});_0x1548c8[_0x5e20('0x34')]=_[_0x5e20('0x2e')](_0x4ff715,_0x5e20('0x2c'));_0x1548c8[_0x5e20('0x35')]=_['keys'](_0x21d1d8[_0x5e20('0x35')]);_0x1548c8[_0x5e20('0x36')]=_[_0x5e20('0x37')](_0x1548c8['model'],_0x1548c8[_0x5e20('0x35')]);_0x4196a3[_0x5e20('0x38')]=_[_0x5e20('0x37')](_0x1548c8[_0x5e20('0x34')],qs[_0x5e20('0x39')](_0x21d1d8[_0x5e20('0x35')][_0x5e20('0x39')]));_0x4196a3[_0x5e20('0x38')]=_0x4196a3[_0x5e20('0x38')][_0x5e20('0x3a')]?_0x4196a3[_0x5e20('0x38')]:_0x1548c8[_0x5e20('0x34')];if(!_0x21d1d8[_0x5e20('0x35')][_0x5e20('0x3b')]('nolimit')){_0x4196a3[_0x5e20('0x1f')]=qs['limit'](_0x21d1d8['query'][_0x5e20('0x1f')]);_0x4196a3[_0x5e20('0x1d')]=qs['offset'](_0x21d1d8[_0x5e20('0x35')][_0x5e20('0x1d')]);}_0x4196a3['order']=qs[_0x5e20('0x3c')](_0x21d1d8[_0x5e20('0x35')][_0x5e20('0x3c')]);_0x4196a3[_0x5e20('0x3d')]=qs[_0x5e20('0x36')](_[_0x5e20('0x3e')](_0x21d1d8[_0x5e20('0x35')],_0x1548c8[_0x5e20('0x36')]),_0x4ff715);if(_0x21d1d8[_0x5e20('0x35')][_0x5e20('0x3f')]){_0x4196a3[_0x5e20('0x3d')]=_[_0x5e20('0x40')](_0x4196a3[_0x5e20('0x3d')],{'$or':_[_0x5e20('0x2e')](_0x4ff715,function(_0x5ad136){if(_0x5ad136[_0x5e20('0x32')]!==_0x5e20('0x41')){var _0x17feb4={};_0x17feb4[_0x5ad136['name']]={'$like':'%'+_0x21d1d8[_0x5e20('0x35')][_0x5e20('0x3f')]+'%'};return _0x17feb4;}})});}_0x4196a3=_[_0x5e20('0x40')]({},_0x4196a3,_0x21d1d8[_0x5e20('0x42')]);var _0x39018d={'where':_0x4196a3['where']};return db[_0x5e20('0x2f')][_0x5e20('0x20')](_0x39018d)[_0x5e20('0x25')](function(_0x24c05f){_0x395a27[_0x5e20('0x20')]=_0x24c05f;if(_0x21d1d8[_0x5e20('0x35')]['includeAll']){_0x4196a3[_0x5e20('0x43')]=[{'all':!![]}];}return db[_0x5e20('0x2f')][_0x5e20('0x44')](_0x4196a3);})['then'](function(_0x2b031d){_0x395a27[_0x5e20('0x45')]=_0x2b031d;return _0x395a27;})[_0x5e20('0x25')](respondWithFilteredResult(_0x335f1e,_0x4196a3))[_0x5e20('0x46')](handleError(_0x335f1e,null));};exports[_0x5e20('0x47')]=function(_0x336d61,_0x113133){var _0x3edea7={'raw':![],'where':{'id':_0x336d61[_0x5e20('0x48')]['id']}},_0x5c9504={};_0x5c9504[_0x5e20('0x34')]=_[_0x5e20('0x49')](db['VoiceChanSpy'][_0x5e20('0x30')]);_0x5c9504['query']=_[_0x5e20('0x49')](_0x336d61[_0x5e20('0x35')]);_0x5c9504[_0x5e20('0x36')]=_[_0x5e20('0x37')](_0x5c9504[_0x5e20('0x34')],_0x5c9504['query']);_0x3edea7[_0x5e20('0x38')]=_['intersection'](_0x5c9504['model'],qs[_0x5e20('0x39')](_0x336d61[_0x5e20('0x35')][_0x5e20('0x39')]));_0x3edea7[_0x5e20('0x38')]=_0x3edea7[_0x5e20('0x38')][_0x5e20('0x3a')]?_0x3edea7[_0x5e20('0x38')]:_0x5c9504['model'];if(_0x336d61['query'][_0x5e20('0x4a')]){_0x3edea7[_0x5e20('0x43')]=[{'all':!![]}];}_0x3edea7=_['merge']({},_0x3edea7,_0x336d61[_0x5e20('0x42')]);return db[_0x5e20('0x2f')][_0x5e20('0x4b')](_0x3edea7)[_0x5e20('0x25')](handleEntityNotFound(_0x113133,null))[_0x5e20('0x25')](respondWithResult(_0x113133,null))['catch'](handleError(_0x113133,null));};exports[_0x5e20('0x4c')]=function(_0x245b52,_0x25491e){return db[_0x5e20('0x2f')][_0x5e20('0x4c')](_0x245b52[_0x5e20('0x4d')],{})[_0x5e20('0x25')](function(_0x4485bb){var _0x4fb004=_0x245b52['user']['get']({'plain':!![]});if(!_0x4fb004)throw new Error(_0x5e20('0x4e'));if(_0x4fb004[_0x5e20('0x4f')]==='user'){var _0x4392ca=_0x4485bb['get']({'plain':!![]});var _0x61a3f1='ChanSpies';return db[_0x5e20('0x50')]['find']({'where':{'name':_0x61a3f1,'userProfileId':_0x4fb004[_0x5e20('0x51')]},'raw':!![]})[_0x5e20('0x25')](function(_0x285d2e){if(_0x285d2e&&_0x285d2e[_0x5e20('0x52')]===0x0){return db[_0x5e20('0x28')][_0x5e20('0x4c')]({'name':_0x4392ca[_0x5e20('0x2c')],'resourceId':_0x4392ca['id'],'type':_0x285d2e[_0x5e20('0x2c')],'sectionId':_0x285d2e['id']},{})[_0x5e20('0x25')](function(){return _0x4485bb;});}else{return _0x4485bb;}})[_0x5e20('0x46')](function(_0x13b716){logger[_0x5e20('0x2a')](_0x5e20('0x53'),_0x13b716);throw _0x13b716;});}return _0x4485bb;})[_0x5e20('0x25')](respondWithResult(_0x25491e,0xc9))[_0x5e20('0x46')](handleError(_0x25491e,null));};exports[_0x5e20('0x24')]=function(_0x1619fa,_0x1ace56){if(_0x1619fa['body']['id']){delete _0x1619fa['body']['id'];}return db[_0x5e20('0x2f')]['find']({'where':{'id':_0x1619fa[_0x5e20('0x48')]['id']}})[_0x5e20('0x25')](handleEntityNotFound(_0x1ace56,null))[_0x5e20('0x25')](saveUpdates(_0x1619fa['body'],null))[_0x5e20('0x25')](respondWithResult(_0x1ace56,null))[_0x5e20('0x46')](handleError(_0x1ace56,null));};exports[_0x5e20('0x29')]=function(_0x5d0345,_0x5d2aa2){return db['VoiceChanSpy'][_0x5e20('0x4b')]({'where':{'id':_0x5d0345[_0x5e20('0x48')]['id']}})[_0x5e20('0x25')](handleEntityNotFound(_0x5d2aa2,null))[_0x5e20('0x25')](removeEntity(_0x5d2aa2,null))[_0x5e20('0x46')](handleError(_0x5d2aa2,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 1253dc5..5dda859 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 _0x4799=['MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','merge','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','length','concat','internal','User','agent','then','exports','models','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','system','push','Set','CDR(type)=%s','chanspy','record'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0x4799,0x92));var _0x9479=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4799[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9479('0x0'));var util=require(_0x9479('0x1'));var BPromise=require(_0x9479('0x2'));var attributes=require(_0x9479('0x3'));var getUserApplications=function(_0x1dd3bb,_0x4e2692,_0xf77075){var _0x56ed4f=0x1;var _0x20ede6=[];var _0x1b7bd0={'context':_0x4e2692['context']||_0x9479('0x4'),'exten':util[_0x9479('0x5')](_0x9479('0x6'),_0x1dd3bb[_0x9479('0x7')],_0xf77075),'type':_0x9479('0x8'),'isApp':![],'ChanSpyId':_0x1dd3bb['id'],'UserId':_0x4e2692['id']};_0x20ede6[_0x9479('0x9')](_['merge']({'app':_0x9479('0xa'),'appdata':util[_0x9479('0x5')](_0x9479('0xb'),_0x9479('0xc')),'priority':_0x56ed4f++},_0x1b7bd0));if(_0x1dd3bb[_0x9479('0xd')]){_0x20ede6[_0x9479('0x9')](_['merge']({'app':_0x9479('0xe'),'appdata':util['format'](_0x9479('0xf'),_0x1dd3bb[_0x9479('0x10')]),'priority':_0x56ed4f++},_0x1b7bd0));}if(_0x1dd3bb[_0x9479('0x11')]){_0x20ede6[_0x9479('0x9')](_[_0x9479('0x12')]({'app':_0x9479('0x13'),'appdata':_0x1dd3bb[_0x9479('0x14')],'priority':_0x56ed4f++},_0x1b7bd0));}_0x20ede6[_0x9479('0x9')](_[_0x9479('0x12')]({'app':_0x9479('0x15'),'appdata':util[_0x9479('0x5')](_0x9479('0x16'),_0x4e2692[_0x9479('0x17')],_0x1dd3bb['options']?_0x1dd3bb[_0x9479('0x18')][_0x9479('0x19')](''):''),'priority':_0x56ed4f++},_0x1b7bd0));if(_0x1dd3bb[_0x9479('0xd')]){_0x20ede6[_0x9479('0x9')](_[_0x9479('0x12')]({'app':'StopMixMonitor','priority':_0x56ed4f++},_0x1b7bd0));}return _0x20ede6;};var getChanSpyApplications=function(_0x4f990c,_0x1c50ca){var _0x31cabc=[];for(var _0x3c1d0e=0x0,_0x3610d4=0x1;_0x3c1d0e<_0x1c50ca[_0x9479('0x1a')];_0x3c1d0e++,_0x3610d4=0x1){_0x31cabc=_0x31cabc[_0x9479('0x1b')](getUserApplications(_0x4f990c,_0x1c50ca[_0x3c1d0e],_0x1c50ca[_0x3c1d0e]['internal']));if(_0x1c50ca[_0x3c1d0e][_0x9479('0x1c')]!=_0x1c50ca[_0x3c1d0e]['name']){_0x31cabc=_0x31cabc[_0x9479('0x1b')](getUserApplications(_0x4f990c,_0x1c50ca[_0x3c1d0e],_0x1c50ca[_0x3c1d0e]['name']));}}return _0x31cabc;};var getChanSpyPromise=function(_0x3b7a63,_0x42508d){return new BPromise(function(_0x44b3ab,_0x1383a8){return _0x3b7a63[_0x9479('0x1d')]['findAll']({'attributes':['id',_0x9479('0x17'),'internal'],'where':{'role':_0x9479('0x1e'),'chanspy':!![]},'raw':!![]})[_0x9479('0x1f')](function(_0x59efd2){if(_0x59efd2){return _0x44b3ab(getChanSpyApplications(_0x42508d,_0x59efd2));}return _0x44b3ab([]);})['catch'](function(_0x46f0b9){_0x1383a8(_0x46f0b9);});});};module[_0x9479('0x20')]=function(_0x25d040,_0x158218){var _0x30ea68=_0x25d040[_0x9479('0x21')];return _0x25d040['define'](_0x9479('0x22'),attributes,{'tableName':_0x9479('0x23'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x414384,_0x14f833,_0x58a41a){return getChanSpyPromise(_0x30ea68,_0x414384)[_0x9479('0x1f')](function(_0x2ac56e){if(_0x2ac56e&&_0x2ac56e[_0x9479('0x1a')]){return _0x30ea68[_0x9479('0x24')][_0x9479('0x25')](_0x2ac56e);}})[_0x9479('0x1f')](function(){_0x58a41a();})[_0x9479('0x26')](function(_0x184d9c){_0x58a41a(_0x184d9c);});},'afterUpdate':function(_0x583041,_0x1aef49,_0x3758e1){return _0x30ea68[_0x9479('0x24')]['destroy']({'where':{'ChanSpyId':_0x583041['id']}})[_0x9479('0x1f')](function(){return getChanSpyPromise(_0x30ea68,_0x583041);})[_0x9479('0x1f')](function(_0x47f0e3){if(_0x47f0e3&&_0x47f0e3[_0x9479('0x1a')]){return _0x30ea68[_0x9479('0x24')]['bulkCreate'](_0x47f0e3);}})['then'](function(){_0x3758e1();})['catch'](function(_0x4ced26){_0x3758e1(_0x4ced26);});},'afterDestroy':function(_0x6e3fb7,_0x33f39f,_0x1b7c0e){return _0x30ea68[_0x9479('0x24')][_0x9479('0x27')]({'where':{'ChanSpyId':_0x6e3fb7['id']}})[_0x9479('0x1f')](function(){_0x1b7c0e();})[_0x9479('0x26')](function(_0x531a82){_0x1b7c0e(_0x531a82);});}}});}; \ No newline at end of file +var _0x57b1=['User','findAll','then','catch','models','define','VoiceExtension','bulkCreate','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','push','merge','Set','CDR(type)=%s','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','name','options','join','length','concat','internal'];(function(_0x46aa6f,_0xf7b072){var _0x44759c=function(_0x97a501){while(--_0x97a501){_0x46aa6f['push'](_0x46aa6f['shift']());}};_0x44759c(++_0xf7b072);}(_0x57b1,0x15c));var _0x157b=function(_0x460a97,_0x351b54){_0x460a97=_0x460a97-0x0;var _0x3707e1=_0x57b1[_0x460a97];return _0x3707e1;};'use strict';var _=require('lodash');var util=require(_0x157b('0x0'));var BPromise=require(_0x157b('0x1'));var attributes=require(_0x157b('0x2'));var getUserApplications=function(_0xee48c9,_0x2c29c3,_0x1d36f8){var _0x4b60b5=0x1;var _0x1335fa=[];var _0x554120={'context':_0x2c29c3[_0x157b('0x3')]||_0x157b('0x4'),'exten':util[_0x157b('0x5')]('%s%s',_0xee48c9[_0x157b('0x6')],_0x1d36f8),'type':_0x157b('0x7'),'isApp':![],'ChanSpyId':_0xee48c9['id'],'UserId':_0x2c29c3['id']};_0x1335fa[_0x157b('0x8')](_[_0x157b('0x9')]({'app':_0x157b('0xa'),'appdata':util[_0x157b('0x5')](_0x157b('0xb'),'chanspy'),'priority':_0x4b60b5++},_0x554120));if(_0xee48c9[_0x157b('0xc')]){_0x1335fa[_0x157b('0x8')](_[_0x157b('0x9')]({'app':_0x157b('0xd'),'appdata':util['format'](_0x157b('0xe'),_0xee48c9[_0x157b('0xf')]),'priority':_0x4b60b5++},_0x554120));}if(_0xee48c9[_0x157b('0x10')]){_0x1335fa[_0x157b('0x8')](_[_0x157b('0x9')]({'app':_0x157b('0x11'),'appdata':_0xee48c9[_0x157b('0x12')],'priority':_0x4b60b5++},_0x554120));}_0x1335fa[_0x157b('0x8')](_[_0x157b('0x9')]({'app':_0x157b('0x13'),'appdata':util[_0x157b('0x5')]('SIP/%s,%s',_0x2c29c3[_0x157b('0x14')],_0xee48c9[_0x157b('0x15')]?_0xee48c9[_0x157b('0x15')][_0x157b('0x16')](''):''),'priority':_0x4b60b5++},_0x554120));if(_0xee48c9['record']){_0x1335fa[_0x157b('0x8')](_[_0x157b('0x9')]({'app':'StopMixMonitor','priority':_0x4b60b5++},_0x554120));}return _0x1335fa;};var getChanSpyApplications=function(_0x522ede,_0x543d60){var _0x51d4fb=[];for(var _0x22444b=0x0,_0xe886f9=0x1;_0x22444b<_0x543d60[_0x157b('0x17')];_0x22444b++,_0xe886f9=0x1){_0x51d4fb=_0x51d4fb[_0x157b('0x18')](getUserApplications(_0x522ede,_0x543d60[_0x22444b],_0x543d60[_0x22444b][_0x157b('0x19')]));if(_0x543d60[_0x22444b][_0x157b('0x19')]!=_0x543d60[_0x22444b][_0x157b('0x14')]){_0x51d4fb=_0x51d4fb[_0x157b('0x18')](getUserApplications(_0x522ede,_0x543d60[_0x22444b],_0x543d60[_0x22444b][_0x157b('0x14')]));}}return _0x51d4fb;};var getChanSpyPromise=function(_0x192236,_0x379710){return new BPromise(function(_0x1b9ebc,_0x16d74f){return _0x192236[_0x157b('0x1a')][_0x157b('0x1b')]({'attributes':['id',_0x157b('0x14'),_0x157b('0x19')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x157b('0x1c')](function(_0x5ca47c){if(_0x5ca47c){return _0x1b9ebc(getChanSpyApplications(_0x379710,_0x5ca47c));}return _0x1b9ebc([]);})[_0x157b('0x1d')](function(_0x867eba){_0x16d74f(_0x867eba);});});};module['exports']=function(_0x254241,_0x3662c1){var _0xfcf77c=_0x254241[_0x157b('0x1e')];return _0x254241[_0x157b('0x1f')]('VoiceChanSpy',attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b7968,_0x159343,_0x273070){return getChanSpyPromise(_0xfcf77c,_0x2b7968)[_0x157b('0x1c')](function(_0x26f71c){if(_0x26f71c&&_0x26f71c[_0x157b('0x17')]){return _0xfcf77c[_0x157b('0x20')][_0x157b('0x21')](_0x26f71c);}})[_0x157b('0x1c')](function(){_0x273070();})[_0x157b('0x1d')](function(_0x31fbf){_0x273070(_0x31fbf);});},'afterUpdate':function(_0x311172,_0xc08acd,_0x27dca6){return _0xfcf77c[_0x157b('0x20')]['destroy']({'where':{'ChanSpyId':_0x311172['id']}})[_0x157b('0x1c')](function(){return getChanSpyPromise(_0xfcf77c,_0x311172);})[_0x157b('0x1c')](function(_0x4845ae){if(_0x4845ae&&_0x4845ae[_0x157b('0x17')]){return _0xfcf77c[_0x157b('0x20')]['bulkCreate'](_0x4845ae);}})[_0x157b('0x1c')](function(){_0x27dca6();})['catch'](function(_0x136e86){_0x27dca6(_0x136e86);});},'afterDestroy':function(_0x4c5f21,_0x2cb065,_0x9ab9b8){return _0xfcf77c[_0x157b('0x20')]['destroy']({'where':{'ChanSpyId':_0x4c5f21['id']}})[_0x157b('0x1c')](function(){_0x9ab9b8();})[_0x157b('0x1d')](function(_0x3987e7){_0x9ab9b8(_0x3987e7);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index ad9e4a8..90a4e18 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 _0x780f=['VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info'];(function(_0x4e8bb0,_0x26ca7a){var _0x469b95=function(_0x158b5f){while(--_0x158b5f){_0x4e8bb0['push'](_0x4e8bb0['shift']());}};_0x469b95(++_0x26ca7a);}(_0x780f,0x6c));var _0xf780=function(_0x9db5d3,_0x4eea5e){_0x9db5d3=_0x9db5d3-0x0;var _0x477a81=_0x780f[_0x9db5d3];return _0x477a81;};'use strict';var _=require(_0xf780('0x0'));var util=require(_0xf780('0x1'));var moment=require(_0xf780('0x2'));var BPromise=require(_0xf780('0x3'));var rs=require(_0xf780('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf780('0x5'));var logger=require(_0xf780('0x6'))(_0xf780('0x7'));var config=require(_0xf780('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf780('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bd856,_0x93539d,_0x1c3fdc){return new BPromise(function(_0xa12d00,_0x44f14c){return client[_0xf780('0xa')](_0x1bd856,_0x1c3fdc)['then'](function(_0x2c8221){logger[_0xf780('0xb')](_0xf780('0xc'),_0x93539d,_0xf780('0xd'));logger[_0xf780('0xe')](_0xf780('0xf'),_0x93539d,_0xf780('0xd'),JSON['stringify'](_0x2c8221));if(_0x2c8221['error']){if(_0x2c8221[_0xf780('0x10')][_0xf780('0x11')]===0x1f4){logger[_0xf780('0x10')](_0xf780('0xc'),_0x93539d,_0x2c8221['error'][_0xf780('0x12')]);return _0x44f14c(_0x2c8221[_0xf780('0x10')][_0xf780('0x12')]);}logger[_0xf780('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x93539d,_0x2c8221[_0xf780('0x10')]['message']);return _0xa12d00(_0x2c8221[_0xf780('0x10')][_0xf780('0x12')]);}else{logger[_0xf780('0xb')](_0xf780('0xc'),_0x93539d,_0xf780('0xd'));_0xa12d00(_0x2c8221[_0xf780('0x13')][_0xf780('0x12')]);}})['catch'](function(_0x450198){logger[_0xf780('0x10')](_0xf780('0xc'),_0x93539d,_0x450198);_0x44f14c(_0x450198);});});} \ No newline at end of file +var _0x6ae2=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x633c61,_0xa7f8dc){_0x633c61=_0x633c61-0x0;var _0x3cd8ea=_0x6ae2[_0x633c61];return _0x3cd8ea;};'use strict';var _=require(_0x26ae('0x0'));var util=require(_0x26ae('0x1'));var moment=require(_0x26ae('0x2'));var BPromise=require(_0x26ae('0x3'));var rs=require(_0x26ae('0x4'));var fs=require('fs');var Redis=require(_0x26ae('0x5'));var db=require(_0x26ae('0x6'))['db'];var utils=require(_0x26ae('0x7'));var logger=require(_0x26ae('0x8'))('rpc');var config=require(_0x26ae('0x9'));var jayson=require(_0x26ae('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13cb27,_0xde4226,_0x473907){return new BPromise(function(_0x151de3,_0x3bc9de){return client[_0x26ae('0xb')](_0x13cb27,_0x473907)[_0x26ae('0xc')](function(_0x4b3eca){logger[_0x26ae('0xd')](_0x26ae('0xe'),_0xde4226,_0x26ae('0xf'));logger[_0x26ae('0x10')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0xde4226,_0x26ae('0xf'),JSON['stringify'](_0x4b3eca));if(_0x4b3eca[_0x26ae('0x11')]){if(_0x4b3eca['error']['code']===0x1f4){logger[_0x26ae('0x11')](_0x26ae('0xe'),_0xde4226,_0x4b3eca[_0x26ae('0x11')][_0x26ae('0x12')]);return _0x3bc9de(_0x4b3eca[_0x26ae('0x11')][_0x26ae('0x12')]);}logger[_0x26ae('0x11')](_0x26ae('0xe'),_0xde4226,_0x4b3eca[_0x26ae('0x11')][_0x26ae('0x12')]);return _0x151de3(_0x4b3eca[_0x26ae('0x11')][_0x26ae('0x12')]);}else{logger['info'](_0x26ae('0xe'),_0xde4226,_0x26ae('0xf'));_0x151de3(_0x4b3eca['result'][_0x26ae('0x12')]);}})[_0x26ae('0x13')](function(_0x4f71d8){logger[_0x26ae('0x11')](_0x26ae('0xe'),_0xde4226,_0x4f71d8);_0x3bc9de(_0x4f71d8);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 5c1e537..7fcd9e3 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 _0xfc5b=['get','isAuthenticated','index','show','post','put','/:id','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4dcd10,_0x398de1){var _0x4f145d=function(_0x5b63bb){while(--_0x5b63bb){_0x4dcd10['push'](_0x4dcd10['shift']());}};_0x4f145d(++_0x398de1);}(_0xfc5b,0xc4));var _0xbfc5=function(_0x40ef76,_0x26b002){_0x40ef76=_0x40ef76-0x0;var _0x4a4c8d=_0xfc5b[_0x40ef76];return _0x4a4c8d;};'use strict';var multer=require(_0xbfc5('0x0'));var util=require(_0xbfc5('0x1'));var path=require(_0xbfc5('0x2'));var timeout=require(_0xbfc5('0x3'));var express=require('express');var router=express[_0xbfc5('0x4')]();var fs_extra=require(_0xbfc5('0x5'));var auth=require(_0xbfc5('0x6'));var interaction=require(_0xbfc5('0x7'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router[_0xbfc5('0x8')]('/',auth[_0xbfc5('0x9')](),controller[_0xbfc5('0xa')]);router[_0xbfc5('0x8')]('/:id',auth[_0xbfc5('0x9')](),controller[_0xbfc5('0xb')]);router[_0xbfc5('0xc')]('/',auth[_0xbfc5('0x9')](),controller['create']);router[_0xbfc5('0xd')](_0xbfc5('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xbfc5('0xf')](_0xbfc5('0xe'),auth[_0xbfc5('0x9')](),controller['destroy']);module[_0xbfc5('0x10')]=router; \ No newline at end of file +var _0x99e5=['get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller'];(function(_0x1bb80d,_0x4b83d7){var _0x4db601=function(_0x12cd97){while(--_0x12cd97){_0x1bb80d['push'](_0x1bb80d['shift']());}};_0x4db601(++_0x4b83d7);}(_0x99e5,0x161));var _0x599e=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0x99e5[_0x50f392];return _0x5926f2;};'use strict';var multer=require(_0x599e('0x0'));var util=require(_0x599e('0x1'));var path=require(_0x599e('0x2'));var timeout=require('connect-timeout');var express=require(_0x599e('0x3'));var router=express['Router']();var fs_extra=require(_0x599e('0x4'));var auth=require(_0x599e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x599e('0x6'));var controller=require(_0x599e('0x7'));router[_0x599e('0x8')]('/',auth[_0x599e('0x9')](),controller[_0x599e('0xa')]);router['get']('/:id',auth[_0x599e('0x9')](),controller[_0x599e('0xb')]);router[_0x599e('0xc')]('/',auth[_0x599e('0x9')](),controller[_0x599e('0xd')]);router['put'](_0x599e('0xe'),auth[_0x599e('0x9')](),controller[_0x599e('0xf')]);router[_0x599e('0x10')](_0x599e('0xe'),auth[_0x599e('0x9')](),controller[_0x599e('0x11')]);module[_0x599e('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index cb3e328..8ff4708 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 _0x4fdc=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4a9e41,_0x472157){var _0x3acc76=function(_0xaccc4d){while(--_0xaccc4d){_0x4a9e41['push'](_0x4a9e41['shift']());}};_0x3acc76(++_0x472157);}(_0x4fdc,0x196));var _0xc4fd=function(_0x401209,_0x568888){_0x401209=_0x401209-0x0;var _0x25cadb=_0x4fdc[_0x401209];return _0x25cadb;};'use strict';var Sequelize=require(_0xc4fd('0x0'));module[_0xc4fd('0x1')]={'name':{'type':Sequelize[_0xc4fd('0x2')],'unique':'name'},'description':{'type':Sequelize[_0xc4fd('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xc4fd('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb5b0=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x4845af,_0x361c34){var _0x280247=function(_0x35436a){while(--_0x35436a){_0x4845af['push'](_0x4845af['shift']());}};_0x280247(++_0x361c34);}(_0xb5b0,0x1bd));var _0x0b5b=function(_0x543df4,_0x80acde){_0x543df4=_0x543df4-0x0;var _0x222670=_0xb5b0[_0x543df4];return _0x222670;};'use strict';var Sequelize=require(_0x0b5b('0x0'));module[_0x0b5b('0x1')]={'name':{'type':Sequelize[_0x0b5b('0x2')],'unique':_0x0b5b('0x3')},'description':{'type':Sequelize[_0x0b5b('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x0b5b('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 34f6bf8..28d88c7 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 _0x9f0e=['stringify','error','code','message','info','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','get','Contexts','UserProfileResource','then','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','options','includeAll','include','findAll','keys','create','body','readFileSync','join','root','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','utf8','render','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../mysqldb','jayson/promise','client','request','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2a9ccc,_0xb277e3){var _0x24344e=function(_0x328550){while(--_0x328550){_0x2a9ccc['push'](_0x2a9ccc['shift']());}};_0x24344e(++_0xb277e3);}(_0x9f0e,0x183));var _0xe9f0=function(_0x146aa8,_0x25d7bb){_0x146aa8=_0x146aa8-0x0;var _0x386a4e=_0x9f0e[_0x146aa8];return _0x386a4e;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require(_0xe9f0('0x5'));var BPromise=require(_0xe9f0('0x6'));var Mustache=require(_0xe9f0('0x7'));var util=require(_0xe9f0('0x8'));var path=require(_0xe9f0('0x9'));var sox=require(_0xe9f0('0xa'));var csv=require('to-csv');var ejs=require(_0xe9f0('0xb'));var fs=require('fs');var fs_extra=require(_0xe9f0('0xc'));var _=require(_0xe9f0('0xd'));var squel=require(_0xe9f0('0xe'));var crypto=require(_0xe9f0('0xf'));var jsforce=require(_0xe9f0('0x10'));var deskjs=require(_0xe9f0('0x11'));var toCsv=require(_0xe9f0('0x12'));var querystring=require(_0xe9f0('0x13'));var Papa=require(_0xe9f0('0x14'));var Redis=require(_0xe9f0('0x15'));var authService=require(_0xe9f0('0x16'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe9f0('0x17'));var utils=require(_0xe9f0('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x19'))['db'];var jayson=require(_0xe9f0('0x1a'));var client=jayson[_0xe9f0('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x283f74,_0xed57c7,_0x1b97da,_0x392bd9){return new BPromise(function(_0x1ed8f8,_0x488eb7){var _0x5534e0=_0x392bd9||client;return _0x5534e0[_0xe9f0('0x1c')](_0x283f74,_0x1b97da)['then'](function(_0x28c9e8){logger['info'](_0xe9f0('0x1d'),_0xed57c7,'request\x20sent');logger[_0xe9f0('0x1e')](_0xe9f0('0x1f'),_0xed57c7,_0xe9f0('0x20'),JSON[_0xe9f0('0x21')](_0x28c9e8));if(_0x28c9e8['error']){if(_0x28c9e8[_0xe9f0('0x22')][_0xe9f0('0x23')]===0x1f4){logger[_0xe9f0('0x22')](_0xe9f0('0x1d'),_0xed57c7,_0x28c9e8[_0xe9f0('0x22')][_0xe9f0('0x24')]);return _0x488eb7(_0x28c9e8[_0xe9f0('0x22')][_0xe9f0('0x24')]);}logger[_0xe9f0('0x22')](_0xe9f0('0x1d'),_0xed57c7,_0x28c9e8[_0xe9f0('0x22')][_0xe9f0('0x24')]);return _0x1ed8f8(_0x28c9e8[_0xe9f0('0x22')][_0xe9f0('0x24')]);}else{logger[_0xe9f0('0x25')](_0xe9f0('0x1d'),_0xed57c7,_0xe9f0('0x20'));_0x1ed8f8(_0x28c9e8['result'][_0xe9f0('0x24')]);}})[_0xe9f0('0x26')](function(_0x84b08d){logger[_0xe9f0('0x22')](_0xe9f0('0x1d'),_0xed57c7,_0x84b08d);_0x488eb7(_0x84b08d);});});}function respondWithStatusCode(_0x1bcbe5,_0x195d92){_0x195d92=_0x195d92||0xcc;return function(_0x346f44){if(_0x346f44){return _0x1bcbe5[_0xe9f0('0x27')](_0x195d92);}return _0x1bcbe5[_0xe9f0('0x28')](_0x195d92)[_0xe9f0('0x29')]();};}function respondWithResult(_0x576df3,_0x2efa0c){_0x2efa0c=_0x2efa0c||0xc8;return function(_0x3322b3){if(_0x3322b3){return _0x576df3[_0xe9f0('0x28')](_0x2efa0c)[_0xe9f0('0x2a')](_0x3322b3);}};}function respondWithFilteredResult(_0x5472ac,_0x350113){return function(_0x398dde){if(_0x398dde){var _0x283c80=typeof _0x350113[_0xe9f0('0x2b')]===_0xe9f0('0x2c')&&typeof _0x350113[_0xe9f0('0x2d')]===_0xe9f0('0x2c');var _0xf63a98=_0x398dde[_0xe9f0('0x2e')];var _0x12aa2c=_0x283c80?0x0:_0x350113[_0xe9f0('0x2b')];var _0x1e3432=_0x283c80?_0x398dde[_0xe9f0('0x2e')]:_0x350113[_0xe9f0('0x2b')]+_0x350113[_0xe9f0('0x2d')];var _0x4853aa;if(_0x1e3432>=_0xf63a98){_0x1e3432=_0xf63a98;_0x4853aa=0xc8;}else{_0x4853aa=0xce;}_0x5472ac[_0xe9f0('0x28')](_0x4853aa);return _0x5472ac['set'](_0xe9f0('0x2f'),_0x12aa2c+'-'+_0x1e3432+'/'+_0xf63a98)[_0xe9f0('0x2a')](_0x398dde);}return null;};}function patchUpdates(_0x5e54d9){return function(_0x5dc435){try{jsonpatch[_0xe9f0('0x30')](_0x5dc435,_0x5e54d9,!![]);}catch(_0x5ebb04){return BPromise['reject'](_0x5ebb04);}return _0x5dc435[_0xe9f0('0x31')]();};}function saveUpdates(_0x4aea6c,_0x2eb06a){return function(_0x5e4ac4){if(_0x5e4ac4){return _0x5e4ac4[_0xe9f0('0x32')](_0x4aea6c)['then'](function(_0x549ed4){return _0x549ed4;});}return null;};}function removeEntity(_0x171c7c,_0x3a7fe1){return function(_0x3ee41e){if(_0x3ee41e){return _0x3ee41e[_0xe9f0('0x33')]()['then'](function(){var _0x37ca7d=_0x3ee41e[_0xe9f0('0x34')]({'plain':!![]});var _0x296ee0=_0xe9f0('0x35');return db[_0xe9f0('0x36')][_0xe9f0('0x33')]({'where':{'type':_0x296ee0,'resourceId':_0x37ca7d['id']}})[_0xe9f0('0x37')](function(){return _0x3ee41e;});})[_0xe9f0('0x37')](function(){_0x171c7c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xed589e,_0x5050bd){return function(_0x4a1d1e){if(!_0x4a1d1e){_0xed589e['sendStatus'](0x194);}return _0x4a1d1e;};}function handleError(_0x4df956,_0x252db4){_0x252db4=_0x252db4||0x1f4;return function(_0x3d9cc3){logger[_0xe9f0('0x22')](_0x3d9cc3[_0xe9f0('0x38')]);if(_0x3d9cc3[_0xe9f0('0x39')]){delete _0x3d9cc3[_0xe9f0('0x39')];}_0x4df956[_0xe9f0('0x28')](_0x252db4)[_0xe9f0('0x3a')](_0x3d9cc3);};}exports[_0xe9f0('0x3b')]=function(_0x2d7f49,_0x1014e3){var _0x951470={},_0x1d4799={},_0x468a4a={'count':0x0,'rows':[]};var _0x28ef31=_[_0xe9f0('0x3c')](db[_0xe9f0('0x3d')][_0xe9f0('0x3e')],function(_0x5710ac){return{'name':_0x5710ac[_0xe9f0('0x3f')],'type':_0x5710ac['type'][_0xe9f0('0x40')]};});_0x1d4799['model']=_[_0xe9f0('0x3c')](_0x28ef31,'name');_0x1d4799[_0xe9f0('0x41')]=_['keys'](_0x2d7f49['query']);_0x1d4799[_0xe9f0('0x42')]=_[_0xe9f0('0x43')](_0x1d4799[_0xe9f0('0x44')],_0x1d4799['query']);_0x951470['attributes']=_['intersection'](_0x1d4799[_0xe9f0('0x44')],qs[_0xe9f0('0x45')](_0x2d7f49[_0xe9f0('0x41')][_0xe9f0('0x45')]));_0x951470[_0xe9f0('0x46')]=_0x951470['attributes'][_0xe9f0('0x47')]?_0x951470[_0xe9f0('0x46')]:_0x1d4799['model'];if(!_0x2d7f49[_0xe9f0('0x41')][_0xe9f0('0x48')](_0xe9f0('0x49'))){_0x951470[_0xe9f0('0x2d')]=qs[_0xe9f0('0x2d')](_0x2d7f49['query'][_0xe9f0('0x2d')]);_0x951470[_0xe9f0('0x2b')]=qs[_0xe9f0('0x2b')](_0x2d7f49['query']['offset']);}_0x951470['order']=qs[_0xe9f0('0x4a')](_0x2d7f49['query']['sort']);_0x951470['where']=qs['filters'](_['pick'](_0x2d7f49[_0xe9f0('0x41')],_0x1d4799[_0xe9f0('0x42')]),_0x28ef31);if(_0x2d7f49[_0xe9f0('0x41')]['filter']){_0x951470[_0xe9f0('0x4b')]=_[_0xe9f0('0x4c')](_0x951470['where'],{'$or':_[_0xe9f0('0x3c')](_0x28ef31,function(_0x1e106b){if(_0x1e106b[_0xe9f0('0x4d')]!==_0xe9f0('0x4e')){var _0x4d81e8={};_0x4d81e8[_0x1e106b[_0xe9f0('0x39')]]={'$like':'%'+_0x2d7f49[_0xe9f0('0x41')]['filter']+'%'};return _0x4d81e8;}})});}_0x951470=_[_0xe9f0('0x4c')]({},_0x951470,_0x2d7f49[_0xe9f0('0x4f')]);var _0x3b636b={'where':_0x951470[_0xe9f0('0x4b')]};return db['VoiceContext'][_0xe9f0('0x2e')](_0x3b636b)[_0xe9f0('0x37')](function(_0x497027){_0x468a4a['count']=_0x497027;if(_0x2d7f49[_0xe9f0('0x41')][_0xe9f0('0x50')]){_0x951470[_0xe9f0('0x51')]=[{'all':!![]}];}return db[_0xe9f0('0x3d')][_0xe9f0('0x52')](_0x951470);})[_0xe9f0('0x37')](function(_0x256b89){_0x468a4a['rows']=_0x256b89;return _0x468a4a;})[_0xe9f0('0x37')](respondWithFilteredResult(_0x1014e3,_0x951470))['catch'](handleError(_0x1014e3,null));};exports['show']=function(_0x3f99bd,_0x259c8d){var _0x6d2633={'raw':![],'where':{'id':_0x3f99bd['params']['id']}},_0x4dfff0={};_0x4dfff0['model']=_['keys'](db['VoiceContext'][_0xe9f0('0x3e')]);_0x4dfff0[_0xe9f0('0x41')]=_[_0xe9f0('0x53')](_0x3f99bd[_0xe9f0('0x41')]);_0x4dfff0[_0xe9f0('0x42')]=_['intersection'](_0x4dfff0['model'],_0x4dfff0[_0xe9f0('0x41')]);_0x6d2633['attributes']=_['intersection'](_0x4dfff0[_0xe9f0('0x44')],qs['fields'](_0x3f99bd['query']['fields']));_0x6d2633['attributes']=_0x6d2633['attributes'][_0xe9f0('0x47')]?_0x6d2633[_0xe9f0('0x46')]:_0x4dfff0[_0xe9f0('0x44')];if(_0x3f99bd[_0xe9f0('0x41')][_0xe9f0('0x50')]){_0x6d2633[_0xe9f0('0x51')]=[{'all':!![]}];}_0x6d2633=_['merge']({},_0x6d2633,_0x3f99bd[_0xe9f0('0x4f')]);return db[_0xe9f0('0x3d')]['find'](_0x6d2633)[_0xe9f0('0x37')](handleEntityNotFound(_0x259c8d,null))[_0xe9f0('0x37')](respondWithResult(_0x259c8d,null))[_0xe9f0('0x26')](handleError(_0x259c8d,null));};exports['create']=function(_0x34bde2,_0x23315e,_0xae9a04){var _0x12805f;return db[_0xe9f0('0x3d')][_0xe9f0('0x54')](_0x34bde2[_0xe9f0('0x55')],{'raw':!![]})[_0xe9f0('0x37')](function(_0x443234){_0x12805f=_0x443234;return db['VoiceContext']['findAll']({'raw':!![]});})[_0xe9f0('0x37')](function(_0x3179fe){var _0xa89388=fs[_0xe9f0('0x56')](path[_0xe9f0('0x57')](config[_0xe9f0('0x58')],_0xe9f0('0x59')),'utf8');var _0x47b1c3=ejs['render'](_0xa89388,{'contexts':_0x3179fe||[]});fs[_0xe9f0('0x5a')](_0xe9f0('0x5b'),_0x47b1c3);})[_0xe9f0('0x37')](function(){return respondWithRpcPromise(_0xe9f0('0x5c'),_0xe9f0('0x54'),{'module':_0xe9f0('0x5d')});})[_0xe9f0('0x37')](function(){var _0x44abaa=_0x34bde2[_0xe9f0('0x5e')][_0xe9f0('0x34')]({'plain':!![]});if(!_0x44abaa)throw new Error(_0xe9f0('0x5f'));if(_0x44abaa[_0xe9f0('0x60')]===_0xe9f0('0x5e')){var _0x53cd13=_0x12805f[_0xe9f0('0x34')]({'plain':!![]});return db[_0xe9f0('0x61')][_0xe9f0('0x62')]({'where':{'name':_0xe9f0('0x35'),'userProfileId':_0x44abaa[_0xe9f0('0x63')]},'raw':!![]})[_0xe9f0('0x37')](function(_0x1c1746){if(_0x1c1746&&_0x1c1746[_0xe9f0('0x64')]===0x0){return db[_0xe9f0('0x36')][_0xe9f0('0x54')]({'name':_0x53cd13[_0xe9f0('0x39')],'resourceId':_0x53cd13['id'],'type':_0x1c1746[_0xe9f0('0x39')],'sectionId':_0x1c1746['id']},{})[_0xe9f0('0x37')](function(){return _0x12805f;});}else{return _0x12805f;}})[_0xe9f0('0x26')](function(_0x5d28b5){logger[_0xe9f0('0x22')](_0xe9f0('0x65'),_0x5d28b5);throw _0x5d28b5;});}return _0x12805f;})['then'](respondWithResult(_0x23315e,0xc9))['catch'](handleError(_0x23315e,null));};exports[_0xe9f0('0x32')]=function(_0x4199dd,_0x4a36d8,_0x93559b){var _0x52ce36;return db[_0xe9f0('0x3d')][_0xe9f0('0x62')]({'where':{'id':_0x4199dd[_0xe9f0('0x66')]['id']}})[_0xe9f0('0x37')](handleEntityNotFound(_0x4a36d8,null))[_0xe9f0('0x37')](saveUpdates(_0x4199dd[_0xe9f0('0x55')],null))[_0xe9f0('0x37')](function(_0x567891){if(_0x567891){_0x52ce36=_0x567891;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0xe9f0('0x37')](function(_0x1209f1){var _0x5b8503=fs[_0xe9f0('0x56')](path['join'](config['root'],'server/files/templates/context.ejs'),_0xe9f0('0x67'));var _0x235c01=ejs[_0xe9f0('0x68')](_0x5b8503,{'contexts':_0x1209f1||[]});fs[_0xe9f0('0x5a')](_0xe9f0('0x5b'),_0x235c01);})[_0xe9f0('0x37')](function(){return respondWithRpcPromise('Reload',_0xe9f0('0x32'),{'module':'chan_sip.so'});})[_0xe9f0('0x37')](function(){return _0x52ce36;})[_0xe9f0('0x37')](respondWithResult(_0x4a36d8,null))[_0xe9f0('0x26')](handleError(_0x4a36d8,null));};exports[_0xe9f0('0x33')]=function(_0x1e0275,_0x41bd56,_0x1e2655){var _0x456d74;return db[_0xe9f0('0x3d')]['find']({'where':{'id':_0x1e0275[_0xe9f0('0x66')]['id']}})[_0xe9f0('0x37')](handleEntityNotFound(_0x41bd56,null))[_0xe9f0('0x37')](removeEntity(_0x41bd56,null))[_0xe9f0('0x37')](function(){return db['VoiceContext'][_0xe9f0('0x52')]({'raw':!![]});})[_0xe9f0('0x37')](function(_0x3957b2){var _0x49bc2f=fs[_0xe9f0('0x56')](path['join'](config[_0xe9f0('0x58')],_0xe9f0('0x59')),_0xe9f0('0x67'));var _0x1864b8=ejs[_0xe9f0('0x68')](_0x49bc2f,{'contexts':_0x3957b2});fs[_0xe9f0('0x5a')](_0xe9f0('0x5b'),_0x1864b8);return respondWithRpcPromise(_0xe9f0('0x5c'),_0xe9f0('0x33'),{'module':_0xe9f0('0x5d')});})[_0xe9f0('0x26')](handleError(_0x41bd56,null));}; \ No newline at end of file +var _0x56bb=['stack','name','index','map','VoiceContext','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','body','readFileSync','root','server/files/templates/context.ejs','utf8','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','join','render','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','Contexts','UserProfileResource','destroy'];(function(_0x3fff80,_0x48f187){var _0x3a87e1=function(_0x1723f3){while(--_0x1723f3){_0x3fff80['push'](_0x3fff80['shift']());}};_0x3a87e1(++_0x48f187);}(_0x56bb,0x9f));var _0xb56b=function(_0x523bf4,_0x447f6b){_0x523bf4=_0x523bf4-0x0;var _0x3eb434=_0x56bb[_0x523bf4];return _0x3eb434;};'use strict';var emlformat=require(_0xb56b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb56b('0x1'));var jsonpatch=require(_0xb56b('0x2'));var rp=require(_0xb56b('0x3'));var moment=require('moment');var BPromise=require(_0xb56b('0x4'));var Mustache=require(_0xb56b('0x5'));var util=require(_0xb56b('0x6'));var path=require(_0xb56b('0x7'));var sox=require(_0xb56b('0x8'));var csv=require('to-csv');var ejs=require(_0xb56b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb56b('0xa'));var squel=require(_0xb56b('0xb'));var crypto=require(_0xb56b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb56b('0xd'));var toCsv=require(_0xb56b('0xe'));var querystring=require(_0xb56b('0xf'));var Papa=require(_0xb56b('0x10'));var Redis=require(_0xb56b('0x11'));var authService=require(_0xb56b('0x12'));var qs=require(_0xb56b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb56b('0x14'));var logger=require(_0xb56b('0x15'))('api');var utils=require(_0xb56b('0x16'));var config=require(_0xb56b('0x17'));var licenseUtil=require(_0xb56b('0x18'));var db=require(_0xb56b('0x19'))['db'];var jayson=require(_0xb56b('0x1a'));var client=jayson['client'][_0xb56b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3d2c01,_0x5bb311,_0xbee406,_0x79a6c){return new BPromise(function(_0x184e12,_0x541bb0){var _0x89e418=_0x79a6c||client;return _0x89e418[_0xb56b('0x1c')](_0x3d2c01,_0xbee406)[_0xb56b('0x1d')](function(_0x13acda){logger[_0xb56b('0x1e')](_0xb56b('0x1f'),_0x5bb311,_0xb56b('0x20'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5bb311,_0xb56b('0x20'),JSON['stringify'](_0x13acda));if(_0x13acda[_0xb56b('0x21')]){if(_0x13acda['error'][_0xb56b('0x22')]===0x1f4){logger['error'](_0xb56b('0x1f'),_0x5bb311,_0x13acda['error']['message']);return _0x541bb0(_0x13acda[_0xb56b('0x21')][_0xb56b('0x23')]);}logger[_0xb56b('0x21')](_0xb56b('0x1f'),_0x5bb311,_0x13acda[_0xb56b('0x21')]['message']);return _0x184e12(_0x13acda[_0xb56b('0x21')]['message']);}else{logger[_0xb56b('0x1e')](_0xb56b('0x1f'),_0x5bb311,'request\x20sent');_0x184e12(_0x13acda['result'][_0xb56b('0x23')]);}})[_0xb56b('0x24')](function(_0x2f2ed8){logger[_0xb56b('0x21')](_0xb56b('0x1f'),_0x5bb311,_0x2f2ed8);_0x541bb0(_0x2f2ed8);});});}function respondWithStatusCode(_0x64db70,_0x4c4043){_0x4c4043=_0x4c4043||0xcc;return function(_0x2c189c){if(_0x2c189c){return _0x64db70[_0xb56b('0x25')](_0x4c4043);}return _0x64db70[_0xb56b('0x26')](_0x4c4043)[_0xb56b('0x27')]();};}function respondWithResult(_0x248354,_0x45605b){_0x45605b=_0x45605b||0xc8;return function(_0x2f092b){if(_0x2f092b){return _0x248354[_0xb56b('0x26')](_0x45605b)[_0xb56b('0x28')](_0x2f092b);}};}function respondWithFilteredResult(_0x2a3252,_0x4c6dc9){return function(_0x4d8780){if(_0x4d8780){var _0x2dd135=typeof _0x4c6dc9[_0xb56b('0x29')]==='undefined'&&typeof _0x4c6dc9[_0xb56b('0x2a')]===_0xb56b('0x2b');var _0x114a68=_0x4d8780[_0xb56b('0x2c')];var _0xc3c470=_0x2dd135?0x0:_0x4c6dc9[_0xb56b('0x29')];var _0x5488ae=_0x2dd135?_0x4d8780[_0xb56b('0x2c')]:_0x4c6dc9[_0xb56b('0x29')]+_0x4c6dc9['limit'];var _0x4f18a0;if(_0x5488ae>=_0x114a68){_0x5488ae=_0x114a68;_0x4f18a0=0xc8;}else{_0x4f18a0=0xce;}_0x2a3252[_0xb56b('0x26')](_0x4f18a0);return _0x2a3252[_0xb56b('0x2d')](_0xb56b('0x2e'),_0xc3c470+'-'+_0x5488ae+'/'+_0x114a68)[_0xb56b('0x28')](_0x4d8780);}return null;};}function patchUpdates(_0xd58198){return function(_0x3acf2b){try{jsonpatch[_0xb56b('0x2f')](_0x3acf2b,_0xd58198,!![]);}catch(_0x4bb01a){return BPromise[_0xb56b('0x30')](_0x4bb01a);}return _0x3acf2b[_0xb56b('0x31')]();};}function saveUpdates(_0x1a1c22,_0x16d1b8){return function(_0x40c548){if(_0x40c548){return _0x40c548['update'](_0x1a1c22)[_0xb56b('0x1d')](function(_0x15d8e7){return _0x15d8e7;});}return null;};}function removeEntity(_0x5a8406,_0x2973fe){return function(_0x2b58ee){if(_0x2b58ee){return _0x2b58ee['destroy']()['then'](function(){var _0x517cb1=_0x2b58ee['get']({'plain':!![]});var _0x48c743=_0xb56b('0x32');return db[_0xb56b('0x33')][_0xb56b('0x34')]({'where':{'type':_0x48c743,'resourceId':_0x517cb1['id']}})[_0xb56b('0x1d')](function(){return _0x2b58ee;});})[_0xb56b('0x1d')](function(){_0x5a8406[_0xb56b('0x26')](0xcc)[_0xb56b('0x27')]();});}};}function handleEntityNotFound(_0x56740b,_0x59022f){return function(_0x2caae0){if(!_0x2caae0){_0x56740b[_0xb56b('0x25')](0x194);}return _0x2caae0;};}function handleError(_0x350c72,_0x416011){_0x416011=_0x416011||0x1f4;return function(_0x4a1b46){logger[_0xb56b('0x21')](_0x4a1b46[_0xb56b('0x35')]);if(_0x4a1b46[_0xb56b('0x36')]){delete _0x4a1b46[_0xb56b('0x36')];}_0x350c72[_0xb56b('0x26')](_0x416011)['send'](_0x4a1b46);};}exports[_0xb56b('0x37')]=function(_0x3e4a49,_0x3684d7){var _0x491399={},_0xc29660={},_0x361781={'count':0x0,'rows':[]};var _0x4a6f67=_[_0xb56b('0x38')](db[_0xb56b('0x39')][_0xb56b('0x3a')],function(_0x728a95){return{'name':_0x728a95[_0xb56b('0x3b')],'type':_0x728a95['type'][_0xb56b('0x3c')]};});_0xc29660['model']=_[_0xb56b('0x38')](_0x4a6f67,_0xb56b('0x36'));_0xc29660[_0xb56b('0x3d')]=_[_0xb56b('0x3e')](_0x3e4a49[_0xb56b('0x3d')]);_0xc29660[_0xb56b('0x3f')]=_[_0xb56b('0x40')](_0xc29660[_0xb56b('0x41')],_0xc29660['query']);_0x491399['attributes']=_['intersection'](_0xc29660[_0xb56b('0x41')],qs['fields'](_0x3e4a49[_0xb56b('0x3d')][_0xb56b('0x42')]));_0x491399[_0xb56b('0x43')]=_0x491399[_0xb56b('0x43')][_0xb56b('0x44')]?_0x491399[_0xb56b('0x43')]:_0xc29660[_0xb56b('0x41')];if(!_0x3e4a49[_0xb56b('0x3d')][_0xb56b('0x45')](_0xb56b('0x46'))){_0x491399['limit']=qs[_0xb56b('0x2a')](_0x3e4a49['query'][_0xb56b('0x2a')]);_0x491399['offset']=qs['offset'](_0x3e4a49[_0xb56b('0x3d')]['offset']);}_0x491399[_0xb56b('0x47')]=qs[_0xb56b('0x48')](_0x3e4a49[_0xb56b('0x3d')][_0xb56b('0x48')]);_0x491399[_0xb56b('0x49')]=qs[_0xb56b('0x3f')](_[_0xb56b('0x4a')](_0x3e4a49['query'],_0xc29660['filters']),_0x4a6f67);if(_0x3e4a49[_0xb56b('0x3d')][_0xb56b('0x4b')]){_0x491399[_0xb56b('0x49')]=_[_0xb56b('0x4c')](_0x491399[_0xb56b('0x49')],{'$or':_[_0xb56b('0x38')](_0x4a6f67,function(_0x2f76a5){if(_0x2f76a5['type']!==_0xb56b('0x4d')){var _0x27878c={};_0x27878c[_0x2f76a5[_0xb56b('0x36')]]={'$like':'%'+_0x3e4a49['query'][_0xb56b('0x4b')]+'%'};return _0x27878c;}})});}_0x491399=_[_0xb56b('0x4c')]({},_0x491399,_0x3e4a49[_0xb56b('0x4e')]);var _0x11b905={'where':_0x491399[_0xb56b('0x49')]};return db['VoiceContext'][_0xb56b('0x2c')](_0x11b905)['then'](function(_0x1270b6){_0x361781[_0xb56b('0x2c')]=_0x1270b6;if(_0x3e4a49[_0xb56b('0x3d')]['includeAll']){_0x491399[_0xb56b('0x4f')]=[{'all':!![]}];}return db[_0xb56b('0x39')][_0xb56b('0x50')](_0x491399);})[_0xb56b('0x1d')](function(_0x16c6bf){_0x361781[_0xb56b('0x51')]=_0x16c6bf;return _0x361781;})['then'](respondWithFilteredResult(_0x3684d7,_0x491399))[_0xb56b('0x24')](handleError(_0x3684d7,null));};exports[_0xb56b('0x52')]=function(_0x2da11b,_0x3ac2a4){var _0x359f77={'raw':![],'where':{'id':_0x2da11b[_0xb56b('0x53')]['id']}},_0x1a4a7d={};_0x1a4a7d[_0xb56b('0x41')]=_['keys'](db[_0xb56b('0x39')][_0xb56b('0x3a')]);_0x1a4a7d[_0xb56b('0x3d')]=_[_0xb56b('0x3e')](_0x2da11b[_0xb56b('0x3d')]);_0x1a4a7d[_0xb56b('0x3f')]=_[_0xb56b('0x40')](_0x1a4a7d[_0xb56b('0x41')],_0x1a4a7d[_0xb56b('0x3d')]);_0x359f77[_0xb56b('0x43')]=_[_0xb56b('0x40')](_0x1a4a7d[_0xb56b('0x41')],qs[_0xb56b('0x42')](_0x2da11b[_0xb56b('0x3d')][_0xb56b('0x42')]));_0x359f77['attributes']=_0x359f77[_0xb56b('0x43')][_0xb56b('0x44')]?_0x359f77[_0xb56b('0x43')]:_0x1a4a7d[_0xb56b('0x41')];if(_0x2da11b[_0xb56b('0x3d')][_0xb56b('0x54')]){_0x359f77['include']=[{'all':!![]}];}_0x359f77=_['merge']({},_0x359f77,_0x2da11b['options']);return db[_0xb56b('0x39')][_0xb56b('0x55')](_0x359f77)[_0xb56b('0x1d')](handleEntityNotFound(_0x3ac2a4,null))[_0xb56b('0x1d')](respondWithResult(_0x3ac2a4,null))[_0xb56b('0x24')](handleError(_0x3ac2a4,null));};exports[_0xb56b('0x56')]=function(_0x367ba2,_0x52598a,_0x25e092){var _0x5bfab5;return db['VoiceContext'][_0xb56b('0x56')](_0x367ba2[_0xb56b('0x57')],{'raw':!![]})[_0xb56b('0x1d')](function(_0x20c62a){_0x5bfab5=_0x20c62a;return db[_0xb56b('0x39')]['findAll']({'raw':!![]});})[_0xb56b('0x1d')](function(_0x19e78d){var _0x75f4bf=fs[_0xb56b('0x58')](path['join'](config[_0xb56b('0x59')],_0xb56b('0x5a')),_0xb56b('0x5b'));var _0x4d49a0=ejs['render'](_0x75f4bf,{'contexts':_0x19e78d||[]});fs['writeFileSync'](_0xb56b('0x5c'),_0x4d49a0);})[_0xb56b('0x1d')](function(){return respondWithRpcPromise(_0xb56b('0x5d'),_0xb56b('0x56'),{'module':_0xb56b('0x5e')});})[_0xb56b('0x1d')](function(){var _0x5ba3f2=_0x367ba2[_0xb56b('0x5f')][_0xb56b('0x60')]({'plain':!![]});if(!_0x5ba3f2)throw new Error(_0xb56b('0x61'));if(_0x5ba3f2[_0xb56b('0x62')]==='user'){var _0x53dfb3=_0x5bfab5[_0xb56b('0x60')]({'plain':!![]});return db[_0xb56b('0x63')][_0xb56b('0x55')]({'where':{'name':_0xb56b('0x32'),'userProfileId':_0x5ba3f2[_0xb56b('0x64')]},'raw':!![]})[_0xb56b('0x1d')](function(_0x489004){if(_0x489004&&_0x489004['autoAssociation']===0x0){return db[_0xb56b('0x33')][_0xb56b('0x56')]({'name':_0x53dfb3[_0xb56b('0x36')],'resourceId':_0x53dfb3['id'],'type':_0x489004[_0xb56b('0x36')],'sectionId':_0x489004['id']},{})['then'](function(){return _0x5bfab5;});}else{return _0x5bfab5;}})['catch'](function(_0x55f327){logger['error'](_0xb56b('0x65'),_0x55f327);throw _0x55f327;});}return _0x5bfab5;})['then'](respondWithResult(_0x52598a,0xc9))[_0xb56b('0x24')](handleError(_0x52598a,null));};exports[_0xb56b('0x66')]=function(_0x457ff8,_0x2f9225,_0x450681){var _0x38ae68;return db[_0xb56b('0x39')][_0xb56b('0x55')]({'where':{'id':_0x457ff8[_0xb56b('0x53')]['id']}})[_0xb56b('0x1d')](handleEntityNotFound(_0x2f9225,null))[_0xb56b('0x1d')](saveUpdates(_0x457ff8[_0xb56b('0x57')],null))[_0xb56b('0x1d')](function(_0x590fa1){if(_0x590fa1){_0x38ae68=_0x590fa1;return db['VoiceContext'][_0xb56b('0x50')]({'raw':!![]});}})[_0xb56b('0x1d')](function(_0x4e597b){var _0x1e31f3=fs[_0xb56b('0x58')](path[_0xb56b('0x67')](config[_0xb56b('0x59')],_0xb56b('0x5a')),_0xb56b('0x5b'));var _0x1fdffd=ejs['render'](_0x1e31f3,{'contexts':_0x4e597b||[]});fs['writeFileSync'](_0xb56b('0x5c'),_0x1fdffd);})[_0xb56b('0x1d')](function(){return respondWithRpcPromise(_0xb56b('0x5d'),_0xb56b('0x66'),{'module':_0xb56b('0x5e')});})[_0xb56b('0x1d')](function(){return _0x38ae68;})['then'](respondWithResult(_0x2f9225,null))[_0xb56b('0x24')](handleError(_0x2f9225,null));};exports['destroy']=function(_0x12a8f7,_0x2ea1bb,_0x3e638b){var _0x22d111;return db['VoiceContext']['find']({'where':{'id':_0x12a8f7[_0xb56b('0x53')]['id']}})['then'](handleEntityNotFound(_0x2ea1bb,null))[_0xb56b('0x1d')](removeEntity(_0x2ea1bb,null))[_0xb56b('0x1d')](function(){return db[_0xb56b('0x39')][_0xb56b('0x50')]({'raw':!![]});})[_0xb56b('0x1d')](function(_0x361e0b){var _0x4eb5b8=fs[_0xb56b('0x58')](path[_0xb56b('0x67')](config[_0xb56b('0x59')],_0xb56b('0x5a')),'utf8');var _0x40d5af=ejs[_0xb56b('0x68')](_0x4eb5b8,{'contexts':_0x361e0b});fs[_0xb56b('0x69')](_0xb56b('0x5c'),_0x40d5af);return respondWithRpcPromise('Reload',_0xb56b('0x34'),{'module':'chan_sip.so'});})[_0xb56b('0x24')](handleError(_0x2ea1bb,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 10c456c..c72ddfd 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 _0x7a40=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceContext.attributes','exports','define','voice_contexts','lodash'];(function(_0x3fca48,_0x2bed07){var _0x8af281=function(_0x1ccd1c){while(--_0x1ccd1c){_0x3fca48['push'](_0x3fca48['shift']());}};_0x8af281(++_0x2bed07);}(_0x7a40,0x197));var _0x07a4=function(_0x51aad1,_0x5b625c){_0x51aad1=_0x51aad1-0x0;var _0x52c401=_0x7a40[_0x51aad1];return _0x52c401;};'use strict';var _=require(_0x07a4('0x0'));var util=require(_0x07a4('0x1'));var logger=require(_0x07a4('0x2'))('api');var moment=require(_0x07a4('0x3'));var BPromise=require(_0x07a4('0x4'));var rp=require(_0x07a4('0x5'));var fs=require('fs');var path=require(_0x07a4('0x6'));var rimraf=require(_0x07a4('0x7'));var config=require('../../config/environment');var attributes=require(_0x07a4('0x8'));module[_0x07a4('0x9')]=function(_0x3a53fb,_0x399d0f){return _0x3a53fb[_0x07a4('0xa')]('VoiceContext',attributes,{'tableName':_0x07a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3b1=['./voiceContext.attributes','exports','VoiceContext','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0xd95b29,_0x1c1831){var _0x38e058=function(_0x2084d6){while(--_0x2084d6){_0xd95b29['push'](_0xd95b29['shift']());}};_0x38e058(++_0x1c1831);}(_0xf3b1,0x1b1));var _0x1f3b=function(_0xb79225,_0x8df86a){_0xb79225=_0xb79225-0x0;var _0x4ca477=_0xf3b1[_0xb79225];return _0x4ca477;};'use strict';var _=require(_0x1f3b('0x0'));var util=require(_0x1f3b('0x1'));var logger=require('../../config/logger')(_0x1f3b('0x2'));var moment=require(_0x1f3b('0x3'));var BPromise=require('bluebird');var rp=require(_0x1f3b('0x4'));var fs=require('fs');var path=require(_0x1f3b('0x5'));var rimraf=require(_0x1f3b('0x6'));var config=require('../../config/environment');var attributes=require(_0x1f3b('0x7'));module[_0x1f3b('0x8')]=function(_0x4931b5,_0x43f36e){return _0x4931b5['define'](_0x1f3b('0x9'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 8b74aa6..c5bc083 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 _0xc493=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0xd65e0d,_0x15a204){var _0x218b10=function(_0x133e79){while(--_0x133e79){_0xd65e0d['push'](_0xd65e0d['shift']());}};_0x218b10(++_0x15a204);}(_0xc493,0x76));var _0x3c49=function(_0x3da675,_0x4b7c68){_0x3da675=_0x3da675-0x0;var _0x42e9ea=_0xc493[_0x3da675];return _0x42e9ea;};'use strict';var _=require(_0x3c49('0x0'));var util=require(_0x3c49('0x1'));var moment=require(_0x3c49('0x2'));var BPromise=require(_0x3c49('0x3'));var rs=require(_0x3c49('0x4'));var fs=require('fs');var Redis=require(_0x3c49('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c49('0x6'));var logger=require(_0x3c49('0x7'))(_0x3c49('0x8'));var config=require(_0x3c49('0x9'));var jayson=require(_0x3c49('0xa'));var client=jayson[_0x3c49('0xb')][_0x3c49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x24dbfa,_0x3a7e4f,_0x3b2cae){return new BPromise(function(_0x1f3310,_0x1a1c70){return client['request'](_0x24dbfa,_0x3b2cae)[_0x3c49('0xd')](function(_0x1607e1){logger[_0x3c49('0xe')](_0x3c49('0xf'),_0x3a7e4f,_0x3c49('0x10'));logger[_0x3c49('0x11')](_0x3c49('0x12'),_0x3a7e4f,_0x3c49('0x10'),JSON[_0x3c49('0x13')](_0x1607e1));if(_0x1607e1[_0x3c49('0x14')]){if(_0x1607e1['error'][_0x3c49('0x15')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x3a7e4f,_0x1607e1['error'][_0x3c49('0x16')]);return _0x1a1c70(_0x1607e1['error'][_0x3c49('0x16')]);}logger['error'](_0x3c49('0xf'),_0x3a7e4f,_0x1607e1['error']['message']);return _0x1f3310(_0x1607e1[_0x3c49('0x14')][_0x3c49('0x16')]);}else{logger['info'](_0x3c49('0xf'),_0x3a7e4f,_0x3c49('0x10'));_0x1f3310(_0x1607e1[_0x3c49('0x17')][_0x3c49('0x16')]);}})[_0x3c49('0x18')](function(_0x402df8){logger[_0x3c49('0x14')]('VoiceContext,\x20%s,\x20%s',_0x3a7e4f,_0x402df8);_0x1a1c70(_0x402df8);});});} \ No newline at end of file +var _0x3256=['stringify','error','code','VoiceContext,\x20%s,\x20%s','message','info','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0x2ab8f6,_0x36883e){var _0x454ed6=function(_0x416e89){while(--_0x416e89){_0x2ab8f6['push'](_0x2ab8f6['shift']());}};_0x454ed6(++_0x36883e);}(_0x3256,0xee));var _0x6325=function(_0x2de2a1,_0x4f61c3){_0x2de2a1=_0x2de2a1-0x0;var _0x17b417=_0x3256[_0x2de2a1];return _0x17b417;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6325('0x0'));var BPromise=require(_0x6325('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6325('0x2'));var db=require(_0x6325('0x3'))['db'];var utils=require(_0x6325('0x4'));var logger=require(_0x6325('0x5'))('rpc');var config=require(_0x6325('0x6'));var jayson=require(_0x6325('0x7'));var client=jayson[_0x6325('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cc7df,_0x4fcdb1,_0x517d18){return new BPromise(function(_0x2c45e1,_0x5ba6d1){return client[_0x6325('0x9')](_0x2cc7df,_0x517d18)[_0x6325('0xa')](function(_0x36ebb7){logger['info']('VoiceContext,\x20%s,\x20%s',_0x4fcdb1,_0x6325('0xb'));logger[_0x6325('0xc')](_0x6325('0xd'),_0x4fcdb1,_0x6325('0xb'),JSON[_0x6325('0xe')](_0x36ebb7));if(_0x36ebb7[_0x6325('0xf')]){if(_0x36ebb7[_0x6325('0xf')][_0x6325('0x10')]===0x1f4){logger[_0x6325('0xf')](_0x6325('0x11'),_0x4fcdb1,_0x36ebb7[_0x6325('0xf')][_0x6325('0x12')]);return _0x5ba6d1(_0x36ebb7['error']['message']);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x4fcdb1,_0x36ebb7[_0x6325('0xf')][_0x6325('0x12')]);return _0x2c45e1(_0x36ebb7[_0x6325('0xf')][_0x6325('0x12')]);}else{logger[_0x6325('0x13')](_0x6325('0x11'),_0x4fcdb1,_0x6325('0xb'));_0x2c45e1(_0x36ebb7['result'][_0x6325('0x12')]);}})[_0x6325('0x14')](function(_0x135fb6){logger[_0x6325('0xf')](_0x6325('0x11'),_0x4fcdb1,_0x135fb6);_0x5ba6d1(_0x135fb6);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index f87f38f..3b22e3e 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 _0x8d74=['create','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x4b9099,_0x1b05e5){var _0x4f7969=function(_0x40f70a){while(--_0x40f70a){_0x4b9099['push'](_0x4b9099['shift']());}};_0x4f7969(++_0x1b05e5);}(_0x8d74,0x16c));var _0x48d7=function(_0xc6839d,_0x344561){_0xc6839d=_0xc6839d-0x0;var _0x463b19=_0x8d74[_0xc6839d];return _0x463b19;};'use strict';var multer=require(_0x48d7('0x0'));var util=require(_0x48d7('0x1'));var path=require(_0x48d7('0x2'));var timeout=require(_0x48d7('0x3'));var express=require(_0x48d7('0x4'));var router=express[_0x48d7('0x5')]();var fs_extra=require(_0x48d7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x48d7('0x7'));var config=require('../../config/environment');var controller=require(_0x48d7('0x8'));router[_0x48d7('0x9')]('/',auth[_0x48d7('0xa')](),controller[_0x48d7('0xb')]);router['get'](_0x48d7('0xc'),auth[_0x48d7('0xa')](),controller[_0x48d7('0xd')]);router['get'](_0x48d7('0xe'),auth[_0x48d7('0xa')](),controller[_0x48d7('0xf')]);router['post']('/',auth[_0x48d7('0xa')](),controller[_0x48d7('0x10')]);router[_0x48d7('0x11')](_0x48d7('0xe'),auth[_0x48d7('0xa')](),controller[_0x48d7('0x12')]);router['delete'](_0x48d7('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2843=['./voiceDialReport.controller','get','isAuthenticated','index','describe','/:id','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x4fc5f8,_0x47e645){var _0x33be96=function(_0x470840){while(--_0x470840){_0x4fc5f8['push'](_0x4fc5f8['shift']());}};_0x33be96(++_0x47e645);}(_0x2843,0x6a));var _0x3284=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0x2843[_0x470bfb];return _0x2f5d97;};'use strict';var multer=require(_0x3284('0x0'));var util=require(_0x3284('0x1'));var path=require(_0x3284('0x2'));var timeout=require(_0x3284('0x3'));var express=require(_0x3284('0x4'));var router=express[_0x3284('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3284('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3284('0x7'));var controller=require(_0x3284('0x8'));router[_0x3284('0x9')]('/',auth[_0x3284('0xa')](),controller[_0x3284('0xb')]);router[_0x3284('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x3284('0xc')]);router['get'](_0x3284('0xd'),auth[_0x3284('0xa')](),controller['show']);router['post']('/',auth[_0x3284('0xa')](),controller[_0x3284('0xe')]);router[_0x3284('0xf')](_0x3284('0xd'),auth[_0x3284('0xa')](),controller[_0x3284('0x10')]);router[_0x3284('0x11')](_0x3284('0xd'),auth[_0x3284('0xa')](),controller['destroy']);module[_0x3284('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 34986a9..f31efe6 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 _0x00bb=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x3de623,_0x39cbcd){var _0x4f3522=function(_0x59111d){while(--_0x59111d){_0x3de623['push'](_0x3de623['shift']());}};_0x4f3522(++_0x39cbcd);}(_0x00bb,0x1d8));var _0xb00b=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x00bb[_0xb0f7c3];return _0x28ea68;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'privilege':{'type':Sequelize[_0xb00b('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xb00b('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb00b('0x2')]},'calleridname':{'type':Sequelize[_0xb00b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'language':{'type':Sequelize[_0xb00b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb00b('0x3')]},'uniqueid':{'type':Sequelize[_0xb00b('0x2')]},'linkedid':{'type':Sequelize[_0xb00b('0x2')]},'destchannel':{'type':Sequelize[_0xb00b('0x2')]},'destchannelstate':{'type':Sequelize[_0xb00b('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xb00b('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb00b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'destlanguage':{'type':Sequelize[_0xb00b('0x2')]},'destaccountcode':{'type':Sequelize[_0xb00b('0x2')]},'destcontext':{'type':Sequelize[_0xb00b('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb00b('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xb00b('0x2')]},'starttime':{'type':Sequelize[_0xb00b('0x4')]},'answertime':{'type':Sequelize[_0xb00b('0x4')]},'endtime':{'type':Sequelize[_0xb00b('0x4')]},'lastevent':{'type':Sequelize[_0xb00b('0x2')],'comment':_0xb00b('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xb00b('0x3')]},'holdtime':{'type':Sequelize[_0xb00b('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xd6d6=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x19311a,_0x2d2679){var _0x42617c=function(_0x43227d){while(--_0x43227d){_0x19311a['push'](_0x19311a['shift']());}};_0x42617c(++_0x2d2679);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x4f0808,_0x594e97){_0x4f0808=_0x4f0808-0x0;var _0x3b67cc=_0xd6d6[_0x4f0808];return _0x3b67cc;};'use strict';var Sequelize=require(_0x6d6d('0x0'));module[_0x6d6d('0x1')]={'privilege':{'type':Sequelize[_0x6d6d('0x2')]},'channel':{'type':Sequelize[_0x6d6d('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x6d6d('0x2')]},'calleridnum':{'type':Sequelize[_0x6d6d('0x2')]},'calleridname':{'type':Sequelize[_0x6d6d('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6d6d('0x2')]},'connectedlinename':{'type':Sequelize[_0x6d6d('0x2')]},'language':{'type':Sequelize[_0x6d6d('0x2')]},'accountcode':{'type':Sequelize[_0x6d6d('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x6d6d('0x2')]},'priority':{'type':Sequelize[_0x6d6d('0x3')]},'uniqueid':{'type':Sequelize[_0x6d6d('0x2')]},'linkedid':{'type':Sequelize[_0x6d6d('0x2')]},'destchannel':{'type':Sequelize[_0x6d6d('0x2')]},'destchannelstate':{'type':Sequelize[_0x6d6d('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x6d6d('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x6d6d('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x6d6d('0x2')]},'destlanguage':{'type':Sequelize[_0x6d6d('0x2')]},'destaccountcode':{'type':Sequelize[_0x6d6d('0x2')]},'destcontext':{'type':Sequelize[_0x6d6d('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x6d6d('0x3')]},'destuniqueid':{'type':Sequelize[_0x6d6d('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x6d6d('0x2')]},'starttime':{'type':Sequelize[_0x6d6d('0x4')]},'answertime':{'type':Sequelize[_0x6d6d('0x4')]},'endtime':{'type':Sequelize[_0x6d6d('0x4')]},'lastevent':{'type':Sequelize[_0x6d6d('0x2')],'comment':_0x6d6d('0x5')},'routeId':{'type':Sequelize[_0x6d6d('0x3')]},'duration':{'type':Sequelize[_0x6d6d('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x6d6d('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index f1c595f..7958e81 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 _0xe2e3=['querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceDialReport','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','params','keys','rawAttributes','fields','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x4ef734,_0x5826d){var _0x33a7cb=function(_0x127a2b){while(--_0x127a2b){_0x4ef734['push'](_0x4ef734['shift']());}};_0x33a7cb(++_0x5826d);}(_0xe2e3,0xd9));var _0x3e2e=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0xe2e3[_0xac151d];return _0x111dba;};'use strict';var emlformat=require(_0x3e2e('0x0'));var rimraf=require(_0x3e2e('0x1'));var zipdir=require(_0x3e2e('0x2'));var jsonpatch=require(_0x3e2e('0x3'));var rp=require('request-promise');var moment=require(_0x3e2e('0x4'));var BPromise=require(_0x3e2e('0x5'));var Mustache=require(_0x3e2e('0x6'));var util=require(_0x3e2e('0x7'));var path=require('path');var sox=require(_0x3e2e('0x8'));var csv=require(_0x3e2e('0x9'));var ejs=require(_0x3e2e('0xa'));var fs=require('fs');var fs_extra=require(_0x3e2e('0xb'));var _=require(_0x3e2e('0xc'));var squel=require(_0x3e2e('0xd'));var crypto=require(_0x3e2e('0xe'));var jsforce=require(_0x3e2e('0xf'));var deskjs=require(_0x3e2e('0x10'));var toCsv=require(_0x3e2e('0x9'));var querystring=require(_0x3e2e('0x11'));var Papa=require('papaparse');var Redis=require(_0x3e2e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3e2e('0x13'));var as=require(_0x3e2e('0x14'));var hardwareService=require(_0x3e2e('0x15'));var logger=require('../../config/logger')(_0x3e2e('0x16'));var utils=require('../../config/utils');var config=require(_0x3e2e('0x17'));var licenseUtil=require(_0x3e2e('0x18'));var db=require(_0x3e2e('0x19'))['db'];function respondWithStatusCode(_0x1d0abe,_0x14abba){_0x14abba=_0x14abba||0xcc;return function(_0x1a7fd0){if(_0x1a7fd0){return _0x1d0abe['sendStatus'](_0x14abba);}return _0x1d0abe['status'](_0x14abba)[_0x3e2e('0x1a')]();};}function respondWithResult(_0x8258ae,_0x3a5dae){_0x3a5dae=_0x3a5dae||0xc8;return function(_0x33995f){if(_0x33995f){return _0x8258ae[_0x3e2e('0x1b')](_0x3a5dae)[_0x3e2e('0x1c')](_0x33995f);}};}function respondWithFilteredResult(_0x148779,_0x5d3ddc){return function(_0x398226){if(_0x398226){var _0x5576ae=typeof _0x5d3ddc['offset']==='undefined'&&typeof _0x5d3ddc[_0x3e2e('0x1d')]===_0x3e2e('0x1e');var _0x63c2e6=_0x398226[_0x3e2e('0x1f')];var _0x2f5296=_0x5576ae?0x0:_0x5d3ddc[_0x3e2e('0x20')];var _0x10da0=_0x5576ae?_0x398226[_0x3e2e('0x1f')]:_0x5d3ddc[_0x3e2e('0x20')]+_0x5d3ddc[_0x3e2e('0x1d')];var _0x3f0c46;if(_0x10da0>=_0x63c2e6){_0x10da0=_0x63c2e6;_0x3f0c46=0xc8;}else{_0x3f0c46=0xce;}_0x148779[_0x3e2e('0x1b')](_0x3f0c46);return _0x148779[_0x3e2e('0x21')](_0x3e2e('0x22'),_0x2f5296+'-'+_0x10da0+'/'+_0x63c2e6)[_0x3e2e('0x1c')](_0x398226);}return null;};}function patchUpdates(_0x53b532){return function(_0x4c771b){try{jsonpatch[_0x3e2e('0x23')](_0x4c771b,_0x53b532,!![]);}catch(_0x1e18a5){return BPromise[_0x3e2e('0x24')](_0x1e18a5);}return _0x4c771b[_0x3e2e('0x25')]();};}function saveUpdates(_0x469380,_0x2ef273){return function(_0x58fc76){if(_0x58fc76){return _0x58fc76[_0x3e2e('0x26')](_0x469380)[_0x3e2e('0x27')](function(_0x452456){return _0x452456;});}return null;};}function removeEntity(_0x390297,_0x5e354e){return function(_0x1bff0b){if(_0x1bff0b){return _0x1bff0b[_0x3e2e('0x28')]()['then'](function(){_0x390297[_0x3e2e('0x1b')](0xcc)[_0x3e2e('0x1a')]();});}};}function handleEntityNotFound(_0x180f0a,_0x524c0b){return function(_0x86fc29){if(!_0x86fc29){_0x180f0a['sendStatus'](0x194);}return _0x86fc29;};}function handleError(_0x10332f,_0x50ecb8){_0x50ecb8=_0x50ecb8||0x1f4;return function(_0x4c5c59){logger[_0x3e2e('0x29')](_0x4c5c59[_0x3e2e('0x2a')]);if(_0x4c5c59['name']){delete _0x4c5c59[_0x3e2e('0x2b')];}_0x10332f[_0x3e2e('0x1b')](_0x50ecb8)[_0x3e2e('0x2c')](_0x4c5c59);};}exports[_0x3e2e('0x2d')]=function(_0x5d047e,_0x480bae){var _0x2b2592={},_0x5018a0={},_0x53b4b6={'count':0x0,'rows':[]};var _0x171c52=_[_0x3e2e('0x2e')](db[_0x3e2e('0x2f')]['rawAttributes'],function(_0x2e6afe){return{'name':_0x2e6afe['fieldName'],'type':_0x2e6afe['type'][_0x3e2e('0x30')]};});_0x5018a0[_0x3e2e('0x31')]=_[_0x3e2e('0x2e')](_0x171c52,_0x3e2e('0x2b'));_0x5018a0['query']=_['keys'](_0x5d047e[_0x3e2e('0x32')]);_0x5018a0[_0x3e2e('0x33')]=_[_0x3e2e('0x34')](_0x5018a0[_0x3e2e('0x31')],_0x5018a0[_0x3e2e('0x32')]);_0x2b2592[_0x3e2e('0x35')]=_['intersection'](_0x5018a0['model'],qs['fields'](_0x5d047e['query']['fields']));_0x2b2592[_0x3e2e('0x35')]=_0x2b2592['attributes'][_0x3e2e('0x36')]?_0x2b2592['attributes']:_0x5018a0[_0x3e2e('0x31')];if(!_0x5d047e[_0x3e2e('0x32')][_0x3e2e('0x37')](_0x3e2e('0x38'))){_0x2b2592[_0x3e2e('0x1d')]=qs[_0x3e2e('0x1d')](_0x5d047e['query'][_0x3e2e('0x1d')]);_0x2b2592['offset']=qs[_0x3e2e('0x20')](_0x5d047e[_0x3e2e('0x32')]['offset']);}_0x2b2592[_0x3e2e('0x39')]=qs[_0x3e2e('0x3a')](_0x5d047e[_0x3e2e('0x32')][_0x3e2e('0x3a')]);_0x2b2592[_0x3e2e('0x3b')]=qs[_0x3e2e('0x33')](_[_0x3e2e('0x3c')](_0x5d047e[_0x3e2e('0x32')],_0x5018a0['filters']),_0x171c52);if(_0x5d047e[_0x3e2e('0x32')][_0x3e2e('0x3d')]){_0x2b2592[_0x3e2e('0x3b')]=_[_0x3e2e('0x3e')](_0x2b2592[_0x3e2e('0x3b')],{'$or':_[_0x3e2e('0x2e')](_0x171c52,function(_0x59ab56){if(_0x59ab56[_0x3e2e('0x3f')]!==_0x3e2e('0x40')){var _0x58f097={};_0x58f097[_0x59ab56[_0x3e2e('0x2b')]]={'$like':'%'+_0x5d047e[_0x3e2e('0x32')][_0x3e2e('0x3d')]+'%'};return _0x58f097;}})});}_0x2b2592=_['merge']({},_0x2b2592,_0x5d047e[_0x3e2e('0x41')]);var _0x210ad2={'where':_0x2b2592[_0x3e2e('0x3b')]};return db[_0x3e2e('0x2f')][_0x3e2e('0x1f')](_0x210ad2)[_0x3e2e('0x27')](function(_0x5e9875){_0x53b4b6[_0x3e2e('0x1f')]=_0x5e9875;if(_0x5d047e[_0x3e2e('0x32')][_0x3e2e('0x42')]){_0x2b2592[_0x3e2e('0x43')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x2b2592);})[_0x3e2e('0x27')](function(_0x4e9140){_0x53b4b6[_0x3e2e('0x44')]=_0x4e9140;return _0x53b4b6;})['then'](respondWithFilteredResult(_0x480bae,_0x2b2592))['catch'](handleError(_0x480bae,null));};exports['show']=function(_0x31dbf6,_0x400e3d){var _0x1fa32f={'raw':!![],'where':{'id':_0x31dbf6[_0x3e2e('0x45')]['id']}},_0x4a9411={};_0x4a9411['model']=_[_0x3e2e('0x46')](db[_0x3e2e('0x2f')][_0x3e2e('0x47')]);_0x4a9411[_0x3e2e('0x32')]=_[_0x3e2e('0x46')](_0x31dbf6[_0x3e2e('0x32')]);_0x4a9411[_0x3e2e('0x33')]=_[_0x3e2e('0x34')](_0x4a9411[_0x3e2e('0x31')],_0x4a9411[_0x3e2e('0x32')]);_0x1fa32f[_0x3e2e('0x35')]=_['intersection'](_0x4a9411[_0x3e2e('0x31')],qs[_0x3e2e('0x48')](_0x31dbf6[_0x3e2e('0x32')][_0x3e2e('0x48')]));_0x1fa32f[_0x3e2e('0x35')]=_0x1fa32f[_0x3e2e('0x35')][_0x3e2e('0x36')]?_0x1fa32f['attributes']:_0x4a9411[_0x3e2e('0x31')];if(_0x31dbf6[_0x3e2e('0x32')][_0x3e2e('0x42')]){_0x1fa32f[_0x3e2e('0x43')]=[{'all':!![]}];}_0x1fa32f=_[_0x3e2e('0x3e')]({},_0x1fa32f,_0x31dbf6[_0x3e2e('0x41')]);return db['VoiceDialReport'][_0x3e2e('0x49')](_0x1fa32f)[_0x3e2e('0x27')](handleEntityNotFound(_0x400e3d,null))[_0x3e2e('0x27')](respondWithResult(_0x400e3d,null))['catch'](handleError(_0x400e3d,null));};exports['create']=function(_0x12b6eb,_0x100d87){return db[_0x3e2e('0x2f')][_0x3e2e('0x4a')](_0x12b6eb[_0x3e2e('0x4b')],{})[_0x3e2e('0x27')](respondWithResult(_0x100d87,0xc9))['catch'](handleError(_0x100d87,null));};exports[_0x3e2e('0x26')]=function(_0x4deb09,_0x59212e){if(_0x4deb09[_0x3e2e('0x4b')]['id']){delete _0x4deb09[_0x3e2e('0x4b')]['id'];}return db[_0x3e2e('0x2f')][_0x3e2e('0x49')]({'where':{'id':_0x4deb09[_0x3e2e('0x45')]['id']}})[_0x3e2e('0x27')](handleEntityNotFound(_0x59212e,null))[_0x3e2e('0x27')](saveUpdates(_0x4deb09[_0x3e2e('0x4b')],null))[_0x3e2e('0x27')](respondWithResult(_0x59212e,null))['catch'](handleError(_0x59212e,null));};exports[_0x3e2e('0x28')]=function(_0x3c5903,_0x47ff06){return db[_0x3e2e('0x2f')][_0x3e2e('0x49')]({'where':{'id':_0x3c5903[_0x3e2e('0x45')]['id']}})[_0x3e2e('0x27')](handleEntityNotFound(_0x47ff06,null))[_0x3e2e('0x27')](removeEntity(_0x47ff06,null))[_0x3e2e('0x4c')](handleError(_0x47ff06,null));};exports[_0x3e2e('0x4d')]=function(_0x1e3d1e,_0x5a5a6f){return db[_0x3e2e('0x2f')][_0x3e2e('0x4d')]()[_0x3e2e('0x27')](respondWithResult(_0x5a5a6f,null))['catch'](handleError(_0x5a5a6f,null));}; \ No newline at end of file +var _0xddb8=['fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','VoiceDialReport','rawAttributes','fieldName','type','key','model','map','filters','intersection','query','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','params','keys','include','find','catch','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x5e2a11,_0xa5534){var _0x1d12f1=function(_0x164128){while(--_0x164128){_0x5e2a11['push'](_0x5e2a11['shift']());}};_0x1d12f1(++_0xa5534);}(_0xddb8,0x17f));var _0x8ddb=function(_0x27ac14,_0x366181){_0x27ac14=_0x27ac14-0x0;var _0x214cff=_0xddb8[_0x27ac14];return _0x214cff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ddb('0x0'));var zipdir=require(_0x8ddb('0x1'));var jsonpatch=require(_0x8ddb('0x2'));var rp=require(_0x8ddb('0x3'));var moment=require(_0x8ddb('0x4'));var BPromise=require(_0x8ddb('0x5'));var Mustache=require(_0x8ddb('0x6'));var util=require(_0x8ddb('0x7'));var path=require(_0x8ddb('0x8'));var sox=require(_0x8ddb('0x9'));var csv=require(_0x8ddb('0xa'));var ejs=require(_0x8ddb('0xb'));var fs=require('fs');var fs_extra=require(_0x8ddb('0xc'));var _=require(_0x8ddb('0xd'));var squel=require(_0x8ddb('0xe'));var crypto=require(_0x8ddb('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8ddb('0x10'));var toCsv=require(_0x8ddb('0xa'));var querystring=require(_0x8ddb('0x11'));var Papa=require(_0x8ddb('0x12'));var Redis=require(_0x8ddb('0x13'));var authService=require(_0x8ddb('0x14'));var qs=require(_0x8ddb('0x15'));var as=require(_0x8ddb('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8ddb('0x17'));var utils=require(_0x8ddb('0x18'));var config=require(_0x8ddb('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8ddb('0x1a'))['db'];function respondWithStatusCode(_0x5422eb,_0xe6bb78){_0xe6bb78=_0xe6bb78||0xcc;return function(_0x255ee1){if(_0x255ee1){return _0x5422eb[_0x8ddb('0x1b')](_0xe6bb78);}return _0x5422eb['status'](_0xe6bb78)[_0x8ddb('0x1c')]();};}function respondWithResult(_0x24585a,_0x414161){_0x414161=_0x414161||0xc8;return function(_0x43fc23){if(_0x43fc23){return _0x24585a[_0x8ddb('0x1d')](_0x414161)[_0x8ddb('0x1e')](_0x43fc23);}};}function respondWithFilteredResult(_0x14cd7b,_0x44a24d){return function(_0x8a6eeb){if(_0x8a6eeb){var _0x48ec14=typeof _0x44a24d[_0x8ddb('0x1f')]===_0x8ddb('0x20')&&typeof _0x44a24d[_0x8ddb('0x21')]===_0x8ddb('0x20');var _0x3db0b6=_0x8a6eeb[_0x8ddb('0x22')];var _0x4e3909=_0x48ec14?0x0:_0x44a24d['offset'];var _0x2cd7fd=_0x48ec14?_0x8a6eeb['count']:_0x44a24d['offset']+_0x44a24d[_0x8ddb('0x21')];var _0x1aa7a9;if(_0x2cd7fd>=_0x3db0b6){_0x2cd7fd=_0x3db0b6;_0x1aa7a9=0xc8;}else{_0x1aa7a9=0xce;}_0x14cd7b['status'](_0x1aa7a9);return _0x14cd7b[_0x8ddb('0x23')](_0x8ddb('0x24'),_0x4e3909+'-'+_0x2cd7fd+'/'+_0x3db0b6)['json'](_0x8a6eeb);}return null;};}function patchUpdates(_0x40b58c){return function(_0x17c5ff){try{jsonpatch[_0x8ddb('0x25')](_0x17c5ff,_0x40b58c,!![]);}catch(_0x4d91ec){return BPromise[_0x8ddb('0x26')](_0x4d91ec);}return _0x17c5ff[_0x8ddb('0x27')]();};}function saveUpdates(_0x5d5f26,_0x242cbb){return function(_0x526b3e){if(_0x526b3e){return _0x526b3e[_0x8ddb('0x28')](_0x5d5f26)[_0x8ddb('0x29')](function(_0x510ca9){return _0x510ca9;});}return null;};}function removeEntity(_0x369dc0,_0x4b2154){return function(_0xbd9f03){if(_0xbd9f03){return _0xbd9f03['destroy']()['then'](function(){_0x369dc0[_0x8ddb('0x1d')](0xcc)[_0x8ddb('0x1c')]();});}};}function handleEntityNotFound(_0x21173f,_0x213c47){return function(_0x3194fa){if(!_0x3194fa){_0x21173f[_0x8ddb('0x1b')](0x194);}return _0x3194fa;};}function handleError(_0x3cd6a9,_0x43b8d5){_0x43b8d5=_0x43b8d5||0x1f4;return function(_0x2d3277){logger['error'](_0x2d3277[_0x8ddb('0x2a')]);if(_0x2d3277[_0x8ddb('0x2b')]){delete _0x2d3277[_0x8ddb('0x2b')];}_0x3cd6a9[_0x8ddb('0x1d')](_0x43b8d5)[_0x8ddb('0x2c')](_0x2d3277);};}exports[_0x8ddb('0x2d')]=function(_0x2b49fa,_0x6f7727){var _0x4c9339={},_0x50856e={},_0x31f2d1={'count':0x0,'rows':[]};var _0x179063=_['map'](db[_0x8ddb('0x2e')][_0x8ddb('0x2f')],function(_0x1e97b8){return{'name':_0x1e97b8[_0x8ddb('0x30')],'type':_0x1e97b8[_0x8ddb('0x31')][_0x8ddb('0x32')]};});_0x50856e[_0x8ddb('0x33')]=_[_0x8ddb('0x34')](_0x179063,_0x8ddb('0x2b'));_0x50856e['query']=_['keys'](_0x2b49fa['query']);_0x50856e[_0x8ddb('0x35')]=_[_0x8ddb('0x36')](_0x50856e[_0x8ddb('0x33')],_0x50856e[_0x8ddb('0x37')]);_0x4c9339['attributes']=_[_0x8ddb('0x36')](_0x50856e['model'],qs[_0x8ddb('0x38')](_0x2b49fa[_0x8ddb('0x37')]['fields']));_0x4c9339['attributes']=_0x4c9339[_0x8ddb('0x39')][_0x8ddb('0x3a')]?_0x4c9339[_0x8ddb('0x39')]:_0x50856e[_0x8ddb('0x33')];if(!_0x2b49fa[_0x8ddb('0x37')][_0x8ddb('0x3b')]('nolimit')){_0x4c9339['limit']=qs[_0x8ddb('0x21')](_0x2b49fa['query'][_0x8ddb('0x21')]);_0x4c9339[_0x8ddb('0x1f')]=qs[_0x8ddb('0x1f')](_0x2b49fa[_0x8ddb('0x37')][_0x8ddb('0x1f')]);}_0x4c9339['order']=qs[_0x8ddb('0x3c')](_0x2b49fa[_0x8ddb('0x37')][_0x8ddb('0x3c')]);_0x4c9339['where']=qs[_0x8ddb('0x35')](_[_0x8ddb('0x3d')](_0x2b49fa['query'],_0x50856e[_0x8ddb('0x35')]),_0x179063);if(_0x2b49fa['query'][_0x8ddb('0x3e')]){_0x4c9339[_0x8ddb('0x3f')]=_['merge'](_0x4c9339['where'],{'$or':_[_0x8ddb('0x34')](_0x179063,function(_0x37b568){if(_0x37b568[_0x8ddb('0x31')]!==_0x8ddb('0x40')){var _0x4abc1d={};_0x4abc1d[_0x37b568[_0x8ddb('0x2b')]]={'$like':'%'+_0x2b49fa[_0x8ddb('0x37')][_0x8ddb('0x3e')]+'%'};return _0x4abc1d;}})});}_0x4c9339=_[_0x8ddb('0x41')]({},_0x4c9339,_0x2b49fa[_0x8ddb('0x42')]);var _0x2671b7={'where':_0x4c9339[_0x8ddb('0x3f')]};return db['VoiceDialReport'][_0x8ddb('0x22')](_0x2671b7)[_0x8ddb('0x29')](function(_0x1ab9ba){_0x31f2d1[_0x8ddb('0x22')]=_0x1ab9ba;if(_0x2b49fa['query'][_0x8ddb('0x43')]){_0x4c9339['include']=[{'all':!![]}];}return db[_0x8ddb('0x2e')][_0x8ddb('0x44')](_0x4c9339);})[_0x8ddb('0x29')](function(_0xf28d17){_0x31f2d1[_0x8ddb('0x45')]=_0xf28d17;return _0x31f2d1;})[_0x8ddb('0x29')](respondWithFilteredResult(_0x6f7727,_0x4c9339))['catch'](handleError(_0x6f7727,null));};exports['show']=function(_0x3ddc17,_0x4be48a){var _0x5b10be={'raw':!![],'where':{'id':_0x3ddc17[_0x8ddb('0x46')]['id']}},_0x483af2={};_0x483af2[_0x8ddb('0x33')]=_[_0x8ddb('0x47')](db[_0x8ddb('0x2e')][_0x8ddb('0x2f')]);_0x483af2[_0x8ddb('0x37')]=_[_0x8ddb('0x47')](_0x3ddc17['query']);_0x483af2[_0x8ddb('0x35')]=_[_0x8ddb('0x36')](_0x483af2[_0x8ddb('0x33')],_0x483af2[_0x8ddb('0x37')]);_0x5b10be[_0x8ddb('0x39')]=_['intersection'](_0x483af2[_0x8ddb('0x33')],qs[_0x8ddb('0x38')](_0x3ddc17[_0x8ddb('0x37')][_0x8ddb('0x38')]));_0x5b10be[_0x8ddb('0x39')]=_0x5b10be[_0x8ddb('0x39')][_0x8ddb('0x3a')]?_0x5b10be[_0x8ddb('0x39')]:_0x483af2[_0x8ddb('0x33')];if(_0x3ddc17[_0x8ddb('0x37')][_0x8ddb('0x43')]){_0x5b10be[_0x8ddb('0x48')]=[{'all':!![]}];}_0x5b10be=_[_0x8ddb('0x41')]({},_0x5b10be,_0x3ddc17['options']);return db[_0x8ddb('0x2e')][_0x8ddb('0x49')](_0x5b10be)[_0x8ddb('0x29')](handleEntityNotFound(_0x4be48a,null))['then'](respondWithResult(_0x4be48a,null))[_0x8ddb('0x4a')](handleError(_0x4be48a,null));};exports[_0x8ddb('0x4b')]=function(_0x14d5eb,_0x23366b){return db[_0x8ddb('0x2e')]['create'](_0x14d5eb['body'],{})['then'](respondWithResult(_0x23366b,0xc9))[_0x8ddb('0x4a')](handleError(_0x23366b,null));};exports[_0x8ddb('0x28')]=function(_0x39dbdb,_0x135c21){if(_0x39dbdb[_0x8ddb('0x4c')]['id']){delete _0x39dbdb[_0x8ddb('0x4c')]['id'];}return db[_0x8ddb('0x2e')][_0x8ddb('0x49')]({'where':{'id':_0x39dbdb[_0x8ddb('0x46')]['id']}})[_0x8ddb('0x29')](handleEntityNotFound(_0x135c21,null))[_0x8ddb('0x29')](saveUpdates(_0x39dbdb['body'],null))[_0x8ddb('0x29')](respondWithResult(_0x135c21,null))[_0x8ddb('0x4a')](handleError(_0x135c21,null));};exports[_0x8ddb('0x4d')]=function(_0x44852c,_0x41b4b8){return db['VoiceDialReport'][_0x8ddb('0x49')]({'where':{'id':_0x44852c['params']['id']}})[_0x8ddb('0x29')](handleEntityNotFound(_0x41b4b8,null))[_0x8ddb('0x29')](removeEntity(_0x41b4b8,null))[_0x8ddb('0x4a')](handleError(_0x41b4b8,null));};exports[_0x8ddb('0x4e')]=function(_0xdbc20d,_0xfa7215){return db[_0x8ddb('0x2e')]['describe']()[_0x8ddb('0x29')](respondWithResult(_0xfa7215,null))[_0x8ddb('0x4a')](handleError(_0xfa7215,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 0ba2561..c67e533 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 _0x11c3=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceDialReport','report_dial','uniqueid'];(function(_0x68f205,_0x34263f){var _0x4225ee=function(_0xf494d6){while(--_0xf494d6){_0x68f205['push'](_0x68f205['shift']());}};_0x4225ee(++_0x34263f);}(_0x11c3,0x179));var _0x311c=function(_0x2c94a3,_0x44baeb){_0x2c94a3=_0x2c94a3-0x0;var _0x5c03e5=_0x11c3[_0x2c94a3];return _0x5c03e5;};'use strict';var _=require(_0x311c('0x0'));var util=require('util');var logger=require(_0x311c('0x1'))(_0x311c('0x2'));var moment=require('moment');var BPromise=require(_0x311c('0x3'));var rp=require(_0x311c('0x4'));var fs=require('fs');var path=require(_0x311c('0x5'));var rimraf=require(_0x311c('0x6'));var config=require(_0x311c('0x7'));var attributes=require('./voiceDialReport.attributes');module[_0x311c('0x8')]=function(_0x366840,_0x32fcf4){return _0x366840[_0x311c('0x9')](_0x311c('0xa'),attributes,{'tableName':_0x311c('0xb'),'paranoid':![],'indexes':[{'fields':[_0x311c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x17a0=['./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x3e99cb,_0x1d2fe0){var _0x1bc729=function(_0x40006f){while(--_0x40006f){_0x3e99cb['push'](_0x3e99cb['shift']());}};_0x1bc729(++_0x1d2fe0);}(_0x17a0,0x165));var _0x017a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x17a0[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0x017a('0x0'));var logger=require(_0x017a('0x1'))(_0x017a('0x2'));var moment=require('moment');var BPromise=require(_0x017a('0x3'));var rp=require(_0x017a('0x4'));var fs=require('fs');var path=require(_0x017a('0x5'));var rimraf=require(_0x017a('0x6'));var config=require('../../config/environment');var attributes=require(_0x017a('0x7'));module[_0x017a('0x8')]=function(_0x3fccd9,_0x8d767f){return _0x3fccd9[_0x017a('0x9')](_0x017a('0xa'),attributes,{'tableName':_0x017a('0xb'),'paranoid':![],'indexes':[{'fields':[_0x017a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 973dc21..70fc684 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 _0xec31=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','message','VoiceDialReport,\x20%s,\x20%s','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','limit','util','moment','bluebird','randomstring','ioredis'];(function(_0x4ae514,_0x501771){var _0x283d2b=function(_0x116dae){while(--_0x116dae){_0x4ae514['push'](_0x4ae514['shift']());}};_0x283d2b(++_0x501771);}(_0xec31,0x157));var _0x1ec3=function(_0x3acb89,_0x2ca05e){_0x3acb89=_0x3acb89-0x0;var _0x4d38f2=_0xec31[_0x3acb89];return _0x4d38f2;};'use strict';var _=require('lodash');var util=require(_0x1ec3('0x0'));var moment=require(_0x1ec3('0x1'));var BPromise=require(_0x1ec3('0x2'));var rs=require(_0x1ec3('0x3'));var fs=require('fs');var Redis=require(_0x1ec3('0x4'));var db=require(_0x1ec3('0x5'))['db'];var utils=require(_0x1ec3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1ec3('0x7'));var jayson=require(_0x1ec3('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x504a56,_0x4090b0,_0x530baf){return new BPromise(function(_0x55aa14,_0x46d04b){return client[_0x1ec3('0x9')](_0x504a56,_0x530baf)[_0x1ec3('0xa')](function(_0x34693f){logger[_0x1ec3('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x4090b0,_0x1ec3('0xc'));logger[_0x1ec3('0xd')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x4090b0,_0x1ec3('0xc'),JSON[_0x1ec3('0xe')](_0x34693f));if(_0x34693f[_0x1ec3('0xf')]){if(_0x34693f[_0x1ec3('0xf')]['code']===0x1f4){logger[_0x1ec3('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x4090b0,_0x34693f[_0x1ec3('0xf')][_0x1ec3('0x10')]);return _0x46d04b(_0x34693f[_0x1ec3('0xf')][_0x1ec3('0x10')]);}logger[_0x1ec3('0xf')](_0x1ec3('0x11'),_0x4090b0,_0x34693f['error']['message']);return _0x55aa14(_0x34693f[_0x1ec3('0xf')][_0x1ec3('0x10')]);}else{logger[_0x1ec3('0xb')](_0x1ec3('0x11'),_0x4090b0,_0x1ec3('0xc'));_0x55aa14(_0x34693f[_0x1ec3('0x12')][_0x1ec3('0x10')]);}})[_0x1ec3('0x13')](function(_0xeacbb2){logger[_0x1ec3('0xf')](_0x1ec3('0x11'),_0x4090b0,_0xeacbb2);_0x46d04b(_0xeacbb2);});});}exports[_0x1ec3('0x14')]=function(_0x4a464f){var _0x1b108b=this;return new Promise(function(_0x1080c5,_0x267f04){return db[_0x1ec3('0x15')][_0x1ec3('0x16')](_0x4a464f[_0x1ec3('0x17')],{'raw':_0x4a464f[_0x1ec3('0x18')]?_0x4a464f['options'][_0x1ec3('0x19')]===undefined?!![]:![]:!![]})[_0x1ec3('0xa')](function(_0x5974c3){logger[_0x1ec3('0xb')]('CreateVoiceDialReport',_0x4a464f);logger[_0x1ec3('0xd')](_0x1ec3('0x14'),_0x4a464f,JSON['stringify'](_0x5974c3));_0x1080c5(_0x5974c3);})[_0x1ec3('0x13')](function(_0x22e256){logger[_0x1ec3('0xf')]('CreateVoiceDialReport',_0x22e256[_0x1ec3('0x10')],_0x4a464f);_0x267f04(_0x1b108b['error'](0x1f4,_0x22e256['message']));});});};exports[_0x1ec3('0x1a')]=function(_0xb2390e){var _0x1c0eba=this;return new Promise(function(_0x186452,_0xfc59b5){return db[_0x1ec3('0x15')][_0x1ec3('0x1b')](_0xb2390e[_0x1ec3('0x17')],{'raw':_0xb2390e[_0x1ec3('0x18')]?_0xb2390e[_0x1ec3('0x18')][_0x1ec3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb2390e[_0x1ec3('0x18')]?_0xb2390e[_0x1ec3('0x18')]['where']||null:null,'attributes':_0xb2390e['options']?_0xb2390e[_0x1ec3('0x18')]['attributes']||null:null,'limit':_0xb2390e[_0x1ec3('0x18')]?_0xb2390e[_0x1ec3('0x18')][_0x1ec3('0x1c')]||null:null})[_0x1ec3('0xa')](function(_0x558be4){logger[_0x1ec3('0xb')](_0x1ec3('0x1a'),_0xb2390e);logger[_0x1ec3('0xd')](_0x1ec3('0x1a'),_0xb2390e,JSON[_0x1ec3('0xe')](_0x558be4));_0x186452(_0x558be4);})[_0x1ec3('0x13')](function(_0x62eed2){logger['error'](_0x1ec3('0x1a'),_0x62eed2['message'],_0xb2390e);_0xfc59b5(_0x1c0eba['error'](0x1f4,_0x62eed2[_0x1ec3('0x10')]));});});}; \ No newline at end of file +var _0x71da=['limit','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateVoiceDialReport','options','then','debug','UpdateVoiceDialReport','VoiceDialReport','update','body','raw','where','attributes'];(function(_0x5c2680,_0x410a0c){var _0x3a52f0=function(_0x27fb6c){while(--_0x27fb6c){_0x5c2680['push'](_0x5c2680['shift']());}};_0x3a52f0(++_0x410a0c);}(_0x71da,0xbb));var _0xa71d=function(_0x2aaa60,_0x22258f){_0x2aaa60=_0x2aaa60-0x0;var _0x2e3fa5=_0x71da[_0x2aaa60];return _0x2e3fa5;};'use strict';var _=require('lodash');var util=require(_0xa71d('0x0'));var moment=require(_0xa71d('0x1'));var BPromise=require(_0xa71d('0x2'));var rs=require(_0xa71d('0x3'));var fs=require('fs');var Redis=require(_0xa71d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa71d('0x5'));var logger=require('../../config/logger')(_0xa71d('0x6'));var config=require(_0xa71d('0x7'));var jayson=require(_0xa71d('0x8'));var client=jayson['client'][_0xa71d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11ec52,_0x52a5e7,_0x395f64){return new BPromise(function(_0x36e541,_0x47a30b){return client['request'](_0x11ec52,_0x395f64)['then'](function(_0x2fcd19){logger['info'](_0xa71d('0xa'),_0x52a5e7,_0xa71d('0xb'));logger['debug'](_0xa71d('0xc'),_0x52a5e7,_0xa71d('0xb'),JSON[_0xa71d('0xd')](_0x2fcd19));if(_0x2fcd19[_0xa71d('0xe')]){if(_0x2fcd19['error']['code']===0x1f4){logger[_0xa71d('0xe')](_0xa71d('0xa'),_0x52a5e7,_0x2fcd19[_0xa71d('0xe')]['message']);return _0x47a30b(_0x2fcd19['error'][_0xa71d('0xf')]);}logger[_0xa71d('0xe')](_0xa71d('0xa'),_0x52a5e7,_0x2fcd19[_0xa71d('0xe')][_0xa71d('0xf')]);return _0x36e541(_0x2fcd19[_0xa71d('0xe')][_0xa71d('0xf')]);}else{logger[_0xa71d('0x10')](_0xa71d('0xa'),_0x52a5e7,_0xa71d('0xb'));_0x36e541(_0x2fcd19[_0xa71d('0x11')][_0xa71d('0xf')]);}})[_0xa71d('0x12')](function(_0x42dc86){logger[_0xa71d('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x52a5e7,_0x42dc86);_0x47a30b(_0x42dc86);});});}exports[_0xa71d('0x13')]=function(_0xd59139){var _0x25c3d6=this;return new Promise(function(_0x2ae450,_0x3e5269){return db['VoiceDialReport']['create'](_0xd59139['body'],{'raw':_0xd59139[_0xa71d('0x14')]?_0xd59139[_0xa71d('0x14')]['raw']===undefined?!![]:![]:!![]})[_0xa71d('0x15')](function(_0x303e40){logger['info']('CreateVoiceDialReport',_0xd59139);logger[_0xa71d('0x16')](_0xa71d('0x13'),_0xd59139,JSON[_0xa71d('0xd')](_0x303e40));_0x2ae450(_0x303e40);})['catch'](function(_0x5055ca){logger[_0xa71d('0xe')](_0xa71d('0x13'),_0x5055ca[_0xa71d('0xf')],_0xd59139);_0x3e5269(_0x25c3d6['error'](0x1f4,_0x5055ca[_0xa71d('0xf')]));});});};exports[_0xa71d('0x17')]=function(_0x3655ea){var _0x30591c=this;return new Promise(function(_0x44cb35,_0x13d52c){return db[_0xa71d('0x18')][_0xa71d('0x19')](_0x3655ea[_0xa71d('0x1a')],{'raw':_0x3655ea[_0xa71d('0x14')]?_0x3655ea['options'][_0xa71d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3655ea[_0xa71d('0x14')]?_0x3655ea[_0xa71d('0x14')][_0xa71d('0x1c')]||null:null,'attributes':_0x3655ea['options']?_0x3655ea['options'][_0xa71d('0x1d')]||null:null,'limit':_0x3655ea[_0xa71d('0x14')]?_0x3655ea[_0xa71d('0x14')][_0xa71d('0x1e')]||null:null})[_0xa71d('0x15')](function(_0x29d45c){logger[_0xa71d('0x10')](_0xa71d('0x17'),_0x3655ea);logger[_0xa71d('0x16')](_0xa71d('0x17'),_0x3655ea,JSON[_0xa71d('0xd')](_0x29d45c));_0x44cb35(_0x29d45c);})[_0xa71d('0x12')](function(_0x2d1faa){logger[_0xa71d('0xe')](_0xa71d('0x17'),_0x2d1faa[_0xa71d('0xf')],_0x3655ea);_0x13d52c(_0x30591c[_0xa71d('0xe')](0x1f4,_0x2d1faa[_0xa71d('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 67d70d5..368004c 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 _0xa575=['/:id','isAuthenticated','show','post','create','/:id/applications','addApplications','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xa575,0x174));var _0x5a57=function(_0x5c2412,_0x5d294e){_0x5c2412=_0x5c2412-0x0;var _0xd6f2b3=_0xa575[_0x5c2412];return _0xd6f2b3;};'use strict';var multer=require('multer');var util=require(_0x5a57('0x0'));var path=require(_0x5a57('0x1'));var timeout=require(_0x5a57('0x2'));var express=require('express');var router=express[_0x5a57('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5a57('0x4'));var interaction=require(_0x5a57('0x5'));var config=require(_0x5a57('0x6'));var controller=require('./voiceExtension.controller');router[_0x5a57('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5a57('0x7')](_0x5a57('0x8'),auth[_0x5a57('0x9')](),controller[_0x5a57('0xa')]);router[_0x5a57('0xb')]('/',auth[_0x5a57('0x9')](),controller[_0x5a57('0xc')]);router['post'](_0x5a57('0xd'),auth['isAuthenticated'](),controller[_0x5a57('0xe')]);router[_0x5a57('0xf')](_0x5a57('0x8'),auth[_0x5a57('0x9')](),controller[_0x5a57('0x10')]);router['delete'](_0x5a57('0x8'),auth[_0x5a57('0x9')](),controller[_0x5a57('0x11')]);module[_0x5a57('0x12')]=router; \ No newline at end of file +var _0xfd67=['util','path','express','fs-extra','../../config/environment','./voiceExtension.controller','get','/:id','isAuthenticated','show','post','create','/:id/applications','put','update','delete','destroy','exports'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0xfd67,0xea));var _0x7fd6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfd67[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require(_0x7fd6('0x0'));var path=require(_0x7fd6('0x1'));var timeout=require('connect-timeout');var express=require(_0x7fd6('0x2'));var router=express['Router']();var fs_extra=require(_0x7fd6('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7fd6('0x4'));var controller=require(_0x7fd6('0x5'));router[_0x7fd6('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7fd6('0x6')](_0x7fd6('0x7'),auth[_0x7fd6('0x8')](),controller[_0x7fd6('0x9')]);router[_0x7fd6('0xa')]('/',auth['isAuthenticated'](),controller[_0x7fd6('0xb')]);router['post'](_0x7fd6('0xc'),auth[_0x7fd6('0x8')](),controller['addApplications']);router[_0x7fd6('0xd')](_0x7fd6('0x7'),auth[_0x7fd6('0x8')](),controller[_0x7fd6('0xe')]);router[_0x7fd6('0xf')](_0x7fd6('0x7'),auth[_0x7fd6('0x8')](),controller[_0x7fd6('0x10')]);module[_0x7fd6('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 5704cff..2364d1d 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 _0x68a1=['system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','internal','outbound-fax'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x68a1,0x107));var _0x168a=function(_0x2e83d0,_0x1ddd00){_0x2e83d0=_0x2e83d0-0x0;var _0x2752f8=_0x68a1[_0x2e83d0];return _0x2752f8;};'use strict';var Sequelize=require(_0x168a('0x0'));module[_0x168a('0x1')]={'context':{'type':Sequelize[_0x168a('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x168a('0x2')],'allowNull':![],'unique':_0x168a('0x3')},'priority':{'type':Sequelize[_0x168a('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x168a('0x3')},'tag':{'type':Sequelize[_0x168a('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x168a('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x168a('0x5')](_0x168a('0x6'),'outbound',_0x168a('0x7'),'inbound-fax',_0x168a('0x8'),_0x168a('0x9'),_0x168a('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x168a('0x2')],'allowNull':![],'defaultValue':_0x168a('0xb')},'IntervalId':{'type':Sequelize[_0x168a('0xc')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x168a('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x168a('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x168a('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x168a('0xc')]},'recordingFormat':{'type':Sequelize[_0x168a('0x2')],'defaultValue':_0x168a('0xe')},'answer':{'type':Sequelize[_0x168a('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x168a('0xf')],'get':function(_0x1c7af9){return this['getDataValue'](_0x168a('0x10'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xc2f2=['internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue','exten','sequelize','STRING','compositeIndex','ENUM','inbound','outbound'];(function(_0x595013,_0x65a215){var _0x2a29e3=function(_0x307bf8){while(--_0x307bf8){_0x595013['push'](_0x595013['shift']());}};_0x2a29e3(++_0x65a215);}(_0xc2f2,0x11b));var _0x2c2f=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xc2f2[_0x5c9307];return _0x373e29;};'use strict';var Sequelize=require(_0x2c2f('0x0'));module['exports']={'context':{'type':Sequelize[_0x2c2f('0x1')],'allowNull':![],'unique':_0x2c2f('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x2c2f('0x1')],'allowNull':![],'unique':_0x2c2f('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x2c2f('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x2c2f('0x1')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x2c2f('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x2c2f('0x3')](_0x2c2f('0x4'),_0x2c2f('0x5'),_0x2c2f('0x6'),_0x2c2f('0x7'),_0x2c2f('0x8'),_0x2c2f('0x9'),_0x2c2f('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2c2f('0x1')],'allowNull':![],'defaultValue':_0x2c2f('0xb')},'IntervalId':{'type':Sequelize[_0x2c2f('0xc')]},'isApp':{'type':Sequelize[_0x2c2f('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x2c2f('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x2c2f('0x1')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x2c2f('0x1')],'defaultValue':_0x2c2f('0xe')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5a4a7a){return this[_0x2c2f('0xf')](_0x2c2f('0x10'));}},'alias':{'type':Sequelize[_0x2c2f('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 2ea32dd..d755b9c 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 _0x2511=['redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','outbound','internal','filter','ignore','map','value','includes','type','name','UserProfileResource','error','send','index','VoiceExtension','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','findAll','rows','catch','params','keys','includeAll','create','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','InternalRoutes','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','cutdigits','mandatoryDisposition','alias','context','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','cast(priority\x20as\x20unsigned)','stack','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x40015a,_0x415db5){var _0x42f8a4=function(_0x5685ad){while(--_0x5685ad){_0x40015a['push'](_0x40015a['shift']());}};_0x42f8a4(++_0x415db5);}(_0x2511,0x1bb));var _0x1251=function(_0x6d0c3e,_0xbc2aed){_0x6d0c3e=_0x6d0c3e-0x0;var _0x2895ce=_0x2511[_0x6d0c3e];return _0x2895ce;};'use strict';var _=require(_0x1251('0x0'));var Redis=require(_0x1251('0x1'));var qs=require(_0x1251('0x2'));var logger=require(_0x1251('0x3'))(_0x1251('0x4'));var config=require(_0x1251('0x5'));var db=require(_0x1251('0x6'))['db'];config[_0x1251('0x7')]=_['defaults'](config[_0x1251('0x7')],{'host':_0x1251('0x8'),'port':0x18eb});var socket=require(_0x1251('0x9'))(new Redis(config[_0x1251('0x7')]));require(_0x1251('0xa'))[_0x1251('0xb')](socket);function respondWithStatusCode(_0x47f4d2,_0x172e93){_0x172e93=_0x172e93||0xcc;return function(_0x21fffc){if(_0x21fffc){return _0x47f4d2[_0x1251('0xc')](_0x172e93);}return _0x47f4d2['status'](_0x172e93)['end']();};}function respondWithResult(_0x535d57,_0xca0d36){_0xca0d36=_0xca0d36||0xc8;return function(_0x478270){if(_0x478270){return _0x535d57[_0x1251('0xd')](_0xca0d36)[_0x1251('0xe')](_0x478270);}};}function respondWithFilteredResult(_0xb3afc9,_0x3d4067){return function(_0x90fe10){if(_0x90fe10){var _0x28869b=typeof _0x3d4067[_0x1251('0xf')]===_0x1251('0x10')&&typeof _0x3d4067[_0x1251('0x11')]===_0x1251('0x10');var _0x54a58c=_0x90fe10[_0x1251('0x12')];var _0x5a5cef=_0x28869b?0x0:_0x3d4067['offset'];var _0x30b2dd=_0x28869b?_0x90fe10[_0x1251('0x12')]:_0x3d4067[_0x1251('0xf')]+_0x3d4067[_0x1251('0x11')];var _0x39a74c;if(_0x30b2dd>=_0x54a58c){_0x30b2dd=_0x54a58c;_0x39a74c=0xc8;}else{_0x39a74c=0xce;}_0xb3afc9[_0x1251('0xd')](_0x39a74c);return _0xb3afc9[_0x1251('0x13')](_0x1251('0x14'),_0x5a5cef+'-'+_0x30b2dd+'/'+_0x54a58c)[_0x1251('0xe')](_0x90fe10);}return null;};}function removeEntity(_0x3b0191){return function(_0x163b99){if(_0x163b99){return _0x163b99[_0x1251('0x15')]()[_0x1251('0x16')](function(){var _0xae89fe=_0x163b99[_0x1251('0x17')]({'plain':!![]});var _0x197ab2=[{'name':_0x1251('0x18'),'value':_0x1251('0x19'),'ignore':![]},{'name':'OutboundRoutes','value':_0x1251('0x1a'),'ignore':![]},{'name':'InternalRoutes','value':_0x1251('0x1b'),'ignore':![]}];var _0x505555=_(_0x197ab2)[_0x1251('0x1c')](_0x1251('0x1d'))[_0x1251('0x1e')](_0x1251('0x1f'))[_0x1251('0x1f')]();if(_[_0x1251('0x20')](_0x505555,_0xae89fe[_0x1251('0x21')])){return;}var _0x73b257=_['find'](_0x197ab2,[_0x1251('0x1f'),_0xae89fe[_0x1251('0x21')]])[_0x1251('0x22')];return db[_0x1251('0x23')][_0x1251('0x15')]({'where':{'type':_0x73b257,'resourceId':_0xae89fe['id']}})[_0x1251('0x16')](function(){return _0x163b99;});})[_0x1251('0x16')](function(){_0x3b0191[_0x1251('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3df46d){return function(_0x278ecd){if(!_0x278ecd){_0x3df46d['sendStatus'](0x194);}return _0x278ecd;};}function handleError(_0x513144,_0x2c13a9){_0x2c13a9=_0x2c13a9||0x1f4;return function(_0x2c7652){logger[_0x1251('0x24')](_0x2c7652['stack']);if(_0x2c7652[_0x1251('0x22')]){delete _0x2c7652[_0x1251('0x22')];}_0x513144[_0x1251('0xd')](_0x2c13a9)[_0x1251('0x25')](_0x2c7652);};}exports[_0x1251('0x26')]=function(_0x330113,_0x545664){var _0x5e8acb={},_0x36155b={},_0x3615e6={'count':0x0,'rows':[]};var _0x55a8d6=_[_0x1251('0x1e')](db[_0x1251('0x27')][_0x1251('0x28')],function(_0x30cf4d){return{'name':_0x30cf4d[_0x1251('0x29')],'type':_0x30cf4d[_0x1251('0x21')]['key']};});_0x36155b[_0x1251('0x2a')]=_[_0x1251('0x1e')](_0x55a8d6,'name');_0x36155b[_0x1251('0x2b')]=_['keys'](_0x330113['query']);_0x36155b[_0x1251('0x2c')]=_['intersection'](_0x36155b[_0x1251('0x2a')],_0x36155b[_0x1251('0x2b')]);_0x5e8acb['attributes']=_[_0x1251('0x2d')](_0x36155b[_0x1251('0x2a')],qs['fields'](_0x330113[_0x1251('0x2b')][_0x1251('0x2e')]));_0x5e8acb[_0x1251('0x2f')]=_0x5e8acb['attributes'][_0x1251('0x30')]?_0x5e8acb[_0x1251('0x2f')]:_0x36155b[_0x1251('0x2a')];if(!_0x330113[_0x1251('0x2b')][_0x1251('0x31')](_0x1251('0x32'))){_0x5e8acb['limit']=qs[_0x1251('0x11')](_0x330113['query']['limit']);_0x5e8acb[_0x1251('0xf')]=qs[_0x1251('0xf')](_0x330113[_0x1251('0x2b')]['offset']);}_0x5e8acb[_0x1251('0x33')]=qs['sort'](_0x330113[_0x1251('0x2b')][_0x1251('0x34')]);_0x5e8acb['where']=qs[_0x1251('0x2c')](_[_0x1251('0x35')](_0x330113[_0x1251('0x2b')],_0x36155b[_0x1251('0x2c')]),_0x55a8d6);if(_0x330113[_0x1251('0x2b')][_0x1251('0x1c')]){_0x5e8acb[_0x1251('0x36')]=_[_0x1251('0x37')](_0x5e8acb['where'],{'$or':_[_0x1251('0x1e')](_0x55a8d6,function(_0x218f17){if(_0x218f17[_0x1251('0x21')]!=='VIRTUAL'){var _0x54f2ab={};_0x54f2ab[_0x218f17['name']]={'$like':'%'+_0x330113[_0x1251('0x2b')][_0x1251('0x1c')]+'%'};return _0x54f2ab;}})});}_0x5e8acb=_[_0x1251('0x37')]({},_0x5e8acb,_0x330113[_0x1251('0x38')]);var _0x21e335={'where':_0x5e8acb[_0x1251('0x36')]};return db[_0x1251('0x27')][_0x1251('0x12')](_0x21e335)['then'](function(_0x1fc1ce){_0x3615e6[_0x1251('0x12')]=_0x1fc1ce;if(_0x330113['query']['includeAll']){_0x5e8acb['include']=[{'all':!![]}];}return db[_0x1251('0x27')][_0x1251('0x39')](_0x5e8acb);})[_0x1251('0x16')](function(_0x13dff4){_0x3615e6[_0x1251('0x3a')]=_0x13dff4;return _0x3615e6;})[_0x1251('0x16')](respondWithFilteredResult(_0x545664,_0x5e8acb))[_0x1251('0x3b')](handleError(_0x545664,null));};exports['show']=function(_0x6e00dd,_0x25edcb){var _0xc4ebc4={'raw':![],'where':{'id':_0x6e00dd[_0x1251('0x3c')]['id']}},_0x1e728e={};_0x1e728e[_0x1251('0x2a')]=_[_0x1251('0x3d')](db[_0x1251('0x27')]['rawAttributes']);_0x1e728e[_0x1251('0x2b')]=_[_0x1251('0x3d')](_0x6e00dd['query']);_0x1e728e['filters']=_[_0x1251('0x2d')](_0x1e728e[_0x1251('0x2a')],_0x1e728e[_0x1251('0x2b')]);_0xc4ebc4[_0x1251('0x2f')]=_['intersection'](_0x1e728e['model'],qs[_0x1251('0x2e')](_0x6e00dd[_0x1251('0x2b')][_0x1251('0x2e')]));_0xc4ebc4[_0x1251('0x2f')]=_0xc4ebc4[_0x1251('0x2f')][_0x1251('0x30')]?_0xc4ebc4[_0x1251('0x2f')]:_0x1e728e[_0x1251('0x2a')];if(_0x6e00dd[_0x1251('0x2b')][_0x1251('0x3e')]){_0xc4ebc4['include']=[{'all':!![]}];}_0xc4ebc4=_[_0x1251('0x37')]({},_0xc4ebc4,_0x6e00dd[_0x1251('0x38')]);return db[_0x1251('0x27')]['find'](_0xc4ebc4)[_0x1251('0x16')](handleEntityNotFound(_0x25edcb,null))[_0x1251('0x16')](respondWithResult(_0x25edcb,null))[_0x1251('0x3b')](handleError(_0x25edcb,null));};exports[_0x1251('0x15')]=function(_0x35ddf4,_0x3ff320){return db[_0x1251('0x27')]['find']({'where':{'id':_0x35ddf4[_0x1251('0x3c')]['id']}})[_0x1251('0x16')](handleEntityNotFound(_0x3ff320,null))['then'](removeEntity(_0x3ff320,null))[_0x1251('0x3b')](handleError(_0x3ff320,null));};exports[_0x1251('0x3f')]=function(_0xf61038,_0x36485d){if(_0xf61038[_0x1251('0x40')]['type']==='outbound'&&!_['startsWith'](_0xf61038['body'][_0x1251('0x41')],'_')){_0xf61038['body'][_0x1251('0x41')]='_'[_0x1251('0x42')](_0xf61038[_0x1251('0x40')][_0x1251('0x41')]);}return db[_0x1251('0x27')]['create'](_0xf61038[_0x1251('0x40')],{'raw':![]})[_0x1251('0x16')](function(_0x863b8b){var _0x155077=_0xf61038['user']['get']({'plain':!![]});if(!_0x155077)throw new Error(_0x1251('0x43'));if(_0x155077[_0x1251('0x44')]==='user'){var _0xf6e7a9=_0x863b8b[_0x1251('0x17')]({'plain':!![]});var _0x2b7499=[{'name':'InboundRoutes','value':_0x1251('0x19')},{'name':_0x1251('0x45'),'value':_0x1251('0x1a')},{'name':_0x1251('0x46'),'value':_0x1251('0x1b')}];var _0x1019df=_['find'](_0x2b7499,[_0x1251('0x1f'),_0xf6e7a9['type']])['name'];return db[_0x1251('0x47')][_0x1251('0x48')]({'where':{'name':_0x1019df,'userProfileId':_0x155077[_0x1251('0x49')]},'raw':!![]})[_0x1251('0x16')](function(_0x318438){if(_0x318438&&_0x318438[_0x1251('0x4a')]===0x0){return db[_0x1251('0x23')][_0x1251('0x3f')]({'name':_0xf6e7a9[_0x1251('0x22')],'resourceId':_0xf6e7a9['id'],'type':_0x318438[_0x1251('0x22')],'sectionId':_0x318438['id']},{})[_0x1251('0x16')](function(){return _0x863b8b;});}else{return _0x863b8b;}})['catch'](function(_0x4d067d){logger['error'](_0x1251('0x4b'),_0x4d067d);throw _0x4d067d;});}return _0x863b8b;})[_0x1251('0x16')](respondWithResult(_0x36485d,0xc9))[_0x1251('0x3b')](handleError(_0x36485d,null));};exports['update']=function(_0x5b47a8,_0x25634c){if(_0x5b47a8[_0x1251('0x40')]['id']){delete _0x5b47a8[_0x1251('0x40')]['id'];}return db[_0x1251('0x27')]['find']({'where':{'id':_0x5b47a8[_0x1251('0x3c')]['id']}})[_0x1251('0x16')](handleEntityNotFound(_0x25634c,null))[_0x1251('0x16')](function(_0x49613e){if(_0x49613e){return db[_0x1251('0x27')][_0x1251('0x4c')](_['pick'](_0x5b47a8['body'],[_0x1251('0x41'),'context','description','recordingFormat',_0x1251('0x4d'),_0x1251('0x4e'),_0x1251('0x4f')]),{'where':{'context':_0x49613e[_0x1251('0x50')],'exten':_0x49613e[_0x1251('0x41')]},'individualHooks':!![]})[_0x1251('0x16')](function(_0x53d163){return _0x53d163;});}return null;})[_0x1251('0x16')](respondWithStatusCode(_0x25634c,null))['catch'](handleError(_0x25634c,null));};exports['addApplications']=function(_0x566e04,_0x4fc4dc){var _0x5b78fb=_0x566e04[_0x1251('0x3c')]['id'];var _0x4ebe76=_0x566e04[_0x1251('0x40')];var _0x567090=0xc8;var _0x14f72f=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x1251('0x51')][_0x1251('0x52')][_0x1251('0x53')][_0x1251('0x54')]},function(_0x210caa){return db[_0x1251('0x27')][_0x1251('0x55')]({'where':{'id':_0x5b78fb},'transaction':_0x210caa})['then'](function(_0x1f7231){if(_0x1f7231){return db[_0x1251('0x27')][_0x1251('0x15')]({'where':{'VoiceExtensionId':_0x5b78fb},'transaction':_0x210caa})['then'](function(){var _0x48dc34=_[_0x1251('0x1e')](_0x4ebe76,function(_0x472097){_0x472097[_0x1251('0x56')]=_0x5b78fb;_0x472097['isApp']=!![];return _0x472097;});return _0x1f7231[_0x1251('0x57')](_0x48dc34);})[_0x1251('0x16')](function(_0x9b6fd4){return db[_0x1251('0x27')]['bulkCreate'](_0x9b6fd4,{'transaction':_0x210caa});});}else{_0x567090=0x194;_0x14f72f=[];}});})[_0x1251('0x16')](function(){if(_0x567090!==0x194){return db[_0x1251('0x27')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x5b78fb},'order':_0x1251('0x58')})[_0x1251('0x16')](function(_0x3033d6){_0x14f72f=_0x3033d6;});}})[_0x1251('0x3b')](function(_0x125ed7){_0x567090=0x1f4;logger['error'](_0x125ed7[_0x1251('0x59')]);if(_0x125ed7[_0x1251('0x22')]){delete _0x125ed7[_0x1251('0x22')];}_0x14f72f=_0x125ed7;})['finally'](function(){if(_0x14f72f===null){_0x4fc4dc['sendStatus'](_0x567090);}else{if(_0x567090===0x1f4){_0x4fc4dc['status'](_0x567090)['send'](_0x14f72f);}else{_0x4fc4dc['status'](_0x567090)[_0x1251('0xe')](_0x14f72f);}}});}; \ No newline at end of file +var _0x1269=['InternalRoutes','internal','filter','ignore','value','type','find','name','destroy','end','error','send','index','map','VoiceExtension','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','params','body','outbound','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','stack','finally','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','then','get','InboundRoutes','inbound','OutboundRoutes'];(function(_0x384900,_0x528c2c){var _0x285256=function(_0x1e007c){while(--_0x1e007c){_0x384900['push'](_0x384900['shift']());}};_0x285256(++_0x528c2c);}(_0x1269,0xed));var _0x9126=function(_0x27af08,_0x192c31){_0x27af08=_0x27af08-0x0;var _0x49eb8e=_0x1269[_0x27af08];return _0x49eb8e;};'use strict';var _=require(_0x9126('0x0'));var Redis=require('ioredis');var qs=require(_0x9126('0x1'));var logger=require(_0x9126('0x2'))(_0x9126('0x3'));var config=require(_0x9126('0x4'));var db=require('../../mysqldb')['db'];config[_0x9126('0x5')]=_[_0x9126('0x6')](config[_0x9126('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x9126('0x7'))(new Redis(config['redis']));require(_0x9126('0x8'))[_0x9126('0x9')](socket);function respondWithStatusCode(_0x32d199,_0x68b678){_0x68b678=_0x68b678||0xcc;return function(_0x3e7bfc){if(_0x3e7bfc){return _0x32d199[_0x9126('0xa')](_0x68b678);}return _0x32d199[_0x9126('0xb')](_0x68b678)['end']();};}function respondWithResult(_0x376a38,_0x13586c){_0x13586c=_0x13586c||0xc8;return function(_0x56590c){if(_0x56590c){return _0x376a38['status'](_0x13586c)[_0x9126('0xc')](_0x56590c);}};}function respondWithFilteredResult(_0xa7ed7a,_0x4121c9){return function(_0x3fe9b2){if(_0x3fe9b2){var _0x6a8d7f=typeof _0x4121c9[_0x9126('0xd')]===_0x9126('0xe')&&typeof _0x4121c9[_0x9126('0xf')]===_0x9126('0xe');var _0x233fa4=_0x3fe9b2[_0x9126('0x10')];var _0x4b4156=_0x6a8d7f?0x0:_0x4121c9[_0x9126('0xd')];var _0x1d6fe7=_0x6a8d7f?_0x3fe9b2['count']:_0x4121c9['offset']+_0x4121c9['limit'];var _0x20645a;if(_0x1d6fe7>=_0x233fa4){_0x1d6fe7=_0x233fa4;_0x20645a=0xc8;}else{_0x20645a=0xce;}_0xa7ed7a[_0x9126('0xb')](_0x20645a);return _0xa7ed7a[_0x9126('0x11')](_0x9126('0x12'),_0x4b4156+'-'+_0x1d6fe7+'/'+_0x233fa4)[_0x9126('0xc')](_0x3fe9b2);}return null;};}function removeEntity(_0x1a1ac7){return function(_0x265339){if(_0x265339){return _0x265339['destroy']()[_0x9126('0x13')](function(){var _0x59a10e=_0x265339[_0x9126('0x14')]({'plain':!![]});var _0x332fdd=[{'name':_0x9126('0x15'),'value':_0x9126('0x16'),'ignore':![]},{'name':_0x9126('0x17'),'value':'outbound','ignore':![]},{'name':_0x9126('0x18'),'value':_0x9126('0x19'),'ignore':![]}];var _0x3a43a7=_(_0x332fdd)[_0x9126('0x1a')](_0x9126('0x1b'))['map'](_0x9126('0x1c'))['value']();if(_['includes'](_0x3a43a7,_0x59a10e[_0x9126('0x1d')])){return;}var _0x50186f=_[_0x9126('0x1e')](_0x332fdd,[_0x9126('0x1c'),_0x59a10e['type']])[_0x9126('0x1f')];return db['UserProfileResource'][_0x9126('0x20')]({'where':{'type':_0x50186f,'resourceId':_0x59a10e['id']}})['then'](function(){return _0x265339;});})[_0x9126('0x13')](function(){_0x1a1ac7['status'](0xcc)[_0x9126('0x21')]();});}};}function handleEntityNotFound(_0x3306ce){return function(_0x2bc151){if(!_0x2bc151){_0x3306ce[_0x9126('0xa')](0x194);}return _0x2bc151;};}function handleError(_0x7a8b6e,_0x21e251){_0x21e251=_0x21e251||0x1f4;return function(_0x4fe23d){logger[_0x9126('0x22')](_0x4fe23d['stack']);if(_0x4fe23d[_0x9126('0x1f')]){delete _0x4fe23d[_0x9126('0x1f')];}_0x7a8b6e[_0x9126('0xb')](_0x21e251)[_0x9126('0x23')](_0x4fe23d);};}exports[_0x9126('0x24')]=function(_0x4d918b,_0x2aaaf8){var _0x125aa1={},_0x4c95a2={},_0x117b08={'count':0x0,'rows':[]};var _0x1a84c2=_[_0x9126('0x25')](db[_0x9126('0x26')][_0x9126('0x27')],function(_0x5c51ba){return{'name':_0x5c51ba['fieldName'],'type':_0x5c51ba[_0x9126('0x1d')][_0x9126('0x28')]};});_0x4c95a2[_0x9126('0x29')]=_[_0x9126('0x25')](_0x1a84c2,'name');_0x4c95a2[_0x9126('0x2a')]=_['keys'](_0x4d918b[_0x9126('0x2a')]);_0x4c95a2[_0x9126('0x2b')]=_[_0x9126('0x2c')](_0x4c95a2[_0x9126('0x29')],_0x4c95a2[_0x9126('0x2a')]);_0x125aa1[_0x9126('0x2d')]=_[_0x9126('0x2c')](_0x4c95a2[_0x9126('0x29')],qs[_0x9126('0x2e')](_0x4d918b['query']['fields']));_0x125aa1['attributes']=_0x125aa1['attributes'][_0x9126('0x2f')]?_0x125aa1[_0x9126('0x2d')]:_0x4c95a2[_0x9126('0x29')];if(!_0x4d918b[_0x9126('0x2a')][_0x9126('0x30')](_0x9126('0x31'))){_0x125aa1[_0x9126('0xf')]=qs['limit'](_0x4d918b[_0x9126('0x2a')][_0x9126('0xf')]);_0x125aa1[_0x9126('0xd')]=qs[_0x9126('0xd')](_0x4d918b[_0x9126('0x2a')][_0x9126('0xd')]);}_0x125aa1[_0x9126('0x32')]=qs[_0x9126('0x33')](_0x4d918b[_0x9126('0x2a')][_0x9126('0x33')]);_0x125aa1[_0x9126('0x34')]=qs[_0x9126('0x2b')](_[_0x9126('0x35')](_0x4d918b['query'],_0x4c95a2[_0x9126('0x2b')]),_0x1a84c2);if(_0x4d918b[_0x9126('0x2a')][_0x9126('0x1a')]){_0x125aa1[_0x9126('0x34')]=_[_0x9126('0x36')](_0x125aa1['where'],{'$or':_[_0x9126('0x25')](_0x1a84c2,function(_0x46de64){if(_0x46de64[_0x9126('0x1d')]!==_0x9126('0x37')){var _0x53b20d={};_0x53b20d[_0x46de64[_0x9126('0x1f')]]={'$like':'%'+_0x4d918b[_0x9126('0x2a')][_0x9126('0x1a')]+'%'};return _0x53b20d;}})});}_0x125aa1=_[_0x9126('0x36')]({},_0x125aa1,_0x4d918b['options']);var _0x28e6b9={'where':_0x125aa1[_0x9126('0x34')]};return db['VoiceExtension'][_0x9126('0x10')](_0x28e6b9)['then'](function(_0x1de421){_0x117b08[_0x9126('0x10')]=_0x1de421;if(_0x4d918b[_0x9126('0x2a')][_0x9126('0x38')]){_0x125aa1[_0x9126('0x39')]=[{'all':!![]}];}return db[_0x9126('0x26')][_0x9126('0x3a')](_0x125aa1);})[_0x9126('0x13')](function(_0x479943){_0x117b08[_0x9126('0x3b')]=_0x479943;return _0x117b08;})[_0x9126('0x13')](respondWithFilteredResult(_0x2aaaf8,_0x125aa1))[_0x9126('0x3c')](handleError(_0x2aaaf8,null));};exports[_0x9126('0x3d')]=function(_0x2ac9ba,_0x5d7d22){var _0x437640={'raw':![],'where':{'id':_0x2ac9ba['params']['id']}},_0x2ba4a9={};_0x2ba4a9[_0x9126('0x29')]=_[_0x9126('0x3e')](db[_0x9126('0x26')]['rawAttributes']);_0x2ba4a9[_0x9126('0x2a')]=_[_0x9126('0x3e')](_0x2ac9ba['query']);_0x2ba4a9[_0x9126('0x2b')]=_['intersection'](_0x2ba4a9[_0x9126('0x29')],_0x2ba4a9[_0x9126('0x2a')]);_0x437640[_0x9126('0x2d')]=_[_0x9126('0x2c')](_0x2ba4a9[_0x9126('0x29')],qs[_0x9126('0x2e')](_0x2ac9ba[_0x9126('0x2a')]['fields']));_0x437640[_0x9126('0x2d')]=_0x437640[_0x9126('0x2d')][_0x9126('0x2f')]?_0x437640['attributes']:_0x2ba4a9[_0x9126('0x29')];if(_0x2ac9ba['query'][_0x9126('0x38')]){_0x437640[_0x9126('0x39')]=[{'all':!![]}];}_0x437640=_[_0x9126('0x36')]({},_0x437640,_0x2ac9ba['options']);return db[_0x9126('0x26')][_0x9126('0x1e')](_0x437640)[_0x9126('0x13')](handleEntityNotFound(_0x5d7d22,null))[_0x9126('0x13')](respondWithResult(_0x5d7d22,null))[_0x9126('0x3c')](handleError(_0x5d7d22,null));};exports[_0x9126('0x20')]=function(_0x1a3300,_0x5728db){return db['VoiceExtension'][_0x9126('0x1e')]({'where':{'id':_0x1a3300[_0x9126('0x3f')]['id']}})[_0x9126('0x13')](handleEntityNotFound(_0x5728db,null))[_0x9126('0x13')](removeEntity(_0x5728db,null))[_0x9126('0x3c')](handleError(_0x5728db,null));};exports['create']=function(_0xbd103c,_0x21e531){if(_0xbd103c[_0x9126('0x40')]['type']===_0x9126('0x41')&&!_['startsWith'](_0xbd103c[_0x9126('0x40')][_0x9126('0x42')],'_')){_0xbd103c['body'][_0x9126('0x42')]='_'[_0x9126('0x43')](_0xbd103c[_0x9126('0x40')]['exten']);}return db[_0x9126('0x26')][_0x9126('0x44')](_0xbd103c['body'],{'raw':![]})[_0x9126('0x13')](function(_0x3d1997){var _0x2254ad=_0xbd103c[_0x9126('0x45')][_0x9126('0x14')]({'plain':!![]});if(!_0x2254ad)throw new Error(_0x9126('0x46'));if(_0x2254ad[_0x9126('0x47')]===_0x9126('0x45')){var _0x589030=_0x3d1997[_0x9126('0x14')]({'plain':!![]});var _0x285a98=[{'name':_0x9126('0x15'),'value':_0x9126('0x16')},{'name':'OutboundRoutes','value':_0x9126('0x41')},{'name':'InternalRoutes','value':'internal'}];var _0x5aaea9=_[_0x9126('0x1e')](_0x285a98,[_0x9126('0x1c'),_0x589030[_0x9126('0x1d')]])[_0x9126('0x1f')];return db[_0x9126('0x48')]['find']({'where':{'name':_0x5aaea9,'userProfileId':_0x2254ad['userProfileId']},'raw':!![]})['then'](function(_0x5f543d){if(_0x5f543d&&_0x5f543d['autoAssociation']===0x0){return db[_0x9126('0x49')]['create']({'name':_0x589030[_0x9126('0x1f')],'resourceId':_0x589030['id'],'type':_0x5f543d[_0x9126('0x1f')],'sectionId':_0x5f543d['id']},{})['then'](function(){return _0x3d1997;});}else{return _0x3d1997;}})['catch'](function(_0x3fe989){logger[_0x9126('0x22')](_0x9126('0x4a'),_0x3fe989);throw _0x3fe989;});}return _0x3d1997;})[_0x9126('0x13')](respondWithResult(_0x21e531,0xc9))[_0x9126('0x3c')](handleError(_0x21e531,null));};exports['update']=function(_0x1501f0,_0x49e322){if(_0x1501f0[_0x9126('0x40')]['id']){delete _0x1501f0[_0x9126('0x40')]['id'];}return db[_0x9126('0x26')]['find']({'where':{'id':_0x1501f0[_0x9126('0x3f')]['id']}})[_0x9126('0x13')](handleEntityNotFound(_0x49e322,null))[_0x9126('0x13')](function(_0x17a1df){if(_0x17a1df){return db[_0x9126('0x26')]['update'](_['pick'](_0x1501f0[_0x9126('0x40')],[_0x9126('0x42'),_0x9126('0x4b'),_0x9126('0x4c'),'recordingFormat','cutdigits','mandatoryDisposition','alias']),{'where':{'context':_0x17a1df[_0x9126('0x4b')],'exten':_0x17a1df[_0x9126('0x42')]},'individualHooks':!![]})['then'](function(_0x3ebd58){return _0x3ebd58;});}return null;})[_0x9126('0x13')](respondWithStatusCode(_0x49e322,null))[_0x9126('0x3c')](handleError(_0x49e322,null));};exports['addApplications']=function(_0x174054,_0x1e248e){var _0x22b589=_0x174054[_0x9126('0x3f')]['id'];var _0xa4de9e=_0x174054[_0x9126('0x40')];var _0x2f74a1=0xc8;var _0x16987d=null;return db[_0x9126('0x4d')]['transaction']({'isolationLevel':db[_0x9126('0x4d')][_0x9126('0x4e')][_0x9126('0x4f')][_0x9126('0x50')]},function(_0x163989){return db[_0x9126('0x26')][_0x9126('0x51')]({'where':{'id':_0x22b589},'transaction':_0x163989})[_0x9126('0x13')](function(_0x195c83){if(_0x195c83){return db[_0x9126('0x26')][_0x9126('0x20')]({'where':{'VoiceExtensionId':_0x22b589},'transaction':_0x163989})[_0x9126('0x13')](function(){var _0x504fb1=_['map'](_0xa4de9e,function(_0x464593){_0x464593['VoiceExtensionId']=_0x22b589;_0x464593['isApp']=!![];return _0x464593;});return _0x195c83['createRouting'](_0x504fb1);})[_0x9126('0x13')](function(_0x87a17b){return db['VoiceExtension'][_0x9126('0x52')](_0x87a17b,{'transaction':_0x163989});});}else{_0x2f74a1=0x194;_0x16987d=[];}});})['then'](function(){if(_0x2f74a1!==0x194){return db[_0x9126('0x26')][_0x9126('0x53')]({'where':{'isApp':!![],'VoiceExtensionId':_0x22b589},'order':_0x9126('0x54')})['then'](function(_0x6353af){_0x16987d=_0x6353af;});}})['catch'](function(_0x3a92ed){_0x2f74a1=0x1f4;logger[_0x9126('0x22')](_0x3a92ed[_0x9126('0x55')]);if(_0x3a92ed[_0x9126('0x1f')]){delete _0x3a92ed['name'];}_0x16987d=_0x3a92ed;})[_0x9126('0x56')](function(){if(_0x16987d===null){_0x1e248e[_0x9126('0xa')](_0x2f74a1);}else{if(_0x2f74a1===0x1f4){_0x1e248e[_0x9126('0xb')](_0x2f74a1)[_0x9126('0x23')](_0x16987d);}else{_0x1e248e[_0x9126('0xb')](_0x2f74a1)[_0x9126('0xc')](_0x16987d);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 1de47cf..439b94e 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 _0x0c80=['save','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x4ae4d4,_0x5ec73f){var _0x8eb95b=function(_0xa6aa78){while(--_0xa6aa78){_0x4ae4d4['push'](_0x4ae4d4['shift']());}};_0x8eb95b(++_0x5ec73f);}(_0x0c80,0x1de));var _0x00c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0c80[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x00c8('0x0'));var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x00c8('0x1')](0x0);var events={'afterCreate':_0x00c8('0x2'),'afterUpdate':'update','afterDestroy':_0x00c8('0x3')};function emitEvent(_0x3592b0){return function(_0x465471,_0x1eab80,_0x219da1){VoiceExtensionEvents[_0x00c8('0x4')](_0x3592b0+':'+_0x465471['id'],_0x465471);VoiceExtensionEvents[_0x00c8('0x4')](_0x3592b0,_0x465471);_0x219da1(null);};}for(var e in events){if(events[_0x00c8('0x5')](e)){var event=events[e];VoiceExtension[_0x00c8('0x6')](e,emitEvent(event));}}module[_0x00c8('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0xc5ca=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save'];(function(_0x48c549,_0x226975){var _0x56e2d9=function(_0x14628c){while(--_0x14628c){_0x48c549['push'](_0x48c549['shift']());}};_0x56e2d9(++_0x226975);}(_0xc5ca,0x7f));var _0xac5c=function(_0x486cf7,_0x1fd468){_0x486cf7=_0x486cf7-0x0;var _0x177937=_0xc5ca[_0x486cf7];return _0x177937;};'use strict';var EventEmitter=require(_0xac5c('0x0'));var VoiceExtension=require(_0xac5c('0x1'))['db'][_0xac5c('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xac5c('0x3')](0x0);var events={'afterCreate':_0xac5c('0x4'),'afterUpdate':_0xac5c('0x5'),'afterDestroy':_0xac5c('0x6')};function emitEvent(_0x952bd3){return function(_0xd25bb3,_0x5a2561,_0x4d257a){VoiceExtensionEvents[_0xac5c('0x7')](_0x952bd3+':'+_0xd25bb3['id'],_0xd25bb3);VoiceExtensionEvents[_0xac5c('0x7')](_0x952bd3,_0xd25bb3);_0x4d257a(null);};}for(var e in events){if(events[_0xac5c('0x8')](e)){var event=events[e];VoiceExtension[_0xac5c('0x9')](e,emitEvent(event));}}module[_0xac5c('0xa')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 67fe92f..9bc6ed0 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 _0x5089=['timeout','options','url','split','length','name','trunk','param','phone','${EXTEN:','prefix','SIP','join','U(xcally-mixmonitor-context)','Interval','findAll','IntervalId','interval','*,*,*,*','intervals','filter','toLowerCase','tag','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appdata','agi','priority','last','catch','VoiceExtension','voice_extensions','get','then','concat','Hangup','lodash','./voiceExtension.attributes','models','Set','CDR(type)=','type','exten','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','inbound','push','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','none','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav'];(function(_0x49f805,_0x587af6){var _0x1e52ca=function(_0x332ca0){while(--_0x332ca0){_0x49f805['push'](_0x49f805['shift']());}};_0x1e52ca(++_0x587af6);}(_0x5089,0x1bb));var _0x9508=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0x5089[_0x4c260a];return _0x17bbdd;};'use strict';var _=require(_0x9508('0x0'));var attributes=require(_0x9508('0x1'));module['exports']=function(_0x2d60c7){var _0x35878a=_0x2d60c7[_0x9508('0x2')];function _0x100d7e(_0x172549){var _0x59d3ee=0x2;var _0x86540d=[{'type':_0x172549['type'],'app':_0x9508('0x3'),'appdata':_0x9508('0x4')+_0x172549[_0x9508('0x5')],'context':_0x172549['context'],'exten':_0x172549[_0x9508('0x6')],'priority':_0x59d3ee++,'VoiceExtensionId':_0x172549['id']},{'type':_0x172549[_0x9508('0x5')],'app':_0x172549['alias']?_0x9508('0x3'):_0x9508('0x7'),'appdata':_0x172549['alias']?_0x9508('0x8')+_0x172549['alias']:_0x9508('0x9'),'context':_0x172549[_0x9508('0xa')],'exten':_0x172549[_0x9508('0x6')],'priority':_0x59d3ee++,'VoiceExtensionId':_0x172549['id']}];if(_0x172549[_0x9508('0x5')]===_0x9508('0xb')){_0x86540d[_0x9508('0xc')]({'type':'inbound','app':_0x9508('0x3'),'appdata':'CDR(routeid)='+_0x172549['id'],'context':_0x172549[_0x9508('0xa')],'exten':_0x172549[_0x9508('0x6')],'priority':_0x59d3ee++,'VoiceExtensionId':_0x172549['id']});}_0x86540d['push']({'type':_0x172549[_0x9508('0x5')],'app':_0x9508('0x3'),'appdata':_0x9508('0xd'),'context':_0x172549[_0x9508('0xa')],'exten':_0x172549['exten'],'priority':_0x59d3ee++,'VoiceExtensionId':_0x172549['id']},{'type':_0x172549[_0x9508('0x5')],'app':_0x9508('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x172549[_0x9508('0xa')],'exten':_0x172549['exten'],'priority':_0x59d3ee++,'VoiceExtensionId':_0x172549['id']},{'type':_0x172549[_0x9508('0x5')],'app':_0x9508('0x3'),'appdata':_0x9508('0xe'),'context':_0x172549[_0x9508('0xa')],'exten':_0x172549[_0x9508('0x6')],'priority':_0x59d3ee++,'VoiceExtensionId':_0x172549['id']});return _0x86540d;}function _0x343802(_0x2222b5){var _0x20df7d=0x2;var _0x5a303c=[{'type':_0x9508('0xf'),'app':_0x9508('0x3'),'appdata':_0x9508('0x10'),'context':_0x2222b5[_0x9508('0xa')],'exten':_0x2222b5[_0x9508('0x6')],'priority':_0x20df7d++,'VoiceExtensionId':_0x2222b5['id']},{'type':_0x9508('0xf'),'app':_0x2222b5['alias']?'Set':_0x9508('0x7'),'appdata':_0x2222b5['alias']?_0x9508('0x8')+_0x2222b5['alias']:_0x9508('0x9'),'context':_0x2222b5[_0x9508('0xa')],'exten':_0x2222b5[_0x9508('0x6')],'priority':_0x20df7d++,'VoiceExtensionId':_0x2222b5['id']},{'type':_0x9508('0xf'),'app':_0x9508('0x3'),'appdata':_0x9508('0x11')+(_0x2222b5[_0x9508('0x12')]?'${EXTEN:'+_0x2222b5['cutdigits']+'}':_0x9508('0x13')),'context':_0x2222b5[_0x9508('0xa')],'exten':_0x2222b5[_0x9508('0x6')],'priority':_0x20df7d++,'VoiceExtensionId':_0x2222b5['id']},{'type':_0x9508('0xf'),'app':_0x9508('0x3'),'appdata':_0x9508('0x14')+_0x2222b5['id'],'context':_0x2222b5['context'],'exten':_0x2222b5['exten'],'priority':_0x20df7d++,'VoiceExtensionId':_0x2222b5['id']},{'type':_0x9508('0xf'),'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x20df7d+0x2)+_0x9508('0x15')+(_0x20df7d+0x1)+')','context':_0x2222b5['context'],'exten':_0x2222b5['exten'],'priority':_0x20df7d++,'VoiceExtensionId':_0x2222b5['id']},{'type':_0x9508('0xf'),'app':_0x9508('0x3'),'appdata':_0x2222b5['cutdigits']?_0x9508('0x16')+_0x2222b5[_0x9508('0x12')]+'}':_0x9508('0x17'),'context':_0x2222b5[_0x9508('0xa')],'exten':_0x2222b5[_0x9508('0x6')],'priority':_0x20df7d++,'VoiceExtensionId':_0x2222b5['id']},{'type':_0x9508('0xf'),'app':_0x9508('0x3'),'appdata':_0x9508('0xd'),'context':_0x2222b5[_0x9508('0xa')],'exten':_0x2222b5[_0x9508('0x6')],'priority':_0x20df7d++,'VoiceExtensionId':_0x2222b5['id']},{'type':_0x9508('0xf'),'app':'Set','appdata':_0x9508('0x18'),'context':_0x2222b5[_0x9508('0xa')],'exten':_0x2222b5[_0x9508('0x6')],'priority':_0x20df7d++,'VoiceExtensionId':_0x2222b5['id']},{'type':'outbound','app':_0x9508('0x3'),'appdata':_0x9508('0xe'),'context':_0x2222b5['context'],'exten':_0x2222b5[_0x9508('0x6')],'priority':_0x20df7d++,'VoiceExtensionId':_0x2222b5['id']},{'type':_0x9508('0xf'),'app':'Set','appdata':_0x9508('0x19')+_0x2222b5['id'],'context':_0x2222b5[_0x9508('0xa')],'exten':_0x2222b5[_0x9508('0x6')],'priority':_0x20df7d++,'VoiceExtensionId':_0x2222b5['id']}];if(_0x2222b5[_0x9508('0x1a')]('recordingFormat')&&_0x2222b5['recordingFormat']!==_0x9508('0x1b')){_0x5a303c[_0x9508('0xc')]({'type':_0x9508('0xf'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x2222b5[_0x9508('0xa')],'exten':_0x2222b5[_0x9508('0x6')],'priority':_0x20df7d++,'VoiceExtensionId':_0x2222b5['id']},{'type':_0x9508('0xf'),'app':_0x9508('0x3'),'appdata':_0x9508('0x1c')+_0x2222b5[_0x9508('0x1d')]||_0x9508('0x1e'),'context':_0x2222b5[_0x9508('0xa')],'exten':_0x2222b5[_0x9508('0x6')],'priority':_0x20df7d++,'VoiceExtensionId':_0x2222b5['id']});}return _0x5a303c;}function _0x24840f(_0x4a34d2,_0x17ca13){var _0x27e248=[{'name':'trunk','param':0x0},{'name':_0x9508('0x1f'),'param':0x1},{'name':_0x9508('0x20'),'param':0x2},{'name':_0x9508('0x21'),'param':0x3}];var _0x307242={};var _0x282f83=_0x17ca13[_0x9508('0x22')](',');var _0x33e17c=[];for(var _0x3700f1=0x0;_0x3700f1<_0x27e248[_0x9508('0x23')];_0x3700f1++){switch(_0x27e248[_0x3700f1][_0x9508('0x24')]){case _0x9508('0x25'):_0x307242['trunk']=_0x282f83[_0x27e248[_0x3700f1][_0x9508('0x26')]]['split']('/')[0x1];_0x307242[_0x9508('0x27')]=_0x282f83[_0x27e248[_0x3700f1][_0x9508('0x26')]][_0x9508('0x22')]('/')[0x2];_0x307242['prefix']=_0x307242['phone']?_0x307242[_0x9508('0x27')][_0x9508('0x22')]('$')[0x0]:undefined;_0x307242[_0x9508('0x27')]=_0x4a34d2[_0x9508('0x12')]?(_0x307242['prefix']||'')+_0x9508('0x28')+_0x4a34d2['cutdigits']+'}':(_0x307242[_0x9508('0x29')]||'')+_0x9508('0x13');_0x33e17c[_0x27e248[_0x3700f1]['param']]=[_0x9508('0x2a'),_0x307242[_0x9508('0x25')],_0x307242['phone']][_0x9508('0x2b')]('/');break;case _0x9508('0x20'):_0x307242[_0x9508('0x20')]=_0x282f83[_0x27e248[_0x3700f1][_0x9508('0x26')]];if(_0x4a34d2['recordingFormat']!=='none'){if(_0x307242[_0x9508('0x20')]['indexOf'](_0x9508('0x2c'))<0x0){_0x307242[_0x9508('0x20')]+=_0x9508('0x2c');}}else{_0x307242[_0x9508('0x20')]=_0x307242['options']['replace']('U(xcally-mixmonitor-context)','');}_0x33e17c[_0x27e248[_0x3700f1][_0x9508('0x26')]]=_0x307242['options'];break;default:_0x33e17c[_0x27e248[_0x3700f1][_0x9508('0x26')]]=_0x282f83[_0x27e248[_0x3700f1]['param']];}}return _0x33e17c[_0x9508('0x2b')](',');}function _0x2925de(_0x21af4c,_0x464c1a,_0x5b456a){return new Promise(function(_0x152288,_0x57b2c){var _0x2c3381=[];if(_['isEmpty'](_0x464c1a))return _0x152288(_0x2c3381);_0x35878a[_0x9508('0x2d')][_0x9508('0x2e')]({'attributes':['id','interval',_0x9508('0x2f')],'raw':!![]})['then'](function(_0xd6d570){for(var _0x5b22d1=0x0,_0x5b4888=0x0;_0x5b22d1<_0x464c1a[_0x9508('0x23')];_0x5b22d1++,_0x5b4888=0x0){var _0x168afb=_0x464c1a[_0x5b22d1];var _0x1936c8=[];var _0x9c674f=[];delete _0x168afb['id'];if(_0x168afb[_0x9508('0x30')]!==_0x9508('0x31')){_0x168afb['intervals']=[_0x168afb[_0x9508('0x30')]];}else{_0x168afb[_0x9508('0x32')]=_0x168afb[_0x9508('0x2f')]?_['map'](_[_0x9508('0x33')](_0xd6d570,{'IntervalId':_0x168afb[_0x9508('0x2f')]}),_0x9508('0x30')):[];}_0x168afb[_0x9508('0xa')]=_0x21af4c['context'];_0x168afb[_0x9508('0x6')]=_0x21af4c['exten'];if(_0x168afb[_0x9508('0x5')])_0x168afb[_0x9508('0x5')]=_0x168afb['type'][_0x9508('0x34')]();if(_0x21af4c[_0x9508('0x5')]==='outbound'){if(_0x168afb[_0x9508('0x1a')](_0x9508('0x35'))&&_0x168afb['tag']&&_0x168afb[_0x9508('0x35')]!=='--'){_0x1936c8['push']({'type':_0x168afb[_0x9508('0x5')]['toLowerCase'](),'app':_0x9508('0x3'),'appdata':'CDR(tag)='+_0x168afb['tag'],'context':_0x21af4c['context'],'exten':_0x21af4c['exten'],'priority':_0x168afb[_0x9508('0x32')][_0x9508('0x23')]+_0x5b456a+_0x5b4888++,'VoiceExtensionId':_0x21af4c['id']});}_0x1936c8[_0x9508('0xc')]({'type':_0x168afb[_0x9508('0x5')][_0x9508('0x34')](),'app':_0x9508('0x36'),'appdata':_0x9508('0x37')+(_0x168afb[_0x9508('0x38')]?_0x9508('0x39')+_0x168afb['callerID']+')':_0x9508('0x3a')),'context':_0x21af4c[_0x9508('0xa')],'exten':_0x21af4c[_0x9508('0x6')],'priority':_0x168afb[_0x9508('0x32')][_0x9508('0x23')]+_0x5b456a+_0x5b4888++,'VoiceExtensionId':_0x21af4c['id']});}else{if(_0x168afb['hasOwnProperty']('answer')){if([_0x9508('0x3b'),'playback'][_0x9508('0x3c')](_0x168afb[_0x9508('0x3d')]['toLowerCase']())&&_0x168afb[_0x9508('0x3e')]!=='custom'){if(_0x168afb['answer']){_0x1936c8[_0x9508('0xc')]({'type':_0x168afb[_0x9508('0x5')]['toLowerCase'](),'app':_0x9508('0x36'),'appdata':_0x9508('0x3f'),'context':_0x21af4c[_0x9508('0xa')],'exten':_0x21af4c[_0x9508('0x6')],'priority':_0x168afb[_0x9508('0x32')][_0x9508('0x23')]+_0x5b456a+_0x5b4888++,'VoiceExtensionId':_0x21af4c['id']});_0x1936c8[_0x9508('0xc')]({'type':_0x168afb[_0x9508('0x5')][_0x9508('0x34')](),'app':_0x9508('0x3'),'appdata':_0x9508('0x40'),'context':_0x21af4c[_0x9508('0xa')],'exten':_0x21af4c[_0x9508('0x6')],'priority':_0x168afb[_0x9508('0x32')]['length']+_0x5b456a+_0x5b4888++,'VoiceExtensionId':_0x21af4c['id']});}else{_0x1936c8[_0x9508('0xc')]({'type':_0x168afb[_0x9508('0x5')]['toLowerCase'](),'app':_0x9508('0x36'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x21af4c['context'],'exten':_0x21af4c[_0x9508('0x6')],'priority':_0x168afb[_0x9508('0x32')]['length']+_0x5b456a+_0x5b4888++,'VoiceExtensionId':_0x21af4c['id']});_0x1936c8[_0x9508('0xc')]({'type':_0x168afb[_0x9508('0x5')]['toLowerCase'](),'app':_0x9508('0x3'),'appdata':_0x9508('0x41'),'context':_0x21af4c[_0x9508('0xa')],'exten':_0x21af4c['exten'],'priority':_0x168afb[_0x9508('0x32')][_0x9508('0x23')]+_0x5b456a+_0x5b4888++,'VoiceExtensionId':_0x21af4c['id']});}}}}for(var _0x17ad2b=0x0;_0x17ad2b<_0x168afb[_0x9508('0x32')][_0x9508('0x23')];_0x17ad2b++){var _0x34a4c5=_0x5b456a+_0x168afb['intervals'][_0x9508('0x23')];var _0x460780=_0x17ad2b===_0x168afb[_0x9508('0x32')][_0x9508('0x23')]-0x1?_0x5b456a+_0x1936c8['length']+_0x9c674f[_0x9508('0x23')]+0x2:_0x5b456a+_0x17ad2b+0x1;_0x1936c8['splice'](_0x17ad2b,0x0,{'type':_0x21af4c[_0x9508('0x5')],'app':_0x9508('0x42'),'appdata':_0x168afb['intervals'][_0x17ad2b]+'?'+_0x21af4c[_0x9508('0xa')]+_0x9508('0x43')+_0x34a4c5+':'+_0x21af4c['context']+_0x9508('0x43')+_0x460780,'exten':_0x21af4c[_0x9508('0x6')],'context':_0x21af4c[_0x9508('0xa')],'priority':_0x5b456a+_0x17ad2b,'VoiceExtensionId':_0x21af4c['id']});}if(_0x168afb[_0x9508('0x3e')]==='outboundDial'){_0x168afb[_0x9508('0x44')]=_0x24840f(_0x21af4c,_0x168afb[_0x9508('0x44')]);}if(_0x168afb[_0x9508('0x3e')]===_0x9508('0x45')){_0x1936c8[_0x9508('0xc')]({'type':_0x168afb[_0x9508('0x5')][_0x9508('0x34')](),'app':_0x9508('0x3'),'appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x21af4c[_0x9508('0xa')],'exten':_0x21af4c[_0x9508('0x6')],'priority':_0x168afb[_0x9508('0x32')]['length']+_0x5b456a+_0x5b4888++,'VoiceExtensionId':_0x21af4c['id']});}_0x168afb[_0x9508('0x46')]=_0x1936c8['length']?_[_0x9508('0x47')](_0x1936c8)['priority']+0x1:_0x5b456a;_0x2c3381=_['concat'](_0x2c3381,_0x1936c8,[_0x168afb],_0x9c674f);_0x5b456a=_['last'](_0x2c3381)[_0x9508('0x46')]+0x1;}return _0x152288(_0x2c3381);})[_0x9508('0x48')](function(_0x22c0c9){_0x57b2c(_0x22c0c9);});});}return _0x2d60c7['define'](_0x9508('0x49'),attributes,{'tableName':_0x9508('0x4a'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3a092a){var _0x74ec10=this[_0x9508('0x4b')]({'plain':!![]});var _0x48cc43=_0x74ec10['type']===_0x9508('0xf')?_0x343802(_0x74ec10):_0x100d7e(_0x74ec10);return _0x2925de(_0x74ec10,_0x3a092a,_[_0x9508('0x47')](_0x48cc43)[_0x9508('0x46')]+0x1)[_0x9508('0x4c')](function(_0x306709){var _0x3ec6b7=_[_0x9508('0x4d')](_0x48cc43,_0x306709);_0x3ec6b7[_0x9508('0xc')]({'type':_0x74ec10[_0x9508('0x5')],'app':_0x9508('0x4e'),'exten':_0x74ec10[_0x9508('0x6')],'context':_0x74ec10[_0x9508('0xa')],'priority':_['last'](_0x3ec6b7)['priority']+0x1,'VoiceExtensionId':_0x74ec10['id']});return _0x3ec6b7;});}}});}; \ No newline at end of file +var _0x7b3a=['outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','XCALLY-MOTION-ANSWER=0','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','param','phone','prefix','SIP','join','replace','U(xcally-mixmonitor-context)','isEmpty','Interval','interval','then','*,*,*,*','intervals','IntervalId','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','hasOwnProperty','answer','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','last','priority','concat','define','voice_extensions','get','Hangup','lodash','exports','type','Set','context','exten','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab'];(function(_0x3bba82,_0x5463fb){var _0x3f47f0=function(_0x28ed78){while(--_0x28ed78){_0x3bba82['push'](_0x3bba82['shift']());}};_0x3f47f0(++_0x5463fb);}(_0x7b3a,0x93));var _0xa7b3=function(_0x53b911,_0x4b8ad4){_0x53b911=_0x53b911-0x0;var _0x43c0b5=_0x7b3a[_0x53b911];return _0x43c0b5;};'use strict';var _=require(_0xa7b3('0x0'));var attributes=require('./voiceExtension.attributes');module[_0xa7b3('0x1')]=function(_0x4e809c){var _0x96238b=_0x4e809c['models'];function _0x58986f(_0x49f6f4){var _0x28af8b=0x2;var _0x444e13=[{'type':_0x49f6f4[_0xa7b3('0x2')],'app':_0xa7b3('0x3'),'appdata':'CDR(type)='+_0x49f6f4[_0xa7b3('0x2')],'context':_0x49f6f4[_0xa7b3('0x4')],'exten':_0x49f6f4[_0xa7b3('0x5')],'priority':_0x28af8b++,'VoiceExtensionId':_0x49f6f4['id']},{'type':_0x49f6f4[_0xa7b3('0x2')],'app':_0x49f6f4['alias']?_0xa7b3('0x3'):_0xa7b3('0x6'),'appdata':_0x49f6f4[_0xa7b3('0x7')]?_0xa7b3('0x8')+_0x49f6f4['alias']:_0xa7b3('0x9'),'context':_0x49f6f4['context'],'exten':_0x49f6f4['exten'],'priority':_0x28af8b++,'VoiceExtensionId':_0x49f6f4['id']}];if(_0x49f6f4[_0xa7b3('0x2')]===_0xa7b3('0xa')){_0x444e13[_0xa7b3('0xb')]({'type':_0xa7b3('0xa'),'app':'Set','appdata':_0xa7b3('0xc')+_0x49f6f4['id'],'context':_0x49f6f4[_0xa7b3('0x4')],'exten':_0x49f6f4[_0xa7b3('0x5')],'priority':_0x28af8b++,'VoiceExtensionId':_0x49f6f4['id']});}_0x444e13[_0xa7b3('0xb')]({'type':_0x49f6f4[_0xa7b3('0x2')],'app':_0xa7b3('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x49f6f4[_0xa7b3('0x4')],'exten':_0x49f6f4[_0xa7b3('0x5')],'priority':_0x28af8b++,'VoiceExtensionId':_0x49f6f4['id']},{'type':_0x49f6f4[_0xa7b3('0x2')],'app':_0xa7b3('0x3'),'appdata':_0xa7b3('0xd'),'context':_0x49f6f4['context'],'exten':_0x49f6f4['exten'],'priority':_0x28af8b++,'VoiceExtensionId':_0x49f6f4['id']},{'type':_0x49f6f4[_0xa7b3('0x2')],'app':'Set','appdata':_0xa7b3('0xe'),'context':_0x49f6f4[_0xa7b3('0x4')],'exten':_0x49f6f4['exten'],'priority':_0x28af8b++,'VoiceExtensionId':_0x49f6f4['id']});return _0x444e13;}function _0xd6ef97(_0x3f4bdb){var _0x383605=0x2;var _0x219ac5=[{'type':_0xa7b3('0xf'),'app':_0xa7b3('0x3'),'appdata':_0xa7b3('0x10'),'context':_0x3f4bdb[_0xa7b3('0x4')],'exten':_0x3f4bdb['exten'],'priority':_0x383605++,'VoiceExtensionId':_0x3f4bdb['id']},{'type':_0xa7b3('0xf'),'app':_0x3f4bdb[_0xa7b3('0x7')]?'Set':_0xa7b3('0x6'),'appdata':_0x3f4bdb['alias']?'CDR(routeAlias)='+_0x3f4bdb[_0xa7b3('0x7')]:'No\x20alias\x20set','context':_0x3f4bdb['context'],'exten':_0x3f4bdb[_0xa7b3('0x5')],'priority':_0x383605++,'VoiceExtensionId':_0x3f4bdb['id']},{'type':_0xa7b3('0xf'),'app':_0xa7b3('0x3'),'appdata':_0xa7b3('0x11')+(_0x3f4bdb[_0xa7b3('0x12')]?_0xa7b3('0x13')+_0x3f4bdb[_0xa7b3('0x12')]+'}':_0xa7b3('0x14')),'context':_0x3f4bdb[_0xa7b3('0x4')],'exten':_0x3f4bdb[_0xa7b3('0x5')],'priority':_0x383605++,'VoiceExtensionId':_0x3f4bdb['id']},{'type':_0xa7b3('0xf'),'app':_0xa7b3('0x3'),'appdata':_0xa7b3('0xc')+_0x3f4bdb['id'],'context':_0x3f4bdb['context'],'exten':_0x3f4bdb[_0xa7b3('0x5')],'priority':_0x383605++,'VoiceExtensionId':_0x3f4bdb['id']},{'type':'outbound','app':_0xa7b3('0x15'),'appdata':_0xa7b3('0x16')+(_0x383605+0x2)+_0xa7b3('0x17')+(_0x383605+0x1)+')','context':_0x3f4bdb[_0xa7b3('0x4')],'exten':_0x3f4bdb[_0xa7b3('0x5')],'priority':_0x383605++,'VoiceExtensionId':_0x3f4bdb['id']},{'type':_0xa7b3('0xf'),'app':_0xa7b3('0x3'),'appdata':_0x3f4bdb[_0xa7b3('0x12')]?_0xa7b3('0x18')+_0x3f4bdb[_0xa7b3('0x12')]+'}':'CDR(prefix)=noprefix','context':_0x3f4bdb[_0xa7b3('0x4')],'exten':_0x3f4bdb[_0xa7b3('0x5')],'priority':_0x383605++,'VoiceExtensionId':_0x3f4bdb['id']},{'type':_0xa7b3('0xf'),'app':_0xa7b3('0x3'),'appdata':_0xa7b3('0x19'),'context':_0x3f4bdb[_0xa7b3('0x4')],'exten':_0x3f4bdb[_0xa7b3('0x5')],'priority':_0x383605++,'VoiceExtensionId':_0x3f4bdb['id']},{'type':'outbound','app':_0xa7b3('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3f4bdb[_0xa7b3('0x4')],'exten':_0x3f4bdb[_0xa7b3('0x5')],'priority':_0x383605++,'VoiceExtensionId':_0x3f4bdb['id']},{'type':_0xa7b3('0xf'),'app':_0xa7b3('0x3'),'appdata':_0xa7b3('0xe'),'context':_0x3f4bdb[_0xa7b3('0x4')],'exten':_0x3f4bdb[_0xa7b3('0x5')],'priority':_0x383605++,'VoiceExtensionId':_0x3f4bdb['id']},{'type':_0xa7b3('0xf'),'app':'Set','appdata':'outboundrouteid='+_0x3f4bdb['id'],'context':_0x3f4bdb[_0xa7b3('0x4')],'exten':_0x3f4bdb[_0xa7b3('0x5')],'priority':_0x383605++,'VoiceExtensionId':_0x3f4bdb['id']}];if(_0x3f4bdb['hasOwnProperty']('recordingFormat')&&_0x3f4bdb[_0xa7b3('0x1a')]!==_0xa7b3('0x1b')){_0x219ac5[_0xa7b3('0xb')]({'type':_0xa7b3('0xf'),'app':_0xa7b3('0x3'),'appdata':_0xa7b3('0x1c'),'context':_0x3f4bdb['context'],'exten':_0x3f4bdb['exten'],'priority':_0x383605++,'VoiceExtensionId':_0x3f4bdb['id']},{'type':_0xa7b3('0xf'),'app':_0xa7b3('0x3'),'appdata':_0xa7b3('0x1d')+_0x3f4bdb[_0xa7b3('0x1a')]||_0xa7b3('0x1e'),'context':_0x3f4bdb['context'],'exten':_0x3f4bdb[_0xa7b3('0x5')],'priority':_0x383605++,'VoiceExtensionId':_0x3f4bdb['id']});}return _0x219ac5;}function _0x27d087(_0x4c5956,_0x27f3c7){var _0x1f56e5=[{'name':_0xa7b3('0x1f'),'param':0x0},{'name':_0xa7b3('0x20'),'param':0x1},{'name':_0xa7b3('0x21'),'param':0x2},{'name':_0xa7b3('0x22'),'param':0x3}];var _0x4ad836={};var _0xb8c28b=_0x27f3c7[_0xa7b3('0x23')](',');var _0x853c15=[];for(var _0x39479c=0x0;_0x39479c<_0x1f56e5[_0xa7b3('0x24')];_0x39479c++){switch(_0x1f56e5[_0x39479c][_0xa7b3('0x25')]){case _0xa7b3('0x1f'):_0x4ad836[_0xa7b3('0x1f')]=_0xb8c28b[_0x1f56e5[_0x39479c][_0xa7b3('0x26')]][_0xa7b3('0x23')]('/')[0x1];_0x4ad836[_0xa7b3('0x27')]=_0xb8c28b[_0x1f56e5[_0x39479c][_0xa7b3('0x26')]][_0xa7b3('0x23')]('/')[0x2];_0x4ad836['prefix']=_0x4ad836['phone']?_0x4ad836[_0xa7b3('0x27')][_0xa7b3('0x23')]('$')[0x0]:undefined;_0x4ad836['phone']=_0x4c5956[_0xa7b3('0x12')]?(_0x4ad836[_0xa7b3('0x28')]||'')+'${EXTEN:'+_0x4c5956['cutdigits']+'}':(_0x4ad836[_0xa7b3('0x28')]||'')+'${EXTEN}';_0x853c15[_0x1f56e5[_0x39479c][_0xa7b3('0x26')]]=[_0xa7b3('0x29'),_0x4ad836[_0xa7b3('0x1f')],_0x4ad836['phone']][_0xa7b3('0x2a')]('/');break;case _0xa7b3('0x21'):_0x4ad836[_0xa7b3('0x21')]=_0xb8c28b[_0x1f56e5[_0x39479c]['param']];if(_0x4c5956[_0xa7b3('0x1a')]!==_0xa7b3('0x1b')){if(_0x4ad836[_0xa7b3('0x21')]['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x4ad836[_0xa7b3('0x21')]+='U(xcally-mixmonitor-context)';}}else{_0x4ad836[_0xa7b3('0x21')]=_0x4ad836[_0xa7b3('0x21')][_0xa7b3('0x2b')](_0xa7b3('0x2c'),'');}_0x853c15[_0x1f56e5[_0x39479c][_0xa7b3('0x26')]]=_0x4ad836[_0xa7b3('0x21')];break;default:_0x853c15[_0x1f56e5[_0x39479c]['param']]=_0xb8c28b[_0x1f56e5[_0x39479c][_0xa7b3('0x26')]];}}return _0x853c15[_0xa7b3('0x2a')](',');}function _0x255de4(_0x3d3a39,_0x540d42,_0x128259){return new Promise(function(_0x3a0f1c,_0x52eba4){var _0x4b04fd=[];if(_[_0xa7b3('0x2d')](_0x540d42))return _0x3a0f1c(_0x4b04fd);_0x96238b[_0xa7b3('0x2e')]['findAll']({'attributes':['id',_0xa7b3('0x2f'),'IntervalId'],'raw':!![]})[_0xa7b3('0x30')](function(_0x1e1696){for(var _0x3edaa4=0x0,_0x56c46c=0x0;_0x3edaa4<_0x540d42[_0xa7b3('0x24')];_0x3edaa4++,_0x56c46c=0x0){var _0x214779=_0x540d42[_0x3edaa4];var _0x2a7038=[];var _0x42fd90=[];delete _0x214779['id'];if(_0x214779[_0xa7b3('0x2f')]!==_0xa7b3('0x31')){_0x214779[_0xa7b3('0x32')]=[_0x214779[_0xa7b3('0x2f')]];}else{_0x214779[_0xa7b3('0x32')]=_0x214779[_0xa7b3('0x33')]?_[_0xa7b3('0x34')](_[_0xa7b3('0x35')](_0x1e1696,{'IntervalId':_0x214779['IntervalId']}),'interval'):[];}_0x214779[_0xa7b3('0x4')]=_0x3d3a39[_0xa7b3('0x4')];_0x214779[_0xa7b3('0x5')]=_0x3d3a39[_0xa7b3('0x5')];if(_0x214779[_0xa7b3('0x2')])_0x214779['type']=_0x214779[_0xa7b3('0x2')][_0xa7b3('0x36')]();if(_0x3d3a39['type']==='outbound'){if(_0x214779['hasOwnProperty'](_0xa7b3('0x37'))&&_0x214779['tag']&&_0x214779['tag']!=='--'){_0x2a7038[_0xa7b3('0xb')]({'type':_0x214779[_0xa7b3('0x2')][_0xa7b3('0x36')](),'app':_0xa7b3('0x3'),'appdata':_0xa7b3('0x38')+_0x214779[_0xa7b3('0x37')],'context':_0x3d3a39[_0xa7b3('0x4')],'exten':_0x3d3a39[_0xa7b3('0x5')],'priority':_0x214779[_0xa7b3('0x32')][_0xa7b3('0x24')]+_0x128259+_0x56c46c++,'VoiceExtensionId':_0x3d3a39['id']});}_0x2a7038[_0xa7b3('0xb')]({'type':_0x214779[_0xa7b3('0x2')]['toLowerCase'](),'app':_0xa7b3('0x15'),'appdata':_0xa7b3('0x39')+(_0x214779['callerID']?'Set(CALLERID(all)='+_0x214779[_0xa7b3('0x3a')]+')':'NoOp(No\x20number\x20available)'),'context':_0x3d3a39['context'],'exten':_0x3d3a39[_0xa7b3('0x5')],'priority':_0x214779[_0xa7b3('0x32')]['length']+_0x128259+_0x56c46c++,'VoiceExtensionId':_0x3d3a39['id']});}else{if(_0x214779[_0xa7b3('0x3b')](_0xa7b3('0x3c'))){if(['queue','playback'][_0xa7b3('0x3d')](_0x214779[_0xa7b3('0x3e')]['toLowerCase']())&&_0x214779[_0xa7b3('0x3f')]!==_0xa7b3('0x40')){if(_0x214779[_0xa7b3('0x3c')]){_0x2a7038[_0xa7b3('0xb')]({'type':_0x214779['type']['toLowerCase'](),'app':_0xa7b3('0x15'),'appdata':_0xa7b3('0x41'),'context':_0x3d3a39[_0xa7b3('0x4')],'exten':_0x3d3a39[_0xa7b3('0x5')],'priority':_0x214779[_0xa7b3('0x32')][_0xa7b3('0x24')]+_0x128259+_0x56c46c++,'VoiceExtensionId':_0x3d3a39['id']});_0x2a7038[_0xa7b3('0xb')]({'type':_0x214779[_0xa7b3('0x2')]['toLowerCase'](),'app':_0xa7b3('0x3'),'appdata':_0xa7b3('0x42'),'context':_0x3d3a39[_0xa7b3('0x4')],'exten':_0x3d3a39[_0xa7b3('0x5')],'priority':_0x214779[_0xa7b3('0x32')][_0xa7b3('0x24')]+_0x128259+_0x56c46c++,'VoiceExtensionId':_0x3d3a39['id']});}else{_0x2a7038[_0xa7b3('0xb')]({'type':_0x214779[_0xa7b3('0x2')][_0xa7b3('0x36')](),'app':_0xa7b3('0x15'),'appdata':_0xa7b3('0x43'),'context':_0x3d3a39[_0xa7b3('0x4')],'exten':_0x3d3a39['exten'],'priority':_0x214779[_0xa7b3('0x32')][_0xa7b3('0x24')]+_0x128259+_0x56c46c++,'VoiceExtensionId':_0x3d3a39['id']});_0x2a7038[_0xa7b3('0xb')]({'type':_0x214779[_0xa7b3('0x2')]['toLowerCase'](),'app':_0xa7b3('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x3d3a39['context'],'exten':_0x3d3a39[_0xa7b3('0x5')],'priority':_0x214779[_0xa7b3('0x32')]['length']+_0x128259+_0x56c46c++,'VoiceExtensionId':_0x3d3a39['id']});}}}}for(var _0x545860=0x0;_0x545860<_0x214779[_0xa7b3('0x32')][_0xa7b3('0x24')];_0x545860++){var _0x4da888=_0x128259+_0x214779[_0xa7b3('0x32')][_0xa7b3('0x24')];var _0x2181ad=_0x545860===_0x214779[_0xa7b3('0x32')][_0xa7b3('0x24')]-0x1?_0x128259+_0x2a7038['length']+_0x42fd90[_0xa7b3('0x24')]+0x2:_0x128259+_0x545860+0x1;_0x2a7038[_0xa7b3('0x44')](_0x545860,0x0,{'type':_0x3d3a39['type'],'app':_0xa7b3('0x45'),'appdata':_0x214779[_0xa7b3('0x32')][_0x545860]+'?'+_0x3d3a39[_0xa7b3('0x4')]+_0xa7b3('0x46')+_0x4da888+':'+_0x3d3a39[_0xa7b3('0x4')]+',${EXTEN},'+_0x2181ad,'exten':_0x3d3a39[_0xa7b3('0x5')],'context':_0x3d3a39[_0xa7b3('0x4')],'priority':_0x128259+_0x545860,'VoiceExtensionId':_0x3d3a39['id']});}if(_0x214779[_0xa7b3('0x3f')]==='outboundDial'){_0x214779[_0xa7b3('0x47')]=_0x27d087(_0x3d3a39,_0x214779[_0xa7b3('0x47')]);}if(_0x214779[_0xa7b3('0x3f')]===_0xa7b3('0x48')){_0x2a7038['push']({'type':_0x214779[_0xa7b3('0x2')][_0xa7b3('0x36')](),'app':_0xa7b3('0x3'),'appdata':_0xa7b3('0x49'),'context':_0x3d3a39[_0xa7b3('0x4')],'exten':_0x3d3a39[_0xa7b3('0x5')],'priority':_0x214779['intervals'][_0xa7b3('0x24')]+_0x128259+_0x56c46c++,'VoiceExtensionId':_0x3d3a39['id']});}_0x214779['priority']=_0x2a7038[_0xa7b3('0x24')]?_[_0xa7b3('0x4a')](_0x2a7038)[_0xa7b3('0x4b')]+0x1:_0x128259;_0x4b04fd=_[_0xa7b3('0x4c')](_0x4b04fd,_0x2a7038,[_0x214779],_0x42fd90);_0x128259=_[_0xa7b3('0x4a')](_0x4b04fd)[_0xa7b3('0x4b')]+0x1;}return _0x3a0f1c(_0x4b04fd);})['catch'](function(_0x2a77e8){_0x52eba4(_0x2a77e8);});});}return _0x4e809c[_0xa7b3('0x4d')]('VoiceExtension',attributes,{'tableName':_0xa7b3('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x7c215c){var _0x5c8f81=this[_0xa7b3('0x4f')]({'plain':!![]});var _0x1a1c2b=_0x5c8f81['type']==='outbound'?_0xd6ef97(_0x5c8f81):_0x58986f(_0x5c8f81);return _0x255de4(_0x5c8f81,_0x7c215c,_['last'](_0x1a1c2b)[_0xa7b3('0x4b')]+0x1)[_0xa7b3('0x30')](function(_0x3b07de){var _0x9b60da=_['concat'](_0x1a1c2b,_0x3b07de);_0x9b60da[_0xa7b3('0xb')]({'type':_0x5c8f81[_0xa7b3('0x2')],'app':_0xa7b3('0x50'),'exten':_0x5c8f81['exten'],'context':_0x5c8f81[_0xa7b3('0x4')],'priority':_['last'](_0x9b60da)[_0xa7b3('0x4b')]+0x1,'VoiceExtensionId':_0x5c8f81['id']});return _0x9b60da;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 6dfabd2..61fc6dc 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 _0xb0df=['VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','then','GetVoiceExtension','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','./voiceExtension.socket','request'];(function(_0x1f9f96,_0x441b53){var _0x2a7bdb=function(_0x348202){while(--_0x348202){_0x1f9f96['push'](_0x1f9f96['shift']());}};_0x2a7bdb(++_0x441b53);}(_0xb0df,0x85));var _0xfb0d=function(_0x5a4b42,_0x2b9c18){_0x5a4b42=_0x5a4b42-0x0;var _0x5e81d6=_0xb0df[_0x5a4b42];return _0x5e81d6;};'use strict';var _=require('lodash');var util=require(_0xfb0d('0x0'));var moment=require(_0xfb0d('0x1'));var BPromise=require(_0xfb0d('0x2'));var rs=require(_0xfb0d('0x3'));var fs=require('fs');var Redis=require(_0xfb0d('0x4'));var db=require(_0xfb0d('0x5'))['db'];var utils=require(_0xfb0d('0x6'));var logger=require(_0xfb0d('0x7'))(_0xfb0d('0x8'));var config=require('../../config/environment');var jayson=require(_0xfb0d('0x9'));var client=jayson[_0xfb0d('0xa')]['http']({'port':0x232a});config['redis']=_[_0xfb0d('0xb')](config[_0xfb0d('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfb0d('0xc')]));require(_0xfb0d('0xd'))['register'](socket);function respondWithRpcPromise(_0x1faf12,_0x41f716,_0x34398f){return new BPromise(function(_0x36043a,_0xf6ee9b){return client[_0xfb0d('0xe')](_0x1faf12,_0x34398f)['then'](function(_0x473b9d){logger['info'](_0xfb0d('0xf'),_0x41f716,_0xfb0d('0x10'));logger[_0xfb0d('0x11')](_0xfb0d('0x12'),_0x41f716,_0xfb0d('0x10'),JSON[_0xfb0d('0x13')](_0x473b9d));if(_0x473b9d[_0xfb0d('0x14')]){if(_0x473b9d['error']['code']===0x1f4){logger['error'](_0xfb0d('0xf'),_0x41f716,_0x473b9d[_0xfb0d('0x14')][_0xfb0d('0x15')]);return _0xf6ee9b(_0x473b9d[_0xfb0d('0x14')][_0xfb0d('0x15')]);}logger[_0xfb0d('0x14')](_0xfb0d('0xf'),_0x41f716,_0x473b9d['error'][_0xfb0d('0x15')]);return _0x36043a(_0x473b9d[_0xfb0d('0x14')][_0xfb0d('0x15')]);}else{logger[_0xfb0d('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x41f716,_0xfb0d('0x10'));_0x36043a(_0x473b9d[_0xfb0d('0x17')][_0xfb0d('0x15')]);}})[_0xfb0d('0x18')](function(_0x190c64){logger[_0xfb0d('0x14')](_0xfb0d('0xf'),_0x41f716,_0x190c64);_0xf6ee9b(_0x190c64);});});}exports['GetVoiceExtension']=function(_0x1b869f){var _0xa5da11=this;return new Promise(function(_0x2baa88,_0x412173){return db[_0xfb0d('0x19')][_0xfb0d('0x1a')]({'raw':_0x1b869f[_0xfb0d('0x1b')]?_0x1b869f[_0xfb0d('0x1b')][_0xfb0d('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b869f[_0xfb0d('0x1b')]?_0x1b869f[_0xfb0d('0x1b')][_0xfb0d('0x1d')]||null:null,'attributes':_0x1b869f['options']?_0x1b869f[_0xfb0d('0x1b')][_0xfb0d('0x1e')]||null:null,'limit':_0x1b869f['options']?_0x1b869f['options'][_0xfb0d('0x1f')]||null:null,'include':_0x1b869f[_0xfb0d('0x1b')]?_0x1b869f['options'][_0xfb0d('0x20')]?_[_0xfb0d('0x21')](_0x1b869f[_0xfb0d('0x1b')][_0xfb0d('0x20')],function(_0xec0688){return{'model':db[_0xec0688[_0xfb0d('0x22')]],'as':_0xec0688['as'],'attributes':_0xec0688[_0xfb0d('0x1e')],'include':_0xec0688[_0xfb0d('0x20')]?_[_0xfb0d('0x21')](_0xec0688[_0xfb0d('0x20')],function(_0x1c6770){return{'model':db[_0x1c6770[_0xfb0d('0x22')]],'as':_0x1c6770['as'],'attributes':_0x1c6770['attributes'],'include':_0x1c6770[_0xfb0d('0x20')]?_[_0xfb0d('0x21')](_0x1c6770['include'],function(_0x13de4){return{'model':db[_0x13de4[_0xfb0d('0x22')]],'as':_0x13de4['as'],'attributes':_0x13de4[_0xfb0d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfb0d('0x23')](function(_0x5b8913){logger['info'](_0xfb0d('0x24'),_0x1b869f);logger['debug'](_0xfb0d('0x24'),_0x1b869f,JSON['stringify'](_0x5b8913));_0x2baa88(_0x5b8913);})[_0xfb0d('0x18')](function(_0x3093f5){logger[_0xfb0d('0x14')](_0xfb0d('0x24'),_0x3093f5['message'],_0x1b869f);_0x412173(_0xa5da11['error'](0x1f4,_0x3093f5[_0xfb0d('0x15')]));});});}; \ No newline at end of file +var _0x1228=['socket.io-emitter','./voiceExtension.socket','register','then','info','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','GetVoiceExtension','VoiceExtension','options','raw','where','limit','include','map','model','attributes','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost'];(function(_0x38e47a,_0xc032eb){var _0x1b0649=function(_0x392ba2){while(--_0x392ba2){_0x38e47a['push'](_0x38e47a['shift']());}};_0x1b0649(++_0xc032eb);}(_0x1228,0x12f));var _0x8122=function(_0x4287e9,_0x31f01c){_0x4287e9=_0x4287e9-0x0;var _0x2f8390=_0x1228[_0x4287e9];return _0x2f8390;};'use strict';var _=require(_0x8122('0x0'));var util=require('util');var moment=require(_0x8122('0x1'));var BPromise=require('bluebird');var rs=require(_0x8122('0x2'));var fs=require('fs');var Redis=require(_0x8122('0x3'));var db=require(_0x8122('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8122('0x5'))(_0x8122('0x6'));var config=require('../../config/environment');var jayson=require(_0x8122('0x7'));var client=jayson[_0x8122('0x8')]['http']({'port':0x232a});config[_0x8122('0x9')]=_[_0x8122('0xa')](config['redis'],{'host':_0x8122('0xb'),'port':0x18eb});var socket=require(_0x8122('0xc'))(new Redis(config['redis']));require(_0x8122('0xd'))[_0x8122('0xe')](socket);function respondWithRpcPromise(_0x4a1378,_0x5a7875,_0x4fa7b3){return new BPromise(function(_0x52f48b,_0x208043){return client['request'](_0x4a1378,_0x4fa7b3)[_0x8122('0xf')](function(_0x23a9e4){logger[_0x8122('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x5a7875,_0x8122('0x11'));logger['debug'](_0x8122('0x12'),_0x5a7875,_0x8122('0x11'),JSON[_0x8122('0x13')](_0x23a9e4));if(_0x23a9e4[_0x8122('0x14')]){if(_0x23a9e4[_0x8122('0x14')][_0x8122('0x15')]===0x1f4){logger[_0x8122('0x14')](_0x8122('0x16'),_0x5a7875,_0x23a9e4[_0x8122('0x14')][_0x8122('0x17')]);return _0x208043(_0x23a9e4[_0x8122('0x14')][_0x8122('0x17')]);}logger['error'](_0x8122('0x16'),_0x5a7875,_0x23a9e4['error'][_0x8122('0x17')]);return _0x52f48b(_0x23a9e4['error'][_0x8122('0x17')]);}else{logger[_0x8122('0x10')](_0x8122('0x16'),_0x5a7875,_0x8122('0x11'));_0x52f48b(_0x23a9e4['result']['message']);}})['catch'](function(_0x56a926){logger[_0x8122('0x14')](_0x8122('0x16'),_0x5a7875,_0x56a926);_0x208043(_0x56a926);});});}exports[_0x8122('0x18')]=function(_0x5a5a57){var _0x5df55f=this;return new Promise(function(_0x1162a8,_0x174321){return db[_0x8122('0x19')]['findAll']({'raw':_0x5a5a57[_0x8122('0x1a')]?_0x5a5a57[_0x8122('0x1a')][_0x8122('0x1b')]===undefined?!![]:![]:!![],'where':_0x5a5a57[_0x8122('0x1a')]?_0x5a5a57[_0x8122('0x1a')][_0x8122('0x1c')]||null:null,'attributes':_0x5a5a57[_0x8122('0x1a')]?_0x5a5a57[_0x8122('0x1a')]['attributes']||null:null,'limit':_0x5a5a57[_0x8122('0x1a')]?_0x5a5a57['options'][_0x8122('0x1d')]||null:null,'include':_0x5a5a57[_0x8122('0x1a')]?_0x5a5a57[_0x8122('0x1a')][_0x8122('0x1e')]?_[_0x8122('0x1f')](_0x5a5a57[_0x8122('0x1a')][_0x8122('0x1e')],function(_0x2708a5){return{'model':db[_0x2708a5[_0x8122('0x20')]],'as':_0x2708a5['as'],'attributes':_0x2708a5['attributes'],'include':_0x2708a5[_0x8122('0x1e')]?_[_0x8122('0x1f')](_0x2708a5[_0x8122('0x1e')],function(_0xc90a18){return{'model':db[_0xc90a18[_0x8122('0x20')]],'as':_0xc90a18['as'],'attributes':_0xc90a18[_0x8122('0x21')],'include':_0xc90a18[_0x8122('0x1e')]?_[_0x8122('0x1f')](_0xc90a18[_0x8122('0x1e')],function(_0x4610b1){return{'model':db[_0x4610b1['model']],'as':_0x4610b1['as'],'attributes':_0x4610b1['attributes']};}):[]};}):[]};}):[]:[]})[_0x8122('0xf')](function(_0x264ccf){logger['info']('GetVoiceExtension',_0x5a5a57);logger[_0x8122('0x22')](_0x8122('0x18'),_0x5a5a57,JSON[_0x8122('0x13')](_0x264ccf));_0x1162a8(_0x264ccf);})['catch'](function(_0x4c8339){logger[_0x8122('0x14')](_0x8122('0x18'),_0x4c8339[_0x8122('0x17')],_0x5a5a57);_0x174321(_0x5df55f[_0x8122('0x14')](0x1f4,_0x4c8339[_0x8122('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 8aac9a2..04ec2c2 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 _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x1049e9,_0x40420f){var _0x15f975=function(_0x209cdc){while(--_0x209cdc){_0x1049e9['push'](_0x1049e9['shift']());}};_0x15f975(++_0x40420f);}(_0xabce,0x103));var _0xeabc=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xabce[_0x21aec3];return _0x288bbc;};'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 +var _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x304f39,_0x8d26df){var _0x3d2608=function(_0x431358){while(--_0x431358){_0x304f39['push'](_0x304f39['shift']());}};_0x3d2608(++_0x8d26df);}(_0x7a54,0x106));var _0x47a5=function(_0x210fc3,_0x5197f0){_0x210fc3=_0x210fc3-0x0;var _0x36f77f=_0x7a54[_0x210fc3];return _0x36f77f;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 0ec3429..c4f46a4 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 _0x2542=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','show','/:id/messages','getMessages','post'];(function(_0x15708a,_0x4f8a5e){var _0x50de1d=function(_0x1335b9){while(--_0x1335b9){_0x15708a['push'](_0x15708a['shift']());}};_0x50de1d(++_0x4f8a5e);}(_0x2542,0x169));var _0x2254=function(_0x34e7a7,_0x176e9d){_0x34e7a7=_0x34e7a7-0x0;var _0x41540f=_0x2542[_0x34e7a7];return _0x41540f;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x10')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x11')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0x12')]);router['delete']('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x13')]);module[_0x2254('0x14')]=router; \ No newline at end of file +var _0x7046=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','getMessages','post','create','put','update'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0x7046,0x144));var _0x6704=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7046[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var path=require(_0x6704('0x2'));var timeout=require(_0x6704('0x3'));var express=require('express');var router=express[_0x6704('0x4')]();var fs_extra=require(_0x6704('0x5'));var auth=require(_0x6704('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6704('0x7'));var controller=require(_0x6704('0x8'));router[_0x6704('0x9')]('/',auth[_0x6704('0xa')](),controller[_0x6704('0xb')]);router['get'](_0x6704('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x6704('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6704('0xd')]);router[_0x6704('0xe')]('/',auth[_0x6704('0xa')](),controller[_0x6704('0xf')]);router[_0x6704('0x10')](_0x6704('0xc'),auth[_0x6704('0xa')](),controller[_0x6704('0x11')]);router['delete'](_0x6704('0xc'),auth[_0x6704('0xa')](),controller['destroy']);module[_0x6704('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index f4c08d1..867066e 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 _0xc2df=['STRING','from-voicemail','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','exports'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xc2df,0x10f));var _0xfc2d=function(_0x455989,_0xc086ac){_0x455989=_0x455989-0x0;var _0x520e86=_0xc2df[_0x455989];return _0x520e86;};'use strict';var Sequelize=require('sequelize');module[_0xfc2d('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xfc2d('0x1')],'defaultValue':_0xfc2d('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xfc2d('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xfc2d('0x1')]},'fullname':{'type':Sequelize[_0xfc2d('0x1')]},'email':{'type':Sequelize[_0xfc2d('0x1')],'validate':{'isEmail':!![]},'set':function(_0x2918a2){this[_0xfc2d('0x3')](_0xfc2d('0x4'),typeof _0x2918a2===_0xfc2d('0x5')&&_0x2918a2[_0xfc2d('0x6')]()?_0x2918a2[_0xfc2d('0x6')]():null);}},'pager':{'type':Sequelize[_0xfc2d('0x1')]},'tz':{'type':Sequelize[_0xfc2d('0x1')],'defaultValue':_0xfc2d('0x7')},'attach':{'type':Sequelize['ENUM'](_0xfc2d('0x8'),'no'),'defaultValue':_0xfc2d('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xfc2d('0x9')](_0xfc2d('0x8'),'no'),'defaultValue':_0xfc2d('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0xfc2d('0x1')]},'callback':{'type':Sequelize[_0xfc2d('0x1')]},'review':{'type':Sequelize[_0xfc2d('0x9')](_0xfc2d('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xfc2d('0x9')](_0xfc2d('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xfc2d('0x9')](_0xfc2d('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xfc2d('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xfc2d('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xfc2d('0x9')](_0xfc2d('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xfc2d('0x9')](_0xfc2d('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xfc2d('0x9')]('yes','no'),'defaultValue':_0xfc2d('0x8'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xfc2d('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xfc2d('0x9')](_0xfc2d('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xfc2d('0x8'),'no'),'defaultValue':_0xfc2d('0x8'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xfc2d('0x1')]},'maxsecs':{'type':Sequelize[_0xfc2d('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xfc2d('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xfc2d('0xc')](_0xfc2d('0xd'))+_0xfc2d('0xe')+this[_0xfc2d('0xc')](_0xfc2d('0xf'));}}}; \ No newline at end of file +var _0xa018=['exports','STRING','contest_mailbox','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','getDataValue','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa018,0x1ef));var _0x8a01=function(_0x1a29c8,_0x4490b7){_0x1a29c8=_0x1a29c8-0x0;var _0x5e6869=_0xa018[_0x1a29c8];return _0x5e6869;};'use strict';var Sequelize=require(_0x8a01('0x0'));module[_0x8a01('0x1')]={'customer_id':{'type':Sequelize[_0x8a01('0x2')]},'context':{'type':Sequelize[_0x8a01('0x2')],'defaultValue':'from-voicemail','unique':_0x8a01('0x3')},'mailbox':{'type':Sequelize[_0x8a01('0x2')],'defaultValue':'','allowNull':![],'unique':_0x8a01('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x8a01('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x2f12a2){this['setDataValue'](_0x8a01('0x4'),typeof _0x2f12a2===_0x8a01('0x5')&&_0x2f12a2[_0x8a01('0x6')]()?_0x2f12a2[_0x8a01('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x8a01('0x2')],'defaultValue':_0x8a01('0x7')},'attach':{'type':Sequelize[_0x8a01('0x8')](_0x8a01('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x8a01('0x8')]('yes','no'),'defaultValue':_0x8a01('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x8a01('0x2')]},'callback':{'type':Sequelize[_0x8a01('0x2')]},'review':{'type':Sequelize[_0x8a01('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x8a01('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x8a01('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x8a01('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x8a01('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x8a01('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x8a01('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x8a01('0x8')](_0x8a01('0x9'),'no'),'defaultValue':_0x8a01('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x8a01('0x8')](_0x8a01('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x8a01('0x9'),'no'),'defaultValue':_0x8a01('0x9'),'allowNull':![]},'stamp':{'type':_0x8a01('0xb')},'emailsubject':{'type':Sequelize[_0x8a01('0x2')]},'emailbody':{'type':Sequelize[_0x8a01('0x2')]},'maxsecs':{'type':Sequelize[_0x8a01('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x8a01('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x8a01('0xd')],'get':function(){return this['getDataValue'](_0x8a01('0xe'))+'\x20-\x20'+this[_0x8a01('0xf')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 24f7fae..dee024f 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 _0xefda=['sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','Voicemails','UserProfileResource','error','stack','name','send','map','VoiceMail','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','getMessages','VoiceMailMessage','mailbox','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'];(function(_0x47f7ec,_0x369f9d){var _0x415101=function(_0x41317a){while(--_0x41317a){_0x47f7ec['push'](_0x47f7ec['shift']());}};_0x415101(++_0x369f9d);}(_0xefda,0x96));var _0xaefd=function(_0x4d584f,_0x385fcd){_0x4d584f=_0x4d584f-0x0;var _0x383793=_0xefda[_0x4d584f];return _0x383793;};'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'];function respondWithStatusCode(_0x382983,_0x2a310c){_0x2a310c=_0x2a310c||0xcc;return function(_0x4b2b5c){if(_0x4b2b5c){return _0x382983[_0xaefd('0x18')](_0x2a310c);}return _0x382983['status'](_0x2a310c)[_0xaefd('0x19')]();};}function respondWithResult(_0x1725af,_0x9dfdf6){_0x9dfdf6=_0x9dfdf6||0xc8;return function(_0x43b82a){if(_0x43b82a){return _0x1725af['status'](_0x9dfdf6)[_0xaefd('0x1a')](_0x43b82a);}};}function respondWithFilteredResult(_0x13492c,_0x41f345){return function(_0x411701){if(_0x411701){var _0x10ee28=typeof _0x41f345[_0xaefd('0x1b')]===_0xaefd('0x1c')&&typeof _0x41f345[_0xaefd('0x1d')]==='undefined';var _0x9d9c29=_0x411701[_0xaefd('0x1e')];var _0x9748f4=_0x10ee28?0x0:_0x41f345[_0xaefd('0x1b')];var _0x2db61b=_0x10ee28?_0x411701[_0xaefd('0x1e')]:_0x41f345['offset']+_0x41f345[_0xaefd('0x1d')];var _0x182f9a;if(_0x2db61b>=_0x9d9c29){_0x2db61b=_0x9d9c29;_0x182f9a=0xc8;}else{_0x182f9a=0xce;}_0x13492c[_0xaefd('0x1f')](_0x182f9a);return _0x13492c[_0xaefd('0x20')](_0xaefd('0x21'),_0x9748f4+'-'+_0x2db61b+'/'+_0x9d9c29)[_0xaefd('0x1a')](_0x411701);}return null;};}function patchUpdates(_0x5282ed){return function(_0x463d48){try{jsonpatch[_0xaefd('0x22')](_0x463d48,_0x5282ed,!![]);}catch(_0x2dcdd8){return BPromise[_0xaefd('0x23')](_0x2dcdd8);}return _0x463d48[_0xaefd('0x24')]();};}function saveUpdates(_0x577fb7,_0x479486){return function(_0x5b9967){if(_0x5b9967){return _0x5b9967[_0xaefd('0x25')](_0x577fb7)[_0xaefd('0x26')](function(_0x313a6f){return _0x313a6f;});}return null;};}function removeEntity(_0x5a44ed,_0x23060f){return function(_0x4cd9b2){if(_0x4cd9b2){return _0x4cd9b2[_0xaefd('0x27')]()[_0xaefd('0x26')](function(){var _0x1a05eb=_0x4cd9b2['get']({'plain':!![]});var _0x435413=_0xaefd('0x28');return db[_0xaefd('0x29')][_0xaefd('0x27')]({'where':{'type':_0x435413,'resourceId':_0x1a05eb['id']}})[_0xaefd('0x26')](function(){return _0x4cd9b2;});})['then'](function(){_0x5a44ed[_0xaefd('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x810bf,_0x16f10f){return function(_0x5470bd){if(!_0x5470bd){_0x810bf[_0xaefd('0x18')](0x194);}return _0x5470bd;};}function handleError(_0x2a8fa8,_0x521839){_0x521839=_0x521839||0x1f4;return function(_0xbeb1b8){logger[_0xaefd('0x2a')](_0xbeb1b8[_0xaefd('0x2b')]);if(_0xbeb1b8['name']){delete _0xbeb1b8[_0xaefd('0x2c')];}_0x2a8fa8['status'](_0x521839)[_0xaefd('0x2d')](_0xbeb1b8);};}exports['index']=function(_0x4a1acb,_0x1d89c4){var _0x1b470c={},_0x4a032d={},_0x578378={'count':0x0,'rows':[]};var _0x4ee0c1=_[_0xaefd('0x2e')](db[_0xaefd('0x2f')]['rawAttributes'],function(_0x5503d0){return{'name':_0x5503d0[_0xaefd('0x30')],'type':_0x5503d0[_0xaefd('0x31')][_0xaefd('0x32')]};});_0x4a032d[_0xaefd('0x33')]=_['map'](_0x4ee0c1,_0xaefd('0x2c'));_0x4a032d[_0xaefd('0x34')]=_[_0xaefd('0x35')](_0x4a1acb[_0xaefd('0x34')]);_0x4a032d[_0xaefd('0x36')]=_[_0xaefd('0x37')](_0x4a032d[_0xaefd('0x33')],_0x4a032d[_0xaefd('0x34')]);_0x1b470c[_0xaefd('0x38')]=_[_0xaefd('0x37')](_0x4a032d[_0xaefd('0x33')],qs[_0xaefd('0x39')](_0x4a1acb[_0xaefd('0x34')][_0xaefd('0x39')]));_0x1b470c[_0xaefd('0x38')]=_0x1b470c[_0xaefd('0x38')]['length']?_0x1b470c[_0xaefd('0x38')]:_0x4a032d[_0xaefd('0x33')];if(!_0x4a1acb[_0xaefd('0x34')]['hasOwnProperty'](_0xaefd('0x3a'))){_0x1b470c['limit']=qs[_0xaefd('0x1d')](_0x4a1acb[_0xaefd('0x34')][_0xaefd('0x1d')]);_0x1b470c[_0xaefd('0x1b')]=qs[_0xaefd('0x1b')](_0x4a1acb[_0xaefd('0x34')][_0xaefd('0x1b')]);}_0x1b470c[_0xaefd('0x3b')]=qs[_0xaefd('0x3c')](_0x4a1acb[_0xaefd('0x34')][_0xaefd('0x3c')]);_0x1b470c[_0xaefd('0x3d')]=qs[_0xaefd('0x36')](_[_0xaefd('0x3e')](_0x4a1acb['query'],_0x4a032d[_0xaefd('0x36')]),_0x4ee0c1);if(_0x4a1acb['query'][_0xaefd('0x3f')]){_0x1b470c[_0xaefd('0x3d')]=_[_0xaefd('0x40')](_0x1b470c[_0xaefd('0x3d')],{'$or':_[_0xaefd('0x2e')](_0x4ee0c1,function(_0x3c9331){if(_0x3c9331[_0xaefd('0x31')]!==_0xaefd('0x41')){var _0x3c7022={};_0x3c7022[_0x3c9331[_0xaefd('0x2c')]]={'$like':'%'+_0x4a1acb['query'][_0xaefd('0x3f')]+'%'};return _0x3c7022;}})});}_0x1b470c=_[_0xaefd('0x40')]({},_0x1b470c,_0x4a1acb['options']);var _0x427f00={'where':_0x1b470c[_0xaefd('0x3d')]};return db[_0xaefd('0x2f')]['count'](_0x427f00)['then'](function(_0x43b6a6){_0x578378[_0xaefd('0x1e')]=_0x43b6a6;if(_0x4a1acb[_0xaefd('0x34')][_0xaefd('0x42')]){_0x1b470c[_0xaefd('0x43')]=[{'all':!![]}];}return db[_0xaefd('0x2f')][_0xaefd('0x44')](_0x1b470c);})[_0xaefd('0x26')](function(_0x48a7af){_0x578378[_0xaefd('0x45')]=_0x48a7af;return _0x578378;})[_0xaefd('0x26')](respondWithFilteredResult(_0x1d89c4,_0x1b470c))[_0xaefd('0x46')](handleError(_0x1d89c4,null));};exports[_0xaefd('0x47')]=function(_0x20d5fd,_0x197f3f){var _0x3633ec={'raw':!![],'where':{'id':_0x20d5fd['params']['id']}},_0x1f4a15={};_0x1f4a15['model']=_[_0xaefd('0x35')](db[_0xaefd('0x2f')]['rawAttributes']);_0x1f4a15['query']=_[_0xaefd('0x35')](_0x20d5fd[_0xaefd('0x34')]);_0x1f4a15[_0xaefd('0x36')]=_[_0xaefd('0x37')](_0x1f4a15[_0xaefd('0x33')],_0x1f4a15[_0xaefd('0x34')]);_0x3633ec[_0xaefd('0x38')]=_[_0xaefd('0x37')](_0x1f4a15[_0xaefd('0x33')],qs['fields'](_0x20d5fd[_0xaefd('0x34')][_0xaefd('0x39')]));_0x3633ec[_0xaefd('0x38')]=_0x3633ec[_0xaefd('0x38')][_0xaefd('0x48')]?_0x3633ec[_0xaefd('0x38')]:_0x1f4a15[_0xaefd('0x33')];if(_0x20d5fd['query'][_0xaefd('0x42')]){_0x3633ec['include']=[{'all':!![]}];}_0x3633ec=_[_0xaefd('0x40')]({},_0x3633ec,_0x20d5fd[_0xaefd('0x49')]);return db[_0xaefd('0x2f')][_0xaefd('0x4a')](_0x3633ec)['then'](handleEntityNotFound(_0x197f3f,null))['then'](respondWithResult(_0x197f3f,null))[_0xaefd('0x46')](handleError(_0x197f3f,null));};exports[_0xaefd('0x4b')]=function(_0x179b8b,_0x4eeb56){return db[_0xaefd('0x2f')][_0xaefd('0x4b')](_0x179b8b['body'],{})[_0xaefd('0x26')](function(_0xf2783d){var _0x3c6a3e=_0x179b8b[_0xaefd('0x4c')][_0xaefd('0x4d')]({'plain':!![]});if(!_0x3c6a3e)throw new Error(_0xaefd('0x4e'));if(_0x3c6a3e[_0xaefd('0x4f')]===_0xaefd('0x4c')){var _0x4dc674=_0xf2783d['get']({'plain':!![]});var _0x1406b8=_0xaefd('0x28');return db['UserProfileSection'][_0xaefd('0x4a')]({'where':{'name':_0x1406b8,'userProfileId':_0x3c6a3e['userProfileId']},'raw':!![]})[_0xaefd('0x26')](function(_0x47296d){if(_0x47296d&&_0x47296d[_0xaefd('0x50')]===0x0){return db[_0xaefd('0x29')][_0xaefd('0x4b')]({'name':_0x4dc674[_0xaefd('0x2c')],'resourceId':_0x4dc674['id'],'type':_0x47296d['name'],'sectionId':_0x47296d['id']},{})['then'](function(){return _0xf2783d;});}else{return _0xf2783d;}})[_0xaefd('0x46')](function(_0x338823){logger['error'](_0xaefd('0x51'),_0x338823);throw _0x338823;});}return _0xf2783d;})[_0xaefd('0x26')](respondWithResult(_0x4eeb56,0xc9))[_0xaefd('0x46')](handleError(_0x4eeb56,null));};exports[_0xaefd('0x25')]=function(_0x4a883b,_0x583caa){if(_0x4a883b[_0xaefd('0x52')]['id']){delete _0x4a883b[_0xaefd('0x52')]['id'];}return db[_0xaefd('0x2f')][_0xaefd('0x4a')]({'where':{'id':_0x4a883b[_0xaefd('0x53')]['id']}})['then'](handleEntityNotFound(_0x583caa,null))[_0xaefd('0x26')](saveUpdates(_0x4a883b[_0xaefd('0x52')],null))['then'](respondWithResult(_0x583caa,null))[_0xaefd('0x46')](handleError(_0x583caa,null));};exports[_0xaefd('0x27')]=function(_0x5f2925,_0x108e35){return db[_0xaefd('0x2f')][_0xaefd('0x4a')]({'where':{'id':_0x5f2925['params']['id']}})[_0xaefd('0x26')](handleEntityNotFound(_0x108e35,null))[_0xaefd('0x26')](removeEntity(_0x108e35,null))['catch'](handleError(_0x108e35,null));};exports[_0xaefd('0x54')]=function(_0x21b65c,_0x14b472,_0x2dd1ee){return db['VoiceMail']['findOne']({'where':{'id':_0x21b65c[_0xaefd('0x53')]['id']}})[_0xaefd('0x26')](handleEntityNotFound(_0x14b472,null))[_0xaefd('0x26')](function(_0x3e1673){var _0x4189c4;var _0x8ab9e7={},_0x314660={};_0x314660[_0xaefd('0x33')]=_[_0xaefd('0x35')](db[_0xaefd('0x55')]['rawAttributes']);_0x314660['query']=_[_0xaefd('0x35')](_0x21b65c[_0xaefd('0x34')]);_0x314660[_0xaefd('0x36')]=_[_0xaefd('0x37')](_0x314660['model'],_0x314660[_0xaefd('0x34')]);_0x8ab9e7[_0xaefd('0x38')]=_[_0xaefd('0x37')](_0x314660[_0xaefd('0x33')],qs[_0xaefd('0x39')](_0x21b65c[_0xaefd('0x34')][_0xaefd('0x39')]));_0x8ab9e7[_0xaefd('0x38')]=_0x8ab9e7['attributes'][_0xaefd('0x48')]?_0x8ab9e7[_0xaefd('0x38')]:_0x314660[_0xaefd('0x33')];if(!_0x21b65c[_0xaefd('0x34')]['hasOwnProperty'](_0xaefd('0x3a'))){_0x8ab9e7['limit']=qs[_0xaefd('0x1d')](_0x21b65c[_0xaefd('0x34')]['limit']);_0x8ab9e7['offset']=qs[_0xaefd('0x1b')](_0x21b65c['query']['offset']);}_0x8ab9e7['order']=qs[_0xaefd('0x3c')](_0x21b65c[_0xaefd('0x34')][_0xaefd('0x3c')]);_0x8ab9e7[_0xaefd('0x3d')]=qs[_0xaefd('0x36')](_[_0xaefd('0x3e')](_0x21b65c['query'],_0x314660['filters']));if(_0x21b65c['query']['filter']){_0x8ab9e7[_0xaefd('0x3d')]=_['merge'](_0x8ab9e7[_0xaefd('0x3d')],{'$or':_['map'](_0x8ab9e7[_0xaefd('0x38')],function(_0x32dc0d){var _0x416241={};_0x416241[_0x32dc0d]={'$like':'%'+_0x21b65c[_0xaefd('0x34')][_0xaefd('0x3f')]+'%'};return _0x416241;})});}_0x8ab9e7[_0xaefd('0x3d')]=_[_0xaefd('0x40')](_0x8ab9e7['where'],{'mailboxuser':_0x3e1673[_0xaefd('0x56')]});_0x8ab9e7=_[_0xaefd('0x40')]({},_0x8ab9e7,_0x21b65c[_0xaefd('0x49')]);return db[_0xaefd('0x55')]['findAndCountAll'](_0x8ab9e7)[_0xaefd('0x26')](respondWithFilteredResult(_0x14b472,_0x8ab9e7));})['catch'](handleError(_0x14b472,null));}; \ No newline at end of file +var _0x5423=['offset','undefined','count','limit','set','Content-Range','reject','destroy','get','Voicemails','UserProfileResource','then','error','stack','name','send','map','VoiceMail','rawAttributes','fieldName','type','key','query','model','attributes','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','intersection','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','update','params','getMessages','findOne','VoiceMailMessage','pick','findAndCountAll','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0xd025b8,_0x223fd9){var _0x2b9daf=function(_0x82ee38){while(--_0x82ee38){_0xd025b8['push'](_0xd025b8['shift']());}};_0x2b9daf(++_0x223fd9);}(_0x5423,0xe3));var _0x3542=function(_0x50f2d6,_0x49805f){_0x50f2d6=_0x50f2d6-0x0;var _0x27316e=_0x5423[_0x50f2d6];return _0x27316e;};'use strict';var emlformat=require(_0x3542('0x0'));var rimraf=require(_0x3542('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3542('0x2'));var rp=require(_0x3542('0x3'));var moment=require('moment');var BPromise=require(_0x3542('0x4'));var Mustache=require(_0x3542('0x5'));var util=require(_0x3542('0x6'));var path=require(_0x3542('0x7'));var sox=require('sox');var csv=require(_0x3542('0x8'));var ejs=require(_0x3542('0x9'));var fs=require('fs');var fs_extra=require(_0x3542('0xa'));var _=require(_0x3542('0xb'));var squel=require(_0x3542('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3542('0xd'));var toCsv=require(_0x3542('0x8'));var querystring=require('querystring');var Papa=require(_0x3542('0xe'));var Redis=require(_0x3542('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3542('0x10'));var as=require(_0x3542('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3542('0x12'))(_0x3542('0x13'));var utils=require(_0x3542('0x14'));var config=require(_0x3542('0x15'));var licenseUtil=require(_0x3542('0x16'));var db=require(_0x3542('0x17'))['db'];function respondWithStatusCode(_0x1cf710,_0x43e977){_0x43e977=_0x43e977||0xcc;return function(_0x4ee86){if(_0x4ee86){return _0x1cf710[_0x3542('0x18')](_0x43e977);}return _0x1cf710[_0x3542('0x19')](_0x43e977)[_0x3542('0x1a')]();};}function respondWithResult(_0x15863d,_0x4bac5b){_0x4bac5b=_0x4bac5b||0xc8;return function(_0x14fe57){if(_0x14fe57){return _0x15863d['status'](_0x4bac5b)[_0x3542('0x1b')](_0x14fe57);}};}function respondWithFilteredResult(_0x13fe0b,_0xc33d42){return function(_0x546fbd){if(_0x546fbd){var _0x270312=typeof _0xc33d42[_0x3542('0x1c')]===_0x3542('0x1d')&&typeof _0xc33d42['limit']===_0x3542('0x1d');var _0x23b0de=_0x546fbd[_0x3542('0x1e')];var _0x3d5199=_0x270312?0x0:_0xc33d42['offset'];var _0x32df3f=_0x270312?_0x546fbd['count']:_0xc33d42[_0x3542('0x1c')]+_0xc33d42[_0x3542('0x1f')];var _0x4d93bc;if(_0x32df3f>=_0x23b0de){_0x32df3f=_0x23b0de;_0x4d93bc=0xc8;}else{_0x4d93bc=0xce;}_0x13fe0b[_0x3542('0x19')](_0x4d93bc);return _0x13fe0b[_0x3542('0x20')](_0x3542('0x21'),_0x3d5199+'-'+_0x32df3f+'/'+_0x23b0de)[_0x3542('0x1b')](_0x546fbd);}return null;};}function patchUpdates(_0x212950){return function(_0x4a7695){try{jsonpatch['apply'](_0x4a7695,_0x212950,!![]);}catch(_0x4c58f1){return BPromise[_0x3542('0x22')](_0x4c58f1);}return _0x4a7695['save']();};}function saveUpdates(_0x1d5488,_0x551645){return function(_0x1d5f1e){if(_0x1d5f1e){return _0x1d5f1e['update'](_0x1d5488)['then'](function(_0x3eacd0){return _0x3eacd0;});}return null;};}function removeEntity(_0xe3f983,_0x5ae097){return function(_0x5d05b2){if(_0x5d05b2){return _0x5d05b2[_0x3542('0x23')]()['then'](function(){var _0x160caa=_0x5d05b2[_0x3542('0x24')]({'plain':!![]});var _0x1e0723=_0x3542('0x25');return db[_0x3542('0x26')][_0x3542('0x23')]({'where':{'type':_0x1e0723,'resourceId':_0x160caa['id']}})[_0x3542('0x27')](function(){return _0x5d05b2;});})[_0x3542('0x27')](function(){_0xe3f983[_0x3542('0x19')](0xcc)[_0x3542('0x1a')]();});}};}function handleEntityNotFound(_0xfdfe62,_0x4462c4){return function(_0x220021){if(!_0x220021){_0xfdfe62[_0x3542('0x18')](0x194);}return _0x220021;};}function handleError(_0x1cab35,_0x39050a){_0x39050a=_0x39050a||0x1f4;return function(_0x303412){logger[_0x3542('0x28')](_0x303412[_0x3542('0x29')]);if(_0x303412['name']){delete _0x303412[_0x3542('0x2a')];}_0x1cab35[_0x3542('0x19')](_0x39050a)[_0x3542('0x2b')](_0x303412);};}exports['index']=function(_0x402c97,_0xc6f23b){var _0x2e883a={},_0x30b5e8={},_0x5c882f={'count':0x0,'rows':[]};var _0x5a274b=_[_0x3542('0x2c')](db[_0x3542('0x2d')][_0x3542('0x2e')],function(_0x44e8f7){return{'name':_0x44e8f7[_0x3542('0x2f')],'type':_0x44e8f7[_0x3542('0x30')][_0x3542('0x31')]};});_0x30b5e8['model']=_['map'](_0x5a274b,_0x3542('0x2a'));_0x30b5e8['query']=_['keys'](_0x402c97[_0x3542('0x32')]);_0x30b5e8['filters']=_['intersection'](_0x30b5e8[_0x3542('0x33')],_0x30b5e8[_0x3542('0x32')]);_0x2e883a[_0x3542('0x34')]=_['intersection'](_0x30b5e8[_0x3542('0x33')],qs['fields'](_0x402c97[_0x3542('0x32')][_0x3542('0x35')]));_0x2e883a['attributes']=_0x2e883a[_0x3542('0x34')]['length']?_0x2e883a[_0x3542('0x34')]:_0x30b5e8[_0x3542('0x33')];if(!_0x402c97[_0x3542('0x32')]['hasOwnProperty'](_0x3542('0x36'))){_0x2e883a['limit']=qs[_0x3542('0x1f')](_0x402c97[_0x3542('0x32')][_0x3542('0x1f')]);_0x2e883a[_0x3542('0x1c')]=qs[_0x3542('0x1c')](_0x402c97[_0x3542('0x32')][_0x3542('0x1c')]);}_0x2e883a[_0x3542('0x37')]=qs[_0x3542('0x38')](_0x402c97[_0x3542('0x32')][_0x3542('0x38')]);_0x2e883a[_0x3542('0x39')]=qs[_0x3542('0x3a')](_['pick'](_0x402c97[_0x3542('0x32')],_0x30b5e8['filters']),_0x5a274b);if(_0x402c97['query'][_0x3542('0x3b')]){_0x2e883a[_0x3542('0x39')]=_[_0x3542('0x3c')](_0x2e883a[_0x3542('0x39')],{'$or':_[_0x3542('0x2c')](_0x5a274b,function(_0x21aec3){if(_0x21aec3[_0x3542('0x30')]!==_0x3542('0x3d')){var _0x53eac6={};_0x53eac6[_0x21aec3[_0x3542('0x2a')]]={'$like':'%'+_0x402c97['query'][_0x3542('0x3b')]+'%'};return _0x53eac6;}})});}_0x2e883a=_[_0x3542('0x3c')]({},_0x2e883a,_0x402c97['options']);var _0x371aba={'where':_0x2e883a[_0x3542('0x39')]};return db['VoiceMail'][_0x3542('0x1e')](_0x371aba)[_0x3542('0x27')](function(_0x5e1b29){_0x5c882f[_0x3542('0x1e')]=_0x5e1b29;if(_0x402c97[_0x3542('0x32')][_0x3542('0x3e')]){_0x2e883a[_0x3542('0x3f')]=[{'all':!![]}];}return db[_0x3542('0x2d')][_0x3542('0x40')](_0x2e883a);})[_0x3542('0x27')](function(_0x4bf45a){_0x5c882f['rows']=_0x4bf45a;return _0x5c882f;})[_0x3542('0x27')](respondWithFilteredResult(_0xc6f23b,_0x2e883a))[_0x3542('0x41')](handleError(_0xc6f23b,null));};exports[_0x3542('0x42')]=function(_0xdeebd3,_0x170749){var _0x53a024={'raw':!![],'where':{'id':_0xdeebd3['params']['id']}},_0x3e6a49={};_0x3e6a49[_0x3542('0x33')]=_[_0x3542('0x43')](db[_0x3542('0x2d')]['rawAttributes']);_0x3e6a49[_0x3542('0x32')]=_[_0x3542('0x43')](_0xdeebd3['query']);_0x3e6a49[_0x3542('0x3a')]=_[_0x3542('0x44')](_0x3e6a49[_0x3542('0x33')],_0x3e6a49[_0x3542('0x32')]);_0x53a024[_0x3542('0x34')]=_[_0x3542('0x44')](_0x3e6a49[_0x3542('0x33')],qs[_0x3542('0x35')](_0xdeebd3['query']['fields']));_0x53a024['attributes']=_0x53a024[_0x3542('0x34')][_0x3542('0x45')]?_0x53a024[_0x3542('0x34')]:_0x3e6a49[_0x3542('0x33')];if(_0xdeebd3[_0x3542('0x32')][_0x3542('0x3e')]){_0x53a024[_0x3542('0x3f')]=[{'all':!![]}];}_0x53a024=_['merge']({},_0x53a024,_0xdeebd3[_0x3542('0x46')]);return db[_0x3542('0x2d')][_0x3542('0x47')](_0x53a024)[_0x3542('0x27')](handleEntityNotFound(_0x170749,null))['then'](respondWithResult(_0x170749,null))[_0x3542('0x41')](handleError(_0x170749,null));};exports[_0x3542('0x48')]=function(_0x55b43a,_0x528f8c){return db[_0x3542('0x2d')][_0x3542('0x48')](_0x55b43a[_0x3542('0x49')],{})[_0x3542('0x27')](function(_0x244f3a){var _0x1a2ecf=_0x55b43a[_0x3542('0x4a')]['get']({'plain':!![]});if(!_0x1a2ecf)throw new Error(_0x3542('0x4b'));if(_0x1a2ecf[_0x3542('0x4c')]===_0x3542('0x4a')){var _0x392c6e=_0x244f3a[_0x3542('0x24')]({'plain':!![]});var _0x28be34=_0x3542('0x25');return db[_0x3542('0x4d')][_0x3542('0x47')]({'where':{'name':_0x28be34,'userProfileId':_0x1a2ecf['userProfileId']},'raw':!![]})['then'](function(_0x15af28){if(_0x15af28&&_0x15af28['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x392c6e[_0x3542('0x2a')],'resourceId':_0x392c6e['id'],'type':_0x15af28[_0x3542('0x2a')],'sectionId':_0x15af28['id']},{})[_0x3542('0x27')](function(){return _0x244f3a;});}else{return _0x244f3a;}})['catch'](function(_0x2db495){logger[_0x3542('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2db495);throw _0x2db495;});}return _0x244f3a;})[_0x3542('0x27')](respondWithResult(_0x528f8c,0xc9))[_0x3542('0x41')](handleError(_0x528f8c,null));};exports[_0x3542('0x4e')]=function(_0x196c59,_0x179249){if(_0x196c59['body']['id']){delete _0x196c59[_0x3542('0x49')]['id'];}return db[_0x3542('0x2d')][_0x3542('0x47')]({'where':{'id':_0x196c59[_0x3542('0x4f')]['id']}})[_0x3542('0x27')](handleEntityNotFound(_0x179249,null))['then'](saveUpdates(_0x196c59['body'],null))[_0x3542('0x27')](respondWithResult(_0x179249,null))[_0x3542('0x41')](handleError(_0x179249,null));};exports[_0x3542('0x23')]=function(_0x5de994,_0x1dfac3){return db[_0x3542('0x2d')][_0x3542('0x47')]({'where':{'id':_0x5de994[_0x3542('0x4f')]['id']}})[_0x3542('0x27')](handleEntityNotFound(_0x1dfac3,null))['then'](removeEntity(_0x1dfac3,null))['catch'](handleError(_0x1dfac3,null));};exports[_0x3542('0x50')]=function(_0x4cd6fd,_0x1fd8c8,_0x3610b7){return db['VoiceMail'][_0x3542('0x51')]({'where':{'id':_0x4cd6fd[_0x3542('0x4f')]['id']}})[_0x3542('0x27')](handleEntityNotFound(_0x1fd8c8,null))[_0x3542('0x27')](function(_0x60b9c0){var _0x52a75b;var _0x4cb73f={},_0x271dd0={};_0x271dd0['model']=_[_0x3542('0x43')](db[_0x3542('0x52')][_0x3542('0x2e')]);_0x271dd0['query']=_[_0x3542('0x43')](_0x4cd6fd[_0x3542('0x32')]);_0x271dd0[_0x3542('0x3a')]=_[_0x3542('0x44')](_0x271dd0[_0x3542('0x33')],_0x271dd0[_0x3542('0x32')]);_0x4cb73f['attributes']=_[_0x3542('0x44')](_0x271dd0[_0x3542('0x33')],qs[_0x3542('0x35')](_0x4cd6fd[_0x3542('0x32')][_0x3542('0x35')]));_0x4cb73f[_0x3542('0x34')]=_0x4cb73f['attributes'][_0x3542('0x45')]?_0x4cb73f[_0x3542('0x34')]:_0x271dd0[_0x3542('0x33')];if(!_0x4cd6fd[_0x3542('0x32')]['hasOwnProperty'](_0x3542('0x36'))){_0x4cb73f[_0x3542('0x1f')]=qs['limit'](_0x4cd6fd['query'][_0x3542('0x1f')]);_0x4cb73f['offset']=qs[_0x3542('0x1c')](_0x4cd6fd['query']['offset']);}_0x4cb73f[_0x3542('0x37')]=qs[_0x3542('0x38')](_0x4cd6fd[_0x3542('0x32')][_0x3542('0x38')]);_0x4cb73f[_0x3542('0x39')]=qs[_0x3542('0x3a')](_[_0x3542('0x53')](_0x4cd6fd['query'],_0x271dd0[_0x3542('0x3a')]));if(_0x4cd6fd[_0x3542('0x32')][_0x3542('0x3b')]){_0x4cb73f[_0x3542('0x39')]=_[_0x3542('0x3c')](_0x4cb73f['where'],{'$or':_[_0x3542('0x2c')](_0x4cb73f[_0x3542('0x34')],function(_0x2c5546){var _0x361c42={};_0x361c42[_0x2c5546]={'$like':'%'+_0x4cd6fd[_0x3542('0x32')][_0x3542('0x3b')]+'%'};return _0x361c42;})});}_0x4cb73f[_0x3542('0x39')]=_['merge'](_0x4cb73f[_0x3542('0x39')],{'mailboxuser':_0x60b9c0['mailbox']});_0x4cb73f=_[_0x3542('0x3c')]({},_0x4cb73f,_0x4cd6fd[_0x3542('0x46')]);return db[_0x3542('0x52')][_0x3542('0x54')](_0x4cb73f)['then'](respondWithFilteredResult(_0x1fd8c8,_0x4cb73f));})['catch'](handleError(_0x1fd8c8,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index f063d3b..b71a6c7 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 _0x01f8=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox','context','api'];(function(_0x24a764,_0x348922){var _0x1eba84=function(_0x24f454){while(--_0x24f454){_0x24a764['push'](_0x24a764['shift']());}};_0x1eba84(++_0x348922);}(_0x01f8,0xfb));var _0x801f=function(_0x43b1ec,_0x15035a){_0x43b1ec=_0x43b1ec-0x0;var _0x5eb9e9=_0x01f8[_0x43b1ec];return _0x5eb9e9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x801f('0x0'));var moment=require('moment');var BPromise=require(_0x801f('0x1'));var rp=require(_0x801f('0x2'));var fs=require('fs');var path=require(_0x801f('0x3'));var rimraf=require(_0x801f('0x4'));var config=require(_0x801f('0x5'));var attributes=require(_0x801f('0x6'));module[_0x801f('0x7')]=function(_0x25ef8a,_0x381387){return _0x25ef8a[_0x801f('0x8')]('VoiceMail',attributes,{'tableName':_0x801f('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x801f('0xa'),_0x801f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd644=['bluebird','request-promise','path','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','context','lodash','../../config/logger','api','moment'];(function(_0x31426e,_0x18db78){var _0x412e1b=function(_0x1b2917){while(--_0x1b2917){_0x31426e['push'](_0x31426e['shift']());}};_0x412e1b(++_0x18db78);}(_0xd644,0x175));var _0x4d64=function(_0x46f065,_0x5e4398){_0x46f065=_0x46f065-0x0;var _0x1ed60b=_0xd644[_0x46f065];return _0x1ed60b;};'use strict';var _=require(_0x4d64('0x0'));var util=require('util');var logger=require(_0x4d64('0x1'))(_0x4d64('0x2'));var moment=require(_0x4d64('0x3'));var BPromise=require(_0x4d64('0x4'));var rp=require(_0x4d64('0x5'));var fs=require('fs');var path=require(_0x4d64('0x6'));var rimraf=require('rimraf');var config=require(_0x4d64('0x7'));var attributes=require(_0x4d64('0x8'));module['exports']=function(_0x279080,_0x1ad77c){return _0x279080[_0x4d64('0x9')](_0x4d64('0xa'),attributes,{'tableName':_0x4d64('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0x4d64('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index d404717..872c599 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 _0x97ad=['code','message','VoiceMail,\x20%s,\x20%s','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1fc6d8,_0x2242dc){var _0x2fed79=function(_0x16f4d3){while(--_0x16f4d3){_0x1fc6d8['push'](_0x1fc6d8['shift']());}};_0x2fed79(++_0x2242dc);}(_0x97ad,0x8f));var _0xd97a=function(_0x4f4e5c,_0xdacb6d){_0x4f4e5c=_0x4f4e5c-0x0;var _0x3102b6=_0x97ad[_0x4f4e5c];return _0x3102b6;};'use strict';var _=require(_0xd97a('0x0'));var util=require(_0xd97a('0x1'));var moment=require(_0xd97a('0x2'));var BPromise=require('bluebird');var rs=require(_0xd97a('0x3'));var fs=require('fs');var Redis=require(_0xd97a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd97a('0x5'))(_0xd97a('0x6'));var config=require('../../config/environment');var jayson=require(_0xd97a('0x7'));var client=jayson['client'][_0xd97a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11732e,_0x358e17,_0x1fd32e){return new BPromise(function(_0x41beec,_0x341ac4){return client[_0xd97a('0x9')](_0x11732e,_0x1fd32e)[_0xd97a('0xa')](function(_0x366a0c){logger[_0xd97a('0xb')]('VoiceMail,\x20%s,\x20%s',_0x358e17,'request\x20sent');logger[_0xd97a('0xc')](_0xd97a('0xd'),_0x358e17,_0xd97a('0xe'),JSON[_0xd97a('0xf')](_0x366a0c));if(_0x366a0c[_0xd97a('0x10')]){if(_0x366a0c[_0xd97a('0x10')][_0xd97a('0x11')]===0x1f4){logger[_0xd97a('0x10')]('VoiceMail,\x20%s,\x20%s',_0x358e17,_0x366a0c['error'][_0xd97a('0x12')]);return _0x341ac4(_0x366a0c[_0xd97a('0x10')][_0xd97a('0x12')]);}logger[_0xd97a('0x10')]('VoiceMail,\x20%s,\x20%s',_0x358e17,_0x366a0c[_0xd97a('0x10')][_0xd97a('0x12')]);return _0x41beec(_0x366a0c['error'][_0xd97a('0x12')]);}else{logger[_0xd97a('0xb')](_0xd97a('0x13'),_0x358e17,'request\x20sent');_0x41beec(_0x366a0c['result'][_0xd97a('0x12')]);}})['catch'](function(_0x2f16b8){logger[_0xd97a('0x10')](_0xd97a('0x13'),_0x358e17,_0x2f16b8);_0x341ac4(_0x2f16b8);});});} \ No newline at end of file +var _0xff4f=['request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceMail,\x20%s,\x20%s'];(function(_0x5f07ed,_0x199d29){var _0x395e73=function(_0x4924b5){while(--_0x4924b5){_0x5f07ed['push'](_0x5f07ed['shift']());}};_0x395e73(++_0x199d29);}(_0xff4f,0x188));var _0xfff4=function(_0x3fdb0f,_0x32a671){_0x3fdb0f=_0x3fdb0f-0x0;var _0x259912=_0xff4f[_0x3fdb0f];return _0x259912;};'use strict';var _=require(_0xfff4('0x0'));var util=require(_0xfff4('0x1'));var moment=require(_0xfff4('0x2'));var BPromise=require(_0xfff4('0x3'));var rs=require(_0xfff4('0x4'));var fs=require('fs');var Redis=require(_0xfff4('0x5'));var db=require(_0xfff4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfff4('0x7'))(_0xfff4('0x8'));var config=require(_0xfff4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfff4('0xa')][_0xfff4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2429bc,_0x4ec87a,_0x44d201){return new BPromise(function(_0x1aa97e,_0x5b0c36){return client[_0xfff4('0xc')](_0x2429bc,_0x44d201)[_0xfff4('0xd')](function(_0x871ef2){logger[_0xfff4('0xe')](_0xfff4('0xf'),_0x4ec87a,_0xfff4('0x10'));logger['debug'](_0xfff4('0x11'),_0x4ec87a,_0xfff4('0x10'),JSON[_0xfff4('0x12')](_0x871ef2));if(_0x871ef2['error']){if(_0x871ef2[_0xfff4('0x13')][_0xfff4('0x14')]===0x1f4){logger['error'](_0xfff4('0xf'),_0x4ec87a,_0x871ef2['error']['message']);return _0x5b0c36(_0x871ef2[_0xfff4('0x13')][_0xfff4('0x15')]);}logger[_0xfff4('0x13')](_0xfff4('0xf'),_0x4ec87a,_0x871ef2['error'][_0xfff4('0x15')]);return _0x1aa97e(_0x871ef2['error'][_0xfff4('0x15')]);}else{logger[_0xfff4('0xe')](_0xfff4('0xf'),_0x4ec87a,'request\x20sent');_0x1aa97e(_0x871ef2[_0xfff4('0x16')][_0xfff4('0x15')]);}})[_0xfff4('0x17')](function(_0x136d84){logger['error'](_0xfff4('0xf'),_0x4ec87a,_0x136d84);_0x5b0c36(_0x136d84);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 9d76928..84d5e89 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 _0x5b00=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','create','put','update','delete','destroy','exports','util'];(function(_0x544639,_0x24bb66){var _0x23f9bc=function(_0xc741bf){while(--_0xc741bf){_0x544639['push'](_0x544639['shift']());}};_0x23f9bc(++_0x24bb66);}(_0x5b00,0x1b7));var _0x05b0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5b00[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x05b0('0x0'));var path=require(_0x05b0('0x1'));var timeout=require(_0x05b0('0x2'));var express=require(_0x05b0('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x05b0('0x4'));var interaction=require(_0x05b0('0x5'));var config=require(_0x05b0('0x6'));var controller=require(_0x05b0('0x7'));router[_0x05b0('0x8')]('/',auth[_0x05b0('0x9')](),controller[_0x05b0('0xa')]);router['get'](_0x05b0('0xb'),auth[_0x05b0('0x9')](),controller[_0x05b0('0xc')]);router[_0x05b0('0x8')](_0x05b0('0xd'),auth[_0x05b0('0x9')](),controller['download']);router['post']('/',auth[_0x05b0('0x9')](),controller[_0x05b0('0xe')]);router[_0x05b0('0xf')](_0x05b0('0xb'),auth[_0x05b0('0x9')](),controller[_0x05b0('0x10')]);router[_0x05b0('0x11')](_0x05b0('0xb'),auth[_0x05b0('0x9')](),controller[_0x05b0('0x12')]);module[_0x05b0('0x13')]=router; \ No newline at end of file +var _0xe460=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/download','download','create','update','destroy'];(function(_0x2e6dee,_0x1a61b0){var _0x47706=function(_0x365546){while(--_0x365546){_0x2e6dee['push'](_0x2e6dee['shift']());}};_0x47706(++_0x1a61b0);}(_0xe460,0xd0));var _0x0e46=function(_0x576d8a,_0x2d7bde){_0x576d8a=_0x576d8a-0x0;var _0x3dc3ef=_0xe460[_0x576d8a];return _0x3dc3ef;};'use strict';var multer=require(_0x0e46('0x0'));var util=require(_0x0e46('0x1'));var path=require(_0x0e46('0x2'));var timeout=require(_0x0e46('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0e46('0x4'));var auth=require(_0x0e46('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0e46('0x6'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0e46('0x7')](_0x0e46('0x8'),auth[_0x0e46('0x9')](),controller[_0x0e46('0xa')]);router[_0x0e46('0x7')](_0x0e46('0xb'),auth[_0x0e46('0x9')](),controller[_0x0e46('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0e46('0xd')]);router['put'](_0x0e46('0x8'),auth['isAuthenticated'](),controller[_0x0e46('0xe')]);router['delete'](_0x0e46('0x8'),auth[_0x0e46('0x9')](),controller[_0x0e46('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 12ff4d4..1eb0f96 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 _0xa06d=['VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','sequelize','exports'];(function(_0x15eab7,_0x49bed6){var _0x1f15c6=function(_0x33acb0){while(--_0x33acb0){_0x15eab7['push'](_0x15eab7['shift']());}};_0x1f15c6(++_0x49bed6);}(_0xa06d,0x120));var _0xda06=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa06d[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xda06('0x0'));module[_0xda06('0x1')]={'name':{'type':Sequelize[_0xda06('0x2')],'get':function(_0x476183){return this[_0xda06('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xda06('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xda06('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0xda06('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xda06('0x5')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xda06('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0xda06('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xda06('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xda06('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xda06('0x6')](_0xda06('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0xda06('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xda06('0x5')],'defaultValue':''},'stamp':{'type':_0xda06('0x8'),'defaultValue':Sequelize[_0xda06('0x9')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x4c59=['BLOB','long','TIMESTAMP','literal','exports','getDataValue','INTEGER','STRING'];(function(_0x1d1eb3,_0x2295dd){var _0x260770=function(_0x4d6bcd){while(--_0x4d6bcd){_0x1d1eb3['push'](_0x1d1eb3['shift']());}};_0x260770(++_0x2295dd);}(_0x4c59,0x74));var _0x94c5=function(_0x4f6afc,_0x4dfa88){_0x4f6afc=_0x4f6afc-0x0;var _0x256eeb=_0x4c59[_0x4f6afc];return _0x256eeb;};'use strict';var Sequelize=require('sequelize');module[_0x94c5('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x414834){return this[_0x94c5('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x94c5('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x94c5('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x94c5('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x94c5('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x94c5('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x94c5('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x94c5('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x94c5('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x94c5('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x94c5('0x4')](_0x94c5('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x94c5('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x94c5('0x3')],'defaultValue':''},'stamp':{'type':_0x94c5('0x6'),'defaultValue':Sequelize[_0x94c5('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 431d8e4..127cc8b 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 _0xcbe4=['show','params','find','catch','create','body','download','recording','msg_id','Sequelize','ValidationError','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','rimraf','request-promise','moment','mustache','util','path','lodash','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','where','filter','merge','options','includeAll','include','VoiceMailMessage','rows'];(function(_0x4629e7,_0x2c5d76){var _0x2ec551=function(_0x187103){while(--_0x187103){_0x4629e7['push'](_0x4629e7['shift']());}};_0x2ec551(++_0x2c5d76);}(_0xcbe4,0xaf));var _0x4cbe=function(_0x2b710a,_0x130140){_0x2b710a=_0x2b710a-0x0;var _0x348c8e=_0xcbe4[_0x2b710a];return _0x348c8e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4cbe('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4cbe('0x1'));var moment=require(_0x4cbe('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4cbe('0x3'));var util=require(_0x4cbe('0x4'));var path=require(_0x4cbe('0x5'));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(_0x4cbe('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4cbe('0x7'));var querystring=require(_0x4cbe('0x8'));var Papa=require(_0x4cbe('0x9'));var Redis=require(_0x4cbe('0xa'));var authService=require('../../components/auth/service');var qs=require(_0x4cbe('0xb'));var as=require(_0x4cbe('0xc'));var hardwareService=require(_0x4cbe('0xd'));var logger=require(_0x4cbe('0xe'))(_0x4cbe('0xf'));var utils=require(_0x4cbe('0x10'));var config=require(_0x4cbe('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x4cbe('0x12'))['db'];function respondWithStatusCode(_0x3b3a29,_0x218430){_0x218430=_0x218430||0xcc;return function(_0x2b2e3a){if(_0x2b2e3a){return _0x3b3a29[_0x4cbe('0x13')](_0x218430);}return _0x3b3a29['status'](_0x218430)[_0x4cbe('0x14')]();};}function respondWithResult(_0xf72b4d,_0x11add6){_0x11add6=_0x11add6||0xc8;return function(_0x1a1961){if(_0x1a1961){return _0xf72b4d[_0x4cbe('0x15')](_0x11add6)[_0x4cbe('0x16')](_0x1a1961);}};}function respondWithFilteredResult(_0xf0f96,_0x500266){return function(_0x4fc565){if(_0x4fc565){var _0x5d7e52=typeof _0x500266['offset']==='undefined'&&typeof _0x500266[_0x4cbe('0x17')]===_0x4cbe('0x18');var _0x100da3=_0x4fc565[_0x4cbe('0x19')];var _0x1ce911=_0x5d7e52?0x0:_0x500266['offset'];var _0x3c0def=_0x5d7e52?_0x4fc565[_0x4cbe('0x19')]:_0x500266[_0x4cbe('0x1a')]+_0x500266[_0x4cbe('0x17')];var _0x2dc22f;if(_0x3c0def>=_0x100da3){_0x3c0def=_0x100da3;_0x2dc22f=0xc8;}else{_0x2dc22f=0xce;}_0xf0f96['status'](_0x2dc22f);return _0xf0f96[_0x4cbe('0x1b')](_0x4cbe('0x1c'),_0x1ce911+'-'+_0x3c0def+'/'+_0x100da3)[_0x4cbe('0x16')](_0x4fc565);}return null;};}function patchUpdates(_0x4f97db){return function(_0xce23c9){try{jsonpatch[_0x4cbe('0x1d')](_0xce23c9,_0x4f97db,!![]);}catch(_0x51e117){return BPromise[_0x4cbe('0x1e')](_0x51e117);}return _0xce23c9[_0x4cbe('0x1f')]();};}function saveUpdates(_0x49de1c,_0x27fe95){return function(_0x3e16cb){if(_0x3e16cb){return _0x3e16cb[_0x4cbe('0x20')](_0x49de1c)['then'](function(_0x8169a5){return _0x8169a5;});}return null;};}function removeEntity(_0x31150e,_0x41ab6b){return function(_0x3ae4a0){if(_0x3ae4a0){return _0x3ae4a0[_0x4cbe('0x21')]()[_0x4cbe('0x22')](function(){_0x31150e[_0x4cbe('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af06f,_0x32aeee){return function(_0x42018a){if(!_0x42018a){_0x4af06f[_0x4cbe('0x13')](0x194);}return _0x42018a;};}function handleError(_0x3cc6f1,_0x3d6ea9){_0x3d6ea9=_0x3d6ea9||0x1f4;return function(_0x5544d1){logger[_0x4cbe('0x23')](_0x5544d1[_0x4cbe('0x24')]);if(_0x5544d1[_0x4cbe('0x25')]){delete _0x5544d1[_0x4cbe('0x25')];}_0x3cc6f1[_0x4cbe('0x15')](_0x3d6ea9)['send'](_0x5544d1);};}exports[_0x4cbe('0x26')]=function(_0x4ca3dc,_0x2b597d){var _0x37c1c0={},_0x41e372={},_0x22a8bd={'count':0x0,'rows':[]};var _0x8cc72e=_[_0x4cbe('0x27')](db['VoiceMailMessage'][_0x4cbe('0x28')],function(_0x56773d){return{'name':_0x56773d[_0x4cbe('0x29')],'type':_0x56773d[_0x4cbe('0x2a')][_0x4cbe('0x2b')]};});_0x41e372[_0x4cbe('0x2c')]=_[_0x4cbe('0x2d')](_[_0x4cbe('0x27')](_0x8cc72e,'name'),[_0x4cbe('0x25')]);_0x41e372[_0x4cbe('0x2e')]=_[_0x4cbe('0x2f')](_0x4ca3dc[_0x4cbe('0x2e')]);_0x41e372[_0x4cbe('0x30')]=_[_0x4cbe('0x31')](_0x41e372['model'],_0x41e372[_0x4cbe('0x2e')]);_0x37c1c0['attributes']=_[_0x4cbe('0x31')](_0x41e372[_0x4cbe('0x2c')],qs[_0x4cbe('0x32')](_0x4ca3dc[_0x4cbe('0x2e')]['fields']));_0x37c1c0[_0x4cbe('0x33')]=_0x37c1c0[_0x4cbe('0x33')]['length']?_0x37c1c0[_0x4cbe('0x33')]:_0x41e372[_0x4cbe('0x2c')];if(!_0x4ca3dc[_0x4cbe('0x2e')][_0x4cbe('0x34')]('nolimit')){_0x37c1c0[_0x4cbe('0x17')]=qs[_0x4cbe('0x17')](_0x4ca3dc[_0x4cbe('0x2e')][_0x4cbe('0x17')]);_0x37c1c0['offset']=qs[_0x4cbe('0x1a')](_0x4ca3dc[_0x4cbe('0x2e')]['offset']);}_0x37c1c0[_0x4cbe('0x35')]=qs['sort'](_0x4ca3dc[_0x4cbe('0x2e')]['sort']);_0x37c1c0[_0x4cbe('0x36')]=qs['filters'](_['pick'](_0x4ca3dc[_0x4cbe('0x2e')],_0x41e372['filters']),_0x8cc72e);if(_0x4ca3dc['query'][_0x4cbe('0x37')]){_0x37c1c0[_0x4cbe('0x36')]=_[_0x4cbe('0x38')](_0x37c1c0[_0x4cbe('0x36')],{'$or':_[_0x4cbe('0x27')](_0x8cc72e,function(_0x2f5ca4){if(_0x2f5ca4[_0x4cbe('0x2a')]!=='VIRTUAL'){var _0x365408={};_0x365408[_0x2f5ca4[_0x4cbe('0x25')]]={'$like':'%'+_0x4ca3dc[_0x4cbe('0x2e')][_0x4cbe('0x37')]+'%'};return _0x365408;}})});}_0x37c1c0=_[_0x4cbe('0x38')]({},_0x37c1c0,_0x4ca3dc[_0x4cbe('0x39')]);var _0x5d2b4e={'where':_0x37c1c0[_0x4cbe('0x36')]};return db['VoiceMailMessage']['count'](_0x5d2b4e)[_0x4cbe('0x22')](function(_0x268e84){_0x22a8bd[_0x4cbe('0x19')]=_0x268e84;if(_0x4ca3dc[_0x4cbe('0x2e')][_0x4cbe('0x3a')]){_0x37c1c0[_0x4cbe('0x3b')]=[{'all':!![]}];}return db[_0x4cbe('0x3c')]['findAll'](_0x37c1c0);})['then'](function(_0x45f73f){_0x22a8bd[_0x4cbe('0x3d')]=_0x45f73f;return _0x22a8bd;})['then'](respondWithFilteredResult(_0x2b597d,_0x37c1c0))['catch'](handleError(_0x2b597d,null));};exports[_0x4cbe('0x3e')]=function(_0x55c31d,_0x2f91c5){var _0x18e40d={'raw':!![],'where':{'id':_0x55c31d[_0x4cbe('0x3f')]['id']}},_0x2a6369={};_0x2a6369[_0x4cbe('0x2c')]=_['keys'](db[_0x4cbe('0x3c')]['rawAttributes']);_0x2a6369[_0x4cbe('0x2e')]=_[_0x4cbe('0x2f')](_0x55c31d[_0x4cbe('0x2e')]);_0x2a6369[_0x4cbe('0x30')]=_['intersection'](_0x2a6369[_0x4cbe('0x2c')],_0x2a6369[_0x4cbe('0x2e')]);_0x18e40d[_0x4cbe('0x33')]=_[_0x4cbe('0x31')](_0x2a6369[_0x4cbe('0x2c')],qs['fields'](_0x55c31d[_0x4cbe('0x2e')][_0x4cbe('0x32')]));_0x18e40d[_0x4cbe('0x33')]=_0x18e40d['attributes']['length']?_0x18e40d['attributes']:_0x2a6369['model'];if(_0x55c31d['query'][_0x4cbe('0x3a')]){_0x18e40d[_0x4cbe('0x3b')]=[{'all':!![]}];}_0x18e40d=_[_0x4cbe('0x38')]({},_0x18e40d,_0x55c31d[_0x4cbe('0x39')]);return db['VoiceMailMessage'][_0x4cbe('0x40')](_0x18e40d)[_0x4cbe('0x22')](handleEntityNotFound(_0x2f91c5,null))['then'](respondWithResult(_0x2f91c5,null))[_0x4cbe('0x41')](handleError(_0x2f91c5,null));};exports[_0x4cbe('0x42')]=function(_0x1d5e5c,_0x58b983){return db[_0x4cbe('0x3c')][_0x4cbe('0x42')](_0x1d5e5c[_0x4cbe('0x43')],{})[_0x4cbe('0x22')](respondWithResult(_0x58b983,0xc9))[_0x4cbe('0x41')](handleError(_0x58b983,null));};exports[_0x4cbe('0x20')]=function(_0x82a1dd,_0x1685e0){if(_0x82a1dd[_0x4cbe('0x43')]['id']){delete _0x82a1dd[_0x4cbe('0x43')]['id'];}return db[_0x4cbe('0x3c')][_0x4cbe('0x40')]({'where':{'id':_0x82a1dd['params']['id']}})[_0x4cbe('0x22')](handleEntityNotFound(_0x1685e0,null))[_0x4cbe('0x22')](saveUpdates(_0x82a1dd[_0x4cbe('0x43')],null))['then'](respondWithResult(_0x1685e0,null))[_0x4cbe('0x41')](handleError(_0x1685e0,null));};exports[_0x4cbe('0x21')]=function(_0x4e6eb8,_0x2b1439){return db[_0x4cbe('0x3c')]['find']({'where':{'id':_0x4e6eb8[_0x4cbe('0x3f')]['id']}})[_0x4cbe('0x22')](handleEntityNotFound(_0x2b1439,null))['then'](removeEntity(_0x2b1439,null))[_0x4cbe('0x41')](handleError(_0x2b1439,null));};exports[_0x4cbe('0x44')]=function(_0x12b41b,_0x578ca3,_0x573525){return db[_0x4cbe('0x3c')][_0x4cbe('0x40')]({'where':{'id':_0x12b41b[_0x4cbe('0x3f')]['id']},'attributes':['id',_0x4cbe('0x45'),_0x4cbe('0x46')]})[_0x4cbe('0x22')](handleEntityNotFound(_0x578ca3,null))['then'](function(_0x482665){if(_0x482665){if(!_0x482665[_0x4cbe('0x45')]){throw new db[(_0x4cbe('0x47'))][(_0x4cbe('0x48'))]('VoiceMailMessage\x20not\x20found');}var _0x9f29={'Content-Type':_0x4cbe('0x49'),'Content-Disposition':_0x4cbe('0x4a')};if(_0x482665[_0x4cbe('0x46')]){_0x9f29[_0x4cbe('0x4b')]=_0x4cbe('0x4c')+_0x482665[_0x4cbe('0x46')]+_0x4cbe('0x4d');}_0x578ca3[_0x4cbe('0x1b')](_0x9f29);return _0x578ca3[_0x4cbe('0x4e')](new Buffer(_0x482665[_0x4cbe('0x45')]));}})[_0x4cbe('0x41')](handleError(_0x578ca3,null));}; \ No newline at end of file +var _0x29a0=['pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','create','body','update','find','params','download','recording','msg_id','Sequelize','ValidationError','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','then','destroy','error','name','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort'];(function(_0x465cfe,_0x98daf6){var _0x1d879a=function(_0xbf3fcd){while(--_0xbf3fcd){_0x465cfe['push'](_0x465cfe['shift']());}};_0x1d879a(++_0x98daf6);}(_0x29a0,0x6b));var _0x029a=function(_0x2bc088,_0x2a7e15){_0x2bc088=_0x2bc088-0x0;var _0x26e019=_0x29a0[_0x2bc088];return _0x26e019;};'use strict';var emlformat=require(_0x029a('0x0'));var rimraf=require(_0x029a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x029a('0x2'));var BPromise=require(_0x029a('0x3'));var Mustache=require('mustache');var util=require(_0x029a('0x4'));var path=require(_0x029a('0x5'));var sox=require(_0x029a('0x6'));var csv=require(_0x029a('0x7'));var ejs=require(_0x029a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x029a('0x9'));var squel=require('squel');var crypto=require(_0x029a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x029a('0xb'));var toCsv=require(_0x029a('0x7'));var querystring=require(_0x029a('0xc'));var Papa=require(_0x029a('0xd'));var Redis=require(_0x029a('0xe'));var authService=require(_0x029a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x029a('0x10'));var hardwareService=require(_0x029a('0x11'));var logger=require(_0x029a('0x12'))(_0x029a('0x13'));var utils=require(_0x029a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x029a('0x15'));var db=require(_0x029a('0x16'))['db'];function respondWithStatusCode(_0x397d3d,_0x5549ed){_0x5549ed=_0x5549ed||0xcc;return function(_0x1e073f){if(_0x1e073f){return _0x397d3d[_0x029a('0x17')](_0x5549ed);}return _0x397d3d[_0x029a('0x18')](_0x5549ed)[_0x029a('0x19')]();};}function respondWithResult(_0x3733c3,_0x36bba8){_0x36bba8=_0x36bba8||0xc8;return function(_0x4bdca3){if(_0x4bdca3){return _0x3733c3[_0x029a('0x18')](_0x36bba8)[_0x029a('0x1a')](_0x4bdca3);}};}function respondWithFilteredResult(_0x224e12,_0x566d68){return function(_0x570f50){if(_0x570f50){var _0x2d6530=typeof _0x566d68[_0x029a('0x1b')]===_0x029a('0x1c')&&typeof _0x566d68['limit']===_0x029a('0x1c');var _0x3f9ac4=_0x570f50['count'];var _0x596e1a=_0x2d6530?0x0:_0x566d68[_0x029a('0x1b')];var _0xf6d9cd=_0x2d6530?_0x570f50[_0x029a('0x1d')]:_0x566d68['offset']+_0x566d68[_0x029a('0x1e')];var _0x5a9a09;if(_0xf6d9cd>=_0x3f9ac4){_0xf6d9cd=_0x3f9ac4;_0x5a9a09=0xc8;}else{_0x5a9a09=0xce;}_0x224e12[_0x029a('0x18')](_0x5a9a09);return _0x224e12[_0x029a('0x1f')]('Content-Range',_0x596e1a+'-'+_0xf6d9cd+'/'+_0x3f9ac4)['json'](_0x570f50);}return null;};}function patchUpdates(_0x32070c){return function(_0x15d6e3){try{jsonpatch['apply'](_0x15d6e3,_0x32070c,!![]);}catch(_0x5c8318){return BPromise[_0x029a('0x20')](_0x5c8318);}return _0x15d6e3[_0x029a('0x21')]();};}function saveUpdates(_0x5bf71b,_0x112d72){return function(_0x4a35e2){if(_0x4a35e2){return _0x4a35e2['update'](_0x5bf71b)[_0x029a('0x22')](function(_0x9c2143){return _0x9c2143;});}return null;};}function removeEntity(_0x1ffef0,_0x3db926){return function(_0x256fe2){if(_0x256fe2){return _0x256fe2[_0x029a('0x23')]()['then'](function(){_0x1ffef0[_0x029a('0x18')](0xcc)[_0x029a('0x19')]();});}};}function handleEntityNotFound(_0x12bda2,_0x15df9e){return function(_0x31837b){if(!_0x31837b){_0x12bda2[_0x029a('0x17')](0x194);}return _0x31837b;};}function handleError(_0x542c65,_0x3491f5){_0x3491f5=_0x3491f5||0x1f4;return function(_0x4b8071){logger[_0x029a('0x24')](_0x4b8071['stack']);if(_0x4b8071[_0x029a('0x25')]){delete _0x4b8071[_0x029a('0x25')];}_0x542c65['status'](_0x3491f5)['send'](_0x4b8071);};}exports[_0x029a('0x26')]=function(_0x2f1420,_0x29859b){var _0xfbd62={},_0x11bf66={},_0x351845={'count':0x0,'rows':[]};var _0x4ebec9=_[_0x029a('0x27')](db[_0x029a('0x28')][_0x029a('0x29')],function(_0x1ad7b8){return{'name':_0x1ad7b8[_0x029a('0x2a')],'type':_0x1ad7b8[_0x029a('0x2b')][_0x029a('0x2c')]};});_0x11bf66[_0x029a('0x2d')]=_[_0x029a('0x2e')](_['map'](_0x4ebec9,_0x029a('0x25')),['name']);_0x11bf66[_0x029a('0x2f')]=_[_0x029a('0x30')](_0x2f1420[_0x029a('0x2f')]);_0x11bf66[_0x029a('0x31')]=_[_0x029a('0x32')](_0x11bf66[_0x029a('0x2d')],_0x11bf66['query']);_0xfbd62['attributes']=_[_0x029a('0x32')](_0x11bf66[_0x029a('0x2d')],qs['fields'](_0x2f1420['query'][_0x029a('0x33')]));_0xfbd62[_0x029a('0x34')]=_0xfbd62['attributes'][_0x029a('0x35')]?_0xfbd62['attributes']:_0x11bf66[_0x029a('0x2d')];if(!_0x2f1420[_0x029a('0x2f')][_0x029a('0x36')]('nolimit')){_0xfbd62[_0x029a('0x1e')]=qs[_0x029a('0x1e')](_0x2f1420[_0x029a('0x2f')][_0x029a('0x1e')]);_0xfbd62[_0x029a('0x1b')]=qs['offset'](_0x2f1420[_0x029a('0x2f')][_0x029a('0x1b')]);}_0xfbd62[_0x029a('0x37')]=qs[_0x029a('0x38')](_0x2f1420['query'][_0x029a('0x38')]);_0xfbd62['where']=qs[_0x029a('0x31')](_[_0x029a('0x39')](_0x2f1420[_0x029a('0x2f')],_0x11bf66[_0x029a('0x31')]),_0x4ebec9);if(_0x2f1420[_0x029a('0x2f')][_0x029a('0x3a')]){_0xfbd62[_0x029a('0x3b')]=_[_0x029a('0x3c')](_0xfbd62[_0x029a('0x3b')],{'$or':_['map'](_0x4ebec9,function(_0x31f3a2){if(_0x31f3a2[_0x029a('0x2b')]!=='VIRTUAL'){var _0xfdb00b={};_0xfdb00b[_0x31f3a2[_0x029a('0x25')]]={'$like':'%'+_0x2f1420['query']['filter']+'%'};return _0xfdb00b;}})});}_0xfbd62=_['merge']({},_0xfbd62,_0x2f1420[_0x029a('0x3d')]);var _0x21cfd3={'where':_0xfbd62['where']};return db['VoiceMailMessage'][_0x029a('0x1d')](_0x21cfd3)[_0x029a('0x22')](function(_0x36ed7d){_0x351845[_0x029a('0x1d')]=_0x36ed7d;if(_0x2f1420[_0x029a('0x2f')][_0x029a('0x3e')]){_0xfbd62[_0x029a('0x3f')]=[{'all':!![]}];}return db[_0x029a('0x28')][_0x029a('0x40')](_0xfbd62);})['then'](function(_0x196a42){_0x351845[_0x029a('0x41')]=_0x196a42;return _0x351845;})[_0x029a('0x22')](respondWithFilteredResult(_0x29859b,_0xfbd62))[_0x029a('0x42')](handleError(_0x29859b,null));};exports[_0x029a('0x43')]=function(_0x2399a2,_0xe70a55){var _0x3d2e81={'raw':!![],'where':{'id':_0x2399a2['params']['id']}},_0x74a90={};_0x74a90['model']=_[_0x029a('0x30')](db[_0x029a('0x28')][_0x029a('0x29')]);_0x74a90[_0x029a('0x2f')]=_[_0x029a('0x30')](_0x2399a2[_0x029a('0x2f')]);_0x74a90[_0x029a('0x31')]=_['intersection'](_0x74a90['model'],_0x74a90[_0x029a('0x2f')]);_0x3d2e81[_0x029a('0x34')]=_[_0x029a('0x32')](_0x74a90[_0x029a('0x2d')],qs[_0x029a('0x33')](_0x2399a2['query'][_0x029a('0x33')]));_0x3d2e81[_0x029a('0x34')]=_0x3d2e81[_0x029a('0x34')][_0x029a('0x35')]?_0x3d2e81[_0x029a('0x34')]:_0x74a90[_0x029a('0x2d')];if(_0x2399a2[_0x029a('0x2f')][_0x029a('0x3e')]){_0x3d2e81['include']=[{'all':!![]}];}_0x3d2e81=_['merge']({},_0x3d2e81,_0x2399a2[_0x029a('0x3d')]);return db[_0x029a('0x28')]['find'](_0x3d2e81)[_0x029a('0x22')](handleEntityNotFound(_0xe70a55,null))[_0x029a('0x22')](respondWithResult(_0xe70a55,null))[_0x029a('0x42')](handleError(_0xe70a55,null));};exports[_0x029a('0x44')]=function(_0x385d03,_0x49251a){return db[_0x029a('0x28')][_0x029a('0x44')](_0x385d03[_0x029a('0x45')],{})[_0x029a('0x22')](respondWithResult(_0x49251a,0xc9))[_0x029a('0x42')](handleError(_0x49251a,null));};exports[_0x029a('0x46')]=function(_0x453fe1,_0x79eb8c){if(_0x453fe1['body']['id']){delete _0x453fe1[_0x029a('0x45')]['id'];}return db['VoiceMailMessage'][_0x029a('0x47')]({'where':{'id':_0x453fe1[_0x029a('0x48')]['id']}})[_0x029a('0x22')](handleEntityNotFound(_0x79eb8c,null))[_0x029a('0x22')](saveUpdates(_0x453fe1[_0x029a('0x45')],null))[_0x029a('0x22')](respondWithResult(_0x79eb8c,null))[_0x029a('0x42')](handleError(_0x79eb8c,null));};exports[_0x029a('0x23')]=function(_0x6f82e2,_0x1fed46){return db['VoiceMailMessage'][_0x029a('0x47')]({'where':{'id':_0x6f82e2[_0x029a('0x48')]['id']}})[_0x029a('0x22')](handleEntityNotFound(_0x1fed46,null))[_0x029a('0x22')](removeEntity(_0x1fed46,null))[_0x029a('0x42')](handleError(_0x1fed46,null));};exports[_0x029a('0x49')]=function(_0x212744,_0x571962,_0x40556d){return db[_0x029a('0x28')][_0x029a('0x47')]({'where':{'id':_0x212744[_0x029a('0x48')]['id']},'attributes':['id',_0x029a('0x4a'),_0x029a('0x4b')]})['then'](handleEntityNotFound(_0x571962,null))[_0x029a('0x22')](function(_0x3f6d41){if(_0x3f6d41){if(!_0x3f6d41[_0x029a('0x4a')]){throw new db[(_0x029a('0x4c'))][(_0x029a('0x4d'))]('VoiceMailMessage\x20not\x20found');}var _0x1d9568={'Content-Type':_0x029a('0x4e'),'Content-Disposition':_0x029a('0x4f')};if(_0x3f6d41[_0x029a('0x4b')]){_0x1d9568['Content-Disposition']=_0x029a('0x50')+_0x3f6d41[_0x029a('0x4b')]+_0x029a('0x51');}_0x571962[_0x029a('0x1f')](_0x1d9568);return _0x571962['send'](new Buffer(_0x3f6d41[_0x029a('0x4a')]));}})[_0x029a('0x42')](handleError(_0x571962,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index b724dd6..cc09134 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 _0x30de=['voice_voicemail_messages','dir','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','VoiceMailMessage'];(function(_0x3f94f9,_0x42774b){var _0x46f84f=function(_0xa080d8){while(--_0xa080d8){_0x3f94f9['push'](_0x3f94f9['shift']());}};_0x46f84f(++_0x42774b);}(_0x30de,0xf2));var _0xe30d=function(_0x4673d4,_0x49c6b4){_0x4673d4=_0x4673d4-0x0;var _0x41d49d=_0x30de[_0x4673d4];return _0x41d49d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe30d('0x0'))('api');var moment=require(_0xe30d('0x1'));var BPromise=require(_0xe30d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe30d('0x3'));var rimraf=require(_0xe30d('0x4'));var config=require(_0xe30d('0x5'));var attributes=require('./voiceMailMessage.attributes');module[_0xe30d('0x6')]=function(_0x4ee504,_0x5edec5){return _0x4ee504['define'](_0xe30d('0x7'),attributes,{'tableName':_0xe30d('0x8'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xe30d('0x9')]}],'timestamps':![]});}; \ No newline at end of file +var _0x3d6f=['../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1beece,_0x42d8ff){var _0x250492=function(_0x25f195){while(--_0x25f195){_0x1beece['push'](_0x1beece['shift']());}};_0x250492(++_0x42d8ff);}(_0x3d6f,0x131));var _0xf3d6=function(_0x461c18,_0x5605b9){_0x461c18=_0x461c18-0x0;var _0x35501c=_0x3d6f[_0x461c18];return _0x35501c;};'use strict';var _=require(_0xf3d6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf3d6('0x1'));var moment=require(_0xf3d6('0x2'));var BPromise=require(_0xf3d6('0x3'));var rp=require(_0xf3d6('0x4'));var fs=require('fs');var path=require(_0xf3d6('0x5'));var rimraf=require(_0xf3d6('0x6'));var config=require(_0xf3d6('0x7'));var attributes=require(_0xf3d6('0x8'));module['exports']=function(_0x21cbc9,_0x3b9b91){return _0x21cbc9[_0xf3d6('0x9')](_0xf3d6('0xa'),attributes,{'tableName':_0xf3d6('0xb'),'paranoid':![],'indexes':[{'name':_0xf3d6('0xc'),'fields':[_0xf3d6('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 5235985..d86c1e0 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 _0x4fba=['client','http','request','then','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','VoiceMailMessage,\x20%s,\x20%s','message','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x239edb,_0x207201){var _0x22d036=function(_0x2b6b50){while(--_0x2b6b50){_0x239edb['push'](_0x239edb['shift']());}};_0x22d036(++_0x207201);}(_0x4fba,0x1b0));var _0xa4fb=function(_0x32da04,_0x255b7b){_0x32da04=_0x32da04-0x0;var _0x468bac=_0x4fba[_0x32da04];return _0x468bac;};'use strict';var _=require(_0xa4fb('0x0'));var util=require(_0xa4fb('0x1'));var moment=require(_0xa4fb('0x2'));var BPromise=require('bluebird');var rs=require(_0xa4fb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa4fb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa4fb('0x5'))(_0xa4fb('0x6'));var config=require(_0xa4fb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa4fb('0x8')][_0xa4fb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ce037,_0x110818,_0x3bb488){return new BPromise(function(_0xb76faa,_0xf96723){return client[_0xa4fb('0xa')](_0x4ce037,_0x3bb488)[_0xa4fb('0xb')](function(_0x3f2918){logger[_0xa4fb('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x110818,_0xa4fb('0xd'));logger[_0xa4fb('0xe')](_0xa4fb('0xf'),_0x110818,_0xa4fb('0xd'),JSON['stringify'](_0x3f2918));if(_0x3f2918['error']){if(_0x3f2918[_0xa4fb('0x10')][_0xa4fb('0x11')]===0x1f4){logger[_0xa4fb('0x10')](_0xa4fb('0x12'),_0x110818,_0x3f2918[_0xa4fb('0x10')][_0xa4fb('0x13')]);return _0xf96723(_0x3f2918[_0xa4fb('0x10')]['message']);}logger['error'](_0xa4fb('0x12'),_0x110818,_0x3f2918['error'][_0xa4fb('0x13')]);return _0xb76faa(_0x3f2918['error']['message']);}else{logger[_0xa4fb('0xc')](_0xa4fb('0x12'),_0x110818,_0xa4fb('0xd'));_0xb76faa(_0x3f2918['result'][_0xa4fb('0x13')]);}})['catch'](function(_0x4a2403){logger['error'](_0xa4fb('0x12'),_0x110818,_0x4a2403);_0xf96723(_0x4a2403);});});} \ No newline at end of file +var _0xd847=['VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xd847,0x14b));var _0x7d84=function(_0x243a18,_0x566c36){_0x243a18=_0x243a18-0x0;var _0x2e40c9=_0xd847[_0x243a18];return _0x2e40c9;};'use strict';var _=require(_0x7d84('0x0'));var util=require(_0x7d84('0x1'));var moment=require(_0x7d84('0x2'));var BPromise=require(_0x7d84('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d84('0x4'));var db=require(_0x7d84('0x5'))['db'];var utils=require(_0x7d84('0x6'));var logger=require(_0x7d84('0x7'))('rpc');var config=require(_0x7d84('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7d84('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe17b58,_0xa6053d,_0x53fbef){return new BPromise(function(_0x54ae0d,_0x37479e){return client['request'](_0xe17b58,_0x53fbef)[_0x7d84('0xa')](function(_0x56e4b7){logger['info'](_0x7d84('0xb'),_0xa6053d,'request\x20sent');logger['debug'](_0x7d84('0xc'),_0xa6053d,'request\x20sent',JSON[_0x7d84('0xd')](_0x56e4b7));if(_0x56e4b7[_0x7d84('0xe')]){if(_0x56e4b7['error'][_0x7d84('0xf')]===0x1f4){logger[_0x7d84('0xe')](_0x7d84('0xb'),_0xa6053d,_0x56e4b7[_0x7d84('0xe')][_0x7d84('0x10')]);return _0x37479e(_0x56e4b7[_0x7d84('0xe')][_0x7d84('0x10')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0xa6053d,_0x56e4b7[_0x7d84('0xe')][_0x7d84('0x10')]);return _0x54ae0d(_0x56e4b7[_0x7d84('0xe')][_0x7d84('0x10')]);}else{logger['info'](_0x7d84('0xb'),_0xa6053d,_0x7d84('0x11'));_0x54ae0d(_0x56e4b7[_0x7d84('0x12')][_0x7d84('0x10')]);}})['catch'](function(_0x208e22){logger[_0x7d84('0xe')](_0x7d84('0xb'),_0xa6053d,_0x208e22);_0x37479e(_0x208e22);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 4cc41e6..96ed284 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 _0x3380=['create','addSound','put','/:id','update','delete','destroy','/:id/sounds/:id2','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','show','/:id/sounds','getSounds','post'];(function(_0x2786ae,_0x19a4b5){var _0x41b174=function(_0x377596){while(--_0x377596){_0x2786ae['push'](_0x2786ae['shift']());}};_0x41b174(++_0x19a4b5);}(_0x3380,0x1ab));var _0x0338=function(_0x4217fb,_0x13d7a8){_0x4217fb=_0x4217fb-0x0;var _0x33f85e=_0x3380[_0x4217fb];return _0x33f85e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0338('0x0'));var timeout=require(_0x0338('0x1'));var express=require('express');var router=express[_0x0338('0x2')]();var fs_extra=require(_0x0338('0x3'));var auth=require(_0x0338('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0338('0x5'));var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth[_0x0338('0x6')](),controller[_0x0338('0x7')]);router[_0x0338('0x8')]('/:id',auth[_0x0338('0x6')](),controller[_0x0338('0x9')]);router[_0x0338('0x8')](_0x0338('0xa'),auth[_0x0338('0x6')](),controller[_0x0338('0xb')]);router[_0x0338('0xc')]('/',auth['isAuthenticated'](),controller[_0x0338('0xd')]);router[_0x0338('0xc')](_0x0338('0xa'),auth[_0x0338('0x6')](),controller[_0x0338('0xe')]);router[_0x0338('0xf')](_0x0338('0x10'),auth[_0x0338('0x6')](),controller[_0x0338('0x11')]);router[_0x0338('0x12')](_0x0338('0x10'),auth['isAuthenticated'](),controller[_0x0338('0x13')]);router[_0x0338('0x12')](_0x0338('0x14'),auth['isAuthenticated'](),controller['removeSound']);module[_0x0338('0x15')]=router; \ No newline at end of file +var _0x856c=['/:id','update','delete','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','/:id/sounds','post','create','put'];(function(_0xde5d8a,_0x4afa17){var _0x2b3040=function(_0x112a1e){while(--_0x112a1e){_0xde5d8a['push'](_0xde5d8a['shift']());}};_0x2b3040(++_0x4afa17);}(_0x856c,0xcf));var _0xc856=function(_0x4dc9e2,_0x9b0f3e){_0x4dc9e2=_0x4dc9e2-0x0;var _0x54219e=_0x856c[_0x4dc9e2];return _0x54219e;};'use strict';var multer=require('multer');var util=require(_0xc856('0x0'));var path=require(_0xc856('0x1'));var timeout=require('connect-timeout');var express=require(_0xc856('0x2'));var router=express[_0xc856('0x3')]();var fs_extra=require(_0xc856('0x4'));var auth=require(_0xc856('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc856('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0xc856('0x7')]('/',auth[_0xc856('0x8')](),controller['index']);router[_0xc856('0x7')]('/:id',auth[_0xc856('0x8')](),controller[_0xc856('0x9')]);router[_0xc856('0x7')](_0xc856('0xa'),auth['isAuthenticated'](),controller['getSounds']);router[_0xc856('0xb')]('/',auth['isAuthenticated'](),controller[_0xc856('0xc')]);router['post'](_0xc856('0xa'),auth[_0xc856('0x8')](),controller['addSound']);router[_0xc856('0xd')](_0xc856('0xe'),auth['isAuthenticated'](),controller[_0xc856('0xf')]);router[_0xc856('0x10')](_0xc856('0xe'),auth[_0xc856('0x8')](),controller['destroy']);router[_0xc856('0x10')]('/:id/sounds/:id2',auth[_0xc856('0x8')](),controller['removeSound']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index e88cee1..4b8cc8f 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 _0xd072=['mp3nb','quietmp3','mp3','BOOLEAN','sequelize','exports','STRING','custom','files'];(function(_0x43c6f8,_0x98a3b2){var _0x110e62=function(_0x5a7cbb){while(--_0x5a7cbb){_0x43c6f8['push'](_0x43c6f8['shift']());}};_0x110e62(++_0x98a3b2);}(_0xd072,0x163));var _0x2d07=function(_0x2f4885,_0x21952c){_0x2f4885=_0x2f4885-0x0;var _0x3901dc=_0xd072[_0x2f4885];return _0x3901dc;};'use strict';var Sequelize=require(_0x2d07('0x0'));module[_0x2d07('0x1')]={'name':{'type':Sequelize[_0x2d07('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM'](_0x2d07('0x3'),_0x2d07('0x4'),_0x2d07('0x5'),'quietmp3nb',_0x2d07('0x6'),_0x2d07('0x7')),'allowNull':!![],'defaultValue':_0x2d07('0x4')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x2d07('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x2d07('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x2d07('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x2d07('0x8')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2104=['ENUM','mp3nb','quietmp3nb','quietmp3','mp3','files','alpha','TIMESTAMP','sequelize','exports','STRING','name'];(function(_0x5e4e1b,_0x191eb1){var _0x58173e=function(_0x1e9c44){while(--_0x1e9c44){_0x5e4e1b['push'](_0x5e4e1b['shift']());}};_0x58173e(++_0x191eb1);}(_0x2104,0x110));var _0x4210=function(_0x188d31,_0x576e87){_0x188d31=_0x188d31-0x0;var _0x30ed33=_0x2104[_0x188d31];return _0x30ed33;};'use strict';var Sequelize=require(_0x4210('0x0'));module[_0x4210('0x1')]={'name':{'type':Sequelize[_0x4210('0x2')],'allowNull':![],'unique':_0x4210('0x3')},'mode':{'type':Sequelize[_0x4210('0x4')]('custom','files',_0x4210('0x5'),_0x4210('0x6'),_0x4210('0x7'),_0x4210('0x8')),'allowNull':!![],'defaultValue':_0x4210('0x9')},'directory':{'type':Sequelize[_0x4210('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x4210('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x4210('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x4210('0x2')],'allowNull':!![],'defaultValue':_0x4210('0xa')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x4210('0xb')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 d01d5b3..8530dc8 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 _0xcaf6=['catch','body','create','sequelize','mode','join','files','mkdirSync','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','transaction','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','Sound','save_name','converted_format','createdAt','root','%s.%s','basename','extname','server/files/moh','format','symlinkSync','message','id2','findOne','getSounds','hasOwnProperty','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','stack','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','show','params','keys','options','find'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xcaf6,0x1e4));var _0x6caf=function(_0x3f4a8e,_0x507c39){_0x3f4a8e=_0x3f4a8e-0x0;var _0x7f68fd=_0xcaf6[_0x3f4a8e];return _0x7f68fd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6caf('0x0'));var zipdir=require(_0x6caf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6caf('0x2'));var moment=require(_0x6caf('0x3'));var BPromise=require(_0x6caf('0x4'));var Mustache=require('mustache');var util=require(_0x6caf('0x5'));var path=require('path');var sox=require(_0x6caf('0x6'));var csv=require(_0x6caf('0x7'));var ejs=require(_0x6caf('0x8'));var fs=require('fs');var fs_extra=require(_0x6caf('0x9'));var _=require(_0x6caf('0xa'));var squel=require(_0x6caf('0xb'));var crypto=require('crypto');var jsforce=require(_0x6caf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6caf('0x7'));var querystring=require(_0x6caf('0xd'));var Papa=require(_0x6caf('0xe'));var Redis=require('ioredis');var authService=require(_0x6caf('0xf'));var qs=require(_0x6caf('0x10'));var as=require(_0x6caf('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6caf('0x12'));var utils=require(_0x6caf('0x13'));var config=require(_0x6caf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e7612,_0x1f6663){_0x1f6663=_0x1f6663||0xcc;return function(_0x1e6b87){if(_0x1e6b87){return _0x2e7612[_0x6caf('0x15')](_0x1f6663);}return _0x2e7612[_0x6caf('0x16')](_0x1f6663)[_0x6caf('0x17')]();};}function respondWithResult(_0x4b0efd,_0x265248){_0x265248=_0x265248||0xc8;return function(_0x411293){if(_0x411293){return _0x4b0efd[_0x6caf('0x16')](_0x265248)[_0x6caf('0x18')](_0x411293);}};}function respondWithFilteredResult(_0x1d1b18,_0x43a3d7){return function(_0x3aaec5){if(_0x3aaec5){var _0x2412ca=typeof _0x43a3d7['offset']===_0x6caf('0x19')&&typeof _0x43a3d7[_0x6caf('0x1a')]===_0x6caf('0x19');var _0x15d1ba=_0x3aaec5[_0x6caf('0x1b')];var _0xcd956f=_0x2412ca?0x0:_0x43a3d7[_0x6caf('0x1c')];var _0x352ea6=_0x2412ca?_0x3aaec5['count']:_0x43a3d7[_0x6caf('0x1c')]+_0x43a3d7[_0x6caf('0x1a')];var _0x1b03c6;if(_0x352ea6>=_0x15d1ba){_0x352ea6=_0x15d1ba;_0x1b03c6=0xc8;}else{_0x1b03c6=0xce;}_0x1d1b18[_0x6caf('0x16')](_0x1b03c6);return _0x1d1b18[_0x6caf('0x1d')](_0x6caf('0x1e'),_0xcd956f+'-'+_0x352ea6+'/'+_0x15d1ba)[_0x6caf('0x18')](_0x3aaec5);}return null;};}function patchUpdates(_0x588d88){return function(_0x36861d){try{jsonpatch[_0x6caf('0x1f')](_0x36861d,_0x588d88,!![]);}catch(_0x37c2c4){return BPromise[_0x6caf('0x20')](_0x37c2c4);}return _0x36861d[_0x6caf('0x21')]();};}function saveUpdates(_0x1abd03,_0x433738){return function(_0x4fa975){if(_0x4fa975){return _0x4fa975[_0x6caf('0x22')](_0x1abd03)[_0x6caf('0x23')](function(_0x13c6aa){return _0x13c6aa;});}return null;};}function removeEntity(_0x55b871,_0x2946c5){return function(_0xcfca9){if(_0xcfca9){return _0xcfca9[_0x6caf('0x24')]()[_0x6caf('0x23')](function(){var _0x550b61=_0xcfca9[_0x6caf('0x25')]({'plain':!![]});var _0x4a239d=_0x6caf('0x26');return db[_0x6caf('0x27')][_0x6caf('0x24')]({'where':{'type':_0x4a239d,'resourceId':_0x550b61['id']}})[_0x6caf('0x23')](function(){return _0xcfca9;});})['then'](function(){_0x55b871[_0x6caf('0x16')](0xcc)[_0x6caf('0x17')]();});}};}function handleEntityNotFound(_0x1b05e9,_0x2792b1){return function(_0x297a67){if(!_0x297a67){_0x1b05e9['sendStatus'](0x194);}return _0x297a67;};}function handleError(_0x1974de,_0x25d5d5){_0x25d5d5=_0x25d5d5||0x1f4;return function(_0xd17215){logger['error'](_0xd17215[_0x6caf('0x28')]);if(_0xd17215[_0x6caf('0x29')]){delete _0xd17215[_0x6caf('0x29')];}_0x1974de[_0x6caf('0x16')](_0x25d5d5)['send'](_0xd17215);};}exports[_0x6caf('0x2a')]=function(_0x4294e0,_0x4acc93){var _0x1d3b89={},_0x15f5ac={},_0x397eda={'count':0x0,'rows':[]};var _0x3abe5a=_[_0x6caf('0x2b')](db[_0x6caf('0x2c')][_0x6caf('0x2d')],function(_0x2f3c5b){return{'name':_0x2f3c5b[_0x6caf('0x2e')],'type':_0x2f3c5b[_0x6caf('0x2f')]['key']};});_0x15f5ac[_0x6caf('0x30')]=_[_0x6caf('0x2b')](_0x3abe5a,'name');_0x15f5ac[_0x6caf('0x31')]=_['keys'](_0x4294e0[_0x6caf('0x31')]);_0x15f5ac[_0x6caf('0x32')]=_[_0x6caf('0x33')](_0x15f5ac[_0x6caf('0x30')],_0x15f5ac['query']);_0x1d3b89[_0x6caf('0x34')]=_[_0x6caf('0x33')](_0x15f5ac[_0x6caf('0x30')],qs[_0x6caf('0x35')](_0x4294e0[_0x6caf('0x31')]['fields']));_0x1d3b89[_0x6caf('0x34')]=_0x1d3b89[_0x6caf('0x34')][_0x6caf('0x36')]?_0x1d3b89[_0x6caf('0x34')]:_0x15f5ac[_0x6caf('0x30')];if(!_0x4294e0[_0x6caf('0x31')]['hasOwnProperty'](_0x6caf('0x37'))){_0x1d3b89[_0x6caf('0x1a')]=qs['limit'](_0x4294e0[_0x6caf('0x31')][_0x6caf('0x1a')]);_0x1d3b89[_0x6caf('0x1c')]=qs['offset'](_0x4294e0['query'][_0x6caf('0x1c')]);}_0x1d3b89[_0x6caf('0x38')]=qs[_0x6caf('0x39')](_0x4294e0[_0x6caf('0x31')]['sort']);delete _0x4294e0['query'][_0x6caf('0x39')];_0x1d3b89[_0x6caf('0x3a')]=qs[_0x6caf('0x32')](_[_0x6caf('0x3b')](_0x4294e0[_0x6caf('0x31')],_0x15f5ac[_0x6caf('0x32')]),_0x3abe5a);if(_0x4294e0['query'][_0x6caf('0x3c')]){_0x1d3b89[_0x6caf('0x3a')]=_['merge'](_0x1d3b89[_0x6caf('0x3a')],{'$or':_[_0x6caf('0x2b')](_0x3abe5a,function(_0x1a548d){if(_0x1a548d[_0x6caf('0x2f')]!==_0x6caf('0x3d')){var _0x1c9caa={};_0x1c9caa[_0x1a548d[_0x6caf('0x29')]]={'$like':'%'+_0x4294e0[_0x6caf('0x31')]['filter']+'%'};return _0x1c9caa;}})});}_0x1d3b89=_[_0x6caf('0x3e')]({},_0x1d3b89,_0x4294e0['options']);var _0x2dfe6f={'where':_0x1d3b89[_0x6caf('0x3a')]};return db[_0x6caf('0x2c')][_0x6caf('0x1b')](_0x2dfe6f)['then'](function(_0x33aa10){_0x397eda[_0x6caf('0x1b')]=_0x33aa10;if(_0x4294e0[_0x6caf('0x31')][_0x6caf('0x3f')]){_0x1d3b89[_0x6caf('0x40')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x6caf('0x41')](_0x1d3b89);})[_0x6caf('0x23')](function(_0x5c0856){_0x397eda['rows']=_0x5c0856;return _0x397eda;})['then'](respondWithFilteredResult(_0x4acc93,_0x1d3b89))['catch'](handleError(_0x4acc93,null));};exports[_0x6caf('0x42')]=function(_0x2465ce,_0x1d4d2d){var _0x432ca2={'raw':![],'where':{'id':_0x2465ce[_0x6caf('0x43')]['id']}},_0xc872b={};_0xc872b['model']=_['keys'](db[_0x6caf('0x2c')][_0x6caf('0x2d')]);_0xc872b[_0x6caf('0x31')]=_[_0x6caf('0x44')](_0x2465ce[_0x6caf('0x31')]);_0xc872b['filters']=_['intersection'](_0xc872b[_0x6caf('0x30')],_0xc872b['query']);_0x432ca2['attributes']=_[_0x6caf('0x33')](_0xc872b[_0x6caf('0x30')],qs[_0x6caf('0x35')](_0x2465ce['query'][_0x6caf('0x35')]));_0x432ca2[_0x6caf('0x34')]=_0x432ca2[_0x6caf('0x34')]['length']?_0x432ca2['attributes']:_0xc872b[_0x6caf('0x30')];if(_0x2465ce[_0x6caf('0x31')]['includeAll']){_0x432ca2['include']=[{'all':!![]}];}_0x432ca2=_[_0x6caf('0x3e')]({},_0x432ca2,_0x2465ce[_0x6caf('0x45')]);return db[_0x6caf('0x2c')][_0x6caf('0x46')](_0x432ca2)['then'](handleEntityNotFound(_0x1d4d2d,null))[_0x6caf('0x23')](respondWithResult(_0x1d4d2d,null))[_0x6caf('0x47')](handleError(_0x1d4d2d,null));};exports['update']=function(_0x212805,_0x4666b9){if(_0x212805[_0x6caf('0x48')]['id']){delete _0x212805[_0x6caf('0x48')]['id'];}return db['VoiceMusicOnHold'][_0x6caf('0x46')]({'where':{'id':_0x212805['params']['id']}})[_0x6caf('0x23')](handleEntityNotFound(_0x4666b9,null))[_0x6caf('0x23')](saveUpdates(_0x212805[_0x6caf('0x48')],null))[_0x6caf('0x23')](respondWithResult(_0x4666b9,null))[_0x6caf('0x47')](handleError(_0x4666b9,null));};exports[_0x6caf('0x49')]=function(_0x683d71,_0x53df0e,_0x2a58de){return db[_0x6caf('0x4a')]['transaction'](function(_0x273755){if(_0x683d71[_0x6caf('0x48')][_0x6caf('0x4b')]==='files'){_0x683d71[_0x6caf('0x48')]['directory']=path[_0x6caf('0x4c')](config['root'],'server/files/moh',_0x683d71[_0x6caf('0x48')][_0x6caf('0x29')]);}return db[_0x6caf('0x2c')]['create'](_0x683d71[_0x6caf('0x48')],{'transaction':_0x273755})['then'](function(_0x429060){if(_0x683d71[_0x6caf('0x48')][_0x6caf('0x4b')]===_0x6caf('0x4d')){fs[_0x6caf('0x4e')](_0x429060[_0x6caf('0x4f')],parseInt(_0x6caf('0x50'),0x8));}var _0x1ab903=_0x683d71[_0x6caf('0x51')]['get']({'plain':!![]});if(!_0x1ab903)throw new Error(_0x6caf('0x52'));if(_0x1ab903[_0x6caf('0x53')]===_0x6caf('0x51')){var _0x54d487=_0x429060[_0x6caf('0x25')]({'plain':!![]});return db[_0x6caf('0x54')][_0x6caf('0x46')]({'where':{'name':_0x6caf('0x26'),'userProfileId':_0x1ab903[_0x6caf('0x55')]},'raw':!![]})['then'](function(_0x176d4b){if(_0x176d4b&&_0x176d4b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x54d487[_0x6caf('0x29')],'resourceId':_0x54d487['id'],'type':_0x176d4b['name'],'sectionId':_0x176d4b['id']},{})[_0x6caf('0x23')](function(){return _0x429060;});}else{return _0x429060;}})['catch'](function(_0x497548){logger[_0x6caf('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x497548);});}return _0x429060;});})['then'](respondWithResult(_0x53df0e,0xc9))[_0x6caf('0x47')](handleError(_0x53df0e,null));};exports[_0x6caf('0x24')]=function(_0x552b4f,_0x5ab6c2,_0x19392c){var _0x5c7e41;return db[_0x6caf('0x2c')][_0x6caf('0x46')]({'where':{'id':_0x552b4f[_0x6caf('0x43')]['id']}})[_0x6caf('0x23')](function(_0x4740ce){if(_0x4740ce){return db[_0x6caf('0x4a')][_0x6caf('0x57')](function(_0x458cc8){return _0x4740ce[_0x6caf('0x24')]({'transaction':_0x458cc8,'raw':!![]})[_0x6caf('0x23')](function(_0x64285b){if(_0x64285b[_0x6caf('0x4f')]){fs[_0x6caf('0x58')](_0x64285b['directory'])[_0x6caf('0x59')](function(_0x2b796e){fs[_0x6caf('0x5a')](path[_0x6caf('0x4c')](_0x64285b[_0x6caf('0x4f')],_0x2b796e));});fs[_0x6caf('0x5b')](_0x64285b[_0x6caf('0x4f')]);}return _0x64285b;});})[_0x6caf('0x47')](function(_0x252a1a){throw new db[(_0x6caf('0x5c'))][(_0x6caf('0x5d'))](_0x252a1a['message']);});}})[_0x6caf('0x23')](handleEntityNotFound(_0x5ab6c2,null))['then'](removeEntity(_0x5ab6c2,null))['catch'](handleError(_0x5ab6c2,null));};exports[_0x6caf('0x5e')]=function(_0x3ac940,_0x1cccfe,_0x41c973){return db[_0x6caf('0x4a')]['transaction'](function(_0x41c1b8){var _0x118012;return db[_0x6caf('0x2c')][_0x6caf('0x46')]({'where':{'id':_0x3ac940[_0x6caf('0x43')]['id']}})[_0x6caf('0x23')](function(_0x2820e1){if(_0x2820e1){_0x118012=_0x2820e1;return _0x2820e1[_0x6caf('0x5e')](_0x3ac940[_0x6caf('0x48')]['id'],{'transaction':_0x41c1b8});}})[_0x6caf('0x23')](function(_0x522209){if(_0x522209){return db[_0x6caf('0x5f')]['findOne']({'where':{'id':_0x3ac940[_0x6caf('0x48')]['id']},'attributes':['id','name',_0x6caf('0x60'),_0x6caf('0x61'),_0x6caf('0x62')],'raw':!![]});}})[_0x6caf('0x23')](function(_0x431975){if(_0x431975){var _0xa0096a=path[_0x6caf('0x4c')](config[_0x6caf('0x63')],'server/files/sounds/converted',util['format'](_0x6caf('0x64'),path[_0x6caf('0x65')](_0x431975[_0x6caf('0x60')],path[_0x6caf('0x66')](_0x431975['save_name'])),_0x431975[_0x6caf('0x61')]));var _0x5067f0=path['join'](config[_0x6caf('0x63')],_0x6caf('0x67'),_0x118012[_0x6caf('0x29')],util[_0x6caf('0x68')](_0x6caf('0x64'),_0x431975[_0x6caf('0x29')],_0x431975[_0x6caf('0x61')]));fs[_0x6caf('0x69')](_0xa0096a,_0x5067f0);return _0x431975;}})[_0x6caf('0x47')](function(_0x3f5010){throw new db[(_0x6caf('0x5c'))][(_0x6caf('0x5d'))](_0x3f5010[_0x6caf('0x6a')]);});})[_0x6caf('0x23')](handleEntityNotFound(_0x1cccfe,null))['then'](respondWithResult(_0x1cccfe,0xc9))[_0x6caf('0x47')](handleError(_0x1cccfe,null));};exports['removeSound']=function(_0x45c648,_0x34efff,_0x23fa03){return db[_0x6caf('0x4a')][_0x6caf('0x57')](function(_0x2053e7){var _0x49e29e;return db[_0x6caf('0x2c')]['findOne']({'where':{'id':_0x45c648['params']['id']}})[_0x6caf('0x23')](handleEntityNotFound(_0x34efff,null))[_0x6caf('0x23')](function(_0x3345f0){if(_0x3345f0){_0x49e29e=_0x3345f0;return _0x3345f0['removeSound'](_0x45c648[_0x6caf('0x43')][_0x6caf('0x6b')]);}})[_0x6caf('0x23')](function(_0x2a368a){if(_0x2a368a){return db['Sound'][_0x6caf('0x6c')]({'where':{'id':_0x45c648['params'][_0x6caf('0x6b')]},'attributes':['id',_0x6caf('0x29'),'save_name',_0x6caf('0x61'),_0x6caf('0x62')],'raw':!![]});}})[_0x6caf('0x23')](function(_0x1d173a){if(_0x1d173a){fs[_0x6caf('0x5a')](path[_0x6caf('0x4c')](_0x49e29e[_0x6caf('0x4f')],util[_0x6caf('0x68')]('%s.%s',_0x1d173a[_0x6caf('0x29')],_0x1d173a['converted_format'])));return _0x1d173a;}})[_0x6caf('0x47')](function(_0x1fd5b1){throw new db[(_0x6caf('0x5c'))]['ValidationError'](_0x1fd5b1['message']);});})[_0x6caf('0x23')](handleEntityNotFound(_0x34efff,null))[_0x6caf('0x23')](respondWithStatusCode(_0x34efff,0xcc))['catch'](handleError(_0x34efff,null));};exports[_0x6caf('0x6d')]=function(_0x5250a1,_0x63305c,_0x50bd86){var _0x512fe4={};var _0x31df77={};var _0x5042a6;var _0x299b02;return db[_0x6caf('0x2c')]['findOne']({'where':{'id':_0x5250a1[_0x6caf('0x43')]['id']}})['then'](handleEntityNotFound(_0x63305c,null))['then'](function(_0x4196a9){if(_0x4196a9){_0x5042a6=_0x4196a9;_0x31df77[_0x6caf('0x30')]=_[_0x6caf('0x44')](db[_0x6caf('0x5f')][_0x6caf('0x2d')]);_0x31df77['query']=_[_0x6caf('0x44')](_0x5250a1[_0x6caf('0x31')]);_0x31df77['filters']=_['intersection'](_0x31df77[_0x6caf('0x30')],_0x31df77['query']);_0x512fe4[_0x6caf('0x34')]=_[_0x6caf('0x33')](_0x31df77[_0x6caf('0x30')],qs[_0x6caf('0x35')](_0x5250a1[_0x6caf('0x31')][_0x6caf('0x35')]));_0x512fe4[_0x6caf('0x34')]=_0x512fe4[_0x6caf('0x34')]['length']?_0x512fe4[_0x6caf('0x34')]:_0x31df77[_0x6caf('0x30')];_0x512fe4['order']=qs['sort'](_0x5250a1[_0x6caf('0x31')][_0x6caf('0x39')]);_0x512fe4['where']=qs[_0x6caf('0x32')](_['pick'](_0x5250a1['query'],_0x31df77[_0x6caf('0x32')]));if(_0x5250a1[_0x6caf('0x31')]['filter']){_0x512fe4['where']=_[_0x6caf('0x3e')](_0x512fe4[_0x6caf('0x3a')],{'$or':_[_0x6caf('0x2b')](_0x512fe4[_0x6caf('0x34')],function(_0x4ec66f){var _0x31e98a={};_0x31e98a[_0x4ec66f]={'$like':'%'+_0x5250a1[_0x6caf('0x31')][_0x6caf('0x3c')]+'%'};return _0x31e98a;})});}_0x512fe4=_[_0x6caf('0x3e')]({},_0x512fe4,_0x5250a1[_0x6caf('0x45')]);return _0x5042a6[_0x6caf('0x6d')](_0x512fe4);}})['then'](function(_0x1459ba){if(_0x1459ba){_0x299b02=_0x1459ba[_0x6caf('0x36')];if(!_0x5250a1[_0x6caf('0x31')][_0x6caf('0x6e')](_0x6caf('0x37'))){_0x512fe4[_0x6caf('0x1a')]=qs[_0x6caf('0x1a')](_0x5250a1[_0x6caf('0x31')][_0x6caf('0x1a')]);_0x512fe4[_0x6caf('0x1c')]=qs[_0x6caf('0x1c')](_0x5250a1['query'][_0x6caf('0x1c')]);}return _0x5042a6[_0x6caf('0x6d')](_0x512fe4);}})[_0x6caf('0x23')](function(_0x253690){if(_0x253690){return _0x253690?{'count':_0x299b02,'rows':_0x253690}:null;}})[_0x6caf('0x23')](respondWithResult(_0x63305c,null))[_0x6caf('0x47')](handleError(_0x63305c,null));}; \ No newline at end of file +var _0xfbd1=['Sound','server/files/sounds/converted','%s.%s','basename','save_name','format','converted_format','Sequelize','removeSound','findOne','id2','createdAt','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','error','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','body','create','sequelize','transaction','files','directory','join','root','server/files/moh','mode','mkdirSync','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','ValidationError','message','addSound'];(function(_0x2d992c,_0x4d6498){var _0x3033e2=function(_0x59c910){while(--_0x59c910){_0x2d992c['push'](_0x2d992c['shift']());}};_0x3033e2(++_0x4d6498);}(_0xfbd1,0xed));var _0x1fbd=function(_0x34311c,_0x52a317){_0x34311c=_0x34311c-0x0;var _0x4b8b35=_0xfbd1[_0x34311c];return _0x4b8b35;};'use strict';var emlformat=require(_0x1fbd('0x0'));var rimraf=require(_0x1fbd('0x1'));var zipdir=require(_0x1fbd('0x2'));var jsonpatch=require(_0x1fbd('0x3'));var rp=require('request-promise');var moment=require(_0x1fbd('0x4'));var BPromise=require(_0x1fbd('0x5'));var Mustache=require(_0x1fbd('0x6'));var util=require(_0x1fbd('0x7'));var path=require(_0x1fbd('0x8'));var sox=require(_0x1fbd('0x9'));var csv=require(_0x1fbd('0xa'));var ejs=require(_0x1fbd('0xb'));var fs=require('fs');var fs_extra=require(_0x1fbd('0xc'));var _=require(_0x1fbd('0xd'));var squel=require(_0x1fbd('0xe'));var crypto=require('crypto');var jsforce=require(_0x1fbd('0xf'));var deskjs=require(_0x1fbd('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1fbd('0x11'));var Redis=require('ioredis');var authService=require(_0x1fbd('0x12'));var qs=require(_0x1fbd('0x13'));var as=require(_0x1fbd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1fbd('0x15'));var utils=require(_0x1fbd('0x16'));var config=require(_0x1fbd('0x17'));var licenseUtil=require(_0x1fbd('0x18'));var db=require(_0x1fbd('0x19'))['db'];function respondWithStatusCode(_0x34fc91,_0x99b3cf){_0x99b3cf=_0x99b3cf||0xcc;return function(_0x380015){if(_0x380015){return _0x34fc91[_0x1fbd('0x1a')](_0x99b3cf);}return _0x34fc91['status'](_0x99b3cf)[_0x1fbd('0x1b')]();};}function respondWithResult(_0x44aafd,_0x5bcb81){_0x5bcb81=_0x5bcb81||0xc8;return function(_0x2cfa68){if(_0x2cfa68){return _0x44aafd[_0x1fbd('0x1c')](_0x5bcb81)['json'](_0x2cfa68);}};}function respondWithFilteredResult(_0x553006,_0x2eedc3){return function(_0x5332cf){if(_0x5332cf){var _0x36770a=typeof _0x2eedc3[_0x1fbd('0x1d')]===_0x1fbd('0x1e')&&typeof _0x2eedc3[_0x1fbd('0x1f')]===_0x1fbd('0x1e');var _0x15e087=_0x5332cf[_0x1fbd('0x20')];var _0x4af3d0=_0x36770a?0x0:_0x2eedc3['offset'];var _0x544417=_0x36770a?_0x5332cf[_0x1fbd('0x20')]:_0x2eedc3[_0x1fbd('0x1d')]+_0x2eedc3['limit'];var _0x135666;if(_0x544417>=_0x15e087){_0x544417=_0x15e087;_0x135666=0xc8;}else{_0x135666=0xce;}_0x553006[_0x1fbd('0x1c')](_0x135666);return _0x553006[_0x1fbd('0x21')]('Content-Range',_0x4af3d0+'-'+_0x544417+'/'+_0x15e087)[_0x1fbd('0x22')](_0x5332cf);}return null;};}function patchUpdates(_0x168a89){return function(_0x4c13ef){try{jsonpatch[_0x1fbd('0x23')](_0x4c13ef,_0x168a89,!![]);}catch(_0x2831e2){return BPromise[_0x1fbd('0x24')](_0x2831e2);}return _0x4c13ef[_0x1fbd('0x25')]();};}function saveUpdates(_0x553ba5,_0x5e91f0){return function(_0x5dda24){if(_0x5dda24){return _0x5dda24[_0x1fbd('0x26')](_0x553ba5)['then'](function(_0x2ae9){return _0x2ae9;});}return null;};}function removeEntity(_0x1ceddc,_0x2107be){return function(_0x59cac3){if(_0x59cac3){return _0x59cac3['destroy']()[_0x1fbd('0x27')](function(){var _0xb61a6f=_0x59cac3[_0x1fbd('0x28')]({'plain':!![]});var _0x566e5c=_0x1fbd('0x29');return db[_0x1fbd('0x2a')][_0x1fbd('0x2b')]({'where':{'type':_0x566e5c,'resourceId':_0xb61a6f['id']}})[_0x1fbd('0x27')](function(){return _0x59cac3;});})['then'](function(){_0x1ceddc[_0x1fbd('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf4ff70,_0x20fb54){return function(_0x1f9f2d){if(!_0x1f9f2d){_0xf4ff70['sendStatus'](0x194);}return _0x1f9f2d;};}function handleError(_0x40f018,_0x45e5df){_0x45e5df=_0x45e5df||0x1f4;return function(_0x24b274){logger[_0x1fbd('0x2c')](_0x24b274['stack']);if(_0x24b274[_0x1fbd('0x2d')]){delete _0x24b274[_0x1fbd('0x2d')];}_0x40f018[_0x1fbd('0x1c')](_0x45e5df)[_0x1fbd('0x2e')](_0x24b274);};}exports['index']=function(_0xd348ea,_0x578901){var _0x44d2fd={},_0x4b986b={},_0x1b616f={'count':0x0,'rows':[]};var _0x2a38b3=_[_0x1fbd('0x2f')](db[_0x1fbd('0x30')][_0x1fbd('0x31')],function(_0x4454f7){return{'name':_0x4454f7[_0x1fbd('0x32')],'type':_0x4454f7['type'][_0x1fbd('0x33')]};});_0x4b986b[_0x1fbd('0x34')]=_[_0x1fbd('0x2f')](_0x2a38b3,_0x1fbd('0x2d'));_0x4b986b['query']=_[_0x1fbd('0x35')](_0xd348ea[_0x1fbd('0x36')]);_0x4b986b[_0x1fbd('0x37')]=_[_0x1fbd('0x38')](_0x4b986b['model'],_0x4b986b[_0x1fbd('0x36')]);_0x44d2fd[_0x1fbd('0x39')]=_['intersection'](_0x4b986b[_0x1fbd('0x34')],qs[_0x1fbd('0x3a')](_0xd348ea[_0x1fbd('0x36')][_0x1fbd('0x3a')]));_0x44d2fd[_0x1fbd('0x39')]=_0x44d2fd['attributes'][_0x1fbd('0x3b')]?_0x44d2fd[_0x1fbd('0x39')]:_0x4b986b[_0x1fbd('0x34')];if(!_0xd348ea[_0x1fbd('0x36')][_0x1fbd('0x3c')](_0x1fbd('0x3d'))){_0x44d2fd[_0x1fbd('0x1f')]=qs[_0x1fbd('0x1f')](_0xd348ea[_0x1fbd('0x36')][_0x1fbd('0x1f')]);_0x44d2fd[_0x1fbd('0x1d')]=qs[_0x1fbd('0x1d')](_0xd348ea[_0x1fbd('0x36')][_0x1fbd('0x1d')]);}_0x44d2fd[_0x1fbd('0x3e')]=qs[_0x1fbd('0x3f')](_0xd348ea['query'][_0x1fbd('0x3f')]);delete _0xd348ea[_0x1fbd('0x36')][_0x1fbd('0x3f')];_0x44d2fd[_0x1fbd('0x40')]=qs[_0x1fbd('0x37')](_[_0x1fbd('0x41')](_0xd348ea[_0x1fbd('0x36')],_0x4b986b[_0x1fbd('0x37')]),_0x2a38b3);if(_0xd348ea[_0x1fbd('0x36')][_0x1fbd('0x42')]){_0x44d2fd[_0x1fbd('0x40')]=_[_0x1fbd('0x43')](_0x44d2fd['where'],{'$or':_['map'](_0x2a38b3,function(_0x28d7ad){if(_0x28d7ad[_0x1fbd('0x44')]!==_0x1fbd('0x45')){var _0x4a52ea={};_0x4a52ea[_0x28d7ad[_0x1fbd('0x2d')]]={'$like':'%'+_0xd348ea[_0x1fbd('0x36')]['filter']+'%'};return _0x4a52ea;}})});}_0x44d2fd=_[_0x1fbd('0x43')]({},_0x44d2fd,_0xd348ea[_0x1fbd('0x46')]);var _0x1f26da={'where':_0x44d2fd['where']};return db[_0x1fbd('0x30')][_0x1fbd('0x20')](_0x1f26da)['then'](function(_0xb8b936){_0x1b616f['count']=_0xb8b936;if(_0xd348ea['query'][_0x1fbd('0x47')]){_0x44d2fd[_0x1fbd('0x48')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x1fbd('0x49')](_0x44d2fd);})['then'](function(_0x2fc432){_0x1b616f[_0x1fbd('0x4a')]=_0x2fc432;return _0x1b616f;})[_0x1fbd('0x27')](respondWithFilteredResult(_0x578901,_0x44d2fd))['catch'](handleError(_0x578901,null));};exports['show']=function(_0xed1dc0,_0x45ec58){var _0xe3a654={'raw':![],'where':{'id':_0xed1dc0[_0x1fbd('0x4b')]['id']}},_0x56f16a={};_0x56f16a[_0x1fbd('0x34')]=_['keys'](db[_0x1fbd('0x30')][_0x1fbd('0x31')]);_0x56f16a[_0x1fbd('0x36')]=_['keys'](_0xed1dc0['query']);_0x56f16a[_0x1fbd('0x37')]=_['intersection'](_0x56f16a[_0x1fbd('0x34')],_0x56f16a[_0x1fbd('0x36')]);_0xe3a654[_0x1fbd('0x39')]=_[_0x1fbd('0x38')](_0x56f16a[_0x1fbd('0x34')],qs['fields'](_0xed1dc0[_0x1fbd('0x36')][_0x1fbd('0x3a')]));_0xe3a654[_0x1fbd('0x39')]=_0xe3a654['attributes'][_0x1fbd('0x3b')]?_0xe3a654[_0x1fbd('0x39')]:_0x56f16a[_0x1fbd('0x34')];if(_0xed1dc0[_0x1fbd('0x36')][_0x1fbd('0x47')]){_0xe3a654[_0x1fbd('0x48')]=[{'all':!![]}];}_0xe3a654=_['merge']({},_0xe3a654,_0xed1dc0[_0x1fbd('0x46')]);return db['VoiceMusicOnHold'][_0x1fbd('0x4c')](_0xe3a654)[_0x1fbd('0x27')](handleEntityNotFound(_0x45ec58,null))[_0x1fbd('0x27')](respondWithResult(_0x45ec58,null))[_0x1fbd('0x4d')](handleError(_0x45ec58,null));};exports['update']=function(_0x2e2647,_0x306dc0){if(_0x2e2647[_0x1fbd('0x4e')]['id']){delete _0x2e2647[_0x1fbd('0x4e')]['id'];}return db[_0x1fbd('0x30')][_0x1fbd('0x4c')]({'where':{'id':_0x2e2647['params']['id']}})[_0x1fbd('0x27')](handleEntityNotFound(_0x306dc0,null))[_0x1fbd('0x27')](saveUpdates(_0x2e2647[_0x1fbd('0x4e')],null))['then'](respondWithResult(_0x306dc0,null))[_0x1fbd('0x4d')](handleError(_0x306dc0,null));};exports[_0x1fbd('0x4f')]=function(_0x4c42e3,_0x16e1e7,_0x2f9768){return db[_0x1fbd('0x50')][_0x1fbd('0x51')](function(_0x1bd7c9){if(_0x4c42e3[_0x1fbd('0x4e')]['mode']===_0x1fbd('0x52')){_0x4c42e3[_0x1fbd('0x4e')][_0x1fbd('0x53')]=path[_0x1fbd('0x54')](config[_0x1fbd('0x55')],_0x1fbd('0x56'),_0x4c42e3['body'][_0x1fbd('0x2d')]);}return db['VoiceMusicOnHold'][_0x1fbd('0x4f')](_0x4c42e3[_0x1fbd('0x4e')],{'transaction':_0x1bd7c9})[_0x1fbd('0x27')](function(_0x3f19c9){if(_0x4c42e3[_0x1fbd('0x4e')][_0x1fbd('0x57')]===_0x1fbd('0x52')){fs[_0x1fbd('0x58')](_0x3f19c9[_0x1fbd('0x53')],parseInt('0777',0x8));}var _0x11f69c=_0x4c42e3['user'][_0x1fbd('0x28')]({'plain':!![]});if(!_0x11f69c)throw new Error(_0x1fbd('0x59'));if(_0x11f69c[_0x1fbd('0x5a')]==='user'){var _0x1fb0cc=_0x3f19c9[_0x1fbd('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x1fbd('0x4c')]({'where':{'name':_0x1fbd('0x29'),'userProfileId':_0x11f69c[_0x1fbd('0x5b')]},'raw':!![]})[_0x1fbd('0x27')](function(_0x2035fd){if(_0x2035fd&&_0x2035fd['autoAssociation']===0x0){return db[_0x1fbd('0x2a')][_0x1fbd('0x4f')]({'name':_0x1fb0cc[_0x1fbd('0x2d')],'resourceId':_0x1fb0cc['id'],'type':_0x2035fd['name'],'sectionId':_0x2035fd['id']},{})[_0x1fbd('0x27')](function(){return _0x3f19c9;});}else{return _0x3f19c9;}})['catch'](function(_0xde0951){logger[_0x1fbd('0x2c')](_0x1fbd('0x5c'),_0xde0951);});}return _0x3f19c9;});})['then'](respondWithResult(_0x16e1e7,0xc9))[_0x1fbd('0x4d')](handleError(_0x16e1e7,null));};exports[_0x1fbd('0x2b')]=function(_0x52d3ef,_0x19ea8a,_0x2607a5){var _0x4e73b3;return db['VoiceMusicOnHold'][_0x1fbd('0x4c')]({'where':{'id':_0x52d3ef[_0x1fbd('0x4b')]['id']}})['then'](function(_0x399b14){if(_0x399b14){return db[_0x1fbd('0x50')][_0x1fbd('0x51')](function(_0x4d536c){return _0x399b14[_0x1fbd('0x2b')]({'transaction':_0x4d536c,'raw':!![]})[_0x1fbd('0x27')](function(_0x6c55b5){if(_0x6c55b5[_0x1fbd('0x53')]){fs[_0x1fbd('0x5d')](_0x6c55b5['directory'])[_0x1fbd('0x5e')](function(_0x38bee2){fs[_0x1fbd('0x5f')](path[_0x1fbd('0x54')](_0x6c55b5[_0x1fbd('0x53')],_0x38bee2));});fs['rmdirSync'](_0x6c55b5[_0x1fbd('0x53')]);}return _0x6c55b5;});})[_0x1fbd('0x4d')](function(_0x5799ae){throw new db['Sequelize'][(_0x1fbd('0x60'))](_0x5799ae[_0x1fbd('0x61')]);});}})[_0x1fbd('0x27')](handleEntityNotFound(_0x19ea8a,null))[_0x1fbd('0x27')](removeEntity(_0x19ea8a,null))[_0x1fbd('0x4d')](handleError(_0x19ea8a,null));};exports[_0x1fbd('0x62')]=function(_0x1c3236,_0x3b0369,_0x422c6f){return db['sequelize'][_0x1fbd('0x51')](function(_0x5484ed){var _0x4c1ae8;return db['VoiceMusicOnHold'][_0x1fbd('0x4c')]({'where':{'id':_0x1c3236[_0x1fbd('0x4b')]['id']}})['then'](function(_0x1a8335){if(_0x1a8335){_0x4c1ae8=_0x1a8335;return _0x1a8335['addSound'](_0x1c3236[_0x1fbd('0x4e')]['id'],{'transaction':_0x5484ed});}})[_0x1fbd('0x27')](function(_0x495c2d){if(_0x495c2d){return db[_0x1fbd('0x63')]['findOne']({'where':{'id':_0x1c3236[_0x1fbd('0x4e')]['id']},'attributes':['id',_0x1fbd('0x2d'),'save_name','converted_format','createdAt'],'raw':!![]});}})[_0x1fbd('0x27')](function(_0x2f22cd){if(_0x2f22cd){var _0x275b5b=path[_0x1fbd('0x54')](config[_0x1fbd('0x55')],_0x1fbd('0x64'),util['format'](_0x1fbd('0x65'),path[_0x1fbd('0x66')](_0x2f22cd[_0x1fbd('0x67')],path['extname'](_0x2f22cd['save_name'])),_0x2f22cd['converted_format']));var _0x31ee5f=path[_0x1fbd('0x54')](config[_0x1fbd('0x55')],_0x1fbd('0x56'),_0x4c1ae8['name'],util[_0x1fbd('0x68')](_0x1fbd('0x65'),_0x2f22cd[_0x1fbd('0x2d')],_0x2f22cd[_0x1fbd('0x69')]));fs['symlinkSync'](_0x275b5b,_0x31ee5f);return _0x2f22cd;}})['catch'](function(_0x399f2d){throw new db[(_0x1fbd('0x6a'))][(_0x1fbd('0x60'))](_0x399f2d[_0x1fbd('0x61')]);});})[_0x1fbd('0x27')](handleEntityNotFound(_0x3b0369,null))[_0x1fbd('0x27')](respondWithResult(_0x3b0369,0xc9))[_0x1fbd('0x4d')](handleError(_0x3b0369,null));};exports[_0x1fbd('0x6b')]=function(_0x45e87b,_0x52e035,_0x26ee4e){return db[_0x1fbd('0x50')][_0x1fbd('0x51')](function(_0x312435){var _0x39f8b9;return db[_0x1fbd('0x30')][_0x1fbd('0x6c')]({'where':{'id':_0x45e87b[_0x1fbd('0x4b')]['id']}})[_0x1fbd('0x27')](handleEntityNotFound(_0x52e035,null))[_0x1fbd('0x27')](function(_0x3c1ae3){if(_0x3c1ae3){_0x39f8b9=_0x3c1ae3;return _0x3c1ae3['removeSound'](_0x45e87b[_0x1fbd('0x4b')][_0x1fbd('0x6d')]);}})[_0x1fbd('0x27')](function(_0x5dce8b){if(_0x5dce8b){return db[_0x1fbd('0x63')]['findOne']({'where':{'id':_0x45e87b[_0x1fbd('0x4b')]['id2']},'attributes':['id',_0x1fbd('0x2d'),_0x1fbd('0x67'),_0x1fbd('0x69'),_0x1fbd('0x6e')],'raw':!![]});}})[_0x1fbd('0x27')](function(_0x481c88){if(_0x481c88){fs[_0x1fbd('0x5f')](path['join'](_0x39f8b9[_0x1fbd('0x53')],util['format'](_0x1fbd('0x65'),_0x481c88[_0x1fbd('0x2d')],_0x481c88['converted_format'])));return _0x481c88;}})[_0x1fbd('0x4d')](function(_0x1d7f64){throw new db[(_0x1fbd('0x6a'))][(_0x1fbd('0x60'))](_0x1d7f64[_0x1fbd('0x61')]);});})[_0x1fbd('0x27')](handleEntityNotFound(_0x52e035,null))[_0x1fbd('0x27')](respondWithStatusCode(_0x52e035,0xcc))[_0x1fbd('0x4d')](handleError(_0x52e035,null));};exports[_0x1fbd('0x6f')]=function(_0x147076,_0x4fbd96,_0x52ba68){var _0x1dcd0f={};var _0x2f9b09={};var _0x1a1c82;var _0x27830b;return db['VoiceMusicOnHold'][_0x1fbd('0x6c')]({'where':{'id':_0x147076['params']['id']}})[_0x1fbd('0x27')](handleEntityNotFound(_0x4fbd96,null))[_0x1fbd('0x27')](function(_0x4a9ece){if(_0x4a9ece){_0x1a1c82=_0x4a9ece;_0x2f9b09[_0x1fbd('0x34')]=_[_0x1fbd('0x35')](db[_0x1fbd('0x63')][_0x1fbd('0x31')]);_0x2f9b09['query']=_[_0x1fbd('0x35')](_0x147076[_0x1fbd('0x36')]);_0x2f9b09['filters']=_[_0x1fbd('0x38')](_0x2f9b09[_0x1fbd('0x34')],_0x2f9b09[_0x1fbd('0x36')]);_0x1dcd0f[_0x1fbd('0x39')]=_['intersection'](_0x2f9b09[_0x1fbd('0x34')],qs[_0x1fbd('0x3a')](_0x147076['query'][_0x1fbd('0x3a')]));_0x1dcd0f['attributes']=_0x1dcd0f['attributes']['length']?_0x1dcd0f[_0x1fbd('0x39')]:_0x2f9b09[_0x1fbd('0x34')];_0x1dcd0f[_0x1fbd('0x3e')]=qs[_0x1fbd('0x3f')](_0x147076[_0x1fbd('0x36')]['sort']);_0x1dcd0f[_0x1fbd('0x40')]=qs['filters'](_[_0x1fbd('0x41')](_0x147076[_0x1fbd('0x36')],_0x2f9b09[_0x1fbd('0x37')]));if(_0x147076[_0x1fbd('0x36')][_0x1fbd('0x42')]){_0x1dcd0f[_0x1fbd('0x40')]=_[_0x1fbd('0x43')](_0x1dcd0f[_0x1fbd('0x40')],{'$or':_[_0x1fbd('0x2f')](_0x1dcd0f[_0x1fbd('0x39')],function(_0x123532){var _0x2d07ec={};_0x2d07ec[_0x123532]={'$like':'%'+_0x147076[_0x1fbd('0x36')][_0x1fbd('0x42')]+'%'};return _0x2d07ec;})});}_0x1dcd0f=_[_0x1fbd('0x43')]({},_0x1dcd0f,_0x147076['options']);return _0x1a1c82['getSounds'](_0x1dcd0f);}})[_0x1fbd('0x27')](function(_0x594b01){if(_0x594b01){_0x27830b=_0x594b01['length'];if(!_0x147076['query'][_0x1fbd('0x3c')](_0x1fbd('0x3d'))){_0x1dcd0f[_0x1fbd('0x1f')]=qs[_0x1fbd('0x1f')](_0x147076[_0x1fbd('0x36')][_0x1fbd('0x1f')]);_0x1dcd0f[_0x1fbd('0x1d')]=qs[_0x1fbd('0x1d')](_0x147076[_0x1fbd('0x36')][_0x1fbd('0x1d')]);}return _0x1a1c82[_0x1fbd('0x6f')](_0x1dcd0f);}})[_0x1fbd('0x27')](function(_0x99dc92){if(_0x99dc92){return _0x99dc92?{'count':_0x27830b,'rows':_0x99dc92}:null;}})['then'](respondWithResult(_0x4fbd96,null))[_0x1fbd('0x4d')](handleError(_0x4fbd96,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 576fea5..3e261d3 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 _0xe387=['define','VoiceMusicOnHold','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceMusicOnHold.attributes','exports'];(function(_0x1ae125,_0x20820a){var _0x1f3b2b=function(_0xe776de){while(--_0xe776de){_0x1ae125['push'](_0x1ae125['shift']());}};_0x1f3b2b(++_0x20820a);}(_0xe387,0x16a));var _0x7e38=function(_0x385d20,_0x28b55b){_0x385d20=_0x385d20-0x0;var _0x324b0d=_0xe387[_0x385d20];return _0x324b0d;};'use strict';var _=require('lodash');var util=require(_0x7e38('0x0'));var logger=require(_0x7e38('0x1'))(_0x7e38('0x2'));var moment=require(_0x7e38('0x3'));var BPromise=require(_0x7e38('0x4'));var rp=require(_0x7e38('0x5'));var fs=require('fs');var path=require(_0x7e38('0x6'));var rimraf=require(_0x7e38('0x7'));var config=require('../../config/environment');var attributes=require(_0x7e38('0x8'));module[_0x7e38('0x9')]=function(_0x2a5797,_0x4287f0){return _0x2a5797[_0x7e38('0xa')](_0x7e38('0xb'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd60e=['rimraf','../../config/environment','exports','define','voice_musiconhold','lodash','util','bluebird','path'];(function(_0x257a8d,_0x3a7ad6){var _0x840c00=function(_0x44da10){while(--_0x44da10){_0x257a8d['push'](_0x257a8d['shift']());}};_0x840c00(++_0x3a7ad6);}(_0xd60e,0xef));var _0xed60=function(_0x5ac4b1,_0x5a4b23){_0x5ac4b1=_0x5ac4b1-0x0;var _0x54694c=_0xd60e[_0x5ac4b1];return _0x54694c;};'use strict';var _=require(_0xed60('0x0'));var util=require(_0xed60('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xed60('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed60('0x3'));var rimraf=require(_0xed60('0x4'));var config=require(_0xed60('0x5'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xed60('0x6')]=function(_0x281c9d,_0x56f462){return _0x281c9d[_0xed60('0x7')]('VoiceMusicOnHold',attributes,{'tableName':_0xed60('0x8'),'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 9c36073..3905877 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 _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x283550,_0x57ad25){var _0x502c8f=function(_0x399488){while(--_0x399488){_0x283550['push'](_0x283550['shift']());}};_0x502c8f(++_0x57ad25);}(_0x70e0,0x17b));var _0x070e=function(_0x2eed47,_0x5717ed){_0x2eed47=_0x2eed47-0x0;var _0xaa3edd=_0x70e0[_0x2eed47];return _0xaa3edd;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x18d682,_0x203b08){var _0x9fecf=function(_0x15e5af){while(--_0x15e5af){_0x18d682['push'](_0x18d682['shift']());}};_0x9fecf(++_0x203b08);}(_0x70e0,0x17b));var _0x070e=function(_0x147f4c,_0x1f46e1){_0x147f4c=_0x147f4c-0x0;var _0x16ac2f=_0x70e0[_0x147f4c];return _0x16ac2f;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index d4de283..494b81c 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 _0x295f=['fs-extra','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','getTeams','create','post','addAgents','/:id/teams','addTeams','put','update','delete','destroy','removeAgents','removeTeams','util','path','connect-timeout','Router'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x295f,0x168));var _0xf295=function(_0x37301b,_0x1ada2f){_0x37301b=_0x37301b-0x0;var _0x36d761=_0x295f[_0x37301b];return _0x36d761;};'use strict';var multer=require('multer');var util=require(_0xf295('0x0'));var path=require(_0xf295('0x1'));var timeout=require(_0xf295('0x2'));var express=require('express');var router=express[_0xf295('0x3')]();var fs_extra=require(_0xf295('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf295('0x5'));var controller=require(_0xf295('0x6'));router[_0xf295('0x7')]('/',auth[_0xf295('0x8')](),controller[_0xf295('0x9')]);router['get'](_0xf295('0xa'),auth[_0xf295('0x8')](),controller[_0xf295('0xb')]);router[_0xf295('0x7')](_0xf295('0xc'),auth[_0xf295('0x8')](),controller[_0xf295('0xd')]);router[_0xf295('0x7')](_0xf295('0xe'),auth[_0xf295('0x8')](),controller[_0xf295('0xf')]);router[_0xf295('0x7')]('/:id/teams',auth[_0xf295('0x8')](),controller[_0xf295('0x10')]);router['post']('/',auth[_0xf295('0x8')](),controller[_0xf295('0x11')]);router[_0xf295('0x12')](_0xf295('0xe'),auth[_0xf295('0x8')](),controller[_0xf295('0x13')]);router[_0xf295('0x12')](_0xf295('0x14'),auth[_0xf295('0x8')](),controller[_0xf295('0x15')]);router[_0xf295('0x16')](_0xf295('0xc'),auth[_0xf295('0x8')](),controller[_0xf295('0x17')]);router[_0xf295('0x18')](_0xf295('0xc'),auth[_0xf295('0x8')](),controller[_0xf295('0x19')]);router['delete']('/:id/users',auth[_0xf295('0x8')](),controller[_0xf295('0x1a')]);router['delete'](_0xf295('0x14'),auth['isAuthenticated'](),controller[_0xf295('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xe94a=['/:id','show','/:id/users','getAgents','/:id/teams','create','addAgents','post','addTeams','update','destroy','removeTeams','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x15c655,_0xcacf6f){var _0x482e4e=function(_0x401580){while(--_0x401580){_0x15c655['push'](_0x15c655['shift']());}};_0x482e4e(++_0xcacf6f);}(_0xe94a,0x1c7));var _0xae94=function(_0x562faa,_0x23adc7){_0x562faa=_0x562faa-0x0;var _0xc70f59=_0xe94a[_0x562faa];return _0xc70f59;};'use strict';var multer=require(_0xae94('0x0'));var util=require(_0xae94('0x1'));var path=require(_0xae94('0x2'));var timeout=require('connect-timeout');var express=require(_0xae94('0x3'));var router=express[_0xae94('0x4')]();var fs_extra=require(_0xae94('0x5'));var auth=require(_0xae94('0x6'));var interaction=require(_0xae94('0x7'));var config=require(_0xae94('0x8'));var controller=require('./voicePrefix.controller');router[_0xae94('0x9')]('/',auth[_0xae94('0xa')](),controller[_0xae94('0xb')]);router[_0xae94('0x9')](_0xae94('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xae94('0x9')](_0xae94('0xd'),auth['isAuthenticated'](),controller[_0xae94('0xe')]);router[_0xae94('0x9')](_0xae94('0xf'),auth[_0xae94('0xa')](),controller[_0xae94('0x10')]);router[_0xae94('0x9')](_0xae94('0x11'),auth[_0xae94('0xa')](),controller['getTeams']);router['post']('/',auth[_0xae94('0xa')](),controller[_0xae94('0x12')]);router['post'](_0xae94('0xf'),auth['isAuthenticated'](),controller[_0xae94('0x13')]);router[_0xae94('0x14')](_0xae94('0x11'),auth[_0xae94('0xa')](),controller[_0xae94('0x15')]);router['put'](_0xae94('0xd'),auth[_0xae94('0xa')](),controller[_0xae94('0x16')]);router['delete'](_0xae94('0xd'),auth['isAuthenticated'](),controller[_0xae94('0x17')]);router['delete'](_0xae94('0xf'),auth[_0xae94('0xa')](),controller['removeAgents']);router['delete'](_0xae94('0x11'),auth[_0xae94('0xa')](),controller[_0xae94('0x18')]);module[_0xae94('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 10057fb..8479c15 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 _0x9cfb=['name','VIRTUAL','getDataValue','INTEGER','sequelize','exports','STRING'];(function(_0x123d71,_0x312053){var _0x335998=function(_0x1f0873){while(--_0x1f0873){_0x123d71['push'](_0x123d71['shift']());}};_0x335998(++_0x312053);}(_0x9cfb,0x7b));var _0xb9cf=function(_0x422fdb,_0x4c5713){_0x422fdb=_0x422fdb-0x0;var _0x5624ac=_0x9cfb[_0x422fdb];return _0x5624ac;};'use strict';var Sequelize=require(_0xb9cf('0x0'));module[_0xb9cf('0x1')]={'name':{'type':Sequelize[_0xb9cf('0x2')],'allowNull':![],'unique':_0xb9cf('0x3')},'prefix':{'type':Sequelize[_0xb9cf('0x4')],'get':function(_0x3d3926){return'system-'+this[_0xb9cf('0x5')](_0xb9cf('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xb9cf('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xb9cf('0x6')]}}; \ No newline at end of file +var _0xfb79=['exports','STRING','VIRTUAL','system-','name','INTEGER'];(function(_0x134de4,_0x49c839){var _0xe97f36=function(_0x2ffa31){while(--_0x2ffa31){_0x134de4['push'](_0x134de4['shift']());}};_0xe97f36(++_0x49c839);}(_0xfb79,0x102));var _0x9fb7=function(_0x5d96ec,_0x39248f){_0x5d96ec=_0x5d96ec-0x0;var _0x350f30=_0xfb79[_0x5d96ec];return _0x350f30;};'use strict';var Sequelize=require('sequelize');module[_0x9fb7('0x0')]={'name':{'type':Sequelize[_0x9fb7('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x9fb7('0x2')],'get':function(_0x29b008){return _0x9fb7('0x3')+this['getDataValue'](_0x9fb7('0x4'))+'-';}},'description':{'type':Sequelize[_0x9fb7('0x1')]},'callerIdAll':{'type':Sequelize[_0x9fb7('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x9fb7('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index a84abfe..c3bf69e 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 _0x5fdc=['fs-extra','lodash','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','VoicePrefix','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','includeAll','catch','show','include','options','find','params','describe','create','sequelize','transaction','body','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoiceExtension','VoicePrefixId','Extensions\x20creation\x20failed','push','callerIdAll','Set','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','system-','addAgents','ids','omit','spread','emit','removeAgents','isArray','getAgents','findOne','User','filter','getTeams','Team','findAll','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','Agents','select','field','tq.TeamId','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x5fdc,0x127));var _0xc5fd=function(_0x562bd0,_0x3844a4){_0x562bd0=_0x562bd0-0x0;var _0x57ecb1=_0x5fdc[_0x562bd0];return _0x57ecb1;};'use strict';var emlformat=require(_0xc5fd('0x0'));var rimraf=require(_0xc5fd('0x1'));var zipdir=require(_0xc5fd('0x2'));var jsonpatch=require(_0xc5fd('0x3'));var rp=require(_0xc5fd('0x4'));var moment=require(_0xc5fd('0x5'));var BPromise=require(_0xc5fd('0x6'));var Mustache=require(_0xc5fd('0x7'));var util=require(_0xc5fd('0x8'));var path=require(_0xc5fd('0x9'));var sox=require(_0xc5fd('0xa'));var csv=require(_0xc5fd('0xb'));var ejs=require(_0xc5fd('0xc'));var fs=require('fs');var fs_extra=require(_0xc5fd('0xd'));var _=require(_0xc5fd('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc5fd('0xf'));var toCsv=require(_0xc5fd('0xb'));var querystring=require(_0xc5fd('0x10'));var Papa=require(_0xc5fd('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc5fd('0x12'));var as=require(_0xc5fd('0x13'));var hardwareService=require(_0xc5fd('0x14'));var logger=require(_0xc5fd('0x15'))(_0xc5fd('0x16'));var utils=require(_0xc5fd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc5fd('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xc5fd('0x19')](config[_0xc5fd('0x1a')],{'host':_0xc5fd('0x1b'),'port':0x18eb});var socket=require(_0xc5fd('0x1c'))(new Redis(config[_0xc5fd('0x1a')]));require(_0xc5fd('0x1d'))[_0xc5fd('0x1e')](socket);function respondWithStatusCode(_0xa7a954,_0x51233a){_0x51233a=_0x51233a||0xcc;return function(_0x124651){if(_0x124651){return _0xa7a954[_0xc5fd('0x1f')](_0x51233a);}return _0xa7a954[_0xc5fd('0x20')](_0x51233a)[_0xc5fd('0x21')]();};}function respondWithResult(_0x4d3636,_0x4fd364){_0x4fd364=_0x4fd364||0xc8;return function(_0x4efafd){if(_0x4efafd){return _0x4d3636['status'](_0x4fd364)['json'](_0x4efafd);}};}function respondWithFilteredResult(_0x35a9d0,_0x430e52){return function(_0x27f611){if(_0x27f611){var _0xd0a9f1=typeof _0x430e52[_0xc5fd('0x22')]===_0xc5fd('0x23')&&typeof _0x430e52[_0xc5fd('0x24')]==='undefined';var _0xb7bab1=_0x27f611[_0xc5fd('0x25')];var _0x32eac2=_0xd0a9f1?0x0:_0x430e52[_0xc5fd('0x22')];var _0x3b3093=_0xd0a9f1?_0x27f611['count']:_0x430e52[_0xc5fd('0x22')]+_0x430e52[_0xc5fd('0x24')];var _0x18048e;if(_0x3b3093>=_0xb7bab1){_0x3b3093=_0xb7bab1;_0x18048e=0xc8;}else{_0x18048e=0xce;}_0x35a9d0[_0xc5fd('0x20')](_0x18048e);return _0x35a9d0['set']('Content-Range',_0x32eac2+'-'+_0x3b3093+'/'+_0xb7bab1)[_0xc5fd('0x26')](_0x27f611);}return null;};}function patchUpdates(_0x2ab935){return function(_0x3d7211){try{jsonpatch[_0xc5fd('0x27')](_0x3d7211,_0x2ab935,!![]);}catch(_0x334401){return BPromise[_0xc5fd('0x28')](_0x334401);}return _0x3d7211['save']();};}function saveUpdates(_0x1a3f21,_0x2701f7){return function(_0x1a5174){if(_0x1a5174){return _0x1a5174[_0xc5fd('0x29')](_0x1a3f21)[_0xc5fd('0x2a')](function(_0x4020af){return _0x4020af;});}return null;};}function removeEntity(_0x475b91,_0x527018){return function(_0x3a86f9){if(_0x3a86f9){return _0x3a86f9['destroy']()[_0xc5fd('0x2a')](function(){var _0x231368=_0x3a86f9[_0xc5fd('0x2b')]({'plain':!![]});var _0x2bee22='VoicePrefixes';return db[_0xc5fd('0x2c')][_0xc5fd('0x2d')]({'where':{'type':_0x2bee22,'resourceId':_0x231368['id']}})[_0xc5fd('0x2a')](function(){return _0x3a86f9;});})[_0xc5fd('0x2a')](function(){_0x475b91[_0xc5fd('0x20')](0xcc)[_0xc5fd('0x21')]();});}};}function handleEntityNotFound(_0x541c12,_0x412ef7){return function(_0x5d4f70){if(!_0x5d4f70){_0x541c12['sendStatus'](0x194);}return _0x5d4f70;};}function handleError(_0x12a962,_0x165ee2){_0x165ee2=_0x165ee2||0x1f4;return function(_0x39b21a){logger[_0xc5fd('0x2e')](_0x39b21a[_0xc5fd('0x2f')]);if(_0x39b21a[_0xc5fd('0x30')]){delete _0x39b21a[_0xc5fd('0x30')];}_0x12a962[_0xc5fd('0x20')](_0x165ee2)['send'](_0x39b21a);};}exports[_0xc5fd('0x31')]=function(_0x1b2957,_0x6bb14d){var _0x3b9699={},_0x14c832={},_0x40ed4d={'count':0x0,'rows':[]};var _0x3c0f64=_[_0xc5fd('0x32')](db[_0xc5fd('0x33')][_0xc5fd('0x34')],function(_0x104f37){return{'name':_0x104f37[_0xc5fd('0x35')],'type':_0x104f37['type'][_0xc5fd('0x36')]};});_0x14c832[_0xc5fd('0x37')]=_[_0xc5fd('0x32')](_0x3c0f64,_0xc5fd('0x30'));_0x14c832[_0xc5fd('0x38')]=_[_0xc5fd('0x39')](_0x1b2957[_0xc5fd('0x38')]);_0x14c832[_0xc5fd('0x3a')]=_[_0xc5fd('0x3b')](_0x14c832['model'],_0x14c832[_0xc5fd('0x38')]);_0x3b9699[_0xc5fd('0x3c')]=_[_0xc5fd('0x3b')](_0x14c832[_0xc5fd('0x37')],qs[_0xc5fd('0x3d')](_0x1b2957[_0xc5fd('0x38')][_0xc5fd('0x3d')]));_0x3b9699['attributes']=_0x3b9699[_0xc5fd('0x3c')][_0xc5fd('0x3e')]?_0x3b9699['attributes']:_0x14c832[_0xc5fd('0x37')];if(!_0x1b2957['query'][_0xc5fd('0x3f')](_0xc5fd('0x40'))){_0x3b9699[_0xc5fd('0x24')]=qs['limit'](_0x1b2957[_0xc5fd('0x38')][_0xc5fd('0x24')]);_0x3b9699['offset']=qs[_0xc5fd('0x22')](_0x1b2957[_0xc5fd('0x38')][_0xc5fd('0x22')]);}_0x3b9699[_0xc5fd('0x41')]=qs[_0xc5fd('0x42')](_0x1b2957[_0xc5fd('0x38')]['sort']);_0x3b9699[_0xc5fd('0x43')]=qs[_0xc5fd('0x3a')](_[_0xc5fd('0x44')](_0x1b2957[_0xc5fd('0x38')],_0x14c832['filters']),_0x3c0f64);if(_0x1b2957['query']['filter']){_0x3b9699[_0xc5fd('0x43')]=_[_0xc5fd('0x45')](_0x3b9699[_0xc5fd('0x43')],{'$or':_[_0xc5fd('0x32')](_0x3c0f64,function(_0x125c02){if(_0x125c02[_0xc5fd('0x46')]!==_0xc5fd('0x47')){var _0x2ef96f={};_0x2ef96f[_0x125c02[_0xc5fd('0x30')]]={'$like':'%'+_0x1b2957['query']['filter']+'%'};return _0x2ef96f;}})});}_0x3b9699=_[_0xc5fd('0x45')]({},_0x3b9699,_0x1b2957['options']);var _0x970623={'where':_0x3b9699[_0xc5fd('0x43')]};return db[_0xc5fd('0x33')]['count'](_0x970623)[_0xc5fd('0x2a')](function(_0x350753){_0x40ed4d['count']=_0x350753;if(_0x1b2957[_0xc5fd('0x38')][_0xc5fd('0x48')]){_0x3b9699['include']=[{'all':!![]}];}return db[_0xc5fd('0x33')]['findAll'](_0x3b9699);})[_0xc5fd('0x2a')](function(_0x17ce12){_0x40ed4d['rows']=_0x17ce12;return _0x40ed4d;})[_0xc5fd('0x2a')](respondWithFilteredResult(_0x6bb14d,_0x3b9699))[_0xc5fd('0x49')](handleError(_0x6bb14d,null));};exports[_0xc5fd('0x4a')]=function(_0x4825fa,_0x408edb){var _0x74a071={'raw':![],'where':{'id':_0x4825fa['params']['id']}},_0x559282={};_0x559282[_0xc5fd('0x37')]=_['keys'](db['VoicePrefix']['rawAttributes']);_0x559282[_0xc5fd('0x38')]=_[_0xc5fd('0x39')](_0x4825fa[_0xc5fd('0x38')]);_0x559282[_0xc5fd('0x3a')]=_[_0xc5fd('0x3b')](_0x559282[_0xc5fd('0x37')],_0x559282['query']);_0x74a071['attributes']=_['intersection'](_0x559282[_0xc5fd('0x37')],qs[_0xc5fd('0x3d')](_0x4825fa[_0xc5fd('0x38')]['fields']));_0x74a071[_0xc5fd('0x3c')]=_0x74a071['attributes'][_0xc5fd('0x3e')]?_0x74a071[_0xc5fd('0x3c')]:_0x559282[_0xc5fd('0x37')];if(_0x4825fa[_0xc5fd('0x38')][_0xc5fd('0x48')]){_0x74a071[_0xc5fd('0x4b')]=[{'all':!![]}];}_0x74a071=_['merge']({},_0x74a071,_0x4825fa[_0xc5fd('0x4c')]);return db[_0xc5fd('0x33')]['find'](_0x74a071)['then'](handleEntityNotFound(_0x408edb,null))[_0xc5fd('0x2a')](respondWithResult(_0x408edb,null))['catch'](handleError(_0x408edb,null));};exports['destroy']=function(_0x6e5626,_0x2436e9){return db['VoicePrefix'][_0xc5fd('0x4d')]({'where':{'id':_0x6e5626[_0xc5fd('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2436e9,null))[_0xc5fd('0x2a')](removeEntity(_0x2436e9,null))[_0xc5fd('0x49')](handleError(_0x2436e9,null));};exports[_0xc5fd('0x4f')]=function(_0x12b847,_0x1940e3){return db[_0xc5fd('0x33')][_0xc5fd('0x4f')]()[_0xc5fd('0x2a')](respondWithResult(_0x1940e3,null))[_0xc5fd('0x49')](handleError(_0x1940e3,null));};exports[_0xc5fd('0x50')]=function(_0x3e1471,_0x4c10a7){var _0x3c9b99;return db[_0xc5fd('0x51')][_0xc5fd('0x52')](function(_0x4989ce){return db[_0xc5fd('0x33')][_0xc5fd('0x50')](_0x3e1471[_0xc5fd('0x53')],{'transaction':_0x4989ce})[_0xc5fd('0x2a')](function(_0x5c7d68){_0x3c9b99=_0x5c7d68[_0xc5fd('0x2b')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x3c9b99[_0xc5fd('0x54')]},'raw':!![]})[_0xc5fd('0x2a')](function(_0x236d04){return createVoicePrefixExtensions(_0x3c9b99,_0x236d04,_0x4989ce);});});})[_0xc5fd('0x2a')](function(){var _0x275e18=_0x3e1471['user']['get']({'plain':!![]});if(!_0x275e18)throw new Error(_0xc5fd('0x55'));if(_0x275e18[_0xc5fd('0x56')]==='user'){var _0x4e9495=_0x3c9b99;return db['UserProfileSection'][_0xc5fd('0x4d')]({'where':{'name':'VoicePrefixes','userProfileId':_0x275e18[_0xc5fd('0x57')]},'raw':!![]})[_0xc5fd('0x2a')](function(_0x2503cd){if(_0x2503cd&&_0x2503cd[_0xc5fd('0x58')]===0x0){return db[_0xc5fd('0x2c')][_0xc5fd('0x50')]({'name':_0x4e9495[_0xc5fd('0x30')],'resourceId':_0x4e9495['id'],'type':_0x2503cd['name'],'sectionId':_0x2503cd['id']},{})[_0xc5fd('0x2a')](function(){return _0x3c9b99;});}else{return _0x3c9b99;}})[_0xc5fd('0x49')](function(_0x228e40){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x228e40);throw _0x228e40;});}return _0x3c9b99;})[_0xc5fd('0x2a')](respondWithResult(_0x4c10a7,null))[_0xc5fd('0x49')](handleError(_0x4c10a7,null));};function Extension(_0x2f30d6,_0x149483,_0x69367,_0x45f9fd){this[_0xc5fd('0x59')]=_0xc5fd('0x5a');this[_0xc5fd('0x5b')]=_0x2f30d6;this[_0xc5fd('0x5c')]=_0x69367;this[_0xc5fd('0x46')]=_0xc5fd('0x5d');this[_0xc5fd('0x5e')]=_0xc5fd('0x5f');this[_0xc5fd('0x60')]=_0x149483;this[_0xc5fd('0x61')]=_0x45f9fd;}function createVoicePrefixExtensions(_0x548b65,_0x404759,_0xc05f80){return new BPromise(function(_0x3eeae0,_0x53a3ee){var _0x32a240=new Extension(formatPrefixName(_0x548b65[_0xc5fd('0x62')]),0x1,_0xc5fd('0x63'),_0xc5fd('0x64'));_0x32a240['VoicePrefixId']=_0x548b65['id'];return db[_0xc5fd('0x65')][_0xc5fd('0x50')](_0x32a240,{'transaction':_0xc05f80})['then'](function(_0x27a1f5){var _0x53ea3d=_0x27a1f5[_0xc5fd('0x2b')]({'plain':!![]});var _0x70a6d=_[_0xc5fd('0x32')](addVoicePrefixExtensions(_0x548b65,_0x404759),function(_0xcaa6b0){_0xcaa6b0[_0xc5fd('0x54')]=_0x53ea3d['id'];_0xcaa6b0[_0xc5fd('0x66')]=_0x548b65['id'];return _0xcaa6b0;});return db['VoiceExtension']['bulkCreate'](_0x70a6d,{'transaction':_0xc05f80})[_0xc5fd('0x2a')](function(_0x1ff40b){if(!_0x1ff40b){return _0x53a3ee(_0xc5fd('0x67'));}else{return _0x3eeae0(_0x1ff40b);}})[_0xc5fd('0x49')](function(_0x27b533){return _0x53a3ee(_0x27b533);});});;});};function addVoicePrefixExtensions(_0x2f4b60,_0x189d7d){var _0x77a940=[];var _0x4d6f97=formatPrefixName(_0x2f4b60[_0xc5fd('0x62')]);_0x77a940[_0xc5fd('0x68')](new Extension(_0x4d6f97,0x2,'Set','CDR(prefix)='+_0x2f4b60[_0xc5fd('0x30')]));if(_0x2f4b60[_0xc5fd('0x69')]){_0x77a940[_0xc5fd('0x68')](new Extension(_0x4d6f97,0x3,_0xc5fd('0x6a'),_0xc5fd('0x6b')+_0x2f4b60[_0xc5fd('0x69')]));}else{_0x77a940[_0xc5fd('0x68')](new Extension(_0x4d6f97,0x3,_0xc5fd('0x63'),'No\x20callerid\x20available'));}_0x77a940[_0xc5fd('0x68')](new Extension(_0x4d6f97,0x4,_0xc5fd('0x6c'),_0x189d7d['context']+','+_0xc5fd('0x6d')+(0x8+_0x2f4b60[_0xc5fd('0x30')]['length'])+'}'+','+0x1));return _0x77a940;}function formatPrefixName(_0x4591be){var _0x2a8c7f='_';for(var _0x5e3f8=0x0;_0x5e3f8<_0x4591be[_0xc5fd('0x3e')];_0x5e3f8++){if(_0x4591be[_0xc5fd('0x6e')](_0x5e3f8)=='-'){_0x2a8c7f+=_0x4591be[_0xc5fd('0x6e')](_0x5e3f8);}else{_0x2a8c7f+='['+_0x4591be[_0xc5fd('0x6e')](_0x5e3f8)+']';}}_0x2a8c7f+='.';return _0x2a8c7f;}exports[_0xc5fd('0x29')]=function(_0x3d1940,_0x130b7b,_0x539c0a){var _0x5131ba=_0x3d1940[_0xc5fd('0x53')];_0x5131ba[_0xc5fd('0x62')]=_0xc5fd('0x6f')+_0x5131ba['name']+'-';return db[_0xc5fd('0x51')][_0xc5fd('0x52')](function(_0x2696be){return db['VoicePrefix'][_0xc5fd('0x29')](_0x5131ba,{'where':{'id':_0x5131ba['id']},'transaction':_0x2696be})[_0xc5fd('0x2a')](function(){return db[_0xc5fd('0x65')]['destroy']({'where':{'VoicePrefixId':_0x5131ba['id']},'transaction':_0x2696be})['then'](function(){return db[_0xc5fd('0x65')][_0xc5fd('0x4d')]({'where':{'id':_0x5131ba['VoiceExtensionId']},'raw':!![]})[_0xc5fd('0x2a')](function(_0x55d691){return createVoicePrefixExtensions(_0x5131ba,_0x55d691,_0x2696be);});});});})[_0xc5fd('0x2a')](function(){return db[_0xc5fd('0x33')]['findById'](_0x5131ba['id']);})['then'](respondWithResult(_0x130b7b,null))[_0xc5fd('0x49')](handleError(_0x130b7b,null));};exports[_0xc5fd('0x70')]=function(_0x39624c,_0x152212,_0x281cf9){return db[_0xc5fd('0x33')]['find']({'where':{'id':_0x39624c[_0xc5fd('0x4e')]['id']}})[_0xc5fd('0x2a')](handleEntityNotFound(_0x152212,null))[_0xc5fd('0x2a')](function(_0x24ecc2){if(_0x24ecc2){return _0x24ecc2[_0xc5fd('0x70')](_0x39624c[_0xc5fd('0x53')][_0xc5fd('0x71')],_[_0xc5fd('0x72')](_0x39624c[_0xc5fd('0x53')],['ids','id'])||{})[_0xc5fd('0x73')](function(_0x58ca76){for(var _0x151d13=0x0;_0x151d13<_0x39624c[_0xc5fd('0x53')][_0xc5fd('0x71')]['length'];_0x151d13+=0x1){socket[_0xc5fd('0x74')]('userVoicePrefix:save',{'UserId':Number(_0x39624c['body'][_0xc5fd('0x71')][_0x151d13]),'VoicePrefixId':Number(_0x39624c[_0xc5fd('0x4e')]['id'])});}return _0x58ca76;});}})[_0xc5fd('0x2a')](respondWithResult(_0x152212,null))[_0xc5fd('0x49')](handleError(_0x152212,null));};exports[_0xc5fd('0x75')]=function(_0x58df99,_0x4b43fc,_0x1ab84b){return db[_0xc5fd('0x33')][_0xc5fd('0x4d')]({'where':{'id':_0x58df99[_0xc5fd('0x4e')]['id']}})[_0xc5fd('0x2a')](handleEntityNotFound(_0x4b43fc,null))['then'](function(_0x3a89a9){if(_0x3a89a9){return _0x3a89a9[_0xc5fd('0x75')](_0x58df99[_0xc5fd('0x38')][_0xc5fd('0x71')])[_0xc5fd('0x2a')](function(){if(_[_0xc5fd('0x76')](_0x58df99[_0xc5fd('0x38')]['ids'])){for(var _0x9e84d2=0x0;_0x9e84d2<_0x58df99[_0xc5fd('0x38')][_0xc5fd('0x71')][_0xc5fd('0x3e')];_0x9e84d2+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x58df99['query'][_0xc5fd('0x71')][_0x9e84d2]),'VoicePrefixId':Number(_0x58df99[_0xc5fd('0x4e')]['id'])});}}else{socket[_0xc5fd('0x74')]('userVoicePrefix:remove',{'UserId':Number(_0x58df99[_0xc5fd('0x38')][_0xc5fd('0x71')]),'VoicePrefixId':Number(_0x58df99[_0xc5fd('0x4e')]['id'])});}});}})[_0xc5fd('0x2a')](respondWithStatusCode(_0x4b43fc,null))[_0xc5fd('0x49')](handleError(_0x4b43fc,null));};exports[_0xc5fd('0x77')]=function(_0x31fb3d,_0x5199f3,_0x32a6f3){var _0xe69dd8={};var _0x312b34={};var _0x38c97e;var _0x320249;return db[_0xc5fd('0x33')][_0xc5fd('0x78')]({'where':{'id':_0x31fb3d[_0xc5fd('0x4e')]['id']}})[_0xc5fd('0x2a')](handleEntityNotFound(_0x5199f3,null))[_0xc5fd('0x2a')](function(_0x4e67e7){if(_0x4e67e7){_0x38c97e=_0x4e67e7;_0x312b34[_0xc5fd('0x37')]=_[_0xc5fd('0x39')](db[_0xc5fd('0x79')][_0xc5fd('0x34')]);_0x312b34[_0xc5fd('0x38')]=_[_0xc5fd('0x39')](_0x31fb3d[_0xc5fd('0x38')]);_0x312b34['filters']=_[_0xc5fd('0x3b')](_0x312b34['model'],_0x312b34[_0xc5fd('0x38')]);_0xe69dd8[_0xc5fd('0x3c')]=_[_0xc5fd('0x3b')](_0x312b34[_0xc5fd('0x37')],qs[_0xc5fd('0x3d')](_0x31fb3d[_0xc5fd('0x38')]['fields']));_0xe69dd8[_0xc5fd('0x3c')]=_0xe69dd8['attributes'][_0xc5fd('0x3e')]?_0xe69dd8[_0xc5fd('0x3c')]:_0x312b34['model'];_0xe69dd8[_0xc5fd('0x41')]=qs[_0xc5fd('0x42')](_0x31fb3d[_0xc5fd('0x38')][_0xc5fd('0x42')]);_0xe69dd8[_0xc5fd('0x43')]=qs[_0xc5fd('0x3a')](_[_0xc5fd('0x44')](_0x31fb3d[_0xc5fd('0x38')],_0x312b34[_0xc5fd('0x3a')]));if(_0x31fb3d[_0xc5fd('0x38')][_0xc5fd('0x7a')]){_0xe69dd8[_0xc5fd('0x43')]=_['merge'](_0xe69dd8[_0xc5fd('0x43')],{'$or':_['map'](_0xe69dd8[_0xc5fd('0x3c')],function(_0xcab6e8){var _0x5951b4={};_0x5951b4[_0xcab6e8]={'$like':'%'+_0x31fb3d['query'][_0xc5fd('0x7a')]+'%'};return _0x5951b4;})});}_0xe69dd8=_['merge']({},_0xe69dd8,_0x31fb3d['options']);return _0x38c97e[_0xc5fd('0x77')](_0xe69dd8);}})[_0xc5fd('0x2a')](function(_0x58b8ce){if(_0x58b8ce){_0x320249=_0x58b8ce[_0xc5fd('0x3e')];if(!_0x31fb3d[_0xc5fd('0x38')]['hasOwnProperty'](_0xc5fd('0x40'))){_0xe69dd8[_0xc5fd('0x24')]=qs[_0xc5fd('0x24')](_0x31fb3d[_0xc5fd('0x38')][_0xc5fd('0x24')]);_0xe69dd8[_0xc5fd('0x22')]=qs[_0xc5fd('0x22')](_0x31fb3d[_0xc5fd('0x38')][_0xc5fd('0x22')]);}return _0x38c97e['getAgents'](_0xe69dd8);}})[_0xc5fd('0x2a')](function(_0x41d546){if(_0x41d546){return _0x41d546?{'count':_0x320249,'rows':_0x41d546}:null;}})[_0xc5fd('0x2a')](respondWithResult(_0x5199f3,null))[_0xc5fd('0x49')](handleError(_0x5199f3,null));};exports[_0xc5fd('0x7b')]=function(_0x3260de,_0x52f4a2,_0x3b04bb){var _0x54625d={};var _0x8cc5f6={};var _0x1f8bec;var _0x5cccd3;return db[_0xc5fd('0x33')][_0xc5fd('0x78')]({'where':{'id':_0x3260de['params']['id']}})['then'](handleEntityNotFound(_0x52f4a2,null))[_0xc5fd('0x2a')](function(_0x588469){if(_0x588469){_0x1f8bec=_0x588469;_0x8cc5f6[_0xc5fd('0x37')]=_[_0xc5fd('0x39')](db[_0xc5fd('0x7c')][_0xc5fd('0x34')]);_0x8cc5f6[_0xc5fd('0x38')]=_['keys'](_0x3260de[_0xc5fd('0x38')]);_0x8cc5f6[_0xc5fd('0x3a')]=_[_0xc5fd('0x3b')](_0x8cc5f6['model'],_0x8cc5f6[_0xc5fd('0x38')]);_0x54625d[_0xc5fd('0x3c')]=_['intersection'](_0x8cc5f6[_0xc5fd('0x37')],qs[_0xc5fd('0x3d')](_0x3260de['query'][_0xc5fd('0x3d')]));_0x54625d[_0xc5fd('0x3c')]=_0x54625d[_0xc5fd('0x3c')][_0xc5fd('0x3e')]?_0x54625d[_0xc5fd('0x3c')]:_0x8cc5f6[_0xc5fd('0x37')];_0x54625d['order']=qs[_0xc5fd('0x42')](_0x3260de[_0xc5fd('0x38')][_0xc5fd('0x42')]);_0x54625d[_0xc5fd('0x43')]=qs[_0xc5fd('0x3a')](_[_0xc5fd('0x44')](_0x3260de['query'],_0x8cc5f6[_0xc5fd('0x3a')]));if(_0x3260de[_0xc5fd('0x38')]['filter']){_0x54625d[_0xc5fd('0x43')]=_[_0xc5fd('0x45')](_0x54625d[_0xc5fd('0x43')],{'$or':_[_0xc5fd('0x32')](_0x54625d[_0xc5fd('0x3c')],function(_0x431e42){var _0x147657={};_0x147657[_0x431e42]={'$like':'%'+_0x3260de[_0xc5fd('0x38')][_0xc5fd('0x7a')]+'%'};return _0x147657;})});}_0x54625d=_[_0xc5fd('0x45')]({},_0x54625d,_0x3260de['options']);return _0x1f8bec[_0xc5fd('0x7b')](_0x54625d);}})[_0xc5fd('0x2a')](function(_0x815f86){if(_0x815f86){_0x5cccd3=_0x815f86[_0xc5fd('0x3e')];if(!_0x3260de[_0xc5fd('0x38')]['hasOwnProperty'](_0xc5fd('0x40'))){_0x54625d[_0xc5fd('0x24')]=qs[_0xc5fd('0x24')](_0x3260de[_0xc5fd('0x38')][_0xc5fd('0x24')]);_0x54625d[_0xc5fd('0x22')]=qs[_0xc5fd('0x22')](_0x3260de[_0xc5fd('0x38')][_0xc5fd('0x22')]);}return _0x1f8bec['getTeams'](_0x54625d);}})[_0xc5fd('0x2a')](function(_0x1e9c2c){if(_0x1e9c2c){return _0x1e9c2c?{'count':_0x5cccd3,'rows':_0x1e9c2c}:null;}})[_0xc5fd('0x2a')](respondWithResult(_0x52f4a2,null))[_0xc5fd('0x49')](handleError(_0x52f4a2,null));};exports['addTeams']=function(_0x1e5d78,_0x4bcd48,_0x5afaf5){var _0x5e0206=_0x1e5d78['body'][_0xc5fd('0x71')];var _0x5a3c8c;return db[_0xc5fd('0x7c')][_0xc5fd('0x7d')]({'where':{'id':_0x5e0206},'attributes':['id'],'include':[{'model':db[_0xc5fd('0x79')],'as':'Agents','attributes':['id',_0xc5fd('0x30'),'online','voicePause','interface'],'raw':!![]}]})[_0xc5fd('0x2a')](function(_0x1cb1a6){if(_0x1cb1a6){_0x5a3c8c=_0x1cb1a6;var _0x358648=_['flatMap'](_0x1cb1a6,function(_0x56a5d0){var _0x2bf91e=_0x56a5d0[_0xc5fd('0x2b')]({'plain':!![]});return _0x2bf91e['Agents'];});return db[_0xc5fd('0x33')][_0xc5fd('0x4d')]({'where':{'id':_0x1e5d78['params']['id']}})[_0xc5fd('0x2a')](function(_0x3c94ec){return db[_0xc5fd('0x51')][_0xc5fd('0x52')](function(_0x3bd95a){return _0x3c94ec[_0xc5fd('0x7e')](_0x5e0206,{'transaction':_0x3bd95a})[_0xc5fd('0x2a')](function(){return BPromise[_0xc5fd('0x7f')](_0x5a3c8c,function(_0x1e23e7){return db[_0xc5fd('0x80')][_0xc5fd('0x81')]({'TeamId':_0x1e23e7['id'],'VoicePrefixId':_0x1e5d78[_0xc5fd('0x4e')]['id']},{'transaction':_0x3bd95a});});})['then'](function(){return BPromise[_0xc5fd('0x7f')](_0x358648,function(_0x4c3fbb){return db[_0xc5fd('0x82')][_0xc5fd('0x83')]({'where':{'UserId':_0x4c3fbb['id'],'VoicePrefixId':_0x1e5d78[_0xc5fd('0x4e')]['id']},'transaction':_0x3bd95a});});})['then'](function(){_0x358648[_0xc5fd('0x84')](function(_0x5a438e){socket[_0xc5fd('0x74')](_0xc5fd('0x85'),{'UserId':_0x5a438e['id'],'VoicePrefixId':_0x3c94ec['id']});});});});});}})[_0xc5fd('0x2a')](respondWithStatusCode(_0x4bcd48,null))[_0xc5fd('0x49')](handleError(_0x4bcd48,null));};exports[_0xc5fd('0x86')]=function(_0x4065d9,_0xf709eb,_0x241693){return db[_0xc5fd('0x7c')][_0xc5fd('0x7d')]({'where':{'id':_0x4065d9[_0xc5fd('0x38')][_0xc5fd('0x71')]},'attributes':['id'],'include':[{'model':db[_0xc5fd('0x79')],'as':_0xc5fd('0x87'),'attributes':['id'],'raw':!![]}]})[_0xc5fd('0x2a')](handleEntityNotFound(_0xf709eb,null))[_0xc5fd('0x2a')](function(_0x2fb5f4){var _0x281c9e=_[_0xc5fd('0x32')](_0x2fb5f4,'id');var _0x5ca2a9=[];var _0x6594ae=[];var _0x1af269=squel[_0xc5fd('0x88')]();_0x1af269[_0xc5fd('0x89')](_0xc5fd('0x8a'))['from'](_0xc5fd('0x8b'),'tq')['join'](_0xc5fd('0x8c'),'ut',_0xc5fd('0x8d'))['where']('VoicePrefixId\x20=\x20?',_0x4065d9[_0xc5fd('0x4e')]['id']);for(var _0x4debb8=0x0;_0x4debb8<_0x2fb5f4[_0xc5fd('0x3e')];_0x4debb8+=0x1){let _0x474579=_0x2fb5f4[_0x4debb8];for(var _0x2ab188=0x0;_0x2ab188<_0x474579['Agents']['length'];_0x2ab188+=0x1){let _0x516a64=_0x474579[_0xc5fd('0x87')][_0x2ab188];var _0x41a3b6=_0x1af269[_0xc5fd('0x8e')]();_0x41a3b6[_0xc5fd('0x43')](_0xc5fd('0x8f'),_0x516a64['id']);_0x6594ae[_0xc5fd('0x68')](db[_0xc5fd('0x51')][_0xc5fd('0x38')](_0x41a3b6[_0xc5fd('0x90')](),{'type':db[_0xc5fd('0x51')][_0xc5fd('0x91')][_0xc5fd('0x92')]})[_0xc5fd('0x2a')](function(_0x492f78){if(_0x492f78[_0xc5fd('0x3e')]===0x1){return _0x516a64['id'];}else{var _0x12e1a8=_[_0xc5fd('0x93')](_[_0xc5fd('0x32')](_0x492f78,'TeamId'),function(_0x4751af){return _[_0xc5fd('0x94')](_0x281c9e,_0x4751af);});if(_0x12e1a8){return _0x516a64['id'];}}}));}}return BPromise[_0xc5fd('0x95')](_0x6594ae)[_0xc5fd('0x2a')](function(_0x2917b5){_0x5ca2a9=_(_0x5ca2a9)[_0xc5fd('0x96')](_0x2917b5)[_0xc5fd('0x97')]()[_0xc5fd('0x98')]();return db[_0xc5fd('0x33')][_0xc5fd('0x4d')]({'where':{'id':_0x4065d9['params']['id']}})[_0xc5fd('0x2a')](function(_0x21526e){return db[_0xc5fd('0x51')][_0xc5fd('0x52')](function(_0x2456d8){return _0x21526e['removeTeams'](_0x4065d9[_0xc5fd('0x38')][_0xc5fd('0x71')],{'transaction':_0x2456d8})['then'](function(){if(!_[_0xc5fd('0x99')](_0x5ca2a9)){return _0x21526e['removeAgents'](_0x5ca2a9,{'transaction':_0x2456d8});}})[_0xc5fd('0x2a')](function(){_0x5ca2a9['forEach'](function(_0x233398){socket[_0xc5fd('0x74')]('userVoicePrefix:remove',{'UserId':_0x233398,'VoicePrefixId':_0x21526e['id']});});});});});});})['then'](respondWithStatusCode(_0xf709eb,null))['catch'](handleError(_0xf709eb,null));}; \ No newline at end of file +var _0x373d=['team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./voicePrefix.socket','register','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','describe','create','sequelize','transaction','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','addAgents','omit','ids','spread','emit','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','addTeams','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','userVoicePrefix:save','field','tq.TeamId','from'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x373d,0x1e2));var _0xd373=function(_0x12f1c0,_0x57cc1f){_0x12f1c0=_0x12f1c0-0x0;var _0x56c50e=_0x373d[_0x12f1c0];return _0x56c50e;};'use strict';var emlformat=require(_0xd373('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd373('0x1'));var jsonpatch=require(_0xd373('0x2'));var rp=require(_0xd373('0x3'));var moment=require(_0xd373('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd373('0x5'));var util=require(_0xd373('0x6'));var path=require(_0xd373('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd373('0x8'));var fs=require('fs');var fs_extra=require(_0xd373('0x9'));var _=require(_0xd373('0xa'));var squel=require(_0xd373('0xb'));var crypto=require('crypto');var jsforce=require(_0xd373('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd373('0xd'));var Redis=require(_0xd373('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd373('0xf'));var as=require(_0xd373('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd373('0x11'));var utils=require(_0xd373('0x12'));var config=require(_0xd373('0x13'));var licenseUtil=require(_0xd373('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xd373('0x15')],{'host':_0xd373('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd373('0x15')]));require(_0xd373('0x17'))[_0xd373('0x18')](socket);function respondWithStatusCode(_0x23ed86,_0x28b2bf){_0x28b2bf=_0x28b2bf||0xcc;return function(_0x1a9df9){if(_0x1a9df9){return _0x23ed86[_0xd373('0x19')](_0x28b2bf);}return _0x23ed86[_0xd373('0x1a')](_0x28b2bf)[_0xd373('0x1b')]();};}function respondWithResult(_0x2c5854,_0x3a5316){_0x3a5316=_0x3a5316||0xc8;return function(_0x263ae3){if(_0x263ae3){return _0x2c5854[_0xd373('0x1a')](_0x3a5316)['json'](_0x263ae3);}};}function respondWithFilteredResult(_0x1e26cf,_0x5eab00){return function(_0x460259){if(_0x460259){var _0x36d47a=typeof _0x5eab00['offset']===_0xd373('0x1c')&&typeof _0x5eab00['limit']==='undefined';var _0x23fada=_0x460259[_0xd373('0x1d')];var _0x167597=_0x36d47a?0x0:_0x5eab00[_0xd373('0x1e')];var _0x16b147=_0x36d47a?_0x460259[_0xd373('0x1d')]:_0x5eab00['offset']+_0x5eab00[_0xd373('0x1f')];var _0xd808f8;if(_0x16b147>=_0x23fada){_0x16b147=_0x23fada;_0xd808f8=0xc8;}else{_0xd808f8=0xce;}_0x1e26cf[_0xd373('0x1a')](_0xd808f8);return _0x1e26cf[_0xd373('0x20')](_0xd373('0x21'),_0x167597+'-'+_0x16b147+'/'+_0x23fada)[_0xd373('0x22')](_0x460259);}return null;};}function patchUpdates(_0x4f64bd){return function(_0x355fca){try{jsonpatch[_0xd373('0x23')](_0x355fca,_0x4f64bd,!![]);}catch(_0x157f81){return BPromise[_0xd373('0x24')](_0x157f81);}return _0x355fca[_0xd373('0x25')]();};}function saveUpdates(_0x238ffd,_0x466a03){return function(_0x109e4c){if(_0x109e4c){return _0x109e4c[_0xd373('0x26')](_0x238ffd)[_0xd373('0x27')](function(_0x437110){return _0x437110;});}return null;};}function removeEntity(_0x34f05a,_0x388182){return function(_0x420a30){if(_0x420a30){return _0x420a30[_0xd373('0x28')]()[_0xd373('0x27')](function(){var _0x50b987=_0x420a30[_0xd373('0x29')]({'plain':!![]});var _0x3e657b=_0xd373('0x2a');return db[_0xd373('0x2b')][_0xd373('0x28')]({'where':{'type':_0x3e657b,'resourceId':_0x50b987['id']}})[_0xd373('0x27')](function(){return _0x420a30;});})[_0xd373('0x27')](function(){_0x34f05a[_0xd373('0x1a')](0xcc)[_0xd373('0x1b')]();});}};}function handleEntityNotFound(_0x158825,_0xbc420b){return function(_0x2ee37c){if(!_0x2ee37c){_0x158825[_0xd373('0x19')](0x194);}return _0x2ee37c;};}function handleError(_0x5287e7,_0x7ca56e){_0x7ca56e=_0x7ca56e||0x1f4;return function(_0x490842){logger['error'](_0x490842[_0xd373('0x2c')]);if(_0x490842[_0xd373('0x2d')]){delete _0x490842[_0xd373('0x2d')];}_0x5287e7[_0xd373('0x1a')](_0x7ca56e)[_0xd373('0x2e')](_0x490842);};}exports['index']=function(_0x6659f6,_0x104156){var _0x4e17c9={},_0x102c3a={},_0x8e4884={'count':0x0,'rows':[]};var _0x146e24=_[_0xd373('0x2f')](db[_0xd373('0x30')][_0xd373('0x31')],function(_0x364c01){return{'name':_0x364c01[_0xd373('0x32')],'type':_0x364c01[_0xd373('0x33')]['key']};});_0x102c3a[_0xd373('0x34')]=_[_0xd373('0x2f')](_0x146e24,_0xd373('0x2d'));_0x102c3a[_0xd373('0x35')]=_[_0xd373('0x36')](_0x6659f6[_0xd373('0x35')]);_0x102c3a[_0xd373('0x37')]=_[_0xd373('0x38')](_0x102c3a[_0xd373('0x34')],_0x102c3a[_0xd373('0x35')]);_0x4e17c9[_0xd373('0x39')]=_[_0xd373('0x38')](_0x102c3a[_0xd373('0x34')],qs[_0xd373('0x3a')](_0x6659f6[_0xd373('0x35')]['fields']));_0x4e17c9[_0xd373('0x39')]=_0x4e17c9[_0xd373('0x39')][_0xd373('0x3b')]?_0x4e17c9[_0xd373('0x39')]:_0x102c3a['model'];if(!_0x6659f6[_0xd373('0x35')][_0xd373('0x3c')](_0xd373('0x3d'))){_0x4e17c9[_0xd373('0x1f')]=qs[_0xd373('0x1f')](_0x6659f6[_0xd373('0x35')]['limit']);_0x4e17c9['offset']=qs[_0xd373('0x1e')](_0x6659f6['query'][_0xd373('0x1e')]);}_0x4e17c9[_0xd373('0x3e')]=qs[_0xd373('0x3f')](_0x6659f6['query'][_0xd373('0x3f')]);_0x4e17c9[_0xd373('0x40')]=qs[_0xd373('0x37')](_[_0xd373('0x41')](_0x6659f6['query'],_0x102c3a['filters']),_0x146e24);if(_0x6659f6['query'][_0xd373('0x42')]){_0x4e17c9['where']=_[_0xd373('0x43')](_0x4e17c9[_0xd373('0x40')],{'$or':_['map'](_0x146e24,function(_0x4e8734){if(_0x4e8734['type']!==_0xd373('0x44')){var _0x43a4b8={};_0x43a4b8[_0x4e8734[_0xd373('0x2d')]]={'$like':'%'+_0x6659f6['query']['filter']+'%'};return _0x43a4b8;}})});}_0x4e17c9=_[_0xd373('0x43')]({},_0x4e17c9,_0x6659f6[_0xd373('0x45')]);var _0x51efee={'where':_0x4e17c9[_0xd373('0x40')]};return db[_0xd373('0x30')][_0xd373('0x1d')](_0x51efee)[_0xd373('0x27')](function(_0x2d8c7d){_0x8e4884['count']=_0x2d8c7d;if(_0x6659f6['query'][_0xd373('0x46')]){_0x4e17c9[_0xd373('0x47')]=[{'all':!![]}];}return db[_0xd373('0x30')][_0xd373('0x48')](_0x4e17c9);})['then'](function(_0x29725c){_0x8e4884['rows']=_0x29725c;return _0x8e4884;})[_0xd373('0x27')](respondWithFilteredResult(_0x104156,_0x4e17c9))[_0xd373('0x49')](handleError(_0x104156,null));};exports[_0xd373('0x4a')]=function(_0xfb2922,_0x15cd1f){var _0x54afd4={'raw':![],'where':{'id':_0xfb2922[_0xd373('0x4b')]['id']}},_0x42744d={};_0x42744d['model']=_[_0xd373('0x36')](db[_0xd373('0x30')][_0xd373('0x31')]);_0x42744d[_0xd373('0x35')]=_[_0xd373('0x36')](_0xfb2922[_0xd373('0x35')]);_0x42744d[_0xd373('0x37')]=_[_0xd373('0x38')](_0x42744d[_0xd373('0x34')],_0x42744d[_0xd373('0x35')]);_0x54afd4['attributes']=_['intersection'](_0x42744d[_0xd373('0x34')],qs['fields'](_0xfb2922[_0xd373('0x35')]['fields']));_0x54afd4['attributes']=_0x54afd4['attributes'][_0xd373('0x3b')]?_0x54afd4[_0xd373('0x39')]:_0x42744d[_0xd373('0x34')];if(_0xfb2922[_0xd373('0x35')][_0xd373('0x46')]){_0x54afd4[_0xd373('0x47')]=[{'all':!![]}];}_0x54afd4=_[_0xd373('0x43')]({},_0x54afd4,_0xfb2922['options']);return db[_0xd373('0x30')]['find'](_0x54afd4)[_0xd373('0x27')](handleEntityNotFound(_0x15cd1f,null))[_0xd373('0x27')](respondWithResult(_0x15cd1f,null))['catch'](handleError(_0x15cd1f,null));};exports[_0xd373('0x28')]=function(_0x5ca39c,_0x46a582){return db[_0xd373('0x30')][_0xd373('0x4c')]({'where':{'id':_0x5ca39c[_0xd373('0x4b')]['id']}})[_0xd373('0x27')](handleEntityNotFound(_0x46a582,null))['then'](removeEntity(_0x46a582,null))['catch'](handleError(_0x46a582,null));};exports['describe']=function(_0x3a2192,_0x384e23){return db['VoicePrefix'][_0xd373('0x4d')]()[_0xd373('0x27')](respondWithResult(_0x384e23,null))['catch'](handleError(_0x384e23,null));};exports[_0xd373('0x4e')]=function(_0xb6b583,_0x102101){var _0x473af2;return db[_0xd373('0x4f')][_0xd373('0x50')](function(_0xc255ec){return db[_0xd373('0x30')][_0xd373('0x4e')](_0xb6b583[_0xd373('0x51')],{'transaction':_0xc255ec})[_0xd373('0x27')](function(_0x5b88ea){_0x473af2=_0x5b88ea['get']({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x473af2['VoiceExtensionId']},'raw':!![]})['then'](function(_0x409246){return createVoicePrefixExtensions(_0x473af2,_0x409246,_0xc255ec);});});})[_0xd373('0x27')](function(){var _0x5b2ae9=_0xb6b583['user']['get']({'plain':!![]});if(!_0x5b2ae9)throw new Error(_0xd373('0x52'));if(_0x5b2ae9[_0xd373('0x53')]==='user'){var _0x52fa5b=_0x473af2;return db[_0xd373('0x54')][_0xd373('0x4c')]({'where':{'name':_0xd373('0x2a'),'userProfileId':_0x5b2ae9[_0xd373('0x55')]},'raw':!![]})[_0xd373('0x27')](function(_0x59da03){if(_0x59da03&&_0x59da03[_0xd373('0x56')]===0x0){return db[_0xd373('0x2b')][_0xd373('0x4e')]({'name':_0x52fa5b[_0xd373('0x2d')],'resourceId':_0x52fa5b['id'],'type':_0x59da03[_0xd373('0x2d')],'sectionId':_0x59da03['id']},{})[_0xd373('0x27')](function(){return _0x473af2;});}else{return _0x473af2;}})[_0xd373('0x49')](function(_0x2e4298){logger[_0xd373('0x57')](_0xd373('0x58'),_0x2e4298);throw _0x2e4298;});}return _0x473af2;})[_0xd373('0x27')](respondWithResult(_0x102101,null))[_0xd373('0x49')](handleError(_0x102101,null));};function Extension(_0x213b3c,_0x42e45d,_0x13f139,_0x4cb143){this[_0xd373('0x59')]=_0xd373('0x5a');this[_0xd373('0x5b')]=_0x213b3c;this['app']=_0x13f139;this[_0xd373('0x33')]='system';this[_0xd373('0x5c')]='Voice\x20Prefix\x20Extension';this[_0xd373('0x5d')]=_0x42e45d;this[_0xd373('0x5e')]=_0x4cb143;}function createVoicePrefixExtensions(_0x427f68,_0x19924a,_0x41c327){return new BPromise(function(_0x1ac620,_0xa47b76){var _0xaaf7fa=new Extension(formatPrefixName(_0x427f68[_0xd373('0x5f')]),0x1,_0xd373('0x60'),_0xd373('0x61'));_0xaaf7fa[_0xd373('0x62')]=_0x427f68['id'];return db[_0xd373('0x63')][_0xd373('0x4e')](_0xaaf7fa,{'transaction':_0x41c327})[_0xd373('0x27')](function(_0x2e7edb){var _0x1379e5=_0x2e7edb[_0xd373('0x29')]({'plain':!![]});var _0x209e76=_[_0xd373('0x2f')](addVoicePrefixExtensions(_0x427f68,_0x19924a),function(_0x295e09){_0x295e09[_0xd373('0x64')]=_0x1379e5['id'];_0x295e09[_0xd373('0x62')]=_0x427f68['id'];return _0x295e09;});return db[_0xd373('0x63')][_0xd373('0x65')](_0x209e76,{'transaction':_0x41c327})[_0xd373('0x27')](function(_0x547a8a){if(!_0x547a8a){return _0xa47b76(_0xd373('0x66'));}else{return _0x1ac620(_0x547a8a);}})[_0xd373('0x49')](function(_0x5fdc16){return _0xa47b76(_0x5fdc16);});});;});};function addVoicePrefixExtensions(_0x4a7d01,_0x38068a){var _0x2d9019=[];var _0x33320c=formatPrefixName(_0x4a7d01[_0xd373('0x5f')]);_0x2d9019[_0xd373('0x67')](new Extension(_0x33320c,0x2,_0xd373('0x68'),_0xd373('0x69')+_0x4a7d01['name']));if(_0x4a7d01[_0xd373('0x6a')]){_0x2d9019[_0xd373('0x67')](new Extension(_0x33320c,0x3,_0xd373('0x68'),_0xd373('0x6b')+_0x4a7d01[_0xd373('0x6a')]));}else{_0x2d9019[_0xd373('0x67')](new Extension(_0x33320c,0x3,_0xd373('0x60'),_0xd373('0x6c')));}_0x2d9019['push'](new Extension(_0x33320c,0x4,_0xd373('0x6d'),_0x38068a['context']+','+_0xd373('0x6e')+(0x8+_0x4a7d01[_0xd373('0x2d')][_0xd373('0x3b')])+'}'+','+0x1));return _0x2d9019;}function formatPrefixName(_0x2a9582){var _0x36e7cc='_';for(var _0x32c044=0x0;_0x32c044<_0x2a9582[_0xd373('0x3b')];_0x32c044++){if(_0x2a9582[_0xd373('0x6f')](_0x32c044)=='-'){_0x36e7cc+=_0x2a9582['charAt'](_0x32c044);}else{_0x36e7cc+='['+_0x2a9582[_0xd373('0x6f')](_0x32c044)+']';}}_0x36e7cc+='.';return _0x36e7cc;}exports['update']=function(_0x40f5ad,_0x27fcbe,_0x310a65){var _0x3ce679=_0x40f5ad[_0xd373('0x51')];_0x3ce679[_0xd373('0x5f')]=_0xd373('0x70')+_0x3ce679['name']+'-';return db[_0xd373('0x4f')][_0xd373('0x50')](function(_0x3d375d){return db['VoicePrefix'][_0xd373('0x26')](_0x3ce679,{'where':{'id':_0x3ce679['id']},'transaction':_0x3d375d})[_0xd373('0x27')](function(){return db[_0xd373('0x63')][_0xd373('0x28')]({'where':{'VoicePrefixId':_0x3ce679['id']},'transaction':_0x3d375d})[_0xd373('0x27')](function(){return db[_0xd373('0x63')][_0xd373('0x4c')]({'where':{'id':_0x3ce679[_0xd373('0x64')]},'raw':!![]})[_0xd373('0x27')](function(_0x727541){return createVoicePrefixExtensions(_0x3ce679,_0x727541,_0x3d375d);});});});})[_0xd373('0x27')](function(){return db[_0xd373('0x30')]['findById'](_0x3ce679['id']);})[_0xd373('0x27')](respondWithResult(_0x27fcbe,null))[_0xd373('0x49')](handleError(_0x27fcbe,null));};exports[_0xd373('0x71')]=function(_0x506f49,_0x377147,_0x365028){return db[_0xd373('0x30')]['find']({'where':{'id':_0x506f49[_0xd373('0x4b')]['id']}})['then'](handleEntityNotFound(_0x377147,null))[_0xd373('0x27')](function(_0x26821a){if(_0x26821a){return _0x26821a[_0xd373('0x71')](_0x506f49[_0xd373('0x51')]['ids'],_[_0xd373('0x72')](_0x506f49['body'],[_0xd373('0x73'),'id'])||{})[_0xd373('0x74')](function(_0x140ec4){for(var _0xb658db=0x0;_0xb658db<_0x506f49[_0xd373('0x51')][_0xd373('0x73')]['length'];_0xb658db+=0x1){socket[_0xd373('0x75')]('userVoicePrefix:save',{'UserId':Number(_0x506f49[_0xd373('0x51')]['ids'][_0xb658db]),'VoicePrefixId':Number(_0x506f49['params']['id'])});}return _0x140ec4;});}})[_0xd373('0x27')](respondWithResult(_0x377147,null))[_0xd373('0x49')](handleError(_0x377147,null));};exports[_0xd373('0x76')]=function(_0x32b739,_0x5a5651,_0x546a07){return db[_0xd373('0x30')][_0xd373('0x4c')]({'where':{'id':_0x32b739[_0xd373('0x4b')]['id']}})[_0xd373('0x27')](handleEntityNotFound(_0x5a5651,null))[_0xd373('0x27')](function(_0x1a30eb){if(_0x1a30eb){return _0x1a30eb[_0xd373('0x76')](_0x32b739[_0xd373('0x35')][_0xd373('0x73')])[_0xd373('0x27')](function(){if(_['isArray'](_0x32b739[_0xd373('0x35')][_0xd373('0x73')])){for(var _0x1576e5=0x0;_0x1576e5<_0x32b739[_0xd373('0x35')][_0xd373('0x73')][_0xd373('0x3b')];_0x1576e5+=0x1){socket[_0xd373('0x75')]('userVoicePrefix:remove',{'UserId':Number(_0x32b739[_0xd373('0x35')]['ids'][_0x1576e5]),'VoicePrefixId':Number(_0x32b739['params']['id'])});}}else{socket[_0xd373('0x75')](_0xd373('0x77'),{'UserId':Number(_0x32b739[_0xd373('0x35')][_0xd373('0x73')]),'VoicePrefixId':Number(_0x32b739[_0xd373('0x4b')]['id'])});}});}})[_0xd373('0x27')](respondWithStatusCode(_0x5a5651,null))['catch'](handleError(_0x5a5651,null));};exports[_0xd373('0x78')]=function(_0x19eb94,_0x6114a5,_0x52ab87){var _0x467ac8={};var _0x2c543a={};var _0x1a5666;var _0x47ae4c;return db[_0xd373('0x30')][_0xd373('0x79')]({'where':{'id':_0x19eb94[_0xd373('0x4b')]['id']}})['then'](handleEntityNotFound(_0x6114a5,null))[_0xd373('0x27')](function(_0x288295){if(_0x288295){_0x1a5666=_0x288295;_0x2c543a[_0xd373('0x34')]=_[_0xd373('0x36')](db[_0xd373('0x7a')][_0xd373('0x31')]);_0x2c543a[_0xd373('0x35')]=_[_0xd373('0x36')](_0x19eb94[_0xd373('0x35')]);_0x2c543a[_0xd373('0x37')]=_[_0xd373('0x38')](_0x2c543a[_0xd373('0x34')],_0x2c543a[_0xd373('0x35')]);_0x467ac8['attributes']=_[_0xd373('0x38')](_0x2c543a[_0xd373('0x34')],qs[_0xd373('0x3a')](_0x19eb94['query'][_0xd373('0x3a')]));_0x467ac8[_0xd373('0x39')]=_0x467ac8['attributes'][_0xd373('0x3b')]?_0x467ac8['attributes']:_0x2c543a[_0xd373('0x34')];_0x467ac8[_0xd373('0x3e')]=qs[_0xd373('0x3f')](_0x19eb94[_0xd373('0x35')][_0xd373('0x3f')]);_0x467ac8[_0xd373('0x40')]=qs['filters'](_[_0xd373('0x41')](_0x19eb94['query'],_0x2c543a[_0xd373('0x37')]));if(_0x19eb94[_0xd373('0x35')][_0xd373('0x42')]){_0x467ac8[_0xd373('0x40')]=_[_0xd373('0x43')](_0x467ac8['where'],{'$or':_[_0xd373('0x2f')](_0x467ac8[_0xd373('0x39')],function(_0x232b78){var _0x12ffc0={};_0x12ffc0[_0x232b78]={'$like':'%'+_0x19eb94[_0xd373('0x35')][_0xd373('0x42')]+'%'};return _0x12ffc0;})});}_0x467ac8=_['merge']({},_0x467ac8,_0x19eb94[_0xd373('0x45')]);return _0x1a5666[_0xd373('0x78')](_0x467ac8);}})[_0xd373('0x27')](function(_0x4b32b6){if(_0x4b32b6){_0x47ae4c=_0x4b32b6[_0xd373('0x3b')];if(!_0x19eb94[_0xd373('0x35')]['hasOwnProperty'](_0xd373('0x3d'))){_0x467ac8['limit']=qs[_0xd373('0x1f')](_0x19eb94['query']['limit']);_0x467ac8[_0xd373('0x1e')]=qs[_0xd373('0x1e')](_0x19eb94[_0xd373('0x35')][_0xd373('0x1e')]);}return _0x1a5666[_0xd373('0x78')](_0x467ac8);}})['then'](function(_0x3ae4c8){if(_0x3ae4c8){return _0x3ae4c8?{'count':_0x47ae4c,'rows':_0x3ae4c8}:null;}})['then'](respondWithResult(_0x6114a5,null))[_0xd373('0x49')](handleError(_0x6114a5,null));};exports[_0xd373('0x7b')]=function(_0xc8f4e6,_0x5c951e,_0x113671){var _0x5621d8={};var _0x30549e={};var _0x633ba0;var _0xa854a2;return db[_0xd373('0x30')][_0xd373('0x79')]({'where':{'id':_0xc8f4e6['params']['id']}})[_0xd373('0x27')](handleEntityNotFound(_0x5c951e,null))[_0xd373('0x27')](function(_0x39327f){if(_0x39327f){_0x633ba0=_0x39327f;_0x30549e[_0xd373('0x34')]=_[_0xd373('0x36')](db[_0xd373('0x7c')][_0xd373('0x31')]);_0x30549e['query']=_[_0xd373('0x36')](_0xc8f4e6[_0xd373('0x35')]);_0x30549e[_0xd373('0x37')]=_[_0xd373('0x38')](_0x30549e[_0xd373('0x34')],_0x30549e[_0xd373('0x35')]);_0x5621d8[_0xd373('0x39')]=_[_0xd373('0x38')](_0x30549e[_0xd373('0x34')],qs[_0xd373('0x3a')](_0xc8f4e6[_0xd373('0x35')][_0xd373('0x3a')]));_0x5621d8[_0xd373('0x39')]=_0x5621d8[_0xd373('0x39')][_0xd373('0x3b')]?_0x5621d8[_0xd373('0x39')]:_0x30549e[_0xd373('0x34')];_0x5621d8['order']=qs[_0xd373('0x3f')](_0xc8f4e6[_0xd373('0x35')]['sort']);_0x5621d8['where']=qs[_0xd373('0x37')](_[_0xd373('0x41')](_0xc8f4e6['query'],_0x30549e[_0xd373('0x37')]));if(_0xc8f4e6[_0xd373('0x35')][_0xd373('0x42')]){_0x5621d8[_0xd373('0x40')]=_[_0xd373('0x43')](_0x5621d8[_0xd373('0x40')],{'$or':_[_0xd373('0x2f')](_0x5621d8[_0xd373('0x39')],function(_0x3cc904){var _0x6e6c7e={};_0x6e6c7e[_0x3cc904]={'$like':'%'+_0xc8f4e6[_0xd373('0x35')]['filter']+'%'};return _0x6e6c7e;})});}_0x5621d8=_['merge']({},_0x5621d8,_0xc8f4e6[_0xd373('0x45')]);return _0x633ba0[_0xd373('0x7b')](_0x5621d8);}})['then'](function(_0x3785b7){if(_0x3785b7){_0xa854a2=_0x3785b7[_0xd373('0x3b')];if(!_0xc8f4e6[_0xd373('0x35')][_0xd373('0x3c')](_0xd373('0x3d'))){_0x5621d8[_0xd373('0x1f')]=qs['limit'](_0xc8f4e6[_0xd373('0x35')][_0xd373('0x1f')]);_0x5621d8[_0xd373('0x1e')]=qs['offset'](_0xc8f4e6[_0xd373('0x35')][_0xd373('0x1e')]);}return _0x633ba0[_0xd373('0x7b')](_0x5621d8);}})['then'](function(_0x6463cd){if(_0x6463cd){return _0x6463cd?{'count':_0xa854a2,'rows':_0x6463cd}:null;}})[_0xd373('0x27')](respondWithResult(_0x5c951e,null))['catch'](handleError(_0x5c951e,null));};exports[_0xd373('0x7d')]=function(_0x2da0cd,_0x48624a,_0x316348){var _0x48ee3b=_0x2da0cd[_0xd373('0x51')][_0xd373('0x73')];var _0x3b6ba5;return db['Team']['findAll']({'where':{'id':_0x48ee3b},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd373('0x7e'),'attributes':['id','name',_0xd373('0x7f'),_0xd373('0x80'),'interface'],'raw':!![]}]})[_0xd373('0x27')](function(_0x5be460){if(_0x5be460){_0x3b6ba5=_0x5be460;var _0x449d06=_[_0xd373('0x81')](_0x5be460,function(_0x15eb3d){var _0x1031eb=_0x15eb3d[_0xd373('0x29')]({'plain':!![]});return _0x1031eb[_0xd373('0x7e')];});return db['VoicePrefix'][_0xd373('0x4c')]({'where':{'id':_0x2da0cd['params']['id']}})[_0xd373('0x27')](function(_0x41faec){return db[_0xd373('0x4f')][_0xd373('0x50')](function(_0x39606d){return _0x41faec[_0xd373('0x7d')](_0x48ee3b,{'transaction':_0x39606d})['then'](function(){return BPromise[_0xd373('0x82')](_0x3b6ba5,function(_0x424a53){return db[_0xd373('0x83')]['upsert']({'TeamId':_0x424a53['id'],'VoicePrefixId':_0x2da0cd[_0xd373('0x4b')]['id']},{'transaction':_0x39606d});});})[_0xd373('0x27')](function(){return BPromise[_0xd373('0x82')](_0x449d06,function(_0x2f1dc0){return db[_0xd373('0x84')][_0xd373('0x85')]({'where':{'UserId':_0x2f1dc0['id'],'VoicePrefixId':_0x2da0cd['params']['id']},'transaction':_0x39606d});});})[_0xd373('0x27')](function(){_0x449d06['forEach'](function(_0x447ea9){socket[_0xd373('0x75')](_0xd373('0x86'),{'UserId':_0x447ea9['id'],'VoicePrefixId':_0x41faec['id']});});});});});}})[_0xd373('0x27')](respondWithStatusCode(_0x48624a,null))['catch'](handleError(_0x48624a,null));};exports['removeTeams']=function(_0x22e0bd,_0x44fbef,_0x3c9e20){return db[_0xd373('0x7c')][_0xd373('0x48')]({'where':{'id':_0x22e0bd[_0xd373('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd373('0x7a')],'as':_0xd373('0x7e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x44fbef,null))[_0xd373('0x27')](function(_0x2225b2){var _0x2d5326=_['map'](_0x2225b2,'id');var _0x259610=[];var _0x747622=[];var _0x5233a2=squel['select']();_0x5233a2[_0xd373('0x87')](_0xd373('0x88'))[_0xd373('0x89')](_0xd373('0x8a'),'tq')[_0xd373('0x8b')](_0xd373('0x8c'),'ut',_0xd373('0x8d'))['where'](_0xd373('0x8e'),_0x22e0bd[_0xd373('0x4b')]['id']);for(var _0x11e4a9=0x0;_0x11e4a9<_0x2225b2[_0xd373('0x3b')];_0x11e4a9+=0x1){let _0x7b49b6=_0x2225b2[_0x11e4a9];for(var _0x4d9ab3=0x0;_0x4d9ab3<_0x7b49b6[_0xd373('0x7e')][_0xd373('0x3b')];_0x4d9ab3+=0x1){let _0x4c924d=_0x7b49b6[_0xd373('0x7e')][_0x4d9ab3];var _0x494de8=_0x5233a2[_0xd373('0x8f')]();_0x494de8[_0xd373('0x40')](_0xd373('0x90'),_0x4c924d['id']);_0x747622[_0xd373('0x67')](db[_0xd373('0x4f')][_0xd373('0x35')](_0x494de8[_0xd373('0x91')](),{'type':db[_0xd373('0x4f')]['QueryTypes'][_0xd373('0x92')]})[_0xd373('0x27')](function(_0x13b085){if(_0x13b085[_0xd373('0x3b')]===0x1){return _0x4c924d['id'];}else{var _0x392bd2=_[_0xd373('0x93')](_['map'](_0x13b085,_0xd373('0x94')),function(_0x10ac87){return _[_0xd373('0x95')](_0x2d5326,_0x10ac87);});if(_0x392bd2){return _0x4c924d['id'];}}}));}}return BPromise[_0xd373('0x96')](_0x747622)[_0xd373('0x27')](function(_0x20fa2e){_0x259610=_(_0x259610)[_0xd373('0x97')](_0x20fa2e)[_0xd373('0x98')]()[_0xd373('0x99')]();return db['VoicePrefix'][_0xd373('0x4c')]({'where':{'id':_0x22e0bd[_0xd373('0x4b')]['id']}})[_0xd373('0x27')](function(_0x536c81){return db[_0xd373('0x4f')]['transaction'](function(_0x4ca4f9){return _0x536c81[_0xd373('0x9a')](_0x22e0bd['query'][_0xd373('0x73')],{'transaction':_0x4ca4f9})['then'](function(){if(!_['isEmpty'](_0x259610)){return _0x536c81['removeAgents'](_0x259610,{'transaction':_0x4ca4f9});}})['then'](function(){_0x259610['forEach'](function(_0x1de658){socket[_0xd373('0x75')](_0xd373('0x77'),{'UserId':_0x1de658,'VoicePrefixId':_0x536c81['id']});});});});});});})[_0xd373('0x27')](respondWithStatusCode(_0x44fbef,null))['catch'](handleError(_0x44fbef,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index dea1638..9f7abb5 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 _0x0552=['../../mysqldb','VoicePrefix','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1df25b,_0x385c60){var _0x3111db=function(_0x17dd3e){while(--_0x17dd3e){_0x1df25b['push'](_0x1df25b['shift']());}};_0x3111db(++_0x385c60);}(_0x0552,0xc5));var _0x2055=function(_0x47b6e0,_0x34403){_0x47b6e0=_0x47b6e0-0x0;var _0x1e8c55=_0x0552[_0x47b6e0];return _0x1e8c55;};'use strict';var EventEmitter=require(_0x2055('0x0'));var VoicePrefix=require(_0x2055('0x1'))['db'][_0x2055('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x2055('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2055('0x4')};function emitEvent(_0x443996){return function(_0x4287e3,_0x5d878f,_0x1ad40a){VoicePrefixEvents[_0x2055('0x5')](_0x443996+':'+_0x4287e3['id'],_0x4287e3);VoicePrefixEvents[_0x2055('0x5')](_0x443996,_0x4287e3);_0x1ad40a(null);};}for(var e in events){if(events[_0x2055('0x6')](e)){var event=events[e];VoicePrefix[_0x2055('0x7')](e,emitEvent(event));}}module[_0x2055('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xe526=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x311eb0,_0x469a4e){var _0x511d58=function(_0x2996ea){while(--_0x2996ea){_0x311eb0['push'](_0x311eb0['shift']());}};_0x511d58(++_0x469a4e);}(_0xe526,0x1c2));var _0x6e52=function(_0x2000b5,_0x581fb7){_0x2000b5=_0x2000b5-0x0;var _0x1aa0f3=_0xe526[_0x2000b5];return _0x1aa0f3;};'use strict';var EventEmitter=require(_0x6e52('0x0'));var VoicePrefix=require(_0x6e52('0x1'))['db'][_0x6e52('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x6e52('0x3')](0x0);var events={'afterCreate':_0x6e52('0x4'),'afterUpdate':_0x6e52('0x5'),'afterDestroy':_0x6e52('0x6')};function emitEvent(_0x57bb4d){return function(_0x42fc1c,_0x3cd040,_0xe85d8e){VoicePrefixEvents[_0x6e52('0x7')](_0x57bb4d+':'+_0x42fc1c['id'],_0x42fc1c);VoicePrefixEvents[_0x6e52('0x7')](_0x57bb4d,_0x42fc1c);_0xe85d8e(null);};}for(var e in events){if(events[_0x6e52('0x8')](e)){var event=events[e];VoicePrefix[_0x6e52('0x9')](e,emitEvent(event));}}module[_0x6e52('0xa')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index b95d5fb..e96b506 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 _0x47df=['voice_prefixes','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix'];(function(_0x2496cf,_0x45cdf1){var _0x5cbae4=function(_0xda2166){while(--_0xda2166){_0x2496cf['push'](_0x2496cf['shift']());}};_0x5cbae4(++_0x45cdf1);}(_0x47df,0x9d));var _0xf47d=function(_0x644883,_0x38bcf1){_0x644883=_0x644883-0x0;var _0x3a6865=_0x47df[_0x644883];return _0x3a6865;};'use strict';var _=require(_0xf47d('0x0'));var util=require(_0xf47d('0x1'));var logger=require(_0xf47d('0x2'))(_0xf47d('0x3'));var moment=require('moment');var BPromise=require(_0xf47d('0x4'));var rp=require(_0xf47d('0x5'));var fs=require('fs');var path=require(_0xf47d('0x6'));var rimraf=require('rimraf');var config=require(_0xf47d('0x7'));var attributes=require(_0xf47d('0x8'));module[_0xf47d('0x9')]=function(_0x3e2ea9,_0x54c49b){return _0x3e2ea9['define'](_0xf47d('0xa'),attributes,{'tableName':_0xf47d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bb0=['moment','bluebird','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','lodash','util','api'];(function(_0x459648,_0x59fb25){var _0xc987bb=function(_0x24119f){while(--_0x24119f){_0x459648['push'](_0x459648['shift']());}};_0xc987bb(++_0x59fb25);}(_0x9bb0,0x11b));var _0x09bb=function(_0x122cc1,_0x5c956e){_0x122cc1=_0x122cc1-0x0;var _0x1e33af=_0x9bb0[_0x122cc1];return _0x1e33af;};'use strict';var _=require(_0x09bb('0x0'));var util=require(_0x09bb('0x1'));var logger=require('../../config/logger')(_0x09bb('0x2'));var moment=require(_0x09bb('0x3'));var BPromise=require(_0x09bb('0x4'));var rp=require(_0x09bb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x09bb('0x6'));var config=require(_0x09bb('0x7'));var attributes=require(_0x09bb('0x8'));module['exports']=function(_0x36ec2c,_0x4ed5f6){return _0x36ec2c[_0x09bb('0x9')](_0x09bb('0xa'),attributes,{'tableName':'voice_prefixes','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 9ac8c93..c576726 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 _0xd386=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','then','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','info','catch','lodash','util'];(function(_0x25f8d5,_0x21bfff){var _0x419e9e=function(_0x5b9c1f){while(--_0x5b9c1f){_0x25f8d5['push'](_0x25f8d5['shift']());}};_0x419e9e(++_0x21bfff);}(_0xd386,0x10c));var _0x6d38=function(_0x34f270,_0x26851b){_0x34f270=_0x34f270-0x0;var _0x172825=_0xd386[_0x34f270];return _0x172825;};'use strict';var _=require(_0x6d38('0x0'));var util=require(_0x6d38('0x1'));var moment=require(_0x6d38('0x2'));var BPromise=require('bluebird');var rs=require(_0x6d38('0x3'));var fs=require('fs');var Redis=require(_0x6d38('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d38('0x5'));var logger=require(_0x6d38('0x6'))(_0x6d38('0x7'));var config=require(_0x6d38('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6d38('0x9')][_0x6d38('0xa')]({'port':0x232a});config[_0x6d38('0xb')]=_[_0x6d38('0xc')](config[_0x6d38('0xb')],{'host':_0x6d38('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6d38('0xb')]));require('./voicePrefix.socket')[_0x6d38('0xe')](socket);function respondWithRpcPromise(_0x4909e0,_0x171f76,_0x29c14b){return new BPromise(function(_0x23c9ba,_0x5dfc29){return client[_0x6d38('0xf')](_0x4909e0,_0x29c14b)[_0x6d38('0x10')](function(_0x404a35){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x171f76,'request\x20sent');logger[_0x6d38('0x11')](_0x6d38('0x12'),_0x171f76,_0x6d38('0x13'),JSON[_0x6d38('0x14')](_0x404a35));if(_0x404a35[_0x6d38('0x15')]){if(_0x404a35['error'][_0x6d38('0x16')]===0x1f4){logger[_0x6d38('0x15')](_0x6d38('0x17'),_0x171f76,_0x404a35[_0x6d38('0x15')][_0x6d38('0x18')]);return _0x5dfc29(_0x404a35[_0x6d38('0x15')][_0x6d38('0x18')]);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x171f76,_0x404a35['error'][_0x6d38('0x18')]);return _0x23c9ba(_0x404a35[_0x6d38('0x15')][_0x6d38('0x18')]);}else{logger[_0x6d38('0x19')](_0x6d38('0x17'),_0x171f76,_0x6d38('0x13'));_0x23c9ba(_0x404a35['result'][_0x6d38('0x18')]);}})[_0x6d38('0x1a')](function(_0x364d22){logger[_0x6d38('0x15')](_0x6d38('0x17'),_0x171f76,_0x364d22);_0x5dfc29(_0x364d22);});});} \ No newline at end of file +var _0x6ab9=['redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x4fb18a,_0x4186a3){var _0x13bf76=function(_0x48d884){while(--_0x48d884){_0x4fb18a['push'](_0x4fb18a['shift']());}};_0x13bf76(++_0x4186a3);}(_0x6ab9,0x19a));var _0x96ab=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x6ab9[_0x35885a];return _0xe86249;};'use strict';var _=require(_0x96ab('0x0'));var util=require(_0x96ab('0x1'));var moment=require('moment');var BPromise=require(_0x96ab('0x2'));var rs=require(_0x96ab('0x3'));var fs=require('fs');var Redis=require(_0x96ab('0x4'));var db=require(_0x96ab('0x5'))['db'];var utils=require(_0x96ab('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x96ab('0x7'));var jayson=require(_0x96ab('0x8'));var client=jayson[_0x96ab('0x9')]['http']({'port':0x232a});config[_0x96ab('0xa')]=_[_0x96ab('0xb')](config['redis'],{'host':_0x96ab('0xc'),'port':0x18eb});var socket=require(_0x96ab('0xd'))(new Redis(config[_0x96ab('0xa')]));require(_0x96ab('0xe'))[_0x96ab('0xf')](socket);function respondWithRpcPromise(_0x2dfc50,_0xdc00cb,_0x84fd1e){return new BPromise(function(_0x3ef79e,_0x9a19d7){return client[_0x96ab('0x10')](_0x2dfc50,_0x84fd1e)[_0x96ab('0x11')](function(_0x43658c){logger['info'](_0x96ab('0x12'),_0xdc00cb,'request\x20sent');logger[_0x96ab('0x13')](_0x96ab('0x14'),_0xdc00cb,_0x96ab('0x15'),JSON[_0x96ab('0x16')](_0x43658c));if(_0x43658c[_0x96ab('0x17')]){if(_0x43658c[_0x96ab('0x17')][_0x96ab('0x18')]===0x1f4){logger[_0x96ab('0x17')](_0x96ab('0x12'),_0xdc00cb,_0x43658c[_0x96ab('0x17')][_0x96ab('0x19')]);return _0x9a19d7(_0x43658c['error']['message']);}logger[_0x96ab('0x17')](_0x96ab('0x12'),_0xdc00cb,_0x43658c[_0x96ab('0x17')]['message']);return _0x3ef79e(_0x43658c[_0x96ab('0x17')][_0x96ab('0x19')]);}else{logger['info'](_0x96ab('0x12'),_0xdc00cb,'request\x20sent');_0x3ef79e(_0x43658c[_0x96ab('0x1a')][_0x96ab('0x19')]);}})[_0x96ab('0x1b')](function(_0x23f826){logger[_0x96ab('0x17')](_0x96ab('0x12'),_0xdc00cb,_0x23f826);_0x9a19d7(_0x23f826);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 0ba6140..8b3bfdb 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 _0x5ab4=['update','emit','removeListener','register','length','voicePrefix:','./voicePrefix.events','save','remove'];(function(_0x55d642,_0xa2298e){var _0x11df2f=function(_0x31b0b9){while(--_0x31b0b9){_0x55d642['push'](_0x55d642['shift']());}};_0x11df2f(++_0xa2298e);}(_0x5ab4,0x9f));var _0x45ab=function(_0x44f114,_0x3123ad){_0x44f114=_0x44f114-0x0;var _0x3bc555=_0x5ab4[_0x44f114];return _0x3bc555;};'use strict';var VoicePrefixEvents=require(_0x45ab('0x0'));var events=[_0x45ab('0x1'),_0x45ab('0x2'),_0x45ab('0x3')];function createListener(_0x40cdb2,_0x4e22bc){return function(_0xc77fdd){_0x4e22bc[_0x45ab('0x4')](_0x40cdb2,_0xc77fdd);};}function removeListener(_0x3d5dbd,_0x44ad44){return function(){VoicePrefixEvents[_0x45ab('0x5')](_0x3d5dbd,_0x44ad44);};}exports[_0x45ab('0x6')]=function(_0x5483f1){for(var _0x3b4d24=0x0,_0x22a033=events[_0x45ab('0x7')];_0x3b4d24<_0x22a033;_0x3b4d24++){var _0x4250ec=events[_0x3b4d24];var _0x2beb3a=createListener(_0x45ab('0x8')+_0x4250ec,_0x5483f1);VoicePrefixEvents['on'](_0x4250ec,_0x2beb3a);}}; \ No newline at end of file +var _0xea70=['length','voicePrefix:','./voicePrefix.events','save','remove','removeListener','register'];(function(_0x10ebb4,_0xc1c637){var _0x3681ac=function(_0x4354ba){while(--_0x4354ba){_0x10ebb4['push'](_0x10ebb4['shift']());}};_0x3681ac(++_0xc1c637);}(_0xea70,0x175));var _0x0ea7=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xea70[_0x4565bf];return _0x5610ba;};'use strict';var VoicePrefixEvents=require(_0x0ea7('0x0'));var events=[_0x0ea7('0x1'),_0x0ea7('0x2'),'update'];function createListener(_0x28ddf0,_0x499815){return function(_0x2fad00){_0x499815['emit'](_0x28ddf0,_0x2fad00);};}function removeListener(_0x425623,_0x3138eb){return function(){VoicePrefixEvents[_0x0ea7('0x3')](_0x425623,_0x3138eb);};}exports[_0x0ea7('0x4')]=function(_0x168372){for(var _0x489be9=0x0,_0x144497=events[_0x0ea7('0x5')];_0x489be9<_0x144497;_0x489be9++){var _0x51b516=events[_0x489be9];var _0x48dedd=createListener(_0x0ea7('0x6')+_0x51b516,_0x168372);VoicePrefixEvents['on'](_0x51b516,_0x48dedd);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 98f5113..15b2c7d 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(_0x2fe689,_0x5794e5){var _0x35ea44=function(_0x51b9d6){while(--_0x51b9d6){_0x2fe689['push'](_0x2fe689['shift']());}};_0x35ea44(++_0x5794e5);}(_0xb10b,0x12a));var _0xbb10=function(_0x47d060,_0x4a2b1d){_0x47d060=_0x47d060-0x0;var _0xb2d051=_0xb10b[_0x47d060];return _0xb2d051;};'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(_0x5982a5,_0x3dc07b){var _0x159c80=function(_0x274c92){while(--_0x274c92){_0x5982a5['push'](_0x5982a5['shift']());}};_0x159c80(++_0x3dc07b);}(_0xb10b,0x12a));var _0xbb10=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0xb10b[_0x54c9dd];return _0x855156;};'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 c4a2d21..84c531a 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 _0xe504=['never','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','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)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','inbound','ENUM','rrmemory','linear','rrordered','setDataValue','strategy','getDataValue','dialMethod','outbound','preview','booked','roundrobin','includes','INTEGER','yes','once','TEXT','join','periodic_announce','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','predictive','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','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)','07:00-22:00,*,*,*','always'];(function(_0x46b01f,_0x43dc27){var _0x5b091a=function(_0x2d9713){while(--_0x2d9713){_0x46b01f['push'](_0x46b01f['shift']());}};_0x5b091a(++_0x43dc27);}(_0xe504,0x15a));var _0x4e50=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xe504[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x4e50('0x0'));module[_0x4e50('0x1')]={'name':{'type':Sequelize[_0x4e50('0x2')],'allowNull':![],'unique':_0x4e50('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x4e50('0x4'),'outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x4e50('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x4e50('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x4e50('0x5')]('rr','ringall','leastrecent','fewestcalls','random',_0x4e50('0x6'),_0x4e50('0x7'),'wrandom',_0x4e50('0x8')),'allowNull':![],'defaultValue':'ringall','set':function(_0x72c381){this[_0x4e50('0x9')](_0x4e50('0xa'),_0x72c381?_0x72c381:_0x4e50('0x6'));},'get':function(){var _0x5d8f67=this[_0x4e50('0xb')]('type');var _0x375004=this[_0x4e50('0xb')](_0x4e50('0xc'));var _0x2b3a5c=this[_0x4e50('0xb')](_0x4e50('0xa'));if(_0x5d8f67===_0x4e50('0xd')){if(_0x375004===_0x4e50('0xe')){return null;}if(_0x375004===_0x4e50('0xf')&&!['rrmemory',_0x4e50('0x10')][_0x4e50('0x11')](_0x2b3a5c)){this['setDataValue'](_0x4e50('0xa'),_0x4e50('0x6'));}}return _0x2b3a5c;}},'servicelevel':{'type':Sequelize[_0x4e50('0x12')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x4e50('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x4e50('0x12')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x4e50('0x12')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x4e50('0x2')]},'weight':{'type':Sequelize[_0x4e50('0x12')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x4e50('0x5')](_0x4e50('0x13'),'no'),'defaultValue':_0x4e50('0x13')},'autopause':{'type':Sequelize[_0x4e50('0x5')](_0x4e50('0x13'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x4e50('0x12')](0xb)},'autopausebusy':{'type':Sequelize[_0x4e50('0x5')](_0x4e50('0x13'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x4e50('0x5')](_0x4e50('0x13'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x4e50('0x12')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x4e50('0x5')](_0x4e50('0x13'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x4e50('0x5')](_0x4e50('0x13'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x4e50('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x4e50('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x4e50('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x4e50('0x12')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x4e50('0x12')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x4e50('0x12')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x4e50('0x5')](_0x4e50('0x13'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x4e50('0x5')]('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x4e50('0x5')]('yes','no',_0x4e50('0x14')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x4e50('0x5')](_0x4e50('0x13'),'no')},'announce_position_limit':{'type':Sequelize[_0x4e50('0x12')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x4e50('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x4e50('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x4e50('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x4e50('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x4e50('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x4e50('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x4e50('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x4e50('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x4e50('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x4e50('0x2')]},'periodic_announce':{'type':Sequelize[_0x4e50('0x15')],'set':function(_0x38279f){this[_0x4e50('0x9')]('periodic_announce',_0x38279f?_0x38279f[_0x4e50('0x16')](','):[]);},'get':function(){return this[_0x4e50('0xb')](_0x4e50('0x17'))?this['getDataValue']('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0x4e50('0x2')],'defaultValue':_0x4e50('0x13'),'set':function(_0x3fc416){this['setDataValue'](_0x4e50('0x18'),_0x3fc416?_0x3fc416[_0x4e50('0x16')](','):undefined);},'get':function(){return this['getDataValue'](_0x4e50('0x18'))?this['getDataValue'](_0x4e50('0x18'))[_0x4e50('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x4e50('0x2')],'defaultValue':'no','set':function(_0x384c0b){this[_0x4e50('0x9')](_0x4e50('0x1a'),_0x384c0b?_0x384c0b[_0x4e50('0x16')](','):undefined);},'get':function(){return this[_0x4e50('0xb')](_0x4e50('0x1a'))?this[_0x4e50('0xb')]('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x4e50('0x5')](_0x4e50('0x13'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x4e50('0x5')](_0x4e50('0x13'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x4e50('0x12')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x4e50('0x13'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4e50('0x2')]},'acw':{'type':Sequelize[_0x4e50('0x1b')],'defaultValue':0x0,'set':function(_0x309772){this[_0x4e50('0x9')](_0x4e50('0x1c'),_0x309772);if(_0x309772){if(this[_0x4e50('0xb')](_0x4e50('0x1d'))<0x2){this[_0x4e50('0x9')](_0x4e50('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x4e50('0x1b')],'defaultValue':0x0,'comment':_0x4e50('0x1e')},'dialMethod':{'type':Sequelize['ENUM'](_0x4e50('0xe'),'progressive','power',_0x4e50('0x1f'),_0x4e50('0xf')),'defaultValue':_0x4e50('0x20'),'comment':_0x4e50('0x21')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x4e50('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4e50('0x23')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x4e50('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4e50('0x24')},'dialPowerLevel':{'type':Sequelize[_0x4e50('0x25')](0x2)[_0x4e50('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x4e50('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x4e50('0x5')](_0x4e50('0x27'),_0x4e50('0x28')),'defaultValue':_0x4e50('0x28'),'comment':_0x4e50('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x4e50('0x25')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x4e50('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x4e50('0x12')](0x3)[_0x4e50('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x4e50('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x4e50('0x12')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x4e50('0x2')],'defaultValue':'tTxX','comment':_0x4e50('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x4e50('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4e50('0x2d')},'dialQueueProject':{'type':Sequelize[_0x4e50('0x2')],'comment':_0x4e50('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4e50('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4e50('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4e50('0x12')](0x5)[_0x4e50('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x4e50('0x12')](0x3)[_0x4e50('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4e50('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4e50('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4e50('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x4e50('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4e50('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4e50('0x32')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4e50('0x12')](0x3)[_0x4e50('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4e50('0x33')},'dialTimezone':{'type':Sequelize[_0x4e50('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x4e50('0x34')},'dialPrefix':{'type':Sequelize[_0x4e50('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x4e50('0x35'),_0x4e50('0x36'),'onlyIfOpen'),'defaultValue':_0x4e50('0x35')},'dialAMDActive':{'type':Sequelize[_0x4e50('0x1b')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4e50('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x4e50('0x12')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4e50('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4e50('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x4e50('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4e50('0x38')},'dialAMDMinWordLength':{'type':Sequelize[_0x4e50('0x12')](0x9)[_0x4e50('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4e50('0x39')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4e50('0x12')](0x9)[_0x4e50('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4e50('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x4e50('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4e50('0x3b')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x4e50('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4e50('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4e50('0x12')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4e50('0x3d')},'dialRecallMeTimeout':{'type':Sequelize[_0x4e50('0x12')](0x5)[_0x4e50('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x4e50('0x3e')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4e50('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4e50('0x5')](_0x4e50('0x40'),_0x4e50('0x41')),'defaultValue':_0x4e50('0x40')},'dialQueueProject2':{'type':Sequelize[_0x4e50('0x2')],'comment':_0x4e50('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x4e50('0x1b')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4e50('0x12')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4e50('0x42')},'dialCutDigit':{'type':Sequelize[_0x4e50('0x12')](0x3)[_0x4e50('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4e50('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4e50('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4e50('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4e50('0x12')](0x5)[_0x4e50('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4e50('0x45')},'dialDropMaxRetry':{'type':Sequelize[_0x4e50('0x12')](0x3)[_0x4e50('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4e50('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4e50('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4e50('0x12')](0x3)[_0x4e50('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4e50('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4e50('0x12')](0x5)[_0x4e50('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4e50('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0x4e50('0x12')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4e50('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4e50('0x12')](0x5)[_0x4e50('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4e50('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4e50('0x12')](0x3)[_0x4e50('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4e50('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4e50('0x12')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4e50('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x4e50('0x4d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x32e330){if(!_0x32e330)this[_0x4e50('0x9')](_0x4e50('0x4e'),null);this[_0x4e50('0x9')](_0x4e50('0x4f'),_0x32e330);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x4e50('0x12')](0x3)[_0x4e50('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x4e50('0x12')](0x3)[_0x4e50('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x4e50('0x1b')],'defaultValue':![]}}; \ No newline at end of file +var _0x4bc1=['wrandom','rrordered','setDataValue','strategy','getDataValue','dialMethod','preview','booked','roundrobin','includes','INTEGER','ENUM','yes','all','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','predictive','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','STRING','name','inbound','outbound','default','ringall','leastrecent','fewestcalls','rrmemory','linear'];(function(_0x12e540,_0x26d444){var _0x521358=function(_0x5eaef2){while(--_0x5eaef2){_0x12e540['push'](_0x12e540['shift']());}};_0x521358(++_0x26d444);}(_0x4bc1,0xa2));var _0x14bc=function(_0x4ffe11,_0x1fe759){_0x4ffe11=_0x4ffe11-0x0;var _0x1926a6=_0x4bc1[_0x4ffe11];return _0x1926a6;};'use strict';var Sequelize=require(_0x14bc('0x0'));module[_0x14bc('0x1')]={'name':{'type':Sequelize[_0x14bc('0x2')],'allowNull':![],'unique':_0x14bc('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x14bc('0x4'),_0x14bc('0x5')),'allowNull':![],'defaultValue':_0x14bc('0x4')},'musiconhold':{'type':Sequelize[_0x14bc('0x2')],'defaultValue':_0x14bc('0x6')},'announce':{'type':Sequelize[_0x14bc('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x14bc('0x7'),_0x14bc('0x8'),_0x14bc('0x9'),'random',_0x14bc('0xa'),_0x14bc('0xb'),_0x14bc('0xc'),_0x14bc('0xd')),'allowNull':![],'defaultValue':_0x14bc('0x7'),'set':function(_0x27ae31){this[_0x14bc('0xe')](_0x14bc('0xf'),_0x27ae31?_0x27ae31:'rrmemory');},'get':function(){var _0x193a42=this[_0x14bc('0x10')]('type');var _0x3c60f1=this['getDataValue'](_0x14bc('0x11'));var _0x530f7b=this[_0x14bc('0x10')](_0x14bc('0xf'));if(_0x193a42==='outbound'){if(_0x3c60f1===_0x14bc('0x12')){return null;}if(_0x3c60f1===_0x14bc('0x13')&&![_0x14bc('0xa'),_0x14bc('0x14')][_0x14bc('0x15')](_0x530f7b)){this[_0x14bc('0xe')](_0x14bc('0xf'),'rrmemory');}}return _0x530f7b;}},'servicelevel':{'type':Sequelize[_0x14bc('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x14bc('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x14bc('0x16')](0xb)},'timeout':{'type':Sequelize[_0x14bc('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x14bc('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x14bc('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x14bc('0x17')](_0x14bc('0x18'),'no'),'defaultValue':_0x14bc('0x18')},'autopause':{'type':Sequelize['ENUM'](_0x14bc('0x18'),'no',_0x14bc('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x14bc('0x17')](_0x14bc('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x14bc('0x17')](_0x14bc('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x14bc('0x17')](_0x14bc('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x14bc('0x17')](_0x14bc('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x14bc('0x17')](_0x14bc('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x14bc('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x14bc('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x14bc('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x14bc('0x17')](_0x14bc('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x14bc('0x17')](_0x14bc('0x18'),'no'),'defaultValue':_0x14bc('0x18')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x14bc('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x14bc('0x17')](_0x14bc('0x18'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x14bc('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x14bc('0x2')]},'queue_youarenext':{'type':Sequelize[_0x14bc('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x14bc('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x14bc('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x14bc('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x14bc('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x14bc('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x14bc('0x2')]},'queue_quantity1':{'type':Sequelize[_0x14bc('0x2')]},'queue_quantity2':{'type':Sequelize[_0x14bc('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x14bc('0x2')]},'queue_less_than':{'type':Sequelize[_0x14bc('0x2')]},'periodic_announce':{'type':Sequelize[_0x14bc('0x1a')],'set':function(_0x6f73c1){this[_0x14bc('0xe')](_0x14bc('0x1b'),_0x6f73c1?_0x6f73c1[_0x14bc('0x1c')](','):[]);},'get':function(){return this[_0x14bc('0x10')](_0x14bc('0x1b'))?this['getDataValue'](_0x14bc('0x1b'))[_0x14bc('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x14bc('0x2')],'defaultValue':'yes','set':function(_0x5348e6){this[_0x14bc('0xe')](_0x14bc('0x1e'),_0x5348e6?_0x5348e6[_0x14bc('0x1c')](','):undefined);},'get':function(){return this[_0x14bc('0x10')](_0x14bc('0x1e'))?this[_0x14bc('0x10')](_0x14bc('0x1e'))[_0x14bc('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x14bc('0x2')],'defaultValue':'no','set':function(_0x3fad8d){this[_0x14bc('0xe')](_0x14bc('0x1f'),_0x3fad8d?_0x3fad8d[_0x14bc('0x1c')](','):undefined);},'get':function(){return this[_0x14bc('0x10')]('leavewhenempty')?this[_0x14bc('0x10')](_0x14bc('0x1f'))[_0x14bc('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x14bc('0x17')](_0x14bc('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x14bc('0x17')](_0x14bc('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x14bc('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x14bc('0x17')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x14bc('0x2')]},'description':{'type':Sequelize[_0x14bc('0x2')]},'acw':{'type':Sequelize[_0x14bc('0x20')],'defaultValue':0x0,'set':function(_0x44c37f){this['setDataValue'](_0x14bc('0x21'),_0x44c37f);if(_0x44c37f){if(this[_0x14bc('0x10')](_0x14bc('0x22'))<0x2){this[_0x14bc('0xe')](_0x14bc('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x14bc('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x14bc('0x20')],'defaultValue':0x0,'comment':_0x14bc('0x23')},'dialMethod':{'type':Sequelize[_0x14bc('0x17')](_0x14bc('0x12'),_0x14bc('0x24'),_0x14bc('0x25'),_0x14bc('0x26'),_0x14bc('0x13')),'defaultValue':_0x14bc('0x24'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x14bc('0x16')](0x4)[_0x14bc('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x14bc('0x28')},'dialLimitQueue':{'type':Sequelize[_0x14bc('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x14bc('0x29')},'dialPowerLevel':{'type':Sequelize[_0x14bc('0x2a')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x14bc('0x2b')},'dialPredictiveOptimization':{'type':Sequelize[_0x14bc('0x17')](_0x14bc('0x2c'),_0x14bc('0x2d')),'defaultValue':_0x14bc('0x2d'),'comment':_0x14bc('0x2e')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x14bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x14bc('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x14bc('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize[_0x14bc('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x14bc('0x16')](0x3)[_0x14bc('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14bc('0x30')},'dialQueueOptions':{'type':Sequelize[_0x14bc('0x2')],'defaultValue':_0x14bc('0x31'),'comment':_0x14bc('0x32')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x14bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x14bc('0x33')},'dialCongestionMaxRetry':{'type':Sequelize[_0x14bc('0x16')](0x3)[_0x14bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14bc('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x14bc('0x16')](0x5)[_0x14bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14bc('0x35')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x14bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14bc('0x36')},'dialBusyRetryFrequency':{'type':Sequelize[_0x14bc('0x16')](0x5)[_0x14bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14bc('0x37')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x14bc('0x16')](0x3)[_0x14bc('0x27')],'defaultValue':0x3,'comment':_0x14bc('0x38')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x14bc('0x16')](0x5)[_0x14bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14bc('0x39')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x14bc('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x14bc('0x3a')},'dialTimezone':{'type':Sequelize[_0x14bc('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x14bc('0x2')],'defaultValue':_0x14bc('0x3b')},'dialPrefix':{'type':Sequelize[_0x14bc('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x14bc('0x3c'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x14bc('0x20')],'defaultValue':0x0,'comment':_0x14bc('0x3d')},'dialAMDInitialSilence':{'type':Sequelize[_0x14bc('0x16')](0x9)[_0x14bc('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x14bc('0x16')](0x9)[_0x14bc('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x14bc('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x14bc('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x14bc('0x3f')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x14bc('0x16')](0x9)[_0x14bc('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x14bc('0x40')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x14bc('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x14bc('0x41')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x14bc('0x16')](0x9)[_0x14bc('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x14bc('0x42')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x14bc('0x16')](0x9)[_0x14bc('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x14bc('0x43')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x14bc('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x14bc('0x16')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x14bc('0x44')},'dialRecallMeTimeout':{'type':Sequelize[_0x14bc('0x16')](0x5)[_0x14bc('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x14bc('0x20')],'defaultValue':0x0,'comment':_0x14bc('0x45')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x14bc('0x46'),_0x14bc('0x47')),'defaultValue':_0x14bc('0x46')},'dialQueueProject2':{'type':Sequelize[_0x14bc('0x2')],'comment':_0x14bc('0x33')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x14bc('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x14bc('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x14bc('0x16')](0x3)[_0x14bc('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x14bc('0x48')},'dialCutDigit':{'type':Sequelize[_0x14bc('0x16')](0x3)[_0x14bc('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x14bc('0x49')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14bc('0x4a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x14bc('0x16')](0x5)[_0x14bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14bc('0x4b')},'dialDropMaxRetry':{'type':Sequelize[_0x14bc('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14bc('0x4c')},'dialDropRetryFrequency':{'type':Sequelize[_0x14bc('0x16')](0x5)[_0x14bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14bc('0x4d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x14bc('0x16')](0x3)[_0x14bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14bc('0x4e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x14bc('0x16')](0x5)[_0x14bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14bc('0x4f')},'dialMachineMaxRetry':{'type':Sequelize[_0x14bc('0x16')](0x3)[_0x14bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14bc('0x50')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x14bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14bc('0x51')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x14bc('0x16')](0x3)[_0x14bc('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14bc('0x52')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x14bc('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14bc('0x53')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x14bc('0x16')],'allowNull':!![],'comment':_0x14bc('0x54')},'mandatoryDisposition':{'type':Sequelize[_0x14bc('0x20')],'defaultValue':![],'comment':_0x14bc('0x55'),'set':function(_0x407f52){if(!_0x407f52)this['setDataValue'](_0x14bc('0x56'),null);this[_0x14bc('0xe')]('mandatoryDisposition',_0x407f52);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x14bc('0x16')](0x3)[_0x14bc('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x14bc('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x14bc('0x16')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index fd27ecb..87c92ea 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 _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(_0x1f89a6,_0x140465){var _0xde687=function(_0x3a1e71){while(--_0x3a1e71){_0x1f89a6['push'](_0x1f89a6['shift']());}};_0xde687(++_0x140465);}(_0xe14b,0x93));var _0xbe14=function(_0x342c02,_0x581600){_0x342c02=_0x342c02-0x0;var _0x55085f=_0xe14b[_0x342c02];return _0x55085f;};'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 +var _0x9957=['includes','find','type','name','UserProfileResource','destroy','stack','send','fieldName','key','getOptions','include','query','findAll','catch','show','params','model','rawAttributes','filters','attributes','intersection','fields','includeAll','merge','VoiceQueue','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','UserProfileSection','userProfileId','autoAssociation','error','clone','length','options','omit','updatedAt','user','role','outbound','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','keys','order','sort','where','pick','CmHopper','rows','getHopperHistories','CmHopperHistory','hasOwnProperty','VoiceQueueId','getHopperFinals','CmHopperFinal','nolimit','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','Agents','voicePause','interface','penalty','transaction','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','forEach','emit','userVoiceQueue:save','ids','User','field','tq.TeamId','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','every','all','union','compact','removeTeams','isEmpty','userVoiceQueue:remove','addAgents','online','SIP/%s','removeAgents','isArray','getAgents','getMembers','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','createdAt','select','ContactId','CmListId','ListId','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','VoiceQueueId\x20=\x20?','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','join','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','VoiceQueues','QueueCampaigns','filter','ignore','map','value'];(function(_0xb0de07,_0x3ca2a0){var _0x4633d8=function(_0x2368e0){while(--_0x2368e0){_0xb0de07['push'](_0xb0de07['shift']());}};_0x4633d8(++_0x3ca2a0);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var moment=require(_0x7995('0x0'));var BPromise=require(_0x7995('0x1'));var util=require(_0x7995('0x2'));var _=require(_0x7995('0x3'));var squel=require('squel');var Redis=require(_0x7995('0x4'));var qs=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var config=require('../../config/environment');var db=require(_0x7995('0x8'))['db'];config[_0x7995('0x9')]=_[_0x7995('0xa')](config[_0x7995('0x9')],{'host':_0x7995('0xb'),'port':0x18eb});var socket=require(_0x7995('0xc'))(new Redis(config['redis']));require(_0x7995('0xd'))[_0x7995('0xe')](socket);function respondWithStatusCode(_0x4a64f7,_0xa2e5f0){_0xa2e5f0=_0xa2e5f0||0xcc;return function(_0x3116fb){if(_0x3116fb){return _0x4a64f7[_0x7995('0xf')](_0xa2e5f0);}return _0x4a64f7[_0x7995('0x10')](_0xa2e5f0)[_0x7995('0x11')]();};}function respondWithResult(_0x1e400a,_0x341672){_0x341672=_0x341672||0xc8;return function(_0x524f7b){if(_0x524f7b){return _0x1e400a[_0x7995('0x10')](_0x341672)[_0x7995('0x12')](_0x524f7b);}};}function respondWithFilteredResult(_0x581f22,_0xb0c872){return function(_0x2cb37a){if(_0x2cb37a){var _0x19a27e=typeof _0xb0c872[_0x7995('0x13')]===_0x7995('0x14')&&typeof _0xb0c872[_0x7995('0x15')]===_0x7995('0x14');var _0x4cc004=_0x2cb37a['count'];var _0x2b4e94=_0x19a27e?0x0:_0xb0c872[_0x7995('0x13')];var _0x24b5bb=_0x19a27e?_0x2cb37a[_0x7995('0x16')]:_0xb0c872[_0x7995('0x13')]+_0xb0c872[_0x7995('0x15')];var _0x2202ce;if(_0x24b5bb>=_0x4cc004){_0x24b5bb=_0x4cc004;_0x2202ce=0xc8;}else{_0x2202ce=0xce;}_0x581f22[_0x7995('0x10')](_0x2202ce);return _0x581f22['set'](_0x7995('0x17'),_0x2b4e94+'-'+_0x24b5bb+'/'+_0x4cc004)['json'](_0x2cb37a);}return null;};}function saveUpdates(_0x2f832e){return function(_0x37f297){if(_0x37f297){return _0x37f297[_0x7995('0x18')](_0x2f832e)[_0x7995('0x19')](function(_0x1e1415){return _0x1e1415;});}return null;};}function removeEntity(_0x37a7d4){return function(_0x4faa60){if(_0x4faa60){return _0x4faa60['destroy']()[_0x7995('0x19')](function(){var _0x5e6f90=_0x4faa60['get']({'plain':!![]});var _0x3ec178=[{'name':_0x7995('0x1a'),'value':'inbound','ignore':![]},{'name':_0x7995('0x1b'),'value':'outbound','ignore':![]}];var _0x4b1a8e=_(_0x3ec178)[_0x7995('0x1c')](_0x7995('0x1d'))[_0x7995('0x1e')](_0x7995('0x1f'))[_0x7995('0x1f')]();if(_[_0x7995('0x20')](_0x4b1a8e,_0x5e6f90['type'])){return;}var _0x32a09a=_[_0x7995('0x21')](_0x3ec178,[_0x7995('0x1f'),_0x5e6f90[_0x7995('0x22')]])[_0x7995('0x23')];return db[_0x7995('0x24')][_0x7995('0x25')]({'where':{'type':_0x32a09a,'resourceId':_0x5e6f90['id']}})[_0x7995('0x19')](function(){return _0x4faa60;});})['then'](function(){_0x37a7d4[_0x7995('0x10')](0xcc)[_0x7995('0x11')]();});}};}function handleEntityNotFound(_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x401dc3[_0x7995('0xf')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x26')]);if(_0x47625f[_0x7995('0x23')]){delete _0x47625f[_0x7995('0x23')];}_0x2a307e[_0x7995('0x10')](_0x56691a)[_0x7995('0x27')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={};var _0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['VoiceQueue']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x28')],'type':_0x3573be[_0x7995('0x22')][_0x7995('0x29')]};});_0x456a28=qs[_0x7995('0x2a')](_0x4253e5,_0x9b2a15);var _0x1ca460={'where':_0x456a28['where']};return db['VoiceQueue'][_0x7995('0x16')](_0x1ca460)['then'](function(_0x553671){_0x3250e0[_0x7995('0x16')]=_0x553671;_0x456a28[_0x7995('0x2b')]=qs[_0x7995('0x2b')](_0x9b2a15[_0x7995('0x2c')]);return db['VoiceQueue'][_0x7995('0x2d')](_0x456a28);})[_0x7995('0x19')](function(_0x5dd802){_0x3250e0['rows']=_0x5dd802;return _0x3250e0;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x2e')](handleError(_0x514445,null));};exports[_0x7995('0x2f')]=function(_0x4a176f,_0x3e7020){var _0x51b95d={'raw':![],'where':{'id':_0x4a176f[_0x7995('0x30')]['id']}},_0x37917b={};_0x37917b[_0x7995('0x31')]=_['keys'](db['VoiceQueue'][_0x7995('0x32')]);_0x37917b['query']=_['keys'](_0x4a176f[_0x7995('0x2c')]);_0x37917b[_0x7995('0x33')]=_['intersection'](_0x37917b[_0x7995('0x31')],_0x37917b[_0x7995('0x2c')]);_0x51b95d[_0x7995('0x34')]=_[_0x7995('0x35')](_0x37917b[_0x7995('0x31')],qs['fields'](_0x4a176f[_0x7995('0x2c')][_0x7995('0x36')]));_0x51b95d[_0x7995('0x34')]=_0x51b95d[_0x7995('0x34')]['length']?_0x51b95d[_0x7995('0x34')]:_0x37917b[_0x7995('0x31')];if(_0x4a176f[_0x7995('0x2c')][_0x7995('0x37')]){_0x51b95d[_0x7995('0x2b')]=[{'all':!![]}];}_0x51b95d=_[_0x7995('0x38')]({},_0x51b95d,_0x4a176f['options']);return db[_0x7995('0x39')][_0x7995('0x21')](_0x51b95d)[_0x7995('0x19')](handleEntityNotFound(_0x3e7020,null))[_0x7995('0x19')](respondWithResult(_0x3e7020,null))[_0x7995('0x2e')](handleError(_0x3e7020,null));};exports[_0x7995('0x3a')]=function(_0x14d638,_0x270c0e){return db[_0x7995('0x39')][_0x7995('0x3a')](_0x14d638[_0x7995('0x3b')],{})[_0x7995('0x19')](function(_0x7b4e67){var _0x53cda2=_0x14d638['user'][_0x7995('0x3c')]({'plain':!![]});if(!_0x53cda2)throw new Error(_0x7995('0x3d'));if(_0x53cda2['role']==='user'){var _0x3f8522=_0x7b4e67['get']({'plain':!![]});var _0x504a33=[{'name':_0x7995('0x1a'),'value':_0x7995('0x3e')},{'name':_0x7995('0x1b'),'value':'outbound'}];var _0x46ac4f=_['find'](_0x504a33,[_0x7995('0x1f'),_0x3f8522['type']])['name'];return db[_0x7995('0x3f')][_0x7995('0x21')]({'where':{'name':_0x46ac4f,'userProfileId':_0x53cda2[_0x7995('0x40')]},'raw':!![]})[_0x7995('0x19')](function(_0x599ecb){if(_0x599ecb&&_0x599ecb[_0x7995('0x41')]===0x0){return db[_0x7995('0x24')][_0x7995('0x3a')]({'name':_0x3f8522[_0x7995('0x23')],'resourceId':_0x3f8522['id'],'type':_0x599ecb['name'],'sectionId':_0x599ecb['id']},{})['then'](function(){return _0x7b4e67;});}else{return _0x7b4e67;}})[_0x7995('0x2e')](function(_0x55791b){logger[_0x7995('0x42')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55791b);throw _0x55791b;});}return _0x7b4e67;})[_0x7995('0x19')](respondWithResult(_0x270c0e,0xc9))['catch'](handleError(_0x270c0e,null));};exports[_0x7995('0x43')]=function(_0x1b0373,_0x4d9245){var _0x3e9e62={'where':{'id':_0x1b0373[_0x7995('0x30')]['id']}},_0x336ff2={};_0x336ff2[_0x7995('0x31')]=_['keys'](db[_0x7995('0x39')][_0x7995('0x32')]);_0x3e9e62[_0x7995('0x34')]=_['intersection'](_0x336ff2[_0x7995('0x31')],qs[_0x7995('0x36')](_0x1b0373[_0x7995('0x2c')][_0x7995('0x36')]));_0x3e9e62[_0x7995('0x34')]=_0x3e9e62['attributes'][_0x7995('0x44')]?_0x3e9e62[_0x7995('0x34')]:_0x336ff2['model'];if(_0x1b0373[_0x7995('0x2c')]['includeAll']){_0x3e9e62[_0x7995('0x2b')]=[{'all':!![]}];}_0x3e9e62=_[_0x7995('0x38')]({},_0x3e9e62,_0x1b0373[_0x7995('0x45')]);return db[_0x7995('0x39')][_0x7995('0x21')](_0x3e9e62)[_0x7995('0x19')](handleEntityNotFound(_0x4d9245,null))[_0x7995('0x19')](function(_0x4d46bc){if(_0x4d46bc){var _0x427dcf=_0x4d46bc[_0x7995('0x3c')]({'plain':!![]});_0x427dcf=qs[_0x7995('0x46')](_0x427dcf,['id','createdAt',_0x7995('0x47')]);_0x1b0373[_0x7995('0x3b')]=_[_0x7995('0x46')](_0x1b0373['body'],['id','createdAt','updatedAt']);return db[_0x7995('0x39')][_0x7995('0x3a')](_['merge'](_0x427dcf,_0x1b0373[_0x7995('0x3b')]),{'include':_0x1b0373[_0x7995('0x2c')][_0x7995('0x37')]?[{'all':!![]}]:undefined})[_0x7995('0x19')](function(_0xc04004){var _0x528c8e=_0x1b0373[_0x7995('0x48')]['get']({'plain':!![]});if(!_0x528c8e)throw new Error(_0x7995('0x3d'));if(_0x528c8e[_0x7995('0x49')]===_0x7995('0x48')){var _0x50c7b5=_0xc04004['get']({'plain':!![]});var _0x54e2b1=[{'name':'VoiceQueues','value':_0x7995('0x3e')},{'name':_0x7995('0x1b'),'value':_0x7995('0x4a')}];var _0x150261=_[_0x7995('0x21')](_0x54e2b1,[_0x7995('0x1f'),_0x50c7b5[_0x7995('0x22')]])[_0x7995('0x23')];return db[_0x7995('0x3f')][_0x7995('0x21')]({'where':{'name':_0x150261,'userProfileId':_0x528c8e[_0x7995('0x40')]},'raw':!![]})[_0x7995('0x19')](function(_0x3da72b){if(_0x3da72b&&_0x3da72b[_0x7995('0x41')]===0x0){return db[_0x7995('0x24')][_0x7995('0x3a')]({'name':_0x50c7b5[_0x7995('0x23')],'resourceId':_0x50c7b5['id'],'type':_0x3da72b[_0x7995('0x23')],'sectionId':_0x3da72b['id']},{})[_0x7995('0x19')](function(){return _0xc04004;});}else{return _0xc04004;}})['catch'](function(_0x56a374){logger[_0x7995('0x42')](_0x7995('0x4b'),_0x56a374);throw _0x56a374;});}return _0xc04004;});}})[_0x7995('0x19')](respondWithResult(_0x4d9245,0xc9))['catch'](handleError(_0x4d9245,null));};exports['update']=function(_0x402fa0,_0x197b52){if(_0x402fa0[_0x7995('0x3b')]['id']){delete _0x402fa0[_0x7995('0x3b')]['id'];}return db['VoiceQueue'][_0x7995('0x21')]({'where':{'id':_0x402fa0[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x197b52,null))[_0x7995('0x19')](saveUpdates(_0x402fa0['body'],null))['then'](respondWithResult(_0x197b52,null))[_0x7995('0x2e')](handleError(_0x197b52,null));};exports[_0x7995('0x25')]=function(_0x6c0221,_0x1d69ce){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x6c0221[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x1d69ce,null))[_0x7995('0x19')](removeEntity(_0x1d69ce,null))['catch'](handleError(_0x1d69ce,null));};exports[_0x7995('0x4c')]=function(_0x3ec5a8,_0xdf9e38){var _0x1ecfdb={'raw':![],'where':{}};var _0x59c5aa={};var _0x51bf6a={'count':0x0,'rows':[]};return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x3ec5a8['params']['id']}})[_0x7995('0x19')](handleEntityNotFound(_0xdf9e38,null))[_0x7995('0x19')](function(_0x2e3421){if(_0x2e3421){_0x59c5aa[_0x7995('0x31')]=_[_0x7995('0x4e')](db['CmHopper'][_0x7995('0x32')]);_0x59c5aa['query']=_[_0x7995('0x4e')](_0x3ec5a8[_0x7995('0x2c')]);_0x59c5aa[_0x7995('0x33')]=_[_0x7995('0x35')](_0x59c5aa[_0x7995('0x31')],_0x59c5aa[_0x7995('0x2c')]);_0x1ecfdb[_0x7995('0x34')]=_[_0x7995('0x35')](_0x59c5aa[_0x7995('0x31')],qs[_0x7995('0x36')](_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x36')]));_0x1ecfdb['attributes']=_0x1ecfdb[_0x7995('0x34')][_0x7995('0x44')]?_0x1ecfdb[_0x7995('0x34')]:_0x59c5aa[_0x7995('0x31')];if(!_0x3ec5a8[_0x7995('0x2c')]['hasOwnProperty']('nolimit')){_0x1ecfdb[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x15')]);_0x1ecfdb['offset']=qs[_0x7995('0x13')](_0x3ec5a8['query']['offset']);}_0x1ecfdb[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x50')]);_0x1ecfdb[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x3ec5a8[_0x7995('0x2c')],_0x59c5aa[_0x7995('0x33')]));_0x1ecfdb[_0x7995('0x51')]['VoiceQueueId']=_0x2e3421['id'];if(_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x1c')]){_0x1ecfdb[_0x7995('0x51')]=_['merge'](_0x1ecfdb[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x1ecfdb[_0x7995('0x34')],function(_0x3a7d9d){var _0x3b0d30={};_0x3b0d30[_0x3a7d9d]={'$like':'%'+_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x3b0d30;})});}_0x1ecfdb=_[_0x7995('0x38')]({},_0x1ecfdb,_0x3ec5a8[_0x7995('0x45')]);return db[_0x7995('0x53')][_0x7995('0x16')]({'where':_0x1ecfdb['where']})['then'](function(_0xd07c1c){_0x51bf6a[_0x7995('0x16')]=_0xd07c1c;if(_0x3ec5a8[_0x7995('0x2c')][_0x7995('0x37')]){_0x1ecfdb['include']=[{'all':!![]}];}return db[_0x7995('0x53')][_0x7995('0x2d')](_0x1ecfdb);})['then'](function(_0x480fdb){_0x51bf6a[_0x7995('0x54')]=_0x480fdb;return _0x51bf6a;});}})[_0x7995('0x19')](respondWithFilteredResult(_0xdf9e38,_0x1ecfdb))['catch'](handleError(_0xdf9e38,null));};exports[_0x7995('0x55')]=function(_0x5b1cba,_0x3758f9){var _0xea9aba={'raw':!![],'where':{}};var _0x4ff9ff={};var _0x5d9d33={'count':0x0,'rows':[]};return db[_0x7995('0x39')]['findOne']({'where':{'id':_0x5b1cba[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x3758f9,null))[_0x7995('0x19')](function(_0x45bd8a){if(_0x45bd8a){_0x4ff9ff[_0x7995('0x31')]=_[_0x7995('0x4e')](db[_0x7995('0x56')][_0x7995('0x32')]);_0x4ff9ff[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x5b1cba[_0x7995('0x2c')]);_0x4ff9ff[_0x7995('0x33')]=_[_0x7995('0x35')](_0x4ff9ff[_0x7995('0x31')],_0x4ff9ff[_0x7995('0x2c')]);_0xea9aba[_0x7995('0x34')]=_[_0x7995('0x35')](_0x4ff9ff[_0x7995('0x31')],qs[_0x7995('0x36')](_0x5b1cba[_0x7995('0x2c')][_0x7995('0x36')]));_0xea9aba[_0x7995('0x34')]=_0xea9aba[_0x7995('0x34')][_0x7995('0x44')]?_0xea9aba[_0x7995('0x34')]:_0x4ff9ff[_0x7995('0x31')];if(!_0x5b1cba[_0x7995('0x2c')][_0x7995('0x57')]('nolimit')){_0xea9aba[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x5b1cba['query']['limit']);_0xea9aba[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x5b1cba[_0x7995('0x2c')][_0x7995('0x13')]);}_0xea9aba[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x5b1cba['query'][_0x7995('0x50')]);_0xea9aba[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x5b1cba[_0x7995('0x2c')],_0x4ff9ff[_0x7995('0x33')]));_0xea9aba[_0x7995('0x51')][_0x7995('0x58')]=_0x45bd8a['id'];if(_0x5b1cba['query'][_0x7995('0x1c')]){_0xea9aba[_0x7995('0x51')]=_['merge'](_0xea9aba['where'],{'$or':_[_0x7995('0x1e')](_0xea9aba[_0x7995('0x34')],function(_0x18e1a2){var _0x3db7a9={};_0x3db7a9[_0x18e1a2]={'$like':'%'+_0x5b1cba[_0x7995('0x2c')]['filter']+'%'};return _0x3db7a9;})});}_0xea9aba=_[_0x7995('0x38')]({},_0xea9aba,_0x5b1cba[_0x7995('0x45')]);return db['CmHopperHistory'][_0x7995('0x16')]({'where':_0xea9aba[_0x7995('0x51')]})['then'](function(_0x1535a3){_0x5d9d33['count']=_0x1535a3;if(_0x5b1cba[_0x7995('0x2c')][_0x7995('0x37')]){_0xea9aba[_0x7995('0x2b')]=[{'all':!![]}];}return db[_0x7995('0x56')][_0x7995('0x2d')](_0xea9aba);})['then'](function(_0x1f0506){_0x5d9d33[_0x7995('0x54')]=_0x1f0506;return _0x5d9d33;});}})[_0x7995('0x19')](respondWithFilteredResult(_0x3758f9,_0xea9aba))['catch'](handleError(_0x3758f9,null));};exports[_0x7995('0x59')]=function(_0x3f3434,_0x350ed3){var _0x308a26={'raw':!![],'where':{}};var _0x5d7018={};var _0x3356fd={'count':0x0,'rows':[]};return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x3f3434['params']['id']}})['then'](handleEntityNotFound(_0x350ed3,null))[_0x7995('0x19')](function(_0x333379){if(_0x333379){_0x5d7018['model']=_['keys'](db[_0x7995('0x5a')][_0x7995('0x32')]);_0x5d7018[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x3f3434[_0x7995('0x2c')]);_0x5d7018['filters']=_['intersection'](_0x5d7018[_0x7995('0x31')],_0x5d7018['query']);_0x308a26['attributes']=_[_0x7995('0x35')](_0x5d7018[_0x7995('0x31')],qs[_0x7995('0x36')](_0x3f3434['query'][_0x7995('0x36')]));_0x308a26[_0x7995('0x34')]=_0x308a26[_0x7995('0x34')][_0x7995('0x44')]?_0x308a26[_0x7995('0x34')]:_0x5d7018['model'];if(!_0x3f3434[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0x308a26[_0x7995('0x15')]=qs['limit'](_0x3f3434[_0x7995('0x2c')][_0x7995('0x15')]);_0x308a26['offset']=qs[_0x7995('0x13')](_0x3f3434[_0x7995('0x2c')]['offset']);}_0x308a26[_0x7995('0x4f')]=qs['sort'](_0x3f3434[_0x7995('0x2c')]['sort']);_0x308a26[_0x7995('0x51')]=qs['filters'](_[_0x7995('0x52')](_0x3f3434[_0x7995('0x2c')],_0x5d7018['filters']));_0x308a26[_0x7995('0x51')]['VoiceQueueId']=_0x333379['id'];if(_0x3f3434['query'][_0x7995('0x1c')]){_0x308a26[_0x7995('0x51')]=_[_0x7995('0x38')](_0x308a26[_0x7995('0x51')],{'$or':_['map'](_0x308a26[_0x7995('0x34')],function(_0x35044a){var _0x4bd29f={};_0x4bd29f[_0x35044a]={'$like':'%'+_0x3f3434['query'][_0x7995('0x1c')]+'%'};return _0x4bd29f;})});}_0x308a26=_['merge']({},_0x308a26,_0x3f3434[_0x7995('0x45')]);return db[_0x7995('0x5a')][_0x7995('0x16')]({'where':_0x308a26['where']})['then'](function(_0x2b7852){_0x3356fd['count']=_0x2b7852;if(_0x3f3434[_0x7995('0x2c')][_0x7995('0x37')]){_0x308a26[_0x7995('0x2b')]=[{'all':!![]}];}return db[_0x7995('0x5a')]['findAll'](_0x308a26);})['then'](function(_0x50f880){_0x3356fd[_0x7995('0x54')]=_0x50f880;return _0x3356fd;});}})[_0x7995('0x19')](respondWithFilteredResult(_0x350ed3,_0x308a26))[_0x7995('0x2e')](handleError(_0x350ed3,null));};exports[_0x7995('0x5c')]=function(_0x265f07,_0x168e7f){var _0x59a793={'raw':!![],'where':{}};var _0x53cbec={};var _0x1a2902={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x265f07[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x168e7f,null))['then'](function(_0x35c3f3){if(_0x35c3f3){_0x53cbec[_0x7995('0x31')]=_[_0x7995('0x4e')](db['CmHopperBlack'][_0x7995('0x32')]);_0x53cbec[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x265f07[_0x7995('0x2c')]);_0x53cbec[_0x7995('0x33')]=_[_0x7995('0x35')](_0x53cbec[_0x7995('0x31')],_0x53cbec[_0x7995('0x2c')]);_0x59a793[_0x7995('0x34')]=_['intersection'](_0x53cbec[_0x7995('0x31')],qs[_0x7995('0x36')](_0x265f07[_0x7995('0x2c')][_0x7995('0x36')]));_0x59a793[_0x7995('0x34')]=_0x59a793['attributes'][_0x7995('0x44')]?_0x59a793[_0x7995('0x34')]:_0x53cbec[_0x7995('0x31')];if(!_0x265f07['query']['hasOwnProperty']('nolimit')){_0x59a793[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x265f07[_0x7995('0x2c')][_0x7995('0x15')]);_0x59a793[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x265f07['query'][_0x7995('0x13')]);}_0x59a793['order']=qs[_0x7995('0x50')](_0x265f07[_0x7995('0x2c')][_0x7995('0x50')]);_0x59a793[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x265f07[_0x7995('0x2c')],_0x53cbec[_0x7995('0x33')]));_0x59a793[_0x7995('0x51')][_0x7995('0x58')]=_0x35c3f3['id'];if(_0x265f07[_0x7995('0x2c')]['filter']){_0x59a793[_0x7995('0x51')]=_['merge'](_0x59a793[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x59a793['attributes'],function(_0x493e74){var _0x2a25eb={};_0x2a25eb[_0x493e74]={'$like':'%'+_0x265f07[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x2a25eb;})});}_0x59a793=_[_0x7995('0x38')]({},_0x59a793,_0x265f07[_0x7995('0x45')]);return db[_0x7995('0x5d')][_0x7995('0x16')]({'where':_0x59a793[_0x7995('0x51')]})[_0x7995('0x19')](function(_0x3c9b3c){_0x1a2902[_0x7995('0x16')]=_0x3c9b3c;if(_0x265f07[_0x7995('0x2c')]['includeAll']){_0x59a793['include']=[{'all':!![]}];}return db[_0x7995('0x5d')][_0x7995('0x2d')](_0x59a793);})[_0x7995('0x19')](function(_0x1531a9){_0x1a2902[_0x7995('0x54')]=_0x1531a9;return _0x1a2902;});}})['then'](respondWithFilteredResult(_0x168e7f,_0x59a793))[_0x7995('0x2e')](handleError(_0x168e7f,null));};exports[_0x7995('0x5e')]=function(_0x5ebf5e,_0x46fc1c){var _0x53d693={};var _0x37416c={};var _0x30cda5;var _0x234a40;return db['VoiceQueue'][_0x7995('0x4d')]({'where':{'id':_0x5ebf5e[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x46fc1c,null))[_0x7995('0x19')](function(_0x11f9fb){if(_0x11f9fb){_0x30cda5=_0x11f9fb;_0x37416c[_0x7995('0x31')]=_[_0x7995('0x4e')](db['Team']['rawAttributes']);_0x37416c['query']=_[_0x7995('0x4e')](_0x5ebf5e[_0x7995('0x2c')]);_0x37416c['filters']=_['intersection'](_0x37416c[_0x7995('0x31')],_0x37416c[_0x7995('0x2c')]);_0x53d693['attributes']=_['intersection'](_0x37416c['model'],qs['fields'](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x36')]));_0x53d693[_0x7995('0x34')]=_0x53d693[_0x7995('0x34')]['length']?_0x53d693[_0x7995('0x34')]:_0x37416c[_0x7995('0x31')];_0x53d693['order']=qs[_0x7995('0x50')](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x50')]);_0x53d693['where']=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x5ebf5e['query'],_0x37416c[_0x7995('0x33')]));if(_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x1c')]){_0x53d693[_0x7995('0x51')]=_[_0x7995('0x38')](_0x53d693[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x53d693[_0x7995('0x34')],function(_0x4254de){var _0x278004={};_0x278004[_0x4254de]={'$like':'%'+_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x278004;})});}_0x53d693=_[_0x7995('0x38')]({},_0x53d693,_0x5ebf5e['options']);return _0x30cda5[_0x7995('0x5e')](_0x53d693);}})[_0x7995('0x19')](function(_0x3603e8){if(_0x3603e8){_0x234a40=_0x3603e8[_0x7995('0x44')];if(!_0x5ebf5e['query'][_0x7995('0x57')](_0x7995('0x5b'))){_0x53d693[_0x7995('0x15')]=qs['limit'](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x15')]);_0x53d693[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x5ebf5e[_0x7995('0x2c')][_0x7995('0x13')]);}return _0x30cda5[_0x7995('0x5e')](_0x53d693);}})['then'](function(_0x35dbd7){if(_0x35dbd7){return _0x35dbd7?{'count':_0x234a40,'rows':_0x35dbd7}:null;}})['then'](respondWithResult(_0x46fc1c,null))[_0x7995('0x2e')](handleError(_0x46fc1c,null));};exports[_0x7995('0x5f')]=function(_0x2190d1,_0x4cae1c){var _0xd012b9=_0x2190d1['body']['teams'];var _0x4ee5ee=_['map'](_0xd012b9,'id');return db[_0x7995('0x60')][_0x7995('0x2d')]({'where':{'id':_0x4ee5ee},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7995('0x61'),'attributes':['id',_0x7995('0x23'),'online',_0x7995('0x62'),_0x7995('0x63')],'raw':!![]}]})[_0x7995('0x19')](function(_0x45a479){if(_0x45a479){var _0x443863=_['flatMap'](_0x45a479,function(_0x38ea3e){var _0x1df81d=_0x38ea3e[_0x7995('0x3c')]({'plain':!![]});_0x1df81d[_0x7995('0x61')]['forEach'](function(_0x428d5a){_0x428d5a[_0x7995('0x64')]=_[_0x7995('0x21')](_0xd012b9,{'id':_0x1df81d['id']})[_0x7995('0x64')];});return _0x1df81d[_0x7995('0x61')];});return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x2190d1[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(_0x1fda95){return db['sequelize'][_0x7995('0x65')](function(_0x521712){return _0x1fda95[_0x7995('0x5f')](_0x4ee5ee,{'transaction':_0x521712})[_0x7995('0x19')](function(){return BPromise[_0x7995('0x66')](_0xd012b9,function(_0x50eb5e){return db['TeamVoiceQueue'][_0x7995('0x67')]({'TeamId':_0x50eb5e['id'],'VoiceQueueId':_0x2190d1[_0x7995('0x30')]['id'],'penalty':_0x50eb5e['penalty']},{'transaction':_0x521712});});})[_0x7995('0x19')](function(){return BPromise['each'](_0x443863,function(_0x43de18){return db[_0x7995('0x68')][_0x7995('0x69')]({'where':{'UserId':_0x43de18['id'],'VoiceQueueId':_0x2190d1[_0x7995('0x30')]['id']},'defaults':{'penalty':_0x43de18['penalty']},'transaction':_0x521712});});})['then'](function(){return BPromise[_0x7995('0x66')](_[_0x7995('0x1c')](_0x443863,{'online':!![]}),function(_0x365318){return db[_0x7995('0x6a')]['upsert']({'membername':_0x365318[_0x7995('0x23')],'UserId':_0x365318['id'],'queue_name':_0x1fda95[_0x7995('0x23')],'VoiceQueueId':_0x1fda95['id'],'interface':_[_0x7995('0x6b')](_0x365318[_0x7995('0x63')])?util[_0x7995('0x6c')]('SIP/%s',_0x365318['name']):_0x365318['interface'],'paused':_0x365318[_0x7995('0x62')]||![],'penalty':_0x365318[_0x7995('0x64')]},{'transaction':_0x521712});});})['then'](function(){_0x443863[_0x7995('0x6d')](function(_0x5635d6){socket[_0x7995('0x6e')](_0x7995('0x6f'),{'UserId':_0x5635d6['id'],'VoiceQueueId':_0x1fda95['id']});});});});});}})[_0x7995('0x19')](respondWithStatusCode(_0x4cae1c,null))[_0x7995('0x2e')](handleError(_0x4cae1c,null));};exports['removeTeams']=function(_0x3fbafb,_0x2caacd){return db[_0x7995('0x60')][_0x7995('0x2d')]({'where':{'id':_0x3fbafb[_0x7995('0x2c')][_0x7995('0x70')]},'attributes':['id'],'include':[{'model':db[_0x7995('0x71')],'as':_0x7995('0x61'),'attributes':['id'],'raw':!![]}]})[_0x7995('0x19')](handleEntityNotFound(_0x2caacd,null))[_0x7995('0x19')](function(_0x30893a){var _0x2b8d90=_[_0x7995('0x1e')](_0x30893a,'id');var _0x2122af=[];var _0x4ff0b6=[];var _0x764245=squel['select']();_0x764245[_0x7995('0x72')](_0x7995('0x73'))['from'](_0x7995('0x74'),'tq')['join'](_0x7995('0x75'),'ut',_0x7995('0x76'))['where']('VoiceQueueId\x20=\x20?',_0x3fbafb['params']['id']);for(var _0x8f5ecd=0x0;_0x8f5ecd<_0x30893a[_0x7995('0x44')];_0x8f5ecd+=0x1){let _0x139f76=_0x30893a[_0x8f5ecd];for(var _0x2b7bc2=0x0;_0x2b7bc2<_0x139f76['Agents'][_0x7995('0x44')];_0x2b7bc2+=0x1){let _0x2b2814=_0x139f76[_0x7995('0x61')][_0x2b7bc2];var _0x2de960=_0x764245[_0x7995('0x43')]();_0x2de960[_0x7995('0x51')](_0x7995('0x77'),_0x2b2814['id']);_0x4ff0b6[_0x7995('0x78')](db['sequelize'][_0x7995('0x2c')](_0x2de960[_0x7995('0x79')](),{'type':db[_0x7995('0x7a')][_0x7995('0x7b')]['SELECT']})[_0x7995('0x19')](function(_0x3a2958){if(_0x3a2958[_0x7995('0x44')]===0x1){return _0x2b2814['id'];}else{var _0x339e6b=_[_0x7995('0x7c')](_[_0x7995('0x1e')](_0x3a2958,'TeamId'),function(_0x1bc617){return _[_0x7995('0x20')](_0x2b8d90,_0x1bc617);});if(_0x339e6b){return _0x2b2814['id'];}}}));}}return BPromise[_0x7995('0x7d')](_0x4ff0b6)[_0x7995('0x19')](function(_0x3fcc49){_0x2122af=_(_0x2122af)[_0x7995('0x7e')](_0x3fcc49)[_0x7995('0x7f')]()[_0x7995('0x1f')]();return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x3fbafb[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(_0x64a62d){return db[_0x7995('0x7a')][_0x7995('0x65')](function(_0x370984){return _0x64a62d[_0x7995('0x80')](_0x3fbafb[_0x7995('0x2c')][_0x7995('0x70')],{'transaction':_0x370984})[_0x7995('0x19')](function(){if(!_[_0x7995('0x81')](_0x2122af)){return _0x64a62d['removeAgents'](_0x2122af,{'transaction':_0x370984})['then'](function(){return db[_0x7995('0x6a')][_0x7995('0x25')]({'where':{'VoiceQueueId':_0x3fbafb['params']['id'],'UserId':_0x2122af},'transaction':_0x370984});});}})[_0x7995('0x19')](function(){_0x2122af['forEach'](function(_0x2ce103){socket['emit'](_0x7995('0x82'),{'UserId':_0x2ce103,'VoiceQueueId':_0x64a62d['id']});});});});});});})[_0x7995('0x19')](respondWithStatusCode(_0x2caacd,null))[_0x7995('0x2e')](handleError(_0x2caacd,null));};exports[_0x7995('0x83')]=function(_0x3aa676,_0x1df2a2){var _0xd82313,_0x1fa59d;return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x3aa676['params']['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x1df2a2,null))[_0x7995('0x19')](function(_0x1d0481){if(_0x1d0481){_0x1fa59d=_0x1d0481;return _0x1d0481[_0x7995('0x83')](_0x3aa676['body'][_0x7995('0x70')],_[_0x7995('0x46')](_0x3aa676[_0x7995('0x3b')],[_0x7995('0x70'),'id'])||{})['spread'](function(_0x32c550){for(var _0x37e647=0x0;_0x37e647<_0x3aa676[_0x7995('0x3b')][_0x7995('0x70')][_0x7995('0x44')];_0x37e647+=0x1){socket[_0x7995('0x6e')](_0x7995('0x6f'),{'UserId':Number(_0x3aa676[_0x7995('0x3b')][_0x7995('0x70')][_0x37e647]),'VoiceQueueId':Number(_0x3aa676['params']['id'])});}return _0x32c550;});}})[_0x7995('0x19')](function(_0x5f5496){_0xd82313=_0x5f5496||[];if(_0x1fa59d){return db[_0x7995('0x71')][_0x7995('0x2d')]({'where':{'id':_0x3aa676[_0x7995('0x3b')][_0x7995('0x70')]},'attributes':['id','name',_0x7995('0x84'),_0x7995('0x62'),_0x7995('0x63')],'raw':!![]});}})[_0x7995('0x19')](function(_0x2c715){if(!_[_0x7995('0x81')](_0x2c715)){var _0x3661ab=[];for(var _0x408692=0x0;_0x408692<_0x2c715[_0x7995('0x44')];_0x408692++){if(_0x2c715[_0x408692][_0x7995('0x84')]){_0x3661ab[_0x7995('0x78')](db[_0x7995('0x6a')][_0x7995('0x67')]({'membername':_0x2c715[_0x408692][_0x7995('0x23')],'UserId':_0x2c715[_0x408692]['id'],'queue_name':_0x1fa59d['name'],'VoiceQueueId':_0x1fa59d['id'],'interface':_['isNil'](_0x2c715[_0x408692][_0x7995('0x63')])?util[_0x7995('0x6c')](_0x7995('0x85'),_0x2c715[_0x408692]['name']):_0x2c715[_0x408692][_0x7995('0x63')],'paused':_0x2c715[_0x408692][_0x7995('0x62')]||![],'penalty':_0x3aa676[_0x7995('0x3b')]['penalty']||0x0}));}}return BPromise[_0x7995('0x7d')](_0x3661ab);}})[_0x7995('0x19')](function(){return _0xd82313;})[_0x7995('0x19')](respondWithResult(_0x1df2a2,null))[_0x7995('0x2e')](handleError(_0x1df2a2,null));};exports[_0x7995('0x86')]=function(_0x3d42a3,_0x29fb77){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x3d42a3[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x29fb77,null))['then'](function(_0x580571){if(_0x580571){return _0x580571[_0x7995('0x86')](_0x3d42a3['query'][_0x7995('0x70')])[_0x7995('0x19')](function(){if(_[_0x7995('0x87')](_0x3d42a3[_0x7995('0x2c')][_0x7995('0x70')])){for(var _0x4eebf4=0x0;_0x4eebf4<_0x3d42a3['query'][_0x7995('0x70')][_0x7995('0x44')];_0x4eebf4+=0x1){socket[_0x7995('0x6e')](_0x7995('0x82'),{'UserId':Number(_0x3d42a3[_0x7995('0x2c')][_0x7995('0x70')][_0x4eebf4]),'VoiceQueueId':Number(_0x3d42a3[_0x7995('0x30')]['id'])});}}else{socket[_0x7995('0x6e')](_0x7995('0x82'),{'UserId':Number(_0x3d42a3[_0x7995('0x2c')]['ids']),'VoiceQueueId':Number(_0x3d42a3[_0x7995('0x30')]['id'])});}});}})[_0x7995('0x19')](function(_0x38e67a){return db[_0x7995('0x6a')]['destroy']({'where':{'VoiceQueueId':_0x3d42a3['params']['id'],'UserId':_0x3d42a3['query']['ids']}})['then'](function(){return _0x38e67a;});})[_0x7995('0x19')](respondWithStatusCode(_0x29fb77,null))['catch'](handleError(_0x29fb77,null));};exports['getAgents']=function(_0x32f19d,_0x44dbb8){var _0x181ed6={};var _0x48b807={};var _0xba00af;var _0x4f008a;return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x32f19d[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x44dbb8,null))[_0x7995('0x19')](function(_0x14be06){if(_0x14be06){_0xba00af=_0x14be06;_0x48b807[_0x7995('0x31')]=_['keys'](db[_0x7995('0x71')][_0x7995('0x32')]);_0x48b807[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x32f19d[_0x7995('0x2c')]);_0x48b807['filters']=_[_0x7995('0x35')](_0x48b807[_0x7995('0x31')],_0x48b807[_0x7995('0x2c')]);_0x181ed6['attributes']=_[_0x7995('0x35')](_0x48b807[_0x7995('0x31')],qs[_0x7995('0x36')](_0x32f19d[_0x7995('0x2c')][_0x7995('0x36')]));_0x181ed6['attributes']=_0x181ed6[_0x7995('0x34')][_0x7995('0x44')]?_0x181ed6[_0x7995('0x34')]:_0x48b807[_0x7995('0x31')];_0x181ed6[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x32f19d[_0x7995('0x2c')]['sort']);_0x181ed6['where']=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x32f19d['query'],_0x48b807['filters']));if(_0x32f19d[_0x7995('0x2c')][_0x7995('0x1c')]){_0x181ed6[_0x7995('0x51')]=_[_0x7995('0x38')](_0x181ed6[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x181ed6[_0x7995('0x34')],function(_0x4dca11){var _0xf90cd8={};_0xf90cd8[_0x4dca11]={'$like':'%'+_0x32f19d[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0xf90cd8;})});}_0x181ed6=_[_0x7995('0x38')]({},_0x181ed6,_0x32f19d[_0x7995('0x45')]);return _0xba00af[_0x7995('0x88')](_0x181ed6);}})['then'](function(_0x1d7c33){if(_0x1d7c33){_0x4f008a=_0x1d7c33[_0x7995('0x44')];if(!_0x32f19d[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0x181ed6[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x32f19d['query'][_0x7995('0x15')]);_0x181ed6[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x32f19d[_0x7995('0x2c')]['offset']);}return _0xba00af[_0x7995('0x88')](_0x181ed6);}})['then'](function(_0x21ba9b){if(_0x21ba9b){return _0x21ba9b?{'count':_0x4f008a,'rows':_0x21ba9b}:null;}})[_0x7995('0x19')](respondWithResult(_0x44dbb8,null))['catch'](handleError(_0x44dbb8,null));};exports['getMembers']=function(_0x478c12,_0x3b22ec){var _0xf503d5={};var _0x7d2ccf={};var _0x18a3dc;var _0x503b32;return db[_0x7995('0x39')][_0x7995('0x4d')]({'where':{'id':_0x478c12[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x3b22ec,null))[_0x7995('0x19')](function(_0x1fa484){if(_0x1fa484){_0x18a3dc=_0x1fa484;_0x7d2ccf[_0x7995('0x31')]=_['keys'](db['UserVoiceQueueRt'][_0x7995('0x32')]);_0x7d2ccf['query']=_['keys'](_0x478c12[_0x7995('0x2c')]);_0x7d2ccf[_0x7995('0x33')]=_[_0x7995('0x35')](_0x7d2ccf[_0x7995('0x31')],_0x7d2ccf[_0x7995('0x2c')]);_0xf503d5[_0x7995('0x34')]=_[_0x7995('0x35')](_0x7d2ccf[_0x7995('0x31')],qs[_0x7995('0x36')](_0x478c12[_0x7995('0x2c')][_0x7995('0x36')]));_0xf503d5[_0x7995('0x34')]=_0xf503d5['attributes'][_0x7995('0x44')]?_0xf503d5[_0x7995('0x34')]:_0x7d2ccf[_0x7995('0x31')];_0xf503d5[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x478c12[_0x7995('0x2c')][_0x7995('0x50')]);_0xf503d5['where']=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x478c12[_0x7995('0x2c')],_0x7d2ccf[_0x7995('0x33')]));if(_0x478c12[_0x7995('0x2c')]['filter']){_0xf503d5[_0x7995('0x51')]=_['merge'](_0xf503d5[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0xf503d5[_0x7995('0x34')],function(_0x5150aa){var _0x260e84={};_0x260e84[_0x5150aa]={'$like':'%'+_0x478c12[_0x7995('0x2c')][_0x7995('0x1c')]+'%'};return _0x260e84;})});}_0xf503d5=_[_0x7995('0x38')]({},_0xf503d5,_0x478c12[_0x7995('0x45')]);return _0x18a3dc[_0x7995('0x89')](_0xf503d5);}})[_0x7995('0x19')](function(_0x4fb899){if(_0x4fb899){_0x503b32=_0x4fb899['length'];if(!_0x478c12[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0xf503d5[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x478c12[_0x7995('0x2c')]['limit']);_0xf503d5[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x478c12[_0x7995('0x2c')][_0x7995('0x13')]);}return _0x18a3dc['getMembers'](_0xf503d5);}})['then'](function(_0x5b93e6){return _0x5b93e6?{'count':_0x503b32,'rows':_0x5b93e6}:null;})[_0x7995('0x19')](respondWithResult(_0x3b22ec,null))['catch'](handleError(_0x3b22ec,null));};exports[_0x7995('0x8a')]=function(_0x1b6411,_0x54e348){var _0x390bd3={};var _0x3f0a01={};var _0x45d8a2;var _0x26ab59;return db[_0x7995('0x39')]['findOne']({'where':{'id':_0x1b6411['params']['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x54e348,null))[_0x7995('0x19')](function(_0x2cfa1d){if(_0x2cfa1d){_0x45d8a2=_0x2cfa1d;_0x3f0a01[_0x7995('0x31')]=_[_0x7995('0x4e')](db['CmList'][_0x7995('0x32')]);_0x3f0a01[_0x7995('0x2c')]=_[_0x7995('0x4e')](_0x1b6411[_0x7995('0x2c')]);_0x3f0a01[_0x7995('0x33')]=_['intersection'](_0x3f0a01['model'],_0x3f0a01['query']);_0x390bd3['attributes']=_[_0x7995('0x35')](_0x3f0a01[_0x7995('0x31')],qs['fields'](_0x1b6411[_0x7995('0x2c')][_0x7995('0x36')]));_0x390bd3['attributes']=_0x390bd3['attributes'][_0x7995('0x44')]?_0x390bd3[_0x7995('0x34')]:_0x3f0a01[_0x7995('0x31')];_0x390bd3[_0x7995('0x4f')]=qs[_0x7995('0x50')](_0x1b6411[_0x7995('0x2c')][_0x7995('0x50')]);_0x390bd3['where']=qs['filters'](_[_0x7995('0x52')](_0x1b6411[_0x7995('0x2c')],_0x3f0a01[_0x7995('0x33')]));if(_0x1b6411['query'][_0x7995('0x1c')]){_0x390bd3[_0x7995('0x51')]=_[_0x7995('0x38')](_0x390bd3[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x390bd3[_0x7995('0x34')],function(_0x28ac7c){var _0x1b4cab={};_0x1b4cab[_0x28ac7c]={'$like':'%'+_0x1b6411[_0x7995('0x2c')]['filter']+'%'};return _0x1b4cab;})});}_0x390bd3=_['merge']({},_0x390bd3,_0x1b6411[_0x7995('0x45')]);return _0x45d8a2['getLists'](_0x390bd3);}})[_0x7995('0x19')](function(_0x5953d1){if(_0x5953d1){_0x26ab59=_0x5953d1[_0x7995('0x44')];if(!_0x1b6411[_0x7995('0x2c')][_0x7995('0x57')]('nolimit')){_0x390bd3['limit']=qs[_0x7995('0x15')](_0x1b6411[_0x7995('0x2c')][_0x7995('0x15')]);_0x390bd3[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x1b6411[_0x7995('0x2c')][_0x7995('0x13')]);}return _0x45d8a2[_0x7995('0x8a')](_0x390bd3);}})[_0x7995('0x19')](function(_0x35403c){if(_0x35403c){return _0x35403c?{'count':_0x26ab59,'rows':_0x35403c}:null;}})[_0x7995('0x19')](respondWithResult(_0x54e348,null))['catch'](handleError(_0x54e348,null));};exports[_0x7995('0x8b')]=function(_0xe43c99,_0x1b7e44){var _0x442c6d=moment()[_0x7995('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3b5edf,_0x44068f;return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0xe43c99[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x1b7e44,null))[_0x7995('0x19')](function(_0x2b812f){if(_0x2b812f){_0x44068f=_0x2b812f;return _0x2b812f[_0x7995('0x8b')](_0xe43c99['body']['ids'],_[_0x7995('0x46')](_0xe43c99[_0x7995('0x3b')],[_0x7995('0x70'),'id'])||{});}return null;})[_0x7995('0x8c')](function(_0x17fd98){var _0x498d7c;_0x3b5edf=_0x17fd98||[];var _0x341024=[];if(_0x17fd98){for(var _0x2bcbc6=0x0;_0x2bcbc6<_0x17fd98[_0x7995('0x44')];_0x2bcbc6+=0x1){var _0x2dd6c7=_0x17fd98[_0x2bcbc6][_0x7995('0x3c')]({'plain':!![]});_0x44068f[_0x7995('0x8d')]=_0xe43c99[_0x7995('0x3b')][_0x7995('0x8d')]?_0xe43c99[_0x7995('0x3b')]['dialCheckDuplicateType']:_0x44068f['dialCheckDuplicateType'];switch(_0x44068f[_0x7995('0x8d')]){case _0x7995('0x8e'):_0x498d7c=squel[_0x7995('0x8f')]()[_0x7995('0x90')](_0x7995('0x91'))[_0x7995('0x92')]([_0x7995('0x93'),_0x7995('0x94'),'ContactId','ListId',_0x7995('0x58'),_0x7995('0x95'),_0x7995('0x47')],squel[_0x7995('0x96')]()['field']('phone',_0x7995('0x93'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x94'))[_0x7995('0x72')]('id',_0x7995('0x97'))[_0x7995('0x72')](_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')](),_0x7995('0x99'))[_0x7995('0x72')](_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')](),'VoiceQueueId')['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x95'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))[_0x7995('0x9a')]('cm_contacts')[_0x7995('0x51')]('deletedAt\x20IS\x20NULL')[_0x7995('0x51')](_0x7995('0x9b'),_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')]())[_0x7995('0x51')](_0x7995('0x9c'))['where'](_0x7995('0x9d'),squel[_0x7995('0x96')]()[_0x7995('0x72')](_0x7995('0x9e'))['from']('cm_hopper_final')[_0x7995('0x51')](_0x7995('0x9f'),_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')]()))['where'](_0x7995('0x9d'),squel[_0x7995('0x96')]()[_0x7995('0x72')]('COALESCE(phone,\x27\x27)')[_0x7995('0x9a')](_0x7995('0x91'))[_0x7995('0x51')]('VoiceQueueId\x20=\x20?',_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')]())))[_0x7995('0x79')]();break;case _0x7995('0xa0'):_0x498d7c=squel[_0x7995('0x8f')]()[_0x7995('0x90')](_0x7995('0x91'))[_0x7995('0x92')]([_0x7995('0x93'),'scheduledAt',_0x7995('0x97'),_0x7995('0x99'),_0x7995('0x58'),_0x7995('0x95'),'updatedAt'],squel[_0x7995('0x96')]()[_0x7995('0x72')](_0x7995('0x93'),_0x7995('0x93'))['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x94'))[_0x7995('0x72')]('id',_0x7995('0x97'))[_0x7995('0x72')](_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')](),_0x7995('0x99'))['field'](_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')](),_0x7995('0x58'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x95'))['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))['from'](_0x7995('0xa1'))[_0x7995('0x51')](_0x7995('0xa2'))['where']('ListId\x20=\x20?',_0x2dd6c7['CmListId'][_0x7995('0x79')]())[_0x7995('0x51')](_0x7995('0x9c'))[_0x7995('0x51')](_0x7995('0x9d'),squel[_0x7995('0x96')]()['field'](_0x7995('0xa3'))[_0x7995('0x9a')](_0x7995('0x91'))[_0x7995('0x51')]('VoiceQueueId\x20=\x20?',_0xe43c99[_0x7995('0x30')]['id'][_0x7995('0x79')]())))['toString']();break;default:_0x498d7c=squel[_0x7995('0x8f')]()['into'](_0x7995('0x91'))[_0x7995('0x92')]([_0x7995('0x93'),'scheduledAt','ContactId',_0x7995('0x99'),_0x7995('0x58'),_0x7995('0x95'),_0x7995('0x47')],squel[_0x7995('0x96')]()[_0x7995('0x72')](_0x7995('0x93'),_0x7995('0x93'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x94'))[_0x7995('0x72')]('id','ContactId')['field'](_0x2dd6c7[_0x7995('0x98')][_0x7995('0x79')](),_0x7995('0x99'))[_0x7995('0x72')](_0xe43c99['params']['id']['toString'](),_0x7995('0x58'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27','createdAt')['field']('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))[_0x7995('0x9a')](_0x7995('0xa1'))[_0x7995('0x51')](_0x7995('0xa2'))['where'](_0x7995('0x9b'),_0x2dd6c7[_0x7995('0x98')]['toString']())[_0x7995('0x51')](_0x7995('0x9c')))[_0x7995('0x79')]();}_0x341024['push'](db[_0x7995('0x7a')][_0x7995('0x2c')](_0x498d7c));}return BPromise[_0x7995('0x7d')](_0x341024);}})[_0x7995('0x19')](function(){var _0x113e03=[];var _0x5348b1=squel['insert']()[_0x7995('0x90')]('cm_hopper_additional_phones')[_0x7995('0x92')](['CmHopperId',_0x7995('0x93'),_0x7995('0xa4'),_0x7995('0x95'),'updatedAt'],squel['select']()['field'](_0x7995('0xa5'))[_0x7995('0x72')](_0x7995('0xa6'))['field'](_0x7995('0xa7'))[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27','createdAt')[_0x7995('0x72')]('\x27'+_0x442c6d+'\x27',_0x7995('0x47'))[_0x7995('0x9a')](_0x7995('0xa8'),'ci')[_0x7995('0xa9')]('cm_hopper','h','h.ContactId=ci.CmContactId')[_0x7995('0x51')](_0x7995('0xaa'),_0x442c6d)[_0x7995('0x51')](_0x7995('0xab'),_0x7995('0xac')))[_0x7995('0x79')]();_0x113e03[_0x7995('0x78')](db[_0x7995('0x7a')][_0x7995('0x2c')](_0x5348b1));return BPromise[_0x7995('0x7d')](_0x113e03);})['then'](function(){return _0x3b5edf;})[_0x7995('0x19')](respondWithResult(_0x1b7e44,null))[_0x7995('0x2e')](handleError(_0x1b7e44,null));};exports[_0x7995('0xad')]=function(_0xff759b,_0x39ee00){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0xff759b['params']['id']}})['then'](handleEntityNotFound(_0x39ee00,null))[_0x7995('0x19')](function(_0x2aec8d){if(_0x2aec8d){return _0x2aec8d[_0x7995('0xad')](_0xff759b[_0x7995('0x2c')]['ids']);}})['then'](function(_0x4b477a){if(_0x4b477a){return db[_0x7995('0x53')][_0x7995('0x25')]({'where':{'ListId':_0xff759b['query'][_0x7995('0x70')],'VoiceQueueId':_0xff759b[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(){return _0x4b477a;});}})[_0x7995('0x19')](respondWithStatusCode(_0x39ee00,null))[_0x7995('0x2e')](handleError(_0x39ee00,null));};exports[_0x7995('0xae')]=function(_0x35229d,_0x22d392){var _0x57438e={};var _0x463c25={};var _0x13d525;var _0x37b7e7;return db['VoiceQueue'][_0x7995('0x4d')]({'where':{'id':_0x35229d['params']['id']}})['then'](handleEntityNotFound(_0x22d392,null))['then'](function(_0x507bf3){if(_0x507bf3){_0x13d525=_0x507bf3;_0x463c25[_0x7995('0x31')]=_['keys'](db[_0x7995('0xaf')][_0x7995('0x32')]);_0x463c25['query']=_[_0x7995('0x4e')](_0x35229d[_0x7995('0x2c')]);_0x463c25[_0x7995('0x33')]=_[_0x7995('0x35')](_0x463c25['model'],_0x463c25[_0x7995('0x2c')]);_0x57438e['attributes']=_[_0x7995('0x35')](_0x463c25[_0x7995('0x31')],qs[_0x7995('0x36')](_0x35229d[_0x7995('0x2c')][_0x7995('0x36')]));_0x57438e[_0x7995('0x34')]=_0x57438e[_0x7995('0x34')][_0x7995('0x44')]?_0x57438e[_0x7995('0x34')]:_0x463c25[_0x7995('0x31')];_0x57438e['order']=qs[_0x7995('0x50')](_0x35229d[_0x7995('0x2c')]['sort']);_0x57438e[_0x7995('0x51')]=qs[_0x7995('0x33')](_[_0x7995('0x52')](_0x35229d[_0x7995('0x2c')],_0x463c25[_0x7995('0x33')]));if(_0x35229d[_0x7995('0x2c')]['filter']){_0x57438e[_0x7995('0x51')]=_['merge'](_0x57438e[_0x7995('0x51')],{'$or':_[_0x7995('0x1e')](_0x57438e[_0x7995('0x34')],function(_0xb79b0b){var _0x259bf2={};_0x259bf2[_0xb79b0b]={'$like':'%'+_0x35229d[_0x7995('0x2c')]['filter']+'%'};return _0x259bf2;})});}_0x57438e=_[_0x7995('0x38')]({},_0x57438e,_0x35229d[_0x7995('0x45')]);return _0x13d525[_0x7995('0xae')](_0x57438e);}})['then'](function(_0x1176cd){if(_0x1176cd){_0x37b7e7=_0x1176cd[_0x7995('0x44')];if(!_0x35229d[_0x7995('0x2c')][_0x7995('0x57')](_0x7995('0x5b'))){_0x57438e[_0x7995('0x15')]=qs[_0x7995('0x15')](_0x35229d[_0x7995('0x2c')][_0x7995('0x15')]);_0x57438e[_0x7995('0x13')]=qs[_0x7995('0x13')](_0x35229d['query'][_0x7995('0x13')]);}return _0x13d525[_0x7995('0xae')](_0x57438e);}})['then'](function(_0x3098ef){if(_0x3098ef){return _0x3098ef?{'count':_0x37b7e7,'rows':_0x3098ef}:null;}})[_0x7995('0x19')](respondWithResult(_0x22d392,null))[_0x7995('0x2e')](handleError(_0x22d392,null));};exports[_0x7995('0xb0')]=function(_0x258f87,_0x5a5cc4){var _0x37af6b;return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x258f87[_0x7995('0x30')]['id']}})[_0x7995('0x19')](handleEntityNotFound(_0x5a5cc4,null))[_0x7995('0x19')](function(_0x120bef){if(_0x120bef){return _0x120bef[_0x7995('0xb0')](_0x258f87[_0x7995('0x3b')][_0x7995('0x70')],_[_0x7995('0x46')](_0x258f87[_0x7995('0x3b')],[_0x7995('0x70'),'id'])||{});}return null;})['spread'](function(_0x247b71){var _0x1ecb6f;_0x37af6b=_0x247b71||[];var _0x225a37=[];if(_0x247b71){for(var _0x1a9f59=0x0;_0x1a9f59<_0x247b71['length'];_0x1a9f59+=0x1){var _0x92a561=_0x247b71[_0x1a9f59][_0x7995('0x3c')]({'plain':!![]});_0x1ecb6f=squel[_0x7995('0x8f')]()[_0x7995('0x90')](_0x7995('0xb1'))[_0x7995('0x92')]([_0x7995('0x93'),'ContactId',_0x7995('0x99'),'VoiceQueueId',_0x7995('0x95'),_0x7995('0x47')],squel[_0x7995('0x96')]()['field']('phone',_0x7995('0x93'))[_0x7995('0x72')]('id',_0x7995('0x97'))['field'](_0x92a561[_0x7995('0x98')]['toString'](),_0x7995('0x99'))[_0x7995('0x72')](_0x258f87[_0x7995('0x30')]['id'][_0x7995('0x79')](),_0x7995('0x58'))[_0x7995('0x72')]('NOW()',_0x7995('0x95'))[_0x7995('0x72')]('NOW()',_0x7995('0x47'))[_0x7995('0x9a')](_0x7995('0xa1'))[_0x7995('0x51')](_0x7995('0xa2'))[_0x7995('0x51')](_0x7995('0x9b'),_0x92a561[_0x7995('0x98')][_0x7995('0x79')]())[_0x7995('0x51')](_0x7995('0x9c')))[_0x7995('0x79')]();_0x225a37[_0x7995('0x78')](db[_0x7995('0x7a')][_0x7995('0x2c')](_0x1ecb6f));}return BPromise[_0x7995('0x7d')](_0x225a37);}})[_0x7995('0x19')](function(){return _0x37af6b;})['then'](respondWithResult(_0x5a5cc4,null))['catch'](handleError(_0x5a5cc4,null));};exports[_0x7995('0xb2')]=function(_0x2f3c17,_0x4fe5eb){return db[_0x7995('0x39')][_0x7995('0x21')]({'where':{'id':_0x2f3c17['params']['id']}})['then'](handleEntityNotFound(_0x4fe5eb,null))[_0x7995('0x19')](function(_0x31a3d6){if(_0x31a3d6){return _0x31a3d6[_0x7995('0xb2')](_0x2f3c17[_0x7995('0x2c')][_0x7995('0x70')]);}})[_0x7995('0x19')](function(_0x1b3920){if(_0x1b3920){return db[_0x7995('0x5d')][_0x7995('0x25')]({'where':{'ListId':_0x2f3c17[_0x7995('0x2c')]['ids'],'VoiceQueueId':_0x2f3c17[_0x7995('0x30')]['id']}})[_0x7995('0x19')](function(){return _0x1b3920;});}})[_0x7995('0x19')](respondWithStatusCode(_0x4fe5eb,null))[_0x7995('0x2e')](handleError(_0x4fe5eb,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 6e7e59e..821a8e8 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 _0x7c3b=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xd35184,_0x46dc7a){var _0x42daa4=function(_0x3430b7){while(--_0x3430b7){_0xd35184['push'](_0xd35184['shift']());}};_0x42daa4(++_0x46dc7a);}(_0x7c3b,0x11e));var _0xb7c3=function(_0x19ea68,_0x11d929){_0x19ea68=_0x19ea68-0x0;var _0xc033f=_0x7c3b[_0x19ea68];return _0xc033f;};'use strict';var EventEmitter=require(_0xb7c3('0x0'));var VoiceQueue=require(_0xb7c3('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xb7c3('0x2')](0x0);var events={'afterCreate':_0xb7c3('0x3'),'afterUpdate':_0xb7c3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1fd430){return function(_0x3fcad4,_0x40ec12,_0x40137d){VoiceQueueEvents[_0xb7c3('0x5')](_0x1fd430+':'+_0x3fcad4['id'],_0x3fcad4);VoiceQueueEvents['emit'](_0x1fd430,_0x3fcad4);_0x40137d(null);};}for(var e in events){if(events[_0xb7c3('0x6')](e)){var event=events[e];VoiceQueue[_0xb7c3('0x7')](e,emitEvent(event));}}module[_0xb7c3('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xa462=['save','update','remove','emit','hasOwnProperty','exports','VoiceQueue','setMaxListeners'];(function(_0x3911a0,_0x399077){var _0xf3dd14=function(_0x40561d){while(--_0x40561d){_0x3911a0['push'](_0x3911a0['shift']());}};_0xf3dd14(++_0x399077);}(_0xa462,0xd6));var _0x2a46=function(_0x2b0f18,_0x244f85){_0x2b0f18=_0x2b0f18-0x0;var _0x3569e7=_0xa462[_0x2b0f18];return _0x3569e7;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0x2a46('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x2a46('0x1')](0x0);var events={'afterCreate':_0x2a46('0x2'),'afterUpdate':_0x2a46('0x3'),'afterDestroy':_0x2a46('0x4')};function emitEvent(_0x96c48b){return function(_0x2575bc,_0xbb43fa,_0x5f7a27){VoiceQueueEvents[_0x2a46('0x5')](_0x96c48b+':'+_0x2575bc['id'],_0x2575bc);VoiceQueueEvents[_0x2a46('0x5')](_0x96c48b,_0x2575bc);_0x5f7a27(null);};}for(var e in events){if(events[_0x2a46('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x2a46('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 5949d2b..fd15131 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0xc6104c,_0x3f0d0b){var _0x59b261=function(_0x314f28){while(--_0x314f28){_0xc6104c['push'](_0xc6104c['shift']());}};_0x59b261(++_0x3f0d0b);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x43d701,_0x4bb2e9){var _0x2ec4c6=function(_0x4d9765){while(--_0x4d9765){_0x43d701['push'](_0x43d701['shift']());}};_0x2ec4c6(++_0x4bb2e9);}(_0x3e74,0x175));var _0x43e7=function(_0x39d338,_0x5dc573){_0x39d338=_0x39d338-0x0;var _0x259a1b=_0x3e74[_0x39d338];return _0x259a1b;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'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 d225e28..e7ccb69 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 _0x32fb=['map','GetVoiceQueue','debug','ShowVoiceQueue','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','request','then','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueue,\x20%s,\x20%s','info','result','catch','VoiceQueue','findAll','options','where','limit','include','model','attributes'];(function(_0x486061,_0x59ec2f){var _0x5ce3a7=function(_0x15efcc){while(--_0x15efcc){_0x486061['push'](_0x486061['shift']());}};_0x5ce3a7(++_0x59ec2f);}(_0x32fb,0x1c9));var _0xb32f=function(_0x456881,_0x760328){_0x456881=_0x456881-0x0;var _0x455d0a=_0x32fb[_0x456881];return _0x455d0a;};'use strict';var _=require(_0xb32f('0x0'));var util=require(_0xb32f('0x1'));var moment=require(_0xb32f('0x2'));var BPromise=require('bluebird');var rs=require(_0xb32f('0x3'));var fs=require('fs');var Redis=require(_0xb32f('0x4'));var db=require(_0xb32f('0x5'))['db'];var utils=require(_0xb32f('0x6'));var logger=require(_0xb32f('0x7'))(_0xb32f('0x8'));var config=require(_0xb32f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb32f('0xa')][_0xb32f('0xb')]({'port':0x232a});config['redis']=_[_0xb32f('0xc')](config['redis'],{'host':_0xb32f('0xd'),'port':0x18eb});var socket=require(_0xb32f('0xe'))(new Redis(config['redis']));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0xc19b4,_0x270b43,_0xfee0c7){return new BPromise(function(_0x20e5b8,_0x41369e){return client[_0xb32f('0xf')](_0xc19b4,_0xfee0c7)[_0xb32f('0x10')](function(_0x113def){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x270b43,_0xb32f('0x11'));logger['debug'](_0xb32f('0x12'),_0x270b43,_0xb32f('0x11'),JSON[_0xb32f('0x13')](_0x113def));if(_0x113def[_0xb32f('0x14')]){if(_0x113def['error'][_0xb32f('0x15')]===0x1f4){logger[_0xb32f('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x270b43,_0x113def[_0xb32f('0x14')][_0xb32f('0x16')]);return _0x41369e(_0x113def['error'][_0xb32f('0x16')]);}logger[_0xb32f('0x14')](_0xb32f('0x17'),_0x270b43,_0x113def[_0xb32f('0x14')][_0xb32f('0x16')]);return _0x20e5b8(_0x113def['error'][_0xb32f('0x16')]);}else{logger[_0xb32f('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x270b43,_0xb32f('0x11'));_0x20e5b8(_0x113def[_0xb32f('0x19')][_0xb32f('0x16')]);}})[_0xb32f('0x1a')](function(_0x4a83e0){logger[_0xb32f('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x270b43,_0x4a83e0);_0x41369e(_0x4a83e0);});});}exports['GetVoiceQueue']=function(_0x164c55){var _0x2cc018=this;return new Promise(function(_0x2a3970,_0x28c313){return db[_0xb32f('0x1b')][_0xb32f('0x1c')]({'raw':_0x164c55[_0xb32f('0x1d')]?_0x164c55['options']['raw']===undefined?!![]:![]:!![],'where':_0x164c55[_0xb32f('0x1d')]?_0x164c55[_0xb32f('0x1d')][_0xb32f('0x1e')]||null:null,'attributes':_0x164c55['options']?_0x164c55[_0xb32f('0x1d')]['attributes']||null:null,'limit':_0x164c55[_0xb32f('0x1d')]?_0x164c55[_0xb32f('0x1d')][_0xb32f('0x1f')]||null:null,'include':_0x164c55[_0xb32f('0x1d')]?_0x164c55['options'][_0xb32f('0x20')]?_['map'](_0x164c55['options']['include'],function(_0x4a8da9){return{'model':db[_0x4a8da9[_0xb32f('0x21')]],'as':_0x4a8da9['as'],'attributes':_0x4a8da9[_0xb32f('0x22')],'include':_0x4a8da9['include']?_[_0xb32f('0x23')](_0x4a8da9['include'],function(_0xa7ab5){return{'model':db[_0xa7ab5[_0xb32f('0x21')]],'as':_0xa7ab5['as'],'attributes':_0xa7ab5['attributes'],'include':_0xa7ab5[_0xb32f('0x20')]?_[_0xb32f('0x23')](_0xa7ab5[_0xb32f('0x20')],function(_0x5c32bf){return{'model':db[_0x5c32bf['model']],'as':_0x5c32bf['as'],'attributes':_0x5c32bf[_0xb32f('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17a221){logger[_0xb32f('0x18')](_0xb32f('0x24'),_0x164c55);logger[_0xb32f('0x25')](_0xb32f('0x24'),_0x164c55,JSON[_0xb32f('0x13')](_0x17a221));_0x2a3970(_0x17a221);})[_0xb32f('0x1a')](function(_0x3c9eb8){logger[_0xb32f('0x14')](_0xb32f('0x24'),_0x3c9eb8[_0xb32f('0x16')],_0x164c55);_0x28c313(_0x2cc018[_0xb32f('0x14')](0x1f4,_0x3c9eb8[_0xb32f('0x16')]));});});};exports[_0xb32f('0x26')]=function(_0x3ce975){var _0x14b543=this;return new Promise(function(_0x1263f7,_0x24b547){return db[_0xb32f('0x1b')][_0xb32f('0x27')]({'raw':_0x3ce975[_0xb32f('0x1d')]?_0x3ce975[_0xb32f('0x1d')][_0xb32f('0x28')]===undefined?!![]:![]:!![],'where':_0x3ce975[_0xb32f('0x1d')]?_0x3ce975[_0xb32f('0x1d')]['where']||null:null,'attributes':_0x3ce975[_0xb32f('0x1d')]?_0x3ce975[_0xb32f('0x1d')][_0xb32f('0x22')]||null:null,'include':_0x3ce975[_0xb32f('0x1d')]?_0x3ce975['options'][_0xb32f('0x20')]?_[_0xb32f('0x23')](_0x3ce975[_0xb32f('0x1d')][_0xb32f('0x20')],function(_0x8c17ac){return{'model':db[_0x8c17ac['model']],'as':_0x8c17ac['as'],'attributes':_0x8c17ac[_0xb32f('0x22')],'include':_0x8c17ac[_0xb32f('0x20')]?_['map'](_0x8c17ac[_0xb32f('0x20')],function(_0x4984ac){return{'model':db[_0x4984ac[_0xb32f('0x21')]],'as':_0x4984ac['as'],'attributes':_0x4984ac[_0xb32f('0x22')],'include':_0x4984ac[_0xb32f('0x20')]?_[_0xb32f('0x23')](_0x4984ac['include'],function(_0x8169c1){return{'model':db[_0x8169c1[_0xb32f('0x21')]],'as':_0x8169c1['as'],'attributes':_0x8169c1[_0xb32f('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc7adff){logger['info'](_0xb32f('0x26'),_0x3ce975);logger[_0xb32f('0x25')](_0xb32f('0x26'),_0x3ce975,JSON[_0xb32f('0x13')](_0xc7adff));_0x1263f7(_0xc7adff);})[_0xb32f('0x1a')](function(_0x5c1feb){logger[_0xb32f('0x14')](_0xb32f('0x26'),_0x5c1feb[_0xb32f('0x16')],_0x3ce975);_0x24b547(_0x14b543[_0xb32f('0x14')](0x1f4,_0x5c1feb['message']));});});}; \ No newline at end of file +var _0x0325=['where','attributes','include','map','model','GetVoiceQueue','debug','ShowVoiceQueue','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceQueue.socket','request','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','info','result','catch','VoiceQueue','findAll','options','raw'];(function(_0x44a3e1,_0x4084b4){var _0x493faa=function(_0x406529){while(--_0x406529){_0x44a3e1['push'](_0x44a3e1['shift']());}};_0x493faa(++_0x4084b4);}(_0x0325,0x167));var _0x5032=function(_0x244184,_0x6ad738){_0x244184=_0x244184-0x0;var _0x555f6d=_0x0325[_0x244184];return _0x555f6d;};'use strict';var _=require(_0x5032('0x0'));var util=require(_0x5032('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5032('0x2'));var fs=require('fs');var Redis=require(_0x5032('0x3'));var db=require(_0x5032('0x4'))['db'];var utils=require(_0x5032('0x5'));var logger=require(_0x5032('0x6'))(_0x5032('0x7'));var config=require(_0x5032('0x8'));var jayson=require(_0x5032('0x9'));var client=jayson[_0x5032('0xa')][_0x5032('0xb')]({'port':0x232a});config[_0x5032('0xc')]=_[_0x5032('0xd')](config[_0x5032('0xc')],{'host':_0x5032('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5032('0xf'))['register'](socket);function respondWithRpcPromise(_0x132b8b,_0x1adbac,_0x3046d6){return new BPromise(function(_0x398dcd,_0xe551e2){return client[_0x5032('0x10')](_0x132b8b,_0x3046d6)['then'](function(_0x53c769){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x1adbac,_0x5032('0x11'));logger['debug'](_0x5032('0x12'),_0x1adbac,_0x5032('0x11'),JSON[_0x5032('0x13')](_0x53c769));if(_0x53c769['error']){if(_0x53c769[_0x5032('0x14')][_0x5032('0x15')]===0x1f4){logger[_0x5032('0x14')](_0x5032('0x16'),_0x1adbac,_0x53c769[_0x5032('0x14')]['message']);return _0xe551e2(_0x53c769[_0x5032('0x14')][_0x5032('0x17')]);}logger[_0x5032('0x14')](_0x5032('0x16'),_0x1adbac,_0x53c769['error'][_0x5032('0x17')]);return _0x398dcd(_0x53c769[_0x5032('0x14')][_0x5032('0x17')]);}else{logger[_0x5032('0x18')](_0x5032('0x16'),_0x1adbac,_0x5032('0x11'));_0x398dcd(_0x53c769[_0x5032('0x19')]['message']);}})[_0x5032('0x1a')](function(_0xb9490e){logger['error'](_0x5032('0x16'),_0x1adbac,_0xb9490e);_0xe551e2(_0xb9490e);});});}exports['GetVoiceQueue']=function(_0x11d532){var _0x55668d=this;return new Promise(function(_0x4b642c,_0x4eb20b){return db[_0x5032('0x1b')][_0x5032('0x1c')]({'raw':_0x11d532[_0x5032('0x1d')]?_0x11d532[_0x5032('0x1d')][_0x5032('0x1e')]===undefined?!![]:![]:!![],'where':_0x11d532[_0x5032('0x1d')]?_0x11d532['options'][_0x5032('0x1f')]||null:null,'attributes':_0x11d532[_0x5032('0x1d')]?_0x11d532[_0x5032('0x1d')][_0x5032('0x20')]||null:null,'limit':_0x11d532[_0x5032('0x1d')]?_0x11d532[_0x5032('0x1d')]['limit']||null:null,'include':_0x11d532[_0x5032('0x1d')]?_0x11d532[_0x5032('0x1d')][_0x5032('0x21')]?_[_0x5032('0x22')](_0x11d532[_0x5032('0x1d')][_0x5032('0x21')],function(_0x2fc82d){return{'model':db[_0x2fc82d[_0x5032('0x23')]],'as':_0x2fc82d['as'],'attributes':_0x2fc82d[_0x5032('0x20')],'include':_0x2fc82d[_0x5032('0x21')]?_[_0x5032('0x22')](_0x2fc82d[_0x5032('0x21')],function(_0x4c3857){return{'model':db[_0x4c3857[_0x5032('0x23')]],'as':_0x4c3857['as'],'attributes':_0x4c3857[_0x5032('0x20')],'include':_0x4c3857[_0x5032('0x21')]?_['map'](_0x4c3857[_0x5032('0x21')],function(_0x325758){return{'model':db[_0x325758['model']],'as':_0x325758['as'],'attributes':_0x325758[_0x5032('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18bedb){logger[_0x5032('0x18')](_0x5032('0x24'),_0x11d532);logger[_0x5032('0x25')](_0x5032('0x24'),_0x11d532,JSON[_0x5032('0x13')](_0x18bedb));_0x4b642c(_0x18bedb);})[_0x5032('0x1a')](function(_0x5acb8f){logger[_0x5032('0x14')]('GetVoiceQueue',_0x5acb8f[_0x5032('0x17')],_0x11d532);_0x4eb20b(_0x55668d['error'](0x1f4,_0x5acb8f[_0x5032('0x17')]));});});};exports['ShowVoiceQueue']=function(_0x28cc7b){var _0x3331f0=this;return new Promise(function(_0x37ac9d,_0x887d0){return db[_0x5032('0x1b')]['find']({'raw':_0x28cc7b[_0x5032('0x1d')]?_0x28cc7b[_0x5032('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x28cc7b['options']?_0x28cc7b[_0x5032('0x1d')][_0x5032('0x1f')]||null:null,'attributes':_0x28cc7b['options']?_0x28cc7b['options'][_0x5032('0x20')]||null:null,'include':_0x28cc7b['options']?_0x28cc7b[_0x5032('0x1d')][_0x5032('0x21')]?_[_0x5032('0x22')](_0x28cc7b[_0x5032('0x1d')][_0x5032('0x21')],function(_0x3b462e){return{'model':db[_0x3b462e[_0x5032('0x23')]],'as':_0x3b462e['as'],'attributes':_0x3b462e[_0x5032('0x20')],'include':_0x3b462e[_0x5032('0x21')]?_[_0x5032('0x22')](_0x3b462e[_0x5032('0x21')],function(_0x192f2e){return{'model':db[_0x192f2e[_0x5032('0x23')]],'as':_0x192f2e['as'],'attributes':_0x192f2e[_0x5032('0x20')],'include':_0x192f2e[_0x5032('0x21')]?_[_0x5032('0x22')](_0x192f2e[_0x5032('0x21')],function(_0x29ae55){return{'model':db[_0x29ae55[_0x5032('0x23')]],'as':_0x29ae55['as'],'attributes':_0x29ae55[_0x5032('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5423d2){logger['info'](_0x5032('0x26'),_0x28cc7b);logger[_0x5032('0x25')](_0x5032('0x26'),_0x28cc7b,JSON['stringify'](_0x5423d2));_0x37ac9d(_0x5423d2);})[_0x5032('0x1a')](function(_0x5ef610){logger['error'](_0x5032('0x26'),_0x5ef610['message'],_0x28cc7b);_0x887d0(_0x3331f0[_0x5032('0x14')](0x1f4,_0x5ef610[_0x5032('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 740b682..7215e27 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 _0xbc3a=['save','remove','update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events'];(function(_0x19ef9f,_0x5a0ea2){var _0x213579=function(_0x38b627){while(--_0x38b627){_0x19ef9f['push'](_0x19ef9f['shift']());}};_0x213579(++_0x5a0ea2);}(_0xbc3a,0xbc));var _0xabc3=function(_0x4590ba,_0x3a47e4){_0x4590ba=_0x4590ba-0x0;var _0x3b0c38=_0xbc3a[_0x4590ba];return _0x3b0c38;};'use strict';var VoiceQueueEvents=require(_0xabc3('0x0'));var events=[_0xabc3('0x1'),_0xabc3('0x2'),_0xabc3('0x3')];function createListener(_0x410edb,_0x275b15){return function(_0x419b2e){_0x275b15[_0xabc3('0x4')](_0x410edb,_0x419b2e);};}function removeListener(_0x5b16d3,_0x29331a){return function(){VoiceQueueEvents[_0xabc3('0x5')](_0x5b16d3,_0x29331a);};}exports[_0xabc3('0x6')]=function(_0x3dbb97){for(var _0x5e7632=0x0,_0x2a8a2d=events[_0xabc3('0x7')];_0x5e7632<_0x2a8a2d;_0x5e7632++){var _0xd4ac5c=events[_0x5e7632];var _0x1102cd=createListener(_0xabc3('0x8')+_0xd4ac5c,_0x3dbb97);VoiceQueueEvents['on'](_0xd4ac5c,_0x1102cd);}}; \ No newline at end of file +var _0x22ca=['remove','update','emit','length','voiceQueue:','save'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x22ca,0x179));var _0xa22c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x22ca[_0x14add3];return _0x4a174f;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xa22c('0x0'),_0xa22c('0x1'),_0xa22c('0x2')];function createListener(_0x2d01ad,_0x39792c){return function(_0x1cd48b){_0x39792c[_0xa22c('0x3')](_0x2d01ad,_0x1cd48b);};}function removeListener(_0x4faabc,_0x2321c4){return function(){VoiceQueueEvents['removeListener'](_0x4faabc,_0x2321c4);};}exports['register']=function(_0x572523){for(var _0x45c95d=0x0,_0x40c5a0=events[_0xa22c('0x4')];_0x45c95d<_0x40c5a0;_0x45c95d++){var _0x5a9819=events[_0x45c95d];var _0x1fbbe6=createListener(_0xa22c('0x5')+_0x5a9819,_0x572523);VoiceQueueEvents['on'](_0x5a9819,_0x1fbbe6);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index e258bd4..4fb3810 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 _0x8e42=['index','/index','getVoiceQueuesReport','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x8e42,0x1d9));var _0x28e4=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x8e42[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0x28e4('0x0'));var util=require(_0x28e4('0x1'));var path=require(_0x28e4('0x2'));var timeout=require('connect-timeout');var express=require(_0x28e4('0x3'));var router=express[_0x28e4('0x4')]();var fs_extra=require(_0x28e4('0x5'));var auth=require(_0x28e4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x28e4('0x7'));var controller=require('./voiceQueueReport.controller');router[_0x28e4('0x8')]('/',auth[_0x28e4('0x9')](),controller[_0x28e4('0xa')]);router['get']('/describe',auth[_0x28e4('0x9')](),controller['describe']);router[_0x28e4('0x8')](_0x28e4('0xb'),auth[_0x28e4('0x9')](),controller[_0x28e4('0xc')]);router[_0x28e4('0x8')](_0x28e4('0xd'),auth[_0x28e4('0x9')](),controller[_0x28e4('0xe')]);router[_0x28e4('0xf')]('/',auth[_0x28e4('0x9')](),controller['create']);router[_0x28e4('0x10')](_0x28e4('0xd'),auth['isAuthenticated'](),controller[_0x28e4('0x11')]);router[_0x28e4('0x12')](_0x28e4('0xd'),auth[_0x28e4('0x9')](),controller[_0x28e4('0x13')]);module[_0x28e4('0x14')]=router; \ No newline at end of file +var _0x8177=['post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','describe','getVoiceQueuesReport','show'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0x8177,0x16f));var _0x7817=function(_0xbef6c4,_0x413772){_0xbef6c4=_0xbef6c4-0x0;var _0x26c3e7=_0x8177[_0xbef6c4];return _0x26c3e7;};'use strict';var multer=require('multer');var util=require(_0x7817('0x0'));var path=require(_0x7817('0x1'));var timeout=require(_0x7817('0x2'));var express=require(_0x7817('0x3'));var router=express[_0x7817('0x4')]();var fs_extra=require(_0x7817('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7817('0x6'));var config=require(_0x7817('0x7'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0x7817('0x8')](),controller['index']);router['get'](_0x7817('0x9'),auth['isAuthenticated'](),controller[_0x7817('0xa')]);router['get']('/index',auth['isAuthenticated'](),controller[_0x7817('0xb')]);router['get']('/:id',auth[_0x7817('0x8')](),controller[_0x7817('0xc')]);router[_0x7817('0xd')]('/',auth[_0x7817('0x8')](),controller[_0x7817('0xe')]);router[_0x7817('0xf')]('/:id',auth[_0x7817('0x8')](),controller[_0x7817('0x10')]);router['delete']('/:id',auth[_0x7817('0x8')](),controller[_0x7817('0x11')]);module[_0x7817('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 65de17e..993e1f1 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 _0x3883=['BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x3883,0xab));var _0x3388=function(_0x4d6394,_0x4e57ab){_0x4d6394=_0x4d6394-0x0;var _0x29faad=_0x3883[_0x4d6394];return _0x29faad;};'use strict';var Sequelize=require(_0x3388('0x0'));var moment=require(_0x3388('0x1'));module['exports']={'type':{'type':Sequelize[_0x3388('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3388('0x2')]},'queue':{'type':Sequelize[_0x3388('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x3388('0x3')],'set':function(_0x425e6d){var _0x39cd47=moment(_0x425e6d);var _0x1c97d3=moment(this[_0x3388('0x4')](_0x3388('0x5')))[_0x3388('0x6')](_0x3388('0x7'));var _0x37e965=_0x39cd47[_0x3388('0x8')](_0x1c97d3,_0x3388('0x9'));this['setDataValue']('queuecallerleaveAt',_0x425e6d);this[_0x3388('0xa')]('holdtime',_0x37e965||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3388('0x3')]},'queuecallerexit':{'type':Sequelize[_0x3388('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x3388('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x3388('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x3388('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x3388('0x2')]},'accountcode':{'type':Sequelize[_0x3388('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3388('0x2')]},'priority':{'type':Sequelize[_0x3388('0x2')]},'holdtime':{'type':Sequelize[_0x3388('0xc')]},'mohtime':{'type':Sequelize[_0x3388('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3388('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x3388('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x3388('0xd')},'transferexten':{'type':Sequelize[_0x3388('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x3388('0x2')]},'secondDisposition':{'type':Sequelize[_0x3388('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x3388('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0x3388('0x2')]}}; \ No newline at end of file +var _0xb23e=['STRING','DATE','queuecallerjoinAt','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb23e,0x1b9));var _0xeb23=function(_0x4f4283,_0x103425){_0x4f4283=_0x4f4283-0x0;var _0x3f356f=_0xb23e[_0x4f4283];return _0x3f356f;};'use strict';var Sequelize=require(_0xeb23('0x0'));var moment=require(_0xeb23('0x1'));module[_0xeb23('0x2')]={'type':{'type':Sequelize[_0xeb23('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xeb23('0x3')]},'calleridname':{'type':Sequelize[_0xeb23('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xeb23('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xeb23('0x4')],'set':function(_0x38a18a){var _0x3179e8=moment(_0x38a18a);var _0x3794f3=moment(this['getDataValue'](_0xeb23('0x5')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x5ba6fe=_0x3179e8['diff'](_0x3794f3,_0xeb23('0x6'));this[_0xeb23('0x7')](_0xeb23('0x8'),_0x38a18a);this[_0xeb23('0x7')]('holdtime',_0x5ba6fe||null);}},'position':{'type':Sequelize[_0xeb23('0x9')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xeb23('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xeb23('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xeb23('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xeb23('0x4')]},'queuecallerexit':{'type':Sequelize[_0xeb23('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xeb23('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xeb23('0x9')]},'channel':{'type':Sequelize[_0xeb23('0x3')]},'connectedlinenum':{'type':Sequelize[_0xeb23('0x3')]},'connectedlinename':{'type':Sequelize[_0xeb23('0x3')]},'accountcode':{'type':Sequelize[_0xeb23('0x3')]},'context':{'type':Sequelize[_0xeb23('0x3')]},'exten':{'type':Sequelize[_0xeb23('0x3')]},'priority':{'type':Sequelize[_0xeb23('0x3')]},'holdtime':{'type':Sequelize[_0xeb23('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xeb23('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xeb23('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xeb23('0xb')},'transferexten':{'type':Sequelize[_0xeb23('0x3')]},'transferuniqueid':{'type':Sequelize[_0xeb23('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xeb23('0x3')]},'thirdDisposition':{'type':Sequelize[_0xeb23('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0xeb23('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index e562f48..7380720 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 _0xff15=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','destroy','params','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xff15,0x140));var _0x5ff1=function(_0x5c7a85,_0x41dd19){_0x5c7a85=_0x5c7a85-0x0;var _0x35290f=_0xff15[_0x5c7a85];return _0x35290f;};'use strict';var emlformat=require(_0x5ff1('0x0'));var rimraf=require(_0x5ff1('0x1'));var zipdir=require(_0x5ff1('0x2'));var jsonpatch=require(_0x5ff1('0x3'));var rp=require(_0x5ff1('0x4'));var moment=require(_0x5ff1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5ff1('0x6'));var util=require(_0x5ff1('0x7'));var path=require(_0x5ff1('0x8'));var sox=require('sox');var csv=require(_0x5ff1('0x9'));var ejs=require(_0x5ff1('0xa'));var fs=require('fs');var fs_extra=require(_0x5ff1('0xb'));var _=require(_0x5ff1('0xc'));var squel=require(_0x5ff1('0xd'));var crypto=require(_0x5ff1('0xe'));var jsforce=require(_0x5ff1('0xf'));var deskjs=require(_0x5ff1('0x10'));var toCsv=require(_0x5ff1('0x9'));var querystring=require(_0x5ff1('0x11'));var Papa=require(_0x5ff1('0x12'));var Redis=require('ioredis');var authService=require(_0x5ff1('0x13'));var qs=require(_0x5ff1('0x14'));var as=require(_0x5ff1('0x15'));var hardwareService=require(_0x5ff1('0x16'));var logger=require(_0x5ff1('0x17'))('api');var utils=require(_0x5ff1('0x18'));var config=require(_0x5ff1('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5ff1('0x1a'))['db'];config[_0x5ff1('0x1b')]=_['defaults'](config['redis'],{'host':_0x5ff1('0x1c'),'port':0x18eb});var socket=require(_0x5ff1('0x1d'))(new Redis(config[_0x5ff1('0x1b')]));require(_0x5ff1('0x1e'))['register'](socket);function respondWithStatusCode(_0x42912c,_0x569523){_0x569523=_0x569523||0xcc;return function(_0x94fcec){if(_0x94fcec){return _0x42912c[_0x5ff1('0x1f')](_0x569523);}return _0x42912c[_0x5ff1('0x20')](_0x569523)['end']();};}function respondWithResult(_0x36c7a1,_0x4d1f4e){_0x4d1f4e=_0x4d1f4e||0xc8;return function(_0x4bdb3a){if(_0x4bdb3a){return _0x36c7a1[_0x5ff1('0x20')](_0x4d1f4e)[_0x5ff1('0x21')](_0x4bdb3a);}};}function respondWithFilteredResult(_0x16b70d,_0x523810){return function(_0x4fd0eb){if(_0x4fd0eb){var _0x26b3d1=typeof _0x523810[_0x5ff1('0x22')]===_0x5ff1('0x23')&&typeof _0x523810[_0x5ff1('0x24')]===_0x5ff1('0x23');var _0x499d64=_0x4fd0eb['count'];var _0x439db5=_0x26b3d1?0x0:_0x523810[_0x5ff1('0x22')];var _0x2047df=_0x26b3d1?_0x4fd0eb[_0x5ff1('0x25')]:_0x523810[_0x5ff1('0x22')]+_0x523810[_0x5ff1('0x24')];var _0x4d81f4;if(_0x2047df>=_0x499d64){_0x2047df=_0x499d64;_0x4d81f4=0xc8;}else{_0x4d81f4=0xce;}_0x16b70d[_0x5ff1('0x20')](_0x4d81f4);return _0x16b70d[_0x5ff1('0x26')]('Content-Range',_0x439db5+'-'+_0x2047df+'/'+_0x499d64)[_0x5ff1('0x21')](_0x4fd0eb);}return null;};}function patchUpdates(_0x4d7576){return function(_0x42e792){try{jsonpatch[_0x5ff1('0x27')](_0x42e792,_0x4d7576,!![]);}catch(_0x521770){return BPromise[_0x5ff1('0x28')](_0x521770);}return _0x42e792[_0x5ff1('0x29')]();};}function saveUpdates(_0x145e91,_0x37bf77){return function(_0xbcbccc){if(_0xbcbccc){return _0xbcbccc[_0x5ff1('0x2a')](_0x145e91)[_0x5ff1('0x2b')](function(_0x445a62){return _0x445a62;});}return null;};}function removeEntity(_0x3b5d7d,_0xb8dba1){return function(_0x246dd6){if(_0x246dd6){return _0x246dd6['destroy']()['then'](function(){_0x3b5d7d[_0x5ff1('0x20')](0xcc)[_0x5ff1('0x2c')]();});}};}function handleEntityNotFound(_0x18a0f1,_0x278a4a){return function(_0x1405f1){if(!_0x1405f1){_0x18a0f1[_0x5ff1('0x1f')](0x194);}return _0x1405f1;};}function handleError(_0x5ddb82,_0x2f9f4d){_0x2f9f4d=_0x2f9f4d||0x1f4;return function(_0x2bf9a8){logger['error'](_0x2bf9a8['stack']);if(_0x2bf9a8[_0x5ff1('0x2d')]){delete _0x2bf9a8[_0x5ff1('0x2d')];}_0x5ddb82[_0x5ff1('0x20')](_0x2f9f4d)[_0x5ff1('0x2e')](_0x2bf9a8);};}exports[_0x5ff1('0x2f')]=function(_0x71da98,_0x12667f){var _0x169c1b={},_0x44aafa={},_0x41ec8f={'count':0x0,'rows':[]};var _0x38c9b2=_[_0x5ff1('0x30')](db[_0x5ff1('0x31')][_0x5ff1('0x32')],function(_0x56bf89){return{'name':_0x56bf89[_0x5ff1('0x33')],'type':_0x56bf89['type'][_0x5ff1('0x34')]};});_0x44aafa[_0x5ff1('0x35')]=_['map'](_0x38c9b2,_0x5ff1('0x2d'));_0x44aafa[_0x5ff1('0x36')]=_[_0x5ff1('0x37')](_0x71da98[_0x5ff1('0x36')]);_0x44aafa[_0x5ff1('0x38')]=_['intersection'](_0x44aafa[_0x5ff1('0x35')],_0x44aafa['query']);_0x169c1b[_0x5ff1('0x39')]=_[_0x5ff1('0x3a')](_0x44aafa['model'],qs[_0x5ff1('0x3b')](_0x71da98[_0x5ff1('0x36')]['fields']));_0x169c1b[_0x5ff1('0x39')]=_0x169c1b[_0x5ff1('0x39')][_0x5ff1('0x3c')]?_0x169c1b[_0x5ff1('0x39')]:_0x44aafa[_0x5ff1('0x35')];if(!_0x71da98['query'][_0x5ff1('0x3d')](_0x5ff1('0x3e'))){_0x169c1b[_0x5ff1('0x24')]=qs[_0x5ff1('0x24')](_0x71da98['query'][_0x5ff1('0x24')]);_0x169c1b[_0x5ff1('0x22')]=qs[_0x5ff1('0x22')](_0x71da98[_0x5ff1('0x36')][_0x5ff1('0x22')]);}_0x169c1b[_0x5ff1('0x3f')]=qs[_0x5ff1('0x40')](_0x71da98['query'][_0x5ff1('0x40')]);_0x169c1b[_0x5ff1('0x41')]=qs[_0x5ff1('0x38')](_[_0x5ff1('0x42')](_0x71da98[_0x5ff1('0x36')],_0x44aafa['filters']),_0x38c9b2);if(_0x71da98[_0x5ff1('0x36')][_0x5ff1('0x43')]){_0x169c1b['where']=_[_0x5ff1('0x44')](_0x169c1b[_0x5ff1('0x41')],{'$or':_[_0x5ff1('0x30')](_0x38c9b2,function(_0x2503ab){if(_0x2503ab[_0x5ff1('0x45')]!==_0x5ff1('0x46')){var _0x457d3f={};_0x457d3f[_0x2503ab[_0x5ff1('0x2d')]]={'$like':'%'+_0x71da98[_0x5ff1('0x36')]['filter']+'%'};return _0x457d3f;}})});}_0x169c1b=_[_0x5ff1('0x44')]({},_0x169c1b,_0x71da98[_0x5ff1('0x47')]);var _0x222cdb={'where':_0x169c1b[_0x5ff1('0x41')]};return db[_0x5ff1('0x31')][_0x5ff1('0x25')](_0x222cdb)[_0x5ff1('0x2b')](function(_0x398b0a){_0x41ec8f[_0x5ff1('0x25')]=_0x398b0a;if(_0x71da98[_0x5ff1('0x36')][_0x5ff1('0x48')]){_0x169c1b[_0x5ff1('0x49')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x5ff1('0x4a')](_0x169c1b);})[_0x5ff1('0x2b')](function(_0x40578a){_0x41ec8f[_0x5ff1('0x4b')]=_0x40578a;return _0x41ec8f;})[_0x5ff1('0x2b')](respondWithFilteredResult(_0x12667f,_0x169c1b))[_0x5ff1('0x4c')](handleError(_0x12667f,null));};exports[_0x5ff1('0x4d')]=function(_0x4ecf0e,_0x9661a1){var _0x45976a={'raw':![],'where':{'id':_0x4ecf0e['params']['id']}},_0x1ddbc9={};_0x1ddbc9['model']=_[_0x5ff1('0x37')](db[_0x5ff1('0x31')][_0x5ff1('0x32')]);_0x1ddbc9[_0x5ff1('0x36')]=_[_0x5ff1('0x37')](_0x4ecf0e[_0x5ff1('0x36')]);_0x1ddbc9[_0x5ff1('0x38')]=_[_0x5ff1('0x3a')](_0x1ddbc9[_0x5ff1('0x35')],_0x1ddbc9[_0x5ff1('0x36')]);_0x45976a['attributes']=_[_0x5ff1('0x3a')](_0x1ddbc9['model'],qs[_0x5ff1('0x3b')](_0x4ecf0e[_0x5ff1('0x36')]['fields']));_0x45976a[_0x5ff1('0x39')]=_0x45976a['attributes'][_0x5ff1('0x3c')]?_0x45976a[_0x5ff1('0x39')]:_0x1ddbc9[_0x5ff1('0x35')];if(_0x4ecf0e[_0x5ff1('0x36')][_0x5ff1('0x48')]){_0x45976a[_0x5ff1('0x49')]=[{'all':!![]}];}_0x45976a=_['merge']({},_0x45976a,_0x4ecf0e[_0x5ff1('0x47')]);return db[_0x5ff1('0x31')][_0x5ff1('0x4e')](_0x45976a)[_0x5ff1('0x2b')](handleEntityNotFound(_0x9661a1,null))[_0x5ff1('0x2b')](respondWithResult(_0x9661a1,null))[_0x5ff1('0x4c')](handleError(_0x9661a1,null));};exports[_0x5ff1('0x4f')]=function(_0x362928,_0x433863){return db[_0x5ff1('0x31')][_0x5ff1('0x4f')](_0x362928[_0x5ff1('0x50')],{})[_0x5ff1('0x2b')](respondWithResult(_0x433863,0xc9))['catch'](handleError(_0x433863,null));};exports[_0x5ff1('0x2a')]=function(_0x3c758c,_0x3527b1){if(_0x3c758c[_0x5ff1('0x50')]['id']){delete _0x3c758c[_0x5ff1('0x50')]['id'];}return db['VoiceQueueReport'][_0x5ff1('0x4e')]({'where':{'id':_0x3c758c['params']['id']}})[_0x5ff1('0x2b')](handleEntityNotFound(_0x3527b1,null))[_0x5ff1('0x2b')](saveUpdates(_0x3c758c[_0x5ff1('0x50')],null))[_0x5ff1('0x2b')](respondWithResult(_0x3527b1,null))['catch'](handleError(_0x3527b1,null));};exports[_0x5ff1('0x51')]=function(_0x2a272e,_0x1ac905){return db['VoiceQueueReport'][_0x5ff1('0x4e')]({'where':{'id':_0x2a272e[_0x5ff1('0x52')]['id']}})['then'](handleEntityNotFound(_0x1ac905,null))[_0x5ff1('0x2b')](removeEntity(_0x1ac905,null))['catch'](handleError(_0x1ac905,null));};exports['describe']=function(_0x27140d,_0x196d33){return db[_0x5ff1('0x31')][_0x5ff1('0x53')]()[_0x5ff1('0x2b')](respondWithResult(_0x196d33,null))[_0x5ff1('0x4c')](handleError(_0x196d33,null));};exports[_0x5ff1('0x54')]=function(_0x551a5e,_0x256939){var _0xc073a={},_0x594309={},_0x3f50ab={'count':0x0,'rows':[]};_0x594309[_0x5ff1('0x35')]=_[_0x5ff1('0x37')](db[_0x5ff1('0x31')][_0x5ff1('0x32')]);_0x594309[_0x5ff1('0x36')]=_[_0x5ff1('0x37')](_0x551a5e['query']);_0x594309[_0x5ff1('0x38')]=_[_0x5ff1('0x3a')](_0x594309[_0x5ff1('0x35')],_0x594309[_0x5ff1('0x36')]);_0xc073a[_0x5ff1('0x39')]=_[_0x5ff1('0x3a')](_0x594309['model'],qs[_0x5ff1('0x3b')](_0x551a5e[_0x5ff1('0x36')]['fields']));_0xc073a[_0x5ff1('0x39')]=_0xc073a[_0x5ff1('0x39')]['length']?_0xc073a['attributes']:_0x594309[_0x5ff1('0x35')];if(!_0x551a5e['query'][_0x5ff1('0x3d')](_0x5ff1('0x3e'))){_0xc073a['limit']=qs['limit'](_0x551a5e[_0x5ff1('0x36')][_0x5ff1('0x24')]);_0xc073a['offset']=qs[_0x5ff1('0x22')](_0x551a5e['query'][_0x5ff1('0x22')]);}_0xc073a[_0x5ff1('0x3f')]=qs[_0x5ff1('0x40')](_0x551a5e['query']['sort']);_0xc073a[_0x5ff1('0x41')]=qs['filters'](_[_0x5ff1('0x42')](_0x551a5e[_0x5ff1('0x36')],_0x594309[_0x5ff1('0x38')]));if(_0x551a5e[_0x5ff1('0x36')][_0x5ff1('0x43')]){_0xc073a['where']=_[_0x5ff1('0x44')](_0xc073a[_0x5ff1('0x41')],{'$or':_[_0x5ff1('0x30')](_0xc073a[_0x5ff1('0x39')],function(_0x46de33){var _0x332a7e={};_0x332a7e[_0x46de33]={'$like':'%'+_0x551a5e[_0x5ff1('0x36')][_0x5ff1('0x43')]+'%'};return _0x332a7e;})});}_0xc073a=_['merge']({},_0xc073a,_0x551a5e[_0x5ff1('0x47')]);var _0x3f5c36={'where':_0xc073a[_0x5ff1('0x41')]};return db[_0x5ff1('0x31')]['count'](_0x3f5c36)['then'](function(_0x37c967){_0x3f50ab['count']=_0x37c967;if(_0x551a5e[_0x5ff1('0x36')][_0x5ff1('0x48')]){_0xc073a[_0x5ff1('0x49')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x5ff1('0x4a')](_0xc073a);})[_0x5ff1('0x2b')](function(_0x41ee86){_0x3f50ab[_0x5ff1('0x4b')]=_0x41ee86;return _0x3f50ab;})[_0x5ff1('0x2b')](respondWithFilteredResult(_0x256939,_0xc073a,_0x5ff1('0x54')))[_0x5ff1('0x4c')](handleError(_0x256939,null,_0x5ff1('0x54')));}; \ No newline at end of file +var _0x7152=['register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','end','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getVoiceQueuesReport','hasOwnProperty','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost'];(function(_0x4b4638,_0xe99cda){var _0x59e92b=function(_0x2817ea){while(--_0x2817ea){_0x4b4638['push'](_0x4b4638['shift']());}};_0x59e92b(++_0xe99cda);}(_0x7152,0x8a));var _0x2715=function(_0x498c78,_0x2eab48){_0x498c78=_0x498c78-0x0;var _0xb7697f=_0x7152[_0x498c78];return _0xb7697f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2715('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2715('0x1'));var rp=require(_0x2715('0x2'));var moment=require(_0x2715('0x3'));var BPromise=require(_0x2715('0x4'));var Mustache=require(_0x2715('0x5'));var util=require('util');var path=require(_0x2715('0x6'));var sox=require(_0x2715('0x7'));var csv=require(_0x2715('0x8'));var ejs=require(_0x2715('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2715('0xa'));var squel=require(_0x2715('0xb'));var crypto=require(_0x2715('0xc'));var jsforce=require(_0x2715('0xd'));var deskjs=require(_0x2715('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2715('0xf'));var authService=require(_0x2715('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2715('0x11'));var hardwareService=require(_0x2715('0x12'));var logger=require(_0x2715('0x13'))(_0x2715('0x14'));var utils=require(_0x2715('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2715('0x16'));var db=require('../../mysqldb')['db'];config[_0x2715('0x17')]=_[_0x2715('0x18')](config[_0x2715('0x17')],{'host':_0x2715('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2715('0x17')]));require('./voiceQueueReport.socket')[_0x2715('0x1a')](socket);function respondWithStatusCode(_0xa76097,_0x205194){_0x205194=_0x205194||0xcc;return function(_0x4c4f0a){if(_0x4c4f0a){return _0xa76097[_0x2715('0x1b')](_0x205194);}return _0xa76097['status'](_0x205194)['end']();};}function respondWithResult(_0x25fd99,_0x4634da){_0x4634da=_0x4634da||0xc8;return function(_0xff9968){if(_0xff9968){return _0x25fd99[_0x2715('0x1c')](_0x4634da)[_0x2715('0x1d')](_0xff9968);}};}function respondWithFilteredResult(_0x5f19b8,_0x4f934b){return function(_0x921ef5){if(_0x921ef5){var _0xade852=typeof _0x4f934b[_0x2715('0x1e')]===_0x2715('0x1f')&&typeof _0x4f934b['limit']===_0x2715('0x1f');var _0xc80cc=_0x921ef5[_0x2715('0x20')];var _0x5c40f7=_0xade852?0x0:_0x4f934b[_0x2715('0x1e')];var _0xa61281=_0xade852?_0x921ef5[_0x2715('0x20')]:_0x4f934b[_0x2715('0x1e')]+_0x4f934b[_0x2715('0x21')];var _0x38683d;if(_0xa61281>=_0xc80cc){_0xa61281=_0xc80cc;_0x38683d=0xc8;}else{_0x38683d=0xce;}_0x5f19b8[_0x2715('0x1c')](_0x38683d);return _0x5f19b8[_0x2715('0x22')](_0x2715('0x23'),_0x5c40f7+'-'+_0xa61281+'/'+_0xc80cc)[_0x2715('0x1d')](_0x921ef5);}return null;};}function patchUpdates(_0x3737a9){return function(_0x1eef92){try{jsonpatch[_0x2715('0x24')](_0x1eef92,_0x3737a9,!![]);}catch(_0x2e734b){return BPromise['reject'](_0x2e734b);}return _0x1eef92[_0x2715('0x25')]();};}function saveUpdates(_0x592716,_0x3a0550){return function(_0x262bb1){if(_0x262bb1){return _0x262bb1[_0x2715('0x26')](_0x592716)['then'](function(_0x4cde6f){return _0x4cde6f;});}return null;};}function removeEntity(_0x3ffb35,_0x1ee953){return function(_0x21d606){if(_0x21d606){return _0x21d606[_0x2715('0x27')]()[_0x2715('0x28')](function(){_0x3ffb35[_0x2715('0x1c')](0xcc)[_0x2715('0x29')]();});}};}function handleEntityNotFound(_0x3e7088,_0x1f6971){return function(_0x5de12e){if(!_0x5de12e){_0x3e7088[_0x2715('0x1b')](0x194);}return _0x5de12e;};}function handleError(_0x33a146,_0x2cc17e){_0x2cc17e=_0x2cc17e||0x1f4;return function(_0x19b998){logger[_0x2715('0x2a')](_0x19b998[_0x2715('0x2b')]);if(_0x19b998[_0x2715('0x2c')]){delete _0x19b998[_0x2715('0x2c')];}_0x33a146[_0x2715('0x1c')](_0x2cc17e)[_0x2715('0x2d')](_0x19b998);};}exports[_0x2715('0x2e')]=function(_0x2567d5,_0x4d744e){var _0x42e5af={},_0x38191a={},_0x49df57={'count':0x0,'rows':[]};var _0x32bcf1=_[_0x2715('0x2f')](db[_0x2715('0x30')][_0x2715('0x31')],function(_0x8dc71b){return{'name':_0x8dc71b[_0x2715('0x32')],'type':_0x8dc71b[_0x2715('0x33')][_0x2715('0x34')]};});_0x38191a[_0x2715('0x35')]=_['map'](_0x32bcf1,_0x2715('0x2c'));_0x38191a['query']=_[_0x2715('0x36')](_0x2567d5['query']);_0x38191a[_0x2715('0x37')]=_[_0x2715('0x38')](_0x38191a['model'],_0x38191a[_0x2715('0x39')]);_0x42e5af[_0x2715('0x3a')]=_['intersection'](_0x38191a['model'],qs[_0x2715('0x3b')](_0x2567d5['query'][_0x2715('0x3b')]));_0x42e5af['attributes']=_0x42e5af['attributes'][_0x2715('0x3c')]?_0x42e5af[_0x2715('0x3a')]:_0x38191a[_0x2715('0x35')];if(!_0x2567d5['query']['hasOwnProperty'](_0x2715('0x3d'))){_0x42e5af[_0x2715('0x21')]=qs[_0x2715('0x21')](_0x2567d5[_0x2715('0x39')][_0x2715('0x21')]);_0x42e5af['offset']=qs['offset'](_0x2567d5['query'][_0x2715('0x1e')]);}_0x42e5af[_0x2715('0x3e')]=qs['sort'](_0x2567d5[_0x2715('0x39')][_0x2715('0x3f')]);_0x42e5af[_0x2715('0x40')]=qs[_0x2715('0x37')](_[_0x2715('0x41')](_0x2567d5[_0x2715('0x39')],_0x38191a[_0x2715('0x37')]),_0x32bcf1);if(_0x2567d5[_0x2715('0x39')][_0x2715('0x42')]){_0x42e5af[_0x2715('0x40')]=_['merge'](_0x42e5af[_0x2715('0x40')],{'$or':_[_0x2715('0x2f')](_0x32bcf1,function(_0x3339d6){if(_0x3339d6[_0x2715('0x33')]!==_0x2715('0x43')){var _0x1ed730={};_0x1ed730[_0x3339d6['name']]={'$like':'%'+_0x2567d5['query']['filter']+'%'};return _0x1ed730;}})});}_0x42e5af=_[_0x2715('0x44')]({},_0x42e5af,_0x2567d5[_0x2715('0x45')]);var _0x336506={'where':_0x42e5af['where']};return db[_0x2715('0x30')][_0x2715('0x20')](_0x336506)['then'](function(_0x47f325){_0x49df57[_0x2715('0x20')]=_0x47f325;if(_0x2567d5[_0x2715('0x39')]['includeAll']){_0x42e5af[_0x2715('0x46')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x2715('0x47')](_0x42e5af);})[_0x2715('0x28')](function(_0xd361fc){_0x49df57[_0x2715('0x48')]=_0xd361fc;return _0x49df57;})[_0x2715('0x28')](respondWithFilteredResult(_0x4d744e,_0x42e5af))[_0x2715('0x49')](handleError(_0x4d744e,null));};exports[_0x2715('0x4a')]=function(_0x173d06,_0x5de318){var _0x4cf9b1={'raw':![],'where':{'id':_0x173d06[_0x2715('0x4b')]['id']}},_0x56f323={};_0x56f323[_0x2715('0x35')]=_[_0x2715('0x36')](db[_0x2715('0x30')][_0x2715('0x31')]);_0x56f323['query']=_[_0x2715('0x36')](_0x173d06[_0x2715('0x39')]);_0x56f323[_0x2715('0x37')]=_['intersection'](_0x56f323[_0x2715('0x35')],_0x56f323[_0x2715('0x39')]);_0x4cf9b1[_0x2715('0x3a')]=_[_0x2715('0x38')](_0x56f323[_0x2715('0x35')],qs[_0x2715('0x3b')](_0x173d06[_0x2715('0x39')]['fields']));_0x4cf9b1[_0x2715('0x3a')]=_0x4cf9b1['attributes']['length']?_0x4cf9b1[_0x2715('0x3a')]:_0x56f323[_0x2715('0x35')];if(_0x173d06[_0x2715('0x39')][_0x2715('0x4c')]){_0x4cf9b1['include']=[{'all':!![]}];}_0x4cf9b1=_[_0x2715('0x44')]({},_0x4cf9b1,_0x173d06[_0x2715('0x45')]);return db[_0x2715('0x30')][_0x2715('0x4d')](_0x4cf9b1)[_0x2715('0x28')](handleEntityNotFound(_0x5de318,null))[_0x2715('0x28')](respondWithResult(_0x5de318,null))[_0x2715('0x49')](handleError(_0x5de318,null));};exports[_0x2715('0x4e')]=function(_0x234934,_0x29039b){return db[_0x2715('0x30')][_0x2715('0x4e')](_0x234934[_0x2715('0x4f')],{})[_0x2715('0x28')](respondWithResult(_0x29039b,0xc9))['catch'](handleError(_0x29039b,null));};exports[_0x2715('0x26')]=function(_0xbf0c89,_0x2d982e){if(_0xbf0c89[_0x2715('0x4f')]['id']){delete _0xbf0c89[_0x2715('0x4f')]['id'];}return db[_0x2715('0x30')][_0x2715('0x4d')]({'where':{'id':_0xbf0c89['params']['id']}})[_0x2715('0x28')](handleEntityNotFound(_0x2d982e,null))[_0x2715('0x28')](saveUpdates(_0xbf0c89[_0x2715('0x4f')],null))[_0x2715('0x28')](respondWithResult(_0x2d982e,null))['catch'](handleError(_0x2d982e,null));};exports[_0x2715('0x27')]=function(_0x261702,_0x48f11d){return db[_0x2715('0x30')][_0x2715('0x4d')]({'where':{'id':_0x261702[_0x2715('0x4b')]['id']}})[_0x2715('0x28')](handleEntityNotFound(_0x48f11d,null))['then'](removeEntity(_0x48f11d,null))[_0x2715('0x49')](handleError(_0x48f11d,null));};exports['describe']=function(_0xe9e5c4,_0x562cdd){return db[_0x2715('0x30')]['describe']()[_0x2715('0x28')](respondWithResult(_0x562cdd,null))[_0x2715('0x49')](handleError(_0x562cdd,null));};exports[_0x2715('0x50')]=function(_0x291439,_0x5e53c9){var _0x1d347c={},_0x43707e={},_0x42a837={'count':0x0,'rows':[]};_0x43707e[_0x2715('0x35')]=_[_0x2715('0x36')](db[_0x2715('0x30')][_0x2715('0x31')]);_0x43707e['query']=_[_0x2715('0x36')](_0x291439['query']);_0x43707e[_0x2715('0x37')]=_[_0x2715('0x38')](_0x43707e[_0x2715('0x35')],_0x43707e[_0x2715('0x39')]);_0x1d347c['attributes']=_[_0x2715('0x38')](_0x43707e[_0x2715('0x35')],qs[_0x2715('0x3b')](_0x291439[_0x2715('0x39')]['fields']));_0x1d347c['attributes']=_0x1d347c[_0x2715('0x3a')][_0x2715('0x3c')]?_0x1d347c[_0x2715('0x3a')]:_0x43707e[_0x2715('0x35')];if(!_0x291439['query'][_0x2715('0x51')](_0x2715('0x3d'))){_0x1d347c[_0x2715('0x21')]=qs[_0x2715('0x21')](_0x291439['query'][_0x2715('0x21')]);_0x1d347c['offset']=qs['offset'](_0x291439[_0x2715('0x39')][_0x2715('0x1e')]);}_0x1d347c[_0x2715('0x3e')]=qs[_0x2715('0x3f')](_0x291439['query'][_0x2715('0x3f')]);_0x1d347c[_0x2715('0x40')]=qs[_0x2715('0x37')](_['pick'](_0x291439[_0x2715('0x39')],_0x43707e['filters']));if(_0x291439[_0x2715('0x39')][_0x2715('0x42')]){_0x1d347c['where']=_['merge'](_0x1d347c[_0x2715('0x40')],{'$or':_[_0x2715('0x2f')](_0x1d347c[_0x2715('0x3a')],function(_0x4c764a){var _0x33bec3={};_0x33bec3[_0x4c764a]={'$like':'%'+_0x291439['query']['filter']+'%'};return _0x33bec3;})});}_0x1d347c=_[_0x2715('0x44')]({},_0x1d347c,_0x291439[_0x2715('0x45')]);var _0x572fd5={'where':_0x1d347c[_0x2715('0x40')]};return db['VoiceQueueReport'][_0x2715('0x20')](_0x572fd5)[_0x2715('0x28')](function(_0x46bf1c){_0x42a837['count']=_0x46bf1c;if(_0x291439['query']['includeAll']){_0x1d347c[_0x2715('0x46')]=[{'all':!![]}];}return db[_0x2715('0x30')][_0x2715('0x47')](_0x1d347c);})['then'](function(_0x38ebcb){_0x42a837[_0x2715('0x48')]=_0x38ebcb;return _0x42a837;})[_0x2715('0x28')](respondWithFilteredResult(_0x5e53c9,_0x1d347c,'getVoiceQueuesReport'))[_0x2715('0x49')](handleError(_0x5e53c9,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 068ba9f..f466a26 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 _0xd7e5=['hook','exports','events','../../mysqldb','VoiceQueueReport','update','remove','emit','hasOwnProperty'];(function(_0x3c8a22,_0x4aadab){var _0xf9bb0b=function(_0xcee79d){while(--_0xcee79d){_0x3c8a22['push'](_0x3c8a22['shift']());}};_0xf9bb0b(++_0x4aadab);}(_0xd7e5,0xd1));var _0x5d7e=function(_0x3e70eb,_0x25877c){_0x3e70eb=_0x3e70eb-0x0;var _0x130b22=_0xd7e5[_0x3e70eb];return _0x130b22;};'use strict';var EventEmitter=require(_0x5d7e('0x0'));var VoiceQueueReport=require(_0x5d7e('0x1'))['db'][_0x5d7e('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5d7e('0x3'),'afterDestroy':_0x5d7e('0x4')};function emitEvent(_0x2e52d7){return function(_0x90efd1,_0x348ab5,_0x5b6836){VoiceQueueReportEvents[_0x5d7e('0x5')](_0x2e52d7+':'+_0x90efd1['id'],_0x90efd1);VoiceQueueReportEvents['emit'](_0x2e52d7,_0x90efd1);_0x5b6836(null);};}for(var e in events){if(events[_0x5d7e('0x6')](e)){var event=events[e];VoiceQueueReport[_0x5d7e('0x7')](e,emitEvent(event));}}module[_0x5d7e('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xbdee=['hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','emit'];(function(_0x5ed781,_0x530807){var _0x45000d=function(_0x281f3a){while(--_0x281f3a){_0x5ed781['push'](_0x5ed781['shift']());}};_0x45000d(++_0x530807);}(_0xbdee,0xaa));var _0xebde=function(_0x5c39ec,_0x324bef){_0x5c39ec=_0x5c39ec-0x0;var _0x1a2a44=_0xbdee[_0x5c39ec];return _0x1a2a44;};'use strict';var EventEmitter=require(_0xebde('0x0'));var VoiceQueueReport=require(_0xebde('0x1'))['db'][_0xebde('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xebde('0x3')](0x0);var events={'afterCreate':_0xebde('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4e7fdc){return function(_0x3e9861,_0x5008c3,_0x1b5c21){VoiceQueueReportEvents[_0xebde('0x5')](_0x4e7fdc+':'+_0x3e9861['id'],_0x3e9861);VoiceQueueReportEvents[_0xebde('0x5')](_0x4e7fdc,_0x3e9861);_0x1b5c21(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xebde('0x6')](e,emitEvent(event));}}module[_0xebde('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 579eea6..53cb164 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 _0xa1db=['request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','report_queue','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2f717f,_0x1e424d){var _0x24c4fb=function(_0x185f30){while(--_0x185f30){_0x2f717f['push'](_0x2f717f['shift']());}};_0x24c4fb(++_0x1e424d);}(_0xa1db,0x15a));var _0xba1d=function(_0x59f3c8,_0x269e43){_0x59f3c8=_0x59f3c8-0x0;var _0x320c2f=_0xa1db[_0x59f3c8];return _0x320c2f;};'use strict';var _=require(_0xba1d('0x0'));var util=require('util');var logger=require(_0xba1d('0x1'))(_0xba1d('0x2'));var moment=require(_0xba1d('0x3'));var BPromise=require(_0xba1d('0x4'));var rp=require(_0xba1d('0x5'));var fs=require('fs');var path=require(_0xba1d('0x6'));var rimraf=require(_0xba1d('0x7'));var config=require(_0xba1d('0x8'));var attributes=require(_0xba1d('0x9'));module[_0xba1d('0xa')]=function(_0x54c5b1,_0x3a0a49){return _0x54c5b1[_0xba1d('0xb')]('VoiceQueueReport',attributes,{'tableName':_0xba1d('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b48=['util','api','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x508794,_0x20e88c){var _0x2df96a=function(_0x355e29){while(--_0x355e29){_0x508794['push'](_0x508794['shift']());}};_0x2df96a(++_0x20e88c);}(_0x0b48,0xf1));var _0x80b4=function(_0xb25243,_0x462a9f){_0xb25243=_0xb25243-0x0;var _0x36d17d=_0x0b48[_0xb25243];return _0x36d17d;};'use strict';var _=require(_0x80b4('0x0'));var util=require(_0x80b4('0x1'));var logger=require('../../config/logger')(_0x80b4('0x2'));var moment=require('moment');var BPromise=require(_0x80b4('0x3'));var rp=require(_0x80b4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x80b4('0x5'));var config=require(_0x80b4('0x6'));var attributes=require(_0x80b4('0x7'));module[_0x80b4('0x8')]=function(_0x1120ea,_0xc4da2e){return _0x1120ea[_0x80b4('0x9')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x80b4('0xa')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 48bcbb0..fa855eb 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 _0x87a6=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','then','info','request\x20sent','debug','stringify','error','message','catch','VoiceQueueReport,\x20%s,\x20%s','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','limit','include','map','model','create','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','lodash'];(function(_0x480148,_0x1c3026){var _0x3b875f=function(_0x34a69f){while(--_0x34a69f){_0x480148['push'](_0x480148['shift']());}};_0x3b875f(++_0x1c3026);}(_0x87a6,0x1b7));var _0x687a=function(_0x5e1081,_0x42ba87){_0x5e1081=_0x5e1081-0x0;var _0x368c35=_0x87a6[_0x5e1081];return _0x368c35;};'use strict';var _=require(_0x687a('0x0'));var util=require(_0x687a('0x1'));var moment=require(_0x687a('0x2'));var BPromise=require(_0x687a('0x3'));var rs=require(_0x687a('0x4'));var fs=require('fs');var Redis=require(_0x687a('0x5'));var db=require(_0x687a('0x6'))['db'];var utils=require(_0x687a('0x7'));var logger=require(_0x687a('0x8'))(_0x687a('0x9'));var config=require('../../config/environment');var jayson=require(_0x687a('0xa'));var client=jayson[_0x687a('0xb')][_0x687a('0xc')]({'port':0x232a});config[_0x687a('0xd')]=_[_0x687a('0xe')](config[_0x687a('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x687a('0xf'))(new Redis(config[_0x687a('0xd')]));require(_0x687a('0x10'))['register'](socket);function respondWithRpcPromise(_0x4f21cb,_0xd9cd57,_0x143075){return new BPromise(function(_0x134377,_0xea2aeb){return client['request'](_0x4f21cb,_0x143075)[_0x687a('0x11')](function(_0x10f17b){logger[_0x687a('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0xd9cd57,_0x687a('0x13'));logger[_0x687a('0x14')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0xd9cd57,_0x687a('0x13'),JSON[_0x687a('0x15')](_0x10f17b));if(_0x10f17b[_0x687a('0x16')]){if(_0x10f17b[_0x687a('0x16')]['code']===0x1f4){logger[_0x687a('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0xd9cd57,_0x10f17b[_0x687a('0x16')][_0x687a('0x17')]);return _0xea2aeb(_0x10f17b[_0x687a('0x16')][_0x687a('0x17')]);}logger[_0x687a('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0xd9cd57,_0x10f17b[_0x687a('0x16')][_0x687a('0x17')]);return _0x134377(_0x10f17b['error'][_0x687a('0x17')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0xd9cd57,_0x687a('0x13'));_0x134377(_0x10f17b['result'][_0x687a('0x17')]);}})[_0x687a('0x18')](function(_0x5d16e){logger['error'](_0x687a('0x19'),_0xd9cd57,_0x5d16e);_0xea2aeb(_0x5d16e);});});}exports[_0x687a('0x1a')]=function(_0x2946c2){var _0x36c916=this;return new Promise(function(_0x187a0b,_0x444771){return db[_0x687a('0x1b')]['findAll']({'raw':_0x2946c2[_0x687a('0x1c')]?_0x2946c2[_0x687a('0x1c')][_0x687a('0x1d')]===undefined?!![]:![]:!![],'where':_0x2946c2[_0x687a('0x1c')]?_0x2946c2[_0x687a('0x1c')][_0x687a('0x1e')]||null:null,'attributes':_0x2946c2['options']?_0x2946c2[_0x687a('0x1c')][_0x687a('0x1f')]||null:null,'limit':_0x2946c2[_0x687a('0x1c')]?_0x2946c2[_0x687a('0x1c')][_0x687a('0x20')]||null:null,'include':_0x2946c2[_0x687a('0x1c')]?_0x2946c2[_0x687a('0x1c')][_0x687a('0x21')]?_[_0x687a('0x22')](_0x2946c2[_0x687a('0x1c')][_0x687a('0x21')],function(_0xd0ead8){return{'model':db[_0xd0ead8[_0x687a('0x23')]],'as':_0xd0ead8['as'],'attributes':_0xd0ead8[_0x687a('0x1f')],'include':_0xd0ead8[_0x687a('0x21')]?_['map'](_0xd0ead8[_0x687a('0x21')],function(_0x4ef433){return{'model':db[_0x4ef433['model']],'as':_0x4ef433['as'],'attributes':_0x4ef433['attributes'],'include':_0x4ef433[_0x687a('0x21')]?_[_0x687a('0x22')](_0x4ef433['include'],function(_0x57db35){return{'model':db[_0x57db35['model']],'as':_0x57db35['as'],'attributes':_0x57db35[_0x687a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x687a('0x11')](function(_0x3b0d89){logger[_0x687a('0x12')](_0x687a('0x1a'),_0x2946c2);logger[_0x687a('0x14')](_0x687a('0x1a'),_0x2946c2,JSON[_0x687a('0x15')](_0x3b0d89));_0x187a0b(_0x3b0d89);})[_0x687a('0x18')](function(_0xefa8d6){logger[_0x687a('0x16')](_0x687a('0x1a'),_0xefa8d6[_0x687a('0x17')],_0x2946c2);_0x444771(_0x36c916[_0x687a('0x16')](0x1f4,_0xefa8d6[_0x687a('0x17')]));});});};exports['CreateVoiceQueueReport']=function(_0x39a50d){var _0x4b7449=this;return new Promise(function(_0x527099,_0x44717c){return db['VoiceQueueReport'][_0x687a('0x24')](_0x39a50d['body'],{'raw':_0x39a50d[_0x687a('0x1c')]?_0x39a50d[_0x687a('0x1c')][_0x687a('0x1d')]===undefined?!![]:![]:!![]})[_0x687a('0x11')](function(_0x1b43ae){logger[_0x687a('0x12')](_0x687a('0x25'),_0x39a50d);logger[_0x687a('0x14')](_0x687a('0x25'),_0x39a50d,JSON[_0x687a('0x15')](_0x1b43ae));_0x527099(_0x1b43ae);})[_0x687a('0x18')](function(_0x321c96){logger[_0x687a('0x16')]('CreateVoiceQueueReport',_0x321c96[_0x687a('0x17')],_0x39a50d);_0x44717c(_0x4b7449['error'](0x1f4,_0x321c96[_0x687a('0x17')]));});});};exports['UpdateVoiceQueueReport']=function(_0x373ba8){var _0x4ab7df=this;return new Promise(function(_0x20c3bf,_0xc206e0){return db[_0x687a('0x1b')]['update'](_0x373ba8[_0x687a('0x26')],{'raw':_0x373ba8[_0x687a('0x1c')]?_0x373ba8[_0x687a('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x373ba8[_0x687a('0x1c')]?_0x373ba8[_0x687a('0x1c')]['where']||null:null,'attributes':_0x373ba8[_0x687a('0x1c')]?_0x373ba8[_0x687a('0x1c')][_0x687a('0x1f')]||null:null,'limit':_0x373ba8[_0x687a('0x1c')]?_0x373ba8[_0x687a('0x1c')]['limit']||null:null})[_0x687a('0x11')](function(_0xa5481d){logger[_0x687a('0x12')](_0x687a('0x27'),_0x373ba8);logger[_0x687a('0x14')](_0x687a('0x27'),_0x373ba8,JSON[_0x687a('0x15')](_0xa5481d));_0x20c3bf(_0xa5481d);})[_0x687a('0x18')](function(_0x2ac2be){logger[_0x687a('0x16')](_0x687a('0x27'),_0x2ac2be[_0x687a('0x17')],_0x373ba8);_0xc206e0(_0x4ab7df[_0x687a('0x16')](0x1f4,_0x2ac2be[_0x687a('0x17')]));});});}; \ No newline at end of file +var _0xba32=['where','attributes','limit','map','include','model','debug','catch','CreateVoiceQueueReport','VoiceQueueReport','create','UpdateVoiceQueueReport','update','body','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceQueueReport.socket','register','request','then','request\x20sent','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','info','result','GetVoiceQueueReport','options','raw'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0xba32,0x126));var _0x2ba3=function(_0x37e848,_0x418405){_0x37e848=_0x37e848-0x0;var _0x512fe7=_0xba32[_0x37e848];return _0x512fe7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2ba3('0x0'));var BPromise=require('bluebird');var rs=require(_0x2ba3('0x1'));var fs=require('fs');var Redis=require(_0x2ba3('0x2'));var db=require(_0x2ba3('0x3'))['db'];var utils=require(_0x2ba3('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x2ba3('0x5'));var jayson=require(_0x2ba3('0x6'));var client=jayson[_0x2ba3('0x7')][_0x2ba3('0x8')]({'port':0x232a});config[_0x2ba3('0x9')]=_[_0x2ba3('0xa')](config[_0x2ba3('0x9')],{'host':_0x2ba3('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ba3('0x9')]));require(_0x2ba3('0xc'))[_0x2ba3('0xd')](socket);function respondWithRpcPromise(_0x3c7aaa,_0x48d5bf,_0x1c0c92){return new BPromise(function(_0x4fece9,_0xf68684){return client[_0x2ba3('0xe')](_0x3c7aaa,_0x1c0c92)[_0x2ba3('0xf')](function(_0x5f5cd8){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x48d5bf,_0x2ba3('0x10'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x48d5bf,_0x2ba3('0x10'),JSON[_0x2ba3('0x11')](_0x5f5cd8));if(_0x5f5cd8[_0x2ba3('0x12')]){if(_0x5f5cd8[_0x2ba3('0x12')]['code']===0x1f4){logger[_0x2ba3('0x12')](_0x2ba3('0x13'),_0x48d5bf,_0x5f5cd8[_0x2ba3('0x12')][_0x2ba3('0x14')]);return _0xf68684(_0x5f5cd8[_0x2ba3('0x12')]['message']);}logger[_0x2ba3('0x12')](_0x2ba3('0x13'),_0x48d5bf,_0x5f5cd8[_0x2ba3('0x12')][_0x2ba3('0x14')]);return _0x4fece9(_0x5f5cd8[_0x2ba3('0x12')][_0x2ba3('0x14')]);}else{logger[_0x2ba3('0x15')](_0x2ba3('0x13'),_0x48d5bf,_0x2ba3('0x10'));_0x4fece9(_0x5f5cd8[_0x2ba3('0x16')][_0x2ba3('0x14')]);}})['catch'](function(_0xb03244){logger[_0x2ba3('0x12')](_0x2ba3('0x13'),_0x48d5bf,_0xb03244);_0xf68684(_0xb03244);});});}exports[_0x2ba3('0x17')]=function(_0x4a0e84){var _0x1d699e=this;return new Promise(function(_0x3de33e,_0x1e2189){return db['VoiceQueueReport']['findAll']({'raw':_0x4a0e84[_0x2ba3('0x18')]?_0x4a0e84['options'][_0x2ba3('0x19')]===undefined?!![]:![]:!![],'where':_0x4a0e84[_0x2ba3('0x18')]?_0x4a0e84['options'][_0x2ba3('0x1a')]||null:null,'attributes':_0x4a0e84[_0x2ba3('0x18')]?_0x4a0e84['options'][_0x2ba3('0x1b')]||null:null,'limit':_0x4a0e84[_0x2ba3('0x18')]?_0x4a0e84['options'][_0x2ba3('0x1c')]||null:null,'include':_0x4a0e84[_0x2ba3('0x18')]?_0x4a0e84[_0x2ba3('0x18')]['include']?_[_0x2ba3('0x1d')](_0x4a0e84['options'][_0x2ba3('0x1e')],function(_0x237ef2){return{'model':db[_0x237ef2['model']],'as':_0x237ef2['as'],'attributes':_0x237ef2['attributes'],'include':_0x237ef2['include']?_[_0x2ba3('0x1d')](_0x237ef2[_0x2ba3('0x1e')],function(_0x49f8c3){return{'model':db[_0x49f8c3[_0x2ba3('0x1f')]],'as':_0x49f8c3['as'],'attributes':_0x49f8c3[_0x2ba3('0x1b')],'include':_0x49f8c3[_0x2ba3('0x1e')]?_[_0x2ba3('0x1d')](_0x49f8c3[_0x2ba3('0x1e')],function(_0x1d58ea){return{'model':db[_0x1d58ea[_0x2ba3('0x1f')]],'as':_0x1d58ea['as'],'attributes':_0x1d58ea[_0x2ba3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2ba3('0xf')](function(_0x726312){logger[_0x2ba3('0x15')](_0x2ba3('0x17'),_0x4a0e84);logger[_0x2ba3('0x20')](_0x2ba3('0x17'),_0x4a0e84,JSON[_0x2ba3('0x11')](_0x726312));_0x3de33e(_0x726312);})[_0x2ba3('0x21')](function(_0x2e14da){logger[_0x2ba3('0x12')](_0x2ba3('0x17'),_0x2e14da[_0x2ba3('0x14')],_0x4a0e84);_0x1e2189(_0x1d699e[_0x2ba3('0x12')](0x1f4,_0x2e14da[_0x2ba3('0x14')]));});});};exports[_0x2ba3('0x22')]=function(_0x55af8d){var _0x4d42b0=this;return new Promise(function(_0x1a5bd8,_0x2e6c77){return db[_0x2ba3('0x23')][_0x2ba3('0x24')](_0x55af8d['body'],{'raw':_0x55af8d[_0x2ba3('0x18')]?_0x55af8d[_0x2ba3('0x18')][_0x2ba3('0x19')]===undefined?!![]:![]:!![]})[_0x2ba3('0xf')](function(_0x2f5c66){logger[_0x2ba3('0x15')](_0x2ba3('0x22'),_0x55af8d);logger[_0x2ba3('0x20')]('CreateVoiceQueueReport',_0x55af8d,JSON[_0x2ba3('0x11')](_0x2f5c66));_0x1a5bd8(_0x2f5c66);})[_0x2ba3('0x21')](function(_0x1b85fd){logger[_0x2ba3('0x12')]('CreateVoiceQueueReport',_0x1b85fd[_0x2ba3('0x14')],_0x55af8d);_0x2e6c77(_0x4d42b0[_0x2ba3('0x12')](0x1f4,_0x1b85fd[_0x2ba3('0x14')]));});});};exports[_0x2ba3('0x25')]=function(_0x249c3f){var _0x17df2a=this;return new Promise(function(_0x1638b6,_0x3cbc56){return db[_0x2ba3('0x23')][_0x2ba3('0x26')](_0x249c3f[_0x2ba3('0x27')],{'raw':_0x249c3f[_0x2ba3('0x18')]?_0x249c3f[_0x2ba3('0x18')][_0x2ba3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x249c3f['options']?_0x249c3f[_0x2ba3('0x18')][_0x2ba3('0x1a')]||null:null,'attributes':_0x249c3f[_0x2ba3('0x18')]?_0x249c3f['options']['attributes']||null:null,'limit':_0x249c3f['options']?_0x249c3f[_0x2ba3('0x18')][_0x2ba3('0x1c')]||null:null})[_0x2ba3('0xf')](function(_0x1d4508){logger[_0x2ba3('0x15')]('UpdateVoiceQueueReport',_0x249c3f);logger['debug']('UpdateVoiceQueueReport',_0x249c3f,JSON[_0x2ba3('0x11')](_0x1d4508));_0x1638b6(_0x1d4508);})[_0x2ba3('0x21')](function(_0xc8114){logger['error'](_0x2ba3('0x25'),_0xc8114[_0x2ba3('0x14')],_0x249c3f);_0x3cbc56(_0x17df2a[_0x2ba3('0x12')](0x1f4,_0xc8114[_0x2ba3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index fda34f9..d2ce48b 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 _0x3a5e=['emit','removeListener','register','voiceQueueReport:','./voiceQueueReport.events','save','remove','update'];(function(_0x309a2c,_0x2f5ef6){var _0x73407b=function(_0x31b53c){while(--_0x31b53c){_0x309a2c['push'](_0x309a2c['shift']());}};_0x73407b(++_0x2f5ef6);}(_0x3a5e,0x14c));var _0xe3a5=function(_0x2f9223,_0x1df35f){_0x2f9223=_0x2f9223-0x0;var _0x592f69=_0x3a5e[_0x2f9223];return _0x592f69;};'use strict';var VoiceQueueReportEvents=require(_0xe3a5('0x0'));var events=[_0xe3a5('0x1'),_0xe3a5('0x2'),_0xe3a5('0x3')];function createListener(_0x378b86,_0x36ef75){return function(_0x509cb0){_0x36ef75[_0xe3a5('0x4')](_0x378b86,_0x509cb0);};}function removeListener(_0x189d9c,_0x46dbe3){return function(){VoiceQueueReportEvents[_0xe3a5('0x5')](_0x189d9c,_0x46dbe3);};}exports[_0xe3a5('0x6')]=function(_0x499f61){for(var _0x5e1507=0x0,_0x3ad90a=events['length'];_0x5e1507<_0x3ad90a;_0x5e1507++){var _0x8b22ec=events[_0x5e1507];var _0x32fab4=createListener(_0xe3a5('0x7')+_0x8b22ec,_0x499f61);VoiceQueueReportEvents['on'](_0x8b22ec,_0x32fab4);}}; \ No newline at end of file +var _0xfd7b=['removeListener','register','length','save','remove','update','emit'];(function(_0xc7adfa,_0x2d929d){var _0x203646=function(_0x470ce9){while(--_0x470ce9){_0xc7adfa['push'](_0xc7adfa['shift']());}};_0x203646(++_0x2d929d);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0xfd7b[_0x234ae1];return _0x227ba0;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xbfd7('0x0'),_0xbfd7('0x1'),_0xbfd7('0x2')];function createListener(_0x27db01,_0x1ea39e){return function(_0x1f9ae1){_0x1ea39e[_0xbfd7('0x3')](_0x27db01,_0x1f9ae1);};}function removeListener(_0x221ad1,_0x249e59){return function(){VoiceQueueReportEvents[_0xbfd7('0x4')](_0x221ad1,_0x249e59);};}exports[_0xbfd7('0x5')]=function(_0x2ad158){for(var _0x639dd4=0x0,_0x5f3067=events[_0xbfd7('0x6')];_0x639dd4<_0x5f3067;_0x639dd4++){var _0x48f2aa=events[_0x639dd4];var _0x33dab1=createListener('voiceQueueReport:'+_0x48f2aa,_0x2ad158);VoiceQueueReportEvents['on'](_0x48f2aa,_0x33dab1);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 83eb530..b552720 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 _0x2333=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','express'];(function(_0x4c995d,_0x5d4844){var _0xae6874=function(_0x2426dd){while(--_0x2426dd){_0x4c995d['push'](_0x4c995d['shift']());}};_0xae6874(++_0x5d4844);}(_0x2333,0x11a));var _0x3233=function(_0x13696f,_0x35b97a){_0x13696f=_0x13696f-0x0;var _0x4acaf1=_0x2333[_0x13696f];return _0x4acaf1;};'use strict';var multer=require(_0x3233('0x0'));var util=require(_0x3233('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3233('0x2'));var router=express[_0x3233('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3233('0x4'));var interaction=require(_0x3233('0x5'));var config=require(_0x3233('0x6'));var controller=require(_0x3233('0x7'));router[_0x3233('0x8')]('/',auth[_0x3233('0x9')](),controller[_0x3233('0xa')]);router[_0x3233('0x8')](_0x3233('0xb'),auth[_0x3233('0x9')](),controller[_0x3233('0xc')]);router[_0x3233('0xd')]('/',auth[_0x3233('0x9')](),controller[_0x3233('0xe')]);router[_0x3233('0xf')](_0x3233('0xb'),auth[_0x3233('0x9')](),controller[_0x3233('0x10')]);router[_0x3233('0x11')](_0x3233('0xb'),auth[_0x3233('0x9')](),controller['destroy']);module[_0x3233('0x12')]=router; \ No newline at end of file +var _0x7aa2=['show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','get','/:id'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x7aa2,0x132));var _0x27aa=function(_0x5650d7,_0x51f443){_0x5650d7=_0x5650d7-0x0;var _0x42431d=_0x7aa2[_0x5650d7];return _0x42431d;};'use strict';var multer=require(_0x27aa('0x0'));var util=require(_0x27aa('0x1'));var path=require(_0x27aa('0x2'));var timeout=require(_0x27aa('0x3'));var express=require(_0x27aa('0x4'));var router=express[_0x27aa('0x5')]();var fs_extra=require(_0x27aa('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x27aa('0x7'));var config=require(_0x27aa('0x8'));var controller=require(_0x27aa('0x9'));router['get']('/',auth[_0x27aa('0xa')](),controller[_0x27aa('0xb')]);router[_0x27aa('0xc')](_0x27aa('0xd'),auth[_0x27aa('0xa')](),controller[_0x27aa('0xe')]);router['post']('/',auth[_0x27aa('0xa')](),controller[_0x27aa('0xf')]);router[_0x27aa('0x10')](_0x27aa('0xd'),auth[_0x27aa('0xa')](),controller[_0x27aa('0x11')]);router[_0x27aa('0x12')]('/:id',auth[_0x27aa('0xa')](),controller[_0x27aa('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 7752bf8..6ea9755 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 _0x1aa8=['STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment'];(function(_0x4bcaea,_0x8879db){var _0x4d0417=function(_0x4f1e4f){while(--_0x4f1e4f){_0x4bcaea['push'](_0x4bcaea['shift']());}};_0x4d0417(++_0x8879db);}(_0x1aa8,0x190));var _0x81aa=function(_0x84953c,_0x14913b){_0x84953c=_0x84953c-0x0;var _0x8e60be=_0x1aa8[_0x84953c];return _0x8e60be;};'use strict';var Sequelize=require(_0x81aa('0x0'));var moment=require(_0x81aa('0x1'));module['exports']={'time':{'type':Sequelize[_0x81aa('0x2')]},'callid':{'type':Sequelize[_0x81aa('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x81aa('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x81aa('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x81aa('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x81aa('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x81aa('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x81aa('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x81aa('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x81aa('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x81aa('0x4')](_0x81aa('0x5'))}}; \ No newline at end of file +var _0x23f6=['sequelize','moment','exports','STRING','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x2eb60b,_0x9542ca){var _0x1b6a31=function(_0xe8e192){while(--_0xe8e192){_0x2eb60b['push'](_0x2eb60b['shift']());}};_0x1b6a31(++_0x9542ca);}(_0x23f6,0x13e));var _0x623f=function(_0x79c952,_0x2511eb){_0x79c952=_0x79c952-0x0;var _0x2964d1=_0x23f6[_0x79c952];return _0x2964d1;};'use strict';var Sequelize=require(_0x623f('0x0'));var moment=require(_0x623f('0x1'));module[_0x623f('0x2')]={'time':{'type':Sequelize[_0x623f('0x3')]},'callid':{'type':Sequelize[_0x623f('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x623f('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x623f('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x623f('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x623f('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x623f('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x623f('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x623f('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x623f('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x623f('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x623f('0x4')](_0x623f('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 31f0603..335ae1d 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 _0x3610=['offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','filters','include','options','find','create','body','params','rimraf','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x455d5c,_0x2996e6){var _0x3a0799=function(_0x5c8f4c){while(--_0x5c8f4c){_0x455d5c['push'](_0x455d5c['shift']());}};_0x3a0799(++_0x2996e6);}(_0x3610,0x7c));var _0x0361=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x3610[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0361('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0361('0x1'));var moment=require(_0x0361('0x2'));var BPromise=require(_0x0361('0x3'));var Mustache=require('mustache');var util=require(_0x0361('0x4'));var path=require(_0x0361('0x5'));var sox=require(_0x0361('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0361('0x7'));var _=require(_0x0361('0x8'));var squel=require(_0x0361('0x9'));var crypto=require(_0x0361('0xa'));var jsforce=require(_0x0361('0xb'));var deskjs=require(_0x0361('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0361('0xd'));var Papa=require('papaparse');var Redis=require(_0x0361('0xe'));var authService=require(_0x0361('0xf'));var qs=require(_0x0361('0x10'));var as=require(_0x0361('0x11'));var hardwareService=require(_0x0361('0x12'));var logger=require(_0x0361('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x0361('0x14'));var licenseUtil=require(_0x0361('0x15'));var db=require(_0x0361('0x16'))['db'];function respondWithStatusCode(_0x4aab86,_0x556b9d){_0x556b9d=_0x556b9d||0xcc;return function(_0x119e59){if(_0x119e59){return _0x4aab86[_0x0361('0x17')](_0x556b9d);}return _0x4aab86[_0x0361('0x18')](_0x556b9d)['end']();};}function respondWithResult(_0x42d407,_0xf527be){_0xf527be=_0xf527be||0xc8;return function(_0x1ac593){if(_0x1ac593){return _0x42d407['status'](_0xf527be)[_0x0361('0x19')](_0x1ac593);}};}function respondWithFilteredResult(_0x64ea7a,_0x407863){return function(_0x2e888b){if(_0x2e888b){var _0x3f0fc8=typeof _0x407863[_0x0361('0x1a')]==='undefined'&&typeof _0x407863['limit']===_0x0361('0x1b');var _0x3daf84=_0x2e888b[_0x0361('0x1c')];var _0x35ddfd=_0x3f0fc8?0x0:_0x407863[_0x0361('0x1a')];var _0x401563=_0x3f0fc8?_0x2e888b[_0x0361('0x1c')]:_0x407863[_0x0361('0x1a')]+_0x407863[_0x0361('0x1d')];var _0x54fe1b;if(_0x401563>=_0x3daf84){_0x401563=_0x3daf84;_0x54fe1b=0xc8;}else{_0x54fe1b=0xce;}_0x64ea7a[_0x0361('0x18')](_0x54fe1b);return _0x64ea7a['set'](_0x0361('0x1e'),_0x35ddfd+'-'+_0x401563+'/'+_0x3daf84)[_0x0361('0x19')](_0x2e888b);}return null;};}function patchUpdates(_0x1555e8){return function(_0x14e114){try{jsonpatch[_0x0361('0x1f')](_0x14e114,_0x1555e8,!![]);}catch(_0x4e5d00){return BPromise[_0x0361('0x20')](_0x4e5d00);}return _0x14e114['save']();};}function saveUpdates(_0x18fa21,_0x3c1f3b){return function(_0x40ceec){if(_0x40ceec){return _0x40ceec[_0x0361('0x21')](_0x18fa21)[_0x0361('0x22')](function(_0x3ed9d9){return _0x3ed9d9;});}return null;};}function removeEntity(_0x282a9a,_0x1bd224){return function(_0x5ca4e8){if(_0x5ca4e8){return _0x5ca4e8[_0x0361('0x23')]()[_0x0361('0x22')](function(){_0x282a9a['status'](0xcc)[_0x0361('0x24')]();});}};}function handleEntityNotFound(_0x35f3a4,_0x51b6e7){return function(_0x491f8a){if(!_0x491f8a){_0x35f3a4[_0x0361('0x17')](0x194);}return _0x491f8a;};}function handleError(_0x23f347,_0x296833){_0x296833=_0x296833||0x1f4;return function(_0x2deec7){logger['error'](_0x2deec7[_0x0361('0x25')]);if(_0x2deec7['name']){delete _0x2deec7[_0x0361('0x26')];}_0x23f347[_0x0361('0x18')](_0x296833)[_0x0361('0x27')](_0x2deec7);};}exports[_0x0361('0x28')]=function(_0x127de7,_0x12e398){var _0x204ad2={},_0x2c8716={},_0x681e7b={'count':0x0,'rows':[]};var _0x3d562d=_[_0x0361('0x29')](db[_0x0361('0x2a')][_0x0361('0x2b')],function(_0x1261ac){return{'name':_0x1261ac[_0x0361('0x2c')],'type':_0x1261ac[_0x0361('0x2d')][_0x0361('0x2e')]};});_0x2c8716[_0x0361('0x2f')]=_[_0x0361('0x29')](_0x3d562d,_0x0361('0x26'));_0x2c8716[_0x0361('0x30')]=_[_0x0361('0x31')](_0x127de7[_0x0361('0x30')]);_0x2c8716['filters']=_[_0x0361('0x32')](_0x2c8716[_0x0361('0x2f')],_0x2c8716[_0x0361('0x30')]);_0x204ad2[_0x0361('0x33')]=_[_0x0361('0x32')](_0x2c8716[_0x0361('0x2f')],qs['fields'](_0x127de7[_0x0361('0x30')][_0x0361('0x34')]));_0x204ad2[_0x0361('0x33')]=_0x204ad2[_0x0361('0x33')][_0x0361('0x35')]?_0x204ad2[_0x0361('0x33')]:_0x2c8716[_0x0361('0x2f')];if(!_0x127de7[_0x0361('0x30')][_0x0361('0x36')](_0x0361('0x37'))){_0x204ad2[_0x0361('0x1d')]=qs[_0x0361('0x1d')](_0x127de7[_0x0361('0x30')]['limit']);_0x204ad2[_0x0361('0x1a')]=qs[_0x0361('0x1a')](_0x127de7[_0x0361('0x30')][_0x0361('0x1a')]);}_0x204ad2[_0x0361('0x38')]=qs[_0x0361('0x39')](_0x127de7[_0x0361('0x30')][_0x0361('0x39')]);_0x204ad2[_0x0361('0x3a')]=qs['filters'](_[_0x0361('0x3b')](_0x127de7[_0x0361('0x30')],_0x2c8716['filters']),_0x3d562d);if(_0x127de7[_0x0361('0x30')]['filter']){_0x204ad2['where']=_[_0x0361('0x3c')](_0x204ad2['where'],{'$or':_[_0x0361('0x29')](_0x3d562d,function(_0x5293b2){if(_0x5293b2[_0x0361('0x2d')]!==_0x0361('0x3d')){var _0x24ebff={};_0x24ebff[_0x5293b2[_0x0361('0x26')]]={'$like':'%'+_0x127de7['query'][_0x0361('0x3e')]+'%'};return _0x24ebff;}})});}_0x204ad2=_[_0x0361('0x3c')]({},_0x204ad2,_0x127de7['options']);var _0x2a63a1={'where':_0x204ad2[_0x0361('0x3a')]};return db['VoiceQueuesLog'][_0x0361('0x1c')](_0x2a63a1)['then'](function(_0x3f45f4){_0x681e7b[_0x0361('0x1c')]=_0x3f45f4;if(_0x127de7[_0x0361('0x30')][_0x0361('0x3f')]){_0x204ad2['include']=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x0361('0x40')](_0x204ad2);})[_0x0361('0x22')](function(_0x44c6d2){_0x681e7b[_0x0361('0x41')]=_0x44c6d2;return _0x681e7b;})[_0x0361('0x22')](respondWithFilteredResult(_0x12e398,_0x204ad2))[_0x0361('0x42')](handleError(_0x12e398,null));};exports[_0x0361('0x43')]=function(_0x4d32cc,_0x4dbc06){var _0x2dab75={'raw':!![],'where':{'id':_0x4d32cc['params']['id']}},_0x1d3da9={};_0x1d3da9['model']=_[_0x0361('0x31')](db[_0x0361('0x2a')][_0x0361('0x2b')]);_0x1d3da9['query']=_[_0x0361('0x31')](_0x4d32cc['query']);_0x1d3da9[_0x0361('0x44')]=_[_0x0361('0x32')](_0x1d3da9[_0x0361('0x2f')],_0x1d3da9[_0x0361('0x30')]);_0x2dab75[_0x0361('0x33')]=_[_0x0361('0x32')](_0x1d3da9[_0x0361('0x2f')],qs[_0x0361('0x34')](_0x4d32cc[_0x0361('0x30')][_0x0361('0x34')]));_0x2dab75['attributes']=_0x2dab75[_0x0361('0x33')][_0x0361('0x35')]?_0x2dab75[_0x0361('0x33')]:_0x1d3da9[_0x0361('0x2f')];if(_0x4d32cc[_0x0361('0x30')][_0x0361('0x3f')]){_0x2dab75[_0x0361('0x45')]=[{'all':!![]}];}_0x2dab75=_['merge']({},_0x2dab75,_0x4d32cc[_0x0361('0x46')]);return db['VoiceQueuesLog'][_0x0361('0x47')](_0x2dab75)[_0x0361('0x22')](handleEntityNotFound(_0x4dbc06,null))['then'](respondWithResult(_0x4dbc06,null))[_0x0361('0x42')](handleError(_0x4dbc06,null));};exports['create']=function(_0x10f549,_0x4415b7){return db[_0x0361('0x2a')][_0x0361('0x48')](_0x10f549[_0x0361('0x49')],{})[_0x0361('0x22')](respondWithResult(_0x4415b7,0xc9))[_0x0361('0x42')](handleError(_0x4415b7,null));};exports[_0x0361('0x21')]=function(_0x2538bf,_0x10daac){if(_0x2538bf[_0x0361('0x49')]['id']){delete _0x2538bf[_0x0361('0x49')]['id'];}return db[_0x0361('0x2a')][_0x0361('0x47')]({'where':{'id':_0x2538bf[_0x0361('0x4a')]['id']}})[_0x0361('0x22')](handleEntityNotFound(_0x10daac,null))['then'](saveUpdates(_0x2538bf[_0x0361('0x49')],null))['then'](respondWithResult(_0x10daac,null))[_0x0361('0x42')](handleError(_0x10daac,null));};exports[_0x0361('0x23')]=function(_0x544e42,_0x110705){return db['VoiceQueuesLog'][_0x0361('0x47')]({'where':{'id':_0x544e42[_0x0361('0x4a')]['id']}})[_0x0361('0x22')](handleEntityNotFound(_0x110705,null))[_0x0361('0x22')](removeEntity(_0x110705,null))['catch'](handleError(_0x110705,null));}; \ No newline at end of file +var _0xd6c6=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','end','error','stack','name','map','VoiceQueuesLog','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x55e9e9,_0x1afc74){var _0x39cb0c=function(_0x4c02f3){while(--_0x4c02f3){_0x55e9e9['push'](_0x55e9e9['shift']());}};_0x39cb0c(++_0x1afc74);}(_0xd6c6,0xd7));var _0x6d6c=function(_0x2bbae6,_0x3e36df){_0x2bbae6=_0x2bbae6-0x0;var _0x47f128=_0xd6c6[_0x2bbae6];return _0x47f128;};'use strict';var emlformat=require(_0x6d6c('0x0'));var rimraf=require(_0x6d6c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d6c('0x2'));var rp=require(_0x6d6c('0x3'));var moment=require(_0x6d6c('0x4'));var BPromise=require(_0x6d6c('0x5'));var Mustache=require(_0x6d6c('0x6'));var util=require(_0x6d6c('0x7'));var path=require(_0x6d6c('0x8'));var sox=require(_0x6d6c('0x9'));var csv=require(_0x6d6c('0xa'));var ejs=require(_0x6d6c('0xb'));var fs=require('fs');var fs_extra=require(_0x6d6c('0xc'));var _=require(_0x6d6c('0xd'));var squel=require(_0x6d6c('0xe'));var crypto=require(_0x6d6c('0xf'));var jsforce=require(_0x6d6c('0x10'));var deskjs=require(_0x6d6c('0x11'));var toCsv=require(_0x6d6c('0xa'));var querystring=require(_0x6d6c('0x12'));var Papa=require(_0x6d6c('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6d6c('0x14'));var as=require(_0x6d6c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d6c('0x16'))('api');var utils=require(_0x6d6c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6d6c('0x18'));var db=require(_0x6d6c('0x19'))['db'];function respondWithStatusCode(_0x26de55,_0x1c7aab){_0x1c7aab=_0x1c7aab||0xcc;return function(_0x363516){if(_0x363516){return _0x26de55[_0x6d6c('0x1a')](_0x1c7aab);}return _0x26de55[_0x6d6c('0x1b')](_0x1c7aab)['end']();};}function respondWithResult(_0x276b63,_0x40eca7){_0x40eca7=_0x40eca7||0xc8;return function(_0x39b709){if(_0x39b709){return _0x276b63[_0x6d6c('0x1b')](_0x40eca7)[_0x6d6c('0x1c')](_0x39b709);}};}function respondWithFilteredResult(_0x5b080d,_0x4ed475){return function(_0x2bb990){if(_0x2bb990){var _0x51214b=typeof _0x4ed475[_0x6d6c('0x1d')]===_0x6d6c('0x1e')&&typeof _0x4ed475[_0x6d6c('0x1f')]===_0x6d6c('0x1e');var _0x1195a4=_0x2bb990[_0x6d6c('0x20')];var _0xb94d8f=_0x51214b?0x0:_0x4ed475[_0x6d6c('0x1d')];var _0x56abdc=_0x51214b?_0x2bb990[_0x6d6c('0x20')]:_0x4ed475[_0x6d6c('0x1d')]+_0x4ed475['limit'];var _0x221c28;if(_0x56abdc>=_0x1195a4){_0x56abdc=_0x1195a4;_0x221c28=0xc8;}else{_0x221c28=0xce;}_0x5b080d[_0x6d6c('0x1b')](_0x221c28);return _0x5b080d[_0x6d6c('0x21')]('Content-Range',_0xb94d8f+'-'+_0x56abdc+'/'+_0x1195a4)[_0x6d6c('0x1c')](_0x2bb990);}return null;};}function patchUpdates(_0x1544c5){return function(_0x5ee10f){try{jsonpatch[_0x6d6c('0x22')](_0x5ee10f,_0x1544c5,!![]);}catch(_0x536d14){return BPromise[_0x6d6c('0x23')](_0x536d14);}return _0x5ee10f['save']();};}function saveUpdates(_0x25e774,_0x4a0e09){return function(_0x19dba9){if(_0x19dba9){return _0x19dba9[_0x6d6c('0x24')](_0x25e774)[_0x6d6c('0x25')](function(_0xd5d6d3){return _0xd5d6d3;});}return null;};}function removeEntity(_0x35df78,_0x1d6e6e){return function(_0x51fba0){if(_0x51fba0){return _0x51fba0['destroy']()[_0x6d6c('0x25')](function(){_0x35df78[_0x6d6c('0x1b')](0xcc)[_0x6d6c('0x26')]();});}};}function handleEntityNotFound(_0x2d9f01,_0x2293cc){return function(_0x1435a4){if(!_0x1435a4){_0x2d9f01[_0x6d6c('0x1a')](0x194);}return _0x1435a4;};}function handleError(_0x5cedae,_0x4f277b){_0x4f277b=_0x4f277b||0x1f4;return function(_0x26ee40){logger[_0x6d6c('0x27')](_0x26ee40[_0x6d6c('0x28')]);if(_0x26ee40[_0x6d6c('0x29')]){delete _0x26ee40[_0x6d6c('0x29')];}_0x5cedae[_0x6d6c('0x1b')](_0x4f277b)['send'](_0x26ee40);};}exports['index']=function(_0x4f84f3,_0x2489c6){var _0x15c2c6={},_0x1648e5={},_0x250a2b={'count':0x0,'rows':[]};var _0x3d21b8=_[_0x6d6c('0x2a')](db[_0x6d6c('0x2b')][_0x6d6c('0x2c')],function(_0x30927d){return{'name':_0x30927d[_0x6d6c('0x2d')],'type':_0x30927d['type'][_0x6d6c('0x2e')]};});_0x1648e5[_0x6d6c('0x2f')]=_['map'](_0x3d21b8,'name');_0x1648e5[_0x6d6c('0x30')]=_['keys'](_0x4f84f3[_0x6d6c('0x30')]);_0x1648e5['filters']=_[_0x6d6c('0x31')](_0x1648e5[_0x6d6c('0x2f')],_0x1648e5[_0x6d6c('0x30')]);_0x15c2c6[_0x6d6c('0x32')]=_[_0x6d6c('0x31')](_0x1648e5[_0x6d6c('0x2f')],qs['fields'](_0x4f84f3['query'][_0x6d6c('0x33')]));_0x15c2c6[_0x6d6c('0x32')]=_0x15c2c6[_0x6d6c('0x32')][_0x6d6c('0x34')]?_0x15c2c6[_0x6d6c('0x32')]:_0x1648e5[_0x6d6c('0x2f')];if(!_0x4f84f3[_0x6d6c('0x30')][_0x6d6c('0x35')](_0x6d6c('0x36'))){_0x15c2c6[_0x6d6c('0x1f')]=qs[_0x6d6c('0x1f')](_0x4f84f3[_0x6d6c('0x30')][_0x6d6c('0x1f')]);_0x15c2c6[_0x6d6c('0x1d')]=qs['offset'](_0x4f84f3[_0x6d6c('0x30')]['offset']);}_0x15c2c6[_0x6d6c('0x37')]=qs['sort'](_0x4f84f3[_0x6d6c('0x30')][_0x6d6c('0x38')]);_0x15c2c6[_0x6d6c('0x39')]=qs[_0x6d6c('0x3a')](_['pick'](_0x4f84f3['query'],_0x1648e5[_0x6d6c('0x3a')]),_0x3d21b8);if(_0x4f84f3[_0x6d6c('0x30')][_0x6d6c('0x3b')]){_0x15c2c6[_0x6d6c('0x39')]=_[_0x6d6c('0x3c')](_0x15c2c6[_0x6d6c('0x39')],{'$or':_[_0x6d6c('0x2a')](_0x3d21b8,function(_0x1b6853){if(_0x1b6853[_0x6d6c('0x3d')]!==_0x6d6c('0x3e')){var _0x279efc={};_0x279efc[_0x1b6853[_0x6d6c('0x29')]]={'$like':'%'+_0x4f84f3[_0x6d6c('0x30')][_0x6d6c('0x3b')]+'%'};return _0x279efc;}})});}_0x15c2c6=_['merge']({},_0x15c2c6,_0x4f84f3[_0x6d6c('0x3f')]);var _0x285123={'where':_0x15c2c6[_0x6d6c('0x39')]};return db[_0x6d6c('0x2b')][_0x6d6c('0x20')](_0x285123)[_0x6d6c('0x25')](function(_0x432553){_0x250a2b[_0x6d6c('0x20')]=_0x432553;if(_0x4f84f3[_0x6d6c('0x30')][_0x6d6c('0x40')]){_0x15c2c6[_0x6d6c('0x41')]=[{'all':!![]}];}return db[_0x6d6c('0x2b')][_0x6d6c('0x42')](_0x15c2c6);})['then'](function(_0xef65de){_0x250a2b[_0x6d6c('0x43')]=_0xef65de;return _0x250a2b;})[_0x6d6c('0x25')](respondWithFilteredResult(_0x2489c6,_0x15c2c6))[_0x6d6c('0x44')](handleError(_0x2489c6,null));};exports[_0x6d6c('0x45')]=function(_0x3caf24,_0x2f1390){var _0x4ef60a={'raw':!![],'where':{'id':_0x3caf24['params']['id']}},_0x4b2331={};_0x4b2331[_0x6d6c('0x2f')]=_[_0x6d6c('0x46')](db[_0x6d6c('0x2b')][_0x6d6c('0x2c')]);_0x4b2331['query']=_[_0x6d6c('0x46')](_0x3caf24[_0x6d6c('0x30')]);_0x4b2331[_0x6d6c('0x3a')]=_[_0x6d6c('0x31')](_0x4b2331[_0x6d6c('0x2f')],_0x4b2331[_0x6d6c('0x30')]);_0x4ef60a[_0x6d6c('0x32')]=_[_0x6d6c('0x31')](_0x4b2331[_0x6d6c('0x2f')],qs['fields'](_0x3caf24[_0x6d6c('0x30')][_0x6d6c('0x33')]));_0x4ef60a[_0x6d6c('0x32')]=_0x4ef60a['attributes']['length']?_0x4ef60a[_0x6d6c('0x32')]:_0x4b2331[_0x6d6c('0x2f')];if(_0x3caf24[_0x6d6c('0x30')]['includeAll']){_0x4ef60a[_0x6d6c('0x41')]=[{'all':!![]}];}_0x4ef60a=_['merge']({},_0x4ef60a,_0x3caf24[_0x6d6c('0x3f')]);return db['VoiceQueuesLog']['find'](_0x4ef60a)['then'](handleEntityNotFound(_0x2f1390,null))['then'](respondWithResult(_0x2f1390,null))[_0x6d6c('0x44')](handleError(_0x2f1390,null));};exports[_0x6d6c('0x47')]=function(_0x358ff7,_0x261624){return db['VoiceQueuesLog'][_0x6d6c('0x47')](_0x358ff7[_0x6d6c('0x48')],{})[_0x6d6c('0x25')](respondWithResult(_0x261624,0xc9))[_0x6d6c('0x44')](handleError(_0x261624,null));};exports[_0x6d6c('0x24')]=function(_0x49996c,_0x51c83b){if(_0x49996c[_0x6d6c('0x48')]['id']){delete _0x49996c[_0x6d6c('0x48')]['id'];}return db['VoiceQueuesLog'][_0x6d6c('0x49')]({'where':{'id':_0x49996c[_0x6d6c('0x4a')]['id']}})[_0x6d6c('0x25')](handleEntityNotFound(_0x51c83b,null))[_0x6d6c('0x25')](saveUpdates(_0x49996c[_0x6d6c('0x48')],null))['then'](respondWithResult(_0x51c83b,null))['catch'](handleError(_0x51c83b,null));};exports[_0x6d6c('0x4b')]=function(_0x4b4d40,_0x18d4c4){return db[_0x6d6c('0x2b')][_0x6d6c('0x49')]({'where':{'id':_0x4b4d40[_0x6d6c('0x4a')]['id']}})[_0x6d6c('0x25')](handleEntityNotFound(_0x18d4c4,null))['then'](removeEntity(_0x18d4c4,null))[_0x6d6c('0x44')](handleError(_0x18d4c4,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index bc80ea7..260a63b 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 _0xd66c=['./voiceQueuesLog.attributes','exports','define','voice_queues_log','event_dtm','event','dtm','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd66c,0x106));var _0xcd66=function(_0x39ddf1,_0x4ddf8a){_0x39ddf1=_0x39ddf1-0x0;var _0xe30e04=_0xd66c[_0x39ddf1];return _0xe30e04;};'use strict';var _=require(_0xcd66('0x0'));var util=require('util');var logger=require(_0xcd66('0x1'))(_0xcd66('0x2'));var moment=require(_0xcd66('0x3'));var BPromise=require(_0xcd66('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd66('0x5'));var rimraf=require(_0xcd66('0x6'));var config=require(_0xcd66('0x7'));var attributes=require(_0xcd66('0x8'));module[_0xcd66('0x9')]=function(_0x2cb861,_0x476c79){return _0x2cb861[_0xcd66('0xa')]('VoiceQueuesLog',attributes,{'tableName':_0xcd66('0xb'),'paranoid':![],'indexes':[{'name':_0xcd66('0xc'),'fields':[_0xcd66('0xd'),_0xcd66('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x8ce3=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','lodash'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x8ce3,0xc3));var _0x38ce=function(_0xeaf92d,_0x26a3bf){_0xeaf92d=_0xeaf92d-0x0;var _0x573a6a=_0x8ce3[_0xeaf92d];return _0x573a6a;};'use strict';var _=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var logger=require('../../config/logger')(_0x38ce('0x2'));var moment=require(_0x38ce('0x3'));var BPromise=require(_0x38ce('0x4'));var rp=require(_0x38ce('0x5'));var fs=require('fs');var path=require(_0x38ce('0x6'));var rimraf=require(_0x38ce('0x7'));var config=require(_0x38ce('0x8'));var attributes=require(_0x38ce('0x9'));module['exports']=function(_0x372f86,_0xb24f4c){return _0x372f86['define'](_0x38ce('0xa'),attributes,{'tableName':_0x38ce('0xb'),'paranoid':![],'indexes':[{'name':_0x38ce('0xc'),'fields':['event',_0x38ce('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index ac6efe9..4c0d0df 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 _0x4717=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','randomstring'];(function(_0x53762e,_0x45330a){var _0x2d939f=function(_0x52b082){while(--_0x52b082){_0x53762e['push'](_0x53762e['shift']());}};_0x2d939f(++_0x45330a);}(_0x4717,0x1e1));var _0x7471=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x4717[_0x5e36d1];return _0x950b9e;};'use strict';var _=require('lodash');var util=require(_0x7471('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7471('0x1'));var fs=require('fs');var Redis=require(_0x7471('0x2'));var db=require(_0x7471('0x3'))['db'];var utils=require(_0x7471('0x4'));var logger=require(_0x7471('0x5'))(_0x7471('0x6'));var config=require(_0x7471('0x7'));var jayson=require(_0x7471('0x8'));var client=jayson[_0x7471('0x9')][_0x7471('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11d86f,_0x2b6274,_0x566a98){return new BPromise(function(_0xd223fb,_0x41587d){return client[_0x7471('0xb')](_0x11d86f,_0x566a98)[_0x7471('0xc')](function(_0x138093){logger[_0x7471('0xd')](_0x7471('0xe'),_0x2b6274,_0x7471('0xf'));logger[_0x7471('0x10')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x2b6274,'request\x20sent',JSON[_0x7471('0x11')](_0x138093));if(_0x138093[_0x7471('0x12')]){if(_0x138093['error'][_0x7471('0x13')]===0x1f4){logger[_0x7471('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2b6274,_0x138093['error']['message']);return _0x41587d(_0x138093[_0x7471('0x12')][_0x7471('0x14')]);}logger[_0x7471('0x12')](_0x7471('0xe'),_0x2b6274,_0x138093[_0x7471('0x12')][_0x7471('0x14')]);return _0xd223fb(_0x138093[_0x7471('0x12')][_0x7471('0x14')]);}else{logger[_0x7471('0xd')](_0x7471('0xe'),_0x2b6274,'request\x20sent');_0xd223fb(_0x138093[_0x7471('0x15')]['message']);}})[_0x7471('0x16')](function(_0x155c9d){logger[_0x7471('0x12')](_0x7471('0xe'),_0x2b6274,_0x155c9d);_0x41587d(_0x155c9d);});});} \ No newline at end of file +var _0xf109=['util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x42e94f,_0x192d00){var _0x13efd6=function(_0x1562e6){while(--_0x1562e6){_0x42e94f['push'](_0x42e94f['shift']());}};_0x13efd6(++_0x192d00);}(_0xf109,0xce));var _0x9f10=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xf109[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var moment=require(_0x9f10('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f10('0x3'))['db'];var utils=require(_0x9f10('0x4'));var logger=require(_0x9f10('0x5'))(_0x9f10('0x6'));var config=require(_0x9f10('0x7'));var jayson=require(_0x9f10('0x8'));var client=jayson[_0x9f10('0x9')][_0x9f10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x227a29,_0x2a877e,_0x3fd82f){return new BPromise(function(_0x5c8719,_0x42a8cd){return client[_0x9f10('0xb')](_0x227a29,_0x3fd82f)[_0x9f10('0xc')](function(_0x1bde2e){logger[_0x9f10('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2a877e,_0x9f10('0xe'));logger[_0x9f10('0xf')](_0x9f10('0x10'),_0x2a877e,'request\x20sent',JSON['stringify'](_0x1bde2e));if(_0x1bde2e[_0x9f10('0x11')]){if(_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x12')]===0x1f4){logger['error'](_0x9f10('0x13'),_0x2a877e,_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x14')]);return _0x42a8cd(_0x1bde2e['error'][_0x9f10('0x14')]);}logger[_0x9f10('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2a877e,_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x14')]);return _0x5c8719(_0x1bde2e['error']['message']);}else{logger[_0x9f10('0xd')](_0x9f10('0x13'),_0x2a877e,'request\x20sent');_0x5c8719(_0x1bde2e[_0x9f10('0x15')]['message']);}})[_0x9f10('0x16')](function(_0x1f68d8){logger['error'](_0x9f10('0x13'),_0x2a877e,_0x1f68d8);_0x42a8cd(_0x1f68d8);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index eefcb5f..31c3f2a 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 _0x9f00=['post','create','runTranscribe','put','update','/:id','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0x9f00,0xc3));var _0x09f0=function(_0x906e88,_0x2b5046){_0x906e88=_0x906e88-0x0;var _0x551acb=_0x9f00[_0x906e88];return _0x551acb;};'use strict';var multer=require(_0x09f0('0x0'));var util=require(_0x09f0('0x1'));var path=require(_0x09f0('0x2'));var timeout=require(_0x09f0('0x3'));var express=require('express');var router=express[_0x09f0('0x4')]();var fs_extra=require(_0x09f0('0x5'));var auth=require(_0x09f0('0x6'));var interaction=require(_0x09f0('0x7'));var config=require(_0x09f0('0x8'));var controller=require(_0x09f0('0x9'));router[_0x09f0('0xa')]('/',auth[_0x09f0('0xb')](),controller[_0x09f0('0xc')]);router[_0x09f0('0xa')](_0x09f0('0xd'),auth[_0x09f0('0xb')](),controller[_0x09f0('0xe')]);router[_0x09f0('0xa')]('/:id',auth[_0x09f0('0xb')](),controller[_0x09f0('0xf')]);router[_0x09f0('0xa')](_0x09f0('0x10'),auth[_0x09f0('0xb')](),controller['download']);router[_0x09f0('0xa')](_0x09f0('0x11'),controller[_0x09f0('0x12')]);router[_0x09f0('0xa')](_0x09f0('0x13'),auth['isAuthenticated'](),controller[_0x09f0('0x14')]);router[_0x09f0('0x15')]('/',auth[_0x09f0('0xb')](),controller[_0x09f0('0x16')]);router[_0x09f0('0x15')](_0x09f0('0x13'),auth['isAuthenticated'](),controller[_0x09f0('0x17')]);router[_0x09f0('0x18')]('/:id',auth[_0x09f0('0xb')](),controller[_0x09f0('0x19')]);router['delete'](_0x09f0('0x1a'),auth[_0x09f0('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x52f0=['/:id/transcribe','post','create','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x2419c9,_0x262667){var _0x7605e=function(_0x1e5c11){while(--_0x1e5c11){_0x2419c9['push'](_0x2419c9['shift']());}};_0x7605e(++_0x262667);}(_0x52f0,0x17f));var _0x052f=function(_0x53618a,_0x3ce1c8){_0x53618a=_0x53618a-0x0;var _0x588ddb=_0x52f0[_0x53618a];return _0x588ddb;};'use strict';var multer=require(_0x052f('0x0'));var util=require(_0x052f('0x1'));var path=require(_0x052f('0x2'));var timeout=require(_0x052f('0x3'));var express=require('express');var router=express[_0x052f('0x4')]();var fs_extra=require(_0x052f('0x5'));var auth=require(_0x052f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x052f('0x7'));var controller=require('./voiceRecording.controller');router[_0x052f('0x8')]('/',auth[_0x052f('0x9')](),controller[_0x052f('0xa')]);router[_0x052f('0x8')](_0x052f('0xb'),auth[_0x052f('0x9')](),controller[_0x052f('0xc')]);router['get'](_0x052f('0xd'),auth['isAuthenticated'](),controller[_0x052f('0xe')]);router[_0x052f('0x8')](_0x052f('0xf'),auth[_0x052f('0x9')](),controller['download']);router['get']('/:id/downloads',controller['downloads']);router['get'](_0x052f('0x10'),auth[_0x052f('0x9')](),controller['downloadTranscribe']);router[_0x052f('0x11')]('/',auth[_0x052f('0x9')](),controller[_0x052f('0x12')]);router[_0x052f('0x11')](_0x052f('0x10'),auth[_0x052f('0x9')](),controller['runTranscribe']);router['put'](_0x052f('0xd'),auth['isAuthenticated'](),controller[_0x052f('0x13')]);router[_0x052f('0x14')](_0x052f('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index a8519ba..4ea2d5d 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(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 3c6d902..8025f05 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 _0xb20e=['papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','VoiceRecording','rawAttributes','fieldName','key','differenceBy','map','format','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','find','catch','update','body','describe','download','../../components/encryptor','uniqueid','value','decryptFile','secrets','recording','existsSync','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','Not\x20found','downloads','sequelize','token','push','$and','%s.cypher','Sequelize','extname','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','location','Location','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','transcribeAccountId','transcribeRegion','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','CloudProvider','findOne','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring'];(function(_0x5c287a,_0x445e09){var _0x4b5f70=function(_0x3cbca4){while(--_0x3cbca4){_0x5c287a['push'](_0x5c287a['shift']());}};_0x4b5f70(++_0x445e09);}(_0xb20e,0x1ac));var _0xeb20=function(_0x6b7e57,_0x42df54){_0x6b7e57=_0x6b7e57-0x0;var _0x37b16d=_0xb20e[_0x6b7e57];return _0x37b16d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeb20('0x0'));var jsonpatch=require(_0xeb20('0x1'));var rp=require(_0xeb20('0x2'));var moment=require(_0xeb20('0x3'));var BPromise=require(_0xeb20('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xeb20('0x5'));var sox=require(_0xeb20('0x6'));var csv=require(_0xeb20('0x7'));var ejs=require(_0xeb20('0x8'));var fs=require('fs');var fs_extra=require(_0xeb20('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xeb20('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xeb20('0xb'));var toCsv=require(_0xeb20('0x7'));var querystring=require(_0xeb20('0xc'));var Papa=require(_0xeb20('0xd'));var AWS=require(_0xeb20('0xe'));var uuidv4=require(_0xeb20('0xf'));var Redis=require(_0xeb20('0x10'));var authService=require(_0xeb20('0x11'));var qs=require(_0xeb20('0x12'));var as=require(_0xeb20('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb20('0x14'))(_0xeb20('0x15'));var utils=require(_0xeb20('0x16'));var config=require(_0xeb20('0x17'));var licenseUtil=require(_0xeb20('0x18'));var db=require(_0xeb20('0x19'))['db'];function respondWithStatusCode(_0x146cc7,_0x529f40){_0x529f40=_0x529f40||0xcc;return function(_0x4e1989){if(_0x4e1989){return _0x146cc7[_0xeb20('0x1a')](_0x529f40);}return _0x146cc7[_0xeb20('0x1b')](_0x529f40)[_0xeb20('0x1c')]();};}function respondWithResult(_0x1e68ce,_0x47b6d7){_0x47b6d7=_0x47b6d7||0xc8;return function(_0x2f7558){if(_0x2f7558){return _0x1e68ce[_0xeb20('0x1b')](_0x47b6d7)[_0xeb20('0x1d')](_0x2f7558);}};}function respondWithFilteredResult(_0x2a9782,_0x3bdf38){return function(_0x7e0cb8){if(_0x7e0cb8){var _0x37130b=typeof _0x3bdf38[_0xeb20('0x1e')]==='undefined'&&typeof _0x3bdf38['limit']===_0xeb20('0x1f');var _0x2b12a5=_0x7e0cb8[_0xeb20('0x20')];var _0x28e147=_0x37130b?0x0:_0x3bdf38['offset'];var _0xde7efe=_0x37130b?_0x7e0cb8[_0xeb20('0x20')]:_0x3bdf38[_0xeb20('0x1e')]+_0x3bdf38[_0xeb20('0x21')];var _0x4b2f7b;if(_0xde7efe>=_0x2b12a5){_0xde7efe=_0x2b12a5;_0x4b2f7b=0xc8;}else{_0x4b2f7b=0xce;}_0x2a9782[_0xeb20('0x1b')](_0x4b2f7b);return _0x2a9782[_0xeb20('0x22')](_0xeb20('0x23'),_0x28e147+'-'+_0xde7efe+'/'+_0x2b12a5)[_0xeb20('0x1d')](_0x7e0cb8);}return null;};}function patchUpdates(_0x3f75e9){return function(_0x2f31a1){try{jsonpatch[_0xeb20('0x24')](_0x2f31a1,_0x3f75e9,!![]);}catch(_0x6d91e){return BPromise[_0xeb20('0x25')](_0x6d91e);}return _0x2f31a1[_0xeb20('0x26')]();};}function saveUpdates(_0x50e1d9,_0x1a2a32){return function(_0x2bc4cc){if(_0x2bc4cc){return _0x2bc4cc['update'](_0x50e1d9)[_0xeb20('0x27')](function(_0x1cdf47){return _0x1cdf47;});}return null;};}function removeEntity(_0x3a97f7,_0xab639a){return function(_0x32e029){if(_0x32e029){return _0x32e029[_0xeb20('0x28')]()[_0xeb20('0x27')](function(){_0x3a97f7[_0xeb20('0x1b')](0xcc)[_0xeb20('0x1c')]();});}};}function handleEntityNotFound(_0xd84097,_0x5ba18a){return function(_0x422f26){if(!_0x422f26){_0xd84097[_0xeb20('0x1a')](0x194);}return _0x422f26;};}function handleError(_0x53fa6c,_0x76c1d6){_0x76c1d6=_0x76c1d6||0x1f4;return function(_0x3ae6fe){logger[_0xeb20('0x29')](_0x3ae6fe[_0xeb20('0x2a')]);if(_0x3ae6fe[_0xeb20('0x2b')]){delete _0x3ae6fe[_0xeb20('0x2b')];}_0x53fa6c[_0xeb20('0x1b')](_0x76c1d6)[_0xeb20('0x2c')](_0x3ae6fe);};}exports['index']=function(_0xc8f9f0,_0x589a87){var _0x1c8f4c={},_0x2c0290={},_0x4ccfcd={'count':0x0,'rows':[]};var _0x38f839=_['map'](db[_0xeb20('0x2d')][_0xeb20('0x2e')],function(_0x348f8c){return{'name':_0x348f8c[_0xeb20('0x2f')],'type':_0x348f8c['type'][_0xeb20('0x30')]};});_0x2c0290['model']=_[_0xeb20('0x31')](_[_0xeb20('0x32')](_0x38f839,_0xeb20('0x2b')),[_0xeb20('0x33')]);_0x2c0290[_0xeb20('0x34')]=_[_0xeb20('0x35')](_0xc8f9f0[_0xeb20('0x34')]);_0x2c0290[_0xeb20('0x36')]=_[_0xeb20('0x37')](_0x2c0290['model'],_0x2c0290[_0xeb20('0x34')]);_0x1c8f4c[_0xeb20('0x38')]=_[_0xeb20('0x37')](_0x2c0290[_0xeb20('0x39')],qs[_0xeb20('0x3a')](_0xc8f9f0['query'][_0xeb20('0x3a')]));_0x1c8f4c['attributes']=_0x1c8f4c[_0xeb20('0x38')]['length']?_0x1c8f4c['attributes']:_0x2c0290['model'];if(!_0xc8f9f0['query'][_0xeb20('0x3b')]('nolimit')){_0x1c8f4c[_0xeb20('0x21')]=qs[_0xeb20('0x21')](_0xc8f9f0[_0xeb20('0x34')][_0xeb20('0x21')]);_0x1c8f4c[_0xeb20('0x1e')]=qs[_0xeb20('0x1e')](_0xc8f9f0[_0xeb20('0x34')][_0xeb20('0x1e')]);}_0x1c8f4c[_0xeb20('0x3c')]=qs['sort'](_0xc8f9f0[_0xeb20('0x34')][_0xeb20('0x3d')]);_0x1c8f4c['where']=qs[_0xeb20('0x36')](_[_0xeb20('0x3e')](_0xc8f9f0[_0xeb20('0x34')],_0x2c0290[_0xeb20('0x36')]),_0x38f839);if(_0xc8f9f0['query'][_0xeb20('0x3f')]){_0x1c8f4c[_0xeb20('0x40')]=_[_0xeb20('0x41')](_0x1c8f4c[_0xeb20('0x40')],{'$or':_[_0xeb20('0x32')](_0x38f839,function(_0x512e06){if(_0x512e06[_0xeb20('0x42')]!==_0xeb20('0x43')){var _0x4420e2={};_0x4420e2[_0x512e06[_0xeb20('0x2b')]]={'$like':'%'+_0xc8f9f0['query'][_0xeb20('0x3f')]+'%'};return _0x4420e2;}})});}_0x1c8f4c=_[_0xeb20('0x41')]({},_0x1c8f4c,_0xc8f9f0[_0xeb20('0x44')]);var _0x4f7cb1={'where':_0x1c8f4c['where']};return db[_0xeb20('0x2d')][_0xeb20('0x20')](_0x4f7cb1)['then'](function(_0x120c85){_0x4ccfcd[_0xeb20('0x20')]=_0x120c85;if(_0xc8f9f0[_0xeb20('0x34')][_0xeb20('0x45')]){_0x1c8f4c['include']=[{'all':!![]}];}return db[_0xeb20('0x2d')][_0xeb20('0x46')](_0x1c8f4c);})['then'](function(_0x2abdd6){_0x4ccfcd[_0xeb20('0x47')]=_0x2abdd6;return _0x4ccfcd;})[_0xeb20('0x27')](respondWithFilteredResult(_0x589a87,_0x1c8f4c))['catch'](handleError(_0x589a87,null));};exports[_0xeb20('0x48')]=function(_0x35f27c,_0x3cb8b1){var _0x556178={'raw':![],'where':{'id':_0x35f27c[_0xeb20('0x49')]['id']}},_0xb35920={};_0xb35920[_0xeb20('0x39')]=_[_0xeb20('0x35')](db['VoiceRecording'][_0xeb20('0x2e')]);_0xb35920[_0xeb20('0x34')]=_[_0xeb20('0x35')](_0x35f27c[_0xeb20('0x34')]);_0xb35920[_0xeb20('0x36')]=_[_0xeb20('0x37')](_0xb35920[_0xeb20('0x39')],_0xb35920[_0xeb20('0x34')]);_0x556178[_0xeb20('0x38')]=_[_0xeb20('0x37')](_0xb35920[_0xeb20('0x39')],qs['fields'](_0x35f27c[_0xeb20('0x34')][_0xeb20('0x3a')]));_0x556178[_0xeb20('0x38')]=_0x556178[_0xeb20('0x38')]['length']?_0x556178[_0xeb20('0x38')]:_0xb35920[_0xeb20('0x39')];if(_0x35f27c[_0xeb20('0x34')][_0xeb20('0x45')]){_0x556178['include']=[{'all':!![]}];}_0x556178=_['merge']({},_0x556178,_0x35f27c[_0xeb20('0x44')]);return db[_0xeb20('0x2d')][_0xeb20('0x4a')](_0x556178)['then'](handleEntityNotFound(_0x3cb8b1,null))[_0xeb20('0x27')](respondWithResult(_0x3cb8b1,null))[_0xeb20('0x4b')](handleError(_0x3cb8b1,null));};exports['create']=function(_0x38268c,_0x19bcc5){return db[_0xeb20('0x2d')]['create'](_0x38268c['body'],{})[_0xeb20('0x27')](respondWithResult(_0x19bcc5,0xc9))[_0xeb20('0x4b')](handleError(_0x19bcc5,null));};exports[_0xeb20('0x4c')]=function(_0x4d8bec,_0xe1b31){if(_0x4d8bec['body']['id']){delete _0x4d8bec[_0xeb20('0x4d')]['id'];}return db[_0xeb20('0x2d')]['find']({'where':{'id':_0x4d8bec[_0xeb20('0x49')]['id']}})[_0xeb20('0x27')](handleEntityNotFound(_0xe1b31,null))[_0xeb20('0x27')](saveUpdates(_0x4d8bec['body'],null))['then'](respondWithResult(_0xe1b31,null))[_0xeb20('0x4b')](handleError(_0xe1b31,null));};exports[_0xeb20('0x4e')]=function(_0x283e89,_0x773130){return db[_0xeb20('0x2d')]['describe']()[_0xeb20('0x27')](respondWithResult(_0x773130,null))['catch'](handleError(_0x773130,null));};exports[_0xeb20('0x4f')]=function(_0x31216a,_0x11e23a,_0x17fb20){var _0x4f5886=require(_0xeb20('0x50'));var _0x28d1c9=![];var _0x430901={};if(_0x31216a['query']['type']&&_0x31216a[_0xeb20('0x34')]['type']===_0xeb20('0x51')){_0x430901[_0xeb20('0x51')]=_0x31216a[_0xeb20('0x49')]['id'];}else{_0x430901['id']=_0x31216a['params']['id'];}return db[_0xeb20('0x2d')][_0xeb20('0x4a')]({'where':_0x430901,'attributes':['id',_0xeb20('0x52')],'raw':!![]})[_0xeb20('0x27')](handleEntityNotFound(_0x11e23a,null))['then'](function(_0x230136){if(_0x230136){var _0x5d3174=_0x230136[_0xeb20('0x52')];var _0x2d950c=util['format']('%s.cypher',_0x5d3174);if(fs['existsSync'](_0x2d950c)){_0x28d1c9=!![];return _0x4f5886[_0xeb20('0x53')](_0x2d950c,_0x5d3174,config[_0xeb20('0x54')][_0xeb20('0x55')])[_0xeb20('0x27')](function(){return _0x230136;});}return _0x230136;}})[_0xeb20('0x27')](function(_0x581439){if(_0x581439){var _0x2960ff=_0x581439[_0xeb20('0x52')];if(!fs[_0xeb20('0x56')](_0x2960ff)){throw new db['Sequelize'][(_0xeb20('0x57'))](_0xeb20('0x58'));}if(_0x581439[_0xeb20('0x59')]){return _0x11e23a['download'](_0x2960ff,_0x581439['filename']+path['extname'](_0x2960ff),function(){if(_0x28d1c9){fs['unlink'](_0x2960ff);}});}else{return _0x11e23a[_0xeb20('0x4f')](_0x2960ff,function(_0x218792){if(_0x28d1c9){fs[_0xeb20('0x5a')](_0x2960ff);}});}}})[_0xeb20('0x4b')](function(_0x366360){if(_0x366360['message']===_0xeb20('0x58')){_0x11e23a[_0xeb20('0x1b')](0x194)[_0xeb20('0x2c')](_0xeb20('0x5b'));}else{return handleError(_0x11e23a,null);}});};exports[_0xeb20('0x5c')]=function(_0x51a3a2,_0x485790,_0x54c7ff){var _0x233424=require(_0xeb20('0x50'));var _0xa8494e=![];var _0x12a2f7={'$and':[db[_0xeb20('0x5d')]['where'](db['sequelize']['fn']('MD5',db[_0xeb20('0x5d')]['col']('uniqueid')),_0x51a3a2[_0xeb20('0x34')][_0xeb20('0x5e')])]};if(_0x51a3a2['query']['type']&&_0x51a3a2[_0xeb20('0x34')][_0xeb20('0x42')]==='uniqueid'){_0x12a2f7['$and'][_0xeb20('0x5f')]({'uniqueid':_0x51a3a2[_0xeb20('0x49')]['id']});}else{_0x12a2f7[_0xeb20('0x60')][_0xeb20('0x5f')]({'id':_0x51a3a2[_0xeb20('0x49')]['id']});}return db[_0xeb20('0x2d')][_0xeb20('0x4a')]({'where':_0x12a2f7,'attributes':['id','value'],'raw':!![]})[_0xeb20('0x27')](handleEntityNotFound(_0x485790,null))[_0xeb20('0x27')](function(_0xc501de){if(_0xc501de){var _0x4b7db1=util[_0xeb20('0x33')](_0xeb20('0x61'),_0xc501de[_0xeb20('0x52')]);if(fs[_0xeb20('0x56')](_0x4b7db1)){_0xa8494e=!![];return _0x233424[_0xeb20('0x53')](_0x4b7db1,_0xc501de[_0xeb20('0x52')],config[_0xeb20('0x54')][_0xeb20('0x55')])[_0xeb20('0x27')](function(){return _0xc501de;});}return _0xc501de;}})[_0xeb20('0x27')](function(_0x48e34e){if(_0x48e34e){if(!fs[_0xeb20('0x56')](_0x48e34e[_0xeb20('0x52')])){throw new db[(_0xeb20('0x62'))][(_0xeb20('0x57'))]('VoiceRecording\x20not\x20found');}if(_0x48e34e[_0xeb20('0x59')]){return _0x485790[_0xeb20('0x4f')](_0x48e34e[_0xeb20('0x52')],_0x48e34e['filename']+path[_0xeb20('0x63')](_0x48e34e['value']),function(){if(_0xa8494e){fs[_0xeb20('0x5a')](_0x48e34e[_0xeb20('0x52')]);}});}else{return _0x485790[_0xeb20('0x4f')](_0x48e34e[_0xeb20('0x52')],function(_0x406479){if(_0xa8494e){fs[_0xeb20('0x5a')](_0x48e34e[_0xeb20('0x52')]);}});}}})[_0xeb20('0x4b')](handleError(_0x485790,null));};exports[_0xeb20('0x28')]=function(_0x344c94,_0x4f9a96){return db['VoiceRecording'][_0xeb20('0x4a')]({'where':{'id':_0x344c94[_0xeb20('0x49')]['id']}})[_0xeb20('0x27')](function(_0x586ba6){if(_[_0xeb20('0x64')](_0x586ba6)){throw new ReferenceError(_0xeb20('0x65'));}return _0x586ba6;})['then'](function(_0xbe9bb8){var _0x1a1dfd=_0xbe9bb8[_0xeb20('0x52')];logger[_0xeb20('0x66')](_0xeb20('0x67'),_0x1a1dfd);if(!_[_0xeb20('0x64')](_0xbe9bb8[_0xeb20('0x52')])&&fs[_0xeb20('0x56')](_0x1a1dfd)){logger[_0xeb20('0x66')]('File:\x20\x22'+_0x1a1dfd+_0xeb20('0x68'));fs[_0xeb20('0x69')](_0x1a1dfd);}_0x1a1dfd=_0x1a1dfd+'.cypher';if(!_['isNil'](_0xbe9bb8['value'])&&fs['existsSync'](_0x1a1dfd)){logger[_0xeb20('0x66')](_0xeb20('0x6a')+_0x1a1dfd+_0xeb20('0x68'));fs[_0xeb20('0x69')](_0x1a1dfd);}return _0xbe9bb8;})[_0xeb20('0x27')](function(_0x6cd17){if(!_0x6cd17)throw new InternalError();return _0x6cd17['destroy']();})['then'](function(){_0x4f9a96[_0xeb20('0x1b')](0xcc)[_0xeb20('0x1c')]();})[_0xeb20('0x4b')](handleError(_0x4f9a96,null));};function getBucketslist(_0x146d1d,_0x22b505,_0x286958){return new Promise(function(_0x2eb6aa,_0xa6a14a){var _0x39febd=new AWS['S3']({'accessKeyId':_0x22b505,'secretAccessKey':_0x146d1d,'region':_0x286958});_0x39febd[_0xeb20('0x6b')]({},function(_0x1f0b18,_0x4c3fd7){if(_0x1f0b18){return _0xa6a14a(_0x1f0b18);}else{return _0x2eb6aa(_0x4c3fd7);}});});}function createBucket(_0x4cfacd,_0x52b9c1,_0x1f8501,_0x2af633){return new Promise(function(_0x72489c,_0x5d63fe){var _0x3cdf84=new AWS['S3']({'accessKeyId':_0x52b9c1,'secretAccessKey':_0x4cfacd,'region':_0x1f8501});_0x3cdf84[_0xeb20('0x6c')]({'Bucket':_0x2af633},function(_0x459cba,_0x620faa){if(_0x459cba){return _0x5d63fe(_0x459cba);}else{return _0x72489c(_0x620faa);}});});}function uploadFile(_0x5a1b23,_0x261379,_0x4ab08f,_0x539fe3,_0x195aba,_0x48c018){return new Promise(function(_0x5b4d0a,_0x29dcd1){var _0x2a8c2f=new AWS['S3']({'accessKeyId':_0x261379,'secretAccessKey':_0x5a1b23,'region':_0x4ab08f});_0x2a8c2f[_0xeb20('0x6d')]({'Bucket':_0x539fe3,'Key':_0x195aba,'Body':_0x48c018},function(_0x51fce8,_0x3efd39){if(_0x51fce8){return _0x29dcd1(_0x51fce8);}else{return _0x5b4d0a(_0x3efd39);}});});}function startTranscribe(_0xa37c87,_0x2d4738,_0x49e4c8,_0x20394e,_0x422bf6,_0x2d5bb6){return new Promise(function(_0x58c431,_0xb07549){var _0x28c9bc=new AWS[(_0xeb20('0x6e'))]({'accessKeyId':_0x2d4738,'secretAccessKey':_0xa37c87,'region':_0x49e4c8});_0x28c9bc['startTranscriptionJob']({'TranscriptionJobName':_0x20394e,'LanguageCode':_0x422bf6,'Media':{'MediaFileUri':_0x2d5bb6}},function(_0x45e92b,_0x5bc616){if(_0x45e92b){return _0xb07549(_0x45e92b);}else{return _0x58c431(_0x5bc616);}});});}function transcribe(_0x21e7e7,_0x352744,_0x420801,_0x19972a,_0x476c1d,_0x2fc910,_0x3242f5){return new Promise(function(_0xf0c696,_0x5f27f0){var _0x58aaaf={};logger[_0xeb20('0x66')](util['format'](_0xeb20('0x6f'),_0x21e7e7,_0x476c1d));return uploadFile(_0x352744,_0x420801,_0x19972a,_0x476c1d,path[_0xeb20('0x70')](_0x2fc910),fs[_0xeb20('0x71')](_0x2fc910))[_0xeb20('0x27')](function(_0x106e9f){logger[_0xeb20('0x66')](util[_0xeb20('0x33')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x21e7e7,_0x476c1d,_0x106e9f['Location']));_0x58aaaf['bucket']=_0x106e9f['Bucket'];_0x58aaaf[_0xeb20('0x72')]=_0x106e9f[_0xeb20('0x73')];logger['info'](util[_0xeb20('0x33')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x21e7e7));return startTranscribe(_0x352744,_0x420801,_0x19972a,uuidv4(),_0x3242f5,_0x106e9f[_0xeb20('0x73')]);})[_0xeb20('0x27')](function(_0x65da7f){logger[_0xeb20('0x66')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x21e7e7,_0x65da7f[_0xeb20('0x74')][_0xeb20('0x75')]));_0x58aaaf['transcribeName']=_0x65da7f['TranscriptionJob'][_0xeb20('0x75')];_0x58aaaf[_0xeb20('0x76')]=_0x65da7f[_0xeb20('0x74')][_0xeb20('0x77')];return _0xf0c696(_0x58aaaf);})[_0xeb20('0x4b')](function(_0x5682d6){return _0x5f27f0(_0x5682d6);});});}exports[_0xeb20('0x78')]=function(_0x28d91f,_0x533a73,_0x448da3){var _0xcd680b;var _0x21b1d1;var _0x294cd8;var _0xb74ba6=require(_0xeb20('0x50'));return db[_0xeb20('0x2d')]['findOne']({'where':{'id':_0x28d91f['params']['id']}})[_0xeb20('0x27')](function(_0xfcc198){if(_0xfcc198){var _0x2a3deb=util[_0xeb20('0x33')](_0xeb20('0x61'),_0xfcc198[_0xeb20('0x52')]);if(fs[_0xeb20('0x56')](_0x2a3deb)){cypher=!![];return _0xb74ba6['decryptFile'](_0x2a3deb,_0xfcc198[_0xeb20('0x52')],config[_0xeb20('0x54')][_0xeb20('0x55')])[_0xeb20('0x27')](function(){return _0xfcc198;});}return _0xfcc198;}})[_0xeb20('0x27')](function(_0x2c787e){if(!_0x2c787e){throw new db[(_0xeb20('0x62'))][(_0xeb20('0x57'))]('Voice\x20Recording\x20not\x20found');}_0x21b1d1=_0x2c787e;return db['Setting']['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x533a73,null))[_0xeb20('0x27')](function(_0x2c07e2){if(_0x2c07e2){_0xcd680b=_0x2c07e2;if(!_0xcd680b['transcribe']||!_0xcd680b[_0xeb20('0x79')]||!_0xcd680b[_0xeb20('0x7a')]||!_0xcd680b['language']||!_0xcd680b[_0xeb20('0x7b')]){throw new db[(_0xeb20('0x62'))][(_0xeb20('0x57'))](_0xeb20('0x7c'));}if(_0x28d91f[_0xeb20('0x4d')][_0xeb20('0x7d')]&&(!_0xcd680b[_0xeb20('0x7e')]||!_0xcd680b[_0xeb20('0x7f')]||!_0xcd680b[_0xeb20('0x80')]||!_0xcd680b['language']||!_0xcd680b[_0xeb20('0x7b')])){throw new db[(_0xeb20('0x62'))][(_0xeb20('0x57'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xeb20('0x81')][_0xeb20('0x82')]({'where':{'id':_0xcd680b[_0xeb20('0x79')]}});}})['then'](function(_0x1a2b91){if(!_0x1a2b91){throw new db[(_0xeb20('0x62'))][(_0xeb20('0x57'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1a2b91[_0xeb20('0x83')]||!_0x1a2b91[_0xeb20('0x84')]){throw new db[(_0xeb20('0x62'))]['ValidationError'](_0xeb20('0x85'));}_0x294cd8=_0x1a2b91;return getBucketslist(_0x294cd8[_0xeb20('0x83')],_0x294cd8[_0xeb20('0x84')],_0xcd680b[_0xeb20('0x7a')]);})[_0xeb20('0x27')](function(_0x1e3a5d){if(_0x1e3a5d&&_0x1e3a5d[_0xeb20('0x86')]){var _0x42056c=_['find'](_0x1e3a5d[_0xeb20('0x86')],function(_0x5d0ac8){return _0x5d0ac8[_0xeb20('0x87')]===_0xcd680b[_0xeb20('0x7b')];});if(!_0x42056c){logger[_0xeb20('0x66')](util['format'](_0xeb20('0x88'),_0x28d91f[_0xeb20('0x49')]['id'],_0xcd680b[_0xeb20('0x7b')]));return createBucket(_0x294cd8['data1'],_0x294cd8['data2'],_0xcd680b[_0xeb20('0x7a')],_0xcd680b[_0xeb20('0x7b')]);}logger[_0xeb20('0x66')](util[_0xeb20('0x33')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x28d91f[_0xeb20('0x49')]['id'],_0xcd680b[_0xeb20('0x7b')]));return;}})['then'](function(_0x22531b){if(_0x21b1d1[_0xeb20('0x76')]===_0xeb20('0x89')){return transcribe(_0x28d91f[_0xeb20('0x49')]['id'],_0x294cd8[_0xeb20('0x83')],_0x294cd8[_0xeb20('0x84')],_0xcd680b['transcribeRegion'],_0xcd680b[_0xeb20('0x7b')],_0x21b1d1[_0xeb20('0x52')],_0xcd680b['language']);}else{logger[_0xeb20('0x66')](util[_0xeb20('0x33')](_0xeb20('0x8a'),_0x28d91f[_0xeb20('0x49')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xeb20('0x27')](function(_0x5da37c){if(_0x5da37c){_0x5da37c[_0xeb20('0x8b')]=_0x28d91f[_0xeb20('0x4d')][_0xeb20('0x7d')];return _0x21b1d1[_0xeb20('0x8c')](_0x5da37c);}})['then'](respondWithResult(_0x533a73,null))[_0xeb20('0x4b')](handleError(_0x533a73,null));};function writeFile(_0xb57496,_0x380957){return new Promise(function(_0x1a3d35,_0x9ab4c2){fs[_0xeb20('0x8d')](_0x380957,_0xb57496,function(_0x4f8386,_0x21d417){if(_0x4f8386){return _0x9ab4c2(_0x4f8386);}else{return _0x1a3d35(_0x21d417);}});});}exports[_0xeb20('0x8e')]=function(_0x5e5be2,_0x172b2c,_0x5a8be8){return db[_0xeb20('0x2d')]['findOne']({'where':{'id':_0x5e5be2[_0xeb20('0x49')]['id']}})['then'](handleEntityNotFound(_0x172b2c))[_0xeb20('0x27')](function(_0x160a83){if(_0x160a83&&_0x160a83[_0xeb20('0x8f')]){var _0x4754a5=_0x160a83[_0xeb20('0x8f')];var _0x5234a5=config[_0xeb20('0x90')]+'/server/files/transcribes/transcribe_'+_0x160a83['id']+_0xeb20('0x91');if(fs['existsSync'](_0x5234a5)){return _0x5234a5;}return writeFile(_0x4754a5,_0x5234a5)[_0xeb20('0x27')](function(){return _0x5234a5;});}else{throw new db[(_0xeb20('0x62'))][(_0xeb20('0x57'))](_0xeb20('0x92'));}})[_0xeb20('0x27')](function(_0x27b13d){return _0x172b2c['download'](_0x27b13d);})['catch'](handleError(_0x172b2c));}; \ No newline at end of file +var _0xedb0=['Not\x20found','downloads','sequelize','MD5','col','token','$and','push','%s.cypher','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','../../components/encryptor','findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','runSentiment','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../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','Content-Range','apply','reject','save','then','destroy','name','send','index','map','VoiceRecording','fieldName','model','differenceBy','format','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','describe','download','type','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message'];(function(_0x303a74,_0x2a17e5){var _0x5c401d=function(_0x579ddb){while(--_0x579ddb){_0x303a74['push'](_0x303a74['shift']());}};_0x5c401d(++_0x2a17e5);}(_0xedb0,0x17b));var _0x0edb=function(_0xc9dd01,_0xf6179b){_0xc9dd01=_0xc9dd01-0x0;var _0x48dd64=_0xedb0[_0xc9dd01];return _0x48dd64;};'use strict';var emlformat=require(_0x0edb('0x0'));var rimraf=require(_0x0edb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0edb('0x2'));var rp=require(_0x0edb('0x3'));var moment=require(_0x0edb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0edb('0x5'));var util=require(_0x0edb('0x6'));var path=require(_0x0edb('0x7'));var sox=require(_0x0edb('0x8'));var csv=require(_0x0edb('0x9'));var ejs=require(_0x0edb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0edb('0xb'));var jsforce=require(_0x0edb('0xc'));var deskjs=require(_0x0edb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0edb('0xe'));var Papa=require(_0x0edb('0xf'));var AWS=require(_0x0edb('0x10'));var uuidv4=require(_0x0edb('0x11'));var Redis=require(_0x0edb('0x12'));var authService=require(_0x0edb('0x13'));var qs=require(_0x0edb('0x14'));var as=require(_0x0edb('0x15'));var hardwareService=require(_0x0edb('0x16'));var logger=require('../../config/logger')(_0x0edb('0x17'));var utils=require(_0x0edb('0x18'));var config=require(_0x0edb('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0edb('0x1a'))['db'];function respondWithStatusCode(_0x7fdd1b,_0x26d3b4){_0x26d3b4=_0x26d3b4||0xcc;return function(_0x4c8fab){if(_0x4c8fab){return _0x7fdd1b[_0x0edb('0x1b')](_0x26d3b4);}return _0x7fdd1b[_0x0edb('0x1c')](_0x26d3b4)[_0x0edb('0x1d')]();};}function respondWithResult(_0x2bebc4,_0x38ca8a){_0x38ca8a=_0x38ca8a||0xc8;return function(_0xe07297){if(_0xe07297){return _0x2bebc4[_0x0edb('0x1c')](_0x38ca8a)[_0x0edb('0x1e')](_0xe07297);}};}function respondWithFilteredResult(_0x54dee4,_0x4cef8f){return function(_0x4f1f08){if(_0x4f1f08){var _0x333f32=typeof _0x4cef8f[_0x0edb('0x1f')]===_0x0edb('0x20')&&typeof _0x4cef8f[_0x0edb('0x21')]===_0x0edb('0x20');var _0x5eb1e6=_0x4f1f08[_0x0edb('0x22')];var _0x369106=_0x333f32?0x0:_0x4cef8f['offset'];var _0x29292f=_0x333f32?_0x4f1f08[_0x0edb('0x22')]:_0x4cef8f[_0x0edb('0x1f')]+_0x4cef8f[_0x0edb('0x21')];var _0x815c48;if(_0x29292f>=_0x5eb1e6){_0x29292f=_0x5eb1e6;_0x815c48=0xc8;}else{_0x815c48=0xce;}_0x54dee4[_0x0edb('0x1c')](_0x815c48);return _0x54dee4['set'](_0x0edb('0x23'),_0x369106+'-'+_0x29292f+'/'+_0x5eb1e6)[_0x0edb('0x1e')](_0x4f1f08);}return null;};}function patchUpdates(_0x283459){return function(_0x134a8a){try{jsonpatch[_0x0edb('0x24')](_0x134a8a,_0x283459,!![]);}catch(_0xf198be){return BPromise[_0x0edb('0x25')](_0xf198be);}return _0x134a8a[_0x0edb('0x26')]();};}function saveUpdates(_0x5f1736,_0x20bbf9){return function(_0x39ba40){if(_0x39ba40){return _0x39ba40['update'](_0x5f1736)[_0x0edb('0x27')](function(_0x20f4e0){return _0x20f4e0;});}return null;};}function removeEntity(_0x344b0f,_0x5cb2ec){return function(_0x550993){if(_0x550993){return _0x550993[_0x0edb('0x28')]()[_0x0edb('0x27')](function(){_0x344b0f[_0x0edb('0x1c')](0xcc)[_0x0edb('0x1d')]();});}};}function handleEntityNotFound(_0x1cb957,_0x20ce0e){return function(_0x263926){if(!_0x263926){_0x1cb957['sendStatus'](0x194);}return _0x263926;};}function handleError(_0x589ecc,_0x5e33ff){_0x5e33ff=_0x5e33ff||0x1f4;return function(_0x37f412){logger['error'](_0x37f412['stack']);if(_0x37f412['name']){delete _0x37f412[_0x0edb('0x29')];}_0x589ecc[_0x0edb('0x1c')](_0x5e33ff)[_0x0edb('0x2a')](_0x37f412);};}exports[_0x0edb('0x2b')]=function(_0x5bed9b,_0x3bf701){var _0x252031={},_0x35e19f={},_0x349e36={'count':0x0,'rows':[]};var _0x1dcf20=_[_0x0edb('0x2c')](db[_0x0edb('0x2d')]['rawAttributes'],function(_0x31d273){return{'name':_0x31d273[_0x0edb('0x2e')],'type':_0x31d273['type']['key']};});_0x35e19f[_0x0edb('0x2f')]=_[_0x0edb('0x30')](_[_0x0edb('0x2c')](_0x1dcf20,_0x0edb('0x29')),[_0x0edb('0x31')]);_0x35e19f['query']=_[_0x0edb('0x32')](_0x5bed9b[_0x0edb('0x33')]);_0x35e19f[_0x0edb('0x34')]=_[_0x0edb('0x35')](_0x35e19f[_0x0edb('0x2f')],_0x35e19f[_0x0edb('0x33')]);_0x252031['attributes']=_[_0x0edb('0x35')](_0x35e19f[_0x0edb('0x2f')],qs[_0x0edb('0x36')](_0x5bed9b[_0x0edb('0x33')][_0x0edb('0x36')]));_0x252031[_0x0edb('0x37')]=_0x252031[_0x0edb('0x37')]['length']?_0x252031[_0x0edb('0x37')]:_0x35e19f['model'];if(!_0x5bed9b[_0x0edb('0x33')][_0x0edb('0x38')](_0x0edb('0x39'))){_0x252031['limit']=qs[_0x0edb('0x21')](_0x5bed9b['query'][_0x0edb('0x21')]);_0x252031[_0x0edb('0x1f')]=qs[_0x0edb('0x1f')](_0x5bed9b[_0x0edb('0x33')][_0x0edb('0x1f')]);}_0x252031[_0x0edb('0x3a')]=qs[_0x0edb('0x3b')](_0x5bed9b[_0x0edb('0x33')]['sort']);_0x252031[_0x0edb('0x3c')]=qs[_0x0edb('0x34')](_[_0x0edb('0x3d')](_0x5bed9b[_0x0edb('0x33')],_0x35e19f[_0x0edb('0x34')]),_0x1dcf20);if(_0x5bed9b[_0x0edb('0x33')]['filter']){_0x252031['where']=_[_0x0edb('0x3e')](_0x252031[_0x0edb('0x3c')],{'$or':_[_0x0edb('0x2c')](_0x1dcf20,function(_0x165e4b){if(_0x165e4b['type']!=='VIRTUAL'){var _0xd4e88e={};_0xd4e88e[_0x165e4b[_0x0edb('0x29')]]={'$like':'%'+_0x5bed9b['query'][_0x0edb('0x3f')]+'%'};return _0xd4e88e;}})});}_0x252031=_[_0x0edb('0x3e')]({},_0x252031,_0x5bed9b[_0x0edb('0x40')]);var _0x112590={'where':_0x252031[_0x0edb('0x3c')]};return db[_0x0edb('0x2d')]['count'](_0x112590)[_0x0edb('0x27')](function(_0xe57552){_0x349e36[_0x0edb('0x22')]=_0xe57552;if(_0x5bed9b['query']['includeAll']){_0x252031[_0x0edb('0x41')]=[{'all':!![]}];}return db[_0x0edb('0x2d')][_0x0edb('0x42')](_0x252031);})[_0x0edb('0x27')](function(_0x3901b5){_0x349e36[_0x0edb('0x43')]=_0x3901b5;return _0x349e36;})[_0x0edb('0x27')](respondWithFilteredResult(_0x3bf701,_0x252031))[_0x0edb('0x44')](handleError(_0x3bf701,null));};exports[_0x0edb('0x45')]=function(_0x470f3b,_0x5af8be){var _0x4c7d76={'raw':![],'where':{'id':_0x470f3b[_0x0edb('0x46')]['id']}},_0x5448d9={};_0x5448d9[_0x0edb('0x2f')]=_[_0x0edb('0x32')](db[_0x0edb('0x2d')]['rawAttributes']);_0x5448d9[_0x0edb('0x33')]=_[_0x0edb('0x32')](_0x470f3b[_0x0edb('0x33')]);_0x5448d9[_0x0edb('0x34')]=_['intersection'](_0x5448d9[_0x0edb('0x2f')],_0x5448d9['query']);_0x4c7d76[_0x0edb('0x37')]=_[_0x0edb('0x35')](_0x5448d9[_0x0edb('0x2f')],qs[_0x0edb('0x36')](_0x470f3b[_0x0edb('0x33')][_0x0edb('0x36')]));_0x4c7d76[_0x0edb('0x37')]=_0x4c7d76[_0x0edb('0x37')]['length']?_0x4c7d76[_0x0edb('0x37')]:_0x5448d9[_0x0edb('0x2f')];if(_0x470f3b['query'][_0x0edb('0x47')]){_0x4c7d76[_0x0edb('0x41')]=[{'all':!![]}];}_0x4c7d76=_[_0x0edb('0x3e')]({},_0x4c7d76,_0x470f3b[_0x0edb('0x40')]);return db[_0x0edb('0x2d')][_0x0edb('0x48')](_0x4c7d76)[_0x0edb('0x27')](handleEntityNotFound(_0x5af8be,null))[_0x0edb('0x27')](respondWithResult(_0x5af8be,null))[_0x0edb('0x44')](handleError(_0x5af8be,null));};exports[_0x0edb('0x49')]=function(_0x4accdf,_0x4310a2){return db[_0x0edb('0x2d')][_0x0edb('0x49')](_0x4accdf[_0x0edb('0x4a')],{})[_0x0edb('0x27')](respondWithResult(_0x4310a2,0xc9))[_0x0edb('0x44')](handleError(_0x4310a2,null));};exports[_0x0edb('0x4b')]=function(_0x476b20,_0x50a5a1){if(_0x476b20[_0x0edb('0x4a')]['id']){delete _0x476b20['body']['id'];}return db[_0x0edb('0x2d')]['find']({'where':{'id':_0x476b20['params']['id']}})[_0x0edb('0x27')](handleEntityNotFound(_0x50a5a1,null))[_0x0edb('0x27')](saveUpdates(_0x476b20['body'],null))[_0x0edb('0x27')](respondWithResult(_0x50a5a1,null))[_0x0edb('0x44')](handleError(_0x50a5a1,null));};exports[_0x0edb('0x4c')]=function(_0x294bf4,_0x4a7321){return db[_0x0edb('0x2d')][_0x0edb('0x4c')]()[_0x0edb('0x27')](respondWithResult(_0x4a7321,null))[_0x0edb('0x44')](handleError(_0x4a7321,null));};exports[_0x0edb('0x4d')]=function(_0x4d17cc,_0x30de9d,_0x588a1d){var _0x294ce2=require('../../components/encryptor');var _0x437f24=![];var _0xf50f00={};if(_0x4d17cc['query']['type']&&_0x4d17cc[_0x0edb('0x33')][_0x0edb('0x4e')]===_0x0edb('0x4f')){_0xf50f00[_0x0edb('0x4f')]=_0x4d17cc['params']['id'];}else{_0xf50f00['id']=_0x4d17cc['params']['id'];}return db[_0x0edb('0x2d')][_0x0edb('0x48')]({'where':_0xf50f00,'attributes':['id','value'],'raw':!![]})[_0x0edb('0x27')](handleEntityNotFound(_0x30de9d,null))[_0x0edb('0x27')](function(_0x5d1dd3){if(_0x5d1dd3){var _0x51a4db=_0x5d1dd3[_0x0edb('0x50')];var _0x4b3326=util[_0x0edb('0x31')]('%s.cypher',_0x51a4db);if(fs[_0x0edb('0x51')](_0x4b3326)){_0x437f24=!![];return _0x294ce2[_0x0edb('0x52')](_0x4b3326,_0x51a4db,config[_0x0edb('0x53')][_0x0edb('0x54')])[_0x0edb('0x27')](function(){return _0x5d1dd3;});}return _0x5d1dd3;}})['then'](function(_0x52c814){if(_0x52c814){var _0x41db9f=_0x52c814['value'];if(!fs[_0x0edb('0x51')](_0x41db9f)){throw new db[(_0x0edb('0x55'))][(_0x0edb('0x56'))](_0x0edb('0x57'));}if(_0x52c814['filename']){return _0x30de9d[_0x0edb('0x4d')](_0x41db9f,_0x52c814[_0x0edb('0x58')]+path[_0x0edb('0x59')](_0x41db9f),function(){if(_0x437f24){fs[_0x0edb('0x5a')](_0x41db9f);}});}else{return _0x30de9d['download'](_0x41db9f,function(_0x650564){if(_0x437f24){fs[_0x0edb('0x5a')](_0x41db9f);}});}}})['catch'](function(_0x5da6f1){if(_0x5da6f1[_0x0edb('0x5b')]===_0x0edb('0x57')){_0x30de9d['status'](0x194)['send'](_0x0edb('0x5c'));}else{return handleError(_0x30de9d,null);}});};exports[_0x0edb('0x5d')]=function(_0x5b9cc6,_0x5f3dc0,_0xf30c87){var _0xe9d910=require('../../components/encryptor');var _0x27b3b4=![];var _0x5e710e={'$and':[db[_0x0edb('0x5e')]['where'](db['sequelize']['fn'](_0x0edb('0x5f'),db['sequelize'][_0x0edb('0x60')](_0x0edb('0x4f'))),_0x5b9cc6[_0x0edb('0x33')][_0x0edb('0x61')])]};if(_0x5b9cc6[_0x0edb('0x33')]['type']&&_0x5b9cc6[_0x0edb('0x33')]['type']===_0x0edb('0x4f')){_0x5e710e[_0x0edb('0x62')][_0x0edb('0x63')]({'uniqueid':_0x5b9cc6[_0x0edb('0x46')]['id']});}else{_0x5e710e['$and']['push']({'id':_0x5b9cc6[_0x0edb('0x46')]['id']});}return db['VoiceRecording'][_0x0edb('0x48')]({'where':_0x5e710e,'attributes':['id','value'],'raw':!![]})[_0x0edb('0x27')](handleEntityNotFound(_0x5f3dc0,null))['then'](function(_0x5a7282){if(_0x5a7282){var _0x556ecc=util['format'](_0x0edb('0x64'),_0x5a7282[_0x0edb('0x50')]);if(fs[_0x0edb('0x51')](_0x556ecc)){_0x27b3b4=!![];return _0xe9d910['decryptFile'](_0x556ecc,_0x5a7282['value'],config['secrets'][_0x0edb('0x54')])['then'](function(){return _0x5a7282;});}return _0x5a7282;}})['then'](function(_0x3c7eff){if(_0x3c7eff){if(!fs[_0x0edb('0x51')](_0x3c7eff['value'])){throw new db[(_0x0edb('0x55'))][(_0x0edb('0x56'))](_0x0edb('0x57'));}if(_0x3c7eff[_0x0edb('0x58')]){return _0x5f3dc0[_0x0edb('0x4d')](_0x3c7eff[_0x0edb('0x50')],_0x3c7eff['filename']+path[_0x0edb('0x59')](_0x3c7eff[_0x0edb('0x50')]),function(){if(_0x27b3b4){fs['unlink'](_0x3c7eff[_0x0edb('0x50')]);}});}else{return _0x5f3dc0[_0x0edb('0x4d')](_0x3c7eff[_0x0edb('0x50')],function(_0xc747c2){if(_0x27b3b4){fs[_0x0edb('0x5a')](_0x3c7eff[_0x0edb('0x50')]);}});}}})['catch'](handleError(_0x5f3dc0,null));};exports[_0x0edb('0x28')]=function(_0xd0b1a7,_0x35d873){return db['VoiceRecording'][_0x0edb('0x48')]({'where':{'id':_0xd0b1a7['params']['id']}})[_0x0edb('0x27')](function(_0x5d8d84){if(_[_0x0edb('0x65')](_0x5d8d84)){throw new ReferenceError(_0x0edb('0x66'));}return _0x5d8d84;})[_0x0edb('0x27')](function(_0xccec74){var _0x6b14b7=_0xccec74[_0x0edb('0x50')];logger[_0x0edb('0x67')](_0x0edb('0x68'),_0x6b14b7);if(!_[_0x0edb('0x65')](_0xccec74[_0x0edb('0x50')])&&fs[_0x0edb('0x51')](_0x6b14b7)){logger[_0x0edb('0x67')](_0x0edb('0x69')+_0x6b14b7+_0x0edb('0x6a'));fs[_0x0edb('0x6b')](_0x6b14b7);}_0x6b14b7=_0x6b14b7+_0x0edb('0x6c');if(!_[_0x0edb('0x65')](_0xccec74['value'])&&fs[_0x0edb('0x51')](_0x6b14b7)){logger[_0x0edb('0x67')](_0x0edb('0x69')+_0x6b14b7+_0x0edb('0x6a'));fs['unlinkSync'](_0x6b14b7);}return _0xccec74;})[_0x0edb('0x27')](function(_0x38206c){if(!_0x38206c)throw new InternalError();return _0x38206c[_0x0edb('0x28')]();})['then'](function(){_0x35d873[_0x0edb('0x1c')](0xcc)[_0x0edb('0x1d')]();})[_0x0edb('0x44')](handleError(_0x35d873,null));};function getBucketslist(_0x23476d,_0x22819d,_0x5ab9b7){return new Promise(function(_0x47c23a,_0x39a1a6){var _0x30cdb7=new AWS['S3']({'accessKeyId':_0x22819d,'secretAccessKey':_0x23476d,'region':_0x5ab9b7});_0x30cdb7[_0x0edb('0x6d')]({},function(_0x1685fb,_0x2d0f65){if(_0x1685fb){return _0x39a1a6(_0x1685fb);}else{return _0x47c23a(_0x2d0f65);}});});}function createBucket(_0x13a79f,_0x4161cf,_0x32571c,_0x370f63){return new Promise(function(_0x9e51a1,_0x287b39){var _0x4ee5e9=new AWS['S3']({'accessKeyId':_0x4161cf,'secretAccessKey':_0x13a79f,'region':_0x32571c});_0x4ee5e9['createBucket']({'Bucket':_0x370f63},function(_0x56a060,_0x243ee4){if(_0x56a060){return _0x287b39(_0x56a060);}else{return _0x9e51a1(_0x243ee4);}});});}function uploadFile(_0x4c52da,_0x216dab,_0x31fc07,_0x41d1cc,_0x1d9d2c,_0x159d03){return new Promise(function(_0x14a117,_0x115224){var _0xeebca0=new AWS['S3']({'accessKeyId':_0x216dab,'secretAccessKey':_0x4c52da,'region':_0x31fc07});_0xeebca0[_0x0edb('0x6e')]({'Bucket':_0x41d1cc,'Key':_0x1d9d2c,'Body':_0x159d03},function(_0x3608e6,_0x4dfed6){if(_0x3608e6){return _0x115224(_0x3608e6);}else{return _0x14a117(_0x4dfed6);}});});}function startTranscribe(_0x4ad5ef,_0x27c5cb,_0x1d32bc,_0x3dbd97,_0x52cb0e,_0x3af32d){return new Promise(function(_0x9e1bbb,_0x4cdf96){var _0x2a9597=new AWS[(_0x0edb('0x6f'))]({'accessKeyId':_0x27c5cb,'secretAccessKey':_0x4ad5ef,'region':_0x1d32bc});_0x2a9597[_0x0edb('0x70')]({'TranscriptionJobName':_0x3dbd97,'LanguageCode':_0x52cb0e,'Media':{'MediaFileUri':_0x3af32d}},function(_0x123333,_0x553324){if(_0x123333){return _0x4cdf96(_0x123333);}else{return _0x9e1bbb(_0x553324);}});});}function transcribe(_0x315e67,_0x4c3d4a,_0x3370f9,_0x157bc7,_0x22984f,_0x1f1072,_0x260846){return new Promise(function(_0x1e9199,_0x12a505){var _0x4676cd={};logger['info'](util[_0x0edb('0x31')](_0x0edb('0x71'),_0x315e67,_0x22984f));return uploadFile(_0x4c3d4a,_0x3370f9,_0x157bc7,_0x22984f,path['basename'](_0x1f1072),fs[_0x0edb('0x72')](_0x1f1072))[_0x0edb('0x27')](function(_0x42256d){logger[_0x0edb('0x67')](util[_0x0edb('0x31')](_0x0edb('0x73'),_0x315e67,_0x22984f,_0x42256d[_0x0edb('0x74')]));_0x4676cd['bucket']=_0x42256d[_0x0edb('0x75')];_0x4676cd[_0x0edb('0x76')]=_0x42256d['Location'];logger[_0x0edb('0x67')](util[_0x0edb('0x31')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x315e67));return startTranscribe(_0x4c3d4a,_0x3370f9,_0x157bc7,uuidv4(),_0x260846,_0x42256d['Location']);})[_0x0edb('0x27')](function(_0x5a32da){logger[_0x0edb('0x67')](util['format'](_0x0edb('0x77'),_0x315e67,_0x5a32da[_0x0edb('0x78')]['TranscriptionJobName']));_0x4676cd[_0x0edb('0x79')]=_0x5a32da[_0x0edb('0x78')][_0x0edb('0x7a')];_0x4676cd[_0x0edb('0x7b')]=_0x5a32da[_0x0edb('0x78')][_0x0edb('0x7c')];return _0x1e9199(_0x4676cd);})[_0x0edb('0x44')](function(_0xb2a4d){return _0x12a505(_0xb2a4d);});});}exports[_0x0edb('0x7d')]=function(_0x280156,_0x5c29a2,_0x23a4db){var _0x4c8322;var _0x4425f9;var _0x49643e;var _0x43e866=require(_0x0edb('0x7e'));return db[_0x0edb('0x2d')][_0x0edb('0x7f')]({'where':{'id':_0x280156[_0x0edb('0x46')]['id']}})['then'](function(_0x2edb00){if(_0x2edb00){var _0x5d4b4a=util['format']('%s.cypher',_0x2edb00[_0x0edb('0x50')]);if(fs['existsSync'](_0x5d4b4a)){cypher=!![];return _0x43e866[_0x0edb('0x52')](_0x5d4b4a,_0x2edb00[_0x0edb('0x50')],config[_0x0edb('0x53')]['recording'])[_0x0edb('0x27')](function(){return _0x2edb00;});}return _0x2edb00;}})['then'](function(_0x9d7024){if(!_0x9d7024){throw new db['Sequelize'][(_0x0edb('0x56'))](_0x0edb('0x80'));}_0x4425f9=_0x9d7024;return db['Setting'][_0x0edb('0x7f')]({'where':{'id':0x1}});})[_0x0edb('0x27')](handleEntityNotFound(_0x5c29a2,null))[_0x0edb('0x27')](function(_0x59a8ec){if(_0x59a8ec){_0x4c8322=_0x59a8ec;if(!_0x4c8322[_0x0edb('0x81')]||!_0x4c8322[_0x0edb('0x82')]||!_0x4c8322['transcribeRegion']||!_0x4c8322['language']||!_0x4c8322['bucket']){throw new db[(_0x0edb('0x55'))][(_0x0edb('0x56'))]('Transcribe\x20not\x20configured');}if(_0x280156[_0x0edb('0x4a')][_0x0edb('0x83')]&&(!_0x4c8322[_0x0edb('0x84')]||!_0x4c8322[_0x0edb('0x85')]||!_0x4c8322[_0x0edb('0x86')]||!_0x4c8322[_0x0edb('0x87')]||!_0x4c8322[_0x0edb('0x88')])){throw new db['Sequelize'][(_0x0edb('0x56'))](_0x0edb('0x89'));}return db['CloudProvider']['findOne']({'where':{'id':_0x4c8322['transcribeAccountId']}});}})[_0x0edb('0x27')](function(_0x4dd876){if(!_0x4dd876){throw new db['Sequelize'][(_0x0edb('0x56'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x4dd876[_0x0edb('0x8a')]||!_0x4dd876[_0x0edb('0x8b')]){throw new db['Sequelize'][(_0x0edb('0x56'))](_0x0edb('0x8c'));}_0x49643e=_0x4dd876;return getBucketslist(_0x49643e[_0x0edb('0x8a')],_0x49643e['data2'],_0x4c8322[_0x0edb('0x8d')]);})['then'](function(_0x194963){if(_0x194963&&_0x194963[_0x0edb('0x8e')]){var _0x421ebf=_[_0x0edb('0x48')](_0x194963['Buckets'],function(_0x2c4d73){return _0x2c4d73[_0x0edb('0x8f')]===_0x4c8322[_0x0edb('0x88')];});if(!_0x421ebf){logger['info'](util[_0x0edb('0x31')](_0x0edb('0x90'),_0x280156[_0x0edb('0x46')]['id'],_0x4c8322[_0x0edb('0x88')]));return createBucket(_0x49643e[_0x0edb('0x8a')],_0x49643e['data2'],_0x4c8322[_0x0edb('0x8d')],_0x4c8322[_0x0edb('0x88')]);}logger['info'](util[_0x0edb('0x31')](_0x0edb('0x91'),_0x280156[_0x0edb('0x46')]['id'],_0x4c8322[_0x0edb('0x88')]));return;}})[_0x0edb('0x27')](function(_0x48df28){if(_0x4425f9[_0x0edb('0x7b')]===_0x0edb('0x92')){return transcribe(_0x280156[_0x0edb('0x46')]['id'],_0x49643e[_0x0edb('0x8a')],_0x49643e[_0x0edb('0x8b')],_0x4c8322[_0x0edb('0x8d')],_0x4c8322[_0x0edb('0x88')],_0x4425f9[_0x0edb('0x50')],_0x4c8322['language']);}else{logger[_0x0edb('0x67')](util[_0x0edb('0x31')](_0x0edb('0x93'),_0x280156[_0x0edb('0x46')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x0edb('0x27')](function(_0x3b8caa){if(_0x3b8caa){_0x3b8caa[_0x0edb('0x94')]=_0x280156['body'][_0x0edb('0x83')];return _0x4425f9[_0x0edb('0x95')](_0x3b8caa);}})[_0x0edb('0x27')](respondWithResult(_0x5c29a2,null))[_0x0edb('0x44')](handleError(_0x5c29a2,null));};function writeFile(_0x2194db,_0x5a5616){return new Promise(function(_0x49ea15,_0x3e253a){fs[_0x0edb('0x96')](_0x5a5616,_0x2194db,function(_0x2ee2ec,_0x427c88){if(_0x2ee2ec){return _0x3e253a(_0x2ee2ec);}else{return _0x49ea15(_0x427c88);}});});}exports[_0x0edb('0x97')]=function(_0x44cd65,_0x334e6d,_0x49c696){return db[_0x0edb('0x2d')][_0x0edb('0x7f')]({'where':{'id':_0x44cd65['params']['id']}})[_0x0edb('0x27')](handleEntityNotFound(_0x334e6d))[_0x0edb('0x27')](function(_0x5602b2){if(_0x5602b2&&_0x5602b2[_0x0edb('0x98')]){var _0x5cbdbe=_0x5602b2['fileText'];var _0x255dc5=config[_0x0edb('0x99')]+_0x0edb('0x9a')+_0x5602b2['id']+_0x0edb('0x9b');if(fs[_0x0edb('0x51')](_0x255dc5)){return _0x255dc5;}return writeFile(_0x5cbdbe,_0x255dc5)['then'](function(){return _0x255dc5;});}else{throw new db[(_0x0edb('0x55'))]['ValidationError'](_0x0edb('0x9c'));}})[_0x0edb('0x27')](function(_0x4e871f){return _0x334e6d[_0x0edb('0x4d')](_0x4e871f);})[_0x0edb('0x44')](handleError(_0x334e6d));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 86d7b07..bd64f40 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 _0x4f17=['voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','VoiceRecording'];(function(_0x94f12,_0x25147b){var _0xc893d7=function(_0x11519f){while(--_0x11519f){_0x94f12['push'](_0x94f12['shift']());}};_0xc893d7(++_0x25147b);}(_0x4f17,0x9e));var _0x74f1=function(_0x21b359,_0x4dc80e){_0x21b359=_0x21b359-0x0;var _0x57b8e7=_0x4f17[_0x21b359];return _0x57b8e7;};'use strict';var attributes=require(_0x74f1('0x0'));module['exports']=function(_0xc7f009,_0xfcf99c){return _0xc7f009['define'](_0x74f1('0x1'),attributes,{'tableName':_0x74f1('0x2'),'paranoid':![],'indexes':[{'name':_0x74f1('0x3'),'fields':[_0x74f1('0x3')]},{'name':_0x74f1('0x4'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0x53d5=['define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports'];(function(_0x42e8f0,_0x4ac7a5){var _0x132549=function(_0xb160fe){while(--_0xb160fe){_0x42e8f0['push'](_0x42e8f0['shift']());}};_0x132549(++_0x4ac7a5);}(_0x53d5,0x1cc));var _0x553d=function(_0x2c53fb,_0x7d12aa){_0x2c53fb=_0x2c53fb-0x0;var _0x292493=_0x53d5[_0x2c53fb];return _0x292493;};'use strict';var attributes=require(_0x553d('0x0'));module[_0x553d('0x1')]=function(_0x217b81,_0x619750){return _0x217b81[_0x553d('0x2')](_0x553d('0x3'),attributes,{'tableName':_0x553d('0x4'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x553d('0x5')]},{'name':_0x553d('0x6'),'fields':[_0x553d('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 33a2c8c..66d4c86 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 _0x430c=['../../components/encryptor','findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','recording','lodash','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','http','request','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','body','options','raw','where','limit','UpdateVoiceRecording','catch','CreateVoiceRecording'];(function(_0x7a0317,_0x261f19){var _0x20bdd6=function(_0x192283){while(--_0x192283){_0x7a0317['push'](_0x7a0317['shift']());}};_0x20bdd6(++_0x261f19);}(_0x430c,0x1a1));var _0xc430=function(_0x380307,_0x440ccd){_0x380307=_0x380307-0x0;var _0x9ea14b=_0x430c[_0x380307];return _0x9ea14b;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc430('0x1'));var rs=require(_0xc430('0x2'));var fs=require('fs');var Redis=require(_0xc430('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc430('0x4'));var jayson=require(_0xc430('0x5'));var client=jayson['client'][_0xc430('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4de44f,_0x212354,_0x2e51c6){return new BPromise(function(_0x814a90,_0x13ae66){return client[_0xc430('0x7')](_0x4de44f,_0x2e51c6)[_0xc430('0x8')](function(_0x861581){logger[_0xc430('0x9')](_0xc430('0xa'),_0x212354,'request\x20sent');logger[_0xc430('0xb')](_0xc430('0xc'),_0x212354,'request\x20sent',JSON[_0xc430('0xd')](_0x861581));if(_0x861581['error']){if(_0x861581[_0xc430('0xe')]['code']===0x1f4){logger[_0xc430('0xe')](_0xc430('0xa'),_0x212354,_0x861581[_0xc430('0xe')][_0xc430('0xf')]);return _0x13ae66(_0x861581[_0xc430('0xe')][_0xc430('0xf')]);}logger[_0xc430('0xe')]('VoiceRecording,\x20%s,\x20%s',_0x212354,_0x861581['error'][_0xc430('0xf')]);return _0x814a90(_0x861581[_0xc430('0xe')][_0xc430('0xf')]);}else{logger[_0xc430('0x9')](_0xc430('0xa'),_0x212354,'request\x20sent');_0x814a90(_0x861581[_0xc430('0x10')]['message']);}})['catch'](function(_0x2e7987){logger[_0xc430('0xe')](_0xc430('0xa'),_0x212354,_0x2e7987);_0x13ae66(_0x2e7987);});});}exports['UpdateVoiceRecording']=function(_0x5d3acc){var _0x36d112=this;return new Promise(function(_0x4c1937,_0x2bcb21){return db['VoiceRecording']['update'](_0x5d3acc[_0xc430('0x11')],{'raw':_0x5d3acc['options']?_0x5d3acc[_0xc430('0x12')][_0xc430('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d3acc[_0xc430('0x12')]?_0x5d3acc[_0xc430('0x12')][_0xc430('0x14')]||null:null,'attributes':_0x5d3acc['options']?_0x5d3acc[_0xc430('0x12')]['attributes']||null:null,'limit':_0x5d3acc['options']?_0x5d3acc[_0xc430('0x12')][_0xc430('0x15')]||null:null})[_0xc430('0x8')](function(_0x56dd16){logger[_0xc430('0x9')]('UpdateVoiceRecording',_0x5d3acc);logger[_0xc430('0xb')](_0xc430('0x16'),_0x5d3acc,JSON['stringify'](_0x56dd16));_0x4c1937(_0x56dd16);})[_0xc430('0x17')](function(_0x3cdbd3){logger['error'](_0xc430('0x16'),_0x3cdbd3['message'],_0x5d3acc);_0x2bcb21(_0x36d112[_0xc430('0xe')](0x1f4,_0x3cdbd3['message']));});});};exports[_0xc430('0x18')]=function(_0x21e28a){var _0x50110b=this;return new Promise(function(_0x33433f,_0x2ec021){var _0x2c0422=require(_0xc430('0x19'));var _0x285407;return db['Setting'][_0xc430('0x1a')]({'attributes':['id',_0xc430('0x1b')],'where':{'id':0x1},'raw':!![]})[_0xc430('0x8')](function(_0x1591e3){_0x285407=_0x1591e3;return db['VoiceRecording'][_0xc430('0x1c')](_0x21e28a['body']);})[_0xc430('0x8')](function(_0x4ad29e){if(_0x285407[_0xc430('0x1b')]&&fs[_0xc430('0x1d')](_0x4ad29e[_0xc430('0x1e')])){var _0x3d7ccf=util['format'](_0xc430('0x1f'),_0x4ad29e[_0xc430('0x1e')]);return _0x2c0422[_0xc430('0x20')](_0x4ad29e[_0xc430('0x1e')],_0x3d7ccf,config['secrets'][_0xc430('0x21')])[_0xc430('0x8')](function(){fs['unlink'](_0x4ad29e[_0xc430('0x1e')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x4ad29e;});}return _0x4ad29e;})[_0xc430('0x8')](function(_0x973a39){logger[_0xc430('0x9')](_0xc430('0x18'),_0x21e28a);logger[_0xc430('0xb')](_0xc430('0x18'),_0x21e28a,JSON[_0xc430('0xd')](_0x973a39));_0x33433f(_0x973a39);})[_0xc430('0x17')](function(_0x47da0d){logger[_0xc430('0xe')]('CreateVoiceRecording',_0x47da0d[_0xc430('0xf')],_0x21e28a);_0x2ec021(_0x50110b[_0xc430('0xe')](0x1f4,_0x47da0d[_0xc430('0xf')]));});});}; \ No newline at end of file +var _0x958a=['unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','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','body','options','raw','where','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher'];(function(_0x229e4a,_0x42c4d3){var _0x5e363a=function(_0x1d5257){while(--_0x1d5257){_0x229e4a['push'](_0x229e4a['shift']());}};_0x5e363a(++_0x42c4d3);}(_0x958a,0x128));var _0xa958=function(_0xb8cd5b,_0x5ee873){_0xb8cd5b=_0xb8cd5b-0x0;var _0x3984fe=_0x958a[_0xb8cd5b];return _0x3984fe;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ddaa9,_0x3ca01f,_0x3b2693){return new BPromise(function(_0x1895da,_0x54c0e0){return client['request'](_0x3ddaa9,_0x3b2693)[_0xa958('0xb')](function(_0x249764){logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));logger[_0xa958('0xf')](_0xa958('0x10'),_0x3ca01f,_0xa958('0xe'),JSON[_0xa958('0x11')](_0x249764));if(_0x249764[_0xa958('0x12')]){if(_0x249764[_0xa958('0x12')][_0xa958('0x13')]===0x1f4){logger[_0xa958('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x3ca01f,_0x249764['error']['message']);return _0x54c0e0(_0x249764[_0xa958('0x12')][_0xa958('0x14')]);}logger[_0xa958('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x3ca01f,_0x249764[_0xa958('0x12')]['message']);return _0x1895da(_0x249764['error']['message']);}else{logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));_0x1895da(_0x249764[_0xa958('0x15')][_0xa958('0x14')]);}})[_0xa958('0x16')](function(_0x23736f){logger[_0xa958('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x3ca01f,_0x23736f);_0x54c0e0(_0x23736f);});});}exports[_0xa958('0x17')]=function(_0x4eadc9){var _0x3a053f=this;return new Promise(function(_0x70d13e,_0x52a184){return db[_0xa958('0x18')][_0xa958('0x19')](_0x4eadc9[_0xa958('0x1a')],{'raw':_0x4eadc9[_0xa958('0x1b')]?_0x4eadc9[_0xa958('0x1b')][_0xa958('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4eadc9['options']?_0x4eadc9['options'][_0xa958('0x1d')]||null:null,'attributes':_0x4eadc9[_0xa958('0x1b')]?_0x4eadc9[_0xa958('0x1b')]['attributes']||null:null,'limit':_0x4eadc9[_0xa958('0x1b')]?_0x4eadc9[_0xa958('0x1b')]['limit']||null:null})[_0xa958('0xb')](function(_0x401175){logger['info']('UpdateVoiceRecording',_0x4eadc9);logger[_0xa958('0xf')](_0xa958('0x17'),_0x4eadc9,JSON['stringify'](_0x401175));_0x70d13e(_0x401175);})[_0xa958('0x16')](function(_0x27097a){logger[_0xa958('0x12')](_0xa958('0x17'),_0x27097a[_0xa958('0x14')],_0x4eadc9);_0x52a184(_0x3a053f[_0xa958('0x12')](0x1f4,_0x27097a['message']));});});};exports[_0xa958('0x1e')]=function(_0x48ef34){var _0x43df63=this;return new Promise(function(_0x3c2ea3,_0x32ea36){var _0x18f600=require(_0xa958('0x1f'));var _0xddc7f6;return db[_0xa958('0x20')][_0xa958('0x21')]({'attributes':['id',_0xa958('0x22')],'where':{'id':0x1},'raw':!![]})[_0xa958('0xb')](function(_0x4c4c37){_0xddc7f6=_0x4c4c37;return db['VoiceRecording'][_0xa958('0x23')](_0x48ef34['body']);})[_0xa958('0xb')](function(_0x1b76de){if(_0xddc7f6['callRecordingEncryption']&&fs[_0xa958('0x24')](_0x1b76de[_0xa958('0x25')])){var _0x179bc2=util[_0xa958('0x26')](_0xa958('0x27'),_0x1b76de['value']);return _0x18f600['encryptFile'](_0x1b76de[_0xa958('0x25')],_0x179bc2,config['secrets']['recording'])[_0xa958('0xb')](function(){fs[_0xa958('0x28')](_0x1b76de[_0xa958('0x25')]);logger[_0xa958('0xc')](_0xa958('0x29'));return _0x1b76de;});}return _0x1b76de;})[_0xa958('0xb')](function(_0x516a2f){logger[_0xa958('0xc')]('CreateVoiceRecording',_0x48ef34);logger['debug'](_0xa958('0x1e'),_0x48ef34,JSON[_0xa958('0x11')](_0x516a2f));_0x3c2ea3(_0x516a2f);})[_0xa958('0x16')](function(_0x1cc55d){logger[_0xa958('0x12')](_0xa958('0x1e'),_0x1cc55d[_0xa958('0x14')],_0x48ef34);_0x32ea36(_0x43df63[_0xa958('0x12')](0x1f4,_0x1cc55d['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 9eff8b8..371d691 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 _0xa81d=['update','delete','destroy','exports','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put'];(function(_0x1a6462,_0x4f5576){var _0x2e5be7=function(_0x3bcdb7){while(--_0x3bcdb7){_0x1a6462['push'](_0x1a6462['shift']());}};_0x2e5be7(++_0x4f5576);}(_0xa81d,0x1e4));var _0xda81=function(_0x395be8,_0x285479){_0x395be8=_0x395be8-0x0;var _0x5ceb20=_0xa81d[_0x395be8];return _0x5ceb20;};'use strict';var multer=require('multer');var util=require(_0xda81('0x0'));var path=require(_0xda81('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xda81('0x2'));var interaction=require(_0xda81('0x3'));var config=require(_0xda81('0x4'));var controller=require(_0xda81('0x5'));router[_0xda81('0x6')]('/',auth['isAuthenticated'](),controller[_0xda81('0x7')]);router['get'](_0xda81('0x8'),auth[_0xda81('0x9')](),controller[_0xda81('0xa')]);router[_0xda81('0x6')](_0xda81('0xb'),auth[_0xda81('0x9')](),controller[_0xda81('0xc')]);router[_0xda81('0xd')]('/',auth['isAuthenticated'](),controller[_0xda81('0xe')]);router[_0xda81('0xf')](_0xda81('0xb'),auth[_0xda81('0x9')](),controller[_0xda81('0x10')]);router[_0xda81('0x11')](_0xda81('0xb'),auth[_0xda81('0x9')](),controller[_0xda81('0x12')]);module[_0xda81('0x13')]=router; \ No newline at end of file +var _0x1be2=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0x25402e,_0x1ab8f2){var _0x168dbb=function(_0x440845){while(--_0x440845){_0x25402e['push'](_0x25402e['shift']());}};_0x168dbb(++_0x1ab8f2);}(_0x1be2,0x123));var _0x21be=function(_0x34d97d,_0x510bec){_0x34d97d=_0x34d97d-0x0;var _0x3e1c84=_0x1be2[_0x34d97d];return _0x3e1c84;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x21be('0x0'));var timeout=require(_0x21be('0x1'));var express=require(_0x21be('0x2'));var router=express[_0x21be('0x3')]();var fs_extra=require(_0x21be('0x4'));var auth=require(_0x21be('0x5'));var interaction=require(_0x21be('0x6'));var config=require(_0x21be('0x7'));var controller=require(_0x21be('0x8'));router[_0x21be('0x9')]('/',auth[_0x21be('0xa')](),controller[_0x21be('0xb')]);router['get'](_0x21be('0xc'),auth[_0x21be('0xa')](),controller[_0x21be('0xd')]);router[_0x21be('0x9')](_0x21be('0xe'),auth[_0x21be('0xa')](),controller[_0x21be('0xf')]);router['post']('/',auth[_0x21be('0xa')](),controller[_0x21be('0x10')]);router['put'](_0x21be('0xe'),auth[_0x21be('0xa')](),controller[_0x21be('0x11')]);router[_0x21be('0x12')](_0x21be('0xe'),auth[_0x21be('0xa')](),controller[_0x21be('0x13')]);module[_0x21be('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index bfd692b..920bd39 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 _0xcba2=['exports','ENUM','blind','attended','STRING','Yes'];(function(_0x32ea4d,_0x4990c5){var _0x5b3d61=function(_0x1be5f1){while(--_0x1be5f1){_0x32ea4d['push'](_0x32ea4d['shift']());}};_0x5b3d61(++_0x4990c5);}(_0xcba2,0x1f2));var _0x2cba=function(_0x1a96b5,_0xbb95bf){_0x1a96b5=_0x1a96b5-0x0;var _0x580a2e=_0xcba2[_0x1a96b5];return _0x580a2e;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x2cba('0x0')]={'type':{'type':Sequelize[_0x2cba('0x1')](_0x2cba('0x2'),_0x2cba('0x3'))},'result':{'type':Sequelize[_0x2cba('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x2cba('0x4')]},'transferercalleridname':{'type':Sequelize[_0x2cba('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x2cba('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x2cba('0x4')]},'transferercontext':{'type':Sequelize[_0x2cba('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x2cba('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x2cba('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x2cba('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x2cba('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x2cba('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x2cba('0x4')]},'transfereecontext':{'type':Sequelize[_0x2cba('0x4')]},'transfereeexten':{'type':Sequelize[_0x2cba('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x2cba('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x2cba('0x4')]}}; \ No newline at end of file +var _0x11dc=['sequelize','moment','exports','ENUM','blind','STRING'];(function(_0x5e6d65,_0x5db89c){var _0x5e1f75=function(_0x3729a1){while(--_0x3729a1){_0x5e6d65['push'](_0x5e6d65['shift']());}};_0x5e1f75(++_0x5db89c);}(_0x11dc,0x156));var _0xc11d=function(_0x64bec,_0x37225c){_0x64bec=_0x64bec-0x0;var _0x46b9c6=_0x11dc[_0x64bec];return _0x46b9c6;};'use strict';var Sequelize=require(_0xc11d('0x0'));var moment=require(_0xc11d('0x1'));module[_0xc11d('0x2')]={'type':{'type':Sequelize[_0xc11d('0x3')](_0xc11d('0x4'),'attended')},'result':{'type':Sequelize[_0xc11d('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xc11d('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xc11d('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xc11d('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xc11d('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xc11d('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xc11d('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xc11d('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xc11d('0x5')]},'transfereecontext':{'type':Sequelize[_0xc11d('0x5')]},'transfereeexten':{'type':Sequelize[_0xc11d('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xc11d('0x3')]('Yes','No')},'context':{'type':Sequelize[_0xc11d('0x5')]},'extension':{'type':Sequelize[_0xc11d('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index eb76831..e781932 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 _0x7464=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','VoiceTransferReport','fieldName','key','model','keys','intersection','query','attributes','fields','length','nolimit','limit','order','where','filters','pick','filter','merge','options','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x1dbc64,_0x2c4e5e){var _0x5e0a19=function(_0x1968a5){while(--_0x1968a5){_0x1dbc64['push'](_0x1dbc64['shift']());}};_0x5e0a19(++_0x2c4e5e);}(_0x7464,0x1a5));var _0x4746=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7464[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x4746('0x0'));var rimraf=require(_0x4746('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4746('0x2'));var rp=require(_0x4746('0x3'));var moment=require(_0x4746('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4746('0x5'));var util=require(_0x4746('0x6'));var path=require(_0x4746('0x7'));var sox=require(_0x4746('0x8'));var csv=require(_0x4746('0x9'));var ejs=require(_0x4746('0xa'));var fs=require('fs');var fs_extra=require(_0x4746('0xb'));var _=require(_0x4746('0xc'));var squel=require('squel');var crypto=require(_0x4746('0xd'));var jsforce=require(_0x4746('0xe'));var deskjs=require(_0x4746('0xf'));var toCsv=require(_0x4746('0x9'));var querystring=require(_0x4746('0x10'));var Papa=require(_0x4746('0x11'));var Redis=require(_0x4746('0x12'));var authService=require(_0x4746('0x13'));var qs=require(_0x4746('0x14'));var as=require(_0x4746('0x15'));var hardwareService=require(_0x4746('0x16'));var logger=require(_0x4746('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4746('0x18'))['db'];function respondWithStatusCode(_0x1e1ec4,_0x2e3b35){_0x2e3b35=_0x2e3b35||0xcc;return function(_0x188613){if(_0x188613){return _0x1e1ec4[_0x4746('0x19')](_0x2e3b35);}return _0x1e1ec4[_0x4746('0x1a')](_0x2e3b35)[_0x4746('0x1b')]();};}function respondWithResult(_0x1b4765,_0x7f15df){_0x7f15df=_0x7f15df||0xc8;return function(_0x56f856){if(_0x56f856){return _0x1b4765[_0x4746('0x1a')](_0x7f15df)[_0x4746('0x1c')](_0x56f856);}};}function respondWithFilteredResult(_0x266f06,_0x4803f1){return function(_0x476c43){if(_0x476c43){var _0x1f3685=typeof _0x4803f1[_0x4746('0x1d')]==='undefined'&&typeof _0x4803f1['limit']===_0x4746('0x1e');var _0x5bcfd8=_0x476c43['count'];var _0x4861af=_0x1f3685?0x0:_0x4803f1[_0x4746('0x1d')];var _0x29a59e=_0x1f3685?_0x476c43[_0x4746('0x1f')]:_0x4803f1['offset']+_0x4803f1['limit'];var _0x56b858;if(_0x29a59e>=_0x5bcfd8){_0x29a59e=_0x5bcfd8;_0x56b858=0xc8;}else{_0x56b858=0xce;}_0x266f06[_0x4746('0x1a')](_0x56b858);return _0x266f06[_0x4746('0x20')](_0x4746('0x21'),_0x4861af+'-'+_0x29a59e+'/'+_0x5bcfd8)[_0x4746('0x1c')](_0x476c43);}return null;};}function patchUpdates(_0x9cf2ee){return function(_0x297f41){try{jsonpatch['apply'](_0x297f41,_0x9cf2ee,!![]);}catch(_0x183cc5){return BPromise[_0x4746('0x22')](_0x183cc5);}return _0x297f41[_0x4746('0x23')]();};}function saveUpdates(_0x3f0e4b,_0x1d086e){return function(_0x528d36){if(_0x528d36){return _0x528d36[_0x4746('0x24')](_0x3f0e4b)[_0x4746('0x25')](function(_0x4c65aa){return _0x4c65aa;});}return null;};}function removeEntity(_0x51b62a,_0x4f189c){return function(_0x27107d){if(_0x27107d){return _0x27107d[_0x4746('0x26')]()[_0x4746('0x25')](function(){_0x51b62a['status'](0xcc)[_0x4746('0x1b')]();});}};}function handleEntityNotFound(_0xc96262,_0x1a4608){return function(_0x9d5a3b){if(!_0x9d5a3b){_0xc96262['sendStatus'](0x194);}return _0x9d5a3b;};}function handleError(_0x2e8c75,_0x259888){_0x259888=_0x259888||0x1f4;return function(_0x54a3a7){logger[_0x4746('0x27')](_0x54a3a7['stack']);if(_0x54a3a7['name']){delete _0x54a3a7[_0x4746('0x28')];}_0x2e8c75['status'](_0x259888)[_0x4746('0x29')](_0x54a3a7);};}exports[_0x4746('0x2a')]=function(_0x203d16,_0x1c4f8e){var _0x2794ed={},_0x25eb0a={},_0x406f59={'count':0x0,'rows':[]};var _0x5a664a=_[_0x4746('0x2b')](db[_0x4746('0x2c')]['rawAttributes'],function(_0x29bc70){return{'name':_0x29bc70[_0x4746('0x2d')],'type':_0x29bc70['type'][_0x4746('0x2e')]};});_0x25eb0a[_0x4746('0x2f')]=_[_0x4746('0x2b')](_0x5a664a,_0x4746('0x28'));_0x25eb0a['query']=_[_0x4746('0x30')](_0x203d16['query']);_0x25eb0a['filters']=_[_0x4746('0x31')](_0x25eb0a['model'],_0x25eb0a[_0x4746('0x32')]);_0x2794ed[_0x4746('0x33')]=_[_0x4746('0x31')](_0x25eb0a[_0x4746('0x2f')],qs[_0x4746('0x34')](_0x203d16[_0x4746('0x32')][_0x4746('0x34')]));_0x2794ed[_0x4746('0x33')]=_0x2794ed[_0x4746('0x33')][_0x4746('0x35')]?_0x2794ed[_0x4746('0x33')]:_0x25eb0a[_0x4746('0x2f')];if(!_0x203d16['query']['hasOwnProperty'](_0x4746('0x36'))){_0x2794ed[_0x4746('0x37')]=qs[_0x4746('0x37')](_0x203d16[_0x4746('0x32')][_0x4746('0x37')]);_0x2794ed['offset']=qs[_0x4746('0x1d')](_0x203d16[_0x4746('0x32')]['offset']);}_0x2794ed[_0x4746('0x38')]=qs['sort'](_0x203d16['query']['sort']);_0x2794ed[_0x4746('0x39')]=qs[_0x4746('0x3a')](_[_0x4746('0x3b')](_0x203d16['query'],_0x25eb0a[_0x4746('0x3a')]),_0x5a664a);if(_0x203d16['query'][_0x4746('0x3c')]){_0x2794ed[_0x4746('0x39')]=_[_0x4746('0x3d')](_0x2794ed[_0x4746('0x39')],{'$or':_[_0x4746('0x2b')](_0x5a664a,function(_0xd42ded){if(_0xd42ded['type']!=='VIRTUAL'){var _0x5d262f={};_0x5d262f[_0xd42ded['name']]={'$like':'%'+_0x203d16[_0x4746('0x32')][_0x4746('0x3c')]+'%'};return _0x5d262f;}})});}_0x2794ed=_[_0x4746('0x3d')]({},_0x2794ed,_0x203d16[_0x4746('0x3e')]);var _0x3d21f8={'where':_0x2794ed[_0x4746('0x39')]};return db['VoiceTransferReport'][_0x4746('0x1f')](_0x3d21f8)[_0x4746('0x25')](function(_0x4cfdd8){_0x406f59[_0x4746('0x1f')]=_0x4cfdd8;if(_0x203d16[_0x4746('0x32')]['includeAll']){_0x2794ed['include']=[{'all':!![]}];}return db[_0x4746('0x2c')][_0x4746('0x3f')](_0x2794ed);})[_0x4746('0x25')](function(_0x297fc8){_0x406f59[_0x4746('0x40')]=_0x297fc8;return _0x406f59;})[_0x4746('0x25')](respondWithFilteredResult(_0x1c4f8e,_0x2794ed))[_0x4746('0x41')](handleError(_0x1c4f8e,null));};exports[_0x4746('0x42')]=function(_0x286f30,_0x190624){var _0xbb048c={'raw':!![],'where':{'id':_0x286f30[_0x4746('0x43')]['id']}},_0x51ad61={};_0x51ad61[_0x4746('0x2f')]=_[_0x4746('0x30')](db[_0x4746('0x2c')]['rawAttributes']);_0x51ad61[_0x4746('0x32')]=_['keys'](_0x286f30[_0x4746('0x32')]);_0x51ad61[_0x4746('0x3a')]=_['intersection'](_0x51ad61[_0x4746('0x2f')],_0x51ad61[_0x4746('0x32')]);_0xbb048c[_0x4746('0x33')]=_[_0x4746('0x31')](_0x51ad61[_0x4746('0x2f')],qs['fields'](_0x286f30[_0x4746('0x32')]['fields']));_0xbb048c['attributes']=_0xbb048c[_0x4746('0x33')][_0x4746('0x35')]?_0xbb048c[_0x4746('0x33')]:_0x51ad61[_0x4746('0x2f')];if(_0x286f30[_0x4746('0x32')][_0x4746('0x44')]){_0xbb048c['include']=[{'all':!![]}];}_0xbb048c=_[_0x4746('0x3d')]({},_0xbb048c,_0x286f30[_0x4746('0x3e')]);return db[_0x4746('0x2c')][_0x4746('0x45')](_0xbb048c)[_0x4746('0x25')](handleEntityNotFound(_0x190624,null))[_0x4746('0x25')](respondWithResult(_0x190624,null))[_0x4746('0x41')](handleError(_0x190624,null));};exports[_0x4746('0x46')]=function(_0x593f30,_0x30bcf1){return db['VoiceTransferReport'][_0x4746('0x46')](_0x593f30[_0x4746('0x47')],{})[_0x4746('0x25')](respondWithResult(_0x30bcf1,0xc9))[_0x4746('0x41')](handleError(_0x30bcf1,null));};exports[_0x4746('0x24')]=function(_0x368cd9,_0x1a0f52){if(_0x368cd9[_0x4746('0x47')]['id']){delete _0x368cd9['body']['id'];}return db[_0x4746('0x2c')][_0x4746('0x45')]({'where':{'id':_0x368cd9[_0x4746('0x43')]['id']}})[_0x4746('0x25')](handleEntityNotFound(_0x1a0f52,null))[_0x4746('0x25')](saveUpdates(_0x368cd9[_0x4746('0x47')],null))[_0x4746('0x25')](respondWithResult(_0x1a0f52,null))['catch'](handleError(_0x1a0f52,null));};exports[_0x4746('0x26')]=function(_0x55ee04,_0x373bde){return db[_0x4746('0x2c')][_0x4746('0x45')]({'where':{'id':_0x55ee04[_0x4746('0x43')]['id']}})['then'](handleEntityNotFound(_0x373bde,null))[_0x4746('0x25')](removeEntity(_0x373bde,null))['catch'](handleError(_0x373bde,null));};exports[_0x4746('0x48')]=function(_0x5ad49b,_0x10b089){return db[_0x4746('0x2c')]['describe']()['then'](respondWithResult(_0x10b089,null))[_0x4746('0x41')](handleError(_0x10b089,null));}; \ No newline at end of file +var _0x72b0=['key','model','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','keys','rawAttributes','options','create','body','find','params','describe','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','VoiceTransferReport'];(function(_0x259c4c,_0x155319){var _0xeb9acb=function(_0x4a4379){while(--_0x4a4379){_0x259c4c['push'](_0x259c4c['shift']());}};_0xeb9acb(++_0x155319);}(_0x72b0,0x18a));var _0x072b=function(_0x191bf5,_0x1dbfa7){_0x191bf5=_0x191bf5-0x0;var _0x3a466d=_0x72b0[_0x191bf5];return _0x3a466d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x072b('0x0'));var zipdir=require(_0x072b('0x1'));var jsonpatch=require(_0x072b('0x2'));var rp=require(_0x072b('0x3'));var moment=require(_0x072b('0x4'));var BPromise=require(_0x072b('0x5'));var Mustache=require('mustache');var util=require(_0x072b('0x6'));var path=require(_0x072b('0x7'));var sox=require(_0x072b('0x8'));var csv=require(_0x072b('0x9'));var ejs=require(_0x072b('0xa'));var fs=require('fs');var fs_extra=require(_0x072b('0xb'));var _=require(_0x072b('0xc'));var squel=require('squel');var crypto=require(_0x072b('0xd'));var jsforce=require(_0x072b('0xe'));var deskjs=require(_0x072b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x072b('0x10'));var Papa=require(_0x072b('0x11'));var Redis=require('ioredis');var authService=require(_0x072b('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x072b('0x13'));var logger=require(_0x072b('0x14'))(_0x072b('0x15'));var utils=require(_0x072b('0x16'));var config=require(_0x072b('0x17'));var licenseUtil=require(_0x072b('0x18'));var db=require(_0x072b('0x19'))['db'];function respondWithStatusCode(_0x417714,_0x3986db){_0x3986db=_0x3986db||0xcc;return function(_0x3c2863){if(_0x3c2863){return _0x417714[_0x072b('0x1a')](_0x3986db);}return _0x417714[_0x072b('0x1b')](_0x3986db)['end']();};}function respondWithResult(_0x4cc3ff,_0x441733){_0x441733=_0x441733||0xc8;return function(_0x352b70){if(_0x352b70){return _0x4cc3ff[_0x072b('0x1b')](_0x441733)[_0x072b('0x1c')](_0x352b70);}};}function respondWithFilteredResult(_0x1e898d,_0x331170){return function(_0xb2fe60){if(_0xb2fe60){var _0x21cd40=typeof _0x331170[_0x072b('0x1d')]==='undefined'&&typeof _0x331170['limit']==='undefined';var _0x4529d3=_0xb2fe60[_0x072b('0x1e')];var _0x5ebd0a=_0x21cd40?0x0:_0x331170[_0x072b('0x1d')];var _0x387131=_0x21cd40?_0xb2fe60[_0x072b('0x1e')]:_0x331170[_0x072b('0x1d')]+_0x331170['limit'];var _0x55db79;if(_0x387131>=_0x4529d3){_0x387131=_0x4529d3;_0x55db79=0xc8;}else{_0x55db79=0xce;}_0x1e898d[_0x072b('0x1b')](_0x55db79);return _0x1e898d['set'](_0x072b('0x1f'),_0x5ebd0a+'-'+_0x387131+'/'+_0x4529d3)[_0x072b('0x1c')](_0xb2fe60);}return null;};}function patchUpdates(_0x364d29){return function(_0x395fbc){try{jsonpatch[_0x072b('0x20')](_0x395fbc,_0x364d29,!![]);}catch(_0x227db3){return BPromise[_0x072b('0x21')](_0x227db3);}return _0x395fbc['save']();};}function saveUpdates(_0x5c8cd4,_0x4f400d){return function(_0x5e28e7){if(_0x5e28e7){return _0x5e28e7[_0x072b('0x22')](_0x5c8cd4)[_0x072b('0x23')](function(_0x465f4b){return _0x465f4b;});}return null;};}function removeEntity(_0x5a4970,_0x4f245a){return function(_0x4f8feb){if(_0x4f8feb){return _0x4f8feb[_0x072b('0x24')]()[_0x072b('0x23')](function(){_0x5a4970[_0x072b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x400826,_0x3bbfd9){return function(_0x167ccd){if(!_0x167ccd){_0x400826[_0x072b('0x1a')](0x194);}return _0x167ccd;};}function handleError(_0x5b8431,_0x2aa60e){_0x2aa60e=_0x2aa60e||0x1f4;return function(_0x39a080){logger[_0x072b('0x25')](_0x39a080[_0x072b('0x26')]);if(_0x39a080['name']){delete _0x39a080[_0x072b('0x27')];}_0x5b8431[_0x072b('0x1b')](_0x2aa60e)[_0x072b('0x28')](_0x39a080);};}exports[_0x072b('0x29')]=function(_0x22deeb,_0x4396d8){var _0x1f77b4={},_0x3f805e={},_0x3b6674={'count':0x0,'rows':[]};var _0x2321bf=_[_0x072b('0x2a')](db[_0x072b('0x2b')]['rawAttributes'],function(_0x1c6176){return{'name':_0x1c6176['fieldName'],'type':_0x1c6176['type'][_0x072b('0x2c')]};});_0x3f805e[_0x072b('0x2d')]=_['map'](_0x2321bf,_0x072b('0x27'));_0x3f805e[_0x072b('0x2e')]=_['keys'](_0x22deeb[_0x072b('0x2e')]);_0x3f805e[_0x072b('0x2f')]=_['intersection'](_0x3f805e[_0x072b('0x2d')],_0x3f805e['query']);_0x1f77b4['attributes']=_[_0x072b('0x30')](_0x3f805e[_0x072b('0x2d')],qs[_0x072b('0x31')](_0x22deeb[_0x072b('0x2e')][_0x072b('0x31')]));_0x1f77b4[_0x072b('0x32')]=_0x1f77b4[_0x072b('0x32')][_0x072b('0x33')]?_0x1f77b4[_0x072b('0x32')]:_0x3f805e['model'];if(!_0x22deeb['query']['hasOwnProperty'](_0x072b('0x34'))){_0x1f77b4['limit']=qs[_0x072b('0x35')](_0x22deeb['query'][_0x072b('0x35')]);_0x1f77b4[_0x072b('0x1d')]=qs['offset'](_0x22deeb[_0x072b('0x2e')][_0x072b('0x1d')]);}_0x1f77b4[_0x072b('0x36')]=qs[_0x072b('0x37')](_0x22deeb[_0x072b('0x2e')]['sort']);_0x1f77b4[_0x072b('0x38')]=qs[_0x072b('0x2f')](_['pick'](_0x22deeb[_0x072b('0x2e')],_0x3f805e[_0x072b('0x2f')]),_0x2321bf);if(_0x22deeb[_0x072b('0x2e')][_0x072b('0x39')]){_0x1f77b4['where']=_[_0x072b('0x3a')](_0x1f77b4[_0x072b('0x38')],{'$or':_[_0x072b('0x2a')](_0x2321bf,function(_0x4a9e0e){if(_0x4a9e0e['type']!==_0x072b('0x3b')){var _0x372e90={};_0x372e90[_0x4a9e0e[_0x072b('0x27')]]={'$like':'%'+_0x22deeb[_0x072b('0x2e')][_0x072b('0x39')]+'%'};return _0x372e90;}})});}_0x1f77b4=_[_0x072b('0x3a')]({},_0x1f77b4,_0x22deeb['options']);var _0x539df1={'where':_0x1f77b4[_0x072b('0x38')]};return db[_0x072b('0x2b')][_0x072b('0x1e')](_0x539df1)[_0x072b('0x23')](function(_0x1cd411){_0x3b6674[_0x072b('0x1e')]=_0x1cd411;if(_0x22deeb[_0x072b('0x2e')][_0x072b('0x3c')]){_0x1f77b4[_0x072b('0x3d')]=[{'all':!![]}];}return db[_0x072b('0x2b')][_0x072b('0x3e')](_0x1f77b4);})[_0x072b('0x23')](function(_0x5e49d3){_0x3b6674[_0x072b('0x3f')]=_0x5e49d3;return _0x3b6674;})[_0x072b('0x23')](respondWithFilteredResult(_0x4396d8,_0x1f77b4))[_0x072b('0x40')](handleError(_0x4396d8,null));};exports['show']=function(_0x172995,_0x443edb){var _0x93ab05={'raw':!![],'where':{'id':_0x172995['params']['id']}},_0x51eb88={};_0x51eb88[_0x072b('0x2d')]=_[_0x072b('0x41')](db[_0x072b('0x2b')][_0x072b('0x42')]);_0x51eb88[_0x072b('0x2e')]=_[_0x072b('0x41')](_0x172995[_0x072b('0x2e')]);_0x51eb88[_0x072b('0x2f')]=_[_0x072b('0x30')](_0x51eb88[_0x072b('0x2d')],_0x51eb88['query']);_0x93ab05['attributes']=_[_0x072b('0x30')](_0x51eb88[_0x072b('0x2d')],qs[_0x072b('0x31')](_0x172995['query'][_0x072b('0x31')]));_0x93ab05[_0x072b('0x32')]=_0x93ab05[_0x072b('0x32')]['length']?_0x93ab05[_0x072b('0x32')]:_0x51eb88[_0x072b('0x2d')];if(_0x172995[_0x072b('0x2e')][_0x072b('0x3c')]){_0x93ab05[_0x072b('0x3d')]=[{'all':!![]}];}_0x93ab05=_[_0x072b('0x3a')]({},_0x93ab05,_0x172995[_0x072b('0x43')]);return db['VoiceTransferReport']['find'](_0x93ab05)[_0x072b('0x23')](handleEntityNotFound(_0x443edb,null))['then'](respondWithResult(_0x443edb,null))[_0x072b('0x40')](handleError(_0x443edb,null));};exports[_0x072b('0x44')]=function(_0x4959a1,_0xcbc537){return db['VoiceTransferReport'][_0x072b('0x44')](_0x4959a1['body'],{})['then'](respondWithResult(_0xcbc537,0xc9))['catch'](handleError(_0xcbc537,null));};exports['update']=function(_0x4e1496,_0x48335b){if(_0x4e1496[_0x072b('0x45')]['id']){delete _0x4e1496['body']['id'];}return db[_0x072b('0x2b')][_0x072b('0x46')]({'where':{'id':_0x4e1496[_0x072b('0x47')]['id']}})['then'](handleEntityNotFound(_0x48335b,null))[_0x072b('0x23')](saveUpdates(_0x4e1496[_0x072b('0x45')],null))[_0x072b('0x23')](respondWithResult(_0x48335b,null))[_0x072b('0x40')](handleError(_0x48335b,null));};exports[_0x072b('0x24')]=function(_0x306803,_0x3dc5fd){return db[_0x072b('0x2b')][_0x072b('0x46')]({'where':{'id':_0x306803[_0x072b('0x47')]['id']}})[_0x072b('0x23')](handleEntityNotFound(_0x3dc5fd,null))[_0x072b('0x23')](removeEntity(_0x3dc5fd,null))[_0x072b('0x40')](handleError(_0x3dc5fd,null));};exports[_0x072b('0x48')]=function(_0x6c3ced,_0x572976){return db[_0x072b('0x2b')][_0x072b('0x48')]()['then'](respondWithResult(_0x572976,null))[_0x072b('0x40')](handleError(_0x572976,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 7a92065..bb6ceff 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 _0x0056=['bluebird','request-promise','path','rimraf','./voiceTransferReport.attributes','define','report_call_transfer','util','../../config/logger','moment'];(function(_0x2cd3d1,_0xb3dc22){var _0x1e3540=function(_0x5a112f){while(--_0x5a112f){_0x2cd3d1['push'](_0x2cd3d1['shift']());}};_0x1e3540(++_0xb3dc22);}(_0x0056,0x15b));var _0x6005=function(_0x333767,_0x3e6f9c){_0x333767=_0x333767-0x0;var _0x51661b=_0x0056[_0x333767];return _0x51661b;};'use strict';var _=require('lodash');var util=require(_0x6005('0x0'));var logger=require(_0x6005('0x1'))('api');var moment=require(_0x6005('0x2'));var BPromise=require(_0x6005('0x3'));var rp=require(_0x6005('0x4'));var fs=require('fs');var path=require(_0x6005('0x5'));var rimraf=require(_0x6005('0x6'));var config=require('../../config/environment');var attributes=require(_0x6005('0x7'));module['exports']=function(_0x47c99d,_0x24fa4a){return _0x47c99d[_0x6005('0x8')]('VoiceTransferReport',attributes,{'tableName':_0x6005('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbacd=['report_call_transfer','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','VoiceTransferReport'];(function(_0x2e897d,_0xded2d1){var _0x31fddb=function(_0x192774){while(--_0x192774){_0x2e897d['push'](_0x2e897d['shift']());}};_0x31fddb(++_0xded2d1);}(_0xbacd,0x114));var _0xdbac=function(_0x5753fd,_0x14a318){_0x5753fd=_0x5753fd-0x0;var _0x557faa=_0xbacd[_0x5753fd];return _0x557faa;};'use strict';var _=require('lodash');var util=require(_0xdbac('0x0'));var logger=require('../../config/logger')(_0xdbac('0x1'));var moment=require(_0xdbac('0x2'));var BPromise=require(_0xdbac('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbac('0x4'));var rimraf=require(_0xdbac('0x5'));var config=require(_0xdbac('0x6'));var attributes=require('./voiceTransferReport.attributes');module[_0xdbac('0x7')]=function(_0x5bc8bb,_0x1b6e04){return _0x5bc8bb[_0xdbac('0x8')](_0xdbac('0x9'),attributes,{'tableName':_0xdbac('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 ce47457..b43a315 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 _0x5e1d=['http','request','info','debug','request\x20sent','stringify','error','VoiceTransferReport,\x20%s,\x20%s','message','result','create','body','options','then','CreateVoiceTransferReport','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x5e1d,0xe8));var _0xd5e1=function(_0x55cdc5,_0x2b2297){_0x55cdc5=_0x55cdc5-0x0;var _0x29acd5=_0x5e1d[_0x55cdc5];return _0x29acd5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd5e1('0x0'));var BPromise=require(_0xd5e1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd5e1('0x2'));var db=require(_0xd5e1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd5e1('0x4'))(_0xd5e1('0x5'));var config=require(_0xd5e1('0x6'));var jayson=require(_0xd5e1('0x7'));var client=jayson['client'][_0xd5e1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53f49e,_0xe93267,_0x46d201){return new BPromise(function(_0x25e238,_0x27d25f){return client[_0xd5e1('0x9')](_0x53f49e,_0x46d201)['then'](function(_0x3c06ca){logger[_0xd5e1('0xa')]('VoiceTransferReport,\x20%s,\x20%s',_0xe93267,'request\x20sent');logger[_0xd5e1('0xb')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0xe93267,_0xd5e1('0xc'),JSON[_0xd5e1('0xd')](_0x3c06ca));if(_0x3c06ca['error']){if(_0x3c06ca[_0xd5e1('0xe')]['code']===0x1f4){logger[_0xd5e1('0xe')](_0xd5e1('0xf'),_0xe93267,_0x3c06ca[_0xd5e1('0xe')][_0xd5e1('0x10')]);return _0x27d25f(_0x3c06ca['error'][_0xd5e1('0x10')]);}logger[_0xd5e1('0xe')](_0xd5e1('0xf'),_0xe93267,_0x3c06ca[_0xd5e1('0xe')][_0xd5e1('0x10')]);return _0x25e238(_0x3c06ca['error'][_0xd5e1('0x10')]);}else{logger[_0xd5e1('0xa')](_0xd5e1('0xf'),_0xe93267,_0xd5e1('0xc'));_0x25e238(_0x3c06ca[_0xd5e1('0x11')][_0xd5e1('0x10')]);}})['catch'](function(_0x488bbc){logger[_0xd5e1('0xe')](_0xd5e1('0xf'),_0xe93267,_0x488bbc);_0x27d25f(_0x488bbc);});});}exports['CreateVoiceTransferReport']=function(_0x4c7e60){var _0x1607fa=this;return new Promise(function(_0x488b75,_0x4af825){return db['VoiceTransferReport'][_0xd5e1('0x12')](_0x4c7e60[_0xd5e1('0x13')],{'raw':_0x4c7e60[_0xd5e1('0x14')]?_0x4c7e60[_0xd5e1('0x14')]['raw']===undefined?!![]:![]:!![]})[_0xd5e1('0x15')](function(_0x28e765){logger['info'](_0xd5e1('0x16'),_0x4c7e60);logger[_0xd5e1('0xb')](_0xd5e1('0x16'),_0x4c7e60,JSON['stringify'](_0x28e765));_0x488b75(_0x28e765);})[_0xd5e1('0x17')](function(_0x1c6631){logger[_0xd5e1('0xe')](_0xd5e1('0x16'),_0x1c6631['message'],_0x4c7e60);_0x4af825(_0x1607fa['error'](0x1f4,_0x1c6631['message']));});});}; \ No newline at end of file +var _0x3fec=['raw','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options'];(function(_0x2923e0,_0xe88675){var _0x1b780e=function(_0x26b804){while(--_0x26b804){_0x2923e0['push'](_0x2923e0['shift']());}};_0x1b780e(++_0xe88675);}(_0x3fec,0x79));var _0xc3fe=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3fec[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc3fe('0x0'));var util=require(_0xc3fe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3fe('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc3fe('0x3'));var logger=require(_0xc3fe('0x4'))(_0xc3fe('0x5'));var config=require(_0xc3fe('0x6'));var jayson=require(_0xc3fe('0x7'));var client=jayson['client'][_0xc3fe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5725f3,_0x509825,_0x4a1ef2){return new BPromise(function(_0x5b8a29,_0x333fa3){return client['request'](_0x5725f3,_0x4a1ef2)['then'](function(_0x317356){logger[_0xc3fe('0x9')](_0xc3fe('0xa'),_0x509825,'request\x20sent');logger[_0xc3fe('0xb')](_0xc3fe('0xc'),_0x509825,_0xc3fe('0xd'),JSON['stringify'](_0x317356));if(_0x317356[_0xc3fe('0xe')]){if(_0x317356[_0xc3fe('0xe')][_0xc3fe('0xf')]===0x1f4){logger['error'](_0xc3fe('0xa'),_0x509825,_0x317356[_0xc3fe('0xe')]['message']);return _0x333fa3(_0x317356[_0xc3fe('0xe')][_0xc3fe('0x10')]);}logger[_0xc3fe('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x509825,_0x317356[_0xc3fe('0xe')][_0xc3fe('0x10')]);return _0x5b8a29(_0x317356[_0xc3fe('0xe')][_0xc3fe('0x10')]);}else{logger[_0xc3fe('0x9')](_0xc3fe('0xa'),_0x509825,_0xc3fe('0xd'));_0x5b8a29(_0x317356[_0xc3fe('0x11')]['message']);}})[_0xc3fe('0x12')](function(_0x2401af){logger[_0xc3fe('0xe')](_0xc3fe('0xa'),_0x509825,_0x2401af);_0x333fa3(_0x2401af);});});}exports[_0xc3fe('0x13')]=function(_0xe5cb83){var _0x1bba78=this;return new Promise(function(_0x27428f,_0x465b10){return db[_0xc3fe('0x14')]['create'](_0xe5cb83[_0xc3fe('0x15')],{'raw':_0xe5cb83[_0xc3fe('0x16')]?_0xe5cb83['options'][_0xc3fe('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x50c77c){logger[_0xc3fe('0x9')](_0xc3fe('0x13'),_0xe5cb83);logger[_0xc3fe('0xb')]('CreateVoiceTransferReport',_0xe5cb83,JSON['stringify'](_0x50c77c));_0x27428f(_0x50c77c);})[_0xc3fe('0x12')](function(_0x15d1b1){logger[_0xc3fe('0xe')](_0xc3fe('0x13'),_0x15d1b1[_0xc3fe('0x10')],_0xe5cb83);_0x465b10(_0x1bba78[_0xc3fe('0xe')](0x1f4,_0x15d1b1['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index d034afc..ab301ef 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['/unhold','unhold','/calls','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','/hangup','isAuthenticated','hangup','hold'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xcb91[_0x20589d];return _0x422de9;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x1cb9('0x0'));var controller=require(_0x1cb9('0x1'));router[_0x1cb9('0x2')](_0x1cb9('0x3'),auth['isAuthenticated'](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0x5')]);router['post'](_0x1cb9('0x6'),auth[_0x1cb9('0x7')](),auth['isWebrtcLicence'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x2')]('/answer',auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller['answer']);router[_0x1cb9('0x2')]('/hold',auth['isAuthenticated'](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x2')](_0x1cb9('0xa'),auth[_0x1cb9('0x7')](),auth['isWebrtcLicence'](),controller[_0x1cb9('0xb')]);router[_0x1cb9('0x2')](_0x1cb9('0xc'),auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller['calls']);router['post']('/transfer',auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0xd')]);module[_0x1cb9('0xe')]=router; \ No newline at end of file +var _0x9bde=['Router','./webbar.controller','/originate','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer','/hold','/unhold','/calls','transfer'];(function(_0x4663cf,_0x4045b2){var _0x5e7f76=function(_0x1e01ae){while(--_0x1e01ae){_0x4663cf['push'](_0x4663cf['shift']());}};_0x5e7f76(++_0x4045b2);}(_0x9bde,0xe1));var _0xe9bd=function(_0x43abb0,_0x319ea3){_0x43abb0=_0x43abb0-0x0;var _0x5e14ae=_0x9bde[_0x43abb0];return _0x5e14ae;};'use strict';var express=require('express');var router=express[_0xe9bd('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xe9bd('0x1'));router['post'](_0xe9bd('0x2'),auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller[_0xe9bd('0x5')]);router[_0xe9bd('0x6')](_0xe9bd('0x7'),auth[_0xe9bd('0x3')](),auth['isWebrtcLicence'](),controller[_0xe9bd('0x8')]);router[_0xe9bd('0x6')](_0xe9bd('0x9'),auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller[_0xe9bd('0xa')]);router[_0xe9bd('0x6')](_0xe9bd('0xb'),auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller['hold']);router['post'](_0xe9bd('0xc'),auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller['unhold']);router[_0xe9bd('0x6')](_0xe9bd('0xd'),auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller['calls']);router[_0xe9bd('0x6')]('/transfer',auth[_0xe9bd('0x3')](),auth[_0xe9bd('0x4')](),controller[_0xe9bd('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index ed5b96b..045c0a2 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 _0x1b73=['unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','VoiceChannels','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../mysqldb','../../config/environment','util','jayson/promise','http','../../config/logger','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','User','findOne','agent','all','filter','rows','UserId','sessionId','\x20not\x20found!','originate','body','length','callerId','callbackUrl','entityFound:','format','user:%s','json','originate\x20executed!','catch','hangup','hangup\x20fired:','hangup\x20executed!','answer','userId','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!'];(function(_0x5e3b17,_0x284d8f){var _0x32f25d=function(_0x22d507){while(--_0x22d507){_0x5e3b17['push'](_0x5e3b17['shift']());}};_0x32f25d(++_0x284d8f);}(_0x1b73,0x1d5));var _0x31b7=function(_0x4adab8,_0x58182c){_0x4adab8=_0x4adab8-0x0;var _0x52ad58=_0x1b73[_0x4adab8];return _0x52ad58;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x31b7('0x0'));var db=require(_0x31b7('0x1'))['db'];var config=require(_0x31b7('0x2'));var util=require(_0x31b7('0x3'));var BPromise=require('bluebird');var jayson=require(_0x31b7('0x4'));var amiClient=jayson['client'][_0x31b7('0x5')]({'port':0x232a});var logger=require(_0x31b7('0x6'))('webbarapi');var Redis=require(_0x31b7('0x7'));config[_0x31b7('0x8')]=_[_0x31b7('0x9')](config['redis'],{'host':_0x31b7('0xa'),'port':0x18eb});var io=require(_0x31b7('0xb'))(new Redis(config[_0x31b7('0x8')]));var Schema=require(_0x31b7('0xc'));var originateValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'callNumber':{'type':_0x31b7('0xf'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x31b7('0xf')},'callbackUrl':{'type':_0x31b7('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'sessionId':{'type':_0x31b7('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'sessionId':{'type':_0x31b7('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'sessionId':{'type':'string','required':[!![],_0x31b7('0x10')]},'transferNumber':{'type':_0x31b7('0xf'),'required':[!![],_0x31b7('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'sessionId':{'type':_0x31b7('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'sessionId':{'type':_0x31b7('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x31b7('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x31b7('0xe')]}});function emit(_0xf213c9,_0x48f733,_0x15df1d){logger[_0x31b7('0x12')](_0xf213c9,_0x48f733,JSON[_0x31b7('0x13')](_0x15df1d));io['to'](_0xf213c9)[_0x31b7('0x14')](_0x48f733,_0x15df1d);}function handleError(_0x3daf67){return function(_0x5f3245){console[_0x31b7('0x15')](_0x31b7('0x16'),_0x5f3245,_0x5f3245 instanceof RangeError);logger[_0x31b7('0x17')](_0x5f3245[_0x31b7('0x18')]);if(_0x5f3245 instanceof RangeError){if(_0x5f3245[_0x31b7('0x19')]){delete _0x5f3245['name'];}_0x3daf67[_0x31b7('0x1a')](0x194)[_0x31b7('0x1b')](_0x5f3245);}else{if(_0x5f3245[_0x31b7('0x19')]){delete _0x5f3245[_0x31b7('0x19')];}_0x3daf67['status'](0x1f4)[_0x31b7('0x1b')](_0x5f3245);}};}function checkError(){return function(_0x15a20c){if(!_0x15a20c){throw new RangeError(_0x31b7('0x1c'));}return _0x15a20c;};}function respondWithRpcPromise(_0x2e4a56,_0x4d4368){return new BPromise(function(_0x33dd04,_0x20cb03){var _0x250574=amiClient;return _0x250574[_0x31b7('0x1d')](_0x2e4a56,_0x4d4368)[_0x31b7('0x1e')](function(_0x2d24bf){if(_0x2d24bf[_0x31b7('0x17')]){if(_0x2d24bf[_0x31b7('0x17')][_0x31b7('0x1f')]===0x1f4){return _0x20cb03(_0x2d24bf['error'][_0x31b7('0x20')]);}return _0x33dd04(_0x2d24bf[_0x31b7('0x17')][_0x31b7('0x20')]);}else{_0x33dd04(_0x2d24bf[_0x31b7('0x21')]);}})['catch'](function(_0xb8a998){_0x20cb03(_0xb8a998);});});}function getAgent(_0x516b89){return db[_0x31b7('0x22')][_0x31b7('0x23')]({'where':{'id':_0x516b89,'role':_0x31b7('0x24')}})[_0x31b7('0x1e')](checkError());}function getAgentCheckSession(_0xffacb,_0x128865){return new BPromise(function(_0x21ab03,_0x554a66){var _0x4e58e5=respondWithRpcPromise('VoiceChannels');var _0x503549=getAgent(_0xffacb);Promise[_0x31b7('0x25')]([_0x4e58e5,_0x503549])[_0x31b7('0x1e')](function(_0x2a7c54){var _0x4f5e1d=_0x2a7c54[0x0];var _0x169238=_0x2a7c54[0x1];var _0x6ba73c=_[_0x31b7('0x26')](_0x4f5e1d[_0x31b7('0x27')],function(_0x58a87e){return _0x58a87e[_0x31b7('0x28')]==_0x169238['id']&&_0x58a87e[_0x31b7('0x29')]==_0x128865;});if(_0x6ba73c['length']==0x1){_0x21ab03(_0x169238);}else{_0x554a66(new RangeError('sessionId\x20'+_0x128865+_0x31b7('0x2a')));}});});}exports[_0x31b7('0x2b')]=function(_0xdde2de,_0x35f83c){logger['info']('originate\x20fired:',_0xdde2de[_0x31b7('0x2c')]);var _0x345393=originateValidation[_0x31b7('0xc')](_0xdde2de[_0x31b7('0x2c')]);if(_0x345393[_0x31b7('0x2d')]>0x0){return _0x35f83c['status'](0x190)['json'](_0x345393);}var _0x36fe4e=_0xdde2de[_0x31b7('0x2c')]['userId'];var _0x2cd807=_0xdde2de[_0x31b7('0x2c')]['callNumber'];var _0x267691=_0xdde2de[_0x31b7('0x2c')][_0x31b7('0x2e')];var _0x23d84b=_0xdde2de[_0x31b7('0x2c')][_0x31b7('0x2f')];return getAgent(_0x36fe4e)[_0x31b7('0x1e')](function(_0x200314){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x200314[_0x31b7('0x19')]);emit(util[_0x31b7('0x31')](_0x31b7('0x32'),_0x200314['name']),'webbar:originate',{'callNumber':_0x2cd807,'callerId':_0x267691,'callbackUrl':_0x23d84b});return _0x35f83c[_0x31b7('0x1a')](0xc8)[_0x31b7('0x33')]({'error':![],'message':_0x31b7('0x34')});})[_0x31b7('0x35')](handleError(_0x35f83c));};exports[_0x31b7('0x36')]=function(_0x37dc32,_0x15a42b){logger[_0x31b7('0x12')](_0x31b7('0x37'),_0x37dc32[_0x31b7('0x2c')]);var _0x5849ad=hangupValidation[_0x31b7('0xc')](_0x37dc32[_0x31b7('0x2c')]);if(_0x5849ad[_0x31b7('0x2d')]>0x0){return _0x15a42b[_0x31b7('0x1a')](0x190)['json'](_0x5849ad);}var _0x20e865=_0x37dc32[_0x31b7('0x2c')]['userId'];var _0x3f8a6b=_0x37dc32['body']['sessionId'];return getAgent(_0x20e865)[_0x31b7('0x1e')](function(_0x10e82c){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x10e82c[_0x31b7('0x19')]);emit(util['format'](_0x31b7('0x32'),_0x10e82c['name']),'webbar:hangup',{'sessionId':_0x3f8a6b});return _0x15a42b['status'](0xc8)[_0x31b7('0x33')]({'error':![],'message':_0x31b7('0x38')});})[_0x31b7('0x35')](handleError(_0x15a42b));};exports[_0x31b7('0x39')]=function(_0x17c2d9,_0x4ccea9){logger[_0x31b7('0x12')]('answer\x20fired:',_0x17c2d9[_0x31b7('0x2c')]);var _0x3caab0=answerValidation[_0x31b7('0xc')](_0x17c2d9[_0x31b7('0x2c')]);if(_0x3caab0['length']>0x0){return _0x4ccea9[_0x31b7('0x1a')](0x190)[_0x31b7('0x33')](_0x3caab0);}var _0x1046fb=_0x17c2d9['body'][_0x31b7('0x3a')];var _0x51918d=_0x17c2d9[_0x31b7('0x2c')][_0x31b7('0x29')];return getAgent(_0x1046fb)['then'](function(_0x152b88){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x152b88[_0x31b7('0x19')]);emit(util['format'](_0x31b7('0x32'),_0x152b88['name']),'webbar:answer',{'sessionId':_0x51918d});return _0x4ccea9[_0x31b7('0x1a')](0xc8)[_0x31b7('0x33')]({'error':![],'message':_0x31b7('0x3b')});})[_0x31b7('0x35')](handleError(_0x4ccea9));};exports['hold']=function(_0x6014e,_0x2be7d6){logger['info'](_0x31b7('0x3c'),_0x6014e[_0x31b7('0x2c')]);var _0x2d313b=holdValidation['validate'](_0x6014e[_0x31b7('0x2c')]);if(_0x2d313b[_0x31b7('0x2d')]>0x0){return _0x2be7d6[_0x31b7('0x1a')](0x190)[_0x31b7('0x33')](_0x2d313b);}var _0x345059=_0x6014e[_0x31b7('0x2c')][_0x31b7('0x3a')];var _0x40aead=_0x6014e['body'][_0x31b7('0x29')];return getAgent(_0x345059)['then'](function(_0x5a72ee){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x5a72ee[_0x31b7('0x19')]);emit(util[_0x31b7('0x31')]('user:%s',_0x5a72ee[_0x31b7('0x19')]),_0x31b7('0x3d'),{'sessionId':_0x40aead});return _0x2be7d6[_0x31b7('0x1a')](0xc8)['json']({'error':![],'message':_0x31b7('0x3e')});})[_0x31b7('0x35')](handleError(_0x2be7d6));};exports[_0x31b7('0x3f')]=function(_0x3b5868,_0x2bf59c){logger[_0x31b7('0x12')](_0x31b7('0x40'),_0x3b5868[_0x31b7('0x2c')]);var _0x4d1fd6=unholdValidation['validate'](_0x3b5868[_0x31b7('0x2c')]);if(_0x4d1fd6[_0x31b7('0x2d')]>0x0){return _0x2bf59c[_0x31b7('0x1a')](0x190)[_0x31b7('0x33')](_0x4d1fd6);}var _0x4920e0=_0x3b5868['body'][_0x31b7('0x3a')];var _0x413bb0=_0x3b5868[_0x31b7('0x2c')][_0x31b7('0x29')];return getAgent(_0x4920e0)[_0x31b7('0x1e')](function(_0x12b713){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x12b713['name']);emit(util['format'](_0x31b7('0x32'),_0x12b713[_0x31b7('0x19')]),_0x31b7('0x41'),{'sessionId':_0x413bb0});return _0x2bf59c[_0x31b7('0x1a')](0xc8)[_0x31b7('0x33')]({'error':![],'message':_0x31b7('0x42')});})[_0x31b7('0x35')](handleError(_0x2bf59c));};exports[_0x31b7('0x43')]=function(_0x1ec95f,_0x3e1c4f){logger['info']('calls\x20fired:',_0x3e1c4f[_0x31b7('0x2c')]);var _0x954c=callsValidation[_0x31b7('0xc')](_0x1ec95f[_0x31b7('0x2c')]);if(_0x954c['length']>0x0){return _0x3e1c4f[_0x31b7('0x1a')](0x190)[_0x31b7('0x33')](_0x954c);}var _0x316175=_0x1ec95f[_0x31b7('0x2c')][_0x31b7('0x3a')];var _0x23ffad=respondWithRpcPromise(_0x31b7('0x44'));var _0x3a8b87=getAgent(_0x316175);return Promise[_0x31b7('0x25')]([_0x23ffad,_0x3a8b87])[_0x31b7('0x1e')](function(_0x29ef38){var _0x4cd34e=_0x29ef38[0x0];var _0x4c77e0=_0x29ef38[0x1];var _0x2cf8ec=_[_0x31b7('0x26')](_0x4cd34e[_0x31b7('0x27')],function(_0x3f25d7){return _0x3f25d7[_0x31b7('0x28')]==_0x4c77e0['id'];});return _0x3e1c4f[_0x31b7('0x1a')](0xc8)['json']({'count':_0x2cf8ec[_0x31b7('0x2d')],'rows':_0x2cf8ec});})['catch'](handleError(_0x3e1c4f));};exports['conference']=function(_0x531bcd,_0x3686b8){logger[_0x31b7('0x12')](_0x31b7('0x45'),_0x531bcd[_0x31b7('0x2c')]);var _0x44934f=conferenceValidation[_0x31b7('0xc')](_0x531bcd[_0x31b7('0x2c')]);if(_0x44934f[_0x31b7('0x2d')]>0x0){return _0x3686b8[_0x31b7('0x1a')](0x190)[_0x31b7('0x33')](_0x44934f);}var _0x40d54b=_0x531bcd[_0x31b7('0x2c')][_0x31b7('0x3a')];return getAgent(_0x40d54b)[_0x31b7('0x1e')](function(_0x2598d5){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x2598d5[_0x31b7('0x19')]);emit(util[_0x31b7('0x31')](_0x31b7('0x32'),_0x2598d5[_0x31b7('0x19')]),_0x31b7('0x46'));return _0x3686b8[_0x31b7('0x1a')](0xc8)[_0x31b7('0x33')]({'error':![],'message':'conference\x20executed!'});})[_0x31b7('0x35')](handleError(_0x3686b8));};exports[_0x31b7('0x47')]=function(_0x47f5f7,_0x2900ff){logger['info'](_0x31b7('0x48'),_0x47f5f7[_0x31b7('0x2c')]);var _0x318746=transferValidation[_0x31b7('0xc')](_0x47f5f7['body']);if(_0x318746[_0x31b7('0x2d')]>0x0){return _0x2900ff['status'](0x190)[_0x31b7('0x33')](_0x318746);}var _0x4b368c=_0x47f5f7[_0x31b7('0x2c')][_0x31b7('0x3a')];var _0xfeb4e2=_0x47f5f7[_0x31b7('0x2c')]['sessionId'];var _0xb4be25=_0x47f5f7[_0x31b7('0x2c')][_0x31b7('0x49')];return getAgent(_0x4b368c)[_0x31b7('0x1e')](function(_0x3c0cf8){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x3c0cf8[_0x31b7('0x19')]);emit(util[_0x31b7('0x31')](_0x31b7('0x32'),_0x3c0cf8[_0x31b7('0x19')]),_0x31b7('0x4a'),{'sessionId':_0xfeb4e2,'transferNumber':_0xb4be25});return _0x2900ff[_0x31b7('0x1a')](0xc8)[_0x31b7('0x33')]({'error':![],'message':_0x31b7('0x4b')});})[_0x31b7('0x35')](handleError(_0x2900ff));}; \ No newline at end of file +var _0xbf6e=['bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','transferNumber\x20is\x20required','info','stringify','emit','log','stack','name','status','send','NotFound','request','then','error','code','message','result','catch','User','agent','VoiceChannels','all','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','filter','UserId','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','../../mysqldb','../../config/environment','util'];(function(_0x47c8a7,_0x1706cc){var _0x350704=function(_0x6b483f){while(--_0x6b483f){_0x47c8a7['push'](_0x47c8a7['shift']());}};_0x350704(++_0x1706cc);}(_0xbf6e,0x149));var _0xebf6=function(_0x1f1611,_0x8e92b0){_0x1f1611=_0x1f1611-0x0;var _0xd79ac6=_0xbf6e[_0x1f1611];return _0xd79ac6;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require(_0xebf6('0x0'))['db'];var config=require(_0xebf6('0x1'));var util=require(_0xebf6('0x2'));var BPromise=require(_0xebf6('0x3'));var jayson=require(_0xebf6('0x4'));var amiClient=jayson[_0xebf6('0x5')][_0xebf6('0x6')]({'port':0x232a});var logger=require('../../config/logger')(_0xebf6('0x7'));var Redis=require(_0xebf6('0x8'));config[_0xebf6('0x9')]=_[_0xebf6('0xa')](config[_0xebf6('0x9')],{'host':_0xebf6('0xb'),'port':0x18eb});var io=require(_0xebf6('0xc'))(new Redis(config['redis']));var Schema=require(_0xebf6('0xd'));var originateValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]},'callNumber':{'type':'string','required':[!![],_0xebf6('0x10')]},'callerId':{'type':_0xebf6('0x11')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]},'sessionId':{'type':_0xebf6('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]},'sessionId':{'type':_0xebf6('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xebf6('0xf')]},'sessionId':{'type':_0xebf6('0x11'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xebf6('0x11'),'required':[!![],_0xebf6('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]},'sessionId':{'type':_0xebf6('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xebf6('0xf')]}});function emit(_0x2c980f,_0xb164a1,_0x642167){logger[_0xebf6('0x13')](_0x2c980f,_0xb164a1,JSON[_0xebf6('0x14')](_0x642167));io['to'](_0x2c980f)[_0xebf6('0x15')](_0xb164a1,_0x642167);}function handleError(_0x2dc96f){return function(_0x2d3984){console[_0xebf6('0x16')]('handleError:',_0x2d3984,_0x2d3984 instanceof RangeError);logger['error'](_0x2d3984[_0xebf6('0x17')]);if(_0x2d3984 instanceof RangeError){if(_0x2d3984[_0xebf6('0x18')]){delete _0x2d3984[_0xebf6('0x18')];}_0x2dc96f[_0xebf6('0x19')](0x194)[_0xebf6('0x1a')](_0x2d3984);}else{if(_0x2d3984[_0xebf6('0x18')]){delete _0x2d3984[_0xebf6('0x18')];}_0x2dc96f[_0xebf6('0x19')](0x1f4)['send'](_0x2d3984);}};}function checkError(){return function(_0xbe39dd){if(!_0xbe39dd){throw new RangeError(_0xebf6('0x1b'));}return _0xbe39dd;};}function respondWithRpcPromise(_0x377934,_0x23d487){return new BPromise(function(_0x6303ac,_0x14c8ac){var _0x2f419e=amiClient;return _0x2f419e[_0xebf6('0x1c')](_0x377934,_0x23d487)[_0xebf6('0x1d')](function(_0x2e32c6){if(_0x2e32c6[_0xebf6('0x1e')]){if(_0x2e32c6[_0xebf6('0x1e')][_0xebf6('0x1f')]===0x1f4){return _0x14c8ac(_0x2e32c6[_0xebf6('0x1e')][_0xebf6('0x20')]);}return _0x6303ac(_0x2e32c6[_0xebf6('0x1e')][_0xebf6('0x20')]);}else{_0x6303ac(_0x2e32c6[_0xebf6('0x21')]);}})[_0xebf6('0x22')](function(_0x4dadf7){_0x14c8ac(_0x4dadf7);});});}function getAgent(_0x58fb66){return db[_0xebf6('0x23')]['findOne']({'where':{'id':_0x58fb66,'role':_0xebf6('0x24')}})[_0xebf6('0x1d')](checkError());}function getAgentCheckSession(_0x5a01ea,_0x4f39eb){return new BPromise(function(_0x37950c,_0x40ae57){var _0x3c3d5c=respondWithRpcPromise(_0xebf6('0x25'));var _0xedaaeb=getAgent(_0x5a01ea);Promise[_0xebf6('0x26')]([_0x3c3d5c,_0xedaaeb])[_0xebf6('0x1d')](function(_0x7551ce){var _0x4c3495=_0x7551ce[0x0];var _0x37cd67=_0x7551ce[0x1];var _0x78cdf0=_['filter'](_0x4c3495[_0xebf6('0x27')],function(_0x28bbea){return _0x28bbea['UserId']==_0x37cd67['id']&&_0x28bbea[_0xebf6('0x28')]==_0x4f39eb;});if(_0x78cdf0[_0xebf6('0x29')]==0x1){_0x37950c(_0x37cd67);}else{_0x40ae57(new RangeError(_0xebf6('0x2a')+_0x4f39eb+_0xebf6('0x2b')));}});});}exports[_0xebf6('0x2c')]=function(_0x41da63,_0x4907d0){logger[_0xebf6('0x13')](_0xebf6('0x2d'),_0x41da63['body']);var _0x534142=originateValidation[_0xebf6('0xd')](_0x41da63[_0xebf6('0x2e')]);if(_0x534142['length']>0x0){return _0x4907d0[_0xebf6('0x19')](0x190)[_0xebf6('0x2f')](_0x534142);}var _0x4d736c=_0x41da63[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x12bd27=_0x41da63['body'][_0xebf6('0x31')];var _0x20192c=_0x41da63[_0xebf6('0x2e')][_0xebf6('0x32')];var _0x4b6d95=_0x41da63['body'][_0xebf6('0x33')];return getAgent(_0x4d736c)[_0xebf6('0x1d')](function(_0x562f76){logger[_0xebf6('0x13')](_0xebf6('0x34'),_0x562f76['name']);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x562f76[_0xebf6('0x18')]),_0xebf6('0x37'),{'callNumber':_0x12bd27,'callerId':_0x20192c,'callbackUrl':_0x4b6d95});return _0x4907d0[_0xebf6('0x19')](0xc8)['json']({'error':![],'message':_0xebf6('0x38')});})['catch'](handleError(_0x4907d0));};exports[_0xebf6('0x39')]=function(_0x54702d,_0xafef4d){logger[_0xebf6('0x13')](_0xebf6('0x3a'),_0x54702d[_0xebf6('0x2e')]);var _0x2f1236=hangupValidation[_0xebf6('0xd')](_0x54702d['body']);if(_0x2f1236[_0xebf6('0x29')]>0x0){return _0xafef4d[_0xebf6('0x19')](0x190)[_0xebf6('0x2f')](_0x2f1236);}var _0x144b41=_0x54702d[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x49f089=_0x54702d[_0xebf6('0x2e')][_0xebf6('0x28')];return getAgent(_0x144b41)[_0xebf6('0x1d')](function(_0x111ff7){logger[_0xebf6('0x13')](_0xebf6('0x34'),_0x111ff7['name']);emit(util['format']('user:%s',_0x111ff7[_0xebf6('0x18')]),_0xebf6('0x3b'),{'sessionId':_0x49f089});return _0xafef4d[_0xebf6('0x19')](0xc8)['json']({'error':![],'message':_0xebf6('0x3c')});})[_0xebf6('0x22')](handleError(_0xafef4d));};exports[_0xebf6('0x3d')]=function(_0x5ca582,_0x8cca55){logger[_0xebf6('0x13')]('answer\x20fired:',_0x5ca582[_0xebf6('0x2e')]);var _0x1de50e=answerValidation[_0xebf6('0xd')](_0x5ca582['body']);if(_0x1de50e[_0xebf6('0x29')]>0x0){return _0x8cca55['status'](0x190)['json'](_0x1de50e);}var _0x256552=_0x5ca582[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x2ac140=_0x5ca582['body'][_0xebf6('0x28')];return getAgent(_0x256552)['then'](function(_0x4483d2){logger[_0xebf6('0x13')](_0xebf6('0x34'),_0x4483d2[_0xebf6('0x18')]);emit(util[_0xebf6('0x35')]('user:%s',_0x4483d2['name']),_0xebf6('0x3e'),{'sessionId':_0x2ac140});return _0x8cca55[_0xebf6('0x19')](0xc8)[_0xebf6('0x2f')]({'error':![],'message':_0xebf6('0x3f')});})['catch'](handleError(_0x8cca55));};exports[_0xebf6('0x40')]=function(_0x21999e,_0x41c4ce){logger[_0xebf6('0x13')](_0xebf6('0x41'),_0x21999e[_0xebf6('0x2e')]);var _0x45e0f1=holdValidation['validate'](_0x21999e[_0xebf6('0x2e')]);if(_0x45e0f1[_0xebf6('0x29')]>0x0){return _0x41c4ce[_0xebf6('0x19')](0x190)[_0xebf6('0x2f')](_0x45e0f1);}var _0x166664=_0x21999e[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x56b26b=_0x21999e[_0xebf6('0x2e')]['sessionId'];return getAgent(_0x166664)[_0xebf6('0x1d')](function(_0x31d8ba){logger['info'](_0xebf6('0x34'),_0x31d8ba['name']);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x31d8ba[_0xebf6('0x18')]),_0xebf6('0x42'),{'sessionId':_0x56b26b});return _0x41c4ce[_0xebf6('0x19')](0xc8)['json']({'error':![],'message':_0xebf6('0x43')});})[_0xebf6('0x22')](handleError(_0x41c4ce));};exports['unhold']=function(_0x1f98fd,_0x2765f2){logger[_0xebf6('0x13')](_0xebf6('0x44'),_0x1f98fd[_0xebf6('0x2e')]);var _0x549892=unholdValidation[_0xebf6('0xd')](_0x1f98fd[_0xebf6('0x2e')]);if(_0x549892[_0xebf6('0x29')]>0x0){return _0x2765f2[_0xebf6('0x19')](0x190)['json'](_0x549892);}var _0x3629aa=_0x1f98fd[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x303997=_0x1f98fd[_0xebf6('0x2e')][_0xebf6('0x28')];return getAgent(_0x3629aa)[_0xebf6('0x1d')](function(_0x9184ce){logger[_0xebf6('0x13')]('entityFound:',_0x9184ce[_0xebf6('0x18')]);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x9184ce['name']),_0xebf6('0x45'),{'sessionId':_0x303997});return _0x2765f2['status'](0xc8)['json']({'error':![],'message':_0xebf6('0x46')});})[_0xebf6('0x22')](handleError(_0x2765f2));};exports[_0xebf6('0x47')]=function(_0x32baee,_0x13c447){logger['info'](_0xebf6('0x48'),_0x13c447['body']);var _0x4ed306=callsValidation['validate'](_0x32baee[_0xebf6('0x2e')]);if(_0x4ed306[_0xebf6('0x29')]>0x0){return _0x13c447['status'](0x190)[_0xebf6('0x2f')](_0x4ed306);}var _0x151476=_0x32baee[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x3a4b20=respondWithRpcPromise(_0xebf6('0x25'));var _0x246f9f=getAgent(_0x151476);return Promise['all']([_0x3a4b20,_0x246f9f])[_0xebf6('0x1d')](function(_0xddf329){var _0x40d85f=_0xddf329[0x0];var _0x3101c2=_0xddf329[0x1];var _0x39637b=_[_0xebf6('0x49')](_0x40d85f['rows'],function(_0x44a46f){return _0x44a46f[_0xebf6('0x4a')]==_0x3101c2['id'];});return _0x13c447[_0xebf6('0x19')](0xc8)[_0xebf6('0x2f')]({'count':_0x39637b[_0xebf6('0x29')],'rows':_0x39637b});})[_0xebf6('0x22')](handleError(_0x13c447));};exports['conference']=function(_0x33c973,_0x193e5b){logger[_0xebf6('0x13')](_0xebf6('0x4b'),_0x33c973[_0xebf6('0x2e')]);var _0x537751=conferenceValidation[_0xebf6('0xd')](_0x33c973[_0xebf6('0x2e')]);if(_0x537751[_0xebf6('0x29')]>0x0){return _0x193e5b[_0xebf6('0x19')](0x190)[_0xebf6('0x2f')](_0x537751);}var _0x6c43e4=_0x33c973[_0xebf6('0x2e')][_0xebf6('0x30')];return getAgent(_0x6c43e4)[_0xebf6('0x1d')](function(_0x3debd2){logger[_0xebf6('0x13')]('entityFound:',_0x3debd2[_0xebf6('0x18')]);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x3debd2[_0xebf6('0x18')]),_0xebf6('0x4c'));return _0x193e5b[_0xebf6('0x19')](0xc8)['json']({'error':![],'message':_0xebf6('0x4d')});})['catch'](handleError(_0x193e5b));};exports[_0xebf6('0x4e')]=function(_0x34fa02,_0x10272b){logger[_0xebf6('0x13')](_0xebf6('0x4f'),_0x34fa02[_0xebf6('0x2e')]);var _0x398074=transferValidation['validate'](_0x34fa02['body']);if(_0x398074[_0xebf6('0x29')]>0x0){return _0x10272b[_0xebf6('0x19')](0x190)['json'](_0x398074);}var _0x3dc02c=_0x34fa02[_0xebf6('0x2e')]['userId'];var _0x3bee09=_0x34fa02[_0xebf6('0x2e')]['sessionId'];var _0x35a5c4=_0x34fa02[_0xebf6('0x2e')][_0xebf6('0x50')];return getAgent(_0x3dc02c)[_0xebf6('0x1d')](function(_0x345763){logger[_0xebf6('0x13')](_0xebf6('0x34'),_0x345763['name']);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x345763[_0xebf6('0x18')]),_0xebf6('0x51'),{'sessionId':_0x3bee09,'transferNumber':_0x35a5c4});return _0x10272b[_0xebf6('0x19')](0xc8)[_0xebf6('0x2f')]({'error':![],'message':_0xebf6('0x52')});})[_0xebf6('0x22')](handleError(_0x10272b));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index f860185..ea0ddbd 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 _0xa115=['get','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addDisposition','addAnswer','addAgents','notify','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xa115,0x88));var _0x5a11=function(_0x2636f5,_0x5be4a0){_0x2636f5=_0x2636f5-0x0;var _0x5a6fde=_0xa115[_0x2636f5];return _0x5a6fde;};'use strict';var multer=require(_0x5a11('0x0'));var util=require(_0x5a11('0x1'));var path=require(_0x5a11('0x2'));var timeout=require(_0x5a11('0x3'));var express=require('express');var router=express[_0x5a11('0x4')]();var fs_extra=require(_0x5a11('0x5'));var auth=require(_0x5a11('0x6'));var interaction=require(_0x5a11('0x7'));var config=require('../../config/environment');var controller=require('./whatsappAccount.controller');router[_0x5a11('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5a11('0x8')]('/describe',auth[_0x5a11('0x9')](),controller[_0x5a11('0xa')]);router[_0x5a11('0x8')](_0x5a11('0xb'),auth[_0x5a11('0x9')](),controller['show']);router['get'](_0x5a11('0xc'),auth['isAuthenticated'](),controller[_0x5a11('0xd')]);router['get'](_0x5a11('0xe'),auth[_0x5a11('0x9')](),controller[_0x5a11('0xf')]);router[_0x5a11('0x8')](_0x5a11('0x10'),auth[_0x5a11('0x9')](),controller[_0x5a11('0x11')]);router[_0x5a11('0x8')](_0x5a11('0x12'),auth[_0x5a11('0x9')](),controller[_0x5a11('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5a11('0x14')]);router[_0x5a11('0x15')](_0x5a11('0xc'),auth[_0x5a11('0x9')](),controller[_0x5a11('0x16')]);router['post'](_0x5a11('0xe'),auth[_0x5a11('0x9')](),controller[_0x5a11('0x17')]);router[_0x5a11('0x15')](_0x5a11('0x10'),auth['isAuthenticated'](),controller[_0x5a11('0x18')]);router[_0x5a11('0x15')]('/:id/applications',auth[_0x5a11('0x9')](),controller['addApplications']);router[_0x5a11('0x15')]('/:id/notify',controller[_0x5a11('0x19')]);router[_0x5a11('0x15')](_0x5a11('0x1a'),auth[_0x5a11('0x9')](),controller[_0x5a11('0x1b')]);router[_0x5a11('0x1c')]('/:id',auth[_0x5a11('0x9')](),controller[_0x5a11('0x1d')]);router[_0x5a11('0x1e')](_0x5a11('0xb'),auth['isAuthenticated'](),controller[_0x5a11('0x1f')]);router[_0x5a11('0x1e')](_0x5a11('0xc'),auth[_0x5a11('0x9')](),controller[_0x5a11('0x20')]);router[_0x5a11('0x1e')](_0x5a11('0xe'),auth[_0x5a11('0x9')](),controller[_0x5a11('0x21')]);router[_0x5a11('0x1e')](_0x5a11('0x10'),auth[_0x5a11('0x9')](),controller[_0x5a11('0x22')]);module[_0x5a11('0x23')]=router; \ No newline at end of file +var _0x1b9f=['describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addApplications','notify','/:id/send','send','update','destroy','delete','removeAnswers','exports','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated'];(function(_0x1ef734,_0x1831e6){var _0x42ec4e=function(_0x59b014){while(--_0x59b014){_0x1ef734['push'](_0x1ef734['shift']());}};_0x42ec4e(++_0x1831e6);}(_0x1b9f,0x9b));var _0xf1b9=function(_0x8aa6cb,_0x593d76){_0x8aa6cb=_0x8aa6cb-0x0;var _0x5e7186=_0x1b9f[_0x8aa6cb];return _0x5e7186;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf1b9('0x0'));var express=require(_0xf1b9('0x1'));var router=express['Router']();var fs_extra=require(_0xf1b9('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xf1b9('0x3'));var config=require(_0xf1b9('0x4'));var controller=require(_0xf1b9('0x5'));router[_0xf1b9('0x6')]('/',auth['isAuthenticated'](),controller[_0xf1b9('0x7')]);router['get'](_0xf1b9('0x8'),auth[_0xf1b9('0x9')](),controller[_0xf1b9('0xa')]);router[_0xf1b9('0x6')](_0xf1b9('0xb'),auth[_0xf1b9('0x9')](),controller[_0xf1b9('0xc')]);router[_0xf1b9('0x6')](_0xf1b9('0xd'),auth[_0xf1b9('0x9')](),controller[_0xf1b9('0xe')]);router['get'](_0xf1b9('0xf'),auth['isAuthenticated'](),controller[_0xf1b9('0x10')]);router['get'](_0xf1b9('0x11'),auth[_0xf1b9('0x9')](),controller[_0xf1b9('0x12')]);router[_0xf1b9('0x6')](_0xf1b9('0x13'),auth[_0xf1b9('0x9')](),controller[_0xf1b9('0x14')]);router[_0xf1b9('0x15')]('/',auth[_0xf1b9('0x9')](),controller[_0xf1b9('0x16')]);router[_0xf1b9('0x15')](_0xf1b9('0xd'),auth[_0xf1b9('0x9')](),controller[_0xf1b9('0x17')]);router[_0xf1b9('0x15')](_0xf1b9('0xf'),auth[_0xf1b9('0x9')](),controller['addAnswer']);router[_0xf1b9('0x15')](_0xf1b9('0x11'),auth['isAuthenticated'](),controller['addAgents']);router[_0xf1b9('0x15')](_0xf1b9('0x13'),auth[_0xf1b9('0x9')](),controller[_0xf1b9('0x18')]);router[_0xf1b9('0x15')]('/:id/notify',controller[_0xf1b9('0x19')]);router['post'](_0xf1b9('0x1a'),auth[_0xf1b9('0x9')](),controller[_0xf1b9('0x1b')]);router['put']('/:id',auth[_0xf1b9('0x9')](),controller[_0xf1b9('0x1c')]);router['delete'](_0xf1b9('0xb'),auth[_0xf1b9('0x9')](),controller[_0xf1b9('0x1d')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0xf1b9('0x1e')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xf1b9('0x1f')]);router['delete'](_0xf1b9('0x11'),auth[_0xf1b9('0x9')](),controller['removeAgents']);module[_0xf1b9('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index e2e6eb4..23a482b 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 _0x770d=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x36bc6a,_0x3770ac){var _0x5f4ce6=function(_0x1c8eb9){while(--_0x1c8eb9){_0x36bc6a['push'](_0x36bc6a['shift']());}};_0x5f4ce6(++_0x3770ac);}(_0x770d,0x122));var _0xd770=function(_0x456323,_0x5dffb9){_0x456323=_0x456323-0x0;var _0x1479e6=_0x770d[_0x456323];return _0x1479e6;};'use strict';var Sequelize=require(_0xd770('0x0'));var rs=require(_0xd770('0x1'));module[_0xd770('0x2')]={'name':{'type':Sequelize[_0xd770('0x3')],'unique':_0xd770('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xd770('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xd770('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd770('0x5')]();}},'phone':{'type':Sequelize[_0xd770('0x3')]},'type':{'type':Sequelize[_0xd770('0x6')](_0xd770('0x7'),'sinch')},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0xd770('0x3')]},'authToken':{'type':Sequelize[_0xd770('0x3')]},'notificationTemplate':{'type':Sequelize[_0xd770('0x8')],'defaultValue':function(){return _0xd770('0x9');}},'notificationSound':{'type':Sequelize[_0xd770('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xd770('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd770('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd770('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd770('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd770('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd770('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd770('0xb')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd770('0xa')],'defaultValue':![],'comment':_0xd770('0xc'),'set':function(_0x1ced49){if(!_0x1ced49){this[_0xd770('0xd')](_0xd770('0xe'),null);}this[_0xd770('0xd')](_0xd770('0xf'),_0x1ced49);}},'description':{'type':Sequelize[_0xd770('0x3')]}}; \ No newline at end of file +var _0x22f2=['sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM'];(function(_0x5e016f,_0x1c874c){var _0x19f6b7=function(_0x24d344){while(--_0x24d344){_0x5e016f['push'](_0x5e016f['shift']());}};_0x19f6b7(++_0x1c874c);}(_0x22f2,0xd6));var _0x222f=function(_0x1ff527,_0x54b6d2){_0x1ff527=_0x1ff527-0x0;var _0x51cc75=_0x22f2[_0x1ff527];return _0x51cc75;};'use strict';var Sequelize=require(_0x222f('0x0'));var rs=require(_0x222f('0x1'));module[_0x222f('0x2')]={'name':{'type':Sequelize[_0x222f('0x3')],'unique':_0x222f('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x222f('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x222f('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x222f('0x3')],'defaultValue':function(){return rs[_0x222f('0x5')]();}},'phone':{'type':Sequelize[_0x222f('0x3')]},'type':{'type':Sequelize[_0x222f('0x6')]('twilio',_0x222f('0x7'))},'accountSid':{'type':Sequelize[_0x222f('0x3')]},'baseUrl':{'type':Sequelize[_0x222f('0x3')]},'authToken':{'type':Sequelize[_0x222f('0x3')]},'notificationTemplate':{'type':Sequelize[_0x222f('0x8')],'defaultValue':function(){return _0x222f('0x9');}},'notificationSound':{'type':Sequelize[_0x222f('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x222f('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x222f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x222f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x222f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x222f('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x222f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x222f('0xc')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x222f('0xd'),'set':function(_0x18c958){if(!_0x18c958){this[_0x222f('0xe')](_0x222f('0xf'),null);}this[_0x222f('0xe')](_0x222f('0x10'),_0x18c958);}},'description':{'type':Sequelize[_0x222f('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 2630d17..ef68a1b 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 _0x4a8e=['socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','name','send','index','Pause','WhatsappAccount','fieldName','type','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','create','body','get','role','user','WhatsappAccounts','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','WhatsappAccountId','findOne','filter','Disposition','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','stack','getApplications','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','Sequelize','ValidationError','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','from','replace','whatsapp:','Body','messageId','MessageSid','notifications','isNil','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','DESC','Contacts','contact','WhatsappInteraction','spread','interaction','created','autoclose','push','unmanaged','*,*,*,*','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','WhatsappQueue','queue','waitForTheAssignedQueue','Start','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','\x0a','CmList','List','out','dataValues','Messages','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','defaults','redis','localhost'];(function(_0x4d9607,_0x4a2515){var _0x5e510f=function(_0x3c8b52){while(--_0x3c8b52){_0x4d9607['push'](_0x4d9607['shift']());}};_0x5e510f(++_0x4a2515);}(_0x4a8e,0x173));var _0xe4a8=function(_0x4350c2,_0x112f3c){_0x4350c2=_0x4350c2-0x0;var _0x8b6406=_0x4a8e[_0x4350c2];return _0x8b6406;};'use strict';var emlformat=require(_0xe4a8('0x0'));var rimraf=require(_0xe4a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe4a8('0x2'));var rp=require(_0xe4a8('0x3'));var moment=require('moment');var BPromise=require(_0xe4a8('0x4'));var Mustache=require(_0xe4a8('0x5'));var util=require(_0xe4a8('0x6'));var path=require(_0xe4a8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe4a8('0x8'));var fs=require('fs');var fs_extra=require(_0xe4a8('0x9'));var _=require(_0xe4a8('0xa'));var squel=require('squel');var crypto=require(_0xe4a8('0xb'));var jsforce=require(_0xe4a8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe4a8('0xd'));var querystring=require(_0xe4a8('0xe'));var Papa=require(_0xe4a8('0xf'));var Redis=require('ioredis');var authService=require(_0xe4a8('0x10'));var qs=require(_0xe4a8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4a8('0x12'));var logger=require('../../config/logger')(_0xe4a8('0x13'));var utils=require('../../config/utils');var config=require(_0xe4a8('0x14'));var licenseUtil=require(_0xe4a8('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe4a8('0x16')](config[_0xe4a8('0x17')],{'host':_0xe4a8('0x18'),'port':0x18eb});var socket=require(_0xe4a8('0x19'))(new Redis(config[_0xe4a8('0x17')]));require(_0xe4a8('0x1a'))[_0xe4a8('0x1b')](socket);var jayson=require(_0xe4a8('0x1c'));var client=jayson[_0xe4a8('0x1d')]['http']({'port':0x232c});function respondWithRpcPromise(_0x7f4beb,_0x1d034a,_0x14af62,_0xf78ac3){return new BPromise(function(_0x489124,_0x38428c){var _0x313c5d=_0xf78ac3||client;return _0x313c5d[_0xe4a8('0x1e')](_0x7f4beb,_0x14af62)[_0xe4a8('0x1f')](function(_0x1e0c9b){logger[_0xe4a8('0x20')](_0xe4a8('0x21'),_0x1d034a,_0xe4a8('0x22'));logger[_0xe4a8('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1d034a,_0xe4a8('0x22'),JSON[_0xe4a8('0x24')](_0x1e0c9b));if(_0x1e0c9b[_0xe4a8('0x25')]){if(_0x1e0c9b[_0xe4a8('0x25')][_0xe4a8('0x26')]===0x1f4){logger[_0xe4a8('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x1d034a,_0x1e0c9b[_0xe4a8('0x25')]['message']);return _0x38428c(_0x1e0c9b['error'][_0xe4a8('0x27')]);}logger[_0xe4a8('0x25')](_0xe4a8('0x21'),_0x1d034a,_0x1e0c9b['error']['message']);return _0x489124(_0x1e0c9b[_0xe4a8('0x25')]['message']);}else{logger[_0xe4a8('0x20')](_0xe4a8('0x21'),_0x1d034a,_0xe4a8('0x22'));_0x489124(_0x1e0c9b[_0xe4a8('0x28')]['message']);}})['catch'](function(_0x1a2892){logger[_0xe4a8('0x25')](_0xe4a8('0x21'),_0x1d034a,_0x1a2892);_0x38428c(_0x1a2892);});});}function respondWithStatusCode(_0x4d9a67,_0x20f289){_0x20f289=_0x20f289||0xcc;return function(_0x8d803d){if(_0x8d803d){return _0x4d9a67[_0xe4a8('0x29')](_0x20f289);}return _0x4d9a67[_0xe4a8('0x2a')](_0x20f289)[_0xe4a8('0x2b')]();};}function respondWithResult(_0x3af9b6,_0x3e6140){_0x3e6140=_0x3e6140||0xc8;return function(_0x28f3){if(_0x28f3){return _0x3af9b6[_0xe4a8('0x2a')](_0x3e6140)[_0xe4a8('0x2c')](_0x28f3);}};}function respondWithFilteredResult(_0x379ab7,_0x3315b2){return function(_0x12352e){if(_0x12352e){var _0x44d094=typeof _0x3315b2[_0xe4a8('0x2d')]===_0xe4a8('0x2e')&&typeof _0x3315b2[_0xe4a8('0x2f')]==='undefined';var _0x3bbcc0=_0x12352e[_0xe4a8('0x30')];var _0xe4ec07=_0x44d094?0x0:_0x3315b2[_0xe4a8('0x2d')];var _0x3af222=_0x44d094?_0x12352e[_0xe4a8('0x30')]:_0x3315b2[_0xe4a8('0x2d')]+_0x3315b2[_0xe4a8('0x2f')];var _0xa3cebc;if(_0x3af222>=_0x3bbcc0){_0x3af222=_0x3bbcc0;_0xa3cebc=0xc8;}else{_0xa3cebc=0xce;}_0x379ab7['status'](_0xa3cebc);return _0x379ab7[_0xe4a8('0x31')]('Content-Range',_0xe4ec07+'-'+_0x3af222+'/'+_0x3bbcc0)[_0xe4a8('0x2c')](_0x12352e);}return null;};}function patchUpdates(_0x5c1324){return function(_0x35baee){try{jsonpatch[_0xe4a8('0x32')](_0x35baee,_0x5c1324,!![]);}catch(_0x1a66ea){return BPromise['reject'](_0x1a66ea);}return _0x35baee[_0xe4a8('0x33')]();};}function saveUpdates(_0x918d84,_0x39baa4){return function(_0x213527){if(_0x213527){return _0x213527[_0xe4a8('0x34')](_0x918d84)[_0xe4a8('0x1f')](function(_0x4e58b4){return _0x4e58b4;});}return null;};}function removeEntity(_0x4a3a4c,_0x1b35b8){return function(_0x4a30da){if(_0x4a30da){return _0x4a30da['destroy']()[_0xe4a8('0x1f')](function(){var _0x4352cc=_0x4a30da['get']({'plain':!![]});var _0x2e5d47='WhatsappAccounts';return db['UserProfileResource'][_0xe4a8('0x35')]({'where':{'type':_0x2e5d47,'resourceId':_0x4352cc['id']}})['then'](function(){return _0x4a30da;});})['then'](function(){_0x4a3a4c[_0xe4a8('0x2a')](0xcc)[_0xe4a8('0x2b')]();});}};}function handleEntityNotFound(_0x37e23d,_0x5f13d0){return function(_0x24f82d){if(!_0x24f82d){_0x37e23d[_0xe4a8('0x29')](0x194);}return _0x24f82d;};}function handleError(_0x1a302a,_0x31bf27){_0x31bf27=_0x31bf27||0x1f4;return function(_0x1b75bc){logger[_0xe4a8('0x25')](_0x1b75bc['stack']);if(_0x1b75bc['name']){delete _0x1b75bc[_0xe4a8('0x36')];}_0x1a302a[_0xe4a8('0x2a')](_0x31bf27)[_0xe4a8('0x37')](_0x1b75bc);};}exports[_0xe4a8('0x38')]=function(_0x1390d5,_0x3871ad){var _0x3f470c={'include':[{'model':db[_0xe4a8('0x39')],'as':'mandatoryDispositionPause'}]},_0x415bcd={},_0x2fd2d3={'count':0x0,'rows':[]};var _0x21a458=_['map'](db[_0xe4a8('0x3a')]['rawAttributes'],function(_0x1adc0b){return{'name':_0x1adc0b[_0xe4a8('0x3b')],'type':_0x1adc0b[_0xe4a8('0x3c')]['key']};});_0x415bcd[_0xe4a8('0x3d')]=_['map'](_0x21a458,_0xe4a8('0x36'));_0x415bcd['query']=_[_0xe4a8('0x3e')](_0x1390d5['query']);_0x415bcd[_0xe4a8('0x3f')]=_[_0xe4a8('0x40')](_0x415bcd[_0xe4a8('0x3d')],_0x415bcd[_0xe4a8('0x41')]);_0x3f470c['attributes']=_[_0xe4a8('0x40')](_0x415bcd[_0xe4a8('0x3d')],qs[_0xe4a8('0x42')](_0x1390d5['query'][_0xe4a8('0x42')]));_0x3f470c[_0xe4a8('0x43')]=_0x3f470c['attributes'][_0xe4a8('0x44')]?_0x3f470c[_0xe4a8('0x43')]:_0x415bcd[_0xe4a8('0x3d')];if(!_0x1390d5[_0xe4a8('0x41')][_0xe4a8('0x45')](_0xe4a8('0x46'))){_0x3f470c['limit']=qs['limit'](_0x1390d5['query'][_0xe4a8('0x2f')]);_0x3f470c['offset']=qs[_0xe4a8('0x2d')](_0x1390d5[_0xe4a8('0x41')][_0xe4a8('0x2d')]);}_0x3f470c[_0xe4a8('0x47')]=qs[_0xe4a8('0x48')](_0x1390d5[_0xe4a8('0x41')][_0xe4a8('0x48')]);_0x3f470c[_0xe4a8('0x49')]=qs[_0xe4a8('0x3f')](_[_0xe4a8('0x4a')](_0x1390d5[_0xe4a8('0x41')],_0x415bcd[_0xe4a8('0x3f')]),_0x21a458);if(_0x1390d5[_0xe4a8('0x41')]['filter']){_0x3f470c[_0xe4a8('0x49')]=_[_0xe4a8('0x4b')](_0x3f470c[_0xe4a8('0x49')],{'$or':_[_0xe4a8('0x4c')](_0x21a458,function(_0x15faee){if(_0x15faee['type']!==_0xe4a8('0x4d')){var _0x33695f={};_0x33695f[_0x15faee[_0xe4a8('0x36')]]={'$like':'%'+_0x1390d5[_0xe4a8('0x41')]['filter']+'%'};return _0x33695f;}})});}_0x3f470c=_['merge']({},_0x3f470c,_0x1390d5[_0xe4a8('0x4e')]);var _0xc9e40a={'where':_0x3f470c[_0xe4a8('0x49')]};return db[_0xe4a8('0x3a')]['count'](_0xc9e40a)['then'](function(_0x4f96de){_0x2fd2d3[_0xe4a8('0x30')]=_0x4f96de;if(_0x1390d5[_0xe4a8('0x41')][_0xe4a8('0x4f')]){_0x3f470c[_0xe4a8('0x50')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xe4a8('0x51')](_0x3f470c);})[_0xe4a8('0x1f')](function(_0x225998){_0x2fd2d3['rows']=_0x225998;return _0x2fd2d3;})[_0xe4a8('0x1f')](respondWithFilteredResult(_0x3871ad,_0x3f470c))[_0xe4a8('0x52')](handleError(_0x3871ad,null));};exports['show']=function(_0x55ac2a,_0x5002af){var _0x28fa69={'raw':![],'where':{'id':_0x55ac2a[_0xe4a8('0x53')]['id']},'include':[{'model':db[_0xe4a8('0x39')],'as':'mandatoryDispositionPause'}]},_0x12ebcf={};_0x12ebcf[_0xe4a8('0x3d')]=_[_0xe4a8('0x3e')](db[_0xe4a8('0x3a')][_0xe4a8('0x54')]);_0x12ebcf[_0xe4a8('0x41')]=_[_0xe4a8('0x3e')](_0x55ac2a[_0xe4a8('0x41')]);_0x12ebcf[_0xe4a8('0x3f')]=_['intersection'](_0x12ebcf[_0xe4a8('0x3d')],_0x12ebcf[_0xe4a8('0x41')]);_0x28fa69['attributes']=_['intersection'](_0x12ebcf[_0xe4a8('0x3d')],qs[_0xe4a8('0x42')](_0x55ac2a[_0xe4a8('0x41')][_0xe4a8('0x42')]));_0x28fa69[_0xe4a8('0x43')]=_0x28fa69[_0xe4a8('0x43')][_0xe4a8('0x44')]?_0x28fa69['attributes']:_0x12ebcf[_0xe4a8('0x3d')];if(_0x55ac2a[_0xe4a8('0x41')][_0xe4a8('0x4f')]){_0x28fa69[_0xe4a8('0x50')]=[{'all':!![]}];}_0x28fa69=_[_0xe4a8('0x4b')]({},_0x28fa69,_0x55ac2a['options']);return db[_0xe4a8('0x3a')]['find'](_0x28fa69)['then'](handleEntityNotFound(_0x5002af,null))[_0xe4a8('0x1f')](respondWithResult(_0x5002af,null))['catch'](handleError(_0x5002af,null));};exports[_0xe4a8('0x55')]=function(_0x4dc5bf,_0x522141){return db[_0xe4a8('0x3a')][_0xe4a8('0x55')](_0x4dc5bf[_0xe4a8('0x56')],{})[_0xe4a8('0x1f')](function(_0x4404d9){var _0x22a11b=_0x4dc5bf['user'][_0xe4a8('0x57')]({'plain':!![]});if(!_0x22a11b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22a11b[_0xe4a8('0x58')]===_0xe4a8('0x59')){var _0x2570e6=_0x4404d9[_0xe4a8('0x57')]({'plain':!![]});var _0xcd0bd2=_0xe4a8('0x5a');return db[_0xe4a8('0x5b')][_0xe4a8('0x5c')]({'where':{'name':_0xcd0bd2,'userProfileId':_0x22a11b[_0xe4a8('0x5d')]},'raw':!![]})['then'](function(_0x2283c3){if(_0x2283c3&&_0x2283c3[_0xe4a8('0x5e')]===0x0){return db[_0xe4a8('0x5f')][_0xe4a8('0x55')]({'name':_0x2570e6['name'],'resourceId':_0x2570e6['id'],'type':_0x2283c3[_0xe4a8('0x36')],'sectionId':_0x2283c3['id']},{})['then'](function(){return _0x4404d9;});}else{return _0x4404d9;}})[_0xe4a8('0x52')](function(_0x1c8a5a){logger[_0xe4a8('0x25')](_0xe4a8('0x60'),_0x1c8a5a);throw _0x1c8a5a;});}return _0x4404d9;})[_0xe4a8('0x1f')](respondWithResult(_0x522141,0xc9))['catch'](handleError(_0x522141,null));};exports[_0xe4a8('0x34')]=function(_0x5f55c8,_0x12498b){if(_0x5f55c8[_0xe4a8('0x56')]['id']){delete _0x5f55c8[_0xe4a8('0x56')]['id'];}return db[_0xe4a8('0x3a')][_0xe4a8('0x5c')]({'where':{'id':_0x5f55c8[_0xe4a8('0x53')]['id']},'include':[{'model':db[_0xe4a8('0x39')],'as':_0xe4a8('0x61')}]})[_0xe4a8('0x1f')](handleEntityNotFound(_0x12498b,null))[_0xe4a8('0x1f')](saveUpdates(_0x5f55c8[_0xe4a8('0x56')],null))[_0xe4a8('0x1f')](respondWithResult(_0x12498b,null))[_0xe4a8('0x52')](handleError(_0x12498b,null));};exports['destroy']=function(_0xe8317,_0x739c02){return db['WhatsappAccount'][_0xe4a8('0x5c')]({'where':{'id':_0xe8317[_0xe4a8('0x53')]['id']}})[_0xe4a8('0x1f')](handleEntityNotFound(_0x739c02,null))[_0xe4a8('0x1f')](removeEntity(_0x739c02,null))[_0xe4a8('0x52')](handleError(_0x739c02,null));};exports[_0xe4a8('0x62')]=function(_0x11c048,_0x34b021){return db['WhatsappAccount'][_0xe4a8('0x62')]()[_0xe4a8('0x1f')](respondWithResult(_0x34b021,null))[_0xe4a8('0x52')](handleError(_0x34b021,null));};exports['addDisposition']=function(_0x15aeff,_0x57a510,_0x1014fd){if(_0x15aeff['body']['id']){delete _0x15aeff[_0xe4a8('0x56')]['id'];}return db['WhatsappAccount'][_0xe4a8('0x5c')]({'where':{'id':_0x15aeff[_0xe4a8('0x53')]['id']}})[_0xe4a8('0x1f')](handleEntityNotFound(_0x57a510,null))['then'](function(_0x102b80){if(_0x102b80){_0x15aeff[_0xe4a8('0x56')][_0xe4a8('0x63')]=_0x102b80['id'];return db['Disposition'][_0xe4a8('0x55')](_0x15aeff[_0xe4a8('0x56')]);}})[_0xe4a8('0x1f')](respondWithResult(_0x57a510,null))[_0xe4a8('0x52')](handleError(_0x57a510,null));};exports['getDispositions']=function(_0x3d14f2,_0x288fed,_0x19fb79){var _0x5c8341={'raw':![],'where':{}};var _0x5cfe6d={};var _0x2aff9f={'count':0x0,'rows':[]};return db[_0xe4a8('0x3a')][_0xe4a8('0x64')]({'where':{'id':_0x3d14f2[_0xe4a8('0x53')]['id']}})[_0xe4a8('0x1f')](handleEntityNotFound(_0x288fed,null))[_0xe4a8('0x1f')](function(_0x337a00){if(_0x337a00){_0x5cfe6d[_0xe4a8('0x3d')]=_[_0xe4a8('0x3e')](db['Disposition'][_0xe4a8('0x54')]);_0x5cfe6d['query']=_[_0xe4a8('0x3e')](_0x3d14f2[_0xe4a8('0x41')]);_0x5cfe6d[_0xe4a8('0x3f')]=_[_0xe4a8('0x40')](_0x5cfe6d[_0xe4a8('0x3d')],_0x5cfe6d[_0xe4a8('0x41')]);_0x5c8341[_0xe4a8('0x43')]=_[_0xe4a8('0x40')](_0x5cfe6d[_0xe4a8('0x3d')],qs[_0xe4a8('0x42')](_0x3d14f2[_0xe4a8('0x41')][_0xe4a8('0x42')]));_0x5c8341[_0xe4a8('0x43')]=_0x5c8341[_0xe4a8('0x43')][_0xe4a8('0x44')]?_0x5c8341[_0xe4a8('0x43')]:_0x5cfe6d[_0xe4a8('0x3d')];if(!_0x3d14f2[_0xe4a8('0x41')][_0xe4a8('0x45')](_0xe4a8('0x46'))){_0x5c8341['limit']=qs[_0xe4a8('0x2f')](_0x3d14f2[_0xe4a8('0x41')][_0xe4a8('0x2f')]);_0x5c8341[_0xe4a8('0x2d')]=qs['offset'](_0x3d14f2['query']['offset']);}_0x5c8341[_0xe4a8('0x47')]=qs[_0xe4a8('0x48')](_0x3d14f2[_0xe4a8('0x41')][_0xe4a8('0x48')]);_0x5c8341[_0xe4a8('0x49')]=qs[_0xe4a8('0x3f')](_['pick'](_0x3d14f2['query'],_0x5cfe6d['filters']));_0x5c8341[_0xe4a8('0x49')]['WhatsappAccountId']=_0x337a00['id'];if(_0x3d14f2[_0xe4a8('0x41')][_0xe4a8('0x65')]){_0x5c8341['where']=_[_0xe4a8('0x4b')](_0x5c8341[_0xe4a8('0x49')],{'$or':_[_0xe4a8('0x4c')](_0x5c8341[_0xe4a8('0x43')],function(_0x2a82e9){var _0x10f0a5={};_0x10f0a5[_0x2a82e9]={'$like':'%'+_0x3d14f2[_0xe4a8('0x41')][_0xe4a8('0x65')]+'%'};return _0x10f0a5;})});}_0x5c8341=_['merge']({},_0x5c8341,_0x3d14f2[_0xe4a8('0x4e')]);return db[_0xe4a8('0x66')][_0xe4a8('0x30')]({'where':_0x5c8341[_0xe4a8('0x49')]})['then'](function(_0x3fe4f7){_0x2aff9f[_0xe4a8('0x30')]=_0x3fe4f7;if(_0x3d14f2['query'][_0xe4a8('0x4f')]){_0x5c8341[_0xe4a8('0x50')]=[{'all':!![]}];}return db[_0xe4a8('0x66')]['findAll'](_0x5c8341);})['then'](function(_0xa10d80){_0x2aff9f[_0xe4a8('0x67')]=_0xa10d80;return _0x2aff9f;});}})[_0xe4a8('0x1f')](respondWithFilteredResult(_0x288fed,_0x5c8341))[_0xe4a8('0x52')](handleError(_0x288fed,null));};exports['removeDispositions']=function(_0x457b3a,_0x7ca81e,_0x2a3e03){return db['WhatsappAccount'][_0xe4a8('0x5c')]({'where':{'id':_0x457b3a[_0xe4a8('0x53')]['id']}})[_0xe4a8('0x1f')](handleEntityNotFound(_0x7ca81e,null))['then'](function(_0x2a0777){if(_0x2a0777){return _0x2a0777[_0xe4a8('0x68')](_0x457b3a[_0xe4a8('0x41')][_0xe4a8('0x69')]);}})[_0xe4a8('0x1f')](respondWithStatusCode(_0x7ca81e,null))[_0xe4a8('0x52')](handleError(_0x7ca81e,null));};exports[_0xe4a8('0x6a')]=function(_0x2b05b5,_0x1743b0,_0x22dc0c){if(_0x2b05b5['body']['id']){delete _0x2b05b5[_0xe4a8('0x56')]['id'];}return db[_0xe4a8('0x3a')][_0xe4a8('0x5c')]({'where':{'id':_0x2b05b5[_0xe4a8('0x53')]['id']}})['then'](handleEntityNotFound(_0x1743b0,null))[_0xe4a8('0x1f')](function(_0x1d3410){if(_0x1d3410){_0x2b05b5[_0xe4a8('0x56')]['WhatsappAccountId']=_0x1d3410['id'];return db[_0xe4a8('0x6b')][_0xe4a8('0x55')](_0x2b05b5['body']);}})['then'](respondWithResult(_0x1743b0,null))[_0xe4a8('0x52')](handleError(_0x1743b0,null));};exports[_0xe4a8('0x6c')]=function(_0x350c22,_0xbb4bd6,_0x3012b5){var _0x19b3a2={'raw':![],'where':{}};var _0x1b9981={};var _0x52dcb6={'count':0x0,'rows':[]};return db[_0xe4a8('0x3a')]['findOne']({'where':{'id':_0x350c22[_0xe4a8('0x53')]['id']}})[_0xe4a8('0x1f')](handleEntityNotFound(_0xbb4bd6,null))[_0xe4a8('0x1f')](function(_0x55df67){if(_0x55df67){_0x1b9981[_0xe4a8('0x3d')]=_[_0xe4a8('0x3e')](db[_0xe4a8('0x6b')][_0xe4a8('0x54')]);_0x1b9981[_0xe4a8('0x41')]=_[_0xe4a8('0x3e')](_0x350c22[_0xe4a8('0x41')]);_0x1b9981[_0xe4a8('0x3f')]=_[_0xe4a8('0x40')](_0x1b9981['model'],_0x1b9981[_0xe4a8('0x41')]);_0x19b3a2['attributes']=_[_0xe4a8('0x40')](_0x1b9981['model'],qs[_0xe4a8('0x42')](_0x350c22[_0xe4a8('0x41')]['fields']));_0x19b3a2[_0xe4a8('0x43')]=_0x19b3a2[_0xe4a8('0x43')][_0xe4a8('0x44')]?_0x19b3a2[_0xe4a8('0x43')]:_0x1b9981[_0xe4a8('0x3d')];if(!_0x350c22[_0xe4a8('0x41')][_0xe4a8('0x45')](_0xe4a8('0x46'))){_0x19b3a2[_0xe4a8('0x2f')]=qs[_0xe4a8('0x2f')](_0x350c22[_0xe4a8('0x41')][_0xe4a8('0x2f')]);_0x19b3a2[_0xe4a8('0x2d')]=qs[_0xe4a8('0x2d')](_0x350c22[_0xe4a8('0x41')][_0xe4a8('0x2d')]);}_0x19b3a2['order']=qs[_0xe4a8('0x48')](_0x350c22[_0xe4a8('0x41')]['sort']);_0x19b3a2['where']=qs['filters'](_[_0xe4a8('0x4a')](_0x350c22[_0xe4a8('0x41')],_0x1b9981[_0xe4a8('0x3f')]));_0x19b3a2[_0xe4a8('0x49')][_0xe4a8('0x63')]=_0x55df67['id'];if(_0x350c22['query'][_0xe4a8('0x65')]){_0x19b3a2[_0xe4a8('0x49')]=_[_0xe4a8('0x4b')](_0x19b3a2[_0xe4a8('0x49')],{'$or':_[_0xe4a8('0x4c')](_0x19b3a2[_0xe4a8('0x43')],function(_0x4f1147){var _0x220385={};_0x220385[_0x4f1147]={'$like':'%'+_0x350c22['query'][_0xe4a8('0x65')]+'%'};return _0x220385;})});}_0x19b3a2=_[_0xe4a8('0x4b')]({},_0x19b3a2,_0x350c22[_0xe4a8('0x4e')]);return db[_0xe4a8('0x6b')][_0xe4a8('0x30')]({'where':_0x19b3a2[_0xe4a8('0x49')]})[_0xe4a8('0x1f')](function(_0x419abf){_0x52dcb6[_0xe4a8('0x30')]=_0x419abf;if(_0x350c22[_0xe4a8('0x41')][_0xe4a8('0x4f')]){_0x19b3a2[_0xe4a8('0x50')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe4a8('0x51')](_0x19b3a2);})[_0xe4a8('0x1f')](function(_0x9ec2c7){_0x52dcb6[_0xe4a8('0x67')]=_0x9ec2c7;return _0x52dcb6;});}})[_0xe4a8('0x1f')](respondWithFilteredResult(_0xbb4bd6,_0x19b3a2))[_0xe4a8('0x52')](handleError(_0xbb4bd6,null));};exports[_0xe4a8('0x6d')]=function(_0x546150,_0x1d0859,_0x113a4c){return db['WhatsappAccount'][_0xe4a8('0x5c')]({'where':{'id':_0x546150[_0xe4a8('0x53')]['id']}})[_0xe4a8('0x1f')](handleEntityNotFound(_0x1d0859,null))[_0xe4a8('0x1f')](function(_0x55d74c){if(_0x55d74c){return _0x55d74c[_0xe4a8('0x6d')](_0x546150[_0xe4a8('0x41')][_0xe4a8('0x69')]);}})[_0xe4a8('0x1f')](respondWithStatusCode(_0x1d0859,null))['catch'](handleError(_0x1d0859,null));};exports['addAgents']=function(_0x37db2f,_0x4402dd,_0x10e454){return db[_0xe4a8('0x3a')][_0xe4a8('0x5c')]({'where':{'id':_0x37db2f[_0xe4a8('0x53')]['id']}})[_0xe4a8('0x1f')](handleEntityNotFound(_0x4402dd,null))[_0xe4a8('0x1f')](function(_0x123efa){if(_0x123efa){return _0x123efa[_0xe4a8('0x6e')](_0x37db2f[_0xe4a8('0x56')]['ids'],_[_0xe4a8('0x6f')](_0x37db2f[_0xe4a8('0x56')],[_0xe4a8('0x69'),'id'])||{})['spread'](function(_0x26c051){for(var _0x3c1615=0x0;_0x3c1615<_0x37db2f['body'][_0xe4a8('0x69')]['length'];_0x3c1615+=0x1){socket[_0xe4a8('0x70')](_0xe4a8('0x71'),{'UserId':Number(_0x37db2f[_0xe4a8('0x56')][_0xe4a8('0x69')][_0x3c1615]),'WhatsappAccountId':Number(_0x37db2f['params']['id'])});}return _0x26c051;});}})[_0xe4a8('0x1f')](respondWithResult(_0x4402dd,null))[_0xe4a8('0x52')](handleError(_0x4402dd,null));};exports[_0xe4a8('0x72')]=function(_0x59e2be,_0x4ff50a,_0x3797ee){return db['WhatsappAccount'][_0xe4a8('0x5c')]({'where':{'id':_0x59e2be[_0xe4a8('0x53')]['id']}})[_0xe4a8('0x1f')](handleEntityNotFound(_0x4ff50a,null))[_0xe4a8('0x1f')](function(_0x5b2e94){if(_0x5b2e94){return _0x5b2e94['removeAgents'](_0x59e2be[_0xe4a8('0x41')]['ids'])['then'](function(){if(_[_0xe4a8('0x73')](_0x59e2be[_0xe4a8('0x41')]['ids'])){for(var _0x5d2248=0x0;_0x5d2248<_0x59e2be[_0xe4a8('0x41')][_0xe4a8('0x69')][_0xe4a8('0x44')];_0x5d2248+=0x1){socket[_0xe4a8('0x70')](_0xe4a8('0x74'),{'UserId':Number(_0x59e2be[_0xe4a8('0x41')][_0xe4a8('0x69')][_0x5d2248]),'WhatsappAccountId':Number(_0x59e2be[_0xe4a8('0x53')]['id'])});}}else{socket['emit'](_0xe4a8('0x74'),{'UserId':Number(_0x59e2be[_0xe4a8('0x41')]['ids']),'WhatsappAccountId':Number(_0x59e2be['params']['id'])});}});}})[_0xe4a8('0x1f')](respondWithStatusCode(_0x4ff50a,null))['catch'](handleError(_0x4ff50a,null));};exports[_0xe4a8('0x75')]=function(_0x2c2072,_0xb1cad8,_0x11e106){var _0x7f68a4={};var _0x3e292b={};var _0x5d4bd9;var _0x3c5355;return db['WhatsappAccount']['findOne']({'where':{'id':_0x2c2072[_0xe4a8('0x53')]['id']}})[_0xe4a8('0x1f')](handleEntityNotFound(_0xb1cad8,null))[_0xe4a8('0x1f')](function(_0x14d7c7){if(_0x14d7c7){_0x5d4bd9=_0x14d7c7;_0x3e292b['model']=_[_0xe4a8('0x3e')](db['User'][_0xe4a8('0x54')]);_0x3e292b['query']=_[_0xe4a8('0x3e')](_0x2c2072[_0xe4a8('0x41')]);_0x3e292b[_0xe4a8('0x3f')]=_[_0xe4a8('0x40')](_0x3e292b[_0xe4a8('0x3d')],_0x3e292b[_0xe4a8('0x41')]);_0x7f68a4[_0xe4a8('0x43')]=_[_0xe4a8('0x40')](_0x3e292b[_0xe4a8('0x3d')],qs[_0xe4a8('0x42')](_0x2c2072[_0xe4a8('0x41')][_0xe4a8('0x42')]));_0x7f68a4[_0xe4a8('0x43')]=_0x7f68a4[_0xe4a8('0x43')][_0xe4a8('0x44')]?_0x7f68a4['attributes']:_0x3e292b[_0xe4a8('0x3d')];_0x7f68a4[_0xe4a8('0x47')]=qs['sort'](_0x2c2072[_0xe4a8('0x41')][_0xe4a8('0x48')]);_0x7f68a4[_0xe4a8('0x49')]=qs[_0xe4a8('0x3f')](_[_0xe4a8('0x4a')](_0x2c2072[_0xe4a8('0x41')],_0x3e292b['filters']));if(_0x2c2072[_0xe4a8('0x41')][_0xe4a8('0x65')]){_0x7f68a4['where']=_[_0xe4a8('0x4b')](_0x7f68a4['where'],{'$or':_[_0xe4a8('0x4c')](_0x7f68a4[_0xe4a8('0x43')],function(_0x13fd47){var _0xc43900={};_0xc43900[_0x13fd47]={'$like':'%'+_0x2c2072[_0xe4a8('0x41')]['filter']+'%'};return _0xc43900;})});}_0x7f68a4=_[_0xe4a8('0x4b')]({},_0x7f68a4,_0x2c2072[_0xe4a8('0x4e')]);return _0x5d4bd9[_0xe4a8('0x75')](_0x7f68a4);}})[_0xe4a8('0x1f')](function(_0x1d8531){if(_0x1d8531){_0x3c5355=_0x1d8531[_0xe4a8('0x44')];if(!_0x2c2072[_0xe4a8('0x41')][_0xe4a8('0x45')](_0xe4a8('0x46'))){_0x7f68a4[_0xe4a8('0x2f')]=qs[_0xe4a8('0x2f')](_0x2c2072['query'][_0xe4a8('0x2f')]);_0x7f68a4[_0xe4a8('0x2d')]=qs[_0xe4a8('0x2d')](_0x2c2072[_0xe4a8('0x41')][_0xe4a8('0x2d')]);}return _0x5d4bd9[_0xe4a8('0x75')](_0x7f68a4);}})[_0xe4a8('0x1f')](function(_0x4e94c1){if(_0x4e94c1){return _0x4e94c1?{'count':_0x3c5355,'rows':_0x4e94c1}:null;}})['then'](respondWithResult(_0xb1cad8,null))[_0xe4a8('0x52')](handleError(_0xb1cad8,null));};exports[_0xe4a8('0x76')]=function(_0x44ae9a,_0x4e3149){var _0x21f860=_0x44ae9a[_0xe4a8('0x53')]['id'];var _0x321f82=_0x44ae9a[_0xe4a8('0x56')];var _0x540d97=0xc8;var _0x39381a=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xe4a8('0x77')]['Transaction'][_0xe4a8('0x78')][_0xe4a8('0x79')]},function(_0x5e829c){return db[_0xe4a8('0x3a')][_0xe4a8('0x64')]({'where':{'id':_0x21f860},'transaction':_0x5e829c})[_0xe4a8('0x1f')](function(_0x1f0869){if(_0x1f0869){return db['WhatsappApplication'][_0xe4a8('0x35')]({'where':{'WhatsappAccountId':_0x21f860},'transaction':_0x5e829c})[_0xe4a8('0x1f')](function(){var _0x24d279=_[_0xe4a8('0x4c')](_0x321f82,function(_0x2ca102){_0x2ca102[_0xe4a8('0x63')]=_0x21f860;return _0x2ca102;});return db[_0xe4a8('0x7a')][_0xe4a8('0x7b')](_0x24d279,{'transaction':_0x5e829c});});}else{_0x540d97=0x194;_0x39381a=[];}});})[_0xe4a8('0x1f')](function(){if(_0x540d97!==0x194){return db[_0xe4a8('0x7a')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x21f860},'order':_0xe4a8('0x7c')})[_0xe4a8('0x1f')](function(_0x2973c0){_0x39381a=_0x2973c0;});}})['catch'](function(_0xdc7947){_0x540d97=0x1f4;logger['error'](_0xdc7947[_0xe4a8('0x7d')]);if(_0xdc7947['name']){delete _0xdc7947['name'];}_0x39381a=_0xdc7947;})['finally'](function(){if(_0x39381a===null){_0x4e3149['sendStatus'](_0x540d97);}else{if(_0x540d97===0x1f4){_0x4e3149[_0xe4a8('0x2a')](_0x540d97)[_0xe4a8('0x37')](_0x39381a);}else{_0x4e3149[_0xe4a8('0x2a')](_0x540d97)[_0xe4a8('0x2c')](_0x39381a);}}});};exports[_0xe4a8('0x7e')]=function(_0x106156,_0x58822c,_0x134adc){var _0x27d1ef={};var _0x46bf87={};var _0x556373;var _0x3d27ea;return db[_0xe4a8('0x3a')][_0xe4a8('0x64')]({'where':{'id':_0x106156[_0xe4a8('0x53')]['id']}})[_0xe4a8('0x1f')](handleEntityNotFound(_0x58822c,null))[_0xe4a8('0x1f')](function(_0x657bc2){if(_0x657bc2){_0x556373=_0x657bc2;_0x46bf87[_0xe4a8('0x3d')]=_[_0xe4a8('0x3e')](db[_0xe4a8('0x7a')][_0xe4a8('0x54')]);_0x46bf87[_0xe4a8('0x41')]=_[_0xe4a8('0x3e')](_0x106156[_0xe4a8('0x41')]);_0x46bf87[_0xe4a8('0x3f')]=_[_0xe4a8('0x40')](_0x46bf87[_0xe4a8('0x3d')],_0x46bf87[_0xe4a8('0x41')]);_0x27d1ef[_0xe4a8('0x43')]=_[_0xe4a8('0x40')](_0x46bf87['model'],qs[_0xe4a8('0x42')](_0x106156[_0xe4a8('0x41')]['fields']));_0x27d1ef[_0xe4a8('0x43')]=_0x27d1ef[_0xe4a8('0x43')]['length']?_0x27d1ef[_0xe4a8('0x43')]:_0x46bf87['model'];_0x27d1ef['order']=qs[_0xe4a8('0x48')](_0x106156[_0xe4a8('0x41')][_0xe4a8('0x48')]);_0x27d1ef['where']=qs['filters'](_[_0xe4a8('0x4a')](_0x106156[_0xe4a8('0x41')],_0x46bf87[_0xe4a8('0x3f')]));if(_0x106156[_0xe4a8('0x41')][_0xe4a8('0x65')]){_0x27d1ef[_0xe4a8('0x49')]=_['merge'](_0x27d1ef['where'],{'$or':_['map'](_0x27d1ef[_0xe4a8('0x43')],function(_0x107fa7){var _0x498b67={};_0x498b67[_0x107fa7]={'$like':'%'+_0x106156[_0xe4a8('0x41')]['filter']+'%'};return _0x498b67;})});}_0x27d1ef=_[_0xe4a8('0x4b')]({},_0x27d1ef,_0x106156[_0xe4a8('0x4e')]);return _0x556373[_0xe4a8('0x7e')](_0x27d1ef);}})['then'](function(_0x3122bf){if(_0x3122bf){_0x3d27ea=_0x3122bf[_0xe4a8('0x44')];if(!_0x106156[_0xe4a8('0x41')][_0xe4a8('0x45')](_0xe4a8('0x46'))){_0x27d1ef[_0xe4a8('0x2f')]=qs['limit'](_0x106156['query']['limit']);_0x27d1ef[_0xe4a8('0x2d')]=qs[_0xe4a8('0x2d')](_0x106156[_0xe4a8('0x41')][_0xe4a8('0x2d')]);}return _0x556373['getApplications'](_0x27d1ef);}})[_0xe4a8('0x1f')](function(_0x980b0d){if(_0x980b0d){return _0x980b0d?{'count':_0x3d27ea,'rows':_0x980b0d}:null;}})[_0xe4a8('0x1f')](respondWithResult(_0x58822c,null))[_0xe4a8('0x52')](handleError(_0x58822c,null));};exports['notify']=function(_0x3453fa,_0x1548ab,_0x35a99c){var _0x2d8868={'channel':_0xe4a8('0x7f')};var _0x518ee3=[];var _0x32bcee=[];var _0x1df2ae={};return db[_0xe4a8('0x3a')][_0xe4a8('0x5c')]({'where':{'id':_0x3453fa[_0xe4a8('0x53')]['id']},'include':[{'model':db[_0xe4a8('0x7a')],'as':_0xe4a8('0x80')}]})[_0xe4a8('0x1f')](handleEntityNotFound(_0x1548ab,null))['then'](function(_0x1b7af7){_0x2d8868[_0xe4a8('0x81')]=_0x1b7af7;if(_0x2d8868[_0xe4a8('0x81')]&&_0x2d8868['account'][_0xe4a8('0x3c')]===_0xe4a8('0x82')&&_0x3453fa[_0xe4a8('0x56')][_0xe4a8('0x83')]){if(_0x3453fa['body'][_0xe4a8('0x83')]['length']===0x0)return;if(_0x3453fa['body'][_0xe4a8('0x83')][0x0][_0xe4a8('0x84')]!==_0xe4a8('0x85'))return;return db[_0xe4a8('0x86')][_0xe4a8('0x34')]({'read':!![],'readAt':_0x3453fa[_0xe4a8('0x56')][_0xe4a8('0x83')][0x0][_0xe4a8('0x87')]},{'where':{'messageId':_0x3453fa[_0xe4a8('0x56')][_0xe4a8('0x83')][0x0][_0xe4a8('0x88')]},'individualHooks':!![]})[_0xe4a8('0x1f')](function(_0x4d4dde){return _0x1548ab[_0xe4a8('0x2a')](0xc8)[_0xe4a8('0x2c')](_0x4d4dde);});}_0x2d8868[_0xe4a8('0x89')]=_[_0xe4a8('0x8a')](_0x1b7af7['Applications'],[_0xe4a8('0x7c')],[_0xe4a8('0x8b')]);if(_0x2d8868[_0xe4a8('0x81')]['Applications']){delete _0x2d8868['account'][_0xe4a8('0x80')];}return db[_0xe4a8('0x8c')]['describe']()['then'](function(_0x5ca154){if(!_0x5ca154){throw new db[(_0xe4a8('0x8d'))][(_0xe4a8('0x8e'))]('no\x20available\x20attributes');}_0x518ee3=_['difference'](_[_0xe4a8('0x3e')](_0x5ca154),[_0xe4a8('0x8f'),_0xe4a8('0x90')]);_0x32bcee=_[_0xe4a8('0x91')](_[_0xe4a8('0x3e')](_0x5ca154),[_0xe4a8('0x8f'),_0xe4a8('0x90'),_0xe4a8('0x92'),_0xe4a8('0x93')]);_0x2d8868[_0xe4a8('0x56')]={'mapKey':_0xe4a8('0x94')};if(_0x2d8868[_0xe4a8('0x81')]&&_0x2d8868['account'][_0xe4a8('0x3c')]===_0xe4a8('0x95')){_0x2d8868['body'][_0xe4a8('0x96')]=_0x3453fa['body']['From'][_0xe4a8('0x97')](_0xe4a8('0x98'),'');_0x2d8868[_0xe4a8('0x56')][_0xe4a8('0x56')]=_0x3453fa[_0xe4a8('0x56')][_0xe4a8('0x99')];_0x2d8868[_0xe4a8('0x56')][_0xe4a8('0x9a')]=_0x3453fa[_0xe4a8('0x56')][_0xe4a8('0x9b')];}if(_0x2d8868[_0xe4a8('0x81')]&&_0x2d8868[_0xe4a8('0x81')]['type']===_0xe4a8('0x82')){_0x2d8868[_0xe4a8('0x56')][_0xe4a8('0x96')]=_0x3453fa[_0xe4a8('0x56')][_0xe4a8('0x9c')][0x0]['from'];_0x2d8868[_0xe4a8('0x56')]['body']=_0x3453fa[_0xe4a8('0x56')]['notifications'][0x0][_0xe4a8('0x27')][_0xe4a8('0x56')];_0x2d8868[_0xe4a8('0x56')][_0xe4a8('0x9a')]=_0x3453fa[_0xe4a8('0x56')][_0xe4a8('0x9c')][0x0][_0xe4a8('0x88')];}if(_0x2d8868['body']['id']){delete _0x2d8868[_0xe4a8('0x56')]['id'];}if(_[_0xe4a8('0x9d')](_0x2d8868['body'][_0xe4a8('0x96')])){throw new db[(_0xe4a8('0x8d'))][(_0xe4a8('0x8e'))](_0xe4a8('0x9e'));}if(_[_0xe4a8('0x9d')](_0x2d8868[_0xe4a8('0x56')][_0xe4a8('0x56')])||_0x2d8868['body'][_0xe4a8('0x56')]===''){throw new db[(_0xe4a8('0x8d'))][(_0xe4a8('0x8e'))](_0xe4a8('0x9f'));}if(_[_0xe4a8('0x9d')](_0x2d8868[_0xe4a8('0x56')][_0xe4a8('0xa0')])){throw new db[(_0xe4a8('0x8d'))]['ValidationError'](_0xe4a8('0xa1')+_0x32bcee);}if(!_[_0xe4a8('0xa2')](_0x32bcee,_0x2d8868[_0xe4a8('0x56')]['mapKey'])){throw new db[(_0xe4a8('0x8d'))][(_0xe4a8('0x8e'))](_0xe4a8('0xa3')+_0x32bcee);}_0x1df2ae[_0x2d8868[_0xe4a8('0x56')][_0xe4a8('0xa0')]]=_0x2d8868[_0xe4a8('0x56')]['from'];return db['CmList'][_0xe4a8('0x5c')]({'where':{'id':_0x2d8868[_0xe4a8('0x81')][_0xe4a8('0x93')]},'include':[{'model':db[_0xe4a8('0x8c')],'as':'Contacts','where':_0x1df2ae,'limit':0x1,'order':[[_0xe4a8('0x90'),_0xe4a8('0xa4')]]}]});})[_0xe4a8('0x1f')](handleEntityNotFound(_0x1548ab,null))[_0xe4a8('0x1f')](function(_0x44844d){if(_0x44844d){_0x2d8868['list']=_[_0xe4a8('0x6f')](_0x44844d,[_0xe4a8('0xa5')]);if(_0x44844d[_0xe4a8('0xa5')][_0xe4a8('0x44')]){return _0x44844d['Contacts'][0x0];}var _0x2f5120=_[_0xe4a8('0x16')](_0x2d8868[_0xe4a8('0x56')],{'firstName':_0x2d8868['body'][_0xe4a8('0x96')],'ListId':_0x44844d['id']});_0x2f5120[_0x2d8868[_0xe4a8('0x56')][_0xe4a8('0xa0')]]=_0x2d8868['body']['from'];return db[_0xe4a8('0x8c')][_0xe4a8('0x55')](_0x2f5120,{'fields':_0x518ee3,'raw':!![]});}})[_0xe4a8('0x1f')](handleEntityNotFound(_0x1548ab,null))[_0xe4a8('0x1f')](function(_0x3f0939){if(_0x3f0939){_0x2d8868[_0xe4a8('0xa6')]=_0x3f0939;var _0x3aa44a={'ContactId':_0x3f0939['id'],'phone':_0x2d8868[_0xe4a8('0x56')][_0xe4a8('0x96')],'WhatsappAccountId':_0x3453fa[_0xe4a8('0x53')]['id']};var _0x1b0f22={'ContactId':_0x3f0939['id'],'WhatsappAccountId':_0x3453fa[_0xe4a8('0x53')]['id'],'closed':![]};return db[_0xe4a8('0xa7')]['find']({'where':_0x1b0f22})[_0xe4a8('0x1f')](function(_0x5e8272){if(_0x5e8272){return[_0x5e8272,![]];}return db['WhatsappInteraction'][_0xe4a8('0x55')](_0x3aa44a)[_0xe4a8('0x1f')](function(_0xa359aa){return[_0xa359aa,!![]];});});}})[_0xe4a8('0xa8')](function(_0x2ca2b0,_0x5567fb){_0x2d8868[_0xe4a8('0xa9')]=_0x2ca2b0['get']({'plain':!![]});_0x2d8868[_0xe4a8('0xa9')][_0xe4a8('0xaa')]=![];if(_0x5567fb){if(_0x2d8868[_0xe4a8('0x81')][_0xe4a8('0xab')]){_0x2d8868[_0xe4a8('0x89')][_0xe4a8('0xac')]({'id':0x0,'priority':_0x2d8868[_0xe4a8('0x89')][_0xe4a8('0x44')]+0x1,'app':'close','appdata':_0xe4a8('0xad'),'interval':_0xe4a8('0xae')});}_0x2d8868[_0xe4a8('0xa9')]['created']=!![];}return db['WhatsappMessage'][_0xe4a8('0x55')]({'phone':_0x2d8868[_0xe4a8('0x56')][_0xe4a8('0x96')],'messageId':_0x2d8868[_0xe4a8('0x56')]['messageId'],'body':_0x2d8868['body']['body'],'WhatsappAccountId':_0x3453fa[_0xe4a8('0x53')]['id'],'WhatsappInteractionId':_0x2ca2b0['id'],'direction':'in','ContactId':_0x2ca2b0[_0xe4a8('0xaf')],'AttachmentId':_0x2d8868['body']['AttachmentId']});})['then'](function(_0x555c){_0x2d8868[_0xe4a8('0x27')]=_0x555c;if(!_0x2d8868[_0xe4a8('0xa9')][_0xe4a8('0xb0')])return;return db[_0xe4a8('0xb1')][_0xe4a8('0x5c')]({'attributes':['id',_0xe4a8('0x36')],'where':{'id':_0x2d8868[_0xe4a8('0xa9')][_0xe4a8('0xb0')]}});})[_0xe4a8('0x1f')](function(_0x1c9bd8){if(_0x1c9bd8){_0x2d8868[_0xe4a8('0x89')][_0xe4a8('0xb2')]({'id':0x0,'priority':0x0,'app':_0xe4a8('0xb3'),'appdata':_0x1c9bd8[_0xe4a8('0x36')]+','+(_0x2d8868['account'][_0xe4a8('0xb4')]||0xa),'interval':'*,*,*,*'});}if(!_0x2d8868[_0xe4a8('0xa9')][_0xe4a8('0xb5')])return;return db[_0xe4a8('0xb6')][_0xe4a8('0x5c')]({'attributes':['id','name'],'where':{'id':_0x2d8868[_0xe4a8('0xa9')]['queueId']}});})['then'](function(_0xd22aee){if(_0xd22aee){_0x2d8868[_0xe4a8('0x89')][_0xe4a8('0xb2')]({'id':0x0,'priority':0x1,'app':_0xe4a8('0xb7'),'appdata':_0xd22aee[_0xe4a8('0x36')]+','+(_0x2d8868[_0xe4a8('0x81')][_0xe4a8('0xb8')]||0x12c),'interval':_0xe4a8('0xae')});}return respondWithRpcPromise(_0xe4a8('0xb9'),_0xe4a8('0xba'),_0x2d8868);})['then'](function(_0x2ab10b){if(_0x2ab10b){var _0x532e9f=0xc8;var _0x4d1796='receiveMessage';logger[_0xe4a8('0x20')](_0xe4a8('0xbb'),_0x4d1796,_0x532e9f,'entity\x20found');logger[_0xe4a8('0x23')](_0xe4a8('0xbc'),_0x4d1796,_0x532e9f,_0xe4a8('0xbd'),JSON['stringify'](_0x2ab10b));if(_0x2d8868[_0xe4a8('0x81')][_0xe4a8('0x3c')]===_0xe4a8('0x95')){return _0x1548ab[_0xe4a8('0x2a')](_0x532e9f)[_0xe4a8('0x31')](_0xe4a8('0xbe'),_0xe4a8('0xbf'))['send'](_0xe4a8('0xc0'));}else{return _0x1548ab[_0xe4a8('0x2a')](_0x532e9f)[_0xe4a8('0x2c')](_0x2ab10b);}}});})[_0xe4a8('0x52')](handleError(_0x1548ab,null));};exports[_0xe4a8('0x37')]=function(_0x113d2e,_0x79e4af,_0x58de4f){var _0x466c5c,_0x648dea,_0x14b84c;if(_[_0xe4a8('0x9d')](_0x113d2e[_0xe4a8('0x56')][_0xe4a8('0x56')])||_0x113d2e[_0xe4a8('0x56')][_0xe4a8('0x56')]===''){throw new db[(_0xe4a8('0x8d'))][(_0xe4a8('0x8e'))](_0xe4a8('0x9f'));}if(_['isNil'](_0x113d2e[_0xe4a8('0x56')]['to'])){throw new db[(_0xe4a8('0x8d'))][(_0xe4a8('0x8e'))]('to\x20is\x20mandatory');}_0x466c5c=_0x113d2e['body']['to'];return db[_0xe4a8('0x3a')][_0xe4a8('0x5c')]({'where':{'id':_0x113d2e['params']['id']},'include':[{'model':db[_0xe4a8('0xc1')],'as':'List','include':[{'model':db[_0xe4a8('0x8c')],'as':_0xe4a8('0xa5'),'where':{'mobile':_0x466c5c},'limit':0x1,'order':[['updatedAt',_0xe4a8('0xa4')]]}]}]})[_0xe4a8('0x1f')](handleEntityNotFound(_0x79e4af,null))[_0xe4a8('0x1f')](function(_0x5e6ecf){if(_0x5e6ecf&&_0x5e6ecf[_0xe4a8('0xc2')]){_0x648dea=_0x5e6ecf['get']({'plain':!![]});if(_0x648dea[_0xe4a8('0xc2')]&&_0x648dea['List'][_0xe4a8('0xa5')]['length']){return _0x648dea[_0xe4a8('0xc2')][_0xe4a8('0xa5')][0x0];}return db['CmContact'][_0xe4a8('0x55')](_[_0xe4a8('0x16')](_0x113d2e['body'],{'firstName':_0x466c5c,'mobile':_0x466c5c,'phone':_0x466c5c,'ListId':_0x648dea[_0xe4a8('0x93')]}));}})[_0xe4a8('0x1f')](handleEntityNotFound(_0x79e4af,null))[_0xe4a8('0x1f')](function(_0x2e809a){if(_0x2e809a){_0x14b84c=_0x2e809a;return db[_0xe4a8('0xa7')]['find']({'where':{'ContactId':_0x14b84c['id'],'closed':![],'WhatsappAccountId':_0x648dea['id']}})[_0xe4a8('0x1f')](function(_0x3a0ad9){if(_0x3a0ad9){return[_0x3a0ad9,![]];}return db[_0xe4a8('0xa7')]['create']({'UserId':_0x113d2e[_0xe4a8('0x59')]['id'],'ContactId':_0x14b84c['id'],'WhatsappAccountId':_0x648dea['id'],'phone':_0x466c5c,'firstMsgDirection':_0xe4a8('0xc3'),'Messages':[_[_0xe4a8('0x4b')](_0x113d2e[_0xe4a8('0x56')],{'read':![],'body':_0x113d2e[_0xe4a8('0x56')][_0xe4a8('0x56')],'phone':_0x466c5c,'WhatsappAccountId':_0x648dea['id'],'UserId':_0x113d2e['user']['id'],'ContactId':_0x14b84c['id']})]},{'include':[{'model':db[_0xe4a8('0x86')],'as':'Messages'}]})[_0xe4a8('0x1f')](function(_0x324e64){return[_0x324e64,!![]];});});}})[_0xe4a8('0xa8')](function(_0x133e56,_0xf25d83){if(_0xf25d83){return _0x133e56;}return db['WhatsappMessage'][_0xe4a8('0x55')](_[_0xe4a8('0x4b')](_0x113d2e['body'],{'read':![],'body':_0x113d2e[_0xe4a8('0x56')][_0xe4a8('0x56')],'phone':_0x466c5c,'WhatsappAccountId':_0x648dea['id'],'WhatsappInteractionId':_0x133e56['id'],'UserId':_0x113d2e[_0xe4a8('0x59')]['id'],'ContactId':_0x14b84c['id']}))[_0xe4a8('0x1f')](function(_0x2c9077){_0x133e56[_0xe4a8('0xc4')][_0xe4a8('0xc5')]=[];_0x133e56[_0xe4a8('0xc4')][_0xe4a8('0xc5')][_0xe4a8('0xac')](_0x2c9077[_0xe4a8('0xc4')]);return _0x133e56;});})[_0xe4a8('0x1f')](respondWithResult(_0x79e4af,null))[_0xe4a8('0x52')](handleError(_0x79e4af,null));}; \ No newline at end of file +var _0xccc2=['http','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','then','WhatsappAccounts','UserProfileResource','end','name','send','index','Pause','WhatsappAccount','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','mandatoryDispositionPause','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','map','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','addAgents','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','WhatsappApplication','findAndCountAll','priority','stack','finally','getApplications','notify','account','sinch','statuses','state','WhatsappMessage','message_id','applications','orderBy','asc','Applications','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','from','From','Body','messageId','MessageSid','notifications','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','CmList','Contacts','list','omit','contact','WhatsappInteraction','interaction','created','close','unmanaged','*,*,*,*','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','queueId','WhatsappQueue','queue','Start','startRouting','entity\x20found','twilio','text/xml','\x0a','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','push','eml-format','fast-json-patch','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xccc2,0xa2));var _0x2ccc=function(_0x4642e0,_0x1e350c){_0x4642e0=_0x4642e0-0x0;var _0x1f4f11=_0xccc2[_0x4642e0];return _0x1f4f11;};'use strict';var emlformat=require(_0x2ccc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2ccc('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2ccc('0x2'));var Mustache=require('mustache');var util=require(_0x2ccc('0x3'));var path=require('path');var sox=require(_0x2ccc('0x4'));var csv=require(_0x2ccc('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ccc('0x6'));var _=require(_0x2ccc('0x7'));var squel=require(_0x2ccc('0x8'));var crypto=require(_0x2ccc('0x9'));var jsforce=require(_0x2ccc('0xa'));var deskjs=require(_0x2ccc('0xb'));var toCsv=require(_0x2ccc('0x5'));var querystring=require(_0x2ccc('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2ccc('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x2ccc('0xe'));var hardwareService=require(_0x2ccc('0xf'));var logger=require(_0x2ccc('0x10'))(_0x2ccc('0x11'));var utils=require(_0x2ccc('0x12'));var config=require(_0x2ccc('0x13'));var licenseUtil=require(_0x2ccc('0x14'));var db=require(_0x2ccc('0x15'))['db'];config[_0x2ccc('0x16')]=_[_0x2ccc('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2ccc('0x18'))(new Redis(config[_0x2ccc('0x16')]));require(_0x2ccc('0x19'))[_0x2ccc('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x2ccc('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0xdcf4fb,_0x590ce9,_0x413e48,_0x32359c){return new BPromise(function(_0x57ed8e,_0x3b654e){var _0x2810de=_0x32359c||client;return _0x2810de['request'](_0xdcf4fb,_0x413e48)['then'](function(_0x45bbb6){logger['info'](_0x2ccc('0x1c'),_0x590ce9,'request\x20sent');logger[_0x2ccc('0x1d')](_0x2ccc('0x1e'),_0x590ce9,_0x2ccc('0x1f'),JSON[_0x2ccc('0x20')](_0x45bbb6));if(_0x45bbb6['error']){if(_0x45bbb6[_0x2ccc('0x21')][_0x2ccc('0x22')]===0x1f4){logger[_0x2ccc('0x21')]('WhatsappAccount,\x20%s,\x20%s',_0x590ce9,_0x45bbb6[_0x2ccc('0x21')][_0x2ccc('0x23')]);return _0x3b654e(_0x45bbb6[_0x2ccc('0x21')]['message']);}logger['error'](_0x2ccc('0x1c'),_0x590ce9,_0x45bbb6['error'][_0x2ccc('0x23')]);return _0x57ed8e(_0x45bbb6['error']['message']);}else{logger[_0x2ccc('0x24')](_0x2ccc('0x1c'),_0x590ce9,'request\x20sent');_0x57ed8e(_0x45bbb6[_0x2ccc('0x25')][_0x2ccc('0x23')]);}})['catch'](function(_0x546be0){logger[_0x2ccc('0x21')]('WhatsappAccount,\x20%s,\x20%s',_0x590ce9,_0x546be0);_0x3b654e(_0x546be0);});});}function respondWithStatusCode(_0x486b5d,_0x4b9f0e){_0x4b9f0e=_0x4b9f0e||0xcc;return function(_0x1f72e1){if(_0x1f72e1){return _0x486b5d[_0x2ccc('0x26')](_0x4b9f0e);}return _0x486b5d[_0x2ccc('0x27')](_0x4b9f0e)['end']();};}function respondWithResult(_0x22307e,_0xdf99cf){_0xdf99cf=_0xdf99cf||0xc8;return function(_0x118b31){if(_0x118b31){return _0x22307e['status'](_0xdf99cf)['json'](_0x118b31);}};}function respondWithFilteredResult(_0x400640,_0x2837ea){return function(_0x2571d2){if(_0x2571d2){var _0x5acf4a=typeof _0x2837ea[_0x2ccc('0x28')]===_0x2ccc('0x29')&&typeof _0x2837ea[_0x2ccc('0x2a')]==='undefined';var _0x39c327=_0x2571d2[_0x2ccc('0x2b')];var _0x16fc2d=_0x5acf4a?0x0:_0x2837ea[_0x2ccc('0x28')];var _0x3c0cdb=_0x5acf4a?_0x2571d2['count']:_0x2837ea['offset']+_0x2837ea[_0x2ccc('0x2a')];var _0x4d84b6;if(_0x3c0cdb>=_0x39c327){_0x3c0cdb=_0x39c327;_0x4d84b6=0xc8;}else{_0x4d84b6=0xce;}_0x400640[_0x2ccc('0x27')](_0x4d84b6);return _0x400640[_0x2ccc('0x2c')](_0x2ccc('0x2d'),_0x16fc2d+'-'+_0x3c0cdb+'/'+_0x39c327)[_0x2ccc('0x2e')](_0x2571d2);}return null;};}function patchUpdates(_0xb9d696){return function(_0xa35f6){try{jsonpatch['apply'](_0xa35f6,_0xb9d696,!![]);}catch(_0x275258){return BPromise['reject'](_0x275258);}return _0xa35f6[_0x2ccc('0x2f')]();};}function saveUpdates(_0x582cc7,_0xc4028c){return function(_0x133adb){if(_0x133adb){return _0x133adb[_0x2ccc('0x30')](_0x582cc7)['then'](function(_0x19cc33){return _0x19cc33;});}return null;};}function removeEntity(_0x3860ec,_0x45581b){return function(_0x2f3b0f){if(_0x2f3b0f){return _0x2f3b0f[_0x2ccc('0x31')]()[_0x2ccc('0x32')](function(){var _0x1efe44=_0x2f3b0f['get']({'plain':!![]});var _0x225cb9=_0x2ccc('0x33');return db[_0x2ccc('0x34')]['destroy']({'where':{'type':_0x225cb9,'resourceId':_0x1efe44['id']}})['then'](function(){return _0x2f3b0f;});})[_0x2ccc('0x32')](function(){_0x3860ec[_0x2ccc('0x27')](0xcc)[_0x2ccc('0x35')]();});}};}function handleEntityNotFound(_0x446122,_0x28d88c){return function(_0x27acee){if(!_0x27acee){_0x446122['sendStatus'](0x194);}return _0x27acee;};}function handleError(_0x59b76c,_0x43f58b){_0x43f58b=_0x43f58b||0x1f4;return function(_0x54285c){logger[_0x2ccc('0x21')](_0x54285c['stack']);if(_0x54285c[_0x2ccc('0x36')]){delete _0x54285c['name'];}_0x59b76c[_0x2ccc('0x27')](_0x43f58b)[_0x2ccc('0x37')](_0x54285c);};}exports[_0x2ccc('0x38')]=function(_0x42c758,_0x3e9953){var _0x3e4b51={'include':[{'model':db[_0x2ccc('0x39')],'as':'mandatoryDispositionPause'}]},_0x54f2cb={},_0xfba141={'count':0x0,'rows':[]};var _0x57ddb4=_['map'](db[_0x2ccc('0x3a')][_0x2ccc('0x3b')],function(_0x1ba643){return{'name':_0x1ba643['fieldName'],'type':_0x1ba643[_0x2ccc('0x3c')]['key']};});_0x54f2cb[_0x2ccc('0x3d')]=_['map'](_0x57ddb4,'name');_0x54f2cb['query']=_[_0x2ccc('0x3e')](_0x42c758[_0x2ccc('0x3f')]);_0x54f2cb[_0x2ccc('0x40')]=_[_0x2ccc('0x41')](_0x54f2cb[_0x2ccc('0x3d')],_0x54f2cb[_0x2ccc('0x3f')]);_0x3e4b51[_0x2ccc('0x42')]=_[_0x2ccc('0x41')](_0x54f2cb[_0x2ccc('0x3d')],qs[_0x2ccc('0x43')](_0x42c758[_0x2ccc('0x3f')][_0x2ccc('0x43')]));_0x3e4b51['attributes']=_0x3e4b51[_0x2ccc('0x42')][_0x2ccc('0x44')]?_0x3e4b51[_0x2ccc('0x42')]:_0x54f2cb['model'];if(!_0x42c758[_0x2ccc('0x3f')][_0x2ccc('0x45')](_0x2ccc('0x46'))){_0x3e4b51[_0x2ccc('0x2a')]=qs['limit'](_0x42c758[_0x2ccc('0x3f')][_0x2ccc('0x2a')]);_0x3e4b51[_0x2ccc('0x28')]=qs[_0x2ccc('0x28')](_0x42c758[_0x2ccc('0x3f')]['offset']);}_0x3e4b51[_0x2ccc('0x47')]=qs[_0x2ccc('0x48')](_0x42c758[_0x2ccc('0x3f')][_0x2ccc('0x48')]);_0x3e4b51[_0x2ccc('0x49')]=qs[_0x2ccc('0x40')](_[_0x2ccc('0x4a')](_0x42c758[_0x2ccc('0x3f')],_0x54f2cb[_0x2ccc('0x40')]),_0x57ddb4);if(_0x42c758[_0x2ccc('0x3f')][_0x2ccc('0x4b')]){_0x3e4b51[_0x2ccc('0x49')]=_[_0x2ccc('0x4c')](_0x3e4b51[_0x2ccc('0x49')],{'$or':_['map'](_0x57ddb4,function(_0x2960ae){if(_0x2960ae['type']!==_0x2ccc('0x4d')){var _0x6d2cb3={};_0x6d2cb3[_0x2960ae[_0x2ccc('0x36')]]={'$like':'%'+_0x42c758[_0x2ccc('0x3f')][_0x2ccc('0x4b')]+'%'};return _0x6d2cb3;}})});}_0x3e4b51=_[_0x2ccc('0x4c')]({},_0x3e4b51,_0x42c758[_0x2ccc('0x4e')]);var _0x508010={'where':_0x3e4b51[_0x2ccc('0x49')]};return db[_0x2ccc('0x3a')][_0x2ccc('0x2b')](_0x508010)[_0x2ccc('0x32')](function(_0x496980){_0xfba141[_0x2ccc('0x2b')]=_0x496980;if(_0x42c758['query'][_0x2ccc('0x4f')]){_0x3e4b51[_0x2ccc('0x50')]=[{'all':!![]}];}return db[_0x2ccc('0x3a')][_0x2ccc('0x51')](_0x3e4b51);})[_0x2ccc('0x32')](function(_0x2807cc){_0xfba141[_0x2ccc('0x52')]=_0x2807cc;return _0xfba141;})['then'](respondWithFilteredResult(_0x3e9953,_0x3e4b51))['catch'](handleError(_0x3e9953,null));};exports[_0x2ccc('0x53')]=function(_0x448ecf,_0x27dcb3){var _0x2b8e46={'raw':![],'where':{'id':_0x448ecf['params']['id']},'include':[{'model':db['Pause'],'as':_0x2ccc('0x54')}]},_0x28563d={};_0x28563d[_0x2ccc('0x3d')]=_['keys'](db['WhatsappAccount']['rawAttributes']);_0x28563d[_0x2ccc('0x3f')]=_[_0x2ccc('0x3e')](_0x448ecf['query']);_0x28563d[_0x2ccc('0x40')]=_[_0x2ccc('0x41')](_0x28563d['model'],_0x28563d[_0x2ccc('0x3f')]);_0x2b8e46[_0x2ccc('0x42')]=_[_0x2ccc('0x41')](_0x28563d['model'],qs['fields'](_0x448ecf[_0x2ccc('0x3f')]['fields']));_0x2b8e46['attributes']=_0x2b8e46['attributes']['length']?_0x2b8e46[_0x2ccc('0x42')]:_0x28563d[_0x2ccc('0x3d')];if(_0x448ecf['query'][_0x2ccc('0x4f')]){_0x2b8e46[_0x2ccc('0x50')]=[{'all':!![]}];}_0x2b8e46=_[_0x2ccc('0x4c')]({},_0x2b8e46,_0x448ecf[_0x2ccc('0x4e')]);return db[_0x2ccc('0x3a')][_0x2ccc('0x55')](_0x2b8e46)[_0x2ccc('0x32')](handleEntityNotFound(_0x27dcb3,null))[_0x2ccc('0x32')](respondWithResult(_0x27dcb3,null))['catch'](handleError(_0x27dcb3,null));};exports[_0x2ccc('0x56')]=function(_0x3c6be3,_0x4aa117){return db[_0x2ccc('0x3a')]['create'](_0x3c6be3[_0x2ccc('0x57')],{})[_0x2ccc('0x32')](function(_0x33cdc0){var _0x1dc5f5=_0x3c6be3[_0x2ccc('0x58')][_0x2ccc('0x59')]({'plain':!![]});if(!_0x1dc5f5)throw new Error(_0x2ccc('0x5a'));if(_0x1dc5f5[_0x2ccc('0x5b')]===_0x2ccc('0x58')){var _0x3b5a51=_0x33cdc0[_0x2ccc('0x59')]({'plain':!![]});var _0x31bc87='WhatsappAccounts';return db['UserProfileSection'][_0x2ccc('0x55')]({'where':{'name':_0x31bc87,'userProfileId':_0x1dc5f5[_0x2ccc('0x5c')]},'raw':!![]})[_0x2ccc('0x32')](function(_0x169210){if(_0x169210&&_0x169210[_0x2ccc('0x5d')]===0x0){return db[_0x2ccc('0x34')][_0x2ccc('0x56')]({'name':_0x3b5a51['name'],'resourceId':_0x3b5a51['id'],'type':_0x169210[_0x2ccc('0x36')],'sectionId':_0x169210['id']},{})[_0x2ccc('0x32')](function(){return _0x33cdc0;});}else{return _0x33cdc0;}})[_0x2ccc('0x5e')](function(_0x1233b4){logger[_0x2ccc('0x21')](_0x2ccc('0x5f'),_0x1233b4);throw _0x1233b4;});}return _0x33cdc0;})[_0x2ccc('0x32')](respondWithResult(_0x4aa117,0xc9))[_0x2ccc('0x5e')](handleError(_0x4aa117,null));};exports[_0x2ccc('0x30')]=function(_0x1c86c4,_0x5902dc){if(_0x1c86c4[_0x2ccc('0x57')]['id']){delete _0x1c86c4[_0x2ccc('0x57')]['id'];}return db[_0x2ccc('0x3a')]['find']({'where':{'id':_0x1c86c4[_0x2ccc('0x60')]['id']},'include':[{'model':db[_0x2ccc('0x39')],'as':'mandatoryDispositionPause'}]})[_0x2ccc('0x32')](handleEntityNotFound(_0x5902dc,null))[_0x2ccc('0x32')](saveUpdates(_0x1c86c4[_0x2ccc('0x57')],null))['then'](respondWithResult(_0x5902dc,null))['catch'](handleError(_0x5902dc,null));};exports[_0x2ccc('0x31')]=function(_0x584351,_0x255b83){return db[_0x2ccc('0x3a')]['find']({'where':{'id':_0x584351[_0x2ccc('0x60')]['id']}})[_0x2ccc('0x32')](handleEntityNotFound(_0x255b83,null))[_0x2ccc('0x32')](removeEntity(_0x255b83,null))[_0x2ccc('0x5e')](handleError(_0x255b83,null));};exports[_0x2ccc('0x61')]=function(_0x1dbdac,_0x1e8191){return db[_0x2ccc('0x3a')][_0x2ccc('0x61')]()['then'](respondWithResult(_0x1e8191,null))[_0x2ccc('0x5e')](handleError(_0x1e8191,null));};exports[_0x2ccc('0x62')]=function(_0xfefaa,_0x173258,_0xd8c135){if(_0xfefaa[_0x2ccc('0x57')]['id']){delete _0xfefaa[_0x2ccc('0x57')]['id'];}return db[_0x2ccc('0x3a')][_0x2ccc('0x55')]({'where':{'id':_0xfefaa[_0x2ccc('0x60')]['id']}})[_0x2ccc('0x32')](handleEntityNotFound(_0x173258,null))[_0x2ccc('0x32')](function(_0x257365){if(_0x257365){_0xfefaa[_0x2ccc('0x57')][_0x2ccc('0x63')]=_0x257365['id'];return db[_0x2ccc('0x64')][_0x2ccc('0x56')](_0xfefaa[_0x2ccc('0x57')]);}})['then'](respondWithResult(_0x173258,null))[_0x2ccc('0x5e')](handleError(_0x173258,null));};exports[_0x2ccc('0x65')]=function(_0x48910f,_0x38e299,_0xa0340b){var _0x5826e8={'raw':![],'where':{}};var _0x32e49c={};var _0x542b17={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x2ccc('0x66')]({'where':{'id':_0x48910f[_0x2ccc('0x60')]['id']}})[_0x2ccc('0x32')](handleEntityNotFound(_0x38e299,null))[_0x2ccc('0x32')](function(_0x3c16d6){if(_0x3c16d6){_0x32e49c[_0x2ccc('0x3d')]=_[_0x2ccc('0x3e')](db[_0x2ccc('0x64')][_0x2ccc('0x3b')]);_0x32e49c[_0x2ccc('0x3f')]=_[_0x2ccc('0x3e')](_0x48910f[_0x2ccc('0x3f')]);_0x32e49c['filters']=_[_0x2ccc('0x41')](_0x32e49c[_0x2ccc('0x3d')],_0x32e49c[_0x2ccc('0x3f')]);_0x5826e8[_0x2ccc('0x42')]=_[_0x2ccc('0x41')](_0x32e49c['model'],qs[_0x2ccc('0x43')](_0x48910f['query'][_0x2ccc('0x43')]));_0x5826e8[_0x2ccc('0x42')]=_0x5826e8[_0x2ccc('0x42')][_0x2ccc('0x44')]?_0x5826e8[_0x2ccc('0x42')]:_0x32e49c['model'];if(!_0x48910f['query'][_0x2ccc('0x45')]('nolimit')){_0x5826e8[_0x2ccc('0x2a')]=qs[_0x2ccc('0x2a')](_0x48910f[_0x2ccc('0x3f')][_0x2ccc('0x2a')]);_0x5826e8['offset']=qs[_0x2ccc('0x28')](_0x48910f[_0x2ccc('0x3f')][_0x2ccc('0x28')]);}_0x5826e8[_0x2ccc('0x47')]=qs['sort'](_0x48910f[_0x2ccc('0x3f')][_0x2ccc('0x48')]);_0x5826e8['where']=qs[_0x2ccc('0x40')](_['pick'](_0x48910f['query'],_0x32e49c[_0x2ccc('0x40')]));_0x5826e8[_0x2ccc('0x49')][_0x2ccc('0x63')]=_0x3c16d6['id'];if(_0x48910f['query']['filter']){_0x5826e8[_0x2ccc('0x49')]=_['merge'](_0x5826e8[_0x2ccc('0x49')],{'$or':_[_0x2ccc('0x67')](_0x5826e8[_0x2ccc('0x42')],function(_0x3b9546){var _0x2d0acf={};_0x2d0acf[_0x3b9546]={'$like':'%'+_0x48910f[_0x2ccc('0x3f')][_0x2ccc('0x4b')]+'%'};return _0x2d0acf;})});}_0x5826e8=_[_0x2ccc('0x4c')]({},_0x5826e8,_0x48910f[_0x2ccc('0x4e')]);return db['Disposition'][_0x2ccc('0x2b')]({'where':_0x5826e8[_0x2ccc('0x49')]})['then'](function(_0x5a4064){_0x542b17['count']=_0x5a4064;if(_0x48910f[_0x2ccc('0x3f')][_0x2ccc('0x4f')]){_0x5826e8['include']=[{'all':!![]}];}return db[_0x2ccc('0x64')][_0x2ccc('0x51')](_0x5826e8);})[_0x2ccc('0x32')](function(_0x4b2916){_0x542b17[_0x2ccc('0x52')]=_0x4b2916;return _0x542b17;});}})[_0x2ccc('0x32')](respondWithFilteredResult(_0x38e299,_0x5826e8))[_0x2ccc('0x5e')](handleError(_0x38e299,null));};exports[_0x2ccc('0x68')]=function(_0x466820,_0x376bb3,_0x5a4a41){return db[_0x2ccc('0x3a')]['find']({'where':{'id':_0x466820[_0x2ccc('0x60')]['id']}})[_0x2ccc('0x32')](handleEntityNotFound(_0x376bb3,null))[_0x2ccc('0x32')](function(_0x263751){if(_0x263751){return _0x263751[_0x2ccc('0x68')](_0x466820['query'][_0x2ccc('0x69')]);}})[_0x2ccc('0x32')](respondWithStatusCode(_0x376bb3,null))['catch'](handleError(_0x376bb3,null));};exports[_0x2ccc('0x6a')]=function(_0x2f5d6b,_0x34ab58,_0x511bb9){if(_0x2f5d6b[_0x2ccc('0x57')]['id']){delete _0x2f5d6b['body']['id'];}return db['WhatsappAccount'][_0x2ccc('0x55')]({'where':{'id':_0x2f5d6b[_0x2ccc('0x60')]['id']}})[_0x2ccc('0x32')](handleEntityNotFound(_0x34ab58,null))[_0x2ccc('0x32')](function(_0x7e85c2){if(_0x7e85c2){_0x2f5d6b[_0x2ccc('0x57')][_0x2ccc('0x63')]=_0x7e85c2['id'];return db[_0x2ccc('0x6b')][_0x2ccc('0x56')](_0x2f5d6b[_0x2ccc('0x57')]);}})[_0x2ccc('0x32')](respondWithResult(_0x34ab58,null))['catch'](handleError(_0x34ab58,null));};exports[_0x2ccc('0x6c')]=function(_0x190dcd,_0x55c58d,_0x29f0a0){var _0x13d3ca={'raw':![],'where':{}};var _0x5336e9={};var _0x2c9c16={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x2ccc('0x66')]({'where':{'id':_0x190dcd[_0x2ccc('0x60')]['id']}})[_0x2ccc('0x32')](handleEntityNotFound(_0x55c58d,null))[_0x2ccc('0x32')](function(_0x2b6ebf){if(_0x2b6ebf){_0x5336e9[_0x2ccc('0x3d')]=_[_0x2ccc('0x3e')](db[_0x2ccc('0x6b')][_0x2ccc('0x3b')]);_0x5336e9[_0x2ccc('0x3f')]=_[_0x2ccc('0x3e')](_0x190dcd['query']);_0x5336e9[_0x2ccc('0x40')]=_[_0x2ccc('0x41')](_0x5336e9[_0x2ccc('0x3d')],_0x5336e9['query']);_0x13d3ca['attributes']=_['intersection'](_0x5336e9[_0x2ccc('0x3d')],qs['fields'](_0x190dcd['query']['fields']));_0x13d3ca['attributes']=_0x13d3ca[_0x2ccc('0x42')][_0x2ccc('0x44')]?_0x13d3ca['attributes']:_0x5336e9[_0x2ccc('0x3d')];if(!_0x190dcd[_0x2ccc('0x3f')][_0x2ccc('0x45')](_0x2ccc('0x46'))){_0x13d3ca['limit']=qs[_0x2ccc('0x2a')](_0x190dcd['query'][_0x2ccc('0x2a')]);_0x13d3ca[_0x2ccc('0x28')]=qs[_0x2ccc('0x28')](_0x190dcd['query'][_0x2ccc('0x28')]);}_0x13d3ca[_0x2ccc('0x47')]=qs['sort'](_0x190dcd[_0x2ccc('0x3f')]['sort']);_0x13d3ca['where']=qs[_0x2ccc('0x40')](_['pick'](_0x190dcd['query'],_0x5336e9[_0x2ccc('0x40')]));_0x13d3ca['where'][_0x2ccc('0x63')]=_0x2b6ebf['id'];if(_0x190dcd['query']['filter']){_0x13d3ca['where']=_[_0x2ccc('0x4c')](_0x13d3ca[_0x2ccc('0x49')],{'$or':_[_0x2ccc('0x67')](_0x13d3ca[_0x2ccc('0x42')],function(_0x31a19f){var _0x55c54b={};_0x55c54b[_0x31a19f]={'$like':'%'+_0x190dcd[_0x2ccc('0x3f')][_0x2ccc('0x4b')]+'%'};return _0x55c54b;})});}_0x13d3ca=_[_0x2ccc('0x4c')]({},_0x13d3ca,_0x190dcd[_0x2ccc('0x4e')]);return db['CannedAnswer'][_0x2ccc('0x2b')]({'where':_0x13d3ca['where']})[_0x2ccc('0x32')](function(_0x598946){_0x2c9c16[_0x2ccc('0x2b')]=_0x598946;if(_0x190dcd['query'][_0x2ccc('0x4f')]){_0x13d3ca[_0x2ccc('0x50')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x13d3ca);})[_0x2ccc('0x32')](function(_0x547954){_0x2c9c16['rows']=_0x547954;return _0x2c9c16;});}})['then'](respondWithFilteredResult(_0x55c58d,_0x13d3ca))[_0x2ccc('0x5e')](handleError(_0x55c58d,null));};exports['removeAnswers']=function(_0x4731f8,_0x2a70b2,_0x300965){return db[_0x2ccc('0x3a')][_0x2ccc('0x55')]({'where':{'id':_0x4731f8[_0x2ccc('0x60')]['id']}})['then'](handleEntityNotFound(_0x2a70b2,null))['then'](function(_0x5120ba){if(_0x5120ba){return _0x5120ba['removeAnswers'](_0x4731f8[_0x2ccc('0x3f')][_0x2ccc('0x69')]);}})['then'](respondWithStatusCode(_0x2a70b2,null))[_0x2ccc('0x5e')](handleError(_0x2a70b2,null));};exports[_0x2ccc('0x6d')]=function(_0x8303eb,_0x12aea3,_0x49ede0){return db[_0x2ccc('0x3a')]['find']({'where':{'id':_0x8303eb[_0x2ccc('0x60')]['id']}})[_0x2ccc('0x32')](handleEntityNotFound(_0x12aea3,null))[_0x2ccc('0x32')](function(_0x2a05e2){if(_0x2a05e2){return _0x2a05e2[_0x2ccc('0x6d')](_0x8303eb[_0x2ccc('0x57')][_0x2ccc('0x69')],_['omit'](_0x8303eb[_0x2ccc('0x57')],[_0x2ccc('0x69'),'id'])||{})[_0x2ccc('0x6e')](function(_0xe11549){for(var _0xb685e8=0x0;_0xb685e8<_0x8303eb[_0x2ccc('0x57')][_0x2ccc('0x69')][_0x2ccc('0x44')];_0xb685e8+=0x1){socket[_0x2ccc('0x6f')]('userWhatsappAccount:save',{'UserId':Number(_0x8303eb[_0x2ccc('0x57')]['ids'][_0xb685e8]),'WhatsappAccountId':Number(_0x8303eb[_0x2ccc('0x60')]['id'])});}return _0xe11549;});}})[_0x2ccc('0x32')](respondWithResult(_0x12aea3,null))[_0x2ccc('0x5e')](handleError(_0x12aea3,null));};exports['removeAgents']=function(_0x2341bb,_0x44f8e6,_0x54410a){return db[_0x2ccc('0x3a')][_0x2ccc('0x55')]({'where':{'id':_0x2341bb[_0x2ccc('0x60')]['id']}})[_0x2ccc('0x32')](handleEntityNotFound(_0x44f8e6,null))['then'](function(_0x40fe8d){if(_0x40fe8d){return _0x40fe8d[_0x2ccc('0x70')](_0x2341bb['query'][_0x2ccc('0x69')])[_0x2ccc('0x32')](function(){if(_[_0x2ccc('0x71')](_0x2341bb['query'][_0x2ccc('0x69')])){for(var _0x14b4e7=0x0;_0x14b4e7<_0x2341bb[_0x2ccc('0x3f')][_0x2ccc('0x69')][_0x2ccc('0x44')];_0x14b4e7+=0x1){socket[_0x2ccc('0x6f')](_0x2ccc('0x72'),{'UserId':Number(_0x2341bb['query'][_0x2ccc('0x69')][_0x14b4e7]),'WhatsappAccountId':Number(_0x2341bb['params']['id'])});}}else{socket[_0x2ccc('0x6f')](_0x2ccc('0x72'),{'UserId':Number(_0x2341bb[_0x2ccc('0x3f')][_0x2ccc('0x69')]),'WhatsappAccountId':Number(_0x2341bb[_0x2ccc('0x60')]['id'])});}});}})[_0x2ccc('0x32')](respondWithStatusCode(_0x44f8e6,null))[_0x2ccc('0x5e')](handleError(_0x44f8e6,null));};exports[_0x2ccc('0x73')]=function(_0x1564e0,_0x177ee0,_0x296e33){var _0x588b9e={};var _0x51cb59={};var _0xd72468;var _0x4e4366;return db[_0x2ccc('0x3a')][_0x2ccc('0x66')]({'where':{'id':_0x1564e0['params']['id']}})[_0x2ccc('0x32')](handleEntityNotFound(_0x177ee0,null))['then'](function(_0x22a0c9){if(_0x22a0c9){_0xd72468=_0x22a0c9;_0x51cb59[_0x2ccc('0x3d')]=_['keys'](db['User'][_0x2ccc('0x3b')]);_0x51cb59[_0x2ccc('0x3f')]=_[_0x2ccc('0x3e')](_0x1564e0[_0x2ccc('0x3f')]);_0x51cb59[_0x2ccc('0x40')]=_[_0x2ccc('0x41')](_0x51cb59[_0x2ccc('0x3d')],_0x51cb59[_0x2ccc('0x3f')]);_0x588b9e[_0x2ccc('0x42')]=_[_0x2ccc('0x41')](_0x51cb59[_0x2ccc('0x3d')],qs[_0x2ccc('0x43')](_0x1564e0[_0x2ccc('0x3f')][_0x2ccc('0x43')]));_0x588b9e['attributes']=_0x588b9e[_0x2ccc('0x42')][_0x2ccc('0x44')]?_0x588b9e[_0x2ccc('0x42')]:_0x51cb59[_0x2ccc('0x3d')];_0x588b9e['order']=qs['sort'](_0x1564e0[_0x2ccc('0x3f')][_0x2ccc('0x48')]);_0x588b9e[_0x2ccc('0x49')]=qs[_0x2ccc('0x40')](_[_0x2ccc('0x4a')](_0x1564e0['query'],_0x51cb59[_0x2ccc('0x40')]));if(_0x1564e0[_0x2ccc('0x3f')][_0x2ccc('0x4b')]){_0x588b9e['where']=_[_0x2ccc('0x4c')](_0x588b9e[_0x2ccc('0x49')],{'$or':_[_0x2ccc('0x67')](_0x588b9e[_0x2ccc('0x42')],function(_0x1ef515){var _0x58a117={};_0x58a117[_0x1ef515]={'$like':'%'+_0x1564e0[_0x2ccc('0x3f')][_0x2ccc('0x4b')]+'%'};return _0x58a117;})});}_0x588b9e=_[_0x2ccc('0x4c')]({},_0x588b9e,_0x1564e0[_0x2ccc('0x4e')]);return _0xd72468[_0x2ccc('0x73')](_0x588b9e);}})[_0x2ccc('0x32')](function(_0xc6f352){if(_0xc6f352){_0x4e4366=_0xc6f352[_0x2ccc('0x44')];if(!_0x1564e0[_0x2ccc('0x3f')][_0x2ccc('0x45')](_0x2ccc('0x46'))){_0x588b9e[_0x2ccc('0x2a')]=qs[_0x2ccc('0x2a')](_0x1564e0[_0x2ccc('0x3f')][_0x2ccc('0x2a')]);_0x588b9e[_0x2ccc('0x28')]=qs[_0x2ccc('0x28')](_0x1564e0[_0x2ccc('0x3f')][_0x2ccc('0x28')]);}return _0xd72468[_0x2ccc('0x73')](_0x588b9e);}})[_0x2ccc('0x32')](function(_0x3b930f){if(_0x3b930f){return _0x3b930f?{'count':_0x4e4366,'rows':_0x3b930f}:null;}})[_0x2ccc('0x32')](respondWithResult(_0x177ee0,null))['catch'](handleError(_0x177ee0,null));};exports[_0x2ccc('0x74')]=function(_0x57a760,_0x2275b8){var _0x3de4fc=_0x57a760['params']['id'];var _0x47e5be=_0x57a760['body'];var _0x43f058=0xc8;var _0x28508b=null;return db[_0x2ccc('0x75')][_0x2ccc('0x76')]({'isolationLevel':db['sequelize'][_0x2ccc('0x77')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x49d994){return db[_0x2ccc('0x3a')][_0x2ccc('0x66')]({'where':{'id':_0x3de4fc},'transaction':_0x49d994})[_0x2ccc('0x32')](function(_0x511c0c){if(_0x511c0c){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x3de4fc},'transaction':_0x49d994})[_0x2ccc('0x32')](function(){var _0x12f6ea=_['map'](_0x47e5be,function(_0x2944af){_0x2944af[_0x2ccc('0x63')]=_0x3de4fc;return _0x2944af;});return db[_0x2ccc('0x78')]['bulkCreate'](_0x12f6ea,{'transaction':_0x49d994});});}else{_0x43f058=0x194;_0x28508b=[];}});})[_0x2ccc('0x32')](function(){if(_0x43f058!==0x194){return db[_0x2ccc('0x78')][_0x2ccc('0x79')]({'where':{'WhatsappAccountId':_0x3de4fc},'order':_0x2ccc('0x7a')})['then'](function(_0x2287b4){_0x28508b=_0x2287b4;});}})[_0x2ccc('0x5e')](function(_0x576d25){_0x43f058=0x1f4;logger[_0x2ccc('0x21')](_0x576d25[_0x2ccc('0x7b')]);if(_0x576d25[_0x2ccc('0x36')]){delete _0x576d25[_0x2ccc('0x36')];}_0x28508b=_0x576d25;})[_0x2ccc('0x7c')](function(){if(_0x28508b===null){_0x2275b8[_0x2ccc('0x26')](_0x43f058);}else{if(_0x43f058===0x1f4){_0x2275b8[_0x2ccc('0x27')](_0x43f058)['send'](_0x28508b);}else{_0x2275b8[_0x2ccc('0x27')](_0x43f058)[_0x2ccc('0x2e')](_0x28508b);}}});};exports['getApplications']=function(_0x2963b1,_0x224599,_0x48f1eb){var _0x312117={};var _0x40b307={};var _0x19fb38;var _0x28f6dc;return db[_0x2ccc('0x3a')]['findOne']({'where':{'id':_0x2963b1[_0x2ccc('0x60')]['id']}})[_0x2ccc('0x32')](handleEntityNotFound(_0x224599,null))[_0x2ccc('0x32')](function(_0x2402ea){if(_0x2402ea){_0x19fb38=_0x2402ea;_0x40b307[_0x2ccc('0x3d')]=_[_0x2ccc('0x3e')](db[_0x2ccc('0x78')][_0x2ccc('0x3b')]);_0x40b307[_0x2ccc('0x3f')]=_['keys'](_0x2963b1[_0x2ccc('0x3f')]);_0x40b307[_0x2ccc('0x40')]=_[_0x2ccc('0x41')](_0x40b307[_0x2ccc('0x3d')],_0x40b307[_0x2ccc('0x3f')]);_0x312117['attributes']=_[_0x2ccc('0x41')](_0x40b307[_0x2ccc('0x3d')],qs[_0x2ccc('0x43')](_0x2963b1[_0x2ccc('0x3f')][_0x2ccc('0x43')]));_0x312117['attributes']=_0x312117[_0x2ccc('0x42')][_0x2ccc('0x44')]?_0x312117[_0x2ccc('0x42')]:_0x40b307[_0x2ccc('0x3d')];_0x312117[_0x2ccc('0x47')]=qs[_0x2ccc('0x48')](_0x2963b1[_0x2ccc('0x3f')][_0x2ccc('0x48')]);_0x312117[_0x2ccc('0x49')]=qs['filters'](_[_0x2ccc('0x4a')](_0x2963b1[_0x2ccc('0x3f')],_0x40b307[_0x2ccc('0x40')]));if(_0x2963b1['query'][_0x2ccc('0x4b')]){_0x312117[_0x2ccc('0x49')]=_[_0x2ccc('0x4c')](_0x312117[_0x2ccc('0x49')],{'$or':_[_0x2ccc('0x67')](_0x312117[_0x2ccc('0x42')],function(_0x2434d6){var _0x45fb79={};_0x45fb79[_0x2434d6]={'$like':'%'+_0x2963b1[_0x2ccc('0x3f')]['filter']+'%'};return _0x45fb79;})});}_0x312117=_[_0x2ccc('0x4c')]({},_0x312117,_0x2963b1['options']);return _0x19fb38['getApplications'](_0x312117);}})[_0x2ccc('0x32')](function(_0x464294){if(_0x464294){_0x28f6dc=_0x464294['length'];if(!_0x2963b1[_0x2ccc('0x3f')][_0x2ccc('0x45')]('nolimit')){_0x312117[_0x2ccc('0x2a')]=qs['limit'](_0x2963b1[_0x2ccc('0x3f')][_0x2ccc('0x2a')]);_0x312117[_0x2ccc('0x28')]=qs[_0x2ccc('0x28')](_0x2963b1[_0x2ccc('0x3f')]['offset']);}return _0x19fb38[_0x2ccc('0x7d')](_0x312117);}})[_0x2ccc('0x32')](function(_0x19f1b9){if(_0x19f1b9){return _0x19f1b9?{'count':_0x28f6dc,'rows':_0x19f1b9}:null;}})[_0x2ccc('0x32')](respondWithResult(_0x224599,null))[_0x2ccc('0x5e')](handleError(_0x224599,null));};exports[_0x2ccc('0x7e')]=function(_0x2d5dd9,_0x5d94b4,_0x16c7c3){var _0x119693={'channel':'whatsapp'};var _0x26791b=[];var _0x2a2ded=[];var _0x1ddf77={};return db[_0x2ccc('0x3a')]['find']({'where':{'id':_0x2d5dd9[_0x2ccc('0x60')]['id']},'include':[{'model':db[_0x2ccc('0x78')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x5d94b4,null))['then'](function(_0x3dd2d4){_0x119693[_0x2ccc('0x7f')]=_0x3dd2d4;if(_0x119693[_0x2ccc('0x7f')]&&_0x119693[_0x2ccc('0x7f')]['type']===_0x2ccc('0x80')&&_0x2d5dd9[_0x2ccc('0x57')]['statuses']){if(_0x2d5dd9[_0x2ccc('0x57')][_0x2ccc('0x81')]['length']===0x0)return;if(_0x2d5dd9[_0x2ccc('0x57')][_0x2ccc('0x81')][0x0][_0x2ccc('0x82')]!=='read')return;return db[_0x2ccc('0x83')][_0x2ccc('0x30')]({'read':!![],'readAt':_0x2d5dd9[_0x2ccc('0x57')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x2d5dd9['body'][_0x2ccc('0x81')][0x0][_0x2ccc('0x84')]},'individualHooks':!![]})[_0x2ccc('0x32')](function(_0x3eccb1){return _0x5d94b4[_0x2ccc('0x27')](0xc8)[_0x2ccc('0x2e')](_0x3eccb1);});}_0x119693[_0x2ccc('0x85')]=_[_0x2ccc('0x86')](_0x3dd2d4['Applications'],[_0x2ccc('0x7a')],[_0x2ccc('0x87')]);if(_0x119693[_0x2ccc('0x7f')][_0x2ccc('0x88')]){delete _0x119693[_0x2ccc('0x7f')]['Applications'];}return db[_0x2ccc('0x89')]['describe']()['then'](function(_0x259eb1){if(!_0x259eb1){throw new db[(_0x2ccc('0x8a'))][(_0x2ccc('0x8b'))]('no\x20available\x20attributes');}_0x26791b=_[_0x2ccc('0x8c')](_['keys'](_0x259eb1),[_0x2ccc('0x8d'),_0x2ccc('0x8e')]);_0x2a2ded=_[_0x2ccc('0x8c')](_[_0x2ccc('0x3e')](_0x259eb1),[_0x2ccc('0x8d'),_0x2ccc('0x8e'),'CompanyId',_0x2ccc('0x8f')]);_0x119693[_0x2ccc('0x57')]={'mapKey':'mobile'};if(_0x119693[_0x2ccc('0x7f')]&&_0x119693[_0x2ccc('0x7f')][_0x2ccc('0x3c')]==='twilio'){_0x119693['body'][_0x2ccc('0x90')]=_0x2d5dd9['body'][_0x2ccc('0x91')]['replace']('whatsapp:','');_0x119693[_0x2ccc('0x57')][_0x2ccc('0x57')]=_0x2d5dd9[_0x2ccc('0x57')][_0x2ccc('0x92')];_0x119693[_0x2ccc('0x57')][_0x2ccc('0x93')]=_0x2d5dd9[_0x2ccc('0x57')][_0x2ccc('0x94')];}if(_0x119693[_0x2ccc('0x7f')]&&_0x119693['account'][_0x2ccc('0x3c')]===_0x2ccc('0x80')){_0x119693['body'][_0x2ccc('0x90')]=_0x2d5dd9[_0x2ccc('0x57')][_0x2ccc('0x95')][0x0]['from'];_0x119693['body'][_0x2ccc('0x57')]=_0x2d5dd9[_0x2ccc('0x57')][_0x2ccc('0x95')][0x0]['message'][_0x2ccc('0x57')];_0x119693[_0x2ccc('0x57')]['messageId']=_0x2d5dd9[_0x2ccc('0x57')][_0x2ccc('0x95')][0x0][_0x2ccc('0x84')];}if(_0x119693['body']['id']){delete _0x119693[_0x2ccc('0x57')]['id'];}if(_['isNil'](_0x119693[_0x2ccc('0x57')]['from'])){throw new db['Sequelize'][(_0x2ccc('0x8b'))](_0x2ccc('0x96'));}if(_[_0x2ccc('0x97')](_0x119693[_0x2ccc('0x57')]['body'])||_0x119693[_0x2ccc('0x57')]['body']===''){throw new db[(_0x2ccc('0x8a'))][(_0x2ccc('0x8b'))](_0x2ccc('0x98'));}if(_[_0x2ccc('0x97')](_0x119693[_0x2ccc('0x57')][_0x2ccc('0x99')])){throw new db[(_0x2ccc('0x8a'))][(_0x2ccc('0x8b'))](_0x2ccc('0x9a')+_0x2a2ded);}if(!_[_0x2ccc('0x9b')](_0x2a2ded,_0x119693[_0x2ccc('0x57')][_0x2ccc('0x99')])){throw new db[(_0x2ccc('0x8a'))][(_0x2ccc('0x8b'))](_0x2ccc('0x9c')+_0x2a2ded);}_0x1ddf77[_0x119693[_0x2ccc('0x57')][_0x2ccc('0x99')]]=_0x119693[_0x2ccc('0x57')][_0x2ccc('0x90')];return db[_0x2ccc('0x9d')]['find']({'where':{'id':_0x119693[_0x2ccc('0x7f')][_0x2ccc('0x8f')]},'include':[{'model':db[_0x2ccc('0x89')],'as':_0x2ccc('0x9e'),'where':_0x1ddf77,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x2ccc('0x32')](handleEntityNotFound(_0x5d94b4,null))[_0x2ccc('0x32')](function(_0x1d09e1){if(_0x1d09e1){_0x119693[_0x2ccc('0x9f')]=_[_0x2ccc('0xa0')](_0x1d09e1,['Contacts']);if(_0x1d09e1['Contacts'][_0x2ccc('0x44')]){return _0x1d09e1['Contacts'][0x0];}var _0x2e8224=_[_0x2ccc('0x17')](_0x119693[_0x2ccc('0x57')],{'firstName':_0x119693[_0x2ccc('0x57')][_0x2ccc('0x90')],'ListId':_0x1d09e1['id']});_0x2e8224[_0x119693[_0x2ccc('0x57')][_0x2ccc('0x99')]]=_0x119693[_0x2ccc('0x57')][_0x2ccc('0x90')];return db[_0x2ccc('0x89')][_0x2ccc('0x56')](_0x2e8224,{'fields':_0x26791b,'raw':!![]});}})[_0x2ccc('0x32')](handleEntityNotFound(_0x5d94b4,null))[_0x2ccc('0x32')](function(_0x32b118){if(_0x32b118){_0x119693[_0x2ccc('0xa1')]=_0x32b118;var _0x1ccedb={'ContactId':_0x32b118['id'],'phone':_0x119693[_0x2ccc('0x57')][_0x2ccc('0x90')],'WhatsappAccountId':_0x2d5dd9['params']['id']};var _0x22c886={'ContactId':_0x32b118['id'],'WhatsappAccountId':_0x2d5dd9[_0x2ccc('0x60')]['id'],'closed':![]};return db[_0x2ccc('0xa2')][_0x2ccc('0x55')]({'where':_0x22c886})['then'](function(_0x3d11f2){if(_0x3d11f2){return[_0x3d11f2,![]];}return db[_0x2ccc('0xa2')]['create'](_0x1ccedb)[_0x2ccc('0x32')](function(_0x1cb7cb){return[_0x1cb7cb,!![]];});});}})[_0x2ccc('0x6e')](function(_0x5d938a,_0x1a8b8a){_0x119693[_0x2ccc('0xa3')]=_0x5d938a[_0x2ccc('0x59')]({'plain':!![]});_0x119693[_0x2ccc('0xa3')][_0x2ccc('0xa4')]=![];if(_0x1a8b8a){if(_0x119693[_0x2ccc('0x7f')]['autoclose']){_0x119693[_0x2ccc('0x85')]['push']({'id':0x0,'priority':_0x119693['applications']['length']+0x1,'app':_0x2ccc('0xa5'),'appdata':_0x2ccc('0xa6'),'interval':_0x2ccc('0xa7')});}_0x119693['interaction'][_0x2ccc('0xa4')]=!![];}return db[_0x2ccc('0x83')]['create']({'phone':_0x119693[_0x2ccc('0x57')][_0x2ccc('0x90')],'messageId':_0x119693[_0x2ccc('0x57')][_0x2ccc('0x93')],'body':_0x119693[_0x2ccc('0x57')][_0x2ccc('0x57')],'WhatsappAccountId':_0x2d5dd9['params']['id'],'WhatsappInteractionId':_0x5d938a['id'],'direction':'in','ContactId':_0x5d938a['ContactId'],'AttachmentId':_0x119693[_0x2ccc('0x57')][_0x2ccc('0xa8')]});})[_0x2ccc('0x32')](function(_0xb2a598){_0x119693[_0x2ccc('0x23')]=_0xb2a598;if(!_0x119693[_0x2ccc('0xa3')]['UserId'])return;return db[_0x2ccc('0xa9')][_0x2ccc('0x55')]({'attributes':['id',_0x2ccc('0x36')],'where':{'id':_0x119693[_0x2ccc('0xa3')][_0x2ccc('0xaa')]}});})[_0x2ccc('0x32')](function(_0xe3e353){if(_0xe3e353){_0x119693[_0x2ccc('0x85')][_0x2ccc('0xab')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xe3e353['name']+','+(_0x119693[_0x2ccc('0x7f')][_0x2ccc('0xac')]||0xa),'interval':'*,*,*,*'});}if(!_0x119693[_0x2ccc('0xa3')][_0x2ccc('0xad')])return;return db[_0x2ccc('0xae')][_0x2ccc('0x55')]({'attributes':['id',_0x2ccc('0x36')],'where':{'id':_0x119693[_0x2ccc('0xa3')][_0x2ccc('0xad')]}});})[_0x2ccc('0x32')](function(_0x224cb7){if(_0x224cb7){_0x119693[_0x2ccc('0x85')][_0x2ccc('0xab')]({'id':0x0,'priority':0x1,'app':_0x2ccc('0xaf'),'appdata':_0x224cb7[_0x2ccc('0x36')]+','+(_0x119693['account']['waitForTheAssignedQueue']||0x12c),'interval':_0x2ccc('0xa7')});}return respondWithRpcPromise(_0x2ccc('0xb0'),_0x2ccc('0xb1'),_0x119693);})[_0x2ccc('0x32')](function(_0x45ef2b){if(_0x45ef2b){var _0xadf823=0xc8;var _0x3cad10='receiveMessage';logger[_0x2ccc('0x24')](_0x2ccc('0x1e'),_0x3cad10,_0xadf823,_0x2ccc('0xb2'));logger[_0x2ccc('0x1d')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3cad10,_0xadf823,'entity\x20found',JSON[_0x2ccc('0x20')](_0x45ef2b));if(_0x119693[_0x2ccc('0x7f')]['type']===_0x2ccc('0xb3')){return _0x5d94b4['status'](_0xadf823)['set']('Content-Type',_0x2ccc('0xb4'))['send'](_0x2ccc('0xb5'));}else{return _0x5d94b4[_0x2ccc('0x27')](_0xadf823)[_0x2ccc('0x2e')](_0x45ef2b);}}});})[_0x2ccc('0x5e')](handleError(_0x5d94b4,null));};exports['send']=function(_0x401f68,_0x2fbe11,_0x2fb5db){var _0x413a06,_0x40a039,_0x396f76;if(_['isNil'](_0x401f68['body'][_0x2ccc('0x57')])||_0x401f68[_0x2ccc('0x57')]['body']===''){throw new db[(_0x2ccc('0x8a'))][(_0x2ccc('0x8b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2ccc('0x97')](_0x401f68[_0x2ccc('0x57')]['to'])){throw new db['Sequelize'][(_0x2ccc('0x8b'))](_0x2ccc('0xb6'));}_0x413a06=_0x401f68[_0x2ccc('0x57')]['to'];return db[_0x2ccc('0x3a')][_0x2ccc('0x55')]({'where':{'id':_0x401f68[_0x2ccc('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0x2ccc('0xb7'),'include':[{'model':db['CmContact'],'as':_0x2ccc('0x9e'),'where':{'mobile':_0x413a06},'limit':0x1,'order':[[_0x2ccc('0x8e'),_0x2ccc('0xb8')]]}]}]})[_0x2ccc('0x32')](handleEntityNotFound(_0x2fbe11,null))[_0x2ccc('0x32')](function(_0x413461){if(_0x413461&&_0x413461[_0x2ccc('0xb7')]){_0x40a039=_0x413461[_0x2ccc('0x59')]({'plain':!![]});if(_0x40a039[_0x2ccc('0xb7')]&&_0x40a039[_0x2ccc('0xb7')][_0x2ccc('0x9e')]['length']){return _0x40a039[_0x2ccc('0xb7')][_0x2ccc('0x9e')][0x0];}return db[_0x2ccc('0x89')][_0x2ccc('0x56')](_[_0x2ccc('0x17')](_0x401f68['body'],{'firstName':_0x413a06,'mobile':_0x413a06,'phone':_0x413a06,'ListId':_0x40a039['ListId']}));}})[_0x2ccc('0x32')](handleEntityNotFound(_0x2fbe11,null))[_0x2ccc('0x32')](function(_0x3b7f05){if(_0x3b7f05){_0x396f76=_0x3b7f05;return db[_0x2ccc('0xa2')][_0x2ccc('0x55')]({'where':{'ContactId':_0x396f76['id'],'closed':![],'WhatsappAccountId':_0x40a039['id']}})[_0x2ccc('0x32')](function(_0x16803c){if(_0x16803c){return[_0x16803c,![]];}return db[_0x2ccc('0xa2')][_0x2ccc('0x56')]({'UserId':_0x401f68[_0x2ccc('0x58')]['id'],'ContactId':_0x396f76['id'],'WhatsappAccountId':_0x40a039['id'],'phone':_0x413a06,'firstMsgDirection':_0x2ccc('0xb9'),'Messages':[_[_0x2ccc('0x4c')](_0x401f68['body'],{'read':![],'body':_0x401f68[_0x2ccc('0x57')][_0x2ccc('0x57')],'phone':_0x413a06,'WhatsappAccountId':_0x40a039['id'],'UserId':_0x401f68[_0x2ccc('0x58')]['id'],'ContactId':_0x396f76['id']})]},{'include':[{'model':db[_0x2ccc('0x83')],'as':_0x2ccc('0xba')}]})[_0x2ccc('0x32')](function(_0x481786){return[_0x481786,!![]];});});}})[_0x2ccc('0x6e')](function(_0x3b22b4,_0x437250){if(_0x437250){return _0x3b22b4;}return db[_0x2ccc('0x83')]['create'](_[_0x2ccc('0x4c')](_0x401f68[_0x2ccc('0x57')],{'read':![],'body':_0x401f68[_0x2ccc('0x57')][_0x2ccc('0x57')],'phone':_0x413a06,'WhatsappAccountId':_0x40a039['id'],'WhatsappInteractionId':_0x3b22b4['id'],'UserId':_0x401f68[_0x2ccc('0x58')]['id'],'ContactId':_0x396f76['id']}))[_0x2ccc('0x32')](function(_0xcc796a){_0x3b22b4[_0x2ccc('0xbb')]['Messages']=[];_0x3b22b4[_0x2ccc('0xbb')][_0x2ccc('0xba')][_0x2ccc('0xbc')](_0xcc796a['dataValues']);return _0x3b22b4;});})[_0x2ccc('0x32')](respondWithResult(_0x2fbe11,null))[_0x2ccc('0x5e')](handleError(_0x2fbe11,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 57318c4..8b5138b 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 _0xc2c3=['hook','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x58bb11,_0xe3ba22){var _0xe79a5a=function(_0x1ce0d4){while(--_0x1ce0d4){_0x58bb11['push'](_0x58bb11['shift']());}};_0xe79a5a(++_0xe3ba22);}(_0xc2c3,0x1f0));var _0x3c2c=function(_0x292b7b,_0xf61b5b){_0x292b7b=_0x292b7b-0x0;var _0xe42ff2=_0xc2c3[_0x292b7b];return _0xe42ff2;};'use strict';var EventEmitter=require(_0x3c2c('0x0'));var WhatsappAccount=require(_0x3c2c('0x1'))['db'][_0x3c2c('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x3c2c('0x3')](0x0);var events={'afterCreate':_0x3c2c('0x4'),'afterUpdate':'update','afterDestroy':_0x3c2c('0x5')};function emitEvent(_0x4212a9){return function(_0x186b99,_0x537ed0,_0x13778c){WhatsappAccountEvents[_0x3c2c('0x6')](_0x4212a9+':'+_0x186b99['id'],_0x186b99);WhatsappAccountEvents['emit'](_0x4212a9,_0x186b99);_0x13778c(null);};}for(var e in events){if(events[_0x3c2c('0x7')](e)){var event=events[e];WhatsappAccount[_0x3c2c('0x8')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x1423=['hasOwnProperty','hook','exports','events','save','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1423,0x1c3));var _0x3142=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1423[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x3142('0x0'));var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3142('0x1'),'afterUpdate':_0x3142('0x2'),'afterDestroy':_0x3142('0x3')};function emitEvent(_0x254efc){return function(_0x41dda5,_0x3dc93e,_0x4515e7){WhatsappAccountEvents[_0x3142('0x4')](_0x254efc+':'+_0x41dda5['id'],_0x41dda5);WhatsappAccountEvents[_0x3142('0x4')](_0x254efc,_0x41dda5);_0x4515e7(null);};}for(var e in events){if(events[_0x3142('0x5')](e)){var event=events[e];WhatsappAccount[_0x3142('0x6')](e,emitEvent(event));}}module[_0x3142('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 456be32..3433959 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 _0x4a15=['WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x245924,_0x4d112){var _0x249b6f=function(_0x54746f){while(--_0x54746f){_0x245924['push'](_0x245924['shift']());}};_0x249b6f(++_0x4d112);}(_0x4a15,0x9e));var _0x54a1=function(_0x3b87f4,_0x112243){_0x3b87f4=_0x3b87f4-0x0;var _0x63d16e=_0x4a15[_0x3b87f4];return _0x63d16e;};'use strict';var _=require(_0x54a1('0x0'));var util=require(_0x54a1('0x1'));var logger=require(_0x54a1('0x2'))(_0x54a1('0x3'));var moment=require(_0x54a1('0x4'));var BPromise=require(_0x54a1('0x5'));var rp=require(_0x54a1('0x6'));var fs=require('fs');var path=require(_0x54a1('0x7'));var rimraf=require('rimraf');var config=require(_0x54a1('0x8'));var attributes=require('./whatsappAccount.attributes');module[_0x54a1('0x9')]=function(_0x10a1a1,_0x215d43){return _0x10a1a1[_0x54a1('0xa')](_0x54a1('0xb'),attributes,{'tableName':_0x54a1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8624=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','define','WhatsappAccount'];(function(_0x2856b1,_0x340e15){var _0x399b4d=function(_0x305577){while(--_0x305577){_0x2856b1['push'](_0x2856b1['shift']());}};_0x399b4d(++_0x340e15);}(_0x8624,0x1d4));var _0x4862=function(_0x8a0140,_0x4a1b16){_0x8a0140=_0x8a0140-0x0;var _0x1be8a8=_0x8624[_0x8a0140];return _0x1be8a8;};'use strict';var _=require(_0x4862('0x0'));var util=require(_0x4862('0x1'));var logger=require(_0x4862('0x2'))(_0x4862('0x3'));var moment=require(_0x4862('0x4'));var BPromise=require(_0x4862('0x5'));var rp=require(_0x4862('0x6'));var fs=require('fs');var path=require(_0x4862('0x7'));var rimraf=require(_0x4862('0x8'));var config=require(_0x4862('0x9'));var attributes=require(_0x4862('0xa'));module['exports']=function(_0x47b967,_0x34d834){return _0x47b967[_0x4862('0xb')](_0x4862('0xc'),attributes,{'tableName':'whatsapp_accounts','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 8b5f6db..0fc331f 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 _0xba1f=['options','raw','where','map','include','model','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find'];(function(_0x2f96e4,_0x19cab1){var _0x51d4c3=function(_0x511996){while(--_0x511996){_0x2f96e4['push'](_0x2f96e4['shift']());}};_0x51d4c3(++_0x19cab1);}(_0xba1f,0x79));var _0xfba1=function(_0xa21c85,_0x30bbc5){_0xa21c85=_0xa21c85-0x0;var _0x1b0c09=_0xba1f[_0xa21c85];return _0x1b0c09;};'use strict';var _=require('lodash');var util=require(_0xfba1('0x0'));var moment=require(_0xfba1('0x1'));var BPromise=require(_0xfba1('0x2'));var rs=require(_0xfba1('0x3'));var fs=require('fs');var Redis=require(_0xfba1('0x4'));var db=require(_0xfba1('0x5'))['db'];var utils=require(_0xfba1('0x6'));var logger=require('../../config/logger')(_0xfba1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xfba1('0x8')]({'port':0x232a});config[_0xfba1('0x9')]=_[_0xfba1('0xa')](config['redis'],{'host':_0xfba1('0xb'),'port':0x18eb});var socket=require(_0xfba1('0xc'))(new Redis(config[_0xfba1('0x9')]));require(_0xfba1('0xd'))[_0xfba1('0xe')](socket);function respondWithRpcPromise(_0x1e5c74,_0x1adc02,_0x5b7714){return new BPromise(function(_0xea676c,_0x4c0c7a){return client[_0xfba1('0xf')](_0x1e5c74,_0x5b7714)[_0xfba1('0x10')](function(_0x1a73d4){logger[_0xfba1('0x11')](_0xfba1('0x12'),_0x1adc02,'request\x20sent');logger[_0xfba1('0x13')](_0xfba1('0x14'),_0x1adc02,_0xfba1('0x15'),JSON[_0xfba1('0x16')](_0x1a73d4));if(_0x1a73d4[_0xfba1('0x17')]){if(_0x1a73d4[_0xfba1('0x17')][_0xfba1('0x18')]===0x1f4){logger[_0xfba1('0x17')](_0xfba1('0x12'),_0x1adc02,_0x1a73d4['error'][_0xfba1('0x19')]);return _0x4c0c7a(_0x1a73d4[_0xfba1('0x17')][_0xfba1('0x19')]);}logger[_0xfba1('0x17')](_0xfba1('0x12'),_0x1adc02,_0x1a73d4[_0xfba1('0x17')][_0xfba1('0x19')]);return _0xea676c(_0x1a73d4[_0xfba1('0x17')]['message']);}else{logger['info'](_0xfba1('0x12'),_0x1adc02,_0xfba1('0x15'));_0xea676c(_0x1a73d4[_0xfba1('0x1a')][_0xfba1('0x19')]);}})[_0xfba1('0x1b')](function(_0x372046){logger[_0xfba1('0x17')](_0xfba1('0x12'),_0x1adc02,_0x372046);_0x4c0c7a(_0x372046);});});}exports[_0xfba1('0x1c')]=function(_0x4892cb){var _0x1818c1=this;return new Promise(function(_0xcf5662,_0x510bf2){return db[_0xfba1('0x1d')][_0xfba1('0x1e')]({'raw':_0x4892cb[_0xfba1('0x1f')]?_0x4892cb[_0xfba1('0x1f')][_0xfba1('0x20')]===undefined?!![]:![]:!![],'where':_0x4892cb['options']?_0x4892cb[_0xfba1('0x1f')][_0xfba1('0x21')]||null:null,'attributes':_0x4892cb[_0xfba1('0x1f')]?_0x4892cb['options']['attributes']||null:null,'include':_0x4892cb[_0xfba1('0x1f')]?_0x4892cb['options']['include']?_[_0xfba1('0x22')](_0x4892cb[_0xfba1('0x1f')][_0xfba1('0x23')],function(_0x5549b9){return{'model':db[_0x5549b9[_0xfba1('0x24')]],'as':_0x5549b9['as'],'attributes':_0x5549b9[_0xfba1('0x25')],'include':_0x5549b9[_0xfba1('0x23')]?_[_0xfba1('0x22')](_0x5549b9[_0xfba1('0x23')],function(_0x373954){return{'model':db[_0x373954[_0xfba1('0x24')]],'as':_0x373954['as'],'attributes':_0x373954[_0xfba1('0x25')],'include':_0x373954[_0xfba1('0x23')]?_[_0xfba1('0x22')](_0x373954[_0xfba1('0x23')],function(_0x5bb43c){return{'model':db[_0x5bb43c[_0xfba1('0x24')]],'as':_0x5bb43c['as'],'attributes':_0x5bb43c['attributes']};}):[]};}):[]};}):[]:[]})[_0xfba1('0x10')](function(_0x410ec3){logger[_0xfba1('0x11')](_0xfba1('0x1c'),_0x4892cb);logger[_0xfba1('0x13')]('ShowWhatsappAccount',_0x4892cb,JSON['stringify'](_0x410ec3));_0xcf5662(_0x410ec3);})['catch'](function(_0x3f4af6){logger['error']('ShowWhatsappAccount',_0x3f4af6[_0xfba1('0x19')],_0x4892cb);_0x510bf2(_0x1818c1[_0xfba1('0x17')](0x1f4,_0x3f4af6['message']));});});}; \ No newline at end of file +var _0x3c19=['./whatsappAccount.socket','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','ShowWhatsappAccount','find','options','raw','where','attributes','include','model','map','then','stringify','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x5a0790,_0x5affbc){var _0x1e7e87=function(_0x3bc5d6){while(--_0x3bc5d6){_0x5a0790['push'](_0x5a0790['shift']());}};_0x1e7e87(++_0x5affbc);}(_0x3c19,0x11b));var _0x93c1=function(_0x53872d,_0x5798f2){_0x53872d=_0x53872d-0x0;var _0x3fa9e0=_0x3c19[_0x53872d];return _0x3fa9e0;};'use strict';var _=require(_0x93c1('0x0'));var util=require(_0x93c1('0x1'));var moment=require(_0x93c1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93c1('0x3'));var db=require(_0x93c1('0x4'))['db'];var utils=require(_0x93c1('0x5'));var logger=require(_0x93c1('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x93c1('0x7'));var client=jayson[_0x93c1('0x8')][_0x93c1('0x9')]({'port':0x232a});config[_0x93c1('0xa')]=_['defaults'](config[_0x93c1('0xa')],{'host':_0x93c1('0xb'),'port':0x18eb});var socket=require(_0x93c1('0xc'))(new Redis(config[_0x93c1('0xa')]));require(_0x93c1('0xd'))[_0x93c1('0xe')](socket);function respondWithRpcPromise(_0x1e5d50,_0x5b6214,_0x1e8ce4){return new BPromise(function(_0x5299bc,_0x4a49d3){return client[_0x93c1('0xf')](_0x1e5d50,_0x1e8ce4)['then'](function(_0xb8d36b){logger[_0x93c1('0x10')](_0x93c1('0x11'),_0x5b6214,_0x93c1('0x12'));logger[_0x93c1('0x13')](_0x93c1('0x14'),_0x5b6214,'request\x20sent',JSON['stringify'](_0xb8d36b));if(_0xb8d36b[_0x93c1('0x15')]){if(_0xb8d36b['error'][_0x93c1('0x16')]===0x1f4){logger[_0x93c1('0x15')](_0x93c1('0x11'),_0x5b6214,_0xb8d36b[_0x93c1('0x15')][_0x93c1('0x17')]);return _0x4a49d3(_0xb8d36b[_0x93c1('0x15')]['message']);}logger['error'](_0x93c1('0x11'),_0x5b6214,_0xb8d36b[_0x93c1('0x15')]['message']);return _0x5299bc(_0xb8d36b[_0x93c1('0x15')][_0x93c1('0x17')]);}else{logger[_0x93c1('0x10')](_0x93c1('0x11'),_0x5b6214,_0x93c1('0x12'));_0x5299bc(_0xb8d36b[_0x93c1('0x18')][_0x93c1('0x17')]);}})['catch'](function(_0x50777c){logger[_0x93c1('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x5b6214,_0x50777c);_0x4a49d3(_0x50777c);});});}exports[_0x93c1('0x19')]=function(_0x3ff067){var _0x5c7d7b=this;return new Promise(function(_0x804d20,_0x5911c3){return db['WhatsappAccount'][_0x93c1('0x1a')]({'raw':_0x3ff067[_0x93c1('0x1b')]?_0x3ff067['options'][_0x93c1('0x1c')]===undefined?!![]:![]:!![],'where':_0x3ff067['options']?_0x3ff067[_0x93c1('0x1b')][_0x93c1('0x1d')]||null:null,'attributes':_0x3ff067[_0x93c1('0x1b')]?_0x3ff067[_0x93c1('0x1b')][_0x93c1('0x1e')]||null:null,'include':_0x3ff067['options']?_0x3ff067[_0x93c1('0x1b')][_0x93c1('0x1f')]?_['map'](_0x3ff067['options'][_0x93c1('0x1f')],function(_0x34ce7a){return{'model':db[_0x34ce7a['model']],'as':_0x34ce7a['as'],'attributes':_0x34ce7a[_0x93c1('0x1e')],'include':_0x34ce7a[_0x93c1('0x1f')]?_['map'](_0x34ce7a['include'],function(_0x2c9182){return{'model':db[_0x2c9182[_0x93c1('0x20')]],'as':_0x2c9182['as'],'attributes':_0x2c9182['attributes'],'include':_0x2c9182[_0x93c1('0x1f')]?_[_0x93c1('0x21')](_0x2c9182[_0x93c1('0x1f')],function(_0x165390){return{'model':db[_0x165390[_0x93c1('0x20')]],'as':_0x165390['as'],'attributes':_0x165390['attributes']};}):[]};}):[]};}):[]:[]})[_0x93c1('0x22')](function(_0x18b822){logger[_0x93c1('0x10')](_0x93c1('0x19'),_0x3ff067);logger['debug']('ShowWhatsappAccount',_0x3ff067,JSON[_0x93c1('0x23')](_0x18b822));_0x804d20(_0x18b822);})[_0x93c1('0x24')](function(_0x233054){logger[_0x93c1('0x15')](_0x93c1('0x19'),_0x233054[_0x93c1('0x17')],_0x3ff067);_0x5911c3(_0x5c7d7b[_0x93c1('0x15')](0x1f4,_0x233054[_0x93c1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 8f4b549..14aee67 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 _0x30db=['removeListener','register','length','whatsappAccount:','save','remove','update','emit'];(function(_0x164b1b,_0x397909){var _0x3dc4ff=function(_0x5d90bb){while(--_0x5d90bb){_0x164b1b['push'](_0x164b1b['shift']());}};_0x3dc4ff(++_0x397909);}(_0x30db,0xd4));var _0xb30d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x30db[_0x57b54c];return _0x59cc19;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xb30d('0x0'),_0xb30d('0x1'),_0xb30d('0x2')];function createListener(_0x1a0b37,_0x17fb72){return function(_0x489fb6){_0x17fb72[_0xb30d('0x3')](_0x1a0b37,_0x489fb6);};}function removeListener(_0x17b079,_0x171207){return function(){WhatsappAccountEvents[_0xb30d('0x4')](_0x17b079,_0x171207);};}exports[_0xb30d('0x5')]=function(_0x323ee5){for(var _0x13f35f=0x0,_0x67f598=events[_0xb30d('0x6')];_0x13f35f<_0x67f598;_0x13f35f++){var _0xd224ae=events[_0x13f35f];var _0x1e78a4=createListener(_0xb30d('0x7')+_0xd224ae,_0x323ee5);WhatsappAccountEvents['on'](_0xd224ae,_0x1e78a4);}}; \ No newline at end of file +var _0x855f=['emit','register','./whatsappAccount.events','save','remove','update'];(function(_0x42cc6e,_0x33a0d7){var _0x2f9c58=function(_0x4becd7){while(--_0x4becd7){_0x42cc6e['push'](_0x42cc6e['shift']());}};_0x2f9c58(++_0x33a0d7);}(_0x855f,0x104));var _0xf855=function(_0x58b024,_0x598058){_0x58b024=_0x58b024-0x0;var _0x25af81=_0x855f[_0x58b024];return _0x25af81;};'use strict';var WhatsappAccountEvents=require(_0xf855('0x0'));var events=[_0xf855('0x1'),_0xf855('0x2'),_0xf855('0x3')];function createListener(_0x56b586,_0x4ba0fc){return function(_0x620582){_0x4ba0fc[_0xf855('0x4')](_0x56b586,_0x620582);};}function removeListener(_0x2af30b,_0xe3d30c){return function(){WhatsappAccountEvents['removeListener'](_0x2af30b,_0xe3d30c);};}exports[_0xf855('0x5')]=function(_0x2427ad){for(var _0x594560=0x0,_0x2b38c6=events['length'];_0x594560<_0x2b38c6;_0x594560++){var _0x26a99f=events[_0x594560];var _0x3b418b=createListener('whatsappAccount:'+_0x26a99f,_0x2427ad);WhatsappAccountEvents['on'](_0x26a99f,_0x3b418b);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index c6ffd7a..c7a8a86 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 _0x437d=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x1800b1,_0xa377fa){var _0x1ef6e0=function(_0x591e21){while(--_0x591e21){_0x1800b1['push'](_0x1800b1['shift']());}};_0x1ef6e0(++_0xa377fa);}(_0x437d,0x1ce));var _0xd437=function(_0x49b36c,_0x11bb2c){_0x49b36c=_0x49b36c-0x0;var _0x1d0c7d=_0x437d[_0x49b36c];return _0x1d0c7d;};'use strict';var multer=require(_0xd437('0x0'));var util=require(_0xd437('0x1'));var path=require(_0xd437('0x2'));var timeout=require(_0xd437('0x3'));var express=require(_0xd437('0x4'));var router=express[_0xd437('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd437('0x6'));var interaction=require(_0xd437('0x7'));var config=require(_0xd437('0x8'));var controller=require(_0xd437('0x9'));router[_0xd437('0xa')]('/',auth[_0xd437('0xb')](),controller[_0xd437('0xc')]);router[_0xd437('0xa')](_0xd437('0xd'),auth[_0xd437('0xb')](),controller[_0xd437('0xe')]);router[_0xd437('0xf')]('/',auth['isAuthenticated'](),controller[_0xd437('0x10')]);router[_0xd437('0x11')](_0xd437('0xd'),auth[_0xd437('0xb')](),controller['update']);router[_0xd437('0x12')](_0xd437('0xd'),auth['isAuthenticated'](),controller[_0xd437('0x13')]);module[_0xd437('0x14')]=router; \ No newline at end of file +var _0x901c=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','put','update','delete','exports','multer'];(function(_0x4a500b,_0x65d0e7){var _0x13c3ea=function(_0x5d1dcb){while(--_0x5d1dcb){_0x4a500b['push'](_0x4a500b['shift']());}};_0x13c3ea(++_0x65d0e7);}(_0x901c,0x179));var _0xc901=function(_0x41e468,_0x318929){_0x41e468=_0x41e468-0x0;var _0x2bd26=_0x901c[_0x41e468];return _0x2bd26;};'use strict';var multer=require(_0xc901('0x0'));var util=require('util');var path=require(_0xc901('0x1'));var timeout=require('connect-timeout');var express=require(_0xc901('0x2'));var router=express[_0xc901('0x3')]();var fs_extra=require(_0xc901('0x4'));var auth=require(_0xc901('0x5'));var interaction=require(_0xc901('0x6'));var config=require(_0xc901('0x7'));var controller=require('./whatsappApplication.controller');router[_0xc901('0x8')]('/',auth['isAuthenticated'](),controller[_0xc901('0x9')]);router[_0xc901('0x8')](_0xc901('0xa'),auth[_0xc901('0xb')](),controller[_0xc901('0xc')]);router[_0xc901('0xd')]('/',auth[_0xc901('0xb')](),controller['create']);router[_0xc901('0xe')](_0xc901('0xa'),auth[_0xc901('0xb')](),controller[_0xc901('0xf')]);router[_0xc901('0x10')]('/:id',auth[_0xc901('0xb')](),controller['destroy']);module[_0xc901('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 92dc8b0..836c6e3 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 _0x31de=['sequelize','STRING','noop','TEXT','*,*,*,*'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x31de,0xf0));var _0xe31d=function(_0x270411,_0x5652fa){_0x270411=_0x270411-0x0;var _0x47d8c9=_0x31de[_0x270411];return _0x47d8c9;};'use strict';var Sequelize=require(_0xe31d('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xe31d('0x1')],'allowNull':![],'defaultValue':_0xe31d('0x2')},'appdata':{'type':Sequelize[_0xe31d('0x3')]()},'description':{'type':Sequelize[_0xe31d('0x1')]},'interval':{'type':Sequelize[_0xe31d('0x1')],'defaultValue':_0xe31d('0x4')}}; \ No newline at end of file +var _0xbebb=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x5d4963,_0x14173c){var _0x2ec117=function(_0x32477b){while(--_0x32477b){_0x5d4963['push'](_0x5d4963['shift']());}};_0x2ec117(++_0x14173c);}(_0xbebb,0x101));var _0xbbeb=function(_0x5a0593,_0x18c56b){_0x5a0593=_0x5a0593-0x0;var _0x1567dd=_0xbebb[_0x5a0593];return _0x1567dd;};'use strict';var Sequelize=require(_0xbbeb('0x0'));module[_0xbbeb('0x1')]={'priority':{'type':Sequelize[_0xbbeb('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbbeb('0x3')],'allowNull':![],'defaultValue':_0xbbeb('0x4')},'appdata':{'type':Sequelize[_0xbbeb('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbbeb('0x3')],'defaultValue':_0xbbeb('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index b95439e..e485882 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 _0x34f0=['model','query','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','options','WhatsappApplication','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','update','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','then','destroy','error','name','send','index','rawAttributes','keys','filters','attributes','intersection'];(function(_0x24d3d3,_0x4b5031){var _0x55dc13=function(_0x42541a){while(--_0x42541a){_0x24d3d3['push'](_0x24d3d3['shift']());}};_0x55dc13(++_0x4b5031);}(_0x34f0,0x13b));var _0x034f=function(_0x4ce819,_0x43654f){_0x4ce819=_0x4ce819-0x0;var _0x5f06b7=_0x34f0[_0x4ce819];return _0x5f06b7;};'use strict';var emlformat=require(_0x034f('0x0'));var rimraf=require(_0x034f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x034f('0x2'));var rp=require('request-promise');var moment=require(_0x034f('0x3'));var BPromise=require(_0x034f('0x4'));var Mustache=require(_0x034f('0x5'));var util=require(_0x034f('0x6'));var path=require(_0x034f('0x7'));var sox=require('sox');var csv=require(_0x034f('0x8'));var ejs=require(_0x034f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x034f('0xa'));var squel=require('squel');var crypto=require(_0x034f('0xb'));var jsforce=require(_0x034f('0xc'));var deskjs=require(_0x034f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x034f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x034f('0xf'));var as=require(_0x034f('0x10'));var hardwareService=require(_0x034f('0x11'));var logger=require(_0x034f('0x12'))(_0x034f('0x13'));var utils=require('../../config/utils');var config=require(_0x034f('0x14'));var licenseUtil=require(_0x034f('0x15'));var db=require(_0x034f('0x16'))['db'];function respondWithStatusCode(_0x568180,_0x720269){_0x720269=_0x720269||0xcc;return function(_0x4d1f54){if(_0x4d1f54){return _0x568180[_0x034f('0x17')](_0x720269);}return _0x568180[_0x034f('0x18')](_0x720269)[_0x034f('0x19')]();};}function respondWithResult(_0x29fe43,_0xe5174c){_0xe5174c=_0xe5174c||0xc8;return function(_0x15a05e){if(_0x15a05e){return _0x29fe43[_0x034f('0x18')](_0xe5174c)[_0x034f('0x1a')](_0x15a05e);}};}function respondWithFilteredResult(_0x5bc410,_0x538e89){return function(_0x101a1e){if(_0x101a1e){var _0x3b911f=typeof _0x538e89[_0x034f('0x1b')]==='undefined'&&typeof _0x538e89['limit']===_0x034f('0x1c');var _0x46826f=_0x101a1e['count'];var _0xbf8794=_0x3b911f?0x0:_0x538e89['offset'];var _0x8500cb=_0x3b911f?_0x101a1e[_0x034f('0x1d')]:_0x538e89[_0x034f('0x1b')]+_0x538e89['limit'];var _0x21d0fc;if(_0x8500cb>=_0x46826f){_0x8500cb=_0x46826f;_0x21d0fc=0xc8;}else{_0x21d0fc=0xce;}_0x5bc410[_0x034f('0x18')](_0x21d0fc);return _0x5bc410[_0x034f('0x1e')](_0x034f('0x1f'),_0xbf8794+'-'+_0x8500cb+'/'+_0x46826f)[_0x034f('0x1a')](_0x101a1e);}return null;};}function patchUpdates(_0x5f442b){return function(_0x1b67ae){try{jsonpatch[_0x034f('0x20')](_0x1b67ae,_0x5f442b,!![]);}catch(_0x32c4ad){return BPromise['reject'](_0x32c4ad);}return _0x1b67ae[_0x034f('0x21')]();};}function saveUpdates(_0x1e9abb,_0xaeb946){return function(_0x4f836a){if(_0x4f836a){return _0x4f836a['update'](_0x1e9abb)[_0x034f('0x22')](function(_0x586598){return _0x586598;});}return null;};}function removeEntity(_0x2d951b,_0x1fd774){return function(_0x33d2cc){if(_0x33d2cc){return _0x33d2cc[_0x034f('0x23')]()[_0x034f('0x22')](function(){_0x2d951b[_0x034f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x880c16,_0x3bfb02){return function(_0x3ffdd5){if(!_0x3ffdd5){_0x880c16[_0x034f('0x17')](0x194);}return _0x3ffdd5;};}function handleError(_0x54dee1,_0x3414e8){_0x3414e8=_0x3414e8||0x1f4;return function(_0x8eacf2){logger[_0x034f('0x24')](_0x8eacf2['stack']);if(_0x8eacf2[_0x034f('0x25')]){delete _0x8eacf2[_0x034f('0x25')];}_0x54dee1[_0x034f('0x18')](_0x3414e8)[_0x034f('0x26')](_0x8eacf2);};}exports[_0x034f('0x27')]=function(_0xdf5fbb,_0xcfb1cb){var _0x172c24={},_0xebc249={},_0x729edb={'count':0x0,'rows':[]};var _0x17d5f6=_['map'](db['WhatsappApplication'][_0x034f('0x28')],function(_0x50552b){return{'name':_0x50552b['fieldName'],'type':_0x50552b['type']['key']};});_0xebc249['model']=_['map'](_0x17d5f6,_0x034f('0x25'));_0xebc249['query']=_[_0x034f('0x29')](_0xdf5fbb['query']);_0xebc249[_0x034f('0x2a')]=_['intersection'](_0xebc249['model'],_0xebc249['query']);_0x172c24[_0x034f('0x2b')]=_[_0x034f('0x2c')](_0xebc249[_0x034f('0x2d')],qs['fields'](_0xdf5fbb[_0x034f('0x2e')]['fields']));_0x172c24['attributes']=_0x172c24[_0x034f('0x2b')][_0x034f('0x2f')]?_0x172c24[_0x034f('0x2b')]:_0xebc249[_0x034f('0x2d')];if(!_0xdf5fbb[_0x034f('0x2e')][_0x034f('0x30')](_0x034f('0x31'))){_0x172c24[_0x034f('0x32')]=qs[_0x034f('0x32')](_0xdf5fbb[_0x034f('0x2e')][_0x034f('0x32')]);_0x172c24[_0x034f('0x1b')]=qs[_0x034f('0x1b')](_0xdf5fbb[_0x034f('0x2e')][_0x034f('0x1b')]);}_0x172c24['order']=qs[_0x034f('0x33')](_0xdf5fbb[_0x034f('0x2e')][_0x034f('0x33')]);_0x172c24[_0x034f('0x34')]=qs['filters'](_[_0x034f('0x35')](_0xdf5fbb[_0x034f('0x2e')],_0xebc249[_0x034f('0x2a')]),_0x17d5f6);if(_0xdf5fbb[_0x034f('0x2e')][_0x034f('0x36')]){_0x172c24[_0x034f('0x34')]=_[_0x034f('0x37')](_0x172c24[_0x034f('0x34')],{'$or':_[_0x034f('0x38')](_0x17d5f6,function(_0x3895fb){if(_0x3895fb[_0x034f('0x39')]!=='VIRTUAL'){var _0x52a2f5={};_0x52a2f5[_0x3895fb['name']]={'$like':'%'+_0xdf5fbb[_0x034f('0x2e')][_0x034f('0x36')]+'%'};return _0x52a2f5;}})});}_0x172c24=_['merge']({},_0x172c24,_0xdf5fbb[_0x034f('0x3a')]);var _0x3e2340={'where':_0x172c24[_0x034f('0x34')]};return db[_0x034f('0x3b')]['count'](_0x3e2340)[_0x034f('0x22')](function(_0xc4e184){_0x729edb[_0x034f('0x1d')]=_0xc4e184;if(_0xdf5fbb[_0x034f('0x2e')][_0x034f('0x3c')]){_0x172c24[_0x034f('0x3d')]=[{'all':!![]}];}return db[_0x034f('0x3b')][_0x034f('0x3e')](_0x172c24);})[_0x034f('0x22')](function(_0xce97b5){_0x729edb[_0x034f('0x3f')]=_0xce97b5;return _0x729edb;})[_0x034f('0x22')](respondWithFilteredResult(_0xcfb1cb,_0x172c24))[_0x034f('0x40')](handleError(_0xcfb1cb,null));};exports[_0x034f('0x41')]=function(_0x40ee54,_0xa00762){var _0x3c784d={'raw':!![],'where':{'id':_0x40ee54[_0x034f('0x42')]['id']}},_0x53da60={};_0x53da60['model']=_[_0x034f('0x29')](db[_0x034f('0x3b')][_0x034f('0x28')]);_0x53da60[_0x034f('0x2e')]=_[_0x034f('0x29')](_0x40ee54[_0x034f('0x2e')]);_0x53da60[_0x034f('0x2a')]=_[_0x034f('0x2c')](_0x53da60[_0x034f('0x2d')],_0x53da60['query']);_0x3c784d[_0x034f('0x2b')]=_['intersection'](_0x53da60[_0x034f('0x2d')],qs[_0x034f('0x43')](_0x40ee54[_0x034f('0x2e')][_0x034f('0x43')]));_0x3c784d[_0x034f('0x2b')]=_0x3c784d['attributes'][_0x034f('0x2f')]?_0x3c784d[_0x034f('0x2b')]:_0x53da60[_0x034f('0x2d')];if(_0x40ee54[_0x034f('0x2e')][_0x034f('0x3c')]){_0x3c784d[_0x034f('0x3d')]=[{'all':!![]}];}_0x3c784d=_[_0x034f('0x37')]({},_0x3c784d,_0x40ee54[_0x034f('0x3a')]);return db[_0x034f('0x3b')][_0x034f('0x44')](_0x3c784d)[_0x034f('0x22')](handleEntityNotFound(_0xa00762,null))[_0x034f('0x22')](respondWithResult(_0xa00762,null))[_0x034f('0x40')](handleError(_0xa00762,null));};exports[_0x034f('0x45')]=function(_0x5a8ea5,_0x2358c2){return db['WhatsappApplication'][_0x034f('0x45')](_0x5a8ea5[_0x034f('0x46')],{})[_0x034f('0x22')](respondWithResult(_0x2358c2,0xc9))[_0x034f('0x40')](handleError(_0x2358c2,null));};exports[_0x034f('0x47')]=function(_0x4bb80d,_0x38a48f){if(_0x4bb80d['body']['id']){delete _0x4bb80d['body']['id'];}return db[_0x034f('0x3b')][_0x034f('0x44')]({'where':{'id':_0x4bb80d[_0x034f('0x42')]['id']}})[_0x034f('0x22')](handleEntityNotFound(_0x38a48f,null))[_0x034f('0x22')](saveUpdates(_0x4bb80d[_0x034f('0x46')],null))[_0x034f('0x22')](respondWithResult(_0x38a48f,null))[_0x034f('0x40')](handleError(_0x38a48f,null));};exports[_0x034f('0x23')]=function(_0x174a65,_0x47ec95){return db[_0x034f('0x3b')][_0x034f('0x44')]({'where':{'id':_0x174a65[_0x034f('0x42')]['id']}})[_0x034f('0x22')](handleEntityNotFound(_0x47ec95,null))[_0x034f('0x22')](removeEntity(_0x47ec95,null))['catch'](handleError(_0x47ec95,null));}; \ No newline at end of file +var _0x38b2=['rawAttributes','type','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','then','includeAll','include','findAll','rows','show','create','body','catch','find','params','destroy','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','count','set','apply','reject','save','update','end','error','stack','name','send','index','map','WhatsappApplication'];(function(_0xc731bb,_0x5891d4){var _0xfe197d=function(_0x2cd6a7){while(--_0x2cd6a7){_0xc731bb['push'](_0xc731bb['shift']());}};_0xfe197d(++_0x5891d4);}(_0x38b2,0xf6));var _0x238b=function(_0x4c96db,_0x290ab2){_0x4c96db=_0x4c96db-0x0;var _0x4c30dc=_0x38b2[_0x4c96db];return _0x4c30dc;};'use strict';var emlformat=require(_0x238b('0x0'));var rimraf=require(_0x238b('0x1'));var zipdir=require(_0x238b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x238b('0x3'));var BPromise=require(_0x238b('0x4'));var Mustache=require('mustache');var util=require(_0x238b('0x5'));var path=require('path');var sox=require(_0x238b('0x6'));var csv=require(_0x238b('0x7'));var ejs=require(_0x238b('0x8'));var fs=require('fs');var fs_extra=require(_0x238b('0x9'));var _=require('lodash');var squel=require(_0x238b('0xa'));var crypto=require(_0x238b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x238b('0xc'));var toCsv=require(_0x238b('0x7'));var querystring=require(_0x238b('0xd'));var Papa=require(_0x238b('0xe'));var Redis=require(_0x238b('0xf'));var authService=require(_0x238b('0x10'));var qs=require(_0x238b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x238b('0x12'));var logger=require(_0x238b('0x13'))(_0x238b('0x14'));var utils=require(_0x238b('0x15'));var config=require(_0x238b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x238b('0x17'))['db'];function respondWithStatusCode(_0x1280d5,_0x3a080c){_0x3a080c=_0x3a080c||0xcc;return function(_0x42af62){if(_0x42af62){return _0x1280d5['sendStatus'](_0x3a080c);}return _0x1280d5['status'](_0x3a080c)['end']();};}function respondWithResult(_0x1a04f2,_0x65d8d2){_0x65d8d2=_0x65d8d2||0xc8;return function(_0x438be2){if(_0x438be2){return _0x1a04f2[_0x238b('0x18')](_0x65d8d2)[_0x238b('0x19')](_0x438be2);}};}function respondWithFilteredResult(_0x68824,_0x406840){return function(_0x24d857){if(_0x24d857){var _0x49d9fd=typeof _0x406840[_0x238b('0x1a')]==='undefined'&&typeof _0x406840[_0x238b('0x1b')]==='undefined';var _0x2ada3b=_0x24d857['count'];var _0x92d5b4=_0x49d9fd?0x0:_0x406840[_0x238b('0x1a')];var _0x37bfd8=_0x49d9fd?_0x24d857[_0x238b('0x1c')]:_0x406840[_0x238b('0x1a')]+_0x406840[_0x238b('0x1b')];var _0x576fae;if(_0x37bfd8>=_0x2ada3b){_0x37bfd8=_0x2ada3b;_0x576fae=0xc8;}else{_0x576fae=0xce;}_0x68824[_0x238b('0x18')](_0x576fae);return _0x68824[_0x238b('0x1d')]('Content-Range',_0x92d5b4+'-'+_0x37bfd8+'/'+_0x2ada3b)['json'](_0x24d857);}return null;};}function patchUpdates(_0xeb6834){return function(_0x162754){try{jsonpatch[_0x238b('0x1e')](_0x162754,_0xeb6834,!![]);}catch(_0x8ee6){return BPromise[_0x238b('0x1f')](_0x8ee6);}return _0x162754[_0x238b('0x20')]();};}function saveUpdates(_0xb1ad7a,_0x2b8e7c){return function(_0x367285){if(_0x367285){return _0x367285[_0x238b('0x21')](_0xb1ad7a)['then'](function(_0x59c751){return _0x59c751;});}return null;};}function removeEntity(_0x1f29da,_0x1ae511){return function(_0x4d214c){if(_0x4d214c){return _0x4d214c['destroy']()['then'](function(){_0x1f29da[_0x238b('0x18')](0xcc)[_0x238b('0x22')]();});}};}function handleEntityNotFound(_0xe167de,_0xa29a15){return function(_0x22d5e9){if(!_0x22d5e9){_0xe167de['sendStatus'](0x194);}return _0x22d5e9;};}function handleError(_0x4a6dd4,_0x436303){_0x436303=_0x436303||0x1f4;return function(_0x3c9e76){logger[_0x238b('0x23')](_0x3c9e76[_0x238b('0x24')]);if(_0x3c9e76[_0x238b('0x25')]){delete _0x3c9e76[_0x238b('0x25')];}_0x4a6dd4['status'](_0x436303)[_0x238b('0x26')](_0x3c9e76);};}exports[_0x238b('0x27')]=function(_0x1c7a56,_0x43b85f){var _0x103ca8={},_0x2a0728={},_0x2aaf83={'count':0x0,'rows':[]};var _0xf277bd=_[_0x238b('0x28')](db[_0x238b('0x29')][_0x238b('0x2a')],function(_0xf0d1bb){return{'name':_0xf0d1bb['fieldName'],'type':_0xf0d1bb[_0x238b('0x2b')]['key']};});_0x2a0728[_0x238b('0x2c')]=_[_0x238b('0x28')](_0xf277bd,_0x238b('0x25'));_0x2a0728['query']=_['keys'](_0x1c7a56['query']);_0x2a0728['filters']=_[_0x238b('0x2d')](_0x2a0728['model'],_0x2a0728[_0x238b('0x2e')]);_0x103ca8[_0x238b('0x2f')]=_[_0x238b('0x2d')](_0x2a0728[_0x238b('0x2c')],qs[_0x238b('0x30')](_0x1c7a56['query']['fields']));_0x103ca8[_0x238b('0x2f')]=_0x103ca8[_0x238b('0x2f')][_0x238b('0x31')]?_0x103ca8['attributes']:_0x2a0728[_0x238b('0x2c')];if(!_0x1c7a56[_0x238b('0x2e')][_0x238b('0x32')](_0x238b('0x33'))){_0x103ca8['limit']=qs[_0x238b('0x1b')](_0x1c7a56['query'][_0x238b('0x1b')]);_0x103ca8[_0x238b('0x1a')]=qs[_0x238b('0x1a')](_0x1c7a56[_0x238b('0x2e')][_0x238b('0x1a')]);}_0x103ca8[_0x238b('0x34')]=qs[_0x238b('0x35')](_0x1c7a56[_0x238b('0x2e')][_0x238b('0x35')]);_0x103ca8['where']=qs[_0x238b('0x36')](_[_0x238b('0x37')](_0x1c7a56[_0x238b('0x2e')],_0x2a0728[_0x238b('0x36')]),_0xf277bd);if(_0x1c7a56[_0x238b('0x2e')][_0x238b('0x38')]){_0x103ca8[_0x238b('0x39')]=_['merge'](_0x103ca8[_0x238b('0x39')],{'$or':_[_0x238b('0x28')](_0xf277bd,function(_0x1447ec){if(_0x1447ec[_0x238b('0x2b')]!=='VIRTUAL'){var _0xb4a0d5={};_0xb4a0d5[_0x1447ec['name']]={'$like':'%'+_0x1c7a56[_0x238b('0x2e')]['filter']+'%'};return _0xb4a0d5;}})});}_0x103ca8=_[_0x238b('0x3a')]({},_0x103ca8,_0x1c7a56[_0x238b('0x3b')]);var _0xcec411={'where':_0x103ca8[_0x238b('0x39')]};return db['WhatsappApplication']['count'](_0xcec411)[_0x238b('0x3c')](function(_0x5938a5){_0x2aaf83[_0x238b('0x1c')]=_0x5938a5;if(_0x1c7a56['query'][_0x238b('0x3d')]){_0x103ca8[_0x238b('0x3e')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x238b('0x3f')](_0x103ca8);})[_0x238b('0x3c')](function(_0x1fbff5){_0x2aaf83[_0x238b('0x40')]=_0x1fbff5;return _0x2aaf83;})[_0x238b('0x3c')](respondWithFilteredResult(_0x43b85f,_0x103ca8))['catch'](handleError(_0x43b85f,null));};exports[_0x238b('0x41')]=function(_0x27eda5,_0x299585){var _0x5053ee={'raw':!![],'where':{'id':_0x27eda5['params']['id']}},_0x247967={};_0x247967[_0x238b('0x2c')]=_['keys'](db[_0x238b('0x29')][_0x238b('0x2a')]);_0x247967['query']=_['keys'](_0x27eda5[_0x238b('0x2e')]);_0x247967[_0x238b('0x36')]=_['intersection'](_0x247967[_0x238b('0x2c')],_0x247967[_0x238b('0x2e')]);_0x5053ee['attributes']=_['intersection'](_0x247967[_0x238b('0x2c')],qs['fields'](_0x27eda5[_0x238b('0x2e')][_0x238b('0x30')]));_0x5053ee[_0x238b('0x2f')]=_0x5053ee[_0x238b('0x2f')][_0x238b('0x31')]?_0x5053ee[_0x238b('0x2f')]:_0x247967[_0x238b('0x2c')];if(_0x27eda5[_0x238b('0x2e')][_0x238b('0x3d')]){_0x5053ee['include']=[{'all':!![]}];}_0x5053ee=_['merge']({},_0x5053ee,_0x27eda5['options']);return db[_0x238b('0x29')]['find'](_0x5053ee)['then'](handleEntityNotFound(_0x299585,null))[_0x238b('0x3c')](respondWithResult(_0x299585,null))['catch'](handleError(_0x299585,null));};exports[_0x238b('0x42')]=function(_0x515e4e,_0x426699){return db[_0x238b('0x29')][_0x238b('0x42')](_0x515e4e[_0x238b('0x43')],{})[_0x238b('0x3c')](respondWithResult(_0x426699,0xc9))[_0x238b('0x44')](handleError(_0x426699,null));};exports[_0x238b('0x21')]=function(_0x1d325f,_0x1b1b26){if(_0x1d325f[_0x238b('0x43')]['id']){delete _0x1d325f[_0x238b('0x43')]['id'];}return db[_0x238b('0x29')][_0x238b('0x45')]({'where':{'id':_0x1d325f[_0x238b('0x46')]['id']}})[_0x238b('0x3c')](handleEntityNotFound(_0x1b1b26,null))[_0x238b('0x3c')](saveUpdates(_0x1d325f[_0x238b('0x43')],null))[_0x238b('0x3c')](respondWithResult(_0x1b1b26,null))[_0x238b('0x44')](handleError(_0x1b1b26,null));};exports[_0x238b('0x47')]=function(_0x4cdc02,_0x4a9357){return db[_0x238b('0x29')][_0x238b('0x45')]({'where':{'id':_0x4cdc02[_0x238b('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a9357,null))[_0x238b('0x3c')](removeEntity(_0x4a9357,null))[_0x238b('0x44')](handleError(_0x4a9357,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 35db464..27d77b9 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 _0x07c3=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1f9172,_0x982504){var _0x5c1f6d=function(_0x4e7c2c){while(--_0x4e7c2c){_0x1f9172['push'](_0x1f9172['shift']());}};_0x5c1f6d(++_0x982504);}(_0x07c3,0x1bf));var _0x307c=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x07c3[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var logger=require(_0x307c('0x2'))(_0x307c('0x3'));var moment=require(_0x307c('0x4'));var BPromise=require(_0x307c('0x5'));var rp=require(_0x307c('0x6'));var fs=require('fs');var path=require(_0x307c('0x7'));var rimraf=require('rimraf');var config=require(_0x307c('0x8'));var attributes=require(_0x307c('0x9'));module[_0x307c('0xa')]=function(_0x317066,_0x250f22){return _0x317066[_0x307c('0xb')](_0x307c('0xc'),attributes,{'tableName':_0x307c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x307c('0xe'),'collate':_0x307c('0xf')});}; \ No newline at end of file +var _0xeb0d=['../../config/environment','./whatsappApplication.attributes','exports','define','whatsapp_applications','utf8mb4','lodash','moment','bluebird','path','rimraf'];(function(_0x53f608,_0x256def){var _0x495b7d=function(_0x467eab){while(--_0x467eab){_0x53f608['push'](_0x53f608['shift']());}};_0x495b7d(++_0x256def);}(_0xeb0d,0xe2));var _0xdeb0=function(_0xfc88e5,_0x36cd00){_0xfc88e5=_0xfc88e5-0x0;var _0x10b302=_0xeb0d[_0xfc88e5];return _0x10b302;};'use strict';var _=require(_0xdeb0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xdeb0('0x1'));var BPromise=require(_0xdeb0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdeb0('0x3'));var rimraf=require(_0xdeb0('0x4'));var config=require(_0xdeb0('0x5'));var attributes=require(_0xdeb0('0x6'));module[_0xdeb0('0x7')]=function(_0x13d486,_0xc48108){return _0x13d486[_0xdeb0('0x8')]('WhatsappApplication',attributes,{'tableName':_0xdeb0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdeb0('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 5dfc670..5eeba28 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 _0xb821=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','util','moment','ioredis'];(function(_0x146915,_0x3546ae){var _0x3f3d01=function(_0x4a58e8){while(--_0x4a58e8){_0x146915['push'](_0x146915['shift']());}};_0x3f3d01(++_0x3546ae);}(_0xb821,0xa7));var _0x1b82=function(_0x173b2d,_0x14ee0a){_0x173b2d=_0x173b2d-0x0;var _0x53f318=_0xb821[_0x173b2d];return _0x53f318;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b82('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b82('0x3'))(_0x1b82('0x4'));var config=require(_0x1b82('0x5'));var jayson=require(_0x1b82('0x6'));var client=jayson['client'][_0x1b82('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x192434,_0x202a5f,_0x3632dd){return new BPromise(function(_0x18f45f,_0x7b87e8){return client[_0x1b82('0x8')](_0x192434,_0x3632dd)[_0x1b82('0x9')](function(_0x141673){logger['info'](_0x1b82('0xa'),_0x202a5f,_0x1b82('0xb'));logger[_0x1b82('0xc')](_0x1b82('0xd'),_0x202a5f,_0x1b82('0xb'),JSON[_0x1b82('0xe')](_0x141673));if(_0x141673[_0x1b82('0xf')]){if(_0x141673[_0x1b82('0xf')]['code']===0x1f4){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);return _0x7b87e8(_0x141673['error'][_0x1b82('0x10')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x202a5f,_0x141673[_0x1b82('0xf')]['message']);return _0x18f45f(_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);}else{logger['info'](_0x1b82('0xa'),_0x202a5f,'request\x20sent');_0x18f45f(_0x141673['result'][_0x1b82('0x10')]);}})['catch'](function(_0x111247){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x111247);_0x7b87e8(_0x111247);});});} \ No newline at end of file +var _0x98a8=['request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x261bcb,_0x10b150){var _0x223820=function(_0x22b551){while(--_0x22b551){_0x261bcb['push'](_0x261bcb['shift']());}};_0x223820(++_0x10b150);}(_0x98a8,0x12c));var _0x898a=function(_0x18f925,_0x923aec){_0x18f925=_0x18f925-0x0;var _0x1f1be6=_0x98a8[_0x18f925];return _0x1f1be6;};'use strict';var _=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var moment=require(_0x898a('0x2'));var BPromise=require(_0x898a('0x3'));var rs=require(_0x898a('0x4'));var fs=require('fs');var Redis=require(_0x898a('0x5'));var db=require(_0x898a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x898a('0x7'))(_0x898a('0x8'));var config=require(_0x898a('0x9'));var jayson=require(_0x898a('0xa'));var client=jayson[_0x898a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aadc2,_0x564583,_0xfa8c50){return new BPromise(function(_0x4fbce5,_0x42021d){return client[_0x898a('0xc')](_0x3aadc2,_0xfa8c50)[_0x898a('0xd')](function(_0x96b636){logger[_0x898a('0xe')](_0x898a('0xf'),_0x564583,_0x898a('0x10'));logger[_0x898a('0x11')](_0x898a('0x12'),_0x564583,'request\x20sent',JSON[_0x898a('0x13')](_0x96b636));if(_0x96b636['error']){if(_0x96b636[_0x898a('0x14')]['code']===0x1f4){logger[_0x898a('0x14')](_0x898a('0xf'),_0x564583,_0x96b636[_0x898a('0x14')]['message']);return _0x42021d(_0x96b636['error']['message']);}logger[_0x898a('0x14')](_0x898a('0xf'),_0x564583,_0x96b636[_0x898a('0x14')][_0x898a('0x15')]);return _0x4fbce5(_0x96b636[_0x898a('0x14')][_0x898a('0x15')]);}else{logger['info'](_0x898a('0xf'),_0x564583,'request\x20sent');_0x4fbce5(_0x96b636[_0x898a('0x16')]['message']);}})[_0x898a('0x17')](function(_0x4fb05b){logger[_0x898a('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x564583,_0x4fb05b);_0x42021d(_0x4fb05b);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 0b63d94..e4c5460 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 _0x6c7b=['/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','whatsapp','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages'];(function(_0x248caa,_0x1bdac7){var _0x1c049a=function(_0x33b56a){while(--_0x33b56a){_0x248caa['push'](_0x248caa['shift']());}};_0x1c049a(++_0x1bdac7);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x11c803,_0x236a36){_0x11c803=_0x11c803-0x0;var _0x4619b6=_0x6c7b[_0x11c803];return _0x4619b6;};'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('0x6')](_0xb6c7('0xc'),auth['isAuthenticated'](),controller['getMessages']);router[_0xb6c7('0x6')](_0xb6c7('0xd'),auth[_0xb6c7('0x7')](),controller[_0xb6c7('0xe')]);router[_0xb6c7('0xf')]('/',auth[_0xb6c7('0x7')](),controller[_0xb6c7('0x10')]);router['post'](_0xb6c7('0xc'),auth[_0xb6c7('0x7')](),controller[_0xb6c7('0x11')]);router[_0xb6c7('0xf')](_0xb6c7('0x12'),auth[_0xb6c7('0x7')](),interaction[_0xb6c7('0x13')]('whatsapp',_0xb6c7('0x14')),controller['addTags']);router['put']('/:id',auth[_0xb6c7('0x7')](),interaction['tracked'](_0xb6c7('0x15'),_0xb6c7('0x16')),controller[_0xb6c7('0x17')]);router[_0xb6c7('0x18')](_0xb6c7('0xa'),auth[_0xb6c7('0x7')](),interaction[_0xb6c7('0x13')](_0xb6c7('0x15'),_0xb6c7('0x19')),controller[_0xb6c7('0x1a')]);router[_0xb6c7('0x18')](_0xb6c7('0x12'),auth[_0xb6c7('0x7')](),controller['removeTags']);module[_0xb6c7('0x1b')]=router; \ No newline at end of file +var _0x7278=['/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','/describe','describe','/:id/messages','getMessages','/:id/download','download','create','post','addMessage'];(function(_0x4ae077,_0x39c0f0){var _0x8964e2=function(_0x2a0e70){while(--_0x2a0e70){_0x4ae077['push'](_0x4ae077['shift']());}};_0x8964e2(++_0x39c0f0);}(_0x7278,0x161));var _0x8727=function(_0x486c8f,_0x1cc73b){_0x486c8f=_0x486c8f-0x0;var _0x236d79=_0x7278[_0x486c8f];return _0x236d79;};'use strict';var multer=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var path=require(_0x8727('0x2'));var timeout=require(_0x8727('0x3'));var express=require(_0x8727('0x4'));var router=express['Router']();var fs_extra=require(_0x8727('0x5'));var auth=require(_0x8727('0x6'));var interaction=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var controller=require(_0x8727('0x9'));router[_0x8727('0xa')]('/',auth[_0x8727('0xb')](),controller['index']);router[_0x8727('0xa')](_0x8727('0xc'),auth[_0x8727('0xb')](),controller[_0x8727('0xd')]);router[_0x8727('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8727('0xa')](_0x8727('0xe'),auth[_0x8727('0xb')](),controller[_0x8727('0xf')]);router[_0x8727('0xa')](_0x8727('0x10'),auth[_0x8727('0xb')](),controller[_0x8727('0x11')]);router['post']('/',auth[_0x8727('0xb')](),controller[_0x8727('0x12')]);router[_0x8727('0x13')]('/:id/messages',auth[_0x8727('0xb')](),controller[_0x8727('0x14')]);router['post'](_0x8727('0x15'),auth[_0x8727('0xb')](),interaction[_0x8727('0x16')](_0x8727('0x17'),_0x8727('0x18')),controller[_0x8727('0x19')]);router[_0x8727('0x1a')](_0x8727('0x1b'),auth[_0x8727('0xb')](),interaction[_0x8727('0x16')]('whatsapp',_0x8727('0x1c')),controller[_0x8727('0x1d')]);router[_0x8727('0x1e')](_0x8727('0x1b'),auth[_0x8727('0xb')](),interaction[_0x8727('0x16')]('whatsapp','whatsappinteraction:destroy'),controller[_0x8727('0x1f')]);router['delete'](_0x8727('0x15'),auth[_0x8727('0xb')](),controller[_0x8727('0x20')]);module[_0x8727('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 332f78d..f7d00ac 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 _0x47d6=['STRING','ENUM','out','INTEGER','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x159091,_0x4b3ee7){var _0x553c21=function(_0x1b5483){while(--_0x1b5483){_0x159091['push'](_0x159091['shift']());}};_0x553c21(++_0x4b3ee7);}(_0x47d6,0x13f));var _0x647d=function(_0x51dd7e,_0xbe3a73){_0x51dd7e=_0x51dd7e-0x0;var _0x4b9ec8=_0x47d6[_0x51dd7e];return _0x4b9ec8;};'use strict';var Sequelize=require(_0x647d('0x0'));var moment=require(_0x647d('0x1'));module[_0x647d('0x2')]={'closed':{'type':Sequelize[_0x647d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x647d('0x4')]},'disposition':{'type':Sequelize[_0x647d('0x5')]},'secondDisposition':{'type':Sequelize[_0x647d('0x5')]},'thirdDisposition':{'type':Sequelize[_0x647d('0x5')]},'note':{'type':Sequelize[_0x647d('0x5')]},'phone':{'type':Sequelize[_0x647d('0x5')]},'read1stAt':{'type':Sequelize[_0x647d('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x647d('0x6')]('in',_0x647d('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x647d('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x647d('0x6')]('in',_0x647d('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x647d('0x8')]}}; \ No newline at end of file +var _0x29b6=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x7629e,_0x40c972){var _0x19569b=function(_0xa62841){while(--_0xa62841){_0x7629e['push'](_0x7629e['shift']());}};_0x19569b(++_0x40c972);}(_0x29b6,0x17e));var _0x629b=function(_0x564443,_0x11ff8e){_0x564443=_0x564443-0x0;var _0x53c545=_0x29b6[_0x564443];return _0x53c545;};'use strict';var Sequelize=require(_0x629b('0x0'));var moment=require(_0x629b('0x1'));module[_0x629b('0x2')]={'closed':{'type':Sequelize[_0x629b('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x629b('0x4')]},'disposition':{'type':Sequelize[_0x629b('0x5')]},'secondDisposition':{'type':Sequelize[_0x629b('0x5')]},'thirdDisposition':{'type':Sequelize[_0x629b('0x5')]},'note':{'type':Sequelize[_0x629b('0x5')]},'phone':{'type':Sequelize[_0x629b('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x629b('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x629b('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x629b('0x6')]('in',_0x629b('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x629b('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 17ac596..2e6c549 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 _0x29ef=['removeTags','download','unix','toString','join','server','files','tmp','root','push','fullname','CmContact','Contact','firstName','attachments','Attachment','createdAt','direction','secret','read','WhatsappAccount','Account','User','Owner','get','mkdirSync','Whatsapp','N.A.','closed','disposition','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','rimraf','moment','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','then','destroy','error','stack','name','send','index','WhatsappInteraction','rawAttributes','fieldName','key','findAll','whatsapp','query','catch','show','model','keys','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','body','params','describe','addMessage','WhatsappMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','count','rows','addTags','spread','Tag','color','emit','whatsappInteractionTags:save'];(function(_0x13e0cb,_0xa96591){var _0x4e1668=function(_0x3a70b6){while(--_0x3a70b6){_0x13e0cb['push'](_0x13e0cb['shift']());}};_0x4e1668(++_0xa96591);}(_0x29ef,0xaf));var _0xf29e=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x29ef[_0x220f3f];return _0x1f170e;};'use strict';var rimraf=require(_0xf29e('0x0'));var zipdir=require('zip-dir');var moment=require(_0xf29e('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf29e('0x2'));var Redis=require(_0xf29e('0x3'));var interaction=require('../../components/interaction/service');var qs=require(_0xf29e('0x4'));var pdf=require(_0xf29e('0x5'));var logger=require(_0xf29e('0x6'))('api');var config=require(_0xf29e('0x7'));var db=require(_0xf29e('0x8'))['db'];config[_0xf29e('0x9')]=_[_0xf29e('0xa')](config[_0xf29e('0x9')],{'host':_0xf29e('0xb'),'port':0x18eb});var socket=require(_0xf29e('0xc'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0xf29e('0xd')](socket);function respondWithStatusCode(_0x24d4f6,_0x42d2d8){_0x42d2d8=_0x42d2d8||0xcc;return function(_0x24c0ac){if(_0x24c0ac){return _0x24d4f6[_0xf29e('0xe')](_0x42d2d8);}return _0x24d4f6[_0xf29e('0xf')](_0x42d2d8)[_0xf29e('0x10')]();};}function respondWithResult(_0x24d5d5,_0x147c91){_0x147c91=_0x147c91||0xc8;return function(_0x2f850a){if(_0x2f850a){return _0x24d5d5[_0xf29e('0xf')](_0x147c91)[_0xf29e('0x11')](_0x2f850a);}};}function respondWithFilteredResult(_0x57a43a,_0x4b666d){return function(_0x2e5291){if(_0x2e5291){var _0x4add37=typeof _0x4b666d[_0xf29e('0x12')]===_0xf29e('0x13')&&typeof _0x4b666d[_0xf29e('0x14')]===_0xf29e('0x13');var _0x341bc5=_0x2e5291['count'];var _0xda6654=_0x4add37?0x0:_0x4b666d['offset'];var _0x3efd41=_0x4add37?_0x2e5291['count']:_0x4b666d[_0xf29e('0x12')]+_0x4b666d[_0xf29e('0x14')];var _0x571199;if(_0x3efd41>=_0x341bc5){_0x3efd41=_0x341bc5;_0x571199=0xc8;}else{_0x571199=0xce;}_0x57a43a[_0xf29e('0xf')](_0x571199);return _0x57a43a[_0xf29e('0x15')](_0xf29e('0x16'),_0xda6654+'-'+_0x3efd41+'/'+_0x341bc5)[_0xf29e('0x11')](_0x2e5291);}return null;};}function saveUpdates(_0x5db498){return function(_0x40c9e7){if(_0x40c9e7){return _0x40c9e7[_0xf29e('0x17')](_0x5db498)[_0xf29e('0x18')](function(_0x9c3707){return _0x9c3707;});}return null;};}function removeEntity(_0x101a04){return function(_0xdefc49){if(_0xdefc49){return _0xdefc49[_0xf29e('0x19')]()[_0xf29e('0x18')](function(){_0x101a04[_0xf29e('0xf')](0xcc)[_0xf29e('0x10')]();});}};}function handleEntityNotFound(_0x25c834){return function(_0x392bda){if(!_0x392bda){_0x25c834[_0xf29e('0xe')](0x194);}return _0x392bda;};}function handleError(_0x523df8,_0xf6d22f){_0xf6d22f=_0xf6d22f||0x1f4;return function(_0xb69291){logger[_0xf29e('0x1a')](_0xb69291[_0xf29e('0x1b')]);if(_0xb69291[_0xf29e('0x1c')]){delete _0xb69291[_0xf29e('0x1c')];}_0x523df8[_0xf29e('0xf')](_0xf6d22f)[_0xf29e('0x1d')](_0xb69291);};}exports[_0xf29e('0x1e')]=function(_0x2e7663,_0x389040){var _0x15257b={};var _0x5cb220=_['map'](db[_0xf29e('0x1f')][_0xf29e('0x20')],function(_0x3d2bb3){return{'name':_0x3d2bb3[_0xf29e('0x21')],'type':_0x3d2bb3['type'][_0xf29e('0x22')]};});_0x15257b=qs['getOptions'](_0x5cb220,_0x2e7663);return interaction[_0xf29e('0x23')](_0xf29e('0x24'),_0x2e7663[_0xf29e('0x25')],_0x2e7663['user'],_0x15257b,_0x5cb220)[_0xf29e('0x18')](respondWithFilteredResult(_0x389040,_0x15257b))[_0xf29e('0x26')](handleError(_0x389040,null));};exports[_0xf29e('0x27')]=function(_0x1bb1de,_0x20723a){var _0x38f56d={'raw':![],'where':{'id':_0x1bb1de['params']['id']}},_0xbede83={};_0xbede83[_0xf29e('0x28')]=_['keys'](db[_0xf29e('0x1f')][_0xf29e('0x20')]);_0xbede83[_0xf29e('0x25')]=_[_0xf29e('0x29')](_0x1bb1de['query']);_0xbede83[_0xf29e('0x2a')]=_['intersection'](_0xbede83[_0xf29e('0x28')],_0xbede83[_0xf29e('0x25')]);_0x38f56d[_0xf29e('0x2b')]=_[_0xf29e('0x2c')](_0xbede83[_0xf29e('0x28')],qs[_0xf29e('0x2d')](_0x1bb1de['query'][_0xf29e('0x2d')]));_0x38f56d[_0xf29e('0x2b')]=_0x38f56d[_0xf29e('0x2b')][_0xf29e('0x2e')]?_0x38f56d[_0xf29e('0x2b')]:_0xbede83['model'];if(_0x1bb1de[_0xf29e('0x25')][_0xf29e('0x2f')]){_0x38f56d[_0xf29e('0x30')]=[{'all':!![]}];}_0x38f56d=_[_0xf29e('0x31')]({},_0x38f56d,_0x1bb1de[_0xf29e('0x32')]);return db[_0xf29e('0x1f')][_0xf29e('0x33')](_0x38f56d)[_0xf29e('0x18')](handleEntityNotFound(_0x20723a,null))[_0xf29e('0x18')](respondWithResult(_0x20723a,null))[_0xf29e('0x26')](handleError(_0x20723a,null));};exports[_0xf29e('0x34')]=function(_0x148171,_0x568ddd){return db[_0xf29e('0x1f')][_0xf29e('0x34')](_0x148171['body'],{})[_0xf29e('0x18')](respondWithResult(_0x568ddd,0xc9))[_0xf29e('0x26')](handleError(_0x568ddd,null));};exports[_0xf29e('0x17')]=function(_0x1adc7f,_0x15b8a8){if(_0x1adc7f[_0xf29e('0x35')]['id']){delete _0x1adc7f[_0xf29e('0x35')]['id'];}return db[_0xf29e('0x1f')][_0xf29e('0x33')]({'where':{'id':_0x1adc7f[_0xf29e('0x36')]['id']}})[_0xf29e('0x18')](handleEntityNotFound(_0x15b8a8,null))[_0xf29e('0x18')](saveUpdates(_0x1adc7f[_0xf29e('0x35')],null))[_0xf29e('0x18')](respondWithResult(_0x15b8a8,null))[_0xf29e('0x26')](handleError(_0x15b8a8,null));};exports[_0xf29e('0x19')]=function(_0x59d0f6,_0x5b904f){return db[_0xf29e('0x1f')][_0xf29e('0x33')]({'where':{'id':_0x59d0f6[_0xf29e('0x36')]['id']}})['then'](handleEntityNotFound(_0x5b904f,null))[_0xf29e('0x18')](removeEntity(_0x5b904f,null))[_0xf29e('0x26')](handleError(_0x5b904f,null));};exports[_0xf29e('0x37')]=function(_0x588a1c,_0x29a63b){return db[_0xf29e('0x1f')][_0xf29e('0x37')]()['then'](respondWithResult(_0x29a63b,null))[_0xf29e('0x26')](handleError(_0x29a63b,null));};exports[_0xf29e('0x38')]=function(_0x1c9245,_0x7ffed7){return db[_0xf29e('0x39')][_0xf29e('0x33')]({'where':{'id':_0x1c9245[_0xf29e('0x36')]['id']}})[_0xf29e('0x18')](handleEntityNotFound(_0x7ffed7,null))[_0xf29e('0x18')](function(_0x422117){if(_0x422117){return _0x422117['addMessage'](_0x1c9245[_0xf29e('0x35')][_0xf29e('0x3a')],_[_0xf29e('0x3b')](_0x1c9245[_0xf29e('0x35')],[_0xf29e('0x3a'),'id'])||{});}})['then'](respondWithResult(_0x7ffed7,null))[_0xf29e('0x26')](handleError(_0x7ffed7,null));};exports['getMessages']=function(_0xc493d2,_0x25cf6d){var _0x38e121={'raw':![],'where':{}};var _0x8bc495={};var _0x2f7f57={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xf29e('0x3c')]({'where':{'id':_0xc493d2['params']['id']}})['then'](handleEntityNotFound(_0x25cf6d,null))['then'](function(_0x5dd3f5){if(_0x5dd3f5){_0x8bc495['model']=_[_0xf29e('0x29')](db['WhatsappMessage'][_0xf29e('0x20')]);_0x8bc495[_0xf29e('0x25')]=_[_0xf29e('0x29')](_0xc493d2[_0xf29e('0x25')]);_0x8bc495[_0xf29e('0x2a')]=_[_0xf29e('0x2c')](_0x8bc495[_0xf29e('0x28')],_0x8bc495[_0xf29e('0x25')]);_0x38e121[_0xf29e('0x2b')]=_[_0xf29e('0x2c')](_0x8bc495[_0xf29e('0x28')],qs[_0xf29e('0x2d')](_0xc493d2[_0xf29e('0x25')][_0xf29e('0x2d')]));_0x38e121[_0xf29e('0x2b')]=_0x38e121[_0xf29e('0x2b')]['length']?_0x38e121[_0xf29e('0x2b')]:_0x8bc495['model'];if(!_0xc493d2[_0xf29e('0x25')][_0xf29e('0x3d')](_0xf29e('0x3e'))){_0x38e121[_0xf29e('0x14')]=qs[_0xf29e('0x14')](_0xc493d2['query']['limit']);_0x38e121[_0xf29e('0x12')]=qs['offset'](_0xc493d2[_0xf29e('0x25')][_0xf29e('0x12')]);}_0x38e121[_0xf29e('0x3f')]=qs['sort'](_0xc493d2[_0xf29e('0x25')][_0xf29e('0x40')]);_0x38e121[_0xf29e('0x41')]=qs[_0xf29e('0x2a')](_[_0xf29e('0x42')](_0xc493d2[_0xf29e('0x25')],_0x8bc495[_0xf29e('0x2a')]));_0x38e121[_0xf29e('0x41')][_0xf29e('0x43')]=_0x5dd3f5['id'];if(_0xc493d2[_0xf29e('0x25')][_0xf29e('0x44')]){_0x38e121[_0xf29e('0x41')]=_[_0xf29e('0x31')](_0x38e121[_0xf29e('0x41')],{'$or':_[_0xf29e('0x45')](_0x38e121[_0xf29e('0x2b')],function(_0x1ebe8a){var _0x947d53={};_0x947d53[_0x1ebe8a]={'$like':'%'+_0xc493d2['query'][_0xf29e('0x44')]+'%'};return _0x947d53;})});}if(_0xc493d2[_0xf29e('0x25')][_0xf29e('0x46')]){var _0x3439fd=_0xc493d2[_0xf29e('0x25')][_0xf29e('0x46')]['split'](',');var _0x58d9b1={};_0x58d9b1[_0x3439fd[0x0]]={'$gte':moment(_0x3439fd[0x1])[_0xf29e('0x47')](_0xf29e('0x48'))};_0x38e121[_0xf29e('0x41')]=_[_0xf29e('0x31')](_0x38e121[_0xf29e('0x41')],_0x58d9b1);}_0x38e121=_[_0xf29e('0x31')]({},_0x38e121,_0xc493d2[_0xf29e('0x32')]);return db[_0xf29e('0x39')][_0xf29e('0x49')]({'where':_0x38e121[_0xf29e('0x41')]})[_0xf29e('0x18')](function(_0x59a7de){_0x2f7f57['count']=_0x59a7de;if(_0xc493d2['query'][_0xf29e('0x2f')]){_0x38e121[_0xf29e('0x30')]=[{'all':!![]}];}return db[_0xf29e('0x39')][_0xf29e('0x23')](_0x38e121);})[_0xf29e('0x18')](function(_0x42fee0){_0x2f7f57[_0xf29e('0x4a')]=_0x42fee0;return _0x2f7f57;});}})[_0xf29e('0x18')](respondWithFilteredResult(_0x25cf6d,_0x38e121))['catch'](handleError(_0x25cf6d,null));};exports[_0xf29e('0x4b')]=function(_0x1eb23e,_0x4e7840){return db[_0xf29e('0x1f')][_0xf29e('0x33')]({'where':{'id':_0x1eb23e[_0xf29e('0x36')]['id']}})['then'](handleEntityNotFound(_0x4e7840,null))['then'](function(_0x538aa3){if(_0x538aa3){return _0x538aa3['setTags'](_0x1eb23e[_0xf29e('0x35')]['ids'],_[_0xf29e('0x3b')](_0x1eb23e['body'],['ids','id'])||{})[_0xf29e('0x4c')](function(){return db[_0xf29e('0x4d')][_0xf29e('0x23')]({'attributes':['id',_0xf29e('0x1c'),_0xf29e('0x4e')],'where':{'id':_0x1eb23e[_0xf29e('0x35')][_0xf29e('0x3a')]}});})['then'](function(_0x573072){socket[_0xf29e('0x4f')](_0xf29e('0x50'),{'id':Number(_0x1eb23e['params']['id']),'tags':_0x573072||[]});return{'id':Number(_0x1eb23e[_0xf29e('0x36')]['id']),'tags':_0x573072||[]};});}})[_0xf29e('0x18')](respondWithResult(_0x4e7840,null))[_0xf29e('0x26')](handleError(_0x4e7840,null));};exports[_0xf29e('0x51')]=function(_0x388e29,_0x448738){return db['WhatsappInteraction']['find']({'where':{'id':_0x388e29[_0xf29e('0x36')]['id']}})[_0xf29e('0x18')](handleEntityNotFound(_0x448738,null))[_0xf29e('0x18')](function(_0x16dca4){if(_0x16dca4){return _0x16dca4[_0xf29e('0x51')](_0x388e29[_0xf29e('0x25')]['ids']);}})[_0xf29e('0x18')](respondWithStatusCode(_0x448738,null))['catch'](handleError(_0x448738,null));};exports[_0xf29e('0x52')]=function(_0x2625cd,_0x5cb75d){var _0x24d978=moment()[_0xf29e('0x53')]()[_0xf29e('0x54')]();var _0x20622b=path[_0xf29e('0x55')](config['root'],_0xf29e('0x56'),_0xf29e('0x57'),_0xf29e('0x58'));var _0x32d642=path['join'](config[_0xf29e('0x59')],_0xf29e('0x56'),_0xf29e('0x57'),'attachments');var _0x29982b=path[_0xf29e('0x55')](_0x20622b,_0x24d978);var _0x1f1845=util[_0xf29e('0x47')]('transcript-%d-%s.zip',_0x2625cd[_0xf29e('0x36')]['id'],_0x24d978);var _0x3e34d5=path[_0xf29e('0x55')](_0x20622b,_0x1f1845);var _0x4812f2=[];_0x4812f2[_0xf29e('0x5a')]({'model':db['User'],'as':'User','attributes':['id',_0xf29e('0x5b')],'raw':!![]});_0x4812f2[_0xf29e('0x5a')]({'model':db[_0xf29e('0x5c')],'as':_0xf29e('0x5d'),'attributes':['id',_0xf29e('0x5e'),'lastName'],'raw':!![]});if(_0x2625cd[_0xf29e('0x25')][_0xf29e('0x5f')]){_0x4812f2[_0xf29e('0x5a')]({'model':db[_0xf29e('0x60')],'as':_0xf29e('0x60'),'raw':!![]});}var _0x31f47c=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id',_0xf29e('0x35'),_0xf29e('0x61'),_0xf29e('0x62'),_0xf29e('0x63'),_0xf29e('0x64')],'include':_0x4812f2}];_0x31f47c[_0xf29e('0x5a')]({'model':db[_0xf29e('0x65')],'as':_0xf29e('0x66'),'attributes':['id','name']});_0x31f47c['push']({'model':db[_0xf29e('0x67')],'as':_0xf29e('0x68'),'attributes':['id','fullname']});return db[_0xf29e('0x1f')][_0xf29e('0x33')]({'where':{'id':_0x2625cd['params']['id']},'include':_0x31f47c})[_0xf29e('0x18')](handleEntityNotFound(_0x5cb75d,null))[_0xf29e('0x18')](function(_0x28ee80){if(_0x28ee80){var _0x3c22b7=_0x28ee80[_0xf29e('0x69')]({'plain':!![]});fs[_0xf29e('0x6a')](_0x29982b);var _0x25f543={'channel':_0xf29e('0x6b'),'account':_0x3c22b7['Account']['name'],'agent':_0x3c22b7['Owner']?_0x3c22b7['Owner'][_0xf29e('0x5b')]:_0xf29e('0x6c'),'createdAt':moment(_0x3c22b7[_0xf29e('0x61')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x3c22b7[_0xf29e('0x6d')]?moment(_0x3c22b7['closedAt'])['format'](_0xf29e('0x48'))[_0xf29e('0x54')]():'','disposition':_0x3c22b7[_0xf29e('0x6e')],'messages':_(_0x3c22b7[_0xf29e('0x6f')])[_0xf29e('0x44')]({'secret':![]})['map'](function(_0x2df4ea){if(_0x2df4ea['Attachment']){var _0x2b21db=path['join'](_0x32d642,_0x2df4ea[_0xf29e('0x60')][_0xf29e('0x70')]);if(fs[_0xf29e('0x71')](_0x2b21db)){fs[_0xf29e('0x72')](_0x2b21db)[_0xf29e('0x73')](fs[_0xf29e('0x74')](path[_0xf29e('0x55')](_0x29982b,_0x2df4ea[_0xf29e('0x60')][_0xf29e('0x70')])));}}return{'date':moment(_0x2df4ea['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xf29e('0x54')](),'sender':_0x2df4ea[_0xf29e('0x62')]===_0xf29e('0x75')?_0x2df4ea[_0xf29e('0x67')]?_0x2df4ea['User'][_0xf29e('0x5b')]:_0xf29e('0x76'):_0x2df4ea['Contact']['firstName']+(_0x2df4ea[_0xf29e('0x5d')][_0xf29e('0x77')]?'\x20'+_0x2df4ea[_0xf29e('0x5d')][_0xf29e('0x77')]:''),'body':_0x2df4ea[_0xf29e('0x60')]?_0x2df4ea[_0xf29e('0x60')][_0xf29e('0x70')]:_0x2df4ea[_0xf29e('0x35')],'direction':_0x2df4ea[_0xf29e('0x62')]===_0xf29e('0x75')?'A':'C','secret':_0x2df4ea['secret'],'read':_0x2df4ea['read'],'attachment':_0x2df4ea[_0xf29e('0x60')]};})['value']()};return ejs[_0xf29e('0x78')](path[_0xf29e('0x55')](config[_0xf29e('0x59')],_0xf29e('0x56'),_0xf29e('0x79'),_0xf29e('0x7a')),{'interaction':_0x25f543})[_0xf29e('0x18')](function(_0x2077bf){var _0x4ea4ae=path['join'](_0x29982b,_0xf29e('0x7b')+_0x3c22b7['id']+'-'+_0x24d978+_0xf29e('0x7c'));var _0x7a7958={'path':_0x4ea4ae,'channel':_0xf29e('0x6b'),'interactionId':_0x3c22b7['id']};return pdf['createPdfFromHTML'](_0x2077bf,_0x7a7958);})['then'](function(){return new BPromise(function(_0x4f49d7,_0x3617f4){zipdir(_0x29982b,{'saveTo':_0x3e34d5},function(_0x215242,_0x36a407){if(_0x215242)return _0x3617f4(_0x215242);return _0x4f49d7(_0x36a407);});})[_0xf29e('0x18')](function(){return new BPromise(function(_0xcd9bf3,_0x2bfb3b){rimraf(_0x29982b,function(_0x423bde){if(_0x423bde)_0x2bfb3b(_0x423bde);return _0xcd9bf3();});});})[_0xf29e('0x18')](function(){return _0x5cb75d[_0xf29e('0x52')](_0x3e34d5,_0x1f1845,function(_0x376b6d){if(_0x376b6d){console[_0xf29e('0x7d')](_0xf29e('0x7e'),_0x376b6d);}else{fs[_0xf29e('0x7f')](_0x3e34d5);}});});});}else{return _0x5cb75d[_0xf29e('0xe')](0xc8);}})[_0xf29e('0x26')](handleError(_0x5cb75d,null));}; \ No newline at end of file +var _0xe61c=['../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','undefined','limit','count','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','index','map','WhatsappInteraction','rawAttributes','type','getOptions','findAll','whatsapp','query','user','catch','show','params','model','keys','filters','intersection','attributes','length','includeAll','include','merge','options','find','create','body','describe','addMessage','ids','WhatsappMessage','fields','hasOwnProperty','offset','order','sort','pick','where','WhatsappInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','omit','spread','color','emit','removeTags','unix','toString','join','root','server','files','tmp','attachments','push','User','fullname','CmContact','lastName','Attachment','Messages','createdAt','secret','read','WhatsappAccount','mkdirSync','Whatsapp','Account','Owner','closed','closedAt','filter','basename','existsSync','pipe','createWriteStream','direction','out','System','Contact','firstName','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','rimraf','moment','bluebird','util','lodash','../../components/interaction/service'];(function(_0xeb1349,_0x5014b9){var _0x2ae143=function(_0x17bb1f){while(--_0x17bb1f){_0xeb1349['push'](_0xeb1349['shift']());}};_0x2ae143(++_0x5014b9);}(_0xe61c,0xee));var _0xce61=function(_0x2eac4f,_0x5173f9){_0x2eac4f=_0x2eac4f-0x0;var _0x58f73b=_0xe61c[_0x2eac4f];return _0x58f73b;};'use strict';var rimraf=require(_0xce61('0x0'));var zipdir=require('zip-dir');var moment=require(_0xce61('0x1'));var BPromise=require(_0xce61('0x2'));var util=require(_0xce61('0x3'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xce61('0x4'));var Redis=require('ioredis');var interaction=require(_0xce61('0x5'));var qs=require(_0xce61('0x6'));var pdf=require(_0xce61('0x7'));var logger=require(_0xce61('0x8'))(_0xce61('0x9'));var config=require(_0xce61('0xa'));var db=require(_0xce61('0xb'))['db'];config['redis']=_[_0xce61('0xc')](config[_0xce61('0xd')],{'host':_0xce61('0xe'),'port':0x18eb});var socket=require(_0xce61('0xf'))(new Redis(config[_0xce61('0xd')]));require(_0xce61('0x10'))[_0xce61('0x11')](socket);function respondWithStatusCode(_0x4c5b02,_0x64a2fd){_0x64a2fd=_0x64a2fd||0xcc;return function(_0x3f764d){if(_0x3f764d){return _0x4c5b02['sendStatus'](_0x64a2fd);}return _0x4c5b02[_0xce61('0x12')](_0x64a2fd)[_0xce61('0x13')]();};}function respondWithResult(_0x50a936,_0x32e03e){_0x32e03e=_0x32e03e||0xc8;return function(_0x52c063){if(_0x52c063){return _0x50a936[_0xce61('0x12')](_0x32e03e)[_0xce61('0x14')](_0x52c063);}};}function respondWithFilteredResult(_0x5e45f1,_0x2a3019){return function(_0x4ec131){if(_0x4ec131){var _0x28ea5f=typeof _0x2a3019['offset']===_0xce61('0x15')&&typeof _0x2a3019[_0xce61('0x16')]===_0xce61('0x15');var _0x3185ae=_0x4ec131[_0xce61('0x17')];var _0x486f1f=_0x28ea5f?0x0:_0x2a3019['offset'];var _0x330cae=_0x28ea5f?_0x4ec131['count']:_0x2a3019['offset']+_0x2a3019[_0xce61('0x16')];var _0x15151b;if(_0x330cae>=_0x3185ae){_0x330cae=_0x3185ae;_0x15151b=0xc8;}else{_0x15151b=0xce;}_0x5e45f1[_0xce61('0x12')](_0x15151b);return _0x5e45f1['set'](_0xce61('0x18'),_0x486f1f+'-'+_0x330cae+'/'+_0x3185ae)['json'](_0x4ec131);}return null;};}function saveUpdates(_0x3df071){return function(_0xafb99e){if(_0xafb99e){return _0xafb99e[_0xce61('0x19')](_0x3df071)[_0xce61('0x1a')](function(_0x3e30fa){return _0x3e30fa;});}return null;};}function removeEntity(_0x2c9ec7){return function(_0xea8db2){if(_0xea8db2){return _0xea8db2[_0xce61('0x1b')]()['then'](function(){_0x2c9ec7['status'](0xcc)[_0xce61('0x13')]();});}};}function handleEntityNotFound(_0x570ba2){return function(_0x336ff9){if(!_0x336ff9){_0x570ba2[_0xce61('0x1c')](0x194);}return _0x336ff9;};}function handleError(_0x41bf1d,_0x115466){_0x115466=_0x115466||0x1f4;return function(_0x44cfbd){logger[_0xce61('0x1d')](_0x44cfbd[_0xce61('0x1e')]);if(_0x44cfbd[_0xce61('0x1f')]){delete _0x44cfbd['name'];}_0x41bf1d['status'](_0x115466)[_0xce61('0x20')](_0x44cfbd);};}exports[_0xce61('0x21')]=function(_0x202c09,_0x15b6e7){var _0x2cf24c={};var _0x2241b2=_[_0xce61('0x22')](db[_0xce61('0x23')][_0xce61('0x24')],function(_0x2758e4){return{'name':_0x2758e4['fieldName'],'type':_0x2758e4[_0xce61('0x25')]['key']};});_0x2cf24c=qs[_0xce61('0x26')](_0x2241b2,_0x202c09);return interaction[_0xce61('0x27')](_0xce61('0x28'),_0x202c09[_0xce61('0x29')],_0x202c09[_0xce61('0x2a')],_0x2cf24c,_0x2241b2)['then'](respondWithFilteredResult(_0x15b6e7,_0x2cf24c))[_0xce61('0x2b')](handleError(_0x15b6e7,null));};exports[_0xce61('0x2c')]=function(_0x51af87,_0x4e9020){var _0x5cb588={'raw':![],'where':{'id':_0x51af87[_0xce61('0x2d')]['id']}},_0x1d6220={};_0x1d6220[_0xce61('0x2e')]=_[_0xce61('0x2f')](db[_0xce61('0x23')]['rawAttributes']);_0x1d6220[_0xce61('0x29')]=_[_0xce61('0x2f')](_0x51af87['query']);_0x1d6220[_0xce61('0x30')]=_[_0xce61('0x31')](_0x1d6220['model'],_0x1d6220[_0xce61('0x29')]);_0x5cb588[_0xce61('0x32')]=_['intersection'](_0x1d6220[_0xce61('0x2e')],qs['fields'](_0x51af87[_0xce61('0x29')]['fields']));_0x5cb588['attributes']=_0x5cb588['attributes'][_0xce61('0x33')]?_0x5cb588[_0xce61('0x32')]:_0x1d6220[_0xce61('0x2e')];if(_0x51af87[_0xce61('0x29')][_0xce61('0x34')]){_0x5cb588[_0xce61('0x35')]=[{'all':!![]}];}_0x5cb588=_[_0xce61('0x36')]({},_0x5cb588,_0x51af87[_0xce61('0x37')]);return db[_0xce61('0x23')][_0xce61('0x38')](_0x5cb588)[_0xce61('0x1a')](handleEntityNotFound(_0x4e9020,null))[_0xce61('0x1a')](respondWithResult(_0x4e9020,null))[_0xce61('0x2b')](handleError(_0x4e9020,null));};exports[_0xce61('0x39')]=function(_0x2d1854,_0xa8705b){return db[_0xce61('0x23')][_0xce61('0x39')](_0x2d1854[_0xce61('0x3a')],{})[_0xce61('0x1a')](respondWithResult(_0xa8705b,0xc9))['catch'](handleError(_0xa8705b,null));};exports[_0xce61('0x19')]=function(_0x152856,_0x2a2e21){if(_0x152856['body']['id']){delete _0x152856['body']['id'];}return db['WhatsappInteraction'][_0xce61('0x38')]({'where':{'id':_0x152856[_0xce61('0x2d')]['id']}})[_0xce61('0x1a')](handleEntityNotFound(_0x2a2e21,null))[_0xce61('0x1a')](saveUpdates(_0x152856[_0xce61('0x3a')],null))[_0xce61('0x1a')](respondWithResult(_0x2a2e21,null))[_0xce61('0x2b')](handleError(_0x2a2e21,null));};exports[_0xce61('0x1b')]=function(_0x12de3d,_0x4c4403){return db['WhatsappInteraction'][_0xce61('0x38')]({'where':{'id':_0x12de3d[_0xce61('0x2d')]['id']}})[_0xce61('0x1a')](handleEntityNotFound(_0x4c4403,null))[_0xce61('0x1a')](removeEntity(_0x4c4403,null))[_0xce61('0x2b')](handleError(_0x4c4403,null));};exports['describe']=function(_0x1ab744,_0x107eec){return db[_0xce61('0x23')][_0xce61('0x3b')]()[_0xce61('0x1a')](respondWithResult(_0x107eec,null))[_0xce61('0x2b')](handleError(_0x107eec,null));};exports['addMessage']=function(_0x441a34,_0x106539){return db['WhatsappMessage']['find']({'where':{'id':_0x441a34[_0xce61('0x2d')]['id']}})[_0xce61('0x1a')](handleEntityNotFound(_0x106539,null))[_0xce61('0x1a')](function(_0x4580e8){if(_0x4580e8){return _0x4580e8[_0xce61('0x3c')](_0x441a34['body'][_0xce61('0x3d')],_['omit'](_0x441a34[_0xce61('0x3a')],[_0xce61('0x3d'),'id'])||{});}})[_0xce61('0x1a')](respondWithResult(_0x106539,null))[_0xce61('0x2b')](handleError(_0x106539,null));};exports['getMessages']=function(_0x482e0d,_0x4db82d){var _0x4410c5={'raw':![],'where':{}};var _0x513ce9={};var _0x294442={'count':0x0,'rows':[]};return db[_0xce61('0x23')]['findOne']({'where':{'id':_0x482e0d[_0xce61('0x2d')]['id']}})[_0xce61('0x1a')](handleEntityNotFound(_0x4db82d,null))['then'](function(_0x22da74){if(_0x22da74){_0x513ce9[_0xce61('0x2e')]=_[_0xce61('0x2f')](db[_0xce61('0x3e')]['rawAttributes']);_0x513ce9[_0xce61('0x29')]=_[_0xce61('0x2f')](_0x482e0d[_0xce61('0x29')]);_0x513ce9['filters']=_[_0xce61('0x31')](_0x513ce9['model'],_0x513ce9[_0xce61('0x29')]);_0x4410c5[_0xce61('0x32')]=_[_0xce61('0x31')](_0x513ce9[_0xce61('0x2e')],qs[_0xce61('0x3f')](_0x482e0d['query'][_0xce61('0x3f')]));_0x4410c5[_0xce61('0x32')]=_0x4410c5[_0xce61('0x32')]['length']?_0x4410c5['attributes']:_0x513ce9[_0xce61('0x2e')];if(!_0x482e0d[_0xce61('0x29')][_0xce61('0x40')]('nolimit')){_0x4410c5[_0xce61('0x16')]=qs[_0xce61('0x16')](_0x482e0d[_0xce61('0x29')][_0xce61('0x16')]);_0x4410c5[_0xce61('0x41')]=qs[_0xce61('0x41')](_0x482e0d[_0xce61('0x29')][_0xce61('0x41')]);}_0x4410c5[_0xce61('0x42')]=qs[_0xce61('0x43')](_0x482e0d['query']['sort']);_0x4410c5['where']=qs[_0xce61('0x30')](_[_0xce61('0x44')](_0x482e0d[_0xce61('0x29')],_0x513ce9[_0xce61('0x30')]));_0x4410c5[_0xce61('0x45')][_0xce61('0x46')]=_0x22da74['id'];if(_0x482e0d[_0xce61('0x29')]['filter']){_0x4410c5[_0xce61('0x45')]=_[_0xce61('0x36')](_0x4410c5[_0xce61('0x45')],{'$or':_['map'](_0x4410c5['attributes'],function(_0x5d3e5e){var _0x3dfdcb={};_0x3dfdcb[_0x5d3e5e]={'$like':'%'+_0x482e0d[_0xce61('0x29')]['filter']+'%'};return _0x3dfdcb;})});}if(_0x482e0d['query'][_0xce61('0x47')]){var _0x51a7d3=_0x482e0d[_0xce61('0x29')]['$gte'][_0xce61('0x48')](',');var _0x5de1bd={};_0x5de1bd[_0x51a7d3[0x0]]={'$gte':moment(_0x51a7d3[0x1])[_0xce61('0x49')](_0xce61('0x4a'))};_0x4410c5[_0xce61('0x45')]=_['merge'](_0x4410c5[_0xce61('0x45')],_0x5de1bd);}_0x4410c5=_[_0xce61('0x36')]({},_0x4410c5,_0x482e0d[_0xce61('0x37')]);return db[_0xce61('0x3e')][_0xce61('0x17')]({'where':_0x4410c5[_0xce61('0x45')]})[_0xce61('0x1a')](function(_0x12953b){_0x294442[_0xce61('0x17')]=_0x12953b;if(_0x482e0d[_0xce61('0x29')]['includeAll']){_0x4410c5[_0xce61('0x35')]=[{'all':!![]}];}return db[_0xce61('0x3e')][_0xce61('0x27')](_0x4410c5);})[_0xce61('0x1a')](function(_0x2173e1){_0x294442[_0xce61('0x4b')]=_0x2173e1;return _0x294442;});}})[_0xce61('0x1a')](respondWithFilteredResult(_0x4db82d,_0x4410c5))['catch'](handleError(_0x4db82d,null));};exports[_0xce61('0x4c')]=function(_0x4db7e2,_0x25701e){return db['WhatsappInteraction'][_0xce61('0x38')]({'where':{'id':_0x4db7e2[_0xce61('0x2d')]['id']}})[_0xce61('0x1a')](handleEntityNotFound(_0x25701e,null))[_0xce61('0x1a')](function(_0xe6c182){if(_0xe6c182){return _0xe6c182['setTags'](_0x4db7e2[_0xce61('0x3a')]['ids'],_[_0xce61('0x4d')](_0x4db7e2[_0xce61('0x3a')],[_0xce61('0x3d'),'id'])||{})[_0xce61('0x4e')](function(){return db['Tag'][_0xce61('0x27')]({'attributes':['id',_0xce61('0x1f'),_0xce61('0x4f')],'where':{'id':_0x4db7e2[_0xce61('0x3a')][_0xce61('0x3d')]}});})[_0xce61('0x1a')](function(_0x24f663){socket[_0xce61('0x50')]('whatsappInteractionTags:save',{'id':Number(_0x4db7e2[_0xce61('0x2d')]['id']),'tags':_0x24f663||[]});return{'id':Number(_0x4db7e2[_0xce61('0x2d')]['id']),'tags':_0x24f663||[]};});}})[_0xce61('0x1a')](respondWithResult(_0x25701e,null))[_0xce61('0x2b')](handleError(_0x25701e,null));};exports['removeTags']=function(_0x1d71c8,_0x5a7815){return db[_0xce61('0x23')][_0xce61('0x38')]({'where':{'id':_0x1d71c8[_0xce61('0x2d')]['id']}})[_0xce61('0x1a')](handleEntityNotFound(_0x5a7815,null))[_0xce61('0x1a')](function(_0x3e7ac1){if(_0x3e7ac1){return _0x3e7ac1[_0xce61('0x51')](_0x1d71c8[_0xce61('0x29')]['ids']);}})[_0xce61('0x1a')](respondWithStatusCode(_0x5a7815,null))[_0xce61('0x2b')](handleError(_0x5a7815,null));};exports['download']=function(_0x3d2ac7,_0x14a290){var _0x35797b=moment()[_0xce61('0x52')]()[_0xce61('0x53')]();var _0x332f39=path[_0xce61('0x54')](config[_0xce61('0x55')],_0xce61('0x56'),_0xce61('0x57'),_0xce61('0x58'));var _0x2f65cc=path['join'](config[_0xce61('0x55')],_0xce61('0x56'),_0xce61('0x57'),_0xce61('0x59'));var _0x1d9284=path[_0xce61('0x54')](_0x332f39,_0x35797b);var _0x112985=util[_0xce61('0x49')]('transcript-%d-%s.zip',_0x3d2ac7[_0xce61('0x2d')]['id'],_0x35797b);var _0x1a55f7=path[_0xce61('0x54')](_0x332f39,_0x112985);var _0x406cad=[];_0x406cad[_0xce61('0x5a')]({'model':db[_0xce61('0x5b')],'as':'User','attributes':['id',_0xce61('0x5c')],'raw':!![]});_0x406cad[_0xce61('0x5a')]({'model':db[_0xce61('0x5d')],'as':'Contact','attributes':['id','firstName',_0xce61('0x5e')],'raw':!![]});if(_0x3d2ac7[_0xce61('0x29')][_0xce61('0x59')]){_0x406cad[_0xce61('0x5a')]({'model':db[_0xce61('0x5f')],'as':_0xce61('0x5f'),'raw':!![]});}var _0x576415=[{'model':db[_0xce61('0x3e')],'as':_0xce61('0x60'),'attributes':['id',_0xce61('0x3a'),_0xce61('0x61'),'direction',_0xce61('0x62'),_0xce61('0x63')],'include':_0x406cad}];_0x576415['push']({'model':db[_0xce61('0x64')],'as':'Account','attributes':['id','name']});_0x576415[_0xce61('0x5a')]({'model':db[_0xce61('0x5b')],'as':'Owner','attributes':['id',_0xce61('0x5c')]});return db[_0xce61('0x23')]['find']({'where':{'id':_0x3d2ac7[_0xce61('0x2d')]['id']},'include':_0x576415})[_0xce61('0x1a')](handleEntityNotFound(_0x14a290,null))['then'](function(_0x4b936d){if(_0x4b936d){var _0x508ae4=_0x4b936d['get']({'plain':!![]});fs[_0xce61('0x65')](_0x1d9284);var _0x3f65fb={'channel':_0xce61('0x66'),'account':_0x508ae4[_0xce61('0x67')]['name'],'agent':_0x508ae4['Owner']?_0x508ae4[_0xce61('0x68')][_0xce61('0x5c')]:'N.A.','createdAt':moment(_0x508ae4[_0xce61('0x61')])[_0xce61('0x49')](_0xce61('0x4a'))[_0xce61('0x53')](),'closedAt':_0x508ae4[_0xce61('0x69')]?moment(_0x508ae4[_0xce61('0x6a')])[_0xce61('0x49')](_0xce61('0x4a'))[_0xce61('0x53')]():'','disposition':_0x508ae4['disposition'],'messages':_(_0x508ae4[_0xce61('0x60')])[_0xce61('0x6b')]({'secret':![]})[_0xce61('0x22')](function(_0x226419){if(_0x226419[_0xce61('0x5f')]){var _0x1f631d=path[_0xce61('0x54')](_0x2f65cc,_0x226419[_0xce61('0x5f')][_0xce61('0x6c')]);if(fs[_0xce61('0x6d')](_0x1f631d)){fs['createReadStream'](_0x1f631d)[_0xce61('0x6e')](fs[_0xce61('0x6f')](path['join'](_0x1d9284,_0x226419[_0xce61('0x5f')][_0xce61('0x6c')])));}}return{'date':moment(_0x226419[_0xce61('0x61')])[_0xce61('0x49')](_0xce61('0x4a'))['toString'](),'sender':_0x226419[_0xce61('0x70')]===_0xce61('0x71')?_0x226419[_0xce61('0x5b')]?_0x226419['User'][_0xce61('0x5c')]:_0xce61('0x72'):_0x226419[_0xce61('0x73')][_0xce61('0x74')]+(_0x226419['Contact'][_0xce61('0x5e')]?'\x20'+_0x226419[_0xce61('0x73')][_0xce61('0x5e')]:''),'body':_0x226419[_0xce61('0x5f')]?_0x226419[_0xce61('0x5f')][_0xce61('0x6c')]:_0x226419[_0xce61('0x3a')],'direction':_0x226419[_0xce61('0x70')]==='out'?'A':'C','secret':_0x226419[_0xce61('0x62')],'read':_0x226419[_0xce61('0x63')],'attachment':_0x226419[_0xce61('0x5f')]};})['value']()};return ejs[_0xce61('0x75')](path[_0xce61('0x54')](config[_0xce61('0x55')],_0xce61('0x56'),'views',_0xce61('0x76')),{'interaction':_0x3f65fb})['then'](function(_0x2a16ed){var _0x373096=path[_0xce61('0x54')](_0x1d9284,_0xce61('0x77')+_0x508ae4['id']+'-'+_0x35797b+_0xce61('0x78'));var _0x13f89b={'path':_0x373096,'channel':'Whatsapp','interactionId':_0x508ae4['id']};return pdf[_0xce61('0x79')](_0x2a16ed,_0x13f89b);})[_0xce61('0x1a')](function(){return new BPromise(function(_0x4b7264,_0x555d36){zipdir(_0x1d9284,{'saveTo':_0x1a55f7},function(_0x27ddd2,_0x4b9e63){if(_0x27ddd2)return _0x555d36(_0x27ddd2);return _0x4b7264(_0x4b9e63);});})[_0xce61('0x1a')](function(){return new BPromise(function(_0xe1528b,_0x389e6){rimraf(_0x1d9284,function(_0x48e4f7){if(_0x48e4f7)_0x389e6(_0x48e4f7);return _0xe1528b();});});})[_0xce61('0x1a')](function(){return _0x14a290['download'](_0x1a55f7,_0x112985,function(_0x5b215a){if(_0x5b215a){console['log']('err',_0x5b215a);}else{fs['unlinkSync'](_0x1a55f7);}});});});}else{return _0x14a290['sendStatus'](0xc8);}})[_0xce61('0x2b')](handleError(_0x14a290,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index faae23a..d863bfb 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 _0xb67f=['setMaxListeners','save','update','remove','getUsers','then','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','../../mysqldb','WhatsappInteraction','WhatsappMessage'];(function(_0x44d40e,_0x385d76){var _0x49fa79=function(_0x4325c4){while(--_0x4325c4){_0x44d40e['push'](_0x44d40e['shift']());}};_0x49fa79(++_0x385d76);}(_0xb67f,0x12d));var _0xfb67=function(_0x22b15c,_0x40ab78){_0x22b15c=_0x22b15c-0x0;var _0x552b58=_0xb67f[_0x22b15c];return _0x552b58;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xfb67('0x0'))['db'][_0xfb67('0x1')];var WhatsappMessage=require(_0xfb67('0x0'))['db'][_0xfb67('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xfb67('0x3')](0x0);var events={'afterCreate':_0xfb67('0x4'),'afterUpdate':_0xfb67('0x5'),'afterDestroy':_0xfb67('0x6')};function emitEvent(_0x5133b9){return function(_0x286416,_0x42168f,_0x2dc6bf){_0x286416[_0xfb67('0x7')]({'attributes':['id'],'raw':!![]})[_0xfb67('0x8')](function(_0x4feb36){_0x286416['setDataValue']('Users',_0x4feb36[_0xfb67('0x9')](function(_0x3ea44e){return{'id':_0x3ea44e['id']};}));return WhatsappMessage[_0xfb67('0xa')]({'where':{'WhatsappInteractionId':_0x286416['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x112ce0){_0x286416[_0xfb67('0xb')](_0xfb67('0xc'),_0x112ce0['length']);WhatsappInteractionEvents[_0xfb67('0xd')](_0x5133b9+':'+_0x286416['id'],_0x286416);WhatsappInteractionEvents['emit'](_0x5133b9,_0x286416);_0x2dc6bf(null);})[_0xfb67('0xe')](_0x2dc6bf(null));};}for(var e in events){if(events[_0xfb67('0xf')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x7794=['save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','WhatsappInteraction','WhatsappMessage'];(function(_0x16a33b,_0x1e7f53){var _0x4d2277=function(_0x356977){while(--_0x356977){_0x16a33b['push'](_0x16a33b['shift']());}};_0x4d2277(++_0x1e7f53);}(_0x7794,0x7b));var _0x4779=function(_0x1fbfba,_0x1d6348){_0x1fbfba=_0x1fbfba-0x0;var _0x1cb949=_0x7794[_0x1fbfba];return _0x1cb949;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x4779('0x0'))['db'][_0x4779('0x1')];var WhatsappMessage=require(_0x4779('0x0'))['db'][_0x4779('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4779('0x3'),'afterUpdate':_0x4779('0x4'),'afterDestroy':'remove'};function emitEvent(_0x40e5f9){return function(_0x54dc7f,_0x59d1bf,_0x53fd58){_0x54dc7f[_0x4779('0x5')]({'attributes':['id'],'raw':!![]})[_0x4779('0x6')](function(_0x523c93){_0x54dc7f[_0x4779('0x7')](_0x4779('0x8'),_0x523c93[_0x4779('0x9')](function(_0x20e2af){return{'id':_0x20e2af['id']};}));return WhatsappMessage[_0x4779('0xa')]({'where':{'WhatsappInteractionId':_0x54dc7f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4779('0x6')](function(_0x42e4c0){_0x54dc7f['setDataValue'](_0x4779('0xb'),_0x42e4c0[_0x4779('0xc')]);WhatsappInteractionEvents[_0x4779('0xd')](_0x40e5f9+':'+_0x54dc7f['id'],_0x54dc7f);WhatsappInteractionEvents[_0x4779('0xd')](_0x40e5f9,_0x54dc7f);_0x53fd58(null);})[_0x4779('0xe')](_0x53fd58(null));};}for(var e in events){if(events[_0x4779('0xf')](e)){var event=events[e];WhatsappInteraction[_0x4779('0x10')](e,emitEvent(event));}}module[_0x4779('0x11')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 882b510..634e0c0 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 _0x0ef6=['format','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','exports','define','closed','closedAt'];(function(_0x184cea,_0x32556d){var _0x4861f9=function(_0x502077){while(--_0x502077){_0x184cea['push'](_0x184cea['shift']());}};_0x4861f9(++_0x32556d);}(_0x0ef6,0x1ef));var _0x60ef=function(_0x56de08,_0x7ec288){_0x56de08=_0x56de08-0x0;var _0x45eef9=_0x0ef6[_0x56de08];return _0x45eef9;};'use strict';var _=require('lodash');var util=require(_0x60ef('0x0'));var logger=require(_0x60ef('0x1'))('api');var moment=require(_0x60ef('0x2'));var BPromise=require(_0x60ef('0x3'));var rp=require(_0x60ef('0x4'));var fs=require('fs');var path=require(_0x60ef('0x5'));var rimraf=require('rimraf');var config=require(_0x60ef('0x6'));var attributes=require(_0x60ef('0x7'));module[_0x60ef('0x8')]=function(_0x1b5290,_0x159cf7){return _0x1b5290[_0x60ef('0x9')]('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2fbf42,_0x3e6a6e,_0x463741){if(_0x2fbf42['changed'](_0x60ef('0xa'))){_0x2fbf42[_0x60ef('0xb')]=moment()[_0x60ef('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x463741(null,_0x2fbf42);}}});}; \ No newline at end of file +var _0x3d70=['./whatsappInteraction.attributes','define','WhatsappInteraction','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x275e93,_0x482f38){var _0x37cf52=function(_0x74579e){while(--_0x74579e){_0x275e93['push'](_0x275e93['shift']());}};_0x37cf52(++_0x482f38);}(_0x3d70,0xf6));var _0x03d7=function(_0xe1a3a5,_0xd3e341){_0xe1a3a5=_0xe1a3a5-0x0;var _0x362646=_0x3d70[_0xe1a3a5];return _0x362646;};'use strict';var _=require('lodash');var util=require(_0x03d7('0x0'));var logger=require(_0x03d7('0x1'))(_0x03d7('0x2'));var moment=require('moment');var BPromise=require(_0x03d7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x03d7('0x4'));var rimraf=require(_0x03d7('0x5'));var config=require('../../config/environment');var attributes=require(_0x03d7('0x6'));module['exports']=function(_0x4728d0,_0xdfabac){return _0x4728d0[_0x03d7('0x7')](_0x03d7('0x8'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x233035,_0x34bc56,_0x2bb58c){if(_0x233035['changed'](_0x03d7('0x9'))){_0x233035[_0x03d7('0xa')]=moment()['format'](_0x03d7('0xb'));}_0x2bb58c(null,_0x233035);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index d3f5d79..66c8017 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 _0x9511=['limit','UpdateWhatsappInteraction','debug','AddTagsToWhatsappInteraction','find','addTags','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','WhatsappInteraction','update','body','raw','options','where','attributes'];(function(_0x75c0aa,_0x52f100){var _0x397a4e=function(_0x410f0c){while(--_0x410f0c){_0x75c0aa['push'](_0x75c0aa['shift']());}};_0x397a4e(++_0x52f100);}(_0x9511,0xbd));var _0x1951=function(_0x131e60,_0x5352ce){_0x131e60=_0x131e60-0x0;var _0x4bc497=_0x9511[_0x131e60];return _0x4bc497;};'use strict';var _=require(_0x1951('0x0'));var util=require(_0x1951('0x1'));var moment=require('moment');var BPromise=require(_0x1951('0x2'));var rs=require(_0x1951('0x3'));var fs=require('fs');var Redis=require(_0x1951('0x4'));var db=require(_0x1951('0x5'))['db'];var utils=require(_0x1951('0x6'));var logger=require(_0x1951('0x7'))(_0x1951('0x8'));var config=require(_0x1951('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1951('0xa')]['http']({'port':0x232a});config[_0x1951('0xb')]=_[_0x1951('0xc')](config[_0x1951('0xb')],{'host':_0x1951('0xd'),'port':0x18eb});var socket=require(_0x1951('0xe'))(new Redis(config[_0x1951('0xb')]));require(_0x1951('0xf'))[_0x1951('0x10')](socket);function respondWithRpcPromise(_0x18c233,_0x5566a8,_0xf61385){return new BPromise(function(_0x25d1b5,_0x20335b){return client[_0x1951('0x11')](_0x18c233,_0xf61385)[_0x1951('0x12')](function(_0x33a3c7){logger['info'](_0x1951('0x13'),_0x5566a8,_0x1951('0x14'));logger['debug'](_0x1951('0x15'),_0x5566a8,_0x1951('0x14'),JSON[_0x1951('0x16')](_0x33a3c7));if(_0x33a3c7[_0x1951('0x17')]){if(_0x33a3c7[_0x1951('0x17')][_0x1951('0x18')]===0x1f4){logger[_0x1951('0x17')](_0x1951('0x13'),_0x5566a8,_0x33a3c7[_0x1951('0x17')][_0x1951('0x19')]);return _0x20335b(_0x33a3c7['error']['message']);}logger[_0x1951('0x17')](_0x1951('0x13'),_0x5566a8,_0x33a3c7['error'][_0x1951('0x19')]);return _0x25d1b5(_0x33a3c7[_0x1951('0x17')][_0x1951('0x19')]);}else{logger[_0x1951('0x1a')](_0x1951('0x13'),_0x5566a8,'request\x20sent');_0x25d1b5(_0x33a3c7[_0x1951('0x1b')][_0x1951('0x19')]);}})[_0x1951('0x1c')](function(_0x1ee54a){logger[_0x1951('0x17')](_0x1951('0x13'),_0x5566a8,_0x1ee54a);_0x20335b(_0x1ee54a);});});}exports['UpdateWhatsappInteraction']=function(_0x4a0600){var _0x38d393=this;return new Promise(function(_0x57d0d1,_0x373292){return db[_0x1951('0x1d')][_0x1951('0x1e')](_0x4a0600[_0x1951('0x1f')],{'raw':_0x4a0600['options']?_0x4a0600['options'][_0x1951('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a0600[_0x1951('0x21')]?_0x4a0600[_0x1951('0x21')][_0x1951('0x22')]||null:null,'attributes':_0x4a0600['options']?_0x4a0600['options'][_0x1951('0x23')]||null:null,'limit':_0x4a0600[_0x1951('0x21')]?_0x4a0600['options'][_0x1951('0x24')]||null:null})[_0x1951('0x12')](function(_0x432c98){logger[_0x1951('0x1a')](_0x1951('0x25'),_0x4a0600);logger[_0x1951('0x26')](_0x1951('0x25'),_0x4a0600,JSON['stringify'](_0x432c98));_0x57d0d1(_0x432c98);})[_0x1951('0x1c')](function(_0x40946d){logger['error'](_0x1951('0x25'),_0x40946d['message'],_0x4a0600);_0x373292(_0x38d393['error'](0x1f4,_0x40946d['message']));});});};exports[_0x1951('0x27')]=function(_0x1f953f){return new Promise(function(_0x365e3a,_0x5a1f29){return db['WhatsappInteraction'][_0x1951('0x28')]({'where':_0x1f953f[_0x1951('0x21')]?_0x1f953f['options']['where']||null:null})[_0x1951('0x12')](function(_0x3d64ee){if(_0x3d64ee){return _0x3d64ee[_0x1951('0x29')](_0x1f953f[_0x1951('0x1f')][_0x1951('0x2a')],_[_0x1951('0x2b')](_0x1f953f[_0x1951('0x1f')],['ids','id'])||{});}})['spread'](function(_0x3ebf31){logger[_0x1951('0x1a')](_0x1951('0x2c'),_0x1f953f);logger[_0x1951('0x26')](_0x1951('0x2c'),_0x1f953f,JSON[_0x1951('0x16')](_0x3ebf31));_0x365e3a(_0x3ebf31);})[_0x1951('0x1c')](function(_0x4f4c8f){logger[_0x1951('0x17')](_0x1951('0x2c'),_0x4f4c8f[_0x1951('0x19')],_0x1f953f);_0x5a1f29(_this[_0x1951('0x17')](0x1f4,_0x4f4c8f[_0x1951('0x19')]));});});}; \ No newline at end of file +var _0xba60=['message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','attributes','AddTagsToWhatsappInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','register','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s'];(function(_0x30b057,_0x1d1505){var _0x331671=function(_0x30bcdf){while(--_0x30bcdf){_0x30b057['push'](_0x30b057['shift']());}};_0x331671(++_0x1d1505);}(_0xba60,0x15a));var _0x0ba6=function(_0x4b5c91,_0x73283d){_0x4b5c91=_0x4b5c91-0x0;var _0x596f37=_0xba60[_0x4b5c91];return _0x596f37;};'use strict';var _=require(_0x0ba6('0x0'));var util=require('util');var moment=require(_0x0ba6('0x1'));var BPromise=require(_0x0ba6('0x2'));var rs=require(_0x0ba6('0x3'));var fs=require('fs');var Redis=require(_0x0ba6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0ba6('0x5'));var logger=require(_0x0ba6('0x6'))(_0x0ba6('0x7'));var config=require('../../config/environment');var jayson=require(_0x0ba6('0x8'));var client=jayson[_0x0ba6('0x9')][_0x0ba6('0xa')]({'port':0x232a});config[_0x0ba6('0xb')]=_[_0x0ba6('0xc')](config[_0x0ba6('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0x0ba6('0xd')](socket);function respondWithRpcPromise(_0x4a2a9d,_0x53ff90,_0x579ff1){return new BPromise(function(_0x516397,_0x309977){return client['request'](_0x4a2a9d,_0x579ff1)[_0x0ba6('0xe')](function(_0x4dab54){logger[_0x0ba6('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x53ff90,_0x0ba6('0x10'));logger[_0x0ba6('0x11')](_0x0ba6('0x12'),_0x53ff90,_0x0ba6('0x10'),JSON[_0x0ba6('0x13')](_0x4dab54));if(_0x4dab54[_0x0ba6('0x14')]){if(_0x4dab54[_0x0ba6('0x14')][_0x0ba6('0x15')]===0x1f4){logger[_0x0ba6('0x14')](_0x0ba6('0x16'),_0x53ff90,_0x4dab54[_0x0ba6('0x14')][_0x0ba6('0x17')]);return _0x309977(_0x4dab54[_0x0ba6('0x14')][_0x0ba6('0x17')]);}logger['error'](_0x0ba6('0x16'),_0x53ff90,_0x4dab54['error'][_0x0ba6('0x17')]);return _0x516397(_0x4dab54[_0x0ba6('0x14')][_0x0ba6('0x17')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x53ff90,'request\x20sent');_0x516397(_0x4dab54[_0x0ba6('0x18')][_0x0ba6('0x17')]);}})[_0x0ba6('0x19')](function(_0x484bc8){logger[_0x0ba6('0x14')](_0x0ba6('0x16'),_0x53ff90,_0x484bc8);_0x309977(_0x484bc8);});});}exports[_0x0ba6('0x1a')]=function(_0x11e3b4){var _0x33ffc0=this;return new Promise(function(_0x2c8dae,_0x21b418){return db[_0x0ba6('0x1b')][_0x0ba6('0x1c')](_0x11e3b4[_0x0ba6('0x1d')],{'raw':_0x11e3b4[_0x0ba6('0x1e')]?_0x11e3b4[_0x0ba6('0x1e')][_0x0ba6('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11e3b4['options']?_0x11e3b4[_0x0ba6('0x1e')]['where']||null:null,'attributes':_0x11e3b4[_0x0ba6('0x1e')]?_0x11e3b4[_0x0ba6('0x1e')][_0x0ba6('0x20')]||null:null,'limit':_0x11e3b4['options']?_0x11e3b4[_0x0ba6('0x1e')]['limit']||null:null})[_0x0ba6('0xe')](function(_0x14ccda){logger[_0x0ba6('0xf')](_0x0ba6('0x1a'),_0x11e3b4);logger[_0x0ba6('0x11')](_0x0ba6('0x1a'),_0x11e3b4,JSON[_0x0ba6('0x13')](_0x14ccda));_0x2c8dae(_0x14ccda);})[_0x0ba6('0x19')](function(_0x76b5d8){logger[_0x0ba6('0x14')](_0x0ba6('0x1a'),_0x76b5d8['message'],_0x11e3b4);_0x21b418(_0x33ffc0[_0x0ba6('0x14')](0x1f4,_0x76b5d8[_0x0ba6('0x17')]));});});};exports[_0x0ba6('0x21')]=function(_0x524787){return new Promise(function(_0x1610ef,_0x586b8d){return db[_0x0ba6('0x1b')][_0x0ba6('0x22')]({'where':_0x524787[_0x0ba6('0x1e')]?_0x524787[_0x0ba6('0x1e')][_0x0ba6('0x23')]||null:null})[_0x0ba6('0xe')](function(_0x146c95){if(_0x146c95){return _0x146c95[_0x0ba6('0x24')](_0x524787[_0x0ba6('0x1d')][_0x0ba6('0x25')],_[_0x0ba6('0x26')](_0x524787[_0x0ba6('0x1d')],[_0x0ba6('0x25'),'id'])||{});}})[_0x0ba6('0x27')](function(_0x1571ec){logger[_0x0ba6('0xf')](_0x0ba6('0x28'),_0x524787);logger['debug'](_0x0ba6('0x28'),_0x524787,JSON[_0x0ba6('0x13')](_0x1571ec));_0x1610ef(_0x1571ec);})['catch'](function(_0x1aa6e9){logger[_0x0ba6('0x14')]('AddTags',_0x1aa6e9['message'],_0x524787);_0x586b8d(_this[_0x0ba6('0x14')](0x1f4,_0x1aa6e9[_0x0ba6('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index b5590fd..bfa6073 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 _0x6a70=['whatsappInteraction:','update','removeListener','register','length'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x6a70,0xba));var _0x06a7=function(_0x16c881,_0x308a6d){_0x16c881=_0x16c881-0x0;var _0x1712db=_0x6a70[_0x16c881];return _0x1712db;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save','remove',_0x06a7('0x0')];function createListener(_0x1409d0,_0x3860c1){return function(_0x291d29){_0x3860c1['emit'](_0x1409d0,_0x291d29);};}function removeListener(_0x15712f,_0x36f9c2){return function(){WhatsappInteractionEvents[_0x06a7('0x1')](_0x15712f,_0x36f9c2);};}exports[_0x06a7('0x2')]=function(_0xa1b488){for(var _0x562d3b=0x0,_0x393160=events[_0x06a7('0x3')];_0x562d3b<_0x393160;_0x562d3b++){var _0x5ac553=events[_0x562d3b];var _0x5798b2=createListener(_0x06a7('0x4')+_0x5ac553,_0xa1b488);WhatsappInteractionEvents['on'](_0x5ac553,_0x5798b2);}}; \ No newline at end of file +var _0xbb00=['emit','removeListener','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update'];(function(_0x142b6d,_0x23672c){var _0x33a18f=function(_0x46783b){while(--_0x46783b){_0x142b6d['push'](_0x142b6d['shift']());}};_0x33a18f(++_0x23672c);}(_0xbb00,0xa4));var _0x0bb0=function(_0x3c4087,_0x5c764b){_0x3c4087=_0x3c4087-0x0;var _0x23ad1f=_0xbb00[_0x3c4087];return _0x23ad1f;};'use strict';var WhatsappInteractionEvents=require(_0x0bb0('0x0'));var events=[_0x0bb0('0x1'),_0x0bb0('0x2'),_0x0bb0('0x3')];function createListener(_0x105342,_0x1cd164){return function(_0x538265){_0x1cd164[_0x0bb0('0x4')](_0x105342,_0x538265);};}function removeListener(_0x1c14d2,_0x5f57e6){return function(){WhatsappInteractionEvents[_0x0bb0('0x5')](_0x1c14d2,_0x5f57e6);};}exports['register']=function(_0xa900f){for(var _0x59a075=0x0,_0x204ff3=events[_0x0bb0('0x6')];_0x59a075<_0x204ff3;_0x59a075++){var _0x275810=events[_0x59a075];var _0x6759d4=createListener(_0x0bb0('0x7')+_0x275810,_0xa900f);WhatsappInteractionEvents['on'](_0x275810,_0x6759d4);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 9ad982f..7e92b2a 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 _0x177f=['./whatsappMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','put','update','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5bedbb,_0x5543ca){var _0x4a8a8f=function(_0x2eb61e){while(--_0x2eb61e){_0x5bedbb['push'](_0x5bedbb['shift']());}};_0x4a8a8f(++_0x5543ca);}(_0x177f,0x14c));var _0xf177=function(_0x2822a9,_0xcd114a){_0x2822a9=_0x2822a9-0x0;var _0x5ca5c3=_0x177f[_0x2822a9];return _0x5ca5c3;};'use strict';var multer=require(_0xf177('0x0'));var util=require(_0xf177('0x1'));var path=require(_0xf177('0x2'));var timeout=require(_0xf177('0x3'));var express=require(_0xf177('0x4'));var router=express[_0xf177('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf177('0x6'));router[_0xf177('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf177('0x7')](_0xf177('0x8'),auth[_0xf177('0x9')](),controller[_0xf177('0xa')]);router['get'](_0xf177('0xb'),auth[_0xf177('0x9')](),controller[_0xf177('0xc')]);router[_0xf177('0xd')]('/',auth[_0xf177('0x9')](),interaction[_0xf177('0xe')](_0xf177('0xf'),_0xf177('0x10')),controller[_0xf177('0x11')]);router[_0xf177('0xd')](_0xf177('0x12'),controller['status']);router[_0xf177('0x13')](_0xf177('0xb'),auth[_0xf177('0x9')](),controller[_0xf177('0x14')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0xf177('0x15')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xf177('0x16')]);router[_0xf177('0x17')]('/:id',auth[_0xf177('0x9')](),controller[_0xf177('0x18')]);module[_0xf177('0x19')]=router; \ No newline at end of file +var _0xc4de=['delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','whatsappmessage:create','status','put','update','/:id/accept','accept','reject'];(function(_0x54839c,_0x26a656){var _0x25e07b=function(_0x152abb){while(--_0x152abb){_0x54839c['push'](_0x54839c['shift']());}};_0x25e07b(++_0x26a656);}(_0xc4de,0x9f));var _0xec4d=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xc4de[_0x1a9204];return _0x17ca68;};'use strict';var multer=require(_0xec4d('0x0'));var util=require(_0xec4d('0x1'));var path=require('path');var timeout=require(_0xec4d('0x2'));var express=require(_0xec4d('0x3'));var router=express['Router']();var fs_extra=require(_0xec4d('0x4'));var auth=require(_0xec4d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xec4d('0x6'));router[_0xec4d('0x7')]('/',auth[_0xec4d('0x8')](),controller[_0xec4d('0x9')]);router[_0xec4d('0x7')](_0xec4d('0xa'),auth[_0xec4d('0x8')](),controller[_0xec4d('0xb')]);router[_0xec4d('0x7')](_0xec4d('0xc'),auth[_0xec4d('0x8')](),controller[_0xec4d('0xd')]);router[_0xec4d('0xe')]('/',auth['isAuthenticated'](),interaction[_0xec4d('0xf')]('whatsapp',_0xec4d('0x10')),controller['create']);router[_0xec4d('0xe')]('/:id/status',controller[_0xec4d('0x11')]);router[_0xec4d('0x12')](_0xec4d('0xc'),auth[_0xec4d('0x8')](),controller[_0xec4d('0x13')]);router[_0xec4d('0x12')](_0xec4d('0x14'),auth['isAuthenticated'](),controller[_0xec4d('0x15')]);router[_0xec4d('0x12')]('/:id/reject',auth[_0xec4d('0x8')](),controller[_0xec4d('0x16')]);router[_0xec4d('0x17')]('/:id',auth[_0xec4d('0x8')](),controller[_0xec4d('0x18')]);module[_0xec4d('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 722145d..2ce27e0 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 _0x0be3=['BOOLEAN','out','STRING','DATE','TEXT','medium'];(function(_0x14f581,_0x3224ad){var _0x1cd55a=function(_0x548e83){while(--_0x548e83){_0x14f581['push'](_0x14f581['shift']());}};_0x1cd55a(++_0x3224ad);}(_0x0be3,0x9a));var _0x30be=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0x0be3[_0x3a7a9c];return _0x59156e;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x30be('0x0')](_0x30be('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x30be('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x30be('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x30be('0x4')](0xbe)},'phone':{'type':Sequelize[_0x30be('0x4')]},'readAt':{'type':Sequelize[_0x30be('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x30be('0x0')]}}; \ No newline at end of file +var _0xfb30=['exports','medium','BOOLEAN','out','STRING','DATE','TEXT','sequelize'];(function(_0x541c90,_0x53c0da){var _0x1ae4f9=function(_0x22059e){while(--_0x22059e){_0x541c90['push'](_0x541c90['shift']());}};_0x1ae4f9(++_0x53c0da);}(_0xfb30,0x167));var _0x0fb3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfb30[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x0fb3('0x0'));module[_0x0fb3('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0fb3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0fb3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x0fb3('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0fb3('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x0fb3('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x0fb3('0x5')]},'providerResponse':{'type':Sequelize[_0x0fb3('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index f08d8eb..9c00f35 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 _0x6159=['./whatsappMessage.socket','register','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','end','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','WhatsappMessage','include','findAll','rows','show','includeAll','find','create','body','params','describe','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','contact','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x3f6ece,_0x530c18){var _0x3ecfa2=function(_0x55717e){while(--_0x55717e){_0x3f6ece['push'](_0x3f6ece['shift']());}};_0x3ecfa2(++_0x530c18);}(_0x6159,0x106));var _0x9615=function(_0x13ae54,_0xf4ce03){_0x13ae54=_0x13ae54-0x0;var _0x1428ea=_0x6159[_0x13ae54];return _0x1428ea;};'use strict';var emlformat=require(_0x9615('0x0'));var rimraf=require(_0x9615('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9615('0x2'));var rp=require(_0x9615('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9615('0x4'));var util=require(_0x9615('0x5'));var path=require(_0x9615('0x6'));var sox=require('sox');var csv=require(_0x9615('0x7'));var ejs=require(_0x9615('0x8'));var fs=require('fs');var fs_extra=require(_0x9615('0x9'));var _=require(_0x9615('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9615('0xb'));var deskjs=require(_0x9615('0xc'));var toCsv=require(_0x9615('0x7'));var querystring=require(_0x9615('0xd'));var Papa=require(_0x9615('0xe'));var Redis=require(_0x9615('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9615('0x10'));var as=require(_0x9615('0x11'));var hardwareService=require(_0x9615('0x12'));var logger=require(_0x9615('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x9615('0x14'));var licenseUtil=require(_0x9615('0x15'));var db=require(_0x9615('0x16'))['db'];config[_0x9615('0x17')]=_['defaults'](config[_0x9615('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9615('0x17')]));require(_0x9615('0x18'))[_0x9615('0x19')](socket);var jayson=require(_0x9615('0x1a'));var client=jayson[_0x9615('0x1b')][_0x9615('0x1c')]({'port':0x232c});var client9002=jayson[_0x9615('0x1b')][_0x9615('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3d349c,_0x21d090,_0x17ff10,_0x23504b){return new BPromise(function(_0x1ac43e,_0x330557){var _0xbca9c5=_0x23504b||client;return _0xbca9c5['request'](_0x3d349c,_0x17ff10)[_0x9615('0x1d')](function(_0x3cfbb7){logger[_0x9615('0x1e')](_0x9615('0x1f'),_0x21d090,_0x9615('0x20'));logger[_0x9615('0x21')](_0x9615('0x22'),_0x21d090,_0x9615('0x20'),JSON[_0x9615('0x23')](_0x3cfbb7));if(_0x3cfbb7['error']){if(_0x3cfbb7[_0x9615('0x24')]['code']===0x1f4){logger['error'](_0x9615('0x1f'),_0x21d090,_0x3cfbb7[_0x9615('0x24')][_0x9615('0x25')]);return _0x330557(_0x3cfbb7[_0x9615('0x24')][_0x9615('0x25')]);}logger[_0x9615('0x24')](_0x9615('0x1f'),_0x21d090,_0x3cfbb7[_0x9615('0x24')][_0x9615('0x25')]);return _0x1ac43e(_0x3cfbb7[_0x9615('0x24')]['message']);}else{logger['info'](_0x9615('0x1f'),_0x21d090,_0x9615('0x20'));_0x1ac43e(_0x3cfbb7[_0x9615('0x26')][_0x9615('0x25')]);}})[_0x9615('0x27')](function(_0x345a58){logger[_0x9615('0x24')](_0x9615('0x1f'),_0x21d090,_0x345a58);_0x330557(_0x345a58);});});}function respondWithStatusCode(_0x11927a,_0x570ec9){_0x570ec9=_0x570ec9||0xcc;return function(_0x7fd8a4){if(_0x7fd8a4){return _0x11927a[_0x9615('0x28')](_0x570ec9);}return _0x11927a[_0x9615('0x29')](_0x570ec9)['end']();};}function respondWithResult(_0xb45d52,_0x380c09){_0x380c09=_0x380c09||0xc8;return function(_0x4e9ad2){if(_0x4e9ad2){return _0xb45d52[_0x9615('0x29')](_0x380c09)[_0x9615('0x2a')](_0x4e9ad2);}};}function respondWithFilteredResult(_0x404b29,_0x2f8363){return function(_0x4aa9d5){if(_0x4aa9d5){var _0x483c8c=typeof _0x2f8363['offset']===_0x9615('0x2b')&&typeof _0x2f8363[_0x9615('0x2c')]===_0x9615('0x2b');var _0x41a589=_0x4aa9d5['count'];var _0x3e2ffa=_0x483c8c?0x0:_0x2f8363['offset'];var _0x109984=_0x483c8c?_0x4aa9d5[_0x9615('0x2d')]:_0x2f8363[_0x9615('0x2e')]+_0x2f8363[_0x9615('0x2c')];var _0x58fb10;if(_0x109984>=_0x41a589){_0x109984=_0x41a589;_0x58fb10=0xc8;}else{_0x58fb10=0xce;}_0x404b29['status'](_0x58fb10);return _0x404b29[_0x9615('0x2f')](_0x9615('0x30'),_0x3e2ffa+'-'+_0x109984+'/'+_0x41a589)[_0x9615('0x2a')](_0x4aa9d5);}return null;};}function patchUpdates(_0x1300e4){return function(_0x26b0b6){try{jsonpatch[_0x9615('0x31')](_0x26b0b6,_0x1300e4,!![]);}catch(_0x13762c){return BPromise[_0x9615('0x32')](_0x13762c);}return _0x26b0b6[_0x9615('0x33')]();};}function saveUpdates(_0x195c51,_0x457e44){return function(_0x3fa56a){if(_0x3fa56a){return _0x3fa56a[_0x9615('0x34')](_0x195c51)[_0x9615('0x1d')](function(_0x55006c){return _0x55006c;});}return null;};}function removeEntity(_0x42f1f3,_0x16e0c1){return function(_0x46dc5d){if(_0x46dc5d){return _0x46dc5d[_0x9615('0x35')]()['then'](function(){_0x42f1f3[_0x9615('0x29')](0xcc)[_0x9615('0x36')]();});}};}function handleEntityNotFound(_0x10a846,_0x4d8d95){return function(_0x257be5){if(!_0x257be5){_0x10a846[_0x9615('0x28')](0x194);}return _0x257be5;};}function handleError(_0x5a7361,_0x144908){_0x144908=_0x144908||0x1f4;return function(_0x90358){logger['error'](_0x90358['stack']);if(_0x90358[_0x9615('0x37')]){delete _0x90358['name'];}_0x5a7361[_0x9615('0x29')](_0x144908)[_0x9615('0x38')](_0x90358);};}exports[_0x9615('0x39')]=function(_0x350689,_0x321e95){var _0x5965d1={},_0xc39be3={},_0x19e2ed={'count':0x0,'rows':[]};var _0x376d94=_[_0x9615('0x3a')](db['WhatsappMessage'][_0x9615('0x3b')],function(_0x41c13d){return{'name':_0x41c13d[_0x9615('0x3c')],'type':_0x41c13d['type'][_0x9615('0x3d')]};});_0xc39be3[_0x9615('0x3e')]=_[_0x9615('0x3a')](_0x376d94,'name');_0xc39be3[_0x9615('0x3f')]=_[_0x9615('0x40')](_0x350689['query']);_0xc39be3[_0x9615('0x41')]=_[_0x9615('0x42')](_0xc39be3[_0x9615('0x3e')],_0xc39be3[_0x9615('0x3f')]);_0x5965d1[_0x9615('0x43')]=_[_0x9615('0x42')](_0xc39be3[_0x9615('0x3e')],qs[_0x9615('0x44')](_0x350689[_0x9615('0x3f')][_0x9615('0x44')]));_0x5965d1[_0x9615('0x43')]=_0x5965d1[_0x9615('0x43')][_0x9615('0x45')]?_0x5965d1[_0x9615('0x43')]:_0xc39be3[_0x9615('0x3e')];if(!_0x350689[_0x9615('0x3f')]['hasOwnProperty'](_0x9615('0x46'))){_0x5965d1['limit']=qs[_0x9615('0x2c')](_0x350689[_0x9615('0x3f')][_0x9615('0x2c')]);_0x5965d1[_0x9615('0x2e')]=qs[_0x9615('0x2e')](_0x350689[_0x9615('0x3f')][_0x9615('0x2e')]);}_0x5965d1[_0x9615('0x47')]=qs[_0x9615('0x48')](_0x350689[_0x9615('0x3f')][_0x9615('0x48')]);_0x5965d1[_0x9615('0x49')]=qs[_0x9615('0x41')](_[_0x9615('0x4a')](_0x350689[_0x9615('0x3f')],_0xc39be3[_0x9615('0x41')]),_0x376d94);if(_0x350689[_0x9615('0x3f')][_0x9615('0x4b')]){_0x5965d1['where']=_[_0x9615('0x4c')](_0x5965d1[_0x9615('0x49')],{'$or':_['map'](_0x376d94,function(_0x13339d){if(_0x13339d[_0x9615('0x4d')]!==_0x9615('0x4e')){var _0x118f21={};_0x118f21[_0x13339d['name']]={'$like':'%'+_0x350689['query'][_0x9615('0x4b')]+'%'};return _0x118f21;}})});}_0x5965d1=_[_0x9615('0x4c')]({},_0x5965d1,_0x350689[_0x9615('0x4f')]);var _0x469a33={'where':_0x5965d1['where']};return db[_0x9615('0x50')][_0x9615('0x2d')](_0x469a33)[_0x9615('0x1d')](function(_0x55f9f5){_0x19e2ed[_0x9615('0x2d')]=_0x55f9f5;if(_0x350689[_0x9615('0x3f')]['includeAll']){_0x5965d1[_0x9615('0x51')]=[{'all':!![]}];}return db[_0x9615('0x50')][_0x9615('0x52')](_0x5965d1);})[_0x9615('0x1d')](function(_0x18280b){_0x19e2ed[_0x9615('0x53')]=_0x18280b;return _0x19e2ed;})[_0x9615('0x1d')](respondWithFilteredResult(_0x321e95,_0x5965d1))[_0x9615('0x27')](handleError(_0x321e95,null));};exports[_0x9615('0x54')]=function(_0x344076,_0x534539){var _0x542bf7={'raw':!![],'where':{'id':_0x344076['params']['id']}},_0x37d2ef={};_0x37d2ef[_0x9615('0x3e')]=_[_0x9615('0x40')](db[_0x9615('0x50')]['rawAttributes']);_0x37d2ef[_0x9615('0x3f')]=_[_0x9615('0x40')](_0x344076[_0x9615('0x3f')]);_0x37d2ef[_0x9615('0x41')]=_[_0x9615('0x42')](_0x37d2ef['model'],_0x37d2ef[_0x9615('0x3f')]);_0x542bf7[_0x9615('0x43')]=_[_0x9615('0x42')](_0x37d2ef[_0x9615('0x3e')],qs[_0x9615('0x44')](_0x344076[_0x9615('0x3f')][_0x9615('0x44')]));_0x542bf7[_0x9615('0x43')]=_0x542bf7[_0x9615('0x43')][_0x9615('0x45')]?_0x542bf7[_0x9615('0x43')]:_0x37d2ef['model'];if(_0x344076[_0x9615('0x3f')][_0x9615('0x55')]){_0x542bf7[_0x9615('0x51')]=[{'all':!![]}];}_0x542bf7=_[_0x9615('0x4c')]({},_0x542bf7,_0x344076['options']);return db[_0x9615('0x50')][_0x9615('0x56')](_0x542bf7)['then'](handleEntityNotFound(_0x534539,null))[_0x9615('0x1d')](respondWithResult(_0x534539,null))[_0x9615('0x27')](handleError(_0x534539,null));};exports[_0x9615('0x57')]=function(_0x49622a,_0xf315b0){return db[_0x9615('0x50')]['create'](_0x49622a['body'],{})[_0x9615('0x1d')](respondWithResult(_0xf315b0,0xc9))[_0x9615('0x27')](handleError(_0xf315b0,null));};exports[_0x9615('0x34')]=function(_0x2d0206,_0x2e908c){if(_0x2d0206[_0x9615('0x58')]['id']){delete _0x2d0206['body']['id'];}return db[_0x9615('0x50')][_0x9615('0x56')]({'where':{'id':_0x2d0206[_0x9615('0x59')]['id']}})[_0x9615('0x1d')](handleEntityNotFound(_0x2e908c,null))[_0x9615('0x1d')](saveUpdates(_0x2d0206[_0x9615('0x58')],null))[_0x9615('0x1d')](respondWithResult(_0x2e908c,null))[_0x9615('0x27')](handleError(_0x2e908c,null));};exports[_0x9615('0x35')]=function(_0x314a99,_0x3f11d9){return db[_0x9615('0x50')][_0x9615('0x56')]({'where':{'id':_0x314a99['params']['id']}})[_0x9615('0x1d')](handleEntityNotFound(_0x3f11d9,null))[_0x9615('0x1d')](removeEntity(_0x3f11d9,null))[_0x9615('0x27')](handleError(_0x3f11d9,null));};exports[_0x9615('0x5a')]=function(_0x11e741,_0x542f09){return db[_0x9615('0x50')]['describe']()['then'](respondWithResult(_0x542f09,null))[_0x9615('0x27')](handleError(_0x542f09,null));};var interaction_log=require(_0x9615('0x13'))('whatsapp-interactions');exports['accept']=function(_0x4f0434,_0xe44b15,_0x5c4635){var _0x438172={'agent':{},'channel':_0x9615('0x5b')};if(_0x4f0434[_0x9615('0x58')]['id']){delete _0x4f0434['body']['id'];}_0x4f0434[_0x9615('0x58')][_0x9615('0x5c')]=!![];_0x4f0434['body'][_0x9615('0x5d')]=moment()['format'](_0x9615('0x5e'));_0x4f0434['body']['UserId']=_0x4f0434['body'][_0x9615('0x5f')]||_0x4f0434[_0x9615('0x60')]['id'];_0x438172[_0x9615('0x61')]['id']=_0x4f0434[_0x9615('0x58')][_0x9615('0x5f')];return db[_0x9615('0x50')][_0x9615('0x56')]({'where':{'id':_0x4f0434[_0x9615('0x59')]['id'],'UserId':null}})[_0x9615('0x1d')](handleEntityNotFound(_0xe44b15,null))['then'](saveUpdates(_0x4f0434['body'],null))[_0x9615('0x1d')](function(_0x5ba7fe){if(_0x5ba7fe){_0x438172[_0x9615('0x25')]=_0x5ba7fe[_0x9615('0x62')]({'plain':!![]});return db[_0x9615('0x63')][_0x9615('0x56')]({'where':{'id':_0x5ba7fe[_0x9615('0x64')]}});}return null;})[_0x9615('0x1d')](handleEntityNotFound(_0xe44b15,null))['then'](function(_0x7e3186){if(_0x7e3186){return _0x7e3186[_0x9615('0x34')]({'UserId':_0x4f0434['body'][_0x9615('0x5f')],'read1stAt':_[_0x9615('0x65')](_0x7e3186['read1stAt'])?moment()[_0x9615('0x66')](_0x9615('0x5e')):undefined});}return null;})[_0x9615('0x1d')](function(_0x3e61f3){if(_0x3e61f3){_0x438172[_0x9615('0x67')]=_0x3e61f3[_0x9615('0x62')]({'plain':!![]});interaction_log[_0x9615('0x1e')](_0x9615('0x68'),_0x4f0434['user']['id'],_0x4f0434[_0x9615('0x60')]['name'],_0x4f0434[_0x9615('0x60')][_0x9615('0x69')],_0x438172[_0x9615('0x67')]['id'],_0x4f0434[_0x9615('0x58')]?JSON[_0x9615('0x23')](_0x4f0434[_0x9615('0x58')]):'null');return respondWithRpcPromise(_0x9615('0x6a'),_0x9615('0x6b'),_0x438172);}return null;})['then'](function(_0x4fe50d){var _0x5a05f7=_0x9615('0x6c')+_0x4fe50d[_0x9615('0x25')][_0x9615('0x6d')];return db[_0x9615('0x6e')][_0x9615('0x3f')](_0x5a05f7,{'type':db[_0x9615('0x6f')][_0x9615('0x70')][_0x9615('0x71')],'raw':!![]})['then'](function(_0xda219a){return _0xda219a;});})[_0x9615('0x1d')](function(_0x4b9138){if(_0x4b9138){_0x438172['message']['contact']=_0x4b9138[0x0];if(!_0x4f0434[_0x9615('0x58')][_0x9615('0x5f')])return;return db[_0x9615('0x72')][_0x9615('0x56')]({'where':{'id':_0x4f0434[_0x9615('0x58')][_0x9615('0x5f')],'role':_0x9615('0x61')},'attributes':['id',_0x9615('0x37'),_0x9615('0x73'),_0x9615('0x74'),_0x9615('0x75')],'raw':!![]});}return null;})[_0x9615('0x1d')](function(_0x50ee30){if(!_0x50ee30)return null;_0x438172[_0x9615('0x25')][_0x9615('0x61')]=_0x50ee30;return _0x438172;})[_0x9615('0x1d')](function(_0x18ccfd){if(_0x18ccfd){if(_0x4f0434[_0x9615('0x58')][_0x9615('0x76')]){_0x438172[_0x9615('0x25')][_0x9615('0x77')]=util['format'](_0x9615('0x78'),_0x4f0434['user'][_0x9615('0x37')]);_0x438172['message'][_0x9615('0x79')]=_0x438172[_0x9615('0x79')];_0x438172[_0x9615('0x25')][_0x9615('0x7a')]=_0x438172[_0x9615('0x79')];_0x438172[_0x9615('0x25')][_0x9615('0x7b')]=_0x9615('0x7c');return respondWithRpcPromise('EventManager',_0x9615('0x7d'),{'event':_0x9615('0x7e'),'message':_0x438172[_0x9615('0x25')]},client9002)['then'](function(){return _0x438172;});}return _0x438172;}return null;})[_0x9615('0x1d')](respondWithResult(_0xe44b15,null))[_0x9615('0x27')](handleError(_0xe44b15,null));};var interaction_log=require(_0x9615('0x13'))(_0x9615('0x7f'));exports[_0x9615('0x32')]=function(_0x4bac24,_0x519352,_0x786f7c){var _0x4e2a22={'agent':{},'channel':_0x9615('0x5b')};if(_0x4bac24[_0x9615('0x58')]['id']){delete _0x4bac24[_0x9615('0x58')]['id'];}_0x4bac24[_0x9615('0x58')][_0x9615('0x5f')]=_0x4bac24[_0x9615('0x58')][_0x9615('0x5f')]||_0x4bac24[_0x9615('0x60')]['id'];_0x4e2a22['agent']['id']=_0x4bac24[_0x9615('0x58')][_0x9615('0x5f')];return db[_0x9615('0x50')]['find']({'where':{'id':_0x4bac24['params']['id'],'UserId':null}})[_0x9615('0x1d')](handleEntityNotFound(_0x519352,null))[_0x9615('0x1d')](function(_0x4e8afa){if(_0x4e8afa){_0x4e2a22[_0x9615('0x25')]=_0x4e8afa[_0x9615('0x62')]({'plain':!![]});return db['WhatsappInteraction'][_0x9615('0x56')]({'where':{'id':_0x4e8afa[_0x9615('0x64')]}});}return null;})[_0x9615('0x1d')](handleEntityNotFound(_0x519352,null))[_0x9615('0x1d')](function(_0x446318){if(_0x446318){_0x4e2a22[_0x9615('0x67')]=_0x446318[_0x9615('0x62')]({'plain':!![]});interaction_log[_0x9615('0x1e')](_0x9615('0x80'),_0x4bac24[_0x9615('0x60')]['id'],_0x4bac24[_0x9615('0x60')][_0x9615('0x37')],_0x4bac24[_0x9615('0x60')][_0x9615('0x69')],_0x4e2a22[_0x9615('0x67')]['id'],_0x4bac24['body']?JSON[_0x9615('0x23')](_0x4bac24[_0x9615('0x58')]):_0x9615('0x81'));return respondWithRpcPromise(_0x9615('0x82'),'rejectMessage',_0x4e2a22);}return null;})[_0x9615('0x1d')](function(_0x146b16){var _0xf4bf45=_0x9615('0x6c')+_0x146b16[_0x9615('0x25')][_0x9615('0x6d')];return db[_0x9615('0x6e')][_0x9615('0x3f')](_0xf4bf45,{'type':db[_0x9615('0x6f')]['QueryTypes'][_0x9615('0x71')],'raw':!![]})[_0x9615('0x1d')](function(_0x23c11d){return _0x23c11d;});})['then'](function(_0x5e29e6){if(_0x5e29e6){_0x4e2a22[_0x9615('0x25')][_0x9615('0x83')]=_0x5e29e6[0x0];if(!_0x4bac24[_0x9615('0x58')][_0x9615('0x5f')])return;return db[_0x9615('0x72')][_0x9615('0x56')]({'where':{'id':_0x4bac24[_0x9615('0x58')][_0x9615('0x5f')],'role':_0x9615('0x61')},'attributes':['id',_0x9615('0x37'),'fullname',_0x9615('0x74'),'internal'],'raw':!![]});}return null;})[_0x9615('0x1d')](function(_0x3347ac){if(!_0x3347ac)return null;_0x4e2a22['message'][_0x9615('0x61')]=_0x3347ac;return _0x4e2a22;})[_0x9615('0x1d')](function(_0x22ab33){if(_0x22ab33){_0x22ab33[_0x9615('0x25')]['interface']=util[_0x9615('0x66')]('SIP/%s',_0x4bac24[_0x9615('0x60')][_0x9615('0x37')]);_0x22ab33[_0x9615('0x25')][_0x9615('0x79')]=_0x4e2a22[_0x9615('0x79')];_0x22ab33[_0x9615('0x25')]['motionChannel']=_0x4e2a22[_0x9615('0x79')];_0x22ab33[_0x9615('0x25')][_0x9615('0x7b')]='reject';respondWithRpcPromise('EventManager',_0x9615('0x7d'),{'event':_0x9615('0x84'),'message':_0x22ab33[_0x9615('0x25')]},client9002);return _0x4e2a22;}return null;})[_0x9615('0x1d')](respondWithResult(_0x519352,null))[_0x9615('0x27')](handleError(_0x519352,null));};exports[_0x9615('0x29')]=function(_0x8ba4c2,_0x3f4072,_0x45dc27){if(_0x8ba4c2[_0x9615('0x58')]['id']){delete _0x8ba4c2[_0x9615('0x58')]['id'];}var _0x2a5327;return db[_0x9615('0x50')][_0x9615('0x56')]({'where':{'id':_0x8ba4c2[_0x9615('0x59')]['id']}})[_0x9615('0x1d')](handleEntityNotFound(_0x3f4072,null))['then'](function(_0x53092){if(_0x53092){_0x2a5327=_0x53092;return db[_0x9615('0x85')]['find']({'where':{'id':_0x53092[_0x9615('0x86')]}});}})[_0x9615('0x1d')](handleEntityNotFound(_0x3f4072,null))[_0x9615('0x1d')](function(_0x46f14a){if(_0x46f14a){logger[_0x9615('0x21')](_0x9615('0x87'),_0x9615('0x29'),_0x9615('0x88'),_0x46f14a[_0x9615('0x4d')],util[_0x9615('0x89')](_0x8ba4c2[_0x9615('0x58')],{'showHidden':![],'depth':null}));switch(_0x46f14a[_0x9615('0x4d')]){case'twilio':if(_0x8ba4c2[_0x9615('0x58')]['MessageSid']&&_0x8ba4c2['body'][_0x9615('0x8a')]===_0x2a5327[_0x9615('0x8b')]&&_0x8ba4c2['body'][_0x9615('0x8c')]&&_0x8ba4c2[_0x9615('0x58')][_0x9615('0x8c')]===_0x9615('0x5c')){return _0x2a5327[_0x9615('0x34')]({'read':!![]});}else{logger[_0x9615('0x24')](_0x9615('0x8d'),_0x9615('0x29'),_0x9615('0x8e'),util[_0x9615('0x89')](_0x8ba4c2['body'],{'showHidden':![],'depth':null}));}break;}return _0x2a5327;}})[_0x9615('0x1d')](respondWithResult(_0x3f4072,null))['catch'](handleError(_0x3f4072,null));}; \ No newline at end of file +var _0xfa37=['sequelize','SELECT','User','agent','interface','channel','EventManager','acceptmessage','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','QueryTypes','contact','fullname','email','internal','SIP/%s','motionChannel','rejectmessage','WhatsappAccount','WhatsappAccountId','inspect','twilio','MessageSid','messageId','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','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','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','destroy','name','index','map','WhatsappMessage','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','show','params','includeAll','find','create','update','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId'];(function(_0x8ea2d1,_0x373583){var _0x4cb6db=function(_0x1e802b){while(--_0x1e802b){_0x8ea2d1['push'](_0x8ea2d1['shift']());}};_0x4cb6db(++_0x373583);}(_0xfa37,0x128));var _0x7fa3=function(_0x591796,_0x4a1624){_0x591796=_0x591796-0x0;var _0x3ed4cf=_0xfa37[_0x591796];return _0x3ed4cf;};'use strict';var emlformat=require(_0x7fa3('0x0'));var rimraf=require(_0x7fa3('0x1'));var zipdir=require(_0x7fa3('0x2'));var jsonpatch=require(_0x7fa3('0x3'));var rp=require(_0x7fa3('0x4'));var moment=require(_0x7fa3('0x5'));var BPromise=require(_0x7fa3('0x6'));var Mustache=require('mustache');var util=require(_0x7fa3('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7fa3('0x8'));var ejs=require(_0x7fa3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7fa3('0xa'));var squel=require('squel');var crypto=require(_0x7fa3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7fa3('0xc'));var toCsv=require(_0x7fa3('0x8'));var querystring=require('querystring');var Papa=require(_0x7fa3('0xd'));var Redis=require(_0x7fa3('0xe'));var authService=require(_0x7fa3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7fa3('0x10'));var hardwareService=require(_0x7fa3('0x11'));var logger=require(_0x7fa3('0x12'))('api');var utils=require(_0x7fa3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7fa3('0x14'));var db=require(_0x7fa3('0x15'))['db'];config[_0x7fa3('0x16')]=_[_0x7fa3('0x17')](config[_0x7fa3('0x16')],{'host':_0x7fa3('0x18'),'port':0x18eb});var socket=require(_0x7fa3('0x19'))(new Redis(config['redis']));require(_0x7fa3('0x1a'))[_0x7fa3('0x1b')](socket);var jayson=require(_0x7fa3('0x1c'));var client=jayson[_0x7fa3('0x1d')][_0x7fa3('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x7fa3('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xefaadb,_0x5be0da,_0x4c0818,_0x13eb69){return new BPromise(function(_0x5c93c2,_0x915f28){var _0x9477e9=_0x13eb69||client;return _0x9477e9[_0x7fa3('0x1f')](_0xefaadb,_0x4c0818)[_0x7fa3('0x20')](function(_0x10bd2c){logger[_0x7fa3('0x21')](_0x7fa3('0x22'),_0x5be0da,_0x7fa3('0x23'));logger[_0x7fa3('0x24')](_0x7fa3('0x25'),_0x5be0da,'request\x20sent',JSON[_0x7fa3('0x26')](_0x10bd2c));if(_0x10bd2c[_0x7fa3('0x27')]){if(_0x10bd2c['error']['code']===0x1f4){logger[_0x7fa3('0x27')](_0x7fa3('0x22'),_0x5be0da,_0x10bd2c[_0x7fa3('0x27')][_0x7fa3('0x28')]);return _0x915f28(_0x10bd2c['error'][_0x7fa3('0x28')]);}logger[_0x7fa3('0x27')](_0x7fa3('0x22'),_0x5be0da,_0x10bd2c[_0x7fa3('0x27')][_0x7fa3('0x28')]);return _0x5c93c2(_0x10bd2c['error'][_0x7fa3('0x28')]);}else{logger['info'](_0x7fa3('0x22'),_0x5be0da,_0x7fa3('0x23'));_0x5c93c2(_0x10bd2c[_0x7fa3('0x29')]['message']);}})[_0x7fa3('0x2a')](function(_0xf0c986){logger[_0x7fa3('0x27')](_0x7fa3('0x22'),_0x5be0da,_0xf0c986);_0x915f28(_0xf0c986);});});}function respondWithStatusCode(_0xdaf64c,_0x571843){_0x571843=_0x571843||0xcc;return function(_0x7b0a1e){if(_0x7b0a1e){return _0xdaf64c[_0x7fa3('0x2b')](_0x571843);}return _0xdaf64c[_0x7fa3('0x2c')](_0x571843)[_0x7fa3('0x2d')]();};}function respondWithResult(_0x429584,_0x3bfd32){_0x3bfd32=_0x3bfd32||0xc8;return function(_0x1fd0b9){if(_0x1fd0b9){return _0x429584['status'](_0x3bfd32)[_0x7fa3('0x2e')](_0x1fd0b9);}};}function respondWithFilteredResult(_0x3e1dc7,_0x444de6){return function(_0x2887f9){if(_0x2887f9){var _0x4fb1d7=typeof _0x444de6[_0x7fa3('0x2f')]===_0x7fa3('0x30')&&typeof _0x444de6['limit']==='undefined';var _0x59cf87=_0x2887f9['count'];var _0x30fe46=_0x4fb1d7?0x0:_0x444de6['offset'];var _0x4dbfff=_0x4fb1d7?_0x2887f9[_0x7fa3('0x31')]:_0x444de6[_0x7fa3('0x2f')]+_0x444de6[_0x7fa3('0x32')];var _0x2c0cfb;if(_0x4dbfff>=_0x59cf87){_0x4dbfff=_0x59cf87;_0x2c0cfb=0xc8;}else{_0x2c0cfb=0xce;}_0x3e1dc7[_0x7fa3('0x2c')](_0x2c0cfb);return _0x3e1dc7[_0x7fa3('0x33')](_0x7fa3('0x34'),_0x30fe46+'-'+_0x4dbfff+'/'+_0x59cf87)['json'](_0x2887f9);}return null;};}function patchUpdates(_0x17428b){return function(_0x2b89ab){try{jsonpatch[_0x7fa3('0x35')](_0x2b89ab,_0x17428b,!![]);}catch(_0x532f67){return BPromise[_0x7fa3('0x36')](_0x532f67);}return _0x2b89ab['save']();};}function saveUpdates(_0x5d3be6,_0x129e76){return function(_0x4c4788){if(_0x4c4788){return _0x4c4788['update'](_0x5d3be6)[_0x7fa3('0x20')](function(_0x2bd6d2){return _0x2bd6d2;});}return null;};}function removeEntity(_0x3bb792,_0x5541a4){return function(_0x49714d){if(_0x49714d){return _0x49714d[_0x7fa3('0x37')]()[_0x7fa3('0x20')](function(){_0x3bb792['status'](0xcc)[_0x7fa3('0x2d')]();});}};}function handleEntityNotFound(_0x544855,_0x59b5fe){return function(_0x43c553){if(!_0x43c553){_0x544855['sendStatus'](0x194);}return _0x43c553;};}function handleError(_0x226019,_0x26c29a){_0x26c29a=_0x26c29a||0x1f4;return function(_0x24b655){logger['error'](_0x24b655['stack']);if(_0x24b655['name']){delete _0x24b655[_0x7fa3('0x38')];}_0x226019[_0x7fa3('0x2c')](_0x26c29a)['send'](_0x24b655);};}exports[_0x7fa3('0x39')]=function(_0xf5cc16,_0x53a342){var _0x26c28e={},_0x178279={},_0x950e30={'count':0x0,'rows':[]};var _0x3709fc=_[_0x7fa3('0x3a')](db[_0x7fa3('0x3b')][_0x7fa3('0x3c')],function(_0x2e2076){return{'name':_0x2e2076['fieldName'],'type':_0x2e2076[_0x7fa3('0x3d')][_0x7fa3('0x3e')]};});_0x178279[_0x7fa3('0x3f')]=_[_0x7fa3('0x3a')](_0x3709fc,_0x7fa3('0x38'));_0x178279[_0x7fa3('0x40')]=_[_0x7fa3('0x41')](_0xf5cc16['query']);_0x178279[_0x7fa3('0x42')]=_['intersection'](_0x178279[_0x7fa3('0x3f')],_0x178279['query']);_0x26c28e[_0x7fa3('0x43')]=_[_0x7fa3('0x44')](_0x178279[_0x7fa3('0x3f')],qs[_0x7fa3('0x45')](_0xf5cc16[_0x7fa3('0x40')]['fields']));_0x26c28e[_0x7fa3('0x43')]=_0x26c28e[_0x7fa3('0x43')][_0x7fa3('0x46')]?_0x26c28e[_0x7fa3('0x43')]:_0x178279['model'];if(!_0xf5cc16[_0x7fa3('0x40')][_0x7fa3('0x47')](_0x7fa3('0x48'))){_0x26c28e[_0x7fa3('0x32')]=qs['limit'](_0xf5cc16[_0x7fa3('0x40')][_0x7fa3('0x32')]);_0x26c28e[_0x7fa3('0x2f')]=qs[_0x7fa3('0x2f')](_0xf5cc16[_0x7fa3('0x40')][_0x7fa3('0x2f')]);}_0x26c28e['order']=qs[_0x7fa3('0x49')](_0xf5cc16[_0x7fa3('0x40')][_0x7fa3('0x49')]);_0x26c28e[_0x7fa3('0x4a')]=qs[_0x7fa3('0x42')](_[_0x7fa3('0x4b')](_0xf5cc16[_0x7fa3('0x40')],_0x178279[_0x7fa3('0x42')]),_0x3709fc);if(_0xf5cc16['query'][_0x7fa3('0x4c')]){_0x26c28e[_0x7fa3('0x4a')]=_['merge'](_0x26c28e['where'],{'$or':_[_0x7fa3('0x3a')](_0x3709fc,function(_0x36cae4){if(_0x36cae4[_0x7fa3('0x3d')]!==_0x7fa3('0x4d')){var _0x1d0eaf={};_0x1d0eaf[_0x36cae4[_0x7fa3('0x38')]]={'$like':'%'+_0xf5cc16['query'][_0x7fa3('0x4c')]+'%'};return _0x1d0eaf;}})});}_0x26c28e=_[_0x7fa3('0x4e')]({},_0x26c28e,_0xf5cc16['options']);var _0x533e37={'where':_0x26c28e[_0x7fa3('0x4a')]};return db[_0x7fa3('0x3b')][_0x7fa3('0x31')](_0x533e37)[_0x7fa3('0x20')](function(_0x3b4773){_0x950e30[_0x7fa3('0x31')]=_0x3b4773;if(_0xf5cc16['query']['includeAll']){_0x26c28e[_0x7fa3('0x4f')]=[{'all':!![]}];}return db[_0x7fa3('0x3b')][_0x7fa3('0x50')](_0x26c28e);})[_0x7fa3('0x20')](function(_0x19ab37){_0x950e30[_0x7fa3('0x51')]=_0x19ab37;return _0x950e30;})['then'](respondWithFilteredResult(_0x53a342,_0x26c28e))[_0x7fa3('0x2a')](handleError(_0x53a342,null));};exports[_0x7fa3('0x52')]=function(_0x346fea,_0x24cef7){var _0x1d314e={'raw':!![],'where':{'id':_0x346fea[_0x7fa3('0x53')]['id']}},_0x49dcad={};_0x49dcad['model']=_['keys'](db['WhatsappMessage']['rawAttributes']);_0x49dcad['query']=_['keys'](_0x346fea[_0x7fa3('0x40')]);_0x49dcad['filters']=_[_0x7fa3('0x44')](_0x49dcad[_0x7fa3('0x3f')],_0x49dcad['query']);_0x1d314e['attributes']=_[_0x7fa3('0x44')](_0x49dcad[_0x7fa3('0x3f')],qs[_0x7fa3('0x45')](_0x346fea[_0x7fa3('0x40')]['fields']));_0x1d314e[_0x7fa3('0x43')]=_0x1d314e['attributes'][_0x7fa3('0x46')]?_0x1d314e[_0x7fa3('0x43')]:_0x49dcad[_0x7fa3('0x3f')];if(_0x346fea[_0x7fa3('0x40')][_0x7fa3('0x54')]){_0x1d314e[_0x7fa3('0x4f')]=[{'all':!![]}];}_0x1d314e=_[_0x7fa3('0x4e')]({},_0x1d314e,_0x346fea['options']);return db['WhatsappMessage'][_0x7fa3('0x55')](_0x1d314e)[_0x7fa3('0x20')](handleEntityNotFound(_0x24cef7,null))[_0x7fa3('0x20')](respondWithResult(_0x24cef7,null))['catch'](handleError(_0x24cef7,null));};exports[_0x7fa3('0x56')]=function(_0x446c14,_0x6af115){return db[_0x7fa3('0x3b')][_0x7fa3('0x56')](_0x446c14['body'],{})['then'](respondWithResult(_0x6af115,0xc9))[_0x7fa3('0x2a')](handleError(_0x6af115,null));};exports[_0x7fa3('0x57')]=function(_0x4ee9c1,_0x1da2de){if(_0x4ee9c1[_0x7fa3('0x58')]['id']){delete _0x4ee9c1[_0x7fa3('0x58')]['id'];}return db[_0x7fa3('0x3b')][_0x7fa3('0x55')]({'where':{'id':_0x4ee9c1[_0x7fa3('0x53')]['id']}})[_0x7fa3('0x20')](handleEntityNotFound(_0x1da2de,null))['then'](saveUpdates(_0x4ee9c1[_0x7fa3('0x58')],null))[_0x7fa3('0x20')](respondWithResult(_0x1da2de,null))['catch'](handleError(_0x1da2de,null));};exports[_0x7fa3('0x37')]=function(_0x145796,_0x5c7dcb){return db['WhatsappMessage'][_0x7fa3('0x55')]({'where':{'id':_0x145796[_0x7fa3('0x53')]['id']}})[_0x7fa3('0x20')](handleEntityNotFound(_0x5c7dcb,null))[_0x7fa3('0x20')](removeEntity(_0x5c7dcb,null))[_0x7fa3('0x2a')](handleError(_0x5c7dcb,null));};exports[_0x7fa3('0x59')]=function(_0x414d8f,_0x745d69){return db[_0x7fa3('0x3b')]['describe']()['then'](respondWithResult(_0x745d69,null))[_0x7fa3('0x2a')](handleError(_0x745d69,null));};var interaction_log=require(_0x7fa3('0x12'))(_0x7fa3('0x5a'));exports[_0x7fa3('0x5b')]=function(_0x5e89ee,_0x581295,_0x20e113){var _0x280d31={'agent':{},'channel':_0x7fa3('0x5c')};if(_0x5e89ee[_0x7fa3('0x58')]['id']){delete _0x5e89ee['body']['id'];}_0x5e89ee[_0x7fa3('0x58')][_0x7fa3('0x5d')]=!![];_0x5e89ee[_0x7fa3('0x58')][_0x7fa3('0x5e')]=moment()[_0x7fa3('0x5f')](_0x7fa3('0x60'));_0x5e89ee[_0x7fa3('0x58')][_0x7fa3('0x61')]=_0x5e89ee[_0x7fa3('0x58')][_0x7fa3('0x61')]||_0x5e89ee[_0x7fa3('0x62')]['id'];_0x280d31['agent']['id']=_0x5e89ee['body'][_0x7fa3('0x61')];return db[_0x7fa3('0x3b')][_0x7fa3('0x55')]({'where':{'id':_0x5e89ee['params']['id'],'UserId':null}})[_0x7fa3('0x20')](handleEntityNotFound(_0x581295,null))['then'](saveUpdates(_0x5e89ee['body'],null))[_0x7fa3('0x20')](function(_0x53decf){if(_0x53decf){_0x280d31[_0x7fa3('0x28')]=_0x53decf[_0x7fa3('0x63')]({'plain':!![]});return db[_0x7fa3('0x64')][_0x7fa3('0x55')]({'where':{'id':_0x53decf['WhatsappInteractionId']}});}return null;})[_0x7fa3('0x20')](handleEntityNotFound(_0x581295,null))[_0x7fa3('0x20')](function(_0xd908b6){if(_0xd908b6){return _0xd908b6[_0x7fa3('0x57')]({'UserId':_0x5e89ee[_0x7fa3('0x58')][_0x7fa3('0x61')],'read1stAt':_['isNil'](_0xd908b6[_0x7fa3('0x65')])?moment()[_0x7fa3('0x5f')](_0x7fa3('0x60')):undefined});}return null;})['then'](function(_0x3a7618){if(_0x3a7618){_0x280d31['interaction']=_0x3a7618[_0x7fa3('0x63')]({'plain':!![]});interaction_log[_0x7fa3('0x21')](_0x7fa3('0x66'),_0x5e89ee['user']['id'],_0x5e89ee[_0x7fa3('0x62')][_0x7fa3('0x38')],_0x5e89ee[_0x7fa3('0x62')][_0x7fa3('0x67')],_0x280d31[_0x7fa3('0x68')]['id'],_0x5e89ee['body']?JSON[_0x7fa3('0x26')](_0x5e89ee[_0x7fa3('0x58')]):_0x7fa3('0x69'));return respondWithRpcPromise(_0x7fa3('0x6a'),'acceptMessage',_0x280d31);}return null;})[_0x7fa3('0x20')](function(_0x4a4b6d){var _0x3b34b6=_0x7fa3('0x6b')+_0x4a4b6d['message'][_0x7fa3('0x6c')];return db[_0x7fa3('0x6d')]['query'](_0x3b34b6,{'type':db['Sequelize']['QueryTypes'][_0x7fa3('0x6e')],'raw':!![]})[_0x7fa3('0x20')](function(_0x317ba4){return _0x317ba4;});})[_0x7fa3('0x20')](function(_0x57dfee){if(_0x57dfee){_0x280d31[_0x7fa3('0x28')]['contact']=_0x57dfee[0x0];if(!_0x5e89ee[_0x7fa3('0x58')][_0x7fa3('0x61')])return;return db[_0x7fa3('0x6f')][_0x7fa3('0x55')]({'where':{'id':_0x5e89ee['body']['UserId'],'role':_0x7fa3('0x70')},'attributes':['id','name','fullname','email','internal'],'raw':!![]});}return null;})[_0x7fa3('0x20')](function(_0x13faff){if(!_0x13faff)return null;_0x280d31[_0x7fa3('0x28')][_0x7fa3('0x70')]=_0x13faff;return _0x280d31;})[_0x7fa3('0x20')](function(_0x4dca8b){if(_0x4dca8b){if(_0x5e89ee[_0x7fa3('0x58')]['manual']){_0x280d31[_0x7fa3('0x28')][_0x7fa3('0x71')]=util[_0x7fa3('0x5f')]('SIP/%s',_0x5e89ee[_0x7fa3('0x62')][_0x7fa3('0x38')]);_0x280d31[_0x7fa3('0x28')]['channel']=_0x280d31[_0x7fa3('0x72')];_0x280d31[_0x7fa3('0x28')]['motionChannel']=_0x280d31[_0x7fa3('0x72')];_0x280d31[_0x7fa3('0x28')]['event']=_0x7fa3('0x5b');return respondWithRpcPromise(_0x7fa3('0x73'),'EventManager',{'event':_0x7fa3('0x74'),'message':_0x280d31[_0x7fa3('0x28')]},client9002)[_0x7fa3('0x20')](function(){return _0x280d31;});}return _0x280d31;}return null;})[_0x7fa3('0x20')](respondWithResult(_0x581295,null))[_0x7fa3('0x2a')](handleError(_0x581295,null));};var interaction_log=require('../../config/logger')(_0x7fa3('0x5a'));exports[_0x7fa3('0x36')]=function(_0x47281d,_0x3ab0a8,_0x16a727){var _0x548f4f={'agent':{},'channel':'whatsapp'};if(_0x47281d[_0x7fa3('0x58')]['id']){delete _0x47281d[_0x7fa3('0x58')]['id'];}_0x47281d[_0x7fa3('0x58')][_0x7fa3('0x61')]=_0x47281d['body'][_0x7fa3('0x61')]||_0x47281d['user']['id'];_0x548f4f['agent']['id']=_0x47281d[_0x7fa3('0x58')][_0x7fa3('0x61')];return db[_0x7fa3('0x3b')][_0x7fa3('0x55')]({'where':{'id':_0x47281d[_0x7fa3('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3ab0a8,null))[_0x7fa3('0x20')](function(_0x473893){if(_0x473893){_0x548f4f['message']=_0x473893[_0x7fa3('0x63')]({'plain':!![]});return db['WhatsappInteraction'][_0x7fa3('0x55')]({'where':{'id':_0x473893[_0x7fa3('0x75')]}});}return null;})[_0x7fa3('0x20')](handleEntityNotFound(_0x3ab0a8,null))[_0x7fa3('0x20')](function(_0x67c59d){if(_0x67c59d){_0x548f4f[_0x7fa3('0x68')]=_0x67c59d[_0x7fa3('0x63')]({'plain':!![]});interaction_log['info'](_0x7fa3('0x76'),_0x47281d[_0x7fa3('0x62')]['id'],_0x47281d['user'][_0x7fa3('0x38')],_0x47281d['user']['role'],_0x548f4f[_0x7fa3('0x68')]['id'],_0x47281d['body']?JSON[_0x7fa3('0x26')](_0x47281d[_0x7fa3('0x58')]):'null');return respondWithRpcPromise(_0x7fa3('0x77'),'rejectMessage',_0x548f4f);}return null;})['then'](function(_0x2fbff0){var _0x350ba8=_0x7fa3('0x6b')+_0x2fbff0[_0x7fa3('0x28')][_0x7fa3('0x6c')];return db[_0x7fa3('0x6d')][_0x7fa3('0x40')](_0x350ba8,{'type':db['Sequelize'][_0x7fa3('0x78')]['SELECT'],'raw':!![]})[_0x7fa3('0x20')](function(_0x2fd142){return _0x2fd142;});})['then'](function(_0x51e8b0){if(_0x51e8b0){_0x548f4f['message'][_0x7fa3('0x79')]=_0x51e8b0[0x0];if(!_0x47281d[_0x7fa3('0x58')][_0x7fa3('0x61')])return;return db[_0x7fa3('0x6f')][_0x7fa3('0x55')]({'where':{'id':_0x47281d[_0x7fa3('0x58')][_0x7fa3('0x61')],'role':_0x7fa3('0x70')},'attributes':['id','name',_0x7fa3('0x7a'),_0x7fa3('0x7b'),_0x7fa3('0x7c')],'raw':!![]});}return null;})[_0x7fa3('0x20')](function(_0x2b9c7e){if(!_0x2b9c7e)return null;_0x548f4f[_0x7fa3('0x28')][_0x7fa3('0x70')]=_0x2b9c7e;return _0x548f4f;})['then'](function(_0x7797c9){if(_0x7797c9){_0x7797c9[_0x7fa3('0x28')][_0x7fa3('0x71')]=util['format'](_0x7fa3('0x7d'),_0x47281d[_0x7fa3('0x62')][_0x7fa3('0x38')]);_0x7797c9[_0x7fa3('0x28')][_0x7fa3('0x72')]=_0x548f4f[_0x7fa3('0x72')];_0x7797c9[_0x7fa3('0x28')][_0x7fa3('0x7e')]=_0x548f4f['channel'];_0x7797c9['message']['event']=_0x7fa3('0x36');respondWithRpcPromise('EventManager',_0x7fa3('0x73'),{'event':_0x7fa3('0x7f'),'message':_0x7797c9[_0x7fa3('0x28')]},client9002);return _0x548f4f;}return null;})['then'](respondWithResult(_0x3ab0a8,null))[_0x7fa3('0x2a')](handleError(_0x3ab0a8,null));};exports[_0x7fa3('0x2c')]=function(_0x2d1908,_0x1b65ab,_0x4cbe8d){if(_0x2d1908[_0x7fa3('0x58')]['id']){delete _0x2d1908['body']['id'];}var _0x1841b;return db['WhatsappMessage']['find']({'where':{'id':_0x2d1908['params']['id']}})['then'](handleEntityNotFound(_0x1b65ab,null))['then'](function(_0x30f6ee){if(_0x30f6ee){_0x1841b=_0x30f6ee;return db[_0x7fa3('0x80')]['find']({'where':{'id':_0x30f6ee[_0x7fa3('0x81')]}});}})[_0x7fa3('0x20')](handleEntityNotFound(_0x1b65ab,null))[_0x7fa3('0x20')](function(_0x418078){if(_0x418078){logger[_0x7fa3('0x24')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x7fa3('0x2c'),'received\x20delivery\x20report\x20from',_0x418078['type'],util[_0x7fa3('0x82')](_0x2d1908['body'],{'showHidden':![],'depth':null}));switch(_0x418078[_0x7fa3('0x3d')]){case _0x7fa3('0x83'):if(_0x2d1908[_0x7fa3('0x58')][_0x7fa3('0x84')]&&_0x2d1908['body'][_0x7fa3('0x84')]===_0x1841b[_0x7fa3('0x85')]&&_0x2d1908[_0x7fa3('0x58')]['MessageStatus']&&_0x2d1908[_0x7fa3('0x58')]['MessageStatus']===_0x7fa3('0x5d')){return _0x1841b[_0x7fa3('0x57')]({'read':!![]});}else{logger[_0x7fa3('0x27')](_0x7fa3('0x86'),_0x7fa3('0x2c'),_0x7fa3('0x83'),util['inspect'](_0x2d1908['body'],{'showHidden':![],'depth':null}));}break;}return _0x1841b;}})[_0x7fa3('0x20')](respondWithResult(_0x1b65ab,null))[_0x7fa3('0x2a')](handleError(_0x1b65ab,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 7dab843..e224d04 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 _0xeffd=['save','update','remove','emit','hasOwnProperty','hook','exports','events','WhatsappMessage','setMaxListeners'];(function(_0xeef94c,_0x1db3f7){var _0x447522=function(_0x16d3d5){while(--_0x16d3d5){_0xeef94c['push'](_0xeef94c['shift']());}};_0x447522(++_0x1db3f7);}(_0xeffd,0x6b));var _0xdeff=function(_0x54f7db,_0x169c13){_0x54f7db=_0x54f7db-0x0;var _0x1fe536=_0xeffd[_0x54f7db];return _0x1fe536;};'use strict';var EventEmitter=require(_0xdeff('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xdeff('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xdeff('0x2')](0x0);var events={'afterCreate':_0xdeff('0x3'),'afterUpdate':_0xdeff('0x4'),'afterDestroy':_0xdeff('0x5')};function emitEvent(_0x4dac0){return function(_0x298274,_0x2881fd,_0x8315d4){WhatsappMessageEvents[_0xdeff('0x6')](_0x4dac0+':'+_0x298274['id'],_0x298274);WhatsappMessageEvents[_0xdeff('0x6')](_0x4dac0,_0x298274);_0x8315d4(null);};}for(var e in events){if(events[_0xdeff('0x7')](e)){var event=events[e];WhatsappMessage[_0xdeff('0x8')](e,emitEvent(event));}}module[_0xdeff('0x9')]=WhatsappMessageEvents; \ No newline at end of file +var _0x94df=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','emit'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0x94df,0xa3));var _0xf94d=function(_0x50a62f,_0x2bdd7f){_0x50a62f=_0x50a62f-0x0;var _0x3d410b=_0x94df[_0x50a62f];return _0x3d410b;};'use strict';var EventEmitter=require(_0xf94d('0x0'));var WhatsappMessage=require(_0xf94d('0x1'))['db'][_0xf94d('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf94d('0x3')](0x0);var events={'afterCreate':_0xf94d('0x4'),'afterUpdate':_0xf94d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x468c7e){return function(_0x1ca087,_0x1aa1b1,_0x29b6fd){WhatsappMessageEvents[_0xf94d('0x6')](_0x468c7e+':'+_0x1ca087['id'],_0x1ca087);WhatsappMessageEvents[_0xf94d('0x6')](_0x468c7e,_0x1ca087);_0x29b6fd(null);};}for(var e in events){if(events[_0xf94d('0x7')](e)){var event=events[e];WhatsappMessage[_0xf94d('0x8')](e,emitEvent(event));}}module[_0xf94d('0x9')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 64a7893..afcfeb4 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 _0xaaa7=['WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','statuses','message_id','err','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','models','get','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','findOne','then','update','createdAt','catch','error','WhatsappAccountId','type','twilio','accountSid','authToken','create','body','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xaaa7,0x15e));var _0x7aaa=function(_0x1decaf,_0x17b093){_0x1decaf=_0x1decaf-0x0;var _0x116e85=_0xaaa7[_0x1decaf];return _0x116e85;};'use strict';var _=require('lodash');var util=require(_0x7aaa('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7aaa('0x1'));var BPromise=require(_0x7aaa('0x2'));var rp=require(_0x7aaa('0x3'));var fetch=require(_0x7aaa('0x4'));var fs=require('fs');var path=require(_0x7aaa('0x5'));var rimraf=require(_0x7aaa('0x6'));var config=require(_0x7aaa('0x7'));var attributes=require(_0x7aaa('0x8'));module['exports']=function(_0xa6141a,_0x544f44){return _0xa6141a[_0x7aaa('0x9')](_0x7aaa('0xa'),attributes,{'tableName':_0x7aaa('0xb'),'paranoid':![],'indexes':[{'name':_0x7aaa('0xc'),'fields':['messageId']},{'name':_0x7aaa('0xd'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x31aaba,_0x14d1ce,_0x47395d){var _0x298d7d=_0xa6141a[_0x7aaa('0xe')];var _0x440aed=_0x31aaba[_0x7aaa('0xf')]({'plain':!![]});if(_0x440aed[_0x7aaa('0x10')][_0x7aaa('0x11')]()==='in'||_0x440aed[_0x7aaa('0x10')][_0x7aaa('0x11')]()===_0x7aaa('0x12')&&!_0x440aed['secret']&&!_[_0x7aaa('0x13')](_0x440aed[_0x7aaa('0x14')])){_0x298d7d[_0x7aaa('0x15')][_0x7aaa('0x16')]({'where':{'id':_0x440aed['WhatsappInteractionId']}})[_0x7aaa('0x17')](function(_0x5acbcf){if(_0x5acbcf){_0x5acbcf[_0x7aaa('0x18')]({'lastMsgAt':_0x440aed[_0x7aaa('0x19')],'lastMsgDirection':_0x440aed['direction']['toLowerCase']()});}})[_0x7aaa('0x1a')](function(_0x1dd347){console[_0x7aaa('0x1b')](_0x1dd347);});}if(_0x440aed[_0x7aaa('0x10')]===_0x7aaa('0x12')&&!_0x440aed['secret']){var _0x21b3f8;_0x298d7d['WhatsappAccount']['find']({'where':{'id':_0x440aed[_0x7aaa('0x1c')]},'raw':!![]})['then'](function(_0x17743d){_0x21b3f8=_0x17743d;if(_0x21b3f8&&_0x21b3f8['type']){switch(_0x21b3f8[_0x7aaa('0x1d')]){case _0x7aaa('0x1e'):var _0x232997=require(_0x7aaa('0x1e'));if(_0x21b3f8[_0x7aaa('0x1f')]&&_0x21b3f8['authToken']&&_0x21b3f8['phone']){var _0x59ea85=new _0x232997(_0x21b3f8[_0x7aaa('0x1f')],_0x21b3f8[_0x7aaa('0x20')]);_0x59ea85['messages'][_0x7aaa('0x21')]({'body':_0x440aed[_0x7aaa('0x22')],'to':_0x7aaa('0x23')+_0x440aed[_0x7aaa('0x24')],'from':_0x7aaa('0x23')+_0x21b3f8[_0x7aaa('0x24')],'statusCallback':_0x21b3f8[_0x7aaa('0x25')]+_0x7aaa('0x26')+_0x440aed['id']+_0x7aaa('0x27')+_0x21b3f8[_0x7aaa('0x28')]})[_0x7aaa('0x17')](function(_0xd6dfa){if(_0xd6dfa['sid']){return _0x31aaba['update']({'messageId':_0xd6dfa[_0x7aaa('0x29')]});}})[_0x7aaa('0x1a')](function(_0x1317f7){logger[_0x7aaa('0x1b')](_0x7aaa('0x2a'),_0x7aaa('0x2b'),_0x7aaa('0x1e'),util[_0x7aaa('0x2c')](_0x1317f7,{'showHidden':![],'depth':null}));});}else{logger[_0x7aaa('0x1b')](_0x7aaa('0x2a'),_0x7aaa('0x2b'),_0x7aaa('0x1e'),_0x7aaa('0x2d'));}break;case _0x7aaa('0x2e'):var _0x35f9c0=_0x21b3f8['accountSid'];var _0x30d4f9=_0x21b3f8[_0x7aaa('0x20')];var _0x4b4e7a=_0x21b3f8['baseUrl']+_0x7aaa('0x2f')+_0x35f9c0+_0x7aaa('0x30');var _0x5b51e7={'to':[_0x440aed['phone']],'message':{'type':_0x7aaa('0x31'),'text':_0x440aed[_0x7aaa('0x22')]}};var _0x22946d={'method':_0x7aaa('0x32'),'uri':_0x4b4e7a,'headers':{'Authorization':_0x7aaa('0x33')+_0x30d4f9,'Content-Type':'application/json'},'body':_0x5b51e7,'json':!![]};rp(_0x22946d)[_0x7aaa('0x17')](function(_0x3be1f6){if(_0x3be1f6[_0x7aaa('0x34')][0x0][_0x7aaa('0x35')]){return _0x31aaba[_0x7aaa('0x18')]({'messageId':_0x3be1f6[_0x7aaa('0x34')][0x0][_0x7aaa('0x35')]});}})[_0x7aaa('0x1a')](function(_0x308788){logger[_0x7aaa('0x36')]('WhatsappMessage,\x20%s',_0x308788);});break;}}})['finally'](function(){_0x47395d();});}else{_0x47395d();}}},'charset':'utf8mb4','collate':_0x7aaa('0x37')});}; \ No newline at end of file +var _0x6e04=['findOne','WhatsappInteractionId','update','createdAt','catch','error','secret','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','phone','authToken','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','Bearer\x20','statuses','message_id','err','finally','utf8mb4','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction'];(function(_0x3df1a2,_0xebccd6){var _0x3a4e57=function(_0x59799e){while(--_0x59799e){_0x3df1a2['push'](_0x3df1a2['shift']());}};_0x3a4e57(++_0xebccd6);}(_0x6e04,0x1bb));var _0x46e0=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0x6e04[_0x4bd06e];return _0x85ebb;};'use strict';var _=require('lodash');var util=require(_0x46e0('0x0'));var logger=require(_0x46e0('0x1'))('api');var moment=require(_0x46e0('0x2'));var BPromise=require('bluebird');var rp=require(_0x46e0('0x3'));var fetch=require('node-fetch');var fs=require('fs');var path=require('path');var rimraf=require(_0x46e0('0x4'));var config=require(_0x46e0('0x5'));var attributes=require(_0x46e0('0x6'));module[_0x46e0('0x7')]=function(_0x199660,_0x386ac3){return _0x199660[_0x46e0('0x8')](_0x46e0('0x9'),attributes,{'tableName':_0x46e0('0xa'),'paranoid':![],'indexes':[{'name':_0x46e0('0xb'),'fields':[_0x46e0('0xb')]},{'name':_0x46e0('0xc'),'fields':[_0x46e0('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x41fc77,_0x24ca5b,_0x344d68){var _0x2d08a3=_0x199660[_0x46e0('0xe')];var _0x21c5c8=_0x41fc77['get']({'plain':!![]});if(_0x21c5c8[_0x46e0('0xf')][_0x46e0('0x10')]()==='in'||_0x21c5c8[_0x46e0('0xf')][_0x46e0('0x10')]()===_0x46e0('0x11')&&!_0x21c5c8['secret']&&!_[_0x46e0('0x12')](_0x21c5c8[_0x46e0('0x13')])){_0x2d08a3[_0x46e0('0x14')][_0x46e0('0x15')]({'where':{'id':_0x21c5c8[_0x46e0('0x16')]}})['then'](function(_0x4405ef){if(_0x4405ef){_0x4405ef[_0x46e0('0x17')]({'lastMsgAt':_0x21c5c8[_0x46e0('0x18')],'lastMsgDirection':_0x21c5c8[_0x46e0('0xf')][_0x46e0('0x10')]()});}})[_0x46e0('0x19')](function(_0x51ce94){console[_0x46e0('0x1a')](_0x51ce94);});}if(_0x21c5c8[_0x46e0('0xf')]===_0x46e0('0x11')&&!_0x21c5c8[_0x46e0('0x1b')]){var _0x5b0baa;_0x2d08a3[_0x46e0('0x1c')][_0x46e0('0x1d')]({'where':{'id':_0x21c5c8[_0x46e0('0x1e')]},'raw':!![]})[_0x46e0('0x1f')](function(_0x430e82){_0x5b0baa=_0x430e82;if(_0x5b0baa&&_0x5b0baa[_0x46e0('0x20')]){switch(_0x5b0baa[_0x46e0('0x20')]){case'twilio':var _0xc490b8=require(_0x46e0('0x21'));if(_0x5b0baa[_0x46e0('0x22')]&&_0x5b0baa['authToken']&&_0x5b0baa[_0x46e0('0x23')]){var _0x230fb0=new _0xc490b8(_0x5b0baa[_0x46e0('0x22')],_0x5b0baa[_0x46e0('0x24')]);_0x230fb0[_0x46e0('0x25')][_0x46e0('0x26')]({'body':_0x21c5c8['body'],'to':_0x46e0('0x27')+_0x21c5c8['phone'],'from':_0x46e0('0x27')+_0x5b0baa['phone'],'statusCallback':_0x5b0baa[_0x46e0('0x28')]+_0x46e0('0x29')+_0x21c5c8['id']+_0x46e0('0x2a')+_0x5b0baa[_0x46e0('0x2b')]})[_0x46e0('0x1f')](function(_0x518d76){if(_0x518d76[_0x46e0('0x2c')]){return _0x41fc77['update']({'messageId':_0x518d76[_0x46e0('0x2c')]});}})[_0x46e0('0x19')](function(_0x454af8){logger[_0x46e0('0x1a')](_0x46e0('0x2d'),_0x46e0('0x2e'),'twilio',util[_0x46e0('0x2f')](_0x454af8,{'showHidden':![],'depth':null}));});}else{logger[_0x46e0('0x1a')](_0x46e0('0x2d'),_0x46e0('0x2e'),'twilio',_0x46e0('0x30'));}break;case _0x46e0('0x31'):var _0x2c06af=_0x5b0baa[_0x46e0('0x22')];var _0xb847cc=_0x5b0baa[_0x46e0('0x24')];var _0x280a31=_0x5b0baa[_0x46e0('0x32')]+_0x46e0('0x33')+_0x2c06af+'/messages/';var _0x5a8a8b={'to':[_0x21c5c8[_0x46e0('0x23')]],'message':{'type':'text','text':_0x21c5c8[_0x46e0('0xd')]}};var _0x16e2d3={'method':'POST','uri':_0x280a31,'headers':{'Authorization':_0x46e0('0x34')+_0xb847cc,'Content-Type':'application/json'},'body':_0x5a8a8b,'json':!![]};rp(_0x16e2d3)[_0x46e0('0x1f')](function(_0x28ef58){if(_0x28ef58[_0x46e0('0x35')][0x0][_0x46e0('0x36')]){return _0x41fc77[_0x46e0('0x17')]({'messageId':_0x28ef58['statuses'][0x0][_0x46e0('0x36')]});}})[_0x46e0('0x19')](function(_0x2ff5d5){logger[_0x46e0('0x37')]('WhatsappMessage,\x20%s',_0x2ff5d5);});break;}}})[_0x46e0('0x38')](function(){_0x344d68();});}else{_0x344d68();}}},'charset':_0x46e0('0x39'),'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 cd8d9de..dabaa17 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 _0x0fae=['jayson/promise','client','http','redis','socket.io-emitter','./whatsappMessage.socket','register','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','WhatsappMessage','options','raw','CreateWhatsappMessage','debug','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x9acb95,_0x5b1715){var _0x1bba49=function(_0x23c0d2){while(--_0x23c0d2){_0x9acb95['push'](_0x9acb95['shift']());}};_0x1bba49(++_0x5b1715);}(_0x0fae,0x158));var _0xe0fa=function(_0x54f898,_0x3fe29b){_0x54f898=_0x54f898-0x0;var _0x5b8de8=_0x0fae[_0x54f898];return _0x5b8de8;};'use strict';var _=require(_0xe0fa('0x0'));var util=require(_0xe0fa('0x1'));var moment=require(_0xe0fa('0x2'));var BPromise=require('bluebird');var rs=require(_0xe0fa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0fa('0x4'))['db'];var utils=require(_0xe0fa('0x5'));var logger=require(_0xe0fa('0x6'))('rpc');var config=require(_0xe0fa('0x7'));var jayson=require(_0xe0fa('0x8'));var client=jayson[_0xe0fa('0x9')][_0xe0fa('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe0fa('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe0fa('0xc'))(new Redis(config['redis']));require(_0xe0fa('0xd'))[_0xe0fa('0xe')](socket);function respondWithRpcPromise(_0x321122,_0x439306,_0x58cc77){return new BPromise(function(_0x1ef933,_0x15bc6f){return client[_0xe0fa('0xf')](_0x321122,_0x58cc77)[_0xe0fa('0x10')](function(_0x4a3c80){logger['info'](_0xe0fa('0x11'),_0x439306,_0xe0fa('0x12'));logger['debug'](_0xe0fa('0x13'),_0x439306,'request\x20sent',JSON['stringify'](_0x4a3c80));if(_0x4a3c80[_0xe0fa('0x14')]){if(_0x4a3c80[_0xe0fa('0x14')][_0xe0fa('0x15')]===0x1f4){logger[_0xe0fa('0x14')](_0xe0fa('0x11'),_0x439306,_0x4a3c80[_0xe0fa('0x14')][_0xe0fa('0x16')]);return _0x15bc6f(_0x4a3c80[_0xe0fa('0x14')][_0xe0fa('0x16')]);}logger[_0xe0fa('0x14')](_0xe0fa('0x11'),_0x439306,_0x4a3c80[_0xe0fa('0x14')][_0xe0fa('0x16')]);return _0x1ef933(_0x4a3c80['error'][_0xe0fa('0x16')]);}else{logger[_0xe0fa('0x17')](_0xe0fa('0x11'),_0x439306,_0xe0fa('0x12'));_0x1ef933(_0x4a3c80[_0xe0fa('0x18')][_0xe0fa('0x16')]);}})[_0xe0fa('0x19')](function(_0x1c3bab){logger[_0xe0fa('0x14')](_0xe0fa('0x11'),_0x439306,_0x1c3bab);_0x15bc6f(_0x1c3bab);});});}exports['CreateWhatsappMessage']=function(_0x46d168){var _0x3ee414=this;return new Promise(function(_0x1674fa,_0x5c37cf){return db[_0xe0fa('0x1a')]['create'](_0x46d168['body'],{'raw':_0x46d168[_0xe0fa('0x1b')]?_0x46d168[_0xe0fa('0x1b')][_0xe0fa('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1eda3b){logger[_0xe0fa('0x17')](_0xe0fa('0x1d'),_0x46d168);logger[_0xe0fa('0x1e')](_0xe0fa('0x1d'),_0x46d168,JSON[_0xe0fa('0x1f')](_0x1eda3b));_0x1674fa(_0x1eda3b);})[_0xe0fa('0x19')](function(_0x4581f5){logger[_0xe0fa('0x14')](_0xe0fa('0x1d'),_0x4581f5['message'],_0x46d168);_0x5c37cf(_0x3ee414[_0xe0fa('0x14')](0x1f4,_0x4581f5[_0xe0fa('0x16')]));});});}; \ No newline at end of file +var _0xd1c3=['util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','WhatsappMessage','create','options','CreateWhatsappMessage'];(function(_0x176310,_0x3be311){var _0x599180=function(_0x3cc268){while(--_0x3cc268){_0x176310['push'](_0x176310['shift']());}};_0x599180(++_0x3be311);}(_0xd1c3,0x1e6));var _0x3d1c=function(_0x452e44,_0x571c8e){_0x452e44=_0x452e44-0x0;var _0x3ac761=_0xd1c3[_0x452e44];return _0x3ac761;};'use strict';var _=require('lodash');var util=require(_0x3d1c('0x0'));var moment=require(_0x3d1c('0x1'));var BPromise=require('bluebird');var rs=require(_0x3d1c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d1c('0x3'))['db'];var utils=require(_0x3d1c('0x4'));var logger=require('../../config/logger')(_0x3d1c('0x5'));var config=require(_0x3d1c('0x6'));var jayson=require(_0x3d1c('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x3d1c('0x8')]=_['defaults'](config['redis'],{'host':_0x3d1c('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d1c('0x8')]));require(_0x3d1c('0xa'))[_0x3d1c('0xb')](socket);function respondWithRpcPromise(_0x106838,_0x25a543,_0x25cb8f){return new BPromise(function(_0x505fbb,_0x374fca){return client[_0x3d1c('0xc')](_0x106838,_0x25cb8f)[_0x3d1c('0xd')](function(_0x162487){logger[_0x3d1c('0xe')](_0x3d1c('0xf'),_0x25a543,_0x3d1c('0x10'));logger[_0x3d1c('0x11')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x25a543,_0x3d1c('0x10'),JSON[_0x3d1c('0x12')](_0x162487));if(_0x162487[_0x3d1c('0x13')]){if(_0x162487[_0x3d1c('0x13')]['code']===0x1f4){logger[_0x3d1c('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x25a543,_0x162487[_0x3d1c('0x13')][_0x3d1c('0x14')]);return _0x374fca(_0x162487[_0x3d1c('0x13')][_0x3d1c('0x14')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x25a543,_0x162487[_0x3d1c('0x13')][_0x3d1c('0x14')]);return _0x505fbb(_0x162487[_0x3d1c('0x13')][_0x3d1c('0x14')]);}else{logger[_0x3d1c('0xe')]('WhatsappMessage,\x20%s,\x20%s',_0x25a543,_0x3d1c('0x10'));_0x505fbb(_0x162487[_0x3d1c('0x15')][_0x3d1c('0x14')]);}})[_0x3d1c('0x16')](function(_0x331353){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x25a543,_0x331353);_0x374fca(_0x331353);});});}exports['CreateWhatsappMessage']=function(_0xb336e6){var _0x3b4de2=this;return new Promise(function(_0x42b321,_0x4855dc){return db[_0x3d1c('0x17')][_0x3d1c('0x18')](_0xb336e6['body'],{'raw':_0xb336e6[_0x3d1c('0x19')]?_0xb336e6['options']['raw']===undefined?!![]:![]:!![]})[_0x3d1c('0xd')](function(_0x506fb2){logger[_0x3d1c('0xe')]('CreateWhatsappMessage',_0xb336e6);logger[_0x3d1c('0x11')](_0x3d1c('0x1a'),_0xb336e6,JSON[_0x3d1c('0x12')](_0x506fb2));_0x42b321(_0x506fb2);})[_0x3d1c('0x16')](function(_0x581e34){logger['error'](_0x3d1c('0x1a'),_0x581e34[_0x3d1c('0x14')],_0xb336e6);_0x4855dc(_0x3b4de2[_0x3d1c('0x13')](0x1f4,_0x581e34[_0x3d1c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 79d5131..73ed6d0 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 _0x4a14=['register','length','whatsappMessage:','./whatsappMessage.events','save','update','emit'];(function(_0x4666fa,_0xb3803c){var _0x51a8aa=function(_0x3da72d){while(--_0x3da72d){_0x4666fa['push'](_0x4666fa['shift']());}};_0x51a8aa(++_0xb3803c);}(_0x4a14,0x1d8));var _0x44a1=function(_0x372a58,_0x21fb75){_0x372a58=_0x372a58-0x0;var _0x5e2501=_0x4a14[_0x372a58];return _0x5e2501;};'use strict';var WhatsappMessageEvents=require(_0x44a1('0x0'));var events=[_0x44a1('0x1'),'remove',_0x44a1('0x2')];function createListener(_0x54b78b,_0x2722c3){return function(_0x3401b2){_0x2722c3[_0x44a1('0x3')](_0x54b78b,_0x3401b2);};}function removeListener(_0xe2caa4,_0x312244){return function(){WhatsappMessageEvents['removeListener'](_0xe2caa4,_0x312244);};}exports[_0x44a1('0x4')]=function(_0x1066cc){for(var _0x3f09e9=0x0,_0x5bd937=events[_0x44a1('0x5')];_0x3f09e9<_0x5bd937;_0x3f09e9++){var _0x4eeb5e=events[_0x3f09e9];var _0x4fedb9=createListener(_0x44a1('0x6')+_0x4eeb5e,_0x1066cc);WhatsappMessageEvents['on'](_0x4eeb5e,_0x4fedb9);}}; \ No newline at end of file +var _0xb8c6=['whatsappMessage:','save','remove','update','emit','removeListener','length'];(function(_0x3f8ba3,_0x4fe833){var _0x1c2e73=function(_0x2aeacf){while(--_0x2aeacf){_0x3f8ba3['push'](_0x3f8ba3['shift']());}};_0x1c2e73(++_0x4fe833);}(_0xb8c6,0xda));var _0x6b8c=function(_0x3ec594,_0x448834){_0x3ec594=_0x3ec594-0x0;var _0x21f286=_0xb8c6[_0x3ec594];return _0x21f286;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x6b8c('0x0'),_0x6b8c('0x1'),_0x6b8c('0x2')];function createListener(_0x4bbf1d,_0x26ea6b){return function(_0x56378d){_0x26ea6b[_0x6b8c('0x3')](_0x4bbf1d,_0x56378d);};}function removeListener(_0x5333da,_0x32489c){return function(){WhatsappMessageEvents[_0x6b8c('0x4')](_0x5333da,_0x32489c);};}exports['register']=function(_0x2e5f98){for(var _0x3e0408=0x0,_0x28f6f6=events[_0x6b8c('0x5')];_0x3e0408<_0x28f6f6;_0x3e0408++){var _0x20f79f=events[_0x3e0408];var _0x2c0b33=createListener(_0x6b8c('0x6')+_0x20f79f,_0x2e5f98);WhatsappMessageEvents['on'](_0x20f79f,_0x2c0b33);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 166ff35..63ec7c7 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 _0x9034=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','update','destroy','delete','removeTeams','removeAgents','exports','util','path','express'];(function(_0x12f73c,_0x49d4a3){var _0x214704=function(_0x5a3539){while(--_0x5a3539){_0x12f73c['push'](_0x12f73c['shift']());}};_0x214704(++_0x49d4a3);}(_0x9034,0x1cd));var _0x4903=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9034[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require(_0x4903('0x0'));var path=require(_0x4903('0x1'));var timeout=require('connect-timeout');var express=require(_0x4903('0x2'));var router=express['Router']();var fs_extra=require(_0x4903('0x3'));var auth=require(_0x4903('0x4'));var interaction=require(_0x4903('0x5'));var config=require(_0x4903('0x6'));var controller=require('./whatsappQueue.controller');router[_0x4903('0x7')]('/',auth[_0x4903('0x8')](),controller[_0x4903('0x9')]);router[_0x4903('0x7')](_0x4903('0xa'),auth['isAuthenticated'](),controller[_0x4903('0xb')]);router[_0x4903('0x7')](_0x4903('0xc'),auth[_0x4903('0x8')](),controller[_0x4903('0xd')]);router['get'](_0x4903('0xe'),auth['isAuthenticated'](),controller[_0x4903('0xf')]);router[_0x4903('0x7')]('/:id/teams',auth[_0x4903('0x8')](),controller['getTeams']);router[_0x4903('0x7')](_0x4903('0x10'),auth[_0x4903('0x8')](),controller[_0x4903('0x11')]);router[_0x4903('0x12')]('/',auth['isAuthenticated'](),controller[_0x4903('0x13')]);router[_0x4903('0x12')](_0x4903('0x14'),auth[_0x4903('0x8')](),controller[_0x4903('0x15')]);router[_0x4903('0x12')](_0x4903('0x10'),auth['isAuthenticated'](),controller[_0x4903('0x16')]);router['put'](_0x4903('0xc'),auth[_0x4903('0x8')](),controller[_0x4903('0x17')]);router['delete']('/:id',auth[_0x4903('0x8')](),controller[_0x4903('0x18')]);router[_0x4903('0x19')]('/:id/teams',auth[_0x4903('0x8')](),controller[_0x4903('0x1a')]);router['delete'](_0x4903('0x10'),auth[_0x4903('0x8')](),controller[_0x4903('0x1b')]);module[_0x4903('0x1c')]=router; \ No newline at end of file +var _0xa958=['index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get'];(function(_0x4e92cc,_0x446a66){var _0x2f3da9=function(_0x58bc65){while(--_0x58bc65){_0x4e92cc['push'](_0x4e92cc['shift']());}};_0x2f3da9(++_0x446a66);}(_0xa958,0x116));var _0x8a95=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xa958[_0x1969a7];return _0x3d665f;};'use strict';var multer=require(_0x8a95('0x0'));var util=require(_0x8a95('0x1'));var path=require(_0x8a95('0x2'));var timeout=require(_0x8a95('0x3'));var express=require(_0x8a95('0x4'));var router=express['Router']();var fs_extra=require(_0x8a95('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8a95('0x6'));var config=require(_0x8a95('0x7'));var controller=require(_0x8a95('0x8'));router[_0x8a95('0x9')]('/',auth['isAuthenticated'](),controller[_0x8a95('0xa')]);router[_0x8a95('0x9')](_0x8a95('0xb'),auth[_0x8a95('0xc')](),controller[_0x8a95('0xd')]);router['get'](_0x8a95('0xe'),auth[_0x8a95('0xc')](),controller[_0x8a95('0xf')]);router['get'](_0x8a95('0x10'),auth[_0x8a95('0xc')](),controller[_0x8a95('0x11')]);router[_0x8a95('0x9')](_0x8a95('0x12'),auth[_0x8a95('0xc')](),controller[_0x8a95('0x13')]);router[_0x8a95('0x9')](_0x8a95('0x14'),auth[_0x8a95('0xc')](),controller[_0x8a95('0x15')]);router[_0x8a95('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8a95('0x16')](_0x8a95('0x12'),auth[_0x8a95('0xc')](),controller[_0x8a95('0x17')]);router[_0x8a95('0x16')](_0x8a95('0x14'),auth[_0x8a95('0xc')](),controller[_0x8a95('0x18')]);router[_0x8a95('0x19')](_0x8a95('0xe'),auth[_0x8a95('0xc')](),controller[_0x8a95('0x1a')]);router[_0x8a95('0x1b')](_0x8a95('0xe'),auth['isAuthenticated'](),controller[_0x8a95('0x1c')]);router['delete'](_0x8a95('0x12'),auth['isAuthenticated'](),controller[_0x8a95('0x1d')]);router[_0x8a95('0x1b')]('/:id/users',auth[_0x8a95('0xc')](),controller[_0x8a95('0x1e')]);module[_0x8a95('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index bf3f446..d3d38e2 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 _0xaaa2=['name','INTEGER','ENUM','beepall','sequelize','exports','STRING'];(function(_0x31660e,_0x489b9e){var _0x9d3ec5=function(_0xbe34fa){while(--_0xbe34fa){_0x31660e['push'](_0x31660e['shift']());}};_0x9d3ec5(++_0x489b9e);}(_0xaaa2,0xac));var _0x2aaa=function(_0x4962a7,_0x4f916b){_0x4962a7=_0x4962a7-0x0;var _0xd8038a=_0xaaa2[_0x4962a7];return _0xd8038a;};'use strict';var Sequelize=require(_0x2aaa('0x0'));module[_0x2aaa('0x1')]={'name':{'type':Sequelize[_0x2aaa('0x2')],'unique':_0x2aaa('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x2aaa('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2aaa('0x5')]('rrmemory',_0x2aaa('0x6'),'roundrobin')},'description':{'type':Sequelize[_0x2aaa('0x2')]}}; \ No newline at end of file +var _0xde2c=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x5972eb,_0xb79770){var _0x314a72=function(_0x586ebf){while(--_0x586ebf){_0x5972eb['push'](_0x5972eb['shift']());}};_0x314a72(++_0xb79770);}(_0xde2c,0x7f));var _0xcde2=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0xde2c[_0x46ae5a];return _0x434986;};'use strict';var Sequelize=require(_0xcde2('0x0'));module[_0xcde2('0x1')]={'name':{'type':Sequelize[_0xcde2('0x2')],'unique':_0xcde2('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xcde2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcde2('0x5')](_0xcde2('0x6'),_0xcde2('0x7'),'roundrobin')},'description':{'type':Sequelize[_0xcde2('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index a33f1bf..dc4880c 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 _0x668b=['WhatsappQueues','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','keys','UserWhatsappQueue','nolimit','order','sort','pick','WhatsappQueueId','filter','merge','User','UserId','agent','whatsappPause','updatedAt','rows','format','SIP','createdAt','getTeams','Team','hasOwnProperty','addTeams','ids','Agents','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','every','includes','all','union','compact','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','util','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','WhatsappQueue','fieldName','type','key','getOptions','where','findAll','catch','show','params','model','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x547e77,_0x4cb1ff){var _0x349c08=function(_0x27a89f){while(--_0x27a89f){_0x547e77['push'](_0x547e77['shift']());}};_0x349c08(++_0x4cb1ff);}(_0x668b,0x12c));var _0xb668=function(_0x34b821,_0x504e55){_0x34b821=_0x34b821-0x0;var _0x5e00a0=_0x668b[_0x34b821];return _0x5e00a0;};'use strict';var BPromise=require('bluebird');var util=require(_0xb668('0x0'));var _=require(_0xb668('0x1'));var squel=require('squel');var Redis=require(_0xb668('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xb668('0x3'))('api');var config=require(_0xb668('0x4'));var db=require(_0xb668('0x5'))['db'];config[_0xb668('0x6')]=_[_0xb668('0x7')](config[_0xb668('0x6')],{'host':_0xb668('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappQueue.socket')[_0xb668('0x9')](socket);function respondWithStatusCode(_0x574b4c,_0x487bfc){_0x487bfc=_0x487bfc||0xcc;return function(_0x22579e){if(_0x22579e){return _0x574b4c[_0xb668('0xa')](_0x487bfc);}return _0x574b4c['status'](_0x487bfc)['end']();};}function respondWithResult(_0x263355,_0x25e716){_0x25e716=_0x25e716||0xc8;return function(_0x229fe1){if(_0x229fe1){return _0x263355[_0xb668('0xb')](_0x25e716)[_0xb668('0xc')](_0x229fe1);}};}function respondWithFilteredResult(_0x312800,_0x313f27){return function(_0x179d99){if(_0x179d99){var _0x2b392e=typeof _0x313f27[_0xb668('0xd')]===_0xb668('0xe')&&typeof _0x313f27['limit']===_0xb668('0xe');var _0x1c6801=_0x179d99[_0xb668('0xf')];var _0x4416d2=_0x2b392e?0x0:_0x313f27[_0xb668('0xd')];var _0x399507=_0x2b392e?_0x179d99[_0xb668('0xf')]:_0x313f27[_0xb668('0xd')]+_0x313f27[_0xb668('0x10')];var _0x1d53d6;if(_0x399507>=_0x1c6801){_0x399507=_0x1c6801;_0x1d53d6=0xc8;}else{_0x1d53d6=0xce;}_0x312800['status'](_0x1d53d6);return _0x312800[_0xb668('0x11')](_0xb668('0x12'),_0x4416d2+'-'+_0x399507+'/'+_0x1c6801)[_0xb668('0xc')](_0x179d99);}return null;};}function saveUpdates(_0x4670f2){return function(_0x86ff1d){if(_0x86ff1d){return _0x86ff1d[_0xb668('0x13')](_0x4670f2)[_0xb668('0x14')](function(_0x5080a5){return _0x5080a5;});}return null;};}function removeEntity(_0xcf8577){return function(_0x5935eb){if(_0x5935eb){return _0x5935eb[_0xb668('0x15')]()[_0xb668('0x14')](function(){var _0x2b5d65=_0x5935eb[_0xb668('0x16')]({'plain':!![]});var _0x529510='WhatsappQueues';return db[_0xb668('0x17')]['destroy']({'where':{'type':_0x529510,'resourceId':_0x2b5d65['id']}})[_0xb668('0x14')](function(){return _0x5935eb;});})['then'](function(){_0xcf8577[_0xb668('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15f5cd){return function(_0x29bc02){if(!_0x29bc02){_0x15f5cd[_0xb668('0xa')](0x194);}return _0x29bc02;};}function handleError(_0x445411,_0x734fee){_0x734fee=_0x734fee||0x1f4;return function(_0x173b97){logger[_0xb668('0x18')](_0x173b97[_0xb668('0x19')]);if(_0x173b97[_0xb668('0x1a')]){delete _0x173b97[_0xb668('0x1a')];}_0x445411['status'](_0x734fee)[_0xb668('0x1b')](_0x173b97);};}exports['index']=function(_0x292106,_0x5c3f4a){var _0x5c6d5e={};var _0x5a5555={'count':0x0,'rows':[]};var _0x34f50e=_[_0xb668('0x1c')](db[_0xb668('0x1d')]['rawAttributes'],function(_0x55913c){return{'name':_0x55913c[_0xb668('0x1e')],'type':_0x55913c[_0xb668('0x1f')][_0xb668('0x20')]};});_0x5c6d5e=qs[_0xb668('0x21')](_0x34f50e,_0x292106);var _0xab7d09={'where':_0x5c6d5e[_0xb668('0x22')]};return db[_0xb668('0x1d')][_0xb668('0xf')](_0xab7d09)[_0xb668('0x14')](function(_0x1bc25f){_0x5a5555[_0xb668('0xf')]=_0x1bc25f;_0x5c6d5e['include']=qs['include'](_0x292106['query']);return db[_0xb668('0x1d')][_0xb668('0x23')](_0x5c6d5e);})[_0xb668('0x14')](function(_0x503e68){_0x5a5555['rows']=_0x503e68;return _0x5a5555;})[_0xb668('0x14')](respondWithFilteredResult(_0x5c3f4a,_0x5c6d5e))[_0xb668('0x24')](handleError(_0x5c3f4a,null));};exports[_0xb668('0x25')]=function(_0x182759,_0x5ce68d){var _0x131b51={'raw':!![],'where':{'id':_0x182759[_0xb668('0x26')]['id']}},_0x265b8e={};_0x265b8e[_0xb668('0x27')]=_['keys'](db[_0xb668('0x1d')][_0xb668('0x28')]);_0x265b8e[_0xb668('0x29')]=_['keys'](_0x182759[_0xb668('0x29')]);_0x265b8e[_0xb668('0x2a')]=_[_0xb668('0x2b')](_0x265b8e[_0xb668('0x27')],_0x265b8e[_0xb668('0x29')]);_0x131b51[_0xb668('0x2c')]=_[_0xb668('0x2b')](_0x265b8e[_0xb668('0x27')],qs[_0xb668('0x2d')](_0x182759['query'][_0xb668('0x2d')]));_0x131b51[_0xb668('0x2c')]=_0x131b51[_0xb668('0x2c')][_0xb668('0x2e')]?_0x131b51[_0xb668('0x2c')]:_0x265b8e[_0xb668('0x27')];if(_0x182759[_0xb668('0x29')][_0xb668('0x2f')]){_0x131b51[_0xb668('0x30')]=[{'all':!![]}];}_0x131b51=_['merge']({},_0x131b51,_0x182759[_0xb668('0x31')]);return db[_0xb668('0x1d')]['find'](_0x131b51)['then'](handleEntityNotFound(_0x5ce68d,null))[_0xb668('0x14')](respondWithResult(_0x5ce68d,null))['catch'](handleError(_0x5ce68d,null));};exports[_0xb668('0x32')]=function(_0x51cf43,_0x1346ac){return db['WhatsappQueue'][_0xb668('0x32')](_0x51cf43['body'],{})['then'](function(_0x3f86b5){var _0x1e0813=_0x51cf43[_0xb668('0x33')][_0xb668('0x16')]({'plain':!![]});if(!_0x1e0813)throw new Error(_0xb668('0x34'));if(_0x1e0813[_0xb668('0x35')]===_0xb668('0x33')){var _0x22b726=_0x3f86b5[_0xb668('0x16')]({'plain':!![]});var _0x7a9512=_0xb668('0x36');return db[_0xb668('0x37')][_0xb668('0x38')]({'where':{'name':_0x7a9512,'userProfileId':_0x1e0813[_0xb668('0x39')]},'raw':!![]})[_0xb668('0x14')](function(_0x551281){if(_0x551281&&_0x551281[_0xb668('0x3a')]===0x0){return db['UserProfileResource']['create']({'name':_0x22b726[_0xb668('0x1a')],'resourceId':_0x22b726['id'],'type':_0x551281[_0xb668('0x1a')],'sectionId':_0x551281['id']},{})[_0xb668('0x14')](function(){return _0x3f86b5;});}else{return _0x3f86b5;}})[_0xb668('0x24')](function(_0x30f5f1){logger[_0xb668('0x18')](_0xb668('0x3b'),_0x30f5f1);throw _0x30f5f1;});}return _0x3f86b5;})['then'](respondWithResult(_0x1346ac,0xc9))[_0xb668('0x24')](handleError(_0x1346ac,null));};exports[_0xb668('0x13')]=function(_0x3162c9,_0xef97ef){if(_0x3162c9['body']['id']){delete _0x3162c9[_0xb668('0x3c')]['id'];}return db[_0xb668('0x1d')][_0xb668('0x38')]({'where':{'id':_0x3162c9[_0xb668('0x26')]['id']}})[_0xb668('0x14')](handleEntityNotFound(_0xef97ef,null))[_0xb668('0x14')](saveUpdates(_0x3162c9[_0xb668('0x3c')],null))[_0xb668('0x14')](respondWithResult(_0xef97ef,null))[_0xb668('0x24')](handleError(_0xef97ef,null));};exports[_0xb668('0x15')]=function(_0x1dc9fb,_0x22c372){return db[_0xb668('0x1d')][_0xb668('0x38')]({'where':{'id':_0x1dc9fb[_0xb668('0x26')]['id']}})[_0xb668('0x14')](handleEntityNotFound(_0x22c372,null))[_0xb668('0x14')](removeEntity(_0x22c372,null))['catch'](handleError(_0x22c372,null));};exports[_0xb668('0x3d')]=function(_0x11f0d8,_0x43428a){return db[_0xb668('0x1d')][_0xb668('0x3d')]()['then'](respondWithResult(_0x43428a,null))['catch'](handleError(_0x43428a,null));};exports[_0xb668('0x3e')]=function(_0x55e289,_0x4da29f){var _0x4d51e6={'raw':!![],'where':{}},_0x358bf7={},_0x4c803d;return db['WhatsappQueue'][_0xb668('0x3f')]({'where':{'id':_0x55e289[_0xb668('0x26')]['id']}})['then'](handleEntityNotFound(_0x4da29f,null))[_0xb668('0x14')](function(_0x516013){if(_0x516013){_0x4c803d=_0x516013[_0xb668('0x16')]({'plain':!![]});_0x358bf7[_0xb668('0x27')]=_[_0xb668('0x40')](db[_0xb668('0x41')]['rawAttributes']);_0x358bf7[_0xb668('0x29')]=_['keys'](_0x55e289['query']);_0x358bf7[_0xb668('0x2a')]=_[_0xb668('0x2b')](_0x358bf7[_0xb668('0x27')],_0x358bf7['query']);_0x4d51e6['attributes']=_[_0xb668('0x2b')](_0x358bf7[_0xb668('0x27')],qs[_0xb668('0x2d')](_0x55e289[_0xb668('0x29')][_0xb668('0x2d')]));_0x4d51e6[_0xb668('0x2c')]=_0x4d51e6[_0xb668('0x2c')][_0xb668('0x2e')]?_0x4d51e6['attributes']:_0x358bf7[_0xb668('0x27')];if(!_0x55e289[_0xb668('0x29')]['hasOwnProperty'](_0xb668('0x42'))){_0x4d51e6[_0xb668('0x10')]=qs[_0xb668('0x10')](_0x55e289['query'][_0xb668('0x10')]);_0x4d51e6[_0xb668('0xd')]=qs[_0xb668('0xd')](_0x55e289['query'][_0xb668('0xd')]);}_0x4d51e6[_0xb668('0x43')]=qs[_0xb668('0x44')](_0x55e289[_0xb668('0x29')]['sort']);_0x4d51e6['where']=qs[_0xb668('0x2a')](_[_0xb668('0x45')](_0x55e289['query'],_0x358bf7[_0xb668('0x2a')]));_0x4d51e6[_0xb668('0x22')][_0xb668('0x46')]=_0x516013['id'];if(_0x55e289[_0xb668('0x29')][_0xb668('0x47')]){_0x4d51e6[_0xb668('0x22')]=_['merge'](_0x4d51e6[_0xb668('0x22')],{'$or':_[_0xb668('0x1c')](_0x4d51e6[_0xb668('0x2c')],function(_0xaafc22){var _0x556264={};_0x556264[_0xaafc22]={'$like':'%'+_0x55e289[_0xb668('0x29')][_0xb668('0x47')]+'%'};return _0x556264;})});}_0x4d51e6=_[_0xb668('0x48')]({},_0x4d51e6,_0x55e289[_0xb668('0x31')]);return db[_0xb668('0x41')][_0xb668('0x23')](_0x4d51e6);}})[_0xb668('0x14')](function(_0x75e276){if(_0x75e276){return db[_0xb668('0x49')]['findAndCountAll']({'where':{'id':_[_0xb668('0x1c')](_0x75e276,_0xb668('0x4a')),'role':_0xb668('0x4b')},'attributes':['id',_0xb668('0x1a'),_0xb668('0x4c'),_0xb668('0x4d'),'createdAt']});}})[_0xb668('0x14')](function(_0x3486fe){if(_0x3486fe){return{'count':_0x3486fe['count'],'rows':_[_0xb668('0x1c')](_0x3486fe[_0xb668('0x4e')],function(_0x5e8f6d){return{'membername':_0x5e8f6d[_0xb668('0x1a')],'UserId':_0x5e8f6d['id'],'queue_name':_0x4c803d['name'],'WhatsappQueueId':_0x4c803d['id'],'interface':util[_0xb668('0x4f')]('%s/%s',_0xb668('0x50'),_0x5e8f6d['name']),'penalty':0x0,'paused':_0x5e8f6d[_0xb668('0x4c')],'createdAt':_0x5e8f6d[_0xb668('0x51')],'updatedAt':_0x5e8f6d[_0xb668('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb668('0x14')](respondWithFilteredResult(_0x4da29f,_0x4d51e6))['catch'](handleError(_0x4da29f,null));};exports[_0xb668('0x52')]=function(_0x581592,_0x390dc9){var _0x378252={};var _0x4c78f3={};var _0x2ad454;var _0x2c1bea;return db[_0xb668('0x1d')][_0xb668('0x3f')]({'where':{'id':_0x581592[_0xb668('0x26')]['id']}})[_0xb668('0x14')](handleEntityNotFound(_0x390dc9,null))[_0xb668('0x14')](function(_0xe77be5){if(_0xe77be5){_0x2ad454=_0xe77be5;_0x4c78f3[_0xb668('0x27')]=_['keys'](db[_0xb668('0x53')][_0xb668('0x28')]);_0x4c78f3['query']=_['keys'](_0x581592['query']);_0x4c78f3[_0xb668('0x2a')]=_['intersection'](_0x4c78f3[_0xb668('0x27')],_0x4c78f3[_0xb668('0x29')]);_0x378252[_0xb668('0x2c')]=_['intersection'](_0x4c78f3[_0xb668('0x27')],qs[_0xb668('0x2d')](_0x581592[_0xb668('0x29')][_0xb668('0x2d')]));_0x378252[_0xb668('0x2c')]=_0x378252[_0xb668('0x2c')][_0xb668('0x2e')]?_0x378252['attributes']:_0x4c78f3['model'];_0x378252['order']=qs[_0xb668('0x44')](_0x581592[_0xb668('0x29')][_0xb668('0x44')]);_0x378252['where']=qs[_0xb668('0x2a')](_[_0xb668('0x45')](_0x581592[_0xb668('0x29')],_0x4c78f3[_0xb668('0x2a')]));if(_0x581592[_0xb668('0x29')][_0xb668('0x47')]){_0x378252['where']=_['merge'](_0x378252[_0xb668('0x22')],{'$or':_[_0xb668('0x1c')](_0x378252[_0xb668('0x2c')],function(_0x5385d1){var _0x48edae={};_0x48edae[_0x5385d1]={'$like':'%'+_0x581592['query'][_0xb668('0x47')]+'%'};return _0x48edae;})});}_0x378252=_['merge']({},_0x378252,_0x581592[_0xb668('0x31')]);return _0x2ad454[_0xb668('0x52')](_0x378252);}})[_0xb668('0x14')](function(_0xd3f69a){if(_0xd3f69a){_0x2c1bea=_0xd3f69a['length'];if(!_0x581592[_0xb668('0x29')][_0xb668('0x54')]('nolimit')){_0x378252[_0xb668('0x10')]=qs[_0xb668('0x10')](_0x581592[_0xb668('0x29')][_0xb668('0x10')]);_0x378252['offset']=qs[_0xb668('0xd')](_0x581592[_0xb668('0x29')]['offset']);}return _0x2ad454[_0xb668('0x52')](_0x378252);}})[_0xb668('0x14')](function(_0x17f182){if(_0x17f182){return _0x17f182?{'count':_0x2c1bea,'rows':_0x17f182}:null;}})[_0xb668('0x14')](respondWithResult(_0x390dc9,null))[_0xb668('0x24')](handleError(_0x390dc9,null));};exports[_0xb668('0x55')]=function(_0x396e34,_0x1ae8e5){var _0x593eea=_0x396e34[_0xb668('0x3c')][_0xb668('0x56')];return db[_0xb668('0x53')][_0xb668('0x23')]({'where':{'id':_0x593eea},'attributes':['id'],'include':[{'model':db[_0xb668('0x49')],'as':_0xb668('0x57'),'attributes':['id',_0xb668('0x1a'),'online',_0xb668('0x58'),_0xb668('0x59')],'raw':!![]}]})['then'](function(_0x590dd4){if(_0x590dd4){var _0x18b129=_['flatMap'](_0x590dd4,function(_0x22b22d){var _0x32f1e2=_0x22b22d[_0xb668('0x16')]({'plain':!![]});return _0x32f1e2[_0xb668('0x57')];});return db[_0xb668('0x1d')][_0xb668('0x38')]({'where':{'id':_0x396e34['params']['id']}})[_0xb668('0x14')](function(_0x4e3371){return db[_0xb668('0x5a')][_0xb668('0x5b')](function(_0x461785){return _0x4e3371[_0xb668('0x55')](_0x593eea,{'transaction':_0x461785})['then'](function(){return BPromise[_0xb668('0x5c')](_0x18b129,function(_0x33c678){return db[_0xb668('0x41')][_0xb668('0x5d')]({'where':{'UserId':_0x33c678['id'],'WhatsappQueueId':_0x396e34[_0xb668('0x26')]['id']},'transaction':_0x461785});});})['then'](function(){_0x18b129[_0xb668('0x5e')](function(_0x14bbca){socket[_0xb668('0x5f')](_0xb668('0x60'),{'UserId':_0x14bbca['id'],'WhatsappQueueId':_0x4e3371['id']});});});});});}})[_0xb668('0x14')](respondWithStatusCode(_0x1ae8e5,null))[_0xb668('0x24')](handleError(_0x1ae8e5,null));};exports[_0xb668('0x61')]=function(_0x569889,_0x14ee7d){return db[_0xb668('0x53')]['findAll']({'where':{'id':_0x569889[_0xb668('0x29')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb668('0x49')],'as':_0xb668('0x57'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x14ee7d,null))[_0xb668('0x14')](function(_0x1dc0c3){var _0x5d6f1f=_['map'](_0x1dc0c3,'id');var _0x56847a=[];var _0xd14ada=[];var _0x538372=squel['select']();_0x538372[_0xb668('0x62')](_0xb668('0x63'))['from'](_0xb668('0x64'),'tq')[_0xb668('0x65')](_0xb668('0x66'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb668('0x22')](_0xb668('0x67'),_0x569889[_0xb668('0x26')]['id']);for(var _0x5f11=0x0;_0x5f11<_0x1dc0c3[_0xb668('0x2e')];_0x5f11+=0x1){let _0x419273=_0x1dc0c3[_0x5f11];for(var _0x216395=0x0;_0x216395<_0x419273[_0xb668('0x57')][_0xb668('0x2e')];_0x216395+=0x1){let _0x38f783=_0x419273[_0xb668('0x57')][_0x216395];var _0x359dc0=_0x538372[_0xb668('0x68')]();_0x359dc0[_0xb668('0x22')](_0xb668('0x69'),_0x38f783['id']);_0xd14ada[_0xb668('0x6a')](db[_0xb668('0x5a')][_0xb668('0x29')](_0x359dc0['toString'](),{'type':db[_0xb668('0x5a')]['QueryTypes']['SELECT']})[_0xb668('0x14')](function(_0x12090d){if(_0x12090d[_0xb668('0x2e')]===0x1){return _0x38f783['id'];}else{var _0x4267b8=_[_0xb668('0x6b')](_[_0xb668('0x1c')](_0x12090d,'TeamId'),function(_0x367f2c){return _[_0xb668('0x6c')](_0x5d6f1f,_0x367f2c);});if(_0x4267b8){return _0x38f783['id'];}}}));}}return BPromise[_0xb668('0x6d')](_0xd14ada)[_0xb668('0x14')](function(_0x320606){_0x56847a=_(_0x56847a)[_0xb668('0x6e')](_0x320606)[_0xb668('0x6f')]()['value']();return db[_0xb668('0x1d')][_0xb668('0x38')]({'where':{'id':_0x569889[_0xb668('0x26')]['id']}})[_0xb668('0x14')](function(_0x3d1477){return db[_0xb668('0x5a')][_0xb668('0x5b')](function(_0x3ec9c4){return _0x3d1477['removeTeams'](_0x569889[_0xb668('0x29')][_0xb668('0x56')],{'transaction':_0x3ec9c4})[_0xb668('0x14')](function(){if(!_['isEmpty'](_0x56847a)){return _0x3d1477[_0xb668('0x70')](_0x56847a,{'transaction':_0x3ec9c4});}})[_0xb668('0x14')](function(){_0x56847a['forEach'](function(_0x23c89d){socket[_0xb668('0x5f')](_0xb668('0x71'),{'UserId':_0x23c89d,'WhatsappQueueId':_0x3d1477['id']});});});});});});})[_0xb668('0x14')](respondWithStatusCode(_0x14ee7d,null))[_0xb668('0x24')](handleError(_0x14ee7d,null));};exports[_0xb668('0x72')]=function(_0x37d727,_0x76e339){return db[_0xb668('0x1d')][_0xb668('0x38')]({'where':{'id':_0x37d727[_0xb668('0x26')]['id']}})[_0xb668('0x14')](handleEntityNotFound(_0x76e339,null))[_0xb668('0x14')](function(_0xbb9b2){if(_0xbb9b2){return _0xbb9b2['addAgents'](_0x37d727[_0xb668('0x3c')]['ids'],_[_0xb668('0x73')](_0x37d727[_0xb668('0x3c')],[_0xb668('0x56'),'id'])||{})[_0xb668('0x74')](function(_0x3591ff){for(var _0x10fa00=0x0;_0x10fa00<_0x37d727[_0xb668('0x3c')]['ids']['length'];_0x10fa00+=0x1){socket[_0xb668('0x5f')](_0xb668('0x60'),{'UserId':Number(_0x37d727['body'][_0xb668('0x56')][_0x10fa00]),'WhatsappQueueId':Number(_0x37d727[_0xb668('0x26')]['id'])});}return _0x3591ff;});}})[_0xb668('0x14')](respondWithResult(_0x76e339,null))[_0xb668('0x24')](handleError(_0x76e339,null));};exports[_0xb668('0x70')]=function(_0x22e8d6,_0xdd8b4c){return db['WhatsappQueue'][_0xb668('0x38')]({'where':{'id':_0x22e8d6[_0xb668('0x26')]['id']}})[_0xb668('0x14')](handleEntityNotFound(_0xdd8b4c,null))[_0xb668('0x14')](function(_0x512c5d){if(_0x512c5d){return _0x512c5d[_0xb668('0x70')](_0x22e8d6[_0xb668('0x29')][_0xb668('0x56')])[_0xb668('0x14')](function(){if(_[_0xb668('0x75')](_0x22e8d6[_0xb668('0x29')][_0xb668('0x56')])){for(var _0x1aed00=0x0;_0x1aed00<_0x22e8d6['query'][_0xb668('0x56')]['length'];_0x1aed00+=0x1){socket[_0xb668('0x5f')](_0xb668('0x71'),{'UserId':Number(_0x22e8d6[_0xb668('0x29')][_0xb668('0x56')][_0x1aed00]),'WhatsappQueueId':Number(_0x22e8d6[_0xb668('0x26')]['id'])});}}else{socket[_0xb668('0x5f')](_0xb668('0x71'),{'UserId':Number(_0x22e8d6[_0xb668('0x29')][_0xb668('0x56')]),'WhatsappQueueId':Number(_0x22e8d6[_0xb668('0x26')]['id'])});}});}})[_0xb668('0x14')](respondWithStatusCode(_0xdd8b4c,null))[_0xb668('0x24')](handleError(_0xdd8b4c,null));};exports['getAgents']=function(_0x148fab,_0x1f09df){var _0xa2c0a={};var _0x3f9ec7={};var _0x43095e;var _0x7c5141;return db[_0xb668('0x1d')][_0xb668('0x3f')]({'where':{'id':_0x148fab[_0xb668('0x26')]['id']}})[_0xb668('0x14')](handleEntityNotFound(_0x1f09df,null))[_0xb668('0x14')](function(_0x1f2138){if(_0x1f2138){_0x43095e=_0x1f2138;_0x3f9ec7[_0xb668('0x27')]=_[_0xb668('0x40')](db[_0xb668('0x49')]['rawAttributes']);_0x3f9ec7[_0xb668('0x29')]=_[_0xb668('0x40')](_0x148fab[_0xb668('0x29')]);_0x3f9ec7['filters']=_[_0xb668('0x2b')](_0x3f9ec7[_0xb668('0x27')],_0x3f9ec7[_0xb668('0x29')]);_0xa2c0a[_0xb668('0x2c')]=_[_0xb668('0x2b')](_0x3f9ec7['model'],qs[_0xb668('0x2d')](_0x148fab[_0xb668('0x29')][_0xb668('0x2d')]));_0xa2c0a[_0xb668('0x2c')]=_0xa2c0a['attributes'][_0xb668('0x2e')]?_0xa2c0a[_0xb668('0x2c')]:_0x3f9ec7[_0xb668('0x27')];_0xa2c0a[_0xb668('0x43')]=qs[_0xb668('0x44')](_0x148fab[_0xb668('0x29')][_0xb668('0x44')]);_0xa2c0a[_0xb668('0x22')]=qs[_0xb668('0x2a')](_['pick'](_0x148fab['query'],_0x3f9ec7[_0xb668('0x2a')]));if(_0x148fab[_0xb668('0x29')]['filter']){_0xa2c0a['where']=_[_0xb668('0x48')](_0xa2c0a[_0xb668('0x22')],{'$or':_[_0xb668('0x1c')](_0xa2c0a[_0xb668('0x2c')],function(_0x301dcc){var _0x4687a9={};_0x4687a9[_0x301dcc]={'$like':'%'+_0x148fab[_0xb668('0x29')][_0xb668('0x47')]+'%'};return _0x4687a9;})});}_0xa2c0a=_['merge']({},_0xa2c0a,_0x148fab[_0xb668('0x31')]);return _0x43095e['getAgents'](_0xa2c0a);}})[_0xb668('0x14')](function(_0x35443a){if(_0x35443a){_0x7c5141=_0x35443a[_0xb668('0x2e')];if(!_0x148fab[_0xb668('0x29')][_0xb668('0x54')](_0xb668('0x42'))){_0xa2c0a['limit']=qs['limit'](_0x148fab[_0xb668('0x29')][_0xb668('0x10')]);_0xa2c0a[_0xb668('0xd')]=qs[_0xb668('0xd')](_0x148fab[_0xb668('0x29')]['offset']);}return _0x43095e['getAgents'](_0xa2c0a);}})[_0xb668('0x14')](function(_0x302106){if(_0x302106){return _0x302106?{'count':_0x7c5141,'rows':_0x302106}:null;}})[_0xb668('0x14')](respondWithResult(_0x1f09df,null))[_0xb668('0x24')](handleError(_0x1f09df,null));}; \ No newline at end of file +var _0x2ce7=['../../components/parsers/qs','../../config/logger','../../config/environment','redis','localhost','./whatsappQueue.socket','register','status','end','json','offset','undefined','limit','count','set','destroy','then','get','WhatsappQueues','UserProfileResource','sendStatus','error','send','map','WhatsappQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','catch','show','params','model','keys','filters','intersection','attributes','fields','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','length','hasOwnProperty','order','sort','WhatsappQueueId','filter','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','rows','format','%s/%s','SIP','Team','pick','getTeams','nolimit','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','forEach','emit','removeTeams','ids','select','field','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','isArray','getAgents','bluebird','util','lodash','squel','ioredis'];(function(_0x5192d3,_0x420f97){var _0x3341c6=function(_0x17c0e1){while(--_0x17c0e1){_0x5192d3['push'](_0x5192d3['shift']());}};_0x3341c6(++_0x420f97);}(_0x2ce7,0x166));var _0x72ce=function(_0x551867,_0x51706a){_0x551867=_0x551867-0x0;var _0x58b257=_0x2ce7[_0x551867];return _0x58b257;};'use strict';var BPromise=require(_0x72ce('0x0'));var util=require(_0x72ce('0x1'));var _=require(_0x72ce('0x2'));var squel=require(_0x72ce('0x3'));var Redis=require(_0x72ce('0x4'));var qs=require(_0x72ce('0x5'));var logger=require(_0x72ce('0x6'))('api');var config=require(_0x72ce('0x7'));var db=require('../../mysqldb')['db'];config[_0x72ce('0x8')]=_['defaults'](config[_0x72ce('0x8')],{'host':_0x72ce('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x72ce('0xa'))[_0x72ce('0xb')](socket);function respondWithStatusCode(_0x317c31,_0x2c214b){_0x2c214b=_0x2c214b||0xcc;return function(_0x51290f){if(_0x51290f){return _0x317c31['sendStatus'](_0x2c214b);}return _0x317c31[_0x72ce('0xc')](_0x2c214b)[_0x72ce('0xd')]();};}function respondWithResult(_0x4332cd,_0x330c42){_0x330c42=_0x330c42||0xc8;return function(_0x33e045){if(_0x33e045){return _0x4332cd[_0x72ce('0xc')](_0x330c42)[_0x72ce('0xe')](_0x33e045);}};}function respondWithFilteredResult(_0x1d588a,_0x3644f5){return function(_0x59695f){if(_0x59695f){var _0x216de7=typeof _0x3644f5[_0x72ce('0xf')]===_0x72ce('0x10')&&typeof _0x3644f5[_0x72ce('0x11')]==='undefined';var _0x13e7d9=_0x59695f[_0x72ce('0x12')];var _0x51d5cc=_0x216de7?0x0:_0x3644f5[_0x72ce('0xf')];var _0x219b66=_0x216de7?_0x59695f[_0x72ce('0x12')]:_0x3644f5[_0x72ce('0xf')]+_0x3644f5[_0x72ce('0x11')];var _0x35c4c3;if(_0x219b66>=_0x13e7d9){_0x219b66=_0x13e7d9;_0x35c4c3=0xc8;}else{_0x35c4c3=0xce;}_0x1d588a[_0x72ce('0xc')](_0x35c4c3);return _0x1d588a[_0x72ce('0x13')]('Content-Range',_0x51d5cc+'-'+_0x219b66+'/'+_0x13e7d9)[_0x72ce('0xe')](_0x59695f);}return null;};}function saveUpdates(_0x4c8efa){return function(_0x13eb26){if(_0x13eb26){return _0x13eb26['update'](_0x4c8efa)['then'](function(_0x381ee){return _0x381ee;});}return null;};}function removeEntity(_0x49f5dd){return function(_0x3de0e1){if(_0x3de0e1){return _0x3de0e1[_0x72ce('0x14')]()[_0x72ce('0x15')](function(){var _0x42dcc8=_0x3de0e1[_0x72ce('0x16')]({'plain':!![]});var _0xfc0cbc=_0x72ce('0x17');return db[_0x72ce('0x18')][_0x72ce('0x14')]({'where':{'type':_0xfc0cbc,'resourceId':_0x42dcc8['id']}})[_0x72ce('0x15')](function(){return _0x3de0e1;});})[_0x72ce('0x15')](function(){_0x49f5dd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x597a75){return function(_0x5ce02c){if(!_0x5ce02c){_0x597a75[_0x72ce('0x19')](0x194);}return _0x5ce02c;};}function handleError(_0x4355f,_0x1718df){_0x1718df=_0x1718df||0x1f4;return function(_0x42e8d6){logger[_0x72ce('0x1a')](_0x42e8d6['stack']);if(_0x42e8d6['name']){delete _0x42e8d6['name'];}_0x4355f[_0x72ce('0xc')](_0x1718df)[_0x72ce('0x1b')](_0x42e8d6);};}exports['index']=function(_0x341bb1,_0x20b49d){var _0x10cdb0={};var _0x3bc405={'count':0x0,'rows':[]};var _0x1a0c90=_[_0x72ce('0x1c')](db[_0x72ce('0x1d')][_0x72ce('0x1e')],function(_0x3ed802){return{'name':_0x3ed802[_0x72ce('0x1f')],'type':_0x3ed802['type'][_0x72ce('0x20')]};});_0x10cdb0=qs[_0x72ce('0x21')](_0x1a0c90,_0x341bb1);var _0x17449c={'where':_0x10cdb0[_0x72ce('0x22')]};return db[_0x72ce('0x1d')]['count'](_0x17449c)[_0x72ce('0x15')](function(_0x337c8b){_0x3bc405['count']=_0x337c8b;_0x10cdb0[_0x72ce('0x23')]=qs[_0x72ce('0x23')](_0x341bb1[_0x72ce('0x24')]);return db['WhatsappQueue'][_0x72ce('0x25')](_0x10cdb0);})[_0x72ce('0x15')](function(_0x3849f6){_0x3bc405['rows']=_0x3849f6;return _0x3bc405;})['then'](respondWithFilteredResult(_0x20b49d,_0x10cdb0))[_0x72ce('0x26')](handleError(_0x20b49d,null));};exports[_0x72ce('0x27')]=function(_0x3270e6,_0x493041){var _0x1b9c6b={'raw':!![],'where':{'id':_0x3270e6[_0x72ce('0x28')]['id']}},_0x1ea6a2={};_0x1ea6a2[_0x72ce('0x29')]=_[_0x72ce('0x2a')](db[_0x72ce('0x1d')][_0x72ce('0x1e')]);_0x1ea6a2[_0x72ce('0x24')]=_[_0x72ce('0x2a')](_0x3270e6[_0x72ce('0x24')]);_0x1ea6a2[_0x72ce('0x2b')]=_[_0x72ce('0x2c')](_0x1ea6a2[_0x72ce('0x29')],_0x1ea6a2[_0x72ce('0x24')]);_0x1b9c6b[_0x72ce('0x2d')]=_[_0x72ce('0x2c')](_0x1ea6a2[_0x72ce('0x29')],qs[_0x72ce('0x2e')](_0x3270e6[_0x72ce('0x24')][_0x72ce('0x2e')]));_0x1b9c6b[_0x72ce('0x2d')]=_0x1b9c6b[_0x72ce('0x2d')]['length']?_0x1b9c6b[_0x72ce('0x2d')]:_0x1ea6a2[_0x72ce('0x29')];if(_0x3270e6[_0x72ce('0x24')]['includeAll']){_0x1b9c6b['include']=[{'all':!![]}];}_0x1b9c6b=_[_0x72ce('0x2f')]({},_0x1b9c6b,_0x3270e6[_0x72ce('0x30')]);return db['WhatsappQueue'][_0x72ce('0x31')](_0x1b9c6b)[_0x72ce('0x15')](handleEntityNotFound(_0x493041,null))['then'](respondWithResult(_0x493041,null))[_0x72ce('0x26')](handleError(_0x493041,null));};exports[_0x72ce('0x32')]=function(_0x3fddfa,_0x119787){return db[_0x72ce('0x1d')]['create'](_0x3fddfa[_0x72ce('0x33')],{})[_0x72ce('0x15')](function(_0x1af557){var _0x32787e=_0x3fddfa[_0x72ce('0x34')][_0x72ce('0x16')]({'plain':!![]});if(!_0x32787e)throw new Error(_0x72ce('0x35'));if(_0x32787e['role']===_0x72ce('0x34')){var _0x327a6c=_0x1af557[_0x72ce('0x16')]({'plain':!![]});var _0x8f3f1f=_0x72ce('0x17');return db[_0x72ce('0x36')]['find']({'where':{'name':_0x8f3f1f,'userProfileId':_0x32787e[_0x72ce('0x37')]},'raw':!![]})[_0x72ce('0x15')](function(_0x2fc17a){if(_0x2fc17a&&_0x2fc17a['autoAssociation']===0x0){return db[_0x72ce('0x18')][_0x72ce('0x32')]({'name':_0x327a6c[_0x72ce('0x38')],'resourceId':_0x327a6c['id'],'type':_0x2fc17a[_0x72ce('0x38')],'sectionId':_0x2fc17a['id']},{})[_0x72ce('0x15')](function(){return _0x1af557;});}else{return _0x1af557;}})[_0x72ce('0x26')](function(_0x349805){logger['error'](_0x72ce('0x39'),_0x349805);throw _0x349805;});}return _0x1af557;})[_0x72ce('0x15')](respondWithResult(_0x119787,0xc9))[_0x72ce('0x26')](handleError(_0x119787,null));};exports['update']=function(_0x384b0b,_0x112641){if(_0x384b0b[_0x72ce('0x33')]['id']){delete _0x384b0b[_0x72ce('0x33')]['id'];}return db[_0x72ce('0x1d')][_0x72ce('0x31')]({'where':{'id':_0x384b0b[_0x72ce('0x28')]['id']}})[_0x72ce('0x15')](handleEntityNotFound(_0x112641,null))[_0x72ce('0x15')](saveUpdates(_0x384b0b['body'],null))[_0x72ce('0x15')](respondWithResult(_0x112641,null))[_0x72ce('0x26')](handleError(_0x112641,null));};exports[_0x72ce('0x14')]=function(_0x24f70a,_0x209519){return db['WhatsappQueue'][_0x72ce('0x31')]({'where':{'id':_0x24f70a[_0x72ce('0x28')]['id']}})[_0x72ce('0x15')](handleEntityNotFound(_0x209519,null))[_0x72ce('0x15')](removeEntity(_0x209519,null))[_0x72ce('0x26')](handleError(_0x209519,null));};exports['describe']=function(_0x3d3a1d,_0x2cda6a){return db[_0x72ce('0x1d')][_0x72ce('0x3a')]()[_0x72ce('0x15')](respondWithResult(_0x2cda6a,null))['catch'](handleError(_0x2cda6a,null));};exports[_0x72ce('0x3b')]=function(_0x41ec9e,_0x59a99e){var _0x5e32e2={'raw':!![],'where':{}},_0x43bb77={},_0x26ce67;return db[_0x72ce('0x1d')][_0x72ce('0x3c')]({'where':{'id':_0x41ec9e[_0x72ce('0x28')]['id']}})['then'](handleEntityNotFound(_0x59a99e,null))['then'](function(_0x432558){if(_0x432558){_0x26ce67=_0x432558['get']({'plain':!![]});_0x43bb77[_0x72ce('0x29')]=_[_0x72ce('0x2a')](db[_0x72ce('0x3d')][_0x72ce('0x1e')]);_0x43bb77['query']=_[_0x72ce('0x2a')](_0x41ec9e[_0x72ce('0x24')]);_0x43bb77[_0x72ce('0x2b')]=_[_0x72ce('0x2c')](_0x43bb77[_0x72ce('0x29')],_0x43bb77['query']);_0x5e32e2['attributes']=_['intersection'](_0x43bb77[_0x72ce('0x29')],qs[_0x72ce('0x2e')](_0x41ec9e[_0x72ce('0x24')][_0x72ce('0x2e')]));_0x5e32e2[_0x72ce('0x2d')]=_0x5e32e2['attributes'][_0x72ce('0x3e')]?_0x5e32e2[_0x72ce('0x2d')]:_0x43bb77['model'];if(!_0x41ec9e[_0x72ce('0x24')][_0x72ce('0x3f')]('nolimit')){_0x5e32e2[_0x72ce('0x11')]=qs[_0x72ce('0x11')](_0x41ec9e[_0x72ce('0x24')]['limit']);_0x5e32e2[_0x72ce('0xf')]=qs[_0x72ce('0xf')](_0x41ec9e[_0x72ce('0x24')]['offset']);}_0x5e32e2[_0x72ce('0x40')]=qs[_0x72ce('0x41')](_0x41ec9e[_0x72ce('0x24')][_0x72ce('0x41')]);_0x5e32e2[_0x72ce('0x22')]=qs['filters'](_['pick'](_0x41ec9e['query'],_0x43bb77[_0x72ce('0x2b')]));_0x5e32e2['where'][_0x72ce('0x42')]=_0x432558['id'];if(_0x41ec9e[_0x72ce('0x24')]['filter']){_0x5e32e2[_0x72ce('0x22')]=_[_0x72ce('0x2f')](_0x5e32e2[_0x72ce('0x22')],{'$or':_[_0x72ce('0x1c')](_0x5e32e2[_0x72ce('0x2d')],function(_0x4c083a){var _0x304c6d={};_0x304c6d[_0x4c083a]={'$like':'%'+_0x41ec9e['query'][_0x72ce('0x43')]+'%'};return _0x304c6d;})});}_0x5e32e2=_[_0x72ce('0x2f')]({},_0x5e32e2,_0x41ec9e['options']);return db['UserWhatsappQueue'][_0x72ce('0x25')](_0x5e32e2);}})['then'](function(_0x8365ea){if(_0x8365ea){return db[_0x72ce('0x44')][_0x72ce('0x45')]({'where':{'id':_[_0x72ce('0x1c')](_0x8365ea,_0x72ce('0x46')),'role':_0x72ce('0x47')},'attributes':['id',_0x72ce('0x38'),_0x72ce('0x48'),_0x72ce('0x49'),_0x72ce('0x4a')]});}})[_0x72ce('0x15')](function(_0x5bc4c0){if(_0x5bc4c0){return{'count':_0x5bc4c0[_0x72ce('0x12')],'rows':_[_0x72ce('0x1c')](_0x5bc4c0[_0x72ce('0x4b')],function(_0x36c885){return{'membername':_0x36c885['name'],'UserId':_0x36c885['id'],'queue_name':_0x26ce67['name'],'WhatsappQueueId':_0x26ce67['id'],'interface':util[_0x72ce('0x4c')](_0x72ce('0x4d'),_0x72ce('0x4e'),_0x36c885[_0x72ce('0x38')]),'penalty':0x0,'paused':_0x36c885[_0x72ce('0x48')],'createdAt':_0x36c885[_0x72ce('0x4a')],'updatedAt':_0x36c885['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x72ce('0x15')](respondWithFilteredResult(_0x59a99e,_0x5e32e2))[_0x72ce('0x26')](handleError(_0x59a99e,null));};exports['getTeams']=function(_0x13ff50,_0x4712af){var _0x156c92={};var _0xc6e452={};var _0x39abdf;var _0x34bd3d;return db[_0x72ce('0x1d')]['findOne']({'where':{'id':_0x13ff50[_0x72ce('0x28')]['id']}})[_0x72ce('0x15')](handleEntityNotFound(_0x4712af,null))['then'](function(_0x4be50b){if(_0x4be50b){_0x39abdf=_0x4be50b;_0xc6e452[_0x72ce('0x29')]=_['keys'](db[_0x72ce('0x4f')][_0x72ce('0x1e')]);_0xc6e452[_0x72ce('0x24')]=_[_0x72ce('0x2a')](_0x13ff50['query']);_0xc6e452[_0x72ce('0x2b')]=_[_0x72ce('0x2c')](_0xc6e452[_0x72ce('0x29')],_0xc6e452[_0x72ce('0x24')]);_0x156c92[_0x72ce('0x2d')]=_[_0x72ce('0x2c')](_0xc6e452['model'],qs['fields'](_0x13ff50[_0x72ce('0x24')][_0x72ce('0x2e')]));_0x156c92[_0x72ce('0x2d')]=_0x156c92['attributes']['length']?_0x156c92[_0x72ce('0x2d')]:_0xc6e452[_0x72ce('0x29')];_0x156c92['order']=qs[_0x72ce('0x41')](_0x13ff50[_0x72ce('0x24')][_0x72ce('0x41')]);_0x156c92[_0x72ce('0x22')]=qs[_0x72ce('0x2b')](_[_0x72ce('0x50')](_0x13ff50[_0x72ce('0x24')],_0xc6e452[_0x72ce('0x2b')]));if(_0x13ff50[_0x72ce('0x24')][_0x72ce('0x43')]){_0x156c92['where']=_[_0x72ce('0x2f')](_0x156c92[_0x72ce('0x22')],{'$or':_['map'](_0x156c92[_0x72ce('0x2d')],function(_0x1f5875){var _0x85537c={};_0x85537c[_0x1f5875]={'$like':'%'+_0x13ff50[_0x72ce('0x24')][_0x72ce('0x43')]+'%'};return _0x85537c;})});}_0x156c92=_[_0x72ce('0x2f')]({},_0x156c92,_0x13ff50['options']);return _0x39abdf[_0x72ce('0x51')](_0x156c92);}})['then'](function(_0x87b1c4){if(_0x87b1c4){_0x34bd3d=_0x87b1c4[_0x72ce('0x3e')];if(!_0x13ff50['query']['hasOwnProperty'](_0x72ce('0x52'))){_0x156c92[_0x72ce('0x11')]=qs['limit'](_0x13ff50[_0x72ce('0x24')][_0x72ce('0x11')]);_0x156c92[_0x72ce('0xf')]=qs[_0x72ce('0xf')](_0x13ff50[_0x72ce('0x24')][_0x72ce('0xf')]);}return _0x39abdf[_0x72ce('0x51')](_0x156c92);}})[_0x72ce('0x15')](function(_0x344fa1){if(_0x344fa1){return _0x344fa1?{'count':_0x34bd3d,'rows':_0x344fa1}:null;}})[_0x72ce('0x15')](respondWithResult(_0x4712af,null))[_0x72ce('0x26')](handleError(_0x4712af,null));};exports['addTeams']=function(_0x1c8255,_0x289ceb){var _0x1b5aa6=_0x1c8255['body']['ids'];return db[_0x72ce('0x4f')][_0x72ce('0x25')]({'where':{'id':_0x1b5aa6},'attributes':['id'],'include':[{'model':db[_0x72ce('0x44')],'as':_0x72ce('0x53'),'attributes':['id','name',_0x72ce('0x54'),'voicePause',_0x72ce('0x55')],'raw':!![]}]})[_0x72ce('0x15')](function(_0x3659db){if(_0x3659db){var _0x3e246e=_[_0x72ce('0x56')](_0x3659db,function(_0xbec129){var _0x2c9af5=_0xbec129[_0x72ce('0x16')]({'plain':!![]});return _0x2c9af5[_0x72ce('0x53')];});return db[_0x72ce('0x1d')]['find']({'where':{'id':_0x1c8255[_0x72ce('0x28')]['id']}})[_0x72ce('0x15')](function(_0x363b2e){return db[_0x72ce('0x57')][_0x72ce('0x58')](function(_0x2648ee){return _0x363b2e[_0x72ce('0x59')](_0x1b5aa6,{'transaction':_0x2648ee})['then'](function(){return BPromise[_0x72ce('0x5a')](_0x3e246e,function(_0x1c7e7b){return db[_0x72ce('0x3d')]['findOrCreate']({'where':{'UserId':_0x1c7e7b['id'],'WhatsappQueueId':_0x1c8255['params']['id']},'transaction':_0x2648ee});});})['then'](function(){_0x3e246e[_0x72ce('0x5b')](function(_0x5a484b){socket[_0x72ce('0x5c')]('userWhatsappQueue:save',{'UserId':_0x5a484b['id'],'WhatsappQueueId':_0x363b2e['id']});});});});});}})['then'](respondWithStatusCode(_0x289ceb,null))[_0x72ce('0x26')](handleError(_0x289ceb,null));};exports[_0x72ce('0x5d')]=function(_0x3e063d,_0x14eca7){return db[_0x72ce('0x4f')]['findAll']({'where':{'id':_0x3e063d[_0x72ce('0x24')][_0x72ce('0x5e')]},'attributes':['id'],'include':[{'model':db[_0x72ce('0x44')],'as':_0x72ce('0x53'),'attributes':['id'],'raw':!![]}]})[_0x72ce('0x15')](handleEntityNotFound(_0x14eca7,null))[_0x72ce('0x15')](function(_0x17a6bb){var _0x4abd40=_[_0x72ce('0x1c')](_0x17a6bb,'id');var _0x187a8f=[];var _0x59c15a=[];var _0x48ad7c=squel[_0x72ce('0x5f')]();_0x48ad7c[_0x72ce('0x60')]('tq.TeamId')[_0x72ce('0x61')](_0x72ce('0x62'),'tq')[_0x72ce('0x63')](_0x72ce('0x64'),'ut',_0x72ce('0x65'))[_0x72ce('0x22')](_0x72ce('0x66'),_0x3e063d['params']['id']);for(var _0x55bf94=0x0;_0x55bf94<_0x17a6bb[_0x72ce('0x3e')];_0x55bf94+=0x1){let _0x5211f4=_0x17a6bb[_0x55bf94];for(var _0x4602ab=0x0;_0x4602ab<_0x5211f4[_0x72ce('0x53')]['length'];_0x4602ab+=0x1){let _0xcfc7c=_0x5211f4[_0x72ce('0x53')][_0x4602ab];var _0x56e0b4=_0x48ad7c['clone']();_0x56e0b4[_0x72ce('0x22')](_0x72ce('0x67'),_0xcfc7c['id']);_0x59c15a['push'](db[_0x72ce('0x57')][_0x72ce('0x24')](_0x56e0b4[_0x72ce('0x68')](),{'type':db[_0x72ce('0x57')][_0x72ce('0x69')][_0x72ce('0x6a')]})[_0x72ce('0x15')](function(_0x207cac){if(_0x207cac[_0x72ce('0x3e')]===0x1){return _0xcfc7c['id'];}else{var _0x2bd065=_['every'](_[_0x72ce('0x1c')](_0x207cac,_0x72ce('0x6b')),function(_0x29a0be){return _[_0x72ce('0x6c')](_0x4abd40,_0x29a0be);});if(_0x2bd065){return _0xcfc7c['id'];}}}));}}return BPromise[_0x72ce('0x6d')](_0x59c15a)[_0x72ce('0x15')](function(_0x1818c0){_0x187a8f=_(_0x187a8f)['union'](_0x1818c0)[_0x72ce('0x6e')]()[_0x72ce('0x6f')]();return db[_0x72ce('0x1d')][_0x72ce('0x31')]({'where':{'id':_0x3e063d[_0x72ce('0x28')]['id']}})[_0x72ce('0x15')](function(_0x24d9bd){return db['sequelize'][_0x72ce('0x58')](function(_0x3f422e){return _0x24d9bd[_0x72ce('0x5d')](_0x3e063d[_0x72ce('0x24')][_0x72ce('0x5e')],{'transaction':_0x3f422e})[_0x72ce('0x15')](function(){if(!_[_0x72ce('0x70')](_0x187a8f)){return _0x24d9bd[_0x72ce('0x71')](_0x187a8f,{'transaction':_0x3f422e});}})[_0x72ce('0x15')](function(){_0x187a8f[_0x72ce('0x5b')](function(_0x203fc6){socket['emit'](_0x72ce('0x72'),{'UserId':_0x203fc6,'WhatsappQueueId':_0x24d9bd['id']});});});});});});})[_0x72ce('0x15')](respondWithStatusCode(_0x14eca7,null))[_0x72ce('0x26')](handleError(_0x14eca7,null));};exports['addAgents']=function(_0x2cf59c,_0x38b83e){return db['WhatsappQueue'][_0x72ce('0x31')]({'where':{'id':_0x2cf59c[_0x72ce('0x28')]['id']}})['then'](handleEntityNotFound(_0x38b83e,null))[_0x72ce('0x15')](function(_0x3ddcfd){if(_0x3ddcfd){return _0x3ddcfd[_0x72ce('0x73')](_0x2cf59c[_0x72ce('0x33')][_0x72ce('0x5e')],_[_0x72ce('0x74')](_0x2cf59c[_0x72ce('0x33')],[_0x72ce('0x5e'),'id'])||{})[_0x72ce('0x75')](function(_0x2ccea3){for(var _0x15459a=0x0;_0x15459a<_0x2cf59c['body']['ids'][_0x72ce('0x3e')];_0x15459a+=0x1){socket[_0x72ce('0x5c')](_0x72ce('0x76'),{'UserId':Number(_0x2cf59c['body']['ids'][_0x15459a]),'WhatsappQueueId':Number(_0x2cf59c[_0x72ce('0x28')]['id'])});}return _0x2ccea3;});}})[_0x72ce('0x15')](respondWithResult(_0x38b83e,null))[_0x72ce('0x26')](handleError(_0x38b83e,null));};exports[_0x72ce('0x71')]=function(_0x67f7,_0x356b03){return db['WhatsappQueue'][_0x72ce('0x31')]({'where':{'id':_0x67f7['params']['id']}})[_0x72ce('0x15')](handleEntityNotFound(_0x356b03,null))[_0x72ce('0x15')](function(_0x1a700a){if(_0x1a700a){return _0x1a700a['removeAgents'](_0x67f7[_0x72ce('0x24')][_0x72ce('0x5e')])[_0x72ce('0x15')](function(){if(_[_0x72ce('0x77')](_0x67f7[_0x72ce('0x24')]['ids'])){for(var _0x5c613f=0x0;_0x5c613f<_0x67f7['query'][_0x72ce('0x5e')][_0x72ce('0x3e')];_0x5c613f+=0x1){socket[_0x72ce('0x5c')](_0x72ce('0x72'),{'UserId':Number(_0x67f7[_0x72ce('0x24')][_0x72ce('0x5e')][_0x5c613f]),'WhatsappQueueId':Number(_0x67f7['params']['id'])});}}else{socket['emit'](_0x72ce('0x72'),{'UserId':Number(_0x67f7[_0x72ce('0x24')][_0x72ce('0x5e')]),'WhatsappQueueId':Number(_0x67f7[_0x72ce('0x28')]['id'])});}});}})['then'](respondWithStatusCode(_0x356b03,null))[_0x72ce('0x26')](handleError(_0x356b03,null));};exports[_0x72ce('0x78')]=function(_0x6dbaab,_0x4a679e){var _0x50652b={};var _0x488b78={};var _0xd6eadf;var _0x599a96;return db[_0x72ce('0x1d')][_0x72ce('0x3c')]({'where':{'id':_0x6dbaab[_0x72ce('0x28')]['id']}})['then'](handleEntityNotFound(_0x4a679e,null))[_0x72ce('0x15')](function(_0x1a0bd2){if(_0x1a0bd2){_0xd6eadf=_0x1a0bd2;_0x488b78['model']=_[_0x72ce('0x2a')](db[_0x72ce('0x44')]['rawAttributes']);_0x488b78[_0x72ce('0x24')]=_[_0x72ce('0x2a')](_0x6dbaab[_0x72ce('0x24')]);_0x488b78['filters']=_[_0x72ce('0x2c')](_0x488b78['model'],_0x488b78[_0x72ce('0x24')]);_0x50652b[_0x72ce('0x2d')]=_[_0x72ce('0x2c')](_0x488b78[_0x72ce('0x29')],qs[_0x72ce('0x2e')](_0x6dbaab[_0x72ce('0x24')][_0x72ce('0x2e')]));_0x50652b[_0x72ce('0x2d')]=_0x50652b[_0x72ce('0x2d')]['length']?_0x50652b[_0x72ce('0x2d')]:_0x488b78[_0x72ce('0x29')];_0x50652b[_0x72ce('0x40')]=qs[_0x72ce('0x41')](_0x6dbaab[_0x72ce('0x24')][_0x72ce('0x41')]);_0x50652b[_0x72ce('0x22')]=qs[_0x72ce('0x2b')](_['pick'](_0x6dbaab['query'],_0x488b78[_0x72ce('0x2b')]));if(_0x6dbaab[_0x72ce('0x24')][_0x72ce('0x43')]){_0x50652b[_0x72ce('0x22')]=_[_0x72ce('0x2f')](_0x50652b[_0x72ce('0x22')],{'$or':_['map'](_0x50652b[_0x72ce('0x2d')],function(_0x50b3ea){var _0x515d88={};_0x515d88[_0x50b3ea]={'$like':'%'+_0x6dbaab[_0x72ce('0x24')]['filter']+'%'};return _0x515d88;})});}_0x50652b=_[_0x72ce('0x2f')]({},_0x50652b,_0x6dbaab[_0x72ce('0x30')]);return _0xd6eadf[_0x72ce('0x78')](_0x50652b);}})['then'](function(_0x2ed51f){if(_0x2ed51f){_0x599a96=_0x2ed51f[_0x72ce('0x3e')];if(!_0x6dbaab[_0x72ce('0x24')][_0x72ce('0x3f')](_0x72ce('0x52'))){_0x50652b[_0x72ce('0x11')]=qs['limit'](_0x6dbaab[_0x72ce('0x24')]['limit']);_0x50652b[_0x72ce('0xf')]=qs[_0x72ce('0xf')](_0x6dbaab[_0x72ce('0x24')][_0x72ce('0xf')]);}return _0xd6eadf[_0x72ce('0x78')](_0x50652b);}})[_0x72ce('0x15')](function(_0x90a397){if(_0x90a397){return _0x90a397?{'count':_0x599a96,'rows':_0x90a397}:null;}})[_0x72ce('0x15')](respondWithResult(_0x4a679e,null))[_0x72ce('0x26')](handleError(_0x4a679e,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index d5c677e..5071d05 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 _0x132f=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x132f,0x16e));var _0xf132=function(_0x1e8b1e,_0x407bbd){_0x1e8b1e=_0x1e8b1e-0x0;var _0x4a0fde=_0x132f[_0x1e8b1e];return _0x4a0fde;};'use strict';var EventEmitter=require(_0xf132('0x0'));var WhatsappQueue=require(_0xf132('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xf132('0x2')](0x0);var events={'afterCreate':_0xf132('0x3'),'afterUpdate':_0xf132('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e3d94){return function(_0x3cb6b5,_0x4adb76,_0x4546f9){WhatsappQueueEvents[_0xf132('0x5')](_0x2e3d94+':'+_0x3cb6b5['id'],_0x3cb6b5);WhatsappQueueEvents[_0xf132('0x5')](_0x2e3d94,_0x3cb6b5);_0x4546f9(null);};}for(var e in events){if(events[_0xf132('0x6')](e)){var event=events[e];WhatsappQueue[_0xf132('0x7')](e,emitEvent(event));}}module[_0xf132('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x6c0c=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue'];(function(_0x114bf1,_0x16ac4a){var _0x58072f=function(_0x377d8a){while(--_0x377d8a){_0x114bf1['push'](_0x114bf1['shift']());}};_0x58072f(++_0x16ac4a);}(_0x6c0c,0x1da));var _0xc6c0=function(_0x7f5c81,_0x3e5830){_0x7f5c81=_0x7f5c81-0x0;var _0x219e62=_0x6c0c[_0x7f5c81];return _0x219e62;};'use strict';var EventEmitter=require(_0xc6c0('0x0'));var WhatsappQueue=require(_0xc6c0('0x1'))['db'][_0xc6c0('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xc6c0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc6c0('0x4')};function emitEvent(_0x37cffe){return function(_0x26b102,_0x420b6b,_0x2246d6){WhatsappQueueEvents[_0xc6c0('0x5')](_0x37cffe+':'+_0x26b102['id'],_0x26b102);WhatsappQueueEvents[_0xc6c0('0x5')](_0x37cffe,_0x26b102);_0x2246d6(null);};}for(var e in events){if(events[_0xc6c0('0x6')](e)){var event=events[e];WhatsappQueue[_0xc6c0('0x7')](e,emitEvent(event));}}module[_0xc6c0('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index e9e9538..731ac21 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 _0x895d=['bluebird','path','rimraf','../../config/environment','exports','WhatsappQueue','lodash','util','api'];(function(_0x449d8b,_0xfe7857){var _0x38d2ad=function(_0x549dd4){while(--_0x549dd4){_0x449d8b['push'](_0x449d8b['shift']());}};_0x38d2ad(++_0xfe7857);}(_0x895d,0x1da));var _0xd895=function(_0x4c7961,_0x51c927){_0x4c7961=_0x4c7961-0x0;var _0x38bb3a=_0x895d[_0x4c7961];return _0x38bb3a;};'use strict';var _=require(_0xd895('0x0'));var util=require(_0xd895('0x1'));var logger=require('../../config/logger')(_0xd895('0x2'));var moment=require('moment');var BPromise=require(_0xd895('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd895('0x4'));var rimraf=require(_0xd895('0x5'));var config=require(_0xd895('0x6'));var attributes=require('./whatsappQueue.attributes');module[_0xd895('0x7')]=function(_0x305c1a,_0x14540b){return _0x305c1a['define'](_0xd895('0x8'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6ba=['path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment'];(function(_0x346027,_0x250e85){var _0x18ce3c=function(_0x2e63ae){while(--_0x2e63ae){_0x346027['push'](_0x346027['shift']());}};_0x18ce3c(++_0x250e85);}(_0xe6ba,0x1f3));var _0xae6b=function(_0x2f2a2b,_0x6e1556){_0x2f2a2b=_0x2f2a2b-0x0;var _0x3ab7e3=_0xe6ba[_0x2f2a2b];return _0x3ab7e3;};'use strict';var _=require(_0xae6b('0x0'));var util=require(_0xae6b('0x1'));var logger=require(_0xae6b('0x2'))(_0xae6b('0x3'));var moment=require(_0xae6b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xae6b('0x5'));var rimraf=require(_0xae6b('0x6'));var config=require(_0xae6b('0x7'));var attributes=require(_0xae6b('0x8'));module[_0xae6b('0x9')]=function(_0x506931,_0x5c1546){return _0x506931['define'](_0xae6b('0xa'),attributes,{'tableName':_0xae6b('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 24a4356..9e14319 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 _0x70be=['ShowWhatsappQueue','find','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./whatsappQueue.socket','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','where','attributes','limit','include','map','model','debug','stringify'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x70be,0xa3));var _0xe70b=function(_0x4158b6,_0x5daf5d){_0x4158b6=_0x4158b6-0x0;var _0x1ac0ac=_0x70be[_0x4158b6];return _0x1ac0ac;};'use strict';var _=require(_0xe70b('0x0'));var util=require(_0xe70b('0x1'));var moment=require('moment');var BPromise=require(_0xe70b('0x2'));var rs=require(_0xe70b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe70b('0x4'))['db'];var utils=require(_0xe70b('0x5'));var logger=require(_0xe70b('0x6'))(_0xe70b('0x7'));var config=require(_0xe70b('0x8'));var jayson=require(_0xe70b('0x9'));var client=jayson[_0xe70b('0xa')][_0xe70b('0xb')]({'port':0x232a});config[_0xe70b('0xc')]=_['defaults'](config[_0xe70b('0xc')],{'host':_0xe70b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe70b('0xe'))['register'](socket);function respondWithRpcPromise(_0x26f59c,_0x4ef8fa,_0x1201f9){return new BPromise(function(_0x2d5800,_0x12b4ce){return client[_0xe70b('0xf')](_0x26f59c,_0x1201f9)[_0xe70b('0x10')](function(_0x53a922){logger['info'](_0xe70b('0x11'),_0x4ef8fa,_0xe70b('0x12'));logger['debug'](_0xe70b('0x13'),_0x4ef8fa,_0xe70b('0x12'),JSON['stringify'](_0x53a922));if(_0x53a922[_0xe70b('0x14')]){if(_0x53a922[_0xe70b('0x14')]['code']===0x1f4){logger[_0xe70b('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x4ef8fa,_0x53a922[_0xe70b('0x14')][_0xe70b('0x15')]);return _0x12b4ce(_0x53a922[_0xe70b('0x14')][_0xe70b('0x15')]);}logger[_0xe70b('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x4ef8fa,_0x53a922[_0xe70b('0x14')][_0xe70b('0x15')]);return _0x2d5800(_0x53a922['error']['message']);}else{logger[_0xe70b('0x16')](_0xe70b('0x11'),_0x4ef8fa,_0xe70b('0x12'));_0x2d5800(_0x53a922[_0xe70b('0x17')][_0xe70b('0x15')]);}})[_0xe70b('0x18')](function(_0x330501){logger[_0xe70b('0x14')](_0xe70b('0x11'),_0x4ef8fa,_0x330501);_0x12b4ce(_0x330501);});});}exports[_0xe70b('0x19')]=function(_0xfd9f97){var _0xf4a461=this;return new Promise(function(_0x470f57,_0xb5ba32){return db[_0xe70b('0x1a')][_0xe70b('0x1b')]({'raw':_0xfd9f97[_0xe70b('0x1c')]?_0xfd9f97[_0xe70b('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xfd9f97[_0xe70b('0x1c')]?_0xfd9f97['options'][_0xe70b('0x1d')]||null:null,'attributes':_0xfd9f97['options']?_0xfd9f97['options'][_0xe70b('0x1e')]||null:null,'limit':_0xfd9f97[_0xe70b('0x1c')]?_0xfd9f97['options'][_0xe70b('0x1f')]||null:null,'include':_0xfd9f97[_0xe70b('0x1c')]?_0xfd9f97[_0xe70b('0x1c')][_0xe70b('0x20')]?_[_0xe70b('0x21')](_0xfd9f97[_0xe70b('0x1c')][_0xe70b('0x20')],function(_0x50ad94){return{'model':db[_0x50ad94['model']],'as':_0x50ad94['as'],'attributes':_0x50ad94[_0xe70b('0x1e')],'include':_0x50ad94[_0xe70b('0x20')]?_[_0xe70b('0x21')](_0x50ad94[_0xe70b('0x20')],function(_0x18411d){return{'model':db[_0x18411d[_0xe70b('0x22')]],'as':_0x18411d['as'],'attributes':_0x18411d['attributes'],'include':_0x18411d['include']?_['map'](_0x18411d[_0xe70b('0x20')],function(_0x112e3c){return{'model':db[_0x112e3c[_0xe70b('0x22')]],'as':_0x112e3c['as'],'attributes':_0x112e3c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b4134){logger[_0xe70b('0x16')](_0xe70b('0x19'),_0xfd9f97);logger[_0xe70b('0x23')](_0xe70b('0x19'),_0xfd9f97,JSON[_0xe70b('0x24')](_0x2b4134));_0x470f57(_0x2b4134);})['catch'](function(_0x534be0){logger[_0xe70b('0x14')]('GetWhatsappQueue',_0x534be0[_0xe70b('0x15')],_0xfd9f97);_0xb5ba32(_0xf4a461[_0xe70b('0x14')](0x1f4,_0x534be0[_0xe70b('0x15')]));});});};exports[_0xe70b('0x25')]=function(_0x1f30e1){var _0xf5edff=this;return new Promise(function(_0x254909,_0x4153d4){return db[_0xe70b('0x1a')][_0xe70b('0x26')]({'raw':_0x1f30e1[_0xe70b('0x1c')]?_0x1f30e1[_0xe70b('0x1c')][_0xe70b('0x27')]===undefined?!![]:![]:!![],'where':_0x1f30e1[_0xe70b('0x1c')]?_0x1f30e1[_0xe70b('0x1c')][_0xe70b('0x1d')]||null:null,'attributes':_0x1f30e1[_0xe70b('0x1c')]?_0x1f30e1[_0xe70b('0x1c')]['attributes']||null:null,'include':_0x1f30e1[_0xe70b('0x1c')]?_0x1f30e1[_0xe70b('0x1c')][_0xe70b('0x20')]?_[_0xe70b('0x21')](_0x1f30e1[_0xe70b('0x1c')][_0xe70b('0x20')],function(_0x3b2e96){return{'model':db[_0x3b2e96[_0xe70b('0x22')]],'as':_0x3b2e96['as'],'attributes':_0x3b2e96[_0xe70b('0x1e')],'include':_0x3b2e96[_0xe70b('0x20')]?_['map'](_0x3b2e96[_0xe70b('0x20')],function(_0x82541b){return{'model':db[_0x82541b['model']],'as':_0x82541b['as'],'attributes':_0x82541b[_0xe70b('0x1e')],'include':_0x82541b[_0xe70b('0x20')]?_[_0xe70b('0x21')](_0x82541b['include'],function(_0x58e26a){return{'model':db[_0x58e26a[_0xe70b('0x22')]],'as':_0x58e26a['as'],'attributes':_0x58e26a['attributes']};}):[]};}):[]};}):[]:[]})[_0xe70b('0x10')](function(_0xc92c4){logger[_0xe70b('0x16')]('ShowWhatsappQueue',_0x1f30e1);logger['debug'](_0xe70b('0x25'),_0x1f30e1,JSON[_0xe70b('0x24')](_0xc92c4));_0x254909(_0xc92c4);})[_0xe70b('0x18')](function(_0x1b18fa){logger[_0xe70b('0x14')](_0xe70b('0x25'),_0x1b18fa[_0xe70b('0x15')],_0x1f30e1);_0x4153d4(_0xf5edff['error'](0x1f4,_0x1b18fa['message']));});});}; \ No newline at end of file +var _0xaeda=['defaults','redis','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowWhatsappQueue','find','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xaeda,0x6b));var _0xaaed=function(_0xc012e8,_0x2bf3f3){_0xc012e8=_0xc012e8-0x0;var _0x57119b=_0xaeda[_0xc012e8];return _0x57119b;};'use strict';var _=require(_0xaaed('0x0'));var util=require(_0xaaed('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaaed('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaaed('0x3'));var logger=require(_0xaaed('0x4'))(_0xaaed('0x5'));var config=require(_0xaaed('0x6'));var jayson=require(_0xaaed('0x7'));var client=jayson[_0xaaed('0x8')][_0xaaed('0x9')]({'port':0x232a});config['redis']=_[_0xaaed('0xa')](config[_0xaaed('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaaed('0xb')]));require(_0xaaed('0xc'))[_0xaaed('0xd')](socket);function respondWithRpcPromise(_0x365fbf,_0x554172,_0x4e2e0b){return new BPromise(function(_0x48f9e3,_0x53014c){return client[_0xaaed('0xe')](_0x365fbf,_0x4e2e0b)[_0xaaed('0xf')](function(_0x1d448a){logger[_0xaaed('0x10')](_0xaaed('0x11'),_0x554172,_0xaaed('0x12'));logger[_0xaaed('0x13')](_0xaaed('0x14'),_0x554172,'request\x20sent',JSON[_0xaaed('0x15')](_0x1d448a));if(_0x1d448a[_0xaaed('0x16')]){if(_0x1d448a['error'][_0xaaed('0x17')]===0x1f4){logger[_0xaaed('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x554172,_0x1d448a[_0xaaed('0x16')][_0xaaed('0x18')]);return _0x53014c(_0x1d448a[_0xaaed('0x16')]['message']);}logger[_0xaaed('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x554172,_0x1d448a[_0xaaed('0x16')]['message']);return _0x48f9e3(_0x1d448a[_0xaaed('0x16')][_0xaaed('0x18')]);}else{logger[_0xaaed('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0x554172,_0xaaed('0x12'));_0x48f9e3(_0x1d448a['result'][_0xaaed('0x18')]);}})[_0xaaed('0x19')](function(_0x41e374){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x554172,_0x41e374);_0x53014c(_0x41e374);});});}exports[_0xaaed('0x1a')]=function(_0x5f2f4b){var _0x201cb4=this;return new Promise(function(_0x5b9f7b,_0xf77f78){return db[_0xaaed('0x1b')][_0xaaed('0x1c')]({'raw':_0x5f2f4b[_0xaaed('0x1d')]?_0x5f2f4b[_0xaaed('0x1d')][_0xaaed('0x1e')]===undefined?!![]:![]:!![],'where':_0x5f2f4b[_0xaaed('0x1d')]?_0x5f2f4b[_0xaaed('0x1d')][_0xaaed('0x1f')]||null:null,'attributes':_0x5f2f4b[_0xaaed('0x1d')]?_0x5f2f4b[_0xaaed('0x1d')][_0xaaed('0x20')]||null:null,'limit':_0x5f2f4b[_0xaaed('0x1d')]?_0x5f2f4b['options'][_0xaaed('0x21')]||null:null,'include':_0x5f2f4b['options']?_0x5f2f4b[_0xaaed('0x1d')][_0xaaed('0x22')]?_[_0xaaed('0x23')](_0x5f2f4b['options'][_0xaaed('0x22')],function(_0x3e888d){return{'model':db[_0x3e888d['model']],'as':_0x3e888d['as'],'attributes':_0x3e888d['attributes'],'include':_0x3e888d[_0xaaed('0x22')]?_['map'](_0x3e888d[_0xaaed('0x22')],function(_0x4f560a){return{'model':db[_0x4f560a[_0xaaed('0x24')]],'as':_0x4f560a['as'],'attributes':_0x4f560a[_0xaaed('0x20')],'include':_0x4f560a[_0xaaed('0x22')]?_[_0xaaed('0x23')](_0x4f560a[_0xaaed('0x22')],function(_0x18594d){return{'model':db[_0x18594d['model']],'as':_0x18594d['as'],'attributes':_0x18594d['attributes']};}):[]};}):[]};}):[]:[]})[_0xaaed('0xf')](function(_0x164af6){logger[_0xaaed('0x10')](_0xaaed('0x1a'),_0x5f2f4b);logger['debug'](_0xaaed('0x1a'),_0x5f2f4b,JSON[_0xaaed('0x15')](_0x164af6));_0x5b9f7b(_0x164af6);})[_0xaaed('0x19')](function(_0x35159d){logger[_0xaaed('0x16')](_0xaaed('0x1a'),_0x35159d[_0xaaed('0x18')],_0x5f2f4b);_0xf77f78(_0x201cb4[_0xaaed('0x16')](0x1f4,_0x35159d[_0xaaed('0x18')]));});});};exports[_0xaaed('0x25')]=function(_0x234f81){var _0x3d23c9=this;return new Promise(function(_0x54d8b1,_0xa8276a){return db[_0xaaed('0x1b')][_0xaaed('0x26')]({'raw':_0x234f81[_0xaaed('0x1d')]?_0x234f81[_0xaaed('0x1d')][_0xaaed('0x1e')]===undefined?!![]:![]:!![],'where':_0x234f81[_0xaaed('0x1d')]?_0x234f81['options']['where']||null:null,'attributes':_0x234f81[_0xaaed('0x1d')]?_0x234f81[_0xaaed('0x1d')][_0xaaed('0x20')]||null:null,'include':_0x234f81[_0xaaed('0x1d')]?_0x234f81[_0xaaed('0x1d')][_0xaaed('0x22')]?_['map'](_0x234f81[_0xaaed('0x1d')][_0xaaed('0x22')],function(_0x3508f2){return{'model':db[_0x3508f2[_0xaaed('0x24')]],'as':_0x3508f2['as'],'attributes':_0x3508f2['attributes'],'include':_0x3508f2[_0xaaed('0x22')]?_[_0xaaed('0x23')](_0x3508f2[_0xaaed('0x22')],function(_0x1e8d2f){return{'model':db[_0x1e8d2f[_0xaaed('0x24')]],'as':_0x1e8d2f['as'],'attributes':_0x1e8d2f[_0xaaed('0x20')],'include':_0x1e8d2f[_0xaaed('0x22')]?_[_0xaaed('0x23')](_0x1e8d2f[_0xaaed('0x22')],function(_0x106472){return{'model':db[_0x106472['model']],'as':_0x106472['as'],'attributes':_0x106472[_0xaaed('0x20')]};}):[]};}):[]};}):[]:[]})[_0xaaed('0xf')](function(_0x355d6b){logger[_0xaaed('0x10')](_0xaaed('0x25'),_0x234f81);logger[_0xaaed('0x13')](_0xaaed('0x25'),_0x234f81,JSON[_0xaaed('0x15')](_0x355d6b));_0x54d8b1(_0x355d6b);})[_0xaaed('0x19')](function(_0x259c79){logger[_0xaaed('0x16')](_0xaaed('0x25'),_0x259c79[_0xaaed('0x18')],_0x234f81);_0xa8276a(_0x3d23c9[_0xaaed('0x16')](0x1f4,_0x259c79[_0xaaed('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index e4f8dea..7e4726e 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 _0xa934=['whatsappQueue:','./whatsappQueue.events','save','update','emit','removeListener','length'];(function(_0xf6f75,_0x2a3266){var _0x26c067=function(_0x590255){while(--_0x590255){_0xf6f75['push'](_0xf6f75['shift']());}};_0x26c067(++_0x2a3266);}(_0xa934,0x1a5));var _0x4a93=function(_0x183a00,_0xabe178){_0x183a00=_0x183a00-0x0;var _0x377a8b=_0xa934[_0x183a00];return _0x377a8b;};'use strict';var WhatsappQueueEvents=require(_0x4a93('0x0'));var events=[_0x4a93('0x1'),'remove',_0x4a93('0x2')];function createListener(_0x1fd8e4,_0x50376a){return function(_0x52ad8a){_0x50376a[_0x4a93('0x3')](_0x1fd8e4,_0x52ad8a);};}function removeListener(_0x3b68d2,_0x5a9f60){return function(){WhatsappQueueEvents[_0x4a93('0x4')](_0x3b68d2,_0x5a9f60);};}exports['register']=function(_0x485d72){for(var _0x4db729=0x0,_0x1f9bbb=events[_0x4a93('0x5')];_0x4db729<_0x1f9bbb;_0x4db729++){var _0x1c0c6c=events[_0x4db729];var _0x102f34=createListener(_0x4a93('0x6')+_0x1c0c6c,_0x485d72);WhatsappQueueEvents['on'](_0x1c0c6c,_0x102f34);}}; \ No newline at end of file +var _0xbb6d=['save','remove','emit','removeListener','length','./whatsappQueue.events'];(function(_0x44bbda,_0x29e7a4){var _0x80b727=function(_0x394d8a){while(--_0x394d8a){_0x44bbda['push'](_0x44bbda['shift']());}};_0x80b727(++_0x29e7a4);}(_0xbb6d,0xf5));var _0xdbb6=function(_0x52f914,_0x3af39e){_0x52f914=_0x52f914-0x0;var _0x257b98=_0xbb6d[_0x52f914];return _0x257b98;};'use strict';var WhatsappQueueEvents=require(_0xdbb6('0x0'));var events=[_0xdbb6('0x1'),_0xdbb6('0x2'),'update'];function createListener(_0x3c924b,_0x30d8ad){return function(_0x1f7e23){_0x30d8ad[_0xdbb6('0x3')](_0x3c924b,_0x1f7e23);};}function removeListener(_0x3b1186,_0x5c3a98){return function(){WhatsappQueueEvents[_0xdbb6('0x4')](_0x3b1186,_0x5c3a98);};}exports['register']=function(_0x3008d6){for(var _0x1dc5a3=0x0,_0x3af8cb=events[_0xdbb6('0x5')];_0x1dc5a3<_0x3af8cb;_0x1dc5a3++){var _0x562e44=events[_0x1dc5a3];var _0x548916=createListener('whatsappQueue:'+_0x562e44,_0x3008d6);WhatsappQueueEvents['on'](_0x562e44,_0x548916);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index c04821a..da04d3f 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 _0xc8f2=['put','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','describe','/:id','show','isAuthenticated'];(function(_0x24546a,_0x34c221){var _0x445307=function(_0x4ca519){while(--_0x4ca519){_0x24546a['push'](_0x24546a['shift']());}};_0x445307(++_0x34c221);}(_0xc8f2,0x137));var _0x2c8f=function(_0xf622cf,_0x469543){_0xf622cf=_0xf622cf-0x0;var _0x8bccbe=_0xc8f2[_0xf622cf];return _0x8bccbe;};'use strict';var multer=require(_0x2c8f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2c8f('0x1'));var express=require('express');var router=express[_0x2c8f('0x2')]();var fs_extra=require(_0x2c8f('0x3'));var auth=require(_0x2c8f('0x4'));var interaction=require(_0x2c8f('0x5'));var config=require(_0x2c8f('0x6'));var controller=require(_0x2c8f('0x7'));router[_0x2c8f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x2c8f('0x9')]);router[_0x2c8f('0x8')](_0x2c8f('0xa'),auth['isAuthenticated'](),controller[_0x2c8f('0xb')]);router['post']('/',auth[_0x2c8f('0xc')](),controller['create']);router[_0x2c8f('0xd')](_0x2c8f('0xa'),auth[_0x2c8f('0xc')](),controller[_0x2c8f('0xe')]);router[_0x2c8f('0xf')](_0x2c8f('0xa'),auth['isAuthenticated'](),controller[_0x2c8f('0x10')]);module[_0x2c8f('0x11')]=router; \ No newline at end of file +var _0xee6e=['destroy','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','create','update','/:id'];(function(_0x14374c,_0x2a36a3){var _0x2293d3=function(_0x1298c9){while(--_0x1298c9){_0x14374c['push'](_0x14374c['shift']());}};_0x2293d3(++_0x2a36a3);}(_0xee6e,0xb5));var _0xeee6=function(_0x1a929f,_0x7d9dd3){_0x1a929f=_0x1a929f-0x0;var _0x161ec5=_0xee6e[_0x1a929f];return _0x161ec5;};'use strict';var multer=require('multer');var util=require(_0xeee6('0x0'));var path=require(_0xeee6('0x1'));var timeout=require(_0xeee6('0x2'));var express=require('express');var router=express[_0xeee6('0x3')]();var fs_extra=require(_0xeee6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xeee6('0x5'));var config=require(_0xeee6('0x6'));var controller=require('./whatsappQueueReport.controller');router[_0xeee6('0x7')]('/',auth[_0xeee6('0x8')](),controller['index']);router['get'](_0xeee6('0x9'),auth['isAuthenticated'](),controller[_0xeee6('0xa')]);router['get']('/:id',auth[_0xeee6('0x8')](),controller['show']);router['post']('/',auth[_0xeee6('0x8')](),controller[_0xeee6('0xb')]);router['put']('/:id',auth[_0xeee6('0x8')](),controller[_0xeee6('0xc')]);router['delete'](_0xeee6('0xd'),auth[_0xeee6('0x8')](),controller[_0xeee6('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index d112b04..0f71520 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x214625,_0x32b8a9){var _0xec13ba=function(_0x82ea94){while(--_0x82ea94){_0x214625['push'](_0x214625['shift']());}};_0xec13ba(++_0x32b8a9);}(_0x7a54,0x106));var _0x47a5=function(_0x17171e,_0x41522b){_0x17171e=_0x17171e-0x0;var _0x4d45a8=_0x7a54[_0x17171e];return _0x4d45a8;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x1bf9ef,_0x2720d6){var _0x317d46=function(_0x404300){while(--_0x404300){_0x1bf9ef['push'](_0x1bf9ef['shift']());}};_0x317d46(++_0x2720d6);}(_0x7a54,0x106));var _0x47a5=function(_0xa74f07,_0x50a60a){_0xa74f07=_0xa74f07-0x0;var _0xbc3c37=_0x7a54[_0xa74f07];return _0xbc3c37;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 183e791..c5da947 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 _0xa478=['filters','intersection','fields','attributes','length','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','model','query','keys'];(function(_0x597f06,_0x336260){var _0x5e21be=function(_0x563296){while(--_0x563296){_0x597f06['push'](_0x597f06['shift']());}};_0x5e21be(++_0x336260);}(_0xa478,0x136));var _0x8a47=function(_0x3d78d7,_0x44acea){_0x3d78d7=_0x3d78d7-0x0;var _0x4b6784=_0xa478[_0x3d78d7];return _0x4b6784;};'use strict';var emlformat=require(_0x8a47('0x0'));var rimraf=require(_0x8a47('0x1'));var zipdir=require(_0x8a47('0x2'));var jsonpatch=require(_0x8a47('0x3'));var rp=require(_0x8a47('0x4'));var moment=require(_0x8a47('0x5'));var BPromise=require(_0x8a47('0x6'));var Mustache=require(_0x8a47('0x7'));var util=require(_0x8a47('0x8'));var path=require(_0x8a47('0x9'));var sox=require(_0x8a47('0xa'));var csv=require(_0x8a47('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a47('0xc'));var _=require(_0x8a47('0xd'));var squel=require(_0x8a47('0xe'));var crypto=require(_0x8a47('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8a47('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8a47('0x11'));var Papa=require(_0x8a47('0x12'));var Redis=require(_0x8a47('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8a47('0x14'));var as=require(_0x8a47('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a47('0x16'))('api');var utils=require(_0x8a47('0x17'));var config=require(_0x8a47('0x18'));var licenseUtil=require(_0x8a47('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e3166,_0x59efc7){_0x59efc7=_0x59efc7||0xcc;return function(_0x36941a){if(_0x36941a){return _0x5e3166[_0x8a47('0x1a')](_0x59efc7);}return _0x5e3166['status'](_0x59efc7)[_0x8a47('0x1b')]();};}function respondWithResult(_0x28bbc5,_0x1a9a6f){_0x1a9a6f=_0x1a9a6f||0xc8;return function(_0x55985c){if(_0x55985c){return _0x28bbc5[_0x8a47('0x1c')](_0x1a9a6f)[_0x8a47('0x1d')](_0x55985c);}};}function respondWithFilteredResult(_0x2f682e,_0x1c8488){return function(_0x41bdaf){if(_0x41bdaf){var _0x18f2be=typeof _0x1c8488[_0x8a47('0x1e')]===_0x8a47('0x1f')&&typeof _0x1c8488[_0x8a47('0x20')]==='undefined';var _0x20fbf7=_0x41bdaf[_0x8a47('0x21')];var _0x3f9093=_0x18f2be?0x0:_0x1c8488['offset'];var _0x341089=_0x18f2be?_0x41bdaf['count']:_0x1c8488['offset']+_0x1c8488[_0x8a47('0x20')];var _0x2174b1;if(_0x341089>=_0x20fbf7){_0x341089=_0x20fbf7;_0x2174b1=0xc8;}else{_0x2174b1=0xce;}_0x2f682e[_0x8a47('0x1c')](_0x2174b1);return _0x2f682e[_0x8a47('0x22')](_0x8a47('0x23'),_0x3f9093+'-'+_0x341089+'/'+_0x20fbf7)[_0x8a47('0x1d')](_0x41bdaf);}return null;};}function patchUpdates(_0x44e119){return function(_0x1bbed6){try{jsonpatch[_0x8a47('0x24')](_0x1bbed6,_0x44e119,!![]);}catch(_0xc2065a){return BPromise['reject'](_0xc2065a);}return _0x1bbed6[_0x8a47('0x25')]();};}function saveUpdates(_0x5923ec,_0x289f28){return function(_0x3d7993){if(_0x3d7993){return _0x3d7993[_0x8a47('0x26')](_0x5923ec)[_0x8a47('0x27')](function(_0x5d4b6c){return _0x5d4b6c;});}return null;};}function removeEntity(_0x116b5e,_0x5ae186){return function(_0x50f6ba){if(_0x50f6ba){return _0x50f6ba['destroy']()['then'](function(){_0x116b5e[_0x8a47('0x1c')](0xcc)[_0x8a47('0x1b')]();});}};}function handleEntityNotFound(_0x5bed3e,_0x2bb0d4){return function(_0xb4590d){if(!_0xb4590d){_0x5bed3e[_0x8a47('0x1a')](0x194);}return _0xb4590d;};}function handleError(_0xfb9ae0,_0x44cf20){_0x44cf20=_0x44cf20||0x1f4;return function(_0xd06be6){logger[_0x8a47('0x28')](_0xd06be6['stack']);if(_0xd06be6[_0x8a47('0x29')]){delete _0xd06be6['name'];}_0xfb9ae0[_0x8a47('0x1c')](_0x44cf20)[_0x8a47('0x2a')](_0xd06be6);};}exports['index']=function(_0x1e89b1,_0x526571){var _0x4d5d32={},_0x12470a={},_0x9b51b8={'count':0x0,'rows':[]};var _0x1ddbcf=_[_0x8a47('0x2b')](db[_0x8a47('0x2c')][_0x8a47('0x2d')],function(_0x58aa06){return{'name':_0x58aa06[_0x8a47('0x2e')],'type':_0x58aa06['type']['key']};});_0x12470a[_0x8a47('0x2f')]=_[_0x8a47('0x2b')](_0x1ddbcf,_0x8a47('0x29'));_0x12470a[_0x8a47('0x30')]=_[_0x8a47('0x31')](_0x1e89b1[_0x8a47('0x30')]);_0x12470a[_0x8a47('0x32')]=_[_0x8a47('0x33')](_0x12470a[_0x8a47('0x2f')],_0x12470a[_0x8a47('0x30')]);_0x4d5d32['attributes']=_[_0x8a47('0x33')](_0x12470a[_0x8a47('0x2f')],qs[_0x8a47('0x34')](_0x1e89b1['query'][_0x8a47('0x34')]));_0x4d5d32[_0x8a47('0x35')]=_0x4d5d32['attributes'][_0x8a47('0x36')]?_0x4d5d32[_0x8a47('0x35')]:_0x12470a[_0x8a47('0x2f')];if(!_0x1e89b1[_0x8a47('0x30')]['hasOwnProperty']('nolimit')){_0x4d5d32[_0x8a47('0x20')]=qs[_0x8a47('0x20')](_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x20')]);_0x4d5d32[_0x8a47('0x1e')]=qs[_0x8a47('0x1e')](_0x1e89b1[_0x8a47('0x30')]['offset']);}_0x4d5d32['order']=qs[_0x8a47('0x37')](_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x37')]);_0x4d5d32[_0x8a47('0x38')]=qs[_0x8a47('0x32')](_[_0x8a47('0x39')](_0x1e89b1[_0x8a47('0x30')],_0x12470a[_0x8a47('0x32')]),_0x1ddbcf);if(_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x3a')]){_0x4d5d32[_0x8a47('0x38')]=_['merge'](_0x4d5d32[_0x8a47('0x38')],{'$or':_['map'](_0x1ddbcf,function(_0x541832){if(_0x541832['type']!=='VIRTUAL'){var _0x57d38e={};_0x57d38e[_0x541832[_0x8a47('0x29')]]={'$like':'%'+_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x3a')]+'%'};return _0x57d38e;}})});}_0x4d5d32=_[_0x8a47('0x3b')]({},_0x4d5d32,_0x1e89b1[_0x8a47('0x3c')]);var _0x20ba1c={'where':_0x4d5d32[_0x8a47('0x38')]};return db[_0x8a47('0x2c')]['count'](_0x20ba1c)['then'](function(_0x442870){_0x9b51b8[_0x8a47('0x21')]=_0x442870;if(_0x1e89b1[_0x8a47('0x30')][_0x8a47('0x3d')]){_0x4d5d32['include']=[{'all':!![]}];}return db[_0x8a47('0x2c')][_0x8a47('0x3e')](_0x4d5d32);})[_0x8a47('0x27')](function(_0x369dd5){_0x9b51b8[_0x8a47('0x3f')]=_0x369dd5;return _0x9b51b8;})['then'](respondWithFilteredResult(_0x526571,_0x4d5d32))[_0x8a47('0x40')](handleError(_0x526571,null));};exports[_0x8a47('0x41')]=function(_0x3010af,_0x5d23ed){var _0x2b3874={'raw':!![],'where':{'id':_0x3010af[_0x8a47('0x42')]['id']}},_0x2c70ea={};_0x2c70ea[_0x8a47('0x2f')]=_['keys'](db[_0x8a47('0x2c')][_0x8a47('0x2d')]);_0x2c70ea[_0x8a47('0x30')]=_[_0x8a47('0x31')](_0x3010af[_0x8a47('0x30')]);_0x2c70ea[_0x8a47('0x32')]=_['intersection'](_0x2c70ea['model'],_0x2c70ea[_0x8a47('0x30')]);_0x2b3874[_0x8a47('0x35')]=_[_0x8a47('0x33')](_0x2c70ea['model'],qs[_0x8a47('0x34')](_0x3010af[_0x8a47('0x30')]['fields']));_0x2b3874['attributes']=_0x2b3874[_0x8a47('0x35')]['length']?_0x2b3874[_0x8a47('0x35')]:_0x2c70ea[_0x8a47('0x2f')];if(_0x3010af[_0x8a47('0x30')][_0x8a47('0x3d')]){_0x2b3874[_0x8a47('0x43')]=[{'all':!![]}];}_0x2b3874=_[_0x8a47('0x3b')]({},_0x2b3874,_0x3010af['options']);return db['WhatsappQueueReport'][_0x8a47('0x44')](_0x2b3874)[_0x8a47('0x27')](handleEntityNotFound(_0x5d23ed,null))[_0x8a47('0x27')](respondWithResult(_0x5d23ed,null))[_0x8a47('0x40')](handleError(_0x5d23ed,null));};exports[_0x8a47('0x45')]=function(_0x55dd7c,_0x4898d0){return db[_0x8a47('0x2c')]['create'](_0x55dd7c[_0x8a47('0x46')],{})[_0x8a47('0x27')](respondWithResult(_0x4898d0,0xc9))['catch'](handleError(_0x4898d0,null));};exports[_0x8a47('0x26')]=function(_0x237ed1,_0x14e22c){if(_0x237ed1[_0x8a47('0x46')]['id']){delete _0x237ed1[_0x8a47('0x46')]['id'];}return db[_0x8a47('0x2c')][_0x8a47('0x44')]({'where':{'id':_0x237ed1[_0x8a47('0x42')]['id']}})['then'](handleEntityNotFound(_0x14e22c,null))[_0x8a47('0x27')](saveUpdates(_0x237ed1[_0x8a47('0x46')],null))[_0x8a47('0x27')](respondWithResult(_0x14e22c,null))[_0x8a47('0x40')](handleError(_0x14e22c,null));};exports['destroy']=function(_0x11db4e,_0xa428dd){return db[_0x8a47('0x2c')][_0x8a47('0x44')]({'where':{'id':_0x11db4e[_0x8a47('0x42')]['id']}})[_0x8a47('0x27')](handleEntityNotFound(_0xa428dd,null))['then'](removeEntity(_0xa428dd,null))['catch'](handleError(_0xa428dd,null));};exports[_0x8a47('0x47')]=function(_0x5db5d3,_0x1da8b7){return db[_0x8a47('0x2c')]['describe']()[_0x8a47('0x27')](respondWithResult(_0x1da8b7,null))['catch'](handleError(_0x1da8b7,null));}; \ No newline at end of file +var _0x3266=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','set','Content-Range','save','update','then','destroy','end','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','type','key','model'];(function(_0x4c0b02,_0x52efc9){var _0x6d9c9c=function(_0x1afdc1){while(--_0x1afdc1){_0x4c0b02['push'](_0x4c0b02['shift']());}};_0x6d9c9c(++_0x52efc9);}(_0x3266,0x6a));var _0x6326=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x3266[_0x9c2427];return _0x51984f;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];function respondWithStatusCode(_0x379358,_0x5c07e1){_0x5c07e1=_0x5c07e1||0xcc;return function(_0x5381d0){if(_0x5381d0){return _0x379358[_0x6326('0x1c')](_0x5c07e1);}return _0x379358[_0x6326('0x1d')](_0x5c07e1)['end']();};}function respondWithResult(_0x425878,_0x4caef3){_0x4caef3=_0x4caef3||0xc8;return function(_0x2d2d9b){if(_0x2d2d9b){return _0x425878[_0x6326('0x1d')](_0x4caef3)[_0x6326('0x1e')](_0x2d2d9b);}};}function respondWithFilteredResult(_0x41c352,_0x1ed3a3){return function(_0x2c1879){if(_0x2c1879){var _0x55923a=typeof _0x1ed3a3[_0x6326('0x1f')]==='undefined'&&typeof _0x1ed3a3['limit']==='undefined';var _0x51e7b9=_0x2c1879['count'];var _0x58e960=_0x55923a?0x0:_0x1ed3a3[_0x6326('0x1f')];var _0x1f4c11=_0x55923a?_0x2c1879[_0x6326('0x20')]:_0x1ed3a3['offset']+_0x1ed3a3['limit'];var _0x954ed5;if(_0x1f4c11>=_0x51e7b9){_0x1f4c11=_0x51e7b9;_0x954ed5=0xc8;}else{_0x954ed5=0xce;}_0x41c352[_0x6326('0x1d')](_0x954ed5);return _0x41c352[_0x6326('0x21')](_0x6326('0x22'),_0x58e960+'-'+_0x1f4c11+'/'+_0x51e7b9)[_0x6326('0x1e')](_0x2c1879);}return null;};}function patchUpdates(_0x25957a){return function(_0x21ee7d){try{jsonpatch['apply'](_0x21ee7d,_0x25957a,!![]);}catch(_0x22307f){return BPromise['reject'](_0x22307f);}return _0x21ee7d[_0x6326('0x23')]();};}function saveUpdates(_0x3c6cfa,_0x2482ef){return function(_0x24fb78){if(_0x24fb78){return _0x24fb78[_0x6326('0x24')](_0x3c6cfa)[_0x6326('0x25')](function(_0x225555){return _0x225555;});}return null;};}function removeEntity(_0x429bb0,_0x4781cc){return function(_0x2d0d00){if(_0x2d0d00){return _0x2d0d00[_0x6326('0x26')]()['then'](function(){_0x429bb0[_0x6326('0x1d')](0xcc)[_0x6326('0x27')]();});}};}function handleEntityNotFound(_0x575701,_0x4e272b){return function(_0x4d28fd){if(!_0x4d28fd){_0x575701[_0x6326('0x1c')](0x194);}return _0x4d28fd;};}function handleError(_0x4dae28,_0x33c466){_0x33c466=_0x33c466||0x1f4;return function(_0x1a48da){logger['error'](_0x1a48da[_0x6326('0x28')]);if(_0x1a48da[_0x6326('0x29')]){delete _0x1a48da[_0x6326('0x29')];}_0x4dae28[_0x6326('0x1d')](_0x33c466)[_0x6326('0x2a')](_0x1a48da);};}exports[_0x6326('0x2b')]=function(_0x40e036,_0x27802c){var _0x461e0f={},_0x127744={},_0x4980f6={'count':0x0,'rows':[]};var _0x2a8873=_[_0x6326('0x2c')](db[_0x6326('0x2d')][_0x6326('0x2e')],function(_0x20c5ab){return{'name':_0x20c5ab['fieldName'],'type':_0x20c5ab[_0x6326('0x2f')][_0x6326('0x30')]};});_0x127744[_0x6326('0x31')]=_['map'](_0x2a8873,_0x6326('0x29'));_0x127744['query']=_['keys'](_0x40e036[_0x6326('0x32')]);_0x127744[_0x6326('0x33')]=_[_0x6326('0x34')](_0x127744[_0x6326('0x31')],_0x127744[_0x6326('0x32')]);_0x461e0f[_0x6326('0x35')]=_[_0x6326('0x34')](_0x127744[_0x6326('0x31')],qs[_0x6326('0x36')](_0x40e036[_0x6326('0x32')][_0x6326('0x36')]));_0x461e0f[_0x6326('0x35')]=_0x461e0f['attributes'][_0x6326('0x37')]?_0x461e0f[_0x6326('0x35')]:_0x127744['model'];if(!_0x40e036[_0x6326('0x32')][_0x6326('0x38')](_0x6326('0x39'))){_0x461e0f['limit']=qs[_0x6326('0x3a')](_0x40e036['query']['limit']);_0x461e0f[_0x6326('0x1f')]=qs[_0x6326('0x1f')](_0x40e036[_0x6326('0x32')]['offset']);}_0x461e0f[_0x6326('0x3b')]=qs['sort'](_0x40e036[_0x6326('0x32')]['sort']);_0x461e0f[_0x6326('0x3c')]=qs[_0x6326('0x33')](_[_0x6326('0x3d')](_0x40e036[_0x6326('0x32')],_0x127744[_0x6326('0x33')]),_0x2a8873);if(_0x40e036[_0x6326('0x32')]['filter']){_0x461e0f[_0x6326('0x3c')]=_[_0x6326('0x3e')](_0x461e0f['where'],{'$or':_[_0x6326('0x2c')](_0x2a8873,function(_0x5ae140){if(_0x5ae140['type']!==_0x6326('0x3f')){var _0x1f8dcf={};_0x1f8dcf[_0x5ae140[_0x6326('0x29')]]={'$like':'%'+_0x40e036[_0x6326('0x32')][_0x6326('0x40')]+'%'};return _0x1f8dcf;}})});}_0x461e0f=_[_0x6326('0x3e')]({},_0x461e0f,_0x40e036['options']);var _0x485bed={'where':_0x461e0f[_0x6326('0x3c')]};return db['WhatsappQueueReport'][_0x6326('0x20')](_0x485bed)['then'](function(_0x282f33){_0x4980f6[_0x6326('0x20')]=_0x282f33;if(_0x40e036[_0x6326('0x32')][_0x6326('0x41')]){_0x461e0f[_0x6326('0x42')]=[{'all':!![]}];}return db[_0x6326('0x2d')][_0x6326('0x43')](_0x461e0f);})[_0x6326('0x25')](function(_0x3b089b){_0x4980f6[_0x6326('0x44')]=_0x3b089b;return _0x4980f6;})[_0x6326('0x25')](respondWithFilteredResult(_0x27802c,_0x461e0f))['catch'](handleError(_0x27802c,null));};exports[_0x6326('0x45')]=function(_0x5ce03a,_0x29f2fd){var _0x1d9d4c={'raw':!![],'where':{'id':_0x5ce03a[_0x6326('0x46')]['id']}},_0x16fc33={};_0x16fc33['model']=_[_0x6326('0x47')](db[_0x6326('0x2d')]['rawAttributes']);_0x16fc33[_0x6326('0x32')]=_[_0x6326('0x47')](_0x5ce03a[_0x6326('0x32')]);_0x16fc33[_0x6326('0x33')]=_['intersection'](_0x16fc33[_0x6326('0x31')],_0x16fc33[_0x6326('0x32')]);_0x1d9d4c[_0x6326('0x35')]=_[_0x6326('0x34')](_0x16fc33[_0x6326('0x31')],qs[_0x6326('0x36')](_0x5ce03a[_0x6326('0x32')]['fields']));_0x1d9d4c[_0x6326('0x35')]=_0x1d9d4c[_0x6326('0x35')][_0x6326('0x37')]?_0x1d9d4c[_0x6326('0x35')]:_0x16fc33['model'];if(_0x5ce03a[_0x6326('0x32')]['includeAll']){_0x1d9d4c[_0x6326('0x42')]=[{'all':!![]}];}_0x1d9d4c=_[_0x6326('0x3e')]({},_0x1d9d4c,_0x5ce03a[_0x6326('0x48')]);return db[_0x6326('0x2d')][_0x6326('0x49')](_0x1d9d4c)['then'](handleEntityNotFound(_0x29f2fd,null))[_0x6326('0x25')](respondWithResult(_0x29f2fd,null))['catch'](handleError(_0x29f2fd,null));};exports['create']=function(_0x2bca12,_0x44cf9d){return db['WhatsappQueueReport'][_0x6326('0x4a')](_0x2bca12[_0x6326('0x4b')],{})[_0x6326('0x25')](respondWithResult(_0x44cf9d,0xc9))[_0x6326('0x4c')](handleError(_0x44cf9d,null));};exports[_0x6326('0x24')]=function(_0x4f8dc0,_0x4af0ee){if(_0x4f8dc0[_0x6326('0x4b')]['id']){delete _0x4f8dc0[_0x6326('0x4b')]['id'];}return db[_0x6326('0x2d')][_0x6326('0x49')]({'where':{'id':_0x4f8dc0[_0x6326('0x46')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x4af0ee,null))[_0x6326('0x25')](saveUpdates(_0x4f8dc0['body'],null))[_0x6326('0x25')](respondWithResult(_0x4af0ee,null))[_0x6326('0x4c')](handleError(_0x4af0ee,null));};exports[_0x6326('0x26')]=function(_0x3e7674,_0x1b5e9a){return db['WhatsappQueueReport'][_0x6326('0x49')]({'where':{'id':_0x3e7674['params']['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x1b5e9a,null))[_0x6326('0x25')](removeEntity(_0x1b5e9a,null))['catch'](handleError(_0x1b5e9a,null));};exports[_0x6326('0x4d')]=function(_0x5040b1,_0xaa4c9d){return db[_0x6326('0x2d')][_0x6326('0x4d')]()[_0x6326('0x25')](respondWithResult(_0xaa4c9d,null))['catch'](handleError(_0xaa4c9d,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 8b35998..0f4e37d 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 _0x097c=['request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x118139,_0x7ce965){var _0x2fece9=function(_0xd145a4){while(--_0xd145a4){_0x118139['push'](_0x118139['shift']());}};_0x2fece9(++_0x7ce965);}(_0x097c,0x6b));var _0xc097=function(_0x1edc3f,_0x57b3a1){_0x1edc3f=_0x1edc3f-0x0;var _0x370892=_0x097c[_0x1edc3f];return _0x370892;};'use strict';var _=require(_0xc097('0x0'));var util=require(_0xc097('0x1'));var logger=require(_0xc097('0x2'))(_0xc097('0x3'));var moment=require('moment');var BPromise=require(_0xc097('0x4'));var rp=require(_0xc097('0x5'));var fs=require('fs');var path=require(_0xc097('0x6'));var rimraf=require(_0xc097('0x7'));var config=require(_0xc097('0x8'));var attributes=require(_0xc097('0x9'));module['exports']=function(_0x232d25,_0x516f76){return _0x232d25[_0xc097('0xa')](_0xc097('0xb'),attributes,{'tableName':_0xc097('0xc'),'paranoid':![],'indexes':[{'name':_0xc097('0xd'),'fields':[_0xc097('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e8e=['request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','report_whatsapp_queue','lodash','../../config/logger','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9e8e,0x7f));var _0xe9e8=function(_0x1948d7,_0x1410d6){_0x1948d7=_0x1948d7-0x0;var _0x5f5f02=_0x9e8e[_0x1948d7];return _0x5f5f02;};'use strict';var _=require(_0xe9e8('0x0'));var util=require('util');var logger=require(_0xe9e8('0x1'))(_0xe9e8('0x2'));var moment=require(_0xe9e8('0x3'));var BPromise=require(_0xe9e8('0x4'));var rp=require(_0xe9e8('0x5'));var fs=require('fs');var path=require(_0xe9e8('0x6'));var rimraf=require(_0xe9e8('0x7'));var config=require(_0xe9e8('0x8'));var attributes=require(_0xe9e8('0x9'));module[_0xe9e8('0xa')]=function(_0x1e0e57,_0x3b7f9f){return _0x1e0e57['define']('WhatsappQueueReport',attributes,{'tableName':_0xe9e8('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index f3da3f7..bccb645 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 _0x2067=['bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','moment'];(function(_0x7afacc,_0x59a0b4){var _0x2c5b61=function(_0x4f8b27){while(--_0x4f8b27){_0x7afacc['push'](_0x7afacc['shift']());}};_0x2c5b61(++_0x59a0b4);}(_0x2067,0x1cb));var _0x7206=function(_0xf08243,_0x4945b7){_0xf08243=_0xf08243-0x0;var _0x43ffe5=_0x2067[_0xf08243];return _0x43ffe5;};'use strict';var _=require(_0x7206('0x0'));var util=require(_0x7206('0x1'));var moment=require(_0x7206('0x2'));var BPromise=require(_0x7206('0x3'));var rs=require(_0x7206('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7206('0x5'))(_0x7206('0x6'));var config=require(_0x7206('0x7'));var jayson=require(_0x7206('0x8'));var client=jayson[_0x7206('0x9')][_0x7206('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e07fd,_0x58e94c,_0x39df54){return new BPromise(function(_0x49d575,_0x3b7fd2){return client[_0x7206('0xb')](_0x4e07fd,_0x39df54)[_0x7206('0xc')](function(_0x2c93ac){logger[_0x7206('0xd')](_0x7206('0xe'),_0x58e94c,'request\x20sent');logger[_0x7206('0xf')](_0x7206('0x10'),_0x58e94c,_0x7206('0x11'),JSON[_0x7206('0x12')](_0x2c93ac));if(_0x2c93ac[_0x7206('0x13')]){if(_0x2c93ac[_0x7206('0x13')]['code']===0x1f4){logger[_0x7206('0x13')](_0x7206('0xe'),_0x58e94c,_0x2c93ac[_0x7206('0x13')][_0x7206('0x14')]);return _0x3b7fd2(_0x2c93ac[_0x7206('0x13')][_0x7206('0x14')]);}logger[_0x7206('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x58e94c,_0x2c93ac[_0x7206('0x13')][_0x7206('0x14')]);return _0x49d575(_0x2c93ac[_0x7206('0x13')][_0x7206('0x14')]);}else{logger[_0x7206('0xd')](_0x7206('0xe'),_0x58e94c,'request\x20sent');_0x49d575(_0x2c93ac[_0x7206('0x15')][_0x7206('0x14')]);}})[_0x7206('0x16')](function(_0x47cd72){logger['error'](_0x7206('0xe'),_0x58e94c,_0x47cd72);_0x3b7fd2(_0x47cd72);});});}exports[_0x7206('0x17')]=function(_0x5d093f){var _0x2be504=this;return new Promise(function(_0x59679c,_0x5db73a){return db[_0x7206('0x18')]['create'](_0x5d093f[_0x7206('0x19')],{'raw':_0x5d093f[_0x7206('0x1a')]?_0x5d093f['options'][_0x7206('0x1b')]===undefined?!![]:![]:!![]})[_0x7206('0xc')](function(_0x2a9764){logger[_0x7206('0xd')](_0x7206('0x17'),_0x5d093f);logger[_0x7206('0xf')]('CreateWhatsappQueueReport',_0x5d093f,JSON[_0x7206('0x12')](_0x2a9764));_0x59679c(_0x2a9764);})['catch'](function(_0x2efe0a){logger[_0x7206('0x13')](_0x7206('0x17'),_0x2efe0a[_0x7206('0x14')],_0x5d093f);_0x5db73a(_0x2be504['error'](0x1f4,_0x2efe0a[_0x7206('0x14')]));});});};exports[_0x7206('0x1c')]=function(_0x32de0f){var _0x4753f7=this;return new Promise(function(_0x685e33,_0x3bfa8c){return db['WhatsappQueueReport'][_0x7206('0x1d')](_0x32de0f[_0x7206('0x19')],{'raw':_0x32de0f['options']?_0x32de0f[_0x7206('0x1a')][_0x7206('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32de0f['options']?_0x32de0f['options'][_0x7206('0x1e')]||null:null,'attributes':_0x32de0f[_0x7206('0x1a')]?_0x32de0f[_0x7206('0x1a')][_0x7206('0x1f')]||null:null,'limit':_0x32de0f['options']?_0x32de0f[_0x7206('0x1a')][_0x7206('0x20')]||null:null})[_0x7206('0xc')](function(_0x33d7a9){logger[_0x7206('0xd')](_0x7206('0x1c'),_0x32de0f);logger[_0x7206('0xf')](_0x7206('0x1c'),_0x32de0f,JSON['stringify'](_0x33d7a9));_0x685e33(_0x33d7a9);})['catch'](function(_0x436c31){logger['error']('UpdateWhatsappQueueReport',_0x436c31[_0x7206('0x14')],_0x32de0f);_0x3bfa8c(_0x4753f7['error'](0x1f4,_0x436c31[_0x7206('0x14')]));});});}; \ No newline at end of file +var _0x0626=['WhatsappQueueReport','body','options','raw','CreateWhatsappQueueReport','update','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','WhatsappQueueReport,\x20%s,\x20%s','result','catch'];(function(_0x39d9ec,_0x4ed6e5){var _0x499ff0=function(_0x565eaf){while(--_0x565eaf){_0x39d9ec['push'](_0x39d9ec['shift']());}};_0x499ff0(++_0x4ed6e5);}(_0x0626,0x1bc));var _0x6062=function(_0x46e671,_0x459ff0){_0x46e671=_0x46e671-0x0;var _0x3471d1=_0x0626[_0x46e671];return _0x3471d1;};'use strict';var _=require(_0x6062('0x0'));var util=require(_0x6062('0x1'));var moment=require('moment');var BPromise=require(_0x6062('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6062('0x3'));var db=require(_0x6062('0x4'))['db'];var utils=require(_0x6062('0x5'));var logger=require('../../config/logger')(_0x6062('0x6'));var config=require(_0x6062('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6062('0x8')][_0x6062('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36810a,_0xb6db80,_0x20a3d3){return new BPromise(function(_0x2e8dc1,_0x50b081){return client['request'](_0x36810a,_0x20a3d3)[_0x6062('0xa')](function(_0xe7d878){logger[_0x6062('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0xb6db80,_0x6062('0xc'));logger[_0x6062('0xd')](_0x6062('0xe'),_0xb6db80,'request\x20sent',JSON[_0x6062('0xf')](_0xe7d878));if(_0xe7d878[_0x6062('0x10')]){if(_0xe7d878[_0x6062('0x10')]['code']===0x1f4){logger[_0x6062('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0xb6db80,_0xe7d878[_0x6062('0x10')][_0x6062('0x11')]);return _0x50b081(_0xe7d878[_0x6062('0x10')][_0x6062('0x11')]);}logger['error'](_0x6062('0x12'),_0xb6db80,_0xe7d878[_0x6062('0x10')]['message']);return _0x2e8dc1(_0xe7d878[_0x6062('0x10')]['message']);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0xb6db80,'request\x20sent');_0x2e8dc1(_0xe7d878[_0x6062('0x13')][_0x6062('0x11')]);}})[_0x6062('0x14')](function(_0x5f42ce){logger[_0x6062('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0xb6db80,_0x5f42ce);_0x50b081(_0x5f42ce);});});}exports['CreateWhatsappQueueReport']=function(_0x350514){var _0x455973=this;return new Promise(function(_0x39dafb,_0x13341a){return db[_0x6062('0x15')]['create'](_0x350514[_0x6062('0x16')],{'raw':_0x350514['options']?_0x350514[_0x6062('0x17')][_0x6062('0x18')]===undefined?!![]:![]:!![]})[_0x6062('0xa')](function(_0x449267){logger[_0x6062('0xb')](_0x6062('0x19'),_0x350514);logger[_0x6062('0xd')](_0x6062('0x19'),_0x350514,JSON[_0x6062('0xf')](_0x449267));_0x39dafb(_0x449267);})[_0x6062('0x14')](function(_0x548364){logger[_0x6062('0x10')](_0x6062('0x19'),_0x548364['message'],_0x350514);_0x13341a(_0x455973['error'](0x1f4,_0x548364['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x51c1fb){var _0x78aa99=this;return new Promise(function(_0x55854d,_0x58ad3d){return db[_0x6062('0x15')][_0x6062('0x1a')](_0x51c1fb[_0x6062('0x16')],{'raw':_0x51c1fb[_0x6062('0x17')]?_0x51c1fb[_0x6062('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51c1fb['options']?_0x51c1fb['options'][_0x6062('0x1b')]||null:null,'attributes':_0x51c1fb[_0x6062('0x17')]?_0x51c1fb[_0x6062('0x17')][_0x6062('0x1c')]||null:null,'limit':_0x51c1fb[_0x6062('0x17')]?_0x51c1fb[_0x6062('0x17')][_0x6062('0x1d')]||null:null})['then'](function(_0x419113){logger[_0x6062('0xb')]('UpdateWhatsappQueueReport',_0x51c1fb);logger[_0x6062('0xd')](_0x6062('0x1e'),_0x51c1fb,JSON[_0x6062('0xf')](_0x419113));_0x55854d(_0x419113);})[_0x6062('0x14')](function(_0x28c4c7){logger[_0x6062('0x10')]('UpdateWhatsappQueueReport',_0x28c4c7[_0x6062('0x11')],_0x51c1fb);_0x58ad3d(_0x78aa99[_0x6062('0x10')](0x1f4,_0x28c4c7[_0x6062('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index dc1ec11..a1ee8d2 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 _0xbd11=['/:id','show','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','index','/describe','isAuthenticated','describe'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xbd11,0x1a9));var _0x1bd1=function(_0x166241,_0x227ee2){_0x166241=_0x166241-0x0;var _0x51fd00=_0xbd11[_0x166241];return _0x51fd00;};'use strict';var multer=require('multer');var util=require(_0x1bd1('0x0'));var path=require(_0x1bd1('0x1'));var timeout=require(_0x1bd1('0x2'));var express=require(_0x1bd1('0x3'));var router=express[_0x1bd1('0x4')]();var fs_extra=require(_0x1bd1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1bd1('0x6'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0x1bd1('0x7')]('/',auth['isAuthenticated'](),controller[_0x1bd1('0x8')]);router['get'](_0x1bd1('0x9'),auth[_0x1bd1('0xa')](),controller[_0x1bd1('0xb')]);router[_0x1bd1('0x7')](_0x1bd1('0xc'),auth[_0x1bd1('0xa')](),controller[_0x1bd1('0xd')]);router['post']('/',auth[_0x1bd1('0xa')](),controller['create']);router[_0x1bd1('0xe')]('/:id',auth[_0x1bd1('0xa')](),controller[_0x1bd1('0xf')]);router[_0x1bd1('0x10')](_0x1bd1('0xc'),auth[_0x1bd1('0xa')](),controller[_0x1bd1('0x11')]);module[_0x1bd1('0x12')]=router; \ No newline at end of file +var _0xd32e=['/:id','post','create','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x1ffca3,_0x5d16d8){var _0x1d1522=function(_0x5b5219){while(--_0x5b5219){_0x1ffca3['push'](_0x1ffca3['shift']());}};_0x1d1522(++_0x5d16d8);}(_0xd32e,0x195));var _0xed32=function(_0x44b7fd,_0x1531e5){_0x44b7fd=_0x44b7fd-0x0;var _0x35dabd=_0xd32e[_0x44b7fd];return _0x35dabd;};'use strict';var multer=require(_0xed32('0x0'));var util=require(_0xed32('0x1'));var path=require(_0xed32('0x2'));var timeout=require(_0xed32('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xed32('0x4'));var auth=require(_0xed32('0x5'));var interaction=require(_0xed32('0x6'));var config=require(_0xed32('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0xed32('0x8')]('/',auth[_0xed32('0x9')](),controller[_0xed32('0xa')]);router[_0xed32('0x8')]('/describe',auth[_0xed32('0x9')](),controller['describe']);router[_0xed32('0x8')](_0xed32('0xb'),auth[_0xed32('0x9')](),controller['show']);router[_0xed32('0xc')]('/',auth[_0xed32('0x9')](),controller[_0xed32('0xd')]);router['put'](_0xed32('0xb'),auth[_0xed32('0x9')](),controller['update']);router[_0xed32('0xe')]('/:id',auth[_0xed32('0x9')](),controller['destroy']);module[_0xed32('0xf')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 599aa41..d10e15e 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 _0x4af8=['DATE','account','agent','queue'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0x4af8,0x1ad));var _0x84af=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x4af8[_0x24237f];return _0x48298e;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x84af('0x0'),_0x84af('0x1'),_0x84af('0x2')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x84af('0x3')]}}; \ No newline at end of file +var _0xe0dd=['ENUM','account','agent','queue','DATE','sequelize','exports'];(function(_0x230600,_0x5c1b0c){var _0x1d1848=function(_0x54642d){while(--_0x54642d){_0x230600['push'](_0x230600['shift']());}};_0x1d1848(++_0x5c1b0c);}(_0xe0dd,0x163));var _0xde0d=function(_0x3522c8,_0x1e7c82){_0x3522c8=_0x3522c8-0x0;var _0x22f498=_0xe0dd[_0x3522c8];return _0x22f498;};'use strict';var Sequelize=require(_0xde0d('0x0'));module[_0xde0d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xde0d('0x2')](_0xde0d('0x3'),_0xde0d('0x4'),_0xde0d('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xde0d('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index edf6b8b..2a58f15 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 _0xe413=['filters','pick','merge','VIRTUAL','filter','options','findAll','catch','show','params','length','includeAll','include','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','update','then','destroy','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x3d9e15,_0x44705e){var _0x5e3e70=function(_0x4a0e79){while(--_0x4a0e79){_0x3d9e15['push'](_0x3d9e15['shift']());}};_0x5e3e70(++_0x44705e);}(_0xe413,0xa3));var _0x3e41=function(_0x518d0a,_0x3a1f1d){_0x518d0a=_0x518d0a-0x0;var _0x561d39=_0xe413[_0x518d0a];return _0x561d39;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e41('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e41('0x1'));var rp=require(_0x3e41('0x2'));var moment=require(_0x3e41('0x3'));var BPromise=require(_0x3e41('0x4'));var Mustache=require(_0x3e41('0x5'));var util=require(_0x3e41('0x6'));var path=require(_0x3e41('0x7'));var sox=require('sox');var csv=require(_0x3e41('0x8'));var ejs=require(_0x3e41('0x9'));var fs=require('fs');var fs_extra=require(_0x3e41('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3e41('0xb'));var jsforce=require(_0x3e41('0xc'));var deskjs=require(_0x3e41('0xd'));var toCsv=require(_0x3e41('0x8'));var querystring=require('querystring');var Papa=require(_0x3e41('0xe'));var Redis=require(_0x3e41('0xf'));var authService=require(_0x3e41('0x10'));var qs=require(_0x3e41('0x11'));var as=require(_0x3e41('0x12'));var hardwareService=require(_0x3e41('0x13'));var logger=require('../../config/logger')(_0x3e41('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3e41('0x15'));var db=require(_0x3e41('0x16'))['db'];function respondWithStatusCode(_0x44930e,_0x2154bb){_0x2154bb=_0x2154bb||0xcc;return function(_0x27fc37){if(_0x27fc37){return _0x44930e[_0x3e41('0x17')](_0x2154bb);}return _0x44930e[_0x3e41('0x18')](_0x2154bb)[_0x3e41('0x19')]();};}function respondWithResult(_0x1e5192,_0x2ff939){_0x2ff939=_0x2ff939||0xc8;return function(_0x47dc7f){if(_0x47dc7f){return _0x1e5192[_0x3e41('0x18')](_0x2ff939)['json'](_0x47dc7f);}};}function respondWithFilteredResult(_0x1c35b5,_0x3bac59){return function(_0x2696ac){if(_0x2696ac){var _0x1d628a=typeof _0x3bac59[_0x3e41('0x1a')]===_0x3e41('0x1b')&&typeof _0x3bac59['limit']===_0x3e41('0x1b');var _0x19b49c=_0x2696ac[_0x3e41('0x1c')];var _0x4cf6c1=_0x1d628a?0x0:_0x3bac59['offset'];var _0x5369e6=_0x1d628a?_0x2696ac[_0x3e41('0x1c')]:_0x3bac59['offset']+_0x3bac59['limit'];var _0x163043;if(_0x5369e6>=_0x19b49c){_0x5369e6=_0x19b49c;_0x163043=0xc8;}else{_0x163043=0xce;}_0x1c35b5['status'](_0x163043);return _0x1c35b5['set'](_0x3e41('0x1d'),_0x4cf6c1+'-'+_0x5369e6+'/'+_0x19b49c)[_0x3e41('0x1e')](_0x2696ac);}return null;};}function patchUpdates(_0x44b1ad){return function(_0x5c6d03){try{jsonpatch['apply'](_0x5c6d03,_0x44b1ad,!![]);}catch(_0x49071f){return BPromise['reject'](_0x49071f);}return _0x5c6d03['save']();};}function saveUpdates(_0x8d3d90,_0xdededb){return function(_0x35e895){if(_0x35e895){return _0x35e895[_0x3e41('0x1f')](_0x8d3d90)[_0x3e41('0x20')](function(_0x4fc260){return _0x4fc260;});}return null;};}function removeEntity(_0x2c85f9,_0x1ddda5){return function(_0x2a0199){if(_0x2a0199){return _0x2a0199[_0x3e41('0x21')]()[_0x3e41('0x20')](function(){_0x2c85f9[_0x3e41('0x18')](0xcc)[_0x3e41('0x19')]();});}};}function handleEntityNotFound(_0x32b78a,_0x147bc6){return function(_0x2ac22e){if(!_0x2ac22e){_0x32b78a['sendStatus'](0x194);}return _0x2ac22e;};}function handleError(_0x4dbebb,_0x29abcb){_0x29abcb=_0x29abcb||0x1f4;return function(_0x5ab930){logger['error'](_0x5ab930[_0x3e41('0x22')]);if(_0x5ab930[_0x3e41('0x23')]){delete _0x5ab930['name'];}_0x4dbebb[_0x3e41('0x18')](_0x29abcb)[_0x3e41('0x24')](_0x5ab930);};}exports[_0x3e41('0x25')]=function(_0x57934a,_0x298262){var _0x3f07f5={},_0x312c9b={},_0x304706={'count':0x0,'rows':[]};var _0x45f5fa=_[_0x3e41('0x26')](db[_0x3e41('0x27')][_0x3e41('0x28')],function(_0x531b9c){return{'name':_0x531b9c[_0x3e41('0x29')],'type':_0x531b9c[_0x3e41('0x2a')][_0x3e41('0x2b')]};});_0x312c9b['model']=_[_0x3e41('0x26')](_0x45f5fa,_0x3e41('0x23'));_0x312c9b[_0x3e41('0x2c')]=_[_0x3e41('0x2d')](_0x57934a[_0x3e41('0x2c')]);_0x312c9b['filters']=_[_0x3e41('0x2e')](_0x312c9b[_0x3e41('0x2f')],_0x312c9b['query']);_0x3f07f5[_0x3e41('0x30')]=_['intersection'](_0x312c9b[_0x3e41('0x2f')],qs[_0x3e41('0x31')](_0x57934a['query'][_0x3e41('0x31')]));_0x3f07f5[_0x3e41('0x30')]=_0x3f07f5[_0x3e41('0x30')]['length']?_0x3f07f5[_0x3e41('0x30')]:_0x312c9b[_0x3e41('0x2f')];if(!_0x57934a[_0x3e41('0x2c')][_0x3e41('0x32')](_0x3e41('0x33'))){_0x3f07f5[_0x3e41('0x34')]=qs[_0x3e41('0x34')](_0x57934a[_0x3e41('0x2c')][_0x3e41('0x34')]);_0x3f07f5['offset']=qs[_0x3e41('0x1a')](_0x57934a[_0x3e41('0x2c')][_0x3e41('0x1a')]);}_0x3f07f5[_0x3e41('0x35')]=qs[_0x3e41('0x36')](_0x57934a[_0x3e41('0x2c')][_0x3e41('0x36')]);_0x3f07f5[_0x3e41('0x37')]=qs[_0x3e41('0x38')](_[_0x3e41('0x39')](_0x57934a[_0x3e41('0x2c')],_0x312c9b[_0x3e41('0x38')]),_0x45f5fa);if(_0x57934a[_0x3e41('0x2c')]['filter']){_0x3f07f5[_0x3e41('0x37')]=_[_0x3e41('0x3a')](_0x3f07f5['where'],{'$or':_[_0x3e41('0x26')](_0x45f5fa,function(_0x2d94d0){if(_0x2d94d0[_0x3e41('0x2a')]!==_0x3e41('0x3b')){var _0x42d9c6={};_0x42d9c6[_0x2d94d0[_0x3e41('0x23')]]={'$like':'%'+_0x57934a['query'][_0x3e41('0x3c')]+'%'};return _0x42d9c6;}})});}_0x3f07f5=_[_0x3e41('0x3a')]({},_0x3f07f5,_0x57934a[_0x3e41('0x3d')]);var _0x194b80={'where':_0x3f07f5['where']};return db[_0x3e41('0x27')][_0x3e41('0x1c')](_0x194b80)[_0x3e41('0x20')](function(_0x5494fe){_0x304706['count']=_0x5494fe;if(_0x57934a[_0x3e41('0x2c')]['includeAll']){_0x3f07f5['include']=[{'all':!![]}];}return db[_0x3e41('0x27')][_0x3e41('0x3e')](_0x3f07f5);})['then'](function(_0x1f6319){_0x304706['rows']=_0x1f6319;return _0x304706;})['then'](respondWithFilteredResult(_0x298262,_0x3f07f5))[_0x3e41('0x3f')](handleError(_0x298262,null));};exports[_0x3e41('0x40')]=function(_0x492494,_0x332993){var _0x37732b={'raw':!![],'where':{'id':_0x492494[_0x3e41('0x41')]['id']}},_0x335b81={};_0x335b81[_0x3e41('0x2f')]=_['keys'](db[_0x3e41('0x27')][_0x3e41('0x28')]);_0x335b81['query']=_[_0x3e41('0x2d')](_0x492494[_0x3e41('0x2c')]);_0x335b81[_0x3e41('0x38')]=_[_0x3e41('0x2e')](_0x335b81[_0x3e41('0x2f')],_0x335b81[_0x3e41('0x2c')]);_0x37732b['attributes']=_[_0x3e41('0x2e')](_0x335b81[_0x3e41('0x2f')],qs[_0x3e41('0x31')](_0x492494['query'][_0x3e41('0x31')]));_0x37732b[_0x3e41('0x30')]=_0x37732b[_0x3e41('0x30')][_0x3e41('0x42')]?_0x37732b[_0x3e41('0x30')]:_0x335b81['model'];if(_0x492494[_0x3e41('0x2c')][_0x3e41('0x43')]){_0x37732b[_0x3e41('0x44')]=[{'all':!![]}];}_0x37732b=_['merge']({},_0x37732b,_0x492494[_0x3e41('0x3d')]);return db['WhatsappTransferReport'][_0x3e41('0x45')](_0x37732b)[_0x3e41('0x20')](handleEntityNotFound(_0x332993,null))[_0x3e41('0x20')](respondWithResult(_0x332993,null))[_0x3e41('0x3f')](handleError(_0x332993,null));};exports[_0x3e41('0x46')]=function(_0x574483,_0x1af53f){return db[_0x3e41('0x27')]['create'](_0x574483[_0x3e41('0x47')],{})[_0x3e41('0x20')](respondWithResult(_0x1af53f,0xc9))[_0x3e41('0x3f')](handleError(_0x1af53f,null));};exports[_0x3e41('0x1f')]=function(_0x2b7f2b,_0x5ab8d6){if(_0x2b7f2b[_0x3e41('0x47')]['id']){delete _0x2b7f2b[_0x3e41('0x47')]['id'];}return db[_0x3e41('0x27')][_0x3e41('0x45')]({'where':{'id':_0x2b7f2b[_0x3e41('0x41')]['id']}})[_0x3e41('0x20')](handleEntityNotFound(_0x5ab8d6,null))[_0x3e41('0x20')](saveUpdates(_0x2b7f2b['body'],null))[_0x3e41('0x20')](respondWithResult(_0x5ab8d6,null))['catch'](handleError(_0x5ab8d6,null));};exports[_0x3e41('0x21')]=function(_0x5c0a26,_0x380773){return db[_0x3e41('0x27')][_0x3e41('0x45')]({'where':{'id':_0x5c0a26[_0x3e41('0x41')]['id']}})[_0x3e41('0x20')](handleEntityNotFound(_0x380773,null))[_0x3e41('0x20')](removeEntity(_0x380773,null))['catch'](handleError(_0x380773,null));};exports[_0x3e41('0x48')]=function(_0x50e7c4,_0xff3bc3){return db[_0x3e41('0x27')][_0x3e41('0x48')]()[_0x3e41('0x20')](respondWithResult(_0xff3bc3,null))[_0x3e41('0x3f')](handleError(_0xff3bc3,null));}; \ No newline at end of file +var _0x45d5=['catch','params','describe','rimraf','zip-dir','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/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','WhatsappTransferReport','show','filters','includeAll','include','find','create','body'];(function(_0x217c01,_0x6b0908){var _0x2dab32=function(_0x4c4bcd){while(--_0x4c4bcd){_0x217c01['push'](_0x217c01['shift']());}};_0x2dab32(++_0x6b0908);}(_0x45d5,0x1d1));var _0x545d=function(_0x43a4ea,_0x1c155e){_0x43a4ea=_0x43a4ea-0x0;var _0x1f17e3=_0x45d5[_0x43a4ea];return _0x1f17e3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x545d('0x0'));var zipdir=require(_0x545d('0x1'));var jsonpatch=require(_0x545d('0x2'));var rp=require(_0x545d('0x3'));var moment=require(_0x545d('0x4'));var BPromise=require(_0x545d('0x5'));var Mustache=require(_0x545d('0x6'));var util=require('util');var path=require(_0x545d('0x7'));var sox=require(_0x545d('0x8'));var csv=require(_0x545d('0x9'));var ejs=require(_0x545d('0xa'));var fs=require('fs');var fs_extra=require(_0x545d('0xb'));var _=require(_0x545d('0xc'));var squel=require(_0x545d('0xd'));var crypto=require(_0x545d('0xe'));var jsforce=require(_0x545d('0xf'));var deskjs=require(_0x545d('0x10'));var toCsv=require(_0x545d('0x9'));var querystring=require(_0x545d('0x11'));var Papa=require(_0x545d('0x12'));var Redis=require(_0x545d('0x13'));var authService=require(_0x545d('0x14'));var qs=require(_0x545d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x545d('0x16'));var logger=require(_0x545d('0x17'))(_0x545d('0x18'));var utils=require(_0x545d('0x19'));var config=require(_0x545d('0x1a'));var licenseUtil=require(_0x545d('0x1b'));var db=require(_0x545d('0x1c'))['db'];function respondWithStatusCode(_0x179ab8,_0x3b8137){_0x3b8137=_0x3b8137||0xcc;return function(_0x2765c8){if(_0x2765c8){return _0x179ab8['sendStatus'](_0x3b8137);}return _0x179ab8[_0x545d('0x1d')](_0x3b8137)[_0x545d('0x1e')]();};}function respondWithResult(_0x2bede8,_0x37fb91){_0x37fb91=_0x37fb91||0xc8;return function(_0x4df46f){if(_0x4df46f){return _0x2bede8[_0x545d('0x1d')](_0x37fb91)[_0x545d('0x1f')](_0x4df46f);}};}function respondWithFilteredResult(_0x161e59,_0x14acdc){return function(_0x17d8a9){if(_0x17d8a9){var _0x4d45df=typeof _0x14acdc[_0x545d('0x20')]===_0x545d('0x21')&&typeof _0x14acdc[_0x545d('0x22')]===_0x545d('0x21');var _0xeda6cc=_0x17d8a9['count'];var _0x9c7853=_0x4d45df?0x0:_0x14acdc[_0x545d('0x20')];var _0x3fdca6=_0x4d45df?_0x17d8a9[_0x545d('0x23')]:_0x14acdc[_0x545d('0x20')]+_0x14acdc['limit'];var _0x31815a;if(_0x3fdca6>=_0xeda6cc){_0x3fdca6=_0xeda6cc;_0x31815a=0xc8;}else{_0x31815a=0xce;}_0x161e59['status'](_0x31815a);return _0x161e59[_0x545d('0x24')](_0x545d('0x25'),_0x9c7853+'-'+_0x3fdca6+'/'+_0xeda6cc)[_0x545d('0x1f')](_0x17d8a9);}return null;};}function patchUpdates(_0xb71f3b){return function(_0x40b27a){try{jsonpatch[_0x545d('0x26')](_0x40b27a,_0xb71f3b,!![]);}catch(_0x5729e2){return BPromise[_0x545d('0x27')](_0x5729e2);}return _0x40b27a[_0x545d('0x28')]();};}function saveUpdates(_0x2933af,_0x30acf2){return function(_0x3b8cff){if(_0x3b8cff){return _0x3b8cff[_0x545d('0x29')](_0x2933af)[_0x545d('0x2a')](function(_0x5ac93e){return _0x5ac93e;});}return null;};}function removeEntity(_0x3c3c0e,_0x26392f){return function(_0x2f4512){if(_0x2f4512){return _0x2f4512[_0x545d('0x2b')]()[_0x545d('0x2a')](function(){_0x3c3c0e[_0x545d('0x1d')](0xcc)[_0x545d('0x1e')]();});}};}function handleEntityNotFound(_0x1fb6e7,_0x5eb538){return function(_0x217f4a){if(!_0x217f4a){_0x1fb6e7[_0x545d('0x2c')](0x194);}return _0x217f4a;};}function handleError(_0xee5c27,_0x593cc7){_0x593cc7=_0x593cc7||0x1f4;return function(_0x171b41){logger['error'](_0x171b41[_0x545d('0x2d')]);if(_0x171b41[_0x545d('0x2e')]){delete _0x171b41[_0x545d('0x2e')];}_0xee5c27[_0x545d('0x1d')](_0x593cc7)['send'](_0x171b41);};}exports['index']=function(_0xf96603,_0xbc2bd1){var _0x2ec396={},_0x4629c3={},_0x29dbc4={'count':0x0,'rows':[]};var _0x47b530=_['map'](db['WhatsappTransferReport'][_0x545d('0x2f')],function(_0x5700e9){return{'name':_0x5700e9[_0x545d('0x30')],'type':_0x5700e9[_0x545d('0x31')][_0x545d('0x32')]};});_0x4629c3['model']=_[_0x545d('0x33')](_0x47b530,_0x545d('0x2e'));_0x4629c3[_0x545d('0x34')]=_['keys'](_0xf96603[_0x545d('0x34')]);_0x4629c3['filters']=_[_0x545d('0x35')](_0x4629c3[_0x545d('0x36')],_0x4629c3[_0x545d('0x34')]);_0x2ec396[_0x545d('0x37')]=_['intersection'](_0x4629c3[_0x545d('0x36')],qs[_0x545d('0x38')](_0xf96603[_0x545d('0x34')]['fields']));_0x2ec396[_0x545d('0x37')]=_0x2ec396[_0x545d('0x37')][_0x545d('0x39')]?_0x2ec396[_0x545d('0x37')]:_0x4629c3['model'];if(!_0xf96603[_0x545d('0x34')]['hasOwnProperty'](_0x545d('0x3a'))){_0x2ec396[_0x545d('0x22')]=qs['limit'](_0xf96603[_0x545d('0x34')][_0x545d('0x22')]);_0x2ec396[_0x545d('0x20')]=qs['offset'](_0xf96603['query'][_0x545d('0x20')]);}_0x2ec396[_0x545d('0x3b')]=qs[_0x545d('0x3c')](_0xf96603[_0x545d('0x34')][_0x545d('0x3c')]);_0x2ec396[_0x545d('0x3d')]=qs['filters'](_['pick'](_0xf96603[_0x545d('0x34')],_0x4629c3['filters']),_0x47b530);if(_0xf96603[_0x545d('0x34')][_0x545d('0x3e')]){_0x2ec396['where']=_['merge'](_0x2ec396[_0x545d('0x3d')],{'$or':_['map'](_0x47b530,function(_0x15cbd0){if(_0x15cbd0['type']!==_0x545d('0x3f')){var _0x2acb40={};_0x2acb40[_0x15cbd0[_0x545d('0x2e')]]={'$like':'%'+_0xf96603[_0x545d('0x34')][_0x545d('0x3e')]+'%'};return _0x2acb40;}})});}_0x2ec396=_[_0x545d('0x40')]({},_0x2ec396,_0xf96603[_0x545d('0x41')]);var _0x56ce6a={'where':_0x2ec396[_0x545d('0x3d')]};return db[_0x545d('0x42')][_0x545d('0x23')](_0x56ce6a)['then'](function(_0x23e6aa){_0x29dbc4[_0x545d('0x23')]=_0x23e6aa;if(_0xf96603[_0x545d('0x34')]['includeAll']){_0x2ec396['include']=[{'all':!![]}];}return db[_0x545d('0x42')]['findAll'](_0x2ec396);})[_0x545d('0x2a')](function(_0x49a977){_0x29dbc4['rows']=_0x49a977;return _0x29dbc4;})['then'](respondWithFilteredResult(_0xbc2bd1,_0x2ec396))['catch'](handleError(_0xbc2bd1,null));};exports[_0x545d('0x43')]=function(_0x26c995,_0x109dbd){var _0x73c6b={'raw':!![],'where':{'id':_0x26c995['params']['id']}},_0x1a5534={};_0x1a5534['model']=_['keys'](db[_0x545d('0x42')]['rawAttributes']);_0x1a5534['query']=_['keys'](_0x26c995[_0x545d('0x34')]);_0x1a5534[_0x545d('0x44')]=_['intersection'](_0x1a5534['model'],_0x1a5534[_0x545d('0x34')]);_0x73c6b[_0x545d('0x37')]=_[_0x545d('0x35')](_0x1a5534[_0x545d('0x36')],qs[_0x545d('0x38')](_0x26c995['query'][_0x545d('0x38')]));_0x73c6b[_0x545d('0x37')]=_0x73c6b['attributes'][_0x545d('0x39')]?_0x73c6b[_0x545d('0x37')]:_0x1a5534[_0x545d('0x36')];if(_0x26c995[_0x545d('0x34')][_0x545d('0x45')]){_0x73c6b[_0x545d('0x46')]=[{'all':!![]}];}_0x73c6b=_[_0x545d('0x40')]({},_0x73c6b,_0x26c995[_0x545d('0x41')]);return db[_0x545d('0x42')][_0x545d('0x47')](_0x73c6b)['then'](handleEntityNotFound(_0x109dbd,null))[_0x545d('0x2a')](respondWithResult(_0x109dbd,null))['catch'](handleError(_0x109dbd,null));};exports[_0x545d('0x48')]=function(_0x4b5507,_0x55f506){return db['WhatsappTransferReport'][_0x545d('0x48')](_0x4b5507[_0x545d('0x49')],{})[_0x545d('0x2a')](respondWithResult(_0x55f506,0xc9))[_0x545d('0x4a')](handleError(_0x55f506,null));};exports['update']=function(_0x3830f4,_0x105d58){if(_0x3830f4[_0x545d('0x49')]['id']){delete _0x3830f4[_0x545d('0x49')]['id'];}return db['WhatsappTransferReport'][_0x545d('0x47')]({'where':{'id':_0x3830f4[_0x545d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x105d58,null))[_0x545d('0x2a')](saveUpdates(_0x3830f4[_0x545d('0x49')],null))['then'](respondWithResult(_0x105d58,null))[_0x545d('0x4a')](handleError(_0x105d58,null));};exports[_0x545d('0x2b')]=function(_0x24b3ba,_0x54a773){return db[_0x545d('0x42')]['find']({'where':{'id':_0x24b3ba[_0x545d('0x4b')]['id']}})[_0x545d('0x2a')](handleEntityNotFound(_0x54a773,null))[_0x545d('0x2a')](removeEntity(_0x54a773,null))[_0x545d('0x4a')](handleError(_0x54a773,null));};exports[_0x545d('0x4c')]=function(_0xa0df84,_0x417076){return db['WhatsappTransferReport'][_0x545d('0x4c')]()['then'](respondWithResult(_0x417076,null))[_0x545d('0x4a')](handleError(_0x417076,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 07809e6..fe7f3bf 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 _0xd7dd=['exports','define','WhatsappTransferReport','uniqueid','lodash','util','api','moment','bluebird','rimraf','./whatsappTransferReport.attributes'];(function(_0x290178,_0x2359d5){var _0x4d6f5c=function(_0x58e40f){while(--_0x58e40f){_0x290178['push'](_0x290178['shift']());}};_0x4d6f5c(++_0x2359d5);}(_0xd7dd,0xa9));var _0xdd7d=function(_0x38c412,_0x556af1){_0x38c412=_0x38c412-0x0;var _0xace629=_0xd7dd[_0x38c412];return _0xace629;};'use strict';var _=require(_0xdd7d('0x0'));var util=require(_0xdd7d('0x1'));var logger=require('../../config/logger')(_0xdd7d('0x2'));var moment=require(_0xdd7d('0x3'));var BPromise=require(_0xdd7d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdd7d('0x5'));var config=require('../../config/environment');var attributes=require(_0xdd7d('0x6'));module[_0xdd7d('0x7')]=function(_0x1e5377,_0x4b0bc5){return _0x1e5377[_0xdd7d('0x8')](_0xdd7d('0x9'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xdd7d('0xa'),'fields':[_0xdd7d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6ad1=['path','rimraf','../../config/environment','exports','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5a23b4,_0x320479){var _0x4123ad=function(_0x434780){while(--_0x434780){_0x5a23b4['push'](_0x5a23b4['shift']());}};_0x4123ad(++_0x320479);}(_0x6ad1,0xd6));var _0x16ad=function(_0x216eb0,_0xec9873){_0x216eb0=_0x216eb0-0x0;var _0x1d45d7=_0x6ad1[_0x216eb0];return _0x1d45d7;};'use strict';var _=require(_0x16ad('0x0'));var util=require(_0x16ad('0x1'));var logger=require(_0x16ad('0x2'))(_0x16ad('0x3'));var moment=require(_0x16ad('0x4'));var BPromise=require(_0x16ad('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x16ad('0x6'));var rimraf=require(_0x16ad('0x7'));var config=require(_0x16ad('0x8'));var attributes=require('./whatsappTransferReport.attributes');module[_0x16ad('0x9')]=function(_0x4ef8c5,_0x2a9263){return _0x4ef8c5['define']('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x16ad('0xa'),'fields':[_0x16ad('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 3170488..45415b4 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 _0x7379=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4c09bb,_0x32f3ab){var _0x15d5a6=function(_0x5899ee){while(--_0x5899ee){_0x4c09bb['push'](_0x4c09bb['shift']());}};_0x15d5a6(++_0x32f3ab);}(_0x7379,0x8f));var _0x9737=function(_0x474381,_0x16588c){_0x474381=_0x474381-0x0;var _0x3e942b=_0x7379[_0x474381];return _0x3e942b;};'use strict';var _=require(_0x9737('0x0'));var util=require(_0x9737('0x1'));var moment=require(_0x9737('0x2'));var BPromise=require(_0x9737('0x3'));var rs=require(_0x9737('0x4'));var fs=require('fs');var Redis=require(_0x9737('0x5'));var db=require(_0x9737('0x6'))['db'];var utils=require(_0x9737('0x7'));var logger=require(_0x9737('0x8'))('rpc');var config=require(_0x9737('0x9'));var jayson=require(_0x9737('0xa'));var client=jayson[_0x9737('0xb')][_0x9737('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa5316c,_0x276081,_0x362335){return new BPromise(function(_0x23e98c,_0x86bc20){return client[_0x9737('0xd')](_0xa5316c,_0x362335)[_0x9737('0xe')](function(_0x47f5d6){logger[_0x9737('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x276081,_0x9737('0x10'));logger[_0x9737('0x11')](_0x9737('0x12'),_0x276081,_0x9737('0x10'),JSON[_0x9737('0x13')](_0x47f5d6));if(_0x47f5d6[_0x9737('0x14')]){if(_0x47f5d6['error'][_0x9737('0x15')]===0x1f4){logger['error'](_0x9737('0x16'),_0x276081,_0x47f5d6['error'][_0x9737('0x17')]);return _0x86bc20(_0x47f5d6['error'][_0x9737('0x17')]);}logger[_0x9737('0x14')](_0x9737('0x16'),_0x276081,_0x47f5d6['error'][_0x9737('0x17')]);return _0x23e98c(_0x47f5d6[_0x9737('0x14')][_0x9737('0x17')]);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x276081,_0x9737('0x10'));_0x23e98c(_0x47f5d6[_0x9737('0x18')]['message']);}})['catch'](function(_0x188770){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x276081,_0x188770);_0x86bc20(_0x188770);});});} \ No newline at end of file +var _0xad14=['code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xad14,0x123));var _0x4ad1=function(_0x1db831,_0x42b7b5){_0x1db831=_0x1db831-0x0;var _0x39ba56=_0xad14[_0x1db831];return _0x39ba56;};'use strict';var _=require(_0x4ad1('0x0'));var util=require(_0x4ad1('0x1'));var moment=require(_0x4ad1('0x2'));var BPromise=require('bluebird');var rs=require(_0x4ad1('0x3'));var fs=require('fs');var Redis=require(_0x4ad1('0x4'));var db=require(_0x4ad1('0x5'))['db'];var utils=require(_0x4ad1('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4ad1('0x7'));var jayson=require(_0x4ad1('0x8'));var client=jayson[_0x4ad1('0x9')][_0x4ad1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b4ba1,_0x5e0f02,_0x4f9506){return new BPromise(function(_0x1227d1,_0x6d8ee8){return client[_0x4ad1('0xb')](_0x5b4ba1,_0x4f9506)['then'](function(_0x1e8a22){logger['info'](_0x4ad1('0xc'),_0x5e0f02,_0x4ad1('0xd'));logger[_0x4ad1('0xe')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x5e0f02,_0x4ad1('0xd'),JSON[_0x4ad1('0xf')](_0x1e8a22));if(_0x1e8a22[_0x4ad1('0x10')]){if(_0x1e8a22[_0x4ad1('0x10')][_0x4ad1('0x11')]===0x1f4){logger[_0x4ad1('0x10')](_0x4ad1('0xc'),_0x5e0f02,_0x1e8a22['error']['message']);return _0x6d8ee8(_0x1e8a22[_0x4ad1('0x10')][_0x4ad1('0x12')]);}logger[_0x4ad1('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5e0f02,_0x1e8a22[_0x4ad1('0x10')]['message']);return _0x1227d1(_0x1e8a22[_0x4ad1('0x10')][_0x4ad1('0x12')]);}else{logger[_0x4ad1('0x13')](_0x4ad1('0xc'),_0x5e0f02,_0x4ad1('0xd'));_0x1227d1(_0x1e8a22[_0x4ad1('0x14')]['message']);}})[_0x4ad1('0x15')](function(_0x29e6fa){logger['error'](_0x4ad1('0xc'),_0x5e0f02,_0x29e6fa);_0x6d8ee8(_0x29e6fa);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 161a407..4fe49d9 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1696=['start','filter','number','exitCode','length','map','name','Online\x20apps:','online','Offline\x20apps:','status','join','log','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','listen','info'];(function(_0x410727,_0x3bbb0f){var _0x49cd1f=function(_0x53f8ac){while(--_0x53f8ac){_0x410727['push'](_0x410727['shift']());}};_0x49cd1f(++_0x3bbb0f);}(_0x1696,0x79));var _0x6169=function(_0x3d4f1f,_0x1b467b){_0x3d4f1f=_0x3d4f1f-0x0;var _0x3cd816=_0x1696[_0x3d4f1f];return _0x3cd816;};'use strict';var _=require(_0x6169('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0x6169('0x1'));var checkLicense=require(_0x6169('0x2'));var rpc=require(_0x6169('0x3'));var config=require(_0x6169('0x4'));var logger=require(_0x6169('0x5'))(_0x6169('0x6'));var pm2=require(_0x6169('0x7'));var pm2Config=require(_0x6169('0x8'));var schedule=require(_0x6169('0x9'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x6169('0xa'));var transcribe=require(_0x6169('0xb'));var provider=require(_0x6169('0xc'));function main(){return db[_0x6169('0xd')][_0x6169('0xe')]()[_0x6169('0xf')](function(){if(config[_0x6169('0x10')]){return seedDb['default']();}})[_0x6169('0xf')](function(){return checkLicense['default']();})[_0x6169('0xf')](function(){return rpc[_0x6169('0x11')]();})['then'](function(_0x46c85b){logger[_0x6169('0x12')](_0x46c85b);return chat[_0x6169('0x13')]();})[_0x6169('0xf')](function(){return whatsapp['start']();})['then'](function(){return schedule[_0x6169('0x13')]();})[_0x6169('0xf')](function(){return transcribe['start']();})[_0x6169('0xf')](function(){return provider[_0x6169('0x13')]();})[_0x6169('0xf')](function(_0x56e64a){logger['info'](_0x56e64a);return pm2['start'](pm2Config);})[_0x6169('0xf')](function(_0x2171d1){var _0x417e48=_0x2171d1[_0x6169('0x14')](function(_0x3ffa76){return typeof _0x3ffa76['exitCode']===_0x6169('0x15')&&_0x3ffa76[_0x6169('0x16')]>=0x0;});if(_0x417e48['length']>0x0){throw new Error(_0x417e48[_0x6169('0x17')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x6169('0x18')](_0x417e48,function(_0x1e3b4e){return'\x22'+_0x1e3b4e['pm2_env'][_0x6169('0x19')]+'\x22';}));}logger[_0x6169('0x12')](_0x6169('0x1a'),_[_0x6169('0x18')](_[_0x6169('0x14')](_0x2171d1,{'status':_0x6169('0x1b')}),_0x6169('0x19'))['join']());logger['info'](_0x6169('0x1c'),_[_0x6169('0x18')](_['filter'](_0x2171d1,function(_0x34675a){return _0x34675a[_0x6169('0x1d')]!==_0x6169('0x1b');}),_0x6169('0x19'))[_0x6169('0x1e')]()||'None');console[_0x6169('0x1f')]('App\x20Ready!');})[_0x6169('0x20')](function(_0x3ec419){console[_0x6169('0x1f')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x3ec419);logger[_0x6169('0x21')](_0x6169('0x22'),_0x3ec419);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x8c52=['start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','join','status','online','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','seedDB','default','then','listen','info'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x8c52,0x7e));var _0x28c5=function(_0x2cfbcf,_0x2cf96f){_0x2cfbcf=_0x2cfbcf-0x0;var _0x41fc13=_0x8c52[_0x2cfbcf];return _0x41fc13;};'use strict';var _=require(_0x28c5('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0x28c5('0x1'));var checkLicense=require(_0x28c5('0x2'));var rpc=require(_0x28c5('0x3'));var config=require(_0x28c5('0x4'));var logger=require(_0x28c5('0x5'))(_0x28c5('0x6'));var pm2=require(_0x28c5('0x7'));var pm2Config=require(_0x28c5('0x8'));var schedule=require(_0x28c5('0x9'));var chat=require(_0x28c5('0xa'));var whatsapp=require(_0x28c5('0xb'));var transcribe=require(_0x28c5('0xc'));var provider=require('./config/schedule/cloud-provider');function main(){return db['sequelize']['sync']()['then'](function(){if(config[_0x28c5('0xd')]){return seedDb[_0x28c5('0xe')]();}})[_0x28c5('0xf')](function(){return checkLicense['default']();})[_0x28c5('0xf')](function(){return rpc[_0x28c5('0x10')]();})['then'](function(_0x3c4bba){logger[_0x28c5('0x11')](_0x3c4bba);return chat[_0x28c5('0x12')]();})[_0x28c5('0xf')](function(){return whatsapp[_0x28c5('0x12')]();})[_0x28c5('0xf')](function(){return schedule[_0x28c5('0x12')]();})[_0x28c5('0xf')](function(){return transcribe[_0x28c5('0x12')]();})[_0x28c5('0xf')](function(){return provider['start']();})[_0x28c5('0xf')](function(_0x4a4b01){logger[_0x28c5('0x11')](_0x4a4b01);return pm2[_0x28c5('0x12')](pm2Config);})['then'](function(_0x4520ea){var _0x236732=_0x4520ea[_0x28c5('0x13')](function(_0x20f186){return typeof _0x20f186[_0x28c5('0x14')]===_0x28c5('0x15')&&_0x20f186[_0x28c5('0x14')]>=0x0;});if(_0x236732[_0x28c5('0x16')]>0x0){throw new Error(_0x236732['length']+_0x28c5('0x17')+_[_0x28c5('0x18')](_0x236732,function(_0x19fc7f){return'\x22'+_0x19fc7f[_0x28c5('0x19')][_0x28c5('0x1a')]+'\x22';}));}logger['info']('Online\x20apps:',_[_0x28c5('0x18')](_[_0x28c5('0x13')](_0x4520ea,{'status':'online'}),_0x28c5('0x1a'))[_0x28c5('0x1b')]());logger['info']('Offline\x20apps:',_['map'](_[_0x28c5('0x13')](_0x4520ea,function(_0x21ffab){return _0x21ffab[_0x28c5('0x1c')]!==_0x28c5('0x1d');}),_0x28c5('0x1a'))[_0x28c5('0x1b')]()||_0x28c5('0x1e'));console[_0x28c5('0x1f')](_0x28c5('0x20'));})['catch'](function(_0x26c44d){console[_0x28c5('0x1f')](_0x28c5('0x21'),_0x26c44d);logger[_0x28c5('0x22')](_0x28c5('0x23'),_0x26c44d);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 2835355..2f65b5c 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 _0x2483=['openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','then','closed','query','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','catch','isAuthenticated','authorization','User','find','authenticate','Wrong\x20credentials.','startsWith','headers','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','sub','Setting','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','add','blockDuration','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','cookie','motion.token','redirect','send','retrieveApiKey','apiKeyIat','regenerateApiKey','validatePasswordPattern','test','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','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','split','length','splice','unshift','encryptString','promisify','sign','secret','payload','options','randomBytes','hex','floor','now','toString','HS512','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','basic-auth','crypto','util','moment','secrets','session','role','fullname','internal','email','userpic','permissions','voicePause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x2483,0x168));var _0x3248=function(_0x339a95,_0x396c16){_0x339a95=_0x339a95-0x0;var _0x18d6ad=_0x2483[_0x339a95];return _0x18d6ad;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x3248('0x0'));var hardwareConf=require(_0x3248('0x1'));var licenseUtil=require(_0x3248('0x2'));var encryptor=require(_0x3248('0x3'));var _=require('lodash');var jwt=require(_0x3248('0x4'));var expressJwt=require(_0x3248('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0x3248('0x6'));var crypto=require(_0x3248('0x7'));var BPromise=require('bluebird');var util=require(_0x3248('0x8'));var moment=require(_0x3248('0x9'));var validateJwt=expressJwt({'secret':config[_0x3248('0xa')][_0x3248('0xb')]});var userAttributes=['id',_0x3248('0xc'),_0x3248('0xd'),'name',_0x3248('0xe'),_0x3248('0xf'),_0x3248('0x10'),_0x3248('0x11'),'md5secret',_0x3248('0x12'),'chatPause',_0x3248('0x13'),_0x3248('0x14'),_0x3248('0x15'),_0x3248('0x16'),_0x3248('0x17'),_0x3248('0x18'),'lastLoginAt','lastPauseAt',_0x3248('0x19'),_0x3248('0x1a'),'passwordResetAt',_0x3248('0x1b'),_0x3248('0x1c'),_0x3248('0x1d'),_0x3248('0x1e'),_0x3248('0x1f'),_0x3248('0x20'),_0x3248('0x21'),_0x3248('0x22'),'phoneBarPrefixRequired','phoneBarRemoteControl',_0x3248('0x23'),_0x3248('0x24'),_0x3248('0x25'),_0x3248('0x26'),_0x3248('0x27'),'settingsEnabled',_0x3248('0x28'),'downloadVoiceRecordings',_0x3248('0x29'),_0x3248('0x2a'),_0x3248('0x2b'),_0x3248('0x2c'),_0x3248('0x2d'),_0x3248('0x2e'),_0x3248('0x2f'),_0x3248('0x30'),_0x3248('0x31'),_0x3248('0x32'),_0x3248('0x33'),_0x3248('0x34'),'faxAutoanswer',_0x3248('0x35'),'whatsappAutoanswer',_0x3248('0x36'),'messengerSoundNotification'];exports[_0x3248('0x37')]=function(){return this['isAuthenticated'](!![])[_0x3248('0x38')](function(_0x2a6948,_0x5d817f,_0x5388b7){if(_0x2a6948[_0x3248('0x39')]){_0x5388b7();}else{return db[_0x3248('0x3a')][_0x3248('0x3b')]({'where':{'id':_0x2a6948[_0x3248('0x3c')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0x3248('0x3d')](function(_0x43c1a5){if(_0x43c1a5&&_0x43c1a5[_0x3248('0x3e')]&&!_0x2a6948[_0x3248('0x3f')]['forceDownload']){return _0x5d817f[_0x3248('0x40')](_0x43c1a5[_0x3248('0x41')]===_0x3248('0x42')?0x195:0x193)[_0x3248('0x43')]({'message':_0x43c1a5['disposition']===_0x3248('0x42')?_0x3248('0x44'):_0x3248('0x45')});}else{_0x5388b7();}})[_0x3248('0x46')](function(_0xaf8685){_0x5388b7(_0xaf8685);});}});};exports[_0x3248('0x47')]=function isAuthenticated(_0x5e2d06){return compose()[_0x3248('0x38')](function(_0x338e6e,_0x44b7fa,_0x2f7c94){var _0x418402;if(_0x338e6e['headers']['authorization']){if(_['startsWith'](_0x338e6e['headers'][_0x3248('0x48')],'Basic')){var _0xda4633=basicAuth(_0x338e6e);db[_0x3248('0x49')][_0x3248('0x4a')]({'where':{'name':_0xda4633['name']}})['then'](function(_0x52fc7c){if(!_0x52fc7c||!_0x52fc7c[_0x3248('0x4b')](_0xda4633['pass'])){return _0x44b7fa['status'](0x191)[_0x3248('0x43')]({'message':_0x3248('0x4c')});}_0x338e6e[_0x3248('0x39')]={'id':_0x52fc7c['id']};_0x2f7c94();})['catch'](function(_0x17301b){_0x2f7c94(_0x17301b);});}else if(_[_0x3248('0x4d')](_0x338e6e[_0x3248('0x4e')][_0x3248('0x48')],_0x3248('0x4f'))){validateJwt(_0x338e6e,_0x44b7fa,_0x2f7c94);}else{if(_0x5e2d06){_0x2f7c94();}else{return _0x44b7fa[_0x3248('0x40')](0x193)[_0x3248('0x43')]({'message':_0x3248('0x50')});}}}else if(_0x338e6e[_0x3248('0x3f')][_0x3248('0x51')]){try{var _0xe9806a={'audience':hardwareConf[_0x3248('0x52')](),'issuer':hardwareConf[_0x3248('0x52')]()};verifyJwt(_0x338e6e[_0x3248('0x3f')][_0x3248('0x51')],_0xe9806a)[_0x3248('0x3d')](function(_0x14aab0){return db[_0x3248('0x49')][_0x3248('0x4a')]({'where':{'id':_0x14aab0[_0x3248('0x53')]}})['then'](function(_0x538ce8){_0x418402=_0x538ce8;return db[_0x3248('0x54')][_0x3248('0x3b')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]});})['then'](function(_0xe0acc9){if(!_0x418402||!_['isEqual'](_0x418402[_0x3248('0x55')],_0x14aab0[_0x3248('0x56')])){return _0x44b7fa[_0x3248('0x40')](0x191)[_0x3248('0x43')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x418402[_0x3248('0x57')]){return _0x44b7fa['status'](0x191)['json']({'message':_0x3248('0x58')});}if(_0x418402[_0x3248('0x59')]){if(_0xe0acc9['blockDuration']>0x0){if(moment(_0x418402['blockedAt'])[_0x3248('0x5a')](_0xe0acc9[_0x3248('0x5b')],_0x3248('0x5c'))>moment()){return _0x44b7fa['status'](0x191)[_0x3248('0x43')]({'message':_0x3248('0x58')});}}else{return _0x44b7fa[_0x3248('0x40')](0x191)[_0x3248('0x43')]({'message':_0x3248('0x58')});}}_0x338e6e[_0x3248('0x39')]={'id':_0x418402['id']};_0x2f7c94();});})[_0x3248('0x46')](function(){return _0x44b7fa[_0x3248('0x40')](0x191)[_0x3248('0x43')]({'message':_0x3248('0x58')});});}catch(_0x54e327){_0x2f7c94(_0x54e327);}}else if(_0x5e2d06){_0x2f7c94();}else{return _0x44b7fa[_0x3248('0x40')](0x193)[_0x3248('0x43')]({'message':_0x3248('0x50')});}})[_0x3248('0x38')](function(_0x27518f,_0x5d5ae8,_0x362c14){if(_0x27518f['user']){db['User'][_0x3248('0x4a')]({'where':{'id':_0x27518f[_0x3248('0x39')]['id']},'attributes':userAttributes})[_0x3248('0x3d')](function(_0x51c98d){if(!_0x51c98d){return _0x5d5ae8[_0x3248('0x40')](0x194)['json']({'message':_0x3248('0x5d')});}_0x27518f[_0x3248('0x39')]=_0x51c98d;_0x362c14();})[_0x3248('0x46')](function(_0xc43a8b){_0x362c14(_0xc43a8b);});}else if(_0x5e2d06){_0x362c14();}else{return _0x5d5ae8[_0x3248('0x40')](0x194)['json']({'message':_0x3248('0x5e')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x3248('0x38')](function(_0x207e69,_0x58a675,_0x37d369){return licenseUtil[_0x3248('0x5f')]()['then'](function(_0x6147ab){if(_0x6147ab[_0x3248('0x60')]){_0x37d369();}else{return _0x58a675[_0x3248('0x40')](0x193)[_0x3248('0x43')]({'message':_0x3248('0x61')});}})[_0x3248('0x46')](function(_0x87273f){_0x37d369(_0x87273f);});});};exports[_0x3248('0x62')]=function isWebrtcLicence(){return compose()[_0x3248('0x38')](function(_0xaa25ad,_0x4000a2,_0x44fcfd){return licenseUtil[_0x3248('0x5f')]()[_0x3248('0x3d')](function(_0x186ee7){if(_0x186ee7[_0x3248('0x63')]){_0x44fcfd();}else{return _0x4000a2[_0x3248('0x40')](0x193)[_0x3248('0x43')]({'message':_0x3248('0x61')});}})[_0x3248('0x46')](function(_0x23dc1b){_0x44fcfd(_0x23dc1b);});});};exports[_0x3248('0x64')]=function(_0x25014a,_0x3418db,_0x111bc1){_0x25014a[_0x3248('0x64')]=!![];return _0x111bc1();};exports[_0x3248('0x65')]=function signToken(_0x51d529){return signJwt(_0x51d529);};exports['setTokenCookie']=function(_0x2b16d1,_0x16243f){if(!_0x2b16d1['user']){return _0x16243f['status'](0x194)[_0x3248('0x43')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x195571={'payload':{'id':_0x2b16d1[_0x3248('0x39')]['id'],'role':_0x2b16d1[_0x3248('0x39')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x195571)['then'](function(_0x11ca2e){_0x16243f[_0x3248('0x66')](_0x3248('0x67'),_0x11ca2e);_0x16243f[_0x3248('0x68')]('/dashboards/general');})['catch'](function(_0x63fd70){return _0x16243f[_0x3248('0x40')](0x1f4)[_0x3248('0x69')](_0x63fd70);});};exports[_0x3248('0x6a')]=function(_0x196427){if(_['isNil'](_0x196427[_0x3248('0x55')])||_['isNil'](_0x196427[_0x3248('0x6b')])){return null;}else{return createJwt(_0x196427);}};exports['generateApiKey']=function(_0x1cb125){_0x1cb125['apiKeyNonce']=generateNonce();_0x1cb125[_0x3248('0x6b')]=generateIssuedAt();return createJwt(_0x1cb125);};exports[_0x3248('0x6c')]=function(_0x23f8b5,_0x301fa5){var _0x14ba12=_0x23f8b5[_0x3248('0x3f')]['apikey'];if(_0x14ba12){var _0x3bd412={'nonce':_0x301fa5[_0x3248('0x55')],'iat':_0x301fa5['apiKeyIat'],'audience':hardwareConf[_0x3248('0x52')](),'issuer':hardwareConf[_0x3248('0x52')]()};return verifyJwt(_0x14ba12,_0x3bd412)[_0x3248('0x3d')](function(){return generateApiKey(_0x301fa5);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0x3248('0x6d')]=function(_0x3cef85){var _0x9decdb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x9decdb[_0x3248('0x6e')](_0x3cef85))throw new db[(_0x3248('0x6f'))][(_0x3248('0x70'))](_0x3248('0x71'));return;};exports[_0x3248('0x72')]=function(_0x104a69,_0x40e28c,_0x376f4c){var _0x499721=encryptor[_0x3248('0x73')](_0x40e28c)['split'](',');for(var _0x1f12d6=0x0;_0x1f12d6<_0x376f4c;_0x1f12d6++){if(!_0x499721[_0x1f12d6])break;if(_0x104a69[_0x3248('0x74')]()===_0x499721[_0x1f12d6][_0x3248('0x74')]()){var _0x1a8884=util[_0x3248('0x75')](_0x3248('0x76'),_0x376f4c);if(_0x376f4c===0x1){_0x1a8884=_0x3248('0x77');}throw new db[(_0x3248('0x6f'))]['ValidationError'](_0x1a8884);}}return;};exports[_0x3248('0x78')]=function(_0xa11a9f,_0x475853){var _0x1be74f=_0x475853?encryptor['decryptString'](_0x475853)[_0x3248('0x79')](','):[];if(_0x1be74f[_0x3248('0x7a')]===0x5){_0x1be74f[_0x3248('0x7b')](-0x1,0x1);}_0x1be74f[_0x3248('0x7c')](_0xa11a9f);return encryptor[_0x3248('0x7d')](_0x1be74f['join'](','));};function signJwt(_0xe74e66){var _0x17be0f=BPromise[_0x3248('0x7e')](jwt[_0x3248('0x7f')],{'context':jwt});var _0x51b9db=_0xe74e66[_0x3248('0x80')]||config[_0x3248('0xa')][_0x3248('0xb')];return new BPromise(function(_0x599ef6,_0x30d4a9){_0x17be0f(_0xe74e66[_0x3248('0x81')],_0x51b9db,_0xe74e66[_0x3248('0x82')])[_0x3248('0x3d')](function(_0x5d9a85){_0x599ef6(_0x5d9a85);})['catch'](function(_0xb9a129){_0x30d4a9(_0xb9a129);});});}function verifyJwt(_0xd2ccd0,_0x4e79f1,_0x5f2881){var _0x33e0b1=BPromise[_0x3248('0x7e')](jwt['verify'],{'context':jwt});var _0x3a766b=_0x5f2881||config[_0x3248('0xa')][_0x3248('0xb')];return new BPromise(function(_0x2a4d68,_0xe0dd01){_0x33e0b1(_0xd2ccd0,_0x3a766b,_0x4e79f1)[_0x3248('0x3d')](function(_0x3a3cb0){_0x2a4d68(_0x3a3cb0);})[_0x3248('0x46')](function(_0x44b3a4){_0xe0dd01(_0x44b3a4);});});}function generateNonce(){return crypto[_0x3248('0x83')](0x10)['toString'](_0x3248('0x84'));}function generateIssuedAt(){return Math[_0x3248('0x85')](Date[_0x3248('0x86')]()/0x3e8)[_0x3248('0x87')]();}function createJwt(_0x31a822){var _0x46e85e={'payload':{'iat':_0x31a822['apiKeyIat'],'nonce':_0x31a822[_0x3248('0x55')]},'options':{'algorithm':_0x3248('0x88'),'subject':_0x31a822['id'][_0x3248('0x87')](),'issuer':hardwareConf[_0x3248('0x52')](),'audience':hardwareConf[_0x3248('0x52')]()}};return signJwt(_0x46e85e)['then'](function(_0x2d1fce){return{'iat':_0x31a822['apiKeyIat'],'nonce':_0x31a822['apiKeyNonce'],'token':_0x2d1fce};});} \ No newline at end of file +var _0x6570=['json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','User','authenticate','pass','status','Wrong\x20credentials.','Bearer','apikey','getUuid','query','find','Setting','allowedLoginAttempts','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','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','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','splice','unshift','join','payload','options','promisify','verify','randomBytes','toString','hex','floor','now','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','composable-middleware','crypto','bluebird','util','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','forceDownload','unmanaged'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x6570,0xdb));var _0x0657=function(_0x17d987,_0x55be23){_0x17d987=_0x17d987-0x0;var _0x453d32=_0x6570[_0x17d987];return _0x453d32;};'use strict';var db=require(_0x0657('0x0'))['db'];var config=require(_0x0657('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x0657('0x2'));var encryptor=require(_0x0657('0x3'));var _=require(_0x0657('0x4'));var jwt=require(_0x0657('0x5'));var expressJwt=require('express-jwt');var compose=require(_0x0657('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0x0657('0x7'));var BPromise=require(_0x0657('0x8'));var util=require(_0x0657('0x9'));var moment=require(_0x0657('0xa'));var validateJwt=expressJwt({'secret':config[_0x0657('0xb')][_0x0657('0xc')]});var userAttributes=['id',_0x0657('0xd'),_0x0657('0xe'),_0x0657('0xf'),_0x0657('0x10'),_0x0657('0x11'),_0x0657('0x12'),_0x0657('0x13'),'md5secret','voicePause','chatPause',_0x0657('0x14'),_0x0657('0x15'),_0x0657('0x16'),_0x0657('0x17'),_0x0657('0x18'),_0x0657('0x19'),_0x0657('0x1a'),_0x0657('0x1b'),_0x0657('0x1c'),_0x0657('0x1d'),_0x0657('0x1e'),'alias','phoneBarAutoAnswer',_0x0657('0x1f'),_0x0657('0x20'),_0x0657('0x21'),_0x0657('0x22'),'phoneBarEnableSettings',_0x0657('0x23'),'phoneBarPrefixRequired','phoneBarRemoteControl',_0x0657('0x24'),_0x0657('0x25'),_0x0657('0x26'),_0x0657('0x27'),_0x0657('0x28'),_0x0657('0x29'),'wssPort','downloadVoiceRecordings',_0x0657('0x2a'),_0x0657('0x2b'),'ignorePauseForPreviewCalls',_0x0657('0x2c'),_0x0657('0x2d'),_0x0657('0x2e'),_0x0657('0x2f'),_0x0657('0x30'),_0x0657('0x31'),_0x0657('0x32'),'openchannelAutoanswer',_0x0657('0x33'),_0x0657('0x34'),_0x0657('0x35'),_0x0657('0x36'),_0x0657('0x37'),_0x0657('0x38')];exports[_0x0657('0x39')]=function(){return this[_0x0657('0x3a')](!![])[_0x0657('0x3b')](function(_0x1c28c2,_0x19ec34,_0x36aed4){if(_0x1c28c2[_0x0657('0x3c')]){_0x36aed4();}else{return db[_0x0657('0x3d')][_0x0657('0x3e')]({'where':{'id':_0x1c28c2[_0x0657('0x3f')]['id']},'attributes':['id',_0x0657('0x40'),_0x0657('0x41')],'raw':!![]})[_0x0657('0x42')](function(_0x3e193e){if(_0x3e193e&&_0x3e193e[_0x0657('0x40')]&&!_0x1c28c2['query'][_0x0657('0x43')]){return _0x19ec34['status'](_0x3e193e['disposition']===_0x0657('0x44')?0x195:0x193)[_0x0657('0x45')]({'message':_0x3e193e['disposition']==='unmanaged'?_0x0657('0x46'):_0x0657('0x47')});}else{_0x36aed4();}})[_0x0657('0x48')](function(_0xf4ffc8){_0x36aed4(_0xf4ffc8);});}});};exports[_0x0657('0x3a')]=function isAuthenticated(_0x457053){return compose()[_0x0657('0x3b')](function(_0x52cb19,_0x49022d,_0x4fae5d){var _0x4db80c;if(_0x52cb19[_0x0657('0x49')][_0x0657('0x4a')]){if(_[_0x0657('0x4b')](_0x52cb19[_0x0657('0x49')][_0x0657('0x4a')],'Basic')){var _0x199ba3=basicAuth(_0x52cb19);db[_0x0657('0x4c')]['find']({'where':{'name':_0x199ba3[_0x0657('0xf')]}})['then'](function(_0x1f8c42){if(!_0x1f8c42||!_0x1f8c42[_0x0657('0x4d')](_0x199ba3[_0x0657('0x4e')])){return _0x49022d[_0x0657('0x4f')](0x191)[_0x0657('0x45')]({'message':_0x0657('0x50')});}_0x52cb19[_0x0657('0x3c')]={'id':_0x1f8c42['id']};_0x4fae5d();})[_0x0657('0x48')](function(_0x20468a){_0x4fae5d(_0x20468a);});}else if(_[_0x0657('0x4b')](_0x52cb19[_0x0657('0x49')][_0x0657('0x4a')],_0x0657('0x51'))){validateJwt(_0x52cb19,_0x49022d,_0x4fae5d);}else{if(_0x457053){_0x4fae5d();}else{return _0x49022d['status'](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x52cb19['query'][_0x0657('0x52')]){try{var _0x45da9c={'audience':hardwareConf[_0x0657('0x53')](),'issuer':hardwareConf[_0x0657('0x53')]()};verifyJwt(_0x52cb19[_0x0657('0x54')][_0x0657('0x52')],_0x45da9c)[_0x0657('0x42')](function(_0x15b847){return db[_0x0657('0x4c')][_0x0657('0x55')]({'where':{'id':_0x15b847['sub']}})['then'](function(_0x262dae){_0x4db80c=_0x262dae;return db[_0x0657('0x56')][_0x0657('0x3e')]({'where':{'id':0x1},'attributes':[_0x0657('0x57'),'blockDuration'],'raw':!![]});})[_0x0657('0x42')](function(_0x486df9){if(!_0x4db80c||!_['isEqual'](_0x4db80c[_0x0657('0x58')],_0x15b847['nonce'])){return _0x49022d[_0x0657('0x4f')](0x191)[_0x0657('0x45')]({'message':_0x0657('0x59')});}if(_0x4db80c[_0x0657('0x5a')]){return _0x49022d[_0x0657('0x4f')](0x191)['json']({'message':_0x0657('0x5b')});}if(_0x4db80c[_0x0657('0x5c')]){if(_0x486df9[_0x0657('0x5d')]>0x0){if(moment(_0x4db80c[_0x0657('0x5e')])[_0x0657('0x5f')](_0x486df9['blockDuration'],'minutes')>moment()){return _0x49022d[_0x0657('0x4f')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x49022d[_0x0657('0x4f')](0x191)[_0x0657('0x45')]({'message':_0x0657('0x5b')});}}_0x52cb19[_0x0657('0x3c')]={'id':_0x4db80c['id']};_0x4fae5d();});})[_0x0657('0x48')](function(){return _0x49022d[_0x0657('0x4f')](0x191)[_0x0657('0x45')]({'message':_0x0657('0x5b')});});}catch(_0x2651df){_0x4fae5d(_0x2651df);}}else if(_0x457053){_0x4fae5d();}else{return _0x49022d[_0x0657('0x4f')](0x193)['json']({'message':_0x0657('0x60')});}})['use'](function(_0x45022e,_0x3c81a1,_0x1e77ca){if(_0x45022e[_0x0657('0x3c')]){db[_0x0657('0x4c')]['find']({'where':{'id':_0x45022e[_0x0657('0x3c')]['id']},'attributes':userAttributes})[_0x0657('0x42')](function(_0x41b73a){if(!_0x41b73a){return _0x3c81a1['status'](0x194)[_0x0657('0x45')]({'message':_0x0657('0x61')});}_0x45022e[_0x0657('0x3c')]=_0x41b73a;_0x1e77ca();})[_0x0657('0x48')](function(_0x924f3c){_0x1e77ca(_0x924f3c);});}else if(_0x457053){_0x1e77ca();}else{return _0x3c81a1[_0x0657('0x4f')](0x194)[_0x0657('0x45')]({'message':_0x0657('0x62')});}});};exports[_0x0657('0x63')]=function canUpdate(){return compose()[_0x0657('0x3b')](function(_0x3383c6,_0x38c9de,_0x2ff119){return licenseUtil[_0x0657('0x64')]()[_0x0657('0x42')](function(_0x243c33){if(_0x243c33[_0x0657('0x65')]){_0x2ff119();}else{return _0x38c9de[_0x0657('0x4f')](0x193)['json']({'message':_0x0657('0x66')});}})['catch'](function(_0xd1459){_0x2ff119(_0xd1459);});});};exports[_0x0657('0x67')]=function isWebrtcLicence(){return compose()['use'](function(_0x4b6498,_0xdadc3a,_0x3afb60){return licenseUtil[_0x0657('0x64')]()[_0x0657('0x42')](function(_0x5debfb){if(_0x5debfb[_0x0657('0x68')]){_0x3afb60();}else{return _0xdadc3a[_0x0657('0x4f')](0x193)[_0x0657('0x45')]({'message':_0x0657('0x66')});}})[_0x0657('0x48')](function(_0x48450e){_0x3afb60(_0x48450e);});});};exports[_0x0657('0x69')]=function(_0x2373a0,_0x2d7f47,_0x1679ec){_0x2373a0[_0x0657('0x69')]=!![];return _0x1679ec();};exports[_0x0657('0x6a')]=function signToken(_0x5136b1){return signJwt(_0x5136b1);};exports[_0x0657('0x6b')]=function(_0xb2e01d,_0x360658){if(!_0xb2e01d['user']){return _0x360658['status'](0x194)[_0x0657('0x45')]({'message':_0x0657('0x6c')});}var _0x35d47e={'payload':{'id':_0xb2e01d[_0x0657('0x3c')]['id'],'role':_0xb2e01d[_0x0657('0x3c')][_0x0657('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x35d47e)['then'](function(_0x2e997f){_0x360658[_0x0657('0x6d')](_0x0657('0x6e'),_0x2e997f);_0x360658[_0x0657('0x6f')](_0x0657('0x70'));})['catch'](function(_0x36385d){return _0x360658[_0x0657('0x4f')](0x1f4)[_0x0657('0x71')](_0x36385d);});};exports['retrieveApiKey']=function(_0x555a9b){if(_[_0x0657('0x72')](_0x555a9b[_0x0657('0x58')])||_[_0x0657('0x72')](_0x555a9b[_0x0657('0x73')])){return null;}else{return createJwt(_0x555a9b);}};exports[_0x0657('0x74')]=function(_0x5d856b){_0x5d856b[_0x0657('0x58')]=generateNonce();_0x5d856b[_0x0657('0x73')]=generateIssuedAt();return createJwt(_0x5d856b);};exports[_0x0657('0x75')]=function(_0x247cd0,_0x4416c6){var _0x3ab6e8=_0x247cd0[_0x0657('0x54')][_0x0657('0x52')];if(_0x3ab6e8){var _0x85c50b={'nonce':_0x4416c6[_0x0657('0x58')],'iat':_0x4416c6[_0x0657('0x73')],'audience':hardwareConf[_0x0657('0x53')](),'issuer':hardwareConf[_0x0657('0x53')]()};return verifyJwt(_0x3ab6e8,_0x85c50b)['then'](function(){return generateApiKey(_0x4416c6);});}else{throw{'message':_0x0657('0x76')};}};exports[_0x0657('0x77')]=function(_0x1b1aed){var _0x1a8e83=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1a8e83[_0x0657('0x78')](_0x1b1aed))throw new db[(_0x0657('0x79'))][(_0x0657('0x7a'))](_0x0657('0x7b'));return;};exports[_0x0657('0x7c')]=function(_0x20b47e,_0x3eb8cf,_0x3833fa){var _0x46af52=encryptor[_0x0657('0x7d')](_0x3eb8cf)[_0x0657('0x7e')](',');for(var _0x413ba1=0x0;_0x413ba1<_0x3833fa;_0x413ba1++){if(!_0x46af52[_0x413ba1])break;if(_0x20b47e[_0x0657('0x7f')]()===_0x46af52[_0x413ba1]['toLowerCase']()){var _0x2a7e94=util[_0x0657('0x80')](_0x0657('0x81'),_0x3833fa);if(_0x3833fa===0x1){_0x2a7e94=_0x0657('0x82');}throw new db[(_0x0657('0x79'))][(_0x0657('0x7a'))](_0x2a7e94);}}return;};exports['updatePasswordsHistory']=function(_0x3d457f,_0x208c8c){var _0x5b820b=_0x208c8c?encryptor[_0x0657('0x7d')](_0x208c8c)[_0x0657('0x7e')](','):[];if(_0x5b820b[_0x0657('0x83')]===0x5){_0x5b820b[_0x0657('0x84')](-0x1,0x1);}_0x5b820b[_0x0657('0x85')](_0x3d457f);return encryptor['encryptString'](_0x5b820b[_0x0657('0x86')](','));};function signJwt(_0x430ecf){var _0x35a658=BPromise['promisify'](jwt['sign'],{'context':jwt});var _0x429c87=_0x430ecf['secret']||config[_0x0657('0xb')][_0x0657('0xc')];return new BPromise(function(_0x41fd54,_0x410e74){_0x35a658(_0x430ecf[_0x0657('0x87')],_0x429c87,_0x430ecf[_0x0657('0x88')])[_0x0657('0x42')](function(_0x289759){_0x41fd54(_0x289759);})['catch'](function(_0x2d4bd4){_0x410e74(_0x2d4bd4);});});}function verifyJwt(_0x23c727,_0x257072,_0x1f0bc2){var _0x13458f=BPromise[_0x0657('0x89')](jwt[_0x0657('0x8a')],{'context':jwt});var _0x530d26=_0x1f0bc2||config[_0x0657('0xb')]['session'];return new BPromise(function(_0x543616,_0x296d8c){_0x13458f(_0x23c727,_0x530d26,_0x257072)[_0x0657('0x42')](function(_0x2ce4a0){_0x543616(_0x2ce4a0);})[_0x0657('0x48')](function(_0x10fa43){_0x296d8c(_0x10fa43);});});}function generateNonce(){return crypto[_0x0657('0x8b')](0x10)[_0x0657('0x8c')](_0x0657('0x8d'));}function generateIssuedAt(){return Math[_0x0657('0x8e')](Date[_0x0657('0x8f')]()/0x3e8)[_0x0657('0x8c')]();}function createJwt(_0x284e86){var _0xdde326={'payload':{'iat':_0x284e86['apiKeyIat'],'nonce':_0x284e86[_0x0657('0x58')]},'options':{'algorithm':'HS512','subject':_0x284e86['id']['toString'](),'issuer':hardwareConf[_0x0657('0x53')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0xdde326)[_0x0657('0x42')](function(_0x1e07e1){return{'iat':_0x284e86[_0x0657('0x73')],'nonce':_0x284e86[_0x0657('0x58')],'token':_0x1e07e1};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 3eafe6a..d029640 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 _0x6093=['startsWith','cf_','map','CmCustomField','findOne','slice','length','fieldType','type','./sql-utils','skipContactsQuery','resolve','getContactsSubquery','then','search','parseQueryParameters','where','default','fields','user','clause','tags','skip','checkListsRestrictions','ids','tag','countFilteredContacts','User','buildContactsQuery','rows','catch','describe','CmContact','keys'];(function(_0x4ef1f0,_0x1b1279){var _0x33a94c=function(_0x33d2d9){while(--_0x33d2d9){_0x4ef1f0['push'](_0x4ef1f0['shift']());}};_0x33a94c(++_0x1b1279);}(_0x6093,0x119));var _0x3609=function(_0xdcc348,_0x44a3f8){_0xdcc348=_0xdcc348-0x0;var _0x39541f=_0x6093[_0xdcc348];return _0x39541f;};'use strict';var _=require('lodash');var sqlUtils=require(_0x3609('0x0'));var db=require('../../mysqldb')['db'];exports['findAll']=function(_0x1bfb9d,_0x34c77e,_0x27d029,_0x576849){var _0x568d51={'count':0x0,'rows':[]};var _0x4884db=sqlUtils[_0x3609('0x1')](_0x34c77e,_0x1bfb9d);if(_0x4884db){return Promise[_0x3609('0x2')](_0x568d51);}var _0x52717e=sqlUtils[_0x3609('0x3')]();var _0x5ef34d={};var _0x2ab4d0=![];var _0x5117e3=![];return Promise[_0x3609('0x2')]()[_0x3609('0x4')](function(){if(_0x1bfb9d[_0x3609('0x5')]){return sqlUtils['parseAdvancedSearchFilter'](_0x1bfb9d[_0x3609('0x5')],_0x576849);}else{return sqlUtils[_0x3609('0x6')](_0x1bfb9d,_0x576849);}})['then'](function(_0x2d3029){_0x52717e[_0x3609('0x7')](_0x2d3029[_0x3609('0x8')]);_0x52717e[_0x3609('0x7')](_0x2d3029[_0x3609('0x9')]);_0x52717e[_0x3609('0x7')](_0x2d3029['filter']);_0x52717e['where'](_0x2d3029[_0x3609('0xa')][_0x3609('0xb')]);_0x5ef34d=_0x2d3029[_0x3609('0xc')];_0x5117e3=_0x2d3029[_0x3609('0xa')][_0x3609('0xd')];return sqlUtils[_0x3609('0xe')](_0x34c77e,_0x1bfb9d,_0x5117e3);})['then'](function(_0x226794){_0x52717e[_0x3609('0x7')](_0x226794);var _0x4438e0=_0x1bfb9d[_0x3609('0x5')]?_0x5ef34d[_0x3609('0xf')]:_0x1bfb9d[_0x3609('0x10')];_0x2ab4d0=_0x4438e0?!![]:![];return sqlUtils[_0x3609('0x11')](_0x52717e,_0x4438e0);})['then'](function(_0x46902a){_0x568d51['count']=_0x46902a;if(_0x568d51['count']===0x0){return;}if(_0x1bfb9d[_0x3609('0x12')]){_0x5117e3=!![];}return sqlUtils[_0x3609('0x13')](_0x52717e,_0x1bfb9d[_0x3609('0x9')],_0x27d029,_0x2ab4d0,_0x5ef34d[_0x3609('0xb')],_0x5117e3);})[_0x3609('0x4')](function(_0xed2c06){if(!_0xed2c06){return[];}return sqlUtils['getFilteredContacts'](_0xed2c06,_0x1bfb9d,_0x27d029);})[_0x3609('0x4')](function(_0x4559a4){_0x568d51[_0x3609('0x14')]=_0x4559a4;return _0x568d51;})[_0x3609('0x15')](function(_0x4c2a06){throw _0x4c2a06;});};exports[_0x3609('0x16')]=function(){var _0x43d775={};var _0x337eda=[];return db[_0x3609('0x17')][_0x3609('0x16')]()[_0x3609('0x4')](function(_0x201ed0){_0x43d775=_0x201ed0;var _0x16de28=Object[_0x3609('0x18')](_0x43d775)['filter'](function(_0x206b8b){return _[_0x3609('0x19')](_0x206b8b,_0x3609('0x1a'))?_0x206b8b:undefined;});var _0x2a8b59=_0x16de28[_0x3609('0x1b')](function(_0x4db822){return db[_0x3609('0x1c')][_0x3609('0x1d')]({'where':{'id':_0x4db822[_0x3609('0x1e')](0x3)},'raw':!![]});});return Promise['all'](_0x2a8b59);})[_0x3609('0x4')](function(_0x3efe4c){for(var _0x161a53=0x0;_0x161a53<_0x3efe4c[_0x3609('0x1f')];_0x161a53++){if(_0x3efe4c[_0x161a53]){var _0xd16675=_0x3609('0x1a')+_0x3efe4c[_0x161a53]['id'];_0x43d775[_0xd16675][_0x3609('0x20')]=_0x3efe4c[_0x161a53][_0x3609('0x21')];}}_0x337eda=_[_0x3609('0x1b')](Object['keys'](_0x43d775),function(_0x3575c1){return{'name':_0x3575c1,'type':_0x43d775[_0x3575c1][_0x3609('0x21')]};});return _0x337eda;})[_0x3609('0x15')](function(_0xd7ecb1){throw _0xd7ecb1;});}; \ No newline at end of file +var _0x957f=['countFilteredContacts','count','User','buildContactsQuery','clause','getFilteredContacts','rows','catch','describe','CmContact','keys','cf_','map','CmCustomField','findOne','all','length','fieldType','type','lodash','./sql-utils','skipContactsQuery','resolve','getContactsSubquery','then','parseAdvancedSearchFilter','search','where','default','fields','filter','user','tags','skip','ids','tag'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0x957f,0x10f));var _0xf957=function(_0x179b74,_0x5dc97d){_0x179b74=_0x179b74-0x0;var _0x268f76=_0x957f[_0x179b74];return _0x268f76;};'use strict';var _=require(_0xf957('0x0'));var sqlUtils=require(_0xf957('0x1'));var db=require('../../mysqldb')['db'];exports['findAll']=function(_0x488023,_0x225d9d,_0x48c2da,_0x67d867){var _0x4abc38={'count':0x0,'rows':[]};var _0x4027ef=sqlUtils[_0xf957('0x2')](_0x225d9d,_0x488023);if(_0x4027ef){return Promise[_0xf957('0x3')](_0x4abc38);}var _0x16e34b=sqlUtils[_0xf957('0x4')]();var _0x59a734={};var _0x48cf3c=![];var _0x3145d9=![];return Promise[_0xf957('0x3')]()[_0xf957('0x5')](function(){if(_0x488023['search']){return sqlUtils[_0xf957('0x6')](_0x488023[_0xf957('0x7')],_0x67d867);}else{return sqlUtils['parseQueryParameters'](_0x488023,_0x67d867);}})['then'](function(_0x162ed6){_0x16e34b[_0xf957('0x8')](_0x162ed6[_0xf957('0x9')]);_0x16e34b[_0xf957('0x8')](_0x162ed6[_0xf957('0xa')]);_0x16e34b[_0xf957('0x8')](_0x162ed6[_0xf957('0xb')]);_0x16e34b['where'](_0x162ed6[_0xf957('0xc')]['clause']);_0x59a734=_0x162ed6[_0xf957('0xd')];_0x3145d9=_0x162ed6[_0xf957('0xc')][_0xf957('0xe')];return sqlUtils['checkListsRestrictions'](_0x225d9d,_0x488023,_0x3145d9);})[_0xf957('0x5')](function(_0x4f199b){_0x16e34b[_0xf957('0x8')](_0x4f199b);var _0x4067ae=_0x488023[_0xf957('0x7')]?_0x59a734[_0xf957('0xf')]:_0x488023[_0xf957('0x10')];_0x48cf3c=_0x4067ae?!![]:![];return sqlUtils[_0xf957('0x11')](_0x16e34b,_0x4067ae);})[_0xf957('0x5')](function(_0x301824){_0x4abc38[_0xf957('0x12')]=_0x301824;if(_0x4abc38[_0xf957('0x12')]===0x0){return;}if(_0x488023[_0xf957('0x13')]){_0x3145d9=!![];}return sqlUtils[_0xf957('0x14')](_0x16e34b,_0x488023[_0xf957('0xa')],_0x48c2da,_0x48cf3c,_0x59a734[_0xf957('0x15')],_0x3145d9);})[_0xf957('0x5')](function(_0x3fc914){if(!_0x3fc914){return[];}return sqlUtils[_0xf957('0x16')](_0x3fc914,_0x488023,_0x48c2da);})[_0xf957('0x5')](function(_0x30feff){_0x4abc38[_0xf957('0x17')]=_0x30feff;return _0x4abc38;})[_0xf957('0x18')](function(_0x4b74a8){throw _0x4b74a8;});};exports[_0xf957('0x19')]=function(){var _0x409516={};var _0x441c65=[];return db[_0xf957('0x1a')][_0xf957('0x19')]()[_0xf957('0x5')](function(_0x1e739b){_0x409516=_0x1e739b;var _0x1c0fb5=Object[_0xf957('0x1b')](_0x409516)[_0xf957('0xb')](function(_0xb86df6){return _['startsWith'](_0xb86df6,_0xf957('0x1c'))?_0xb86df6:undefined;});var _0x39631a=_0x1c0fb5[_0xf957('0x1d')](function(_0x5b9e4d){return db[_0xf957('0x1e')][_0xf957('0x1f')]({'where':{'id':_0x5b9e4d['slice'](0x3)},'raw':!![]});});return Promise[_0xf957('0x20')](_0x39631a);})[_0xf957('0x5')](function(_0x315db0){for(var _0x3db9c4=0x0;_0x3db9c4<_0x315db0[_0xf957('0x21')];_0x3db9c4++){if(_0x315db0[_0x3db9c4]){var _0x13ab6f=_0xf957('0x1c')+_0x315db0[_0x3db9c4]['id'];_0x409516[_0x13ab6f][_0xf957('0x22')]=_0x315db0[_0x3db9c4]['type'];}}_0x441c65=_[_0xf957('0x1d')](Object[_0xf957('0x1b')](_0x409516),function(_0x3e4eaf){return{'name':_0x3e4eaf,'type':_0x409516[_0x3e4eaf][_0xf957('0x23')]};});return _0x441c65;})[_0xf957('0x18')](function(_0x4cca20){throw _0x4cca20;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index f986142..f68ce51 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 _0xd0b8=['field','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)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','fieldType','datetime','DATE','type','default','text','start','value','Tag','tags','and','ids','User','clause','uc.UserId\x20=\x20?','user','skip','map','some','compact','Contact','push','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','tag','then','filter','role','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','color','keyBy','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','COUNT(*)','isEmpty','t.id\x20IN\x20?','exports','lodash','squel','../parsers/advancedSearch','../interaction/utils','../../mysqldb','agent','search','ListId','autocomplete','true','select','cm_contacts','where','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','left_join','t.id\x20=\x20ct.TagId','lastName','mobile','fax','email','CompanyId','createdAt','deletedAt','TagIds','includes','forEach'];(function(_0x51c8e6,_0xe8dd59){var _0xc9c892=function(_0x4d5413){while(--_0x4d5413){_0x51c8e6['push'](_0x51c8e6['shift']());}};_0xc9c892(++_0xe8dd59);}(_0xd0b8,0xb5));var _0x8d0b=function(_0x590c5b,_0x4e87de){_0x590c5b=_0x590c5b-0x0;var _0x561f27=_0xd0b8[_0x590c5b];return _0x561f27;};'use strict';var _=require(_0x8d0b('0x0'));var squel=require(_0x8d0b('0x1'));var as=require(_0x8d0b('0x2'));var qs=require('../parsers/qs');var utils=require(_0x8d0b('0x3'));var db=require(_0x8d0b('0x4'))['db'];function skipContactsQuery(_0x29ff75,_0x52dd4b){var _0x259dba=![];if(_0x29ff75['role']===_0x8d0b('0x5')&&!_0x52dd4b[_0x8d0b('0x6')]&&!_0x52dd4b[_0x8d0b('0x7')]&&_0x52dd4b[_0x8d0b('0x8')]!==_0x8d0b('0x9')){_0x259dba=!![];}return _0x259dba;}function getContactsSubquery(){return squel[_0x8d0b('0xa')]()['from'](_0x8d0b('0xb'),'c')[_0x8d0b('0xc')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x266270,_0x28a58d){var _0x12f855=_0x28a58d?'c':_0x8d0b('0xd');_0x266270['left_join'](_0x8d0b('0xe'),'uc',_0x8d0b('0xf')+_0x12f855+_0x8d0b('0x10'))['left_join'](_0x8d0b('0x11'),'ct',_0x8d0b('0x12')+_0x12f855+'.id')[_0x8d0b('0x13')]('tools_tags','t',_0x8d0b('0x14'));return _0x266270;}function addFieldsToQuery(_0x59bb24,_0x366bde,_0x2c82a1,_0x149384,_0x39897b){var _0x135347=_0x39897b?'c':_0x8d0b('0xd');if(!_0x366bde){_0x366bde=['id','firstName',_0x8d0b('0x15'),'phone',_0x8d0b('0x16'),_0x8d0b('0x17'),_0x8d0b('0x18'),_0x8d0b('0x7'),_0x8d0b('0x19'),_0x8d0b('0x1a'),'updatedAt',_0x8d0b('0x1b'),_0x8d0b('0x1c')];}else if(!_0x366bde[_0x8d0b('0x1d')]('id')){_0x366bde['push']('id');}var _0xf615a=_0x2c82a1&&_0x39897b||!_0x2c82a1&&!_0x39897b;if(_0x149384){_0xf615a=_0x149384&&_0x39897b||!_0x149384&&!_0x39897b;}_0x366bde[_0x8d0b('0x1e')](function(_0x1b2d2b){if(_0x1b2d2b==='TagIds'){if(_0xf615a){_0x59bb24[_0x8d0b('0x1f')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x1b2d2b);}else if(_0x2c82a1||_0x149384){_0x59bb24[_0x8d0b('0x1f')](_0x135347+'.'+_0x1b2d2b);}}else{_0x59bb24[_0x8d0b('0x1f')](_0x135347+'.'+_0x1b2d2b);}});return _0x59bb24;}function getSqlClauses(){var _0x28517e={'default':squel[_0x8d0b('0x20')](),'fields':squel[_0x8d0b('0x20')](),'filter':squel['expr'](),'tags':{'clause':squel[_0x8d0b('0x20')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x28517e;}function parseTagParameter(_0x4b6d14){var _0x31c00f=squel[_0x8d0b('0x20')]();if(_0x4b6d14){var _0x4b8e90=utils[_0x8d0b('0x21')](_0x4b6d14);_0x4b8e90['forEach'](function(_0x11757d){_0x31c00f['or'](_0x8d0b('0x22'),'%,'+_0x11757d+',%');});}return _0x31c00f;}function parseSearchFilter(_0x454848){var _0x14f9c8=squel[_0x8d0b('0x20')]();if(_0x454848){var _0x37d5f2=_0x454848['replace']('\x5c','\x5c\x5c')[_0x8d0b('0x23')](/'/g,'\x27\x27');if(_0x37d5f2[_0x8d0b('0x24')]('\x20')[_0x8d0b('0x25')]>0x1){_0x14f9c8['or'](_0x8d0b('0x26'),qs[_0x8d0b('0x27')](_0x37d5f2,!![]),null);}else{if(qs[_0x8d0b('0x28')](_0x37d5f2)){_0x14f9c8['or'](_0x8d0b('0x29'),_0x37d5f2+'%');_0x14f9c8['or'](_0x8d0b('0x2a'),_0x37d5f2+'%');_0x14f9c8['or']('c.mobile\x20LIKE\x20?',_0x37d5f2+'%');_0x14f9c8['or'](_0x8d0b('0x2b'),_0x37d5f2+'%');}else if(qs[_0x8d0b('0x2c')](_0x37d5f2)){_0x14f9c8['or'](_0x8d0b('0x2d'),_0x37d5f2+'%');}else{_0x14f9c8['or']('c.firstName\x20LIKE\x20?','%'+_0x37d5f2+'%');_0x14f9c8['or'](_0x8d0b('0x2e'),'%'+_0x37d5f2+'%');_0x14f9c8['or']('c.email\x20LIKE\x20?','%'+_0x37d5f2+'%');}}}return _0x14f9c8;}function parseAdvancedSearchFilter(_0x12ed14,_0xe15865){var _0x450a6c=getSqlClauses();var _0x3cfc96=as[_0x8d0b('0x2f')](_0x12ed14);var _0x188d08=_0x3cfc96[_0x8d0b('0x30')];for(var _0x321e90=0x0;_0x321e90<_0x3cfc96[_0x8d0b('0x31')][_0x8d0b('0x25')];_0x321e90++){var _0x4f91ce=_0x3cfc96[_0x8d0b('0x31')][_0x321e90];var _0x303ad2='c';var _0x449fe9=_[_0x8d0b('0x32')](_0xe15865,[_0x8d0b('0x33'),_0x4f91ce[_0x8d0b('0x1f')]]);if(_0x449fe9){if(_0x4f91ce['field']==='dateOfBirth'||_0x449fe9[_0x8d0b('0x34')]===_0x8d0b('0x35')){_0x4f91ce['castTo']=_0x8d0b('0x36');}var _0xaa18c1=as['buildExpression'](_0x303ad2,_0x449fe9[_0x8d0b('0x37')],_0x4f91ce);_0x450a6c[_0x8d0b('0x38')][_0x188d08](_0xaa18c1[_0x8d0b('0x39')],_0xaa18c1['value'][_0x8d0b('0x3a')],_0xaa18c1[_0x8d0b('0x3b')]['end']);}else{if(_0x4f91ce['field']===_0x8d0b('0x3c')){var _0xc7d80a=_0x4f91ce[_0x8d0b('0x3b')][_0x8d0b('0x24')](',')['map'](function(_0x334ee1){return Number(_0x334ee1);});var _0x51a1b8=parseTagParameter(_0xc7d80a);_0x450a6c[_0x8d0b('0x3d')]['clause'][_0x8d0b('0x3e')](_0x51a1b8);_0x450a6c[_0x8d0b('0x3d')][_0x8d0b('0x3f')]=_0xc7d80a;}else if(_0x4f91ce[_0x8d0b('0x1f')]===_0x8d0b('0x40')){_0x450a6c['user'][_0x8d0b('0x41')][_0x8d0b('0x3e')](_0x8d0b('0x42'),_0x4f91ce[_0x8d0b('0x3b')]);_0x450a6c[_0x8d0b('0x43')][_0x8d0b('0x44')]=!![];}}}return _0x450a6c;}function parseModelFields(_0x3ca4c7,_0x2d54ad){var _0x2712c4=squel[_0x8d0b('0x20')]();var _0x1b1138=_(_0x3ca4c7)['keys']()[_0x8d0b('0x45')](function(_0x4c9e82){return _[_0x8d0b('0x46')](_0x2d54ad,[_0x8d0b('0x33'),_0x4c9e82])?_0x4c9e82:undefined;})[_0x8d0b('0x47')]()['value']();if(_0x3ca4c7['Contact']){_0x1b1138['push'](_0x8d0b('0x48'));}if(_0x3ca4c7[_0x8d0b('0x40')]){_0x1b1138[_0x8d0b('0x49')]('User');}if(_0x1b1138['length']>0x0){_0x1b1138[_0x8d0b('0x1e')](function(_0x59af2f){if(_0x59af2f===_0x8d0b('0x7')){_0x2712c4[_0x8d0b('0x3e')]('c.ListId\x20IN\x20?',[]['concat'](_0x3ca4c7[_0x59af2f]));}else if(_0x59af2f===_0x8d0b('0x48')){var _0x15684e='%'+_0x3ca4c7[_0x59af2f]+'%';_0x2712c4[_0x8d0b('0x3e')](_0x8d0b('0x4a'),_0x15684e);}else if(_0x59af2f===_0x8d0b('0x40')){_0x2712c4[_0x8d0b('0x3e')](_0x8d0b('0x42'),_0x3ca4c7[_0x59af2f]);}else{_0x2712c4[_0x8d0b('0x3e')]('c.'+_0x59af2f+_0x8d0b('0x4b'),_0x3ca4c7[_0x59af2f]);}});}return _0x2712c4;}function parseQueryParameters(_0x1d4c77,_0x303aa2){var _0x4390ce=getSqlClauses();return Promise[_0x8d0b('0x4c')]()['then'](function(){return parseModelFields(_0x1d4c77,_0x303aa2);})['then'](function(_0x4467a4){_0x4390ce['fields'][_0x8d0b('0x3e')](_0x4467a4);return parseTagParameter(_0x1d4c77[_0x8d0b('0x4d')]);})[_0x8d0b('0x4e')](function(_0x5cc1b1){_0x4390ce['tags'][_0x8d0b('0x41')][_0x8d0b('0x3e')](_0x5cc1b1);return parseSearchFilter(_0x1d4c77[_0x8d0b('0x4f')]);})[_0x8d0b('0x4e')](function(_0x1464bd){_0x4390ce[_0x8d0b('0x4f')]=_0x1464bd;return _0x4390ce;});}function checkListsRestrictions(_0x54b703,_0x592c95,_0xe3645a){var _0x4b8cbf=squel[_0x8d0b('0x20')]();return Promise[_0x8d0b('0x4c')]()[_0x8d0b('0x4e')](function(){if(_0x592c95['search']&&_0x54b703[_0x8d0b('0x50')]===_0x8d0b('0x5')&&!_0xe3645a){return _0x54b703[_0x8d0b('0x51')]({'attributes':['id'],'raw':!![]});}})[_0x8d0b('0x4e')](function(_0x496568){if(_0x496568){if(_0x496568[_0x8d0b('0x25')]===0x0){_0x4b8cbf[_0x8d0b('0x3e')](_0x8d0b('0x52'));}else{_0x4b8cbf[_0x8d0b('0x3e')](_0x8d0b('0x53'),_[_0x8d0b('0x45')](_0x496568,'id'));}}})['then'](function(){return _0x4b8cbf;});}function buildContactsQuery(_0xac85cc,_0x551cf6,_0x1167de,_0x45ecd0,_0x422f8a,_0x350322){if(_0x551cf6){_0x551cf6=_0x1167de[_0x8d0b('0x54')];}_0xac85cc=addFieldsToQuery(_0xac85cc,_0x551cf6,_0x45ecd0,_0x350322,!![]);var _0x43afe5=squel['select']();_0x43afe5=addFieldsToQuery(_0x43afe5,_0x551cf6,_0x45ecd0,_0x350322,![]);if(_0x45ecd0||_0x350322){_0xac85cc=applyJoinClauses(_0xac85cc,!![]);_0xac85cc[_0x8d0b('0x55')](_0x8d0b('0x56'));if(_0x1167de['limit']){_0x43afe5[_0x8d0b('0x57')](_0x1167de[_0x8d0b('0x57')]);}if(_0x1167de['offset']){_0x43afe5['offset'](_0x1167de[_0x8d0b('0x58')]);}}else{_0x43afe5=applyJoinClauses(_0x43afe5,![]);_0x43afe5[_0x8d0b('0x55')](_0x8d0b('0x59'));if(_0x1167de[_0x8d0b('0x57')]){_0xac85cc['limit'](_0x1167de[_0x8d0b('0x57')]);}if(_0x1167de[_0x8d0b('0x58')]){_0xac85cc[_0x8d0b('0x58')](_0x1167de['offset']);}}_0x43afe5[_0x8d0b('0x5a')](_0x422f8a);if(_0x1167de[_0x8d0b('0x5b')]){_0x1167de[_0x8d0b('0x5b')]['forEach'](function(_0x2c452b){_0xac85cc['order']('c.'+_0x2c452b[0x0],_0x2c452b[0x1]===_0x8d0b('0x5c')?![]:!![]);_0x43afe5[_0x8d0b('0x5b')]('subqry.'+_0x2c452b[0x0],_0x2c452b[0x1]===_0x8d0b('0x5c')?![]:!![]);});}_0x43afe5['from'](_0xac85cc,'subqry');return _0x43afe5;}function getFilteredContacts(_0x16b9cd){var _0x135a3b=[];return db[_0x8d0b('0x3c')]['findAll']({'attributes':['id','name',_0x8d0b('0x5d')],'raw':!![]})[_0x8d0b('0x4e')](function(_0x34744e){_0x135a3b=_[_0x8d0b('0x5e')](_0x34744e,'id');var _0x4a1b54={'type':db['Sequelize'][_0x8d0b('0x5f')][_0x8d0b('0x60')],'model':db[_0x8d0b('0x61')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x8d0b('0x62')][_0x8d0b('0x63')](_0x16b9cd[_0x8d0b('0x64')](),_0x4a1b54);})[_0x8d0b('0x4e')](function(_0x8f38a2){_0x8f38a2['forEach'](function(_0x3a8421){if(_0x3a8421[_0x8d0b('0x1c')]){_0x3a8421[_0x8d0b('0x65')]=[];_0x3a8421[_0x8d0b('0x1c')]['split'](',')[_0x8d0b('0x1e')](function(_0x538acf){_0x3a8421[_0x8d0b('0x65')][_0x8d0b('0x49')](_0x135a3b[_0x538acf]);});}delete _0x3a8421[_0x8d0b('0x1c')];});return _0x8f38a2;});}function countFilteredContacts(_0x47464c,_0x20879a){var _0x36fdc6=_0x47464c['clone']();_0x36fdc6[_0x8d0b('0x1f')](_0x8d0b('0x66'));_0x36fdc6=applyJoinClauses(_0x36fdc6,!![]);_0x47464c[_0x8d0b('0x55')]('c.id');var _0x4df5ef=utils[_0x8d0b('0x21')](_0x20879a);if(!_[_0x8d0b('0x67')](_0x4df5ef)){_0x36fdc6[_0x8d0b('0xc')](_0x8d0b('0x68'),_0x4df5ef);}var _0x2815ee={'type':db['Sequelize']['QueryTypes'][_0x8d0b('0x60')],'raw':!![]};return db['sequelize']['query'](_0x36fdc6[_0x8d0b('0x64')](),_0x2815ee)['then'](function(_0x3426f7){return _0x3426f7[0x0][_0x8d0b('0x66')];});}module[_0x8d0b('0x69')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xefcf=['find','name','dateOfBirth','fieldType','datetime','castTo','DATE','type','default','text','value','start','end','Tag','map','clause','tags','ids','User','user','and','uc.UserId\x20=\x20?','some','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','then','fields','tag','filter','resolve','getLists','c.ListId\x20IS\x20NULL','attributes','select','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','color','keyBy','Sequelize','QueryTypes','SELECT','sequelize','query','Tags','clone','COUNT(*)','isEmpty','toString','exports','lodash','squel','../interaction/utils','../../mysqldb','role','agent','search','ListId','true','from','where','c.deletedAt\x20IS\x20NULL','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','phone','mobile','fax','email','deletedAt','TagIds','includes','push','forEach','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)','getFullTextValue','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','conditions'];(function(_0x534163,_0x43fba4){var _0x5de81a=function(_0x49e8c1){while(--_0x49e8c1){_0x534163['push'](_0x534163['shift']());}};_0x5de81a(++_0x43fba4);}(_0xefcf,0x1da));var _0xfefc=function(_0x13d5bc,_0x3fce3c){_0x13d5bc=_0x13d5bc-0x0;var _0x4b8a40=_0xefcf[_0x13d5bc];return _0x4b8a40;};'use strict';var _=require(_0xfefc('0x0'));var squel=require(_0xfefc('0x1'));var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var utils=require(_0xfefc('0x2'));var db=require(_0xfefc('0x3'))['db'];function skipContactsQuery(_0x596a96,_0x480065){var _0x2dd927=![];if(_0x596a96[_0xfefc('0x4')]===_0xfefc('0x5')&&!_0x480065[_0xfefc('0x6')]&&!_0x480065[_0xfefc('0x7')]&&_0x480065['autocomplete']!==_0xfefc('0x8')){_0x2dd927=!![];}return _0x2dd927;}function getContactsSubquery(){return squel['select']()[_0xfefc('0x9')]('cm_contacts','c')[_0xfefc('0xa')](_0xfefc('0xb'));}function applyJoinClauses(_0x482b27,_0x4b59d4){var _0x1295fa=_0x4b59d4?'c':'subqry';_0x482b27['left_join'](_0xfefc('0xc'),'uc',_0xfefc('0xd')+_0x1295fa+_0xfefc('0xe'))[_0xfefc('0xf')](_0xfefc('0x10'),'ct','ct.CmContactId\x20=\x20'+_0x1295fa+_0xfefc('0xe'))[_0xfefc('0xf')]('tools_tags','t',_0xfefc('0x11'));return _0x482b27;}function addFieldsToQuery(_0x4618d4,_0x26368e,_0x2b42a9,_0x25a567,_0x3b7b22){var _0x3d1bf8=_0x3b7b22?'c':_0xfefc('0x12');if(!_0x26368e){_0x26368e=['id',_0xfefc('0x13'),_0xfefc('0x14'),_0xfefc('0x15'),_0xfefc('0x16'),_0xfefc('0x17'),_0xfefc('0x18'),'ListId','CompanyId','createdAt','updatedAt',_0xfefc('0x19'),_0xfefc('0x1a')];}else if(!_0x26368e[_0xfefc('0x1b')]('id')){_0x26368e[_0xfefc('0x1c')]('id');}var _0x4b0082=_0x2b42a9&&_0x3b7b22||!_0x2b42a9&&!_0x3b7b22;if(_0x25a567){_0x4b0082=_0x25a567&&_0x3b7b22||!_0x25a567&&!_0x3b7b22;}_0x26368e[_0xfefc('0x1d')](function(_0x3af273){if(_0x3af273===_0xfefc('0x1a')){if(_0x4b0082){_0x4618d4[_0xfefc('0x1e')](_0xfefc('0x1f'),_0x3af273);}else if(_0x2b42a9||_0x25a567){_0x4618d4[_0xfefc('0x1e')](_0x3d1bf8+'.'+_0x3af273);}}else{_0x4618d4['field'](_0x3d1bf8+'.'+_0x3af273);}});return _0x4618d4;}function getSqlClauses(){var _0xa28966={'default':squel['expr'](),'fields':squel['expr'](),'filter':squel[_0xfefc('0x20')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0xfefc('0x20')](),'skip':![]}};return _0xa28966;}function parseTagParameter(_0x2534e8){var _0x2e8aaa=squel[_0xfefc('0x20')]();if(_0x2534e8){var _0x2bf31e=utils[_0xfefc('0x21')](_0x2534e8);_0x2bf31e[_0xfefc('0x1d')](function(_0x3607e3){_0x2e8aaa['or'](_0xfefc('0x22'),'%,'+_0x3607e3+',%');});}return _0x2e8aaa;}function parseSearchFilter(_0x2f5316){var _0x2f4e64=squel['expr']();if(_0x2f5316){var _0x13e8fd=_0x2f5316[_0xfefc('0x23')]('\x5c','\x5c\x5c')[_0xfefc('0x23')](/'/g,'\x27\x27');if(_0x13e8fd[_0xfefc('0x24')]('\x20')[_0xfefc('0x25')]>0x1){_0x2f4e64['or'](_0xfefc('0x26'),qs[_0xfefc('0x27')](_0x13e8fd,!![]),null);}else{if(qs['isNumeric'](_0x13e8fd)){_0x2f4e64['or'](_0xfefc('0x28'),_0x13e8fd+'%');_0x2f4e64['or']('c.phone\x20LIKE\x20?',_0x13e8fd+'%');_0x2f4e64['or'](_0xfefc('0x29'),_0x13e8fd+'%');_0x2f4e64['or']('c.fax\x20LIKE\x20?',_0x13e8fd+'%');}else if(qs['isEmail'](_0x13e8fd)){_0x2f4e64['or']('c.email\x20LIKE\x20?',_0x13e8fd+'%');}else{_0x2f4e64['or']('c.firstName\x20LIKE\x20?','%'+_0x13e8fd+'%');_0x2f4e64['or'](_0xfefc('0x2a'),'%'+_0x13e8fd+'%');_0x2f4e64['or'](_0xfefc('0x2b'),'%'+_0x13e8fd+'%');}}}return _0x2f4e64;}function parseAdvancedSearchFilter(_0x3770ce,_0x40f9f5){var _0x44db15=getSqlClauses();var _0x2e9f1b=as[_0xfefc('0x2c')](_0x3770ce);var _0x84abdd=_0x2e9f1b['sqlOperator'];for(var _0x122c69=0x0;_0x122c69<_0x2e9f1b[_0xfefc('0x2d')][_0xfefc('0x25')];_0x122c69++){var _0x36452e=_0x2e9f1b[_0xfefc('0x2d')][_0x122c69];var _0xabe9c9='c';var _0x4be7ba=_[_0xfefc('0x2e')](_0x40f9f5,[_0xfefc('0x2f'),_0x36452e[_0xfefc('0x1e')]]);if(_0x4be7ba){if(_0x36452e[_0xfefc('0x1e')]===_0xfefc('0x30')||_0x4be7ba[_0xfefc('0x31')]===_0xfefc('0x32')){_0x36452e[_0xfefc('0x33')]=_0xfefc('0x34');}var _0x16628d=as['buildExpression'](_0xabe9c9,_0x4be7ba[_0xfefc('0x35')],_0x36452e);_0x44db15[_0xfefc('0x36')][_0x84abdd](_0x16628d[_0xfefc('0x37')],_0x16628d[_0xfefc('0x38')][_0xfefc('0x39')],_0x16628d[_0xfefc('0x38')][_0xfefc('0x3a')]);}else{if(_0x36452e[_0xfefc('0x1e')]===_0xfefc('0x3b')){var _0x508258=_0x36452e[_0xfefc('0x38')][_0xfefc('0x24')](',')[_0xfefc('0x3c')](function(_0xdfb5f4){return Number(_0xdfb5f4);});var _0x5ee254=parseTagParameter(_0x508258);_0x44db15['tags'][_0xfefc('0x3d')]['and'](_0x5ee254);_0x44db15[_0xfefc('0x3e')][_0xfefc('0x3f')]=_0x508258;}else if(_0x36452e[_0xfefc('0x1e')]===_0xfefc('0x40')){_0x44db15[_0xfefc('0x41')][_0xfefc('0x3d')][_0xfefc('0x42')](_0xfefc('0x43'),_0x36452e[_0xfefc('0x38')]);_0x44db15[_0xfefc('0x41')]['skip']=!![];}}}return _0x44db15;}function parseModelFields(_0x2b3c46,_0x6ed9d2){var _0x36d094=squel[_0xfefc('0x20')]();var _0x61db0=_(_0x2b3c46)['keys']()['map'](function(_0x22a5f2){return _[_0xfefc('0x44')](_0x6ed9d2,[_0xfefc('0x2f'),_0x22a5f2])?_0x22a5f2:undefined;})['compact']()['value']();if(_0x2b3c46['Contact']){_0x61db0[_0xfefc('0x1c')]('Contact');}if(_0x2b3c46['User']){_0x61db0[_0xfefc('0x1c')](_0xfefc('0x40'));}if(_0x61db0['length']>0x0){_0x61db0['forEach'](function(_0x3511bd){if(_0x3511bd===_0xfefc('0x7')){_0x36d094[_0xfefc('0x42')](_0xfefc('0x45'),[][_0xfefc('0x46')](_0x2b3c46[_0x3511bd]));}else if(_0x3511bd==='Contact'){var _0x35210c='%'+_0x2b3c46[_0x3511bd]+'%';_0x36d094['and'](_0xfefc('0x47'),_0x35210c);}else if(_0x3511bd===_0xfefc('0x40')){_0x36d094[_0xfefc('0x42')](_0xfefc('0x43'),_0x2b3c46[_0x3511bd]);}else{_0x36d094['and']('c.'+_0x3511bd+_0xfefc('0x48'),_0x2b3c46[_0x3511bd]);}});}return _0x36d094;}function parseQueryParameters(_0x530c53,_0x394c2c){var _0x1e7a6a=getSqlClauses();return Promise['resolve']()['then'](function(){return parseModelFields(_0x530c53,_0x394c2c);})[_0xfefc('0x49')](function(_0x40bb93){_0x1e7a6a[_0xfefc('0x4a')][_0xfefc('0x42')](_0x40bb93);return parseTagParameter(_0x530c53[_0xfefc('0x4b')]);})['then'](function(_0x132b6e){_0x1e7a6a[_0xfefc('0x3e')][_0xfefc('0x3d')][_0xfefc('0x42')](_0x132b6e);return parseSearchFilter(_0x530c53[_0xfefc('0x4c')]);})[_0xfefc('0x49')](function(_0x3857ab){_0x1e7a6a[_0xfefc('0x4c')]=_0x3857ab;return _0x1e7a6a;});}function checkListsRestrictions(_0x2c0020,_0x2ed854,_0x13b29a){var _0x11490e=squel[_0xfefc('0x20')]();return Promise[_0xfefc('0x4d')]()['then'](function(){if(_0x2ed854[_0xfefc('0x6')]&&_0x2c0020[_0xfefc('0x4')]===_0xfefc('0x5')&&!_0x13b29a){return _0x2c0020[_0xfefc('0x4e')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x4b6ba1){if(_0x4b6ba1){if(_0x4b6ba1['length']===0x0){_0x11490e[_0xfefc('0x42')](_0xfefc('0x4f'));}else{_0x11490e[_0xfefc('0x42')]('c.ListId\x20IN\x20?',_[_0xfefc('0x3c')](_0x4b6ba1,'id'));}}})['then'](function(){return _0x11490e;});}function buildContactsQuery(_0x371759,_0x1ff8b0,_0x16c1d7,_0xad634e,_0xffe268,_0x32acbf){if(_0x1ff8b0){_0x1ff8b0=_0x16c1d7[_0xfefc('0x50')];}_0x371759=addFieldsToQuery(_0x371759,_0x1ff8b0,_0xad634e,_0x32acbf,!![]);var _0x4b3d26=squel[_0xfefc('0x51')]();_0x4b3d26=addFieldsToQuery(_0x4b3d26,_0x1ff8b0,_0xad634e,_0x32acbf,![]);if(_0xad634e||_0x32acbf){_0x371759=applyJoinClauses(_0x371759,!![]);_0x371759[_0xfefc('0x52')](_0xfefc('0x53'));if(_0x16c1d7['limit']){_0x4b3d26[_0xfefc('0x54')](_0x16c1d7[_0xfefc('0x54')]);}if(_0x16c1d7[_0xfefc('0x55')]){_0x4b3d26[_0xfefc('0x55')](_0x16c1d7[_0xfefc('0x55')]);}}else{_0x4b3d26=applyJoinClauses(_0x4b3d26,![]);_0x4b3d26[_0xfefc('0x52')](_0xfefc('0x56'));if(_0x16c1d7[_0xfefc('0x54')]){_0x371759[_0xfefc('0x54')](_0x16c1d7[_0xfefc('0x54')]);}if(_0x16c1d7[_0xfefc('0x55')]){_0x371759[_0xfefc('0x55')](_0x16c1d7['offset']);}}_0x4b3d26[_0xfefc('0x57')](_0xffe268);if(_0x16c1d7[_0xfefc('0x58')]){_0x16c1d7[_0xfefc('0x58')][_0xfefc('0x1d')](function(_0x462ec1){_0x371759['order']('c.'+_0x462ec1[0x0],_0x462ec1[0x1]===_0xfefc('0x59')?![]:!![]);_0x4b3d26[_0xfefc('0x58')](_0xfefc('0x5a')+_0x462ec1[0x0],_0x462ec1[0x1]===_0xfefc('0x59')?![]:!![]);});}_0x4b3d26[_0xfefc('0x9')](_0x371759,_0xfefc('0x12'));return _0x4b3d26;}function getFilteredContacts(_0x23bc45){var _0xc2b839=[];return db['Tag']['findAll']({'attributes':['id','name',_0xfefc('0x5b')],'raw':!![]})['then'](function(_0x318340){_0xc2b839=_[_0xfefc('0x5c')](_0x318340,'id');var _0x256f85={'type':db[_0xfefc('0x5d')][_0xfefc('0x5e')][_0xfefc('0x5f')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xfefc('0x60')][_0xfefc('0x61')](_0x23bc45['toString'](),_0x256f85);})[_0xfefc('0x49')](function(_0x29d94a){_0x29d94a['forEach'](function(_0x502e11){if(_0x502e11[_0xfefc('0x1a')]){_0x502e11[_0xfefc('0x62')]=[];_0x502e11[_0xfefc('0x1a')][_0xfefc('0x24')](',')[_0xfefc('0x1d')](function(_0x2c766d){_0x502e11[_0xfefc('0x62')][_0xfefc('0x1c')](_0xc2b839[_0x2c766d]);});}delete _0x502e11['TagIds'];});return _0x29d94a;});}function countFilteredContacts(_0x5c529c,_0x579b2b){var _0x520ab8=_0x5c529c[_0xfefc('0x63')]();_0x520ab8[_0xfefc('0x1e')](_0xfefc('0x64'));_0x520ab8=applyJoinClauses(_0x520ab8,!![]);_0x5c529c[_0xfefc('0x52')]('c.id');var _0x54d1e8=utils[_0xfefc('0x21')](_0x579b2b);if(!_[_0xfefc('0x65')](_0x54d1e8)){_0x520ab8[_0xfefc('0xa')]('t.id\x20IN\x20?',_0x54d1e8);}var _0x465b38={'type':db[_0xfefc('0x5d')]['QueryTypes'][_0xfefc('0x5f')],'raw':!![]};return db['sequelize'][_0xfefc('0x61')](_0x520ab8[_0xfefc('0x66')](),_0x465b38)[_0xfefc('0x49')](function(_0x1b98b3){return _0x1b98b3[0x0][_0xfefc('0x64')];});}module[_0xfefc('0x67')]={'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 cac9056..0eed608 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 _0xd622=['hasOwnProperty','createReadStream','createWriteStream','data','update','binary','write','end','final','unlink','decryptFile','createDecipher','close','encryptString','createCipher','base64','decryptString','utf8','crypto','../../config/environment','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','test','getCiphers','filter'];(function(_0x293440,_0x357eff){var _0x596af9=function(_0x37d50c){while(--_0x37d50c){_0x293440['push'](_0x293440['shift']());}};_0x596af9(++_0x357eff);}(_0xd622,0x172));var _0x2d62=function(_0x568280,_0x59017a){_0x568280=_0x568280-0x0;var _0x2c5afc=_0xd622[_0x568280];return _0x2c5afc;};'use strict';var crypto=require(_0x2d62('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x2d62('0x1'));var logger=require('../../config/logger')(_0x2d62('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x2d62('0x3')][_0x2d62('0x4')],'algorithm':_0x2d62('0x5')};const fileOptions={'algorithm':_0x2d62('0x6')};if(config[_0x2d62('0x7')]&&config['encrypt'][_0x2d62('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x2d62('0x8')]);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0x2d62('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x2d62('0x9')](',\x20');logger[_0x2d62('0xa')](config[_0x2d62('0x7')][_0x2d62('0x8')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x31f7ba){return AES_SUPPORTED_RX[_0x2d62('0xb')](_0x31f7ba);}function getSupportedCiphers(){return crypto[_0x2d62('0xc')]()[_0x2d62('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0xa8ef8b){return getSupportedCiphers()['indexOf'](_0xa8ef8b)>-0x1;}function combineOptions(_0x1022ab){var _0x593143={};for(var _0x22de57 in fileOptions){if(fileOptions['hasOwnProperty'](_0x22de57)){_0x593143[_0x22de57]=fileOptions[_0x22de57];}}if(_0x1022ab){for(var _0x1ef308 in _0x1022ab){if(_0x1022ab[_0x2d62('0xe')](_0x1ef308)){_0x593143[_0x1ef308]=_0x1022ab[_0x1ef308];}}}return _0x593143;}exports['encryptFile']=function(_0x316db5,_0x1efea8,_0x202a76,_0xd1b244){return new BPromise(function(_0x403956,_0x312526){_0xd1b244=combineOptions(_0xd1b244);var _0x1e0794=new Buffer(_0x202a76);var _0x46f71b=fs[_0x2d62('0xf')](_0x316db5);var _0x179ef1=fs[_0x2d62('0x10')](_0x1efea8);var _0x3d1100=crypto['createCipher'](_0xd1b244[_0x2d62('0x8')],_0x1e0794);_0x46f71b['on'](_0x2d62('0x11'),function(_0x30ee89){var _0x1f65c2=new Buffer(_0x3d1100[_0x2d62('0x12')](_0x30ee89),_0x2d62('0x13'));_0x179ef1[_0x2d62('0x14')](_0x1f65c2);});_0x46f71b['on'](_0x2d62('0x15'),function(){try{var _0x4da6a8=new Buffer(_0x3d1100[_0x2d62('0x16')]('binary'),_0x2d62('0x13'));_0x179ef1[_0x2d62('0x14')](_0x4da6a8);_0x179ef1[_0x2d62('0x15')]();_0x179ef1['on']('close',function(){return _0x403956(_0x1efea8);});}catch(_0x29e0c7){fs[_0x2d62('0x17')](_0x1efea8);return _0x312526(_0x29e0c7);}});});};exports[_0x2d62('0x18')]=function(_0x429593,_0x187250,_0x29f5f4,_0x4cbe5a){return new BPromise(function(_0x115d77,_0x402a9b){_0x4cbe5a=combineOptions(_0x4cbe5a);var _0x53c0d8=new Buffer(_0x29f5f4);var _0x2d425e=fs['createReadStream'](_0x429593);var _0x219bb7=fs[_0x2d62('0x10')](_0x187250);var _0x46bb94=crypto[_0x2d62('0x19')](_0x4cbe5a[_0x2d62('0x8')],_0x53c0d8);_0x2d425e['on'](_0x2d62('0x11'),function(_0x46b654){var _0x1a0d68=new Buffer(_0x46bb94['update'](_0x46b654),_0x2d62('0x13'));_0x219bb7[_0x2d62('0x14')](_0x1a0d68);});_0x2d425e['on'](_0x2d62('0x15'),function(){try{var _0x5d9fc3=new Buffer(_0x46bb94[_0x2d62('0x16')](_0x2d62('0x13')),_0x2d62('0x13'));_0x219bb7['write'](_0x5d9fc3);_0x219bb7[_0x2d62('0x15')]();_0x219bb7['on'](_0x2d62('0x1a'),function(){return _0x115d77(_0x187250);});}catch(_0x4dc3f2){fs[_0x2d62('0x17')](_0x187250);return _0x402a9b(_0x4dc3f2);}});});};exports[_0x2d62('0x1b')]=function(_0x16a0ca,_0x4f7630,_0x3e2f5d){var _0x35746c=_0x3e2f5d||stringOptions['algorithm'];var _0x355081=_0x4f7630||stringOptions['secret'];var _0x3d431e=crypto[_0x2d62('0x1c')](_0x35746c,_0x355081);var _0x3147ea=_0x3d431e['update'](_0x16a0ca,'utf8',_0x2d62('0x1d'));_0x3147ea+=_0x3d431e[_0x2d62('0x16')](_0x2d62('0x1d'));return _0x3147ea;};exports[_0x2d62('0x1e')]=function(_0x48ac04,_0x1fbe9c,_0x5ce521){var _0x9f60e0=_0x5ce521||stringOptions[_0x2d62('0x8')];var _0x4e3e5b=_0x1fbe9c||stringOptions['secret'];var _0x19dfc8=crypto[_0x2d62('0x19')](_0x9f60e0,_0x4e3e5b);var _0x4d4f34=_0x19dfc8['update'](_0x48ac04,_0x2d62('0x1d'),_0x2d62('0x1f'));_0x4d4f34+=_0x19dfc8[_0x2d62('0x16')](_0x2d62('0x1f'));return _0x4d4f34;}; \ No newline at end of file +var _0x5838=['encryptString','createCipher','utf8','base64','decryptString','secret','crypto','bluebird','lodash','../../config/environment','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','write','end','final','binary','close','unlink','createDecipher'];(function(_0x58c8f3,_0x15d60c){var _0x3bcfb9=function(_0x463b1c){while(--_0x463b1c){_0x58c8f3['push'](_0x58c8f3['shift']());}};_0x3bcfb9(++_0x15d60c);}(_0x5838,0x6c));var _0x8583=function(_0x520822,_0x208b36){_0x520822=_0x520822-0x0;var _0x3d8cb6=_0x5838[_0x520822];return _0x3d8cb6;};'use strict';var crypto=require(_0x8583('0x0'));var fs=require('fs');var BPromise=require(_0x8583('0x1'));var _=require(_0x8583('0x2'));var config=require(_0x8583('0x3'));var logger=require('../../config/logger')('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x8583('0x4')][_0x8583('0x5')],'algorithm':_0x8583('0x6')};const fileOptions={'algorithm':_0x8583('0x7')};if(config['encrypt']&&config['encrypt']['algorithm']){var isSupported=isAlgorithmSupported(config[_0x8583('0x8')][_0x8583('0x9')]);if(isSupported){fileOptions[_0x8583('0x9')]=config[_0x8583('0x8')][_0x8583('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x8583('0xa')](',\x20');logger[_0x8583('0xb')](config[_0x8583('0x8')][_0x8583('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x4b56b1){return AES_SUPPORTED_RX[_0x8583('0xc')](_0x4b56b1);}function getSupportedCiphers(){return crypto[_0x8583('0xd')]()[_0x8583('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x14db96){return getSupportedCiphers()['indexOf'](_0x14db96)>-0x1;}function combineOptions(_0x5bd0b2){var _0x451e06={};for(var _0x1fd6e1 in fileOptions){if(fileOptions['hasOwnProperty'](_0x1fd6e1)){_0x451e06[_0x1fd6e1]=fileOptions[_0x1fd6e1];}}if(_0x5bd0b2){for(var _0x607612 in _0x5bd0b2){if(_0x5bd0b2[_0x8583('0xf')](_0x607612)){_0x451e06[_0x607612]=_0x5bd0b2[_0x607612];}}}return _0x451e06;}exports[_0x8583('0x10')]=function(_0x2fe57a,_0x408327,_0x195b85,_0x6100){return new BPromise(function(_0x5b55be,_0x1c91b3){_0x6100=combineOptions(_0x6100);var _0x385d6f=new Buffer(_0x195b85);var _0x70bf14=fs[_0x8583('0x11')](_0x2fe57a);var _0x5cf9a7=fs[_0x8583('0x12')](_0x408327);var _0x57d219=crypto['createCipher'](_0x6100[_0x8583('0x9')],_0x385d6f);_0x70bf14['on'](_0x8583('0x13'),function(_0x211197){var _0x245fec=new Buffer(_0x57d219[_0x8583('0x14')](_0x211197),'binary');_0x5cf9a7[_0x8583('0x15')](_0x245fec);});_0x70bf14['on'](_0x8583('0x16'),function(){try{var _0x3cc42b=new Buffer(_0x57d219[_0x8583('0x17')](_0x8583('0x18')),_0x8583('0x18'));_0x5cf9a7['write'](_0x3cc42b);_0x5cf9a7[_0x8583('0x16')]();_0x5cf9a7['on'](_0x8583('0x19'),function(){return _0x5b55be(_0x408327);});}catch(_0x5a229f){fs[_0x8583('0x1a')](_0x408327);return _0x1c91b3(_0x5a229f);}});});};exports['decryptFile']=function(_0x4a4250,_0x14be2a,_0x59788e,_0x2a8e0f){return new BPromise(function(_0x4d419e,_0xb02c32){_0x2a8e0f=combineOptions(_0x2a8e0f);var _0x38dc6e=new Buffer(_0x59788e);var _0x5adbd0=fs[_0x8583('0x11')](_0x4a4250);var _0x5aef95=fs[_0x8583('0x12')](_0x14be2a);var _0x233ec2=crypto[_0x8583('0x1b')](_0x2a8e0f[_0x8583('0x9')],_0x38dc6e);_0x5adbd0['on'](_0x8583('0x13'),function(_0x54e199){var _0x2205ab=new Buffer(_0x233ec2[_0x8583('0x14')](_0x54e199),_0x8583('0x18'));_0x5aef95['write'](_0x2205ab);});_0x5adbd0['on'](_0x8583('0x16'),function(){try{var _0x4dd0d0=new Buffer(_0x233ec2[_0x8583('0x17')](_0x8583('0x18')),_0x8583('0x18'));_0x5aef95[_0x8583('0x15')](_0x4dd0d0);_0x5aef95[_0x8583('0x16')]();_0x5aef95['on'](_0x8583('0x19'),function(){return _0x4d419e(_0x14be2a);});}catch(_0x3e3ef1){fs['unlink'](_0x14be2a);return _0xb02c32(_0x3e3ef1);}});});};exports[_0x8583('0x1c')]=function(_0x3ad5e7,_0x540c96,_0x2a3b65){var _0x292174=_0x2a3b65||stringOptions[_0x8583('0x9')];var _0x53d817=_0x540c96||stringOptions['secret'];var _0x5865aa=crypto[_0x8583('0x1d')](_0x292174,_0x53d817);var _0x4dd182=_0x5865aa[_0x8583('0x14')](_0x3ad5e7,_0x8583('0x1e'),_0x8583('0x1f'));_0x4dd182+=_0x5865aa[_0x8583('0x17')]('base64');return _0x4dd182;};exports[_0x8583('0x20')]=function(_0x51f5c3,_0xd6970d,_0x32015d){var _0x1aa339=_0x32015d||stringOptions[_0x8583('0x9')];var _0x326f5b=_0xd6970d||stringOptions[_0x8583('0x21')];var _0x39a8ad=crypto[_0x8583('0x1b')](_0x1aa339,_0x326f5b);var _0xa16022=_0x39a8ad[_0x8583('0x14')](_0x51f5c3,_0x8583('0x1f'),'utf8');_0xa16022+=_0x39a8ad[_0x8583('0x17')](_0x8583('0x1e'));return _0xa16022;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 65294c6..a10bd51 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 _0x2638=['util','path','lodash','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','num','Empty','split','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.csv','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit'];(function(_0x302e89,_0x392aa6){var _0x3f93c7=function(_0xaa956e){while(--_0xaa956e){_0x302e89['push'](_0x302e89['shift']());}};_0x3f93c7(++_0x392aa6);}(_0x2638,0x6a));var _0x8263=function(_0x469ae2,_0x24cd30){_0x469ae2=_0x469ae2-0x0;var _0x5e33e4=_0x2638[_0x469ae2];return _0x5e33e4;};'use strict';var util=require(_0x8263('0x0'));var path=require(_0x8263('0x1'));var _=require(_0x8263('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x8263('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x8263('0x4'));var db=require(_0x8263('0x5'))['db'];var dbH=require(_0x8263('0x5'))[_0x8263('0x6')];var logger=require(_0x8263('0x7'))(_0x8263('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x8263('0x9')][0x2]);var QUERY=process[_0x8263('0x9')][0x3];var PATH=process[_0x8263('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xa62782,_0x329687){var _0x1ec9b1={'status':_0xa62782};var _0x3ca0c7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x329687){_0x1ec9b1[_0x8263('0xa')]=_0x329687;}return db[_0x8263('0xb')][_0x8263('0xc')](_0x1ec9b1,_0x3ca0c7);}function main(){var _0x24381a=0x1388;var _0xdb4f58;logger[_0x8263('0xd')](util[_0x8263('0xe')](_0x8263('0xf'),EXTRACTED_REPORT_ID,_0x8263('0x10')));return db[_0x8263('0x11')][_0x8263('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x8263('0x13')]})[_0x8263('0x14')](function(_0x3a2b7e){if(_0x3a2b7e){_0xdb4f58=_0x3a2b7e;_0x24381a=_0xdb4f58[_0x8263('0x13')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x8263('0x15')](util[_0x8263('0xe')](_0x8263('0x16'),QUERY),{'type':dbH[_0x8263('0x17')]['QueryTypes']['SELECT']});})[_0x8263('0x14')](function(_0x4b33cd){if(!_0x4b33cd[0x0][_0x8263('0x18')]){return analyticExtractedReport(_0x8263('0x19'));}var _0x6f3b65=[];var _0x6a9c1c=0x0;if(_0xdb4f58[_0x8263('0x1a')]){if(_0x4b33cd&&_0x4b33cd[_0x8263('0x1b')]){var _0xb5469a=_[_0x8263('0x1c')](_0x4b33cd[0x0][_0x8263('0x18')]/_0x24381a);var _0x4ee1d1=Number['isInteger'](_0x4b33cd[0x0][_0x8263('0x18')]/_0x24381a)?_0x4b33cd[0x0]['num']%_0x24381a:0x0;_0xb5469a[_0x8263('0x1d')](function(_0x1c1aa5){if(_0x1c1aa5>0x0){_0x6a9c1c+=_0x24381a;}_0x6f3b65['push'](dbH[_0x8263('0x17')][_0x8263('0x15')](util[_0x8263('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x24381a,_0x6a9c1c),{'type':dbH[_0x8263('0x17')]['QueryTypes']['SELECT']}));});if(_0x4ee1d1>0x0){_0x6a9c1c+=_0x24381a;_0x6f3b65[_0x8263('0x1e')](dbH[_0x8263('0x17')][_0x8263('0x15')](util['format'](_0x8263('0x1f'),QUERY,_0x4ee1d1,_0x6a9c1c),{'type':dbH[_0x8263('0x17')][_0x8263('0x20')]['SELECT']}));}}}else{_0x6f3b65[_0x8263('0x1e')](dbH['sequelize'][_0x8263('0x15')](QUERY,{'type':dbH[_0x8263('0x17')][_0x8263('0x20')][_0x8263('0x21')]}));}var _0x53a3d1=path[_0x8263('0x22')](PATH);var _0x56eb77=path[_0x8263('0x23')](PATH,_0x8263('0x24'));var _0x241231=_0xdb4f58[_0x8263('0x1a')]&&_0x6f3b65[_0x8263('0x1b')]>0x1;var _0x4de2c8=[];if(!fs['existsSync'](path[_0x8263('0x25')](_0x53a3d1,_0x56eb77))&&_0x241231){fs['mkdirSync'](path[_0x8263('0x25')](_0x53a3d1,_0x56eb77));}return BPromise[_0x8263('0x26')](_0x6f3b65,function(_0x28e3ab){_0x4de2c8['push'](_0x28e3ab);})[_0x8263('0x14')](function(){for(var _0x18e64a=0x0;_0x18e64a<_0x4de2c8[_0x8263('0x1b')];_0x18e64a+=0x1){var _0x1c6260;var _0x4fa399=_0x4de2c8[_0x18e64a];if(_0x241231){_0x1c6260=path['join'](_0x53a3d1,_0x56eb77,util[_0x8263('0xe')](_0x8263('0x27'),_0x56eb77,_0x18e64a,_0x8263('0x28')));}else{_0x1c6260=path['join'](_0x53a3d1,util[_0x8263('0xe')](_0x8263('0x29'),_0x56eb77,_0x8263('0x28')));}fs[_0x8263('0x2a')](_0x1c6260,csv(_0x4fa399));}})[_0x8263('0x14')](function(){if(_0x241231){return new Promise(function(_0x415ed5){zipdir(path[_0x8263('0x25')](_0x53a3d1,_0x56eb77),{'saveTo':path[_0x8263('0x25')](_0x53a3d1,util[_0x8263('0xe')](_0x8263('0x29'),_0x56eb77,_0x8263('0x2b')))},function(_0x24bfad,_0x48c29e){rimraf(path[_0x8263('0x25')](_0x53a3d1,_0x56eb77),function(){});_0x415ed5(_0x8263('0x2c'));});});}})['then'](function(){logger[_0x8263('0xd')](util[_0x8263('0xe')](_0x8263('0x2d'),EXTRACTED_REPORT_ID,_0x8263('0x10')));return analyticExtractedReport(_0x8263('0x2e'),_0x241231?util['format'](_0x8263('0x29'),_0x56eb77,_0x241231?_0x8263('0x2b'):'csv'):null);});})[_0x8263('0x2f')](function(_0xfdf848){logger[_0x8263('0xd')](util[_0x8263('0xe')](_0x8263('0x30'),EXTRACTED_REPORT_ID,'CSV'),util[_0x8263('0x31')](_0xfdf848,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8263('0x32'));})[_0x8263('0x33')](function(){process[_0x8263('0x34')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xbe96=['query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','existsSync','join','each','%s.%s','csv','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','catch','inspect','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','then','splitSizeCsv','sequelize'];(function(_0x51bb38,_0x4e57a0){var _0x51c09b=function(_0x3321e2){while(--_0x3321e2){_0x51bb38['push'](_0x51bb38['shift']());}};_0x51c09b(++_0x4e57a0);}(_0xbe96,0xd6));var _0x6be9=function(_0x2050bf,_0x487981){_0x2050bf=_0x2050bf-0x0;var _0x210dc9=_0xbe96[_0x2050bf];return _0x210dc9;};'use strict';var util=require(_0x6be9('0x0'));var path=require(_0x6be9('0x1'));var _=require(_0x6be9('0x2'));var csv=require(_0x6be9('0x3'));var fs=require('fs');var BPromise=require(_0x6be9('0x4'));var zipdir=require(_0x6be9('0x5'));var rimraf=require(_0x6be9('0x6'));var db=require(_0x6be9('0x7'))['db'];var dbH=require(_0x6be9('0x7'))[_0x6be9('0x8')];var logger=require(_0x6be9('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x6be9('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x6be9('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x13cd31,_0xe95c0b){var _0x3c46cf={'status':_0x13cd31};var _0x1742e2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xe95c0b){_0x3c46cf[_0x6be9('0xb')]=_0xe95c0b;}return db['AnalyticExtractedReport']['update'](_0x3c46cf,_0x1742e2);}function main(){var _0x145b5d=0x1388;var _0x4892c9;logger[_0x6be9('0xc')](util[_0x6be9('0xd')](_0x6be9('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x6be9('0xf')][_0x6be9('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6be9('0x11'),'splitSizeCsv']})[_0x6be9('0x12')](function(_0x4f46fa){if(_0x4f46fa){_0x4892c9=_0x4f46fa;_0x145b5d=_0x4892c9[_0x6be9('0x13')]||0x1388;}})[_0x6be9('0x12')](function(){return dbH[_0x6be9('0x14')][_0x6be9('0x15')](util['format'](_0x6be9('0x16'),QUERY),{'type':dbH[_0x6be9('0x14')][_0x6be9('0x17')][_0x6be9('0x18')]});})[_0x6be9('0x12')](function(_0x52f343){if(!_0x52f343[0x0]['num']){return analyticExtractedReport('Empty');}var _0x5b1865=[];var _0x11fd37=0x0;if(_0x4892c9[_0x6be9('0x11')]){if(_0x52f343&&_0x52f343[_0x6be9('0x19')]){var _0x21dd46=_[_0x6be9('0x1a')](_0x52f343[0x0][_0x6be9('0x1b')]/_0x145b5d);var _0xcd22=Number[_0x6be9('0x1c')](_0x52f343[0x0][_0x6be9('0x1b')]/_0x145b5d)?_0x52f343[0x0][_0x6be9('0x1b')]%_0x145b5d:0x0;_0x21dd46[_0x6be9('0x1d')](function(_0x35ce95){if(_0x35ce95>0x0){_0x11fd37+=_0x145b5d;}_0x5b1865[_0x6be9('0x1e')](dbH['sequelize'][_0x6be9('0x15')](util[_0x6be9('0xd')](_0x6be9('0x1f'),QUERY,_0x145b5d,_0x11fd37),{'type':dbH['sequelize'][_0x6be9('0x17')]['SELECT']}));});if(_0xcd22>0x0){_0x11fd37+=_0x145b5d;_0x5b1865[_0x6be9('0x1e')](dbH['sequelize'][_0x6be9('0x15')](util[_0x6be9('0xd')](_0x6be9('0x1f'),QUERY,_0xcd22,_0x11fd37),{'type':dbH[_0x6be9('0x14')][_0x6be9('0x17')][_0x6be9('0x18')]}));}}}else{_0x5b1865[_0x6be9('0x1e')](dbH[_0x6be9('0x14')][_0x6be9('0x15')](QUERY,{'type':dbH[_0x6be9('0x14')]['QueryTypes'][_0x6be9('0x18')]}));}var _0xa29c31=path[_0x6be9('0x20')](PATH);var _0x151706=path['basename'](PATH,_0x6be9('0x21'));var _0x304360=_0x4892c9[_0x6be9('0x11')]&&_0x5b1865['length']>0x1;var _0x532b20=[];if(!fs[_0x6be9('0x22')](path[_0x6be9('0x23')](_0xa29c31,_0x151706))&&_0x304360){fs['mkdirSync'](path[_0x6be9('0x23')](_0xa29c31,_0x151706));}return BPromise[_0x6be9('0x24')](_0x5b1865,function(_0x2b81d5){_0x532b20[_0x6be9('0x1e')](_0x2b81d5);})['then'](function(){for(var _0x36af64=0x0;_0x36af64<_0x532b20[_0x6be9('0x19')];_0x36af64+=0x1){var _0xf170fc;var _0x1400b3=_0x532b20[_0x36af64];if(_0x304360){_0xf170fc=path[_0x6be9('0x23')](_0xa29c31,_0x151706,util[_0x6be9('0xd')]('%s%d.%s',_0x151706,_0x36af64,'csv'));}else{_0xf170fc=path[_0x6be9('0x23')](_0xa29c31,util[_0x6be9('0xd')](_0x6be9('0x25'),_0x151706,_0x6be9('0x26')));}fs[_0x6be9('0x27')](_0xf170fc,csv(_0x1400b3));}})[_0x6be9('0x12')](function(){if(_0x304360){return new Promise(function(_0x2d3d7c){zipdir(path[_0x6be9('0x23')](_0xa29c31,_0x151706),{'saveTo':path[_0x6be9('0x23')](_0xa29c31,util[_0x6be9('0xd')]('%s.%s',_0x151706,_0x6be9('0x28')))},function(_0x477ddb,_0xf6918e){rimraf(path[_0x6be9('0x23')](_0xa29c31,_0x151706),function(){});_0x2d3d7c(_0x6be9('0x29'));});});}})[_0x6be9('0x12')](function(){logger['info'](util[_0x6be9('0xd')](_0x6be9('0x2a'),EXTRACTED_REPORT_ID,_0x6be9('0x2b')));return analyticExtractedReport('Completed',_0x304360?util[_0x6be9('0xd')](_0x6be9('0x25'),_0x151706,_0x304360?'zip':_0x6be9('0x26')):null);});})[_0x6be9('0x2c')](function(_0x4b2826){logger['info'](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util[_0x6be9('0x2d')](_0x4b2826,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x6be9('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 7a9f850..4a13bb8 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 _0xc696=['endDate','header','pageBreak','before','landscape','toString','\x20/\x20','Arial','black','right','num','Empty','find','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','.pdf','join','each','createPdfKitDocument','%s.%s','zip\x20finished','Completed','pdf','PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','info','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','error','end','createPdfFromHTML','path','lodash','util','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','pick','value','length','body','push','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xc696,0x17e));var _0x6c69=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xc696[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x6c69('0x0'));var fs=require('fs');var util=require(_0x6c69('0x1'));var path=require('path');var moment=require('moment');var htmlToPdfmake=require(_0x6c69('0x2'));var PdfPrinter=require(_0x6c69('0x3'));var zipdir=require(_0x6c69('0x4'));var rimraf=require(_0x6c69('0x5'));var JSDOM=require('jsdom')[_0x6c69('0x6')];var window=new JSDOM('')[_0x6c69('0x7')];var BPromise=require(_0x6c69('0x8'));var db=require(_0x6c69('0x9'))['db'];var dbH=require(_0x6c69('0x9'))[_0x6c69('0xa')];var logger=require(_0x6c69('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x6c69('0xc')][0x2]);var QUERY=process[_0x6c69('0xc')][0x3];var PATH=process[_0x6c69('0xc')][0x4];var NAME=process[_0x6c69('0xc')][0x5];var FORMAT=_0x6c69('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4aa216,_0x3c64d8){var _0x4462d2={'status':_0x4aa216};var _0x1d006a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3c64d8){_0x4462d2['savename']=_0x3c64d8;}return db[_0x6c69('0xe')][_0x6c69('0xf')](_0x4462d2,_0x1d006a);}function getHeaders(_0x3c091c){return _[_0x6c69('0x10')](_0x3c091c,function(_0x49e0e3){return{'text':_0x49e0e3,'style':_0x6c69('0x11')};});}function getRows(_0xbd0246,_0x3a6696){return _[_0x6c69('0x10')](_0x3a6696,function(_0x4235aa){return _(_0x4235aa)[_0x6c69('0x12')](_0xbd0246)['map'](function(_0x1cc418){return _0x1cc418?_['toString'](_0x1cc418):'';})[_0x6c69('0x13')]();});}function createTable(_0x106e40,_0xfe76de){var _0x27898f={'widths':_['fill'](Array(_0x106e40[_0x6c69('0x14')]),0x91),'heights':function(_0x29685d){return _0x29685d===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x44d958=getHeaders(_0x106e40);_0x27898f[_0x6c69('0x15')][_0x6c69('0x16')](_0x44d958);var _0x26ff2d=getRows(_0x106e40,_0xfe76de);_0x27898f[_0x6c69('0x15')]=_0x27898f['body']['concat'](_0x26ff2d);return _0x27898f;}function createTables(_0x4557c5){var _0xc255aa=[];var _0x4a3004=_['chunk'](Object[_0x6c69('0x17')](_0x4557c5[0x0]),0x5);_0x4a3004[_0x6c69('0x18')](function(_0x26ed27){_0xc255aa[_0x6c69('0x16')](createTable(_0x26ed27,_0x4557c5));});return _0xc255aa;}function getPDFDocDefinition(_0x114c98){var _0x39baf8=util[_0x6c69('0x19')](_0x6c69('0x1a'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x6c69('0x1b')])[_0x6c69('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0x6c69('0x1c')])[_0x6c69('0x19')](FORMAT));var _0x5d6b35=[];for(var _0x20ae6b=0x0;_0x20ae6b<_0x114c98[_0x6c69('0x14')];_0x20ae6b++){var _0x23d0d5=[];if(_0x20ae6b===0x0){_0x23d0d5[_0x6c69('0x16')]({'text':_0x39baf8,'style':_0x6c69('0x1d')});}var _0x20408b={'table':_0x114c98[_0x20ae6b]};if(_0x20ae6b>0x0){_0x20408b[_0x6c69('0x1e')]=_0x6c69('0x1f');_0x20408b['margin']=[0x0,0x46,0x0,0x0];}_0x23d0d5[_0x6c69('0x16')](_0x20408b);_0x5d6b35[_0x6c69('0x16')](_0x23d0d5);}return{'pageSize':'A4','pageOrientation':_0x6c69('0x20'),'content':_0x5d6b35,'footer':function(_0x4d7032,_0x364653){return{'text':_0x4d7032[_0x6c69('0x21')]()+_0x6c69('0x22')+_0x364653,'style':'footer'};},'defaultStyle':{'font':_0x6c69('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x6c69('0x24')},'footer':{'alignment':_0x6c69('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5bba9c){var _0x56943e=0x1388;var _0x316761;if(!_0x5bba9c[0x0][_0x6c69('0x26')]){return analyticExtractedReport(_0x6c69('0x27'));}return db['Setting'][_0x6c69('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6c69('0x29'),_0x6c69('0x2a')]})[_0x6c69('0x2b')](function(_0xede76){if(_0xede76){_0x316761=_0xede76;_0x56943e=_0x316761['splitSizePdf']||0x3e8;}})[_0x6c69('0x2b')](function(){var _0x5d0f3e=[];var _0x5cde24=0x0;if(_0x316761[_0x6c69('0x29')]){if(_0x5bba9c&&_0x5bba9c[_0x6c69('0x14')]){var _0x3b87b5=_[_0x6c69('0x2c')](_0x5bba9c[0x0][_0x6c69('0x26')]/_0x56943e);var _0x5172cf=Number[_0x6c69('0x2d')](_0x5bba9c[0x0][_0x6c69('0x26')]/_0x56943e)?_0x5bba9c[0x0]['num']%_0x56943e:0x0;_0x3b87b5[_0x6c69('0x18')](function(_0x2988ef){if(_0x2988ef>0x0){_0x5cde24+=_0x56943e;}_0x5d0f3e[_0x6c69('0x16')](dbH[_0x6c69('0x2e')][_0x6c69('0x2f')](util['format'](_0x6c69('0x30'),QUERY,_0x56943e,_0x5cde24),{'type':dbH[_0x6c69('0x2e')]['QueryTypes'][_0x6c69('0x31')]}));});if(_0x5172cf>0x0){_0x5cde24+=_0x56943e;_0x5d0f3e['push'](dbH[_0x6c69('0x2e')][_0x6c69('0x2f')](util[_0x6c69('0x19')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5172cf,_0x5cde24),{'type':dbH[_0x6c69('0x2e')][_0x6c69('0x32')][_0x6c69('0x31')]}));}}}else{_0x5d0f3e[_0x6c69('0x16')](dbH['sequelize'][_0x6c69('0x2f')](QUERY,{'type':dbH[_0x6c69('0x2e')][_0x6c69('0x32')][_0x6c69('0x31')]}));}var _0x4f70aa=path[_0x6c69('0x33')](PATH);var _0xb65c70=path['basename'](PATH,_0x6c69('0x34'));var _0x4e6932=_0x316761[_0x6c69('0x29')]&&_0x5d0f3e[_0x6c69('0x14')]>0x1;var _0x125713=[];if(!fs['existsSync'](path['join'](_0x4f70aa,_0xb65c70))&&_0x4e6932){fs['mkdirSync'](path[_0x6c69('0x35')](_0x4f70aa,_0xb65c70));}return BPromise[_0x6c69('0x36')](_0x5d0f3e,function(_0x40c1e4){_0x125713['push'](_0x40c1e4);})[_0x6c69('0x2b')](function(){var _0x4306a2=[];for(var _0x5c28e2=0x0;_0x5c28e2<_0x125713['length'];_0x5c28e2+=0x1){var _0x511f12=_0x125713[_0x5c28e2];var _0x206711=createTables(_['flatten'](_0x511f12));var _0x351f3d;var _0x1483e2=getPDFDocDefinition(_0x206711);var _0x589671=getPDFPrinter();var _0x4b6228=_0x589671[_0x6c69('0x37')](_0x1483e2);if(_0x4e6932){_0x351f3d=path['join'](_0x4f70aa,_0xb65c70,util[_0x6c69('0x19')]('%s%d.%s',_0xb65c70,_0x5c28e2,'pdf'));}else{_0x351f3d=path[_0x6c69('0x35')](_0x4f70aa,util['format']('%s.%s',_0xb65c70,'pdf'));}_0x4306a2['push'](writePDFDocument(_0x4b6228,_0x351f3d));}return Promise['all'](_0x4306a2);})['then'](function(){if(_0x4e6932){return new Promise(function(_0x326c94){zipdir(path[_0x6c69('0x35')](_0x4f70aa,_0xb65c70),{'saveTo':path[_0x6c69('0x35')](_0x4f70aa,util[_0x6c69('0x19')](_0x6c69('0x38'),_0xb65c70,'zip'))},function(){rimraf(path[_0x6c69('0x35')](_0x4f70aa,_0xb65c70),function(){});_0x326c94(_0x6c69('0x39'));});});}})[_0x6c69('0x2b')](function(){if(!_0x4e6932)return;rimraf(path[_0x6c69('0x35')](_0x4f70aa,_0xb65c70),function(){});})[_0x6c69('0x2b')](function(){logger['info'](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x6c69('0x3a'),_0x4e6932?util[_0x6c69('0x19')](_0x6c69('0x38'),_0xb65c70,_0x4e6932?'zip':_0x6c69('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x6c69('0x19')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6c69('0x3c')));return db[_0x6c69('0xe')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x2e9bac){EXTRACTED_REPORT=_0x2e9bac;return dbH[_0x6c69('0x2e')][_0x6c69('0x2f')](util[_0x6c69('0x19')](_0x6c69('0x3d'),QUERY),{'type':dbH[_0x6c69('0x2e')][_0x6c69('0x32')][_0x6c69('0x31')]});})['then'](extractReport)[_0x6c69('0x3e')](function(_0x2d6912){logger[_0x6c69('0x3f')](util[_0x6c69('0x19')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x2d6912,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6c69('0x40'));})[_0x6c69('0x41')](function(){process[_0x6c69('0x42')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x12b6fa=new PdfPrinter({'Arial':{'normal':__dirname+_0x6c69('0x43'),'bold':__dirname+_0x6c69('0x44'),'italics':__dirname+_0x6c69('0x45'),'bolditalics':__dirname+_0x6c69('0x46')}});return _0x12b6fa;}function getPDFDocDefinitionFromHTML(_0x53243d,_0x219781){var _0xfcb699=util[_0x6c69('0x19')](_0x6c69('0x47'),_0x219781[_0x6c69('0x48')],_0x219781[_0x6c69('0x49')]);var _0x4b171c=moment()['format']('YYYY-MM-DD')[_0x6c69('0x21')]();var _0x42046e=htmlToPdfmake(_0x53243d,{'window':window,'tableAutoSize':!![]});return{'content':[_0x42046e],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x6c69('0x4a'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x6c69('0x4a'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x6c69('0x4a')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x6c69('0x1d')}];},'footer':function(_0x2d3de6,_0xe28cdd){return[{'text':util[_0x6c69('0x19')](_0x6c69('0x4b'),_0xfcb699,_0x2d3de6,_0xe28cdd,_0x4b171c),'style':'footer'}];}};}function writePDFDocument(_0xcd0107,_0x5bdadc){return new Promise(function(_0x22b214,_0xd8136d){var _0x1dadc1=_0xcd0107[_0x6c69('0x4c')](fs[_0x6c69('0x4d')](_0x5bdadc));_0x1dadc1['on']('finish',function(){_0x22b214('finish');});_0x1dadc1['on'](_0x6c69('0x4e'),function(_0x25ae62){_0xd8136d(_0x25ae62);});_0xcd0107[_0x6c69('0x4f')]();});}exports[_0x6c69('0x50')]=function(_0x2af004,_0x20df8b){var _0x4fa40d=getPDFPrinter();var _0x4ef58a=getPDFDocDefinitionFromHTML(_0x2af004,_0x20df8b);var _0x4e036e=_0x4fa40d['createPdfKitDocument'](_0x4ef58a);return writePDFDocument(_0x4e036e,_0x20df8b[_0x6c69('0x51')])[_0x6c69('0x3e')](function(_0x5c19df){throw _0x5c19df;});}; \ No newline at end of file +var _0x5007=['findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','createWriteStream','finish','error','end','createPdfFromHTML','catch','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','bluebird','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','map','tableHeader','toString','value','fill','length','auto','body','push','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','Arial','black','right','num','Empty','Setting','splitSizePdf','then','range','sequelize','SELECT','query','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.pdf','split','existsSync','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','%s.%s','pdf','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','PDF'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5007,0x1c4));var _0x7500=function(_0x4a99ab,_0xc1b539){_0x4a99ab=_0x4a99ab-0x0;var _0x1b3d67=_0x5007[_0x4a99ab];return _0x1b3d67;};'use strict';var _=require(_0x7500('0x0'));var fs=require('fs');var util=require(_0x7500('0x1'));var path=require(_0x7500('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x7500('0x3'));var PdfPrinter=require(_0x7500('0x4'));var zipdir=require(_0x7500('0x5'));var rimraf=require(_0x7500('0x6'));var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x7500('0x7'));var db=require(_0x7500('0x8'))['db'];var dbH=require(_0x7500('0x8'))['dbH'];var logger=require(_0x7500('0x9'))(_0x7500('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x7500('0xb')][0x2]);var QUERY=process[_0x7500('0xb')][0x3];var PATH=process[_0x7500('0xb')][0x4];var NAME=process[_0x7500('0xb')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x39cdc5,_0xeaa09b){var _0x5373d1={'status':_0x39cdc5};var _0x2a8be0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xeaa09b){_0x5373d1[_0x7500('0xc')]=_0xeaa09b;}return db[_0x7500('0xd')]['update'](_0x5373d1,_0x2a8be0);}function getHeaders(_0x20d197){return _[_0x7500('0xe')](_0x20d197,function(_0x45f2cf){return{'text':_0x45f2cf,'style':_0x7500('0xf')};});}function getRows(_0x51beee,_0x5854b4){return _[_0x7500('0xe')](_0x5854b4,function(_0x4cf0b8){return _(_0x4cf0b8)['pick'](_0x51beee)[_0x7500('0xe')](function(_0x4e7c9b){return _0x4e7c9b?_[_0x7500('0x10')](_0x4e7c9b):'';})[_0x7500('0x11')]();});}function createTable(_0xe84548,_0x4f1a39){var _0x59ec59={'widths':_[_0x7500('0x12')](Array(_0xe84548[_0x7500('0x13')]),0x91),'heights':function(_0x1c4da8){return _0x1c4da8===0x0?_0x7500('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x29fc0a=getHeaders(_0xe84548);_0x59ec59[_0x7500('0x15')][_0x7500('0x16')](_0x29fc0a);var _0x46166d=getRows(_0xe84548,_0x4f1a39);_0x59ec59[_0x7500('0x15')]=_0x59ec59[_0x7500('0x15')][_0x7500('0x17')](_0x46166d);return _0x59ec59;}function createTables(_0x2eb084){var _0x1d29b5=[];var _0x1df4cd=_[_0x7500('0x18')](Object['keys'](_0x2eb084[0x0]),0x5);_0x1df4cd[_0x7500('0x19')](function(_0x424db8){_0x1d29b5[_0x7500('0x16')](createTable(_0x424db8,_0x2eb084));});return _0x1d29b5;}function getPDFDocDefinition(_0x269e8d){var _0x1895a0=util[_0x7500('0x1a')](_0x7500('0x1b'),NAME,EXTRACTED_REPORT[_0x7500('0x1c')],moment(EXTRACTED_REPORT[_0x7500('0x1d')])[_0x7500('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x7500('0x1e')])['format'](FORMAT));var _0x41c61b=[];for(var _0x4eba12=0x0;_0x4eba12<_0x269e8d['length'];_0x4eba12++){var _0x11a294=[];if(_0x4eba12===0x0){_0x11a294[_0x7500('0x16')]({'text':_0x1895a0,'style':_0x7500('0x1f')});}var _0x50887c={'table':_0x269e8d[_0x4eba12]};if(_0x4eba12>0x0){_0x50887c[_0x7500('0x20')]='before';_0x50887c['margin']=[0x0,0x46,0x0,0x0];}_0x11a294['push'](_0x50887c);_0x41c61b[_0x7500('0x16')](_0x11a294);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x41c61b,'footer':function(_0x467d52,_0x55df48){return{'text':_0x467d52[_0x7500('0x10')]()+'\x20/\x20'+_0x55df48,'style':'footer'};},'defaultStyle':{'font':_0x7500('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x7500('0x22')},'footer':{'alignment':_0x7500('0x23'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x38ffcb){var _0x2f8904=0x1388;var _0xd60663;if(!_0x38ffcb[0x0][_0x7500('0x24')]){return analyticExtractedReport(_0x7500('0x25'));}return db[_0x7500('0x26')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x7500('0x27')]})[_0x7500('0x28')](function(_0x4d52b8){if(_0x4d52b8){_0xd60663=_0x4d52b8;_0x2f8904=_0xd60663[_0x7500('0x27')]||0x3e8;}})[_0x7500('0x28')](function(){var _0x3b0ab0=[];var _0x5adb92=0x0;if(_0xd60663['split']){if(_0x38ffcb&&_0x38ffcb[_0x7500('0x13')]){var _0x360e10=_[_0x7500('0x29')](_0x38ffcb[0x0][_0x7500('0x24')]/_0x2f8904);var _0x1c8bcc=Number['isInteger'](_0x38ffcb[0x0]['num']/_0x2f8904)?_0x38ffcb[0x0][_0x7500('0x24')]%_0x2f8904:0x0;_0x360e10[_0x7500('0x19')](function(_0x451534){if(_0x451534>0x0){_0x5adb92+=_0x2f8904;}_0x3b0ab0[_0x7500('0x16')](dbH[_0x7500('0x2a')]['query'](util[_0x7500('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2f8904,_0x5adb92),{'type':dbH[_0x7500('0x2a')]['QueryTypes'][_0x7500('0x2b')]}));});if(_0x1c8bcc>0x0){_0x5adb92+=_0x2f8904;_0x3b0ab0[_0x7500('0x16')](dbH[_0x7500('0x2a')][_0x7500('0x2c')](util[_0x7500('0x1a')](_0x7500('0x2d'),QUERY,_0x1c8bcc,_0x5adb92),{'type':dbH['sequelize']['QueryTypes'][_0x7500('0x2b')]}));}}}else{_0x3b0ab0['push'](dbH[_0x7500('0x2a')][_0x7500('0x2c')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x7500('0x2b')]}));}var _0x531496=path['dirname'](PATH);var _0x23a345=path[_0x7500('0x2e')](PATH,_0x7500('0x2f'));var _0x4430f0=_0xd60663[_0x7500('0x30')]&&_0x3b0ab0[_0x7500('0x13')]>0x1;var _0x6a7872=[];if(!fs[_0x7500('0x31')](path[_0x7500('0x32')](_0x531496,_0x23a345))&&_0x4430f0){fs[_0x7500('0x33')](path['join'](_0x531496,_0x23a345));}return BPromise['each'](_0x3b0ab0,function(_0x228f30){_0x6a7872[_0x7500('0x16')](_0x228f30);})[_0x7500('0x28')](function(){var _0x31df1d=[];for(var _0x1104d5=0x0;_0x1104d5<_0x6a7872[_0x7500('0x13')];_0x1104d5+=0x1){var _0x24832e=_0x6a7872[_0x1104d5];var _0x2f4d5e=createTables(_[_0x7500('0x34')](_0x24832e));var _0x13e610;var _0x3c301f=getPDFDocDefinition(_0x2f4d5e);var _0x56838a=getPDFPrinter();var _0x573600=_0x56838a[_0x7500('0x35')](_0x3c301f);if(_0x4430f0){_0x13e610=path['join'](_0x531496,_0x23a345,util[_0x7500('0x1a')](_0x7500('0x36'),_0x23a345,_0x1104d5,'pdf'));}else{_0x13e610=path['join'](_0x531496,util['format'](_0x7500('0x37'),_0x23a345,_0x7500('0x38')));}_0x31df1d[_0x7500('0x16')](writePDFDocument(_0x573600,_0x13e610));}return Promise[_0x7500('0x39')](_0x31df1d);})[_0x7500('0x28')](function(){if(_0x4430f0){return new Promise(function(_0x79b37a){zipdir(path['join'](_0x531496,_0x23a345),{'saveTo':path[_0x7500('0x32')](_0x531496,util['format']('%s.%s',_0x23a345,_0x7500('0x3a')))},function(){rimraf(path[_0x7500('0x32')](_0x531496,_0x23a345),function(){});_0x79b37a(_0x7500('0x3b'));});});}})[_0x7500('0x28')](function(){if(!_0x4430f0)return;rimraf(path[_0x7500('0x32')](_0x531496,_0x23a345),function(){});})[_0x7500('0x28')](function(){logger[_0x7500('0x3c')](util[_0x7500('0x1a')](_0x7500('0x3d'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x7500('0x3e'),_0x4430f0?util[_0x7500('0x1a')](_0x7500('0x37'),_0x23a345,_0x4430f0?_0x7500('0x3a'):_0x7500('0x38')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x7500('0x3c')](util[_0x7500('0x1a')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x7500('0x3f')));return db['AnalyticExtractedReport'][_0x7500('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x7500('0x28')](function(_0x26e276){EXTRACTED_REPORT=_0x26e276;return dbH[_0x7500('0x2a')][_0x7500('0x2c')](util[_0x7500('0x1a')](_0x7500('0x41'),QUERY),{'type':dbH[_0x7500('0x2a')]['QueryTypes'][_0x7500('0x2b')]});})[_0x7500('0x28')](extractReport)['catch'](function(_0x388792){logger['info'](util[_0x7500('0x1a')](_0x7500('0x42'),EXTRACTED_REPORT_ID,_0x7500('0x3f')),util[_0x7500('0x43')](_0x388792,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x7500('0x44')](function(){process[_0x7500('0x45')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x34780f=new PdfPrinter({'Arial':{'normal':__dirname+_0x7500('0x46'),'bold':__dirname+_0x7500('0x47'),'italics':__dirname+_0x7500('0x48'),'bolditalics':__dirname+_0x7500('0x49')}});return _0x34780f;}function getPDFDocDefinitionFromHTML(_0x245e36,_0x4ebc66){var _0x279c87=util[_0x7500('0x1a')](_0x7500('0x4a'),_0x4ebc66[_0x7500('0x4b')],_0x4ebc66['interactionId']);var _0x47e600=moment()[_0x7500('0x1a')](_0x7500('0x4c'))[_0x7500('0x10')]();var _0x523696=htmlToPdfmake(_0x245e36,{'window':window,'tableAutoSize':!![]});return{'content':[_0x523696],'defaultStyle':{'font':_0x7500('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x7500('0x4d'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x7500('0x4d'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x7500('0x4d')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x7500('0x1f')}];},'footer':function(_0xd1185,_0x54695a){return[{'text':util[_0x7500('0x1a')](_0x7500('0x4e'),_0x279c87,_0xd1185,_0x54695a,_0x47e600),'style':_0x7500('0x4f')}];}};}function writePDFDocument(_0x51a816,_0x446621){return new Promise(function(_0x491463,_0x175e12){var _0x290d93=_0x51a816['pipe'](fs[_0x7500('0x50')](_0x446621));_0x290d93['on'](_0x7500('0x51'),function(){_0x491463(_0x7500('0x51'));});_0x290d93['on'](_0x7500('0x52'),function(_0x5d80bb){_0x175e12(_0x5d80bb);});_0x51a816[_0x7500('0x53')]();});}exports[_0x7500('0x54')]=function(_0x20b73a,_0x1be4a3){var _0xe6aa4e=getPDFPrinter();var _0x26fe08=getPDFDocDefinitionFromHTML(_0x20b73a,_0x1be4a3);var _0x219d2a=_0xe6aa4e[_0x7500('0x35')](_0x26fe08);return writePDFDocument(_0x219d2a,_0x1be4a3[_0x7500('0x2')])[_0x7500('0x55')](function(_0x4b2d66){throw _0x4b2d66;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 0fa67d9..0dd17b3 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 _0x7410=['Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','analytics','argv','savename','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','split','length','range','forEach','format','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','join','mkdirSync','each','push','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished'];(function(_0x48be0a,_0x7cdaea){var _0xc128cc=function(_0x40918c){while(--_0x40918c){_0x48be0a['push'](_0x48be0a['shift']());}};_0xc128cc(++_0x7cdaea);}(_0x7410,0x1e6));var _0x0741=function(_0xb60cf5,_0x1c501f){_0xb60cf5=_0xb60cf5-0x0;var _0x594826=_0x7410[_0xb60cf5];return _0x594826;};'use strict';var util=require(_0x0741('0x0'));var path=require(_0x0741('0x1'));var _=require(_0x0741('0x2'));var fs=require('fs');var json2xls=require(_0x0741('0x3'));var BPromise=require(_0x0741('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x0741('0x5'));var db=require(_0x0741('0x6'))['db'];var dbH=require(_0x0741('0x6'))[_0x0741('0x7')];var logger=require('../../config/logger')(_0x0741('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x0741('0x9')][0x3];var PATH=process[_0x0741('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x16ba04,_0x2bed27){var _0x54948c={'status':_0x16ba04};var _0xa1a672={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2bed27){_0x54948c[_0x0741('0xa')]=_0x2bed27;}return db['AnalyticExtractedReport'][_0x0741('0xb')](_0x54948c,_0xa1a672);}function main(){var _0x283d68=0x1388;var _0x4883bf;logger[_0x0741('0xc')](util['format'](_0x0741('0xd'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x0741('0xe')][_0x0741('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x0741('0x10')]})[_0x0741('0x11')](function(_0x530941){if(_0x530941){_0x4883bf=_0x530941;_0x283d68=_0x4883bf['splitSizeXlsx']||0x1388;}})[_0x0741('0x11')](function(){return dbH[_0x0741('0x12')][_0x0741('0x13')](util['format'](_0x0741('0x14'),QUERY),{'type':dbH[_0x0741('0x12')][_0x0741('0x15')]['SELECT']});})[_0x0741('0x11')](function(_0x27fd72){if(!_0x27fd72[0x0][_0x0741('0x16')]){return analyticExtractedReport(_0x0741('0x17'));}var _0x274161=[];var _0x27be7c=0x0;if(_0x4883bf[_0x0741('0x18')]){if(_0x27fd72&&_0x27fd72[_0x0741('0x19')]){var _0x548a30=_[_0x0741('0x1a')](_0x27fd72[0x0][_0x0741('0x16')]/_0x283d68);var _0x970de6=Number['isInteger'](_0x27fd72[0x0][_0x0741('0x16')]/_0x283d68)?_0x27fd72[0x0][_0x0741('0x16')]%_0x283d68:0x0;_0x548a30[_0x0741('0x1b')](function(_0x25c9ae){if(_0x25c9ae>0x0){_0x27be7c+=_0x283d68;}_0x274161['push'](dbH[_0x0741('0x12')][_0x0741('0x13')](util[_0x0741('0x1c')](_0x0741('0x1d'),QUERY,_0x283d68,_0x27be7c),{'type':dbH[_0x0741('0x12')][_0x0741('0x15')][_0x0741('0x1e')]}));});if(_0x970de6>0x0){_0x27be7c+=_0x283d68;_0x274161['push'](dbH['sequelize'][_0x0741('0x13')](util['format'](_0x0741('0x1d'),QUERY,_0x970de6,_0x27be7c),{'type':dbH[_0x0741('0x12')][_0x0741('0x15')]['SELECT']}));}}}else{_0x274161['push'](dbH[_0x0741('0x12')][_0x0741('0x13')](QUERY,{'type':dbH[_0x0741('0x12')][_0x0741('0x15')][_0x0741('0x1e')]}));}var _0xd67fa3=path[_0x0741('0x1f')](PATH);var _0x5cea44=path[_0x0741('0x20')](PATH,'.xlsx');var _0x3e180a=_0x4883bf[_0x0741('0x18')]&&_0x274161[_0x0741('0x19')]>0x1;var _0x16ae59=[];if(!fs['existsSync'](path[_0x0741('0x21')](_0xd67fa3,_0x5cea44))&&_0x3e180a){fs[_0x0741('0x22')](path['join'](_0xd67fa3,_0x5cea44));}return BPromise[_0x0741('0x23')](_0x274161,function(_0x59674c){_0x16ae59[_0x0741('0x24')](_0x59674c);})[_0x0741('0x11')](function(){for(var _0x45d654=0x0;_0x45d654<_0x16ae59[_0x0741('0x19')];_0x45d654+=0x1){var _0x7060a2;var _0x3a181e=_0x16ae59[_0x45d654];if(_0x3e180a){_0x7060a2=path[_0x0741('0x21')](_0xd67fa3,_0x5cea44,util[_0x0741('0x1c')](_0x0741('0x25'),_0x5cea44,_0x45d654,'xlsx'));}else{_0x7060a2=path[_0x0741('0x21')](_0xd67fa3,util[_0x0741('0x1c')](_0x0741('0x26'),_0x5cea44,_0x0741('0x27')));}fs[_0x0741('0x28')](_0x7060a2,json2xls(_0x3a181e),_0x0741('0x29'));}})[_0x0741('0x11')](function(){if(_0x3e180a){return new Promise(function(_0x7a6f84){zipdir(path[_0x0741('0x21')](_0xd67fa3,_0x5cea44),{'saveTo':path[_0x0741('0x21')](_0xd67fa3,util[_0x0741('0x1c')](_0x0741('0x26'),_0x5cea44,_0x0741('0x2a')))},function(_0x10c2d0,_0x10c537){rimraf(path['join'](_0xd67fa3,_0x5cea44),function(){});_0x7a6f84(_0x0741('0x2b'));});});}})[_0x0741('0x11')](function(){logger['info'](util[_0x0741('0x1c')](_0x0741('0x2c'),EXTRACTED_REPORT_ID,_0x0741('0x2d')));return analyticExtractedReport(_0x0741('0x2e'),_0x3e180a?util['format']('%s.%s',_0x5cea44,_0x3e180a?'zip':'xlsx'):null);});})[_0x0741('0x2f')](function(_0x372026){logger[_0x0741('0xc')](util['format'](_0x0741('0x30'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x0741('0x31')](_0x372026,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0741('0x32'));})[_0x0741('0x33')](function(){process[_0x0741('0x34')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x4170=['lodash','json2xls','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','format','sequelize','QueryTypes','SELECT','num','length','range','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','existsSync','join','mkdirSync','%s%d.%s','xlsx','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','info','inspect','finally','exit','util','path'];(function(_0x434849,_0x27a13a){var _0x265681=function(_0x45b575){while(--_0x45b575){_0x434849['push'](_0x434849['shift']());}};_0x265681(++_0x27a13a);}(_0x4170,0x166));var _0x0417=function(_0x4107f0,_0x2bcb0c){_0x4107f0=_0x4107f0-0x0;var _0x247ea7=_0x4170[_0x4107f0];return _0x247ea7;};'use strict';var util=require(_0x0417('0x0'));var path=require(_0x0417('0x1'));var _=require(_0x0417('0x2'));var fs=require('fs');var json2xls=require(_0x0417('0x3'));var BPromise=require('bluebird');var zipdir=require(_0x0417('0x4'));var rimraf=require(_0x0417('0x5'));var db=require(_0x0417('0x6'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x0417('0x7'))(_0x0417('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x0417('0x9')][0x2]);var QUERY=process[_0x0417('0x9')][0x3];var PATH=process[_0x0417('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x253547,_0x363cd9){var _0x55eed0={'status':_0x253547};var _0x5e9399={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x363cd9){_0x55eed0['savename']=_0x363cd9;}return db[_0x0417('0xa')][_0x0417('0xb')](_0x55eed0,_0x5e9399);}function main(){var _0x1cb3f4=0x1388;var _0x88fe46;logger['info'](util['format'](_0x0417('0xc'),EXTRACTED_REPORT_ID,_0x0417('0xd')));return db[_0x0417('0xe')][_0x0417('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0417('0x10'),_0x0417('0x11')]})['then'](function(_0x2ebb97){if(_0x2ebb97){_0x88fe46=_0x2ebb97;_0x1cb3f4=_0x88fe46['splitSizeXlsx']||0x1388;}})[_0x0417('0x12')](function(){return dbH['sequelize']['query'](util[_0x0417('0x13')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0417('0x14')][_0x0417('0x15')][_0x0417('0x16')]});})['then'](function(_0x1a2060){if(!_0x1a2060[0x0][_0x0417('0x17')]){return analyticExtractedReport('Empty');}var _0x2a779a=[];var _0x3221bd=0x0;if(_0x88fe46[_0x0417('0x10')]){if(_0x1a2060&&_0x1a2060[_0x0417('0x18')]){var _0xdb60d=_[_0x0417('0x19')](_0x1a2060[0x0]['num']/_0x1cb3f4);var _0x4bb5a3=Number['isInteger'](_0x1a2060[0x0][_0x0417('0x17')]/_0x1cb3f4)?_0x1a2060[0x0][_0x0417('0x17')]%_0x1cb3f4:0x0;_0xdb60d[_0x0417('0x1a')](function(_0x2ee500){if(_0x2ee500>0x0){_0x3221bd+=_0x1cb3f4;}_0x2a779a[_0x0417('0x1b')](dbH[_0x0417('0x14')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1cb3f4,_0x3221bd),{'type':dbH[_0x0417('0x14')][_0x0417('0x15')][_0x0417('0x16')]}));});if(_0x4bb5a3>0x0){_0x3221bd+=_0x1cb3f4;_0x2a779a[_0x0417('0x1b')](dbH[_0x0417('0x14')][_0x0417('0x1c')](util[_0x0417('0x13')](_0x0417('0x1d'),QUERY,_0x4bb5a3,_0x3221bd),{'type':dbH[_0x0417('0x14')][_0x0417('0x15')]['SELECT']}));}}}else{_0x2a779a[_0x0417('0x1b')](dbH[_0x0417('0x14')][_0x0417('0x1c')](QUERY,{'type':dbH[_0x0417('0x14')][_0x0417('0x15')]['SELECT']}));}var _0x508683=path[_0x0417('0x1e')](PATH);var _0x1a92fd=path['basename'](PATH,'.xlsx');var _0x490883=_0x88fe46[_0x0417('0x10')]&&_0x2a779a['length']>0x1;var _0x32f073=[];if(!fs[_0x0417('0x1f')](path[_0x0417('0x20')](_0x508683,_0x1a92fd))&&_0x490883){fs[_0x0417('0x21')](path[_0x0417('0x20')](_0x508683,_0x1a92fd));}return BPromise['each'](_0x2a779a,function(_0x36cf27){_0x32f073[_0x0417('0x1b')](_0x36cf27);})['then'](function(){for(var _0x47df20=0x0;_0x47df20<_0x32f073[_0x0417('0x18')];_0x47df20+=0x1){var _0x59cc2d;var _0x54dbb4=_0x32f073[_0x47df20];if(_0x490883){_0x59cc2d=path[_0x0417('0x20')](_0x508683,_0x1a92fd,util[_0x0417('0x13')](_0x0417('0x22'),_0x1a92fd,_0x47df20,_0x0417('0x23')));}else{_0x59cc2d=path[_0x0417('0x20')](_0x508683,util[_0x0417('0x13')](_0x0417('0x24'),_0x1a92fd,'xlsx'));}fs['writeFileSync'](_0x59cc2d,json2xls(_0x54dbb4),'binary');}})[_0x0417('0x12')](function(){if(_0x490883){return new Promise(function(_0x153e16){zipdir(path[_0x0417('0x20')](_0x508683,_0x1a92fd),{'saveTo':path['join'](_0x508683,util['format'](_0x0417('0x24'),_0x1a92fd,_0x0417('0x25')))},function(_0x1f4e5f,_0x3d4c10){rimraf(path[_0x0417('0x20')](_0x508683,_0x1a92fd),function(){});_0x153e16('zip\x20finished');});});}})['then'](function(){logger['info'](util['format'](_0x0417('0x26'),EXTRACTED_REPORT_ID,_0x0417('0xd')));return analyticExtractedReport(_0x0417('0x27'),_0x490883?util['format']('%s.%s',_0x1a92fd,_0x490883?_0x0417('0x25'):'xlsx'):null);});})[_0x0417('0x28')](function(_0x2c5b89){logger[_0x0417('0x29')](util[_0x0417('0x13')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'),util[_0x0417('0x2a')](_0x2c5b89,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x0417('0x2b')](function(){process[_0x0417('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 6c4be29..ff5f4eb 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 _0x6ebb=['uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','extensions','extension','find','Set','CDR(type)=%s','type','context','VoiceExtensionId','inbound','push','CDR(routeid)=','priority','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','interval','*,*,*,*','IntervalId','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)','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','destroy','models','bulkCreate','sortBy','catch','error','Interval','findAll','intervals','VoiceExtension','then'];(function(_0x1990a8,_0x179529){var _0x1d0b00=function(_0x11564d){while(--_0x11564d){_0x1990a8['push'](_0x1990a8['shift']());}};_0x1d0b00(++_0x179529);}(_0x6ebb,0xd3));var _0xb6eb=function(_0x9119f3,_0x5364d3){_0x9119f3=_0x9119f3-0x0;var _0x336cc3=_0x6ebb[_0x9119f3];return _0x336cc3;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x17b5e6,_0x5cc62f){var _0x3820e5=this;return _0x17b5e6['models'][_0xb6eb('0x0')][_0xb6eb('0x1')]({'raw':!![]})['then'](function(_0x5423ae){_0x3820e5[_0xb6eb('0x2')]=_0x5423ae;return _0x17b5e6['models'][_0xb6eb('0x3')][_0xb6eb('0x1')]({'where':{'IntervalId':_0x5cc62f['IntervalId']},'raw':!![]});})[_0xb6eb('0x4')](function(_0x763640){return _0x17b5e6['models']['VoiceExtension'][_0xb6eb('0x1')]({'where':{'exten':{'$in':_[_0xb6eb('0x5')](_[_0xb6eb('0x6')](_0x763640,_0xb6eb('0x7')))}},'order':[{'raw':_0xb6eb('0x8')}],'raw':!![]});})[_0xb6eb('0x4')](function(_0x2018f9){var _0x64e39e=_[_0xb6eb('0x9')](_0x2018f9,{'priority':'1'});var _0x17e91f=_[_0xb6eb('0x9')](_0x2018f9,{'isApp':0x1});var _0x4f9c00=_[_0xb6eb('0xa')](_0x17e91f,_0xb6eb('0x7'));var _0x3e669c=[_0xb6eb('0xb'),_0xb6eb('0xc')];var _0x2a35eb=[];var _0x3a89af=[];for(var _0x2a3bf4 in _0x4f9c00){if(_0x4f9c00[_0xb6eb('0xd')](_0x2a3bf4)){_0x3820e5['priority']=0x2;_0x3820e5[_0xb6eb('0xe')]=[];_0x3820e5[_0xb6eb('0xf')]=_[_0xb6eb('0x10')](_0x64e39e,{'exten':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x7')]});_0x3820e5['extensions']['push']({'type':_0x4f9c00[_0x2a3bf4][0x0]['type'],'app':_0xb6eb('0x11'),'appdata':util['format'](_0xb6eb('0x12'),_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x13')]),'context':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x14')],'exten':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x7')],'priority':_0x3820e5['priority']++,'VoiceExtensionId':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x15')]});if(_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x13')]===_0xb6eb('0x16')){_0x3820e5[_0xb6eb('0xe')][_0xb6eb('0x17')]({'type':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x13')],'app':'Set','appdata':_0xb6eb('0x18')+_0x4f9c00[_0x2a3bf4][0x0]['VoiceExtensionId'],'context':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x14')],'exten':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x7')],'priority':_0x3820e5[_0xb6eb('0x19')]++,'VoiceExtensionId':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x15')]});}else if(_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x13')]===_0xb6eb('0x1a')){if(_0x3820e5['extension']){_0x3820e5[_0xb6eb('0xe')][_0xb6eb('0x17')]({'type':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x13')],'app':_0xb6eb('0x11'),'appdata':_0xb6eb('0x1b')+(_0x3820e5[_0xb6eb('0xf')][_0xb6eb('0x1c')]?_0xb6eb('0x1d')+_0x3820e5['extension'][_0xb6eb('0x1c')]+'}':_0xb6eb('0x1e')),'context':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x14')],'exten':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x7')],'priority':_0x3820e5[_0xb6eb('0x19')]++,'VoiceExtensionId':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x15')]});}_0x3820e5[_0xb6eb('0xe')][_0xb6eb('0x17')]({'type':_0x4f9c00[_0x2a3bf4][0x0]['type'],'app':_0xb6eb('0x11'),'appdata':_0xb6eb('0x18')+_0x4f9c00[_0x2a3bf4][0x0]['VoiceExtensionId'],'context':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x14')],'exten':_0x4f9c00[_0x2a3bf4][0x0]['exten'],'priority':_0x3820e5[_0xb6eb('0x19')]++,'VoiceExtensionId':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x15')]});var _0x31681b=_0x3820e5[_0xb6eb('0x19')]++;_0x3820e5[_0xb6eb('0xe')][_0xb6eb('0x17')]({'type':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x13')],'app':_0xb6eb('0x1f'),'appdata':_0xb6eb('0x20')+(_0x31681b+0x2)+_0xb6eb('0x21')+(_0x31681b+0x1)+')','context':_0x4f9c00[_0x2a3bf4][0x0]['context'],'exten':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x7')],'priority':_0x31681b,'VoiceExtensionId':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x15')]});if(_0x3820e5[_0xb6eb('0xf')]){_0x3820e5[_0xb6eb('0xe')][_0xb6eb('0x17')]({'type':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x13')],'app':_0xb6eb('0x11'),'appdata':_0x3820e5[_0xb6eb('0xf')][_0xb6eb('0x1c')]?_0xb6eb('0x22')+_0x3820e5[_0xb6eb('0xf')][_0xb6eb('0x1c')]+'}':_0xb6eb('0x23'),'context':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x14')],'exten':_0x4f9c00[_0x2a3bf4][0x0]['exten'],'priority':_0x3820e5[_0xb6eb('0x19')]++,'VoiceExtensionId':_0x4f9c00[_0x2a3bf4][0x0]['VoiceExtensionId']});}_0x3820e5[_0xb6eb('0xe')][_0xb6eb('0x17')]({'type':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x13')],'app':_0xb6eb('0x11'),'appdata':_0xb6eb('0x24')+_0x4f9c00[_0x2a3bf4][0x0]['VoiceExtensionId'],'context':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x14')],'exten':_0x4f9c00[_0x2a3bf4][0x0]['exten'],'priority':_0x3820e5[_0xb6eb('0x19')]++,'VoiceExtensionId':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x15')]});if(_0x3820e5[_0xb6eb('0xf')]&&_0x3820e5[_0xb6eb('0xf')]['hasOwnProperty'](_0xb6eb('0x25'))&&_0x3820e5['extension'][_0xb6eb('0x25')]!==_0xb6eb('0x26')){_0x3820e5[_0xb6eb('0xe')]['push']({'type':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x13')],'app':_0xb6eb('0x11'),'appdata':_0xb6eb('0x27'),'context':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x14')],'exten':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x7')],'priority':_0x3820e5[_0xb6eb('0x19')]++,'VoiceExtensionId':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x15')]});_0x3820e5[_0xb6eb('0xe')][_0xb6eb('0x17')]({'type':_0x4f9c00[_0x2a3bf4][0x0]['type'],'app':_0xb6eb('0x11'),'appdata':_0xb6eb('0x28')+_0x3820e5[_0xb6eb('0xf')]['recordingFormat']||_0xb6eb('0x29'),'context':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x14')],'exten':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x7')],'priority':_0x3820e5['priority']++,'VoiceExtensionId':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x15')]});}}_0x3820e5[_0xb6eb('0xe')]['push']({'type':_0x4f9c00[_0x2a3bf4][0x0]['type'],'app':_0xb6eb('0x11'),'appdata':_0xb6eb('0x2a'),'context':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x14')],'exten':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x7')],'priority':_0x3820e5[_0xb6eb('0x19')]++,'VoiceExtensionId':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x15')]});_0x3820e5[_0xb6eb('0xe')][_0xb6eb('0x17')]({'type':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x13')],'app':'Set','appdata':_0xb6eb('0x2b'),'context':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x14')],'exten':_0x4f9c00[_0x2a3bf4][0x0]['exten'],'priority':_0x3820e5[_0xb6eb('0x19')]++,'VoiceExtensionId':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x15')]});_0x3820e5[_0xb6eb('0xe')][_0xb6eb('0x17')]({'type':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x13')],'app':'Set','appdata':_0xb6eb('0x2c'),'context':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x14')],'exten':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x7')],'priority':_0x3820e5[_0xb6eb('0x19')]++,'VoiceExtensionId':_0x4f9c00[_0x2a3bf4][0x0]['VoiceExtensionId']});for(var _0x169cd8=0x0,_0x9e7c34=0x0;_0x169cd8<_0x4f9c00[_0x2a3bf4][_0xb6eb('0x2d')];_0x169cd8+=0x1,_0x9e7c34=0x0){var _0x3a9223=_0x4f9c00[_0x2a3bf4][_0x169cd8];if(_0x3a9223['type']){_0x3a9223[_0xb6eb('0x13')]=_0x3a9223[_0xb6eb('0x13')][_0xb6eb('0x2e')]();}var _0x3e8bd2=[];var _0x116e60=[];delete _0x3a9223['id'];delete _0x3a9223['createdAt'];delete _0x3a9223['updatedAt'];var _0x3e5fa8=_0x3a9223[_0xb6eb('0x2f')]!==_0xb6eb('0x30')?[_0x3a9223[_0xb6eb('0x2f')]]:_0x3a9223[_0xb6eb('0x31')]?_[_0xb6eb('0x6')](_[_0xb6eb('0x9')](_0x3820e5[_0xb6eb('0x2')],{'IntervalId':_0x3a9223[_0xb6eb('0x31')]}),_0xb6eb('0x2f')):[];if(_0x3a9223[_0xb6eb('0xd')](_0xb6eb('0x32'))){if(_0x3a9223[_0xb6eb('0x32')]&&_0x3a9223[_0xb6eb('0x32')]!=='--'){_0x3e8bd2['push']({'type':_0x3a9223[_0xb6eb('0x13')],'app':_0xb6eb('0x11'),'appdata':'CDR(tag)='+_0x3a9223[_0xb6eb('0x32')],'context':_0x3a9223[_0xb6eb('0x14')],'exten':_0x3a9223[_0xb6eb('0x7')],'priority':_0x3e5fa8['length']+_0x3820e5[_0xb6eb('0x19')]+_0x9e7c34++,'VoiceExtensionId':_0x3a9223[_0xb6eb('0x15')]});}}if(_0x3a9223[_0xb6eb('0x13')]===_0xb6eb('0x1a')&&_0x3a9223[_0xb6eb('0xd')](_0xb6eb('0x33'))){if(_0x3a9223[_0xb6eb('0x33')]){_0x3e8bd2[_0xb6eb('0x17')]({'type':_0x3a9223['type'],'app':'ExecIf','appdata':_0xb6eb('0x34')+_0x3a9223[_0xb6eb('0x33')]+')','context':_0x3a9223[_0xb6eb('0x14')],'exten':_0x3a9223[_0xb6eb('0x7')],'priority':_0x3e5fa8['length']+_0x3820e5['priority']+_0x9e7c34++,'VoiceExtensionId':_0x3a9223[_0xb6eb('0x15')]});}else{_0x3e8bd2[_0xb6eb('0x17')]({'type':_0x3a9223[_0xb6eb('0x13')],'app':_0xb6eb('0x1f'),'appdata':_0xb6eb('0x35'),'context':_0x3a9223[_0xb6eb('0x14')],'exten':_0x3a9223[_0xb6eb('0x7')],'priority':_0x3e5fa8['length']+_0x3820e5['priority']+_0x9e7c34++,'VoiceExtensionId':_0x3a9223[_0xb6eb('0x15')]});}}if(_0x3a9223[_0xb6eb('0xd')](_0xb6eb('0x36'))){if(_0x3e669c['indexOf'](_0x3a9223[_0xb6eb('0x37')][_0xb6eb('0x2e')]())>=0x0&&_0x3a9223[_0xb6eb('0x38')]!==_0xb6eb('0x39')){if(_0x3a9223[_0xb6eb('0x36')]){_0x3e8bd2['push']({'type':_0x3a9223[_0xb6eb('0x13')],'app':_0xb6eb('0x1f'),'appdata':_0xb6eb('0x3a'),'context':_0x3a9223['context'],'exten':_0x3a9223[_0xb6eb('0x7')],'priority':_0x3e5fa8['length']+_0x3820e5[_0xb6eb('0x19')]+_0x9e7c34++,'VoiceExtensionId':_0x3a9223[_0xb6eb('0x15')]});_0x3e8bd2[_0xb6eb('0x17')]({'type':_0x3a9223[_0xb6eb('0x13')],'app':_0xb6eb('0x11'),'appdata':_0xb6eb('0x3b'),'context':_0x3a9223[_0xb6eb('0x14')],'exten':_0x3a9223[_0xb6eb('0x7')],'priority':_0x3e5fa8[_0xb6eb('0x2d')]+_0x3820e5[_0xb6eb('0x19')]+_0x9e7c34++,'VoiceExtensionId':_0x3a9223[_0xb6eb('0x15')]});}else{_0x3e8bd2[_0xb6eb('0x17')]({'type':_0x3a9223['type'],'app':_0xb6eb('0x1f'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3a9223[_0xb6eb('0x14')],'exten':_0x3a9223[_0xb6eb('0x7')],'priority':_0x3e5fa8[_0xb6eb('0x2d')]+_0x3820e5[_0xb6eb('0x19')]+_0x9e7c34++,'VoiceExtensionId':_0x3a9223[_0xb6eb('0x15')]});_0x3e8bd2[_0xb6eb('0x17')]({'type':_0x3a9223[_0xb6eb('0x13')],'app':_0xb6eb('0x11'),'appdata':_0xb6eb('0x3c'),'context':_0x3a9223['context'],'exten':_0x3a9223[_0xb6eb('0x7')],'priority':_0x3e5fa8['length']+_0x3820e5[_0xb6eb('0x19')]+_0x9e7c34++,'VoiceExtensionId':_0x3a9223[_0xb6eb('0x15')]});}}}for(var _0xaf49bc=0x0;_0xaf49bc<_0x3e5fa8[_0xb6eb('0x2d')];_0xaf49bc+=0x1){var _0x1eca52=_0x3820e5[_0xb6eb('0x19')]+_0x3e5fa8['length'];var _0x5b6ad5=_0xaf49bc===_0x3e5fa8[_0xb6eb('0x2d')]-0x1?_0x3820e5[_0xb6eb('0x19')]+_0x3e8bd2[_0xb6eb('0x2d')]+_0x116e60['length']+0x2:_0x3820e5[_0xb6eb('0x19')]+_0xaf49bc+0x1;_0x3e8bd2[_0xb6eb('0x3d')](_0xaf49bc,0x0,{'type':_0x3a9223[_0xb6eb('0x13')],'app':_0xb6eb('0x3e'),'appdata':_0x3e5fa8[_0xaf49bc]+'?'+_0x3a9223['context']+_0xb6eb('0x3f')+_0x1eca52+':'+_0x3a9223[_0xb6eb('0x14')]+',${EXTEN},'+_0x5b6ad5,'exten':_0x3a9223['exten'],'context':_0x3a9223[_0xb6eb('0x14')],'priority':_0x3820e5[_0xb6eb('0x19')]+_0xaf49bc,'VoiceExtensionId':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x15')]});}_0x3a9223[_0xb6eb('0x19')]=_0x3e8bd2['length']?_['last'](_0x3e8bd2)[_0xb6eb('0x19')]+0x1:_0x3820e5[_0xb6eb('0x19')];_0x3820e5[_0xb6eb('0x19')]=(_0x116e60[_0xb6eb('0x2d')]?_[_0xb6eb('0x40')](_0x116e60)['priority']:_0x3a9223[_0xb6eb('0x19')])+0x1;_0x3820e5['extensions']=_[_0xb6eb('0x41')](_0x3820e5['extensions'],_0x3e8bd2,[_0x3a9223],_0x116e60);}_0x3820e5['extensions'][_0xb6eb('0x17')]({'type':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x13')],'app':'Hangup','exten':_0x4f9c00[_0x2a3bf4][0x0]['exten'],'context':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x14')],'priority':_0x3820e5[_0xb6eb('0x19')],'VoiceExtensionId':_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x15')]});_0x2a35eb['push'](_0x4f9c00[_0x2a3bf4][0x0][_0xb6eb('0x15')]);_0x3a89af=_['concat'](_0x3a89af,_0x3820e5[_0xb6eb('0xe')]);}}return _0x17b5e6['transaction'](function(_0x3a3680){return _0x17b5e6['models'][_0xb6eb('0x3')][_0xb6eb('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x2a35eb}},'transaction':_0x3a3680})[_0xb6eb('0x4')](function(_0x5563db){return _0x17b5e6[_0xb6eb('0x43')][_0xb6eb('0x3')][_0xb6eb('0x44')](_[_0xb6eb('0x45')](_0x3a89af,'priority'),{'transaction':_0x3a3680});});});})[_0xb6eb('0x46')](function(_0x3010da){console[_0xb6eb('0x47')](_0x3010da);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x1fdb=['${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','toLowerCase','createdAt','interval','*,*,*,*','tag','callerID','ExecIf','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','bulkCreate','sortBy','catch','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','filter','queue','playback','hasOwnProperty','priority','extensions','extension','find','exten','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','cutdigits','${EXTEN:'];(function(_0x1afabf,_0x56fdcc){var _0x497ff1=function(_0x2f6104){while(--_0x2f6104){_0x1afabf['push'](_0x1afabf['shift']());}};_0x497ff1(++_0x56fdcc);}(_0x1fdb,0x143));var _0xb1fd=function(_0x3bbdc6,_0x38a238){_0x3bbdc6=_0x3bbdc6-0x0;var _0x333327=_0x1fdb[_0x3bbdc6];return _0x333327;};'use strict';var _=require(_0xb1fd('0x0'));var util=require(_0xb1fd('0x1'));function rewrite(_0x323430,_0x4ce157){var _0x1e2620=this;return _0x323430[_0xb1fd('0x2')][_0xb1fd('0x3')][_0xb1fd('0x4')]({'raw':!![]})[_0xb1fd('0x5')](function(_0x383688){_0x1e2620[_0xb1fd('0x6')]=_0x383688;return _0x323430['models'][_0xb1fd('0x7')][_0xb1fd('0x4')]({'where':{'IntervalId':_0x4ce157[_0xb1fd('0x8')]},'raw':!![]});})[_0xb1fd('0x5')](function(_0x5cd5d2){return _0x323430[_0xb1fd('0x2')][_0xb1fd('0x7')][_0xb1fd('0x4')]({'where':{'exten':{'$in':_[_0xb1fd('0x9')](_[_0xb1fd('0xa')](_0x5cd5d2,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xb1fd('0x5')](function(_0xc76662){var _0x478524=_[_0xb1fd('0xb')](_0xc76662,{'priority':'1'});var _0x5cddc8=_[_0xb1fd('0xb')](_0xc76662,{'isApp':0x1});var _0x47afc4=_['groupBy'](_0x5cddc8,'exten');var _0x1595eb=[_0xb1fd('0xc'),_0xb1fd('0xd')];var _0x198565=[];var _0xd29736=[];for(var _0x25894e in _0x47afc4){if(_0x47afc4[_0xb1fd('0xe')](_0x25894e)){_0x1e2620[_0xb1fd('0xf')]=0x2;_0x1e2620[_0xb1fd('0x10')]=[];_0x1e2620[_0xb1fd('0x11')]=_[_0xb1fd('0x12')](_0x478524,{'exten':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x13')]});_0x1e2620[_0xb1fd('0x10')][_0xb1fd('0x14')]({'type':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x15')],'app':_0xb1fd('0x16'),'appdata':util[_0xb1fd('0x17')](_0xb1fd('0x18'),_0x47afc4[_0x25894e][0x0]['type']),'context':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x19')],'exten':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x13')],'priority':_0x1e2620[_0xb1fd('0xf')]++,'VoiceExtensionId':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x1a')]});if(_0x47afc4[_0x25894e][0x0][_0xb1fd('0x15')]===_0xb1fd('0x1b')){_0x1e2620[_0xb1fd('0x10')]['push']({'type':_0x47afc4[_0x25894e][0x0]['type'],'app':_0xb1fd('0x16'),'appdata':_0xb1fd('0x1c')+_0x47afc4[_0x25894e][0x0]['VoiceExtensionId'],'context':_0x47afc4[_0x25894e][0x0]['context'],'exten':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x13')],'priority':_0x1e2620[_0xb1fd('0xf')]++,'VoiceExtensionId':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x1a')]});}else if(_0x47afc4[_0x25894e][0x0][_0xb1fd('0x15')]===_0xb1fd('0x1d')){if(_0x1e2620[_0xb1fd('0x11')]){_0x1e2620[_0xb1fd('0x10')][_0xb1fd('0x14')]({'type':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x15')],'app':_0xb1fd('0x16'),'appdata':'CDR(destination)='+(_0x1e2620['extension'][_0xb1fd('0x1e')]?_0xb1fd('0x1f')+_0x1e2620[_0xb1fd('0x11')][_0xb1fd('0x1e')]+'}':_0xb1fd('0x20')),'context':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x19')],'exten':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x13')],'priority':_0x1e2620['priority']++,'VoiceExtensionId':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x1a')]});}_0x1e2620[_0xb1fd('0x10')][_0xb1fd('0x14')]({'type':_0x47afc4[_0x25894e][0x0]['type'],'app':_0xb1fd('0x16'),'appdata':_0xb1fd('0x1c')+_0x47afc4[_0x25894e][0x0][_0xb1fd('0x1a')],'context':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x19')],'exten':_0x47afc4[_0x25894e][0x0]['exten'],'priority':_0x1e2620[_0xb1fd('0xf')]++,'VoiceExtensionId':_0x47afc4[_0x25894e][0x0]['VoiceExtensionId']});var _0x50a4ae=_0x1e2620[_0xb1fd('0xf')]++;_0x1e2620[_0xb1fd('0x10')]['push']({'type':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x15')],'app':'ExecIf','appdata':_0xb1fd('0x21')+(_0x50a4ae+0x2)+_0xb1fd('0x22')+(_0x50a4ae+0x1)+')','context':_0x47afc4[_0x25894e][0x0]['context'],'exten':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x13')],'priority':_0x50a4ae,'VoiceExtensionId':_0x47afc4[_0x25894e][0x0]['VoiceExtensionId']});if(_0x1e2620[_0xb1fd('0x11')]){_0x1e2620[_0xb1fd('0x10')][_0xb1fd('0x14')]({'type':_0x47afc4[_0x25894e][0x0]['type'],'app':_0xb1fd('0x16'),'appdata':_0x1e2620[_0xb1fd('0x11')]['cutdigits']?_0xb1fd('0x23')+_0x1e2620[_0xb1fd('0x11')]['cutdigits']+'}':_0xb1fd('0x24'),'context':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x19')],'exten':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x13')],'priority':_0x1e2620[_0xb1fd('0xf')]++,'VoiceExtensionId':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x1a')]});}_0x1e2620[_0xb1fd('0x10')][_0xb1fd('0x14')]({'type':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x15')],'app':_0xb1fd('0x16'),'appdata':_0xb1fd('0x25')+_0x47afc4[_0x25894e][0x0][_0xb1fd('0x1a')],'context':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x19')],'exten':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x13')],'priority':_0x1e2620['priority']++,'VoiceExtensionId':_0x47afc4[_0x25894e][0x0]['VoiceExtensionId']});if(_0x1e2620['extension']&&_0x1e2620[_0xb1fd('0x11')][_0xb1fd('0xe')](_0xb1fd('0x26'))&&_0x1e2620[_0xb1fd('0x11')][_0xb1fd('0x26')]!=='none'){_0x1e2620['extensions'][_0xb1fd('0x14')]({'type':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x15')],'app':'Set','appdata':_0xb1fd('0x27'),'context':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x19')],'exten':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x13')],'priority':_0x1e2620[_0xb1fd('0xf')]++,'VoiceExtensionId':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x1a')]});_0x1e2620['extensions'][_0xb1fd('0x14')]({'type':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x15')],'app':'Set','appdata':_0xb1fd('0x28')+_0x1e2620[_0xb1fd('0x11')][_0xb1fd('0x26')]||_0xb1fd('0x29'),'context':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x19')],'exten':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x13')],'priority':_0x1e2620[_0xb1fd('0xf')]++,'VoiceExtensionId':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x1a')]});}}_0x1e2620[_0xb1fd('0x10')][_0xb1fd('0x14')]({'type':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x15')],'app':_0xb1fd('0x16'),'appdata':_0xb1fd('0x2a'),'context':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x19')],'exten':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x13')],'priority':_0x1e2620[_0xb1fd('0xf')]++,'VoiceExtensionId':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x1a')]});_0x1e2620['extensions']['push']({'type':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x15')],'app':_0xb1fd('0x16'),'appdata':_0xb1fd('0x2b'),'context':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x19')],'exten':_0x47afc4[_0x25894e][0x0]['exten'],'priority':_0x1e2620[_0xb1fd('0xf')]++,'VoiceExtensionId':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x1a')]});_0x1e2620[_0xb1fd('0x10')][_0xb1fd('0x14')]({'type':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x15')],'app':_0xb1fd('0x16'),'appdata':'MONITOR_OPTIONS=ab','context':_0x47afc4[_0x25894e][0x0]['context'],'exten':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x13')],'priority':_0x1e2620[_0xb1fd('0xf')]++,'VoiceExtensionId':_0x47afc4[_0x25894e][0x0]['VoiceExtensionId']});for(var _0x106038=0x0,_0x234763=0x0;_0x106038<_0x47afc4[_0x25894e]['length'];_0x106038+=0x1,_0x234763=0x0){var _0x269f48=_0x47afc4[_0x25894e][_0x106038];if(_0x269f48[_0xb1fd('0x15')]){_0x269f48[_0xb1fd('0x15')]=_0x269f48[_0xb1fd('0x15')][_0xb1fd('0x2c')]();}var _0x4bffe8=[];var _0x19c5cd=[];delete _0x269f48['id'];delete _0x269f48[_0xb1fd('0x2d')];delete _0x269f48['updatedAt'];var _0x386e37=_0x269f48[_0xb1fd('0x2e')]!==_0xb1fd('0x2f')?[_0x269f48[_0xb1fd('0x2e')]]:_0x269f48[_0xb1fd('0x8')]?_['map'](_['filter'](_0x1e2620[_0xb1fd('0x6')],{'IntervalId':_0x269f48[_0xb1fd('0x8')]}),_0xb1fd('0x2e')):[];if(_0x269f48[_0xb1fd('0xe')](_0xb1fd('0x30'))){if(_0x269f48['tag']&&_0x269f48[_0xb1fd('0x30')]!=='--'){_0x4bffe8[_0xb1fd('0x14')]({'type':_0x269f48[_0xb1fd('0x15')],'app':'Set','appdata':'CDR(tag)='+_0x269f48[_0xb1fd('0x30')],'context':_0x269f48[_0xb1fd('0x19')],'exten':_0x269f48[_0xb1fd('0x13')],'priority':_0x386e37['length']+_0x1e2620[_0xb1fd('0xf')]+_0x234763++,'VoiceExtensionId':_0x269f48['VoiceExtensionId']});}}if(_0x269f48[_0xb1fd('0x15')]===_0xb1fd('0x1d')&&_0x269f48['hasOwnProperty'](_0xb1fd('0x31'))){if(_0x269f48[_0xb1fd('0x31')]){_0x4bffe8['push']({'type':_0x269f48[_0xb1fd('0x15')],'app':_0xb1fd('0x32'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x269f48['callerID']+')','context':_0x269f48[_0xb1fd('0x19')],'exten':_0x269f48['exten'],'priority':_0x386e37[_0xb1fd('0x33')]+_0x1e2620[_0xb1fd('0xf')]+_0x234763++,'VoiceExtensionId':_0x269f48[_0xb1fd('0x1a')]});}else{_0x4bffe8['push']({'type':_0x269f48[_0xb1fd('0x15')],'app':_0xb1fd('0x32'),'appdata':_0xb1fd('0x34'),'context':_0x269f48[_0xb1fd('0x19')],'exten':_0x269f48['exten'],'priority':_0x386e37[_0xb1fd('0x33')]+_0x1e2620[_0xb1fd('0xf')]+_0x234763++,'VoiceExtensionId':_0x269f48['VoiceExtensionId']});}}if(_0x269f48[_0xb1fd('0xe')](_0xb1fd('0x35'))){if(_0x1595eb[_0xb1fd('0x36')](_0x269f48['app'][_0xb1fd('0x2c')]())>=0x0&&_0x269f48[_0xb1fd('0x37')]!==_0xb1fd('0x38')){if(_0x269f48[_0xb1fd('0x35')]){_0x4bffe8[_0xb1fd('0x14')]({'type':_0x269f48['type'],'app':'ExecIf','appdata':_0xb1fd('0x39'),'context':_0x269f48['context'],'exten':_0x269f48[_0xb1fd('0x13')],'priority':_0x386e37[_0xb1fd('0x33')]+_0x1e2620[_0xb1fd('0xf')]+_0x234763++,'VoiceExtensionId':_0x269f48[_0xb1fd('0x1a')]});_0x4bffe8[_0xb1fd('0x14')]({'type':_0x269f48[_0xb1fd('0x15')],'app':_0xb1fd('0x16'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x269f48[_0xb1fd('0x19')],'exten':_0x269f48[_0xb1fd('0x13')],'priority':_0x386e37[_0xb1fd('0x33')]+_0x1e2620['priority']+_0x234763++,'VoiceExtensionId':_0x269f48['VoiceExtensionId']});}else{_0x4bffe8[_0xb1fd('0x14')]({'type':_0x269f48[_0xb1fd('0x15')],'app':_0xb1fd('0x32'),'appdata':_0xb1fd('0x3a'),'context':_0x269f48[_0xb1fd('0x19')],'exten':_0x269f48[_0xb1fd('0x13')],'priority':_0x386e37[_0xb1fd('0x33')]+_0x1e2620['priority']+_0x234763++,'VoiceExtensionId':_0x269f48[_0xb1fd('0x1a')]});_0x4bffe8[_0xb1fd('0x14')]({'type':_0x269f48[_0xb1fd('0x15')],'app':_0xb1fd('0x16'),'appdata':_0xb1fd('0x3b'),'context':_0x269f48[_0xb1fd('0x19')],'exten':_0x269f48['exten'],'priority':_0x386e37[_0xb1fd('0x33')]+_0x1e2620[_0xb1fd('0xf')]+_0x234763++,'VoiceExtensionId':_0x269f48[_0xb1fd('0x1a')]});}}}for(var _0x4fdfe2=0x0;_0x4fdfe2<_0x386e37[_0xb1fd('0x33')];_0x4fdfe2+=0x1){var _0x414f97=_0x1e2620['priority']+_0x386e37[_0xb1fd('0x33')];var _0x545272=_0x4fdfe2===_0x386e37['length']-0x1?_0x1e2620[_0xb1fd('0xf')]+_0x4bffe8[_0xb1fd('0x33')]+_0x19c5cd[_0xb1fd('0x33')]+0x2:_0x1e2620[_0xb1fd('0xf')]+_0x4fdfe2+0x1;_0x4bffe8[_0xb1fd('0x3c')](_0x4fdfe2,0x0,{'type':_0x269f48[_0xb1fd('0x15')],'app':_0xb1fd('0x3d'),'appdata':_0x386e37[_0x4fdfe2]+'?'+_0x269f48[_0xb1fd('0x19')]+_0xb1fd('0x3e')+_0x414f97+':'+_0x269f48['context']+_0xb1fd('0x3e')+_0x545272,'exten':_0x269f48[_0xb1fd('0x13')],'context':_0x269f48[_0xb1fd('0x19')],'priority':_0x1e2620['priority']+_0x4fdfe2,'VoiceExtensionId':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x1a')]});}_0x269f48[_0xb1fd('0xf')]=_0x4bffe8[_0xb1fd('0x33')]?_['last'](_0x4bffe8)[_0xb1fd('0xf')]+0x1:_0x1e2620['priority'];_0x1e2620[_0xb1fd('0xf')]=(_0x19c5cd[_0xb1fd('0x33')]?_[_0xb1fd('0x3f')](_0x19c5cd)[_0xb1fd('0xf')]:_0x269f48[_0xb1fd('0xf')])+0x1;_0x1e2620[_0xb1fd('0x10')]=_['concat'](_0x1e2620[_0xb1fd('0x10')],_0x4bffe8,[_0x269f48],_0x19c5cd);}_0x1e2620['extensions'][_0xb1fd('0x14')]({'type':_0x47afc4[_0x25894e][0x0]['type'],'app':_0xb1fd('0x40'),'exten':_0x47afc4[_0x25894e][0x0]['exten'],'context':_0x47afc4[_0x25894e][0x0]['context'],'priority':_0x1e2620[_0xb1fd('0xf')],'VoiceExtensionId':_0x47afc4[_0x25894e][0x0][_0xb1fd('0x1a')]});_0x198565[_0xb1fd('0x14')](_0x47afc4[_0x25894e][0x0][_0xb1fd('0x1a')]);_0xd29736=_[_0xb1fd('0x41')](_0xd29736,_0x1e2620[_0xb1fd('0x10')]);}}return _0x323430[_0xb1fd('0x42')](function(_0x1dd50f){return _0x323430[_0xb1fd('0x2')][_0xb1fd('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x198565}},'transaction':_0x1dd50f})[_0xb1fd('0x5')](function(_0x4fd022){return _0x323430[_0xb1fd('0x2')][_0xb1fd('0x7')][_0xb1fd('0x43')](_[_0xb1fd('0x44')](_0xd29736,_0xb1fd('0xf')),{'transaction':_0x1dd50f});});});})[_0xb1fd('0x45')](function(_0x5349d0){console['error'](_0x5349d0);});}exports[_0xb1fd('0x46')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 42171e8..aa38a82 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 _0x094b=['cm_hopper','\x20=\x20?','into','cm_contacts','id\x20IN\x20?','str','cm_hopper_final','cm_hopper_black','findAll','outbound','CmList','Lists','get','sequelize','query','catch','VoiceQueueId','VoiceQueue','BlackLists','all','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resolve','unlinkSync','exit','SIGINT','info','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','inspect','insert','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','toString','NOW()','from','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x094b,0x95));var _0xb094=function(_0x4fccab,_0x1c83b7){_0x4fccab=_0x4fccab-0x0;var _0x4cc78e=_0x094b[_0x4fccab];return _0x4cc78e;};'use strict';var BPromise=require(_0xb094('0x0'));var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require(_0xb094('0x1'));var Papa=require('papaparse');var Redis=require(_0xb094('0x2'));var db=require(_0xb094('0x3'))['db'];var config=require(_0xb094('0x4'));var logger=require(_0xb094('0x5'))('api');config['redis']=_[_0xb094('0x6')](config[_0xb094('0x7')],{'host':_0xb094('0x8'),'port':0x18eb});var socket=require(_0xb094('0x9'))(new Redis(config['redis']));require(_0xb094('0xa'))[_0xb094('0xb')](socket);try{if(!process[_0xb094('0xc')][0x2]||process[_0xb094('0xc')][0x2]===_0xb094('0xd')||process[_0xb094('0xc')][0x2]===_0xb094('0xe')){throw new Error(_0xb094('0xf'));}var FILEPATH=process[_0xb094('0xc')][0x2];if(!process[_0xb094('0xc')][0x3]||process[_0xb094('0xc')][0x3]==='undefined'||process[_0xb094('0xc')][0x3]===_0xb094('0xe')||!process[_0xb094('0xc')][0x4]||process[_0xb094('0xc')][0x4]===_0xb094('0xd')||process[_0xb094('0xc')][0x4]===_0xb094('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xb094('0x10')](process[_0xb094('0xc')][0x3][_0xb094('0x11')](','),process['argv'][0x4][_0xb094('0x11')](','));if(!process[_0xb094('0xc')][0x5]||process[_0xb094('0xc')][0x5]===_0xb094('0xd')||process[_0xb094('0xc')][0x5]===_0xb094('0xe')){throw new Error(_0xb094('0x12'));}var LISTID=process[_0xb094('0xc')][0x5];var COMPANYID=process[_0xb094('0xc')][0x6]&&process[_0xb094('0xc')][0x6]!==_0xb094('0xd')&&process[_0xb094('0xc')][0x6]!==_0xb094('0xe')?process['argv'][0x6]:null;var DUPLICATES=process[_0xb094('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0xb094('0xc')][0x7]!==_0xb094('0xe')?process['argv'][0x7]:null;if(!process[_0xb094('0xc')][0x8]||process['argv'][0x8]===_0xb094('0xd')||process[_0xb094('0xc')][0x8]===_0xb094('0xe')){throw new Error(_0xb094('0x13'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x2526f9){logger[_0xb094('0x14')](_0x2526f9);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(_0x3dbcc1,_0xc50dcb,_0xaf8c62,_0x24f971){var _0x3a029f={'message':_0xc50dcb};_0x3a029f[_0x3dbcc1]=!![];if(_0xaf8c62){_0x3a029f[_0xb094('0x15')]=_0xaf8c62;}if(_0x24f971){_0x3a029f[_0xb094('0x16')]=_0x24f971;}return _0x3a029f;}function isEmail(_0x197d3b){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))*$/[_0xb094('0x17')](_0x197d3b);}function checkRow(_0x2f1c4a,_0x24bd25,_0x2f20ec){return new BPromise(function(_0x43de0c,_0x32b09d){if(_[_0xb094('0x18')](_0x2f1c4a)){return _0x32b09d(handleCheckRowError(_0xb094('0x14'),_0xb094('0x19'),null,_0x2f20ec));}if(_0x2f1c4a[_0xb094('0x1a')]&&_0x2f1c4a[_0xb094('0x1a')][_0xb094('0x1b')]){var _0x4bcea8=_[_0xb094('0x1c')](_0x2f1c4a[_0xb094('0x1a')],'message')[_0xb094('0x1d')](';');return _0x32b09d(handleCheckRowError(_0xb094('0x14'),_0x4bcea8,null,_0x2f20ec));}var _0x1ae5f2={};for(var _0x50a324 in FIELDS){if(FIELDS[_0xb094('0x1e')](_0x50a324)&&FIELDS[_0x50a324]){_0x1ae5f2[_0x50a324]=_0x2f1c4a[_0xb094('0x1f')][0x0][FIELDS[_0x50a324]]||_0x2f1c4a[_0xb094('0x1f')][0x0]['\ufeff'+FIELDS[_0x50a324]];}}if(!_0x1ae5f2['firstName']){return _0x32b09d(handleCheckRowError(_0xb094('0x14'),_0xb094('0x20'),null,_0x2f20ec));}if(!_0x1ae5f2[_0xb094('0x21')]){return _0x32b09d(handleCheckRowError('error',_0xb094('0x22'),null,_0x2f20ec));}if(_0x1ae5f2['birthDate']){var _0x504f05=moment(_0x1ae5f2[_0xb094('0x23')],_0xb094('0x24'));if(!_0x504f05[_0xb094('0x25')]()){return _0x32b09d(handleCheckRowError(_0xb094('0x14'),_0xb094('0x26'),null,_0x2f20ec));}}if(_0x1ae5f2[_0xb094('0x27')]){if(!isEmail(_0x1ae5f2[_0xb094('0x27')])){return _0x32b09d(handleCheckRowError('error',_0xb094('0x28'),null,_0x2f20ec));}}_0x1ae5f2[_0xb094('0x29')]=LISTID;_0x1ae5f2[_0xb094('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xb094('0x1b')]&&_0x24bd25){var _0x41bde1={};for(var _0x39530e=0x0,_0xe77fcd=DUPLICATES[_0xb094('0x1b')];_0x39530e<_0xe77fcd;_0x39530e+=0x1){_0x41bde1[DUPLICATES[_0x39530e]]=_0x1ae5f2[DUPLICATES[_0x39530e]];}var _0x102937=_[_0xb094('0x2b')](_0x24bd25,_0x41bde1);if(_0x102937){return _0x32b09d(handleCheckRowError('duplicate',_0xb094('0x2c'),_0x102937,_0x2f20ec));}}return db[_0xb094('0x2d')]['create'](_0x1ae5f2,{'raw':!![],'hooks':![],'fields':_[_0xb094('0x2e')](_0x1ae5f2)})[_0xb094('0x2f')](function(_0x305a2e){if(DUPLICATES&&DUPLICATES[_0xb094('0x1b')]&&_0x24bd25){_0x24bd25[_0xb094('0x30')](_[_0xb094('0x31')](_0x1ae5f2,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x305a2e['id'];return _0x43de0c();})['catch'](function(_0x515937){return _0x32b09d(handleCheckRowError(_0xb094('0x14'),_0xb094('0x32')+(_0x515937[_0xb094('0x33')]||JSON[_0xb094('0x34')](_0x515937)),null,_0x2f20ec));});});}function checkHopper(){function _0x9f3849(){return function(_0x2e357b){logger[_0xb094('0x14')](_0xb094('0x35'),'checkHopper',util[_0xb094('0x36')](_0x2e357b,{'showHidden':![],'depth':null}));};}var _0x2c13ad=function(_0x17b2fc,_0x50b90f){var _0x2a503f=squel[_0xb094('0x37')]()['into']('cm_hopper')[_0xb094('0x38')]([_0xb094('0x21'),_0xb094('0x39'),_0xb094('0x3a'),_0xb094('0x29'),_0x50b90f,_0xb094('0x3b'),_0xb094('0x3c')],squel[_0xb094('0x3d')]()[_0xb094('0x3e')](_0xb094('0x21'),'phone')[_0xb094('0x3e')]('NOW()','scheduledAt')[_0xb094('0x3e')]('id',_0xb094('0x3a'))[_0xb094('0x3e')](LISTID[_0xb094('0x3f')](),_0xb094('0x29'))['field'](_0x17b2fc['id'][_0xb094('0x3f')](),_0x50b90f)[_0xb094('0x3e')](_0xb094('0x40'),_0xb094('0x3b'))[_0xb094('0x3e')](_0xb094('0x40'),'updatedAt')[_0xb094('0x41')]('cm_contacts')['where'](_0xb094('0x42'))[_0xb094('0x43')](_0xb094('0x44'),LISTID[_0xb094('0x3f')]())[_0xb094('0x43')](_0xb094('0x45'))[_0xb094('0x43')](_0xb094('0x46'),squel[_0xb094('0x3d')]()[_0xb094('0x3e')](_0xb094('0x21'))[_0xb094('0x41')](_0xb094('0x47'))[_0xb094('0x43')](_0x50b90f+_0xb094('0x48'),_0x17b2fc['id'][_0xb094('0x3f')]())))['toString']();return _0x2a503f;};var _0x1e66c2=function(_0x3a3508,_0x5f2091){var _0x196a39=squel['insert']()[_0xb094('0x49')]('cm_hopper')[_0xb094('0x38')]([_0xb094('0x21'),_0xb094('0x39'),_0xb094('0x3a'),'ListId',_0x5f2091,'createdAt','updatedAt'],squel[_0xb094('0x3d')]()[_0xb094('0x3e')](_0xb094('0x21'),'phone')[_0xb094('0x3e')](_0xb094('0x40'),_0xb094('0x39'))[_0xb094('0x3e')]('id',_0xb094('0x3a'))[_0xb094('0x3e')](LISTID[_0xb094('0x3f')](),_0xb094('0x29'))[_0xb094('0x3e')](_0x3a3508['id'][_0xb094('0x3f')](),_0x5f2091)[_0xb094('0x3e')](_0xb094('0x40'),'createdAt')[_0xb094('0x3e')](_0xb094('0x40'),_0xb094('0x3c'))['from'](_0xb094('0x4a'))['where'](_0xb094('0x42'))['where']('ListId\x20=\x20?',LISTID[_0xb094('0x3f')]())['where'](_0xb094('0x4b'),squel[_0xb094('0x4c')](hopperContacts))[_0xb094('0x43')](_0xb094('0x45'))[_0xb094('0x43')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field']('calleridnum')[_0xb094('0x41')](_0xb094('0x4d'))[_0xb094('0x43')](_0x5f2091+_0xb094('0x48'),_0x3a3508['id'][_0xb094('0x3f')]()))[_0xb094('0x43')](_0xb094('0x46'),squel['select']()[_0xb094('0x3e')](_0xb094('0x21'))['from']('cm_hopper')[_0xb094('0x43')](_0x5f2091+'\x20=\x20?',_0x3a3508['id'][_0xb094('0x3f')]())))[_0xb094('0x3f')]();return _0x196a39;};function _0x2237c9(_0x17db91,_0x1a1b6b){var _0x36fb03=squel[_0xb094('0x37')]()['into'](_0xb094('0x47'))[_0xb094('0x38')]([_0xb094('0x21'),'scheduledAt',_0xb094('0x3a'),_0xb094('0x29'),_0x1a1b6b,_0xb094('0x3b'),_0xb094('0x3c')],squel['select']()[_0xb094('0x3e')](_0xb094('0x21'),_0xb094('0x21'))[_0xb094('0x3e')](_0xb094('0x40'),_0xb094('0x39'))[_0xb094('0x3e')]('id',_0xb094('0x3a'))[_0xb094('0x3e')](LISTID[_0xb094('0x3f')](),_0xb094('0x29'))[_0xb094('0x3e')](_0x17db91['id']['toString'](),_0x1a1b6b)[_0xb094('0x3e')](_0xb094('0x40'),_0xb094('0x3b'))[_0xb094('0x3e')](_0xb094('0x40'),'updatedAt')[_0xb094('0x41')](_0xb094('0x4a'))[_0xb094('0x43')](_0xb094('0x42'))[_0xb094('0x43')](_0xb094('0x44'),LISTID[_0xb094('0x3f')]())[_0xb094('0x43')]('id\x20IN\x20?',squel[_0xb094('0x4c')](hopperContacts))[_0xb094('0x43')](_0xb094('0x45')))['toString']();return _0x36fb03;}function _0xb4e328(_0x148e5a,_0x526221){var _0x36a77e=squel[_0xb094('0x37')]()['into'](_0xb094('0x4e'))[_0xb094('0x38')]([_0xb094('0x21'),_0xb094('0x3a'),_0xb094('0x29'),_0x526221,'createdAt',_0xb094('0x3c')],squel[_0xb094('0x3d')]()['field'](_0xb094('0x21'),'phone')[_0xb094('0x3e')]('id',_0xb094('0x3a'))['field'](LISTID[_0xb094('0x3f')](),_0xb094('0x29'))[_0xb094('0x3e')](_0x148e5a['id']['toString'](),_0x526221)[_0xb094('0x3e')](_0xb094('0x40'),'createdAt')[_0xb094('0x3e')]('NOW()','updatedAt')[_0xb094('0x41')]('cm_contacts')[_0xb094('0x43')](_0xb094('0x42'))[_0xb094('0x43')](_0xb094('0x44'),LISTID[_0xb094('0x3f')]())[_0xb094('0x43')](_0xb094('0x4b'),squel[_0xb094('0x4c')](hopperContacts))[_0xb094('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0xb094('0x3f')]();return _0x36a77e;}return db['VoiceQueue'][_0xb094('0x4f')]({'where':{'type':_0xb094('0x50')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xb094('0x51')],'as':_0xb094('0x52'),'where':{'id':LISTID}}]})['then'](function(_0x448c5a){var _0x76c38c=[];if(_0x448c5a){var _0x470c6c;for(var _0x1fa6b8=0x0,_0x2bb113;_0x1fa6b8<_0x448c5a['length'];_0x1fa6b8+=0x1){_0x2bb113=_0x448c5a[_0x1fa6b8][_0xb094('0x53')]({'plain':!![]});switch(_0x2bb113['dialCheckDuplicateType']){case'always':_0x76c38c['push'](db[_0xb094('0x54')][_0xb094('0x55')](_0x1e66c2(_0x2bb113,'VoiceQueueId'))[_0xb094('0x2f')](function(){})[_0xb094('0x56')](_0x9f3849()));break;case'onlyIfOpen':_0x76c38c['push'](db[_0xb094('0x54')][_0xb094('0x55')](_0x2c13ad(_0x2bb113,_0xb094('0x57')))['then'](function(){})['catch'](_0x9f3849()));break;default:_0x76c38c[_0xb094('0x30')](db[_0xb094('0x54')][_0xb094('0x55')](_0x2237c9(_0x2bb113,_0xb094('0x57')))[_0xb094('0x2f')](function(){})[_0xb094('0x56')](_0x9f3849()));}}}return _0x76c38c;})['all']()[_0xb094('0x2f')](function(){return db[_0xb094('0x58')][_0xb094('0x4f')]({'where':{'type':_0xb094('0x50')},'attributes':['id'],'include':[{'model':db[_0xb094('0x51')],'as':_0xb094('0x59'),'where':{'id':LISTID}}]})[_0xb094('0x2f')](function(_0x3c62b6){var _0x47512a=[];if(_0x3c62b6){var _0x5bbdf6;for(var _0x5eee25=0x0,_0x4ed771;_0x5eee25<_0x3c62b6[_0xb094('0x1b')];_0x5eee25+=0x1){_0x4ed771=_0x3c62b6[_0x5eee25][_0xb094('0x53')]({'plain':!![]});_0x47512a['push'](db[_0xb094('0x54')][_0xb094('0x55')](_0xb4e328(_0x4ed771,_0xb094('0x57')))[_0xb094('0x2f')](function(){})[_0xb094('0x56')](_0x9f3849()));}}return _0x47512a;})[_0xb094('0x5a')]();})[_0xb094('0x2f')](function(){return db['Campaign'][_0xb094('0x4f')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xb094('0x51')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x58f86f){var _0x4b00bf=[];if(_0x58f86f){for(var _0x10e5f3=0x0,_0x20f475;_0x10e5f3<_0x58f86f['length'];_0x10e5f3+=0x1){_0x20f475=_0x58f86f[_0x10e5f3][_0xb094('0x53')]({'plain':!![]});switch(_0x20f475['dialCheckDuplicateType']){case'always':_0x4b00bf[_0xb094('0x30')](db['sequelize']['query'](_0x1e66c2(_0x20f475,_0xb094('0x5b')))[_0xb094('0x2f')](function(){})[_0xb094('0x56')](_0x9f3849()));break;case'onlyIfOpen':_0x4b00bf[_0xb094('0x30')](db[_0xb094('0x54')]['query'](_0x2c13ad(_0x20f475,_0xb094('0x5b')))['then'](function(){})[_0xb094('0x56')](_0x9f3849()));break;default:_0x4b00bf[_0xb094('0x30')](db['sequelize'][_0xb094('0x55')](_0x2237c9(_0x20f475,_0xb094('0x5b')))[_0xb094('0x2f')](function(){})[_0xb094('0x56')](_0x9f3849()));}}}return _0x4b00bf;})[_0xb094('0x5a')]();})[_0xb094('0x2f')](function(){return db[_0xb094('0x5c')][_0xb094('0x4f')]({'attributes':['id'],'include':[{'model':db[_0xb094('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xb094('0x2f')](function(_0x512ce8){var _0x463b16=[];if(_0x512ce8){for(var _0x3bcf6d=0x0,_0x36aff8;_0x3bcf6d<_0x512ce8[_0xb094('0x1b')];_0x3bcf6d+=0x1){_0x36aff8=_0x512ce8[_0x3bcf6d][_0xb094('0x53')]({'plain':!![]});_0x463b16['push'](db[_0xb094('0x54')][_0xb094('0x55')](_0xb4e328(_0x36aff8,_0xb094('0x5b')))[_0xb094('0x2f')](function(){})['catch'](_0x9f3849()));}}return _0x463b16;})[_0xb094('0x5a')]();})[_0xb094('0x56')](function(_0x44fbf3){logger[_0xb094('0x14')](_0xb094('0x5d'),_0xb094('0x5e'),_0x44fbf3[_0xb094('0x33')]);});}var processPromises=function(_0x2cbe40){return BPromise[_0xb094('0x5a')](promises)[_0xb094('0x2f')](function(_0x2b2baf){})[_0xb094('0x56')](function(_0x546f8b){logger[_0xb094('0x14')](_0xb094('0x5f'),JSON[_0xb094('0x34')](_0x546f8b));})[_0xb094('0x60')](function(){socket[_0xb094('0x61')](_0xb094('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2cbe40){return _0x2cbe40['resume']();}});};var endCsv=function(){return BPromise[_0xb094('0x63')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xb094('0x2f')](function(){socket[_0xb094('0x61')](_0xb094('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb094('0x64')](FILEPATH);}catch(_0x158058){logger[_0xb094('0x14')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xb094('0x34')](_0x158058));}finally{process[_0xb094('0x65')](0x0);}});};process['on'](_0xb094('0x66'),function(){logger[_0xb094('0x67')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xb094('0x63')]()[_0xb094('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db['CmContact'][_0xb094('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xb094('0x2f')](function(_0x2c6f21){var _0xee5494=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xb094('0x68')](_0xee5494,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3021bb,_0x1f5037){total+=0x1;var _0x4cc26d=total;promises[_0xb094('0x30')](checkRow(_0x3021bb,_0x2c6f21,_0x4cc26d)['then'](function(){success+=0x1;})['catch'](function(_0x1ac1e1){if(_0x1ac1e1[_0xb094('0x14')]){errors+=0x1;delete _0x1ac1e1[_0xb094('0x14')];}else if(_0x1ac1e1[_0xb094('0x69')]){duplicates+=0x1;delete _0x1ac1e1[_0xb094('0x69')];}rows[_0xb094('0x30')](_0x1ac1e1);}));if(total%0xc8===0x0){_0x1f5037[_0xb094('0x6a')]();return processPromises(_0x1f5037);}},'complete':function(){return processPromises()['then'](function(){logger['info'](_0xb094('0x6b'));endCsv();});},'error':function(_0x4e4605,_0x4236a3){logger[_0xb094('0x67')](_0xb094('0x6c'),JSON[_0xb094('0x34')](_0x4e4605));endCsv();}});})['catch'](function(_0x263a33){logger['error'](_0xb094('0x6d'),JSON['stringify'](_0x263a33));});}main(); \ No newline at end of file +var _0x589c=['localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','isValid','email','ListId','CompanyId','find','duplicate','CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','message','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','field','NOW()','toString','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','into','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','dialCheckDuplicateType','always','sequelize','query','catch','onlyIfOpen','VoiceQueueId','all','get','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','stringify','finally','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','api','defaults','redis'];(function(_0xa6d7bb,_0x76d0a5){var _0xaf51ec=function(_0x29bd3c){while(--_0x29bd3c){_0xa6d7bb['push'](_0xa6d7bb['shift']());}};_0xaf51ec(++_0x76d0a5);}(_0x589c,0x149));var _0xc589=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x589c[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0xc589('0x0'));var util=require('util');var _=require(_0xc589('0x1'));var fs=require('fs');var squel=require(_0xc589('0x2'));var Papa=require(_0xc589('0x3'));var Redis=require(_0xc589('0x4'));var db=require(_0xc589('0x5'))['db'];var config=require(_0xc589('0x6'));var logger=require('../../../config/logger')(_0xc589('0x7'));config['redis']=_[_0xc589('0x8')](config[_0xc589('0x9')],{'host':_0xc589('0xa'),'port':0x18eb});var socket=require(_0xc589('0xb'))(new Redis(config[_0xc589('0x9')]));require(_0xc589('0xc'))[_0xc589('0xd')](socket);try{if(!process[_0xc589('0xe')][0x2]||process['argv'][0x2]==='undefined'||process[_0xc589('0xe')][0x2]===_0xc589('0xf')){throw new Error(_0xc589('0x10'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0xc589('0xe')][0x3]==='undefined'||process[_0xc589('0xe')][0x3]===_0xc589('0xf')||!process[_0xc589('0xe')][0x4]||process[_0xc589('0xe')][0x4]===_0xc589('0x11')||process[_0xc589('0xe')][0x4]===_0xc589('0xf')){throw new Error(_0xc589('0x12'));}var FIELDS=_[_0xc589('0x13')](process[_0xc589('0xe')][0x3][_0xc589('0x14')](','),process[_0xc589('0xe')][0x4]['split'](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0xc589('0x11')||process['argv'][0x5]===_0xc589('0xf')){throw new Error(_0xc589('0x15'));}var LISTID=process[_0xc589('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xc589('0xe')][0x6]!==_0xc589('0x11')&&process['argv'][0x6]!=='null'?process[_0xc589('0xe')][0x6]:null;var DUPLICATES=process[_0xc589('0xe')][0x7]&&process[_0xc589('0xe')][0x7]!==_0xc589('0x11')&&process[_0xc589('0xe')][0x7]!==_0xc589('0xf')?process[_0xc589('0xe')][0x7]:null;if(!process[_0xc589('0xe')][0x8]||process[_0xc589('0xe')][0x8]==='undefined'||process[_0xc589('0xe')][0x8]===_0xc589('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xc589('0xe')][0x8];}catch(_0x198ced){logger['error'](_0x198ced);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(_0x418160,_0x3a34c7,_0x2fce07,_0x5b7ab7){var _0x175970={'message':_0x3a34c7};_0x175970[_0x418160]=!![];if(_0x2fce07){_0x175970['contact']=_0x2fce07;}if(_0x5b7ab7){_0x175970['index']=_0x5b7ab7;}return _0x175970;}function isEmail(_0x4c81e7){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'](_0x4c81e7);}function checkRow(_0x1dc236,_0x55a435,_0x524234){return new BPromise(function(_0x39b8cd,_0x127e13){if(_[_0xc589('0x16')](_0x1dc236)){return _0x127e13(handleCheckRowError(_0xc589('0x17'),_0xc589('0x18'),null,_0x524234));}if(_0x1dc236[_0xc589('0x19')]&&_0x1dc236[_0xc589('0x19')][_0xc589('0x1a')]){var _0x34e838=_[_0xc589('0x1b')](_0x1dc236[_0xc589('0x19')],'message')[_0xc589('0x1c')](';');return _0x127e13(handleCheckRowError(_0xc589('0x17'),_0x34e838,null,_0x524234));}var _0x22a20d={};for(var _0x6b4e49 in FIELDS){if(FIELDS[_0xc589('0x1d')](_0x6b4e49)&&FIELDS[_0x6b4e49]){_0x22a20d[_0x6b4e49]=_0x1dc236[_0xc589('0x1e')][0x0][FIELDS[_0x6b4e49]]||_0x1dc236[_0xc589('0x1e')][0x0]['\ufeff'+FIELDS[_0x6b4e49]];}}if(!_0x22a20d[_0xc589('0x1f')]){return _0x127e13(handleCheckRowError(_0xc589('0x17'),'firstName\x20not\x20specified!',null,_0x524234));}if(!_0x22a20d[_0xc589('0x20')]){return _0x127e13(handleCheckRowError('error',_0xc589('0x21'),null,_0x524234));}if(_0x22a20d[_0xc589('0x22')]){var _0x1c61d1=moment(_0x22a20d['birthDate'],'YYYY-MM-DD');if(!_0x1c61d1[_0xc589('0x23')]()){return _0x127e13(handleCheckRowError(_0xc589('0x17'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x524234));}}if(_0x22a20d[_0xc589('0x24')]){if(!isEmail(_0x22a20d[_0xc589('0x24')])){return _0x127e13(handleCheckRowError(_0xc589('0x17'),'email\x20format\x20is\x20not\x20valid!',null,_0x524234));}}_0x22a20d[_0xc589('0x25')]=LISTID;_0x22a20d[_0xc589('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x55a435){var _0x2495f4={};for(var _0x3189e2=0x0,_0xea755e=DUPLICATES[_0xc589('0x1a')];_0x3189e2<_0xea755e;_0x3189e2+=0x1){_0x2495f4[DUPLICATES[_0x3189e2]]=_0x22a20d[DUPLICATES[_0x3189e2]];}var _0x5b2f69=_[_0xc589('0x27')](_0x55a435,_0x2495f4);if(_0x5b2f69){return _0x127e13(handleCheckRowError(_0xc589('0x28'),'Duplicate\x20Contact',_0x5b2f69,_0x524234));}}return db[_0xc589('0x29')][_0xc589('0x2a')](_0x22a20d,{'raw':!![],'hooks':![],'fields':_[_0xc589('0x2b')](_0x22a20d)})[_0xc589('0x2c')](function(_0x4fcf76){if(DUPLICATES&&DUPLICATES[_0xc589('0x1a')]&&_0x55a435){_0x55a435[_0xc589('0x2d')](_[_0xc589('0x2e')](_0x22a20d,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4fcf76['id'];return _0x39b8cd();})['catch'](function(_0x3a0b79){return _0x127e13(handleCheckRowError(_0xc589('0x17'),_0xc589('0x2f')+(_0x3a0b79[_0xc589('0x30')]||JSON['stringify'](_0x3a0b79)),null,_0x524234));});});}function checkHopper(){function _0x217fe0(){return function(_0x2ae4bb){logger[_0xc589('0x17')](_0xc589('0x31'),_0xc589('0x32'),util[_0xc589('0x33')](_0x2ae4bb,{'showHidden':![],'depth':null}));};}var _0x8ed8b2=function(_0x2e73a4,_0x1c86ea){var _0x18067a=squel[_0xc589('0x34')]()['into'](_0xc589('0x35'))[_0xc589('0x36')]([_0xc589('0x20'),_0xc589('0x37'),_0xc589('0x38'),_0xc589('0x25'),_0x1c86ea,_0xc589('0x39'),'updatedAt'],squel['select']()['field'](_0xc589('0x20'),_0xc589('0x20'))[_0xc589('0x3a')](_0xc589('0x3b'),'scheduledAt')['field']('id',_0xc589('0x38'))[_0xc589('0x3a')](LISTID['toString'](),_0xc589('0x25'))[_0xc589('0x3a')](_0x2e73a4['id'][_0xc589('0x3c')](),_0x1c86ea)[_0xc589('0x3a')]('NOW()',_0xc589('0x39'))['field'](_0xc589('0x3b'),_0xc589('0x3d'))[_0xc589('0x3e')](_0xc589('0x3f'))[_0xc589('0x40')](_0xc589('0x41'))['where'](_0xc589('0x42'),LISTID['toString']())[_0xc589('0x40')](_0xc589('0x43'))[_0xc589('0x40')](_0xc589('0x44'),squel[_0xc589('0x45')]()[_0xc589('0x3a')](_0xc589('0x20'))[_0xc589('0x3e')](_0xc589('0x35'))[_0xc589('0x40')](_0x1c86ea+_0xc589('0x46'),_0x2e73a4['id'][_0xc589('0x3c')]())))['toString']();return _0x18067a;};var _0x2d07e6=function(_0x4f780a,_0x3f276a){var _0x393a4f=squel[_0xc589('0x34')]()[_0xc589('0x47')](_0xc589('0x35'))['fromQuery']([_0xc589('0x20'),_0xc589('0x37'),'ContactId','ListId',_0x3f276a,'createdAt',_0xc589('0x3d')],squel[_0xc589('0x45')]()[_0xc589('0x3a')]('phone',_0xc589('0x20'))[_0xc589('0x3a')](_0xc589('0x3b'),_0xc589('0x37'))[_0xc589('0x3a')]('id',_0xc589('0x38'))[_0xc589('0x3a')](LISTID['toString'](),_0xc589('0x25'))['field'](_0x4f780a['id'][_0xc589('0x3c')](),_0x3f276a)[_0xc589('0x3a')](_0xc589('0x3b'),_0xc589('0x39'))[_0xc589('0x3a')](_0xc589('0x3b'),_0xc589('0x3d'))[_0xc589('0x3e')](_0xc589('0x3f'))[_0xc589('0x40')](_0xc589('0x41'))[_0xc589('0x40')](_0xc589('0x42'),LISTID[_0xc589('0x3c')]())[_0xc589('0x40')](_0xc589('0x48'),squel[_0xc589('0x49')](hopperContacts))[_0xc589('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0xc589('0x40')](_0xc589('0x44'),squel[_0xc589('0x45')]()[_0xc589('0x3a')](_0xc589('0x4a'))[_0xc589('0x3e')](_0xc589('0x4b'))[_0xc589('0x40')](_0x3f276a+_0xc589('0x46'),_0x4f780a['id'][_0xc589('0x3c')]()))[_0xc589('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc589('0x45')]()['field'](_0xc589('0x20'))[_0xc589('0x3e')](_0xc589('0x35'))[_0xc589('0x40')](_0x3f276a+_0xc589('0x46'),_0x4f780a['id'][_0xc589('0x3c')]())))[_0xc589('0x3c')]();return _0x393a4f;};function _0x3f9e96(_0x1f0532,_0x418661){var _0x50feb8=squel[_0xc589('0x34')]()['into'](_0xc589('0x35'))[_0xc589('0x36')]([_0xc589('0x20'),_0xc589('0x37'),_0xc589('0x38'),_0xc589('0x25'),_0x418661,'createdAt','updatedAt'],squel[_0xc589('0x45')]()[_0xc589('0x3a')](_0xc589('0x20'),_0xc589('0x20'))[_0xc589('0x3a')](_0xc589('0x3b'),'scheduledAt')[_0xc589('0x3a')]('id',_0xc589('0x38'))[_0xc589('0x3a')](LISTID[_0xc589('0x3c')](),_0xc589('0x25'))[_0xc589('0x3a')](_0x1f0532['id'][_0xc589('0x3c')](),_0x418661)[_0xc589('0x3a')]('NOW()',_0xc589('0x39'))[_0xc589('0x3a')]('NOW()',_0xc589('0x3d'))[_0xc589('0x3e')]('cm_contacts')[_0xc589('0x40')](_0xc589('0x41'))[_0xc589('0x40')](_0xc589('0x42'),LISTID[_0xc589('0x3c')]())[_0xc589('0x40')](_0xc589('0x48'),squel[_0xc589('0x49')](hopperContacts))[_0xc589('0x40')](_0xc589('0x43')))[_0xc589('0x3c')]();return _0x50feb8;}function _0x485a2b(_0x4914af,_0x278719){var _0x4152b3=squel[_0xc589('0x34')]()[_0xc589('0x47')](_0xc589('0x4c'))['fromQuery']([_0xc589('0x20'),'ContactId',_0xc589('0x25'),_0x278719,_0xc589('0x39'),'updatedAt'],squel[_0xc589('0x45')]()[_0xc589('0x3a')](_0xc589('0x20'),'phone')[_0xc589('0x3a')]('id',_0xc589('0x38'))[_0xc589('0x3a')](LISTID[_0xc589('0x3c')](),'ListId')[_0xc589('0x3a')](_0x4914af['id'][_0xc589('0x3c')](),_0x278719)[_0xc589('0x3a')](_0xc589('0x3b'),_0xc589('0x39'))[_0xc589('0x3a')]('NOW()','updatedAt')[_0xc589('0x3e')]('cm_contacts')[_0xc589('0x40')](_0xc589('0x41'))[_0xc589('0x40')](_0xc589('0x42'),LISTID['toString']())[_0xc589('0x40')](_0xc589('0x48'),squel[_0xc589('0x49')](hopperContacts))[_0xc589('0x40')](_0xc589('0x43')))[_0xc589('0x3c')]();return _0x4152b3;}return db[_0xc589('0x4d')][_0xc589('0x4e')]({'where':{'type':_0xc589('0x4f')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xc589('0x50')],'as':_0xc589('0x51'),'where':{'id':LISTID}}]})[_0xc589('0x2c')](function(_0x1c2f2e){var _0x2dd1b3=[];if(_0x1c2f2e){var _0x35db25;for(var _0x5147a2=0x0,_0x3a2bc2;_0x5147a2<_0x1c2f2e[_0xc589('0x1a')];_0x5147a2+=0x1){_0x3a2bc2=_0x1c2f2e[_0x5147a2]['get']({'plain':!![]});switch(_0x3a2bc2[_0xc589('0x52')]){case _0xc589('0x53'):_0x2dd1b3[_0xc589('0x2d')](db[_0xc589('0x54')][_0xc589('0x55')](_0x2d07e6(_0x3a2bc2,'VoiceQueueId'))[_0xc589('0x2c')](function(){})[_0xc589('0x56')](_0x217fe0()));break;case _0xc589('0x57'):_0x2dd1b3[_0xc589('0x2d')](db[_0xc589('0x54')][_0xc589('0x55')](_0x8ed8b2(_0x3a2bc2,_0xc589('0x58')))[_0xc589('0x2c')](function(){})[_0xc589('0x56')](_0x217fe0()));break;default:_0x2dd1b3[_0xc589('0x2d')](db[_0xc589('0x54')][_0xc589('0x55')](_0x3f9e96(_0x3a2bc2,'VoiceQueueId'))[_0xc589('0x2c')](function(){})[_0xc589('0x56')](_0x217fe0()));}}}return _0x2dd1b3;})[_0xc589('0x59')]()['then'](function(){return db[_0xc589('0x4d')][_0xc589('0x4e')]({'where':{'type':_0xc589('0x4f')},'attributes':['id'],'include':[{'model':db[_0xc589('0x50')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x5a169d){var _0x58cdeb=[];if(_0x5a169d){var _0x240d4e;for(var _0x1cafba=0x0,_0x1b29f9;_0x1cafba<_0x5a169d[_0xc589('0x1a')];_0x1cafba+=0x1){_0x1b29f9=_0x5a169d[_0x1cafba][_0xc589('0x5a')]({'plain':!![]});_0x58cdeb['push'](db[_0xc589('0x54')][_0xc589('0x55')](_0x485a2b(_0x1b29f9,_0xc589('0x58')))[_0xc589('0x2c')](function(){})[_0xc589('0x56')](_0x217fe0()));}}return _0x58cdeb;})[_0xc589('0x59')]();})[_0xc589('0x2c')](function(){return db[_0xc589('0x5b')][_0xc589('0x4e')]({'attributes':['id',_0xc589('0x52')],'include':[{'model':db[_0xc589('0x50')],'as':'Lists','where':{'id':LISTID}}]})[_0xc589('0x2c')](function(_0x4e6f57){var _0x65862e=[];if(_0x4e6f57){for(var _0x2d203c=0x0,_0xa73c95;_0x2d203c<_0x4e6f57[_0xc589('0x1a')];_0x2d203c+=0x1){_0xa73c95=_0x4e6f57[_0x2d203c]['get']({'plain':!![]});switch(_0xa73c95[_0xc589('0x52')]){case _0xc589('0x53'):_0x65862e['push'](db['sequelize'][_0xc589('0x55')](_0x2d07e6(_0xa73c95,_0xc589('0x5c')))[_0xc589('0x2c')](function(){})[_0xc589('0x56')](_0x217fe0()));break;case _0xc589('0x57'):_0x65862e[_0xc589('0x2d')](db[_0xc589('0x54')][_0xc589('0x55')](_0x8ed8b2(_0xa73c95,_0xc589('0x5c')))['then'](function(){})['catch'](_0x217fe0()));break;default:_0x65862e[_0xc589('0x2d')](db[_0xc589('0x54')][_0xc589('0x55')](_0x3f9e96(_0xa73c95,_0xc589('0x5c')))[_0xc589('0x2c')](function(){})[_0xc589('0x56')](_0x217fe0()));}}}return _0x65862e;})[_0xc589('0x59')]();})[_0xc589('0x2c')](function(){return db[_0xc589('0x5b')][_0xc589('0x4e')]({'attributes':['id'],'include':[{'model':db[_0xc589('0x50')],'as':_0xc589('0x5d'),'where':{'id':LISTID}}]})[_0xc589('0x2c')](function(_0x3e6c54){var _0x50c6dc=[];if(_0x3e6c54){for(var _0x39044f=0x0,_0x12f333;_0x39044f<_0x3e6c54[_0xc589('0x1a')];_0x39044f+=0x1){_0x12f333=_0x3e6c54[_0x39044f][_0xc589('0x5a')]({'plain':!![]});_0x50c6dc[_0xc589('0x2d')](db[_0xc589('0x54')][_0xc589('0x55')](_0x485a2b(_0x12f333,'CampaignId'))[_0xc589('0x2c')](function(){})[_0xc589('0x56')](_0x217fe0()));}}return _0x50c6dc;})[_0xc589('0x59')]();})[_0xc589('0x56')](function(_0x266e96){logger[_0xc589('0x17')](_0xc589('0x5e'),'generalCheckHopper',_0x266e96[_0xc589('0x30')]);});}var processPromises=function(_0x1c0ecd){return BPromise[_0xc589('0x59')](promises)[_0xc589('0x2c')](function(_0x569055){})[_0xc589('0x56')](function(_0x2ca1d7){logger[_0xc589('0x17')](_0xc589('0x5f'),JSON[_0xc589('0x60')](_0x2ca1d7));})[_0xc589('0x61')](function(){socket[_0xc589('0x62')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1c0ecd){return _0x1c0ecd[_0xc589('0x63')]();}});};var endCsv=function(){return BPromise[_0xc589('0x64')]()[_0xc589('0x2c')](function(){if(hopperContacts){return checkHopper();}})[_0xc589('0x2c')](function(){socket[_0xc589('0x62')](_0xc589('0x65')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xc589('0x66')](FILEPATH);}catch(_0x322f51){logger[_0xc589('0x17')](_0xc589('0x67'),JSON['stringify'](_0x322f51));}finally{process['exit'](0x0);}});};process['on'](_0xc589('0x68'),function(){logger[_0xc589('0x69')](_0xc589('0x6a'));endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xc589('0x14')](',');return db['CmContact'][_0xc589('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xc589('0x2c')](function(_0x53dac6){var _0x3fd3c5=fs[_0xc589('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xc589('0x6c')](_0x3fd3c5,{'header':!![],'skipEmptyLines':!![],'step':function(_0x303915,_0x129426){total+=0x1;var _0x444f15=total;promises[_0xc589('0x2d')](checkRow(_0x303915,_0x53dac6,_0x444f15)['then'](function(){success+=0x1;})['catch'](function(_0x3147d4){if(_0x3147d4['error']){errors+=0x1;delete _0x3147d4[_0xc589('0x17')];}else if(_0x3147d4[_0xc589('0x28')]){duplicates+=0x1;delete _0x3147d4[_0xc589('0x28')];}rows[_0xc589('0x2d')](_0x3147d4);}));if(total%0xc8===0x0){_0x129426[_0xc589('0x6d')]();return processPromises(_0x129426);}},'complete':function(){return processPromises()['then'](function(){logger[_0xc589('0x69')](_0xc589('0x6e'));endCsv();});},'error':function(_0x1b6570,_0x13ca3f){logger[_0xc589('0x69')](_0xc589('0x6f'),JSON[_0xc589('0x60')](_0x1b6570));endCsv();}});})['catch'](function(_0x3eb92e){logger[_0xc589('0x17')](_0xc589('0x70'),JSON['stringify'](_0x3eb92e));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 01c03c5..36441a8 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 _0xe50a=['findAll','AdditionalPhones','length','push','then','split','all','isNil','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','phone','scheduledat','updatedAt','priority','UserId','recallme','fields','cm_contacts','.CmListId','.id\x20=\x20','.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','into','cm_hopper_black','ContactId','ListId','createdAt','ListId\x20=\x20?','\x20=\x20','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.ListId\x20=\x20','field','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','exit','code','message','sequelize','query','spread','catch','error','campaigns.id','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','set','offset','dialTimezone','info','main','stringify','binding','clone','socket_timestamp','root','server/files/tmp','includes','name','parse','data','errors','find','hasOwnProperty','replace','isValid','isNaN','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','trim','itemTypeId','description','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','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()','each','contactTypeId','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','from','join','where','.dialCheckDuplicateType\x20IN\x20(','CmContact'];(function(_0x461c18,_0x5605b9){var _0x35501c=function(_0x1cd251){while(--_0x1cd251){_0x461c18['push'](_0x461c18['shift']());}};_0x35501c(++_0x5605b9);}(_0xe50a,0xa2));var _0xae50=function(_0x5b6cf1,_0x32fdcd){_0x5b6cf1=_0x5b6cf1-0x0;var _0x46278c=_0xe50a[_0x5b6cf1];return _0x46278c;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xae50('0x0'));var Papa=require(_0xae50('0x1'));var util=require('util');var BPromise=require(_0xae50('0x2'));var moment=require(_0xae50('0x3'));var squel=require(_0xae50('0x4'));var Redis=require('ioredis');var db=require(_0xae50('0x5'))['db'];var config=require(_0xae50('0x6'));var shared=require(_0xae50('0x7'));var logger=require(_0xae50('0x8'))(_0xae50('0x9'));config[_0xae50('0xa')]=_[_0xae50('0xb')](config['redis'],{'host':_0xae50('0xc'),'port':0x18eb});var socket=require(_0xae50('0xd'))(new Redis(config[_0xae50('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xae50('0xe')](_0xae50('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0xae50('0xf'));function isEmail(_0x795b47){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))*$/[_0xae50('0x10')](_0x795b47);}function selectNotIn(_0x319231,_0x59493a,_0x4332ed,_0x500967,_0x46fe38){return squel[_0xae50('0x11')]()['field']('phone')[_0xae50('0x12')](_0x500967)[_0xae50('0x13')](_0x59493a,null,_0x59493a+'.id\x20=\x20'+_0x500967+'.'+_0x4332ed)[_0xae50('0x14')](_0x500967+'.'+_0x4332ed+'\x20=\x20'+_0x319231+'.'+_0x4332ed)[_0xae50('0x14')](_0x59493a+_0xae50('0x15')+_0x46fe38[_0xae50('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5d8f14,_0xdade40){promisesAdditionalPhones=[];return db[_0xae50('0x16')][_0xae50('0x17')]({'raw':!![],'attributes':['id',_0xae50('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x177155){if(_0x177155!==null){var _0x28e720=[];for(var _0x460a02=0x0;_0x460a02<_0x177155[_0xae50('0x19')];_0x460a02++){var _0x3d21d0=_0x177155[_0x460a02];_0x28e720[_0xae50('0x1a')](insertAdditionalPhones(_0x3d21d0));}}Promise['all'](_0x28e720)[_0xae50('0x1b')](function(){_0x5d8f14({'val':0x1});});});});}function insertAdditionalPhones(_0x16197d){return new Promise(function(_0x13b3b7,_0x27b6ba){var _0x28a300=_0x16197d[_0xae50('0x18')];var _0x320aef=_0x28a300[_0xae50('0x1c')](';');var _0x52e7ef=[];orderBy=0x0;for(var _0x2698b8=0x0;_0x2698b8<_0x320aef[_0xae50('0x19')];_0x2698b8++){_0x52e7ef[_0xae50('0x1a')](splitAdditionalPhone(_0x16197d['id'],_0x320aef[_0x2698b8]));}Promise[_0xae50('0x1d')](_0x52e7ef)[_0xae50('0x1b')](function(){_0x13b3b7({'val':_0x320aef['length']});});});}function splitAdditionalPhone(_0x131942,_0xed5890){return new Promise(function(_0x315256,_0x37cd12){var _0x1c7376=_0xed5890[_0xae50('0x1c')](':');var _0x1d0616=_0x1c7376[0x0];var _0x6318a6=_0x1c7376[0x1];if(!_[_0xae50('0x1e')](_0x6318a6)){var _0x22a2a3=_0x6318a6[_0xae50('0x1c')]('|');var _0x2cbae1=[];for(var _0x312706=0x0;_0x312706<_0x22a2a3[_0xae50('0x19')];_0x312706++){if(_0x22a2a3[_0x312706]!==''){var _0x347eeb=_[_0xae50('0x1f')](promisesAdditionalPhones,{'contactId':_0x131942,'phone':_0x22a2a3[_0x312706]});if(_0x347eeb[_0xae50('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0xae50('0x1a')]({'contactId':_0x131942,'contactTypeId':_0x1d0616,'phone':_0x22a2a3[_0x312706],'orderBy':orderBy});}}}_0x315256({'ok':0x1});}else _0x315256({'res':0x0});});}function createAdditionalPhone(_0x137284,_0x44ea7d,_0x41cc98,_0x30ab69){var _0x53ea5a='';var _0x5cbe7b='';var _0x2bcbd6=_0x41cc98['split']('§');_0x53ea5a=_0x2bcbd6[0x0];if(_0x2bcbd6[_0xae50('0x19')]==0x2)_0x5cbe7b=_0x2bcbd6[0x1];return new Promise(function(_0x291e36,_0x28fe14){return db[_0xae50('0x20')][_0xae50('0x21')]({'where':{'CmContactId':_0x137284,'item':_0x53ea5a}})[_0xae50('0x1b')](function(_0x547ee0){if(_0x547ee0){return db['CmContactHasItem'][_0xae50('0x22')]({'ItemTypeId':_0x44ea7d,'description':_0x5cbe7b,'OrderBy':_0x30ab69},{'where':{'CmContactId':_0x137284,'item':_0x53ea5a}})[_0xae50('0x1b')](function(_0x1a47d7){_0x291e36({'res':_0xae50('0x23')});});}else{return db['CmContactHasItem'][_0xae50('0x24')]({'CmContactId':_0x137284,'item':_0x53ea5a,'description':_0x5cbe7b,'ItemTypeId':_0x44ea7d,'OrderBy':_0x30ab69,'ItemClass':_0xae50('0x25')})[_0xae50('0x1b')](function(_0x2b9954){_0x291e36({'res':_0xae50('0x26')});});}});});}function insertCmHopper(_0xb5f4f4,_0x415f35,_0x5a9578,_0x1aba24,_0x598494){var _0x2c4618=['cm_contacts.phone','cm_contacts.scheduledat',_0xae50('0x27'),_0xae50('0x28'),_0x415f35+'.'+_0x1aba24,'cm_contacts.createdAt',_0xae50('0x29'),_0xae50('0x2a'),_0xae50('0x2b'),'\x22'+_0x598494+'\x22'];return squel[_0xae50('0x2c')]()['into'](_0xae50('0x2d'))[_0xae50('0x2e')]([_0xae50('0x2f'),_0xae50('0x30'),'ContactId','ListId',_0x1aba24,'createdAt',_0xae50('0x31'),_0xae50('0x32'),_0xae50('0x33'),_0xae50('0x34')],squel[_0xae50('0x11')]()[_0xae50('0x35')](_0x2c4618)[_0xae50('0x12')](_0x415f35)[_0xae50('0x13')](_0xae50('0x36'),null,'cm_contacts.ListId\x20=\x20'+_0x415f35+_0xae50('0x37'))['join'](_0x5a9578,null,_0x5a9578+_0xae50('0x38')+_0x415f35+'.'+_0x1aba24)[_0xae50('0x14')](_0x415f35+_0xae50('0x39'),_0xb5f4f4)[_0xae50('0x14')](_0xae50('0x3a'),NOW)[_0xae50('0x14')](_0xae50('0x3b'),selectNotIn(_0x415f35,_0x5a9578,_0x1aba24,_0xae50('0x2d'),[_0xae50('0x3c'),_0xae50('0x3d')]))[_0xae50('0x14')](_0xae50('0x3b'),selectNotIn(_0x415f35,_0x5a9578,_0x1aba24,_0xae50('0x2d'),['\x22always\x22'])))[_0xae50('0x3e')]();}function insertCmHopperBlack(_0xc76a01,_0x27c5b6,_0x1361aa,_0xd25282){var _0x40af9a=[_0xae50('0x3f'),_0xae50('0x27'),_0xae50('0x28'),_0x27c5b6+'.'+_0xd25282,_0xae50('0x40'),_0xae50('0x29')];return squel[_0xae50('0x2c')]()[_0xae50('0x41')](_0xae50('0x42'))[_0xae50('0x2e')]([_0xae50('0x2f'),_0xae50('0x43'),_0xae50('0x44'),_0xd25282,_0xae50('0x45'),_0xae50('0x31')],squel['select']()[_0xae50('0x35')](_0x40af9a)[_0xae50('0x12')](_0x27c5b6)[_0xae50('0x13')](_0xae50('0x36'),null,'cm_contacts.ListId\x20=\x20'+_0x27c5b6+_0xae50('0x37'))[_0xae50('0x13')](_0x1361aa,null,_0x1361aa+_0xae50('0x38')+_0x27c5b6+'.'+_0xd25282)[_0xae50('0x14')](_0x27c5b6+_0xae50('0x39'),_0xc76a01)['where'](_0xae50('0x3a'),NOW)[_0xae50('0x14')](_0xae50('0x3b'),squel[_0xae50('0x11')]()['field'](_0xae50('0x2f'))[_0xae50('0x12')](_0xae50('0x42'))['where'](_0xae50('0x46'),_0xc76a01)['where'](_0xd25282+_0xae50('0x47')+_0x27c5b6+'.'+_0xd25282)))[_0xae50('0x3e')]();}function insertTzCmHopper(_0x17a13e,_0x5c68ad,_0x1ada1e,_0x4c52cd,_0x5673db,_0x4907a8){var _0x444399=[_0xae50('0x3f'),_0xae50('0x48')+_0x4907a8+_0xae50('0x49'),_0xae50('0x27'),'cm_contacts.ListId',_0x5c68ad+'.'+_0x4c52cd,'cm_contacts.createdAt',_0xae50('0x29'),'cm_contacts.priority',_0xae50('0x2b'),'\x22'+_0x5673db+'\x22'];var _0x20074e=squel['insert']()[_0xae50('0x41')](_0xae50('0x2d'))[_0xae50('0x2e')]([_0xae50('0x2f'),_0xae50('0x30'),_0xae50('0x43'),_0xae50('0x44'),_0x4c52cd,_0xae50('0x45'),_0xae50('0x31'),'priority',_0xae50('0x33'),_0xae50('0x34')],squel[_0xae50('0x11')]()[_0xae50('0x35')](_0x444399)[_0xae50('0x12')](_0x5c68ad)[_0xae50('0x13')](_0xae50('0x36'),null,_0xae50('0x4a')+_0x5c68ad+'.CmListId')['join'](_0x1ada1e,null,_0x1ada1e+_0xae50('0x38')+_0x5c68ad+'.'+_0x4c52cd)[_0xae50('0x13')](_0x4907a8,null,_0x4907a8+'.id\x20=\x20'+_0x5c68ad+'.'+_0x4c52cd)[_0xae50('0x14')](_0x5c68ad+_0xae50('0x39'),_0x17a13e)[_0xae50('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xae50('0x14')](_0xae50('0x3b'),selectNotIn(_0x5c68ad,_0x1ada1e,_0x4c52cd,_0xae50('0x2d'),[_0xae50('0x3c'),'\x22onlyIfOpen\x22']))['where'](_0xae50('0x3b'),selectNotIn(_0x5c68ad,_0x1ada1e,_0x4c52cd,'cm_hopper',['\x22always\x22'])))[_0xae50('0x3e')]();return _0x20074e;}function insertTzCmHopperBlack(_0x309985,_0x2334e8,_0x2ffbae,_0x33207b){var _0x11f884=['cm_contacts.phone',_0xae50('0x27'),'cm_contacts.ListId',_0x2334e8+'.'+_0x33207b,_0xae50('0x40'),_0xae50('0x29')];return squel[_0xae50('0x2c')]()['into']('cm_hopper_black')[_0xae50('0x2e')]([_0xae50('0x2f'),_0xae50('0x43'),'ListId',_0x33207b,'createdAt','updatedAt'],squel[_0xae50('0x11')]()['fields'](_0x11f884)[_0xae50('0x12')](_0x2334e8)[_0xae50('0x13')](_0xae50('0x36'),null,'cm_contacts.ListId\x20=\x20'+_0x2334e8+'.CmListId')['join'](_0x2ffbae,null,_0x2ffbae+_0xae50('0x38')+_0x2334e8+'.'+_0x33207b)[_0xae50('0x14')](_0x2334e8+_0xae50('0x39'),_0x309985)[_0xae50('0x14')](_0xae50('0x3a'),NOW)['where'](_0xae50('0x3b'),squel[_0xae50('0x11')]()[_0xae50('0x4b')]('phone')['from'](_0xae50('0x42'))['where'](_0xae50('0x46'),_0x309985)[_0xae50('0x14')](_0x33207b+_0xae50('0x47')+_0x2334e8+'.'+_0x33207b)))[_0xae50('0x3e')]();}function insertCmHopperAdditionalPhones(_0x52a8de){var _0x15dd76=[_0xae50('0x4c'),_0xae50('0x4d'),_0xae50('0x4e'),_0xae50('0x4f'),_0xae50('0x50')];return squel[_0xae50('0x2c')]()[_0xae50('0x41')]('cm_hopper_additional_phones')['fromQuery'](['CmHopperId',_0xae50('0x2f'),_0xae50('0x51'),'createdAt',_0xae50('0x31')],squel[_0xae50('0x11')]()[_0xae50('0x35')](_0x15dd76)[_0xae50('0x12')]('cm_hopper')['join']('cm_contacts',null,_0xae50('0x52'))[_0xae50('0x13')](_0xae50('0x53'),null,_0xae50('0x54'))[_0xae50('0x14')](_0xae50('0x55'),_0x52a8de)[_0xae50('0x14')](_0xae50('0x3a'),NOW))[_0xae50('0x3e')]();}function insertCmContact(_0x2e6714,_0x4072f3,_0x20cc79,_0xad133d){var _0x269480=_[_0xae50('0x56')](_[_0xae50('0x57')](_0xad133d),[_0xae50('0x44'),_0xae50('0x58'),'createdAt',_0xae50('0x31'),_0xae50('0x59')]);return squel['insert']()[_0xae50('0x41')](_0xae50('0x36'))[_0xae50('0x2e')](_0x269480,squel[_0xae50('0x11')]()[_0xae50('0x35')](_0x269480)[_0xae50('0x12')](_0x4072f3)[_0xae50('0x14')]('('+_0x20cc79['join'](',')+_0xae50('0x5a'),squel[_0xae50('0x11')]()[_0xae50('0x35')](_0x20cc79)[_0xae50('0x12')]('cm_contacts')[_0xae50('0x14')]('ListId\x20=\x20?',_0x2e6714)['where'](_0xae50('0x5b')))['where'](_0xae50('0x5c'),squel[_0xae50('0x11')]()[_0xae50('0x4b')](_0xae50('0x5d'),_0xae50('0x5e'))[_0xae50('0x12')](_0x4072f3)[_0xae50('0x5f')](_0x20cc79[_0xae50('0x13')](','))))[_0xae50('0x3e')]();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0xedaf7){logger['error'](_0xedaf7['message']);process[_0xae50('0x60')](0x1);}function handleError(_0x170cf4,_0x49df44){stats['errors'][_0xae50('0x1a')]({'name':_0x49df44[_0xae50('0x61')],'message':_0x49df44[_0xae50('0x62')],'row':_0x170cf4});}function handleQuery(_0x87fffb){logger['info'](_0x87fffb);return db[_0xae50('0x63')][_0xae50('0x64')](_0x87fffb)[_0xae50('0x65')](function(_0x464e30){results[_0xae50('0x1a')](_0x464e30);})[_0xae50('0x66')](function(_0x2ab267){logger[_0xae50('0x67')](_0x2ab267[_0xae50('0x62')]);});}function updateTzCampaigns(_0x1e676f){return new Promise(function(_0x1eae21,_0x3521d9){var _0x59cfac=squel[_0xae50('0x11')]()[_0xae50('0x35')]([_0xae50('0x68'),'campaigns.dialTimezone'])[_0xae50('0x12')](_0xae50('0x69'))['join']('campaigns_has_cm_lists',null,_0xae50('0x6a'))['where'](_0xae50('0x6b')+_0x1e676f);db['sequelize']['query'](_0x59cfac['toString']())[_0xae50('0x65')](function(_0x57cef8){var _0xe610fa=[];for(var _0x14aaef=0x0;_0x14aaef<_0x57cef8[_0xae50('0x19')];_0x14aaef++){_0xe610fa[_0xae50('0x1a')](getTimezoneData(_0x57cef8[_0x14aaef],tmp_campaigns));}BPromise[_0xae50('0x1d')](_0xe610fa)[_0xae50('0x1b')](function(){_0x1eae21({'val':0x1});});})[_0xae50('0x66')](function(_0x823052){logger['error'](_0x823052[_0xae50('0x62')]);_0x1eae21({'val':0x0});});});}function updateTzVoiceQueues(_0x4d9a5b){return new Promise(function(_0x42b0f0,_0x3f465f){var _0x593ea6=squel[_0xae50('0x11')]()[_0xae50('0x35')](['voice_queues.id',_0xae50('0x6c')])['from'](_0xae50('0x6d'))[_0xae50('0x13')](_0xae50('0x6e'),null,_0xae50('0x6f'))[_0xae50('0x14')](_0xae50('0x70')+_0x4d9a5b);db[_0xae50('0x63')][_0xae50('0x64')](_0x593ea6[_0xae50('0x3e')]())[_0xae50('0x65')](function(_0x3015b5){var _0x4a841f=[];for(var _0x47244d=0x0;_0x47244d<_0x3015b5['length'];_0x47244d++){_0x4a841f[_0xae50('0x1a')](getTimezoneData(_0x3015b5[_0x47244d],tmp_voice_queues));}BPromise[_0xae50('0x1d')](_0x4a841f)['then'](function(){_0x42b0f0({'val':0x1});});})[_0xae50('0x66')](function(_0x22d59d){logger[_0xae50('0x67')](_0x22d59d[_0xae50('0x62')]);_0x42b0f0({'val':0x0});});});}function getTimezoneData(_0x33d6af,_0x440572){return new Promise(function(_0x29df9a,_0x48cdeb){var _0x213f8c=shared[_0xae50('0x71')];var _0x5e10a0=_0x213f8c[_0x33d6af['dialTimezone']];if(_[_0xae50('0x1e')](_0x5e10a0)){_0x29df9a({'ret':0x1});}else{var _0x4e4899=_0x5e10a0['utcOffset'];var _0x2030c5=squel[_0xae50('0x2c')]()[_0xae50('0x41')](_0x440572)[_0xae50('0x72')]('id',_0x33d6af['id'])['set'](_0xae50('0x73'),_0x4e4899)['set'](_0xae50('0x74'),_0x33d6af[_0xae50('0x74')])['toString']();return db[_0xae50('0x63')][_0xae50('0x64')](_0x2030c5)[_0xae50('0x65')](function(_0x5b8603){_0x29df9a({'ret':0x1});})[_0xae50('0x66')](function(_0x3f9348){logger['error'](_0x3f9348[_0xae50('0x62')]);_0x48cdeb({'ret':0x1});});}});}function handleTZQuery(_0x38d899){logger[_0xae50('0x75')](_0x38d899);return db[_0xae50('0x63')][_0xae50('0x64')](_0x38d899)[_0xae50('0x65')](function(_0x345520){})[_0xae50('0x66')](function(_0xc4f998){logger[_0xae50('0x67')](_0xc4f998['message']);});}function main(_0x3678da,_0x332628,_0x355784,_0x3bae95){logger[_0xae50('0x75')](_0xae50('0x76'),_0x3678da,JSON[_0xae50('0x77')](_0x332628));process['send']('start');var _0x5a2bb7=_0x332628[_0xae50('0x78')];var _0x4cfa0f=_[_0xae50('0x79')](_0x5a2bb7);var _0x30b815=_0x332628[_0xae50('0x7a')];var _0x43759e=path[_0xae50('0x13')](config[_0xae50('0x7b')],_0xae50('0x7c'),_0x30b815+'.csv');hasTZ=_[_0xae50('0x57')](_0x5a2bb7)[_0xae50('0x7d')](_0xae50('0x74'));var _0x463c2c=_[_0xae50('0x57')](_0x5a2bb7)[_0xae50('0x13')]();logger[_0xae50('0x75')]('header',_0x463c2c);db['ContactItemType'][_0xae50('0x17')]({'raw':!![],'attributes':['id',_0xae50('0x7e')]})[_0xae50('0x1b')](function(_0x2acb9e){for(var _0x1059a3=0x0;_0x1059a3<_0x2acb9e[_0xae50('0x19')];_0x1059a3++){if(_0x2acb9e[_0x1059a3][_0xae50('0x7e')]in _0x5a2bb7){contactItemTypes[_0xae50('0x1a')](_0x2acb9e[_0x1059a3]);delete _0x4cfa0f[_0x2acb9e[_0x1059a3][_0xae50('0x7e')]];hasAdditionalPhones=!![];}for(var _0x4716fd in _0x5a2bb7){if(_0x2acb9e[_0x1059a3]['name']+'_description'===_0x4716fd){phoneDescriptions[_0xae50('0x1a')]({'itemTypeId':_0x2acb9e[_0x1059a3]['id'],'description':_0x4716fd});delete _0x4cfa0f[_0x4716fd];}}}if(hasAdditionalPhones)_0x4cfa0f[_0xae50('0x18')]='';var _0x33ca70=_[_0xae50('0x57')](_0x4cfa0f)[_0xae50('0x13')]();logger[_0xae50('0x75')]('header',_0x33ca70);fs['writeFileSync'](_0x43759e,_0x33ca70+'\x0a');Papa[_0xae50('0x7f')](fs['createReadStream'](_0x3678da),{'header':!![],'skipEmptyLines':!![],'step':function(_0x336215,_0x29bfe2){try{for(var _0x331b68=0x0,_0x356528=[];_0x331b68<_0x336215[_0xae50('0x80')][_0xae50('0x19')];_0x331b68++){stats['rows']+=0x1;if(_0x336215['errors'][_0x331b68]){handleError(_0x336215[_0xae50('0x80')][_0x331b68],_0x336215[_0xae50('0x81')][_0x331b68]);}else{var _0x53af5c=[];var _0x5612b6=[];var _0x94ec4c={};for(var _0x285f3a in _0x5a2bb7){let _0x2f42a2=contactItemTypes[_0xae50('0x82')](_0x401bd4=>_0x401bd4[_0xae50('0x7e')]===_0x285f3a);let _0x2c17e6=contactItemTypes[_0xae50('0x82')](_0x4e3d2e=>_0x4e3d2e[_0xae50('0x7e')]+'_description'===_0x285f3a);if(_[_0xae50('0x1e')](_0x2f42a2)&&_[_0xae50('0x1e')](_0x2c17e6)){if(_0x5a2bb7[_0xae50('0x83')](_0x285f3a)){if(_0x336215[_0xae50('0x80')][_0x331b68][_0x5a2bb7[_0x285f3a]]){var _0x56cbb4=_['trim'](_0x336215[_0xae50('0x80')][_0x331b68][_0x5a2bb7[_0x285f3a]][_0xae50('0x84')](/"/g,'\x27'));switch(_0x285f3a){case'scheduledat':var _0x458518=moment(_0x56cbb4,_0xae50('0xf'),!![]);if(_0x458518[_0xae50('0x85')]()){_0x356528[_0xae50('0x1a')]('\x22'+_0x56cbb4+'\x22');}else{_0x53af5c[_0xae50('0x1a')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xae50('0x32'):var _0x114c8d=parseInt(_0x56cbb4);_0x56cbb4=_[_0xae50('0x86')](_0x114c8d)||_0x114c8d<0x0||_0x114c8d>0x4?_0x3bae95?0x3:0x2:_0x114c8d;_0x356528[_0xae50('0x1a')]('\x22'+_0x56cbb4+'\x22');break;case _0xae50('0x33'):var _0x2e0972=parseInt(_0x56cbb4);if(_[_0xae50('0x87')](_0x2e0972)&&_[_0xae50('0x7d')](_0x355784,_0x2e0972)){_0x356528['push']('\x22'+_0x2e0972+'\x22');}else{_0x53af5c[_0xae50('0x1a')](_0xae50('0x88'));}break;case'email':if(isEmail(_0x56cbb4)){_0x356528['push']('\x22'+_0x56cbb4+'\x22');}else{_0x53af5c[_0xae50('0x1a')](_0xae50('0x89'));}break;case'dateOfBirth':var _0x3aa04f=moment(_0x56cbb4,_0xae50('0x8a'),!![]);if(_0x3aa04f[_0xae50('0x85')]()){_0x356528[_0xae50('0x1a')]('\x22'+_0x56cbb4+'\x22');}else{_0x53af5c['push'](_0xae50('0x8b'));}break;case'dialTimezone':var _0x322caa=shared[_0xae50('0x71')];var _0x561cd5=_0x322caa[_0x56cbb4];if(!_[_0xae50('0x1e')](_0x561cd5)){var _0xbc2fad=_0x561cd5[_0xae50('0x8c')];_0x356528['push']('\x22'+_0x56cbb4+'\x22');_0x356528[_0xae50('0x1a')]('\x22'+_0xbc2fad+'\x22');}break;default:_0x356528[_0xae50('0x1a')]('\x22'+_0x56cbb4+'\x22');}}else{switch(_0x285f3a){case _0xae50('0x8d'):case _0xae50('0x2f'):_0x53af5c[_0xae50('0x1a')](_0x285f3a+'\x20not\x20specified');break;default:_0x356528['push']('\x22\x22');}}}}else{var _0x36e8ad='';if(!_[_0xae50('0x1e')](_0x2f42a2)){if(!_0x94ec4c['hasOwnProperty'](_0x2f42a2['id'])){if(!_[_0xae50('0x1e')](_0x336215['data'][_0x331b68][_0x5a2bb7[_0x285f3a]])){var _0x56cbb4=_[_0xae50('0x8e')](_0x336215['data'][_0x331b68][_0x5a2bb7[_0x285f3a]][_0xae50('0x84')](/"/g,'\x27'));var _0x218bdd=phoneDescriptions['find'](_0x580cf4=>_0x580cf4[_0xae50('0x8f')]===_0x2f42a2['id']);if(!_[_0xae50('0x1e')](_0x218bdd)){var _0x38865b=_[_0xae50('0x8e')](_0x336215[_0xae50('0x80')][_0x331b68][_0x5a2bb7[_0x218bdd[_0xae50('0x90')]]][_0xae50('0x84')](/"/g,'\x27'));if(!_[_0xae50('0x1e')](_0x38865b))_0x56cbb4=_0x56cbb4+'§'+_0x38865b;}if(_0x36e8ad=='')_0x36e8ad=_0x56cbb4;else _0x36e8ad+='|'+_0x56cbb4;}_0x5612b6[_0xae50('0x1a')](_0x2f42a2['id']+':'+_0x36e8ad);_0x94ec4c[_0x2f42a2['id']]=0x1;}}}}if(hasAdditionalPhones){_0x356528[_0xae50('0x1a')]('\x22'+_0x5612b6[_0xae50('0x13')](';')+'\x22');}if(_0x53af5c[_0xae50('0x19')]){handleError(_0x336215['data'][_0x331b68],{'code':_0xae50('0x91'),'message':_0x53af5c[_0xae50('0x13')]()});}else{fs[_0xae50('0x92')](_0x43759e,_0x356528['join']()+'\x0a');}_0x356528=[];}if(!(stats[_0xae50('0x93')]%0xc8)){socket[_0xae50('0x94')](_0xae50('0x95')+_0x30b815,stats);stats[_0xae50('0x81')]=[];}}if(stopped){logger[_0xae50('0x75')](_0xae50('0x96'));_0x29bfe2['abort']();}}catch(_0x21879a){handleError(_0x336215['data'][_0x331b68],{'code':_0xae50('0x97'),'message':_0x21879a[_0xae50('0x62')]});logger['error'](_0xae50('0x98'),_0x21879a['message']);}},'complete':function(){try{var _0x16aac7=[];var _0x4215d8=[];var _0x57e756=_0xae50('0x36');if(_0x332628['duplicates']&&_0x332628[_0xae50('0x99')]['length']){_0x57e756=_0xae50('0x9a')+_0x30b815;_0x16aac7[_0xae50('0x1a')](_0xae50('0x9b')+_0x57e756+_0xae50('0x9c'));}tmp_campaigns=_0xae50('0x9d')+_0x30b815;tmp_voice_queues=_0xae50('0x9e')+_0x30b815;_0x4215d8[_0xae50('0x1a')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0xae50('0x9f'));_0x4215d8['push'](_0xae50('0x9b')+tmp_voice_queues+_0xae50('0x9f'));BPromise['each'](_0x4215d8,handleTZQuery)[_0xae50('0x1b')](function(_0x7148a5){updateTzCampaigns(_0x332628['ListId'])['then'](function(_0x5bdeae){updateTzVoiceQueues(_0x332628[_0xae50('0x44')])[_0xae50('0x1b')](function(_0x518e60){if(hasTZ)_0x33ca70=_0x33ca70[_0xae50('0x84')](_0xae50('0x74'),'dialTimezone,utcOffset');var _0x57bb82=util[_0xae50('0xe')](_0xae50('0xa0'),_0x43759e,_0x57e756,_0x33ca70,_0x332628[_0xae50('0x44')],_0x332628[_0xae50('0x58')]||null,NOW,NOW);if(_[_0xae50('0x1e')](_0x5a2bb7[_0xae50('0x30')])){_0x57bb82+=_0xae50('0xa1');}_0x16aac7[_0xae50('0x1a')](_0x57bb82);if(_0x332628['duplicates']&&_0x332628[_0xae50('0x99')][_0xae50('0x19')]){_0x16aac7['push'](insertCmContact(_0x332628[_0xae50('0x44')],_0x57e756,_0x332628[_0xae50('0x99')],_0x5a2bb7));_0x16aac7['push']('DROP\x20TABLE\x20'+_0x57e756+';');}BPromise[_0xae50('0xa2')](_0x16aac7,handleQuery)['then'](function(_0x5d919c){BPromise[_0xae50('0x1d')]([handleAdditionalPhones()])['then'](function(){_0x16aac7=[];for(var _0x3ea247=0x0;_0x3ea247\x20\x20','existsSync','parse','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','map','No\x20agent\x20available','uncaughtException','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','length','push','all','split','isNil','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','insert','cm_hopper','fromQuery','ContactId','ListId','createdAt','priority','UserId','recallme','fields','join','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.id','cm_contacts.updatedAt','into','cm_hopper_black','updatedAt','ListId\x20=\x20?','\x20=\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','scheduledat','\x22always\x22','cm_hopper.id','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','exit','errors','code','message','sequelize','query','spread','catch','error','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','offset','main','send','start','binding','socket_timestamp','root','.csv','includes'];(function(_0x1c0029,_0x3fa67e){var _0x5b295c=function(_0x119663){while(--_0x119663){_0x1c0029['push'](_0x1c0029['shift']());}};_0x5b295c(++_0x3fa67e);}(_0x6655,0xea));var _0x5665=function(_0x49d685,_0x334e5c){_0x49d685=_0x49d685-0x0;var _0x7a8052=_0x6655[_0x49d685];return _0x7a8052;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require('papaparse');var util=require(_0x5665('0x0'));var BPromise=require(_0x5665('0x1'));var moment=require(_0x5665('0x2'));var squel=require('squel');var Redis=require(_0x5665('0x3'));var db=require(_0x5665('0x4'))['db'];var config=require(_0x5665('0x5'));var shared=require(_0x5665('0x6'));var logger=require(_0x5665('0x7'))('import');config[_0x5665('0x8')]=_[_0x5665('0x9')](config[_0x5665('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x5665('0xa'))(new Redis(config[_0x5665('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x5665('0xb')](_0x5665('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x5665('0xb')](_0x5665('0xc'));function isEmail(_0x5ed74c){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))*$/[_0x5665('0xd')](_0x5ed74c);}function selectNotIn(_0x196147,_0x224917,_0x166e7c,_0xe106d6,_0x34770d){return squel[_0x5665('0xe')]()[_0x5665('0xf')](_0x5665('0x10'))[_0x5665('0x11')](_0xe106d6)['join'](_0x224917,null,_0x224917+_0x5665('0x12')+_0xe106d6+'.'+_0x166e7c)[_0x5665('0x13')](_0xe106d6+'.'+_0x166e7c+'\x20=\x20'+_0x196147+'.'+_0x166e7c)[_0x5665('0x13')](_0x224917+_0x5665('0x14')+_0x34770d['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x35ec0a,_0x2b10ad){promisesAdditionalPhones=[];return db[_0x5665('0x15')][_0x5665('0x16')]({'raw':!![],'attributes':['id',_0x5665('0x17')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x5665('0x18')](function(_0x42cbcf){if(_0x42cbcf!==null){var _0x313114=[];for(var _0x168166=0x0;_0x168166<_0x42cbcf[_0x5665('0x19')];_0x168166++){var _0x2b73da=_0x42cbcf[_0x168166];_0x313114[_0x5665('0x1a')](insertAdditionalPhones(_0x2b73da));}}Promise[_0x5665('0x1b')](_0x313114)[_0x5665('0x18')](function(){_0x35ec0a({'val':0x1});});});});}function insertAdditionalPhones(_0x1dbddc){return new Promise(function(_0x332818,_0x30afda){var _0x18417d=_0x1dbddc[_0x5665('0x17')];var _0xb91534=_0x18417d[_0x5665('0x1c')](';');var _0x28008e=[];orderBy=0x0;for(var _0xf9dfa4=0x0;_0xf9dfa4<_0xb91534[_0x5665('0x19')];_0xf9dfa4++){_0x28008e[_0x5665('0x1a')](splitAdditionalPhone(_0x1dbddc['id'],_0xb91534[_0xf9dfa4]));}Promise[_0x5665('0x1b')](_0x28008e)[_0x5665('0x18')](function(){_0x332818({'val':_0xb91534['length']});});});}function splitAdditionalPhone(_0xba660f,_0xb7f16d){return new Promise(function(_0x47007a,_0x353d75){var _0xd89413=_0xb7f16d[_0x5665('0x1c')](':');var _0x54af8a=_0xd89413[0x0];var _0x4b0466=_0xd89413[0x1];if(!_[_0x5665('0x1d')](_0x4b0466)){var _0x226e08=_0x4b0466[_0x5665('0x1c')]('|');var _0x32040a=[];for(var _0x7d53fd=0x0;_0x7d53fd<_0x226e08[_0x5665('0x19')];_0x7d53fd++){if(_0x226e08[_0x7d53fd]!==''){var _0x302be9=_[_0x5665('0x1e')](promisesAdditionalPhones,{'contactId':_0xba660f,'phone':_0x226e08[_0x7d53fd]});if(_0x302be9['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0xba660f,'contactTypeId':_0x54af8a,'phone':_0x226e08[_0x7d53fd],'orderBy':orderBy});}}}_0x47007a({'ok':0x1});}else _0x47007a({'res':0x0});});}function createAdditionalPhone(_0x5a13ed,_0x6df7d2,_0x134d71,_0x4e51e1){var _0x1913d4='';var _0x5285da='';var _0x4a37f0=_0x134d71[_0x5665('0x1c')]('§');_0x1913d4=_0x4a37f0[0x0];if(_0x4a37f0[_0x5665('0x19')]==0x2)_0x5285da=_0x4a37f0[0x1];return new Promise(function(_0x533c26,_0x9668c8){return db[_0x5665('0x1f')][_0x5665('0x20')]({'where':{'CmContactId':_0x5a13ed,'item':_0x1913d4}})[_0x5665('0x18')](function(_0x1f9c7b){if(_0x1f9c7b){return db[_0x5665('0x1f')][_0x5665('0x21')]({'ItemTypeId':_0x6df7d2,'description':_0x5285da,'OrderBy':_0x4e51e1},{'where':{'CmContactId':_0x5a13ed,'item':_0x1913d4}})[_0x5665('0x18')](function(_0x3403e7){_0x533c26({'res':_0x5665('0x22')});});}else{return db[_0x5665('0x1f')][_0x5665('0x23')]({'CmContactId':_0x5a13ed,'item':_0x1913d4,'description':_0x5285da,'ItemTypeId':_0x6df7d2,'OrderBy':_0x4e51e1,'ItemClass':_0x5665('0x24')})['then'](function(_0x49e4fa){_0x533c26({'res':_0x5665('0x25')});});}});});}function insertCmHopper(_0x88c9b2,_0x58584d,_0x185535,_0x35bfa7,_0x44fa93){var _0x2bab78=[_0x5665('0x26'),'cm_contacts.scheduledat','cm_contacts.id',_0x5665('0x27'),_0x58584d+'.'+_0x35bfa7,_0x5665('0x28'),'cm_contacts.updatedAt',_0x5665('0x29'),'cm_contacts.UserId','\x22'+_0x44fa93+'\x22'];return squel[_0x5665('0x2a')]()['into'](_0x5665('0x2b'))[_0x5665('0x2c')]([_0x5665('0x10'),'scheduledat',_0x5665('0x2d'),_0x5665('0x2e'),_0x35bfa7,_0x5665('0x2f'),'updatedAt',_0x5665('0x30'),_0x5665('0x31'),_0x5665('0x32')],squel[_0x5665('0xe')]()[_0x5665('0x33')](_0x2bab78)[_0x5665('0x11')](_0x58584d)[_0x5665('0x34')](_0x5665('0x35'),null,_0x5665('0x36')+_0x58584d+_0x5665('0x37'))['join'](_0x185535,null,_0x185535+_0x5665('0x12')+_0x58584d+'.'+_0x35bfa7)[_0x5665('0x13')](_0x58584d+_0x5665('0x38'),_0x88c9b2)[_0x5665('0x13')](_0x5665('0x39'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x58584d,_0x185535,_0x35bfa7,_0x5665('0x2b'),['\x22always\x22',_0x5665('0x3a')]))[_0x5665('0x13')](_0x5665('0x3b'),selectNotIn(_0x58584d,_0x185535,_0x35bfa7,_0x5665('0x2b'),['\x22always\x22'])))[_0x5665('0x3c')]();}function insertCmHopperBlack(_0x3fefdb,_0x67e71f,_0x31d886,_0x910804){var _0x34af66=[_0x5665('0x26'),_0x5665('0x3d'),_0x5665('0x27'),_0x67e71f+'.'+_0x910804,_0x5665('0x28'),_0x5665('0x3e')];return squel[_0x5665('0x2a')]()[_0x5665('0x3f')](_0x5665('0x40'))[_0x5665('0x2c')](['phone',_0x5665('0x2d'),'ListId',_0x910804,'createdAt',_0x5665('0x41')],squel[_0x5665('0xe')]()[_0x5665('0x33')](_0x34af66)[_0x5665('0x11')](_0x67e71f)[_0x5665('0x34')](_0x5665('0x35'),null,'cm_contacts.ListId\x20=\x20'+_0x67e71f+_0x5665('0x37'))[_0x5665('0x34')](_0x31d886,null,_0x31d886+_0x5665('0x12')+_0x67e71f+'.'+_0x910804)['where'](_0x67e71f+'.CmListId\x20=\x20?',_0x3fefdb)[_0x5665('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5665('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x5665('0xe')]()[_0x5665('0xf')](_0x5665('0x10'))[_0x5665('0x11')](_0x5665('0x40'))['where'](_0x5665('0x42'),_0x3fefdb)[_0x5665('0x13')](_0x910804+_0x5665('0x43')+_0x67e71f+'.'+_0x910804)))[_0x5665('0x3c')]();}function insertTzCmHopper(_0x46b3e7,_0x2b94c7,_0x2199a5,_0x374498,_0x4916ca,_0x53dd2a){var _0x13fc36=[_0x5665('0x26'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x53dd2a+_0x5665('0x44'),_0x5665('0x3d'),_0x5665('0x27'),_0x2b94c7+'.'+_0x374498,'cm_contacts.createdAt',_0x5665('0x3e'),_0x5665('0x29'),_0x5665('0x45'),'\x22'+_0x4916ca+'\x22'];var _0x5615d9=squel[_0x5665('0x2a')]()['into'](_0x5665('0x2b'))[_0x5665('0x2c')]([_0x5665('0x10'),_0x5665('0x46'),_0x5665('0x2d'),_0x5665('0x2e'),_0x374498,_0x5665('0x2f'),_0x5665('0x41'),_0x5665('0x30'),'UserId',_0x5665('0x32')],squel[_0x5665('0xe')]()['fields'](_0x13fc36)[_0x5665('0x11')](_0x2b94c7)[_0x5665('0x34')](_0x5665('0x35'),null,_0x5665('0x36')+_0x2b94c7+_0x5665('0x37'))[_0x5665('0x34')](_0x2199a5,null,_0x2199a5+_0x5665('0x12')+_0x2b94c7+'.'+_0x374498)[_0x5665('0x34')](_0x53dd2a,null,_0x53dd2a+'.id\x20=\x20'+_0x2b94c7+'.'+_0x374498)[_0x5665('0x13')](_0x2b94c7+_0x5665('0x38'),_0x46b3e7)[_0x5665('0x13')](_0x5665('0x39'),NOW)[_0x5665('0x13')](_0x5665('0x3b'),selectNotIn(_0x2b94c7,_0x2199a5,_0x374498,_0x5665('0x2b'),[_0x5665('0x47'),'\x22onlyIfOpen\x22']))['where'](_0x5665('0x3b'),selectNotIn(_0x2b94c7,_0x2199a5,_0x374498,_0x5665('0x2b'),[_0x5665('0x47')])))[_0x5665('0x3c')]();return _0x5615d9;}function insertTzCmHopperBlack(_0x4f54e3,_0x37570f,_0x4e020f,_0x1c5f4f){var _0x103c39=['cm_contacts.phone',_0x5665('0x3d'),_0x5665('0x27'),_0x37570f+'.'+_0x1c5f4f,_0x5665('0x28'),_0x5665('0x3e')];return squel[_0x5665('0x2a')]()['into'](_0x5665('0x40'))['fromQuery'](['phone',_0x5665('0x2d'),'ListId',_0x1c5f4f,_0x5665('0x2f'),_0x5665('0x41')],squel[_0x5665('0xe')]()['fields'](_0x103c39)[_0x5665('0x11')](_0x37570f)['join'](_0x5665('0x35'),null,_0x5665('0x36')+_0x37570f+_0x5665('0x37'))[_0x5665('0x34')](_0x4e020f,null,_0x4e020f+_0x5665('0x12')+_0x37570f+'.'+_0x1c5f4f)[_0x5665('0x13')](_0x37570f+_0x5665('0x38'),_0x4f54e3)[_0x5665('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5665('0x13')](_0x5665('0x3b'),squel[_0x5665('0xe')]()[_0x5665('0xf')](_0x5665('0x10'))['from']('cm_hopper_black')['where'](_0x5665('0x42'),_0x4f54e3)[_0x5665('0x13')](_0x1c5f4f+_0x5665('0x43')+_0x37570f+'.'+_0x1c5f4f)))[_0x5665('0x3c')]();}function insertCmHopperAdditionalPhones(_0xbb535){var _0x56f581=[_0x5665('0x48'),'cm_contact_has_items.item','cm_contact_has_items.OrderBy',_0x5665('0x49'),'cm_contact_has_items.updatedAt'];return squel['insert']()[_0x5665('0x3f')](_0x5665('0x4a'))[_0x5665('0x2c')]([_0x5665('0x4b'),'phone',_0x5665('0x4c'),_0x5665('0x2f'),_0x5665('0x41')],squel[_0x5665('0xe')]()[_0x5665('0x33')](_0x56f581)[_0x5665('0x11')]('cm_hopper')[_0x5665('0x34')](_0x5665('0x35'),null,_0x5665('0x4d'))[_0x5665('0x34')](_0x5665('0x4e'),null,_0x5665('0x4f'))[_0x5665('0x13')](_0x5665('0x50'),_0xbb535)[_0x5665('0x13')](_0x5665('0x39'),NOW))['toString']();}function insertCmContact(_0x143b5e,_0x58da05,_0x276dd7,_0x298b6c){var _0x130cdc=_[_0x5665('0x51')](_[_0x5665('0x52')](_0x298b6c),[_0x5665('0x2e'),_0x5665('0x53'),_0x5665('0x2f'),'updatedAt','scheduledAt']);return squel['insert']()[_0x5665('0x3f')](_0x5665('0x35'))['fromQuery'](_0x130cdc,squel[_0x5665('0xe')]()[_0x5665('0x33')](_0x130cdc)[_0x5665('0x11')](_0x58da05)[_0x5665('0x13')]('('+_0x276dd7[_0x5665('0x34')](',')+')\x20NOT\x20IN\x20?',squel[_0x5665('0xe')]()[_0x5665('0x33')](_0x276dd7)['from'](_0x5665('0x35'))[_0x5665('0x13')](_0x5665('0x42'),_0x143b5e)[_0x5665('0x13')](_0x5665('0x54')))[_0x5665('0x13')](_0x5665('0x55'),squel[_0x5665('0xe')]()[_0x5665('0xf')](_0x5665('0x56'),_0x5665('0x57'))['from'](_0x58da05)[_0x5665('0x58')](_0x276dd7['join'](','))))[_0x5665('0x3c')]();}function handleStop(){logger[_0x5665('0x59')](_0x5665('0x5a'));stopped=!![];}function handleUncaughtException(_0x22602a){logger['error'](_0x22602a['message']);process[_0x5665('0x5b')](0x1);}function handleError(_0x4915b0,_0x312038){stats[_0x5665('0x5c')][_0x5665('0x1a')]({'name':_0x312038[_0x5665('0x5d')],'message':_0x312038[_0x5665('0x5e')],'row':_0x4915b0});}function handleQuery(_0x40d668){logger[_0x5665('0x59')](_0x40d668);return db[_0x5665('0x5f')][_0x5665('0x60')](_0x40d668)[_0x5665('0x61')](function(_0x59f983){results[_0x5665('0x1a')](_0x59f983);})[_0x5665('0x62')](function(_0x58ac26){logger[_0x5665('0x63')](_0x58ac26['message']);});}function updateTzCampaigns(_0x3af293){return new Promise(function(_0x1459fb,_0x4e4494){var _0x386d59=squel[_0x5665('0xe')]()[_0x5665('0x33')](['campaigns.id',_0x5665('0x64')])[_0x5665('0x11')](_0x5665('0x65'))[_0x5665('0x34')]('campaigns_has_cm_lists',null,_0x5665('0x66'))[_0x5665('0x13')](_0x5665('0x67')+_0x3af293);db[_0x5665('0x5f')]['query'](_0x386d59[_0x5665('0x3c')]())[_0x5665('0x61')](function(_0x183345){var _0x80cc1=[];for(var _0x251d01=0x0;_0x251d01<_0x183345[_0x5665('0x19')];_0x251d01++){_0x80cc1[_0x5665('0x1a')](getTimezoneData(_0x183345[_0x251d01],tmp_campaigns));}BPromise[_0x5665('0x1b')](_0x80cc1)[_0x5665('0x18')](function(){_0x1459fb({'val':0x1});});})['catch'](function(_0x4fcffa){logger[_0x5665('0x63')](_0x4fcffa[_0x5665('0x5e')]);_0x1459fb({'val':0x0});});});}function updateTzVoiceQueues(_0x3548ad){return new Promise(function(_0x36ea1d,_0x9c9860){var _0x1224e=squel[_0x5665('0xe')]()['fields'](['voice_queues.id','voice_queues.dialTimezone'])[_0x5665('0x11')]('voice_queues')['join'](_0x5665('0x68'),null,_0x5665('0x69'))[_0x5665('0x13')](_0x5665('0x6a')+_0x3548ad);db[_0x5665('0x5f')][_0x5665('0x60')](_0x1224e[_0x5665('0x3c')]())[_0x5665('0x61')](function(_0x22d53f){var _0x579632=[];for(var _0x56093f=0x0;_0x56093f<_0x22d53f[_0x5665('0x19')];_0x56093f++){_0x579632['push'](getTimezoneData(_0x22d53f[_0x56093f],tmp_voice_queues));}BPromise[_0x5665('0x1b')](_0x579632)[_0x5665('0x18')](function(){_0x36ea1d({'val':0x1});});})[_0x5665('0x62')](function(_0x1f63d9){logger[_0x5665('0x63')](_0x1f63d9[_0x5665('0x5e')]);_0x36ea1d({'val':0x0});});});}function getTimezoneData(_0x42bf10,_0x3f4777){return new Promise(function(_0x270bec,_0x1eba30){var _0x2e0da4=shared[_0x5665('0x6b')];var _0x4aa544=_0x2e0da4[_0x42bf10[_0x5665('0x6c')]];if(_[_0x5665('0x1d')](_0x4aa544)){_0x270bec({'ret':0x1});}else{var _0x207023=_0x4aa544[_0x5665('0x6d')];var _0x335525=squel[_0x5665('0x2a')]()[_0x5665('0x3f')](_0x3f4777)[_0x5665('0x6e')]('id',_0x42bf10['id'])[_0x5665('0x6e')](_0x5665('0x6f'),_0x207023)[_0x5665('0x6e')](_0x5665('0x6c'),_0x42bf10[_0x5665('0x6c')])[_0x5665('0x3c')]();return db['sequelize'][_0x5665('0x60')](_0x335525)[_0x5665('0x61')](function(_0x8de282){_0x270bec({'ret':0x1});})[_0x5665('0x62')](function(_0xd3e5ff){logger['error'](_0xd3e5ff[_0x5665('0x5e')]);_0x1eba30({'ret':0x1});});}});}function handleTZQuery(_0x290573){logger[_0x5665('0x59')](_0x290573);return db[_0x5665('0x5f')]['query'](_0x290573)['spread'](function(_0x4f7585){})[_0x5665('0x62')](function(_0x414ecd){logger[_0x5665('0x63')](_0x414ecd[_0x5665('0x5e')]);});}function main(_0xb68b5b,_0x560952,_0x4ba645,_0x596617){logger['info'](_0x5665('0x70'),_0xb68b5b,JSON['stringify'](_0x560952));process[_0x5665('0x71')](_0x5665('0x72'));var _0x4d3597=_0x560952[_0x5665('0x73')];var _0xdb20ed=_['clone'](_0x4d3597);var _0x27b354=_0x560952[_0x5665('0x74')];var _0x31935c=path[_0x5665('0x34')](config[_0x5665('0x75')],'server/files/tmp',_0x27b354+_0x5665('0x76'));hasTZ=_[_0x5665('0x52')](_0x4d3597)[_0x5665('0x77')](_0x5665('0x6c'));var _0x497387=_[_0x5665('0x52')](_0x4d3597)[_0x5665('0x34')]();logger[_0x5665('0x59')](_0x5665('0x78'),_0x497387);db[_0x5665('0x79')]['findAll']({'raw':!![],'attributes':['id','name']})[_0x5665('0x18')](function(_0x53c4c3){for(var _0x5f5c23=0x0;_0x5f5c23<_0x53c4c3['length'];_0x5f5c23++){if(_0x53c4c3[_0x5f5c23][_0x5665('0x7a')]in _0x4d3597){contactItemTypes[_0x5665('0x1a')](_0x53c4c3[_0x5f5c23]);delete _0xdb20ed[_0x53c4c3[_0x5f5c23][_0x5665('0x7a')]];hasAdditionalPhones=!![];}for(var _0x52baa0 in _0x4d3597){if(_0x53c4c3[_0x5f5c23][_0x5665('0x7a')]+_0x5665('0x7b')===_0x52baa0){phoneDescriptions[_0x5665('0x1a')]({'itemTypeId':_0x53c4c3[_0x5f5c23]['id'],'description':_0x52baa0});delete _0xdb20ed[_0x52baa0];}}}if(hasAdditionalPhones)_0xdb20ed[_0x5665('0x17')]='';var _0x281efa=_[_0x5665('0x52')](_0xdb20ed)['join']();logger[_0x5665('0x59')]('header',_0x281efa);fs[_0x5665('0x7c')](_0x31935c,_0x281efa+'\x0a');Papa['parse'](fs['createReadStream'](_0xb68b5b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5db678,_0x1b7bf2){try{for(var _0x2cd418=0x0,_0x3a4e67=[];_0x2cd418<_0x5db678['data'][_0x5665('0x19')];_0x2cd418++){stats['rows']+=0x1;if(_0x5db678[_0x5665('0x5c')][_0x2cd418]){handleError(_0x5db678['data'][_0x2cd418],_0x5db678[_0x5665('0x5c')][_0x2cd418]);}else{var _0x486b4a=[];var _0x269ee0=[];var _0x5df6f2={};for(var _0x2cb079 in _0x4d3597){let _0x4eb66f=contactItemTypes[_0x5665('0x7d')](_0xac9499=>_0xac9499['name']===_0x2cb079);let _0x2f84e6=contactItemTypes[_0x5665('0x7d')](_0x3853a9=>_0x3853a9[_0x5665('0x7a')]+_0x5665('0x7b')===_0x2cb079);if(_[_0x5665('0x1d')](_0x4eb66f)&&_[_0x5665('0x1d')](_0x2f84e6)){if(_0x4d3597[_0x5665('0x7e')](_0x2cb079)){if(_0x5db678[_0x5665('0x7f')][_0x2cd418][_0x4d3597[_0x2cb079]]){var _0x19a374=_[_0x5665('0x80')](_0x5db678[_0x5665('0x7f')][_0x2cd418][_0x4d3597[_0x2cb079]][_0x5665('0x81')](/"/g,'\x27'));switch(_0x2cb079){case _0x5665('0x46'):var _0x38085c=moment(_0x19a374,_0x5665('0xc'),!![]);if(_0x38085c['isValid']()){_0x3a4e67['push']('\x22'+_0x19a374+'\x22');}else{_0x486b4a[_0x5665('0x1a')](_0x5665('0x82'));}break;case _0x5665('0x30'):var _0x5b19aa=parseInt(_0x19a374);_0x19a374=_['isNaN'](_0x5b19aa)||_0x5b19aa<0x0||_0x5b19aa>0x4?_0x596617?0x3:0x2:_0x5b19aa;_0x3a4e67['push']('\x22'+_0x19a374+'\x22');break;case _0x5665('0x31'):var _0x358da2=parseInt(_0x19a374);if(_[_0x5665('0x83')](_0x358da2)&&_[_0x5665('0x77')](_0x4ba645,_0x358da2)){_0x3a4e67[_0x5665('0x1a')]('\x22'+_0x358da2+'\x22');}else{_0x486b4a[_0x5665('0x1a')](_0x5665('0x84'));}break;case _0x5665('0x85'):if(isEmail(_0x19a374)){_0x3a4e67['push']('\x22'+_0x19a374+'\x22');}else{_0x486b4a[_0x5665('0x1a')](_0x5665('0x86'));}break;case _0x5665('0x87'):var _0x5057cf=moment(_0x19a374,_0x5665('0x88'),!![]);if(_0x5057cf[_0x5665('0x89')]()){_0x3a4e67['push']('\x22'+_0x19a374+'\x22');}else{_0x486b4a[_0x5665('0x1a')](_0x5665('0x8a'));}break;case _0x5665('0x6c'):var _0x152111=shared[_0x5665('0x6b')];var _0x561ccc=_0x152111[_0x19a374];if(!_[_0x5665('0x1d')](_0x561ccc)){var _0x8c225e=_0x561ccc[_0x5665('0x6d')];_0x3a4e67[_0x5665('0x1a')]('\x22'+_0x19a374+'\x22');_0x3a4e67[_0x5665('0x1a')]('\x22'+_0x8c225e+'\x22');}break;default:_0x3a4e67['push']('\x22'+_0x19a374+'\x22');}}else{switch(_0x2cb079){case _0x5665('0x8b'):case _0x5665('0x10'):_0x486b4a[_0x5665('0x1a')](_0x2cb079+_0x5665('0x8c'));break;default:_0x3a4e67[_0x5665('0x1a')]('\x22\x22');}}}}else{var _0x36922b='';if(!_[_0x5665('0x1d')](_0x4eb66f)){if(!_0x5df6f2[_0x5665('0x7e')](_0x4eb66f['id'])){if(!_[_0x5665('0x1d')](_0x5db678[_0x5665('0x7f')][_0x2cd418][_0x4d3597[_0x2cb079]])){var _0x19a374=_[_0x5665('0x80')](_0x5db678[_0x5665('0x7f')][_0x2cd418][_0x4d3597[_0x2cb079]][_0x5665('0x81')](/"/g,'\x27'));var _0x43aa1d=phoneDescriptions[_0x5665('0x7d')](_0x34dd1e=>_0x34dd1e['itemTypeId']===_0x4eb66f['id']);if(!_[_0x5665('0x1d')](_0x43aa1d)){var _0x2a39ac=_[_0x5665('0x80')](_0x5db678[_0x5665('0x7f')][_0x2cd418][_0x4d3597[_0x43aa1d[_0x5665('0x8d')]]][_0x5665('0x81')](/"/g,'\x27'));if(!_[_0x5665('0x1d')](_0x2a39ac))_0x19a374=_0x19a374+'§'+_0x2a39ac;}if(_0x36922b=='')_0x36922b=_0x19a374;else _0x36922b+='|'+_0x19a374;}_0x269ee0[_0x5665('0x1a')](_0x4eb66f['id']+':'+_0x36922b);_0x5df6f2[_0x4eb66f['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3a4e67['push']('\x22'+_0x269ee0[_0x5665('0x34')](';')+'\x22');}if(_0x486b4a['length']){handleError(_0x5db678[_0x5665('0x7f')][_0x2cd418],{'code':_0x5665('0x8e'),'message':_0x486b4a[_0x5665('0x34')]()});}else{fs[_0x5665('0x8f')](_0x31935c,_0x3a4e67[_0x5665('0x34')]()+'\x0a');}_0x3a4e67=[];}if(!(stats[_0x5665('0x90')]%0xc8)){socket['emit'](_0x5665('0x91')+_0x27b354,stats);stats[_0x5665('0x5c')]=[];}}if(stopped){logger[_0x5665('0x59')]('Abort\x20parser');_0x1b7bf2[_0x5665('0x92')]();}}catch(_0x46f69f){handleError(_0x5db678[_0x5665('0x7f')][_0x2cd418],{'code':_0x5665('0x93'),'message':_0x46f69f[_0x5665('0x5e')]});logger[_0x5665('0x63')](_0x5665('0x94'),_0x46f69f['message']);}},'complete':function(){try{var _0x286804=[];var _0x1a29a8=[];var _0xf780cd=_0x5665('0x35');if(_0x560952[_0x5665('0x95')]&&_0x560952[_0x5665('0x95')][_0x5665('0x19')]){_0xf780cd=_0x5665('0x96')+_0x27b354;_0x286804[_0x5665('0x1a')](_0x5665('0x97')+_0xf780cd+_0x5665('0x98'));}tmp_campaigns='campaigns_'+_0x27b354;tmp_voice_queues='voice_queues_'+_0x27b354;_0x1a29a8[_0x5665('0x1a')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x5665('0x99'));_0x1a29a8['push'](_0x5665('0x97')+tmp_voice_queues+_0x5665('0x99'));BPromise[_0x5665('0x9a')](_0x1a29a8,handleTZQuery)[_0x5665('0x18')](function(_0x12b274){updateTzCampaigns(_0x560952['ListId'])[_0x5665('0x18')](function(_0x50ad51){updateTzVoiceQueues(_0x560952[_0x5665('0x2e')])['then'](function(_0x10fe85){if(hasTZ)_0x281efa=_0x281efa[_0x5665('0x81')](_0x5665('0x6c'),'dialTimezone,utcOffset');var _0x5b6db2=util[_0x5665('0xb')](_0x5665('0x9b'),_0x31935c,_0xf780cd,_0x281efa,_0x560952[_0x5665('0x2e')],_0x560952[_0x5665('0x53')]||null,NOW,NOW);if(_[_0x5665('0x1d')](_0x4d3597[_0x5665('0x46')])){_0x5b6db2+=',\x20scheduledAt\x20=\x20NOW()';}_0x286804[_0x5665('0x1a')](_0x5b6db2);if(_0x560952[_0x5665('0x95')]&&_0x560952[_0x5665('0x95')][_0x5665('0x19')]){_0x286804['push'](insertCmContact(_0x560952[_0x5665('0x2e')],_0xf780cd,_0x560952[_0x5665('0x95')],_0x4d3597));_0x286804[_0x5665('0x1a')](_0x5665('0x9c')+_0xf780cd+';');}BPromise[_0x5665('0x9a')](_0x286804,handleQuery)[_0x5665('0x18')](function(_0x212426){BPromise['all']([handleAdditionalPhones()])[_0x5665('0x18')](function(){_0x286804=[];for(var _0x5c8383=0x0;_0x5c8383\x20\x20','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','select','field','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','push','all','then','error','message','AdditionalPhones','split','CmContactHasItem','update','create','inserted','CmContact','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','from','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','into','cm_hopper_black','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','\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'];(function(_0x1fc6c9,_0x203742){var _0x10fb88=function(_0x6d2637){while(--_0x6d2637){_0x1fc6c9['push'](_0x1fc6c9['shift']());}};_0x10fb88(++_0x203742);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0xe36e('0x0'));var util=require('util');var BPromise=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var squel=require(_0xe36e('0x3'));var Redis=require(_0xe36e('0x4'));var db=require(_0xe36e('0x5'))['db'];var config=require(_0xe36e('0x6'));var logger=require(_0xe36e('0x7'))(_0xe36e('0x8'));config[_0xe36e('0x9')]=_[_0xe36e('0xa')](config[_0xe36e('0x9')],{'host':_0xe36e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe36e('0x9')]));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'](_0xe36e('0xc'));var tempTableName=_0xe36e('0xd')+moment()[_0xe36e('0xe')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0xf119e4){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'](_0xf119e4);}function selectNotIn(_0x2e968d,_0x2133cf,_0x43d604,_0x2ad6fd,_0xce0110){return squel[_0xe36e('0xf')]()[_0xe36e('0x10')](_0xe36e('0x11'))['from'](_0x2ad6fd)[_0xe36e('0x12')](_0x2133cf,null,_0x2133cf+_0xe36e('0x13')+_0x2ad6fd+'.'+_0x43d604)[_0xe36e('0x14')](_0x2ad6fd+'.'+_0x43d604+_0xe36e('0x15')+_0x2e968d+'.'+_0x43d604)['where'](_0x2133cf+_0xe36e('0x16')+_0xce0110['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x525155,_0x27ff47){promisesAdditionalPhones=[];promisesContact=[];return db[_0xe36e('0x17')][_0xe36e('0x18')](_0xe36e('0x19')+tempTableName)[_0xe36e('0x1a')](function(_0x924cd5){if(_0x924cd5!==null){var _0x2096f6=[];for(var _0x39bae8=0x0;_0x39bae8<_0x924cd5[_0xe36e('0x1b')];_0x39bae8++){var _0x428d34=_0x924cd5[_0x39bae8];if(!_['isNil'](_0x428d34[_0xe36e('0x11')])){if(!_[_0xe36e('0x1c')](_0x428d34['AdditionalPhones']))_0x2096f6[_0xe36e('0x1d')](insertAdditionalPhones(_0x428d34));promisesContact['push']({'contact':_0x428d34});}}}Promise[_0xe36e('0x1e')](_0x2096f6)[_0xe36e('0x1f')](function(){_0x525155({'val':0x1});});})['catch'](function(_0x472825){logger[_0xe36e('0x20')](_0x472825[_0xe36e('0x21')]);});});}function insertAdditionalPhones(_0x597331){return new Promise(function(_0x21e95e,_0x21bcf9){var _0x3f0ae3=_0x597331[_0xe36e('0x22')];if(_[_0xe36e('0x1c')](_0x3f0ae3))_0x21bcf9({'val':0x0});else{var _0x360b95=_0x3f0ae3['split'](';');var _0xd71137=[];orderBy=0x0;for(var _0x4f214a=0x0;_0x4f214a<_0x360b95[_0xe36e('0x1b')];_0x4f214a++){_0xd71137[_0xe36e('0x1d')](splitAdditionalPhone(_0x597331['id'],_0x360b95[_0x4f214a]));}Promise[_0xe36e('0x1e')](_0xd71137)['then'](function(){_0x21e95e({'val':_0x360b95['length']});});}});}function splitAdditionalPhone(_0x4749a8,_0x10818d){return new Promise(function(_0xb0cd85,_0xb32195){var _0x31c12c=_0x10818d[_0xe36e('0x23')](':');var _0x1a045c=_0x31c12c[0x0];var _0x5ac484=_0x31c12c[0x1];if(_0x5ac484!==''){var _0x3cafbf=_0x5ac484[_0xe36e('0x23')]('|');var _0x10597f=[];for(var _0x262caa=0x0;_0x262caa<_0x3cafbf['length'];_0x262caa++){if(_0x3cafbf[_0x262caa]!==''){var _0x2d757c=_['filter'](promisesAdditionalPhones,{'contactId':_0x4749a8,'phone':_0x3cafbf[_0x262caa]});if(_0x2d757c[_0xe36e('0x1b')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x4749a8,'contactTypeId':_0x1a045c,'phone':_0x3cafbf[_0x262caa],'orderBy':orderBy});}}}_0xb0cd85({'ok':0x1});}else _0xb0cd85({'res':0x0});});}function createAdditionalPhone(_0x19f001,_0x5884cb,_0x410504,_0x4c5d98){var _0x3b1045='';var _0x59548b='';var _0x4bb75b=_0x410504['split']('§');_0x3b1045=_0x4bb75b[0x0];if(_0x4bb75b['length']==0x2)_0x59548b=_0x4bb75b[0x1];return new Promise(function(_0x203fa2,_0x1fc639){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x19f001,'item':_0x3b1045}})[_0xe36e('0x1f')](function(_0xb8d44e){if(_0xb8d44e){return db[_0xe36e('0x24')][_0xe36e('0x25')]({'ItemTypeId':_0x5884cb,'description':_0x59548b,'OrderBy':_0x4c5d98},{'where':{'CmContactId':_0x19f001,'item':_0x3b1045}})[_0xe36e('0x1f')](function(_0x4759b4){_0x203fa2({'res':'updated'});});}else{return db[_0xe36e('0x24')][_0xe36e('0x26')]({'CmContactId':_0x19f001,'item':_0x3b1045,'ItemTypeId':_0x5884cb,'description':_0x59548b,'OrderBy':_0x4c5d98,'ItemClass':'PHONE'})[_0xe36e('0x1f')](function(_0xa06f61){_0x203fa2({'res':_0xe36e('0x27')});});}});});}function updateContact(_0x5d6f41){return new Promise(function(_0x21623e,_0x253cdc){var _0xfe4ee8=_0x5d6f41['id'];delete _0x5d6f41['id'];return db[_0xe36e('0x28')][_0xe36e('0x25')](_0x5d6f41,{'where':{'id':_0xfe4ee8}})[_0xe36e('0x1f')](function(_0xf808f5){updatedRows+=0x1;return db['CmHopper'][_0xe36e('0x25')]({'phone':_0x5d6f41['phone']},{'where':{'ContactId':_0xfe4ee8}})['then'](function(_0x81cf9a){_0x21623e({'ret':'OK'});});});});}function insertCmHopper(_0x4f620d,_0x3b1299,_0x248f39,_0x38bdbc,_0x235437){var _0x4a6a2b=['cm_contacts.phone',_0xe36e('0x29'),_0xe36e('0x2a'),_0xe36e('0x2b'),_0x3b1299+'.'+_0x38bdbc,_0xe36e('0x2c'),'cm_contacts.updatedAt',_0xe36e('0x2d'),_0xe36e('0x2e'),'\x22'+_0x235437+'\x22'];return squel[_0xe36e('0x2f')]()['into'](_0xe36e('0x30'))[_0xe36e('0x31')](['phone',_0xe36e('0x32'),_0xe36e('0x33'),_0xe36e('0x34'),_0x38bdbc,_0xe36e('0x35'),_0xe36e('0x36'),_0xe36e('0x37'),_0xe36e('0x38'),_0xe36e('0x39')],squel[_0xe36e('0xf')]()[_0xe36e('0x3a')](_0x4a6a2b)[_0xe36e('0x3b')](_0x3b1299)[_0xe36e('0x12')](_0xe36e('0x3c'),null,'cm_contacts.ListId\x20=\x20'+_0x3b1299+_0xe36e('0x3d'))[_0xe36e('0x12')](_0x248f39,null,_0x248f39+_0xe36e('0x13')+_0x3b1299+'.'+_0x38bdbc)[_0xe36e('0x14')](_0x3b1299+_0xe36e('0x3e'),_0x4f620d)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xe36e('0x14')](_0xe36e('0x3f'),selectNotIn(_0x3b1299,_0x248f39,_0x38bdbc,_0xe36e('0x30'),[_0xe36e('0x40'),_0xe36e('0x41')]))[_0xe36e('0x14')](_0xe36e('0x3f'),selectNotIn(_0x3b1299,_0x248f39,_0x38bdbc,_0xe36e('0x30'),['\x22always\x22'])))[_0xe36e('0x42')]();}function insertCmHopperBlack(_0x2d392c,_0x4788a0,_0x21dc35,_0x5ef3e4){var _0x23e344=[_0xe36e('0x43'),_0xe36e('0x2a'),_0xe36e('0x2b'),_0x4788a0+'.'+_0x5ef3e4,_0xe36e('0x2c'),'cm_contacts.updatedAt'];return squel[_0xe36e('0x2f')]()[_0xe36e('0x44')](_0xe36e('0x45'))[_0xe36e('0x31')]([_0xe36e('0x11'),_0xe36e('0x33'),'ListId',_0x5ef3e4,_0xe36e('0x35'),_0xe36e('0x36')],squel[_0xe36e('0xf')]()[_0xe36e('0x3a')](_0x23e344)[_0xe36e('0x3b')](_0x4788a0)['join'](_0xe36e('0x3c'),null,_0xe36e('0x46')+_0x4788a0+_0xe36e('0x3d'))[_0xe36e('0x12')](_0x21dc35,null,_0x21dc35+_0xe36e('0x13')+_0x4788a0+'.'+_0x5ef3e4)[_0xe36e('0x14')](_0x4788a0+_0xe36e('0x3e'),_0x2d392c)[_0xe36e('0x14')](_0xe36e('0x47'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xe36e('0xf')]()['field'](_0xe36e('0x11'))[_0xe36e('0x3b')](_0xe36e('0x45'))[_0xe36e('0x14')]('ListId\x20=\x20?',_0x2d392c)[_0xe36e('0x14')](_0x5ef3e4+_0xe36e('0x48'),_0x4788a0+'.'+_0x5ef3e4)))['toString']();}function insertCmHopperAdditionalPhones(_0x125e62){var _0x40634a=[_0xe36e('0x49'),_0xe36e('0x4a'),_0xe36e('0x4b'),_0xe36e('0x4c'),_0xe36e('0x4d')];return squel[_0xe36e('0x2f')]()[_0xe36e('0x44')](_0xe36e('0x4e'))[_0xe36e('0x31')]([_0xe36e('0x4f'),_0xe36e('0x11'),_0xe36e('0x50'),_0xe36e('0x35'),'updatedAt'],squel[_0xe36e('0xf')]()['fields'](_0x40634a)['from'](_0xe36e('0x30'))[_0xe36e('0x12')]('cm_contacts',null,_0xe36e('0x51'))[_0xe36e('0x12')](_0xe36e('0x52'),null,_0xe36e('0x53'))[_0xe36e('0x14')](_0xe36e('0x54'),_0x125e62)[_0xe36e('0x14')](_0xe36e('0x47'),NOW))[_0xe36e('0x42')]();}function insertCmContact(_0x55d190,_0x22117e,_0x837e8,_0x546509){var _0x1d0fac=_[_0xe36e('0x55')](_[_0xe36e('0x56')](_0x546509),[_0xe36e('0x34'),_0xe36e('0x57'),'createdAt','updatedAt']);return squel['insert']()['into'](_0xe36e('0x3c'))[_0xe36e('0x31')](_0x1d0fac,squel[_0xe36e('0xf')]()[_0xe36e('0x3a')](_0x1d0fac)[_0xe36e('0x3b')](_0x22117e)[_0xe36e('0x14')]('('+_0x837e8[_0xe36e('0x12')](',')+_0xe36e('0x58'),squel[_0xe36e('0xf')]()['fields'](_0x837e8)[_0xe36e('0x3b')](_0xe36e('0x3c'))['where'](_0xe36e('0x59'),_0x55d190))[_0xe36e('0x14')](_0xe36e('0x5a'),squel[_0xe36e('0xf')]()[_0xe36e('0x10')](_0xe36e('0x5b'),_0xe36e('0x5c'))[_0xe36e('0x3b')](_0x22117e)[_0xe36e('0x5d')](_0x837e8[_0xe36e('0x12')](','))))[_0xe36e('0x42')]();}function handleStop(){logger[_0xe36e('0x5e')](_0xe36e('0x5f'));stopped=!![];}function handleUncaughtException(_0x6f979f){logger[_0xe36e('0x20')](_0x6f979f[_0xe36e('0x21')]);process[_0xe36e('0x60')](0x1);}function handleError(_0x275142,_0x14738a){stats[_0xe36e('0x61')][_0xe36e('0x1d')]({'name':_0x14738a[_0xe36e('0x62')],'message':_0x14738a[_0xe36e('0x21')],'row':_0x275142});}function handleQuery(_0x434d88){logger[_0xe36e('0x5e')](_0x434d88);return db['sequelize'][_0xe36e('0x18')](_0x434d88)[_0xe36e('0x1a')](function(_0x49336b){results[_0xe36e('0x1d')](_0x49336b);})[_0xe36e('0x63')](function(_0x180dc3){logger[_0xe36e('0x20')](_0x180dc3[_0xe36e('0x21')]);});}function main(_0x34a2c3,_0x49deab,_0x3db651,_0x5b7185){logger[_0xe36e('0x5e')](_0xe36e('0x64'),_0x34a2c3,JSON[_0xe36e('0x65')](_0x49deab));process[_0xe36e('0x66')](_0xe36e('0x67'));var _0x109def=_0x49deab[_0xe36e('0x68')];var _0xfea627=_['clone'](_0x109def);var _0x34c7a5=_0x49deab[_0xe36e('0x69')];var _0x4e6929=path[_0xe36e('0x12')](config[_0xe36e('0x6a')],_0xe36e('0x6b'),_0x34c7a5+_0xe36e('0x6c'));logger[_0xe36e('0x5e')](_0xe36e('0x6d'),_0x49deab);db[_0xe36e('0x6e')]['findAll']({'raw':!![],'attributes':['id',_0xe36e('0x6f')]})[_0xe36e('0x1f')](function(_0x4289e2){for(var _0x1b7268=0x0;_0x1b7268<_0x4289e2[_0xe36e('0x1b')];_0x1b7268++){if(_0x4289e2[_0x1b7268][_0xe36e('0x6f')]in _0x109def){contactItemTypes[_0xe36e('0x1d')](_0x4289e2[_0x1b7268]);delete _0xfea627[_0x4289e2[_0x1b7268][_0xe36e('0x6f')]];hasAdditionalPhones=!![];}for(var _0x42d246 in _0x109def){if(_0x4289e2[_0x1b7268][_0xe36e('0x6f')]+_0xe36e('0x70')===_0x42d246){phoneDescriptions['push']({'itemTypeId':_0x4289e2[_0x1b7268]['id'],'description':_0x42d246});delete _0xfea627[_0x42d246];}}}if(hasAdditionalPhones)_0xfea627[_0xe36e('0x22')]='';var _0x9a77de=_[_0xe36e('0x56')](_0xfea627)[_0xe36e('0x12')]();logger['info']('header',_0x9a77de);fs[_0xe36e('0x71')](_0x4e6929,_0x9a77de+'\x0a');Papa['parse'](fs['createReadStream'](_0x34a2c3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x59c454,_0xe0a282){try{for(var _0x51041b=0x0,_0x2cbd78=[];_0x51041b<_0x59c454[_0xe36e('0x72')][_0xe36e('0x1b')];_0x51041b++){stats[_0xe36e('0x73')]+=0x1;if(_0x59c454[_0xe36e('0x61')][_0x51041b]){handleError(_0x59c454[_0xe36e('0x72')][_0x51041b],_0x59c454[_0xe36e('0x61')][_0x51041b]);}else{var _0x14a9b4=[];var _0x2a26f4=[];var _0x5e7c92={};for(var _0x7b9501 in _0x109def){let _0x54f14c=contactItemTypes[_0xe36e('0x74')](_0x517c2a=>_0x517c2a[_0xe36e('0x6f')]===_0x7b9501);let _0x209e45=contactItemTypes[_0xe36e('0x74')](_0x29a372=>_0x29a372['name']+'_description'===_0x7b9501);if(_[_0xe36e('0x1c')](_0x54f14c)&&_[_0xe36e('0x1c')](_0x209e45)){if(_0x109def[_0xe36e('0x75')](_0x7b9501)){if(_0x59c454[_0xe36e('0x72')][_0x51041b][_0x109def[_0x7b9501]]){var _0x522968=_[_0xe36e('0x76')](_0x59c454['data'][_0x51041b][_0x109def[_0x7b9501]][_0xe36e('0x77')](/"/g,'\x27'));switch(_0x7b9501){case _0xe36e('0x32'):var _0x4e55b5=moment(_0x522968,_0xe36e('0xc'),!![]);if(_0x4e55b5['isValid']()){_0x2cbd78[_0xe36e('0x1d')]('\x22'+_0x522968+'\x22');}else{_0x14a9b4[_0xe36e('0x1d')](_0xe36e('0x78'));}break;case _0xe36e('0x37'):var _0x5af384=parseInt(_0x522968);_0x522968=_[_0xe36e('0x79')](_0x5af384)||_0x5af384<0x0||_0x5af384>0x4?_0x5b7185?0x3:0x2:_0x5af384;_0x2cbd78['push']('\x22'+_0x522968+'\x22');break;case'UserId':var _0x39ace1=parseInt(_0x522968);if(_[_0xe36e('0x7a')](_0x39ace1)&&_['includes'](_0x3db651,_0x39ace1)){_0x2cbd78['push']('\x22'+_0x39ace1+'\x22');}else{_0x14a9b4[_0xe36e('0x1d')]('agent\x20not\x20exists');}break;case _0xe36e('0x7b'):if(isEmail(_0x522968)){_0x2cbd78[_0xe36e('0x1d')]('\x22'+_0x522968+'\x22');}else{_0x14a9b4[_0xe36e('0x1d')](_0xe36e('0x7c'));}break;case _0xe36e('0x7d'):var _0x16c26a=moment(_0x522968,'YYYY-MM-DD',!![]);if(_0x16c26a[_0xe36e('0x7e')]()){_0x2cbd78[_0xe36e('0x1d')]('\x22'+_0x522968+'\x22');}else{_0x14a9b4[_0xe36e('0x1d')](_0xe36e('0x7f'));}break;default:_0x2cbd78['push']('\x22'+_0x522968+'\x22');}}else{switch(_0x7b9501){case _0xe36e('0x80'):case _0xe36e('0x11'):_0x14a9b4[_0xe36e('0x1d')](_0x7b9501+_0xe36e('0x81'));break;default:_0x2cbd78['push']('\x22\x22');}}}}else{var _0x38be05='';if(!_['isNil'](_0x54f14c)){if(!_0x5e7c92[_0xe36e('0x75')](_0x54f14c['id'])){for(var _0x5d3dac=0x0;_0x5d3dac<_0x109def[_0x7b9501][_0xe36e('0x1b')];_0x5d3dac++){var _0x522968=_['trim'](_0x59c454[_0xe36e('0x72')][_0x51041b][_0x109def[_0x7b9501][_0x5d3dac]][_0xe36e('0x77')](/"/g,'\x27'));var _0x354b25=phoneDescriptions['find'](_0x347c17=>_0x347c17[_0xe36e('0x82')]===_0x54f14c['id']);if(!_['isNil'](_0x354b25)){var _0x3beba7=_[_0xe36e('0x76')](_0x59c454[_0xe36e('0x72')][_0x51041b][_0x109def[_0x354b25['description']][0x0]]['replace'](/"/g,'\x27'));if(!_[_0xe36e('0x1c')](_0x3beba7))_0x522968=_0x522968+'§'+_0x3beba7;}if(_0x38be05=='')_0x38be05=_0x522968;else _0x38be05+='|'+_0x522968;}_0x2a26f4[_0xe36e('0x1d')](_0x54f14c['id']+':'+_0x38be05);_0x5e7c92[_0x54f14c['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2cbd78[_0xe36e('0x1d')]('\x22'+_0x2a26f4[_0xe36e('0x12')](';')+'\x22');}if(_0x14a9b4[_0xe36e('0x1b')]){handleError(_0x59c454['data'][_0x51041b],{'code':_0xe36e('0x83'),'message':_0x14a9b4[_0xe36e('0x12')]()});}else{fs[_0xe36e('0x84')](_0x4e6929,_0x2cbd78[_0xe36e('0x12')]()+'\x0a');}_0x2cbd78=[];}if(!(stats[_0xe36e('0x73')]%0xc8)){socket['emit'](_0xe36e('0x85')+_0x34c7a5,stats);stats[_0xe36e('0x61')]=[];}}if(stopped){logger[_0xe36e('0x5e')]('Abort\x20parser');_0xe0a282[_0xe36e('0x86')]();}}catch(_0x499f0a){handleError(_0x59c454[_0xe36e('0x72')][_0x51041b],{'code':'SystemError','message':_0x499f0a[_0xe36e('0x21')]});logger[_0xe36e('0x20')]('step',_0x499f0a[_0xe36e('0x21')]);}},'complete':function(){try{var _0x52d4fe=[];var _0xa58551=tempTableName;_0x52d4fe[_0xe36e('0x1d')](_0xe36e('0x87')+_0xa58551+_0xe36e('0x88'));logger[_0xe36e('0x5e')]('CIS\x20len',contactItemTypes[_0xe36e('0x1b')]);var _0x4d75f8=util[_0xe36e('0xe')](_0xe36e('0x89'),_0x4e6929,_0xa58551,_0x9a77de,_0x49deab[_0xe36e('0x34')],_0x49deab[_0xe36e('0x57')]||null,NOW,NOW);if(_[_0xe36e('0x1c')](_0x109def[_0xe36e('0x32')])){_0x4d75f8+=',\x20scheduledAt\x20=\x20NOW()';}_0x52d4fe[_0xe36e('0x1d')](_0x4d75f8);BPromise[_0xe36e('0x8a')](_0x52d4fe,handleQuery)[_0xe36e('0x1f')](function(_0x4fd01d){BPromise[_0xe36e('0x1e')]([handleAdditionalPhones()])[_0xe36e('0x1f')](function(){_0x52d4fe=[];for(var _0x352e4a=0x0;_0x352e4a\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','from','where','.dialCheckDuplicateType\x20IN\x20(','join','query','spread','length','isNil','phone','AdditionalPhones','push','all','error','split','filter','CmContactHasItem','findOne','then','update','updated','create','PHONE','inserted','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.createdAt','cm_hopper_black','.CmListId','ListId\x20=\x20?','toString','cm_contact_has_items.item','cm_contact_has_items.createdAt','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','MIN(id)','min_id','group','info','message','errors','sequelize','catch','main','send','clone','root','server/files/tmp','.csv','ContactItemType'];(function(_0x1951fd,_0x2a91df){var _0xe45e33=function(_0x367672){while(--_0x367672){_0x1951fd['push'](_0x1951fd['shift']());}};_0xe45e33(++_0x2a91df);}(_0xc434,0x16b));var _0x4c43=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xc434[_0x2aec52];return _0x3b8835;};'use strict';var fs=require('fs');var path=require(_0x4c43('0x0'));var _=require(_0x4c43('0x1'));var Papa=require(_0x4c43('0x2'));var util=require(_0x4c43('0x3'));var BPromise=require(_0x4c43('0x4'));var moment=require(_0x4c43('0x5'));var squel=require(_0x4c43('0x6'));var Redis=require(_0x4c43('0x7'));var db=require('../../../mysqldb')['db'];var config=require(_0x4c43('0x8'));var logger=require(_0x4c43('0x9'))(_0x4c43('0xa'));config[_0x4c43('0xb')]=_[_0x4c43('0xc')](config[_0x4c43('0xb')],{'host':_0x4c43('0xd'),'port':0x18eb});var socket=require(_0x4c43('0xe'))(new Redis(config[_0x4c43('0xb')]));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()[_0x4c43('0xf')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x4c43('0x10')+moment()[_0x4c43('0xf')](_0x4c43('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4fb2fc){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))*$/[_0x4c43('0x12')](_0x4fb2fc);}function selectNotIn(_0x23b930,_0x223cf0,_0x2115ae,_0x26eee2,_0x39acf3){return squel[_0x4c43('0x13')]()[_0x4c43('0x14')]('phone')[_0x4c43('0x15')](_0x26eee2)['join'](_0x223cf0,null,_0x223cf0+'.id\x20=\x20'+_0x26eee2+'.'+_0x2115ae)[_0x4c43('0x16')](_0x26eee2+'.'+_0x2115ae+'\x20=\x20'+_0x23b930+'.'+_0x2115ae)[_0x4c43('0x16')](_0x223cf0+_0x4c43('0x17')+_0x39acf3[_0x4c43('0x18')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x35fac6,_0x2ff9ad){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x4c43('0x19')]('select\x20*\x20from\x20'+tempTableName)[_0x4c43('0x1a')](function(_0x2c75a0){if(_0x2c75a0!==null){var _0xd93120=[];for(var _0x23d4a2=0x0;_0x23d4a2<_0x2c75a0[_0x4c43('0x1b')];_0x23d4a2++){var _0x467967=_0x2c75a0[_0x23d4a2];if(!_[_0x4c43('0x1c')](_0x467967[_0x4c43('0x1d')])){if(!_[_0x4c43('0x1c')](_0x467967[_0x4c43('0x1e')]))_0xd93120[_0x4c43('0x1f')](insertAdditionalPhones(_0x467967));promisesContact[_0x4c43('0x1f')]({'contact':_0x467967});}}}Promise[_0x4c43('0x20')](_0xd93120)['then'](function(){_0x35fac6({'val':0x1});});})['catch'](function(_0x53f51d){logger[_0x4c43('0x21')](_0x53f51d['message']);});});}function insertAdditionalPhones(_0x7650d6){return new Promise(function(_0x104c6a,_0x5e5fb0){var _0x123c90=_0x7650d6['AdditionalPhones'];if(_['isNil'](_0x123c90))_0x5e5fb0({'val':0x0});else{var _0x1d6a86=_0x123c90['split'](';');var _0x276c2c=[];orderBy=0x0;for(var _0x5e1f35=0x0;_0x5e1f35<_0x1d6a86[_0x4c43('0x1b')];_0x5e1f35++){_0x276c2c[_0x4c43('0x1f')](splitAdditionalPhone(_0x7650d6['id'],_0x1d6a86[_0x5e1f35]));}Promise[_0x4c43('0x20')](_0x276c2c)['then'](function(){_0x104c6a({'val':_0x1d6a86[_0x4c43('0x1b')]});});}});}function splitAdditionalPhone(_0x3955da,_0xe31a9d){return new Promise(function(_0x3c264f,_0x15f70f){var _0x52b986=_0xe31a9d[_0x4c43('0x22')](':');var _0x436b1b=_0x52b986[0x0];var _0x1fd224=_0x52b986[0x1];if(_0x1fd224!==''){var _0x355cf9=_0x1fd224[_0x4c43('0x22')]('|');var _0x11d286=[];for(var _0x59671d=0x0;_0x59671d<_0x355cf9[_0x4c43('0x1b')];_0x59671d++){if(_0x355cf9[_0x59671d]!==''){var _0x2c08bf=_[_0x4c43('0x23')](promisesAdditionalPhones,{'contactId':_0x3955da,'phone':_0x355cf9[_0x59671d]});if(_0x2c08bf[_0x4c43('0x1b')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x3955da,'contactTypeId':_0x436b1b,'phone':_0x355cf9[_0x59671d],'orderBy':orderBy});}}}_0x3c264f({'ok':0x1});}else _0x3c264f({'res':0x0});});}function createAdditionalPhone(_0x355ead,_0xebf5ae,_0x31b97f,_0x3a36f0){var _0x2f0533='';var _0x38c31a='';var _0x5423be=_0x31b97f[_0x4c43('0x22')]('§');_0x2f0533=_0x5423be[0x0];if(_0x5423be[_0x4c43('0x1b')]==0x2)_0x38c31a=_0x5423be[0x1];return new Promise(function(_0x3ca787,_0x1409de){return db[_0x4c43('0x24')][_0x4c43('0x25')]({'where':{'CmContactId':_0x355ead,'item':_0x2f0533}})[_0x4c43('0x26')](function(_0x1cee04){if(_0x1cee04){return db['CmContactHasItem'][_0x4c43('0x27')]({'ItemTypeId':_0xebf5ae,'description':_0x38c31a,'OrderBy':_0x3a36f0},{'where':{'CmContactId':_0x355ead,'item':_0x2f0533}})[_0x4c43('0x26')](function(_0xccca4d){_0x3ca787({'res':_0x4c43('0x28')});});}else{return db[_0x4c43('0x24')][_0x4c43('0x29')]({'CmContactId':_0x355ead,'item':_0x2f0533,'ItemTypeId':_0xebf5ae,'description':_0x38c31a,'OrderBy':_0x3a36f0,'ItemClass':_0x4c43('0x2a')})[_0x4c43('0x26')](function(_0x4b73da){_0x3ca787({'res':_0x4c43('0x2b')});});}});});}function updateContact(_0x2e64a3){return new Promise(function(_0x62cfa3,_0x51f714){var _0x4ffe54=_0x2e64a3['id'];delete _0x2e64a3['id'];return db['CmContact']['update'](_0x2e64a3,{'where':{'id':_0x4ffe54}})['then'](function(_0x4929b4){updatedRows+=0x1;return db[_0x4c43('0x2c')]['update']({'phone':_0x2e64a3['phone']},{'where':{'ContactId':_0x4ffe54}})['then'](function(_0x4390f9){_0x62cfa3({'ret':'OK'});});});});}function insertCmHopper(_0x2be4f1,_0x10b199,_0x2a3f59,_0x24633c,_0x262940){var _0x129152=[_0x4c43('0x2d'),_0x4c43('0x2e'),'cm_contacts.id',_0x4c43('0x2f'),_0x10b199+'.'+_0x24633c,'cm_contacts.createdAt',_0x4c43('0x30'),'cm_contacts.priority',_0x4c43('0x31'),'\x22'+_0x262940+'\x22'];return squel[_0x4c43('0x32')]()[_0x4c43('0x33')](_0x4c43('0x34'))[_0x4c43('0x35')]([_0x4c43('0x1d'),_0x4c43('0x36'),_0x4c43('0x37'),_0x4c43('0x38'),_0x24633c,_0x4c43('0x39'),_0x4c43('0x3a'),_0x4c43('0x3b'),_0x4c43('0x3c'),_0x4c43('0x3d')],squel[_0x4c43('0x13')]()[_0x4c43('0x3e')](_0x129152)[_0x4c43('0x15')](_0x10b199)[_0x4c43('0x18')](_0x4c43('0x3f'),null,_0x4c43('0x40')+_0x10b199+'.CmListId')[_0x4c43('0x18')](_0x2a3f59,null,_0x2a3f59+_0x4c43('0x41')+_0x10b199+'.'+_0x24633c)[_0x4c43('0x16')](_0x10b199+_0x4c43('0x42'),_0x2be4f1)[_0x4c43('0x16')](_0x4c43('0x43'),NOW)[_0x4c43('0x16')](_0x4c43('0x44'),selectNotIn(_0x10b199,_0x2a3f59,_0x24633c,_0x4c43('0x34'),[_0x4c43('0x45'),_0x4c43('0x46')]))['where'](_0x4c43('0x44'),selectNotIn(_0x10b199,_0x2a3f59,_0x24633c,_0x4c43('0x34'),[_0x4c43('0x45')])))['toString']();}function insertCmHopperBlack(_0x51a498,_0x98fdc4,_0x3747bf,_0x55c9a4){var _0x46dd85=['cm_contacts.phone','cm_contacts.id',_0x4c43('0x2f'),_0x98fdc4+'.'+_0x55c9a4,_0x4c43('0x47'),_0x4c43('0x30')];return squel[_0x4c43('0x32')]()[_0x4c43('0x33')](_0x4c43('0x48'))[_0x4c43('0x35')](['phone',_0x4c43('0x37'),_0x4c43('0x38'),_0x55c9a4,'createdAt',_0x4c43('0x3a')],squel[_0x4c43('0x13')]()[_0x4c43('0x3e')](_0x46dd85)[_0x4c43('0x15')](_0x98fdc4)['join'](_0x4c43('0x3f'),null,_0x4c43('0x40')+_0x98fdc4+_0x4c43('0x49'))[_0x4c43('0x18')](_0x3747bf,null,_0x3747bf+'.id\x20=\x20'+_0x98fdc4+'.'+_0x55c9a4)[_0x4c43('0x16')](_0x98fdc4+_0x4c43('0x42'),_0x51a498)['where'](_0x4c43('0x43'),NOW)[_0x4c43('0x16')](_0x4c43('0x44'),squel[_0x4c43('0x13')]()[_0x4c43('0x14')]('phone')[_0x4c43('0x15')](_0x4c43('0x48'))['where'](_0x4c43('0x4a'),_0x51a498)[_0x4c43('0x16')](_0x55c9a4+'\x20=\x20?',_0x98fdc4+'.'+_0x55c9a4)))[_0x4c43('0x4b')]();}function insertCmHopperAdditionalPhones(_0x1dc193){var _0x5a5db1=['cm_hopper.id',_0x4c43('0x4c'),'cm_contact_has_items.OrderBy',_0x4c43('0x4d'),'cm_contact_has_items.updatedAt'];return squel[_0x4c43('0x32')]()[_0x4c43('0x33')]('cm_hopper_additional_phones')[_0x4c43('0x35')]([_0x4c43('0x4e'),_0x4c43('0x1d'),_0x4c43('0x4f'),_0x4c43('0x39'),_0x4c43('0x3a')],squel['select']()[_0x4c43('0x3e')](_0x5a5db1)['from'](_0x4c43('0x34'))[_0x4c43('0x18')](_0x4c43('0x3f'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x4c43('0x18')](_0x4c43('0x50'),null,_0x4c43('0x51'))[_0x4c43('0x16')](_0x4c43('0x52'),_0x1dc193)[_0x4c43('0x16')](_0x4c43('0x43'),NOW))['toString']();}function insertCmContact(_0x58a70a,_0x21d590,_0x32a3eb,_0xbf4524){var _0x2ecd44=_[_0x4c43('0x53')](_[_0x4c43('0x54')](_0xbf4524),[_0x4c43('0x38'),_0x4c43('0x55'),'createdAt','updatedAt']);return squel[_0x4c43('0x32')]()[_0x4c43('0x33')]('cm_contacts')['fromQuery'](_0x2ecd44,squel['select']()[_0x4c43('0x3e')](_0x2ecd44)[_0x4c43('0x15')](_0x21d590)[_0x4c43('0x16')]('('+_0x32a3eb[_0x4c43('0x18')](',')+_0x4c43('0x56'),squel[_0x4c43('0x13')]()[_0x4c43('0x3e')](_0x32a3eb)[_0x4c43('0x15')]('cm_contacts')[_0x4c43('0x16')]('ListId\x20=\x20?',_0x58a70a))[_0x4c43('0x16')]('id\x20IN\x20?',squel[_0x4c43('0x13')]()[_0x4c43('0x14')](_0x4c43('0x57'),_0x4c43('0x58'))['from'](_0x21d590)[_0x4c43('0x59')](_0x32a3eb[_0x4c43('0x18')](','))))[_0x4c43('0x4b')]();}function handleStop(){logger[_0x4c43('0x5a')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x5337ce){logger[_0x4c43('0x21')](_0x5337ce[_0x4c43('0x5b')]);process['exit'](0x1);}function handleError(_0x3e65d9,_0x4b98e4){stats[_0x4c43('0x5c')]['push']({'name':_0x4b98e4['code'],'message':_0x4b98e4[_0x4c43('0x5b')],'row':_0x3e65d9});}function handleQuery(_0x13c8d5){logger['info'](_0x13c8d5);return db[_0x4c43('0x5d')][_0x4c43('0x19')](_0x13c8d5)['spread'](function(_0x109871){results[_0x4c43('0x1f')](_0x109871);})[_0x4c43('0x5e')](function(_0x11cbb1){logger[_0x4c43('0x21')](_0x11cbb1[_0x4c43('0x5b')]);});}function main(_0xe358b5,_0x37776e,_0x35f4b3,_0x312a3c){logger[_0x4c43('0x5a')](_0x4c43('0x5f'),_0xe358b5,JSON['stringify'](_0x37776e));process[_0x4c43('0x60')]('start');var _0x37ac7b=_0x37776e['binding'];var _0xe9e745=_[_0x4c43('0x61')](_0x37ac7b);var _0x53c02b=_0x37776e['socket_timestamp'];var _0x2dc326=path[_0x4c43('0x18')](config[_0x4c43('0x62')],_0x4c43('0x63'),_0x53c02b+_0x4c43('0x64'));logger[_0x4c43('0x5a')]('body',_0x37776e);db[_0x4c43('0x65')][_0x4c43('0x66')]({'raw':!![],'attributes':['id',_0x4c43('0x67')]})[_0x4c43('0x26')](function(_0x421084){for(var _0x19f525=0x0;_0x19f525<_0x421084['length'];_0x19f525++){if(_0x421084[_0x19f525][_0x4c43('0x67')]in _0x37ac7b){contactItemTypes[_0x4c43('0x1f')](_0x421084[_0x19f525]);delete _0xe9e745[_0x421084[_0x19f525][_0x4c43('0x67')]];hasAdditionalPhones=!![];}for(var _0x4fec8c in _0x37ac7b){if(_0x421084[_0x19f525]['name']+_0x4c43('0x68')===_0x4fec8c){phoneDescriptions[_0x4c43('0x1f')]({'itemTypeId':_0x421084[_0x19f525]['id'],'description':_0x4fec8c});delete _0xe9e745[_0x4fec8c];}}}if(hasAdditionalPhones)_0xe9e745['AdditionalPhones']='';var _0x54ec1b=_['keys'](_0xe9e745)[_0x4c43('0x18')]();logger[_0x4c43('0x5a')]('header',_0x54ec1b);fs['writeFileSync'](_0x2dc326,_0x54ec1b+'\x0a');Papa[_0x4c43('0x69')](fs[_0x4c43('0x6a')](_0xe358b5),{'header':!![],'skipEmptyLines':!![],'step':function(_0x44252b,_0x4821cf){try{for(var _0x1e2c7c=0x0,_0xea7e4=[];_0x1e2c7c<_0x44252b['data'][_0x4c43('0x1b')];_0x1e2c7c++){stats[_0x4c43('0x6b')]+=0x1;if(_0x44252b[_0x4c43('0x5c')][_0x1e2c7c]){handleError(_0x44252b['data'][_0x1e2c7c],_0x44252b[_0x4c43('0x5c')][_0x1e2c7c]);}else{var _0x926a37=[];var _0x4be428=[];var _0x4dfaaf={};for(var _0x2ea10a in _0x37ac7b){let _0x4f5fbd=contactItemTypes[_0x4c43('0x6c')](_0x4e03df=>_0x4e03df[_0x4c43('0x67')]===_0x2ea10a);let _0x15bed6=contactItemTypes[_0x4c43('0x6c')](_0x5ea664=>_0x5ea664[_0x4c43('0x67')]+_0x4c43('0x68')===_0x2ea10a);if(_[_0x4c43('0x1c')](_0x4f5fbd)&&_[_0x4c43('0x1c')](_0x15bed6)){if(_0x37ac7b['hasOwnProperty'](_0x2ea10a)){if(_0x44252b[_0x4c43('0x6d')][_0x1e2c7c][_0x37ac7b[_0x2ea10a]]){var _0x510755=_[_0x4c43('0x6e')](_0x44252b[_0x4c43('0x6d')][_0x1e2c7c][_0x37ac7b[_0x2ea10a]]['replace'](/"/g,'\x27'));switch(_0x2ea10a){case _0x4c43('0x36'):var _0xa6225f=moment(_0x510755,_0x4c43('0x6f'),!![]);if(_0xa6225f[_0x4c43('0x70')]()){_0xea7e4[_0x4c43('0x1f')]('\x22'+_0x510755+'\x22');}else{_0x926a37[_0x4c43('0x1f')](_0x4c43('0x71'));}break;case _0x4c43('0x3b'):var _0x30dffb=parseInt(_0x510755);_0x510755=_[_0x4c43('0x72')](_0x30dffb)||_0x30dffb<0x0||_0x30dffb>0x4?_0x312a3c?0x3:0x2:_0x30dffb;_0xea7e4['push']('\x22'+_0x510755+'\x22');break;case'UserId':var _0x1d3fc9=parseInt(_0x510755);if(_[_0x4c43('0x73')](_0x1d3fc9)&&_[_0x4c43('0x74')](_0x35f4b3,_0x1d3fc9)){_0xea7e4['push']('\x22'+_0x1d3fc9+'\x22');}else{_0x926a37[_0x4c43('0x1f')](_0x4c43('0x75'));}break;case _0x4c43('0x76'):if(isEmail(_0x510755)){_0xea7e4['push']('\x22'+_0x510755+'\x22');}else{_0x926a37[_0x4c43('0x1f')](_0x4c43('0x77'));}break;case _0x4c43('0x78'):var _0x52cd0b=moment(_0x510755,_0x4c43('0x79'),!![]);if(_0x52cd0b['isValid']()){_0xea7e4[_0x4c43('0x1f')]('\x22'+_0x510755+'\x22');}else{_0x926a37[_0x4c43('0x1f')](_0x4c43('0x7a'));}break;default:_0xea7e4[_0x4c43('0x1f')]('\x22'+_0x510755+'\x22');}}else{switch(_0x2ea10a){case'firstName':case _0x4c43('0x1d'):_0x926a37[_0x4c43('0x1f')](_0x2ea10a+_0x4c43('0x7b'));break;default:_0xea7e4[_0x4c43('0x1f')]('\x22\x22');}}}}else{var _0x45da3d='';if(!_[_0x4c43('0x1c')](_0x4f5fbd)){if(!_0x4dfaaf[_0x4c43('0x7c')](_0x4f5fbd['id'])){for(var _0x5c7d66=0x0;_0x5c7d66<_0x37ac7b[_0x2ea10a][_0x4c43('0x1b')];_0x5c7d66++){var _0x510755=_[_0x4c43('0x6e')](_0x44252b['data'][_0x1e2c7c][_0x37ac7b[_0x2ea10a][_0x5c7d66]][_0x4c43('0x7d')](/"/g,'\x27'));var _0x5dbac3=phoneDescriptions[_0x4c43('0x6c')](_0x4a1a55=>_0x4a1a55['itemTypeId']===_0x4f5fbd['id']);if(!_[_0x4c43('0x1c')](_0x5dbac3)){var _0xaf9989=_[_0x4c43('0x6e')](_0x44252b['data'][_0x1e2c7c][_0x37ac7b[_0x5dbac3[_0x4c43('0x7e')]][0x0]][_0x4c43('0x7d')](/"/g,'\x27'));if(!_[_0x4c43('0x1c')](_0xaf9989))_0x510755=_0x510755+'§'+_0xaf9989;}if(_0x45da3d=='')_0x45da3d=_0x510755;else _0x45da3d+='|'+_0x510755;}_0x4be428[_0x4c43('0x1f')](_0x4f5fbd['id']+':'+_0x45da3d);_0x4dfaaf[_0x4f5fbd['id']]=0x1;}}}}if(hasAdditionalPhones){_0xea7e4['push']('\x22'+_0x4be428['join'](';')+'\x22');}if(_0x926a37[_0x4c43('0x1b')]){handleError(_0x44252b['data'][_0x1e2c7c],{'code':_0x4c43('0x7f'),'message':_0x926a37[_0x4c43('0x18')]()});}else{fs[_0x4c43('0x80')](_0x2dc326,_0xea7e4[_0x4c43('0x18')]()+'\x0a');}_0xea7e4=[];}if(!(stats[_0x4c43('0x6b')]%0xc8)){socket[_0x4c43('0x81')]('contact:import:'+_0x53c02b,stats);stats[_0x4c43('0x5c')]=[];}}if(stopped){logger[_0x4c43('0x5a')](_0x4c43('0x82'));_0x4821cf['abort']();}}catch(_0x1727d8){handleError(_0x44252b[_0x4c43('0x6d')][_0x1e2c7c],{'code':_0x4c43('0x83'),'message':_0x1727d8[_0x4c43('0x5b')]});logger[_0x4c43('0x21')]('step',_0x1727d8[_0x4c43('0x5b')]);}},'complete':function(){try{var _0x4005ee=[];var _0x51fba6=tempTableName;_0x4005ee[_0x4c43('0x1f')](_0x4c43('0x84')+_0x51fba6+_0x4c43('0x85'));logger[_0x4c43('0x5a')](_0x4c43('0x86'),contactItemTypes['length']);var _0x354c06=util[_0x4c43('0xf')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x2dc326,_0x51fba6,_0x54ec1b,_0x37776e[_0x4c43('0x38')],_0x37776e[_0x4c43('0x55')]||null,NOW,NOW);if(_['isNil'](_0x37ac7b[_0x4c43('0x36')])){_0x354c06+=_0x4c43('0x87');}_0x4005ee['push'](_0x354c06);BPromise[_0x4c43('0x88')](_0x4005ee,handleQuery)[_0x4c43('0x26')](function(_0x10cab2){BPromise[_0x4c43('0x20')]([handleAdditionalPhones()])[_0x4c43('0x26')](function(){_0x4005ee=[];for(var _0x2c3fe4=0x0;_0x2c3fe4\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','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','limit','offset','query','groupBy','Setting','enableEmailPreview','all','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','t.id\x20IN\x20?','exports','lodash','updateInteraction','./utils','../../mysqldb','role','field','name','from','tools_tags','getInteractionFK','user_has_','select','u.id','u.fullname','ui.','left_join','users','where','\x20IN\x20?'];(function(_0x5df61d,_0x158640){var _0x24cc4c=function(_0x2de006){while(--_0x2de006){_0x5df61d['push'](_0x5df61d['shift']());}};_0x24cc4c(++_0x158640);}(_0x1dae,0x123));var _0xe1da=function(_0x2af47f,_0x4ac577){_0x2af47f=_0x2af47f-0x0;var _0x277a24=_0x1dae[_0x2af47f];return _0x277a24;};'use strict';var _=require(_0xe1da('0x0'));var squel=require('squel');var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require('./update-interaction')[_0xe1da('0x1')];var utils=require(_0xe1da('0x2'));var db=require(_0xe1da('0x3'))['db'];function skipInteractionsQuery(_0x18de78,_0x24bdd0,_0x3437d8){var _0x1a8ad2=![];var _0x44facd=utils['getAccountFK'](_0x18de78);if(_0x24bdd0[_0xe1da('0x4')]==='agent'&&!_0x3437d8['search']&&!_0x3437d8[_0x44facd]){_0x1a8ad2=!![];}return _0x1a8ad2;}function getTagsQuery(){return squel['select']()['field']('id')[_0xe1da('0x5')](_0xe1da('0x6'))[_0xe1da('0x5')]('color')[_0xe1da('0x7')](_0xe1da('0x8'));}function getUsersQuery(_0x1aa771,_0x535e7a){var _0x23e55e=utils[_0xe1da('0x9')](_0x1aa771);var _0x57e121=_0xe1da('0xa')+_0x1aa771+'_interactions';var _0x371bef=squel[_0xe1da('0xb')]()[_0xe1da('0x5')](_0xe1da('0xc'))['field'](_0xe1da('0xd'))['field'](_0xe1da('0xe')+_0x23e55e)[_0xe1da('0x7')](_0x57e121,'ui')[_0xe1da('0xf')](_0xe1da('0x10'),'u','u.id\x20=\x20ui.UserId');if(_0x535e7a['length']>0x0){_0x371bef[_0xe1da('0x11')](_0xe1da('0xe')+_0x23e55e+_0xe1da('0x12'),_[_0xe1da('0x13')](_0x535e7a,'id'));}return _0x371bef;}function getInteractionsQuery(_0x31f15a){var _0x32bc7a=utils[_0xe1da('0x14')](_0x31f15a);var _0x3577af=utils[_0xe1da('0x15')](_0x31f15a);var _0x4f7ab1=utils['getInteractionFK'](_0x31f15a);return squel[_0xe1da('0xb')]()['from'](_0x32bc7a[_0xe1da('0x16')],'i')[_0xe1da('0xf')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xe1da('0xf')](_0xe1da('0x10'),'o',_0xe1da('0x17'))[_0xe1da('0xf')](_0x32bc7a[_0xe1da('0x18')],'a','a.id\x20=\x20i.'+_0x3577af)[_0xe1da('0xf')](_0x32bc7a[_0xe1da('0x19')],'me',_0xe1da('0x1a')+_0x4f7ab1+_0xe1da('0x1b'))[_0xe1da('0xf')](_0x32bc7a[_0xe1da('0x1c')],'it',_0xe1da('0x1d')+_0x4f7ab1+_0xe1da('0x1b'))[_0xe1da('0xf')]('tools_tags','t',_0xe1da('0x1e'));}function getSqlClauses(){var _0x6b968f={'body':squel[_0xe1da('0x1f')](),'contact':squel[_0xe1da('0x1f')](),'default':squel[_0xe1da('0x1f')](),'fields':squel[_0xe1da('0x1f')](),'filter':squel[_0xe1da('0x1f')](),'read':squel[_0xe1da('0x1f')](),'tags':{'clause':squel[_0xe1da('0x1f')](),'ids':null},'user':squel[_0xe1da('0x1f')]()};return _0x6b968f;}function parseTagParameter(_0x4e4319){var _0x8b085=squel[_0xe1da('0x1f')]();if(_0x4e4319){var _0x22c526=utils[_0xe1da('0x20')](_0x4e4319);_0x22c526[_0xe1da('0x21')](function(_0xeb4520){_0x8b085['or'](_0xe1da('0x22'),'%,'+_0xeb4520+',%');});}return _0x8b085;}function parseReadParameter(_0x3f6d8d){var _0x26daba='';if(_0x3f6d8d){_0x26daba=_0xe1da('0x23');if(_0x3f6d8d==='1'){_0x26daba=_0x26daba[_0xe1da('0x24')](_0xe1da('0x25'),'=');}else{_0x26daba=_0x26daba[_0xe1da('0x24')](_0xe1da('0x25'),'>');}}return _0x26daba;}function parseSearchFilter(_0x566a12,_0x3acea6){var _0x56149a=squel[_0xe1da('0x1f')]();if(_0x3acea6){var _0x5c7257=_0x3acea6[_0xe1da('0x24')]('\x5c','\x5c\x5c')[_0xe1da('0x24')](/'/g,'\x27\x27');if(qs[_0xe1da('0x26')](_0x5c7257)){_0x56149a['or']('i.id\x20LIKE\x20?',_0x5c7257+'%');if(['sms',_0xe1da('0x27')][_0xe1da('0x28')](_0x566a12)){_0x56149a['or'](_0xe1da('0x29'),_0x5c7257+'%');}else if(_0x566a12==='fax'){_0x56149a['or']('i.fax\x20LIKE\x20?',_0x5c7257+'%');}else if(_0x566a12===_0xe1da('0x2a')){_0x56149a['or'](_0xe1da('0x2b'),_0x5c7257+'%');}}else if(_0x566a12==='mail'&&qs[_0xe1da('0x2c')](_0x5c7257)){_0x56149a['or']('c.email\x20LIKE\x20?',_0x5c7257+'%');}else{if(_0x566a12===_0xe1da('0x2d')){_0x56149a['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5c7257,!![]))['or'](_0xe1da('0x2e'),qs[_0xe1da('0x2f')](_0x5c7257));}else if(_0x566a12!==_0xe1da('0x30')){_0x56149a['or'](_0xe1da('0x31'),qs['getFullTextValue'](_0x5c7257));}_0x56149a['or'](_0xe1da('0x32'),qs[_0xe1da('0x2f')](_0x5c7257,!![]),null);}}return _0x56149a;}function parseAdvancedSearchFilter(_0x311f1c,_0x59a100){var _0x3dd59f=getSqlClauses();var _0x366ef1=as['parseSearch'](_0x311f1c);var _0x22d7e4=_0x366ef1[_0xe1da('0x33')];for(var _0x1b16f2=0x0;_0x1b16f2<_0x366ef1[_0xe1da('0x34')][_0xe1da('0x35')];_0x1b16f2++){var _0x5c4d1e=_0x366ef1[_0xe1da('0x34')][_0x1b16f2];var _0x608722='i';var _0x1481e0=_[_0xe1da('0x36')](_0x59a100,['name',_0x5c4d1e[_0xe1da('0x5')]]);if(_0x1481e0){var _0x42a294=as[_0xe1da('0x37')](_0x608722,_0x1481e0[_0xe1da('0x38')],_0x5c4d1e);_0x3dd59f[_0xe1da('0x39')][_0x22d7e4](_0x42a294[_0xe1da('0x3a')],_0x42a294[_0xe1da('0x3b')]['start'],_0x42a294[_0xe1da('0x3b')][_0xe1da('0x3c')]);}else{switch(_0x5c4d1e[_0xe1da('0x5')]){case _0xe1da('0x3d'):var _0x3bc39d=parseReadParameter(_0x5c4d1e[_0xe1da('0x3b')]);_0x3dd59f[_0xe1da('0x3e')]['and'](_0x3bc39d);break;case _0xe1da('0x3f'):if(_0x5c4d1e[_0xe1da('0x40')]===_0xe1da('0x41')){if(_0x5c4d1e['value'][_0xe1da('0x42')]('\x20')[_0xe1da('0x35')]>0x1){_0x3dd59f[_0xe1da('0x43')][_0x22d7e4](_0xe1da('0x32'),qs['getFullTextValue'](_0x5c4d1e[_0xe1da('0x3b')],!![]),null);}else{var _0x1c9f58='%'+_0x5c4d1e[_0xe1da('0x3b')]+'%';_0x3dd59f[_0xe1da('0x43')][_0x22d7e4](_0xe1da('0x44'),_0x1c9f58,_0x1c9f58,_0x1c9f58);}}else{_0x1481e0=_[_0xe1da('0x36')](_0x59a100,[_0xe1da('0x6'),_0xe1da('0x45')]);_0x5c4d1e[_0xe1da('0x5')]=_0xe1da('0x45');_0x42a294=as['buildExpression'](_0x608722,_0x1481e0[_0xe1da('0x38')],_0x5c4d1e);_0x3dd59f[_0xe1da('0x43')][_0x22d7e4](_0x42a294[_0xe1da('0x3a')],_0x42a294[_0xe1da('0x3b')][_0xe1da('0x46')],_0x42a294[_0xe1da('0x3b')][_0xe1da('0x3c')]);}break;case'Tag':var _0x309927=_0x5c4d1e[_0xe1da('0x3b')][_0xe1da('0x42')](',')[_0xe1da('0x13')](function(_0x235344){return Number(_0x235344);});var _0x306716=parseTagParameter(_0x309927);_0x3dd59f[_0xe1da('0x47')]['clause'][_0xe1da('0x48')](_0x306716);_0x3dd59f[_0xe1da('0x47')][_0xe1da('0x49')]=_0x309927;break;case _0xe1da('0x4a'):if(_0x5c4d1e[_0xe1da('0x40')]===_0xe1da('0x41')){_0x3dd59f[_0xe1da('0x4b')][_0x22d7e4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x5c4d1e[_0xe1da('0x3b')]+'%',null);}else{_0x1481e0=_[_0xe1da('0x36')](_0x59a100,[_0xe1da('0x6'),_0xe1da('0x4c')]);_0x5c4d1e[_0xe1da('0x5')]=_0xe1da('0x4c');_0x42a294=as[_0xe1da('0x37')](_0x608722,_0x1481e0[_0xe1da('0x38')],_0x5c4d1e);_0x3dd59f['user'][_0x22d7e4](_0x42a294[_0xe1da('0x3a')],_0x42a294['value'][_0xe1da('0x46')],_0x42a294[_0xe1da('0x3b')][_0xe1da('0x3c')]);}break;case'body':case _0xe1da('0x4d'):_0x42a294=as['buildExpression']('me',null,_0x5c4d1e);_0x3dd59f['body'][_0x22d7e4](_0x42a294[_0xe1da('0x3a')],_0x42a294[_0xe1da('0x3b')][_0xe1da('0x46')],_0x42a294['value'][_0xe1da('0x3c')]);break;}}}return _0x3dd59f;}function parseModelFields(_0x2ec805,_0x1662ce,_0x37afd9){var _0x3513a1=utils[_0xe1da('0x15')](_0x2ec805);var _0x42fd49=squel[_0xe1da('0x1f')]();var _0x5c3511=_(_0x1662ce)[_0xe1da('0x4e')]()['map'](function(_0x515ff0){return _[_0xe1da('0x4f')](_0x37afd9,[_0xe1da('0x6'),_0x515ff0])?_0x515ff0:undefined;})[_0xe1da('0x50')]()[_0xe1da('0x3b')]();if(_0x5c3511[_0xe1da('0x35')]>0x0){_0x5c3511[_0xe1da('0x21')](function(_0x433f7f){if(_0x433f7f===_0x3513a1){_0x42fd49['and']('i.'+_0x3513a1+_0xe1da('0x12'),[]['concat'](_0x1662ce[_0x433f7f]));}else if(_0x433f7f===_0xe1da('0x51')){var _0x31b7c7=JSON[_0xe1da('0x52')](_0x1662ce[_0x433f7f])['$gte'];var _0x19a7ab=JSON[_0xe1da('0x52')](_0x1662ce[_0x433f7f])['$lte'];_0x42fd49[_0xe1da('0x48')](_0xe1da('0x53'),_0x31b7c7,_0x19a7ab);}else{if(_0x1662ce[_0x433f7f]===_0xe1da('0x54')){_0x42fd49[_0xe1da('0x48')]('i.'+_0x433f7f+_0xe1da('0x55'));}else{_0x42fd49[_0xe1da('0x48')]('i.'+_0x433f7f+_0xe1da('0x56'),_0x1662ce[_0x433f7f]);}}});}return _0x42fd49;}function parseQueryParameters(_0x4eb1cb,_0x53900b,_0x116cac){var _0x5d0905=getSqlClauses();return Promise['resolve']()[_0xe1da('0x57')](function(){return parseModelFields(_0x4eb1cb,_0x53900b,_0x116cac);})[_0xe1da('0x57')](function(_0x21615c){_0x5d0905['fields'][_0xe1da('0x48')](_0x21615c);return parseReadParameter(_0x53900b[_0xe1da('0x3e')]);})['then'](function(_0x39863d){_0x5d0905[_0xe1da('0x3e')]['and'](_0x39863d);return parseTagParameter(_0x53900b[_0xe1da('0x58')]);})[_0xe1da('0x57')](function(_0x1aa323){_0x5d0905[_0xe1da('0x47')][_0xe1da('0x59')]['and'](_0x1aa323);return parseSearchFilter(_0x4eb1cb,_0x53900b[_0xe1da('0x5a')]);})[_0xe1da('0x57')](function(_0x1854cf){_0x5d0905[_0xe1da('0x5a')]=_0x1854cf;return _0x5d0905;});}function checkAccountsRestrictions(_0x1f0f03,_0x765821,_0x1b34c9){var _0x15c0dc=utils[_0xe1da('0x15')](_0x1f0f03);var _0xc8938c=_0xe1da('0x5b')+_['capitalize'](_0x1f0f03)+(_0x1f0f03===_0xe1da('0x5c')?_0xe1da('0x5d'):_0xe1da('0x5e'));var _0x74dd17=squel[_0xe1da('0x1f')]();return Promise['resolve']()[_0xe1da('0x57')](function(){if(_0x1b34c9[_0xe1da('0x5f')]&&_0x765821[_0xe1da('0x4')]==='agent'){return _0x765821[_0xc8938c]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x4de65f){if(_0x4de65f){if(_0x4de65f[_0xe1da('0x35')]===0x0){_0x74dd17['and']('i.'+_0x15c0dc+_0xe1da('0x55'));}else{_0x74dd17['and']('i.'+_0x15c0dc+_0xe1da('0x12'),_[_0xe1da('0x13')](_0x4de65f,'id'));}}else if(!_0x1b34c9[_0x15c0dc]){_0x74dd17[_0xe1da('0x48')]('i.'+_0x15c0dc+_0xe1da('0x60'));}})[_0xe1da('0x57')](function(){return _0x74dd17;});}function getClosedOrderClause(_0x30ce24,_0x350d77){var _0x5806d9='';var _0x4803a7=[_0xe1da('0x61'),_0xe1da('0x62'),_0xe1da('0x63')];if(_0x30ce24==='mail'){_0x4803a7[_0xe1da('0x64')](_0xe1da('0x65'));}if(_0x350d77[_0xe1da('0x66')]==='0'&&_0x30ce24===_0xe1da('0x2d')){_0x5806d9=_0xe1da('0x65');}else{if(_0x350d77['closed']==='1'){_0x4803a7[_0xe1da('0x67')]();}_0x5806d9=_0xe1da('0x68')+_0x4803a7[_0xe1da('0x69')](',\x20')+')';}return _0x5806d9;}function getFilteredInteractions(_0x37e65c,_0x476647,_0x31523f,_0x1aff4a){var _0x4b099d=utils['getInteractionFK'](_0x37e65c);var _0x352c51=_[_0xe1da('0x6a')](_0x37e65c)+'Interaction';var _0x3e9e89=[];var _0x32e98b=getTagsQuery();var _0x5f17ce={'type':db[_0xe1da('0x6b')][_0xe1da('0x6c')][_0xe1da('0x6d')],'raw':!![]};var _0x16f839=[];var _0x5f32b0=[];return db[_0xe1da('0x6e')]['query'](_0x32e98b[_0xe1da('0x6f')](),_0x5f17ce)[_0xe1da('0x57')](function(_0x308beb){_0x3e9e89=_[_0xe1da('0x70')](_0x308beb,'id');_0x5f17ce=_[_0xe1da('0x71')](_0x5f17ce,{'model':db[_0x352c51],'mapToModel':!![],'nest':!![]});if(_0x31523f[_0xe1da('0x72')]){_0x1aff4a[_0xe1da('0x73')][_0xe1da('0x21')](function(_0x58ab3a){_0x476647[_0xe1da('0x5')]('i.'+_0x58ab3a);});}else{_0x476647[_0xe1da('0x5')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe1da('0x3d'));_0x476647['field']('a.key','Account.key');_0x476647[_0xe1da('0x5')]('a.mandatoryDisposition','Account.mandatoryDisposition');if(_0x37e65c==='mail'){_0x476647['field'](_0xe1da('0x74'),'Account.email');_0x476647[_0xe1da('0x5')]('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',_0xe1da('0x75'));_0x476647[_0xe1da('0x5')](_0xe1da('0x76'));_0x476647[_0xe1da('0x5')](_0xe1da('0x77'));_0x476647[_0xe1da('0x5')]('i.updatedAt');_0x476647[_0xe1da('0x5')](_0xe1da('0x78'));_0x476647[_0xe1da('0x5')](_0xe1da('0x79'));_0x476647[_0xe1da('0x5')](_0xe1da('0x7a'));_0x476647[_0xe1da('0x5')](_0xe1da('0x7b'));_0x476647['field'](_0xe1da('0x7c'));_0x476647[_0xe1da('0x5')]('i.subject');_0x476647[_0xe1da('0x5')](_0xe1da('0x63'));_0x476647[_0xe1da('0x5')](_0xe1da('0x62'));_0x476647['field'](_0xe1da('0x61'));_0x476647['field']('i.substatus');_0x476647['field'](_0xe1da('0x7d'));_0x476647[_0xe1da('0x5')](_0xe1da('0x7e'));_0x476647['field']('i.MailAccountId');_0x476647[_0xe1da('0x5')](_0xe1da('0x7f'));}else if(_0x37e65c==='openchannel'){_0x476647[_0xe1da('0x5')](_0xe1da('0x80'),_0xe1da('0x75'));}else{_0x476647[_0xe1da('0x5')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');}if(_0x37e65c!==_0xe1da('0x2d')){_0x476647['field'](_0xe1da('0x81'));}_0x476647['field'](_0xe1da('0x82'),'Contact.firstName');_0x476647[_0xe1da('0x5')](_0xe1da('0x83'),_0xe1da('0x84'));_0x476647[_0xe1da('0x5')](_0xe1da('0x85'),_0xe1da('0x86'));_0x476647['field'](_0xe1da('0x87'),_0xe1da('0x88'));_0x476647[_0xe1da('0x5')]('c.mobile',_0xe1da('0x89'));_0x476647[_0xe1da('0x5')](_0xe1da('0x8a'),_0xe1da('0x8b'));_0x476647['field'](_0xe1da('0x8c'),_0xe1da('0x8d'));_0x476647[_0xe1da('0x5')]('o.internal','Owner.internal');_0x476647[_0xe1da('0x5')](_0xe1da('0x8e'),'TagIds');}if(_0x1aff4a[_0xe1da('0x8f')]){_0x476647[_0xe1da('0x8f')](_0x1aff4a[_0xe1da('0x8f')]);}if(_0x1aff4a['offset']){_0x476647[_0xe1da('0x90')](_0x1aff4a[_0xe1da('0x90')]);}return db[_0xe1da('0x6e')][_0xe1da('0x91')](_0x476647[_0xe1da('0x6f')](),_0x5f17ce);})['then'](function(_0x2c5574){_0x16f839=_0x2c5574;var _0x492b0f=getUsersQuery(_0x37e65c,_0x16f839);return db[_0xe1da('0x6e')][_0xe1da('0x91')](_0x492b0f[_0xe1da('0x6f')](),_0x5f17ce);})['then'](function(_0x484ee3){_0x5f32b0=_[_0xe1da('0x92')](_0x484ee3,_0x4b099d);if(_0x37e65c===_0xe1da('0x2d')){return db[_0xe1da('0x93')]['findOne']({'attributes':[_0xe1da('0x94')],'raw':!![]});}})['then'](function(_0x4fd50f){var _0x433a6d=_0x4fd50f?_0x4fd50f[_0xe1da('0x94')]:undefined;var _0x443121=_0x16f839[_0xe1da('0x13')](function(_0x5a52f1){return updateInteraction(_0x5a52f1,_0x3e9e89,_0x5f32b0,_0x433a6d);});return Promise[_0xe1da('0x95')](_0x443121);});}function countFilteredInteractions(_0x4c23e5,_0x3b30f0){var _0x45ab06=_0x4c23e5[_0xe1da('0x96')]();_0x45ab06['field']('COUNT(*)');_0x45ab06['field'](_0xe1da('0x97'),_0xe1da('0x3d'));var _0x392f10=utils['getSelectedTags'](_0x3b30f0);if(!_[_0xe1da('0x98')](_0x392f10)){_0x45ab06[_0xe1da('0x11')](_0xe1da('0x99'),_0x392f10);}var _0x568eec={'type':db['Sequelize']['QueryTypes'][_0xe1da('0x6d')],'raw':!![]};return db[_0xe1da('0x6e')][_0xe1da('0x91')](_0x45ab06['toString'](),_0x568eec);}module[_0xe1da('0x9a')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x2e3f=['Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','limit','offset','query','toString','enableEmailPreview','clone','getSelectedTags','t.id\x20IN\x20?','SELECT','exports','lodash','squel','../parsers/advancedSearch','./update-interaction','updateInteraction','./utils','getAccountFK','role','search','select','field','name','color','getInteractionFK','user_has_','_interactions','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','from','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','it.','tools_tags','t.id\x20=\x20it.TagId','expr','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\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','conditions','find','buildExpression','default','text','value','start','unreadMessages','and','Contact','$substring','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','Tag','tags','clause','ids','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','user','end','body','plainBody','keys','compact','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','read','tag','filter','get','capitalize','chat','Websites','Accounts','i.thirdDisposition','i.secondDisposition','i.disposition','i.substatus','closed','CONCAT_WS(\x27\x27,\x20','join','Sequelize','QueryTypes','sequelize','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.email','Account.email','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','i.id','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.MailAccountId','i.UserId','contactName','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x2e3f,0xb6));var _0xf2e3=function(_0x2f8e1e,_0x1a1c14){_0x2f8e1e=_0x2f8e1e-0x0;var _0x400373=_0x2e3f[_0x2f8e1e];return _0x400373;};'use strict';var _=require(_0xf2e3('0x0'));var squel=require(_0xf2e3('0x1'));var as=require(_0xf2e3('0x2'));var qs=require('../parsers/qs');var updateInteraction=require(_0xf2e3('0x3'))[_0xf2e3('0x4')];var utils=require(_0xf2e3('0x5'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x2ef9a9,_0x2fce85,_0x22af9c){var _0x17905a=![];var _0x496660=utils[_0xf2e3('0x6')](_0x2ef9a9);if(_0x2fce85[_0xf2e3('0x7')]==='agent'&&!_0x22af9c[_0xf2e3('0x8')]&&!_0x22af9c[_0x496660]){_0x17905a=!![];}return _0x17905a;}function getTagsQuery(){return squel[_0xf2e3('0x9')]()['field']('id')[_0xf2e3('0xa')](_0xf2e3('0xb'))['field'](_0xf2e3('0xc'))['from']('tools_tags');}function getUsersQuery(_0x3405f4,_0x3c7118){var _0x219fbb=utils[_0xf2e3('0xd')](_0x3405f4);var _0x4487df=_0xf2e3('0xe')+_0x3405f4+_0xf2e3('0xf');var _0x3b0553=squel[_0xf2e3('0x9')]()[_0xf2e3('0xa')]('u.id')['field'](_0xf2e3('0x10'))[_0xf2e3('0xa')](_0xf2e3('0x11')+_0x219fbb)['from'](_0x4487df,'ui')[_0xf2e3('0x12')](_0xf2e3('0x13'),'u',_0xf2e3('0x14'));if(_0x3c7118[_0xf2e3('0x15')]>0x0){_0x3b0553[_0xf2e3('0x16')](_0xf2e3('0x11')+_0x219fbb+_0xf2e3('0x17'),_[_0xf2e3('0x18')](_0x3c7118,'id'));}return _0x3b0553;}function getInteractionsQuery(_0x206d5c){var _0x377bf5=utils[_0xf2e3('0x19')](_0x206d5c);var _0x2142db=utils[_0xf2e3('0x6')](_0x206d5c);var _0x12c8ab=utils[_0xf2e3('0xd')](_0x206d5c);return squel['select']()[_0xf2e3('0x1a')](_0x377bf5[_0xf2e3('0x1b')],'i')[_0xf2e3('0x12')](_0xf2e3('0x1c'),'c',_0xf2e3('0x1d'))['left_join']('users','o','o.id\x20=\x20i.UserId')['left_join'](_0x377bf5['accounts'],'a',_0xf2e3('0x1e')+_0x2142db)['left_join'](_0x377bf5[_0xf2e3('0x1f')],'me',_0xf2e3('0x20')+_0x12c8ab+_0xf2e3('0x21'))[_0xf2e3('0x12')](_0x377bf5['interactionsTags'],'it',_0xf2e3('0x22')+_0x12c8ab+_0xf2e3('0x21'))[_0xf2e3('0x12')](_0xf2e3('0x23'),'t',_0xf2e3('0x24'));}function getSqlClauses(){var _0x44320b={'body':squel[_0xf2e3('0x25')](),'contact':squel['expr'](),'default':squel[_0xf2e3('0x25')](),'fields':squel[_0xf2e3('0x25')](),'filter':squel[_0xf2e3('0x25')](),'read':squel[_0xf2e3('0x25')](),'tags':{'clause':squel[_0xf2e3('0x25')](),'ids':null},'user':squel[_0xf2e3('0x25')]()};return _0x44320b;}function parseTagParameter(_0x4d438a){var _0x1efbce=squel[_0xf2e3('0x25')]();if(_0x4d438a){var _0x4f57ec=utils['getSelectedTags'](_0x4d438a);_0x4f57ec[_0xf2e3('0x26')](function(_0x4a0e7f){_0x1efbce['or'](_0xf2e3('0x27'),'%,'+_0x4a0e7f+',%');});}return _0x1efbce;}function parseReadParameter(_0x47e3fa){var _0x266c92='';if(_0x47e3fa){_0x266c92=_0xf2e3('0x28');if(_0x47e3fa==='1'){_0x266c92=_0x266c92[_0xf2e3('0x29')](_0xf2e3('0x2a'),'=');}else{_0x266c92=_0x266c92['replace'](_0xf2e3('0x2a'),'>');}}return _0x266c92;}function parseSearchFilter(_0x8216a8,_0x541dda){var _0x187fa8=squel[_0xf2e3('0x25')]();if(_0x541dda){var _0x333175=_0x541dda['replace']('\x5c','\x5c\x5c')[_0xf2e3('0x29')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x333175)){_0x187fa8['or'](_0xf2e3('0x2b'),_0x333175+'%');if([_0xf2e3('0x2c'),_0xf2e3('0x2d')][_0xf2e3('0x2e')](_0x8216a8)){_0x187fa8['or'](_0xf2e3('0x2f'),_0x333175+'%');}else if(_0x8216a8===_0xf2e3('0x30')){_0x187fa8['or'](_0xf2e3('0x31'),_0x333175+'%');}else if(_0x8216a8===_0xf2e3('0x32')){_0x187fa8['or'](_0xf2e3('0x33'),_0x333175+'%');}}else if(_0x8216a8===_0xf2e3('0x34')&&qs['isEmail'](_0x333175)){_0x187fa8['or'](_0xf2e3('0x35'),_0x333175+'%');}else{if(_0x8216a8===_0xf2e3('0x34')){_0x187fa8['or'](_0xf2e3('0x36'),qs[_0xf2e3('0x37')](_0x333175,!![]))['or'](_0xf2e3('0x38'),qs[_0xf2e3('0x37')](_0x333175));}else if(_0x8216a8!==_0xf2e3('0x30')){_0x187fa8['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf2e3('0x37')](_0x333175));}_0x187fa8['or'](_0xf2e3('0x39'),qs[_0xf2e3('0x37')](_0x333175,!![]),null);}}return _0x187fa8;}function parseAdvancedSearchFilter(_0x5ea0fd,_0x11dfa8){var _0x51b91b=getSqlClauses();var _0x130c70=as[_0xf2e3('0x3a')](_0x5ea0fd);var _0x1cbd30=_0x130c70['sqlOperator'];for(var _0x4d6376=0x0;_0x4d6376<_0x130c70[_0xf2e3('0x3b')][_0xf2e3('0x15')];_0x4d6376++){var _0x1bf94b=_0x130c70[_0xf2e3('0x3b')][_0x4d6376];var _0x2aef7b='i';var _0x3edb9f=_[_0xf2e3('0x3c')](_0x11dfa8,[_0xf2e3('0xb'),_0x1bf94b[_0xf2e3('0xa')]]);if(_0x3edb9f){var _0x28ecb5=as[_0xf2e3('0x3d')](_0x2aef7b,_0x3edb9f['type'],_0x1bf94b);_0x51b91b[_0xf2e3('0x3e')][_0x1cbd30](_0x28ecb5[_0xf2e3('0x3f')],_0x28ecb5[_0xf2e3('0x40')][_0xf2e3('0x41')],_0x28ecb5['value']['end']);}else{switch(_0x1bf94b[_0xf2e3('0xa')]){case _0xf2e3('0x42'):var _0x4bf450=parseReadParameter(_0x1bf94b['value']);_0x51b91b['read'][_0xf2e3('0x43')](_0x4bf450);break;case _0xf2e3('0x44'):if(_0x1bf94b['operator']===_0xf2e3('0x45')){if(_0x1bf94b[_0xf2e3('0x40')][_0xf2e3('0x46')]('\x20')['length']>0x1){_0x51b91b[_0xf2e3('0x47')][_0x1cbd30](_0xf2e3('0x39'),qs[_0xf2e3('0x37')](_0x1bf94b[_0xf2e3('0x40')],!![]),null);}else{var _0x4a20cf='%'+_0x1bf94b[_0xf2e3('0x40')]+'%';_0x51b91b['contact'][_0x1cbd30](_0xf2e3('0x48'),_0x4a20cf,_0x4a20cf,_0x4a20cf);}}else{_0x3edb9f=_[_0xf2e3('0x3c')](_0x11dfa8,['name','ContactId']);_0x1bf94b[_0xf2e3('0xa')]=_0xf2e3('0x49');_0x28ecb5=as[_0xf2e3('0x3d')](_0x2aef7b,_0x3edb9f[_0xf2e3('0x4a')],_0x1bf94b);_0x51b91b[_0xf2e3('0x47')][_0x1cbd30](_0x28ecb5['text'],_0x28ecb5[_0xf2e3('0x40')]['start'],_0x28ecb5[_0xf2e3('0x40')]['end']);}break;case _0xf2e3('0x4b'):var _0x1d4bba=_0x1bf94b[_0xf2e3('0x40')][_0xf2e3('0x46')](',')[_0xf2e3('0x18')](function(_0x70241c){return Number(_0x70241c);});var _0x471f23=parseTagParameter(_0x1d4bba);_0x51b91b[_0xf2e3('0x4c')][_0xf2e3('0x4d')][_0xf2e3('0x43')](_0x471f23);_0x51b91b[_0xf2e3('0x4c')][_0xf2e3('0x4e')]=_0x1d4bba;break;case _0xf2e3('0x4f'):if(_0x1bf94b['operator']===_0xf2e3('0x45')){_0x51b91b['user'][_0x1cbd30](_0xf2e3('0x50'),'%'+_0x1bf94b[_0xf2e3('0x40')]+'%',null);}else{_0x3edb9f=_['find'](_0x11dfa8,['name',_0xf2e3('0x51')]);_0x1bf94b['field']=_0xf2e3('0x51');_0x28ecb5=as[_0xf2e3('0x3d')](_0x2aef7b,_0x3edb9f[_0xf2e3('0x4a')],_0x1bf94b);_0x51b91b[_0xf2e3('0x52')][_0x1cbd30](_0x28ecb5[_0xf2e3('0x3f')],_0x28ecb5[_0xf2e3('0x40')][_0xf2e3('0x41')],_0x28ecb5[_0xf2e3('0x40')][_0xf2e3('0x53')]);}break;case _0xf2e3('0x54'):case _0xf2e3('0x55'):_0x28ecb5=as[_0xf2e3('0x3d')]('me',null,_0x1bf94b);_0x51b91b[_0xf2e3('0x54')][_0x1cbd30](_0x28ecb5[_0xf2e3('0x3f')],_0x28ecb5[_0xf2e3('0x40')][_0xf2e3('0x41')],_0x28ecb5[_0xf2e3('0x40')][_0xf2e3('0x53')]);break;}}}return _0x51b91b;}function parseModelFields(_0x3b680d,_0x187f8f,_0x2b7719){var _0x100ab8=utils['getAccountFK'](_0x3b680d);var _0x295575=squel[_0xf2e3('0x25')]();var _0x4a58c3=_(_0x187f8f)[_0xf2e3('0x56')]()[_0xf2e3('0x18')](function(_0x151e33){return _['some'](_0x2b7719,['name',_0x151e33])?_0x151e33:undefined;})[_0xf2e3('0x57')]()[_0xf2e3('0x40')]();if(_0x4a58c3[_0xf2e3('0x15')]>0x0){_0x4a58c3[_0xf2e3('0x26')](function(_0x20e8f2){if(_0x20e8f2===_0x100ab8){_0x295575[_0xf2e3('0x43')]('i.'+_0x100ab8+'\x20IN\x20?',[][_0xf2e3('0x58')](_0x187f8f[_0x20e8f2]));}else if(_0x20e8f2===_0xf2e3('0x59')){var _0x20c907=JSON['parse'](_0x187f8f[_0x20e8f2])[_0xf2e3('0x5a')];var _0x22f57a=JSON[_0xf2e3('0x5b')](_0x187f8f[_0x20e8f2])[_0xf2e3('0x5c')];_0x295575[_0xf2e3('0x43')](_0xf2e3('0x5d'),_0x20c907,_0x22f57a);}else{if(_0x187f8f[_0x20e8f2]===_0xf2e3('0x5e')){_0x295575[_0xf2e3('0x43')]('i.'+_0x20e8f2+_0xf2e3('0x5f'));}else{_0x295575[_0xf2e3('0x43')]('i.'+_0x20e8f2+_0xf2e3('0x60'),_0x187f8f[_0x20e8f2]);}}});}return _0x295575;}function parseQueryParameters(_0x3b5bc8,_0x55958e,_0x5e452e){var _0x224586=getSqlClauses();return Promise[_0xf2e3('0x61')]()['then'](function(){return parseModelFields(_0x3b5bc8,_0x55958e,_0x5e452e);})[_0xf2e3('0x62')](function(_0x15b672){_0x224586[_0xf2e3('0x63')][_0xf2e3('0x43')](_0x15b672);return parseReadParameter(_0x55958e[_0xf2e3('0x64')]);})['then'](function(_0x292021){_0x224586[_0xf2e3('0x64')][_0xf2e3('0x43')](_0x292021);return parseTagParameter(_0x55958e[_0xf2e3('0x65')]);})['then'](function(_0x27879e){_0x224586[_0xf2e3('0x4c')][_0xf2e3('0x4d')]['and'](_0x27879e);return parseSearchFilter(_0x3b5bc8,_0x55958e[_0xf2e3('0x66')]);})['then'](function(_0x2dc5d5){_0x224586['filter']=_0x2dc5d5;return _0x224586;});}function checkAccountsRestrictions(_0x10d009,_0x49216d,_0x34be66){var _0x4109b8=utils[_0xf2e3('0x6')](_0x10d009);var _0x2e992d=_0xf2e3('0x67')+_[_0xf2e3('0x68')](_0x10d009)+(_0x10d009===_0xf2e3('0x69')?_0xf2e3('0x6a'):_0xf2e3('0x6b'));var _0x248181=squel[_0xf2e3('0x25')]();return Promise[_0xf2e3('0x61')]()[_0xf2e3('0x62')](function(){if(_0x34be66['search']&&_0x49216d[_0xf2e3('0x7')]==='agent'){return _0x49216d[_0x2e992d]({'attributes':['id'],'raw':!![]});}})[_0xf2e3('0x62')](function(_0x491a89){if(_0x491a89){if(_0x491a89[_0xf2e3('0x15')]===0x0){_0x248181[_0xf2e3('0x43')]('i.'+_0x4109b8+'\x20IS\x20NULL');}else{_0x248181['and']('i.'+_0x4109b8+_0xf2e3('0x17'),_[_0xf2e3('0x18')](_0x491a89,'id'));}}else if(!_0x34be66[_0x4109b8]){_0x248181[_0xf2e3('0x43')]('i.'+_0x4109b8+'\x20IS\x20NOT\x20NULL');}})['then'](function(){return _0x248181;});}function getClosedOrderClause(_0x2b77cc,_0x1ae4a5){var _0x104731='';var _0x6fa708=[_0xf2e3('0x6c'),_0xf2e3('0x6d'),_0xf2e3('0x6e')];if(_0x2b77cc===_0xf2e3('0x34')){_0x6fa708['unshift'](_0xf2e3('0x6f'));}if(_0x1ae4a5[_0xf2e3('0x70')]==='0'&&_0x2b77cc===_0xf2e3('0x34')){_0x104731=_0xf2e3('0x6f');}else{if(_0x1ae4a5[_0xf2e3('0x70')]==='1'){_0x6fa708['shift']();}_0x104731=_0xf2e3('0x71')+_0x6fa708[_0xf2e3('0x72')](',\x20')+')';}return _0x104731;}function getFilteredInteractions(_0x329b07,_0x57aa6b,_0x313e69,_0x4dc4d4){var _0x5213d0=utils[_0xf2e3('0xd')](_0x329b07);var _0x4b7a4c=_[_0xf2e3('0x68')](_0x329b07)+'Interaction';var _0x5471f3=[];var _0x29f184=getTagsQuery();var _0x17916f={'type':db[_0xf2e3('0x73')][_0xf2e3('0x74')]['SELECT'],'raw':!![]};var _0x85acc3=[];var _0x6f173e=[];return db[_0xf2e3('0x75')]['query'](_0x29f184['toString'](),_0x17916f)[_0xf2e3('0x62')](function(_0xcf160d){_0x5471f3=_[_0xf2e3('0x76')](_0xcf160d,'id');_0x17916f=_[_0xf2e3('0x77')](_0x17916f,{'model':db[_0x4b7a4c],'mapToModel':!![],'nest':!![]});if(_0x313e69[_0xf2e3('0x63')]){_0x4dc4d4[_0xf2e3('0x78')]['forEach'](function(_0x2ec873){_0x57aa6b[_0xf2e3('0xa')]('i.'+_0x2ec873);});}else{_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x79'),_0xf2e3('0x42'));_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x7a'),_0xf2e3('0x7b'));_0x57aa6b[_0xf2e3('0xa')]('a.mandatoryDisposition','Account.mandatoryDisposition');if(_0x329b07===_0xf2e3('0x34')){_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x7c'),_0xf2e3('0x7d'));_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x7e'),'contactName');_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x7f'));_0x57aa6b['field']('i.createdAt');_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x80'));_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x81'));_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x82'));_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x83'));_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x84'));_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x85'));_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x86'));_0x57aa6b['field'](_0xf2e3('0x6e'));_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x6d'));_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x6c'));_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x6f'));_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x87'));_0x57aa6b['field'](_0xf2e3('0x88'));_0x57aa6b['field'](_0xf2e3('0x89'));_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x8a'));}else if(_0x329b07===_0xf2e3('0x32')){_0x57aa6b[_0xf2e3('0xa')]('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',_0xf2e3('0x8b'));}else{_0x57aa6b['field'](_0xf2e3('0x8c'),_0xf2e3('0x8b'));}if(_0x329b07!==_0xf2e3('0x34')){_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x8d'));}_0x57aa6b['field']('c.firstName',_0xf2e3('0x8e'));_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x8f'),_0xf2e3('0x90'));_0x57aa6b[_0xf2e3('0xa')]('c.email',_0xf2e3('0x91'));_0x57aa6b[_0xf2e3('0xa')]('c.phone',_0xf2e3('0x92'));_0x57aa6b[_0xf2e3('0xa')]('c.mobile',_0xf2e3('0x93'));_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x94'),_0xf2e3('0x95'));_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x96'),_0xf2e3('0x97'));_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x98'),'Owner.internal');_0x57aa6b[_0xf2e3('0xa')](_0xf2e3('0x99'),'TagIds');}if(_0x4dc4d4[_0xf2e3('0x9a')]){_0x57aa6b[_0xf2e3('0x9a')](_0x4dc4d4['limit']);}if(_0x4dc4d4['offset']){_0x57aa6b[_0xf2e3('0x9b')](_0x4dc4d4[_0xf2e3('0x9b')]);}return db[_0xf2e3('0x75')][_0xf2e3('0x9c')](_0x57aa6b[_0xf2e3('0x9d')](),_0x17916f);})[_0xf2e3('0x62')](function(_0x529a14){_0x85acc3=_0x529a14;var _0x38840f=getUsersQuery(_0x329b07,_0x85acc3);return db['sequelize'][_0xf2e3('0x9c')](_0x38840f['toString'](),_0x17916f);})[_0xf2e3('0x62')](function(_0x5aeb80){_0x6f173e=_['groupBy'](_0x5aeb80,_0x5213d0);if(_0x329b07===_0xf2e3('0x34')){return db['Setting']['findOne']({'attributes':[_0xf2e3('0x9e')],'raw':!![]});}})['then'](function(_0x2a6933){var _0x25689a=_0x2a6933?_0x2a6933['enableEmailPreview']:undefined;var _0x3c4812=_0x85acc3[_0xf2e3('0x18')](function(_0x268b10){return updateInteraction(_0x268b10,_0x5471f3,_0x6f173e,_0x25689a);});return Promise['all'](_0x3c4812);});}function countFilteredInteractions(_0x4c5356,_0x21e63e){var _0x3cd7b0=_0x4c5356[_0xf2e3('0x9f')]();_0x3cd7b0[_0xf2e3('0xa')]('COUNT(*)');_0x3cd7b0['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf2e3('0x42'));var _0x427b91=utils[_0xf2e3('0xa0')](_0x21e63e);if(!_['isEmpty'](_0x427b91)){_0x3cd7b0[_0xf2e3('0x16')](_0xf2e3('0xa1'),_0x427b91);}var _0x50a173={'type':db[_0xf2e3('0x73')][_0xf2e3('0x74')][_0xf2e3('0xa2')],'raw':!![]};return db[_0xf2e3('0x75')][_0xf2e3('0x9c')](_0x3cd7b0['toString'](),_0x50a173);}module[_0xf2e3('0xa3')]={'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 7f143f9..e795465 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 _0x4979=['disposition','UserId','answered','total','MailMessage','out','-id','then','plainBody','lastMsgText','trimStart','catch','updateInteraction','Users','Tags','TagIds','lodash','../../mysqldb','map','fullname','forEach','push','waiting','talking','unmanaged','abandoned'];(function(_0x129678,_0x439acb){var _0x2cd1bb=function(_0x44d053){while(--_0x44d053){_0x129678['push'](_0x129678['shift']());}};_0x2cd1bb(++_0x439acb);}(_0x4979,0x148));var _0x9497=function(_0x3d9866,_0x226ff8){_0x3d9866=_0x3d9866-0x0;var _0x1d6f97=_0x4979[_0x3d9866];return _0x1d6f97;};'use strict';var _=require(_0x9497('0x0'));var db=require(_0x9497('0x1'))['db'];function getInteractionUsers(_0x178741,_0x53c275){return new Promise(function(_0x11864b,_0x539f78){try{var _0x2a96cb=[];if(_0x53c275[_0x178741]){_0x2a96cb=_0x53c275[_0x178741][_0x9497('0x2')](function(_0x459ae1){return{'id':_0x459ae1['id'],'fullname':_0x459ae1[_0x9497('0x3')]};});}return _0x11864b(_0x2a96cb);}catch(_0x261717){_0x539f78(_0x261717);}});}function getInteractionTags(_0x28bf3e,_0x26ee2e){var _0x36a7c5=[];if(_0x28bf3e){_0x28bf3e['split'](',')[_0x9497('0x4')](function(_0x1bf366){_0x36a7c5[_0x9497('0x5')](_0x26ee2e[_0x1bf366]);});}return _0x36a7c5;}function updateWaitingCounter(_0x3d266e){if(_0x3d266e[_0x9497('0x6')]){_0x3d266e['waiting']-=0x1;}}function updateInteractionCounters(_0x366b6d){_0x366b6d['waiting']=0x0;_0x366b6d[_0x9497('0x7')]=0x0;_0x366b6d['answered']=0x0;_0x366b6d[_0x9497('0x8')]=0x0;_0x366b6d[_0x9497('0x9')]=0x0;_0x366b6d['total']=0x0;if(_0x366b6d['closed']){if(_0x366b6d[_0x9497('0xa')]===_0x9497('0x9')){_0x366b6d[_0x9497('0x9')]+=0x1;updateWaitingCounter(_0x366b6d);}if(_0x366b6d[_0x9497('0xb')]){_0x366b6d[_0x9497('0xc')]+=0x1;if(_0x366b6d[_0x9497('0x7')]){_0x366b6d[_0x9497('0x7')]-=0x1;}}else{if(_0x366b6d[_0x9497('0xa')]){_0x366b6d[_0x9497('0x8')]+=0x1;updateWaitingCounter(_0x366b6d);}}}else{if(!_0x366b6d[_0x9497('0xb')]){_0x366b6d['waiting']+=0x1;}if(_0x366b6d[_0x9497('0xb')]){_0x366b6d[_0x9497('0x7')]+=0x1;updateWaitingCounter(_0x366b6d);}}_0x366b6d[_0x9497('0xd')]+=0x1;return _0x366b6d;}function getLastMessageText(_0x4e3adf){return db[_0x9497('0xe')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x4e3adf['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x9497('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x9497('0x10'),'raw':!![]})[_0x9497('0x11')](function(_0x52694c){if(_0x52694c&&_0x52694c[_0x9497('0x12')]){_0x4e3adf[_0x9497('0x13')]=_[_0x9497('0x14')](_0x52694c['plainBody']);}return _0x4e3adf;})[_0x9497('0x15')](function(_0x5dd8a1){throw _0x5dd8a1;});}exports[_0x9497('0x16')]=function(_0x1a02db,_0x328296,_0x5c4f61,_0x3a4484){return new Promise(function(_0x459e90,_0x5ee3af){return getInteractionUsers(_0x1a02db['id'],_0x5c4f61)[_0x9497('0x11')](function(_0x27ec8c){_0x1a02db[_0x9497('0x17')]=_0x27ec8c;return getInteractionTags(_0x1a02db['TagIds'],_0x328296);})[_0x9497('0x11')](function(_0x3ef359){_0x1a02db[_0x9497('0x18')]=_0x3ef359;delete _0x1a02db[_0x9497('0x19')];return updateInteractionCounters(_0x1a02db);})['then'](function(_0x5cafe2){if(_0x3a4484){return getLastMessageText(_0x5cafe2);}else{return _0x5cafe2;}})[_0x9497('0x11')](function(_0x5d0d9e){_0x459e90(_0x5d0d9e);})[_0x9497('0x15')](function(_0x169b7a){_0x5ee3af(_0x169b7a);});});}; \ No newline at end of file +var _0x85c7=['catch','TagIds','Tags','lodash','../../mysqldb','map','fullname','split','push','waiting','answered','unmanaged','abandoned','total','closed','talking','disposition','UserId','MailMessage','findOne','plainBody','-id','then','lastMsgText','trimStart'];(function(_0x3bf74d,_0x5c2a6b){var _0x155b00=function(_0x5f246e){while(--_0x5f246e){_0x3bf74d['push'](_0x3bf74d['shift']());}};_0x155b00(++_0x5c2a6b);}(_0x85c7,0x1c5));var _0x785c=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x85c7[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x785c('0x0'));var db=require(_0x785c('0x1'))['db'];function getInteractionUsers(_0xdd7e6b,_0x4acf8f){return new Promise(function(_0x3d58de,_0x2a9a44){try{var _0x30a0fb=[];if(_0x4acf8f[_0xdd7e6b]){_0x30a0fb=_0x4acf8f[_0xdd7e6b][_0x785c('0x2')](function(_0x3d18fa){return{'id':_0x3d18fa['id'],'fullname':_0x3d18fa[_0x785c('0x3')]};});}return _0x3d58de(_0x30a0fb);}catch(_0x170911){_0x2a9a44(_0x170911);}});}function getInteractionTags(_0x1c17e5,_0x276a28){var _0x132059=[];if(_0x1c17e5){_0x1c17e5[_0x785c('0x4')](',')['forEach'](function(_0x3e95ac){_0x132059[_0x785c('0x5')](_0x276a28[_0x3e95ac]);});}return _0x132059;}function updateWaitingCounter(_0xb395d4){if(_0xb395d4['waiting']){_0xb395d4[_0x785c('0x6')]-=0x1;}}function updateInteractionCounters(_0x16cc5c){_0x16cc5c[_0x785c('0x6')]=0x0;_0x16cc5c['talking']=0x0;_0x16cc5c[_0x785c('0x7')]=0x0;_0x16cc5c[_0x785c('0x8')]=0x0;_0x16cc5c[_0x785c('0x9')]=0x0;_0x16cc5c[_0x785c('0xa')]=0x0;if(_0x16cc5c[_0x785c('0xb')]){if(_0x16cc5c['disposition']===_0x785c('0x9')){_0x16cc5c[_0x785c('0x9')]+=0x1;updateWaitingCounter(_0x16cc5c);}if(_0x16cc5c['UserId']){_0x16cc5c[_0x785c('0x7')]+=0x1;if(_0x16cc5c[_0x785c('0xc')]){_0x16cc5c['talking']-=0x1;}}else{if(_0x16cc5c[_0x785c('0xd')]){_0x16cc5c[_0x785c('0x8')]+=0x1;updateWaitingCounter(_0x16cc5c);}}}else{if(!_0x16cc5c[_0x785c('0xe')]){_0x16cc5c[_0x785c('0x6')]+=0x1;}if(_0x16cc5c[_0x785c('0xe')]){_0x16cc5c[_0x785c('0xc')]+=0x1;updateWaitingCounter(_0x16cc5c);}}_0x16cc5c[_0x785c('0xa')]+=0x1;return _0x16cc5c;}function getLastMessageText(_0x4fa15c){return db[_0x785c('0xf')][_0x785c('0x10')]({'where':{'$and':[{'MailInteractionId':_0x4fa15c['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x785c('0x11')],'order':_0x785c('0x12'),'raw':!![]})[_0x785c('0x13')](function(_0x2df574){if(_0x2df574&&_0x2df574[_0x785c('0x11')]){_0x4fa15c[_0x785c('0x14')]=_[_0x785c('0x15')](_0x2df574['plainBody']);}return _0x4fa15c;})[_0x785c('0x16')](function(_0xbced69){throw _0xbced69;});}exports['updateInteraction']=function(_0x150327,_0x2f834c,_0x7c1777,_0x2aa557){return new Promise(function(_0x216fdd,_0x54b9f7){return getInteractionUsers(_0x150327['id'],_0x7c1777)[_0x785c('0x13')](function(_0x4bc21d){_0x150327['Users']=_0x4bc21d;return getInteractionTags(_0x150327[_0x785c('0x17')],_0x2f834c);})[_0x785c('0x13')](function(_0x3eb8d3){_0x150327[_0x785c('0x18')]=_0x3eb8d3;delete _0x150327['TagIds'];return updateInteractionCounters(_0x150327);})[_0x785c('0x13')](function(_0x118397){if(_0x2aa557){return getLastMessageText(_0x118397);}else{return _0x118397;}})[_0x785c('0x13')](function(_0x55acd4){_0x216fdd(_0x55acd4);})[_0x785c('0x16')](function(_0x3145c6){_0x54b9f7(_0x3145c6);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 20ff43b..d25c9d9 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 _0x858c=['websites','accounts','_interactions','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','update','then','info','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','upperFirst','InteractionId','unknown'];(function(_0x12641c,_0x4d39db){var _0x400a38=function(_0x48ea24){while(--_0x48ea24){_0x12641c['push'](_0x12641c['shift']());}};_0x400a38(++_0x4d39db);}(_0x858c,0x1ef));var _0xc858=function(_0x1bdc83,_0x39453d){_0x1bdc83=_0x1bdc83-0x0;var _0x2201c1=_0x858c[_0x1bdc83];return _0x2201c1;};'use strict';var _=require(_0xc858('0x0'));var db=require(_0xc858('0x1'))['db'];var loggers={'openchannel':require(_0xc858('0x2'))(_0xc858('0x3')),'mail':require('../../config/logger')('mail-interactions'),'fax':require('../../config/logger')(_0xc858('0x4')),'sms':require(_0xc858('0x2'))(_0xc858('0x5')),'chat':require('../../config/logger')(_0xc858('0x6')),'whatsapp':require('../../config/logger')(_0xc858('0x7'))};function getAccountFK(_0x426e6d){return _[_0xc858('0x8')](_0x426e6d)+(_0x426e6d===_0xc858('0x9')?_0xc858('0xa'):_0xc858('0xb'))+'Id';}function getInteractionFK(_0x275960){return _[_0xc858('0x8')](_0x275960)+'InteractionId';}function getInteractionId(_0x36ed9d,_0x160dff,_0x42964f){if(_0x36ed9d&&_0x36ed9d[_[_0xc858('0xc')](_0x42964f)+_0xc858('0xd')]){return _0x36ed9d[_[_0xc858('0xc')](_0x42964f)+_0xc858('0xd')];}else if(_0x36ed9d&&_0x36ed9d['id']){return _0x36ed9d['id'];}else if(_0x160dff&&_0x160dff['id']){return _0x160dff['id'];}else{return _0xc858('0xe');}}function getInteractionsTables(_0x270bda){return{'accounts':_0x270bda+'_'+(_0x270bda===_0xc858('0x9')?_0xc858('0xf'):_0xc858('0x10')),'interactions':_0x270bda+_0xc858('0x11'),'interactionsTags':_0x270bda+'_interaction_has_tags','messages':_0x270bda+_0xc858('0x12'),'userInteractions':_0xc858('0x13')+_0x270bda+_0xc858('0x11')};}function getSelectedTags(_0x3c336e){var _0x42ea54=[];if(_0x3c336e){_0x42ea54=Array[_0xc858('0x14')](_0x3c336e)?_0x3c336e:[_0x3c336e];}return _0x42ea54;}function log(_0x56abf2,_0x646558,_0x9029d8,_0x5d01f5,_0x3a6b68,_0x34083e){loggers[_0x3a6b68[_0xc858('0x15')]()][_0x56abf2](_0xc858('0x16'),_0x34083e[_0xc858('0x17')](),_0x646558?_0x646558['id']:null,_0x646558?_0x646558[_0xc858('0x18')]:null,_0x646558?_0x646558[_0xc858('0x19')]:null,getInteractionId(_0x9029d8,_0x5d01f5,_0x3a6b68),_0x9029d8?JSON[_0xc858('0x1a')](_0x9029d8):_0xc858('0x1b'));}function updateUser(_0x25dbde,_0x4595a7,_0x367e37,_0x38cbdd,_0x2bab76){db[_[_0xc858('0xc')](_0x38cbdd)+_0xc858('0x1c')][_0xc858('0x1d')]({'where':{'id':getInteractionId(_0x4595a7,_0x367e37,_0x38cbdd)}})['then'](function(_0xa4f6cc){if(_0xa4f6cc){return _0xa4f6cc[_0xc858('0x1e')]({'UserId':_0x25dbde?_0x25dbde['id']:null});}})[_0xc858('0x1f')](function(_0x833fef){if(_0x833fef){log(_0xc858('0x20'),_0x25dbde,_0x4595a7,_0x367e37,_0x38cbdd,_0x2bab76);}})['catch'](function(){log('error',_0x25dbde,_0x4595a7,_0x367e37,_0x38cbdd,_0x2bab76);});}module[_0xc858('0x21')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x3fd9=['openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','Website','Account','InteractionId','upperFirst','unknown','chat','websites','accounts','_interactions','_messages','user_has_','isArray','toLowerCase','toUpperCase','role','stringify','Interaction','then','info','error','exports','lodash','../../mysqldb','../../config/logger'];(function(_0x4a6382,_0x358636){var _0x23270a=function(_0x437f2b){while(--_0x437f2b){_0x4a6382['push'](_0x4a6382['shift']());}};_0x23270a(++_0x358636);}(_0x3fd9,0x129));var _0x93fd=function(_0x50cc9b,_0x3a536f){_0x50cc9b=_0x50cc9b-0x0;var _0x1338e6=_0x3fd9[_0x50cc9b];return _0x1338e6;};'use strict';var _=require(_0x93fd('0x0'));var db=require(_0x93fd('0x1'))['db'];var loggers={'openchannel':require(_0x93fd('0x2'))(_0x93fd('0x3')),'mail':require(_0x93fd('0x2'))(_0x93fd('0x4')),'fax':require(_0x93fd('0x2'))('fax-interactions'),'sms':require(_0x93fd('0x2'))(_0x93fd('0x5')),'chat':require(_0x93fd('0x2'))(_0x93fd('0x6')),'whatsapp':require(_0x93fd('0x2'))(_0x93fd('0x7'))};function getAccountFK(_0x92b167){return _[_0x93fd('0x8')](_0x92b167)+(_0x92b167==='chat'?_0x93fd('0x9'):_0x93fd('0xa'))+'Id';}function getInteractionFK(_0x5c3511){return _['capitalize'](_0x5c3511)+_0x93fd('0xb');}function getInteractionId(_0x86c9d8,_0x596c72,_0x23d19c){if(_0x86c9d8&&_0x86c9d8[_[_0x93fd('0xc')](_0x23d19c)+_0x93fd('0xb')]){return _0x86c9d8[_[_0x93fd('0xc')](_0x23d19c)+_0x93fd('0xb')];}else if(_0x86c9d8&&_0x86c9d8['id']){return _0x86c9d8['id'];}else if(_0x596c72&&_0x596c72['id']){return _0x596c72['id'];}else{return _0x93fd('0xd');}}function getInteractionsTables(_0x2c4db1){return{'accounts':_0x2c4db1+'_'+(_0x2c4db1===_0x93fd('0xe')?_0x93fd('0xf'):_0x93fd('0x10')),'interactions':_0x2c4db1+_0x93fd('0x11'),'interactionsTags':_0x2c4db1+'_interaction_has_tags','messages':_0x2c4db1+_0x93fd('0x12'),'userInteractions':_0x93fd('0x13')+_0x2c4db1+_0x93fd('0x11')};}function getSelectedTags(_0x37b5be){var _0x29039c=[];if(_0x37b5be){_0x29039c=Array[_0x93fd('0x14')](_0x37b5be)?_0x37b5be:[_0x37b5be];}return _0x29039c;}function log(_0x21c170,_0x31e8d6,_0x23a084,_0x3f8d96,_0x407ffc,_0x48275c){loggers[_0x407ffc[_0x93fd('0x15')]()][_0x21c170]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x48275c[_0x93fd('0x16')](),_0x31e8d6?_0x31e8d6['id']:null,_0x31e8d6?_0x31e8d6['name']:null,_0x31e8d6?_0x31e8d6[_0x93fd('0x17')]:null,getInteractionId(_0x23a084,_0x3f8d96,_0x407ffc),_0x23a084?JSON[_0x93fd('0x18')](_0x23a084):'null');}function updateUser(_0x220eb7,_0x11bcd6,_0x20acc0,_0x15510c,_0x382d49){db[_['upperFirst'](_0x15510c)+_0x93fd('0x19')]['findOne']({'where':{'id':getInteractionId(_0x11bcd6,_0x20acc0,_0x15510c)}})['then'](function(_0x41452f){if(_0x41452f){return _0x41452f['update']({'UserId':_0x220eb7?_0x220eb7['id']:null});}})[_0x93fd('0x1a')](function(_0x177a8d){if(_0x177a8d){log(_0x93fd('0x1b'),_0x220eb7,_0x11bcd6,_0x20acc0,_0x15510c,_0x382d49);}})['catch'](function(){log(_0x93fd('0x1c'),_0x220eb7,_0x11bcd6,_0x20acc0,_0x15510c,_0x382d49);});}module[_0x93fd('0x1d')]={'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 c4dec7b..6036662 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 _0xd44f=['split','aes-256-ctr','%s:%s:%s','update','base64','utf8','final','hasOwnProperty','use','License','findOne','then','status','format','catch','users','User','admin','../../config/environment','data1','license'];(function(_0x24c57b,_0x2ab0c0){var _0x1d0146=function(_0x420e86){while(--_0x420e86){_0x24c57b['push'](_0x24c57b['shift']());}};_0x1d0146(++_0x2ab0c0);}(_0xd44f,0xa5));var _0xfd44=function(_0x4c2bc5,_0x4984e2){_0x4c2bc5=_0x4c2bc5-0x0;var _0x487209=_0xd44f[_0x4c2bc5];return _0x487209;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0xfd44('0x0'));function getValueFromLicense(_0x2e1578,_0x5e1c49){if(_0x2e1578&&_0x5e1c49){if(_0x5e1c49[_0xfd44('0x1')]&&_0x5e1c49[_0xfd44('0x2')]){var _0x37fd8b=_0x5e1c49[_0xfd44('0x1')];var _0x34c18b=_0x5e1c49[_0xfd44('0x2')];var _0x4059ae=_0x37fd8b[_0xfd44('0x3')]('-')[0x4];var _0x42faae=_0x37fd8b['split']('-')[0x0];var _0x1533ee=crypto['createDecipher'](_0xfd44('0x4'),util['format'](_0xfd44('0x5'),_0x4059ae,_0x37fd8b,_0x42faae));var _0x55304f=_0x1533ee[_0xfd44('0x6')](_0x34c18b,_0xfd44('0x7'),_0xfd44('0x8'));_0x55304f+=_0x1533ee[_0xfd44('0x9')](_0xfd44('0x8'));var _0x538277=JSON['parse'](_0x55304f);return _0x538277[_0xfd44('0xa')](_0x2e1578)?_0x538277[_0x2e1578]:null;}}return null;}function isLimit(_0x33cc3c,_0x11989a,_0x9abff,_0x54c5c2){var _0x298ce1=_0x11989a;return compose()[_0xfd44('0xb')](function(_0x36c158,_0x5a84da,_0x1a5ef8){return db[_0xfd44('0xc')][_0xfd44('0xd')]({'where':{'id':0x1},'raw':!![]})[_0xfd44('0xe')](function(_0x345697){var _0x5b6d01=getValueFromLicense(_0x33cc3c,_0x345697);return _0x5b6d01?_0x5b6d01:_0x298ce1;})[_0xfd44('0xe')](function(_0x429bc9){_0x298ce1=_0x429bc9;return _0x9abff['count'](_0x54c5c2);})[_0xfd44('0xe')](function(_0x455162){if(_0x455162>=_0x298ce1){return _0x5a84da[_0xfd44('0xf')](0x193)['json']({'message':util[_0xfd44('0x10')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x33cc3c)});}_0x1a5ef8();})[_0xfd44('0x11')](function(_0x57e9c6){_0x1a5ef8(_0x57e9c6);});});}function isUserLimit(){return isLimit(_0xfd44('0x12'),0x1,db[_0xfd44('0x13')],{'where':{'$or':[{'role':_0xfd44('0x14')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x4358=['catch','User','admin','user','isUserLimit','crypto','../../mysqldb','../../config/environment','data1','split','createDecipher','aes-256-ctr','format','update','base64','utf8','final','parse','use','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x1274c4,_0x3a22f0){var _0x151346=function(_0x5836a2){while(--_0x5836a2){_0x1274c4['push'](_0x1274c4['shift']());}};_0x151346(++_0x3a22f0);}(_0x4358,0x65));var _0x8435=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0x4358[_0x585d81];return _0x1aca0d;};'use strict';var crypto=require(_0x8435('0x0'));var util=require('util');var compose=require('composable-middleware');var db=require(_0x8435('0x1'))['db'];var config=require(_0x8435('0x2'));function getValueFromLicense(_0x15a229,_0x4f5f24){if(_0x15a229&&_0x4f5f24){if(_0x4f5f24[_0x8435('0x3')]&&_0x4f5f24['license']){var _0x1e27f2=_0x4f5f24['data1'];var _0x364db5=_0x4f5f24['license'];var _0x5f1058=_0x1e27f2[_0x8435('0x4')]('-')[0x4];var _0x5b4eb5=_0x1e27f2['split']('-')[0x0];var _0x18e282=crypto[_0x8435('0x5')](_0x8435('0x6'),util[_0x8435('0x7')]('%s:%s:%s',_0x5f1058,_0x1e27f2,_0x5b4eb5));var _0x5b56ea=_0x18e282[_0x8435('0x8')](_0x364db5,_0x8435('0x9'),_0x8435('0xa'));_0x5b56ea+=_0x18e282[_0x8435('0xb')]('utf8');var _0x2d57c9=JSON[_0x8435('0xc')](_0x5b56ea);return _0x2d57c9['hasOwnProperty'](_0x15a229)?_0x2d57c9[_0x15a229]:null;}}return null;}function isLimit(_0x2cc43c,_0xad7ec6,_0x4e582c,_0x3cb6ba){var _0x324009=_0xad7ec6;return compose()[_0x8435('0xd')](function(_0x17afea,_0x1bd552,_0x130515){return db['License'][_0x8435('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x8435('0xf')](function(_0x1073fb){var _0x3f9a2c=getValueFromLicense(_0x2cc43c,_0x1073fb);return _0x3f9a2c?_0x3f9a2c:_0x324009;})['then'](function(_0x4c32c6){_0x324009=_0x4c32c6;return _0x4e582c['count'](_0x3cb6ba);})['then'](function(_0x3543c1){if(_0x3543c1>=_0x324009){return _0x1bd552[_0x8435('0x10')](0x193)[_0x8435('0x11')]({'message':util[_0x8435('0x7')](_0x8435('0x12'),_0x2cc43c)});}_0x130515();})[_0x8435('0x13')](function(_0x3f409e){_0x130515(_0x3f409e);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x8435('0x14')],{'where':{'$or':[{'role':_0x8435('0x15')},{'role':_0x8435('0x16')}]}});}exports[_0x8435('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index c480a1e..0795a79 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 _0xeb75=['DATE','operator','$eq','$between','value','includes','$gt','$lte','format','YYYY-MM-DD','castTo','text','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','$substring','start','$startsWith','shift','pop','utcOffset','add','hours','minutes','lodash','parseSearch','startsWith','and','replace','[$and]','[$or]','split','slice','forEach','match','indexOf','conditions','push','buildExpression'];(function(_0x427217,_0x4039b1){var _0x5b28fb=function(_0x3eaa08){while(--_0x3eaa08){_0x427217['push'](_0x427217['shift']());}};_0x5b28fb(++_0x4039b1);}(_0xeb75,0xcd));var _0x5eb7=function(_0x1e96d0,_0x3717b9){_0x1e96d0=_0x1e96d0-0x0;var _0x40d501=_0xeb75[_0x1e96d0];return _0x40d501;};'use strict';var _=require(_0x5eb7('0x0'));var moment=require('moment');exports[_0x5eb7('0x1')]=function(_0x2acd45){var _0x3a3fe8={'conditions':[]};_0x3a3fe8['sqlOperator']=_[_0x5eb7('0x2')](_0x2acd45,'[$or]')?'or':_0x5eb7('0x3');var _0x45150b=_0x2acd45[_0x5eb7('0x4')](_0x5eb7('0x5'),'')[_0x5eb7('0x4')](_0x5eb7('0x6'),'')[_0x5eb7('0x7')]('||');for(var _0x58cc2f=0x0;_0x58cc2f<_0x45150b['length'];_0x58cc2f++){var _0x5b1ca9=_0x45150b[_0x58cc2f][_0x5eb7('0x7')](':=');var _0x25d15b=_0x5b1ca9[0x0];var _0x1642a3=_0x5b1ca9[_0x5eb7('0x8')](0x1);_0x1642a3[_0x5eb7('0x9')](function(_0x5291ff){var _0x10e9e0=_0x5291ff[_0x5eb7('0x7')]('[')['shift']();var _0x3b36c9=_0x5291ff[_0x5eb7('0xa')](/\[(.*?)\]/g);_0x3b36c9[_0x5eb7('0x9')](function(_0x38966a){var _0x2694d2=_0x38966a['split']('[')['filter'](function(_0xd878fb){return _0xd878fb[_0x5eb7('0xb')](']')>-0x1;})['map'](function(_0x111ed7){return _0x111ed7['split'](']')[0x0];})[0x0];_0x3a3fe8[_0x5eb7('0xc')][_0x5eb7('0xd')]({'field':_0x25d15b,'operator':_0x10e9e0,'value':_0x2694d2});});});}return _0x3a3fe8;};exports[_0x5eb7('0xe')]=function(_0x324fa7,_0x4c759a,_0x3d37af){var _0x1fb2f3={};if(_0x4c759a===_0x5eb7('0xf')){if(_0x3d37af[_0x5eb7('0x10')]===_0x5eb7('0x11')){_0x3d37af[_0x5eb7('0x10')]=_0x5eb7('0x12');_0x3d37af[_0x5eb7('0x13')]+=','+_0x3d37af[_0x5eb7('0x13')];}else if(_[_0x5eb7('0x14')]([_0x5eb7('0x15'),_0x5eb7('0x16')],_0x3d37af[_0x5eb7('0x10')])){_0x3d37af[_0x5eb7('0x13')]=moment(_0x3d37af[_0x5eb7('0x13')])['add'](0x1,'days')[_0x5eb7('0x17')](_0x5eb7('0x18'));}}if(_0x3d37af[_0x5eb7('0x19')]){_0x4c759a=_0x3d37af[_0x5eb7('0x19')];_0x1fb2f3[_0x5eb7('0x1a')]='CAST('+_0x324fa7+'.'+_0x3d37af[_0x5eb7('0x1b')]+_0x5eb7('0x1c')+_0x3d37af['castTo']+')\x20'+parseOperator(_0x3d37af[_0x5eb7('0x10')]);}else{_0x1fb2f3['text']=_0x324fa7+'.'+_0x3d37af[_0x5eb7('0x1b')]+'\x20'+parseOperator(_0x3d37af['operator']);}if(_[_0x5eb7('0x14')]([_0x5eb7('0x1d'),_0x5eb7('0x1e')],_0x3d37af[_0x5eb7('0x10')]))_0x1fb2f3['text']='('+_0x1fb2f3['text']+_0x5eb7('0x1f')+_0x324fa7+'.'+_0x3d37af[_0x5eb7('0x1b')]+_0x5eb7('0x20');_0x1fb2f3[_0x5eb7('0x13')]=parseValue(_0x4c759a,_0x3d37af['operator'],_0x3d37af[_0x5eb7('0x13')]);return _0x1fb2f3;};function parseOperator(_0x3cb8ed){var _0x5b2f11;switch(_0x3cb8ed){case _0x5eb7('0x21'):_0x5b2f11=_0x5eb7('0x22');break;case _0x5eb7('0x1e'):_0x5b2f11=_0x5eb7('0x23');break;case'$eq':_0x5b2f11=_0x5eb7('0x24');break;case _0x5eb7('0x1d'):_0x5b2f11=_0x5eb7('0x25');break;case'$substring':case'$startsWith':case _0x5eb7('0x26'):_0x5b2f11=_0x5eb7('0x27');break;case _0x5eb7('0x28'):_0x5b2f11=_0x5eb7('0x29');break;case _0x5eb7('0x15'):_0x5b2f11=_0x5eb7('0x2a');break;case _0x5eb7('0x16'):_0x5b2f11=_0x5eb7('0x2b');break;case'$gte':_0x5b2f11=_0x5eb7('0x2c');break;case _0x5eb7('0x12'):_0x5b2f11=_0x5eb7('0x2d');break;}return _0x5b2f11;}function parseValue(_0x3b61fb,_0x5b1d93,_0x1e0409){var _0x490563={'start':undefined,'end':undefined};switch(_0x5b1d93){case _0x5eb7('0x21'):case _0x5eb7('0x1e'):_0x490563['start']=_0x1e0409['split'](',');break;case _0x5eb7('0x2e'):_0x490563[_0x5eb7('0x2f')]='%'+_0x1e0409+'%';break;case _0x5eb7('0x30'):_0x490563['start']=_0x1e0409+'%';break;case _0x5eb7('0x26'):_0x490563['start']='%'+_0x1e0409;break;case _0x5eb7('0x12'):var _0x2c4529=_0x1e0409[_0x5eb7('0x7')](',');var _0x1e0409=_0x2c4529[_0x5eb7('0x31')]();var _0x1d1728=_0x2c4529[_0x5eb7('0x32')]();if(_0x3b61fb==='DATE'){_0x1e0409=moment(_0x1e0409)[_0x5eb7('0x33')](0x0,!![])[_0x5eb7('0x17')]();_0x1d1728=moment(_0x1d1728)[_0x5eb7('0x33')](0x0,!![])[_0x5eb7('0x34')](0x17,_0x5eb7('0x35'))[_0x5eb7('0x34')](0x3b,_0x5eb7('0x36'))[_0x5eb7('0x34')](0x3b,'seconds')[_0x5eb7('0x17')]();}_0x490563={'start':_0x1e0409,'end':_0x1d1728};break;default:_0x490563[_0x5eb7('0x2f')]=_0x1e0409;break;}return _0x490563;} \ No newline at end of file +var _0x3b6b=['lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','[$and]','length','split','slice','forEach','shift','match','indexOf','map','push','buildExpression','operator','$eq','$between','value','includes','add','days','format','castTo','CAST(','field','\x20AS\x20','text','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$lt','<\x20?','$gt','>\x20?','<=\x20?','BETWEEN\x20?\x20AND\x20?','start','$endsWith','pop','DATE','utcOffset','hours','minutes','seconds'];(function(_0x2dccd7,_0x5cf88a){var _0x395894=function(_0x206e2f){while(--_0x206e2f){_0x2dccd7['push'](_0x2dccd7['shift']());}};_0x395894(++_0x5cf88a);}(_0x3b6b,0x1e6));var _0xb3b6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3b6b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb3b6('0x0'));var moment=require(_0xb3b6('0x1'));exports[_0xb3b6('0x2')]=function(_0x756b54){var _0x4b2acf={'conditions':[]};_0x4b2acf[_0xb3b6('0x3')]=_[_0xb3b6('0x4')](_0x756b54,_0xb3b6('0x5'))?'or':'and';var _0x258617=_0x756b54[_0xb3b6('0x6')](_0xb3b6('0x7'),'')[_0xb3b6('0x6')](_0xb3b6('0x5'),'')['split']('||');for(var _0x5cce33=0x0;_0x5cce33<_0x258617[_0xb3b6('0x8')];_0x5cce33++){var _0x5b792e=_0x258617[_0x5cce33][_0xb3b6('0x9')](':=');var _0x258081=_0x5b792e[0x0];var _0x789dec=_0x5b792e[_0xb3b6('0xa')](0x1);_0x789dec[_0xb3b6('0xb')](function(_0x3233e7){var _0x2b8257=_0x3233e7[_0xb3b6('0x9')]('[')[_0xb3b6('0xc')]();var _0x4b9c0b=_0x3233e7[_0xb3b6('0xd')](/\[(.*?)\]/g);_0x4b9c0b[_0xb3b6('0xb')](function(_0x1cf64a){var _0x5f572d=_0x1cf64a[_0xb3b6('0x9')]('[')['filter'](function(_0x545960){return _0x545960[_0xb3b6('0xe')](']')>-0x1;})[_0xb3b6('0xf')](function(_0x5ea601){return _0x5ea601[_0xb3b6('0x9')](']')[0x0];})[0x0];_0x4b2acf['conditions'][_0xb3b6('0x10')]({'field':_0x258081,'operator':_0x2b8257,'value':_0x5f572d});});});}return _0x4b2acf;};exports[_0xb3b6('0x11')]=function(_0x280e7e,_0x1794d5,_0x5e8c11){var _0x326913={};if(_0x1794d5==='DATE'){if(_0x5e8c11[_0xb3b6('0x12')]===_0xb3b6('0x13')){_0x5e8c11['operator']=_0xb3b6('0x14');_0x5e8c11[_0xb3b6('0x15')]+=','+_0x5e8c11[_0xb3b6('0x15')];}else if(_[_0xb3b6('0x16')](['$gt','$lte'],_0x5e8c11['operator'])){_0x5e8c11[_0xb3b6('0x15')]=moment(_0x5e8c11['value'])[_0xb3b6('0x17')](0x1,_0xb3b6('0x18'))[_0xb3b6('0x19')]('YYYY-MM-DD');}}if(_0x5e8c11[_0xb3b6('0x1a')]){_0x1794d5=_0x5e8c11[_0xb3b6('0x1a')];_0x326913['text']=_0xb3b6('0x1b')+_0x280e7e+'.'+_0x5e8c11[_0xb3b6('0x1c')]+_0xb3b6('0x1d')+_0x5e8c11['castTo']+')\x20'+parseOperator(_0x5e8c11[_0xb3b6('0x12')]);}else{_0x326913[_0xb3b6('0x1e')]=_0x280e7e+'.'+_0x5e8c11[_0xb3b6('0x1c')]+'\x20'+parseOperator(_0x5e8c11[_0xb3b6('0x12')]);}if(_['includes']([_0xb3b6('0x1f'),_0xb3b6('0x20')],_0x5e8c11[_0xb3b6('0x12')]))_0x326913[_0xb3b6('0x1e')]='('+_0x326913[_0xb3b6('0x1e')]+'\x20OR\x20'+_0x280e7e+'.'+_0x5e8c11[_0xb3b6('0x1c')]+_0xb3b6('0x21');_0x326913[_0xb3b6('0x15')]=parseValue(_0x1794d5,_0x5e8c11['operator'],_0x5e8c11['value']);return _0x326913;};function parseOperator(_0x2c6cd1){var _0xa69b82;switch(_0x2c6cd1){case _0xb3b6('0x22'):_0xa69b82=_0xb3b6('0x23');break;case'$notIn':_0xa69b82=_0xb3b6('0x24');break;case'$eq':_0xa69b82=_0xb3b6('0x25');break;case'$ne':_0xa69b82=_0xb3b6('0x26');break;case _0xb3b6('0x27'):case'$startsWith':case'$endsWith':_0xa69b82='LIKE\x20?';break;case _0xb3b6('0x28'):_0xa69b82=_0xb3b6('0x29');break;case _0xb3b6('0x2a'):_0xa69b82=_0xb3b6('0x2b');break;case'$lte':_0xa69b82=_0xb3b6('0x2c');break;case'$gte':_0xa69b82='>=\x20?';break;case'$between':_0xa69b82=_0xb3b6('0x2d');break;}return _0xa69b82;}function parseValue(_0x367b1d,_0x274c96,_0x62a972){var _0xc9bce9={'start':undefined,'end':undefined};switch(_0x274c96){case _0xb3b6('0x22'):case'$notIn':_0xc9bce9[_0xb3b6('0x2e')]=_0x62a972['split'](',');break;case _0xb3b6('0x27'):_0xc9bce9[_0xb3b6('0x2e')]='%'+_0x62a972+'%';break;case'$startsWith':_0xc9bce9[_0xb3b6('0x2e')]=_0x62a972+'%';break;case _0xb3b6('0x2f'):_0xc9bce9[_0xb3b6('0x2e')]='%'+_0x62a972;break;case _0xb3b6('0x14'):var _0x12e957=_0x62a972[_0xb3b6('0x9')](',');var _0x62a972=_0x12e957[_0xb3b6('0xc')]();var _0x3ea641=_0x12e957[_0xb3b6('0x30')]();if(_0x367b1d===_0xb3b6('0x31')){_0x62a972=moment(_0x62a972)[_0xb3b6('0x32')](0x0,!![])[_0xb3b6('0x19')]();_0x3ea641=moment(_0x3ea641)[_0xb3b6('0x32')](0x0,!![])['add'](0x17,_0xb3b6('0x33'))[_0xb3b6('0x17')](0x3b,_0xb3b6('0x34'))[_0xb3b6('0x17')](0x3b,_0xb3b6('0x35'))[_0xb3b6('0x19')]();}_0xc9bce9={'start':_0x62a972,'end':_0x3ea641};break;default:_0xc9bce9['start']=_0x62a972;break;}return _0xc9bce9;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index a388e3d..d725be6 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 _0xb4f3=['raw','fields','filters','isEmpty','forOwn','find','type','DATE','$gte','format','YYYY-MM-DD','utc','subtract','uniqueid','isArray','split','offset','sort','map','indexOf','priority','unsigned','substr','DESC','omit','isObject','isString','length','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','\x22{EXPR}\x22','forEach','push','replace','{EXPR}','join','getOptions','query','$id','model','name','attributes','intersection','nolimit','limit','order','where','pick','filter','object','columns','value','merge','lower','col','options','include','includeAll','lodash','moment','../../mysqldb','keys','includes','parse','alias'];(function(_0x9ee221,_0x5ee976){var _0x2de22c=function(_0x15e92a){while(--_0x15e92a){_0x9ee221['push'](_0x9ee221['shift']());}};_0x2de22c(++_0x5ee976);}(_0xb4f3,0x1d5));var _0x3b4f=function(_0x1831cd,_0xaa72f4){_0x1831cd=_0x1831cd-0x0;var _0x1ced4e=_0xb4f3[_0x1831cd];return _0x1ced4e;};'use strict';var _=require(_0x3b4f('0x0'));var sequelize=require('sequelize');var moment=require(_0x3b4f('0x1'));var db=require(_0x3b4f('0x2'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4335d8){var _0x2b6738=['ne'];try{var _0x1d3108=JSON['parse'](_0x4335d8);var _0x584214=Object[_0x3b4f('0x3')](_0x1d3108)[0x0];return _0x2b6738[_0x3b4f('0x4')](_0x584214);}catch(_0x4a0a15){return![];}}function getOperatorValue(_0x2224db){var _0x4dd3d1=JSON['parse'](_0x2224db);var _0x43c2a9=Object[_0x3b4f('0x3')](_0x4dd3d1)[0x0];var _0x3f49de=_0x4dd3d1[_0x43c2a9];return{['$'+_0x43c2a9]:_0x3f49de};}function parseIncludeModel(_0x1552dc){var _0x1a28c7=JSON[_0x3b4f('0x5')](_0x1552dc);return{'model':db[_0x1a28c7['model']],'as':_0x1a28c7[_0x3b4f('0x6')],'attributes':_0x1a28c7['fields'],'raw':_0x1a28c7[_0x3b4f('0x7')]};}exports[_0x3b4f('0x8')]=function(_0x1819fd){var _0x13dcd5=null;if(_0x1819fd){_0x13dcd5=_0x1819fd['split'](',');}return _0x13dcd5;};exports[_0x3b4f('0x9')]=function(_0x1d5a00,_0x1caf8e){var _0x40c51a={};if(!_[_0x3b4f('0xa')](_0x1d5a00)){_[_0x3b4f('0xb')](_0x1d5a00,function(_0x2d3056,_0x1972d6){try{if(_0x1caf8e){var _0x38e07e=_[_0x3b4f('0xc')](_0x1caf8e,{'name':_0x1972d6})||{};if(hasSequelizeOperator(_0x2d3056)){_0x40c51a[_0x1972d6]=getOperatorValue(_0x2d3056);}else if(_0x38e07e[_0x3b4f('0xd')]===_0x3b4f('0xe')&&_['isPlainObject'](_0x2d3056)){var _0x8633b6=JSON[_0x3b4f('0x5')](_0x2d3056);var _0x46a7a5={'$gte':moment(moment(_0x8633b6[_0x3b4f('0xf')])[_0x3b4f('0x10')](_0x3b4f('0x11')))[_0x3b4f('0x12')]()[_0x3b4f('0x10')](),'$lte':moment(moment(_0x8633b6['$lte'])[_0x3b4f('0x10')](_0x3b4f('0x11')))[_0x3b4f('0x12')]()[_0x3b4f('0x13')](0x1,'s')['format']()};_0x40c51a[_0x1972d6]=_0x46a7a5;}else if(_0x38e07e['name']===_0x3b4f('0x14')){_0x40c51a[_0x1972d6]=_0x2d3056;}else{_0x40c51a[_0x1972d6]=_['isArray'](_0x2d3056)?_0x2d3056:JSON[_0x3b4f('0x5')](_0x2d3056);}}else{_0x40c51a[_0x1972d6]=_[_0x3b4f('0x15')](_0x2d3056)?_0x2d3056:JSON['parse'](_0x2d3056);}}catch(_0x1b1dce){_0x40c51a[_0x1972d6]=_0x2d3056[_0x3b4f('0x16')](',');}});}return _0x40c51a;};exports['limit']=function(_0x756668){_0x756668=parseInt(_0x756668,0xa);if(!_0x756668||_0x756668<0x0){_0x756668=LIMIT_VALUE;}return _0x756668;};exports[_0x3b4f('0x17')]=function(_0xcf03c6){_0xcf03c6=parseInt(_0xcf03c6,0xa);if(!_0xcf03c6||_0xcf03c6<0x0){_0xcf03c6=0x0;}return _0xcf03c6;};exports[_0x3b4f('0x18')]=function(_0x19a799){var _0x4f0f00,_0x2ba76d=null;if(_0x19a799){_0x4f0f00=_0x19a799['split'](',');_0x2ba76d=_[_0x3b4f('0x19')](_0x4f0f00,function(_0x51a8dc){if(_0x51a8dc[_0x3b4f('0x1a')]('-')===0x0){return[_0x51a8dc===_0x3b4f('0x1b')?sequelize['cast'](sequelize['col'](_0x3b4f('0x1b')),_0x3b4f('0x1c')):_0x51a8dc[_0x3b4f('0x1d')](0x1),_0x3b4f('0x1e')];}else{return[_0x51a8dc===_0x3b4f('0x1b')?sequelize['cast'](sequelize['col'](_0x3b4f('0x1b')),'unsigned'):_0x51a8dc,'ASC'];}});}return _0x2ba76d;};exports[_0x3b4f('0x1f')]=function(_0x47cba0,_0x11e8dc){if(_[_0x3b4f('0xa')](_0x47cba0)){return _0x47cba0;}if(_['isArray'](_0x47cba0)){for(var _0x5a8bd2=0x0;_0x5a8bd2<_0x47cba0['length'];_0x5a8bd2+=0x1){_0x47cba0[_0x5a8bd2]=this[_0x3b4f('0x1f')](_0x47cba0[_0x5a8bd2],_0x11e8dc);}return _0x47cba0;}if(!_[_0x3b4f('0x20')](_0x47cba0)){return _0x47cba0;}if(_[_0x3b4f('0x21')](_0x11e8dc)){_0x11e8dc=[_0x11e8dc];}if(!_[_0x3b4f('0x15')](_0x11e8dc)){return _0x47cba0;}for(var _0x3e0850=0x0;_0x3e0850<_0x11e8dc[_0x3b4f('0x22')];_0x3e0850+=0x1){_['unset'](_0x47cba0,_0x11e8dc[_0x3e0850]);}for(var _0x4b4c65 in _0x47cba0){if(_0x47cba0[_0x3b4f('0x23')](_0x4b4c65)){_0x47cba0[_0x4b4c65]=this[_0x3b4f('0x1f')](_0x47cba0[_0x4b4c65],_0x11e8dc);}}return _0x47cba0;};exports[_0x3b4f('0x24')]=function(_0x4ef1cc){return _0x4ef1cc[_0x3b4f('0x25')](RegExp(_0x3b4f('0x26')))?!![]:![];};exports[_0x3b4f('0x27')]=function(_0x280226){return _0x280226[_0x3b4f('0x25')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x2585c7,_0x2074a9){var _0x43d13a=[];var _0x473d0e=/[ `!@#$%^&*()_\-?~]/;var _0x44ec4b=_0x2074a9?_0x3b4f('0x28'):'{EXPR}';_0x2585c7[_0x3b4f('0x16')](/[ ,]+/)[_0x3b4f('0x29')](function(_0x2edc63){_0x2edc63=_0x2edc63['replace'](/([^:]")"+/g,'$1');_0x2edc63='+'+_0x2edc63+'*';var _0x2eebea=_0x2edc63[_0x3b4f('0x25')](_0x473d0e);if(_0x2eebea){_0x2edc63='\x22'+_0x2edc63+'\x22';}_0x43d13a[_0x3b4f('0x2a')](_0x2edc63);});_0x44ec4b=_0x44ec4b[_0x3b4f('0x2b')](_0x3b4f('0x2c'),_0x43d13a[_0x3b4f('0x2d')]('\x20'));return _0x44ec4b;};exports[_0x3b4f('0x2e')]=function(_0x5e61c4,_0x5118f8,_0x388c6c){var _0xde8b64={},_0x4730ab={};if(_0x5118f8[_0x3b4f('0x2f')][_0x3b4f('0x30')]){_0x5118f8['query']['id']=_0x5118f8[_0x3b4f('0x2f')][_0x3b4f('0x30')];delete _0x5118f8[_0x3b4f('0x2f')]['$id'];}_0xde8b64[_0x3b4f('0x31')]=_[_0x3b4f('0x19')](_0x5e61c4,_0x3b4f('0x32'));_0xde8b64['query']=_['keys'](_0x5118f8[_0x3b4f('0x2f')]);_0xde8b64[_0x3b4f('0x9')]=_['intersection'](_0xde8b64[_0x3b4f('0x31')],_0xde8b64[_0x3b4f('0x2f')]);_0x4730ab[_0x3b4f('0x33')]=_[_0x3b4f('0x34')](_0xde8b64['model'],this[_0x3b4f('0x8')](_0x5118f8[_0x3b4f('0x2f')][_0x3b4f('0x8')]));_0x4730ab[_0x3b4f('0x33')]=_0x4730ab[_0x3b4f('0x33')][_0x3b4f('0x22')]?_0x4730ab[_0x3b4f('0x33')]:_0xde8b64[_0x3b4f('0x31')];if(!_0x5118f8[_0x3b4f('0x2f')][_0x3b4f('0x23')](_0x3b4f('0x35'))){_0x4730ab[_0x3b4f('0x36')]=this['limit'](_0x5118f8[_0x3b4f('0x2f')]['limit']);_0x4730ab[_0x3b4f('0x17')]=this['offset'](_0x5118f8[_0x3b4f('0x2f')][_0x3b4f('0x17')]);}_0x4730ab[_0x3b4f('0x37')]=this[_0x3b4f('0x18')](_0x5118f8['query'][_0x3b4f('0x18')]);_0x4730ab[_0x3b4f('0x38')]=this[_0x3b4f('0x9')](_[_0x3b4f('0x39')](_0x5118f8['query'],_0xde8b64[_0x3b4f('0x9')]),_0x5e61c4);if(_0x5118f8[_0x3b4f('0x2f')][_0x3b4f('0x3a')]){var _0x5b77c3=_0x5e61c4;var _0x412d5a=_0x5118f8['query']['filter'];if(typeof _0x412d5a===_0x3b4f('0x3b')){_0x5b77c3=_[_0x3b4f('0x3a')](_0x5e61c4,function(_0x55b445){return _['includes'](_0x412d5a[_0x3b4f('0x3c')],_0x55b445[_0x3b4f('0x32')]);});_0x412d5a=_0x412d5a[_0x3b4f('0x3d')];}_0x4730ab[_0x3b4f('0x38')]=_[_0x3b4f('0x3e')](_0x4730ab[_0x3b4f('0x38')],{'$or':_[_0x3b4f('0x19')](_0x5b77c3,function(_0xbd2d5){if(_0xbd2d5[_0x3b4f('0xd')]!=='VIRTUAL'){if(_0x388c6c){return sequelize[_0x3b4f('0x38')](sequelize['fn'](_0x3b4f('0x3f'),sequelize[_0x3b4f('0x40')](_0xbd2d5[_0x3b4f('0x32')])),{'$like':sequelize['fn'](_0x3b4f('0x3f'),'%'+_0x5118f8[_0x3b4f('0x2f')][_0x3b4f('0x3a')]+'%')});}else{var _0x2acf88={};_0x2acf88[_0xbd2d5[_0x3b4f('0x32')]]={'$like':'%'+_0x5118f8[_0x3b4f('0x2f')][_0x3b4f('0x3a')]+'%'};return _0x2acf88;}}})});}_0x4730ab=_[_0x3b4f('0x3e')]({},_0x4730ab,_0x5118f8[_0x3b4f('0x41')]);return _0x4730ab;};exports[_0x3b4f('0x42')]=function(_0xd1dac6){var _0x5f490c=[];if(_0xd1dac6[_0x3b4f('0x43')]){_0x5f490c[_0x3b4f('0x2a')]({'all':!![]});}else if(_0xd1dac6[_0x3b4f('0x42')]){if(Array[_0x3b4f('0x15')](_0xd1dac6[_0x3b4f('0x42')])){_0x5f490c=Object[_0x3b4f('0x3')](_0xd1dac6[_0x3b4f('0x42')])[_0x3b4f('0x19')](function(_0x383f0a){return parseIncludeModel(_0xd1dac6[_0x3b4f('0x42')][_0x383f0a]);});}else{var _0x14aebd=parseIncludeModel(_0xd1dac6[_0x3b4f('0x42')]);_0x5f490c[_0x3b4f('0x2a')](_0x14aebd);}}return _0x5f490c;}; \ No newline at end of file +var _0xaaae=['$id','intersection','model','attributes','offset','sort','where','pick','filter','object','columns','name','value','VIRTUAL','lower','merge','options','includeAll','include','sequelize','../../mysqldb','parse','keys','fields','raw','filters','isEmpty','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','subtract','isArray','limit','map','indexOf','priority','cast','col','unsigned','substr','omit','length','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','{EXPR}','split','forEach','replace','push','join','getOptions','query'];(function(_0x7a319d,_0x235959){var _0x5c6b4e=function(_0x2e5b17){while(--_0x2e5b17){_0x7a319d['push'](_0x7a319d['shift']());}};_0x5c6b4e(++_0x235959);}(_0xaaae,0x10b));var _0xeaaa=function(_0x4e76f8,_0x3f2cdd){_0x4e76f8=_0x4e76f8-0x0;var _0x3cdb06=_0xaaae[_0x4e76f8];return _0x3cdb06;};'use strict';var _=require('lodash');var sequelize=require(_0xeaaa('0x0'));var moment=require('moment');var db=require(_0xeaaa('0x1'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x34f63c){var _0x2a9165=['ne'];try{var _0x395176=JSON[_0xeaaa('0x2')](_0x34f63c);var _0x464378=Object['keys'](_0x395176)[0x0];return _0x2a9165['includes'](_0x464378);}catch(_0x2cefb7){return![];}}function getOperatorValue(_0x1e6e38){var _0x2660e0=JSON[_0xeaaa('0x2')](_0x1e6e38);var _0x1de6a5=Object[_0xeaaa('0x3')](_0x2660e0)[0x0];var _0x5eb9a8=_0x2660e0[_0x1de6a5];return{['$'+_0x1de6a5]:_0x5eb9a8};}function parseIncludeModel(_0x167507){var _0x2f248e=JSON['parse'](_0x167507);return{'model':db[_0x2f248e['model']],'as':_0x2f248e['alias'],'attributes':_0x2f248e[_0xeaaa('0x4')],'raw':_0x2f248e[_0xeaaa('0x5')]};}exports[_0xeaaa('0x4')]=function(_0x3cc2f3){var _0xd990de=null;if(_0x3cc2f3){_0xd990de=_0x3cc2f3['split'](',');}return _0xd990de;};exports[_0xeaaa('0x6')]=function(_0x428a0c,_0x49d210){var _0x3714a4={};if(!_[_0xeaaa('0x7')](_0x428a0c)){_['forOwn'](_0x428a0c,function(_0x9b977e,_0x3befd1){try{if(_0x49d210){var _0x57d15f=_[_0xeaaa('0x8')](_0x49d210,{'name':_0x3befd1})||{};if(hasSequelizeOperator(_0x9b977e)){_0x3714a4[_0x3befd1]=getOperatorValue(_0x9b977e);}else if(_0x57d15f[_0xeaaa('0x9')]===_0xeaaa('0xa')&&_[_0xeaaa('0xb')](_0x9b977e)){var _0x12486f=JSON[_0xeaaa('0x2')](_0x9b977e);var _0x630cb2={'$gte':moment(moment(_0x12486f[_0xeaaa('0xc')])[_0xeaaa('0xd')](_0xeaaa('0xe')))['utc']()[_0xeaaa('0xd')](),'$lte':moment(moment(_0x12486f['$lte'])[_0xeaaa('0xd')](_0xeaaa('0xe')))['utc']()[_0xeaaa('0xf')](0x1,'s')[_0xeaaa('0xd')]()};_0x3714a4[_0x3befd1]=_0x630cb2;}else if(_0x57d15f['name']==='uniqueid'){_0x3714a4[_0x3befd1]=_0x9b977e;}else{_0x3714a4[_0x3befd1]=_['isArray'](_0x9b977e)?_0x9b977e:JSON[_0xeaaa('0x2')](_0x9b977e);}}else{_0x3714a4[_0x3befd1]=_[_0xeaaa('0x10')](_0x9b977e)?_0x9b977e:JSON[_0xeaaa('0x2')](_0x9b977e);}}catch(_0x5aa708){_0x3714a4[_0x3befd1]=_0x9b977e['split'](',');}});}return _0x3714a4;};exports[_0xeaaa('0x11')]=function(_0x166698){_0x166698=parseInt(_0x166698,0xa);if(!_0x166698||_0x166698<0x0){_0x166698=LIMIT_VALUE;}return _0x166698;};exports['offset']=function(_0x2237d4){_0x2237d4=parseInt(_0x2237d4,0xa);if(!_0x2237d4||_0x2237d4<0x0){_0x2237d4=0x0;}return _0x2237d4;};exports['sort']=function(_0x2257c2){var _0x49b7f7,_0x3a6289=null;if(_0x2257c2){_0x49b7f7=_0x2257c2['split'](',');_0x3a6289=_[_0xeaaa('0x12')](_0x49b7f7,function(_0x16b920){if(_0x16b920[_0xeaaa('0x13')]('-')===0x0){return[_0x16b920===_0xeaaa('0x14')?sequelize[_0xeaaa('0x15')](sequelize[_0xeaaa('0x16')](_0xeaaa('0x14')),_0xeaaa('0x17')):_0x16b920[_0xeaaa('0x18')](0x1),'DESC'];}else{return[_0x16b920===_0xeaaa('0x14')?sequelize['cast'](sequelize['col'](_0xeaaa('0x14')),_0xeaaa('0x17')):_0x16b920,'ASC'];}});}return _0x3a6289;};exports[_0xeaaa('0x19')]=function(_0x535b8e,_0x3a511a){if(_[_0xeaaa('0x7')](_0x535b8e)){return _0x535b8e;}if(_[_0xeaaa('0x10')](_0x535b8e)){for(var _0xcaa47c=0x0;_0xcaa47c<_0x535b8e[_0xeaaa('0x1a')];_0xcaa47c+=0x1){_0x535b8e[_0xcaa47c]=this[_0xeaaa('0x19')](_0x535b8e[_0xcaa47c],_0x3a511a);}return _0x535b8e;}if(!_['isObject'](_0x535b8e)){return _0x535b8e;}if(_[_0xeaaa('0x1b')](_0x3a511a)){_0x3a511a=[_0x3a511a];}if(!_[_0xeaaa('0x10')](_0x3a511a)){return _0x535b8e;}for(var _0x41c036=0x0;_0x41c036<_0x3a511a['length'];_0x41c036+=0x1){_[_0xeaaa('0x1c')](_0x535b8e,_0x3a511a[_0x41c036]);}for(var _0x24cc55 in _0x535b8e){if(_0x535b8e[_0xeaaa('0x1d')](_0x24cc55)){_0x535b8e[_0x24cc55]=this[_0xeaaa('0x19')](_0x535b8e[_0x24cc55],_0x3a511a);}}return _0x535b8e;};exports[_0xeaaa('0x1e')]=function(_0x3ebdb9){return _0x3ebdb9[_0xeaaa('0x1f')](RegExp(_0xeaaa('0x20')))?!![]:![];};exports[_0xeaaa('0x21')]=function(_0x125058){return _0x125058[_0xeaaa('0x1f')](/^\S+@\S+$/)?!![]:![];};exports[_0xeaaa('0x22')]=function(_0x7bcb4e,_0x1e36f2){var _0x421f65=[];var _0x2894ae=/[ `!@#$%^&*()_\-?~]/;var _0x386583=_0x1e36f2?'\x22{EXPR}\x22':_0xeaaa('0x23');_0x7bcb4e[_0xeaaa('0x24')](/[ ,]+/)[_0xeaaa('0x25')](function(_0x43ff07){_0x43ff07=_0x43ff07[_0xeaaa('0x26')](/([^:]")"+/g,'$1');_0x43ff07='+'+_0x43ff07+'*';var _0xe26ece=_0x43ff07[_0xeaaa('0x1f')](_0x2894ae);if(_0xe26ece){_0x43ff07='\x22'+_0x43ff07+'\x22';}_0x421f65[_0xeaaa('0x27')](_0x43ff07);});_0x386583=_0x386583['replace'](_0xeaaa('0x23'),_0x421f65[_0xeaaa('0x28')]('\x20'));return _0x386583;};exports[_0xeaaa('0x29')]=function(_0x354cfb,_0x5ad473,_0x39ef1a){var _0x309122={},_0x1b16a8={};if(_0x5ad473[_0xeaaa('0x2a')][_0xeaaa('0x2b')]){_0x5ad473[_0xeaaa('0x2a')]['id']=_0x5ad473[_0xeaaa('0x2a')][_0xeaaa('0x2b')];delete _0x5ad473[_0xeaaa('0x2a')]['$id'];}_0x309122['model']=_['map'](_0x354cfb,'name');_0x309122['query']=_[_0xeaaa('0x3')](_0x5ad473['query']);_0x309122[_0xeaaa('0x6')]=_[_0xeaaa('0x2c')](_0x309122[_0xeaaa('0x2d')],_0x309122[_0xeaaa('0x2a')]);_0x1b16a8[_0xeaaa('0x2e')]=_[_0xeaaa('0x2c')](_0x309122['model'],this[_0xeaaa('0x4')](_0x5ad473[_0xeaaa('0x2a')][_0xeaaa('0x4')]));_0x1b16a8[_0xeaaa('0x2e')]=_0x1b16a8[_0xeaaa('0x2e')][_0xeaaa('0x1a')]?_0x1b16a8[_0xeaaa('0x2e')]:_0x309122[_0xeaaa('0x2d')];if(!_0x5ad473[_0xeaaa('0x2a')][_0xeaaa('0x1d')]('nolimit')){_0x1b16a8['limit']=this[_0xeaaa('0x11')](_0x5ad473[_0xeaaa('0x2a')][_0xeaaa('0x11')]);_0x1b16a8[_0xeaaa('0x2f')]=this['offset'](_0x5ad473[_0xeaaa('0x2a')][_0xeaaa('0x2f')]);}_0x1b16a8['order']=this[_0xeaaa('0x30')](_0x5ad473[_0xeaaa('0x2a')][_0xeaaa('0x30')]);_0x1b16a8[_0xeaaa('0x31')]=this['filters'](_[_0xeaaa('0x32')](_0x5ad473['query'],_0x309122[_0xeaaa('0x6')]),_0x354cfb);if(_0x5ad473[_0xeaaa('0x2a')][_0xeaaa('0x33')]){var _0x493a87=_0x354cfb;var _0x5ef4bc=_0x5ad473[_0xeaaa('0x2a')][_0xeaaa('0x33')];if(typeof _0x5ef4bc===_0xeaaa('0x34')){_0x493a87=_[_0xeaaa('0x33')](_0x354cfb,function(_0xbb6edb){return _['includes'](_0x5ef4bc[_0xeaaa('0x35')],_0xbb6edb[_0xeaaa('0x36')]);});_0x5ef4bc=_0x5ef4bc[_0xeaaa('0x37')];}_0x1b16a8[_0xeaaa('0x31')]=_['merge'](_0x1b16a8['where'],{'$or':_[_0xeaaa('0x12')](_0x493a87,function(_0x42f865){if(_0x42f865[_0xeaaa('0x9')]!==_0xeaaa('0x38')){if(_0x39ef1a){return sequelize[_0xeaaa('0x31')](sequelize['fn']('lower',sequelize[_0xeaaa('0x16')](_0x42f865[_0xeaaa('0x36')])),{'$like':sequelize['fn'](_0xeaaa('0x39'),'%'+_0x5ad473[_0xeaaa('0x2a')][_0xeaaa('0x33')]+'%')});}else{var _0x1bbdd7={};_0x1bbdd7[_0x42f865['name']]={'$like':'%'+_0x5ad473[_0xeaaa('0x2a')][_0xeaaa('0x33')]+'%'};return _0x1bbdd7;}}})});}_0x1b16a8=_[_0xeaaa('0x3a')]({},_0x1b16a8,_0x5ad473[_0xeaaa('0x3b')]);return _0x1b16a8;};exports['include']=function(_0x2f6108){var _0x66f600=[];if(_0x2f6108[_0xeaaa('0x3c')]){_0x66f600[_0xeaaa('0x27')]({'all':!![]});}else if(_0x2f6108[_0xeaaa('0x3d')]){if(Array[_0xeaaa('0x10')](_0x2f6108[_0xeaaa('0x3d')])){_0x66f600=Object[_0xeaaa('0x3')](_0x2f6108[_0xeaaa('0x3d')])[_0xeaaa('0x12')](function(_0x4d62f8){return parseIncludeModel(_0x2f6108[_0xeaaa('0x3d')][_0x4d62f8]);});}else{var _0x4797f9=parseIncludeModel(_0x2f6108[_0xeaaa('0x3d')]);_0x66f600[_0xeaaa('0x27')](_0x4797f9);}}return _0x66f600;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index b60c414..a70f88e 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 _0x4819=['queue','destconnectedlinenum','omit','pick','filterAgentAttributes','role','whatsappStatusTime','chatCapacity','mailCurrentCapacity','phoneBarEnableAutomaticScreenRecording','onhold','routealias','getRealtimeAgentsQueryFields','jayson/promise','../../mysqldb','client','http','chatPause','mailPause','voicePause','whatsappPause','every','filter','length','unknown','unavailable','ringing','isNil','voiceStatus','idle','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','Agents','then','error','result','request','merge','catch','getRealtimeAgents','pause','*pause','busy','isArray','startCase','Queue','findOne','getAgents','all','flatten','map','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','User','findAll','name','fullname','openchannelPause','smsPause','pauseType','globalStatus','split','fields','startsWith','ASC','fullname,internal','internal','indexOf','validateSortParameter','DESC','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','faxPause','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','voiceStatusTime'];(function(_0x33f283,_0x5a498e){var _0x4dd16a=function(_0x2c741e){while(--_0x2c741e){_0x33f283['push'](_0x33f283['shift']());}};_0x4dd16a(++_0x5a498e);}(_0x4819,0xcd));var _0x9481=function(_0x3855fd,_0x26003f){_0x3855fd=_0x3855fd-0x0;var _0x226a53=_0x4819[_0x3855fd];return _0x226a53;};'use strict';var _=require('lodash');var jayson=require(_0x9481('0x0'));var db=require(_0x9481('0x1'))['db'];var amiClient=jayson[_0x9481('0x2')][_0x9481('0x3')]({'port':0x232a});var routingClient=jayson[_0x9481('0x2')][_0x9481('0x3')]({'port':0x232c});function isAgentPaused(_0x40a703,_0x14dc10){var _0xc39edf=[_0x40a703[_0x9481('0x4')],_0x40a703['faxPause'],_0x40a703[_0x9481('0x5')],_0x40a703['openchannelPause'],_0x40a703['smsPause'],_0x40a703[_0x9481('0x6')],_0x40a703[_0x9481('0x7')]];if(!_0x14dc10)return _[_0x9481('0x8')](_0xc39edf);var _0x3278ff=_[_0x9481('0x9')](_0xc39edf);return _0x3278ff['length']>0x0&&_0x3278ff[_0x9481('0xa')]<_0xc39edf['length']?!![]:![];}function isIdle(_0x2fabf1){return _0x2fabf1==='idle'||_0x2fabf1===_0x9481('0xb')||_0x2fabf1===_0x9481('0xc')||_0x2fabf1===_0x9481('0xd')||_[_0x9481('0xe')](_0x2fabf1);}function isAgentIdle(_0xe84f77){if(_0xe84f77[_0x9481('0xf')]!==_0x9481('0x10')&&_0xe84f77[_0x9481('0x6')]){_0xe84f77[_0x9481('0xf')]='pause';return![];}return _['every']([_0xe84f77[_0x9481('0x11')],_0xe84f77[_0x9481('0x12')],_0xe84f77[_0x9481('0x13')],_0xe84f77[_0x9481('0x14')],_0xe84f77[_0x9481('0x15')],_0xe84f77[_0x9481('0xf')],_0xe84f77[_0x9481('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x9481('0x17'),{})[_0x9481('0x18')](function(_0x5b1fe6){if(_0x5b1fe6[_0x9481('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x34108d=_0x5b1fe6[_0x9481('0x1a')];return routingClient[_0x9481('0x1b')](_0x9481('0x17'),{})['then'](function(_0x5eda66){if(_0x5eda66[_0x9481('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x4d0da7=_0x5eda66[_0x9481('0x1a')];return _[_0x9481('0x1c')]({},_0x34108d,_0x4d0da7);});})[_0x9481('0x1d')](function(_0x41051d){throw _0x41051d;});}exports[_0x9481('0x1e')]=getRealtimeAgents;function getAgentStatus(_0x3dc33f){var _0x55a1bd=_0x9481('0xb');if(isAgentPaused(_0x3dc33f))_0x55a1bd=_0x9481('0x1f');else if(isAgentPaused(_0x3dc33f,!![]))_0x55a1bd=_0x9481('0x20');else if(isAgentIdle(_0x3dc33f))_0x55a1bd=_0x9481('0x10');else _0x55a1bd=_0x9481('0x21');return _0x55a1bd;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x215dd7,_0x294908){var _0x572599=_[_0x9481('0x22')](_0x215dd7)?_0x215dd7:[_0x215dd7];var _0xd1cd1a=_[_0x9481('0x23')](_0x294908)+_0x9481('0x24');var _0x2dc02e=_['map'](_0x572599,function(_0x91e3d9){return db[_0xd1cd1a][_0x9481('0x25')]({'where':{'id':_0x91e3d9}})['then'](function(_0x5eb4f5){if(!_0x5eb4f5)return[];return _0x5eb4f5[_0x9481('0x26')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x9481('0x27')](_0x2dc02e)['then'](function(_0x1e6f28){var _0x20ff9a=_(_0x1e6f28)[_0x9481('0x28')]()[_0x9481('0x29')]('id')['uniq']()[_0x9481('0x2a')]();return _0x20ff9a;});}exports[_0x9481('0x2b')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3c2585,_0x587706,_0x1791b2){try{if(_0x587706['length']>0x0){_0x3c2585=_0x3c2585[_0x9481('0x9')](function(_0xe153ab){return _0x587706[_0x9481('0x2c')](_0xe153ab['id']);});}var _0x13ef93=_0x3c2585[_0x9481('0x9')](function(_0x53560d){var _0x2aa9ff=_0x9481('0x21');if(isAgentIdle(_0x53560d)){_0x2aa9ff=_0x9481('0x10');}return _0x2aa9ff===_0x1791b2;});return _['map'](_0x13ef93,'id');}catch(_0x56752e){throw _0x56752e;}}exports[_0x9481('0x2d')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x427c25,_0x42df68,_0x2b33f8){return Promise['resolve']()['then'](function(){if(_0x42df68['length']>0x0){_0x427c25=_0x427c25[_0x9481('0x9')](function(_0x5d6c65){return _0x42df68[_0x9481('0x2c')](_0x5d6c65['id']);});}return _0x427c25;})['then'](function(){return db[_0x9481('0x2e')][_0x9481('0x2f')]({'attributes':['id',_0x9481('0x30'),_0x9481('0x31'),_0x9481('0x4'),'faxPause',_0x9481('0x5'),_0x9481('0x32'),_0x9481('0x33'),'voicePause',_0x9481('0x7'),_0x9481('0x34')],'where':{'id':{'$in':_[_0x9481('0x29')](_0x427c25,'id')}},'raw':!![]});})[_0x9481('0x18')](function(_0xdc87e6){return _0xdc87e6[_0x9481('0x29')](function(_0x5d7299){var _0x41c6a2=_['find'](_0x427c25,['id',_0x5d7299['id']]);var _0x203ef9=filterAgentAttributes(_0x41c6a2);_[_0x9481('0x1c')](_0x5d7299,_0x203ef9);_0x5d7299[_0x9481('0x35')]=getAgentStatus(_0x5d7299);return _0x5d7299;});})[_0x9481('0x18')](function(_0x2ebcbd){var _0x2face9=sortAgentsByStatus(_0x2ebcbd,_0x2b33f8);return _['map'](_0x2face9,'id');})[_0x9481('0x1d')](function(_0x15e27f){throw _0x15e27f;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x5e00ad){var _0x31ea6a={'fields':[],'order':null};var _0x5ab28f=_0x5e00ad[_0x9481('0x36')](',');_0x31ea6a[_0x9481('0x37')]=_[_0x9481('0x9')](_0x5ab28f,function(_0x2a1bcf){if(!_0x2a1bcf['includes'](_0x9481('0x35'))){return!![];}_0x31ea6a['order']=_[_0x9481('0x38')](_0x2a1bcf,'-')?'DESC':_0x9481('0x39');return![];});return _0x31ea6a;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x315fb9){if(!_0x315fb9){_0x315fb9=_0x9481('0x3a');}if(_0x315fb9[_0x9481('0x2c')](_0x9481('0x31'))&&!_0x315fb9[_0x9481('0x2c')](_0x9481('0x3b'))){var _0xb6ff1=_0x315fb9['substring'](0x0,_0x315fb9[_0x9481('0x3c')](_0x9481('0x31')));_0x315fb9+=','+_0xb6ff1+_0x9481('0x3b');}return _0x315fb9;}exports[_0x9481('0x3d')]=validateSortParameter;function sortAgentsByStatus(_0x3f1b6f,_0x344e2d){var _0x2e4241=_0x3f1b6f['sort'](function(_0xf7b2e1,_0x1872ff){if(_0xf7b2e1['globalStatus']===_0x1872ff[_0x9481('0x35')]){if(_0xf7b2e1[_0x9481('0x35')]===_0x9481('0x1f')){if(_0x344e2d===_0x9481('0x3e')){return(_0xf7b2e1[_0x9481('0x34')]||'')<(_0x1872ff['pauseType']||'')||_0xf7b2e1[_0x9481('0x31')]['toLowerCase']()>_0x1872ff[_0x9481('0x31')][_0x9481('0x3f')]()?0x1:-0x1;}else{return(_0xf7b2e1['pauseType']||'')<(_0x1872ff['pauseType']||'')||_0xf7b2e1[_0x9481('0x31')][_0x9481('0x3f')]()>_0x1872ff[_0x9481('0x31')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x344e2d===_0x9481('0x3e')){return _0xf7b2e1[_0x9481('0x31')]['toLowerCase']()<_0x1872ff['fullname'][_0x9481('0x3f')]()?0x1:-0x1;}else{return _0xf7b2e1['fullname'][_0x9481('0x3f')]()<_0x1872ff[_0x9481('0x31')][_0x9481('0x3f')]()?-0x1:0x1;}}}else{if(_0x344e2d===_0x9481('0x3e')){return _0xf7b2e1[_0x9481('0x35')]<_0x1872ff['globalStatus']?0x1:-0x1;}else{return _0xf7b2e1[_0x9481('0x35')]<_0x1872ff[_0x9481('0x35')]?-0x1:0x1;}}});return _0x2e4241;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x1c98fa){var _0x35d740=[_0x9481('0x40'),_0x9481('0x41'),_0x9481('0x42'),_0x9481('0x43'),_0x9481('0x34'),_0x9481('0x43'),_0x9481('0x3b'),'address',_0x9481('0x4'),'openchannelPause','mailPause',_0x9481('0x33'),'whatsappPause',_0x9481('0x44'),_0x9481('0x6'),'chatCapacity',_0x9481('0x45'),_0x9481('0x46'),_0x9481('0x47'),_0x9481('0x48'),_0x9481('0x49'),_0x9481('0x4a'),'openchannelCurrentCapacity','mailCurrentCapacity',_0x9481('0x4b'),_0x9481('0x4c'),_0x9481('0x4d'),_0x9481('0x11'),_0x9481('0x14'),_0x9481('0x13'),_0x9481('0x15'),_0x9481('0x16'),'faxStatus',_0x9481('0xf'),_0x9481('0x4e'),_0x9481('0x4f'),_0x9481('0x50'),_0x9481('0x51'),'whatsappStatusTime','faxStatusTime',_0x9481('0x52'),_0x9481('0x53'),_0x9481('0x54'),'screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias'];var _0x538507=['chatPause','openchannelPause',_0x9481('0x5'),_0x9481('0x33'),'whatsappPause',_0x9481('0x44'),'voicePause',_0x9481('0x41')];var _0x229b69=_(_0x1c98fa)[_0x9481('0x55')](_0x538507)[_0x9481('0x56')](_0x35d740)[_0x9481('0x2a')]();return _0x229b69;}exports[_0x9481('0x57')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x9481('0x30'),'fullname',_0x9481('0x58'),_0x9481('0x3b'),'online',_0x9481('0x35'),_0x9481('0x40'),_0x9481('0x42'),_0x9481('0x34'),_0x9481('0x43'),'faxPause',_0x9481('0x4'),_0x9481('0x5'),_0x9481('0x32'),_0x9481('0x33'),_0x9481('0x6'),_0x9481('0x7'),_0x9481('0x11'),_0x9481('0x12'),_0x9481('0x13'),'openchannelStatus','smsStatus','voiceStatus',_0x9481('0x16'),_0x9481('0x4e'),'faxStatusTime',_0x9481('0x50'),_0x9481('0x4f'),_0x9481('0x51'),_0x9481('0x52'),_0x9481('0x59'),_0x9481('0x5a'),'faxCapacity','mailCapacity',_0x9481('0x45'),_0x9481('0x47'),_0x9481('0x48'),_0x9481('0x4a'),_0x9481('0x4d'),_0x9481('0x5b'),'openchannelCurrentCapacity','smsCurrentCapacity',_0x9481('0x4c'),'phoneBarEnableScreenRecordingByAgent',_0x9481('0x5c'),'destconnectedlinenum',_0x9481('0x5d'),_0x9481('0x53'),_0x9481('0x5e'),'screenrecording'];}exports[_0x9481('0x5f')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x46ed=['map','findOne','getAgents','all','flatten','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','findAll','name','pauseType','find','globalStatus','split','order','startsWith','DESC','ASC','fullname,internal','fullname','validateSortParameter','toLowerCase','sortAgentsByStatus','userpic','online','lastPauseAt','internal','address','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','role','lastLoginAt','faxStatus','mailCurrentCapacity','smsCurrentCapacity','onhold','queue','routealias','lodash','jayson/promise','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','unknown','unavailable','ringing','isNil','voiceStatus','chatStatus','openchannelStatus','smsStatus','whatsappStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','pause','*pause','idle','busy','isArray','startCase','Queue'];(function(_0x10f95f,_0xe0a31b){var _0x191874=function(_0x50b95a){while(--_0x50b95a){_0x10f95f['push'](_0x10f95f['shift']());}};_0x191874(++_0xe0a31b);}(_0x46ed,0x168));var _0xd46e=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x46ed[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xd46e('0x0'));var jayson=require(_0xd46e('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xd46e('0x2')][_0xd46e('0x3')]({'port':0x232a});var routingClient=jayson[_0xd46e('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x2e6b84,_0x4518b8){var _0x54ef98=[_0x2e6b84[_0xd46e('0x4')],_0x2e6b84[_0xd46e('0x5')],_0x2e6b84[_0xd46e('0x6')],_0x2e6b84[_0xd46e('0x7')],_0x2e6b84[_0xd46e('0x8')],_0x2e6b84[_0xd46e('0x9')],_0x2e6b84[_0xd46e('0xa')]];if(!_0x4518b8)return _[_0xd46e('0xb')](_0x54ef98);var _0x31259b=_[_0xd46e('0xc')](_0x54ef98);return _0x31259b[_0xd46e('0xd')]>0x0&&_0x31259b['length']<_0x54ef98[_0xd46e('0xd')]?!![]:![];}function isIdle(_0x81235b){return _0x81235b==='idle'||_0x81235b===_0xd46e('0xe')||_0x81235b===_0xd46e('0xf')||_0x81235b===_0xd46e('0x10')||_[_0xd46e('0x11')](_0x81235b);}function isAgentIdle(_0x1ad723){if(_0x1ad723[_0xd46e('0x12')]!=='idle'&&_0x1ad723[_0xd46e('0x9')]){_0x1ad723['voiceStatus']='pause';return![];}return _[_0xd46e('0xb')]([_0x1ad723[_0xd46e('0x13')],_0x1ad723['faxStatus'],_0x1ad723['mailStatus'],_0x1ad723[_0xd46e('0x14')],_0x1ad723[_0xd46e('0x15')],_0x1ad723[_0xd46e('0x12')],_0x1ad723[_0xd46e('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0xd46e('0x17'),{})[_0xd46e('0x18')](function(_0x417402){if(_0x417402[_0xd46e('0x19')]){throw new Error(_0xd46e('0x1a'));}var _0x47fa8f=_0x417402[_0xd46e('0x1b')];return routingClient[_0xd46e('0x1c')](_0xd46e('0x17'),{})['then'](function(_0x5ddd04){if(_0x5ddd04[_0xd46e('0x19')]){throw new Error(_0xd46e('0x1d'));}var _0x488690=_0x5ddd04['result'];return _[_0xd46e('0x1e')]({},_0x47fa8f,_0x488690);});})[_0xd46e('0x1f')](function(_0x362885){throw _0x362885;});}exports[_0xd46e('0x20')]=getRealtimeAgents;function getAgentStatus(_0x409010){var _0x312d6f=_0xd46e('0xe');if(isAgentPaused(_0x409010))_0x312d6f=_0xd46e('0x21');else if(isAgentPaused(_0x409010,!![]))_0x312d6f=_0xd46e('0x22');else if(isAgentIdle(_0x409010))_0x312d6f=_0xd46e('0x23');else _0x312d6f=_0xd46e('0x24');return _0x312d6f;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x259072,_0x1c83fa){var _0x79aa51=_[_0xd46e('0x25')](_0x259072)?_0x259072:[_0x259072];var _0x128246=_[_0xd46e('0x26')](_0x1c83fa)+_0xd46e('0x27');var _0x8a1be=_[_0xd46e('0x28')](_0x79aa51,function(_0x4cf899){return db[_0x128246][_0xd46e('0x29')]({'where':{'id':_0x4cf899}})['then'](function(_0x4b8f6a){if(!_0x4b8f6a)return[];return _0x4b8f6a[_0xd46e('0x2a')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xd46e('0x2b')](_0x8a1be)[_0xd46e('0x18')](function(_0x42afc7){var _0x247b9f=_(_0x42afc7)[_0xd46e('0x2c')]()[_0xd46e('0x28')]('id')['uniq']()[_0xd46e('0x2d')]();return _0x247b9f;});}exports[_0xd46e('0x2e')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0xddbce9,_0x17db79,_0x96f15c){try{if(_0x17db79[_0xd46e('0xd')]>0x0){_0xddbce9=_0xddbce9['filter'](function(_0x465d54){return _0x17db79[_0xd46e('0x2f')](_0x465d54['id']);});}var _0x2d1afe=_0xddbce9[_0xd46e('0xc')](function(_0x106edc){var _0x423ea3=_0xd46e('0x24');if(isAgentIdle(_0x106edc)){_0x423ea3=_0xd46e('0x23');}return _0x423ea3===_0x96f15c;});return _[_0xd46e('0x28')](_0x2d1afe,'id');}catch(_0x45ea47){throw _0x45ea47;}}exports[_0xd46e('0x30')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x504324,_0x2f4a1b,_0x5ed8dc){return Promise[_0xd46e('0x31')]()[_0xd46e('0x18')](function(){if(_0x2f4a1b[_0xd46e('0xd')]>0x0){_0x504324=_0x504324[_0xd46e('0xc')](function(_0x5ef248){return _0x2f4a1b[_0xd46e('0x2f')](_0x5ef248['id']);});}return _0x504324;})[_0xd46e('0x18')](function(){return db['User'][_0xd46e('0x32')]({'attributes':['id',_0xd46e('0x33'),'fullname',_0xd46e('0x4'),_0xd46e('0x5'),_0xd46e('0x6'),'openchannelPause','smsPause',_0xd46e('0x9'),_0xd46e('0xa'),_0xd46e('0x34')],'where':{'id':{'$in':_[_0xd46e('0x28')](_0x504324,'id')}},'raw':!![]});})[_0xd46e('0x18')](function(_0x423de9){return _0x423de9[_0xd46e('0x28')](function(_0xf8b746){var _0x527a2f=_[_0xd46e('0x35')](_0x504324,['id',_0xf8b746['id']]);var _0x1a1181=filterAgentAttributes(_0x527a2f);_[_0xd46e('0x1e')](_0xf8b746,_0x1a1181);_0xf8b746[_0xd46e('0x36')]=getAgentStatus(_0xf8b746);return _0xf8b746;});})[_0xd46e('0x18')](function(_0x1e0897){var _0x42ddde=sortAgentsByStatus(_0x1e0897,_0x5ed8dc);return _['map'](_0x42ddde,'id');})[_0xd46e('0x1f')](function(_0x357212){throw _0x357212;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x14447e){var _0x96b0f9={'fields':[],'order':null};var _0x12ccf8=_0x14447e[_0xd46e('0x37')](',');_0x96b0f9['fields']=_[_0xd46e('0xc')](_0x12ccf8,function(_0x3ecf34){if(!_0x3ecf34[_0xd46e('0x2f')](_0xd46e('0x36'))){return!![];}_0x96b0f9[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x3ecf34,'-')?_0xd46e('0x3a'):_0xd46e('0x3b');return![];});return _0x96b0f9;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x232e6f){if(!_0x232e6f){_0x232e6f=_0xd46e('0x3c');}if(_0x232e6f[_0xd46e('0x2f')](_0xd46e('0x3d'))&&!_0x232e6f[_0xd46e('0x2f')]('internal')){var _0x964c66=_0x232e6f['substring'](0x0,_0x232e6f['indexOf']('fullname'));_0x232e6f+=','+_0x964c66+'internal';}return _0x232e6f;}exports[_0xd46e('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x54949f,_0x3b76e0){var _0x40720e=_0x54949f['sort'](function(_0x462477,_0x4114e6){if(_0x462477[_0xd46e('0x36')]===_0x4114e6[_0xd46e('0x36')]){if(_0x462477[_0xd46e('0x36')]===_0xd46e('0x21')){if(_0x3b76e0===_0xd46e('0x3a')){return(_0x462477[_0xd46e('0x34')]||'')<(_0x4114e6[_0xd46e('0x34')]||'')||_0x462477[_0xd46e('0x3d')][_0xd46e('0x3f')]()>_0x4114e6['fullname']['toLowerCase']()?0x1:-0x1;}else{return(_0x462477['pauseType']||'')<(_0x4114e6[_0xd46e('0x34')]||'')||_0x462477['fullname'][_0xd46e('0x3f')]()>_0x4114e6[_0xd46e('0x3d')][_0xd46e('0x3f')]()?-0x1:0x1;}}else{if(_0x3b76e0===_0xd46e('0x3a')){return _0x462477[_0xd46e('0x3d')][_0xd46e('0x3f')]()<_0x4114e6[_0xd46e('0x3d')][_0xd46e('0x3f')]()?0x1:-0x1;}else{return _0x462477['fullname'][_0xd46e('0x3f')]()<_0x4114e6['fullname'][_0xd46e('0x3f')]()?-0x1:0x1;}}}else{if(_0x3b76e0===_0xd46e('0x3a')){return _0x462477[_0xd46e('0x36')]<_0x4114e6[_0xd46e('0x36')]?0x1:-0x1;}else{return _0x462477[_0xd46e('0x36')]<_0x4114e6['globalStatus']?-0x1:0x1;}}});return _0x40720e;}exports[_0xd46e('0x40')]=sortAgentsByStatus;function filterAgentAttributes(_0xfcd7f9){var _0x2acb83=[_0xd46e('0x41'),_0xd46e('0x42'),'lastLoginAt',_0xd46e('0x43'),_0xd46e('0x34'),_0xd46e('0x43'),_0xd46e('0x44'),_0xd46e('0x45'),'chatPause',_0xd46e('0x7'),_0xd46e('0x6'),_0xd46e('0x8'),_0xd46e('0xa'),_0xd46e('0x5'),_0xd46e('0x9'),_0xd46e('0x46'),_0xd46e('0x47'),'mailCapacity',_0xd46e('0x48'),_0xd46e('0x49'),_0xd46e('0x4a'),_0xd46e('0x4b'),_0xd46e('0x4c'),'mailCurrentCapacity','smsCurrentCapacity',_0xd46e('0x4d'),_0xd46e('0x4e'),_0xd46e('0x13'),'openchannelStatus','mailStatus',_0xd46e('0x15'),_0xd46e('0x16'),'faxStatus',_0xd46e('0x12'),_0xd46e('0x4f'),_0xd46e('0x50'),_0xd46e('0x51'),_0xd46e('0x52'),_0xd46e('0x53'),_0xd46e('0x54'),_0xd46e('0x55'),'queue',_0xd46e('0x56'),_0xd46e('0x57'),_0xd46e('0x58'),_0xd46e('0x59'),'routealias'];var _0x56dd9a=[_0xd46e('0x4'),'openchannelPause',_0xd46e('0x6'),_0xd46e('0x8'),_0xd46e('0xa'),_0xd46e('0x5'),_0xd46e('0x9'),_0xd46e('0x42')];var _0x492329=_(_0xfcd7f9)[_0xd46e('0x5a')](_0x56dd9a)[_0xd46e('0x5b')](_0x2acb83)[_0xd46e('0x2d')]();return _0x492329;}exports['filterAgentAttributes']=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xd46e('0x33'),_0xd46e('0x3d'),_0xd46e('0x5c'),_0xd46e('0x44'),_0xd46e('0x42'),_0xd46e('0x36'),_0xd46e('0x41'),_0xd46e('0x5d'),_0xd46e('0x34'),_0xd46e('0x43'),_0xd46e('0x5'),_0xd46e('0x4'),_0xd46e('0x6'),_0xd46e('0x7'),'smsPause',_0xd46e('0x9'),_0xd46e('0xa'),_0xd46e('0x13'),_0xd46e('0x5e'),'mailStatus',_0xd46e('0x14'),_0xd46e('0x15'),_0xd46e('0x12'),_0xd46e('0x16'),'chatStatusTime',_0xd46e('0x54'),_0xd46e('0x51'),'openchannelStatusTime','smsStatusTime',_0xd46e('0x55'),_0xd46e('0x53'),_0xd46e('0x46'),'faxCapacity','mailCapacity',_0xd46e('0x47'),_0xd46e('0x48'),_0xd46e('0x49'),_0xd46e('0x4b'),_0xd46e('0x4e'),_0xd46e('0x5f'),_0xd46e('0x4c'),_0xd46e('0x60'),_0xd46e('0x4d'),_0xd46e('0x58'),_0xd46e('0x59'),_0xd46e('0x56'),_0xd46e('0x61'),_0xd46e('0x62'),_0xd46e('0x63'),_0xd46e('0x57')];}exports['getRealtimeAgentsQueryFields']=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 5fe330a..04c2a8a 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 _0x1df0=['inUse','loggedInDb','ringing','talking','unknown','pTalking','originated','message','dialActive','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','map','get','waiting','find','pick','initializeQueues','lodash','client','http','loggedIn','paused','busy'];(function(_0x5bf94d,_0x297e9f){var _0x13949b=function(_0x2e1e53){while(--_0x2e1e53){_0x5bf94d['push'](_0x5bf94d['shift']());}};_0x13949b(++_0x297e9f);}(_0x1df0,0x1f4));var _0x01df=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x1df0[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x01df('0x0'));var jayson=require('jayson/promise');var util=require('util');var amiClient=jayson[_0x01df('0x1')][_0x01df('0x2')]({'port':0x232a});var routingClient=jayson['client'][_0x01df('0x2')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0x01df('0x3'),_0x01df('0x4'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0x01df('0x5'),_0x01df('0x6'),'invalid',_0x01df('0x7'),'notInUse','onHold',_0x01df('0x8'),'ringInUse',_0x01df('0x9'),'unavailable',_0x01df('0xa')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x01df('0xb'),_0x01df('0xc'),_0x01df('0xd'),'statusMessage',_0x01df('0xe'),'dialMethod',_0x01df('0xf'),_0x01df('0x10'),'startProgressive',_0x01df('0x11'),_0x01df('0x12'),_0x01df('0x13'),_0x01df('0x14'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0x01df('0x15'),_0x01df('0x16'),_0x01df('0x17'),'predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0x01df('0x18'),'predictiveIntervalAvgHoldtime',_0x01df('0x19')];function getRealtimeQueues(_0x2c77db,_0x3519c5){var _0x256d64=_0x3519c5===_0x01df('0x1a')?amiClient:routingClient;return _0x256d64[_0x01df('0x1b')](_[_0x01df('0x1c')](_0x3519c5)+_0x01df('0x1d'),_0x2c77db)[_0x01df('0x1e')](function(_0x26168c){if(_0x26168c[_0x01df('0x1f')])throw new Error(util[_0x01df('0x20')](_0x01df('0x21'),_0x3519c5));return _0x26168c[_0x01df('0x22')];})[_0x01df('0x23')](function(_0x25148d){throw _0x25148d;});}exports[_0x01df('0x24')]=getRealtimeQueues;function initializeQueues(_0x199f81,_0x322e1a,_0x194a76,_0x39b93c){var _0x1b73f4=DEFAULT_QUEUE_ATTRIBUTES;if(_0x194a76==='voice'){if(_0x39b93c===_0x01df('0x25')){_0x1b73f4=_0x1b73f4[_0x01df('0x26')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x39b93c===_0x01df('0x27')){_0x1b73f4=_0x1b73f4['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x199f81[_0x01df('0x28')](function(_0x3e1bed){var _0x1cd5c3=_0x3e1bed[_0x01df('0x29')]({'plain':!![]});_0x1cd5c3[_0x01df('0x4')]=0x0;_0x1cd5c3[_0x01df('0x7')]=0x0;_0x1cd5c3[_0x01df('0x3')]=0x0;_0x1cd5c3['available']=0x0;_0x1cd5c3[_0x01df('0x2a')]=0x0;if(_0x194a76==='voice'){_0x1cd5c3[_0x01df('0x9')]=0x0;_0x1cd5c3['busy']=0x0;if(_0x39b93c===_0x01df('0x27')){_0x1cd5c3[_0x01df('0xb')]=0x0;_0x1cd5c3[_0x01df('0xc')]=0x0;}}var _0x209918=_[_0x01df('0x2b')](_0x322e1a,['id',_0x1cd5c3['id']]);if(_0x209918){_['merge'](_0x1cd5c3,_[_0x01df('0x2c')](_0x209918,_0x1b73f4));}return _0x1cd5c3;});}exports[_0x01df('0x2d')]=initializeQueues; \ No newline at end of file +var _0x1880=['voice','request','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','concat','outbound','map','get','loggedInDb','merge','lodash','jayson/promise','client','http','available','loggedIn','paused','waiting','busy','invalid','ringInUse','talking','unavailable','unknown','pTalking','originated','message','statusMessage','dialActive','dialMethod','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x1880,0x1bf));var _0x0188=function(_0x105d2e,_0xefc0f9){_0x105d2e=_0x105d2e-0x0;var _0x44969d=_0x1880[_0x105d2e];return _0x44969d;};'use strict';var _=require(_0x0188('0x0'));var jayson=require(_0x0188('0x1'));var util=require('util');var amiClient=jayson[_0x0188('0x2')][_0x0188('0x3')]({'port':0x232a});var routingClient=jayson[_0x0188('0x2')][_0x0188('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x0188('0x4'),_0x0188('0x5'),_0x0188('0x6'),_0x0188('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0x0188('0x8'),'inUse',_0x0188('0x9'),'loggedInDb','notInUse','onHold','ringing',_0x0188('0xa'),_0x0188('0xb'),_0x0188('0xc'),_0x0188('0xd')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x0188('0xe'),_0x0188('0xf'),_0x0188('0x10'),_0x0188('0x11'),_0x0188('0x12'),_0x0188('0x13'),'Trunk','startPredictive',_0x0188('0x14'),_0x0188('0x15'),_0x0188('0x16'),_0x0188('0x17'),_0x0188('0x18'),_0x0188('0x19'),_0x0188('0x1a'),_0x0188('0x1b'),'predictiveIntervalAvailable',_0x0188('0x1c'),_0x0188('0x1d'),_0x0188('0x1e'),_0x0188('0x1f'),'predictiveIntervalAvgHoldtime',_0x0188('0x20')];function getRealtimeQueues(_0x51bb89,_0x599ee9){var _0x503891=_0x599ee9===_0x0188('0x21')?amiClient:routingClient;return _0x503891[_0x0188('0x22')](_['startCase'](_0x599ee9)+_0x0188('0x23'),_0x51bb89)[_0x0188('0x24')](function(_0x4a8130){if(_0x4a8130[_0x0188('0x25')])throw new Error(util[_0x0188('0x26')](_0x0188('0x27'),_0x599ee9));return _0x4a8130[_0x0188('0x28')];})[_0x0188('0x29')](function(_0x2b2d6a){throw _0x2b2d6a;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x3d410e,_0x2b2979,_0x288c4d,_0x4016f4){var _0x2faaa7=DEFAULT_QUEUE_ATTRIBUTES;if(_0x288c4d===_0x0188('0x21')){if(_0x4016f4==='inbound'){_0x2faaa7=_0x2faaa7[_0x0188('0x2a')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x4016f4===_0x0188('0x2b')){_0x2faaa7=_0x2faaa7[_0x0188('0x2a')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x3d410e[_0x0188('0x2c')](function(_0x5c4ec2){var _0x537222=_0x5c4ec2[_0x0188('0x2d')]({'plain':!![]});_0x537222[_0x0188('0x6')]=0x0;_0x537222[_0x0188('0x2e')]=0x0;_0x537222[_0x0188('0x5')]=0x0;_0x537222[_0x0188('0x4')]=0x0;_0x537222[_0x0188('0x7')]=0x0;if(_0x288c4d===_0x0188('0x21')){_0x537222[_0x0188('0xb')]=0x0;_0x537222['busy']=0x0;if(_0x4016f4===_0x0188('0x2b')){_0x537222[_0x0188('0xe')]=0x0;_0x537222[_0x0188('0xf')]=0x0;}}var _0x57c11c=_['find'](_0x2b2979,['id',_0x537222['id']]);if(_0x57c11c){_[_0x0188('0x2f')](_0x537222,_['pick'](_0x57c11c,_0x2faaa7));}return _0x537222;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index d9d9f65..607623f 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(_0x5a9666,_0x30bc94){var _0x28601f=function(_0x52e447){while(--_0x52e447){_0x5a9666['push'](_0x5a9666['shift']());}};_0x28601f(++_0x30bc94);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x585e84,_0x1d8489){var _0x39f3c4=function(_0x1855a3){while(--_0x1855a3){_0x585e84['push'](_0x585e84['shift']());}};_0x39f3c4(++_0x1d8489);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 22993ad..4582548 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 _0xa6b9=['internal','concat','head','mac','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','digest','licenseToken','test','replace','hostname','macAddress','ipAddress','update','hex','substring','lodash','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','length','family','IPv4'];(function(_0x5521ee,_0x32d7d2){var _0x403819=function(_0x474a59){while(--_0x474a59){_0x5521ee['push'](_0x5521ee['shift']());}};_0x403819(++_0x32d7d2);}(_0xa6b9,0x177));var _0x9a6b=function(_0x318f19,_0x1ad0fc){_0x318f19=_0x318f19-0x0;var _0x1adf1d=_0xa6b9[_0x318f19];return _0x1adf1d;};'use strict';var _=require(_0x9a6b('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x9a6b('0x1'));var exec=require(_0x9a6b('0x2'))[_0x9a6b('0x3')];var config=require(_0x9a6b('0x4'));function getInterfaces(){var _0x23cbb7=[];var _0x3ce4dc=os[_0x9a6b('0x5')]();var _0x376363=_['orderBy'](_['keys'](_0x3ce4dc));for(var _0x6bd5c2=0x0;_0x6bd5c2<_0x376363[_0x9a6b('0x6')];_0x6bd5c2++){var _0x160ef0=_0x3ce4dc[_0x376363[_0x6bd5c2]]['filter'](function(_0x1abd9d){return _0x1abd9d[_0x9a6b('0x7')]===_0x9a6b('0x8')&&_0x1abd9d[_0x9a6b('0x9')]===![];});_0x23cbb7=_0x23cbb7[_0x9a6b('0xa')](_0x160ef0);}return _0x23cbb7;}function getFirstInterface(){var _0x12d187=_[_0x9a6b('0xb')](getInterfaces());return{'macAddress':_0x12d187&&_0x12d187[_0x9a6b('0xc')]?_0x12d187[_0x9a6b('0xc')]:'00:00:00:00:00:00','ipAddress':_0x12d187&&_0x12d187['address']?_0x12d187[_0x9a6b('0xd')]:_0x9a6b('0xe')};}exports[_0x9a6b('0xf')]=getFirstInterface;function getCPUhash(){var _0x5d9c63=_['orderBy'](os[_0x9a6b('0x10')]()[_0x9a6b('0x11')](function(_0x148b8c){return _0x148b8c[_0x9a6b('0x12')];}))[_0x9a6b('0x13')](':');return crypto[_0x9a6b('0x14')](_0x9a6b('0x15'))['update'](_0x5d9c63)[_0x9a6b('0x16')]('hex');}exports['getUuid']=function(){var _0x341ad=os['platform']();var _0xaf4080=/[0-9a-f-]{36}/;if(config[_0x9a6b('0x17')]&&_0xaf4080[_0x9a6b('0x18')](config[_0x9a6b('0x17')])){return config['licenseToken'];}else if(_0x341ad==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x9a6b('0x19')]('\x0d\x0a','');}else{var _0x2d6bc0=getFirstInterface();var _0x152845=getCPUhash();var _0x259d71=_0x152845+'|'+os[_0x9a6b('0x1a')]()+'|'+_0x2d6bc0[_0x9a6b('0x1b')]+'|'+_0x2d6bc0[_0x9a6b('0x1c')];var _0x30aec9=crypto['createHash'](_0x9a6b('0x15'))[_0x9a6b('0x1d')](_0x259d71)['digest'](_0x9a6b('0x1e'));return _0x30aec9[_0x9a6b('0x1f')](0x0,0x8)+'-'+_0x30aec9[_0x9a6b('0x1f')](0x8,0xc)+'-'+_0x30aec9[_0x9a6b('0x1f')](0xc,0x10)+'-'+_0x30aec9[_0x9a6b('0x1f')](0x10,0x14)+'-'+_0x30aec9['substring'](0x14);}}; \ No newline at end of file +var _0x1d8c=['ipAddress','digest','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','orderBy','length','filter','internal','concat','head','mac','00:00:00:00:00:00','getFirstInterface','map','model','createHash','update','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace'];(function(_0x520342,_0x5a2a53){var _0x340084=function(_0x1d4a1a){while(--_0x1d4a1a){_0x520342['push'](_0x520342['shift']());}};_0x340084(++_0x5a2a53);}(_0x1d8c,0x9e));var _0xc1d8=function(_0x5ec4d5,_0x55f2a0){_0x5ec4d5=_0x5ec4d5-0x0;var _0x4811fa=_0x1d8c[_0x5ec4d5];return _0x4811fa;};'use strict';var _=require(_0xc1d8('0x0'));var os=require('os');var crypto=require(_0xc1d8('0x1'));var machine=require(_0xc1d8('0x2'));var exec=require(_0xc1d8('0x3'))[_0xc1d8('0x4')];var config=require(_0xc1d8('0x5'));function getInterfaces(){var _0x543fe1=[];var _0x2b15fc=os['networkInterfaces']();var _0x5d06dc=_[_0xc1d8('0x6')](_['keys'](_0x2b15fc));for(var _0x1f281c=0x0;_0x1f281c<_0x5d06dc[_0xc1d8('0x7')];_0x1f281c++){var _0x3c683b=_0x2b15fc[_0x5d06dc[_0x1f281c]][_0xc1d8('0x8')](function(_0x5f3581){return _0x5f3581['family']==='IPv4'&&_0x5f3581[_0xc1d8('0x9')]===![];});_0x543fe1=_0x543fe1[_0xc1d8('0xa')](_0x3c683b);}return _0x543fe1;}function getFirstInterface(){var _0x329c2f=_[_0xc1d8('0xb')](getInterfaces());return{'macAddress':_0x329c2f&&_0x329c2f[_0xc1d8('0xc')]?_0x329c2f[_0xc1d8('0xc')]:_0xc1d8('0xd'),'ipAddress':_0x329c2f&&_0x329c2f['address']?_0x329c2f['address']:'127.0.0.1'};}exports[_0xc1d8('0xe')]=getFirstInterface;function getCPUhash(){var _0x4c4529=_[_0xc1d8('0x6')](os['cpus']()[_0xc1d8('0xf')](function(_0x3f9e67){return _0x3f9e67[_0xc1d8('0x10')];}))['join'](':');return crypto[_0xc1d8('0x11')]('md5')[_0xc1d8('0x12')](_0x4c4529)['digest'](_0xc1d8('0x13'));}exports[_0xc1d8('0x14')]=function(){var _0x480f22=os[_0xc1d8('0x15')]();var _0xaea255=/[0-9a-f-]{36}/;if(config[_0xc1d8('0x16')]&&_0xaea255[_0xc1d8('0x17')](config[_0xc1d8('0x16')])){return config['licenseToken'];}else if(_0x480f22===_0xc1d8('0x18')){return exec(_0xc1d8('0x19'),{'encoding':_0xc1d8('0x1a')})[_0xc1d8('0x1b')]('\x0d\x0a','');}else{var _0x37bbac=getFirstInterface();var _0x4fdb36=getCPUhash();var _0x45a201=_0x4fdb36+'|'+os['hostname']()+'|'+_0x37bbac['macAddress']+'|'+_0x37bbac[_0xc1d8('0x1c')];var _0x243a7=crypto[_0xc1d8('0x11')]('md5')['update'](_0x45a201)[_0xc1d8('0x1d')](_0xc1d8('0x13'));return _0x243a7[_0xc1d8('0x1e')](0x0,0x8)+'-'+_0x243a7[_0xc1d8('0x1e')](0x8,0xc)+'-'+_0x243a7['substring'](0xc,0x10)+'-'+_0x243a7[_0xc1d8('0x1e')](0x10,0x14)+'-'+_0x243a7[_0xc1d8('0x1e')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 4ae5737..d3122e4 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 _0x2a37=['format','YYYY-MM-DD\x20HH:mm','encryptString','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate','error','default','moment','request-promise','bluebird','pkginfo','version','../../components/encryptor','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data1','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s'];(function(_0x512099,_0x2b1b6b){var _0x246035=function(_0x5f41b2){while(--_0x5f41b2){_0x512099['push'](_0x512099['shift']());}};_0x246035(++_0x2b1b6b);}(_0x2a37,0x9f));var _0x72a3=function(_0x1fa026,_0x6ace7e){_0x1fa026=_0x1fa026-0x0;var _0x3fbdd9=_0x2a37[_0x1fa026];return _0x3fbdd9;};'use strict';var util=require('util');var moment=require(_0x72a3('0x0'));var rp=require(_0x72a3('0x1'));var BPromise=require(_0x72a3('0x2'));var pkginfo=require(_0x72a3('0x3'))(module,_0x72a3('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x72a3('0x5'));var hardware=require('./hardware');var logger=require(_0x72a3('0x6'))(_0x72a3('0x7'));var HOST=_0x72a3('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xb86007){return new BPromise(function(_0x29ab59,_0xa24713){var _0x2ff965=util['format'](_0x72a3('0x9'),HOST,_0xb86007,module[_0x72a3('0xa')][_0x72a3('0x4')]);if(oldToken){_0x2ff965=util['format'](_0x72a3('0xb'),HOST,_0xb86007,module[_0x72a3('0xa')][_0x72a3('0x4')],oldToken);}var _0x55b0c4={'uri':_0x2ff965,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x55b0c4)[_0x72a3('0xc')](function(_0x39ca18){_0x29ab59(_0x39ca18);})[_0x72a3('0xd')](function(_0x1a58bb){_0xa24713(_0x1a58bb);});});}function manageLicense(_0x1597ff,_0x422efa){var _0x3b83cc=_0x422efa[_0x72a3('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x3b83cc[_0x72a3('0xf')]!==_0x1597ff&&!_0x3b83cc['data2']){oldToken=_0x3b83cc[_0x72a3('0xf')];}httpRequest(_0x1597ff)[_0x72a3('0xc')](function(_0x1aecb8){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1aecb8[_0x72a3('0x10')]){isOldTokenSent=![];if(!_0x3b83cc[_0x72a3('0x7')]&&_0x3b83cc['license']!=_0x1aecb8[_0x72a3('0x7')]||_0x3b83cc['license']&&_0x3b83cc['data2']){logger['info'](_0x72a3('0x11'));}if(_0x3b83cc[_0x72a3('0x7')]&&!_0x3b83cc[_0x72a3('0x12')]&&_0x3b83cc[_0x72a3('0x7')]!=_0x1aecb8[_0x72a3('0x7')]){logger[_0x72a3('0x13')](_0x72a3('0x14'));}if(_0x3b83cc[_0x72a3('0x7')]&&!_0x3b83cc[_0x72a3('0x12')]&&_0x3b83cc[_0x72a3('0x7')]==_0x1aecb8['license']){return _0x422efa;}return _0x422efa[_0x72a3('0x15')]({'data1':_0x1597ff,'data2':null,'license':_0x1aecb8['license']});}else{if(_0x1aecb8[_0x72a3('0x7')]||_0x3b83cc['license']){if(!_0x3b83cc[_0x72a3('0x12')]){if(_0x3b83cc[_0x72a3('0xf')]==_0x1597ff){GRAY_PERIOD_REASON=_0x72a3('0x16');logger[_0x72a3('0x13')](_0x72a3('0x17'));}else{GRAY_PERIOD_REASON=_0x72a3('0x18');logger[_0x72a3('0x13')](_0x72a3('0x19'),_0x3b83cc[_0x72a3('0xf')],_0x1597ff);}logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x72a3('0x1a')](_0x72a3('0x1b')));return _0x422efa[_0x72a3('0x15')]({'data2':encryptor[_0x72a3('0x1c')](moment()['format'](_0x72a3('0x1b')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x3b83cc[_0x72a3('0x12')]),'days')>DAYS){logger[_0x72a3('0x13')](_0x72a3('0x1d'),moment()[_0x72a3('0x1a')](_0x72a3('0x1b')));isOldTokenSent=![];return _0x422efa['update']({'data1':_0x1597ff,'data2':null,'license':null});}}}else{if(_0x3b83cc['data1']!=_0x1597ff){logger[_0x72a3('0x13')](_0x72a3('0x19'),_0x3b83cc['data1'],_0x1597ff);return _0x422efa['update']({'data1':_0x1597ff,'data2':null,'license':null});}}}return _0x422efa;})['then'](function(_0x1ae6e2){_0x422efa=_0x1ae6e2;})[_0x72a3('0xd')](function(_0x2481e9){logger['error'](_0x2481e9[_0x72a3('0x1e')]);})[_0x72a3('0x1f')](function(){setTimeout(function(){manageLicense(hardware[_0x72a3('0x20')](),_0x422efa);},TIME);});}function defaultLicense(){var _0xc44464=hardware['getUuid']();if(_0xc44464){return db[_0x72a3('0x21')][_0x72a3('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0xc44464}})['spread'](function(_0x10e38a,_0x3c4d1e){logger[_0x72a3('0x13')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0xc44464);manageLicense(_0xc44464,_0x10e38a);})[_0x72a3('0xd')](function(_0x2d8d9d){logger[_0x72a3('0x23')](_0x2d8d9d[_0x72a3('0x1e')]);});}}exports[_0x72a3('0x24')]=defaultLicense; \ No newline at end of file +var _0x6d71=['%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','catch','message','finally','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','version','./hardware','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','get','data1','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed'];(function(_0x45b798,_0x31a834){var _0x44c45e=function(_0x153581){while(--_0x153581){_0x45b798['push'](_0x45b798['shift']());}};_0x44c45e(++_0x31a834);}(_0x6d71,0x127));var _0x16d7=function(_0x307dbc,_0x2bc734){_0x307dbc=_0x307dbc-0x0;var _0x4f7bdd=_0x6d71[_0x307dbc];return _0x4f7bdd;};'use strict';var util=require(_0x16d7('0x0'));var moment=require(_0x16d7('0x1'));var rp=require(_0x16d7('0x2'));var BPromise=require(_0x16d7('0x3'));var pkginfo=require('pkginfo')(module,_0x16d7('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x16d7('0x5'));var logger=require('../logger')(_0x16d7('0x6'));var HOST=_0x16d7('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x498a9e){return new BPromise(function(_0x1bfb2c,_0x575da0){var _0x22ce6e=util['format'](_0x16d7('0x8'),HOST,_0x498a9e,module[_0x16d7('0x9')][_0x16d7('0x4')]);if(oldToken){_0x22ce6e=util[_0x16d7('0xa')](_0x16d7('0xb'),HOST,_0x498a9e,module[_0x16d7('0x9')][_0x16d7('0x4')],oldToken);}var _0x2c859d={'uri':_0x22ce6e,'method':_0x16d7('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x2c859d)[_0x16d7('0xd')](function(_0x362624){_0x1bfb2c(_0x362624);})['catch'](function(_0x2de95a){_0x575da0(_0x2de95a);});});}function manageLicense(_0x38d621,_0x3e61a9){var _0x42f48f=_0x3e61a9[_0x16d7('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x42f48f['data1']!==_0x38d621&&!_0x42f48f['data2']){oldToken=_0x42f48f[_0x16d7('0xf')];}httpRequest(_0x38d621)['then'](function(_0x32e01c){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x32e01c[_0x16d7('0x10')]){isOldTokenSent=![];if(!_0x42f48f[_0x16d7('0x6')]&&_0x42f48f[_0x16d7('0x6')]!=_0x32e01c[_0x16d7('0x6')]||_0x42f48f['license']&&_0x42f48f['data2']){logger['info'](_0x16d7('0x11'));}if(_0x42f48f['license']&&!_0x42f48f[_0x16d7('0x12')]&&_0x42f48f[_0x16d7('0x6')]!=_0x32e01c[_0x16d7('0x6')]){logger[_0x16d7('0x13')](_0x16d7('0x14'));}if(_0x42f48f[_0x16d7('0x6')]&&!_0x42f48f[_0x16d7('0x12')]&&_0x42f48f['license']==_0x32e01c[_0x16d7('0x6')]){return _0x3e61a9;}return _0x3e61a9[_0x16d7('0x15')]({'data1':_0x38d621,'data2':null,'license':_0x32e01c[_0x16d7('0x6')]});}else{if(_0x32e01c[_0x16d7('0x6')]||_0x42f48f[_0x16d7('0x6')]){if(!_0x42f48f[_0x16d7('0x12')]){if(_0x42f48f[_0x16d7('0xf')]==_0x38d621){GRAY_PERIOD_REASON=_0x16d7('0x16');logger['info'](_0x16d7('0x17'));}else{GRAY_PERIOD_REASON=_0x16d7('0x18');logger[_0x16d7('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x42f48f[_0x16d7('0xf')],_0x38d621);}logger[_0x16d7('0x13')](_0x16d7('0x19'),GRAY_PERIOD_REASON[_0x16d7('0x1a')](),moment()['format'](_0x16d7('0x1b')));return _0x3e61a9[_0x16d7('0x15')]({'data2':encryptor[_0x16d7('0x1c')](moment()[_0x16d7('0xa')](_0x16d7('0x1b')))});}else{if(moment()[_0x16d7('0x1d')](encryptor[_0x16d7('0x1e')](_0x42f48f[_0x16d7('0x12')]),'days')>DAYS){logger[_0x16d7('0x13')](_0x16d7('0x1f'),moment()[_0x16d7('0xa')](_0x16d7('0x1b')));isOldTokenSent=![];return _0x3e61a9[_0x16d7('0x15')]({'data1':_0x38d621,'data2':null,'license':null});}}}else{if(_0x42f48f[_0x16d7('0xf')]!=_0x38d621){logger['info'](_0x16d7('0x20'),_0x42f48f[_0x16d7('0xf')],_0x38d621);return _0x3e61a9['update']({'data1':_0x38d621,'data2':null,'license':null});}}}return _0x3e61a9;})[_0x16d7('0xd')](function(_0x3a2e39){_0x3e61a9=_0x3a2e39;})[_0x16d7('0x21')](function(_0x19d7d9){logger['error'](_0x19d7d9[_0x16d7('0x22')]);})[_0x16d7('0x23')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x3e61a9);},TIME);});}function defaultLicense(){var _0x33bbb5=hardware['getUuid']();if(_0x33bbb5){return db[_0x16d7('0x24')][_0x16d7('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x33bbb5}})['spread'](function(_0xb2e5c5,_0xfcdc73){logger[_0x16d7('0x13')](_0x16d7('0x26'),_0x33bbb5);manageLicense(_0x33bbb5,_0xb2e5c5);})[_0x16d7('0x21')](function(_0x5d38c8){logger['error'](_0x5d38c8['message']);});}}exports[_0x16d7('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 52fa26a..2047696 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 _0xc0eb=['forEach','admin','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','split','decryptString','format','parse','gray','deadline','grayReason','changed','message','findAll','role','sequelize','count','user','telephone','telephones'];(function(_0x3af190,_0x5748c2){var _0x3721ab=function(_0x585904){while(--_0x585904){_0x3af190['push'](_0x3af190['shift']());}};_0x3721ab(++_0x5748c2);}(_0xc0eb,0x1b3));var _0xbc0e=function(_0x8c6eee,_0x21f601){_0x8c6eee=_0x8c6eee-0x0;var _0x5a03b5=_0xc0eb[_0x8c6eee];return _0x5a03b5;};'use strict';var util=require(_0xbc0e('0x0'));var _=require('lodash');var moment=require(_0xbc0e('0x1'));var BPromise=require(_0xbc0e('0x2'));var hardware=require(_0xbc0e('0x3'));var encryptor=require(_0xbc0e('0x4'));var db=require(_0xbc0e('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbc0e('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xbc0e('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbc0e('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1bbfd8){return new BPromise(function(_0x1e8396,_0x5468bb){return db[_0xbc0e('0x8')][_0xbc0e('0x9')](_[_0xbc0e('0xa')](_0x1bbfd8,{'raw':!![],'where':{'id':0x1}}))[_0xbc0e('0xb')](function(_0x294d5c){return checkLicense(_0x294d5c,null);})[_0xbc0e('0xb')](function(_0x2c7f21){_0x1e8396(_0x2c7f21);return;})[_0xbc0e('0xc')](function(_0x5d9ad3){_0x5468bb(_0x5d9ad3);});});}function checkLicense(_0x3e6cd7,_0x5b0af7){if(!_0x3e6cd7){demoLicense[_0xbc0e('0xd')]=_0x3e6cd7[_0xbc0e('0xe')];return demoLicense;}try{var _0x7d55f2=_0x5b0af7||_0x3e6cd7[_0xbc0e('0xf')];if(_[_0xbc0e('0x10')](_0x7d55f2)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x35f20c=_0x3e6cd7[_0xbc0e('0xe')];var _0x3d0a28=_0x3e6cd7['data2'];var _0x17bc92=_0x35f20c[_0xbc0e('0x11')]('-')[0x4];var _0x4878cb=_0x35f20c[_0xbc0e('0x11')]('-')[0x0];var _0x27a35d=encryptor[_0xbc0e('0x12')](_0x7d55f2,util[_0xbc0e('0x13')]('%s:%s:%s',_0x17bc92,_0x35f20c,_0x4878cb));var _0x4ffbb6=JSON[_0xbc0e('0x14')](_0x27a35d);_0x4ffbb6['demo']=![];_0x4ffbb6[_0xbc0e('0xd')]=_0x35f20c;_0x4ffbb6['machineUuid']=hardware['getUuid']();if(_0x3d0a28){var _0x34bd86=encryptor[_0xbc0e('0x12')](_0x3d0a28);_0x4ffbb6[_0xbc0e('0x15')]=_0x34bd86;_0x4ffbb6[_0xbc0e('0x16')]=moment(_0x34bd86)['add'](0x7,'days')[_0xbc0e('0x13')]();_0x4ffbb6[_0xbc0e('0x17')]=_0x4ffbb6[_0xbc0e('0xd')]!=_0x4ffbb6['machineUuid']?_0xbc0e('0x18'):'disabled';}return _0x4ffbb6;}catch(_0x11db2c){breakingLicense[_0xbc0e('0xd')]=_0x3e6cd7[_0xbc0e('0xe')];breakingLicense[_0xbc0e('0x19')]=_0x11db2c[_0xbc0e('0x19')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x281a17,_0xc8a994){getLicense()['then'](function(_0x5e20c2){return db['User'][_0xbc0e('0x1a')]({'attributes':[_0xbc0e('0x1b'),[db[_0xbc0e('0x1c')]['fn']('COUNT',db[_0xbc0e('0x1c')]['col'](_0xbc0e('0x1b'))),_0xbc0e('0x1d')]],'group':'role','where':{'role':{'$or':['admin',_0xbc0e('0x1e'),_0xbc0e('0x1f')]}},'raw':!![]})[_0xbc0e('0xb')](function(_0x18b17b){var _0x426b97={'user':_0x5e20c2['users']||0x0,'telephone':_0x5e20c2[_0xbc0e('0x20')]||0x0};_0x18b17b[_0xbc0e('0x21')](function(_0x2909c7){var _0x4f92c0=_0x2909c7[_0xbc0e('0x1b')]===_0xbc0e('0x22')?_0xbc0e('0x1e'):_0x2909c7['role'];_0x426b97[_0x4f92c0]-=_0x2909c7['count'];if(_0x426b97[_0x4f92c0]<0x0)_0x426b97[_0x4f92c0]=0x0;});_0x281a17(_0x426b97);return;});})[_0xbc0e('0xc')](function(_0xad8396){_0xc8a994(_0xad8396);});});}function checkUserLimits(_0x132603){return new BPromise(function(_0x102802,_0x5ea36e){getLimits()[_0xbc0e('0xb')](function(_0x32ca04){var _0x8d7c4e=_[_0xbc0e('0x23')](_[_0xbc0e('0x24')](_0x132603,_0xbc0e('0x1b')),['admin',_0xbc0e('0x1e'),_0xbc0e('0x1f')]);var _0x461d4f=(_0x8d7c4e[_0xbc0e('0x22')]||0x0)+(_0x8d7c4e[_0xbc0e('0x1e')]||0x0);var _0x1c3cb5=_0x8d7c4e[_0xbc0e('0x1f')]||0x0;if(_0x461d4f>_0x32ca04[_0xbc0e('0x1e')])return _0x5ea36e(_0xbc0e('0x25'));if(_0x1c3cb5>_0x32ca04[_0xbc0e('0x1f')])return _0x5ea36e(_0xbc0e('0x26'));return _0x102802();})['catch'](function(_0x14804a){_0x5ea36e(_0x14804a);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x9b0f=['Demo\x20license','getUuid','Breaking\x20license','then','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','demo','uuid','machineUuid','deadline','add','days','changed','disabled','role','sequelize','COUNT','col','count','admin','user','telephone','telephones','forEach','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','lodash','moment','bluebird','./hardware','2027-01-01T00:00:00.000Z'];(function(_0x35b436,_0x490050){var _0x5b3ffb=function(_0x37917a){while(--_0x37917a){_0x35b436['push'](_0x35b436['shift']());}};_0x5b3ffb(++_0x490050);}(_0x9b0f,0x1db));var _0xf9b0=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x9b0f[_0x5806c3];return _0x48ac77;};'use strict';var util=require('util');var _=require(_0xf9b0('0x0'));var moment=require(_0xf9b0('0x1'));var BPromise=require(_0xf9b0('0x2'));var hardware=require(_0xf9b0('0x3'));var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xf9b0('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xf9b0('0x5'),'machineUuid':hardware[_0xf9b0('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xf9b0('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xf9b0('0x7'),'machineUuid':hardware[_0xf9b0('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x512cde){return new BPromise(function(_0x2cdb3e,_0x44722f){return db['License']['find'](_['defaults'](_0x512cde,{'raw':!![],'where':{'id':0x1}}))[_0xf9b0('0x8')](function(_0x15a505){return checkLicense(_0x15a505,null);})[_0xf9b0('0x8')](function(_0x86234){_0x2cdb3e(_0x86234);return;})['catch'](function(_0x5780a0){_0x44722f(_0x5780a0);});});}function checkLicense(_0x4663d4,_0x45974d){if(!_0x4663d4){demoLicense['uuid']=_0x4663d4[_0xf9b0('0x9')];return demoLicense;}try{var _0x9d1372=_0x45974d||_0x4663d4[_0xf9b0('0xa')];if(_[_0xf9b0('0xb')](_0x9d1372)){throw new Error(_0xf9b0('0xc'));}var _0x59f9db=_0x4663d4[_0xf9b0('0x9')];var _0x227cad=_0x4663d4[_0xf9b0('0xd')];var _0x338d21=_0x59f9db[_0xf9b0('0xe')]('-')[0x4];var _0x3b745a=_0x59f9db['split']('-')[0x0];var _0x4c9636=encryptor[_0xf9b0('0xf')](_0x9d1372,util[_0xf9b0('0x10')]('%s:%s:%s',_0x338d21,_0x59f9db,_0x3b745a));var _0x1d9f6d=JSON[_0xf9b0('0x11')](_0x4c9636);_0x1d9f6d[_0xf9b0('0x12')]=![];_0x1d9f6d[_0xf9b0('0x13')]=_0x59f9db;_0x1d9f6d[_0xf9b0('0x14')]=hardware[_0xf9b0('0x6')]();if(_0x227cad){var _0x47cc28=encryptor[_0xf9b0('0xf')](_0x227cad);_0x1d9f6d['gray']=_0x47cc28;_0x1d9f6d[_0xf9b0('0x15')]=moment(_0x47cc28)[_0xf9b0('0x16')](0x7,_0xf9b0('0x17'))['format']();_0x1d9f6d['grayReason']=_0x1d9f6d[_0xf9b0('0x13')]!=_0x1d9f6d[_0xf9b0('0x14')]?_0xf9b0('0x18'):_0xf9b0('0x19');}return _0x1d9f6d;}catch(_0x27e20a){breakingLicense[_0xf9b0('0x13')]=_0x4663d4[_0xf9b0('0x9')];breakingLicense['message']=_0x27e20a['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4f5870,_0x44fa36){getLicense()[_0xf9b0('0x8')](function(_0x167835){return db['User']['findAll']({'attributes':[_0xf9b0('0x1a'),[db[_0xf9b0('0x1b')]['fn'](_0xf9b0('0x1c'),db[_0xf9b0('0x1b')][_0xf9b0('0x1d')]('role')),_0xf9b0('0x1e')]],'group':_0xf9b0('0x1a'),'where':{'role':{'$or':[_0xf9b0('0x1f'),_0xf9b0('0x20'),_0xf9b0('0x21')]}},'raw':!![]})['then'](function(_0x3a7789){var _0x20adbe={'user':_0x167835['users']||0x0,'telephone':_0x167835[_0xf9b0('0x22')]||0x0};_0x3a7789[_0xf9b0('0x23')](function(_0x1842b7){var _0x4cd498=_0x1842b7[_0xf9b0('0x1a')]===_0xf9b0('0x1f')?_0xf9b0('0x20'):_0x1842b7[_0xf9b0('0x1a')];_0x20adbe[_0x4cd498]-=_0x1842b7['count'];if(_0x20adbe[_0x4cd498]<0x0)_0x20adbe[_0x4cd498]=0x0;});_0x4f5870(_0x20adbe);return;});})[_0xf9b0('0x24')](function(_0x590fb4){_0x44fa36(_0x590fb4);});});}function checkUserLimits(_0x18fea8){return new BPromise(function(_0x10b3a9,_0x517192){getLimits()[_0xf9b0('0x8')](function(_0x261355){var _0x462a2e=_[_0xf9b0('0x25')](_[_0xf9b0('0x26')](_0x18fea8,_0xf9b0('0x1a')),[_0xf9b0('0x1f'),_0xf9b0('0x20'),_0xf9b0('0x21')]);var _0xd117d9=(_0x462a2e[_0xf9b0('0x1f')]||0x0)+(_0x462a2e['user']||0x0);var _0x288623=_0x462a2e[_0xf9b0('0x21')]||0x0;if(_0xd117d9>_0x261355[_0xf9b0('0x20')])return _0x517192(_0xf9b0('0x27'));if(_0x288623>_0x261355[_0xf9b0('0x21')])return _0x517192('License\x20limit\x20reached\x20for\x20telephones');return _0x10b3a9();})['catch'](function(_0x13cac7){_0x517192(_0x13cac7);});});}module['exports']={'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 5190690..cf00a02 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 _0xa30a=['http://localhost:9000','myappanuglar-secret','secret','exports'];(function(_0x1654fc,_0x2a775d){var _0x2db2eb=function(_0x55a17a){while(--_0x55a17a){_0x1654fc['push'](_0x1654fc['shift']());}};_0x2db2eb(++_0x2a775d);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';module[_0xaa30('0x0')]={'DOMAIN':_0xaa30('0x1'),'SESSION_SECRET':_0xaa30('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xaa30('0x3'),'DEBUG':''}; \ No newline at end of file +var _0xfcbb=['http://localhost:9000','myappanuglar-secret','exports'];(function(_0x1870f8,_0x34f3d4){var _0x4e1ec0=function(_0xc62064){while(--_0xc62064){_0x1870f8['push'](_0x1870f8['shift']());}};_0x4e1ec0(++_0x34f3d4);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x3a7255,_0x3b7bcc){_0x3a7255=_0x3a7255-0x0;var _0x10b992=_0xfcbb[_0x3a7255];return _0x10b992;};'use strict';module[_0xbfcb('0x0')]={'DOMAIN':_0xbfcb('0x1'),'SESSION_SECRET':_0xbfcb('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index b08afed..498a83f 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc356=['exports','../utils/loggers','fileLogger'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xc356,0x6a));var _0x6c35=function(_0x12d812,_0x496bb7){_0x12d812=_0x12d812-0x0;var _0x3711ab=_0xc356[_0x12d812];return _0x3711ab;};'use strict';var fileLogger=require(_0x6c35('0x0'))[_0x6c35('0x1')];module[_0x6c35('0x2')]=fileLogger; \ No newline at end of file +var _0x19a5=['../utils/loggers','fileLogger'];(function(_0x22f404,_0x29c386){var _0x210a54=function(_0x4e68f2){while(--_0x4e68f2){_0x22f404['push'](_0x22f404['shift']());}};_0x210a54(++_0x29c386);}(_0x19a5,0x7a));var _0x519a=function(_0x443c29,_0x4c79e6){_0x443c29=_0x443c29-0x0;var _0x4b17bd=_0x19a5[_0x443c29];return _0x4b17bd;};'use strict';var fileLogger=require(_0x519a('0x0'))[_0x519a('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 1d8b570..b13abf6 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 _0x3fb8=['../../config/environment','resolve','join','legacy-libs','express','ami','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','exports','path'];(function(_0x1895b7,_0x21fbc7){var _0x1aecdc=function(_0x44682a){while(--_0x44682a){_0x1895b7['push'](_0x1895b7['shift']());}};_0x1aecdc(++_0x21fbc7);}(_0x3fb8,0xc3));var _0x83fb=function(_0x589f05,_0x1c5a16){_0x589f05=_0x589f05-0x0;var _0x3a11b4=_0x3fb8[_0x589f05];return _0x3a11b4;};'use strict';var path=require(_0x83fb('0x0'));var cfg=require(_0x83fb('0x1'));var env={'NODE_PATH':path[_0x83fb('0x2')](path[_0x83fb('0x3')](cfg['root'],_0x83fb('0x4')))};var pm2config={'apps':[{'name':_0x83fb('0x5'),'script':path[_0x83fb('0x3')](__dirname,'../../services/express/index.js'),'env':env},{'name':_0x83fb('0x6'),'script':path[_0x83fb('0x3')](__dirname,_0x83fb('0x7')),'env':env},{'name':'agi','script':path[_0x83fb('0x3')](__dirname,_0x83fb('0x8')),'env':env},{'name':_0x83fb('0x9'),'script':path[_0x83fb('0x3')](__dirname,_0x83fb('0xa')),'env':env},{'name':'routing','script':path['join'](__dirname,_0x83fb('0xb')),'env':env},{'name':_0x83fb('0xc'),'script':path[_0x83fb('0x3')](__dirname,'../../services/xdr/index.js'),'env':env}]};module[_0x83fb('0xd')]=pm2config; \ No newline at end of file +var _0x1f91=['../../config/environment','root','legacy-libs','join','../../services/express/index.js','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/xdr/index.js','exports','path'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x1f91,0xc2));var _0x11f9=function(_0x371e4c,_0x279833){_0x371e4c=_0x371e4c-0x0;var _0x4b214c=_0x1f91[_0x371e4c];return _0x4b214c;};'use strict';var path=require(_0x11f9('0x0'));var cfg=require(_0x11f9('0x1'));var env={'NODE_PATH':path['resolve'](path['join'](cfg[_0x11f9('0x2')],_0x11f9('0x3')))};var pm2config={'apps':[{'name':'express','script':path[_0x11f9('0x4')](__dirname,_0x11f9('0x5')),'env':env},{'name':'ami','script':path[_0x11f9('0x4')](__dirname,_0x11f9('0x6')),'env':env},{'name':_0x11f9('0x7'),'script':path['join'](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x11f9('0x8'),'script':path[_0x11f9('0x4')](__dirname,_0x11f9('0x9')),'env':env},{'name':_0x11f9('0xa'),'script':path['join'](__dirname,'../../services/routing/index.js'),'env':env},{'name':'xdr','script':path[_0x11f9('0x4')](__dirname,_0x11f9('0xb')),'env':env}]};module[_0x11f9('0xc')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 8bca3b4..be2fb99 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 _0xb7e4=['dump','bluebird','./config','start','then','disconnect','restart','list','describe','delete'];(function(_0x3d6907,_0x2f08fb){var _0x2ab3aa=function(_0x5f2f01){while(--_0x5f2f01){_0x3d6907['push'](_0x3d6907['shift']());}};_0x2ab3aa(++_0x2f08fb);}(_0xb7e4,0x1e1));var _0x4b7e=function(_0x41bedb,_0x50fa19){_0x41bedb=_0x41bedb-0x0;var _0x269cb1=_0xb7e4[_0x41bedb];return _0x269cb1;};'use strict';var pm2=require('pm2');var BPromise=require(_0x4b7e('0x0'));var config=require(_0x4b7e('0x1'));function connect(){return new BPromise(function(_0x21b5f0,_0x3817d2){return pm2['connect'](function(_0x5abd34){if(_0x5abd34){return _0x3817d2(_0x5abd34);}return _0x21b5f0('connected');});});};exports[_0x4b7e('0x2')]=function(_0x4457d0){return connect()[_0x4b7e('0x3')](function(){return new BPromise(function(_0xedc030,_0x2147ec){return pm2[_0x4b7e('0x2')](_0x4457d0,function(_0x42da9b,_0x54076b){if(_0x42da9b){return _0x2147ec(_0x42da9b);}pm2['disconnect']();return _0xedc030(_0x54076b);});});});};exports['stop']=function(_0x1d0aad){return connect()[_0x4b7e('0x3')](function(){return new BPromise(function(_0x30046d,_0x122712){return pm2['stop'](_0x1d0aad,function(_0xbecdaa,_0x43eab9){if(_0xbecdaa){return _0x122712(_0xbecdaa);}pm2[_0x4b7e('0x4')]();return _0x30046d(_0x43eab9);});});});};exports[_0x4b7e('0x5')]=function(_0x3d8e5f){return connect()['then'](function(){return new BPromise(function(_0x3e2f07,_0xfa9ce9){return pm2['restart'](_0x3d8e5f,function(_0x4bb4de,_0x2d2b7c){if(_0x4bb4de){return _0xfa9ce9(_0x4bb4de);}pm2[_0x4b7e('0x4')]();return _0x3e2f07(_0x2d2b7c);});});});};exports[_0x4b7e('0x6')]=function(){return connect()['then'](function(){return new BPromise(function(_0x2dea96,_0x1c5d6c){return pm2[_0x4b7e('0x6')](function(_0x26324f,_0x1f1e11){if(_0x26324f){return _0x1c5d6c(_0x26324f);}pm2[_0x4b7e('0x4')]();return _0x2dea96(_0x1f1e11);});});});};exports['describe']=function(_0x481a64){return connect()[_0x4b7e('0x3')](function(){return new BPromise(function(_0x4739ec,_0x8460c5){return pm2[_0x4b7e('0x7')](_0x481a64,function(_0x5083b5,_0x5e5072){if(_0x5083b5){return _0x8460c5(_0x5083b5);}pm2[_0x4b7e('0x4')]();return _0x4739ec(_0x5e5072);});});});};exports['delete']=function(_0x492918){return connect()[_0x4b7e('0x3')](function(){return new BPromise(function(_0x224b2d,_0x59c42e){return pm2[_0x4b7e('0x8')](_0x492918,function(_0x550fba,_0x40e0c1){if(_0x550fba){return _0x59c42e(_0x550fba);}pm2[_0x4b7e('0x4')]();return _0x224b2d(_0x40e0c1);});});});};exports[_0x4b7e('0x9')]=function(){return connect()[_0x4b7e('0x3')](function(){return new BPromise(function(_0x38faa1,_0x476040){return pm2[_0x4b7e('0x9')](function(_0x381a76){if(_0x381a76){return _0x476040(_0x381a76);}return _0x38faa1('saved');});});});}; \ No newline at end of file +var _0x855f=['restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connected','then','disconnect','stop'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x855f,0xe3));var _0xf855=function(_0x779f77,_0xf203bb){_0x779f77=_0x779f77-0x0;var _0x28f34d=_0x855f[_0x779f77];return _0x28f34d;};'use strict';var pm2=require(_0xf855('0x0'));var BPromise=require(_0xf855('0x1'));var config=require(_0xf855('0x2'));function connect(){return new BPromise(function(_0x522fcf,_0x483a93){return pm2['connect'](function(_0xeff45d){if(_0xeff45d){return _0x483a93(_0xeff45d);}return _0x522fcf(_0xf855('0x3'));});});};exports['start']=function(_0x3db3a3){return connect()[_0xf855('0x4')](function(){return new BPromise(function(_0x5eb077,_0x433a32){return pm2['start'](_0x3db3a3,function(_0x4328b2,_0x3b6b6f){if(_0x4328b2){return _0x433a32(_0x4328b2);}pm2[_0xf855('0x5')]();return _0x5eb077(_0x3b6b6f);});});});};exports[_0xf855('0x6')]=function(_0x5ca87b){return connect()[_0xf855('0x4')](function(){return new BPromise(function(_0xf0c60,_0x39e838){return pm2[_0xf855('0x6')](_0x5ca87b,function(_0x3779eb,_0x2ab882){if(_0x3779eb){return _0x39e838(_0x3779eb);}pm2['disconnect']();return _0xf0c60(_0x2ab882);});});});};exports[_0xf855('0x7')]=function(_0xf28533){return connect()[_0xf855('0x4')](function(){return new BPromise(function(_0x378145,_0x2277bd){return pm2[_0xf855('0x7')](_0xf28533,function(_0x3beb62,_0x5b5fbb){if(_0x3beb62){return _0x2277bd(_0x3beb62);}pm2[_0xf855('0x5')]();return _0x378145(_0x5b5fbb);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x10df7d,_0x34e680){return pm2[_0xf855('0x8')](function(_0x472916,_0x1f77e6){if(_0x472916){return _0x34e680(_0x472916);}pm2[_0xf855('0x5')]();return _0x10df7d(_0x1f77e6);});});});};exports[_0xf855('0x9')]=function(_0x1c279c){return connect()[_0xf855('0x4')](function(){return new BPromise(function(_0x38a216,_0x519088){return pm2['describe'](_0x1c279c,function(_0x36ee89,_0xcde74f){if(_0x36ee89){return _0x519088(_0x36ee89);}pm2[_0xf855('0x5')]();return _0x38a216(_0xcde74f);});});});};exports[_0xf855('0xa')]=function(_0x558656){return connect()[_0xf855('0x4')](function(){return new BPromise(function(_0x5d26e6,_0x17f2f1){return pm2[_0xf855('0xa')](_0x558656,function(_0xa0c380,_0x535b61){if(_0xa0c380){return _0x17f2f1(_0xa0c380);}pm2[_0xf855('0x5')]();return _0x5d26e6(_0x535b61);});});});};exports[_0xf855('0xb')]=function(){return connect()[_0xf855('0x4')](function(){return new BPromise(function(_0x38ee58,_0x273444){return pm2[_0xf855('0xb')](function(_0x4d4350){if(_0x4d4350){return _0x273444(_0x4d4350);}return _0x38ee58(_0xf855('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index aee6c02..02df63f 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 _0x37c0=['../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','then','length','map','info','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','ioredis','../../config/environment'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0x37c0,0x183));var _0x037c=function(_0x53390f,_0x5d0db5){_0x53390f=_0x53390f-0x0;var _0x3fd55a=_0x37c0[_0x53390f];return _0x3fd55a;};'use strict';var _=require(_0x037c('0x0'));var moment=require('moment');var Redis=require(_0x037c('0x1'));var util=require('util');var config=require(_0x037c('0x2'));var db=require(_0x037c('0x3'))['db'];var logger=require(_0x037c('0x4'))(_0x037c('0x5'));config[_0x037c('0x6')]=_['defaults'](config[_0x037c('0x6')],{'host':_0x037c('0x7'),'port':0x18eb});var io=require(_0x037c('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x5693d2=0x0;var _0x12eae6=[];return db[_0x037c('0x9')][_0x037c('0xa')]({'raw':!![],'attributes':['id',_0x037c('0xb')],'where':{'id':0x1}})['then'](function(_0x1d2c20){_0x5693d2=_0x1d2c20[_0x037c('0xb')];if(_0x5693d2){return db[_0x037c('0xc')][_0x037c('0xd')]({'raw':!![],'attributes':['id',_0x037c('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x037c('0xf')](_0x1d2c20[_0x037c('0xb')],_0x037c('0x10'))}}});}else{return[];}})[_0x037c('0x11')](function(_0x37217d){if(_0x37217d&&_0x37217d[_0x037c('0x12')]){_0x12eae6=_[_0x037c('0x13')](_0x37217d||[],'id');logger[_0x037c('0x14')]('[CHAT]\x20Interactions\x20to\x20close:',_0x12eae6['join']());return db[_0x037c('0xc')][_0x037c('0x15')]({'closeReason':'system','disposition':_0x037c('0x16'),'closed':!![],'closedAt':moment()[_0x037c('0x17')](_0x037c('0x18'))},{'where':{'id':_0x12eae6}});}})[_0x037c('0x11')](function(){if(_0x12eae6&&_0x12eae6[_0x037c('0x12')]){logger['info'](_0x037c('0x19'),_0x12eae6['join']());for(var _0x26bf5d=0x0;_0x26bf5d<_0x12eae6[_0x037c('0x12')];_0x26bf5d++){io[_0x037c('0x1a')](_0x037c('0x1b'),{'id':_0x12eae6[_0x26bf5d],'closed':!![]});}}})['catch'](function(_0x4ca3b3){logger['error'](_0x037c('0x1c'),_0x4ca3b3?util['inspect'](_0x4ca3b3,{'showHidden':![],'depth':null}):'');});}exports[_0x037c('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xf094=['map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','localhost','Setting','then','chatTimeout','ChatInteraction','lastMsgAt','minutes','length'];(function(_0x305f11,_0x26c4a6){var _0x14004c=function(_0x57ae06){while(--_0x57ae06){_0x305f11['push'](_0x305f11['shift']());}};_0x14004c(++_0x26c4a6);}(_0xf094,0xec));var _0x4f09=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0xf094[_0x3afe18];return _0x19ed1f;};'use strict';var _=require(_0x4f09('0x0'));var moment=require(_0x4f09('0x1'));var Redis=require(_0x4f09('0x2'));var util=require(_0x4f09('0x3'));var config=require(_0x4f09('0x4'));var db=require(_0x4f09('0x5'))['db'];var logger=require(_0x4f09('0x6'))('schedule');config[_0x4f09('0x7')]=_['defaults'](config['redis'],{'host':_0x4f09('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4f09('0x7')]));function closeInteractions(){var _0x22048e=0x0;var _0x1996c9=[];return db[_0x4f09('0x9')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x4f09('0xa')](function(_0x3cac6a){_0x22048e=_0x3cac6a[_0x4f09('0xb')];if(_0x22048e){return db[_0x4f09('0xc')]['findAll']({'raw':!![],'attributes':['id',_0x4f09('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x3cac6a['chatTimeout'],_0x4f09('0xe'))}}});}else{return[];}})['then'](function(_0x42a079){if(_0x42a079&&_0x42a079[_0x4f09('0xf')]){_0x1996c9=_[_0x4f09('0x10')](_0x42a079||[],'id');logger[_0x4f09('0x11')](_0x4f09('0x12'),_0x1996c9[_0x4f09('0x13')]());return db[_0x4f09('0xc')][_0x4f09('0x14')]({'closeReason':'system','disposition':_0x4f09('0x15'),'closed':!![],'closedAt':moment()['format'](_0x4f09('0x16'))},{'where':{'id':_0x1996c9}});}})[_0x4f09('0xa')](function(){if(_0x1996c9&&_0x1996c9[_0x4f09('0xf')]){logger[_0x4f09('0x11')](_0x4f09('0x17'),_0x1996c9[_0x4f09('0x13')]());for(var _0x44f1c8=0x0;_0x44f1c8<_0x1996c9[_0x4f09('0xf')];_0x44f1c8++){io['emit'](_0x4f09('0x18'),{'id':_0x1996c9[_0x44f1c8],'closed':!![]});}}})[_0x4f09('0x19')](function(_0xafa17c){logger[_0x4f09('0x1a')]('[CHAT]\x20Error\x20closing\x20interactions',_0xafa17c?util['inspect'](_0xafa17c,{'showHidden':![],'depth':null}):'');});}exports[_0x4f09('0x1b')]=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 be73e0c..5ee9ff8 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 _0x6ce5=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x3ab593,_0x47a446){var _0x2eca2b=function(_0xb2f6ee){while(--_0xb2f6ee){_0x3ab593['push'](_0x3ab593['shift']());}};_0x2eca2b(++_0x47a446);}(_0x6ce5,0xf2));var _0x56ce=function(_0x1c642b,_0x1bc26d){_0x1c642b=_0x1c642b-0x0;var _0x54b32f=_0x6ce5[_0x1c642b];return _0x54b32f;};'use strict';function start(){var _0x5ccd17=require(_0x56ce('0x0'));return _0x5ccd17[_0x56ce('0x1')]();}module[_0x56ce('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x689a=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x3901ec,_0x13deae){var _0x10f9c2=function(_0x58afda){while(--_0x58afda){_0x3901ec['push'](_0x3901ec['shift']());}};_0x10f9c2(++_0x13deae);}(_0x689a,0x107));var _0xa689=function(_0x4a4bc1,_0x742646){_0x4a4bc1=_0x4a4bc1-0x0;var _0x924cda=_0x689a[_0x4a4bc1];return _0x924cda;};'use strict';function start(){var _0x562ea4=require(_0xa689('0x0'));return _0x562ea4['startAllRefreshIntervals']();}module[_0xa689('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index ebe258b..b6f935e 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 _0xcf21=['start','add\x20cron','deleteJob','stop\x20cron','active','update','update\x20cron','run','util','path','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','name','Smtp','user','bcc','subtractNumber','join','../../files/reports','savename','zip','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error\x20mail','stringify','email\x20sent','error','data','isNil','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','findAll','CloudProvider','keys','jobs','map','keyBy','difference','intersection','length','toString','exists','stop','delete\x20cron','toRun','index','resolve','run\x20job','cron','isBetween','startAt','endAt'];(function(_0x478fb2,_0x15014d){var _0x32481b=function(_0x1c777d){while(--_0x1c777d){_0x478fb2['push'](_0x478fb2['shift']());}};_0x32481b(++_0x15014d);}(_0xcf21,0x168));var _0x1cf2=function(_0x488f95,_0xc7de54){_0x488f95=_0x488f95-0x0;var _0x5a38e0=_0xcf21[_0x488f95];return _0x5a38e0;};'use strict';var fs=require('fs');var util=require(_0x1cf2('0x0'));var path=require(_0x1cf2('0x1'));var _=require('lodash');var moment=require(_0x1cf2('0x2'));var CronJobManager=require(_0x1cf2('0x3'));var jayson=require(_0x1cf2('0x4'));var BPromise=require(_0x1cf2('0x5'));var logger=require(_0x1cf2('0x6'))(_0x1cf2('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x1cf2('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0x1cf2('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x16b203,_0x323647){return function(){logger[_0x1cf2('0xa')](_0x1cf2('0xb'),_0x16b203[_0x1cf2('0xc')]);var _0x5a65a0=!![];var _0x49a84a=_0x16b203['MailAccount'][_0x1cf2('0xd')]();var _0x507c28={'account':_0x49a84a,'message':{'from':util[_0x1cf2('0xe')](_0x1cf2('0xf'),_0x16b203[_0x1cf2('0x10')][_0x1cf2('0x11')],_0x16b203[_0x1cf2('0x10')]['email']||_0x16b203[_0x1cf2('0x10')][_0x1cf2('0x12')][_0x1cf2('0x13')]),'to':_0x16b203[_0x1cf2('0xc')],'cc':_0x16b203['cc'],'bcc':_0x16b203[_0x1cf2('0x14')],'subject':util[_0x1cf2('0xe')]('Report\x20%s\x20last\x20%s\x20%s',_0x323647[_0x1cf2('0x11')],_0x16b203[_0x1cf2('0x15')],_0x16b203['subtractUnit'])}};var _0x585a5e=path[_0x1cf2('0x16')](__dirname,_0x1cf2('0x17'));var _0x413685=_0x323647[_0x1cf2('0x18')];var _0x27c1f1=util['format']('%s.%s',path['basename'](_0x323647[_0x1cf2('0x18')],path['extname'](_0x323647[_0x1cf2('0x18')])),_0x1cf2('0x19'));var _0x35fa63=path[_0x1cf2('0x16')](_0x585a5e,_0x413685);var _0x480c1f=path['join'](_0x585a5e,_0x27c1f1);if(fs[_0x1cf2('0x1a')](_0x35fa63)){_0x323647[_0x1cf2('0x1b')]=_0x1cf2('0x1c');_0x507c28[_0x1cf2('0x1d')]['attachments']=[{'filename':_0x413685,'path':_0x35fa63}];_0x507c28[_0x1cf2('0x1d')][_0x1cf2('0x1e')]=util[_0x1cf2('0xe')](_0x1cf2('0x1f'),JSON['stringify'](_0x323647,null,0x2));}else if(fs[_0x1cf2('0x1a')](_0x480c1f)){_0x323647[_0x1cf2('0x1b')]=_0x1cf2('0x1c');_0x507c28['message'][_0x1cf2('0x20')]=[{'filename':_0x27c1f1,'path':_0x480c1f}];}else{_0x507c28[_0x1cf2('0x1d')][_0x1cf2('0x1e')]=_0x1cf2('0x21');if(!_0x16b203[_0x1cf2('0x22')]){_0x5a65a0=![];logger[_0x1cf2('0xa')](_0x1cf2('0x23'));}}if(_0x5a65a0){return client[_0x1cf2('0x24')](_0x1cf2('0x25'),_0x507c28)[_0x1cf2('0x26')](function(_0x3c83a5){if(_0x3c83a5['error']){return logger['error'](_0x1cf2('0x27'),JSON[_0x1cf2('0x28')](_0x3c83a5));}return logger['info'](_0x1cf2('0x29'));})['catch'](function(_0x3a8af5){return logger[_0x1cf2('0x2a')]('error\x20mail',JSON['stringify'](_0x3a8af5));});}};}function handleError(){return function(_0x2e9e49){return logger[_0x1cf2('0x2a')](JSON[_0x1cf2('0x28')](_0x2e9e49));};}function handleResult(_0x3ecb5f){return function(_0xbf361e){logger['info'](_0x1cf2('0x2b'),JSON[_0x1cf2('0x28')](_0xbf361e));if(_0x3ecb5f['MailAccount']&&_0x3ecb5f['MailAccount'][_0x1cf2('0x12')]&&!_[_0x1cf2('0x2c')](_0x3ecb5f[_0x1cf2('0xc')])){setTimeout(handleSendEmail(_0x3ecb5f,_0xbf361e),0x3c*0x3e8);}};}function handleJob(_0x2af698){return function(){try{if(_[_0x1cf2('0x2c')](_0x2af698[_0x1cf2('0x15')])){return logger[_0x1cf2('0xa')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x1cf2('0x2c')](_0x2af698[_0x1cf2('0x2d')])){return logger[_0x1cf2('0xa')](_0x1cf2('0x2e'));}var _0x8513df={'startDate':moment()[_0x1cf2('0x2f')](_0x2af698[_0x1cf2('0x15')],_0x2af698[_0x1cf2('0x2d')])['format'](_0x1cf2('0x30')),'endDate':moment()[_0x1cf2('0xe')](_0x1cf2('0x30')),'type':_0x1cf2('0x31'),'output':_0x2af698[_0x1cf2('0x32')],'name':_0x2af698['name']};if(!_[_0x1cf2('0x2c')](_0x2af698['DefaultReportId'])){logger[_0x1cf2('0xa')](_0x1cf2('0x33'),_0x2af698[_0x1cf2('0x34')]);return analyticDefaultReportController['runReport']({'id':_0x2af698[_0x1cf2('0x34')]},_0x8513df)[_0x1cf2('0x26')](handleResult(_0x2af698))[_0x1cf2('0x35')](handleError());}if(!_[_0x1cf2('0x2c')](_0x2af698[_0x1cf2('0x36')])){logger['info'](_0x1cf2('0x37'),_0x2af698[_0x1cf2('0x36')]);return analyticCustomReportController[_0x1cf2('0x38')]({'id':_0x2af698[_0x1cf2('0x36')]},_0x8513df)[_0x1cf2('0x26')](handleResult(_0x2af698))[_0x1cf2('0x35')](handleError());}}catch(_0x47f417){logger['error'](JSON[_0x1cf2('0x28')](_0x47f417));}return logger[_0x1cf2('0xa')](_0x1cf2('0x39'));};}function getJobs(_0x59767e){var _0x3afec4={};if(_0x59767e){_0x3afec4['id']=_0x59767e;}return db[_0x1cf2('0x3a')][_0x1cf2('0x3b')]({'where':_0x3afec4,'include':[{'model':db[_0x1cf2('0x10')],'attributes':['id','name',_0x1cf2('0xc')],'include':[{'model':db['MailServerOut'],'as':_0x1cf2('0x12'),'include':[{'model':db[_0x1cf2('0x3c')],'as':_0x1cf2('0x3c')}]}]}]})['then'](function(_0x3b9915){var _0x54aa07=_[_0x1cf2('0x3d')](manager[_0x1cf2('0x3e')]);var _0x49dac0=_[_0x1cf2('0x3f')](_0x3b9915,function(_0x4a7513){return _0x4a7513['id']['toString']();});var _0x421ca5=_[_0x1cf2('0x40')](_0x3b9915,function(_0x44dcd9){return _0x44dcd9['id']['toString']();});var _0x4180dd=_0x59767e?_0x49dac0:_[_0x1cf2('0x41')](_0x49dac0,_0x54aa07);var _0x42bfbc=_[_0x1cf2('0x42')](_0x49dac0,_0x54aa07);var _0x1a30f7=_[_0x1cf2('0x41')](_0x54aa07,_0x49dac0);var _0x43ca6c;var _0x3caf32;for(_0x43ca6c=0x0;_0x43ca6c<_0x1a30f7[_0x1cf2('0x43')]&&!_0x59767e;_0x43ca6c+=0x1){_0x3caf32=_0x1a30f7[_0x43ca6c][_0x1cf2('0x44')]();if(manager[_0x1cf2('0x45')](_0x3caf32)){manager[_0x1cf2('0x46')](_0x3caf32);manager['deleteJob'](_0x3caf32);logger[_0x1cf2('0xa')](_0x1cf2('0x47'),_0x3caf32);}}logger[_0x1cf2('0xa')](_0x1cf2('0x48'),JSON['stringify'](_0x4180dd));for(_0x43ca6c=0x0;_0x43ca6c<_0x4180dd[_0x1cf2('0x43')];_0x43ca6c+=0x1){_0x3caf32=_0x4180dd[_0x43ca6c][_0x1cf2('0x44')]();logger[_0x1cf2('0xa')](_0x1cf2('0x49'),_0x3caf32);if(_0x59767e){logger[_0x1cf2('0xa')]('my\x20id',_0x59767e);logger[_0x1cf2('0xa')](JSON['stringify'](_0x421ca5[_0x3caf32]));BPromise[_0x1cf2('0x4a')]()[_0x1cf2('0x26')](handleJob(_0x421ca5[_0x3caf32]));logger['info'](_0x1cf2('0x4b'),_0x421ca5[_0x3caf32][_0x1cf2('0x11')],_0x421ca5[_0x3caf32][_0x1cf2('0x4c')]);}else if(_0x421ca5[_0x3caf32]['cron']&&_0x421ca5[_0x3caf32]['active']&&moment()[_0x1cf2('0x4d')](_0x421ca5[_0x3caf32][_0x1cf2('0x4e')],_0x421ca5[_0x3caf32][_0x1cf2('0x4f')])){manager['add'](_0x3caf32,_0x421ca5[_0x3caf32]['cron'],handleJob(_0x421ca5[_0x3caf32]));manager[_0x1cf2('0x50')](_0x3caf32);logger[_0x1cf2('0xa')](_0x1cf2('0x51'),_0x421ca5[_0x3caf32][_0x1cf2('0x11')],_0x421ca5[_0x3caf32][_0x1cf2('0x4c')]);}else if(manager[_0x1cf2('0x45')](_0x3caf32)){manager[_0x1cf2('0x46')](_0x3caf32);manager[_0x1cf2('0x52')](_0x3caf32);logger[_0x1cf2('0xa')](_0x1cf2('0x53'),_0x421ca5[_0x3caf32][_0x1cf2('0x11')],_0x421ca5[_0x3caf32][_0x1cf2('0x4c')]);}}for(_0x43ca6c=0x0,_0x3caf32;_0x43ca6c<_0x42bfbc[_0x1cf2('0x43')]&&!_0x59767e;_0x43ca6c+=0x1){_0x3caf32=_0x42bfbc[_0x43ca6c][_0x1cf2('0x44')]();if(manager[_0x1cf2('0x45')](_0x3caf32)){if(_0x421ca5[_0x3caf32][_0x1cf2('0x4c')]&&_0x421ca5[_0x3caf32][_0x1cf2('0x54')]&&moment()['isBetween'](_0x421ca5[_0x3caf32][_0x1cf2('0x4e')],_0x421ca5[_0x3caf32][_0x1cf2('0x4f')])){manager[_0x1cf2('0x55')](_0x3caf32,_0x421ca5[_0x3caf32][_0x1cf2('0x4c')],handleJob(_0x421ca5[_0x3caf32]));logger['info'](_0x1cf2('0x56'),_0x421ca5[_0x3caf32][_0x1cf2('0x11')],_0x421ca5[_0x3caf32][_0x1cf2('0x4c')]);}else{manager[_0x1cf2('0x46')](_0x3caf32);manager[_0x1cf2('0x52')](_0x3caf32);logger[_0x1cf2('0xa')](_0x1cf2('0x53'),_0x421ca5[_0x3caf32]['name'],_0x421ca5[_0x3caf32][_0x1cf2('0x4c')]);}}}})[_0x1cf2('0x35')](function(_0x9b5044){logger['error'](JSON[_0x1cf2('0x28')](_0x9b5044));});}exports[_0x1cf2('0x57')]=function(_0x4f440d){return getJobs(_0x4f440d);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xdc2b=['moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','savename','basename','extname','zip','join','existsSync','Sent','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','SendMail','then','error','error\x20mail','email\x20sent','catch','stringify','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','jobs','map','toString','keyBy','difference','intersection','exists','deleteJob','toRun','length','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','start','add\x20cron','stop','endAt','update','update\x20cron','run','path'];(function(_0x1b8beb,_0x3c0253){var _0xab297f=function(_0x144981){while(--_0x144981){_0x1b8beb['push'](_0x1b8beb['shift']());}};_0xab297f(++_0x3c0253);}(_0xdc2b,0xf8));var _0xbdc2=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xdc2b[_0x1d24eb];return _0x1dc576;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xbdc2('0x0'));var _=require('lodash');var moment=require(_0xbdc2('0x1'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xbdc2('0x2'));var BPromise=require(_0xbdc2('0x3'));var logger=require(_0xbdc2('0x4'))(_0xbdc2('0x5'));var db=require(_0xbdc2('0x6'))['db'];var analyticCustomReportController=require(_0xbdc2('0x7'));var analyticDefaultReportController=require(_0xbdc2('0x8'));var client=jayson[_0xbdc2('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2a37a0,_0x18d19e){return function(){logger[_0xbdc2('0xa')](_0xbdc2('0xb'),_0x2a37a0['email']);var _0x3c8c07=!![];var _0xed4ee8=_0x2a37a0[_0xbdc2('0xc')][_0xbdc2('0xd')]();var _0x21f327={'account':_0xed4ee8,'message':{'from':util[_0xbdc2('0xe')](_0xbdc2('0xf'),_0x2a37a0[_0xbdc2('0xc')][_0xbdc2('0x10')],_0x2a37a0[_0xbdc2('0xc')]['email']||_0x2a37a0['MailAccount'][_0xbdc2('0x11')]['user']),'to':_0x2a37a0[_0xbdc2('0x12')],'cc':_0x2a37a0['cc'],'bcc':_0x2a37a0[_0xbdc2('0x13')],'subject':util['format'](_0xbdc2('0x14'),_0x18d19e[_0xbdc2('0x10')],_0x2a37a0[_0xbdc2('0x15')],_0x2a37a0[_0xbdc2('0x16')])}};var _0x388dea=path['join'](__dirname,'../../files/reports');var _0x26f665=_0x18d19e[_0xbdc2('0x17')];var _0x3fcc72=util[_0xbdc2('0xe')]('%s.%s',path[_0xbdc2('0x18')](_0x18d19e[_0xbdc2('0x17')],path[_0xbdc2('0x19')](_0x18d19e[_0xbdc2('0x17')])),_0xbdc2('0x1a'));var _0x19a40b=path[_0xbdc2('0x1b')](_0x388dea,_0x26f665);var _0x5a958c=path['join'](_0x388dea,_0x3fcc72);if(fs[_0xbdc2('0x1c')](_0x19a40b)){_0x18d19e['status']=_0xbdc2('0x1d');_0x21f327[_0xbdc2('0x1e')][_0xbdc2('0x1f')]=[{'filename':_0x26f665,'path':_0x19a40b}];_0x21f327['message']['text']=util[_0xbdc2('0xe')](_0xbdc2('0x20'),JSON['stringify'](_0x18d19e,null,0x2));}else if(fs[_0xbdc2('0x1c')](_0x5a958c)){_0x18d19e[_0xbdc2('0x21')]=_0xbdc2('0x1d');_0x21f327[_0xbdc2('0x1e')]['attachments']=[{'filename':_0x3fcc72,'path':_0x5a958c}];}else{_0x21f327[_0xbdc2('0x1e')]['text']=_0xbdc2('0x22');if(!_0x2a37a0[_0xbdc2('0x23')]){_0x3c8c07=![];logger[_0xbdc2('0xa')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x3c8c07){return client['request'](_0xbdc2('0x24'),_0x21f327)[_0xbdc2('0x25')](function(_0xadfe2e){if(_0xadfe2e[_0xbdc2('0x26')]){return logger['error'](_0xbdc2('0x27'),JSON['stringify'](_0xadfe2e));}return logger[_0xbdc2('0xa')](_0xbdc2('0x28'));})[_0xbdc2('0x29')](function(_0xd79c94){return logger['error'](_0xbdc2('0x27'),JSON['stringify'](_0xd79c94));});}};}function handleError(){return function(_0x511fd8){return logger[_0xbdc2('0x26')](JSON[_0xbdc2('0x2a')](_0x511fd8));};}function handleResult(_0x41037d){return function(_0x2fc03b){logger[_0xbdc2('0xa')]('data',JSON[_0xbdc2('0x2a')](_0x2fc03b));if(_0x41037d[_0xbdc2('0xc')]&&_0x41037d[_0xbdc2('0xc')][_0xbdc2('0x11')]&&!_['isNil'](_0x41037d[_0xbdc2('0x12')])){setTimeout(handleSendEmail(_0x41037d,_0x2fc03b),0x3c*0x3e8);}};}function handleJob(_0x5455c9){return function(){try{if(_[_0xbdc2('0x2b')](_0x5455c9[_0xbdc2('0x15')])){return logger[_0xbdc2('0xa')](_0xbdc2('0x2c'));}if(_[_0xbdc2('0x2b')](_0x5455c9[_0xbdc2('0x16')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0xe061b9={'startDate':moment()[_0xbdc2('0x2d')](_0x5455c9[_0xbdc2('0x15')],_0x5455c9[_0xbdc2('0x16')])[_0xbdc2('0xe')](_0xbdc2('0x2e')),'endDate':moment()[_0xbdc2('0xe')](_0xbdc2('0x2e')),'type':_0xbdc2('0x2f'),'output':_0x5455c9[_0xbdc2('0x30')],'name':_0x5455c9['name']};if(!_[_0xbdc2('0x2b')](_0x5455c9['DefaultReportId'])){logger[_0xbdc2('0xa')](_0xbdc2('0x31'),_0x5455c9['DefaultReportId']);return analyticDefaultReportController[_0xbdc2('0x32')]({'id':_0x5455c9[_0xbdc2('0x33')]},_0xe061b9)[_0xbdc2('0x25')](handleResult(_0x5455c9))[_0xbdc2('0x29')](handleError());}if(!_['isNil'](_0x5455c9['CustomReportId'])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x5455c9[_0xbdc2('0x34')]);return analyticCustomReportController['runReport']({'id':_0x5455c9[_0xbdc2('0x34')]},_0xe061b9)[_0xbdc2('0x25')](handleResult(_0x5455c9))['catch'](handleError());}}catch(_0x2e4e69){logger[_0xbdc2('0x26')](JSON[_0xbdc2('0x2a')](_0x2e4e69));}return logger[_0xbdc2('0xa')](_0xbdc2('0x35'));};}function getJobs(_0x44a901){var _0x1706d7={};if(_0x44a901){_0x1706d7['id']=_0x44a901;}return db[_0xbdc2('0x36')][_0xbdc2('0x37')]({'where':_0x1706d7,'include':[{'model':db[_0xbdc2('0xc')],'attributes':['id',_0xbdc2('0x10'),_0xbdc2('0x12')],'include':[{'model':db[_0xbdc2('0x38')],'as':_0xbdc2('0x11'),'include':[{'model':db[_0xbdc2('0x39')],'as':_0xbdc2('0x39')}]}]}]})[_0xbdc2('0x25')](function(_0x478dab){var _0x218fac=_['keys'](manager[_0xbdc2('0x3a')]);var _0x5a6c67=_[_0xbdc2('0x3b')](_0x478dab,function(_0x1c41e7){return _0x1c41e7['id'][_0xbdc2('0x3c')]();});var _0x1f67a2=_[_0xbdc2('0x3d')](_0x478dab,function(_0x24a31b){return _0x24a31b['id'][_0xbdc2('0x3c')]();});var _0x50b48d=_0x44a901?_0x5a6c67:_[_0xbdc2('0x3e')](_0x5a6c67,_0x218fac);var _0x2f2d38=_[_0xbdc2('0x3f')](_0x5a6c67,_0x218fac);var _0x53a409=_[_0xbdc2('0x3e')](_0x218fac,_0x5a6c67);var _0x2088b8;var _0x31b5d4;for(_0x2088b8=0x0;_0x2088b8<_0x53a409['length']&&!_0x44a901;_0x2088b8+=0x1){_0x31b5d4=_0x53a409[_0x2088b8]['toString']();if(manager[_0xbdc2('0x40')](_0x31b5d4)){manager['stop'](_0x31b5d4);manager[_0xbdc2('0x41')](_0x31b5d4);logger[_0xbdc2('0xa')]('delete\x20cron',_0x31b5d4);}}logger[_0xbdc2('0xa')](_0xbdc2('0x42'),JSON[_0xbdc2('0x2a')](_0x50b48d));for(_0x2088b8=0x0;_0x2088b8<_0x50b48d[_0xbdc2('0x43')];_0x2088b8+=0x1){_0x31b5d4=_0x50b48d[_0x2088b8][_0xbdc2('0x3c')]();logger['info'](_0xbdc2('0x44'),_0x31b5d4);if(_0x44a901){logger['info'](_0xbdc2('0x45'),_0x44a901);logger[_0xbdc2('0xa')](JSON[_0xbdc2('0x2a')](_0x1f67a2[_0x31b5d4]));BPromise[_0xbdc2('0x46')]()[_0xbdc2('0x25')](handleJob(_0x1f67a2[_0x31b5d4]));logger[_0xbdc2('0xa')](_0xbdc2('0x47'),_0x1f67a2[_0x31b5d4][_0xbdc2('0x10')],_0x1f67a2[_0x31b5d4]['cron']);}else if(_0x1f67a2[_0x31b5d4][_0xbdc2('0x48')]&&_0x1f67a2[_0x31b5d4][_0xbdc2('0x49')]&&moment()[_0xbdc2('0x4a')](_0x1f67a2[_0x31b5d4][_0xbdc2('0x4b')],_0x1f67a2[_0x31b5d4]['endAt'])){manager['add'](_0x31b5d4,_0x1f67a2[_0x31b5d4]['cron'],handleJob(_0x1f67a2[_0x31b5d4]));manager[_0xbdc2('0x4c')](_0x31b5d4);logger['info'](_0xbdc2('0x4d'),_0x1f67a2[_0x31b5d4]['name'],_0x1f67a2[_0x31b5d4][_0xbdc2('0x48')]);}else if(manager[_0xbdc2('0x40')](_0x31b5d4)){manager[_0xbdc2('0x4e')](_0x31b5d4);manager['deleteJob'](_0x31b5d4);logger[_0xbdc2('0xa')]('stop\x20cron',_0x1f67a2[_0x31b5d4][_0xbdc2('0x10')],_0x1f67a2[_0x31b5d4][_0xbdc2('0x48')]);}}for(_0x2088b8=0x0,_0x31b5d4;_0x2088b8<_0x2f2d38[_0xbdc2('0x43')]&&!_0x44a901;_0x2088b8+=0x1){_0x31b5d4=_0x2f2d38[_0x2088b8]['toString']();if(manager[_0xbdc2('0x40')](_0x31b5d4)){if(_0x1f67a2[_0x31b5d4][_0xbdc2('0x48')]&&_0x1f67a2[_0x31b5d4][_0xbdc2('0x49')]&&moment()[_0xbdc2('0x4a')](_0x1f67a2[_0x31b5d4][_0xbdc2('0x4b')],_0x1f67a2[_0x31b5d4][_0xbdc2('0x4f')])){manager[_0xbdc2('0x50')](_0x31b5d4,_0x1f67a2[_0x31b5d4][_0xbdc2('0x48')],handleJob(_0x1f67a2[_0x31b5d4]));logger[_0xbdc2('0xa')](_0xbdc2('0x51'),_0x1f67a2[_0x31b5d4][_0xbdc2('0x10')],_0x1f67a2[_0x31b5d4][_0xbdc2('0x48')]);}else{manager[_0xbdc2('0x4e')](_0x31b5d4);manager[_0xbdc2('0x41')](_0x31b5d4);logger['info']('stop\x20cron',_0x1f67a2[_0x31b5d4][_0xbdc2('0x10')],_0x1f67a2[_0x31b5d4][_0xbdc2('0x48')]);}}}})[_0xbdc2('0x29')](function(_0x2ef0d3){logger['error'](JSON[_0xbdc2('0x2a')](_0x2ef0d3));});}exports[_0xbdc2('0x52')]=function(_0x2770ba){return getJobs(_0x2770ba);};exports[_0xbdc2('0x4c')]=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 e6301c2..c983689 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 _0xbefe=['aws-sdk','util','bluebird','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','Comprehend','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','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','bucket','ValidationError','Transcript\x20not\x20available','CloudProvider','sentimentAccountId','Sequelize','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','findOne','update','Positive','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','push','all','error','inspect','start'];(function(_0x285c37,_0x3ebb43){var _0x1828da=function(_0x101264){while(--_0x101264){_0x285c37['push'](_0x285c37['shift']());}};_0x1828da(++_0x3ebb43);}(_0xbefe,0x168));var _0xebef=function(_0x27b1da,_0xc8abcf){_0x27b1da=_0x27b1da-0x0;var _0x27f050=_0xbefe[_0x27b1da];return _0x27f050;};var _=require('lodash');var AWS=require(_0xebef('0x0'));var rp=require('request-promise');var util=require(_0xebef('0x1'));var BPromise=require(_0xebef('0x2'));var db=require(_0xebef('0x3'))['db'];var logger=require(_0xebef('0x4'))(_0xebef('0x5'));function getTranscriptionJob(_0xed872a,_0x33b5a7,_0x2e79b7,_0x563623){return new Promise(function(_0x3fe404,_0x39de80){var _0x3e89ca=new AWS['TranscribeService']({'accessKeyId':_0x33b5a7,'secretAccessKey':_0xed872a,'region':_0x2e79b7});_0x3e89ca[_0xebef('0x6')]({'TranscriptionJobName':_0x563623},function(_0x2fbd2c,_0x598d6d){if(_0x2fbd2c){return _0x39de80(_0x2fbd2c);}else{return _0x3fe404(_0x598d6d);}});});}function sentiment(_0x4d28bb,_0x28bce0,_0xa0a8ef,_0x187f3b,_0x12f30c){return new Promise(function(_0x37ef55,_0x2b08a1){var _0x37143a=new AWS[(_0xebef('0x7'))]({'accessKeyId':_0x28bce0,'secretAccessKey':_0x4d28bb,'region':_0xa0a8ef});_0x37143a['detectSentiment']({'Text':_0x187f3b,'LanguageCode':_0x12f30c[_0xebef('0x8')](0x0,0x2)},function(_0x3c1c66,_0x3cdc08){if(_0x3c1c66){return _0x2b08a1(_0x3c1c66);}else{return _0x37ef55(_0x3cdc08);}});});}function checkTranscribeJob(_0x3c79e0,_0x1dcae4,_0x566dbe){var _0x584ac2;return new BPromise(function(_0x5dd833,_0x501665){logger[_0xebef('0x9')](util[_0xebef('0xa')](_0xebef('0xb'),_0x3c79e0['id'],_0x3c79e0[_0xebef('0xc')]));return getTranscriptionJob(_0x566dbe[_0xebef('0xd')],_0x566dbe[_0xebef('0xe')],_0x1dcae4['transcribeRegion'],_0x3c79e0[_0xebef('0xc')])[_0xebef('0xf')](function(_0x1921aa){logger[_0xebef('0x9')](util[_0xebef('0xa')](_0xebef('0x10'),_0x3c79e0['id'],_0x3c79e0[_0xebef('0xc')],_0x1921aa[_0xebef('0x11')][_0xebef('0x12')]));if(!_0x3c79e0[_0xebef('0x13')]){switch(_0x1921aa[_0xebef('0x11')]['TranscriptionJobStatus']){case _0xebef('0x14'):var _0x226c8e={'transcribeStatus':_0x1921aa[_0xebef('0x11')]['TranscriptionJobStatus'],'fileUri':_0x1921aa[_0xebef('0x11')][_0xebef('0x15')][_0xebef('0x16')]};logger[_0xebef('0x9')](util[_0xebef('0xa')](_0xebef('0x17'),_0x3c79e0['id']));return rp({'uri':_0x1921aa[_0xebef('0x11')]['Transcript']['TranscriptFileUri'],'json':!![]})['then'](function(_0x59e078){logger[_0xebef('0x9')](util[_0xebef('0xa')](_0xebef('0x18'),_0x3c79e0['id']));if(_0x59e078&&_0x59e078[_0xebef('0x19')]&&_0x59e078[_0xebef('0x19')][_0xebef('0x1a')]&&_0x59e078['results'][_0xebef('0x1a')][_0xebef('0x1b')]){_0x226c8e[_0xebef('0x13')]='';for(var _0x2506eb=0x0;_0x2506eb<_0x59e078[_0xebef('0x19')][_0xebef('0x1a')][_0xebef('0x1b')];_0x2506eb++){_0x226c8e[_0xebef('0x13')]+=_0x59e078[_0xebef('0x19')][_0xebef('0x1a')][_0x2506eb][_0xebef('0x1c')]+'';}}return _0x3c79e0['update'](_0x226c8e);})[_0xebef('0xf')](function(){logger['info'](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3c79e0['id']));if(!_0x3c79e0['tempSentiment']){throw new db['Sequelize']['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1dcae4['sentiment']||!_0x1dcae4['sentimentAccountId']||!_0x1dcae4['sentimentRegion']||!_0x1dcae4['language']||!_0x1dcae4[_0xebef('0x1d')]){throw new db['Sequelize'][(_0xebef('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x226c8e[_0xebef('0x13')]){throw new Error(_0xebef('0x1f'));}if(_0x1dcae4['sentimentAccountId']===_0x566dbe['id']){return _0x566dbe;}else{return db[_0xebef('0x20')]['findOne']({'where':{'id':_settings[_0xebef('0x21')]}});}})[_0xebef('0xf')](function(_0x1ef774){if(!_0x1ef774){throw new db[(_0xebef('0x22'))][(_0xebef('0x1e'))](_0xebef('0x23'));}if(!_0x1ef774['data1']||!_0x1ef774[_0xebef('0xe')]){throw new db['Sequelize'][(_0xebef('0x1e'))](_0xebef('0x24'));}_0x584ac2=_0x1ef774;logger[_0xebef('0x9')](util[_0xebef('0xa')](_0xebef('0x25'),_0x3c79e0['id']));return sentiment(_0x584ac2[_0xebef('0xd')],_0x584ac2[_0xebef('0xe')],_0x1dcae4['sentimentRegion'],_0x226c8e[_0xebef('0x13')],_0x1dcae4[_0xebef('0x26')]);})[_0xebef('0xf')](function(_0x307592){logger[_0xebef('0x9')](util[_0xebef('0xa')](_0xebef('0x27'),_0x3c79e0['id']));return _0x3c79e0['update']({'sentiment':_0x307592[_0xebef('0x28')],'sPositive':_0x307592[_0xebef('0x29')]['Positive'],'sNegative':_0x307592[_0xebef('0x29')][_0xebef('0x2a')],'sMixed':_0x307592[_0xebef('0x29')][_0xebef('0x2b')],'sNeutral':_0x307592[_0xebef('0x29')]['Neutral']});})[_0xebef('0xf')](function(){logger[_0xebef('0x9')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3c79e0['id']));_0x5dd833();});case _0xebef('0x2c'):return _0x3c79e0['update']({'transcribeStatus':'FAILED','failureReason':_0x1921aa['TranscriptionJob'][_0xebef('0x2d')]})['then'](function(){logger['info'](util[_0xebef('0xa')](_0xebef('0x2e'),_0x3c79e0['id']));_0x5dd833();});default:logger[_0xebef('0x9')](util['format'](_0xebef('0x2f'),_0x3c79e0['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0x3c79e0['tempSentiment']){throw new db[(_0xebef('0x22'))]['ValidationError'](_0xebef('0x30'));}if(!_0x1dcae4['sentiment']||!_0x1dcae4['sentimentAccountId']||!_0x1dcae4[_0xebef('0x31')]||!_0x1dcae4[_0xebef('0x26')]||!_0x1dcae4[_0xebef('0x1d')]){throw new db[(_0xebef('0x22'))][(_0xebef('0x1e'))](_0xebef('0x32'));}if(!_0x3c79e0['fileText']){throw new Error(_0xebef('0x1f'));}if(_0x1dcae4[_0xebef('0x21')]===_0x566dbe['id']){return _0x566dbe;}else{return db[_0xebef('0x20')][_0xebef('0x33')]({'where':{'id':_settings[_0xebef('0x21')]}});}})[_0xebef('0xf')](function(_0x3c033d){if(!_0x3c033d){throw new db[(_0xebef('0x22'))][(_0xebef('0x1e'))](_0xebef('0x23'));}if(!_0x3c033d['data1']||!_0x3c033d['data2']){throw new db['Sequelize']['ValidationError'](_0xebef('0x24'));}_0x584ac2=_0x3c033d;logger[_0xebef('0x9')](util[_0xebef('0xa')](_0xebef('0x25'),_0x3c79e0['id']));return sentiment(_0x584ac2[_0xebef('0xd')],_0x584ac2['data2'],_0x1dcae4['sentimentRegion'],_0x3c79e0[_0xebef('0x13')],_0x1dcae4['language']);})['then'](function(_0x2860bc){logger[_0xebef('0x9')](util[_0xebef('0xa')](_0xebef('0x27'),_0x3c79e0['id']));return _0x3c79e0[_0xebef('0x34')]({'sentiment':_0x2860bc[_0xebef('0x28')],'sPositive':_0x2860bc[_0xebef('0x29')][_0xebef('0x35')],'sNegative':_0x2860bc[_0xebef('0x29')][_0xebef('0x2a')],'sMixed':_0x2860bc[_0xebef('0x29')][_0xebef('0x2b')],'sNeutral':_0x2860bc[_0xebef('0x29')]['Neutral'],'transcribeStatus':_0xebef('0x14')});})[_0xebef('0xf')](function(){logger[_0xebef('0x9')](util[_0xebef('0xa')](_0xebef('0x2e'),_0x3c79e0['id']));_0x5dd833();});}})[_0xebef('0x36')](function(_0x4898aa){if(_0x4898aa){if(!_0x4898aa[_0xebef('0x37')]||_0x4898aa[_0xebef('0x37')]!==_0xebef('0x38')){logger['error'](util['format'](_0xebef('0x39'),_0x3c79e0['id']),util['inspect'](_0x4898aa,{'showHidden':![],'depth':null}));}}_0x5dd833();});});}function checkTranscribe(){var _0x44b3eb;var _0x4440e8;var _0x2f22de;return db[_0xebef('0x3a')][_0xebef('0x3b')]({'where':{'transcribeStatus':_0xebef('0x3c')}})[_0xebef('0xf')](function(_0x54d164){if(!_0x54d164||!_0x54d164[_0xebef('0x1b')]){throw new db['Sequelize'][(_0xebef('0x1e'))](_0xebef('0x3d'));}_0x44b3eb=_0x54d164;return db[_0xebef('0x3e')][_0xebef('0x33')]({'where':{'id':0x1}});})['then'](function(_0x5f9e80){if(!_0x5f9e80){throw new db['Sequelize']['ValidationError'](_0xebef('0x3f'));}_0x4440e8=_0x5f9e80;if(!_0x4440e8[_0xebef('0x5')]||!_0x4440e8[_0xebef('0x40')]||!_0x4440e8[_0xebef('0x41')]||!_0x4440e8[_0xebef('0x26')]||!_0x4440e8[_0xebef('0x1d')]){throw new db[(_0xebef('0x22'))][(_0xebef('0x1e'))](_0xebef('0x42'));}return db[_0xebef('0x20')][_0xebef('0x33')]({'where':{'id':_0x4440e8[_0xebef('0x40')]}});})[_0xebef('0xf')](function(_0x766610){if(!_0x766610){throw new db[(_0xebef('0x22'))][(_0xebef('0x1e'))](_0xebef('0x23'));}if(!_0x766610[_0xebef('0xd')]||!_0x766610[_0xebef('0xe')]){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x2f22de=_0x766610;var _0x395dee=[];_0x44b3eb['forEach'](function(_0x525048){_0x395dee[_0xebef('0x43')](checkTranscribeJob(_0x525048,_0x4440e8,_0x2f22de));});return BPromise[_0xebef('0x44')](_0x395dee);})[_0xebef('0x36')](function(_0x4c62e9){if(_0x4c62e9){if(!_0x4c62e9[_0xebef('0x37')]||_0x4c62e9[_0xebef('0x37')]!==_0xebef('0x38')){logger[_0xebef('0x45')](util[_0xebef('0x46')](_0x4c62e9,{'showHidden':![],'depth':null}));}}});}exports[_0xebef('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x4899=['[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','sentimentAccountId','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data1','sentimentRegion','Sentiment','Positive','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','COMPLETED','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','start','lodash','request-promise','bluebird','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','substring','info','format','transcribeName','data2','then','fileText','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update'];(function(_0x3db122,_0x5e6bee){var _0x325b67=function(_0x5095af){while(--_0x5095af){_0x3db122['push'](_0x3db122['shift']());}};_0x325b67(++_0x5e6bee);}(_0x4899,0x74));var _0x9489=function(_0x1ae4fd,_0x3ec9cd){_0x1ae4fd=_0x1ae4fd-0x0;var _0x359c3=_0x4899[_0x1ae4fd];return _0x359c3;};var _=require(_0x9489('0x0'));var AWS=require('aws-sdk');var rp=require(_0x9489('0x1'));var util=require('util');var BPromise=require(_0x9489('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x9489('0x3'))(_0x9489('0x4'));function getTranscriptionJob(_0x2a7d88,_0x2a8d19,_0xbeb4d3,_0x49173a){return new Promise(function(_0x99c731,_0x3d7499){var _0x411ebe=new AWS[(_0x9489('0x5'))]({'accessKeyId':_0x2a8d19,'secretAccessKey':_0x2a7d88,'region':_0xbeb4d3});_0x411ebe['getTranscriptionJob']({'TranscriptionJobName':_0x49173a},function(_0x553c77,_0x1379eb){if(_0x553c77){return _0x3d7499(_0x553c77);}else{return _0x99c731(_0x1379eb);}});});}function sentiment(_0x5ec4cf,_0x3590a3,_0xb426d8,_0x52f169,_0x1dac7c){return new Promise(function(_0x12480e,_0x141c15){var _0x91d101=new AWS[(_0x9489('0x6'))]({'accessKeyId':_0x3590a3,'secretAccessKey':_0x5ec4cf,'region':_0xb426d8});_0x91d101[_0x9489('0x7')]({'Text':_0x52f169,'LanguageCode':_0x1dac7c[_0x9489('0x8')](0x0,0x2)},function(_0xae3bc6,_0x5df21d){if(_0xae3bc6){return _0x141c15(_0xae3bc6);}else{return _0x12480e(_0x5df21d);}});});}function checkTranscribeJob(_0x3fa5b7,_0x208490,_0x7368e2){var _0x5de484;return new BPromise(function(_0x532b72,_0x3ad3b4){logger[_0x9489('0x9')](util[_0x9489('0xa')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x3fa5b7['id'],_0x3fa5b7[_0x9489('0xb')]));return getTranscriptionJob(_0x7368e2['data1'],_0x7368e2[_0x9489('0xc')],_0x208490['transcribeRegion'],_0x3fa5b7[_0x9489('0xb')])[_0x9489('0xd')](function(_0x1cb631){logger[_0x9489('0x9')](util[_0x9489('0xa')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x3fa5b7['id'],_0x3fa5b7[_0x9489('0xb')],_0x1cb631['TranscriptionJob']['TranscriptionJobStatus']));if(!_0x3fa5b7[_0x9489('0xe')]){switch(_0x1cb631[_0x9489('0xf')][_0x9489('0x10')]){case'COMPLETED':var _0x23ef8f={'transcribeStatus':_0x1cb631[_0x9489('0xf')]['TranscriptionJobStatus'],'fileUri':_0x1cb631['TranscriptionJob'][_0x9489('0x11')][_0x9489('0x12')]};logger[_0x9489('0x9')](util[_0x9489('0xa')](_0x9489('0x13'),_0x3fa5b7['id']));return rp({'uri':_0x1cb631[_0x9489('0xf')][_0x9489('0x11')]['TranscriptFileUri'],'json':!![]})[_0x9489('0xd')](function(_0x2f5535){logger[_0x9489('0x9')](util['format'](_0x9489('0x14'),_0x3fa5b7['id']));if(_0x2f5535&&_0x2f5535[_0x9489('0x15')]&&_0x2f5535[_0x9489('0x15')][_0x9489('0x16')]&&_0x2f5535[_0x9489('0x15')][_0x9489('0x16')]['length']){_0x23ef8f[_0x9489('0xe')]='';for(var _0xf68ab6=0x0;_0xf68ab6<_0x2f5535[_0x9489('0x15')][_0x9489('0x16')][_0x9489('0x17')];_0xf68ab6++){_0x23ef8f[_0x9489('0xe')]+=_0x2f5535[_0x9489('0x15')][_0x9489('0x16')][_0xf68ab6][_0x9489('0x18')]+'';}}return _0x3fa5b7[_0x9489('0x19')](_0x23ef8f);})[_0x9489('0xd')](function(){logger[_0x9489('0x9')](util[_0x9489('0xa')](_0x9489('0x1a'),_0x3fa5b7['id']));if(!_0x3fa5b7[_0x9489('0x1b')]){throw new db[(_0x9489('0x1c'))]['ValidationError'](_0x9489('0x1d'));}if(!_0x208490['sentiment']||!_0x208490['sentimentAccountId']||!_0x208490['sentimentRegion']||!_0x208490[_0x9489('0x1e')]||!_0x208490[_0x9489('0x1f')]){throw new db['Sequelize'][(_0x9489('0x20'))](_0x9489('0x21'));}if(!_0x23ef8f[_0x9489('0xe')]){throw new Error('Transcript\x20not\x20available');}if(_0x208490['sentimentAccountId']===_0x7368e2['id']){return _0x7368e2;}else{return db[_0x9489('0x22')]['findOne']({'where':{'id':_settings[_0x9489('0x23')]}});}})[_0x9489('0xd')](function(_0x19d472){if(!_0x19d472){throw new db[(_0x9489('0x1c'))][(_0x9489('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x19d472['data1']||!_0x19d472[_0x9489('0xc')]){throw new db[(_0x9489('0x1c'))][(_0x9489('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x5de484=_0x19d472;logger[_0x9489('0x9')](util['format'](_0x9489('0x24'),_0x3fa5b7['id']));return sentiment(_0x5de484[_0x9489('0x25')],_0x5de484[_0x9489('0xc')],_0x208490[_0x9489('0x26')],_0x23ef8f['fileText'],_0x208490[_0x9489('0x1e')]);})[_0x9489('0xd')](function(_0x34f898){logger['info'](util[_0x9489('0xa')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x3fa5b7['id']));return _0x3fa5b7[_0x9489('0x19')]({'sentiment':_0x34f898[_0x9489('0x27')],'sPositive':_0x34f898['SentimentScore'][_0x9489('0x28')],'sNegative':_0x34f898[_0x9489('0x29')][_0x9489('0x2a')],'sMixed':_0x34f898['SentimentScore'][_0x9489('0x2b')],'sNeutral':_0x34f898[_0x9489('0x29')][_0x9489('0x2c')]});})[_0x9489('0xd')](function(){logger[_0x9489('0x9')](util[_0x9489('0xa')](_0x9489('0x1a'),_0x3fa5b7['id']));_0x532b72();});case _0x9489('0x2d'):return _0x3fa5b7[_0x9489('0x19')]({'transcribeStatus':_0x9489('0x2d'),'failureReason':_0x1cb631[_0x9489('0xf')][_0x9489('0x2e')]})[_0x9489('0xd')](function(){logger[_0x9489('0x9')](util[_0x9489('0xa')](_0x9489('0x1a'),_0x3fa5b7['id']));_0x532b72();});default:logger[_0x9489('0x9')](util[_0x9489('0xa')](_0x9489('0x2f'),_0x3fa5b7['id']));break;}}else{return BPromise[_0x9489('0x30')]()[_0x9489('0xd')](function(){if(!_0x3fa5b7[_0x9489('0x1b')]){throw new db['Sequelize']['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x208490[_0x9489('0x31')]||!_0x208490[_0x9489('0x23')]||!_0x208490[_0x9489('0x26')]||!_0x208490[_0x9489('0x1e')]||!_0x208490[_0x9489('0x1f')]){throw new db[(_0x9489('0x1c'))][(_0x9489('0x20'))](_0x9489('0x21'));}if(!_0x3fa5b7[_0x9489('0xe')]){throw new Error(_0x9489('0x32'));}if(_0x208490[_0x9489('0x23')]===_0x7368e2['id']){return _0x7368e2;}else{return db['CloudProvider'][_0x9489('0x33')]({'where':{'id':_settings[_0x9489('0x23')]}});}})[_0x9489('0xd')](function(_0x1b6f3e){if(!_0x1b6f3e){throw new db[(_0x9489('0x1c'))][(_0x9489('0x20'))](_0x9489('0x34'));}if(!_0x1b6f3e[_0x9489('0x25')]||!_0x1b6f3e[_0x9489('0xc')]){throw new db['Sequelize'][(_0x9489('0x20'))](_0x9489('0x35'));}_0x5de484=_0x1b6f3e;logger[_0x9489('0x9')](util[_0x9489('0xa')](_0x9489('0x24'),_0x3fa5b7['id']));return sentiment(_0x5de484[_0x9489('0x25')],_0x5de484[_0x9489('0xc')],_0x208490['sentimentRegion'],_0x3fa5b7[_0x9489('0xe')],_0x208490[_0x9489('0x1e')]);})[_0x9489('0xd')](function(_0x400d04){logger[_0x9489('0x9')](util[_0x9489('0xa')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x3fa5b7['id']));return _0x3fa5b7['update']({'sentiment':_0x400d04['Sentiment'],'sPositive':_0x400d04[_0x9489('0x29')][_0x9489('0x28')],'sNegative':_0x400d04[_0x9489('0x29')][_0x9489('0x2a')],'sMixed':_0x400d04[_0x9489('0x29')][_0x9489('0x2b')],'sNeutral':_0x400d04[_0x9489('0x29')][_0x9489('0x2c')],'transcribeStatus':_0x9489('0x36')});})[_0x9489('0xd')](function(){logger[_0x9489('0x9')](util[_0x9489('0xa')](_0x9489('0x1a'),_0x3fa5b7['id']));_0x532b72();});}})['catch'](function(_0x4ce544){if(_0x4ce544){if(!_0x4ce544[_0x9489('0x37')]||_0x4ce544[_0x9489('0x37')]!==_0x9489('0x38')){logger[_0x9489('0x39')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x3fa5b7['id']),util[_0x9489('0x3a')](_0x4ce544,{'showHidden':![],'depth':null}));}}_0x532b72();});});}function checkTranscribe(){var _0x70372;var _0x149adf;var _0x356132;return db[_0x9489('0x3b')][_0x9489('0x3c')]({'where':{'transcribeStatus':_0x9489('0x3d')}})[_0x9489('0xd')](function(_0x25e18d){if(!_0x25e18d||!_0x25e18d[_0x9489('0x17')]){throw new db[(_0x9489('0x1c'))][(_0x9489('0x20'))](_0x9489('0x3e'));}_0x70372=_0x25e18d;return db[_0x9489('0x3f')][_0x9489('0x33')]({'where':{'id':0x1}});})[_0x9489('0xd')](function(_0x346faf){if(!_0x346faf){throw new db[(_0x9489('0x1c'))][(_0x9489('0x20'))](_0x9489('0x40'));}_0x149adf=_0x346faf;if(!_0x149adf[_0x9489('0x4')]||!_0x149adf[_0x9489('0x41')]||!_0x149adf[_0x9489('0x42')]||!_0x149adf[_0x9489('0x1e')]||!_0x149adf[_0x9489('0x1f')]){throw new db['Sequelize'][(_0x9489('0x20'))](_0x9489('0x43'));}return db[_0x9489('0x22')][_0x9489('0x33')]({'where':{'id':_0x149adf[_0x9489('0x41')]}});})[_0x9489('0xd')](function(_0x1edcc1){if(!_0x1edcc1){throw new db[(_0x9489('0x1c'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x1edcc1[_0x9489('0x25')]||!_0x1edcc1['data2']){throw new db[(_0x9489('0x1c'))]['ValidationError'](_0x9489('0x35'));}_0x356132=_0x1edcc1;var _0x3819fe=[];_0x70372[_0x9489('0x44')](function(_0x3b5b60){_0x3819fe[_0x9489('0x45')](checkTranscribeJob(_0x3b5b60,_0x149adf,_0x356132));});return BPromise['all'](_0x3819fe);})['catch'](function(_0x52658a){if(_0x52658a){if(!_0x52658a['name']||_0x52658a['name']!==_0x9489('0x38')){logger['error'](util[_0x9489('0x3a')](_0x52658a,{'showHidden':![],'depth':null}));}}});}exports[_0x9489('0x46')]=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 016835d..aad458f 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 _0x6b23=['format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','util','../../config/environment','../../mysqldb','../logger','defaults','localhost','redis','WhatsappInteraction','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout'];(function(_0x26b3de,_0x331a69){var _0x55b678=function(_0x31aa55){while(--_0x31aa55){_0x26b3de['push'](_0x26b3de['shift']());}};_0x55b678(++_0x331a69);}(_0x6b23,0x102));var _0x36b2=function(_0x2f71f6,_0x3a1f4d){_0x2f71f6=_0x2f71f6-0x0;var _0x2b23ea=_0x6b23[_0x2f71f6];return _0x2b23ea;};'use strict';var _=require(_0x36b2('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x36b2('0x1'));var config=require(_0x36b2('0x2'));var db=require(_0x36b2('0x3'))['db'];var logger=require(_0x36b2('0x4'))('schedule');config['redis']=_[_0x36b2('0x5')](config['redis'],{'host':_0x36b2('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x36b2('0x7')]));function closeInteractions(){var _0x4d1c95=[];return db[_0x36b2('0x8')]['findAll']({'raw':!![],'attributes':['id',_0x36b2('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x36b2('0xa')](0x18,_0x36b2('0xb'))}}})[_0x36b2('0xc')](function(_0x4984a2){if(_0x4984a2&&_0x4984a2[_0x36b2('0xd')]){_0x4d1c95=_[_0x36b2('0xe')](_0x4984a2||[],'id');logger[_0x36b2('0xf')](_0x36b2('0x10'),_0x4d1c95[_0x36b2('0x11')]());return db['WhatsappInteraction'][_0x36b2('0x12')]({'closeReason':_0x36b2('0x13'),'disposition':_0x36b2('0x14'),'closed':!![],'closedAt':moment()[_0x36b2('0x15')](_0x36b2('0x16'))},{'where':{'id':_0x4d1c95}});}})[_0x36b2('0xc')](function(){if(_0x4d1c95&&_0x4d1c95[_0x36b2('0xd')]){logger[_0x36b2('0xf')](_0x36b2('0x17'),_0x4d1c95[_0x36b2('0x11')]());for(var _0x56a201=0x0;_0x56a201<_0x4d1c95['length'];_0x56a201++){io[_0x36b2('0x18')](_0x36b2('0x19'),{'id':_0x4d1c95[_0x56a201],'closed':!![]});}}})[_0x36b2('0x1a')](function(_0x4a6cda){logger[_0x36b2('0x1b')](_0x36b2('0x1c'),_0x4a6cda?util[_0x36b2('0x1d')](_0x4a6cda,{'showHidden':![],'depth':null}):'');});}exports[_0x36b2('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x8f0a=['format','YYYY-MM-DD\x20HH:mm:ss','length','info','whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','redis','defaults','localhost','findAll','lastMsgAt','subtract','hours','then','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout'];(function(_0x2d9c6a,_0x59393d){var _0xf3c918=function(_0x4f3f26){while(--_0x4f3f26){_0x2d9c6a['push'](_0x2d9c6a['shift']());}};_0xf3c918(++_0x59393d);}(_0x8f0a,0x1e4));var _0xa8f0=function(_0x623e7,_0x1bef7d){_0x623e7=_0x623e7-0x0;var _0x121131=_0x8f0a[_0x623e7];return _0x121131;};'use strict';var _=require(_0xa8f0('0x0'));var moment=require(_0xa8f0('0x1'));var Redis=require(_0xa8f0('0x2'));var util=require(_0xa8f0('0x3'));var config=require(_0xa8f0('0x4'));var db=require(_0xa8f0('0x5'))['db'];var logger=require('../logger')('schedule');config[_0xa8f0('0x6')]=_[_0xa8f0('0x7')](config[_0xa8f0('0x6')],{'host':_0xa8f0('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa8f0('0x6')]));function closeInteractions(){var _0x422b9e=[];return db['WhatsappInteraction'][_0xa8f0('0x9')]({'raw':!![],'attributes':['id',_0xa8f0('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xa8f0('0xb')](0x18,_0xa8f0('0xc'))}}})[_0xa8f0('0xd')](function(_0x479c72){if(_0x479c72&&_0x479c72['length']){_0x422b9e=_[_0xa8f0('0xe')](_0x479c72||[],'id');logger['info'](_0xa8f0('0xf'),_0x422b9e[_0xa8f0('0x10')]());return db['WhatsappInteraction'][_0xa8f0('0x11')]({'closeReason':_0xa8f0('0x12'),'disposition':_0xa8f0('0x13'),'closed':!![],'closedAt':moment()[_0xa8f0('0x14')](_0xa8f0('0x15'))},{'where':{'id':_0x422b9e}});}})[_0xa8f0('0xd')](function(){if(_0x422b9e&&_0x422b9e[_0xa8f0('0x16')]){logger[_0xa8f0('0x17')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x422b9e['join']());for(var _0x442147=0x0;_0x442147<_0x422b9e[_0xa8f0('0x16')];_0x442147++){io['emit'](_0xa8f0('0x18'),{'id':_0x422b9e[_0x442147],'closed':!![]});}}})['catch'](function(_0x244df1){logger[_0xa8f0('0x19')](_0xa8f0('0x1a'),_0x244df1?util['inspect'](_0x244df1,{'showHidden':![],'depth':null}):'');});}exports[_0xa8f0('0x1b')]=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 2245b25..310de81 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x31d5=['finished\x20populating','contacts1','CmHopper','destroy','bulkCreate','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','CmContact','then','log'];(function(_0x3479a8,_0x8858ed){var _0x7f58e4=function(_0x382f01){while(--_0x382f01){_0x3479a8['push'](_0x3479a8['shift']());}};_0x7f58e4(++_0x8858ed);}(_0x31d5,0x1ab));var _0x531d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x31d5[_0x3947c9];return _0x2e7871;};'use strict';var util=require(_0x531d('0x0'));var db=require(_0x531d('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x531d('0x2')]({'id':i,'firstName':_0x531d('0x3')+i,'lastName':_0x531d('0x4')+i,'phone':0xf879fb460+i,'email':_0x531d('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x531d('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x531d('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x531d('0x6')](),'updatedAt':Date[_0x531d('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x531d('0x3')+i,'lastName':_0x531d('0x4')+i,'phone':0xf879fb460+i,'email':_0x531d('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x531d('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x531d('0x6')](),'updatedAt':Date[_0x531d('0x6')]()});}db[_0x531d('0x7')]['destroy']({'where':{}})[_0x531d('0x8')](function(){return db[_0x531d('0x7')]['bulkCreate'](contacts);})[_0x531d('0x8')](function(){console[_0x531d('0x9')](_0x531d('0xa'),_0x531d('0xb'));return db[_0x531d('0xc')][_0x531d('0xd')]({'where':{}});})['then'](function(){return db['CmHopper'][_0x531d('0xe')](hopper);})[_0x531d('0x8')](function(){console['log'](_0x531d('0xa'),_0x531d('0xf'));return db[_0x531d('0x7')][_0x531d('0xe')](contacts2);})[_0x531d('0x8')](function(){console[_0x531d('0x9')](_0x531d('0xa'),_0x531d('0x10'));return db['CmHopper'][_0x531d('0xe')](hopper2);})[_0x531d('0x8')](function(){console[_0x531d('0x9')](_0x531d('0xa'),_0x531d('0x11'));})[_0x531d('0x12')](function(_0x36ea8c){console[_0x531d('0x9')](_0x36ea8c);}); \ No newline at end of file +var _0xdf63=['CmHopper','then','finished\x20populating','hopper2','catch','util','push','innocenzo.biondo','@xcally.com','now','Innocenzo','Biondo','CmContact','destroy','bulkCreate','log'];(function(_0x55a76a,_0x2d0203){var _0x45885a=function(_0x4348d5){while(--_0x4348d5){_0x55a76a['push'](_0x55a76a['shift']());}};_0x45885a(++_0x2d0203);}(_0xdf63,0x175));var _0x3df6=function(_0x148f22,_0x5a5572){_0x148f22=_0x148f22-0x0;var _0x50ccfa=_0xdf63[_0x148f22];return _0x50ccfa;};'use strict';var util=require(_0x3df6('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x3df6('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x3df6('0x2')+i+_0x3df6('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x3df6('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3df6('0x4')](),'updatedAt':Date[_0x3df6('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x3df6('0x5')+i,'lastName':_0x3df6('0x6')+i,'phone':0xf879fb460+i,'email':_0x3df6('0x2')+i+_0x3df6('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x3df6('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x3df6('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3df6('0x4')](),'updatedAt':Date[_0x3df6('0x4')]()});}db[_0x3df6('0x7')][_0x3df6('0x8')]({'where':{}})['then'](function(){return db['CmContact'][_0x3df6('0x9')](contacts);})['then'](function(){console[_0x3df6('0xa')]('finished\x20populating','contacts1');return db[_0x3df6('0xb')]['destroy']({'where':{}});})['then'](function(){return db['CmHopper'][_0x3df6('0x9')](hopper);})[_0x3df6('0xc')](function(){console[_0x3df6('0xa')]('finished\x20populating','hopper1');return db[_0x3df6('0x7')][_0x3df6('0x9')](contacts2);})[_0x3df6('0xc')](function(){console[_0x3df6('0xa')](_0x3df6('0xd'),'contacts2');return db['CmHopper'][_0x3df6('0x9')](hopper2);})[_0x3df6('0xc')](function(){console[_0x3df6('0xa')](_0x3df6('0xd'),_0x3df6('0xe'));})[_0x3df6('0xf')](function(_0x2979db){console[_0x3df6('0xa')](_0x2979db);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 018a32b..3c55249 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x769a=['push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate','log','util','../mysqldb'];(function(_0x154092,_0x50650f){var _0x329fe6=function(_0x178ecd){while(--_0x178ecd){_0x154092['push'](_0x154092['shift']());}};_0x329fe6(++_0x50650f);}(_0x769a,0xbc));var _0xa769=function(_0x36d703,_0x55b354){_0x36d703=_0x36d703-0x0;var _0x12c909=_0x769a[_0x36d703];return _0x12c909;};'use strict';var util=require(_0xa769('0x0'));var db=require(_0xa769('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xa769('0x2')]({'name':util[_0xa769('0x3')](_0xa769('0x4'),_0xa769('0x5'),i),'fullname':util['format']('%s%s',_0xa769('0x5'),i),'email':util['format'](_0xa769('0x6'),_0xa769('0x5'),i),'role':_0xa769('0x5'),'password':_0xa769('0x7'),'internal':0xfa0+i,'type':_0xa769('0x8'),'transport':[_0xa769('0x9'),'ws',_0xa769('0xa')],'disallow':[_0xa769('0xb')],'allow':['ulaw'],'defaultuser':util[_0xa769('0x3')](_0xa769('0x4'),_0xa769('0x5'),i),'encryption':_0xa769('0xc'),'avpf':'yes','force_avp':'yes','icesupport':_0xa769('0xc'),'dtlsenable':_0xa769('0xc'),'dtlsverify':'no','dtlscertfile':_0xa769('0xd'),'dtlsprivatekey':_0xa769('0xe'),'dtlssetup':_0xa769('0xf'),'callerid':util[_0xa769('0x3')](_0xa769('0x10'),util['format'](_0xa769('0x4'),'agent',i),0xfa0+i)});}db['User'][_0xa769('0x11')](users)['then'](function(){console['log']('add\x20user');})['catch'](function(_0x4325d6){console[_0xa769('0x12')](_0x4325d6);}); \ No newline at end of file +var _0x24ae=['all','ulaw','yes','/etc/pki/tls/certs/motion.crt','\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch','util','../mysqldb','format','%s%s','agent','password','friend','udp','wss'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x24ae,0x7c));var _0xe24a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x24ae[_0x5d2803];return _0xdcad2c;};'use strict';var util=require(_0xe24a('0x0'));var db=require(_0xe24a('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xe24a('0x2')](_0xe24a('0x3'),_0xe24a('0x4'),i),'fullname':util[_0xe24a('0x2')]('%s%s','agent',i),'email':util[_0xe24a('0x2')]('%s%s@xcally.com',_0xe24a('0x4'),i),'role':_0xe24a('0x4'),'password':_0xe24a('0x5'),'internal':0xfa0+i,'type':_0xe24a('0x6'),'transport':[_0xe24a('0x7'),'ws',_0xe24a('0x8')],'disallow':[_0xe24a('0x9')],'allow':[_0xe24a('0xa')],'defaultuser':util[_0xe24a('0x2')](_0xe24a('0x3'),_0xe24a('0x4'),i),'encryption':_0xe24a('0xb'),'avpf':_0xe24a('0xb'),'force_avp':_0xe24a('0xb'),'icesupport':_0xe24a('0xb'),'dtlsenable':_0xe24a('0xb'),'dtlsverify':'no','dtlscertfile':_0xe24a('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util[_0xe24a('0x2')](_0xe24a('0xd'),util['format'](_0xe24a('0x3'),_0xe24a('0x4'),i),0xfa0+i)});}db[_0xe24a('0xe')]['bulkCreate'](users)[_0xe24a('0xf')](function(){console[_0xe24a('0x10')](_0xe24a('0x11'));})[_0xe24a('0x12')](function(_0x5431a6){console[_0xe24a('0x10')](_0x5431a6);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 9e44461..4a0889e 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf40b=['Trunks','IvrCampaigns','resourceId','map','Campaign','where','type','%s:queue:%s','length','format','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteractions','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','user','OpenchannelQueue','Telephones','voice:inbound','getVoiceQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','voice','fax','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED','util','bluebird','../mysqldb','./environment','Agents','User','name','role','agent','telephone','ivr','UserProfileSection','findOne','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll'];(function(_0x5302fb,_0x1a2db3){var _0x43e6a4=function(_0x324ae6){while(--_0x324ae6){_0x5302fb['push'](_0x5302fb['shift']());}};_0x43e6a4(++_0x1a2db3);}(_0xf40b,0xb0));var _0xbf40=function(_0xa7dd32,_0x35561f){_0xa7dd32=_0xa7dd32-0x0;var _0x20f2f8=_0xf40b[_0xa7dd32];return _0x20f2f8;};'use strict';var _=require('lodash');var util=require(_0xbf40('0x0'));var BPromise=require(_0xbf40('0x1'));var db=require(_0xbf40('0x2'))['db'];var config=require(_0xbf40('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xbf40('0x4'),'model':db[_0xbf40('0x5')],'attributes':['id',_0xbf40('0x6'),_0xbf40('0x7')],'raw':!![],'where':{'role':_0xbf40('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xbf40('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xbf40('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0xbf40('0x6')],'where':{'role':_0xbf40('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xbf40('0x6'),'type'],'where':{'type':_0xbf40('0xa')}};function getAssociatedResources(_0x31cd41,_0x40330b,_0x1ee6b1){return db[_0xbf40('0xb')][_0xbf40('0xc')]({'where':{'name':_0x31cd41,'userProfileId':_0x40330b},'raw':!![]})[_0xbf40('0xd')](function(_0x20b14e){if(_0x20b14e){if(_0x20b14e['autoAssociation']){switch(_0x31cd41){case _0xbf40('0xe'):case _0xbf40('0xf'):case _0xbf40('0x10'):case _0xbf40('0x11'):case _0xbf40('0x12'):case _0xbf40('0x13'):case _0xbf40('0x14'):return db[_0x1ee6b1][_0xbf40('0x15')](queryQueues);case'Telephones':return db[_0x1ee6b1]['findAll'](queryTelephones);case _0xbf40('0x16'):return db[_0x1ee6b1][_0xbf40('0x15')](queryTrunks);case _0xbf40('0x17'):return db[_0x1ee6b1][_0xbf40('0x15')](queryCampaigns);}}else{return db['UserProfileResource'][_0xbf40('0x15')]({'attributes':[_0xbf40('0x18')],'where':{'sectionId':_0x20b14e['id']},'raw':!![]})[_0xbf40('0xd')](function(_0x347473){if(_0x347473){var _0x39a323={'where':{'id':_[_0xbf40('0x19')](_0x347473,_0xbf40('0x18'))},'raw':!![]};switch(_0x1ee6b1){case _0xbf40('0x5'):_0x39a323['where'][_0xbf40('0x7')]=_0xbf40('0x9');break;case _0xbf40('0x1a'):_0x39a323[_0xbf40('0x1b')][_0xbf40('0x1c')]=_0xbf40('0xa');break;}return db[_0x1ee6b1][_0xbf40('0x15')](_0x39a323);}else{return[];}});}}else{return[];}})[_0xbf40('0xd')](function(_0x5979da){return _0x5979da;});}function joinOrLeaveQueues(_0x2c8af5,_0x6aa551,_0x3af762,_0x2d6492){_0x2c8af5[_0x6aa551](util['format'](_0xbf40('0x1d'),_0x3af762,_0x2d6492[_0xbf40('0x6')]));if(_0x2d6492[_0xbf40('0x4')]){for(var _0x1922c8=0x0;_0x1922c8<_0x2d6492[_0xbf40('0x4')][_0xbf40('0x1e')];_0x1922c8+=0x1){_0x2c8af5[_0x6aa551](util[_0xbf40('0x1f')](_0xbf40('0x20'),_0x2d6492[_0xbf40('0x4')][_0x1922c8][_0xbf40('0x6')]));}}}function joinOrLeave(_0x1788a8,_0x1487d0,_0x17fa9a){var _0x1471ee;if(_0x1788a8[_0xbf40('0x21')][_0xbf40('0x22')]['id']){db['User'][_0xbf40('0x23')]({'attributes':['id',_0xbf40('0x6'),_0xbf40('0x7'),_0xbf40('0x24')],'where':{'id':_0x1788a8[_0xbf40('0x21')][_0xbf40('0x22')]['id']},'include':[{'model':db[_0xbf40('0x25')],'as':_0xbf40('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xbf40('0x27')],'as':_0xbf40('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xbf40('0x29')],'as':_0xbf40('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0xbf40('0x2b')],'as':_0xbf40('0x2c'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xbf40('0x2d'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xbf40('0x2e'),'attributes':['id'],'raw':!![]}]})[_0xbf40('0xd')](function(_0x1b7870){if(_0x1b7870){_0x1471ee=_0x1b7870;_0x1788a8[_0x1487d0](util['format'](_0xbf40('0x20'),_0x1b7870[_0xbf40('0x6')]));var _0x253a51=[];switch(_0x1b7870['role']){case _0xbf40('0x2f'):_0x1788a8[_0x1487d0]('voice:inbound');_0x1788a8[_0x1487d0](_0xbf40('0x30'));if(queryQueues[_0xbf40('0x31')](_0xbf40('0x32'))){delete queryQueues['include'];}_0x253a51[_0xbf40('0x33')](db[_0xbf40('0x34')][_0xbf40('0x15')](queryQueues));_0x253a51[_0xbf40('0x33')](db[_0xbf40('0x35')][_0xbf40('0x15')](queryQueues));_0x253a51[_0xbf40('0x33')](db[_0xbf40('0x36')][_0xbf40('0x15')](queryQueues));_0x253a51['push'](db[_0xbf40('0x37')][_0xbf40('0x15')](queryQueues));_0x253a51[_0xbf40('0x33')](db[_0xbf40('0x38')]['findAll'](queryQueues));_0x253a51[_0xbf40('0x33')](db['OpenchannelQueue'][_0xbf40('0x15')](queryQueues));_0x253a51[_0xbf40('0x33')](db[_0xbf40('0x39')]['findAll'](queryQueues));_0x253a51[_0xbf40('0x33')](db[_0xbf40('0x5')][_0xbf40('0x15')](queryTelephones));_0x253a51[_0xbf40('0x33')](db[_0xbf40('0x3a')]['findAll'](queryTrunks));_0x253a51[_0xbf40('0x33')](db[_0xbf40('0x1a')][_0xbf40('0x15')](queryCampaigns));_0x253a51['push'](db[_0xbf40('0x5')][_0xbf40('0x15')](queryAgents));break;case _0xbf40('0x3b'):_0x1788a8[_0x1487d0]('voice:inbound');_0x1788a8[_0x1487d0](_0xbf40('0x30'));_0x253a51[_0xbf40('0x33')](getAssociatedResources(_0xbf40('0xe'),_0x1b7870[_0xbf40('0x24')],_0xbf40('0x34')));_0x253a51[_0xbf40('0x33')](getAssociatedResources(_0xbf40('0xf'),_0x1b7870[_0xbf40('0x24')],_0xbf40('0x35')));_0x253a51[_0xbf40('0x33')](getAssociatedResources(_0xbf40('0x10'),_0x1b7870[_0xbf40('0x24')],_0xbf40('0x36')));_0x253a51[_0xbf40('0x33')](getAssociatedResources('SmsQueues',_0x1b7870[_0xbf40('0x24')],'SmsQueue'));_0x253a51[_0xbf40('0x33')](getAssociatedResources(_0xbf40('0x12'),_0x1b7870[_0xbf40('0x24')],_0xbf40('0x38')));_0x253a51[_0xbf40('0x33')](getAssociatedResources('OpenchannelQueues',_0x1b7870[_0xbf40('0x24')],_0xbf40('0x3c')));_0x253a51['push'](getAssociatedResources(_0xbf40('0x14'),_0x1b7870['userProfileId'],_0xbf40('0x39')));_0x253a51[_0xbf40('0x33')](getAssociatedResources(_0xbf40('0x3d'),_0x1b7870[_0xbf40('0x24')],_0xbf40('0x5')));_0x253a51[_0xbf40('0x33')](getAssociatedResources(_0xbf40('0x16'),_0x1b7870['userProfileId'],_0xbf40('0x3a')));_0x253a51[_0xbf40('0x33')](getAssociatedResources(_0xbf40('0x17'),_0x1b7870[_0xbf40('0x24')],_0xbf40('0x1a')));_0x253a51[_0xbf40('0x33')](db[_0xbf40('0x5')][_0xbf40('0x15')](queryAgents));break;case'agent':_0x1788a8[_0x1487d0](_0xbf40('0x3e'));_0x1788a8[_0x1487d0]('voice:outbound');_0x253a51[_0xbf40('0x33')](_0x1b7870[_0xbf40('0x3f')]({'attributes':['id',_0xbf40('0x6')]}));_0x253a51[_0xbf40('0x33')](_0x1b7870['getChatQueues']({'attributes':['id','name']}));_0x253a51[_0xbf40('0x33')](_0x1b7870[_0xbf40('0x40')]({'attributes':['id',_0xbf40('0x6')]}));_0x253a51['push'](_0x1b7870['getSmsQueues']({'attributes':['id',_0xbf40('0x6')]}));_0x253a51['push'](_0x1b7870[_0xbf40('0x41')]({'attributes':['id','name']}));_0x253a51[_0xbf40('0x33')](_0x1b7870[_0xbf40('0x42')]({'attributes':['id','name']}));_0x253a51[_0xbf40('0x33')](_0x1b7870[_0xbf40('0x43')]({'attributes':['id','name']}));break;}return BPromise['all'](_0x253a51);}})[_0xbf40('0xd')](function(_0x17dc02){if(_0x17dc02&&_0x17dc02['length']){for(var _0x150fed=0x0;_0x150fed<_0x17dc02[_0xbf40('0x1e')];_0x150fed+=0x1){for(var _0x272b22=0x0;_0x272b22<_0x17dc02[_0x150fed][_0xbf40('0x1e')];_0x272b22+=0x1){switch(_0x150fed){case 0x0:joinOrLeaveQueues(_0x1788a8,_0x1487d0,_0xbf40('0x44'),_0x17dc02[_0x150fed][_0x272b22]);break;case 0x1:joinOrLeaveQueues(_0x1788a8,_0x1487d0,'chat',_0x17dc02[_0x150fed][_0x272b22]);break;case 0x2:joinOrLeaveQueues(_0x1788a8,_0x1487d0,_0xbf40('0x45'),_0x17dc02[_0x150fed][_0x272b22]);break;case 0x3:joinOrLeaveQueues(_0x1788a8,_0x1487d0,_0xbf40('0x46'),_0x17dc02[_0x150fed][_0x272b22]);break;case 0x4:joinOrLeaveQueues(_0x1788a8,_0x1487d0,_0xbf40('0x47'),_0x17dc02[_0x150fed][_0x272b22]);break;case 0x5:joinOrLeaveQueues(_0x1788a8,_0x1487d0,_0xbf40('0x48'),_0x17dc02[_0x150fed][_0x272b22]);break;case 0x6:joinOrLeaveQueues(_0x1788a8,_0x1487d0,_0xbf40('0x49'),_0x17dc02[_0x150fed][_0x272b22]);break;case 0x7:if(_0x1471ee[_0xbf40('0x7')]!==_0xbf40('0x8'))_0x1788a8[_0x1487d0](util['format']('telephone:%s',_0x17dc02[_0x150fed][_0x272b22][_0xbf40('0x6')]));break;case 0x8:if(_0x1471ee[_0xbf40('0x7')]!=='agent')_0x1788a8[_0x1487d0](util[_0xbf40('0x1f')](_0xbf40('0x4a'),_0x17dc02[_0x150fed][_0x272b22][_0xbf40('0x6')]));break;case 0x9:if(_0x1471ee['role']!==_0xbf40('0x8'))_0x1788a8[_0x1487d0](util[_0xbf40('0x1f')](_0xbf40('0x4b'),_0x17dc02[_0x150fed][_0x272b22]['type'],_0x17dc02[_0x150fed][_0x272b22][_0xbf40('0x6')]));break;case 0xa:_0x1788a8[_0x1487d0](util['format'](_0xbf40('0x20'),_0x17dc02[_0x150fed][_0x272b22]['name']));break;}}}}})[_0xbf40('0xd')](function(){if(_0x1487d0==='leave'){var _0x73ece5=_[_0xbf40('0x19')](_0x1471ee[_0xbf40('0x26')],'id');return _0x1471ee[_0xbf40('0x4c')](_0x73ece5)[_0xbf40('0xd')](function(){for(var _0x35c15b=0x0;_0x35c15b<_0x73ece5[_0xbf40('0x1e')];_0x35c15b+=0x1){_0x17fa9a[_0xbf40('0x4d')](_0xbf40('0x4e'),{'ChatInteractionId':Number(_0x73ece5[_0x35c15b]),'UserId':Number(_0x1471ee['id'])});}});}})['then'](function(){if(_0x1487d0===_0xbf40('0x4f')){var _0x504a5c=_['map'](_0x1471ee[_0xbf40('0x28')],'id');return _0x1471ee['removeMailInteractions'](_0x504a5c)[_0xbf40('0xd')](function(){for(var _0xb8a729=0x0;_0xb8a729<_0x504a5c[_0xbf40('0x1e')];_0xb8a729+=0x1){_0x17fa9a[_0xbf40('0x4d')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x504a5c[_0xb8a729]),'UserId':Number(_0x1471ee['id'])});}});}})['then'](function(){if(_0x1487d0===_0xbf40('0x4f')){var _0xc604e4=_['map'](_0x1471ee[_0xbf40('0x2a')],'id');return _0x1471ee['removeFaxInteractions'](_0xc604e4)[_0xbf40('0xd')](function(){for(var _0x500bc6=0x0;_0x500bc6<_0xc604e4['length'];_0x500bc6+=0x1){_0x17fa9a['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0xc604e4[_0x500bc6]),'UserId':Number(_0x1471ee['id'])});}});}})['then'](function(){if(_0x1487d0===_0xbf40('0x4f')){var _0x13c39f=_[_0xbf40('0x19')](_0x1471ee[_0xbf40('0x2c')],'id');return _0x1471ee[_0xbf40('0x50')](_0x13c39f)['then'](function(){for(var _0x280578=0x0;_0x280578<_0x13c39f[_0xbf40('0x1e')];_0x280578+=0x1){_0x17fa9a[_0xbf40('0x4d')](_0xbf40('0x51'),{'SmsInteractionId':Number(_0x13c39f[_0x280578]),'UserId':Number(_0x1471ee['id'])});}});}})[_0xbf40('0xd')](function(){if(_0x1487d0===_0xbf40('0x4f')){var _0x3bf438=_[_0xbf40('0x19')](_0x1471ee[_0xbf40('0x2d')],'id');return _0x1471ee[_0xbf40('0x52')](_0x3bf438)['then'](function(){for(var _0x48d9a4=0x0;_0x48d9a4<_0x3bf438[_0xbf40('0x1e')];_0x48d9a4+=0x1){_0x17fa9a[_0xbf40('0x4d')](_0xbf40('0x53'),{'OpenchannelInteractionId':Number(_0x3bf438[_0x48d9a4]),'UserId':Number(_0x1471ee['id'])});}});}})[_0xbf40('0xd')](function(){if(_0x1487d0===_0xbf40('0x4f')){var _0x47a1c6=_[_0xbf40('0x19')](_0x1471ee[_0xbf40('0x2e')],'id');return _0x1471ee[_0xbf40('0x54')](_0x47a1c6)[_0xbf40('0xd')](function(){for(var _0x236b41=0x0;_0x236b41<_0x47a1c6[_0xbf40('0x1e')];_0x236b41+=0x1){_0x17fa9a[_0xbf40('0x4d')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x47a1c6[_0x236b41]),'UserId':Number(_0x1471ee['id'])});}});}})[_0xbf40('0x55')](function(_0x2f9037){_0x1788a8[_0xbf40('0x56')](_0x2f9037);});}}function onDisconnect(_0x4b9f5d,_0x43a55b){joinOrLeave(_0x4b9f5d,_0xbf40('0x4f'),_0x43a55b);}function onConnect(_0x396970){joinOrLeave(_0x396970,_0xbf40('0x57'));}exports[_0xbf40('0x58')]=function(_0x3be6fe){_0x3be6fe['on'](_0xbf40('0x59'),function(_0x57a514){_0x57a514['setMaxListeners'](0x0);_0x57a514[_0xbf40('0x5a')]=_0x57a514[_0xbf40('0x5b')]['connection'][_0xbf40('0x5c')]+':'+_0x57a514[_0xbf40('0x5b')][_0xbf40('0x59')][_0xbf40('0x5d')];_0x57a514[_0xbf40('0x5e')]=new Date();_0x57a514['log']=function(_0x413e28){console[_0xbf40('0x56')]('SocketIO\x20'+_0x57a514[_0xbf40('0x5f')][_0xbf40('0x6')]+'['+_0x57a514[_0xbf40('0x5a')]+']',_0x413e28);};_0x57a514['on'](_0xbf40('0x60'),function(){onDisconnect(_0x57a514,_0x3be6fe);_0x57a514[_0xbf40('0x56')](_0xbf40('0x61'));});onConnect(_0x57a514);_0x57a514[_0xbf40('0x56')](_0xbf40('0x62'));});}; \ No newline at end of file +var _0x633b=['join','default','connection','setMaxListeners','address','request','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','Agents','User','name','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','UserProfileResource','resourceId','map','where','format','length','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','voice:outbound','ChatQueues','SmsQueues','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','chat','fax','mail','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log'];(function(_0x18d087,_0x92c5a9){var _0xf248b3=function(_0xa9de97){while(--_0xa9de97){_0x18d087['push'](_0x18d087['shift']());}};_0xf248b3(++_0x92c5a9);}(_0x633b,0xd8));var _0xb633=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x633b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb633('0x0'));var util=require(_0xb633('0x1'));var BPromise=require(_0xb633('0x2'));var db=require(_0xb633('0x3'))['db'];var config=require(_0xb633('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xb633('0x5'),'model':db[_0xb633('0x6')],'attributes':['id',_0xb633('0x7'),_0xb633('0x8')],'raw':!![],'where':{'role':_0xb633('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xb633('0x7')],'where':{'role':_0xb633('0xa')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xb633('0x7')],'where':{'role':_0xb633('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xb633('0xb')],'where':{'type':_0xb633('0xc')}};function getAssociatedResources(_0x331680,_0x26c666,_0x3d4b30){return db[_0xb633('0xd')][_0xb633('0xe')]({'where':{'name':_0x331680,'userProfileId':_0x26c666},'raw':!![]})[_0xb633('0xf')](function(_0x5ce24b){if(_0x5ce24b){if(_0x5ce24b[_0xb633('0x10')]){switch(_0x331680){case _0xb633('0x11'):case'ChatQueues':case _0xb633('0x12'):case'SmsQueues':case _0xb633('0x13'):case _0xb633('0x14'):case _0xb633('0x15'):return db[_0x3d4b30]['findAll'](queryQueues);case _0xb633('0x16'):return db[_0x3d4b30][_0xb633('0x17')](queryTelephones);case _0xb633('0x18'):return db[_0x3d4b30]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x3d4b30][_0xb633('0x17')](queryCampaigns);}}else{return db[_0xb633('0x19')]['findAll']({'attributes':[_0xb633('0x1a')],'where':{'sectionId':_0x5ce24b['id']},'raw':!![]})[_0xb633('0xf')](function(_0x1bbab8){if(_0x1bbab8){var _0x215128={'where':{'id':_[_0xb633('0x1b')](_0x1bbab8,_0xb633('0x1a'))},'raw':!![]};switch(_0x3d4b30){case'User':_0x215128['where'][_0xb633('0x8')]=_0xb633('0xa');break;case'Campaign':_0x215128[_0xb633('0x1c')]['type']=_0xb633('0xc');break;}return db[_0x3d4b30]['findAll'](_0x215128);}else{return[];}});}}else{return[];}})['then'](function(_0x3fc86b){return _0x3fc86b;});}function joinOrLeaveQueues(_0x9fb5de,_0x1f181f,_0xd5d83d,_0x32dbba){_0x9fb5de[_0x1f181f](util[_0xb633('0x1d')]('%s:queue:%s',_0xd5d83d,_0x32dbba[_0xb633('0x7')]));if(_0x32dbba[_0xb633('0x5')]){for(var _0x1bb40b=0x0;_0x1bb40b<_0x32dbba[_0xb633('0x5')][_0xb633('0x1e')];_0x1bb40b+=0x1){_0x9fb5de[_0x1f181f](util[_0xb633('0x1d')]('user:%s',_0x32dbba[_0xb633('0x5')][_0x1bb40b][_0xb633('0x7')]));}}}function joinOrLeave(_0x52e011,_0x58684f,_0x393f52){var _0x4a7269;if(_0x52e011['handshake'][_0xb633('0x1f')]['id']){db[_0xb633('0x6')][_0xb633('0x20')]({'attributes':['id',_0xb633('0x7'),_0xb633('0x8'),_0xb633('0x21')],'where':{'id':_0x52e011['handshake'][_0xb633('0x1f')]['id']},'include':[{'model':db[_0xb633('0x22')],'as':_0xb633('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xb633('0x24')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb633('0x25')],'as':_0xb633('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xb633('0x27')],'as':_0xb633('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xb633('0x29')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb633('0x2a')],'as':_0xb633('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xb633('0xf')](function(_0x3e47d1){if(_0x3e47d1){_0x4a7269=_0x3e47d1;_0x52e011[_0x58684f](util[_0xb633('0x1d')](_0xb633('0x2c'),_0x3e47d1[_0xb633('0x7')]));var _0x3a66b6=[];switch(_0x3e47d1[_0xb633('0x8')]){case _0xb633('0x2d'):_0x52e011[_0x58684f](_0xb633('0x2e'));_0x52e011[_0x58684f]('voice:outbound');if(queryQueues['hasOwnProperty'](_0xb633('0x2f'))){delete queryQueues[_0xb633('0x2f')];}_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x31')]['findAll'](queryQueues));_0x3a66b6['push'](db[_0xb633('0x32')]['findAll'](queryQueues));_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x33')]['findAll'](queryQueues));_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x34')][_0xb633('0x17')](queryQueues));_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x35')][_0xb633('0x17')](queryQueues));_0x3a66b6['push'](db[_0xb633('0x36')][_0xb633('0x17')](queryQueues));_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x37')][_0xb633('0x17')](queryQueues));_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x6')][_0xb633('0x17')](queryTelephones));_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x38')][_0xb633('0x17')](queryTrunks));_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x39')][_0xb633('0x17')](queryCampaigns));_0x3a66b6['push'](db[_0xb633('0x6')][_0xb633('0x17')](queryAgents));break;case _0xb633('0x3a'):_0x52e011[_0x58684f](_0xb633('0x2e'));_0x52e011[_0x58684f](_0xb633('0x3b'));_0x3a66b6[_0xb633('0x30')](getAssociatedResources(_0xb633('0x11'),_0x3e47d1[_0xb633('0x21')],'VoiceQueue'));_0x3a66b6[_0xb633('0x30')](getAssociatedResources(_0xb633('0x3c'),_0x3e47d1[_0xb633('0x21')],_0xb633('0x32')));_0x3a66b6[_0xb633('0x30')](getAssociatedResources(_0xb633('0x12'),_0x3e47d1[_0xb633('0x21')],_0xb633('0x33')));_0x3a66b6[_0xb633('0x30')](getAssociatedResources(_0xb633('0x3d'),_0x3e47d1[_0xb633('0x21')],_0xb633('0x34')));_0x3a66b6[_0xb633('0x30')](getAssociatedResources(_0xb633('0x13'),_0x3e47d1[_0xb633('0x21')],_0xb633('0x35')));_0x3a66b6[_0xb633('0x30')](getAssociatedResources(_0xb633('0x14'),_0x3e47d1['userProfileId'],_0xb633('0x36')));_0x3a66b6['push'](getAssociatedResources(_0xb633('0x15'),_0x3e47d1[_0xb633('0x21')],_0xb633('0x37')));_0x3a66b6['push'](getAssociatedResources(_0xb633('0x16'),_0x3e47d1[_0xb633('0x21')],'User'));_0x3a66b6[_0xb633('0x30')](getAssociatedResources(_0xb633('0x18'),_0x3e47d1[_0xb633('0x21')],_0xb633('0x38')));_0x3a66b6[_0xb633('0x30')](getAssociatedResources(_0xb633('0x3e'),_0x3e47d1[_0xb633('0x21')],_0xb633('0x39')));_0x3a66b6[_0xb633('0x30')](db[_0xb633('0x6')][_0xb633('0x17')](queryAgents));break;case _0xb633('0x9'):_0x52e011[_0x58684f](_0xb633('0x2e'));_0x52e011[_0x58684f](_0xb633('0x3b'));_0x3a66b6[_0xb633('0x30')](_0x3e47d1[_0xb633('0x3f')]({'attributes':['id','name']}));_0x3a66b6[_0xb633('0x30')](_0x3e47d1[_0xb633('0x40')]({'attributes':['id',_0xb633('0x7')]}));_0x3a66b6[_0xb633('0x30')](_0x3e47d1[_0xb633('0x41')]({'attributes':['id','name']}));_0x3a66b6['push'](_0x3e47d1[_0xb633('0x42')]({'attributes':['id','name']}));_0x3a66b6['push'](_0x3e47d1['getMailQueues']({'attributes':['id','name']}));_0x3a66b6[_0xb633('0x30')](_0x3e47d1[_0xb633('0x43')]({'attributes':['id',_0xb633('0x7')]}));_0x3a66b6[_0xb633('0x30')](_0x3e47d1[_0xb633('0x44')]({'attributes':['id','name']}));break;}return BPromise['all'](_0x3a66b6);}})[_0xb633('0xf')](function(_0xff1f58){if(_0xff1f58&&_0xff1f58[_0xb633('0x1e')]){for(var _0x2d7340=0x0;_0x2d7340<_0xff1f58[_0xb633('0x1e')];_0x2d7340+=0x1){for(var _0x262086=0x0;_0x262086<_0xff1f58[_0x2d7340][_0xb633('0x1e')];_0x262086+=0x1){switch(_0x2d7340){case 0x0:joinOrLeaveQueues(_0x52e011,_0x58684f,'voice',_0xff1f58[_0x2d7340][_0x262086]);break;case 0x1:joinOrLeaveQueues(_0x52e011,_0x58684f,_0xb633('0x45'),_0xff1f58[_0x2d7340][_0x262086]);break;case 0x2:joinOrLeaveQueues(_0x52e011,_0x58684f,_0xb633('0x46'),_0xff1f58[_0x2d7340][_0x262086]);break;case 0x3:joinOrLeaveQueues(_0x52e011,_0x58684f,'sms',_0xff1f58[_0x2d7340][_0x262086]);break;case 0x4:joinOrLeaveQueues(_0x52e011,_0x58684f,_0xb633('0x47'),_0xff1f58[_0x2d7340][_0x262086]);break;case 0x5:joinOrLeaveQueues(_0x52e011,_0x58684f,'openchannel',_0xff1f58[_0x2d7340][_0x262086]);break;case 0x6:joinOrLeaveQueues(_0x52e011,_0x58684f,'whatsapp',_0xff1f58[_0x2d7340][_0x262086]);break;case 0x7:if(_0x4a7269[_0xb633('0x8')]!==_0xb633('0x9'))_0x52e011[_0x58684f](util['format'](_0xb633('0x48'),_0xff1f58[_0x2d7340][_0x262086][_0xb633('0x7')]));break;case 0x8:if(_0x4a7269[_0xb633('0x8')]!==_0xb633('0x9'))_0x52e011[_0x58684f](util[_0xb633('0x1d')](_0xb633('0x49'),_0xff1f58[_0x2d7340][_0x262086][_0xb633('0x7')]));break;case 0x9:if(_0x4a7269[_0xb633('0x8')]!==_0xb633('0x9'))_0x52e011[_0x58684f](util[_0xb633('0x1d')]('campaign:%s:%s',_0xff1f58[_0x2d7340][_0x262086][_0xb633('0xb')],_0xff1f58[_0x2d7340][_0x262086][_0xb633('0x7')]));break;case 0xa:_0x52e011[_0x58684f](util[_0xb633('0x1d')]('user:%s',_0xff1f58[_0x2d7340][_0x262086]['name']));break;}}}}})[_0xb633('0xf')](function(){if(_0x58684f===_0xb633('0x4a')){var _0x55b7de=_[_0xb633('0x1b')](_0x4a7269[_0xb633('0x23')],'id');return _0x4a7269[_0xb633('0x4b')](_0x55b7de)[_0xb633('0xf')](function(){for(var _0x2693cb=0x0;_0x2693cb<_0x55b7de[_0xb633('0x1e')];_0x2693cb+=0x1){_0x393f52[_0xb633('0x4c')](_0xb633('0x4d'),{'ChatInteractionId':Number(_0x55b7de[_0x2693cb]),'UserId':Number(_0x4a7269['id'])});}});}})[_0xb633('0xf')](function(){if(_0x58684f===_0xb633('0x4a')){var _0x9715cb=_[_0xb633('0x1b')](_0x4a7269[_0xb633('0x4e')],'id');return _0x4a7269[_0xb633('0x4f')](_0x9715cb)[_0xb633('0xf')](function(){for(var _0x221e78=0x0;_0x221e78<_0x9715cb[_0xb633('0x1e')];_0x221e78+=0x1){_0x393f52[_0xb633('0x4c')](_0xb633('0x50'),{'MailInteractionId':Number(_0x9715cb[_0x221e78]),'UserId':Number(_0x4a7269['id'])});}});}})[_0xb633('0xf')](function(){if(_0x58684f===_0xb633('0x4a')){var _0x773da=_['map'](_0x4a7269['FaxInteractions'],'id');return _0x4a7269['removeFaxInteractions'](_0x773da)[_0xb633('0xf')](function(){for(var _0x4ec5d1=0x0;_0x4ec5d1<_0x773da[_0xb633('0x1e')];_0x4ec5d1+=0x1){_0x393f52[_0xb633('0x4c')](_0xb633('0x51'),{'FaxInteractionId':Number(_0x773da[_0x4ec5d1]),'UserId':Number(_0x4a7269['id'])});}});}})['then'](function(){if(_0x58684f===_0xb633('0x4a')){var _0x53e905=_['map'](_0x4a7269[_0xb633('0x28')],'id');return _0x4a7269[_0xb633('0x52')](_0x53e905)['then'](function(){for(var _0x42d9b4=0x0;_0x42d9b4<_0x53e905[_0xb633('0x1e')];_0x42d9b4+=0x1){_0x393f52[_0xb633('0x4c')](_0xb633('0x53'),{'SmsInteractionId':Number(_0x53e905[_0x42d9b4]),'UserId':Number(_0x4a7269['id'])});}});}})[_0xb633('0xf')](function(){if(_0x58684f===_0xb633('0x4a')){var _0xbd331e=_[_0xb633('0x1b')](_0x4a7269[_0xb633('0x54')],'id');return _0x4a7269[_0xb633('0x55')](_0xbd331e)[_0xb633('0xf')](function(){for(var _0x2dce97=0x0;_0x2dce97<_0xbd331e[_0xb633('0x1e')];_0x2dce97+=0x1){_0x393f52[_0xb633('0x4c')](_0xb633('0x56'),{'OpenchannelInteractionId':Number(_0xbd331e[_0x2dce97]),'UserId':Number(_0x4a7269['id'])});}});}})[_0xb633('0xf')](function(){if(_0x58684f===_0xb633('0x4a')){var _0x4606dd=_['map'](_0x4a7269['WhatsappInteractions'],'id');return _0x4a7269[_0xb633('0x57')](_0x4606dd)[_0xb633('0xf')](function(){for(var _0x35496c=0x0;_0x35496c<_0x4606dd[_0xb633('0x1e')];_0x35496c+=0x1){_0x393f52['emit'](_0xb633('0x58'),{'WhatsappInteractionId':Number(_0x4606dd[_0x35496c]),'UserId':Number(_0x4a7269['id'])});}});}})['catch'](function(_0x6f830e){_0x52e011[_0xb633('0x59')](_0x6f830e);});}}function onDisconnect(_0x18a3f9,_0x108843){joinOrLeave(_0x18a3f9,_0xb633('0x4a'),_0x108843);}function onConnect(_0x55a724){joinOrLeave(_0x55a724,_0xb633('0x5a'));}exports[_0xb633('0x5b')]=function(_0xba0f43){_0xba0f43['on'](_0xb633('0x5c'),function(_0x4bd993){_0x4bd993[_0xb633('0x5d')](0x0);_0x4bd993[_0xb633('0x5e')]=_0x4bd993['request'][_0xb633('0x5c')]['remoteAddress']+':'+_0x4bd993[_0xb633('0x5f')]['connection'][_0xb633('0x60')];_0x4bd993['connectedAt']=new Date();_0x4bd993[_0xb633('0x59')]=function(_0x30ce50){console[_0xb633('0x59')](_0xb633('0x61')+_0x4bd993[_0xb633('0x62')][_0xb633('0x7')]+'['+_0x4bd993['address']+']',_0x30ce50);};_0x4bd993['on'](_0xb633('0x63'),function(){onDisconnect(_0x4bd993,_0xba0f43);_0x4bd993[_0xb633('0x59')](_0xb633('0x64'));});onConnect(_0x4bd993);_0x4bd993[_0xb633('0x59')](_0xb633('0x65'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index d0698c9..69aeaa9 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 _0x6cea=['SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','Sequelize','SELECT','then','contact','UserId','undefined','format','SIP/%s','name','agent','incomingmessage','get','motionChannel','interface','AfterCreate','changed','closed','substatus','QueryTypes','User','find','fullname','email','internal','default','length','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','http','ChatInteraction','Chat','closedinteraction','afterCreate','newmessage','ChatOfflineMessage','Sms','SmsInteraction','newinteraction','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','info','Trigger,\x20%s','error','code','catch','channel','event','direction','resolve'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6cea,0xb7));var _0xa6ce=function(_0x3cc8b2,_0x1f10ba){_0x3cc8b2=_0x3cc8b2-0x0;var _0x52a228=_0x6cea[_0x3cc8b2];return _0x52a228;};'use strict';var util=require(_0xa6ce('0x0'));var db=require(_0xa6ce('0x1'))['db'];var jayson=require(_0xa6ce('0x2'));var logger=require(_0xa6ce('0x3'))(_0xa6ce('0x4'));var client=jayson[_0xa6ce('0x5')][_0xa6ce('0x6')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xa6ce('0x7'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xa6ce('0x8'),'model':_0xa6ce('0x7'),'event':'afterUpdate','condition':_0xa6ce('0x9'),'callback':afterUpdate},{'channel':_0xa6ce('0x8'),'model':'ChatMessage','event':_0xa6ce('0xa'),'condition':_0xa6ce('0xb'),'callback':afterCreateMessage},{'channel':_0xa6ce('0x8'),'model':_0xa6ce('0xc'),'event':_0xa6ce('0xa'),'condition':_0xa6ce('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0xa6ce('0xd'),'model':_0xa6ce('0xe'),'event':'afterCreate','condition':_0xa6ce('0xf'),'callback':afterCreate},{'channel':_0xa6ce('0xd'),'model':_0xa6ce('0xe'),'event':_0xa6ce('0x10'),'condition':_0xa6ce('0x9'),'callback':afterUpdate},{'channel':_0xa6ce('0xd'),'model':_0xa6ce('0x11'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xa6ce('0x12'),'model':_0xa6ce('0x13'),'event':_0xa6ce('0xa'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xa6ce('0x12'),'model':_0xa6ce('0x13'),'event':_0xa6ce('0x10'),'condition':_0xa6ce('0x9'),'callback':afterUpdate},{'channel':_0xa6ce('0x12'),'model':_0xa6ce('0x14'),'event':_0xa6ce('0xa'),'condition':_0xa6ce('0xb'),'callback':afterCreateMessage},{'channel':_0xa6ce('0x15'),'model':_0xa6ce('0x16'),'event':_0xa6ce('0xa'),'condition':_0xa6ce('0xf'),'callback':afterCreate},{'channel':_0xa6ce('0x15'),'model':'FaxInteraction','event':_0xa6ce('0x10'),'condition':_0xa6ce('0x9'),'callback':afterUpdate},{'channel':_0xa6ce('0x15'),'model':'FaxMessage','event':_0xa6ce('0xa'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xa6ce('0x17'),'model':_0xa6ce('0x18'),'event':_0xa6ce('0xa'),'condition':_0xa6ce('0xf'),'callback':afterCreate},{'channel':_0xa6ce('0x17'),'model':_0xa6ce('0x18'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xa6ce('0x17'),'model':_0xa6ce('0x19'),'event':_0xa6ce('0xa'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xa6ce('0x1a'),'model':_0xa6ce('0x1b'),'event':_0xa6ce('0xa'),'condition':_0xa6ce('0xf'),'callback':afterCreate},{'channel':'Openchannel','model':_0xa6ce('0x1b'),'event':_0xa6ce('0x10'),'condition':_0xa6ce('0x9'),'callback':afterUpdate},{'channel':_0xa6ce('0x1a'),'model':'OpenchannelMessage','event':'afterCreate','condition':_0xa6ce('0xb'),'callback':afterCreateMessage}];function request(_0x1c2d8a){return client[_0xa6ce('0x1c')](_0xa6ce('0x1d'),_0x1c2d8a)['then'](function(_0x8614bc){logger[_0xa6ce('0x1e')](_0xa6ce('0x1f'),_0xa6ce('0x1d'),_0x8614bc);if(_0x8614bc[_0xa6ce('0x20')]){if(_0x8614bc[_0xa6ce('0x20')][_0xa6ce('0x21')]===0x1f4){logger[_0xa6ce('0x20')](_0xa6ce('0x1f'),'EventManager',_0x8614bc[_0xa6ce('0x20')]);}}})[_0xa6ce('0x22')](function(_0x6446ba){logger[_0xa6ce('0x20')]('Trigger,\x20%s',_0xa6ce('0x1d'),_0x6446ba);});}function afterCreateMessage(_0x228bcf){return function(_0x562443){_0x562443=_0x562443['get']({'plain':!![]});_0x562443[_0xa6ce('0x23')]=_0x228bcf;_0x562443['motionChannel']=_0x228bcf;_0x562443[_0xa6ce('0x24')]=_0x562443[_0xa6ce('0x25')];Promise[_0xa6ce('0x26')]()['then'](function(){if(typeof _0x562443['ContactId']==='undefined')return null;var _0x2372a5=_0xa6ce('0x27')+_0x562443[_0xa6ce('0x28')];return db[_0xa6ce('0x29')][_0xa6ce('0x2a')](_0x2372a5,{'type':db[_0xa6ce('0x2b')]['QueryTypes'][_0xa6ce('0x2c')],'raw':!![]});})[_0xa6ce('0x2d')](function(_0x208097){if(_0x208097){_0x562443[_0xa6ce('0x2e')]=_0x208097[0x0];}if(typeof _0x562443[_0xa6ce('0x2f')]===_0xa6ce('0x30'))return;return getAgent(_0x562443[_0xa6ce('0x2f')]);})[_0xa6ce('0x2d')](function(_0x30c39f){if(_0x30c39f){_0x562443['interface']=util[_0xa6ce('0x31')](_0xa6ce('0x32'),_0x30c39f[_0xa6ce('0x33')]);_0x562443[_0xa6ce('0x34')]=_0x30c39f;_0x562443[_0xa6ce('0x23')]=_0x228bcf;return request({'event':_0xa6ce('0x35'),'message':_0x562443});}else{return request({'event':'outgoingmessage','message':_0x562443});}})['catch'](function(_0x74846e){logger[_0xa6ce('0x20')](_0xa6ce('0x1f'),'AfterCreateMessage',_0x74846e);});};}function afterCreateOfflineMessage(_0x29f441){return function(_0x73c3d7){_0x73c3d7=_0x73c3d7['get']({'plain':!![]});_0x73c3d7[_0xa6ce('0x23')]=_0x29f441;_0x73c3d7['motionChannel']=_0x29f441;_0x73c3d7[_0xa6ce('0x24')]='offlineMessage';return request({'event':_0x73c3d7['event'],'message':_0x73c3d7});};}function afterCreate(_0x48548d,_0x278bcf){return function(_0x16a161){_0x16a161=_0x16a161[_0xa6ce('0x36')]({'plain':!![]});_0x16a161['channel']=_0x48548d;_0x16a161[_0xa6ce('0x37')]=_0x48548d;_0x16a161['event']='opened';Promise['resolve']()[_0xa6ce('0x2d')](function(){var _0x436248=_0xa6ce('0x27')+_0x16a161[_0xa6ce('0x28')];return db[_0xa6ce('0x29')][_0xa6ce('0x2a')](_0x436248,{'type':db[_0xa6ce('0x2b')]['QueryTypes'][_0xa6ce('0x2c')],'raw':!![]});})[_0xa6ce('0x2d')](function(_0x3273ae){if(_0x3273ae){_0x16a161[_0xa6ce('0x2e')]=_0x3273ae[0x0];}if(typeof _0x16a161[_0xa6ce('0x2f')]===_0xa6ce('0x30'))return;return getAgent(_0x16a161[_0xa6ce('0x2f')]);})[_0xa6ce('0x2d')](function(_0x233cf9){if(_0x233cf9){_0x16a161[_0xa6ce('0x38')]=util['format'](_0xa6ce('0x32'),_0x233cf9[_0xa6ce('0x33')]);_0x16a161[_0xa6ce('0x34')]=_0x233cf9;}return request({'event':_0x278bcf,'message':_0x16a161});})[_0xa6ce('0x22')](function(_0x4e9f11){logger[_0xa6ce('0x20')](_0xa6ce('0x1f'),_0xa6ce('0x39'),_0x4e9f11);});};}function afterUpdate(_0x1ac813){return function(_0x238438){var _0x2937cc=_0x238438[_0xa6ce('0x3a')]('closed')&&_0x238438[_0xa6ce('0x3b')];var _0x1178c9=_0x238438[_0xa6ce('0x3a')](_0xa6ce('0x3c'));if(_0x2937cc||_0x1178c9){var _0x23afdd=_0x2937cc?'closedinteraction':'substatus';var _0x1b0108=_0x238438['get']({'plain':!![]});_0x1b0108['channel']=_0x1ac813;_0x1b0108[_0xa6ce('0x37')]=_0x1ac813;_0x1b0108[_0xa6ce('0x24')]=_0x2937cc?'closed':_0xa6ce('0x3c');var _0x57cb52=_0xa6ce('0x27')+_0x1b0108[_0xa6ce('0x28')];return db[_0xa6ce('0x29')][_0xa6ce('0x2a')](_0x57cb52,{'type':db[_0xa6ce('0x2b')][_0xa6ce('0x3d')][_0xa6ce('0x2c')],'raw':!![]})[_0xa6ce('0x2d')](function(_0x38a49b){if(_0x38a49b){_0x1b0108[_0xa6ce('0x2e')]=_0x38a49b[0x0];}if(typeof _0x1b0108['UserId']===_0xa6ce('0x30'))return;return getAgent(_0x1b0108[_0xa6ce('0x2f')]);})[_0xa6ce('0x2d')](function(_0x1747a4){if(_0x1747a4){_0x1b0108['interface']=util[_0xa6ce('0x31')](_0xa6ce('0x32'),_0x1747a4[_0xa6ce('0x33')]);_0x1b0108[_0xa6ce('0x34')]=_0x1747a4;}return request({'event':_0x23afdd,'message':_0x1b0108});})[_0xa6ce('0x22')](function(_0x4c2f1e){logger[_0xa6ce('0x20')](_0xa6ce('0x1f'),'AfterUpdate',_0x4c2f1e);});}};}function getAgent(_0x24e51b){return db[_0xa6ce('0x3e')][_0xa6ce('0x3f')]({'where':{'id':_0x24e51b},'attributes':['id',_0xa6ce('0x33'),_0xa6ce('0x40'),_0xa6ce('0x41'),_0xa6ce('0x42')],'raw':!![]})[_0xa6ce('0x2d')](function(_0x5e5f7c){return _0x5e5f7c;});}exports[_0xa6ce('0x43')]=function(){for(var _0x54336c=0x0;_0x54336c=_0x7cbfff[_0x7e4a('0x12')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x48cb05(_0xc5e6e4);})['catch'](function(_0x31e9fd){_0x56e34c(_0x31e9fd);});});}; \ No newline at end of file +var _0x1f69=['then','agents','catch','lodash','../mysqldb','./license/util','voice','chat','fax','whatsapp','openchannel','getChannels','toLowerCase','clearBlockUser','isUndefined','updateAttributes','getLicense','role','User','agent'];(function(_0x1b68ba,_0x23687a){var _0xf49b11=function(_0x5732c6){while(--_0x5732c6){_0x1b68ba['push'](_0x1b68ba['shift']());}};_0xf49b11(++_0x23687a);}(_0x1f69,0xcb));var _0x91f6=function(_0xe19f31,_0x43c71d){_0xe19f31=_0xe19f31-0x0;var _0x5b6bd4=_0x1f69[_0xe19f31];return _0x5b6bd4;};'use strict';var _=require(_0x91f6('0x0'));var BPromise=require('bluebird');var db=require(_0x91f6('0x1'))['db'];var util=require(_0x91f6('0x2'));var channels=[_0x91f6('0x3'),'mail',_0x91f6('0x4'),_0x91f6('0x5'),'sms',_0x91f6('0x6'),_0x91f6('0x7')];exports[_0x91f6('0x8')]=function(){return channels;};exports['isValidChannel']=function(_0x2150e3){_0x2150e3=_0x2150e3[_0x91f6('0x9')]();return _['includes'](channels,_0x2150e3);};exports[_0x91f6('0xa')]=function(_0x458584,_0x11cddf,_0x58a30c,_0x3b95c9){var _0x4ee4c8={'loginAttempts':_0x11cddf,'blocked':_0x58a30c};if(!_[_0x91f6('0xb')](_0x3b95c9)){_0x4ee4c8['blockedAt']=_0x3b95c9;}return _0x458584[_0x91f6('0xc')](_0x4ee4c8);};exports[_0x91f6('0xd')]=function(_0x217f5b){return new BPromise(function(_0x18c605,_0x131fab){var _0x5abe65=0x0;if(_0x217f5b[_0x91f6('0xe')]!=='agent'){_0x18c605(_0x217f5b);}db[_0x91f6('0xf')]['count']({'where':{'role':_0x91f6('0x10'),'online':!![],'id':{'$ne':_0x217f5b['id']}}})[_0x91f6('0x11')](function(_0x1bb1cf){_0x5abe65=_0x1bb1cf;return util[_0x91f6('0xd')]();})['then'](function(_0xb8c496){if(_0xb8c496&&_0xb8c496[_0x91f6('0x12')]&&_0x5abe65>=_0xb8c496[_0x91f6('0x12')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x18c605(_0x217f5b);})[_0x91f6('0x13')](function(_0x2f20a0){_0x131fab(_0x2f20a0);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 97fcfdb..3ce7ade 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bbb=['Entity\x20not\x20found','Not\x20Found','Out\x20Of\x20Interval','code','details','Resource\x20Conflict','Conflict','error','stack','statusMessage','send','exports','util','message','Internal\x20Server\x20Error','Error','name','Bad\x20Request','inherits','Forbidden'];(function(_0x2f87cd,_0xcaf299){var _0x5d7eda=function(_0x37ffb0){while(--_0x37ffb0){_0x2f87cd['push'](_0x2f87cd['shift']());}};_0x5d7eda(++_0xcaf299);}(_0x8bbb,0x84));var _0xb8bb=function(_0x1cc961,_0x2c42ee){_0x1cc961=_0x1cc961-0x0;var _0x471d86=_0x8bbb[_0x1cc961];return _0x471d86;};'use strict';var util=require(_0xb8bb('0x0'));var logger=require('../config/logger')('api');var APIError=function(_0x3a6a7c,_0x53b115){this[_0xb8bb('0x1')]=_0x3a6a7c||_0xb8bb('0x2');this['name']=_0x53b115||_0xb8bb('0x3');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x44868c){this[_0xb8bb('0x1')]=_0x44868c||'Bad\x20Request';this[_0xb8bb('0x4')]=_0xb8bb('0x5');util[_0xb8bb('0x6')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x50552f){this[_0xb8bb('0x1')]=_0x50552f||_0xb8bb('0x7');this[_0xb8bb('0x4')]=_0xb8bb('0x7');util[_0xb8bb('0x6')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x5c0a3c){this[_0xb8bb('0x1')]=_0x5c0a3c||_0xb8bb('0x8');this[_0xb8bb('0x4')]=_0xb8bb('0x9');util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x275d30){this[_0xb8bb('0x1')]=_0x275d30||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this['name']=_0xb8bb('0xa');this[_0xb8bb('0xb')]=0x193;this[_0xb8bb('0xc')]={'type':'OutOfInterval'};util[_0xb8bb('0x6')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x3a1936){this[_0xb8bb('0x1')]=_0x3a1936||_0xb8bb('0xd');this[_0xb8bb('0x4')]=_0xb8bb('0xe');util[_0xb8bb('0x6')](APIBadRequestError,APIError);};function getStatusCode(_0x14895b){switch(_0x14895b){case _0xb8bb('0x5'):return 0x190;case _0xb8bb('0x7'),_0xb8bb('0xa'):return 0x193;case _0xb8bb('0x9'):return 0x194;case'Conflict':return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x1c9faa){if(_0x1c9faa===_0xb8bb('0xa'))return _0x1c9faa;return null;}function handleError(_0x33dac4){return function(_0x4d7823){logger[_0xb8bb('0xf')](_0x4d7823[_0xb8bb('0x10')]);var _0x2a4cc2=getStatusCode(_0x4d7823['name']);var _0x2899ab=getCustomStatusMessage(_0x4d7823['name']);if(_0x4d7823['name']){delete _0x4d7823[_0xb8bb('0x4')];}if(_0x2899ab){_0x33dac4[_0xb8bb('0x11')]=_0x2899ab;}return _0x33dac4['status'](_0x2a4cc2)[_0xb8bb('0x12')](_0x4d7823);};}module[_0xb8bb('0x13')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file +var _0xb87d=['util','../config/logger','api','message','Internal\x20Server\x20Error','name','Error','Bad\x20Request','Forbidden','Entity\x20not\x20found','Not\x20Found','inherits','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','code','details','OutOfInterval','Resource\x20Conflict','Conflict','error','stack','statusMessage','status','send'];(function(_0x5b013f,_0xddff1d){var _0x27b5d3=function(_0xf8452){while(--_0xf8452){_0x5b013f['push'](_0x5b013f['shift']());}};_0x27b5d3(++_0xddff1d);}(_0xb87d,0x180));var _0xdb87=function(_0x53a0cc,_0x1fa342){_0x53a0cc=_0x53a0cc-0x0;var _0x382e48=_0xb87d[_0x53a0cc];return _0x382e48;};'use strict';var util=require(_0xdb87('0x0'));var logger=require(_0xdb87('0x1'))(_0xdb87('0x2'));var APIError=function(_0x5042e3,_0x3cd22a){this[_0xdb87('0x3')]=_0x5042e3||_0xdb87('0x4');this[_0xdb87('0x5')]=_0x3cd22a||_0xdb87('0x6');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x977fb2){this[_0xdb87('0x3')]=_0x977fb2||_0xdb87('0x7');this[_0xdb87('0x5')]=_0xdb87('0x7');util['inherits'](APIBadRequestError,APIError);};var APIForbiddenError=function(_0xda3b9a){this['message']=_0xda3b9a||_0xdb87('0x8');this[_0xdb87('0x5')]=_0xdb87('0x8');util['inherits'](APIForbiddenError,APIError);};var APINotFoundError=function(_0x3d21e4){this[_0xdb87('0x3')]=_0x3d21e4||_0xdb87('0x9');this[_0xdb87('0x5')]=_0xdb87('0xa');util[_0xdb87('0xb')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x545750){this['message']=_0x545750||_0xdb87('0xc');this['name']=_0xdb87('0xd');this[_0xdb87('0xe')]=0x193;this[_0xdb87('0xf')]={'type':_0xdb87('0x10')};util[_0xdb87('0xb')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x219eff){this['message']=_0x219eff||_0xdb87('0x11');this[_0xdb87('0x5')]=_0xdb87('0x12');util[_0xdb87('0xb')](APIBadRequestError,APIError);};function getStatusCode(_0x194aec){switch(_0x194aec){case _0xdb87('0x7'):return 0x190;case'Forbidden',_0xdb87('0xd'):return 0x193;case _0xdb87('0xa'):return 0x194;case'Conflict':return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x1b276f){if(_0x1b276f==='Out\x20Of\x20Interval')return _0x1b276f;return null;}function handleError(_0x44a378){return function(_0xffc217){logger[_0xdb87('0x13')](_0xffc217[_0xdb87('0x14')]);var _0x294c21=getStatusCode(_0xffc217[_0xdb87('0x5')]);var _0x646178=getCustomStatusMessage(_0xffc217[_0xdb87('0x5')]);if(_0xffc217[_0xdb87('0x5')]){delete _0xffc217['name'];}if(_0x646178){_0x44a378[_0xdb87('0x15')]=_0x646178;}return _0x44a378[_0xdb87('0x16')](_0x294c21)[_0xdb87('0x17')](_0xffc217);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 4781701..ceafae5 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb544=['404','status','render','json'];(function(_0x5e003b,_0x40566e){var _0x4603ac=function(_0x34d193){while(--_0x34d193){_0x5e003b['push'](_0x5e003b['shift']());}};_0x4603ac(++_0x40566e);}(_0xb544,0xd0));var _0x4b54=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xb544[_0xaa1b3e];return _0x454d7d;};'use strict';module['exports'][0x194]=function pageNotFound(_0x540caf,_0x2f8897){var _0x45af45=_0x4b54('0x0');var _0x3442ff=0x194;var _0xc4666b={'status':_0x3442ff};_0x2f8897[_0x4b54('0x1')](_0xc4666b[_0x4b54('0x1')]);_0x2f8897[_0x4b54('0x2')](_0x45af45,{},function(_0x4e75e5,_0x56747e){if(_0x4e75e5){return _0x2f8897['status'](_0xc4666b['status'])[_0x4b54('0x3')](_0xc4666b);}_0x2f8897['send'](_0x56747e);});}; \ No newline at end of file +var _0x3abc=['json','send','exports','status'];(function(_0x1ef960,_0x1d3bdd){var _0x239917=function(_0x3ac51e){while(--_0x3ac51e){_0x1ef960['push'](_0x1ef960['shift']());}};_0x239917(++_0x1d3bdd);}(_0x3abc,0x166));var _0xc3ab=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x3abc[_0x34bf97];return _0x292719;};'use strict';module[_0xc3ab('0x0')][0x194]=function pageNotFound(_0x1ab63b,_0x49d5b0){var _0x2c0cc4='404';var _0x40be31=0x194;var _0x70a29a={'status':_0x40be31};_0x49d5b0['status'](_0x70a29a[_0xc3ab('0x1')]);_0x49d5b0['render'](_0x2c0cc4,{},function(_0x25d11c,_0x4dea56){if(_0x25d11c){return _0x49d5b0[_0xc3ab('0x1')](_0x70a29a['status'])[_0xc3ab('0x2')](_0x70a29a);}_0x49d5b0[_0xc3ab('0x3')](_0x4dea56);});}; \ No newline at end of file diff --git a/server/files/chat/iframe.ejs b/server/files/chat/iframe.ejs index ae77249..ae3ec99 100644 --- a/server/files/chat/iframe.ejs +++ b/server/files/chat/iframe.ejs @@ -6,7 +6,7 @@ throw new Error(`Domain "${window.location.origin}"" can't load snippet for '{{{chatWebsiteAddressOrigin}}}'. Please check your website domain in the current XCALLY Chat Website settings.`); } } catch (error) { - console.warn(`Domain ${window.location.origin} can't load snippet for '{{{chatWebsiteAddressOrigin}}}'. Please check your website domain in the current XCALLY Chat Website settings.`); + window.alert(`Domain ${window.location.origin} can't load snippet for '{{{chatWebsiteAddressOrigin}}}'. Please check your website domain in the current XCALLY Chat Website settings.`); return; } diff --git a/server/migrations/2.6.29.js b/server/migrations/2.6.29.js deleted file mode 100644 index a59425a..0000000 --- a/server/migrations/2.6.29.js +++ /dev/null @@ -1,169 +0,0 @@ -'use strict'; - -var BPromise = require('bluebird'); -var util = require('util'); -var logger = require('../config/logger')('migration'); -var Sequence = function() {}; - -Sequence.prototype.enqueue = function(fn) { - this.tail = this.tail ? this.tail.finally(fn) : fn(); -}; - -var Migration = function(queryInterface) { - this.queryInterface = queryInterface; - this.sequence = new Sequence(); -}; - -Migration.prototype.changeColumn = function(table, column, type) { - var _this = this; - this.sequence.enqueue(function() { - return _this.queryInterface - .changeColumn(table, column, type) - .then(function() { - logger.info('Changed column %s in table %s', column, table); - }) - .catch(function(err) { - logger.info(JSON.stringify(err)); - }); - }); -}; - -Migration.prototype.addColumn = function(table, column, type) { - var _this = this; - this.sequence.enqueue(function() { - return _this.queryInterface - .addColumn(table, column, type) - .then(function() { - logger.info('Added column %s to %s', column, table); - }) - .catch(function(err) { - logger.info(JSON.stringify(err)); - }); - }); -}; - -Migration.prototype.dropTable = function(table) { - var _this = this; - this.sequence.enqueue(function() { - return _this.queryInterface - .dropTable(table, { - force: true, - }) - .then(function() { - logger.info('table dropped %s', table); - }) - .catch(function(err) { - logger.info(JSON.stringify(err)); - }); - }); -}; - -Migration.prototype.addIndex = function(table, column, indexName) { - var _this = this; - this.sequence.enqueue(function() { - return _this.queryInterface - .addIndex(table, column, { - indexName: indexName, - }) - .then(function() { - logger.info('addIndex %s %s %s', table, column.join(','), indexName); - }) - .catch(function(err) { - logger.info(JSON.stringify(err)); - }); - }); -}; - -Migration.prototype.removeIndex = function(table, indexName) { - var _this = this; - this.sequence.enqueue(function() { - return _this.queryInterface - .removeIndex(table, indexName) - .then(function() { - logger.info('removeIndex %s %s', table, indexName); - }) - .catch(function(err) { - logger.info(JSON.stringify(err)); - }); - }); -}; - -Migration.prototype.query = function(sql) { - var _this = this; - this.sequence.enqueue(function() { - return _this.queryInterface.sequelize - .query(sql) - .then(function() { - logger.info('query %s', sql); - }) - .catch(function(err) { - logger.info(JSON.stringify(err)); - }); - }); -}; - -Migration.prototype.removeColumn = function(table, column) { - var _this = this; - this.sequence.enqueue(function() { - return _this.queryInterface - .removeColumn(table, column) - .then(function() { - logger.info('Removed column %s from %s', column, table); - }) - .catch(function(err) { - logger.info( - util.inspect(err, { - showHidden: false, - depth: null, - }) - ); - }); - }); -}; - -Migration.prototype.renameColumn = function(table, oldColumn, newColumn) { - var _this = this; - this.sequence.enqueue(function() { - return _this.queryInterface - .renameColumn(table, oldColumn, newColumn) - .then(function() { - logger.info( - 'Renamed column from %s to %s on %s', - oldColumn, - newColumn, - table - ); - }) - .catch(function(err) { - logger.info( - util.inspect(err, { - showHidden: false, - depth: null, - }) - ); - }); - }); -}; - -Migration.prototype.final = function(resolve) { - this.sequence.enqueue(function() { - return resolve(); - }); -}; - -module.exports = { - up: function(queryInterface /*, Sequelize */) { - return new BPromise(function(resolve) { - var migration = new Migration(queryInterface); - // Add your migration code here - - // START FINAL - migration.final(resolve); - // END FINAL - }); - }, - - down: function( /* queryInterface, Sequelize */ ) { - // var migration = new Migration(queryInterface); - }, -}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 50cdcdc..6348526 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8e4=['WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','MailInteractionHasTag','hasOne','userSetting','cascade','UserId','Recordings','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','FaxInteractions','WhatsappInteractions','SenderId','CmHopper','Hoppers','SET\x20NULL','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueues','ChatQueue','ChatQueues','FaxQueue','SmsQueue','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','user_has_chat_websites','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','user_has_whatsapp_accounts','VoiceChanSpy','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sound','Sounds','moh_has_sounds','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','CmList','voice_queues_has_cm_lists','Agents','BlackLists','Messages','mailboxuser','mailbox','QueueCalls','AgentReports','uniqueid','Contact','MailAccountId','CloudProviderId','restrict','Imap','Dispositions','Interactions','List','TemplateId','user_has_mail_accounts','team_has_mail_queues','Teams','MailInteractionId','ContactId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','Account','ChatWebsite','TagId','MailQueueReport','Items','FaxAccountId','Answers','Exntensions','ListId','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','user_has_sms_interactions','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Agent','Queue','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','Members','CompanyId','CmContactHasItem','Phones','CmContactId','ChatInteractions','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CampaignId','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','AutomationId','Intervals','ChatApplications','SmsApplications','AnalyticDefaultReport','AnalyticCustomReport','CustomReportId','Mohs','sms_interaction_has_tags','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','ItemTypeId','Hopper','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','AnalyticMetric','Fields','MetricId','Subjects','Descriptions','DescriptionId','SalesforceField','FieldId','AccountId','Subject','Description','Field','Variable','VariableId','Configurations','SubjectId','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerAccount','FreshsalesConfiguration','FreshsalesField','FromId','ToId','SessionId','ProjectId','team_has_sms_queues','SmsQueues','TrunkBackup','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','FromUserId','ToChatQueueId','ToQueue','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsAccountId','CustomFields','userProfileId','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','Smtp','../config/environment','sequelize','lodash','determine','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','utf8','utf8_general_ci','sequelizeHistory','utf8mb4','name','database','password','options','User','import','../api/user/user.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','VoiceMailMessage','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','Integration','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model'];(function(_0x1441d6,_0x5c43be){var _0x34a949=function(_0x2bc368){while(--_0x2bc368){_0x1441d6['push'](_0x1441d6['shift']());}};_0x34a949(++_0x5c43be);}(_0xf8e4,0xf2));var _0x4f8e=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0xf8e4[_0x2dbce7];return _0x3a3ed0;};'use strict';var config=require(_0x4f8e('0x0'));var Sequelize=require(_0x4f8e('0x1'));var _=require(_0x4f8e('0x2'));var jstz=require('jstz');var timezone=jstz[_0x4f8e('0x3')]();config[_0x4f8e('0x1')]=_[_0x4f8e('0x4')](config['sequelize'],{'database':'motion2','username':_0x4f8e('0x5'),'password':_0x4f8e('0x6'),'options':{'host':_0x4f8e('0x7'),'port':0xcea,'dialect':_0x4f8e('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x4f8e('0x9'),'collate':_0x4f8e('0xa')}}});config['sequelizeHistory']=_[_0x4f8e('0x4')](config[_0x4f8e('0xb')],{'database':'motion2','username':_0x4f8e('0x5'),'password':_0x4f8e('0x6'),'options':{'host':_0x4f8e('0x7'),'port':0xcea,'dialect':_0x4f8e('0x8'),'dialectOptions':{'charset':_0x4f8e('0xc')},'logging':![],'timezone':timezone[_0x4f8e('0xd')](),'define':{'charset':_0x4f8e('0x9'),'collate':_0x4f8e('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x4f8e('0xe')],config[_0x4f8e('0x1')]['username'],config[_0x4f8e('0x1')][_0x4f8e('0xf')],config[_0x4f8e('0x1')][_0x4f8e('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4f8e('0xb')][_0x4f8e('0xe')],config['sequelizeHistory']['username'],config['sequelizeHistory'][_0x4f8e('0xf')],config[_0x4f8e('0xb')]['options'])};db[_0x4f8e('0x11')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x13'));db['VoiceChanSpy']=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x14'));db[_0x4f8e('0x15')]=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0x16'));db[_0x4f8e('0x17')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x18'));db[_0x4f8e('0x19')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0x1a'));db[_0x4f8e('0x1b')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0x1c'));db[_0x4f8e('0x1d')]=db[_0x4f8e('0x1')]['import']('../api/screenRecording/screenRecording.model');db[_0x4f8e('0x1e')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/voiceMail/voiceMail.model');db[_0x4f8e('0x1f')]=db['sequelize'][_0x4f8e('0x12')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x4f8e('0x20')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/voiceCallReport/voiceCallReport.model');db[_0x4f8e('0x21')]=db['sequelize']['import'](_0x4f8e('0x22'));db[_0x4f8e('0x23')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x4f8e('0x24')]=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0x25'));db[_0x4f8e('0x26')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x27'));db[_0x4f8e('0x28')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x29'));db['VoiceTransferReport']=db['sequelize'][_0x4f8e('0x12')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x4f8e('0x2a')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x2b'));db['UserVoiceQueue']=db[_0x4f8e('0x1')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0x4f8e('0x2c')]=db['sequelize'][_0x4f8e('0x12')]('../api/userChatQueue/userChatQueue.model');db[_0x4f8e('0x2d')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x2e'));db[_0x4f8e('0x2f')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0x30'));db[_0x4f8e('0x31')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x32'));db[_0x4f8e('0x33')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0x34'));db['UserWhatsappQueue']=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0x35'));db[_0x4f8e('0x36')]=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0x37'));db[_0x4f8e('0x38')]=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0x39'));db[_0x4f8e('0x3a')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0x3b'));db[_0x4f8e('0x3c')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x3d'));db[_0x4f8e('0x3e')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x3f'));db[_0x4f8e('0x40')]=db['sequelize'][_0x4f8e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x4f8e('0x41')]=db[_0x4f8e('0x1')]['import']('../api/mailMessage/mailMessage.model');db[_0x4f8e('0x42')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0x43'));db['MailQueueReport']=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/mailQueueReport/mailQueueReport.model');db[_0x4f8e('0x44')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x45'));db[_0x4f8e('0x46')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/dashboardItem/dashboardItem.model');db[_0x4f8e('0x47')]=db['sequelize']['import'](_0x4f8e('0x48'));db[_0x4f8e('0x49')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0x4a'));db[_0x4f8e('0x4b')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x4c'));db[_0x4f8e('0x4d')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0x4e'));db['FaxQueue']=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/faxQueue/faxQueue.model');db[_0x4f8e('0x4f')]=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0x50'));db[_0x4f8e('0x51')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x52'));db[_0x4f8e('0x53')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0x54'));db[_0x4f8e('0x55')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/smsInteraction/smsInteraction.model');db[_0x4f8e('0x56')]=db[_0x4f8e('0x1')]['import']('../api/smsMessage/smsMessage.model');db['SmsQueue']=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0x57'));db[_0x4f8e('0x58')]=db['sequelize'][_0x4f8e('0x12')]('../api/openchannelAccount/openchannelAccount.model');db[_0x4f8e('0x59')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0x5a'));db[_0x4f8e('0x5b')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x5c'));db[_0x4f8e('0x5d')]=db[_0x4f8e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db[_0x4f8e('0x5e')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x5f'));db['ChatWebsite']=db['sequelize']['import']('../api/chatWebsite/chatWebsite.model');db[_0x4f8e('0x60')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x61'));db[_0x4f8e('0x62')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x4f8e('0x63')]=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0x64'));db[_0x4f8e('0x65')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x66'));db[_0x4f8e('0x67')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x68'));db['ChatQueue']=db['sequelize']['import'](_0x4f8e('0x69'));db[_0x4f8e('0x6a')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x6b'));db[_0x4f8e('0x6c')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0x6d'));db['CmCompany']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x6e'));db[_0x4f8e('0x6f')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x70'));db['CmHopper']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x71'));db[_0x4f8e('0x72')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0x73'));db[_0x4f8e('0x74')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x75'));db[_0x4f8e('0x76')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x4f8e('0x77')]=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0x78'));db[_0x4f8e('0x79')]=db['sequelize'][_0x4f8e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x4f8e('0x7a')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x7b'));db[_0x4f8e('0x7c')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x7d'));db[_0x4f8e('0x7e')]=db['sequelize']['import']('../api/cannedAnswer/cannedAnswer.model');db[_0x4f8e('0x7f')]=db[_0x4f8e('0x1')]['import']('../api/disposition/disposition.model');db[_0x4f8e('0x80')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x81'));db[_0x4f8e('0x82')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x83'));db[_0x4f8e('0x84')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/pause/pause.model');db['Cdr']=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/cdr/cdr.model');db[_0x4f8e('0x85')]=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0x86'));db[_0x4f8e('0x87')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x88'));db['Sound']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x89'));db[_0x4f8e('0x8a')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x8b'));db['ContactItemType']=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0x8c'));db['CmContactHasItem']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x8d'));db['CmHopperAdditionalPhone']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x8e'));db[_0x4f8e('0x8f')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x90'));db[_0x4f8e('0x91')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x92'));db['Variable']=db[_0x4f8e('0x1')]['import'](_0x4f8e('0x93'));db['Integration']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x94'));db[_0x4f8e('0x95')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x96'));db['AnalyticCustomReport']=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0x97'));db['AnalyticDefaultReport']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x98'));db['AnalyticExtractedReport']=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0x99'));db['AnalyticMetric']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x9a'));db[_0x4f8e('0x9b')]=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0x9c'));db[_0x4f8e('0x9d')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x9e'));db[_0x4f8e('0x9f')]=db['sequelize']['import'](_0x4f8e('0xa0'));db[_0x4f8e('0xa1')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xa2'));db['SalesforceField']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xa3'));db[_0x4f8e('0xa4')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0xa5'));db[_0x4f8e('0xa6')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x4f8e('0xa7')]=db[_0x4f8e('0x1')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0x4f8e('0xa8')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0xa9'));db[_0x4f8e('0xaa')]=db['sequelize'][_0x4f8e('0x12')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x4f8e('0xab')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db['sequelize'][_0x4f8e('0x12')]('../api/intZohoAccount/intZohoAccount.model');db[_0x4f8e('0xac')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xad'));db[_0x4f8e('0xae')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xaf'));db[_0x4f8e('0xb0')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xb1'));db[_0x4f8e('0xb2')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xb3'));db[_0x4f8e('0xb4')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xb5'));db[_0x4f8e('0xb6')]=db[_0x4f8e('0x1')]['import']('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x4f8e('0xb7')]=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0xb8'));db[_0x4f8e('0xb9')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xba'));db[_0x4f8e('0xbb')]=db['sequelize'][_0x4f8e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x4f8e('0xbc')]=db['sequelize'][_0x4f8e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x4f8e('0xbd')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0xbe'));db[_0x4f8e('0xbf')]=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0xc0'));db[_0x4f8e('0xc1')]=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0xc2'));db[_0x4f8e('0xc3')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xc4'));db[_0x4f8e('0xc5')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0xc6'));db[_0x4f8e('0xc7')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xc8'));db[_0x4f8e('0xc9')]=db[_0x4f8e('0x1')]['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xca'));db['FreshsalesField']=db['sequelize'][_0x4f8e('0x12')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x4f8e('0xcb')]=db['sequelize']['import'](_0x4f8e('0x94'));db['Network']=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0xcc'));db[_0x4f8e('0xcd')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0xce'));db[_0x4f8e('0xcf')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xd0'));db[_0x4f8e('0xd1')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xd2'));db[_0x4f8e('0xd3')]=db['sequelize'][_0x4f8e('0x12')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x4f8e('0xd4')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xd5'));db[_0x4f8e('0xd6')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0xd7'));db['SquareReport']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xd8'));db[_0x4f8e('0xd9')]=db['sequelize'][_0x4f8e('0x12')]('../api/squareReportDetail/squareReportDetail.model');db[_0x4f8e('0xda')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xdb'));db[_0x4f8e('0xdc')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xdd'));db['SquareOdbc']=db[_0x4f8e('0x1')]['import'](_0x4f8e('0xde'));db[_0x4f8e('0xdf')]=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0xe0'));db[_0x4f8e('0xe1')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xe2'));db['SquareMessage']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xe3'));db[_0x4f8e('0xe4')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xe5'));db[_0x4f8e('0xe6')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xe7'));db[_0x4f8e('0xe8')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0xe9'));db[_0x4f8e('0xea')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xeb'));db[_0x4f8e('0xec')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xed'));db[_0x4f8e('0xee')]=db['sequelize']['import'](_0x4f8e('0xef'));db[_0x4f8e('0xf0')]=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0xf1'));db[_0x4f8e('0xf2')]=db[_0x4f8e('0x1')]['import'](_0x4f8e('0xf3'));db[_0x4f8e('0xf4')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xf5'));db['OpenchannelTransferReport']=db[_0x4f8e('0x1')]['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x4f8e('0xf6')]=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0xf7'));db['CmList']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xf8'));db['VoicePrefix']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xf9'));db[_0x4f8e('0xfa')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xfb'));db['UserProfileSection']=db[_0x4f8e('0x1')]['import']('../api/userProfileSection/userProfileSection.model');db[_0x4f8e('0xfc')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xfd'));db[_0x4f8e('0xfe')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/userNotification/userNotification.model');db['WhatsappAccount']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0xff'));db['WhatsappApplication']=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x100'));db[_0x4f8e('0x101')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x102'));db[_0x4f8e('0x103')]=db['sequelize'][_0x4f8e('0x12')](_0x4f8e('0x104'));db[_0x4f8e('0x105')]=db[_0x4f8e('0x1')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x4f8e('0x106')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x107'));db[_0x4f8e('0x108')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x109'));db[_0x4f8e('0x10a')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x10b'));db[_0x4f8e('0x10c')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x10d'));db[_0x4f8e('0x10e')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x4f8e('0x10f')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x4f8e('0x110')]=db[_0x4f8e('0x1')][_0x4f8e('0x12')](_0x4f8e('0x111'));db[_0x4f8e('0x112')]=db['sequelize'][_0x4f8e('0x12')]('../api/mailInteractionHasTag/mailInteractionHasTag.model');db[_0x4f8e('0x11')][_0x4f8e('0x113')](db['VoiceMail'],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db['User']['hasOne'](db[_0x4f8e('0x110')],{'as':_0x4f8e('0x114'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x116')});db[_0x4f8e('0x11')]['hasMany'](db[_0x4f8e('0x1b')],{'as':_0x4f8e('0x117'),'foreignKey':_0x4f8e('0x116')});db[_0x4f8e('0x11')][_0x4f8e('0x118')](db[_0x4f8e('0x2a')],{'as':_0x4f8e('0x119'),'foreignKey':_0x4f8e('0x116')});db[_0x4f8e('0x11')][_0x4f8e('0x118')](db[_0x4f8e('0x15')],{'as':_0x4f8e('0x11a'),'onDelete':_0x4f8e('0x115'),'hooks':!![]});db[_0x4f8e('0x11')][_0x4f8e('0x118')](db[_0x4f8e('0x74')],{'as':_0x4f8e('0x11b'),'foreignKey':_0x4f8e('0x116')});db['User']['hasMany'](db['CmHopperHistory'],{'as':_0x4f8e('0x11c'),'foreignKey':_0x4f8e('0x116')});db[_0x4f8e('0x11')][_0x4f8e('0x118')](db['ReportAgentPreview'],{'as':_0x4f8e('0x77'),'foreignKey':'UserId'});db[_0x4f8e('0x11')][_0x4f8e('0x118')](db[_0x4f8e('0x5b')],{'as':_0x4f8e('0x11d'),'foreignKey':_0x4f8e('0x116')});db[_0x4f8e('0x11')][_0x4f8e('0x118')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x4f8e('0x116')});db[_0x4f8e('0x11')][_0x4f8e('0x118')](db[_0x4f8e('0x55')],{'as':'SmsInteractions','foreignKey':_0x4f8e('0x116')});db[_0x4f8e('0x11')][_0x4f8e('0x118')](db[_0x4f8e('0x4b')],{'as':_0x4f8e('0x11e'),'foreignKey':_0x4f8e('0x116')});db['User'][_0x4f8e('0x118')](db[_0x4f8e('0x40')],{'as':'MailInteractions','foreignKey':'UserId'});db[_0x4f8e('0x11')][_0x4f8e('0x118')](db[_0x4f8e('0x101')],{'as':_0x4f8e('0x11f'),'foreignKey':_0x4f8e('0x116')});db[_0x4f8e('0x11')][_0x4f8e('0x118')](db[_0x4f8e('0xfe')],{'as':'UserNotifications','foreignKey':_0x4f8e('0x120')});db[_0x4f8e('0x11')][_0x4f8e('0x118')](db[_0x4f8e('0x121')],{'as':_0x4f8e('0x122'),'foreignKey':_0x4f8e('0x116'),'onDelete':_0x4f8e('0x123')});db[_0x4f8e('0x11')]['belongsTo'](db[_0x4f8e('0xfa')],{'as':_0x4f8e('0xfa'),'foreignKey':'userProfileId'});db[_0x4f8e('0x11')][_0x4f8e('0x124')](db[_0x4f8e('0x6a')],{'as':_0x4f8e('0x125'),'through':_0x4f8e('0x126')});db['User']['belongsToMany'](db[_0x4f8e('0x6f')],{'as':_0x4f8e('0x127'),'through':_0x4f8e('0x128')});db[_0x4f8e('0x11')][_0x4f8e('0x124')](db['CmList'],{'as':_0x4f8e('0x129'),'through':_0x4f8e('0x12a')});db[_0x4f8e('0x11')][_0x4f8e('0x124')](db['Team'],{'through':_0x4f8e('0x12b')});db[_0x4f8e('0x11')]['belongsToMany'](db[_0x4f8e('0x40')],{'as':_0x4f8e('0x12c'),'through':_0x4f8e('0x12d')});db['User']['belongsToMany'](db[_0x4f8e('0x63')],{'as':'ChatInteractions','through':_0x4f8e('0x12e')});db[_0x4f8e('0x11')][_0x4f8e('0x124')](db[_0x4f8e('0x4b')],{'as':_0x4f8e('0x11e'),'through':_0x4f8e('0x12f')});db[_0x4f8e('0x11')][_0x4f8e('0x124')](db[_0x4f8e('0x55')],{'as':_0x4f8e('0x130'),'through':'user_has_sms_interactions'});db[_0x4f8e('0x11')][_0x4f8e('0x124')](db[_0x4f8e('0x5b')],{'as':_0x4f8e('0x11d'),'through':_0x4f8e('0x131')});db['User'][_0x4f8e('0x124')](db[_0x4f8e('0x101')],{'as':_0x4f8e('0x11f'),'through':_0x4f8e('0x132')});db[_0x4f8e('0x11')][_0x4f8e('0x124')](db[_0x4f8e('0x19')],{'as':_0x4f8e('0x133'),'through':'UserVoiceQueue','required':![]});db[_0x4f8e('0x11')][_0x4f8e('0x124')](db[_0x4f8e('0x134')],{'as':_0x4f8e('0x135'),'through':_0x4f8e('0x10f'),'required':![]});db[_0x4f8e('0x11')][_0x4f8e('0x124')](db[_0x4f8e('0x3c')],{'as':_0x4f8e('0x136'),'through':_0x4f8e('0x2d'),'required':![]});db[_0x4f8e('0x11')][_0x4f8e('0x124')](db[_0x4f8e('0x137')],{'as':_0x4f8e('0x138'),'through':_0x4f8e('0x2c'),'required':![],'hooks':!![]});db['User'][_0x4f8e('0x124')](db[_0x4f8e('0x139')],{'as':'FaxQueues','through':_0x4f8e('0x2f'),'required':![]});db[_0x4f8e('0x11')][_0x4f8e('0x124')](db[_0x4f8e('0x13a')],{'as':'SmsQueues','through':_0x4f8e('0x31'),'required':![]});db['User'][_0x4f8e('0x124')](db[_0x4f8e('0x5e')],{'as':_0x4f8e('0x13b'),'through':_0x4f8e('0x33'),'required':![]});db[_0x4f8e('0x11')]['belongsToMany'](db[_0x4f8e('0x108')],{'as':_0x4f8e('0x13c'),'through':_0x4f8e('0x13d'),'required':![]});db[_0x4f8e('0x11')]['belongsToMany'](db['CmList'],{'through':_0x4f8e('0x12a')});db[_0x4f8e('0x11')][_0x4f8e('0x124')](db['ChatWebsite'],{'as':'ChatWebsites','through':_0x4f8e('0x13e')});db[_0x4f8e('0x11')][_0x4f8e('0x124')](db[_0x4f8e('0x47')],{'as':'FaxAccounts','through':_0x4f8e('0x13f')});db[_0x4f8e('0x11')][_0x4f8e('0x124')](db[_0x4f8e('0x3a')],{'as':_0x4f8e('0x140'),'through':'user_has_mail_accounts'});db['User'][_0x4f8e('0x124')](db[_0x4f8e('0x58')],{'as':_0x4f8e('0x141'),'through':_0x4f8e('0x142')});db[_0x4f8e('0x11')][_0x4f8e('0x124')](db[_0x4f8e('0x51')],{'as':_0x4f8e('0x143'),'through':_0x4f8e('0x144')});db[_0x4f8e('0x11')][_0x4f8e('0x124')](db[_0x4f8e('0x145')],{'as':'WhatsappAccounts','through':_0x4f8e('0x146')});db[_0x4f8e('0x147')][_0x4f8e('0x118')](db[_0x4f8e('0x15')],{'as':_0x4f8e('0x148'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x149')});db[_0x4f8e('0x14a')]['hasMany'](db[_0x4f8e('0x15')],{'onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x15')][_0x4f8e('0x118')](db[_0x4f8e('0x15')],{'as':_0x4f8e('0x14b'),'onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x17')][_0x4f8e('0x124')](db[_0x4f8e('0x14c')],{'as':_0x4f8e('0x14d'),'through':_0x4f8e('0x14e')});db[_0x4f8e('0x19')][_0x4f8e('0x118')](db[_0x4f8e('0x2a')],{'as':'Members','foreignKey':_0x4f8e('0x14f')});db[_0x4f8e('0x19')]['hasMany'](db[_0x4f8e('0x121')],{'as':_0x4f8e('0x122'),'foreignKey':'VoiceQueueId'});db[_0x4f8e('0x19')][_0x4f8e('0x118')](db[_0x4f8e('0x74')],{'as':_0x4f8e('0x11b'),'foreignKey':_0x4f8e('0x14f')});db[_0x4f8e('0x19')]['hasMany'](db[_0x4f8e('0x76')],{'as':_0x4f8e('0x150'),'foreignKey':_0x4f8e('0x14f')});db[_0x4f8e('0x19')][_0x4f8e('0x118')](db[_0x4f8e('0x77')],{'as':_0x4f8e('0x77'),'foreignKey':'VoiceQueueId'});db[_0x4f8e('0x19')]['hasMany'](db[_0x4f8e('0x72')],{'as':_0x4f8e('0x151'),'foreignKey':'VoiceQueueId'});db[_0x4f8e('0x19')][_0x4f8e('0x118')](db[_0x4f8e('0xd4')],{'as':_0x4f8e('0x152'),'foreignKey':_0x4f8e('0x14f')});db[_0x4f8e('0x19')]['belongsTo'](db[_0x4f8e('0x28')],{'as':_0x4f8e('0x28'),'foreignKey':'TrunkId'});db[_0x4f8e('0x19')][_0x4f8e('0x153')](db[_0x4f8e('0x28')],{'as':'TrunkBackup','foreignKey':_0x4f8e('0x154')});db[_0x4f8e('0x19')][_0x4f8e('0x153')](db[_0x4f8e('0x82')],{'as':_0x4f8e('0x82'),'foreignKey':_0x4f8e('0x155')});db[_0x4f8e('0x19')][_0x4f8e('0x153')](db[_0x4f8e('0x84')],{'as':_0x4f8e('0x156'),'foreignKey':_0x4f8e('0x157')});db[_0x4f8e('0x19')][_0x4f8e('0x124')](db[_0x4f8e('0x158')],{'as':_0x4f8e('0x129'),'through':_0x4f8e('0x159')});db['VoiceQueue'][_0x4f8e('0x124')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x15a'),'through':'UserVoiceQueue'});db[_0x4f8e('0x19')][_0x4f8e('0x124')](db[_0x4f8e('0xe4')],{'as':'Teams','through':'TeamVoiceQueue'});db[_0x4f8e('0x19')]['belongsToMany'](db['CmList'],{'as':_0x4f8e('0x15b'),'through':'voice_queues_has_cm_blacklists'});db['VoiceRecording'][_0x4f8e('0x153')](db['User'],{'as':_0x4f8e('0x11'),'foreignKey':_0x4f8e('0x116')});db[_0x4f8e('0x1d')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x11'),'foreignKey':_0x4f8e('0x116')});db['VoiceMail'][_0x4f8e('0x118')](db['VoiceMailMessage'],{'as':_0x4f8e('0x15c'),'onDelete':'cascade','foreignKey':_0x4f8e('0x15d'),'sourceKey':_0x4f8e('0x15e')});db[_0x4f8e('0x1f')]['belongsTo'](db['VoiceMail'],{'foreignKey':_0x4f8e('0x15d'),'targetKey':_0x4f8e('0x15e')});db[_0x4f8e('0x20')]['hasMany'](db[_0x4f8e('0x24')],{'as':_0x4f8e('0x15f'),'foreignKey':'uniqueid','constraints':![]});db[_0x4f8e('0x20')]['hasMany'](db[_0x4f8e('0x23')],{'as':_0x4f8e('0x160'),'foreignKey':_0x4f8e('0x161'),'constraints':![]});db[_0x4f8e('0x20')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'as':'User','foreignKey':_0x4f8e('0x116')});db['VoiceCallReport'][_0x4f8e('0x153')](db[_0x4f8e('0x6f')],{'as':_0x4f8e('0x162'),'foreignKey':'ContactId'});db[_0x4f8e('0x36')][_0x4f8e('0x153')](db[_0x4f8e('0x3a')],{'as':_0x4f8e('0x3a'),'foreignKey':_0x4f8e('0x163')});db[_0x4f8e('0x36')][_0x4f8e('0x153')](db[_0x4f8e('0x10a')],{'as':_0x4f8e('0x10a'),'foreignKey':_0x4f8e('0x164'),'onDelete':_0x4f8e('0x165')});db[_0x4f8e('0x38')][_0x4f8e('0x153')](db[_0x4f8e('0x3a')],{'as':_0x4f8e('0x3a'),'foreignKey':'MailAccountId'});db[_0x4f8e('0x38')][_0x4f8e('0x153')](db[_0x4f8e('0x10a')],{'as':_0x4f8e('0x10a'),'foreignKey':'CloudProviderId','onDelete':_0x4f8e('0x165')});db[_0x4f8e('0x3a')]['hasOne'](db[_0x4f8e('0x36')],{'as':_0x4f8e('0x166'),'onDelete':_0x4f8e('0x115')});db['MailAccount'][_0x4f8e('0x113')](db[_0x4f8e('0x38')],{'as':'Smtp','onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x3a')][_0x4f8e('0x118')](db[_0x4f8e('0x7f')],{'as':_0x4f8e('0x167'),'foreignKey':'MailAccountId','onDelete':'cascade'});db['MailAccount']['hasMany'](db[_0x4f8e('0x7e')],{'as':'Answers','foreignKey':_0x4f8e('0x163')});db[_0x4f8e('0x3a')][_0x4f8e('0x118')](db[_0x4f8e('0x41')],{'as':_0x4f8e('0x15c'),'foreignKey':'MailAccountId'});db[_0x4f8e('0x3a')][_0x4f8e('0x118')](db[_0x4f8e('0x40')],{'as':_0x4f8e('0x168')});db[_0x4f8e('0x3a')][_0x4f8e('0x118')](db[_0x4f8e('0x42')],{'as':'Applications','foreignKey':_0x4f8e('0x163'),'onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x3a')][_0x4f8e('0x153')](db[_0x4f8e('0x158')],{'as':_0x4f8e('0x169'),'foreignKey':'ListId'});db['MailAccount'][_0x4f8e('0x153')](db['Template'],{'as':_0x4f8e('0x8f'),'foreignKey':_0x4f8e('0x16a')});db[_0x4f8e('0x3a')]['belongsTo'](db[_0x4f8e('0x84')],{'as':_0x4f8e('0x156'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4f8e('0x3a')][_0x4f8e('0x124')](db['User'],{'as':_0x4f8e('0x15a'),'through':_0x4f8e('0x16b')});db[_0x4f8e('0x3c')][_0x4f8e('0x124')](db['User'],{'as':_0x4f8e('0x15a'),'through':'UserMailQueue'});db['MailQueue'][_0x4f8e('0x124')](db['Team'],{'through':_0x4f8e('0x16c'),'as':_0x4f8e('0x16d')});db[_0x4f8e('0x40')][_0x4f8e('0x118')](db['MailMessage'],{'as':_0x4f8e('0x15c'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x16e')});db[_0x4f8e('0x40')][_0x4f8e('0x153')](db[_0x4f8e('0x3a')],{'as':'Account','foreignKey':_0x4f8e('0x163')});db[_0x4f8e('0x40')][_0x4f8e('0x153')](db[_0x4f8e('0x6f')],{'as':_0x4f8e('0x162'),'foreignKey':_0x4f8e('0x16f')});db['MailInteraction'][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x170'),'foreignKey':_0x4f8e('0x116')});db[_0x4f8e('0x40')][_0x4f8e('0x124')](db[_0x4f8e('0x8a')],{'through':_0x4f8e('0x171'),'as':_0x4f8e('0x172')});db[_0x4f8e('0x40')][_0x4f8e('0x124')](db[_0x4f8e('0x8a')],{'through':_0x4f8e('0x171'),'as':_0x4f8e('0x173')});db[_0x4f8e('0x40')][_0x4f8e('0x124')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x174'),'through':_0x4f8e('0x12d'),'foreignKey':_0x4f8e('0x16e')});db['MailMessage'][_0x4f8e('0x118')](db[_0x4f8e('0xec')],{'as':_0x4f8e('0x175'),'onDelete':'cascade'});db[_0x4f8e('0x41')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x11')});db[_0x4f8e('0x41')][_0x4f8e('0x153')](db[_0x4f8e('0x6f')],{'onDelete':_0x4f8e('0x115'),'as':'Contact'});db[_0x4f8e('0x41')][_0x4f8e('0x153')](db[_0x4f8e('0x40')],{'as':_0x4f8e('0x176'),'foreignKey':_0x4f8e('0x16e')});db[_0x4f8e('0x41')][_0x4f8e('0x153')](db['MailAccount'],{'as':_0x4f8e('0x177'),'foreignKey':'MailAccountId'});db[_0x4f8e('0x41')][_0x4f8e('0x153')](db[_0x4f8e('0x178')],{'as':_0x4f8e('0x178'),'foreignKey':'ChatWebsiteId'});db[_0x4f8e('0x41')]['belongsTo'](db[_0x4f8e('0x67')],{'as':_0x4f8e('0x67'),'foreignKey':'ChatOfflineMessageId'});db[_0x4f8e('0x42')]['belongsTo'](db['User'],{'onDelete':'restrict'});db[_0x4f8e('0x42')][_0x4f8e('0x153')](db[_0x4f8e('0x3c')],{'onDelete':_0x4f8e('0x165')});db['MailApplication'][_0x4f8e('0x153')](db[_0x4f8e('0x3a')],{'onDelete':'restrict'});db[_0x4f8e('0x42')][_0x4f8e('0x153')](db['Interval'],{'onDelete':_0x4f8e('0x165'),'foreignKey':_0x4f8e('0x155')});db[_0x4f8e('0x42')]['belongsTo'](db[_0x4f8e('0x8a')],{'onDelete':_0x4f8e('0x165'),'foreignKey':_0x4f8e('0x179')});db['MailQueueReport'][_0x4f8e('0x153')](db[_0x4f8e('0x3a')],{});db[_0x4f8e('0x17a')][_0x4f8e('0x153')](db[_0x4f8e('0x158')],{'as':_0x4f8e('0x169'),'foreignKey':'ListId'});db[_0x4f8e('0x17a')][_0x4f8e('0x153')](db[_0x4f8e('0x6f')],{'as':_0x4f8e('0x162'),'foreignKey':_0x4f8e('0x16f')});db['MailQueueReport']['belongsTo'](db['MailInteraction'],{});db[_0x4f8e('0x17a')][_0x4f8e('0x153')](db[_0x4f8e('0x41')],{});db[_0x4f8e('0x17a')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{});db[_0x4f8e('0x17a')]['belongsTo'](db[_0x4f8e('0x3c')],{});db[_0x4f8e('0x44')][_0x4f8e('0x118')](db[_0x4f8e('0x46')],{'as':_0x4f8e('0x17b'),'onDelete':_0x4f8e('0x115')});db['FaxAccount'][_0x4f8e('0x118')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x4f8e('0x17c'),'onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x47')][_0x4f8e('0x118')](db[_0x4f8e('0x7e')],{'as':_0x4f8e('0x17d'),'foreignKey':'FaxAccountId'});db[_0x4f8e('0x47')][_0x4f8e('0x118')](db['FaxInteraction'],{'as':_0x4f8e('0x168')});db[_0x4f8e('0x47')][_0x4f8e('0x118')](db['FaxApplication'],{'as':'Applications','foreignKey':'FaxAccountId','onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x47')]['hasMany'](db[_0x4f8e('0x15')],{'as':_0x4f8e('0x17e'),'onDelete':_0x4f8e('0x115')});db['FaxAccount'][_0x4f8e('0x118')](db['FaxMessage'],{'as':'Messages'});db['FaxAccount'][_0x4f8e('0x153')](db[_0x4f8e('0x28')],{'as':_0x4f8e('0x28')});db['FaxAccount']['belongsTo'](db[_0x4f8e('0x158')],{'as':_0x4f8e('0x169'),'foreignKey':_0x4f8e('0x17f')});db[_0x4f8e('0x47')][_0x4f8e('0x153')](db[_0x4f8e('0x84')],{'as':_0x4f8e('0x156'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4f8e('0x47')][_0x4f8e('0x124')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x15a'),'through':'user_has_fax_accounts'});db[_0x4f8e('0x49')]['belongsTo'](db[_0x4f8e('0x11')],{'onDelete':_0x4f8e('0x165')});db[_0x4f8e('0x49')][_0x4f8e('0x153')](db[_0x4f8e('0x139')],{'onDelete':'restrict'});db[_0x4f8e('0x49')]['belongsTo'](db[_0x4f8e('0x47')],{'onDelete':_0x4f8e('0x165')});db[_0x4f8e('0x49')][_0x4f8e('0x153')](db[_0x4f8e('0x8a')],{'onDelete':'restrict','foreignKey':_0x4f8e('0x179')});db[_0x4f8e('0x4b')]['hasMany'](db[_0x4f8e('0x4d')],{'as':_0x4f8e('0x15c'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x180')});db[_0x4f8e('0x4b')][_0x4f8e('0x153')](db[_0x4f8e('0x47')],{'as':_0x4f8e('0x177'),'foreignKey':_0x4f8e('0x17c')});db[_0x4f8e('0x4b')][_0x4f8e('0x153')](db[_0x4f8e('0x6f')],{'as':_0x4f8e('0x162'),'foreignKey':'ContactId'});db[_0x4f8e('0x4b')]['belongsTo'](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x170'),'foreignKey':'UserId'});db['FaxInteraction'][_0x4f8e('0x124')](db[_0x4f8e('0x8a')],{'through':_0x4f8e('0x181'),'as':_0x4f8e('0x172')});db[_0x4f8e('0x4b')]['belongsToMany'](db[_0x4f8e('0x8a')],{'through':_0x4f8e('0x181'),'as':'ThroughTags'});db[_0x4f8e('0x4b')][_0x4f8e('0x124')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x174'),'through':_0x4f8e('0x12f'),'foreignKey':'FaxInteractionId'});db[_0x4f8e('0x4d')][_0x4f8e('0x153')](db['User'],{'onDelete':_0x4f8e('0x115'),'as':'User'});db[_0x4f8e('0x4d')][_0x4f8e('0x153')](db['FaxInteraction'],{'as':_0x4f8e('0x176'),'foreignKey':_0x4f8e('0x180')});db['FaxMessage'][_0x4f8e('0x153')](db[_0x4f8e('0x6f')],{'onDelete':_0x4f8e('0x115'),'as':_0x4f8e('0x162')});db[_0x4f8e('0x4d')][_0x4f8e('0x153')](db[_0x4f8e('0xec')],{'as':_0x4f8e('0xec'),'foreignKey':_0x4f8e('0x182')});db['FaxMessage'][_0x4f8e('0x153')](db[_0x4f8e('0x47')],{'as':_0x4f8e('0x177'),'foreignKey':_0x4f8e('0x17c')});db[_0x4f8e('0x139')]['belongsToMany'](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x15a'),'through':_0x4f8e('0x2f')});db[_0x4f8e('0x139')]['belongsToMany'](db['Team'],{'through':_0x4f8e('0x183'),'as':_0x4f8e('0x16d')});db['FaxQueueReport'][_0x4f8e('0x153')](db[_0x4f8e('0x47')],{});db[_0x4f8e('0x4f')]['belongsTo'](db[_0x4f8e('0x158')],{'as':_0x4f8e('0x169'),'foreignKey':'ListId'});db[_0x4f8e('0x4f')][_0x4f8e('0x153')](db[_0x4f8e('0x6f')],{'as':_0x4f8e('0x162'),'foreignKey':_0x4f8e('0x16f')});db[_0x4f8e('0x4f')][_0x4f8e('0x153')](db[_0x4f8e('0x4b')],{});db[_0x4f8e('0x4f')]['belongsTo'](db[_0x4f8e('0x4d')],{});db[_0x4f8e('0x4f')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{});db[_0x4f8e('0x4f')]['belongsTo'](db['FaxQueue'],{});db[_0x4f8e('0x51')][_0x4f8e('0x118')](db[_0x4f8e('0x7f')],{'as':'Dispositions','foreignKey':_0x4f8e('0x184'),'onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x51')][_0x4f8e('0x118')](db['CannedAnswer'],{'as':_0x4f8e('0x17d'),'foreignKey':_0x4f8e('0x184')});db[_0x4f8e('0x51')]['hasMany'](db['SmsMessage'],{'as':_0x4f8e('0x15c'),'foreignKey':_0x4f8e('0x184')});db['SmsAccount'][_0x4f8e('0x118')](db[_0x4f8e('0x55')],{'as':_0x4f8e('0x168')});db[_0x4f8e('0x51')][_0x4f8e('0x118')](db['SmsApplication'],{'as':_0x4f8e('0x14b'),'foreignKey':_0x4f8e('0x184'),'onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x51')][_0x4f8e('0x153')](db[_0x4f8e('0x158')],{'as':_0x4f8e('0x169'),'foreignKey':_0x4f8e('0x17f')});db['SmsAccount'][_0x4f8e('0x153')](db[_0x4f8e('0x84')],{'as':_0x4f8e('0x156'),'foreignKey':_0x4f8e('0x157')});db[_0x4f8e('0x51')][_0x4f8e('0x124')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x15a'),'through':_0x4f8e('0x144')});db[_0x4f8e('0x53')][_0x4f8e('0x153')](db['User'],{'onDelete':_0x4f8e('0x165')});db['SmsApplication'][_0x4f8e('0x153')](db[_0x4f8e('0x13a')],{'onDelete':_0x4f8e('0x165')});db[_0x4f8e('0x53')]['belongsTo'](db[_0x4f8e('0x51')],{'onDelete':'restrict'});db[_0x4f8e('0x53')][_0x4f8e('0x153')](db[_0x4f8e('0x82')],{'onDelete':_0x4f8e('0x165'),'foreignKey':_0x4f8e('0x155')});db[_0x4f8e('0x53')][_0x4f8e('0x153')](db['Tag'],{'onDelete':_0x4f8e('0x165'),'foreignKey':_0x4f8e('0x179')});db[_0x4f8e('0x55')][_0x4f8e('0x118')](db['SmsMessage'],{'as':'Messages','onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x185')});db[_0x4f8e('0x55')][_0x4f8e('0x153')](db[_0x4f8e('0x51')],{'as':'Account','foreignKey':_0x4f8e('0x184')});db[_0x4f8e('0x55')][_0x4f8e('0x153')](db[_0x4f8e('0x6f')],{'as':'Contact','foreignKey':_0x4f8e('0x16f')});db[_0x4f8e('0x55')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x170'),'foreignKey':'UserId'});db[_0x4f8e('0x55')][_0x4f8e('0x124')](db[_0x4f8e('0x8a')],{'through':'sms_interaction_has_tags','as':_0x4f8e('0x172')});db['SmsInteraction'][_0x4f8e('0x124')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x4f8e('0x173')});db[_0x4f8e('0x55')][_0x4f8e('0x124')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x174'),'through':_0x4f8e('0x186'),'foreignKey':_0x4f8e('0x185')});db[_0x4f8e('0x56')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x11')});db['SmsMessage'][_0x4f8e('0x153')](db[_0x4f8e('0x6f')],{'onDelete':_0x4f8e('0x115'),'as':_0x4f8e('0x162')});db[_0x4f8e('0x56')][_0x4f8e('0x153')](db[_0x4f8e('0x55')],{'onDelete':_0x4f8e('0x115'),'as':_0x4f8e('0x176'),'foreignKey':_0x4f8e('0x185')});db[_0x4f8e('0x56')][_0x4f8e('0x153')](db[_0x4f8e('0x51')],{'as':'Account','foreignKey':_0x4f8e('0x184')});db['SmsQueue']['belongsToMany'](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x15a'),'through':_0x4f8e('0x31'),'foreignKey':'SmsQueueId'});db['SmsQueue']['belongsToMany'](db[_0x4f8e('0xe4')],{'through':'team_has_sms_queues','as':_0x4f8e('0x16d')});db[_0x4f8e('0x58')][_0x4f8e('0x118')](db[_0x4f8e('0x7f')],{'as':_0x4f8e('0x167'),'foreignKey':_0x4f8e('0x187'),'onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x58')][_0x4f8e('0x118')](db[_0x4f8e('0x7e')],{'as':_0x4f8e('0x17d'),'foreignKey':_0x4f8e('0x187')});db['OpenchannelAccount'][_0x4f8e('0x118')](db[_0x4f8e('0x5b')],{'as':_0x4f8e('0x168'),'foreignKey':_0x4f8e('0x187')});db['OpenchannelAccount'][_0x4f8e('0x118')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':_0x4f8e('0x187')});db[_0x4f8e('0x58')]['hasMany'](db[_0x4f8e('0x59')],{'as':_0x4f8e('0x14b'),'foreignKey':'OpenchannelAccountId','onDelete':_0x4f8e('0x115')});db['OpenchannelAccount']['belongsTo'](db['CmList'],{'as':_0x4f8e('0x169'),'foreignKey':_0x4f8e('0x17f')});db['OpenchannelAccount'][_0x4f8e('0x153')](db[_0x4f8e('0x84')],{'as':_0x4f8e('0x156'),'foreignKey':_0x4f8e('0x157')});db[_0x4f8e('0x58')]['belongsToMany'](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x15a'),'through':_0x4f8e('0x142')});db[_0x4f8e('0x59')][_0x4f8e('0x153')](db['User'],{'onDelete':'restrict'});db[_0x4f8e('0x59')]['belongsTo'](db[_0x4f8e('0x5e')],{'onDelete':'restrict','foreignKey':_0x4f8e('0x188')});db[_0x4f8e('0x59')][_0x4f8e('0x153')](db[_0x4f8e('0x58')],{'onDelete':_0x4f8e('0x165'),'foreignKey':_0x4f8e('0x187')});db[_0x4f8e('0x59')][_0x4f8e('0x153')](db[_0x4f8e('0x82')],{'onDelete':_0x4f8e('0x165'),'foreignKey':_0x4f8e('0x155')});db['OpenchannelApplication'][_0x4f8e('0x153')](db['Tag'],{'onDelete':_0x4f8e('0x165'),'foreignKey':_0x4f8e('0x179')});db['OpenchannelInteraction'][_0x4f8e('0x118')](db[_0x4f8e('0x5d')],{'as':_0x4f8e('0x15c'),'onDelete':_0x4f8e('0x115'),'foreignKey':'OpenchannelInteractionId'});db[_0x4f8e('0x5b')][_0x4f8e('0x153')](db[_0x4f8e('0x58')],{'as':_0x4f8e('0x177'),'foreignKey':'OpenchannelAccountId'});db[_0x4f8e('0x5b')][_0x4f8e('0x153')](db['CmContact'],{'as':_0x4f8e('0x162'),'foreignKey':_0x4f8e('0x16f')});db[_0x4f8e('0x5b')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'as':'Owner','foreignKey':'UserId'});db[_0x4f8e('0x5b')]['belongsToMany'](db[_0x4f8e('0x8a')],{'through':'openchannel_interaction_has_tags','as':_0x4f8e('0x172')});db[_0x4f8e('0x5b')][_0x4f8e('0x124')](db[_0x4f8e('0x8a')],{'through':'openchannel_interaction_has_tags','as':_0x4f8e('0x173')});db['OpenchannelInteraction'][_0x4f8e('0x124')](db['User'],{'as':'Users','through':_0x4f8e('0x131'),'foreignKey':_0x4f8e('0x189')});db[_0x4f8e('0x5d')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'onDelete':_0x4f8e('0x115'),'as':_0x4f8e('0x11')});db['OpenchannelMessage'][_0x4f8e('0x153')](db['CmContact'],{'onDelete':_0x4f8e('0x115'),'as':_0x4f8e('0x162')});db[_0x4f8e('0x5d')]['belongsTo'](db[_0x4f8e('0x5b')],{'onDelete':_0x4f8e('0x115'),'as':_0x4f8e('0x176'),'foreignKey':_0x4f8e('0x189')});db[_0x4f8e('0x5d')][_0x4f8e('0x153')](db[_0x4f8e('0xec')],{'as':_0x4f8e('0xec'),'foreignKey':_0x4f8e('0x182')});db[_0x4f8e('0x5d')][_0x4f8e('0x153')](db[_0x4f8e('0x58')],{'as':'Account','foreignKey':_0x4f8e('0x187')});db['OpenchannelQueue'][_0x4f8e('0x124')](db[_0x4f8e('0x11')],{'as':'Agents','through':_0x4f8e('0x33'),'foreignKey':_0x4f8e('0x188')});db[_0x4f8e('0x5e')]['belongsToMany'](db['Team'],{'through':_0x4f8e('0x18a'),'as':_0x4f8e('0x16d')});db[_0x4f8e('0x178')][_0x4f8e('0x118')](db[_0x4f8e('0x7f')],{'as':_0x4f8e('0x167'),'foreignKey':_0x4f8e('0x18b'),'onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x178')][_0x4f8e('0x118')](db[_0x4f8e('0x7e')],{'as':'Answers','foreignKey':'ChatWebsiteId'});db[_0x4f8e('0x178')]['hasMany'](db[_0x4f8e('0x6c')],{'as':_0x4f8e('0x18c')});db[_0x4f8e('0x178')][_0x4f8e('0x118')](db[_0x4f8e('0x63')],{'as':_0x4f8e('0x168')});db['ChatWebsite'][_0x4f8e('0x118')](db[_0x4f8e('0x62')],{'as':'Applications','foreignKey':'ChatWebsiteId','onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x178')][_0x4f8e('0x118')](db[_0x4f8e('0x65')],{'as':_0x4f8e('0x15c')});db[_0x4f8e('0x178')]['belongsTo'](db['CmList'],{'as':_0x4f8e('0x169'),'foreignKey':'ListId'});db['ChatWebsite'][_0x4f8e('0x153')](db[_0x4f8e('0x82')],{'as':'Interval','foreignKey':_0x4f8e('0x155')});db[_0x4f8e('0x178')]['belongsTo'](db[_0x4f8e('0x3a')],{'as':_0x4f8e('0x3a'),'foreignKey':_0x4f8e('0x163')});db[_0x4f8e('0x178')][_0x4f8e('0x153')](db[_0x4f8e('0x84')],{'as':_0x4f8e('0x156'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4f8e('0x178')][_0x4f8e('0x124')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x15a'),'through':_0x4f8e('0x13e')});db['OpenchannelQueueReport'][_0x4f8e('0x153')](db['OpenchannelAccount'],{});db[_0x4f8e('0x60')]['belongsTo'](db[_0x4f8e('0x158')],{'as':_0x4f8e('0x169'),'foreignKey':'ListId'});db[_0x4f8e('0x60')][_0x4f8e('0x153')](db['CmContact'],{'as':_0x4f8e('0x162'),'foreignKey':_0x4f8e('0x16f')});db[_0x4f8e('0x60')][_0x4f8e('0x153')](db[_0x4f8e('0x5b')],{});db[_0x4f8e('0x60')][_0x4f8e('0x153')](db['OpenchannelMessage'],{});db[_0x4f8e('0x60')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{});db[_0x4f8e('0x60')][_0x4f8e('0x153')](db['OpenchannelQueue'],{});db[_0x4f8e('0x62')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x18d'),'foreignKey':_0x4f8e('0x116'),'onDelete':_0x4f8e('0x165')});db[_0x4f8e('0x62')][_0x4f8e('0x153')](db[_0x4f8e('0x137')],{'as':_0x4f8e('0x18e'),'foreignKey':'ChatQueueId','onDelete':_0x4f8e('0x165')});db[_0x4f8e('0x62')]['belongsTo'](db[_0x4f8e('0x178')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0x4f8e('0x165')});db[_0x4f8e('0x62')][_0x4f8e('0x153')](db[_0x4f8e('0x8a')],{'onDelete':_0x4f8e('0x165'),'foreignKey':_0x4f8e('0x179')});db[_0x4f8e('0x63')][_0x4f8e('0x118')](db[_0x4f8e('0x65')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x4f8e('0x18f')});db[_0x4f8e('0x63')][_0x4f8e('0x153')](db[_0x4f8e('0x178')],{'as':_0x4f8e('0x177'),'foreignKey':_0x4f8e('0x18b')});db[_0x4f8e('0x63')]['belongsTo'](db[_0x4f8e('0x6f')],{'as':_0x4f8e('0x162'),'foreignKey':_0x4f8e('0x16f')});db[_0x4f8e('0x63')]['belongsTo'](db[_0x4f8e('0x11')],{'as':'Owner','foreignKey':_0x4f8e('0x116')});db[_0x4f8e('0x63')][_0x4f8e('0x124')](db[_0x4f8e('0x8a')],{'through':_0x4f8e('0x190'),'as':_0x4f8e('0x172')});db['ChatInteraction']['belongsToMany'](db[_0x4f8e('0x8a')],{'through':'chat_interaction_has_tags','as':_0x4f8e('0x173')});db[_0x4f8e('0x63')][_0x4f8e('0x124')](db[_0x4f8e('0x11')],{'as':'Users','through':_0x4f8e('0x12e'),'foreignKey':_0x4f8e('0x18f')});db[_0x4f8e('0x65')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'onDelete':'cascade','as':'User'});db['ChatMessage'][_0x4f8e('0x153')](db[_0x4f8e('0x6f')],{'onDelete':_0x4f8e('0x115'),'as':_0x4f8e('0x162'),'foreignKey':_0x4f8e('0x16f')});db[_0x4f8e('0x65')][_0x4f8e('0x153')](db[_0x4f8e('0x63')],{'onDelete':_0x4f8e('0x115'),'as':_0x4f8e('0x176'),'foreignKey':_0x4f8e('0x18f')});db[_0x4f8e('0x65')][_0x4f8e('0x153')](db['Attachment'],{'as':_0x4f8e('0xec'),'foreignKey':_0x4f8e('0x182')});db[_0x4f8e('0x65')]['belongsTo'](db[_0x4f8e('0x178')],{'as':_0x4f8e('0x177'),'foreignKey':_0x4f8e('0x18b')});db[_0x4f8e('0x67')][_0x4f8e('0x118')](db[_0x4f8e('0xec')],{'as':'Attachments','foreignKey':_0x4f8e('0x191'),'onDelete':_0x4f8e('0x115'),'hooks':!![]});db[_0x4f8e('0x67')][_0x4f8e('0x153')](db['CmContact'],{'onDelete':'cascade','as':'Contact','foreignKey':_0x4f8e('0x16f')});db[_0x4f8e('0x67')][_0x4f8e('0x153')](db[_0x4f8e('0x178')],{'as':'Account','foreignKey':_0x4f8e('0x18b')});db[_0x4f8e('0x137')][_0x4f8e('0x124')](db[_0x4f8e('0x11')],{'as':'Agents','through':_0x4f8e('0x2c'),'hooks':!![]});db[_0x4f8e('0x137')]['belongsToMany'](db[_0x4f8e('0xe4')],{'through':_0x4f8e('0x192'),'as':_0x4f8e('0x16d')});db['ChatGroup']['hasMany'](db[_0x4f8e('0xcf')],{'as':_0x4f8e('0x15c'),'foreignKey':_0x4f8e('0x193'),'onDelete':'cascade'});db[_0x4f8e('0x6a')][_0x4f8e('0x124')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x194'),'through':_0x4f8e('0x126')});db[_0x4f8e('0x6c')][_0x4f8e('0x153')](db[_0x4f8e('0x178')],{'as':'Website','foreignKey':_0x4f8e('0x18b')});db['CmCompany'][_0x4f8e('0x118')](db[_0x4f8e('0x6f')],{'as':_0x4f8e('0x127'),'foreignKey':_0x4f8e('0x195')});db[_0x4f8e('0x6f')][_0x4f8e('0x118')](db[_0x4f8e('0x196')],{'as':_0x4f8e('0x197'),'foreignKey':_0x4f8e('0x198')});db[_0x4f8e('0x6f')][_0x4f8e('0x118')](db[_0x4f8e('0x121')],{'as':_0x4f8e('0x122'),'foreignKey':_0x4f8e('0x16f')});db[_0x4f8e('0x6f')][_0x4f8e('0x118')](db['CmHopperFinal'],{'as':_0x4f8e('0x11b'),'foreignKey':'ContactId'});db[_0x4f8e('0x6f')][_0x4f8e('0x118')](db['CmHopperHistory'],{'as':_0x4f8e('0x150'),'foreignKey':_0x4f8e('0x16f')});db[_0x4f8e('0x6f')][_0x4f8e('0x118')](db[_0x4f8e('0x77')],{'as':_0x4f8e('0x77'),'foreignKey':_0x4f8e('0x16f')});db[_0x4f8e('0x6f')][_0x4f8e('0x118')](db[_0x4f8e('0xd4')],{'as':_0x4f8e('0x152'),'foreignKey':_0x4f8e('0x16f')});db[_0x4f8e('0x6f')][_0x4f8e('0x118')](db[_0x4f8e('0x5b')],{'as':_0x4f8e('0x11d'),'foreignKey':'ContactId','onDelete':_0x4f8e('0x165')});db['CmContact']['hasMany'](db[_0x4f8e('0x63')],{'as':_0x4f8e('0x199'),'foreignKey':_0x4f8e('0x16f'),'onDelete':_0x4f8e('0x165')});db[_0x4f8e('0x6f')][_0x4f8e('0x118')](db['SmsInteraction'],{'as':_0x4f8e('0x130'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x4f8e('0x6f')][_0x4f8e('0x118')](db[_0x4f8e('0x4b')],{'as':'FaxInteractions','foreignKey':_0x4f8e('0x16f'),'onDelete':'restrict'});db[_0x4f8e('0x6f')][_0x4f8e('0x118')](db[_0x4f8e('0x40')],{'as':'MailInteractions','foreignKey':_0x4f8e('0x16f'),'onDelete':'restrict'});db[_0x4f8e('0x6f')][_0x4f8e('0x153')](db['CmCompany'],{'as':'Company','foreignKey':_0x4f8e('0x195')});db['CmContact']['belongsTo'](db['CmList'],{'as':_0x4f8e('0x169'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x4f8e('0x6f')][_0x4f8e('0x124')](db[_0x4f8e('0x11')],{'as':'Users','through':_0x4f8e('0x128')});db[_0x4f8e('0x6f')]['belongsToMany'](db[_0x4f8e('0x8a')],{'as':_0x4f8e('0x172'),'through':_0x4f8e('0x19a')});db[_0x4f8e('0x6f')][_0x4f8e('0x124')](db[_0x4f8e('0x8a')],{'through':'cm_contact_has_tags','as':_0x4f8e('0x173')});db[_0x4f8e('0x121')][_0x4f8e('0x118')](db[_0x4f8e('0x19b')],{'as':_0x4f8e('0x19c'),'foreignKey':'CmHopperId'});db['CmHopper'][_0x4f8e('0x153')](db[_0x4f8e('0x6f')],{'as':_0x4f8e('0x162'),'foreignKey':_0x4f8e('0x16f'),'onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x121')][_0x4f8e('0x153')](db[_0x4f8e('0x158')],{'as':_0x4f8e('0x169'),'foreignKey':'ListId','onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x121')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'as':'Agent','foreignKey':'UserId'});db[_0x4f8e('0x121')][_0x4f8e('0x153')](db[_0x4f8e('0x19')],{'as':_0x4f8e('0x18e'),'foreignKey':_0x4f8e('0x14f'),'onDelete':_0x4f8e('0x115')});db['CmHopper']['belongsTo'](db[_0x4f8e('0xe8')],{'as':_0x4f8e('0xe8'),'foreignKey':_0x4f8e('0x19d'),'onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x121')]['belongsTo'](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x170'),'foreignKey':'OwnerId'});db['CmHopperBlack'][_0x4f8e('0x153')](db[_0x4f8e('0x6f')],{'as':_0x4f8e('0x162'),'foreignKey':_0x4f8e('0x16f'),'onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x72')]['belongsTo'](db[_0x4f8e('0x158')],{'as':_0x4f8e('0x169'),'foreignKey':_0x4f8e('0x17f'),'onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x72')][_0x4f8e('0x153')](db[_0x4f8e('0x19')],{'as':'Queue','foreignKey':_0x4f8e('0x14f'),'onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x72')][_0x4f8e('0x153')](db[_0x4f8e('0xe8')],{'as':'Campaign','foreignKey':_0x4f8e('0x19d'),'onDelete':_0x4f8e('0x115')});db['Automation'][_0x4f8e('0x118')](db[_0x4f8e('0x80')],{'as':{'plural':'All','singular':_0x4f8e('0x19e')},'foreignKey':_0x4f8e('0x19f'),'onDelete':_0x4f8e('0x115'),'hooks':!![]});db[_0x4f8e('0x7c')][_0x4f8e('0x118')](db[_0x4f8e('0x80')],{'as':{'plural':_0x4f8e('0x1a0'),'singular':_0x4f8e('0x1a1')},'foreignKey':_0x4f8e('0x1a2'),'onDelete':_0x4f8e('0x115'),'hooks':!![]});db[_0x4f8e('0x7c')][_0x4f8e('0x118')](db['Action'],{'as':'Actions','foreignKey':_0x4f8e('0x1a3'),'onDelete':_0x4f8e('0x115'),'hooks':!![]});db[_0x4f8e('0x7f')][_0x4f8e('0x118')](db[_0x4f8e('0x7f')],{'as':_0x4f8e('0x167'),'foreignKey':'ParentId','onDelete':'cascade'});db[_0x4f8e('0x82')][_0x4f8e('0x118')](db[_0x4f8e('0x82')],{'as':_0x4f8e('0x1a4'),'foreignKey':_0x4f8e('0x155'),'onDelete':_0x4f8e('0x115'),'hooks':!![],'required':![]});db[_0x4f8e('0x82')][_0x4f8e('0x118')](db['VoiceExtension'],{'as':_0x4f8e('0x11a'),'foreignKey':_0x4f8e('0x155'),'onDelete':_0x4f8e('0x165')});db[_0x4f8e('0x82')][_0x4f8e('0x118')](db[_0x4f8e('0x42')],{'as':'MailApplications','foreignKey':_0x4f8e('0x155')});db['Interval'][_0x4f8e('0x118')](db['ChatApplication'],{'as':_0x4f8e('0x1a5'),'foreignKey':_0x4f8e('0x155')});db[_0x4f8e('0x82')][_0x4f8e('0x118')](db[_0x4f8e('0x49')],{'as':'FaxApplications','foreignKey':'IntervalId'});db[_0x4f8e('0x82')]['hasMany'](db[_0x4f8e('0x53')],{'as':_0x4f8e('0x1a6'),'foreignKey':_0x4f8e('0x155')});db['Schedule'][_0x4f8e('0x153')](db[_0x4f8e('0x3a')],{});db[_0x4f8e('0x87')]['belongsTo'](db[_0x4f8e('0x1a7')],{'foreignKey':'DefaultReportId'});db[_0x4f8e('0x87')][_0x4f8e('0x153')](db[_0x4f8e('0x1a8')],{'foreignKey':_0x4f8e('0x1a9')});db[_0x4f8e('0x14c')][_0x4f8e('0x124')](db['VoiceMusicOnHold'],{'as':_0x4f8e('0x1aa'),'through':'moh_has_sounds','onDelete':'restrict'});db[_0x4f8e('0x8a')][_0x4f8e('0x124')](db[_0x4f8e('0x6f')],{'through':_0x4f8e('0x19a')});db['Tag'][_0x4f8e('0x124')](db[_0x4f8e('0x63')],{'through':_0x4f8e('0x190')});db['Tag'][_0x4f8e('0x124')](db[_0x4f8e('0x40')],{'through':'mail_interaction_has_tags'});db['Tag'][_0x4f8e('0x124')](db['SmsInteraction'],{'through':_0x4f8e('0x1ab')});db[_0x4f8e('0x8a')][_0x4f8e('0x124')](db[_0x4f8e('0x4b')],{'through':'fax_interaction_has_tags'});db[_0x4f8e('0x8a')][_0x4f8e('0x124')](db['OpenchannelInteraction'],{'through':_0x4f8e('0x1ac')});db[_0x4f8e('0x8a')][_0x4f8e('0x124')](db['WhatsappInteraction'],{'through':_0x4f8e('0x1ad')});db['CmContactHasItem']['belongsTo'](db['ContactItemType'],{'as':'ItemType','foreignKey':_0x4f8e('0x1ae')});db[_0x4f8e('0x19b')]['belongsTo'](db[_0x4f8e('0x121')],{'as':_0x4f8e('0x1af'),'foreignKey':'CmHopperId'});db[_0x4f8e('0x196')][_0x4f8e('0x153')](db[_0x4f8e('0x6f')],{'as':_0x4f8e('0x162'),'foreignKey':_0x4f8e('0x198')});db[_0x4f8e('0x91')]['hasMany'](db['Condition'],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':_0x4f8e('0x1b0'),'onDelete':'cascade','hooks':!![]});db[_0x4f8e('0x91')][_0x4f8e('0x118')](db['Condition'],{'as':{'plural':_0x4f8e('0x1b1'),'singular':_0x4f8e('0x1b2')},'foreignKey':_0x4f8e('0x1b3'),'onDelete':_0x4f8e('0x115'),'hooks':!![]});db[_0x4f8e('0x91')][_0x4f8e('0x118')](db[_0x4f8e('0x7a')],{'as':_0x4f8e('0x1b4'),'foreignKey':_0x4f8e('0x1b5'),'onDelete':_0x4f8e('0x115'),'hooks':!![]});db[_0x4f8e('0x1a8')][_0x4f8e('0x118')](db[_0x4f8e('0x9b')],{'as':'Fields','onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1a9'),'hooks':!![]});db[_0x4f8e('0x1a7')][_0x4f8e('0x118')](db[_0x4f8e('0x9b')],{'as':'Fields','onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x4f8e('0x1b6')][_0x4f8e('0x118')](db['AnalyticFieldReport'],{'as':_0x4f8e('0x1b7'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1b8')});db['AnalyticFieldReport'][_0x4f8e('0x153')](db[_0x4f8e('0x1b6')],{'foreignKey':_0x4f8e('0x1b8')});db[_0x4f8e('0x9f')]['hasMany'](db[_0x4f8e('0xa1')],{'as':'Configurations','onDelete':_0x4f8e('0x115'),'foreignKey':'AccountId'});db[_0x4f8e('0xa1')]['hasMany'](db['SalesforceField'],{'as':_0x4f8e('0x1b9'),'onDelete':_0x4f8e('0x115'),'foreignKey':'SubjectId'});db[_0x4f8e('0xa1')][_0x4f8e('0x118')](db['SalesforceField'],{'as':_0x4f8e('0x1ba'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1bb')});db[_0x4f8e('0xa1')][_0x4f8e('0x118')](db[_0x4f8e('0x1bc')],{'as':'Fields','onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1bd')});db[_0x4f8e('0xa1')][_0x4f8e('0x153')](db[_0x4f8e('0x9f')],{'as':'Account','foreignKey':_0x4f8e('0x1be')});db[_0x4f8e('0x1bc')][_0x4f8e('0x118')](db[_0x4f8e('0x1bc')],{'as':_0x4f8e('0x1bf'),'foreignKey':'SubjectId'});db[_0x4f8e('0x1bc')][_0x4f8e('0x118')](db[_0x4f8e('0x1bc')],{'as':_0x4f8e('0x1c0'),'foreignKey':_0x4f8e('0x1bb')});db[_0x4f8e('0x1bc')]['hasMany'](db['SalesforceField'],{'as':_0x4f8e('0x1c1'),'foreignKey':_0x4f8e('0x1bd')});db[_0x4f8e('0x1bc')][_0x4f8e('0x153')](db['Variable'],{'as':_0x4f8e('0x1c2'),'foreignKey':_0x4f8e('0x1c3')});db[_0x4f8e('0xa4')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0x4f8e('0x1c4'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1be')});db[_0x4f8e('0xa6')][_0x4f8e('0x118')](db[_0x4f8e('0xa7')],{'as':_0x4f8e('0x1b9'),'onDelete':_0x4f8e('0x115'),'foreignKey':'SubjectId'});db['SugarcrmConfiguration'][_0x4f8e('0x118')](db[_0x4f8e('0xa7')],{'as':'Descriptions','onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1bb')});db[_0x4f8e('0xa6')]['hasMany'](db[_0x4f8e('0xa7')],{'as':_0x4f8e('0x1b7'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1bd')});db['SugarcrmConfiguration'][_0x4f8e('0x153')](db['SugarcrmAccount'],{'as':_0x4f8e('0x177'),'foreignKey':_0x4f8e('0x1be')});db['SugarcrmField']['hasMany'](db[_0x4f8e('0xa7')],{'as':_0x4f8e('0x1bf'),'foreignKey':'SubjectId'});db[_0x4f8e('0xa7')][_0x4f8e('0x118')](db[_0x4f8e('0xa7')],{'as':_0x4f8e('0x1c0'),'foreignKey':'DescriptionId'});db[_0x4f8e('0xa7')][_0x4f8e('0x118')](db[_0x4f8e('0xa7')],{'as':'Field','foreignKey':_0x4f8e('0x1bd')});db[_0x4f8e('0xa7')]['belongsTo'](db[_0x4f8e('0x1c2')],{'as':_0x4f8e('0x1c2'),'foreignKey':'VariableId'});db[_0x4f8e('0xa8')]['hasMany'](db[_0x4f8e('0xaa')],{'as':_0x4f8e('0x1c4'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1be')});db[_0x4f8e('0xaa')][_0x4f8e('0x118')](db[_0x4f8e('0xab')],{'as':_0x4f8e('0x1b9'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1c5')});db[_0x4f8e('0xaa')][_0x4f8e('0x118')](db[_0x4f8e('0xab')],{'as':_0x4f8e('0x1ba'),'onDelete':'cascade','foreignKey':_0x4f8e('0x1bb')});db[_0x4f8e('0xaa')]['hasMany'](db[_0x4f8e('0xab')],{'as':_0x4f8e('0x1b7'),'onDelete':'cascade','foreignKey':_0x4f8e('0x1bd')});db['DeskConfiguration']['belongsTo'](db[_0x4f8e('0xa8')],{'as':_0x4f8e('0x177'),'foreignKey':_0x4f8e('0x1be')});db[_0x4f8e('0xaa')]['belongsToMany'](db[_0x4f8e('0x8a')],{'through':_0x4f8e('0x1c6')});db['DeskField'][_0x4f8e('0x118')](db[_0x4f8e('0xab')],{'as':_0x4f8e('0x1bf'),'foreignKey':'SubjectId'});db[_0x4f8e('0xab')][_0x4f8e('0x118')](db['DeskField'],{'as':_0x4f8e('0x1c0'),'foreignKey':_0x4f8e('0x1bb')});db[_0x4f8e('0xab')][_0x4f8e('0x118')](db[_0x4f8e('0xab')],{'as':_0x4f8e('0x1c1'),'foreignKey':_0x4f8e('0x1bd')});db['DeskField']['belongsTo'](db[_0x4f8e('0x1c2')],{'as':_0x4f8e('0x1c2'),'foreignKey':_0x4f8e('0x1c3')});db['ZohoAccount'][_0x4f8e('0x118')](db[_0x4f8e('0xac')],{'as':_0x4f8e('0x1c4'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1be')});db[_0x4f8e('0xac')][_0x4f8e('0x118')](db[_0x4f8e('0xae')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x4f8e('0x1c5')});db[_0x4f8e('0xac')][_0x4f8e('0x118')](db[_0x4f8e('0xae')],{'as':_0x4f8e('0x1ba'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1bb')});db[_0x4f8e('0xac')][_0x4f8e('0x118')](db['ZohoField'],{'as':_0x4f8e('0x1b7'),'onDelete':'cascade','foreignKey':_0x4f8e('0x1bd')});db['ZohoConfiguration']['belongsTo'](db['ZohoAccount'],{'as':_0x4f8e('0x177'),'foreignKey':_0x4f8e('0x1be')});db['ZohoField']['hasMany'](db[_0x4f8e('0xae')],{'as':'Subject','foreignKey':_0x4f8e('0x1c5')});db[_0x4f8e('0xae')][_0x4f8e('0x118')](db[_0x4f8e('0xae')],{'as':_0x4f8e('0x1c0'),'foreignKey':_0x4f8e('0x1bb')});db[_0x4f8e('0xae')][_0x4f8e('0x118')](db[_0x4f8e('0xae')],{'as':_0x4f8e('0x1c1'),'foreignKey':_0x4f8e('0x1bd')});db['ZohoField'][_0x4f8e('0x153')](db[_0x4f8e('0x1c2')],{'as':_0x4f8e('0x1c2'),'foreignKey':_0x4f8e('0x1c3')});db[_0x4f8e('0xb0')]['hasMany'](db['ZendeskConfiguration'],{'as':_0x4f8e('0x1c4'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1be')});db['ZendeskConfiguration'][_0x4f8e('0x118')](db[_0x4f8e('0xb4')],{'as':_0x4f8e('0x1b9'),'foreignKey':_0x4f8e('0x1c5')});db[_0x4f8e('0xb2')]['hasMany'](db[_0x4f8e('0xb4')],{'as':_0x4f8e('0x1ba'),'foreignKey':_0x4f8e('0x1bb')});db[_0x4f8e('0xb2')][_0x4f8e('0x118')](db[_0x4f8e('0xb4')],{'as':_0x4f8e('0x1b7'),'foreignKey':_0x4f8e('0x1bd')});db[_0x4f8e('0xb2')][_0x4f8e('0x153')](db[_0x4f8e('0xb0')],{'as':_0x4f8e('0x177'),'foreignKey':_0x4f8e('0x1be')});db[_0x4f8e('0xb2')]['belongsToMany'](db[_0x4f8e('0x8a')],{'through':_0x4f8e('0x1c7')});db['ZendeskField'][_0x4f8e('0x118')](db[_0x4f8e('0xb4')],{'as':_0x4f8e('0x1bf'),'foreignKey':_0x4f8e('0x1c5')});db[_0x4f8e('0xb4')]['hasMany'](db[_0x4f8e('0xb4')],{'as':_0x4f8e('0x1c0'),'foreignKey':'DescriptionId'});db[_0x4f8e('0xb4')][_0x4f8e('0x118')](db[_0x4f8e('0xb4')],{'as':_0x4f8e('0x1c1'),'foreignKey':'FieldId'});db[_0x4f8e('0xb4')][_0x4f8e('0x153')](db[_0x4f8e('0x1c2')],{'as':_0x4f8e('0x1c2'),'foreignKey':_0x4f8e('0x1c3')});db[_0x4f8e('0xb6')][_0x4f8e('0x118')](db['FreshdeskConfiguration'],{'as':_0x4f8e('0x1c4'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1be')});db[_0x4f8e('0xb7')][_0x4f8e('0x118')](db[_0x4f8e('0xb9')],{'as':_0x4f8e('0x1b9'),'onDelete':'cascade','foreignKey':_0x4f8e('0x1c5')});db[_0x4f8e('0xb7')]['hasMany'](db[_0x4f8e('0xb9')],{'as':'Descriptions','onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1bb')});db[_0x4f8e('0xb7')][_0x4f8e('0x118')](db[_0x4f8e('0xb9')],{'as':'Fields','onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1bd')});db[_0x4f8e('0xb7')][_0x4f8e('0x153')](db[_0x4f8e('0xb6')],{'as':'Account','foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x4f8e('0x124')](db[_0x4f8e('0x8a')],{'through':_0x4f8e('0x1c8')});db[_0x4f8e('0xb9')][_0x4f8e('0x118')](db[_0x4f8e('0xb9')],{'as':_0x4f8e('0x1bf'),'foreignKey':_0x4f8e('0x1c5')});db['FreshdeskField'][_0x4f8e('0x118')](db[_0x4f8e('0xb9')],{'as':_0x4f8e('0x1c0'),'foreignKey':'DescriptionId'});db[_0x4f8e('0xb9')][_0x4f8e('0x118')](db['FreshdeskField'],{'as':'Field','foreignKey':_0x4f8e('0x1bd')});db[_0x4f8e('0xb9')][_0x4f8e('0x153')](db['Variable'],{'as':_0x4f8e('0x1c2'),'foreignKey':_0x4f8e('0x1c3')});db[_0x4f8e('0x1c9')][_0x4f8e('0x118')](db[_0x4f8e('0xbb')],{'as':_0x4f8e('0x1c4'),'onDelete':_0x4f8e('0x115'),'foreignKey':'AccountId'});db[_0x4f8e('0xbb')][_0x4f8e('0x118')](db['VtigerField'],{'as':_0x4f8e('0x1b9'),'foreignKey':_0x4f8e('0x1c5')});db[_0x4f8e('0xbb')][_0x4f8e('0x118')](db[_0x4f8e('0xbc')],{'as':_0x4f8e('0x1ba'),'foreignKey':'DescriptionId'});db['VtigerConfiguration'][_0x4f8e('0x118')](db[_0x4f8e('0xbc')],{'as':'Fields','foreignKey':_0x4f8e('0x1bd')});db[_0x4f8e('0xbb')][_0x4f8e('0x153')](db['VtigerAccount'],{'as':_0x4f8e('0x177'),'foreignKey':_0x4f8e('0x1be')});db[_0x4f8e('0xbc')][_0x4f8e('0x118')](db[_0x4f8e('0xbc')],{'as':_0x4f8e('0x1bf'),'foreignKey':_0x4f8e('0x1c5')});db['VtigerField']['hasMany'](db[_0x4f8e('0xbc')],{'as':'Description','foreignKey':_0x4f8e('0x1bb')});db['VtigerField']['hasMany'](db[_0x4f8e('0xbc')],{'as':_0x4f8e('0x1c1'),'foreignKey':_0x4f8e('0x1bd')});db[_0x4f8e('0xbc')][_0x4f8e('0x153')](db['Variable'],{'as':'Variable','foreignKey':_0x4f8e('0x1c3')});db['ServicenowAccount'][_0x4f8e('0x118')](db[_0x4f8e('0xbf')],{'as':_0x4f8e('0x1c4'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1be')});db['ServicenowConfiguration'][_0x4f8e('0x118')](db[_0x4f8e('0xc1')],{'as':'Subjects','foreignKey':_0x4f8e('0x1c5')});db[_0x4f8e('0xbf')]['hasMany'](db[_0x4f8e('0xc1')],{'as':_0x4f8e('0x1ba'),'foreignKey':_0x4f8e('0x1bb')});db['ServicenowConfiguration'][_0x4f8e('0x118')](db[_0x4f8e('0xc1')],{'as':'Fields','foreignKey':_0x4f8e('0x1bd')});db[_0x4f8e('0xbf')][_0x4f8e('0x153')](db[_0x4f8e('0xbd')],{'as':_0x4f8e('0x177'),'foreignKey':_0x4f8e('0x1be')});db['ServicenowField'][_0x4f8e('0x118')](db[_0x4f8e('0xc1')],{'as':'Subject','foreignKey':_0x4f8e('0x1c5')});db[_0x4f8e('0xc1')]['hasMany'](db[_0x4f8e('0xc1')],{'as':_0x4f8e('0x1c0'),'foreignKey':'DescriptionId'});db['ServicenowField'][_0x4f8e('0x118')](db['ServicenowField'],{'as':_0x4f8e('0x1c1'),'foreignKey':_0x4f8e('0x1bd')});db['ServicenowField'][_0x4f8e('0x153')](db[_0x4f8e('0x1c2')],{'as':_0x4f8e('0x1c2'),'foreignKey':_0x4f8e('0x1c3')});db['Dynamics365Account'][_0x4f8e('0x118')](db['Dynamics365Configuration'],{'as':_0x4f8e('0x1c4'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1be')});db['Dynamics365Account']['belongsTo'](db['CloudProvider'],{'as':_0x4f8e('0x10a'),'foreignKey':_0x4f8e('0x164')});db[_0x4f8e('0xc5')][_0x4f8e('0x118')](db['Dynamics365Field'],{'as':_0x4f8e('0x1b9'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1c5')});db['Dynamics365Configuration'][_0x4f8e('0x118')](db[_0x4f8e('0xc7')],{'as':_0x4f8e('0x1ba'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1bb')});db[_0x4f8e('0xc5')][_0x4f8e('0x118')](db[_0x4f8e('0xc7')],{'as':_0x4f8e('0x1b7'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1bd')});db[_0x4f8e('0xc5')]['belongsTo'](db[_0x4f8e('0xc3')],{'as':_0x4f8e('0x177'),'foreignKey':_0x4f8e('0x1be')});db[_0x4f8e('0xc7')][_0x4f8e('0x118')](db[_0x4f8e('0xc7')],{'as':'Subject','foreignKey':_0x4f8e('0x1c5')});db[_0x4f8e('0xc7')][_0x4f8e('0x118')](db[_0x4f8e('0xc7')],{'as':_0x4f8e('0x1c0'),'foreignKey':'DescriptionId'});db[_0x4f8e('0xc7')][_0x4f8e('0x118')](db['Dynamics365Field'],{'as':_0x4f8e('0x1c1'),'foreignKey':'FieldId'});db[_0x4f8e('0xc7')][_0x4f8e('0x153')](db[_0x4f8e('0x1c2')],{'as':_0x4f8e('0x1c2'),'foreignKey':_0x4f8e('0x1c3')});db[_0x4f8e('0xc9')][_0x4f8e('0x118')](db[_0x4f8e('0x1ca')],{'as':_0x4f8e('0x1c4'),'onDelete':'cascade','foreignKey':_0x4f8e('0x1be')});db[_0x4f8e('0x1ca')][_0x4f8e('0x118')](db['FreshsalesField'],{'as':_0x4f8e('0x1b9'),'foreignKey':'SubjectId'});db['FreshsalesConfiguration'][_0x4f8e('0x118')](db['FreshsalesField'],{'as':_0x4f8e('0x1ba'),'foreignKey':'DescriptionId'});db[_0x4f8e('0x1ca')][_0x4f8e('0x118')](db[_0x4f8e('0x1cb')],{'as':_0x4f8e('0x1b7'),'foreignKey':_0x4f8e('0x1bd')});db['FreshsalesConfiguration'][_0x4f8e('0x153')](db[_0x4f8e('0xc9')],{'as':_0x4f8e('0x177'),'foreignKey':_0x4f8e('0x1be')});db['FreshsalesField']['hasMany'](db[_0x4f8e('0x1cb')],{'as':_0x4f8e('0x1bf'),'foreignKey':_0x4f8e('0x1c5')});db[_0x4f8e('0x1cb')][_0x4f8e('0x118')](db[_0x4f8e('0x1cb')],{'as':_0x4f8e('0x1c0'),'foreignKey':_0x4f8e('0x1bb')});db['FreshsalesField']['hasMany'](db[_0x4f8e('0x1cb')],{'as':_0x4f8e('0x1c1'),'foreignKey':'FieldId'});db[_0x4f8e('0x1cb')][_0x4f8e('0x153')](db[_0x4f8e('0x1c2')],{'as':'Variable','foreignKey':_0x4f8e('0x1c3')});db[_0x4f8e('0xcd')][_0x4f8e('0x153')](db[_0x4f8e('0x178')],{});db[_0x4f8e('0xcd')]['belongsTo'](db['CmList'],{'as':_0x4f8e('0x169'),'foreignKey':_0x4f8e('0x17f')});db['ChatQueueReport'][_0x4f8e('0x153')](db[_0x4f8e('0x6f')],{'as':'Contact','foreignKey':'ContactId'});db[_0x4f8e('0xcd')][_0x4f8e('0x153')](db[_0x4f8e('0x63')],{});db['ChatQueueReport'][_0x4f8e('0x153')](db[_0x4f8e('0x65')],{});db[_0x4f8e('0xcd')]['belongsTo'](db[_0x4f8e('0x11')],{});db[_0x4f8e('0xcd')][_0x4f8e('0x153')](db[_0x4f8e('0x137')],{});db['ChatInternalMessage']['belongsTo'](db[_0x4f8e('0x11')],{'onDelete':'cascade','foreignKey':_0x4f8e('0x1cc')});db[_0x4f8e('0xcf')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1cd')});db[_0x4f8e('0xd4')][_0x4f8e('0x118')](db[_0x4f8e('0xd3')],{'foreignKey':_0x4f8e('0x1ce'),'onDelete':_0x4f8e('0x115')});db[_0x4f8e('0xd4')][_0x4f8e('0x118')](db[_0x4f8e('0xd1')],{'foreignKey':'SessionId','onDelete':_0x4f8e('0x115')});db[_0x4f8e('0xd6')][_0x4f8e('0x153')](db[_0x4f8e('0x51')],{});db[_0x4f8e('0xd6')][_0x4f8e('0x153')](db[_0x4f8e('0x158')],{'as':'List','foreignKey':_0x4f8e('0x17f')});db[_0x4f8e('0xd6')]['belongsTo'](db[_0x4f8e('0x6f')],{'as':'Contact','foreignKey':_0x4f8e('0x16f')});db[_0x4f8e('0xd6')][_0x4f8e('0x153')](db['SmsInteraction'],{});db['SmsQueueReport'][_0x4f8e('0x153')](db[_0x4f8e('0x56')],{});db[_0x4f8e('0xd6')]['belongsTo'](db[_0x4f8e('0x11')],{});db[_0x4f8e('0xd6')][_0x4f8e('0x153')](db[_0x4f8e('0x13a')],{});db[_0x4f8e('0xda')][_0x4f8e('0x118')](db[_0x4f8e('0xd4')],{'foreignKey':_0x4f8e('0x1cf')});db[_0x4f8e('0xda')]['hasMany'](db[_0x4f8e('0xd3')],{'foreignKey':_0x4f8e('0x1cf')});db[_0x4f8e('0xda')][_0x4f8e('0x118')](db[_0x4f8e('0xd1')],{'foreignKey':'ProjectId'});db[_0x4f8e('0xe4')]['belongsToMany'](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x15a'),'through':_0x4f8e('0x12b')});db[_0x4f8e('0xe4')][_0x4f8e('0x124')](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':_0x4f8e('0x133')});db[_0x4f8e('0xe4')][_0x4f8e('0x124')](db[_0x4f8e('0x3c')],{'through':_0x4f8e('0x16c'),'as':_0x4f8e('0x136')});db[_0x4f8e('0xe4')]['belongsToMany'](db[_0x4f8e('0x137')],{'through':'team_has_chat_queues','as':_0x4f8e('0x138')});db[_0x4f8e('0xe4')][_0x4f8e('0x124')](db[_0x4f8e('0x139')],{'through':_0x4f8e('0x183'),'as':'FaxQueues'});db[_0x4f8e('0xe4')]['belongsToMany'](db['SmsQueue'],{'through':_0x4f8e('0x1d0'),'as':_0x4f8e('0x1d1')});db[_0x4f8e('0xe4')][_0x4f8e('0x124')](db[_0x4f8e('0x5e')],{'through':_0x4f8e('0x18a'),'as':_0x4f8e('0x13b')});db[_0x4f8e('0xe4')][_0x4f8e('0x124')](db[_0x4f8e('0x108')],{'through':'team_has_whatsapp_queues','as':_0x4f8e('0x13c')});db[_0x4f8e('0xe4')][_0x4f8e('0x124')](db['VoicePrefix'],{'through':_0x4f8e('0x10e'),'as':'VoicePrefixes'});db[_0x4f8e('0xe8')][_0x4f8e('0x118')](db['CmHopper'],{'as':_0x4f8e('0x122'),'foreignKey':_0x4f8e('0x19d')});db[_0x4f8e('0xe8')][_0x4f8e('0x118')](db[_0x4f8e('0x74')],{'as':'HopperFinals','foreignKey':_0x4f8e('0x19d')});db[_0x4f8e('0xe8')][_0x4f8e('0x118')](db[_0x4f8e('0x76')],{'as':_0x4f8e('0x150'),'foreignKey':'CampaignId'});db[_0x4f8e('0xe8')][_0x4f8e('0x118')](db[_0x4f8e('0x72')],{'as':'HopperBlacks','foreignKey':_0x4f8e('0x19d')});db[_0x4f8e('0xe8')]['belongsTo'](db[_0x4f8e('0x28')],{'as':_0x4f8e('0x28'),'foreignKey':'TrunkId'});db['Campaign'][_0x4f8e('0x153')](db[_0x4f8e('0x28')],{'as':_0x4f8e('0x1d2'),'foreignKey':_0x4f8e('0x154')});db[_0x4f8e('0xe8')]['belongsTo'](db[_0x4f8e('0x82')],{'as':_0x4f8e('0x82'),'foreignKey':_0x4f8e('0x155')});db[_0x4f8e('0xe8')][_0x4f8e('0x153')](db[_0x4f8e('0xdf')],{'as':_0x4f8e('0xdf'),'foreignKey':_0x4f8e('0x1d3')});db[_0x4f8e('0xe8')][_0x4f8e('0x124')](db['CmList'],{'as':_0x4f8e('0x129'),'through':_0x4f8e('0x1d4')});db[_0x4f8e('0xe8')][_0x4f8e('0x124')](db[_0x4f8e('0x158')],{'as':_0x4f8e('0x15b'),'through':_0x4f8e('0x1d5')});db['Attachment'][_0x4f8e('0x153')](db[_0x4f8e('0x67')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0x4f8e('0xf0')]['belongsTo'](db[_0x4f8e('0x41')],{});db['MailTransferReport'][_0x4f8e('0x153')](db[_0x4f8e('0x40')],{});db[_0x4f8e('0xf0')]['belongsTo'](db['MailAccount'],{'foreignKey':_0x4f8e('0x1d6'),'as':_0x4f8e('0x1d7')});db[_0x4f8e('0xf0')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x4f8e('0x1d8')});db[_0x4f8e('0xf0')]['belongsTo'](db[_0x4f8e('0x11')],{'foreignKey':_0x4f8e('0x1d9'),'as':_0x4f8e('0x1da')});db[_0x4f8e('0xf0')][_0x4f8e('0x153')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db['MailTransferReport']['belongsTo'](db['MailAccount'],{'foreignKey':_0x4f8e('0x1db'),'as':'ToAccount'});db[_0x4f8e('0xf2')][_0x4f8e('0x153')](db[_0x4f8e('0x65')],{});db[_0x4f8e('0xf2')][_0x4f8e('0x153')](db['ChatInteraction'],{});db[_0x4f8e('0xf2')][_0x4f8e('0x153')](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0x4f8e('0x1d7')});db[_0x4f8e('0xf2')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'foreignKey':_0x4f8e('0x1dc'),'as':_0x4f8e('0x1d8')});db['ChatTransferReport'][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'foreignKey':_0x4f8e('0x1d9'),'as':_0x4f8e('0x1da')});db[_0x4f8e('0xf2')][_0x4f8e('0x153')](db[_0x4f8e('0x137')],{'foreignKey':_0x4f8e('0x1dd'),'as':_0x4f8e('0x1de')});db[_0x4f8e('0xf2')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x4f8e('0x1df'),'as':_0x4f8e('0x1e0')});db[_0x4f8e('0xf4')][_0x4f8e('0x153')](db[_0x4f8e('0x4d')],{});db['FaxTransferReport'][_0x4f8e('0x153')](db[_0x4f8e('0x4b')],{});db['FaxTransferReport'][_0x4f8e('0x153')](db[_0x4f8e('0x47')],{'foreignKey':_0x4f8e('0x1e1'),'as':'FromAccount'});db[_0x4f8e('0xf4')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x4f8e('0xf4')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'foreignKey':_0x4f8e('0x1d9'),'as':_0x4f8e('0x1da')});db[_0x4f8e('0xf4')][_0x4f8e('0x153')](db[_0x4f8e('0x139')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db[_0x4f8e('0xf4')][_0x4f8e('0x153')](db[_0x4f8e('0x47')],{'foreignKey':_0x4f8e('0x1e2'),'as':'ToAccount'});db[_0x4f8e('0x1e3')][_0x4f8e('0x153')](db[_0x4f8e('0x5d')],{});db[_0x4f8e('0x1e3')][_0x4f8e('0x153')](db[_0x4f8e('0x5b')],{});db[_0x4f8e('0x1e3')][_0x4f8e('0x153')](db[_0x4f8e('0x58')],{'foreignKey':_0x4f8e('0x1e4'),'as':_0x4f8e('0x1d7')});db[_0x4f8e('0x1e3')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'foreignKey':_0x4f8e('0x1dc'),'as':_0x4f8e('0x1d8')});db[_0x4f8e('0x1e3')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'foreignKey':_0x4f8e('0x1d9'),'as':_0x4f8e('0x1da')});db[_0x4f8e('0x1e3')][_0x4f8e('0x153')](db[_0x4f8e('0x5e')],{'foreignKey':_0x4f8e('0x1e5'),'as':_0x4f8e('0x1de')});db['OpenchannelTransferReport']['belongsTo'](db[_0x4f8e('0x58')],{'foreignKey':'ToOpenchannelAccountId','as':_0x4f8e('0x1e0')});db[_0x4f8e('0xf6')][_0x4f8e('0x153')](db[_0x4f8e('0x56')],{});db[_0x4f8e('0xf6')][_0x4f8e('0x153')](db[_0x4f8e('0x55')],{});db[_0x4f8e('0xf6')]['belongsTo'](db[_0x4f8e('0x51')],{'foreignKey':_0x4f8e('0x1e6'),'as':_0x4f8e('0x1d7')});db[_0x4f8e('0xf6')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'foreignKey':_0x4f8e('0x1dc'),'as':_0x4f8e('0x1d8')});db['SmsTransferReport'][_0x4f8e('0x153')](db['User'],{'foreignKey':_0x4f8e('0x1d9'),'as':_0x4f8e('0x1da')});db[_0x4f8e('0xf6')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x4f8e('0x1de')});db[_0x4f8e('0xf6')][_0x4f8e('0x153')](db['SmsAccount'],{'foreignKey':_0x4f8e('0x1e7'),'as':_0x4f8e('0x1e0')});db[_0x4f8e('0x158')]['hasMany'](db[_0x4f8e('0x7f')],{'as':_0x4f8e('0x167'),'foreignKey':_0x4f8e('0x17f'),'onDelete':_0x4f8e('0x115')});db['CmList'][_0x4f8e('0x118')](db[_0x4f8e('0x79')],{'as':_0x4f8e('0x1e8'),'foreignKey':_0x4f8e('0x17f')});db[_0x4f8e('0x158')][_0x4f8e('0x118')](db['CmContact'],{'as':_0x4f8e('0x127'),'onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x17f')});db[_0x4f8e('0x158')][_0x4f8e('0x118')](db[_0x4f8e('0x74')],{'as':'HopperFinals','foreignKey':_0x4f8e('0x17f')});db[_0x4f8e('0x158')][_0x4f8e('0x118')](db[_0x4f8e('0x76')],{'as':_0x4f8e('0x11c'),'foreignKey':_0x4f8e('0x17f')});db[_0x4f8e('0x158')][_0x4f8e('0x118')](db[_0x4f8e('0x77')],{'as':'ReportAgentPreview','foreignKey':_0x4f8e('0x17f')});db[_0x4f8e('0x158')][_0x4f8e('0x124')](db[_0x4f8e('0x19')],{'as':'Queues','through':_0x4f8e('0x159')});db[_0x4f8e('0x158')][_0x4f8e('0x124')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x15a'),'through':_0x4f8e('0x12a')});db['VoicePrefix'][_0x4f8e('0x118')](db[_0x4f8e('0x15')],{'as':_0x4f8e('0x11a'),'onDelete':_0x4f8e('0x115')});db['VoicePrefix'][_0x4f8e('0x124')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x15a'),'through':_0x4f8e('0x10f')});db[_0x4f8e('0x134')][_0x4f8e('0x124')](db[_0x4f8e('0xe4')],{'through':'TeamVoicePrefix','as':_0x4f8e('0x16d')});db['UserProfile']['hasMany'](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x174'),'foreignKey':_0x4f8e('0x1e9')});db[_0x4f8e('0xfa')]['hasMany'](db[_0x4f8e('0x1ea')],{'as':_0x4f8e('0x1eb'),'foreignKey':'userProfileId','onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x1ea')][_0x4f8e('0x118')](db[_0x4f8e('0xfc')],{'as':_0x4f8e('0x1ec'),'foreignKey':_0x4f8e('0x1ed'),'onDelete':_0x4f8e('0x115')});db['WhatsappAccount'][_0x4f8e('0x118')](db[_0x4f8e('0x7f')],{'as':_0x4f8e('0x167'),'foreignKey':_0x4f8e('0x1ee'),'onDelete':_0x4f8e('0x115')});db[_0x4f8e('0x145')][_0x4f8e('0x118')](db[_0x4f8e('0x7e')],{'as':'Answers','foreignKey':_0x4f8e('0x1ee')});db[_0x4f8e('0x145')][_0x4f8e('0x118')](db[_0x4f8e('0x103')],{'as':_0x4f8e('0x15c'),'foreignKey':_0x4f8e('0x1ee')});db['WhatsappAccount'][_0x4f8e('0x118')](db[_0x4f8e('0x101')],{'as':_0x4f8e('0x168')});db['WhatsappAccount'][_0x4f8e('0x118')](db[_0x4f8e('0x1ef')],{'as':'Applications','foreignKey':'WhatsappAccountId','onDelete':'cascade'});db['WhatsappAccount'][_0x4f8e('0x153')](db[_0x4f8e('0x158')],{'as':_0x4f8e('0x169'),'foreignKey':_0x4f8e('0x17f')});db['WhatsappAccount']['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x4f8e('0x157')});db[_0x4f8e('0x145')][_0x4f8e('0x124')](db['User'],{'as':_0x4f8e('0x15a'),'through':_0x4f8e('0x146')});db['WhatsappApplication']['belongsTo'](db[_0x4f8e('0x11')],{'onDelete':_0x4f8e('0x165')});db[_0x4f8e('0x1ef')][_0x4f8e('0x153')](db['WhatsappQueue'],{'onDelete':_0x4f8e('0x165')});db[_0x4f8e('0x1ef')][_0x4f8e('0x153')](db[_0x4f8e('0x145')],{'onDelete':'restrict'});db['WhatsappApplication'][_0x4f8e('0x153')](db['Interval'],{'onDelete':'restrict','foreignKey':'IntervalId'});db['WhatsappApplication'][_0x4f8e('0x153')](db[_0x4f8e('0x8a')],{'onDelete':'restrict','foreignKey':_0x4f8e('0x179')});db[_0x4f8e('0x101')][_0x4f8e('0x118')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0x4f8e('0x115'),'foreignKey':_0x4f8e('0x1f0')});db[_0x4f8e('0x101')][_0x4f8e('0x153')](db[_0x4f8e('0x145')],{'as':_0x4f8e('0x177'),'foreignKey':_0x4f8e('0x1ee')});db[_0x4f8e('0x101')]['belongsTo'](db[_0x4f8e('0x6f')],{'as':_0x4f8e('0x162'),'foreignKey':_0x4f8e('0x16f')});db[_0x4f8e('0x101')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x170'),'foreignKey':'UserId'});db[_0x4f8e('0x101')][_0x4f8e('0x124')](db[_0x4f8e('0x8a')],{'through':_0x4f8e('0x1ad'),'as':_0x4f8e('0x172')});db[_0x4f8e('0x101')]['belongsToMany'](db[_0x4f8e('0x8a')],{'through':_0x4f8e('0x1ad'),'as':'ThroughTags'});db['WhatsappInteraction'][_0x4f8e('0x124')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x174'),'through':'user_has_whatsapp_interactions','foreignKey':_0x4f8e('0x1f0')});db[_0x4f8e('0x103')]['belongsTo'](db['User'],{'as':_0x4f8e('0x11')});db[_0x4f8e('0x103')][_0x4f8e('0x153')](db['CmContact'],{'onDelete':'cascade','as':_0x4f8e('0x162')});db[_0x4f8e('0x103')][_0x4f8e('0x153')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x4f8e('0x176'),'foreignKey':_0x4f8e('0x1f0')});db['WhatsappMessage'][_0x4f8e('0x153')](db[_0x4f8e('0x145')],{'as':_0x4f8e('0x177'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0x4f8e('0x153')](db[_0x4f8e('0x145')],{});db[_0x4f8e('0x105')][_0x4f8e('0x153')](db[_0x4f8e('0x158')],{'as':_0x4f8e('0x169'),'foreignKey':_0x4f8e('0x17f')});db[_0x4f8e('0x105')]['belongsTo'](db[_0x4f8e('0x6f')],{'as':_0x4f8e('0x162'),'foreignKey':_0x4f8e('0x16f')});db[_0x4f8e('0x105')][_0x4f8e('0x153')](db[_0x4f8e('0x101')],{});db[_0x4f8e('0x105')][_0x4f8e('0x153')](db[_0x4f8e('0x108')],{});db[_0x4f8e('0x105')][_0x4f8e('0x153')](db['WhatsappMessage'],{});db[_0x4f8e('0x105')][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{});db[_0x4f8e('0x106')][_0x4f8e('0x153')](db[_0x4f8e('0x103')],{});db[_0x4f8e('0x106')][_0x4f8e('0x153')](db[_0x4f8e('0x101')],{});db['WhatsappTransferReport'][_0x4f8e('0x153')](db[_0x4f8e('0x145')],{'foreignKey':_0x4f8e('0x1f1'),'as':_0x4f8e('0x1d7')});db[_0x4f8e('0x106')][_0x4f8e('0x153')](db['WhatsappAccount'],{'foreignKey':_0x4f8e('0x1f2'),'as':_0x4f8e('0x1e0')});db['WhatsappTransferReport'][_0x4f8e('0x153')](db[_0x4f8e('0x108')],{'foreignKey':_0x4f8e('0x1f3'),'as':_0x4f8e('0x1de')});db[_0x4f8e('0x106')]['belongsTo'](db[_0x4f8e('0x11')],{'foreignKey':'FromUserId','as':_0x4f8e('0x1d8')});db[_0x4f8e('0x106')][_0x4f8e('0x153')](db['User'],{'foreignKey':_0x4f8e('0x1d9'),'as':_0x4f8e('0x1da')});db['WhatsappQueue']['belongsToMany'](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x15a'),'through':_0x4f8e('0x13d'),'foreignKey':_0x4f8e('0x1f4')});db[_0x4f8e('0x108')][_0x4f8e('0x124')](db[_0x4f8e('0xe4')],{'through':'team_has_whatsapp_queues','as':_0x4f8e('0x16d')});db['UserSetting'][_0x4f8e('0x153')](db[_0x4f8e('0x11')],{'as':_0x4f8e('0x1f5'),'foreignKey':_0x4f8e('0x116'),'onDelete':_0x4f8e('0x115'),'hooks':!![]});db['CloudProvider']['hasOne'](db[_0x4f8e('0xc3')],{'as':'Dynamics365Account','onDelete':_0x4f8e('0x165')});db['CloudProvider']['hasOne'](db[_0x4f8e('0x36')],{'as':_0x4f8e('0x166'),'onDelete':'restrict'});db[_0x4f8e('0x10a')][_0x4f8e('0x113')](db[_0x4f8e('0x38')],{'as':_0x4f8e('0x1f6'),'onDelete':'restrict'});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x1f6e=['Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Sound','../api/tag/tag.model','ContactItemType','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','SalesforceAccount','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','MailInteractionHasTag','../api/mailInteractionHasTag/mailInteractionHasTag.model','hasOne','cascade','UserId','userSetting','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','FaxInteractions','WhatsappInteractions','UserNotifications','Hoppers','SET\x20NULL','UserProfile','userProfileId','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','MailInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','FaxQueues','OpenchannelQueues','WhatsappQueues','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','HopperFinals','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','Agents','Teams','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','mailboxuser','mailbox','QueueCalls','AgentReports','Contact','MailAccountId','CloudProviderId','restrict','Imap','Smtp','List','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','user_has_mail_interactions','Attachments','Interaction','ChatOfflineMessageId','IntervalId','TagId','ListId','DashboardItem','Items','Disposition','Dispositions','FaxAccountId','Interactions','FaxApplication','Exntensions','Messages','FaxInteractionId','fax_interaction_has_tags','ThroughTags','AttachmentId','team_has_fax_queues','FaxQueueReport','ContactId','SmsAccount','SmsAccountId','SmsInteraction','SmsInteractionId','sms_interaction_has_tags','Users','team_has_sms_queues','Answers','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','CompanyId','CmContactHasItem','Phones','CmContactId','SmsInteractions','Company','cm_contact_has_tags','CmHopperId','Agent','Campaign','CampaignId','OwnerId','All','AutomationAllId','OneAny','AutomationAnyId','Actions','ParentId','Intervals','ChatApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemTypeId','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','SalesforceConfiguration','AccountId','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Field','SugarcrmConfiguration','Configurations','Subjects','SugarcrmField','VariableId','DeskConfiguration','int_desk_configuration_has_tags','ZohoConfiguration','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','Description','ServicenowField','Dynamics365Field','FromId','ToId','SessionId','ProjectId','ChatQueues','SmsQueues','team_has_whatsapp_queues','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToAgent','ToChatQueueId','ToQueue','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CmCustomField','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSections','Resources','WhatsappAccountId','WhatsappInteractionId','ToWhatsappAccountId','WhatsappQueueId','user','exports','sequelize','jstz','defaultsDeep','motion2','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','xcall','xC@LL1234','name','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1f6e,0x171));var _0xe1f6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1f6e[_0x2641f9];return _0x585741;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xe1f6('0x0'));var _=require('lodash');var jstz=require(_0xe1f6('0x1'));var timezone=jstz['determine']();config[_0xe1f6('0x0')]=_[_0xe1f6('0x2')](config[_0xe1f6('0x0')],{'database':_0xe1f6('0x3'),'username':'xcall','password':'xC@LL1234','options':{'host':_0xe1f6('0x4'),'port':0xcea,'dialect':_0xe1f6('0x5'),'dialectOptions':{'charset':_0xe1f6('0x6')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xe1f6('0x7'),'collate':_0xe1f6('0x8')}}});config['sequelizeHistory']=_[_0xe1f6('0x2')](config[_0xe1f6('0x9')],{'database':_0xe1f6('0x3'),'username':_0xe1f6('0xa'),'password':_0xe1f6('0xb'),'options':{'host':_0xe1f6('0x4'),'port':0xcea,'dialect':_0xe1f6('0x5'),'dialectOptions':{'charset':_0xe1f6('0x6')},'logging':![],'timezone':timezone[_0xe1f6('0xc')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe1f6('0x0')][_0xe1f6('0xd')],config[_0xe1f6('0x0')][_0xe1f6('0xe')],config[_0xe1f6('0x0')][_0xe1f6('0xf')],config[_0xe1f6('0x0')][_0xe1f6('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe1f6('0x9')][_0xe1f6('0xd')],config[_0xe1f6('0x9')][_0xe1f6('0xe')],config[_0xe1f6('0x9')]['password'],config[_0xe1f6('0x9')]['options'])};db[_0xe1f6('0x11')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x13'));db[_0xe1f6('0x14')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0xe1f6('0x15')]=db['sequelize'][_0xe1f6('0x12')]('../api/voiceContext/voiceContext.model');db[_0xe1f6('0x16')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x17'));db[_0xe1f6('0x18')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x19'));db[_0xe1f6('0x1a')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x1b'));db['VoiceRecording']=db[_0xe1f6('0x0')]['import'](_0xe1f6('0x1c'));db[_0xe1f6('0x1d')]=db[_0xe1f6('0x0')]['import'](_0xe1f6('0x1e'));db[_0xe1f6('0x1f')]=db['sequelize'][_0xe1f6('0x12')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xe1f6('0x20')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/voiceCallReport/voiceCallReport.model');db[_0xe1f6('0x21')]=db[_0xe1f6('0x0')]['import'](_0xe1f6('0x22'));db[_0xe1f6('0x23')]=db[_0xe1f6('0x0')]['import']('../api/voiceAgentReport/voiceAgentReport.model');db[_0xe1f6('0x24')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x25'));db[_0xe1f6('0x26')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x27'));db[_0xe1f6('0x28')]=db[_0xe1f6('0x0')]['import'](_0xe1f6('0x29'));db[_0xe1f6('0x2a')]=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0x2b'));db[_0xe1f6('0x2c')]=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0x2d'));db[_0xe1f6('0x2e')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x2f'));db[_0xe1f6('0x30')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x31'));db[_0xe1f6('0x32')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x33'));db[_0xe1f6('0x34')]=db['sequelize']['import'](_0xe1f6('0x35'));db[_0xe1f6('0x36')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x37'));db[_0xe1f6('0x38')]=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0x39'));db[_0xe1f6('0x3a')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x3b'));db[_0xe1f6('0x3c')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x3d'));db[_0xe1f6('0x3e')]=db['sequelize']['import'](_0xe1f6('0x3f'));db[_0xe1f6('0x40')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x41'));db[_0xe1f6('0x42')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x43'));db[_0xe1f6('0x44')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x45'));db[_0xe1f6('0x46')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x47'));db[_0xe1f6('0x48')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x49'));db[_0xe1f6('0x4a')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x4b'));db[_0xe1f6('0x4c')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x4d'));db['Dashboard']=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0x4e'));db['DashboardItem']=db[_0xe1f6('0x0')]['import']('../api/dashboardItem/dashboardItem.model');db[_0xe1f6('0x4f')]=db[_0xe1f6('0x0')]['import'](_0xe1f6('0x50'));db['FaxApplication']=db[_0xe1f6('0x0')]['import']('../api/faxApplication/faxApplication.model');db[_0xe1f6('0x51')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x52'));db[_0xe1f6('0x53')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x54'));db[_0xe1f6('0x55')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/faxQueue/faxQueue.model');db['FaxQueueReport']=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x56'));db['SmsAccount']=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0x57'));db[_0xe1f6('0x58')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x59'));db['SmsInteraction']=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x5a'));db[_0xe1f6('0x5b')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x5c'));db[_0xe1f6('0x5d')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x5e'));db[_0xe1f6('0x5f')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x60'));db['OpenchannelApplication']=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/openchannelApplication/openchannelApplication.model');db[_0xe1f6('0x61')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x62'));db[_0xe1f6('0x63')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x64'));db[_0xe1f6('0x65')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x66'));db[_0xe1f6('0x67')]=db[_0xe1f6('0x0')]['import'](_0xe1f6('0x68'));db[_0xe1f6('0x69')]=db['sequelize']['import'](_0xe1f6('0x6a'));db[_0xe1f6('0x6b')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x6c'));db[_0xe1f6('0x6d')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x6e'));db[_0xe1f6('0x6f')]=db['sequelize'][_0xe1f6('0x12')]('../api/chatMessage/chatMessage.model');db[_0xe1f6('0x70')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x71'));db[_0xe1f6('0x72')]=db[_0xe1f6('0x0')]['import']('../api/chatQueue/chatQueue.model');db[_0xe1f6('0x73')]=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0x74'));db[_0xe1f6('0x75')]=db['sequelize'][_0xe1f6('0x12')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0xe1f6('0x76')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/cmCompany/cmCompany.model');db[_0xe1f6('0x77')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x78'));db[_0xe1f6('0x79')]=db['sequelize']['import'](_0xe1f6('0x7a'));db[_0xe1f6('0x7b')]=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0x7c'));db[_0xe1f6('0x7d')]=db['sequelize'][_0xe1f6('0x12')]('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0x7e'));db[_0xe1f6('0x7f')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x80'));db['CmCustomField']=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0xe1f6('0x81')]=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0x82'));db[_0xe1f6('0x83')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/automation/automation.model');db[_0xe1f6('0x84')]=db['sequelize']['import']('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x85'));db[_0xe1f6('0x86')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x87'));db[_0xe1f6('0x88')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/interval/interval.model');db[_0xe1f6('0x89')]=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0x8a'));db[_0xe1f6('0x8b')]=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0x8c'));db[_0xe1f6('0x8d')]=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0x8e'));db['Schedule']=db[_0xe1f6('0x0')]['import']('../api/schedule/schedule.model');db[_0xe1f6('0x8f')]=db['sequelize'][_0xe1f6('0x12')]('../api/sound/sound.model');db['Tag']=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0x90'));db[_0xe1f6('0x91')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/contactItemType/contactItemType.model');db['CmContactHasItem']=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/cmContactHasItem/cmContactHasItem.model');db[_0xe1f6('0x92')]=db[_0xe1f6('0x0')]['import'](_0xe1f6('0x93'));db[_0xe1f6('0x94')]=db[_0xe1f6('0x0')]['import'](_0xe1f6('0x95'));db[_0xe1f6('0x96')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x97'));db[_0xe1f6('0x98')]=db[_0xe1f6('0x0')]['import']('../api/variable/variable.model');db['Integration']=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/integration/integration.model');db['IntegrationReport']=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x99'));db['AnalyticCustomReport']=db[_0xe1f6('0x0')]['import'](_0xe1f6('0x9a'));db[_0xe1f6('0x9b')]=db[_0xe1f6('0x0')]['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xe1f6('0x9c')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x9d'));db[_0xe1f6('0x9e')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x9f'));db['AnalyticFieldReport']=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db['sequelize']['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0xe1f6('0xa0')]=db[_0xe1f6('0x0')]['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db['SalesforceConfiguration']=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xa1'));db[_0xe1f6('0xa2')]=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0xa3'));db[_0xe1f6('0xa4')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xa5'));db['SugarcrmConfiguration']=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xa6'));db['SugarcrmField']=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xa7'));db[_0xe1f6('0xa8')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xa9'));db['DeskConfiguration']=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xaa'));db[_0xe1f6('0xab')]=db['sequelize'][_0xe1f6('0x12')]('../api/intDeskField/intDeskField.model');db[_0xe1f6('0xac')]=db['sequelize'][_0xe1f6('0x12')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xad'));db[_0xe1f6('0xae')]=db['sequelize']['import'](_0xe1f6('0xaf'));db[_0xe1f6('0xb0')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xb1'));db[_0xe1f6('0xb2')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xb3'));db[_0xe1f6('0xb4')]=db[_0xe1f6('0x0')]['import'](_0xe1f6('0xb5'));db[_0xe1f6('0xb6')]=db[_0xe1f6('0x0')]['import']('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0xe1f6('0x0')]['import'](_0xe1f6('0xb7'));db[_0xe1f6('0xb8')]=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0xb9'));db[_0xe1f6('0xba')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xbb'));db[_0xe1f6('0xbc')]=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0xbd'));db[_0xe1f6('0xbe')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xbf'));db[_0xe1f6('0xc0')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xe1f6('0xc1')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xc2'));db['ServicenowField']=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xc3'));db[_0xe1f6('0xc4')]=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0xc5'));db[_0xe1f6('0xc6')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db['Dynamics365Field']=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0xc7'));db[_0xe1f6('0xc8')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xc9'));db[_0xe1f6('0xca')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xcb'));db[_0xe1f6('0xcc')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xcd'));db['Integration']=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/integration/integration.model');db[_0xe1f6('0xce')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/network/network.model');db[_0xe1f6('0xcf')]=db[_0xe1f6('0x0')]['import'](_0xe1f6('0xd0'));db[_0xe1f6('0xd1')]=db[_0xe1f6('0x0')]['import'](_0xe1f6('0xd2'));db[_0xe1f6('0xd3')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xd4'));db[_0xe1f6('0xd5')]=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0xd6'));db[_0xe1f6('0xd7')]=db[_0xe1f6('0x0')]['import'](_0xe1f6('0xd8'));db[_0xe1f6('0xd9')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/smsQueueReport/smsQueueReport.model');db[_0xe1f6('0xda')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xdb'));db[_0xe1f6('0xdc')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xdd'));db[_0xe1f6('0xde')]=db[_0xe1f6('0x0')]['import'](_0xe1f6('0xdf'));db[_0xe1f6('0xe0')]=db['sequelize'][_0xe1f6('0x12')]('../api/setting/setting.model');db['SquareOdbc']=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xe1'));db[_0xe1f6('0xe2')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xe3'));db[_0xe1f6('0xe4')]=db['sequelize']['import'](_0xe1f6('0xe5'));db[_0xe1f6('0xe6')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/squareMessage/squareMessage.model');db[_0xe1f6('0xe7')]=db[_0xe1f6('0x0')]['import'](_0xe1f6('0xe8'));db[_0xe1f6('0xe9')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xea'));db['Campaign']=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0xeb'));db[_0xe1f6('0xec')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xed'));db[_0xe1f6('0xee')]=db['sequelize'][_0xe1f6('0x12')]('../api/attachment/attachment.model');db[_0xe1f6('0xef')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xf0'));db[_0xe1f6('0xf1')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xf2'));db['ChatTransferReport']=db[_0xe1f6('0x0')]['import'](_0xe1f6('0xf3'));db['FaxTransferReport']=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xf4'));db[_0xe1f6('0xf5')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xf6'));db[_0xe1f6('0xf7')]=db['sequelize']['import'](_0xe1f6('0xf8'));db[_0xe1f6('0xf9')]=db[_0xe1f6('0x0')]['import'](_0xe1f6('0xfa'));db['VoicePrefix']=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0xfb'));db['UserProfile']=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/userProfile/userProfile.model');db[_0xe1f6('0xfc')]=db[_0xe1f6('0x0')]['import'](_0xe1f6('0xfd'));db[_0xe1f6('0xfe')]=db['sequelize'][_0xe1f6('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0xe1f6('0xff')]=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0x100'));db[_0xe1f6('0x101')]=db['sequelize'][_0xe1f6('0x12')]('../api/whatsappAccount/whatsappAccount.model');db[_0xe1f6('0x102')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/whatsappApplication/whatsappApplication.model');db[_0xe1f6('0x103')]=db[_0xe1f6('0x0')]['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0xe1f6('0x104')]=db['sequelize'][_0xe1f6('0x12')](_0xe1f6('0x105'));db[_0xe1f6('0x106')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x107'));db[_0xe1f6('0x108')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x109'));db[_0xe1f6('0x10a')]=db[_0xe1f6('0x0')]['import']('../api/whatsappQueue/whatsappQueue.model');db[_0xe1f6('0x10b')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db['sequelize'][_0xe1f6('0x12')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xe1f6('0x10c')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')](_0xe1f6('0x10d'));db[_0xe1f6('0x10e')]=db['sequelize']['import'](_0xe1f6('0x10f'));db[_0xe1f6('0x110')]=db[_0xe1f6('0x0')][_0xe1f6('0x12')]('../api/user-setting/user-setting.model');db[_0xe1f6('0x111')]=db[_0xe1f6('0x0')]['import'](_0xe1f6('0x112'));db[_0xe1f6('0x11')][_0xe1f6('0x113')](db['VoiceMail'],{'as':_0xe1f6('0x1f'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x115')});db[_0xe1f6('0x11')][_0xe1f6('0x113')](db[_0xe1f6('0x110')],{'as':_0xe1f6('0x116'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x115')});db[_0xe1f6('0x11')][_0xe1f6('0x117')](db[_0xe1f6('0x118')],{'as':_0xe1f6('0x119'),'foreignKey':'UserId'});db[_0xe1f6('0x11')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0xe1f6('0x11a'),'foreignKey':_0xe1f6('0x115')});db[_0xe1f6('0x11')]['hasMany'](db['VoiceExtension'],{'as':_0xe1f6('0x11b'),'onDelete':_0xe1f6('0x114'),'hooks':!![]});db[_0xe1f6('0x11')][_0xe1f6('0x117')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xe1f6('0x115')});db['User'][_0xe1f6('0x117')](db[_0xe1f6('0x11c')],{'as':_0xe1f6('0x11d'),'foreignKey':_0xe1f6('0x115')});db[_0xe1f6('0x11')]['hasMany'](db['ReportAgentPreview'],{'as':_0xe1f6('0x7f'),'foreignKey':'UserId'});db['User']['hasMany'](db['OpenchannelInteraction'],{'as':_0xe1f6('0x11e'),'foreignKey':_0xe1f6('0x115')});db[_0xe1f6('0x11')][_0xe1f6('0x117')](db[_0xe1f6('0x6d')],{'as':_0xe1f6('0x11f'),'foreignKey':_0xe1f6('0x115')});db[_0xe1f6('0x11')][_0xe1f6('0x117')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xe1f6('0x115')});db[_0xe1f6('0x11')][_0xe1f6('0x117')](db[_0xe1f6('0x51')],{'as':_0xe1f6('0x120'),'foreignKey':_0xe1f6('0x115')});db[_0xe1f6('0x11')][_0xe1f6('0x117')](db[_0xe1f6('0x46')],{'as':'MailInteractions','foreignKey':_0xe1f6('0x115')});db[_0xe1f6('0x11')][_0xe1f6('0x117')](db[_0xe1f6('0x103')],{'as':_0xe1f6('0x121'),'foreignKey':_0xe1f6('0x115')});db[_0xe1f6('0x11')][_0xe1f6('0x117')](db['UserNotification'],{'as':_0xe1f6('0x122'),'foreignKey':'SenderId'});db[_0xe1f6('0x11')][_0xe1f6('0x117')](db[_0xe1f6('0x79')],{'as':_0xe1f6('0x123'),'foreignKey':_0xe1f6('0x115'),'onDelete':_0xe1f6('0x124')});db[_0xe1f6('0x11')]['belongsTo'](db[_0xe1f6('0x125')],{'as':_0xe1f6('0x125'),'foreignKey':_0xe1f6('0x126')});db[_0xe1f6('0x11')][_0xe1f6('0x127')](db[_0xe1f6('0x73')],{'as':'Groups','through':_0xe1f6('0x128')});db['User']['belongsToMany'](db[_0xe1f6('0x77')],{'as':_0xe1f6('0x129'),'through':_0xe1f6('0x12a')});db['User'][_0xe1f6('0x127')](db[_0xe1f6('0xf9')],{'as':'Lists','through':_0xe1f6('0x12b')});db[_0xe1f6('0x11')][_0xe1f6('0x127')](db[_0xe1f6('0xe7')],{'through':_0xe1f6('0x12c')});db['User'][_0xe1f6('0x127')](db[_0xe1f6('0x46')],{'as':_0xe1f6('0x12d'),'through':'user_has_mail_interactions'});db[_0xe1f6('0x11')][_0xe1f6('0x127')](db['ChatInteraction'],{'as':_0xe1f6('0x11f'),'through':'user_has_chat_interactions'});db[_0xe1f6('0x11')]['belongsToMany'](db['FaxInteraction'],{'as':_0xe1f6('0x120'),'through':_0xe1f6('0x12e')});db[_0xe1f6('0x11')][_0xe1f6('0x127')](db['SmsInteraction'],{'as':'SmsInteractions','through':_0xe1f6('0x12f')});db[_0xe1f6('0x11')]['belongsToMany'](db[_0xe1f6('0x61')],{'as':_0xe1f6('0x11e'),'through':_0xe1f6('0x130')});db[_0xe1f6('0x11')][_0xe1f6('0x127')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':_0xe1f6('0x131')});db[_0xe1f6('0x11')][_0xe1f6('0x127')](db[_0xe1f6('0x1a')],{'as':_0xe1f6('0x132'),'through':_0xe1f6('0x2e'),'required':![]});db[_0xe1f6('0x11')][_0xe1f6('0x127')](db[_0xe1f6('0x133')],{'as':_0xe1f6('0x134'),'through':_0xe1f6('0x10e'),'required':![]});db[_0xe1f6('0x11')][_0xe1f6('0x127')](db[_0xe1f6('0x42')],{'as':'MailQueues','through':'UserMailQueue','required':![]});db['User'][_0xe1f6('0x127')](db[_0xe1f6('0x72')],{'as':'ChatQueues','through':_0xe1f6('0x30'),'required':![],'hooks':!![]});db[_0xe1f6('0x11')][_0xe1f6('0x127')](db[_0xe1f6('0x55')],{'as':_0xe1f6('0x135'),'through':_0xe1f6('0x34'),'required':![]});db[_0xe1f6('0x11')][_0xe1f6('0x127')](db[_0xe1f6('0x5d')],{'as':'SmsQueues','through':_0xe1f6('0x36'),'required':![]});db[_0xe1f6('0x11')][_0xe1f6('0x127')](db[_0xe1f6('0x65')],{'as':_0xe1f6('0x136'),'through':'UserOpenchannelQueue','required':![]});db[_0xe1f6('0x11')][_0xe1f6('0x127')](db[_0xe1f6('0x10a')],{'as':_0xe1f6('0x137'),'through':_0xe1f6('0x3a'),'required':![]});db[_0xe1f6('0x11')][_0xe1f6('0x127')](db[_0xe1f6('0xf9')],{'through':_0xe1f6('0x12b')});db[_0xe1f6('0x11')][_0xe1f6('0x127')](db['ChatWebsite'],{'as':'ChatWebsites','through':_0xe1f6('0x138')});db[_0xe1f6('0x11')][_0xe1f6('0x127')](db[_0xe1f6('0x4f')],{'as':_0xe1f6('0x139'),'through':_0xe1f6('0x13a')});db[_0xe1f6('0x11')]['belongsToMany'](db['MailAccount'],{'as':_0xe1f6('0x13b'),'through':_0xe1f6('0x13c')});db['User'][_0xe1f6('0x127')](db[_0xe1f6('0x5f')],{'as':_0xe1f6('0x13d'),'through':_0xe1f6('0x13e')});db[_0xe1f6('0x11')]['belongsToMany'](db['SmsAccount'],{'as':_0xe1f6('0x13f'),'through':_0xe1f6('0x140')});db[_0xe1f6('0x11')][_0xe1f6('0x127')](db['WhatsappAccount'],{'as':_0xe1f6('0x141'),'through':_0xe1f6('0x142')});db['VoiceChanSpy'][_0xe1f6('0x117')](db[_0xe1f6('0x16')],{'as':_0xe1f6('0x143'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x144')});db[_0xe1f6('0x15')]['hasMany'](db[_0xe1f6('0x16')],{'onDelete':'cascade'});db[_0xe1f6('0x16')][_0xe1f6('0x117')](db[_0xe1f6('0x16')],{'as':_0xe1f6('0x145'),'onDelete':_0xe1f6('0x114')});db['VoiceMusicOnHold'][_0xe1f6('0x127')](db['Sound'],{'as':_0xe1f6('0x146'),'through':_0xe1f6('0x147')});db[_0xe1f6('0x1a')][_0xe1f6('0x117')](db[_0xe1f6('0x2c')],{'as':_0xe1f6('0x148'),'foreignKey':'VoiceQueueId'});db[_0xe1f6('0x1a')][_0xe1f6('0x117')](db[_0xe1f6('0x79')],{'as':_0xe1f6('0x123'),'foreignKey':'VoiceQueueId'});db[_0xe1f6('0x1a')][_0xe1f6('0x117')](db[_0xe1f6('0x7d')],{'as':_0xe1f6('0x149'),'foreignKey':_0xe1f6('0x14a')});db[_0xe1f6('0x1a')][_0xe1f6('0x117')](db[_0xe1f6('0x11c')],{'as':_0xe1f6('0x14b'),'foreignKey':_0xe1f6('0x14a')});db[_0xe1f6('0x1a')]['hasMany'](db[_0xe1f6('0x7f')],{'as':_0xe1f6('0x7f'),'foreignKey':_0xe1f6('0x14a')});db[_0xe1f6('0x1a')][_0xe1f6('0x117')](db[_0xe1f6('0x7b')],{'as':_0xe1f6('0x14c'),'foreignKey':_0xe1f6('0x14a')});db[_0xe1f6('0x1a')][_0xe1f6('0x117')](db[_0xe1f6('0xd7')],{'as':_0xe1f6('0x14d'),'foreignKey':_0xe1f6('0x14a')});db[_0xe1f6('0x1a')][_0xe1f6('0x14e')](db[_0xe1f6('0x28')],{'as':_0xe1f6('0x28'),'foreignKey':_0xe1f6('0x14f')});db[_0xe1f6('0x1a')][_0xe1f6('0x14e')](db[_0xe1f6('0x28')],{'as':_0xe1f6('0x150'),'foreignKey':'TrunkBackupId'});db[_0xe1f6('0x1a')][_0xe1f6('0x14e')](db[_0xe1f6('0x88')],{'as':_0xe1f6('0x88'),'foreignKey':'IntervalId'});db[_0xe1f6('0x1a')][_0xe1f6('0x14e')](db[_0xe1f6('0x89')],{'as':_0xe1f6('0x151'),'foreignKey':_0xe1f6('0x152')});db[_0xe1f6('0x1a')][_0xe1f6('0x127')](db[_0xe1f6('0xf9')],{'as':_0xe1f6('0x153'),'through':'voice_queues_has_cm_lists'});db[_0xe1f6('0x1a')][_0xe1f6('0x127')](db['User'],{'as':_0xe1f6('0x154'),'through':_0xe1f6('0x2e')});db[_0xe1f6('0x1a')][_0xe1f6('0x127')](db[_0xe1f6('0xe7')],{'as':_0xe1f6('0x155'),'through':_0xe1f6('0x156')});db['VoiceQueue']['belongsToMany'](db[_0xe1f6('0xf9')],{'as':_0xe1f6('0x157'),'through':_0xe1f6('0x158')});db[_0xe1f6('0x118')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'as':'User','foreignKey':_0xe1f6('0x115')});db[_0xe1f6('0x1d')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x11'),'foreignKey':_0xe1f6('0x115')});db[_0xe1f6('0x1f')][_0xe1f6('0x117')](db[_0xe1f6('0x159')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xe1f6('0x15a'),'sourceKey':_0xe1f6('0x15b')});db[_0xe1f6('0x159')]['belongsTo'](db[_0xe1f6('0x1f')],{'foreignKey':_0xe1f6('0x15a'),'targetKey':_0xe1f6('0x15b')});db['VoiceCallReport'][_0xe1f6('0x117')](db[_0xe1f6('0x24')],{'as':_0xe1f6('0x15c'),'foreignKey':'uniqueid','constraints':![]});db[_0xe1f6('0x20')]['hasMany'](db[_0xe1f6('0x23')],{'as':_0xe1f6('0x15d'),'foreignKey':'uniqueid','constraints':![]});db[_0xe1f6('0x20')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x11'),'foreignKey':_0xe1f6('0x115')});db['VoiceCallReport']['belongsTo'](db[_0xe1f6('0x77')],{'as':_0xe1f6('0x15e'),'foreignKey':'ContactId'});db[_0xe1f6('0x3c')][_0xe1f6('0x14e')](db['MailAccount'],{'as':_0xe1f6('0x40'),'foreignKey':_0xe1f6('0x15f')});db[_0xe1f6('0x3c')]['belongsTo'](db['CloudProvider'],{'as':_0xe1f6('0x10b'),'foreignKey':_0xe1f6('0x160'),'onDelete':_0xe1f6('0x161')});db[_0xe1f6('0x3e')][_0xe1f6('0x14e')](db['MailAccount'],{'as':_0xe1f6('0x40'),'foreignKey':_0xe1f6('0x15f')});db[_0xe1f6('0x3e')][_0xe1f6('0x14e')](db[_0xe1f6('0x10b')],{'as':_0xe1f6('0x10b'),'foreignKey':_0xe1f6('0x160'),'onDelete':_0xe1f6('0x161')});db['MailAccount'][_0xe1f6('0x113')](db[_0xe1f6('0x3c')],{'as':_0xe1f6('0x162'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x40')][_0xe1f6('0x113')](db[_0xe1f6('0x3e')],{'as':_0xe1f6('0x163'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x40')][_0xe1f6('0x117')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xe1f6('0x15f'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x40')][_0xe1f6('0x117')](db[_0xe1f6('0x84')],{'as':'Answers','foreignKey':_0xe1f6('0x15f')});db[_0xe1f6('0x40')][_0xe1f6('0x117')](db[_0xe1f6('0x48')],{'as':'Messages','foreignKey':_0xe1f6('0x15f')});db['MailAccount'][_0xe1f6('0x117')](db['MailInteraction'],{'as':'Interactions'});db[_0xe1f6('0x40')]['hasMany'](db['MailApplication'],{'as':_0xe1f6('0x145'),'foreignKey':'MailAccountId','onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x40')][_0xe1f6('0x14e')](db[_0xe1f6('0xf9')],{'as':_0xe1f6('0x164'),'foreignKey':'ListId'});db[_0xe1f6('0x40')]['belongsTo'](db['Template'],{'as':_0xe1f6('0x94'),'foreignKey':'TemplateId'});db[_0xe1f6('0x40')]['belongsTo'](db[_0xe1f6('0x89')],{'as':_0xe1f6('0x151'),'foreignKey':_0xe1f6('0x152')});db['MailAccount'][_0xe1f6('0x127')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x154'),'through':_0xe1f6('0x13c')});db[_0xe1f6('0x42')][_0xe1f6('0x127')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x154'),'through':_0xe1f6('0x32')});db[_0xe1f6('0x42')][_0xe1f6('0x127')](db['Team'],{'through':_0xe1f6('0x165'),'as':'Teams'});db[_0xe1f6('0x46')][_0xe1f6('0x117')](db[_0xe1f6('0x48')],{'as':'Messages','onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x166')});db['MailInteraction'][_0xe1f6('0x14e')](db[_0xe1f6('0x40')],{'as':_0xe1f6('0x167'),'foreignKey':_0xe1f6('0x15f')});db[_0xe1f6('0x46')][_0xe1f6('0x14e')](db[_0xe1f6('0x77')],{'as':_0xe1f6('0x15e'),'foreignKey':'ContactId'});db['MailInteraction'][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x168'),'foreignKey':_0xe1f6('0x115')});db[_0xe1f6('0x46')][_0xe1f6('0x127')](db[_0xe1f6('0x169')],{'through':_0xe1f6('0x16a'),'as':_0xe1f6('0x16b')});db['MailInteraction'][_0xe1f6('0x127')](db[_0xe1f6('0x169')],{'through':_0xe1f6('0x16a'),'as':'ThroughTags'});db[_0xe1f6('0x46')][_0xe1f6('0x127')](db[_0xe1f6('0x11')],{'as':'Users','through':_0xe1f6('0x16c'),'foreignKey':_0xe1f6('0x166')});db[_0xe1f6('0x48')][_0xe1f6('0x117')](db['Attachment'],{'as':_0xe1f6('0x16d'),'onDelete':_0xe1f6('0x114')});db['MailMessage']['belongsTo'](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x11')});db[_0xe1f6('0x48')][_0xe1f6('0x14e')](db[_0xe1f6('0x77')],{'onDelete':_0xe1f6('0x114'),'as':_0xe1f6('0x15e')});db[_0xe1f6('0x48')][_0xe1f6('0x14e')](db[_0xe1f6('0x46')],{'as':_0xe1f6('0x16e'),'foreignKey':_0xe1f6('0x166')});db[_0xe1f6('0x48')][_0xe1f6('0x14e')](db[_0xe1f6('0x40')],{'as':'Account','foreignKey':_0xe1f6('0x15f')});db[_0xe1f6('0x48')][_0xe1f6('0x14e')](db[_0xe1f6('0x67')],{'as':'ChatWebsite','foreignKey':'ChatWebsiteId'});db[_0xe1f6('0x48')][_0xe1f6('0x14e')](db[_0xe1f6('0x70')],{'as':'ChatOfflineMessage','foreignKey':_0xe1f6('0x16f')});db['MailApplication'][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'onDelete':'restrict'});db[_0xe1f6('0x4a')][_0xe1f6('0x14e')](db[_0xe1f6('0x42')],{'onDelete':'restrict'});db[_0xe1f6('0x4a')]['belongsTo'](db['MailAccount'],{'onDelete':_0xe1f6('0x161')});db[_0xe1f6('0x4a')][_0xe1f6('0x14e')](db[_0xe1f6('0x88')],{'onDelete':_0xe1f6('0x161'),'foreignKey':_0xe1f6('0x170')});db[_0xe1f6('0x4a')]['belongsTo'](db[_0xe1f6('0x169')],{'onDelete':_0xe1f6('0x161'),'foreignKey':_0xe1f6('0x171')});db[_0xe1f6('0x4c')]['belongsTo'](db[_0xe1f6('0x40')],{});db[_0xe1f6('0x4c')][_0xe1f6('0x14e')](db[_0xe1f6('0xf9')],{'as':_0xe1f6('0x164'),'foreignKey':_0xe1f6('0x172')});db[_0xe1f6('0x4c')][_0xe1f6('0x14e')](db[_0xe1f6('0x77')],{'as':_0xe1f6('0x15e'),'foreignKey':'ContactId'});db[_0xe1f6('0x4c')]['belongsTo'](db[_0xe1f6('0x46')],{});db[_0xe1f6('0x4c')][_0xe1f6('0x14e')](db[_0xe1f6('0x48')],{});db[_0xe1f6('0x4c')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{});db[_0xe1f6('0x4c')]['belongsTo'](db[_0xe1f6('0x42')],{});db['Dashboard'][_0xe1f6('0x117')](db[_0xe1f6('0x173')],{'as':_0xe1f6('0x174'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x4f')][_0xe1f6('0x117')](db[_0xe1f6('0x175')],{'as':_0xe1f6('0x176'),'foreignKey':_0xe1f6('0x177'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x4f')][_0xe1f6('0x117')](db[_0xe1f6('0x84')],{'as':'Answers','foreignKey':_0xe1f6('0x177')});db[_0xe1f6('0x4f')][_0xe1f6('0x117')](db[_0xe1f6('0x51')],{'as':_0xe1f6('0x178')});db[_0xe1f6('0x4f')]['hasMany'](db[_0xe1f6('0x179')],{'as':'Applications','foreignKey':_0xe1f6('0x177'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x4f')][_0xe1f6('0x117')](db['VoiceExtension'],{'as':_0xe1f6('0x17a'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x4f')][_0xe1f6('0x117')](db[_0xe1f6('0x53')],{'as':'Messages'});db[_0xe1f6('0x4f')][_0xe1f6('0x14e')](db['Trunk'],{'as':_0xe1f6('0x28')});db[_0xe1f6('0x4f')][_0xe1f6('0x14e')](db[_0xe1f6('0xf9')],{'as':_0xe1f6('0x164'),'foreignKey':_0xe1f6('0x172')});db[_0xe1f6('0x4f')]['belongsTo'](db[_0xe1f6('0x89')],{'as':_0xe1f6('0x151'),'foreignKey':_0xe1f6('0x152')});db[_0xe1f6('0x4f')][_0xe1f6('0x127')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x154'),'through':_0xe1f6('0x13a')});db[_0xe1f6('0x179')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'onDelete':_0xe1f6('0x161')});db[_0xe1f6('0x179')][_0xe1f6('0x14e')](db[_0xe1f6('0x55')],{'onDelete':_0xe1f6('0x161')});db[_0xe1f6('0x179')]['belongsTo'](db[_0xe1f6('0x4f')],{'onDelete':_0xe1f6('0x161')});db['FaxApplication'][_0xe1f6('0x14e')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xe1f6('0x51')][_0xe1f6('0x117')](db[_0xe1f6('0x53')],{'as':_0xe1f6('0x17b'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x17c')});db[_0xe1f6('0x51')][_0xe1f6('0x14e')](db[_0xe1f6('0x4f')],{'as':_0xe1f6('0x167'),'foreignKey':_0xe1f6('0x177')});db[_0xe1f6('0x51')]['belongsTo'](db[_0xe1f6('0x77')],{'as':'Contact','foreignKey':'ContactId'});db[_0xe1f6('0x51')]['belongsTo'](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x168'),'foreignKey':_0xe1f6('0x115')});db[_0xe1f6('0x51')][_0xe1f6('0x127')](db[_0xe1f6('0x169')],{'through':_0xe1f6('0x17d'),'as':'Tags'});db[_0xe1f6('0x51')]['belongsToMany'](db[_0xe1f6('0x169')],{'through':_0xe1f6('0x17d'),'as':_0xe1f6('0x17e')});db[_0xe1f6('0x51')][_0xe1f6('0x127')](db[_0xe1f6('0x11')],{'as':'Users','through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db[_0xe1f6('0x53')][_0xe1f6('0x14e')](db['User'],{'onDelete':'cascade','as':_0xe1f6('0x11')});db[_0xe1f6('0x53')]['belongsTo'](db[_0xe1f6('0x51')],{'as':_0xe1f6('0x16e'),'foreignKey':_0xe1f6('0x17c')});db['FaxMessage'][_0xe1f6('0x14e')](db[_0xe1f6('0x77')],{'onDelete':_0xe1f6('0x114'),'as':_0xe1f6('0x15e')});db[_0xe1f6('0x53')][_0xe1f6('0x14e')](db[_0xe1f6('0xee')],{'as':'Attachment','foreignKey':_0xe1f6('0x17f')});db[_0xe1f6('0x53')][_0xe1f6('0x14e')](db[_0xe1f6('0x4f')],{'as':_0xe1f6('0x167'),'foreignKey':_0xe1f6('0x177')});db[_0xe1f6('0x55')][_0xe1f6('0x127')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x154'),'through':'UserFaxQueue'});db[_0xe1f6('0x55')][_0xe1f6('0x127')](db['Team'],{'through':_0xe1f6('0x180'),'as':_0xe1f6('0x155')});db[_0xe1f6('0x181')]['belongsTo'](db[_0xe1f6('0x4f')],{});db[_0xe1f6('0x181')][_0xe1f6('0x14e')](db[_0xe1f6('0xf9')],{'as':_0xe1f6('0x164'),'foreignKey':'ListId'});db['FaxQueueReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x77')],{'as':_0xe1f6('0x15e'),'foreignKey':_0xe1f6('0x182')});db['FaxQueueReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x51')],{});db[_0xe1f6('0x181')][_0xe1f6('0x14e')](db[_0xe1f6('0x53')],{});db[_0xe1f6('0x181')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{});db[_0xe1f6('0x181')][_0xe1f6('0x14e')](db[_0xe1f6('0x55')],{});db[_0xe1f6('0x183')][_0xe1f6('0x117')](db[_0xe1f6('0x175')],{'as':_0xe1f6('0x176'),'foreignKey':_0xe1f6('0x184'),'onDelete':'cascade'});db[_0xe1f6('0x183')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xe1f6('0x184')});db[_0xe1f6('0x183')][_0xe1f6('0x117')](db[_0xe1f6('0x5b')],{'as':_0xe1f6('0x17b'),'foreignKey':_0xe1f6('0x184')});db['SmsAccount'][_0xe1f6('0x117')](db[_0xe1f6('0x185')],{'as':_0xe1f6('0x178')});db['SmsAccount'][_0xe1f6('0x117')](db[_0xe1f6('0x58')],{'as':_0xe1f6('0x145'),'foreignKey':_0xe1f6('0x184'),'onDelete':_0xe1f6('0x114')});db['SmsAccount'][_0xe1f6('0x14e')](db[_0xe1f6('0xf9')],{'as':_0xe1f6('0x164'),'foreignKey':_0xe1f6('0x172')});db[_0xe1f6('0x183')]['belongsTo'](db[_0xe1f6('0x89')],{'as':_0xe1f6('0x151'),'foreignKey':_0xe1f6('0x152')});db[_0xe1f6('0x183')][_0xe1f6('0x127')](db['User'],{'as':_0xe1f6('0x154'),'through':_0xe1f6('0x140')});db['SmsApplication'][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'onDelete':_0xe1f6('0x161')});db[_0xe1f6('0x58')][_0xe1f6('0x14e')](db['SmsQueue'],{'onDelete':_0xe1f6('0x161')});db['SmsApplication'][_0xe1f6('0x14e')](db[_0xe1f6('0x183')],{'onDelete':'restrict'});db['SmsApplication'][_0xe1f6('0x14e')](db[_0xe1f6('0x88')],{'onDelete':_0xe1f6('0x161'),'foreignKey':_0xe1f6('0x170')});db[_0xe1f6('0x58')]['belongsTo'](db[_0xe1f6('0x169')],{'onDelete':_0xe1f6('0x161'),'foreignKey':_0xe1f6('0x171')});db[_0xe1f6('0x185')]['hasMany'](db['SmsMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0xe1f6('0x186')});db['SmsInteraction'][_0xe1f6('0x14e')](db['SmsAccount'],{'as':_0xe1f6('0x167'),'foreignKey':_0xe1f6('0x184')});db[_0xe1f6('0x185')][_0xe1f6('0x14e')](db[_0xe1f6('0x77')],{'as':_0xe1f6('0x15e'),'foreignKey':_0xe1f6('0x182')});db[_0xe1f6('0x185')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x168'),'foreignKey':'UserId'});db[_0xe1f6('0x185')][_0xe1f6('0x127')](db[_0xe1f6('0x169')],{'through':_0xe1f6('0x187'),'as':_0xe1f6('0x16b')});db[_0xe1f6('0x185')][_0xe1f6('0x127')](db[_0xe1f6('0x169')],{'through':_0xe1f6('0x187'),'as':_0xe1f6('0x17e')});db['SmsInteraction'][_0xe1f6('0x127')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x188'),'through':_0xe1f6('0x12f'),'foreignKey':_0xe1f6('0x186')});db[_0xe1f6('0x5b')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x11')});db[_0xe1f6('0x5b')][_0xe1f6('0x14e')](db[_0xe1f6('0x77')],{'onDelete':_0xe1f6('0x114'),'as':_0xe1f6('0x15e')});db[_0xe1f6('0x5b')]['belongsTo'](db[_0xe1f6('0x185')],{'onDelete':'cascade','as':_0xe1f6('0x16e'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xe1f6('0x14e')](db[_0xe1f6('0x183')],{'as':_0xe1f6('0x167'),'foreignKey':_0xe1f6('0x184')});db['SmsQueue']['belongsToMany'](db['User'],{'as':'Agents','through':_0xe1f6('0x36'),'foreignKey':'SmsQueueId'});db[_0xe1f6('0x5d')][_0xe1f6('0x127')](db[_0xe1f6('0xe7')],{'through':_0xe1f6('0x189'),'as':_0xe1f6('0x155')});db[_0xe1f6('0x5f')][_0xe1f6('0x117')](db[_0xe1f6('0x175')],{'as':_0xe1f6('0x176'),'foreignKey':'OpenchannelAccountId','onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x5f')][_0xe1f6('0x117')](db['CannedAnswer'],{'as':_0xe1f6('0x18a'),'foreignKey':_0xe1f6('0x18b')});db['OpenchannelAccount'][_0xe1f6('0x117')](db[_0xe1f6('0x61')],{'as':_0xe1f6('0x178'),'foreignKey':_0xe1f6('0x18b')});db[_0xe1f6('0x5f')][_0xe1f6('0x117')](db['OpenchannelMessage'],{'as':_0xe1f6('0x17b'),'foreignKey':_0xe1f6('0x18b')});db[_0xe1f6('0x5f')][_0xe1f6('0x117')](db[_0xe1f6('0x18c')],{'as':'Applications','foreignKey':_0xe1f6('0x18b'),'onDelete':'cascade'});db[_0xe1f6('0x5f')]['belongsTo'](db[_0xe1f6('0xf9')],{'as':_0xe1f6('0x164'),'foreignKey':'ListId'});db['OpenchannelAccount'][_0xe1f6('0x14e')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xe1f6('0x152')});db['OpenchannelAccount'][_0xe1f6('0x127')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x154'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'onDelete':_0xe1f6('0x161')});db[_0xe1f6('0x18c')][_0xe1f6('0x14e')](db[_0xe1f6('0x65')],{'onDelete':_0xe1f6('0x161'),'foreignKey':_0xe1f6('0x18d')});db[_0xe1f6('0x18c')]['belongsTo'](db[_0xe1f6('0x5f')],{'onDelete':_0xe1f6('0x161'),'foreignKey':'OpenchannelAccountId'});db[_0xe1f6('0x18c')][_0xe1f6('0x14e')](db[_0xe1f6('0x88')],{'onDelete':_0xe1f6('0x161'),'foreignKey':_0xe1f6('0x170')});db[_0xe1f6('0x18c')][_0xe1f6('0x14e')](db[_0xe1f6('0x169')],{'onDelete':_0xe1f6('0x161'),'foreignKey':'TagId'});db[_0xe1f6('0x61')]['hasMany'](db[_0xe1f6('0x63')],{'as':_0xe1f6('0x17b'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x18e')});db[_0xe1f6('0x61')][_0xe1f6('0x14e')](db[_0xe1f6('0x5f')],{'as':_0xe1f6('0x167'),'foreignKey':'OpenchannelAccountId'});db[_0xe1f6('0x61')]['belongsTo'](db[_0xe1f6('0x77')],{'as':'Contact','foreignKey':_0xe1f6('0x182')});db[_0xe1f6('0x61')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x168'),'foreignKey':_0xe1f6('0x115')});db[_0xe1f6('0x61')][_0xe1f6('0x127')](db[_0xe1f6('0x169')],{'through':_0xe1f6('0x18f'),'as':'Tags'});db[_0xe1f6('0x61')][_0xe1f6('0x127')](db[_0xe1f6('0x169')],{'through':'openchannel_interaction_has_tags','as':_0xe1f6('0x17e')});db['OpenchannelInteraction'][_0xe1f6('0x127')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x188'),'through':_0xe1f6('0x130'),'foreignKey':_0xe1f6('0x18e')});db[_0xe1f6('0x63')][_0xe1f6('0x14e')](db['User'],{'onDelete':_0xe1f6('0x114'),'as':'User'});db[_0xe1f6('0x63')][_0xe1f6('0x14e')](db[_0xe1f6('0x77')],{'onDelete':_0xe1f6('0x114'),'as':'Contact'});db[_0xe1f6('0x63')][_0xe1f6('0x14e')](db['OpenchannelInteraction'],{'onDelete':_0xe1f6('0x114'),'as':_0xe1f6('0x16e'),'foreignKey':_0xe1f6('0x18e')});db[_0xe1f6('0x63')]['belongsTo'](db[_0xe1f6('0xee')],{'as':_0xe1f6('0xee'),'foreignKey':_0xe1f6('0x17f')});db['OpenchannelMessage'][_0xe1f6('0x14e')](db[_0xe1f6('0x5f')],{'as':_0xe1f6('0x167'),'foreignKey':_0xe1f6('0x18b')});db[_0xe1f6('0x65')][_0xe1f6('0x127')](db['User'],{'as':_0xe1f6('0x154'),'through':_0xe1f6('0x38'),'foreignKey':_0xe1f6('0x18d')});db[_0xe1f6('0x65')][_0xe1f6('0x127')](db[_0xe1f6('0xe7')],{'through':_0xe1f6('0x190'),'as':_0xe1f6('0x155')});db[_0xe1f6('0x67')][_0xe1f6('0x117')](db[_0xe1f6('0x175')],{'as':'Dispositions','foreignKey':_0xe1f6('0x191'),'onDelete':'cascade'});db[_0xe1f6('0x67')][_0xe1f6('0x117')](db['CannedAnswer'],{'as':_0xe1f6('0x18a'),'foreignKey':_0xe1f6('0x191')});db[_0xe1f6('0x67')][_0xe1f6('0x117')](db[_0xe1f6('0x75')],{'as':_0xe1f6('0x192')});db['ChatWebsite'][_0xe1f6('0x117')](db['ChatInteraction'],{'as':_0xe1f6('0x178')});db[_0xe1f6('0x67')][_0xe1f6('0x117')](db[_0xe1f6('0x6b')],{'as':'Applications','foreignKey':_0xe1f6('0x191'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x67')]['hasMany'](db[_0xe1f6('0x6f')],{'as':_0xe1f6('0x17b')});db[_0xe1f6('0x67')][_0xe1f6('0x14e')](db[_0xe1f6('0xf9')],{'as':'List','foreignKey':_0xe1f6('0x172')});db[_0xe1f6('0x67')][_0xe1f6('0x14e')](db['Interval'],{'as':_0xe1f6('0x88'),'foreignKey':'IntervalId'});db[_0xe1f6('0x67')]['belongsTo'](db[_0xe1f6('0x40')],{'as':'MailAccount','foreignKey':_0xe1f6('0x15f')});db[_0xe1f6('0x67')][_0xe1f6('0x14e')](db[_0xe1f6('0x89')],{'as':_0xe1f6('0x151'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xe1f6('0x67')][_0xe1f6('0x127')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x154'),'through':_0xe1f6('0x138')});db['OpenchannelQueueReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x5f')],{});db[_0xe1f6('0x69')]['belongsTo'](db[_0xe1f6('0xf9')],{'as':_0xe1f6('0x164'),'foreignKey':_0xe1f6('0x172')});db['OpenchannelQueueReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x77')],{'as':'Contact','foreignKey':'ContactId'});db[_0xe1f6('0x69')][_0xe1f6('0x14e')](db['OpenchannelInteraction'],{});db[_0xe1f6('0x69')]['belongsTo'](db[_0xe1f6('0x63')],{});db[_0xe1f6('0x69')]['belongsTo'](db[_0xe1f6('0x11')],{});db[_0xe1f6('0x69')][_0xe1f6('0x14e')](db['OpenchannelQueue'],{});db[_0xe1f6('0x6b')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'as':'Agent','foreignKey':'UserId','onDelete':'restrict'});db[_0xe1f6('0x6b')][_0xe1f6('0x14e')](db['ChatQueue'],{'as':'Queue','foreignKey':_0xe1f6('0x193'),'onDelete':_0xe1f6('0x161')});db['ChatApplication'][_0xe1f6('0x14e')](db['ChatWebsite'],{'as':_0xe1f6('0x194'),'foreignKey':_0xe1f6('0x191'),'onDelete':_0xe1f6('0x161')});db[_0xe1f6('0x6b')][_0xe1f6('0x14e')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xe1f6('0x171')});db[_0xe1f6('0x6d')]['hasMany'](db['ChatMessage'],{'as':'Messages','onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x195')});db['ChatInteraction'][_0xe1f6('0x14e')](db[_0xe1f6('0x67')],{'as':_0xe1f6('0x167'),'foreignKey':_0xe1f6('0x191')});db[_0xe1f6('0x6d')][_0xe1f6('0x14e')](db[_0xe1f6('0x77')],{'as':_0xe1f6('0x15e'),'foreignKey':_0xe1f6('0x182')});db['ChatInteraction'][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x168'),'foreignKey':_0xe1f6('0x115')});db[_0xe1f6('0x6d')][_0xe1f6('0x127')](db['Tag'],{'through':_0xe1f6('0x196'),'as':'Tags'});db[_0xe1f6('0x6d')]['belongsToMany'](db['Tag'],{'through':_0xe1f6('0x196'),'as':_0xe1f6('0x17e')});db[_0xe1f6('0x6d')][_0xe1f6('0x127')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x188'),'through':_0xe1f6('0x197'),'foreignKey':_0xe1f6('0x195')});db[_0xe1f6('0x6f')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'onDelete':_0xe1f6('0x114'),'as':'User'});db[_0xe1f6('0x6f')][_0xe1f6('0x14e')](db['CmContact'],{'onDelete':_0xe1f6('0x114'),'as':_0xe1f6('0x15e'),'foreignKey':_0xe1f6('0x182')});db[_0xe1f6('0x6f')][_0xe1f6('0x14e')](db[_0xe1f6('0x6d')],{'onDelete':'cascade','as':_0xe1f6('0x16e'),'foreignKey':_0xe1f6('0x195')});db['ChatMessage']['belongsTo'](db[_0xe1f6('0xee')],{'as':_0xe1f6('0xee'),'foreignKey':_0xe1f6('0x17f')});db[_0xe1f6('0x6f')][_0xe1f6('0x14e')](db[_0xe1f6('0x67')],{'as':_0xe1f6('0x167'),'foreignKey':_0xe1f6('0x191')});db['ChatOfflineMessage']['hasMany'](db[_0xe1f6('0xee')],{'as':_0xe1f6('0x16d'),'foreignKey':_0xe1f6('0x16f'),'onDelete':_0xe1f6('0x114'),'hooks':!![]});db[_0xe1f6('0x70')][_0xe1f6('0x14e')](db['CmContact'],{'onDelete':_0xe1f6('0x114'),'as':_0xe1f6('0x15e'),'foreignKey':_0xe1f6('0x182')});db[_0xe1f6('0x70')][_0xe1f6('0x14e')](db[_0xe1f6('0x67')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xe1f6('0x72')]['belongsToMany'](db[_0xe1f6('0x11')],{'as':'Agents','through':_0xe1f6('0x30'),'hooks':!![]});db[_0xe1f6('0x72')][_0xe1f6('0x127')](db[_0xe1f6('0xe7')],{'through':_0xe1f6('0x198'),'as':_0xe1f6('0x155')});db[_0xe1f6('0x73')][_0xe1f6('0x117')](db[_0xe1f6('0xd1')],{'as':_0xe1f6('0x17b'),'foreignKey':_0xe1f6('0x199'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x73')][_0xe1f6('0x127')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x148'),'through':_0xe1f6('0x128')});db['ChatProactiveAction'][_0xe1f6('0x14e')](db[_0xe1f6('0x67')],{'as':_0xe1f6('0x194'),'foreignKey':_0xe1f6('0x191')});db[_0xe1f6('0x76')][_0xe1f6('0x117')](db['CmContact'],{'as':'Contacts','foreignKey':_0xe1f6('0x19a')});db[_0xe1f6('0x77')][_0xe1f6('0x117')](db[_0xe1f6('0x19b')],{'as':_0xe1f6('0x19c'),'foreignKey':_0xe1f6('0x19d')});db['CmContact'][_0xe1f6('0x117')](db[_0xe1f6('0x79')],{'as':_0xe1f6('0x123'),'foreignKey':_0xe1f6('0x182')});db['CmContact']['hasMany'](db[_0xe1f6('0x7d')],{'as':_0xe1f6('0x149'),'foreignKey':_0xe1f6('0x182')});db[_0xe1f6('0x77')][_0xe1f6('0x117')](db[_0xe1f6('0x11c')],{'as':'HopperHistories','foreignKey':_0xe1f6('0x182')});db[_0xe1f6('0x77')]['hasMany'](db[_0xe1f6('0x7f')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db[_0xe1f6('0x77')][_0xe1f6('0x117')](db[_0xe1f6('0xd7')],{'as':_0xe1f6('0x14d'),'foreignKey':'ContactId'});db['CmContact'][_0xe1f6('0x117')](db[_0xe1f6('0x61')],{'as':'OpenchannelInteractions','foreignKey':_0xe1f6('0x182'),'onDelete':_0xe1f6('0x161')});db['CmContact'][_0xe1f6('0x117')](db['ChatInteraction'],{'as':_0xe1f6('0x11f'),'foreignKey':_0xe1f6('0x182'),'onDelete':'restrict'});db['CmContact'][_0xe1f6('0x117')](db[_0xe1f6('0x185')],{'as':_0xe1f6('0x19e'),'foreignKey':_0xe1f6('0x182'),'onDelete':_0xe1f6('0x161')});db[_0xe1f6('0x77')]['hasMany'](db[_0xe1f6('0x51')],{'as':'FaxInteractions','foreignKey':_0xe1f6('0x182'),'onDelete':_0xe1f6('0x161')});db[_0xe1f6('0x77')][_0xe1f6('0x117')](db['MailInteraction'],{'as':_0xe1f6('0x12d'),'foreignKey':_0xe1f6('0x182'),'onDelete':_0xe1f6('0x161')});db[_0xe1f6('0x77')]['belongsTo'](db[_0xe1f6('0x76')],{'as':_0xe1f6('0x19f'),'foreignKey':'CompanyId'});db[_0xe1f6('0x77')][_0xe1f6('0x14e')](db[_0xe1f6('0xf9')],{'as':'List','foreignKey':_0xe1f6('0x172'),'onDelete':'cascade'});db[_0xe1f6('0x77')][_0xe1f6('0x127')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x188'),'through':_0xe1f6('0x12a')});db[_0xe1f6('0x77')][_0xe1f6('0x127')](db[_0xe1f6('0x169')],{'as':_0xe1f6('0x16b'),'through':_0xe1f6('0x1a0')});db[_0xe1f6('0x77')][_0xe1f6('0x127')](db[_0xe1f6('0x169')],{'through':'cm_contact_has_tags','as':_0xe1f6('0x17e')});db['CmHopper'][_0xe1f6('0x117')](db[_0xe1f6('0x92')],{'as':'AdditionalPhones','foreignKey':_0xe1f6('0x1a1')});db[_0xe1f6('0x79')]['belongsTo'](db[_0xe1f6('0x77')],{'as':_0xe1f6('0x15e'),'foreignKey':_0xe1f6('0x182'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x79')][_0xe1f6('0x14e')](db[_0xe1f6('0xf9')],{'as':'List','foreignKey':_0xe1f6('0x172'),'onDelete':_0xe1f6('0x114')});db['CmHopper'][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x1a2'),'foreignKey':'UserId'});db[_0xe1f6('0x79')][_0xe1f6('0x14e')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0xe1f6('0x14a'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x79')][_0xe1f6('0x14e')](db[_0xe1f6('0x1a3')],{'as':'Campaign','foreignKey':_0xe1f6('0x1a4'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x79')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'as':'Owner','foreignKey':_0xe1f6('0x1a5')});db['CmHopperBlack'][_0xe1f6('0x14e')](db[_0xe1f6('0x77')],{'as':_0xe1f6('0x15e'),'foreignKey':_0xe1f6('0x182'),'onDelete':_0xe1f6('0x114')});db['CmHopperBlack']['belongsTo'](db[_0xe1f6('0xf9')],{'as':_0xe1f6('0x164'),'foreignKey':_0xe1f6('0x172'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x7b')][_0xe1f6('0x14e')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0xe1f6('0x14a'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x7b')][_0xe1f6('0x14e')](db[_0xe1f6('0x1a3')],{'as':_0xe1f6('0x1a3'),'foreignKey':_0xe1f6('0x1a4'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x83')][_0xe1f6('0x117')](db[_0xe1f6('0x86')],{'as':{'plural':_0xe1f6('0x1a6'),'singular':'OneAll'},'foreignKey':_0xe1f6('0x1a7'),'onDelete':_0xe1f6('0x114'),'hooks':!![]});db[_0xe1f6('0x83')]['hasMany'](db['Condition'],{'as':{'plural':'Any','singular':_0xe1f6('0x1a8')},'foreignKey':_0xe1f6('0x1a9'),'onDelete':_0xe1f6('0x114'),'hooks':!![]});db['Automation'][_0xe1f6('0x117')](db[_0xe1f6('0x81')],{'as':_0xe1f6('0x1aa'),'foreignKey':'AutomationId','onDelete':_0xe1f6('0x114'),'hooks':!![]});db['Disposition'][_0xe1f6('0x117')](db[_0xe1f6('0x175')],{'as':'Dispositions','foreignKey':_0xe1f6('0x1ab'),'onDelete':_0xe1f6('0x114')});db['Interval'][_0xe1f6('0x117')](db[_0xe1f6('0x88')],{'as':_0xe1f6('0x1ac'),'foreignKey':_0xe1f6('0x170'),'onDelete':_0xe1f6('0x114'),'hooks':!![],'required':![]});db[_0xe1f6('0x88')][_0xe1f6('0x117')](db[_0xe1f6('0x16')],{'as':'Extensions','foreignKey':_0xe1f6('0x170'),'onDelete':_0xe1f6('0x161')});db[_0xe1f6('0x88')][_0xe1f6('0x117')](db['MailApplication'],{'as':'MailApplications','foreignKey':_0xe1f6('0x170')});db[_0xe1f6('0x88')]['hasMany'](db['ChatApplication'],{'as':_0xe1f6('0x1ad'),'foreignKey':_0xe1f6('0x170')});db[_0xe1f6('0x88')][_0xe1f6('0x117')](db[_0xe1f6('0x179')],{'as':_0xe1f6('0x1ae'),'foreignKey':'IntervalId'});db[_0xe1f6('0x88')][_0xe1f6('0x117')](db['SmsApplication'],{'as':_0xe1f6('0x1af'),'foreignKey':_0xe1f6('0x170')});db[_0xe1f6('0x1b0')]['belongsTo'](db['MailAccount'],{});db[_0xe1f6('0x1b0')][_0xe1f6('0x14e')](db[_0xe1f6('0x9b')],{'foreignKey':_0xe1f6('0x1b1')});db[_0xe1f6('0x1b0')][_0xe1f6('0x14e')](db[_0xe1f6('0x1b2')],{'foreignKey':_0xe1f6('0x1b3')});db[_0xe1f6('0x8f')][_0xe1f6('0x127')](db[_0xe1f6('0x18')],{'as':_0xe1f6('0x1b4'),'through':'moh_has_sounds','onDelete':_0xe1f6('0x161')});db[_0xe1f6('0x169')][_0xe1f6('0x127')](db[_0xe1f6('0x77')],{'through':'cm_contact_has_tags'});db[_0xe1f6('0x169')][_0xe1f6('0x127')](db[_0xe1f6('0x6d')],{'through':_0xe1f6('0x196')});db['Tag'][_0xe1f6('0x127')](db['MailInteraction'],{'through':_0xe1f6('0x16a')});db[_0xe1f6('0x169')][_0xe1f6('0x127')](db[_0xe1f6('0x185')],{'through':_0xe1f6('0x187')});db[_0xe1f6('0x169')]['belongsToMany'](db[_0xe1f6('0x51')],{'through':_0xe1f6('0x17d')});db[_0xe1f6('0x169')]['belongsToMany'](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db['Tag'][_0xe1f6('0x127')](db[_0xe1f6('0x103')],{'through':_0xe1f6('0x1b5')});db['CmContactHasItem'][_0xe1f6('0x14e')](db[_0xe1f6('0x91')],{'as':'ItemType','foreignKey':_0xe1f6('0x1b6')});db[_0xe1f6('0x92')][_0xe1f6('0x14e')](db['CmHopper'],{'as':'Hopper','foreignKey':_0xe1f6('0x1a1')});db[_0xe1f6('0x19b')][_0xe1f6('0x14e')](db[_0xe1f6('0x77')],{'as':_0xe1f6('0x15e'),'foreignKey':_0xe1f6('0x19d')});db[_0xe1f6('0x96')][_0xe1f6('0x117')](db[_0xe1f6('0x86')],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':_0xe1f6('0x1b7'),'onDelete':_0xe1f6('0x114'),'hooks':!![]});db[_0xe1f6('0x96')]['hasMany'](db[_0xe1f6('0x86')],{'as':{'plural':_0xe1f6('0x1b8'),'singular':'AnyCondition'},'foreignKey':_0xe1f6('0x1b9'),'onDelete':_0xe1f6('0x114'),'hooks':!![]});db[_0xe1f6('0x96')][_0xe1f6('0x117')](db[_0xe1f6('0x81')],{'as':_0xe1f6('0x1aa'),'foreignKey':_0xe1f6('0x1ba'),'onDelete':_0xe1f6('0x114'),'hooks':!![]});db[_0xe1f6('0x1b2')][_0xe1f6('0x117')](db[_0xe1f6('0x1bb')],{'as':_0xe1f6('0x1bc'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1b3'),'hooks':!![]});db['AnalyticDefaultReport'][_0xe1f6('0x117')](db[_0xe1f6('0x1bb')],{'as':_0xe1f6('0x1bc'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1b1')});db[_0xe1f6('0x9e')][_0xe1f6('0x117')](db[_0xe1f6('0x1bb')],{'as':_0xe1f6('0x1bc'),'onDelete':_0xe1f6('0x114'),'foreignKey':'MetricId'});db[_0xe1f6('0x1bb')][_0xe1f6('0x14e')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0xe1f6('0x117')](db[_0xe1f6('0x1bd')],{'as':'Configurations','onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1be')});db[_0xe1f6('0x1bd')][_0xe1f6('0x117')](db[_0xe1f6('0xa2')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xe1f6('0x1bf')});db['SalesforceConfiguration'][_0xe1f6('0x117')](db[_0xe1f6('0xa2')],{'as':_0xe1f6('0x1c0'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1c1')});db[_0xe1f6('0x1bd')][_0xe1f6('0x117')](db['SalesforceField'],{'as':_0xe1f6('0x1bc'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1c2')});db[_0xe1f6('0x1bd')][_0xe1f6('0x14e')](db[_0xe1f6('0xa0')],{'as':_0xe1f6('0x167'),'foreignKey':_0xe1f6('0x1be')});db[_0xe1f6('0xa2')]['hasMany'](db[_0xe1f6('0xa2')],{'as':_0xe1f6('0x1c3'),'foreignKey':_0xe1f6('0x1bf')});db[_0xe1f6('0xa2')]['hasMany'](db['SalesforceField'],{'as':'Description','foreignKey':_0xe1f6('0x1c1')});db[_0xe1f6('0xa2')]['hasMany'](db['SalesforceField'],{'as':_0xe1f6('0x1c4'),'foreignKey':_0xe1f6('0x1c2')});db[_0xe1f6('0xa2')][_0xe1f6('0x14e')](db['Variable'],{'as':_0xe1f6('0x98'),'foreignKey':'VariableId'});db['SugarcrmAccount'][_0xe1f6('0x117')](db[_0xe1f6('0x1c5')],{'as':_0xe1f6('0x1c6'),'onDelete':'cascade','foreignKey':_0xe1f6('0x1be')});db[_0xe1f6('0x1c5')][_0xe1f6('0x117')](db['SugarcrmField'],{'as':_0xe1f6('0x1c7'),'onDelete':'cascade','foreignKey':_0xe1f6('0x1bf')});db['SugarcrmConfiguration'][_0xe1f6('0x117')](db[_0xe1f6('0x1c8')],{'as':_0xe1f6('0x1c0'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1c1')});db[_0xe1f6('0x1c5')][_0xe1f6('0x117')](db[_0xe1f6('0x1c8')],{'as':_0xe1f6('0x1bc'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1c2')});db[_0xe1f6('0x1c5')][_0xe1f6('0x14e')](db[_0xe1f6('0xa4')],{'as':'Account','foreignKey':'AccountId'});db[_0xe1f6('0x1c8')][_0xe1f6('0x117')](db[_0xe1f6('0x1c8')],{'as':_0xe1f6('0x1c3'),'foreignKey':_0xe1f6('0x1bf')});db['SugarcrmField'][_0xe1f6('0x117')](db[_0xe1f6('0x1c8')],{'as':'Description','foreignKey':'DescriptionId'});db['SugarcrmField'][_0xe1f6('0x117')](db['SugarcrmField'],{'as':'Field','foreignKey':_0xe1f6('0x1c2')});db[_0xe1f6('0x1c8')][_0xe1f6('0x14e')](db['Variable'],{'as':'Variable','foreignKey':_0xe1f6('0x1c9')});db[_0xe1f6('0xa8')][_0xe1f6('0x117')](db[_0xe1f6('0x1ca')],{'as':_0xe1f6('0x1c6'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1be')});db['DeskConfiguration'][_0xe1f6('0x117')](db['DeskField'],{'as':_0xe1f6('0x1c7'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1bf')});db[_0xe1f6('0x1ca')][_0xe1f6('0x117')](db['DeskField'],{'as':_0xe1f6('0x1c0'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1c1')});db[_0xe1f6('0x1ca')][_0xe1f6('0x117')](db['DeskField'],{'as':_0xe1f6('0x1bc'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1c2')});db[_0xe1f6('0x1ca')][_0xe1f6('0x14e')](db['DeskAccount'],{'as':_0xe1f6('0x167'),'foreignKey':_0xe1f6('0x1be')});db['DeskConfiguration']['belongsToMany'](db[_0xe1f6('0x169')],{'through':_0xe1f6('0x1cb')});db[_0xe1f6('0xab')][_0xe1f6('0x117')](db[_0xe1f6('0xab')],{'as':_0xe1f6('0x1c3'),'foreignKey':_0xe1f6('0x1bf')});db[_0xe1f6('0xab')][_0xe1f6('0x117')](db[_0xe1f6('0xab')],{'as':'Description','foreignKey':_0xe1f6('0x1c1')});db['DeskField'][_0xe1f6('0x117')](db[_0xe1f6('0xab')],{'as':_0xe1f6('0x1c4'),'foreignKey':_0xe1f6('0x1c2')});db[_0xe1f6('0xab')][_0xe1f6('0x14e')](db[_0xe1f6('0x98')],{'as':_0xe1f6('0x98'),'foreignKey':_0xe1f6('0x1c9')});db[_0xe1f6('0xac')][_0xe1f6('0x117')](db[_0xe1f6('0x1cc')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xe1f6('0x1be')});db[_0xe1f6('0x1cc')]['hasMany'](db[_0xe1f6('0xae')],{'as':_0xe1f6('0x1c7'),'onDelete':'cascade','foreignKey':_0xe1f6('0x1bf')});db[_0xe1f6('0x1cc')]['hasMany'](db['ZohoField'],{'as':_0xe1f6('0x1c0'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1c1')});db[_0xe1f6('0x1cc')][_0xe1f6('0x117')](db[_0xe1f6('0xae')],{'as':_0xe1f6('0x1bc'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1c2')});db['ZohoConfiguration'][_0xe1f6('0x14e')](db['ZohoAccount'],{'as':_0xe1f6('0x167'),'foreignKey':_0xe1f6('0x1be')});db[_0xe1f6('0xae')]['hasMany'](db[_0xe1f6('0xae')],{'as':_0xe1f6('0x1c3'),'foreignKey':_0xe1f6('0x1bf')});db[_0xe1f6('0xae')][_0xe1f6('0x117')](db['ZohoField'],{'as':'Description','foreignKey':_0xe1f6('0x1c1')});db[_0xe1f6('0xae')][_0xe1f6('0x117')](db[_0xe1f6('0xae')],{'as':_0xe1f6('0x1c4'),'foreignKey':'FieldId'});db[_0xe1f6('0xae')][_0xe1f6('0x14e')](db[_0xe1f6('0x98')],{'as':_0xe1f6('0x98'),'foreignKey':_0xe1f6('0x1c9')});db['ZendeskAccount'][_0xe1f6('0x117')](db[_0xe1f6('0xb2')],{'as':_0xe1f6('0x1c6'),'onDelete':_0xe1f6('0x114'),'foreignKey':'AccountId'});db[_0xe1f6('0xb2')][_0xe1f6('0x117')](db[_0xe1f6('0xb4')],{'as':_0xe1f6('0x1c7'),'foreignKey':'SubjectId'});db['ZendeskConfiguration'][_0xe1f6('0x117')](db[_0xe1f6('0xb4')],{'as':_0xe1f6('0x1c0'),'foreignKey':_0xe1f6('0x1c1')});db[_0xe1f6('0xb2')][_0xe1f6('0x117')](db[_0xe1f6('0xb4')],{'as':_0xe1f6('0x1bc'),'foreignKey':'FieldId'});db[_0xe1f6('0xb2')][_0xe1f6('0x14e')](db['ZendeskAccount'],{'as':_0xe1f6('0x167'),'foreignKey':'AccountId'});db[_0xe1f6('0xb2')][_0xe1f6('0x127')](db['Tag'],{'through':_0xe1f6('0x1cd')});db[_0xe1f6('0xb4')][_0xe1f6('0x117')](db['ZendeskField'],{'as':_0xe1f6('0x1c3'),'foreignKey':_0xe1f6('0x1bf')});db[_0xe1f6('0xb4')][_0xe1f6('0x117')](db[_0xe1f6('0xb4')],{'as':'Description','foreignKey':_0xe1f6('0x1c1')});db[_0xe1f6('0xb4')]['hasMany'](db[_0xe1f6('0xb4')],{'as':_0xe1f6('0x1c4'),'foreignKey':_0xe1f6('0x1c2')});db[_0xe1f6('0xb4')][_0xe1f6('0x14e')](db['Variable'],{'as':_0xe1f6('0x98'),'foreignKey':_0xe1f6('0x1c9')});db[_0xe1f6('0xb6')][_0xe1f6('0x117')](db[_0xe1f6('0x1ce')],{'as':_0xe1f6('0x1c6'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1be')});db[_0xe1f6('0x1ce')][_0xe1f6('0x117')](db['FreshdeskField'],{'as':_0xe1f6('0x1c7'),'onDelete':_0xe1f6('0x114'),'foreignKey':'SubjectId'});db[_0xe1f6('0x1ce')]['hasMany'](db[_0xe1f6('0xb8')],{'as':_0xe1f6('0x1c0'),'onDelete':_0xe1f6('0x114'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration']['hasMany'](db[_0xe1f6('0xb8')],{'as':'Fields','onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1c2')});db[_0xe1f6('0x1ce')]['belongsTo'](db[_0xe1f6('0xb6')],{'as':_0xe1f6('0x167'),'foreignKey':_0xe1f6('0x1be')});db[_0xe1f6('0x1ce')][_0xe1f6('0x127')](db[_0xe1f6('0x169')],{'through':_0xe1f6('0x1cf')});db[_0xe1f6('0xb8')][_0xe1f6('0x117')](db[_0xe1f6('0xb8')],{'as':_0xe1f6('0x1c3'),'foreignKey':_0xe1f6('0x1bf')});db['FreshdeskField']['hasMany'](db[_0xe1f6('0xb8')],{'as':_0xe1f6('0x1d0'),'foreignKey':_0xe1f6('0x1c1')});db[_0xe1f6('0xb8')][_0xe1f6('0x117')](db[_0xe1f6('0xb8')],{'as':_0xe1f6('0x1c4'),'foreignKey':_0xe1f6('0x1c2')});db['FreshdeskField'][_0xe1f6('0x14e')](db['Variable'],{'as':_0xe1f6('0x98'),'foreignKey':'VariableId'});db[_0xe1f6('0xba')][_0xe1f6('0x117')](db[_0xe1f6('0xbc')],{'as':_0xe1f6('0x1c6'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1be')});db[_0xe1f6('0xbc')]['hasMany'](db[_0xe1f6('0xbe')],{'as':_0xe1f6('0x1c7'),'foreignKey':_0xe1f6('0x1bf')});db[_0xe1f6('0xbc')][_0xe1f6('0x117')](db[_0xe1f6('0xbe')],{'as':_0xe1f6('0x1c0'),'foreignKey':_0xe1f6('0x1c1')});db[_0xe1f6('0xbc')][_0xe1f6('0x117')](db[_0xe1f6('0xbe')],{'as':'Fields','foreignKey':_0xe1f6('0x1c2')});db[_0xe1f6('0xbc')][_0xe1f6('0x14e')](db[_0xe1f6('0xba')],{'as':'Account','foreignKey':'AccountId'});db[_0xe1f6('0xbe')][_0xe1f6('0x117')](db[_0xe1f6('0xbe')],{'as':_0xe1f6('0x1c3'),'foreignKey':_0xe1f6('0x1bf')});db['VtigerField'][_0xe1f6('0x117')](db[_0xe1f6('0xbe')],{'as':_0xe1f6('0x1d0'),'foreignKey':_0xe1f6('0x1c1')});db[_0xe1f6('0xbe')][_0xe1f6('0x117')](db[_0xe1f6('0xbe')],{'as':'Field','foreignKey':'FieldId'});db[_0xe1f6('0xbe')][_0xe1f6('0x14e')](db[_0xe1f6('0x98')],{'as':_0xe1f6('0x98'),'foreignKey':_0xe1f6('0x1c9')});db[_0xe1f6('0xc0')][_0xe1f6('0x117')](db[_0xe1f6('0xc1')],{'as':_0xe1f6('0x1c6'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1be')});db['ServicenowConfiguration'][_0xe1f6('0x117')](db['ServicenowField'],{'as':_0xe1f6('0x1c7'),'foreignKey':'SubjectId'});db[_0xe1f6('0xc1')][_0xe1f6('0x117')](db[_0xe1f6('0x1d1')],{'as':_0xe1f6('0x1c0'),'foreignKey':_0xe1f6('0x1c1')});db['ServicenowConfiguration']['hasMany'](db[_0xe1f6('0x1d1')],{'as':'Fields','foreignKey':_0xe1f6('0x1c2')});db[_0xe1f6('0xc1')]['belongsTo'](db['ServicenowAccount'],{'as':'Account','foreignKey':_0xe1f6('0x1be')});db[_0xe1f6('0x1d1')][_0xe1f6('0x117')](db[_0xe1f6('0x1d1')],{'as':_0xe1f6('0x1c3'),'foreignKey':_0xe1f6('0x1bf')});db[_0xe1f6('0x1d1')][_0xe1f6('0x117')](db[_0xe1f6('0x1d1')],{'as':_0xe1f6('0x1d0'),'foreignKey':_0xe1f6('0x1c1')});db['ServicenowField'][_0xe1f6('0x117')](db[_0xe1f6('0x1d1')],{'as':_0xe1f6('0x1c4'),'foreignKey':_0xe1f6('0x1c2')});db[_0xe1f6('0x1d1')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['Dynamics365Account'][_0xe1f6('0x117')](db['Dynamics365Configuration'],{'as':_0xe1f6('0x1c6'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1be')});db[_0xe1f6('0xc4')]['belongsTo'](db[_0xe1f6('0x10b')],{'as':_0xe1f6('0x10b'),'foreignKey':_0xe1f6('0x160')});db[_0xe1f6('0xc6')][_0xe1f6('0x117')](db[_0xe1f6('0x1d2')],{'as':_0xe1f6('0x1c7'),'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1bf')});db[_0xe1f6('0xc6')][_0xe1f6('0x117')](db[_0xe1f6('0x1d2')],{'as':'Descriptions','onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1c1')});db[_0xe1f6('0xc6')]['hasMany'](db['Dynamics365Field'],{'as':'Fields','onDelete':_0xe1f6('0x114'),'foreignKey':'FieldId'});db[_0xe1f6('0xc6')][_0xe1f6('0x14e')](db[_0xe1f6('0xc4')],{'as':_0xe1f6('0x167'),'foreignKey':_0xe1f6('0x1be')});db['Dynamics365Field'][_0xe1f6('0x117')](db[_0xe1f6('0x1d2')],{'as':_0xe1f6('0x1c3'),'foreignKey':_0xe1f6('0x1bf')});db['Dynamics365Field']['hasMany'](db['Dynamics365Field'],{'as':_0xe1f6('0x1d0'),'foreignKey':_0xe1f6('0x1c1')});db['Dynamics365Field'][_0xe1f6('0x117')](db[_0xe1f6('0x1d2')],{'as':_0xe1f6('0x1c4'),'foreignKey':_0xe1f6('0x1c2')});db[_0xe1f6('0x1d2')][_0xe1f6('0x14e')](db['Variable'],{'as':_0xe1f6('0x98'),'foreignKey':_0xe1f6('0x1c9')});db[_0xe1f6('0xc8')][_0xe1f6('0x117')](db[_0xe1f6('0xca')],{'as':_0xe1f6('0x1c6'),'onDelete':_0xe1f6('0x114'),'foreignKey':'AccountId'});db[_0xe1f6('0xca')][_0xe1f6('0x117')](db['FreshsalesField'],{'as':_0xe1f6('0x1c7'),'foreignKey':'SubjectId'});db[_0xe1f6('0xca')][_0xe1f6('0x117')](db['FreshsalesField'],{'as':_0xe1f6('0x1c0'),'foreignKey':_0xe1f6('0x1c1')});db[_0xe1f6('0xca')][_0xe1f6('0x117')](db[_0xe1f6('0xcc')],{'as':_0xe1f6('0x1bc'),'foreignKey':'FieldId'});db[_0xe1f6('0xca')][_0xe1f6('0x14e')](db['FreshsalesAccount'],{'as':_0xe1f6('0x167'),'foreignKey':_0xe1f6('0x1be')});db[_0xe1f6('0xcc')]['hasMany'](db[_0xe1f6('0xcc')],{'as':_0xe1f6('0x1c3'),'foreignKey':_0xe1f6('0x1bf')});db[_0xe1f6('0xcc')][_0xe1f6('0x117')](db[_0xe1f6('0xcc')],{'as':_0xe1f6('0x1d0'),'foreignKey':_0xe1f6('0x1c1')});db['FreshsalesField'][_0xe1f6('0x117')](db['FreshsalesField'],{'as':'Field','foreignKey':_0xe1f6('0x1c2')});db[_0xe1f6('0xcc')][_0xe1f6('0x14e')](db[_0xe1f6('0x98')],{'as':'Variable','foreignKey':_0xe1f6('0x1c9')});db[_0xe1f6('0xcf')]['belongsTo'](db[_0xe1f6('0x67')],{});db[_0xe1f6('0xcf')][_0xe1f6('0x14e')](db[_0xe1f6('0xf9')],{'as':_0xe1f6('0x164'),'foreignKey':'ListId'});db[_0xe1f6('0xcf')]['belongsTo'](db[_0xe1f6('0x77')],{'as':_0xe1f6('0x15e'),'foreignKey':'ContactId'});db[_0xe1f6('0xcf')]['belongsTo'](db[_0xe1f6('0x6d')],{});db[_0xe1f6('0xcf')][_0xe1f6('0x14e')](db[_0xe1f6('0x6f')],{});db[_0xe1f6('0xcf')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{});db[_0xe1f6('0xcf')][_0xe1f6('0x14e')](db['ChatQueue'],{});db[_0xe1f6('0xd1')]['belongsTo'](db[_0xe1f6('0x11')],{'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1d3')});db[_0xe1f6('0xd1')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x1d4')});db[_0xe1f6('0xd7')][_0xe1f6('0x117')](db[_0xe1f6('0xd5')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xe1f6('0xd7')]['hasMany'](db[_0xe1f6('0xd3')],{'foreignKey':_0xe1f6('0x1d5'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0xd9')]['belongsTo'](db[_0xe1f6('0x183')],{});db[_0xe1f6('0xd9')][_0xe1f6('0x14e')](db[_0xe1f6('0xf9')],{'as':'List','foreignKey':'ListId'});db['SmsQueueReport']['belongsTo'](db[_0xe1f6('0x77')],{'as':_0xe1f6('0x15e'),'foreignKey':'ContactId'});db[_0xe1f6('0xd9')][_0xe1f6('0x14e')](db['SmsInteraction'],{});db['SmsQueueReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x5b')],{});db['SmsQueueReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{});db['SmsQueueReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x5d')],{});db[_0xe1f6('0xde')][_0xe1f6('0x117')](db[_0xe1f6('0xd7')],{'foreignKey':'ProjectId'});db[_0xe1f6('0xde')][_0xe1f6('0x117')](db[_0xe1f6('0xd5')],{'foreignKey':'ProjectId'});db[_0xe1f6('0xde')][_0xe1f6('0x117')](db[_0xe1f6('0xd3')],{'foreignKey':_0xe1f6('0x1d6')});db[_0xe1f6('0xe7')][_0xe1f6('0x127')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x154'),'through':_0xe1f6('0x12c')});db[_0xe1f6('0xe7')][_0xe1f6('0x127')](db[_0xe1f6('0x1a')],{'through':'TeamVoiceQueue','as':_0xe1f6('0x132')});db[_0xe1f6('0xe7')][_0xe1f6('0x127')](db[_0xe1f6('0x42')],{'through':_0xe1f6('0x165'),'as':'MailQueues'});db[_0xe1f6('0xe7')][_0xe1f6('0x127')](db[_0xe1f6('0x72')],{'through':_0xe1f6('0x198'),'as':_0xe1f6('0x1d7')});db['Team'][_0xe1f6('0x127')](db[_0xe1f6('0x55')],{'through':_0xe1f6('0x180'),'as':_0xe1f6('0x135')});db[_0xe1f6('0xe7')][_0xe1f6('0x127')](db['SmsQueue'],{'through':_0xe1f6('0x189'),'as':_0xe1f6('0x1d8')});db['Team'][_0xe1f6('0x127')](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0xe1f6('0xe7')][_0xe1f6('0x127')](db[_0xe1f6('0x10a')],{'through':_0xe1f6('0x1d9'),'as':_0xe1f6('0x137')});db[_0xe1f6('0xe7')][_0xe1f6('0x127')](db[_0xe1f6('0x133')],{'through':_0xe1f6('0x10c'),'as':_0xe1f6('0x134')});db['Campaign']['hasMany'](db[_0xe1f6('0x79')],{'as':'Hoppers','foreignKey':_0xe1f6('0x1a4')});db[_0xe1f6('0x1a3')][_0xe1f6('0x117')](db['CmHopperFinal'],{'as':_0xe1f6('0x149'),'foreignKey':_0xe1f6('0x1a4')});db['Campaign'][_0xe1f6('0x117')](db[_0xe1f6('0x11c')],{'as':_0xe1f6('0x14b'),'foreignKey':_0xe1f6('0x1a4')});db[_0xe1f6('0x1a3')][_0xe1f6('0x117')](db[_0xe1f6('0x7b')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db['Campaign'][_0xe1f6('0x14e')](db[_0xe1f6('0x28')],{'as':_0xe1f6('0x28'),'foreignKey':_0xe1f6('0x14f')});db[_0xe1f6('0x1a3')]['belongsTo'](db[_0xe1f6('0x28')],{'as':_0xe1f6('0x150'),'foreignKey':_0xe1f6('0x1da')});db[_0xe1f6('0x1a3')][_0xe1f6('0x14e')](db[_0xe1f6('0x88')],{'as':_0xe1f6('0x88'),'foreignKey':_0xe1f6('0x170')});db[_0xe1f6('0x1a3')][_0xe1f6('0x14e')](db[_0xe1f6('0xe2')],{'as':_0xe1f6('0xe2'),'foreignKey':_0xe1f6('0x1db')});db[_0xe1f6('0x1a3')][_0xe1f6('0x127')](db['CmList'],{'as':'Lists','through':_0xe1f6('0x1dc')});db[_0xe1f6('0x1a3')][_0xe1f6('0x127')](db['CmList'],{'as':_0xe1f6('0x157'),'through':'campaigns_has_cm_blacklists'});db[_0xe1f6('0xee')][_0xe1f6('0x14e')](db[_0xe1f6('0x70')],{'as':_0xe1f6('0x70'),'foreignKey':_0xe1f6('0x16f')});db[_0xe1f6('0xf1')][_0xe1f6('0x14e')](db['MailMessage'],{});db['MailTransferReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x46')],{});db[_0xe1f6('0xf1')][_0xe1f6('0x14e')](db[_0xe1f6('0x40')],{'foreignKey':'FromMailAccountId','as':_0xe1f6('0x1dd')});db[_0xe1f6('0xf1')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'foreignKey':_0xe1f6('0x1de'),'as':_0xe1f6('0x1df')});db[_0xe1f6('0xf1')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'foreignKey':_0xe1f6('0x1e0'),'as':'ToAgent'});db[_0xe1f6('0xf1')][_0xe1f6('0x14e')](db[_0xe1f6('0x42')],{'foreignKey':_0xe1f6('0x1e1'),'as':'ToQueue'});db[_0xe1f6('0xf1')][_0xe1f6('0x14e')](db[_0xe1f6('0x40')],{'foreignKey':'ToMailAccountId','as':_0xe1f6('0x1e2')});db[_0xe1f6('0x1e3')][_0xe1f6('0x14e')](db['ChatMessage'],{});db[_0xe1f6('0x1e3')][_0xe1f6('0x14e')](db[_0xe1f6('0x6d')],{});db['ChatTransferReport'][_0xe1f6('0x14e')](db['ChatWebsite'],{'foreignKey':_0xe1f6('0x1e4'),'as':_0xe1f6('0x1dd')});db[_0xe1f6('0x1e3')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'foreignKey':'FromUserId','as':_0xe1f6('0x1df')});db['ChatTransferReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'foreignKey':_0xe1f6('0x1e0'),'as':_0xe1f6('0x1e5')});db['ChatTransferReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x72')],{'foreignKey':_0xe1f6('0x1e6'),'as':_0xe1f6('0x1e7')});db[_0xe1f6('0x1e3')][_0xe1f6('0x14e')](db[_0xe1f6('0x67')],{'foreignKey':_0xe1f6('0x1e8'),'as':'ToAccount'});db[_0xe1f6('0x1e9')][_0xe1f6('0x14e')](db[_0xe1f6('0x53')],{});db['FaxTransferReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x51')],{});db[_0xe1f6('0x1e9')][_0xe1f6('0x14e')](db[_0xe1f6('0x4f')],{'foreignKey':_0xe1f6('0x1ea'),'as':_0xe1f6('0x1dd')});db['FaxTransferReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'foreignKey':_0xe1f6('0x1de'),'as':_0xe1f6('0x1df')});db[_0xe1f6('0x1e9')][_0xe1f6('0x14e')](db['User'],{'foreignKey':_0xe1f6('0x1e0'),'as':'ToAgent'});db[_0xe1f6('0x1e9')][_0xe1f6('0x14e')](db[_0xe1f6('0x55')],{'foreignKey':'ToFaxQueueId','as':_0xe1f6('0x1e7')});db[_0xe1f6('0x1e9')][_0xe1f6('0x14e')](db[_0xe1f6('0x4f')],{'foreignKey':_0xe1f6('0x1eb'),'as':_0xe1f6('0x1e2')});db['OpenchannelTransferReport']['belongsTo'](db[_0xe1f6('0x63')],{});db[_0xe1f6('0xf5')]['belongsTo'](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x5f')],{'foreignKey':'FromOpenchannelAccountId','as':_0xe1f6('0x1dd')});db['OpenchannelTransferReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'foreignKey':_0xe1f6('0x1de'),'as':_0xe1f6('0x1df')});db['OpenchannelTransferReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'foreignKey':_0xe1f6('0x1e0'),'as':_0xe1f6('0x1e5')});db[_0xe1f6('0xf5')]['belongsTo'](db[_0xe1f6('0x65')],{'foreignKey':_0xe1f6('0x1ec'),'as':'ToQueue'});db[_0xe1f6('0xf5')][_0xe1f6('0x14e')](db[_0xe1f6('0x5f')],{'foreignKey':_0xe1f6('0x1ed'),'as':_0xe1f6('0x1e2')});db[_0xe1f6('0xf7')][_0xe1f6('0x14e')](db[_0xe1f6('0x5b')],{});db[_0xe1f6('0xf7')][_0xe1f6('0x14e')](db[_0xe1f6('0x185')],{});db[_0xe1f6('0xf7')][_0xe1f6('0x14e')](db[_0xe1f6('0x183')],{'foreignKey':_0xe1f6('0x1ee'),'as':'FromAccount'});db['SmsTransferReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'foreignKey':_0xe1f6('0x1de'),'as':_0xe1f6('0x1df')});db[_0xe1f6('0xf7')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'foreignKey':_0xe1f6('0x1e0'),'as':'ToAgent'});db[_0xe1f6('0xf7')]['belongsTo'](db[_0xe1f6('0x5d')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0xe1f6('0xf7')][_0xe1f6('0x14e')](db[_0xe1f6('0x183')],{'foreignKey':_0xe1f6('0x1ef'),'as':_0xe1f6('0x1e2')});db[_0xe1f6('0xf9')][_0xe1f6('0x117')](db[_0xe1f6('0x175')],{'as':_0xe1f6('0x176'),'foreignKey':'ListId','onDelete':_0xe1f6('0x114')});db[_0xe1f6('0xf9')][_0xe1f6('0x117')](db[_0xe1f6('0x1f0')],{'as':_0xe1f6('0x1f1'),'foreignKey':'ListId'});db[_0xe1f6('0xf9')]['hasMany'](db[_0xe1f6('0x77')],{'as':'Contacts','onDelete':_0xe1f6('0x114'),'foreignKey':_0xe1f6('0x172')});db[_0xe1f6('0xf9')][_0xe1f6('0x117')](db['CmHopperFinal'],{'as':_0xe1f6('0x149'),'foreignKey':'ListId'});db[_0xe1f6('0xf9')]['hasMany'](db[_0xe1f6('0x11c')],{'as':_0xe1f6('0x11d'),'foreignKey':_0xe1f6('0x172')});db[_0xe1f6('0xf9')][_0xe1f6('0x117')](db[_0xe1f6('0x7f')],{'as':_0xe1f6('0x7f'),'foreignKey':_0xe1f6('0x172')});db['CmList']['belongsToMany'](db[_0xe1f6('0x1a')],{'as':_0xe1f6('0x1f2'),'through':_0xe1f6('0x1f3')});db['CmList']['belongsToMany'](db['User'],{'as':_0xe1f6('0x154'),'through':_0xe1f6('0x12b')});db['VoicePrefix']['hasMany'](db[_0xe1f6('0x16')],{'as':'Extensions','onDelete':'cascade'});db[_0xe1f6('0x133')][_0xe1f6('0x127')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x154'),'through':_0xe1f6('0x10e')});db[_0xe1f6('0x133')][_0xe1f6('0x127')](db[_0xe1f6('0xe7')],{'through':_0xe1f6('0x10c'),'as':'Teams'});db[_0xe1f6('0x125')][_0xe1f6('0x117')](db['User'],{'as':'Users','foreignKey':_0xe1f6('0x126')});db[_0xe1f6('0x125')]['hasMany'](db[_0xe1f6('0xfc')],{'as':_0xe1f6('0x1f4'),'foreignKey':_0xe1f6('0x126'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0xfc')][_0xe1f6('0x117')](db['UserProfileResource'],{'as':_0xe1f6('0x1f5'),'foreignKey':'sectionId','onDelete':_0xe1f6('0x114')});db['WhatsappAccount'][_0xe1f6('0x117')](db[_0xe1f6('0x175')],{'as':_0xe1f6('0x176'),'foreignKey':_0xe1f6('0x1f6'),'onDelete':_0xe1f6('0x114')});db[_0xe1f6('0x101')][_0xe1f6('0x117')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xe1f6('0x1f6')});db['WhatsappAccount'][_0xe1f6('0x117')](db['WhatsappMessage'],{'as':'Messages','foreignKey':'WhatsappAccountId'});db[_0xe1f6('0x101')]['hasMany'](db['WhatsappInteraction'],{'as':'Interactions'});db['WhatsappAccount'][_0xe1f6('0x117')](db[_0xe1f6('0x102')],{'as':_0xe1f6('0x145'),'foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0xe1f6('0x101')][_0xe1f6('0x14e')](db[_0xe1f6('0xf9')],{'as':_0xe1f6('0x164'),'foreignKey':_0xe1f6('0x172')});db['WhatsappAccount'][_0xe1f6('0x14e')](db['Pause'],{'as':_0xe1f6('0x151'),'foreignKey':_0xe1f6('0x152')});db[_0xe1f6('0x101')][_0xe1f6('0x127')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x154'),'through':_0xe1f6('0x142')});db[_0xe1f6('0x102')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'onDelete':_0xe1f6('0x161')});db[_0xe1f6('0x102')]['belongsTo'](db[_0xe1f6('0x10a')],{'onDelete':_0xe1f6('0x161')});db[_0xe1f6('0x102')][_0xe1f6('0x14e')](db[_0xe1f6('0x101')],{'onDelete':'restrict'});db[_0xe1f6('0x102')][_0xe1f6('0x14e')](db[_0xe1f6('0x88')],{'onDelete':_0xe1f6('0x161'),'foreignKey':_0xe1f6('0x170')});db[_0xe1f6('0x102')][_0xe1f6('0x14e')](db['Tag'],{'onDelete':_0xe1f6('0x161'),'foreignKey':'TagId'});db[_0xe1f6('0x103')]['hasMany'](db[_0xe1f6('0x104')],{'as':_0xe1f6('0x17b'),'onDelete':'cascade','foreignKey':_0xe1f6('0x1f7')});db[_0xe1f6('0x103')][_0xe1f6('0x14e')](db[_0xe1f6('0x101')],{'as':_0xe1f6('0x167'),'foreignKey':_0xe1f6('0x1f6')});db[_0xe1f6('0x103')][_0xe1f6('0x14e')](db[_0xe1f6('0x77')],{'as':_0xe1f6('0x15e'),'foreignKey':_0xe1f6('0x182')});db['WhatsappInteraction']['belongsTo'](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x168'),'foreignKey':_0xe1f6('0x115')});db[_0xe1f6('0x103')][_0xe1f6('0x127')](db[_0xe1f6('0x169')],{'through':_0xe1f6('0x1b5'),'as':_0xe1f6('0x16b')});db['WhatsappInteraction'][_0xe1f6('0x127')](db[_0xe1f6('0x169')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db[_0xe1f6('0x103')][_0xe1f6('0x127')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x188'),'through':_0xe1f6('0x131'),'foreignKey':_0xe1f6('0x1f7')});db[_0xe1f6('0x104')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x11')});db[_0xe1f6('0x104')]['belongsTo'](db[_0xe1f6('0x77')],{'onDelete':_0xe1f6('0x114'),'as':_0xe1f6('0x15e')});db[_0xe1f6('0x104')][_0xe1f6('0x14e')](db[_0xe1f6('0x103')],{'onDelete':_0xe1f6('0x114'),'as':_0xe1f6('0x16e'),'foreignKey':'WhatsappInteractionId'});db[_0xe1f6('0x104')][_0xe1f6('0x14e')](db[_0xe1f6('0x101')],{'as':_0xe1f6('0x167'),'foreignKey':'WhatsappAccountId'});db[_0xe1f6('0x106')]['belongsTo'](db[_0xe1f6('0x101')],{});db['WhatsappQueueReport'][_0xe1f6('0x14e')](db[_0xe1f6('0xf9')],{'as':'List','foreignKey':'ListId'});db[_0xe1f6('0x106')]['belongsTo'](db[_0xe1f6('0x77')],{'as':'Contact','foreignKey':_0xe1f6('0x182')});db[_0xe1f6('0x106')][_0xe1f6('0x14e')](db[_0xe1f6('0x103')],{});db[_0xe1f6('0x106')][_0xe1f6('0x14e')](db[_0xe1f6('0x10a')],{});db[_0xe1f6('0x106')][_0xe1f6('0x14e')](db[_0xe1f6('0x104')],{});db['WhatsappQueueReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{});db[_0xe1f6('0x108')][_0xe1f6('0x14e')](db[_0xe1f6('0x104')],{});db['WhatsappTransferReport'][_0xe1f6('0x14e')](db[_0xe1f6('0x103')],{});db[_0xe1f6('0x108')][_0xe1f6('0x14e')](db[_0xe1f6('0x101')],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db[_0xe1f6('0x108')]['belongsTo'](db[_0xe1f6('0x101')],{'foreignKey':_0xe1f6('0x1f8'),'as':'ToAccount'});db[_0xe1f6('0x108')][_0xe1f6('0x14e')](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':_0xe1f6('0x1e7')});db[_0xe1f6('0x108')][_0xe1f6('0x14e')](db['User'],{'foreignKey':_0xe1f6('0x1de'),'as':'FromAgent'});db[_0xe1f6('0x108')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'foreignKey':_0xe1f6('0x1e0'),'as':_0xe1f6('0x1e5')});db['WhatsappQueue']['belongsToMany'](db['User'],{'as':_0xe1f6('0x154'),'through':'UserWhatsappQueue','foreignKey':_0xe1f6('0x1f9')});db[_0xe1f6('0x10a')]['belongsToMany'](db[_0xe1f6('0xe7')],{'through':'team_has_whatsapp_queues','as':_0xe1f6('0x155')});db[_0xe1f6('0x110')][_0xe1f6('0x14e')](db[_0xe1f6('0x11')],{'as':_0xe1f6('0x1fa'),'foreignKey':_0xe1f6('0x115'),'onDelete':'cascade','hooks':!![]});db[_0xe1f6('0x10b')][_0xe1f6('0x113')](db['Dynamics365Account'],{'as':'Dynamics365Account','onDelete':_0xe1f6('0x161')});db[_0xe1f6('0x10b')][_0xe1f6('0x113')](db['MailServerIn'],{'as':_0xe1f6('0x162'),'onDelete':_0xe1f6('0x161')});db['CloudProvider'][_0xe1f6('0x113')](db[_0xe1f6('0x3e')],{'as':'Smtp','onDelete':_0xe1f6('0x161')});module[_0xe1f6('0x1fb')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 41db21e..48c04eb 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ab0=['/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','resolve','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','default','then','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/members/reports','./api/memberReport','/api/voice/transfers/reports','./api/mailServerOut','/api/mail/accounts','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/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/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','/api/sounds','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/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/questions/reports','./api/jscriptyQuestionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','/api/mail_interaction_has_tags','./api/mailInteractionHasTag','./api/authLocal','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet'];(function(_0x3a1f91,_0x15fe8b){var _0x451178=function(_0x5d99){while(--_0x5d99){_0x3a1f91['push'](_0x3a1f91['shift']());}};_0x451178(++_0x15fe8b);}(_0x0ab0,0x118));var _0x00ab=function(_0x502285,_0x1b9c03){_0x502285=_0x502285-0x0;var _0xc4d4c2=_0x0ab0[_0x502285];return _0xc4d4c2;};'use strict';var path=require(_0x00ab('0x0'));var express=require(_0x00ab('0x1'));var errors=require(_0x00ab('0x2'));var config=require(_0x00ab('0x3'));var setupLoggers=require(_0x00ab('0x4'))[_0x00ab('0x5')];var clientSideLogs=require('./api/client-side-logs');exports[_0x00ab('0x6')]=function(_0x1281d4){return setupLoggers(_0x1281d4)[_0x00ab('0x7')](function(){_0x1281d4['use']('/api/users',require(_0x00ab('0x8')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xa'),require(_0x00ab('0xb')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xc'),require(_0x00ab('0xd')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xe'),require(_0x00ab('0xf')));_0x1281d4[_0x00ab('0x9')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x1281d4['use'](_0x00ab('0x10'),require(_0x00ab('0x11')));_0x1281d4[_0x00ab('0x9')]('/api/voice/recordings',require(_0x00ab('0x12')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x13'),require(_0x00ab('0x14')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x15'),require(_0x00ab('0x16')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x17'),require(_0x00ab('0x18')));_0x1281d4[_0x00ab('0x9')]('/api/voice/calls/reports',require(_0x00ab('0x19')));_0x1281d4[_0x00ab('0x9')]('/api/voice/dials/reports',require(_0x00ab('0x1a')));_0x1281d4['use'](_0x00ab('0x1b'),require(_0x00ab('0x1c')));_0x1281d4[_0x00ab('0x9')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x1d'),require(_0x00ab('0x1e')));_0x1281d4['use']('/api/trunks',require('./api/trunk'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x1f'),require('./api/voiceTransferReport'));_0x1281d4[_0x00ab('0x9')]('/api/mail/out_servers',require(_0x00ab('0x20')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x21'),require('./api/mailAccount'));_0x1281d4[_0x00ab('0x9')]('/api/mail/queues',require(_0x00ab('0x22')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x23'),require('./api/mailSubstatus'));_0x1281d4['use'](_0x00ab('0x24'),require('./api/mailInteraction'));_0x1281d4['use'](_0x00ab('0x25'),require(_0x00ab('0x26')));_0x1281d4['use'](_0x00ab('0x27'),require(_0x00ab('0x28')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x29'),require(_0x00ab('0x2a')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x2b'),require(_0x00ab('0x2c')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x2d'),require(_0x00ab('0x2e')));_0x1281d4['use'](_0x00ab('0x2f'),require(_0x00ab('0x30')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x31'),require(_0x00ab('0x32')));_0x1281d4[_0x00ab('0x9')]('/api/fax/interactions',require(_0x00ab('0x33')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x34'),require(_0x00ab('0x35')));_0x1281d4['use'](_0x00ab('0x36'),require(_0x00ab('0x37')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x38'),require('./api/faxQueueReport'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x39'),require(_0x00ab('0x3a')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x3b'),require(_0x00ab('0x3c')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x3d'),require('./api/smsInteraction'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x3e'),require('./api/smsMessage'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x3f'),require('./api/smsQueue'));_0x1281d4['use'](_0x00ab('0x40'),require(_0x00ab('0x41')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x42'),require(_0x00ab('0x43')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x44'),require('./api/openchannelInteraction'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x45'),require(_0x00ab('0x46')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x47'),require(_0x00ab('0x48')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x49'),require(_0x00ab('0x4a')));_0x1281d4['use'](_0x00ab('0x4b'),require(_0x00ab('0x4c')));_0x1281d4['use']('/api/chat/applications',require(_0x00ab('0x4d')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x4e'),require(_0x00ab('0x4f')));_0x1281d4[_0x00ab('0x9')]('/api/chat/messages',require('./api/chatMessage'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x50'),require(_0x00ab('0x51')));_0x1281d4['use'](_0x00ab('0x52'),require('./api/chatQueue'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x53'),require('./api/chatGroup'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x54'),require(_0x00ab('0x55')));_0x1281d4['use'](_0x00ab('0x56'),require(_0x00ab('0x57')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x58'),require(_0x00ab('0x59')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x5a'),require('./api/cmHopper'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x5b'),require(_0x00ab('0x5c')));_0x1281d4[_0x00ab('0x9')]('/api/cm/hopper_final',require(_0x00ab('0x5d')));_0x1281d4['use'](_0x00ab('0x5e'),require('./api/cmHopperHistory'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x5f'),require(_0x00ab('0x60')));_0x1281d4['use'](_0x00ab('0x61'),require('./api/action'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x62'),require(_0x00ab('0x63')));_0x1281d4['use'](_0x00ab('0x64'),require(_0x00ab('0x65')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x66'),require('./api/disposition'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x67'),require(_0x00ab('0x68')));_0x1281d4['use'](_0x00ab('0x69'),require(_0x00ab('0x6a')));_0x1281d4['use']('/api/pauses',require(_0x00ab('0x6b')));_0x1281d4['use'](_0x00ab('0x6c'),require(_0x00ab('0x6d')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x6e'),require('./api/voiceQueuesLog'));_0x1281d4['use'](_0x00ab('0x6f'),require('./api/schedule'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x70'),require('./api/sound'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x71'),require(_0x00ab('0x72')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x73'),require(_0x00ab('0x74')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x75'),require(_0x00ab('0x76')));_0x1281d4['use'](_0x00ab('0x77'),require(_0x00ab('0x78')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x79'),require(_0x00ab('0x7a')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x7b'),require('./api/trigger'));_0x1281d4[_0x00ab('0x9')]('/api/variables',require(_0x00ab('0x7c')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x7d'),require(_0x00ab('0x7e')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x7f'),require('./api/integrationReport'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x80'),require('./api/analyticCustomReport'));_0x1281d4['use'](_0x00ab('0x81'),require(_0x00ab('0x82')));_0x1281d4['use']('/api/analytics/extracted_reports',require(_0x00ab('0x83')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x84'),require(_0x00ab('0x85')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x86'),require(_0x00ab('0x87')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x88'),require(_0x00ab('0x89')));_0x1281d4['use'](_0x00ab('0x8a'),require('./api/intSalesforceAccount'));_0x1281d4['use'](_0x00ab('0x8b'),require(_0x00ab('0x8c')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x8d'),require(_0x00ab('0x8e')));_0x1281d4[_0x00ab('0x9')]('/api/integrations/sugarcrm/accounts',require(_0x00ab('0x8f')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x90'),require(_0x00ab('0x91')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x92'),require(_0x00ab('0x93')));_0x1281d4['use'](_0x00ab('0x94'),require(_0x00ab('0x95')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x96'),require(_0x00ab('0x97')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x98'),require('./api/intDeskField'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x99'),require('./api/intZohoAccount'));_0x1281d4['use'](_0x00ab('0x9a'),require('./api/intZohoConfiguration'));_0x1281d4['use'](_0x00ab('0x9b'),require(_0x00ab('0x9c')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x9d'),require(_0x00ab('0x9e')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x9f'),require(_0x00ab('0xa0')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xa1'),require('./api/intZendeskField'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xa2'),require(_0x00ab('0xa3')));_0x1281d4[_0x00ab('0x9')]('/api/integrations/freshdesk/configurations',require(_0x00ab('0xa4')));_0x1281d4[_0x00ab('0x9')]('/api/integrations/freshdesk/fields',require('./api/intFreshdeskField'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xa5'),require(_0x00ab('0xa6')));_0x1281d4['use']('/api/integrations/vtiger/configurations',require(_0x00ab('0xa7')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xa8'),require('./api/intVtigerField'));_0x1281d4['use'](_0x00ab('0xa9'),require(_0x00ab('0xaa')));_0x1281d4['use']('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x1281d4[_0x00ab('0x9')]('/api/integrations/servicenow/fields',require(_0x00ab('0xab')));_0x1281d4[_0x00ab('0x9')]('/api/integrations/dynamics365/accounts',require(_0x00ab('0xac')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xad'),require(_0x00ab('0xae')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xaf'),require(_0x00ab('0xb0')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xb1'),require('./api/intFreshsalesAccount'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xb2'),require(_0x00ab('0xb3')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xb4'),require('./api/intFreshsalesField'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xb5'),require(_0x00ab('0xb6')));_0x1281d4['use'](_0x00ab('0xb7'),require(_0x00ab('0xb8')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xb9'),require(_0x00ab('0xba')));_0x1281d4[_0x00ab('0x9')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xbb'),require(_0x00ab('0xbc')));_0x1281d4[_0x00ab('0x9')]('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x1281d4['use'](_0x00ab('0xbd'),require(_0x00ab('0xbe')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xbf'),require('./api/squareReport'));_0x1281d4[_0x00ab('0x9')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xc0'),require('./api/jscriptyProject'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xc1'),require(_0x00ab('0xc2')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xc3'),require(_0x00ab('0xc4')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xc5'),require(_0x00ab('0xc6')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xc7'),require(_0x00ab('0xc8')));_0x1281d4['use'](_0x00ab('0xc9'),require('./api/squareMessage'));_0x1281d4['use'](_0x00ab('0xca'),require(_0x00ab('0xcb')));_0x1281d4['use'](_0x00ab('0xcc'),require(_0x00ab('0xcd')));_0x1281d4['use'](_0x00ab('0xce'),require('./api/campaign'));_0x1281d4['use'](_0x00ab('0xcf'),require(_0x00ab('0xd0')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xd1'),require(_0x00ab('0xd2')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xd3'),require(_0x00ab('0xd4')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xd5'),require('./api/mailTransferReport'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xd6'),require('./api/chatTransferReport'));_0x1281d4['use'](_0x00ab('0xd7'),require(_0x00ab('0xd8')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xd9'),require('./api/openchannelTransferReport'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xda'),require(_0x00ab('0xdb')));_0x1281d4['use'](_0x00ab('0xdc'),require(_0x00ab('0xdd')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xde'),require('./api/voicePrefix'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xdf'),require(_0x00ab('0xe0')));_0x1281d4[_0x00ab('0x9')]('/api/userProfile/sections',require(_0x00ab('0xe1')));_0x1281d4['use'](_0x00ab('0xe2'),require('./api/userProfileResource'));_0x1281d4[_0x00ab('0x9')]('/api/userNotifications',require(_0x00ab('0xe3')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xe4'),require('./api/whatsappAccount'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xe5'),require(_0x00ab('0xe6')));_0x1281d4['use']('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xe7'),require(_0x00ab('0xe8')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xe9'),require('./api/whatsappQueueReport'));_0x1281d4['use'](_0x00ab('0xea'),require(_0x00ab('0xeb')));_0x1281d4[_0x00ab('0x9')]('/api/whatsapp/queues',require(_0x00ab('0xec')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xed'),require('./api/cloudProvider'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xee'),require(_0x00ab('0xef')));_0x1281d4[_0x00ab('0x9')]('/api/user-settings',require('./api/user-setting'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xf0'),require(_0x00ab('0xf1')));_0x1281d4[_0x00ab('0x9')]('/api/auth/local',require(_0x00ab('0xf2')));_0x1281d4[_0x00ab('0x9')]('/api/auth/google',require('./api/authGoogle'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xf3'),require(_0x00ab('0xf4')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xf5'),require('./api/jira'));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xf6'),require(_0x00ab('0xf7')));_0x1281d4['use'](_0x00ab('0xf8'),require(_0x00ab('0xf9')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xfa'),require(_0x00ab('0xfb')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xfc'),require(_0x00ab('0xfd')));_0x1281d4['use']('/api/webbar',require(_0x00ab('0xfe')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0xff'),clientSideLogs);_0x1281d4[_0x00ab('0x9')](_0x00ab('0x100'),express[_0x00ab('0x101')](path[_0x00ab('0x102')](config[_0x00ab('0x103')],_0x00ab('0x100'))));_0x1281d4['use'](_0x00ab('0x104'),express[_0x00ab('0x101')](path[_0x00ab('0x102')](config[_0x00ab('0x103')],_0x00ab('0x104'))));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x105'),express[_0x00ab('0x101')](path[_0x00ab('0x102')](config[_0x00ab('0x103')],_0x00ab('0x105'))));_0x1281d4['use'](_0x00ab('0x106'),express[_0x00ab('0x101')](path[_0x00ab('0x102')](config[_0x00ab('0x103')],_0x00ab('0x107'),'3.9.0')));_0x1281d4[_0x00ab('0x9')](_0x00ab('0x108'),express[_0x00ab('0x101')](path['join'](config['root'],_0x00ab('0x109'))));_0x1281d4['route'](_0x00ab('0x10a'))[_0x00ab('0x10b')](errors[0x194]);_0x1281d4[_0x00ab('0x10c')]('/*')[_0x00ab('0x10b')](function(_0x1b8f45,_0x5b9f08){_0x5b9f08[_0x00ab('0x10d')](path[_0x00ab('0x10e')](_0x1281d4[_0x00ab('0x10b')]('appPath')+_0x00ab('0x10f')));});return _0x1281d4;});}; \ No newline at end of file +var _0xeff2=['./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/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/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','static','join','root','/apidoc','/www','/demo','/snippet','snippet','3.9.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','setupLoggers','./api/client-side-logs','default','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmField','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations'];(function(_0x2fc147,_0x2fbd8a){var _0x315652=function(_0x11009d){while(--_0x11009d){_0x2fc147['push'](_0x2fc147['shift']());}};_0x315652(++_0x2fbd8a);}(_0xeff2,0x180));var _0x2eff=function(_0x4a0b4f,_0x3d77ac){_0x4a0b4f=_0x4a0b4f-0x0;var _0x430511=_0xeff2[_0x4a0b4f];return _0x430511;};'use strict';var path=require('path');var express=require('express');var errors=require('./errors');var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')[_0x2eff('0x0')];var clientSideLogs=require(_0x2eff('0x1'));exports[_0x2eff('0x2')]=function(_0x17aba8){return setupLoggers(_0x17aba8)['then'](function(){_0x17aba8[_0x2eff('0x3')]('/api/users',require('./api/user'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x4'),require(_0x2eff('0x5')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x6'),require('./api/voiceContext'));_0x17aba8[_0x2eff('0x3')]('/api/voice/extensions',require(_0x2eff('0x7')));_0x17aba8['use'](_0x2eff('0x8'),require(_0x2eff('0x9')));_0x17aba8[_0x2eff('0x3')]('/api/voice/queues',require('./api/voiceQueue'));_0x17aba8['use']('/api/voice/recordings',require(_0x2eff('0xa')));_0x17aba8['use'](_0x2eff('0xb'),require(_0x2eff('0xc')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xd'),require(_0x2eff('0xe')));_0x17aba8['use'](_0x2eff('0xf'),require('./api/voiceMailMessage'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x10'),require(_0x2eff('0x11')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x12'),require('./api/voiceDialReport'));_0x17aba8[_0x2eff('0x3')]('/api/voice/agents/reports',require(_0x2eff('0x13')));_0x17aba8['use']('/api/voice/queues/reports',require(_0x2eff('0x14')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x15'),require(_0x2eff('0x16')));_0x17aba8[_0x2eff('0x3')]('/api/trunks',require(_0x2eff('0x17')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x18'),require(_0x2eff('0x19')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x1a'),require(_0x2eff('0x1b')));_0x17aba8['use'](_0x2eff('0x1c'),require(_0x2eff('0x1d')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x1e'),require(_0x2eff('0x1f')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x20'),require('./api/mailSubstatus'));_0x17aba8['use']('/api/mail/interactions',require(_0x2eff('0x21')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x22'),require(_0x2eff('0x23')));_0x17aba8['use']('/api/mail/applications',require('./api/mailApplication'));_0x17aba8[_0x2eff('0x3')]('/api/mail/reports/queue',require(_0x2eff('0x24')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x25'),require(_0x2eff('0x26')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x27'),require('./api/dashboardItem'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x28'),require(_0x2eff('0x29')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x2a'),require(_0x2eff('0x2b')));_0x17aba8[_0x2eff('0x3')]('/api/fax/interactions',require(_0x2eff('0x2c')));_0x17aba8[_0x2eff('0x3')]('/api/fax/messages',require(_0x2eff('0x2d')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x2e'),require(_0x2eff('0x2f')));_0x17aba8['use']('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x17aba8['use'](_0x2eff('0x30'),require(_0x2eff('0x31')));_0x17aba8['use']('/api/sms/applications',require(_0x2eff('0x32')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x33'),require(_0x2eff('0x34')));_0x17aba8['use'](_0x2eff('0x35'),require('./api/smsMessage'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x36'),require('./api/smsQueue'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x37'),require(_0x2eff('0x38')));_0x17aba8[_0x2eff('0x3')]('/api/openchannel/applications',require(_0x2eff('0x39')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x3a'),require('./api/openchannelInteraction'));_0x17aba8['use'](_0x2eff('0x3b'),require(_0x2eff('0x3c')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x3d'),require(_0x2eff('0x3e')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x3f'),require(_0x2eff('0x40')));_0x17aba8[_0x2eff('0x3')]('/api/openchannel/reports/queue',require(_0x2eff('0x41')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x42'),require(_0x2eff('0x43')));_0x17aba8['use']('/api/chat/interactions',require(_0x2eff('0x44')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x45'),require(_0x2eff('0x46')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x47'),require('./api/chatOfflineMessage'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x48'),require(_0x2eff('0x49')));_0x17aba8[_0x2eff('0x3')]('/api/chat/groups',require(_0x2eff('0x4a')));_0x17aba8[_0x2eff('0x3')]('/api/chat/proactive_actions',require(_0x2eff('0x4b')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x4c'),require(_0x2eff('0x4d')));_0x17aba8['use'](_0x2eff('0x4e'),require('./api/cmContact'));_0x17aba8[_0x2eff('0x3')]('/api/cm/hopper',require(_0x2eff('0x4f')));_0x17aba8[_0x2eff('0x3')]('/api/cm/hopper_black',require(_0x2eff('0x50')));_0x17aba8['use'](_0x2eff('0x51'),require(_0x2eff('0x52')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x53'),require(_0x2eff('0x54')));_0x17aba8['use']('/api/cm/custom_fields',require(_0x2eff('0x55')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x56'),require(_0x2eff('0x57')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x58'),require('./api/automation'));_0x17aba8['use'](_0x2eff('0x59'),require(_0x2eff('0x5a')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x5b'),require(_0x2eff('0x5c')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x5d'),require(_0x2eff('0x5e')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x5f'),require('./api/interval'));_0x17aba8['use'](_0x2eff('0x60'),require('./api/pause'));_0x17aba8['use'](_0x2eff('0x61'),require(_0x2eff('0x62')));_0x17aba8['use'](_0x2eff('0x63'),require(_0x2eff('0x64')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x65'),require(_0x2eff('0x66')));_0x17aba8['use'](_0x2eff('0x67'),require(_0x2eff('0x68')));_0x17aba8['use']('/api/tags',require(_0x2eff('0x69')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x6a'),require(_0x2eff('0x6b')));_0x17aba8[_0x2eff('0x3')]('/api/cm_contact_has_items',require(_0x2eff('0x6c')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x6d'),require(_0x2eff('0x6e')));_0x17aba8['use'](_0x2eff('0x6f'),require(_0x2eff('0x70')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x71'),require(_0x2eff('0x72')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x73'),require('./api/variable'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x74'),require(_0x2eff('0x75')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x76'),require(_0x2eff('0x77')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x78'),require(_0x2eff('0x79')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x7a'),require(_0x2eff('0x7b')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x7c'),require(_0x2eff('0x7d')));_0x17aba8['use'](_0x2eff('0x7e'),require(_0x2eff('0x7f')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x80'),require(_0x2eff('0x81')));_0x17aba8[_0x2eff('0x3')]('/api/analytics/tree_reports',require(_0x2eff('0x82')));_0x17aba8[_0x2eff('0x3')]('/api/integrations/salesforce/accounts',require(_0x2eff('0x83')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x84'),require(_0x2eff('0x85')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x86'),require('./api/intSalesforceField'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x87'),require(_0x2eff('0x88')));_0x17aba8[_0x2eff('0x3')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x17aba8[_0x2eff('0x3')]('/api/integrations/sugarcrm/fields',require(_0x2eff('0x89')));_0x17aba8[_0x2eff('0x3')]('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x8a'),require(_0x2eff('0x8b')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x8c'),require(_0x2eff('0x8d')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x8e'),require('./api/intZohoAccount'));_0x17aba8['use'](_0x2eff('0x8f'),require(_0x2eff('0x90')));_0x17aba8[_0x2eff('0x3')]('/api/integrations/zoho/fields',require(_0x2eff('0x91')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x92'),require('./api/intZendeskAccount'));_0x17aba8['use'](_0x2eff('0x93'),require(_0x2eff('0x94')));_0x17aba8[_0x2eff('0x3')]('/api/integrations/zendesk/fields',require(_0x2eff('0x95')));_0x17aba8['use'](_0x2eff('0x96'),require('./api/intFreshdeskAccount'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x97'),require(_0x2eff('0x98')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x99'),require(_0x2eff('0x9a')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x9b'),require(_0x2eff('0x9c')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x9d'),require(_0x2eff('0x9e')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0x9f'),require(_0x2eff('0xa0')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xa1'),require(_0x2eff('0xa2')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xa3'),require(_0x2eff('0xa4')));_0x17aba8['use'](_0x2eff('0xa5'),require(_0x2eff('0xa6')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xa7'),require('./api/intDynamics365Account'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xa8'),require('./api/intDynamics365Configuration'));_0x17aba8[_0x2eff('0x3')]('/api/integrations/dynamics365/fields',require(_0x2eff('0xa9')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xaa'),require(_0x2eff('0xab')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xac'),require(_0x2eff('0xad')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xae'),require(_0x2eff('0xaf')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xb0'),require(_0x2eff('0xb1')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xb2'),require(_0x2eff('0xb3')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xb4'),require(_0x2eff('0xb5')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xb6'),require(_0x2eff('0xb7')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xb8'),require('./api/jscriptyQuestionReport'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xb9'),require('./api/jscriptySessionReport'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xba'),require(_0x2eff('0xbb')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xbc'),require(_0x2eff('0xbd')));_0x17aba8[_0x2eff('0x3')]('/api/square/details/reports',require('./api/squareReportDetail'));_0x17aba8['use'](_0x2eff('0xbe'),require(_0x2eff('0xbf')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xc0'),require(_0x2eff('0xc1')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xc2'),require(_0x2eff('0xc3')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xc4'),require('./api/squareProject'));_0x17aba8['use'](_0x2eff('0xc5'),require(_0x2eff('0xc6')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xc7'),require(_0x2eff('0xc8')));_0x17aba8[_0x2eff('0x3')]('/api/teams',require('./api/team'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xc9'),require('./api/license'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xca'),require(_0x2eff('0xcb')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xcc'),require(_0x2eff('0xcd')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xce'),require('./api/attachment'));_0x17aba8['use'](_0x2eff('0xcf'),require('./api/plugin'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xd0'),require(_0x2eff('0xd1')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xd2'),require(_0x2eff('0xd3')));_0x17aba8['use'](_0x2eff('0xd4'),require('./api/faxTransferReport'));_0x17aba8[_0x2eff('0x3')]('/api/openchannel/reports/transfer',require(_0x2eff('0xd5')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xd6'),require(_0x2eff('0xd7')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xd8'),require(_0x2eff('0xd9')));_0x17aba8['use']('/api/voice/prefixes',require('./api/voicePrefix'));_0x17aba8[_0x2eff('0x3')]('/api/userProfiles',require('./api/userProfile'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xda'),require('./api/userProfileSection'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xdb'),require(_0x2eff('0xdc')));_0x17aba8[_0x2eff('0x3')]('/api/userNotifications',require(_0x2eff('0xdd')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xde'),require('./api/whatsappAccount'));_0x17aba8[_0x2eff('0x3')]('/api/whatsapp/applications',require(_0x2eff('0xdf')));_0x17aba8[_0x2eff('0x3')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xe0'),require(_0x2eff('0xe1')));_0x17aba8['use']('/api/whatsapp/reports/queue',require(_0x2eff('0xe2')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xe3'),require(_0x2eff('0xe4')));_0x17aba8['use'](_0x2eff('0xe5'),require('./api/whatsappQueue'));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xe6'),require(_0x2eff('0xe7')));_0x17aba8['use'](_0x2eff('0xe8'),require('./api/realtime'));_0x17aba8['use'](_0x2eff('0xe9'),require(_0x2eff('0xea')));_0x17aba8[_0x2eff('0x3')]('/api/mail_interaction_has_tags',require('./api/mailInteractionHasTag'));_0x17aba8['use'](_0x2eff('0xeb'),require('./api/authLocal'));_0x17aba8[_0x2eff('0x3')]('/api/auth/google',require(_0x2eff('0xec')));_0x17aba8['use']('/api/auth/activedirectory',require(_0x2eff('0xed')));_0x17aba8['use'](_0x2eff('0xee'),require(_0x2eff('0xef')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xf0'),require(_0x2eff('0xf1')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xf2'),require(_0x2eff('0xf3')));_0x17aba8['use'](_0x2eff('0xf4'),require(_0x2eff('0xf5')));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xf6'),require('./api/pm2'));_0x17aba8['use'](_0x2eff('0xf7'),require(_0x2eff('0xf8')));_0x17aba8[_0x2eff('0x3')]('/api/logs',clientSideLogs);_0x17aba8[_0x2eff('0x3')]('/apidoc',express[_0x2eff('0xf9')](path[_0x2eff('0xfa')](config[_0x2eff('0xfb')],_0x2eff('0xfc'))));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xfd'),express[_0x2eff('0xf9')](path[_0x2eff('0xfa')](config[_0x2eff('0xfb')],_0x2eff('0xfd'))));_0x17aba8[_0x2eff('0x3')]('/demo',express[_0x2eff('0xf9')](path[_0x2eff('0xfa')](config[_0x2eff('0xfb')],_0x2eff('0xfe'))));_0x17aba8[_0x2eff('0x3')](_0x2eff('0xff'),express[_0x2eff('0xf9')](path[_0x2eff('0xfa')](config[_0x2eff('0xfb')],_0x2eff('0x100'),_0x2eff('0x101'))));_0x17aba8['use'](_0x2eff('0x102'),express['static'](path['join'](config['root'],_0x2eff('0x103'))));_0x17aba8[_0x2eff('0x104')](_0x2eff('0x105'))[_0x2eff('0x106')](errors[0x194]);_0x17aba8['route']('/*')[_0x2eff('0x106')](function(_0x331d0d,_0x4d1d6f){_0x4d1d6f[_0x2eff('0x107')](path[_0x2eff('0x108')](_0x17aba8[_0x2eff('0x106')](_0x2eff('0x109'))+'/index.html'));});return _0x17aba8;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index f00afc6..2600f11 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b89=['../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','../config/triggers','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/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/pause/pause.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x1b89,0xd4));var _0x91b8=function(_0x5edafc,_0x22002c){_0x5edafc=_0x5edafc-0x0;var _0x1fa600=_0x1b89[_0x5edafc];return _0x1fa600;};'use strict';var jayson=require(_0x91b8('0x0'));var _=require(_0x91b8('0x1'));var config=require(_0x91b8('0x2'));exports[_0x91b8('0x3')]=function(){return new Promise(function(_0x51c82d,_0x7070bd){var _0x24970e={};_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x5')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x6')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x7')));_0x24970e=_['merge'](_0x24970e,require('../api/voiceRecording/voiceRecording.rpc'));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x8')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x9')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0xa')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0xb')));_0x24970e=_['merge'](_0x24970e,require(_0x91b8('0xc')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/trunk/trunk.rpc'));_0x24970e=_['merge'](_0x24970e,require(_0x91b8('0xd')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0xe')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/mailServerIn/mailServerIn.rpc'));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0xf')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x10')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x11')));_0x24970e=_['merge'](_0x24970e,require(_0x91b8('0x12')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x13')));_0x24970e=_['merge'](_0x24970e,require(_0x91b8('0x14')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x15')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x16')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/faxInteraction/faxInteraction.rpc'));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x17')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/faxQueue/faxQueue.rpc'));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x18')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/smsAccount/smsAccount.rpc'));_0x24970e=_['merge'](_0x24970e,require('../api/smsInteraction/smsInteraction.rpc'));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/smsMessage/smsMessage.rpc'));_0x24970e=_['merge'](_0x24970e,require('../api/smsQueue/smsQueue.rpc'));_0x24970e=_['merge'](_0x24970e,require(_0x91b8('0x19')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x24970e=_['merge'](_0x24970e,require(_0x91b8('0x1a')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x1b')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x1c')));_0x24970e=_['merge'](_0x24970e,require(_0x91b8('0x1d')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x1e')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x1f')));_0x24970e=_['merge'](_0x24970e,require(_0x91b8('0x20')));_0x24970e=_['merge'](_0x24970e,require('../api/cmHopper/cmHopper.rpc'));_0x24970e=_['merge'](_0x24970e,require(_0x91b8('0x21')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x22')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x24970e=_['merge'](_0x24970e,require('../api/interval/interval.rpc'));_0x24970e=_['merge'](_0x24970e,require(_0x91b8('0x23')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/sound/sound.rpc'));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x24')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x25')));_0x24970e=_['merge'](_0x24970e,require(_0x91b8('0x26')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x27')));_0x24970e=_['merge'](_0x24970e,require(_0x91b8('0x28')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x29')));_0x24970e=_['merge'](_0x24970e,require(_0x91b8('0x2a')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x2b')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x2c')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x2d')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x2e')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x2f')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/squareReport/squareReport.rpc'));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x30')));_0x24970e=_['merge'](_0x24970e,require(_0x91b8('0x31')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x32')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x33')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/squareRecording/squareRecording.rpc'));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/squareMessage/squareMessage.rpc'));_0x24970e=_['merge'](_0x24970e,require(_0x91b8('0x34')));_0x24970e=_['merge'](_0x24970e,require(_0x91b8('0x35')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/plugin/plugin.rpc'));_0x24970e=_['merge'](_0x24970e,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x36')));_0x24970e=_[_0x91b8('0x4')](_0x24970e,require(_0x91b8('0x37')));var _0xa1b59e=jayson[_0x91b8('0x38')](_0x24970e)[_0x91b8('0x39')]();var _0x38f4c3=config[_0x91b8('0x3a')][_0x91b8('0x3b')]||config[_0x91b8('0x3b')]+0x1;var _0x1843f3=config[_0x91b8('0x3a')]['ip']||_0x91b8('0x3c');_0xa1b59e['on'](_0x91b8('0x3d'),function(_0x47b1db){return _0x7070bd(_0x47b1db);});_0xa1b59e['listen'](_0x38f4c3,_0x1843f3,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x1843f3,_0x38f4c3);require(_0x91b8('0x3e'))[_0x91b8('0x3f')]();return _0x51c82d(_0x91b8('0x40')+_0x1843f3+':'+_0x38f4c3);});});}; \ No newline at end of file +var _0x7f4b=['../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.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/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.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/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','../config/environment','listen','merge','../api/user/user.rpc'];(function(_0x379799,_0x4ccf16){var _0x46e431=function(_0x34bd4d){while(--_0x34bd4d){_0x379799['push'](_0x379799['shift']());}};_0x46e431(++_0x4ccf16);}(_0x7f4b,0x154));var _0xb7f4=function(_0x545150,_0x2c2b6c){_0x545150=_0x545150-0x0;var _0xff7fd6=_0x7f4b[_0x545150];return _0xff7fd6;};'use strict';var jayson=require('jayson/promise');var _=require(_0xb7f4('0x0'));var config=require(_0xb7f4('0x1'));exports[_0xb7f4('0x2')]=function(){return new Promise(function(_0x28dad7,_0x284782){var _0x409675={};_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x4')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x5')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x6')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/voiceRecording/voiceRecording.rpc'));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x7')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x8')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x9')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0xa')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0xb')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0xc')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/mailAccount/mailAccount.rpc'));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0xd')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0xe')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/mailMessage/mailMessage.rpc'));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0xf')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x10')));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0x11')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x12')));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0x13')));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0x14')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x15')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0x16')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x17')));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0x18')));_0x409675=_['merge'](_0x409675,require('../api/smsQueue/smsQueue.rpc'));_0x409675=_['merge'](_0x409675,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x19')));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0x1a')));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0x1b')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x1c')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x1d')));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0x1e')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/chatQueue/chatQueue.rpc'));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x1f')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/cmHopper/cmHopper.rpc'));_0x409675=_['merge'](_0x409675,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x20')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x21')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x22')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x23')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/pause/pause.rpc'));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x24')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x25')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x26')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/trigger/trigger.rpc'));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x27')));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0x28')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x29')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0x2a')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x2b')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x2c')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x2d')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x2e')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0x2f')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x30')));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0x31')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/setting/setting.rpc'));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x32')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x33')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/squareRecording/squareRecording.rpc'));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0x34')));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0x35')));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0x36')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x37')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x409675=_[_0xb7f4('0x3')](_0x409675,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x38')));_0x409675=_['merge'](_0x409675,require(_0xb7f4('0x39')));_0x409675=_[_0xb7f4('0x3')](_0x409675,require(_0xb7f4('0x3a')));var _0x475060=jayson[_0xb7f4('0x3b')](_0x409675)[_0xb7f4('0x3c')]();var _0x2a1755=config[_0xb7f4('0x3d')][_0xb7f4('0x3e')]||config['port']+0x1;var _0x3b32f2=config[_0xb7f4('0x3d')]['ip']||'localhost';_0x475060['on'](_0xb7f4('0x3f'),function(_0x4398e2){return _0x284782(_0x4398e2);});_0x475060['listen'](_0x2a1755,_0x3b32f2,function(){console[_0xb7f4('0x40')](_0xb7f4('0x41'),_0x3b32f2,_0x2a1755);require(_0xb7f4('0x42'))[_0xb7f4('0x43')]();return _0x28dad7(_0xb7f4('0x44')+_0x3b32f2+':'+_0x2a1755);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 6584a51..0ae8279 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 _0x4a41=['emit','ready','line','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','command','inherits','prototype','sendRequest','answer','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','wav','BEEP','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','EventEmitter','./reply','./error','call','utf8','setTimeout','headers'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x4a41,0x1b8));var _0x14a4=function(_0x514ba6,_0x27815c){_0x514ba6=_0x514ba6-0x0;var _0x43d9d7=_0x4a41[_0x514ba6];return _0x43d9d7;};'use strict';var util=require(_0x14a4('0x0'));var _=require(_0x14a4('0x1'));var EventEmitter=require(_0x14a4('0x2'))[_0x14a4('0x3')];var AGIReply=require(_0x14a4('0x4'));var AGIError=require(_0x14a4('0x5'));function AGIChannel(_0x2b175e){var _0x1d9e01=this,_0x3a53ca=new AGIReply(),_0x3c7802=![],_0x4c2b43={};EventEmitter[_0x14a4('0x6')](_0x1d9e01);_0x2b175e['setEncoding'](_0x14a4('0x7'));_0x2b175e[_0x14a4('0x8')](0x8*0x3c*0x3c*0x3e8);_0x3a53ca['setEncoding'](_0x14a4('0x7'));_0x3a53ca['on'](_0x14a4('0x9'),function(_0x4c3eb2){for(var _0x593323 in _0x4c3eb2){_0x1d9e01[_0x593323]=_0x4c3eb2[_0x593323];}_0x1d9e01[_0x14a4('0xa')](_0x14a4('0xb'));});_0x3a53ca['on'](_0x14a4('0xc'),function(_0x5b4edd){if(_0x5b4edd[_0x14a4('0xd')]()=='hangup'){_0x1d9e01[_0x14a4('0xa')](_0x14a4('0xe'));return;}if(_0x5b4edd['substring'](0x0,0xb)=='520-Invalid'){_0x3c7802=!![];}if(_0x3c7802){_0x4c2b43['rx']+=_0x5b4edd+'\x0a';if(_0x5b4edd[_0x14a4('0xf')](_0x14a4('0x10'))!=-0x1){_0x3c7802=![];}}else{_0x4c2b43['rx']=_0x5b4edd;}if(_0x3c7802){return;}if(typeof _0x4c2b43['cb']==_0x14a4('0x11')){var _0x54bd98=_0x4c2b43['rx'][_0x14a4('0x12')](0x0,0x3),_0x43cbf3=null,_0x4346d3=null;_0x54bd98=parseInt(_0x54bd98);if(isNaN(_0x54bd98)){_0x4c2b43['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x14a4('0x13')});return;}if(_0x54bd98!=0xc8){_0x4c2b43['cb'](null,{'code':_0x54bd98,'result':-0x1,'extra':'KO'});return;}_0x43cbf3=_0x4c2b43['rx'][_0x14a4('0x12')](0x4)[_0x14a4('0x14')]('result=','');if(_0x43cbf3[_0x14a4('0x15')]('\x20')!=-0x1){_0x43cbf3=_0x43cbf3[_0x14a4('0x16')](0x0,_0x43cbf3[_0x14a4('0x15')]('\x20'));}if(_[_0x14a4('0x17')](_0x43cbf3,'-1')){_0x43cbf3=parseInt(_0x43cbf3);}_0x4346d3=_0x4c2b43['rx'][_0x14a4('0x18')]('\x20');if(_0x4346d3[_0x14a4('0x19')]==0x3){_0x4346d3=_0x4346d3[0x2][_0x14a4('0x12')](0x1,_0x4346d3[0x2][_0x14a4('0x19')]-0x1);}else if(_0x4346d3[_0x14a4('0x19')]>0x3){var _0x194af9=/\((.+)\)/;var _0x13f448=_0x4c2b43['rx'][_0x14a4('0x1a')](_0x194af9);if(_0x13f448){_0x4346d3=_0x13f448[0x1];}else{_0x4346d3=null;}}else{_0x4346d3=null;}_0x4c2b43['cb'](null,{'code':_0x54bd98,'result':_0x43cbf3,'extra':_0x4346d3});}});_0x2b175e['on']('error',function(_0x4c51e6){_0x1d9e01[_0x14a4('0xa')](_0x14a4('0x1b'),new AGIError(_0x14a4('0x1c'),_0x4c51e6[_0x14a4('0x1d')]));});_0x2b175e['on'](_0x14a4('0x1e'),function(){_0x1d9e01[_0x14a4('0xa')](_0x14a4('0x1e'),new AGIError(_0x14a4('0x1f')));});_0x2b175e['on'](_0x14a4('0x20'),function(){_0x1d9e01['emit'](_0x14a4('0x20'),new AGIError(_0x14a4('0x21')));_0x2b175e[_0x14a4('0x22')]();});_0x2b175e['pipe'](_0x3a53ca);this[_0x14a4('0x23')]=function(_0x1510bb,_0x50b2d8){var _0x1510bb=_0x1510bb||'',_0x50b2d8=typeof _0x50b2d8=='function'?_0x50b2d8:new Function();_0x4c2b43={'tx':_0x1510bb,'rx':'','cb':_0x50b2d8};_0x2b175e['write'](_0x1510bb+'\x0a');},this[_0x14a4('0x1e')]=function(){_0x2b175e[_0x14a4('0x22')]();};}util[_0x14a4('0x24')](AGIChannel,EventEmitter);AGIChannel[_0x14a4('0x25')][_0x14a4('0x26')]=function(_0x4376dc){return this[_0x14a4('0x23')]['sync'](this,_0x4376dc);};AGIChannel['prototype'][_0x14a4('0x27')]=function(){return this[_0x14a4('0x26')](_0x14a4('0x28'));};AGIChannel[_0x14a4('0x25')][_0x14a4('0x29')]=function(_0x1e139c,_0x1fbfa7,_0x2edeb2){_0x1e139c=_0x1e139c===undefined?'beep':_0x1e139c;_0x1fbfa7=_0x1fbfa7===undefined?'5':_0x1fbfa7;_0x2edeb2=_0x2edeb2===undefined?'1':_0x2edeb2;return this['sendRequest'](util[_0x14a4('0x2a')](_0x14a4('0x2b'),_0x1e139c,_0x1fbfa7*0x3e8,_0x2edeb2));};AGIChannel['prototype'][_0x14a4('0x2c')]=function(_0x2706d7){_0x2706d7=_0x2706d7||'NO\x20MESSAGE';return this[_0x14a4('0x26')](util[_0x14a4('0x2a')](_0x14a4('0x2d'),_0x2706d7));};AGIChannel['prototype'][_0x14a4('0x2e')]=function(_0x380e0f,_0x28b1f1){if(_[_0x14a4('0x2f')](_0x28b1f1)){return this[_0x14a4('0x26')](util[_0x14a4('0x2a')](_0x14a4('0x30'),_0x380e0f,_0x28b1f1[_0x14a4('0x31')](',')));}return this[_0x14a4('0x26')](util[_0x14a4('0x2a')](_0x14a4('0x30'),_0x380e0f,_0x28b1f1));};AGIChannel[_0x14a4('0x25')][_0x14a4('0x32')]=function(_0x22f0d8){return this[_0x14a4('0x26')](util[_0x14a4('0x2a')]('SET\x20CONTEXT\x20%s',_0x22f0d8));};AGIChannel[_0x14a4('0x25')][_0x14a4('0x33')]=function(_0x34f8db){return this[_0x14a4('0x26')](util[_0x14a4('0x2a')](_0x14a4('0x34'),_0x34f8db));};AGIChannel[_0x14a4('0x25')][_0x14a4('0x35')]=function(_0x21ba88){return this[_0x14a4('0x26')](util[_0x14a4('0x2a')](_0x14a4('0x36'),_0x21ba88));};AGIChannel[_0x14a4('0x25')][_0x14a4('0xe')]=function(){return this[_0x14a4('0x26')](_0x14a4('0x37'));};AGIChannel[_0x14a4('0x25')]['setVariable']=function(_0x13b8c1,_0x53b306){var _0x53b584=_[_0x14a4('0x38')](_0x53b306)||_[_0x14a4('0x39')](_0x53b306)?_0x53b306[_0x14a4('0x3a')]():_0x53b306;return this[_0x14a4('0x26')](util[_0x14a4('0x2a')](_0x14a4('0x3b'),_0x13b8c1,_0x53b584?_0x53b584[_0x14a4('0x3a')]()[_0x14a4('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x14a4('0x25')][_0x14a4('0x3c')]=function(_0x35acd8,_0x31c296){return this[_0x14a4('0x26')](util[_0x14a4('0x2a')]('SAY\x20NUMBER\x20%s\x20%s',_0x35acd8,_0x31c296));};AGIChannel[_0x14a4('0x25')][_0x14a4('0x3d')]=function(_0x16552e,_0x5a934d){return this[_0x14a4('0x26')](util[_0x14a4('0x2a')](_0x14a4('0x3e'),_0x16552e,_0x5a934d));};AGIChannel['prototype']['sayPhonetic']=function(_0x2344a7,_0x38dfa0){return this[_0x14a4('0x26')](util[_0x14a4('0x2a')](_0x14a4('0x3f'),_0x2344a7,_0x38dfa0));};AGIChannel[_0x14a4('0x25')][_0x14a4('0x40')]=function(_0x1ddd6c,_0x528dc3,_0x40001f){_0x528dc3=_0x528dc3||this[_0x14a4('0x41')];_0x40001f=_0x40001f||0x1;this[_0x14a4('0x32')](_0x1ddd6c);this[_0x14a4('0x33')](_0x528dc3);this[_0x14a4('0x35')](_0x40001f);return this[_0x14a4('0x2c')](util[_0x14a4('0x2a')](_0x14a4('0x42'),_0x1ddd6c,_0x528dc3,_0x40001f));};AGIChannel[_0x14a4('0x25')][_0x14a4('0x43')]=function(_0x2d19e5){return this[_0x14a4('0x26')](util[_0x14a4('0x2a')]('GET\x20VARIABLE\x20\x22%s\x22',_0x2d19e5));};AGIChannel[_0x14a4('0x25')]['recordFile']=function(_0x2fb7c9,_0x4a4457,_0x463b84,_0x1339ef,_0x1df0f3,_0x596c01){_0x4a4457=_0x4a4457||_0x14a4('0x44');_0x463b84=_0x463b84||'';_0x1339ef=_0x1339ef===undefined?-0x1:_0x1339ef==='-1'?-0x1:_0x1339ef*0x3e8;_0x1df0f3=_0x1df0f3===undefined?'':'s='+_0x1df0f3;_0x596c01=_0x596c01?_0x14a4('0x45'):'';return this[_0x14a4('0x26')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x2fb7c9,_0x4a4457,_0x463b84,_0x1339ef,_0x596c01,_0x1df0f3));};AGIChannel[_0x14a4('0x25')]['streamFile']=function(_0x3a543a,_0x32a9be){_0x32a9be=_0x32a9be||'';return this['sendRequest'](util[_0x14a4('0x2a')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x3a543a,_0x32a9be));};AGIChannel['prototype'][_0x14a4('0x46')]=function(_0x23042f){return this[_0x14a4('0x2e')](_0x14a4('0x47'),_0x23042f);};AGIChannel[_0x14a4('0x25')][_0x14a4('0x48')]=function(_0x384c8d){return this['exec']('WAIT',_0x384c8d);};AGIChannel['prototype'][_0x14a4('0x1b')]=function(_0x4b6df,_0x12ecb2){this[_0x14a4('0x2c')](util[_0x14a4('0x2a')](_0x14a4('0x49'),_0x4b6df['id'],_0x4b6df[_0x14a4('0x4a')],_0x12ecb2));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0xb1ef=['./reply','./error','setEncoding','utf8','setTimeout','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','inherits','prototype','sendRequest','sync','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','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isNumber','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0xb1ef,0x93));var _0xfb1e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ef[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xfb1e('0x0'));var _=require(_0xfb1e('0x1'));var EventEmitter=require('events')[_0xfb1e('0x2')];var AGIReply=require(_0xfb1e('0x3'));var AGIError=require(_0xfb1e('0x4'));function AGIChannel(_0x2c7116){var _0xb70c57=this,_0x1ce096=new AGIReply(),_0x477ee0=![],_0x4b7622={};EventEmitter['call'](_0xb70c57);_0x2c7116[_0xfb1e('0x5')](_0xfb1e('0x6'));_0x2c7116[_0xfb1e('0x7')](0x8*0x3c*0x3c*0x3e8);_0x1ce096[_0xfb1e('0x5')]('utf8');_0x1ce096['on']('headers',function(_0x3c7643){for(var _0x106367 in _0x3c7643){_0xb70c57[_0x106367]=_0x3c7643[_0x106367];}_0xb70c57[_0xfb1e('0x8')](_0xfb1e('0x9'));});_0x1ce096['on'](_0xfb1e('0xa'),function(_0x2fbf8d){if(_0x2fbf8d[_0xfb1e('0xb')]()==_0xfb1e('0xc')){_0xb70c57['emit'](_0xfb1e('0xc'));return;}if(_0x2fbf8d[_0xfb1e('0xd')](0x0,0xb)==_0xfb1e('0xe')){_0x477ee0=!![];}if(_0x477ee0){_0x4b7622['rx']+=_0x2fbf8d+'\x0a';if(_0x2fbf8d[_0xfb1e('0xf')](_0xfb1e('0x10'))!=-0x1){_0x477ee0=![];}}else{_0x4b7622['rx']=_0x2fbf8d;}if(_0x477ee0){return;}if(typeof _0x4b7622['cb']==_0xfb1e('0x11')){var _0x2f7b2e=_0x4b7622['rx'][_0xfb1e('0xd')](0x0,0x3),_0x4f33f8=null,_0x30b991=null;_0x2f7b2e=parseInt(_0x2f7b2e);if(isNaN(_0x2f7b2e)){_0x4b7622['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x2f7b2e!=0xc8){_0x4b7622['cb'](null,{'code':_0x2f7b2e,'result':-0x1,'extra':'KO'});return;}_0x4f33f8=_0x4b7622['rx'][_0xfb1e('0xd')](0x4)[_0xfb1e('0x12')](_0xfb1e('0x13'),'');if(_0x4f33f8[_0xfb1e('0x14')]('\x20')!=-0x1){_0x4f33f8=_0x4f33f8[_0xfb1e('0x15')](0x0,_0x4f33f8['indexOf']('\x20'));}if(_[_0xfb1e('0x16')](_0x4f33f8,'-1')){_0x4f33f8=parseInt(_0x4f33f8);}_0x30b991=_0x4b7622['rx'][_0xfb1e('0x17')]('\x20');if(_0x30b991[_0xfb1e('0x18')]==0x3){_0x30b991=_0x30b991[0x2][_0xfb1e('0xd')](0x1,_0x30b991[0x2][_0xfb1e('0x18')]-0x1);}else if(_0x30b991['length']>0x3){var _0x2f3d7e=/\((.+)\)/;var _0x3cf40c=_0x4b7622['rx'][_0xfb1e('0x19')](_0x2f3d7e);if(_0x3cf40c){_0x30b991=_0x3cf40c[0x1];}else{_0x30b991=null;}}else{_0x30b991=null;}_0x4b7622['cb'](null,{'code':_0x2f7b2e,'result':_0x4f33f8,'extra':_0x30b991});}});_0x2c7116['on'](_0xfb1e('0x1a'),function(_0x2b0116){_0xb70c57['emit'](_0xfb1e('0x1a'),new AGIError(_0xfb1e('0x1b'),_0x2b0116[_0xfb1e('0x1c')]));});_0x2c7116['on'](_0xfb1e('0x1d'),function(){_0xb70c57[_0xfb1e('0x8')]('close',new AGIError(_0xfb1e('0x1e')));});_0x2c7116['on']('timeout',function(){_0xb70c57['emit'](_0xfb1e('0x1f'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x2c7116[_0xfb1e('0x20')]();});_0x2c7116[_0xfb1e('0x21')](_0x1ce096);this[_0xfb1e('0x22')]=function(_0x484d67,_0x548dc0){var _0x484d67=_0x484d67||'',_0x548dc0=typeof _0x548dc0==_0xfb1e('0x11')?_0x548dc0:new Function();_0x4b7622={'tx':_0x484d67,'rx':'','cb':_0x548dc0};_0x2c7116[_0xfb1e('0x23')](_0x484d67+'\x0a');},this[_0xfb1e('0x1d')]=function(){_0x2c7116[_0xfb1e('0x20')]();};}util[_0xfb1e('0x24')](AGIChannel,EventEmitter);AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x26')]=function(_0x4e24e3){return this[_0xfb1e('0x22')][_0xfb1e('0x27')](this,_0x4e24e3);};AGIChannel[_0xfb1e('0x25')]['answer']=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x28')]=function(_0x20826c,_0x4412d0,_0x3108b6){_0x20826c=_0x20826c===undefined?_0xfb1e('0x29'):_0x20826c;_0x4412d0=_0x4412d0===undefined?'5':_0x4412d0;_0x3108b6=_0x3108b6===undefined?'1':_0x3108b6;return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x2b'),_0x20826c,_0x4412d0*0x3e8,_0x3108b6));};AGIChannel['prototype'][_0xfb1e('0x2c')]=function(_0x2dfa98){_0x2dfa98=_0x2dfa98||_0xfb1e('0x2d');return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x2e'),_0x2dfa98));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x2f')]=function(_0x55a618,_0x35f2f3){if(_[_0xfb1e('0x30')](_0x35f2f3)){return this[_0xfb1e('0x26')](util['format'](_0xfb1e('0x31'),_0x55a618,_0x35f2f3['join'](',')));}return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x31'),_0x55a618,_0x35f2f3));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x32')]=function(_0x3fff90){return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x33'),_0x3fff90));};AGIChannel['prototype'][_0xfb1e('0x34')]=function(_0x13b590){return this['sendRequest'](util[_0xfb1e('0x2a')](_0xfb1e('0x35'),_0x13b590));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x36')]=function(_0x8c628f){return this[_0xfb1e('0x26')](util['format']('SET\x20PRIORITY\x20%s',_0x8c628f));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0xc')]=function(){return this['sendRequest'](_0xfb1e('0x37'));};AGIChannel['prototype'][_0xfb1e('0x38')]=function(_0x3fc4de,_0x573bcc){var _0x2b375a=_['isBoolean'](_0x573bcc)||_[_0xfb1e('0x39')](_0x573bcc)?_0x573bcc[_0xfb1e('0x3a')]():_0x573bcc;return this[_0xfb1e('0x26')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x3fc4de,_0x2b375a?_0x2b375a[_0xfb1e('0x3a')]()[_0xfb1e('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xfb1e('0x25')]['sayNumber']=function(_0x54e3d2,_0x33514d){return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x3b'),_0x54e3d2,_0x33514d));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x3c')]=function(_0x35c2ae,_0x4eb62c){return this['sendRequest'](util[_0xfb1e('0x2a')](_0xfb1e('0x3d'),_0x35c2ae,_0x4eb62c));};AGIChannel[_0xfb1e('0x25')]['sayPhonetic']=function(_0x220512,_0x166558){return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x220512,_0x166558));};AGIChannel[_0xfb1e('0x25')]['continueAt']=function(_0x371a1e,_0x4800a3,_0x4787a0){_0x4800a3=_0x4800a3||this[_0xfb1e('0x3e')];_0x4787a0=_0x4787a0||0x1;this['setContext'](_0x371a1e);this[_0xfb1e('0x34')](_0x4800a3);this[_0xfb1e('0x36')](_0x4787a0);return this[_0xfb1e('0x2c')](util[_0xfb1e('0x2a')](_0xfb1e('0x3f'),_0x371a1e,_0x4800a3,_0x4787a0));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x40')]=function(_0xa8f62d){return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x41'),_0xa8f62d));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x42')]=function(_0x5c423b,_0x3a935e,_0x366f46,_0x310655,_0x5c7bf3,_0x2770fd){_0x3a935e=_0x3a935e||'wav';_0x366f46=_0x366f46||'';_0x310655=_0x310655===undefined?-0x1:_0x310655==='-1'?-0x1:_0x310655*0x3e8;_0x5c7bf3=_0x5c7bf3===undefined?'':'s='+_0x5c7bf3;_0x2770fd=_0x2770fd?_0xfb1e('0x43'):'';return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x44'),_0x5c423b,_0x3a935e,_0x366f46,_0x310655,_0x2770fd,_0x5c7bf3));};AGIChannel[_0xfb1e('0x25')]['streamFile']=function(_0x2c80b7,_0x54d3e7){_0x54d3e7=_0x54d3e7||'';return this[_0xfb1e('0x26')](util['format'](_0xfb1e('0x45'),_0x2c80b7,_0x54d3e7));};AGIChannel[_0xfb1e('0x25')]['agi']=function(_0x2ff83e){return this[_0xfb1e('0x2f')]('AGI',_0x2ff83e);};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x46')]=function(_0x3da297){return this[_0xfb1e('0x2f')](_0xfb1e('0x47'),_0x3da297);};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x1a')]=function(_0x364b37,_0x51d055){this[_0xfb1e('0x2c')](util[_0xfb1e('0x2a')](_0xfb1e('0x48'),_0x364b37['id'],_0x364b37[_0xfb1e('0x49')],_0x51d055));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xfb1e('0x4a')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 1dc92a2..7ddaf53 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 _0xaf9a=['[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.'];(function(_0x3215ce,_0x2b0394){var _0x1150e5=function(_0x28e183){while(--_0x28e183){_0x3215ce['push'](_0x3215ce['shift']());}};_0x1150e5(++_0x2b0394);}(_0xaf9a,0x13e));var _0xaaf9=function(_0x36b350,_0x194820){_0x36b350=_0x36b350-0x0;var _0x3578f6=_0xaf9a[_0x36b350];return _0x3578f6;};'use strict';var util=require(_0xaaf9('0x0'));var error={'E_AGI_UNDEFINED':_0xaaf9('0x1'),'E_AGI_ARGUMENT_PORT':_0xaaf9('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xaaf9('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xaaf9('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xaaf9('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xaaf9('0x6'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xaaf9('0x7'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x2f8188){var _0x2f8188=_0x2f8188||null,_0x2f9de9=_0x2f9de9||[],_0x2ee6ae=0x1,_0x1d9020='';if(!error[_0x2f8188]){_0x2f8188=_0xaaf9('0x8');}_0x2f9de9['push'](error[_0x2f8188]);while(arguments[_0x2ee6ae]){_0x2f9de9[_0xaaf9('0x9')](arguments[_0x2ee6ae]);_0x2ee6ae++;}_0x1d9020=util['format'][_0xaaf9('0xa')](util,_0x2f9de9);this[_0xaaf9('0xb')]=_0x1d9020;this[_0xaaf9('0xc')]=_0x2f8188;}module[_0xaaf9('0xd')]=AGIError; \ No newline at end of file +var _0xe8b3=['Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','apply','message','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x508acd,_0x852c77){var _0x4e8524=function(_0x10ea09){while(--_0x10ea09){_0x508acd['push'](_0x508acd['shift']());}};_0x4e8524(++_0x852c77);}(_0xe8b3,0x1db));var _0x3e8b=function(_0x3bf03f,_0xbfd44){_0x3bf03f=_0x3bf03f-0x0;var _0x29dc98=_0xe8b3[_0x3bf03f];return _0x29dc98;};'use strict';var util=require(_0x3e8b('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x3e8b('0x1'),'E_AGI_SERVER_ERROR':_0x3e8b('0x2'),'E_AGI_SERVER_CLOSE':_0x3e8b('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x3e8b('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x3e8b('0x5'),'E_AGI_SOCKET_CLOSE':_0x3e8b('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x3e8b('0x7'),'E_AGI_COMMAND_EMPTY':_0x3e8b('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x3e8b('0x9'),'E_AGI_IVR_ENTRY':_0x3e8b('0xa')};function AGIError(_0x342f53){var _0x342f53=_0x342f53||null,_0x5897a6=_0x5897a6||[],_0x17c585=0x1,_0x22a194='';if(!error[_0x342f53]){_0x342f53='E_AGI_UNDEFINED';}_0x5897a6[_0x3e8b('0xb')](error[_0x342f53]);while(arguments[_0x17c585]){_0x5897a6[_0x3e8b('0xb')](arguments[_0x17c585]);_0x17c585++;}_0x22a194=util['format'][_0x3e8b('0xc')](util,_0x5897a6);this[_0x3e8b('0xd')]=_0x22a194;this['name']=_0x342f53;}module[_0x3e8b('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 203e9b8..6b749fe 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 _0x4f51=['ioredis','./error','../../config/environment','redis','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','exports','lodash','EventEmitter'];(function(_0x150e5d,_0x30ec0f){var _0x5a5f9f=function(_0x283c33){while(--_0x283c33){_0x150e5d['push'](_0x150e5d['shift']());}};_0x5a5f9f(++_0x30ec0f);}(_0x4f51,0xca));var _0x14f5=function(_0x175a55,_0x4082fd){_0x175a55=_0x175a55-0x0;var _0x167adf=_0x4f51[_0x175a55];return _0x167adf;};'use strict';var _=require(_0x14f5('0x0'));var EventEmitter=require('events')[_0x14f5('0x1')];var Redis=require(_0x14f5('0x2'));var AGIError=require(_0x14f5('0x3'));var config=require(_0x14f5('0x4'));config[_0x14f5('0x5')]=_['defaults'](config[_0x14f5('0x5')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0x14f5('0x6')](_0x14f5('0x7'),function(_0x5b2988){if(_0x5b2988)return eventEmitter[_0x14f5('0x8')](_0x14f5('0x9'),new AGIError(_0x14f5('0xa'),_0x5b2988));});sub['on']('message',function(_0xa65b30,_0x5e0b23){if(_0xa65b30!=='agi')return;try{var _0x5920f8=JSON['parse'](_0x5e0b23);eventEmitter[_0x14f5('0x8')]('projectUpdate',_0x5920f8);}catch(_0x5892bd){eventEmitter['emit'](_0x14f5('0x9'),new AGIError(_0x14f5('0xa'),_0x5892bd));}});module[_0x14f5('0xb')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x23c4=['redis','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','message','parse','projectUpdate','EventEmitter','./error','defaults'];(function(_0x3bab53,_0x46230f){var _0x1a969e=function(_0x15ecb1){while(--_0x15ecb1){_0x3bab53['push'](_0x3bab53['shift']());}};_0x1a969e(++_0x46230f);}(_0x23c4,0x1a1));var _0x423c=function(_0x67655b,_0x15ff31){_0x67655b=_0x67655b-0x0;var _0x71c09d=_0x23c4[_0x67655b];return _0x71c09d;};'use strict';var _=require('lodash');var EventEmitter=require('events')[_0x423c('0x0')];var Redis=require('ioredis');var AGIError=require(_0x423c('0x1'));var config=require('../../config/environment');config['redis']=_[_0x423c('0x2')](config['redis'],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x423c('0x3')]);sub[_0x423c('0x4')](_0x423c('0x5'),function(_0x2e3342){if(_0x2e3342)return eventEmitter[_0x423c('0x6')](_0x423c('0x7'),new AGIError(_0x423c('0x8'),_0x2e3342));});sub['on'](_0x423c('0x9'),function(_0x554e66,_0x51943c){if(_0x554e66!=='agi')return;try{var _0x3650d9=JSON[_0x423c('0xa')](_0x51943c);eventEmitter[_0x423c('0x6')](_0x423c('0xb'),_0x3650d9);}catch(_0x1ba407){eventEmitter[_0x423c('0x6')](_0x423c('0x7'),new AGIError(_0x423c('0x8'),_0x1ba407));}});module['exports']={'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 aeae4d9..77acaa1 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 _0x0bad=['length','no\x20edge/s\x20available','condition','split','vswitch','target','default','agicommand','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','numberOfEdges','prototype','addVertex','edges','addEdge','size','relations','traverseBFS','info','stop\x20traverse'];(function(_0x261127,_0x1aaf78){var _0x41d282=function(_0x430e75){while(--_0x430e75){_0x261127['push'](_0x261127['shift']());}};_0x41d282(++_0x1aaf78);}(_0x0bad,0x1b1));var _0xd0ba=function(_0x1b321e,_0x4a4092){_0x1b321e=_0x1b321e-0x0;var _0x5142ad=_0x0bad[_0x1b321e];return _0x5142ad;};'use strict';var _=require(_0xd0ba('0x0'));var logger=require(_0xd0ba('0x1'))(_0xd0ba('0x2'));var verticesWithRetry=[_0xd0ba('0x3'),_0xd0ba('0x4'),_0xd0ba('0x5')];var Graph=function(){this[_0xd0ba('0x6')]={};this['edges']={};this[_0xd0ba('0x7')]=0x0;};Graph[_0xd0ba('0x8')][_0xd0ba('0x9')]=function(_0x501ca2){this[_0xd0ba('0x6')][_0x501ca2['id']]=_0x501ca2;this[_0xd0ba('0xa')][_0x501ca2['id']]=[];};Graph[_0xd0ba('0x8')][_0xd0ba('0xb')]=function(_0x475375,_0x19b1d9,_0x5d0efa){this[_0xd0ba('0xa')][_0x475375]['push']({'target':_0x19b1d9,'condition':_0x5d0efa});this[_0xd0ba('0x7')]+=0x1;};Graph['prototype'][_0xd0ba('0xc')]=function(){return _[_0xd0ba('0xc')](this[_0xd0ba('0x6')]);};Graph[_0xd0ba('0x8')][_0xd0ba('0xd')]=function(){return this[_0xd0ba('0x7')];};Graph[_0xd0ba('0x8')]['getVertex']=function(_0x1ca345){return this[_0xd0ba('0x6')][_0x1ca345];};Graph[_0xd0ba('0x8')][_0xd0ba('0xe')]=function(_0x404d1a,_0x328263){if(!this[_0xd0ba('0x6')][_0x404d1a]){return logger[_0xd0ba('0xf')]('no\x20vertex\x20found');}var _0xeea616=_0x328263(this['vertices'][_0x404d1a]);if(!_0xeea616){return logger[_0xd0ba('0xf')](_0xd0ba('0x10'));}if(this[_0xd0ba('0xa')][_0x404d1a][_0xd0ba('0x11')]===0x0){return logger[_0xd0ba('0xf')](_0xd0ba('0x12'));}for(var _0x3c8cf3=0x0,_0x628c6f=[],_0x44bb77=![];_0x3c8cf3\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','uniqueid','info','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','finally','./server','listening','lodash','syncho','../../config/environment','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','projectUpdate'];(function(_0x327d0f,_0x2ad38b){var _0x5a1aba=function(_0x483797){while(--_0x483797){_0x327d0f['push'](_0x327d0f['shift']());}};_0x5a1aba(++_0x2ad38b);}(_0x0caa,0x158));var _0xa0ca=function(_0x1fa3a9,_0x25a3f9){_0x1fa3a9=_0x1fa3a9-0x0;var _0x1e31ff=_0x0caa[_0x1fa3a9];return _0x1e31ff;};'use strict';var _=require(_0xa0ca('0x0'));var syncho=require(_0xa0ca('0x1'));var util=require('util');var config=require(_0xa0ca('0x2'));var logger=require('../../config/logger')(_0xa0ca('0x3'));var utilLicense=require(_0xa0ca('0x4'));var rpc=require(_0xa0ca('0x5'));var Project=require(_0xa0ca('0x6'));var AGIEmitter=require(_0xa0ca('0x7'))[_0xa0ca('0x8')];var projects=[];config['agi']=_['defaults'](config[_0xa0ca('0x3')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0xa0ca('0x9'),projectUpdateHandler);function connectionHandler(_0x2e01e4){process[_0xa0ca('0xa')](function(){syncho(function(){try{setChannelVariables(_0x2e01e4);agiHandler(_0x2e01e4);}catch(_0xc23239){logger[_0xa0ca('0xb')](_0xc23239['stack']);}});});}function projectUpdateHandler(_0x280940){try{var _0x54b3c6=_[_0xa0ca('0xc')](projects,['id',_0x280940['id']]);if(_0x54b3c6>-0x1){if(_0x280940[_0xa0ca('0xd')]===!![]){projects[_0xa0ca('0xe')](_0x54b3c6,0x1);}else{projects[_0x54b3c6]=_0x280940;}}else{projects['push'](_0x280940);}}catch(_0x50f2db){logger['error'](_0x50f2db[_0xa0ca('0xf')]);}}function listeningHandler(){console['log'](_0xa0ca('0x10'),config[_0xa0ca('0x3')][_0xa0ca('0x11')]);logger['info'](util[_0xa0ca('0x12')](_0xa0ca('0x13'),config[_0xa0ca('0x3')]['ip'],config[_0xa0ca('0x3')][_0xa0ca('0x11')]));}function errorHandler(_0x2519c5){if(_0x2519c5&&_0x2519c5['name']&&_0x2519c5[_0xa0ca('0x14')]){logger['error'](util[_0xa0ca('0x12')](_0xa0ca('0x15'),_0x2519c5[_0xa0ca('0x16')],_0x2519c5[_0xa0ca('0x14')]));}else{logger['error'](util[_0xa0ca('0x12')]('[ERROR]\x20%s',_0x2519c5[_0xa0ca('0xf')]));}}function closeHandler(){logger['info'](util[_0xa0ca('0x12')](_0xa0ca('0x17'),this[_0xa0ca('0x18')],this['calleridname'],this[_0xa0ca('0x19')],this[_0xa0ca('0x1a')],this['uniqueid']));try{createSquareReport(this);}catch(_0x31b1a2){logger[_0xa0ca('0xb')](_0x31b1a2[_0xa0ca('0xf')]);}}function timeoutHandler(){logger['info'](util[_0xa0ca('0x12')](_0xa0ca('0x1b'),this[_0xa0ca('0x18')],this[_0xa0ca('0x1c')],this[_0xa0ca('0x19')],this[_0xa0ca('0x1a')],this[_0xa0ca('0x1d')]));}function hangupHandler(){logger[_0xa0ca('0x1e')](util[_0xa0ca('0x12')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0xa0ca('0x1c')],this[_0xa0ca('0x19')],this['dnid'],this['uniqueid']));this[_0xa0ca('0x1f')]=!![];}function createSquareReport(_0x3bfa5b,_0x221dbe){rpc[_0xa0ca('0x20')](_0x3bfa5b)[_0xa0ca('0x21')](function(_0x2f319a){if(_0x221dbe){_0x221dbe(null,_0x2f319a);}})[_0xa0ca('0x22')](function(_0x53cbff){if(_0x221dbe){_0x221dbe(null,_0x53cbff);}});}function setChannelVariables(_0x5071b2){for(var _0x48e907 in _0x5071b2){if(_0x5071b2[_0xa0ca('0x23')](_0x48e907)){if(_0x48e907[_0xa0ca('0x24')](_0xa0ca('0x25'))===0x0){_0x5071b2[_0x48e907[_0xa0ca('0x26')](0x4)]=_0x5071b2[_0x48e907];delete _0x5071b2[_0x48e907];}}}}function agiHandler(_0xa9487b){logger[_0xa0ca('0x27')](_0xa0ca('0x28'),JSON[_0xa0ca('0x29')](_0xa9487b,null,0x2));logger[_0xa0ca('0x1e')](util[_0xa0ca('0x12')](_0xa0ca('0x2a'),_0xa9487b['arg_1'],_0xa9487b[_0xa0ca('0x1c')],_0xa9487b[_0xa0ca('0x19')],_0xa9487b[_0xa0ca('0x1a')],_0xa9487b['uniqueid']));_0xa9487b['on']('error',errorHandler);_0xa9487b['on'](_0xa0ca('0x2b'),closeHandler);_0xa9487b['on'](_0xa0ca('0x2c'),timeoutHandler);_0xa9487b[_0xa0ca('0x1f')]=![];_0xa9487b['on']('hangup',hangupHandler);var _0x3b2c0a=_['find'](projects,[_0xa0ca('0x16'),_0xa9487b[_0xa0ca('0x18')]]);if(!_0x3b2c0a)return Project[_0xa0ca('0x2d')](_0xa9487b);if(!_0x3b2c0a[_0xa0ca('0x2e')])return Project[_0xa0ca('0x2f')](_0xa9487b);return Project[_0xa0ca('0x30')](_0x3b2c0a,_0xa9487b);}function main(){var _0x2b043e;return utilLicense[_0xa0ca('0x31')]()[_0xa0ca('0x21')](function(_0x5a77e1){if(!_0x5a77e1)return;if(_0x5a77e1[_0xa0ca('0x32')]){if(_0x5a77e1[_0xa0ca('0x33')]&&_0x5a77e1[_0xa0ca('0x33')]>0x0){logger[_0xa0ca('0x1e')](util[_0xa0ca('0x12')](_0xa0ca('0x34'),_0x5a77e1[_0xa0ca('0x33')]));_0x2b043e=_0x5a77e1[_0xa0ca('0x33')];}else{logger[_0xa0ca('0x1e')](_0xa0ca('0x35'));}}else{logger['info'](_0xa0ca('0x36'));_0x2b043e=-0x1;}})[_0xa0ca('0x21')](function(){return Project[_0xa0ca('0x37')]();})[_0xa0ca('0x21')](function(_0x385ae8){projects=_0x385ae8;return;})[_0xa0ca('0x22')](function(_0x34d5df){logger[_0xa0ca('0xb')]('[LICENSE]',_0x34d5df[_0xa0ca('0xf')]);})[_0xa0ca('0x38')](function(){var _0x14b9fe=require(_0xa0ca('0x39'))(config['agi'][_0xa0ca('0x11')],config[_0xa0ca('0x3')]['ip'],_0x2b043e);_0x14b9fe['on'](_0xa0ca('0xb'),errorHandler);_0x14b9fe['on'](_0xa0ca('0x3a'),listeningHandler);_0x14b9fe['on']('connection',connectionHandler);_0x14b9fe['on'](_0xa0ca('0x2b'),closeHandler);});}main(); \ No newline at end of file +var _0xb4f5=['info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','host.docker.internal','port','name','message','format','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','createSquareReport','catch','hasOwnProperty','indexOf','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','evtHangup','handleNotFound','handleUnpublished','initialize','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','finally','listening','connection','lodash','syncho','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','defaults','127.0.0.1','projectUpdate','nextTick','error','stack','deleted','splice','push','production','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x1a1757,_0x52d430){var _0x4f9430=function(_0x4ff842){while(--_0x4ff842){_0x1a1757['push'](_0x1a1757['shift']());}};_0x4f9430(++_0x52d430);}(_0xb4f5,0x64));var _0x5b4f=function(_0x3439ef,_0x198707){_0x3439ef=_0x3439ef-0x0;var _0x3c7937=_0xb4f5[_0x3439ef];return _0x3c7937;};'use strict';var _=require(_0x5b4f('0x0'));var syncho=require(_0x5b4f('0x1'));var util=require('util');var config=require('../../config/environment');var logger=require(_0x5b4f('0x2'))(_0x5b4f('0x3'));var utilLicense=require(_0x5b4f('0x4'));var rpc=require(_0x5b4f('0x5'));var Project=require(_0x5b4f('0x6'));var AGIEmitter=require(_0x5b4f('0x7'))['EventEmitter'];var projects=[];config[_0x5b4f('0x3')]=_[_0x5b4f('0x8')](config[_0x5b4f('0x3')],{'ip':_0x5b4f('0x9'),'port':0x11dd});AGIEmitter['on'](_0x5b4f('0xa'),projectUpdateHandler);function connectionHandler(_0x2e6dce){process[_0x5b4f('0xb')](function(){syncho(function(){try{setChannelVariables(_0x2e6dce);agiHandler(_0x2e6dce);}catch(_0x301cb6){logger[_0x5b4f('0xc')](_0x301cb6[_0x5b4f('0xd')]);}});});}function projectUpdateHandler(_0x241293){try{var _0x2e2e2f=_['findIndex'](projects,['id',_0x241293['id']]);if(_0x2e2e2f>-0x1){if(_0x241293[_0x5b4f('0xe')]===!![]){projects[_0x5b4f('0xf')](_0x2e2e2f,0x1);}else{projects[_0x2e2e2f]=_0x241293;}}else{projects[_0x5b4f('0x10')](_0x241293);}}catch(_0x21628c){logger[_0x5b4f('0xc')](_0x21628c[_0x5b4f('0xd')]);}}function listeningHandler(){var _0x2fef07=config['env']===_0x5b4f('0x11')||![];console[_0x5b4f('0x12')](_0x5b4f('0x13'),config[_0x5b4f('0x3')]['port']);logger[_0x5b4f('0x14')](util['format'](_0x5b4f('0x15'),_0x2fef07?config[_0x5b4f('0x3')]['ip']:_0x5b4f('0x16'),config[_0x5b4f('0x3')][_0x5b4f('0x17')]));}function errorHandler(_0x47add5){if(_0x47add5&&_0x47add5[_0x5b4f('0x18')]&&_0x47add5[_0x5b4f('0x19')]){logger[_0x5b4f('0xc')](util[_0x5b4f('0x1a')]('[%s]\x20%s',_0x47add5[_0x5b4f('0x18')],_0x47add5['message']));}else{logger['error'](util[_0x5b4f('0x1a')](_0x5b4f('0x1b'),_0x47add5['stack']));}}function closeHandler(){logger['info'](util[_0x5b4f('0x1a')](_0x5b4f('0x1c'),this['arg_1'],this[_0x5b4f('0x1d')],this['callerid'],this[_0x5b4f('0x1e')],this[_0x5b4f('0x1f')]));try{createSquareReport(this);}catch(_0x19f58f){logger['error'](_0x19f58f[_0x5b4f('0xd')]);}}function timeoutHandler(){logger[_0x5b4f('0x14')](util[_0x5b4f('0x1a')](_0x5b4f('0x20'),this[_0x5b4f('0x21')],this[_0x5b4f('0x1d')],this['callerid'],this['dnid'],this[_0x5b4f('0x1f')]));}function hangupHandler(){logger[_0x5b4f('0x14')](util['format'](_0x5b4f('0x22'),this[_0x5b4f('0x21')],this[_0x5b4f('0x1d')],this[_0x5b4f('0x23')],this[_0x5b4f('0x1e')],this['uniqueid']));this['evtHangup']=!![];}function createSquareReport(_0x1e921a,_0x2f2af6){rpc[_0x5b4f('0x24')](_0x1e921a)['then'](function(_0x11e15c){if(_0x2f2af6){_0x2f2af6(null,_0x11e15c);}})[_0x5b4f('0x25')](function(_0x3223e4){if(_0x2f2af6){_0x2f2af6(null,_0x3223e4);}});}function setChannelVariables(_0x500866){for(var _0x396bc7 in _0x500866){if(_0x500866[_0x5b4f('0x26')](_0x396bc7)){if(_0x396bc7[_0x5b4f('0x27')]('agi_')===0x0){_0x500866[_0x396bc7[_0x5b4f('0x28')](0x4)]=_0x500866[_0x396bc7];delete _0x500866[_0x396bc7];}}}}function agiHandler(_0x197166){logger[_0x5b4f('0x29')](_0x5b4f('0x2a'),JSON[_0x5b4f('0x2b')](_0x197166,null,0x2));logger['info'](util[_0x5b4f('0x1a')](_0x5b4f('0x2c'),_0x197166[_0x5b4f('0x21')],_0x197166[_0x5b4f('0x1d')],_0x197166[_0x5b4f('0x23')],_0x197166['dnid'],_0x197166[_0x5b4f('0x1f')]));_0x197166['on'](_0x5b4f('0xc'),errorHandler);_0x197166['on'](_0x5b4f('0x2d'),closeHandler);_0x197166['on']('timeout',timeoutHandler);_0x197166[_0x5b4f('0x2e')]=![];_0x197166['on']('hangup',hangupHandler);var _0x5beb2a=_['find'](projects,[_0x5b4f('0x18'),_0x197166[_0x5b4f('0x21')]]);if(!_0x5beb2a)return Project[_0x5b4f('0x2f')](_0x197166);if(!_0x5beb2a[_0x5b4f('0x11')])return Project[_0x5b4f('0x30')](_0x197166);return Project[_0x5b4f('0x31')](_0x5beb2a,_0x197166);}function main(){var _0x2944aa;return utilLicense[_0x5b4f('0x32')]()[_0x5b4f('0x33')](function(_0xe0eeb9){if(!_0xe0eeb9)return;if(_0xe0eeb9[_0x5b4f('0x34')]){if(_0xe0eeb9[_0x5b4f('0x35')]&&_0xe0eeb9['callysquare']>0x0){logger[_0x5b4f('0x14')](util['format'](_0x5b4f('0x36'),_0xe0eeb9['callysquare']));_0x2944aa=_0xe0eeb9[_0x5b4f('0x35')];}else{logger[_0x5b4f('0x14')](_0x5b4f('0x37'));}}else{logger['info'](_0x5b4f('0x38'));_0x2944aa=-0x1;}})[_0x5b4f('0x33')](function(){return Project['getAll']();})[_0x5b4f('0x33')](function(_0x24b82a){projects=_0x24b82a;return;})[_0x5b4f('0x25')](function(_0x504cd9){logger[_0x5b4f('0xc')]('[LICENSE]',_0x504cd9[_0x5b4f('0xd')]);})[_0x5b4f('0x39')](function(){var _0x5c5dd3=require('./server')(config['agi'][_0x5b4f('0x17')],config['agi']['ip'],_0x2944aa);_0x5c5dd3['on']('error',errorHandler);_0x5c5dd3['on'](_0x5b4f('0x3a'),listeningHandler);_0x5c5dd3['on'](_0x5b4f('0x3b'),connectionHandler);_0x5c5dd3['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 e0531db..a0beba9 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 _0x0e2b=['error','message','result','sendMailMessage','SendMail','bluebird','jayson/promise','client','http'];(function(_0x2b7dcd,_0x4c775b){var _0x305a26=function(_0x37a750){while(--_0x37a750){_0x2b7dcd['push'](_0x2b7dcd['shift']());}};_0x305a26(++_0x4c775b);}(_0x0e2b,0x125));var _0xb0e2=function(_0x2c9d95,_0x4e4ea5){_0x2c9d95=_0x2c9d95-0x0;var _0x29a602=_0x0e2b[_0x2c9d95];return _0x29a602;};'use strict';var BPromise=require(_0xb0e2('0x0'));var jayson=require(_0xb0e2('0x1'));var client=jayson[_0xb0e2('0x2')][_0xb0e2('0x3')]({'port':0x232b});function request(_0x4b11ca,_0x4afb70){return new BPromise(function(_0x4998b4,_0x5db1c9){return client['request'](_0x4b11ca,_0x4afb70)['then'](function(_0x44f51e){if(_0x44f51e[_0xb0e2('0x4')]){return _0x5db1c9(_0x44f51e[_0xb0e2('0x4')][_0xb0e2('0x5')]);}else{return _0x4998b4(_0x44f51e[_0xb0e2('0x6')]);}})['catch'](function(_0xd02f43){return _0x5db1c9(_0xd02f43);});});}exports[_0xb0e2('0x7')]=function(_0xaa15bc,_0x69cc0a){return request(_0xb0e2('0x8'),{'account':_0xaa15bc,'message':_0x69cc0a});}; \ No newline at end of file +var _0x44c2=['jayson/promise','client','http','request','then','error','message','catch','SendMail','bluebird'];(function(_0x49681e,_0x214fc7){var _0x1ba7df=function(_0x1f1906){while(--_0x1f1906){_0x49681e['push'](_0x49681e['shift']());}};_0x1ba7df(++_0x214fc7);}(_0x44c2,0x6d));var _0x244c=function(_0xbc4659,_0x578fba){_0xbc4659=_0xbc4659-0x0;var _0x5831f9=_0x44c2[_0xbc4659];return _0x5831f9;};'use strict';var BPromise=require(_0x244c('0x0'));var jayson=require(_0x244c('0x1'));var client=jayson[_0x244c('0x2')][_0x244c('0x3')]({'port':0x232b});function request(_0x4f32d8,_0x37f746){return new BPromise(function(_0x31376b,_0x4b436c){return client[_0x244c('0x4')](_0x4f32d8,_0x37f746)[_0x244c('0x5')](function(_0x2e047e){if(_0x2e047e[_0x244c('0x6')]){return _0x4b436c(_0x2e047e[_0x244c('0x6')][_0x244c('0x7')]);}else{return _0x31376b(_0x2e047e['result']);}})[_0x244c('0x8')](function(_0x32b745){return _0x4b436c(_0x32b745);});});}exports['sendMailMessage']=function(_0x4a31a4,_0x3eed83){return request(_0x244c('0x9'),{'account':_0x4a31a4,'message':_0x3eed83});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index b6a87bf..10e5338 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 _0x021c=['mxGraphModel','root','inspect','start','debug','stringify','format','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','stack','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','close','Project\x20%s\x20not\x20found','continueAt','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','agi','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','retry','maxRetry','omit','mxCell','hasOwnProperty','length','addEdge','source','toJson'];(function(_0x59437a,_0x4d941b){var _0x515feb=function(_0x35b589){while(--_0x35b589){_0x59437a['push'](_0x59437a['shift']());}};_0x515feb(++_0x4d941b);}(_0x021c,0x180));var _0xc021=function(_0x5bf601,_0x8fb76d){_0x5bf601=_0x5bf601-0x0;var _0x4ea9b6=_0x021c[_0x5bf601];return _0x4ea9b6;};'use strict';var _=require(_0xc021('0x0'));var moment=require(_0xc021('0x1'));var parser=require(_0xc021('0x2'));var util=require(_0xc021('0x3'));var logger=require('../../config/logger')(_0xc021('0x4'));var rpc=require('./rpc');var mailRpc=require(_0xc021('0x5'));var Graph=require(_0xc021('0x6'));var Vertices=require(_0xc021('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xc021('0x8')]()[_0xc021('0x9')](function(_0x482ec0){logger[_0xc021('0xa')](_0xc021('0xb'),_0x482ec0['stack']);return[];});}function addVertex(_0x31ee7f,_0x579795,_0x254900){_0x579795[_0xc021('0xc')]=_0x254900;if(_0x579795['hasOwnProperty'](_0xc021('0xd'))){_0x579795[_0xc021('0xe')]=parseInt(_0x579795['retry'],0xa);}_0x31ee7f['addVertex'](_[_0xc021('0xf')](_0x579795,_0xc021('0x10')));}function initGraph(_0x5019af,_0x468bd6){var _0x4f799f=new Graph();for(var _0x18480b in _0x5019af){if(_0x5019af[_0xc021('0x11')](_0x18480b)){if(_['isArray'](_0x5019af[_0x18480b])){for(var _0x178bb2=0x0;_0x178bb2<_0x5019af[_0x18480b][_0xc021('0x12')];_0x178bb2+=0x1){addVertex(_0x4f799f,_0x5019af[_0x18480b][_0x178bb2],_0x18480b);}}else{addVertex(_0x4f799f,_0x5019af[_0x18480b],_0x18480b);}}}for(var _0x522c94=0x0;_0x522c94<_0x468bd6[_0xc021('0x12')];_0x522c94+=0x1){if(_0x468bd6[_0x522c94]['source']&&_0x468bd6[_0x522c94]['target']){_0x4f799f[_0xc021('0x13')](_0x468bd6[_0x522c94][_0xc021('0x14')],_0x468bd6[_0x522c94]['target'],_0x468bd6[_0x522c94]['value']);}}return _0x4f799f;}function getRoot(_0x15cff3){return parser[_0xc021('0x15')](_0x15cff3,{'object':!![]})[_0xc021('0x16')][_0xc021('0x17')];}function inspect(_0x543177){return util[_0xc021('0x18')](_0x543177,{'showHidden':![],'depth':null});}function initialize(_0x55323e,_0x5186f6){var _0x1f0147=getRoot(_0x55323e['production']);if(!_0x1f0147||!_0x1f0147[_0xc021('0x19')])return;var _0x25d17a,_0x297791,_0x325aab;logger[_0xc021('0x1a')](_0xc021('0x17'),JSON[_0xc021('0x1b')](_0x1f0147,null,0x2));_0x5186f6['joinAt']=moment()[_0xc021('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');_0x25d17a=initGraph(_[_0xc021('0xf')](_0x1f0147,'mxCell'),_0x1f0147[_0xc021('0x10')]);_0x297791=new Vertices(_0x5186f6,rpc,mailRpc);logger[_0xc021('0x1d')](util['format'](_0xc021('0x1e'),_0x5186f6[_0xc021('0x1f')],_0x5186f6[_0xc021('0x20')],_0x5186f6[_0xc021('0x21')],_0x5186f6[_0xc021('0x22')],_0x5186f6['uniqueid']));_0x25d17a[_0xc021('0x23')](_0x1f0147[_0xc021('0x19')]['id'],function(_0x172782){try{_0x172782=_0x297791[_0xc021('0x24')](_0x172782);logger[_0xc021('0x1a')](_0xc021('0x25'),JSON[_0xc021('0x1b')](_0x172782,null,0x2));if(_0x172782[_0xc021('0xc')]===_0xc021('0x26')){logger[_0xc021('0x1d')](_0xc021('0x27'));_0x5186f6[_0xc021('0x28')]=_0x172782[_0xc021('0x28')]||_0x5186f6[_0xc021('0x28')];_0x5186f6[_0xc021('0x29')]=_0x172782[_0xc021('0x29')];_0x5186f6[_0xc021('0x2a')]=_0x172782[_0xc021('0x2a')]?_0x172782['priority']-0x1:0x1;return null;}else if(_0x172782&&_0x297791[_0x172782[_0xc021('0xc')]]){_0x325aab=_0x297791[_0x172782['agicommand']](_0x172782);logger['info'](_0xc021('0x2b'),JSON['stringify'](_0x325aab,null,0x2));if(_0x325aab&&_0x325aab[_0xc021('0x2c')]===AGI_CODE_SUCCESS&&_0x325aab[_0xc021('0x2d')]!==AGI_RESULT_ERROR&&!_0x5186f6['evtHangup']){logger[_0xc021('0x1a')]('response',inspect(_0x325aab));return _[_0xc021('0x2e')](_0x325aab[_0xc021('0x2d')])?null:_0x325aab[_0xc021('0x2d')][_0xc021('0x2f')]();}else{logger['error'](_0xc021('0x2b'),inspect(_0x325aab));return null;}}else{logger[_0xc021('0xa')](_0xc021('0x30'));return null;}}catch(_0x41c75b){logger[_0xc021('0xa')](_0x41c75b[_0xc021('0x31')]);return null;}});if(_0x1f0147[_0xc021('0x32')]){logger[_0xc021('0x1d')](util[_0xc021('0x1c')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5186f6[_0xc021('0x1f')],_0x5186f6[_0xc021('0x20')],_0x5186f6[_0xc021('0x21')],_0x5186f6[_0xc021('0x22')],_0x5186f6['uniqueid']));_0x25d17a[_0xc021('0x23')](_0x1f0147[_0xc021('0x32')]['id'],function(_0x569277){try{_0x569277=_0x297791[_0xc021('0x24')](_0x569277);logger['debug'](_0xc021('0x25'),JSON['stringify'](_0x569277,null,0x2));if(_0x569277&&_0x297791[_0x569277[_0xc021('0xc')]]){_0x325aab=_0x297791[_0x569277[_0xc021('0xc')]](_0x569277);if(_0x325aab){logger[_0xc021('0x1a')](_0xc021('0x2b'),inspect(_0x325aab));return _[_0xc021('0x2e')](_0x325aab['result'])?null:_0x325aab[_0xc021('0x2d')][_0xc021('0x2f')]();}else{logger[_0xc021('0xa')](_0xc021('0x2b'),inspect(_0x325aab));return null;}}else{logger[_0xc021('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x2900af){logger[_0xc021('0xa')](_0x2900af[_0xc021('0x31')]);return null;}});}logger[_0xc021('0x1d')](util['format'](_0xc021('0x33'),_0x5186f6[_0xc021('0x1f')],_0x5186f6[_0xc021('0x20')],_0x5186f6[_0xc021('0x21')],_0x5186f6[_0xc021('0x22')],_0x5186f6['uniqueid']));logger[_0xc021('0x1d')](util[_0xc021('0x1c')](_0xc021('0x34'),_0x5186f6[_0xc021('0x28')],_0x5186f6['extension'],parseInt(_0x5186f6[_0xc021('0x2a')],0xa)+0x1));_0x5186f6['continueAt'](_0x5186f6[_0xc021('0x28')],_0x5186f6[_0xc021('0x29')],parseInt(_0x5186f6[_0xc021('0x2a')],0xa)+0x1);_0x5186f6[_0xc021('0x35')]();}function handleNotFound(_0xf622c6){logger[_0xc021('0xa')](util[_0xc021('0x1c')](_0xc021('0x36'),_0xf622c6[_0xc021('0x1f')]));_0xf622c6[_0xc021('0x37')](_0xf622c6[_0xc021('0x28')],_0xf622c6['extension'],parseInt(_0xf622c6[_0xc021('0x2a')],0xa)+0x1);_0xf622c6['close']();}function handleUnpublished(_0x569bbc){logger[_0xc021('0xa')](util[_0xc021('0x1c')](_0xc021('0x38'),_0x569bbc['arg_1']));_0x569bbc[_0xc021('0x37')](_0x569bbc[_0xc021('0x28')],_0x569bbc[_0xc021('0x29')],parseInt(_0x569bbc['priority'],0xa)+0x1);_0x569bbc[_0xc021('0x35')]();}module[_0xc021('0x39')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x9dd9=['stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','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','uniqueid','traverseBFS','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','continueAt','Project\x20%s\x20not\x20found','close','Project\x20%s\x20not\x20published','exports','moment','xml2json','util','agi','./rpc','./mailRpc','./graph','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','length','source','addEdge','target','value','toJson','root','inspect','production','start'];(function(_0x576964,_0x3c2dc9){var _0x129325=function(_0x388c92){while(--_0x388c92){_0x576964['push'](_0x576964['shift']());}};_0x129325(++_0x3c2dc9);}(_0x9dd9,0x165));var _0x99dd=function(_0x1bd321,_0x323d83){_0x1bd321=_0x1bd321-0x0;var _0x3a70d8=_0x9dd9[_0x1bd321];return _0x3a70d8;};'use strict';var _=require('lodash');var moment=require(_0x99dd('0x0'));var parser=require(_0x99dd('0x1'));var util=require(_0x99dd('0x2'));var logger=require('../../config/logger')(_0x99dd('0x3'));var rpc=require(_0x99dd('0x4'));var mailRpc=require(_0x99dd('0x5'));var Graph=require(_0x99dd('0x6'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x99dd('0x7')](function(_0x2bdb93){logger[_0x99dd('0x8')](_0x99dd('0x9'),_0x2bdb93[_0x99dd('0xa')]);return[];});}function addVertex(_0x226977,_0x466fdf,_0x5a6b95){_0x466fdf[_0x99dd('0xb')]=_0x5a6b95;if(_0x466fdf[_0x99dd('0xc')](_0x99dd('0xd'))){_0x466fdf[_0x99dd('0xe')]=parseInt(_0x466fdf[_0x99dd('0xd')],0xa);}_0x226977[_0x99dd('0xf')](_['omit'](_0x466fdf,_0x99dd('0x10')));}function initGraph(_0x4c03fc,_0x3fd8aa){var _0x314b30=new Graph();for(var _0x14c098 in _0x4c03fc){if(_0x4c03fc['hasOwnProperty'](_0x14c098)){if(_['isArray'](_0x4c03fc[_0x14c098])){for(var _0x10d6c7=0x0;_0x10d6c7<_0x4c03fc[_0x14c098]['length'];_0x10d6c7+=0x1){addVertex(_0x314b30,_0x4c03fc[_0x14c098][_0x10d6c7],_0x14c098);}}else{addVertex(_0x314b30,_0x4c03fc[_0x14c098],_0x14c098);}}}for(var _0x4b73e3=0x0;_0x4b73e3<_0x3fd8aa[_0x99dd('0x11')];_0x4b73e3+=0x1){if(_0x3fd8aa[_0x4b73e3][_0x99dd('0x12')]&&_0x3fd8aa[_0x4b73e3]['target']){_0x314b30[_0x99dd('0x13')](_0x3fd8aa[_0x4b73e3][_0x99dd('0x12')],_0x3fd8aa[_0x4b73e3][_0x99dd('0x14')],_0x3fd8aa[_0x4b73e3][_0x99dd('0x15')]);}}return _0x314b30;}function getRoot(_0x3b4d07){return parser[_0x99dd('0x16')](_0x3b4d07,{'object':!![]})['mxGraphModel'][_0x99dd('0x17')];}function inspect(_0x4be99e){return util[_0x99dd('0x18')](_0x4be99e,{'showHidden':![],'depth':null});}function initialize(_0x246763,_0x111baf){var _0x12bb75=getRoot(_0x246763[_0x99dd('0x19')]);if(!_0x12bb75||!_0x12bb75[_0x99dd('0x1a')])return;var _0x1ceac3,_0x87c6b4,_0x3a9dfd;logger['debug'](_0x99dd('0x17'),JSON[_0x99dd('0x1b')](_0x12bb75,null,0x2));_0x111baf[_0x99dd('0x1c')]=moment()['format'](_0x99dd('0x1d'));_0x1ceac3=initGraph(_[_0x99dd('0x1e')](_0x12bb75,'mxCell'),_0x12bb75[_0x99dd('0x10')]);_0x87c6b4=new Vertices(_0x111baf,rpc,mailRpc);logger[_0x99dd('0x1f')](util[_0x99dd('0x20')](_0x99dd('0x21'),_0x111baf[_0x99dd('0x22')],_0x111baf[_0x99dd('0x23')],_0x111baf[_0x99dd('0x24')],_0x111baf[_0x99dd('0x25')],_0x111baf['uniqueid']));_0x1ceac3['traverseBFS'](_0x12bb75['start']['id'],function(_0x32d1bd){try{_0x32d1bd=_0x87c6b4[_0x99dd('0x26')](_0x32d1bd);logger['debug'](_0x99dd('0x27'),JSON[_0x99dd('0x1b')](_0x32d1bd,null,0x2));if(_0x32d1bd[_0x99dd('0xb')]===_0x99dd('0x28')){logger['info'](_0x99dd('0x29'));_0x111baf['context']=_0x32d1bd['context']||_0x111baf[_0x99dd('0x2a')];_0x111baf[_0x99dd('0x2b')]=_0x32d1bd[_0x99dd('0x2b')];_0x111baf[_0x99dd('0x2c')]=_0x32d1bd['priority']?_0x32d1bd[_0x99dd('0x2c')]-0x1:0x1;return null;}else if(_0x32d1bd&&_0x87c6b4[_0x32d1bd[_0x99dd('0xb')]]){_0x3a9dfd=_0x87c6b4[_0x32d1bd[_0x99dd('0xb')]](_0x32d1bd);logger[_0x99dd('0x1f')](_0x99dd('0x2d'),JSON['stringify'](_0x3a9dfd,null,0x2));if(_0x3a9dfd&&_0x3a9dfd[_0x99dd('0x2e')]===AGI_CODE_SUCCESS&&_0x3a9dfd[_0x99dd('0x2f')]!==AGI_RESULT_ERROR&&!_0x111baf[_0x99dd('0x30')]){logger[_0x99dd('0x31')](_0x99dd('0x2d'),inspect(_0x3a9dfd));return _['isUndefined'](_0x3a9dfd[_0x99dd('0x2f')])?null:_0x3a9dfd[_0x99dd('0x2f')][_0x99dd('0x32')]();}else{logger[_0x99dd('0x8')](_0x99dd('0x2d'),inspect(_0x3a9dfd));return null;}}else{logger[_0x99dd('0x8')](_0x99dd('0x33'));return null;}}catch(_0x13d7bc){logger['error'](_0x13d7bc['stack']);return null;}});if(_0x12bb75[_0x99dd('0x34')]){logger[_0x99dd('0x1f')](util[_0x99dd('0x20')](_0x99dd('0x35'),_0x111baf[_0x99dd('0x22')],_0x111baf['calleridname'],_0x111baf[_0x99dd('0x24')],_0x111baf['dnid'],_0x111baf[_0x99dd('0x36')]));_0x1ceac3[_0x99dd('0x37')](_0x12bb75[_0x99dd('0x34')]['id'],function(_0x3d829a){try{_0x3d829a=_0x87c6b4[_0x99dd('0x26')](_0x3d829a);logger[_0x99dd('0x31')](_0x99dd('0x27'),JSON[_0x99dd('0x1b')](_0x3d829a,null,0x2));if(_0x3d829a&&_0x87c6b4[_0x3d829a[_0x99dd('0xb')]]){_0x3a9dfd=_0x87c6b4[_0x3d829a[_0x99dd('0xb')]](_0x3d829a);if(_0x3a9dfd){logger[_0x99dd('0x31')]('response',inspect(_0x3a9dfd));return _[_0x99dd('0x38')](_0x3a9dfd[_0x99dd('0x2f')])?null:_0x3a9dfd[_0x99dd('0x2f')][_0x99dd('0x32')]();}else{logger[_0x99dd('0x8')]('response',inspect(_0x3a9dfd));return null;}}else{logger[_0x99dd('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x30022e){logger[_0x99dd('0x8')](_0x30022e[_0x99dd('0xa')]);return null;}});}logger[_0x99dd('0x1f')](util['format'](_0x99dd('0x39'),_0x111baf[_0x99dd('0x22')],_0x111baf[_0x99dd('0x23')],_0x111baf[_0x99dd('0x24')],_0x111baf['dnid'],_0x111baf['uniqueid']));logger[_0x99dd('0x1f')](util[_0x99dd('0x20')](_0x99dd('0x3a'),_0x111baf[_0x99dd('0x2a')],_0x111baf[_0x99dd('0x2b')],parseInt(_0x111baf[_0x99dd('0x2c')],0xa)+0x1));_0x111baf[_0x99dd('0x3b')](_0x111baf[_0x99dd('0x2a')],_0x111baf[_0x99dd('0x2b')],parseInt(_0x111baf[_0x99dd('0x2c')],0xa)+0x1);_0x111baf['close']();}function handleNotFound(_0x21f2a5){logger['error'](util[_0x99dd('0x20')](_0x99dd('0x3c'),_0x21f2a5[_0x99dd('0x22')]));_0x21f2a5[_0x99dd('0x3b')](_0x21f2a5[_0x99dd('0x2a')],_0x21f2a5[_0x99dd('0x2b')],parseInt(_0x21f2a5[_0x99dd('0x2c')],0xa)+0x1);_0x21f2a5[_0x99dd('0x3d')]();}function handleUnpublished(_0xffa186){logger[_0x99dd('0x8')](util[_0x99dd('0x20')](_0x99dd('0x3e'),_0xffa186['arg_1']));_0xffa186[_0x99dd('0x3b')](_0xffa186[_0x99dd('0x2a')],_0xffa186[_0x99dd('0x2b')],parseInt(_0xffa186[_0x99dd('0x2c')],0xa)+0x1);_0xffa186['close']();}module[_0x99dd('0x3f')]={'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 1c8b744..6be44dd 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 _0xc0c0=['trim','emit','line','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','slice'];(function(_0x1ee4a4,_0x1a51b8){var _0x1d5d5e=function(_0x5e8656){while(--_0x5e8656){_0x1ee4a4['push'](_0x1ee4a4['shift']());}};_0x1d5d5e(++_0x1a51b8);}(_0xc0c0,0x136));var _0x0c0c=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0xc0c0[_0x5a9c0c];return _0x53c77d;};'use strict';var util=require(_0x0c0c('0x0'));var Transform=require(_0x0c0c('0x1'))[_0x0c0c('0x2')];function AGIReply(_0x1fb5ff){Transform[_0x0c0c('0x3')](this,_0x1fb5ff);this[_0x0c0c('0x4')]='';this[_0x0c0c('0x5')]=![];}util[_0x0c0c('0x6')](AGIReply,Transform);AGIReply['prototype'][_0x0c0c('0x7')]=function(_0x445031,_0x73246c,_0x54280a){var _0x1532d2='\x0a',_0x17500c=['\x0a\x0a',_0x0c0c('0x8')],_0x107738=-0x1,_0x44a079=-0x1,_0x5a9bd9='',_0x5814e6=0x0,_0x4f0425='',_0x5af919='';this[_0x0c0c('0x4')]+=_0x445031[_0x0c0c('0x9')]();_0x4f0425=this['_localBuffer'];if(!this['_inBody']){_0x5814e6=0x0;while(_0x17500c[_0x5814e6]){while((_0x44a079=_0x4f0425[_0x0c0c('0xa')](_0x17500c[_0x5814e6]))!=-0x1){_0x5a9bd9=_0x17500c[_0x5814e6];_0x5af919=_0x4f0425['substring'](0x0,_0x44a079);_0x4f0425=_0x4f0425[_0x0c0c('0xb')](_0x44a079+_0x5a9bd9[_0x0c0c('0xc')]);var _0x5d967b=_0x5af919['split'](_0x1532d2),_0x104e5f=0x0,_0x1aa603={},_0x260a93='',_0x5e0128='',_0x3029e1=-0x1;while(_0x5d967b[_0x104e5f]){_0x3029e1=_0x5d967b[_0x104e5f]['indexOf'](':');if(_0x3029e1!=-0x1){_0x260a93=_0x5d967b[_0x104e5f][_0x0c0c('0xd')](0x0,_0x3029e1)[_0x0c0c('0xe')]();_0x5e0128=_0x5d967b[_0x104e5f][_0x0c0c('0xd')](_0x3029e1+0x1)['trim']();if(_0x260a93[_0x0c0c('0xc')]>0x0){_0x1aa603[_0x260a93]=_0x5e0128;}}else{}_0x104e5f++;}this[_0x0c0c('0xf')]('headers',_0x1aa603);this[_0x0c0c('0x5')]=!![];}_0x5814e6++;}this['_localBuffer']=_0x4f0425;}else{while((_0x107738=_0x4f0425[_0x0c0c('0xa')](_0x1532d2))!=-0x1){_0x5af919=_0x4f0425[_0x0c0c('0xb')](0x0,_0x107738);this[_0x0c0c('0xf')](_0x0c0c('0x10'),_0x5af919);_0x4f0425=_0x4f0425[_0x0c0c('0xb')](_0x107738+_0x1532d2[_0x0c0c('0xc')]);}this[_0x0c0c('0x4')]=_0x4f0425;}_0x54280a();};module[_0x0c0c('0x11')]=AGIReply; \ No newline at end of file +var _0x53b5=['_transform','_localBuffer','_inBody','substring','split','indexOf','slice','trim','length','emit','headers','line','exports','util','stream','call','inherits','prototype'];(function(_0x106d9b,_0x5dc768){var _0x220189=function(_0x269616){while(--_0x269616){_0x106d9b['push'](_0x106d9b['shift']());}};_0x220189(++_0x5dc768);}(_0x53b5,0xd3));var _0x553b=function(_0x104413,_0x5b60d5){_0x104413=_0x104413-0x0;var _0x2abce5=_0x53b5[_0x104413];return _0x2abce5;};'use strict';var util=require(_0x553b('0x0'));var Transform=require(_0x553b('0x1'))['Transform'];function AGIReply(_0x278896){Transform[_0x553b('0x2')](this,_0x278896);this['_localBuffer']='';this['_inBody']=![];}util[_0x553b('0x3')](AGIReply,Transform);AGIReply[_0x553b('0x4')][_0x553b('0x5')]=function(_0x6b752f,_0x4a9cf5,_0x2394d4){var _0x4749af='\x0a',_0x4bdeaa=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x58e985=-0x1,_0x1fc330=-0x1,_0x302df3='',_0x5d0732=0x0,_0x44b538='',_0x1b945f='';this[_0x553b('0x6')]+=_0x6b752f['toString']();_0x44b538=this[_0x553b('0x6')];if(!this[_0x553b('0x7')]){_0x5d0732=0x0;while(_0x4bdeaa[_0x5d0732]){while((_0x1fc330=_0x44b538['indexOf'](_0x4bdeaa[_0x5d0732]))!=-0x1){_0x302df3=_0x4bdeaa[_0x5d0732];_0x1b945f=_0x44b538[_0x553b('0x8')](0x0,_0x1fc330);_0x44b538=_0x44b538[_0x553b('0x8')](_0x1fc330+_0x302df3['length']);var _0x311062=_0x1b945f[_0x553b('0x9')](_0x4749af),_0x5dafa7=0x0,_0x46e771={},_0x239ab9='',_0x346fcf='',_0x24d766=-0x1;while(_0x311062[_0x5dafa7]){_0x24d766=_0x311062[_0x5dafa7][_0x553b('0xa')](':');if(_0x24d766!=-0x1){_0x239ab9=_0x311062[_0x5dafa7][_0x553b('0xb')](0x0,_0x24d766)[_0x553b('0xc')]();_0x346fcf=_0x311062[_0x5dafa7]['slice'](_0x24d766+0x1)[_0x553b('0xc')]();if(_0x239ab9[_0x553b('0xd')]>0x0){_0x46e771[_0x239ab9]=_0x346fcf;}}else{}_0x5dafa7++;}this[_0x553b('0xe')](_0x553b('0xf'),_0x46e771);this[_0x553b('0x7')]=!![];}_0x5d0732++;}this[_0x553b('0x6')]=_0x44b538;}else{while((_0x58e985=_0x44b538[_0x553b('0xa')](_0x4749af))!=-0x1){_0x1b945f=_0x44b538['substring'](0x0,_0x58e985);this[_0x553b('0xe')](_0x553b('0x10'),_0x1b945f);_0x44b538=_0x44b538[_0x553b('0x8')](_0x58e985+_0x4749af[_0x553b('0xd')]);}this[_0x553b('0x6')]=_0x44b538;}_0x2394d4();};module[_0x553b('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 62cb9b1..b2acd5f 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 _0xaf80=['GetContactByPhone','ShowTrunk','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','PauseUser','agentUnpause','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','request','then','error','result','getSquareProjects','GetSquareProjects','production','getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','name','email','getSquareProjectById','ShowSquareProject','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowUser','getContactByPhone'];(function(_0x61151d,_0x1eaadf){var _0x57752d=function(_0x1ac48a){while(--_0x1ac48a){_0x61151d['push'](_0x61151d['shift']());}};_0x57752d(++_0x1eaadf);}(_0xaf80,0x1ef));var _0x0af8=function(_0x395623,_0x367616){_0x395623=_0x395623-0x0;var _0x4986d1=_0xaf80[_0x395623];return _0x4986d1;};'use strict';var _=require(_0x0af8('0x0'));var moment=require(_0x0af8('0x1'));var jayson=require(_0x0af8('0x2'));var client=jayson[_0x0af8('0x3')]['http']({'port':0x2329});function request(_0x5bfb4e,_0x5bcd97){return new Promise(function(_0x431bc8,_0x3fba3b){return client[_0x0af8('0x4')](_0x5bfb4e,_0x5bcd97)[_0x0af8('0x5')](function(_0x6313e5){if(_0x6313e5[_0x0af8('0x6')]){return _0x3fba3b(_0x6313e5['error']['message']);}else{return _0x431bc8(_0x6313e5[_0x0af8('0x7')]);}})['catch'](function(_0x207a9b){return _0x3fba3b(_0x207a9b);});});}exports[_0x0af8('0x8')]=function(){return request(_0x0af8('0x9'),{'options':{'raw':![],'attributes':['id','name',_0x0af8('0xa')]}});};exports[_0x0af8('0xb')]=function(_0x2f4267){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x2f4267},'attributes':['production']}});};exports[_0x0af8('0xc')]=function(_0x1b4570){return request(_0x0af8('0xd'),{'options':{'raw':![],'where':{'id':_0x1b4570},'include':[{'model':_0x0af8('0xe'),'as':_0x0af8('0xf'),'include':[{'model':'CloudProvider','as':_0x0af8('0x10')}]}],'attributes':['id',_0x0af8('0x11'),_0x0af8('0x12')],'smtp':!![]}});};exports[_0x0af8('0x13')]=function(_0x24be44){return request(_0x0af8('0x14'),{'options':{'where':{'id':_0x24be44},'attributes':[_0x0af8('0x11')]}});};exports['getVoiceQueueById']=function(_0x58ef18){return request(_0x0af8('0x15'),{'options':{'where':{'id':_0x58ef18},'attributes':[_0x0af8('0x11')]}});};exports[_0x0af8('0x16')]=function(_0x216f0b){return request(_0x0af8('0x17'),{'options':{'where':{'id':_0x216f0b},'attributes':[_0x0af8('0x11')]}});};exports[_0x0af8('0x18')]=function(_0x325b4c){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x325b4c},'attributes':['dsn']}});};exports['getUserById']=function(_0x3294ce){return request(_0x0af8('0x19'),{'options':{'where':{'id':_0x3294ce},'attributes':['name']}});};exports[_0x0af8('0x1a')]=function(_0x230a68){return request(_0x0af8('0x1b'),{'options':{'where':{'phone':_0x230a68['phone']},'attributes':['id']}});};exports['getTrunkById']=function(_0x50b8fa){return request(_0x0af8('0x1c'),{'options':{'where':{'id':_0x50b8fa},'attributes':[_0x0af8('0x11')]}});};exports['getSoundById']=function(_0x2baa24){return request('ShowSound',{'options':{'where':{'id':_0x2baa24},'attributes':['save_name']}});};exports[_0x0af8('0x1d')]=function(_0x2e0b36){return request(_0x0af8('0x1e'),{'options':{'raw':![],'where':{'id':_0x2e0b36},'include':[{'model':_0x0af8('0x1f'),'as':_0x0af8('0x20')}]}});};exports['getSmsAccountById']=function(_0x592523){return request(_0x0af8('0x21'),{'options':{'where':{'id':_0x592523},'attributes':['id',_0x0af8('0x11')]}});};exports[_0x0af8('0x22')]=function(_0x300474){return request(_0x0af8('0x23'),{'body':_0x300474});};exports[_0x0af8('0x24')]=function(_0x1b046b){return request(_0x0af8('0x25'),{'body':_0x1b046b});};exports['createSquareReport']=function(_0x55e1ee){return request(_0x0af8('0x26'),{'body':_[_0x0af8('0x27')](_0x55e1ee,{'project_name':_0x55e1ee[_0x0af8('0x28')],'prev_project_name':_0x55e1ee[_0x0af8('0x29')]||'','is_subproject':_0x55e1ee['arg_2']?!![]:![],'leaveAt':moment()['format'](_0x0af8('0x2a'))})});};exports[_0x0af8('0x2b')]=function(_0x23a102){return request(_0x0af8('0x2c'),{'body':_0x23a102});};exports[_0x0af8('0x2d')]=function(_0x410216){return request(_0x0af8('0x2e'),{'body':_0x410216});};exports['createCmContact']=function(_0x34aa8b){return request(_0x0af8('0x2f'),{'options':{'raw':![],'where':{'phone':_0x34aa8b[_0x0af8('0x30')],'ListId':_0x34aa8b[_0x0af8('0x31')]}}})[_0x0af8('0x5')](function(_0x231230){if(_0x231230){return _0x231230;}return request(_0x0af8('0x32'),{'body':_0x34aa8b});});};exports[_0x0af8('0x33')]=function(_0x80bdcc){return request(_0x0af8('0x34'),{'options':{'where':{'id':_0x80bdcc},'attributes':[_0x0af8('0x11')]}});};exports['agentLogin']=function(_0x405a60,_0x497a8d){return request(_0x0af8('0x35'),{'body':{'interface':_0x497a8d},'options':{'where':_0x405a60}});};exports['agentPause']=function(_0x318ca7,_0x1d2d4f,_0x535352){return request(_0x0af8('0x36'),{'body':{'type':_0x1d2d4f,'uniqueid':_0x535352},'options':{'where':_0x318ca7}});};exports[_0x0af8('0x37')]=function(_0x34b3e5){return request('UnpauseUser',{'body':{},'options':{'where':_0x34b3e5}});};exports[_0x0af8('0x38')]=function(_0x3c6884){return request(_0x0af8('0x39'),{'body':{},'options':{'where':_0x3c6884}});}; \ No newline at end of file +var _0x34e8=['then','error','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getVoiceQueueById','ShowVoiceQueue','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','request'];(function(_0x488a70,_0x4819a4){var _0x30f375=function(_0x38635d){while(--_0x38635d){_0x488a70['push'](_0x488a70['shift']());}};_0x30f375(++_0x4819a4);}(_0x34e8,0x12c));var _0x834e=function(_0x5e38c,_0x142570){_0x5e38c=_0x5e38c-0x0;var _0x3845df=_0x34e8[_0x5e38c];return _0x3845df;};'use strict';var _=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var jayson=require(_0x834e('0x2'));var client=jayson[_0x834e('0x3')]['http']({'port':0x2329});function request(_0x832422,_0x21e2e0){return new Promise(function(_0x472111,_0x31bf20){return client[_0x834e('0x4')](_0x832422,_0x21e2e0)[_0x834e('0x5')](function(_0x398bee){if(_0x398bee['error']){return _0x31bf20(_0x398bee[_0x834e('0x6')]['message']);}else{return _0x472111(_0x398bee[_0x834e('0x7')]);}})[_0x834e('0x8')](function(_0x3a3ef6){return _0x31bf20(_0x3a3ef6);});});}exports[_0x834e('0x9')]=function(){return request(_0x834e('0xa'),{'options':{'raw':![],'attributes':['id',_0x834e('0xb'),_0x834e('0xc')]}});};exports[_0x834e('0xd')]=function(_0x3bdda9){return request(_0x834e('0xe'),{'options':{'raw':![],'where':{'name':_0x3bdda9},'attributes':[_0x834e('0xc')]}});};exports[_0x834e('0xf')]=function(_0x14038b){return request(_0x834e('0x10'),{'options':{'raw':![],'where':{'id':_0x14038b},'include':[{'model':_0x834e('0x11'),'as':_0x834e('0x12'),'include':[{'model':_0x834e('0x13'),'as':'CloudProvider'}]}],'attributes':['id',_0x834e('0xb'),_0x834e('0x14')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x23848e){return request(_0x834e('0xe'),{'options':{'where':{'id':_0x23848e},'attributes':[_0x834e('0xb')]}});};exports[_0x834e('0x15')]=function(_0x50e860){return request(_0x834e('0x16'),{'options':{'where':{'id':_0x50e860},'attributes':[_0x834e('0xb')]}});};exports['getVariableById']=function(_0x316205){return request('ShowVariable',{'options':{'where':{'id':_0x316205},'attributes':[_0x834e('0xb')]}});};exports[_0x834e('0x17')]=function(_0x478afe){return request(_0x834e('0x18'),{'options':{'where':{'id':_0x478afe},'attributes':[_0x834e('0x19')]}});};exports[_0x834e('0x1a')]=function(_0x50b3f6){return request(_0x834e('0x1b'),{'options':{'where':{'id':_0x50b3f6},'attributes':[_0x834e('0xb')]}});};exports[_0x834e('0x1c')]=function(_0xb993a1){return request(_0x834e('0x1d'),{'options':{'where':{'phone':_0xb993a1[_0x834e('0x1e')]},'attributes':['id']}});};exports[_0x834e('0x1f')]=function(_0x595515){return request(_0x834e('0x20'),{'options':{'where':{'id':_0x595515},'attributes':[_0x834e('0xb')]}});};exports[_0x834e('0x21')]=function(_0x325a99){return request('ShowSound',{'options':{'where':{'id':_0x325a99},'attributes':[_0x834e('0x22')]}});};exports[_0x834e('0x23')]=function(_0x5a05c0){return request(_0x834e('0x24'),{'options':{'raw':![],'where':{'id':_0x5a05c0},'include':[{'model':_0x834e('0x25'),'as':_0x834e('0x26')}]}});};exports['getSmsAccountById']=function(_0x4e3f48){return request(_0x834e('0x27'),{'options':{'where':{'id':_0x4e3f48},'attributes':['id',_0x834e('0xb')]}});};exports['createSmsMessage']=function(_0x25ee1d){return request(_0x834e('0x28'),{'body':_0x25ee1d});};exports['createSquareDetailsReport']=function(_0x3bc4f7){return request(_0x834e('0x29'),{'body':_0x3bc4f7});};exports[_0x834e('0x2a')]=function(_0x561cd2){return request(_0x834e('0x2b'),{'body':_[_0x834e('0x2c')](_0x561cd2,{'project_name':_0x561cd2['arg_1'],'prev_project_name':_0x561cd2['arg_2']||'','is_subproject':_0x561cd2[_0x834e('0x2d')]?!![]:![],'leaveAt':moment()['format'](_0x834e('0x2e'))})});};exports[_0x834e('0x2f')]=function(_0x3db026){return request(_0x834e('0x30'),{'body':_0x3db026});};exports[_0x834e('0x31')]=function(_0x130cc5){return request('CreateSquareMessage',{'body':_0x130cc5});};exports['createCmContact']=function(_0x4dc64a){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x4dc64a[_0x834e('0x1e')],'ListId':_0x4dc64a[_0x834e('0x32')]}}})[_0x834e('0x5')](function(_0x5dacc1){if(_0x5dacc1){return _0x5dacc1;}return request(_0x834e('0x33'),{'body':_0x4dc64a});});};exports[_0x834e('0x34')]=function(_0x1f3671){return request(_0x834e('0x35'),{'options':{'where':{'id':_0x1f3671},'attributes':[_0x834e('0xb')]}});};exports[_0x834e('0x36')]=function(_0x3d149d,_0xfaf716){return request(_0x834e('0x37'),{'body':{'interface':_0xfaf716},'options':{'where':_0x3d149d}});};exports['agentPause']=function(_0xef9ec2,_0x5cad11,_0x2c75c2){return request(_0x834e('0x38'),{'body':{'type':_0x5cad11,'uniqueid':_0x2c75c2},'options':{'where':_0xef9ec2}});};exports[_0x834e('0x39')]=function(_0x2b3418){return request(_0x834e('0x3a'),{'body':{},'options':{'where':_0x2b3418}});};exports[_0x834e('0x3b')]=function(_0x4696a1){return request(_0x834e('0x3c'),{'body':{},'options':{'where':_0x4696a1}});}; \ 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 99936e2..9b624b3 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 _0x16a6=['./polly','./lex'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x16a6,0x15c));var _0x616a=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0x16a6[_0x2d8d69];return _0x39ae22;};var polly=require(_0x616a('0x0'));var lex=require(_0x616a('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x9a14=['exports'];(function(_0x2619cd,_0x48536f){var _0x1753a6=function(_0x365f99){while(--_0x365f99){_0x2619cd['push'](_0x2619cd['shift']());}};_0x1753a6(++_0x48536f);}(_0x9a14,0xa8));var _0x49a1=function(_0x555521,_0x48ee61){_0x555521=_0x555521-0x0;var _0x688d7d=_0x9a14[_0x555521];return _0x688d7d;};var polly=require('./polly');var lex=require('./lex');module[_0x49a1('0x0')]={'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 9d746e3..ae46a5a 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 _0x750a=['exports'];(function(_0x31f588,_0x9e9797){var _0x19c178=function(_0x35a94f){while(--_0x35a94f){_0x31f588['push'](_0x31f588['shift']());}};_0x19c178(++_0x9e9797);}(_0x750a,0x140));var _0xa750=function(_0xaa0de8,_0x34a717){_0xaa0de8=_0xaa0de8-0x0;var _0x16724a=_0x750a[_0xaa0de8];return _0x16724a;};'use strict';var lex=require('./lib/api');module[_0xa750('0x0')]=function(_0x5368b2,_0x499583,_0x139fa5,_0xeb020d,_0x1b459c,_0x19bd5f){return lex(_0x5368b2,_0x499583,_0x139fa5,_0xeb020d,_0x1b459c,_0x19bd5f);}; \ No newline at end of file +var _0x153f=['exports','./lib/api'];(function(_0x135448,_0x4ca19f){var _0x28389e=function(_0x5a2113){while(--_0x5a2113){_0x135448['push'](_0x135448['shift']());}};_0x28389e(++_0x4ca19f);}(_0x153f,0x15b));var _0xf153=function(_0x4b1d27,_0x2d815a){_0x4b1d27=_0x4b1d27-0x0;var _0x3aa5de=_0x153f[_0x4b1d27];return _0x3aa5de;};'use strict';var lex=require(_0xf153('0x0'));module[_0xf153('0x1')]=function(_0xde7eae,_0x44cea3,_0x2afb9a,_0x1ccc1c,_0x3b85fc,_0x59757c){return lex(_0xde7eae,_0x44cea3,_0x2afb9a,_0x1ccc1c,_0x3b85fc,_0x59757c);}; \ 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 801b666..89e669e 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(_0xff2052,_0x1f81dc){var _0xa282f=function(_0x327867){while(--_0x327867){_0xff2052['push'](_0xff2052['shift']());}};_0xa282f(++_0x1f81dc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x1e8bc7,_0x21f69f){var _0x5b888f=function(_0x12e1e4){while(--_0x12e1e4){_0x1e8bc7['push'](_0x1e8bc7['shift']());}};_0x5b888f(++_0x21f69f);}(_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 6ae8195..b484458 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 _0x6cf1=['exports'];(function(_0x12e13a,_0x3f8461){var _0xf4cf3c=function(_0x54012f){while(--_0x54012f){_0x12e13a['push'](_0x12e13a['shift']());}};_0xf4cf3c(++_0x3f8461);}(_0x6cf1,0x190));var _0x16cf=function(_0x4c558a,_0x1b0736){_0x4c558a=_0x4c558a-0x0;var _0x35d47b=_0x6cf1[_0x4c558a];return _0x35d47b;};'use strict';var polly=require('./lib/api');module[_0x16cf('0x0')]=function(_0x2bba89,_0x46ca07,_0xfcba73,_0x5d1925,_0x46d005,_0x5a8456,_0x5c4da5){return polly(_0x2bba89,_0x46ca07,_0xfcba73,_0x5d1925,_0x46d005,_0x5a8456,_0x5c4da5);}; \ No newline at end of file +var _0x7996=['./lib/api','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7996,0xf0));var _0x6799=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0x7996[_0x5a636f];return _0x6a8cfb;};'use strict';var polly=require(_0x6799('0x0'));module[_0x6799('0x1')]=function(_0x18633c,_0xb050d4,_0x4db326,_0x59985f,_0x30dc4a,_0x3548cc,_0x3f3668){return polly(_0x18633c,_0xb050d4,_0x4db326,_0x59985f,_0x30dc4a,_0x3548cc,_0x3f3668);}; \ 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 176d6c7..677f0db 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 _0x19bc=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x29065c,_0x1a0997){var _0x57aaa7=function(_0x44c596){while(--_0x44c596){_0x29065c['push'](_0x29065c['shift']());}};_0x57aaa7(++_0x1a0997);}(_0x19bc,0xe9));var _0xc19b=function(_0x5a956d,_0x3f291e){_0x5a956d=_0x5a956d-0x0;var _0x2d14ed=_0x19bc[_0x5a956d];return _0x2d14ed;};'use strict';var fs=require('fs');var path=require(_0xc19b('0x0'));var BPromise=require(_0xc19b('0x1'));var rs=require('randomstring');var AWS=require(_0xc19b('0x2'));function pollyResult(_0x55bf07,_0x36b171,_0x5d9a35){return new BPromise(function(_0x22ca39,_0xecb000){_0x55bf07[_0xc19b('0x3')](_0x36b171,function(_0xf67665,_0x475ae9){if(_0xf67665){_0xecb000(_0xf67665);}else if(_0x475ae9){if(_0x475ae9['AudioStream']instanceof Buffer){fs[_0xc19b('0x4')](_0x5d9a35,_0x475ae9[_0xc19b('0x5')],function(_0x45a6f0){if(_0x45a6f0){_0xecb000(_0x45a6f0);}else{_0x22ca39();}});}else{_0xecb000(new Error(_0xc19b('0x6')));}}else{_0xecb000(new Error(_0xc19b('0x7')));}});});}module[_0xc19b('0x8')]=function(_0x1b948b,_0x4ad5eb,_0x2a8048,_0xeb0661,_0x3433c3,_0x1e69c6,_0x31c46a){var _0x52bca7=new AWS[(_0xc19b('0x9'))]({'accessKeyId':_0x1b948b,'secretAccessKey':_0x4ad5eb,'region':_0x2a8048});var _0x292501={'Text':_0x3433c3,'TextType':_0x1e69c6||_0xc19b('0xa'),'OutputFormat':_0xc19b('0xb'),'VoiceId':_0xeb0661};return pollyResult(_0x52bca7,_0x292501,_0x31c46a);}; \ No newline at end of file +var _0x29da=['mp3','bluebird','randomstring','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text'];(function(_0x56272d,_0x242414){var _0x57fb66=function(_0x1f6afc){while(--_0x1f6afc){_0x56272d['push'](_0x56272d['shift']());}};_0x57fb66(++_0x242414);}(_0x29da,0x14b));var _0xa29d=function(_0x582974,_0x5968cb){_0x582974=_0x582974-0x0;var _0x364d64=_0x29da[_0x582974];return _0x364d64;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xa29d('0x0'));var rs=require(_0xa29d('0x1'));var AWS=require(_0xa29d('0x2'));function pollyResult(_0x506c2e,_0x28392e,_0x322469){return new BPromise(function(_0x2f1358,_0xc5c4de){_0x506c2e['synthesizeSpeech'](_0x28392e,function(_0x55fb1c,_0x2912d4){if(_0x55fb1c){_0xc5c4de(_0x55fb1c);}else if(_0x2912d4){if(_0x2912d4[_0xa29d('0x3')]instanceof Buffer){fs[_0xa29d('0x4')](_0x322469,_0x2912d4['AudioStream'],function(_0x54a028){if(_0x54a028){_0xc5c4de(_0x54a028);}else{_0x2f1358();}});}else{_0xc5c4de(new Error(_0xa29d('0x5')));}}else{_0xc5c4de(new Error(_0xa29d('0x6')));}});});}module['exports']=function(_0x3941f1,_0xaa287a,_0x353b36,_0x234bac,_0x533dbf,_0x1642a8,_0x390324){var _0x240e47=new AWS[(_0xa29d('0x7'))]({'accessKeyId':_0x3941f1,'secretAccessKey':_0xaa287a,'region':_0x353b36});var _0x480c59={'Text':_0x533dbf,'TextType':_0x1642a8||_0xa29d('0x8'),'OutputFormat':_0xa29d('0x9'),'VoiceId':_0x234bac};return pollyResult(_0x240e47,_0x480c59,_0x390324);}; \ 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 1454297..3ba28f8 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 _0xba16=['./lib/api'];(function(_0x203963,_0x13ab7c){var _0xedaccc=function(_0x14bdde){while(--_0x14bdde){_0x203963['push'](_0x203963['shift']());}};_0xedaccc(++_0x13ab7c);}(_0xba16,0xba));var _0x6ba1=function(_0x422d6a,_0x20d24f){_0x422d6a=_0x422d6a-0x0;var _0x3bff4b=_0xba16[_0x422d6a];return _0x3bff4b;};'use strict';var asr=require(_0x6ba1('0x0'));module['exports']=function(_0xfa54a4,_0x2d4734,_0x21269e,_0x1a47fe){return asr(_0xfa54a4,_0x2d4734,_0x21269e);}; \ No newline at end of file +var _0xe173=['./lib/api','exports'];(function(_0x41d637,_0x3abcac){var _0x54b35a=function(_0x16a25c){while(--_0x16a25c){_0x41d637['push'](_0x41d637['shift']());}};_0x54b35a(++_0x3abcac);}(_0xe173,0x184));var _0x3e17=function(_0x7cac81,_0x4a90c8){_0x7cac81=_0x7cac81-0x0;var _0x3fb378=_0xe173[_0x7cac81];return _0x3fb378;};'use strict';var asr=require(_0x3e17('0x0'));module[_0x3e17('0x1')]=function(_0x581fff,_0xac9b88,_0x17325b,_0x1c2077){return asr(_0x581fff,_0xac9b88,_0x17325b);}; \ 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 237d5d8..0536f08 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 _0x7794=['string','length','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports'];(function(_0x2dd1d5,_0x24dd44){var _0x50308d=function(_0x10a3f5){while(--_0x10a3f5){_0x2dd1d5['push'](_0x2dd1d5['shift']());}};_0x50308d(++_0x24dd44);}(_0x7794,0x7b));var _0x4779=function(_0xb2271,_0x2c42e9){_0xb2271=_0xb2271-0x0;var _0x58b75b=_0x7794[_0xb2271];return _0x58b75b;};'use strict';var url=require('url');var BPromise=require(_0x4779('0x0'));var fs=require('fs');var host=_0x4779('0x1');module[_0x4779('0x2')]=function(_0xa47992,_0x493318,_0x309b79){return new BPromise(function(_0x1e9fdc,_0x4d3b05){var _0x40e5f9;if(typeof _0xa47992!=='string'||_0xa47992['length']===0x0){return _0x4d3b05('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x493318!==_0x4779('0x3')||_0x493318[_0x4779('0x4')]===0x0){return _0x4d3b05('key\x20should\x20be\x20a\x20string');}if(typeof _0x309b79!==_0x4779('0x5')&&(typeof _0x309b79!==_0x4779('0x3')||_0x309b79[_0x4779('0x4')]===0x0)){return _0x4d3b05(_0x4779('0x6'));}try{_0x40e5f9=fs[_0x4779('0x7')](_0xa47992)[_0x4779('0x8')](_0x4779('0x9'));}catch(_0x5e4992){return _0x4d3b05(_0x5e4992);}return _0x1e9fdc({'method':_0x4779('0xa'),'uri':host+_0x4779('0xb')+_0x493318,'body':{'config':{'encoding':_0x4779('0xc'),'sampleRateHertz':_0x4779('0xd'),'languageCode':_0x309b79},'audio':{'content':_0x40e5f9}},'json':!![]});});}; \ No newline at end of file +var _0x57d4=['key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x4c6ab4,_0x26f57e){var _0x59938c=function(_0x4cab25){while(--_0x4cab25){_0x4c6ab4['push'](_0x4c6ab4['shift']());}};_0x59938c(++_0x26f57e);}(_0x57d4,0x78));var _0x457d=function(_0x14a442,_0x5f04ff){_0x14a442=_0x14a442-0x0;var _0x291baf=_0x57d4[_0x14a442];return _0x291baf;};'use strict';var url=require(_0x457d('0x0'));var BPromise=require(_0x457d('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x457d('0x2')]=function(_0xa408c8,_0x1e26ab,_0x30a25c){return new BPromise(function(_0x1219e1,_0x3c89b2){var _0x3e2239;if(typeof _0xa408c8!==_0x457d('0x3')||_0xa408c8[_0x457d('0x4')]===0x0){return _0x3c89b2(_0x457d('0x5'));}if(typeof _0x1e26ab!==_0x457d('0x3')||_0x1e26ab['length']===0x0){return _0x3c89b2(_0x457d('0x6'));}if(typeof _0x30a25c!==_0x457d('0x7')&&(typeof _0x30a25c!=='string'||_0x30a25c['length']===0x0)){return _0x3c89b2(_0x457d('0x8'));}try{_0x3e2239=fs[_0x457d('0x9')](_0xa408c8)[_0x457d('0xa')]('base64');}catch(_0x5bc628){return _0x3c89b2(_0x5bc628);}return _0x1219e1({'method':'POST','uri':host+_0x457d('0xb')+_0x1e26ab,'body':{'config':{'encoding':_0x457d('0xc'),'sampleRateHertz':_0x457d('0xd'),'languageCode':_0x30a25c},'audio':{'content':_0x3e2239}},'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 38a07bd..10cb4be 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 _0x8cda=['./asr'];(function(_0x35213d,_0x5a5f7b){var _0x4559eb=function(_0x3d6aa7){while(--_0x3d6aa7){_0x35213d['push'](_0x35213d['shift']());}};_0x4559eb(++_0x5a5f7b);}(_0x8cda,0xb2));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};var asr=require(_0xa8cd('0x0'));module['exports']={'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/scripts/index.js b/server/services/agi/scripts/index.js index 6ba0d3c..5b2cbe0 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 _0x026e=['POST','.mp3','from','audioContent','writeFile','resolve','unlink','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','base64','goggleTTS\x20path','uri','results','map','alternatives','transcript','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','googleDialogflow','result','source','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','nda','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','./aws','./sestek','./tilde','../../../config/logger','protocol','https:','host','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','pipe','get','data','end','transcode','error\x20convert','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','then','chmodSync','777','split','googleCloudTTS','ssml','input','MP3','text:synthesize'];(function(_0x48e0a4,_0x13a5e1){var _0x571222=function(_0x366349){while(--_0x366349){_0x48e0a4['push'](_0x48e0a4['shift']());}};_0x571222(++_0x13a5e1);}(_0x026e,0x16b));var _0xe026=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x026e[_0x20a584];return _0x4b41a8;};'use strict';var apiai=require(_0xe026('0x0'));var BPromise=require(_0xe026('0x1'));var dialogflow=require(_0xe026('0x2'));var fs=require('fs');var http=require(_0xe026('0x3'));var https=require(_0xe026('0x4'));var md5=require(_0xe026('0x5'));var path=require(_0xe026('0x6'));var querystring=require(_0xe026('0x7'));var rp=require(_0xe026('0x8'));var rs=require(_0xe026('0x9'));var sox=require(_0xe026('0xa'));var tts=require(_0xe026('0xb'));var urlParse=require(_0xe026('0xc'))[_0xe026('0xd')];var util=require('util');var aws=require(_0xe026('0xe'));var google=require('./google');var sestek=require(_0xe026('0xf'));var tilde=require(_0xe026('0x10'));var logger=require(_0xe026('0x11'))('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x528717,_0x402414){return new BPromise(function(_0x50c101,_0x5d59c7){var _0x17e0f1=urlParse(_0x528717);var _0x2fc51b=_0x17e0f1[_0xe026('0x12')]===_0xe026('0x13')?https:http;var _0x52a1cb={'host':_0x17e0f1[_0xe026('0x14')],'path':_0x17e0f1[_0xe026('0x6')],'headers':{'user-agent':_0xe026('0x15')}};_0x2fc51b['get'](_0x52a1cb,function(_0x174891){if(_0x174891[_0xe026('0x16')]!==0xc8){logger[_0xe026('0x17')](_0xe026('0x18')+_0x528717+_0xe026('0x19')+_0x174891[_0xe026('0x16')]+'\x20('+_0x174891[_0xe026('0x1a')]+')');_0x5d59c7(new Error(_0xe026('0x18')+_0x528717+_0xe026('0x19')+_0x174891[_0xe026('0x16')]+'\x20('+_0x174891[_0xe026('0x1a')]+')'));return;}var _0x3fb417=fs[_0xe026('0x1b')](_0x402414);_0x3fb417['on'](_0xe026('0x1c'),function(){logger[_0xe026('0x1d')](_0xe026('0x1e'));_0x3fb417[_0xe026('0x1f')](_0x50c101);});_0x3fb417['on'](_0xe026('0x17'),function(_0x3f24d6){fs['unlink'](_0x402414);logger[_0xe026('0x17')](_0xe026('0x20'),_0x3f24d6);_0x5d59c7(_0x3f24d6);});_0x174891[_0xe026('0x21')](_0x3fb417);})['on'](_0xe026('0x17'),function(_0x549832){logger[_0xe026('0x17')](_0x549832);_0x5d59c7(_0x549832);})['end']();});}function uploadFile(_0x49ced9){return new BPromise(function(_0x4e90d4,_0xe285b5){var _0x4e4410=urlParse(_0x49ced9);var _0x4fe2c0=_0x4e4410[_0xe026('0x12')]===_0xe026('0x13')?https:http;var _0x5a3e86={'host':_0x4e4410[_0xe026('0x14')],'path':_0x4e4410[_0xe026('0x6')],'headers':{'user-agent':_0xe026('0x15')}};_0x4fe2c0[_0xe026('0x22')](_0x5a3e86,function(_0x218cc0){if(_0x218cc0[_0xe026('0x16')]!==0xc8){_0xe285b5(new Error('request\x20to\x20'+_0x49ced9+_0xe026('0x19')+_0x218cc0[_0xe026('0x16')]+'\x20('+_0x218cc0[_0xe026('0x1a')]+')'));return;}var _0x508930='';_0x218cc0['on'](_0xe026('0x23'),function(_0x18e81e){_0x508930+=_0x18e81e;});_0x218cc0['on']('end',function(){_0x4e90d4(_0x508930);});})['on'](_0xe026('0x17'),function(_0x2e0c9e){_0xe285b5(_0x2e0c9e);})[_0xe026('0x24')]();});}function convertFile(_0x3274d6,_0x48f147){return new BPromise(function(_0x2131fb,_0x37a3e0){var _0x56d077=sox[_0xe026('0x25')](_0x3274d6,_0x48f147,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x56d077['on'](_0xe026('0x17'),function(_0x2904d6){logger[_0xe026('0x17')](_0xe026('0x26'),_0x2904d6);_0x37a3e0(_0x2904d6);});_0x56d077['on'](_0xe026('0x24'),function(){logger[_0xe026('0x1d')](_0xe026('0x27'));_0x2131fb();});_0x56d077[_0xe026('0x28')]();});}function base64Decode(_0x54014b,_0x4b4670){var _0x444057=path['resolve'](__dirname,_0xe026('0x29'),rs[_0xe026('0x2a')](0x4)+_0xe026('0x2b'));fs[_0xe026('0x2c')](_0x444057,_0x54014b,'base64');return convertFile(_0x444057,_0x4b4670)[_0xe026('0x2d')](function(){try{fs['unlink'](_0x444057);fs[_0xe026('0x2e')](_0x4b4670,_0xe026('0x2f'));}catch(_0x57143a){logger[_0xe026('0x17')](_0x57143a);}return _0x4b4670[_0xe026('0x30')]('.')[0x0];});}function base64Encode(_0x30f74a){var _0x4685e7=fs['readFileSync'](_0x30f74a);return new Buffer(_0x4685e7)['toString']('base64');}exports[_0xe026('0x31')]=function(_0x9b9cd5,_0x3e42db,_0x15d1be,_0x120633,_0x1d88d1,_0x46bf59){var _0x3e0442,_0x2aa269;var _0xc92dba='https://texttospeech.googleapis.com/v1/';var _0x28b0f1='?key='+_0x9b9cd5;var _0x2bcc2b={};if(_0x3e42db===_0xe026('0x32')){_0x2bcc2b[_0xe026('0x33')]={'ssml':_0x15d1be};}else{_0x2bcc2b[_0xe026('0x33')]={'text':_0x15d1be};};_0x2bcc2b['voice']={'languageCode':_0x120633,'ssmlGender':_0x1d88d1};_0x2bcc2b['audioConfig']={'audioEncoding':_0xe026('0x34'),'sampleRateHertz':0x1f40};var _0x1d45c1={'url':_0xc92dba+_0xe026('0x35')+_0x28b0f1,'method':_0xe026('0x36'),'json':!![],'body':_0x2bcc2b};return rp(_0x1d45c1)[_0xe026('0x2d')](function(_0x486d75){return new BPromise(function(_0x70ff5,_0xdce487){_0x3e0442=path['resolve'](__dirname,_0xe026('0x29'),rs['generate'](0x4)+_0xe026('0x37'));var _0x20d9dd=Buffer[_0xe026('0x38')](_0x486d75[_0xe026('0x39')],'base64');return fs[_0xe026('0x3a')](_0x3e0442,_0x20d9dd,function(_0x23dade){_0xdce487(_0x23dade);},function(_0x56b836){fs[_0xe026('0x2e')](_0x3e0442,_0xe026('0x2f'));_0x70ff5(_0x56b836);});});})[_0xe026('0x2d')](function(_0x3879f3){_0x2aa269=path[_0xe026('0x3b')](__dirname,_0xe026('0x29'),rs['generate'](0x4)+_0xe026('0x2b'));return convertFile(_0x3e0442,_0x2aa269);})[_0xe026('0x2d')](function(){try{fs[_0xe026('0x3c')](_0x3e0442);fs[_0xe026('0x2e')](_0x2aa269,_0xe026('0x2f'));}catch(_0x3e4262){logger['error'](_0x3e4262);}logger[_0xe026('0x1d')](_0xe026('0x3d'),_0x2aa269['split']('.')[0x0]);return _0x2aa269['split']('.')[0x0];});};exports[_0xe026('0x3e')]=function(_0x2a7896,_0xecee56){var _0x27bce4=_0xe026('0x3f');var _0x207797,_0x500750;var _0x256546;var _0x30f233={'encoding':'utf8','method':_0xe026('0x36'),'timeout':0x2710,'url':_0x27bce4,'headers':{'Content-Type':_0xe026('0x40')},'body':_0xe026('0x41')+encodeURIComponent(JSON[_0xe026('0x42')]([[[_0xe026('0x43'),JSON[_0xe026('0x42')]([_0x2a7896,_0xecee56||'en',![],_0xe026('0x44')]),null,_0xe026('0x45')]]]))};return rp(_0x30f233)[_0xe026('0x2d')](function(_0x5d40f0){try{_0x256546=eval(_0x5d40f0['slice'](0x5))[0x0][0x2];}catch(_0x22f70c){throw new Error(_0xe026('0x46')+_0x5d40f0['data']);}if(!_0x256546){if(_0x2a7896[_0xe026('0x47')]>0xc8){throw new Error(_0xe026('0x48'));}else{throw new Error(_0xe026('0x49')+_0xecee56+_0xe026('0x4a'));}}try{_0x256546=eval(_0x256546)[0x0];}catch(_0x113980){throw new Error(_0xe026('0x46')+res['data']);}const _0x31aa95=_0x256546;_0x207797=path[_0xe026('0x3b')](__dirname,_0xe026('0x29'),rs[_0xe026('0x2a')](0x4)+_0xe026('0x37'));fs['writeFileSync'](_0x207797,_0x256546,{'encoding':_0xe026('0x4b')});_0x500750=path[_0xe026('0x3b')](__dirname,'tmp',rs[_0xe026('0x2a')](0x4)+_0xe026('0x2b'));return convertFile(_0x207797,_0x500750);})[_0xe026('0x2d')](function(){try{fs[_0xe026('0x3c')](_0x207797);fs[_0xe026('0x2e')](_0x500750,'777');}catch(_0x13a3dd){logger['error'](_0x13a3dd);}logger[_0xe026('0x1d')](_0xe026('0x4c'),_0x500750['split']('.')[0x0]);return _0x500750[_0xe026('0x30')]('.')[0x0];});};exports['googleASR']=function(_0x5cc446,_0x46aed6,_0x478e74){return google['asr'](_0x5cc446,_0x46aed6,_0x478e74)['then'](function(_0x47bd57){logger['info'](_0x47bd57[_0xe026('0x4d')]);return rp(_0x47bd57);})[_0xe026('0x2d')](function(_0x5a89db){var _0x5e7fda='';var _0x290217=0x0;try{fs[_0xe026('0x3c')](_0x5cc446);}catch(_0x2793bc){logger[_0xe026('0x17')](_0x2793bc);}if(_0x5a89db&&_0x5a89db['results']){_0x5e7fda=_0x5a89db[_0xe026('0x4e')][_0xe026('0x4f')](function(_0xc4538d){return _0xc4538d&&_0xc4538d[_0xe026('0x50')][0x0]&&_0xc4538d[_0xe026('0x50')][0x0]['transcript']?_0xc4538d[_0xe026('0x50')][0x0][_0xe026('0x51')]:'';})['join']('\x0a');_0x290217=_0x5a89db[_0xe026('0x4e')][_0xe026('0x4f')](function(_0x9d4756){return _0x9d4756&&_0x9d4756[_0xe026('0x50')][0x0]&&_0x9d4756[_0xe026('0x50')][0x0][_0xe026('0x52')]?_0x9d4756[_0xe026('0x50')][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0xe026('0x1d')](_0xe026('0x53'),_0x5e7fda);logger[_0xe026('0x1d')](_0xe026('0x54'),_0x290217);return{'transcript':_0x5e7fda,'confidence':_0x290217};})['catch'](function(_0x61b873){logger['error'](_0xe026('0x55'),_0x61b873[_0xe026('0x16')],_0x61b873[_0xe026('0x56')],_0x61b873['message']);});};exports[_0xe026('0x57')]=function(_0x4dbd07,_0x7036be,_0x114199,_0x3ca360){var _0x4529fb=apiai(_0x7036be,{'language':_0x3ca360||'en'});return _0x4529fb['textRequest'](_0x114199,{'sessionId':md5(_0x4dbd07)})[_0xe026('0x2d')](function(_0x4c3214){logger[_0xe026('0x1d')](JSON['stringify'](_0x4c3214));return{'source':_0x4c3214[_0xe026('0x58')][_0xe026('0x59')],'resolvedQuery':_0x4c3214[_0xe026('0x58')]['resolvedQuery'],'action':_0x4c3214['result'][_0xe026('0x5a')],'actionIncomplete':_0x4c3214[_0xe026('0x58')][_0xe026('0x5b')],'speech':_0x4c3214[_0xe026('0x58')][_0xe026('0x5c')][_0xe026('0x5d')],'score':_0x4c3214[_0xe026('0x58')][_0xe026('0x5e')],'statusCode':_0x4c3214[_0xe026('0x5f')][_0xe026('0x60')],'endConversation':_0x4c3214[_0xe026('0x58')][_0xe026('0x61')][_0xe026('0x62')]||![],'isFallbackIntent':_0x4c3214[_0xe026('0x58')][_0xe026('0x61')][_0xe026('0x63')]};});};exports[_0xe026('0x64')]=function(_0x38874f,_0x5f4ed5,_0x3e2b89,_0xd9a767,_0x5c2290,_0x57c03b){var _0x5b3103=_0xd9a767['replace'](/\\n/g,'\x0a');var _0x32da8c={'credentials':{'private_key':_0x5b3103,'client_email':_0x3e2b89}};var _0x1836d6=new dialogflow[(_0xe026('0x65'))](_0x32da8c);var _0x20efc4=_0x1836d6[_0xe026('0x66')](_0x5f4ed5,md5(_0x38874f));var _0x4bfd9f={'session':_0x20efc4,'queryInput':{'text':{'text':_0x5c2290,'languageCode':_0x57c03b}}};return _0x1836d6[_0xe026('0x67')](_0x4bfd9f)['then'](function(_0x4846a0){if(_0x4846a0&&_0x4846a0[_0xe026('0x47')]){logger[_0xe026('0x1d')](_0xe026('0x68'),JSON[_0xe026('0x42')](_0x4846a0));var _0xe67467=_0x4846a0[0x0];if(_0xe67467){var _0x3028f5={'action':_0xe67467[_0xe026('0x69')]['action'],'allRequiredParamsPresent':_0xe67467[_0xe026('0x69')][_0xe026('0x6a')],'endConversation':_0xe67467[_0xe026('0x69')]['diagnosticInfo']&&_0xe67467[_0xe026('0x69')][_0xe026('0x6b')]['fields']?_0xe67467['queryResult']['diagnosticInfo'][_0xe026('0x6c')][_0xe026('0x6d')][_0xe026('0x6e')]:![],'fulfillmentText':_0xe67467[_0xe026('0x69')]['fulfillmentText'],'intentName':_0xe67467['queryResult'][_0xe026('0x6f')][_0xe026('0x56')],'intentDisplayName':_0xe67467[_0xe026('0x69')]['intent'][_0xe026('0x70')],'isFallbackIntent':_0xe67467[_0xe026('0x69')]['intent'][_0xe026('0x71')],'languageCode':_0xe67467[_0xe026('0x69')][_0xe026('0x72')],'queryText':_0xe67467[_0xe026('0x69')]['queryText'],'responseId':_0xe67467[_0xe026('0x73')],'score':_0xe67467[_0xe026('0x69')][_0xe026('0x74')],'speech':_0xe67467[_0xe026('0x69')][_0xe026('0x75')],'providerResponse':JSON[_0xe026('0x42')](_0x4846a0)};return _0x3028f5;}}});};exports[_0xe026('0x76')]=function(_0x1e33e6,_0x270eb7,_0x20e5ac,_0x10c372){return tilde[_0xe026('0x77')](_0x1e33e6,_0x270eb7,_0x20e5ac,_0x10c372)['then'](function(_0x13c0b5){try{fs[_0xe026('0x3c')](_0x1e33e6);}catch(_0x4b630c){logger[_0xe026('0x17')](_0x4b630c);}logger['info'](_0xe026('0x78'),_0x13c0b5['transcript']);logger['info'](_0xe026('0x79'),_0x13c0b5[_0xe026('0x52')]);return _0x13c0b5;});};exports['awsPolly']=function(_0x5dcaa8,_0x2d25b3,_0x26d70a,_0x5c0af8,_0x153320,_0x16afe4){var _0x306329=path['resolve'](__dirname,_0xe026('0x29'),rs[_0xe026('0x2a')](0x4)+_0xe026('0x37'));var _0x3265e6;return aws[_0xe026('0x7a')](_0x5dcaa8,_0x2d25b3,_0x26d70a,_0x5c0af8,_0x153320,_0x16afe4,_0x306329)[_0xe026('0x2d')](function(){_0x3265e6=path[_0xe026('0x3b')](__dirname,_0xe026('0x29'),rs[_0xe026('0x2a')](0x4)+_0xe026('0x2b'));return convertFile(_0x306329,_0x3265e6);})['then'](function(){try{fs[_0xe026('0x3c')](_0x306329);fs[_0xe026('0x2e')](_0x3265e6,_0xe026('0x2f'));}catch(_0x37c93a){logger[_0xe026('0x17')](_0x37c93a);}return _0x3265e6[_0xe026('0x30')]('.')[0x0];});};exports['awsLex']=function(_0x8d8563,_0x3e67f4,_0x274684,_0x9f90c8,_0x56cc3d,_0x3f3077){return aws[_0xe026('0x7b')](_0x8d8563,_0x3e67f4,_0x274684,_0x9f90c8,_0x56cc3d,_0x3f3077)[_0xe026('0x2d')](function(_0x2fd617){logger['info'](JSON[_0xe026('0x42')](_0x2fd617));return _0x2fd617;});};exports[_0xe026('0x7c')]=function(_0x4d9fe4,_0x1f2064,_0x19fa57,_0x576b07){var _0x5238ea=util['format'](_0xe026('0x7d'),ISPEECH_API,_0x4d9fe4,encodeURIComponent(_0x1f2064),_0x19fa57,_0x576b07);var _0x444d81=path['resolve'](__dirname,_0xe026('0x29'),rs[_0xe026('0x2a')](0x4)+'.mp3');var _0x5e49fa;return downloadFile(_0x5238ea,_0x444d81)[_0xe026('0x2d')](function(){_0x5e49fa=path[_0xe026('0x3b')](__dirname,_0xe026('0x29'),rs[_0xe026('0x2a')](0x4)+_0xe026('0x2b'));return convertFile(_0x444d81,_0x5e49fa);})['then'](function(){try{fs[_0xe026('0x3c')](_0x444d81);fs[_0xe026('0x2e')](_0x5e49fa,'777');}catch(_0x1eb9d0){logger[_0xe026('0x17')](_0x1eb9d0);}return _0x5e49fa[_0xe026('0x30')]('.')[0x0];});};exports[_0xe026('0x7e')]=function(_0x5e57cc,_0x4b8d6e,_0x54b50c,_0x16302){var _0x1f1926=util[_0xe026('0x7f')](_0xe026('0x80'),ISPEECH_API,_0x4b8d6e,_0x54b50c,base64Encode(_0x5e57cc),_0x16302?util[_0xe026('0x7f')](_0xe026('0x81'),encodeURIComponent(_0x16302)):_0xe026('0x82'));return uploadFile(_0x1f1926)[_0xe026('0x2d')](function(_0x3e1e50){return querystring[_0xe026('0xd')](_0x3e1e50);});};exports['sestekNDA']=function(_0x37c9d6,_0x4ef9bc){return sestek[_0xe026('0x83')](_0x37c9d6,_0x4ef9bc)[_0xe026('0x2d')](function(_0x472ad3){logger[_0xe026('0x1d')](JSON[_0xe026('0x42')](_0x472ad3));var _0x504aee={'speech':_0x472ad3[_0xe026('0x84')],'action':_0x472ad3[_0xe026('0x85')]?_0x472ad3[_0xe026('0x85')][_0xe026('0x86')]:undefined,'actiondata':_0x472ad3[_0xe026('0x85')]?_0x472ad3[_0xe026('0x85')]['CustomActionData']:undefined};if(_0x472ad3[_0xe026('0x85')]&&_0x472ad3['channelData'][_0xe026('0x87')]){return base64Decode(_0x472ad3[_0xe026('0x85')]['AudioFromTts'][_0xe026('0x88')],path[_0xe026('0x3b')](__dirname,'tmp',rs[_0xe026('0x2a')](0x4)+_0xe026('0x2b')))[_0xe026('0x2d')](function(_0xbc90cf){_0x504aee[_0xe026('0x89')]=_0xbc90cf;return _0x504aee;});}return _0x504aee;});};exports[_0xe026('0x8a')]=function(){return __dirname;}; \ No newline at end of file +var _0x78e8=['confidence','join','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','actionIncomplete','fulfillment','speech','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','dialogflow','https','path','querystring','request-promise','randomstring','google-tts-api','parse','util','./aws','./google','./sestek','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish\x20download\x20file','close','unlink','download\x20error','pipe','https:','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','chmodSync','777','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','input','voice','audioConfig','MP3','text:synthesize','POST','then','resolve','from','audioContent','writeFile','googleCloudTTS\x20path','split','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','jQ1olc','stringify','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','info','goggleTTS\x20path','asr','uri','results','alternatives','transcript','map'];(function(_0x1b4206,_0x3eaf43){var _0x303b1a=function(_0x2ff59c){while(--_0x2ff59c){_0x1b4206['push'](_0x1b4206['shift']());}};_0x303b1a(++_0x3eaf43);}(_0x78e8,0x1df));var _0x878e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x78e8[_0x5b561d];return _0x431060;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0x878e('0x0'));var fs=require('fs');var http=require('http');var https=require(_0x878e('0x1'));var md5=require('md5');var path=require(_0x878e('0x2'));var querystring=require(_0x878e('0x3'));var rp=require(_0x878e('0x4'));var rs=require(_0x878e('0x5'));var sox=require('sox');var tts=require(_0x878e('0x6'));var urlParse=require('url')[_0x878e('0x7')];var util=require(_0x878e('0x8'));var aws=require(_0x878e('0x9'));var google=require(_0x878e('0xa'));var sestek=require(_0x878e('0xb'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0x878e('0xc'));var ISPEECH_API=_0x878e('0xd');function downloadFile(_0x2aaa31,_0x560c03){return new BPromise(function(_0x56571d,_0x42922a){var _0x458c2e=urlParse(_0x2aaa31);var _0x12ecd5=_0x458c2e[_0x878e('0xe')]==='https:'?https:http;var _0x4a73c4={'host':_0x458c2e[_0x878e('0xf')],'path':_0x458c2e['path'],'headers':{'user-agent':_0x878e('0x10')}};_0x12ecd5[_0x878e('0x11')](_0x4a73c4,function(_0x2b47b3){if(_0x2b47b3[_0x878e('0x12')]!==0xc8){logger[_0x878e('0x13')](_0x878e('0x14')+_0x2aaa31+_0x878e('0x15')+_0x2b47b3[_0x878e('0x12')]+'\x20('+_0x2b47b3[_0x878e('0x16')]+')');_0x42922a(new Error(_0x878e('0x14')+_0x2aaa31+_0x878e('0x15')+_0x2b47b3[_0x878e('0x12')]+'\x20('+_0x2b47b3[_0x878e('0x16')]+')'));return;}var _0x36773f=fs[_0x878e('0x17')](_0x560c03);_0x36773f['on']('finish',function(){logger['info'](_0x878e('0x18'));_0x36773f[_0x878e('0x19')](_0x56571d);});_0x36773f['on'](_0x878e('0x13'),function(_0x51683a){fs[_0x878e('0x1a')](_0x560c03);logger[_0x878e('0x13')](_0x878e('0x1b'),_0x51683a);_0x42922a(_0x51683a);});_0x2b47b3[_0x878e('0x1c')](_0x36773f);})['on'](_0x878e('0x13'),function(_0x13dd2d){logger['error'](_0x13dd2d);_0x42922a(_0x13dd2d);})['end']();});}function uploadFile(_0xa2914f){return new BPromise(function(_0x27a8ac,_0x180658){var _0x1e018c=urlParse(_0xa2914f);var _0x4714b5=_0x1e018c[_0x878e('0xe')]===_0x878e('0x1d')?https:http;var _0x1bd13f={'host':_0x1e018c['host'],'path':_0x1e018c['path'],'headers':{'user-agent':_0x878e('0x10')}};_0x4714b5[_0x878e('0x11')](_0x1bd13f,function(_0x5832cc){if(_0x5832cc[_0x878e('0x12')]!==0xc8){_0x180658(new Error(_0x878e('0x14')+_0xa2914f+'\x20failed,\x20status\x20code\x20=\x20'+_0x5832cc['statusCode']+'\x20('+_0x5832cc['statusMessage']+')'));return;}var _0xba40dd='';_0x5832cc['on'](_0x878e('0x1e'),function(_0x6abac5){_0xba40dd+=_0x6abac5;});_0x5832cc['on'](_0x878e('0x1f'),function(){_0x27a8ac(_0xba40dd);});})['on'](_0x878e('0x13'),function(_0x5b4b3e){_0x180658(_0x5b4b3e);})[_0x878e('0x1f')]();});}function convertFile(_0x47d023,_0x1eeac0){return new BPromise(function(_0x58b39b,_0x1c076d){var _0x3014fc=sox[_0x878e('0x20')](_0x47d023,_0x1eeac0,{'sampleRate':0x1f40,'format':_0x878e('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3014fc['on'](_0x878e('0x13'),function(_0xaf24c0){logger[_0x878e('0x13')](_0x878e('0x22'),_0xaf24c0);_0x1c076d(_0xaf24c0);});_0x3014fc['on']('end',function(){logger['info'](_0x878e('0x23'));_0x58b39b();});_0x3014fc[_0x878e('0x24')]();});}function base64Decode(_0x361320,_0x3445f3){var _0x3ae388=path['resolve'](__dirname,_0x878e('0x25'),rs[_0x878e('0x26')](0x4)+_0x878e('0x27'));fs[_0x878e('0x28')](_0x3ae388,_0x361320,'base64');return convertFile(_0x3ae388,_0x3445f3)['then'](function(){try{fs['unlink'](_0x3ae388);fs[_0x878e('0x29')](_0x3445f3,_0x878e('0x2a'));}catch(_0x3533d0){logger[_0x878e('0x13')](_0x3533d0);}return _0x3445f3['split']('.')[0x0];});}function base64Encode(_0x366726){var _0x3a899d=fs['readFileSync'](_0x366726);return new Buffer(_0x3a899d)[_0x878e('0x2b')](_0x878e('0x2c'));}exports[_0x878e('0x2d')]=function(_0x516c26,_0x5870c9,_0x5e5dd4,_0x55dbd0,_0x11c6cc,_0x52867e){var _0x3465d8,_0xae5e1a;var _0x41fabd=_0x878e('0x2e');var _0xeb0edc='?key='+_0x516c26;var _0x2c9a61={};if(_0x5870c9==='ssml'){_0x2c9a61[_0x878e('0x2f')]={'ssml':_0x5e5dd4};}else{_0x2c9a61[_0x878e('0x2f')]={'text':_0x5e5dd4};};_0x2c9a61[_0x878e('0x30')]={'languageCode':_0x55dbd0,'ssmlGender':_0x11c6cc};_0x2c9a61[_0x878e('0x31')]={'audioEncoding':_0x878e('0x32'),'sampleRateHertz':0x1f40};var _0x6b7b06={'url':_0x41fabd+_0x878e('0x33')+_0xeb0edc,'method':_0x878e('0x34'),'json':!![],'body':_0x2c9a61};return rp(_0x6b7b06)[_0x878e('0x35')](function(_0x37d13c){return new BPromise(function(_0x4558dc,_0x386b3a){_0x3465d8=path[_0x878e('0x36')](__dirname,_0x878e('0x25'),rs['generate'](0x4)+'.mp3');var _0x1a92a4=Buffer[_0x878e('0x37')](_0x37d13c[_0x878e('0x38')],_0x878e('0x2c'));return fs[_0x878e('0x39')](_0x3465d8,_0x1a92a4,function(_0x501db6){_0x386b3a(_0x501db6);},function(_0x372a3b){fs['chmodSync'](_0x3465d8,'777');_0x4558dc(_0x372a3b);});});})['then'](function(_0x829b91){_0xae5e1a=path['resolve'](__dirname,_0x878e('0x25'),rs[_0x878e('0x26')](0x4)+_0x878e('0x27'));return convertFile(_0x3465d8,_0xae5e1a);})[_0x878e('0x35')](function(){try{fs[_0x878e('0x1a')](_0x3465d8);fs[_0x878e('0x29')](_0xae5e1a,_0x878e('0x2a'));}catch(_0x1f8ecd){logger['error'](_0x1f8ecd);}logger['info'](_0x878e('0x3a'),_0xae5e1a['split']('.')[0x0]);return _0xae5e1a[_0x878e('0x3b')]('.')[0x0];});};exports['googleTTS']=function(_0x465473,_0x3aaaa7){var _0x408eaf=_0x878e('0x3c');var _0x4b586b,_0x2e0049;var _0x39c9e0;var _0x9ff9b5={'encoding':_0x878e('0x3d'),'method':_0x878e('0x34'),'timeout':0x2710,'url':_0x408eaf,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x878e('0x3e')+encodeURIComponent(JSON['stringify']([[[_0x878e('0x3f'),JSON[_0x878e('0x40')]([_0x465473,_0x3aaaa7||'en',![],'null']),null,_0x878e('0x41')]]]))};return rp(_0x9ff9b5)[_0x878e('0x35')](function(_0x27f72e){try{_0x39c9e0=eval(_0x27f72e[_0x878e('0x42')](0x5))[0x0][0x2];}catch(_0x35562d){throw new Error(_0x878e('0x43')+_0x27f72e[_0x878e('0x1e')]);}if(!_0x39c9e0){if(_0x465473[_0x878e('0x44')]>0xc8){throw new Error(_0x878e('0x45'));}else{throw new Error(_0x878e('0x46')+_0x3aaaa7+_0x878e('0x47'));}}try{_0x39c9e0=eval(_0x39c9e0)[0x0];}catch(_0x1223c6){throw new Error(_0x878e('0x43')+res[_0x878e('0x1e')]);}const _0x19befb=_0x39c9e0;_0x4b586b=path[_0x878e('0x36')](__dirname,_0x878e('0x25'),rs[_0x878e('0x26')](0x4)+_0x878e('0x48'));fs[_0x878e('0x28')](_0x4b586b,_0x39c9e0,{'encoding':'base64'});_0x2e0049=path['resolve'](__dirname,'tmp',rs[_0x878e('0x26')](0x4)+_0x878e('0x27'));return convertFile(_0x4b586b,_0x2e0049);})[_0x878e('0x35')](function(){try{fs[_0x878e('0x1a')](_0x4b586b);fs[_0x878e('0x29')](_0x2e0049,_0x878e('0x2a'));}catch(_0xef386b){logger['error'](_0xef386b);}logger[_0x878e('0x49')](_0x878e('0x4a'),_0x2e0049[_0x878e('0x3b')]('.')[0x0]);return _0x2e0049[_0x878e('0x3b')]('.')[0x0];});};exports['googleASR']=function(_0x1769c0,_0x2b732a,_0x109c7e){return google[_0x878e('0x4b')](_0x1769c0,_0x2b732a,_0x109c7e)['then'](function(_0x4907f6){logger[_0x878e('0x49')](_0x4907f6[_0x878e('0x4c')]);return rp(_0x4907f6);})['then'](function(_0x21f454){var _0x4d6a92='';var _0x55bdcc=0x0;try{fs[_0x878e('0x1a')](_0x1769c0);}catch(_0xf8a029){logger[_0x878e('0x13')](_0xf8a029);}if(_0x21f454&&_0x21f454[_0x878e('0x4d')]){_0x4d6a92=_0x21f454[_0x878e('0x4d')]['map'](function(_0xd87be4){return _0xd87be4&&_0xd87be4[_0x878e('0x4e')][0x0]&&_0xd87be4[_0x878e('0x4e')][0x0][_0x878e('0x4f')]?_0xd87be4[_0x878e('0x4e')][0x0]['transcript']:'';})['join']('\x0a');_0x55bdcc=_0x21f454[_0x878e('0x4d')][_0x878e('0x50')](function(_0x39d69){return _0x39d69&&_0x39d69[_0x878e('0x4e')][0x0]&&_0x39d69['alternatives'][0x0][_0x878e('0x51')]?_0x39d69[_0x878e('0x4e')][0x0][_0x878e('0x51')]:0x0;})[_0x878e('0x52')]('\x0a');}logger[_0x878e('0x49')](_0x878e('0x53'),_0x4d6a92);logger[_0x878e('0x49')]('googleASR\x20confidence',_0x55bdcc);return{'transcript':_0x4d6a92,'confidence':_0x55bdcc};})[_0x878e('0x54')](function(_0x1dcddf){logger[_0x878e('0x13')](_0x878e('0x55'),_0x1dcddf[_0x878e('0x12')],_0x1dcddf[_0x878e('0x56')],_0x1dcddf[_0x878e('0x57')]);});};exports[_0x878e('0x58')]=function(_0x19a828,_0x2bec2c,_0x413d63,_0x4f32e4){var _0x5db2ea=apiai(_0x2bec2c,{'language':_0x4f32e4||'en'});return _0x5db2ea[_0x878e('0x59')](_0x413d63,{'sessionId':md5(_0x19a828)})['then'](function(_0x5d090a){logger[_0x878e('0x49')](JSON[_0x878e('0x40')](_0x5d090a));return{'source':_0x5d090a['result']['source'],'resolvedQuery':_0x5d090a[_0x878e('0x5a')][_0x878e('0x5b')],'action':_0x5d090a['result']['action'],'actionIncomplete':_0x5d090a[_0x878e('0x5a')][_0x878e('0x5c')],'speech':_0x5d090a[_0x878e('0x5a')][_0x878e('0x5d')][_0x878e('0x5e')],'score':_0x5d090a['result'][_0x878e('0x5f')],'statusCode':_0x5d090a[_0x878e('0x60')][_0x878e('0x61')],'endConversation':_0x5d090a['result'][_0x878e('0x62')]['endConversation']||![],'isFallbackIntent':_0x5d090a['result'][_0x878e('0x62')][_0x878e('0x63')]};});};exports[_0x878e('0x64')]=function(_0x43a7f7,_0x4e6e00,_0x59c034,_0x2e4ab5,_0x1029ec,_0x3f0939){var _0x18916b=_0x2e4ab5['replace'](/\\n/g,'\x0a');var _0xe64adb={'credentials':{'private_key':_0x18916b,'client_email':_0x59c034}};var _0x1545ce=new dialogflow[(_0x878e('0x65'))](_0xe64adb);var _0x28eae7=_0x1545ce[_0x878e('0x66')](_0x4e6e00,md5(_0x43a7f7));var _0x29a41a={'session':_0x28eae7,'queryInput':{'text':{'text':_0x1029ec,'languageCode':_0x3f0939}}};return _0x1545ce[_0x878e('0x67')](_0x29a41a)[_0x878e('0x35')](function(_0x38902e){if(_0x38902e&&_0x38902e[_0x878e('0x44')]){logger[_0x878e('0x49')](_0x878e('0x68'),JSON[_0x878e('0x40')](_0x38902e));var _0x1fe8ce=_0x38902e[0x0];if(_0x1fe8ce){var _0x563071={'action':_0x1fe8ce[_0x878e('0x69')][_0x878e('0x6a')],'allRequiredParamsPresent':_0x1fe8ce[_0x878e('0x69')][_0x878e('0x6b')],'endConversation':_0x1fe8ce[_0x878e('0x69')][_0x878e('0x6c')]&&_0x1fe8ce[_0x878e('0x69')][_0x878e('0x6c')][_0x878e('0x6d')]?_0x1fe8ce['queryResult'][_0x878e('0x6c')]['fields'][_0x878e('0x6e')][_0x878e('0x6f')]:![],'fulfillmentText':_0x1fe8ce['queryResult'][_0x878e('0x70')],'intentName':_0x1fe8ce[_0x878e('0x69')][_0x878e('0x71')][_0x878e('0x56')],'intentDisplayName':_0x1fe8ce[_0x878e('0x69')][_0x878e('0x71')]['displayName'],'isFallbackIntent':_0x1fe8ce[_0x878e('0x69')][_0x878e('0x71')][_0x878e('0x72')],'languageCode':_0x1fe8ce[_0x878e('0x69')][_0x878e('0x73')],'queryText':_0x1fe8ce['queryResult'][_0x878e('0x74')],'responseId':_0x1fe8ce[_0x878e('0x75')],'score':_0x1fe8ce[_0x878e('0x69')][_0x878e('0x76')],'speech':_0x1fe8ce[_0x878e('0x69')][_0x878e('0x70')],'providerResponse':JSON[_0x878e('0x40')](_0x38902e)};return _0x563071;}}});};exports[_0x878e('0x77')]=function(_0x1a620e,_0x55cea9,_0x5e7d5f,_0x3374a6){return tilde[_0x878e('0x4b')](_0x1a620e,_0x55cea9,_0x5e7d5f,_0x3374a6)[_0x878e('0x35')](function(_0x25933d){try{fs['unlink'](_0x1a620e);}catch(_0x4a1fa6){logger['error'](_0x4a1fa6);}logger[_0x878e('0x49')](_0x878e('0x78'),_0x25933d[_0x878e('0x4f')]);logger[_0x878e('0x49')](_0x878e('0x79'),_0x25933d[_0x878e('0x51')]);return _0x25933d;});};exports['awsPolly']=function(_0x1abff2,_0x2c6e08,_0x802749,_0x2b5d8a,_0x2c18bf,_0x5c82b2){var _0x2c1a29=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x39409a;return aws[_0x878e('0x7a')](_0x1abff2,_0x2c6e08,_0x802749,_0x2b5d8a,_0x2c18bf,_0x5c82b2,_0x2c1a29)[_0x878e('0x35')](function(){_0x39409a=path[_0x878e('0x36')](__dirname,'tmp',rs[_0x878e('0x26')](0x4)+_0x878e('0x27'));return convertFile(_0x2c1a29,_0x39409a);})[_0x878e('0x35')](function(){try{fs['unlink'](_0x2c1a29);fs[_0x878e('0x29')](_0x39409a,'777');}catch(_0x41c363){logger[_0x878e('0x13')](_0x41c363);}return _0x39409a[_0x878e('0x3b')]('.')[0x0];});};exports[_0x878e('0x7b')]=function(_0x18768f,_0x5d6da5,_0xaa7951,_0x51f6c9,_0x279b71,_0x208309){return aws[_0x878e('0x7c')](_0x18768f,_0x5d6da5,_0xaa7951,_0x51f6c9,_0x279b71,_0x208309)['then'](function(_0x976413){logger[_0x878e('0x49')](JSON[_0x878e('0x40')](_0x976413));return _0x976413;});};exports[_0x878e('0x7d')]=function(_0x2475ca,_0x6f400,_0x44f8a4,_0x21d78e){var _0x478388=util[_0x878e('0x7e')](_0x878e('0x7f'),ISPEECH_API,_0x2475ca,encodeURIComponent(_0x6f400),_0x44f8a4,_0x21d78e);var _0x4980d4=path['resolve'](__dirname,_0x878e('0x25'),rs[_0x878e('0x26')](0x4)+_0x878e('0x48'));var _0x438e40;return downloadFile(_0x478388,_0x4980d4)[_0x878e('0x35')](function(){_0x438e40=path[_0x878e('0x36')](__dirname,_0x878e('0x25'),rs['generate'](0x4)+_0x878e('0x27'));return convertFile(_0x4980d4,_0x438e40);})[_0x878e('0x35')](function(){try{fs[_0x878e('0x1a')](_0x4980d4);fs[_0x878e('0x29')](_0x438e40,_0x878e('0x2a'));}catch(_0xf439a){logger[_0x878e('0x13')](_0xf439a);}return _0x438e40[_0x878e('0x3b')]('.')[0x0];});};exports['ispeechASR']=function(_0x302d85,_0x55b9d2,_0xedefd6,_0x1e99b8){var _0x4f96de=util[_0x878e('0x7e')](_0x878e('0x80'),ISPEECH_API,_0x55b9d2,_0xedefd6,base64Encode(_0x302d85),_0x1e99b8?util[_0x878e('0x7e')](_0x878e('0x81'),encodeURIComponent(_0x1e99b8)):_0x878e('0x82'));return uploadFile(_0x4f96de)[_0x878e('0x35')](function(_0x2f7e2d){return querystring[_0x878e('0x7')](_0x2f7e2d);});};exports[_0x878e('0x83')]=function(_0x482814,_0x2625ca){return sestek[_0x878e('0x84')](_0x482814,_0x2625ca)[_0x878e('0x35')](function(_0x56c353){logger[_0x878e('0x49')](JSON['stringify'](_0x56c353));var _0x1cb586={'speech':_0x56c353['text'],'action':_0x56c353[_0x878e('0x85')]?_0x56c353[_0x878e('0x85')][_0x878e('0x86')]:undefined,'actiondata':_0x56c353['channelData']?_0x56c353['channelData'][_0x878e('0x87')]:undefined};if(_0x56c353[_0x878e('0x85')]&&_0x56c353[_0x878e('0x85')][_0x878e('0x88')]){return base64Decode(_0x56c353[_0x878e('0x85')][_0x878e('0x88')][_0x878e('0x89')],path[_0x878e('0x36')](__dirname,'tmp',rs[_0x878e('0x26')](0x4)+_0x878e('0x27')))[_0x878e('0x35')](function(_0x48e6f0){_0x1cb586[_0x878e('0x8a')]=_0x48e6f0;return _0x1cb586;});}return _0x1cb586;});};exports[_0x878e('0x8b')]=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 c12d432..6708666 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 _0x5e8c=['exports'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0x5e8c,0xfa));var _0xc5e8=function(_0x3cb51a,_0x554504){_0x3cb51a=_0x3cb51a-0x0;var _0x3dc99a=_0x5e8c[_0x3cb51a];return _0x3dc99a;};var nda=require('./nda');module[_0xc5e8('0x0')]={'nda':nda}; \ No newline at end of file +var _0x96fe=['./nda','exports'];(function(_0x5eb62e,_0x1d0dc8){var _0x10b750=function(_0x4705fe){while(--_0x4705fe){_0x5eb62e['push'](_0x5eb62e['shift']());}};_0x10b750(++_0x1d0dc8);}(_0x96fe,0x1da));var _0xe96f=function(_0x50b462,_0x34e287){_0x50b462=_0x50b462-0x0;var _0x576290=_0x96fe[_0x50b462];return _0x576290;};var nda=require(_0xe96f('0x0'));module[_0xe96f('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 14e6106..1194997 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 _0x1752=['custom_action_data','info','stringify','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','calleridname','access_token','body','channelData','project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x1752,0xa5));var _0x2175=function(_0x5ae7a4,_0x5878f5){_0x5ae7a4=_0x5ae7a4-0x0;var _0x426a77=_0x1752[_0x5ae7a4];return _0x426a77;};'use strict';var rp=require('request-promise');var url=require(_0x2175('0x0'));var logger=require(_0x2175('0x1'))(_0x2175('0x2'));module[_0x2175('0x3')]=function(_0x1b2344,_0xe2453c){var _0x56c315={'method':_0x2175('0x4'),'uri':url[_0x2175('0x5')](_0xe2453c[_0x2175('0x6')],_0x2175('0x7')),'form':{'grant_type':_0x2175('0x8'),'username':_0xe2453c[_0x2175('0x9')],'password':_0xe2453c[_0x2175('0x8')]},'json':!![]};return rp(_0x56c315)[_0x2175('0xa')](function(_0x339e4d){var _0x672ff1={'method':'POST','uri':url[_0x2175('0x5')](_0xe2453c[_0x2175('0xb')],_0x2175('0xc')),'body':{'type':_0xe2453c[_0x2175('0xd')]||_0x2175('0xe'),'channelId':'Nda','conversation':{'id':_0x1b2344['uniqueid']},'from':{'id':_0x1b2344['callerid'],'name':_0x1b2344[_0x2175('0xf')]},'recipient':{'id':_0x1b2344['dnid'],'name':_0x1b2344['extension']},'text':_0xe2453c['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x339e4d[_0x2175('0x10')]},'json':!![]};if(_0xe2453c['project']){_0x672ff1[_0x2175('0x11')][_0x2175('0x12')]['ProjectName']=_0xe2453c[_0x2175('0x13')];}if(_0xe2453c[_0x2175('0x14')]=='1'){_0x672ff1[_0x2175('0x11')][_0x2175('0x12')][_0x2175('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x2175('0x16')};}if(_0xe2453c[_0x2175('0x17')]){_0x672ff1[_0x2175('0x11')]['channelData']['CustomAction']=_0xe2453c[_0x2175('0x17')];if(_0xe2453c[_0x2175('0x18')]){_0x672ff1[_0x2175('0x11')]['channelData']['CustomActionData']=_0xe2453c['custom_action_data'];}}logger[_0x2175('0x19')](JSON[_0x2175('0x1a')](_0x672ff1));return rp(_0x672ff1);});}; \ No newline at end of file +var _0x0cfa=['resolve','ndauth_url','/token','password','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','uniqueid','dnid','extension','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi'];(function(_0x299282,_0x248baf){var _0x5f432d=function(_0x46edaf){while(--_0x46edaf){_0x299282['push'](_0x299282['shift']());}};_0x5f432d(++_0x248baf);}(_0x0cfa,0x18f));var _0xa0cf=function(_0x42f4c5,_0x4a5fec){_0x42f4c5=_0x42f4c5-0x0;var _0x878cbf=_0x0cfa[_0x42f4c5];return _0x878cbf;};'use strict';var rp=require(_0xa0cf('0x0'));var url=require(_0xa0cf('0x1'));var logger=require(_0xa0cf('0x2'))(_0xa0cf('0x3'));module['exports']=function(_0x525629,_0x4d8758){var _0x37c4e1={'method':'POST','uri':url[_0xa0cf('0x4')](_0x4d8758[_0xa0cf('0x5')],_0xa0cf('0x6')),'form':{'grant_type':_0xa0cf('0x7'),'username':_0x4d8758['username'],'password':_0x4d8758[_0xa0cf('0x7')]},'json':!![]};return rp(_0x37c4e1)['then'](function(_0x232245){var _0x5f0054={'method':_0xa0cf('0x8'),'uri':url['resolve'](_0x4d8758[_0xa0cf('0x9')],_0xa0cf('0xa')),'body':{'type':_0x4d8758[_0xa0cf('0xb')]||'message','channelId':_0xa0cf('0xc'),'conversation':{'id':_0x525629[_0xa0cf('0xd')]},'from':{'id':_0x525629['callerid'],'name':_0x525629['calleridname']},'recipient':{'id':_0x525629[_0xa0cf('0xe')],'name':_0x525629[_0xa0cf('0xf')]},'text':_0x4d8758[_0xa0cf('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x232245[_0xa0cf('0x11')]},'json':!![]};if(_0x4d8758[_0xa0cf('0x12')]){_0x5f0054[_0xa0cf('0x13')][_0xa0cf('0x14')][_0xa0cf('0x15')]=_0x4d8758[_0xa0cf('0x12')];}if(_0x4d8758[_0xa0cf('0x16')]=='1'){_0x5f0054['body'][_0xa0cf('0x14')][_0xa0cf('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xa0cf('0x18')};}if(_0x4d8758['custom_action']){_0x5f0054[_0xa0cf('0x13')][_0xa0cf('0x14')][_0xa0cf('0x19')]=_0x4d8758[_0xa0cf('0x1a')];if(_0x4d8758[_0xa0cf('0x1b')]){_0x5f0054['body'][_0xa0cf('0x14')][_0xa0cf('0x1c')]=_0x4d8758['custom_action_data'];}}logger[_0xa0cf('0x1d')](JSON[_0xa0cf('0x1e')](_0x5f0054));return rp(_0x5f0054);});}; \ 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 3dfa586..e787214 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 _0xf8c1=['./lib/api','exports'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xf8c1,0x1b4));var _0x1f8c=function(_0x5ac554,_0x1ade88){_0x5ac554=_0x5ac554-0x0;var _0x2f8b9e=_0xf8c1[_0x5ac554];return _0x2f8b9e;};'use strict';var asr=require(_0x1f8c('0x0'));module[_0x1f8c('0x1')]=function(_0x4bbb3a,_0xbe9fd5,_0x1cc913,_0x717876){return asr(_0x4bbb3a,_0xbe9fd5,_0x1cc913,_0x717876);}; \ No newline at end of file +var _0x36b5=['./lib/api','exports'];(function(_0x29e314,_0x19d592){var _0x4c9fcb=function(_0xcb1c9){while(--_0xcb1c9){_0x29e314['push'](_0x29e314['shift']());}};_0x4c9fcb(++_0x19d592);}(_0x36b5,0x196));var _0x536b=function(_0xb36843,_0x57c1f4){_0xb36843=_0xb36843-0x0;var _0x227b83=_0x36b5[_0xb36843];return _0x227b83;};'use strict';var asr=require(_0x536b('0x0'));module[_0x536b('0x1')]=function(_0x1f2c49,_0x3dca86,_0x25fd4f,_0x342b7b){return asr(_0x1f2c49,_0x3dca86,_0x25fd4f,_0x342b7b);}; \ 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 52e3019..5478ed1 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 _0xb3ae=['crypto','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','data','EOS','error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','stringify','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','bluebird','moment'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0xb3ae,0x1d2));var _0xeb3a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xb3ae[_0x46698a];return _0x356db0;};'use strict';var BPromise=require(_0xeb3a('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xeb3a('0x1'));var crypto=require(_0xeb3a('0x2'));var logger=require('../../../../../../config/logger')(_0xeb3a('0x3'));module['exports']=function(_0x2c78ba,_0x318837,_0x5a0ae7,_0x35e7f7){return new BPromise(function(_0x507323,_0x50227d){logger[_0xeb3a('0x4')](_0xeb3a('0x5'),_0x35e7f7||_0xeb3a('0x6'));var _0x345b9c=new WebSocket(_0x35e7f7||_0xeb3a('0x6'),{'perMessageDeflate':![]});var _0x3348b7='';var _0x2bbecb='0';var _0x3e3d65='1';var _0x54f4e6=_0xeb3a('0x7');function _0x3737fa(_0x5d00c4){var _0x2c1568=crypto[_0xeb3a('0x8')]('sha1');_0x2c1568['update'](_0x5d00c4);return _0x2c1568[_0xeb3a('0x9')](_0xeb3a('0xa'));}function _0x3f1fbb(){try{logger[_0xeb3a('0x4')](_0xeb3a('0xb'));var _0x1ba34c=moment()[_0xeb3a('0xc')]();var _0x1432c3=_0x3737fa(_0x1ba34c+_0x318837+_0x5a0ae7);_0x345b9c[_0xeb3a('0xd')](JSON['stringify']({'appID':_0x318837,'timestamp':_0x1ba34c,'appKey':_0x1432c3}));var _0x5cab71=fs[_0xeb3a('0xe')](_0x2c78ba);_0x5cab71['on'](_0xeb3a('0xf'),function(_0xfdfaa2){_0x345b9c[_0xeb3a('0xd')](_0xfdfaa2);});_0x5cab71['on']('close',function(){_0x345b9c['send'](_0xeb3a('0x10'));});}catch(_0x4285df){logger[_0xeb3a('0x11')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x4285df));_0x345b9c[_0xeb3a('0x12')]();}}function _0x2a6287(_0x4fb132){try{if(_0x4fb132){var _0x51e628=JSON['parse'](_0x4fb132);switch(_0x51e628[_0xeb3a('0x13')]){case 0x0:if(_0x51e628[_0xeb3a('0x14')]){if(_0x51e628[_0xeb3a('0x14')][_0xeb3a('0x15')]){logger[_0xeb3a('0x4')](_0xeb3a('0x16'),JSON[_0xeb3a('0x17')](_0x51e628[_0xeb3a('0x14')][_0xeb3a('0x18')]));_0x3348b7=_0x51e628[_0xeb3a('0x14')][_0xeb3a('0x18')][0x0][_0xeb3a('0x19')];_0x2bbecb=_0x51e628[_0xeb3a('0x14')][_0xeb3a('0x18')][0x0][_0xeb3a('0x1a')];_0x3e3d65='0';_0x54f4e6=_0xeb3a('0x1b');_0x345b9c[_0xeb3a('0x12')]();}}break;case 0x1:logger[_0xeb3a('0x4')](_0xeb3a('0x7'));_0x3e3d65='1';_0x54f4e6='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xeb3a('0x4')](_0xeb3a('0x1c'));_0x3e3d65='2';_0x54f4e6=_0xeb3a('0x1c');break;case 0x9:logger[_0xeb3a('0x4')](_0xeb3a('0x1d'));_0x3e3d65='9';_0x54f4e6=_0xeb3a('0x1d');break;case 0xa:logger[_0xeb3a('0x4')](_0xeb3a('0x1e'));_0x3e3d65='10';_0x54f4e6=_0xeb3a('0x1e');break;case 0xb:logger['info'](_0xeb3a('0x1f'));_0x3e3d65='11';_0x54f4e6=_0xeb3a('0x1f');}}}catch(_0x5303e5){logger['error'](_0xeb3a('0x20'),JSON[_0xeb3a('0x17')](_0x5303e5));_0x345b9c['terminate']();}}function _0x70393b(){logger[_0xeb3a('0x4')]('Close\x20Tilde\x20ASR\x20socket');_0x507323({'transcript':_0x3348b7,'confidence':_0x2bbecb,'status':_0x3e3d65,'status_message':_0x54f4e6});}function _0x1e6376(_0x574b43){logger[_0xeb3a('0x11')](_0xeb3a('0x21'));if(!_[_0xeb3a('0x22')](_0x574b43)){logger[_0xeb3a('0x11')](_[_0xeb3a('0x23')](_0x574b43)?JSON[_0xeb3a('0x17')](_0x574b43):_0x574b43);}}_0x345b9c['on'](_0xeb3a('0x24'),_0x3f1fbb);_0x345b9c['on'](_0xeb3a('0x25'),_0x2a6287);_0x345b9c['on'](_0xeb3a('0x26'),_0x70393b);_0x345b9c['on'](_0xeb3a('0x11'),_0x1e6376);});}; \ No newline at end of file +var _0xc6bc=['moment','crypto','../../../../../../config/logger','agi','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','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','terminate','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','isObject','open','message','bluebird','lodash'];(function(_0x51c6b9,_0x150fc0){var _0x4bb8e2=function(_0x3d5e4e){while(--_0x3d5e4e){_0x51c6b9['push'](_0x51c6b9['shift']());}};_0x4bb8e2(++_0x150fc0);}(_0xc6bc,0x166));var _0xcc6b=function(_0x5cc18d,_0x1889e7){_0x5cc18d=_0x5cc18d-0x0;var _0xdb2b4b=_0xc6bc[_0x5cc18d];return _0xdb2b4b;};'use strict';var BPromise=require(_0xcc6b('0x0'));var _=require(_0xcc6b('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xcc6b('0x2'));var crypto=require(_0xcc6b('0x3'));var logger=require(_0xcc6b('0x4'))(_0xcc6b('0x5'));module[_0xcc6b('0x6')]=function(_0x5e80bb,_0x4dee95,_0x37d956,_0x236fe6){return new BPromise(function(_0x3832f2,_0x10d60a){logger[_0xcc6b('0x7')]('Tilde\x20URI',_0x236fe6||_0xcc6b('0x8'));var _0x1d50ff=new WebSocket(_0x236fe6||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x2edd07='';var _0x7e8ac7='0';var _0x414206='1';var _0xf176a0=_0xcc6b('0x9');function _0x45df37(_0x5f515b){var _0x4fc23f=crypto[_0xcc6b('0xa')](_0xcc6b('0xb'));_0x4fc23f[_0xcc6b('0xc')](_0x5f515b);return _0x4fc23f[_0xcc6b('0xd')](_0xcc6b('0xe'));}function _0x447050(){try{logger['info'](_0xcc6b('0xf'));var _0xf14fe5=moment()[_0xcc6b('0x10')]();var _0x3c15d9=_0x45df37(_0xf14fe5+_0x4dee95+_0x37d956);_0x1d50ff[_0xcc6b('0x11')](JSON[_0xcc6b('0x12')]({'appID':_0x4dee95,'timestamp':_0xf14fe5,'appKey':_0x3c15d9}));var _0x41d18e=fs[_0xcc6b('0x13')](_0x5e80bb);_0x41d18e['on'](_0xcc6b('0x14'),function(_0x1335b8){_0x1d50ff[_0xcc6b('0x11')](_0x1335b8);});_0x41d18e['on'](_0xcc6b('0x15'),function(){_0x1d50ff[_0xcc6b('0x11')](_0xcc6b('0x16'));});}catch(_0x14e7bf){logger[_0xcc6b('0x17')](_0xcc6b('0x18'),JSON['stringify'](_0x14e7bf));_0x1d50ff['terminate']();}}function _0x2b1711(_0x2a080b){try{if(_0x2a080b){var _0x325213=JSON['parse'](_0x2a080b);switch(_0x325213['status']){case 0x0:if(_0x325213[_0xcc6b('0x19')]){if(_0x325213['result']['final']){logger[_0xcc6b('0x7')](_0xcc6b('0x1a'),JSON[_0xcc6b('0x12')](_0x325213[_0xcc6b('0x19')]['hypotheses']));_0x2edd07=_0x325213['result'][_0xcc6b('0x1b')][0x0][_0xcc6b('0x1c')];_0x7e8ac7=_0x325213['result'][_0xcc6b('0x1b')][0x0][_0xcc6b('0x1d')];_0x414206='0';_0xf176a0=_0xcc6b('0x1e');_0x1d50ff[_0xcc6b('0x1f')]();}}break;case 0x1:logger['info'](_0xcc6b('0x9'));_0x414206='1';_0xf176a0='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger['info'](_0xcc6b('0x20'));_0x414206='2';_0xf176a0=_0xcc6b('0x20');break;case 0x9:logger[_0xcc6b('0x7')](_0xcc6b('0x21'));_0x414206='9';_0xf176a0=_0xcc6b('0x21');break;case 0xa:logger['info'](_0xcc6b('0x22'));_0x414206='10';_0xf176a0='Authentication\x20failed.';break;case 0xb:logger[_0xcc6b('0x7')](_0xcc6b('0x23'));_0x414206='11';_0xf176a0='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x51e2c5){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0xcc6b('0x12')](_0x51e2c5));_0x1d50ff[_0xcc6b('0x1f')]();}}function _0x700bfc(){logger[_0xcc6b('0x7')](_0xcc6b('0x24'));_0x3832f2({'transcript':_0x2edd07,'confidence':_0x7e8ac7,'status':_0x414206,'status_message':_0xf176a0});}function _0x2741f3(_0x3d3e13){logger[_0xcc6b('0x17')]('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0x3d3e13)){logger[_0xcc6b('0x17')](_[_0xcc6b('0x25')](_0x3d3e13)?JSON[_0xcc6b('0x12')](_0x3d3e13):_0x3d3e13);}}_0x1d50ff['on'](_0xcc6b('0x26'),_0x447050);_0x1d50ff['on'](_0xcc6b('0x27'),_0x2b1711);_0x1d50ff['on'](_0xcc6b('0x15'),_0x700bfc);_0x1d50ff['on'](_0xcc6b('0x17'),_0x2741f3);});}; \ 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 baf9aed..2c36e65 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 _0xc32a=['./asr','exports'];(function(_0x302fcf,_0x4e4901){var _0x2de7b7=function(_0x1fcdd2){while(--_0x1fcdd2){_0x302fcf['push'](_0x302fcf['shift']());}};_0x2de7b7(++_0x4e4901);}(_0xc32a,0x9c));var _0xac32=function(_0x5e8eae,_0x4f81e0){_0x5e8eae=_0x5e8eae-0x0;var _0xdd09cd=_0xc32a[_0x5e8eae];return _0xdd09cd;};var asr=require(_0xac32('0x0'));module[_0xac32('0x1')]={'asr':asr}; \ No newline at end of file +var _0xdcbb=['./asr','exports'];(function(_0x532b5b,_0xce6ec8){var _0x169ff9=function(_0x4d2804){while(--_0x4d2804){_0x532b5b['push'](_0x532b5b['shift']());}};_0x169ff9(++_0xce6ec8);}(_0xdcbb,0x16e));var _0xbdcb=function(_0x1669fb,_0x18504f){_0x1669fb=_0x1669fb-0x0;var _0x5a8eb4=_0xdcbb[_0x1669fb];return _0x5a8eb4;};var asr=require(_0xbdcb('0x0'));module[_0xbdcb('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 517f6bf..fc8fd65 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 _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x2922c2,_0x7f1b96){var _0x3f3279=function(_0x31b817){while(--_0x31b817){_0x2922c2['push'](_0x2922c2['shift']());}};_0x3f3279(++_0x7f1b96);}(_0x34e8,0x12c));var _0x834e=function(_0x5199f8,_0x460c2a){_0x5199f8=_0x5199f8-0x0;var _0x18ba7e=_0x34e8[_0x5199f8];return _0x18ba7e;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 2b61ae7..b68a3c9 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 _0xbd50=['uniqueid','calleridname','context','extension','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isNil','isEmpty','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','timeout','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','tildeASR','appid','appsecret','clear','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','saveRestApiResult','%s.%s','length','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','isConfigured','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','MRCPSynth','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','no\x20grammar\x20configured','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','query','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','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','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','awspolly','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','PLAYBACK','no\x20queue\x20selected','queue_id','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','statusCode','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','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','voicemail','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','mailRpc','prototype','getVariableById','then','catch','getVoiceQueue','rpc','getVoiceQueueById','name','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','callerid','createSquareRecording'];(function(_0x1e3020,_0x1a002a){var _0x54767c=function(_0x3d6bb9){while(--_0x3d6bb9){_0x1e3020['push'](_0x1e3020['shift']());}};_0x54767c(++_0x1a002a);}(_0xbd50,0x196));var _0x0bd5=function(_0x2221be,_0x4f84cd){_0x2221be=_0x2221be-0x0;var _0x50824a=_0xbd50[_0x2221be];return _0x50824a;};'use strict';var fs=require('fs');var util=require(_0x0bd5('0x0'));var _=require(_0x0bd5('0x1'));var sh=require(_0x0bd5('0x2'));var odbc=require('odbc')();var rs=require(_0x0bd5('0x3'));var moment=require(_0x0bd5('0x4'));var Mustache=require(_0x0bd5('0x5'));var rp=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('agi');var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH=_0x0bd5('0x8');var recursiveMapAttributes=[_0x0bd5('0x9'),_0x0bd5('0xa')];var verticesWithRetry=[_0x0bd5('0xb'),_0x0bd5('0xc'),'getsecretdigits'];var AGIVertices=function(_0x47e78d,_0x1a5cb9,_0x25e31e){this[_0x0bd5('0xd')]=_0x47e78d;this['rpc']=_0x1a5cb9;this[_0x0bd5('0xe')]=_0x25e31e;};AGIVertices[_0x0bd5('0xf')]['getVariable']=function(_0x210f45,_0x7db86e){this['rpc'][_0x0bd5('0x10')](_0x210f45)[_0x0bd5('0x11')](function(_0x1aa818){_0x7db86e(null,_0x1aa818?_0x1aa818['name']:![]);})[_0x0bd5('0x12')](function(_0x23982f){_0x7db86e(_0x23982f);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x13')]=function(_0xfa1eed,_0x557be0){this[_0x0bd5('0x14')][_0x0bd5('0x15')](_0xfa1eed)['then'](function(_0x78f9b8){_0x557be0(null,_0x78f9b8?_0x78f9b8[_0x0bd5('0x16')]:![]);})['catch'](function(_0x31349f){_0x557be0(_0x31349f);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x17')]=function(_0xc22553,_0x55d565){this[_0x0bd5('0x14')][_0x0bd5('0x18')](_0xc22553)[_0x0bd5('0x11')](function(_0x277b32){_0x55d565(null,_0x277b32?_0x277b32[_0x0bd5('0x16')]:![]);})[_0x0bd5('0x12')](function(_0xc58e12){_0x55d565(_0xc58e12);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x19')]=function(_0x20c667,_0x27bc1e){this[_0x0bd5('0x14')][_0x0bd5('0x1a')](_0x20c667)[_0x0bd5('0x11')](function(_0x527c37){_0x27bc1e(null,_0x527c37?_0x527c37['dsn']:![]);})['catch'](function(_0x4ed64e){_0x27bc1e(_0x4ed64e);});};AGIVertices['prototype'][_0x0bd5('0x1b')]=function(_0x86381d,_0x13ce46){this[_0x0bd5('0x14')][_0x0bd5('0x1c')](_0x86381d)['then'](function(_0x440f85){_0x13ce46(null,_0x440f85?_0x440f85[_0x0bd5('0x16')]:![]);})[_0x0bd5('0x12')](function(_0x5a8139){_0x13ce46(_0x5a8139);});};AGIVertices[_0x0bd5('0xf')]['getTrunk']=function(_0x4969e6,_0x14c319){this[_0x0bd5('0x14')][_0x0bd5('0x1d')](_0x4969e6)['then'](function(_0x42428c){_0x14c319(null,_0x42428c?_0x42428c['name']:![]);})[_0x0bd5('0x12')](function(_0x3ffb08){_0x14c319(_0x3ffb08);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1e')]=function(_0x3ff237,_0x2023d5){var _0x19bb5e=this;this[_0x0bd5('0x14')][_0x0bd5('0x1f')](_0x3ff237)[_0x0bd5('0x11')](function(_0x15561b){_0x2023d5(null,_0x15561b?_0x19bb5e[_0x0bd5('0x20')](_0x15561b[_0x0bd5('0x21')]):![]);})[_0x0bd5('0x12')](function(_0x5e5a33){_0x2023d5(_0x5e5a33);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x22')]=function(_0x4c799f,_0x20e6c3){this[_0x0bd5('0x14')]['getMailAccountById'](_0x4c799f)[_0x0bd5('0x11')](function(_0x1b7cf4){_0x20e6c3(null,_0x1b7cf4?_0x1b7cf4:![]);})[_0x0bd5('0x12')](function(_0x25a35b){_0x20e6c3(_0x25a35b);});};AGIVertices['prototype'][_0x0bd5('0x23')]=function(_0x366e8c,_0x622d46,_0x24ef4a){this[_0x0bd5('0xe')][_0x0bd5('0x23')](_0x366e8c,_0x622d46)['then'](function(){_0x24ef4a(null);})[_0x0bd5('0x12')](function(_0x589ea2){_0x24ef4a(_0x589ea2);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x24')]=function(_0x444ddb,_0x132e02){this[_0x0bd5('0x14')][_0x0bd5('0x25')](_0x444ddb)[_0x0bd5('0x11')](function(_0x24f7d5){if(_0x24f7d5){if(_0x24f7d5[_0x0bd5('0x26')]){_0x132e02(null,[_0x24f7d5[_0x0bd5('0x27')]]);}else{_0x132e02(null,_[_0x0bd5('0x28')](_0x24f7d5[_0x0bd5('0x29')],_0x0bd5('0x27')));}}else{_0x132e02(null,![]);}})['catch'](function(_0x3e153a){_0x132e02(_0x3e153a);});};AGIVertices[_0x0bd5('0xf')]['getSoundPath']=function(_0x50b9ce){return util[_0x0bd5('0x2a')](_0x0bd5('0x2b'),FILES_PATH,_0x50b9ce);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x2c')]=function(_0x1dd2e1,_0x387e24,_0x22c10c){odbc[_0x0bd5('0x2d')](_0x1dd2e1,function(_0x44b2ce){if(_0x44b2ce){logger[_0x0bd5('0x2e')](_0x0bd5('0x2f'),_0x44b2ce);_0x22c10c(_0x44b2ce);}else{logger[_0x0bd5('0x30')](_0x0bd5('0x31'));odbc['query'](_0x387e24,function(_0x109f54,_0x5b915c){if(_0x109f54){logger[_0x0bd5('0x30')](_0x0bd5('0x32'),_0x387e24);_0x22c10c(_0x109f54);}else{logger[_0x0bd5('0x30')](_0x0bd5('0x33'),_0x387e24);odbc[_0x0bd5('0x34')](function(_0x18e408){if(_0x18e408){logger['error'](_0x0bd5('0x35'),_0x18e408);}_0x22c10c(null,_0x5b915c);});}});}});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x36')]=function(_0x1a9dda,_0x1c73be){this[_0x0bd5('0x14')][_0x0bd5('0x37')](_0x1a9dda)[_0x0bd5('0x11')](function(_0x1c2ef8){_0x1c73be(null,_0x1c2ef8?_0x1c2ef8:![]);})['catch'](function(_0x177aa3){_0x1c73be(_0x177aa3);});};AGIVertices['prototype'][_0x0bd5('0x38')]=function(_0xc17464,_0x480b8b){this[_0x0bd5('0x14')][_0x0bd5('0x38')](_0xc17464)[_0x0bd5('0x11')](function(_0x3ec4b0){_0x480b8b(null,_0x3ec4b0);})[_0x0bd5('0x12')](function(_0x1a8d55){_0x480b8b(_0x1a8d55);});};AGIVertices[_0x0bd5('0xf')]['createSquareDetailsReport']=function(_0x4d3ca5,_0x994f24,_0x545b63){this['rpc'][_0x0bd5('0x39')]({'uniqueid':this[_0x0bd5('0xd')]['uniqueid'],'node':_0x4d3ca5['label'],'application':_0x4d3ca5['agicommand'],'data':_0x994f24||null,'project_name':this[_0x0bd5('0xd')]['arg_1'],'callerid':this['channel'][_0x0bd5('0x3a')]})[_0x0bd5('0x11')](function(_0x49e46a){if(_0x545b63){_0x545b63(null,_0x49e46a);}})['catch'](function(_0xb46d84){if(_0x545b63){_0x545b63(_0xb46d84);}});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x3b')]=function(_0xa36962,_0x56a702,_0x290342,_0x44f485){this[_0x0bd5('0x14')][_0x0bd5('0x3b')]({'uniqueid':this[_0x0bd5('0xd')][_0x0bd5('0x3c')],'callerid':this['channel'][_0x0bd5('0x3a')],'calleridname':this[_0x0bd5('0xd')][_0x0bd5('0x3d')],'context':this['channel'][_0x0bd5('0x3e')],'extension':this[_0x0bd5('0xd')][_0x0bd5('0x3f')],'priority':this['channel'][_0x0bd5('0x40')],'accountcode':this[_0x0bd5('0xd')][_0x0bd5('0x41')],'dnid':this[_0x0bd5('0xd')][_0x0bd5('0x42')],'projectName':this['channel'][_0x0bd5('0x43')],'saveName':_0x56a702,'filename':_0xa36962[_0x0bd5('0x44')]||_0x56a702,'savePath':_0x290342})['then'](function(_0x2db9b0){_0x44f485(null,_0x2db9b0);})[_0x0bd5('0x12')](function(_0x146bdc){_0x44f485(_0x146bdc);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x45')]=function(_0x508aa8,_0x109793,_0x128df9,_0x5cd889,_0x70d7ce){this['rpc'][_0x0bd5('0x45')]({'uniqueid':this[_0x0bd5('0xd')][_0x0bd5('0x3c')],'body':_0x508aa8,'direction':_0x109793,'providerName':_0x128df9,'providerResponse':_0x5cd889})[_0x0bd5('0x11')](function(_0x5f54bb){if(_0x70d7ce){_0x70d7ce(null,_0x5f54bb);}})[_0x0bd5('0x12')](function(_0x4cb674){if(_0x70d7ce){_0x70d7ce(_0x4cb674);}});};AGIVertices['prototype'][_0x0bd5('0x46')]=function(_0x1b473f,_0x172393){this['rpc'][_0x0bd5('0x46')]({'firstName':_['isEmpty'](_0x1b473f[_0x0bd5('0x16')])||_[_0x0bd5('0x47')](_0x1b473f[_0x0bd5('0x16')])?'callback_'+Math['random']():_0x1b473f['name'],'lastName':_[_0x0bd5('0x48')](_0x1b473f[_0x0bd5('0x49')])||_[_0x0bd5('0x47')](_0x1b473f['lastName'])?null:_0x1b473f[_0x0bd5('0x49')],'phone':_0x1b473f[_0x0bd5('0x4a')],'ListId':_0x1b473f['list_id'],'scheduledat':_0x1b473f[_0x0bd5('0x4b')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x0bd5('0x4c'),'description':_0x0bd5('0x4d')+_0x1b473f[_0x0bd5('0x4b')][_0x0bd5('0x4e')](),'priority':_0x1b473f['callback_priority']})[_0x0bd5('0x11')](function(_0x3316ba){_0x172393(null,_0x3316ba);})[_0x0bd5('0x12')](function(_0x5cf2f2){_0x172393(_0x5cf2f2);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x4f')]=function(_0x374701,_0x4851fb){this['rpc'][_0x0bd5('0x50')](_0x374701)['then'](function(_0x3e20e9){_0x4851fb(null,_0x3e20e9?_0x3e20e9[_0x0bd5('0x16')]:![]);})[_0x0bd5('0x12')](function(_0x5e7bcd){_0x4851fb(_0x5e7bcd);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x51')]=function(_0x3eaea6,_0x38aae5,_0x5e93fa){var _0x3c0d59={'role':_0x0bd5('0x52')};_0x3c0d59[_0x3eaea6]=this[_0x0bd5('0xd')][_0x0bd5('0x3a')];this[_0x0bd5('0x14')]['agentPause'](_0x3c0d59,_0x38aae5,this[_0x0bd5('0xd')]['uniqueid'])[_0x0bd5('0x11')](function(_0x5d6cb3){_0x5e93fa(null,_['isNil'](_0x5d6cb3)?![]:!![]);})[_0x0bd5('0x12')](function(_0x55883d){logger[_0x0bd5('0x2e')](_0x55883d);_0x5e93fa(null,![]);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x53')]=function(_0x5c84f9,_0x4f7e86){var _0x27609f={'role':'agent'};_0x27609f[_0x5c84f9]=this[_0x0bd5('0xd')][_0x0bd5('0x3a')];this['rpc'][_0x0bd5('0x53')](_0x27609f)['then'](function(_0x45ccf5){_0x4f7e86(null,_[_0x0bd5('0x47')](_0x45ccf5)?![]:!![]);})[_0x0bd5('0x12')](function(_0x18cb9b){logger[_0x0bd5('0x2e')](_0x18cb9b);_0x4f7e86(null,![]);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x54')]=function(_0x4ad449,_0x33ad3f){var _0x1e5e7d={'role':_0x0bd5('0x52')};_0x1e5e7d[_0x4ad449]=this['channel']['callerid'];this[_0x0bd5('0x14')][_0x0bd5('0x54')](_0x1e5e7d)[_0x0bd5('0x11')](function(_0x42dc72){_0x33ad3f(null,_[_0x0bd5('0x47')](_0x42dc72)?![]:!![]);})[_0x0bd5('0x12')](function(_0x1db7f2){logger[_0x0bd5('0x2e')](_0x1db7f2);_0x33ad3f(null,![]);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x55')]=function(_0x11c266,_0x377869){var _0x30b87e={'role':_0x0bd5('0x52')};_0x30b87e[_0x11c266]=this[_0x0bd5('0xd')][_0x0bd5('0x3a')];var _0x29d9d8=_0x11c266!=_0x0bd5('0x56')?util['format'](_0x0bd5('0x57'),_0x0bd5('0x58'),this['channel'][_0x0bd5('0x3a')]):undefined;this['rpc'][_0x0bd5('0x55')](_0x30b87e,_0x29d9d8)[_0x0bd5('0x11')](function(_0x4f7170){_0x377869(null,_[_0x0bd5('0x47')](_0x4f7170)?![]:!![]);})[_0x0bd5('0x12')](function(_0x1510bd){logger[_0x0bd5('0x2e')](_0x1510bd);_0x377869(null,![]);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x59')]=function(_0x2fbea8,_0x1a5708){sh[_0x0bd5('0x5a')](_['trim'](_0x2fbea8),function(_0x196c1c,_0x3be572){var _0x583835=_0x3be572[_0x0bd5('0x5b')](/(\r\n|\n|\r)/gm,'');_0x1a5708(null,_0x583835);});};AGIVertices[_0x0bd5('0xf')]['googleCloudTTS']=function(_0x215491,_0x333303){scripts['googleCloudTTS'](_0x215491[_0x0bd5('0x5c')],_0x215491['google_cloud_tts_text_type']||_0x0bd5('0x5d'),_0x215491[_0x0bd5('0x5d')],_0x215491[_0x0bd5('0x5e')]||_0x0bd5('0x5f'),_0x215491[_0x0bd5('0x60')]||_0x0bd5('0x61'),_0x215491[_0x0bd5('0x62')]||_0x0bd5('0x63'))[_0x0bd5('0x11')](function(_0x1812a4){_0x333303(null,_0x1812a4);})[_0x0bd5('0x12')](function(_0x1182b4){_0x333303(_0x1182b4);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x64')]=function(_0x580a90,_0x2707f7){scripts[_0x0bd5('0x64')](_0x580a90[_0x0bd5('0x5d')],_0x580a90[_0x0bd5('0x65')]||'en',0x1)[_0x0bd5('0x11')](function(_0xf5ef66){_0x2707f7(null,_0xf5ef66);})['catch'](function(_0x1500f2){_0x2707f7(_0x1500f2);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x66')]=function(_0x371b77,_0x3bc8cc){var _0x116e67={'uri':_0x371b77[_0x0bd5('0x67')],'method':_0x371b77['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x371b77['timeout'])==='number'&&parseInt(_0x371b77[_0x0bd5('0x68')])>=0x1?parseInt(_0x371b77[_0x0bd5('0x68')])*0x3e8:0x5*0x3e8};if(_[_0x0bd5('0x69')]([_0x0bd5('0x6a'),_0x0bd5('0x6b')],_0x116e67['method'][_0x0bd5('0x6c')]())){try{_0x116e67[_0x0bd5('0x6d')]=_0x371b77['rawBody']?JSON[_0x0bd5('0x6e')](_0x371b77[_0x0bd5('0xa')]):{};}catch(_0x1a812e){logger[_0x0bd5('0x2e')](_0x0bd5('0x6f'),_0x1a812e);}}try{_0x116e67[_0x0bd5('0x70')]=_0x371b77[_0x0bd5('0x9')]?JSON[_0x0bd5('0x6e')](_0x371b77[_0x0bd5('0x9')]):{};}catch(_0x32110c){logger[_0x0bd5('0x2e')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x32110c);}if(_0x371b77[_0x0bd5('0x71')]){try{var _0x3a0719=require(_0x371b77[_0x0bd5('0x71')])[_0x0bd5('0x72')](this,_0x116e67);_0x116e67[_0x0bd5('0x73')]=Mustache['render'](_0x371b77[_0x0bd5('0x67')],_0x3a0719,{},['$$','$$']);if(_0x116e67[_0x0bd5('0x70')]){_0x116e67[_0x0bd5('0x70')]=JSON[_0x0bd5('0x6e')](Mustache[_0x0bd5('0x74')](JSON[_0x0bd5('0x75')](_0x116e67[_0x0bd5('0x70')]),_0x3a0719,{},['$$','$$']));}if(_0x116e67[_0x0bd5('0x6d')]){_0x116e67[_0x0bd5('0x6d')]=JSON[_0x0bd5('0x6e')](Mustache[_0x0bd5('0x74')](JSON[_0x0bd5('0x75')](_0x116e67[_0x0bd5('0x6d')]),_0x3a0719,{},['$$','$$']));}}catch(_0xcbb2fc){logger[_0x0bd5('0x2e')](_0x0bd5('0x76'),_0xcbb2fc);}}rp(_0x116e67)[_0x0bd5('0x11')](function(_0x14653e){var _0x6afdff={'statusCode':_0x14653e['statusCode']||0xc8,'statusMessage':_0x14653e['statusMessage']||'OK','headers':_0x14653e[_0x0bd5('0x70')]||{},'body':_0x14653e[_0x0bd5('0x6d')]||{}};_0x3bc8cc(null,_0x6afdff);})[_0x0bd5('0x12')](function(_0xc53281){var _0x25b65b={'statusCode':_0xc53281['statusCode']||0x1f4,'statusMessage':_0xc53281[_0x0bd5('0x77')]||_0x0bd5('0x78'),'headers':_0xc53281[_0x0bd5('0x79')][_0x0bd5('0x70')]||{},'body':_0xc53281[_0x0bd5('0x79')]['body']||{}};_0x3bc8cc(null,_0x25b65b);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x7a')]=function(_0x7c1d11,_0x200df8){scripts[_0x0bd5('0x7a')](this[_0x0bd5('0xd')][_0x0bd5('0x3c')],_0x7c1d11[_0x0bd5('0x7b')],_0x7c1d11[_0x0bd5('0x5d')],_0x7c1d11[_0x0bd5('0x7c')]||'en')[_0x0bd5('0x11')](function(_0x48a77d){_0x200df8(null,_0x48a77d);})[_0x0bd5('0x12')](function(_0x26ad0c){_0x200df8(_0x26ad0c);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x7d')]=function(_0x2c77eb,_0x46a5ee){scripts[_0x0bd5('0x7d')](this[_0x0bd5('0xd')]['uniqueid'],_0x2c77eb[_0x0bd5('0x7e')],_0x2c77eb[_0x0bd5('0x7f')],_0x2c77eb[_0x0bd5('0x80')],_0x2c77eb[_0x0bd5('0x5d')],_0x2c77eb[_0x0bd5('0x81')]||'en')[_0x0bd5('0x11')](function(_0x3ee6bf){_0x46a5ee(null,_0x3ee6bf);})[_0x0bd5('0x12')](function(_0x97d31b){_0x46a5ee(_0x97d31b);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x82')]=function(_0x112e85,_0x23a041){scripts[_0x0bd5('0x82')](this[_0x0bd5('0xd')],_0x112e85)[_0x0bd5('0x11')](function(_0x54ba20){_0x23a041(null,_0x54ba20);})[_0x0bd5('0x12')](function(_0x331841){_0x23a041(_0x331841);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x83')]=function(_0x323f48,_0x2cd599){scripts[_0x0bd5('0x83')](_0x323f48[_0x0bd5('0x7b')],_0x323f48[_0x0bd5('0x5d')],_0x323f48['ispeech_tts_language']||_0x0bd5('0x5f'),_0x323f48[_0x0bd5('0x84')])[_0x0bd5('0x11')](function(_0x505d41){_0x2cd599(null,_0x505d41);})[_0x0bd5('0x12')](function(_0x1d5c3a){_0x2cd599(_0x1d5c3a);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x85')]=function(_0x1e7d05,_0x2fd908,_0x533297){scripts[_0x0bd5('0x85')](_0x2fd908,_0x1e7d05['key'],_0x1e7d05[_0x0bd5('0x86')]||'en-US',this['isConfigured'](_0x1e7d05[_0x0bd5('0x87')])?_0x1e7d05[_0x0bd5('0x87')]:undefined)[_0x0bd5('0x11')](function(_0x1e0a98){_0x533297(null,_0x1e0a98);})['catch'](function(_0xb303d9){_0x533297(_0xb303d9);});};AGIVertices[_0x0bd5('0xf')]['awsPolly']=function(_0x8e94cf,_0x3609db){scripts[_0x0bd5('0x88')](_0x8e94cf[_0x0bd5('0x89')],_0x8e94cf[_0x0bd5('0x8a')],_0x8e94cf[_0x0bd5('0x8b')],_0x8e94cf[_0x0bd5('0x8c')]||_0x0bd5('0x8d'),_0x8e94cf[_0x0bd5('0x5d')],_0x8e94cf[_0x0bd5('0x8e')]||_0x0bd5('0x5d'))[_0x0bd5('0x11')](function(_0xaea5ef){_0x3609db(null,_0xaea5ef);})[_0x0bd5('0x12')](function(_0x2220f5){_0x3609db(_0x2220f5);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x8f')]=function(_0x12da8d,_0x2eee49){scripts[_0x0bd5('0x8f')](this[_0x0bd5('0xd')][_0x0bd5('0x3c')],_0x12da8d[_0x0bd5('0x89')],_0x12da8d[_0x0bd5('0x8a')],_0x12da8d[_0x0bd5('0x90')],_0x12da8d[_0x0bd5('0x5d')],_0x12da8d['aws_bot_name'])[_0x0bd5('0x11')](function(_0x4b65f6){_0x2eee49(null,_0x4b65f6);})[_0x0bd5('0x12')](function(_0x467a37){_0x2eee49(_0x467a37);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x91')]=function(_0x105048,_0xeffd4d,_0x1fa5c7){scripts[_0x0bd5('0x91')](_0xeffd4d,_0x105048[_0x0bd5('0x7b')],_0x105048['google_asr_language']||'en-US')[_0x0bd5('0x11')](function(_0x392bdc){_0x1fa5c7(null,_0x392bdc);})['catch'](function(_0x3771b7){_0x1fa5c7(_0x3771b7);});};AGIVertices['prototype'][_0x0bd5('0x92')]=function(_0x1e754a,_0x240ed8,_0x40a5d0){scripts['tildeASR'](_0x240ed8,_0x1e754a[_0x0bd5('0x93')],_0x1e754a[_0x0bd5('0x94')],_0x1e754a[_0x0bd5('0x73')])[_0x0bd5('0x11')](function(_0x5d2896){_0x40a5d0(null,_0x5d2896);})[_0x0bd5('0x12')](function(_0x327708){_0x40a5d0(_0x327708);});};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x95')]=function(_0x31d2e0){var _0x32c424=_[_0x0bd5('0x69')](verticesWithRetry,_0x31d2e0[_0x0bd5('0x96')])?_0x31d2e0:_[_0x0bd5('0x97')](_0x31d2e0);for(var _0x42a7b0 in _0x32c424){if(_0x32c424[_0x0bd5('0x98')](_0x42a7b0)){if(_0x32c424[_0x42a7b0]&&_[_0x0bd5('0x99')](_0x32c424[_0x42a7b0])){if(_['includes'](recursiveMapAttributes,_0x42a7b0)){_0x32c424[_0x42a7b0]=this[_0x0bd5('0x9a')](_0x32c424[_0x42a7b0]);}else{_0x32c424[_0x42a7b0]=this[_0x0bd5('0x9b')](_0x32c424[_0x42a7b0]);}}}}return _0x32c424;};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x9c')]=function(_0x29db27){for(var _0x74b27 in _0x29db27){if(_0x29db27[_0x0bd5('0x98')](_0x74b27)){if(_[_0x0bd5('0x9d')](_0x29db27[_0x74b27])){this[_0x0bd5('0x9c')](_0x29db27[_0x74b27]);}else if(_[_0x0bd5('0x9e')](_0x29db27[_0x74b27])){for(var _0x2a05bc=0x0;_0x2a05bc<_0x29db27[_0x74b27]['length'];_0x2a05bc++){this[_0x0bd5('0x9c')](_0x29db27[_0x74b27][_0x2a05bc]);}}else if(_['isString'](_0x29db27[_0x74b27])){_0x29db27[_0x74b27]=this[_0x0bd5('0x9b')](_0x29db27[_0x74b27]);}}}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x9f')]=function(_0x57e61b,_0x509e4d){for(var _0x57d9dd in _0x57e61b){if(_0x57e61b[_0x0bd5('0x98')](_0x57d9dd)){if(_[_0x0bd5('0x9d')](_0x57e61b[_0x57d9dd])){if(!_[_0x0bd5('0x48')](_0x57e61b[_0x57d9dd])){this[_0x0bd5('0x9f')](_0x57e61b[_0x57d9dd],util[_0x0bd5('0x2a')](_0x0bd5('0xa0'),_0x509e4d,_0x57d9dd));}}else if(_[_0x0bd5('0x9e')](_0x57e61b[_0x57d9dd])){for(var _0xe74312=0x0;_0xe74312<_0x57e61b[_0x57d9dd][_0x0bd5('0xa1')];_0xe74312++){this[_0x0bd5('0x9f')](_0x57e61b[_0x57d9dd][_0xe74312],util[_0x0bd5('0x2a')]('%s.%s',_0x509e4d,_0x57d9dd+'['+_0xe74312+']'));}}else{if(!_[_0x0bd5('0x47')](_0x57e61b[_0x57d9dd])){this[_0x0bd5('0xd')]['setVariable'](util['format'](_0x0bd5('0xa0'),_0x509e4d,_0x57d9dd),_0x57e61b[_0x57d9dd]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x4145b8){try{var _0x26c6db=JSON[_0x0bd5('0x6e')](_0x4145b8);this[_0x0bd5('0x9c')](_0x26c6db);return JSON[_0x0bd5('0x75')](_0x26c6db);}catch(_0x36e17c){return this[_0x0bd5('0x9b')](_0x4145b8);}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x9b')]=function(_0xa965e5){var _0xa2096c=_0xa965e5['split']('{');for(var _0x137649=0x1;_0x137649<_0xa2096c[_0x0bd5('0xa1')];_0x137649+=0x1){var _0x41aeec=_0xa2096c[_0x137649][_0x0bd5('0xa2')]('}');if(_0x41aeec[_0x0bd5('0xa1')]>0x1){_0xa965e5=_0xa965e5[_0x0bd5('0xa3')]('{'+_0x41aeec[0x0]+'}',this[_0x0bd5('0xd')][_0x0bd5('0xa4')](_0x41aeec[0x0])[_0x0bd5('0xa5')]||_0x41aeec[0x0]);}}if(_0xa2096c[_0x0bd5('0xa1')]===0x1){return _0xa965e5[_0x0bd5('0x4e')]();}return this[_0x0bd5('0x9b')](_0xa965e5);};AGIVertices['prototype'][_0x0bd5('0xa6')]=function(_0x5d8f36,_0x337ed1){var _0x4b24f2=this[_0x0bd5('0xd')][_0x0bd5('0xa4')](_0x5d8f36);if(_0x4b24f2[_0x0bd5('0xa7')]===-0x1){return _0x4b24f2;}logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xa8'),_0x337ed1,_0x4b24f2[_0x0bd5('0xa5')]));return this[_0x0bd5('0xd')][_0x0bd5('0xa9')](_0x337ed1,_0x4b24f2[_0x0bd5('0xa5')]);};AGIVertices['prototype'][_0x0bd5('0xaa')]=function(_0x365b22){return _0x365b22&&_0x365b22!=='0'&&_0x365b22!=='-1'&&_0x365b22!=='';};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xab')]=function(_0x26c4c5){this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x26c4c5,'-');_0x26c4c5[_0x0bd5('0xac')]=_0x26c4c5[_0x0bd5('0xab')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xad')]=function(_0x315e4a){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xae'),_0x315e4a[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x315e4a['text'])){return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}var _0x2a8c09='\x22'+_0x315e4a['text']+'\x22';if(this[_0x0bd5('0xaa')](_0x315e4a[_0x0bd5('0x79')])){_0x2a8c09+=','+_0x315e4a[_0x0bd5('0x79')];}var _0x545fde=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0xb2'),_0x2a8c09);if(_0x545fde[_0x0bd5('0xa7')]===-0x1){return _0x545fde;}return this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x2a8c09));};AGIVertices[_0x0bd5('0xf')]['mrcprecog']=function(_0x39a94f){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xb3'),_0x39a94f[_0x0bd5('0xaf')]));if(!this['isConfigured'](_0x39a94f[_0x0bd5('0xb4')])){return this['channel'][_0x0bd5('0xb0')]('no\x20grammar\x20configured');}var _0x5807ba=_0x39a94f[_0x0bd5('0xb4')];if(this[_0x0bd5('0xaa')](_0x39a94f[_0x0bd5('0x79')])){_0x5807ba+=','+_0x39a94f[_0x0bd5('0x79')];}var _0x4f9dd1=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0xb5'),_0x5807ba);if(_0x4f9dd1[_0x0bd5('0xa7')]===-0x1){return _0x4f9dd1;}var _0x5a05b4=this[_0x0bd5('0xa6')](_0x0bd5('0xb6'),_0x0bd5('0xb7'));if(_0x5a05b4[_0x0bd5('0xa7')]===-0x1){return _0x5a05b4;}var _0x20c7c6=this[_0x0bd5('0xa6')](_0x0bd5('0xb8'),_0x0bd5('0xb9'));if(_0x20c7c6[_0x0bd5('0xa7')]===-0x1){return _0x20c7c6;}var _0x466e41=this['getAndSetVariable'](_0x0bd5('0xba'),'MRCP_RECOG_INSTANCE');if(_0x466e41[_0x0bd5('0xa7')]===-0x1){return _0x466e41;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xbb'),_0x5807ba));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xbc')]=function(_0x4b656e){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0xbd'),_0x4b656e[_0x0bd5('0xaf')]));return this['channel'][_0x0bd5('0xbc')]([_0x4b656e[_0x0bd5('0xbe')],_0x4b656e[_0x0bd5('0xbf')]]);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xc0')]=function(_0x20ff57){logger['info'](util['format'](_0x0bd5('0xc1'),_0x20ff57['label']));if(this[_0x0bd5('0xaa')](_0x20ff57[_0x0bd5('0x68')])){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xc2'),_0x20ff57[_0x0bd5('0x68')]));var _0x3da9b5=this[_0x0bd5('0xd')][_0x0bd5('0xc3')](_0x20ff57[_0x0bd5('0x68')]);if(_0x3da9b5[_0x0bd5('0xa7')]===-0x1){return _0x3da9b5;}}return this['channel'][_0x0bd5('0xc0')]();};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x4c')]=function(_0x2f1461){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xc4'),_0x2f1461[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x2f1461[_0x0bd5('0xc5')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x2f1461,_0x0bd5('0xc6'));}_0x2f1461[_0x0bd5('0x4b')]=moment();if(this[_0x0bd5('0xaa')](_0x2f1461[_0x0bd5('0xc7')])){_0x2f1461[_0x0bd5('0x4b')]=moment()[_0x0bd5('0xc8')](_0x2f1461[_0x0bd5('0xc7')],_0x0bd5('0xc9'));}if(!this[_0x0bd5('0xaa')](_0x2f1461['callback_priority'])){_0x2f1461[_0x0bd5('0xca')]=0x2;}this[_0x0bd5('0x46')][_0x0bd5('0x72')](this,_0x2f1461);return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xcb'),_0x2f1461[_0x0bd5('0x4a')],_0x2f1461[_0x0bd5('0xc5')],_0x2f1461['scheduledAt']));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xcc')]=function(_0x3263a7){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0xcd'),_0x3263a7['label']));var _0x2a50a2=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x3263a7['application'],_0x3263a7[_0x0bd5('0x79')]);if(_0x2a50a2[_0x0bd5('0xa7')]===-0x1){return _0x2a50a2;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xce'),_0x3263a7[_0x0bd5('0xcf')],_0x3263a7[_0x0bd5('0x79')]));};AGIVertices[_0x0bd5('0xf')]['lumenvoxtts']=function(_0x1a5c39){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0xd0'),_0x1a5c39[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x1a5c39['text'])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0xb1'));}var _0x4996fc='\x22'+_0x1a5c39['text']+'\x22';if(this['isConfigured'](_0x1a5c39[_0x0bd5('0x79')])){_0x4996fc+=','+_0x1a5c39[_0x0bd5('0x79')];}var _0x3e7ce1=this[_0x0bd5('0xd')][_0x0bd5('0x5a')]('MRCPSynth',_0x4996fc);if(_0x3e7ce1[_0x0bd5('0xa7')]===-0x1){return _0x3e7ce1;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4996fc));};AGIVertices['prototype']['sestektts']=function(_0x394de9){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0xd1'),_0x394de9['label']));if(!this[_0x0bd5('0xaa')](_0x394de9[_0x0bd5('0x5d')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}var _0x3b617f='\x22'+_0x394de9['text']+'\x22';if(this[_0x0bd5('0xaa')](_0x394de9[_0x0bd5('0x79')])){_0x3b617f+=','+_0x394de9[_0x0bd5('0x79')];}var _0x4a3e68=this['channel'][_0x0bd5('0x5a')](_0x0bd5('0xb2'),_0x3b617f);if(_0x4a3e68[_0x0bd5('0xa7')]===-0x1){return _0x4a3e68;}return this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xd2'),_0x3b617f));};AGIVertices['prototype'][_0x0bd5('0xd3')]=function(_0x277dbe){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xd4'),_0x277dbe[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x277dbe['grammar'])){return this[_0x0bd5('0xd')]['noop']('no\x20grammar\x20configured');}var _0x2f066b=_0x277dbe[_0x0bd5('0xb4')];if(this[_0x0bd5('0xaa')](_0x277dbe[_0x0bd5('0x79')])){_0x2f066b+=','+_0x277dbe[_0x0bd5('0x79')];}var _0x221cf6=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0xb5'),_0x2f066b);if(_0x221cf6[_0x0bd5('0xa7')]===-0x1){return _0x221cf6;}var _0x30ffcc=this['getAndSetVariable'](_0x0bd5('0xb6'),_0x0bd5('0xd5'));if(_0x30ffcc['result']===-0x1){return _0x30ffcc;}var _0x3ac7da=this[_0x0bd5('0xa6')](_0x0bd5('0xb8'),_0x0bd5('0xd6'));if(_0x3ac7da[_0x0bd5('0xa7')]===-0x1){return _0x3ac7da;}var _0x163832=this['getAndSetVariable'](_0x0bd5('0xba'),_0x0bd5('0xd7'));if(_0x163832[_0x0bd5('0xa7')]===-0x1){return _0x163832;}return this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0xbb'),_0x2f066b));};AGIVertices['prototype'][_0x0bd5('0xd8')]=function(_0x3d3073){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0xd9'),_0x3d3073['label']));if(!this['isConfigured'](_0x3d3073[_0x0bd5('0xb4')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xda'));}var _0x56a475=_0x3d3073['grammar'];if(this[_0x0bd5('0xaa')](_0x3d3073[_0x0bd5('0x79')])){_0x56a475+=','+_0x3d3073[_0x0bd5('0x79')];}var _0x440d03=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0xb5'),_0x56a475);if(_0x440d03['result']===-0x1){return _0x440d03;}var _0xf69970=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x0bd5('0xdb'));if(_0xf69970[_0x0bd5('0xa7')]===-0x1){return _0xf69970;}var _0x101ada=this[_0x0bd5('0xa6')]('RECOG_INPUT()',_0x0bd5('0xdc'));if(_0x101ada[_0x0bd5('0xa7')]===-0x1){return _0x101ada;}var _0xb325b7=this[_0x0bd5('0xa6')](_0x0bd5('0xba'),_0x0bd5('0xdd'));if(_0xb325b7[_0x0bd5('0xa7')]===-0x1){return _0xb325b7;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0xbb'),_0x56a475));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xde')]=function(_0x17a446){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xdf'),_0x17a446[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x17a446['odbc_id'])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x17a446,_0x0bd5('0xe0'));}var _0x8628fd=this[_0x0bd5('0x19')][_0x0bd5('0x72')](this,_0x17a446[_0x0bd5('0xe1')]);if(!_0x8628fd){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x17a446,'no\x20odbc\x20database\x20found');}if(!this[_0x0bd5('0xaa')](_0x17a446[_0x0bd5('0xe2')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x17a446,_0x0bd5('0xe3'));}var _0x284fbf=_0x17a446['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('query:\x20%s',_0x284fbf));var _0x187367=this[_0x0bd5('0x2c')][_0x0bd5('0x72')](this,_0x8628fd,_0x284fbf);this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x17a446,_0x284fbf);if(!this[_0x0bd5('0xaa')](_0x17a446[_0x0bd5('0xe4')])){return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0xe5'));}var _0x4fd105=this[_0x0bd5('0xa4')]['sync'](this,_0x17a446[_0x0bd5('0xe4')]);if(!_0x4fd105){return this['channel']['error'](_0x17a446,_0x0bd5('0xe6'));}var _0x2a3d44=this;_0x187367[_0x0bd5('0xe7')](function(_0x7e0bac,_0x303cbb){Object[_0x0bd5('0xe8')](_0x7e0bac)[_0x0bd5('0xe7')](function(_0xd0cf36){_0x2a3d44['channel'][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0xe9'),_0x4fd105,_0x303cbb,_0xd0cf36),_0x7e0bac[_0xd0cf36]);});});this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0xea'),_0x4fd105),_0x187367['length']);return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xeb'),_0x4fd105));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xec')]=function(_0x49363b){logger[_0x0bd5('0xed')](util['format'](_0x0bd5('0xee'),_0x49363b[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x49363b[_0x0bd5('0xef')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x49363b,'no\x20user\x20selected');}var _0x48a214=this[_0x0bd5('0x1b')][_0x0bd5('0x72')](this,_0x49363b[_0x0bd5('0xef')]);if(!_0x48a214){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x49363b,_0x0bd5('0xf0'));}var _0x5e6752=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0xf1'),[util['format'](_0x0bd5('0xf2'),_0x48a214),_0x49363b['timeout'],_0x49363b['opts'],_0x49363b[_0x0bd5('0x67')]]);if(_0x5e6752[_0x0bd5('0xa7')]===-0x1){return _0x5e6752;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format']('Executed\x20command\x20%s',_0x0bd5('0xf1')));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xf3')]=function(_0x207acf){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x207acf[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x207acf['key'])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0xf4'));}if(!this[_0x0bd5('0xaa')](_0x207acf['text'])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')][_0x0bd5('0xf5')]=!![];this['createSquareDetailsReport'](_0x207acf);this[_0x0bd5('0x45')](_0x207acf[_0x0bd5('0x5d')],'in','','');this['channel']['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0xf6'),_0x207acf[_0x0bd5('0x5d')]));var _0x24da0a=this[_0x0bd5('0x7a')][_0x0bd5('0x72')](this,_0x207acf);if(_0x24da0a){for(var _0x214875 in _0x24da0a){if(_0x24da0a['hasOwnProperty'](_0x214875)){this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0xf7'),_0x214875[_0x0bd5('0x6c')]()),_0x24da0a[_0x214875]);}}this[_0x0bd5('0x45')](_0x24da0a[_0x0bd5('0xf8')],_0x0bd5('0xf9'),_0x0bd5('0xf3'),'');return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0xfa'),_0x24da0a[_0x0bd5('0xf8')]));}return this[_0x0bd5('0xd')]['error'](_0x207acf,_0x0bd5('0xfb'));};AGIVertices[_0x0bd5('0xf')]['dialogflowV2']=function(_0x2b61e7){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0xfc'),_0x2b61e7[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x2b61e7[_0x0bd5('0x7e')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xfd'));}if(!this[_0x0bd5('0xaa')](_0x2b61e7[_0x0bd5('0x7f')])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0xfe'));}if(!this[_0x0bd5('0xaa')](_0x2b61e7[_0x0bd5('0x80')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xff'));}if(!this[_0x0bd5('0xaa')](_0x2b61e7[_0x0bd5('0x81')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x100'));}if(!this['isConfigured'](_0x2b61e7['text'])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x2b61e7);this[_0x0bd5('0x45')](_0x2b61e7[_0x0bd5('0x5d')],'in','','');this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x101'),_0x2b61e7[_0x0bd5('0x5d')]));var _0x27e296=this[_0x0bd5('0x7d')][_0x0bd5('0x72')](this,_0x2b61e7);if(_0x27e296){for(var _0x70396c in _0x27e296){if(_0x27e296[_0x0bd5('0x98')](_0x70396c)){if(_0x70396c!==_0x0bd5('0x102')){this['channel'][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0xf7'),_0x70396c[_0x0bd5('0x6c')]()),_0x27e296[_0x70396c]);}}}this[_0x0bd5('0x45')](_0x27e296[_0x0bd5('0xf8')],_0x0bd5('0xf9'),_0x0bd5('0x103'),_0x27e296[_0x0bd5('0x102')]);return this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0x104'),_0x27e296[_0x0bd5('0xf8')]));}return this[_0x0bd5('0xd')]['error'](_0x2b61e7,_0x0bd5('0x105'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x106')]=function(_0x47fc7a){logger['info'](util['format'](_0x0bd5('0x107'),_0x47fc7a[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x47fc7a['ndauth_url'])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0x108'));}if(!this[_0x0bd5('0xaa')](_0x47fc7a['username'])){return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0x109'));}if(!this[_0x0bd5('0xaa')](_0x47fc7a[_0x0bd5('0x10a')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x10b'));}if(!this['isConfigured'](_0x47fc7a[_0x0bd5('0x10c')])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0xb1'));}this['channel']['bot']=!![];this[_0x0bd5('0x39')](_0x47fc7a);this[_0x0bd5('0x45')](_0x47fc7a[_0x0bd5('0x5d')],'in','','');this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x10d'),_0x47fc7a[_0x0bd5('0x5d')]));var _0x85338b=this[_0x0bd5('0x82')][_0x0bd5('0x72')](this,_0x47fc7a);if(_0x85338b){for(var _0xbf22de in _0x85338b){if(_0x85338b['hasOwnProperty'](_0xbf22de)){this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0x10e'),_0xbf22de[_0x0bd5('0x6c')]()),_0x85338b[_0xbf22de]);}}this[_0x0bd5('0x45')](_0x85338b[_0x0bd5('0xf8')],'out','sesteknda','');if(_0x85338b[_0x0bd5('0x10f')]){this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0x110'),_0x85338b['audiofile']));var _0x2c67b1=this[_0x0bd5('0xd')][_0x0bd5('0x111')](_0x85338b[_0x0bd5('0x10f')]);try{fs['unlink'](_0x85338b[_0x0bd5('0x10f')]+'.wav');}catch(_0x27fe1e){logger[_0x0bd5('0x2e')](_0x27fe1e);}return _0x2c67b1;}else{return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x112'),_0x85338b['speech']));}}return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x47fc7a,_0x0bd5('0x113'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x114')]=function(_0x1c44b6){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x115'),_0x1c44b6['label']));return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x114'));};AGIVertices['prototype'][_0x0bd5('0x116')]=function(_0xfa2e4d){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x117'),_0xfa2e4d[_0x0bd5('0xaf')]));var _0x32d781='';if(_0xfa2e4d[_0x0bd5('0x118')]){if(!this[_0x0bd5('0xaa')](_0xfa2e4d['trunk_id'])){return this[_0x0bd5('0xd')]['error'](_0xfa2e4d,_0x0bd5('0x119'));}else{var _0x4a43d6=parseInt(_0xfa2e4d['trunk_id'],0xa);if(isNaN(_0x4a43d6)){_0x32d781=_0xfa2e4d[_0x0bd5('0x118')];}else{_0x32d781=this[_0x0bd5('0x11a')][_0x0bd5('0x72')](this,_0xfa2e4d[_0x0bd5('0x118')]);if(!_0x32d781){return this[_0x0bd5('0xd')]['error'](_0xfa2e4d,_0x0bd5('0x11b'));}}}}else if(_0xfa2e4d[_0x0bd5('0x11c')]){_0x32d781=_0xfa2e4d[_0x0bd5('0x11c')];}else{return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0xfa2e4d,'no\x20trunk\x20selected');}var _0x57dd7c=this[_0x0bd5('0xd')][_0x0bd5('0x5a')]('DIAL',[util[_0x0bd5('0x2a')](_0x0bd5('0x11d'),_0x32d781,_0xfa2e4d['phone']),_0xfa2e4d['timeout'],_0xfa2e4d[_0x0bd5('0x11e')],_0xfa2e4d[_0x0bd5('0x67')]]);if(_0x57dd7c[_0x0bd5('0xa7')]===-0x1){return _0x57dd7c;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x11f'),_0x0bd5('0xf1')));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x120')]=function(_0x3aa0a8){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x121'),_0x3aa0a8['label']));return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0x120'));};AGIVertices['prototype'][_0x0bd5('0xc')]=function(_0x1a15f1){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x1a15f1[_0x0bd5('0xaf')]));if(_0x1a15f1[_0x0bd5('0xac')]===0x0){return this['maxRetry'](_0x1a15f1);}_0x1a15f1[_0x0bd5('0xac')]-=0x1;if(!this[_0x0bd5('0xaa')](_0x1a15f1[_0x0bd5('0x122')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1a15f1,_0x0bd5('0x123'));}var _0x5b19d3=this['getSound'][_0x0bd5('0x72')](this,_0x1a15f1['file_id']);if(!_0x5b19d3){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1a15f1,_0x0bd5('0x124'));}if(!this['isConfigured'](_0x1a15f1['variable_id'])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x0bd5('0xe5'));}var _0x4989be=this[_0x0bd5('0xd')][_0x0bd5('0x125')](_0x5b19d3,_0x1a15f1[_0x0bd5('0x126')],_0x1a15f1['maxdigit']);var _0x2add71=_0x4989be[_0x0bd5('0xa7')]?_0x4989be[_0x0bd5('0xa7')][_0x0bd5('0x4e')]():'';logger['info'](_0x0bd5('0x127'),JSON[_0x0bd5('0x75')](_0x4989be));if(_0x4989be['result']===-0x1){this['createSquareDetailsReport'][_0x0bd5('0x72')](this,_0x1a15f1,_0x2add71);return _0x4989be;}else if(_0x4989be['extra']===_0x0bd5('0x68')){_0x4989be[_0x0bd5('0xa7')]=_0x2add71[_0x0bd5('0xa1')]>=parseInt(_0x1a15f1[_0x0bd5('0x128')])?'x':'i';}else{_0x4989be[_0x0bd5('0xa7')]=_0x2add71[_0x0bd5('0xa1')]>=parseInt(_0x1a15f1[_0x0bd5('0x128')])&&_0x2add71[_0x0bd5('0xa1')]<=parseInt(_0x1a15f1[_0x0bd5('0x129')])?'x':'i';}var _0x54738d=this[_0x0bd5('0xa4')][_0x0bd5('0x72')](this,_0x1a15f1[_0x0bd5('0xe4')]);if(!_0x54738d){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1a15f1,'no\x20variable\x20found');}this['channel'][_0x0bd5('0xa9')](_0x54738d,_0x2add71);if(this[_0x0bd5('0xaa')](_0x1a15f1[_0x0bd5('0x12a')])){var _0x173e0b=parseInt(_0x1a15f1[_0x0bd5('0x12a')],0xa);var _0xaf06bd=rs[_0x0bd5('0x12b')]({'charset':'*','length':_0x173e0b});var _0x183052=_0x2add71[_0x0bd5('0xa1')];if(_0x183052>0x0){if(_0x183052>_0x173e0b){this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x1a15f1,_0x1a15f1[_0x0bd5('0x12c')]===_0x0bd5('0x12d')?_0xaf06bd+_0x2add71[_0x0bd5('0x12e')](_0x173e0b):_0x2add71[_0x0bd5('0x12e')](0x0,_0x183052-_0x173e0b)+_0xaf06bd);}else{this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x1a15f1,rs['generate']({'charset':'*','length':_0x183052}));}}else{this[_0x0bd5('0x39')]['sync'](this,_0x1a15f1,'');}}else{this[_0x0bd5('0x39')]['sync'](this,_0x1a15f1,_0x2add71);}return _0x4989be;};AGIVertices['prototype'][_0x0bd5('0x12f')]=function(_0x259463){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x259463[_0x0bd5('0xaf')]));return this['getdigits'](_0x259463);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x130')]=function(_0x5e5211){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x131'),_0x5e5211[_0x0bd5('0xaf')]));this[_0x0bd5('0x39')]['sync'](this,_0x5e5211,_0x5e5211['goalname']);return this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('GOAL\x20%s',_0x5e5211['goalname']));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x132')]=function(_0x284191){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x284191[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x284191['aws_access_key_id'])||!this[_0x0bd5('0xaa')](_0x284191[_0x0bd5('0x8a')])){return this['channel'][_0x0bd5('0xb0')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x0bd5('0xaa')](_0x284191['text'])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x133'),_0x284191['text']));var _0x194aca=this[_0x0bd5('0x88')][_0x0bd5('0x72')](this,_0x284191);if(_0x194aca){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x134'),_0x194aca));var _0x4f0c4b=this['channel'][_0x0bd5('0x111')](_0x194aca);try{fs[_0x0bd5('0x135')](_0x194aca+_0x0bd5('0x136'));}catch(_0x5e84a1){logger['error'](_0x5e84a1);}return _0x4f0c4b;}return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x284191,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x137')]=function(_0x4c522d){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x138'),_0x4c522d[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x4c522d['aws_access_key_id'])||!this['isConfigured'](_0x4c522d[_0x0bd5('0x8a')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x0bd5('0xaa')](_0x4c522d[_0x0bd5('0x139')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x13a'));}if(!this['isConfigured'](_0x4c522d[_0x0bd5('0x5d')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this['channel'][_0x0bd5('0xf5')]=!![];this[_0x0bd5('0x39')](_0x4c522d);this[_0x0bd5('0x45')](_0x4c522d[_0x0bd5('0x5d')],'in','','');this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('Trying\x20Amazon\x20Lex:\x20%s',_0x4c522d[_0x0bd5('0x5d')]));var _0x309a34=this[_0x0bd5('0x8f')][_0x0bd5('0x72')](this,_0x4c522d);if(_0x309a34){for(var _0x3810ff in _0x309a34){if(_0x309a34[_0x0bd5('0x98')](_0x3810ff)&&_[_0x0bd5('0x99')](_0x309a34[_0x3810ff])){this[_0x0bd5('0xd')]['setVariable'](util[_0x0bd5('0x2a')](_0x0bd5('0x13b'),_0x3810ff[_0x0bd5('0x6c')]()),_0x309a34[_0x3810ff]);}}if(_[_0x0bd5('0x47')](_0x309a34[_0x0bd5('0x77')])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0x13c'));}else{this['createSquareMessage'](_0x309a34[_0x0bd5('0x77')],_0x0bd5('0xf9'),_0x0bd5('0x13d'),'');return this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x13e'),_0x309a34[_0x0bd5('0x77')]));}}return this[_0x0bd5('0xd')]['error'](_0x4c522d,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x13f')]=function(_0x25f5c4){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x140'),_0x25f5c4[_0x0bd5('0xaf')],_0x25f5c4[_0x0bd5('0x68')]));if(!this[_0x0bd5('0xaa')](_0x25f5c4[_0x0bd5('0x7b')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xf4'));}var _0xd23950=_0x0bd5('0x141');var _0x2e48f6=util[_0x0bd5('0x2a')](_0x0bd5('0x142'),FILES_PATH,rs[_0x0bd5('0x12b')](0x4));var _0x3ff8e9=util[_0x0bd5('0x2a')](_0x0bd5('0xa0'),_0x2e48f6,_0xd23950);var _0x1b9646=!![];if(_0x25f5c4[_0x0bd5('0x143')]===_0x0bd5('0x144')){_0x1b9646=![];}var _0x1e63e9=this[_0x0bd5('0xd')][_0x0bd5('0x145')](_0x2e48f6,_0xd23950,_0x25f5c4[_0x0bd5('0x146')],_0x25f5c4[_0x0bd5('0x68')],undefined,_0x1b9646);if(_0x1e63e9['result']!==-0x1){this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x147'),_0x3ff8e9));var _0x2c8810=this['googleASR']['sync'](this,_0x25f5c4,_0x3ff8e9);if(_0x2c8810){for(var _0x419a33 in _0x2c8810){if(_0x2c8810['hasOwnProperty'](_0x419a33)){this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util['format'](_0x0bd5('0x148'),_0x419a33[_0x0bd5('0x6c')]()),_0x2c8810[_0x419a33]);}}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x149'),JSON[_0x0bd5('0x75')](_0x2c8810)));}}return _0x1e63e9;};AGIVertices['prototype'][_0x0bd5('0x14a')]=function(_0x3c245c){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x3c245c[_0x0bd5('0xaf')]));if(!this['isConfigured'](_0x3c245c[_0x0bd5('0x93')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x14b'));}if(!this[_0x0bd5('0xaa')](_0x3c245c[_0x0bd5('0x94')])){return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0x14c'));}var _0x48bd5d='wav';var _0x2c810e=util['format'](_0x0bd5('0x142'),FILES_PATH,rs[_0x0bd5('0x12b')](0x4));var _0xa8847=util[_0x0bd5('0x2a')](_0x0bd5('0xa0'),_0x2c810e,_0x48bd5d);var _0x112958=!![];if(_0x3c245c[_0x0bd5('0x143')]==='NOBEEP'){_0x112958=![];}var _0x463f05=this[_0x0bd5('0xd')][_0x0bd5('0x145')](_0x2c810e,_0x48bd5d,_0x3c245c['intKey'],_0x3c245c['timeout'],undefined,_0x112958);if(_0x463f05[_0x0bd5('0xa7')]!==-0x1){this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')]('tilde\x20%s\x20file\x20created',_0xa8847));var _0x376080=this[_0x0bd5('0x92')][_0x0bd5('0x72')](this,_0x3c245c,_0xa8847);if(_0x376080){for(var _0x44b594 in _0x376080){if(_0x376080[_0x0bd5('0x98')](_0x44b594)){this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0x14d'),_0x44b594[_0x0bd5('0x6c')]()),_0x376080[_0x44b594]);}}return this['channel']['noop'](util['format'](_0x0bd5('0x14e'),JSON['stringify'](_0x376080)));}}return _0x463f05;};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x14f')]=function(_0x4087bb){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x150'),_0x4087bb[_0x0bd5('0xaf')]));return this[_0x0bd5('0xd')][_0x0bd5('0x151')](_0x4087bb[_0x0bd5('0x3e')],_0x4087bb[_0x0bd5('0x3f')],_0x4087bb[_0x0bd5('0x40')]);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x152')]=function(_0x14f58f){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x14f58f[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x14f58f[_0x0bd5('0x153')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x14f58f,'no\x20condition\x20configured');}try{var _0x44bde8=eval(_0x14f58f[_0x0bd5('0x153')])?_0x0bd5('0x154'):_0x0bd5('0x155');this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x156'),_0x14f58f[_0x0bd5('0x153')],_0x44bde8));return{'code':0xc8,'result':_0x44bde8};}catch(_0x4f063e){return{'code':0xc8,'result':_0x0bd5('0x155')};}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x157')]=function(_0x1f6da5){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x1f6da5[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x1f6da5[_0x0bd5('0x158')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1f6da5,_0x0bd5('0x159'));}var _0x3936a2=this['getIntervals']['sync'](this,_0x1f6da5[_0x0bd5('0x158')]);if(!_0x3936a2){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1f6da5,'no\x20intervals\x20found');}for(var _0x2e50ca=0x0;_0x2e50ca<_0x3936a2[_0x0bd5('0xa1')];_0x2e50ca+=0x1){var _0x26c6d7=this[_0x0bd5('0xd')][_0x0bd5('0xa4')](util[_0x0bd5('0x2a')](_0x0bd5('0x15a'),_0x3936a2[_0x2e50ca]));if(_0x26c6d7[_0x0bd5('0xa7')]===-0x1){return _0x26c6d7;}logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x15b'),_0x3936a2[_0x2e50ca],_0x26c6d7[_0x0bd5('0xa5')]));if(_0x26c6d7[_0x0bd5('0xa5')]===_0x0bd5('0x154')){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x15b'),_0x3936a2[_0x2e50ca],_0x0bd5('0x154')));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x15b'),_0x3936a2[_0x2e50ca],_0x0bd5('0x154')));return{'code':0xc8,'result':_0x0bd5('0x154')};}else{logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x15b'),_0x3936a2[_0x2e50ca],'false'));this['channel'][_0x0bd5('0xb0')](util['format']('IFTIME\x20%s\x20%s',_0x3936a2[_0x2e50ca],_0x0bd5('0x155')));}}return{'code':0xc8,'result':_0x0bd5('0x155')};};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x15c')]=function(_0x7463ae){logger['info'](util[_0x0bd5('0x2a')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x7463ae[_0x0bd5('0xaf')]));return this['channel'][_0x0bd5('0x15c')]();};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x15d')]=function(_0x592215){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x15e'),_0x592215[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x592215[_0x0bd5('0x7b')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xf4'));}var _0x33f0c0=_0x0bd5('0x141');var _0x6e88fa=util['format'](_0x0bd5('0x142'),FILES_PATH,rs[_0x0bd5('0x12b')](0x4));var _0x4faba1=util['format'](_0x0bd5('0xa0'),_0x6e88fa,_0x33f0c0);var _0x18009d=!![];if(_0x592215[_0x0bd5('0x143')]===_0x0bd5('0x144')){_0x18009d=![];}var _0x597660=this['channel'][_0x0bd5('0x145')](_0x6e88fa,_0x33f0c0,_0x592215[_0x0bd5('0x146')],_0x592215[_0x0bd5('0x68')],undefined,_0x18009d);if(_0x597660['result']!==-0x1){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('ispeech\x20%s\x20file\x20created',_0x4faba1));var _0x43faa5=this[_0x0bd5('0x85')][_0x0bd5('0x72')](this,_0x592215,_0x4faba1);if(_0x43faa5){for(var _0x9605c1 in _0x43faa5){if(_0x43faa5['hasOwnProperty'](_0x9605c1)){this['channel'][_0x0bd5('0xa9')](util[_0x0bd5('0x2a')](_0x0bd5('0x15f'),_0x9605c1[_0x0bd5('0x6c')]()),_0x43faa5[_0x9605c1]);}}return this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0x160'),JSON['stringify'](_0x43faa5)));}}return _0x597660;};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x161')]=function(_0x277363){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x277363[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x277363[_0x0bd5('0x7b')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xf4'));}if(!this['isConfigured'](_0x277363['text'])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x162'),_0x277363['text']));var _0xb64926=this['ispeechTTS'][_0x0bd5('0x72')](this,_0x277363);if(_0xb64926){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x163'),_0xb64926));var _0x3af7b0=this['channel'][_0x0bd5('0x111')](_0xb64926,_0x277363['intKey']);try{fs[_0x0bd5('0x135')](_0xb64926+_0x0bd5('0x136'));}catch(_0x41adb7){logger[_0x0bd5('0x2e')](_0x41adb7);}return _0x3af7b0;}return this['channel'][_0x0bd5('0x2e')](_0x277363,_0x0bd5('0x164'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x165')]=function(_0x357f6c){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x166'),_0x357f6c[_0x0bd5('0xaf')]));if(!this['isConfigured'](_0x357f6c[_0x0bd5('0x167')])){return this[_0x0bd5('0xd')]['error'](_0x357f6c,_0x0bd5('0x168'));}logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x169'),this[_0x0bd5('0xd')]['callerid'],_0x357f6c['findBy']));var _0x3017d9=this[_0x0bd5('0x55')]['sync'](this,_0x357f6c[_0x0bd5('0x167')]);if(_0x3017d9){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x16a'),this['channel'][_0x0bd5('0x3a')],_0x357f6c['findBy']));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x16a'),this[_0x0bd5('0xd')]['callerid'],_0x357f6c[_0x0bd5('0x167')]));return{'code':0xc8,'result':'success'};}else{logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x16b'),this[_0x0bd5('0xd')]['callerid'],_0x357f6c[_0x0bd5('0x167')]));this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x16b'),this['channel']['callerid'],_0x357f6c['findBy']));return{'code':0xc8,'result':_0x0bd5('0x16c')};}};AGIVertices[_0x0bd5('0xf')]['logout']=function(_0x43c805){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x43c805[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x43c805[_0x0bd5('0x167')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x43c805,_0x0bd5('0x168'));}logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x169'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x43c805[_0x0bd5('0x167')]));var _0x145e75=this['agentLogout'][_0x0bd5('0x72')](this,_0x43c805['findBy']);if(_0x145e75){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x16a'),this['channel'][_0x0bd5('0x3a')],_0x43c805[_0x0bd5('0x167')]));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x16a'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x43c805[_0x0bd5('0x167')]));return{'code':0xc8,'result':_0x0bd5('0x16d')};}else{logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x16b'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x43c805['findBy']));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x16b'),this['channel'][_0x0bd5('0x3a')],_0x43c805['findBy']));return{'code':0xc8,'result':_0x0bd5('0x16c')};}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x16e')]=function(_0x3f907d){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x16f'),_0x3f907d['label']));if(!this[_0x0bd5('0xaa')](_0x3f907d[_0x0bd5('0x170')])){return this['channel'][_0x0bd5('0x2e')](_0x3f907d,'no\x20operation\x20configured');}this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x171'),_0x3f907d['operation']));var _0x171751=eval(_0x3f907d[_0x0bd5('0x170')]);if(!this[_0x0bd5('0xaa')](_0x3f907d[_0x0bd5('0xe4')])){return this['channel'][_0x0bd5('0xb0')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1bf149=this[_0x0bd5('0xa4')][_0x0bd5('0x72')](this,_0x3f907d[_0x0bd5('0xe4')]);if(!_0x1bf149){return this['channel'][_0x0bd5('0x2e')](_0x3f907d,_0x0bd5('0xe6'));}if(_[_0x0bd5('0x9e')](_0x171751)){var _0x7109de=this;_0x171751[_0x0bd5('0xe7')](function(_0x4213e9,_0x406e53){_0x7109de['channel'][_0x0bd5('0xa9')](util['format'](_0x0bd5('0x172'),_0x1bf149,_0x406e53),_0x4213e9);});return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x173'),_0x1bf149));}else{return this[_0x0bd5('0xd')][_0x0bd5('0xa9')](_0x1bf149,_0x171751);}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xb')]=function(_0x536b9f){logger['info'](util['format'](_0x0bd5('0x174'),_0x536b9f[_0x0bd5('0xaf')]));if(_0x536b9f[_0x0bd5('0xac')]===0x0){return this[_0x0bd5('0xab')](_0x536b9f);}_0x536b9f['retry']-=0x1;if(!this[_0x0bd5('0xaa')](_0x536b9f[_0x0bd5('0x122')])){return this['channel'][_0x0bd5('0x2e')](_0x536b9f,_0x0bd5('0x123'));}var _0x2a2059=this[_0x0bd5('0x1e')]['sync'](this,_0x536b9f[_0x0bd5('0x122')]);if(!_0x2a2059){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x536b9f,'no\x20file\x20audio\x20found');}var _0x1f6463=this[_0x0bd5('0xd')]['getData'](_0x2a2059,_0x536b9f[_0x0bd5('0x126')],_0x536b9f['digit']);var _0x3e3704=_0x1f6463[_0x0bd5('0xa7')];if(_0x1f6463[_0x0bd5('0xa7')]===-0x1){this['createSquareDetailsReport'][_0x0bd5('0x72')](this,_0x536b9f,'-1');return _0x1f6463;}else if(_0x1f6463[_0x0bd5('0xa5')]===_0x0bd5('0x68')){_0x1f6463[_0x0bd5('0xa7')]=_0x1f6463['result'][_0x0bd5('0xa1')]>0x0?_0x1f6463[_0x0bd5('0xa7')]:'t';}else if(_[_0x0bd5('0x48')](_0x1f6463[_0x0bd5('0xa7')])){_0x1f6463[_0x0bd5('0xa7')]='#';_0x3e3704='#';}if(!this['isConfigured'](_0x536b9f[_0x0bd5('0xe4')])){this[_0x0bd5('0xd')][_0x0bd5('0xb0')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x4bec93=this['getVariable'][_0x0bd5('0x72')](this,_0x536b9f[_0x0bd5('0xe4')]);if(!_0x4bec93){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x536b9f,_0x0bd5('0xe6'));}this['channel'][_0x0bd5('0xa9')](_0x4bec93,_0x3e3704);}this[_0x0bd5('0x39')]['sync'](this,_0x536b9f,_0x3e3704);return _0x1f6463;};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0xb0')]=function(_0x12d23d){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x175'),_0x12d23d['label']));return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x12d23d[_0x0bd5('0x176')]||_0x12d23d['label']);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x177')]=function(_0x4b91aa){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x178'),_0x4b91aa[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x4b91aa['findBy'])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x4b91aa,_0x0bd5('0x168'));}logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x169'),this[_0x0bd5('0xd')]['callerid'],_0x4b91aa[_0x0bd5('0x167')]));var _0x2b99b6=this[_0x0bd5('0x4f')]['sync'](this,_0x4b91aa[_0x0bd5('0x179')]);var _0x23e35a=this[_0x0bd5('0x51')][_0x0bd5('0x72')](this,_0x4b91aa[_0x0bd5('0x167')],_0x2b99b6);if(_0x23e35a){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x16a'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x4b91aa[_0x0bd5('0x167')]));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x4b91aa[_0x0bd5('0x167')]));return{'code':0xc8,'result':_0x0bd5('0x16d')};}else{logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x16b'),this[_0x0bd5('0xd')]['callerid'],_0x4b91aa[_0x0bd5('0x167')]));this['channel'][_0x0bd5('0xb0')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x0bd5('0x3a')],_0x4b91aa['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0bd5('0xf')]['playback']=function(_0x3d96fc){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x3d96fc['label']));if(!this[_0x0bd5('0xaa')](_0x3d96fc['file_id'])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x3d96fc,'no\x20file\x20audio\x20selected');}var _0x4b3285=this[_0x0bd5('0x1e')][_0x0bd5('0x72')](this,_0x3d96fc[_0x0bd5('0x122')]);if(!_0x4b3285){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x3d96fc,_0x0bd5('0x124'));}var _0x1504e5=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0x17a'),[_0x4b3285,_0x3d96fc[_0x0bd5('0x11e')]]);if(_0x1504e5['result']===-0x1){return _0x1504e5;}return this[_0x0bd5('0xd')]['noop'](util[_0x0bd5('0x2a')](_0x0bd5('0xce'),'PLAYBACK',_0x4b3285));};AGIVertices['prototype']['queue']=function(_0x465452){logger['info'](util[_0x0bd5('0x2a')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x465452[_0x0bd5('0xaf')]));if(!this['isConfigured'](_0x465452['queue_id'])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x465452,_0x0bd5('0x17b'));}var _0x316e4c='';var _0x4edadd=parseInt(_0x465452[_0x0bd5('0x17c')],0xa);if(isNaN(_0x4edadd)){_0x316e4c=_0x465452[_0x0bd5('0x17c')];}else{_0x316e4c=this[_0x0bd5('0x13')][_0x0bd5('0x72')](this,_0x465452['queue_id']);if(!_0x316e4c){return this[_0x0bd5('0xd')]['error'](_0x465452,'no\x20queue\x20found');}}var _0x4010d7='';if(this[_0x0bd5('0xaa')](_0x465452['file_id'])){var _0x31beee=this[_0x0bd5('0x1e')][_0x0bd5('0x72')](this,_0x465452[_0x0bd5('0x122')]);if(_0x31beee){_0x4010d7=_0x31beee;}}this[_0x0bd5('0x39')]['sync'](this,_0x465452,_0x316e4c);if(_0x465452[_0x0bd5('0x11e')]['indexOf']('x')<0x0){_0x465452['opts']+='x';}if(_0x465452['opts'][_0x0bd5('0x17d')]('X')<0x0){_0x465452[_0x0bd5('0x11e')]+='X';}this[_0x0bd5('0xd')][_0x0bd5('0xa9')](_0x0bd5('0x17e'),_0x316e4c?_0x316e4c['toLowerCase']():'');var _0x1a22db=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0x17f'),[_0x316e4c,_0x465452[_0x0bd5('0x11e')],_0x465452[_0x0bd5('0x67')],_0x4010d7,_0x465452[_0x0bd5('0x68')],_0x465452[_0x0bd5('0xbc')],_0x465452[_0x0bd5('0x180')],_0x465452[_0x0bd5('0x181')],'',_0x465452[_0x0bd5('0x182')]]);if(_0x1a22db['result']===-0x1){return _0x1a22db;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xce'),_0x0bd5('0x17f'),_0x316e4c));};AGIVertices[_0x0bd5('0xf')]['record']=function(_0x28d03a){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x183'),_0x28d03a[_0x0bd5('0xaf')]));var _0x4655f1=_0x28d03a[_0x0bd5('0x184')]||_0x0bd5('0x141');var _0x5ba2ec=util[_0x0bd5('0x2a')](_0x0bd5('0x185'),this[_0x0bd5('0xd')][_0x0bd5('0x3c')],rs[_0x0bd5('0x12b')](0x5));var _0x4e77c9=util[_0x0bd5('0x2a')](_0x0bd5('0x186'),FILES_PATH,_0x5ba2ec,_0x4655f1);var _0x38f391=util[_0x0bd5('0x2a')]('%s/recordings/%s',FILES_PATH,_0x5ba2ec);this[_0x0bd5('0x3b')][_0x0bd5('0x72')](this,_0x28d03a,_0x5ba2ec,_0x4e77c9);this[_0x0bd5('0xd')][_0x0bd5('0xa9')](_0x0bd5('0x187'),_0x5ba2ec);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x38f391,_0x4655f1,_0x28d03a[_0x0bd5('0x188')],_0x28d03a[_0x0bd5('0x68')]);return this[_0x0bd5('0xd')]['recordFile'](_0x38f391,_0x4655f1,_0x28d03a[_0x0bd5('0x188')],_0x28d03a[_0x0bd5('0x68')],undefined,!![]);};AGIVertices[_0x0bd5('0xf')]['restapi']=function(_0xb556c6){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x189'),_0xb556c6[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0xb556c6['url'])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x18a'));}var _0x3c45bf=this[_0x0bd5('0x66')][_0x0bd5('0x72')](this,_0xb556c6);logger['info'](util[_0x0bd5('0x2a')]('Response:',util[_0x0bd5('0x18b')](_0x3c45bf,{'showHidden':![],'depth':null})));if(!this[_0x0bd5('0xaa')](_0xb556c6[_0x0bd5('0xe4')])){return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0x18c'));}var _0x118a01=this[_0x0bd5('0xa4')][_0x0bd5('0x72')](this,_0xb556c6[_0x0bd5('0xe4')]);if(!_0x118a01){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0xb556c6,_0x0bd5('0xe6'));}this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util['format'](_0x0bd5('0x18d'),_0x118a01),_0x3c45bf[_0x0bd5('0x18e')]?_0x3c45bf[_0x0bd5('0x18e')]:_0x0bd5('0x18f'));this[_0x0bd5('0xd')][_0x0bd5('0xa9')](util['format'](_0x0bd5('0x190'),_0x118a01),_0x3c45bf[_0x0bd5('0x191')]?_0x3c45bf[_0x0bd5('0x191')]:'OK');if(_0x3c45bf[_0x0bd5('0x6d')]){try{this[_0x0bd5('0x9f')](_0x3c45bf['body'],_0x118a01);}catch(_0x2be7e2){logger[_0x0bd5('0x2e')](util[_0x0bd5('0x2a')](_0x0bd5('0x192'),_0x118a01));}}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0xeb'),_0x118a01));};AGIVertices[_0x0bd5('0xf')]['saydigits']=function(_0x23bfb7){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x193'),_0x23bfb7['label']));return this[_0x0bd5('0xd')][_0x0bd5('0x194')](_0x23bfb7['digits']['replace'](/\s+/g,''),_0x23bfb7[_0x0bd5('0x188')]);};AGIVertices[_0x0bd5('0xf')]['saynumber']=function(_0x497cdf){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x195'),_0x497cdf['label']));return this[_0x0bd5('0xd')]['sayNumber'](_0x497cdf['number'][_0x0bd5('0x5b')](/\s+/g,''),_0x497cdf[_0x0bd5('0x188')]);};AGIVertices[_0x0bd5('0xf')]['sayphonetic']=function(_0x4cbb81){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x196'),_0x4cbb81[_0x0bd5('0xaf')]));return this[_0x0bd5('0xd')]['sayPhonetic'](_0x4cbb81[_0x0bd5('0x5d')],_0x4cbb81[_0x0bd5('0x188')]);};AGIVertices[_0x0bd5('0xf')]['sendMail']=function(_0x1827f9){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x197'),_0x1827f9['label']));if(!this[_0x0bd5('0xaa')](_0x1827f9[_0x0bd5('0x198')])){return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0x199'));}var _0x14dbae=this[_0x0bd5('0x22')][_0x0bd5('0x72')](this,_0x1827f9[_0x0bd5('0x198')]);if(!_0x14dbae||!_0x14dbae[_0x0bd5('0x19a')]){return this[_0x0bd5('0xd')]['error'](_0x1827f9,_0x0bd5('0x19b'));}var _0x41215a={'from':util[_0x0bd5('0x2a')](_0x0bd5('0x19c'),_0x14dbae['name'],_0x14dbae[_0x0bd5('0x19d')]||_0x14dbae['Smtp']['user']),'to':_0x1827f9['to']||'','cc':_0x1827f9['cc']||'','bcc':_0x1827f9['bcc']||'','subject':_0x1827f9['subject'],'html':_0x1827f9[_0x0bd5('0x5d')],'text':_0x1827f9[_0x0bd5('0x5d')]};if(this[_0x0bd5('0xaa')](_0x1827f9[_0x0bd5('0x19e')])){}logger[_0x0bd5('0xed')](_0x0bd5('0x19f'),JSON[_0x0bd5('0x75')](_0x41215a));this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x1827f9,_0x1827f9[_0x0bd5('0x198')]);this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1a0'),_0x14dbae[_0x0bd5('0x16')]));this['sendMailMessage'][_0x0bd5('0x72')](this,_0x14dbae[_0x0bd5('0x1a1')],_0x41215a);return this['channel'][_0x0bd5('0xb0')](_0x0bd5('0x1a2'));};AGIVertices[_0x0bd5('0xf')]['sendFax']=function(_0x1d1b6f){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x1a3'),_0x1d1b6f[_0x0bd5('0xaf')]));return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x1a4'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1a5')]=function(_0x23ce8c){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x23ce8c['label']));if(!this[_0x0bd5('0xaa')](_0x23ce8c['sms_account_id'])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x1a6'));}var _0x3f0cd7=this[_0x0bd5('0x36')][_0x0bd5('0x72')](this,_0x23ce8c[_0x0bd5('0x1a7')]);if(!_0x3f0cd7){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x23ce8c,_0x0bd5('0x1a8'));}var _0x42dd38={'body':_0x23ce8c[_0x0bd5('0x1a9')],'phone':_0x23ce8c['to']||'','SmsAccountId':_0x3f0cd7['id']};logger[_0x0bd5('0xed')]('sendSMS\x20message',JSON['stringify'](_0x42dd38));this[_0x0bd5('0x39')][_0x0bd5('0x72')](this,_0x23ce8c,_0x23ce8c[_0x0bd5('0x1a7')]);this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1aa'),_0x3f0cd7['name']));this[_0x0bd5('0x38')][_0x0bd5('0x72')](this,_0x42dd38);return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x1ab'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1ac')]=function(_0x15add0){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x15add0[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x15add0[_0x0bd5('0xe4')])){return this[_0x0bd5('0xd')]['error'](_0x15add0,_0x0bd5('0x1ad'));}var _0x536880=this[_0x0bd5('0xa4')][_0x0bd5('0x72')](this,_0x15add0[_0x0bd5('0xe4')]);if(!_0x536880){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x15add0,_0x0bd5('0xe6'));}return this['channel'][_0x0bd5('0xa9')](_0x536880,_0x15add0['variable_value']);};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1ae')]=function(_0x3a412b){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x1af'),_0x3a412b['label']));this[_0x0bd5('0xd')][_0x0bd5('0xb0')]('START\x20CALLY\x20SQUARE');var _0x41b6df=this['channel'][_0x0bd5('0xa4')]('XMCS-UNIQUEID');if(!_['isEmpty'](_0x41b6df[_0x0bd5('0xa5')])){this[_0x0bd5('0xd')][_0x0bd5('0x3c')]=_0x41b6df[_0x0bd5('0xa5')];}if(_0x3a412b[_0x0bd5('0xc0')]===_0x0bd5('0x1b0')){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x1b1'));return this[_0x0bd5('0xd')]['answer']();}return this[_0x0bd5('0xd')]['noop'](_0x0bd5('0x1b2'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1b3')]=function(_0x282953){logger['info'](util[_0x0bd5('0x2a')](_0x0bd5('0x1b4'),_0x282953['label']));if(!this[_0x0bd5('0xaa')](_0x282953['project_id'])){return this[_0x0bd5('0xd')]['error'](_0x282953,_0x0bd5('0x1b5'));}var _0x3c24d2=this['getSquareProject'][_0x0bd5('0x72')](this,_0x282953['project_id']);if(!this['isConfigured'](_0x3c24d2)){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x282953,util['format'](_0x0bd5('0x1b6'),_0x282953[_0x0bd5('0x1b7')]));}if(_0x3c24d2===this[_0x0bd5('0xd')]['arg_1']){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x282953,_0x0bd5('0x1b8'));}this['createSquareDetailsReport']['sync'](this,_0x282953,_0x3c24d2);var _0xdb0a02=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0x1b9'),util[_0x0bd5('0x2a')](_0x0bd5('0x1ba'),config[_0x0bd5('0xbc')]['host']||_0x0bd5('0x1bb'),_0x3c24d2,this[_0x0bd5('0xd')][_0x0bd5('0x43')]));if(_0xdb0a02['result']===-0x1){return _0xdb0a02;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')]('Executed\x20command\x20%s\x20%s',_0x0bd5('0x1b9'),_0x3c24d2));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1bc')]=function(_0x3797c2){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x1bd'),_0x3797c2[_0x0bd5('0xaf')]));var _0x50d6d4=this[_0x0bd5('0x59')]['sync'](this,_0x3797c2['command']);this['createSquareDetailsReport'][_0x0bd5('0x72')](this,_0x3797c2,_0x3797c2[_0x0bd5('0xbe')]);if(this[_0x0bd5('0xaa')](_0x3797c2[_0x0bd5('0xe4')])){var _0xa4bc74=this[_0x0bd5('0xa4')]['sync'](this,_0x3797c2[_0x0bd5('0xe4')]);if(_0xa4bc74){this[_0x0bd5('0xd')][_0x0bd5('0xa9')](_0xa4bc74,_0x50d6d4);return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1be'),_0x3797c2[_0x0bd5('0xbe')],_0xa4bc74));}}return this['channel'][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1bf'),_0x3797c2[_0x0bd5('0xbe')]));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1c0')]=function(_0xf92b03){logger['info'](util['format'](_0x0bd5('0x1c1'),_0xf92b03[_0x0bd5('0xaf')]));_0xf92b03[_0x0bd5('0x5d')]=_0xf92b03[_0x0bd5('0x5d')][_0x0bd5('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0bd5('0xaa')](_0xf92b03[_0x0bd5('0x5c')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0x1c2'));}if(!this[_0x0bd5('0xaa')](_0xf92b03[_0x0bd5('0x5d')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1c3'),_0xf92b03[_0x0bd5('0x5d')]));var _0x452a90=this['googleCloudTTS'][_0x0bd5('0x72')](this,_0xf92b03);if(_0x452a90){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x1c4'),_0x452a90));var _0x3ba9eb=this['channel'][_0x0bd5('0x111')](_0x452a90);try{fs[_0x0bd5('0x135')](_0x452a90+_0x0bd5('0x136'));}catch(_0x2aae79){logger[_0x0bd5('0x2e')](_0x2aae79);}return _0x3ba9eb;}return this[_0x0bd5('0xd')]['error'](_0xf92b03,_0x0bd5('0x1c5'));};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1c6')]=function(_0x27cdf0){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x1c7'),_0x27cdf0[_0x0bd5('0xaf')]));_0x27cdf0[_0x0bd5('0x5d')]=_0x27cdf0[_0x0bd5('0x5d')][_0x0bd5('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0bd5('0xaa')](_0x27cdf0[_0x0bd5('0x5d')])){return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](_0x0bd5('0xb1'));}this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x1c8'),_0x27cdf0[_0x0bd5('0x5d')]));var _0x3f8b2f=this[_0x0bd5('0x64')]['sync'](this,_0x27cdf0);if(_0x3f8b2f){this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x1c9'),_0x3f8b2f));var _0x75e291=this['channel'][_0x0bd5('0x111')](_0x3f8b2f);try{fs[_0x0bd5('0x135')](_0x3f8b2f+'.wav');}catch(_0x4c23a4){logger[_0x0bd5('0x2e')](_0x4c23a4);}return _0x75e291;}return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x27cdf0,_0x0bd5('0x1ca'));};AGIVertices['prototype'][_0x0bd5('0x1cb')]=function(_0x1685b4){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x1685b4[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x1685b4[_0x0bd5('0x167')])){return this[_0x0bd5('0xd')][_0x0bd5('0x2e')](_0x1685b4,_0x0bd5('0x168'));}logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x169'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x1685b4[_0x0bd5('0x167')]));var _0x2e3f18=this[_0x0bd5('0x53')][_0x0bd5('0x72')](this,_0x1685b4[_0x0bd5('0x167')]);if(_0x2e3f18){logger[_0x0bd5('0x30')](util['format'](_0x0bd5('0x16a'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x1685b4[_0x0bd5('0x167')]));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util['format'](_0x0bd5('0x16a'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x1685b4[_0x0bd5('0x167')]));return{'code':0xc8,'result':_0x0bd5('0x16d')};}else{logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x0bd5('0x3a')],_0x1685b4[_0x0bd5('0x167')]));this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0x16b'),this[_0x0bd5('0xd')][_0x0bd5('0x3a')],_0x1685b4['findBy']));return{'code':0xc8,'result':_0x0bd5('0x16c')};}};AGIVertices[_0x0bd5('0xf')][_0x0bd5('0x1cc')]=function(_0x50911a){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x50911a[_0x0bd5('0xaf')]));var _0x2f083b=this[_0x0bd5('0xd')][_0x0bd5('0x5a')](_0x0bd5('0x1cd'),[_0x50911a[_0x0bd5('0x1ce')],_0x50911a[_0x0bd5('0x79')]]);if(_0x2f083b['result']===-0x1){return _0x2f083b;}return this[_0x0bd5('0xd')][_0x0bd5('0xb0')](util[_0x0bd5('0x2a')](_0x0bd5('0xce'),_0x0bd5('0x1cd'),_0x50911a[_0x0bd5('0x1ce')]));};AGIVertices[_0x0bd5('0xf')]['vswitch']=function(_0x31e58e){logger[_0x0bd5('0x30')](util[_0x0bd5('0x2a')](_0x0bd5('0x1cf'),_0x31e58e[_0x0bd5('0xaf')]));if(!this[_0x0bd5('0xaa')](_0x31e58e['variable_id'])){return this[_0x0bd5('0xd')]['error'](_0x31e58e,_0x0bd5('0x1ad'));}var _0x49077c=this[_0x0bd5('0xa4')][_0x0bd5('0x72')](this,_0x31e58e[_0x0bd5('0xe4')]);if(!_0x49077c){return this[_0x0bd5('0xd')]['error'](_0x31e58e,_0x0bd5('0xe6'));}var _0x161c39=this[_0x0bd5('0xd')][_0x0bd5('0xa4')](_0x49077c);return{'code':0xc8,'result':_0x161c39[_0x0bd5('0xa5')]?_0x161c39[_0x0bd5('0xa5')]:'-'};};String[_0x0bd5('0xf')][_0x0bd5('0xa3')]=function(_0x6d1308,_0x1c8003){return this['split'](_0x6d1308)[_0x0bd5('0x1d0')](_0x1c8003);};module[_0x0bd5('0x1d1')]=AGIVertices; \ No newline at end of file +var _0xb66c=['agentLogin','internal','LOCAL','exec','trim','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','headers','rawHeaders','parse','computedVariables','uri','render','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_polly_region','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','getVariable','extra','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','scheduledAt','delay','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','getSquareOdbc','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','speech','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','mindigit','maxdigit','hiddendigitsnum','hiddendigitspos','substr','generate','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_secret_access_key','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','stringify','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','NOBEEP','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','AGENT\x20%s\x20FOUND\x20BY','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','digit','no\x20variable\x20found','Enter\x20in\x20NOOP\x20(%s)\x20block','getPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%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','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','getMailAccount','no\x20mail\x20account\x20found','Smtp','bcc','subject','template_id','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','sms_account_id','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','XMCS-UNIQUEID','yes','Skipped\x20Answer','subproject','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','system','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','util','shelljs','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariableById','name','catch','getVoiceQueue','then','getSquareProjectById','getSquareOdbcById','getUser','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','priority','dnid','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','isNil','phone','list_id','callback','Callback\x20scheduled\x20at\x20','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xb66c,0x175));var _0xcb66=function(_0x59bc77,_0x4556aa){_0x59bc77=_0x59bc77-0x0;var _0x19b145=_0xb66c[_0x59bc77];return _0x19b145;};'use strict';var fs=require('fs');var util=require(_0xcb66('0x0'));var _=require('lodash');var sh=require(_0xcb66('0x1'));var odbc=require('odbc')();var rs=require(_0xcb66('0x2'));var moment=require(_0xcb66('0x3'));var Mustache=require(_0xcb66('0x4'));var rp=require('request-promise');var logger=require(_0xcb66('0x5'))(_0xcb66('0x6'));var config=require(_0xcb66('0x7'));var scripts=require(_0xcb66('0x8'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0xcb66('0x9')];var verticesWithRetry=[_0xcb66('0xa'),_0xcb66('0xb'),_0xcb66('0xc')];var AGIVertices=function(_0xf7bc39,_0x58582b,_0x2c62ad){this[_0xcb66('0xd')]=_0xf7bc39;this[_0xcb66('0xe')]=_0x58582b;this[_0xcb66('0xf')]=_0x2c62ad;};AGIVertices[_0xcb66('0x10')]['getVariable']=function(_0x393bde,_0x2b32ec){this[_0xcb66('0xe')][_0xcb66('0x11')](_0x393bde)['then'](function(_0x9eda68){_0x2b32ec(null,_0x9eda68?_0x9eda68[_0xcb66('0x12')]:![]);})[_0xcb66('0x13')](function(_0x2339bb){_0x2b32ec(_0x2339bb);});};AGIVertices['prototype'][_0xcb66('0x14')]=function(_0x40c810,_0x36c846){this[_0xcb66('0xe')]['getVoiceQueueById'](_0x40c810)[_0xcb66('0x15')](function(_0x540e7e){_0x36c846(null,_0x540e7e?_0x540e7e[_0xcb66('0x12')]:![]);})['catch'](function(_0x27442d){_0x36c846(_0x27442d);});};AGIVertices['prototype']['getSquareProject']=function(_0x274aed,_0x13cfea){this[_0xcb66('0xe')][_0xcb66('0x16')](_0x274aed)['then'](function(_0x3a6e26){_0x13cfea(null,_0x3a6e26?_0x3a6e26[_0xcb66('0x12')]:![]);})[_0xcb66('0x13')](function(_0x58bca0){_0x13cfea(_0x58bca0);});};AGIVertices[_0xcb66('0x10')]['getSquareOdbc']=function(_0x4165ea,_0x41edae){this[_0xcb66('0xe')][_0xcb66('0x17')](_0x4165ea)['then'](function(_0x51990b){_0x41edae(null,_0x51990b?_0x51990b['dsn']:![]);})[_0xcb66('0x13')](function(_0x4b13d4){_0x41edae(_0x4b13d4);});};AGIVertices['prototype'][_0xcb66('0x18')]=function(_0x507d5a,_0x1c1219){this[_0xcb66('0xe')][_0xcb66('0x19')](_0x507d5a)[_0xcb66('0x15')](function(_0x1261d2){_0x1c1219(null,_0x1261d2?_0x1261d2[_0xcb66('0x12')]:![]);})[_0xcb66('0x13')](function(_0x5977e1){_0x1c1219(_0x5977e1);});};AGIVertices[_0xcb66('0x10')]['getTrunk']=function(_0x4cdcd9,_0xf89c0e){this[_0xcb66('0xe')][_0xcb66('0x1a')](_0x4cdcd9)['then'](function(_0x341554){_0xf89c0e(null,_0x341554?_0x341554[_0xcb66('0x12')]:![]);})[_0xcb66('0x13')](function(_0x40e3de){_0xf89c0e(_0x40e3de);});};AGIVertices['prototype'][_0xcb66('0x1b')]=function(_0x31560e,_0x134987){var _0x293711=this;this[_0xcb66('0xe')][_0xcb66('0x1c')](_0x31560e)[_0xcb66('0x15')](function(_0x967710){_0x134987(null,_0x967710?_0x293711[_0xcb66('0x1d')](_0x967710[_0xcb66('0x1e')]):![]);})['catch'](function(_0x2152dc){_0x134987(_0x2152dc);});};AGIVertices['prototype']['getMailAccount']=function(_0x58cd2b,_0x31a10a){this['rpc'][_0xcb66('0x1f')](_0x58cd2b)[_0xcb66('0x15')](function(_0x1b8a79){_0x31a10a(null,_0x1b8a79?_0x1b8a79:![]);})['catch'](function(_0x123787){_0x31a10a(_0x123787);});};AGIVertices[_0xcb66('0x10')][_0xcb66('0x20')]=function(_0x311ede,_0xa411e3,_0x375636){this[_0xcb66('0xf')][_0xcb66('0x20')](_0x311ede,_0xa411e3)[_0xcb66('0x15')](function(){_0x375636(null);})[_0xcb66('0x13')](function(_0x521350){_0x375636(_0x521350);});};AGIVertices[_0xcb66('0x10')][_0xcb66('0x21')]=function(_0xeba0d1,_0x5f6d80){this[_0xcb66('0xe')][_0xcb66('0x22')](_0xeba0d1)[_0xcb66('0x15')](function(_0x5a343f){if(_0x5a343f){if(_0x5a343f[_0xcb66('0x23')]){_0x5f6d80(null,[_0x5a343f[_0xcb66('0x24')]]);}else{_0x5f6d80(null,_[_0xcb66('0x25')](_0x5a343f[_0xcb66('0x26')],'interval'));}}else{_0x5f6d80(null,![]);}})[_0xcb66('0x13')](function(_0x17a21a){_0x5f6d80(_0x17a21a);});};AGIVertices[_0xcb66('0x10')][_0xcb66('0x1d')]=function(_0x17152e){return util[_0xcb66('0x27')](_0xcb66('0x28'),FILES_PATH,_0x17152e);};AGIVertices[_0xcb66('0x10')][_0xcb66('0x29')]=function(_0x299156,_0x3dc592,_0x17b087){odbc['open'](_0x299156,function(_0x4d9b76){if(_0x4d9b76){logger['error'](_0xcb66('0x2a'),_0x4d9b76);_0x17b087(_0x4d9b76);}else{logger[_0xcb66('0x2b')](_0xcb66('0x2c'));odbc[_0xcb66('0x2d')](_0x3dc592,function(_0x1a2686,_0x2d8a5e){if(_0x1a2686){logger['info'](_0xcb66('0x2e'),_0x3dc592);_0x17b087(_0x1a2686);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x3dc592);odbc['close'](function(_0x411105){if(_0x411105){logger[_0xcb66('0x2f')](_0xcb66('0x30'),_0x411105);}_0x17b087(null,_0x2d8a5e);});}});}});};AGIVertices[_0xcb66('0x10')][_0xcb66('0x31')]=function(_0x3e71a7,_0x3422b6){this[_0xcb66('0xe')][_0xcb66('0x32')](_0x3e71a7)['then'](function(_0xe45331){_0x3422b6(null,_0xe45331?_0xe45331:![]);})[_0xcb66('0x13')](function(_0x4df1b8){_0x3422b6(_0x4df1b8);});};AGIVertices['prototype'][_0xcb66('0x33')]=function(_0x1f1712,_0x4a5934){this['rpc'][_0xcb66('0x33')](_0x1f1712)['then'](function(_0x4d2049){_0x4a5934(null,_0x4d2049);})[_0xcb66('0x13')](function(_0x192bb){_0x4a5934(_0x192bb);});};AGIVertices[_0xcb66('0x10')][_0xcb66('0x34')]=function(_0x99229,_0x235862,_0x3323ee){this[_0xcb66('0xe')][_0xcb66('0x34')]({'uniqueid':this['channel']['uniqueid'],'node':_0x99229['label'],'application':_0x99229[_0xcb66('0x35')],'data':_0x235862||null,'project_name':this['channel'][_0xcb66('0x36')],'callerid':this['channel'][_0xcb66('0x37')]})[_0xcb66('0x15')](function(_0x3c3b62){if(_0x3323ee){_0x3323ee(null,_0x3c3b62);}})[_0xcb66('0x13')](function(_0x3115e2){if(_0x3323ee){_0x3323ee(_0x3115e2);}});};AGIVertices[_0xcb66('0x10')]['createSquareRecording']=function(_0x51848c,_0x437490,_0x99d85b,_0x165397){this[_0xcb66('0xe')][_0xcb66('0x38')]({'uniqueid':this[_0xcb66('0xd')][_0xcb66('0x39')],'callerid':this[_0xcb66('0xd')][_0xcb66('0x37')],'calleridname':this['channel'][_0xcb66('0x3a')],'context':this[_0xcb66('0xd')][_0xcb66('0x3b')],'extension':this[_0xcb66('0xd')]['extension'],'priority':this[_0xcb66('0xd')][_0xcb66('0x3c')],'accountcode':this[_0xcb66('0xd')]['accountcode'],'dnid':this[_0xcb66('0xd')][_0xcb66('0x3d')],'projectName':this[_0xcb66('0xd')][_0xcb66('0x36')],'saveName':_0x437490,'filename':_0x51848c['file']||_0x437490,'savePath':_0x99d85b})[_0xcb66('0x15')](function(_0xb0854f){_0x165397(null,_0xb0854f);})[_0xcb66('0x13')](function(_0x4b1d46){_0x165397(_0x4b1d46);});};AGIVertices['prototype'][_0xcb66('0x3e')]=function(_0x5defd3,_0x37262a,_0x55c6e4,_0x184653,_0x416448){this[_0xcb66('0xe')]['createSquareMessage']({'uniqueid':this[_0xcb66('0xd')]['uniqueid'],'body':_0x5defd3,'direction':_0x37262a,'providerName':_0x55c6e4,'providerResponse':_0x184653})[_0xcb66('0x15')](function(_0xe1b64d){if(_0x416448){_0x416448(null,_0xe1b64d);}})[_0xcb66('0x13')](function(_0x1f6d4d){if(_0x416448){_0x416448(_0x1f6d4d);}});};AGIVertices[_0xcb66('0x10')]['createCmContact']=function(_0x9017f4,_0x5b04ad){this[_0xcb66('0xe')][_0xcb66('0x3f')]({'firstName':_[_0xcb66('0x40')](_0x9017f4['name'])||_['isNil'](_0x9017f4['name'])?_0xcb66('0x41')+Math[_0xcb66('0x42')]():_0x9017f4[_0xcb66('0x12')],'lastName':_[_0xcb66('0x40')](_0x9017f4[_0xcb66('0x43')])||_[_0xcb66('0x44')](_0x9017f4[_0xcb66('0x43')])?null:_0x9017f4[_0xcb66('0x43')],'phone':_0x9017f4[_0xcb66('0x45')],'ListId':_0x9017f4[_0xcb66('0x46')],'scheduledat':_0x9017f4['scheduledAt'],'callbackUniqueid':this[_0xcb66('0xd')][_0xcb66('0x39')],'tags':_0xcb66('0x47'),'description':_0xcb66('0x48')+_0x9017f4['scheduledAt']['toString'](),'priority':_0x9017f4[_0xcb66('0x49')]})[_0xcb66('0x15')](function(_0x726d0f){_0x5b04ad(null,_0x726d0f);})[_0xcb66('0x13')](function(_0xff3820){_0x5b04ad(_0xff3820);});};AGIVertices[_0xcb66('0x10')]['getPause']=function(_0x3888ce,_0xf69f45){this[_0xcb66('0xe')][_0xcb66('0x4a')](_0x3888ce)['then'](function(_0x454493){_0xf69f45(null,_0x454493?_0x454493['name']:![]);})[_0xcb66('0x13')](function(_0x4b2110){_0xf69f45(_0x4b2110);});};AGIVertices[_0xcb66('0x10')][_0xcb66('0x4b')]=function(_0x146a06,_0x5cab77,_0x54e6c2){var _0x696bc1={'role':_0xcb66('0x4c')};_0x696bc1[_0x146a06]=this['channel']['callerid'];this[_0xcb66('0xe')]['agentPause'](_0x696bc1,_0x5cab77,this[_0xcb66('0xd')]['uniqueid'])[_0xcb66('0x15')](function(_0x26c39e){_0x54e6c2(null,_[_0xcb66('0x44')](_0x26c39e)?![]:!![]);})['catch'](function(_0x11c279){logger[_0xcb66('0x2f')](_0x11c279);_0x54e6c2(null,![]);});};AGIVertices['prototype'][_0xcb66('0x4d')]=function(_0x27e83c,_0x417c7e){var _0x1fd270={'role':_0xcb66('0x4c')};_0x1fd270[_0x27e83c]=this[_0xcb66('0xd')]['callerid'];this[_0xcb66('0xe')][_0xcb66('0x4d')](_0x1fd270)[_0xcb66('0x15')](function(_0x22438d){_0x417c7e(null,_[_0xcb66('0x44')](_0x22438d)?![]:!![]);})[_0xcb66('0x13')](function(_0x8913b0){logger[_0xcb66('0x2f')](_0x8913b0);_0x417c7e(null,![]);});};AGIVertices[_0xcb66('0x10')]['agentLogout']=function(_0x2cba8,_0x253ca3){var _0x25e648={'role':_0xcb66('0x4c')};_0x25e648[_0x2cba8]=this[_0xcb66('0xd')][_0xcb66('0x37')];this['rpc'][_0xcb66('0x4e')](_0x25e648)[_0xcb66('0x15')](function(_0x5c59e6){_0x253ca3(null,_[_0xcb66('0x44')](_0x5c59e6)?![]:!![]);})[_0xcb66('0x13')](function(_0x3a232f){logger[_0xcb66('0x2f')](_0x3a232f);_0x253ca3(null,![]);});};AGIVertices['prototype'][_0xcb66('0x4f')]=function(_0x33b739,_0x412eaa){var _0x5926ae={'role':_0xcb66('0x4c')};_0x5926ae[_0x33b739]=this[_0xcb66('0xd')][_0xcb66('0x37')];var _0x1462af=_0x33b739!=_0xcb66('0x50')?util[_0xcb66('0x27')]('%s/%s@from-sip/n',_0xcb66('0x51'),this[_0xcb66('0xd')][_0xcb66('0x37')]):undefined;this[_0xcb66('0xe')]['agentLogin'](_0x5926ae,_0x1462af)[_0xcb66('0x15')](function(_0x26c43c){_0x412eaa(null,_[_0xcb66('0x44')](_0x26c43c)?![]:!![]);})[_0xcb66('0x13')](function(_0x183381){logger[_0xcb66('0x2f')](_0x183381);_0x412eaa(null,![]);});};AGIVertices[_0xcb66('0x10')]['shellCommand']=function(_0x5b8f76,_0x1b7f2b){sh[_0xcb66('0x52')](_[_0xcb66('0x53')](_0x5b8f76),function(_0x43fb09,_0xaef77){var _0x11072c=_0xaef77['replace'](/(\r\n|\n|\r)/gm,'');_0x1b7f2b(null,_0x11072c);});};AGIVertices[_0xcb66('0x10')][_0xcb66('0x54')]=function(_0x19da1c,_0x534cf4){scripts[_0xcb66('0x54')](_0x19da1c[_0xcb66('0x55')],_0x19da1c['google_cloud_tts_text_type']||_0xcb66('0x56'),_0x19da1c[_0xcb66('0x56')],_0x19da1c[_0xcb66('0x57')]||_0xcb66('0x58'),_0x19da1c[_0xcb66('0x59')]||_0xcb66('0x5a'),_0x19da1c[_0xcb66('0x5b')]||_0xcb66('0x5c'))[_0xcb66('0x15')](function(_0x4277e1){_0x534cf4(null,_0x4277e1);})[_0xcb66('0x13')](function(_0x30faa6){_0x534cf4(_0x30faa6);});};AGIVertices[_0xcb66('0x10')][_0xcb66('0x5d')]=function(_0x4332f4,_0x39e86a){scripts[_0xcb66('0x5d')](_0x4332f4[_0xcb66('0x56')],_0x4332f4[_0xcb66('0x5e')]||'en',0x1)['then'](function(_0x1eebc5){_0x39e86a(null,_0x1eebc5);})['catch'](function(_0x14eada){_0x39e86a(_0x14eada);});};AGIVertices['prototype'][_0xcb66('0x5f')]=function(_0x2912c9,_0x42a71a){var _0x1a4cdb={'uri':_0x2912c9[_0xcb66('0x60')],'method':_0x2912c9[_0xcb66('0x61')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2912c9[_0xcb66('0x62')])===_0xcb66('0x63')&&parseInt(_0x2912c9[_0xcb66('0x62')])>=0x1?parseInt(_0x2912c9[_0xcb66('0x62')])*0x3e8:0x5*0x3e8};if(_[_0xcb66('0x64')]([_0xcb66('0x65'),_0xcb66('0x66')],_0x1a4cdb['method'][_0xcb66('0x67')]())){try{_0x1a4cdb[_0xcb66('0x68')]=_0x2912c9[_0xcb66('0x9')]?JSON['parse'](_0x2912c9[_0xcb66('0x9')]):{};}catch(_0x416e29){logger[_0xcb66('0x2f')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x416e29);}}try{_0x1a4cdb[_0xcb66('0x69')]=_0x2912c9[_0xcb66('0x6a')]?JSON[_0xcb66('0x6b')](_0x2912c9[_0xcb66('0x6a')]):{};}catch(_0x38a3c0){logger[_0xcb66('0x2f')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x38a3c0);}if(_0x2912c9[_0xcb66('0x6c')]){try{var _0x536ecf=require(_0x2912c9[_0xcb66('0x6c')])['sync'](this,_0x1a4cdb);_0x1a4cdb[_0xcb66('0x6d')]=Mustache['render'](_0x2912c9[_0xcb66('0x60')],_0x536ecf,{},['$$','$$']);if(_0x1a4cdb[_0xcb66('0x69')]){_0x1a4cdb[_0xcb66('0x69')]=JSON['parse'](Mustache[_0xcb66('0x6e')](JSON['stringify'](_0x1a4cdb[_0xcb66('0x69')]),_0x536ecf,{},['$$','$$']));}if(_0x1a4cdb[_0xcb66('0x68')]){_0x1a4cdb[_0xcb66('0x68')]=JSON[_0xcb66('0x6b')](Mustache[_0xcb66('0x6e')](JSON['stringify'](_0x1a4cdb[_0xcb66('0x68')]),_0x536ecf,{},['$$','$$']));}}catch(_0xfa72ee){logger[_0xcb66('0x2f')](_0xcb66('0x6f'),_0xfa72ee);}}rp(_0x1a4cdb)['then'](function(_0x19ac18){var _0x469b1f={'statusCode':_0x19ac18['statusCode']||0xc8,'statusMessage':_0x19ac18[_0xcb66('0x70')]||'OK','headers':_0x19ac18[_0xcb66('0x69')]||{},'body':_0x19ac18[_0xcb66('0x68')]||{}};_0x42a71a(null,_0x469b1f);})[_0xcb66('0x13')](function(_0x4be3e7){var _0x197eb8={'statusCode':_0x4be3e7[_0xcb66('0x71')]||0x1f4,'statusMessage':_0x4be3e7[_0xcb66('0x72')]||_0xcb66('0x73'),'headers':_0x4be3e7[_0xcb66('0x74')]['headers']||{},'body':_0x4be3e7[_0xcb66('0x74')][_0xcb66('0x68')]||{}};_0x42a71a(null,_0x197eb8);});};AGIVertices[_0xcb66('0x10')][_0xcb66('0x75')]=function(_0xb3a1e,_0xf7b62b){scripts[_0xcb66('0x75')](this['channel']['uniqueid'],_0xb3a1e['key'],_0xb3a1e[_0xcb66('0x56')],_0xb3a1e[_0xcb66('0x76')]||'en')['then'](function(_0x1722c6){_0xf7b62b(null,_0x1722c6);})['catch'](function(_0x3f3b1a){_0xf7b62b(_0x3f3b1a);});};AGIVertices[_0xcb66('0x10')][_0xcb66('0x77')]=function(_0x28987a,_0x4d45b2){scripts[_0xcb66('0x77')](this[_0xcb66('0xd')][_0xcb66('0x39')],_0x28987a[_0xcb66('0x78')],_0x28987a[_0xcb66('0x79')],_0x28987a['private_key'],_0x28987a['text'],_0x28987a[_0xcb66('0x7a')]||'en')['then'](function(_0x2b6166){_0x4d45b2(null,_0x2b6166);})[_0xcb66('0x13')](function(_0x3c36d2){_0x4d45b2(_0x3c36d2);});};AGIVertices[_0xcb66('0x10')][_0xcb66('0x7b')]=function(_0x2a478c,_0x5f0b8d){scripts[_0xcb66('0x7b')](this['channel'],_0x2a478c)[_0xcb66('0x15')](function(_0x3c3ec3){_0x5f0b8d(null,_0x3c3ec3);})[_0xcb66('0x13')](function(_0x23b942){_0x5f0b8d(_0x23b942);});};AGIVertices[_0xcb66('0x10')][_0xcb66('0x7c')]=function(_0x5763c7,_0x137a66){scripts[_0xcb66('0x7c')](_0x5763c7[_0xcb66('0x7d')],_0x5763c7[_0xcb66('0x56')],_0x5763c7[_0xcb66('0x7e')]||_0xcb66('0x58'),_0x5763c7[_0xcb66('0x7f')])[_0xcb66('0x15')](function(_0x56e3ef){_0x137a66(null,_0x56e3ef);})['catch'](function(_0x25c9da){_0x137a66(_0x25c9da);});};AGIVertices[_0xcb66('0x10')]['ispeechASR']=function(_0xa876b8,_0x33490d,_0x5e6799){scripts[_0xcb66('0x80')](_0x33490d,_0xa876b8['key'],_0xa876b8[_0xcb66('0x81')]||_0xcb66('0x58'),this[_0xcb66('0x82')](_0xa876b8[_0xcb66('0x83')])?_0xa876b8[_0xcb66('0x83')]:undefined)['then'](function(_0x5d512f){_0x5e6799(null,_0x5d512f);})[_0xcb66('0x13')](function(_0x3c0cb6){_0x5e6799(_0x3c0cb6);});};AGIVertices[_0xcb66('0x10')][_0xcb66('0x84')]=function(_0x3731c5,_0x4d50b1){scripts[_0xcb66('0x84')](_0x3731c5['aws_access_key_id'],_0x3731c5['aws_secret_access_key'],_0x3731c5[_0xcb66('0x85')],_0x3731c5['aws_polly_voice']||'Amy',_0x3731c5[_0xcb66('0x56')],_0x3731c5[_0xcb66('0x86')]||'text')[_0xcb66('0x15')](function(_0x134589){_0x4d50b1(null,_0x134589);})[_0xcb66('0x13')](function(_0x3acdeb){_0x4d50b1(_0x3acdeb);});};AGIVertices[_0xcb66('0x10')][_0xcb66('0x87')]=function(_0x1e21db,_0x3cb320){scripts[_0xcb66('0x87')](this[_0xcb66('0xd')][_0xcb66('0x39')],_0x1e21db['aws_access_key_id'],_0x1e21db['aws_secret_access_key'],_0x1e21db[_0xcb66('0x88')],_0x1e21db[_0xcb66('0x56')],_0x1e21db[_0xcb66('0x89')])[_0xcb66('0x15')](function(_0x16f499){_0x3cb320(null,_0x16f499);})[_0xcb66('0x13')](function(_0x16b420){_0x3cb320(_0x16b420);});};AGIVertices['prototype'][_0xcb66('0x8a')]=function(_0x49a473,_0x4f30c2,_0x590640){scripts[_0xcb66('0x8a')](_0x4f30c2,_0x49a473[_0xcb66('0x7d')],_0x49a473[_0xcb66('0x8b')]||'en-US')[_0xcb66('0x15')](function(_0x50a683){_0x590640(null,_0x50a683);})['catch'](function(_0x2c83df){_0x590640(_0x2c83df);});};AGIVertices[_0xcb66('0x10')][_0xcb66('0x8c')]=function(_0x395294,_0x2668f2,_0x5a10f9){scripts[_0xcb66('0x8c')](_0x2668f2,_0x395294[_0xcb66('0x8d')],_0x395294[_0xcb66('0x8e')],_0x395294[_0xcb66('0x6d')])[_0xcb66('0x15')](function(_0x113a9e){_0x5a10f9(null,_0x113a9e);})[_0xcb66('0x13')](function(_0x5d3772){_0x5a10f9(_0x5d3772);});};AGIVertices[_0xcb66('0x10')][_0xcb66('0x8f')]=function(_0x2f7a2a){var _0x56b9e7=_[_0xcb66('0x64')](verticesWithRetry,_0x2f7a2a[_0xcb66('0x35')])?_0x2f7a2a:_['clone'](_0x2f7a2a);for(var _0x7736a2 in _0x56b9e7){if(_0x56b9e7[_0xcb66('0x90')](_0x7736a2)){if(_0x56b9e7[_0x7736a2]&&_[_0xcb66('0x91')](_0x56b9e7[_0x7736a2])){if(_['includes'](recursiveMapAttributes,_0x7736a2)){_0x56b9e7[_0x7736a2]=this[_0xcb66('0x92')](_0x56b9e7[_0x7736a2]);}else{_0x56b9e7[_0x7736a2]=this[_0xcb66('0x93')](_0x56b9e7[_0x7736a2]);}}}}return _0x56b9e7;};AGIVertices[_0xcb66('0x10')][_0xcb66('0x94')]=function(_0x25f06c){for(var _0x5b2e1d in _0x25f06c){if(_0x25f06c[_0xcb66('0x90')](_0x5b2e1d)){if(_[_0xcb66('0x95')](_0x25f06c[_0x5b2e1d])){this[_0xcb66('0x94')](_0x25f06c[_0x5b2e1d]);}else if(_[_0xcb66('0x96')](_0x25f06c[_0x5b2e1d])){for(var _0x276be1=0x0;_0x276be1<_0x25f06c[_0x5b2e1d][_0xcb66('0x97')];_0x276be1++){this['recursiveNodeIndex'](_0x25f06c[_0x5b2e1d][_0x276be1]);}}else if(_['isString'](_0x25f06c[_0x5b2e1d])){_0x25f06c[_0x5b2e1d]=this[_0xcb66('0x93')](_0x25f06c[_0x5b2e1d]);}}}};AGIVertices[_0xcb66('0x10')][_0xcb66('0x98')]=function(_0x38b12c,_0x3bd0d7){for(var _0x42f38b in _0x38b12c){if(_0x38b12c['hasOwnProperty'](_0x42f38b)){if(_[_0xcb66('0x95')](_0x38b12c[_0x42f38b])){if(!_[_0xcb66('0x40')](_0x38b12c[_0x42f38b])){this[_0xcb66('0x98')](_0x38b12c[_0x42f38b],util[_0xcb66('0x27')](_0xcb66('0x99'),_0x3bd0d7,_0x42f38b));}}else if(_[_0xcb66('0x96')](_0x38b12c[_0x42f38b])){for(var _0x3135e7=0x0;_0x3135e7<_0x38b12c[_0x42f38b]['length'];_0x3135e7++){this[_0xcb66('0x98')](_0x38b12c[_0x42f38b][_0x3135e7],util[_0xcb66('0x27')](_0xcb66('0x99'),_0x3bd0d7,_0x42f38b+'['+_0x3135e7+']'));}}else{if(!_['isNil'](_0x38b12c[_0x42f38b])){this[_0xcb66('0xd')][_0xcb66('0x9a')](util['format']('%s.%s',_0x3bd0d7,_0x42f38b),_0x38b12c[_0x42f38b]);}}}}};AGIVertices[_0xcb66('0x10')][_0xcb66('0x92')]=function(_0x285b9c){try{var _0x51247a=JSON['parse'](_0x285b9c);this[_0xcb66('0x94')](_0x51247a);return JSON['stringify'](_0x51247a);}catch(_0x5d701a){return this[_0xcb66('0x93')](_0x285b9c);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x2b6ed1){var _0x1dbf42=_0x2b6ed1[_0xcb66('0x9b')]('{');for(var _0xf66e40=0x1;_0xf66e40<_0x1dbf42[_0xcb66('0x97')];_0xf66e40+=0x1){var _0x405765=_0x1dbf42[_0xf66e40][_0xcb66('0x9b')]('}');if(_0x405765[_0xcb66('0x97')]>0x1){_0x2b6ed1=_0x2b6ed1['replaceAll']('{'+_0x405765[0x0]+'}',this[_0xcb66('0xd')][_0xcb66('0x9c')](_0x405765[0x0])[_0xcb66('0x9d')]||_0x405765[0x0]);}}if(_0x1dbf42[_0xcb66('0x97')]===0x1){return _0x2b6ed1[_0xcb66('0x9e')]();}return this[_0xcb66('0x93')](_0x2b6ed1);};AGIVertices[_0xcb66('0x10')][_0xcb66('0x9f')]=function(_0x1a3ba8,_0x39fc6b){var _0x3e0c2c=this[_0xcb66('0xd')]['getVariable'](_0x1a3ba8);if(_0x3e0c2c[_0xcb66('0xa0')]===-0x1){return _0x3e0c2c;}logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0xa1'),_0x39fc6b,_0x3e0c2c[_0xcb66('0x9d')]));return this[_0xcb66('0xd')]['setVariable'](_0x39fc6b,_0x3e0c2c['extra']);};AGIVertices['prototype'][_0xcb66('0x82')]=function(_0x5ab121){return _0x5ab121&&_0x5ab121!=='0'&&_0x5ab121!=='-1'&&_0x5ab121!=='';};AGIVertices['prototype'][_0xcb66('0xa2')]=function(_0x135046){this[_0xcb66('0x34')][_0xcb66('0xa3')](this,_0x135046,'-');_0x135046[_0xcb66('0xa4')]=_0x135046[_0xcb66('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xcb66('0x10')][_0xcb66('0xa5')]=function(_0x56135d){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0xa6'),_0x56135d[_0xcb66('0xa7')]));if(!this[_0xcb66('0x82')](_0x56135d[_0xcb66('0x56')])){return this[_0xcb66('0xd')][_0xcb66('0xa8')]('no\x20text\x20configured');}var _0x42e664='\x22'+_0x56135d[_0xcb66('0x56')]+'\x22';if(this[_0xcb66('0x82')](_0x56135d[_0xcb66('0x74')])){_0x42e664+=','+_0x56135d[_0xcb66('0x74')];}var _0x62477d=this[_0xcb66('0xd')][_0xcb66('0x52')](_0xcb66('0xa9'),_0x42e664);if(_0x62477d['result']===-0x1){return _0x62477d;}return this[_0xcb66('0xd')][_0xcb66('0xa8')](util['format'](_0xcb66('0xaa'),_0x42e664));};AGIVertices[_0xcb66('0x10')][_0xcb66('0xab')]=function(_0x40ab09){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0xac'),_0x40ab09['label']));if(!this[_0xcb66('0x82')](_0x40ab09['grammar'])){return this['channel']['noop'](_0xcb66('0xad'));}var _0x3cd531=_0x40ab09[_0xcb66('0xae')];if(this[_0xcb66('0x82')](_0x40ab09[_0xcb66('0x74')])){_0x3cd531+=','+_0x40ab09[_0xcb66('0x74')];}var _0x1664bc=this['channel'][_0xcb66('0x52')](_0xcb66('0xaf'),_0x3cd531);if(_0x1664bc[_0xcb66('0xa0')]===-0x1){return _0x1664bc;}var _0x1cb179=this['getAndSetVariable'](_0xcb66('0xb0'),'MRCP_RECOG_CONFIDENCE');if(_0x1cb179['result']===-0x1){return _0x1cb179;}var _0x3dbff2=this[_0xcb66('0x9f')]('RECOG_INPUT()',_0xcb66('0xb1'));if(_0x3dbff2[_0xcb66('0xa0')]===-0x1){return _0x3dbff2;}var _0xf4a5bf=this[_0xcb66('0x9f')]('RECOG_INSTANCE()',_0xcb66('0xb2'));if(_0xf4a5bf[_0xcb66('0xa0')]===-0x1){return _0xf4a5bf;}return this[_0xcb66('0xd')][_0xcb66('0xa8')](util['format'](_0xcb66('0xb3'),_0x3cd531));};AGIVertices['prototype'][_0xcb66('0x6')]=function(_0x311e56){logger['info'](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x311e56[_0xcb66('0xa7')]));return this[_0xcb66('0xd')]['agi']([_0x311e56[_0xcb66('0xb4')],_0x311e56[_0xcb66('0xb5')]]);};AGIVertices['prototype'][_0xcb66('0xb6')]=function(_0x2b1f71){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0xb7'),_0x2b1f71[_0xcb66('0xa7')]));if(this[_0xcb66('0x82')](_0x2b1f71[_0xcb66('0x62')])){logger['info'](util[_0xcb66('0x27')](_0xcb66('0xb8'),_0x2b1f71[_0xcb66('0x62')]));var _0x22ed1d=this[_0xcb66('0xd')][_0xcb66('0xb9')](_0x2b1f71[_0xcb66('0x62')]);if(_0x22ed1d['result']===-0x1){return _0x22ed1d;}}return this[_0xcb66('0xd')][_0xcb66('0xb6')]();};AGIVertices[_0xcb66('0x10')][_0xcb66('0x47')]=function(_0x5e7a5a){logger['info'](util[_0xcb66('0x27')](_0xcb66('0xba'),_0x5e7a5a[_0xcb66('0xa7')]));if(!this[_0xcb66('0x82')](_0x5e7a5a[_0xcb66('0x46')])){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x5e7a5a,_0xcb66('0xbb'));}_0x5e7a5a[_0xcb66('0xbc')]=moment();if(this[_0xcb66('0x82')](_0x5e7a5a[_0xcb66('0xbd')])){_0x5e7a5a[_0xcb66('0xbc')]=moment()['add'](_0x5e7a5a['delay'],'minutes');}if(!this[_0xcb66('0x82')](_0x5e7a5a[_0xcb66('0x49')])){_0x5e7a5a[_0xcb66('0x49')]=0x2;}this['createCmContact'][_0xcb66('0xa3')](this,_0x5e7a5a);return this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x5e7a5a['phone'],_0x5e7a5a[_0xcb66('0x46')],_0x5e7a5a['scheduledAt']));};AGIVertices[_0xcb66('0x10')][_0xcb66('0xbe')]=function(_0x36f067){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0xbf'),_0x36f067[_0xcb66('0xa7')]));var _0x4b03cc=this[_0xcb66('0xd')][_0xcb66('0x52')](_0x36f067[_0xcb66('0xc0')],_0x36f067[_0xcb66('0x74')]);if(_0x4b03cc['result']===-0x1){return _0x4b03cc;}return this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0xc1'),_0x36f067[_0xcb66('0xc0')],_0x36f067[_0xcb66('0x74')]));};AGIVertices[_0xcb66('0x10')][_0xcb66('0xc2')]=function(_0x166f62){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x166f62[_0xcb66('0xa7')]));if(!this[_0xcb66('0x82')](_0x166f62[_0xcb66('0x56')])){return this[_0xcb66('0xd')][_0xcb66('0xa8')](_0xcb66('0xc3'));}var _0x58b6db='\x22'+_0x166f62[_0xcb66('0x56')]+'\x22';if(this[_0xcb66('0x82')](_0x166f62['options'])){_0x58b6db+=','+_0x166f62[_0xcb66('0x74')];}var _0x2869c9=this[_0xcb66('0xd')]['exec']('MRCPSynth',_0x58b6db);if(_0x2869c9[_0xcb66('0xa0')]===-0x1){return _0x2869c9;}return this[_0xcb66('0xd')]['noop'](util[_0xcb66('0x27')](_0xcb66('0xaa'),_0x58b6db));};AGIVertices['prototype'][_0xcb66('0xc4')]=function(_0x90c525){logger['info'](util[_0xcb66('0x27')](_0xcb66('0xc5'),_0x90c525['label']));if(!this[_0xcb66('0x82')](_0x90c525['text'])){return this[_0xcb66('0xd')][_0xcb66('0xa8')](_0xcb66('0xc3'));}var _0x46eb02='\x22'+_0x90c525['text']+'\x22';if(this[_0xcb66('0x82')](_0x90c525['options'])){_0x46eb02+=','+_0x90c525[_0xcb66('0x74')];}var _0x31772e=this['channel'][_0xcb66('0x52')](_0xcb66('0xa9'),_0x46eb02);if(_0x31772e[_0xcb66('0xa0')]===-0x1){return _0x31772e;}return this['channel'][_0xcb66('0xa8')](util[_0xcb66('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x46eb02));};AGIVertices[_0xcb66('0x10')][_0xcb66('0xc6')]=function(_0x26359b){logger['info'](util[_0xcb66('0x27')](_0xcb66('0xc7'),_0x26359b['label']));if(!this[_0xcb66('0x82')](_0x26359b[_0xcb66('0xae')])){return this[_0xcb66('0xd')][_0xcb66('0xa8')](_0xcb66('0xad'));}var _0x422855=_0x26359b[_0xcb66('0xae')];if(this[_0xcb66('0x82')](_0x26359b[_0xcb66('0x74')])){_0x422855+=','+_0x26359b[_0xcb66('0x74')];}var _0x45797c=this[_0xcb66('0xd')][_0xcb66('0x52')]('MRCPRecog',_0x422855);if(_0x45797c[_0xcb66('0xa0')]===-0x1){return _0x45797c;}var _0x2c1c5e=this[_0xcb66('0x9f')]('RECOG_CONFIDENCE()',_0xcb66('0xc8'));if(_0x2c1c5e['result']===-0x1){return _0x2c1c5e;}var _0x3a67eb=this[_0xcb66('0x9f')](_0xcb66('0xc9'),_0xcb66('0xca'));if(_0x3a67eb[_0xcb66('0xa0')]===-0x1){return _0x3a67eb;}var _0xc0a30e=this[_0xcb66('0x9f')](_0xcb66('0xcb'),_0xcb66('0xcc'));if(_0xc0a30e[_0xcb66('0xa0')]===-0x1){return _0xc0a30e;}return this['channel'][_0xcb66('0xa8')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x422855));};AGIVertices[_0xcb66('0x10')][_0xcb66('0xcd')]=function(_0x8d83eb){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0xce'),_0x8d83eb[_0xcb66('0xa7')]));if(!this['isConfigured'](_0x8d83eb[_0xcb66('0xae')])){return this[_0xcb66('0xd')][_0xcb66('0xa8')](_0xcb66('0xad'));}var _0x3752fe=_0x8d83eb[_0xcb66('0xae')];if(this[_0xcb66('0x82')](_0x8d83eb[_0xcb66('0x74')])){_0x3752fe+=','+_0x8d83eb['options'];}var _0x2245ef=this[_0xcb66('0xd')][_0xcb66('0x52')](_0xcb66('0xaf'),_0x3752fe);if(_0x2245ef['result']===-0x1){return _0x2245ef;}var _0xe4a247=this['getAndSetVariable'](_0xcb66('0xb0'),_0xcb66('0xcf'));if(_0xe4a247['result']===-0x1){return _0xe4a247;}var _0x38de32=this[_0xcb66('0x9f')](_0xcb66('0xc9'),_0xcb66('0xd0'));if(_0x38de32[_0xcb66('0xa0')]===-0x1){return _0x38de32;}var _0x743338=this[_0xcb66('0x9f')](_0xcb66('0xcb'),_0xcb66('0xd1'));if(_0x743338[_0xcb66('0xa0')]===-0x1){return _0x743338;}return this[_0xcb66('0xd')]['noop'](util[_0xcb66('0x27')](_0xcb66('0xb3'),_0x3752fe));};AGIVertices['prototype'][_0xcb66('0xd2')]=function(_0x203bcf){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0xd3'),_0x203bcf[_0xcb66('0xa7')]));if(!this['isConfigured'](_0x203bcf['odbc_id'])){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x203bcf,_0xcb66('0xd4'));}var _0x46ae54=this[_0xcb66('0xd5')][_0xcb66('0xa3')](this,_0x203bcf[_0xcb66('0xd6')]);if(!_0x46ae54){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x203bcf,_0xcb66('0xd7'));}if(!this[_0xcb66('0x82')](_0x203bcf[_0xcb66('0x2d')])){return this[_0xcb66('0xd')]['error'](_0x203bcf,_0xcb66('0xd8'));}var _0x1ee052=_0x203bcf[_0xcb66('0x2d')][_0xcb66('0xd9')](/(\r\n|\n|\r)/gm,'\x20');this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0xda'),_0x1ee052));var _0x37addb=this['getQueryOdbc'][_0xcb66('0xa3')](this,_0x46ae54,_0x1ee052);this[_0xcb66('0x34')][_0xcb66('0xa3')](this,_0x203bcf,_0x1ee052);if(!this[_0xcb66('0x82')](_0x203bcf[_0xcb66('0xdb')])){return this['channel'][_0xcb66('0xa8')](_0xcb66('0xdc'));}var _0x3b8d55=this['getVariable'][_0xcb66('0xa3')](this,_0x203bcf[_0xcb66('0xdb')]);if(!_0x3b8d55){return this['channel'][_0xcb66('0x2f')](_0x203bcf,'no\x20variable\x20found');}var _0x2f55e6=this;_0x37addb[_0xcb66('0xdd')](function(_0x5d4f3c,_0x1c8e78){Object['keys'](_0x5d4f3c)[_0xcb66('0xdd')](function(_0x2de3fa){_0x2f55e6[_0xcb66('0xd')][_0xcb66('0x9a')](util[_0xcb66('0x27')](_0xcb66('0xde'),_0x3b8d55,_0x1c8e78,_0x2de3fa),_0x5d4f3c[_0x2de3fa]);});});this[_0xcb66('0xd')]['setVariable'](util['format'](_0xcb66('0xdf'),_0x3b8d55),_0x37addb['length']);return this['channel'][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0xe0'),_0x3b8d55));};AGIVertices[_0xcb66('0x10')]['dial']=function(_0x209219){logger[_0xcb66('0xe1')](util[_0xcb66('0x27')](_0xcb66('0xe2'),_0x209219['label']));if(!this[_0xcb66('0x82')](_0x209219[_0xcb66('0xe3')])){return this[_0xcb66('0xd')]['error'](_0x209219,_0xcb66('0xe4'));}var _0x25d937=this[_0xcb66('0x18')][_0xcb66('0xa3')](this,_0x209219[_0xcb66('0xe3')]);if(!_0x25d937){return this[_0xcb66('0xd')]['error'](_0x209219,_0xcb66('0xe5'));}var _0x1895f2=this[_0xcb66('0xd')][_0xcb66('0x52')](_0xcb66('0xe6'),[util[_0xcb66('0x27')](_0xcb66('0xe7'),_0x25d937),_0x209219[_0xcb66('0x62')],_0x209219['opts'],_0x209219['url']]);if(_0x1895f2[_0xcb66('0xa0')]===-0x1){return _0x1895f2;}return this[_0xcb66('0xd')]['noop'](util[_0xcb66('0x27')](_0xcb66('0xe8'),_0xcb66('0xe6')));};AGIVertices['prototype']['dialogflow']=function(_0x452dfa){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0xe9'),_0x452dfa['label']));if(!this['isConfigured'](_0x452dfa['key'])){return this[_0xcb66('0xd')][_0xcb66('0xa8')](_0xcb66('0xea'));}if(!this[_0xcb66('0x82')](_0x452dfa[_0xcb66('0x56')])){return this[_0xcb66('0xd')][_0xcb66('0xa8')](_0xcb66('0xc3'));}this['channel'][_0xcb66('0xeb')]=!![];this[_0xcb66('0x34')](_0x452dfa);this['createSquareMessage'](_0x452dfa[_0xcb66('0x56')],'in','','');this['channel'][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0xec'),_0x452dfa[_0xcb66('0x56')]));var _0x2b951b=this['googleDialogflow'][_0xcb66('0xa3')](this,_0x452dfa);if(_0x2b951b){for(var _0x3ec59e in _0x2b951b){if(_0x2b951b[_0xcb66('0x90')](_0x3ec59e)){this[_0xcb66('0xd')]['setVariable'](util[_0xcb66('0x27')](_0xcb66('0xed'),_0x3ec59e[_0xcb66('0x67')]()),_0x2b951b[_0x3ec59e]);}}this[_0xcb66('0x3e')](_0x2b951b['speech'],_0xcb66('0xee'),_0xcb66('0xef'),'');return this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0xf0'),_0x2b951b['speech']));}return this[_0xcb66('0xd')]['error'](_0x452dfa,_0xcb66('0xf1'));};AGIVertices[_0xcb66('0x10')][_0xcb66('0xf2')]=function(_0x3ddf49){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0xf3'),_0x3ddf49[_0xcb66('0xa7')]));if(!this[_0xcb66('0x82')](_0x3ddf49[_0xcb66('0x78')])){return this[_0xcb66('0xd')][_0xcb66('0xa8')](_0xcb66('0xf4'));}if(!this[_0xcb66('0x82')](_0x3ddf49[_0xcb66('0x79')])){return this['channel']['noop']('no\x20client_email\x20configured');}if(!this[_0xcb66('0x82')](_0x3ddf49['private_key'])){return this[_0xcb66('0xd')][_0xcb66('0xa8')](_0xcb66('0xf5'));}if(!this[_0xcb66('0x82')](_0x3ddf49[_0xcb66('0x7a')])){return this[_0xcb66('0xd')]['noop'](_0xcb66('0xf6'));}if(!this[_0xcb66('0x82')](_0x3ddf49['text'])){return this[_0xcb66('0xd')]['noop']('no\x20text\x20configured');}this['channel'][_0xcb66('0xeb')]=!![];this[_0xcb66('0x34')](_0x3ddf49);this[_0xcb66('0x3e')](_0x3ddf49[_0xcb66('0x56')],'in','','');this[_0xcb66('0xd')]['noop'](util[_0xcb66('0x27')](_0xcb66('0xf7'),_0x3ddf49[_0xcb66('0x56')]));var _0x5a54bd=this[_0xcb66('0x77')][_0xcb66('0xa3')](this,_0x3ddf49);if(_0x5a54bd){for(var _0x272e99 in _0x5a54bd){if(_0x5a54bd['hasOwnProperty'](_0x272e99)){if(_0x272e99!==_0xcb66('0xf8')){this[_0xcb66('0xd')][_0xcb66('0x9a')](util[_0xcb66('0x27')](_0xcb66('0xed'),_0x272e99[_0xcb66('0x67')]()),_0x5a54bd[_0x272e99]);}}}this[_0xcb66('0x3e')](_0x5a54bd[_0xcb66('0xf9')],'out',_0xcb66('0xf2'),_0x5a54bd[_0xcb66('0xf8')]);return this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0xfa'),_0x5a54bd['speech']));}return this[_0xcb66('0xd')]['error'](_0x3ddf49,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xcb66('0x10')][_0xcb66('0xfb')]=function(_0x205dc5){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0xfc'),_0x205dc5[_0xcb66('0xa7')]));if(!this[_0xcb66('0x82')](_0x205dc5['ndauth_url'])){return this[_0xcb66('0xd')][_0xcb66('0xa8')](_0xcb66('0xfd'));}if(!this[_0xcb66('0x82')](_0x205dc5[_0xcb66('0xfe')])){return this[_0xcb66('0xd')][_0xcb66('0xa8')]('no\x20username\x20configured');}if(!this[_0xcb66('0x82')](_0x205dc5[_0xcb66('0xff')])){return this['channel'][_0xcb66('0xa8')](_0xcb66('0x100'));}if(!this[_0xcb66('0x82')](_0x205dc5[_0xcb66('0x101')])){return this['channel'][_0xcb66('0xa8')]('no\x20text\x20configured');}this[_0xcb66('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x205dc5);this[_0xcb66('0x3e')](_0x205dc5[_0xcb66('0x56')],'in','','');this['channel'][_0xcb66('0xa8')](util['format'](_0xcb66('0x102'),_0x205dc5[_0xcb66('0x56')]));var _0x5c5b35=this[_0xcb66('0x7b')][_0xcb66('0xa3')](this,_0x205dc5);if(_0x5c5b35){for(var _0x5b1110 in _0x5c5b35){if(_0x5c5b35[_0xcb66('0x90')](_0x5b1110)){this[_0xcb66('0xd')][_0xcb66('0x9a')](util[_0xcb66('0x27')]('SESTEK_NDA_%s',_0x5b1110[_0xcb66('0x67')]()),_0x5c5b35[_0x5b1110]);}}this['createSquareMessage'](_0x5c5b35[_0xcb66('0xf9')],_0xcb66('0xee'),'sesteknda','');if(_0x5c5b35[_0xcb66('0x103')]){this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x5c5b35['audiofile']));var _0x271776=this[_0xcb66('0xd')][_0xcb66('0x104')](_0x5c5b35[_0xcb66('0x103')]);try{fs[_0xcb66('0x105')](_0x5c5b35[_0xcb66('0x103')]+_0xcb66('0x106'));}catch(_0xe7310f){logger[_0xcb66('0x2f')](_0xe7310f);}return _0x271776;}else{return this['channel']['noop'](util[_0xcb66('0x27')]('SestekNDA\x20Result\x20%s',_0x5c5b35[_0xcb66('0xf9')]));}}return this[_0xcb66('0xd')]['error'](_0x205dc5,_0xcb66('0x107'));};AGIVertices[_0xcb66('0x10')]['end']=function(_0x28fdb5){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x108'),_0x28fdb5[_0xcb66('0xa7')]));return this[_0xcb66('0xd')][_0xcb66('0xa8')]('end');};AGIVertices[_0xcb66('0x10')][_0xcb66('0x109')]=function(_0x413772){logger['info'](util['format'](_0xcb66('0x10a'),_0x413772['label']));var _0x2aab13='';if(_0x413772[_0xcb66('0x10b')]){if(!this[_0xcb66('0x82')](_0x413772['trunk_id'])){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x413772,'no\x20trunk\x20selected');}else{var _0x388047=parseInt(_0x413772[_0xcb66('0x10b')],0xa);if(isNaN(_0x388047)){_0x2aab13=_0x413772['trunk_id'];}else{_0x2aab13=this[_0xcb66('0x10c')][_0xcb66('0xa3')](this,_0x413772[_0xcb66('0x10b')]);if(!_0x2aab13){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x413772,_0xcb66('0x10d'));}}}}else if(_0x413772[_0xcb66('0x10e')]){_0x2aab13=_0x413772[_0xcb66('0x10e')];}else{return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x413772,'no\x20trunk\x20selected');}var _0x4266f5=this[_0xcb66('0xd')][_0xcb66('0x52')]('DIAL',[util[_0xcb66('0x27')](_0xcb66('0x10f'),_0x2aab13,_0x413772[_0xcb66('0x45')]),_0x413772['timeout'],_0x413772[_0xcb66('0x110')],_0x413772[_0xcb66('0x60')]]);if(_0x4266f5[_0xcb66('0xa0')]===-0x1){return _0x4266f5;}return this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')]('Executed\x20command\x20%s',_0xcb66('0xe6')));};AGIVertices[_0xcb66('0x10')]['finally']=function(_0x49ccd2){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x111'),_0x49ccd2[_0xcb66('0xa7')]));return this[_0xcb66('0xd')][_0xcb66('0xa8')]('finally');};AGIVertices[_0xcb66('0x10')][_0xcb66('0xb')]=function(_0x5b66c4){logger[_0xcb66('0x2b')](util['format']('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x5b66c4[_0xcb66('0xa7')]));if(_0x5b66c4[_0xcb66('0xa4')]===0x0){return this[_0xcb66('0xa2')](_0x5b66c4);}_0x5b66c4[_0xcb66('0xa4')]-=0x1;if(!this[_0xcb66('0x82')](_0x5b66c4[_0xcb66('0x112')])){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x5b66c4,_0xcb66('0x113'));}var _0x308447=this[_0xcb66('0x1b')]['sync'](this,_0x5b66c4[_0xcb66('0x112')]);if(!_0x308447){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x5b66c4,_0xcb66('0x114'));}if(!this[_0xcb66('0x82')](_0x5b66c4[_0xcb66('0xdb')])){return this[_0xcb66('0xd')][_0xcb66('0x2f')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2f7a36=this[_0xcb66('0xd')][_0xcb66('0x115')](_0x308447,_0x5b66c4[_0xcb66('0x116')],_0x5b66c4['maxdigit']);var _0x1b800e=_0x2f7a36[_0xcb66('0xa0')]?_0x2f7a36[_0xcb66('0xa0')][_0xcb66('0x9e')]():'';logger[_0xcb66('0x2b')]('test',JSON['stringify'](_0x2f7a36));if(_0x2f7a36['result']===-0x1){this[_0xcb66('0x34')][_0xcb66('0xa3')](this,_0x5b66c4,_0x1b800e);return _0x2f7a36;}else if(_0x2f7a36[_0xcb66('0x9d')]===_0xcb66('0x62')){_0x2f7a36[_0xcb66('0xa0')]=_0x1b800e[_0xcb66('0x97')]>=parseInt(_0x5b66c4[_0xcb66('0x117')])?'x':'i';}else{_0x2f7a36[_0xcb66('0xa0')]=_0x1b800e['length']>=parseInt(_0x5b66c4['mindigit'])&&_0x1b800e[_0xcb66('0x97')]<=parseInt(_0x5b66c4[_0xcb66('0x118')])?'x':'i';}var _0x223781=this[_0xcb66('0x9c')][_0xcb66('0xa3')](this,_0x5b66c4[_0xcb66('0xdb')]);if(!_0x223781){return this[_0xcb66('0xd')]['error'](_0x5b66c4,'no\x20variable\x20found');}this[_0xcb66('0xd')][_0xcb66('0x9a')](_0x223781,_0x1b800e);if(this[_0xcb66('0x82')](_0x5b66c4[_0xcb66('0x119')])){var _0x6fdb45=parseInt(_0x5b66c4[_0xcb66('0x119')],0xa);var _0x23e190=rs['generate']({'charset':'*','length':_0x6fdb45});var _0x499e54=_0x1b800e[_0xcb66('0x97')];if(_0x499e54>0x0){if(_0x499e54>_0x6fdb45){this[_0xcb66('0x34')][_0xcb66('0xa3')](this,_0x5b66c4,_0x5b66c4[_0xcb66('0x11a')]==='first'?_0x23e190+_0x1b800e[_0xcb66('0x11b')](_0x6fdb45):_0x1b800e['substr'](0x0,_0x499e54-_0x6fdb45)+_0x23e190);}else{this[_0xcb66('0x34')][_0xcb66('0xa3')](this,_0x5b66c4,rs[_0xcb66('0x11c')]({'charset':'*','length':_0x499e54}));}}else{this[_0xcb66('0x34')][_0xcb66('0xa3')](this,_0x5b66c4,'');}}else{this[_0xcb66('0x34')]['sync'](this,_0x5b66c4,_0x1b800e);}return _0x2f7a36;};AGIVertices[_0xcb66('0x10')][_0xcb66('0xc')]=function(_0x103f37){logger[_0xcb66('0x2b')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x103f37[_0xcb66('0xa7')]));return this[_0xcb66('0xb')](_0x103f37);};AGIVertices['prototype'][_0xcb66('0x11d')]=function(_0x6f8055){logger['info'](util['format'](_0xcb66('0x11e'),_0x6f8055[_0xcb66('0xa7')]));this['createSquareDetailsReport'][_0xcb66('0xa3')](this,_0x6f8055,_0x6f8055[_0xcb66('0x11f')]);return this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0x120'),_0x6f8055[_0xcb66('0x11f')]));};AGIVertices[_0xcb66('0x10')][_0xcb66('0x121')]=function(_0xad3910){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x122'),_0xad3910[_0xcb66('0xa7')]));if(!this[_0xcb66('0x82')](_0xad3910[_0xcb66('0x123')])||!this['isConfigured'](_0xad3910['aws_secret_access_key'])){return this['channel']['noop'](_0xcb66('0x124'));}if(!this[_0xcb66('0x82')](_0xad3910[_0xcb66('0x56')])){return this['channel'][_0xcb66('0xa8')](_0xcb66('0xc3'));}this[_0xcb66('0xd')][_0xcb66('0xa8')](util['format'](_0xcb66('0x125'),_0xad3910[_0xcb66('0x56')]));var _0x45eae5=this[_0xcb66('0x84')]['sync'](this,_0xad3910);if(_0x45eae5){this['channel'][_0xcb66('0xa8')](util['format'](_0xcb66('0x126'),_0x45eae5));var _0x454967=this[_0xcb66('0xd')]['streamFile'](_0x45eae5);try{fs[_0xcb66('0x105')](_0x45eae5+'.wav');}catch(_0x24832c){logger[_0xcb66('0x2f')](_0x24832c);}return _0x454967;}return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0xad3910,_0xcb66('0x127'));};AGIVertices[_0xcb66('0x10')][_0xcb66('0x128')]=function(_0x55e321){logger['info'](util[_0xcb66('0x27')](_0xcb66('0x129'),_0x55e321[_0xcb66('0xa7')]));if(!this['isConfigured'](_0x55e321[_0xcb66('0x123')])||!this[_0xcb66('0x82')](_0x55e321[_0xcb66('0x12a')])){return this[_0xcb66('0xd')][_0xcb66('0xa8')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x55e321['aws_bot_name'])){return this[_0xcb66('0xd')]['noop'](_0xcb66('0x12b'));}if(!this[_0xcb66('0x82')](_0x55e321[_0xcb66('0x56')])){return this[_0xcb66('0xd')][_0xcb66('0xa8')](_0xcb66('0xc3'));}this[_0xcb66('0xd')][_0xcb66('0xeb')]=!![];this[_0xcb66('0x34')](_0x55e321);this[_0xcb66('0x3e')](_0x55e321[_0xcb66('0x56')],'in','','');this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0x12c'),_0x55e321[_0xcb66('0x56')]));var _0x3a84b0=this[_0xcb66('0x87')][_0xcb66('0xa3')](this,_0x55e321);if(_0x3a84b0){for(var _0x30c2b9 in _0x3a84b0){if(_0x3a84b0[_0xcb66('0x90')](_0x30c2b9)&&_['isString'](_0x3a84b0[_0x30c2b9])){this['channel'][_0xcb66('0x9a')](util[_0xcb66('0x27')](_0xcb66('0x12d'),_0x30c2b9[_0xcb66('0x67')]()),_0x3a84b0[_0x30c2b9]);}}if(_[_0xcb66('0x44')](_0x3a84b0['message'])){return this[_0xcb66('0xd')][_0xcb66('0xa8')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xcb66('0x3e')](_0x3a84b0[_0xcb66('0x72')],_0xcb66('0xee'),_0xcb66('0x12e'),'');return this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0x12f'),_0x3a84b0[_0xcb66('0x72')]));}}return this['channel']['error'](_0x55e321,_0xcb66('0x130'));};AGIVertices['prototype'][_0xcb66('0x131')]=function(_0x234bf5){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x132'),_0x234bf5[_0xcb66('0xa7')],_0x234bf5[_0xcb66('0x62')]));if(!this[_0xcb66('0x82')](_0x234bf5[_0xcb66('0x7d')])){return this[_0xcb66('0xd')][_0xcb66('0xa8')]('no\x20key\x20configured');}var _0x187f4f=_0xcb66('0x133');var _0x466e59=util['format']('%s/recordings/%s',FILES_PATH,rs[_0xcb66('0x11c')](0x4));var _0x3b0713=util[_0xcb66('0x27')](_0xcb66('0x99'),_0x466e59,_0x187f4f);var _0x4237ba=!![];if(_0x234bf5[_0xcb66('0x134')]==='NOBEEP'){_0x4237ba=![];}var _0x11b5f2=this['channel']['recordFile'](_0x466e59,_0x187f4f,_0x234bf5[_0xcb66('0x135')],_0x234bf5[_0xcb66('0x62')],undefined,_0x4237ba);if(_0x11b5f2[_0xcb66('0xa0')]!==-0x1){this['channel'][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0x136'),_0x3b0713));var _0x30e5fb=this[_0xcb66('0x8a')][_0xcb66('0xa3')](this,_0x234bf5,_0x3b0713);if(_0x30e5fb){for(var _0x585aba in _0x30e5fb){if(_0x30e5fb[_0xcb66('0x90')](_0x585aba)){this[_0xcb66('0xd')][_0xcb66('0x9a')](util[_0xcb66('0x27')](_0xcb66('0x137'),_0x585aba[_0xcb66('0x67')]()),_0x30e5fb[_0x585aba]);}}return this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0x138'),JSON[_0xcb66('0x139')](_0x30e5fb)));}}return _0x11b5f2;};AGIVertices[_0xcb66('0x10')]['tildeasr']=function(_0x1cece0){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x1cece0['label']));if(!this['isConfigured'](_0x1cece0[_0xcb66('0x8d')])){return this[_0xcb66('0xd')][_0xcb66('0xa8')](_0xcb66('0x13a'));}if(!this['isConfigured'](_0x1cece0[_0xcb66('0x8e')])){return this[_0xcb66('0xd')]['noop'](_0xcb66('0x13b'));}var _0x412515=_0xcb66('0x133');var _0x5e0001=util[_0xcb66('0x27')](_0xcb66('0x13c'),FILES_PATH,rs[_0xcb66('0x11c')](0x4));var _0x174aa6=util['format']('%s.%s',_0x5e0001,_0x412515);var _0x389aa3=!![];if(_0x1cece0[_0xcb66('0x134')]===_0xcb66('0x13d')){_0x389aa3=![];}var _0xcf8863=this[_0xcb66('0xd')][_0xcb66('0x13e')](_0x5e0001,_0x412515,_0x1cece0['intKey'],_0x1cece0[_0xcb66('0x62')],undefined,_0x389aa3);if(_0xcf8863[_0xcb66('0xa0')]!==-0x1){this['channel'][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0x13f'),_0x174aa6));var _0x17d2f2=this[_0xcb66('0x8c')][_0xcb66('0xa3')](this,_0x1cece0,_0x174aa6);if(_0x17d2f2){for(var _0x1aad4a in _0x17d2f2){if(_0x17d2f2[_0xcb66('0x90')](_0x1aad4a)){this[_0xcb66('0xd')]['setVariable'](util[_0xcb66('0x27')](_0xcb66('0x140'),_0x1aad4a['toUpperCase']()),_0x17d2f2[_0x1aad4a]);}}return this['channel'][_0xcb66('0xa8')](util[_0xcb66('0x27')]('TildeASR\x20Result\x20%s',JSON[_0xcb66('0x139')](_0x17d2f2)));}}return _0xcf8863;};AGIVertices[_0xcb66('0x10')][_0xcb66('0x141')]=function(_0x2d6b00){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x142'),_0x2d6b00[_0xcb66('0xa7')]));return this['channel'][_0xcb66('0x143')](_0x2d6b00[_0xcb66('0x3b')],_0x2d6b00['extension'],_0x2d6b00[_0xcb66('0x3c')]);};AGIVertices[_0xcb66('0x10')][_0xcb66('0x144')]=function(_0x2337c7){logger['info'](util[_0xcb66('0x27')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x2337c7['label']));if(!this[_0xcb66('0x82')](_0x2337c7[_0xcb66('0x145')])){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x2337c7,_0xcb66('0x146'));}try{var _0x23b351=eval(_0x2337c7[_0xcb66('0x145')])?_0xcb66('0x147'):_0xcb66('0x148');this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0x149'),_0x2337c7[_0xcb66('0x145')],_0x23b351));return{'code':0xc8,'result':_0x23b351};}catch(_0x1b193d){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xcb66('0x10')]['gotoiftime']=function(_0x157291){logger[_0xcb66('0x2b')](util['format']('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x157291[_0xcb66('0xa7')]));if(!this[_0xcb66('0x82')](_0x157291['interval_id'])){return this['channel'][_0xcb66('0x2f')](_0x157291,_0xcb66('0x14a'));}var _0x47a606=this[_0xcb66('0x21')][_0xcb66('0xa3')](this,_0x157291[_0xcb66('0x14b')]);if(!_0x47a606){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x157291,_0xcb66('0x14c'));}for(var _0x5d63e7=0x0;_0x5d63e7<_0x47a606[_0xcb66('0x97')];_0x5d63e7+=0x1){var _0x10d862=this['channel'][_0xcb66('0x9c')](util['format'](_0xcb66('0x14d'),_0x47a606[_0x5d63e7]));if(_0x10d862[_0xcb66('0xa0')]===-0x1){return _0x10d862;}logger[_0xcb66('0x2b')](util['format'](_0xcb66('0x14e'),_0x47a606[_0x5d63e7],_0x10d862[_0xcb66('0x9d')]));if(_0x10d862['extra']===_0xcb66('0x147')){logger[_0xcb66('0x2b')](util['format']('IFTIME\x20%s\x20%s',_0x47a606[_0x5d63e7],_0xcb66('0x147')));this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')]('IFTIME\x20%s\x20%s',_0x47a606[_0x5d63e7],_0xcb66('0x147')));return{'code':0xc8,'result':_0xcb66('0x147')};}else{logger['info'](util[_0xcb66('0x27')](_0xcb66('0x14e'),_0x47a606[_0x5d63e7],'false'));this[_0xcb66('0xd')][_0xcb66('0xa8')](util['format'](_0xcb66('0x14e'),_0x47a606[_0x5d63e7],_0xcb66('0x148')));}}return{'code':0xc8,'result':_0xcb66('0x148')};};AGIVertices[_0xcb66('0x10')]['hangup']=function(_0x105003){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x14f'),_0x105003['label']));return this[_0xcb66('0xd')]['hangup']();};AGIVertices[_0xcb66('0x10')]['ispeechasr']=function(_0xca430e){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x150'),_0xca430e[_0xcb66('0xa7')]));if(!this[_0xcb66('0x82')](_0xca430e[_0xcb66('0x7d')])){return this[_0xcb66('0xd')][_0xcb66('0xa8')](_0xcb66('0xea'));}var _0x18700b=_0xcb66('0x133');var _0x1ced4f=util['format'](_0xcb66('0x13c'),FILES_PATH,rs[_0xcb66('0x11c')](0x4));var _0xee9a3e=util[_0xcb66('0x27')]('%s.%s',_0x1ced4f,_0x18700b);var _0x268f8f=!![];if(_0xca430e['beep']===_0xcb66('0x13d')){_0x268f8f=![];}var _0x57b01c=this['channel'][_0xcb66('0x13e')](_0x1ced4f,_0x18700b,_0xca430e['intKey'],_0xca430e['timeout'],undefined,_0x268f8f);if(_0x57b01c['result']!==-0x1){this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')]('ispeech\x20%s\x20file\x20created',_0xee9a3e));var _0x1c410b=this[_0xcb66('0x80')]['sync'](this,_0xca430e,_0xee9a3e);if(_0x1c410b){for(var _0x7a9324 in _0x1c410b){if(_0x1c410b['hasOwnProperty'](_0x7a9324)){this[_0xcb66('0xd')][_0xcb66('0x9a')](util[_0xcb66('0x27')](_0xcb66('0x151'),_0x7a9324['toUpperCase']()),_0x1c410b[_0x7a9324]);}}return this['channel']['noop'](util[_0xcb66('0x27')](_0xcb66('0x152'),JSON[_0xcb66('0x139')](_0x1c410b)));}}return _0x57b01c;};AGIVertices[_0xcb66('0x10')][_0xcb66('0x153')]=function(_0x5ec6d1){logger['info'](util[_0xcb66('0x27')](_0xcb66('0x154'),_0x5ec6d1[_0xcb66('0xa7')]));if(!this['isConfigured'](_0x5ec6d1[_0xcb66('0x7d')])){return this[_0xcb66('0xd')]['noop'](_0xcb66('0xea'));}if(!this[_0xcb66('0x82')](_0x5ec6d1['text'])){return this[_0xcb66('0xd')][_0xcb66('0xa8')]('no\x20text\x20configured');}this['channel']['noop'](util[_0xcb66('0x27')]('Trying\x20ispeech\x20TTS\x20%s',_0x5ec6d1['text']));var _0x564444=this[_0xcb66('0x7c')][_0xcb66('0xa3')](this,_0x5ec6d1);if(_0x564444){this[_0xcb66('0xd')][_0xcb66('0xa8')](util['format'](_0xcb66('0x155'),_0x564444));var _0x385416=this[_0xcb66('0xd')][_0xcb66('0x104')](_0x564444,_0x5ec6d1['intKey']);try{fs[_0xcb66('0x105')](_0x564444+'.wav');}catch(_0x5787b4){logger[_0xcb66('0x2f')](_0x5787b4);}return _0x385416;}return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x5ec6d1,_0xcb66('0x156'));};AGIVertices[_0xcb66('0x10')]['login']=function(_0x1795ad){logger[_0xcb66('0x2b')](util['format'](_0xcb66('0x157'),_0x1795ad[_0xcb66('0xa7')]));if(!this[_0xcb66('0x82')](_0x1795ad[_0xcb66('0x158')])){return this['channel'][_0xcb66('0x2f')](_0x1795ad,_0xcb66('0x159'));}logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x15a'),this[_0xcb66('0xd')][_0xcb66('0x37')],_0x1795ad[_0xcb66('0x158')]));var _0x567f05=this['agentLogin']['sync'](this,_0x1795ad['findBy']);if(_0x567f05){logger[_0xcb66('0x2b')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xcb66('0xd')][_0xcb66('0x37')],_0x1795ad[_0xcb66('0x158')]));this['channel'][_0xcb66('0xa8')](util[_0xcb66('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xcb66('0x37')],_0x1795ad[_0xcb66('0x158')]));return{'code':0xc8,'result':'success'};}else{logger[_0xcb66('0x2b')](util[_0xcb66('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xcb66('0xd')][_0xcb66('0x37')],_0x1795ad[_0xcb66('0x158')]));this[_0xcb66('0xd')]['noop'](util[_0xcb66('0x27')](_0xcb66('0x15b'),this['channel']['callerid'],_0x1795ad['findBy']));return{'code':0xc8,'result':_0xcb66('0x15c')};}};AGIVertices[_0xcb66('0x10')]['logout']=function(_0x3a953f){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x3a953f[_0xcb66('0xa7')]));if(!this['isConfigured'](_0x3a953f[_0xcb66('0x158')])){return this[_0xcb66('0xd')]['error'](_0x3a953f,_0xcb66('0x159'));}logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x15a'),this[_0xcb66('0xd')]['callerid'],_0x3a953f[_0xcb66('0x158')]));var _0x59b15f=this[_0xcb66('0x4e')]['sync'](this,_0x3a953f[_0xcb66('0x158')]);if(_0x59b15f){logger['info'](util[_0xcb66('0x27')](_0xcb66('0x15d'),this[_0xcb66('0xd')][_0xcb66('0x37')],_0x3a953f[_0xcb66('0x158')]));this[_0xcb66('0xd')][_0xcb66('0xa8')](util['format'](_0xcb66('0x15d'),this['channel'][_0xcb66('0x37')],_0x3a953f[_0xcb66('0x158')]));return{'code':0xc8,'result':_0xcb66('0x15e')};}else{logger[_0xcb66('0x2b')](util[_0xcb66('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xcb66('0xd')][_0xcb66('0x37')],_0x3a953f[_0xcb66('0x158')]));this[_0xcb66('0xd')]['noop'](util[_0xcb66('0x27')](_0xcb66('0x15b'),this[_0xcb66('0xd')]['callerid'],_0x3a953f[_0xcb66('0x158')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xcb66('0x10')][_0xcb66('0x15f')]=function(_0x5e6914){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x160'),_0x5e6914['label']));if(!this[_0xcb66('0x82')](_0x5e6914[_0xcb66('0x161')])){return this[_0xcb66('0xd')]['error'](_0x5e6914,_0xcb66('0x162'));}this['channel'][_0xcb66('0xa8')](util['format'](_0xcb66('0x163'),_0x5e6914[_0xcb66('0x161')]));var _0x217ddf=eval(_0x5e6914[_0xcb66('0x161')]);if(!this['isConfigured'](_0x5e6914[_0xcb66('0xdb')])){return this[_0xcb66('0xd')][_0xcb66('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2176f7=this['getVariable'][_0xcb66('0xa3')](this,_0x5e6914[_0xcb66('0xdb')]);if(!_0x2176f7){return this['channel'][_0xcb66('0x2f')](_0x5e6914,'no\x20variable\x20found');}if(_[_0xcb66('0x96')](_0x217ddf)){var _0x20cad2=this;_0x217ddf['forEach'](function(_0x1f316a,_0x3e29c5){_0x20cad2['channel'][_0xcb66('0x9a')](util[_0xcb66('0x27')](_0xcb66('0x164'),_0x2176f7,_0x3e29c5),_0x1f316a);});return this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')]('variable\x20%s[key]\x20set',_0x2176f7));}else{return this['channel']['setVariable'](_0x2176f7,_0x217ddf);}};AGIVertices[_0xcb66('0x10')][_0xcb66('0xa')]=function(_0x458b45){logger[_0xcb66('0x2b')](util['format'](_0xcb66('0x165'),_0x458b45[_0xcb66('0xa7')]));if(_0x458b45[_0xcb66('0xa4')]===0x0){return this[_0xcb66('0xa2')](_0x458b45);}_0x458b45[_0xcb66('0xa4')]-=0x1;if(!this[_0xcb66('0x82')](_0x458b45['file_id'])){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x458b45,_0xcb66('0x113'));}var _0x41c507=this[_0xcb66('0x1b')][_0xcb66('0xa3')](this,_0x458b45[_0xcb66('0x112')]);if(!_0x41c507){return this['channel']['error'](_0x458b45,_0xcb66('0x114'));}var _0x16448e=this[_0xcb66('0xd')]['getData'](_0x41c507,_0x458b45['response'],_0x458b45[_0xcb66('0x166')]);var _0x1c712d=_0x16448e['result'];if(_0x16448e[_0xcb66('0xa0')]===-0x1){this[_0xcb66('0x34')]['sync'](this,_0x458b45,'-1');return _0x16448e;}else if(_0x16448e[_0xcb66('0x9d')]===_0xcb66('0x62')){_0x16448e[_0xcb66('0xa0')]=_0x16448e['result'][_0xcb66('0x97')]>0x0?_0x16448e['result']:'t';}else if(_[_0xcb66('0x40')](_0x16448e[_0xcb66('0xa0')])){_0x16448e[_0xcb66('0xa0')]='#';_0x1c712d='#';}if(!this['isConfigured'](_0x458b45[_0xcb66('0xdb')])){this[_0xcb66('0xd')][_0xcb66('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x7443df=this[_0xcb66('0x9c')]['sync'](this,_0x458b45[_0xcb66('0xdb')]);if(!_0x7443df){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x458b45,_0xcb66('0x167'));}this['channel']['setVariable'](_0x7443df,_0x1c712d);}this[_0xcb66('0x34')]['sync'](this,_0x458b45,_0x1c712d);return _0x16448e;};AGIVertices[_0xcb66('0x10')]['noop']=function(_0x52ad64){logger['info'](util['format'](_0xcb66('0x168'),_0x52ad64[_0xcb66('0xa7')]));return this[_0xcb66('0xd')][_0xcb66('0xa8')](_0x52ad64['output']||_0x52ad64[_0xcb66('0xa7')]);};AGIVertices[_0xcb66('0x10')]['pause']=function(_0x45a22d){logger['info'](util[_0xcb66('0x27')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x45a22d[_0xcb66('0xa7')]));if(!this['isConfigured'](_0x45a22d[_0xcb66('0x158')])){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x45a22d,_0xcb66('0x159'));}logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x15a'),this[_0xcb66('0xd')]['callerid'],_0x45a22d[_0xcb66('0x158')]));var _0x13d034=this[_0xcb66('0x169')][_0xcb66('0xa3')](this,_0x45a22d['pause_id']);var _0x13bfcd=this['agentPause'][_0xcb66('0xa3')](this,_0x45a22d[_0xcb66('0x158')],_0x13d034);if(_0x13bfcd){logger['info'](util[_0xcb66('0x27')](_0xcb66('0x15d'),this[_0xcb66('0xd')][_0xcb66('0x37')],_0x45a22d['findBy']));this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0x15d'),this[_0xcb66('0xd')][_0xcb66('0x37')],_0x45a22d[_0xcb66('0x158')]));return{'code':0xc8,'result':'success'};}else{logger[_0xcb66('0x2b')](util['format'](_0xcb66('0x15b'),this['channel'][_0xcb66('0x37')],_0x45a22d['findBy']));this[_0xcb66('0xd')][_0xcb66('0xa8')](util['format'](_0xcb66('0x15d'),this[_0xcb66('0xd')][_0xcb66('0x37')],_0x45a22d['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xcb66('0x16a')]=function(_0x3bd915){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x16b'),_0x3bd915[_0xcb66('0xa7')]));if(!this[_0xcb66('0x82')](_0x3bd915[_0xcb66('0x112')])){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x3bd915,'no\x20file\x20audio\x20selected');}var _0x1f8b45=this[_0xcb66('0x1b')][_0xcb66('0xa3')](this,_0x3bd915[_0xcb66('0x112')]);if(!_0x1f8b45){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x3bd915,'no\x20file\x20audio\x20found');}var _0x38c268=this['channel']['exec'](_0xcb66('0x16c'),[_0x1f8b45,_0x3bd915[_0xcb66('0x110')]]);if(_0x38c268[_0xcb66('0xa0')]===-0x1){return _0x38c268;}return this['channel'][_0xcb66('0xa8')](util['format']('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x1f8b45));};AGIVertices[_0xcb66('0x10')][_0xcb66('0x16d')]=function(_0x5b9252){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x16e'),_0x5b9252['label']));if(!this[_0xcb66('0x82')](_0x5b9252[_0xcb66('0x16f')])){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x5b9252,_0xcb66('0x170'));}var _0x2cd34b='';var _0x500d77=parseInt(_0x5b9252['queue_id'],0xa);if(isNaN(_0x500d77)){_0x2cd34b=_0x5b9252['queue_id'];}else{_0x2cd34b=this[_0xcb66('0x14')][_0xcb66('0xa3')](this,_0x5b9252['queue_id']);if(!_0x2cd34b){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x5b9252,_0xcb66('0x171'));}}var _0xe9da2='';if(this['isConfigured'](_0x5b9252['file_id'])){var _0x2d908e=this['getSound'][_0xcb66('0xa3')](this,_0x5b9252[_0xcb66('0x112')]);if(_0x2d908e){_0xe9da2=_0x2d908e;}}this['createSquareDetailsReport'][_0xcb66('0xa3')](this,_0x5b9252,_0x2cd34b);if(_0x5b9252[_0xcb66('0x110')][_0xcb66('0x172')]('x')<0x0){_0x5b9252[_0xcb66('0x110')]+='x';}if(_0x5b9252[_0xcb66('0x110')]['indexOf']('X')<0x0){_0x5b9252[_0xcb66('0x110')]+='X';}this[_0xcb66('0xd')][_0xcb66('0x9a')](_0xcb66('0x173'),_0x2cd34b?_0x2cd34b['toLowerCase']():'');var _0x519c78=this[_0xcb66('0xd')][_0xcb66('0x52')](_0xcb66('0x174'),[_0x2cd34b,_0x5b9252['opts'],_0x5b9252[_0xcb66('0x60')],_0xe9da2,_0x5b9252['timeout'],_0x5b9252[_0xcb66('0x6')],_0x5b9252['macro'],_0x5b9252['gosub'],'',_0x5b9252[_0xcb66('0x175')]]);if(_0x519c78['result']===-0x1){return _0x519c78;}return this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')]('Executed\x20command\x20%s\x20%s',_0xcb66('0x174'),_0x2cd34b));};AGIVertices[_0xcb66('0x10')][_0xcb66('0x176')]=function(_0x292033){logger[_0xcb66('0x2b')](util['format'](_0xcb66('0x177'),_0x292033[_0xcb66('0xa7')]));var _0x19bfeb=_0x292033['recordingFormat']||'wav';var _0x29d222=util[_0xcb66('0x27')](_0xcb66('0x178'),this[_0xcb66('0xd')][_0xcb66('0x39')],rs[_0xcb66('0x11c')](0x5));var _0x373155=util['format'](_0xcb66('0x179'),FILES_PATH,_0x29d222,_0x19bfeb);var _0x2921de=util[_0xcb66('0x27')](_0xcb66('0x13c'),FILES_PATH,_0x29d222);this[_0xcb66('0x38')][_0xcb66('0xa3')](this,_0x292033,_0x29d222,_0x373155);this[_0xcb66('0xd')][_0xcb66('0x9a')](_0xcb66('0x17a'),_0x29d222);logger[_0xcb66('0x2b')](_0xcb66('0x17b'),_0x2921de,_0x19bfeb,_0x292033[_0xcb66('0x17c')],_0x292033['timeout']);return this[_0xcb66('0xd')][_0xcb66('0x13e')](_0x2921de,_0x19bfeb,_0x292033[_0xcb66('0x17c')],_0x292033[_0xcb66('0x62')],undefined,!![]);};AGIVertices['prototype'][_0xcb66('0x17d')]=function(_0x2fd975){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x17e'),_0x2fd975[_0xcb66('0xa7')]));if(!this['isConfigured'](_0x2fd975[_0xcb66('0x60')])){return this[_0xcb66('0xd')][_0xcb66('0xa8')](_0xcb66('0x17f'));}var _0x2dd920=this[_0xcb66('0x5f')][_0xcb66('0xa3')](this,_0x2fd975);logger[_0xcb66('0x2b')](util['format']('Response:',util[_0xcb66('0x180')](_0x2dd920,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x2fd975['variable_id'])){return this['channel'][_0xcb66('0xa8')](_0xcb66('0x181'));}var _0x4508d1=this[_0xcb66('0x9c')][_0xcb66('0xa3')](this,_0x2fd975['variable_id']);if(!_0x4508d1){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x2fd975,_0xcb66('0x167'));}this[_0xcb66('0xd')][_0xcb66('0x9a')](util[_0xcb66('0x27')](_0xcb66('0x182'),_0x4508d1),_0x2dd920['statusCode']?_0x2dd920[_0xcb66('0x71')]:_0xcb66('0x183'));this['channel'][_0xcb66('0x9a')](util[_0xcb66('0x27')](_0xcb66('0x184'),_0x4508d1),_0x2dd920[_0xcb66('0x70')]?_0x2dd920[_0xcb66('0x70')]:'OK');if(_0x2dd920[_0xcb66('0x68')]){try{this['saveRestApiResult'](_0x2dd920[_0xcb66('0x68')],_0x4508d1);}catch(_0x1381d8){logger[_0xcb66('0x2f')](util[_0xcb66('0x27')](_0xcb66('0x185'),_0x4508d1));}}return this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0xe0'),_0x4508d1));};AGIVertices[_0xcb66('0x10')][_0xcb66('0x186')]=function(_0x1f7253){logger['info'](util[_0xcb66('0x27')](_0xcb66('0x187'),_0x1f7253[_0xcb66('0xa7')]));return this[_0xcb66('0xd')][_0xcb66('0x188')](_0x1f7253[_0xcb66('0x189')][_0xcb66('0xd9')](/\s+/g,''),_0x1f7253[_0xcb66('0x17c')]);};AGIVertices[_0xcb66('0x10')]['saynumber']=function(_0x440587){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x18a'),_0x440587[_0xcb66('0xa7')]));return this[_0xcb66('0xd')][_0xcb66('0x18b')](_0x440587[_0xcb66('0x63')]['replace'](/\s+/g,''),_0x440587['escape_digits']);};AGIVertices[_0xcb66('0x10')][_0xcb66('0x18c')]=function(_0x4cac68){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x18d'),_0x4cac68[_0xcb66('0xa7')]));return this[_0xcb66('0xd')][_0xcb66('0x18e')](_0x4cac68[_0xcb66('0x56')],_0x4cac68[_0xcb66('0x17c')]);};AGIVertices[_0xcb66('0x10')]['sendMail']=function(_0x837cae){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x18f'),_0x837cae[_0xcb66('0xa7')]));if(!this['isConfigured'](_0x837cae[_0xcb66('0x190')])){return this[_0xcb66('0xd')]['noop']('no\x20mail\x20account\x20configured');}var _0x3bae4b=this[_0xcb66('0x191')][_0xcb66('0xa3')](this,_0x837cae[_0xcb66('0x190')]);if(!_0x3bae4b||!_0x3bae4b['Smtp']){return this['channel']['error'](_0x837cae,_0xcb66('0x192'));}var _0x1b1e9e={'from':util[_0xcb66('0x27')]('\x22%s\x22\x20<%s>',_0x3bae4b[_0xcb66('0x12')],_0x3bae4b['email']||_0x3bae4b[_0xcb66('0x193')]['user']),'to':_0x837cae['to']||'','cc':_0x837cae['cc']||'','bcc':_0x837cae[_0xcb66('0x194')]||'','subject':_0x837cae[_0xcb66('0x195')],'html':_0x837cae[_0xcb66('0x56')],'text':_0x837cae['text']};if(this['isConfigured'](_0x837cae[_0xcb66('0x196')])){}logger[_0xcb66('0xe1')]('sendMail\x20message',JSON[_0xcb66('0x139')](_0x1b1e9e));this[_0xcb66('0x34')][_0xcb66('0xa3')](this,_0x837cae,_0x837cae[_0xcb66('0x190')]);this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x3bae4b[_0xcb66('0x12')]));this[_0xcb66('0x20')][_0xcb66('0xa3')](this,_0x3bae4b[_0xcb66('0x197')],_0x1b1e9e);return this['channel'][_0xcb66('0xa8')](_0xcb66('0x198'));};AGIVertices['prototype']['sendFax']=function(_0x54242d){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x54242d[_0xcb66('0xa7')]));return this[_0xcb66('0xd')][_0xcb66('0xa8')](_0xcb66('0x199'));};AGIVertices[_0xcb66('0x10')]['sendSMS']=function(_0x33c25d){logger['info'](util['format'](_0xcb66('0x19a'),_0x33c25d['label']));if(!this[_0xcb66('0x82')](_0x33c25d['sms_account_id'])){return this[_0xcb66('0xd')][_0xcb66('0xa8')]('no\x20sms\x20account\x20configured');}var _0x471701=this[_0xcb66('0x31')][_0xcb66('0xa3')](this,_0x33c25d['sms_account_id']);if(!_0x471701){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x33c25d,_0xcb66('0x19b'));}var _0x5c13db={'body':_0x33c25d[_0xcb66('0x19c')],'phone':_0x33c25d['to']||'','SmsAccountId':_0x471701['id']};logger['debug'](_0xcb66('0x19d'),JSON['stringify'](_0x5c13db));this[_0xcb66('0x34')]['sync'](this,_0x33c25d,_0x33c25d[_0xcb66('0x19e')]);this['channel']['noop'](util[_0xcb66('0x27')](_0xcb66('0x19f'),_0x471701[_0xcb66('0x12')]));this[_0xcb66('0x33')][_0xcb66('0xa3')](this,_0x5c13db);return this[_0xcb66('0xd')]['noop'](_0xcb66('0x1a0'));};AGIVertices[_0xcb66('0x10')][_0xcb66('0x1a1')]=function(_0x107f0e){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x1a2'),_0x107f0e[_0xcb66('0xa7')]));if(!this[_0xcb66('0x82')](_0x107f0e[_0xcb66('0xdb')])){return this[_0xcb66('0xd')]['error'](_0x107f0e,_0xcb66('0x1a3'));}var _0x42f949=this['getVariable']['sync'](this,_0x107f0e[_0xcb66('0xdb')]);if(!_0x42f949){return this['channel'][_0xcb66('0x2f')](_0x107f0e,_0xcb66('0x167'));}return this['channel'][_0xcb66('0x9a')](_0x42f949,_0x107f0e[_0xcb66('0x1a4')]);};AGIVertices['prototype'][_0xcb66('0x1a5')]=function(_0xbb8975){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x1a6'),_0xbb8975[_0xcb66('0xa7')]));this[_0xcb66('0xd')]['noop']('START\x20CALLY\x20SQUARE');var _0x215f2f=this[_0xcb66('0xd')][_0xcb66('0x9c')](_0xcb66('0x1a7'));if(!_['isEmpty'](_0x215f2f[_0xcb66('0x9d')])){this[_0xcb66('0xd')][_0xcb66('0x39')]=_0x215f2f['extra'];}if(_0xbb8975[_0xcb66('0xb6')]===_0xcb66('0x1a8')){this[_0xcb66('0xd')]['noop']('Answer');return this[_0xcb66('0xd')]['answer']();}return this['channel']['noop'](_0xcb66('0x1a9'));};AGIVertices[_0xcb66('0x10')][_0xcb66('0x1aa')]=function(_0x57a726){logger['info'](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x57a726[_0xcb66('0xa7')]));if(!this[_0xcb66('0x82')](_0x57a726['project_id'])){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x57a726,_0xcb66('0x1ab'));}var _0x470652=this[_0xcb66('0x1ac')]['sync'](this,_0x57a726['project_id']);if(!this[_0xcb66('0x82')](_0x470652)){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x57a726,util[_0xcb66('0x27')](_0xcb66('0x1ad'),_0x57a726[_0xcb66('0x1ae')]));}if(_0x470652===this[_0xcb66('0xd')]['arg_1']){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x57a726,_0xcb66('0x1af'));}this[_0xcb66('0x34')][_0xcb66('0xa3')](this,_0x57a726,_0x470652);var _0x68d3b9=this[_0xcb66('0xd')][_0xcb66('0x52')](_0xcb66('0x1b0'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xcb66('0x6')][_0xcb66('0x1b1')]||'127.0.0.1',_0x470652,this['channel'][_0xcb66('0x36')]));if(_0x68d3b9[_0xcb66('0xa0')]===-0x1){return _0x68d3b9;}return this[_0xcb66('0xd')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0xcb66('0x1b0'),_0x470652));};AGIVertices[_0xcb66('0x10')][_0xcb66('0x1b2')]=function(_0x518845){logger['info'](util[_0xcb66('0x27')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x518845[_0xcb66('0xa7')]));var _0x1a3145=this[_0xcb66('0x1b3')][_0xcb66('0xa3')](this,_0x518845[_0xcb66('0xb4')]);this[_0xcb66('0x34')][_0xcb66('0xa3')](this,_0x518845,_0x518845['command']);if(this['isConfigured'](_0x518845[_0xcb66('0xdb')])){var _0x580ab3=this[_0xcb66('0x9c')][_0xcb66('0xa3')](this,_0x518845[_0xcb66('0xdb')]);if(_0x580ab3){this[_0xcb66('0xd')]['setVariable'](_0x580ab3,_0x1a3145);return this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0x1b4'),_0x518845[_0xcb66('0xb4')],_0x580ab3));}}return this['channel'][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0x1b5'),_0x518845['command']));};AGIVertices[_0xcb66('0x10')][_0xcb66('0x1b6')]=function(_0x1365fb){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x1b7'),_0x1365fb['label']));_0x1365fb[_0xcb66('0x56')]=_0x1365fb[_0xcb66('0x56')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xcb66('0x82')](_0x1365fb[_0xcb66('0x55')])){return this[_0xcb66('0xd')][_0xcb66('0xa8')](_0xcb66('0x1b8'));}if(!this['isConfigured'](_0x1365fb['text'])){return this[_0xcb66('0xd')][_0xcb66('0xa8')](_0xcb66('0xc3'));}this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0x1b9'),_0x1365fb['text']));var _0x1a418a=this[_0xcb66('0x54')][_0xcb66('0xa3')](this,_0x1365fb);if(_0x1a418a){this[_0xcb66('0xd')][_0xcb66('0xa8')](util['format'](_0xcb66('0x1ba'),_0x1a418a));var _0x3a7c30=this['channel']['streamFile'](_0x1a418a);try{fs[_0xcb66('0x105')](_0x1a418a+_0xcb66('0x106'));}catch(_0x280225){logger['error'](_0x280225);}return _0x3a7c30;}return this[_0xcb66('0xd')]['error'](_0x1365fb,_0xcb66('0x1bb'));};AGIVertices[_0xcb66('0x10')]['tts']=function(_0x509679){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x509679['label']));_0x509679[_0xcb66('0x56')]=_0x509679[_0xcb66('0x56')][_0xcb66('0xd9')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xcb66('0x82')](_0x509679[_0xcb66('0x56')])){return this[_0xcb66('0xd')]['noop'](_0xcb66('0xc3'));}this[_0xcb66('0xd')]['noop'](util[_0xcb66('0x27')](_0xcb66('0x1bc'),_0x509679[_0xcb66('0x56')]));var _0x8568c6=this['googleTTS'][_0xcb66('0xa3')](this,_0x509679);if(_0x8568c6){this['channel'][_0xcb66('0xa8')](util[_0xcb66('0x27')]('Google\x20TTS\x20%s\x20file\x20created',_0x8568c6));var _0x2f0935=this['channel'][_0xcb66('0x104')](_0x8568c6);try{fs[_0xcb66('0x105')](_0x8568c6+_0xcb66('0x106'));}catch(_0x357702){logger[_0xcb66('0x2f')](_0x357702);}return _0x2f0935;}return this[_0xcb66('0xd')]['error'](_0x509679,_0xcb66('0x1bd'));};AGIVertices['prototype'][_0xcb66('0x1be')]=function(_0x42ef7f){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x1bf'),_0x42ef7f[_0xcb66('0xa7')]));if(!this['isConfigured'](_0x42ef7f['findBy'])){return this['channel']['error'](_0x42ef7f,_0xcb66('0x159'));}logger['info'](util['format'](_0xcb66('0x15a'),this[_0xcb66('0xd')]['callerid'],_0x42ef7f[_0xcb66('0x158')]));var _0x270d26=this[_0xcb66('0x4d')][_0xcb66('0xa3')](this,_0x42ef7f[_0xcb66('0x158')]);if(_0x270d26){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x15d'),this[_0xcb66('0xd')][_0xcb66('0x37')],_0x42ef7f[_0xcb66('0x158')]));this[_0xcb66('0xd')]['noop'](util[_0xcb66('0x27')](_0xcb66('0x15d'),this[_0xcb66('0xd')][_0xcb66('0x37')],_0x42ef7f[_0xcb66('0x158')]));return{'code':0xc8,'result':_0xcb66('0x15e')};}else{logger['info'](util[_0xcb66('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xcb66('0xd')]['callerid'],_0x42ef7f['findBy']));this[_0xcb66('0xd')][_0xcb66('0xa8')](util[_0xcb66('0x27')](_0xcb66('0x15b'),this[_0xcb66('0xd')][_0xcb66('0x37')],_0x42ef7f[_0xcb66('0x158')]));return{'code':0xc8,'result':_0xcb66('0x15c')};}};AGIVertices[_0xcb66('0x10')][_0xcb66('0x1c0')]=function(_0x339ec6){logger['info'](util[_0xcb66('0x27')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x339ec6[_0xcb66('0xa7')]));var _0x4c4438=this['channel'][_0xcb66('0x52')](_0xcb66('0x1c1'),[_0x339ec6[_0xcb66('0x1c2')],_0x339ec6[_0xcb66('0x74')]]);if(_0x4c4438['result']===-0x1){return _0x4c4438;}return this[_0xcb66('0xd')]['noop'](util['format']('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x339ec6[_0xcb66('0x1c2')]));};AGIVertices[_0xcb66('0x10')]['vswitch']=function(_0x2a62e7){logger[_0xcb66('0x2b')](util[_0xcb66('0x27')](_0xcb66('0x1c3'),_0x2a62e7[_0xcb66('0xa7')]));if(!this[_0xcb66('0x82')](_0x2a62e7[_0xcb66('0xdb')])){return this[_0xcb66('0xd')][_0xcb66('0x2f')](_0x2a62e7,_0xcb66('0x1a3'));}var _0x43f532=this['getVariable'][_0xcb66('0xa3')](this,_0x2a62e7[_0xcb66('0xdb')]);if(!_0x43f532){return this['channel'][_0xcb66('0x2f')](_0x2a62e7,'no\x20variable\x20found');}var _0x4d49b4=this[_0xcb66('0xd')][_0xcb66('0x9c')](_0x43f532);return{'code':0xc8,'result':_0x4d49b4[_0xcb66('0x9d')]?_0x4d49b4[_0xcb66('0x9d')]:'-'};};String[_0xcb66('0x10')]['replaceAll']=function(_0x466dea,_0x14245e){return this[_0xcb66('0x9b')](_0x466dea)['join'](_0x14245e);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 0c99945..0fa01ee 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 _0x4d8f=['[%s][UPDATE][ACWTIME:%s]','catch','error','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','Action','QueuePause','getAgent','attended','destlinkedid','savePause','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','finally','message','[%s][TIMER][STOP][AGENT:%s]','pauseType','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','acw','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','timer','update','uniqueid','then','info'];(function(_0x4f5226,_0x518f6c){var _0x42fdd5=function(_0x565397){while(--_0x565397){_0x4f5226['push'](_0x4f5226['shift']());}};_0x42fdd5(++_0x518f6c);}(_0x4d8f,0x18e));var _0xf4d8=function(_0x2a717c,_0x2835c6){_0x2a717c=_0x2a717c-0x0;var _0x334c66=_0x4d8f[_0x2a717c];return _0x334c66;};'use strict';var _=require(_0xf4d8('0x0'));var moment=require(_0xf4d8('0x1'));var ami=require('../ami');var logger=require(_0xf4d8('0x2'))('acw');var RpcUser=require(_0xf4d8('0x3'));var RpcVoiceAgentReport=require(_0xf4d8('0x4'));function Acw(_0x429a90){this['voiceQueues']=_0x429a90[_0xf4d8('0x5')];this[_0xf4d8('0x6')]=_0x429a90[_0xf4d8('0x6')];this['timers']=_0x429a90[_0xf4d8('0x7')];this[_0xf4d8('0x8')]={};ami['on'](_0xf4d8('0x9'),this[_0xf4d8('0xa')][_0xf4d8('0xb')](this));ami['on'](_0xf4d8('0xc'),this[_0xf4d8('0xd')][_0xf4d8('0xb')](this));ami['on'](_0xf4d8('0xe'),this['syncHangup'][_0xf4d8('0xb')](this));ami['on'](_0xf4d8('0xf'),this[_0xf4d8('0x10')]['bind'](this));ami['on'](_0xf4d8('0x11'),this[_0xf4d8('0x12')][_0xf4d8('0xb')](this));ami['on'](_0xf4d8('0x13'),this[_0xf4d8('0x14')][_0xf4d8('0xb')](this));ami['on'](_0xf4d8('0x15'),this['syncAgentConnectPreview'][_0xf4d8('0xb')](this));}function getDiff(_0x3fe15c){var _0x5e5706=moment()[_0xf4d8('0x16')](0x0);var _0x462bcd=moment(_0x3fe15c)[_0xf4d8('0x16')](0x0);return _0x5e5706[_0xf4d8('0x17')](_0x462bcd,_0xf4d8('0x18'));}Acw[_0xf4d8('0x19')][_0xf4d8('0x1a')]=function(_0x59c3da,_0x8bbc84){var _0x3df426=this;var _0x58fa2f=getDiff(_0x3df426['timers'][_0x59c3da]['lastPauseAt']);clearTimeout(_0x3df426[_0xf4d8('0x7')][_0x59c3da][_0xf4d8('0x1b')]);_0x3df426['timers'][_0x59c3da][_0xf4d8('0x1b')]=![];return RpcVoiceAgentReport[_0xf4d8('0x1c')]({'acwtime':_0x58fa2f},_0x3df426[_0xf4d8('0x7')][_0x59c3da][_0xf4d8('0x1d')],_0x59c3da)[_0xf4d8('0x1e')](function(_0x7f2e2a){logger[_0xf4d8('0x1f')](_0xf4d8('0x20'),_0x8bbc84,_0x58fa2f,_0x7f2e2a);})[_0xf4d8('0x21')](function(_0x3b8346){logger[_0xf4d8('0x22')]('[%s][UPDATE][ERRORS:%s]',_0x8bbc84,_0x3b8346);})['finally'](function(){delete _0x3df426[_0xf4d8('0x7')][_0x59c3da];});};Acw[_0xf4d8('0x19')]['startAcw']=function(_0x15e204){try{var _0x44e6d1=this;var _0x30a7a4=this[_0xf4d8('0x8')][_0x15e204][_0xf4d8('0x23')];var _0x1a344c=this[_0xf4d8('0x8')][_0x15e204][_0xf4d8('0x24')];var _0x11dd49=this[_0xf4d8('0x5')][_0x1a344c];var _0x55265c=![];var _0xc55332=_0xf4d8('0x25');if(_0x11dd49[_0xf4d8('0x26')]&&_0x11dd49[_0xf4d8('0x27')]['name']){_0x55265c=!![];_0xc55332=_0x11dd49[_0xf4d8('0x27')]['name'];}return ami[_0xf4d8('0x28')]({'action':_0xf4d8('0x29'),'interface':_0x30a7a4,'paused':!![],'reason':_0xc55332})[_0xf4d8('0x1e')](function(){if(_0x44e6d1[_0xf4d8('0x6')][_0x30a7a4]){return RpcUser[_0xf4d8('0x2a')](_0x44e6d1[_0xf4d8('0x6')][_0x30a7a4]['id'])[_0xf4d8('0x1e')](function(_0x44b602){if(!_0x44b602||_0x44b602['voicePause']){logger[_0xf4d8('0x1f')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x15e204,_0x30a7a4,_0x1a344c);return;}logger[_0xf4d8('0x1f')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x15e204,_0x30a7a4,_0x1a344c);var _0x5beb78=_0x44e6d1[_0xf4d8('0x8')][_0x15e204][_0xf4d8('0x2b')]&&_0x44e6d1['channels'][_0x15e204]['destlinkedid']?_0x44e6d1[_0xf4d8('0x8')][_0x15e204][_0xf4d8('0x2c')]:_0x15e204;return RpcUser[_0xf4d8('0x2d')](_0x44e6d1[_0xf4d8('0x6')][_0x30a7a4],_0xc55332,_0x5beb78)[_0xf4d8('0x1e')](function(_0x261b47){_0x44e6d1[_0xf4d8('0x5')][_0x1a344c][_0xf4d8('0x2e')]-=0x1;_0x44e6d1[_0xf4d8('0x5')][_0x1a344c][_0xf4d8('0x2f')]+=0x1;return _0x261b47;});})[_0xf4d8('0x1e')](function(_0x4c5f31){if(_0x55265c||!_0x4c5f31){return;}_0x44e6d1[_0xf4d8('0x7')][_0x30a7a4]={};logger[_0xf4d8('0x1f')](_0xf4d8('0x30'),_0x15e204,_0x44e6d1[_0xf4d8('0x5')][_0x1a344c][_0xf4d8('0x31')],_0x30a7a4,_0x1a344c);_0x44e6d1[_0xf4d8('0x7')][_0x30a7a4][_0xf4d8('0x1b')]=setTimeout(_0x44e6d1[_0xf4d8('0x32')][_0xf4d8('0xb')](_0x44e6d1,_0x30a7a4),_0x44e6d1[_0xf4d8('0x5')][_0x1a344c][_0xf4d8('0x31')]*0x3e8);_0x44e6d1[_0xf4d8('0x7')][_0x30a7a4][_0xf4d8('0x33')]=moment()[_0xf4d8('0x34')]('YYYY-MM-DD\x20HH:mm:ss');_0x44e6d1[_0xf4d8('0x7')][_0x30a7a4][_0xf4d8('0x1d')]=_0x15e204;_0x44e6d1[_0xf4d8('0x7')][_0x30a7a4][_0xf4d8('0x24')]=_0x1a344c;_0x44e6d1[_0xf4d8('0x7')][_0x30a7a4][_0xf4d8('0x1a')]=_0x44e6d1[_0xf4d8('0x1a')]['bind'](_0x44e6d1,_0x30a7a4,_0x15e204);});}})[_0xf4d8('0x21')](function(){logger[_0xf4d8('0x22')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x15e204,_0x44e6d1[_0xf4d8('0x5')][_0x1a344c][_0xf4d8('0x31')],_0x30a7a4,_0x1a344c);})[_0xf4d8('0x35')](function(){delete _0x44e6d1['channels'][_0x15e204];});}catch(_0x2e5f0a){logger[_0xf4d8('0x22')]('[ACW][START]\x20%s',_0x2e5f0a[_0xf4d8('0x36')]);}};Acw[_0xf4d8('0x19')][_0xf4d8('0x32')]=function(_0x58a822){try{var _0x17bbd2=this;if(_0x17bbd2[_0xf4d8('0x7')][_0x58a822]){_0x17bbd2[_0xf4d8('0x7')][_0x58a822][_0xf4d8('0x1b')]=![];var _0x2de982=_0x17bbd2[_0xf4d8('0x7')][_0x58a822][_0xf4d8('0x1d')];var _0x40a5bd=_0x17bbd2[_0xf4d8('0x7')][_0x58a822][_0xf4d8('0x24')];var _0x52fb3c=_0x17bbd2[_0xf4d8('0x5')][_0x40a5bd]['acwTimeout'];logger[_0xf4d8('0x1f')](_0xf4d8('0x37'),_0x2de982,_0x58a822);RpcUser[_0xf4d8('0x2a')](this[_0xf4d8('0x6')][_0x58a822]['id'])[_0xf4d8('0x1e')](function(_0x3e5606){if(_0x3e5606[_0xf4d8('0x38')]==='ACW'){return RpcUser['saveUnpause'](_0x17bbd2['agents'][_0x58a822]);}});RpcVoiceAgentReport[_0xf4d8('0x1c')]({'acwtime':_0x52fb3c,'agentacw':!![]},_0x2de982,_0x58a822)[_0xf4d8('0x1e')](function(_0x7d98c6){logger['info'](_0xf4d8('0x20'),_0x2de982,_0x52fb3c,_0x7d98c6);})['catch'](function(_0x4595e3){logger[_0xf4d8('0x22')](_0xf4d8('0x39'),_0x2de982,_0x4595e3);});}else{logger['error'](_0xf4d8('0x3a'),_0x58a822);if(_0x17bbd2[_0xf4d8('0x7')]){logger['info']('[ACW][TIMERS]',JSON[_0xf4d8('0x3b')](_0x17bbd2[_0xf4d8('0x7')]));}}}catch(_0x7f095c){logger['error'](_0xf4d8('0x3c'),_0x7f095c[_0xf4d8('0x36')]);}};Acw[_0xf4d8('0x19')][_0xf4d8('0xa')]=function(_0x441eab){try{if(this[_0xf4d8('0x5')][_0x441eab[_0xf4d8('0x24')]]&&(this[_0xf4d8('0x5')][_0x441eab['queue']][_0xf4d8('0x3d')]||this['voiceQueues'][_0x441eab[_0xf4d8('0x24')]][_0xf4d8('0x26')])){if(this[_0xf4d8('0x6')][_0x441eab[_0xf4d8('0x23')]]){this['channels'][_0x441eab['uniqueid']]={'queue':_0x441eab[_0xf4d8('0x24')],'interface':_0x441eab['interface'],'destlinkedid':_0x441eab[_0xf4d8('0x2c')]};}}}catch(_0x46afde){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x46afde['message']);}};Acw[_0xf4d8('0x19')][_0xf4d8('0x3e')]=function(_0x26ca59){try{if(this[_0xf4d8('0x5')][_0x26ca59[_0xf4d8('0x24')]]&&(this['voiceQueues'][_0x26ca59[_0xf4d8('0x24')]][_0xf4d8('0x3d')]||this[_0xf4d8('0x5')][_0x26ca59[_0xf4d8('0x24')]][_0xf4d8('0x26')])){if(this[_0xf4d8('0x6')][_0x26ca59[_0xf4d8('0x23')]]){this[_0xf4d8('0x8')][_0x26ca59[_0xf4d8('0x1d')]]={'queue':_0x26ca59[_0xf4d8('0x24')],'interface':_0x26ca59[_0xf4d8('0x23')]};}}}catch(_0x553370){logger[_0xf4d8('0x22')](_0xf4d8('0x3f'),_0x553370[_0xf4d8('0x36')]);}};Acw[_0xf4d8('0x19')][_0xf4d8('0xd')]=function(_0x5e6587){try{if(this[_0xf4d8('0x8')][_0x5e6587[_0xf4d8('0x1d')]]&&_[_0xf4d8('0x40')](this['channels'][_0x5e6587[_0xf4d8('0x1d')]][_0xf4d8('0x2b')])){logger[_0xf4d8('0x1f')]('[%s][HANGUP:UNIQUEID]',_0x5e6587[_0xf4d8('0x1d')]);this[_0xf4d8('0x41')](_0x5e6587[_0xf4d8('0x1d')]);}else if(this[_0xf4d8('0x8')][_0x5e6587[_0xf4d8('0x42')]]&&_[_0xf4d8('0x40')](this[_0xf4d8('0x8')][_0x5e6587[_0xf4d8('0x42')]]['attended'])){logger[_0xf4d8('0x1f')](_0xf4d8('0x43'),_0x5e6587[_0xf4d8('0x42')]);this[_0xf4d8('0x41')](_0x5e6587['linkedid']);}}catch(_0x327cee){logger['error'](_0xf4d8('0x44'),_0x327cee[_0xf4d8('0x36')]);}};Acw[_0xf4d8('0x19')][_0xf4d8('0x45')]=function(_0x28870e){try{if(this[_0xf4d8('0x8')][_0x28870e['uniqueid']]&&this[_0xf4d8('0x8')][_0x28870e[_0xf4d8('0x1d')]][_0xf4d8('0x2b')]){logger[_0xf4d8('0x1f')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x28870e['uniqueid']);this['startAcw'](_0x28870e[_0xf4d8('0x1d')]);}else if(this[_0xf4d8('0x8')][_0x28870e['linkedid']]&&this[_0xf4d8('0x8')][_0x28870e[_0xf4d8('0x42')]][_0xf4d8('0x2b')]){logger[_0xf4d8('0x1f')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x28870e[_0xf4d8('0x42')]);this[_0xf4d8('0x41')](_0x28870e[_0xf4d8('0x42')]);}}catch(_0x1b34bd){logger[_0xf4d8('0x22')](_0xf4d8('0x46'),_0x1b34bd[_0xf4d8('0x36')]);}};Acw[_0xf4d8('0x19')][_0xf4d8('0x12')]=function(_0x29ed9f){try{if(!_[_0xf4d8('0x47')](this[_0xf4d8('0x8')][_0x29ed9f[_0xf4d8('0x48')]])){this[_0xf4d8('0x41')](_0x29ed9f['transfereeuniqueid']);if(this[_0xf4d8('0x8')][_0x29ed9f[_0xf4d8('0x49')]]){this[_0xf4d8('0x8')][_0x29ed9f[_0xf4d8('0x49')]]['attended']=!![];this[_0xf4d8('0x8')][_0x29ed9f[_0xf4d8('0x4a')]]=this[_0xf4d8('0x8')][_0x29ed9f['secondtransfereruniqueid']];delete this['channels'][_0x29ed9f['secondtransfereruniqueid']];}}else if(!_['isNil'](this[_0xf4d8('0x8')][_0x29ed9f[_0xf4d8('0x4a')]])){this[_0xf4d8('0x41')](_0x29ed9f['transfertargetuniqueid']);if(this['channels'][_0x29ed9f[_0xf4d8('0x4b')]]){this['channels'][_0x29ed9f[_0xf4d8('0x4b')]][_0xf4d8('0x2b')]=!![];this[_0xf4d8('0x8')][_0x29ed9f[_0xf4d8('0x48')]]=this['channels'][_0x29ed9f[_0xf4d8('0x4b')]];delete this[_0xf4d8('0x8')][_0x29ed9f[_0xf4d8('0x4b')]];}}}catch(_0x151e74){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x151e74[_0xf4d8('0x36')]);}};Acw[_0xf4d8('0x19')]['syncBlindTransfer']=function(_0x4aea78){try{if(this[_0xf4d8('0x8')][_0x4aea78[_0xf4d8('0x4c')]]){logger['info'](_0xf4d8('0x4d'),JSON[_0xf4d8('0x3b')](_0x4aea78['transfereruniqueid']));this[_0xf4d8('0x41')](_0x4aea78[_0xf4d8('0x4c')]);}else if(this[_0xf4d8('0x8')][_0x4aea78[_0xf4d8('0x4e')]]){logger['info'](_0xf4d8('0x4f'),JSON[_0xf4d8('0x3b')](_0x4aea78[_0xf4d8('0x4e')]));this[_0xf4d8('0x41')](_0x4aea78[_0xf4d8('0x4e')]);}}catch(_0x4911d0){logger[_0xf4d8('0x22')]('[ACW][syncBlindTransfer]\x20%s',_0x4911d0[_0xf4d8('0x36')]);}};Acw[_0xf4d8('0x19')]['syncAgentRingNoAnswer']=function(_0x266f2e){try{if(this[_0xf4d8('0x5')][_0x266f2e[_0xf4d8('0x24')]]&&this[_0xf4d8('0x5')][_0x266f2e[_0xf4d8('0x24')]][_0xf4d8('0x50')]===_0xf4d8('0x51')){if(this[_0xf4d8('0x6')][_0x266f2e[_0xf4d8('0x23')]]){logger['info'](_0xf4d8('0x52'),_0x266f2e[_0xf4d8('0x1d')],_0x266f2e[_0xf4d8('0x23')],_0x266f2e['queue']);return RpcUser['savePause'](this[_0xf4d8('0x6')][_0x266f2e[_0xf4d8('0x23')]],_0xf4d8('0x53'),_0x266f2e[_0xf4d8('0x1d')]);}}}catch(_0x4fb5a0){logger[_0xf4d8('0x22')](_0xf4d8('0x54'),_0x4fb5a0[_0xf4d8('0x36')]);}};module[_0xf4d8('0x55')]=Acw; \ No newline at end of file +var _0x82a6=['syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','lastPauseAt','timer','update','uniqueid','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','queue','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','then','getAgent','voicePause','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','format','updateAcw','[ACW][START]\x20%s','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','pauseType','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','hanguprequest','syncHangupRequest','bind','hangup','syncHangup','agentringnoanswer'];(function(_0x5727a6,_0x57a97f){var _0x3ca94f=function(_0x3438ec){while(--_0x3438ec){_0x5727a6['push'](_0x5727a6['shift']());}};_0x3ca94f(++_0x57a97f);}(_0x82a6,0x19e));var _0x682a=function(_0x1c3e98,_0x489c1c){_0x1c3e98=_0x1c3e98-0x0;var _0x46f20e=_0x82a6[_0x1c3e98];return _0x46f20e;};'use strict';var _=require(_0x682a('0x0'));var moment=require(_0x682a('0x1'));var ami=require(_0x682a('0x2'));var logger=require(_0x682a('0x3'))(_0x682a('0x4'));var RpcUser=require(_0x682a('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x547e68){this[_0x682a('0x6')]=_0x547e68[_0x682a('0x6')];this['agents']=_0x547e68[_0x682a('0x7')];this[_0x682a('0x8')]=_0x547e68['timers'];this[_0x682a('0x9')]={};ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on'](_0x682a('0xa'),this[_0x682a('0xb')][_0x682a('0xc')](this));ami['on'](_0x682a('0xd'),this[_0x682a('0xe')]['bind'](this));ami['on'](_0x682a('0xf'),this[_0x682a('0x10')]['bind'](this));ami['on']('attendedtransfer',this[_0x682a('0x11')][_0x682a('0xc')](this));ami['on'](_0x682a('0x12'),this[_0x682a('0x13')][_0x682a('0xc')](this));ami['on'](_0x682a('0x14'),this[_0x682a('0x15')][_0x682a('0xc')](this));}function getDiff(_0x5d95ec){var _0x41cf35=moment()[_0x682a('0x16')](0x0);var _0x52e490=moment(_0x5d95ec)[_0x682a('0x16')](0x0);return _0x41cf35[_0x682a('0x17')](_0x52e490,'seconds');}Acw[_0x682a('0x18')]['updateAcw']=function(_0x298cf1,_0xe3ff70){var _0x2e1ac7=this;var _0x4f1f48=getDiff(_0x2e1ac7[_0x682a('0x8')][_0x298cf1][_0x682a('0x19')]);clearTimeout(_0x2e1ac7[_0x682a('0x8')][_0x298cf1][_0x682a('0x1a')]);_0x2e1ac7[_0x682a('0x8')][_0x298cf1][_0x682a('0x1a')]=![];return RpcVoiceAgentReport[_0x682a('0x1b')]({'acwtime':_0x4f1f48},_0x2e1ac7[_0x682a('0x8')][_0x298cf1][_0x682a('0x1c')],_0x298cf1)['then'](function(_0x6a112a){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0xe3ff70,_0x4f1f48,_0x6a112a);})[_0x682a('0x1d')](function(_0x553b55){logger[_0x682a('0x1e')](_0x682a('0x1f'),_0xe3ff70,_0x553b55);})[_0x682a('0x20')](function(){delete _0x2e1ac7['timers'][_0x298cf1];});};Acw[_0x682a('0x18')][_0x682a('0x21')]=function(_0x1835aa){try{var _0x4bf4b5=this;var _0x212ef4=this['channels'][_0x1835aa]['interface'];var _0xe59653=this[_0x682a('0x9')][_0x1835aa][_0x682a('0x22')];var _0x2a0ffa=this[_0x682a('0x6')][_0xe59653];var _0x1012a3=![];var _0x3dd62a=_0x682a('0x23');if(_0x2a0ffa[_0x682a('0x24')]&&_0x2a0ffa['mandatoryDispositionPause'][_0x682a('0x25')]){_0x1012a3=!![];_0x3dd62a=_0x2a0ffa[_0x682a('0x26')][_0x682a('0x25')];}return ami[_0x682a('0x27')]({'action':'QueuePause','interface':_0x212ef4,'paused':!![],'reason':_0x3dd62a})[_0x682a('0x28')](function(){if(_0x4bf4b5['agents'][_0x212ef4]){return RpcUser[_0x682a('0x29')](_0x4bf4b5[_0x682a('0x7')][_0x212ef4]['id'])[_0x682a('0x28')](function(_0xc4e15e){if(!_0xc4e15e||_0xc4e15e[_0x682a('0x2a')]){logger[_0x682a('0x2b')](_0x682a('0x2c'),_0x1835aa,_0x212ef4,_0xe59653);return;}logger[_0x682a('0x2b')](_0x682a('0x2d'),_0x1835aa,_0x212ef4,_0xe59653);var _0x59dcf6=_0x4bf4b5[_0x682a('0x9')][_0x1835aa][_0x682a('0x2e')]&&_0x4bf4b5[_0x682a('0x9')][_0x1835aa][_0x682a('0x2f')]?_0x4bf4b5['channels'][_0x1835aa][_0x682a('0x2f')]:_0x1835aa;return RpcUser[_0x682a('0x30')](_0x4bf4b5[_0x682a('0x7')][_0x212ef4],_0x3dd62a,_0x59dcf6)[_0x682a('0x28')](function(_0x19e95e){_0x4bf4b5[_0x682a('0x6')][_0xe59653][_0x682a('0x31')]-=0x1;_0x4bf4b5[_0x682a('0x6')][_0xe59653][_0x682a('0x32')]+=0x1;return _0x19e95e;});})['then'](function(_0x1647b6){if(_0x1012a3||!_0x1647b6){return;}_0x4bf4b5['timers'][_0x212ef4]={};logger[_0x682a('0x2b')](_0x682a('0x33'),_0x1835aa,_0x4bf4b5[_0x682a('0x6')][_0xe59653][_0x682a('0x34')],_0x212ef4,_0xe59653);_0x4bf4b5[_0x682a('0x8')][_0x212ef4]['timer']=setTimeout(_0x4bf4b5['stopAcw'][_0x682a('0xc')](_0x4bf4b5,_0x212ef4),_0x4bf4b5[_0x682a('0x6')][_0xe59653][_0x682a('0x34')]*0x3e8);_0x4bf4b5['timers'][_0x212ef4]['lastPauseAt']=moment()[_0x682a('0x35')]('YYYY-MM-DD\x20HH:mm:ss');_0x4bf4b5[_0x682a('0x8')][_0x212ef4]['uniqueid']=_0x1835aa;_0x4bf4b5[_0x682a('0x8')][_0x212ef4][_0x682a('0x22')]=_0xe59653;_0x4bf4b5[_0x682a('0x8')][_0x212ef4][_0x682a('0x36')]=_0x4bf4b5[_0x682a('0x36')]['bind'](_0x4bf4b5,_0x212ef4,_0x1835aa);});}})[_0x682a('0x1d')](function(){logger[_0x682a('0x1e')](_0x682a('0x33'),_0x1835aa,_0x4bf4b5[_0x682a('0x6')][_0xe59653][_0x682a('0x34')],_0x212ef4,_0xe59653);})[_0x682a('0x20')](function(){delete _0x4bf4b5[_0x682a('0x9')][_0x1835aa];});}catch(_0x59cdef){logger[_0x682a('0x1e')](_0x682a('0x37'),_0x59cdef[_0x682a('0x38')]);}};Acw['prototype'][_0x682a('0x39')]=function(_0x43eaf7){try{var _0x4cf4f7=this;if(_0x4cf4f7['timers'][_0x43eaf7]){_0x4cf4f7[_0x682a('0x8')][_0x43eaf7][_0x682a('0x1a')]=![];var _0x56c384=_0x4cf4f7[_0x682a('0x8')][_0x43eaf7][_0x682a('0x1c')];var _0x642089=_0x4cf4f7[_0x682a('0x8')][_0x43eaf7][_0x682a('0x22')];var _0x8b1029=_0x4cf4f7['voiceQueues'][_0x642089][_0x682a('0x34')];logger[_0x682a('0x2b')](_0x682a('0x3a'),_0x56c384,_0x43eaf7);RpcUser[_0x682a('0x29')](this[_0x682a('0x7')][_0x43eaf7]['id'])[_0x682a('0x28')](function(_0x38fd30){if(_0x38fd30[_0x682a('0x3b')]===_0x682a('0x23')){return RpcUser[_0x682a('0x3c')](_0x4cf4f7[_0x682a('0x7')][_0x43eaf7]);}});RpcVoiceAgentReport[_0x682a('0x1b')]({'acwtime':_0x8b1029,'agentacw':!![]},_0x56c384,_0x43eaf7)[_0x682a('0x28')](function(_0xa99b2){logger[_0x682a('0x2b')](_0x682a('0x3d'),_0x56c384,_0x8b1029,_0xa99b2);})[_0x682a('0x1d')](function(_0x43e9bf){logger[_0x682a('0x1e')]('[%s][UPDATE][ERRORS:%s]',_0x56c384,_0x43e9bf);});}else{logger[_0x682a('0x1e')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x43eaf7);if(_0x4cf4f7[_0x682a('0x8')]){logger['info'](_0x682a('0x3e'),JSON[_0x682a('0x3f')](_0x4cf4f7['timers']));}}}catch(_0x47b4b2){logger[_0x682a('0x1e')](_0x682a('0x40'),_0x47b4b2[_0x682a('0x38')]);}};Acw[_0x682a('0x18')][_0x682a('0x41')]=function(_0x54f683){try{if(this[_0x682a('0x6')][_0x54f683[_0x682a('0x22')]]&&(this[_0x682a('0x6')][_0x54f683[_0x682a('0x22')]]['acw']||this['voiceQueues'][_0x54f683[_0x682a('0x22')]][_0x682a('0x24')])){if(this['agents'][_0x54f683[_0x682a('0x42')]]){this[_0x682a('0x9')][_0x54f683[_0x682a('0x1c')]]={'queue':_0x54f683[_0x682a('0x22')],'interface':_0x54f683['interface'],'destlinkedid':_0x54f683[_0x682a('0x2f')]};}}}catch(_0x385597){logger[_0x682a('0x1e')](_0x682a('0x43'),_0x385597[_0x682a('0x38')]);}};Acw[_0x682a('0x18')][_0x682a('0x15')]=function(_0x4475fe){try{if(this[_0x682a('0x6')][_0x4475fe[_0x682a('0x22')]]&&(this[_0x682a('0x6')][_0x4475fe[_0x682a('0x22')]][_0x682a('0x4')]||this[_0x682a('0x6')][_0x4475fe['queue']][_0x682a('0x24')])){if(this[_0x682a('0x7')][_0x4475fe[_0x682a('0x42')]]){this['channels'][_0x4475fe['uniqueid']]={'queue':_0x4475fe[_0x682a('0x22')],'interface':_0x4475fe[_0x682a('0x42')]};}}}catch(_0x5dbf1d){logger[_0x682a('0x1e')](_0x682a('0x44'),_0x5dbf1d[_0x682a('0x38')]);}};Acw[_0x682a('0x18')][_0x682a('0xb')]=function(_0x394a89){try{if(this[_0x682a('0x9')][_0x394a89[_0x682a('0x1c')]]&&_[_0x682a('0x45')](this[_0x682a('0x9')][_0x394a89[_0x682a('0x1c')]][_0x682a('0x2e')])){logger[_0x682a('0x2b')](_0x682a('0x46'),_0x394a89[_0x682a('0x1c')]);this[_0x682a('0x21')](_0x394a89['uniqueid']);}else if(this['channels'][_0x394a89['linkedid']]&&_[_0x682a('0x45')](this[_0x682a('0x9')][_0x394a89['linkedid']][_0x682a('0x2e')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x394a89[_0x682a('0x47')]);this[_0x682a('0x21')](_0x394a89['linkedid']);}}catch(_0x1f4df5){logger['error'](_0x682a('0x48'),_0x1f4df5['message']);}};Acw[_0x682a('0x18')][_0x682a('0xe')]=function(_0x22f914){try{if(this['channels'][_0x22f914['uniqueid']]&&this[_0x682a('0x9')][_0x22f914[_0x682a('0x1c')]][_0x682a('0x2e')]){logger[_0x682a('0x2b')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x22f914[_0x682a('0x1c')]);this['startAcw'](_0x22f914[_0x682a('0x1c')]);}else if(this[_0x682a('0x9')][_0x22f914[_0x682a('0x47')]]&&this[_0x682a('0x9')][_0x22f914[_0x682a('0x47')]]['attended']){logger[_0x682a('0x2b')](_0x682a('0x49'),_0x22f914[_0x682a('0x47')]);this['startAcw'](_0x22f914[_0x682a('0x47')]);}}catch(_0x1e0c6){logger[_0x682a('0x1e')](_0x682a('0x4a'),_0x1e0c6[_0x682a('0x38')]);}};Acw[_0x682a('0x18')][_0x682a('0x11')]=function(_0x2c56e4){try{if(!_['isNil'](this[_0x682a('0x9')][_0x2c56e4['transfereeuniqueid']])){this[_0x682a('0x21')](_0x2c56e4[_0x682a('0x4b')]);if(this[_0x682a('0x9')][_0x2c56e4['secondtransfereruniqueid']]){this[_0x682a('0x9')][_0x2c56e4['secondtransfereruniqueid']]['attended']=!![];this[_0x682a('0x9')][_0x2c56e4[_0x682a('0x4c')]]=this['channels'][_0x2c56e4['secondtransfereruniqueid']];delete this[_0x682a('0x9')][_0x2c56e4['secondtransfereruniqueid']];}}else if(!_['isNil'](this[_0x682a('0x9')][_0x2c56e4['transfertargetuniqueid']])){this[_0x682a('0x21')](_0x2c56e4[_0x682a('0x4c')]);if(this[_0x682a('0x9')][_0x2c56e4[_0x682a('0x4d')]]){this[_0x682a('0x9')][_0x2c56e4['origtransfereruniqueid']][_0x682a('0x2e')]=!![];this[_0x682a('0x9')][_0x2c56e4[_0x682a('0x4b')]]=this['channels'][_0x2c56e4[_0x682a('0x4d')]];delete this[_0x682a('0x9')][_0x2c56e4['origtransfereruniqueid']];}}}catch(_0x35ef5e){logger[_0x682a('0x1e')](_0x682a('0x4e'),_0x35ef5e['message']);}};Acw[_0x682a('0x18')]['syncBlindTransfer']=function(_0x1f63a2){try{if(this[_0x682a('0x9')][_0x1f63a2[_0x682a('0x4f')]]){logger[_0x682a('0x2b')](_0x682a('0x50'),JSON[_0x682a('0x3f')](_0x1f63a2[_0x682a('0x4f')]));this['startAcw'](_0x1f63a2[_0x682a('0x4f')]);}else if(this[_0x682a('0x9')][_0x1f63a2['transfererlinkedid']]){logger[_0x682a('0x2b')](_0x682a('0x51'),JSON[_0x682a('0x3f')](_0x1f63a2['transfererlinkedid']));this[_0x682a('0x21')](_0x1f63a2['transfererlinkedid']);}}catch(_0x61d8ed){logger['error'](_0x682a('0x52'),_0x61d8ed['message']);}};Acw[_0x682a('0x18')]['syncAgentRingNoAnswer']=function(_0x1daf43){try{if(this[_0x682a('0x6')][_0x1daf43[_0x682a('0x22')]]&&this['voiceQueues'][_0x1daf43[_0x682a('0x22')]]['autopause']==='all'){if(this[_0x682a('0x7')][_0x1daf43[_0x682a('0x42')]]){logger[_0x682a('0x2b')](_0x682a('0x53'),_0x1daf43['uniqueid'],_0x1daf43['interface'],_0x1daf43['queue']);return RpcUser[_0x682a('0x30')](this[_0x682a('0x7')][_0x1daf43['interface']],_0x682a('0x54'),_0x1daf43[_0x682a('0x1c')]);}}}catch(_0x3104c8){logger[_0x682a('0x1e')](_0x682a('0x55'),_0x3104c8[_0x682a('0x38')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 2437afa..e779129 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 _0xc08c=['connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','resolve','then','actionDeviceStateList','actionCoreShowChannels','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close'];(function(_0xc732c1,_0x326271){var _0x3a514a=function(_0x3d6233){while(--_0x3d6233){_0xc732c1['push'](_0xc732c1['shift']());}};_0x3a514a(++_0x326271);}(_0xc08c,0x162));var _0xcc08=function(_0x584291,_0x24b5b3){_0x584291=_0x584291-0x0;var _0x4e7d08=_0xc08c[_0x584291];return _0x4e7d08;};'use strict';var Manager=require(_0xcc08('0x0'));var BPromise=require(_0xcc08('0x1'));var util=require(_0xcc08('0x2'));var logger=require(_0xcc08('0x3'))(_0xcc08('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0xcc08('0x5')][_0xcc08('0x6')],config[_0xcc08('0x5')]['ip'],config[_0xcc08('0x5')][_0xcc08('0x7')],config[_0xcc08('0x5')][_0xcc08('0x8')],!![]);ami[_0xcc08('0x9')]();ami[_0xcc08('0xa')]=BPromise[_0xcc08('0xb')](ami['action']);function error(_0x4a7df3){logger[_0xcc08('0xc')](util[_0xcc08('0xd')](_0xcc08('0xe'),config[_0xcc08('0x5')][_0xcc08('0x7')],config[_0xcc08('0x5')]['ip'],config[_0xcc08('0x5')][_0xcc08('0x6')],util['inspect'](_0x4a7df3,![],null)));}function close(){logger[_0xcc08('0xc')](util['format'](_0xcc08('0xf'),config[_0xcc08('0x5')][_0xcc08('0x7')],config['asterisk']['ip'],config[_0xcc08('0x5')][_0xcc08('0x6')]));}ami[_0xcc08('0x10')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xcc08('0xa')]({'action':_0xcc08('0x11')});};};ami[_0xcc08('0x12')]=function(){return function(){return ami[_0xcc08('0xa')]({'action':_0xcc08('0x13')});};};ami[_0xcc08('0x14')]=function(){return function(){return ami[_0xcc08('0xa')]({'action':_0xcc08('0x15')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xcc08('0xa')]({'action':'coreshowchannels'});};};function connect(){logger[_0xcc08('0x16')](util['format'](_0xcc08('0x17'),config[_0xcc08('0x5')]['username'],config[_0xcc08('0x5')]['ip'],config[_0xcc08('0x5')]['port']));ami[_0xcc08('0x18')](_0xcc08('0xc'),error);ami['once'](_0xcc08('0x19'),close);}ami['on'](_0xcc08('0x1a'),connect);ami['on'](_0xcc08('0x1b'),function(_0x4f0add){logger['info'](util['format'](_0xcc08('0x1c'),config[_0xcc08('0x5')][_0xcc08('0x7')],config[_0xcc08('0x5')]['ip'],config[_0xcc08('0x5')][_0xcc08('0x6')],util[_0xcc08('0x1d')](_0x4f0add,![],null)));});ami['on'](_0xcc08('0x1e'),function(){logger[_0xcc08('0x16')](util[_0xcc08('0xd')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xcc08('0x5')][_0xcc08('0x7')],config[_0xcc08('0x5')]['ip'],config[_0xcc08('0x5')]['port']));return Promise[_0xcc08('0x1f')]()[_0xcc08('0x20')](ami[_0xcc08('0x10')]())[_0xcc08('0x20')](ami[_0xcc08('0x21')]())['then'](ami[_0xcc08('0x12')]())['then'](ami[_0xcc08('0x14')]())[_0xcc08('0x20')](ami[_0xcc08('0x22')]())[_0xcc08('0x23')](function(_0x15857e){logger[_0xcc08('0xc')](_0xcc08('0x24'),util[_0xcc08('0x1d')](_0x15857e,{'showHidden':![],'depth':null}));});});ami['once'](_0xcc08('0xc'),error);ami['once']('close',close);module[_0xcc08('0x25')]=ami; \ No newline at end of file +var _0xf35b=['close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','actionSipShowRegistry','then','actionSipPeerStatus','actionCoreShowChannels','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once'];(function(_0x155924,_0x2a5368){var _0x262e4b=function(_0x1e245a){while(--_0x1e245a){_0x155924['push'](_0x155924['shift']());}};_0x262e4b(++_0x2a5368);}(_0xf35b,0x7a));var _0xbf35=function(_0x31e04e,_0x544b93){_0x31e04e=_0x31e04e-0x0;var _0x24a3cc=_0xf35b[_0x31e04e];return _0x24a3cc;};'use strict';var Manager=require(_0xbf35('0x0'));var BPromise=require(_0xbf35('0x1'));var util=require(_0xbf35('0x2'));var logger=require(_0xbf35('0x3'))(_0xbf35('0x4'));var config=require(_0xbf35('0x5'));var ami=new Manager(config[_0xbf35('0x6')][_0xbf35('0x7')],config[_0xbf35('0x6')]['ip'],config[_0xbf35('0x6')][_0xbf35('0x8')],config[_0xbf35('0x6')][_0xbf35('0x9')],!![]);ami[_0xbf35('0xa')]();ami[_0xbf35('0xb')]=BPromise[_0xbf35('0xc')](ami[_0xbf35('0xd')]);function error(_0x2319f5){logger[_0xbf35('0xe')](util[_0xbf35('0xf')](_0xbf35('0x10'),config[_0xbf35('0x6')]['username'],config[_0xbf35('0x6')]['ip'],config[_0xbf35('0x6')][_0xbf35('0x7')],util[_0xbf35('0x11')](_0x2319f5,![],null)));}function close(){logger[_0xbf35('0xe')](util[_0xbf35('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xbf35('0x6')]['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami['Action']({'action':_0xbf35('0x12')});};};ami[_0xbf35('0x13')]=function(){return function(){return ami[_0xbf35('0xb')]({'action':_0xbf35('0x14')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xbf35('0xb')]({'action':_0xbf35('0x15')});};};ami[_0xbf35('0x16')]=function(){return function(){return ami[_0xbf35('0xb')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xbf35('0xb')]({'action':_0xbf35('0x17')});};};function connect(){logger['info'](util[_0xbf35('0xf')](_0xbf35('0x18'),config['asterisk'][_0xbf35('0x8')],config[_0xbf35('0x6')]['ip'],config[_0xbf35('0x6')][_0xbf35('0x7')]));ami['once'](_0xbf35('0xe'),error);ami[_0xbf35('0x19')](_0xbf35('0x1a'),close);}ami['on']('connect',connect);ami['on'](_0xbf35('0x1b'),function(_0x3d3323){logger[_0xbf35('0x1c')](util[_0xbf35('0xf')](_0xbf35('0x1d'),config['asterisk'][_0xbf35('0x8')],config[_0xbf35('0x6')]['ip'],config[_0xbf35('0x6')][_0xbf35('0x7')],util['inspect'](_0x3d3323,![],null)));});ami['on']('fullybooted',function(){logger['info'](util[_0xbf35('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xbf35('0x6')][_0xbf35('0x8')],config['asterisk']['ip'],config[_0xbf35('0x6')][_0xbf35('0x7')]));return Promise['resolve']()['then'](ami[_0xbf35('0x1e')]())[_0xbf35('0x1f')](ami[_0xbf35('0x13')]())[_0xbf35('0x1f')](ami[_0xbf35('0x20')]())[_0xbf35('0x1f')](ami[_0xbf35('0x16')]())[_0xbf35('0x1f')](ami[_0xbf35('0x21')]())[_0xbf35('0x22')](function(_0x478dab){logger[_0xbf35('0xe')](_0xbf35('0x23'),util['inspect'](_0x478dab,{'showHidden':![],'depth':null}));});});ami['once'](_0xbf35('0xe'),error);ami['once']('close',close);module[_0xbf35('0x24')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 7f58244..4818af0 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 _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x231dda,_0x5b04cc){_0x231dda=_0x231dda-0x0;var _0x3f88cb=_0xcb91[_0x231dda];return _0x3f88cb;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file +var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e9a69,_0x40c0ec){_0x5e9a69=_0x5e9a69-0x0;var _0x5979c8=_0xcb91[_0x5e9a69];return _0x5979c8;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 12be4d7..01e4589 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 _0x2c58=['starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:save','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','Error','stringify','isTrunkReachable','active','reachable','status','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','ifTime','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','isArray','length','push','command','iftime\x20%s,%s','content','true','Action','indexOf','all','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Timezone:\x20','catch','resetActiveCalls','syncCampaigns','undefined','dialGlobalInterval','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','handlePower','power','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','[ifTime][promiseAll]','Global:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','[ifTime][Action]','queue','updateOriginated','uniqueid','answertime','YYYY-MM-DD\x20HH:mm:ss','ivr','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','droptime','responsetime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','countdropretry','countglobal','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','dialDropMaxRetry','queueCallerAbandonCreateState','additional','rescheduleContact','dialDropRetryFrequency','ContactId','ListId','VoiceQueueId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','add','CampaignId','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','isNil','locked','paused','stateinterface','merge','roundrobin','run','idHopper','[unlock][syncQueueStatusComplete]','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','membername','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','MACHINE','AMD','countmachineretry','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','Machine','countbusyretry','dialMachineMaxRetry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Normal\x20Clearing','[syncAgentComplete]','outboundUnknownCallsDay','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','resolve','available','inUse','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','assign','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','launchHandleIvr','actionOriginate','object','originate','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','dialCutDigit','SIP/%s/%s%s','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','dialCongestionRetryFrequency','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','erlangCalls','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','loggedIn','predictiveIntervalPauses','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','talking','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','tryOriginatePredictive','[handlePredictive][limitChannel]','checkContactLowerLimitOriginate','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','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]','Umin\x20=\x20','exports','lodash','uuid','moment','./utils','./utils/hopper','../../../config/logger','dialer','booked','predictive','predictiveCalls','../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','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','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','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','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','getSeconds','startProgressive\x20value\x20cleared','handlePredictive','error','stack','temp','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime'];(function(_0x215692,_0x344ee3){var _0x2214fe=function(_0x41c809){while(--_0x41c809){_0x215692['push'](_0x215692['shift']());}};_0x2214fe(++_0x344ee3);}(_0x2c58,0x1ab));var _0x82c5=function(_0x5c851b,_0x1a8af5){_0x5c851b=_0x5c851b-0x0;var _0x3f37eb=_0x2c58[_0x5c851b];return _0x3f37eb;};'use strict';var util=require('util');var _=require(_0x82c5('0x0'));var uuid=require(_0x82c5('0x1'));var moment=require(_0x82c5('0x2'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0x82c5('0x3'));var hopperUtils=require(_0x82c5('0x4'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x82c5('0x5'))(_0x82c5('0x6'));var loggerBooked=require(_0x82c5('0x5'))(_0x82c5('0x7'));var loggerPredictive=require(_0x82c5('0x5'))(_0x82c5('0x8'));var loggerPredictiveCalls=require(_0x82c5('0x5'))(_0x82c5('0x9'));var loggerSyncQueueSummary=require(_0x82c5('0x5'))('syncQueueSummary');var ami=require(_0x82c5('0xa'));config['redis']=_[_0x82c5('0xb')](config[_0x82c5('0xc')],{'host':_0x82c5('0xd'),'port':0x18eb});var io=require(_0x82c5('0xe'))(new Redis(config[_0x82c5('0xc')]));var cmHopper=require(_0x82c5('0xf'));var voiceQueueRt=require(_0x82c5('0x10'));var RpcSetting=require(_0x82c5('0x11'));var Interval=require(_0x82c5('0x12'));var Action=require(_0x82c5('0x13'));var History=require(_0x82c5('0x14'));var Final=require(_0x82c5('0x15'));var AgentComplete=require(_0x82c5('0x16'));var QueueCallerAbandon=require(_0x82c5('0x17'));var Hangup=require('./models/hangup');var ipAgi=process[_0x82c5('0x18')][_0x82c5('0x19')]||_0x82c5('0x1a');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x82c5('0x1b')][_0x82c5('0x1c')]=function(_0x50353e){this[_0x82c5('0x1d')]=this[_0x82c5('0x1d')]?this['tail'][_0x82c5('0x1e')](_0x50353e):_0x50353e();};function Dialer(_0x316972,_0x50c1fe){this['sequence']=new Sequence();this[_0x82c5('0x1f')]=_0x50c1fe;this[_0x82c5('0x20')]=_0x316972[_0x82c5('0x20')];this[_0x82c5('0x21')]=_0x316972[_0x82c5('0x21')];this[_0x82c5('0x22')]=_0x316972['agents'];this[_0x82c5('0x23')]=_0x316972[_0x82c5('0x23')];this['maxNumberOriginate']=config[_0x82c5('0x24')]||0x2;this['channels']={};this[_0x82c5('0x25')]={};this[_0x82c5('0x26')]={};this[_0x82c5('0x27')]={};this[_0x82c5('0x28')]={};this[_0x82c5('0x29')]={};this[_0x82c5('0x2a')]={};this['ivrOriginated']={};this[_0x82c5('0x2b')]={};this[_0x82c5('0x2c')]={};this[_0x82c5('0x2d')]={};ami['on'](_0x82c5('0x2e'),this[_0x82c5('0x2f')][_0x82c5('0x30')](this));ami['on'](_0x82c5('0x31'),this[_0x82c5('0x32')][_0x82c5('0x30')](this));ami['on'](_0x82c5('0x33'),this[_0x82c5('0x34')][_0x82c5('0x30')](this));ami['on'](_0x82c5('0x35'),this[_0x82c5('0x36')][_0x82c5('0x30')](this));ami['on']('custom:queuesummary',this[_0x82c5('0x37')][_0x82c5('0x30')](this));ami['on'](_0x82c5('0x38'),this[_0x82c5('0x39')]['bind'](this));ami['on']('hangup',this[_0x82c5('0x3a')]['bind'](this));ami['on'](_0x82c5('0x3b'),this[_0x82c5('0x3c')]['bind'](this));ami['on'](_0x82c5('0x3d'),this['syncVarSet'][_0x82c5('0x30')](this));ami['on'](_0x82c5('0x3e'),this[_0x82c5('0x3f')][_0x82c5('0x30')](this));ami['on'](_0x82c5('0x40'),this[_0x82c5('0x41')][_0x82c5('0x30')](this));this[_0x82c5('0x42')]();this[_0x82c5('0x43')]();RpcSetting[_0x82c5('0x44')]()[_0x82c5('0x45')](function(_0x12f514){previewRecallmeReminderInterval=_0x12f514[_0x82c5('0x46')];});}function isNotNull(_0x264439){return _0x264439!==null&&!_[_0x82c5('0x47')](_0x264439);}function msgResponse(_0x3e7507,_0x5be6fb,_0x1f7535){return{'action':_0x3e7507,'response':_0x5be6fb,'message':_0x1f7535,'stack':_0x1f7535};}function emit(_0x2eed49,_0x366a2e,_0x41d53c){io['to'](_0x2eed49)[_0x82c5('0x48')](_0x366a2e,_0x41d53c);}function emitOutboundVoiceQueueSummary(_0xb88533){if(_0xb88533[_0x82c5('0x49')]===_0x82c5('0x4a')){logger[_0x82c5('0x4b')](_0x82c5('0x4c'),util[_0x82c5('0x4d')](_0xb88533,{'showHidden':![],'depth':null}));emit(util[_0x82c5('0x4e')](_0x82c5('0x4f'),_0xb88533[_0x82c5('0x50')]),_0x82c5('0x51'),_0xb88533);}}function checkGetDataPredictive(_0x47b8ea){if(isNotNull(_0x47b8ea)&&!_[_0x82c5('0x52')](_0x47b8ea)){loggerPredictive[_0x82c5('0x53')](_0x82c5('0x54'));loggerPredictive['info'](_0x82c5('0x55'),_0x47b8ea[_0x82c5('0x56')]);loggerPredictive[_0x82c5('0x53')](_0x82c5('0x57'),_0x47b8ea[_0x82c5('0x58')]);loggerPredictive['info'](_0x82c5('0x59'),_0x47b8ea[_0x82c5('0x5a')]);loggerPredictive[_0x82c5('0x53')](_0x82c5('0x5b'),_0x47b8ea[_0x82c5('0x5c')]);loggerPredictive[_0x82c5('0x53')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x47b8ea[_0x82c5('0x5d')]);loggerPredictive[_0x82c5('0x53')](_0x82c5('0x5e'),_0x47b8ea['predictiveIntervalAvgTalktime']);loggerPredictive[_0x82c5('0x53')](_0x82c5('0x5f'));if(_0x47b8ea[_0x82c5('0x56')]>0x0){if(!_[_0x82c5('0x47')](_0x47b8ea[_0x82c5('0x60')])&&_0x47b8ea[_0x82c5('0x60')]>0x0){return!![];}loggerPredictive[_0x82c5('0x53')](_0x82c5('0x61'));if(!_[_0x82c5('0x47')](_0x47b8ea[_0x82c5('0x5d')])&&_0x47b8ea[_0x82c5('0x5d')]>0x0){return!![];}loggerPredictive[_0x82c5('0x53')](_0x82c5('0x62'));}else{loggerPredictive['info'](_0x82c5('0x63'));}}else{loggerPredictive[_0x82c5('0x53')](_0x82c5('0x64'));}return![];}function mergeDataErlangB(_0x51fab9){return function(_0x23193a){loggerPredictive[_0x82c5('0x53')](_0x82c5('0x65'));loggerPredictive['info'](_0x82c5('0x66'),_0x23193a['erlangCalls']);loggerPredictive[_0x82c5('0x53')](_0x82c5('0x67'),_0x23193a[_0x82c5('0x68')]);loggerPredictive[_0x82c5('0x53')](_0x82c5('0x69'),_0x23193a[_0x82c5('0x6a')]);loggerPredictive[_0x82c5('0x53')](_0x82c5('0x6b'),_0x23193a[_0x82c5('0x6c')]);loggerPredictive[_0x82c5('0x53')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x23193a[_0x82c5('0x6a')]);loggerPredictive[_0x82c5('0x53')](_0x82c5('0x5f'));_['merge'](_0x51fab9,_0x23193a);};}function ifInterval(_0x1ec03e,_0x48e0e6){if(_[_0x82c5('0x47')](_0x48e0e6)){return![];}return utils[_0x82c5('0x6d')](undefined,_0x48e0e6)<_0x1ec03e*0x3c;}function clearPredictiveAttributes(_0x57e5d3){if(_0x57e5d3[_0x82c5('0x2a')]){_0x57e5d3[_0x82c5('0x2a')]=undefined;loggerPredictive[_0x82c5('0x4b')](_0x57e5d3[_0x82c5('0x50')],_0x82c5('0x6e'));}if(_0x57e5d3['startPredictive']){_0x57e5d3[_0x82c5('0x29')]=undefined;loggerPredictive[_0x82c5('0x4b')](_0x57e5d3[_0x82c5('0x50')],'startPredictive\x20value\x20cleared');}if(_0x57e5d3[_0x82c5('0x6f')]){clearInterval(_0x57e5d3[_0x82c5('0x6f')]);_0x57e5d3[_0x82c5('0x6f')]=undefined;loggerPredictive['debug'](_0x57e5d3['name'],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x3113a0,_0x5e29ef){return function(_0x309182){loggerPredictive['error'](_0x5e29ef[_0x82c5('0x50')],_0x3113a0);loggerPredictive[_0x82c5('0x70')](_0x309182[_0x82c5('0x71')]);clearPredictiveAttributes(_0x5e29ef);};}function loggerCatch(_0x4ba6e3){return function(_0x303a68){logger[_0x82c5('0x70')](_0x4ba6e3,util[_0x82c5('0x4d')](_0x303a68,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x3f76a3,_0xe3c93b,_0x49b814){return function(_0x43f290){utils['checkContactLowerLimitOriginate'](_0xe3c93b,_0x49b814,0x0);_0xe3c93b[_0x82c5('0x72')]=0x0;logger[_0x82c5('0x70')](_0x3f76a3,util[_0x82c5('0x4d')](_0x43f290,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4375aa){return function(_0x2c7aec){if(isNotNull(_0x2c7aec)&&isNotNull(_0x2c7aec[0x0])){if(_0x2c7aec[0x0][_0x82c5('0x73')]>0x0){_0x4375aa[_0x82c5('0x74')]=utils[_0x82c5('0x75')][_0x82c5('0x76')];logger[_0x82c5('0x53')](_0x82c5('0x77')+_0x4375aa[_0x82c5('0x50')],_0x2c7aec[0x0][_0x82c5('0x73')],_0x82c5('0x78'));}else{_0x4375aa[_0x82c5('0x74')]=utils[_0x82c5('0x75')][_0x82c5('0x79')];logger[_0x82c5('0x53')](_0x82c5('0x7a')+_0x4375aa[_0x82c5('0x50')]);}}};}function createObjHistory(_0x494b9a,_0x4105a6,_0x5a7129,_0x10e125,_0x23c63b){_0x494b9a[_0x82c5('0x74')]=_0x5a7129;var _0x3dab17=new Action(_0x494b9a,_0x4105a6);var _0x37b61d=new History(_0x3dab17);_0x37b61d[_0x82c5('0x7b')]=_0x10e125;_0x37b61d[_0x82c5('0x7c')]=_0x23c63b;_0x37b61d[_0x82c5('0x7d')]=_0x3dab17[_0x82c5('0x7e')];return _0x37b61d;}function unlockQueueStatus(_0x50c5c8,_0x52cddc){setTimeout(function(){if(_[_0x82c5('0x47')](_0x50c5c8[_0x82c5('0x7f')])){loggerBooked[_0x82c5('0x70')](_0x82c5('0x80'),_0x52cddc);}_0x50c5c8[_0x82c5('0x7f')]=!![];loggerBooked['info'](_0x82c5('0x81'),_0x52cddc,JSON['stringify'](_[_0x82c5('0x82')](_0x50c5c8,[_0x82c5('0x50'),_0x82c5('0x7f')])));},0x1f3);}function checkInterval(_0x5d7924){return function(){if(!isNotNull(_0x5d7924[_0x82c5('0x83')])){_0x5d7924[_0x82c5('0x74')]=utils[_0x82c5('0x75')][_0x82c5('0x84')];throw _0x5d7924[_0x82c5('0x50')]+_0x82c5('0x85');}if(!isNotNull(_0x5d7924[_0x82c5('0x83')][_0x82c5('0x86')])){_0x5d7924[_0x82c5('0x74')]=utils[_0x82c5('0x75')][_0x82c5('0x84')];throw _0x5d7924[_0x82c5('0x50')]+_0x82c5('0x85');}if(!isNotNull(_['isEmpty'](_0x5d7924['Interval'][_0x82c5('0x86')]))){_0x5d7924[_0x82c5('0x74')]=utils[_0x82c5('0x75')][_0x82c5('0x84')];throw _0x5d7924[_0x82c5('0x50')]+_0x82c5('0x85');}};}function checkIsIVRCampaignActive(_0x280f9c){return function(){if(!utils[_0x82c5('0x87')](_0x280f9c)){_0x280f9c[_0x82c5('0x74')]=utils[_0x82c5('0x75')][_0x82c5('0x88')];throw _0x280f9c[_0x82c5('0x50')]+_0x82c5('0x89');}};}function emitCampaignSummary(_0x8f6c18){if(utils[_0x82c5('0x8a')](_0x8f6c18)){emit(util['format']('campaign:ivr:%s',_0x8f6c18[_0x82c5('0x50')]),_0x82c5('0x8b'),_0x8f6c18);}}function loggerCatchQueueSummary(_0x3e481a,_0x23faae){return function(_0x1897f8){clearPredictiveAttributes(_0x23faae);emitCampaignSummary(_0x23faae);loggerSyncQueueSummary[_0x82c5('0x4b')](_0x3e481a,util[_0x82c5('0x4d')](_0x1897f8,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x8acdc3){if(_0x8acdc3[_0x82c5('0x8c')]){if(_0x8acdc3['originated']===0x0){_0x8acdc3[_0x82c5('0x8c')]=![];_0x8acdc3[_0x82c5('0x74')]=utils[_0x82c5('0x75')][_0x82c5('0x88')];loggerSyncQueueSummary[_0x82c5('0x4b')](_0x82c5('0x8d'),_0x8acdc3[_0x82c5('0x50')],_0x82c5('0x8e'));}else{_0x8acdc3[_0x82c5('0x74')]=utils[_0x82c5('0x75')][_0x82c5('0x8f')];loggerSyncQueueSummary['debug'](_0x82c5('0x8d'),_0x8acdc3[_0x82c5('0x50')],_0x82c5('0x90'));}emitCampaignSummary(_0x8acdc3);}}function myreject(_0x3b2b84){return function(_0x1bf92e){return _0x3b2b84(msgResponse('[ifTime][Action]',_0x82c5('0x91'),JSON[_0x82c5('0x92')](_0x1bf92e)));};}Dialer['prototype'][_0x82c5('0x93')]=function(_0x59ddf6){return!_[_0x82c5('0x47')](_0x59ddf6)&&_0x59ddf6&&!_['isUndefined'](_0x59ddf6['name'])&&!_[_0x82c5('0x47')](_0x59ddf6[_0x82c5('0x94')])&&_0x59ddf6['active']&&(this['trunks'][util[_0x82c5('0x4e')]('SIP/%s',_0x59ddf6[_0x82c5('0x50')])]['status']===_0x82c5('0x95')||this[_0x82c5('0x23')][util[_0x82c5('0x4e')]('SIP/%s',_0x59ddf6[_0x82c5('0x50')])][_0x82c5('0x96')]===_0x82c5('0x97'));};Dialer['prototype'][_0x82c5('0x98')]=function(_0x418ec6){var _0x57c855=this;return function(){if(!_0x57c855['isTrunkReachable'](_0x418ec6[_0x82c5('0x99')])){if(!_0x57c855['isTrunkReachable'](_0x418ec6[_0x82c5('0x9a')])){_0x418ec6['message']=utils[_0x82c5('0x75')][_0x82c5('0x9b')];throw _0x418ec6[_0x82c5('0x50')]+_0x82c5('0x9c');}}};};Dialer['prototype'][_0x82c5('0x9d')]=function(_0x3803b1,_0x59fa14,_0x157ff5,_0x3b1776){var _0x1645a4=this;return function(){var _0x90eca7=!![];return _0x1645a4[_0x82c5('0x9e')](_0x3803b1,_0x59fa14,_0x157ff5,_0x3b1776,_0x90eca7);};};Dialer['prototype'][_0x82c5('0x9f')]=function(_0x33e3a1,_0x3369b9,_0x21ccb6,_0x5b5922){var _0x1699b5=this;return function(){var _0x3b976c=![];return _0x1699b5[_0x82c5('0x9e')](_0x33e3a1[_0x82c5('0x86')],_0x3369b9,_0x21ccb6,_0x5b5922,_0x3b976c);};};Dialer[_0x82c5('0x1b')][_0x82c5('0x9e')]=function(_0x3ff3c6,_0x1c3213,_0x192687,_0x29fbe1,_0x4c265d){var _0x25f09=[];return new Promise(function(_0x3c1e98,_0x4fb9dd){if(!isNotNull(_0x3ff3c6)){_0x29fbe1[_0x82c5('0x74')]=utils[_0x82c5('0x75')][_0x82c5('0x84')];return _0x4fb9dd(msgResponse('ifTime',_0x82c5('0xa0'),_0x192687+_0x82c5('0xa1')));}if(_['isEmpty'](_0x3ff3c6)){_0x29fbe1[_0x82c5('0x74')]=utils[_0x82c5('0x75')]['EMPTY_INTERVAL'];return _0x4fb9dd(msgResponse(_0x82c5('0xa2'),'Failure',_0x192687+_0x82c5('0xa3')));}if(_0x1c3213&&_[_0x82c5('0x47')](config[_0x82c5('0xa4')][_0x1c3213])){_0x29fbe1[_0x82c5('0x74')]=utils[_0x82c5('0x75')][_0x82c5('0xa5')];return _0x4fb9dd(msgResponse(_0x82c5('0xa2'),_0x82c5('0xa0'),_0x192687+'\x20Timezone\x20unknow\x20'+_0x1c3213));}if(_[_0x82c5('0xa6')](_0x3ff3c6)){for(var _0x263462=0x0;_0x263462<_0x3ff3c6[_0x82c5('0xa7')];_0x263462+=0x1){_0x25f09[_0x82c5('0xa8')](ami['Action']({'action':_0x82c5('0xa9'),'command':util[_0x82c5('0x4e')](_0x82c5('0xaa'),_0x3ff3c6[_0x263462]['interval'],!_[_0x82c5('0x47')](config[_0x82c5('0xa4')][_0x1c3213])?_0x1c3213:'')})[_0x82c5('0x45')](function(_0x13e944){return _0x13e944[_0x82c5('0xab')]['indexOf'](_0x82c5('0xac'))>=0x0;})['catch'](myreject(_0x4fb9dd)));}}else{_0x25f09[_0x82c5('0xa8')](ami[_0x82c5('0xad')]({'action':_0x82c5('0xa9'),'command':util[_0x82c5('0x4e')]('iftime\x20%s,%s',_0x3ff3c6,!_[_0x82c5('0x47')](config[_0x82c5('0xa4')][_0x1c3213])?_0x1c3213:'')})[_0x82c5('0x45')](function(_0x24a3d5){return _0x24a3d5['content'][_0x82c5('0xae')](_0x82c5('0xac'))>=0x0;})['catch'](myreject(_0x4fb9dd)));}Promise[_0x82c5('0xaf')](_0x25f09)[_0x82c5('0x45')](function(_0x45973b){var _0x45eb2d=_['some'](_0x45973b);if(_0x45eb2d){return _0x3c1e98(_0x45eb2d);}else{_0x29fbe1[_0x82c5('0x74')]=_0x4c265d?utils['CAMPAIGN_STATUS'][_0x82c5('0xb0')]:utils[_0x82c5('0x75')][_0x82c5('0xb1')];return _0x4fb9dd(msgResponse('[ifTime][promiseAll]',_0x82c5('0xa0'),'Global:\x20'+_0x4c265d+'\x20'+_0x192687+'\x20Interval\x20is\x20overtime:\x20'+util[_0x82c5('0x4d')](_0x3ff3c6,{'showHidden':![],'depth':null})+_0x82c5('0xb2')+_0x1c3213));}})[_0x82c5('0xb3')](function(_0x4b7d73){return _0x4fb9dd(msgResponse('ifTime',_0x82c5('0xa0'),JSON['stringify'](_0x4b7d73)));});});};Dialer[_0x82c5('0x1b')][_0x82c5('0x42')]=function(){var _0x50d51a=this;return cmHopper[_0x82c5('0xb4')]({'active':![]},{'where':{'active':!![]}})[_0x82c5('0x45')](function(){setInterval(function(){_0x50d51a['syncCampaigns']();},0x3e8);});};Dialer['prototype'][_0x82c5('0xb5')]=function(){var _0x3780f1=this;var _0x5c8aaf;for(var _0x3ed4a0 in this[_0x82c5('0x21')]){if(typeof this[_0x82c5('0x21')][_0x3ed4a0]!==_0x82c5('0xb6')){_0x5c8aaf=this[_0x82c5('0x21')][_0x3ed4a0];if(utils['isIVRCampaign'](_0x5c8aaf)&&utils['isIVRCampaignActive'](_0x5c8aaf)){_0x5c8aaf['sendMessageOneNotActive']=!![];Promise['resolve']()['then'](checkIsIVRCampaignActive(_0x5c8aaf))[_0x82c5('0x45')](checkInterval(_0x5c8aaf))[_0x82c5('0x45')](_0x3780f1[_0x82c5('0x98')](_0x5c8aaf))[_0x82c5('0x45')](_0x3780f1['checkIfTime'](_0x5c8aaf[_0x82c5('0xb7')],_0x5c8aaf[_0x82c5('0xb8')],_0x5c8aaf[_0x82c5('0x50')],_0x5c8aaf))[_0x82c5('0x45')](_0x3780f1['checkIfTimeIntervals'](_0x5c8aaf[_0x82c5('0x83')],_0x5c8aaf[_0x82c5('0xb8')],_0x5c8aaf['name'],_0x5c8aaf))[_0x82c5('0x45')](_0x3780f1['launchHandleIvr'](_0x5c8aaf))[_0x82c5('0xb3')](loggerCatchQueueSummary(_0x82c5('0xb9'),_0x5c8aaf));}else{notSendMessagesCampaign(_0x5c8aaf);}}}};Dialer[_0x82c5('0x1b')][_0x82c5('0xba')]=function(_0x110e55){if(_0x110e55['dialMethod']!==_0x82c5('0x8')){clearPredictiveAttributes(_0x110e55);}switch(_0x110e55[_0x82c5('0xbb')]){case'progressive':this[_0x82c5('0xbc')](_0x110e55,0x1);break;case _0x82c5('0xbd'):this[_0x82c5('0xbc')](_0x110e55,_0x110e55['dialPowerLevel']);break;case'predictive':this[_0x82c5('0x8')](_0x110e55);break;case _0x82c5('0x7'):this[_0x82c5('0xbc')](_0x110e55,0x1);break;default:logger[_0x82c5('0x70')]('Queue',_0x110e55[_0x82c5('0x50')],_0x82c5('0xbe'));}};Dialer[_0x82c5('0x1b')][_0x82c5('0xa2')]=function(_0x2eb41f,_0x3c156a){var _0x54e201=_0x2eb41f[_0x82c5('0xb8')];var _0x500cfe=_0x3c156a?_0x2eb41f[_0x82c5('0xb7')]:_0x2eb41f[_0x82c5('0x83')][_0x82c5('0x86')];logger[_0x82c5('0xbf')](_0x82c5('0xc0'),_0x500cfe,_0x54e201,_0x2eb41f['name'],util[_0x82c5('0x4e')](_0x82c5('0xc1'),_0x2eb41f[_0x82c5('0x50')],_0x2eb41f['id']));var _0x2dbd3a=null;return Interval[_0x82c5('0xc2')](_0x500cfe,_0x54e201)['then'](function(_0x1966d8){if(_0x1966d8===!![]){return _0x1966d8;}else{_0x2eb41f[_0x82c5('0x74')]=_0x3c156a?utils[_0x82c5('0x75')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x82c5('0x75')][_0x82c5('0xb1')];_0x2dbd3a=msgResponse(_0x82c5('0xc3'),'Failure',_0x82c5('0xc4')+_0x3c156a+'\x20'+_0x2eb41f['name']+'\x20Interval\x20is\x20overtime:\x20'+util[_0x82c5('0x4d')](_0x500cfe,{'showHidden':![],'depth':null})+_0x82c5('0xb2')+_0x54e201);}if(_0x2dbd3a!==null){logger['silly'](_0x82c5('0xc5'),_0x2dbd3a);_0x2dbd3a[_0x82c5('0xc6')]=_0x3c156a;throw _0x2dbd3a;}})[_0x82c5('0xb3')](function(_0x2bc5ec){logger[_0x82c5('0x70')](_0x82c5('0xc7'),_0x2bc5ec);throw msgResponse(_0x82c5('0xc8'),'Error',util['inspect'](_0x2bc5ec,{'showHidden':![],'depth':null}));});};Dialer[_0x82c5('0x1b')][_0x82c5('0x2f')]=function(_0x1ef18a){if(this[_0x82c5('0x20')][_0x1ef18a[_0x82c5('0xc9')]]){if(this[_0x82c5('0x27')][_0x1ef18a['uniqueid']]&&this[_0x82c5('0x27')][_0x1ef18a['uniqueid']]['type']!=='ivr'){this[_0x82c5('0xca')](this[_0x82c5('0x20')][_0x1ef18a[_0x82c5('0xc9')]]);this[_0x82c5('0x27')][_0x1ef18a[_0x82c5('0xcb')]][_0x82c5('0xcc')]=moment()[_0x82c5('0x4e')](_0x82c5('0xcd'));}}};Dialer['prototype']['syncAgentComplete']=function(_0x7f5ff6){var _0x395bf8=this['uniqueId'][_0x7f5ff6[_0x82c5('0xcb')]];if(this[_0x82c5('0x20')][_0x7f5ff6[_0x82c5('0xc9')]]){if(_0x395bf8&&_0x395bf8[_0x82c5('0x49')]!==_0x82c5('0xce')){delete this[_0x82c5('0x27')][_0x7f5ff6[_0x82c5('0xcb')]];this[_0x82c5('0x20')][_0x7f5ff6[_0x82c5('0xc9')]][_0x82c5('0xcf')]+=0x1;var _0x1ca973=new AgentComplete(_0x395bf8,_0x7f5ff6);if(_0x7f5ff6[_0x82c5('0xd0')]===_0x82c5('0xd1')){_0x1ca973[_0x82c5('0xd2')]=this[_0x82c5('0x20')][_0x7f5ff6[_0x82c5('0xc9')]][_0x82c5('0xd3')]&&this[_0x82c5('0x20')][_0x7f5ff6['queue']][_0x82c5('0xd4')]?moment()[_0x82c5('0x4e')](_0x82c5('0xcd')):undefined;}hopperUtils[_0x82c5('0xd5')](_0x1ca973)[_0x82c5('0xb3')](loggerCatch(_0x82c5('0xd6')));hopperUtils[_0x82c5('0xd7')](_0x1ca973)[_0x82c5('0xb3')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0x82c5('0x32')]=function(_0x5821a2){var _0x16fe8c=this['uniqueId'][_0x5821a2['uniqueid']];var _0x4bbf7d=this;var _0xf9646a=![];var _0x4464c1;var _0x75a8e0;if(this[_0x82c5('0x20')][_0x5821a2[_0x82c5('0xc9')]]){if(_0x16fe8c&&_0x16fe8c[_0x82c5('0x49')]!=='ivr'){delete this[_0x82c5('0x27')][_0x5821a2[_0x82c5('0xcb')]];this[_0x82c5('0xca')](this[_0x82c5('0x20')][_0x5821a2[_0x82c5('0xc9')]]);_0x16fe8c[_0x82c5('0xd8')]=moment()[_0x82c5('0x4e')](_0x82c5('0xcd'));var _0x2f5d30=new QueueCallerAbandon(_0x16fe8c,_0x5821a2);if(utils[_0x82c5('0x6d')](_0x16fe8c['droptime'],_0x16fe8c[_0x82c5('0xd9')])>=_0x16fe8c['dialQueueTimeout']){this[_0x82c5('0x20')][_0x5821a2['queue']][_0x82c5('0x5a')]+=0x1;this[_0x82c5('0x20')][_0x5821a2['queue']][_0x82c5('0xda')]+=0x1;this[_0x82c5('0x20')][_0x5821a2['queue']][_0x82c5('0xdb')]+=0x1;_0x2f5d30[_0x82c5('0x7b')]=0xa;_0x2f5d30[_0x82c5('0x7c')]=_0x82c5('0xdc');_0x2f5d30[_0x82c5('0xdd')]=_0x82c5('0xde');_0x2f5d30[_0x82c5('0xd2')]=this['voiceQueues'][_0x5821a2[_0x82c5('0xc9')]][_0x82c5('0xd3')]?moment()[_0x82c5('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x2f5d30[_0x82c5('0xdf')]+=0x1;_0x2f5d30[_0x82c5('0xe0')]+=0x1;_0x4464c1=this[_0x82c5('0x20')][_0x5821a2[_0x82c5('0xc9')]]['dialDropRetryFrequency'];_0x75a8e0=this['voiceQueues'][_0x5821a2[_0x82c5('0xc9')]][_0x82c5('0xe1')];hopperUtils[_0x82c5('0xe2')](_0x2f5d30,_0x2f5d30['state'],_0x16fe8c[_0x82c5('0xe3')])['then'](function(_0x20eb82){_0xf9646a=_0x20eb82['additional']==0x1;if(_0x2f5d30[_0x82c5('0xdf')]>=_0x4bbf7d['voiceQueues'][_0x5821a2[_0x82c5('0xc9')]][_0x82c5('0xe4')]){_0x4bbf7d[_0x82c5('0xe5')](_0x2f5d30,_0x20eb82[_0x82c5('0xe6')]);}else{hopperUtils[_0x82c5('0xe7')]({'active':![],'countdropretry':_0x2f5d30[_0x82c5('0xdf')],'scheduledat':moment()['add'](_0x4bbf7d['voiceQueues'][_0x5821a2[_0x82c5('0xc9')]][_0x82c5('0xe8')],'minutes')[_0x82c5('0x4e')](_0x82c5('0xcd')),'ContactId':_0x16fe8c[_0x82c5('0xe9')],'ListId':_0x16fe8c[_0x82c5('0xea')],'VoiceQueueId':_0x16fe8c[_0x82c5('0xeb')]||undefined,'CampaignId':_0x16fe8c['CampaignId']||undefined})[_0x82c5('0xb3')](loggerCatch(_0x82c5('0xec')));var _0x337fd8=new History(_0x2f5d30);_0x337fd8[_0x82c5('0x7b')]=0xa;_0x337fd8[_0x82c5('0x7c')]='Drop';_0x337fd8['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x337fd8['endtime']=_0x337fd8['starttime'];_0x337fd8[_0x82c5('0xed')]=_0x2f5d30['calleridname'];_0x337fd8[_0x82c5('0xee')]=_0x2f5d30['calleridnum'];hopperUtils[_0x82c5('0xd5')](_0x337fd8)[_0x82c5('0xb3')](loggerCatch(_0x82c5('0xef')));}})[_0x82c5('0x45')](function(){if(_0xf9646a)hopperUtils[_0x82c5('0xf0')](_0x2f5d30,_0x4464c1,_0x75a8e0)[_0x82c5('0x45')](function(){return 0x1;});});}else{this[_0x82c5('0x20')][_0x5821a2['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x82c5('0x20')][_0x5821a2['queue']][_0x82c5('0xf1')]+=0x1;_0x2f5d30[_0x82c5('0x7b')]=0xb;_0x2f5d30[_0x82c5('0x7c')]=_0x82c5('0xf2');_0x2f5d30[_0x82c5('0xdd')]=_0x82c5('0xf3');_0x2f5d30[_0x82c5('0xf4')]+=0x1;_0x2f5d30[_0x82c5('0xe0')]+=0x1;_0x4464c1=this[_0x82c5('0x20')][_0x5821a2[_0x82c5('0xc9')]][_0x82c5('0xf5')];_0x75a8e0=this[_0x82c5('0x20')][_0x5821a2['queue']][_0x82c5('0xe1')];hopperUtils[_0x82c5('0xe2')](_0x2f5d30,_0x2f5d30[_0x82c5('0x7b')],_0x16fe8c[_0x82c5('0xe3')])[_0x82c5('0x45')](function(_0x51fc14){if(_0x2f5d30[_0x82c5('0xf4')]>=_0x4bbf7d[_0x82c5('0x20')][_0x5821a2[_0x82c5('0xc9')]][_0x82c5('0xf6')]){_0x4bbf7d[_0x82c5('0xe5')](_0x2f5d30,_0x51fc14['additional']);}else{hopperUtils[_0x82c5('0xe7')]({'active':![],'countabandonedretry':_0x2f5d30[_0x82c5('0xf4')],'scheduledat':moment()[_0x82c5('0xf7')](_0x4bbf7d[_0x82c5('0x20')][_0x5821a2[_0x82c5('0xc9')]][_0x82c5('0xf5')],'minutes')[_0x82c5('0x4e')](_0x82c5('0xcd')),'ContactId':_0x16fe8c['ContactId'],'ListId':_0x16fe8c[_0x82c5('0xea')],'VoiceQueueId':_0x16fe8c[_0x82c5('0xeb')]||undefined,'CampaignId':_0x16fe8c[_0x82c5('0xf8')]||undefined})[_0x82c5('0xb3')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x34254d=new History(_0x2f5d30);_0x34254d[_0x82c5('0x7b')]=0xb;_0x34254d[_0x82c5('0x7c')]=_0x82c5('0xf2');_0x34254d[_0x82c5('0x7e')]=moment()[_0x82c5('0x4e')](_0x82c5('0xcd'));_0x34254d['endtime']=_0x34254d['starttime'];_0x34254d[_0x82c5('0xed')]=_0x2f5d30['calleridname'];_0x34254d[_0x82c5('0xee')]=_0x2f5d30['calleridnum'];hopperUtils[_0x82c5('0xd5')](_0x34254d)[_0x82c5('0xb3')](loggerCatch(_0x82c5('0xf9')));}})[_0x82c5('0x45')](function(){if(_0xf9646a)hopperUtils['swapAdditionalPhones'](_0x2f5d30,_0x4464c1,_0x75a8e0)[_0x82c5('0x45')](function(){return 0x1;});});}}}};Dialer[_0x82c5('0x1b')][_0x82c5('0x3c')]=function(_0x5177f4){if(this[_0x82c5('0x25')][_0x5177f4[_0x82c5('0xcb')]]){this['actions'][_0x5177f4[_0x82c5('0xcb')]][_0x82c5('0xfa')]=_0x5177f4['channel'];}if(this['uniqueId'][_0x5177f4[_0x82c5('0xcb')]]){this[_0x82c5('0x27')][_0x5177f4[_0x82c5('0xcb')]][_0x82c5('0xfa')]=_0x5177f4[_0x82c5('0xfa')];}};Dialer[_0x82c5('0x1b')][_0x82c5('0x3f')]=function(_0x15f2fb){if(!this[_0x82c5('0x25')][_0x15f2fb[_0x82c5('0xfb')]]){return;}var _0x46ac6b=this[_0x82c5('0x20')][this[_0x82c5('0x25')][_0x15f2fb[_0x82c5('0xfb')]][_0x82c5('0xc9')]][_0x82c5('0xfc')]||_0x82c5('0xfd');if(_0x46ac6b==='roundrobin'){if(this[_0x82c5('0x25')][_0x15f2fb['actionid']]&&_[_0x82c5('0xfe')](this[_0x82c5('0x25')][_0x15f2fb[_0x82c5('0xfb')]][_0x82c5('0xff')])&&_0x15f2fb['status']==='1'&&_0x15f2fb[_0x82c5('0x100')]==='0'){if(this[_0x82c5('0x22')][_0x15f2fb['stateinterface']]){if(!this[_0x82c5('0x22')][_0x15f2fb[_0x82c5('0x101')]][_0x82c5('0xff')]){this['agents'][_0x15f2fb[_0x82c5('0x101')]][_0x82c5('0xff')]=!![];this[_0x82c5('0x25')][_0x15f2fb[_0x82c5('0xfb')]][_0x82c5('0xff')]=!![];this[_0x82c5('0x25')][_0x15f2fb[_0x82c5('0xfb')]][_0x82c5('0x101')]=_0x15f2fb[_0x82c5('0x101')];}}}}else if(_0x46ac6b===_0x82c5('0xfd')){if(this[_0x82c5('0x25')][_0x15f2fb['actionid']]){if(this['agents'][_0x15f2fb[_0x82c5('0x101')]]){this['actions'][_0x15f2fb[_0x82c5('0xfb')]][_0x82c5('0x101')]=_0x15f2fb[_0x82c5('0x101')];if(_[_0x82c5('0xfe')](this['queueBooked'][this[_0x82c5('0x25')][_0x15f2fb[_0x82c5('0xfb')]]['queue']])){this['queueBooked'][this[_0x82c5('0x25')][_0x15f2fb['actionid']][_0x82c5('0xc9')]]=[];}this[_0x82c5('0x2b')][this[_0x82c5('0x25')][_0x15f2fb[_0x82c5('0xfb')]][_0x82c5('0xc9')]][_0x82c5('0xa8')](_[_0x82c5('0x102')](_[_0x82c5('0x82')](this[_0x82c5('0x25')][_0x15f2fb[_0x82c5('0xfb')]],['idHopper',_0x82c5('0x101')]),{'status':_0x15f2fb[_0x82c5('0x96')],'paused':_0x15f2fb[_0x82c5('0x100')]}));}}}};Dialer[_0x82c5('0x1b')][_0x82c5('0x41')]=function(_0x29694f){if(!this[_0x82c5('0x25')][_0x29694f['actionid']]){return;}var _0x5b3438=this;var _0x30c6df=this[_0x82c5('0x20')][this[_0x82c5('0x25')][_0x29694f[_0x82c5('0xfb')]][_0x82c5('0xc9')]];var _0x5394b5=_0x30c6df[_0x82c5('0xfc')]||'rrmemory';if(_0x5394b5===_0x82c5('0x103')){if(this[_0x82c5('0x25')][_0x29694f[_0x82c5('0xfb')]]&&this[_0x82c5('0x25')][_0x29694f[_0x82c5('0xfb')]][_0x82c5('0x101')]){this['preview'][_0x82c5('0x104')](this[_0x82c5('0x25')][_0x29694f[_0x82c5('0xfb')]][_0x82c5('0x105')],this[_0x82c5('0x25')][_0x29694f[_0x82c5('0xfb')]][_0x82c5('0x101')])[_0x82c5('0xb3')](function(_0x1d4d1e){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x82c5('0x4d')](_0x1d4d1e,{'showHidden':![],'depth':null}));})[_0x82c5('0x1e')](function(){_0x5b3438[_0x82c5('0xca')](_0x5b3438['voiceQueues'][_0x5b3438['actions'][_0x29694f[_0x82c5('0xfb')]][_0x82c5('0xc9')]]);_0x5b3438[_0x82c5('0x22')][_0x5b3438['actions'][_0x29694f['actionid']][_0x82c5('0x101')]][_0x82c5('0xff')]=![];delete _0x5b3438['actions'][_0x29694f[_0x82c5('0xfb')]];unlockQueueStatus(_0x30c6df);});}else{this[_0x82c5('0xca')](this[_0x82c5('0x20')][this[_0x82c5('0x25')][_0x29694f[_0x82c5('0xfb')]][_0x82c5('0xc9')]]);hopperUtils[_0x82c5('0xe7')]({'active':![],'ContactId':this[_0x82c5('0x25')][_0x29694f[_0x82c5('0xfb')]]['ContactId'],'ListId':this[_0x82c5('0x25')][_0x29694f['actionid']]['ListId'],'VoiceQueueId':this['actions'][_0x29694f[_0x82c5('0xfb')]][_0x82c5('0xeb')]||undefined,'CampaignId':this['actions'][_0x29694f[_0x82c5('0xfb')]][_0x82c5('0xf8')]||undefined})[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x106')));delete this[_0x82c5('0x25')][_0x29694f[_0x82c5('0xfb')]];unlockQueueStatus(_0x30c6df);}}else if(_0x5394b5===_0x82c5('0xfd')){var _0x25b4d5;if(this[_0x82c5('0x25')][_0x29694f[_0x82c5('0xfb')]]&&!_[_0x82c5('0x52')](this['queueBooked'][this[_0x82c5('0x25')][_0x29694f[_0x82c5('0xfb')]][_0x82c5('0xc9')]])){if(this[_0x82c5('0x2c')][_0x5b3438[_0x82c5('0x25')][_0x29694f[_0x82c5('0xfb')]][_0x82c5('0xc9')]]){this[_0x82c5('0x2c')][_0x5b3438[_0x82c5('0x25')][_0x29694f['actionid']][_0x82c5('0xc9')]]=this[_0x82c5('0x2c')][this[_0x82c5('0x25')][_0x29694f[_0x82c5('0xfb')]][_0x82c5('0xc9')]]?this[_0x82c5('0x2c')][this['actions'][_0x29694f[_0x82c5('0xfb')]]['queue']]:this[_0x82c5('0x2b')][this[_0x82c5('0x25')][_0x29694f[_0x82c5('0xfb')]][_0x82c5('0xc9')]]?this['queueBooked'][this[_0x82c5('0x25')][_0x29694f[_0x82c5('0xfb')]][_0x82c5('0xc9')]]['_rr']||0x0:0x0;}this['queueBooked'][this[_0x82c5('0x25')][_0x29694f[_0x82c5('0xfb')]][_0x82c5('0xc9')]]['_rr']=this[_0x82c5('0x2c')][this[_0x82c5('0x25')][_0x29694f[_0x82c5('0xfb')]][_0x82c5('0xc9')]];for(var _0x44ac6d=0x0;_0x44ac6d=_0x4399ca[_0x82c5('0x12d')]){_0x3a904c[_0x82c5('0x12e')](_0x5dedeb,_0x36fe40,_0x21eb10,_0x82c5('0x12f'));}else{if(_0x5dedeb['countmachineretry']>=_0x4399ca['dialMachineMaxRetry']){_0x3a904c[_0x82c5('0x130')](_0x5dedeb,_0x36fe40,_0x21eb10,_0x82c5('0x131'));}else{hopperUtils[_0x82c5('0xe7')]({'active':![],'countmachineretry':_0x5dedeb['countmachineretry'],'scheduledat':moment()[_0x82c5('0xf7')](_0x4399ca[_0x82c5('0x132')],_0x82c5('0x133'))[_0x82c5('0x4e')](_0x82c5('0xcd')),'ContactId':_0x5dedeb[_0x82c5('0xe9')],'ListId':_0x5dedeb[_0x82c5('0xea')],'VoiceQueueId':_0x5dedeb[_0x82c5('0xeb')]||undefined,'CampaignId':_0x5dedeb['CampaignId']||undefined})[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x134')));_0x36fe40({'reschedule':0x1});}}});}if(_0x4de2a0[_0x82c5('0x49')]===_0x82c5('0xce')&&this[_0x82c5('0x21')][_0x4de2a0[_0x82c5('0xc9')]]['dialAMDActive']&&_0x360b85[_0x82c5('0x11c')]===_0x82c5('0x11d')){delete this[_0x82c5('0x27')][_0x360b85['uniqueid']];this[_0x82c5('0xca')](this[_0x82c5('0x21')][_0x4de2a0[_0x82c5('0xc9')]]);_0x633386=new Hangup(_0x4de2a0,_0x360b85);_0x633386[_0x82c5('0x7b')]=0x12;_0x633386[_0x82c5('0x7c')]=_0x82c5('0x135');_0x633386[_0x82c5('0x11f')]=_0x82c5('0x126');ami[_0x82c5('0x48')](_0x82c5('0x120'),ut['buildObj'](_0x633386,'amd'));this['saveInDb'](_0x633386,_0x82c5('0x136'),'[syncHangupInAMDIvr]');}if(_0x4de2a0[_0x82c5('0x49')]===_0x82c5('0xce')&&this[_0x82c5('0x21')][_0x4de2a0[_0x82c5('0xc9')]][_0x82c5('0x11b')]&&_0x360b85[_0x82c5('0x11c')]===_0x82c5('0x125')){return new Promise(function(_0x594373,_0x1cbb58){delete _0x3a904c[_0x82c5('0x27')][_0x360b85[_0x82c5('0xcb')]];_0x3a904c[_0x82c5('0xca')](_0x3a904c['campaigns'][_0x4de2a0[_0x82c5('0xc9')]]);_0x3a904c[_0x82c5('0x21')][_0x4de2a0[_0x82c5('0xc9')]][_0x82c5('0xcf')]+=0x1;_0x3a904c[_0x82c5('0x21')][_0x4de2a0[_0x82c5('0xc9')]][_0x82c5('0x11e')]+=0x1;var _0x5c8290=_0x3a904c[_0x82c5('0x21')][_0x4de2a0['queue']];var _0x171f44=new Hangup(_0x4de2a0,_0x360b85);_0x171f44[_0x82c5('0x7b')]=0x13;_0x171f44[_0x82c5('0x7c')]=_0x82c5('0x137');_0x171f44['membername']=_0x82c5('0x126');_0x171f44[_0x82c5('0x127')]+=0x1;_0x171f44['countglobal']+=0x1;_0x171f44[_0x82c5('0x122')]=!![];ami[_0x82c5('0x48')](_0x82c5('0x120'),ut['buildObj'](_0x171f44,_0x82c5('0x122')));hopperUtils[_0x82c5('0xd5')](_0x171f44)[_0x82c5('0xb3')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x171f44[_0x82c5('0x138')]+_0x171f44['countcongestionretry']+_0x171f44[_0x82c5('0x12a')]+_0x171f44[_0x82c5('0x12b')]+_0x171f44['countdropretry']+_0x171f44[_0x82c5('0xf4')]+_0x171f44[_0x82c5('0x127')]+_0x171f44[_0x82c5('0x12c')]>=_0x5c8290[_0x82c5('0x12d')]){_0x3a904c[_0x82c5('0x12e')](_0x171f44,_0x594373,_0x1cbb58,_0x82c5('0x12f'));}else{if(_0x171f44[_0x82c5('0x127')]>=_0x5c8290[_0x82c5('0x139')]){_0x3a904c[_0x82c5('0x130')](_0x171f44,_0x594373,_0x1cbb58,_0x82c5('0x131'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x171f44[_0x82c5('0x127')],'scheduledat':moment()[_0x82c5('0xf7')](_0x5c8290[_0x82c5('0x132')],_0x82c5('0x133'))[_0x82c5('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x171f44[_0x82c5('0xe9')],'ListId':_0x171f44['ListId'],'VoiceQueueId':_0x171f44[_0x82c5('0xeb')]||undefined,'CampaignId':_0x171f44[_0x82c5('0xf8')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x594373({'reschedule':0x1});}}});}}};Dialer[_0x82c5('0x1b')][_0x82c5('0x3a')]=function(_0xcb3528){var _0x47e6e5=this['uniqueId'][_0xcb3528[_0x82c5('0xcb')]];var _0x23d0ce;if(_0x47e6e5&&_0x47e6e5['type']===_0x82c5('0xce')){delete this[_0x82c5('0x27')][_0xcb3528[_0x82c5('0xcb')]];this[_0x82c5('0xca')](this['campaigns'][_0x47e6e5['queue']]);this[_0x82c5('0x21')][_0x47e6e5[_0x82c5('0xc9')]][_0x82c5('0x13a')]+=0x1;_0x23d0ce=new Hangup(_0x47e6e5,_0xcb3528);hopperUtils[_0x82c5('0xd5')](_0x23d0ce)[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x13b')));hopperUtils[_0x82c5('0xd7')](_0x23d0ce)['catch'](loggerCatch(_0x82c5('0x13c')));}if(_0x47e6e5&&_0x47e6e5['type']!=='ivr'&&isNotNull(this['voiceQueues'][_0x47e6e5[_0x82c5('0xc9')]][_0x82c5('0x13d')])){delete this[_0x82c5('0x27')][_0xcb3528[_0x82c5('0xcb')]];this[_0x82c5('0xca')](this['voiceQueues'][_0x47e6e5['queue']]);this[_0x82c5('0x20')][_0x47e6e5[_0x82c5('0xc9')]]['outboundAnswerCallsDay']+=0x1;this[_0x82c5('0x20')][_0x47e6e5[_0x82c5('0xc9')]][_0x82c5('0x11e')]+=0x1;_0x23d0ce=new Hangup(_0x47e6e5,_0xcb3528);_0x23d0ce['state']=0x10;_0x23d0ce[_0x82c5('0x7c')]=_0x82c5('0x13e');_0x23d0ce[_0x82c5('0x11f')]=_0x82c5('0x13f');hopperUtils[_0x82c5('0xd5')](_0x23d0ce)[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x13b')));hopperUtils['moveContactManagedDialer'](_0x23d0ce)[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x13c')));}if(_0x47e6e5&&_0x47e6e5[_0x82c5('0x49')]!==_0x82c5('0xce')&&!isNotNull(this[_0x82c5('0x20')][_0x47e6e5[_0x82c5('0xc9')]][_0x82c5('0x13d')])){if(_0xcb3528[_0x82c5('0x140')]===_0x82c5('0x141')){delete this[_0x82c5('0x27')][_0xcb3528[_0x82c5('0xcb')]];this['voiceQueues'][_0x47e6e5[_0x82c5('0xc9')]]['outboundAnswerCallsDay']+=0x1;const _0x3ee1ad=new AgentComplete(_0x47e6e5,_0xcb3528);_0x3ee1ad['CampaignId']=this[_0x82c5('0x20')][_0x47e6e5['queue']]['id'];hopperUtils[_0x82c5('0xd5')](_0x3ee1ad)['catch'](loggerCatch(_0x82c5('0xd6')));hopperUtils[_0x82c5('0xd7')](_0x3ee1ad)[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x142')));}else{delete this[_0x82c5('0x27')][_0xcb3528['uniqueid']];this['updateOriginated'](this[_0x82c5('0x20')][_0x47e6e5[_0x82c5('0xc9')]]);this['voiceQueues'][_0x47e6e5[_0x82c5('0xc9')]][_0x82c5('0x143')]+=0x1;_0x23d0ce=new Hangup(_0x47e6e5,_0xcb3528);_0x23d0ce[_0x82c5('0x7b')]=0xc;_0x23d0ce['statedesc']=_0xcb3528[_0x82c5('0x140')];_0x23d0ce[_0x82c5('0x11f')]='Unknow';hopperUtils['createHistory'](_0x23d0ce)[_0x82c5('0xb3')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x82c5('0xd7')](_0x23d0ce)[_0x82c5('0xb3')](loggerCatch('[syncHangupIvr]'));}}};Dialer[_0x82c5('0x1b')][_0x82c5('0x37')]=function(_0x388d01){var _0x2f9768=this;if(!_0x2f9768[_0x82c5('0x2d')][_0x388d01[_0x82c5('0x50')]]){_0x2f9768[_0x82c5('0x2d')][_0x388d01[_0x82c5('0x50')]]={'running':![]};}else if(_0x2f9768[_0x82c5('0x2d')][_0x388d01['name']][_0x82c5('0x144')]===!![]){return;}else if(_0x2f9768[_0x82c5('0x2d')][_0x388d01[_0x82c5('0x50')]]['running']===![]){_0x2f9768[_0x82c5('0x2d')][_0x388d01[_0x82c5('0x50')]][_0x82c5('0x144')]=!![];}var _0x2d504d=_0x2f9768[_0x82c5('0x20')][_0x388d01['name']];var _0x41b009=_0x2d504d[_0x82c5('0x74')]!==utils['CAMPAIGN_STATUS'][_0x82c5('0x88')];var _0x2b50c5=utils[_0x82c5('0x145')](_0x2d504d);_0x2d504d[_0x82c5('0x146')]=utils[_0x82c5('0x147')](_0x2d504d,_0x2f9768[_0x82c5('0x23')]);Promise[_0x82c5('0x148')]()[_0x82c5('0x45')](function(){if(_0x2d504d['statusMessage']===utils[_0x82c5('0x75')][_0x82c5('0x88')]){if(_0x41b009){clearPredictiveAttributes(_0x2d504d);_0x388d01[_0x82c5('0x29')]=undefined;_0x388d01[_0x82c5('0x2a')]=undefined;}if(_0x2d504d[_0x82c5('0x146')]===utils[_0x82c5('0x75')][_0x82c5('0x88')]){_0x388d01[_0x82c5('0x149')]=0x0;_0x388d01[_0x82c5('0x100')]=0x0;_0x388d01[_0x82c5('0x14a')]=0x0;_0x388d01['talking']=0x0;_0x388d01[_0x82c5('0x14b')]=0x0;}}else if(_0x2d504d[_0x82c5('0x146')]===utils[_0x82c5('0x75')][_0x82c5('0x14c')]&&!_0x2b50c5){return _0x2f9768['ifTime'](_0x2d504d,!![])[_0x82c5('0x45')](function(){return _0x2f9768['ifTime'](_0x2d504d,![]);})[_0x82c5('0x45')](function(){return _0x2f9768['checkDialMethod'](_0x2d504d);})[_0x82c5('0xb3')](function(_0x4f6272){loggerSyncQueueSummary['debug'](_0x82c5('0x14d'),util[_0x82c5('0x4d')](_0x4f6272,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x2d504d);});}else{clearPredictiveAttributes(_0x2d504d);}})[_0x82c5('0x45')](function(){var _0x3c3af3=_0x388d01[_0x82c5('0x14e')](_0x2d504d);if(_0x3c3af3||_0x2d504d[_0x82c5('0x14f')]){_0x2d504d[_0x82c5('0x14f')]=![];_0x388d01['updateReportFromOutboundQueue'](_0x2d504d);Object[_0x82c5('0x150')](_0x2d504d,_0x388d01);emitOutboundVoiceQueueSummary(_0x388d01);}_0x2f9768[_0x82c5('0x2d')][_0x2d504d[_0x82c5('0x50')]][_0x82c5('0x144')]=![];})[_0x82c5('0xb3')](function(_0x50b70e){logger[_0x82c5('0x70')](_0x82c5('0x14d'),util[_0x82c5('0x4d')](_0x50b70e,{'showHidden':![],'depth':null}));_0x2f9768[_0x82c5('0x2d')][_0x2d504d[_0x82c5('0x50')]]['running']=![];});};Dialer[_0x82c5('0x1b')]['syncQueueSummaryComplete']=_[_0x82c5('0x151')](function(){var _0x4f117a=_[_0x82c5('0x152')](this[_0x82c5('0x20')],function(_0x5e76f8){return _0x5e76f8[_0x82c5('0x153')];});var _0x2d5c94=_[_0x82c5('0x152')](this[_0x82c5('0x22')],function(_0x1ded9a){return _0x1ded9a[_0x82c5('0x154')]&&_0x1ded9a[_0x82c5('0x96')]===_0x82c5('0x95');});if(_0x4f117a[_0x82c5('0xa7')]>0x0&&_0x2d5c94[_0x82c5('0xa7')]>0x0){return Promise[_0x82c5('0x148')]()[_0x82c5('0x45')](cmHopper[_0x82c5('0x155')](_['map'](_0x4f117a,'id'),previewRecallmeReminderInterval,_[_0x82c5('0x156')](_0x2d5c94,'id')))['then'](function(_0x83b9f4){for(var _0x241cab=0x0;_0x241cab<_0x83b9f4[_0x82c5('0xa7')];_0x241cab++){var _0xc14b51=_0x83b9f4[_0x241cab][_0x82c5('0x157')][_0x82c5('0x50')];if(_0xc14b51)io['to'](util[_0x82c5('0x4e')](_0x82c5('0x158'),_0xc14b51))[_0x82c5('0x48')](_0x82c5('0x159'),{'hopper':_0x83b9f4[_0x241cab]});}})[_0x82c5('0xb3')](function(_0x19f732){logger[_0x82c5('0x70')](_0x82c5('0x15a'),_0x19f732);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x82c5('0x1b')]['loopClearZombieChannels']=function(){var _0x2238c7=this;setInterval(function(){_0x2238c7[_0x82c5('0x15b')](_0x2238c7[_0x82c5('0x27')],_0x82c5('0x15c'));_0x2238c7[_0x82c5('0x15b')](_0x2238c7[_0x82c5('0x25')],_0x82c5('0x15d'));},0x32c8);};Dialer[_0x82c5('0x1b')]['clearZombieChannels']=function(_0x49b486,_0x380d82){var _0x44060d=this;for(var _0x26ded4 in _0x49b486){if(typeof _0x49b486[_0x26ded4]!==_0x82c5('0xb6')){this['sequence'][_0x82c5('0x1c')](function(){if(!_['isNil'](_0x49b486[_0x26ded4])){return ami[_0x82c5('0xad')]({'action':_0x82c5('0x96'),'channel':_0x49b486[_0x26ded4][_0x82c5('0xfa')]})[_0x82c5('0xb3')](function(_0x2f71c5){if(_0x2f71c5[_0x82c5('0x74')]===_0x82c5('0x15e')){setTimeout(function(){if(_0x49b486[_0x26ded4]&&_0x49b486[_0x26ded4][_0x82c5('0x49')]!==_0x82c5('0xce')){_0x44060d['updateOriginated'](_0x44060d[_0x82c5('0x20')][_0x49b486[_0x26ded4]['queue']]);logger[_0x82c5('0x70')](_0x82c5('0x15f'),_0x380d82,_0x26ded4,_0x49b486[_0x26ded4]['queue']);delete _0x49b486[_0x26ded4];}if(_0x49b486[_0x26ded4]&&_0x49b486[_0x26ded4][_0x82c5('0x49')]===_0x82c5('0xce')){_0x44060d[_0x82c5('0xca')](_0x44060d['campaigns'][_0x49b486[_0x26ded4]['queue']]);logger[_0x82c5('0x70')](_0x82c5('0x160'),_0x380d82,_0x26ded4,_0x49b486[_0x26ded4][_0x82c5('0xc9')]);delete _0x49b486[_0x26ded4];}},0x2328);}});}});}}};Dialer[_0x82c5('0x1b')][_0x82c5('0x161')]=function(_0xc9970a){return Promise[_0x82c5('0x148')]()[_0x82c5('0x45')](voiceQueueRt['getVoiceQueueRtPauses'](_0xc9970a))[_0x82c5('0xb3')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x82c5('0x1b')]['updateOriginated']=function(_0xe1ef90){if(!_['isUndefined'](_0xe1ef90)&&_0xe1ef90!==null){if(typeof _0xe1ef90[_0x82c5('0x162')]!=='undefined'){if(_0xe1ef90['originated']>0x0){_0xe1ef90[_0x82c5('0x162')]-=0x1;}else{logger[_0x82c5('0x70')](_0x82c5('0x163'));}}}else{logger['error'](_0x82c5('0x164'));}};Dialer[_0x82c5('0x1b')][_0x82c5('0x165')]=function(_0x3dd796,_0x4187c0){var _0x52cd63=this;return function(_0x2014c5){_0x52cd63[_0x82c5('0xca')](_0x4187c0);logger['error'](_0x3dd796,util[_0x82c5('0x4d')](_0x2014c5,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x82c5('0x166')]=function(_0x2b990f,_0x2b6e51,_0x259b77){var _0x19ed40={'state':0x19,'statedesc':_0x82c5('0x167')};this[_0x82c5('0xca')](_0x2b6e51);this['saveInDb'](_[_0x82c5('0x102')](_0x19ed40,_[_0x82c5('0x82')](_0x259b77,[_0x82c5('0xe9'),_0x82c5('0xea'),_0x82c5('0x168'),_0x82c5('0xeb'),_0x82c5('0xf8')])),'[emptyContact][createHistory]',_0x82c5('0x169'));logger[_0x82c5('0x70')](_0x2b990f);};Dialer[_0x82c5('0x1b')][_0x82c5('0x123')]=function(_0x31aa3a,_0x2980f4,_0x5761e7){hopperUtils[_0x82c5('0xd5')](_0x31aa3a)[_0x82c5('0xb3')](loggerCatch(_0x2980f4));hopperUtils[_0x82c5('0xd7')](_0x31aa3a)['catch'](loggerCatch(_0x5761e7));};Dialer[_0x82c5('0x1b')][_0x82c5('0xe5')]=function(_0x1cfa16,_0x427119){hopperUtils['createHistory'](_0x1cfa16)['catch'](loggerCatch(_0x82c5('0xd6')));if(_0x427119==0x0){hopperUtils[_0x82c5('0xd7')](_0x1cfa16)[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x16a')));}};Dialer[_0x82c5('0x1b')][_0x82c5('0x15a')]=function(_0x1877a6){return Promise[_0x82c5('0x148')]()[_0x82c5('0x45')](cmHopper[_0x82c5('0x155')](_0x1877a6['id'],previewRecallmeReminderInterval))[_0x82c5('0x45')](function(_0x1b1835){for(var _0x29592e=0x0;_0x29592e<_0x1b1835[_0x82c5('0xa7')];_0x29592e++){var _0x571744=_0x1b1835[_0x29592e][_0x82c5('0x157')]['name'];if(_0x571744)io['to'](util[_0x82c5('0x4e')](_0x82c5('0x158'),_0x571744))[_0x82c5('0x48')]('user:dialPreviewRecallReminder',{'hopper':_0x1b1835[_0x29592e]});}})[_0x82c5('0xb3')](function(){});};Dialer[_0x82c5('0x1b')][_0x82c5('0x16b')]=function(_0x5d9fe2){var _0x4c4c8c=this;return function(){_0x4c4c8c['handleIvr'](_0x5d9fe2);};};Dialer[_0x82c5('0x1b')][_0x82c5('0x16c')]=function(_0x145f01,_0xb04ee1){var _0x2d986f=this;var _0x5af45b=uuid['v4']();this[_0x82c5('0x25')][_0x5af45b]=new Action(_0x145f01,_0xb04ee1,_0x5af45b);return new Promise(function(_0x21e211,_0x11958a){if(_['isUndefined'](_0x145f01)&&typeof _0x145f01!==_0x82c5('0x16d')){return _0x11958a(msgResponse(_0x82c5('0x16e'),'Failure','voiceQueue\x20is\x20undefine'));}if(_[_0x82c5('0x47')](_0xb04ee1[_0x82c5('0x16f')])||_0xb04ee1['phone']===null){return _0x11958a(msgResponse(_0x82c5('0x16e'),_0x82c5('0xa0'),_0x82c5('0x170')));}var _0x5c44a1={'XMD-CALLERID':_0x2d986f[_0x82c5('0x25')][_0x5af45b][_0x82c5('0x171')](),'XMD-AGI':_0x145f01[_0x82c5('0x13d')]?util[_0x82c5('0x4e')](_0x82c5('0x172'),ipAgi,_0x145f01['dialQueueProject']):_0x82c5('0x173'),'XMD-AGIAFTER':_0x145f01['dialQueueProject2']?util['format'](_0x82c5('0x172'),ipAgi,_0x145f01['dialQueueProject2']):_0x82c5('0x173'),'XMD-QUEUE':utils[_0x82c5('0x174')](_0x145f01)?util[_0x82c5('0x4e')](_0x82c5('0x175'),_0x145f01[_0x82c5('0x50')],_0x145f01[_0x82c5('0x176')]||'',_0x145f01[_0x82c5('0xd4')]?'c':'',_0x145f01[_0x82c5('0x177')]||0x3):'NONE','XMD-CONTACTID':_0xb04ee1[_0x82c5('0xe9')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2d986f[_0x82c5('0x25')][_0x5af45b][_0x82c5('0x171')](),'XMD-AMD':_0x145f01[_0x82c5('0x11b')]?'ACTIVE':_0x82c5('0x173'),'XMD-DESTINATION':_0x82c5('0x11a')};if(_0x145f01['dialAMDActive']){_0x5c44a1['XMD-AMDINITIALSILENCE']=_0x145f01['dialAMDInitialSilence']||0x9c4;_0x5c44a1[_0x82c5('0x178')]=_0x145f01[_0x82c5('0x179')]||0x5dc;_0x5c44a1[_0x82c5('0x17a')]=_0x145f01['dialAMDAfterGreetingSilence']||0x320;_0x5c44a1['XMD-AMDTOTALANALYSISTIME']=_0x145f01['dialAMDTotalAnalysisTime']||0x1388;_0x5c44a1[_0x82c5('0x17b')]=_0x145f01[_0x82c5('0x17c')]||0x64;_0x5c44a1[_0x82c5('0x17d')]=_0x145f01[_0x82c5('0x17e')]||0x32;_0x5c44a1['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x145f01[_0x82c5('0x17f')]||0x3;_0x5c44a1['XMD-AMDSILENCETHRESHOLD']=_0x145f01[_0x82c5('0x180')]||0x100;_0x5c44a1[_0x82c5('0x181')]=_0x145f01[_0x82c5('0x182')]||0x1388;}if(utils['isOutboundQueue'](_0x145f01)){_0x5c44a1[_0x82c5('0x183')]=_0xb04ee1[_0x82c5('0xeb')];}else{_0x5c44a1[_0x82c5('0x184')]=_0xb04ee1[_0x82c5('0xf8')];}var _0x43777c=utils[_0x82c5('0x185')](_0xb04ee1[_0x82c5('0x186')]);Object[_0x82c5('0x150')](_0x5c44a1,_0x43777c);var _0x13ece3=_0x2d986f[_0x82c5('0x93')](_0x145f01[_0x82c5('0x99')])?utils['getCallerId'](_0x145f01['Trunk'][_0x82c5('0x187')],_0x145f01['dialOriginateCallerIdName'],_0x145f01[_0x82c5('0x188')]>0x0?utils['getCallerIdRandom'](_0x145f01[_0x82c5('0x189')],_0x145f01[_0x82c5('0x188')]):_0x145f01[_0x82c5('0x189')]):utils['getCallerId'](_[_0x82c5('0xfe')](_0x145f01[_0x82c5('0x9a')])?_0x145f01[_0x82c5('0x99')][_0x82c5('0x187')]:_0x145f01[_0x82c5('0x9a')]['callerid'],_0x145f01['dialOriginateCallerIdName'],_0x145f01['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x82c5('0x18a')](_0x145f01[_0x82c5('0x189')],_0x145f01[_0x82c5('0x188')]):_0x145f01[_0x82c5('0x189')]);if(_0x13ece3){_0x5c44a1[_0x82c5('0x18b')]=_0x2d986f['actions'][_0x5af45b][_0x82c5('0x18c')]=utils[_0x82c5('0x18d')](_0x13ece3);_0x5c44a1[_0x82c5('0x18e')]=_0xb04ee1[_0x82c5('0x16f')];}_0x145f01[_0x82c5('0x18f')]=_0x5c44a1;return ami[_0x82c5('0xad')]({'actionid':_0x5af45b,'action':_0x82c5('0x16e'),'channel':_0x2d986f[_0x82c5('0x93')](_0x145f01[_0x82c5('0x99')])?util[_0x82c5('0x4e')]('SIP/%s/%s%s',_0x145f01[_0x82c5('0x99')][_0x82c5('0x50')],isNotNull(_0x145f01[_0x82c5('0x190')])?_0x145f01[_0x82c5('0x190')][_0x82c5('0x191')]()||'':'',_0x145f01[_0x82c5('0x192')]>0x0?_0xb04ee1[_0x82c5('0x16f')]['substring'](_0x145f01[_0x82c5('0x192')]):_0xb04ee1[_0x82c5('0x16f')]):util[_0x82c5('0x4e')](_0x82c5('0x193'),_[_0x82c5('0xfe')](_0x145f01[_0x82c5('0x9a')])?_0x145f01[_0x82c5('0x99')][_0x82c5('0x50')]:_0x145f01[_0x82c5('0x9a')][_0x82c5('0x50')],isNotNull(_0x145f01['dialPrefix'])?_0x145f01[_0x82c5('0x190')][_0x82c5('0x191')]()||'':'',_0x145f01[_0x82c5('0x192')]>0x0?_0xb04ee1[_0x82c5('0x16f')][_0x82c5('0x194')](_0x145f01['dialCutDigit']):_0xb04ee1['phone']),'callerid':_0x13ece3,'Exten':'xcally-motion-dialer','Context':_0x82c5('0x195'),'Priority':'1','variable':_0x5c44a1,'timeout':(_0x145f01[_0x82c5('0x196')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5af45b})[_0x82c5('0x45')](function(_0x598db1){return _0x21e211(_0x598db1);})['catch'](function(_0xf2ab8c){_0x145f01[_0x82c5('0x197')]+=0x1;var _0x57c785=new History(_0x2d986f[_0x82c5('0x25')][_0x5af45b]);logger[_0x82c5('0x70')](util[_0x82c5('0x4e')]('[originateError]:\x20%s',JSON[_0x82c5('0x92')](_0xf2ab8c)));_0x57c785[_0x82c5('0x7b')]=0xe;_0x57c785['statedesc']=_0x82c5('0x198');_0x57c785[_0x82c5('0x7e')]=moment()[_0x82c5('0x4e')](_0x82c5('0xcd'));_0x57c785[_0x82c5('0x7d')]=_0x57c785[_0x82c5('0x7e')];hopperUtils[_0x82c5('0xd5')](_0x57c785)[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x199')));_0x2d986f[_0x82c5('0xd7')](_0x57c785)['catch'](loggerCatch(_0x82c5('0x199')))[_0x82c5('0x1e')](function(){delete _0x2d986f[_0x82c5('0x25')][_0x5af45b];return _0x11958a(msgResponse(_0x82c5('0x16e'),_0x82c5('0x91'),_0x82c5('0x19a')));});});});};Dialer['prototype'][_0x82c5('0x19b')]=function(_0x41f7ff,_0xc7fe27,_0x84eab1){var _0x50f961=new History(_0xc7fe27);if(_0x50f961[_0x82c5('0x138')]+_0x50f961['countcongestionretry']+_0x50f961['countnoanswerretry']+_0x50f961['countnosuchnumberretry']+_0x50f961[_0x82c5('0xdf')]+_0x50f961[_0x82c5('0xf4')]+_0x50f961[_0x82c5('0x127')]+_0x50f961[_0x82c5('0x12c')]>=_0x84eab1['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x41f7ff){case 0x3:if(_0x50f961[_0x82c5('0x12a')]>=_0x84eab1[_0x82c5('0x19c')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x50f961['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x82c5('0xf7')](_0x84eab1[_0x82c5('0x19d')],_0x82c5('0x133'))[_0x82c5('0x4e')](_0x82c5('0xcd')),'ContactId':_0x50f961[_0x82c5('0xe9')],'ListId':_0x50f961[_0x82c5('0xea')],'VoiceQueueId':_0x50f961[_0x82c5('0xeb')]||undefined,'CampaignId':_0x50f961[_0x82c5('0xf8')]||undefined})[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x19e')));break;case 0x5:if(_0x50f961['countbusyretry']>=_0x84eab1['dialBusyMaxRetry']-0x1){return!![];}hopperUtils[_0x82c5('0xe7')]({'active':![],'countbusyretry':_0x50f961['countbusyretry']+=0x1,'scheduledat':moment()[_0x82c5('0xf7')](_0x84eab1[_0x82c5('0x19f')],_0x82c5('0x133'))[_0x82c5('0x4e')](_0x82c5('0xcd')),'ContactId':_0x50f961[_0x82c5('0xe9')],'ListId':_0x50f961['ListId'],'VoiceQueueId':_0x50f961[_0x82c5('0xeb')]||undefined,'CampaignId':_0x50f961[_0x82c5('0xf8')]||undefined})['catch'](loggerCatch(_0x82c5('0x1a0')));break;case 0x8:if(_0x50f961[_0x82c5('0x129')]>=_0x84eab1[_0x82c5('0x1a1')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x50f961['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x84eab1['dialCongestionRetryFrequency'],_0x82c5('0x133'))['format'](_0x82c5('0xcd')),'ContactId':_0x50f961[_0x82c5('0xe9')],'ListId':_0x50f961['ListId'],'VoiceQueueId':_0x50f961[_0x82c5('0xeb')]||undefined,'CampaignId':_0x50f961['CampaignId']||undefined})[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x1a2')));break;case 0x0:if(_0x50f961[_0x82c5('0x12b')]>=_0x84eab1[_0x82c5('0x1a3')]-0x1){return!![];}else{hopperUtils[_0x82c5('0xe7')]({'active':![],'countnosuchnumberretry':_0x50f961[_0x82c5('0x12b')]+=0x1,'scheduledat':moment()[_0x82c5('0xf7')](_0x84eab1[_0x82c5('0x1a4')],_0x82c5('0x133'))[_0x82c5('0x4e')](_0x82c5('0xcd')),'ContactId':_0x50f961[_0x82c5('0xe9')],'ListId':_0x50f961[_0x82c5('0xea')],'VoiceQueueId':_0x50f961[_0x82c5('0xeb')]||undefined,'CampaignId':_0x50f961[_0x82c5('0xf8')]||undefined})[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x1a5')));}break;case 0xa:if(_0x50f961[_0x82c5('0xdf')]>=_0x84eab1['dialDropMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x50f961[_0x82c5('0xdf')]+=0x1,'scheduledat':moment()[_0x82c5('0xf7')](_0x84eab1[_0x82c5('0xe8')],_0x82c5('0x133'))[_0x82c5('0x4e')](_0x82c5('0xcd')),'ContactId':_0x50f961[_0x82c5('0xe9')],'ListId':_0x50f961[_0x82c5('0xea')],'VoiceQueueId':_0x50f961[_0x82c5('0xeb')]||undefined,'CampaignId':_0x50f961['CampaignId']||undefined})[_0x82c5('0xb3')](loggerCatch(_0x82c5('0xec')));break;case 0xb:if(_0x50f961[_0x82c5('0xf4')]>=_0x84eab1[_0x82c5('0xf6')]-0x1){return!![];}hopperUtils[_0x82c5('0xe7')]({'active':![],'countabandonedretry':_0x50f961[_0x82c5('0xf4')]+=0x1,'scheduledat':moment()[_0x82c5('0xf7')](_0x84eab1[_0x82c5('0xf5')],_0x82c5('0x133'))[_0x82c5('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x50f961[_0x82c5('0xe9')],'ListId':_0x50f961[_0x82c5('0xea')],'VoiceQueueId':_0x50f961[_0x82c5('0xeb')]||undefined,'CampaignId':_0x50f961[_0x82c5('0xf8')]||undefined})['catch'](loggerCatch(_0x82c5('0x1a6')));break;case 0x13:if(_0x50f961[_0x82c5('0x127')]>=_0x84eab1[_0x82c5('0x139')]-0x1){return!![];}hopperUtils[_0x82c5('0xe7')]({'active':![],'countmachineretry':_0x50f961['countmachineretry']+=0x1,'scheduledat':moment()[_0x82c5('0xf7')](_0x84eab1['dialMachineRetryFrequency'],_0x82c5('0x133'))[_0x82c5('0x4e')](_0x82c5('0xcd')),'ContactId':_0x50f961[_0x82c5('0xe9')],'ListId':_0x50f961['ListId'],'VoiceQueueId':_0x50f961[_0x82c5('0xeb')]||undefined,'CampaignId':_0x50f961['CampaignId']||undefined})[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x134')));break;case 0x14:if(_0x50f961[_0x82c5('0x12c')]>=_0x84eab1['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x82c5('0xe7')]({'active':![],'countagentrejectretry':_0x50f961[_0x82c5('0x12c')]+=0x1,'scheduledat':moment()[_0x82c5('0xf7')](_0x84eab1[_0x82c5('0x1a7')],'minutes')[_0x82c5('0x4e')](_0x82c5('0xcd')),'ContactId':_0x50f961['ContactId'],'ListId':_0x50f961[_0x82c5('0xea')],'VoiceQueueId':_0x50f961[_0x82c5('0xeb')]||undefined,'CampaignId':_0x50f961[_0x82c5('0xf8')]||undefined})[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x1a8')));break;default:return!![];}};Dialer[_0x82c5('0x1b')][_0x82c5('0x115')]=function(_0x442d55,_0xa0fceb,_0x56ed50){var _0x15b086=this;var _0x2a1fce=new History(_0x442d55);var _0xbdd7e6=![];var _0x392ec5;var _0x5d33ee;return new Promise(function(_0x3904c8,_0xc44754){if(_['isUndefined'](_0xa0fceb)&&typeof _0xa0fceb!=='object'){return _0xc44754(msgResponse(_0x82c5('0x1a9'),_0x82c5('0xa0'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0x56ed50)&&typeof _0x56ed50!==_0x82c5('0x16d')){return _0xc44754(msgResponse(_0x82c5('0x1a9'),_0x82c5('0xa0'),_0x82c5('0x1aa')));}hopperUtils[_0x82c5('0xe2')](_0x2a1fce,_0x56ed50['reason'],_0xa0fceb)[_0x82c5('0x45')](function(_0x5d67d8){if(_0x5d67d8[_0x82c5('0xe6')]==0x1)_0xbdd7e6=!![];switch(_0x56ed50['reason']){case'0':_0xa0fceb[_0x82c5('0x1ab')]+=0x1;_0x2a1fce[_0x82c5('0x7b')]=0x0;_0x2a1fce['statedesc']=_0x82c5('0x1ac');_0x2a1fce['countnosuchnumberretry']+=0x1;_0x2a1fce[_0x82c5('0xe0')]+=0x1;ami[_0x82c5('0x48')](_0x82c5('0x1ad'),ut[_0x82c5('0x121')](_0x442d55,_0x82c5('0x1ae')));_0x392ec5=_0xa0fceb[_0x82c5('0x1a4')];_0x5d33ee=_0xa0fceb[_0x82c5('0xe1')];hopperUtils[_0x82c5('0xd5')](_0x2a1fce)[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x128')));if(_0x15b086[_0x82c5('0x19b')](0x0,_0x442d55,_0xa0fceb)&&!_0xbdd7e6){if(_0x2a1fce[_0x82c5('0x12b')]>=_0xa0fceb[_0x82c5('0x1a3')]){_0x15b086['createStateFinal'](_0x2a1fce,_0x3904c8,_0xc44754,_0x82c5('0x1af'));}else{_0x15b086[_0x82c5('0x12e')](_0x2a1fce,_0x3904c8,_0xc44754,_0x82c5('0x1af'));}}break;case'3':_0xa0fceb[_0x82c5('0x1b0')]+=0x1;_0x2a1fce[_0x82c5('0x7b')]=0x3;_0x2a1fce[_0x82c5('0x7c')]=_0x82c5('0x1b1');_0x2a1fce[_0x82c5('0x12a')]+=0x1;_0x2a1fce[_0x82c5('0xe0')]+=0x1;var _0x11a967=ut['buildNoAnswerEventPayload'](_0x442d55,_0xa0fceb);ami[_0x82c5('0x48')](_0x82c5('0x1b2'),_0x11a967);_0x392ec5=_0xa0fceb[_0x82c5('0x19d')];_0x5d33ee=_0xa0fceb[_0x82c5('0xe1')];hopperUtils[_0x82c5('0xd5')](_0x2a1fce)[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x1b3')));if(_0x15b086[_0x82c5('0x19b')](0x3,_0x442d55,_0xa0fceb)&&!_0xbdd7e6){if(_0x2a1fce['countnoanswerretry']>=_0xa0fceb[_0x82c5('0x19c')]){_0x15b086['createStateFinal'](_0x2a1fce,_0x3904c8,_0xc44754,_0x82c5('0x1b4'));}else{_0x15b086[_0x82c5('0x12e')](_0x2a1fce,_0x3904c8,_0xc44754,_0x82c5('0x1b4'));}}break;case'5':_0xa0fceb[_0x82c5('0x1b5')]+=0x1;_0x2a1fce['state']=0x5;_0x2a1fce[_0x82c5('0x7c')]=_0x82c5('0x1b6');_0x2a1fce[_0x82c5('0x138')]+=0x1;_0x2a1fce['countglobal']+=0x1;ami[_0x82c5('0x48')](_0x82c5('0x1b7'),ut[_0x82c5('0x121')](_0x442d55,_0x82c5('0x1b8')));_0x392ec5=_0xa0fceb[_0x82c5('0x19f')];_0x5d33ee=_0xa0fceb['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x2a1fce)['catch'](loggerCatch(_0x82c5('0x1b9')));if(_0x15b086[_0x82c5('0x19b')](0x5,_0x442d55,_0xa0fceb)&&!_0xbdd7e6){if(_0x2a1fce['countbusyretry']>=_0xa0fceb[_0x82c5('0x1ba')]){_0x15b086['createStateFinal'](_0x2a1fce,_0x3904c8,_0xc44754,_0x82c5('0x1bb'));}else{_0x15b086[_0x82c5('0x12e')](_0x2a1fce,_0x3904c8,_0xc44754,'reason\x205\x20busy');}}break;case'8':_0xa0fceb['outboundCongestionCallsDay']+=0x1;_0x2a1fce['state']=0x8;_0x2a1fce[_0x82c5('0x7c')]='Congestion';_0x2a1fce['countcongestionretry']+=0x1;_0x2a1fce[_0x82c5('0xe0')]+=0x1;_0x392ec5=_0xa0fceb[_0x82c5('0x1bc')];_0x5d33ee=_0xa0fceb[_0x82c5('0xe1')];ami['emit']('custom:agentcongestion',ut['buildObj'](_0x442d55,_0x82c5('0x1bd')));hopperUtils[_0x82c5('0xd5')](_0x2a1fce)[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x1be')));if(_0x15b086[_0x82c5('0x19b')](0x8,_0x442d55,_0xa0fceb)&&!_0xbdd7e6){if(_0x2a1fce['countcongestionretry']>=_0xa0fceb[_0x82c5('0x1a1')]){_0x15b086[_0x82c5('0x130')](_0x2a1fce,_0x3904c8,_0xc44754,_0x82c5('0x1bf'));}else{_0x15b086[_0x82c5('0x12e')](_0x2a1fce,_0x3904c8,_0xc44754,_0x82c5('0x1bf'));}}break;case'11':_0xa0fceb[_0x82c5('0x1c0')]+=0x1;_0x2a1fce[_0x82c5('0x7b')]=0xb;_0x2a1fce[_0x82c5('0x7c')]=_0x82c5('0xf2');_0x2a1fce[_0x82c5('0xf4')]+=0x1;_0x2a1fce[_0x82c5('0xe0')]+=0x1;_0x392ec5=_0xa0fceb[_0x82c5('0xf5')];_0x5d33ee=_0xa0fceb[_0x82c5('0xe1')];hopperUtils[_0x82c5('0xd5')](_0x2a1fce)[_0x82c5('0xb3')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x15b086[_0x82c5('0x19b')](0xb,_0x442d55,_0xa0fceb)&&!_0xbdd7e6){if(_0x2a1fce[_0x82c5('0xf4')]>=_0xa0fceb[_0x82c5('0xf6')]){_0x15b086[_0x82c5('0x130')](_0x2a1fce,_0x3904c8,_0xc44754,_0x82c5('0x1c1'));}else{_0x15b086[_0x82c5('0x12e')](_0x2a1fce,_0x3904c8,_0xc44754,_0x82c5('0x1c1'));}}break;case'20':_0xa0fceb[_0x82c5('0x1c2')]+=0x1;_0x2a1fce[_0x82c5('0x7b')]=0x14;_0x2a1fce['statedesc']='AgentReject';_0x2a1fce[_0x82c5('0x12c')]+=0x1;_0x2a1fce[_0x82c5('0xe0')]+=0x1;_0x392ec5=_0xa0fceb[_0x82c5('0x1a7')];_0x5d33ee=_0xa0fceb[_0x82c5('0xe1')];ami[_0x82c5('0x48')](_0x82c5('0x1c3'),ut[_0x82c5('0x121')](_0x442d55,'agentreject'));hopperUtils['createHistory'](_0x2a1fce)[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x1c4')));if(_0x15b086[_0x82c5('0x19b')](0x14,_0x442d55,_0xa0fceb)&&!_0xbdd7e6){if(_0x2a1fce[_0x82c5('0x12c')]>=_0xa0fceb[_0x82c5('0x1c5')]){_0x15b086[_0x82c5('0x130')](_0x2a1fce,_0x3904c8,_0xc44754,_0x82c5('0x1c6'));}else{_0x15b086[_0x82c5('0x12e')](_0x2a1fce,_0x3904c8,_0xc44754,_0x82c5('0x1c6'));}}break;default:_0xa0fceb[_0x82c5('0x143')]+=0x1;_0x2a1fce[_0x82c5('0x7b')]=0xc;_0x2a1fce['statedesc']=_0x56ed50['reason'];_0x392ec5=_0xa0fceb['dialAgentRejectRetryFrequency'];_0x5d33ee=_0xa0fceb[_0x82c5('0xe1')];hopperUtils[_0x82c5('0xd5')](_0x2a1fce)[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x1c7')));if(_0x15b086[_0x82c5('0x19b')](_0x56ed50[_0x82c5('0xd0')],_0x442d55,_0xa0fceb)&&!_0xbdd7e6){if(_0x2a1fce[_0x82c5('0x138')]+_0x2a1fce['countcongestionretry']+_0x2a1fce[_0x82c5('0x12a')]+_0x2a1fce[_0x82c5('0x12b')]+_0x2a1fce[_0x82c5('0xdf')]+_0x2a1fce[_0x82c5('0xf4')]+_0x2a1fce[_0x82c5('0x127')]+_0x2a1fce[_0x82c5('0x12c')]>=_0xa0fceb[_0x82c5('0x12d')]){_0x15b086[_0x82c5('0x12e')](_0x2a1fce,_0x3904c8,_0xc44754,_0x56ed50[_0x82c5('0xd0')]);}else{_0x15b086[_0x82c5('0x130')](_0x2a1fce,_0x3904c8,_0xc44754,_0x56ed50['reason']);}}}})[_0x82c5('0x45')](function(){if(_0xbdd7e6){hopperUtils['swapAdditionalPhones'](_0x2a1fce,_0x392ec5,_0x5d33ee)['then'](function(){return _0x3904c8(0x1);});}});});};Dialer['prototype'][_0x82c5('0x12e')]=function(_0x4ba4ae,_0x83e2d3,_0x381f2d,_0x396d7c){var _0x49f0c7=new Final(_0x4ba4ae);_0x49f0c7[_0x82c5('0x7b')]=0xf;_0x49f0c7['statedesc']=_0x82c5('0x1c8');this[_0x82c5('0x130')](_0x49f0c7,_0x83e2d3,_0x381f2d,_0x396d7c);};Dialer['prototype'][_0x82c5('0x130')]=function(_0x18f655,_0x237c97,_0x371708,_0x3fa4b6){hopperUtils[_0x82c5('0xd7')](_0x18f655)['then'](function(){return _0x237c97(msgResponse(_0x82c5('0x1a9'),_0x82c5('0x114'),_0x3fa4b6));})['catch'](function(){return _0x371708(msgResponse('[moveContactManagedDialer][0]',_0x82c5('0xa0'),_0x82c5('0x1c9')));});};Dialer[_0x82c5('0x1b')]['predictive']=function(_0x35dcef){var _0x144dc9=_0x35dcef[_0x82c5('0x1ca')]/0x64;var _0x30df91=_0x35dcef[_0x82c5('0xda')]/(_0x35dcef[_0x82c5('0xda')]+_0x35dcef[_0x82c5('0xcf')]);var _0x1fe59f=Math[_0x82c5('0x1cb')](_0x35dcef[_0x82c5('0x1cc')]*(_0x35dcef[_0x82c5('0x1cd')]/0x64));var _0x30654c=Math[_0x82c5('0x1cb')](_0x35dcef[_0x82c5('0x1cc')]*(_0x35dcef[_0x82c5('0x1ce')]/0x64));var _0x53496b=_0x35dcef[_0x82c5('0x149')]+_0x35dcef['talking'];var _0x581322=Math[_0x82c5('0x1cf')](_0x35dcef[_0x82c5('0x1d0')]*_0x35dcef[_0x82c5('0x6a')]*_0x35dcef[_0x82c5('0x1d1')]*_0x35dcef['predictiveIntervalMultiplicativeFactor']);if(_[_0x82c5('0x47')](_0x35dcef[_0x82c5('0x2a')])){if(!_[_0x82c5('0x47')](_0x35dcef[_0x82c5('0x29')])){_0x35dcef[_0x82c5('0x29')]=undefined;loggerPredictive[_0x82c5('0x70')](_0x82c5('0x1d2'),_0x82c5('0x1d3'));}if(!_[_0x82c5('0x47')](_0x35dcef['handlePredictive'])){loggerPredictive[_0x82c5('0x70')]('[startMethodPredictive][StartProgressive]',_0x82c5('0x1d4'));clearInterval(_0x35dcef['handlePredictive']);_0x35dcef[_0x82c5('0x6f')]=undefined;}_0x35dcef['startProgressive']=moment()[_0x82c5('0x4e')](_0x82c5('0xcd'));loggerPredictive[_0x82c5('0x53')](_0x35dcef[_0x82c5('0x50')],_0x82c5('0x1d5'),_0x35dcef[_0x82c5('0x2a')]);this[_0x82c5('0xbc')](_0x35dcef,0x1);}else if(ifInterval(_0x35dcef[_0x82c5('0x1d6')],_0x35dcef['startProgressive'])){this[_0x82c5('0xbc')](_0x35dcef,0x1);loggerPredictiveCalls[_0x82c5('0x53')](_0x82c5('0x1d7'),_0x35dcef[_0x82c5('0x2a')],_0x35dcef['name']);_0x35dcef['erlangCalls']=0x0;_0x35dcef['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x144dc9<_0x30df91&&_0x35dcef[_0x82c5('0x1d8')]===_0x82c5('0x1d9')){clearPredictiveAttributes(_0x35dcef);loggerPredictive[_0x82c5('0x53')](_0x82c5('0x1da'),_0x82c5('0x1db'),_0x30df91,'startProgressive',_0x35dcef[_0x82c5('0x50')]);}else if(_0x581322<_0x35dcef[_0x82c5('0xdb')]&&_0x35dcef['dialPredictiveOptimization']===_0x82c5('0x1d9')){clearPredictiveAttributes(_0x35dcef);loggerPredictive['info'](_0x82c5('0x1dc'),_0x82c5('0x1dd'),_0x581322,_0x82c5('0x1de'),_0x35dcef[_0x82c5('0xdb')],_0x82c5('0x2a'),_0x35dcef[_0x82c5('0x50')]);}else if(!ifInterval(_0x35dcef['dialPredictiveInterval'],_0x35dcef['startProgressive'])&&_[_0x82c5('0x47')](_0x35dcef['startPredictive'])&&!_[_0x82c5('0x47')](_0x35dcef[_0x82c5('0x2a')])){_0x35dcef[_0x82c5('0x29')]=moment()[_0x82c5('0x4e')](_0x82c5('0xcd'));loggerPredictive[_0x82c5('0x53')](_0x35dcef[_0x82c5('0x50')],_0x82c5('0x1df'),_0x35dcef[_0x82c5('0x29')]);hopperUtils[_0x82c5('0x1e0')](_0x35dcef[_0x82c5('0x1d6')])[_0x82c5('0x45')](this[_0x82c5('0x1e1')](_0x35dcef))[_0x82c5('0x45')](mergeDataErlangB(_0x35dcef))['then'](this[_0x82c5('0x1e2')](_0x35dcef))['catch'](loggerCatchPredictive(_0x82c5('0x1e3'),_0x35dcef));}else if(!ifInterval(_0x35dcef[_0x82c5('0x1d6')],_0x35dcef[_0x82c5('0x29')])){_0x35dcef[_0x82c5('0xdb')]=0x0;_0x35dcef['startPredictive']=moment()[_0x82c5('0x4e')](_0x82c5('0xcd'));loggerPredictive[_0x82c5('0x53')](_0x35dcef['name'],'recalculate\x20predictive\x20at',_0x35dcef[_0x82c5('0x29')]);clearInterval(_0x35dcef['handlePredictive']);_0x35dcef[_0x82c5('0x6f')]=undefined;hopperUtils[_0x82c5('0x1e0')](_0x35dcef[_0x82c5('0x1d6')])[_0x82c5('0x45')](this[_0x82c5('0x1e1')](_0x35dcef))[_0x82c5('0x45')](mergeDataErlangB(_0x35dcef))[_0x82c5('0x45')](this['startMethodPredictive'](_0x35dcef))[_0x82c5('0xb3')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x35dcef));}else if(_0x35dcef[_0x82c5('0x1cc')]&&_0x53496b<_0x35dcef[_0x82c5('0x1cc')]-_0x30654c){clearPredictiveAttributes(_0x35dcef);loggerPredictive[_0x82c5('0x53')](_0x35dcef[_0x82c5('0x50')],_0x82c5('0x1e4'),_0x53496b,_0x82c5('0x1e5'),_0x35dcef[_0x82c5('0x1cc')],'-',_0x30654c,'=',_0x35dcef['predictiveIntervalAvailable']-_0x30654c,')');}else if(_0x35dcef[_0x82c5('0x1cc')]&&_0x53496b>_0x35dcef[_0x82c5('0x1cc')]+_0x1fe59f){clearPredictiveAttributes(_0x35dcef);loggerPredictive[_0x82c5('0x53')](_0x35dcef[_0x82c5('0x50')],_0x82c5('0x1e4'),_0x53496b,')\x20are\x20more\x20than\x20threshold\x20(',_0x35dcef[_0x82c5('0x1cc')],'+',_0x1fe59f,'=',_0x35dcef['predictiveIntervalAvailable']+_0x1fe59f,')');}};Dialer[_0x82c5('0x1b')]['getDataPredictive']=function(_0x137cee){var _0x53b67c=this;return function(_0x5d3bd7){return new Promise(function(_0x1bd98d,_0xdc7a7c){_[_0x82c5('0x102')](_0x137cee,_0x5d3bd7[0x0]);if(checkGetDataPredictive(_0x5d3bd7[0x0])){var _0x52e726=_0x137cee['predictiveIntervalAvailable']=_0x137cee['talking']+_0x137cee[_0x82c5('0x149')];var _0x2685d1=_0x137cee[_0x82c5('0x1d6')]*0x3c;var _0x5d0082=_0x5d3bd7[0x0]['predictiveIntervalAvgTalktime']+_0x5d3bd7[0x0][_0x82c5('0x5d')];var _0x4ed28f=(_0x5d3bd7[0x0][_0x82c5('0x58')]+_0x5d3bd7[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5d3bd7[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5d3bd7[0x0][_0x82c5('0x56')];_0x137cee[_0x82c5('0x1d1')]=_0x4ed28f>0x0?_0x4ed28f:0x1;switch(_0x137cee[_0x82c5('0x1d8')]){case _0x82c5('0x1d9'):var _0x474f8f=_0x137cee['dialPredictiveOptimizationPercentage']/0x64;return _0x53b67c[_0x82c5('0x1e6')](_0x52e726,_0x2685d1,_0x5d0082,_0x4ed28f,_0x474f8f)[_0x82c5('0x45')](function(_0x34afd5){return _0x1bd98d(_0x34afd5);});case'agentBusyFactor':var _0x161f2e=_0x137cee[_0x82c5('0x1ca')]/0x64;return _0x53b67c['busyFactor'](_0x52e726,_0x2685d1,_0x5d0082,_0x4ed28f,_0x161f2e)['then'](function(_0x42a661){return _0x1bd98d(_0x42a661);});default:return _0xdc7a7c(msgResponse(_0x82c5('0x1e7'),_0x82c5('0xa0'),_0x82c5('0x1e8')));}}else{return _0xdc7a7c(msgResponse(_0x82c5('0x1e7'),'Failure',_0x82c5('0x1e9')));}});};};Dialer[_0x82c5('0x1b')][_0x82c5('0x1ea')]=function(_0x1a5dd1){var _0x4486c7=this;return function(_0x21db0f){return new Promise(function(_0x6f3d19,_0x2bdcf0){_[_0x82c5('0x102')](_0x1a5dd1,_0x21db0f[0x0]);if(checkGetDataPredictive(_0x21db0f[0x0])){loggerPredictive[_0x82c5('0x53')](JSON[_0x82c5('0x92')](_0x21db0f[0x0]));if(_0x1a5dd1[_0x82c5('0x1d8')]==='dropRate'){return _0x4486c7[_0x82c5('0x161')](_0x1a5dd1['id'])[_0x82c5('0x45')](function(_0x7e7c79){var _0x324506=_0x1a5dd1['loggedIn']-_0x7e7c79[0x0]['outboundQueuePauses'];var _0xc7b425=_0x1a5dd1['dialPredictiveInterval']*0x3c;var _0x10f85d=_0x21db0f[0x0]['predictiveIntervalAvgTalktime']+_0x21db0f[0x0]['predictiveIntervalAvgHoldtime'];var _0x52c571=(_0x21db0f[0x0][_0x82c5('0x58')]+_0x21db0f[0x0][_0x82c5('0x5a')]+_0x21db0f[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x21db0f[0x0]['predictiveIntervalTotalCalls'];var _0x1ebd2a=_0x1a5dd1[_0x82c5('0x1ca')]/0x64;_0x1a5dd1['predictiveIntervalPauses']=_0x7e7c79[0x0][_0x82c5('0x1eb')]||0x0;_0x1a5dd1['predictiveIntervalHitRate']=_0x52c571>0x0?_0x52c571:0x1;return _0x4486c7['abandonmentRate'](_0x324506,_0xc7b425,_0x10f85d,_0x52c571,_0x1ebd2a);})[_0x82c5('0x45')](function(_0x385534){return _0x6f3d19(_0x385534);})[_0x82c5('0xb3')](function(_0xb196cf){return _0x2bdcf0(msgResponse(_0x82c5('0x1ec'),_0x82c5('0xa0'),JSON[_0x82c5('0x92')](_0xb196cf)));});}if(_0x1a5dd1[_0x82c5('0x1d8')]==='agentBusyFactor'){return _0x4486c7[_0x82c5('0x161')](_0x1a5dd1['id'])['then'](function(_0x1de383){var _0xb7082f=_0x1a5dd1[_0x82c5('0x1ed')]-_0x1de383[0x0][_0x82c5('0x1eb')];var _0x303f85=_0x1a5dd1['dialPredictiveInterval']*0x3c;var _0x2ce3dd=_0x21db0f[0x0]['predictiveIntervalAvgTalktime']+_0x21db0f[0x0][_0x82c5('0x5d')];var _0xeaf7dc=(_0x21db0f[0x0][_0x82c5('0x58')]+_0x21db0f[0x0][_0x82c5('0x5a')]+_0x21db0f[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x21db0f[0x0][_0x82c5('0x56')];var _0x43d514=_0x1a5dd1['dialPredictiveOptimizationPercentage']/0x64;_0x1a5dd1[_0x82c5('0x1ee')]=_0x1de383[0x0][_0x82c5('0x1eb')]||0x0;_0x1a5dd1[_0x82c5('0x1d1')]=_0xeaf7dc>0x0?_0xeaf7dc:0x1;return _0x4486c7['busyFactor'](_0xb7082f,_0x303f85,_0x2ce3dd,_0xeaf7dc,_0x43d514);})[_0x82c5('0x45')](function(_0x21ee5b){return _0x6f3d19(_0x21ee5b);})[_0x82c5('0xb3')](function(_0x5bff23){return _0x2bdcf0(msgResponse(_0x82c5('0x1ec'),'Failure',JSON['stringify'](_0x5bff23)));});}}else{return _0x2bdcf0(msgResponse('[getDataPredictive]',_0x82c5('0xa0'),_0x82c5('0x1e9')));}});};};Dialer[_0x82c5('0x1b')][_0x82c5('0x1e2')]=function(_0x524b93){var _0x2f3732=this;return function(){var _0x2e3e43=0x0;var _0x43c0aa=Math[_0x82c5('0x1cf')](_0x524b93[_0x82c5('0x68')]*0x3e8);if(_0x43c0aa>0x0){_0x43c0aa=_0x43c0aa<0x64?0x64:_0x43c0aa;loggerPredictive['info'](_0x524b93[_0x82c5('0x50')],_0x82c5('0x1ef'),_0x43c0aa,_0x82c5('0x1f0'));_0x524b93[_0x82c5('0x6f')]=setInterval(function(){_0x2f3732[_0x82c5('0x6f')](_0x524b93);loggerPredictiveCalls['info'](_0x82c5('0x1f1'),_0x2e3e43+=0x1);},_0x43c0aa);}else{loggerPredictive[_0x82c5('0x53')](_0x524b93[_0x82c5('0x50')],_0x82c5('0x1f2'));}};};Dialer[_0x82c5('0x1b')][_0x82c5('0x1f3')]=function(_0x2ca4cd,_0x327ffd){var _0x21e8bb=this;return function(_0x3be79a){if(_[_0x82c5('0x52')](_0x3be79a)){if(_[_0x82c5('0xfe')](_0x327ffd[_0x82c5('0x168')])||!_0x327ffd[_0x82c5('0x1f4')]){if(_0x2ca4cd['dialMethod']===_0x82c5('0x7')){_0x2ca4cd['queueStatusComplete']=_['isUndefined'](_0x2ca4cd[_0x82c5('0x7f')])?!![]:_0x2ca4cd[_0x82c5('0x7f')];var _0x245c55=uuid['v4']();_0x21e8bb[_0x82c5('0x25')][_0x245c55]=new Action(_0x2ca4cd,_0x327ffd,_0x245c55);loggerBooked['info']('[booked][checkContactBlack]',_0x245c55,_0x82c5('0x1f5'),JSON['stringify'](_0x2ca4cd[_0x82c5('0x7f')]),'Queue:\x20',_0x2ca4cd[_0x82c5('0x50')]);if(_0x2ca4cd[_0x82c5('0x7f')]){_0x2ca4cd['queueStatusComplete']=![];_0x21e8bb[_0x82c5('0x2b')][_0x21e8bb['actions'][_0x245c55]['queue']]=[];ami[_0x82c5('0xad')]({'actionid':_0x245c55,'action':_0x82c5('0x1f6'),'queue':_0x2ca4cd[_0x82c5('0x50')]})[_0x82c5('0xb3')](function(){_0x21e8bb[_0x82c5('0xca')](_0x2ca4cd);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x21e8bb[_0x82c5('0x25')][_0x245c55][_0x82c5('0xe9')],'ListId':_0x21e8bb[_0x82c5('0x25')][_0x245c55][_0x82c5('0xea')],'VoiceQueueId':_0x21e8bb[_0x82c5('0x25')][_0x245c55][_0x82c5('0xeb')]||undefined,'CampaignId':_0x21e8bb['actions'][_0x245c55][_0x82c5('0xf8')]||undefined})[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x1f7')));delete _0x21e8bb[_0x82c5('0x25')][_0x245c55];});}else{loggerBooked[_0x82c5('0x53')](_0x82c5('0x1f8'),JSON[_0x82c5('0x92')](_0x2ca4cd[_0x82c5('0x7f')]),_0x82c5('0x1f9'),_0x2ca4cd[_0x82c5('0x50')]);_0x21e8bb[_0x82c5('0xca')](_0x2ca4cd);hopperUtils[_0x82c5('0xe7')]({'active':![],'ContactId':_0x21e8bb[_0x82c5('0x25')][_0x245c55][_0x82c5('0xe9')],'ListId':_0x21e8bb[_0x82c5('0x25')][_0x245c55][_0x82c5('0xea')],'VoiceQueueId':_0x21e8bb[_0x82c5('0x25')][_0x245c55]['VoiceQueueId']||undefined,'CampaignId':_0x21e8bb[_0x82c5('0x25')][_0x245c55][_0x82c5('0xf8')]||undefined})[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x1f7')));delete _0x21e8bb['actions'][_0x245c55];}}else{return _0x21e8bb[_0x82c5('0x16c')](_0x2ca4cd,_0x327ffd);}}else{if(utils[_0x82c5('0x6d')](undefined,_0x327ffd['scheduledat'])<_0x2ca4cd['dialRecallMeTimeout']*0x3c){if(_0x327ffd['Agent']&&!_0x327ffd[_0x82c5('0x157')][_0x82c5('0x1fa')]){_0x21e8bb[_0x82c5('0x1f')][_0x82c5('0x104')](_0x327ffd['id'])['finally'](function(){_0x21e8bb[_0x82c5('0xca')](_0x2ca4cd);});}else{hopperUtils['unlockContact']({'active':![]},_0x327ffd['id'],0x1)[_0x82c5('0x1e')](function(){_0x21e8bb[_0x82c5('0xca')](_0x2ca4cd);});}}else{_0x2ca4cd[_0x82c5('0x1fb')]+=0x1;_0x21e8bb['updateOriginated'](_0x2ca4cd);if(_0x2ca4cd[_0x82c5('0x1fc')]){hopperUtils[_0x82c5('0xe7')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x327ffd[_0x82c5('0xe9')],'ListId':_0x327ffd[_0x82c5('0xea')],'VoiceQueueId':_0x327ffd['VoiceQueueId']||undefined,'CampaignId':_0x327ffd[_0x82c5('0xf8')]||undefined})[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x1fd')));hopperUtils['createHistory'](createObjHistory(_0x2ca4cd,_0x327ffd,utils[_0x82c5('0x75')]['QUEUE_RECALL'],0x17,_0x82c5('0x1fe')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x21e8bb[_0x82c5('0x123')](createObjHistory(_0x2ca4cd,_0x327ffd,utils['CAMPAIGN_STATUS'][_0x82c5('0x1ff')],0x16,_0x82c5('0x200')),_0x82c5('0x201'),'[Originate][HistoryRecallClose]');}}}}else{_0x2ca4cd[_0x82c5('0x202')]+=0x1;_0x21e8bb[_0x82c5('0x123')](createObjHistory(_0x2ca4cd,_0x327ffd,utils[_0x82c5('0x75')]['BLACKLIST'],0xd,'Blacklist'),_0x82c5('0x203'),_0x82c5('0x204'));throw _0x82c5('0x205');}};};Dialer[_0x82c5('0x1b')][_0x82c5('0x206')]=function(_0x32bd2f){var _0x365411=this;var _0x3ba6dc=_0x32bd2f[_0x82c5('0x207')]-_0x32bd2f[_0x82c5('0x162')];emitCampaignSummary(_0x32bd2f);if(_0x3ba6dc>0x0&&_0x32bd2f[_0x82c5('0x72')]==0x0){if(_0x3ba6dc>this[_0x82c5('0x24')]){_0x3ba6dc=this[_0x82c5('0x24')];}_0x32bd2f[_0x82c5('0x72')]=0x1;hopperUtils[_0x82c5('0x208')](_0x32bd2f,_0x3ba6dc)[_0x82c5('0x45')](function(_0x287072){_0x32bd2f[_0x82c5('0x72')]=0x0;if(_0x287072){if(!utils[_0x82c5('0x209')](_0x287072)){_0x32bd2f[_0x82c5('0x74')]=utils[_0x82c5('0x75')][_0x82c5('0x79')];logger[_0x82c5('0x53')](_0x82c5('0x20a')+_0x32bd2f[_0x82c5('0x50')]);}else{_0x32bd2f['originated']+=_0x287072['length'];_0x32bd2f[_0x82c5('0x74')]=utils[_0x82c5('0x75')][_0x82c5('0x20b')];for(var _0x124f0d=0x0;_0x124f0d<_0x287072[_0x82c5('0xa7')];_0x124f0d+=0x1){_0x32bd2f[_0x82c5('0x20c')]+=0x1;if(_['isNil'](_0x287072[_0x124f0d])||_[_0x82c5('0xfe')](_0x287072[_0x124f0d]['Contact'])||_[_0x82c5('0xfe')](_0x287072[_0x124f0d]['phone'])){_0x365411['emptyContact'](_0x82c5('0x20d'),_0x32bd2f,_0x287072[_0x124f0d]);}else{hopperUtils[_0x82c5('0x20e')](_[_0x82c5('0x82')](_0x287072[_0x124f0d],[_0x82c5('0xf8'),_0x82c5('0x16f')]))[_0x82c5('0x45')](_0x365411[_0x82c5('0x1f3')](_0x32bd2f,_0x287072[_0x124f0d]))['catch'](_0x365411[_0x82c5('0x165')](_0x82c5('0x20f'),_0x32bd2f));}}}}})[_0x82c5('0xb3')](loggerGetContactDialer(_0x82c5('0x210'),_0x32bd2f,_0x3ba6dc));}};Dialer[_0x82c5('0x1b')][_0x82c5('0xbc')]=function(_0x1f026a,_0x264f14){var _0x21c0ef=this;var _0x48e7cf=[];if(_0x264f14<0x1||_0x1f026a['dialMethod']==='booked'){_0x264f14=0x1;}var _0x38ec79=Math[_0x82c5('0x1cf')](_0x1f026a[_0x82c5('0x149')]*_0x264f14)-_0x1f026a[_0x82c5('0x162')];if(_0x1f026a[_0x82c5('0x211')]>0x0){var _0x230f6d=_0x1f026a[_0x82c5('0x211')]-_0x1f026a[_0x82c5('0x162')]-_0x1f026a[_0x82c5('0x212')]-_0x1f026a[_0x82c5('0x14b')];if(_0x38ec79>_0x230f6d){_0x38ec79=_0x230f6d;}}if(_0x38ec79>0x0&&_0x1f026a['temp']==0x0){if(_0x1f026a[_0x82c5('0xbb')]===_0x82c5('0x7')){_0x38ec79=0x1;}if(_0x38ec79>this['maxNumberOriginate']){_0x38ec79=this[_0x82c5('0x24')];}for(var _0x21e103 in this[_0x82c5('0x22')]){if(typeof this[_0x82c5('0x22')][_0x21e103]!==_0x82c5('0xb6')){if(this[_0x82c5('0x22')][_0x21e103][_0x82c5('0x7b')]===_0x82c5('0x213')&&this[_0x82c5('0x22')][_0x21e103][_0x82c5('0x96')]===_0x82c5('0x95')){_0x48e7cf[_0x82c5('0xa8')](this['agents'][_0x21e103]['id']);}}}_0x1f026a[_0x82c5('0x72')]=0x1;hopperUtils[_0x82c5('0x214')](_0x1f026a,_0x48e7cf,_0x38ec79)['then'](function(_0x5853b1){_0x1f026a[_0x82c5('0x72')]=0x0;if(_0x5853b1){if(!utils[_0x82c5('0x209')](_0x5853b1)){hopperUtils[_0x82c5('0x215')](_0x1f026a)['then'](sendMessageReschedule(_0x1f026a))[_0x82c5('0xb3')](loggerCatch(_0x82c5('0x216')));}else{_0x1f026a[_0x82c5('0x162')]+=_0x5853b1['length'];_0x1f026a[_0x82c5('0x74')]=_0x1f026a[_0x82c5('0xbb')]===_0x82c5('0x7')?utils['CAMPAIGN_STATUS'][_0x82c5('0x14c')]:utils[_0x82c5('0x75')][_0x82c5('0x20b')];for(var _0x5774f6=0x0;_0x5774f6<_0x5853b1[_0x82c5('0xa7')];_0x5774f6+=0x1){if(_[_0x82c5('0xfe')](_0x5853b1[_0x5774f6])||_[_0x82c5('0xfe')](_0x5853b1[_0x5774f6][_0x82c5('0x186')])||_[_0x82c5('0xfe')](_0x5853b1[_0x5774f6][_0x82c5('0x16f')])){_0x21c0ef[_0x82c5('0x166')](_0x82c5('0x20d'),_0x1f026a,_0x5853b1[_0x5774f6]);}else{hopperUtils['checkIsBlackList'](_[_0x82c5('0x82')](_0x5853b1[_0x5774f6],['VoiceQueueId',_0x82c5('0x16f')]))[_0x82c5('0x45')](_0x21c0ef[_0x82c5('0x1f3')](_0x1f026a,_0x5853b1[_0x5774f6]))[_0x82c5('0xb3')](_0x21c0ef[_0x82c5('0x165')](_0x82c5('0x20d'),_0x1f026a));}}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x1f026a,_0x38ec79));}};Dialer['prototype'][_0x82c5('0x6f')]=function(_0x1a9647){if(_0x1a9647[_0x82c5('0x211')]>0x0){var _0x19762a=_0x1a9647[_0x82c5('0x211')]-_0x1a9647[_0x82c5('0x162')]-_0x1a9647['talking'];if(_0x19762a>0x0&&_0x1a9647[_0x82c5('0x72')]==0x0){this[_0x82c5('0x217')](_0x1a9647);}else{loggerPredictiveCalls[_0x82c5('0x53')](_0x82c5('0x218'));}}else{this[_0x82c5('0x217')](_0x1a9647);}};Dialer[_0x82c5('0x1b')]['tryOriginatePredictive']=function(_0x132434){var _0x31555a=this;var _0x1a4a30=[];_0x132434[_0x82c5('0x162')]+=0x1;for(var _0x11605f in this[_0x82c5('0x22')]){if(typeof this['agents'][_0x11605f]!=='undefined'){if(this[_0x82c5('0x22')][_0x11605f][_0x82c5('0x7b')]===_0x82c5('0x213')&&this[_0x82c5('0x22')][_0x11605f]['status']===_0x82c5('0x95')){_0x1a4a30['push'](this[_0x82c5('0x22')][_0x11605f]['id']);}}}_0x132434[_0x82c5('0x72')]=0x1;return this[_0x82c5('0x214')](_0x132434['id'],_0x1a4a30,0x1,_0x132434['dialOrderByScheduledAt'],_0x132434)['then'](function(_0x40687b){_0x132434[_0x82c5('0x72')]=0x1;if(_0x40687b){if(!utils[_0x82c5('0x209')](_0x40687b)){utils[_0x82c5('0x219')](_0x132434,0x1,0x0);return hopperUtils[_0x82c5('0x215')](_0x132434)[_0x82c5('0x45')](sendMessageReschedule(_0x132434))[_0x82c5('0xb3')](loggerCatch('[countReScheduled]\x20'));}else{_0x132434[_0x82c5('0x74')]=utils[_0x82c5('0x75')][_0x82c5('0x20b')];if(_['isNil'](_0x40687b[0x0])||_[_0x82c5('0xfe')](_0x40687b[0x0][_0x82c5('0x186')])||_[_0x82c5('0xfe')](_0x40687b[0x0][_0x82c5('0x16f')])){_0x31555a[_0x82c5('0x166')](_0x82c5('0x20d'),_0x132434,_0x40687b[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0x82c5('0x82')](_0x40687b[0x0],[_0x82c5('0xeb'),'phone']))['then'](_0x31555a[_0x82c5('0x1f3')](_0x132434,_0x40687b[0x0]))[_0x82c5('0xb3')](_0x31555a[_0x82c5('0x165')](_0x82c5('0x21a'),_0x132434));}}}})[_0x82c5('0xb3')](loggerGetContactDialer(_0x82c5('0x21b'),_0x132434,0x1));};Dialer[_0x82c5('0x1b')][_0x82c5('0x1e6')]=function(_0x533f29,_0x1b1298,_0x4f40bb,_0x3b79f5,_0x49a748,_0x1057d7){loggerPredictive[_0x82c5('0x53')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x82c5('0x53')](_0x82c5('0x21c'),_0x533f29);loggerPredictive[_0x82c5('0x53')](_0x82c5('0x21d'),_0x1b1298);loggerPredictive[_0x82c5('0x53')](_0x82c5('0x21e'),_0x4f40bb);loggerPredictive[_0x82c5('0x53')]('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',_0x3b79f5);loggerPredictive[_0x82c5('0x53')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49a748);loggerPredictive[_0x82c5('0x53')](_0x82c5('0x5f'));return new Promise(function(_0x4b4587,_0x30c1d3){if(_0x533f29<=0x0||isNaN(_0x533f29)){return _0x30c1d3(msgResponse(_0x82c5('0x21f'),_0x82c5('0x91'),_0x82c5('0x220')+_0x533f29));}if(_0x4f40bb<=0x0||isNaN(_0x4f40bb)){return _0x30c1d3(msgResponse(_0x82c5('0x21f'),_0x82c5('0x91'),'Ts\x20=\x20'+_0x4f40bb));}if(_0x3b79f5<=0x0||isNaN(_0x3b79f5)){return _0x30c1d3(msgResponse(_0x82c5('0x21f'),_0x82c5('0x91'),_0x82c5('0x221')+_0x3b79f5));}if(_0x1b1298<=0x0||isNaN(_0x1b1298)){return _0x30c1d3(msgResponse('[abandonmentRate]','Error',_0x82c5('0x222')+_0x1b1298));}if(_0x49a748<=0x0||isNaN(_0x49a748)){return _0x30c1d3(msgResponse(_0x82c5('0x21f'),_0x82c5('0x91'),'Amax\x20=\x20'+_0x49a748));}_0x1057d7=_0x1057d7||0x0;var _0x42c289=0x1/_0x4f40bb;var _0x7a08bc=0x0;var _0x159193=0x0;var _0x1bca22=0x0;var _0x3ee547=0x0;for(var _0x346057=0x0;_0x1bca22<_0x49a748;_0x346057+=0x1){_0x159193=_0x346057/_0x1b1298;_0x7a08bc=(_0x3b79f5*_0x159193+_0x1057d7)/_0x42c289;_0x1bca22=utils[_0x82c5('0x223')](_0x7a08bc,_0x533f29);_0x3ee547=_0x7a08bc/_0x533f29*(0x1-utils['erlangb'](_0x7a08bc,_0x533f29));}return _0x4b4587({'erlangCalls':_0x346057,'erlangCallToSecond':_0x1b1298/_0x346057,'erlangAbandonmentRate':_0x1bca22,'erlangBusyFactor':_0x3ee547});});};Dialer['prototype']['busyFactor']=function(_0xccd63a,_0x1226e6,_0x5be25f,_0x30d2a6,_0x30e512,_0x10f3f5){loggerPredictive[_0x82c5('0x53')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x82c5('0x53')](_0x82c5('0x21c'),_0xccd63a);loggerPredictive[_0x82c5('0x53')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1226e6);loggerPredictive[_0x82c5('0x53')](_0x82c5('0x21e'),_0x5be25f);loggerPredictive['info'](_0x82c5('0x224'),_0x30d2a6);loggerPredictive['info'](_0x82c5('0x225'),_0x30e512);loggerPredictive[_0x82c5('0x53')](_0x82c5('0x5f'));return new Promise(function(_0x43e766,_0x2cbf96){if(_0xccd63a<=0x0||isNaN(_0xccd63a)){return _0x2cbf96(msgResponse('[busyFactor]','Error',_0x82c5('0x220')+_0xccd63a));}if(_0x5be25f<=0x0||isNaN(_0x5be25f)){return _0x2cbf96(msgResponse(_0x82c5('0x226'),_0x82c5('0x91'),'Ts\x20=\x20'+_0x5be25f));}if(_0x30d2a6<=0x0||isNaN(_0x30d2a6)){return _0x2cbf96(msgResponse(_0x82c5('0x226'),'Error',_0x82c5('0x221')+_0x30d2a6));}if(_0x1226e6<=0x0||isNaN(_0x1226e6)){return _0x2cbf96(msgResponse(_0x82c5('0x226'),'Error','interval\x20=\x20'+_0x1226e6));}if(_0x30e512<=0x0||isNaN(_0x30e512)){return _0x2cbf96(msgResponse('[busyFactor]',_0x82c5('0x91'),_0x82c5('0x227')+_0x30e512));}_0x10f3f5=_0x10f3f5||0x0;var _0x11fda6=0x1/_0x5be25f;var _0x115088=0x0;var _0x2e49bb=0x0;var _0x3b1c7b=0x0;var _0x1f05ac=0x0;for(var _0x5062a8=0x0;_0x1f05ac<_0x30e512;_0x5062a8+=0x1){_0x2e49bb=_0x5062a8/_0x1226e6;_0x115088=(_0x30d2a6*_0x2e49bb+_0x10f3f5)/_0x11fda6;_0x3b1c7b=utils[_0x82c5('0x223')](_0x115088,_0xccd63a);_0x1f05ac=_0x115088/_0xccd63a*(0x1-utils[_0x82c5('0x223')](_0x115088,_0xccd63a));}return _0x43e766({'erlangCalls':_0x5062a8,'erlangCallToSecond':_0x1226e6/_0x5062a8,'erlangAbandonmentRate':_0x3b1c7b,'erlangBusyFactor':_0x1f05ac});});};module[_0x82c5('0x228')]=Dialer; \ No newline at end of file +var _0x1189=['OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','booked','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','decrementOriginate','[syncAgentConnect]','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','moveContactManagedDialer','[syncQueueCallerAbandon]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','state','statedesc','Drop','TIMEOUT','verifyAdditionalPhones','voiceQueue','additional','countdropretry','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','dialDropRetryFrequency','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','dropreason','countabandonedretry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','minutes','[rescheduleContact][Abandoned]','calleridnum','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','roundrobin','locked','paused','stateinterface','isNil','run','idHopper','finally','[syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','response','Success','[syncOriginateResponse]','[callProgressDetecting]\x20','syncVarSet','variable','amdstatus','xcally-motion-dialer','dialAMDActive','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','AMD','amd','saveInDb','[syncHangupInAMD]','value','MACHINE','[syncVarSet]','membername','countmachineretry','countglobal','custom:amd','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','reason19\x20machine....','reason\x2019\x20machine....','[rescheduleContact][Machine]','[syncHangup]','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AGI','[syncHangupIvr][createHistory]','Normal\x20Clearing','[syncAgentComplete][createHistory]','[syncAgentComplete]','cause-txt','Unknown','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','syncQueueSummaryComplete','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','loopClearZombieChannels','clearZombieChannels','[uniqueid]','No\x20such\x20channel','[Dialer][checkChannel]','[clearZombieChannels]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','emptyContact','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','handleIvr','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','variables','originate','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','entity\x20is\x20undefine','[callProgressDetecting]','NoSuchNumber','nosuchnumber','callAdditionalPhoneAfterMin','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','checkRetriveMax','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','dialPredictiveOptimization','loggedIn','predictiveIntervalPauses','outboundQueuePauses','abandonmentRate','[CatchErlangB]','erlangCallToSecond','one\x20call\x20every:','milliseconds','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','[checkContactBlack]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','unlockContact','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','checkContactEmpty','RUNNING','ivrTotalCallsDays','checkIsBlackListIvr','[actionOriginateIvr]','[handleIvr]','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','[actionOriginate]\x20','checkIsBlackList','[handlePower]','talking','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','[countReScheduled]\x20','[actionOriginatePredictive]','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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','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','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/setting','./models/history','./models/final','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','getSettings','then','previewRecallmeReminderInterval','emit','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','name','voice_queue:save','isEmpty','info','predictiveIntervalTotalCalls','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','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','erlangAbandonmentRate','merge','getSeconds','startProgressive','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','isIVRCampaign','format','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20deactivated','Error','isTrunkReachable','active','status','reachable','SIP/%s','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','interval','content','indexOf','catch','iftime\x20%s,%s','some','OVERTIME_GLOBAL_INTERVAL'];(function(_0x2891d1,_0x2ddd3e){var _0x486948=function(_0x13fa0f){while(--_0x13fa0f){_0x2891d1['push'](_0x2891d1['shift']());}};_0x486948(++_0x2ddd3e);}(_0x1189,0x17f));var _0x9118=function(_0x588540,_0x1a6b5d){_0x588540=_0x588540-0x0;var _0x1c6c97=_0x1189[_0x588540];return _0x1c6c97;};'use strict';var util=require(_0x9118('0x0'));var _=require(_0x9118('0x1'));var uuid=require(_0x9118('0x2'));var moment=require(_0x9118('0x3'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0x9118('0x4'));var hopperUtils=require(_0x9118('0x5'));var ut=require(_0x9118('0x6'));var config=require(_0x9118('0x7'));var logger=require(_0x9118('0x8'))(_0x9118('0x9'));var loggerBooked=require(_0x9118('0x8'))('booked');var loggerPredictive=require(_0x9118('0x8'))(_0x9118('0xa'));var loggerPredictiveCalls=require(_0x9118('0x8'))(_0x9118('0xb'));var loggerSyncQueueSummary=require(_0x9118('0x8'))(_0x9118('0xc'));var ami=require('../ami');config[_0x9118('0xd')]=_[_0x9118('0xe')](config[_0x9118('0xd')],{'host':_0x9118('0xf'),'port':0x18eb});var io=require(_0x9118('0x10'))(new Redis(config[_0x9118('0xd')]));var cmHopper=require(_0x9118('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x9118('0x12'));var Interval=require('../rpc/interval');var Action=require('./models/action');var History=require(_0x9118('0x13'));var Final=require(_0x9118('0x14'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x9118('0x15'));var Hangup=require(_0x9118('0x16'));var ipAgi=process[_0x9118('0x17')][_0x9118('0x18')]||_0x9118('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x9118('0x1a')][_0x9118('0x1b')]=function(_0x11b1b9){this[_0x9118('0x1c')]=this[_0x9118('0x1c')]?this[_0x9118('0x1c')]['finally'](_0x11b1b9):_0x11b1b9();};function Dialer(_0x5c403d,_0x30241a){this['sequence']=new Sequence();this[_0x9118('0x1d')]=_0x30241a;this[_0x9118('0x1e')]=_0x5c403d[_0x9118('0x1e')];this[_0x9118('0x1f')]=_0x5c403d['campaigns'];this[_0x9118('0x20')]=_0x5c403d['agents'];this[_0x9118('0x21')]=_0x5c403d['trunks'];this[_0x9118('0x22')]=config[_0x9118('0x22')]||0x2;this['channels']={};this[_0x9118('0x23')]={};this[_0x9118('0x24')]={};this[_0x9118('0x25')]={};this[_0x9118('0x26')]={};this[_0x9118('0x27')]={};this['startProgressive']={};this[_0x9118('0x28')]={};this[_0x9118('0x29')]={};this[_0x9118('0x2a')]={};this[_0x9118('0x2b')]={};ami['on'](_0x9118('0x2c'),this[_0x9118('0x2d')][_0x9118('0x2e')](this));ami['on'](_0x9118('0x2f'),this[_0x9118('0x30')][_0x9118('0x2e')](this));ami['on']('originateresponse',this[_0x9118('0x31')]['bind'](this));ami['on'](_0x9118('0x32'),this[_0x9118('0x33')][_0x9118('0x2e')](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0x9118('0x2e')](this));ami['on'](_0x9118('0x34'),this['syncQueueSummaryComplete'][_0x9118('0x2e')](this));ami['on'](_0x9118('0x35'),this[_0x9118('0x36')][_0x9118('0x2e')](this));ami['on'](_0x9118('0x37'),this[_0x9118('0x38')][_0x9118('0x2e')](this));ami['on'](_0x9118('0x39'),this['syncVarSet'][_0x9118('0x2e')](this));ami['on'](_0x9118('0x3a'),this[_0x9118('0x3b')][_0x9118('0x2e')](this));ami['on'](_0x9118('0x3c'),this[_0x9118('0x3d')][_0x9118('0x2e')](this));this[_0x9118('0x3e')]();this['loopClearZombieChannels']();RpcSetting[_0x9118('0x3f')]()[_0x9118('0x40')](function(_0x5c1d8f){previewRecallmeReminderInterval=_0x5c1d8f[_0x9118('0x41')];});}function isNotNull(_0x4d3da7){return _0x4d3da7!==null&&!_['isUndefined'](_0x4d3da7);}function msgResponse(_0x521e48,_0x3d97b0,_0x4abf44){return{'action':_0x521e48,'response':_0x3d97b0,'message':_0x4abf44,'stack':_0x4abf44};}function emit(_0x452e13,_0x238d0a,_0x3f5093){io['to'](_0x452e13)[_0x9118('0x42')](_0x238d0a,_0x3f5093);}function emitOutboundVoiceQueueSummary(_0x38662f){if(_0x38662f[_0x9118('0x43')]==='outbound'){logger[_0x9118('0x44')](_0x9118('0x45'),util[_0x9118('0x46')](_0x38662f,{'showHidden':![],'depth':null}));emit(util['format'](_0x9118('0x47'),_0x38662f[_0x9118('0x48')]),_0x9118('0x49'),_0x38662f);}}function checkGetDataPredictive(_0x590d78){if(isNotNull(_0x590d78)&&!_[_0x9118('0x4a')](_0x590d78)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x9118('0x4b')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x590d78[_0x9118('0x4c')]);loggerPredictive[_0x9118('0x4b')](_0x9118('0x4d'),_0x590d78[_0x9118('0x4e')]);loggerPredictive[_0x9118('0x4b')](_0x9118('0x4f'),_0x590d78[_0x9118('0x50')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x590d78[_0x9118('0x51')]);loggerPredictive[_0x9118('0x4b')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x590d78[_0x9118('0x52')]);loggerPredictive[_0x9118('0x4b')](_0x9118('0x53'),_0x590d78['predictiveIntervalAvgTalktime']);loggerPredictive[_0x9118('0x4b')](_0x9118('0x54'));if(_0x590d78[_0x9118('0x4c')]>0x0){if(!_[_0x9118('0x55')](_0x590d78[_0x9118('0x56')])&&_0x590d78[_0x9118('0x56')]>0x0){return!![];}loggerPredictive[_0x9118('0x4b')](_0x9118('0x57'));if(!_['isUndefined'](_0x590d78[_0x9118('0x52')])&&_0x590d78['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info'](_0x9118('0x58'));}else{loggerPredictive[_0x9118('0x4b')](_0x9118('0x59'));}}else{loggerPredictive[_0x9118('0x4b')](_0x9118('0x5a'));}return![];}function mergeDataErlangB(_0x4e1401){return function(_0x54db50){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0x9118('0x4b')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x54db50[_0x9118('0x5b')]);loggerPredictive[_0x9118('0x4b')](_0x9118('0x5c'),_0x54db50['erlangCallToSecond']);loggerPredictive[_0x9118('0x4b')](_0x9118('0x5d'),_0x54db50['erlangAbandonmentRate']);loggerPredictive['info'](_0x9118('0x5e'),_0x54db50[_0x9118('0x5f')]);loggerPredictive['info'](_0x9118('0x5d'),_0x54db50[_0x9118('0x60')]);loggerPredictive['info'](_0x9118('0x54'));_[_0x9118('0x61')](_0x4e1401,_0x54db50);};}function ifInterval(_0x131d29,_0xfcaa5f){if(_['isUndefined'](_0xfcaa5f)){return![];}return utils[_0x9118('0x62')](undefined,_0xfcaa5f)<_0x131d29*0x3c;}function clearPredictiveAttributes(_0x28656e){if(_0x28656e[_0x9118('0x63')]){_0x28656e['startProgressive']=undefined;loggerPredictive[_0x9118('0x44')](_0x28656e[_0x9118('0x48')],_0x9118('0x64'));}if(_0x28656e['startPredictive']){_0x28656e[_0x9118('0x27')]=undefined;loggerPredictive[_0x9118('0x44')](_0x28656e[_0x9118('0x48')],_0x9118('0x65'));}if(_0x28656e[_0x9118('0x66')]){clearInterval(_0x28656e[_0x9118('0x66')]);_0x28656e['handlePredictive']=undefined;loggerPredictive[_0x9118('0x44')](_0x28656e[_0x9118('0x48')],_0x9118('0x67'));}}function loggerCatchPredictive(_0x1da638,_0x48bc46){return function(_0x29152e){loggerPredictive[_0x9118('0x68')](_0x48bc46[_0x9118('0x48')],_0x1da638);loggerPredictive[_0x9118('0x68')](_0x29152e[_0x9118('0x69')]);clearPredictiveAttributes(_0x48bc46);};}function loggerCatch(_0x2475a9){return function(_0x447f1b){logger[_0x9118('0x68')](_0x2475a9,util['inspect'](_0x447f1b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1b6f40){return function(_0x31a1d9){if(isNotNull(_0x31a1d9)&&isNotNull(_0x31a1d9[0x0])){if(_0x31a1d9[0x0][_0x9118('0x6a')]>0x0){_0x1b6f40['message']=utils[_0x9118('0x6b')][_0x9118('0x6c')];logger['info'](_0x9118('0x6d')+_0x1b6f40['name'],_0x31a1d9[0x0]['contactsRescheduled'],'contacts');}else{_0x1b6f40[_0x9118('0x6e')]=utils[_0x9118('0x6b')][_0x9118('0x6f')];logger[_0x9118('0x4b')](_0x9118('0x70')+_0x1b6f40[_0x9118('0x48')]);}}};}function createObjHistory(_0x1c40d1,_0x4b0510,_0x514372,_0xa9858a,_0x1e3da9){_0x1c40d1['message']=_0x514372;var _0x59e005=new Action(_0x1c40d1,_0x4b0510);var _0x15065b=new History(_0x59e005);_0x15065b['state']=_0xa9858a;_0x15065b['statedesc']=_0x1e3da9;_0x15065b[_0x9118('0x71')]=_0x59e005[_0x9118('0x72')];return _0x15065b;}function unlockQueueStatus(_0x3edea6,_0x4018b8){setTimeout(function(){if(_[_0x9118('0x55')](_0x3edea6[_0x9118('0x73')])){loggerBooked[_0x9118('0x68')](_0x9118('0x74'),_0x4018b8);}_0x3edea6[_0x9118('0x73')]=!![];loggerBooked['info'](_0x9118('0x75'),_0x4018b8,JSON[_0x9118('0x76')](_[_0x9118('0x77')](_0x3edea6,['name',_0x9118('0x73')])));},0x1f3);}function checkInterval(_0xedc3f1){return function(){if(!isNotNull(_0xedc3f1[_0x9118('0x78')])){_0xedc3f1['message']=utils[_0x9118('0x6b')][_0x9118('0x79')];throw _0xedc3f1['name']+_0x9118('0x7a');}if(!isNotNull(_0xedc3f1[_0x9118('0x78')][_0x9118('0x7b')])){_0xedc3f1[_0x9118('0x6e')]=utils[_0x9118('0x6b')][_0x9118('0x79')];throw _0xedc3f1[_0x9118('0x48')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x9118('0x4a')](_0xedc3f1[_0x9118('0x78')]['Intervals']))){_0xedc3f1[_0x9118('0x6e')]=utils[_0x9118('0x6b')][_0x9118('0x79')];throw _0xedc3f1[_0x9118('0x48')]+_0x9118('0x7a');}};}function checkIsIVRCampaignActive(_0x53c248){return function(){if(!utils[_0x9118('0x7c')](_0x53c248)){_0x53c248[_0x9118('0x6e')]=utils[_0x9118('0x6b')][_0x9118('0x7d')];throw _0x53c248[_0x9118('0x48')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x237536){if(utils[_0x9118('0x7e')](_0x237536)){emit(util[_0x9118('0x7f')](_0x9118('0x80'),_0x237536['name']),_0x9118('0x81'),_0x237536);}}function loggerCatchQueueSummary(_0x34bc3b,_0x2c7208){return function(_0x337513){clearPredictiveAttributes(_0x2c7208);emitCampaignSummary(_0x2c7208);loggerSyncQueueSummary[_0x9118('0x44')](_0x34bc3b,util[_0x9118('0x46')](_0x337513,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x5e03e4){if(_0x5e03e4[_0x9118('0x82')]){if(_0x5e03e4[_0x9118('0x83')]===0x0){_0x5e03e4[_0x9118('0x82')]=![];_0x5e03e4[_0x9118('0x6e')]=utils[_0x9118('0x6b')][_0x9118('0x7d')];loggerSyncQueueSummary[_0x9118('0x44')](_0x9118('0x84'),_0x5e03e4[_0x9118('0x48')],_0x9118('0x85'));}else{_0x5e03e4[_0x9118('0x6e')]=utils[_0x9118('0x6b')]['DISACTIVED'];loggerSyncQueueSummary['debug'](_0x9118('0x84'),_0x5e03e4[_0x9118('0x48')],_0x9118('0x86'));}emitCampaignSummary(_0x5e03e4);}}function myreject(_0x54641f){return function(_0x57c584){return _0x54641f(msgResponse('[ifTime][Action]',_0x9118('0x87'),JSON[_0x9118('0x76')](_0x57c584)));};}Dialer[_0x9118('0x1a')][_0x9118('0x88')]=function(_0x162702){return!_[_0x9118('0x55')](_0x162702)&&_0x162702&&!_[_0x9118('0x55')](_0x162702[_0x9118('0x48')])&&!_[_0x9118('0x55')](_0x162702['active'])&&_0x162702[_0x9118('0x89')]&&(this[_0x9118('0x21')][util[_0x9118('0x7f')]('SIP/%s',_0x162702[_0x9118('0x48')])][_0x9118('0x8a')]===_0x9118('0x8b')||this[_0x9118('0x21')][util[_0x9118('0x7f')](_0x9118('0x8c'),_0x162702[_0x9118('0x48')])][_0x9118('0x8a')]===_0x9118('0x8d'));};Dialer['prototype'][_0x9118('0x8e')]=function(_0x295334){var _0x39f2c0=this;return function(){if(!_0x39f2c0[_0x9118('0x88')](_0x295334[_0x9118('0x8f')])){if(!_0x39f2c0[_0x9118('0x88')](_0x295334[_0x9118('0x90')])){_0x295334[_0x9118('0x6e')]=utils[_0x9118('0x6b')]['TRUNK_NOT_REACHABLE'];throw _0x295334['name']+_0x9118('0x91');}}};};Dialer['prototype'][_0x9118('0x92')]=function(_0x510b04,_0x15a2f2,_0x2e00eb,_0x444d4a){var _0x433453=this;return function(){var _0x4fc24e=!![];return _0x433453[_0x9118('0x93')](_0x510b04,_0x15a2f2,_0x2e00eb,_0x444d4a,_0x4fc24e);};};Dialer[_0x9118('0x1a')][_0x9118('0x94')]=function(_0xc6e34f,_0xff9178,_0x212fb1,_0x5a17f4){var _0x47d793=this;return function(){var _0x13c36f=![];return _0x47d793[_0x9118('0x93')](_0xc6e34f[_0x9118('0x7b')],_0xff9178,_0x212fb1,_0x5a17f4,_0x13c36f);};};Dialer[_0x9118('0x1a')][_0x9118('0x93')]=function(_0xdb0dca,_0x506322,_0x5bcc95,_0x485912,_0x140e66){var _0x190e85=[];return new Promise(function(_0xcc5304,_0x40429f){if(!isNotNull(_0xdb0dca)){_0x485912['message']=utils[_0x9118('0x6b')][_0x9118('0x79')];return _0x40429f(msgResponse(_0x9118('0x95'),_0x9118('0x96'),_0x5bcc95+_0x9118('0x97')));}if(_[_0x9118('0x4a')](_0xdb0dca)){_0x485912[_0x9118('0x6e')]=utils[_0x9118('0x6b')][_0x9118('0x98')];return _0x40429f(msgResponse(_0x9118('0x95'),_0x9118('0x96'),_0x5bcc95+_0x9118('0x99')));}if(_0x506322&&_[_0x9118('0x55')](config[_0x9118('0x9a')][_0x506322])){_0x485912['message']=utils['CAMPAIGN_STATUS'][_0x9118('0x9b')];return _0x40429f(msgResponse(_0x9118('0x95'),_0x9118('0x96'),_0x5bcc95+_0x9118('0x9c')+_0x506322));}if(_[_0x9118('0x9d')](_0xdb0dca)){for(var _0x29d826=0x0;_0x29d826<_0xdb0dca[_0x9118('0x9e')];_0x29d826+=0x1){_0x190e85[_0x9118('0x9f')](ami[_0x9118('0xa0')]({'action':_0x9118('0xa1'),'command':util[_0x9118('0x7f')]('iftime\x20%s,%s',_0xdb0dca[_0x29d826][_0x9118('0xa2')],!_[_0x9118('0x55')](config['timezones'][_0x506322])?_0x506322:'')})[_0x9118('0x40')](function(_0x45f115){return _0x45f115[_0x9118('0xa3')][_0x9118('0xa4')]('true')>=0x0;})[_0x9118('0xa5')](myreject(_0x40429f)));}}else{_0x190e85['push'](ami[_0x9118('0xa0')]({'action':_0x9118('0xa1'),'command':util[_0x9118('0x7f')](_0x9118('0xa6'),_0xdb0dca,!_[_0x9118('0x55')](config[_0x9118('0x9a')][_0x506322])?_0x506322:'')})['then'](function(_0x17b746){return _0x17b746[_0x9118('0xa3')][_0x9118('0xa4')]('true')>=0x0;})[_0x9118('0xa5')](myreject(_0x40429f)));}Promise['all'](_0x190e85)[_0x9118('0x40')](function(_0x5b02fb){var _0x18de57=_[_0x9118('0xa7')](_0x5b02fb);if(_0x18de57){return _0xcc5304(_0x18de57);}else{_0x485912[_0x9118('0x6e')]=_0x140e66?utils[_0x9118('0x6b')][_0x9118('0xa8')]:utils['CAMPAIGN_STATUS'][_0x9118('0xa9')];return _0x40429f(msgResponse(_0x9118('0xaa'),_0x9118('0x96'),_0x9118('0xab')+_0x140e66+'\x20'+_0x5bcc95+'\x20Interval\x20is\x20overtime:\x20'+util[_0x9118('0x46')](_0xdb0dca,{'showHidden':![],'depth':null})+_0x9118('0xac')+_0x506322));}})[_0x9118('0xa5')](function(_0x3e20e4){return _0x40429f(msgResponse('ifTime','Failure',JSON[_0x9118('0x76')](_0x3e20e4)));});});};Dialer[_0x9118('0x1a')][_0x9118('0x3e')]=function(){var _0x11076d=this;return cmHopper[_0x9118('0xad')]({'active':![]},{'where':{'active':!![]}})[_0x9118('0x40')](function(){setInterval(function(){_0x11076d[_0x9118('0xae')]();},0x3e8);});};Dialer['prototype'][_0x9118('0xae')]=function(){var _0x5f3b01=this;var _0xf9ee69;for(var _0x27ab18 in this['campaigns']){if(typeof this['campaigns'][_0x27ab18]!==_0x9118('0xaf')){_0xf9ee69=this['campaigns'][_0x27ab18];if(utils[_0x9118('0x7e')](_0xf9ee69)&&utils[_0x9118('0x7c')](_0xf9ee69)){_0xf9ee69[_0x9118('0x82')]=!![];Promise[_0x9118('0xb0')]()[_0x9118('0x40')](checkIsIVRCampaignActive(_0xf9ee69))[_0x9118('0x40')](checkInterval(_0xf9ee69))['then'](_0x5f3b01[_0x9118('0x8e')](_0xf9ee69))[_0x9118('0x40')](_0x5f3b01['checkIfTime'](_0xf9ee69['dialGlobalInterval'],_0xf9ee69[_0x9118('0xb1')],_0xf9ee69[_0x9118('0x48')],_0xf9ee69))[_0x9118('0x40')](_0x5f3b01[_0x9118('0x94')](_0xf9ee69['Interval'],_0xf9ee69[_0x9118('0xb1')],_0xf9ee69[_0x9118('0x48')],_0xf9ee69))[_0x9118('0x40')](_0x5f3b01[_0x9118('0xb2')](_0xf9ee69))[_0x9118('0xa5')](loggerCatchQueueSummary(_0x9118('0xb3'),_0xf9ee69));}else{notSendMessagesCampaign(_0xf9ee69);}}}};Dialer['prototype'][_0x9118('0xb4')]=function(_0x5b2944){if(_0x5b2944[_0x9118('0xb5')]!==_0x9118('0xa')){clearPredictiveAttributes(_0x5b2944);}switch(_0x5b2944[_0x9118('0xb5')]){case _0x9118('0xb6'):this[_0x9118('0xb7')](_0x5b2944,0x1);break;case'power':this[_0x9118('0xb7')](_0x5b2944,_0x5b2944['dialPowerLevel']);break;case'predictive':this['predictive'](_0x5b2944);break;case _0x9118('0xb8'):this['handlePower'](_0x5b2944,0x1);break;default:logger[_0x9118('0x68')](_0x9118('0xb9'),_0x5b2944['name'],_0x9118('0xba'));}};Dialer[_0x9118('0x1a')]['ifTime']=function(_0x362e66,_0x27266f){var _0x2ab593=_0x362e66[_0x9118('0xb1')];var _0x54a2ef=_0x27266f?_0x362e66['dialGlobalInterval']:_0x362e66[_0x9118('0x78')]['Intervals'];logger[_0x9118('0xbb')](_0x9118('0xbc'),_0x54a2ef,_0x2ab593,_0x362e66[_0x9118('0x48')],util['format']('Voice\x20Queue\x20%s\x20$s',_0x362e66[_0x9118('0x48')],_0x362e66['id']));var _0x17ae69=null;return Interval['intervalIftime'](_0x54a2ef,_0x2ab593)[_0x9118('0x40')](function(_0x18890b){if(_0x18890b===!![]){return _0x18890b;}else{_0x362e66[_0x9118('0x6e')]=_0x27266f?utils[_0x9118('0x6b')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x9118('0x6b')][_0x9118('0xa9')];_0x17ae69=msgResponse(_0x9118('0xaa'),'Failure',_0x9118('0xab')+_0x27266f+'\x20'+_0x362e66[_0x9118('0x48')]+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x54a2ef,{'showHidden':![],'depth':null})+_0x9118('0xac')+_0x2ab593);}if(_0x17ae69!==null){logger[_0x9118('0xbb')](_0x9118('0xbd'),_0x17ae69);_0x17ae69[_0x9118('0xbe')]=_0x27266f;throw _0x17ae69;}})[_0x9118('0xa5')](function(_0x162b3d){logger[_0x9118('0x68')](_0x9118('0xbf'),_0x162b3d);throw msgResponse('[ifTime][Action]',_0x9118('0x87'),util[_0x9118('0x46')](_0x162b3d,{'showHidden':![],'depth':null}));});};Dialer[_0x9118('0x1a')][_0x9118('0x2d')]=function(_0x5871b5){if(this['voiceQueues'][_0x5871b5[_0x9118('0xc0')]]){if(this[_0x9118('0x25')][_0x5871b5[_0x9118('0xc1')]]&&this[_0x9118('0x25')][_0x5871b5[_0x9118('0xc1')]]['type']!==_0x9118('0xc2')){utils[_0x9118('0xc3')](this[_0x9118('0x1e')][_0x5871b5['queue']],_0x9118('0xc4'));this[_0x9118('0x25')][_0x5871b5[_0x9118('0xc1')]]['answertime']=moment()['format'](_0x9118('0xc5'));}}};Dialer['prototype'][_0x9118('0x33')]=function(_0x268481){var _0x2e3c54=this[_0x9118('0x25')][_0x268481['uniqueid']];if(this['voiceQueues'][_0x268481['queue']]){if(_0x2e3c54&&_0x2e3c54[_0x9118('0x43')]!=='ivr'){delete this['uniqueId'][_0x268481[_0x9118('0xc1')]];this['voiceQueues'][_0x268481[_0x9118('0xc0')]][_0x9118('0xc6')]+=0x1;var _0x4e77da=new AgentComplete(_0x2e3c54,_0x268481);if(_0x268481[_0x9118('0xc7')]===_0x9118('0xc8')){_0x4e77da[_0x9118('0xc9')]=this['voiceQueues'][_0x268481[_0x9118('0xc0')]][_0x9118('0xca')]&&this[_0x9118('0x1e')][_0x268481[_0x9118('0xc0')]][_0x9118('0xcb')]?moment()[_0x9118('0x7f')](_0x9118('0xc5')):undefined;}hopperUtils[_0x9118('0xcc')](_0x4e77da)[_0x9118('0xa5')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x9118('0xcd')](_0x4e77da)[_0x9118('0xa5')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x9118('0x1a')]['syncQueueCallerAbandon']=function(_0x1a276f){var _0x3fc900=this[_0x9118('0x25')][_0x1a276f[_0x9118('0xc1')]];var _0xd864ab=this;var _0x1f4c2b=![];var _0x2e37c1;var _0x22fa16;if(this[_0x9118('0x1e')][_0x1a276f[_0x9118('0xc0')]]){if(_0x3fc900&&_0x3fc900[_0x9118('0x43')]!==_0x9118('0xc2')){delete this[_0x9118('0x25')][_0x1a276f[_0x9118('0xc1')]];utils['decrementOriginate'](this['voiceQueues'][_0x1a276f['queue']],_0x9118('0xce'));_0x3fc900[_0x9118('0xcf')]=moment()[_0x9118('0x7f')](_0x9118('0xc5'));var _0x2aa555=new QueueCallerAbandon(_0x3fc900,_0x1a276f);if(utils[_0x9118('0x62')](_0x3fc900[_0x9118('0xcf')],_0x3fc900[_0x9118('0xd0')])>=_0x3fc900[_0x9118('0xd1')]){this[_0x9118('0x1e')][_0x1a276f[_0x9118('0xc0')]][_0x9118('0x50')]+=0x1;this[_0x9118('0x1e')][_0x1a276f['queue']][_0x9118('0xd2')]+=0x1;this['voiceQueues'][_0x1a276f[_0x9118('0xc0')]][_0x9118('0xd3')]+=0x1;_0x2aa555[_0x9118('0xd4')]=0xa;_0x2aa555[_0x9118('0xd5')]=_0x9118('0xd6');_0x2aa555['dropreason']=_0x9118('0xd7');_0x2aa555[_0x9118('0xc9')]=this[_0x9118('0x1e')][_0x1a276f[_0x9118('0xc0')]]['dialQueueProject2']?moment()[_0x9118('0x7f')](_0x9118('0xc5')):undefined;_0x2aa555['countdropretry']+=0x1;_0x2aa555['countglobal']+=0x1;_0x2e37c1=this[_0x9118('0x1e')][_0x1a276f[_0x9118('0xc0')]]['dialDropRetryFrequency'];_0x22fa16=this['voiceQueues'][_0x1a276f[_0x9118('0xc0')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x9118('0xd8')](_0x2aa555,_0x2aa555[_0x9118('0xd4')],_0x3fc900[_0x9118('0xd9')])['then'](function(_0x23dceb){_0x1f4c2b=_0x23dceb[_0x9118('0xda')]==0x1;if(_0x2aa555[_0x9118('0xdb')]>=_0xd864ab['voiceQueues'][_0x1a276f['queue']][_0x9118('0xdc')]){_0xd864ab[_0x9118('0xdd')](_0x2aa555,_0x23dceb[_0x9118('0xda')]);}else{hopperUtils[_0x9118('0xde')]({'active':![],'countdropretry':_0x2aa555[_0x9118('0xdb')],'scheduledat':moment()[_0x9118('0xdf')](_0xd864ab[_0x9118('0x1e')][_0x1a276f[_0x9118('0xc0')]][_0x9118('0xe0')],'minutes')[_0x9118('0x7f')](_0x9118('0xc5')),'ContactId':_0x3fc900[_0x9118('0xe1')],'ListId':_0x3fc900[_0x9118('0xe2')],'VoiceQueueId':_0x3fc900[_0x9118('0xe3')]||undefined,'CampaignId':_0x3fc900[_0x9118('0xe4')]||undefined})[_0x9118('0xa5')](loggerCatch(_0x9118('0xe5')));var _0x4f56dd=new History(_0x2aa555);_0x4f56dd['state']=0xa;_0x4f56dd[_0x9118('0xd5')]='Drop';_0x4f56dd[_0x9118('0x72')]=moment()[_0x9118('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f56dd['endtime']=_0x4f56dd['starttime'];_0x4f56dd[_0x9118('0xe6')]=_0x2aa555['calleridname'];_0x4f56dd['calleridnum']=_0x2aa555['calleridnum'];hopperUtils[_0x9118('0xcc')](_0x4f56dd)['catch'](loggerCatch(_0x9118('0xe7')));}})['then'](function(){if(_0x1f4c2b)hopperUtils[_0x9118('0xe8')](_0x2aa555,_0x2e37c1,_0x22fa16)[_0x9118('0x40')](function(){return 0x1;});});}else{this[_0x9118('0x1e')][_0x1a276f[_0x9118('0xc0')]][_0x9118('0x51')]+=0x1;this[_0x9118('0x1e')][_0x1a276f['queue']][_0x9118('0xe9')]+=0x1;_0x2aa555[_0x9118('0xd4')]=0xb;_0x2aa555[_0x9118('0xd5')]=_0x9118('0xea');_0x2aa555[_0x9118('0xeb')]='CALLEREXIT';_0x2aa555[_0x9118('0xec')]+=0x1;_0x2aa555['countglobal']+=0x1;_0x2e37c1=this[_0x9118('0x1e')][_0x1a276f[_0x9118('0xc0')]]['dialAbandonedRetryFrequency'];_0x22fa16=this[_0x9118('0x1e')][_0x1a276f[_0x9118('0xc0')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x9118('0xd8')](_0x2aa555,_0x2aa555[_0x9118('0xd4')],_0x3fc900['voiceQueue'])['then'](function(_0x2d82eb){if(_0x2aa555[_0x9118('0xec')]>=_0xd864ab[_0x9118('0x1e')][_0x1a276f[_0x9118('0xc0')]][_0x9118('0xed')]){_0xd864ab[_0x9118('0xdd')](_0x2aa555,_0x2d82eb[_0x9118('0xda')]);}else{hopperUtils[_0x9118('0xde')]({'active':![],'countabandonedretry':_0x2aa555[_0x9118('0xec')],'scheduledat':moment()[_0x9118('0xdf')](_0xd864ab[_0x9118('0x1e')][_0x1a276f[_0x9118('0xc0')]][_0x9118('0xee')],_0x9118('0xef'))[_0x9118('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3fc900[_0x9118('0xe1')],'ListId':_0x3fc900[_0x9118('0xe2')],'VoiceQueueId':_0x3fc900[_0x9118('0xe3')]||undefined,'CampaignId':_0x3fc900[_0x9118('0xe4')]||undefined})['catch'](loggerCatch(_0x9118('0xf0')));var _0x2772d1=new History(_0x2aa555);_0x2772d1[_0x9118('0xd4')]=0xb;_0x2772d1['statedesc']='Abandoned';_0x2772d1[_0x9118('0x72')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2772d1['endtime']=_0x2772d1[_0x9118('0x72')];_0x2772d1[_0x9118('0xe6')]=_0x2aa555[_0x9118('0xe6')];_0x2772d1[_0x9118('0xf1')]=_0x2aa555[_0x9118('0xf1')];hopperUtils['createHistory'](_0x2772d1)[_0x9118('0xa5')](loggerCatch(_0x9118('0xf2')));}})[_0x9118('0x40')](function(){if(_0x1f4c2b)hopperUtils[_0x9118('0xe8')](_0x2aa555,_0x2e37c1,_0x22fa16)[_0x9118('0x40')](function(){return 0x1;});});}}}};Dialer[_0x9118('0x1a')]['syncNewExten']=function(_0x43539d){if(this[_0x9118('0x23')][_0x43539d[_0x9118('0xc1')]]){this[_0x9118('0x23')][_0x43539d[_0x9118('0xc1')]][_0x9118('0xf3')]=_0x43539d[_0x9118('0xf3')];}if(this['uniqueId'][_0x43539d[_0x9118('0xc1')]]){this[_0x9118('0x25')][_0x43539d[_0x9118('0xc1')]][_0x9118('0xf3')]=_0x43539d[_0x9118('0xf3')];}};Dialer[_0x9118('0x1a')][_0x9118('0x3b')]=function(_0x2babf8){if(!this[_0x9118('0x23')][_0x2babf8[_0x9118('0xf4')]]){return;}var _0x1f67c2=this[_0x9118('0x1e')][this[_0x9118('0x23')][_0x2babf8['actionid']][_0x9118('0xc0')]][_0x9118('0xf5')]||_0x9118('0xf6');if(_0x1f67c2===_0x9118('0xf7')){if(this[_0x9118('0x23')][_0x2babf8[_0x9118('0xf4')]]&&_['isNil'](this[_0x9118('0x23')][_0x2babf8[_0x9118('0xf4')]][_0x9118('0xf8')])&&_0x2babf8[_0x9118('0x8a')]==='1'&&_0x2babf8[_0x9118('0xf9')]==='0'){if(this[_0x9118('0x20')][_0x2babf8[_0x9118('0xfa')]]){if(!this[_0x9118('0x20')][_0x2babf8[_0x9118('0xfa')]]['locked']){this[_0x9118('0x20')][_0x2babf8[_0x9118('0xfa')]]['locked']=!![];this[_0x9118('0x23')][_0x2babf8['actionid']][_0x9118('0xf8')]=!![];this['actions'][_0x2babf8['actionid']][_0x9118('0xfa')]=_0x2babf8[_0x9118('0xfa')];}}}}else if(_0x1f67c2===_0x9118('0xf6')){if(this[_0x9118('0x23')][_0x2babf8[_0x9118('0xf4')]]){if(this[_0x9118('0x20')][_0x2babf8['stateinterface']]){this[_0x9118('0x23')][_0x2babf8['actionid']][_0x9118('0xfa')]=_0x2babf8[_0x9118('0xfa')];if(_[_0x9118('0xfb')](this[_0x9118('0x29')][this[_0x9118('0x23')][_0x2babf8[_0x9118('0xf4')]]['queue']])){this[_0x9118('0x29')][this[_0x9118('0x23')][_0x2babf8[_0x9118('0xf4')]][_0x9118('0xc0')]]=[];}this[_0x9118('0x29')][this[_0x9118('0x23')][_0x2babf8[_0x9118('0xf4')]][_0x9118('0xc0')]][_0x9118('0x9f')](_[_0x9118('0x61')](_[_0x9118('0x77')](this['actions'][_0x2babf8[_0x9118('0xf4')]],['idHopper',_0x9118('0xfa')]),{'status':_0x2babf8[_0x9118('0x8a')],'paused':_0x2babf8[_0x9118('0xf9')]}));}}}};Dialer['prototype']['syncQueueStatusComplete']=function(_0x1e00a7){if(!this['actions'][_0x1e00a7[_0x9118('0xf4')]]){return;}var _0xa1ca36=this;var _0x6620f=this[_0x9118('0x1e')][this['actions'][_0x1e00a7[_0x9118('0xf4')]][_0x9118('0xc0')]];var _0xbbba21=_0x6620f[_0x9118('0xf5')]||_0x9118('0xf6');if(_0xbbba21===_0x9118('0xf7')){if(this[_0x9118('0x23')][_0x1e00a7[_0x9118('0xf4')]]&&this[_0x9118('0x23')][_0x1e00a7[_0x9118('0xf4')]][_0x9118('0xfa')]){this[_0x9118('0x1d')][_0x9118('0xfc')](this[_0x9118('0x23')][_0x1e00a7[_0x9118('0xf4')]][_0x9118('0xfd')],this['actions'][_0x1e00a7['actionid']]['stateinterface'])[_0x9118('0xa5')](function(_0x345716){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x9118('0x46')](_0x345716,{'showHidden':![],'depth':null}));})[_0x9118('0xfe')](function(){utils['decrementOriginate'](_0xa1ca36[_0x9118('0x1e')][_0xa1ca36[_0x9118('0x23')][_0x1e00a7[_0x9118('0xf4')]][_0x9118('0xc0')]],_0x9118('0xff'));_0xa1ca36[_0x9118('0x20')][_0xa1ca36[_0x9118('0x23')][_0x1e00a7['actionid']]['stateinterface']][_0x9118('0xf8')]=![];delete _0xa1ca36[_0x9118('0x23')][_0x1e00a7['actionid']];unlockQueueStatus(_0x6620f);});}else{utils[_0x9118('0xc3')](this[_0x9118('0x1e')][this[_0x9118('0x23')][_0x1e00a7[_0x9118('0xf4')]][_0x9118('0xc0')]],_0x9118('0xff'));hopperUtils['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x1e00a7[_0x9118('0xf4')]]['ContactId'],'ListId':this[_0x9118('0x23')][_0x1e00a7[_0x9118('0xf4')]][_0x9118('0xe2')],'VoiceQueueId':this['actions'][_0x1e00a7[_0x9118('0xf4')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x9118('0x23')][_0x1e00a7[_0x9118('0xf4')]][_0x9118('0xe4')]||undefined})[_0x9118('0xa5')](loggerCatch(_0x9118('0x100')));delete this['actions'][_0x1e00a7[_0x9118('0xf4')]];unlockQueueStatus(_0x6620f);}}else if(_0xbbba21===_0x9118('0xf6')){var _0x57661b;if(this[_0x9118('0x23')][_0x1e00a7[_0x9118('0xf4')]]&&!_[_0x9118('0x4a')](this[_0x9118('0x29')][this[_0x9118('0x23')][_0x1e00a7[_0x9118('0xf4')]][_0x9118('0xc0')]])){if(this['queueBookedRR'][_0xa1ca36[_0x9118('0x23')][_0x1e00a7[_0x9118('0xf4')]][_0x9118('0xc0')]]){this[_0x9118('0x2a')][_0xa1ca36[_0x9118('0x23')][_0x1e00a7['actionid']]['queue']]=this['queueBookedRR'][this[_0x9118('0x23')][_0x1e00a7[_0x9118('0xf4')]][_0x9118('0xc0')]]?this[_0x9118('0x2a')][this['actions'][_0x1e00a7[_0x9118('0xf4')]]['queue']]:this[_0x9118('0x29')][this['actions'][_0x1e00a7[_0x9118('0xf4')]][_0x9118('0xc0')]]?this['queueBooked'][this['actions'][_0x1e00a7['actionid']][_0x9118('0xc0')]][_0x9118('0x101')]||0x0:0x0;}this[_0x9118('0x29')][this[_0x9118('0x23')][_0x1e00a7[_0x9118('0xf4')]][_0x9118('0xc0')]][_0x9118('0x101')]=this['queueBookedRR'][this[_0x9118('0x23')][_0x1e00a7[_0x9118('0xf4')]][_0x9118('0xc0')]];for(var _0x2fa639=0x0;_0x2fa639=_0x2a71fd[_0x9118('0x126')]){_0x43a8d0[_0x9118('0x127')](_0x4966bd,_0x4167ca,_0x5458ec,'reason19\x20machine....');}else{if(_0x4966bd['countmachineretry']>=_0x2a71fd[_0x9118('0x128')]){_0x43a8d0[_0x9118('0x129')](_0x4966bd,_0x4167ca,_0x5458ec,'reason\x2019\x20machine....');}else{hopperUtils[_0x9118('0xde')]({'active':![],'countmachineretry':_0x4966bd[_0x9118('0x11c')],'scheduledat':moment()['add'](_0x2a71fd[_0x9118('0x12a')],_0x9118('0xef'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4966bd['ContactId'],'ListId':_0x4966bd[_0x9118('0xe2')],'VoiceQueueId':_0x4966bd['VoiceQueueId']||undefined,'CampaignId':_0x4966bd[_0x9118('0xe4')]||undefined})[_0x9118('0xa5')](loggerCatch('[rescheduleContact][Machine]'));_0x4167ca({'reschedule':0x1});}}});}if(_0x59cc74[_0x9118('0x43')]===_0x9118('0xc2')&&this[_0x9118('0x1f')][_0x59cc74['queue']][_0x9118('0x110')]&&_0x17e621['value']==='HANGUP'){delete this[_0x9118('0x25')][_0x17e621['uniqueid']];utils[_0x9118('0xc3')](this[_0x9118('0x1f')][_0x59cc74[_0x9118('0xc0')]],_0x9118('0x11a'));_0x155a39=new Hangup(_0x59cc74,_0x17e621);_0x155a39['state']=0x12;_0x155a39[_0x9118('0xd5')]=_0x9118('0x113');_0x155a39['membername']='AMD';ami[_0x9118('0x42')](_0x9118('0x11e'),ut[_0x9118('0x11f')](_0x155a39,_0x9118('0x115')));this[_0x9118('0x116')](_0x155a39,_0x9118('0x12b'),_0x9118('0x12c'));}if(_0x59cc74[_0x9118('0x43')]===_0x9118('0xc2')&&this[_0x9118('0x1f')][_0x59cc74[_0x9118('0xc0')]][_0x9118('0x110')]&&_0x17e621['value']==='MACHINE'){return new Promise(function(_0x1bf420,_0x2a99e5){delete _0x43a8d0[_0x9118('0x25')][_0x17e621[_0x9118('0xc1')]];utils[_0x9118('0xc3')](_0x43a8d0[_0x9118('0x1f')][_0x59cc74['queue']],'[syncVarSet]');_0x43a8d0[_0x9118('0x1f')][_0x59cc74[_0x9118('0xc0')]]['outboundAnswerCallsDay']+=0x1;_0x43a8d0['campaigns'][_0x59cc74[_0x9118('0xc0')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x45f8f7=_0x43a8d0[_0x9118('0x1f')][_0x59cc74[_0x9118('0xc0')]];var _0x2f9ac0=new Hangup(_0x59cc74,_0x17e621);_0x2f9ac0[_0x9118('0xd4')]=0x13;_0x2f9ac0['statedesc']=_0x9118('0x12d');_0x2f9ac0[_0x9118('0x11b')]=_0x9118('0x114');_0x2f9ac0[_0x9118('0x11c')]+=0x1;_0x2f9ac0[_0x9118('0x11d')]+=0x1;_0x2f9ac0[_0x9118('0x115')]=!![];ami['emit'](_0x9118('0x11e'),ut[_0x9118('0x11f')](_0x2f9ac0,_0x9118('0x115')));hopperUtils[_0x9118('0xcc')](_0x2f9ac0)['catch'](loggerCatch(_0x9118('0x120')));if(_0x2f9ac0['countbusyretry']+_0x2f9ac0[_0x9118('0x122')]+_0x2f9ac0['countnoanswerretry']+_0x2f9ac0['countnosuchnumberretry']+_0x2f9ac0[_0x9118('0xdb')]+_0x2f9ac0[_0x9118('0xec')]+_0x2f9ac0['countmachineretry']+_0x2f9ac0[_0x9118('0x125')]>=_0x45f8f7['dialGlobalMaxRetry']){_0x43a8d0[_0x9118('0x127')](_0x2f9ac0,_0x1bf420,_0x2a99e5,_0x9118('0x12e'));}else{if(_0x2f9ac0[_0x9118('0x11c')]>=_0x45f8f7['dialMachineMaxRetry']){_0x43a8d0[_0x9118('0x129')](_0x2f9ac0,_0x1bf420,_0x2a99e5,_0x9118('0x12f'));}else{hopperUtils[_0x9118('0xde')]({'active':![],'countmachineretry':_0x2f9ac0[_0x9118('0x11c')],'scheduledat':moment()['add'](_0x45f8f7[_0x9118('0x12a')],_0x9118('0xef'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2f9ac0['ContactId'],'ListId':_0x2f9ac0[_0x9118('0xe2')],'VoiceQueueId':_0x2f9ac0[_0x9118('0xe3')]||undefined,'CampaignId':_0x2f9ac0[_0x9118('0xe4')]||undefined})['catch'](loggerCatch(_0x9118('0x130')));_0x1bf420({'reschedule':0x1});}}});}}};Dialer[_0x9118('0x1a')][_0x9118('0x36')]=function(_0x28ba28){var _0x1852b8=this[_0x9118('0x25')][_0x28ba28['uniqueid']];var _0xf56de0;if(_0x1852b8){if(_0x1852b8[_0x9118('0x43')]==='ivr'){delete this[_0x9118('0x25')][_0x28ba28[_0x9118('0xc1')]];utils[_0x9118('0xc3')](this[_0x9118('0x1f')][_0x1852b8[_0x9118('0xc0')]],_0x9118('0x131'));this[_0x9118('0x1f')][_0x1852b8[_0x9118('0xc0')]][_0x9118('0x132')]+=0x1;_0xf56de0=new Hangup(_0x1852b8,_0x28ba28);hopperUtils[_0x9118('0xcc')](_0xf56de0)[_0x9118('0xa5')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x9118('0xcd')](_0xf56de0)['catch'](loggerCatch(_0x9118('0x133')));}else{if(isNotNull(this[_0x9118('0x1e')][_0x1852b8[_0x9118('0xc0')]][_0x9118('0x134')])){delete this[_0x9118('0x25')][_0x28ba28['uniqueid']];utils[_0x9118('0xc3')](this[_0x9118('0x1e')][_0x1852b8[_0x9118('0xc0')]],_0x9118('0x131'));this[_0x9118('0x1e')][_0x1852b8[_0x9118('0xc0')]][_0x9118('0xc6')]+=0x1;this[_0x9118('0x1e')][_0x1852b8['queue']][_0x9118('0x112')]+=0x1;_0xf56de0=new Hangup(_0x1852b8,_0x28ba28);_0xf56de0[_0x9118('0xd4')]=0x10;_0xf56de0[_0x9118('0xd5')]='AnswerAGI';_0xf56de0['membername']=_0x9118('0x135');hopperUtils[_0x9118('0xcc')](_0xf56de0)[_0x9118('0xa5')](loggerCatch(_0x9118('0x136')));hopperUtils['moveContactManagedDialer'](_0xf56de0)['catch'](loggerCatch(_0x9118('0x133')));}else{delete this[_0x9118('0x25')][_0x28ba28[_0x9118('0xc1')]];utils[_0x9118('0xc3')](this['voiceQueues'][_0x1852b8[_0x9118('0xc0')]],'[syncHangup2]');if(_0x28ba28['cause-txt']===_0x9118('0x137')){this[_0x9118('0x1e')][_0x1852b8['queue']]['outboundAnswerCallsDay']+=0x1;const _0x4a9fa9=new AgentComplete(_0x1852b8,_0x28ba28);_0x4a9fa9[_0x9118('0xe4')]=this[_0x9118('0x1e')][_0x1852b8[_0x9118('0xc0')]]['id'];hopperUtils[_0x9118('0xcc')](_0x4a9fa9)[_0x9118('0xa5')](loggerCatch(_0x9118('0x138')));hopperUtils[_0x9118('0xcd')](_0x4a9fa9)['catch'](loggerCatch(_0x9118('0x139')));}else{this[_0x9118('0x1e')][_0x1852b8[_0x9118('0xc0')]]['outboundUnknownCallsDay']+=0x1;_0xf56de0=new Hangup(_0x1852b8,_0x28ba28);_0xf56de0[_0x9118('0xd4')]=0xc;_0xf56de0[_0x9118('0xd5')]=_0x28ba28[_0x9118('0x13a')];_0xf56de0['membername']=_0x9118('0x13b');hopperUtils['createHistory'](_0xf56de0)[_0x9118('0xa5')](loggerCatch(_0x9118('0x136')));hopperUtils['moveContactManagedDialer'](_0xf56de0)[_0x9118('0xa5')](loggerCatch(_0x9118('0x133')));}}}}};Dialer['prototype']['syncQueueSummary']=function(_0x24b697){var _0x1fea46=this;if(!_0x1fea46[_0x9118('0x2b')][_0x24b697[_0x9118('0x48')]]){_0x1fea46[_0x9118('0x2b')][_0x24b697[_0x9118('0x48')]]={'running':![]};}else if(_0x1fea46['queuesSummary'][_0x24b697['name']]['running']===!![]){return;}else if(_0x1fea46['queuesSummary'][_0x24b697[_0x9118('0x48')]]['running']===![]){_0x1fea46[_0x9118('0x2b')][_0x24b697['name']][_0x9118('0x13c')]=!![];}var _0x1c4de4=_0x1fea46[_0x9118('0x1e')][_0x24b697['name']];var _0xb68f26=_0x1c4de4[_0x9118('0x6e')]!==utils['CAMPAIGN_STATUS'][_0x9118('0x7d')];var _0x201983=utils[_0x9118('0x13d')](_0x1c4de4);_0x1c4de4[_0x9118('0x13e')]=utils[_0x9118('0x13f')](_0x1c4de4,_0x1fea46['trunks']);Promise[_0x9118('0xb0')]()[_0x9118('0x40')](function(){if(_0x1c4de4[_0x9118('0x13e')]===utils[_0x9118('0x6b')]['INACTIVE']){if(_0xb68f26){clearPredictiveAttributes(_0x1c4de4);_0x24b697[_0x9118('0x27')]=undefined;_0x24b697[_0x9118('0x63')]=undefined;}if(_0x1c4de4['statusMessage']===utils[_0x9118('0x6b')]['INACTIVE']){_0x24b697[_0x9118('0x140')]=0x0;_0x24b697['paused']=0x0;_0x24b697['inUse']=0x0;_0x24b697['talking']=0x0;_0x24b697[_0x9118('0x141')]=0x0;}}else if(_0x1c4de4[_0x9118('0x13e')]===utils[_0x9118('0x6b')][_0x9118('0x142')]&&!_0x201983){return _0x1fea46[_0x9118('0x95')](_0x1c4de4,!![])[_0x9118('0x40')](function(){return _0x1fea46[_0x9118('0x95')](_0x1c4de4,![]);})[_0x9118('0x40')](function(){return _0x1fea46[_0x9118('0xb4')](_0x1c4de4);})[_0x9118('0xa5')](function(_0x5336d1){loggerSyncQueueSummary[_0x9118('0x44')](_0x9118('0x143'),util[_0x9118('0x46')](_0x5336d1,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1c4de4);});}else{clearPredictiveAttributes(_0x1c4de4);}})[_0x9118('0x40')](function(){var _0x1f2163=_0x24b697[_0x9118('0x144')](_0x1c4de4);if(_0x1f2163||_0x1c4de4[_0x9118('0x145')]){_0x1c4de4[_0x9118('0x145')]=![];_0x24b697[_0x9118('0x146')](_0x1c4de4);Object[_0x9118('0x147')](_0x1c4de4,_0x24b697);emitOutboundVoiceQueueSummary(_0x24b697);}_0x1fea46[_0x9118('0x2b')][_0x1c4de4[_0x9118('0x48')]][_0x9118('0x13c')]=![];})['catch'](function(_0x1ae0c1){logger['error'](_0x9118('0x143'),util[_0x9118('0x46')](_0x1ae0c1,{'showHidden':![],'depth':null}));_0x1fea46[_0x9118('0x2b')][_0x1c4de4[_0x9118('0x48')]]['running']=![];});};Dialer[_0x9118('0x1a')][_0x9118('0x148')]=_[_0x9118('0x149')](function(){var _0x2467b9=_[_0x9118('0x14a')](this[_0x9118('0x1e')],function(_0xdcb317){return _0xdcb317[_0x9118('0x14b')];});var _0x5d2455=_[_0x9118('0x14a')](this[_0x9118('0x20')],function(_0x4844d8){return _0x4844d8[_0x9118('0x14c')]&&_0x4844d8[_0x9118('0x8a')]===_0x9118('0x8b');});if(_0x2467b9[_0x9118('0x9e')]>0x0&&_0x5d2455['length']>0x0){return Promise[_0x9118('0xb0')]()[_0x9118('0x40')](cmHopper[_0x9118('0x14d')](_['map'](_0x2467b9,'id'),previewRecallmeReminderInterval,_[_0x9118('0x14e')](_0x5d2455,'id')))[_0x9118('0x40')](function(_0x48d0f7){for(var _0x1252db=0x0;_0x1252db<_0x48d0f7[_0x9118('0x9e')];_0x1252db++){var _0x48d92c=_0x48d0f7[_0x1252db][_0x9118('0x14f')][_0x9118('0x48')];if(_0x48d92c)io['to'](util[_0x9118('0x7f')](_0x9118('0x150'),_0x48d92c))[_0x9118('0x42')](_0x9118('0x151'),{'hopper':_0x48d0f7[_0x1252db]});}})[_0x9118('0xa5')](function(_0x20fb05){logger[_0x9118('0x68')](_0x9118('0x152'),_0x20fb05);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x9118('0x1a')][_0x9118('0x153')]=function(){var _0x4af513=this;setInterval(function(){_0x4af513[_0x9118('0x154')](_0x4af513[_0x9118('0x25')],_0x9118('0x155'));_0x4af513[_0x9118('0x154')](_0x4af513['actions'],'[actions]');},0x32c8);};Dialer[_0x9118('0x1a')][_0x9118('0x154')]=function(_0x2bca07,_0x526df1){var _0x18aa41=this;for(var _0x33e5a7 in _0x2bca07){if(typeof _0x2bca07[_0x33e5a7]!=='undefined'){this['sequence']['enqueue'](function(){if(!_[_0x9118('0xfb')](_0x2bca07[_0x33e5a7])){return ami[_0x9118('0xa0')]({'action':'status','channel':_0x2bca07[_0x33e5a7][_0x9118('0xf3')]})[_0x9118('0xa5')](function(_0xe81085){if(_0xe81085[_0x9118('0x6e')]===_0x9118('0x156')){setTimeout(function(){if(_0x2bca07[_0x33e5a7]&&_0x2bca07[_0x33e5a7][_0x9118('0x43')]!==_0x9118('0xc2')){utils['decrementOriginate'](_0x18aa41['voiceQueues'][_0x2bca07[_0x33e5a7][_0x9118('0xc0')]],'[clearZombieChannels]');logger[_0x9118('0x68')](_0x9118('0x157'),_0x526df1,_0x33e5a7,_0x2bca07[_0x33e5a7][_0x9118('0xc0')]);delete _0x2bca07[_0x33e5a7];}if(_0x2bca07[_0x33e5a7]&&_0x2bca07[_0x33e5a7][_0x9118('0x43')]===_0x9118('0xc2')){utils[_0x9118('0xc3')](_0x18aa41[_0x9118('0x1f')][_0x2bca07[_0x33e5a7][_0x9118('0xc0')]],_0x9118('0x158'));logger['error'](_0x9118('0x159'),_0x526df1,_0x33e5a7,_0x2bca07[_0x33e5a7][_0x9118('0xc0')]);delete _0x2bca07[_0x33e5a7];}},0x2328);}});}});}}};Dialer['prototype'][_0x9118('0x15a')]=function(_0x516791){return Promise[_0x9118('0xb0')]()[_0x9118('0x40')](voiceQueueRt[_0x9118('0x15a')](_0x516791))[_0x9118('0xa5')](loggerCatch(_0x9118('0x15b')));};Dialer[_0x9118('0x1a')][_0x9118('0x15c')]=function(_0x1ef441,_0x4a4a5d,_0x5c3887){var _0x455e2f={'state':0x19,'statedesc':'notFound'};utils[_0x9118('0xc3')](_0x4a4a5d,'[emptyContact]'+_0x1ef441);this[_0x9118('0x116')](_[_0x9118('0x61')](_0x455e2f,_['pick'](_0x5c3887,[_0x9118('0xe1'),_0x9118('0xe2'),_0x9118('0x15d'),'VoiceQueueId',_0x9118('0xe4')])),_0x9118('0x15e'),_0x9118('0x15f'));logger['error'](_0x1ef441);};Dialer['prototype']['saveInDb']=function(_0x4ef9a1,_0x512e7b,_0xaa90b8){hopperUtils['createHistory'](_0x4ef9a1)['catch'](loggerCatch(_0x512e7b));hopperUtils[_0x9118('0xcd')](_0x4ef9a1)['catch'](loggerCatch(_0xaa90b8));};Dialer[_0x9118('0x1a')]['queueCallerAbandonCreateState']=function(_0x5449e5,_0x28ecdd){hopperUtils[_0x9118('0xcc')](_0x5449e5)[_0x9118('0xa5')](loggerCatch(_0x9118('0x138')));if(_0x28ecdd==0x0){hopperUtils['moveContactManagedDialer'](_0x5449e5)['catch'](loggerCatch(_0x9118('0x160')));}};Dialer['prototype'][_0x9118('0x152')]=function(_0x4ea547){return Promise[_0x9118('0xb0')]()[_0x9118('0x40')](cmHopper[_0x9118('0x14d')](_0x4ea547['id'],previewRecallmeReminderInterval))[_0x9118('0x40')](function(_0x2489fb){for(var _0x33cbaf=0x0;_0x33cbaf<_0x2489fb[_0x9118('0x9e')];_0x33cbaf++){var _0x3ec931=_0x2489fb[_0x33cbaf][_0x9118('0x14f')][_0x9118('0x48')];if(_0x3ec931)io['to'](util[_0x9118('0x7f')](_0x9118('0x150'),_0x3ec931))['emit'](_0x9118('0x151'),{'hopper':_0x2489fb[_0x33cbaf]});}})['catch'](function(){});};Dialer['prototype']['launchHandleIvr']=function(_0x4eb47a){var _0xe06df0=this;return function(){_0xe06df0[_0x9118('0x161')](_0x4eb47a);};};Dialer[_0x9118('0x1a')][_0x9118('0x162')]=function(_0x28e8c4,_0x56fd3f){var _0xd1d2b1=this;var _0x3bb8a5=uuid['v4']();this[_0x9118('0x23')][_0x3bb8a5]=new Action(_0x28e8c4,_0x56fd3f,_0x3bb8a5);return new Promise(function(_0x5ef633,_0x3218d0){if(_[_0x9118('0x55')](_0x28e8c4)&&typeof _0x28e8c4!==_0x9118('0x163')){return _0x3218d0(msgResponse('originate',_0x9118('0x96'),_0x9118('0x164')));}if(_[_0x9118('0x55')](_0x56fd3f['phone'])||_0x56fd3f[_0x9118('0x165')]===null){return _0x3218d0(msgResponse('originate',_0x9118('0x96'),_0x9118('0x166')));}var _0x6fdc82={'XMD-CALLERID':_0xd1d2b1['actions'][_0x3bb8a5][_0x9118('0x167')](),'XMD-AGI':_0x28e8c4['dialQueueProject']?util[_0x9118('0x7f')](_0x9118('0x168'),ipAgi,_0x28e8c4[_0x9118('0x134')]):_0x9118('0x169'),'XMD-AGIAFTER':_0x28e8c4['dialQueueProject2']?util[_0x9118('0x7f')]('\x22agi://%s/square,%s\x22',ipAgi,_0x28e8c4[_0x9118('0xca')]):'NONE','XMD-QUEUE':utils[_0x9118('0x16a')](_0x28e8c4)?util[_0x9118('0x7f')](_0x9118('0x16b'),_0x28e8c4[_0x9118('0x48')],_0x28e8c4[_0x9118('0x16c')]||'',_0x28e8c4[_0x9118('0xcb')]?'c':'',_0x28e8c4[_0x9118('0xd1')]||0x3):_0x9118('0x169'),'XMD-CONTACTID':_0x56fd3f[_0x9118('0xe1')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xd1d2b1[_0x9118('0x23')][_0x3bb8a5][_0x9118('0x167')](),'XMD-AMD':_0x28e8c4[_0x9118('0x110')]?'ACTIVE':_0x9118('0x169'),'XMD-DESTINATION':_0x9118('0x10f')};if(_0x28e8c4['dialAMDActive']){_0x6fdc82[_0x9118('0x16d')]=_0x28e8c4[_0x9118('0x16e')]||0x9c4;_0x6fdc82[_0x9118('0x16f')]=_0x28e8c4[_0x9118('0x170')]||0x5dc;_0x6fdc82[_0x9118('0x171')]=_0x28e8c4[_0x9118('0x172')]||0x320;_0x6fdc82[_0x9118('0x173')]=_0x28e8c4[_0x9118('0x174')]||0x1388;_0x6fdc82[_0x9118('0x175')]=_0x28e8c4[_0x9118('0x176')]||0x64;_0x6fdc82[_0x9118('0x177')]=_0x28e8c4[_0x9118('0x178')]||0x32;_0x6fdc82[_0x9118('0x179')]=_0x28e8c4['dialAMDMaximumNumberOfWords']||0x3;_0x6fdc82[_0x9118('0x17a')]=_0x28e8c4[_0x9118('0x17b')]||0x100;_0x6fdc82[_0x9118('0x17c')]=_0x28e8c4['dialAMDMaximumWordLength']||0x1388;}if(utils['isOutboundQueue'](_0x28e8c4)){_0x6fdc82[_0x9118('0x17d')]=_0x56fd3f[_0x9118('0xe3')];}else{_0x6fdc82[_0x9118('0x17e')]=_0x56fd3f[_0x9118('0xe4')];}var _0x5393be=utils[_0x9118('0x17f')](_0x56fd3f[_0x9118('0x180')]);Object[_0x9118('0x147')](_0x6fdc82,_0x5393be);var _0x211149=_0xd1d2b1['isTrunkReachable'](_0x28e8c4[_0x9118('0x8f')])?utils[_0x9118('0x181')](_0x28e8c4[_0x9118('0x8f')][_0x9118('0x182')],_0x28e8c4[_0x9118('0x183')],_0x28e8c4[_0x9118('0x184')]>0x0?utils[_0x9118('0x185')](_0x28e8c4[_0x9118('0x186')],_0x28e8c4[_0x9118('0x184')]):_0x28e8c4['dialOriginateCallerIdNumber']):utils[_0x9118('0x181')](_[_0x9118('0xfb')](_0x28e8c4[_0x9118('0x90')])?_0x28e8c4[_0x9118('0x8f')]['callerid']:_0x28e8c4[_0x9118('0x90')][_0x9118('0x182')],_0x28e8c4[_0x9118('0x183')],_0x28e8c4['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x9118('0x185')](_0x28e8c4[_0x9118('0x186')],_0x28e8c4[_0x9118('0x184')]):_0x28e8c4['dialOriginateCallerIdNumber']);if(_0x211149){_0x6fdc82[_0x9118('0x187')]=_0xd1d2b1[_0x9118('0x23')][_0x3bb8a5][_0x9118('0x188')]=utils[_0x9118('0x189')](_0x211149);_0x6fdc82['XMD-ORIGINATECALLERIDNUM']=_0x56fd3f['phone'];}_0x28e8c4[_0x9118('0x18a')]=_0x6fdc82;return ami[_0x9118('0xa0')]({'actionid':_0x3bb8a5,'action':_0x9118('0x18b'),'channel':_0xd1d2b1[_0x9118('0x88')](_0x28e8c4['Trunk'])?util[_0x9118('0x7f')](_0x9118('0x18c'),_0x28e8c4[_0x9118('0x8f')][_0x9118('0x48')],isNotNull(_0x28e8c4[_0x9118('0x18d')])?_0x28e8c4[_0x9118('0x18d')][_0x9118('0x18e')]()||'':'',_0x28e8c4[_0x9118('0x18f')]>0x0?_0x56fd3f[_0x9118('0x165')]['substring'](_0x28e8c4[_0x9118('0x18f')]):_0x56fd3f[_0x9118('0x165')]):util[_0x9118('0x7f')](_0x9118('0x18c'),_[_0x9118('0xfb')](_0x28e8c4[_0x9118('0x90')])?_0x28e8c4[_0x9118('0x8f')]['name']:_0x28e8c4[_0x9118('0x90')][_0x9118('0x48')],isNotNull(_0x28e8c4[_0x9118('0x18d')])?_0x28e8c4['dialPrefix'][_0x9118('0x18e')]()||'':'',_0x28e8c4[_0x9118('0x18f')]>0x0?_0x56fd3f['phone'][_0x9118('0x190')](_0x28e8c4['dialCutDigit']):_0x56fd3f[_0x9118('0x165')]),'callerid':_0x211149,'Exten':'xcally-motion-dialer','Context':_0x9118('0x191'),'Priority':'1','variable':_0x6fdc82,'timeout':(_0x28e8c4['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3bb8a5})[_0x9118('0x40')](function(_0x1b7edb){return _0x5ef633(_0x1b7edb);})[_0x9118('0xa5')](function(_0x365e0f){_0x28e8c4[_0x9118('0x192')]+=0x1;var _0x3ff7e0=new History(_0xd1d2b1[_0x9118('0x23')][_0x3bb8a5]);logger[_0x9118('0x68')](util[_0x9118('0x7f')](_0x9118('0x193'),JSON[_0x9118('0x76')](_0x365e0f)));_0x3ff7e0['state']=0xe;_0x3ff7e0[_0x9118('0xd5')]=_0x9118('0x194');_0x3ff7e0['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3ff7e0['endtime']=_0x3ff7e0[_0x9118('0x72')];hopperUtils[_0x9118('0xcc')](_0x3ff7e0)['catch'](loggerCatch(_0x9118('0x195')));_0xd1d2b1['moveContactManagedDialer'](_0x3ff7e0)[_0x9118('0xa5')](loggerCatch(_0x9118('0x195')))[_0x9118('0xfe')](function(){delete _0xd1d2b1[_0x9118('0x23')][_0x3bb8a5];return _0x3218d0(msgResponse('originate',_0x9118('0x87'),_0x9118('0x196')));});});});};Dialer['prototype']['checkRetriveMax']=function(_0x60fadd,_0x32db7d,_0x1b636b){var _0x3906c5=new History(_0x32db7d);if(_0x3906c5['countbusyretry']+_0x3906c5[_0x9118('0x122')]+_0x3906c5[_0x9118('0x123')]+_0x3906c5[_0x9118('0x124')]+_0x3906c5[_0x9118('0xdb')]+_0x3906c5['countabandonedretry']+_0x3906c5[_0x9118('0x11c')]+_0x3906c5[_0x9118('0x125')]>=_0x1b636b[_0x9118('0x126')]-0x1){return!![];}switch(_0x60fadd){case 0x3:if(_0x3906c5[_0x9118('0x123')]>=_0x1b636b[_0x9118('0x197')]-0x1){return!![];}hopperUtils[_0x9118('0xde')]({'active':![],'countnoanswerretry':_0x3906c5['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x9118('0xdf')](_0x1b636b[_0x9118('0x198')],_0x9118('0xef'))[_0x9118('0x7f')](_0x9118('0xc5')),'ContactId':_0x3906c5[_0x9118('0xe1')],'ListId':_0x3906c5[_0x9118('0xe2')],'VoiceQueueId':_0x3906c5['VoiceQueueId']||undefined,'CampaignId':_0x3906c5[_0x9118('0xe4')]||undefined})[_0x9118('0xa5')](loggerCatch(_0x9118('0x199')));break;case 0x5:if(_0x3906c5[_0x9118('0x121')]>=_0x1b636b[_0x9118('0x19a')]-0x1){return!![];}hopperUtils[_0x9118('0xde')]({'active':![],'countbusyretry':_0x3906c5[_0x9118('0x121')]+=0x1,'scheduledat':moment()[_0x9118('0xdf')](_0x1b636b[_0x9118('0x19b')],_0x9118('0xef'))[_0x9118('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3906c5[_0x9118('0xe1')],'ListId':_0x3906c5['ListId'],'VoiceQueueId':_0x3906c5[_0x9118('0xe3')]||undefined,'CampaignId':_0x3906c5[_0x9118('0xe4')]||undefined})[_0x9118('0xa5')](loggerCatch(_0x9118('0x19c')));break;case 0x8:if(_0x3906c5['countcongestionretry']>=_0x1b636b[_0x9118('0x19d')]-0x1){return!![];}hopperUtils[_0x9118('0xde')]({'active':![],'countcongestionretry':_0x3906c5[_0x9118('0x122')]+=0x1,'scheduledat':moment()['add'](_0x1b636b[_0x9118('0x19e')],_0x9118('0xef'))[_0x9118('0x7f')](_0x9118('0xc5')),'ContactId':_0x3906c5[_0x9118('0xe1')],'ListId':_0x3906c5[_0x9118('0xe2')],'VoiceQueueId':_0x3906c5[_0x9118('0xe3')]||undefined,'CampaignId':_0x3906c5[_0x9118('0xe4')]||undefined})['catch'](loggerCatch(_0x9118('0x19f')));break;case 0x0:if(_0x3906c5['countnosuchnumberretry']>=_0x1b636b['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0x9118('0xde')]({'active':![],'countnosuchnumberretry':_0x3906c5[_0x9118('0x124')]+=0x1,'scheduledat':moment()['add'](_0x1b636b[_0x9118('0x1a0')],_0x9118('0xef'))[_0x9118('0x7f')](_0x9118('0xc5')),'ContactId':_0x3906c5[_0x9118('0xe1')],'ListId':_0x3906c5['ListId'],'VoiceQueueId':_0x3906c5[_0x9118('0xe3')]||undefined,'CampaignId':_0x3906c5['CampaignId']||undefined})[_0x9118('0xa5')](loggerCatch(_0x9118('0x1a1')));}break;case 0xa:if(_0x3906c5[_0x9118('0xdb')]>=_0x1b636b['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0x9118('0xde')]({'active':![],'countdropretry':_0x3906c5[_0x9118('0xdb')]+=0x1,'scheduledat':moment()['add'](_0x1b636b[_0x9118('0xe0')],_0x9118('0xef'))[_0x9118('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3906c5[_0x9118('0xe1')],'ListId':_0x3906c5[_0x9118('0xe2')],'VoiceQueueId':_0x3906c5[_0x9118('0xe3')]||undefined,'CampaignId':_0x3906c5['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x3906c5[_0x9118('0xec')]>=_0x1b636b['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0x9118('0xde')]({'active':![],'countabandonedretry':_0x3906c5[_0x9118('0xec')]+=0x1,'scheduledat':moment()[_0x9118('0xdf')](_0x1b636b[_0x9118('0xee')],'minutes')['format'](_0x9118('0xc5')),'ContactId':_0x3906c5[_0x9118('0xe1')],'ListId':_0x3906c5[_0x9118('0xe2')],'VoiceQueueId':_0x3906c5['VoiceQueueId']||undefined,'CampaignId':_0x3906c5[_0x9118('0xe4')]||undefined})[_0x9118('0xa5')](loggerCatch(_0x9118('0xf0')));break;case 0x13:if(_0x3906c5[_0x9118('0x11c')]>=_0x1b636b[_0x9118('0x128')]-0x1){return!![];}hopperUtils[_0x9118('0xde')]({'active':![],'countmachineretry':_0x3906c5['countmachineretry']+=0x1,'scheduledat':moment()[_0x9118('0xdf')](_0x1b636b[_0x9118('0x12a')],_0x9118('0xef'))[_0x9118('0x7f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3906c5['ContactId'],'ListId':_0x3906c5[_0x9118('0xe2')],'VoiceQueueId':_0x3906c5[_0x9118('0xe3')]||undefined,'CampaignId':_0x3906c5[_0x9118('0xe4')]||undefined})['catch'](loggerCatch(_0x9118('0x130')));break;case 0x14:if(_0x3906c5['countagentrejectretry']>=_0x1b636b[_0x9118('0x1a2')]-0x1){return!![];}hopperUtils[_0x9118('0xde')]({'active':![],'countagentrejectretry':_0x3906c5[_0x9118('0x125')]+=0x1,'scheduledat':moment()[_0x9118('0xdf')](_0x1b636b[_0x9118('0x1a3')],'minutes')[_0x9118('0x7f')](_0x9118('0xc5')),'ContactId':_0x3906c5[_0x9118('0xe1')],'ListId':_0x3906c5[_0x9118('0xe2')],'VoiceQueueId':_0x3906c5['VoiceQueueId']||undefined,'CampaignId':_0x3906c5['CampaignId']||undefined})[_0x9118('0xa5')](loggerCatch(_0x9118('0x1a4')));break;default:return!![];}};Dialer[_0x9118('0x1a')][_0x9118('0x1a5')]=function(_0x42ca19,_0x1155b3,_0x14871b){var _0x23d2d5=this;var _0x58a4f4=new History(_0x42ca19);var _0xc1a18c=![];var _0x207033;var _0x106858;return new Promise(function(_0x31a0b2,_0x104321){if(_[_0x9118('0x55')](_0x1155b3)&&typeof _0x1155b3!==_0x9118('0x163')){return _0x104321(msgResponse('[callProgressDetecting]','Failure',_0x9118('0x1a6')));}if(_['isUndefined'](_0x14871b)&&typeof _0x14871b!==_0x9118('0x163')){return _0x104321(msgResponse(_0x9118('0x1a7'),'Failure','evt\x20is\x20undefine'));}hopperUtils['verifyAdditionalPhones'](_0x58a4f4,_0x14871b[_0x9118('0xc7')],_0x1155b3)[_0x9118('0x40')](function(_0x38bbb9){if(_0x38bbb9['additional']==0x1)_0xc1a18c=!![];switch(_0x14871b[_0x9118('0xc7')]){case'0':_0x1155b3['outboundNoSuchCallsDay']+=0x1;_0x58a4f4['state']=0x0;_0x58a4f4[_0x9118('0xd5')]=_0x9118('0x1a8');_0x58a4f4[_0x9118('0x124')]+=0x1;_0x58a4f4[_0x9118('0x11d')]+=0x1;ami[_0x9118('0x42')]('custom:agentnosuchnumber',ut[_0x9118('0x11f')](_0x42ca19,_0x9118('0x1a9')));_0x207033=_0x1155b3['dialNoSuchNumberRetryFrequency'];_0x106858=_0x1155b3[_0x9118('0x1aa')];hopperUtils[_0x9118('0xcc')](_0x58a4f4)[_0x9118('0xa5')](loggerCatch(_0x9118('0x120')));if(_0x23d2d5['checkRetriveMax'](0x0,_0x42ca19,_0x1155b3)&&!_0xc1a18c){if(_0x58a4f4[_0x9118('0x124')]>=_0x1155b3['dialNoSuchNumberMaxRetry']){_0x23d2d5[_0x9118('0x129')](_0x58a4f4,_0x31a0b2,_0x104321,_0x9118('0x1ab'));}else{_0x23d2d5[_0x9118('0x127')](_0x58a4f4,_0x31a0b2,_0x104321,_0x9118('0x1ab'));}}break;case'3':_0x1155b3[_0x9118('0x1ac')]+=0x1;_0x58a4f4[_0x9118('0xd4')]=0x3;_0x58a4f4[_0x9118('0xd5')]=_0x9118('0x1ad');_0x58a4f4[_0x9118('0x123')]+=0x1;_0x58a4f4['countglobal']+=0x1;var _0x1937ce=ut[_0x9118('0x1ae')](_0x42ca19,_0x1155b3);ami[_0x9118('0x42')]('custom:agentnoanswer',_0x1937ce);_0x207033=_0x1155b3[_0x9118('0x198')];_0x106858=_0x1155b3[_0x9118('0x1aa')];hopperUtils[_0x9118('0xcc')](_0x58a4f4)[_0x9118('0xa5')](loggerCatch(_0x9118('0x1af')));if(_0x23d2d5[_0x9118('0x1b0')](0x3,_0x42ca19,_0x1155b3)&&!_0xc1a18c){if(_0x58a4f4[_0x9118('0x123')]>=_0x1155b3[_0x9118('0x197')]){_0x23d2d5[_0x9118('0x129')](_0x58a4f4,_0x31a0b2,_0x104321,_0x9118('0x1b1'));}else{_0x23d2d5['stateGlobal'](_0x58a4f4,_0x31a0b2,_0x104321,_0x9118('0x1b1'));}}break;case'5':_0x1155b3[_0x9118('0x1b2')]+=0x1;_0x58a4f4['state']=0x5;_0x58a4f4[_0x9118('0xd5')]=_0x9118('0x1b3');_0x58a4f4[_0x9118('0x121')]+=0x1;_0x58a4f4[_0x9118('0x11d')]+=0x1;ami['emit'](_0x9118('0x1b4'),ut[_0x9118('0x11f')](_0x42ca19,'busy'));_0x207033=_0x1155b3['dialBusyRetryFrequency'];_0x106858=_0x1155b3[_0x9118('0x1aa')];hopperUtils[_0x9118('0xcc')](_0x58a4f4)[_0x9118('0xa5')](loggerCatch(_0x9118('0x1b5')));if(_0x23d2d5[_0x9118('0x1b0')](0x5,_0x42ca19,_0x1155b3)&&!_0xc1a18c){if(_0x58a4f4[_0x9118('0x121')]>=_0x1155b3['dialBusyMaxRetry']){_0x23d2d5[_0x9118('0x129')](_0x58a4f4,_0x31a0b2,_0x104321,_0x9118('0x1b6'));}else{_0x23d2d5[_0x9118('0x127')](_0x58a4f4,_0x31a0b2,_0x104321,_0x9118('0x1b6'));}}break;case'8':_0x1155b3[_0x9118('0x1b7')]+=0x1;_0x58a4f4[_0x9118('0xd4')]=0x8;_0x58a4f4[_0x9118('0xd5')]=_0x9118('0x1b8');_0x58a4f4[_0x9118('0x122')]+=0x1;_0x58a4f4[_0x9118('0x11d')]+=0x1;_0x207033=_0x1155b3['dialCongestionRetryFrequency'];_0x106858=_0x1155b3['callAdditionalPhoneAfterMin'];ami['emit'](_0x9118('0x1b9'),ut['buildObj'](_0x42ca19,_0x9118('0x1ba')));hopperUtils[_0x9118('0xcc')](_0x58a4f4)[_0x9118('0xa5')](loggerCatch(_0x9118('0x1bb')));if(_0x23d2d5['checkRetriveMax'](0x8,_0x42ca19,_0x1155b3)&&!_0xc1a18c){if(_0x58a4f4[_0x9118('0x122')]>=_0x1155b3[_0x9118('0x19d')]){_0x23d2d5[_0x9118('0x129')](_0x58a4f4,_0x31a0b2,_0x104321,_0x9118('0x1bc'));}else{_0x23d2d5[_0x9118('0x127')](_0x58a4f4,_0x31a0b2,_0x104321,_0x9118('0x1bc'));}}break;case'11':_0x1155b3[_0x9118('0x1bd')]+=0x1;_0x58a4f4[_0x9118('0xd4')]=0xb;_0x58a4f4[_0x9118('0xd5')]=_0x9118('0xea');_0x58a4f4[_0x9118('0xec')]+=0x1;_0x58a4f4[_0x9118('0x11d')]+=0x1;_0x207033=_0x1155b3[_0x9118('0xee')];_0x106858=_0x1155b3['callAdditionalPhoneAfterMin'];hopperUtils[_0x9118('0xcc')](_0x58a4f4)[_0x9118('0xa5')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x23d2d5[_0x9118('0x1b0')](0xb,_0x42ca19,_0x1155b3)&&!_0xc1a18c){if(_0x58a4f4[_0x9118('0xec')]>=_0x1155b3[_0x9118('0xed')]){_0x23d2d5['createStateFinal'](_0x58a4f4,_0x31a0b2,_0x104321,_0x9118('0x1be'));}else{_0x23d2d5['stateGlobal'](_0x58a4f4,_0x31a0b2,_0x104321,_0x9118('0x1be'));}}break;case'20':_0x1155b3[_0x9118('0x1bf')]+=0x1;_0x58a4f4['state']=0x14;_0x58a4f4[_0x9118('0xd5')]='AgentReject';_0x58a4f4[_0x9118('0x125')]+=0x1;_0x58a4f4[_0x9118('0x11d')]+=0x1;_0x207033=_0x1155b3[_0x9118('0x1a3')];_0x106858=_0x1155b3[_0x9118('0x1aa')];ami[_0x9118('0x42')]('custom:agentreject',ut[_0x9118('0x11f')](_0x42ca19,'agentreject'));hopperUtils['createHistory'](_0x58a4f4)[_0x9118('0xa5')](loggerCatch(_0x9118('0x1c0')));if(_0x23d2d5[_0x9118('0x1b0')](0x14,_0x42ca19,_0x1155b3)&&!_0xc1a18c){if(_0x58a4f4['countagentrejectretry']>=_0x1155b3[_0x9118('0x1a2')]){_0x23d2d5[_0x9118('0x129')](_0x58a4f4,_0x31a0b2,_0x104321,_0x9118('0x1c1'));}else{_0x23d2d5[_0x9118('0x127')](_0x58a4f4,_0x31a0b2,_0x104321,_0x9118('0x1c1'));}}break;default:_0x1155b3[_0x9118('0x1c2')]+=0x1;_0x58a4f4[_0x9118('0xd4')]=0xc;_0x58a4f4[_0x9118('0xd5')]=_0x14871b['reason'];_0x207033=_0x1155b3['dialAgentRejectRetryFrequency'];_0x106858=_0x1155b3[_0x9118('0x1aa')];hopperUtils[_0x9118('0xcc')](_0x58a4f4)[_0x9118('0xa5')](loggerCatch(_0x9118('0x1c3')));if(_0x23d2d5[_0x9118('0x1b0')](_0x14871b[_0x9118('0xc7')],_0x42ca19,_0x1155b3)&&!_0xc1a18c){if(_0x58a4f4[_0x9118('0x121')]+_0x58a4f4[_0x9118('0x122')]+_0x58a4f4[_0x9118('0x123')]+_0x58a4f4[_0x9118('0x124')]+_0x58a4f4[_0x9118('0xdb')]+_0x58a4f4[_0x9118('0xec')]+_0x58a4f4[_0x9118('0x11c')]+_0x58a4f4[_0x9118('0x125')]>=_0x1155b3[_0x9118('0x126')]){_0x23d2d5[_0x9118('0x127')](_0x58a4f4,_0x31a0b2,_0x104321,_0x14871b[_0x9118('0xc7')]);}else{_0x23d2d5[_0x9118('0x129')](_0x58a4f4,_0x31a0b2,_0x104321,_0x14871b[_0x9118('0xc7')]);}}}})['then'](function(){if(_0xc1a18c){hopperUtils[_0x9118('0xe8')](_0x58a4f4,_0x207033,_0x106858)['then'](function(){return _0x31a0b2(0x1);});}});});};Dialer[_0x9118('0x1a')][_0x9118('0x127')]=function(_0x996ab4,_0x132a87,_0x2010aa,_0x1d321a){var _0x343eb6=new Final(_0x996ab4);_0x343eb6[_0x9118('0xd4')]=0xf;_0x343eb6[_0x9118('0xd5')]='Global';this['createStateFinal'](_0x343eb6,_0x132a87,_0x2010aa,_0x1d321a);};Dialer[_0x9118('0x1a')]['createStateFinal']=function(_0x3ec478,_0x3a17bb,_0x244d17,_0x497386){hopperUtils['moveContactManagedDialer'](_0x3ec478)['then'](function(){return _0x3a17bb(msgResponse('[callProgressDetecting]',_0x9118('0x109'),_0x497386));})[_0x9118('0xa5')](function(){return _0x244d17(msgResponse(_0x9118('0x1c4'),'Failure',_0x9118('0x1c5')));});};Dialer[_0x9118('0x1a')][_0x9118('0xa')]=function(_0x6b6e5d){var _0x565557=_0x6b6e5d[_0x9118('0x1c6')]/0x64;var _0x10dbac=_0x6b6e5d[_0x9118('0xd2')]/(_0x6b6e5d[_0x9118('0xd2')]+_0x6b6e5d[_0x9118('0xc6')]);var _0xa313c9=Math[_0x9118('0x1c7')](_0x6b6e5d['predictiveIntervalAvailable']*(_0x6b6e5d['predictiveIntervalMaxThreshold']/0x64));var _0x336229=Math[_0x9118('0x1c7')](_0x6b6e5d[_0x9118('0x1c8')]*(_0x6b6e5d['predictiveIntervalMinThreshold']/0x64));var _0x1e2079=_0x6b6e5d['available']+_0x6b6e5d['talking'];var _0x113986=Math[_0x9118('0x1c9')](_0x6b6e5d['erlangCalls']*_0x6b6e5d[_0x9118('0x60')]*_0x6b6e5d[_0x9118('0x1ca')]*_0x6b6e5d[_0x9118('0x1cb')]);if(_[_0x9118('0x55')](_0x6b6e5d['startProgressive'])){if(!_[_0x9118('0x55')](_0x6b6e5d[_0x9118('0x27')])){_0x6b6e5d[_0x9118('0x27')]=undefined;loggerPredictive[_0x9118('0x68')](_0x9118('0x1cc'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x9118('0x55')](_0x6b6e5d['handlePredictive'])){loggerPredictive['error'](_0x9118('0x1cc'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x6b6e5d[_0x9118('0x66')]);_0x6b6e5d[_0x9118('0x66')]=undefined;}_0x6b6e5d['startProgressive']=moment()[_0x9118('0x7f')](_0x9118('0xc5'));loggerPredictive[_0x9118('0x4b')](_0x6b6e5d[_0x9118('0x48')],_0x9118('0x1cd'),_0x6b6e5d[_0x9118('0x63')]);this['handlePower'](_0x6b6e5d,0x1);}else if(ifInterval(_0x6b6e5d[_0x9118('0x1ce')],_0x6b6e5d[_0x9118('0x63')])){this['handlePower'](_0x6b6e5d,0x1);loggerPredictiveCalls['info'](_0x9118('0x1cf'),_0x6b6e5d[_0x9118('0x63')],_0x6b6e5d[_0x9118('0x48')]);_0x6b6e5d[_0x9118('0x5b')]=0x0;_0x6b6e5d[_0x9118('0xd3')]=0x0;}else if(_0x565557<_0x10dbac&&_0x6b6e5d['dialPredictiveOptimization']===_0x9118('0x1d0')){clearPredictiveAttributes(_0x6b6e5d);loggerPredictive[_0x9118('0x4b')](_0x9118('0x1d1'),_0x9118('0x1d2'),_0x10dbac,_0x9118('0x63'),_0x6b6e5d[_0x9118('0x48')]);}else if(_0x113986<_0x6b6e5d[_0x9118('0xd3')]&&_0x6b6e5d['dialPredictiveOptimization']==='dropRate'){clearPredictiveAttributes(_0x6b6e5d);loggerPredictive[_0x9118('0x4b')](_0x9118('0x1d3'),_0x9118('0x1d4'),_0x113986,_0x9118('0x1d5'),_0x6b6e5d[_0x9118('0xd3')],_0x9118('0x63'),_0x6b6e5d['name']);}else if(!ifInterval(_0x6b6e5d['dialPredictiveInterval'],_0x6b6e5d[_0x9118('0x63')])&&_[_0x9118('0x55')](_0x6b6e5d[_0x9118('0x27')])&&!_[_0x9118('0x55')](_0x6b6e5d['startProgressive'])){_0x6b6e5d[_0x9118('0x27')]=moment()[_0x9118('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x6b6e5d[_0x9118('0x48')],_0x9118('0x1d6'),_0x6b6e5d[_0x9118('0x27')]);hopperUtils[_0x9118('0x1d7')](_0x6b6e5d['dialPredictiveInterval'])[_0x9118('0x40')](this[_0x9118('0x1d8')](_0x6b6e5d))[_0x9118('0x40')](mergeDataErlangB(_0x6b6e5d))[_0x9118('0x40')](this[_0x9118('0x1d9')](_0x6b6e5d))[_0x9118('0xa5')](loggerCatchPredictive(_0x9118('0x1da'),_0x6b6e5d));}else if(!ifInterval(_0x6b6e5d[_0x9118('0x1ce')],_0x6b6e5d[_0x9118('0x27')])){_0x6b6e5d['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x6b6e5d['startPredictive']=moment()[_0x9118('0x7f')](_0x9118('0xc5'));loggerPredictive[_0x9118('0x4b')](_0x6b6e5d[_0x9118('0x48')],'recalculate\x20predictive\x20at',_0x6b6e5d[_0x9118('0x27')]);clearInterval(_0x6b6e5d[_0x9118('0x66')]);_0x6b6e5d[_0x9118('0x66')]=undefined;hopperUtils[_0x9118('0x1d7')](_0x6b6e5d[_0x9118('0x1ce')])[_0x9118('0x40')](this['getDataPredictive'](_0x6b6e5d))[_0x9118('0x40')](mergeDataErlangB(_0x6b6e5d))[_0x9118('0x40')](this[_0x9118('0x1d9')](_0x6b6e5d))['catch'](loggerCatchPredictive(_0x9118('0x1db'),_0x6b6e5d));}else if(_0x6b6e5d['predictiveIntervalAvailable']&&_0x1e2079<_0x6b6e5d[_0x9118('0x1c8')]-_0x336229){clearPredictiveAttributes(_0x6b6e5d);loggerPredictive['info'](_0x6b6e5d['name'],_0x9118('0x1dc'),_0x1e2079,_0x9118('0x1dd'),_0x6b6e5d[_0x9118('0x1c8')],'-',_0x336229,'=',_0x6b6e5d[_0x9118('0x1c8')]-_0x336229,')');}else if(_0x6b6e5d[_0x9118('0x1c8')]&&_0x1e2079>_0x6b6e5d[_0x9118('0x1c8')]+_0xa313c9){clearPredictiveAttributes(_0x6b6e5d);loggerPredictive[_0x9118('0x4b')](_0x6b6e5d['name'],_0x9118('0x1dc'),_0x1e2079,_0x9118('0x1de'),_0x6b6e5d[_0x9118('0x1c8')],'+',_0xa313c9,'=',_0x6b6e5d[_0x9118('0x1c8')]+_0xa313c9,')');}};Dialer[_0x9118('0x1a')]['getDataPredictive']=function(_0x5a020b){var _0x30f5c5=this;return function(_0x33df98){return new Promise(function(_0x2faee9,_0x76b249){_[_0x9118('0x61')](_0x5a020b,_0x33df98[0x0]);if(checkGetDataPredictive(_0x33df98[0x0])){var _0x1bbd7e=_0x5a020b[_0x9118('0x1c8')]=_0x5a020b['talking']+_0x5a020b[_0x9118('0x140')];var _0x2063bd=_0x5a020b[_0x9118('0x1ce')]*0x3c;var _0x513050=_0x33df98[0x0][_0x9118('0x56')]+_0x33df98[0x0][_0x9118('0x52')];var _0x9e3c7c=(_0x33df98[0x0][_0x9118('0x4e')]+_0x33df98[0x0][_0x9118('0x50')]+_0x33df98[0x0][_0x9118('0x51')])/_0x33df98[0x0]['predictiveIntervalTotalCalls'];_0x5a020b[_0x9118('0x1ca')]=_0x9e3c7c>0x0?_0x9e3c7c:0x1;switch(_0x5a020b['dialPredictiveOptimization']){case _0x9118('0x1d0'):var _0x419bf6=_0x5a020b[_0x9118('0x1c6')]/0x64;return _0x30f5c5['abandonmentRate'](_0x1bbd7e,_0x2063bd,_0x513050,_0x9e3c7c,_0x419bf6)[_0x9118('0x40')](function(_0x210d02){return _0x2faee9(_0x210d02);});case _0x9118('0x1df'):var _0x366763=_0x5a020b[_0x9118('0x1c6')]/0x64;return _0x30f5c5[_0x9118('0x1e0')](_0x1bbd7e,_0x2063bd,_0x513050,_0x9e3c7c,_0x366763)[_0x9118('0x40')](function(_0x3a6ab6){return _0x2faee9(_0x3a6ab6);});default:return _0x76b249(msgResponse(_0x9118('0x1e1'),_0x9118('0x96'),_0x9118('0x1e2')));}}else{return _0x76b249(msgResponse(_0x9118('0x1e1'),_0x9118('0x96'),_0x9118('0x1e3')));}});};};Dialer[_0x9118('0x1a')][_0x9118('0x1e4')]=function(_0x3bef3b){var _0x1c9c66=this;return function(_0x438be4){return new Promise(function(_0x24d95d,_0x338a4b){_['merge'](_0x3bef3b,_0x438be4[0x0]);if(checkGetDataPredictive(_0x438be4[0x0])){loggerPredictive['info'](JSON[_0x9118('0x76')](_0x438be4[0x0]));if(_0x3bef3b[_0x9118('0x1e5')]===_0x9118('0x1d0')){return _0x1c9c66[_0x9118('0x15a')](_0x3bef3b['id'])[_0x9118('0x40')](function(_0x51d13a){var _0x25a9a9=_0x3bef3b[_0x9118('0x1e6')]-_0x51d13a[0x0]['outboundQueuePauses'];var _0x578490=_0x3bef3b['dialPredictiveInterval']*0x3c;var _0xa65d6a=_0x438be4[0x0][_0x9118('0x56')]+_0x438be4[0x0][_0x9118('0x52')];var _0x2c9fdc=(_0x438be4[0x0][_0x9118('0x4e')]+_0x438be4[0x0][_0x9118('0x50')]+_0x438be4[0x0][_0x9118('0x51')])/_0x438be4[0x0][_0x9118('0x4c')];var _0x5d22d6=_0x3bef3b[_0x9118('0x1c6')]/0x64;_0x3bef3b[_0x9118('0x1e7')]=_0x51d13a[0x0][_0x9118('0x1e8')]||0x0;_0x3bef3b[_0x9118('0x1ca')]=_0x2c9fdc>0x0?_0x2c9fdc:0x1;return _0x1c9c66[_0x9118('0x1e9')](_0x25a9a9,_0x578490,_0xa65d6a,_0x2c9fdc,_0x5d22d6);})['then'](function(_0x5c1e2c){return _0x24d95d(_0x5c1e2c);})[_0x9118('0xa5')](function(_0x8b3c4b){return _0x338a4b(msgResponse(_0x9118('0x1ea'),_0x9118('0x96'),JSON[_0x9118('0x76')](_0x8b3c4b)));});}if(_0x3bef3b[_0x9118('0x1e5')]==='agentBusyFactor'){return _0x1c9c66[_0x9118('0x15a')](_0x3bef3b['id'])[_0x9118('0x40')](function(_0x18ae61){var _0x56dc35=_0x3bef3b[_0x9118('0x1e6')]-_0x18ae61[0x0][_0x9118('0x1e8')];var _0x85d6c9=_0x3bef3b['dialPredictiveInterval']*0x3c;var _0x54fd64=_0x438be4[0x0][_0x9118('0x56')]+_0x438be4[0x0]['predictiveIntervalAvgHoldtime'];var _0x36d38d=(_0x438be4[0x0][_0x9118('0x4e')]+_0x438be4[0x0][_0x9118('0x50')]+_0x438be4[0x0][_0x9118('0x51')])/_0x438be4[0x0]['predictiveIntervalTotalCalls'];var _0x3a5fd6=_0x3bef3b[_0x9118('0x1c6')]/0x64;_0x3bef3b[_0x9118('0x1e7')]=_0x18ae61[0x0][_0x9118('0x1e8')]||0x0;_0x3bef3b[_0x9118('0x1ca')]=_0x36d38d>0x0?_0x36d38d:0x1;return _0x1c9c66['busyFactor'](_0x56dc35,_0x85d6c9,_0x54fd64,_0x36d38d,_0x3a5fd6);})[_0x9118('0x40')](function(_0x866e15){return _0x24d95d(_0x866e15);})[_0x9118('0xa5')](function(_0x522c49){return _0x338a4b(msgResponse(_0x9118('0x1ea'),_0x9118('0x96'),JSON[_0x9118('0x76')](_0x522c49)));});}}else{return _0x338a4b(msgResponse(_0x9118('0x1e1'),_0x9118('0x96'),_0x9118('0x1e3')));}});};};Dialer[_0x9118('0x1a')]['startMethodPredictive']=function(_0x3f5ddf){var _0x1db68f=this;return function(){var _0x18e7cf=0x0;var _0x2670a7=Math[_0x9118('0x1c9')](_0x3f5ddf[_0x9118('0x1eb')]*0x3e8);if(_0x2670a7>0x0){_0x2670a7=_0x2670a7<0x64?0x64:_0x2670a7;loggerPredictive['info'](_0x3f5ddf[_0x9118('0x48')],_0x9118('0x1ec'),_0x2670a7,_0x9118('0x1ed'));_0x3f5ddf[_0x9118('0x66')]=setInterval(function(){_0x1db68f[_0x9118('0x66')](_0x3f5ddf);loggerPredictiveCalls[_0x9118('0x4b')]('[handlePredictive]',_0x18e7cf+=0x1);},_0x2670a7);}else{loggerPredictive[_0x9118('0x4b')](_0x3f5ddf[_0x9118('0x48')],_0x9118('0x1ee'));}};};Dialer['prototype'][_0x9118('0x1ef')]=function(_0x3401dc,_0x31e5b8){var _0x2113ea=this;return function(_0x33b812){if(_[_0x9118('0x4a')](_0x33b812)){if(_[_0x9118('0xfb')](_0x31e5b8[_0x9118('0x15d')])||!_0x31e5b8['recallme']){if(_0x3401dc[_0x9118('0xb5')]===_0x9118('0xb8')){_0x3401dc[_0x9118('0x73')]=_[_0x9118('0x55')](_0x3401dc[_0x9118('0x73')])?!![]:_0x3401dc[_0x9118('0x73')];var _0x220855=uuid['v4']();_0x2113ea['actions'][_0x220855]=new Action(_0x3401dc,_0x31e5b8,_0x220855);loggerBooked[_0x9118('0x4b')](_0x9118('0x1f0'),_0x220855,_0x9118('0x1f1'),JSON[_0x9118('0x76')](_0x3401dc[_0x9118('0x73')]),'Queue:\x20',_0x3401dc[_0x9118('0x48')]);if(_0x3401dc[_0x9118('0x73')]){_0x3401dc[_0x9118('0x73')]=![];_0x2113ea['queueBooked'][_0x2113ea[_0x9118('0x23')][_0x220855][_0x9118('0xc0')]]=[];ami[_0x9118('0xa0')]({'actionid':_0x220855,'action':'queuestatus','queue':_0x3401dc['name']})[_0x9118('0xa5')](function(){utils[_0x9118('0xc3')](_0x3401dc,_0x9118('0x1f2'));hopperUtils[_0x9118('0xde')]({'active':![],'ContactId':_0x2113ea['actions'][_0x220855][_0x9118('0xe1')],'ListId':_0x2113ea[_0x9118('0x23')][_0x220855][_0x9118('0xe2')],'VoiceQueueId':_0x2113ea[_0x9118('0x23')][_0x220855][_0x9118('0xe3')]||undefined,'CampaignId':_0x2113ea[_0x9118('0x23')][_0x220855][_0x9118('0xe4')]||undefined})[_0x9118('0xa5')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2113ea['actions'][_0x220855];});}else{loggerBooked[_0x9118('0x4b')](_0x9118('0x1f3'),JSON[_0x9118('0x76')](_0x3401dc[_0x9118('0x73')]),_0x9118('0x1f4'),_0x3401dc[_0x9118('0x48')]);utils['decrementOriginate'](_0x3401dc,_0x9118('0x1f2'));hopperUtils[_0x9118('0xde')]({'active':![],'ContactId':_0x2113ea[_0x9118('0x23')][_0x220855]['ContactId'],'ListId':_0x2113ea[_0x9118('0x23')][_0x220855][_0x9118('0xe2')],'VoiceQueueId':_0x2113ea['actions'][_0x220855][_0x9118('0xe3')]||undefined,'CampaignId':_0x2113ea[_0x9118('0x23')][_0x220855][_0x9118('0xe4')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2113ea[_0x9118('0x23')][_0x220855];}}else{return _0x2113ea[_0x9118('0x162')](_0x3401dc,_0x31e5b8);}}else{if(utils[_0x9118('0x62')](undefined,_0x31e5b8[_0x9118('0x1f5')])<_0x3401dc[_0x9118('0x1f6')]*0x3c){if(_0x31e5b8[_0x9118('0x14f')]&&!_0x31e5b8['Agent']['voicePause']){_0x2113ea['preview'][_0x9118('0xfc')](_0x31e5b8['id'])[_0x9118('0xfe')](function(){utils[_0x9118('0xc3')](_0x3401dc,_0x9118('0x1f2'));});}else{hopperUtils[_0x9118('0x1f7')]({'active':![]},_0x31e5b8['id'],0x1)['finally'](function(){utils[_0x9118('0xc3')](_0x3401dc,_0x9118('0x1f2'));});}}else{_0x3401dc[_0x9118('0x1f8')]+=0x1;utils[_0x9118('0xc3')](_0x3401dc,'[checkContactBlack]');if(_0x3401dc['dialRecallInQueue']){hopperUtils[_0x9118('0xde')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x31e5b8['ContactId'],'ListId':_0x31e5b8[_0x9118('0xe2')],'VoiceQueueId':_0x31e5b8[_0x9118('0xe3')]||undefined,'CampaignId':_0x31e5b8[_0x9118('0xe4')]||undefined})[_0x9118('0xa5')](loggerCatch(_0x9118('0x1f9')));hopperUtils[_0x9118('0xcc')](createObjHistory(_0x3401dc,_0x31e5b8,utils['CAMPAIGN_STATUS']['QUEUE_RECALL'],0x17,_0x9118('0x1fa')))[_0x9118('0xa5')](loggerCatch(_0x9118('0x1fb')));}else{_0x2113ea[_0x9118('0x116')](createObjHistory(_0x3401dc,_0x31e5b8,utils[_0x9118('0x6b')][_0x9118('0x1fc')],0x16,_0x9118('0x1fd')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x3401dc[_0x9118('0x1fe')]+=0x1;_0x2113ea[_0x9118('0x116')](createObjHistory(_0x3401dc,_0x31e5b8,utils[_0x9118('0x6b')][_0x9118('0x1ff')],0xd,_0x9118('0x200')),'[Originate][historyBlacklist]',_0x9118('0x201'));throw _0x9118('0x202');}};};Dialer[_0x9118('0x1a')][_0x9118('0x161')]=function(_0x4a7967){var _0x46992d=this;var _0x3f626e=_0x4a7967[_0x9118('0x203')]-_0x4a7967[_0x9118('0x83')];emitCampaignSummary(_0x4a7967);if(_0x3f626e>0x0&&_0x4a7967[_0x9118('0x204')]==0x0){if(_0x3f626e>this[_0x9118('0x22')]){_0x3f626e=this[_0x9118('0x22')];}_0x4a7967[_0x9118('0x204')]=0x1;hopperUtils[_0x9118('0x205')](_0x4a7967,_0x3f626e)[_0x9118('0x40')](function(_0x4b75c6){_0x4a7967[_0x9118('0x204')]=0x0;if(_0x4b75c6){if(!utils[_0x9118('0x206')](_0x4b75c6)){_0x4a7967[_0x9118('0x6e')]=utils[_0x9118('0x6b')][_0x9118('0x6f')];logger[_0x9118('0x4b')]('[getContactCampaign2][Empty]'+_0x4a7967[_0x9118('0x48')]);}else{_0x4a7967['originated']+=_0x4b75c6[_0x9118('0x9e')];_0x4a7967[_0x9118('0x6e')]=utils['CAMPAIGN_STATUS'][_0x9118('0x207')];for(var _0x2f90a1=0x0;_0x2f90a1<_0x4b75c6['length'];_0x2f90a1+=0x1){_0x4a7967[_0x9118('0x208')]+=0x1;if(_['isNil'](_0x4b75c6[_0x2f90a1])||_['isNil'](_0x4b75c6[_0x2f90a1][_0x9118('0x180')])||_[_0x9118('0xfb')](_0x4b75c6[_0x2f90a1][_0x9118('0x165')])){_0x46992d['emptyContact']('[actionOriginate]\x20',_0x4a7967,_0x4b75c6[_0x2f90a1]);}else{hopperUtils[_0x9118('0x209')](_[_0x9118('0x77')](_0x4b75c6[_0x2f90a1],[_0x9118('0xe4'),_0x9118('0x165')]))[_0x9118('0x40')](_0x46992d[_0x9118('0x1ef')](_0x4a7967,_0x4b75c6[_0x2f90a1]))['catch'](function(_0x29ffbf){logger['error'](_0x9118('0x20a'),_0x29ffbf);utils[_0x9118('0xc3')](_0x4a7967,_0x9118('0x20b'));});}}}}})[_0x9118('0xa5')](function(_0x323012){_0x4a7967['temp']=0x0;logger[_0x9118('0x68')](_0x9118('0x20c'),_0x323012);});}};Dialer['prototype'][_0x9118('0xb7')]=function(_0x3bf07f,_0x4a247b){var _0x53d21e=this;var _0x5a791a=[];if(_0x4a247b<0x1||_0x3bf07f[_0x9118('0xb5')]===_0x9118('0xb8')){_0x4a247b=0x1;}var _0x37629a=Math['floor'](_0x3bf07f[_0x9118('0x140')]*_0x4a247b)-_0x3bf07f[_0x9118('0x83')];if(_0x3bf07f[_0x9118('0x20d')]>0x0){var _0x2c9a54=_0x3bf07f[_0x9118('0x20d')]-_0x3bf07f[_0x9118('0x83')]-_0x3bf07f['talking']-_0x3bf07f[_0x9118('0x141')];if(_0x37629a>_0x2c9a54){_0x37629a=_0x2c9a54;}}if(_0x37629a>0x0&&_0x3bf07f[_0x9118('0x204')]==0x0){if(_0x3bf07f[_0x9118('0xb5')]===_0x9118('0xb8')){_0x37629a=0x1;}if(_0x37629a>this[_0x9118('0x22')]){_0x37629a=this['maxNumberOriginate'];}for(var _0x22afe1 in this['agents']){if(typeof this[_0x9118('0x20')][_0x22afe1]!==_0x9118('0xaf')){if(this[_0x9118('0x20')][_0x22afe1][_0x9118('0xd4')]===_0x9118('0x20e')&&this['agents'][_0x22afe1][_0x9118('0x8a')]==='reachable'){_0x5a791a[_0x9118('0x9f')](this['agents'][_0x22afe1]['id']);}}}_0x3bf07f['temp']=0x1;hopperUtils[_0x9118('0x20f')](_0x3bf07f,_0x5a791a,_0x37629a)[_0x9118('0x40')](function(_0x1e9e7d){_0x3bf07f[_0x9118('0x204')]=0x0;if(_0x1e9e7d){if(!utils[_0x9118('0x206')](_0x1e9e7d)){hopperUtils[_0x9118('0x210')](_0x3bf07f)[_0x9118('0x40')](sendMessageReschedule(_0x3bf07f))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x3bf07f['originated']+=_0x1e9e7d[_0x9118('0x9e')];_0x3bf07f['message']=_0x3bf07f['dialMethod']===_0x9118('0xb8')?utils[_0x9118('0x6b')]['ACTIVE']:utils[_0x9118('0x6b')]['RUNNING'];for(var _0x561c5d=0x0;_0x561c5d<_0x1e9e7d['length'];_0x561c5d+=0x1){if(_['isNil'](_0x1e9e7d[_0x561c5d])||_['isNil'](_0x1e9e7d[_0x561c5d][_0x9118('0x180')])||_['isNil'](_0x1e9e7d[_0x561c5d][_0x9118('0x165')])){_0x53d21e['emptyContact'](_0x9118('0x211'),_0x3bf07f,_0x1e9e7d[_0x561c5d]);}else{hopperUtils[_0x9118('0x212')](_[_0x9118('0x77')](_0x1e9e7d[_0x561c5d],[_0x9118('0xe3'),_0x9118('0x165')]))['then'](_0x53d21e['checkContactBlack'](_0x3bf07f,_0x1e9e7d[_0x561c5d]))[_0x9118('0xa5')](function(_0xa88bab){logger[_0x9118('0x68')]('[actionOriginate]',_0xa88bab);utils[_0x9118('0xc3')](_0x3bf07f,_0x9118('0x213'));});}}}}})['catch'](function(_0x4e4fe0){_0x3bf07f['temp']=0x0;logger['error'](_0x9118('0x20c'),_0x4e4fe0);});}};Dialer[_0x9118('0x1a')][_0x9118('0x66')]=function(_0x125256){if(_0x125256['dialLimitQueue']>0x0){var _0x2b9f1f=_0x125256[_0x9118('0x20d')]-_0x125256[_0x9118('0x83')]-_0x125256[_0x9118('0x214')];if(_0x2b9f1f>0x0&&_0x125256['temp']==0x0){this[_0x9118('0x215')](_0x125256);}else{loggerPredictiveCalls[_0x9118('0x4b')](_0x9118('0x216'));}}else{this[_0x9118('0x215')](_0x125256);}};Dialer[_0x9118('0x1a')][_0x9118('0x215')]=function(_0x20761e){var _0xe84a1a=this;var _0x48d1b8=[];_0x20761e[_0x9118('0x83')]+=0x1;for(var _0x29744a in this[_0x9118('0x20')]){if(typeof this[_0x9118('0x20')][_0x29744a]!==_0x9118('0xaf')){if(this[_0x9118('0x20')][_0x29744a][_0x9118('0xd4')]==='not_inuse'&&this[_0x9118('0x20')][_0x29744a][_0x9118('0x8a')]==='reachable'){_0x48d1b8['push'](this['agents'][_0x29744a]['id']);}}}_0x20761e[_0x9118('0x204')]=0x1;return this[_0x9118('0x20f')](_0x20761e['id'],_0x48d1b8,0x1,_0x20761e[_0x9118('0x217')],_0x20761e)[_0x9118('0x40')](function(_0x28ba89){_0x20761e['temp']=0x1;if(_0x28ba89){if(!utils[_0x9118('0x206')](_0x28ba89)){utils['checkContactLowerLimitOriginate'](_0x20761e,0x1,0x0);return hopperUtils[_0x9118('0x210')](_0x20761e)['then'](sendMessageReschedule(_0x20761e))[_0x9118('0xa5')](loggerCatch(_0x9118('0x218')));}else{_0x20761e[_0x9118('0x6e')]=utils[_0x9118('0x6b')]['RUNNING'];if(_[_0x9118('0xfb')](_0x28ba89[0x0])||_[_0x9118('0xfb')](_0x28ba89[0x0][_0x9118('0x180')])||_['isNil'](_0x28ba89[0x0][_0x9118('0x165')])){_0xe84a1a[_0x9118('0x15c')](_0x9118('0x211'),_0x20761e,_0x28ba89[0x0]);}else{return hopperUtils[_0x9118('0x212')](_[_0x9118('0x77')](_0x28ba89[0x0],[_0x9118('0xe3'),_0x9118('0x165')]))[_0x9118('0x40')](_0xe84a1a[_0x9118('0x1ef')](_0x20761e,_0x28ba89[0x0]))[_0x9118('0xa5')](function(_0x1f07de){logger[_0x9118('0x68')](_0x9118('0x219'),_0x1f07de);utils['decrementOriginate'](_0x20761e,'[actionOriginatePredictive]');});}}}})[_0x9118('0xa5')](function(_0xa17aa5){_0x20761e['temp']=0x0;logger['error'](_0x9118('0x20c'),_0xa17aa5);});};Dialer[_0x9118('0x1a')][_0x9118('0x1e9')]=function(_0x436850,_0xf0fe3d,_0x81618a,_0x1df3e9,_0x433d86,_0x73f7b5){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x9118('0x4b')](_0x9118('0x21a'),_0x436850);loggerPredictive['info'](_0x9118('0x21b'),_0xf0fe3d);loggerPredictive[_0x9118('0x4b')]('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',_0x81618a);loggerPredictive[_0x9118('0x4b')](_0x9118('0x21c'),_0x1df3e9);loggerPredictive[_0x9118('0x4b')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x433d86);loggerPredictive[_0x9118('0x4b')](_0x9118('0x54'));return new Promise(function(_0x3a703f,_0x3aa61f){if(_0x436850<=0x0||isNaN(_0x436850)){return _0x3aa61f(msgResponse(_0x9118('0x21d'),_0x9118('0x87'),_0x9118('0x21e')+_0x436850));}if(_0x81618a<=0x0||isNaN(_0x81618a)){return _0x3aa61f(msgResponse(_0x9118('0x21d'),_0x9118('0x87'),_0x9118('0x21f')+_0x81618a));}if(_0x1df3e9<=0x0||isNaN(_0x1df3e9)){return _0x3aa61f(msgResponse(_0x9118('0x21d'),_0x9118('0x87'),_0x9118('0x220')+_0x1df3e9));}if(_0xf0fe3d<=0x0||isNaN(_0xf0fe3d)){return _0x3aa61f(msgResponse('[abandonmentRate]',_0x9118('0x87'),_0x9118('0x221')+_0xf0fe3d));}if(_0x433d86<=0x0||isNaN(_0x433d86)){return _0x3aa61f(msgResponse(_0x9118('0x21d'),_0x9118('0x87'),_0x9118('0x222')+_0x433d86));}_0x73f7b5=_0x73f7b5||0x0;var _0x54ad11=0x1/_0x81618a;var _0x2bface=0x0;var _0x39ae6b=0x0;var _0x506fb1=0x0;var _0x3eb471=0x0;for(var _0x1951c7=0x0;_0x506fb1<_0x433d86;_0x1951c7+=0x1){_0x39ae6b=_0x1951c7/_0xf0fe3d;_0x2bface=(_0x1df3e9*_0x39ae6b+_0x73f7b5)/_0x54ad11;_0x506fb1=utils[_0x9118('0x223')](_0x2bface,_0x436850);_0x3eb471=_0x2bface/_0x436850*(0x1-utils[_0x9118('0x223')](_0x2bface,_0x436850));}return _0x3a703f({'erlangCalls':_0x1951c7,'erlangCallToSecond':_0xf0fe3d/_0x1951c7,'erlangAbandonmentRate':_0x506fb1,'erlangBusyFactor':_0x3eb471});});};Dialer['prototype']['busyFactor']=function(_0x7b5344,_0x185eee,_0x11e17d,_0x45ee58,_0x2c973d,_0x3b5ced){loggerPredictive[_0x9118('0x4b')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x9118('0x4b')](_0x9118('0x21a'),_0x7b5344);loggerPredictive['info'](_0x9118('0x21b'),_0x185eee);loggerPredictive[_0x9118('0x4b')](_0x9118('0x224'),_0x11e17d);loggerPredictive[_0x9118('0x4b')](_0x9118('0x21c'),_0x45ee58);loggerPredictive[_0x9118('0x4b')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2c973d);loggerPredictive[_0x9118('0x4b')](_0x9118('0x54'));return new Promise(function(_0x53ff91,_0x4d7028){if(_0x7b5344<=0x0||isNaN(_0x7b5344)){return _0x4d7028(msgResponse(_0x9118('0x225'),'Error',_0x9118('0x21e')+_0x7b5344));}if(_0x11e17d<=0x0||isNaN(_0x11e17d)){return _0x4d7028(msgResponse(_0x9118('0x225'),_0x9118('0x87'),_0x9118('0x21f')+_0x11e17d));}if(_0x45ee58<=0x0||isNaN(_0x45ee58)){return _0x4d7028(msgResponse(_0x9118('0x225'),_0x9118('0x87'),_0x9118('0x220')+_0x45ee58));}if(_0x185eee<=0x0||isNaN(_0x185eee)){return _0x4d7028(msgResponse(_0x9118('0x225'),'Error',_0x9118('0x221')+_0x185eee));}if(_0x2c973d<=0x0||isNaN(_0x2c973d)){return _0x4d7028(msgResponse('[busyFactor]',_0x9118('0x87'),_0x9118('0x226')+_0x2c973d));}_0x3b5ced=_0x3b5ced||0x0;var _0xbf4235=0x1/_0x11e17d;var _0x1ea80a=0x0;var _0x4b2153=0x0;var _0x1bc2a2=0x0;var _0x2f06e8=0x0;for(var _0x4934c6=0x0;_0x2f06e8<_0x2c973d;_0x4934c6+=0x1){_0x4b2153=_0x4934c6/_0x185eee;_0x1ea80a=(_0x45ee58*_0x4b2153+_0x3b5ced)/_0xbf4235;_0x1bc2a2=utils['erlangb'](_0x1ea80a,_0x7b5344);_0x2f06e8=_0x1ea80a/_0x7b5344*(0x1-utils['erlangb'](_0x1ea80a,_0x7b5344));}return _0x53ff91({'erlangCalls':_0x4934c6,'erlangCallToSecond':_0x185eee/_0x4934c6,'erlangAbandonmentRate':_0x1bc2a2,'erlangBusyFactor':_0x2f06e8});});};module[_0x9118('0x227')]=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 e2c3bb8..09a93b9 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 _0x9e33=['ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','queue','exports','util','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper'];(function(_0x3b58a7,_0x3cf0f2){var _0x1bc681=function(_0x54b1d4){while(--_0x54b1d4){_0x3b58a7['push'](_0x3b58a7['shift']());}};_0x1bc681(++_0x3cf0f2);}(_0x9e33,0xe7));var _0x39e3=function(_0x31df6f,_0x380e73){_0x31df6f=_0x31df6f-0x0;var _0x31e353=_0x9e33[_0x31df6f];return _0x31e353;};'use strict';var util=require(_0x39e3('0x0'));var _=require('lodash');var moment=require(_0x39e3('0x1'));function checkNameSurname(_0x443be7,_0x55c78a,_0x1ffcf8){var _0x46374b='';if(!_[_0x39e3('0x2')](_0x55c78a)&&'string'===typeof _0x55c78a){_0x46374b+=_0x55c78a;}if(!_['isNil'](_0x1ffcf8)&&_0x39e3('0x3')===typeof _0x1ffcf8){_0x46374b+='\x20'+_0x1ffcf8;}if(_0x46374b!==''){return _0x46374b;}return _0x443be7;}function Action(_0xf27553,_0x10d76d,_0x5a1370){this[_0x39e3('0x4')]=_0xf27553;this[_0x39e3('0x5')]=_0x5a1370||undefined;this[_0x39e3('0x6')]=checkNameSurname(_0x10d76d['Contact'][_0x39e3('0x7')],_0x10d76d[_0x39e3('0x8')]['firstName'],_0x10d76d[_0x39e3('0x8')][_0x39e3('0x9')]);this[_0x39e3('0xa')]=_0x10d76d[_0x39e3('0x7')];this['queue']=_0xf27553[_0x39e3('0x6')];this[_0x39e3('0xb')]=_0x10d76d['active']||![];this[_0x39e3('0xc')]=_0xf27553[_0x39e3('0xc')];this[_0x39e3('0xd')]=_0xf27553[_0x39e3('0xd')]||0x3;this[_0x39e3('0xe')]=_0x10d76d[_0x39e3('0xe')];this[_0x39e3('0xf')]=_0x10d76d[_0x39e3('0xf')];this[_0x39e3('0x10')]=_0x10d76d[_0x39e3('0x10')];this['countnoanswerretry']=_0x10d76d['countnoanswerretry'];this['countnosuchnumberretry']=_0x10d76d['countnosuchnumberretry'];this[_0x39e3('0x11')]=_0x10d76d[_0x39e3('0x11')];this[_0x39e3('0x12')]=_0x10d76d[_0x39e3('0x12')];this[_0x39e3('0x13')]=_0x10d76d['countmachineretry'];this[_0x39e3('0x14')]=_0x10d76d['countagentrejectretry'];this[_0x39e3('0x15')]=_0x10d76d[_0x39e3('0x15')];this[_0x39e3('0x16')]=_0x10d76d[_0x39e3('0x16')];this['UserId']=_0x10d76d[_0x39e3('0x17')];this[_0x39e3('0x18')]=_0x10d76d['VoiceQueueId'];this[_0x39e3('0x19')]=_0x10d76d[_0x39e3('0x19')];this[_0x39e3('0x1a')]=_0x10d76d['id'];this[_0x39e3('0x1b')]=_0x10d76d[_0x39e3('0x8')][_0x39e3('0x1c')]||'';this[_0x39e3('0x1d')]=moment()[_0x39e3('0x1e')](_0x39e3('0x1f'));this[_0x39e3('0x20')]=_0x10d76d[_0x39e3('0x20')];this[_0x39e3('0x21')]=_0x10d76d['callbackuniqueid'];this[_0x39e3('0x22')]=_0x10d76d[_0x39e3('0x22')];this[_0x39e3('0x23')]=_0x10d76d[_0x39e3('0x23')];this[_0x39e3('0x24')]='';this['originatecalleridname']='';}Action[_0x39e3('0x25')]['getCaller']=function(){return util['format'](_0x39e3('0x26'),this[_0x39e3('0x6')],this[_0x39e3('0x4')]['dialCutDigit']>0x0?this[_0x39e3('0xa')]['substring'](this[_0x39e3('0x4')][_0x39e3('0x27')]):this[_0x39e3('0xa')]);};Action[_0x39e3('0x25')][_0x39e3('0x28')]=function(){return this[_0x39e3('0x29')];};module[_0x39e3('0x2a')]=Action; \ No newline at end of file +var _0xf20f=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','name','voiceQueue','dialCutDigit','getQueue','queue','util','lodash','moment','isNil','string','uniqueid','Contact','firstName','lastName','number','phone','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x357640,_0x532b5d){var _0x640d79=function(_0xd5a6eb){while(--_0xd5a6eb){_0x357640['push'](_0x357640['shift']());}};_0x640d79(++_0x532b5d);}(_0xf20f,0x14e));var _0xff20=function(_0x195f89,_0x549c51){_0x195f89=_0x195f89-0x0;var _0xacc141=_0xf20f[_0x195f89];return _0xacc141;};'use strict';var util=require(_0xff20('0x0'));var _=require(_0xff20('0x1'));var moment=require(_0xff20('0x2'));function checkNameSurname(_0x402897,_0x1e654e,_0x6c9031){var _0x3c7c5e='';if(!_[_0xff20('0x3')](_0x1e654e)&&_0xff20('0x4')===typeof _0x1e654e){_0x3c7c5e+=_0x1e654e;}if(!_[_0xff20('0x3')](_0x6c9031)&&_0xff20('0x4')===typeof _0x6c9031){_0x3c7c5e+='\x20'+_0x6c9031;}if(_0x3c7c5e!==''){return _0x3c7c5e;}return _0x402897;}function Action(_0x218b0f,_0x37ed24,_0x1c15cd){this['voiceQueue']=_0x218b0f;this[_0xff20('0x5')]=_0x1c15cd||undefined;this['name']=checkNameSurname(_0x37ed24[_0xff20('0x6')]['phone'],_0x37ed24[_0xff20('0x6')][_0xff20('0x7')],_0x37ed24[_0xff20('0x6')][_0xff20('0x8')]);this[_0xff20('0x9')]=_0x37ed24[_0xff20('0xa')];this['queue']=_0x218b0f['name'];this[_0xff20('0xb')]=_0x37ed24['active']||![];this['type']=_0x218b0f[_0xff20('0xc')];this[_0xff20('0xd')]=_0x218b0f[_0xff20('0xd')]||0x3;this[_0xff20('0xe')]=_0x37ed24[_0xff20('0xe')];this['countbusyretry']=_0x37ed24[_0xff20('0xf')];this[_0xff20('0x10')]=_0x37ed24[_0xff20('0x10')];this[_0xff20('0x11')]=_0x37ed24['countnoanswerretry'];this['countnosuchnumberretry']=_0x37ed24[_0xff20('0x12')];this[_0xff20('0x13')]=_0x37ed24[_0xff20('0x13')];this['countabandonedretry']=_0x37ed24[_0xff20('0x14')];this[_0xff20('0x15')]=_0x37ed24[_0xff20('0x15')];this['countagentrejectretry']=_0x37ed24[_0xff20('0x16')];this[_0xff20('0x17')]=_0x37ed24[_0xff20('0x17')];this[_0xff20('0x18')]=_0x37ed24['ListId'];this[_0xff20('0x19')]=_0x37ed24[_0xff20('0x19')];this['VoiceQueueId']=_0x37ed24[_0xff20('0x1a')];this[_0xff20('0x1b')]=_0x37ed24[_0xff20('0x1b')];this[_0xff20('0x1c')]=_0x37ed24['id'];this[_0xff20('0x1d')]=_0x37ed24[_0xff20('0x6')][_0xff20('0x7')]||'';this[_0xff20('0x1e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x37ed24[_0xff20('0x1f')];this[_0xff20('0x20')]=_0x37ed24[_0xff20('0x20')];this[_0xff20('0x21')]=_0x37ed24[_0xff20('0x21')];this[_0xff20('0x22')]=_0x37ed24[_0xff20('0x22')];this['originatecalleridnum']='';this[_0xff20('0x23')]='';}Action['prototype'][_0xff20('0x24')]=function(){return util[_0xff20('0x25')](_0xff20('0x26'),this[_0xff20('0x27')],this[_0xff20('0x28')][_0xff20('0x29')]>0x0?this[_0xff20('0x9')]['substring'](this['voiceQueue'][_0xff20('0x29')]):this[_0xff20('0x9')]);};Action['prototype'][_0xff20('0x2a')]=function(){return this[_0xff20('0x2b')];};module['exports']=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 f232885..576ecd6 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 _0xb579=['agiafterat','exports','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','number','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','starttime','holdtime','endtime','queue','membername','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x5aba31,_0x411720){var _0x4a7d1e=function(_0x4ced22){while(--_0x4ced22){_0x5aba31['push'](_0x5aba31['shift']());}};_0x4a7d1e(++_0x411720);}(_0xb579,0xae));var _0x9b57=function(_0x40e84c,_0x14231e){_0x40e84c=_0x40e84c-0x0;var _0x261700=_0xb579[_0x40e84c];return _0x261700;};'use strict';var moment=require('moment');var utils=require(_0x9b57('0x0'));function AgentComplete(_0x294f57,_0x154c56){this[_0x9b57('0x1')]=0x4;this[_0x9b57('0x2')]=_0x9b57('0x3');this[_0x9b57('0x4')]=_0x294f57[_0x9b57('0x4')];this[_0x9b57('0x5')]=_0x294f57[_0x9b57('0x5')];this[_0x9b57('0x6')]=_0x294f57[_0x9b57('0x5')]===_0x9b57('0x7')?'queue':_0x294f57[_0x9b57('0x5')];this[_0x9b57('0x8')]=_0x294f57[_0x9b57('0x8')];this[_0x9b57('0x9')]=_0x294f57['countcongestionretry'];this[_0x9b57('0xa')]=_0x294f57['countnoanswerretry'];this[_0x9b57('0xb')]=_0x294f57[_0x9b57('0x8')]+_0x294f57[_0x9b57('0x9')]+_0x294f57[_0x9b57('0xa')]+_0x294f57[_0x9b57('0xc')]+_0x294f57[_0x9b57('0xd')]+_0x294f57[_0x9b57('0xe')]+_0x294f57[_0x9b57('0xf')]+_0x294f57[_0x9b57('0x10')];this[_0x9b57('0xc')]=_0x294f57[_0x9b57('0xc')];this[_0x9b57('0xd')]=_0x294f57[_0x9b57('0xd')];this[_0x9b57('0xe')]=_0x294f57['countabandonedretry'];this[_0x9b57('0xf')]=_0x294f57[_0x9b57('0xf')];this[_0x9b57('0x10')]=_0x294f57[_0x9b57('0x10')];this[_0x9b57('0x11')]=_0x154c56[_0x9b57('0x11')];this['calleridname']=_0x294f57['name'];this['calleridnum']=_0x294f57[_0x9b57('0x12')];this['starttime']=_0x294f57['starttime'];this[_0x9b57('0x13')]=_0x294f57[_0x9b57('0x13')];this[_0x9b57('0x14')]=_0x294f57[_0x9b57('0x14')];this['endtime']=moment()[_0x9b57('0x15')](_0x9b57('0x16'));this[_0x9b57('0x17')]=utils[_0x9b57('0x18')](_0x294f57[_0x9b57('0x13')],_0x294f57[_0x9b57('0x19')]);this[_0x9b57('0x1a')]=utils['getSeconds'](_0x294f57[_0x9b57('0x14')],_0x294f57[_0x9b57('0x13')]);this['talktime']=utils[_0x9b57('0x18')](this[_0x9b57('0x1b')],_0x294f57[_0x9b57('0x14')]);this[_0x9b57('0x1c')]=_0x154c56[_0x9b57('0x1c')];this['membername']=_0x154c56[_0x9b57('0x1d')];this[_0x9b57('0x1e')]=_0x154c56[_0x9b57('0x1e')];this[_0x9b57('0x1f')]=_0x294f57[_0x9b57('0x1f')];this[_0x9b57('0x20')]=_0x294f57[_0x9b57('0x20')];this[_0x9b57('0x21')]=_0x294f57['callbackat'];this['recallme']=_0x294f57['recallme'];this[_0x9b57('0x22')]=_0x294f57['ContactId'];this[_0x9b57('0x23')]=_0x294f57[_0x9b57('0x23')];this[_0x9b57('0x24')]=_0x294f57['UserId'];this[_0x9b57('0x25')]=_0x294f57['VoiceQueueId'];this[_0x9b57('0x26')]=_0x294f57[_0x9b57('0x26')];this[_0x9b57('0x27')]=_0x294f57[_0x9b57('0x27')]||'';this['originatecalleridname']=_0x294f57[_0x9b57('0x28')]||'';this[_0x9b57('0x29')]=_0x294f57[_0x9b57('0x29')];}module[_0x9b57('0x2a')]=AgentComplete; \ No newline at end of file +var _0xb1eb=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','talktime','membername','callback','callbackuniqueid'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xb1eb,0x12a));var _0xbb1e=function(_0x3ffac4,_0x4b49c6){_0x3ffac4=_0x3ffac4-0x0;var _0x35685a=_0xb1eb[_0x3ffac4];return _0x35685a;};'use strict';var moment=require(_0xbb1e('0x0'));var utils=require('../utils');function AgentComplete(_0xed3513,_0x5e91db){this[_0xbb1e('0x1')]=0x4;this[_0xbb1e('0x2')]=_0xbb1e('0x3');this[_0xbb1e('0x4')]=_0xed3513[_0xbb1e('0x4')];this[_0xbb1e('0x5')]=_0xed3513['type'];this[_0xbb1e('0x6')]=_0xed3513['type']==='outbound'?_0xbb1e('0x7'):_0xed3513['type'];this[_0xbb1e('0x8')]=_0xed3513[_0xbb1e('0x8')];this[_0xbb1e('0x9')]=_0xed3513['countcongestionretry'];this[_0xbb1e('0xa')]=_0xed3513[_0xbb1e('0xa')];this['countglobal']=_0xed3513[_0xbb1e('0x8')]+_0xed3513['countcongestionretry']+_0xed3513[_0xbb1e('0xa')]+_0xed3513[_0xbb1e('0xb')]+_0xed3513['countdropretry']+_0xed3513['countabandonedretry']+_0xed3513[_0xbb1e('0xc')]+_0xed3513[_0xbb1e('0xd')];this['countnosuchnumberretry']=_0xed3513[_0xbb1e('0xb')];this['countdropretry']=_0xed3513['countdropretry'];this[_0xbb1e('0xe')]=_0xed3513[_0xbb1e('0xe')];this[_0xbb1e('0xc')]=_0xed3513['countmachineretry'];this[_0xbb1e('0xd')]=_0xed3513[_0xbb1e('0xd')];this[_0xbb1e('0xf')]=_0x5e91db[_0xbb1e('0xf')];this[_0xbb1e('0x10')]=_0xed3513['name'];this['calleridnum']=_0xed3513[_0xbb1e('0x11')];this[_0xbb1e('0x12')]=_0xed3513['starttime'];this[_0xbb1e('0x13')]=_0xed3513[_0xbb1e('0x13')];this['answertime']=_0xed3513[_0xbb1e('0x14')];this[_0xbb1e('0x15')]=moment()[_0xbb1e('0x16')](_0xbb1e('0x17'));this['ringtime']=utils[_0xbb1e('0x18')](_0xed3513[_0xbb1e('0x13')],_0xed3513['starttime']);this[_0xbb1e('0x19')]=utils['getSeconds'](_0xed3513[_0xbb1e('0x14')],_0xed3513['responsetime']);this[_0xbb1e('0x1a')]=utils[_0xbb1e('0x18')](this['endtime'],_0xed3513[_0xbb1e('0x14')]);this[_0xbb1e('0x7')]=_0x5e91db[_0xbb1e('0x7')];this[_0xbb1e('0x1b')]=_0x5e91db['membername'];this['reason']=_0x5e91db['reason'];this['callback']=_0xed3513[_0xbb1e('0x1c')];this[_0xbb1e('0x1d')]=_0xed3513['callbackuniqueid'];this[_0xbb1e('0x1e')]=_0xed3513[_0xbb1e('0x1e')];this[_0xbb1e('0x1f')]=_0xed3513[_0xbb1e('0x1f')];this['ContactId']=_0xed3513[_0xbb1e('0x20')];this[_0xbb1e('0x21')]=_0xed3513[_0xbb1e('0x21')];this[_0xbb1e('0x22')]=_0xed3513['UserId'];this[_0xbb1e('0x23')]=_0xed3513[_0xbb1e('0x23')];this[_0xbb1e('0x24')]=_0xed3513[_0xbb1e('0x24')];this[_0xbb1e('0x25')]=_0xed3513['originatecalleridnum']||'';this[_0xbb1e('0x26')]=_0xed3513['originatecalleridname']||'';this[_0xbb1e('0x27')]=_0xed3513['agiafterat'];}module[_0xbb1e('0x28')]=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 9020a0a..35b6fa0 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 _0x74de=['holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime'];(function(_0x5914d6,_0x3dd7d4){var _0x2bffdc=function(_0x49b758){while(--_0x49b758){_0x5914d6['push'](_0x5914d6['shift']());}};_0x2bffdc(++_0x3dd7d4);}(_0x74de,0x78));var _0xe74d=function(_0x3eb7f8,_0x50a65a){_0x3eb7f8=_0x3eb7f8-0x0;var _0x52ee1f=_0x74de[_0x3eb7f8];return _0x52ee1f;};'use strict';function Final(_0x5044d6){this['uniqueid']=_0x5044d6[_0xe74d('0x0')];this[_0xe74d('0x1')]=_0x5044d6['scheduledat'];this[_0xe74d('0x2')]=_0x5044d6[_0xe74d('0x2')];this[_0xe74d('0x3')]=_0x5044d6[_0xe74d('0x2')]===_0xe74d('0x4')?'queue':_0x5044d6[_0xe74d('0x2')];this['countbusyretry']=_0x5044d6[_0xe74d('0x5')];this[_0xe74d('0x6')]=_0x5044d6[_0xe74d('0x6')];this[_0xe74d('0x7')]=_0x5044d6[_0xe74d('0x7')];this[_0xe74d('0x8')]=_0x5044d6[_0xe74d('0x5')]+_0x5044d6[_0xe74d('0x6')]+_0x5044d6[_0xe74d('0x7')]+_0x5044d6['countnosuchnumberretry']+_0x5044d6['countdropretry']+_0x5044d6[_0xe74d('0x9')]+_0x5044d6['countmachineretry']+_0x5044d6[_0xe74d('0xa')];this['countnosuchnumberretry']=_0x5044d6['countnosuchnumberretry'];this['countdropretry']=_0x5044d6[_0xe74d('0xb')];this[_0xe74d('0x9')]=_0x5044d6[_0xe74d('0x9')];this[_0xe74d('0xc')]=_0x5044d6[_0xe74d('0xc')];this[_0xe74d('0xa')]=_0x5044d6[_0xe74d('0xa')];this['queue']=_0x5044d6[_0xe74d('0xd')];this[_0xe74d('0xe')]=_0x5044d6[_0xe74d('0xe')];this[_0xe74d('0xf')]=_0x5044d6[_0xe74d('0xf')];this[_0xe74d('0x10')]=_0x5044d6['starttime'];this[_0xe74d('0x11')]=_0x5044d6['responsetime'];this[_0xe74d('0x12')]=_0x5044d6[_0xe74d('0x11')];this[_0xe74d('0x13')]=_0x5044d6[_0xe74d('0x13')]||0x0;this[_0xe74d('0x14')]=_0x5044d6['holdtime']||0x0;this[_0xe74d('0x15')]=_0x5044d6['talktime']||0x0;this[_0xe74d('0x16')]=_0x5044d6[_0xe74d('0x16')];this[_0xe74d('0x17')]=_0x5044d6[_0xe74d('0x17')];this['callbackat']=_0x5044d6['callbackat'];this[_0xe74d('0x18')]=_0x5044d6[_0xe74d('0x18')];this[_0xe74d('0x19')]=_0x5044d6[_0xe74d('0x19')];this[_0xe74d('0x1a')]=_0x5044d6['ListId'];this[_0xe74d('0x1b')]=_0x5044d6[_0xe74d('0x1b')];this[_0xe74d('0x1c')]=_0x5044d6[_0xe74d('0x1c')];this['CampaignId']=_0x5044d6[_0xe74d('0x1d')];this[_0xe74d('0x1e')]=_0x5044d6[_0xe74d('0x1e')]||'';this[_0xe74d('0x1f')]=_0x5044d6[_0xe74d('0x1f')]||'';this[_0xe74d('0x20')]=_0x5044d6[_0xe74d('0x20')];this[_0xe74d('0x21')]=_0x5044d6[_0xe74d('0x21')];}module[_0xe74d('0x22')]=Final; \ No newline at end of file +var _0x1d52=['originatecalleridname','state','statedesc','exports','uniqueid','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','countmachineretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x37cd8c,_0x425de5){var _0x213168=function(_0x4aed59){while(--_0x4aed59){_0x37cd8c['push'](_0x37cd8c['shift']());}};_0x213168(++_0x425de5);}(_0x1d52,0x11c));var _0x21d5=function(_0x41c105,_0x5bb3c4){_0x41c105=_0x41c105-0x0;var _0x16d846=_0x1d52[_0x41c105];return _0x16d846;};'use strict';function Final(_0x379f5f){this[_0x21d5('0x0')]=_0x379f5f[_0x21d5('0x0')];this['scheduledat']=_0x379f5f['scheduledat'];this[_0x21d5('0x1')]=_0x379f5f[_0x21d5('0x1')];this[_0x21d5('0x2')]=_0x379f5f[_0x21d5('0x1')]===_0x21d5('0x3')?'queue':_0x379f5f[_0x21d5('0x1')];this[_0x21d5('0x4')]=_0x379f5f['countbusyretry'];this['countcongestionretry']=_0x379f5f[_0x21d5('0x5')];this['countnoanswerretry']=_0x379f5f[_0x21d5('0x6')];this[_0x21d5('0x7')]=_0x379f5f['countbusyretry']+_0x379f5f['countcongestionretry']+_0x379f5f[_0x21d5('0x6')]+_0x379f5f['countnosuchnumberretry']+_0x379f5f[_0x21d5('0x8')]+_0x379f5f['countabandonedretry']+_0x379f5f['countmachineretry']+_0x379f5f[_0x21d5('0x9')];this[_0x21d5('0xa')]=_0x379f5f[_0x21d5('0xa')];this[_0x21d5('0x8')]=_0x379f5f['countdropretry'];this[_0x21d5('0xb')]=_0x379f5f[_0x21d5('0xb')];this[_0x21d5('0xc')]=_0x379f5f[_0x21d5('0xc')];this[_0x21d5('0x9')]=_0x379f5f[_0x21d5('0x9')];this['queue']=_0x379f5f[_0x21d5('0xd')];this[_0x21d5('0xe')]=_0x379f5f[_0x21d5('0xe')];this[_0x21d5('0xf')]=_0x379f5f[_0x21d5('0xf')];this[_0x21d5('0x10')]=_0x379f5f['starttime'];this['responsetime']=_0x379f5f[_0x21d5('0x11')];this['endtime']=_0x379f5f[_0x21d5('0x11')];this[_0x21d5('0x12')]=_0x379f5f[_0x21d5('0x12')]||0x0;this['holdtime']=_0x379f5f[_0x21d5('0x13')]||0x0;this[_0x21d5('0x14')]=_0x379f5f[_0x21d5('0x14')]||0x0;this[_0x21d5('0x15')]=_0x379f5f[_0x21d5('0x15')];this[_0x21d5('0x16')]=_0x379f5f['callbackuniqueid'];this[_0x21d5('0x17')]=_0x379f5f['callbackat'];this[_0x21d5('0x18')]=_0x379f5f['recallme'];this[_0x21d5('0x19')]=_0x379f5f[_0x21d5('0x19')];this[_0x21d5('0x1a')]=_0x379f5f[_0x21d5('0x1a')];this[_0x21d5('0x1b')]=_0x379f5f[_0x21d5('0x1b')];this[_0x21d5('0x1c')]=_0x379f5f[_0x21d5('0x1c')];this[_0x21d5('0x1d')]=_0x379f5f[_0x21d5('0x1d')];this[_0x21d5('0x1e')]=_0x379f5f['originatecalleridnum']||'';this[_0x21d5('0x1f')]=_0x379f5f[_0x21d5('0x1f')]||'';this[_0x21d5('0x20')]=_0x379f5f[_0x21d5('0x20')];this[_0x21d5('0x21')]=_0x379f5f[_0x21d5('0x21')];}module[_0x21d5('0x22')]=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 c54369f..d690fc5 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 _0xc214=['starttime','endtime','format','ringtime','getSeconds','responsetime','holdtime','talktime','membername','IVR','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','../utils','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number'];(function(_0x458cac,_0x315751){var _0x107c4c=function(_0x563d02){while(--_0x563d02){_0x458cac['push'](_0x458cac['shift']());}};_0x107c4c(++_0x315751);}(_0xc214,0x1f2));var _0x4c21=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xc214[_0x2aa0e7];return _0x1472c0;};'use strict';var moment=require('moment');var utils=require(_0x4c21('0x0'));function Hangup(_0x235225,_0x20866f){this['state']=0x4;this[_0x4c21('0x1')]=_0x4c21('0x2');this[_0x4c21('0x3')]=_0x235225[_0x4c21('0x3')];this[_0x4c21('0x4')]=_0x235225['type'];this[_0x4c21('0x5')]=_0x235225[_0x4c21('0x4')]===_0x4c21('0x6')?_0x4c21('0x7'):_0x235225[_0x4c21('0x4')];this[_0x4c21('0x8')]=_0x235225['amd']||![];this[_0x4c21('0x9')]=_0x235225[_0x4c21('0x9')];this[_0x4c21('0xa')]=_0x235225['countcongestionretry'];this[_0x4c21('0xb')]=_0x235225[_0x4c21('0xb')];this[_0x4c21('0xc')]=_0x235225[_0x4c21('0x9')]+_0x235225[_0x4c21('0xa')]+_0x235225[_0x4c21('0xb')]+_0x235225['countnosuchnumberretry']+_0x235225[_0x4c21('0xd')]+_0x235225[_0x4c21('0xe')]+_0x235225[_0x4c21('0xf')]+_0x235225[_0x4c21('0x10')];this['countnosuchnumberretry']=_0x235225['countnosuchnumberretry'];this[_0x4c21('0xd')]=_0x235225[_0x4c21('0xd')];this[_0x4c21('0xe')]=_0x235225['countabandonedretry'];this[_0x4c21('0xf')]=_0x235225[_0x4c21('0xf')];this[_0x4c21('0x10')]=_0x235225[_0x4c21('0x10')];this[_0x4c21('0x11')]=_0x20866f['uniqueid'];this[_0x4c21('0x12')]=_0x235225[_0x4c21('0x13')];this[_0x4c21('0x14')]=_0x235225[_0x4c21('0x15')];this[_0x4c21('0x16')]=_0x235225[_0x4c21('0x16')];this['responsetime']=_0x235225['responsetime'];this[_0x4c21('0x17')]=moment()[_0x4c21('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4c21('0x19')]=utils[_0x4c21('0x1a')](_0x235225[_0x4c21('0x1b')],_0x235225[_0x4c21('0x16')]);this[_0x4c21('0x1c')]=0x0;this[_0x4c21('0x1d')]=utils['getSeconds'](this['endtime'],_0x235225[_0x4c21('0x1b')]);this[_0x4c21('0x7')]=_0x235225[_0x4c21('0x7')];this[_0x4c21('0x1e')]=_0x4c21('0x1f');this['reason']=_0x20866f['cause-txt'];this[_0x4c21('0x20')]=_0x235225[_0x4c21('0x20')];this[_0x4c21('0x21')]=_0x235225['callbackuniqueid'];this['callbackat']=_0x235225['callbackat'];this[_0x4c21('0x22')]=_0x235225[_0x4c21('0x22')];this[_0x4c21('0x23')]=_0x235225[_0x4c21('0x23')];this[_0x4c21('0x24')]=_0x235225[_0x4c21('0x24')];this[_0x4c21('0x25')]=_0x235225[_0x4c21('0x25')];this[_0x4c21('0x26')]=_0x235225[_0x4c21('0x26')];this[_0x4c21('0x27')]=_0x235225['CampaignId'];}module['exports']=Hangup; \ No newline at end of file +var _0x738b=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','state','statedesc','Answer','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0x738b,0x1ee));var _0xb738=function(_0x24c7fc,_0x5ef17d){_0x24c7fc=_0x24c7fc-0x0;var _0x36e2bc=_0x738b[_0x24c7fc];return _0x36e2bc;};'use strict';var moment=require('moment');var utils=require('../utils');function Hangup(_0x2348dc,_0x1d7d52){this[_0xb738('0x0')]=0x4;this[_0xb738('0x1')]=_0xb738('0x2');this[_0xb738('0x3')]=_0x2348dc[_0xb738('0x3')];this[_0xb738('0x4')]=_0x2348dc[_0xb738('0x4')];this['campaigntype']=_0x2348dc[_0xb738('0x4')]===_0xb738('0x5')?_0xb738('0x6'):_0x2348dc[_0xb738('0x4')];this['amd']=_0x2348dc[_0xb738('0x7')]||![];this['countbusyretry']=_0x2348dc[_0xb738('0x8')];this['countcongestionretry']=_0x2348dc[_0xb738('0x9')];this['countnoanswerretry']=_0x2348dc[_0xb738('0xa')];this[_0xb738('0xb')]=_0x2348dc[_0xb738('0x8')]+_0x2348dc[_0xb738('0x9')]+_0x2348dc[_0xb738('0xa')]+_0x2348dc[_0xb738('0xc')]+_0x2348dc[_0xb738('0xd')]+_0x2348dc['countabandonedretry']+_0x2348dc[_0xb738('0xe')]+_0x2348dc['countagentrejectretry'];this[_0xb738('0xc')]=_0x2348dc[_0xb738('0xc')];this[_0xb738('0xd')]=_0x2348dc[_0xb738('0xd')];this[_0xb738('0xf')]=_0x2348dc[_0xb738('0xf')];this[_0xb738('0xe')]=_0x2348dc[_0xb738('0xe')];this[_0xb738('0x10')]=_0x2348dc['countagentrejectretry'];this[_0xb738('0x11')]=_0x1d7d52['uniqueid'];this[_0xb738('0x12')]=_0x2348dc[_0xb738('0x13')];this['calleridnum']=_0x2348dc[_0xb738('0x14')];this[_0xb738('0x15')]=_0x2348dc['starttime'];this[_0xb738('0x16')]=_0x2348dc['responsetime'];this[_0xb738('0x17')]=moment()[_0xb738('0x18')](_0xb738('0x19'));this[_0xb738('0x1a')]=utils[_0xb738('0x1b')](_0x2348dc[_0xb738('0x16')],_0x2348dc[_0xb738('0x15')]);this['holdtime']=0x0;this[_0xb738('0x1c')]=utils[_0xb738('0x1b')](this[_0xb738('0x17')],_0x2348dc[_0xb738('0x16')]);this['queue']=_0x2348dc['queue'];this[_0xb738('0x1d')]='IVR';this[_0xb738('0x1e')]=_0x1d7d52[_0xb738('0x1f')];this['callback']=_0x2348dc[_0xb738('0x20')];this[_0xb738('0x21')]=_0x2348dc[_0xb738('0x21')];this[_0xb738('0x22')]=_0x2348dc['callbackat'];this[_0xb738('0x23')]=_0x2348dc[_0xb738('0x23')];this[_0xb738('0x24')]=_0x2348dc[_0xb738('0x24')];this[_0xb738('0x25')]=_0x2348dc[_0xb738('0x25')];this[_0xb738('0x26')]=_0x2348dc[_0xb738('0x26')];this[_0xb738('0x27')]=_0x2348dc[_0xb738('0x27')];this[_0xb738('0x28')]=_0x2348dc[_0xb738('0x28')];}module[_0xb738('0x29')]=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 a451a1d..1ee44b5 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 _0x24d6=['countglobal','countnosuchnumberretry','countmachineretry','countdropretry','countabandonedretry','queue','name','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','countcongestionretry','countnoanswerretry'];(function(_0xf9b6da,_0x25eb5d){var _0x3d6658=function(_0x3bb734){while(--_0x3bb734){_0xf9b6da['push'](_0xf9b6da['shift']());}};_0x3d6658(++_0x25eb5d);}(_0x24d6,0x90));var _0x624d=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x24d6[_0x2a6809];return _0x11c371;};'use strict';var utils=require(_0x624d('0x0'));function History(_0x1767fc){this[_0x624d('0x1')]=_0x1767fc[_0x624d('0x1')];this[_0x624d('0x2')]=_0x1767fc['scheduledat']||undefined;this[_0x624d('0x3')]=_0x1767fc[_0x624d('0x3')];this[_0x624d('0x4')]=_0x1767fc[_0x624d('0x3')]===_0x624d('0x5')?'queue':_0x1767fc['type'];this['countbusyretry']=_0x1767fc['countbusyretry'];this[_0x624d('0x6')]=_0x1767fc[_0x624d('0x6')];this[_0x624d('0x7')]=_0x1767fc[_0x624d('0x7')];this[_0x624d('0x8')]=_0x1767fc['countbusyretry']+_0x1767fc[_0x624d('0x6')]+_0x1767fc['countnoanswerretry']+_0x1767fc[_0x624d('0x9')]+_0x1767fc['countdropretry']+_0x1767fc['countabandonedretry']+_0x1767fc[_0x624d('0xa')]+_0x1767fc['countagentrejectretry'];this['countnosuchnumberretry']=_0x1767fc[_0x624d('0x9')];this[_0x624d('0xb')]=_0x1767fc[_0x624d('0xb')];this[_0x624d('0xc')]=_0x1767fc[_0x624d('0xc')];this[_0x624d('0xa')]=_0x1767fc[_0x624d('0xa')];this['countagentrejectretry']=_0x1767fc['countagentrejectretry'];this[_0x624d('0xd')]=_0x1767fc[_0x624d('0xd')];this['calleridname']=_0x1767fc[_0x624d('0xe')];this[_0x624d('0xf')]=_0x1767fc[_0x624d('0x10')];this[_0x624d('0x11')]=_0x1767fc[_0x624d('0x11')];this['responsetime']=_0x1767fc[_0x624d('0x12')];this[_0x624d('0x13')]=_0x1767fc[_0x624d('0x12')];this[_0x624d('0x14')]=utils[_0x624d('0x15')](_0x1767fc['responsetime'],_0x1767fc[_0x624d('0x11')]);this[_0x624d('0x16')]=0x0;this[_0x624d('0x17')]=0x0;this[_0x624d('0x18')]=_0x1767fc[_0x624d('0x18')];this[_0x624d('0x19')]=_0x1767fc[_0x624d('0x19')];this['callbackat']=_0x1767fc[_0x624d('0x1a')];this[_0x624d('0x1b')]=_0x1767fc['recallme'];this['ContactId']=_0x1767fc[_0x624d('0x1c')];this['ListId']=_0x1767fc[_0x624d('0x1d')];this[_0x624d('0x1e')]=_0x1767fc[_0x624d('0x1e')];this[_0x624d('0x1f')]=_0x1767fc[_0x624d('0x1f')];this[_0x624d('0x20')]=_0x1767fc[_0x624d('0x20')];this[_0x624d('0x21')]=_0x1767fc[_0x624d('0x21')]||'';this[_0x624d('0x22')]=_0x1767fc['originatecalleridname']||'';this['state']=_0x1767fc[_0x624d('0x23')];this[_0x624d('0x24')]=_0x1767fc[_0x624d('0x24')];}module[_0x624d('0x25')]=History; \ No newline at end of file +var _0x2cc6=['countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','number','starttime','responsetime','endtime','ringtime','getSeconds','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','type','outbound','queue','countbusyretry'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2cc6,0x170));var _0x62cc=function(_0x284885,_0x34b143){_0x284885=_0x284885-0x0;var _0x3a9710=_0x2cc6[_0x284885];return _0x3a9710;};'use strict';var utils=require(_0x62cc('0x0'));function History(_0x192309){this[_0x62cc('0x1')]=_0x192309[_0x62cc('0x1')];this['scheduledat']=_0x192309['scheduledat']||undefined;this['type']=_0x192309[_0x62cc('0x2')];this['campaigntype']=_0x192309[_0x62cc('0x2')]===_0x62cc('0x3')?_0x62cc('0x4'):_0x192309[_0x62cc('0x2')];this[_0x62cc('0x5')]=_0x192309[_0x62cc('0x5')];this['countcongestionretry']=_0x192309[_0x62cc('0x6')];this['countnoanswerretry']=_0x192309[_0x62cc('0x7')];this[_0x62cc('0x8')]=_0x192309[_0x62cc('0x5')]+_0x192309[_0x62cc('0x6')]+_0x192309[_0x62cc('0x7')]+_0x192309['countnosuchnumberretry']+_0x192309['countdropretry']+_0x192309[_0x62cc('0x9')]+_0x192309[_0x62cc('0xa')]+_0x192309[_0x62cc('0xb')];this['countnosuchnumberretry']=_0x192309[_0x62cc('0xc')];this[_0x62cc('0xd')]=_0x192309[_0x62cc('0xd')];this[_0x62cc('0x9')]=_0x192309[_0x62cc('0x9')];this['countmachineretry']=_0x192309['countmachineretry'];this[_0x62cc('0xb')]=_0x192309[_0x62cc('0xb')];this[_0x62cc('0x4')]=_0x192309[_0x62cc('0x4')];this['calleridname']=_0x192309['name'];this['calleridnum']=_0x192309[_0x62cc('0xe')];this['starttime']=_0x192309[_0x62cc('0xf')];this[_0x62cc('0x10')]=_0x192309[_0x62cc('0x10')];this[_0x62cc('0x11')]=_0x192309[_0x62cc('0x10')];this[_0x62cc('0x12')]=utils[_0x62cc('0x13')](_0x192309[_0x62cc('0x10')],_0x192309[_0x62cc('0xf')]);this['holdtime']=0x0;this[_0x62cc('0x14')]=0x0;this['callback']=_0x192309[_0x62cc('0x15')];this[_0x62cc('0x16')]=_0x192309[_0x62cc('0x16')];this[_0x62cc('0x17')]=_0x192309[_0x62cc('0x17')];this[_0x62cc('0x18')]=_0x192309[_0x62cc('0x18')];this[_0x62cc('0x19')]=_0x192309[_0x62cc('0x19')];this['ListId']=_0x192309['ListId'];this[_0x62cc('0x1a')]=_0x192309[_0x62cc('0x1a')];this[_0x62cc('0x1b')]=_0x192309[_0x62cc('0x1b')];this['CampaignId']=_0x192309[_0x62cc('0x1c')];this['originatecalleridnum']=_0x192309[_0x62cc('0x1d')]||'';this[_0x62cc('0x1e')]=_0x192309[_0x62cc('0x1e')]||'';this[_0x62cc('0x1f')]=_0x192309[_0x62cc('0x1f')];this[_0x62cc('0x20')]=_0x192309[_0x62cc('0x20')];}module[_0x62cc('0x21')]=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 3e2d771..1495a94 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 _0xaa80=['VoiceQueueId','CampaignId','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','name','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','holdtime','getSeconds','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x2280eb,_0x15c4f6){var _0x1daead=function(_0x460c59){while(--_0x460c59){_0x2280eb['push'](_0x2280eb['shift']());}};_0x1daead(++_0x15c4f6);}(_0xaa80,0x157));var _0x0aa8=function(_0x5dfd07,_0x11f42e){_0x5dfd07=_0x5dfd07-0x0;var _0x10cd46=_0xaa80[_0x5dfd07];return _0x10cd46;};'use strict';var utils=require(_0x0aa8('0x0'));function QueueCallerAbandon(_0x4aebd8,_0xa9af76){this[_0x0aa8('0x1')]=_0x4aebd8[_0x0aa8('0x1')];this[_0x0aa8('0x2')]=_0x4aebd8['type'];this[_0x0aa8('0x3')]=_0x4aebd8[_0x0aa8('0x2')]==='outbound'?_0x0aa8('0x4'):_0x4aebd8['type'];this['countbusyretry']=_0x4aebd8[_0x0aa8('0x5')];this[_0x0aa8('0x6')]=_0x4aebd8[_0x0aa8('0x6')];this[_0x0aa8('0x7')]=_0x4aebd8['countnoanswerretry'];this[_0x0aa8('0x8')]=_0x4aebd8[_0x0aa8('0x5')]+_0x4aebd8[_0x0aa8('0x6')]+_0x4aebd8['countnoanswerretry']+_0x4aebd8[_0x0aa8('0x9')]+_0x4aebd8['countdropretry']+_0x4aebd8[_0x0aa8('0xa')]+_0x4aebd8[_0x0aa8('0xb')]+_0x4aebd8[_0x0aa8('0xc')];this[_0x0aa8('0x9')]=_0x4aebd8[_0x0aa8('0x9')];this[_0x0aa8('0xd')]=_0x4aebd8['countdropretry'];this[_0x0aa8('0xa')]=_0x4aebd8[_0x0aa8('0xa')];this['countmachineretry']=_0x4aebd8[_0x0aa8('0xb')];this[_0x0aa8('0xc')]=_0x4aebd8[_0x0aa8('0xc')];this[_0x0aa8('0xe')]=_0xa9af76[_0x0aa8('0xe')];this['calleridname']=_0x4aebd8[_0x0aa8('0xf')];this['calleridnum']=_0x4aebd8[_0x0aa8('0x10')];this[_0x0aa8('0x11')]=_0x4aebd8['starttime'];this[_0x0aa8('0x12')]=_0x4aebd8[_0x0aa8('0x12')];this[_0x0aa8('0x13')]=_0x4aebd8['droptime'];this[_0x0aa8('0x14')]=_0x4aebd8[_0x0aa8('0x14')];this[_0x0aa8('0x15')]=this[_0x0aa8('0x13')];this[_0x0aa8('0x16')]=utils['getSeconds'](_0x4aebd8[_0x0aa8('0x12')],_0x4aebd8[_0x0aa8('0x11')]);this[_0x0aa8('0x17')]=utils[_0x0aa8('0x18')](this[_0x0aa8('0x13')],_0x4aebd8[_0x0aa8('0x12')]);this[_0x0aa8('0x19')]=0x0;this[_0x0aa8('0x4')]=_0xa9af76[_0x0aa8('0x4')];this[_0x0aa8('0x1a')]=_0xa9af76['connectedlinename'];this[_0x0aa8('0x1b')]=_0xa9af76[_0x0aa8('0x1b')];this['callback']=_0x4aebd8[_0x0aa8('0x1c')];this['callbackuniqueid']=_0x4aebd8[_0x0aa8('0x1d')];this[_0x0aa8('0x1e')]=_0x4aebd8['callbackat'];this[_0x0aa8('0x1f')]=_0x4aebd8[_0x0aa8('0x1f')];this[_0x0aa8('0x20')]=_0x4aebd8[_0x0aa8('0x20')];this[_0x0aa8('0x21')]=_0x4aebd8['ListId'];this[_0x0aa8('0x22')]=_0x4aebd8[_0x0aa8('0x22')];this['VoiceQueueId']=_0x4aebd8[_0x0aa8('0x23')];this[_0x0aa8('0x24')]=_0x4aebd8[_0x0aa8('0x24')];this['originatecalleridnum']=_0x4aebd8['originatecalleridnum']||'';this[_0x0aa8('0x25')]=_0x4aebd8[_0x0aa8('0x25')]||'';this[_0x0aa8('0x26')]=_0x4aebd8['agiafterat'];this[_0x0aa8('0x27')]=_0x4aebd8[_0x0aa8('0x27')];this['statedesc']=_0x4aebd8[_0x0aa8('0x28')];}module[_0x0aa8('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0xf2d0=['starttime','responsetime','droptime','dropreason','ringtime','getSeconds','holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','agiafterat','state','statedesc','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number'];(function(_0x2c93e5,_0x1c20c3){var _0x1f4fea=function(_0x33b7d6){while(--_0x33b7d6){_0x2c93e5['push'](_0x2c93e5['shift']());}};_0x1f4fea(++_0x1c20c3);}(_0xf2d0,0x137));var _0x0f2d=function(_0x211d64,_0x1cbbe3){_0x211d64=_0x211d64-0x0;var _0x56d5cd=_0xf2d0[_0x211d64];return _0x56d5cd;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x118153,_0x28a869){this[_0x0f2d('0x0')]=_0x118153[_0x0f2d('0x0')];this[_0x0f2d('0x1')]=_0x118153[_0x0f2d('0x1')];this[_0x0f2d('0x2')]=_0x118153[_0x0f2d('0x1')]===_0x0f2d('0x3')?'queue':_0x118153[_0x0f2d('0x1')];this[_0x0f2d('0x4')]=_0x118153[_0x0f2d('0x4')];this[_0x0f2d('0x5')]=_0x118153[_0x0f2d('0x5')];this[_0x0f2d('0x6')]=_0x118153[_0x0f2d('0x6')];this[_0x0f2d('0x7')]=_0x118153[_0x0f2d('0x4')]+_0x118153['countcongestionretry']+_0x118153[_0x0f2d('0x6')]+_0x118153[_0x0f2d('0x8')]+_0x118153[_0x0f2d('0x9')]+_0x118153['countabandonedretry']+_0x118153['countmachineretry']+_0x118153['countagentrejectretry'];this[_0x0f2d('0x8')]=_0x118153[_0x0f2d('0x8')];this[_0x0f2d('0x9')]=_0x118153[_0x0f2d('0x9')];this[_0x0f2d('0xa')]=_0x118153[_0x0f2d('0xa')];this[_0x0f2d('0xb')]=_0x118153[_0x0f2d('0xb')];this[_0x0f2d('0xc')]=_0x118153[_0x0f2d('0xc')];this[_0x0f2d('0xd')]=_0x28a869[_0x0f2d('0xd')];this[_0x0f2d('0xe')]=_0x118153['name'];this[_0x0f2d('0xf')]=_0x118153[_0x0f2d('0x10')];this[_0x0f2d('0x11')]=_0x118153[_0x0f2d('0x11')];this['responsetime']=_0x118153[_0x0f2d('0x12')];this[_0x0f2d('0x13')]=_0x118153[_0x0f2d('0x13')];this['dropreason']=_0x118153[_0x0f2d('0x14')];this['endtime']=this[_0x0f2d('0x13')];this[_0x0f2d('0x15')]=utils[_0x0f2d('0x16')](_0x118153[_0x0f2d('0x12')],_0x118153[_0x0f2d('0x11')]);this[_0x0f2d('0x17')]=utils[_0x0f2d('0x16')](this['droptime'],_0x118153[_0x0f2d('0x12')]);this[_0x0f2d('0x18')]=0x0;this[_0x0f2d('0x19')]=_0x28a869['queue'];this[_0x0f2d('0x1a')]=_0x28a869[_0x0f2d('0x1b')];this['reason']=_0x28a869[_0x0f2d('0x1c')];this[_0x0f2d('0x1d')]=_0x118153[_0x0f2d('0x1d')];this[_0x0f2d('0x1e')]=_0x118153[_0x0f2d('0x1e')];this[_0x0f2d('0x1f')]=_0x118153['callbackat'];this['recallme']=_0x118153[_0x0f2d('0x20')];this[_0x0f2d('0x21')]=_0x118153[_0x0f2d('0x21')];this['ListId']=_0x118153[_0x0f2d('0x22')];this['UserId']=_0x118153['UserId'];this[_0x0f2d('0x23')]=_0x118153['VoiceQueueId'];this[_0x0f2d('0x24')]=_0x118153[_0x0f2d('0x24')];this[_0x0f2d('0x25')]=_0x118153['originatecalleridnum']||'';this['originatecalleridname']=_0x118153['originatecalleridname']||'';this[_0x0f2d('0x26')]=_0x118153['agiafterat'];this[_0x0f2d('0x27')]=_0x118153[_0x0f2d('0x27')];this[_0x0f2d('0x28')]=_0x118153['statedesc'];}module['exports']=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 68142e5..0f2a4cc 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 _0x2542=['getContactDialer','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','[unlockContact]','unlockContact','moveContactManagedDialer','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]','[verifyAdditionalPhone]','verifyAdditionalPhones','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperBlack','inspect','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]'];(function(_0x30a956,_0x11222e){var _0x2ac17d=function(_0x3be1d2){while(--_0x3be1d2){_0x30a956['push'](_0x30a956['shift']());}};_0x2ac17d(++_0x11222e);}(_0x2542,0x169));var _0x2254=function(_0x484ed9,_0x352885){_0x484ed9=_0x484ed9-0x0;var _0x35cb69=_0x2542[_0x484ed9];return _0x35cb69;};'use strict';var util=require(_0x2254('0x0'));var logger=require(_0x2254('0x1'))(_0x2254('0x2'));var cmHopper=require(_0x2254('0x3'));var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x2254('0x4'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x4059d1){return util[_0x2254('0x5')](_0x4059d1,{'showHidden':![],'depth':null});}function getContactDialer(_0x27f5c9,_0x456612,_0x76c902){return cmHopper['getContactDialer'](_0x27f5c9['id'],_0x456612,_0x76c902,_0x27f5c9[_0x2254('0x6')])[_0x2254('0x7')](function(_0x2ee7ee){_0x27f5c9[_0x2254('0x8')]=0x0;logger[_0x2254('0x9')](_0x2254('0xa'),inspectError(_0x2ee7ee));});}exports[_0x2254('0xb')]=getContactDialer;function getContactDialerIvr(_0xbf1c18,_0xb395da){return cmHopper[_0x2254('0xc')](_0xbf1c18['id'],_0xb395da,_0xbf1c18[_0x2254('0x6')])['catch'](function(_0x336e14){_0xbf1c18[_0x2254('0x8')]=0x0;logger[_0x2254('0x9')](_0x2254('0xd'),inspectError(_0x336e14));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x524fad){return cmHopper[_0x2254('0xe')](_0x524fad)[_0x2254('0x7')](function(_0x116b70){logger[_0x2254('0x9')](_0x2254('0xf'),inspectError(_0x116b70));});}exports[_0x2254('0xe')]=countReScheduled;function rescheduleContact(_0x592a4f){return cmHopper[_0x2254('0x10')](_0x592a4f)[_0x2254('0x7')](function(_0x504749){logger[_0x2254('0x9')](_0x2254('0x11'),inspectError(_0x504749));});}exports[_0x2254('0x10')]=rescheduleContact;function unlockContact(_0x145272,_0x26285a,_0xbc5548){return cmHopper['unlockContact'](_0x145272,_0x26285a,_0xbc5548)[_0x2254('0x7')](function(_0x57247a){logger[_0x2254('0x9')](_0x2254('0x12'),inspectError(_0x57247a));});}exports[_0x2254('0x13')]=unlockContact;function moveContactManagedDialer(_0x25f8b2){return cmHopper[_0x2254('0x14')](_0x25f8b2)[_0x2254('0x7')](function(_0x497724){logger['error']('[moveContactManagedDialer]',inspectError(_0x497724));});}exports[_0x2254('0x14')]=moveContactManagedDialer;function checkIsBlackList(_0x3a79f8){return cmHopperBlack[_0x2254('0x15')](_0x3a79f8)[_0x2254('0x7')](function(_0x2801d9){logger[_0x2254('0x9')]('[checkIsBlackList]',inspectError(_0x2801d9));});}exports[_0x2254('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x16148d){return cmHopperBlack[_0x2254('0x16')](_0x16148d)['catch'](function(_0x52fedc){logger['error'](_0x2254('0x17'),inspectError(_0x52fedc));});}exports[_0x2254('0x16')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0xf88b56,_0x56b91e,_0x5713e4){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0xf88b56,_0x56b91e,_0x5713e4)['catch'](function(_0x5e5edb){logger['error'](_0x2254('0x18'),inspectError(_0x5e5edb));});}exports[_0x2254('0x19')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x2f3037,_0x265467,_0x13522d){return cmHopperAdditionalPhone[_0x2254('0x1a')](_0x2f3037,_0x265467,_0x13522d)['catch'](function(_0x4a8274){logger[_0x2254('0x9')]('[swapAdditionalPhone]',inspectError(_0x4a8274));});}exports[_0x2254('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x141dc5){return cmHopperHistory[_0x2254('0x1b')](_0x141dc5)[_0x2254('0x7')](function(_0x19043b){logger['error'](_0x2254('0x1c'),inspectError(_0x19043b));});}exports[_0x2254('0x1b')]=avgHandleTime;function createHistory(_0x21285d){return cmHopperHistory[_0x2254('0x1d')](_0x21285d)[_0x2254('0x7')](function(_0x377c41){logger[_0x2254('0x9')](_0x2254('0x1e'),inspectError(_0x377c41));});}exports[_0x2254('0x1d')]=createHistory; \ No newline at end of file +var _0x7b84=['swapAdditionalPhones','[avgHandleTime]','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','temp','error','[getContactDialer]','getContactDialerIvr','catch','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','unlockContact','[unlockContact]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','[verifyAdditionalPhone]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b84,0x17c));var _0x47b8=function(_0x126f02,_0x83a49a){_0x126f02=_0x126f02-0x0;var _0x1199a9=_0x7b84[_0x126f02];return _0x1199a9;};'use strict';var util=require(_0x47b8('0x0'));var logger=require(_0x47b8('0x1'))(_0x47b8('0x2'));var cmHopper=require(_0x47b8('0x3'));var cmHopperAdditionalPhone=require(_0x47b8('0x4'));var cmHopperBlack=require(_0x47b8('0x5'));var cmHopperHistory=require(_0x47b8('0x6'));function inspectError(_0x5c7cda){return util[_0x47b8('0x7')](_0x5c7cda,{'showHidden':![],'depth':null});}function getContactDialer(_0x1fa41a,_0x2279ea,_0x7013d7){return cmHopper[_0x47b8('0x8')](_0x1fa41a['id'],_0x2279ea,_0x7013d7,_0x1fa41a[_0x47b8('0x9')])['catch'](function(_0x3867ca){_0x1fa41a[_0x47b8('0xa')]=0x0;logger[_0x47b8('0xb')](_0x47b8('0xc'),inspectError(_0x3867ca));});}exports[_0x47b8('0x8')]=getContactDialer;function getContactDialerIvr(_0x1af17f,_0x24d240){return cmHopper[_0x47b8('0xd')](_0x1af17f['id'],_0x24d240,_0x1af17f[_0x47b8('0x9')])[_0x47b8('0xe')](function(_0x289f98){_0x1af17f[_0x47b8('0xa')]=0x0;logger[_0x47b8('0xb')](_0x47b8('0xf'),inspectError(_0x289f98));});}exports[_0x47b8('0xd')]=getContactDialerIvr;function countReScheduled(_0x2a1af3){return cmHopper[_0x47b8('0x10')](_0x2a1af3)[_0x47b8('0xe')](function(_0x25a224){logger[_0x47b8('0xb')](_0x47b8('0x11'),inspectError(_0x25a224));});}exports[_0x47b8('0x10')]=countReScheduled;function rescheduleContact(_0x2d1aaf){return cmHopper[_0x47b8('0x12')](_0x2d1aaf)[_0x47b8('0xe')](function(_0x223121){logger[_0x47b8('0xb')]('[rescheduleContact]',inspectError(_0x223121));});}exports[_0x47b8('0x12')]=rescheduleContact;function unlockContact(_0x340da0,_0x3e760a,_0x1217a4){return cmHopper[_0x47b8('0x13')](_0x340da0,_0x3e760a,_0x1217a4)[_0x47b8('0xe')](function(_0x4765ad){logger['error'](_0x47b8('0x14'),inspectError(_0x4765ad));});}exports['unlockContact']=unlockContact;function moveContactManagedDialer(_0x525fd6){return cmHopper['moveContactManagedDialer'](_0x525fd6)[_0x47b8('0xe')](function(_0x36faf1){logger[_0x47b8('0xb')]('[moveContactManagedDialer]',inspectError(_0x36faf1));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x4f6716){return cmHopperBlack[_0x47b8('0x15')](_0x4f6716)['catch'](function(_0x2a4fa7){logger[_0x47b8('0xb')](_0x47b8('0x16'),inspectError(_0x2a4fa7));});}exports[_0x47b8('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x4eba33){return cmHopperBlack[_0x47b8('0x17')](_0x4eba33)[_0x47b8('0xe')](function(_0x2840c3){logger[_0x47b8('0xb')](_0x47b8('0x18'),inspectError(_0x2840c3));});}exports[_0x47b8('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x54f6bc,_0x31555d,_0x2a22e3){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x54f6bc,_0x31555d,_0x2a22e3)[_0x47b8('0xe')](function(_0x247429){logger[_0x47b8('0xb')](_0x47b8('0x19'),inspectError(_0x247429));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x35b327,_0x332c23,_0x319d17){return cmHopperAdditionalPhone[_0x47b8('0x1a')](_0x35b327,_0x332c23,_0x319d17)[_0x47b8('0xe')](function(_0xbf5ce9){logger[_0x47b8('0xb')]('[swapAdditionalPhone]',inspectError(_0xbf5ce9));});}exports[_0x47b8('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x1f719a){return cmHopperHistory['avgHandleTime'](_0x1f719a)[_0x47b8('0xe')](function(_0x6d517a){logger[_0x47b8('0xb')](_0x47b8('0x1b'),inspectError(_0x6d517a));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x162d96){return cmHopperHistory['createHistory'](_0x162d96)[_0x47b8('0xe')](function(_0x2255ab){logger[_0x47b8('0xb')](_0x47b8('0x1c'),inspectError(_0x2255ab));});}exports['createHistory']=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 5667935..c1b5749 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 _0x7249=['GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','preview','type','isIVRCampaign','outbound','isOutboundQueue','isQueueCampaignActive','isIVRCampaignActive','diff','seconds','getSeconds','dialMethod','dialActive','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','dialGlobalInterval','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','includes','status','TrunkBackup','ACTIVE','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','isUndefined','string','format','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','random','toString','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','updatedAt','undefined','description','length','toUpperCase','XMD-','setXMDContactVariables','lodash','moment','../../../../config/environment/shared','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','INTERVAL_IS_EMPTY','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME'];(function(_0x50cc54,_0x54c15f){var _0x28ecca=function(_0x4eff92){while(--_0x4eff92){_0x50cc54['push'](_0x50cc54['shift']());}};_0x28ecca(++_0x54c15f);}(_0x7249,0xa2));var _0x9724=function(_0x4eb5e1,_0x36f619){_0x4eb5e1=_0x4eb5e1-0x0;var _0x549c4a=_0x7249[_0x4eb5e1];return _0x549c4a;};'use strict';var _=require(_0x9724('0x0'));var moment=require(_0x9724('0x1'));var util=require('util');var logger=require('../../../../config/logger')('dialer');var timezones=require(_0x9724('0x2'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x9724('0x3'),'CONTACTS_RESCHEDULED':_0x9724('0x4'),'DEACTIVATED':_0x9724('0x5'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':_0x9724('0x6'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x9724('0x7'),'NULL_INTERVAL':_0x9724('0x8'),'OVERTIME_INTERVAL':_0x9724('0x9'),'OVERTIME_GLOBAL_INTERVAL':_0x9724('0xa'),'QUEUE_RECALL':_0x9724('0xb'),'RECALL_TIMEOUT':_0x9724('0xc'),'RUNNING':_0x9724('0xd'),'UNKNOWN_TIMEZONE':_0x9724('0xe'),'UNREACHABLE_TRUNK':_0x9724('0xf')};exports[_0x9724('0x10')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x5b3079){return _0x5b3079['dialMethod']===_0x9724('0x11');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0xcfb525){return _0xcfb525[_0x9724('0x12')]==='ivr';}exports[_0x9724('0x13')]=isIVRCampaign;function isOutboundQueue(_0x20f5e4){return _0x20f5e4[_0x9724('0x12')]===_0x9724('0x14');}exports[_0x9724('0x15')]=isOutboundQueue;function isQueueCampaignActive(_0x3af8a1){return _0x3af8a1['dialActive'];}exports[_0x9724('0x16')]=isQueueCampaignActive;function isIVRCampaignActive(_0x2d58cc){return _0x2d58cc['active'];}exports[_0x9724('0x17')]=isIVRCampaignActive;function getSeconds(_0x9817b5,_0x50c5e0){var _0x2d2ffd=moment(_0x9817b5)['milliseconds'](0x0);var _0x225e80=moment(_0x50c5e0)['milliseconds'](0x0);return _0x2d2ffd[_0x9724('0x18')](_0x225e80,_0x9724('0x19'));}exports[_0x9724('0x1a')]=getSeconds;function hasQueueCampaignDataChanged(_0x3f232e,_0x444f03){var _0xac0574=![];var _0x58255f=_0x3f232e[_0x9724('0x1b')]!==_0x444f03[_0x9724('0x1b')]||_0x3f232e[_0x9724('0x1c')]!==_0x444f03['dialActive']||_0x3f232e[_0x9724('0x1d')]!==_0x444f03[_0x9724('0x1d')];var _0x3c1759=_0x3f232e[_0x9724('0x1e')]!==_0x444f03[_0x9724('0x1e')]||_0x3f232e[_0x9724('0x1f')]!==_0x444f03['loggedIn']||_0x3f232e['loggedInDb']!==_0x444f03[_0x9724('0x20')]||_0x3f232e[_0x9724('0x21')]!==_0x444f03['paused']||_0x3f232e[_0x9724('0x22')]!==_0x444f03[_0x9724('0x22')]||_0x3f232e[_0x9724('0x23')]!==_0x444f03[_0x9724('0x23')]||_0x3f232e['waiting']!==_0x444f03[_0x9724('0x24')]||_0x3f232e[_0x9724('0x25')]!==_0x444f03[_0x9724('0x25')]||_0x3f232e[_0x9724('0x26')]!==_0x444f03[_0x9724('0x26')];if(_0x3f232e[_0x9724('0x27')]&&_0x444f03[_0x9724('0x27')]){_0xac0574=_0x3f232e['Trunk'][_0x9724('0x28')]!==_0x444f03[_0x9724('0x27')][_0x9724('0x28')]||_0x3f232e[_0x9724('0x27')]['active']!==_0x444f03['Trunk'][_0x9724('0x29')];}return _0x58255f||_0x3c1759||_0xac0574;}exports[_0x9724('0x2a')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x1e68f7){var _0x1888de=null;var _0x351624=_0x1e68f7[_0x9724('0x2b')];if(_['isNil'](_0x1e68f7[_0x9724('0x2c')])||_[_0x9724('0x2d')](_0x1e68f7[_0x9724('0x2e')])||_['isNil'](_0x1e68f7['Interval'][_0x9724('0x2f')])){_0x1888de=CAMPAIGN_STATUS[_0x9724('0x30')];}else if(_['isEmpty'](_0x1e68f7[_0x9724('0x2c')])||_[_0x9724('0x31')](_0x1e68f7[_0x9724('0x2e')]['Intervals'])){_0x1888de=CAMPAIGN_STATUS[_0x9724('0x32')];}else if(_0x351624&&!timezones[_0x351624]){_0x1888de=CAMPAIGN_STATUS[_0x9724('0x33')];}return _0x1888de;}function checkAnyValidTrunk(_0x24a96a,_0x18acd7){var _0x32e8ca=null;var _0x4a803e=_0x9724('0x34');var _0x89131a=[_0x9724('0x35'),'unmonitored'];var _0x179099=!![];if(_0x24a96a[_0x9724('0x27')]&&_0x24a96a[_0x9724('0x27')][_0x9724('0x29')]){_0x4a803e+=_0x24a96a[_0x9724('0x27')][_0x9724('0x28')];_0x32e8ca=_0x18acd7[_0x4a803e];_0x179099=_0x89131a[_0x9724('0x36')](_0x32e8ca[_0x9724('0x37')]);}else if(_0x24a96a[_0x9724('0x38')]&&_0x24a96a[_0x9724('0x38')][_0x9724('0x29')]){_0x4a803e+=_0x24a96a[_0x9724('0x38')][_0x9724('0x28')];_0x32e8ca=_0x18acd7[_0x4a803e];_0x179099=_0x89131a[_0x9724('0x36')](_0x32e8ca[_0x9724('0x37')]);}return _0x179099;}function getQueueCampaignStatusMessage(_0x5ac726,_0x165444){var _0x1d415f=CAMPAIGN_STATUS[_0x9724('0x39')];var _0x8841b3=isPreviewCampaign(_0x5ac726);if(!isQueueCampaignActive(_0x5ac726)){if(_0x8841b3){_0x1d415f=CAMPAIGN_STATUS[_0x9724('0x3a')];}else{if(_0x5ac726[_0x9724('0x26')]===0x0&&_0x5ac726[_0x9724('0x22')]===0x0&&_0x5ac726[_0x9724('0x24')]===0x0&&(_0x5ac726[_0x9724('0x23')]||0x0)===0x0){_0x1d415f=CAMPAIGN_STATUS[_0x9724('0x3a')];}else{_0x1d415f=CAMPAIGN_STATUS[_0x9724('0x3b')];}}}else if(_0x5ac726[_0x9724('0x1f')]===0x0){_0x1d415f=CAMPAIGN_STATUS[_0x9724('0x3c')];}else if(!checkAnyValidTrunk(_0x5ac726,_0x165444)){_0x1d415f=CAMPAIGN_STATUS[_0x9724('0x3d')];}else if(!isPreviewCampaign(_0x5ac726)){var _0x1de9b0=checkAnyValidQueueCampaignInterval(_0x5ac726);if(_0x1de9b0){_0x1d415f=_0x1de9b0;}}return _0x1d415f;}exports[_0x9724('0x3e')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x2daf82){var _0x55e798=CAMPAIGN_STATUS[_0x9724('0x3b')];if(_0x2daf82[_0x9724('0x26')]===0x0&&_0x2daf82[_0x9724('0x22')]===0x0&&_0x2daf82[_0x9724('0x24')]===0x0&&(_0x2daf82[_0x9724('0x23')]||0x0)===0x0){_0x55e798=CAMPAIGN_STATUS[_0x9724('0x3a')];}return _0x55e798;}exports[_0x9724('0x3f')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x400fde){var _0x28336f=_0x400fde[_0x9724('0x40')](/"(.*?)"/);return _0x28336f?_0x28336f[0x1]:_0x400fde;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x2392b6,_0x524bd6,_0x240495){if(!_[_0x9724('0x41')](_0x240495)&&typeof _0x240495==='string'&&!_[_0x9724('0x31')](_0x240495)){if(!_[_0x9724('0x41')](_0x524bd6)&&typeof _0x524bd6===_0x9724('0x42')&&!_['isEmpty'](_0x524bd6)){return util[_0x9724('0x43')]('\x22%s\x22\x20<%s>',_0x524bd6,_0x240495);}return util[_0x9724('0x43')]('\x22%s\x22\x20<%s>',_0x240495,_0x240495);}if(!_[_0x9724('0x41')](_0x2392b6)&&typeof _0x2392b6===_0x9724('0x42')&&!_[_0x9724('0x31')](_0x2392b6)){return _0x2392b6;}return _0x9724('0x44');}exports[_0x9724('0x45')]=getCallerId;function getCallerIdRandom(_0x5153e8,_0x1aa113){var _0x1d2c19;var _0x3593e5;var _0x5a53f1;if(_0x1aa113<=0x0){_0x1aa113=0x1;}_0x1d2c19=new RegExp(_0x9724('0x46')+_0x1aa113+'}$');_0x3593e5=Math[_0x9724('0x47')](0xa,_0x1aa113-0x1);_0x5a53f1=Math[_0x9724('0x47')](0xa,_0x1aa113)-0x1;return util[_0x9724('0x43')]('%s',_['replace'](_0x5153e8,_0x1d2c19,_[_0x9724('0x48')](_0x3593e5,_0x5a53f1)[_0x9724('0x49')]()));}exports[_0x9724('0x4a')]=getCallerIdRandom;function decrementOriginate(_0x268454){if(_0x268454[_0x9724('0x26')]&&_0x268454[_0x9724('0x26')]>0x0){_0x268454[_0x9724('0x26')]-=0x1;}else{logger['error'](_0x9724('0x4b'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x35f79d){return _0x35f79d&&_0x35f79d['length']>0x0;}exports[_0x9724('0x4c')]=checkContactEmpty;function erlangb(_0x37f24a,_0x5a6099){if(_0x5a6099===0x0){return 0x0;}var _0x4cf7d9=0x1;for(var _0x12fd84=0x1;_0x12fd84<=_0x5a6099;_0x12fd84+=0x1){_0x4cf7d9=0x1+_0x4cf7d9*_0x12fd84/_0x37f24a;}return 0x1/_0x4cf7d9;}exports[_0x9724('0x4d')]=erlangb;function checkContactLowerLimitOriginate(_0x31f4c8,_0x2e8993,_0x58685e){if(_0x2e8993>_0x58685e){for(var _0x53bfd2=0x0;_0x53bfd2<_0x2e8993-_0x58685e;_0x53bfd2+=0x1){decrementOriginate(_0x31f4c8);}}}exports[_0x9724('0x4e')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x56c792){var _0x4e1189={};var _0x2df824=['id','createdAt','tags',_0x9724('0x4f')];const _0x53daeb=0xfa;if(_0x56c792){for(var _0x190af6 in _0x56c792){if(typeof _0x56c792[_0x190af6]!==_0x9724('0x50')){if(!_[_0x9724('0x2d')](_0x56c792[_0x190af6])&&!_0x2df824['includes'](_0x190af6)){if(_0x190af6===_0x9724('0x51')&&_0x56c792[_0x190af6][_0x9724('0x52')]>_0x53daeb){_0x4e1189['XMD-'+_0x190af6[_0x9724('0x53')]()]=_0x56c792[_0x190af6][_0x9724('0x49')]()['substring'](0x0,_0x53daeb);}else{_0x4e1189[_0x9724('0x54')+_0x190af6[_0x9724('0x53')]()]=_0x56c792[_0x190af6];}}}}}return _0x4e1189;}exports[_0x9724('0x55')]=setXMDContactVariables; \ No newline at end of file +var _0x893b=['milliseconds','diff','seconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','Interval','isEmpty','dialGlobalInterval','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','unmonitored','includes','status','TrunkBackup','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value','decrementOriginate','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','undefined','length','XMD-','toUpperCase','setXMDContactVariables','lodash','moment','util','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','DEACTIVATED','INTERVAL_IS_EMPTY','NOT_ACTIVE','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x893b,0x190));var _0xb893=function(_0x30fd6d,_0x3e9d38){_0x30fd6d=_0x30fd6d-0x0;var _0x30e51d=_0x893b[_0x30fd6d];return _0x30e51d;};'use strict';var _=require(_0xb893('0x0'));var moment=require(_0xb893('0x1'));var util=require(_0xb893('0x2'));var logger=require('../../../../config/logger')(_0xb893('0x3'));var timezones=require(_0xb893('0x4'))[_0xb893('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0xb893('0x6'),'BLACKLIST':_0xb893('0x7'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0xb893('0x8'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':_0xb893('0x9'),'INACTIVE':_0xb893('0xa'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':_0xb893('0xb'),'OVERTIME_INTERVAL':_0xb893('0xc'),'OVERTIME_GLOBAL_INTERVAL':_0xb893('0xd'),'QUEUE_RECALL':_0xb893('0xe'),'RECALL_TIMEOUT':_0xb893('0xf'),'RUNNING':_0xb893('0x10'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0xb893('0x11')};exports[_0xb893('0x12')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x1ce2a4){return _0x1ce2a4[_0xb893('0x13')]===_0xb893('0x14');}exports[_0xb893('0x15')]=isPreviewCampaign;function isIVRCampaign(_0x4976ef){return _0x4976ef[_0xb893('0x16')]===_0xb893('0x17');}exports[_0xb893('0x18')]=isIVRCampaign;function isOutboundQueue(_0x146975){return _0x146975[_0xb893('0x16')]===_0xb893('0x19');}exports[_0xb893('0x1a')]=isOutboundQueue;function isQueueCampaignActive(_0x5ae199){return _0x5ae199[_0xb893('0x1b')];}exports[_0xb893('0x1c')]=isQueueCampaignActive;function isIVRCampaignActive(_0x4875cb){return _0x4875cb[_0xb893('0x1d')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x5ed8c1,_0x615d17){var _0x530188=moment(_0x5ed8c1)[_0xb893('0x1e')](0x0);var _0x471e9a=moment(_0x615d17)[_0xb893('0x1e')](0x0);return _0x530188[_0xb893('0x1f')](_0x471e9a,_0xb893('0x20'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x184ebc,_0x324deb){var _0x1a0be3=![];var _0x2cb14e=_0x184ebc[_0xb893('0x13')]!==_0x324deb['dialMethod']||_0x184ebc['dialActive']!==_0x324deb[_0xb893('0x1b')]||_0x184ebc[_0xb893('0x21')]!==_0x324deb[_0xb893('0x21')];var _0x597204=_0x184ebc[_0xb893('0x22')]!==_0x324deb[_0xb893('0x22')]||_0x184ebc[_0xb893('0x23')]!==_0x324deb[_0xb893('0x23')]||_0x184ebc[_0xb893('0x24')]!==_0x324deb[_0xb893('0x24')]||_0x184ebc[_0xb893('0x25')]!==_0x324deb['paused']||_0x184ebc[_0xb893('0x26')]!==_0x324deb['talking']||_0x184ebc['pTalking']!==_0x324deb[_0xb893('0x27')]||_0x184ebc[_0xb893('0x28')]!==_0x324deb['waiting']||_0x184ebc[_0xb893('0x29')]!==_0x324deb['inUse']||_0x184ebc[_0xb893('0x2a')]!==_0x324deb[_0xb893('0x2a')];if(_0x184ebc[_0xb893('0x2b')]&&_0x324deb[_0xb893('0x2b')]){_0x1a0be3=_0x184ebc[_0xb893('0x2b')][_0xb893('0x2c')]!==_0x324deb[_0xb893('0x2b')][_0xb893('0x2c')]||_0x184ebc['Trunk'][_0xb893('0x1d')]!==_0x324deb[_0xb893('0x2b')][_0xb893('0x1d')];}return _0x2cb14e||_0x597204||_0x1a0be3;}exports[_0xb893('0x2d')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x5a0a9a){var _0x22078d=null;var _0x1d8a11=_0x5a0a9a[_0xb893('0x2e')];if(_[_0xb893('0x2f')](_0x5a0a9a['dialGlobalInterval'])||_[_0xb893('0x2f')](_0x5a0a9a[_0xb893('0x30')])||_[_0xb893('0x2f')](_0x5a0a9a[_0xb893('0x30')]['Intervals'])){_0x22078d=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0xb893('0x31')](_0x5a0a9a[_0xb893('0x32')])||_['isEmpty'](_0x5a0a9a['Interval']['Intervals'])){_0x22078d=CAMPAIGN_STATUS[_0xb893('0x33')];}else if(_0x1d8a11&&!timezones[_0x1d8a11]){_0x22078d=CAMPAIGN_STATUS[_0xb893('0x34')];}return _0x22078d;}function checkAnyValidTrunk(_0x497d8b,_0x47f8b2){var _0x23199f=null;var _0x4dd818=_0xb893('0x35');var _0x153440=['reachable',_0xb893('0x36')];var _0x1bb9eb=!![];if(_0x497d8b[_0xb893('0x2b')]&&_0x497d8b[_0xb893('0x2b')][_0xb893('0x1d')]){_0x4dd818+=_0x497d8b['Trunk'][_0xb893('0x2c')];_0x23199f=_0x47f8b2[_0x4dd818];_0x1bb9eb=_0x153440[_0xb893('0x37')](_0x23199f[_0xb893('0x38')]);}else if(_0x497d8b[_0xb893('0x39')]&&_0x497d8b['TrunkBackup'][_0xb893('0x1d')]){_0x4dd818+=_0x497d8b[_0xb893('0x39')][_0xb893('0x2c')];_0x23199f=_0x47f8b2[_0x4dd818];_0x1bb9eb=_0x153440[_0xb893('0x37')](_0x23199f['status']);}return _0x1bb9eb;}function getQueueCampaignStatusMessage(_0x3663ad,_0x2a33d3){var _0x410ae6=CAMPAIGN_STATUS['ACTIVE'];var _0x12ffaa=isPreviewCampaign(_0x3663ad);if(!isQueueCampaignActive(_0x3663ad)){if(_0x12ffaa){_0x410ae6=CAMPAIGN_STATUS[_0xb893('0x3a')];}else{if(_0x3663ad[_0xb893('0x2a')]===0x0&&_0x3663ad[_0xb893('0x26')]===0x0&&_0x3663ad[_0xb893('0x28')]===0x0&&(_0x3663ad[_0xb893('0x27')]||0x0)===0x0){_0x410ae6=CAMPAIGN_STATUS['INACTIVE'];}else{_0x410ae6=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x3663ad['loggedIn']===0x0){_0x410ae6=CAMPAIGN_STATUS[_0xb893('0x3b')];}else if(!checkAnyValidTrunk(_0x3663ad,_0x2a33d3)){_0x410ae6=CAMPAIGN_STATUS[_0xb893('0x3c')];}else if(!isPreviewCampaign(_0x3663ad)){var _0x2bd72d=checkAnyValidQueueCampaignInterval(_0x3663ad);if(_0x2bd72d){_0x410ae6=_0x2bd72d;}}return _0x410ae6;}exports[_0xb893('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x54d713){var _0x2a94c7=CAMPAIGN_STATUS['DISACTIVED'];if(_0x54d713['originated']===0x0&&_0x54d713[_0xb893('0x26')]===0x0&&_0x54d713[_0xb893('0x28')]===0x0&&(_0x54d713[_0xb893('0x27')]||0x0)===0x0){_0x2a94c7=CAMPAIGN_STATUS[_0xb893('0x3a')];}return _0x2a94c7;}exports[_0xb893('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x5f4aa4){var _0x223395=_0x5f4aa4[_0xb893('0x3f')](/"(.*?)"/);return _0x223395?_0x223395[0x1]:_0x5f4aa4;}exports[_0xb893('0x40')]=extractCalleridName;function getCallerId(_0x431681,_0x4eea98,_0x280c37){if(!_[_0xb893('0x41')](_0x280c37)&&typeof _0x280c37===_0xb893('0x42')&&!_[_0xb893('0x31')](_0x280c37)){if(!_[_0xb893('0x41')](_0x4eea98)&&typeof _0x4eea98===_0xb893('0x42')&&!_[_0xb893('0x31')](_0x4eea98)){return util[_0xb893('0x43')](_0xb893('0x44'),_0x4eea98,_0x280c37);}return util[_0xb893('0x43')](_0xb893('0x44'),_0x280c37,_0x280c37);}if(!_[_0xb893('0x41')](_0x431681)&&typeof _0x431681===_0xb893('0x42')&&!_[_0xb893('0x31')](_0x431681)){return _0x431681;}return'\x22\x22\x20<>';}exports[_0xb893('0x45')]=getCallerId;function getCallerIdRandom(_0x9a9add,_0x1a0537){var _0x57c64a;var _0x49c998;var _0x429862;if(_0x1a0537<=0x0){_0x1a0537=0x1;}_0x57c64a=new RegExp('\x5cw{0,'+_0x1a0537+'}$');_0x49c998=Math['pow'](0xa,_0x1a0537-0x1);_0x429862=Math[_0xb893('0x46')](0xa,_0x1a0537)-0x1;return util['format']('%s',_[_0xb893('0x47')](_0x9a9add,_0x57c64a,_[_0xb893('0x48')](_0x49c998,_0x429862)[_0xb893('0x49')]()));}exports[_0xb893('0x4a')]=getCallerIdRandom;function decrementOriginate(_0x36b273,_0x3ebd37){if(_0x36b273[_0xb893('0x2a')]&&_0x36b273[_0xb893('0x2a')]>0x0){_0x36b273[_0xb893('0x2a')]-=0x1;}else{logger[_0xb893('0x4b')](_0xb893('0x4c'),_0x3ebd37);}}exports[_0xb893('0x4d')]=decrementOriginate;function checkContactEmpty(_0x44e0fa){return _0x44e0fa&&_0x44e0fa['length']>0x0;}exports[_0xb893('0x4e')]=checkContactEmpty;function erlangb(_0x32383e,_0x2ccca5){if(_0x2ccca5===0x0){return 0x0;}var _0x6d3d38=0x1;for(var _0x323d85=0x1;_0x323d85<=_0x2ccca5;_0x323d85+=0x1){_0x6d3d38=0x1+_0x6d3d38*_0x323d85/_0x32383e;}return 0x1/_0x6d3d38;}exports[_0xb893('0x4f')]=erlangb;function checkContactLowerLimitOriginate(_0x467c23,_0x54bd41,_0x3fb3b7){if(_0x54bd41>_0x3fb3b7){for(var _0x3eab5c=0x0;_0x3eab5c<_0x54bd41-_0x3fb3b7;_0x3eab5c+=0x1){decrementOriginate(_0x467c23,'[checkContactLowerLimitOriginate]\x20');}}}exports[_0xb893('0x50')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0xb15da6){var _0x1c402f={};var _0x80704d=['id','createdAt','tags','updatedAt'];const _0x5d80c1=0xfa;if(_0xb15da6){for(var _0x1a0b39 in _0xb15da6){if(typeof _0xb15da6[_0x1a0b39]!==_0xb893('0x51')){if(!_[_0xb893('0x2f')](_0xb15da6[_0x1a0b39])&&!_0x80704d['includes'](_0x1a0b39)){if(_0x1a0b39==='description'&&_0xb15da6[_0x1a0b39][_0xb893('0x52')]>_0x5d80c1){_0x1c402f[_0xb893('0x53')+_0x1a0b39[_0xb893('0x54')]()]=_0xb15da6[_0x1a0b39][_0xb893('0x49')]()['substring'](0x0,_0x5d80c1);}else{_0x1c402f[_0xb893('0x53')+_0x1a0b39[_0xb893('0x54')]()]=_0xb15da6[_0x1a0b39];}}}}}return _0x1c402f;}exports[_0xb893('0x55')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index bbb8cef..91e8d0f 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(_0x5600fd,_0x1283cb){var _0x133ac1=function(_0x3c00d4){while(--_0x3c00d4){_0x5600fd['push'](_0x5600fd['shift']());}};_0x133ac1(++_0x1283cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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(_0x1359c3,_0x55326c){var _0x2a1cbe=function(_0x37735f){while(--_0x37735f){_0x1359c3['push'](_0x1359c3['shift']());}};_0x2a1cbe(++_0x55326c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 094aee8..13593ca 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 _0xc3a1=['notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','FaxAccountId','Trunk','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','lodash','bluebird','path','tiff2pdf','./util/gs','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','prototype','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then'];(function(_0x419dc3,_0x5a4528){var _0x5e0573=function(_0x7c6186){while(--_0x7c6186){_0x419dc3['push'](_0x419dc3['shift']());}};_0x5e0573(++_0x5a4528);}(_0xc3a1,0x11d));var _0x1c3a=function(_0x1423ff,_0x4b06e0){_0x1423ff=_0x1423ff-0x0;var _0x5b3f79=_0xc3a1[_0x1423ff];return _0x5b3f79;};'use strict';var util=require('util');var _=require(_0x1c3a('0x0'));var BPromise=require(_0x1c3a('0x1'));var uuid=require('uuid');var moment=require('moment');var path=require(_0x1c3a('0x2'));var tiff2pdf=require(_0x1c3a('0x3'));var gs=require(_0x1c3a('0x4'));var logger=require('../../../config/logger')(_0x1c3a('0x5'));var ami=require('../ami');var rpcDb=require(_0x1c3a('0x6'));var Channel=require(_0x1c3a('0x7'));var ut=require(_0x1c3a('0x8'));var Action=require(_0x1c3a('0x9'));var faxAccount=require(_0x1c3a('0xa'));var attachment=require(_0x1c3a('0xb'));var faxMessage=require(_0x1c3a('0xc'));function Fax(_0x368a5b){this[_0x1c3a('0xd')]={};this[_0x1c3a('0xe')]=_0x368a5b['faxAccounts'];this['trunks']=_0x368a5b[_0x1c3a('0xf')];this[_0x1c3a('0x10')]={};ami['on'](_0x1c3a('0x11'),this[_0x1c3a('0x12')][_0x1c3a('0x13')](this));ami['on']('varset',this[_0x1c3a('0x14')][_0x1c3a('0x13')](this));ami['on'](_0x1c3a('0x15'),this[_0x1c3a('0x16')][_0x1c3a('0x13')](this));ami['on']('newexten',this[_0x1c3a('0x17')][_0x1c3a('0x13')](this));ami['on']('faxstatus',this[_0x1c3a('0x18')][_0x1c3a('0x13')](this));ami['on'](_0x1c3a('0x19'),this[_0x1c3a('0x1a')][_0x1c3a('0x13')](this));ami['on'](_0x1c3a('0x1b'),this[_0x1c3a('0x1c')][_0x1c3a('0x13')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x1c3a('0x13')](this));}Fax[_0x1c3a('0x1d')][_0x1c3a('0x12')]=function(_0x34ef1b){if(_0x34ef1b[_0x1c3a('0x1e')]===_0x1c3a('0x1f')){for(var _0x31d490 in this['faxAccounts']){if(this[_0x1c3a('0xe')][_0x1c3a('0x20')](_0x31d490)){if(_0x34ef1b[_0x1c3a('0x21')]===this[_0x1c3a('0xe')][_0x31d490]['localstationid']){this[_0x1c3a('0xd')][_0x34ef1b[_0x1c3a('0x22')]]={};this[_0x1c3a('0xd')][_0x34ef1b['uniqueid']][_0x1c3a('0x23')]=_0x34ef1b[_0x1c3a('0x23')];this[_0x1c3a('0xd')][_0x34ef1b[_0x1c3a('0x22')]]['id']=this[_0x1c3a('0xe')][_0x31d490]['id'];this[_0x1c3a('0xd')][_0x34ef1b['uniqueid']]['name']=this[_0x1c3a('0xe')][_0x31d490][_0x1c3a('0x24')];logger[_0x1c3a('0x25')](_0x34ef1b[_0x1c3a('0x22')],'\x20syncNewchannel\x20');}}}}if(this[_0x1c3a('0x10')][_0x34ef1b['uniqueid']]){this[_0x1c3a('0xd')][_0x34ef1b['uniqueid']]={};this['channels'][_0x34ef1b[_0x1c3a('0x22')]][_0x1c3a('0x23')]=_0x34ef1b[_0x1c3a('0x23')];logger[_0x1c3a('0x25')](_0x34ef1b[_0x1c3a('0x22')],_0x1c3a('0x26'));}};Fax[_0x1c3a('0x1d')][_0x1c3a('0x14')]=function(_0xecdcda){if(this[_0x1c3a('0xd')][_0xecdcda[_0x1c3a('0x22')]]){for(var _0x65c28e in _0xecdcda[_0x1c3a('0x27')]){if(_0xecdcda[_0x1c3a('0x27')][_0x1c3a('0x20')](_0x65c28e)){this['channels'][_0xecdcda[_0x1c3a('0x22')]][_0x65c28e]=_0xecdcda[_0x1c3a('0x28')];}}}};Fax[_0x1c3a('0x1d')]['syncNewState']=function(_0x5601e3){if(this[_0x1c3a('0xd')][_0x5601e3[_0x1c3a('0x22')]]){this[_0x1c3a('0xd')][_0x5601e3['uniqueid']][_0x1c3a('0x29')]=_0x5601e3[_0x1c3a('0x29')];this[_0x1c3a('0xd')][_0x5601e3[_0x1c3a('0x22')]]['channelstatedesc']=_0x5601e3[_0x1c3a('0x2a')];}};Fax[_0x1c3a('0x1d')][_0x1c3a('0x17')]=function(_0x526799){if(this[_0x1c3a('0xd')][_0x526799[_0x1c3a('0x22')]]){for(var _0x40932d in _0x526799[_0x1c3a('0x27')]){if(_0x526799['variable'][_0x1c3a('0x20')](_0x40932d)){this[_0x1c3a('0xd')][_0x526799['uniqueid']][_0x40932d]=_0x526799[_0x1c3a('0x28')];}}}};Fax[_0x1c3a('0x1d')][_0x1c3a('0x18')]=function(_0x6b7922){if(this[_0x1c3a('0xd')][_0x6b7922[_0x1c3a('0x22')]]){this[_0x1c3a('0xd')][_0x6b7922[_0x1c3a('0x22')]][_0x1c3a('0x2b')]=_0x6b7922[_0x1c3a('0x2b')];this['channels'][_0x6b7922['uniqueid']][_0x1c3a('0x2c')]=_0x6b7922[_0x1c3a('0x2c')];this[_0x1c3a('0xd')][_0x6b7922[_0x1c3a('0x22')]][_0x1c3a('0x2d')]=_0x6b7922[_0x1c3a('0x2d')];this[_0x1c3a('0xd')][_0x6b7922[_0x1c3a('0x22')]][_0x1c3a('0x2e')]=_0x6b7922[_0x1c3a('0x2e')];logger['info'](_0x6b7922[_0x1c3a('0x22')],_0x1c3a('0x2f'));}};Fax['prototype']['syncReceiveFax']=function(_0xb376ea){var _0x8f959=this;if(this[_0x1c3a('0xd')][_0xb376ea['uniqueid']]){var _0x41ef23=this[_0x1c3a('0xd')][_0xb376ea[_0x1c3a('0x22')]]['id'];this[_0x1c3a('0xd')][_0xb376ea['uniqueid']][_0x1c3a('0x30')]=_0xb376ea[_0x1c3a('0x30')];this['channels'][_0xb376ea[_0x1c3a('0x22')]][_0x1c3a('0x31')]=_0xb376ea[_0x1c3a('0x31')];this[_0x1c3a('0xd')][_0xb376ea['uniqueid']][_0x1c3a('0x2d')]=_0xb376ea['localstationid'];this[_0x1c3a('0xd')][_0xb376ea[_0x1c3a('0x22')]][_0x1c3a('0x32')]=_0xb376ea[_0x1c3a('0x32')];this[_0x1c3a('0xd')][_0xb376ea[_0x1c3a('0x22')]][_0x1c3a('0x33')]=_0xb376ea[_0x1c3a('0x33')];this['channels'][_0xb376ea[_0x1c3a('0x22')]]['filename']=_0xb376ea[_0x1c3a('0x2e')];this[_0x1c3a('0xd')][_0xb376ea[_0x1c3a('0x22')]]['calleridnum']=_0xb376ea[_0x1c3a('0x34')];if(this['channels'][_0xb376ea[_0x1c3a('0x22')]][_0x1c3a('0x31')]>0x0){tiff2pdf(_0xb376ea[_0x1c3a('0x2e')],_0x1c3a('0x35'),function(_0x1f0ce4){logger[_0x1c3a('0x25')](_0xb376ea['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x1f0ce4[_0x1c3a('0x36')]);attachment[_0x1c3a('0x37')]({'name':path[_0x1c3a('0x38')](_0xb376ea[_0x1c3a('0x2e')])['name'],'basename':path['parse'](_0xb376ea[_0x1c3a('0x2e')])[_0x1c3a('0x24')]+_0x1c3a('0x39'),'type':_0x1c3a('0x3a')})[_0x1c3a('0x3b')](function(_0x36fdb4){faxAccount[_0x1c3a('0x3c')](_0x41ef23,{'from':_0xb376ea[_0x1c3a('0x34')],'mapKey':'fax','body':path[_0x1c3a('0x38')](_0xb376ea[_0x1c3a('0x2e')])[_0x1c3a('0x24')]+_0x1c3a('0x39'),'AttachmentId':_0x36fdb4['id']})[_0x1c3a('0x3d')](function(_0x31e6ee){logger[_0x1c3a('0x3e')](_0xb376ea['uniqueid'],_0x1c3a('0x3f'),JSON[_0x1c3a('0x40')](_0x31e6ee));});})['catch'](function(_0x2dd825){logger['error'](_0xb376ea[_0x1c3a('0x22')],'\x20receiveFax\x20',JSON['stringify'](_0x2dd825));});});}logger[_0x1c3a('0x25')](_0xb376ea[_0x1c3a('0x22')],_0x1c3a('0x41'));}};Fax['prototype'][_0x1c3a('0x42')]=function(_0x2f7ba2){if(this[_0x1c3a('0x10')][_0x2f7ba2[_0x1c3a('0x22')]]){_[_0x1c3a('0x43')](this[_0x1c3a('0xd')][_0x2f7ba2[_0x1c3a('0x22')]],_[_0x1c3a('0x44')](_0x2f7ba2,[_0x1c3a('0x45'),'reason']));}};function updateStatus(_0x8b6e1a){if(_0x8b6e1a[_0x1c3a('0x46')]){faxMessage[_0x1c3a('0x47')](_0x8b6e1a['AttachmentId'],{'failMessage':_0x1c3a('0x48')})[_0x1c3a('0x3b')](function(_0x343452){ut[_0x1c3a('0x49')]('[Fax][Message][Error][Updated]',_0x343452);})['catch'](function(_0x296b0c){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x296b0c);});}else{ut[_0x1c3a('0x49')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype']['updateStatus']=function(_0x444bf7,_0x8bb2e2,_0x59d818){var _0x4bf244=this;var _0x4cd64c={};if(_0x8bb2e2){_0x4cd64c={'read':_0x8bb2e2};}else{_0x4cd64c={'failMessage':_0x59d818};}if(this['actions'][_0x444bf7][_0x1c3a('0x46')]){faxMessage[_0x1c3a('0x47')](this['actions'][_0x444bf7][_0x1c3a('0x46')],_0x4cd64c)[_0x1c3a('0x3b')](function(_0x58f80a){ut[_0x1c3a('0x49')]('[Fax][Message][Updated]',_0x58f80a);})['catch'](function(_0x411b49){ut['logger'](_0x1c3a('0x4a'),_0x411b49);})[_0x1c3a('0x4b')](function(){delete _0x4bf244[_0x1c3a('0xd')][_0x444bf7];delete _0x4bf244[_0x1c3a('0x10')][_0x444bf7];});}else{ut['logger'](_0x1c3a('0x4c'));delete this['channels'][_0x444bf7];delete this['actions'][_0x444bf7];}};Fax[_0x1c3a('0x1d')]['syncHangup']=function(_0x2fa38d){var _0x4224c8=this;if(this['channels'][_0x2fa38d[_0x1c3a('0x22')]]){if(this[_0x1c3a('0x10')][_0x2fa38d[_0x1c3a('0x22')]]){this[_0x1c3a('0xd')][_0x2fa38d[_0x1c3a('0x22')]]['id']=this[_0x1c3a('0x10')][_0x2fa38d[_0x1c3a('0x22')]]['id'];this[_0x1c3a('0xd')][_0x2fa38d[_0x1c3a('0x22')]][_0x1c3a('0x24')]=this[_0x1c3a('0x10')][_0x2fa38d['uniqueid']][_0x1c3a('0x24')];}logger[_0x1c3a('0x25')](_0x2fa38d[_0x1c3a('0x22')],this[_0x1c3a('0x10')][_0x2fa38d[_0x1c3a('0x22')]]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON[_0x1c3a('0x40')](this['channels'][_0x2fa38d[_0x1c3a('0x22')]]));if(this['actions'][_0x2fa38d[_0x1c3a('0x22')]]){if(this[_0x1c3a('0xd')][_0x2fa38d['uniqueid']][_0x1c3a('0x4d')]>0x0&&this[_0x1c3a('0xd')][_0x2fa38d[_0x1c3a('0x22')]]['faxstatus']===_0x1c3a('0x4e')){this['updateStatus'](_0x2fa38d[_0x1c3a('0x22')],!![]);}else{this[_0x1c3a('0x4f')](_0x2fa38d[_0x1c3a('0x22')],![],this[_0x1c3a('0xd')][_0x2fa38d[_0x1c3a('0x22')]][_0x1c3a('0x50')]?_0x1c3a('0x51')+this['channels'][_0x2fa38d[_0x1c3a('0x22')]]['faxstatusstring']:_0x1c3a('0x52'));}}}};Fax[_0x1c3a('0x1d')][_0x1c3a('0x53')]=function(_0x359513){var _0x343d80=this;return new BPromise(function(_0x1fd267,_0x3336af){_0x343d80[_0x1c3a('0x54')](_0x359513,_0x343d80['faxAccounts'][_0x359513['FaxAccountId']])[_0x1c3a('0x3b')](function(_0x1cbd5e){ut[_0x1c3a('0x49')](_0x1c3a('0x55'),_0x1cbd5e);_0x1fd267(ut[_0x1c3a('0x36')](_0x1c3a('0x56')));})[_0x1c3a('0x3d')](function(_0x466cf5){ut[_0x1c3a('0x49')](_0x1c3a('0x57'),_0x466cf5);updateStatus(_0x359513);_0x3336af(ut[_0x1c3a('0x36')](_0x1c3a('0x58')));});});};Fax[_0x1c3a('0x1d')]['checkAfterSend']=function(_0x4b93a9){var _0x5cf4b2=this;return new BPromise(function(_0x371897,_0x1a7d57){var _0x5a84a4=_0x5cf4b2[_0x1c3a('0x59')](_0x5cf4b2['faxAccounts'][_0x4b93a9[_0x1c3a('0x5a')]][_0x1c3a('0x5b')],_0x4b93a9);if(_0x5a84a4['isValid']){_0x371897(ut['message']('Trunk\x20Reachable'));}else{_0x1a7d57(ut[_0x1c3a('0x36')](_0x5a84a4[_0x1c3a('0x36')]));}});};function originate(_0xacc43d,_0x109021,_0x21c4ef){return new BPromise(function(_0x29b9f3,_0x47faa9){if(_0x21c4ef){var _0x23ceef=util[_0x1c3a('0x5c')](_0x1c3a('0x5d'),path[_0x1c3a('0x38')](_0xacc43d[_0x1c3a('0x2')])[_0x1c3a('0x24')],_0xacc43d['path']);gs[_0x1c3a('0x5e')](_0x23ceef)['then'](function(){_0xacc43d[_0x1c3a('0x2')]=util[_0x1c3a('0x5c')](_0x1c3a('0x5f'),path[_0x1c3a('0x38')](_0xacc43d[_0x1c3a('0x2')])[_0x1c3a('0x60')],path['parse'](_0xacc43d[_0x1c3a('0x2')])[_0x1c3a('0x24')]);_0x109021[_0x1c3a('0x61')]=_0xacc43d[_0x1c3a('0x2')];ut[_0x1c3a('0x49')](_0x1c3a('0x62'),'');ami[_0x1c3a('0x63')](ut['variablesAction'](_0xacc43d,_0x109021))[_0x1c3a('0x3b')](function(_0x1aae5f){_0x29b9f3(_0x1aae5f);})['catch'](function(_0x2452d2){_0x47faa9(_0x2452d2);});})['catch'](function(_0x59ff43){_0x47faa9(_0x59ff43);});}else{ami[_0x1c3a('0x63')](ut['variablesAction'](_0xacc43d,_0x109021))[_0x1c3a('0x3b')](function(_0x553987){_0x29b9f3(_0x553987);})[_0x1c3a('0x3d')](function(_0x402a31){_0x47faa9(_0x402a31);});}});}Fax[_0x1c3a('0x1d')][_0x1c3a('0x54')]=function(_0x300f9a,_0x363689){var _0x520f52=this;return new BPromise(function(_0x3f37eb,_0x4692b1){var _0x3bc01c=uuid['v4']();var _0x288450=ut[_0x1c3a('0x64')](_0x300f9a,_0x363689);_0x520f52[_0x1c3a('0x10')][_0x3bc01c]=new Action(_0x3bc01c,_0x363689,_0x300f9a);var _0xfe2214=_0x520f52['actions'][_0x3bc01c];if(path[_0x1c3a('0x38')](_0x300f9a[_0x1c3a('0x2')])[_0x1c3a('0x65')]===_0x1c3a('0x39')){originate(_0xfe2214,_0x288450,!![])[_0x1c3a('0x3b')](function(_0x2e7639){_0x3f37eb(_0x2e7639);})['catch'](function(_0x9286af){_0x4692b1(_0x9286af);});}else{originate(_0xfe2214,_0x288450,![])[_0x1c3a('0x3b')](function(_0x39cd8a){_0x3f37eb(_0x39cd8a);})[_0x1c3a('0x3d')](function(_0x45b998){_0x4692b1(_0x45b998);});}});};Fax[_0x1c3a('0x1d')][_0x1c3a('0x66')]=function(_0x1c2d60){return!_[_0x1c3a('0x67')](_0x1c2d60)&&!_['isNil'](_0x1c2d60[_0x1c3a('0x24')])&&!_['isNil'](_0x1c2d60[_0x1c3a('0x68')])&&_0x1c2d60[_0x1c3a('0x68')]&&!_['isNil'](this[_0x1c3a('0xf')][util[_0x1c3a('0x5c')](_0x1c3a('0x69'),_0x1c2d60[_0x1c3a('0x24')])])&&!_['isNil'](this[_0x1c3a('0xf')][util[_0x1c3a('0x5c')](_0x1c3a('0x69'),_0x1c2d60[_0x1c3a('0x24')])][_0x1c3a('0x2c')])&&(this[_0x1c3a('0xf')][util['format']('SIP/%s',_0x1c2d60[_0x1c3a('0x24')])][_0x1c3a('0x2c')]===_0x1c3a('0x6a')||this[_0x1c3a('0xf')][util[_0x1c3a('0x5c')](_0x1c3a('0x69'),_0x1c2d60[_0x1c3a('0x24')])][_0x1c3a('0x2c')]===_0x1c3a('0x6b'));};Fax['prototype'][_0x1c3a('0x59')]=function(_0x1969dc,_0x5794bb){if(!this['isTrunkReachable'](_0x1969dc)){ut[_0x1c3a('0x49')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x1c3a('0x67')](_0x1969dc)?'':_0x1969dc['name']+_0x1c3a('0x6c'));return{'isValid':![],'message':_0x1c3a('0x6d')};}if(_[_0x1c3a('0x67')](_0x5794bb[_0x1c3a('0x5')])){ut[_0x1c3a('0x49')](_0x1c3a('0x6e'),JSON['stringify'](_0x5794bb));return{'isValid':![],'message':_0x1c3a('0x6f')};}if(_[_0x1c3a('0x67')](_0x5794bb[_0x1c3a('0x2')])){ut['logger'](_0x1c3a('0x70'),JSON['stringify'](_0x5794bb));return{'isValid':![],'message':_0x1c3a('0x71')};}return{'isValid':!![],'message':_0x1c3a('0x72')};};module['exports']=Fax; \ No newline at end of file +var _0x92ed=['Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','newstate','syncNewState','newexten','syncNewExten','bind','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','channel','uniqueid','name','\x20syncNewchannel\x20','info','channelstate','channelstatedesc','variable','value','operation','status','filename','\x20syncFaxStatus\x20','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','fax','catch','error','\x20receiveFax\x20','stringify','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path'];(function(_0x4532cd,_0x3c59b6){var _0x4f761=function(_0x3359f0){while(--_0x3359f0){_0x4532cd['push'](_0x4532cd['shift']());}};_0x4f761(++_0x3c59b6);}(_0x92ed,0xf2));var _0xd92e=function(_0xb479b4,_0x11eb3b){_0xb479b4=_0xb479b4-0x0;var _0x170c1d=_0x92ed[_0xb479b4];return _0x170c1d;};'use strict';var util=require(_0xd92e('0x0'));var _=require(_0xd92e('0x1'));var BPromise=require(_0xd92e('0x2'));var uuid=require(_0xd92e('0x3'));var moment=require(_0xd92e('0x4'));var path=require(_0xd92e('0x5'));var tiff2pdf=require(_0xd92e('0x6'));var gs=require(_0xd92e('0x7'));var logger=require('../../../config/logger')('fax');var ami=require(_0xd92e('0x8'));var rpcDb=require(_0xd92e('0x9'));var Channel=require('./channel');var ut=require(_0xd92e('0xa'));var Action=require(_0xd92e('0xb'));var faxAccount=require(_0xd92e('0xc'));var attachment=require('../rpc/attachment');var faxMessage=require(_0xd92e('0xd'));function Fax(_0x57e195){this[_0xd92e('0xe')]={};this[_0xd92e('0xf')]=_0x57e195[_0xd92e('0xf')];this[_0xd92e('0x10')]=_0x57e195[_0xd92e('0x10')];this[_0xd92e('0x11')]={};ami['on'](_0xd92e('0x12'),this[_0xd92e('0x13')]['bind'](this));ami['on'](_0xd92e('0x14'),this['syncVarSet']['bind'](this));ami['on'](_0xd92e('0x15'),this[_0xd92e('0x16')]['bind'](this));ami['on'](_0xd92e('0x17'),this[_0xd92e('0x18')][_0xd92e('0x19')](this));ami['on']('faxstatus',this[_0xd92e('0x1a')][_0xd92e('0x19')](this));ami['on'](_0xd92e('0x1b'),this[_0xd92e('0x1c')][_0xd92e('0x19')](this));ami['on'](_0xd92e('0x1d'),this['syncHangup'][_0xd92e('0x19')](this));ami['on'](_0xd92e('0x1e'),this[_0xd92e('0x1f')][_0xd92e('0x19')](this));}Fax[_0xd92e('0x20')][_0xd92e('0x13')]=function(_0x55c42e){if(_0x55c42e[_0xd92e('0x21')]===_0xd92e('0x22')){for(var _0x2e8371 in this['faxAccounts']){if(this[_0xd92e('0xf')][_0xd92e('0x23')](_0x2e8371)){if(_0x55c42e[_0xd92e('0x24')]===this['faxAccounts'][_0x2e8371][_0xd92e('0x25')]){this[_0xd92e('0xe')][_0x55c42e['uniqueid']]={};this['channels'][_0x55c42e['uniqueid']][_0xd92e('0x26')]=_0x55c42e[_0xd92e('0x26')];this[_0xd92e('0xe')][_0x55c42e[_0xd92e('0x27')]]['id']=this[_0xd92e('0xf')][_0x2e8371]['id'];this['channels'][_0x55c42e[_0xd92e('0x27')]][_0xd92e('0x28')]=this['faxAccounts'][_0x2e8371][_0xd92e('0x28')];logger['info'](_0x55c42e['uniqueid'],_0xd92e('0x29'));}}}}if(this['actions'][_0x55c42e['uniqueid']]){this[_0xd92e('0xe')][_0x55c42e[_0xd92e('0x27')]]={};this['channels'][_0x55c42e[_0xd92e('0x27')]]['channel']=_0x55c42e[_0xd92e('0x26')];logger[_0xd92e('0x2a')](_0x55c42e[_0xd92e('0x27')],_0xd92e('0x29'));}};Fax['prototype']['syncVarSet']=function(_0x468098){if(this[_0xd92e('0xe')][_0x468098[_0xd92e('0x27')]]){for(var _0x4cbdfa in _0x468098['variable']){if(_0x468098['variable'][_0xd92e('0x23')](_0x4cbdfa)){this['channels'][_0x468098[_0xd92e('0x27')]][_0x4cbdfa]=_0x468098['value'];}}}};Fax[_0xd92e('0x20')][_0xd92e('0x16')]=function(_0x55880e){if(this[_0xd92e('0xe')][_0x55880e[_0xd92e('0x27')]]){this[_0xd92e('0xe')][_0x55880e[_0xd92e('0x27')]][_0xd92e('0x2b')]=_0x55880e[_0xd92e('0x2b')];this[_0xd92e('0xe')][_0x55880e['uniqueid']][_0xd92e('0x2c')]=_0x55880e[_0xd92e('0x2c')];}};Fax['prototype'][_0xd92e('0x18')]=function(_0xdb1de3){if(this[_0xd92e('0xe')][_0xdb1de3[_0xd92e('0x27')]]){for(var _0x5e8389 in _0xdb1de3[_0xd92e('0x2d')]){if(_0xdb1de3['variable']['hasOwnProperty'](_0x5e8389)){this[_0xd92e('0xe')][_0xdb1de3[_0xd92e('0x27')]][_0x5e8389]=_0xdb1de3[_0xd92e('0x2e')];}}}};Fax[_0xd92e('0x20')]['syncFaxStatus']=function(_0x2d084b){if(this[_0xd92e('0xe')][_0x2d084b[_0xd92e('0x27')]]){this['channels'][_0x2d084b['uniqueid']][_0xd92e('0x2f')]=_0x2d084b[_0xd92e('0x2f')];this[_0xd92e('0xe')][_0x2d084b[_0xd92e('0x27')]]['status']=_0x2d084b[_0xd92e('0x30')];this[_0xd92e('0xe')][_0x2d084b['uniqueid']]['localstationid']=_0x2d084b[_0xd92e('0x25')];this[_0xd92e('0xe')][_0x2d084b['uniqueid']][_0xd92e('0x31')]=_0x2d084b[_0xd92e('0x31')];logger['info'](_0x2d084b[_0xd92e('0x27')],_0xd92e('0x32'));}};Fax[_0xd92e('0x20')][_0xd92e('0x1c')]=function(_0x332822){var _0x5d3389=this;if(this[_0xd92e('0xe')][_0x332822[_0xd92e('0x27')]]){var _0x989d9d=this[_0xd92e('0xe')][_0x332822[_0xd92e('0x27')]]['id'];this[_0xd92e('0xe')][_0x332822[_0xd92e('0x27')]]['remotestationid']=_0x332822['remotestationid'];this[_0xd92e('0xe')][_0x332822[_0xd92e('0x27')]][_0xd92e('0x33')]=_0x332822[_0xd92e('0x33')];this[_0xd92e('0xe')][_0x332822['uniqueid']][_0xd92e('0x25')]=_0x332822['localstationid'];this[_0xd92e('0xe')][_0x332822['uniqueid']]['resolution']=_0x332822[_0xd92e('0x34')];this['channels'][_0x332822['uniqueid']][_0xd92e('0x35')]=_0x332822[_0xd92e('0x35')];this['channels'][_0x332822[_0xd92e('0x27')]]['filename']=_0x332822[_0xd92e('0x31')];this[_0xd92e('0xe')][_0x332822[_0xd92e('0x27')]][_0xd92e('0x36')]=_0x332822['calleridnum'];if(this['channels'][_0x332822[_0xd92e('0x27')]][_0xd92e('0x33')]>0x0){tiff2pdf(_0x332822[_0xd92e('0x31')],_0xd92e('0x37'),function(_0x534923){logger[_0xd92e('0x2a')](_0x332822[_0xd92e('0x27')],_0xd92e('0x38'),_0x534923[_0xd92e('0x39')]);attachment[_0xd92e('0x3a')]({'name':path[_0xd92e('0x3b')](_0x332822['filename'])[_0xd92e('0x28')],'basename':path[_0xd92e('0x3b')](_0x332822['filename'])[_0xd92e('0x28')]+_0xd92e('0x3c'),'type':_0xd92e('0x3d')})[_0xd92e('0x3e')](function(_0x193874){faxAccount[_0xd92e('0x3f')](_0x989d9d,{'from':_0x332822[_0xd92e('0x36')],'mapKey':_0xd92e('0x40'),'body':path[_0xd92e('0x3b')](_0x332822['filename'])[_0xd92e('0x28')]+_0xd92e('0x3c'),'AttachmentId':_0x193874['id']})[_0xd92e('0x41')](function(_0x130820){logger[_0xd92e('0x42')](_0x332822[_0xd92e('0x27')],'\x20notify\x20',JSON['stringify'](_0x130820));});})[_0xd92e('0x41')](function(_0x2bbdf6){logger[_0xd92e('0x42')](_0x332822[_0xd92e('0x27')],_0xd92e('0x43'),JSON[_0xd92e('0x44')](_0x2bbdf6));});});}logger[_0xd92e('0x2a')](_0x332822[_0xd92e('0x27')],_0xd92e('0x43'));}};Fax[_0xd92e('0x20')][_0xd92e('0x1f')]=function(_0xde2b4f){if(this[_0xd92e('0x11')][_0xde2b4f['uniqueid']]){_[_0xd92e('0x45')](this[_0xd92e('0xe')][_0xde2b4f[_0xd92e('0x27')]],_[_0xd92e('0x46')](_0xde2b4f,[_0xd92e('0x47'),_0xd92e('0x48')]));}};function updateStatus(_0x2226c7){if(_0x2226c7[_0xd92e('0x49')]){faxMessage[_0xd92e('0x4a')](_0x2226c7[_0xd92e('0x49')],{'failMessage':_0xd92e('0x4b')})['then'](function(_0x587da0){ut['logger'](_0xd92e('0x4c'),_0x587da0);})[_0xd92e('0x41')](function(_0x5e0bd5){ut[_0xd92e('0x4d')](_0xd92e('0x4e'),_0x5e0bd5);});}else{ut[_0xd92e('0x4d')](_0xd92e('0x4f'));}}Fax[_0xd92e('0x20')][_0xd92e('0x50')]=function(_0x491a44,_0x2bde6f,_0x5d481e){var _0x2d05d2=this;var _0x142075={};if(_0x2bde6f){_0x142075={'read':_0x2bde6f};}else{_0x142075={'failMessage':_0x5d481e};}if(this[_0xd92e('0x11')][_0x491a44]['AttachmentId']){faxMessage[_0xd92e('0x4a')](this[_0xd92e('0x11')][_0x491a44][_0xd92e('0x49')],_0x142075)['then'](function(_0xdc4a01){ut[_0xd92e('0x4d')](_0xd92e('0x51'),_0xdc4a01);})[_0xd92e('0x41')](function(_0xe9798c){ut[_0xd92e('0x4d')](_0xd92e('0x52'),_0xe9798c);})[_0xd92e('0x53')](function(){delete _0x2d05d2[_0xd92e('0xe')][_0x491a44];delete _0x2d05d2['actions'][_0x491a44];});}else{ut[_0xd92e('0x4d')](_0xd92e('0x54'));delete this[_0xd92e('0xe')][_0x491a44];delete this[_0xd92e('0x11')][_0x491a44];}};Fax[_0xd92e('0x20')]['syncHangup']=function(_0x234131){var _0x2cf6f3=this;if(this['channels'][_0x234131[_0xd92e('0x27')]]){if(this[_0xd92e('0x11')][_0x234131['uniqueid']]){this[_0xd92e('0xe')][_0x234131[_0xd92e('0x27')]]['id']=this[_0xd92e('0x11')][_0x234131[_0xd92e('0x27')]]['id'];this[_0xd92e('0xe')][_0x234131[_0xd92e('0x27')]][_0xd92e('0x28')]=this[_0xd92e('0x11')][_0x234131['uniqueid']][_0xd92e('0x28')];}logger[_0xd92e('0x2a')](_0x234131[_0xd92e('0x27')],this[_0xd92e('0x11')][_0x234131['uniqueid']]?_0xd92e('0x55'):_0xd92e('0x56'),JSON[_0xd92e('0x44')](this['channels'][_0x234131['uniqueid']]));if(this[_0xd92e('0x11')][_0x234131['uniqueid']]){if(this[_0xd92e('0xe')][_0x234131[_0xd92e('0x27')]][_0xd92e('0x57')]>0x0&&this[_0xd92e('0xe')][_0x234131[_0xd92e('0x27')]]['faxstatus']==='SUCCESS'){this[_0xd92e('0x50')](_0x234131[_0xd92e('0x27')],!![]);}else{this['updateStatus'](_0x234131[_0xd92e('0x27')],![],this[_0xd92e('0xe')][_0x234131['uniqueid']][_0xd92e('0x58')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x234131[_0xd92e('0x27')]]['faxstatusstring']:_0xd92e('0x59'));}}}};Fax[_0xd92e('0x20')][_0xd92e('0x5a')]=function(_0x426b69){var _0x1fb440=this;return new BPromise(function(_0x347f7c,_0x196470){_0x1fb440[_0xd92e('0x5b')](_0x426b69,_0x1fb440[_0xd92e('0xf')][_0x426b69[_0xd92e('0x5c')]])[_0xd92e('0x3e')](function(_0x2d13c9){ut[_0xd92e('0x4d')](_0xd92e('0x5d'),_0x2d13c9);_0x347f7c(ut[_0xd92e('0x39')]('Fax\x20received'));})['catch'](function(_0xf2e1c6){ut['logger'](_0xd92e('0x5e'),_0xf2e1c6);updateStatus(_0x426b69);_0x196470(ut[_0xd92e('0x39')](_0xd92e('0x5f')));});});};Fax[_0xd92e('0x20')]['checkAfterSend']=function(_0x2303db){var _0x3cddde=this;return new BPromise(function(_0x880812,_0x2dfe6d){var _0x9bb3c8=_0x3cddde[_0xd92e('0x60')](_0x3cddde[_0xd92e('0xf')][_0x2303db[_0xd92e('0x5c')]][_0xd92e('0x61')],_0x2303db);if(_0x9bb3c8[_0xd92e('0x62')]){_0x880812(ut[_0xd92e('0x39')](_0xd92e('0x63')));}else{_0x2dfe6d(ut[_0xd92e('0x39')](_0x9bb3c8[_0xd92e('0x39')]));}});};function originate(_0x4a62e7,_0x42b67d,_0x2a03bc){return new BPromise(function(_0xc752ee,_0x3e4d6a){if(_0x2a03bc){var _0x571311=util['format'](_0xd92e('0x64'),path[_0xd92e('0x3b')](_0x4a62e7[_0xd92e('0x5')])[_0xd92e('0x28')],_0x4a62e7[_0xd92e('0x5')]);gs[_0xd92e('0x65')](_0x571311)[_0xd92e('0x3e')](function(){_0x4a62e7[_0xd92e('0x5')]=util[_0xd92e('0x66')]('%s/%s.tif',path[_0xd92e('0x3b')](_0x4a62e7[_0xd92e('0x5')])[_0xd92e('0x67')],path[_0xd92e('0x3b')](_0x4a62e7[_0xd92e('0x5')])[_0xd92e('0x28')]);_0x42b67d[_0xd92e('0x68')]=_0x4a62e7['path'];ut[_0xd92e('0x4d')](_0xd92e('0x69'),'');ami[_0xd92e('0x6a')](ut[_0xd92e('0x6b')](_0x4a62e7,_0x42b67d))[_0xd92e('0x3e')](function(_0x375c2e){_0xc752ee(_0x375c2e);})[_0xd92e('0x41')](function(_0x3ee427){_0x3e4d6a(_0x3ee427);});})[_0xd92e('0x41')](function(_0x558a9c){_0x3e4d6a(_0x558a9c);});}else{ami[_0xd92e('0x6a')](ut['variablesAction'](_0x4a62e7,_0x42b67d))[_0xd92e('0x3e')](function(_0x38bb8f){_0xc752ee(_0x38bb8f);})[_0xd92e('0x41')](function(_0x3f7dac){_0x3e4d6a(_0x3f7dac);});}});}Fax['prototype'][_0xd92e('0x5b')]=function(_0x3f38bb,_0x481de2){var _0x308fb9=this;return new BPromise(function(_0x4d33ab,_0x3d9709){var _0x1e2b88=uuid['v4']();var _0x3458e3=ut[_0xd92e('0x6c')](_0x3f38bb,_0x481de2);_0x308fb9['actions'][_0x1e2b88]=new Action(_0x1e2b88,_0x481de2,_0x3f38bb);var _0x398b62=_0x308fb9['actions'][_0x1e2b88];if(path['parse'](_0x3f38bb[_0xd92e('0x5')])['ext']===_0xd92e('0x3c')){originate(_0x398b62,_0x3458e3,!![])[_0xd92e('0x3e')](function(_0x274b5e){_0x4d33ab(_0x274b5e);})[_0xd92e('0x41')](function(_0x3091d3){_0x3d9709(_0x3091d3);});}else{originate(_0x398b62,_0x3458e3,![])[_0xd92e('0x3e')](function(_0x47acc9){_0x4d33ab(_0x47acc9);})[_0xd92e('0x41')](function(_0x1db979){_0x3d9709(_0x1db979);});}});};Fax[_0xd92e('0x20')][_0xd92e('0x6d')]=function(_0x5850d7){return!_[_0xd92e('0x6e')](_0x5850d7)&&!_['isNil'](_0x5850d7[_0xd92e('0x28')])&&!_[_0xd92e('0x6e')](_0x5850d7['active'])&&_0x5850d7[_0xd92e('0x6f')]&&!_[_0xd92e('0x6e')](this[_0xd92e('0x10')][util[_0xd92e('0x66')](_0xd92e('0x70'),_0x5850d7[_0xd92e('0x28')])])&&!_['isNil'](this['trunks'][util['format'](_0xd92e('0x70'),_0x5850d7[_0xd92e('0x28')])][_0xd92e('0x30')])&&(this[_0xd92e('0x10')][util[_0xd92e('0x66')](_0xd92e('0x70'),_0x5850d7[_0xd92e('0x28')])][_0xd92e('0x30')]===_0xd92e('0x71')||this['trunks'][util[_0xd92e('0x66')](_0xd92e('0x70'),_0x5850d7[_0xd92e('0x28')])][_0xd92e('0x30')]==='unmonitored');};Fax['prototype'][_0xd92e('0x60')]=function(_0x483cec,_0x773826){if(!this[_0xd92e('0x6d')](_0x483cec)){ut[_0xd92e('0x4d')](_0xd92e('0x72'),_[_0xd92e('0x6e')](_0x483cec)?'':_0x483cec[_0xd92e('0x28')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0xd92e('0x6e')](_0x773826['fax'])){ut[_0xd92e('0x4d')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x773826));return{'isValid':![],'message':_0xd92e('0x73')};}if(_[_0xd92e('0x6e')](_0x773826[_0xd92e('0x5')])){ut['logger'](_0xd92e('0x74'),JSON[_0xd92e('0x44')](_0x773826));return{'isValid':![],'message':_0xd92e('0x75')};}return{'isValid':!![],'message':_0xd92e('0x76')};};module[_0xd92e('0x77')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 645d6e2..f2e7d92 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 _0x9f99=['lodash','error','inspect','notify','then','[Notify]\x20','util','bluebird','preview'];(function(_0x37760f,_0x56f96e){var _0x3fa046=function(_0x2b9159){while(--_0x2b9159){_0x37760f['push'](_0x37760f['shift']());}};_0x3fa046(++_0x56f96e);}(_0x9f99,0x11d));var _0x99f9=function(_0x7c721a,_0x20d800){_0x7c721a=_0x7c721a-0x0;var _0x41b5b5=_0x9f99[_0x7c721a];return _0x41b5b5;};'use strict';var util=require(_0x99f9('0x0'));var BPromise=require(_0x99f9('0x1'));var logger=require('../../../config/logger')(_0x99f9('0x2'));var _=require(_0x99f9('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x2c29b7){return function(_0xd42612){logger[_0x99f9('0x4')](_0x2c29b7,util[_0x99f9('0x5')](_0xd42612,{'showHidden':![],'depth':null}));};}exports[_0x99f9('0x6')]=function(_0x4f9a17,_0xdec878){return BPromise['resolve']()[_0x99f9('0x7')](faxAccount[_0x99f9('0x6')](_0x4f9a17,_0xdec878))['catch'](loggerCatch(_0x99f9('0x8')));}; \ No newline at end of file +var _0x1fd8=['../rpc/faxAccount','error','notify','resolve','then','catch','preview','lodash'];(function(_0x2cddb1,_0x523c57){var _0x3f0ca7=function(_0x32968a){while(--_0x32968a){_0x2cddb1['push'](_0x2cddb1['shift']());}};_0x3f0ca7(++_0x523c57);}(_0x1fd8,0x13e));var _0x81fd=function(_0x57307a,_0x9de85c){_0x57307a=_0x57307a-0x0;var _0xbce01a=_0x1fd8[_0x57307a];return _0xbce01a;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x81fd('0x0'));var _=require(_0x81fd('0x1'));var faxAccount=require(_0x81fd('0x2'));function loggerCatch(_0x844a92){return function(_0x2717d9){logger[_0x81fd('0x3')](_0x844a92,util['inspect'](_0x2717d9,{'showHidden':![],'depth':null}));};}exports[_0x81fd('0x4')]=function(_0x5731d8,_0x1c6e74){return BPromise[_0x81fd('0x5')]()[_0x81fd('0x6')](faxAccount['notify'](_0x5731d8,_0x1c6e74))[_0x81fd('0x7')](loggerCatch('[Notify]\x20'));}; \ 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 4bcc642..c21f582 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 _0x3b15=['\x20Error\x20:','inspect','child_process','exec','execute','info','Exec\x20gs'];(function(_0x4b91c4,_0x23f35f){var _0x25cb80=function(_0x48e283){while(--_0x48e283){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x25cb80(++_0x23f35f);}(_0x3b15,0xd4));var _0x53b1=function(_0x4c73ac,_0x46b73c){_0x4c73ac=_0x4c73ac-0x0;var _0x9839ee=_0x3b15[_0x4c73ac];return _0x9839ee;};'use strict';var util=require('util');var logger=require('../../../../config/logger')('fax');var BPromise=require('bluebird');var exec=require(_0x53b1('0x0'))[_0x53b1('0x1')];exports[_0x53b1('0x2')]=function(_0x4b108b){return new BPromise(function(_0x4b8801,_0x4c3365){exec(_0x4b108b,function(_0x3bfe9f,_0x4d5497,_0x5efa2e){logger['info']('Exec\x20gs',_0x4d5497);if(_0x3bfe9f){logger[_0x53b1('0x3')](_0x53b1('0x4'),_0x53b1('0x5'),util[_0x53b1('0x6')](_0x3bfe9f,{'showHidden':![],'depth':null}),_0x4d5497,_0x5efa2e);_0x4c3365(_0x3bfe9f);}_0x4b8801(_0x4d5497);});});}; \ No newline at end of file +var _0x5916=['info','Exec\x20gs','inspect','../../../../config/logger','fax','bluebird','child_process','exec','execute'];(function(_0x4105b2,_0x268009){var _0x5051e3=function(_0x45c491){while(--_0x45c491){_0x4105b2['push'](_0x4105b2['shift']());}};_0x5051e3(++_0x268009);}(_0x5916,0x1b3));var _0x6591=function(_0x240733,_0x48ca63){_0x240733=_0x240733-0x0;var _0x122cb9=_0x5916[_0x240733];return _0x122cb9;};'use strict';var util=require('util');var logger=require(_0x6591('0x0'))(_0x6591('0x1'));var BPromise=require(_0x6591('0x2'));var exec=require(_0x6591('0x3'))[_0x6591('0x4')];exports[_0x6591('0x5')]=function(_0x1fc3f8){return new BPromise(function(_0x5eef1e,_0x18d1b6){exec(_0x1fc3f8,function(_0x272bd6,_0x543c7f,_0x107af0){logger[_0x6591('0x6')](_0x6591('0x7'),_0x543c7f);if(_0x272bd6){logger[_0x6591('0x6')]('Exec\x20gs','\x20Error\x20:',util[_0x6591('0x8')](_0x272bd6,{'showHidden':![],'depth':null}),_0x543c7f,_0x107af0);_0x18d1b6(_0x272bd6);}_0x5eef1e(_0x543c7f);});});}; \ 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 f370136..37720fd 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 _0xd950=['maxrate','format','\x22%s\x22','modem','gateway','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','util','lodash','moment','../../../../config/logger','fax','inspect','ecm','headerinfo'];(function(_0x3494c9,_0x9d3656){var _0x36bed4=function(_0x1709fc){while(--_0x1709fc){_0x3494c9['push'](_0x3494c9['shift']());}};_0x36bed4(++_0x9d3656);}(_0xd950,0x133));var _0x0d95=function(_0x2af86c,_0x30b070){_0x2af86c=_0x2af86c-0x0;var _0x27ff10=_0xd950[_0x2af86c];return _0x27ff10;};'use strict';var util=require(_0x0d95('0x0'));var _=require(_0x0d95('0x1'));var moment=require(_0x0d95('0x2'));var logger=require(_0x0d95('0x3'))(_0x0d95('0x4'));exports['message']=function(_0x4eb103){return{'message':_0x4eb103};};exports['logger']=function(_0x4fa601,_0x4d93d3){logger['info'](_0x4fa601,util[_0x0d95('0x5')](_0x4d93d3,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0xa6b6b2,_0x589206){var _0x151026={'XMF-ECM':_0x589206[_0x0d95('0x6')],'XMF-HEADERINFO':_0x589206[_0x0d95('0x7')],'XMF-MINRATE':_0x589206['minrate'],'XMF-MAXRATE':_0x589206[_0x0d95('0x8')],'XMF-MODEM':util[_0x0d95('0x9')](_0x0d95('0xa'),_0x589206[_0x0d95('0xb')]),'XMF-GATEWAY':_0x589206[_0x0d95('0xc')],'XMF-FAXDETECT':_0x589206['faxdetect'],'XMF-T38TIMEOUT':_0x589206[_0x0d95('0xd')],'XMF-LOCALSTATIONID':_0x589206[_0x0d95('0xe')],'XMF-PATH':_0xa6b6b2[_0x0d95('0xf')]};return _0x151026;};exports[_0x0d95('0x10')]=function(_0x2094be,_0x4e384e){return{'actionid':_0x2094be[_0x0d95('0x11')],'action':_0x0d95('0x12'),'channel':_0x2094be[_0x0d95('0x13')],'Exten':_0x0d95('0x14'),'Context':'from-sip','Priority':'1','callerid':util[_0x0d95('0x9')]('\x22%s\x22\x20<%s>',_0x2094be[_0x0d95('0x7')]?_0x2094be[_0x0d95('0x7')]:'',_0x2094be['localstationid']),'variable':_0x4e384e,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2094be[_0x0d95('0x11')]};}; \ No newline at end of file +var _0x541d=['inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','util','lodash','../../../../config/logger','fax','message','logger','info'];(function(_0x51aa7b,_0x248830){var _0x37d2fc=function(_0x435f12){while(--_0x435f12){_0x51aa7b['push'](_0x51aa7b['shift']());}};_0x37d2fc(++_0x248830);}(_0x541d,0x1cd));var _0xd541=function(_0x228d65,_0x379f6f){_0x228d65=_0x228d65-0x0;var _0x39b130=_0x541d[_0x228d65];return _0x39b130;};'use strict';var util=require(_0xd541('0x0'));var _=require(_0xd541('0x1'));var moment=require('moment');var logger=require(_0xd541('0x2'))(_0xd541('0x3'));exports[_0xd541('0x4')]=function(_0x227561){return{'message':_0x227561};};exports[_0xd541('0x5')]=function(_0x12c20c,_0x484de1){logger[_0xd541('0x6')](_0x12c20c,util[_0xd541('0x7')](_0x484de1,{'showHidden':![],'depth':null}));};exports[_0xd541('0x8')]=function(_0x567633,_0x15e4fa){var _0x5c6f5f={'XMF-ECM':_0x15e4fa[_0xd541('0x9')],'XMF-HEADERINFO':_0x15e4fa[_0xd541('0xa')],'XMF-MINRATE':_0x15e4fa[_0xd541('0xb')],'XMF-MAXRATE':_0x15e4fa[_0xd541('0xc')],'XMF-MODEM':util[_0xd541('0xd')](_0xd541('0xe'),_0x15e4fa[_0xd541('0xf')]),'XMF-GATEWAY':_0x15e4fa[_0xd541('0x10')],'XMF-FAXDETECT':_0x15e4fa[_0xd541('0x11')],'XMF-T38TIMEOUT':_0x15e4fa[_0xd541('0x12')],'XMF-LOCALSTATIONID':_0x15e4fa[_0xd541('0x13')],'XMF-PATH':_0x567633[_0xd541('0x14')]};return _0x5c6f5f;};exports['variablesAction']=function(_0xd98610,_0x2241df){return{'actionid':_0xd98610[_0xd541('0x15')],'action':_0xd541('0x16'),'channel':_0xd98610[_0xd541('0x17')],'Exten':_0xd541('0x18'),'Context':'from-sip','Priority':'1','callerid':util[_0xd541('0xd')](_0xd541('0x19'),_0xd98610[_0xd541('0xa')]?_0xd98610[_0xd541('0xa')]:'',_0xd98610[_0xd541('0x13')]),'variable':_0x2241df,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xd98610['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 9ffc720..bd9ec35 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 _0xd97f=['initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','util','moment','./realtime','./report','./acw','./trigger','./dialer','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','hour','resolve','getAgents','initAgents','then','getTelephones','initTelephones','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns'];(function(_0x1e9165,_0x24bac1){var _0x5e9c50=function(_0x521fb6){while(--_0x521fb6){_0x1e9165['push'](_0x1e9165['shift']());}};_0x5e9c50(++_0x24bac1);}(_0xd97f,0xf3));var _0xfd97=function(_0x39f9f6,_0x3152c0){_0x39f9f6=_0x39f9f6-0x0;var _0x1f262e=_0xd97f[_0x39f9f6];return _0x1f262e;};'use strict';var util=require(_0xfd97('0x0'));var moment=require(_0xfd97('0x1'));var server=require('./server');var Realtime=require(_0xfd97('0x2'));var Report=require(_0xfd97('0x3'));var Acw=require(_0xfd97('0x4'));var Trigger=require(_0xfd97('0x5'));var Dialer=require(_0xfd97('0x6'));var Preview=require('./preview');var Fax=require('./fax');var user=require(_0xfd97('0x7'));var voiceQueue=require(_0xfd97('0x8'));var voiceQueueReport=require(_0xfd97('0x9'));var voiceCallReport=require(_0xfd97('0xa'));var trunk=require(_0xfd97('0xb'));var trigger=require('./rpc/trigger');var template=require(_0xfd97('0xc'));var cmHopperHistory=require(_0xfd97('0xd'));var campaign=require(_0xfd97('0xe'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xfd97('0xf'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xfd97('0x10'));var sugarcrm=require(_0xfd97('0x11'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xfd97('0x12'));var zoho=require(_0xfd97('0x13'));var vtiger=require(_0xfd97('0x14'));var freshsales=require(_0xfd97('0x15'));var servicenow=require(_0xfd97('0x16'));var dynamics365=require(_0xfd97('0x17'));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')(_0xfd97('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xfd97('0x19')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xfd97('0x19')](_0xfd97('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xfd97('0x1b')]()['then'](user[_0xfd97('0x1c')]())['then'](realtime[_0xfd97('0x1d')]())[_0xfd97('0x1e')](user[_0xfd97('0x1f')]())[_0xfd97('0x1e')](realtime[_0xfd97('0x20')]())[_0xfd97('0x1e')](trunk['getTrunks']())[_0xfd97('0x1e')](realtime[_0xfd97('0x21')]())[_0xfd97('0x1e')](voiceQueue[_0xfd97('0x22')]())[_0xfd97('0x1e')](realtime['initVoiceQueues']())[_0xfd97('0x1e')](trigger[_0xfd97('0x23')]())[_0xfd97('0x1e')](realtime[_0xfd97('0x24')]())['then'](template[_0xfd97('0x25')]())['then'](realtime[_0xfd97('0x26')]())[_0xfd97('0x1e')](zendesk[_0xfd97('0x27')]())[_0xfd97('0x1e')](realtime['initZendeskAccounts']())[_0xfd97('0x1e')](salesforce[_0xfd97('0x28')]())[_0xfd97('0x1e')](realtime['initSalesforceAccounts']())[_0xfd97('0x1e')](sugarcrm[_0xfd97('0x29')]())[_0xfd97('0x1e')](realtime[_0xfd97('0x2a')]())[_0xfd97('0x1e')](freshdesk[_0xfd97('0x2b')]())[_0xfd97('0x1e')](realtime[_0xfd97('0x2c')]())[_0xfd97('0x1e')](desk[_0xfd97('0x2d')]())[_0xfd97('0x1e')](realtime[_0xfd97('0x2e')]())[_0xfd97('0x1e')](zoho[_0xfd97('0x2f')]())[_0xfd97('0x1e')](realtime[_0xfd97('0x30')]())[_0xfd97('0x1e')](vtiger[_0xfd97('0x31')]())[_0xfd97('0x1e')](realtime[_0xfd97('0x32')]())[_0xfd97('0x1e')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0xfd97('0x33')]())[_0xfd97('0x1e')](servicenow[_0xfd97('0x34')]())[_0xfd97('0x1e')](realtime[_0xfd97('0x35')]())[_0xfd97('0x1e')](dynamics365[_0xfd97('0x36')]())[_0xfd97('0x1e')](realtime[_0xfd97('0x37')]())[_0xfd97('0x1e')](campaign[_0xfd97('0x38')]())[_0xfd97('0x1e')](realtime[_0xfd97('0x39')]())['then'](voiceExtension[_0xfd97('0x3a')]())[_0xfd97('0x1e')](realtime[_0xfd97('0x3b')]())[_0xfd97('0x1e')](faxAccount[_0xfd97('0x3c')]())[_0xfd97('0x1e')](realtime[_0xfd97('0x3d')]())[_0xfd97('0x1e')](function(){return realtime;});}function initParams(){return Promise[_0xfd97('0x1b')]()[_0xfd97('0x1e')](voiceQueueReport[_0xfd97('0x3e')]())[_0xfd97('0x1e')](realtime[_0xfd97('0x3f')]())['then'](cmHopperHistory[_0xfd97('0x40')]())['then'](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0xfd97('0x41')]())[_0xfd97('0x1e')](realtime['initCampaignHopperHistory']())[_0xfd97('0x1e')](voiceCallReport[_0xfd97('0x42')]())['then'](realtime[_0xfd97('0x43')]())[_0xfd97('0x44')](function(_0x27850b){logger[_0xfd97('0x45')](_0xfd97('0x46'),util[_0xfd97('0x47')](_0x27850b,{'showHidden':![],'depth':null}));});}function main(){return server[_0xfd97('0x48')](realtime,preview,fax)[_0xfd97('0x1e')](function(){return initRealtime();})[_0xfd97('0x1e')](function(){return initParams();})[_0xfd97('0x1e')](function(){report[_0xfd97('0x49')]();setInterval(initRealtime,0x1388);})[_0xfd97('0x44')](function(_0x6ba0dc){logger[_0xfd97('0x45')](_0xfd97('0x4a'),util[_0xfd97('0x47')](_0x6ba0dc,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xbb7b=['initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','[index.js][initParams]','inspect','sync','catch','[index.js][main]','util','moment','./realtime','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/freshsales','../../config/logger','ami','get','hour','then','getAgents','initAgents','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns'];(function(_0x38075c,_0x37aa05){var _0xbac926=function(_0xd108ef){while(--_0xd108ef){_0x38075c['push'](_0x38075c['shift']());}};_0xbac926(++_0x37aa05);}(_0xbb7b,0x17f));var _0xbbb7=function(_0x5c115c,_0x1f1c23){_0x5c115c=_0x5c115c-0x0;var _0x4fd5f5=_0xbb7b[_0x5c115c];return _0x4fd5f5;};'use strict';var util=require(_0xbbb7('0x0'));var moment=require(_0xbbb7('0x1'));var server=require('./server');var Realtime=require(_0xbbb7('0x2'));var Report=require('./report');var Acw=require(_0xbbb7('0x3'));var Trigger=require(_0xbbb7('0x4'));var Dialer=require(_0xbbb7('0x5'));var Preview=require('./preview');var Fax=require(_0xbbb7('0x6'));var user=require(_0xbbb7('0x7'));var voiceQueue=require(_0xbbb7('0x8'));var voiceQueueReport=require(_0xbbb7('0x9'));var voiceCallReport=require(_0xbbb7('0xa'));var trunk=require(_0xbbb7('0xb'));var trigger=require(_0xbbb7('0xc'));var template=require('./rpc/template');var cmHopperHistory=require(_0xbbb7('0xd'));var campaign=require(_0xbbb7('0xe'));var voiceExtension=require(_0xbbb7('0xf'));var faxAccount=require(_0xbbb7('0x10'));var zendesk=require(_0xbbb7('0x11'));var salesforce=require(_0xbbb7('0x12'));var sugarcrm=require(_0xbbb7('0x13'));var freshdesk=require(_0xbbb7('0x14'));var desk=require('./rpc/integrations/desk');var zoho=require(_0xbbb7('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xbbb7('0x16'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xbbb7('0x17'))(_0xbbb7('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xbbb7('0x19')](_0xbbb7('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xbbb7('0x19')](_0xbbb7('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0xbbb7('0x1b')](user[_0xbbb7('0x1c')]())['then'](realtime[_0xbbb7('0x1d')]())[_0xbbb7('0x1b')](user['getTelephones']())[_0xbbb7('0x1b')](realtime[_0xbbb7('0x1e')]())[_0xbbb7('0x1b')](trunk['getTrunks']())[_0xbbb7('0x1b')](realtime[_0xbbb7('0x1f')]())[_0xbbb7('0x1b')](voiceQueue[_0xbbb7('0x20')]())['then'](realtime[_0xbbb7('0x21')]())[_0xbbb7('0x1b')](trigger[_0xbbb7('0x22')]())[_0xbbb7('0x1b')](realtime[_0xbbb7('0x23')]())[_0xbbb7('0x1b')](template[_0xbbb7('0x24')]())[_0xbbb7('0x1b')](realtime[_0xbbb7('0x25')]())['then'](zendesk[_0xbbb7('0x26')]())[_0xbbb7('0x1b')](realtime[_0xbbb7('0x27')]())[_0xbbb7('0x1b')](salesforce['getSalesforceAccounts']())[_0xbbb7('0x1b')](realtime['initSalesforceAccounts']())[_0xbbb7('0x1b')](sugarcrm['getSugarcrmAccounts']())[_0xbbb7('0x1b')](realtime[_0xbbb7('0x28')]())[_0xbbb7('0x1b')](freshdesk[_0xbbb7('0x29')]())[_0xbbb7('0x1b')](realtime[_0xbbb7('0x2a')]())['then'](desk[_0xbbb7('0x2b')]())['then'](realtime[_0xbbb7('0x2c')]())[_0xbbb7('0x1b')](zoho['getZohoAccounts']())[_0xbbb7('0x1b')](realtime[_0xbbb7('0x2d')]())[_0xbbb7('0x1b')](vtiger[_0xbbb7('0x2e')]())[_0xbbb7('0x1b')](realtime[_0xbbb7('0x2f')]())[_0xbbb7('0x1b')](freshsales[_0xbbb7('0x30')]())[_0xbbb7('0x1b')](realtime[_0xbbb7('0x31')]())[_0xbbb7('0x1b')](servicenow[_0xbbb7('0x32')]())['then'](realtime[_0xbbb7('0x33')]())[_0xbbb7('0x1b')](dynamics365[_0xbbb7('0x34')]())[_0xbbb7('0x1b')](realtime[_0xbbb7('0x35')]())[_0xbbb7('0x1b')](campaign[_0xbbb7('0x36')]())[_0xbbb7('0x1b')](realtime[_0xbbb7('0x37')]())['then'](voiceExtension[_0xbbb7('0x38')]())[_0xbbb7('0x1b')](realtime[_0xbbb7('0x39')]())[_0xbbb7('0x1b')](faxAccount[_0xbbb7('0x3a')]())[_0xbbb7('0x1b')](realtime[_0xbbb7('0x3b')]())[_0xbbb7('0x1b')](function(){return realtime;});}function initParams(){return Promise[_0xbbb7('0x3c')]()[_0xbbb7('0x1b')](voiceQueueReport[_0xbbb7('0x3d')]())[_0xbbb7('0x1b')](realtime['initVoiceQueueReports']())[_0xbbb7('0x1b')](cmHopperHistory[_0xbbb7('0x3e')]())[_0xbbb7('0x1b')](realtime['initVoiceQueueHopperHistory']())[_0xbbb7('0x1b')](cmHopperHistory[_0xbbb7('0x3f')]())[_0xbbb7('0x1b')](realtime[_0xbbb7('0x40')]())['then'](voiceCallReport[_0xbbb7('0x41')]())[_0xbbb7('0x1b')](realtime[_0xbbb7('0x42')]())['catch'](function(_0x3aa68e){logger[_0xbbb7('0x43')](_0xbbb7('0x44'),util[_0xbbb7('0x45')](_0x3aa68e,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xbbb7('0x1b')](function(){return initRealtime();})[_0xbbb7('0x1b')](function(){return initParams();})[_0xbbb7('0x1b')](function(){report[_0xbbb7('0x46')]();setInterval(initRealtime,0x1388);})[_0xbbb7('0x47')](function(_0x4553d5){logger[_0xbbb7('0x43')](_0xbbb7('0x48'),util[_0xbbb7('0x45')](_0x4553d5,{'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 d37ec8a..9d0e89f 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 _0x5900=['status','phone','mobile','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','md5','prototype','toLowerCase','idle','inuse','talking','voiceStatus','statePause','toNumber','address','stringify','format','user:%s','emit','user:ami:update','omit','user:presence','util','moment','ioredis','../../../config/environment','redis','localhost','name','email','accountcode','fullname','state','unknown'];(function(_0x1bb82a,_0x47d1a6){var _0x13a56e=function(_0x358a49){while(--_0x358a49){_0x1bb82a['push'](_0x1bb82a['shift']());}};_0x13a56e(++_0x47d1a6);}(_0x5900,0xd2));var _0x0590=function(_0x4be3f3,_0x20efd7){_0x4be3f3=_0x4be3f3-0x0;var _0x5278b3=_0x5900[_0x4be3f3];return _0x5278b3;};'use strict';var _=require('lodash');var util=require(_0x0590('0x0'));var moment=require(_0x0590('0x1'));var md5=require('md5');var Redis=require(_0x0590('0x2'));var config=require(_0x0590('0x3'));config[_0x0590('0x4')]=_['defaults'](config[_0x0590('0x4')],{'host':_0x0590('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0590('0x4')]));function Agent(_0x1d9927){this['id']=_0x1d9927['id']||0x0;this['name']=_0x1d9927[_0x0590('0x6')]||'';this[_0x0590('0x7')]=_0x1d9927[_0x0590('0x7')]||'';this[_0x0590('0x8')]=_0x1d9927[_0x0590('0x8')]||'';this[_0x0590('0x9')]=_0x1d9927[_0x0590('0x9')]||'';this[_0x0590('0xa')]=_0x0590('0xb');this['stateTime']=0x0;this[_0x0590('0xc')]=_0x0590('0xb');this['address']='';this[_0x0590('0xd')]='';this[_0x0590('0xe')]='';this['interface']='';this['online']=_0x1d9927[_0x0590('0xf')]||![];this['voiceStatus']=_0x0590('0xb');this[_0x0590('0x10')]=0x0;this[_0x0590('0x11')]='';this[_0x0590('0x12')]='';this[_0x0590('0x13')]=![];this['local']=![];this[_0x0590('0x14')]='';}Agent[_0x0590('0x15')]['updateStatusRealtime']=function(_0x2c006e){var _0x9d960e;if(_0x2c006e&&_0x2c006e[_0x0590('0xa')]){_0x9d960e=_0x2c006e['state'][_0x0590('0x16')]();switch(_0x9d960e){case'not_inuse':_0x9d960e=_0x0590('0x17');break;case _0x0590('0x18'):_0x9d960e=_0x0590('0x19');break;}}if(_0x9d960e&&this[_0x0590('0x1a')]!==_0x9d960e||_0x2c006e[_0x0590('0x1b')]){this[_0x0590('0x10')]=_[_0x0590('0x1c')](moment()['format']('x'));}if(_0x9d960e){this['voiceStatus']=_0x9d960e;}var _0x97e9ae={'id':this['id'],'name':this[_0x0590('0x6')],'email':this['email'],'accountcode':this[_0x0590('0x8')],'fullname':this[_0x0590('0x9')],'state':this[_0x0590('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this[_0x0590('0x1d')],'online':this['online'],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x0590('0x10')],'voiceStatusCallerIdNumber':this[_0x0590('0x11')],'voiceStatusQueue':this[_0x0590('0x12')],'interface':this['interface'],'onhold':this['onhold']};var _0x470936=md5(JSON[_0x0590('0x1e')](_0x97e9ae));if(this[_0x0590('0x14')]!==_0x470936){this['md5']=_0x470936;io['to'](util[_0x0590('0x1f')](_0x0590('0x20'),_0x97e9ae[_0x0590('0x6')]))[_0x0590('0x21')](_0x0590('0x22'),_[_0x0590('0x23')](_0x97e9ae,['online']));io['emit'](_0x0590('0x24'),_0x97e9ae);}};module['exports']=Agent; \ No newline at end of file +var _0x0afd=['toNumber','format','interface','onhold','stringify','user:%s','name','emit','user:ami:update','omit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','email','accountcode','fullname','state','unknown','status','address','phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','idle','inuse','talking','statePause'];(function(_0x19ad7b,_0x2ae8fa){var _0x8a0f00=function(_0x56781d){while(--_0x56781d){_0x19ad7b['push'](_0x19ad7b['shift']());}};_0x8a0f00(++_0x2ae8fa);}(_0x0afd,0x138));var _0xd0af=function(_0x2e3df2,_0x583635){_0x2e3df2=_0x2e3df2-0x0;var _0x34c8c9=_0x0afd[_0x2e3df2];return _0x34c8c9;};'use strict';var _=require(_0xd0af('0x0'));var util=require(_0xd0af('0x1'));var moment=require(_0xd0af('0x2'));var md5=require('md5');var Redis=require(_0xd0af('0x3'));var config=require(_0xd0af('0x4'));config[_0xd0af('0x5')]=_[_0xd0af('0x6')](config['redis'],{'host':_0xd0af('0x7'),'port':0x18eb});var io=require(_0xd0af('0x8'))(new Redis(config['redis']));function Agent(_0x461be2){this['id']=_0x461be2['id']||0x0;this['name']=_0x461be2['name']||'';this[_0xd0af('0x9')]=_0x461be2[_0xd0af('0x9')]||'';this[_0xd0af('0xa')]=_0x461be2[_0xd0af('0xa')]||'';this[_0xd0af('0xb')]=_0x461be2['fullname']||'';this[_0xd0af('0xc')]=_0xd0af('0xd');this['stateTime']=0x0;this[_0xd0af('0xe')]=_0xd0af('0xd');this[_0xd0af('0xf')]='';this[_0xd0af('0x10')]='';this[_0xd0af('0x11')]='';this['interface']='';this[_0xd0af('0x12')]=_0x461be2[_0xd0af('0x12')]||![];this[_0xd0af('0x13')]=_0xd0af('0xd');this[_0xd0af('0x14')]=0x0;this[_0xd0af('0x15')]='';this[_0xd0af('0x16')]='';this['onhold']=![];this[_0xd0af('0x17')]=![];this[_0xd0af('0x18')]='';}Agent[_0xd0af('0x19')][_0xd0af('0x1a')]=function(_0x15ff91){var _0x1ee14a;if(_0x15ff91&&_0x15ff91['state']){_0x1ee14a=_0x15ff91['state']['toLowerCase']();switch(_0x1ee14a){case _0xd0af('0x1b'):_0x1ee14a=_0xd0af('0x1c');break;case _0xd0af('0x1d'):_0x1ee14a=_0xd0af('0x1e');break;}}if(_0x1ee14a&&this['voiceStatus']!==_0x1ee14a||_0x15ff91[_0xd0af('0x1f')]){this[_0xd0af('0x14')]=_[_0xd0af('0x20')](moment()[_0xd0af('0x21')]('x'));}if(_0x1ee14a){this[_0xd0af('0x13')]=_0x1ee14a;}var _0x2cefa6={'id':this['id'],'name':this['name'],'email':this['email'],'accountcode':this[_0xd0af('0xa')],'fullname':this[_0xd0af('0xb')],'state':this[_0xd0af('0xc')],'stateTime':this['stateTime'],'status':this[_0xd0af('0xe')],'address':this[_0xd0af('0xf')],'online':this['online'],'voiceStatus':this[_0xd0af('0x13')],'voiceStatusTime':this[_0xd0af('0x14')],'voiceStatusCallerIdNumber':this[_0xd0af('0x15')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0xd0af('0x22')],'onhold':this[_0xd0af('0x23')]};var _0x1a7c0a=md5(JSON[_0xd0af('0x24')](_0x2cefa6));if(this['md5']!==_0x1a7c0a){this[_0xd0af('0x18')]=_0x1a7c0a;io['to'](util[_0xd0af('0x21')](_0xd0af('0x25'),_0x2cefa6[_0xd0af('0x26')]))[_0xd0af('0x27')](_0xd0af('0x28'),_[_0xd0af('0x29')](_0x2cefa6,[_0xd0af('0x12')]));io[_0xd0af('0x27')](_0xd0af('0x2a'),_0x2cefa6);}};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 0dc8432..7a932b8 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 _0x2221=['dialAMDMaximumWordLength','exports','name','type','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x3f619d,_0x4762c5){var _0x1eb364=function(_0x407268){while(--_0x407268){_0x3f619d['push'](_0x3f619d['shift']());}};_0x1eb364(++_0x4762c5);}(_0x2221,0x1d8));var _0x1222=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x2221[_0x1ed116];return _0x574066;};'use strict';function Campaign(_0x5079d8){this['id']=_0x5079d8['id']||0x0;this[_0x1222('0x0')]=_0x5079d8['name']||'';this[_0x1222('0x1')]=_0x5079d8[_0x1222('0x1')]||'campaign';this[_0x1222('0x2')]=0x0;this['temp']=0x0;this[_0x1222('0x3')]=0x0;this[_0x1222('0x4')]=0x0;this[_0x1222('0x5')]='';this['sendMessageOneNotActive']=!![];this['active']=_0x5079d8[_0x1222('0x6')];this[_0x1222('0x7')]=_0x5079d8[_0x1222('0x7')];this[_0x1222('0x8')]=_0x5079d8[_0x1222('0x8')]||null;this['dialGlobalInterval']=_0x5079d8[_0x1222('0x9')]?_0x5079d8[_0x1222('0x9')]:null;this[_0x1222('0xa')]=_0x5079d8[_0x1222('0xa')];this[_0x1222('0xb')]=_0x5079d8[_0x1222('0xb')];this[_0x1222('0xc')]=_0x5079d8[_0x1222('0xc')]||0x1e;this[_0x1222('0xd')]=_0x5079d8['dialCongestionMaxRetry'];this[_0x1222('0xe')]=_0x5079d8[_0x1222('0xe')];this[_0x1222('0xf')]=_0x5079d8['dialBusyMaxRetry'];this[_0x1222('0x10')]=_0x5079d8['dialBusyRetryFrequency'];this[_0x1222('0x11')]=_0x5079d8[_0x1222('0x11')];this[_0x1222('0x12')]=_0x5079d8[_0x1222('0x12')];this['dialGlobalMaxRetry']=_0x5079d8[_0x1222('0x13')];this[_0x1222('0x14')]=_0x5079d8[_0x1222('0x14')]||0x3;this[_0x1222('0x15')]=_0x5079d8[_0x1222('0x15')]||0x96;this['dialDropMaxRetry']=_0x5079d8['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x5079d8[_0x1222('0x16')]||0x96;this[_0x1222('0x17')]=_0x5079d8['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x5079d8[_0x1222('0x18')]||0x96;this[_0x1222('0x19')]=_0x5079d8[_0x1222('0x19')]||0x3;this[_0x1222('0x1a')]=_0x5079d8['dialMachineRetryFrequency']||0x96;this[_0x1222('0x1b')]=_0x5079d8[_0x1222('0x1b')]||0x3;this[_0x1222('0x1c')]=_0x5079d8['dialAgentRejectRetryFrequency']||0x96;this[_0x1222('0x1d')]=_0x5079d8[_0x1222('0x1d')]||'DESC';this[_0x1222('0x1e')]=_0x5079d8[_0x1222('0x1e')]||undefined;this[_0x1222('0x1f')]=_0x5079d8['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x1222('0x20')]=_0x5079d8[_0x1222('0x20')]||undefined;this['TrunkBackup']=_0x5079d8['TrunkBackup']?_0x5079d8[_0x1222('0x21')]:undefined;this['Trunk']=_0x5079d8[_0x1222('0x22')]?_0x5079d8['Trunk']:undefined;this[_0x1222('0x23')]=_0x5079d8['Interval']?_0x5079d8[_0x1222('0x23')]:undefined;this[_0x1222('0x24')]=_0x5079d8[_0x1222('0x24')]?_0x5079d8['SquareProject']:undefined;this[_0x1222('0x25')]=_0x5079d8[_0x1222('0x24')]?_0x5079d8['SquareProject'][_0x1222('0x0')]:undefined;this['dialAMDActive']=_0x5079d8[_0x1222('0x26')]||![];this[_0x1222('0x27')]=_0x5079d8[_0x1222('0x27')];this['dialAMDGreeting']=_0x5079d8[_0x1222('0x28')];this['dialAMDAfterGreetingSilence']=_0x5079d8[_0x1222('0x29')];this[_0x1222('0x2a')]=_0x5079d8[_0x1222('0x2a')];this['dialAMDMinWordLength']=_0x5079d8['dialAMDMinWordLength'];this[_0x1222('0x2b')]=_0x5079d8[_0x1222('0x2b')];this[_0x1222('0x2c')]=_0x5079d8[_0x1222('0x2c')];this['dialAMDSilenceThreshold']=_0x5079d8['dialAMDSilenceThreshold'];this[_0x1222('0x2d')]=_0x5079d8['dialAMDMaximumWordLength'];}module[_0x1222('0x2e')]=Campaign; \ No newline at end of file +var _0x21e5=['dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry'];(function(_0x468e71,_0x171468){var _0x2c9045=function(_0x3607c1){while(--_0x3607c1){_0x468e71['push'](_0x468e71['shift']());}};_0x2c9045(++_0x171468);}(_0x21e5,0x11f));var _0x521e=function(_0xf168d3,_0x43dcfc){_0xf168d3=_0xf168d3-0x0;var _0x17fb54=_0x21e5[_0xf168d3];return _0x17fb54;};'use strict';function Campaign(_0x4ab677){this['id']=_0x4ab677['id']||0x0;this['name']=_0x4ab677[_0x521e('0x0')]||'';this[_0x521e('0x1')]=_0x4ab677[_0x521e('0x1')]||_0x521e('0x2');this[_0x521e('0x3')]=0x0;this[_0x521e('0x4')]=0x0;this[_0x521e('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x521e('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0x521e('0x7')]=_0x4ab677[_0x521e('0x7')];this[_0x521e('0x8')]=_0x4ab677[_0x521e('0x8')];this[_0x521e('0x9')]=_0x4ab677[_0x521e('0x9')]||null;this[_0x521e('0xa')]=_0x4ab677['dialGlobalInterval']?_0x4ab677[_0x521e('0xa')]:null;this[_0x521e('0xb')]=_0x4ab677[_0x521e('0xb')];this['dialOriginateCallerIdNumber']=_0x4ab677[_0x521e('0xc')];this[_0x521e('0xd')]=_0x4ab677['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x4ab677[_0x521e('0xe')];this[_0x521e('0xf')]=_0x4ab677['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x4ab677[_0x521e('0x10')];this['dialBusyRetryFrequency']=_0x4ab677[_0x521e('0x11')];this[_0x521e('0x12')]=_0x4ab677[_0x521e('0x12')];this[_0x521e('0x13')]=_0x4ab677[_0x521e('0x13')];this[_0x521e('0x14')]=_0x4ab677[_0x521e('0x14')];this[_0x521e('0x15')]=_0x4ab677[_0x521e('0x15')]||0x3;this[_0x521e('0x16')]=_0x4ab677[_0x521e('0x16')]||0x96;this[_0x521e('0x17')]=_0x4ab677[_0x521e('0x17')]||0x3;this[_0x521e('0x18')]=_0x4ab677[_0x521e('0x18')]||0x96;this[_0x521e('0x19')]=_0x4ab677[_0x521e('0x19')]||0x3;this['dialAbandonedRetryFrequency']=_0x4ab677[_0x521e('0x1a')]||0x96;this[_0x521e('0x1b')]=_0x4ab677[_0x521e('0x1b')]||0x3;this[_0x521e('0x1c')]=_0x4ab677[_0x521e('0x1c')]||0x96;this[_0x521e('0x1d')]=_0x4ab677[_0x521e('0x1d')]||0x3;this[_0x521e('0x1e')]=_0x4ab677[_0x521e('0x1e')]||0x96;this[_0x521e('0x1f')]=_0x4ab677['dialOrderByScheduledAt']||_0x521e('0x20');this['dialPrefix']=_0x4ab677['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x4ab677[_0x521e('0x21')]||undefined;this[_0x521e('0x22')]=_0x4ab677[_0x521e('0x22')]||undefined;this[_0x521e('0x23')]=_0x4ab677[_0x521e('0x23')]?_0x4ab677[_0x521e('0x23')]:undefined;this[_0x521e('0x24')]=_0x4ab677[_0x521e('0x24')]?_0x4ab677[_0x521e('0x24')]:undefined;this[_0x521e('0x25')]=_0x4ab677[_0x521e('0x25')]?_0x4ab677[_0x521e('0x25')]:undefined;this['SquareProject']=_0x4ab677[_0x521e('0x26')]?_0x4ab677[_0x521e('0x26')]:undefined;this[_0x521e('0x27')]=_0x4ab677[_0x521e('0x26')]?_0x4ab677[_0x521e('0x26')][_0x521e('0x0')]:undefined;this[_0x521e('0x28')]=_0x4ab677[_0x521e('0x28')]||![];this[_0x521e('0x29')]=_0x4ab677[_0x521e('0x29')];this['dialAMDGreeting']=_0x4ab677[_0x521e('0x2a')];this[_0x521e('0x2b')]=_0x4ab677[_0x521e('0x2b')];this[_0x521e('0x2c')]=_0x4ab677['dialAMDTotalAnalysisTime'];this[_0x521e('0x2d')]=_0x4ab677[_0x521e('0x2d')];this[_0x521e('0x2e')]=_0x4ab677['dialAMDBetweenWordsSilence'];this[_0x521e('0x2f')]=_0x4ab677[_0x521e('0x2f')];this[_0x521e('0x30')]=_0x4ab677['dialAMDSilenceThreshold'];this[_0x521e('0x31')]=_0x4ab677[_0x521e('0x31')];}module[_0x521e('0x32')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index a2fbba6..a5b18b3 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 _0x7382=['type','tag','monitor','monitorFilename','queue','transferconnectedlinenum','transferType','mohtime','exports','channel','accountcode','context','uniqueid','linkedid','exten','answertime','endtime','unmanaged','lastapplication','lastdata','duration','holdtime'];(function(_0x280e9f,_0x360cb6){var _0xb61f82=function(_0x320225){while(--_0x320225){_0x280e9f['push'](_0x280e9f['shift']());}};_0xb61f82(++_0x360cb6);}(_0x7382,0x111));var _0x2738=function(_0xe84e44,_0x493f51){_0xe84e44=_0xe84e44-0x0;var _0x8c9c98=_0x7382[_0xe84e44];return _0x8c9c98;};'use strict';function Channel(){this['starttime']=null;this[_0x2738('0x0')]='';this['destinationchannel']='';this['calleridnum']=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0x2738('0x1')]=0x0;this[_0x2738('0x2')]='';this[_0x2738('0x3')]=0x0;this[_0x2738('0x4')]=0x0;this[_0x2738('0x5')]=0x0;this['answered']=![];this[_0x2738('0x6')]=null;this[_0x2738('0x7')]=null;this[_0x2738('0x8')]=![];this['abandoned']=![];this[_0x2738('0x9')]='';this[_0x2738('0xa')]='';this[_0x2738('0xb')]=0x0;this['billableseconds']=0x0;this[_0x2738('0xc')]=0x0;this[_0x2738('0xd')]=null;this[_0x2738('0xe')]=null;this['disposition']=null;this[_0x2738('0xf')]=![];this[_0x2738('0x10')]=null;this[_0x2738('0x11')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0x2738('0x12')]=undefined;this[_0x2738('0x13')]=undefined;this[_0x2738('0x14')]=0x0;}module[_0x2738('0x15')]=Channel; \ No newline at end of file +var _0x66ee=['transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinename','accountcode','context','uniqueid','exten','answered','answertime','endtime','unmanaged','lastapplication','billableseconds','type','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x66ee,0x85));var _0xe66e=function(_0x112dcd,_0x3aa609){_0x112dcd=_0x112dcd-0x0;var _0x598464=_0x66ee[_0x112dcd];return _0x598464;};'use strict';function Channel(){this[_0xe66e('0x0')]=null;this[_0xe66e('0x1')]='';this[_0xe66e('0x2')]='';this[_0xe66e('0x3')]=0x0;this[_0xe66e('0x4')]='';this['connectedlinenum']=undefined;this[_0xe66e('0x5')]=undefined;this[_0xe66e('0x6')]=0x0;this[_0xe66e('0x7')]='';this[_0xe66e('0x8')]=0x0;this['linkedid']=0x0;this[_0xe66e('0x9')]=0x0;this[_0xe66e('0xa')]=![];this[_0xe66e('0xb')]=null;this[_0xe66e('0xc')]=null;this[_0xe66e('0xd')]=![];this['abandoned']=![];this[_0xe66e('0xe')]='';this['lastdata']='';this['duration']=0x0;this[_0xe66e('0xf')]=0x0;this['holdtime']=0x0;this[_0xe66e('0x10')]=null;this['tag']=null;this[_0xe66e('0x11')]=null;this[_0xe66e('0x12')]=![];this[_0xe66e('0x13')]=null;this[_0xe66e('0x14')]=null;this[_0xe66e('0x15')]=[];this[_0xe66e('0x16')]=undefined;this[_0xe66e('0x17')]=undefined;this['transferType']=undefined;this[_0xe66e('0x18')]=0x0;}module[_0xe66e('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index de68c1c..5acc2cf 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 _0x21c7=['serverUrl','Configurations','exports','name','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x3d86f5,_0x257914){var _0x2d6881=function(_0x2d912e){while(--_0x2d912e){_0x3d86f5['push'](_0x3d86f5['shift']());}};_0x2d6881(++_0x257914);}(_0x21c7,0x93));var _0x721c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x21c7[_0x3dd15e];return _0x231fd0;};'use strict';function DeskAccount(_0x45962c){this['id']=_0x45962c['id']||0x0;this['name']=_0x45962c[_0x721c('0x0')]||'';this['username']=_0x45962c['username']||'';this['remoteUri']=_0x45962c[_0x721c('0x1')]||'';this[_0x721c('0x2')]=_0x45962c['authType']||'';this['password']=_0x45962c[_0x721c('0x3')]||'';this[_0x721c('0x4')]=_0x45962c[_0x721c('0x4')]||'';this[_0x721c('0x5')]=_0x45962c[_0x721c('0x5')]||'';this[_0x721c('0x6')]=_0x45962c[_0x721c('0x6')]||'';this[_0x721c('0x7')]=_0x45962c['tokenSecret']||'';this[_0x721c('0x8')]=_0x45962c[_0x721c('0x8')]||'';this[_0x721c('0x9')]=_0x45962c[_0x721c('0x9')]||'';this[_0x721c('0xa')]=_0x45962c[_0x721c('0xa')]||{};}module[_0x721c('0xb')]=DeskAccount; \ No newline at end of file +var _0x61aa=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x61aa,0xed));var _0xa61a=function(_0x21e45c,_0x89818){_0x21e45c=_0x21e45c-0x0;var _0x48c323=_0x61aa[_0x21e45c];return _0x48c323;};'use strict';function DeskAccount(_0x302dad){this['id']=_0x302dad['id']||0x0;this[_0xa61a('0x0')]=_0x302dad[_0xa61a('0x0')]||'';this[_0xa61a('0x1')]=_0x302dad[_0xa61a('0x1')]||'';this[_0xa61a('0x2')]=_0x302dad[_0xa61a('0x2')]||'';this['authType']=_0x302dad[_0xa61a('0x3')]||'';this[_0xa61a('0x4')]=_0x302dad['password']||'';this['consumerKey']=_0x302dad[_0xa61a('0x5')]||'';this[_0xa61a('0x6')]=_0x302dad[_0xa61a('0x6')]||'';this[_0xa61a('0x7')]=_0x302dad[_0xa61a('0x7')]||'';this[_0xa61a('0x8')]=_0x302dad['tokenSecret']||'';this[_0xa61a('0x9')]=_0x302dad[_0xa61a('0x9')]||'';this[_0xa61a('0xa')]=_0x302dad[_0xa61a('0xa')]||'';this['Configurations']=_0x302dad[_0xa61a('0xb')]||{};}module[_0xa61a('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 6be8ad1..e70f8b9 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 _0xb903=['CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations'];(function(_0x4bbb93,_0x25712b){var _0x3069d1=function(_0x8d96ce){while(--_0x8d96ce){_0x4bbb93['push'](_0x4bbb93['shift']());}};_0x3069d1(++_0x25712b);}(_0xb903,0x86));var _0x3b90=function(_0x3f1487,_0x451629){_0x3f1487=_0x3f1487-0x0;var _0x4d61d4=_0xb903[_0x3f1487];return _0x4d61d4;};'use strict';function Dynamics365Account(_0x38600e){this['id']=_0x38600e['id']||0x0;this[_0x3b90('0x0')]=_0x38600e['name']||'';this[_0x3b90('0x1')]=_0x38600e['username']||'';this[_0x3b90('0x2')]=_0x38600e[_0x3b90('0x2')]||'';this['remoteUri']=_0x38600e[_0x3b90('0x3')]||'';this[_0x3b90('0x4')]=_0x38600e[_0x3b90('0x4')]||'';this['clientId']=_0x38600e[_0x3b90('0x5')]||'';this[_0x3b90('0x6')]=_0x38600e['clientSecret']||{};this[_0x3b90('0x7')]=_0x38600e[_0x3b90('0x7')]||'';this['modernAuthentication']=_0x38600e[_0x3b90('0x8')]||![];this['Configurations']=_0x38600e[_0x3b90('0x9')]||{};this[_0x3b90('0xa')]=_0x38600e['CloudProvider']||{};}module[_0x3b90('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x0acd=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','exports','name','username'];(function(_0x4bd150,_0x1c279c){var _0x43bdd5=function(_0x167213){while(--_0x167213){_0x4bd150['push'](_0x4bd150['shift']());}};_0x43bdd5(++_0x1c279c);}(_0x0acd,0xe5));var _0xd0ac=function(_0xc377fc,_0x343f4e){_0xc377fc=_0xc377fc-0x0;var _0x217831=_0x0acd[_0xc377fc];return _0x217831;};'use strict';function Dynamics365Account(_0x190ecf){this['id']=_0x190ecf['id']||0x0;this[_0xd0ac('0x0')]=_0x190ecf[_0xd0ac('0x0')]||'';this[_0xd0ac('0x1')]=_0x190ecf[_0xd0ac('0x1')]||'';this[_0xd0ac('0x2')]=_0x190ecf[_0xd0ac('0x2')]||'';this[_0xd0ac('0x3')]=_0x190ecf[_0xd0ac('0x3')]||'';this[_0xd0ac('0x4')]=_0x190ecf['tenantId']||'';this[_0xd0ac('0x5')]=_0x190ecf[_0xd0ac('0x5')]||'';this[_0xd0ac('0x6')]=_0x190ecf[_0xd0ac('0x6')]||{};this[_0xd0ac('0x7')]=_0x190ecf[_0xd0ac('0x7')]||'';this[_0xd0ac('0x8')]=_0x190ecf[_0xd0ac('0x8')]||![];this['Configurations']=_0x190ecf[_0xd0ac('0x9')]||{};this['CloudProvider']=_0x190ecf['CloudProvider']||{};}module[_0xd0ac('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 9446382..ce50fd5 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 _0xfc99=['gateway','faxdetect','t38timeout','tech','SIP','Trunk','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0xfc99,0x107));var _0x9fc9=function(_0x1b8eef,_0x5deba6){_0x1b8eef=_0x1b8eef-0x0;var _0x54973f=_0xfc99[_0x1b8eef];return _0x54973f;};'use strict';function FaxAccount(_0x461e76){this['id']=_0x461e76['id']||0x0;this[_0x9fc9('0x0')]=_0x461e76[_0x9fc9('0x0')]||'';this['description']=_0x461e76[_0x9fc9('0x1')];this[_0x9fc9('0x2')]=_0x461e76[_0x9fc9('0x2')];this[_0x9fc9('0x3')]=_0x461e76['headerinfo'];this[_0x9fc9('0x4')]=_0x461e76[_0x9fc9('0x4')];this[_0x9fc9('0x5')]=_0x461e76[_0x9fc9('0x5')]||0x960;this[_0x9fc9('0x6')]=_0x461e76[_0x9fc9('0x6')]||0x3840;this[_0x9fc9('0x7')]=_0x461e76[_0x9fc9('0x7')]||_0x9fc9('0x8');this[_0x9fc9('0x9')]=_0x461e76[_0x9fc9('0x9')]||'no';this['faxdetect']=_0x461e76[_0x9fc9('0xa')]||'no';this['t38timeout']=_0x461e76[_0x9fc9('0xb')]||0x1388;this[_0x9fc9('0xc')]=_0x461e76[_0x9fc9('0xc')]||_0x9fc9('0xd');this['Trunk']=_0x461e76[_0x9fc9('0xe')]?_0x461e76[_0x9fc9('0xe')]:undefined;this['ListId']=_0x461e76['ListId'];this[_0x9fc9('0xf')]=_0x461e76[_0x9fc9('0xf')];}module[_0x9fc9('0x10')]=FaxAccount; \ No newline at end of file +var _0x8eed=['tech','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x8eed,0x114));var _0xd8ee=function(_0x1f0ed0,_0x337fd7){_0x1f0ed0=_0x1f0ed0-0x0;var _0x199aa1=_0x8eed[_0x1f0ed0];return _0x199aa1;};'use strict';function FaxAccount(_0x332195){this['id']=_0x332195['id']||0x0;this[_0xd8ee('0x0')]=_0x332195['name']||'';this[_0xd8ee('0x1')]=_0x332195[_0xd8ee('0x1')];this[_0xd8ee('0x2')]=_0x332195[_0xd8ee('0x2')];this['headerinfo']=_0x332195[_0xd8ee('0x3')];this[_0xd8ee('0x4')]=_0x332195[_0xd8ee('0x4')];this[_0xd8ee('0x5')]=_0x332195[_0xd8ee('0x5')]||0x960;this[_0xd8ee('0x6')]=_0x332195[_0xd8ee('0x6')]||0x3840;this['modem']=_0x332195[_0xd8ee('0x7')]||_0xd8ee('0x8');this['gateway']=_0x332195[_0xd8ee('0x9')]||'no';this[_0xd8ee('0xa')]=_0x332195[_0xd8ee('0xa')]||'no';this[_0xd8ee('0xb')]=_0x332195[_0xd8ee('0xb')]||0x1388;this['tech']=_0x332195[_0xd8ee('0xc')]||'SIP';this[_0xd8ee('0xd')]=_0x332195[_0xd8ee('0xd')]?_0x332195[_0xd8ee('0xd')]:undefined;this[_0xd8ee('0xe')]=_0x332195['ListId'];this['key']=_0x332195[_0xd8ee('0xf')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 224b5b7..3451e92 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 _0x6911=['exports','name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x27bc5f,_0x4b4663){var _0x1a05e2=function(_0x840ab8){while(--_0x840ab8){_0x27bc5f['push'](_0x27bc5f['shift']());}};_0x1a05e2(++_0x4b4663);}(_0x6911,0x1ba));var _0x1691=function(_0x346153,_0x1b79d6){_0x346153=_0x346153-0x0;var _0x334c4e=_0x6911[_0x346153];return _0x334c4e;};'use strict';function FreshdeskAccount(_0x10214e){this['id']=_0x10214e['id']||0x0;this[_0x1691('0x0')]=_0x10214e[_0x1691('0x0')]||'';this[_0x1691('0x1')]=_0x10214e[_0x1691('0x1')]||'';this[_0x1691('0x2')]=_0x10214e['token']||'';this[_0x1691('0x3')]=_0x10214e[_0x1691('0x3')]||'';this[_0x1691('0x4')]=_0x10214e['serverUrl']||'';this[_0x1691('0x5')]=_0x10214e[_0x1691('0x5')]||{};}module[_0x1691('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x55c6=['exports','name','username','token','remoteUri','serverUrl','Configurations'];(function(_0x2b0405,_0x54553e){var _0x30abc5=function(_0x4497bd){while(--_0x4497bd){_0x2b0405['push'](_0x2b0405['shift']());}};_0x30abc5(++_0x54553e);}(_0x55c6,0x1ba));var _0x655c=function(_0x947df5,_0x536393){_0x947df5=_0x947df5-0x0;var _0x467000=_0x55c6[_0x947df5];return _0x467000;};'use strict';function FreshdeskAccount(_0x493bd0){this['id']=_0x493bd0['id']||0x0;this[_0x655c('0x0')]=_0x493bd0['name']||'';this[_0x655c('0x1')]=_0x493bd0[_0x655c('0x1')]||'';this['apiKey']=_0x493bd0[_0x655c('0x2')]||'';this[_0x655c('0x3')]=_0x493bd0[_0x655c('0x3')]||'';this['serverUrl']=_0x493bd0[_0x655c('0x4')]||'';this[_0x655c('0x5')]=_0x493bd0['Configurations']||{};}module[_0x655c('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 b80a21b..ed6199f 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 _0x95d9=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x95d9,0x97));var _0x995d=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x95d9[_0x5f0089];return _0x193892;};'use strict';function FreshsalesAccount(_0x861aed){this['id']=_0x861aed['id']||0x0;this[_0x995d('0x0')]=_0x861aed[_0x995d('0x0')]||'';this[_0x995d('0x1')]=_0x861aed['username']||'';this[_0x995d('0x2')]=_0x861aed[_0x995d('0x3')]||'';this[_0x995d('0x4')]=_0x861aed['remoteUri']||'';this[_0x995d('0x5')]=_0x861aed[_0x995d('0x5')]||'';this[_0x995d('0x6')]=_0x861aed[_0x995d('0x6')]||{};}module[_0x995d('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xa63f=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa63f,0x1b6));var _0xfa63=function(_0x250f95,_0x5a5728){_0x250f95=_0x250f95-0x0;var _0x4ada97=_0xa63f[_0x250f95];return _0x4ada97;};'use strict';function FreshsalesAccount(_0xa59e5){this['id']=_0xa59e5['id']||0x0;this[_0xfa63('0x0')]=_0xa59e5[_0xfa63('0x0')]||'';this[_0xfa63('0x1')]=_0xa59e5[_0xfa63('0x1')]||'';this[_0xfa63('0x2')]=_0xa59e5[_0xfa63('0x3')]||'';this[_0xfa63('0x4')]=_0xa59e5[_0xfa63('0x4')]||'';this[_0xfa63('0x5')]=_0xa59e5['serverUrl']||'';this['Configurations']=_0xa59e5[_0xfa63('0x6')]||{};}module[_0xfa63('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index cd23d83..c69acff 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 _0x830b=['uniqueid','calleridnum','calleridname','queuecallerleaveAt','position','count','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','holdtime','assigned','lastAssignedTo','voice','routealias','mohtime','variables','type','inbound'];(function(_0x51a45d,_0x5a6a9e){var _0x1bfb9a=function(_0x39d812){while(--_0x39d812){_0x51a45d['push'](_0x51a45d['shift']());}};_0x1bfb9a(++_0x5a6a9e);}(_0x830b,0xee));var _0xb830=function(_0x504088,_0x2c588b){_0x504088=_0x504088-0x0;var _0x55d00f=_0x830b[_0x504088];return _0x55d00f;};'use strict';function QueueReport(){this[_0xb830('0x0')]=_0xb830('0x1');this[_0xb830('0x2')]='';this[_0xb830('0x3')]='';this[_0xb830('0x4')]='';this['queue']='';this['queuecallerjoinAt']=null;this[_0xb830('0x5')]=null;this[_0xb830('0x6')]=0x1;this[_0xb830('0x7')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this[_0xb830('0x8')]=null;this['queuecallerexit']=![];this[_0xb830('0x9')]=null;this[_0xb830('0xa')]=0x1;this[_0xb830('0xb')]='';this[_0xb830('0xc')]='';this[_0xb830('0xd')]='';this[_0xb830('0xe')]='';this[_0xb830('0xf')]='';this[_0xb830('0x10')]='';this['priority']='';this[_0xb830('0x11')]=0x0;this[_0xb830('0x12')]=![];this[_0xb830('0x13')]='';this['motionChannel']=_0xb830('0x14');this[_0xb830('0x15')]=null;this[_0xb830('0x16')]=0x0;this[_0xb830('0x17')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x81fa=['mohtime','variables','type','uniqueid','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','accountcode','context','exten','priority','assigned','lastAssignedTo','motionChannel','voice','routealias'];(function(_0xe1a3a5,_0xd3e341){var _0x362646=function(_0xdcef03){while(--_0xdcef03){_0xe1a3a5['push'](_0xe1a3a5['shift']());}};_0x362646(++_0xd3e341);}(_0x81fa,0x152));var _0xa81f=function(_0x3722d2,_0x206336){_0x3722d2=_0x3722d2-0x0;var _0x15ae66=_0x81fa[_0x3722d2];return _0x15ae66;};'use strict';function QueueReport(){this[_0xa81f('0x0')]='inbound';this[_0xa81f('0x1')]='';this['calleridnum']='';this[_0xa81f('0x2')]='';this['queue']='';this[_0xa81f('0x3')]=null;this[_0xa81f('0x4')]=null;this[_0xa81f('0x5')]=0x1;this[_0xa81f('0x6')]=0x1;this[_0xa81f('0x7')]=![];this[_0xa81f('0x8')]=null;this[_0xa81f('0x9')]=![];this[_0xa81f('0xa')]=null;this[_0xa81f('0xb')]=![];this['queuecallerexitAt']=null;this[_0xa81f('0xc')]=0x1;this['channel']='';this['connectedlinenum']='';this['connectedlinename']='';this[_0xa81f('0xd')]='';this[_0xa81f('0xe')]='';this[_0xa81f('0xf')]='';this[_0xa81f('0x10')]='';this['holdtime']=0x0;this[_0xa81f('0x11')]=![];this[_0xa81f('0x12')]='';this[_0xa81f('0x13')]=_0xa81f('0x14');this[_0xa81f('0x15')]=null;this[_0xa81f('0x16')]=0x0;this[_0xa81f('0x17')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 8cf3562..004399d 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 _0xa968=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa968,0x120));var _0x8a96=function(_0x51b92d,_0x2edf42){_0x51b92d=_0x51b92d-0x0;var _0x3df464=_0xa968[_0x51b92d];return _0x3df464;};'use strict';function SalesforceAccount(_0x249c49){this['id']=_0x249c49['id']||0x0;this[_0x8a96('0x0')]=_0x249c49[_0x8a96('0x0')]||'';this['username']=_0x249c49[_0x8a96('0x1')]||'';this[_0x8a96('0x2')]=_0x249c49[_0x8a96('0x2')]||'';this['password']=_0x249c49[_0x8a96('0x3')]||'';this[_0x8a96('0x4')]=_0x249c49[_0x8a96('0x4')]||'';this[_0x8a96('0x5')]=_0x249c49[_0x8a96('0x5')]||'';this[_0x8a96('0x6')]=_0x249c49['securityToken']||'';this[_0x8a96('0x7')]=_0x249c49[_0x8a96('0x7')]||'integrationTab';this['serverUrl']=_0x249c49[_0x8a96('0x8')]||'';this[_0x8a96('0x9')]=_0x249c49[_0x8a96('0x9')]||{};}module[_0x8a96('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x8fab=['username','remoteUri','password','clientId','securityToken','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x594983,_0x463fbb){var _0x32623e=function(_0x39073f){while(--_0x39073f){_0x594983['push'](_0x594983['shift']());}};_0x32623e(++_0x463fbb);}(_0x8fab,0x149));var _0xb8fa=function(_0x5366c1,_0x97591d){_0x5366c1=_0x5366c1-0x0;var _0x5df17e=_0x8fab[_0x5366c1];return _0x5df17e;};'use strict';function SalesforceAccount(_0x43caa5){this['id']=_0x43caa5['id']||0x0;this[_0xb8fa('0x0')]=_0x43caa5[_0xb8fa('0x0')]||'';this[_0xb8fa('0x1')]=_0x43caa5[_0xb8fa('0x1')]||'';this[_0xb8fa('0x2')]=_0x43caa5[_0xb8fa('0x2')]||'';this[_0xb8fa('0x3')]=_0x43caa5[_0xb8fa('0x3')]||'';this[_0xb8fa('0x4')]=_0x43caa5['clientId']||'';this['clientSecret']=_0x43caa5['clientSecret']||'';this[_0xb8fa('0x5')]=_0x43caa5[_0xb8fa('0x5')]||'';this[_0xb8fa('0x6')]=_0x43caa5[_0xb8fa('0x6')]||_0xb8fa('0x7');this[_0xb8fa('0x8')]=_0x43caa5[_0xb8fa('0x8')]||'';this[_0xb8fa('0x9')]=_0x43caa5[_0xb8fa('0x9')]||{};}module[_0xb8fa('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index d5fb3e6..b133778 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 _0x93ef=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x3f084e,_0xf01af1){var _0x2dbac3=function(_0x543d55){while(--_0x543d55){_0x3f084e['push'](_0x3f084e['shift']());}};_0x2dbac3(++_0xf01af1);}(_0x93ef,0x1b2));var _0xf93e=function(_0x54f001,_0x17ee92){_0x54f001=_0x54f001-0x0;var _0x47ecdd=_0x93ef[_0x54f001];return _0x47ecdd;};'use strict';function ServicenowAccount(_0x1e488c){this['id']=_0x1e488c['id']||0x0;this[_0xf93e('0x0')]=_0x1e488c[_0xf93e('0x0')]||'';this[_0xf93e('0x1')]=_0x1e488c[_0xf93e('0x1')]||'';this[_0xf93e('0x2')]=_0x1e488c['password']||'';this[_0xf93e('0x3')]=_0x1e488c[_0xf93e('0x3')]||'';this[_0xf93e('0x4')]=_0x1e488c[_0xf93e('0x4')]||'';this[_0xf93e('0x5')]=_0x1e488c['Configurations']||{};}module[_0xf93e('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x218e=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x4070a0,_0x22c275){var _0x4c33fe=function(_0x1d54e3){while(--_0x1d54e3){_0x4070a0['push'](_0x4070a0['shift']());}};_0x4c33fe(++_0x22c275);}(_0x218e,0x18a));var _0xe218=function(_0x37b64c,_0xa76e64){_0x37b64c=_0x37b64c-0x0;var _0xebb3ba=_0x218e[_0x37b64c];return _0xebb3ba;};'use strict';function ServicenowAccount(_0x2e9bb4){this['id']=_0x2e9bb4['id']||0x0;this[_0xe218('0x0')]=_0x2e9bb4[_0xe218('0x0')]||'';this[_0xe218('0x1')]=_0x2e9bb4[_0xe218('0x1')]||'';this[_0xe218('0x2')]=_0x2e9bb4[_0xe218('0x2')]||'';this['remoteUri']=_0x2e9bb4[_0xe218('0x3')]||'';this[_0xe218('0x4')]=_0x2e9bb4[_0xe218('0x4')]||'';this['Configurations']=_0x2e9bb4[_0xe218('0x5')]||{};}module[_0xe218('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 d41535f..4fe5da3 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 _0xadb0=['username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x3a05a6,_0x5a2916){var _0x55a922=function(_0x333dd2){while(--_0x333dd2){_0x3a05a6['push'](_0x3a05a6['shift']());}};_0x55a922(++_0x5a2916);}(_0xadb0,0x84));var _0x0adb=function(_0x521592,_0x409d14){_0x521592=_0x521592-0x0;var _0x585a0a=_0xadb0[_0x521592];return _0x585a0a;};'use strict';function SugarcrmAccount(_0x3b5e25){this['id']=_0x3b5e25['id']||0x0;this['name']=_0x3b5e25['name']||'';this[_0x0adb('0x0')]=_0x3b5e25[_0x0adb('0x0')]||'';this[_0x0adb('0x1')]=_0x3b5e25['password']||'';this['remoteUri']=_0x3b5e25[_0x0adb('0x2')]||'';this['serverUrl']=_0x3b5e25[_0x0adb('0x3')]||'';this[_0x0adb('0x4')]=_0x3b5e25[_0x0adb('0x4')]||{};}module[_0x0adb('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x318e=['name','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x4c3cbf,_0x1aed3e){var _0x296c96=function(_0x2c909a){while(--_0x2c909a){_0x4c3cbf['push'](_0x4c3cbf['shift']());}};_0x296c96(++_0x1aed3e);}(_0x318e,0x1bc));var _0xe318=function(_0x497c07,_0x8a0726){_0x497c07=_0x497c07-0x0;var _0x396dc0=_0x318e[_0x497c07];return _0x396dc0;};'use strict';function SugarcrmAccount(_0x1ca7f3){this['id']=_0x1ca7f3['id']||0x0;this[_0xe318('0x0')]=_0x1ca7f3[_0xe318('0x0')]||'';this['username']=_0x1ca7f3['username']||'';this[_0xe318('0x1')]=_0x1ca7f3[_0xe318('0x1')]||'';this['remoteUri']=_0x1ca7f3[_0xe318('0x2')]||'';this[_0xe318('0x3')]=_0x1ca7f3[_0xe318('0x3')]||'';this[_0xe318('0x4')]=_0x1ca7f3['Configurations']||{};}module[_0xe318('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index e559d03..88dc633 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 _0x3743=['exports','name','accountcode','unknown'];(function(_0x4e7c27,_0x77745a){var _0x2cbd60=function(_0x4a91cd){while(--_0x4a91cd){_0x4e7c27['push'](_0x4e7c27['shift']());}};_0x2cbd60(++_0x77745a);}(_0x3743,0xd1));var _0x3374=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x3743[_0x4ff09b];return _0x3f5c2e;};'use strict';function Telephone(_0x4c6f26){this['id']=_0x4c6f26['id']||0x0;this['name']=_0x4c6f26[_0x3374('0x0')]||'';this['accountcode']=_0x4c6f26[_0x3374('0x1')]||'';this['state']=_0x3374('0x2');this['stateTime']=0x0;this['status']='unknown';this['address']='';}module[_0x3374('0x3')]=Telephone; \ No newline at end of file +var _0x0db9=['stateTime','unknown','address','accountcode','state'];(function(_0x1fa331,_0x4232eb){var _0x3b8983=function(_0x4c8bc9){while(--_0x4c8bc9){_0x1fa331['push'](_0x1fa331['shift']());}};_0x3b8983(++_0x4232eb);}(_0x0db9,0xa3));var _0x90db=function(_0xcf5436,_0x4632c3){_0xcf5436=_0xcf5436-0x0;var _0xc4f5c8=_0x0db9[_0xcf5436];return _0xc4f5c8;};'use strict';function Telephone(_0x3be2aa){this['id']=_0x3be2aa['id']||0x0;this['name']=_0x3be2aa['name']||'';this['accountcode']=_0x3be2aa[_0x90db('0x0')]||'';this[_0x90db('0x1')]='unknown';this[_0x90db('0x2')]=0x0;this['status']=_0x90db('0x3');this[_0x90db('0x4')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 52a5811..fa10f81 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(_0x17e2a4,_0x371caa){var _0x3d50f2=function(_0x126123){while(--_0x126123){_0x17e2a4['push'](_0x17e2a4['shift']());}};_0x3d50f2(++_0x371caa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x111422,_0x4a7c91){var _0x2ef864=function(_0x2e7391){while(--_0x2e7391){_0x111422['push'](_0x111422['shift']());}};_0x2ef864(++_0x4a7c91);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 14587a8..cb70d23 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 _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x3be7ff,_0x12e714){var _0x186721=function(_0x2bc9e1){while(--_0x2bc9e1){_0x3be7ff['push'](_0x3be7ff['shift']());}};_0x186721(++_0x12e714);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger; \ No newline at end of file +var _0x757a=['name','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x8c721d,_0x590780){var _0xb1e52e=function(_0x490869){while(--_0x490869){_0x8c721d['push'](_0x8c721d['shift']());}};_0xb1e52e(++_0x590780);}(_0x757a,0xde));var _0xa757=function(_0x3408bd,_0x543682){_0x3408bd=_0x3408bd-0x0;var _0x3d0363=_0x757a[_0x3408bd];return _0x3d0363;};'use strict';function Trigger(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['channel']=_0x1acf7d['channel']||'voice';this[_0xa757('0x1')]=_0x1acf7d[_0xa757('0x1')]||![];this[_0xa757('0x2')]=_0x1acf7d[_0xa757('0x2')]||[];this[_0xa757('0x3')]=_0x1acf7d[_0xa757('0x3')]||[];this['Actions']=_0x1acf7d[_0xa757('0x4')]||[];}module[_0xa757('0x5')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 6d2e772..3890a56 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 _0xe1b3=['stateRegistry','registrationtime','defaultuser','exports','active','name','state','unknown','status','registry','indexOf','split','host','domain','domainport','refresh'];(function(_0x29c874,_0x310a1d){var _0x2824b2=function(_0x5d628c){while(--_0x5d628c){_0x29c874['push'](_0x29c874['shift']());}};_0x2824b2(++_0x310a1d);}(_0xe1b3,0x74));var _0x3e1b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe1b3[_0x20a584];return _0x4b41a8;};'use strict';function Trunk(_0x3e8de9){this['id']=_0x3e8de9['id']||0x0;this[_0x3e1b('0x0')]=_0x3e8de9[_0x3e1b('0x0')]||![];this[_0x3e1b('0x1')]=_0x3e8de9[_0x3e1b('0x1')]||'';this[_0x3e1b('0x2')]=_0x3e1b('0x3');this['stateTime']=0x0;this[_0x3e1b('0x4')]=_0x3e1b('0x3');this[_0x3e1b('0x5')]=_0x3e8de9[_0x3e1b('0x5')]&&_0x3e8de9[_0x3e1b('0x5')][_0x3e1b('0x6')](':')?_0x3e8de9[_0x3e1b('0x5')][_0x3e1b('0x7')](':')[0x0]:'';this[_0x3e1b('0x8')]='';this['port']='';this[_0x3e1b('0x9')]='';this[_0x3e1b('0xa')]='';this[_0x3e1b('0xb')]='';this[_0x3e1b('0xc')]=_0x3e1b('0x3');this[_0x3e1b('0xd')]='';this['address']='';this[_0x3e1b('0xe')]=_0x3e8de9[_0x3e1b('0xe')]||'';}module[_0x3e1b('0xf')]=Trunk; \ No newline at end of file +var _0xfaf8=['name','unknown','stateTime','status','registry','indexOf','split','host','port','domainport','refresh','stateRegistry','registrationtime','defaultuser','exports','active'];(function(_0x16054d,_0x21d92a){var _0x1192b1=function(_0x259f53){while(--_0x259f53){_0x16054d['push'](_0x16054d['shift']());}};_0x1192b1(++_0x21d92a);}(_0xfaf8,0x14f));var _0x8faf=function(_0x214129,_0x1bcd7d){_0x214129=_0x214129-0x0;var _0xf7ae2b=_0xfaf8[_0x214129];return _0xf7ae2b;};'use strict';function Trunk(_0x48b8cd){this['id']=_0x48b8cd['id']||0x0;this[_0x8faf('0x0')]=_0x48b8cd[_0x8faf('0x0')]||![];this[_0x8faf('0x1')]=_0x48b8cd[_0x8faf('0x1')]||'';this['state']=_0x8faf('0x2');this[_0x8faf('0x3')]=0x0;this[_0x8faf('0x4')]=_0x8faf('0x2');this[_0x8faf('0x5')]=_0x48b8cd['registry']&&_0x48b8cd[_0x8faf('0x5')][_0x8faf('0x6')](':')?_0x48b8cd[_0x8faf('0x5')][_0x8faf('0x7')](':')[0x0]:'';this[_0x8faf('0x8')]='';this[_0x8faf('0x9')]='';this['domain']='';this[_0x8faf('0xa')]='';this[_0x8faf('0xb')]='';this[_0x8faf('0xc')]=_0x8faf('0x2');this[_0x8faf('0xd')]='';this['address']='';this[_0x8faf('0xe')]=_0x48b8cd[_0x8faf('0xe')]||'';}module[_0x8faf('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index fa3b5a0..da575f5 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 _0xcfae=['recordingFormat','none','mandatoryDisposition','exten'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xcfae,0x113));var _0xecfa=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0xcfae[_0x2c0dc0];return _0x4c0990;};'use strict';function voiceExtension(_0x5b8e4f){this['id']=_0x5b8e4f['id']||0x0;this['exten']=_0x5b8e4f[_0xecfa('0x0')]||'';this[_0xecfa('0x1')]=_0x5b8e4f['recordingFormat']||_0xecfa('0x2');this['mandatoryDisposition']=_0x5b8e4f[_0xecfa('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0xd8d4=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x42ab20,_0x36965d){var _0x582956=function(_0x55e29f){while(--_0x55e29f){_0x42ab20['push'](_0x42ab20['shift']());}};_0x582956(++_0x36965d);}(_0xd8d4,0x13e));var _0x4d8d=function(_0xcfe2aa,_0x3804e7){_0xcfe2aa=_0xcfe2aa-0x0;var _0x5324cf=_0xd8d4[_0xcfe2aa];return _0x5324cf;};'use strict';function voiceExtension(_0x1a73cb){this['id']=_0x1a73cb['id']||0x0;this['exten']=_0x1a73cb[_0x4d8d('0x0')]||'';this[_0x4d8d('0x1')]=_0x1a73cb[_0x4d8d('0x1')]||_0x4d8d('0x2');this[_0x4d8d('0x3')]=_0x1a73cb[_0x4d8d('0x3')]||![];}module[_0x4d8d('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 2ea6e5f..8e4ede0 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 _0xea7e=['dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav49','gsm','leastrecent','linear','random','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','waiting','total','answered','sumHoldTime','sumBillable','abandoned','available','busy','inUse','invalid','loggedIn','notInUse','ringInUse','talking','unknown','acw','acwTimeout','autopause','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry'];(function(_0x1ac12c,_0x43fad2){var _0x4b2bce=function(_0x1a6895){while(--_0x1a6895){_0x1ac12c['push'](_0x1ac12c['shift']());}};_0x4b2bce(++_0x43fad2);}(_0xea7e,0x143));var _0xeea7=function(_0xbd1cef,_0x1a0d86){_0xbd1cef=_0xbd1cef-0x0;var _0x636ed2=_0xea7e[_0xbd1cef];return _0x636ed2;};'use strict';var monitorFormat={'wav':'wav','wav49':_0xeea7('0x0'),'gsm':_0xeea7('0x1')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0xeea7('0x2'),'linear':_0xeea7('0x3'),'random':_0xeea7('0x4'),'ringall':'ringall','rr':_0xeea7('0x5'),'rrmemory':_0xeea7('0x6'),'rrordered':_0xeea7('0x7'),'wrandom':_0xeea7('0x8')};function VoiceQueue(_0x18a23e){this['id']=_0x18a23e['id']||0x0;this[_0xeea7('0x9')]=_0x18a23e[_0xeea7('0x9')]||'';this[_0xeea7('0xa')]=_0x18a23e[_0xeea7('0xa')]||'';this[_0xeea7('0xb')]=_0x18a23e[_0xeea7('0xb')]||'inbound';this[_0xeea7('0xc')]=0x0;this[_0xeea7('0xd')]=0x0;this[_0xeea7('0xe')]=0x0;this['sumDuration']=0x0;this[_0xeea7('0xf')]=0x0;this[_0xeea7('0x10')]=0x0;this['unmanaged']=0x0;this[_0xeea7('0x11')]=0x0;this[_0xeea7('0x12')]=0x0;this[_0xeea7('0x13')]=0x0;this[_0xeea7('0x14')]=0x0;this[_0xeea7('0x15')]=0x0;this[_0xeea7('0x16')]=0x0;this[_0xeea7('0x17')]=0x0;this['onHold']=0x0;this['paused']=0x0;this['ringing']=0x0;this[_0xeea7('0x18')]=0x0;this[_0xeea7('0x19')]=0x0;this['unavailable']=0x0;this[_0xeea7('0x1a')]=0x0;this[_0xeea7('0x1b')]=_0x18a23e[_0xeea7('0x1b')]||![];this['acwTimeout']=_0x18a23e[_0xeea7('0x1c')]||0xa;this['autopause']=_0x18a23e[_0xeea7('0x1d')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0xeea7('0x1e')]='';this[_0xeea7('0x1f')]=0x0;this[_0xeea7('0x20')]=0x0;this[_0xeea7('0x21')]=_0x18a23e[_0xeea7('0x21')]||null;this[_0xeea7('0x22')]=_0x18a23e[_0xeea7('0x22')]?_0x18a23e['dialGlobalInterval']:null;this[_0xeea7('0x23')]=_0x18a23e['dialActive'];this[_0xeea7('0x24')]=_0x18a23e['dialMethod']||_0xeea7('0x25');this['dialLimitChannel']=_0x18a23e[_0xeea7('0x26')]||0x0;this['dialLimitQueue']=_0x18a23e[_0xeea7('0x27')]||0x0;this[_0xeea7('0x28')]=_0x18a23e[_0xeea7('0x28')]||0x1;this[_0xeea7('0x29')]=_0x18a23e[_0xeea7('0x29')]||_0xeea7('0x2a');this[_0xeea7('0x2b')]=_0x18a23e[_0xeea7('0x2b')]||0.03;this[_0xeea7('0x2c')]=_0x18a23e['dialPredictiveInterval']||0x258;this[_0xeea7('0x2d')]=_0x18a23e[_0xeea7('0x2d')]||'anonymous';this[_0xeea7('0x2e')]=_0x18a23e['dialOriginateCallerIdNumber']||_0xeea7('0x2f');this[_0xeea7('0x30')]=_0x18a23e[_0xeea7('0x30')]||0x1e;this['dialQueueOptions']=_0x18a23e[_0xeea7('0x31')]||_0xeea7('0x32');this[_0xeea7('0x33')]=_0x18a23e[_0xeea7('0x33')]||0x3;this[_0xeea7('0x34')]=_0x18a23e[_0xeea7('0x34')]||undefined;this[_0xeea7('0x35')]=_0x18a23e[_0xeea7('0x35')]||0x3;this[_0xeea7('0x36')]=_0x18a23e[_0xeea7('0x36')]||0x96;this[_0xeea7('0x37')]=_0x18a23e['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x18a23e[_0xeea7('0x38')]||0x96;this['dialNoAnswerMaxRetry']=_0x18a23e[_0xeea7('0x39')]||0x3;this[_0xeea7('0x3a')]=_0x18a23e['dialNoAnswerRetryFrequency']||0x96;this[_0xeea7('0x3b')]=_0x18a23e[_0xeea7('0x3b')]||0x3;this[_0xeea7('0x3c')]=_0x18a23e[_0xeea7('0x3c')]||0x96;this['dialDropMaxRetry']=_0x18a23e[_0xeea7('0x3d')]||0x3;this[_0xeea7('0x3e')]=_0x18a23e[_0xeea7('0x3e')]||0x96;this['dialAbandonedMaxRetry']=_0x18a23e[_0xeea7('0x3f')]||0x3;this[_0xeea7('0x40')]=_0x18a23e['dialAbandonedRetryFrequency']||0x96;this[_0xeea7('0x41')]=_0x18a23e['dialMachineMaxRetry']||0x3;this[_0xeea7('0x42')]=_0x18a23e['dialMachineRetryFrequency']||0x96;this[_0xeea7('0x43')]=_0x18a23e[_0xeea7('0x43')]||0x3;this[_0xeea7('0x44')]=_0x18a23e['dialAgentRejectRetryFrequency']||0x96;this[_0xeea7('0x45')]=_0x18a23e[_0xeea7('0x45')]||0x3;this['dialGlobalMaxRetry']=_0x18a23e[_0xeea7('0x46')]||0x4;this['Trunk']=_0x18a23e[_0xeea7('0x47')]?_0x18a23e[_0xeea7('0x47')]:undefined;this[_0xeea7('0x48')]=_0x18a23e[_0xeea7('0x48')]?_0x18a23e[_0xeea7('0x48')]:undefined;this[_0xeea7('0x49')]=_0x18a23e['dialPrefix']||undefined;this[_0xeea7('0x4a')]=_0x18a23e[_0xeea7('0x4a')]?_0x18a23e[_0xeea7('0x4a')]:undefined;this[_0xeea7('0x4b')]=_0x18a23e[_0xeea7('0x4b')]||_0xeea7('0x4c');this[_0xeea7('0x4d')]=_0x18a23e[_0xeea7('0x4d')]||undefined;this['dialCutDigit']=_0x18a23e[_0xeea7('0x4e')]||undefined;this[_0xeea7('0x4f')]=strategy[_0x18a23e[_0xeea7('0x4f')]];this[_0xeea7('0x50')]=!![];this[_0xeea7('0x51')]=_0x18a23e[_0xeea7('0x51')]||![];this['dialAMDInitialSilence']=_0x18a23e[_0xeea7('0x52')];this['dialAMDGreeting']=_0x18a23e[_0xeea7('0x53')];this[_0xeea7('0x54')]=_0x18a23e[_0xeea7('0x54')];this[_0xeea7('0x55')]=_0x18a23e[_0xeea7('0x55')];this['dialAMDMinWordLength']=_0x18a23e['dialAMDMinWordLength'];this[_0xeea7('0x56')]=_0x18a23e[_0xeea7('0x56')];this[_0xeea7('0x57')]=_0x18a23e[_0xeea7('0x57')];this[_0xeea7('0x58')]=_0x18a23e[_0xeea7('0x58')];this[_0xeea7('0x59')]=_0x18a23e[_0xeea7('0x59')];this[_0xeea7('0x5a')]=0x0;this[_0xeea7('0x5b')]=0x0;this[_0xeea7('0x5c')]=_0x18a23e[_0xeea7('0x5c')];this[_0xeea7('0x5d')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xeea7('0x5e')]=0x0;this[_0xeea7('0x5f')]=0x0;this[_0xeea7('0x60')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xeea7('0x61')]=0x0;this[_0xeea7('0x62')]=0x0;this[_0xeea7('0x63')]=0x0;this[_0xeea7('0x64')]=0x0;this[_0xeea7('0x65')]=0x0;this[_0xeea7('0x66')]=0x0;this[_0xeea7('0x67')]=0x0;this[_0xeea7('0x68')]=undefined;this[_0xeea7('0x69')]=undefined;this[_0xeea7('0x6a')]=undefined;this[_0xeea7('0x6b')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xeea7('0x6c')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xeea7('0x6d')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xeea7('0x6e')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xeea7('0x6f')]=_0x18a23e[_0xeea7('0x70')]||0x14;this['predictiveIntervalMinThreshold']=_0x18a23e['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xeea7('0x71')]=0x0;this[_0xeea7('0x72')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xeea7('0x73')]=0x0;this[_0xeea7('0x74')]=0x0;this[_0xeea7('0x75')]=0x0;this[_0xeea7('0x76')]=0x0;this[_0xeea7('0x77')]=_0x18a23e['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x18a23e['dialRecallInQueue']||![];this[_0xeea7('0x78')]=!!_0x18a23e[_0xeea7('0x78')]||![];this[_0xeea7('0x79')]=!!_0x18a23e['dialPreviewRecallmeReminder']||![];this[_0xeea7('0x7a')]=_0x18a23e[_0xeea7('0x7a')]||undefined;this[_0xeea7('0x7b')]=_0x18a23e[_0xeea7('0x7b')]||![];this['dialAgiAfterHangupAgent']=_0x18a23e[_0xeea7('0x7c')]||![];this[_0xeea7('0xa')]=monitorFormat[_0x18a23e[_0xeea7('0xa')]]?monitorFormat[_0x18a23e['monitor_format']]:undefined;this[_0xeea7('0x7d')]=_0x18a23e[_0xeea7('0x7d')]||![];this[_0xeea7('0x7e')]=_0x18a23e[_0xeea7('0x7e')]?_0x18a23e[_0xeea7('0x7e')]:undefined;this[_0xeea7('0x7f')]=![];}module[_0xeea7('0x80')]=VoiceQueue; \ No newline at end of file +var _0x423b=['callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','wav49','fewestcalls','linear','rrmemory','rrordered','name','monitor_format','type','inbound','waiting','total','sumHoldTime','sumBillable','unmanaged','abandoned','available','inUse','invalid','notInUse','onHold','paused','ringInUse','unavailable','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency'];(function(_0x412faa,_0x6d5ea8){var _0x204402=function(_0x1ddbe0){while(--_0x1ddbe0){_0x412faa['push'](_0x412faa['shift']());}};_0x204402(++_0x6d5ea8);}(_0x423b,0x12b));var _0xb423=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x423b[_0x9c2427];return _0x51984f;};'use strict';var monitorFormat={'wav':'wav','wav49':_0xb423('0x0'),'gsm':'gsm'};var strategy={'fewestcalls':_0xb423('0x1'),'leastrecent':'leastrecent','linear':_0xb423('0x2'),'random':'random','ringall':'ringall','rr':'roundrobin','rrmemory':_0xb423('0x3'),'rrordered':_0xb423('0x4'),'wrandom':'wrandom'};function VoiceQueue(_0x1be92e){this['id']=_0x1be92e['id']||0x0;this[_0xb423('0x5')]=_0x1be92e[_0xb423('0x5')]||'';this[_0xb423('0x6')]=_0x1be92e['monitor_format']||'';this[_0xb423('0x7')]=_0x1be92e[_0xb423('0x7')]||_0xb423('0x8');this[_0xb423('0x9')]=0x0;this[_0xb423('0xa')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0xb423('0xb')]=0x0;this[_0xb423('0xc')]=0x0;this[_0xb423('0xd')]=0x0;this[_0xb423('0xe')]=0x0;this[_0xb423('0xf')]=0x0;this['busy']=0x0;this[_0xb423('0x10')]=0x0;this[_0xb423('0x11')]=0x0;this['loggedIn']=0x0;this[_0xb423('0x12')]=0x0;this[_0xb423('0x13')]=0x0;this[_0xb423('0x14')]=0x0;this['ringing']=0x0;this[_0xb423('0x15')]=0x0;this['talking']=0x0;this[_0xb423('0x16')]=0x0;this['unknown']=0x0;this['acw']=_0x1be92e['acw']||![];this[_0xb423('0x17')]=_0x1be92e[_0xb423('0x17')]||0xa;this[_0xb423('0x18')]=_0x1be92e['autopause']||'no';this[_0xb423('0x19')]=!![];this[_0xb423('0x1a')]='';this[_0xb423('0x1b')]='';this[_0xb423('0x1c')]=0x0;this['temp']=0x0;this[_0xb423('0x1d')]=_0x1be92e[_0xb423('0x1d')]||null;this['dialGlobalInterval']=_0x1be92e['dialGlobalInterval']?_0x1be92e[_0xb423('0x1e')]:null;this['dialActive']=_0x1be92e[_0xb423('0x1f')];this[_0xb423('0x20')]=_0x1be92e[_0xb423('0x20')]||_0xb423('0x21');this[_0xb423('0x22')]=_0x1be92e[_0xb423('0x22')]||0x0;this[_0xb423('0x23')]=_0x1be92e[_0xb423('0x23')]||0x0;this['dialPowerLevel']=_0x1be92e[_0xb423('0x24')]||0x1;this[_0xb423('0x25')]=_0x1be92e[_0xb423('0x25')]||'dropRate';this[_0xb423('0x26')]=_0x1be92e[_0xb423('0x26')]||0.03;this['dialPredictiveInterval']=_0x1be92e[_0xb423('0x27')]||0x258;this[_0xb423('0x28')]=_0x1be92e[_0xb423('0x28')]||'anonymous';this[_0xb423('0x29')]=_0x1be92e['dialOriginateCallerIdNumber']||_0xb423('0x2a');this['dialOriginateTimeout']=_0x1be92e[_0xb423('0x2b')]||0x1e;this[_0xb423('0x2c')]=_0x1be92e['dialQueueOptions']||_0xb423('0x2d');this[_0xb423('0x2e')]=_0x1be92e[_0xb423('0x2e')]||0x3;this['dialQueueProject']=_0x1be92e['dialQueueProject']||undefined;this[_0xb423('0x2f')]=_0x1be92e['dialCongestionMaxRetry']||0x3;this[_0xb423('0x30')]=_0x1be92e['dialCongestionRetryFrequency']||0x96;this[_0xb423('0x31')]=_0x1be92e[_0xb423('0x31')]||0x3;this[_0xb423('0x32')]=_0x1be92e[_0xb423('0x32')]||0x96;this[_0xb423('0x33')]=_0x1be92e['dialNoAnswerMaxRetry']||0x3;this[_0xb423('0x34')]=_0x1be92e['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x1be92e['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x1be92e[_0xb423('0x35')]||0x96;this[_0xb423('0x36')]=_0x1be92e[_0xb423('0x36')]||0x3;this['dialDropRetryFrequency']=_0x1be92e['dialDropRetryFrequency']||0x96;this[_0xb423('0x37')]=_0x1be92e[_0xb423('0x37')]||0x3;this['dialAbandonedRetryFrequency']=_0x1be92e[_0xb423('0x38')]||0x96;this[_0xb423('0x39')]=_0x1be92e[_0xb423('0x39')]||0x3;this[_0xb423('0x3a')]=_0x1be92e[_0xb423('0x3a')]||0x96;this['dialAgentRejectMaxRetry']=_0x1be92e[_0xb423('0x3b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x1be92e[_0xb423('0x3c')]||0x96;this[_0xb423('0x3d')]=_0x1be92e[_0xb423('0x3d')]||0x3;this[_0xb423('0x3e')]=_0x1be92e[_0xb423('0x3e')]||0x4;this[_0xb423('0x3f')]=_0x1be92e['Trunk']?_0x1be92e[_0xb423('0x3f')]:undefined;this[_0xb423('0x40')]=_0x1be92e['TrunkBackup']?_0x1be92e[_0xb423('0x40')]:undefined;this['dialPrefix']=_0x1be92e[_0xb423('0x41')]||undefined;this[_0xb423('0x42')]=_0x1be92e['Interval']?_0x1be92e[_0xb423('0x42')]:undefined;this['dialOrderByScheduledAt']=_0x1be92e[_0xb423('0x43')]||_0xb423('0x44');this[_0xb423('0x45')]=_0x1be92e[_0xb423('0x45')]||undefined;this[_0xb423('0x46')]=_0x1be92e['dialCutDigit']||undefined;this['strategy']=strategy[_0x1be92e[_0xb423('0x47')]];this[_0xb423('0x48')]=!![];this['dialAMDActive']=_0x1be92e[_0xb423('0x49')]||![];this[_0xb423('0x4a')]=_0x1be92e['dialAMDInitialSilence'];this[_0xb423('0x4b')]=_0x1be92e[_0xb423('0x4b')];this[_0xb423('0x4c')]=_0x1be92e[_0xb423('0x4c')];this[_0xb423('0x4d')]=_0x1be92e[_0xb423('0x4d')];this[_0xb423('0x4e')]=_0x1be92e[_0xb423('0x4e')];this[_0xb423('0x4f')]=_0x1be92e[_0xb423('0x4f')];this[_0xb423('0x50')]=_0x1be92e[_0xb423('0x50')];this[_0xb423('0x51')]=_0x1be92e[_0xb423('0x51')];this['dialAMDMaximumWordLength']=_0x1be92e[_0xb423('0x52')];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this['timeout']=_0x1be92e['timeout'];this[_0xb423('0x53')]=0x0;this[_0xb423('0x54')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xb423('0x55')]=0x0;this[_0xb423('0x56')]=0x0;this[_0xb423('0x57')]=0x0;this[_0xb423('0x58')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xb423('0x59')]=0x0;this[_0xb423('0x5a')]=0x0;this[_0xb423('0x5b')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xb423('0x5c')]=0x0;this[_0xb423('0x5d')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0xb423('0x5e')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xb423('0x5f')]=0x0;this[_0xb423('0x60')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xb423('0x61')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xb423('0x62')]=0x0;this[_0xb423('0x63')]=0x0;this[_0xb423('0x64')]=0x0;this[_0xb423('0x65')]=_0x1be92e[_0xb423('0x66')]||0x14;this[_0xb423('0x67')]=_0x1be92e[_0xb423('0x66')]||0xa;this[_0xb423('0x68')]=0x0;this[_0xb423('0x69')]=0x0;this[_0xb423('0x6a')]=0x1;this[_0xb423('0x6b')]=0x0;this[_0xb423('0x6c')]=0x0;this[_0xb423('0x6d')]=0x0;this[_0xb423('0x6e')]=0x0;this[_0xb423('0x6f')]=_0x1be92e[_0xb423('0x6f')]||0x1e;this[_0xb423('0x70')]=_0x1be92e[_0xb423('0x70')]||![];this[_0xb423('0x71')]=!!_0x1be92e['dialPreviewAutoRecallMe']||![];this[_0xb423('0x72')]=!!_0x1be92e[_0xb423('0x72')]||![];this[_0xb423('0x73')]=_0x1be92e[_0xb423('0x73')]||undefined;this[_0xb423('0x74')]=_0x1be92e[_0xb423('0x74')]||![];this['dialAgiAfterHangupAgent']=_0x1be92e['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x1be92e[_0xb423('0x6')]]?monitorFormat[_0x1be92e[_0xb423('0x6')]]:undefined;this[_0xb423('0x75')]=_0x1be92e[_0xb423('0x75')]||![];this[_0xb423('0x76')]=_0x1be92e['mandatoryDispositionPause']?_0x1be92e['mandatoryDispositionPause']:undefined;this[_0xb423('0x77')]=![];}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index e2a2c30..5c2f88b 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 _0x0048=['erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','prototype','loggedin','callers','length','SIP/','online','incall','status','booked','keys','exten','xcally-motion-preview','compareToInboundQueue','compareToOutboundQueue','some','active','updateReportFromOutboundQueue','outboundBusyCallsDay','outboundReCallsDay','preview','exports','loggedIn','loggedInDb','ringing','talking','available','answered','inUse','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','paused','sumBillable','sumDuration','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','total','unavailable','unknown','unmanaged','waiting','type','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls'];(function(_0x323713,_0x3a868d){var _0x309089=function(_0x2a85d2){while(--_0x2a85d2){_0x323713['push'](_0x323713['shift']());}};_0x309089(++_0x3a868d);}(_0x0048,0x129));var _0x8004=function(_0x30b710,_0x4477d1){_0x30b710=_0x30b710-0x0;var _0x205edf=_0x0048[_0x30b710];return _0x205edf;};'use strict';var INBOUND_COUNTERS=['available',_0x8004('0x0'),_0x8004('0x1'),'paused',_0x8004('0x2'),_0x8004('0x3'),'waiting'];var OUTBOUND_COUNTERS=[_0x8004('0x4'),_0x8004('0x5'),_0x8004('0x6'),_0x8004('0x0'),'loggedInDb','originated',_0x8004('0x7'),_0x8004('0x8'),_0x8004('0x9'),'outboundBusyCallsDay',_0x8004('0xa'),_0x8004('0xb'),_0x8004('0xc'),'outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay',_0x8004('0xd'),'pTalking','talking',_0x8004('0xe'),_0x8004('0xf'),'total','waiting'];function VoiceQueueSummary(_0x1a261e){this['id']=_0x1a261e['id'];this[_0x8004('0x10')]=_0x1a261e[_0x8004('0x10')];this[_0x8004('0x11')]=_0x1a261e[_0x8004('0x11')];this[_0x8004('0x12')]=_0x1a261e[_0x8004('0x12')]||0x0;this['answered']=_0x1a261e[_0x8004('0x5')]||0x0;this[_0x8004('0x4')]=_0x1a261e[_0x8004('0x4')]||0x0;this[_0x8004('0x13')]=_0x1a261e[_0x8004('0x13')]||0x0;this[_0x8004('0x6')]=_0x1a261e[_0x8004('0x6')]||0x0;this[_0x8004('0x14')]=_0x1a261e[_0x8004('0x14')]||0x0;this[_0x8004('0x0')]=_0x1a261e[_0x8004('0x0')]||0x0;this[_0x8004('0x1')]=_0x1a261e[_0x8004('0x1')]||0x0;this[_0x8004('0x15')]=_0x1a261e[_0x8004('0x15')]||0x0;this[_0x8004('0x16')]=_0x1a261e[_0x8004('0x16')]||0x0;this[_0x8004('0xd')]=_0x1a261e[_0x8004('0xd')]||0x0;this['ringing']=_0x1a261e[_0x8004('0x2')]||0x0;this[_0x8004('0x17')]=_0x1a261e['ringInUse'];this[_0x8004('0xe')]=_0x1a261e[_0x8004('0xe')];this[_0x8004('0xf')]=_0x1a261e[_0x8004('0xf')];this[_0x8004('0x18')]=_0x1a261e[_0x8004('0x18')]||0x0;this[_0x8004('0x3')]=_0x1a261e[_0x8004('0x3')]||0x0;this[_0x8004('0x19')]=_0x1a261e[_0x8004('0x19')]||0x0;this['type']=_0x1a261e['type'];this['unavailable']=_0x1a261e[_0x8004('0x1a')]||0x0;this[_0x8004('0x1b')]=_0x1a261e['unknown']||0x0;this[_0x8004('0x1c')]=_0x1a261e[_0x8004('0x1c')]||0x0;this[_0x8004('0x1d')]=_0x1a261e[_0x8004('0x1d')]||0x0;if(_0x1a261e[_0x8004('0x1e')]===_0x8004('0x1f')){this['pTalking']=_0x1a261e[_0x8004('0x20')]||0x0;this[_0x8004('0x21')]=_0x1a261e['dialActive'];this[_0x8004('0x22')]=_0x1a261e[_0x8004('0x22')];this[_0x8004('0x23')]=_0x1a261e[_0x8004('0x23')];this['dialOriginateCallerIdNumber']=_0x1a261e['dialOriginateCallerIdNumber'];this[_0x8004('0x24')]=_0x1a261e[_0x8004('0x24')];this['dialPrefix']=_0x1a261e[_0x8004('0x25')];this[_0x8004('0x26')]=_0x1a261e[_0x8004('0x26')];this[_0x8004('0x27')]=_0x1a261e[_0x8004('0x27')];this['outboundAnswerCallsDay']=_0x1a261e[_0x8004('0x8')];this['outboundBlacklistCallsDay']=_0x1a261e[_0x8004('0x9')];this['outboundBusyCallsDay']=_0x1a261e['outboundBusyCallsDay'];this['outboundCongestionCallsDay']=_0x1a261e[_0x8004('0xa')];this[_0x8004('0x28')]=_0x1a261e['outboundDropCallsDayACS'];this[_0x8004('0x29')]=_0x1a261e[_0x8004('0x29')];this[_0x8004('0x2a')]=_0x1a261e[_0x8004('0x2a')];this[_0x8004('0xb')]=_0x1a261e[_0x8004('0xb')];this[_0x8004('0xc')]=_0x1a261e[_0x8004('0xc')];this['outboundOriginateFailureCallsDay']=_0x1a261e['outboundOriginateFailureCallsDay'];this['outboundReCallsDay']=_0x1a261e['outboundReCallsDay'];this[_0x8004('0x2b')]=_0x1a261e[_0x8004('0x2b')];this[_0x8004('0x2c')]=_0x1a261e[_0x8004('0x2c')];this['predictiveIntervalAnsweredCalls']=_0x1a261e[_0x8004('0x2d')];this['predictiveIntervalAvgHoldtime']=_0x1a261e[_0x8004('0x2e')];this[_0x8004('0x2f')]=_0x1a261e[_0x8004('0x2f')];this['predictiveIntervalDroppedCallsCallersExit']=_0x1a261e[_0x8004('0x30')];this[_0x8004('0x31')]=_0x1a261e[_0x8004('0x31')];this[_0x8004('0x32')]=_0x1a261e[_0x8004('0x32')];this[_0x8004('0x33')]=_0x1a261e[_0x8004('0x33')];this[_0x8004('0x34')]=_0x1a261e['predictiveIntervalHitRate'];this[_0x8004('0x35')]=_0x1a261e[_0x8004('0x35')];this[_0x8004('0x36')]=_0x1a261e[_0x8004('0x36')];this['predictiveIntervalAvailable']=_0x1a261e[_0x8004('0x37')];this[_0x8004('0x38')]=_0x1a261e['predictiveIntervalTotalCalls'];this[_0x8004('0x39')]=_0x1a261e['originated'];this[_0x8004('0x3a')]=_0x1a261e['erlangCalls'];this['erlangCallToSecond']=_0x1a261e[_0x8004('0x3b')];this[_0x8004('0x3c')]=_0x1a261e[_0x8004('0x3c')];this[_0x8004('0x3d')]=_0x1a261e[_0x8004('0x3d')];this['startPredictive']=_0x1a261e[_0x8004('0x3e')];this[_0x8004('0x3f')]=_0x1a261e[_0x8004('0x3f')];this[_0x8004('0x40')]=_0x1a261e['message'];this[_0x8004('0x41')]=_0x1a261e[_0x8004('0x41')];}if(_0x1a261e['Trunk']){this[_0x8004('0x42')]={'id':_0x1a261e[_0x8004('0x42')]['id'],'name':_0x1a261e[_0x8004('0x42')]['name'],'active':_0x1a261e[_0x8004('0x42')]['active'],'callerid':_0x1a261e[_0x8004('0x42')][_0x8004('0x43')]};}}VoiceQueueSummary[_0x8004('0x44')]['createReport']=function(_0x586a3b,_0x5ac54b,_0x4ed556,_0x1ff51a){this[_0x8004('0x1')]=0x0;this['talking']=0x0;this[_0x8004('0xd')]=0x0;this[_0x8004('0x1b')]=0x0;this['notInUse']=0x0;this[_0x8004('0x6')]=0x0;this[_0x8004('0x13')]=0x0;this[_0x8004('0x14')]=0x0;this['unavailable']=0x0;this[_0x8004('0x2')]=0x0;this['ringInUse']=0x0;this[_0x8004('0x15')]=0x0;if(_0x4ed556){if(_0x4ed556['available']){this[_0x8004('0x4')]=Number(_0x4ed556[_0x8004('0x4')]);}if(_0x4ed556['loggedin']){this[_0x8004('0x0')]=Number(_0x4ed556[_0x8004('0x45')]);}if(_0x4ed556[_0x8004('0x46')]){this['waiting']=Number(_0x4ed556['callers']);}}for(var _0x1bf929=0x0;_0x1bf929<_0x586a3b[_0x8004('0x47')];_0x1bf929++){var _0x11158c=_0x5ac54b[_0x8004('0x48')+_0x586a3b[_0x1bf929]['name']];if(_0x11158c&&_0x11158c[_0x8004('0x49')]){this[_0x8004('0x1')]+=0x1;}if(_0x586a3b[_0x1bf929][_0x8004('0x4a')]==='1'){this[_0x8004('0x3')]+=0x1;}if(_0x586a3b[_0x1bf929][_0x8004('0xd')]==='1'&&!['2','7','8']['includes'](_0x586a3b[_0x1bf929]['status'])){this[_0x8004('0xd')]+=0x1;}switch(_0x586a3b[_0x1bf929][_0x8004('0x4b')]){case'0':this[_0x8004('0x1b')]+=0x1;break;case'1':this[_0x8004('0x16')]+=0x1;break;case'2':this[_0x8004('0x6')]+=0x1;break;case'3':this[_0x8004('0x13')]+=0x1;break;case'4':this[_0x8004('0x14')]+=0x1;break;case'5':this[_0x8004('0x1a')]+=0x1;break;case'6':this[_0x8004('0x2')]+=0x1;break;case'7':this[_0x8004('0x17')]+=0x1;break;case'8':this[_0x8004('0x15')]+=0x1;break;}}if(this[_0x8004('0x22')]===_0x8004('0x4c')){var _0x49cdef=Object[_0x8004('0x4d')](_0x1ff51a);for(var _0x11dbbe=0x0;_0x11dbbe<_0x49cdef[_0x8004('0x47')];_0x11dbbe++){var _0x379a4a=_0x49cdef[_0x11dbbe];var _0x592e16=_0x1ff51a[_0x379a4a];if(_0x592e16['queue']===this[_0x8004('0x10')]&&_0x592e16[_0x8004('0x1e')]==='dialer'&&_0x592e16[_0x8004('0x4e')]===_0x8004('0x4f')){this['talking']+=0x1;}}if(this['talking']>this['inUse']){this[_0x8004('0x3')]=this[_0x8004('0x6')];}this[_0x8004('0x20')]=0x0;}return this;};VoiceQueueSummary[_0x8004('0x44')][_0x8004('0x50')]=function(_0x17446d){var _0x1d7455=![];if(_0x17446d){_0x1d7455=INBOUND_COUNTERS['some'](function(_0x2a3600){return this[_0x2a3600]!==_0x17446d[_0x2a3600];},this);}return _0x1d7455;};VoiceQueueSummary[_0x8004('0x44')][_0x8004('0x51')]=function(_0x18cbe2){var _0x502de4=![];var _0x378e68=![];var _0x521723=![];if(_0x18cbe2){_0x502de4=this['dialMethod']!==_0x18cbe2[_0x8004('0x22')]||this[_0x8004('0x21')]!==_0x18cbe2[_0x8004('0x21')]||this[_0x8004('0x40')]!==_0x18cbe2['message']||this[_0x8004('0x41')]!==_0x18cbe2['statusMessage'];_0x378e68=OUTBOUND_COUNTERS[_0x8004('0x52')](function(_0x46793d){return this[_0x46793d]!==_0x18cbe2[_0x46793d];},this);if(this[_0x8004('0x42')]&&_0x18cbe2[_0x8004('0x42')]){_0x521723=this[_0x8004('0x42')][_0x8004('0x10')]!==_0x18cbe2[_0x8004('0x42')][_0x8004('0x10')]||this['Trunk'][_0x8004('0x53')]!==_0x18cbe2[_0x8004('0x42')]['active'];}}return _0x502de4||_0x378e68||_0x521723;};VoiceQueueSummary['prototype'][_0x8004('0x54')]=function(_0x23f343){this[_0x8004('0x5')]=_0x23f343[_0x8004('0x5')];this[_0x8004('0x40')]=_0x23f343[_0x8004('0x40')];this[_0x8004('0x41')]=_0x23f343['statusMessage'];this[_0x8004('0x39')]=_0x23f343['originated'];this[_0x8004('0x7')]=_0x23f343[_0x8004('0x7')];this[_0x8004('0x8')]=_0x23f343[_0x8004('0x8')];this['outboundBlacklistCallsDay']=_0x23f343[_0x8004('0x9')];this[_0x8004('0x55')]=_0x23f343[_0x8004('0x55')];this[_0x8004('0xa')]=_0x23f343[_0x8004('0xa')];this['outboundNoAnswerCallsDay']=_0x23f343[_0x8004('0xb')];this[_0x8004('0xc')]=_0x23f343[_0x8004('0xc')];this[_0x8004('0x56')]=_0x23f343[_0x8004('0x56')];this[_0x8004('0x2b')]=_0x23f343[_0x8004('0x2b')];this[_0x8004('0x2c')]=_0x23f343[_0x8004('0x2c')];this['sumBillable']=_0x23f343[_0x8004('0xe')];this['sumDuration']=_0x23f343[_0x8004('0xf')];this[_0x8004('0x19')]=_0x23f343['total'];if(this[_0x8004('0x22')]===_0x8004('0x57')){this[_0x8004('0x20')]=_0x23f343[_0x8004('0x20')];}};module[_0x8004('0x58')]=VoiceQueueSummary; \ No newline at end of file +var _0x0bde=['some','compareToOutboundQueue','active','updateReportFromOutboundQueue','preview','available','loggedInDb','paused','talking','waiting','inUse','loggedIn','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','pTalking','sumBillable','total','name','strategy','abandoned','answered','busy','invalid','onHold','notInUse','ringing','ringInUse','sumDuration','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','prototype','createReport','loggedin','callers','length','SIP/','online','includes','status','booked','keys','exten','xcally-motion-preview','compareToInboundQueue'];(function(_0x5410e4,_0x1f5c7e){var _0x41121f=function(_0x38aec2){while(--_0x38aec2){_0x5410e4['push'](_0x5410e4['shift']());}};_0x41121f(++_0x1f5c7e);}(_0x0bde,0x110));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var INBOUND_COUNTERS=[_0xe0bd('0x0'),'loggedIn',_0xe0bd('0x1'),_0xe0bd('0x2'),'ringing',_0xe0bd('0x3'),_0xe0bd('0x4')];var OUTBOUND_COUNTERS=[_0xe0bd('0x0'),'answered',_0xe0bd('0x5'),_0xe0bd('0x6'),_0xe0bd('0x1'),_0xe0bd('0x7'),_0xe0bd('0x8'),_0xe0bd('0x9'),_0xe0bd('0xa'),_0xe0bd('0xb'),_0xe0bd('0xc'),_0xe0bd('0xd'),_0xe0bd('0xe'),_0xe0bd('0xf'),_0xe0bd('0x10'),'outboundUnknownCallsDay',_0xe0bd('0x2'),_0xe0bd('0x11'),'talking',_0xe0bd('0x12'),'sumDuration',_0xe0bd('0x13'),_0xe0bd('0x4')];function VoiceQueueSummary(_0x3cc36c){this['id']=_0x3cc36c['id'];this[_0xe0bd('0x14')]=_0x3cc36c[_0xe0bd('0x14')];this[_0xe0bd('0x15')]=_0x3cc36c[_0xe0bd('0x15')];this['abandoned']=_0x3cc36c[_0xe0bd('0x16')]||0x0;this[_0xe0bd('0x17')]=_0x3cc36c[_0xe0bd('0x17')]||0x0;this['available']=_0x3cc36c[_0xe0bd('0x0')]||0x0;this['busy']=_0x3cc36c[_0xe0bd('0x18')]||0x0;this[_0xe0bd('0x5')]=_0x3cc36c[_0xe0bd('0x5')]||0x0;this[_0xe0bd('0x19')]=_0x3cc36c[_0xe0bd('0x19')]||0x0;this[_0xe0bd('0x6')]=_0x3cc36c[_0xe0bd('0x6')]||0x0;this[_0xe0bd('0x1')]=_0x3cc36c['loggedInDb']||0x0;this['onHold']=_0x3cc36c[_0xe0bd('0x1a')]||0x0;this[_0xe0bd('0x1b')]=_0x3cc36c[_0xe0bd('0x1b')]||0x0;this[_0xe0bd('0x2')]=_0x3cc36c[_0xe0bd('0x2')]||0x0;this[_0xe0bd('0x1c')]=_0x3cc36c['ringing']||0x0;this['ringInUse']=_0x3cc36c[_0xe0bd('0x1d')];this[_0xe0bd('0x12')]=_0x3cc36c[_0xe0bd('0x12')];this[_0xe0bd('0x1e')]=_0x3cc36c[_0xe0bd('0x1e')];this[_0xe0bd('0x1f')]=_0x3cc36c[_0xe0bd('0x1f')]||0x0;this['talking']=_0x3cc36c['talking']||0x0;this[_0xe0bd('0x13')]=_0x3cc36c[_0xe0bd('0x13')]||0x0;this[_0xe0bd('0x20')]=_0x3cc36c[_0xe0bd('0x20')];this[_0xe0bd('0x21')]=_0x3cc36c['unavailable']||0x0;this[_0xe0bd('0x22')]=_0x3cc36c['unknown']||0x0;this[_0xe0bd('0x23')]=_0x3cc36c[_0xe0bd('0x23')]||0x0;this[_0xe0bd('0x4')]=_0x3cc36c['waiting']||0x0;if(_0x3cc36c[_0xe0bd('0x20')]===_0xe0bd('0x24')){this['pTalking']=_0x3cc36c[_0xe0bd('0x11')]||0x0;this['dialActive']=_0x3cc36c[_0xe0bd('0x25')];this['dialMethod']=_0x3cc36c[_0xe0bd('0x26')];this[_0xe0bd('0x27')]=_0x3cc36c[_0xe0bd('0x27')];this['dialOriginateCallerIdNumber']=_0x3cc36c[_0xe0bd('0x28')];this['dialOriginateTimeout']=_0x3cc36c[_0xe0bd('0x29')];this[_0xe0bd('0x2a')]=_0x3cc36c['dialPrefix'];this['temp']=_0x3cc36c[_0xe0bd('0x2b')];this[_0xe0bd('0x2c')]=_0x3cc36c[_0xe0bd('0x2c')];this[_0xe0bd('0x9')]=_0x3cc36c[_0xe0bd('0x9')];this[_0xe0bd('0xa')]=_0x3cc36c[_0xe0bd('0xa')];this['outboundBusyCallsDay']=_0x3cc36c[_0xe0bd('0xb')];this[_0xe0bd('0xc')]=_0x3cc36c[_0xe0bd('0xc')];this[_0xe0bd('0x2d')]=_0x3cc36c[_0xe0bd('0x2d')];this[_0xe0bd('0x2e')]=_0x3cc36c['outboundDropCallsDayCallersExit'];this[_0xe0bd('0x2f')]=_0x3cc36c[_0xe0bd('0x2f')];this[_0xe0bd('0xd')]=_0x3cc36c[_0xe0bd('0xd')];this[_0xe0bd('0xe')]=_0x3cc36c[_0xe0bd('0xe')];this[_0xe0bd('0x30')]=_0x3cc36c[_0xe0bd('0x30')];this['outboundReCallsDay']=_0x3cc36c['outboundReCallsDay'];this[_0xe0bd('0x10')]=_0x3cc36c[_0xe0bd('0x10')];this[_0xe0bd('0x31')]=_0x3cc36c[_0xe0bd('0x31')];this[_0xe0bd('0x32')]=_0x3cc36c['predictiveIntervalAnsweredCalls'];this['predictiveIntervalAvgHoldtime']=_0x3cc36c['predictiveIntervalAvgHoldtime'];this[_0xe0bd('0x33')]=_0x3cc36c[_0xe0bd('0x33')];this[_0xe0bd('0x34')]=_0x3cc36c[_0xe0bd('0x34')];this[_0xe0bd('0x35')]=_0x3cc36c[_0xe0bd('0x35')];this['predictiveIntervalErlangCalls']=_0x3cc36c[_0xe0bd('0x36')];this[_0xe0bd('0x37')]=_0x3cc36c[_0xe0bd('0x37')];this['predictiveIntervalHitRate']=_0x3cc36c[_0xe0bd('0x38')];this[_0xe0bd('0x39')]=_0x3cc36c['predictiveIntervalMultiplicativeFactor'];this[_0xe0bd('0x3a')]=_0x3cc36c[_0xe0bd('0x3a')];this[_0xe0bd('0x3b')]=_0x3cc36c['predictiveIntervalAvailable'];this[_0xe0bd('0x3c')]=_0x3cc36c['predictiveIntervalTotalCalls'];this[_0xe0bd('0x7')]=_0x3cc36c[_0xe0bd('0x7')];this[_0xe0bd('0x3d')]=_0x3cc36c[_0xe0bd('0x3d')];this['erlangCallToSecond']=_0x3cc36c[_0xe0bd('0x3e')];this[_0xe0bd('0x3f')]=_0x3cc36c[_0xe0bd('0x3f')];this['erlangBusyFactor']=_0x3cc36c['erlangBusyFactor'];this[_0xe0bd('0x40')]=_0x3cc36c[_0xe0bd('0x40')];this[_0xe0bd('0x41')]=_0x3cc36c['startProgressive'];this['message']=_0x3cc36c[_0xe0bd('0x42')];this[_0xe0bd('0x43')]=_0x3cc36c[_0xe0bd('0x43')];}if(_0x3cc36c[_0xe0bd('0x44')]){this['Trunk']={'id':_0x3cc36c[_0xe0bd('0x44')]['id'],'name':_0x3cc36c[_0xe0bd('0x44')][_0xe0bd('0x14')],'active':_0x3cc36c['Trunk']['active'],'callerid':_0x3cc36c[_0xe0bd('0x44')][_0xe0bd('0x45')]};}}VoiceQueueSummary[_0xe0bd('0x46')][_0xe0bd('0x47')]=function(_0x5ada76,_0x7a2547,_0x41597a,_0x1f6e20){this['loggedInDb']=0x0;this['talking']=0x0;this[_0xe0bd('0x2')]=0x0;this['unknown']=0x0;this[_0xe0bd('0x1b')]=0x0;this[_0xe0bd('0x5')]=0x0;this['busy']=0x0;this[_0xe0bd('0x19')]=0x0;this[_0xe0bd('0x21')]=0x0;this[_0xe0bd('0x1c')]=0x0;this['ringInUse']=0x0;this[_0xe0bd('0x1a')]=0x0;if(_0x41597a){if(_0x41597a[_0xe0bd('0x0')]){this[_0xe0bd('0x0')]=Number(_0x41597a[_0xe0bd('0x0')]);}if(_0x41597a[_0xe0bd('0x48')]){this[_0xe0bd('0x6')]=Number(_0x41597a[_0xe0bd('0x48')]);}if(_0x41597a[_0xe0bd('0x49')]){this['waiting']=Number(_0x41597a[_0xe0bd('0x49')]);}}for(var _0x7a6831=0x0;_0x7a6831<_0x5ada76[_0xe0bd('0x4a')];_0x7a6831++){var _0x381ee7=_0x7a2547[_0xe0bd('0x4b')+_0x5ada76[_0x7a6831][_0xe0bd('0x14')]];if(_0x381ee7&&_0x381ee7[_0xe0bd('0x4c')]){this[_0xe0bd('0x1')]+=0x1;}if(_0x5ada76[_0x7a6831]['incall']==='1'){this[_0xe0bd('0x3')]+=0x1;}if(_0x5ada76[_0x7a6831][_0xe0bd('0x2')]==='1'&&!['2','7','8'][_0xe0bd('0x4d')](_0x5ada76[_0x7a6831][_0xe0bd('0x4e')])){this[_0xe0bd('0x2')]+=0x1;}switch(_0x5ada76[_0x7a6831]['status']){case'0':this[_0xe0bd('0x22')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0xe0bd('0x19')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0xe0bd('0x1d')]+=0x1;break;case'8':this[_0xe0bd('0x1a')]+=0x1;break;}}if(this[_0xe0bd('0x26')]===_0xe0bd('0x4f')){var _0x17ed8c=Object[_0xe0bd('0x50')](_0x1f6e20);for(var _0xe2b989=0x0;_0xe2b989<_0x17ed8c[_0xe0bd('0x4a')];_0xe2b989++){var _0x137bed=_0x17ed8c[_0xe2b989];var _0x252013=_0x1f6e20[_0x137bed];if(_0x252013['queue']===this[_0xe0bd('0x14')]&&_0x252013['type']==='dialer'&&_0x252013[_0xe0bd('0x51')]===_0xe0bd('0x52')){this[_0xe0bd('0x3')]+=0x1;}}if(this['talking']>this[_0xe0bd('0x5')]){this[_0xe0bd('0x3')]=this[_0xe0bd('0x5')];}this[_0xe0bd('0x11')]=0x0;}return this;};VoiceQueueSummary[_0xe0bd('0x46')][_0xe0bd('0x53')]=function(_0x2144cb){var _0x443c80=![];if(_0x2144cb){_0x443c80=INBOUND_COUNTERS[_0xe0bd('0x54')](function(_0x1f85ef){return this[_0x1f85ef]!==_0x2144cb[_0x1f85ef];},this);}return _0x443c80;};VoiceQueueSummary[_0xe0bd('0x46')][_0xe0bd('0x55')]=function(_0x544195){var _0x1a62ce=![];var _0xa761ae=![];var _0x530338=![];if(_0x544195){_0x1a62ce=this['dialMethod']!==_0x544195['dialMethod']||this[_0xe0bd('0x25')]!==_0x544195['dialActive']||this['message']!==_0x544195['message']||this[_0xe0bd('0x43')]!==_0x544195[_0xe0bd('0x43')];_0xa761ae=OUTBOUND_COUNTERS[_0xe0bd('0x54')](function(_0x50dd77){return this[_0x50dd77]!==_0x544195[_0x50dd77];},this);if(this['Trunk']&&_0x544195[_0xe0bd('0x44')]){_0x530338=this['Trunk'][_0xe0bd('0x14')]!==_0x544195[_0xe0bd('0x44')][_0xe0bd('0x14')]||this[_0xe0bd('0x44')][_0xe0bd('0x56')]!==_0x544195[_0xe0bd('0x44')][_0xe0bd('0x56')];}}return _0x1a62ce||_0xa761ae||_0x530338;};VoiceQueueSummary[_0xe0bd('0x46')][_0xe0bd('0x57')]=function(_0x332bfd){this[_0xe0bd('0x17')]=_0x332bfd[_0xe0bd('0x17')];this[_0xe0bd('0x42')]=_0x332bfd['message'];this[_0xe0bd('0x43')]=_0x332bfd['statusMessage'];this[_0xe0bd('0x7')]=_0x332bfd[_0xe0bd('0x7')];this[_0xe0bd('0x8')]=_0x332bfd[_0xe0bd('0x8')];this[_0xe0bd('0x9')]=_0x332bfd[_0xe0bd('0x9')];this[_0xe0bd('0xa')]=_0x332bfd[_0xe0bd('0xa')];this[_0xe0bd('0xb')]=_0x332bfd['outboundBusyCallsDay'];this['outboundCongestionCallsDay']=_0x332bfd['outboundCongestionCallsDay'];this[_0xe0bd('0xd')]=_0x332bfd[_0xe0bd('0xd')];this[_0xe0bd('0xe')]=_0x332bfd[_0xe0bd('0xe')];this[_0xe0bd('0xf')]=_0x332bfd[_0xe0bd('0xf')];this[_0xe0bd('0x10')]=_0x332bfd[_0xe0bd('0x10')];this[_0xe0bd('0x31')]=_0x332bfd['outboundUnknownCallsDay'];this[_0xe0bd('0x12')]=_0x332bfd['sumBillable'];this['sumDuration']=_0x332bfd[_0xe0bd('0x1e')];this[_0xe0bd('0x13')]=_0x332bfd[_0xe0bd('0x13')];if(this[_0xe0bd('0x26')]===_0xe0bd('0x58')){this[_0xe0bd('0x11')]=_0x332bfd[_0xe0bd('0x11')];}};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 1f60110..7d658a5 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 _0x3265=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x2229d5,_0x19d472){var _0x11df56=function(_0x33baf2){while(--_0x33baf2){_0x2229d5['push'](_0x2229d5['shift']());}};_0x11df56(++_0x19d472);}(_0x3265,0x85));var _0x5326=function(_0x57b4ed,_0x35a4ab){_0x57b4ed=_0x57b4ed-0x0;var _0x2af230=_0x3265[_0x57b4ed];return _0x2af230;};'use strict';function VtigerAccount(_0x1d3b53){this['id']=_0x1d3b53['id']||0x0;this[_0x5326('0x0')]=_0x1d3b53[_0x5326('0x0')]||'';this[_0x5326('0x1')]=_0x1d3b53['username']||'';this[_0x5326('0x2')]=_0x1d3b53['accessKey']||'';this['remoteUri']=_0x1d3b53[_0x5326('0x3')]||'';this[_0x5326('0x4')]=_0x1d3b53[_0x5326('0x4')]||'';this[_0x5326('0x5')]=_0x1d3b53[_0x5326('0x5')]||{};}module[_0x5326('0x6')]=VtigerAccount; \ No newline at end of file +var _0x366c=['name','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x349751,_0x45ea3e){var _0x2c32d2=function(_0x21b920){while(--_0x21b920){_0x349751['push'](_0x349751['shift']());}};_0x2c32d2(++_0x45ea3e);}(_0x366c,0x82));var _0xc366=function(_0x16d250,_0x12f9ff){_0x16d250=_0x16d250-0x0;var _0x3c3d21=_0x366c[_0x16d250];return _0x3c3d21;};'use strict';function VtigerAccount(_0x585ac8){this['id']=_0x585ac8['id']||0x0;this[_0xc366('0x0')]=_0x585ac8[_0xc366('0x0')]||'';this['username']=_0x585ac8['username']||'';this[_0xc366('0x1')]=_0x585ac8[_0xc366('0x1')]||'';this[_0xc366('0x2')]=_0x585ac8[_0xc366('0x2')]||'';this[_0xc366('0x3')]=_0x585ac8[_0xc366('0x3')]||'';this[_0xc366('0x4')]=_0x585ac8[_0xc366('0x4')]||{};}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 f0e35fd..327f8ee 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 _0x7c9a=['authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x1be3e5,_0x1a2b46){var _0x34840e=function(_0x4351e6){while(--_0x4351e6){_0x1be3e5['push'](_0x1be3e5['shift']());}};_0x34840e(++_0x1a2b46);}(_0x7c9a,0x1b3));var _0xa7c9=function(_0x64c483,_0x2c6ad8){_0x64c483=_0x64c483-0x0;var _0x2f78c6=_0x7c9a[_0x64c483];return _0x2f78c6;};'use strict';function ZendeskAccount(_0x407475){this['id']=_0x407475['id']||0x0;this[_0xa7c9('0x0')]=_0x407475[_0xa7c9('0x0')]||'';this[_0xa7c9('0x1')]=_0x407475[_0xa7c9('0x1')]||'';this[_0xa7c9('0x2')]=_0x407475['password']||'';this[_0xa7c9('0x3')]=_0x407475[_0xa7c9('0x3')]||'';this[_0xa7c9('0x4')]=_0x407475[_0xa7c9('0x4')]||'';this[_0xa7c9('0x5')]=_0x407475[_0xa7c9('0x5')]||'';this['type']=_0x407475[_0xa7c9('0x6')]||_0xa7c9('0x7');this[_0xa7c9('0x8')]=_0x407475['serverUrl']||'';this[_0xa7c9('0x9')]=_0x407475[_0xa7c9('0x9')]||{};}module[_0xa7c9('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x5579=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x574aed,_0xedb8cc){var _0x2d6bd8=function(_0x999d05){while(--_0x999d05){_0x574aed['push'](_0x574aed['shift']());}};_0x2d6bd8(++_0xedb8cc);}(_0x5579,0xa4));var _0x9557=function(_0x22dd24,_0x25e4df){_0x22dd24=_0x22dd24-0x0;var _0x113a54=_0x5579[_0x22dd24];return _0x113a54;};'use strict';function ZendeskAccount(_0x11887d){this['id']=_0x11887d['id']||0x0;this[_0x9557('0x0')]=_0x11887d['name']||'';this[_0x9557('0x1')]=_0x11887d[_0x9557('0x1')]||'';this['password']=_0x11887d[_0x9557('0x2')]||'';this[_0x9557('0x3')]=_0x11887d[_0x9557('0x3')]||'';this[_0x9557('0x4')]=_0x11887d[_0x9557('0x4')]||'';this['authType']=_0x11887d[_0x9557('0x5')]||'';this[_0x9557('0x6')]=_0x11887d[_0x9557('0x6')]||_0x9557('0x7');this[_0x9557('0x8')]=_0x11887d[_0x9557('0x8')]||'';this['Configurations']=_0x11887d[_0x9557('0x9')]||{};}module[_0x9557('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 0ce3ea3..450e512 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 _0x7585=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7585,0xd6));var _0x5758=function(_0x48fffb,_0x16d2a5){_0x48fffb=_0x48fffb-0x0;var _0x3664f0=_0x7585[_0x48fffb];return _0x3664f0;};'use strict';function ZohoAccount(_0x5816b4){this['id']=_0x5816b4['id']||0x0;this[_0x5758('0x0')]=_0x5816b4['name']||'';this['description']=_0x5816b4[_0x5758('0x1')]||'';this[_0x5758('0x2')]=_0x5816b4[_0x5758('0x2')]||'';this['zone']=_0x5816b4[_0x5758('0x3')]||'';this[_0x5758('0x4')]=_0x5816b4[_0x5758('0x4')]||'';this[_0x5758('0x5')]=_0x5816b4['clientSecret']||'';this[_0x5758('0x6')]=_0x5816b4['serverUrl']||'';this[_0x5758('0x7')]=_0x5816b4[_0x5758('0x7')]||'';this['refreshToken']=_0x5816b4[_0x5758('0x8')]||'';this[_0x5758('0x9')]=_0x5816b4[_0x5758('0x9')]||{};}module[_0x5758('0xa')]=ZohoAccount; \ No newline at end of file +var _0xb17e=['exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x1cc190,_0x2da462){var _0x1a0778=function(_0x2370ec){while(--_0x2370ec){_0x1cc190['push'](_0x1cc190['shift']());}};_0x1a0778(++_0x2da462);}(_0xb17e,0x14b));var _0xeb17=function(_0x1533c8,_0x288d76){_0x1533c8=_0x1533c8-0x0;var _0x8bcfb1=_0xb17e[_0x1533c8];return _0x8bcfb1;};'use strict';function ZohoAccount(_0x16e905){this['id']=_0x16e905['id']||0x0;this['name']=_0x16e905[_0xeb17('0x0')]||'';this[_0xeb17('0x1')]=_0x16e905[_0xeb17('0x1')]||'';this[_0xeb17('0x2')]=_0x16e905[_0xeb17('0x2')]||'';this['zone']=_0x16e905[_0xeb17('0x3')]||'';this[_0xeb17('0x4')]=_0x16e905[_0xeb17('0x4')]||'';this[_0xeb17('0x5')]=_0x16e905[_0xeb17('0x5')]||'';this['serverUrl']=_0x16e905[_0xeb17('0x6')]||'';this[_0xeb17('0x7')]=_0x16e905[_0xeb17('0x7')]||'';this[_0xeb17('0x8')]=_0x16e905[_0xeb17('0x8')]||'';this[_0xeb17('0x9')]=_0x16e905['Configurations']||{};}module[_0xeb17('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 db26bd5..c9f35cb 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 _0x8aad=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','exports','util','lodash','isNil','uniqueid','idContact','queue','name','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x2d8ee7,_0x5055a8){var _0x28d629=function(_0x227607){while(--_0x227607){_0x2d8ee7['push'](_0x2d8ee7['shift']());}};_0x28d629(++_0x5055a8);}(_0x8aad,0x146));var _0xd8aa=function(_0x5cfb9c,_0x32475d){_0x5cfb9c=_0x5cfb9c-0x0;var _0x2761b9=_0x8aad[_0x5cfb9c];return _0x2761b9;};'use strict';var util=require(_0xd8aa('0x0'));var _=require(_0xd8aa('0x1'));var moment=require('moment');function checkNameSurname(_0x11554c,_0x5bcfd1,_0x276f03){var _0xb610c0='';if(!_['isNil'](_0x5bcfd1)&&'string'===typeof _0x5bcfd1){_0xb610c0+=_0x5bcfd1;}if(!_[_0xd8aa('0x2')](_0x276f03)&&'string'===typeof _0x276f03){_0xb610c0+='\x20'+_0x276f03;}if(_0xb610c0!==''){return _0xb610c0;}return _0x11554c;}function Action(_0x53248c,_0x16b648,_0x43ddeb,_0x16ea12,_0x4a4b10){this[_0xd8aa('0x3')]=_0x43ddeb||undefined;this[_0xd8aa('0x4')]=_0x53248c['id'];this[_0xd8aa('0x5')]=_0x16b648[_0xd8aa('0x6')];this['type']=_0x16b648['type'];this[_0xd8aa('0x7')]=_0xd8aa('0x5');this[_0xd8aa('0x8')]=![];this[_0xd8aa('0x9')]=_[_0xd8aa('0x2')](_0x53248c['Agent'])?undefined:_0x53248c[_0xd8aa('0xa')][_0xd8aa('0x6')];this[_0xd8aa('0xb')]=this[_0xd8aa('0x9')]?util[_0xd8aa('0xc')](_0xd8aa('0xd'),this[_0xd8aa('0x9')]):_0x16ea12||undefined;this[_0xd8aa('0xe')]=checkNameSurname(_0x53248c[_0xd8aa('0xf')][_0xd8aa('0x10')],_0x53248c['Contact']['firstName'],_0x53248c[_0xd8aa('0xf')][_0xd8aa('0x11')]);this[_0xd8aa('0x12')]=_0x53248c['active']||![];this[_0xd8aa('0x13')]=_0x53248c[_0xd8aa('0x10')];this[_0xd8aa('0x14')]=_0x53248c[_0xd8aa('0x14')];this['countbusyretry']=_0x53248c[_0xd8aa('0x15')]||0x0;this[_0xd8aa('0x16')]=_0x53248c['countcongestionretry']||0x0;this[_0xd8aa('0x17')]=_0x53248c[_0xd8aa('0x17')]||0x0;this[_0xd8aa('0x18')]=(_0x53248c[_0xd8aa('0x15')]||0x0)+(_0x53248c[_0xd8aa('0x16')]||0x0)+(_0x53248c['countnoanswerretry']||0x0)+(_0x53248c[_0xd8aa('0x19')]||0x0)+(_0x53248c[_0xd8aa('0x1a')]||0x0)+(_0x53248c[_0xd8aa('0x1b')]||0x0)+(_0x53248c[_0xd8aa('0x1c')]||0x0)+(_0x53248c['countagentrejectretry']||0x0);this[_0xd8aa('0x19')]=_0x53248c[_0xd8aa('0x19')]||0x0;this[_0xd8aa('0x1a')]=_0x53248c[_0xd8aa('0x1a')]||0x0;this[_0xd8aa('0x1b')]=_0x53248c['countabandonedretry']||0x0;this[_0xd8aa('0x1c')]=_0x53248c[_0xd8aa('0x1c')]||0x0;this[_0xd8aa('0x1d')]=_0x53248c['countagentrejectretry']||0x0;this[_0xd8aa('0x1e')]=_0x53248c[_0xd8aa('0x1e')];this[_0xd8aa('0x1f')]=_0x53248c[_0xd8aa('0x1f')];this[_0xd8aa('0x20')]=_0x53248c[_0xd8aa('0x20')];this[_0xd8aa('0x21')]=_0x53248c[_0xd8aa('0x21')];this[_0xd8aa('0x22')]=_0x53248c[_0xd8aa('0x22')];this[_0xd8aa('0x23')]=_0x53248c[_0xd8aa('0x23')];this[_0xd8aa('0x24')]=_['isNil'](_0x53248c[_0xd8aa('0xa')])?_0x53248c[_0xd8aa('0x24')]:_0x53248c[_0xd8aa('0xa')]['id'];this[_0xd8aa('0x25')]=_0x53248c[_0xd8aa('0x25')];this[_0xd8aa('0x26')]='';this[_0xd8aa('0x27')]='';}Action[_0xd8aa('0x28')][_0xd8aa('0x29')]=function(){return util[_0xd8aa('0xc')]('\x22%s\x22\x20<%s>',this[_0xd8aa('0xe')],this[_0xd8aa('0x2a')]);};module[_0xd8aa('0x2b')]=Action; \ No newline at end of file +var _0x0abf=['callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','\x22%s\x22\x20<%s>','calleridname','number','exports','util','moment','string','isNil','uniqueid','idContact','queue','name','type','campaigntype','Agent','channelAgent','membername','format','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback'];(function(_0x2b6d5d,_0xe6a33f){var _0x4d7a0d=function(_0x1dc02f){while(--_0x1dc02f){_0x2b6d5d['push'](_0x2b6d5d['shift']());}};_0x4d7a0d(++_0xe6a33f);}(_0x0abf,0xe8));var _0xf0ab=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0abf[_0x3947c9];return _0x2e7871;};'use strict';var util=require(_0xf0ab('0x0'));var _=require('lodash');var moment=require(_0xf0ab('0x1'));function checkNameSurname(_0x27c8c9,_0x528ef7,_0x598001){var _0x313b14='';if(!_['isNil'](_0x528ef7)&&_0xf0ab('0x2')===typeof _0x528ef7){_0x313b14+=_0x528ef7;}if(!_[_0xf0ab('0x3')](_0x598001)&&_0xf0ab('0x2')===typeof _0x598001){_0x313b14+='\x20'+_0x598001;}if(_0x313b14!==''){return _0x313b14;}return _0x27c8c9;}function Action(_0xbb1f91,_0x2ab7d6,_0x4d2ea8,_0x233afe,_0x57ff3b){this[_0xf0ab('0x4')]=_0x4d2ea8||undefined;this[_0xf0ab('0x5')]=_0xbb1f91['id'];this[_0xf0ab('0x6')]=_0x2ab7d6[_0xf0ab('0x7')];this['type']=_0x2ab7d6[_0xf0ab('0x8')];this[_0xf0ab('0x9')]=_0xf0ab('0x6');this['dialAnswer']=![];this['membername']=_[_0xf0ab('0x3')](_0xbb1f91['Agent'])?undefined:_0xbb1f91[_0xf0ab('0xa')][_0xf0ab('0x7')];this[_0xf0ab('0xb')]=this[_0xf0ab('0xc')]?util[_0xf0ab('0xd')](_0xf0ab('0xe'),this[_0xf0ab('0xc')]):_0x233afe||undefined;this['calleridname']=checkNameSurname(_0xbb1f91[_0xf0ab('0xf')][_0xf0ab('0x10')],_0xbb1f91[_0xf0ab('0xf')][_0xf0ab('0x11')],_0xbb1f91[_0xf0ab('0xf')][_0xf0ab('0x12')]);this[_0xf0ab('0x13')]=_0xbb1f91[_0xf0ab('0x13')]||![];this[_0xf0ab('0x14')]=_0xbb1f91[_0xf0ab('0x10')];this[_0xf0ab('0x15')]=_0xbb1f91[_0xf0ab('0x15')];this[_0xf0ab('0x16')]=_0xbb1f91[_0xf0ab('0x16')]||0x0;this[_0xf0ab('0x17')]=_0xbb1f91['countcongestionretry']||0x0;this[_0xf0ab('0x18')]=_0xbb1f91[_0xf0ab('0x18')]||0x0;this[_0xf0ab('0x19')]=(_0xbb1f91[_0xf0ab('0x16')]||0x0)+(_0xbb1f91[_0xf0ab('0x17')]||0x0)+(_0xbb1f91[_0xf0ab('0x18')]||0x0)+(_0xbb1f91[_0xf0ab('0x1a')]||0x0)+(_0xbb1f91[_0xf0ab('0x1b')]||0x0)+(_0xbb1f91[_0xf0ab('0x1c')]||0x0)+(_0xbb1f91[_0xf0ab('0x1d')]||0x0)+(_0xbb1f91[_0xf0ab('0x1e')]||0x0);this[_0xf0ab('0x1a')]=_0xbb1f91[_0xf0ab('0x1a')]||0x0;this[_0xf0ab('0x1b')]=_0xbb1f91[_0xf0ab('0x1b')]||0x0;this[_0xf0ab('0x1c')]=_0xbb1f91['countabandonedretry']||0x0;this[_0xf0ab('0x1d')]=_0xbb1f91[_0xf0ab('0x1d')]||0x0;this[_0xf0ab('0x1e')]=_0xbb1f91[_0xf0ab('0x1e')]||0x0;this[_0xf0ab('0x1f')]=_0xbb1f91[_0xf0ab('0x1f')];this[_0xf0ab('0x20')]=_0xbb1f91[_0xf0ab('0x20')];this[_0xf0ab('0x21')]=_0xbb1f91[_0xf0ab('0x21')];this[_0xf0ab('0x22')]=_0xbb1f91['recallme'];this['ContactId']=_0xbb1f91['ContactId'];this[_0xf0ab('0x23')]=_0xbb1f91['ListId'];this[_0xf0ab('0x24')]=_[_0xf0ab('0x3')](_0xbb1f91['Agent'])?_0xbb1f91[_0xf0ab('0x24')]:_0xbb1f91[_0xf0ab('0xa')]['id'];this[_0xf0ab('0x25')]=_0xbb1f91[_0xf0ab('0x25')];this[_0xf0ab('0x26')]='';this['originatecalleridname']='';}Action[_0xf0ab('0x27')]['getCaller']=function(){return util['format'](_0xf0ab('0x28'),this[_0xf0ab('0x29')],this[_0xf0ab('0x2a')]);};module[_0xf0ab('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 34892e1..a2edb27 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(_0x253a3c,_0x13e82a){var _0x1e1bc4=function(_0x2e7e46){while(--_0x2e7e46){_0x253a3c['push'](_0x253a3c['shift']());}};_0x1e1bc4(++_0x13e82a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 _0x562f=['[callProgressDetectingCustomer][logNoAnswer]','cloneAction','countnoanswerretry','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','Congestion','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedRetryFrequency','outboundUnknownCallsDay','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknownGlobal]','destlinkedid','callProgressDetectingAgent','object','isUndefined','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','decrementOriginate','[callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','phone','VoiceQueueId','agents','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','called','logger','Call\x20failed','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','callerid','originatecalleridnum','extractCalleridNumber','setXMDContactVariables','Contact','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','syncOriginateResponse','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','transfer','[syncHangup][talking][transfer]','variables','filterKey','keys','variable','value','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','ioredis','../../../config/logger','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','defaults','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','originated','pTalking','sendMessageOneNotActive','CAMPAIGN_STATUS','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','prototype','syncCampaigns','dialMethod','preview','booked','type','outbound','clearZombieChannels','hasOwnProperty','dialActive','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','size','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','message','NO_AGENTS_LOGGED','isActive','INACTIVE','isTrunkReachable','Trunk','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','totalGlobal','NoSuchNumber','buildObj','verifyAdditionalPhones','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','info','actioncountonusuch','idContact','incrementPreviewCounters','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','acw','channelAgent','custom:agentcomplete','complete','outboundAnswerCallsDay','total','decrementTalking','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','countglobal','Busy','custom:agentbusy','busy','additional','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','swapAdditionalPhones','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency'];(function(_0xc10c59,_0x2a3cad){var _0x122809=function(_0x3e8e30){while(--_0x3e8e30){_0xc10c59['push'](_0xc10c59['shift']());}};_0x122809(++_0x2a3cad);}(_0x562f,0x1b8));var _0xf562=function(_0x5d0eb8,_0x40c598){_0x5d0eb8=_0x5d0eb8-0x0;var _0x32d89b=_0x562f[_0x5d0eb8];return _0x32d89b;};'use strict';var util=require(_0xf562('0x0'));var _=require(_0xf562('0x1'));var uuid=require('uuid');var moment=require('moment');var Redis=require(_0xf562('0x2'));var config=require('../../../config/environment');var logger=require(_0xf562('0x3'))('preview');var loggerAction=require(_0xf562('0x3'))(_0xf562('0x4'));var ami=require('../ami');var rpcDb=require(_0xf562('0x5'));var cmHopperAdditionalPhone=require(_0xf562('0x6'));var Action=require(_0xf562('0x7'));var ut=require(_0xf562('0x8'));var utils=require('../dialer/utils');config[_0xf562('0x9')]=_[_0xf562('0xa')](config[_0xf562('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf562('0x9')]));var Sequence=function(){};Sequence['prototype'][_0xf562('0xb')]=function(_0x50616d){this[_0xf562('0xc')]=this['tail']?this[_0xf562('0xc')]['finally'](_0x50616d):_0x50616d();};function Preview(_0x12fe1b){this[_0xf562('0xd')]=new Sequence();this[_0xf562('0xe')]=_0x12fe1b[_0xf562('0xf')];this[_0xf562('0x10')]=_0x12fe1b['trunks'];this[_0xf562('0x11')]={};this['agents']=_0x12fe1b['agents'];this[_0xf562('0x12')]=0x0;ami['on'](_0xf562('0x13'),this['syncOriginateResponse'][_0xf562('0x14')](this));ami['on'](_0xf562('0x15'),this[_0xf562('0x16')]['bind'](this));ami['on'](_0xf562('0x17'),this[_0xf562('0x18')]['bind'](this));ami['on'](_0xf562('0x19'),this[_0xf562('0x1a')][_0xf562('0x14')](this));ami['on'](_0xf562('0x1b'),this[_0xf562('0x1c')][_0xf562('0x14')](this));ami['on'](_0xf562('0x1d'),this['syncVarSet'][_0xf562('0x14')](this));ami['on'](_0xf562('0x1e'),this[_0xf562('0x1f')]['bind'](this));ami['on']('blindtransfer',this[_0xf562('0x20')]['bind'](this));this[_0xf562('0x21')](this['campaignsPreview']);}function emit(_0x379df5,_0x4747a1,_0x5bfcac){io['to'](_0x379df5)[_0xf562('0x22')](_0x4747a1,_0x5bfcac);}function emitVoiceQueueChannelRemove(_0x5c8553){logger['info'](_0xf562('0x23'),JSON[_0xf562('0x24')](_0x5c8553));emit(util[_0xf562('0x25')](_0xf562('0x26'),_0x5c8553[_0xf562('0x27')]),_0xf562('0x28'),_0x5c8553);io[_0xf562('0x22')](_0xf562('0x29'),_0x5c8553);}function notSendMessagesQueue(_0x18b7dd){if(_0x18b7dd['sendMessageOneNotActive']){if(_0x18b7dd[_0xf562('0x2a')]===0x0&&_0x18b7dd[_0xf562('0x2b')]===0x0){_0x18b7dd[_0xf562('0x2c')]=![];_0x18b7dd['available']=0x0;_0x18b7dd['paused']=0x0;_0x18b7dd['message']=utils[_0xf562('0x2d')]['INACTIVE'];ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x18b7dd[_0xf562('0x27')]+_0xf562('0x2e'));}else{_0x18b7dd['message']=utils['CAMPAIGN_STATUS'][_0xf562('0x2f')];ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x18b7dd[_0xf562('0x27')]+_0xf562('0x30'));}}}Preview[_0xf562('0x31')]['loopCampaigns']=function(){var _0x4aa6e3=this;setInterval(function(){_0x4aa6e3['syncCampaigns']();},0x7cf);};Preview['prototype'][_0xf562('0x32')]=function(){var _0x361520=this[_0xf562('0xe')];this[_0xf562('0x12')]+=0x1;for(var _0x86b16d in _0x361520){if(_0x361520['hasOwnProperty'](_0x86b16d)&&(_0x361520[_0x86b16d][_0xf562('0x33')]===_0xf562('0x34')||_0x361520[_0x86b16d][_0xf562('0x33')]===_0xf562('0x35'))&&_0x361520[_0x86b16d][_0xf562('0x36')]===_0xf562('0x37')){if(this[_0xf562('0x12')]>0x7){this[_0xf562('0x12')]=0x0;this[_0xf562('0x38')]();}}if(_0x361520[_0xf562('0x39')](_0x86b16d)&&_0x361520[_0x86b16d][_0xf562('0x33')]==='preview'&&_0x361520[_0x86b16d]['type']===_0xf562('0x37')){if(_0x361520[_0x86b16d][_0xf562('0x3a')]){this['setMessage'](_0x361520[_0x86b16d]);if(_0x361520[_0x86b16d][_0xf562('0x3b')])this[_0xf562('0x3c')](_0x361520[_0x86b16d]);}else{notSendMessagesQueue(_0x361520[_0x86b16d]);}}}};Preview['prototype'][_0xf562('0x3d')]=function(_0x4860a6){var _0x28000e=this;this['sequence'][_0xf562('0xb')](function(){if(!_[_0xf562('0x3e')](_0x28000e['actions'][_0x4860a6])){loggerAction['info'](_0xf562('0x3f'),_0x4860a6,_0xf562('0x40'),_0x28000e[_0xf562('0x11')][_0x4860a6][_0xf562('0x41')],_0xf562('0x42'),JSON[_0xf562('0x24')](_0x28000e[_0xf562('0xe')][_0x28000e[_0xf562('0x11')][_0x4860a6][_0xf562('0x41')]]['originated']),_0xf562('0x43'),JSON[_0xf562('0x24')](_0x28000e['campaignsPreview'][_0x28000e['actions'][_0x4860a6][_0xf562('0x41')]][_0xf562('0x2b')]),JSON[_0xf562('0x24')](_0x28000e[_0xf562('0x11')][_0x4860a6][_0xf562('0x44')]),JSON[_0xf562('0x24')](_[_0xf562('0x45')](_0x28000e['actions'][_0x4860a6],[_0xf562('0x46'),_0xf562('0x47'),'VoiceQueueId',_0xf562('0x48')])));return ami[_0xf562('0x49')]({'action':_0xf562('0x4a'),'channel':_0x28000e['actions'][_0x4860a6][_0xf562('0x4b')]})[_0xf562('0x4c')](function(_0xed0e33){if(_0xed0e33['message']===_0xf562('0x4d')){setTimeout(function(){if(_0x28000e[_0xf562('0x11')][_0x4860a6]){utils['decrementOriginate'](_0x28000e[_0xf562('0xe')][_0x28000e['actions'][_0x4860a6]['queue']],_0xf562('0x4e'));if(_0x28000e[_0xf562('0x11')][_0x4860a6][_0xf562('0x44')]===!![]){ut['decrementTalking'](_0x28000e[_0xf562('0xe')][_0x28000e[_0xf562('0x11')][_0x4860a6]['queue']],_0xf562('0x4e'));ut[_0xf562('0x4f')](_0xf562('0x50')+_0x4860a6,_0x28000e[_0xf562('0x11')][_0x4860a6]['queue']);}ut[_0xf562('0x4f')]('[Dialer][checkChannel][Preview]'+_0x4860a6,_0x28000e[_0xf562('0x11')][_0x4860a6][_0xf562('0x41')]);delete _0x28000e[_0xf562('0x11')][_0x4860a6];}},0x2328);}});}});};Preview[_0xf562('0x31')][_0xf562('0x38')]=function(){var _0x177a76=this;loggerAction['info'](_0xf562('0x51'),_[_0xf562('0x52')](this[_0xf562('0x11')]));for(var _0x90f57c in this[_0xf562('0x11')]){if(_0x177a76[_0xf562('0x11')][_0xf562('0x39')](_0x90f57c)){_0x177a76[_0xf562('0x3d')](_0x90f57c);}}};Preview[_0xf562('0x31')][_0xf562('0x3c')]=function(_0x5d3212){var _0xf6b52=this;rpcDb['getContactRecallMe'](_0x5d3212['id'],ut[_0xf562('0x53')](this['agents']))[_0xf562('0x54')](function(_0x3e78a2){if(!_[_0xf562('0x3e')](_0x3e78a2)){for(var _0x5ce168=0x0;_0x5ce168<_0x3e78a2['length'];_0x5ce168+=0x1){if(ut[_0xf562('0x55')](_0x3e78a2[_0x5ce168][_0xf562('0x56')])<_0x5d3212[_0xf562('0x57')]*0x3c){if(_0x3e78a2[_0x5ce168][_0xf562('0x58')]&&!_0x3e78a2[_0x5ce168][_0xf562('0x58')][_0xf562('0x59')]){_0xf6b52[_0xf562('0x5a')](_0x3e78a2[_0x5ce168]['id'])[_0xf562('0x54')](ut['logger2'](_0xf562('0x5b')))[_0xf562('0x4c')](ut[_0xf562('0x5c')](_0xf562('0x5b')));}else{rpcDb[_0xf562('0x5d')](_0x3e78a2[_0x5ce168]['id']);}}else{var _0x5d3cd3=new Action(_0x3e78a2[_0x5ce168],_0x5d3212);_0x5d3cd3[_0xf562('0x5e')]=moment()[_0xf562('0x25')](_0xf562('0x5f'));_0x5d3212[_0xf562('0x60')]+=0x1;ut[_0xf562('0x61')](_0x5d3cd3,0x17,_0xf562('0x62'));if(_0x5d3212[_0xf562('0x63')]){rpcDb['rescheduleContactInQueue'](ut[_0xf562('0x64')](_0x3e78a2[_0x5ce168]));rpcDb[_0xf562('0x65')](_0x5d3cd3,_0xf562('0x66'));}else{ut[_0xf562('0x61')](_0x5d3cd3,0x16,_0xf562('0x67'));rpcDb[_0xf562('0x65')](_0x5d3cd3,'[HistoryRecallClose]');rpcDb[_0xf562('0x68')](_0x5d3cd3,_0xf562('0x69'));}}}}})[_0xf562('0x4c')](ut['logger2'](_0xf562('0x6a')));};Preview[_0xf562('0x31')]['setMessage']=function(_0x1239f8){_0x1239f8['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0x1239f8['loggedIn'])){_0x1239f8[_0xf562('0x6b')]=utils[_0xf562('0x2d')][_0xf562('0x6c')];}else if(!ut[_0xf562('0x6d')](_0x1239f8[_0xf562('0x3a')])){_0x1239f8[_0xf562('0x6b')]=utils['CAMPAIGN_STATUS'][_0xf562('0x6e')];}else if(!this[_0xf562('0x6f')](_0x1239f8[_0xf562('0x70')])){if(!this[_0xf562('0x6f')](_0x1239f8[_0xf562('0x71')])){_0x1239f8[_0xf562('0x6b')]=utils[_0xf562('0x2d')]['UNREACHABLE_TRUNK'];}else{_0x1239f8['message']=utils[_0xf562('0x2d')]['ACTIVE'];}}else{_0x1239f8[_0xf562('0x6b')]=utils[_0xf562('0x2d')][_0xf562('0x72')];}};Preview['prototype'][_0xf562('0x73')]=function(_0x540c79,_0x1014a3,_0x250894){var _0x216bdd=this;var _0x326af0=this[_0xf562('0x11')][_0x1014a3];var _0x12927d=this['campaignsPreview'][_0x326af0[_0xf562('0x41')]];var _0x525977;var _0x54d3f2=![];var _0x219362=0x2;var _0x139731=0x3;if(_0x12927d){switch(_0x250894){case'1':_0x12927d['outboundNoSuchCallsDay']+=0x1;_0x326af0[_0xf562('0x74')]+=0x1;_0x326af0['countglobal']=ut[_0xf562('0x75')](_0x326af0);ut[_0xf562('0x61')](_0x326af0,0x0,_0xf562('0x76'));ami['emit']('custom:agentnosuchnumber',ut[_0xf562('0x77')](_0x326af0,'nosuchnumber'));rpcDb[_0xf562('0x65')](_0x326af0,'[callProgressDetectingCustomer][logNoSuch]');_0x216bdd[_0xf562('0x78')](_0x326af0,'0',_0x12927d)[_0xf562('0x54')](function(_0x342d6b){_0x54d3f2=_0x342d6b['additional']==0x1;_0x219362=_0x12927d[_0xf562('0x79')];_0x139731=_0x12927d[_0xf562('0x7a')];if(!_0x54d3f2){if(ut[_0xf562('0x75')](_0x326af0)>=_0x12927d[_0xf562('0x7b')]){_0x525977=ut['cloneAction'](_0x326af0,0xf,_0xf562('0x7c'));rpcDb['createCustomerFinal'](_0x525977,_0xf562('0x7d'));}else{if(_0x326af0['countnosuchnumberretry']>=_0x12927d[_0xf562('0x7e')]){rpcDb[_0xf562('0x68')](_0x326af0,_0xf562('0x7d'));}else{rpcDb[_0xf562('0x7f')](ut[_0xf562('0x80')](_0x326af0,'countnosuchnumberretry',_0x12927d[_0xf562('0x79')]),_0x326af0[_0xf562('0x81')],_0x326af0[_0xf562('0x82')]);}}delete this[_0xf562('0x11')][_0x540c79[_0xf562('0x83')]];}else{_0x326af0[_0xf562('0x74')]++;logger[_0xf562('0x84')](_0xf562('0x85'),_0x326af0[_0xf562('0x74')]);logger['info']('id',_0x326af0[_0xf562('0x86')]);_0x216bdd[_0xf562('0x87')]({'id':_0x326af0[_0xf562('0x86')],'field':{'countnosuchnumberretry':_0x326af0[_0xf562('0x74')]}})[_0xf562('0x54')](function(){_0x216bdd['swapAdditionalPhones'](_0x326af0,_0x219362,_0x139731)[_0xf562('0x54')](function(){});});}});break;case _0xf562('0x88'):var _0x302265=moment()[_0xf562('0x25')](_0xf562('0x5f'));_0x326af0[_0xf562('0x89')]=_0x302265;_0x326af0['answertime']=_0x302265;_0x326af0[_0xf562('0x44')]=!![];_0x12927d[_0xf562('0x2b')]+=0x1;logger[_0xf562('0x84')](_0xf562('0x8a'),_0x326af0[_0xf562('0x8b')],'\x20Queue',_0x12927d['name'],'pTalking:\x20',_0x12927d['pTalking']);ami[_0xf562('0x22')](_0xf562('0x8c'),ut['buildObj'](_0x326af0,_0xf562('0x8d'),this['campaignsPreview'][_0x326af0[_0xf562('0x41')]]));if(_0x12927d[_0xf562('0x8e')]||_0x12927d['mandatoryDisposition']){ami[_0xf562('0x22')]('custom:agentConnectPreview',{'queue':_0x326af0[_0xf562('0x41')],'interface':_0x326af0[_0xf562('0x8f')],'uniqueid':_0x326af0['uniqueid']});}break;case'16':ami[_0xf562('0x22')](_0xf562('0x90'),ut['buildObj'](_0x326af0,_0xf562('0x91'),this[_0xf562('0xe')][_0x326af0[_0xf562('0x41')]]));emitVoiceQueueChannelRemove(ut[_0xf562('0x77')](_0x326af0,'complete'));_0x12927d[_0xf562('0x92')]+=0x1;_0x12927d[_0xf562('0x93')]+=0x1;_0x12927d['answered']+=0x1;ut[_0xf562('0x94')](_0x12927d,_0xf562('0x95'));_0x326af0['countglobal']=ut['totalGlobal'](_0x326af0);ut[_0xf562('0x61')](_0x326af0,0x4,'Answer');rpcDb[_0xf562('0x65')](_0x326af0,_0xf562('0x96'));rpcDb[_0xf562('0x68')](_0x326af0,_0xf562('0x97'));rpcDb[_0xf562('0x98')](_0x326af0);_0x12927d[_0xf562('0x99')]+=_0x326af0[_0xf562('0x9a')];_0x12927d[_0xf562('0x9b')]+=_0x326af0[_0xf562('0x9a')];logger[_0xf562('0x84')](_0xf562('0x9c'),_0x326af0[_0xf562('0x8b')],_0xf562('0x9d'),_0x12927d[_0xf562('0x27')],'pTalking:\x20',_0x12927d[_0xf562('0x2b')]);delete this['actions'][_0x540c79[_0xf562('0x83')]];break;case'BUSY':_0x12927d[_0xf562('0x9e')]+=0x1;_0x326af0[_0xf562('0x9f')]+=0x1;_0x326af0[_0xf562('0xa0')]=ut[_0xf562('0x75')](_0x326af0);ut[_0xf562('0x61')](_0x326af0,0x5,_0xf562('0xa1'));_0x219362=_0x12927d['dialBusyRetryFrequency'];_0x139731=_0x12927d['callAdditionalPhoneAfterMin'];ami['emit'](_0xf562('0xa2'),ut['buildObj'](_0x326af0,_0xf562('0xa3')));rpcDb[_0xf562('0x65')](_0x326af0,'[callProgressDetectingCustomer][logBusy]');_0x216bdd[_0xf562('0x78')](_0x326af0,'5',_0x12927d)[_0xf562('0x54')](function(_0x26bc65){_0x54d3f2=_0x26bc65[_0xf562('0xa4')]==0x1;if(!_0x54d3f2){if(ut['totalGlobal'](_0x326af0)>=_0x12927d[_0xf562('0x7b')]){_0x525977=ut['cloneAction'](_0x326af0,0xf,_0xf562('0x7c'));rpcDb['createCustomerFinal'](_0x525977,_0xf562('0xa5'));}else{if(_0x326af0[_0xf562('0x9f')]>=_0x12927d[_0xf562('0xa6')]){rpcDb['createCustomerFinal'](_0x326af0,_0xf562('0xa7'));}else{rpcDb[_0xf562('0x7f')](ut[_0xf562('0x80')](_0x326af0,'countbusyretry',_0x12927d[_0xf562('0xa8')]),_0x326af0[_0xf562('0x81')],_0x326af0['activeContact']);}}}else{_0x326af0[_0xf562('0x9f')]++;_0x216bdd['incrementPreviewCounters']({'id':_0x326af0[_0xf562('0x86')],'field':{'countbusyretry':_0x326af0[_0xf562('0x9f')]}})[_0xf562('0x54')](function(){_0x216bdd[_0xf562('0xa9')](_0x326af0,_0x219362,_0x139731)[_0xf562('0x54')](function(){});});}});break;case _0xf562('0xaa'):_0x12927d[_0xf562('0xab')]+=0x1;_0x326af0['countnoanswerretry']+=0x1;_0x326af0[_0xf562('0xa0')]=ut['totalGlobal'](_0x326af0);ut['logCustomer'](_0x326af0,0x3,_0xf562('0xac'));_0x219362=_0x12927d[_0xf562('0xad')];_0x139731=_0x12927d[_0xf562('0x7a')];var _0x1e40f6=ut['buildNoAnswerEventPayload'](_0x326af0,_0x12927d);ami[_0xf562('0x22')]('custom:agentnoanswer',_0x1e40f6);rpcDb['createCustomerHistory'](_0x326af0,_0xf562('0xae'));_0x216bdd[_0xf562('0x78')](_0x326af0,'3',_0x12927d)[_0xf562('0x54')](function(_0x39de1b){_0x54d3f2=_0x39de1b[_0xf562('0xa4')]==0x1;if(!_0x54d3f2){if(ut[_0xf562('0x75')](_0x326af0)>=_0x12927d[_0xf562('0x7b')]){_0x525977=ut[_0xf562('0xaf')](_0x326af0,0xf,_0xf562('0x7c'));rpcDb[_0xf562('0x68')](_0x525977,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x326af0[_0xf562('0xb0')]>=_0x12927d[_0xf562('0xb1')]){rpcDb['createCustomerFinal'](_0x326af0,_0xf562('0xae'));}else{rpcDb[_0xf562('0x7f')](ut[_0xf562('0x80')](_0x326af0,_0xf562('0xb0'),_0x12927d[_0xf562('0xad')]),_0x326af0[_0xf562('0x81')],_0x326af0['activeContact']);}}}else{_0x326af0[_0xf562('0xb0')]++;_0x216bdd[_0xf562('0x87')]({'id':_0x326af0[_0xf562('0x86')],'field':{'countnoanswerretry':_0x326af0['countnoanswerretry']}})[_0xf562('0x54')](function(){_0x216bdd[_0xf562('0xa9')](_0x326af0,_0x219362,_0x139731)[_0xf562('0x54')](function(){});});}});break;case _0xf562('0xb2'):_0x12927d['outboundCongestionCallsDay']+=0x1;_0x326af0[_0xf562('0xb3')]+=0x1;_0x326af0[_0xf562('0xa0')]=ut[_0xf562('0x75')](_0x326af0);ut[_0xf562('0x61')](_0x326af0,0x8,_0xf562('0xb4'));_0x219362=_0x12927d[_0xf562('0xb5')];_0x139731=_0x12927d['callAdditionalPhoneAfterMin'];ami['emit']('custom:agentcongestion',ut[_0xf562('0x77')](_0x326af0,_0xf562('0xb6')));rpcDb['createCustomerHistory'](_0x326af0,_0xf562('0xb7'));_0x216bdd[_0xf562('0x78')](_0x326af0,'8',_0x12927d)[_0xf562('0x54')](function(_0x263f70){_0x54d3f2=_0x263f70[_0xf562('0xa4')]==0x1;if(!_0x54d3f2){if(ut[_0xf562('0x75')](_0x326af0)>=_0x12927d[_0xf562('0x7b')]){_0x525977=ut['cloneAction'](_0x326af0,0xf,_0xf562('0x7c'));rpcDb['createCustomerFinal'](_0x525977,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x326af0[_0xf562('0xb3')]>=_0x12927d['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x326af0,_0xf562('0xb7'));}else{rpcDb['rescheduleContact'](ut[_0xf562('0x80')](_0x326af0,_0xf562('0xb3'),_0x12927d[_0xf562('0xa8')]),_0x326af0[_0xf562('0x81')],_0x326af0['activeContact']);}}}else{_0x326af0[_0xf562('0xb3')]++;_0x216bdd[_0xf562('0x87')]({'id':_0x326af0['idContact'],'field':{'countcongestionretry':_0x326af0[_0xf562('0xb3')]}})[_0xf562('0x54')](function(){_0x216bdd['swapAdditionalPhones'](_0x326af0,_0x219362,_0x139731)['then'](function(){});});}});break;case'CANCEL':_0x12927d[_0xf562('0xb8')]+=0x1;_0x326af0[_0xf562('0xb9')]+=0x1;_0x326af0[_0xf562('0xa0')]=ut[_0xf562('0x75')](_0x326af0);ut[_0xf562('0x61')](_0x326af0,0x14,_0xf562('0xba'));_0x219362=_0x12927d['dialAgentRejectRetryFrequency'];_0x139731=_0x12927d[_0xf562('0x7a')];ami[_0xf562('0x22')](_0xf562('0xbb'),ut['buildObj'](_0x326af0,_0xf562('0xbc')));rpcDb['createCustomerHistory'](_0x326af0,_0xf562('0xbd'));_0x216bdd['verifyAdditionalPhones'](_0x326af0,'20',_0x12927d)[_0xf562('0x54')](function(_0x4590a3){_0x54d3f2=_0x4590a3[_0xf562('0xa4')]==0x1;if(!_0x54d3f2){if(ut[_0xf562('0x75')](_0x326af0)>=_0x12927d[_0xf562('0x7b')]){_0x525977=ut[_0xf562('0xaf')](_0x326af0,0x14,_0xf562('0xba'));rpcDb[_0xf562('0x68')](_0x525977,_0xf562('0xbe'));}else{if(_0x326af0[_0xf562('0xb9')]>=_0x12927d['dialAgentRejectMaxRetry']){rpcDb['createCustomerFinal'](_0x326af0,_0xf562('0xbe'));}else{rpcDb[_0xf562('0x7f')](ut['scheduledAt'](_0x326af0,_0xf562('0xb9'),_0x12927d[_0xf562('0xbf')]),_0x326af0[_0xf562('0x81')],_0x326af0[_0xf562('0x82')]);}}}else{_0x326af0[_0xf562('0xb0')]++;_0x216bdd[_0xf562('0x87')]({'id':_0x326af0[_0xf562('0x86')],'field':{'countnoanswerretry':_0x326af0[_0xf562('0xb0')]}})[_0xf562('0x54')](function(){_0x216bdd[_0xf562('0xa9')](_0x326af0,_0x219362,_0x139731)[_0xf562('0x54')](function(){});});}});break;case _0xf562('0xc0'):_0x12927d['outboundAbandonedCallsDay']+=0x1;_0x326af0[_0xf562('0xc1')]+=0x1;_0x326af0[_0xf562('0xa0')]=ut['totalGlobal'](_0x326af0);ut[_0xf562('0x61')](_0x326af0,0xb,_0xf562('0xc2'));rpcDb[_0xf562('0x65')](_0x326af0,_0xf562('0xc3'));_0x216bdd['verifyAdditionalPhones'](_0x326af0,'11',_0x12927d)['then'](function(_0x4d8e4c){_0x54d3f2=_0x4d8e4c[_0xf562('0xa4')]==0x1;if(!_0x54d3f2){if(ut[_0xf562('0x75')](_0x326af0)>=_0x12927d['dialGlobalMaxRetry']){_0x525977=ut['cloneAction'](_0x326af0,0xf,_0xf562('0x7c'));rpcDb[_0xf562('0x68')](_0x525977,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x326af0['countabandonedetry']>=_0x12927d['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x326af0,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xf562('0x7f')](ut['scheduledAt'](_0x326af0,_0xf562('0xc1'),_0x12927d[_0xf562('0xc4')]),_0x326af0[_0xf562('0x81')],_0x326af0[_0xf562('0x82')]);}}}else{_0x326af0[_0xf562('0xb0')]++;_0x216bdd[_0xf562('0x87')]({'id':_0x326af0[_0xf562('0x86')],'field':{'countnoanswerretry':_0x326af0['countnoanswerretry']}})[_0xf562('0x54')](function(){_0x216bdd[_0xf562('0xa9')](_0x326af0,_0x219362,_0x139731)[_0xf562('0x54')](function(){});});}});break;case'18':_0x12927d[_0xf562('0xc5')]+=0x1;_0x326af0['countmachineretry']+=0x1;_0x326af0['countglobal']=ut[_0xf562('0x75')](_0x326af0);ut[_0xf562('0x61')](_0x326af0,0x12,_0x540c79[_0xf562('0xc6')]||_0x540c79[_0xf562('0xc7')]);ami[_0xf562('0x22')]('custom:amd',ut['buildObj'](_0x326af0,_0xf562('0xc8')));rpcDb['createCustomerHistory'](_0x326af0,_0xf562('0xc9'));_0x216bdd['verifyAdditionalPhones'](_0x326af0,'18',_0x12927d)[_0xf562('0x54')](function(_0x23c40f){_0x54d3f2=_0x23c40f[_0xf562('0xa4')]==0x1;if(!_0x54d3f2){if(ut[_0xf562('0x75')](_0x326af0)>=_0x12927d[_0xf562('0x7b')]){_0x525977=ut[_0xf562('0xaf')](_0x326af0,0x12,'Global');rpcDb[_0xf562('0x68')](_0x525977,_0xf562('0xc9'));}else{rpcDb[_0xf562('0x68')](_0x326af0,_0xf562('0xc9'));}}else{_0x326af0[_0xf562('0xb0')]++;_0x216bdd[_0xf562('0x87')]({'id':_0x326af0[_0xf562('0x86')],'field':{'countnoanswerretry':_0x326af0[_0xf562('0xb0')]}})[_0xf562('0x54')](function(){_0x216bdd['swapAdditionalPhones'](_0x326af0,_0x219362,_0x139731)[_0xf562('0x54')](function(){});});}});delete this[_0xf562('0x11')][_0x540c79[_0xf562('0x83')]];break;case'19':_0x12927d[_0xf562('0xc5')]+=0x1;_0x326af0[_0xf562('0xa0')]=ut['totalGlobal'](_0x326af0);ut[_0xf562('0x61')](_0x326af0,0x13,_0x540c79['cause-txt']||_0x540c79[_0xf562('0xc7')]);ami[_0xf562('0x22')](_0xf562('0xca'),ut[_0xf562('0x77')](_0x326af0,_0xf562('0xc8')));rpcDb[_0xf562('0x65')](_0x326af0,_0xf562('0xcb'));_0x216bdd['verifyAdditionalPhones'](_0x326af0,'18',_0x12927d)[_0xf562('0x54')](function(_0x5794a3){_0x54d3f2=_0x5794a3[_0xf562('0xa4')]==0x1;if(!_0x54d3f2){if(ut[_0xf562('0x75')](_0x326af0)>=_0x12927d[_0xf562('0x7b')]){_0x525977=ut[_0xf562('0xaf')](_0x326af0,0xf,_0xf562('0x7c'));rpcDb[_0xf562('0x68')](_0x525977,_0xf562('0xcb'));}else{rpcDb['createCustomerFinal'](_0x326af0,_0xf562('0xcb'));}}else{_0x326af0[_0xf562('0xb0')]++;_0x216bdd[_0xf562('0x87')]({'id':_0x326af0[_0xf562('0x86')],'field':{'countnoanswerretry':_0x326af0['countnoanswerretry']}})['then'](function(){_0x216bdd[_0xf562('0xa9')](_0x326af0,_0x219362,_0x139731)[_0xf562('0x54')](function(){});});}});delete this[_0xf562('0x11')][_0x540c79[_0xf562('0x83')]];break;default:if(_0x326af0['dialAnswer']){ut['decrementTalking'](_0x12927d,_0xf562('0xcc'));ut[_0xf562('0x4f')]('[Dialer][decrementTalking][no\x20Hangup][Preview]'+_0x12927d[_0xf562('0x27')],_0x540c79);}_0x12927d['outboundUnknownCallsDay']+=0x1;_0x326af0[_0xf562('0xa0')]=ut[_0xf562('0x75')](_0x326af0);ut[_0xf562('0x61')](_0x326af0,0xc,_0x540c79[_0xf562('0xc6')]||_0x540c79['dialstatus']);_0x219362=_0x12927d[_0xf562('0xbf')];_0x139731=_0x12927d[_0xf562('0x7a')];rpcDb[_0xf562('0x65')](_0x326af0,'[callProgressDetectingCustomer][logUnknown]');_0x216bdd[_0xf562('0x78')](_0x326af0,'20',_0x12927d)[_0xf562('0x54')](function(_0xaf6625){_0x54d3f2=_0xaf6625[_0xf562('0xa4')]==0x1;if(!_0x54d3f2){if(ut[_0xf562('0x75')](_0x326af0)>=_0x12927d[_0xf562('0x7b')]){_0x525977=ut[_0xf562('0xaf')](_0x326af0,0xf,_0xf562('0x7c'));rpcDb[_0xf562('0x68')](_0x525977,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xf562('0x68')](_0x326af0,_0xf562('0xcd'));}delete this[_0xf562('0x11')][_0x540c79['linkedid']];}else{_0x216bdd[_0xf562('0xa9')](_0x326af0,_0x219362,_0x139731)[_0xf562('0x54')](function(){});}});}if(!(_0x326af0[_0xf562('0x44')]&&_0x250894==='16')){utils['decrementOriginate'](_0x12927d,'[callProgressDetectingCustomer]');logger[_0xf562('0x84')]('[originated][decrement][callProgressDetectingCustomer]',_0x326af0[_0xf562('0x8b')],'\x20Queue',_0x12927d[_0xf562('0x27')],_0xf562('0x42'),_0x12927d[_0xf562('0x2a')]);}if(_0x250894!==_0xf562('0x88')){delete this['actions'][_0x540c79['linkedid']];delete this[_0xf562('0x11')][_0x540c79[_0xf562('0xce')]];}_0x12927d['queueSummaryCountersUpdated']=!![];}};Preview[_0xf562('0x31')][_0xf562('0xcf')]=function(_0x5317c1,_0x341611,_0x545487){if(_['isUndefined'](_0x341611)&&_0xf562('0xd0')!==typeof _0x341611){return;}if(_[_0xf562('0xd1')](_0x545487)&&'object'!==typeof _0x545487){return;}switch(_0x545487['reason']){case'0':ut[_0xf562('0xd2')](_0x5317c1,0x0,_0xf562('0x76'));rpcDb[_0xf562('0xd3')](_0x5317c1,_0xf562('0xd4'));break;case'3':ut[_0xf562('0xd2')](_0x5317c1,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x5317c1,_0xf562('0xd5'));break;case'5':ut['logAgent'](_0x5317c1,0x5,'Busy');rpcDb[_0xf562('0xd3')](_0x5317c1,_0xf562('0xd6'));break;case'8':ut[_0xf562('0xd2')](_0x5317c1,0x8,_0xf562('0xb4'));rpcDb['createAgentHistory'](_0x5317c1,_0xf562('0xd7'));break;case'22':ut[_0xf562('0xd2')](_0x5317c1,0x16,_0xf562('0xd8'));rpcDb[_0xf562('0xd3')](_0x5317c1,_0xf562('0xd9'));break;default:ut[_0xf562('0xd2')](_0x5317c1,0xc,_0x545487[_0xf562('0xda')]);rpcDb['createAgentHistory'](_0x5317c1,_0xf562('0xd7'));}utils[_0xf562('0xdb')](_0x341611,_0xf562('0xdc'));logger[_0xf562('0x84')]('[originated][decrement][callProgressDetectingAgent]',_0x5317c1[_0xf562('0x8b')],_0xf562('0x9d'),_0x341611['name'],'originated:\x20',_0x341611['originated']);delete this[_0xf562('0x11')][_0x5317c1[_0xf562('0x8b')]];};Preview[_0xf562('0x31')][_0xf562('0x78')]=function(_0x5d1057,_0x52add3,_0x1885be){return cmHopperAdditionalPhone[_0xf562('0x78')](_0x5d1057,_0x52add3,_0x1885be)[_0xf562('0x4c')](logger[_0xf562('0x84')](_0xf562('0xdd')));};Preview['prototype']['swapAdditionalPhones']=function(_0x20d062,_0x527a91,_0x418790){return cmHopperAdditionalPhone[_0xf562('0xa9')](_0x20d062,_0x527a91,_0x418790)['catch'](logger[_0xf562('0x84')](_0xf562('0xde')));};Preview[_0xf562('0x31')][_0xf562('0x87')]=function(_0x1eb76e){return Promise[_0xf562('0xdf')]()['then'](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x1eb76e))[_0xf562('0x4c')](logger[_0xf562('0x84')]('[incrementPreviewCounters]\x20'));};Preview['prototype'][_0xf562('0xe0')]=function(_0x32de67,_0x6cfcc9,_0x3ad388,_0x402372,_0x5ce445){var _0x3eba86=this;return new Promise(function(_0x410e77,_0x3d327f){if(_[_0xf562('0x3e')](_0x6cfcc9)||_[_0xf562('0x3e')](_0x6cfcc9['Contact'])||_[_0xf562('0x3e')](_0x6cfcc9[_0xf562('0xe1')])||_[_0xf562('0x3e')](_0x6cfcc9[_0xf562('0xe2')])){_0x3d327f(ut[_0xf562('0x6b')]('Contact\x20is\x20undefined',_0x402372,_0x5ce445));return;}var _0xd3fcc5=uuid['v4']();var _0x4b3979=_0x3eba86[_0xf562('0xe')][_0x6cfcc9['Queue'][_0xf562('0x27')]];var _0x194190=_0x3ad388?_0x3eba86[_0xf562('0xe3')][_0x3ad388]['id']:undefined;_0x3eba86[_0xf562('0x11')][_0xd3fcc5]=new Action(_0x6cfcc9,_0x4b3979,_0xd3fcc5,_0x3ad388,_0x194190);var _0x1f3380=_0x3eba86[_0xf562('0x11')][_0xd3fcc5];_0x1f3380[_0xf562('0x81')]=_0x402372;_0x1f3380[_0xf562('0x82')]=_0x5ce445;_0x1f3380[_0xf562('0xe4')]=_0x3ad388;if(_['isEmpty'](_0x32de67)){_0x3eba86[_0xf562('0xe5')](_0x1f3380,_0x4b3979,_0x6cfcc9,_0x3ad388)[_0xf562('0x54')](function(_0x57348b){logger['info'](_0xf562('0xe6'),_0xf562('0xe7')+_0x1f3380[_0xf562('0x41')]+'\x20IdHopper:\x20'+_0x1f3380[_0xf562('0x86')],JSON['stringify'](_0x57348b));ami['emit']('custom:agentcalled',ut[_0xf562('0x77')](_0x1f3380,_0xf562('0xe8'),_0x3eba86['campaignsPreview'][_0x1f3380[_0xf562('0x41')]]));_0x410e77(ut[_0xf562('0x6b')]('Calling'));})[_0xf562('0x4c')](function(_0x3a4422){ut[_0xf562('0xe9')]('[Preview][execCall][failure]',_0x3a4422);_0x3d327f(ut[_0xf562('0x6b')](_0xf562('0xea'),_0x402372,_0x5ce445));});}else{_0x4b3979[_0xf562('0xeb')]+=0x1;ut['logBlacklist'](_0x1f3380);rpcDb[_0xf562('0xec')](_0x1f3380,_0xf562('0xed'));delete _0x3eba86[_0xf562('0x11')][_0xd3fcc5];_0x3d327f(ut[_0xf562('0x6b')](_0xf562('0xee'),_0x402372,_0x5ce445));}});};Preview['prototype'][_0xf562('0x6f')]=function(_0x23bcdc){return!_[_0xf562('0x3e')](_0x23bcdc)&&!_[_0xf562('0x3e')](_0x23bcdc['name'])&&!_[_0xf562('0x3e')](_0x23bcdc[_0xf562('0xef')])&&_0x23bcdc[_0xf562('0xef')]&&!_[_0xf562('0x3e')](this[_0xf562('0x10')][util[_0xf562('0x25')](_0xf562('0xf0'),_0x23bcdc['name'])])&&!_[_0xf562('0x3e')](this[_0xf562('0x10')][util[_0xf562('0x25')]('SIP/%s',_0x23bcdc[_0xf562('0x27')])][_0xf562('0x4a')])&&(this['trunks'][util[_0xf562('0x25')]('SIP/%s',_0x23bcdc[_0xf562('0x27')])][_0xf562('0x4a')]==='reachable'||this[_0xf562('0x10')][util[_0xf562('0x25')](_0xf562('0xf0'),_0x23bcdc[_0xf562('0x27')])]['status']===_0xf562('0xf1'));};Preview['prototype']['run']=function(_0x44fed1,_0xa38317){return this[_0xf562('0xf2')](_0x44fed1,_0xa38317)[_0xf562('0x54')](function(_0x23745d){return _['pick'](_0x23745d,['message']);})[_0xf562('0x4c')](function(_0x127f96){if(_0x127f96[_0xf562('0xf3')]){rpcDb[_0xf562('0xf4')](_0x44fed1);}if(_0x127f96[_0xf562('0xef')]){rpcDb[_0xf562('0x5d')](_0x44fed1);}throw _['pick'](_0x127f96,[_0xf562('0x6b')]);});};Preview['prototype'][_0xf562('0xf2')]=function(_0x3f5d45,_0x5d6de6){var _0x1cc7f2=this;var _0x543e8f,_0x3bce3d;return rpcDb[_0xf562('0xf5')](_0x3f5d45)[_0xf562('0x54')](function(_0x52525c){if(!_[_0xf562('0x3e')](_0x52525c[0x0])){_0x3bce3d=_0x52525c[0x0][_0xf562('0xf6')]?![]:!![];_0x543e8f=_0x52525c[0x0][_0xf562('0xf6')]?!![]:![];_0x543e8f=_0x5d6de6?!![]:_0x543e8f;}var _0x2acb5b=_0x1cc7f2[_0xf562('0xf7')](_0x52525c);if(_0x2acb5b[_0xf562('0xf8')]){rpcDb[_0xf562('0xf9')](_['pick'](_0x52525c[0x0],['VoiceQueueId',_0xf562('0xe1')]))['then'](function(_0x1d3af2){_0x1cc7f2[_0xf562('0xe0')](_0x1d3af2,_0x52525c[0x0],_0x5d6de6,_0x3bce3d,_0x543e8f)[_0xf562('0x54')](function(_0x389c1c){return _0x389c1c;})[_0xf562('0x4c')](function(_0x399b80){throw _0x399b80;});})[_0xf562('0x4c')](function(_0x58126f){ut[_0xf562('0xe9')]('[Preview][checkIsBlackList]',_0x58126f);throw ut['message'](_0xf562('0xfa'),_0x3bce3d,_0x543e8f);});}else{throw ut[_0xf562('0x6b')](_0x2acb5b[_0xf562('0x6b')],_0x3bce3d,_0x543e8f);}})['catch'](function(_0x4f3701){ut[_0xf562('0xe9')](_0xf562('0xfb'),_0x4f3701);throw ut[_0xf562('0x6b')]('Call\x20unsuccessful',![],!![]);});};Preview['prototype'][_0xf562('0xf7')]=function(_0xd10d66){if(_[_0xf562('0x3e')](_0xd10d66)||_[_0xf562('0xfc')](_0xd10d66)||!_['isNil'](_0xd10d66[0x0][_0xf562('0x58')])&&_[_0xf562('0x3e')](_0xd10d66[0x0][_0xf562('0x58')]['name'])){ut[_0xf562('0xe9')](_0xf562('0xfd'),_0xd10d66);return{'isValid':![],'message':_0xf562('0xfe')};}var _0x4cb3bd=this[_0xf562('0xe')][_0xd10d66[0x0][_0xf562('0x40')]['name']];_0x4cb3bd['message']=utils['CAMPAIGN_STATUS'][_0xf562('0x72')];if(_[_0xf562('0x3e')](_0x4cb3bd)){ut[_0xf562('0xe9')](_0xf562('0xff'),_0x4cb3bd);return{'isValid':![],'message':_0xf562('0x100')};}if(!this[_0xf562('0x6f')](_0x4cb3bd['Trunk'])){ut[_0xf562('0xe9')](_0xf562('0x101'),_0xf562('0x102')+_0x4cb3bd[_0xf562('0x27')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x4cb3bd[_0xf562('0x71')])){ut[_0xf562('0xe9')](_0xf562('0x101'),_0x4cb3bd[_0xf562('0x27')]+_0xf562('0x103'));return{'isValid':![],'message':_0xf562('0x104')};}}if(!ut['isActive'](_0x4cb3bd[_0xf562('0x3a')])){ut['logger'](_0xf562('0x105'),_0x4cb3bd[_0xf562('0x27')]+_0xf562('0x106'));return{'isValid':![],'message':_0xf562('0x102')+_0x4cb3bd[_0xf562('0x27')]+_0xf562('0x106')};}return{'isValid':!![],'message':_0xf562('0x107')};};Preview['prototype'][_0xf562('0xe5')]=function(_0x26a767,_0x32e30f,_0x3b3846,_0x35174f){var _0x1a1cff=this;return new Promise(function(_0x4ab92c,_0x4b2510){var _0x10b813=_0x26a767['uniqueid'];var _0x3af995=_0x1a1cff[_0xf562('0x6f')](_0x32e30f[_0xf562('0x70')])?util[_0xf562('0x25')](_0xf562('0x108'),_0x32e30f[_0xf562('0x70')][_0xf562('0x27')],_[_0xf562('0x3e')](_0x32e30f['dialPrefix'])?'':_0x32e30f[_0xf562('0x109')][_0xf562('0x10a')]()||'',_0x32e30f[_0xf562('0x10b')]>0x0?_0x3b3846[_0xf562('0xe1')]['substring'](_0x32e30f[_0xf562('0x10b')]):_0x3b3846['phone']):util[_0xf562('0x25')](_0xf562('0x108'),_[_0xf562('0x3e')](_0x32e30f[_0xf562('0x71')])?_0x32e30f[_0xf562('0x70')][_0xf562('0x27')]:_0x32e30f[_0xf562('0x71')]['name'],_[_0xf562('0x3e')](_0x32e30f[_0xf562('0x109')])?'':_0x32e30f[_0xf562('0x109')][_0xf562('0x10a')]()||'',_0x32e30f[_0xf562('0x10b')]>0x0?_0x3b3846[_0xf562('0xe1')][_0xf562('0x10c')](_0x32e30f[_0xf562('0x10b')]):_0x3b3846[_0xf562('0xe1')]);var _0x4e9707=_0x1a1cff['isTrunkReachable'](_0x32e30f[_0xf562('0x70')])?ut[_0xf562('0x10d')](_0x32e30f[_0xf562('0x70')]['callerid'],_0x32e30f[_0xf562('0x10e')],_0x32e30f[_0xf562('0x10f')]>0x0?ut['getCallerIdRandom'](_0x32e30f['dialOriginateCallerIdNumber'],_0x32e30f[_0xf562('0x10f')]):_0x32e30f[_0xf562('0x110')]):ut[_0xf562('0x10d')](_['isNil'](_0x32e30f[_0xf562('0x71')])?_0x32e30f[_0xf562('0x70')][_0xf562('0x111')]:_0x32e30f[_0xf562('0x71')][_0xf562('0x111')],_0x32e30f['dialOriginateCallerIdName'],_0x32e30f[_0xf562('0x10f')]>0x0?ut['getCallerIdRandom'](_0x32e30f[_0xf562('0x110')],_0x32e30f[_0xf562('0x10f')]):_0x32e30f[_0xf562('0x110')]);if(_0x4e9707){_0x26a767['originatecalleridname']=ut['extractCalleridName'](_0x4e9707);_0x26a767[_0xf562('0x112')]=ut[_0xf562('0x113')](_0x4e9707);}var _0x4a4fea=ut['addVariables'](_0x32e30f,_0x3b3846,_0x3af995,_0x4e9707,_0x10b813,_0x26a767);var _0x15ce8a=utils[_0xf562('0x114')](_0x3b3846[_0xf562('0x115')]);Object['assign'](_0x4a4fea,_0x15ce8a);_[_0xf562('0x116')](_0x26a767,ut[_0xf562('0x117')](_0x4a4fea));_0x26a767[_0xf562('0x5e')]=moment()[_0xf562('0x25')]('YYYY-MM-DD\x20HH:mm:ss');_0x32e30f['variables']=_0x4a4fea;var _0x25686c=ut[_0xf562('0x118')](_0x26a767,_0x32e30f,_0x4a4fea,_0x26a767['activeContact'],_0x35174f);return ami['Action'](_0x25686c)[_0xf562('0x54')](function(_0x1e7b9d){_0x32e30f['originated']+=0x1;logger[_0xf562('0x84')](_0xf562('0x119'),_0x10b813,_0xf562('0x9d'),_0x32e30f[_0xf562('0x27')],'originated:\x20',_0x32e30f[_0xf562('0x2a')]);_0x4ab92c(_0x1e7b9d);})[_0xf562('0x4c')](function(_0x3be999){ut[_0xf562('0xd2')](_0x26a767,0xe,_0xf562('0x11a'));rpcDb[_0xf562('0xd3')](_0x26a767,'[originateFailure][logOriginateFailure]');_0x4b2510(_0x3be999);});});};Preview['prototype'][_0xf562('0x1c')]=function(_0x62d792){if(this[_0xf562('0x11')][_0x62d792[_0xf562('0x83')]]){this[_0xf562('0x11')][_0x62d792[_0xf562('0x83')]][_0xf562('0x4b')]=_0x62d792[_0xf562('0x4b')];}};Preview[_0xf562('0x31')][_0xf562('0x11b')]=function(_0x596e9c){var _0x561697=this;var _0x2ccfcb=this[_0xf562('0x11')][_0x596e9c[_0xf562('0x11c')]];if(_0x2ccfcb){if(_0x2ccfcb[_0xf562('0xe4')]&&this[_0xf562('0xe3')][_0x2ccfcb[_0xf562('0xe4')]]){ut[_0xf562('0x11d')](_0x2ccfcb,this[_0xf562('0xe3')][_0x2ccfcb[_0xf562('0xe4')]][_0xf562('0x27')],this['agents'][_0x2ccfcb['lookAgent']]['id']);}var _0x364a17=_[_0xf562('0x11e')](_0x2ccfcb);_0x364a17[_0xf562('0x89')]=moment()[_0xf562('0x25')](_0xf562('0x5f'));var _0x1e0d3c=_0x561697[_0xf562('0xe')][_0x2ccfcb[_0xf562('0x41')]];if(ut[_0xf562('0x11f')](_0x596e9c[_0xf562('0x120')])){if(_0x2ccfcb[_0xf562('0x81')]){rpcDb[_0xf562('0xf4')](_0x2ccfcb['idContact']);}if(_0x2ccfcb[_0xf562('0x82')]){rpcDb['disableContact'](_0x2ccfcb['idContact']);}ami[_0xf562('0x22')](_0xf562('0x121'),ut[_0xf562('0x77')](_0x2ccfcb,_0xf562('0x122'),this['campaignsPreview'][_0x2ccfcb[_0xf562('0x41')]]));this[_0xf562('0xcf')](_0x364a17,_0x1e0d3c,_0x596e9c);}else{_0x2ccfcb[_0xf562('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x364a17,0x4,'Answer');rpcDb[_0xf562('0xd3')](_0x364a17,_0xf562('0x123'));}}};Preview['prototype'][_0xf562('0x16')]=function(_0x35edae){var _0x3de159=this[_0xf562('0x11')][_0x35edae[_0xf562('0x83')]];var _0x58ab52;if(_0x3de159){_0x58ab52=this[_0xf562('0xe')][_0x3de159[_0xf562('0x41')]];logger[_0xf562('0x84')](_0xf562('0x124'),_0x35edae[_0xf562('0x83')],_0xf562('0x9d'),_0x58ab52[_0xf562('0x27')],'pTalking:\x20',_0x58ab52['pTalking']);}if(this[_0xf562('0x11')][_0x35edae[_0xf562('0x83')]]&&_0x35edae[_0xf562('0x83')]!==_0x35edae['uniqueid']){if(_0x35edae[_0xf562('0x125')]==='16'&&this[_0xf562('0x11')][_0x35edae['linkedid']]['dialAnswer']){this[_0xf562('0x73')](_0x35edae,_0x35edae['linkedid'],_0x35edae['cause']);}else if(this[_0xf562('0x11')][_0x35edae[_0xf562('0x83')]][_0xf562('0x44')]){logger['info'](_0xf562('0x126'),_0x35edae[_0xf562('0x83')],_0x35edae['cause'],_0xf562('0x9d'),_0x58ab52[_0xf562('0x27')],_0xf562('0x43'),_0x58ab52[_0xf562('0x2b')]);this[_0xf562('0x73')](_0x35edae,_0x35edae['linkedid'],_0x35edae['cause']);}}else if(_0x3de159&&_[_0xf562('0x3e')](_0x3de159[_0xf562('0x127')])&&_0x58ab52['dialQueueProject']&&_0x35edae[_0xf562('0x83')]===_0x35edae[_0xf562('0x8b')]&&_[_0xf562('0x3e')](_0x35edae[_0xf562('0xda')])&&_0x35edae[_0xf562('0x125')]==='16'&&_0x35edae['channelstate']==='6'&&_[_0xf562('0xd1')](_0x3de159[_0xf562('0x128')])){if(_0x3de159[_0xf562('0x81')]){rpcDb[_0xf562('0xf4')](_0x3de159['idContact']);}if(_0x3de159[_0xf562('0x82')]){rpcDb[_0xf562('0x5d')](_0x3de159[_0xf562('0x86')]);}_0x35edae[_0xf562('0xda')]='22';this[_0xf562('0xcf')](_0x3de159,_0x58ab52,_0x35edae);}else if(_0x3de159&&_0x3de159['transfer']){if(_0x35edae[_0xf562('0x125')]==='16'&&this['actions'][_0x35edae[_0xf562('0x83')]][_0xf562('0x44')]){logger[_0xf562('0x84')](_0xf562('0x129'),_0x35edae[_0xf562('0x83')],_0x35edae['cause'],'\x20Queue',_0x58ab52['name'],'pTalking:\x20',_0x58ab52[_0xf562('0x2b')]);this[_0xf562('0x73')](_0x35edae,_0x35edae[_0xf562('0x83')],_0x35edae['cause']);}else if(this[_0xf562('0x11')][_0x35edae[_0xf562('0x83')]][_0xf562('0x44')]){logger['info'](_0xf562('0x126'),_0x35edae[_0xf562('0x83')],_0x35edae[_0xf562('0x125')],_0xf562('0x9d'),_0x58ab52[_0xf562('0x27')],'pTalking:\x20',_0x58ab52[_0xf562('0x2b')]);this[_0xf562('0x73')](_0x35edae,_0x35edae['linkedid'],_0x35edae['cause']);}}};Preview['prototype'][_0xf562('0x1a')]=function(_0x12ae25){if(this[_0xf562('0x11')][_0x12ae25['destlinkedid']]&&_0x12ae25[_0xf562('0xce')]!==_0x12ae25['destuniqueid']){this[_0xf562('0x73')](_0x12ae25,_0x12ae25[_0xf562('0xce')],_0x12ae25[_0xf562('0xc7')]);}};Preview[_0xf562('0x31')][_0xf562('0x18')]=function(_0x247577){if(this[_0xf562('0x11')][_0x247577[_0xf562('0x83')]]&&_0x247577[_0xf562('0x83')]!==_0x247577[_0xf562('0x8b')]&&!this[_0xf562('0x11')][_0x247577[_0xf562('0x83')]]['dialAnswer']){if(_0x247577[_0xf562('0x125')]==='1'){this[_0xf562('0x73')](_0x247577,_0x247577[_0xf562('0x83')],_0x247577['cause']);}}};Preview[_0xf562('0x31')]['addVariable']=function(_0x134702,_0x6d9790,_0x4bf9fd){if(this[_0xf562('0x11')][_0x134702]){if(_['isNil'](this[_0xf562('0x11')][_0x134702][_0xf562('0x12a')])){this[_0xf562('0x11')][_0x134702]['variables']={};}this[_0xf562('0x11')][_0x134702][_0xf562('0x12a')][_0x6d9790]=_0x4bf9fd;}};Preview[_0xf562('0x31')]['syncVarSet']=function(_0x4c5b48){try{if(!_[_0xf562('0x3e')](_0x4c5b48)){if(ut[_0xf562('0x12b')](_[_0xf562('0x12c')](_0x4c5b48[_0xf562('0x12d')])[0x0])){this['addVariable'](_0x4c5b48[_0xf562('0x8b')],_[_0xf562('0x12c')](_0x4c5b48[_0xf562('0x12d')])[0x0],_0x4c5b48[_0xf562('0x12e')]);}}}catch(_0x51fbb4){logger['error']('[syncVarSet][Preview]',util[_0xf562('0x12f')](_0x51fbb4,{'showHidden':![],'depth':null}));}};Preview[_0xf562('0x31')]['syncAttendedTransfer']=function(_0x176e57){if(_0x176e57){if(this[_0xf562('0x11')][_0x176e57[_0xf562('0x130')]]){this['actions'][_0x176e57[_0xf562('0x130')]][_0xf562('0x128')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0xe51c6){if(_0xe51c6){if(this[_0xf562('0x11')][_0xe51c6['transfererlinkedid']]){this[_0xf562('0x11')][_0xe51c6[_0xf562('0x131')]][_0xf562('0x128')]=!![];}}};module[_0xf562('0x132')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 2fce241..2f0e37e 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 _0xe2d3=['queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','createHistory','catch','[createHistory]\x20','resolve','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','then','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime'];(function(_0x230c5c,_0x46db0d){var _0x1c92f8=function(_0x23a1d7){while(--_0x23a1d7){_0x230c5c['push'](_0x230c5c['shift']());}};_0x1c92f8(++_0x46db0d);}(_0xe2d3,0x1ba));var _0x3e2d=function(_0x5c7e53,_0x174ce5){_0x5c7e53=_0x5c7e53-0x0;var _0x1c9af9=_0xe2d3[_0x5c7e53];return _0x1c9af9;};'use strict';var util=require(_0x3e2d('0x0'));var BPromise=require(_0x3e2d('0x1'));var logger=require('../../../config/logger')(_0x3e2d('0x2'));var cmHopper=require(_0x3e2d('0x3'));var cmHopperHistory=require(_0x3e2d('0x4'));var cmHopperBlack=require(_0x3e2d('0x5'));var agentReportPreview=require(_0x3e2d('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x2bbca0){return function(_0x203beb){logger[_0x3e2d('0x7')](_0x2bbca0,util['inspect'](_0x203beb,{'showHidden':![],'depth':null}));};}function create(_0x4d5100){return cmHopperHistory[_0x3e2d('0x8')](_0x4d5100)[_0x3e2d('0x9')](loggerCatch(_0x3e2d('0xa')));}function createAgent(_0x42e55b){return BPromise[_0x3e2d('0xb')]()['then'](agentReportPreview[_0x3e2d('0x8')](_0x42e55b))[_0x3e2d('0x9')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x4aa777){return cmHopper['moveContactManagedDialer'](_0x4aa777,!![])[_0x3e2d('0x9')](loggerCatch(_0x3e2d('0xc')));}exports['checkIsBlackList']=function(_0x360127){return cmHopperBlack[_0x3e2d('0xd')](_0x360127)[_0x3e2d('0x9')](loggerCatch(_0x3e2d('0xe')));};exports['getContactPreview']=function(_0x3f0c36){return BPromise[_0x3e2d('0xb')]()[_0x3e2d('0xf')](cmHopper[_0x3e2d('0x10')](_0x3f0c36))[_0x3e2d('0x9')](loggerCatch(_0x3e2d('0x11')));};exports[_0x3e2d('0x8')]=function(_0x384342,_0x1db663){create(_0x384342)['catch'](loggerCatch(_0x1db663));moveContact(_0x384342)[_0x3e2d('0x9')](loggerCatch(_0x1db663));};exports[_0x3e2d('0x12')]=function(_0x1bb431,_0x5b104e){createAgent(_0x1bb431)[_0x3e2d('0x9')](loggerCatch(_0x5b104e));};exports[_0x3e2d('0x13')]=function(_0x538d15,_0x470f19){create(_0x538d15)[_0x3e2d('0x9')](loggerCatch(_0x470f19));};exports[_0x3e2d('0x14')]=function(_0x2ed152,_0x2c5353){moveContact(_0x2ed152)[_0x3e2d('0x9')](loggerCatch(_0x2c5353));};exports[_0x3e2d('0x15')]=function(_0x204381,_0x28ac30,_0x25a368){if(_0x28ac30){_0x204381[_0x3e2d('0x16')]=null;}if(_0x25a368){_0x204381['active']=![];}return cmHopper['rescheduleContact'](_0x204381)[_0x3e2d('0x9')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x3abdc0){return cmHopper['countReScheduled'](_0x3abdc0)[_0x3e2d('0x9')](loggerCatch(_0x3e2d('0x17')));};exports[_0x3e2d('0x18')]=function(_0x167ffb){return cmHopper[_0x3e2d('0x18')]({'UserId':null},_0x167ffb,0x1)[_0x3e2d('0x9')](loggerCatch(_0x3e2d('0x19')));};exports[_0x3e2d('0x1a')]=function(_0x4a4ca9){return cmHopper[_0x3e2d('0x18')]({'active':![]},_0x4a4ca9,0x1)[_0x3e2d('0x9')](loggerCatch(_0x3e2d('0x1b')));};exports[_0x3e2d('0x1c')]=function(_0x26e2bc){var _0x5817bd={};_0x5817bd['type']=_0x26e2bc[_0x3e2d('0x1d')];_0x5817bd[_0x3e2d('0x1e')]=_0x26e2bc['uniqueid'];_0x5817bd[_0x3e2d('0x1f')]=_0x26e2bc[_0x3e2d('0x1f')];_0x5817bd[_0x3e2d('0x20')]=_0x26e2bc[_0x3e2d('0x20')];_0x5817bd[_0x3e2d('0x21')]=_0x26e2bc['queue'];_0x5817bd['queuecallerjoinAt']=_0x26e2bc[_0x3e2d('0x22')];_0x5817bd[_0x3e2d('0x23')]=_0x26e2bc[_0x3e2d('0x22')];_0x5817bd[_0x3e2d('0x24')]=0x1;_0x5817bd[_0x3e2d('0x25')]=_0x26e2bc[_0x3e2d('0x26')];_0x5817bd[_0x3e2d('0x27')]=_0x26e2bc['membername'];_0x5817bd[_0x3e2d('0x28')]=_0x3e2d('0x29');_0x5817bd[_0x3e2d('0x2a')]=_0x3e2d('0x2b');_0x5817bd[_0x3e2d('0x2c')]=0x0;_0x5817bd[_0x3e2d('0x2d')]=0x1;_0x5817bd[_0x3e2d('0x2e')]=_0x26e2bc[_0x3e2d('0x2f')];_0x5817bd[_0x3e2d('0x30')]='COMPLETED';return BPromise[_0x3e2d('0xb')]()[_0x3e2d('0xf')](voiceQueueReport['create'](_0x5817bd))[_0x3e2d('0x9')](loggerCatch(_0x3e2d('0x31')));};exports[_0x3e2d('0x32')]=function(_0x6c950,_0x5328a1){return BPromise[_0x3e2d('0xb')]()[_0x3e2d('0xf')](cmHopper[_0x3e2d('0x32')](_0x6c950,_0x5328a1))[_0x3e2d('0x9')](loggerCatch(_0x3e2d('0x33')));};exports[_0x3e2d('0x34')]=function(_0x181ed3){return cmHopper[_0x3e2d('0x15')](_0x181ed3,!![],!![])[_0x3e2d('0x9')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xcebe=['createAgentHistory','createCustomerHistory','UserId','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','preview','../rpc/cmHopper','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','resolve','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','then'];(function(_0x6e0910,_0x2a2ad3){var _0xf23606=function(_0x2db370){while(--_0x2db370){_0x6e0910['push'](_0x6e0910['shift']());}};_0xf23606(++_0x2a2ad3);}(_0xcebe,0x155));var _0xeceb=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xcebe[_0x2d7f0e];return _0x110b07;};'use strict';var util=require(_0xeceb('0x0'));var BPromise=require(_0xeceb('0x1'));var logger=require('../../../config/logger')(_0xeceb('0x2'));var cmHopper=require(_0xeceb('0x3'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0xeceb('0x4'));var voiceQueueReport=require(_0xeceb('0x5'));function loggerCatch(_0x518366){return function(_0x50142a){logger[_0xeceb('0x6')](_0x518366,util[_0xeceb('0x7')](_0x50142a,{'showHidden':![],'depth':null}));};}function create(_0x468bec){return cmHopperHistory[_0xeceb('0x8')](_0x468bec)[_0xeceb('0x9')](loggerCatch(_0xeceb('0xa')));}function createAgent(_0x1257b7){return BPromise[_0xeceb('0xb')]()['then'](agentReportPreview['createHistory'](_0x1257b7))[_0xeceb('0x9')](loggerCatch(_0xeceb('0xa')));}function moveContact(_0x4dcbf5){return cmHopper['moveContactManagedDialer'](_0x4dcbf5,!![])[_0xeceb('0x9')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xeceb('0xc')]=function(_0x47dfe8){return cmHopperBlack[_0xeceb('0xc')](_0x47dfe8)[_0xeceb('0x9')](loggerCatch(_0xeceb('0xd')));};exports[_0xeceb('0xe')]=function(_0x1f1621){return BPromise[_0xeceb('0xb')]()[_0xeceb('0xf')](cmHopper['getContactPreview'](_0x1f1621))[_0xeceb('0x9')](loggerCatch('[getContactPreview]\x20'));};exports[_0xeceb('0x8')]=function(_0x1b740f,_0x1e163d){create(_0x1b740f)[_0xeceb('0x9')](loggerCatch(_0x1e163d));moveContact(_0x1b740f)[_0xeceb('0x9')](loggerCatch(_0x1e163d));};exports[_0xeceb('0x10')]=function(_0x590b46,_0x43ffa9){createAgent(_0x590b46)[_0xeceb('0x9')](loggerCatch(_0x43ffa9));};exports[_0xeceb('0x11')]=function(_0xcd51e9,_0x55fe1d){create(_0xcd51e9)[_0xeceb('0x9')](loggerCatch(_0x55fe1d));};exports['createCustomerFinal']=function(_0x128af9,_0x1224e4){moveContact(_0x128af9)['catch'](loggerCatch(_0x1224e4));};exports['rescheduleContact']=function(_0x18544e,_0x1c1e46,_0x3cce0d){if(_0x1c1e46){_0x18544e[_0xeceb('0x12')]=null;}if(_0x3cce0d){_0x18544e['active']=![];}return cmHopper[_0xeceb('0x13')](_0x18544e)[_0xeceb('0x9')](loggerCatch(_0xeceb('0x14')));};exports[_0xeceb('0x15')]=function(_0x36abec){return cmHopper['countReScheduled'](_0x36abec)[_0xeceb('0x9')](loggerCatch(_0xeceb('0x16')));};exports['unlockContact']=function(_0x63b49){return cmHopper[_0xeceb('0x17')]({'UserId':null},_0x63b49,0x1)[_0xeceb('0x9')](loggerCatch(_0xeceb('0x18')));};exports['disableContact']=function(_0x3ec934){return cmHopper['unlockContact']({'active':![]},_0x3ec934,0x1)['catch'](loggerCatch(_0xeceb('0x19')));};exports[_0xeceb('0x1a')]=function(_0x5de01f){var _0x3c2322={};_0x3c2322[_0xeceb('0x1b')]=_0x5de01f['type'];_0x3c2322[_0xeceb('0x1c')]=_0x5de01f[_0xeceb('0x1c')];_0x3c2322[_0xeceb('0x1d')]=_0x5de01f[_0xeceb('0x1d')];_0x3c2322[_0xeceb('0x1e')]=_0x5de01f[_0xeceb('0x1e')];_0x3c2322[_0xeceb('0x1f')]=_0x5de01f['queue'];_0x3c2322['queuecallerjoinAt']=_0x5de01f[_0xeceb('0x20')];_0x3c2322['queuecallerleaveAt']=_0x5de01f[_0xeceb('0x20')];_0x3c2322[_0xeceb('0x21')]=0x1;_0x3c2322[_0xeceb('0x22')]=_0x5de01f[_0xeceb('0x23')];_0x3c2322[_0xeceb('0x24')]=_0x5de01f[_0xeceb('0x25')];_0x3c2322[_0xeceb('0x26')]=_0xeceb('0x27');_0x3c2322[_0xeceb('0x28')]=_0xeceb('0x29');_0x3c2322['holdtime']=0x0;_0x3c2322[_0xeceb('0x2a')]=0x1;_0x3c2322[_0xeceb('0x2b')]=_0x5de01f[_0xeceb('0x25')];_0x3c2322[_0xeceb('0x2c')]=_0xeceb('0x2d');return BPromise[_0xeceb('0xb')]()[_0xeceb('0xf')](voiceQueueReport[_0xeceb('0x2e')](_0x3c2322))[_0xeceb('0x9')](loggerCatch(_0xeceb('0x2f')));};exports[_0xeceb('0x30')]=function(_0x5d6058,_0x9fe82){return BPromise[_0xeceb('0xb')]()[_0xeceb('0xf')](cmHopper[_0xeceb('0x30')](_0x5d6058,_0x9fe82))[_0xeceb('0x9')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xeceb('0x31')]=function(_0x1e6cdd){return cmHopper[_0xeceb('0x13')](_0x1e6cdd,!![],!![])[_0xeceb('0x9')](loggerCatch(_0xeceb('0x32')));}; \ 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 824ded1..01e7692 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 _0x37cc=['buildObj','agentReadyId','not_inuse','reachable','push','getDiff','milliseconds','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','membername','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','logger','info','loggerError','error','inspect','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','starttime','responsetime','endtime','logAgent','state','statedesc','ringtime','getSeconds','logLookAgent','UserId','logCustomer','talktime','answertime','isFailure','Failure','RECALL','originate','channelAgent','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','motionChannel','mandatoryDisposition'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x37cc,0x162));var _0xc37c=function(_0x21e841,_0x5674c2){_0x21e841=_0x21e841-0x0;var _0x36b0a7=_0x37cc[_0x21e841];return _0x36b0a7;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xc37c('0x0'));var logger=require(_0xc37c('0x1'))(_0xc37c('0x2'));var ipAgi=process[_0xc37c('0x3')][_0xc37c('0x4')]||_0xc37c('0x5');var utils=require(_0xc37c('0x6'));exports[_0xc37c('0x7')]=function(_0x2775fe){return function(_0x561f7a){logger['error'](_0x2775fe,util['inspect'](_0x561f7a,{'showHidden':![],'depth':null}));};};exports[_0xc37c('0x8')]=function(_0x552302,_0x3f54f3){logger[_0xc37c('0x9')](_0x552302,util['inspect'](_0x3f54f3,{'showHidden':![],'depth':null}));};exports[_0xc37c('0xa')]=function(_0x403bb0,_0x104af2){logger[_0xc37c('0xb')](_0x403bb0,util[_0xc37c('0xc')](_0x104af2,{'showHidden':![],'depth':null}));};exports[_0xc37c('0xd')]=function(_0x36cfc1){return function(_0x7f4cc4){logger[_0xc37c('0x9')](_0x36cfc1,util['inspect'](_0x7f4cc4,{'showHidden':![],'depth':null}));};};exports[_0xc37c('0xe')]=function(_0x2346ef,_0x5826f3,_0x18ec90){return{'message':_0x2346ef,'unlock':_0x5826f3,'active':_0x18ec90};};exports[_0xc37c('0xf')]=function(_0x3cbe66,_0x542d5f,_0x3566ec){if(!_[_0xc37c('0x10')](_0x3566ec)&&_0xc37c('0x11')===typeof _0x3566ec&&!_[_0xc37c('0x12')](_0x3566ec)){if(!_[_0xc37c('0x10')](_0x542d5f)&&'string'===typeof _0x542d5f&&!_[_0xc37c('0x12')](_0x542d5f)){return util[_0xc37c('0x13')](_0xc37c('0x14'),_0x542d5f,_0x3566ec);}return util[_0xc37c('0x13')](_0xc37c('0x14'),_0x3566ec,_0x3566ec);}if(!_[_0xc37c('0x10')](_0x3cbe66)&&_0xc37c('0x11')===typeof _0x3cbe66&&!_[_0xc37c('0x12')](_0x3cbe66)){return _0x3cbe66;}return _0xc37c('0x15');};exports[_0xc37c('0x16')]=function(_0x4b261d){if(_[_0xc37c('0x17')](_0x4b261d)){return![];}return _0x4b261d;};exports[_0xc37c('0x18')]=function(_0x3b86de,_0x597191,_0x2060c3,_0x1fc9db,_0x5360f3,_0x2db8d9){var _0xe91af6={'XMD-QUEUE':_0x597191[_0xc37c('0x19')]?_0x597191[_0xc37c('0x19')][_0xc37c('0x1a')]:'','XMD-CALLERID':_0x1fc9db,'XMD-CALLERID-PREVIEW':_0x2db8d9?util['format'](_0xc37c('0x14'),_0x2db8d9[_0xc37c('0x1b')],_0x2db8d9[_0xc37c('0x1c')]):_0x1fc9db,'XMD-DIALID':_0x5360f3,'XMD-CONTACTID':_0x597191[_0xc37c('0x1d')],'XMD-CDRTYPE':_0xc37c('0x1e'),'CALLERID(all)':_0x1fc9db,'XMD-VOICEQUEUEID':_0x597191['VoiceQueueId'],'XMD-DIALCHANNEL':_0x2060c3,'XMD-DIALTIMEOUT':_0x3b86de[_0xc37c('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0xc37c('0x13')]('\x22rtTxX%s%s\x22',_0x3b86de[_0xc37c('0x20')]?'g':'',_[_0xc37c('0x12')](_0x3b86de['monitor_format'])?'':_0xc37c('0x21')),'XMD-DIALURL':_0x3b86de[_0xc37c('0x22')]||'','XMD-AGI':_0x3b86de[_0xc37c('0x23')]?util['format'](_0xc37c('0x24'),ipAgi,_0x3b86de['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x3b86de[_0xc37c('0x20')]?util['format'](_0xc37c('0x24'),ipAgi,_0x3b86de[_0xc37c('0x20')]):_0xc37c('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x2db8d9?_0x2db8d9[_0xc37c('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x2db8d9?_0x2db8d9['originatecalleridname']:'','XMD-DESTINATION':_0xc37c('0x27'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xc37c('0x12')](_0x3b86de[_0xc37c('0x28')])){_0xe91af6[util[_0xc37c('0x13')]('%s',_0xc37c('0x29'))]=_0x3b86de['monitor_format'];_0xe91af6[util[_0xc37c('0x13')]('%s',_0xc37c('0x2a'))]=_0x5360f3;}return _0xe91af6;};exports[_0xc37c('0x2b')]=function(_0x3655b4){var _0x4e47a0={};for(var _0x30ef93 in _0x3655b4){if(_0x3655b4[_0xc37c('0x2c')](_0x30ef93)){_0x4e47a0[util[_0xc37c('0x13')]('%s',_[_0xc37c('0x2d')](_0x30ef93))]=_0x3655b4[_0x30ef93];}}return{'variables':_0x4e47a0};};exports[_0xc37c('0x2e')]=function(_0x4423b4,_0x1f555b){if(!_[_0xc37c('0x17')](_0x4423b4)){if(_0x4423b4[_0xc37c('0x2c')]('originated')){if(_0x4423b4['originated']>0x0){_0x4423b4[_0xc37c('0x2f')]-=0x1;}else{logger[_0xc37c('0xb')](_0xc37c('0x30'),_0x1f555b);}}}else{logger[_0xc37c('0xb')](_0xc37c('0x31'),_0x1f555b);}};exports[_0xc37c('0x32')]=function(_0x43e3a7){var _0x4155a9=moment()[_0xc37c('0x13')](_0xc37c('0x33'));_0x43e3a7['state']=0xd;_0x43e3a7['statedesc']='Blacklist';_0x43e3a7[_0xc37c('0x34')]=_0x4155a9;_0x43e3a7[_0xc37c('0x35')]=_0x4155a9;_0x43e3a7[_0xc37c('0x36')]=_0x4155a9;};exports[_0xc37c('0x37')]=function(_0x111d7a,_0x429f92,_0x4e3df8){var _0x517f8f=moment()['format'](_0xc37c('0x33'));_0x111d7a[_0xc37c('0x38')]=_0x429f92;_0x111d7a[_0xc37c('0x39')]=_0x4e3df8;_0x111d7a[_0xc37c('0x35')]=_0x517f8f;_0x111d7a[_0xc37c('0x3a')]=utils[_0xc37c('0x3b')](_0x111d7a[_0xc37c('0x35')],_0x111d7a['starttime']);};exports[_0xc37c('0x3c')]=function(_0x41962a,_0x5a98e3,_0x5492e2){_0x41962a['membername']=_0x5a98e3;_0x41962a[_0xc37c('0x3d')]=_0x5492e2;};exports[_0xc37c('0x3e')]=function(_0x2672d1,_0x1fa2e3,_0x2921b6){var _0x40d214=moment()[_0xc37c('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x2672d1[_0xc37c('0x38')]=_0x1fa2e3;_0x2672d1[_0xc37c('0x39')]=_0x2921b6;_0x2672d1['responsetime']=_0x2672d1[_0xc37c('0x35')]?_0x2672d1[_0xc37c('0x35')]:_0x40d214;_0x2672d1['endtime']=_0x2672d1['endtime']?_0x2672d1[_0xc37c('0x36')]:_0x40d214;_0x2672d1[_0xc37c('0x3a')]=utils[_0xc37c('0x3b')](_0x2672d1[_0xc37c('0x35')]||0x0,_0x2672d1['starttime']||0x0);_0x2672d1[_0xc37c('0x3f')]=_0x2672d1[_0xc37c('0x40')]?utils[_0xc37c('0x3b')](_0x2672d1[_0xc37c('0x36')],_0x2672d1[_0xc37c('0x40')]):0x0;};exports[_0xc37c('0x41')]=function(_0x36eebc){return _0x36eebc===_0xc37c('0x42');};exports['variablesAction']=function(_0x102a3f,_0x20148a,_0x496eda,_0xbefb28,_0x182dc1){var _0x1f63b1=_0xbefb28?_0xc37c('0x43'):_0x102a3f['calleridname'];_0x1f63b1=_0x182dc1?'BOOKED':_0x1f63b1;return{'actionid':_0x102a3f['uniqueid'],'action':_0xc37c('0x44'),'channel':_0x102a3f[_0xc37c('0x45')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x1f63b1,_0x102a3f[_0xc37c('0x1c')]),'Exten':_0xc37c('0x27'),'Context':_0xc37c('0x46'),'Priority':'1','variable':_0x496eda,'timeout':(_0x20148a[_0xc37c('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x102a3f[_0xc37c('0x48')]};};exports[_0xc37c('0x49')]=function(_0x22077b){return _0x22077b[_0xc37c('0x4a')]+_0x22077b[_0xc37c('0x4b')]+_0x22077b[_0xc37c('0x4c')]+_0x22077b[_0xc37c('0x4d')]+_0x22077b['countnosuchnumberretry'];};exports[_0xc37c('0x4e')]=function(_0x1f630f){var _0x29a269=_[_0xc37c('0x4f')](_0x1f630f);_0x29a269['state']=0xf;_0x29a269[_0xc37c('0x39')]=_0xc37c('0x50');return _0x29a269;};exports[_0xc37c('0x51')]=function(_0xd7f6ba,_0x3a67d0,_0x2a562c){var _0x2b05ce={};_0x2b05ce[_0x3a67d0]=_0xd7f6ba[_0x3a67d0];_0x2b05ce[_0xc37c('0x52')]=![];_0x2b05ce[_0xc37c('0x53')]=moment()[_0xc37c('0x54')](_0x2a562c,_0xc37c('0x55'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2b05ce[_0xc37c('0x1d')]=_0xd7f6ba[_0xc37c('0x1d')];_0x2b05ce['ListId']=_0xd7f6ba[_0xc37c('0x56')];_0x2b05ce['VoiceQueueId']=_0xd7f6ba[_0xc37c('0x57')]||undefined;return _0x2b05ce;};exports[_0xc37c('0x58')]=function(_0x63077a,_0x4c726c){if(!_[_0xc37c('0x17')](_0x63077a)){if(_0x63077a[_0xc37c('0x59')]>0x0){_0x63077a[_0xc37c('0x59')]-=0x1;}else{logger[_0xc37c('0xb')](_0x4c726c,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xc37c('0xb')](_0x4c726c,_0xc37c('0x5a'));}};exports['IsNotLoggedIn']=function(_0x1af51c){if(_0x1af51c<=0x0){return!![];}return![];};function buildObj(_0x42daf6,_0x1cfecd,_0x36889a){_0x42daf6[_0xc37c('0x5b')]=_0x1cfecd;_0x42daf6['name']=_0x42daf6[_0xc37c('0x5c')];_0x42daf6[_0xc37c('0x5d')]=_0x42daf6[_0xc37c('0x45')];_0x42daf6[_0xc37c('0x5e')]='voice';if(_0x36889a){_0x42daf6[_0xc37c('0x5f')]=_0x36889a[_0xc37c('0x5f')];}return _0x42daf6;}exports[_0xc37c('0x60')]=buildObj;exports[_0xc37c('0x61')]=function(_0x1f78ac){var _0x2fd4e7=[];for(var _0x2bcbcc in _0x1f78ac){if(_0x1f78ac[_0xc37c('0x2c')](_0x2bcbcc)){if(!_[_0xc37c('0x17')](_0x1f78ac[_0x2bcbcc])&&_0x1f78ac[_0x2bcbcc]['state']===_0xc37c('0x62')&&_0x1f78ac[_0x2bcbcc]['status']===_0xc37c('0x63')){_0x2fd4e7[_0xc37c('0x64')](_0x1f78ac[_0x2bcbcc]['id']);}}}return _0x2fd4e7;};exports[_0xc37c('0x65')]=function(_0x224a50){var _0x46599b=moment()[_0xc37c('0x66')](0x0);var _0x254d83=moment(_0x224a50)[_0xc37c('0x66')](0x0);return _0x46599b['diff'](_0x254d83,'seconds');};exports['createBody']=function(_0x107246){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x107246[_0xc37c('0x1d')],'ListId':_0x107246[_0xc37c('0x56')],'VoiceQueueId':_0x107246[_0xc37c('0x57')]||undefined,'CampaignId':_0x107246[_0xc37c('0x67')]||undefined};};exports[_0xc37c('0x68')]=function(_0x5c45bc){if(_0x5c45bc===_0xc37c('0x48')||_0x5c45bc===_0xc37c('0x69')||_0x5c45bc==='queue'||_0x5c45bc===_0xc37c('0x6a')||_0x5c45bc===_0xc37c('0x6b')||_0x5c45bc===_0xc37c('0x6c')||_0x5c45bc===_0xc37c('0x6d')||_0x5c45bc===_0xc37c('0x45')||_0x5c45bc==='calleridname'||_0x5c45bc===_0xc37c('0x52')||_0x5c45bc===_0xc37c('0x1c')||_0x5c45bc===_0xc37c('0x53')||_0x5c45bc===_0xc37c('0x4a')||_0x5c45bc===_0xc37c('0x4b')||_0x5c45bc===_0xc37c('0x4c')||_0x5c45bc==='countglobal'||_0x5c45bc===_0xc37c('0x6e')||_0x5c45bc===_0xc37c('0x6f')||_0x5c45bc===_0xc37c('0x70')||_0x5c45bc===_0xc37c('0x71')||_0x5c45bc===_0xc37c('0x1d')||_0x5c45bc==='ListId'||_0x5c45bc===_0xc37c('0x3d')||_0x5c45bc===_0xc37c('0x57')||_0x5c45bc===_0xc37c('0x72')||_0x5c45bc===_0xc37c('0x73')||_0x5c45bc===_0xc37c('0x74')||_0x5c45bc===_0xc37c('0x75')||_0x5c45bc===_0xc37c('0x76')||_0x5c45bc===_0xc37c('0x77')||_0x5c45bc===_0xc37c('0x78')||_0x5c45bc===_0xc37c('0x79')||_0x5c45bc===_0xc37c('0x7a')||_0x5c45bc===_0xc37c('0x7b')||_0x5c45bc===_0xc37c('0x7c')||_0x5c45bc==='xmd-cdrtype'||_0x5c45bc===_0xc37c('0x7d')||_0x5c45bc===_0xc37c('0x7e')||_0x5c45bc===_0xc37c('0x7f')||_0x5c45bc===_0xc37c('0x80')||_0x5c45bc===_0xc37c('0x81')||_0x5c45bc===_0xc37c('0x82')||_0x5c45bc===_0xc37c('0x83')||_0x5c45bc===_0xc37c('0x84')||_0x5c45bc===_0xc37c('0x85')||_0x5c45bc===_0xc37c('0x86')||_0x5c45bc==='rtpaudioqosrttbridged'||_0x5c45bc===_0xc37c('0x80')||_0x5c45bc==='rtpaudioqosbridged'||_0x5c45bc==='rtpaudioqosjitter'||_0x5c45bc===_0xc37c('0x83')||_0x5c45bc===_0xc37c('0x84')||_0x5c45bc==='rtpaudioqoslossbridged'||_0x5c45bc==='rtpaudioqosrtt'||_0x5c45bc===_0xc37c('0x87')||_0x5c45bc===_0xc37c('0x88')||_0x5c45bc===_0xc37c('0x89')||_0x5c45bc===_0xc37c('0x38')||_0x5c45bc===_0xc37c('0x39')){return![];}return!![];};exports[_0xc37c('0x8a')]=function(_0x2d9e81,_0xeffd68){var _0x52a046,_0x3b1e7d,_0x1a45b4;if(_0xeffd68<=0x0){_0xeffd68=0x1;}_0x52a046=new RegExp(_0xc37c('0x8b')+_0xeffd68+'}$');_0x3b1e7d=Math[_0xc37c('0x8c')](0xa,_0xeffd68-0x1);_0x1a45b4=Math[_0xc37c('0x8c')](0xa,_0xeffd68)-0x1;return util[_0xc37c('0x13')]('%s',_[_0xc37c('0x8d')](_0x2d9e81,_0x52a046,_['random'](_0x3b1e7d,_0x1a45b4)));};exports[_0xc37c('0x8e')]=function(_0x49f009){var _0x24b8f3=_0x49f009[_0xc37c('0x8f')](/"(.*?)"/);return _0x24b8f3?_0x24b8f3[0x1]:_0x49f009;};exports[_0xc37c('0x90')]=function(_0x4c8ec5){var _0x7fd224=_0x4c8ec5[_0xc37c('0x8f')](/<(.*?)>/);return _0x7fd224?_0x7fd224[0x1]:_0x4c8ec5;};function buildNoAnswerEventPayload(_0x324e63,_0xfd4631){var _0x19b732=buildObj(_0x324e63,_0xc37c('0x91'));if(!_[_0xc37c('0x12')](_0xfd4631[_0xc37c('0x92')])){Object['keys'](_0xfd4631[_0xc37c('0x92')])[_0xc37c('0x93')](function(_0x5d8a45){_0x19b732[_0x5d8a45[_0xc37c('0x94')]()]=_0xfd4631[_0xc37c('0x92')][_0x5d8a45];});}return _0x19b732;}exports[_0xc37c('0x95')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x1e01=['logger','info','loggerError','inspect','message','isUndefined','string','format','isEmpty','isActive','Queue','name','\x22%s\x22\x20<%s>','calleridname','calleridnum','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','logBlacklist','state','starttime','responsetime','endtime','logAgent','logLookAgent','membername','UserId','YYYY-MM-DD\x20HH:mm:ss','statedesc','getSeconds','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','from-sip','timeout','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','decrementTalking','pTalking','[decrementTalking]\x20object\x20talking\x20is\x20negative','[decrementTalking]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','interface','mandatoryDisposition','buildObj','agentReadyId','isNil','not_inuse','status','push','getDiff','milliseconds','diff','seconds','createBody','filterKey','idContact','queue','type','campaigntype','dialAnswer','channelAgent','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','127.0.0.1','../../dialer/utils','loggerCatch','error'];(function(_0x133305,_0x19a973){var _0x57fe64=function(_0x4f4ad0){while(--_0x4f4ad0){_0x133305['push'](_0x133305['shift']());}};_0x57fe64(++_0x19a973);}(_0x1e01,0x19b));var _0x11e0=function(_0xa29c69,_0x1b2df1){_0xa29c69=_0xa29c69-0x0;var _0x35ae9f=_0x1e01[_0xa29c69];return _0x35ae9f;};'use strict';var util=require(_0x11e0('0x0'));var _=require(_0x11e0('0x1'));var moment=require(_0x11e0('0x2'));var logger=require(_0x11e0('0x3'))(_0x11e0('0x4'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0x11e0('0x5');var utils=require(_0x11e0('0x6'));exports[_0x11e0('0x7')]=function(_0x5be19a){return function(_0x4c1289){logger[_0x11e0('0x8')](_0x5be19a,util['inspect'](_0x4c1289,{'showHidden':![],'depth':null}));};};exports[_0x11e0('0x9')]=function(_0x45ee7d,_0x1fe83e){logger[_0x11e0('0xa')](_0x45ee7d,util['inspect'](_0x1fe83e,{'showHidden':![],'depth':null}));};exports[_0x11e0('0xb')]=function(_0x2b4ccb,_0x1b5c81){logger[_0x11e0('0x8')](_0x2b4ccb,util[_0x11e0('0xc')](_0x1b5c81,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x17c510){return function(_0xb53423){logger[_0x11e0('0xa')](_0x17c510,util['inspect'](_0xb53423,{'showHidden':![],'depth':null}));};};exports[_0x11e0('0xd')]=function(_0x381a9c,_0x2bd095,_0x5a60c1){return{'message':_0x381a9c,'unlock':_0x2bd095,'active':_0x5a60c1};};exports['getCallerId']=function(_0x333165,_0x514eb0,_0x548cbf){if(!_[_0x11e0('0xe')](_0x548cbf)&&'string'===typeof _0x548cbf&&!_['isEmpty'](_0x548cbf)){if(!_[_0x11e0('0xe')](_0x514eb0)&&_0x11e0('0xf')===typeof _0x514eb0&&!_['isEmpty'](_0x514eb0)){return util[_0x11e0('0x10')]('\x22%s\x22\x20<%s>',_0x514eb0,_0x548cbf);}return util[_0x11e0('0x10')]('\x22%s\x22\x20<%s>',_0x548cbf,_0x548cbf);}if(!_[_0x11e0('0xe')](_0x333165)&&_0x11e0('0xf')===typeof _0x333165&&!_[_0x11e0('0x11')](_0x333165)){return _0x333165;}return'\x22\x22\x20<>';};exports[_0x11e0('0x12')]=function(_0x55a6d2){if(_['isNil'](_0x55a6d2)){return![];}return _0x55a6d2;};exports['addVariables']=function(_0x1ff2b7,_0x337b7f,_0x2f9ac2,_0x266a96,_0x4309c1,_0x2fa764){var _0x272c6c={'XMD-QUEUE':_0x337b7f[_0x11e0('0x13')]?_0x337b7f[_0x11e0('0x13')][_0x11e0('0x14')]:'','XMD-CALLERID':_0x266a96,'XMD-CALLERID-PREVIEW':_0x2fa764?util[_0x11e0('0x10')](_0x11e0('0x15'),_0x2fa764[_0x11e0('0x16')],_0x2fa764[_0x11e0('0x17')]):_0x266a96,'XMD-DIALID':_0x4309c1,'XMD-CONTACTID':_0x337b7f['ContactId'],'XMD-CDRTYPE':_0x11e0('0x18'),'CALLERID(all)':_0x266a96,'XMD-VOICEQUEUEID':_0x337b7f[_0x11e0('0x19')],'XMD-DIALCHANNEL':_0x2f9ac2,'XMD-DIALTIMEOUT':_0x1ff2b7['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x11e0('0x10')](_0x11e0('0x1a'),_0x1ff2b7[_0x11e0('0x1b')]?'g':'',_[_0x11e0('0x11')](_0x1ff2b7[_0x11e0('0x1c')])?'':_0x11e0('0x1d')),'XMD-DIALURL':_0x1ff2b7['dialPreviewUrl']||'','XMD-AGI':_0x1ff2b7['dialQueueProject']?util[_0x11e0('0x10')](_0x11e0('0x1e'),ipAgi,_0x1ff2b7['dialQueueProject']):_0x11e0('0x1f'),'XMD-AGIAFTER':_0x1ff2b7['dialQueueProject2']?util[_0x11e0('0x10')](_0x11e0('0x1e'),ipAgi,_0x1ff2b7[_0x11e0('0x1b')]):_0x11e0('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x2fa764?_0x2fa764[_0x11e0('0x20')]:'','XMD-ORIGINATECALLERIDNAME':_0x2fa764?_0x2fa764[_0x11e0('0x21')]:'','XMD-DESTINATION':_0x11e0('0x22'),'SIPADDHEADER':_0x11e0('0x23')};if(!_[_0x11e0('0x11')](_0x1ff2b7[_0x11e0('0x1c')])){_0x272c6c[util[_0x11e0('0x10')]('%s',_0x11e0('0x24'))]=_0x1ff2b7[_0x11e0('0x1c')];_0x272c6c[util[_0x11e0('0x10')]('%s',_0x11e0('0x25'))]=_0x4309c1;}return _0x272c6c;};exports[_0x11e0('0x26')]=function(_0x3ace96){var _0x3a3066={};for(var _0x1d754a in _0x3ace96){if(_0x3ace96[_0x11e0('0x27')](_0x1d754a)){_0x3a3066[util[_0x11e0('0x10')]('%s',_[_0x11e0('0x28')](_0x1d754a))]=_0x3ace96[_0x1d754a];}}return{'variables':_0x3a3066};};exports[_0x11e0('0x29')]=function(_0x2425ea){var _0x37efe3=moment()[_0x11e0('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x2425ea[_0x11e0('0x2a')]=0xd;_0x2425ea['statedesc']='Blacklist';_0x2425ea[_0x11e0('0x2b')]=_0x37efe3;_0x2425ea[_0x11e0('0x2c')]=_0x37efe3;_0x2425ea[_0x11e0('0x2d')]=_0x37efe3;};exports[_0x11e0('0x2e')]=function(_0x12a41b,_0x269af5,_0x1d34b9){var _0x47c7b6=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x12a41b[_0x11e0('0x2a')]=_0x269af5;_0x12a41b['statedesc']=_0x1d34b9;_0x12a41b['responsetime']=_0x47c7b6;_0x12a41b['ringtime']=utils['getSeconds'](_0x12a41b[_0x11e0('0x2c')],_0x12a41b[_0x11e0('0x2b')]);};exports[_0x11e0('0x2f')]=function(_0x5da3b8,_0x4630b9,_0x13a61b){_0x5da3b8[_0x11e0('0x30')]=_0x4630b9;_0x5da3b8[_0x11e0('0x31')]=_0x13a61b;};exports['logCustomer']=function(_0x555bd1,_0x4adf49,_0x42dfc8){var _0x1e8a69=moment()['format'](_0x11e0('0x32'));_0x555bd1['state']=_0x4adf49;_0x555bd1[_0x11e0('0x33')]=_0x42dfc8;_0x555bd1[_0x11e0('0x2c')]=_0x555bd1[_0x11e0('0x2c')]?_0x555bd1[_0x11e0('0x2c')]:_0x1e8a69;_0x555bd1[_0x11e0('0x2d')]=_0x555bd1['endtime']?_0x555bd1[_0x11e0('0x2d')]:_0x1e8a69;_0x555bd1['ringtime']=utils[_0x11e0('0x34')](_0x555bd1[_0x11e0('0x2c')]||0x0,_0x555bd1[_0x11e0('0x2b')]||0x0);_0x555bd1[_0x11e0('0x35')]=_0x555bd1['answertime']?utils['getSeconds'](_0x555bd1['endtime'],_0x555bd1[_0x11e0('0x36')]):0x0;};exports[_0x11e0('0x37')]=function(_0x12ee44){return _0x12ee44===_0x11e0('0x38');};exports[_0x11e0('0x39')]=function(_0x407f6d,_0x4a61ac,_0x33440c,_0x35b455,_0x4f1fe5){var _0x429556=_0x35b455?_0x11e0('0x3a'):_0x407f6d[_0x11e0('0x16')];_0x429556=_0x4f1fe5?_0x11e0('0x3b'):_0x429556;return{'actionid':_0x407f6d[_0x11e0('0x3c')],'action':_0x11e0('0x3d'),'channel':_0x407f6d['channelAgent'],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x429556,_0x407f6d[_0x11e0('0x17')]),'Exten':_0x11e0('0x22'),'Context':_0x11e0('0x3e'),'Priority':'1','variable':_0x33440c,'timeout':(_0x4a61ac[_0x11e0('0x3f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x407f6d[_0x11e0('0x3c')]};};exports['totalGlobal']=function(_0xb96608){return _0xb96608[_0x11e0('0x40')]+_0xb96608[_0x11e0('0x41')]+_0xb96608['countnoanswerretry']+_0xb96608[_0x11e0('0x42')]+_0xb96608[_0x11e0('0x43')];};exports[_0x11e0('0x44')]=function(_0x2fae57){var _0x385a7b=_[_0x11e0('0x45')](_0x2fae57);_0x385a7b['state']=0xf;_0x385a7b[_0x11e0('0x33')]=_0x11e0('0x46');return _0x385a7b;};exports[_0x11e0('0x47')]=function(_0x4f547c,_0x1fd9d5,_0x18e7f3){var _0x139c0f={};_0x139c0f[_0x1fd9d5]=_0x4f547c[_0x1fd9d5];_0x139c0f[_0x11e0('0x48')]=![];_0x139c0f[_0x11e0('0x49')]=moment()[_0x11e0('0x4a')](_0x18e7f3,_0x11e0('0x4b'))[_0x11e0('0x10')](_0x11e0('0x32'));_0x139c0f[_0x11e0('0x4c')]=_0x4f547c['ContactId'];_0x139c0f[_0x11e0('0x4d')]=_0x4f547c[_0x11e0('0x4d')];_0x139c0f[_0x11e0('0x19')]=_0x4f547c['VoiceQueueId']||undefined;return _0x139c0f;};exports[_0x11e0('0x4e')]=function(_0x1c53fb,_0x3eb2d3){if(!_['isNil'](_0x1c53fb)){if(_0x1c53fb['pTalking']>0x0){_0x1c53fb[_0x11e0('0x4f')]-=0x1;}else{logger[_0x11e0('0xa')](_0x3eb2d3,_0x11e0('0x50'));}}else{logger[_0x11e0('0x8')](_0x3eb2d3,_0x11e0('0x51'));}};exports[_0x11e0('0x52')]=function(_0x4ba975){if(_0x4ba975<=0x0){return!![];}return![];};function buildObj(_0x24cf6f,_0x2fb904,_0xeecbef){_0x24cf6f['lastevent']=_0x2fb904;_0x24cf6f['name']=_0x24cf6f['queue'];_0x24cf6f[_0x11e0('0x53')]=_0x24cf6f['channelAgent'];_0x24cf6f['motionChannel']='voice';if(_0xeecbef){_0x24cf6f[_0x11e0('0x54')]=_0xeecbef[_0x11e0('0x54')];}return _0x24cf6f;}exports[_0x11e0('0x55')]=buildObj;exports[_0x11e0('0x56')]=function(_0x2a349d){var _0x62ea5f=[];for(var _0x1b28a2 in _0x2a349d){if(_0x2a349d[_0x11e0('0x27')](_0x1b28a2)){if(!_[_0x11e0('0x57')](_0x2a349d[_0x1b28a2])&&_0x2a349d[_0x1b28a2]['state']===_0x11e0('0x58')&&_0x2a349d[_0x1b28a2][_0x11e0('0x59')]==='reachable'){_0x62ea5f[_0x11e0('0x5a')](_0x2a349d[_0x1b28a2]['id']);}}}return _0x62ea5f;};exports[_0x11e0('0x5b')]=function(_0x48ff15){var _0x512163=moment()[_0x11e0('0x5c')](0x0);var _0x8fca4e=moment(_0x48ff15)['milliseconds'](0x0);return _0x512163[_0x11e0('0x5d')](_0x8fca4e,_0x11e0('0x5e'));};exports[_0x11e0('0x5f')]=function(_0x3b4e72){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3b4e72[_0x11e0('0x4c')],'ListId':_0x3b4e72['ListId'],'VoiceQueueId':_0x3b4e72['VoiceQueueId']||undefined,'CampaignId':_0x3b4e72['CampaignId']||undefined};};exports[_0x11e0('0x60')]=function(_0x997663){if(_0x997663===_0x11e0('0x3c')||_0x997663===_0x11e0('0x61')||_0x997663===_0x11e0('0x62')||_0x997663===_0x11e0('0x63')||_0x997663===_0x11e0('0x64')||_0x997663===_0x11e0('0x65')||_0x997663===_0x11e0('0x30')||_0x997663===_0x11e0('0x66')||_0x997663===_0x11e0('0x16')||_0x997663===_0x11e0('0x48')||_0x997663===_0x11e0('0x17')||_0x997663==='scheduledat'||_0x997663===_0x11e0('0x40')||_0x997663===_0x11e0('0x41')||_0x997663===_0x11e0('0x67')||_0x997663===_0x11e0('0x68')||_0x997663===_0x11e0('0x69')||_0x997663===_0x11e0('0x6a')||_0x997663===_0x11e0('0x6b')||_0x997663==='recallme'||_0x997663===_0x11e0('0x4c')||_0x997663===_0x11e0('0x4d')||_0x997663===_0x11e0('0x31')||_0x997663===_0x11e0('0x19')||_0x997663===_0x11e0('0x6c')||_0x997663===_0x11e0('0x6d')||_0x997663===_0x11e0('0x6e')||_0x997663===_0x11e0('0x6f')||_0x997663==='xmd-listid'||_0x997663===_0x11e0('0x70')||_0x997663==='xmd-dialtimeout'||_0x997663==='xmd-dialoptions'||_0x997663===_0x11e0('0x71')||_0x997663===_0x11e0('0x72')||_0x997663===_0x11e0('0x73')||_0x997663===_0x11e0('0x74')||_0x997663===_0x11e0('0x75')||_0x997663===_0x11e0('0x76')||_0x997663===_0x11e0('0x77')||_0x997663===_0x11e0('0x78')||_0x997663==='rtpaudioqosbridged'||_0x997663===_0x11e0('0x79')||_0x997663===_0x11e0('0x7a')||_0x997663===_0x11e0('0x7b')||_0x997663==='rtpaudioqoslossbridged'||_0x997663==='rtpaudioqosrtt'||_0x997663===_0x11e0('0x7c')||_0x997663==='rtpaudioqos'||_0x997663===_0x11e0('0x7d')||_0x997663===_0x11e0('0x79')||_0x997663===_0x11e0('0x7a')||_0x997663===_0x11e0('0x7b')||_0x997663===_0x11e0('0x7e')||_0x997663===_0x11e0('0x7f')||_0x997663==='rtpaudioqosrttbridged'||_0x997663==='bridgepeer'||_0x997663==='bridgepvtcallid'||_0x997663===_0x11e0('0x2a')||_0x997663===_0x11e0('0x33')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x4b4983,_0x3e3cee){var _0x2ddce5,_0x45140e,_0x32d956;if(_0x3e3cee<=0x0){_0x3e3cee=0x1;}_0x2ddce5=new RegExp(_0x11e0('0x80')+_0x3e3cee+'}$');_0x45140e=Math[_0x11e0('0x81')](0xa,_0x3e3cee-0x1);_0x32d956=Math['pow'](0xa,_0x3e3cee)-0x1;return util[_0x11e0('0x10')]('%s',_[_0x11e0('0x82')](_0x4b4983,_0x2ddce5,_[_0x11e0('0x83')](_0x45140e,_0x32d956)));};exports[_0x11e0('0x84')]=function(_0x25a4aa){var _0x167764=_0x25a4aa['match'](/"(.*?)"/);return _0x167764?_0x167764[0x1]:_0x25a4aa;};exports[_0x11e0('0x85')]=function(_0x2f4a9e){var _0x173a60=_0x2f4a9e[_0x11e0('0x86')](/<(.*?)>/);return _0x173a60?_0x173a60[0x1]:_0x2f4a9e;};function buildNoAnswerEventPayload(_0x2141a3,_0xefa9a0){var _0x2d16ff=buildObj(_0x2141a3,'noanswer');if(!_['isEmpty'](_0xefa9a0[_0x11e0('0x87')])){Object[_0x11e0('0x88')](_0xefa9a0[_0x11e0('0x87')])[_0x11e0('0x89')](function(_0x385c97){_0x2d16ff[_0x385c97[_0x11e0('0x8a')]()]=_0xefa9a0[_0x11e0('0x87')][_0x385c97];});}return _0x2d16ff;}exports[_0x11e0('0x8b')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 7e2f5e9..01a1025 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 _0x9fa5=['voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel'];(function(_0x357063,_0x837a4f){var _0x380fb2=function(_0x33bfe1){while(--_0x33bfe1){_0x357063['push'](_0x357063['shift']());}};_0x380fb2(++_0x837a4f);}(_0x9fa5,0x66));var _0x59fa=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x9fa5[_0x3a6efd];return _0x487b9a;};'use strict';exports['queueadd']={'queue':{'type':_0x59fa('0x0'),'required':!![]},'interface':{'type':_0x59fa('0x0'),'required':!![]},'membername':{'type':_0x59fa('0x0'),'required':!![]},'penalty':{'type':_0x59fa('0x1'),'required':![]},'paused':{'type':_0x59fa('0x2'),'required':![]}};exports[_0x59fa('0x3')]={'queue':{'type':_0x59fa('0x0'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x59fa('0x4')]={'interface':{'type':_0x59fa('0x0'),'required':!![]},'paused':{'type':_0x59fa('0x2')},'reason':{'type':_0x59fa('0x0'),'required':![]}};exports[_0x59fa('0x5')]={'module':{'type':'string','required':![]}};exports[_0x59fa('0x6')]={'uniqueid':{'type':_0x59fa('0x0'),'required':!![]}};exports[_0x59fa('0x7')]={'uniqueid':{'type':_0x59fa('0x0'),'required':!![]},'filename':{'type':_0x59fa('0x0')},'format':{'type':_0x59fa('0x0')},'mixmonitorid':{'type':_0x59fa('0x0')}};exports[_0x59fa('0x8')]={'uniqueid':{'type':_0x59fa('0x0'),'required':!![]}};exports[_0x59fa('0x9')]={'uniqueid':{'type':_0x59fa('0x0'),'required':!![]},'exten':{'type':_0x59fa('0x0'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x7d20=['voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','queuepause','voicequeuechannel','voicechannel'];(function(_0x57a50d,_0x2871f8){var _0x1b25b3=function(_0x45691e){while(--_0x45691e){_0x57a50d['push'](_0x57a50d['shift']());}};_0x1b25b3(++_0x2871f8);}(_0x7d20,0xe9));var _0x07d2=function(_0x219e05,_0x36e7b1){_0x219e05=_0x219e05-0x0;var _0x58d3de=_0x7d20[_0x219e05];return _0x58d3de;};'use strict';exports[_0x07d2('0x0')]={'queue':{'type':_0x07d2('0x1'),'required':!![]},'interface':{'type':_0x07d2('0x1'),'required':!![]},'membername':{'type':_0x07d2('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':_0x07d2('0x1'),'required':!![]},'interface':{'type':_0x07d2('0x1'),'required':!![]}};exports[_0x07d2('0x2')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x07d2('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x07d2('0x1'),'required':![]}};exports[_0x07d2('0x3')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x07d2('0x4')]={'uniqueid':{'type':_0x07d2('0x1'),'required':!![]},'filename':{'type':_0x07d2('0x1')},'format':{'type':_0x07d2('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x07d2('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x07d2('0x6')]={'uniqueid':{'type':_0x07d2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x07d2('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 39d57d8..b7878f7 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 _0x2032=['voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','outbound','channels','queueChannels','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','agents','initTelephones','initTrunks','mergeFromDatabase','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2032,0xd9));var _0x2203=function(_0x454bc2,_0x4a0ff2){_0x454bc2=_0x454bc2-0x0;var _0x1fdd1a=_0x2032[_0x454bc2];return _0x1fdd1a;};'use strict';var _=require('lodash');var moment=require(_0x2203('0x0'));var util=require(_0x2203('0x1'));var Agent=require(_0x2203('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x2203('0x3'));var VoiceQueue=require(_0x2203('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x2203('0x5'));var Campaign=require(_0x2203('0x6'));var VoiceExtension=require(_0x2203('0x7'));var ZendeskAccount=require(_0x2203('0x8'));var SalesforceAccount=require(_0x2203('0x9'));var FreshdeskAccount=require(_0x2203('0xa'));var SugarcrmAccount=require(_0x2203('0xb'));var ZohoAccount=require(_0x2203('0xc'));var DeskAccount=require(_0x2203('0xd'));var VtigerAccount=require(_0x2203('0xe'));var ServicenowAccount=require(_0x2203('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x2203('0x10'));function Realtime(){this['agents']={};this[_0x2203('0x11')]={};this[_0x2203('0x12')]={};this[_0x2203('0x13')]={};this['triggers']={};this[_0x2203('0x14')]={};this['templates']={};this[_0x2203('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x2203('0x16')]={};this[_0x2203('0x17')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x2203('0x18')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x2203('0x19')]={};this[_0x2203('0x1a')]={};this[_0x2203('0x1b')]={};this[_0x2203('0x1c')]={};this[_0x2203('0x1d')]={};this[_0x2203('0x1e')]={};}function freeIsNotKey(_0x2c36e6,_0x2c085c,_0xdf9d0b){var _0x3053f3=_['mapKeys'](_0x2c36e6,function(_0x280eda){return _0x280eda[_0xdf9d0b];});for(var _0x2ee127 in _0x2c085c){if(_0x2c085c['hasOwnProperty'](_0x2ee127)){if(!_0x3053f3[_0x2ee127]){delete _0x2c085c[_0x2ee127];}}}}function freeIsNotKeySip(_0x3f9ef6,_0x8906e1){var _0x4aeb9f=_[_0x2203('0x1f')](_0x3f9ef6,function(_0x5ee83c){return util[_0x2203('0x20')](_0x2203('0x21'),_0x5ee83c[_0x2203('0x22')]);});for(var _0x3b4034 in _0x8906e1){if(_0x8906e1[_0x2203('0x23')](_0x3b4034)){if(!_0x4aeb9f[_0x3b4034]){delete _0x8906e1[_0x3b4034];}}}}function freeIsNotKeyAgent(_0x449039,_0x538c23){var _0x13d3f7=_['mapKeys'](_0x449039,function(_0x5ac866){var _0x15f543=_['isNil'](_0x5ac866[_0x2203('0x24')])?util[_0x2203('0x20')]('SIP/%s',_0x5ac866[_0x2203('0x22')]):_0x5ac866['interface'];return _0x15f543;});for(var _0x5c8da9 in _0x538c23){if(_0x538c23[_0x2203('0x23')](_0x5c8da9)){if(!_0x13d3f7[_0x5c8da9]){delete _0x538c23[_0x5c8da9];}}}}function clearVoiceCallReports(_0x2718f5){_0x2718f5[_0x2203('0x25')]=0x0;_0x2718f5[_0x2203('0x26')]=0x0;_0x2718f5[_0x2203('0x27')]=0x0;_0x2718f5[_0x2203('0x28')]=0x0;_0x2718f5[_0x2203('0x29')]=0x0;}function clearCampaigns(_0x250349){if(!_['isEmpty'](_0x250349)){for(var _0x143f41 in _0x250349){if(_0x250349[_0x2203('0x23')](_0x143f41)){_0x250349[_0x143f41][_0x2203('0x2a')]=0x0;_0x250349[_0x143f41]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xb2071b){if(!_[_0x2203('0x2b')](_0xb2071b)){for(var _0x5c5fd3 in _0xb2071b){if(_0xb2071b[_0x2203('0x23')](_0x5c5fd3)){_0xb2071b[_0x5c5fd3][_0x2203('0x25')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x26')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2c')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2d')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x27')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x28')]=0x0;_0xb2071b[_0x5c5fd3]['sumBillable']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2e')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2f')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x30')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x31')]=0x0;_0xb2071b[_0x5c5fd3]['outboundNoSuchCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x32')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x33')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x34')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x35')]=0x0;_0xb2071b[_0x5c5fd3]['outboundOriginateFailureCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x36')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x37')]=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerAgiCallsDay']=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x38')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x125dfc,_0x464c88){for(var _0x191894 in _0x464c88){if(_0x125dfc[_0x2203('0x23')](_0x191894)){_0x125dfc[_0x191894]=_0x464c88[_0x191894];}}};Realtime[_0x2203('0x39')]['initAgents']=function(){var _0xb22e28=this;return function(_0x2324c0){if(_0x2324c0){freeIsNotKeyAgent(_0x2324c0,_0xb22e28['agents']);for(var _0x2a2ee7=0x0,_0x20fbe1={};_0x2a2ee7<_0x2324c0[_0x2203('0x3a')];_0x2a2ee7+=0x1){_0x20fbe1=_0x2324c0[_0x2a2ee7];var _0x4187b4=_[_0x2203('0x3b')](_0x20fbe1[_0x2203('0x24')])?util[_0x2203('0x20')](_0x2203('0x21'),_0x20fbe1[_0x2203('0x22')]):_0x20fbe1['interface'];if(_[_0x2203('0x3c')](_0xb22e28[_0x2203('0x3d')][_0x4187b4])){_0xb22e28['agents'][_0x4187b4]=new Agent(_0x20fbe1);}else{_0xb22e28['mergeFromDatabase'](_0xb22e28[_0x2203('0x3d')][_0x4187b4],_0x20fbe1);}}}return _0xb22e28['agents'];};};Realtime[_0x2203('0x39')][_0x2203('0x3e')]=function(){var _0x127ee3=this;return function(_0x5221f0){if(_0x5221f0){freeIsNotKeySip(_0x5221f0,_0x127ee3['telephones']);for(var _0x34cdeb=0x0,_0x47c93a={};_0x34cdeb<_0x5221f0[_0x2203('0x3a')];_0x34cdeb+=0x1){_0x47c93a=_0x5221f0[_0x34cdeb];if(_['isUndefined'](_0x127ee3[_0x2203('0x11')][util['format'](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])])){_0x127ee3[_0x2203('0x11')][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a['name'])]=new Telephone(_0x47c93a);}else{_0x127ee3['mergeFromDatabase'](_0x127ee3['telephones'][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])],_0x47c93a);}}}return _0x127ee3[_0x2203('0x11')];};};Realtime[_0x2203('0x39')][_0x2203('0x3f')]=function(){var _0x1c7e3d=this;return function(_0x590b4e){if(_0x590b4e){freeIsNotKeySip(_0x590b4e,_0x1c7e3d[_0x2203('0x12')]);for(var _0x1b12c3=0x0,_0x108fde={};_0x1b12c3<_0x590b4e[_0x2203('0x3a')];_0x1b12c3+=0x1){_0x108fde=_0x590b4e[_0x1b12c3];if(_['isUndefined'](_0x1c7e3d['trunks'][util[_0x2203('0x20')]('SIP/%s',_0x108fde[_0x2203('0x22')])])){_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')]('SIP/%s',_0x108fde['name'])]=new Trunk(_0x108fde);}else{_0x1c7e3d[_0x2203('0x40')](_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')](_0x2203('0x21'),_0x108fde[_0x2203('0x22')])],_0x108fde);}}}return _0x1c7e3d[_0x2203('0x12')];};};Realtime['prototype'][_0x2203('0x41')]=function(){var _0x165a3f=this;return function(_0x3a866c){if(_0x3a866c){freeIsNotKey(_0x3a866c,_0x165a3f[_0x2203('0x42')],'id');for(var _0x16b452=0x0,_0x36b99f={};_0x16b452<_0x3a866c[_0x2203('0x3a')];_0x16b452+=0x1){_0x36b99f=_0x3a866c[_0x16b452];if(_[_0x2203('0x3c')](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']])){_0x165a3f[_0x2203('0x42')][_0x36b99f['id']]=new Trigger(_0x36b99f);}else{_0x165a3f['mergeFromDatabase'](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']],_0x36b99f);}}}return _0x165a3f[_0x2203('0x42')];};};Realtime[_0x2203('0x39')][_0x2203('0x43')]=function(){var _0x4c3259=this;return function(_0x58bd5c){if(_0x58bd5c){freeIsNotKey(_0x58bd5c,_0x4c3259[_0x2203('0x44')],'id');for(var _0x48129c=0x0,_0x273e5f={};_0x48129c<_0x58bd5c[_0x2203('0x3a')];_0x48129c+=0x1){_0x273e5f=_0x58bd5c[_0x48129c];if(_[_0x2203('0x3c')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']])){_0x4c3259['templates'][_0x273e5f['id']]=new Template(_0x273e5f);}else{_0x4c3259[_0x2203('0x40')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']],_0x273e5f);}}}return _0x4c3259['templates'];};};Realtime[_0x2203('0x39')][_0x2203('0x45')]=function(){var _0x35b2e9=this;return function(_0x2600a9){if(_0x2600a9){freeIsNotKey(_0x2600a9,_0x35b2e9['zendeskAccounts'],'id');for(var _0x4c1a29=0x0,_0x21b8ab={};_0x4c1a29<_0x2600a9['length'];_0x4c1a29+=0x1){_0x21b8ab=_0x2600a9[_0x4c1a29];if(_['isUndefined'](_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']])){_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']]=new ZendeskAccount(_0x21b8ab);}else{_0x35b2e9[_0x2203('0x40')](_0x35b2e9['zendeskAccounts'][_0x21b8ab['id']],_0x21b8ab);}}}return _0x35b2e9['zendeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x47')]=function(){var _0x12d7fa=this;return function(_0x21d2d7){if(_0x21d2d7){freeIsNotKey(_0x21d2d7,_0x12d7fa[_0x2203('0x48')],'id');for(var _0x21fd78=0x0,_0x4a7f4e={};_0x21fd78<_0x21d2d7[_0x2203('0x3a')];_0x21fd78+=0x1){_0x4a7f4e=_0x21d2d7[_0x21fd78];if(_['isUndefined'](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']])){_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']]=new SalesforceAccount(_0x4a7f4e);}else{_0x12d7fa[_0x2203('0x40')](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']],_0x4a7f4e);}}}return _0x12d7fa['salesforceAccounts'];};};Realtime['prototype'][_0x2203('0x49')]=function(){var _0x1f772d=this;return function(_0x126aad){if(_0x126aad){freeIsNotKey(_0x126aad,_0x1f772d[_0x2203('0x4a')],'id');for(var _0x559370=0x0,_0x4de47a={};_0x559370<_0x126aad['length'];_0x559370+=0x1){_0x4de47a=_0x126aad[_0x559370];if(_[_0x2203('0x3c')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']])){_0x1f772d['freshdeskAccounts'][_0x4de47a['id']]=new FreshdeskAccount(_0x4de47a);}else{_0x1f772d[_0x2203('0x40')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']],_0x4de47a);}}}return _0x1f772d['freshdeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x4b')]=function(){var _0x172c6a=this;return function(_0x6a1877){if(_0x6a1877){freeIsNotKey(_0x6a1877,_0x172c6a['zohoAccounts'],'id');for(var _0x120db1=0x0,_0x5268d6={};_0x120db1<_0x6a1877[_0x2203('0x3a')];_0x120db1+=0x1){_0x5268d6=_0x6a1877[_0x120db1];if(_[_0x2203('0x3c')](_0x172c6a['zohoAccounts'][_0x5268d6['id']])){_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']]=new ZohoAccount(_0x5268d6);}else{_0x172c6a[_0x2203('0x40')](_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']],_0x5268d6);}}}return _0x172c6a[_0x2203('0x4c')];};};Realtime[_0x2203('0x39')][_0x2203('0x4d')]=function(){var _0x569d4a=this;return function(_0x562a3d){if(_0x562a3d){freeIsNotKey(_0x562a3d,_0x569d4a[_0x2203('0x19')],'id');for(var _0x524356=0x0,_0x56e881={};_0x524356<_0x562a3d[_0x2203('0x3a')];_0x524356+=0x1){_0x56e881=_0x562a3d[_0x524356];if(_[_0x2203('0x3c')](_0x569d4a[_0x2203('0x19')][_0x56e881['id']])){_0x569d4a['deskAccounts'][_0x56e881['id']]=new DeskAccount(_0x56e881);}else{_0x569d4a[_0x2203('0x40')](_0x569d4a['deskAccounts'][_0x56e881['id']],_0x56e881);}}}return _0x569d4a['deskAccounts'];};};Realtime[_0x2203('0x39')]['initSugarcrmAccounts']=function(){var _0x54ec71=this;return function(_0x5efc59){if(_0x5efc59){freeIsNotKey(_0x5efc59,_0x54ec71[_0x2203('0x18')],'id');for(var _0x31256b=0x0,_0x367122={};_0x31256b<_0x5efc59[_0x2203('0x3a')];_0x31256b+=0x1){_0x367122=_0x5efc59[_0x31256b];if(_[_0x2203('0x3c')](_0x54ec71[_0x2203('0x18')][_0x367122['id']])){_0x54ec71[_0x2203('0x18')][_0x367122['id']]=new SugarcrmAccount(_0x367122);}else{_0x54ec71[_0x2203('0x40')](_0x54ec71[_0x2203('0x18')][_0x367122['id']],_0x367122);}}}return _0x54ec71[_0x2203('0x18')];};};Realtime[_0x2203('0x39')][_0x2203('0x4e')]=function(){var _0x58ff57=this;return function(_0x585bde){if(_0x585bde){freeIsNotKey(_0x585bde,_0x58ff57[_0x2203('0x1a')],'id');for(var _0x43d8c0=0x0,_0x2511bd={};_0x43d8c0<_0x585bde[_0x2203('0x3a')];_0x43d8c0+=0x1){_0x2511bd=_0x585bde[_0x43d8c0];if(_[_0x2203('0x3c')](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']])){_0x58ff57['vtigerAccounts'][_0x2511bd['id']]=new VtigerAccount(_0x2511bd);}else{_0x58ff57['mergeFromDatabase'](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']],_0x2511bd);}}}return _0x58ff57[_0x2203('0x1a')];};};Realtime[_0x2203('0x39')][_0x2203('0x4f')]=function(){var _0xcab922=this;return function(_0x7b0b9c){if(_0x7b0b9c){freeIsNotKey(_0x7b0b9c,_0xcab922[_0x2203('0x1b')],'id');for(var _0x191b67=0x0,_0x2c6bcc={};_0x191b67<_0x7b0b9c[_0x2203('0x3a')];_0x191b67+=0x1){_0x2c6bcc=_0x7b0b9c[_0x191b67];if(_[_0x2203('0x3c')](_0xcab922['servicenowAccounts'][_0x2c6bcc['id']])){_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']]=new ServicenowAccount(_0x2c6bcc);}else{_0xcab922[_0x2203('0x40')](_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']],_0x2c6bcc);}}}return _0xcab922[_0x2203('0x1b')];};};Realtime[_0x2203('0x39')][_0x2203('0x50')]=function(){var _0x52c159=this;return function(_0x544756){if(_0x544756){freeIsNotKey(_0x544756,_0x52c159[_0x2203('0x1c')],'id');for(var _0x35b7b9=0x0,_0x49e795={};_0x35b7b9<_0x544756[_0x2203('0x3a')];_0x35b7b9+=0x1){_0x49e795=_0x544756[_0x35b7b9];if(_[_0x2203('0x3c')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']])){_0x52c159[_0x2203('0x1c')][_0x49e795['id']]=new Dynamics365Account(_0x49e795);}else{_0x52c159[_0x2203('0x40')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']],_0x49e795);}}}return _0x52c159[_0x2203('0x1c')];};};Realtime[_0x2203('0x39')][_0x2203('0x51')]=function(){var _0x519120=this;return function(_0x468619){if(_0x468619){freeIsNotKey(_0x468619,_0x519120[_0x2203('0x1d')],'id');for(var _0x465898=0x0,_0x4e461e={};_0x465898<_0x468619[_0x2203('0x3a')];_0x465898+=0x1){_0x4e461e=_0x468619[_0x465898];if(_[_0x2203('0x3c')](_0x519120[_0x2203('0x1d')][_0x4e461e['id']])){_0x519120[_0x2203('0x1d')][_0x4e461e['id']]=new FreshsalesAccount(_0x4e461e);}else{_0x519120[_0x2203('0x40')](_0x519120['freshsalesAccounts'][_0x4e461e['id']],_0x4e461e);}}}return _0x519120[_0x2203('0x1d')];};};Realtime[_0x2203('0x39')][_0x2203('0x52')]=function(){var _0x4dde80=this;return function(_0x5507b6){for(var _0x5d9ae2=0x0;_0x5d9ae2<_0x5507b6['length'];_0x5d9ae2+=0x1){_['merge'](_0x4dde80[_0x2203('0x13')][_0x5507b6[_0x5d9ae2][_0x2203('0x22')]],_0x5507b6[_0x5d9ae2]);}return _0x4dde80[_0x2203('0x13')];};};Realtime[_0x2203('0x39')][_0x2203('0x53')]=function(){var _0x169845=this;return function(_0x3f7926){clearVoiceQueues(_0x169845[_0x2203('0x13')]);if(_0x3f7926){_0x3f7926=_['groupBy'](_0x3f7926,'uniqueid');for(var _0xb54e51 in _0x3f7926){if(_0x3f7926[_0x2203('0x23')](_0xb54e51)){for(var _0xafcc82=0x0;_0xafcc82<_0x3f7926[_0xb54e51][_0x2203('0x3a')];_0xafcc82+=0x1){var _0x1bbd2d=_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x54')];if(_0x169845[_0x2203('0x13')][_0x1bbd2d]){if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x55')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2c')]+=0x1;}if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x56')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2d')]+=0x1;}_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x57')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;if(_0xafcc82===_0x3f7926[_0xb54e51]['length']-0x1){_0x169845[_0x2203('0x13')][_0x1bbd2d]['sumDuration']+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')]||_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerabandonAt']||_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5c')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x25')]+=0x1;if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5d')]){_0x169845[_0x2203('0x13')][_0x1bbd2d]['answered']+=0x1;_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x29')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x28')]+=_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]||0x0;}}}}}}return _0x169845[_0x2203('0x13')];};};Realtime['prototype'][_0x2203('0x5e')]=function(){var _0x47a2c7=this;return function(_0x48bd5){clearVoiceCallReports(_0x47a2c7[_0x2203('0x15')]);if(_0x48bd5){for(var _0xe3bee5=0x0;_0xe3bee5<_0x48bd5[_0x2203('0x3a')];_0xe3bee5+=0x1){_0x47a2c7[_0x2203('0x15')]['total']+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x28')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')];if(_0x48bd5[_0xe3bee5]['disposition']===_0x2203('0x60')){_0x47a2c7[_0x2203('0x15')][_0x2203('0x26')]+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x27')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')]-_0x48bd5[_0xe3bee5][_0x2203('0x61')]||0x0;_0x47a2c7[_0x2203('0x15')][_0x2203('0x29')]+=_0x48bd5[_0xe3bee5][_0x2203('0x61')];}}}return _0x47a2c7[_0x2203('0x15')];};};Realtime['prototype'][_0x2203('0x62')]=function(){var _0x7f71b8=this;return function(_0x21b755){if(_0x21b755){freeIsNotKey(_0x21b755,_0x7f71b8[_0x2203('0x14')],_0x2203('0x22'));for(var _0x52c35e=0x0,_0x23f7b1={};_0x52c35e<_0x21b755[_0x2203('0x3a')];_0x52c35e+=0x1){_0x23f7b1=_0x21b755[_0x52c35e];if(_[_0x2203('0x3c')](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]])){_0x7f71b8[_0x2203('0x14')][_0x23f7b1['name']]=new Campaign(_0x23f7b1);}else{_0x7f71b8['mergeFromDatabase'](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]],_0x23f7b1);_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]][_0x2203('0x63')]=_0x23f7b1['SquareProject']?_0x23f7b1[_0x2203('0x64')][_0x2203('0x22')]:undefined;}}}return _0x7f71b8['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x4fc51a=this;return function(_0x5e07d7){if(_0x5e07d7){freeIsNotKey(_0x5e07d7,_0x4fc51a[_0x2203('0x65')],'id');for(var _0x6319a3=0x0,_0x437095={};_0x6319a3<_0x5e07d7['length'];_0x6319a3+=0x1){_0x437095=_0x5e07d7[_0x6319a3];if(_['isUndefined'](_0x4fc51a['voiceExtensions'][_0x437095['id']])){_0x4fc51a[_0x2203('0x65')][_0x437095['id']]=new VoiceExtension(_0x437095);}else{_0x4fc51a[_0x2203('0x40')](_0x4fc51a[_0x2203('0x65')][_0x437095['id']],_0x437095);}}}return _0x4fc51a[_0x2203('0x65')];};};Realtime[_0x2203('0x39')][_0x2203('0x66')]=function(){var _0x3d1797=this;return function(_0x52f25e){clearCampaigns(_0x3d1797[_0x2203('0x14')]);for(var _0x74843=0x0;_0x74843<_0x52f25e[_0x2203('0x3a')];_0x74843+=0x1){_[_0x2203('0x67')](_0x3d1797[_0x2203('0x14')][_0x52f25e[_0x74843][_0x2203('0x22')]],_0x52f25e[_0x74843]);}return _0x3d1797[_0x2203('0x14')];};};Realtime['prototype'][_0x2203('0x68')]=function(){var _0x51a2fe=this;return function(_0x5d0176){if(_0x5d0176){freeIsNotKey(_0x5d0176,_0x51a2fe[_0x2203('0x1e')],'id');for(var _0x5cd030=0x0,_0xb9588e={};_0x5cd030<_0x5d0176[_0x2203('0x3a')];_0x5cd030+=0x1){_0xb9588e=_0x5d0176[_0x5cd030];if(_['isUndefined'](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']])){_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']]=new FaxAccount(_0xb9588e);}else{_0x51a2fe[_0x2203('0x40')](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']],_0xb9588e);}}}return _0x51a2fe[_0x2203('0x1e')];};};Realtime[_0x2203('0x39')]['initVoiceQueues']=function(){var _0x215638=this;return function(_0x3541b3){if(_0x3541b3){freeIsNotKey(_0x3541b3,_0x215638['voiceQueues'],'name');for(var _0x377176=0x0,_0x3fe71b={};_0x377176<_0x3541b3[_0x2203('0x3a')];_0x377176+=0x1){_0x3fe71b=_0x3541b3[_0x377176];if(_[_0x2203('0x3c')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]])){_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]]=new VoiceQueue(_0x3fe71b);}else{_0x215638[_0x2203('0x40')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]],_0x3fe71b);}}}return _0x215638[_0x2203('0x13')];};};module[_0x2203('0x69')]=Realtime; \ No newline at end of file +var _0x2032=['voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','outbound','channels','queueChannels','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','agents','initTelephones','initTrunks','mergeFromDatabase','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2032,0xd9));var _0x2203=function(_0x50a35b,_0x161341){_0x50a35b=_0x50a35b-0x0;var _0x479ad1=_0x2032[_0x50a35b];return _0x479ad1;};'use strict';var _=require('lodash');var moment=require(_0x2203('0x0'));var util=require(_0x2203('0x1'));var Agent=require(_0x2203('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x2203('0x3'));var VoiceQueue=require(_0x2203('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x2203('0x5'));var Campaign=require(_0x2203('0x6'));var VoiceExtension=require(_0x2203('0x7'));var ZendeskAccount=require(_0x2203('0x8'));var SalesforceAccount=require(_0x2203('0x9'));var FreshdeskAccount=require(_0x2203('0xa'));var SugarcrmAccount=require(_0x2203('0xb'));var ZohoAccount=require(_0x2203('0xc'));var DeskAccount=require(_0x2203('0xd'));var VtigerAccount=require(_0x2203('0xe'));var ServicenowAccount=require(_0x2203('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x2203('0x10'));function Realtime(){this['agents']={};this[_0x2203('0x11')]={};this[_0x2203('0x12')]={};this[_0x2203('0x13')]={};this['triggers']={};this[_0x2203('0x14')]={};this['templates']={};this[_0x2203('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x2203('0x16')]={};this[_0x2203('0x17')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x2203('0x18')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x2203('0x19')]={};this[_0x2203('0x1a')]={};this[_0x2203('0x1b')]={};this[_0x2203('0x1c')]={};this[_0x2203('0x1d')]={};this[_0x2203('0x1e')]={};}function freeIsNotKey(_0x2c36e6,_0x2c085c,_0xdf9d0b){var _0x3053f3=_['mapKeys'](_0x2c36e6,function(_0x280eda){return _0x280eda[_0xdf9d0b];});for(var _0x2ee127 in _0x2c085c){if(_0x2c085c['hasOwnProperty'](_0x2ee127)){if(!_0x3053f3[_0x2ee127]){delete _0x2c085c[_0x2ee127];}}}}function freeIsNotKeySip(_0x3f9ef6,_0x8906e1){var _0x4aeb9f=_[_0x2203('0x1f')](_0x3f9ef6,function(_0x5ee83c){return util[_0x2203('0x20')](_0x2203('0x21'),_0x5ee83c[_0x2203('0x22')]);});for(var _0x3b4034 in _0x8906e1){if(_0x8906e1[_0x2203('0x23')](_0x3b4034)){if(!_0x4aeb9f[_0x3b4034]){delete _0x8906e1[_0x3b4034];}}}}function freeIsNotKeyAgent(_0x449039,_0x538c23){var _0x13d3f7=_['mapKeys'](_0x449039,function(_0x5ac866){var _0x15f543=_['isNil'](_0x5ac866[_0x2203('0x24')])?util[_0x2203('0x20')]('SIP/%s',_0x5ac866[_0x2203('0x22')]):_0x5ac866['interface'];return _0x15f543;});for(var _0x5c8da9 in _0x538c23){if(_0x538c23[_0x2203('0x23')](_0x5c8da9)){if(!_0x13d3f7[_0x5c8da9]){delete _0x538c23[_0x5c8da9];}}}}function clearVoiceCallReports(_0x2718f5){_0x2718f5[_0x2203('0x25')]=0x0;_0x2718f5[_0x2203('0x26')]=0x0;_0x2718f5[_0x2203('0x27')]=0x0;_0x2718f5[_0x2203('0x28')]=0x0;_0x2718f5[_0x2203('0x29')]=0x0;}function clearCampaigns(_0x250349){if(!_['isEmpty'](_0x250349)){for(var _0x143f41 in _0x250349){if(_0x250349[_0x2203('0x23')](_0x143f41)){_0x250349[_0x143f41][_0x2203('0x2a')]=0x0;_0x250349[_0x143f41]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xb2071b){if(!_[_0x2203('0x2b')](_0xb2071b)){for(var _0x5c5fd3 in _0xb2071b){if(_0xb2071b[_0x2203('0x23')](_0x5c5fd3)){_0xb2071b[_0x5c5fd3][_0x2203('0x25')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x26')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2c')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2d')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x27')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x28')]=0x0;_0xb2071b[_0x5c5fd3]['sumBillable']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2e')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2f')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x30')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x31')]=0x0;_0xb2071b[_0x5c5fd3]['outboundNoSuchCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x32')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x33')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x34')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x35')]=0x0;_0xb2071b[_0x5c5fd3]['outboundOriginateFailureCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x36')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x37')]=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerAgiCallsDay']=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x38')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x125dfc,_0x464c88){for(var _0x191894 in _0x464c88){if(_0x125dfc[_0x2203('0x23')](_0x191894)){_0x125dfc[_0x191894]=_0x464c88[_0x191894];}}};Realtime[_0x2203('0x39')]['initAgents']=function(){var _0xb22e28=this;return function(_0x2324c0){if(_0x2324c0){freeIsNotKeyAgent(_0x2324c0,_0xb22e28['agents']);for(var _0x2a2ee7=0x0,_0x20fbe1={};_0x2a2ee7<_0x2324c0[_0x2203('0x3a')];_0x2a2ee7+=0x1){_0x20fbe1=_0x2324c0[_0x2a2ee7];var _0x4187b4=_[_0x2203('0x3b')](_0x20fbe1[_0x2203('0x24')])?util[_0x2203('0x20')](_0x2203('0x21'),_0x20fbe1[_0x2203('0x22')]):_0x20fbe1['interface'];if(_[_0x2203('0x3c')](_0xb22e28[_0x2203('0x3d')][_0x4187b4])){_0xb22e28['agents'][_0x4187b4]=new Agent(_0x20fbe1);}else{_0xb22e28['mergeFromDatabase'](_0xb22e28[_0x2203('0x3d')][_0x4187b4],_0x20fbe1);}}}return _0xb22e28['agents'];};};Realtime[_0x2203('0x39')][_0x2203('0x3e')]=function(){var _0x127ee3=this;return function(_0x5221f0){if(_0x5221f0){freeIsNotKeySip(_0x5221f0,_0x127ee3['telephones']);for(var _0x34cdeb=0x0,_0x47c93a={};_0x34cdeb<_0x5221f0[_0x2203('0x3a')];_0x34cdeb+=0x1){_0x47c93a=_0x5221f0[_0x34cdeb];if(_['isUndefined'](_0x127ee3[_0x2203('0x11')][util['format'](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])])){_0x127ee3[_0x2203('0x11')][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a['name'])]=new Telephone(_0x47c93a);}else{_0x127ee3['mergeFromDatabase'](_0x127ee3['telephones'][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])],_0x47c93a);}}}return _0x127ee3[_0x2203('0x11')];};};Realtime[_0x2203('0x39')][_0x2203('0x3f')]=function(){var _0x1c7e3d=this;return function(_0x590b4e){if(_0x590b4e){freeIsNotKeySip(_0x590b4e,_0x1c7e3d[_0x2203('0x12')]);for(var _0x1b12c3=0x0,_0x108fde={};_0x1b12c3<_0x590b4e[_0x2203('0x3a')];_0x1b12c3+=0x1){_0x108fde=_0x590b4e[_0x1b12c3];if(_['isUndefined'](_0x1c7e3d['trunks'][util[_0x2203('0x20')]('SIP/%s',_0x108fde[_0x2203('0x22')])])){_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')]('SIP/%s',_0x108fde['name'])]=new Trunk(_0x108fde);}else{_0x1c7e3d[_0x2203('0x40')](_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')](_0x2203('0x21'),_0x108fde[_0x2203('0x22')])],_0x108fde);}}}return _0x1c7e3d[_0x2203('0x12')];};};Realtime['prototype'][_0x2203('0x41')]=function(){var _0x165a3f=this;return function(_0x3a866c){if(_0x3a866c){freeIsNotKey(_0x3a866c,_0x165a3f[_0x2203('0x42')],'id');for(var _0x16b452=0x0,_0x36b99f={};_0x16b452<_0x3a866c[_0x2203('0x3a')];_0x16b452+=0x1){_0x36b99f=_0x3a866c[_0x16b452];if(_[_0x2203('0x3c')](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']])){_0x165a3f[_0x2203('0x42')][_0x36b99f['id']]=new Trigger(_0x36b99f);}else{_0x165a3f['mergeFromDatabase'](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']],_0x36b99f);}}}return _0x165a3f[_0x2203('0x42')];};};Realtime[_0x2203('0x39')][_0x2203('0x43')]=function(){var _0x4c3259=this;return function(_0x58bd5c){if(_0x58bd5c){freeIsNotKey(_0x58bd5c,_0x4c3259[_0x2203('0x44')],'id');for(var _0x48129c=0x0,_0x273e5f={};_0x48129c<_0x58bd5c[_0x2203('0x3a')];_0x48129c+=0x1){_0x273e5f=_0x58bd5c[_0x48129c];if(_[_0x2203('0x3c')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']])){_0x4c3259['templates'][_0x273e5f['id']]=new Template(_0x273e5f);}else{_0x4c3259[_0x2203('0x40')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']],_0x273e5f);}}}return _0x4c3259['templates'];};};Realtime[_0x2203('0x39')][_0x2203('0x45')]=function(){var _0x35b2e9=this;return function(_0x2600a9){if(_0x2600a9){freeIsNotKey(_0x2600a9,_0x35b2e9['zendeskAccounts'],'id');for(var _0x4c1a29=0x0,_0x21b8ab={};_0x4c1a29<_0x2600a9['length'];_0x4c1a29+=0x1){_0x21b8ab=_0x2600a9[_0x4c1a29];if(_['isUndefined'](_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']])){_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']]=new ZendeskAccount(_0x21b8ab);}else{_0x35b2e9[_0x2203('0x40')](_0x35b2e9['zendeskAccounts'][_0x21b8ab['id']],_0x21b8ab);}}}return _0x35b2e9['zendeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x47')]=function(){var _0x12d7fa=this;return function(_0x21d2d7){if(_0x21d2d7){freeIsNotKey(_0x21d2d7,_0x12d7fa[_0x2203('0x48')],'id');for(var _0x21fd78=0x0,_0x4a7f4e={};_0x21fd78<_0x21d2d7[_0x2203('0x3a')];_0x21fd78+=0x1){_0x4a7f4e=_0x21d2d7[_0x21fd78];if(_['isUndefined'](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']])){_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']]=new SalesforceAccount(_0x4a7f4e);}else{_0x12d7fa[_0x2203('0x40')](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']],_0x4a7f4e);}}}return _0x12d7fa['salesforceAccounts'];};};Realtime['prototype'][_0x2203('0x49')]=function(){var _0x1f772d=this;return function(_0x126aad){if(_0x126aad){freeIsNotKey(_0x126aad,_0x1f772d[_0x2203('0x4a')],'id');for(var _0x559370=0x0,_0x4de47a={};_0x559370<_0x126aad['length'];_0x559370+=0x1){_0x4de47a=_0x126aad[_0x559370];if(_[_0x2203('0x3c')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']])){_0x1f772d['freshdeskAccounts'][_0x4de47a['id']]=new FreshdeskAccount(_0x4de47a);}else{_0x1f772d[_0x2203('0x40')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']],_0x4de47a);}}}return _0x1f772d['freshdeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x4b')]=function(){var _0x172c6a=this;return function(_0x6a1877){if(_0x6a1877){freeIsNotKey(_0x6a1877,_0x172c6a['zohoAccounts'],'id');for(var _0x120db1=0x0,_0x5268d6={};_0x120db1<_0x6a1877[_0x2203('0x3a')];_0x120db1+=0x1){_0x5268d6=_0x6a1877[_0x120db1];if(_[_0x2203('0x3c')](_0x172c6a['zohoAccounts'][_0x5268d6['id']])){_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']]=new ZohoAccount(_0x5268d6);}else{_0x172c6a[_0x2203('0x40')](_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']],_0x5268d6);}}}return _0x172c6a[_0x2203('0x4c')];};};Realtime[_0x2203('0x39')][_0x2203('0x4d')]=function(){var _0x569d4a=this;return function(_0x562a3d){if(_0x562a3d){freeIsNotKey(_0x562a3d,_0x569d4a[_0x2203('0x19')],'id');for(var _0x524356=0x0,_0x56e881={};_0x524356<_0x562a3d[_0x2203('0x3a')];_0x524356+=0x1){_0x56e881=_0x562a3d[_0x524356];if(_[_0x2203('0x3c')](_0x569d4a[_0x2203('0x19')][_0x56e881['id']])){_0x569d4a['deskAccounts'][_0x56e881['id']]=new DeskAccount(_0x56e881);}else{_0x569d4a[_0x2203('0x40')](_0x569d4a['deskAccounts'][_0x56e881['id']],_0x56e881);}}}return _0x569d4a['deskAccounts'];};};Realtime[_0x2203('0x39')]['initSugarcrmAccounts']=function(){var _0x54ec71=this;return function(_0x5efc59){if(_0x5efc59){freeIsNotKey(_0x5efc59,_0x54ec71[_0x2203('0x18')],'id');for(var _0x31256b=0x0,_0x367122={};_0x31256b<_0x5efc59[_0x2203('0x3a')];_0x31256b+=0x1){_0x367122=_0x5efc59[_0x31256b];if(_[_0x2203('0x3c')](_0x54ec71[_0x2203('0x18')][_0x367122['id']])){_0x54ec71[_0x2203('0x18')][_0x367122['id']]=new SugarcrmAccount(_0x367122);}else{_0x54ec71[_0x2203('0x40')](_0x54ec71[_0x2203('0x18')][_0x367122['id']],_0x367122);}}}return _0x54ec71[_0x2203('0x18')];};};Realtime[_0x2203('0x39')][_0x2203('0x4e')]=function(){var _0x58ff57=this;return function(_0x585bde){if(_0x585bde){freeIsNotKey(_0x585bde,_0x58ff57[_0x2203('0x1a')],'id');for(var _0x43d8c0=0x0,_0x2511bd={};_0x43d8c0<_0x585bde[_0x2203('0x3a')];_0x43d8c0+=0x1){_0x2511bd=_0x585bde[_0x43d8c0];if(_[_0x2203('0x3c')](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']])){_0x58ff57['vtigerAccounts'][_0x2511bd['id']]=new VtigerAccount(_0x2511bd);}else{_0x58ff57['mergeFromDatabase'](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']],_0x2511bd);}}}return _0x58ff57[_0x2203('0x1a')];};};Realtime[_0x2203('0x39')][_0x2203('0x4f')]=function(){var _0xcab922=this;return function(_0x7b0b9c){if(_0x7b0b9c){freeIsNotKey(_0x7b0b9c,_0xcab922[_0x2203('0x1b')],'id');for(var _0x191b67=0x0,_0x2c6bcc={};_0x191b67<_0x7b0b9c[_0x2203('0x3a')];_0x191b67+=0x1){_0x2c6bcc=_0x7b0b9c[_0x191b67];if(_[_0x2203('0x3c')](_0xcab922['servicenowAccounts'][_0x2c6bcc['id']])){_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']]=new ServicenowAccount(_0x2c6bcc);}else{_0xcab922[_0x2203('0x40')](_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']],_0x2c6bcc);}}}return _0xcab922[_0x2203('0x1b')];};};Realtime[_0x2203('0x39')][_0x2203('0x50')]=function(){var _0x52c159=this;return function(_0x544756){if(_0x544756){freeIsNotKey(_0x544756,_0x52c159[_0x2203('0x1c')],'id');for(var _0x35b7b9=0x0,_0x49e795={};_0x35b7b9<_0x544756[_0x2203('0x3a')];_0x35b7b9+=0x1){_0x49e795=_0x544756[_0x35b7b9];if(_[_0x2203('0x3c')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']])){_0x52c159[_0x2203('0x1c')][_0x49e795['id']]=new Dynamics365Account(_0x49e795);}else{_0x52c159[_0x2203('0x40')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']],_0x49e795);}}}return _0x52c159[_0x2203('0x1c')];};};Realtime[_0x2203('0x39')][_0x2203('0x51')]=function(){var _0x519120=this;return function(_0x468619){if(_0x468619){freeIsNotKey(_0x468619,_0x519120[_0x2203('0x1d')],'id');for(var _0x465898=0x0,_0x4e461e={};_0x465898<_0x468619[_0x2203('0x3a')];_0x465898+=0x1){_0x4e461e=_0x468619[_0x465898];if(_[_0x2203('0x3c')](_0x519120[_0x2203('0x1d')][_0x4e461e['id']])){_0x519120[_0x2203('0x1d')][_0x4e461e['id']]=new FreshsalesAccount(_0x4e461e);}else{_0x519120[_0x2203('0x40')](_0x519120['freshsalesAccounts'][_0x4e461e['id']],_0x4e461e);}}}return _0x519120[_0x2203('0x1d')];};};Realtime[_0x2203('0x39')][_0x2203('0x52')]=function(){var _0x4dde80=this;return function(_0x5507b6){for(var _0x5d9ae2=0x0;_0x5d9ae2<_0x5507b6['length'];_0x5d9ae2+=0x1){_['merge'](_0x4dde80[_0x2203('0x13')][_0x5507b6[_0x5d9ae2][_0x2203('0x22')]],_0x5507b6[_0x5d9ae2]);}return _0x4dde80[_0x2203('0x13')];};};Realtime[_0x2203('0x39')][_0x2203('0x53')]=function(){var _0x169845=this;return function(_0x3f7926){clearVoiceQueues(_0x169845[_0x2203('0x13')]);if(_0x3f7926){_0x3f7926=_['groupBy'](_0x3f7926,'uniqueid');for(var _0xb54e51 in _0x3f7926){if(_0x3f7926[_0x2203('0x23')](_0xb54e51)){for(var _0xafcc82=0x0;_0xafcc82<_0x3f7926[_0xb54e51][_0x2203('0x3a')];_0xafcc82+=0x1){var _0x1bbd2d=_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x54')];if(_0x169845[_0x2203('0x13')][_0x1bbd2d]){if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x55')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2c')]+=0x1;}if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x56')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2d')]+=0x1;}_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x57')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;if(_0xafcc82===_0x3f7926[_0xb54e51]['length']-0x1){_0x169845[_0x2203('0x13')][_0x1bbd2d]['sumDuration']+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')]||_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerabandonAt']||_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5c')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x25')]+=0x1;if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5d')]){_0x169845[_0x2203('0x13')][_0x1bbd2d]['answered']+=0x1;_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x29')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x28')]+=_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]||0x0;}}}}}}return _0x169845[_0x2203('0x13')];};};Realtime['prototype'][_0x2203('0x5e')]=function(){var _0x47a2c7=this;return function(_0x48bd5){clearVoiceCallReports(_0x47a2c7[_0x2203('0x15')]);if(_0x48bd5){for(var _0xe3bee5=0x0;_0xe3bee5<_0x48bd5[_0x2203('0x3a')];_0xe3bee5+=0x1){_0x47a2c7[_0x2203('0x15')]['total']+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x28')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')];if(_0x48bd5[_0xe3bee5]['disposition']===_0x2203('0x60')){_0x47a2c7[_0x2203('0x15')][_0x2203('0x26')]+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x27')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')]-_0x48bd5[_0xe3bee5][_0x2203('0x61')]||0x0;_0x47a2c7[_0x2203('0x15')][_0x2203('0x29')]+=_0x48bd5[_0xe3bee5][_0x2203('0x61')];}}}return _0x47a2c7[_0x2203('0x15')];};};Realtime['prototype'][_0x2203('0x62')]=function(){var _0x7f71b8=this;return function(_0x21b755){if(_0x21b755){freeIsNotKey(_0x21b755,_0x7f71b8[_0x2203('0x14')],_0x2203('0x22'));for(var _0x52c35e=0x0,_0x23f7b1={};_0x52c35e<_0x21b755[_0x2203('0x3a')];_0x52c35e+=0x1){_0x23f7b1=_0x21b755[_0x52c35e];if(_[_0x2203('0x3c')](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]])){_0x7f71b8[_0x2203('0x14')][_0x23f7b1['name']]=new Campaign(_0x23f7b1);}else{_0x7f71b8['mergeFromDatabase'](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]],_0x23f7b1);_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]][_0x2203('0x63')]=_0x23f7b1['SquareProject']?_0x23f7b1[_0x2203('0x64')][_0x2203('0x22')]:undefined;}}}return _0x7f71b8['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x4fc51a=this;return function(_0x5e07d7){if(_0x5e07d7){freeIsNotKey(_0x5e07d7,_0x4fc51a[_0x2203('0x65')],'id');for(var _0x6319a3=0x0,_0x437095={};_0x6319a3<_0x5e07d7['length'];_0x6319a3+=0x1){_0x437095=_0x5e07d7[_0x6319a3];if(_['isUndefined'](_0x4fc51a['voiceExtensions'][_0x437095['id']])){_0x4fc51a[_0x2203('0x65')][_0x437095['id']]=new VoiceExtension(_0x437095);}else{_0x4fc51a[_0x2203('0x40')](_0x4fc51a[_0x2203('0x65')][_0x437095['id']],_0x437095);}}}return _0x4fc51a[_0x2203('0x65')];};};Realtime[_0x2203('0x39')][_0x2203('0x66')]=function(){var _0x3d1797=this;return function(_0x52f25e){clearCampaigns(_0x3d1797[_0x2203('0x14')]);for(var _0x74843=0x0;_0x74843<_0x52f25e[_0x2203('0x3a')];_0x74843+=0x1){_[_0x2203('0x67')](_0x3d1797[_0x2203('0x14')][_0x52f25e[_0x74843][_0x2203('0x22')]],_0x52f25e[_0x74843]);}return _0x3d1797[_0x2203('0x14')];};};Realtime['prototype'][_0x2203('0x68')]=function(){var _0x51a2fe=this;return function(_0x5d0176){if(_0x5d0176){freeIsNotKey(_0x5d0176,_0x51a2fe[_0x2203('0x1e')],'id');for(var _0x5cd030=0x0,_0xb9588e={};_0x5cd030<_0x5d0176[_0x2203('0x3a')];_0x5cd030+=0x1){_0xb9588e=_0x5d0176[_0x5cd030];if(_['isUndefined'](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']])){_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']]=new FaxAccount(_0xb9588e);}else{_0x51a2fe[_0x2203('0x40')](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']],_0xb9588e);}}}return _0x51a2fe[_0x2203('0x1e')];};};Realtime[_0x2203('0x39')]['initVoiceQueues']=function(){var _0x215638=this;return function(_0x3541b3){if(_0x3541b3){freeIsNotKey(_0x3541b3,_0x215638['voiceQueues'],'name');for(var _0x377176=0x0,_0x3fe71b={};_0x377176<_0x3541b3[_0x2203('0x3a')];_0x377176+=0x1){_0x3fe71b=_0x3541b3[_0x377176];if(_[_0x2203('0x3c')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]])){_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]]=new VoiceQueue(_0x3fe71b);}else{_0x215638[_0x2203('0x40')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]],_0x3fe71b);}}}return _0x215638[_0x2203('0x13')];};};module[_0x2203('0x69')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 51800e2..b07faf0 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 _0x1c3d=['mergeDBDataToRealtime','hasOwnProperty'];(function(_0x2dc7c9,_0x3a15f8){var _0x3e6536=function(_0x312829){while(--_0x312829){_0x2dc7c9['push'](_0x2dc7c9['shift']());}};_0x3e6536(++_0x3a15f8);}(_0x1c3d,0x177));var _0xd1c3=function(_0x3aaae2,_0x558dac){_0x3aaae2=_0x3aaae2-0x0;var _0x5b6e34=_0x1c3d[_0x3aaae2];return _0x5b6e34;};'use strict';function mergeDBDataToRealtime(_0xdb6845,_0x9491ca){var _0xed9733=Object['assign']({},_0xdb6845);for(var _0x29b56b in _0x9491ca){if(_0xed9733[_0xd1c3('0x0')](_0x29b56b)){_0xed9733[_0x29b56b]=_0x9491ca[_0x29b56b];}}return _0xed9733;}exports[_0xd1c3('0x1')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x6302=['hasOwnProperty'];(function(_0x44e918,_0x4ef1d7){var _0x56dc25=function(_0x5c8c00){while(--_0x5c8c00){_0x44e918['push'](_0x44e918['shift']());}};_0x56dc25(++_0x4ef1d7);}(_0x6302,0x1df));var _0x2630=function(_0x515d27,_0x5ecc30){_0x515d27=_0x515d27-0x0;var _0x432d58=_0x6302[_0x515d27];return _0x432d58;};'use strict';function mergeDBDataToRealtime(_0x2c9d17,_0x51d64){var _0x1d72e9=Object['assign']({},_0x2c9d17);for(var _0x46532a in _0x51d64){if(_0x1d72e9[_0x2630('0x0')](_0x46532a)){_0x1d72e9[_0x46532a]=_0x51d64[_0x46532a];}}return _0x1d72e9;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 6d0e1b6..9e9574a 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 _0x49a3=['format','prototype','length','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','keys','getCallType','channel','split','getAgentByInternal','calleridnum','internal','destination','type','lastapplication','lastdata','from-voip-provider','callerid','context','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','connectedlinenum','transfers','linkedid','uniqueid','UserId','membername','monitorFilename','filename','createdAt','calleridname','connectedlinename','exten','xcally-motion-dialer','create','isArray','forEach','voiceDialReport','startsWith','Local','substring','indexOf','phone','lastIndexOf','blindTransfer','exports','lodash','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','custom:voiceDialReport','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface'];(function(_0x4ea3a2,_0x179738){var _0x143cc6=function(_0x27983d){while(--_0x27983d){_0x4ea3a2['push'](_0x4ea3a2['shift']());}};_0x143cc6(++_0x179738);}(_0x49a3,0xea));var _0x349a=function(_0x2bd523,_0x2af742){_0x2bd523=_0x2bd523-0x0;var _0x59f347=_0x49a3[_0x2bd523];return _0x59f347;};'use strict';var _=require(_0x349a('0x0'));var moment=require(_0x349a('0x1'));var util=require(_0x349a('0x2'));var config=require('../../../config/environment');var ami=require(_0x349a('0x3'));var RpcVoiceAgentReport=require(_0x349a('0x4'));var RpcVoiceCallReport=require(_0x349a('0x5'));var RpcVoiceDialReport=require(_0x349a('0x6'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x349a('0x7'));var RpcVoiceRecording=require(_0x349a('0x8'));var RpcVoiceTransferReport=require(_0x349a('0x9'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x349a('0xa'));var VoiceAgentReport=require(_0x349a('0xb'));var VoiceDialReport=require(_0x349a('0xc'));var UserReport=require('./userReport');function Report(_0x2ee031){this[_0x349a('0xd')]=_0x2ee031;this['agents']=_0x2ee031[_0x349a('0xe')];this[_0x349a('0xf')]=_0x2ee031[_0x349a('0xf')];}Report['prototype']['sync']=function(_0x14b5c7){var _0x451e15=new VoiceQueueReport(this[_0x349a('0xd')]);var _0x4cd5d6=new VoiceAgentReport(this[_0x349a('0xd')]);var _0x1cc2b1=new VoiceDialReport(this['realtime']);var _0x10d01d=new VoiceCallReport(this[_0x349a('0xd')]);var _0x3053e8=new UserReport(this[_0x349a('0xd')]);if(config[_0x349a('0x10')]&&config['xdr'][_0x349a('0x11')]){ami['on'](_0x349a('0x12'),this[_0x349a('0x13')][_0x349a('0x14')](this));ami['on'](_0x349a('0x15'),this[_0x349a('0x16')][_0x349a('0x14')](this));ami['on']('custom:voiceAgentReport',this[_0x349a('0x17')]['bind'](this));ami['on'](_0x349a('0x18'),this['voiceDialReport'][_0x349a('0x14')](this));ami['on']('blindtransfer',this['blindTransfer'][_0x349a('0x14')](this));ami['on'](_0x349a('0x19'),this[_0x349a('0x1a')][_0x349a('0x14')](this));}};Report['prototype'][_0x349a('0x1b')]=function(_0x5832d4){var _0x195740;_0x195740=_[_0x349a('0x1c')](this[_0x349a('0xe')],function(_0x27fe8c){return _0x27fe8c[_0x349a('0x1d')]==_0x5832d4||_0x27fe8c[_0x349a('0x1e')]==_0x5832d4;});if(_[_0x349a('0x1f')](_0x195740)){var _0x4145c3=_['find'](this[_0x349a('0xf')],function(_0x3eda58){return _0x3eda58[_0x349a('0x1d')]==_0x5832d4||_0x3eda58[_0x349a('0x1e')]==_0x5832d4;});if(_0x4145c3){_0x195740=_[_0x349a('0x1c')](this[_0x349a('0xe')],function(_0x3c1b8e){return _0x3c1b8e[_0x349a('0x20')]==util[_0x349a('0x21')]('SIP/%s',_0x4145c3[_0x349a('0x1e')]);});}}return _0x195740;};Report[_0x349a('0x22')][_0x349a('0x13')]=function(_0x1b6446){for(var _0x43e5d8=0x0;_0x43e5d8<_0x1b6446[_0x349a('0x23')];_0x43e5d8+=0x1){var _0x19b743=this[_0x349a('0x1b')](_0x1b6446[_0x43e5d8]['connectedlinenum']);if(_0x19b743){_0x1b6446[_0x43e5d8][_0x349a('0x1d')]=_0x19b743['accountcode'];_0x1b6446[_0x43e5d8][_0x349a('0x24')]=!![];_0x1b6446[_0x43e5d8][_0x349a('0x25')]=_0x19b743['name'];_0x1b6446[_0x43e5d8][_0x349a('0x20')]=_[_0x349a('0x1f')](_0x19b743[_0x349a('0x20')])?util['format'](_0x349a('0x26'),_0x19b743[_0x349a('0x1e')]):_0x19b743['interface'];if(_0x1b6446[_0x43e5d8][_0x349a('0x27')]){_0x1b6446[_0x43e5d8][_0x349a('0x28')]=moment()['format'](_0x349a('0x29'));}if(_0x1b6446[_0x43e5d8][_0x349a('0x2a')]){_0x1b6446[_0x43e5d8][_0x349a('0x2b')]=moment()[_0x349a('0x21')](_0x349a('0x29'));}RpcMemberReport['voiceQueueReport'](_0x1b6446[_0x43e5d8]);}RpcVoiceQueueReport['create'](_0x1b6446[_0x43e5d8]);}};function extractCalleridNumber(_0x416bc3){var _0x328a27=_0x416bc3[_0x349a('0x2c')](/<(.*?)>/);return _0x328a27?_0x328a27[0x1]:_0x416bc3;}Report[_0x349a('0x22')]['getAgentByInternal']=function(_0x11df81){for(var _0x1d1c95=0x0;_0x1d1c95',_0x87d216['calleridname'],_0x87d216[_0x349a('0x32')]);}if(RpcVoiceTransferReport[_0x349a('0x41')][_0x87d216[_0x349a('0x42')]]){var _0x4483a7=RpcVoiceTransferReport[_0x349a('0x41')][_0x87d216[_0x349a('0x42')]];_0x4483a7['transfereelinkedid']=_0x87d216[_0x349a('0x43')];RpcVoiceTransferReport['blindTransfer'](_0x4483a7);delete RpcVoiceTransferReport[_0x349a('0x41')][_0x87d216[_0x349a('0x42')]];}if(_[_0x349a('0x1f')](_0x87d216[_0x349a('0x35')])){_0x87d216[_0x349a('0x35')]=this[_0x349a('0x2e')](_0x87d216);}if(_['isNil'](_0x87d216[_0x349a('0x44')])){var _0x52cc97=_0x87d216[_0x349a('0x2f')]['split']('-')[0x0];var _0x28273a=this[_0x349a('0xe')][_0x52cc97];if(!_0x28273a)_0x28273a=this[_0x349a('0x31')](_0x87d216['accountcode']);if(_0x28273a){_0x87d216[_0x349a('0x44')]=_0x28273a['id'];_0x87d216[_0x349a('0x45')]=_0x28273a[_0x349a('0x1e')];}}RpcVoiceCallReport['create'](_0x87d216);if(_0x87d216['monitor']){for(var _0x51650f=0x0;_0x51650f<_0x87d216['monitors'][_0x349a('0x23')];_0x51650f+=0x1){_0x87d216[_0x349a('0x46')]=_0x87d216['monitors'][_0x51650f][_0x349a('0x47')];_0x87d216[_0x349a('0x48')]=_0x87d216['monitors'][_0x51650f]['createdAt'];if(_0x87d216['exten']=='xcally-motion-preview'){_0x87d216[_0x349a('0x32')]=_0x87d216[_0x349a('0x40')];_0x87d216[_0x349a('0x49')]=_0x87d216[_0x349a('0x4a')];_0x87d216[_0x349a('0x40')]=_0x87d216[_0x349a('0x1d')];_0x87d216[_0x349a('0x4a')]=_0x87d216[_0x349a('0x45')];_0x87d216[_0x349a('0x4b')]=_0x87d216[_0x349a('0x3c')];}else if(_0x87d216[_0x349a('0x4b')]==_0x349a('0x4c')){_0x87d216[_0x349a('0x32')]=_0x87d216[_0x349a('0x34')];_0x87d216[_0x349a('0x4b')]=_0x87d216['originatecalleridnum'];}RpcVoiceRecording[_0x349a('0x4d')](_0x87d216);}}};Report[_0x349a('0x22')][_0x349a('0x17')]=function(_0xbd2929){if(_[_0x349a('0x4e')](_0xbd2929)){_0xbd2929[_0x349a('0x4f')](function(_0x57c99d){RpcVoiceAgentReport[_0x349a('0x4d')](_0x57c99d);});}else{RpcVoiceAgentReport['create'](_0xbd2929);}};Report[_0x349a('0x22')][_0x349a('0x50')]=function(_0x3a8fd7){RpcVoiceDialReport['create'](_0x3a8fd7);var _0x51bb8b;var _0x6cc84e;var _0x35cd90=_0x3a8fd7[_0x349a('0x2f')];if(_[_0x349a('0x51')](_0x35cd90,_0x349a('0x52'))){_0x6cc84e=_0x35cd90[_0x349a('0x53')](_0x35cd90['indexOf']('/')+0x1,_0x35cd90[_0x349a('0x54')]('@'));_0x51bb8b=_[_0x349a('0x1c')](this[_0x349a('0xe')],function(_0xba3e3){return _0xba3e3['mobile']==_0x6cc84e||_0xba3e3[_0x349a('0x55')]==_0x6cc84e||_0xba3e3[_0x349a('0x1d')]==_0x6cc84e;});}else{_0x6cc84e=_0x35cd90['substring'](_0x35cd90['indexOf']('/')+0x1,_0x35cd90[_0x349a('0x56')]('-'));_0x51bb8b=this[_0x349a('0x1b')](_0x6cc84e);}if(_0x51bb8b){_0x3a8fd7['interface']=_['isNil'](_0x51bb8b[_0x349a('0x20')])?util[_0x349a('0x21')](_0x349a('0x26'),_0x51bb8b['name']):_0x51bb8b[_0x349a('0x20')];_0x3a8fd7[_0x349a('0x45')]=_0x51bb8b[_0x349a('0x1e')];_0x3a8fd7[_0x349a('0x1d')]=_0x51bb8b[_0x349a('0x1d')];RpcMemberReport[_0x349a('0x50')](_0x3a8fd7);}};Report['prototype'][_0x349a('0x57')]=function(_0x2f5b67){RpcVoiceTransferReport['transfers'][_0x2f5b67['transfererlinkedid']]=_0x2f5b67;};Report[_0x349a('0x22')][_0x349a('0x1a')]=function(_0x51ddab){RpcVoiceTransferReport['attendedTransfer'](_0x51ddab);};module[_0x349a('0x58')]=Report; \ No newline at end of file +var _0x695c=['destinationchannel','disposition','ANSWERED','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','monitor','monitors','monitorFilename','createdAt','exten','connectedlinename','forEach','startsWith','Local','substring','indexOf','mobile','membername','transfererlinkedid','attendedTransfer','lodash','moment','util','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','attendedtransfer','findAgent','accountcode','name','isNil','find','interface','SIP/%s','length','connectedlinenum','assigned','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','calleridnum','internal','type','dialer','lastapplication','queue','lastdata','destination','callerid','context','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','channel'];(function(_0x425b19,_0x2dcf14){var _0x15ecab=function(_0x317d46){while(--_0x317d46){_0x425b19['push'](_0x425b19['shift']());}};_0x15ecab(++_0x2dcf14);}(_0x695c,0x174));var _0xc695=function(_0x55a5c5,_0x421935){_0x55a5c5=_0x55a5c5-0x0;var _0x55f93a=_0x695c[_0x55a5c5];return _0x55f93a;};'use strict';var _=require(_0xc695('0x0'));var moment=require(_0xc695('0x1'));var util=require(_0xc695('0x2'));var config=require(_0xc695('0x3'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xc695('0x4'));var RpcVoiceCallReport=require(_0xc695('0x5'));var RpcVoiceDialReport=require(_0xc695('0x6'));var RpcMemberReport=require(_0xc695('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xc695('0x8'));var VoiceAgentReport=require(_0xc695('0x9'));var VoiceDialReport=require(_0xc695('0xa'));var UserReport=require(_0xc695('0xb'));function Report(_0x32cf6a){this[_0xc695('0xc')]=_0x32cf6a;this[_0xc695('0xd')]=_0x32cf6a[_0xc695('0xd')];this[_0xc695('0xe')]=_0x32cf6a['telephones'];}Report[_0xc695('0xf')][_0xc695('0x10')]=function(_0xa5fcd2){var _0x5e6ab5=new VoiceQueueReport(this[_0xc695('0xc')]);var _0x5ad3a3=new VoiceAgentReport(this[_0xc695('0xc')]);var _0x2a4617=new VoiceDialReport(this[_0xc695('0xc')]);var _0x2c16d6=new VoiceCallReport(this[_0xc695('0xc')]);var _0x3ba8ac=new UserReport(this['realtime']);if(config[_0xc695('0x11')]&&config[_0xc695('0x11')][_0xc695('0x12')]){ami['on'](_0xc695('0x13'),this[_0xc695('0x14')]['bind'](this));ami['on'](_0xc695('0x15'),this[_0xc695('0x16')][_0xc695('0x17')](this));ami['on'](_0xc695('0x18'),this[_0xc695('0x19')][_0xc695('0x17')](this));ami['on']('custom:voiceDialReport',this[_0xc695('0x1a')][_0xc695('0x17')](this));ami['on']('blindtransfer',this['blindTransfer'][_0xc695('0x17')](this));ami['on'](_0xc695('0x1b'),this['attendedTransfer'][_0xc695('0x17')](this));}};Report[_0xc695('0xf')][_0xc695('0x1c')]=function(_0x14395c){var _0x8d3c40;_0x8d3c40=_['find'](this[_0xc695('0xd')],function(_0xac6586){return _0xac6586[_0xc695('0x1d')]==_0x14395c||_0xac6586[_0xc695('0x1e')]==_0x14395c;});if(_[_0xc695('0x1f')](_0x8d3c40)){var _0x3ef924=_[_0xc695('0x20')](this['telephones'],function(_0xa31a8){return _0xa31a8[_0xc695('0x1d')]==_0x14395c||_0xa31a8['name']==_0x14395c;});if(_0x3ef924){_0x8d3c40=_['find'](this[_0xc695('0xd')],function(_0x4d08e6){return _0x4d08e6[_0xc695('0x21')]==util['format'](_0xc695('0x22'),_0x3ef924[_0xc695('0x1e')]);});}}return _0x8d3c40;};Report['prototype'][_0xc695('0x14')]=function(_0x1b4433){for(var _0x406779=0x0;_0x406779<_0x1b4433[_0xc695('0x23')];_0x406779+=0x1){var _0x10cbf7=this[_0xc695('0x1c')](_0x1b4433[_0x406779][_0xc695('0x24')]);if(_0x10cbf7){_0x1b4433[_0x406779][_0xc695('0x1d')]=_0x10cbf7[_0xc695('0x1d')];_0x1b4433[_0x406779][_0xc695('0x25')]=!![];_0x1b4433[_0x406779]['lastAssignedTo']=_0x10cbf7[_0xc695('0x1e')];_0x1b4433[_0x406779][_0xc695('0x21')]=_[_0xc695('0x1f')](_0x10cbf7[_0xc695('0x21')])?util[_0xc695('0x26')]('SIP/%s',_0x10cbf7[_0xc695('0x1e')]):_0x10cbf7[_0xc695('0x21')];if(_0x1b4433[_0x406779][_0xc695('0x27')]){_0x1b4433[_0x406779][_0xc695('0x28')]=moment()[_0xc695('0x26')](_0xc695('0x29'));}if(_0x1b4433[_0x406779]['queuecallerexit']){_0x1b4433[_0x406779][_0xc695('0x2a')]=moment()[_0xc695('0x26')](_0xc695('0x29'));}RpcMemberReport[_0xc695('0x14')](_0x1b4433[_0x406779]);}RpcVoiceQueueReport[_0xc695('0x2b')](_0x1b4433[_0x406779]);}};function extractCalleridNumber(_0x2872f5){var _0x5f4afc=_0x2872f5[_0xc695('0x2c')](/<(.*?)>/);return _0x5f4afc?_0x5f4afc[0x1]:_0x2872f5;}Report['prototype'][_0xc695('0x2d')]=function(_0x280a55){for(var _0x1f0d64=0x0;_0x1f0d64',_0x145cc1[_0xc695('0x42')],_0x145cc1['calleridnum']);}if(RpcVoiceTransferReport[_0xc695('0x43')][_0x145cc1['linkedid']]){var _0x1ec98d=RpcVoiceTransferReport[_0xc695('0x43')][_0x145cc1[_0xc695('0x44')]];_0x1ec98d[_0xc695('0x45')]=_0x145cc1[_0xc695('0x46')];RpcVoiceTransferReport[_0xc695('0x47')](_0x1ec98d);delete RpcVoiceTransferReport['transfers'][_0x145cc1['linkedid']];}if(_['isNil'](_0x145cc1[_0xc695('0x32')])){_0x145cc1['type']=this[_0xc695('0x2f')](_0x145cc1);}if(_['isNil'](_0x145cc1['UserId'])){var _0x5355b7=_0x145cc1[_0xc695('0x3e')]['split']('-')[0x0];var _0x5cb649=this[_0xc695('0xd')][_0x5355b7];if(!_0x5cb649)_0x5cb649=this['getAgentByInternal'](_0x145cc1[_0xc695('0x1d')]);if(_0x5cb649){_0x145cc1['UserId']=_0x5cb649['id'];_0x145cc1['membername']=_0x5cb649[_0xc695('0x1e')];}}RpcVoiceCallReport[_0xc695('0x2b')](_0x145cc1);if(_0x145cc1[_0xc695('0x48')]){for(var _0x1af5b1=0x0;_0x1af5b1<_0x145cc1[_0xc695('0x49')][_0xc695('0x23')];_0x1af5b1+=0x1){_0x145cc1[_0xc695('0x4a')]=_0x145cc1[_0xc695('0x49')][_0x1af5b1]['filename'];_0x145cc1[_0xc695('0x4b')]=_0x145cc1['monitors'][_0x1af5b1][_0xc695('0x4b')];if(_0x145cc1[_0xc695('0x4c')]=='xcally-motion-preview'){_0x145cc1['calleridnum']=_0x145cc1[_0xc695('0x24')];_0x145cc1['calleridname']=_0x145cc1[_0xc695('0x4d')];_0x145cc1[_0xc695('0x24')]=_0x145cc1[_0xc695('0x1d')];_0x145cc1[_0xc695('0x4d')]=_0x145cc1['membername'];_0x145cc1[_0xc695('0x4c')]=_0x145cc1[_0xc695('0x3d')];}else if(_0x145cc1[_0xc695('0x4c')]=='xcally-motion-dialer'){_0x145cc1[_0xc695('0x30')]=_0x145cc1[_0xc695('0x37')];_0x145cc1['exten']=_0x145cc1[_0xc695('0x3d')];}RpcVoiceRecording['create'](_0x145cc1);}}};Report[_0xc695('0xf')][_0xc695('0x19')]=function(_0x345535){if(_['isArray'](_0x345535)){_0x345535[_0xc695('0x4e')](function(_0x3a0363){RpcVoiceAgentReport[_0xc695('0x2b')](_0x3a0363);});}else{RpcVoiceAgentReport['create'](_0x345535);}};Report[_0xc695('0xf')][_0xc695('0x1a')]=function(_0x2a08c7){RpcVoiceDialReport[_0xc695('0x2b')](_0x2a08c7);var _0x21a6d4;var _0x2d2175;var _0x1fcdae=_0x2a08c7[_0xc695('0x3e')];if(_[_0xc695('0x4f')](_0x1fcdae,_0xc695('0x50'))){_0x2d2175=_0x1fcdae[_0xc695('0x51')](_0x1fcdae[_0xc695('0x52')]('/')+0x1,_0x1fcdae[_0xc695('0x52')]('@'));_0x21a6d4=_[_0xc695('0x20')](this[_0xc695('0xd')],function(_0x3710f7){return _0x3710f7[_0xc695('0x53')]==_0x2d2175||_0x3710f7['phone']==_0x2d2175||_0x3710f7[_0xc695('0x1d')]==_0x2d2175;});}else{_0x2d2175=_0x1fcdae['substring'](_0x1fcdae['indexOf']('/')+0x1,_0x1fcdae['lastIndexOf']('-'));_0x21a6d4=this[_0xc695('0x1c')](_0x2d2175);}if(_0x21a6d4){_0x2a08c7['interface']=_[_0xc695('0x1f')](_0x21a6d4[_0xc695('0x21')])?util[_0xc695('0x26')](_0xc695('0x22'),_0x21a6d4[_0xc695('0x1e')]):_0x21a6d4['interface'];_0x2a08c7[_0xc695('0x54')]=_0x21a6d4[_0xc695('0x1e')];_0x2a08c7[_0xc695('0x1d')]=_0x21a6d4[_0xc695('0x1d')];RpcMemberReport['voiceDialReport'](_0x2a08c7);}};Report[_0xc695('0xf')][_0xc695('0x47')]=function(_0x2fa36e){RpcVoiceTransferReport[_0xc695('0x43')][_0x2fa36e[_0xc695('0x55')]]=_0x2fa36e;};Report[_0xc695('0xf')][_0xc695('0x56')]=function(_0x294b2e){RpcVoiceTransferReport['attendedTransfer'](_0x294b2e);};module['exports']=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index ed3d0d5..f46f357 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdcf2=['telephones','registryentry','bind','devicestatechange','peerstatus','syncPeerStatus','resolve','actionSipShowRegistry','catch','error','inspect','then','[userReport][devicestatelist]','[userReport][sippeerstatus]','syncRealtimeShow','prototype','isNotNull','isUndefined','emit','syncRegistry','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','stateRegistry','omit','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','updateStatusRealtime','telephone:%s','telephone:save','toNumber','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','lodash','moment','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','trunks','agents'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xdcf2,0x1a4));var _0x2dcf=function(_0x86a1f1,_0x38d683){_0x86a1f1=_0x86a1f1-0x0;var _0x3d0d87=_0xdcf2[_0x86a1f1];return _0x3d0d87;};'use strict';var _=require(_0x2dcf('0x0'));var moment=require(_0x2dcf('0x1'));var util=require('util');var Redis=require('ioredis');var BPromise=require(_0x2dcf('0x2'));var config=require(_0x2dcf('0x3'));var logger=require(_0x2dcf('0x4'))(_0x2dcf('0x5'));var ami=require(_0x2dcf('0x6'));config[_0x2dcf('0x7')]=_[_0x2dcf('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2dcf('0x9'))(new Redis(config[_0x2dcf('0x7')]));function UserReport(_0x5b96cd){this[_0x2dcf('0xa')]=_0x5b96cd[_0x2dcf('0xa')];this[_0x2dcf('0xb')]=_0x5b96cd[_0x2dcf('0xb')];this[_0x2dcf('0xc')]=_0x5b96cd[_0x2dcf('0xc')];ami['on'](_0x2dcf('0xd'),this['syncRegistry'][_0x2dcf('0xe')](this));ami['on']('registry',this['syncRegistry'][_0x2dcf('0xe')](this));ami['on'](_0x2dcf('0xf'),this['syncDeviceState'][_0x2dcf('0xe')](this));ami['on'](_0x2dcf('0x10'),this[_0x2dcf('0x11')][_0x2dcf('0xe')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x2dcf('0x12')]()['then'](ami[_0x2dcf('0x13')]())[_0x2dcf('0x14')](function(_0x256c37){logger[_0x2dcf('0x15')]('[userReport][sipshowregistry]',util[_0x2dcf('0x16')](_0x256c37,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x2dcf('0x12')]()[_0x2dcf('0x17')](ami['actionDeviceStateList']())[_0x2dcf('0x14')](function(_0x26b2e8){logger[_0x2dcf('0x15')](_0x2dcf('0x18'),util[_0x2dcf('0x16')](_0x26b2e8,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x2dcf('0x12')]()[_0x2dcf('0x17')](ami['actionSipPeerStatus']())[_0x2dcf('0x14')](function(_0x135b8f){logger['error'](_0x2dcf('0x19'),util[_0x2dcf('0x16')](_0x135b8f,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0x2dcf('0x1a')]=function(){setInterval(function(){BPromise['resolve']()[_0x2dcf('0x17')](showSipRegistrations())[_0x2dcf('0x17')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x2dcf('0x1b')][_0x2dcf('0x1c')]=function(_0x3c5e8c){return _0x3c5e8c!==null&&!_[_0x2dcf('0x1d')](_0x3c5e8c);};UserReport[_0x2dcf('0x1b')][_0x2dcf('0x1e')]=function(_0x431aac,_0x2c6415,_0x5d9839){io['to'](_0x431aac)[_0x2dcf('0x1e')](_0x2c6415,_0x5d9839);};UserReport[_0x2dcf('0x1b')][_0x2dcf('0x1f')]=function(_0x5e365d){try{if(this[_0x2dcf('0x1c')](_0x5e365d)){logger[_0x2dcf('0x20')](_0x2dcf('0x21'),_0x5e365d[_0x2dcf('0x22')],_0x5e365d[_0x2dcf('0x23')]);logger[_0x2dcf('0x24')](_0x2dcf('0x25'),util[_0x2dcf('0x16')](_0x5e365d,{'showHidden':![],'depth':null}));var _0x2b1271=_['find'](this[_0x2dcf('0xa')],{'defaultuser':_0x5e365d['username']});if(_0x2b1271){_0x5e365d[_0x2dcf('0x26')]=_0x5e365d['state'];_['merge'](_0x2b1271,_[_0x2dcf('0x27')](_0x5e365d,['event','actionid',_0x2dcf('0x22'),'state']));logger['debug'](_0x2dcf('0x28'),util[_0x2dcf('0x16')](_0x2b1271,{'showHidden':![],'depth':null}));this[_0x2dcf('0x1e')](util[_0x2dcf('0x29')](_0x2dcf('0x2a'),_0x2b1271[_0x2dcf('0x2b')]),_0x2dcf('0x2c'),_0x2b1271);}}}catch(_0x244a57){logger[_0x2dcf('0x15')]('[userReport][registry]',util[_0x2dcf('0x16')](_0x244a57,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x2dcf('0x2d')]=function(_0x4bd3ac){try{if(this['isNotNull'](_0x4bd3ac)){logger[_0x2dcf('0x20')](_0x2dcf('0x2e'),_0x4bd3ac[_0x2dcf('0x2f')],_0x4bd3ac[_0x2dcf('0x23')]);logger[_0x2dcf('0x24')](_0x2dcf('0x30'),util[_0x2dcf('0x16')](_0x4bd3ac,{'showHidden':![],'depth':null}));if(this[_0x2dcf('0xb')][_0x4bd3ac['device']]){if(!this['agents'][_0x4bd3ac[_0x2dcf('0x2f')]][_0x2dcf('0x31')]||_0x4bd3ac['state'][_0x2dcf('0x32')]()==_0x2dcf('0x33')){this[_0x2dcf('0xb')][_0x4bd3ac[_0x2dcf('0x2f')]][_0x2dcf('0x31')]=![];if(this['agents'][_0x4bd3ac[_0x2dcf('0x2f')]]['state']!==_0x4bd3ac[_0x2dcf('0x23')][_0x2dcf('0x32')]()){this[_0x2dcf('0xb')][_0x4bd3ac['device']][_0x2dcf('0x34')]=_['toNumber'](moment()[_0x2dcf('0x29')]('x'));}this[_0x2dcf('0xb')][_0x4bd3ac['device']]['state']=_0x4bd3ac[_0x2dcf('0x23')][_0x2dcf('0x32')]();this[_0x2dcf('0xb')][_0x4bd3ac['device']][_0x2dcf('0x35')](_0x4bd3ac);}}else if(this['telephones'][_0x4bd3ac[_0x2dcf('0x2f')]]){if(this[_0x2dcf('0xc')][_0x4bd3ac['device']][_0x2dcf('0x23')]!==_0x4bd3ac[_0x2dcf('0x23')][_0x2dcf('0x32')]()){this[_0x2dcf('0xc')][_0x4bd3ac['device']][_0x2dcf('0x34')]=_['toNumber'](moment()[_0x2dcf('0x29')]('x'));}this[_0x2dcf('0xc')][_0x4bd3ac['device']]['state']=_0x4bd3ac['state']['toLowerCase']();logger[_0x2dcf('0x24')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util['inspect'](this[_0x2dcf('0xc')][_0x4bd3ac[_0x2dcf('0x2f')]],{'showHidden':![],'depth':null}));this[_0x2dcf('0x1e')](util[_0x2dcf('0x29')](_0x2dcf('0x36'),this[_0x2dcf('0xc')][_0x4bd3ac[_0x2dcf('0x2f')]]['name']),_0x2dcf('0x37'),this[_0x2dcf('0xc')][_0x4bd3ac[_0x2dcf('0x2f')]]);}else if(this[_0x2dcf('0xa')][_0x4bd3ac[_0x2dcf('0x2f')]]){if(this['trunks'][_0x4bd3ac[_0x2dcf('0x2f')]][_0x2dcf('0x23')]!==_0x4bd3ac['state']['toLowerCase']()){this[_0x2dcf('0xa')][_0x4bd3ac[_0x2dcf('0x2f')]][_0x2dcf('0x34')]=_[_0x2dcf('0x38')](moment()[_0x2dcf('0x29')]('x'));}this[_0x2dcf('0xa')][_0x4bd3ac[_0x2dcf('0x2f')]][_0x2dcf('0x23')]=_0x4bd3ac[_0x2dcf('0x23')][_0x2dcf('0x32')]();logger[_0x2dcf('0x24')](_0x2dcf('0x39'),util[_0x2dcf('0x16')](this[_0x2dcf('0xa')][_0x4bd3ac[_0x2dcf('0x2f')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x2dcf('0x29')](_0x2dcf('0x2a'),this[_0x2dcf('0xa')][_0x4bd3ac[_0x2dcf('0x2f')]][_0x2dcf('0x2b')]),_0x2dcf('0x2c'),this[_0x2dcf('0xa')][_0x4bd3ac[_0x2dcf('0x2f')]]);}else if(_[_0x2dcf('0x3a')](_0x4bd3ac[_0x2dcf('0x2f')],_0x2dcf('0x3b'))){var _0x3bc5d3=_0x4bd3ac[_0x2dcf('0x2f')];var _0x437d38=_0x3bc5d3[_0x2dcf('0x3c')](_0x3bc5d3[_0x2dcf('0x3d')]('/')+0x1,_0x3bc5d3['indexOf']('@'));var _0x553c9c=_['find'](this[_0x2dcf('0xb')],function(_0x54fd92){return _0x54fd92['mobile']==_0x437d38||_0x54fd92[_0x2dcf('0x3e')]==_0x437d38||_0x54fd92[_0x2dcf('0x3f')]==_0x437d38;});if(_0x553c9c){if(_0x553c9c[_0x2dcf('0x23')]!==_0x4bd3ac['state'][_0x2dcf('0x32')]()){_0x553c9c[_0x2dcf('0x34')]=_[_0x2dcf('0x38')](moment()['format']('x'));}_0x553c9c[_0x2dcf('0x23')]=_0x4bd3ac[_0x2dcf('0x23')][_0x2dcf('0x32')]();_0x553c9c[_0x2dcf('0x31')]=!![];_0x553c9c[_0x2dcf('0x35')](_0x4bd3ac);}}}}catch(_0x598015){logger[_0x2dcf('0x15')](_0x2dcf('0x30'),util[_0x2dcf('0x16')](_0x598015,{'showHidden':![],'depth':null}));}};UserReport[_0x2dcf('0x1b')][_0x2dcf('0x11')]=function(_0x5b11ce){try{if(this[_0x2dcf('0x1c')](_0x5b11ce)&&this['isNotNull'](_0x5b11ce[_0x2dcf('0x10')])){logger[_0x2dcf('0x20')](_0x2dcf('0x40'),_0x5b11ce['peer'],_0x5b11ce['address'],_0x5b11ce['peerstatus']);logger[_0x2dcf('0x24')]('[userReport][peerstatus]',util[_0x2dcf('0x16')](_0x5b11ce,{'showHidden':![],'depth':null}));if(this[_0x2dcf('0xb')][_0x5b11ce[_0x2dcf('0x41')]]){if(!this[_0x2dcf('0xb')][_0x5b11ce[_0x2dcf('0x41')]][_0x2dcf('0x31')]||_0x5b11ce[_0x2dcf('0x10')][_0x2dcf('0x32')]()=='registered'){this[_0x2dcf('0xb')][_0x5b11ce[_0x2dcf('0x41')]][_0x2dcf('0x31')]=![];this[_0x2dcf('0xb')][_0x5b11ce[_0x2dcf('0x41')]]['status']=_0x5b11ce[_0x2dcf('0x10')][_0x2dcf('0x32')]();this[_0x2dcf('0xb')][_0x5b11ce['peer']][_0x2dcf('0x42')]=_0x5b11ce[_0x2dcf('0x42')];this['agents'][_0x5b11ce[_0x2dcf('0x41')]]['updateStatusRealtime'](_0x5b11ce);}}else if(this[_0x2dcf('0xc')][_0x5b11ce[_0x2dcf('0x41')]]){this[_0x2dcf('0xc')][_0x5b11ce[_0x2dcf('0x41')]][_0x2dcf('0x43')]=_0x5b11ce['peerstatus'][_0x2dcf('0x32')]();this['telephones'][_0x5b11ce['peer']][_0x2dcf('0x42')]=_0x5b11ce[_0x2dcf('0x42')];logger[_0x2dcf('0x24')](_0x2dcf('0x44'),util[_0x2dcf('0x16')](this[_0x2dcf('0xc')][_0x5b11ce['peer']],{'showHidden':![],'depth':null}));this[_0x2dcf('0x1e')](util[_0x2dcf('0x29')](_0x2dcf('0x36'),this[_0x2dcf('0xc')][_0x5b11ce['peer']][_0x2dcf('0x2b')]),_0x2dcf('0x37'),this['telephones'][_0x5b11ce['peer']]);}else if(this['trunks'][_0x5b11ce['peer']]){this[_0x2dcf('0xa')][_0x5b11ce[_0x2dcf('0x41')]][_0x2dcf('0x43')]=_0x5b11ce[_0x2dcf('0x10')][_0x2dcf('0x32')]();this['trunks'][_0x5b11ce['peer']][_0x2dcf('0x42')]=_0x5b11ce['address'];logger[_0x2dcf('0x24')](_0x2dcf('0x45'),util[_0x2dcf('0x16')](this[_0x2dcf('0xa')][_0x5b11ce['peer']],{'showHidden':![],'depth':null}));this['emit'](util[_0x2dcf('0x29')](_0x2dcf('0x2a'),this[_0x2dcf('0xa')][_0x5b11ce['peer']][_0x2dcf('0x2b')]),'trunk:save',this[_0x2dcf('0xa')][_0x5b11ce[_0x2dcf('0x41')]]);}}}catch(_0x9f7f54){logger['error'](_0x2dcf('0x46'),util[_0x2dcf('0x16')](_0x9f7f54,{'showHidden':![],'depth':null}));}};module[_0x2dcf('0x47')]=UserReport; \ No newline at end of file +var _0x0fd5=['telephone:%s','telephone:save','trunk:save','startsWith','substring','indexOf','find','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','resolve','then','actionSipShowRegistry','catch','inspect','actionDeviceStateList','error','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','stateRegistry','merge','omit','event','format','trunk:%s','name','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','toLowerCase','inuse','local','stateTime','updateStatusRealtime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:'];(function(_0x56b878,_0x4be9aa){var _0x32b9ec=function(_0x1511ea){while(--_0x1511ea){_0x56b878['push'](_0x56b878['shift']());}};_0x32b9ec(++_0x4be9aa);}(_0x0fd5,0x1e6));var _0x50fd=function(_0x15eeab,_0x1192ba){_0x15eeab=_0x15eeab-0x0;var _0x58b610=_0x0fd5[_0x15eeab];return _0x58b610;};'use strict';var _=require(_0x50fd('0x0'));var moment=require(_0x50fd('0x1'));var util=require(_0x50fd('0x2'));var Redis=require(_0x50fd('0x3'));var BPromise=require(_0x50fd('0x4'));var config=require(_0x50fd('0x5'));var logger=require(_0x50fd('0x6'))('ami');var ami=require(_0x50fd('0x7'));config[_0x50fd('0x8')]=_[_0x50fd('0x9')](config[_0x50fd('0x8')],{'host':_0x50fd('0xa'),'port':0x18eb});var io=require(_0x50fd('0xb'))(new Redis(config[_0x50fd('0x8')]));function UserReport(_0x496ec1){this[_0x50fd('0xc')]=_0x496ec1[_0x50fd('0xc')];this[_0x50fd('0xd')]=_0x496ec1[_0x50fd('0xd')];this[_0x50fd('0xe')]=_0x496ec1[_0x50fd('0xe')];ami['on'](_0x50fd('0xf'),this[_0x50fd('0x10')]['bind'](this));ami['on']('registry',this[_0x50fd('0x10')][_0x50fd('0x11')](this));ami['on'](_0x50fd('0x12'),this[_0x50fd('0x13')][_0x50fd('0x11')](this));ami['on'](_0x50fd('0x14'),this[_0x50fd('0x15')][_0x50fd('0x11')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x50fd('0x16')]()[_0x50fd('0x17')](ami[_0x50fd('0x18')]())[_0x50fd('0x19')](function(_0x5b7d7b){logger['error']('[userReport][sipshowregistry]',util[_0x50fd('0x1a')](_0x5b7d7b,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x50fd('0x16')]()[_0x50fd('0x17')](ami[_0x50fd('0x1b')]())[_0x50fd('0x19')](function(_0x5b55af){logger[_0x50fd('0x1c')](_0x50fd('0x1d'),util['inspect'](_0x5b55af,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x50fd('0x16')]()[_0x50fd('0x17')](ami[_0x50fd('0x1e')]())['catch'](function(_0x1bab8b){logger['error'](_0x50fd('0x1f'),util[_0x50fd('0x1a')](_0x1bab8b,{'showHidden':![],'depth':null}));});}UserReport[_0x50fd('0x20')][_0x50fd('0x21')]=function(){setInterval(function(){BPromise[_0x50fd('0x16')]()['then'](showSipRegistrations())[_0x50fd('0x17')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x50fd('0x20')][_0x50fd('0x22')]=function(_0x12e166){return _0x12e166!==null&&!_[_0x50fd('0x23')](_0x12e166);};UserReport[_0x50fd('0x20')][_0x50fd('0x24')]=function(_0x8d28de,_0x331298,_0x20f626){io['to'](_0x8d28de)[_0x50fd('0x24')](_0x331298,_0x20f626);};UserReport['prototype'][_0x50fd('0x10')]=function(_0x1726f2){try{if(this[_0x50fd('0x22')](_0x1726f2)){logger['info'](_0x50fd('0x25'),_0x1726f2[_0x50fd('0x26')],_0x1726f2[_0x50fd('0x27')]);logger[_0x50fd('0x28')](_0x50fd('0x29'),util['inspect'](_0x1726f2,{'showHidden':![],'depth':null}));var _0x31f271=_['find'](this[_0x50fd('0xc')],{'defaultuser':_0x1726f2[_0x50fd('0x26')]});if(_0x31f271){_0x1726f2[_0x50fd('0x2a')]=_0x1726f2[_0x50fd('0x27')];_[_0x50fd('0x2b')](_0x31f271,_[_0x50fd('0x2c')](_0x1726f2,[_0x50fd('0x2d'),'actionid','username',_0x50fd('0x27')]));logger['debug']('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x50fd('0x1a')](_0x31f271,{'showHidden':![],'depth':null}));this['emit'](util[_0x50fd('0x2e')](_0x50fd('0x2f'),_0x31f271[_0x50fd('0x30')]),'trunk:save',_0x31f271);}}}catch(_0x2e9a34){logger['error'](_0x50fd('0x29'),util[_0x50fd('0x1a')](_0x2e9a34,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x50fd('0x13')]=function(_0x190f6d){try{if(this[_0x50fd('0x22')](_0x190f6d)){logger[_0x50fd('0x31')](_0x50fd('0x32'),_0x190f6d[_0x50fd('0x33')],_0x190f6d[_0x50fd('0x27')]);logger[_0x50fd('0x28')](_0x50fd('0x34'),util[_0x50fd('0x1a')](_0x190f6d,{'showHidden':![],'depth':null}));if(this[_0x50fd('0xd')][_0x190f6d[_0x50fd('0x33')]]){if(!this[_0x50fd('0xd')][_0x190f6d[_0x50fd('0x33')]]['local']||_0x190f6d[_0x50fd('0x27')][_0x50fd('0x35')]()==_0x50fd('0x36')){this[_0x50fd('0xd')][_0x190f6d[_0x50fd('0x33')]][_0x50fd('0x37')]=![];if(this[_0x50fd('0xd')][_0x190f6d['device']][_0x50fd('0x27')]!==_0x190f6d[_0x50fd('0x27')]['toLowerCase']()){this[_0x50fd('0xd')][_0x190f6d[_0x50fd('0x33')]][_0x50fd('0x38')]=_['toNumber'](moment()['format']('x'));}this[_0x50fd('0xd')][_0x190f6d['device']][_0x50fd('0x27')]=_0x190f6d[_0x50fd('0x27')][_0x50fd('0x35')]();this['agents'][_0x190f6d[_0x50fd('0x33')]][_0x50fd('0x39')](_0x190f6d);}}else if(this[_0x50fd('0xe')][_0x190f6d['device']]){if(this[_0x50fd('0xe')][_0x190f6d['device']][_0x50fd('0x27')]!==_0x190f6d[_0x50fd('0x27')][_0x50fd('0x35')]()){this['telephones'][_0x190f6d['device']][_0x50fd('0x38')]=_[_0x50fd('0x3a')](moment()['format']('x'));}this[_0x50fd('0xe')][_0x190f6d[_0x50fd('0x33')]]['state']=_0x190f6d[_0x50fd('0x27')][_0x50fd('0x35')]();logger['debug'](_0x50fd('0x3b'),util[_0x50fd('0x1a')](this[_0x50fd('0xe')][_0x190f6d[_0x50fd('0x33')]],{'showHidden':![],'depth':null}));this[_0x50fd('0x24')](util[_0x50fd('0x2e')](_0x50fd('0x3c'),this['telephones'][_0x190f6d[_0x50fd('0x33')]][_0x50fd('0x30')]),_0x50fd('0x3d'),this['telephones'][_0x190f6d[_0x50fd('0x33')]]);}else if(this[_0x50fd('0xc')][_0x190f6d[_0x50fd('0x33')]]){if(this[_0x50fd('0xc')][_0x190f6d[_0x50fd('0x33')]][_0x50fd('0x27')]!==_0x190f6d[_0x50fd('0x27')][_0x50fd('0x35')]()){this['trunks'][_0x190f6d[_0x50fd('0x33')]][_0x50fd('0x38')]=_[_0x50fd('0x3a')](moment()[_0x50fd('0x2e')]('x'));}this[_0x50fd('0xc')][_0x190f6d[_0x50fd('0x33')]][_0x50fd('0x27')]=_0x190f6d[_0x50fd('0x27')][_0x50fd('0x35')]();logger[_0x50fd('0x28')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0x50fd('0x1a')](this[_0x50fd('0xc')][_0x190f6d[_0x50fd('0x33')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x50fd('0x2f'),this['trunks'][_0x190f6d[_0x50fd('0x33')]][_0x50fd('0x30')]),_0x50fd('0x3e'),this['trunks'][_0x190f6d[_0x50fd('0x33')]]);}else if(_[_0x50fd('0x3f')](_0x190f6d[_0x50fd('0x33')],'Local')){var _0x57606a=_0x190f6d['device'];var _0x57ddb9=_0x57606a[_0x50fd('0x40')](_0x57606a[_0x50fd('0x41')]('/')+0x1,_0x57606a[_0x50fd('0x41')]('@'));var _0x3c3399=_[_0x50fd('0x42')](this[_0x50fd('0xd')],function(_0x1ca821){return _0x1ca821[_0x50fd('0x43')]==_0x57ddb9||_0x1ca821[_0x50fd('0x44')]==_0x57ddb9||_0x1ca821[_0x50fd('0x45')]==_0x57ddb9;});if(_0x3c3399){if(_0x3c3399[_0x50fd('0x27')]!==_0x190f6d[_0x50fd('0x27')][_0x50fd('0x35')]()){_0x3c3399['stateTime']=_[_0x50fd('0x3a')](moment()[_0x50fd('0x2e')]('x'));}_0x3c3399[_0x50fd('0x27')]=_0x190f6d[_0x50fd('0x27')]['toLowerCase']();_0x3c3399[_0x50fd('0x37')]=!![];_0x3c3399['updateStatusRealtime'](_0x190f6d);}}}}catch(_0x219960){logger['error']('[userReport][devicestatechange]',util[_0x50fd('0x1a')](_0x219960,{'showHidden':![],'depth':null}));}};UserReport[_0x50fd('0x20')][_0x50fd('0x15')]=function(_0x43145b){try{if(this[_0x50fd('0x22')](_0x43145b)&&this[_0x50fd('0x22')](_0x43145b['peerstatus'])){logger[_0x50fd('0x31')](_0x50fd('0x46'),_0x43145b[_0x50fd('0x47')],_0x43145b[_0x50fd('0x48')],_0x43145b[_0x50fd('0x14')]);logger['debug'](_0x50fd('0x49'),util[_0x50fd('0x1a')](_0x43145b,{'showHidden':![],'depth':null}));if(this[_0x50fd('0xd')][_0x43145b[_0x50fd('0x47')]]){if(!this[_0x50fd('0xd')][_0x43145b[_0x50fd('0x47')]][_0x50fd('0x37')]||_0x43145b[_0x50fd('0x14')]['toLowerCase']()=='registered'){this[_0x50fd('0xd')][_0x43145b[_0x50fd('0x47')]]['local']=![];this['agents'][_0x43145b['peer']][_0x50fd('0x4a')]=_0x43145b[_0x50fd('0x14')][_0x50fd('0x35')]();this[_0x50fd('0xd')][_0x43145b['peer']]['address']=_0x43145b[_0x50fd('0x48')];this['agents'][_0x43145b['peer']][_0x50fd('0x39')](_0x43145b);}}else if(this['telephones'][_0x43145b[_0x50fd('0x47')]]){this['telephones'][_0x43145b[_0x50fd('0x47')]][_0x50fd('0x4a')]=_0x43145b[_0x50fd('0x14')][_0x50fd('0x35')]();this[_0x50fd('0xe')][_0x43145b['peer']][_0x50fd('0x48')]=_0x43145b[_0x50fd('0x48')];logger['debug'](_0x50fd('0x4b'),util[_0x50fd('0x1a')](this[_0x50fd('0xe')][_0x43145b[_0x50fd('0x47')]],{'showHidden':![],'depth':null}));this[_0x50fd('0x24')](util[_0x50fd('0x2e')](_0x50fd('0x3c'),this[_0x50fd('0xe')][_0x43145b[_0x50fd('0x47')]][_0x50fd('0x30')]),_0x50fd('0x3d'),this[_0x50fd('0xe')][_0x43145b[_0x50fd('0x47')]]);}else if(this[_0x50fd('0xc')][_0x43145b[_0x50fd('0x47')]]){this['trunks'][_0x43145b[_0x50fd('0x47')]][_0x50fd('0x4a')]=_0x43145b[_0x50fd('0x14')][_0x50fd('0x35')]();this[_0x50fd('0xc')][_0x43145b['peer']][_0x50fd('0x48')]=_0x43145b[_0x50fd('0x48')];logger[_0x50fd('0x28')](_0x50fd('0x4c'),util[_0x50fd('0x1a')](this['trunks'][_0x43145b[_0x50fd('0x47')]],{'showHidden':![],'depth':null}));this[_0x50fd('0x24')](util['format']('trunk:%s',this[_0x50fd('0xc')][_0x43145b[_0x50fd('0x47')]][_0x50fd('0x30')]),_0x50fd('0x3e'),this[_0x50fd('0xc')][_0x43145b[_0x50fd('0x47')]]);}}}catch(_0x360620){logger['error'](_0x50fd('0x49'),util['inspect'](_0x360620,{'showHidden':![],'depth':null}));}};module[_0x50fd('0x4d')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 915d1d3..df679e6 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5144=['syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','isNil','includes','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','agents','variables','agentcalled','bind','agentconnect','syncAgentConnect','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncVarSet','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','destuniqueid','voiceQueues','format','called','mandatoryDisposition','type','inbound','voice','omit','event','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','queue','user:%s','membername','user:called','error','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','info','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','routealias','merge','interface','pick','destconnectedlinenum','name','accountcode','exten','user:agentconnect','agentringnoanswer','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','reason','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','assign','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][queuecallerabandon]'];(function(_0x1f4f0b,_0xc6db05){var _0x1be5c2=function(_0xc1a719){while(--_0xc1a719){_0x1f4f0b['push'](_0x1f4f0b['shift']());}};_0x1be5c2(++_0xc6db05);}(_0x5144,0x170));var _0x4514=function(_0x43b1bc,_0x4d8456){_0x43b1bc=_0x43b1bc-0x0;var _0x5fb40e=_0x5144[_0x43b1bc];return _0x5fb40e;};'use strict';var _=require(_0x4514('0x0'));var moment=require(_0x4514('0x1'));var util=require(_0x4514('0x2'));var Redis=require(_0x4514('0x3'));var config=require(_0x4514('0x4'));var logger=require(_0x4514('0x5'))('ami');var ami=require('../ami');config[_0x4514('0x6')]=_[_0x4514('0x7')](config['redis'],{'host':_0x4514('0x8'),'port':0x18eb});var io=require(_0x4514('0x9'))(new Redis(config[_0x4514('0x6')]));function VoiceAgentReport(_0x518d9e){this[_0x4514('0xa')]={};this[_0x4514('0xb')]=_0x518d9e[_0x4514('0xa')];this['voiceQueues']=_0x518d9e['voiceQueues'];this[_0x4514('0xc')]=_0x518d9e[_0x4514('0xc')];this[_0x4514('0xd')]={};ami['on'](_0x4514('0xe'),this['syncAgentCalled'][_0x4514('0xf')](this));ami['on'](_0x4514('0x10'),this[_0x4514('0x11')]['bind'](this));ami['on']('agentringnoanswer',this[_0x4514('0x12')][_0x4514('0xf')](this));ami['on'](_0x4514('0x13'),this[_0x4514('0x14')][_0x4514('0xf')](this));ami['on'](_0x4514('0x15'),this['syncAgentComplete']['bind'](this));ami['on']('varset',this[_0x4514('0x16')]['bind'](this));ami['on']('hangup',this[_0x4514('0x17')][_0x4514('0xf')](this));ami['on'](_0x4514('0x18'),this[_0x4514('0x19')]['bind'](this));ami['on'](_0x4514('0x1a'),this[_0x4514('0x1b')]['bind'](this));ami['on']('attendedtransfer',this[_0x4514('0x1c')]['bind'](this));ami['on'](_0x4514('0x1d'),this[_0x4514('0x1e')][_0x4514('0xf')](this));}VoiceAgentReport[_0x4514('0x1f')][_0x4514('0x20')]=function(_0x5a40b5,_0x2bcadb,_0x1f3b6a){io['to'](_0x5a40b5)[_0x4514('0x20')](_0x2bcadb,_0x1f3b6a);};VoiceAgentReport['prototype'][_0x4514('0x21')]=function(_0x2ee80f){return _0x2ee80f!==null&&!_[_0x4514('0x22')](_0x2ee80f);};VoiceAgentReport['prototype'][_0x4514('0x23')]=function(_0x330dac){try{if(this[_0x4514('0x21')](_0x330dac)){logger['info'](_0x4514('0x24'),_0x330dac[_0x4514('0x25')],_0x330dac['membername'],_0x330dac['destuniqueid']);logger['debug'](_0x4514('0x26'),_0x330dac[_0x4514('0x25')],util[_0x4514('0x27')](_0x330dac,{'showHidden':![],'depth':null}));if(_[_0x4514('0x22')](this[_0x4514('0xa')][_0x330dac[_0x4514('0x25')]])){this['channels'][_0x330dac[_0x4514('0x25')]]={};}var _0x4e3fb6=this[_0x4514('0xc')][_0x330dac['interface']];var _0xb48020=this[_0x4514('0xa')][_0x330dac[_0x4514('0x25')]][_0x330dac[_0x4514('0x28')]];var _0x24a16e=this[_0x4514('0x29')][_0x330dac['queue']];var _0x2fc711=this[_0x4514('0xd')][_0x330dac[_0x4514('0x25')]];if(_[_0x4514('0x22')](_0xb48020)){_0xb48020={'agentcalledAt':moment()[_0x4514('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x4514('0x2b'),'mandatoryDisposition':_0x24a16e&&_0x24a16e['mandatoryDisposition']?_0x24a16e[_0x4514('0x2c')]:![],'type':_0x24a16e&&_0x24a16e['type']?_0x24a16e[_0x4514('0x2d')]:_0x4514('0x2e'),'variables':_0x2fc711,'motionChannel':_0x4514('0x2f')};}Object['assign'](_0xb48020,_[_0x4514('0x30')](_0x330dac,[_0x4514('0x31'),'privilege']));this[_0x4514('0xa')][_0x330dac[_0x4514('0x25')]][_0x330dac[_0x4514('0x28')]]=_0xb48020;logger[_0x4514('0x32')](_0x4514('0x33'),_0x330dac[_0x4514('0x25')],util[_0x4514('0x27')](_0xb48020,{'showHidden':![],'depth':null}));ami[_0x4514('0x20')](_0x4514('0x34'),_0xb48020);var _0x7335dd={'id':_0x4e3fb6['id'],'calleridnum':_0xb48020[_0x4514('0x35')],'queue':_0xb48020[_0x4514('0x36')],'variables':_0xb48020['variables'],'uniqueid':_0x330dac[_0x4514('0x25')]};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x330dac[_0x4514('0x25')],util['inspect'](_0x7335dd,{'showHidden':![],'depth':null}));this[_0x4514('0x20')](util['format'](_0x4514('0x37'),_0x330dac[_0x4514('0x38')]),_0x4514('0x39'),_0x7335dd);}}catch(_0x4f18f1){logger[_0x4514('0x3a')](_0x4514('0x3b'),_0x330dac['uniqueid'],util[_0x4514('0x27')](_0x4f18f1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4514('0x1f')][_0x4514('0x11')]=function(_0xb57246){try{if(this[_0x4514('0x21')](_0xb57246)){if(this[_0x4514('0xa')][_0xb57246[_0x4514('0x25')]]){for(var _0x2fcc3d in this['channels'][_0xb57246['uniqueid']]){if(this[_0x4514('0xa')][_0xb57246[_0x4514('0x25')]][_0x4514('0x3c')](_0x2fcc3d)){if(_0xb57246['destuniqueid']===_0x2fcc3d){logger[_0x4514('0x3d')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0xb57246[_0x4514('0x25')],_0xb57246['membername'],_0xb57246[_0x4514('0x28')]);this['channels'][_0xb57246['uniqueid']][_0x2fcc3d][_0x4514('0x3e')]=moment()[_0x4514('0x2a')](_0x4514('0x3f'));this['channels'][_0xb57246[_0x4514('0x25')]][_0x2fcc3d][_0x4514('0x40')]=_0xb57246[_0x4514('0x40')];this[_0x4514('0xa')][_0xb57246[_0x4514('0x25')]][_0x2fcc3d][_0x4514('0x41')]=_0xb57246[_0x4514('0x41')];this[_0x4514('0xa')][_0xb57246[_0x4514('0x25')]][_0x2fcc3d]['destchannelstate']=_0xb57246[_0x4514('0x42')];this[_0x4514('0xa')][_0xb57246['uniqueid']][_0x2fcc3d][_0x4514('0x43')]=_0xb57246[_0x4514('0x43')];this['channels'][_0xb57246['uniqueid']][_0x2fcc3d][_0x4514('0x44')]=_0xb57246[_0x4514('0x44')];this[_0x4514('0xa')][_0xb57246[_0x4514('0x25')]][_0x2fcc3d]['lastevent']=_0x4514('0x45');if(this['voiceChannels'][this[_0x4514('0xa')][_0xb57246['uniqueid']][_0x2fcc3d][_0x4514('0x25')]]){var _0x3af9a1=this[_0x4514('0xb')][this[_0x4514('0xa')][_0xb57246['uniqueid']][_0x2fcc3d][_0x4514('0x25')]][_0x4514('0x46')];this[_0x4514('0xa')][_0xb57246['uniqueid']][_0x2fcc3d][_0x4514('0x46')]=_0x3af9a1;_0xb57246['routealias']=_0x3af9a1;}_[_0x4514('0x47')](this[_0x4514('0xc')][_0xb57246[_0x4514('0x48')]],_[_0x4514('0x49')](_0xb57246,[_0x4514('0x36'),_0x4514('0x4a'),_0x4514('0x46')]));var _0x9cad07=this[_0x4514('0xc')][_0xb57246['interface']];var _0x1db828={'id':_0x9cad07['id'],'name':_0x9cad07[_0x4514('0x4b')],'agentconnected':!![],'destaccountcode':_0x9cad07[_0x4514('0x4c')],'destconnectedlinenum':this[_0x4514('0xa')][_0xb57246[_0x4514('0x25')]][_0xb57246['destuniqueid']][_0x4514('0x4d')],'queue':this['channels'][_0xb57246[_0x4514('0x25')]][_0xb57246[_0x4514('0x28')]][_0x4514('0x36')],'routealias':this['channels'][_0xb57246['uniqueid']][_0xb57246[_0x4514('0x28')]][_0x4514('0x46')],'uniqueid':this[_0x4514('0xa')][_0xb57246[_0x4514('0x25')]][_0xb57246[_0x4514('0x28')]][_0x4514('0x25')]};ami[_0x4514('0x20')]('custom:agentconnect',this[_0x4514('0xa')][_0xb57246[_0x4514('0x25')]][_0xb57246[_0x4514('0x28')]]);this[_0x4514('0x20')](util['format'](_0x4514('0x37'),_0xb57246[_0x4514('0x38')]),_0x4514('0x4e'),_0x1db828);}else if(!this[_0x4514('0xa')][_0xb57246[_0x4514('0x25')]][_0x2fcc3d][_0x4514('0x4f')]&&!this[_0x4514('0xa')][_0xb57246[_0x4514('0x25')]][_0x2fcc3d][_0x4514('0x15')]){logger['info'](_0x4514('0x50'),_0xb57246[_0x4514('0x25')],this[_0x4514('0xa')][_0xb57246['uniqueid']][_0x2fcc3d][_0x4514('0x38')],_0x2fcc3d);this[_0x4514('0xa')][_0xb57246[_0x4514('0x25')]][_0x2fcc3d][_0x4514('0x4f')]=!![];this[_0x4514('0xa')][_0xb57246[_0x4514('0x25')]][_0x2fcc3d][_0x4514('0x51')]=moment()[_0x4514('0x2a')](_0x4514('0x3f'));this[_0x4514('0xa')][_0xb57246[_0x4514('0x25')]][_0x2fcc3d][_0x4514('0x52')]=_0xb57246[_0x4514('0x28')];this[_0x4514('0xa')][_0xb57246['uniqueid']][_0x2fcc3d][_0x4514('0x53')]=_0xb57246[_0x4514('0x38')];this[_0x4514('0xa')][_0xb57246[_0x4514('0x25')]][_0x2fcc3d][_0x4514('0x54')]='answered_elsewhere';this[_0x4514('0xa')][_0xb57246[_0x4514('0x25')]][_0x2fcc3d][_0x4514('0x55')]=_0x4514('0x56');logger['debug'](_0x4514('0x57'),_0xb57246[_0x4514('0x25')],util[_0x4514('0x27')](this[_0x4514('0xa')][_0xb57246['uniqueid']][_0x2fcc3d],{'showHidden':![],'depth':null}));ami[_0x4514('0x20')](_0x4514('0x58'),this[_0x4514('0xa')][_0xb57246[_0x4514('0x25')]][_0x2fcc3d]);}else{logger['debug']('[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken',_0xb57246[_0x4514('0x25')]);}}}}}}catch(_0x586df2){logger[_0x4514('0x3a')]('[%s][voiceAgentReport][agentconnect]',_0xb57246[_0x4514('0x25')],util['inspect'](_0x586df2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4514('0x1f')][_0x4514('0x12')]=function(_0x4a0fe){try{if(this[_0x4514('0x21')](_0x4a0fe)){logger[_0x4514('0x32')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x4a0fe[_0x4514('0x25')],util[_0x4514('0x27')](_0x4a0fe,{'showHidden':![],'depth':null}));if(this[_0x4514('0xa')][_0x4a0fe[_0x4514('0x25')]]&&this[_0x4514('0xa')][_0x4a0fe['uniqueid']][_0x4a0fe[_0x4514('0x28')]]){logger[_0x4514('0x3d')](_0x4514('0x59'),_0x4a0fe[_0x4514('0x25')],_0x4a0fe[_0x4514('0x38')],_0x4a0fe['destuniqueid']);var _0x2b7f82=this[_0x4514('0xc')][_0x4a0fe[_0x4514('0x48')]];var _0x42c27d=this[_0x4514('0xa')][_0x4a0fe['uniqueid']][_0x4a0fe[_0x4514('0x28')]];_0x42c27d[_0x4514('0x4f')]=!![];_0x42c27d[_0x4514('0x51')]=moment()[_0x4514('0x2a')](_0x4514('0x3f'));_0x42c27d[_0x4514('0x54')]=_0x4514('0x5a');_0x42c27d['reason']='rejected';var _0x5e4cc0={'id':_0x2b7f82['id'],'name':_0x2b7f82[_0x4514('0x4b')],'queue':_0x42c27d[_0x4514('0x36')],'uniqueid':_0x42c27d[_0x4514('0x25')]};logger['debug'](_0x4514('0x5b'),_0x4a0fe[_0x4514('0x25')],util['inspect'](_0x5e4cc0,{'showHidden':![],'depth':null}));this[_0x4514('0x20')](util[_0x4514('0x2a')]('user:%s',_0x2b7f82[_0x4514('0x4b')]),'user:agentringnoanswer',_0x5e4cc0);ami[_0x4514('0x20')](_0x4514('0x5c'),_0x42c27d);this[_0x4514('0xa')][_0x4a0fe[_0x4514('0x25')]][_0x4a0fe[_0x4514('0x28')]]=Object[_0x4514('0x5d')]({},_0x42c27d);}}}catch(_0x1cc849){logger[_0x4514('0x3a')](_0x4514('0x5e'),_0x4a0fe[_0x4514('0x25')],util['inspect'](_0x1cc849,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4514('0x1f')][_0x4514('0x14')]=function(_0x35d4d7){try{if(this[_0x4514('0x21')](_0x35d4d7)){logger[_0x4514('0x32')](_0x4514('0x5f'),_0x35d4d7[_0x4514('0x25')],util[_0x4514('0x27')](_0x35d4d7,{'showHidden':![],'depth':null}));if(this[_0x4514('0xa')][_0x35d4d7[_0x4514('0x25')]]){for(var _0x19bfcb in this[_0x4514('0xa')][_0x35d4d7[_0x4514('0x25')]]){if(this[_0x4514('0xa')][_0x35d4d7['uniqueid']]['hasOwnProperty'](_0x19bfcb)&&!this['channels'][_0x35d4d7[_0x4514('0x25')]][_0x19bfcb][_0x4514('0x4f')]&&!this['channels'][_0x35d4d7[_0x4514('0x25')]][_0x19bfcb][_0x4514('0x15')]){logger[_0x4514('0x3d')](_0x4514('0x60'),_0x35d4d7[_0x4514('0x25')],this[_0x4514('0xa')][_0x35d4d7[_0x4514('0x25')]][_0x19bfcb][_0x4514('0x38')],_0x19bfcb);this[_0x4514('0xa')][_0x35d4d7['uniqueid']][_0x19bfcb]['agentringnoanswer']=!![];this['channels'][_0x35d4d7[_0x4514('0x25')]][_0x19bfcb][_0x4514('0x51')]=moment()['format'](_0x4514('0x3f'));this[_0x4514('0xa')][_0x35d4d7['uniqueid']][_0x19bfcb][_0x4514('0x54')]=_0x4514('0x61');this[_0x4514('0xa')][_0x35d4d7[_0x4514('0x25')]][_0x19bfcb][_0x4514('0x55')]=_0x4514('0x61');logger[_0x4514('0x32')](_0x4514('0x62'),_0x35d4d7[_0x4514('0x25')],util[_0x4514('0x27')](this['channels'][_0x35d4d7[_0x4514('0x25')]][_0x19bfcb],{'showHidden':![],'depth':null}));ami[_0x4514('0x20')]('custom:agentqueuecallerabandon',this['channels'][_0x35d4d7[_0x4514('0x25')]][_0x19bfcb]);}}}}}catch(_0x28dfa1){logger[_0x4514('0x3a')](_0x4514('0x63'),_0x35d4d7[_0x4514('0x25')],util['inspect'](_0x28dfa1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4514('0x1f')][_0x4514('0x64')]=function(_0x4d7c0a){try{if(this['isNotNull'](_0x4d7c0a)){logger[_0x4514('0x32')](_0x4514('0x65'),_0x4d7c0a[_0x4514('0x25')],util[_0x4514('0x27')](_0x4d7c0a,{'showHidden':![],'depth':null}));if(this[_0x4514('0xa')][_0x4d7c0a[_0x4514('0x25')]]){for(var _0x36f1ca in this[_0x4514('0xa')][_0x4d7c0a[_0x4514('0x25')]]){if(this[_0x4514('0xa')][_0x4d7c0a[_0x4514('0x25')]][_0x4514('0x3c')](_0x36f1ca)){if(this[_0x4514('0xa')][_0x4d7c0a['uniqueid']][_0x36f1ca][_0x4514('0x3e')]&&!this[_0x4514('0xa')][_0x4d7c0a['uniqueid']][_0x36f1ca][_0x4514('0x15')]){logger[_0x4514('0x3d')](_0x4514('0x66'),_0x4d7c0a[_0x4514('0x25')],this[_0x4514('0xa')][_0x4d7c0a['uniqueid']][_0x36f1ca][_0x4514('0x38')],_0x36f1ca);this[_0x4514('0xa')][_0x4d7c0a[_0x4514('0x25')]][_0x36f1ca][_0x4514('0x15')]=!![];this[_0x4514('0xa')][_0x4d7c0a['uniqueid']][_0x36f1ca][_0x4514('0x67')]=moment()['format'](_0x4514('0x3f'));this[_0x4514('0xa')][_0x4d7c0a[_0x4514('0x25')]][_0x36f1ca][_0x4514('0x54')]=_0x4514('0x68');this[_0x4514('0xa')][_0x4d7c0a[_0x4514('0x25')]][_0x36f1ca]['reason']=_0x4d7c0a[_0x4514('0x55')]==_0x4514('0x69')?_0x4514('0x6a'):_0x4d7c0a[_0x4514('0x55')];this[_0x4514('0xa')][_0x4d7c0a[_0x4514('0x25')]][_0x36f1ca][_0x4514('0x6b')]=_0x4d7c0a[_0x4514('0x6b')];if(this[_0x4514('0x29')][_0x4d7c0a['queue']]&&this[_0x4514('0x29')][_0x4d7c0a[_0x4514('0x36')]][_0x4514('0x6c')]){this[_0x4514('0xa')][_0x4d7c0a[_0x4514('0x25')]][_0x36f1ca][_0x4514('0x6d')]=this['voiceQueues'][_0x4d7c0a[_0x4514('0x36')]][_0x4514('0x6e')];this[_0x4514('0xa')][_0x4d7c0a[_0x4514('0x25')]][_0x36f1ca][_0x4514('0x6f')]=!![];}this[_0x4514('0xc')][_0x4d7c0a[_0x4514('0x48')]]=_['omit'](this[_0x4514('0xc')][_0x4d7c0a['interface']],[_0x4514('0x36'),_0x4514('0x4a')]);logger[_0x4514('0x32')](_0x4514('0x70'),_0x4d7c0a[_0x4514('0x25')],util['inspect'](this[_0x4514('0xa')][_0x4d7c0a['uniqueid']][_0x36f1ca],{'showHidden':![],'depth':null}));ami['emit'](_0x4514('0x71'),this[_0x4514('0xa')][_0x4d7c0a[_0x4514('0x25')]][_0x36f1ca]);logger['debug'](_0x4514('0x72'),_0x4d7c0a[_0x4514('0x25')],util[_0x4514('0x27')]({'id':this[_0x4514('0xc')][_0x4d7c0a['interface']]['id'],'destaccountcode':_0x4d7c0a[_0x4514('0x73')]},{'showHidden':![],'depth':null}));this[_0x4514('0x20')](util[_0x4514('0x2a')]('user:%s',_0x4d7c0a['membername']),_0x4514('0x74'),{'id':this[_0x4514('0xc')][_0x4d7c0a['interface']]['id'],'destaccountcode':Number(_0x4d7c0a[_0x4514('0x73')])});}}}}}}catch(_0x2b8d90){logger[_0x4514('0x3a')](_0x4514('0x75'),_0x4d7c0a[_0x4514('0x25')],util[_0x4514('0x27')](_0x2b8d90,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4514('0x1f')][_0x4514('0x16')]=function(_0x3e0aa6){try{if(this[_0x4514('0x21')](_0x3e0aa6)){logger['debug'](_0x4514('0x76'),_0x3e0aa6['uniqueid'],util[_0x4514('0x27')](_0x3e0aa6,{'showHidden':![],'depth':null}));this[_0x4514('0x77')](_0x3e0aa6[_0x4514('0x25')],_[_0x4514('0x78')](_0x3e0aa6[_0x4514('0x79')])[0x0],_0x3e0aa6[_0x4514('0x7a')]);if(this[_0x4514('0xa')][_0x3e0aa6[_0x4514('0x25')]]){for(var _0x2e0881 in this[_0x4514('0xa')][_0x3e0aa6['uniqueid']]){if(this[_0x4514('0xa')][_0x3e0aa6['uniqueid']][_0x4514('0x3c')](_0x2e0881)){logger['info'](_0x4514('0x7b'),_0x3e0aa6[_0x4514('0x25')],_0x2e0881,_[_0x4514('0x78')](_0x3e0aa6[_0x4514('0x79')])[0x0],_0x3e0aa6[_0x4514('0x7a')]);if(_[_0x4514('0x22')](this[_0x4514('0xa')][_0x3e0aa6['uniqueid']][_0x2e0881][_0x4514('0xd')])){this['channels'][_0x3e0aa6['uniqueid']][_0x2e0881]['variables']={};}this[_0x4514('0xa')][_0x3e0aa6[_0x4514('0x25')]][_0x2e0881][_0x4514('0xd')]=this[_0x4514('0xd')][_0x3e0aa6[_0x4514('0x25')]];}}}}}catch(_0x3060ec){logger['error']('[%s][voiceAgentReport][varset]',_0x3e0aa6[_0x4514('0x25')],util[_0x4514('0x27')](_0x3060ec,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4514('0x1f')][_0x4514('0x77')]=function(_0x1ccaca,_0x414215,_0x150aec){var _0x50eab7=[_0x4514('0x7c'),'rtpaudioqosbridged',_0x4514('0x7d'),'rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged',_0x4514('0x7e'),_0x4514('0x7f'),_0x4514('0x80'),_0x4514('0x81'),_0x4514('0x82'),_0x4514('0x83'),_0x4514('0x84'),_0x4514('0x85'),_0x4514('0x86'),'memberlastcall',_0x4514('0x38'),_0x4514('0x87'),'memberrealtime'];if(!_[_0x4514('0x88')](_0x414215)&&!_[_0x4514('0x89')](_0x50eab7,_0x414215)){if(_[_0x4514('0x22')](this[_0x4514('0xd')][_0x1ccaca])){this['variables'][_0x1ccaca]={};}this[_0x4514('0xd')][_0x1ccaca][_0x414215]=_0x150aec;}};VoiceAgentReport[_0x4514('0x1f')]['syncHangup']=function(_0x106384){try{if(this[_0x4514('0x21')](_0x106384)){logger[_0x4514('0x32')]('[%s][voiceAgentReport][hangup]\x20event:',_0x106384[_0x4514('0x25')],util[_0x4514('0x27')](_0x106384,{'showHidden':![],'depth':null}));if(this['channels'][_0x106384['uniqueid']]){for(var _0x3e578e in this[_0x4514('0xa')][_0x106384[_0x4514('0x25')]]){if(this[_0x4514('0xa')][_0x106384[_0x4514('0x25')]][_0x4514('0x3c')](_0x3e578e)){if(this[_0x4514('0xa')][_0x106384[_0x4514('0x25')]][_0x3e578e][_0x4514('0x55')]==_0x4514('0x69')&&this[_0x4514('0xa')][_0x106384['uniqueid']][_0x3e578e][_0x4514('0x15')]){logger[_0x4514('0x3d')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x106384['uniqueid'],_0x3e578e);this['channels'][_0x106384['uniqueid']][_0x3e578e]['agentcompleteAt']=moment()[_0x4514('0x2a')](_0x4514('0x3f'));}}}logger[_0x4514('0x32')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x106384[_0x4514('0x25')],util[_0x4514('0x27')](_[_0x4514('0x8a')](this[_0x4514('0xa')][_0x106384['uniqueid']]),{'showHidden':![],'depth':null}));ami['emit'](_0x4514('0x8b'),_[_0x4514('0x8a')](this['channels'][_0x106384[_0x4514('0x25')]]));delete this['channels'][_0x106384[_0x4514('0x25')]];}if(this[_0x4514('0xd')][_0x106384[_0x4514('0x25')]]){delete this[_0x4514('0xd')][_0x106384[_0x4514('0x25')]];}}}catch(_0x4022f6){logger[_0x4514('0x3a')](_0x4514('0x8c'),_0x106384[_0x4514('0x25')],util['inspect'](_0x4022f6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4514('0x1f')][_0x4514('0x1c')]=function(_0x3505b5){try{if(this['isNotNull'](_0x3505b5)){logger[_0x4514('0x32')](_0x4514('0x8d'),_0x3505b5[_0x4514('0x25')],util['inspect'](_0x3505b5,{'showHidden':![],'depth':null}));if(this[_0x4514('0xa')][_0x3505b5[_0x4514('0x8e')]]){for(var _0x37cd60 in this['channels'][_0x3505b5['transfereeuniqueid']]){if(this[_0x4514('0xa')][_0x3505b5[_0x4514('0x8e')]][_0x4514('0x3c')](_0x37cd60)){if(_0x3505b5[_0x4514('0x8f')]===_0x37cd60){logger[_0x4514('0x3d')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3505b5[_0x4514('0x25')],this[_0x4514('0xa')][_0x3505b5[_0x4514('0x8e')]][_0x37cd60]['membername'],_0x37cd60);var _0x3fe979=moment();this[_0x4514('0xa')][_0x3505b5[_0x4514('0x8e')]][_0x37cd60]['agentcomplete']=!![];this[_0x4514('0xa')][_0x3505b5[_0x4514('0x8e')]][_0x37cd60][_0x4514('0x67')]=moment()[_0x4514('0x2a')](_0x4514('0x3f'));this[_0x4514('0xa')][_0x3505b5[_0x4514('0x8e')]][_0x37cd60][_0x4514('0x54')]=_0x4514('0x68');this[_0x4514('0xa')][_0x3505b5[_0x4514('0x8e')]][_0x37cd60][_0x4514('0x55')]=_0x4514('0x69');this[_0x4514('0xa')][_0x3505b5['transfereeuniqueid']][_0x37cd60]['talktime']=_0x3fe979['diff'](this['channels'][_0x3505b5[_0x4514('0x8e')]][_0x37cd60][_0x4514('0x3e')],_0x4514('0x90'));}}}}if(this[_0x4514('0xa')][_0x3505b5['secondtransfereruniqueid']]){var _0x3298f5=this[_0x4514('0xa')][_0x3505b5[_0x4514('0x91')]];this[_0x4514('0xa')][_0x3505b5['secondtransfereruniqueid']]=this[_0x4514('0xa')][_0x3505b5[_0x4514('0x8e')]];this['channels'][_0x3505b5[_0x4514('0x8e')]]=_0x3298f5;}}}catch(_0x533765){logger['error'](_0x4514('0x92'),_0x3505b5[_0x4514('0x25')],util[_0x4514('0x27')](_0x533765,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4514('0x1f')][_0x4514('0x1e')]=function(_0x3f7604){try{if(this[_0x4514('0x21')](_0x3f7604)){logger[_0x4514('0x32')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x3f7604[_0x4514('0x25')],util[_0x4514('0x27')](_0x3f7604,{'showHidden':![],'depth':null}));if(this['channels'][_0x3f7604['transfereeuniqueid']]){for(var _0x56866a in this[_0x4514('0xa')][_0x3f7604[_0x4514('0x8e')]]){if(this['channels'][_0x3f7604['transfereeuniqueid']][_0x4514('0x3c')](_0x56866a)){if(_0x3f7604['transfereruniqueid']===_0x56866a){logger[_0x4514('0x3d')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3f7604[_0x4514('0x25')],this[_0x4514('0xa')][_0x3f7604[_0x4514('0x8e')]][_0x56866a][_0x4514('0x38')],_0x56866a);var _0x38239e=moment();this[_0x4514('0xa')][_0x3f7604[_0x4514('0x8e')]][_0x56866a][_0x4514('0x15')]=!![];this[_0x4514('0xa')][_0x3f7604[_0x4514('0x8e')]][_0x56866a][_0x4514('0x67')]=_0x38239e;this[_0x4514('0xa')][_0x3f7604[_0x4514('0x8e')]][_0x56866a][_0x4514('0x54')]=_0x4514('0x68');this[_0x4514('0xa')][_0x3f7604[_0x4514('0x8e')]][_0x56866a][_0x4514('0x55')]=_0x4514('0x69');this['channels'][_0x3f7604[_0x4514('0x8e')]][_0x56866a][_0x4514('0x6b')]=_0x38239e['diff'](this[_0x4514('0xa')][_0x3f7604[_0x4514('0x8e')]][_0x56866a][_0x4514('0x3e')],_0x4514('0x90'));}}}}}}catch(_0x3ef2eb){logger[_0x4514('0x3a')](_0x4514('0x93'),_0x3f7604['uniqueid'],util['inspect'](_0x3ef2eb,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x4514('0x19')]=function(_0x3dbbad){var _0xd0706c='';try{if(this[_0x4514('0x21')](_0x3dbbad)){logger['debug']('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x3dbbad[_0x4514('0x25')],util[_0x4514('0x27')](_0x3dbbad,{'showHidden':![],'depth':null}));if(_0x3dbbad[_0x4514('0x94')]){_0xd0706c=_0x3dbbad[_0x4514('0x94')][_0x4514('0x95')](0x0,_0x3dbbad[_0x4514('0x94')][_0x4514('0x96')]('-'));if(this[_0x4514('0xc')][_0xd0706c]){logger['info'](_0x4514('0x97'),_0x3dbbad[_0x4514('0x25')],_0xd0706c);this[_0x4514('0xc')][_0xd0706c][_0x4514('0x98')]=!![];}}}}catch(_0x558f1a){logger['error']('[%s][voiceAgentReport][musiconholdstart]',_0x3dbbad[_0x4514('0x25')],util[_0x4514('0x27')](_0x558f1a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x4514('0x1b')]=function(_0x3edc97){var _0x1453f6='';try{if(this['isNotNull'](_0x3edc97)){logger[_0x4514('0x32')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x3edc97[_0x4514('0x25')],util['inspect'](_0x3edc97,{'showHidden':![],'depth':null}));if(_0x3edc97[_0x4514('0x94')]){_0x1453f6=_0x3edc97[_0x4514('0x94')][_0x4514('0x95')](0x0,_0x3edc97[_0x4514('0x94')][_0x4514('0x96')]('-'));if(this[_0x4514('0xc')][_0x1453f6]){logger[_0x4514('0x3d')](_0x4514('0x99'),_0x3edc97[_0x4514('0x25')],_0x1453f6);this[_0x4514('0xc')][_0x1453f6]['onhold']=![];}}}}catch(_0x4945b2){logger['error'](_0x4514('0x9a'),_0x3edc97['uniqueid'],util[_0x4514('0x27')](_0x4945b2,{'showHidden':![],'depth':null}));}};module[_0x4514('0x9b')]=VoiceAgentReport; \ No newline at end of file +var _0x930b=['syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncBlindTransfer','emit','prototype','isNotNull','isUndefined','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','agents','queue','format','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','inbound','voice','assign','omit','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','inspect','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','routealias','pick','destconnectedlinenum','interface','accountcode','custom:agentconnect','user:agentconnect','agentringnoanswer','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','answeredelsewheredestinationuniqueid','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','error','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','agentringnoanswerAt','rejected','name','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','diff','agentconnectAt','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','util','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','variables','agentcalled','syncAgentCalled','bind','syncAgentConnect','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x930b,0x89));var _0xb930=function(_0x428bfd,_0x13418d){_0x428bfd=_0x428bfd-0x0;var _0x385e66=_0x930b[_0x428bfd];return _0x385e66;};'use strict';var _=require(_0xb930('0x0'));var moment=require('moment');var util=require(_0xb930('0x1'));var Redis=require('ioredis');var config=require(_0xb930('0x2'));var logger=require(_0xb930('0x3'))(_0xb930('0x4'));var ami=require(_0xb930('0x5'));config['redis']=_[_0xb930('0x6')](config[_0xb930('0x7')],{'host':_0xb930('0x8'),'port':0x18eb});var io=require(_0xb930('0x9'))(new Redis(config[_0xb930('0x7')]));function VoiceAgentReport(_0x3db993){this[_0xb930('0xa')]={};this[_0xb930('0xb')]=_0x3db993[_0xb930('0xa')];this[_0xb930('0xc')]=_0x3db993[_0xb930('0xc')];this['agents']=_0x3db993['agents'];this[_0xb930('0xd')]={};ami['on'](_0xb930('0xe'),this[_0xb930('0xf')][_0xb930('0x10')](this));ami['on']('agentconnect',this[_0xb930('0x11')]['bind'](this));ami['on']('agentringnoanswer',this[_0xb930('0x12')]['bind'](this));ami['on'](_0xb930('0x13'),this[_0xb930('0x14')][_0xb930('0x10')](this));ami['on']('agentcomplete',this[_0xb930('0x15')]['bind'](this));ami['on'](_0xb930('0x16'),this[_0xb930('0x17')][_0xb930('0x10')](this));ami['on'](_0xb930('0x18'),this[_0xb930('0x19')][_0xb930('0x10')](this));ami['on'](_0xb930('0x1a'),this['syncMusicOnHoldStart'][_0xb930('0x10')](this));ami['on'](_0xb930('0x1b'),this[_0xb930('0x1c')][_0xb930('0x10')](this));ami['on'](_0xb930('0x1d'),this['syncAttendedTransfer'][_0xb930('0x10')](this));ami['on']('blindtransfer',this[_0xb930('0x1e')][_0xb930('0x10')](this));}VoiceAgentReport['prototype'][_0xb930('0x1f')]=function(_0x1c75cf,_0x2dcbda,_0x3080af){io['to'](_0x1c75cf)[_0xb930('0x1f')](_0x2dcbda,_0x3080af);};VoiceAgentReport[_0xb930('0x20')][_0xb930('0x21')]=function(_0x2ac87a){return _0x2ac87a!==null&&!_[_0xb930('0x22')](_0x2ac87a);};VoiceAgentReport[_0xb930('0x20')][_0xb930('0xf')]=function(_0x572c0e){try{if(this[_0xb930('0x21')](_0x572c0e)){logger['info'](_0xb930('0x23'),_0x572c0e[_0xb930('0x24')],_0x572c0e[_0xb930('0x25')],_0x572c0e[_0xb930('0x26')]);logger[_0xb930('0x27')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x572c0e['uniqueid'],util['inspect'](_0x572c0e,{'showHidden':![],'depth':null}));if(_[_0xb930('0x22')](this[_0xb930('0xa')][_0x572c0e[_0xb930('0x24')]])){this[_0xb930('0xa')][_0x572c0e[_0xb930('0x24')]]={};}var _0x25d5a3=this[_0xb930('0x28')][_0x572c0e['interface']];var _0x4b2887=this[_0xb930('0xa')][_0x572c0e[_0xb930('0x24')]][_0x572c0e[_0xb930('0x26')]];var _0xe46bad=this[_0xb930('0xc')][_0x572c0e[_0xb930('0x29')]];var _0x207b6a=this[_0xb930('0xd')][_0x572c0e[_0xb930('0x24')]];if(_[_0xb930('0x22')](_0x4b2887)){_0x4b2887={'agentcalledAt':moment()[_0xb930('0x2a')](_0xb930('0x2b')),'lastevent':_0xb930('0x2c'),'mandatoryDisposition':_0xe46bad&&_0xe46bad[_0xb930('0x2d')]?_0xe46bad[_0xb930('0x2d')]:![],'type':_0xe46bad&&_0xe46bad[_0xb930('0x2e')]?_0xe46bad['type']:_0xb930('0x2f'),'variables':_0x207b6a,'motionChannel':_0xb930('0x30')};}Object[_0xb930('0x31')](_0x4b2887,_[_0xb930('0x32')](_0x572c0e,['event',_0xb930('0x33')]));this[_0xb930('0xa')][_0x572c0e[_0xb930('0x24')]][_0x572c0e['destuniqueid']]=_0x4b2887;logger['debug'](_0xb930('0x34'),_0x572c0e[_0xb930('0x24')],util[_0xb930('0x35')](_0x4b2887,{'showHidden':![],'depth':null}));ami[_0xb930('0x1f')](_0xb930('0x36'),_0x4b2887);var _0x86958f={'id':_0x25d5a3['id'],'calleridnum':_0x4b2887[_0xb930('0x37')],'queue':_0x4b2887[_0xb930('0x29')],'variables':_0x4b2887[_0xb930('0xd')],'uniqueid':_0x572c0e[_0xb930('0x24')]};logger[_0xb930('0x27')](_0xb930('0x38'),_0x572c0e[_0xb930('0x24')],util[_0xb930('0x35')](_0x86958f,{'showHidden':![],'depth':null}));this[_0xb930('0x1f')](util[_0xb930('0x2a')](_0xb930('0x39'),_0x572c0e[_0xb930('0x25')]),_0xb930('0x3a'),_0x86958f);}}catch(_0x5dadc3){logger['error'](_0xb930('0x3b'),_0x572c0e['uniqueid'],util[_0xb930('0x35')](_0x5dadc3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb930('0x20')][_0xb930('0x11')]=function(_0x18adcc){try{if(this[_0xb930('0x21')](_0x18adcc)){if(this[_0xb930('0xa')][_0x18adcc[_0xb930('0x24')]]){for(var _0x4a0f2b in this[_0xb930('0xa')][_0x18adcc['uniqueid']]){if(this[_0xb930('0xa')][_0x18adcc['uniqueid']][_0xb930('0x3c')](_0x4a0f2b)){if(_0x18adcc[_0xb930('0x26')]===_0x4a0f2b){logger[_0xb930('0x3d')](_0xb930('0x3e'),_0x18adcc[_0xb930('0x24')],_0x18adcc[_0xb930('0x25')],_0x18adcc['destuniqueid']);this[_0xb930('0xa')][_0x18adcc['uniqueid']][_0x4a0f2b]['agentconnectAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xb930('0xa')][_0x18adcc[_0xb930('0x24')]][_0x4a0f2b][_0xb930('0x3f')]=_0x18adcc['connectedlinename'];this[_0xb930('0xa')][_0x18adcc['uniqueid']][_0x4a0f2b][_0xb930('0x40')]=_0x18adcc[_0xb930('0x40')];this[_0xb930('0xa')][_0x18adcc[_0xb930('0x24')]][_0x4a0f2b][_0xb930('0x41')]=_0x18adcc[_0xb930('0x41')];this[_0xb930('0xa')][_0x18adcc[_0xb930('0x24')]][_0x4a0f2b][_0xb930('0x42')]=_0x18adcc[_0xb930('0x42')];this[_0xb930('0xa')][_0x18adcc['uniqueid']][_0x4a0f2b]['holdtime']=_0x18adcc[_0xb930('0x43')];this[_0xb930('0xa')][_0x18adcc[_0xb930('0x24')]][_0x4a0f2b][_0xb930('0x44')]='connect';if(this['voiceChannels'][this[_0xb930('0xa')][_0x18adcc['uniqueid']][_0x4a0f2b]['uniqueid']]){var _0x53c881=this[_0xb930('0xb')][this[_0xb930('0xa')][_0x18adcc[_0xb930('0x24')]][_0x4a0f2b][_0xb930('0x24')]][_0xb930('0x45')];this[_0xb930('0xa')][_0x18adcc['uniqueid']][_0x4a0f2b][_0xb930('0x45')]=_0x53c881;_0x18adcc[_0xb930('0x45')]=_0x53c881;}_['merge'](this[_0xb930('0x28')][_0x18adcc['interface']],_[_0xb930('0x46')](_0x18adcc,[_0xb930('0x29'),_0xb930('0x47'),_0xb930('0x45')]));var _0x47d190=this[_0xb930('0x28')][_0x18adcc[_0xb930('0x48')]];var _0x3d545e={'id':_0x47d190['id'],'name':_0x47d190['name'],'agentconnected':!![],'destaccountcode':_0x47d190[_0xb930('0x49')],'destconnectedlinenum':this[_0xb930('0xa')][_0x18adcc[_0xb930('0x24')]][_0x18adcc['destuniqueid']]['exten'],'queue':this[_0xb930('0xa')][_0x18adcc['uniqueid']][_0x18adcc[_0xb930('0x26')]][_0xb930('0x29')],'routealias':this[_0xb930('0xa')][_0x18adcc[_0xb930('0x24')]][_0x18adcc['destuniqueid']][_0xb930('0x45')],'uniqueid':this['channels'][_0x18adcc[_0xb930('0x24')]][_0x18adcc[_0xb930('0x26')]][_0xb930('0x24')]};ami[_0xb930('0x1f')](_0xb930('0x4a'),this[_0xb930('0xa')][_0x18adcc['uniqueid']][_0x18adcc['destuniqueid']]);this[_0xb930('0x1f')](util[_0xb930('0x2a')](_0xb930('0x39'),_0x18adcc[_0xb930('0x25')]),_0xb930('0x4b'),_0x3d545e);}else if(!this[_0xb930('0xa')][_0x18adcc['uniqueid']][_0x4a0f2b][_0xb930('0x4c')]&&!this[_0xb930('0xa')][_0x18adcc[_0xb930('0x24')]][_0x4a0f2b][_0xb930('0x4d')]){logger['info'](_0xb930('0x4e'),_0x18adcc[_0xb930('0x24')],this['channels'][_0x18adcc[_0xb930('0x24')]][_0x4a0f2b][_0xb930('0x25')],_0x4a0f2b);this[_0xb930('0xa')][_0x18adcc['uniqueid']][_0x4a0f2b][_0xb930('0x4c')]=!![];this[_0xb930('0xa')][_0x18adcc['uniqueid']][_0x4a0f2b]['agentringnoanswerAt']=moment()[_0xb930('0x2a')](_0xb930('0x2b'));this[_0xb930('0xa')][_0x18adcc[_0xb930('0x24')]][_0x4a0f2b][_0xb930('0x4f')]=_0x18adcc['destuniqueid'];this[_0xb930('0xa')][_0x18adcc[_0xb930('0x24')]][_0x4a0f2b]['answeredelsewheremembername']=_0x18adcc[_0xb930('0x25')];this['channels'][_0x18adcc['uniqueid']][_0x4a0f2b][_0xb930('0x44')]=_0xb930('0x50');this[_0xb930('0xa')][_0x18adcc[_0xb930('0x24')]][_0x4a0f2b][_0xb930('0x51')]='answered_elsewhere';logger[_0xb930('0x27')](_0xb930('0x52'),_0x18adcc[_0xb930('0x24')],util[_0xb930('0x35')](this[_0xb930('0xa')][_0x18adcc['uniqueid']][_0x4a0f2b],{'showHidden':![],'depth':null}));ami['emit']('custom:agentansweredelsewhere',this['channels'][_0x18adcc[_0xb930('0x24')]][_0x4a0f2b]);}else{logger[_0xb930('0x27')]('[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken',_0x18adcc[_0xb930('0x24')]);}}}}}}catch(_0x4e88d8){logger[_0xb930('0x53')](_0xb930('0x54'),_0x18adcc['uniqueid'],util[_0xb930('0x35')](_0x4e88d8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb930('0x20')][_0xb930('0x12')]=function(_0xf4ce73){try{if(this[_0xb930('0x21')](_0xf4ce73)){logger[_0xb930('0x27')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0xf4ce73[_0xb930('0x24')],util[_0xb930('0x35')](_0xf4ce73,{'showHidden':![],'depth':null}));if(this[_0xb930('0xa')][_0xf4ce73[_0xb930('0x24')]]&&this[_0xb930('0xa')][_0xf4ce73[_0xb930('0x24')]][_0xf4ce73['destuniqueid']]){logger['info'](_0xb930('0x55'),_0xf4ce73[_0xb930('0x24')],_0xf4ce73[_0xb930('0x25')],_0xf4ce73[_0xb930('0x26')]);var _0x722b04=this['agents'][_0xf4ce73[_0xb930('0x48')]];var _0x21de69=this['channels'][_0xf4ce73[_0xb930('0x24')]][_0xf4ce73[_0xb930('0x26')]];_0x21de69[_0xb930('0x4c')]=!![];_0x21de69[_0xb930('0x56')]=moment()[_0xb930('0x2a')](_0xb930('0x2b'));_0x21de69[_0xb930('0x44')]=_0xb930('0x57');_0x21de69[_0xb930('0x51')]=_0xb930('0x57');var _0x12dd2c={'id':_0x722b04['id'],'name':_0x722b04[_0xb930('0x58')],'queue':_0x21de69[_0xb930('0x29')],'uniqueid':_0x21de69[_0xb930('0x24')]};logger[_0xb930('0x27')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0xf4ce73[_0xb930('0x24')],util['inspect'](_0x12dd2c,{'showHidden':![],'depth':null}));this[_0xb930('0x1f')](util[_0xb930('0x2a')](_0xb930('0x39'),_0x722b04['name']),_0xb930('0x59'),_0x12dd2c);ami[_0xb930('0x1f')](_0xb930('0x5a'),_0x21de69);this[_0xb930('0xa')][_0xf4ce73['uniqueid']][_0xf4ce73['destuniqueid']]=Object[_0xb930('0x31')]({},_0x21de69);}}}catch(_0x1762e2){logger[_0xb930('0x53')](_0xb930('0x5b'),_0xf4ce73[_0xb930('0x24')],util[_0xb930('0x35')](_0x1762e2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb930('0x20')][_0xb930('0x14')]=function(_0x1f04e0){try{if(this[_0xb930('0x21')](_0x1f04e0)){logger[_0xb930('0x27')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x1f04e0[_0xb930('0x24')],util[_0xb930('0x35')](_0x1f04e0,{'showHidden':![],'depth':null}));if(this[_0xb930('0xa')][_0x1f04e0[_0xb930('0x24')]]){for(var _0x208d39 in this['channels'][_0x1f04e0['uniqueid']]){if(this['channels'][_0x1f04e0[_0xb930('0x24')]][_0xb930('0x3c')](_0x208d39)&&!this[_0xb930('0xa')][_0x1f04e0[_0xb930('0x24')]][_0x208d39]['agentringnoanswer']&&!this[_0xb930('0xa')][_0x1f04e0['uniqueid']][_0x208d39][_0xb930('0x4d')]){logger[_0xb930('0x3d')](_0xb930('0x5c'),_0x1f04e0['uniqueid'],this[_0xb930('0xa')][_0x1f04e0['uniqueid']][_0x208d39][_0xb930('0x25')],_0x208d39);this['channels'][_0x1f04e0[_0xb930('0x24')]][_0x208d39][_0xb930('0x4c')]=!![];this[_0xb930('0xa')][_0x1f04e0['uniqueid']][_0x208d39][_0xb930('0x56')]=moment()['format'](_0xb930('0x2b'));this[_0xb930('0xa')][_0x1f04e0[_0xb930('0x24')]][_0x208d39][_0xb930('0x44')]='abandoned';this['channels'][_0x1f04e0[_0xb930('0x24')]][_0x208d39][_0xb930('0x51')]=_0xb930('0x5d');logger['debug'](_0xb930('0x5e'),_0x1f04e0[_0xb930('0x24')],util[_0xb930('0x35')](this[_0xb930('0xa')][_0x1f04e0[_0xb930('0x24')]][_0x208d39],{'showHidden':![],'depth':null}));ami[_0xb930('0x1f')](_0xb930('0x5f'),this['channels'][_0x1f04e0[_0xb930('0x24')]][_0x208d39]);}}}}}catch(_0xfa4141){logger[_0xb930('0x53')]('[%s][voiceAgentReport][queuecallerabandon]',_0x1f04e0['uniqueid'],util[_0xb930('0x35')](_0xfa4141,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb930('0x20')]['syncAgentComplete']=function(_0x471cbd){try{if(this[_0xb930('0x21')](_0x471cbd)){logger[_0xb930('0x27')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x471cbd[_0xb930('0x24')],util['inspect'](_0x471cbd,{'showHidden':![],'depth':null}));if(this[_0xb930('0xa')][_0x471cbd[_0xb930('0x24')]]){for(var _0x13ecab in this[_0xb930('0xa')][_0x471cbd[_0xb930('0x24')]]){if(this[_0xb930('0xa')][_0x471cbd[_0xb930('0x24')]][_0xb930('0x3c')](_0x13ecab)){if(this[_0xb930('0xa')][_0x471cbd[_0xb930('0x24')]][_0x13ecab]['agentconnectAt']&&!this[_0xb930('0xa')][_0x471cbd[_0xb930('0x24')]][_0x13ecab]['agentcomplete']){logger[_0xb930('0x3d')](_0xb930('0x60'),_0x471cbd[_0xb930('0x24')],this[_0xb930('0xa')][_0x471cbd[_0xb930('0x24')]][_0x13ecab][_0xb930('0x25')],_0x13ecab);this[_0xb930('0xa')][_0x471cbd['uniqueid']][_0x13ecab][_0xb930('0x4d')]=!![];this['channels'][_0x471cbd[_0xb930('0x24')]][_0x13ecab][_0xb930('0x61')]=moment()[_0xb930('0x2a')](_0xb930('0x2b'));this[_0xb930('0xa')][_0x471cbd[_0xb930('0x24')]][_0x13ecab]['lastevent']='complete';this[_0xb930('0xa')][_0x471cbd[_0xb930('0x24')]][_0x13ecab]['reason']=_0x471cbd['reason']==_0xb930('0x62')?_0xb930('0x63'):_0x471cbd[_0xb930('0x51')];this[_0xb930('0xa')][_0x471cbd['uniqueid']][_0x13ecab][_0xb930('0x64')]=_0x471cbd[_0xb930('0x64')];if(this['voiceQueues'][_0x471cbd[_0xb930('0x29')]]&&this['voiceQueues'][_0x471cbd['queue']][_0xb930('0x65')]){this[_0xb930('0xa')][_0x471cbd[_0xb930('0x24')]][_0x13ecab][_0xb930('0x66')]=this[_0xb930('0xc')][_0x471cbd[_0xb930('0x29')]][_0xb930('0x67')];this[_0xb930('0xa')][_0x471cbd[_0xb930('0x24')]][_0x13ecab][_0xb930('0x68')]=!![];}this[_0xb930('0x28')][_0x471cbd[_0xb930('0x48')]]=_[_0xb930('0x32')](this[_0xb930('0x28')][_0x471cbd['interface']],['queue',_0xb930('0x47')]);logger[_0xb930('0x27')](_0xb930('0x69'),_0x471cbd['uniqueid'],util['inspect'](this['channels'][_0x471cbd[_0xb930('0x24')]][_0x13ecab],{'showHidden':![],'depth':null}));ami[_0xb930('0x1f')]('custom:agentcomplete',this[_0xb930('0xa')][_0x471cbd['uniqueid']][_0x13ecab]);logger[_0xb930('0x27')](_0xb930('0x6a'),_0x471cbd['uniqueid'],util['inspect']({'id':this['agents'][_0x471cbd[_0xb930('0x48')]]['id'],'destaccountcode':_0x471cbd[_0xb930('0x6b')]},{'showHidden':![],'depth':null}));this[_0xb930('0x1f')](util[_0xb930('0x2a')](_0xb930('0x39'),_0x471cbd[_0xb930('0x25')]),_0xb930('0x6c'),{'id':this[_0xb930('0x28')][_0x471cbd[_0xb930('0x48')]]['id'],'destaccountcode':Number(_0x471cbd[_0xb930('0x6b')])});}}}}}}catch(_0x25e536){logger['error'](_0xb930('0x6d'),_0x471cbd['uniqueid'],util[_0xb930('0x35')](_0x25e536,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb930('0x20')]['syncVarSet']=function(_0xd8bafe){try{if(this[_0xb930('0x21')](_0xd8bafe)){logger[_0xb930('0x27')]('[%s][voiceAgentReport][varset]\x20event:',_0xd8bafe[_0xb930('0x24')],util['inspect'](_0xd8bafe,{'showHidden':![],'depth':null}));this['addVariable'](_0xd8bafe[_0xb930('0x24')],_[_0xb930('0x6e')](_0xd8bafe[_0xb930('0x6f')])[0x0],_0xd8bafe[_0xb930('0x70')]);if(this[_0xb930('0xa')][_0xd8bafe['uniqueid']]){for(var _0x3880ab in this[_0xb930('0xa')][_0xd8bafe[_0xb930('0x24')]]){if(this[_0xb930('0xa')][_0xd8bafe[_0xb930('0x24')]]['hasOwnProperty'](_0x3880ab)){logger['info'](_0xb930('0x71'),_0xd8bafe[_0xb930('0x24')],_0x3880ab,_[_0xb930('0x6e')](_0xd8bafe[_0xb930('0x6f')])[0x0],_0xd8bafe[_0xb930('0x70')]);if(_[_0xb930('0x22')](this['channels'][_0xd8bafe['uniqueid']][_0x3880ab][_0xb930('0xd')])){this[_0xb930('0xa')][_0xd8bafe[_0xb930('0x24')]][_0x3880ab][_0xb930('0xd')]={};}this[_0xb930('0xa')][_0xd8bafe['uniqueid']][_0x3880ab][_0xb930('0xd')]=this[_0xb930('0xd')][_0xd8bafe[_0xb930('0x24')]];}}}}}catch(_0x12287d){logger[_0xb930('0x53')]('[%s][voiceAgentReport][varset]',_0xd8bafe['uniqueid'],util[_0xb930('0x35')](_0x12287d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb930('0x72')]=function(_0x9f3c11,_0x508404,_0x14f0e8){var _0x3d15c0=[_0xb930('0x73'),_0xb930('0x74'),_0xb930('0x75'),'rtpaudioqosjitterbridged',_0xb930('0x76'),_0xb930('0x77'),_0xb930('0x78'),'rtpaudioqosrttbridged',_0xb930('0x79'),_0xb930('0x7a'),_0xb930('0x7b'),_0xb930('0x7c'),'membercalls',_0xb930('0x7d'),_0xb930('0x7e'),_0xb930('0x7f'),_0xb930('0x25'),_0xb930('0x80'),'memberrealtime'];if(!_[_0xb930('0x81')](_0x508404)&&!_[_0xb930('0x82')](_0x3d15c0,_0x508404)){if(_[_0xb930('0x22')](this[_0xb930('0xd')][_0x9f3c11])){this['variables'][_0x9f3c11]={};}this['variables'][_0x9f3c11][_0x508404]=_0x14f0e8;}};VoiceAgentReport['prototype']['syncHangup']=function(_0x1ca804){try{if(this[_0xb930('0x21')](_0x1ca804)){logger[_0xb930('0x27')](_0xb930('0x83'),_0x1ca804[_0xb930('0x24')],util[_0xb930('0x35')](_0x1ca804,{'showHidden':![],'depth':null}));if(this['channels'][_0x1ca804[_0xb930('0x24')]]){for(var _0x4077f8 in this[_0xb930('0xa')][_0x1ca804['uniqueid']]){if(this[_0xb930('0xa')][_0x1ca804[_0xb930('0x24')]]['hasOwnProperty'](_0x4077f8)){if(this[_0xb930('0xa')][_0x1ca804[_0xb930('0x24')]][_0x4077f8][_0xb930('0x51')]==_0xb930('0x62')&&this[_0xb930('0xa')][_0x1ca804[_0xb930('0x24')]][_0x4077f8]['agentcomplete']){logger[_0xb930('0x3d')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x1ca804['uniqueid'],_0x4077f8);this[_0xb930('0xa')][_0x1ca804[_0xb930('0x24')]][_0x4077f8][_0xb930('0x61')]=moment()[_0xb930('0x2a')](_0xb930('0x2b'));}}}logger['debug']('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x1ca804[_0xb930('0x24')],util['inspect'](_[_0xb930('0x84')](this['channels'][_0x1ca804[_0xb930('0x24')]]),{'showHidden':![],'depth':null}));ami[_0xb930('0x1f')](_0xb930('0x85'),_[_0xb930('0x84')](this[_0xb930('0xa')][_0x1ca804[_0xb930('0x24')]]));delete this[_0xb930('0xa')][_0x1ca804['uniqueid']];}if(this[_0xb930('0xd')][_0x1ca804[_0xb930('0x24')]]){delete this[_0xb930('0xd')][_0x1ca804[_0xb930('0x24')]];}}}catch(_0x31fae0){logger['error'](_0xb930('0x86'),_0x1ca804[_0xb930('0x24')],util['inspect'](_0x31fae0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb930('0x20')]['syncAttendedTransfer']=function(_0x1c9f64){try{if(this[_0xb930('0x21')](_0x1c9f64)){logger[_0xb930('0x27')](_0xb930('0x87'),_0x1c9f64['uniqueid'],util[_0xb930('0x35')](_0x1c9f64,{'showHidden':![],'depth':null}));if(this[_0xb930('0xa')][_0x1c9f64[_0xb930('0x88')]]){for(var _0x384692 in this[_0xb930('0xa')][_0x1c9f64['transfereeuniqueid']]){if(this[_0xb930('0xa')][_0x1c9f64['transfereeuniqueid']][_0xb930('0x3c')](_0x384692)){if(_0x1c9f64[_0xb930('0x89')]===_0x384692){logger['info'](_0xb930('0x8a'),_0x1c9f64['uniqueid'],this[_0xb930('0xa')][_0x1c9f64[_0xb930('0x88')]][_0x384692][_0xb930('0x25')],_0x384692);var _0x2209dc=moment();this['channels'][_0x1c9f64[_0xb930('0x88')]][_0x384692]['agentcomplete']=!![];this[_0xb930('0xa')][_0x1c9f64[_0xb930('0x88')]][_0x384692][_0xb930('0x61')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xb930('0xa')][_0x1c9f64[_0xb930('0x88')]][_0x384692][_0xb930('0x44')]=_0xb930('0x8b');this[_0xb930('0xa')][_0x1c9f64[_0xb930('0x88')]][_0x384692]['reason']=_0xb930('0x62');this[_0xb930('0xa')][_0x1c9f64[_0xb930('0x88')]][_0x384692][_0xb930('0x64')]=_0x2209dc[_0xb930('0x8c')](this[_0xb930('0xa')][_0x1c9f64[_0xb930('0x88')]][_0x384692][_0xb930('0x8d')],_0xb930('0x8e'));}}}}if(this['channels'][_0x1c9f64['secondtransfereruniqueid']]){var _0x515e4c=this[_0xb930('0xa')][_0x1c9f64[_0xb930('0x8f')]];this[_0xb930('0xa')][_0x1c9f64['secondtransfereruniqueid']]=this[_0xb930('0xa')][_0x1c9f64[_0xb930('0x88')]];this[_0xb930('0xa')][_0x1c9f64[_0xb930('0x88')]]=_0x515e4c;}}}catch(_0x3c7b31){logger['error'](_0xb930('0x90'),_0x1c9f64[_0xb930('0x24')],util['inspect'](_0x3c7b31,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb930('0x1e')]=function(_0x15a459){try{if(this[_0xb930('0x21')](_0x15a459)){logger[_0xb930('0x27')](_0xb930('0x91'),_0x15a459[_0xb930('0x24')],util[_0xb930('0x35')](_0x15a459,{'showHidden':![],'depth':null}));if(this[_0xb930('0xa')][_0x15a459[_0xb930('0x88')]]){for(var _0x451f11 in this['channels'][_0x15a459[_0xb930('0x88')]]){if(this[_0xb930('0xa')][_0x15a459['transfereeuniqueid']]['hasOwnProperty'](_0x451f11)){if(_0x15a459[_0xb930('0x92')]===_0x451f11){logger[_0xb930('0x3d')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x15a459[_0xb930('0x24')],this[_0xb930('0xa')][_0x15a459[_0xb930('0x88')]][_0x451f11][_0xb930('0x25')],_0x451f11);var _0x26e709=moment();this[_0xb930('0xa')][_0x15a459[_0xb930('0x88')]][_0x451f11][_0xb930('0x4d')]=!![];this[_0xb930('0xa')][_0x15a459['transfereeuniqueid']][_0x451f11][_0xb930('0x61')]=_0x26e709;this['channels'][_0x15a459[_0xb930('0x88')]][_0x451f11][_0xb930('0x44')]=_0xb930('0x8b');this[_0xb930('0xa')][_0x15a459[_0xb930('0x88')]][_0x451f11][_0xb930('0x51')]=_0xb930('0x62');this[_0xb930('0xa')][_0x15a459[_0xb930('0x88')]][_0x451f11][_0xb930('0x64')]=_0x26e709[_0xb930('0x8c')](this[_0xb930('0xa')][_0x15a459['transfereeuniqueid']][_0x451f11][_0xb930('0x8d')],_0xb930('0x8e'));}}}}}}catch(_0x4f4dc5){logger[_0xb930('0x53')](_0xb930('0x93'),_0x15a459[_0xb930('0x24')],util[_0xb930('0x35')](_0x4f4dc5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb930('0x20')]['syncMusicOnHoldStart']=function(_0x11497d){var _0x11c4ae='';try{if(this[_0xb930('0x21')](_0x11497d)){logger[_0xb930('0x27')](_0xb930('0x94'),_0x11497d[_0xb930('0x24')],util[_0xb930('0x35')](_0x11497d,{'showHidden':![],'depth':null}));if(_0x11497d[_0xb930('0x95')]){_0x11c4ae=_0x11497d[_0xb930('0x95')][_0xb930('0x96')](0x0,_0x11497d[_0xb930('0x95')][_0xb930('0x97')]('-'));if(this[_0xb930('0x28')][_0x11c4ae]){logger[_0xb930('0x3d')](_0xb930('0x98'),_0x11497d[_0xb930('0x24')],_0x11c4ae);this['agents'][_0x11c4ae][_0xb930('0x99')]=!![];}}}}catch(_0x362d13){logger[_0xb930('0x53')]('[%s][voiceAgentReport][musiconholdstart]',_0x11497d['uniqueid'],util[_0xb930('0x35')](_0x362d13,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb930('0x20')][_0xb930('0x1c')]=function(_0x1d0521){var _0x2f1040='';try{if(this[_0xb930('0x21')](_0x1d0521)){logger[_0xb930('0x27')](_0xb930('0x9a'),_0x1d0521[_0xb930('0x24')],util['inspect'](_0x1d0521,{'showHidden':![],'depth':null}));if(_0x1d0521['channel']){_0x2f1040=_0x1d0521['channel'][_0xb930('0x96')](0x0,_0x1d0521['channel'][_0xb930('0x97')]('-'));if(this['agents'][_0x2f1040]){logger['info'](_0xb930('0x9b'),_0x1d0521[_0xb930('0x24')],_0x2f1040);this['agents'][_0x2f1040][_0xb930('0x99')]=![];}}}}catch(_0x492f2f){logger[_0xb930('0x53')](_0xb930('0x9c'),_0x1d0521['uniqueid'],util[_0xb930('0x35')](_0x492f2f,{'showHidden':![],'depth':null}));}};module[_0xb930('0x9d')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index c47346f..7704215 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc60=['secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','set','agi','dial','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','defaults','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','syncNewExten','bind','newchannel','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','syncNewCallerId','uniqueid','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','keys','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','name','accountcode','syncNewChannel','debug','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','pick','undefined','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','subtract','duration','seconds','includes','lastapplication','lastdata','startsWith','cdr(','match','isNil','queue','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','diff','connectedlinename','destinationchannel','disposition','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','endsWith','.wav49','replace','monitorFilename','find','monitors','push','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','value','variable','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcallid','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','user:agentcomplete','transferType','resolve','transferToInternal','getSettings','then','stopRecordingOnTransfer','catch','Action','StopMixMonitor','finally','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transfertargetcalleridnum'];(function(_0x51594d,_0x42a040){var _0xec01=function(_0x5177a4){while(--_0x5177a4){_0x51594d['push'](_0x51594d['shift']());}};_0xec01(++_0x42a040);}(_0xbc60,0xdc));var _0x0bc6=function(_0x7897d1,_0xb8ae7b){_0x7897d1=_0x7897d1-0x0;var _0x2f10e1=_0xbc60[_0x7897d1];return _0x2f10e1;};'use strict';var _=require(_0x0bc6('0x0'));var moment=require(_0x0bc6('0x1'));var util=require(_0x0bc6('0x2'));var path=require(_0x0bc6('0x3'));var Redis=require(_0x0bc6('0x4'));var config=require(_0x0bc6('0x5'));var logger=require(_0x0bc6('0x6'))(_0x0bc6('0x7'));var ami=require(_0x0bc6('0x8'));var Channel=require(_0x0bc6('0x9'));var RpcSetting=require('../rpc/setting');var applications=[_0x0bc6('0xa'),'queue',_0x0bc6('0xb'),_0x0bc6('0xc'),_0x0bc6('0xd'),_0x0bc6('0xe')];var dispositions=['NO\x20ANSWER',_0x0bc6('0xf'),_0x0bc6('0xf'),_0x0bc6('0x10'),_0x0bc6('0x10'),_0x0bc6('0x10'),_0x0bc6('0x11'),_0x0bc6('0x12'),_0x0bc6('0xf'),_0x0bc6('0xf'),'FAILED'];config['redis']=_[_0x0bc6('0x13')](config[_0x0bc6('0x14')],{'host':_0x0bc6('0x15'),'port':0x18eb});var io=require(_0x0bc6('0x16'))(new Redis(config[_0x0bc6('0x14')]));function VoiceCallReport(_0x3d8f56){this['channels']=_0x3d8f56[_0x0bc6('0x17')];this[_0x0bc6('0x18')]=_0x3d8f56[_0x0bc6('0x18')];this[_0x0bc6('0x19')]={};ami['on']('coreshowchannel',this[_0x0bc6('0x1a')][_0x0bc6('0x1b')](this));ami['on']('newexten',this['syncNewExten'][_0x0bc6('0x1b')](this));ami['on'](_0x0bc6('0x1c'),this['syncNewChannel'][_0x0bc6('0x1b')](this));ami['on']('newstate',this[_0x0bc6('0x1d')][_0x0bc6('0x1b')](this));ami['on'](_0x0bc6('0x1e'),this[_0x0bc6('0x1f')]['bind'](this));ami['on'](_0x0bc6('0x20'),this[_0x0bc6('0x21')]['bind'](this));ami['on'](_0x0bc6('0x22'),this['syncNewCallerId'][_0x0bc6('0x1b')](this));ami['on']('attendedtransfer',this[_0x0bc6('0x23')][_0x0bc6('0x1b')](this));ami['on'](_0x0bc6('0x24'),this[_0x0bc6('0x25')]['bind'](this));ami['on']('musiconholdstart',this[_0x0bc6('0x26')]['bind'](this));ami['on'](_0x0bc6('0x27'),this[_0x0bc6('0x28')][_0x0bc6('0x1b')](this));try{logger[_0x0bc6('0x29')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0x0bc6('0x2a')]();}catch(_0x207e81){logger[_0x0bc6('0x2b')](_0x0bc6('0x2c'),util[_0x0bc6('0x2d')](_0x207e81,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x0bc6('0x2e')][_0x0bc6('0x2f')]=function(_0x284d36){return _0x284d36!==null&&!_[_0x0bc6('0x30')](_0x284d36);};VoiceCallReport['prototype'][_0x0bc6('0x31')]=function(_0x179b39,_0x50f3eb,_0x56360a){io['to'](_0x179b39)[_0x0bc6('0x31')](_0x50f3eb,_0x56360a);};VoiceCallReport[_0x0bc6('0x2e')][_0x0bc6('0x32')]=function(_0x511f4b){try{if(this[_0x0bc6('0x2f')](_0x511f4b)){logger[_0x0bc6('0x29')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x511f4b[_0x0bc6('0x33')],_0x511f4b[_0x0bc6('0x34')],_0x511f4b[_0x0bc6('0x35')]);logger['debug'](_0x0bc6('0x36'),_0x511f4b['uniqueid'],util[_0x0bc6('0x2d')](_0x511f4b,{'showHidden':![],'depth':null}));if(_0x511f4b['uniqueid']===_0x511f4b[_0x0bc6('0x37')]){if(!_[_0x0bc6('0x30')](this['channels'][_0x511f4b['uniqueid']])){_[_0x0bc6('0x38')](this[_0x0bc6('0x17')][_0x511f4b[_0x0bc6('0x33')]],_['pick'](_0x511f4b,_[_0x0bc6('0x39')](this[_0x0bc6('0x17')][_0x511f4b[_0x0bc6('0x33')]])));}}if(_0x511f4b[_0x0bc6('0x3a')]===_0x0bc6('0x3b')){var _0xd1b357=this[_0x0bc6('0x18')][_0x511f4b[_0x0bc6('0x3c')][_0x0bc6('0x3d')]('-')[0x0]];if(_0xd1b357){if(_0x511f4b[_0x0bc6('0x3e')]==_0x0bc6('0x3f')){_0xd1b357[_0x0bc6('0x40')]=_0x511f4b[_0x0bc6('0x41')];this[_0x0bc6('0x31')](util[_0x0bc6('0x42')](_0x0bc6('0x43'),_0xd1b357[_0x0bc6('0x44')]),'user:agentconnect',{'id':_0xd1b357['id'],'destaccountcode':_0xd1b357[_0x0bc6('0x45')],'destconnectedlinenum':_0x511f4b[_0x0bc6('0x41')]});}}}}}catch(_0x11660d){logger[_0x0bc6('0x2b')]('[%s][voiceCallReport][newcallerid]',_0x511f4b[_0x0bc6('0x33')],util['inspect'](_0x11660d,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x0bc6('0x46')]=function(_0x1e5ff7){try{if(this[_0x0bc6('0x2f')](_0x1e5ff7)){logger[_0x0bc6('0x47')](_0x0bc6('0x48'),_0x1e5ff7[_0x0bc6('0x33')],util[_0x0bc6('0x2d')](_0x1e5ff7,{'showHidden':![],'depth':null}));if(this[_0x0bc6('0x17')][_0x1e5ff7[_0x0bc6('0x33')]]){return;}if(_0x1e5ff7['channel']===_0x0bc6('0x49')){return;}if(_0x1e5ff7[_0x0bc6('0x33')]!==_0x1e5ff7[_0x0bc6('0x37')]&&!this['blindTransfers'][_0x1e5ff7['linkedid']]){return;}logger[_0x0bc6('0x29')](_0x0bc6('0x4a'),_0x1e5ff7[_0x0bc6('0x33')],_0x1e5ff7[_0x0bc6('0x3a')],_0x1e5ff7[_0x0bc6('0x3e')]);this[_0x0bc6('0x17')][_0x1e5ff7[_0x0bc6('0x33')]]=new Channel();this[_0x0bc6('0x17')][_0x1e5ff7[_0x0bc6('0x33')]][_0x0bc6('0x4b')]=moment()['format'](_0x0bc6('0x4c'));this['channels'][_0x1e5ff7[_0x0bc6('0x33')]]['disposition']=dispositions[_[_0x0bc6('0x4d')](_0x1e5ff7[_0x0bc6('0x4e')])];_[_0x0bc6('0x38')](this[_0x0bc6('0x17')][_0x1e5ff7[_0x0bc6('0x33')]],_[_0x0bc6('0x4f')](_0x1e5ff7,_[_0x0bc6('0x39')](this['channels'][_0x1e5ff7[_0x0bc6('0x33')]])));if(_0x1e5ff7[_0x0bc6('0x3a')]===_0x0bc6('0x3b')){var _0x59b37a=this[_0x0bc6('0x18')][_0x1e5ff7[_0x0bc6('0x3c')]['split']('-')[0x0]];if(_0x59b37a&&typeof _0x59b37a[_0x0bc6('0x40')]===_0x0bc6('0x50')){_0x59b37a[_0x0bc6('0x40')]=_0x1e5ff7['exten'];logger['debug'](_0x0bc6('0x51'),_0x1e5ff7[_0x0bc6('0x33')],util[_0x0bc6('0x2d')]({'id':_0x59b37a['id'],'destaccountcode':_0x59b37a[_0x0bc6('0x45')],'destconnectedlinenum':_0x1e5ff7[_0x0bc6('0x3e')]},{'showHidden':![],'depth':null}));this[_0x0bc6('0x31')](util[_0x0bc6('0x42')](_0x0bc6('0x43'),_0x59b37a[_0x0bc6('0x44')]),_0x0bc6('0x52'),{'id':_0x59b37a['id'],'destaccountcode':_0x59b37a[_0x0bc6('0x45')],'destconnectedlinenum':_0x1e5ff7[_0x0bc6('0x3e')]});}}}}catch(_0x1b6924){logger[_0x0bc6('0x2b')](_0x0bc6('0x53'),_0x1e5ff7['uniqueid'],util[_0x0bc6('0x2d')](_0x1b6924,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0bc6('0x2e')][_0x0bc6('0x1a')]=function(_0x5f156c){try{if(this[_0x0bc6('0x2f')](_0x5f156c)){logger[_0x0bc6('0x47')](_0x0bc6('0x54'),_0x5f156c[_0x0bc6('0x33')],util[_0x0bc6('0x2d')](_0x5f156c,{'showHidden':![],'depth':null}));if(_0x5f156c[_0x0bc6('0x3c')]===_0x0bc6('0x49')||_0x5f156c[_0x0bc6('0x3e')]==='h')return;if(_0x5f156c['uniqueid']===_0x5f156c[_0x0bc6('0x37')]||this[_0x0bc6('0x19')][_0x5f156c['linkedid']]){_0x5f156c[_0x0bc6('0x55')]=_0x5f156c[_0x0bc6('0x55')]?_0x5f156c[_0x0bc6('0x55')][_0x0bc6('0x56')]():undefined;_0x5f156c[_0x0bc6('0x57')]=_0x5f156c['appdata']||_0x5f156c[_0x0bc6('0x57')];if(_0x5f156c[_0x0bc6('0x58')]&&!_0x5f156c['appdata']['startsWith']('CDR(routeAlias)')&&_0x5f156c['application']!=='queue'){_0x5f156c[_0x0bc6('0x57')]=_0x5f156c['applicationdata']['toLowerCase']();}logger[_0x0bc6('0x29')](_0x0bc6('0x59'),_0x5f156c['uniqueid'],_0x5f156c[_0x0bc6('0x55')],_0x5f156c[_0x0bc6('0x57')]);if(_[_0x0bc6('0x30')](this[_0x0bc6('0x17')][_0x5f156c[_0x0bc6('0x33')]])){this['channels'][_0x5f156c[_0x0bc6('0x33')]]=new Channel();this[_0x0bc6('0x17')][_0x5f156c[_0x0bc6('0x33')]][_0x0bc6('0x4b')]=_0x5f156c['duration']?moment()[_0x0bc6('0x5a')](moment[_0x0bc6('0x5b')](_0x5f156c[_0x0bc6('0x5b')])[_0x0bc6('0x5c')](),_0x0bc6('0x5c'))['format'](_0x0bc6('0x4c')):moment()[_0x0bc6('0x42')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0bc6('0x17')][_0x5f156c[_0x0bc6('0x33')]]['disposition']='NO\x20ANSWER';}_[_0x0bc6('0x38')](this['channels'][_0x5f156c[_0x0bc6('0x33')]],_[_0x0bc6('0x4f')](_0x5f156c,_[_0x0bc6('0x39')](this[_0x0bc6('0x17')][_0x5f156c[_0x0bc6('0x33')]])));if(_[_0x0bc6('0x5d')](applications,_0x5f156c['application'])){this[_0x0bc6('0x17')][_0x5f156c[_0x0bc6('0x33')]][_0x0bc6('0x5e')]=_0x5f156c[_0x0bc6('0x55')];this[_0x0bc6('0x17')][_0x5f156c[_0x0bc6('0x33')]][_0x0bc6('0x5f')]=_0x5f156c[_0x0bc6('0x57')];if(_0x5f156c['application']===_0x0bc6('0xa')&&_[_0x0bc6('0x60')](_0x5f156c[_0x0bc6('0x57')][_0x0bc6('0x56')](),_0x0bc6('0x61'))){var _0x3114d2=_0x5f156c[_0x0bc6('0x57')][_0x0bc6('0x3d')]('=');var _0x41a30b=_0x3114d2[0x0][_0x0bc6('0x56')]()[_0x0bc6('0x62')](/cdr\((.*)\)/);if(_0x41a30b){if(_0x41a30b[0x1]==='type'&&!_[_0x0bc6('0x63')](this['channels'][_0x5f156c[_0x0bc6('0x33')]][_0x41a30b[0x1]]))return;this[_0x0bc6('0x17')][_0x5f156c[_0x0bc6('0x33')]][_0x41a30b[0x1]]=_0x3114d2[0x1];}}else if(_0x5f156c[_0x0bc6('0x55')]===_0x0bc6('0x64')){this[_0x0bc6('0x17')][_0x5f156c['uniqueid']][_0x0bc6('0x64')]=_0x5f156c[_0x0bc6('0x57')][_0x0bc6('0x3d')](',')[0x0];}}}}}catch(_0xd00e92){logger[_0x0bc6('0x2b')](_0x0bc6('0x65'),_0x5f156c[_0x0bc6('0x33')],util['inspect'](_0xd00e92,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0bc6('0x2e')]['syncNewState']=function(_0x444240){try{if(this['isNotNull'](_0x444240)){logger['info'](_0x0bc6('0x66'),_0x444240['uniqueid'],_0x444240[_0x0bc6('0x37')],_0x444240['calleridname'],_0x444240[_0x0bc6('0x35')]);logger[_0x0bc6('0x47')](_0x0bc6('0x67'),_0x444240[_0x0bc6('0x33')],util[_0x0bc6('0x2d')](_0x444240,{'showHidden':![],'depth':null}));if(_0x444240[_0x0bc6('0x4e')]!=='6')return;var _0x2bde1f=this['agents'][_0x444240[_0x0bc6('0x3c')][_0x0bc6('0x3d')]('-')[0x0]];if(_0x444240[_0x0bc6('0x33')]!==_0x444240[_0x0bc6('0x37')]){var _0x3261b2=moment();if(this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x37')]]){if(!this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x37')]][_0x0bc6('0x68')]){this[_0x0bc6('0x17')][_0x444240['linkedid']]['answered']=!![];this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x37')]][_0x0bc6('0x69')]=_0x3261b2[_0x0bc6('0x42')](_0x0bc6('0x4c'));if(this[_0x0bc6('0x17')][_0x444240['linkedid']][_0x0bc6('0x4b')]){this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x37')]]['holdtime']=_0x3261b2[_0x0bc6('0x6a')](this[_0x0bc6('0x17')][_0x444240['linkedid']][_0x0bc6('0x4b')],_0x0bc6('0x5c'));}}this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x37')]][_0x0bc6('0x37')]=_0x444240[_0x0bc6('0x33')];if(_0x444240[_0x0bc6('0x35')]!==_0x0bc6('0x3f')){this['channels'][_0x444240[_0x0bc6('0x37')]][_0x0bc6('0x41')]=_0x444240[_0x0bc6('0x35')];}this[_0x0bc6('0x17')][_0x444240['linkedid']][_0x0bc6('0x6b')]=_0x444240['calleridname'];this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x37')]][_0x0bc6('0x6c')]=_0x444240[_0x0bc6('0x3c')];this['channels'][_0x444240['linkedid']][_0x0bc6('0x6d')]=dispositions[_[_0x0bc6('0x4d')](_0x444240[_0x0bc6('0x4e')])];if(_0x2bde1f){this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x37')]][_0x0bc6('0x6e')]=_0x2bde1f['id'];this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x37')]]['membername']=_0x2bde1f['name'];}}if(this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x33')]]){if(!this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x33')]]['answered']){this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x33')]][_0x0bc6('0x68')]=!![];this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x33')]][_0x0bc6('0x69')]=_0x3261b2['format'](_0x0bc6('0x4c'));if(this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x33')]][_0x0bc6('0x4b')]){this['channels'][_0x444240[_0x0bc6('0x33')]]['holdtime']=_0x3261b2[_0x0bc6('0x6a')](this['channels'][_0x444240['uniqueid']][_0x0bc6('0x4b')],_0x0bc6('0x5c'));}}if(_0x444240[_0x0bc6('0x35')]!==_0x0bc6('0x3f')){this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x33')]]['connectedlinenum']=_0x444240[_0x0bc6('0x35')];}this[_0x0bc6('0x17')][_0x444240['uniqueid']][_0x0bc6('0x6b')]=_0x444240[_0x0bc6('0x34')];this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x33')]][_0x0bc6('0x6c')]=_0x444240[_0x0bc6('0x3c')];this['channels'][_0x444240[_0x0bc6('0x33')]]['disposition']=dispositions[_[_0x0bc6('0x4d')](_0x444240[_0x0bc6('0x4e')])];}}else{if(this['channels'][_0x444240[_0x0bc6('0x33')]]){if(_0x2bde1f){this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x33')]][_0x0bc6('0x6e')]=_0x2bde1f['id'];this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x33')]][_0x0bc6('0x6f')]=_0x2bde1f[_0x0bc6('0x44')];}}}if(_0x444240[_0x0bc6('0x3a')]==='from-sip'){if(_0x2bde1f){_0x2bde1f[_0x0bc6('0x40')]=_0x444240[_0x0bc6('0x3e')];var _0x16ea05,_0x5c8790;if(this[_0x0bc6('0x17')][_0x444240['uniqueid']]){_0x16ea05=this[_0x0bc6('0x17')][_0x444240['uniqueid']][_0x0bc6('0x70')];_0x5c8790=this[_0x0bc6('0x17')][_0x444240['uniqueid']][_0x0bc6('0x64')];}else if(this[_0x0bc6('0x17')][_0x444240[_0x0bc6('0x37')]]){_0x16ea05=this['channels'][_0x444240[_0x0bc6('0x37')]][_0x0bc6('0x70')];_0x5c8790=this['channels'][_0x444240[_0x0bc6('0x37')]][_0x0bc6('0x64')];}_0x2bde1f[_0x0bc6('0x64')]=_0x5c8790;_0x2bde1f['routealias']=_0x16ea05;var _0x5d84bd={'id':_0x2bde1f['id'],'name':_0x2bde1f[_0x0bc6('0x44')],'agentconnected':!![],'destaccountcode':_0x2bde1f[_0x0bc6('0x45')],'destconnectedlinenum':_0x444240['exten'],'queue':_0x5c8790||undefined,'routealias':_0x16ea05,'uniqueid':_0x444240['linkedid']};logger['debug'](_0x0bc6('0x71'),_0x444240[_0x0bc6('0x33')],util[_0x0bc6('0x2d')](_0x5d84bd,{'showHidden':![],'depth':null}));this[_0x0bc6('0x31')](util[_0x0bc6('0x42')](_0x0bc6('0x43'),_0x2bde1f[_0x0bc6('0x44')]),_0x0bc6('0x52'),_0x5d84bd);}}}}catch(_0x5351bc){logger['error'](_0x0bc6('0x72'),_0x444240['uniqueid'],util[_0x0bc6('0x2d')](_0x5351bc,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0bc6('0x2e')][_0x0bc6('0x73')]=function(_0x54f7a9,_0x3c7c31){try{if(this[_0x0bc6('0x17')][_0x54f7a9]){logger[_0x0bc6('0x29')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x54f7a9,_0x3c7c31);this[_0x0bc6('0x17')][_0x54f7a9]['monitor']=!![];if(_[_0x0bc6('0x74')](_0x3c7c31,_0x0bc6('0x75'))){_0x3c7c31=_0x3c7c31[_0x0bc6('0x76')](_0x0bc6('0x75'),'.WAV');}this[_0x0bc6('0x17')][_0x54f7a9][_0x0bc6('0x77')]=_0x3c7c31;var _0x14927a=_[_0x0bc6('0x78')](this['channels'][_0x54f7a9][_0x0bc6('0x79')],{'filename':_0x3c7c31});if(_['isNil'](_0x14927a)){this[_0x0bc6('0x17')][_0x54f7a9][_0x0bc6('0x79')][_0x0bc6('0x7a')]({'filename':_0x3c7c31,'createdAt':moment()[_0x0bc6('0x42')](_0x0bc6('0x4c')),'mixmonitorid':'','status':'rec'});}}}catch(_0x219c48){logger[_0x0bc6('0x2b')](_0x0bc6('0x7b'),_0x54f7a9,util[_0x0bc6('0x2d')](_0x219c48,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0bc6('0x2e')][_0x0bc6('0x1f')]=function(_0x2b23bf){try{if(this[_0x0bc6('0x2f')](_0x2b23bf)){logger['debug'](_0x0bc6('0x7c'),_0x2b23bf[_0x0bc6('0x33')],util[_0x0bc6('0x2d')](_0x2b23bf,{'showHidden':![],'depth':null}));if(this[_0x0bc6('0x17')][_0x2b23bf[_0x0bc6('0x33')]]&&_0x2b23bf['channel']!=_0x0bc6('0x49')){if(this['isNotNull'](_0x2b23bf['variable'])){if(this[_0x0bc6('0x2f')](_0x2b23bf['variable']['mixmonitor_filename'])){logger[_0x0bc6('0x29')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x2b23bf[_0x0bc6('0x33')],_0x2b23bf['value']);this[_0x0bc6('0x73')](_0x2b23bf['uniqueid'],_0x2b23bf[_0x0bc6('0x7d')]);}else if(this[_0x0bc6('0x2f')](_0x2b23bf[_0x0bc6('0x7e')][_0x0bc6('0x7f')])){logger[_0x0bc6('0x29')](_0x0bc6('0x80'),_0x2b23bf[_0x0bc6('0x33')],_0x2b23bf['value']);this['channels'][_0x2b23bf[_0x0bc6('0x33')]][_0x0bc6('0x35')]=_0x2b23bf['value'];}else if(this[_0x0bc6('0x2f')](_0x2b23bf[_0x0bc6('0x7e')][_0x0bc6('0x81')])){logger['info'](_0x0bc6('0x82'),_0x2b23bf['uniqueid'],_0x2b23bf[_0x0bc6('0x7d')]);this[_0x0bc6('0x17')][_0x2b23bf['uniqueid']][_0x0bc6('0x83')]=_0x2b23bf[_0x0bc6('0x7d')];}else if(this[_0x0bc6('0x2f')](_0x2b23bf[_0x0bc6('0x7e')][_0x0bc6('0x84')])){logger[_0x0bc6('0x29')](_0x0bc6('0x85'),_0x2b23bf[_0x0bc6('0x33')],_0x2b23bf[_0x0bc6('0x7d')]);this[_0x0bc6('0x17')][_0x2b23bf[_0x0bc6('0x33')]][_0x0bc6('0x86')]=_0x2b23bf['value'];}else if(this[_0x0bc6('0x2f')](_0x2b23bf[_0x0bc6('0x7e')][_0x0bc6('0x87')])){logger[_0x0bc6('0x29')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x2b23bf['uniqueid'],_0x2b23bf[_0x0bc6('0x7d')][_0x0bc6('0x3d')](',')[0x0]);this[_0x0bc6('0x17')][_0x2b23bf['uniqueid']][_0x0bc6('0x64')]=_0x2b23bf['value'][_0x0bc6('0x3d')](',')[0x0];}else if(this[_0x0bc6('0x2f')](_0x2b23bf[_0x0bc6('0x7e')]['xmd-originatecalleridnum'])){logger[_0x0bc6('0x29')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x2b23bf['uniqueid'],_0x2b23bf[_0x0bc6('0x7d')]);this[_0x0bc6('0x17')][_0x2b23bf[_0x0bc6('0x33')]][_0x0bc6('0x88')]=_0x2b23bf[_0x0bc6('0x7d')];}else if(this['isNotNull'](_0x2b23bf['variable'][_0x0bc6('0x89')])){logger[_0x0bc6('0x29')](_0x0bc6('0x8a'),_0x2b23bf['uniqueid'],_0x2b23bf[_0x0bc6('0x7d')]);this[_0x0bc6('0x17')][_0x2b23bf['uniqueid']]['destination']=_0x2b23bf[_0x0bc6('0x7d')];}else if(this[_0x0bc6('0x2f')](_0x2b23bf[_0x0bc6('0x7e')][_0x0bc6('0x8b')])){logger[_0x0bc6('0x29')](_0x0bc6('0x8c'),_0x2b23bf[_0x0bc6('0x33')],_0x2b23bf[_0x0bc6('0x7d')]);this[_0x0bc6('0x17')][_0x2b23bf[_0x0bc6('0x33')]][_0x0bc6('0x8d')]=_0x2b23bf[_0x0bc6('0x7d')];}else if(this['isNotNull'](_0x2b23bf['variable'][_0x0bc6('0x8e')])){logger[_0x0bc6('0x29')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x2b23bf[_0x0bc6('0x33')],_0x2b23bf[_0x0bc6('0x7d')]);this['channels'][_0x2b23bf[_0x0bc6('0x33')]][_0x0bc6('0x64')]=_0x2b23bf[_0x0bc6('0x7d')];}else if(this[_0x0bc6('0x2f')](_0x2b23bf[_0x0bc6('0x7e')]['sipcallid'])){logger[_0x0bc6('0x29')](_0x0bc6('0x8f'),_0x2b23bf[_0x0bc6('0x33')],_0x2b23bf[_0x0bc6('0x7d')]);this[_0x0bc6('0x17')][_0x2b23bf['uniqueid']]['sipcalluniqueid']=_0x2b23bf['value'];}}}else if(this[_0x0bc6('0x2f')](_0x2b23bf['variable'][_0x0bc6('0x90')])){if(_0x2b23bf[_0x0bc6('0x7d')]){var _0x44e3ef=path['parse'](_0x2b23bf[_0x0bc6('0x7d')])[_0x0bc6('0x44')];logger[_0x0bc6('0x29')](_0x0bc6('0x91'),_0x44e3ef,_0x2b23bf[_0x0bc6('0x7d')]);this[_0x0bc6('0x73')](_0x44e3ef,_0x2b23bf[_0x0bc6('0x7d')]);}}else if(this['channels'][_0x2b23bf[_0x0bc6('0x37')]]){if(this[_0x0bc6('0x2f')](_0x2b23bf[_0x0bc6('0x7e')])){if(this['isNotNull'](_0x2b23bf['variable'][_0x0bc6('0x92')])){logger[_0x0bc6('0x29')](_0x0bc6('0x8f'),_0x2b23bf['linkedid'],_0x2b23bf[_0x0bc6('0x7d')]);this[_0x0bc6('0x17')][_0x2b23bf[_0x0bc6('0x37')]][_0x0bc6('0x93')]=_0x2b23bf['value'];}}}}}catch(_0x4f202c){logger['error'](_0x0bc6('0x94'),_0x2b23bf[_0x0bc6('0x33')],util[_0x0bc6('0x2d')](_0x4f202c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0bc6('0x2e')][_0x0bc6('0x21')]=function(_0x256fa9){try{if(this['isNotNull'](_0x256fa9)){logger[_0x0bc6('0x47')](_0x0bc6('0x95'),_0x256fa9[_0x0bc6('0x33')],util[_0x0bc6('0x2d')](_0x256fa9,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x256fa9['linkedid']]){if(this[_0x0bc6('0x17')][this['blindTransfers'][_0x256fa9['linkedid']][_0x0bc6('0x37')]]){this['channels'][this[_0x0bc6('0x19')][_0x256fa9[_0x0bc6('0x37')]][_0x0bc6('0x37')]][_0x0bc6('0x33')]=_0x256fa9[_0x0bc6('0x33')];this[_0x0bc6('0x17')][this['blindTransfers'][_0x256fa9[_0x0bc6('0x37')]][_0x0bc6('0x37')]][_0x0bc6('0x68')]=this[_0x0bc6('0x17')][_0x256fa9['uniqueid']][_0x0bc6('0x68')];this[_0x0bc6('0x17')][this[_0x0bc6('0x19')][_0x256fa9['linkedid']][_0x0bc6('0x37')]][_0x0bc6('0x69')]=this[_0x0bc6('0x17')][_0x256fa9[_0x0bc6('0x33')]][_0x0bc6('0x69')];this[_0x0bc6('0x17')][this['blindTransfers'][_0x256fa9[_0x0bc6('0x37')]][_0x0bc6('0x37')]][_0x0bc6('0x6c')]=this[_0x0bc6('0x17')][this[_0x0bc6('0x19')][_0x256fa9['linkedid']]['linkedid']]['channel'];this[_0x0bc6('0x17')][this[_0x0bc6('0x19')][_0x256fa9[_0x0bc6('0x37')]]['linkedid']][_0x0bc6('0x6d')]=this[_0x0bc6('0x17')][_0x256fa9[_0x0bc6('0x33')]][_0x0bc6('0x6d')];this[_0x0bc6('0x17')][_0x256fa9[_0x0bc6('0x33')]]=this[_0x0bc6('0x17')][this[_0x0bc6('0x19')][_0x256fa9['linkedid']]['linkedid']];delete this[_0x0bc6('0x17')][this[_0x0bc6('0x19')][_0x256fa9[_0x0bc6('0x37')]][_0x0bc6('0x37')]];}else if(this[_0x0bc6('0x17')][this[_0x0bc6('0x19')][_0x256fa9[_0x0bc6('0x37')]][_0x0bc6('0x33')]]){this[_0x0bc6('0x17')][this['blindTransfers'][_0x256fa9[_0x0bc6('0x37')]]['uniqueid']][_0x0bc6('0x33')]=[this[_0x0bc6('0x17')][this[_0x0bc6('0x19')][_0x256fa9[_0x0bc6('0x37')]]['uniqueid']][_0x0bc6('0x37')],this[_0x0bc6('0x17')][this[_0x0bc6('0x19')][_0x256fa9[_0x0bc6('0x37')]]['uniqueid']][_0x0bc6('0x37')]=this[_0x0bc6('0x17')][this[_0x0bc6('0x19')][_0x256fa9[_0x0bc6('0x37')]][_0x0bc6('0x33')]][_0x0bc6('0x33')]][0x0];this[_0x0bc6('0x17')][this[_0x0bc6('0x19')][_0x256fa9[_0x0bc6('0x37')]][_0x0bc6('0x33')]]['answered']=this['channels'][_0x256fa9['uniqueid']][_0x0bc6('0x68')];this['channels'][this['blindTransfers'][_0x256fa9[_0x0bc6('0x37')]][_0x0bc6('0x33')]]['answertime']=this[_0x0bc6('0x17')][_0x256fa9['uniqueid']]['answertime'];this[_0x0bc6('0x17')][this['blindTransfers'][_0x256fa9[_0x0bc6('0x37')]][_0x0bc6('0x33')]][_0x0bc6('0x6c')]=this[_0x0bc6('0x17')][this['blindTransfers'][_0x256fa9[_0x0bc6('0x37')]][_0x0bc6('0x33')]][_0x0bc6('0x3c')];this[_0x0bc6('0x17')][this[_0x0bc6('0x19')][_0x256fa9[_0x0bc6('0x37')]][_0x0bc6('0x33')]]['disposition']=this[_0x0bc6('0x17')][_0x256fa9['uniqueid']]['disposition'];this['channels'][_0x256fa9[_0x0bc6('0x33')]]=this[_0x0bc6('0x17')][this[_0x0bc6('0x19')][_0x256fa9[_0x0bc6('0x37')]][_0x0bc6('0x33')]];delete this['channels'][this[_0x0bc6('0x19')][_0x256fa9[_0x0bc6('0x37')]][_0x0bc6('0x33')]];}}if(this['channels'][_0x256fa9[_0x0bc6('0x33')]]){logger['info'](_0x0bc6('0x96'),_0x256fa9[_0x0bc6('0x33')],_0x256fa9[_0x0bc6('0x97')]);var _0x1452fa=moment();this['channels'][_0x256fa9['uniqueid']][_0x0bc6('0x98')]=_0x1452fa[_0x0bc6('0x42')](_0x0bc6('0x4c'));this[_0x0bc6('0x17')][_0x256fa9[_0x0bc6('0x33')]][_0x0bc6('0x5b')]=_0x1452fa[_0x0bc6('0x6a')](this['channels'][_0x256fa9['uniqueid']][_0x0bc6('0x4b')],_0x0bc6('0x5c'));if(this[_0x0bc6('0x17')][_0x256fa9['uniqueid']][_0x0bc6('0x68')]){this['channels'][_0x256fa9[_0x0bc6('0x33')]][_0x0bc6('0x99')]=_0x1452fa[_0x0bc6('0x6a')](this[_0x0bc6('0x17')][_0x256fa9[_0x0bc6('0x33')]][_0x0bc6('0x69')],'seconds');this[_0x0bc6('0x17')][_0x256fa9[_0x0bc6('0x33')]]['holdtime']=this[_0x0bc6('0x17')][_0x256fa9['uniqueid']][_0x0bc6('0x5b')]-this[_0x0bc6('0x17')][_0x256fa9['uniqueid']][_0x0bc6('0x99')];}if(_0x256fa9['context']===_0x0bc6('0x3b')){if(this[_0x0bc6('0x18')][_0x256fa9[_0x0bc6('0x3c')][_0x0bc6('0x3d')]('-')[0x0]]){this['agents'][_0x256fa9['channel']['split']('-')[0x0]]=_[_0x0bc6('0x9a')](this[_0x0bc6('0x18')][_0x256fa9['channel'][_0x0bc6('0x3d')]('-')[0x0]],[_0x0bc6('0x40')]);logger[_0x0bc6('0x47')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x256fa9['uniqueid'],util[_0x0bc6('0x2d')]({'id':this['agents'][_0x256fa9[_0x0bc6('0x3c')][_0x0bc6('0x3d')]('-')[0x0]]['id'],'destaccountcode':this[_0x0bc6('0x18')][_0x256fa9[_0x0bc6('0x3c')][_0x0bc6('0x3d')]('-')[0x0]][_0x0bc6('0x45')]},{'showHidden':![],'depth':null}));this[_0x0bc6('0x31')](util[_0x0bc6('0x42')](_0x0bc6('0x43'),this[_0x0bc6('0x18')][_0x256fa9[_0x0bc6('0x3c')]['split']('-')[0x0]][_0x0bc6('0x44')]),_0x0bc6('0x9b'),{'id':this[_0x0bc6('0x18')][_0x256fa9['channel'][_0x0bc6('0x3d')]('-')[0x0]]['id'],'destaccountcode':this[_0x0bc6('0x18')][_0x256fa9[_0x0bc6('0x3c')][_0x0bc6('0x3d')]('-')[0x0]]['accountcode']});for(var _0x1014fa=0x0;_0x1014fa0x0?!![]:![];if(!_0x529d29){return this[_0xc22f('0x19')](this[_0xc22f('0x14')][_0xc22f('0x6e')]);}};VoiceQueueReport[_0xc22f('0x3a')][_0xc22f('0x1b')]=function(_0x22b712){var _0x5994eb=this[_0xc22f('0x14')]['id'];if(this[_0xc22f('0x14')][_0xc22f('0x62')][_0x5994eb]&&this[_0xc22f('0x14')][_0xc22f('0x62')][_0x5994eb][_0x22b712['actionid']]){this['summary'][_0xc22f('0x62')][_0x5994eb][_0x22b712[_0xc22f('0x61')]][_0xc22f('0x10')][_0xc22f('0x6f')](_0x22b712);}};VoiceQueueReport[_0xc22f('0x3a')][_0xc22f('0x17')]=function(_0x51f943){var _0x3b3151=this;try{if(this[_0xc22f('0x5d')](_0x51f943)&&this[_0xc22f('0x5d')](_0x51f943[_0xc22f('0x52')])){logger[_0xc22f('0x54')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xc22f('0x44')](_0x51f943,{'showHidden':![],'depth':null}));var _0x52b289=this[_0xc22f('0x12')][_0x51f943[_0xc22f('0x52')]];if(_0x52b289){logger[_0xc22f('0x54')](_0xc22f('0x70'),_0x52b289[_0xc22f('0x5b')]);this[_0xc22f('0x14')][_0xc22f('0x64')][_0x52b289[_0xc22f('0x5b')]]={'summaryEvent':_0x51f943};this[_0xc22f('0x14')][_0xc22f('0x6d')]+=0x1;return ami['Action']({'action':_0xc22f('0x62'),'queue':_0x52b289[_0xc22f('0x5b')]})['then'](function(_0x385d25){if(!_0x3b3151[_0xc22f('0x14')][_0xc22f('0x62')][_0x51f943['actionid']]){_0x3b3151[_0xc22f('0x14')][_0xc22f('0x62')][_0x51f943[_0xc22f('0x61')]]={};}_0x3b3151['summary'][_0xc22f('0x62')][_0x51f943[_0xc22f('0x61')]][_0x385d25['actionid']]={'queue':_0x52b289[_0xc22f('0x5b')],'agents':[]};})[_0xc22f('0x40')](function(_0x1d8dc7){throw _0x1d8dc7;});}}}catch(_0x42ce57){logger['error'](_0xc22f('0x63'),util[_0xc22f('0x44')](_0x42ce57,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x1b1e4e){if(this['summary'][_0xc22f('0x6d')]>0x0){this[_0xc22f('0x14')]['completeEvent']=_0x1b1e4e;return;}logger[_0xc22f('0x54')](_0xc22f('0x71'),util[_0xc22f('0x44')](_0x1b1e4e,{'showHidden':![],'depth':null}));this[_0xc22f('0x14')]=initializeSummary();ami[_0xc22f('0x4b')](_0xc22f('0x72'),{});};VoiceQueueReport[_0xc22f('0x3a')]['syncQueueCallerJoin']=function(_0x3e6334){try{if(this[_0xc22f('0x5d')](_0x3e6334)){logger['debug'](_0xc22f('0x73'),_0x3e6334[_0xc22f('0x4f')],util['inspect'](_0x3e6334,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xc22f('0xe')][_0x3e6334[_0xc22f('0x4f')]])){this[_0xc22f('0xe')][_0x3e6334[_0xc22f('0x4f')]]=[];}if(_['isUndefined'](this[_0xc22f('0x3c')][_0x3e6334[_0xc22f('0x4f')]])){this[_0xc22f('0x3c')][_0x3e6334[_0xc22f('0x4f')]]={};}var _0x2e3f31=new QueueReport();_0x2e3f31['queue']=_0x3e6334[_0xc22f('0x52')];_0x2e3f31['type']=this[_0xc22f('0x12')][_0x2e3f31[_0xc22f('0x52')]]&&this[_0xc22f('0x12')][_0x2e3f31[_0xc22f('0x52')]][_0xc22f('0x6a')]?this[_0xc22f('0x12')][_0x2e3f31['queue']][_0xc22f('0x6a')]||'inbound':'inbound';_0x2e3f31[_0xc22f('0x74')]=moment()[_0xc22f('0x50')](_0xc22f('0x75'));_0x2e3f31['position']=_0x3e6334[_0xc22f('0x76')];_0x2e3f31['count']=_0x3e6334['count'];_0x2e3f31['uniqueid']=_0x3e6334['uniqueid'];_0x2e3f31[_0xc22f('0x77')]=this[_0xc22f('0x3c')][_0x3e6334[_0xc22f('0x4f')]]['routealias'];logger[_0xc22f('0x78')](_0xc22f('0x79'),_0x2e3f31[_0xc22f('0x52')],_0x2e3f31[_0xc22f('0x6a')]);Object[_0xc22f('0x68')](_0x2e3f31,_[_0xc22f('0x7a')](_0x3e6334,_[_0xc22f('0x7b')](_0x2e3f31)));this[_0xc22f('0xe')][_0x3e6334['uniqueid']][_0xc22f('0x6f')](_0x2e3f31);this['channels'][_0x3e6334[_0xc22f('0x4f')]]=_0x2e3f31;this['emitVoiceQueueChannelSave'](_0x2e3f31,_0xc22f('0x7c'));}}catch(_0x5727e8){logger['error'](_0xc22f('0x73'),_0x3e6334['uniqueid'],util['inspect'](_0x5727e8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc22f('0x1f')]=function(_0x156343){try{if(this[_0xc22f('0x5d')](_0x156343)){logger['debug'](_0xc22f('0x7d'),_0x156343['uniqueid'],util[_0xc22f('0x44')](_0x156343,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x156343[_0xc22f('0x4f')]]){var _0x3ce1fe=_['last'](this[_0xc22f('0xe')][_0x156343[_0xc22f('0x4f')]]);_0x3ce1fe[_0xc22f('0x39')]=![];_0x3ce1fe[_0xc22f('0x7e')]=null;_0x3ce1fe[_0xc22f('0x7f')]=_0x156343[_0xc22f('0x7f')];_0x3ce1fe[_0xc22f('0x80')]=_0x156343[_0xc22f('0x80')];_0x3ce1fe[_0xc22f('0x1e')]=!![];_0x3ce1fe[_0xc22f('0x81')]=moment()[_0xc22f('0x50')](_0xc22f('0x75'));_0x3ce1fe['queuecallerexitreason']='ABANDONED';_0x3ce1fe['lastAssignedTo']=null;logger['info'](_0xc22f('0x82'),_0x3ce1fe[_0xc22f('0x52')],_0x3ce1fe[_0xc22f('0x6a')]);this[_0xc22f('0x3c')][_0x156343[_0xc22f('0x4f')]]=_0x3ce1fe;this['emitVoiceQueueChannelRemove'](_0x3ce1fe,_0xc22f('0x1e'));}}}catch(_0x1f43b9){logger[_0xc22f('0x45')]('[%s][voiceQueueReport][queuecallerabandon]',_0x156343[_0xc22f('0x4f')],util[_0xc22f('0x44')](_0x1f43b9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc22f('0x83')]=function(_0x215377){try{if(this['isNotNull'](_0x215377)){logger[_0xc22f('0x54')](_0xc22f('0x84'),_0x215377[_0xc22f('0x4f')],util[_0xc22f('0x44')](_0x215377,{'showHidden':![],'depth':null}));if(this[_0xc22f('0xe')][_0x215377[_0xc22f('0x4f')]]){var _0x3d2b05=_[_0xc22f('0x85')](this['queueReports'][_0x215377[_0xc22f('0x4f')]]);_0x3d2b05[_0xc22f('0x86')]=moment()[_0xc22f('0x50')](_0xc22f('0x75'));_0x3d2b05['connectedlinenum']=_0x215377[_0xc22f('0x87')];_0x3d2b05['connectedlinename']=_0x215377[_0xc22f('0x88')];logger['info'](_0xc22f('0x89'),_0x3d2b05[_0xc22f('0x52')],_0x3d2b05[_0xc22f('0x6a')],_0x215377['connectedlinenum'],_0x215377[_0xc22f('0x88')]);this[_0xc22f('0x3c')][_0x215377[_0xc22f('0x4f')]]=_0x3d2b05;this[_0xc22f('0x4c')](_0x3d2b05,_0xc22f('0x20'));}}}catch(_0x5cd549){logger[_0xc22f('0x45')](_0xc22f('0x84'),_0x215377[_0xc22f('0x4f')],util[_0xc22f('0x44')](_0x5cd549,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc22f('0x24')]=function(_0x262ee4){try{if(this['isNotNull'](_0x262ee4)){logger[_0xc22f('0x54')]('[%s][voiceQueueReport][agentconnect]',_0x262ee4[_0xc22f('0x4f')],util[_0xc22f('0x44')](_0x262ee4,{'showHidden':![],'depth':null}));if(this[_0xc22f('0xe')][_0x262ee4[_0xc22f('0x4f')]]){var _0x520409=_['last'](this[_0xc22f('0xe')][_0x262ee4['uniqueid']]);_0x520409[_0xc22f('0x39')]=!![];_0x520409[_0xc22f('0x56')]=_0xc22f('0x8a');logger['info']('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x520409[_0xc22f('0x52')],_0x520409['type']);}}}catch(_0x3bf962){logger[_0xc22f('0x45')](_0xc22f('0x8b'),_0x262ee4[_0xc22f('0x4f')],util[_0xc22f('0x44')](_0x3bf962,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc22f('0x3a')][_0xc22f('0x22')]=function(_0x16f08b){try{if(this[_0xc22f('0x5d')](_0x16f08b)){logger[_0xc22f('0x54')]('[%s][voiceQueueReport][agentcomplete]',_0x16f08b['uniqueid'],util['inspect'](_0x16f08b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x16f08b[_0xc22f('0x4f')]]){var _0x1aed3a=_[_0xc22f('0x85')](this[_0xc22f('0xe')][_0x16f08b[_0xc22f('0x4f')]]);_0x1aed3a[_0xc22f('0x1e')]=![];_0x1aed3a[_0xc22f('0x81')]=null;_0x1aed3a[_0xc22f('0x8c')]=!![];_0x1aed3a[_0xc22f('0x8d')]=_0x16f08b[_0xc22f('0x8e')];_0x1aed3a[_0xc22f('0x7f')]=_0x16f08b[_0xc22f('0x7f')];_0x1aed3a[_0xc22f('0x39')]=!![];_0x1aed3a[_0xc22f('0x38')]=![];_0x1aed3a[_0xc22f('0x8f')]=null;if(!_0x1aed3a[_0xc22f('0x90')]){if(_0x16f08b[_0xc22f('0x91')]==_0xc22f('0x90')){_0x1aed3a[_0xc22f('0x56')]=_0xc22f('0x92');logger[_0xc22f('0x78')](_0xc22f('0x93'),_0x1aed3a[_0xc22f('0x52')],_0x1aed3a[_0xc22f('0x6a')]);}else{if(_[_0xc22f('0x94')](_0x16f08b['channel'][_0xc22f('0x95')](),_0xc22f('0x96'))){if(this['queueReports'][_0x16f08b['linkedid']]){var _0x5a8f39=_[_0xc22f('0x85')](this[_0xc22f('0xe')][_0x16f08b[_0xc22f('0x97')]]);_0x5a8f39[_0xc22f('0x39')]=![];_0x5a8f39[_0xc22f('0x38')]=!![];_0x5a8f39[_0xc22f('0x8f')]=moment(_0x1aed3a[_0xc22f('0x74')])[_0xc22f('0x98')](_0x16f08b[_0xc22f('0x7f')],_0xc22f('0x99'))['format'](_0xc22f('0x75'));_0x5a8f39['queuecallerexitreason']='FORWARDTRANSFER';_0x5a8f39['transfer']=!![];_0x5a8f39[_0xc22f('0x9a')]=_0xc22f('0x9b');_0x5a8f39[_0xc22f('0x9c')]=_0x16f08b['destexten'];_0x5a8f39[_0xc22f('0x9d')]=_0x16f08b[_0xc22f('0x4f')];logger[_0xc22f('0x78')](_0xc22f('0x9e'),_0x5a8f39[_0xc22f('0x52')],_0x5a8f39['type']);var _0x967298=this[_0xc22f('0xe')][_0x16f08b['linkedid']];this[_0xc22f('0xe')][_0x16f08b[_0xc22f('0x97')]]=this[_0xc22f('0xe')][_0x16f08b[_0xc22f('0x4f')]];this['queueReports'][_0x16f08b[_0xc22f('0x4f')]]=_0x967298;}}else{_0x1aed3a[_0xc22f('0x56')]=_0xc22f('0x9f')+_0x16f08b[_0xc22f('0x91')][_0xc22f('0xa0')]();logger[_0xc22f('0x78')](_0xc22f('0xa1'),_0x1aed3a['queue'],_0x1aed3a[_0xc22f('0x6a')],_0x1aed3a[_0xc22f('0x56')]);}}}this[_0xc22f('0x3c')][_0x16f08b['uniqueid']]=_0x1aed3a;}}}catch(_0x9b4009){logger[_0xc22f('0x45')](_0xc22f('0xa2'),_0x16f08b[_0xc22f('0x4f')],util['inspect'](_0x9b4009,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc22f('0x3a')]['syncVarSet']=function(_0x5ed025){try{if(this[_0xc22f('0x5d')](_0x5ed025)){logger[_0xc22f('0x54')](_0xc22f('0xa3'),_0x5ed025[_0xc22f('0x4f')],util[_0xc22f('0x44')](_0x5ed025,{'showHidden':![],'depth':null}));this[_0xc22f('0xa4')](_0x5ed025[_0xc22f('0x4f')],_[_0xc22f('0x7b')](_0x5ed025[_0xc22f('0xa5')])[0x0],_0x5ed025[_0xc22f('0xa6')]);if(this[_0xc22f('0xe')][_0x5ed025[_0xc22f('0x4f')]]){var _0x497d79=_['last'](this[_0xc22f('0xe')][_0x5ed025[_0xc22f('0x4f')]]);if(_0x497d79){if(this[_0xc22f('0x5d')](_0x5ed025[_0xc22f('0xa5')])&&this['isNotNull'](_0x5ed025[_0xc22f('0xa5')][_0xc22f('0x62')])){switch(_0x5ed025[_0xc22f('0xa6')]){case _0xc22f('0xa7'):_0x497d79[_0xc22f('0x38')]=![];_0x497d79[_0xc22f('0x8f')]=null;break;case _0xc22f('0xa8'):_0x497d79[_0xc22f('0xa9')]=_0xc22f('0xaa');_0x497d79[_0xc22f('0x38')]=!![];_0x497d79[_0xc22f('0x8f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x497d79[_0xc22f('0x86')]=moment()[_0xc22f('0x50')](_0xc22f('0x75'));logger[_0xc22f('0x54')](_0xc22f('0xab'),_0x5ed025[_0xc22f('0x4f')],util['inspect'](_0x497d79,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x497d79);break;default:_0x497d79[_0xc22f('0x38')]=!![];_0x497d79[_0xc22f('0x8f')]=moment()[_0xc22f('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x497d79[_0xc22f('0x86')]=moment()[_0xc22f('0x50')](_0xc22f('0x75'));}_0x497d79['queuecallerabandon']=![];_0x497d79[_0xc22f('0x81')]=null;_0x497d79[_0xc22f('0x56')]=_0x5ed025[_0xc22f('0xa6')];this['channels'][_0x5ed025[_0xc22f('0x4f')]]=_0x497d79;this[_0xc22f('0x49')](_0x497d79,_0xc22f('0x25'));}else if(this[_0xc22f('0x5d')](_0x5ed025[_0xc22f('0xa5')])&&this['isNotNull'](_0x5ed025[_0xc22f('0xa5')][_0xc22f('0xac')])){if(!_0x497d79[_0xc22f('0x1e')]){_0x497d79[_0xc22f('0x38')]=!![];_0x497d79[_0xc22f('0x8f')]=moment()['format'](_0xc22f('0x75'));_0x497d79[_0xc22f('0x56')]='EXITWITHKEY';_0x497d79[_0xc22f('0x86')]=moment()[_0xc22f('0x50')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5ed025[_0xc22f('0x4f')]]=_0x497d79;}}logger[_0xc22f('0x78')](_0xc22f('0xad'),_0x5ed025['uniqueid'],_0x497d79['queue'],_0x497d79[_0xc22f('0x6a')],_[_0xc22f('0x7b')](_0x5ed025[_0xc22f('0xa5')])[0x0],_0x5ed025[_0xc22f('0xa6')]);_0x497d79[_0xc22f('0x15')]=this[_0xc22f('0x15')][_0x5ed025[_0xc22f('0x4f')]];}}}}catch(_0x30ba63){logger[_0xc22f('0x45')](_0xc22f('0xa3'),_0x5ed025[_0xc22f('0x4f')],util[_0xc22f('0x44')](_0x30ba63,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc22f('0x3a')][_0xc22f('0xa4')]=function(_0x1aa2f7,_0x1fca9a,_0x552c91){var _0x1aadf8=[_0xc22f('0xae'),'rtpaudioqosbridged',_0xc22f('0xaf'),'rtpaudioqosjitterbridged',_0xc22f('0xb0'),_0xc22f('0xb1'),_0xc22f('0xb2'),_0xc22f('0xb3'),_0xc22f('0xb4'),'sipuri',_0xc22f('0xb5'),_0xc22f('0xb6'),_0xc22f('0xb7'),_0xc22f('0xb8'),_0xc22f('0xb9'),_0xc22f('0xba'),_0xc22f('0x8e'),'memberpenalty',_0xc22f('0xbb')];if(!_[_0xc22f('0x3d')](_0x1fca9a)&&!_['includes'](_0x1aadf8,_0x1fca9a)){if(_['isUndefined'](this[_0xc22f('0x15')][_0x1aa2f7])){this['variables'][_0x1aa2f7]={};}this['variables'][_0x1aa2f7][_0x1fca9a]=_0x552c91;}};VoiceQueueReport[_0xc22f('0x3a')][_0xc22f('0xbc')]=function(_0x4166e5,_0x7a1510,_0xad25c2){try{var _0x1c6d24={};if(this[_0xc22f('0xe')][_0x4166e5]){for(var _0x5cf933=0x0;_0x5cf9330x0?!![]:![];if(!_0x21565a){return this[_0xde5f('0x19')](this[_0xde5f('0x4b')][_0xde5f('0x6f')]);}};VoiceQueueReport[_0xde5f('0xb')]['syncQueueMember']=function(_0x610a83){var _0x5bb0ea=this['summary']['id'];if(this[_0xde5f('0x4b')]['queuestatus'][_0x5bb0ea]&&this['summary'][_0xde5f('0x6b')][_0x5bb0ea][_0x610a83['actionid']]){this['summary'][_0xde5f('0x6b')][_0x5bb0ea][_0x610a83['actionid']][_0xde5f('0x10')]['push'](_0x610a83);}};VoiceQueueReport['prototype']['syncQueueSummary']=function(_0x4182c1){var _0x25020c=this;try{if(this[_0xde5f('0x70')](_0x4182c1)&&this[_0xde5f('0x70')](_0x4182c1[_0xde5f('0x54')])){logger[_0xde5f('0x4f')](_0xde5f('0x71'),util[_0xde5f('0x47')](_0x4182c1,{'showHidden':![],'depth':null}));var _0x9d4fd7=this['voiceQueues'][_0x4182c1['queue']];if(_0x9d4fd7){logger['debug'](_0xde5f('0x72'),_0x9d4fd7[_0xde5f('0x66')]);this[_0xde5f('0x4b')][_0xde5f('0x60')][_0x9d4fd7[_0xde5f('0x66')]]={'summaryEvent':_0x4182c1};this[_0xde5f('0x4b')][_0xde5f('0x6e')]+=0x1;return ami[_0xde5f('0x40')]({'action':_0xde5f('0x6b'),'queue':_0x9d4fd7[_0xde5f('0x66')]})[_0xde5f('0x63')](function(_0x57febd){if(!_0x25020c[_0xde5f('0x4b')][_0xde5f('0x6b')][_0x4182c1[_0xde5f('0x64')]]){_0x25020c[_0xde5f('0x4b')]['queuestatus'][_0x4182c1[_0xde5f('0x64')]]={};}_0x25020c[_0xde5f('0x4b')][_0xde5f('0x6b')][_0x4182c1[_0xde5f('0x64')]][_0x57febd[_0xde5f('0x64')]]={'queue':_0x9d4fd7[_0xde5f('0x66')],'agents':[]};})[_0xde5f('0x43')](function(_0x52ede5){throw _0x52ede5;});}}}catch(_0x409e32){logger[_0xde5f('0x45')](_0xde5f('0x65'),util[_0xde5f('0x47')](_0x409e32,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xde5f('0xb')][_0xde5f('0x19')]=function(_0x39c07d){if(this[_0xde5f('0x4b')][_0xde5f('0x6e')]>0x0){this['summary']['completeEvent']=_0x39c07d;return;}logger[_0xde5f('0x4f')](_0xde5f('0x73'),util[_0xde5f('0x47')](_0x39c07d,{'showHidden':![],'depth':null}));this[_0xde5f('0x4b')]=initializeSummary();ami[_0xde5f('0x4e')](_0xde5f('0x74'),{});};VoiceQueueReport[_0xde5f('0xb')]['syncQueueCallerJoin']=function(_0x408110){try{if(this[_0xde5f('0x70')](_0x408110)){logger[_0xde5f('0x4f')](_0xde5f('0x75'),_0x408110[_0xde5f('0x51')],util[_0xde5f('0x47')](_0x408110,{'showHidden':![],'depth':null}));if(_[_0xde5f('0x76')](this['queueReports'][_0x408110[_0xde5f('0x51')]])){this[_0xde5f('0xe')][_0x408110[_0xde5f('0x51')]]=[];}if(_['isUndefined'](this[_0xde5f('0x3c')][_0x408110[_0xde5f('0x51')]])){this[_0xde5f('0x3c')][_0x408110[_0xde5f('0x51')]]={};}var _0x5f385d=new QueueReport();_0x5f385d[_0xde5f('0x54')]=_0x408110['queue'];_0x5f385d[_0xde5f('0x5d')]=this[_0xde5f('0x12')][_0x5f385d[_0xde5f('0x54')]]&&this[_0xde5f('0x12')][_0x5f385d[_0xde5f('0x54')]][_0xde5f('0x5d')]?this[_0xde5f('0x12')][_0x5f385d[_0xde5f('0x54')]][_0xde5f('0x5d')]||_0xde5f('0x5e'):_0xde5f('0x5e');_0x5f385d['queuecallerjoinAt']=moment()[_0xde5f('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x5f385d[_0xde5f('0x77')]=_0x408110['position'];_0x5f385d[_0xde5f('0x78')]=_0x408110[_0xde5f('0x78')];_0x5f385d['uniqueid']=_0x408110[_0xde5f('0x51')];_0x5f385d[_0xde5f('0x79')]=this[_0xde5f('0x3c')][_0x408110[_0xde5f('0x51')]][_0xde5f('0x79')];logger[_0xde5f('0x7a')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x5f385d['queue'],_0x5f385d[_0xde5f('0x5d')]);Object[_0xde5f('0x6a')](_0x5f385d,_[_0xde5f('0x7b')](_0x408110,_[_0xde5f('0x7c')](_0x5f385d)));this['queueReports'][_0x408110[_0xde5f('0x51')]]['push'](_0x5f385d);this[_0xde5f('0x3c')][_0x408110[_0xde5f('0x51')]]=_0x5f385d;this[_0xde5f('0x7d')](_0x5f385d,_0xde5f('0x1d'));}}catch(_0x63017a){logger[_0xde5f('0x45')](_0xde5f('0x75'),_0x408110[_0xde5f('0x51')],util[_0xde5f('0x47')](_0x63017a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xde5f('0xb')]['syncQueueCallerAbandon']=function(_0x4be8e7){try{if(this[_0xde5f('0x70')](_0x4be8e7)){logger['debug'](_0xde5f('0x7e'),_0x4be8e7[_0xde5f('0x51')],util[_0xde5f('0x47')](_0x4be8e7,{'showHidden':![],'depth':null}));if(this[_0xde5f('0xe')][_0x4be8e7[_0xde5f('0x51')]]){var _0x5d1a5e=_[_0xde5f('0x7f')](this[_0xde5f('0xe')][_0x4be8e7[_0xde5f('0x51')]]);_0x5d1a5e[_0xde5f('0x80')]=![];_0x5d1a5e['queuecallercompleteAt']=null;_0x5d1a5e[_0xde5f('0x81')]=_0x4be8e7[_0xde5f('0x81')];_0x5d1a5e[_0xde5f('0x82')]=_0x4be8e7[_0xde5f('0x82')];_0x5d1a5e[_0xde5f('0x1f')]=!![];_0x5d1a5e[_0xde5f('0x83')]=moment()[_0xde5f('0x52')](_0xde5f('0x84'));_0x5d1a5e['queuecallerexitreason']=_0xde5f('0x85');_0x5d1a5e['lastAssignedTo']=null;logger[_0xde5f('0x7a')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x5d1a5e[_0xde5f('0x54')],_0x5d1a5e['type']);this['channels'][_0x4be8e7['uniqueid']]=_0x5d1a5e;this['emitVoiceQueueChannelRemove'](_0x5d1a5e,_0xde5f('0x1f'));}}}catch(_0x403bcc){logger[_0xde5f('0x45')](_0xde5f('0x7e'),_0x4be8e7[_0xde5f('0x51')],util[_0xde5f('0x47')](_0x403bcc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xde5f('0xb')][_0xde5f('0x22')]=function(_0x200c21){try{if(this[_0xde5f('0x70')](_0x200c21)){logger['debug'](_0xde5f('0x86'),_0x200c21[_0xde5f('0x51')],util[_0xde5f('0x47')](_0x200c21,{'showHidden':![],'depth':null}));if(this[_0xde5f('0xe')][_0x200c21['uniqueid']]){var _0x49f188=_[_0xde5f('0x7f')](this[_0xde5f('0xe')][_0x200c21[_0xde5f('0x51')]]);_0x49f188['queuecallerleaveAt']=moment()[_0xde5f('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x49f188[_0xde5f('0x87')]=_0x200c21[_0xde5f('0x87')];_0x49f188[_0xde5f('0x88')]=_0x200c21['connectedlinename'];logger[_0xde5f('0x7a')](_0xde5f('0x89'),_0x49f188[_0xde5f('0x54')],_0x49f188[_0xde5f('0x5d')],_0x200c21[_0xde5f('0x87')],_0x200c21[_0xde5f('0x88')]);this[_0xde5f('0x3c')][_0x200c21[_0xde5f('0x51')]]=_0x49f188;this[_0xde5f('0x7d')](_0x49f188,'queuecallerleave');}}}catch(_0x53468c){logger[_0xde5f('0x45')](_0xde5f('0x86'),_0x200c21[_0xde5f('0x51')],util[_0xde5f('0x47')](_0x53468c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xde5f('0x25')]=function(_0x30c97f){try{if(this['isNotNull'](_0x30c97f)){logger[_0xde5f('0x4f')](_0xde5f('0x8a'),_0x30c97f[_0xde5f('0x51')],util['inspect'](_0x30c97f,{'showHidden':![],'depth':null}));if(this[_0xde5f('0xe')][_0x30c97f[_0xde5f('0x51')]]){var _0x159135=_[_0xde5f('0x7f')](this[_0xde5f('0xe')][_0x30c97f['uniqueid']]);_0x159135['queuecallercomplete']=!![];_0x159135[_0xde5f('0x59')]=_0xde5f('0x8b');logger[_0xde5f('0x7a')](_0xde5f('0x8c'),_0x159135['queue'],_0x159135['type']);}}}catch(_0x57ce1b){logger[_0xde5f('0x45')](_0xde5f('0x8a'),_0x30c97f[_0xde5f('0x51')],util['inspect'](_0x57ce1b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xde5f('0xb')][_0xde5f('0x23')]=function(_0x53e3a6){try{if(this[_0xde5f('0x70')](_0x53e3a6)){logger[_0xde5f('0x4f')]('[%s][voiceQueueReport][agentcomplete]',_0x53e3a6[_0xde5f('0x51')],util[_0xde5f('0x47')](_0x53e3a6,{'showHidden':![],'depth':null}));if(this[_0xde5f('0xe')][_0x53e3a6['uniqueid']]){var _0x5a68c6=_[_0xde5f('0x7f')](this[_0xde5f('0xe')][_0x53e3a6[_0xde5f('0x51')]]);_0x5a68c6[_0xde5f('0x1f')]=![];_0x5a68c6[_0xde5f('0x83')]=null;_0x5a68c6['assigned']=!![];_0x5a68c6[_0xde5f('0x8d')]=_0x53e3a6[_0xde5f('0x8e')];_0x5a68c6['holdtime']=_0x53e3a6[_0xde5f('0x81')];_0x5a68c6['queuecallercomplete']=!![];_0x5a68c6[_0xde5f('0x3a')]=![];_0x5a68c6[_0xde5f('0x8f')]=null;if(!_0x5a68c6[_0xde5f('0x90')]){if(_0x53e3a6[_0xde5f('0x91')]==_0xde5f('0x90')){_0x5a68c6['queuecallerexitreason']=_0xde5f('0x92');logger[_0xde5f('0x7a')](_0xde5f('0x93'),_0x5a68c6[_0xde5f('0x54')],_0x5a68c6['type']);}else{if(_['startsWith'](_0x53e3a6[_0xde5f('0x42')][_0xde5f('0x94')](),_0xde5f('0x95'))){if(this[_0xde5f('0xe')][_0x53e3a6['linkedid']]){var _0x14c872=_[_0xde5f('0x7f')](this[_0xde5f('0xe')][_0x53e3a6[_0xde5f('0x96')]]);_0x14c872['queuecallercomplete']=![];_0x14c872['queuecallerexit']=!![];_0x14c872['queuecallerexitAt']=moment(_0x5a68c6[_0xde5f('0x97')])[_0xde5f('0x98')](_0x53e3a6[_0xde5f('0x81')],_0xde5f('0x99'))[_0xde5f('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x14c872[_0xde5f('0x59')]=_0xde5f('0x9a');_0x14c872[_0xde5f('0x90')]=!![];_0x14c872['transfertype']=_0xde5f('0x9b');_0x14c872['transferexten']=_0x53e3a6[_0xde5f('0x9c')];_0x14c872[_0xde5f('0x9d')]=_0x53e3a6[_0xde5f('0x51')];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x14c872[_0xde5f('0x54')],_0x14c872[_0xde5f('0x5d')]);var _0x5a5bf8=this[_0xde5f('0xe')][_0x53e3a6[_0xde5f('0x96')]];this['queueReports'][_0x53e3a6['linkedid']]=this[_0xde5f('0xe')][_0x53e3a6[_0xde5f('0x51')]];this[_0xde5f('0xe')][_0x53e3a6['uniqueid']]=_0x5a5bf8;}}else{_0x5a68c6[_0xde5f('0x59')]=_0xde5f('0x9e')+_0x53e3a6[_0xde5f('0x91')][_0xde5f('0x9f')]();logger[_0xde5f('0x7a')](_0xde5f('0xa0'),_0x5a68c6[_0xde5f('0x54')],_0x5a68c6['type'],_0x5a68c6[_0xde5f('0x59')]);}}}this[_0xde5f('0x3c')][_0x53e3a6[_0xde5f('0x51')]]=_0x5a68c6;}}}catch(_0x1a4303){logger[_0xde5f('0x45')]('[%s][voiceQueueReport][agentcomplete]',_0x53e3a6[_0xde5f('0x51')],util['inspect'](_0x1a4303,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xde5f('0xb')][_0xde5f('0x27')]=function(_0x2d80d7){try{if(this[_0xde5f('0x70')](_0x2d80d7)){logger[_0xde5f('0x4f')](_0xde5f('0xa1'),_0x2d80d7[_0xde5f('0x51')],util['inspect'](_0x2d80d7,{'showHidden':![],'depth':null}));this[_0xde5f('0xa2')](_0x2d80d7[_0xde5f('0x51')],_[_0xde5f('0x7c')](_0x2d80d7[_0xde5f('0xa3')])[0x0],_0x2d80d7['value']);if(this[_0xde5f('0xe')][_0x2d80d7[_0xde5f('0x51')]]){var _0x51df6d=_[_0xde5f('0x7f')](this[_0xde5f('0xe')][_0x2d80d7['uniqueid']]);if(_0x51df6d){if(this['isNotNull'](_0x2d80d7[_0xde5f('0xa3')])&&this[_0xde5f('0x70')](_0x2d80d7[_0xde5f('0xa3')]['queuestatus'])){switch(_0x2d80d7[_0xde5f('0xa4')]){case _0xde5f('0xa5'):_0x51df6d[_0xde5f('0x3a')]=![];_0x51df6d[_0xde5f('0x8f')]=null;break;case _0xde5f('0xa6'):_0x51df6d['lastevent']=_0xde5f('0xa7');_0x51df6d[_0xde5f('0x3a')]=!![];_0x51df6d[_0xde5f('0x8f')]=moment()[_0xde5f('0x52')](_0xde5f('0x84'));_0x51df6d['queuecallerleaveAt']=moment()[_0xde5f('0x52')](_0xde5f('0x84'));logger[_0xde5f('0x4f')](_0xde5f('0xa8'),_0x2d80d7[_0xde5f('0x51')],util[_0xde5f('0x47')](_0x51df6d,{'showHidden':![],'depth':null}));ami['emit'](_0xde5f('0xa9'),_0x51df6d);break;default:_0x51df6d['queuecallerexit']=!![];_0x51df6d['queuecallerexitAt']=moment()['format'](_0xde5f('0x84'));_0x51df6d[_0xde5f('0xaa')]=moment()[_0xde5f('0x52')](_0xde5f('0x84'));}_0x51df6d[_0xde5f('0x1f')]=![];_0x51df6d['queuecallerabandonAt']=null;_0x51df6d[_0xde5f('0x59')]=_0x2d80d7[_0xde5f('0xa4')];this[_0xde5f('0x3c')][_0x2d80d7[_0xde5f('0x51')]]=_0x51df6d;this[_0xde5f('0x4c')](_0x51df6d,_0xde5f('0x26'));}else if(this[_0xde5f('0x70')](_0x2d80d7[_0xde5f('0xa3')])&&this[_0xde5f('0x70')](_0x2d80d7['variable'][_0xde5f('0xab')])){if(!_0x51df6d[_0xde5f('0x1f')]){_0x51df6d[_0xde5f('0x3a')]=!![];_0x51df6d[_0xde5f('0x8f')]=moment()[_0xde5f('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x51df6d[_0xde5f('0x59')]=_0xde5f('0xac');_0x51df6d[_0xde5f('0xaa')]=moment()[_0xde5f('0x52')](_0xde5f('0x84'));this[_0xde5f('0x3c')][_0x2d80d7['uniqueid']]=_0x51df6d;}}logger[_0xde5f('0x7a')](_0xde5f('0xad'),_0x2d80d7['uniqueid'],_0x51df6d[_0xde5f('0x54')],_0x51df6d[_0xde5f('0x5d')],_[_0xde5f('0x7c')](_0x2d80d7[_0xde5f('0xa3')])[0x0],_0x2d80d7[_0xde5f('0xa4')]);_0x51df6d[_0xde5f('0x14')]=this[_0xde5f('0x14')][_0x2d80d7['uniqueid']];}}}}catch(_0x26e6c3){logger[_0xde5f('0x45')](_0xde5f('0xa1'),_0x2d80d7[_0xde5f('0x51')],util[_0xde5f('0x47')](_0x26e6c3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xde5f('0xb')][_0xde5f('0xa2')]=function(_0x3f9822,_0x26d579,_0xa1fc34){var _0xe0e1cd=[_0xde5f('0xae'),_0xde5f('0xaf'),_0xde5f('0xb0'),_0xde5f('0xb1'),'rtpaudioqosloss',_0xde5f('0xb2'),_0xde5f('0xb3'),'rtpaudioqosrttbridged',_0xde5f('0xb4'),_0xde5f('0xb5'),'bridgepeer',_0xde5f('0xb6'),_0xde5f('0xb7'),'memberdynamic','memberinterface',_0xde5f('0xb8'),'membername',_0xde5f('0xb9'),'memberrealtime'];if(!_[_0xde5f('0x3f')](_0x26d579)&&!_[_0xde5f('0xba')](_0xe0e1cd,_0x26d579)){if(_[_0xde5f('0x76')](this['variables'][_0x3f9822])){this[_0xde5f('0x14')][_0x3f9822]={};}this['variables'][_0x3f9822][_0x26d579]=_0xa1fc34;}};VoiceQueueReport['prototype'][_0xde5f('0xbb')]=function(_0x54bbc7,_0x3444b9,_0x3f18da){try{var _0x480d31={};if(this[_0xde5f('0xe')][_0x54bbc7]){for(var _0x15af61=0x0;_0x15af61=0x0?moment(_0x42f29a[_0x059e('0x16')])[_0x059e('0xb')](_0x42f29a['starttime'],_0x059e('0xc')):null,'data1':_0x059e('0x17'),'data2':_0x42f29a[_0x059e('0x11')],'data3':_0x42f29a['exten'],'data4':_0x42f29a[_0x059e('0x18')]||null,'role':'agent','internal':_0x42f29a[_0x059e('0x11')]?_[_0x059e('0x10')](_0x42f29a[_0x059e('0x11')]):undefined,'uniqueid':_0x42f29a[_0x059e('0x19')]},'log':_0x059e('0x4')});}; \ No newline at end of file +var _0xd349=['../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','queuecallerleaveAt','calleridnum','exten','queue','agent','accountcode','toNumber','voiceDialReport','membername','starttime','endtime','seconds','diff','outbound','uniqueid','moment','lodash'];(function(_0x2fb87c,_0x2dee49){var _0x43038b=function(_0x7e5396){while(--_0x7e5396){_0x2fb87c['push'](_0x2fb87c['shift']());}};_0x43038b(++_0x2dee49);}(_0xd349,0x116));var _0x9d34=function(_0x2271fd,_0x4e5372){_0x2271fd=_0x2271fd-0x0;var _0xbbe4d2=_0xd349[_0x2271fd];return _0xbbe4d2;};'use strict';var moment=require(_0x9d34('0x0'));var _=require(_0x9d34('0x1'));var util=require('util');var client=require(_0x9d34('0x2'));exports[_0x9d34('0x3')]=function(_0x5033d4){var _0x54e545=_0x5033d4[_0x9d34('0x4')]||_0x5033d4[_0x9d34('0x5')];return client[_0x9d34('0x6')](_0x9d34('0x7'),{'body':{'channel':_0x9d34('0x8'),'membername':_0x5033d4[_0x9d34('0x9')],'interface':_[_0x9d34('0xa')](_0x5033d4[_0x9d34('0xb')])?util[_0x9d34('0xc')]('SIP/%s',_0x5033d4[_0x9d34('0x9')]):_0x5033d4[_0x9d34('0xb')],'type':'TALKING','enterAt':_0x5033d4[_0x9d34('0xd')],'exitAt':_0x54e545,'duration':moment(_0x54e545)['diff'](_0x5033d4[_0x9d34('0xd')],'seconds'),'data1':'inbound','data2':_0x5033d4[_0x9d34('0xe')],'data3':_0x5033d4[_0x9d34('0xf')],'data4':null,'data5':_0x5033d4[_0x9d34('0x10')],'role':_0x9d34('0x11'),'internal':_0x5033d4[_0x9d34('0x12')]?_[_0x9d34('0x13')](_0x5033d4['accountcode']):undefined,'uniqueid':_0x5033d4['uniqueid']},'log':_0x9d34('0x7')});};exports[_0x9d34('0x14')]=function(_0x497397){return client[_0x9d34('0x6')](_0x9d34('0x7'),{'body':{'channel':_0x9d34('0x8'),'membername':_0x497397[_0x9d34('0x15')],'interface':_0x497397[_0x9d34('0xb')],'type':'TALKING','enterAt':_0x497397[_0x9d34('0x16')],'exitAt':_0x497397[_0x9d34('0x17')],'duration':moment(_0x497397[_0x9d34('0x17')])['diff'](_0x497397[_0x9d34('0x16')],_0x9d34('0x18'))>=0x0?moment(_0x497397[_0x9d34('0x17')])[_0x9d34('0x19')](_0x497397['starttime'],_0x9d34('0x18')):null,'data1':_0x9d34('0x1a'),'data2':_0x497397[_0x9d34('0x12')],'data3':_0x497397['exten'],'data4':_0x497397['dialstring']||null,'role':_0x9d34('0x11'),'internal':_0x497397['accountcode']?_[_0x9d34('0x13')](_0x497397[_0x9d34('0x12')]):undefined,'uniqueid':_0x497397[_0x9d34('0x1b')]},'log':_0x9d34('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index f04f2e1..9746ac0 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 _0x160f=['ShowSetting','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request'];(function(_0x22a7b5,_0x10f1d2){var _0x485df3=function(_0x411563){while(--_0x411563){_0x22a7b5['push'](_0x22a7b5['shift']());}};_0x485df3(++_0x10f1d2);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xf160('0x0'));exports[_0xf160('0x1')]=function(){return client[_0xf160('0x2')](_0xf160('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0xf160('0x4')]},'log':_0xf160('0x5')});}; \ No newline at end of file +var _0x180d=['Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','getSettings'];(function(_0x3ee0d8,_0x1e34e0){var _0x4203d8=function(_0x4e4194){while(--_0x4e4194){_0x3ee0d8['push'](_0x3ee0d8['shift']());}};_0x4203d8(++_0x1e34e0);}(_0x180d,0xf9));var _0xd180=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x180d[_0x1d24eb];return _0x1dc576;};'use strict';var client=require('../client');exports[_0xd180('0x0')]=function(){return client[_0xd180('0x1')](_0xd180('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd180('0x3'),_0xd180('0x4')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index cafdaad..99ac409 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 _0xd60e=['name','html','../client','getTemplates','Request','GetTemplate'];(function(_0x332998,_0x2d99c7){var _0x460be7=function(_0x1a4d24){while(--_0x1a4d24){_0x332998['push'](_0x332998['shift']());}};_0x460be7(++_0x2d99c7);}(_0xd60e,0x1d6));var _0xed60=function(_0x41874a,_0x38d2f0){_0x41874a=_0x41874a-0x0;var _0x1f22c4=_0xd60e[_0x41874a];return _0x1f22c4;};'use strict';var client=require(_0xed60('0x0'));exports[_0xed60('0x1')]=function(_0x210168){return function(_0x5a5433){return client[_0xed60('0x2')](_0xed60('0x3'),{'options':{'raw':!![],'attributes':['id',_0xed60('0x4'),_0xed60('0x5')]},'log':_0xed60('0x3')});};}; \ No newline at end of file +var _0xcb10=['../client','getTemplates','Request','name','GetTemplate'];(function(_0x3f39ab,_0x16c981){var _0x170952=function(_0x45e049){while(--_0x45e049){_0x3f39ab['push'](_0x3f39ab['shift']());}};_0x170952(++_0x16c981);}(_0xcb10,0x104));var _0x0cb1=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xcb10[_0x29d915];return _0x160f86;};'use strict';var client=require(_0x0cb1('0x0'));exports[_0x0cb1('0x1')]=function(_0x568ead){return function(_0x8e770b){return client[_0x0cb1('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x0cb1('0x3'),'html']},'log':_0x0cb1('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 1b89389..ca10451 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 _0x6e15=['channel','Condition','AllConditions','field','operator','value','action','data4','data6','../client','getTriggers','GetTrigger','name'];(function(_0x4633f9,_0x91b9a9){var _0x2404ee=function(_0xd8347e){while(--_0xd8347e){_0x4633f9['push'](_0x4633f9['shift']());}};_0x2404ee(++_0x91b9a9);}(_0x6e15,0x1dd));var _0x56e1=function(_0x373f25,_0x587bf6){_0x373f25=_0x373f25-0x0;var _0x562019=_0x6e15[_0x373f25];return _0x562019;};'use strict';var client=require(_0x56e1('0x0'));exports[_0x56e1('0x1')]=function(_0x582b76){return function(_0x2d79eb){return client['Request'](_0x56e1('0x2'),{'options':{'raw':![],'attributes':['id',_0x56e1('0x3'),_0x56e1('0x4'),'status'],'include':[{'model':_0x56e1('0x5'),'as':_0x56e1('0x6'),'attributes':['id',_0x56e1('0x7'),_0x56e1('0x8'),'value']},{'model':_0x56e1('0x5'),'as':'AnyConditions','attributes':['id',_0x56e1('0x7'),_0x56e1('0x8'),_0x56e1('0x9')]},{'model':'Action','as':'Actions','attributes':['id',_0x56e1('0xa'),'data1','data2','data3',_0x56e1('0xb'),'data5',_0x56e1('0xc'),'data7']}]},'log':_0x56e1('0x2')});};}; \ No newline at end of file +var _0x3250=['value','Action','data1','data2','data4','data5','data7','GetTrigger','../client','getTriggers','Request','name','status','Condition','AllConditions','field','operator'];(function(_0x25e9ff,_0x3f0c8b){var _0x1cc069=function(_0x5e29b1){while(--_0x5e29b1){_0x25e9ff['push'](_0x25e9ff['shift']());}};_0x1cc069(++_0x3f0c8b);}(_0x3250,0x18f));var _0x0325=function(_0x3a5dee,_0x434e05){_0x3a5dee=_0x3a5dee-0x0;var _0x1c4f75=_0x3250[_0x3a5dee];return _0x1c4f75;};'use strict';var client=require(_0x0325('0x0'));exports[_0x0325('0x1')]=function(_0x11c37c){return function(_0x58d9d){return client[_0x0325('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x0325('0x3'),'channel',_0x0325('0x4')],'include':[{'model':_0x0325('0x5'),'as':_0x0325('0x6'),'attributes':['id',_0x0325('0x7'),_0x0325('0x8'),_0x0325('0x9')]},{'model':_0x0325('0x5'),'as':'AnyConditions','attributes':['id','field','operator',_0x0325('0x9')]},{'model':_0x0325('0xa'),'as':'Actions','attributes':['id','action',_0x0325('0xb'),_0x0325('0xc'),'data3',_0x0325('0xd'),_0x0325('0xe'),'data6',_0x0325('0xf')]}]},'log':_0x0325('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 8b77288..063095f 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 _0xac65=['GetTrunk','name','defaultuser','../client','getTrunks','Request'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0xac65,0x11d));var _0x5ac6=function(_0x4f7414,_0x3d39f3){_0x4f7414=_0x4f7414-0x0;var _0x20bcb9=_0xac65[_0x4f7414];return _0x20bcb9;};'use strict';var client=require(_0x5ac6('0x0'));exports[_0x5ac6('0x1')]=function(_0x11c244){return function(_0x550314){return client[_0x5ac6('0x2')](_0x5ac6('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x5ac6('0x4'),'registry',_0x5ac6('0x5')]},'log':_0x5ac6('0x3')});};}; \ No newline at end of file +var _0xd8eb=['name','registry','defaultuser','GetTrunk','../client','getTrunks','Request'];(function(_0x326d35,_0x4f65b3){var _0xd3f8f3=function(_0x1fbbaf){while(--_0x1fbbaf){_0x326d35['push'](_0x326d35['shift']());}};_0xd3f8f3(++_0x4f65b3);}(_0xd8eb,0x66));var _0xbd8e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xd8eb[_0x13ea00];return _0x1f7347;};'use strict';var client=require(_0xbd8e('0x0'));exports[_0xbd8e('0x1')]=function(_0x56d701){return function(_0x23449b){return client[_0xbd8e('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xbd8e('0x3'),_0xbd8e('0x4'),_0xbd8e('0x5')]},'log':_0xbd8e('0x6')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 261cd75..6a3d140 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 _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file +var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 4f032b3..25ebee0 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 _0xee4a=['CreateVoiceAgentReport','UpdateVoiceAgentReport','Request'];(function(_0x5a385f,_0x2c54a2){var _0x38a126=function(_0xc9ff2a){while(--_0xc9ff2a){_0x5a385f['push'](_0x5a385f['shift']());}};_0x38a126(++_0x2c54a2);}(_0xee4a,0x125));var _0xaee4=function(_0x2e48be,_0x3ebece){_0x2e48be=_0x2e48be-0x0;var _0x485bb6=_0xee4a[_0x2e48be];return _0x485bb6;};'use strict';var client=require('../client');exports['create']=function(_0x3af793){return client[_0xaee4('0x0')](_0xaee4('0x1'),{'body':_0x3af793,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x23783e,_0x2b6f25,_0x305106){return client['Request'](_0xaee4('0x2'),{'body':_0x23783e,'options':{'where':{'uniqueid':_0x2b6f25,'interface':_0x305106,'agentcomplete':!![]}},'log':_0xaee4('0x2')});}; \ No newline at end of file +var _0xbc4c=['Request','CreateVoiceAgentReport','update','../client','create'];(function(_0x31b950,_0x48a4e9){var _0x415d87=function(_0x42cb07){while(--_0x42cb07){_0x31b950['push'](_0x31b950['shift']());}};_0x415d87(++_0x48a4e9);}(_0xbc4c,0x198));var _0xcbc4=function(_0x4fa291,_0x56e289){_0x4fa291=_0x4fa291-0x0;var _0x506d9b=_0xbc4c[_0x4fa291];return _0x506d9b;};'use strict';var client=require(_0xcbc4('0x0'));exports[_0xcbc4('0x1')]=function(_0x41a7a8){return client[_0xcbc4('0x2')](_0xcbc4('0x3'),{'body':_0x41a7a8,'log':_0xcbc4('0x3')});};exports[_0xcbc4('0x4')]=function(_0x124b38,_0x3664d4,_0x5bc6f5){return client[_0xcbc4('0x2')]('UpdateVoiceAgentReport',{'body':_0x124b38,'options':{'where':{'uniqueid':_0x3664d4,'interface':_0x5bc6f5,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 6386b08..bcf71d4 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 _0x2e90=['endOf','type','disposition','duration','GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','context','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x2e90,0xd6));var _0x02e9=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2e90[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require('moment');var util=require(_0x02e9('0x0'));var _=require(_0x02e9('0x1'));var client=require(_0x02e9('0x2'));exports[_0x02e9('0x3')]=function(_0x4e6f99){return client[_0x02e9('0x4')](_0x02e9('0x5'),{'body':_[_0x02e9('0x6')](_0x4e6f99,{'source':_0x4e6f99['calleridnum'],'destinationcontext':_0x4e6f99[_0x02e9('0x7')],'callerid':_0x4e6f99['callerid'],'amaflags':_0x02e9('0x8')}),'log':_0x02e9('0x5')});};exports[_0x02e9('0x9')]=function(){return function(){return client[_0x02e9('0x4')](_0x02e9('0xa'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x02e9('0xb')]('day')[_0x02e9('0xc')](_0x02e9('0xd')),moment()[_0x02e9('0xe')]('day')[_0x02e9('0xc')](_0x02e9('0xd'))]}},'attributes':[_0x02e9('0xf'),_0x02e9('0x10'),_0x02e9('0x11'),'billableseconds']},'log':_0x02e9('0x12')});};}; \ No newline at end of file +var _0xbe83=['startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','Request','merge','calleridnum','callerid','getVoiceCallReports','GetVoiceCallReport','outbound'];(function(_0x175e89,_0x20835f){var _0x2ed996=function(_0x56239f){while(--_0x56239f){_0x175e89['push'](_0x175e89['shift']());}};_0x2ed996(++_0x20835f);}(_0xbe83,0x129));var _0x3be8=function(_0x4f2505,_0x4b730c){_0x4f2505=_0x4f2505-0x0;var _0x3e20fc=_0xbe83[_0x4f2505];return _0x3e20fc;};'use strict';var moment=require('moment');var util=require('util');var _=require('lodash');var client=require('../client');exports['create']=function(_0x110475){return client[_0x3be8('0x0')]('CreateVoiceCallReport',{'body':_[_0x3be8('0x1')](_0x110475,{'source':_0x110475[_0x3be8('0x2')],'destinationcontext':_0x110475['context'],'callerid':_0x110475[_0x3be8('0x3')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0x3be8('0x4')]=function(){return function(){return client[_0x3be8('0x0')](_0x3be8('0x5'),{'options':{'where':{'type':[_0x3be8('0x6')],'createdAt':{'$between':[moment()[_0x3be8('0x7')](_0x3be8('0x8'))[_0x3be8('0x9')](_0x3be8('0xa')),moment()['endOf'](_0x3be8('0x8'))['format'](_0x3be8('0xa'))]}},'attributes':[_0x3be8('0xb'),_0x3be8('0xc'),_0x3be8('0xd'),_0x3be8('0xe')]},'log':_0x3be8('0xf')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 620233a..4077ac9 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 _0xb3e8=['create','Request','CreateVoiceDialReport','../client'];(function(_0x58b308,_0x548a0d){var _0x102ec9=function(_0x2ad03b){while(--_0x2ad03b){_0x58b308['push'](_0x58b308['shift']());}};_0x102ec9(++_0x548a0d);}(_0xb3e8,0x13b));var _0x8b3e=function(_0x13eec2,_0xe78b42){_0x13eec2=_0x13eec2-0x0;var _0x46c367=_0xb3e8[_0x13eec2];return _0x46c367;};'use strict';var client=require(_0x8b3e('0x0'));exports[_0x8b3e('0x1')]=function(_0x19676b){return client[_0x8b3e('0x2')](_0x8b3e('0x3'),{'body':_0x19676b,'log':_0x8b3e('0x3')});}; \ No newline at end of file +var _0x39d9=['create','Request','CreateVoiceDialReport','../client'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x39d9,0x1eb));var _0x939d=function(_0xae9689,_0x4df061){_0xae9689=_0xae9689-0x0;var _0x16ee93=_0x39d9[_0xae9689];return _0x16ee93;};'use strict';var client=require(_0x939d('0x0'));exports[_0x939d('0x1')]=function(_0x98668a){return client[_0x939d('0x2')](_0x939d('0x3'),{'body':_0x98668a,'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 61d28f3..e451015 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 _0x96cc=['Request','exten','recordingFormat','getVoiceExtensions','../client'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0x96cc,0x16c));var _0xc96c=function(_0x48a4bc,_0x19e9aa){_0x48a4bc=_0x48a4bc-0x0;var _0x1a27bd=_0x96cc[_0x48a4bc];return _0x1a27bd;};'use strict';var client=require(_0xc96c('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xc96c('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xc96c('0x2'),_0xc96c('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xc96c('0x4')});};}; \ No newline at end of file +var _0xee11=['getVoiceExtensions','../client','GetVoiceExtension','exten','recordingFormat'];(function(_0x21390e,_0x1d5444){var _0x17defd=function(_0xe0964){while(--_0xe0964){_0x21390e['push'](_0x21390e['shift']());}};_0x17defd(++_0x1d5444);}(_0xee11,0x146));var _0x1ee1=function(_0x23629f,_0x4b37fa){_0x23629f=_0x23629f-0x0;var _0x4d810a=_0xee11[_0x23629f];return _0x4d810a;};'use strict';var client=require(_0x1ee1('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0x1ee1('0x1'),{'options':{'raw':!![],'attributes':['id',_0x1ee1('0x2'),_0x1ee1('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x1ee1('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 0876a60..48fcfb9 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 _0xf8ec=['../client','Request','name','acw','monitor_format','type','dialActive','dialMethod','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','getVoiceQueues'];(function(_0x4595c7,_0x1dfd25){var _0x506697=function(_0x1c8196){while(--_0x1c8196){_0x4595c7['push'](_0x4595c7['shift']());}};_0x506697(++_0x1dfd25);}(_0xf8ec,0xec));var _0xcf8e=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xf8ec[_0x3ff085];return _0x2b68c3;};'use strict';var client=require(_0xcf8e('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xcf8e('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xcf8e('0x2'),_0xcf8e('0x3'),'acwTimeout','autopause',_0xcf8e('0x4'),_0xcf8e('0x5'),_0xcf8e('0x6'),_0xcf8e('0x7'),'dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization',_0xcf8e('0x8'),_0xcf8e('0x9'),_0xcf8e('0xa'),_0xcf8e('0xb'),_0xcf8e('0xc'),_0xcf8e('0xd'),_0xcf8e('0xe'),_0xcf8e('0xf'),_0xcf8e('0x10'),'dialCongestionRetryFrequency',_0xcf8e('0x11'),_0xcf8e('0x12'),_0xcf8e('0x13'),_0xcf8e('0x14'),'dialGlobalMaxRetry',_0xcf8e('0x15'),_0xcf8e('0x16'),_0xcf8e('0x17'),_0xcf8e('0x18'),_0xcf8e('0x19'),_0xcf8e('0x1a'),_0xcf8e('0x1b'),_0xcf8e('0x1c'),_0xcf8e('0x1d'),_0xcf8e('0x1e'),'dialAMDBetweenWordsSilence',_0xcf8e('0x1f'),'dialAMDSilenceThreshold',_0xcf8e('0x20'),'timeout','dialRecallMeTimeout',_0xcf8e('0x21'),_0xcf8e('0x22'),_0xcf8e('0x23'),_0xcf8e('0x24'),'dialQueueProject2',_0xcf8e('0x4'),_0xcf8e('0x25'),_0xcf8e('0x26'),_0xcf8e('0x27'),'dialNoSuchNumberMaxRetry',_0xcf8e('0x28'),_0xcf8e('0x29'),_0xcf8e('0x2a'),'dialAbandonedMaxRetry',_0xcf8e('0x2b'),_0xcf8e('0x2c'),_0xcf8e('0x2d'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0xcf8e('0x2e'),_0xcf8e('0x2f'),'dialPredictiveIntervalMinThreshold',_0xcf8e('0x30'),_0xcf8e('0x31')],'include':[{'model':_0xcf8e('0x32'),'as':_0xcf8e('0x32'),'attributes':['id','name',_0xcf8e('0x33'),_0xcf8e('0x34')]},{'model':_0xcf8e('0x35'),'as':_0xcf8e('0x36'),'attributes':['id',_0xcf8e('0x2')]},{'model':'Trunk','as':_0xcf8e('0x37'),'attributes':['id',_0xcf8e('0x2'),'callerid','active']},{'model':_0xcf8e('0x38'),'as':_0xcf8e('0x38'),'attributes':['id',_0xcf8e('0x2')],'include':[{'model':_0xcf8e('0x38'),'as':_0xcf8e('0x39'),'attributes':['id',_0xcf8e('0x2'),'interval']}]}]},'log':_0xcf8e('0x3a')});};}; \ No newline at end of file +var _0xe8b7=['dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callerid','active','Trunk','TrunkBackup','Interval','Intervals','getVoiceQueues','../client','name','acwTimeout','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xe8b7,0x65));var _0x7e8b=function(_0x147e1b,_0x184638){_0x147e1b=_0x147e1b-0x0;var _0x2fba00=_0xe8b7[_0x147e1b];return _0x2fba00;};'use strict';var client=require(_0x7e8b('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x7e8b('0x1'),'acw',_0x7e8b('0x2'),'autopause',_0x7e8b('0x3'),'type',_0x7e8b('0x4'),_0x7e8b('0x5'),_0x7e8b('0x6'),_0x7e8b('0x7'),_0x7e8b('0x8'),'dialPredictiveOptimization',_0x7e8b('0x9'),_0x7e8b('0xa'),_0x7e8b('0xb'),'dialOriginateCallerIdNumber',_0x7e8b('0xc'),_0x7e8b('0xd'),_0x7e8b('0xe'),_0x7e8b('0xf'),_0x7e8b('0x10'),'dialCongestionRetryFrequency',_0x7e8b('0x11'),_0x7e8b('0x12'),_0x7e8b('0x13'),_0x7e8b('0x14'),_0x7e8b('0x15'),'dialTimezone',_0x7e8b('0x16'),_0x7e8b('0x17'),_0x7e8b('0x18'),_0x7e8b('0x19'),_0x7e8b('0x1a'),'dialAMDGreeting',_0x7e8b('0x1b'),_0x7e8b('0x1c'),_0x7e8b('0x1d'),_0x7e8b('0x1e'),_0x7e8b('0x1f'),_0x7e8b('0x20'),_0x7e8b('0x21'),_0x7e8b('0x22'),_0x7e8b('0x23'),_0x7e8b('0x24'),_0x7e8b('0x25'),_0x7e8b('0x26'),_0x7e8b('0x27'),'dialQueueProject2',_0x7e8b('0x3'),_0x7e8b('0x28'),_0x7e8b('0x29'),_0x7e8b('0x2a'),_0x7e8b('0x2b'),_0x7e8b('0x2c'),_0x7e8b('0x2d'),_0x7e8b('0x2e'),_0x7e8b('0x2f'),_0x7e8b('0x30'),'dialMachineMaxRetry',_0x7e8b('0x31'),_0x7e8b('0x32'),'dialAgentRejectRetryFrequency',_0x7e8b('0x33'),_0x7e8b('0x34'),_0x7e8b('0x35'),_0x7e8b('0x36'),_0x7e8b('0x37')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0x7e8b('0x1'),_0x7e8b('0x38'),_0x7e8b('0x39')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id',_0x7e8b('0x1')]},{'model':_0x7e8b('0x3a'),'as':_0x7e8b('0x3b'),'attributes':['id',_0x7e8b('0x1'),_0x7e8b('0x38'),'active']},{'model':_0x7e8b('0x3c'),'as':_0x7e8b('0x3c'),'attributes':['id',_0x7e8b('0x1')],'include':[{'model':_0x7e8b('0x3c'),'as':_0x7e8b('0x3d'),'attributes':['id',_0x7e8b('0x1'),'interval']}]}]},'log':_0x7e8b('0x3e')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 33264b8..ad72eb2 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(_0x332d20,_0x5aad16){var _0x51bbe8=function(_0x3f6506){while(--_0x3f6506){_0x332d20['push'](_0x332d20['shift']());}};_0x51bbe8(++_0x5aad16);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x3bd9e9,_0x3df6ae){var _0x52ffae=function(_0x5e55ee){while(--_0x5e55ee){_0x3bd9e9['push'](_0x3bd9e9['shift']());}};_0x52ffae(++_0x3df6ae);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 bb11c99..769de93 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 _0x7ada=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x2d9f8b,_0x1eca48){var _0x251209=function(_0x15205f){while(--_0x15205f){_0x2d9f8b['push'](_0x2d9f8b['shift']());}};_0x251209(++_0x1eca48);}(_0x7ada,0x1c3));var _0xa7ad=function(_0x2e247d,_0x683d0d){_0x2e247d=_0x2e247d-0x0;var _0x55bb63=_0x7ada[_0x2e247d];return _0x55bb63;};'use strict';var client=require(_0xa7ad('0x0'));exports[_0xa7ad('0x1')]=function(_0x4bc94d){return function(){return client[_0xa7ad('0x2')](_0xa7ad('0x3'),{'options':{'where':{'VoiceQueueId':_0x4bc94d,'paused':!![]},'raw':!![]},'log':_0xa7ad('0x1')});};}; \ No newline at end of file +var _0xa270=['../client','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x130933,_0x29c0d7){var _0xcf661=function(_0x42267d){while(--_0x42267d){_0x130933['push'](_0x130933['shift']());}};_0xcf661(++_0x29c0d7);}(_0xa270,0x1b9));var _0x0a27=function(_0x5f1027,_0x17f3da){_0x5f1027=_0x5f1027-0x0;var _0x19ba16=_0xa270[_0x5f1027];return _0x19ba16;};'use strict';var client=require(_0x0a27('0x0'));exports['getVoiceQueueRtPauses']=function(_0x422deb){return function(){return client['Request'](_0x0a27('0x1'),{'options':{'where':{'VoiceQueueId':_0x422deb,'paused':!![]},'raw':!![]},'log':_0x0a27('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 5731238..f84d0a0 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 _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0xa34f16,_0x497d3c){var _0x4bb70c=function(_0x1740d4){while(--_0x1740d4){_0xa34f16['push'](_0xa34f16['shift']());}};_0x4bb70c(++_0x497d3c);}(_0x7a54,0x106));var _0x47a5=function(_0x4a039d,_0x21cf6a){_0x4a039d=_0x4a039d-0x0;var _0x4c76a3=_0x7a54[_0x4a039d];return _0x4c76a3;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x42f34c,_0xa168a1){var _0x5343cd=function(_0x5e04ae){while(--_0x5e04ae){_0x42f34c['push'](_0x42f34c['shift']());}};_0x5343cd(++_0xa168a1);}(_0x7a54,0x106));var _0x47a5=function(_0x10c468,_0x17f72a){_0x10c468=_0x10c468-0x0;var _0x7ed762=_0x7a54[_0x10c468];return _0x7ed762;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 7dfc727..807c068 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 _0x88ed=['secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','context','extension','blind','origtransferercalleridnum'];(function(_0x13d33a,_0x5b250a){var _0x46d32f=function(_0x5dcc20){while(--_0x5dcc20){_0x13d33a['push'](_0x13d33a['shift']());}};_0x46d32f(++_0x5b250a);}(_0x88ed,0x178));var _0xd88e=function(_0x1987c2,_0x25e5ea){_0x1987c2=_0x1987c2-0x0;var _0x3fbcf3=_0x88ed[_0x1987c2];return _0x3fbcf3;};'use strict';var client=require('../client');exports[_0xd88e('0x0')]={};exports[_0xd88e('0x1')]=function(_0x3221b6){return client[_0xd88e('0x2')](_0xd88e('0x3'),{'body':{'result':_0x3221b6[_0xd88e('0x4')],'transfererchannel':_0x3221b6[_0xd88e('0x5')],'transferercalleridnum':_0x3221b6[_0xd88e('0x6')],'transferercalleridname':_0x3221b6[_0xd88e('0x7')],'transfererconnectedlinenum':_0x3221b6[_0xd88e('0x8')],'transfererconnectedlinename':_0x3221b6['transfererconnectedlinename'],'transfereraccountcode':_0x3221b6['transfereraccountcode'],'transferercontext':_0x3221b6[_0xd88e('0x9')],'transfererexten':_0x3221b6[_0xd88e('0xa')],'transfererlinkedid':_0x3221b6[_0xd88e('0xb')],'transfereechannel':_0x3221b6['transfereechannel'],'transfereecalleridnum':_0x3221b6[_0xd88e('0xc')],'transfereecalleridname':_0x3221b6['transfereecalleridname'],'transfereeconnectedlinenum':_0x3221b6['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x3221b6[_0xd88e('0xd')],'transfereeaccountcode':_0x3221b6[_0xd88e('0xe')],'transfereecontext':_0x3221b6['transfereecontext'],'transfereeexten':_0x3221b6[_0xd88e('0xf')],'transfereelinkedid':_0x3221b6['transfereelinkedid'],'isexternal':_0x3221b6['isexternal'],'context':_0x3221b6[_0xd88e('0x10')],'extension':_0x3221b6[_0xd88e('0x11')],'type':_0xd88e('0x12')},'log':_0xd88e('0x3')});};exports['attendedTransfer']=function(_0x2b084e){return client[_0xd88e('0x2')](_0xd88e('0x3'),{'body':{'result':_0x2b084e[_0xd88e('0x4')],'transfererchannel':_0x2b084e['origtransfererchannel'],'transferercalleridnum':_0x2b084e[_0xd88e('0x13')],'transferercalleridname':_0x2b084e['origtransferercalleridname'],'transfererconnectedlinenum':_0x2b084e[_0xd88e('0x14')],'transfererconnectedlinename':_0x2b084e[_0xd88e('0x15')],'transfereraccountcode':_0x2b084e['origtransfereraccountcode'],'transferercontext':_0x2b084e[_0xd88e('0x16')],'transfererexten':_0x2b084e[_0xd88e('0x17')],'transfererlinkedid':_0x2b084e['origtransfererlinkedid'],'transfereechannel':_0x2b084e['transfertargetchannel'],'transfereecalleridnum':_0x2b084e[_0xd88e('0x18')],'transfereecalleridname':_0x2b084e[_0xd88e('0x19')],'transfereeconnectedlinenum':_0x2b084e[_0xd88e('0x1a')],'transfereeconnectedlinename':_0x2b084e[_0xd88e('0x1b')],'transfereeaccountcode':_0x2b084e[_0xd88e('0x1c')],'transfereecontext':_0x2b084e[_0xd88e('0x1d')],'transfereeexten':_0x2b084e[_0xd88e('0x1e')],'transfereelinkedid':_0x2b084e[_0xd88e('0x1f')],'isexternal':_0x2b084e[_0xd88e('0x20')],'context':_0x2b084e[_0xd88e('0x21')],'extension':_0x2b084e[_0xd88e('0x22')],'type':_0xd88e('0x23')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x602d=['result','transfererchannel','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport'];(function(_0x4d5ca7,_0x2f12e9){var _0x3d3a80=function(_0x3da673){while(--_0x3da673){_0x4d5ca7['push'](_0x4d5ca7['shift']());}};_0x3d3a80(++_0x2f12e9);}(_0x602d,0x178));var _0xd602=function(_0x1f6a39,_0x211be6){_0x1f6a39=_0x1f6a39-0x0;var _0x769d6b=_0x602d[_0x1f6a39];return _0x769d6b;};'use strict';var client=require('../client');exports[_0xd602('0x0')]={};exports[_0xd602('0x1')]=function(_0x34115a){return client[_0xd602('0x2')](_0xd602('0x3'),{'body':{'result':_0x34115a[_0xd602('0x4')],'transfererchannel':_0x34115a[_0xd602('0x5')],'transferercalleridnum':_0x34115a['transferercalleridnum'],'transferercalleridname':_0x34115a['transferercalleridname'],'transfererconnectedlinenum':_0x34115a[_0xd602('0x6')],'transfererconnectedlinename':_0x34115a[_0xd602('0x7')],'transfereraccountcode':_0x34115a['transfereraccountcode'],'transferercontext':_0x34115a[_0xd602('0x8')],'transfererexten':_0x34115a[_0xd602('0x9')],'transfererlinkedid':_0x34115a[_0xd602('0xa')],'transfereechannel':_0x34115a[_0xd602('0xb')],'transfereecalleridnum':_0x34115a[_0xd602('0xc')],'transfereecalleridname':_0x34115a['transfereecalleridname'],'transfereeconnectedlinenum':_0x34115a[_0xd602('0xd')],'transfereeconnectedlinename':_0x34115a[_0xd602('0xe')],'transfereeaccountcode':_0x34115a[_0xd602('0xf')],'transfereecontext':_0x34115a['transfereecontext'],'transfereeexten':_0x34115a[_0xd602('0x10')],'transfereelinkedid':_0x34115a[_0xd602('0x11')],'isexternal':_0x34115a[_0xd602('0x12')],'context':_0x34115a[_0xd602('0x13')],'extension':_0x34115a[_0xd602('0x14')],'type':_0xd602('0x15')},'log':'CreateVoiceTransferReport'});};exports[_0xd602('0x16')]=function(_0x5ebf9b){return client[_0xd602('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x5ebf9b[_0xd602('0x4')],'transfererchannel':_0x5ebf9b[_0xd602('0x17')],'transferercalleridnum':_0x5ebf9b['origtransferercalleridnum'],'transferercalleridname':_0x5ebf9b[_0xd602('0x18')],'transfererconnectedlinenum':_0x5ebf9b['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x5ebf9b[_0xd602('0x19')],'transfereraccountcode':_0x5ebf9b[_0xd602('0x1a')],'transferercontext':_0x5ebf9b[_0xd602('0x1b')],'transfererexten':_0x5ebf9b[_0xd602('0x1c')],'transfererlinkedid':_0x5ebf9b['origtransfererlinkedid'],'transfereechannel':_0x5ebf9b['transfertargetchannel'],'transfereecalleridnum':_0x5ebf9b['transfertargetcalleridnum'],'transfereecalleridname':_0x5ebf9b[_0xd602('0x1d')],'transfereeconnectedlinenum':_0x5ebf9b[_0xd602('0x1e')],'transfereeconnectedlinename':_0x5ebf9b[_0xd602('0x1f')],'transfereeaccountcode':_0x5ebf9b[_0xd602('0x20')],'transfereecontext':_0x5ebf9b['transfertargetcontext'],'transfereeexten':_0x5ebf9b[_0xd602('0x21')],'transfereelinkedid':_0x5ebf9b[_0xd602('0x22')],'isexternal':_0x5ebf9b[_0xd602('0x12')],'context':_0x5ebf9b[_0xd602('0x23')],'extension':_0x5ebf9b[_0xd602('0x24')],'type':_0xd602('0x25')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index b250117..5108d6d 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(_0x2463fc,_0x42f267){var _0x1bc15c=function(_0x18a06d){while(--_0x18a06d){_0x2463fc['push'](_0x2463fc['shift']());}};_0x1bc15c(++_0x42f267);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a3dc0,_0xfb849e){_0x4a3dc0=_0x4a3dc0-0x0;var _0x233760=_0xb10b[_0x4a3dc0];return _0x233760;};'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(_0x493eb0,_0x408801){var _0x96b589=function(_0x432fc6){while(--_0x432fc6){_0x493eb0['push'](_0x493eb0['shift']());}};_0x96b589(++_0x408801);}(_0xb10b,0x12a));var _0xbb10=function(_0x3fa8ee,_0x3b350d){_0x3fa8ee=_0x3fa8ee-0x0;var _0x36a857=_0xb10b[_0x3fa8ee];return _0x36a857;};'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 7305b40..82289e0 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 _0x4874=['length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','trigger:%s','action','toLowerCase','merge','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x4874,0x12a));var _0x4487=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x4874[_0x2fc012];return _0x2891f9;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0x4487('0x0'));var util=require(_0x4487('0x1'));var config=require(_0x4487('0x2'));var logger=require(_0x4487('0x3'))(_0x4487('0x4'));var cmContactRpc=require(_0x4487('0x5'));config['redis']=_['defaults'](config[_0x4487('0x6')],{'host':_0x4487('0x7'),'port':0x18eb});var io=require(_0x4487('0x8'))(new Redis(config[_0x4487('0x6')]));function emit(_0x5813b4,_0x46bcf6,_0x3a3b99,_0x158fa4,_0x4210b8){logger[_0x4487('0x9')](_0x4487('0xa'),_0x5813b4,_0x46bcf6['id'],_0x3a3b99,_0x158fa4,JSON[_0x4487('0xb')](_0x4210b8));io['to'](_0x3a3b99)[_0x4487('0xc')](_0x158fa4,_0x4210b8);}exports[_0x4487('0xd')]=function(_0x307e71,_0x69e8d,_0x2d2842,_0x110520){var _0xdcb719,_0x58ce1c;var _0x1cd87b={};var _0x1b346a;var _0x3f08ff=Number(_0x2d2842[_0x4487('0xe')]);var _0x50322c=_0x2d2842[_0x4487('0xf')]?Boolean(Number(_0x2d2842[_0x4487('0xf')])):![];var _0x5d4e1d;var _0x43f637=![];if(!_[_0x4487('0x10')](_0x2d2842['data5'])){if(_0x2d2842[_0x4487('0x11')]=='1')_0x43f637=!![];}if(!_0x43f637){if(_0x110520[_0x4487('0x12')]){_0x1cd87b['id']=_0x110520[_0x4487('0x12')];}}if(!_0x1cd87b['id']){_0x1cd87b[_0x4487('0x13')]=_0x3f08ff;_0x5d4e1d=_0x2d2842['data3']&&_0x2d2842[_0x4487('0x14')]!=='0'?_0x2d2842[_0x4487('0x14')][_0x4487('0x15')](','):[_0x4487('0x16')];_0x1cd87b['$or']=_[_0x4487('0x17')](_0x5d4e1d,function(_0x3d8936){var _0x551f9f={};_0x551f9f[_0x3d8936]=_0x110520[_0x4487('0x18')]?_0x110520[_0x4487('0x19')]:_0x110520[_0x4487('0x1a')];return _0x551f9f;});_0x1b346a=_0x110520[_0x4487('0x18')]?_0x110520[_0x4487('0x19')]:_0x110520[_0x4487('0x1a')];}var _0x142fae=['id',_0x4487('0x1b'),_0x4487('0x1c'),_0x4487('0x16'),_0x4487('0x1d'),_0x4487('0x1e'),'ListId',_0x4487('0x1f'),_0x4487('0x20'),_0x4487('0x21')];var _0x42ad93=_[_0x4487('0x22')](_0x142fae,_0x5d4e1d);BPromise[_0x4487('0x23')]()[_0x4487('0x24')](cmContactRpc[_0x4487('0x25')]({'attributes':_0x42ad93,'where':_0x1cd87b,'phone':_0x1b346a}))[_0x4487('0x24')](function(_0x431d73){_0x58ce1c=_0x431d73;if(!_['isEmpty'](_0x58ce1c)){if(_0x58ce1c[_0x4487('0x26')]===0x1){_0xdcb719=_0x58ce1c[0x0];logger[_0x4487('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x110520[_0x4487('0x27')],_0x69e8d['id'],_0xdcb719['id']);}else{logger['info'](_0x4487('0x28'),_0x110520[_0x4487('0x27')],_0x69e8d['id'],_[_0x4487('0x17')](_0x58ce1c,'id')['join'](','));}return;}else{logger[_0x4487('0x9')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x110520['uniqueid'],_0x69e8d['id']);var _0xa20ef2={'ListId':_0x3f08ff};var _0xa9a26f=_0x2d2842[_0x4487('0x29')]&&_0x2d2842[_0x4487('0x29')]!=='0'?_0x2d2842['data4']:_0x4487('0x16');if(_0x50322c){logger['info'](_0x4487('0x2a'),_0x110520[_0x4487('0x27')],_0x69e8d['id']);_0xa20ef2[_0xa9a26f]=_[_0x4487('0x10')](_0x110520['routeId'])?_0x110520[_0x4487('0x1a')]:_0x110520['destcalleridnum'];if(_[_0x4487('0x10')](_0x110520[_0x4487('0x18')])){_0xa20ef2[_0x4487('0x1b')]=_0x110520[_0x4487('0x2b')]&&_0x110520[_0x4487('0x2b')]!==_0x4487('0x2c')?_0x110520['calleridname']:'Unknown';}else{_0xa20ef2[_0x4487('0x1b')]=_0x110520[_0x4487('0x2d')]&&_0x110520['destcalleridname']!==''?_0x110520['destcalleridname']:_0x4487('0x2e');}return BPromise[_0x4487('0x23')]()[_0x4487('0x24')](cmContactRpc[_0x4487('0x2f')](_0xa20ef2))[_0x4487('0x24')](function(_0x34755a){_0xdcb719=_0x34755a;_0x58ce1c[_0x4487('0x30')](_0x34755a);if(_0xdcb719){logger[_0x4487('0x9')](_0x4487('0x31'),_0x110520[_0x4487('0x27')],_0x69e8d['id'],_0xdcb719['id']);}return;});}else{logger[_0x4487('0x9')](_0x4487('0x32'),_0x110520['uniqueid'],_0x69e8d['id']);_0xa20ef2[_0xa9a26f]=_[_0x4487('0x10')](_0x110520[_0x4487('0x18')])?_0x110520[_0x4487('0x1a')]:_0x110520[_0x4487('0x19')];if(_[_0x4487('0x10')](_0x110520[_0x4487('0x18')])){_0xa20ef2['firstName']=_0x110520[_0x4487('0x2b')]&&_0x110520[_0x4487('0x2b')]!==_0x4487('0x2c')?_0x110520[_0x4487('0x2b')]:_0x4487('0x2e');}else{_0xa20ef2[_0x4487('0x1b')]=_0x110520['destcalleridname']&&_0x110520[_0x4487('0x2d')]!==_0x4487('0x2c')?_0x110520['destcalleridname']:_0x4487('0x2e');}_0xdcb719=_0xa20ef2;_0x58ce1c[_0x4487('0x30')](_0xa20ef2);return;}}})['then'](function(){if(_0x307e71){emit(_0x110520[_0x4487('0x27')],_0x69e8d,util[_0x4487('0x33')]('user:%s',_0x307e71['name']),util[_0x4487('0x33')](_0x4487('0x34'),_0x2d2842[_0x4487('0x35')][_0x4487('0x36')]()),{'evt':_[_0x4487('0x37')](_0x110520,{'autoCreate':_0x50322c}),'contact':_0xdcb719===undefined?{}:_0xdcb719,'contacts':_0x58ce1c[_0x4487('0x26')]===0x0?undefined:_0x58ce1c});}});}; \ No newline at end of file +var _0x3989=['data2','isNil','data5','ListId','data3','split','phone','destcalleridnum','calleridnum','routeId','firstName','lastName','createdAt','scheduledAt','union','resolve','then','getContacts','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','','format','user:%s','name','trigger:%s','lodash','bluebird','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','localhost','info','emit','data1'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x3989,0x85));var _0x9398=function(_0x1b7d9a,_0x1dd4f4){_0x1b7d9a=_0x1b7d9a-0x0;var _0x247195=_0x3989[_0x1b7d9a];return _0x247195;};'use strict';var _=require(_0x9398('0x0'));var BPromise=require(_0x9398('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0x9398('0x2'));var logger=require(_0x9398('0x3'))(_0x9398('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0x9398('0x5')]=_[_0x9398('0x6')](config[_0x9398('0x5')],{'host':_0x9398('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9398('0x5')]));function emit(_0xcf471,_0x5586dd,_0x28f27f,_0xd12639,_0x281e97){logger[_0x9398('0x8')]('[CM][%s][%s]',_0xcf471,_0x5586dd['id'],_0x28f27f,_0xd12639,JSON['stringify'](_0x281e97));io['to'](_0x28f27f)[_0x9398('0x9')](_0xd12639,_0x281e97);}exports['exec']=function(_0x5ed325,_0x452c78,_0x3dce87,_0x519e17){var _0x4303fc,_0x53a450;var _0x2926ed={};var _0x160d71;var _0x6646db=Number(_0x3dce87[_0x9398('0xa')]);var _0x2c4da9=_0x3dce87[_0x9398('0xb')]?Boolean(Number(_0x3dce87['data2'])):![];var _0xeb1697;var _0x53049a=![];if(!_[_0x9398('0xc')](_0x3dce87['data5'])){if(_0x3dce87[_0x9398('0xd')]=='1')_0x53049a=!![];}if(!_0x53049a){if(_0x519e17['xmd-contactid']){_0x2926ed['id']=_0x519e17['xmd-contactid'];}}if(!_0x2926ed['id']){_0x2926ed[_0x9398('0xe')]=_0x6646db;_0xeb1697=_0x3dce87[_0x9398('0xf')]&&_0x3dce87['data3']!=='0'?_0x3dce87[_0x9398('0xf')][_0x9398('0x10')](','):[_0x9398('0x11')];_0x2926ed['$or']=_['map'](_0xeb1697,function(_0x192320){var _0x305f54={};_0x305f54[_0x192320]=_0x519e17['routeId']?_0x519e17[_0x9398('0x12')]:_0x519e17[_0x9398('0x13')];return _0x305f54;});_0x160d71=_0x519e17[_0x9398('0x14')]?_0x519e17[_0x9398('0x12')]:_0x519e17[_0x9398('0x13')];}var _0xe5fc35=['id',_0x9398('0x15'),_0x9398('0x16'),_0x9398('0x11'),'mobile','fax',_0x9398('0xe'),_0x9398('0x17'),_0x9398('0x18'),'updatedAt'];var _0xe0823c=_[_0x9398('0x19')](_0xe5fc35,_0xeb1697);BPromise[_0x9398('0x1a')]()[_0x9398('0x1b')](cmContactRpc[_0x9398('0x1c')]({'attributes':_0xe0823c,'where':_0x2926ed,'phone':_0x160d71}))[_0x9398('0x1b')](function(_0x5d24dc){_0x53a450=_0x5d24dc;if(!_['isEmpty'](_0x53a450)){if(_0x53a450[_0x9398('0x1d')]===0x1){_0x4303fc=_0x53a450[0x0];logger['info'](_0x9398('0x1e'),_0x519e17[_0x9398('0x1f')],_0x452c78['id'],_0x4303fc['id']);}else{logger[_0x9398('0x8')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x519e17[_0x9398('0x1f')],_0x452c78['id'],_[_0x9398('0x20')](_0x53a450,'id')[_0x9398('0x21')](','));}return;}else{logger[_0x9398('0x8')](_0x9398('0x22'),_0x519e17[_0x9398('0x1f')],_0x452c78['id']);var _0x55233d={'ListId':_0x6646db};var _0x45c8db=_0x3dce87[_0x9398('0x23')]&&_0x3dce87[_0x9398('0x23')]!=='0'?_0x3dce87[_0x9398('0x23')]:_0x9398('0x11');if(_0x2c4da9){logger[_0x9398('0x8')](_0x9398('0x24'),_0x519e17[_0x9398('0x1f')],_0x452c78['id']);_0x55233d[_0x45c8db]=_[_0x9398('0xc')](_0x519e17['routeId'])?_0x519e17[_0x9398('0x13')]:_0x519e17[_0x9398('0x12')];if(_[_0x9398('0xc')](_0x519e17[_0x9398('0x14')])){_0x55233d['firstName']=_0x519e17[_0x9398('0x25')]&&_0x519e17[_0x9398('0x25')]!==''?_0x519e17[_0x9398('0x25')]:_0x9398('0x26');}else{_0x55233d[_0x9398('0x15')]=_0x519e17[_0x9398('0x27')]&&_0x519e17[_0x9398('0x27')]!==''?_0x519e17[_0x9398('0x27')]:'Unknown';}return BPromise[_0x9398('0x1a')]()[_0x9398('0x1b')](cmContactRpc[_0x9398('0x28')](_0x55233d))[_0x9398('0x1b')](function(_0x50f8be){_0x4303fc=_0x50f8be;_0x53a450['push'](_0x50f8be);if(_0x4303fc){logger['info'](_0x9398('0x29'),_0x519e17[_0x9398('0x1f')],_0x452c78['id'],_0x4303fc['id']);}return;});}else{logger[_0x9398('0x8')](_0x9398('0x2a'),_0x519e17[_0x9398('0x1f')],_0x452c78['id']);_0x55233d[_0x45c8db]=_[_0x9398('0xc')](_0x519e17['routeId'])?_0x519e17[_0x9398('0x13')]:_0x519e17['destcalleridnum'];if(_[_0x9398('0xc')](_0x519e17['routeId'])){_0x55233d[_0x9398('0x15')]=_0x519e17[_0x9398('0x25')]&&_0x519e17['calleridname']!==_0x9398('0x2b')?_0x519e17[_0x9398('0x25')]:'Unknown';}else{_0x55233d[_0x9398('0x15')]=_0x519e17[_0x9398('0x27')]&&_0x519e17['destcalleridname']!==_0x9398('0x2b')?_0x519e17[_0x9398('0x27')]:_0x9398('0x26');}_0x4303fc=_0x55233d;_0x53a450['push'](_0x55233d);return;}}})[_0x9398('0x1b')](function(){if(_0x5ed325){emit(_0x519e17[_0x9398('0x1f')],_0x452c78,util[_0x9398('0x2c')](_0x9398('0x2d'),_0x5ed325[_0x9398('0x2e')]),util['format'](_0x9398('0x2f'),_0x3dce87['action']['toLowerCase']()),{'evt':_['merge'](_0x519e17,{'autoCreate':_0x2c4da9}),'contact':_0x4303fc===undefined?{}:_0x4303fc,'contacts':_0x53a450['length']===0x0?undefined:_0x53a450});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 31be3eb..38e7a0a 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 _0x0db8=['deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:timeout','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','clone','undefined','motionChannel','debug','inspect','checkTriggers','hasOwnProperty','merge','Actions','action','motionbar','browser','data1','TemplateId','data2','html','render','buildUri','isNil','data3','uriLocation','windowWidth','data5','800','windowHeight','600','data6','winapp','winApplication','winArguments','format','user:%s','interface','name','trigger:%s:%s','jscripty','trigger:%s','toLowerCase','contactmanager','exec','integration','queue','routeId','urlforward','query','search','replace','AllConditions','length','checkConditions','channel','AnyConditions','some','checkTrigger:\x20trigger','evt','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','message','event','membername','lastevent','mailSubstatus','substatus','created','equals','exports','util','url','mustache','ioredis','./urlforward','./script','../../../config/environment','../ami','redis','defaults','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x0db8,0x1cd));var _0x80db=function(_0x1454e1,_0x3b2847){_0x1454e1=_0x1454e1-0x0;var _0x3739e5=_0x0db8[_0x1454e1];return _0x3739e5;};'use strict';var util=require(_0x80db('0x0'));var _=require('lodash');var url=require(_0x80db('0x1'));var Mustache=require(_0x80db('0x2'));var Redis=require(_0x80db('0x3'));var urlforward=require(_0x80db('0x4'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require(_0x80db('0x5'));var config=require(_0x80db('0x6'));var logger=require('../../../config/logger')('trigger');var ami=require(_0x80db('0x7'));config[_0x80db('0x8')]=_[_0x80db('0x9')](config['redis'],{'host':_0x80db('0xa'),'port':0x18eb});var io=require(_0x80db('0xb'))(new Redis(config[_0x80db('0x8')]));var operators={'equals':function(_0x336795,_0x276940){return _0x336795==_0x276940;},'not_equals':function(_0x238572,_0x14421c){return _0x238572!=_0x14421c;}};var barAndWebActions=[_0x80db('0xc'),'url','winapp'];function Trigger(_0x1511fa){this[_0x80db('0xd')]=_0x1511fa[_0x80db('0xd')];this[_0x80db('0xe')]=_0x1511fa['agents'];this[_0x80db('0xf')]=_0x1511fa['voiceQueues'];this[_0x80db('0x10')]=_0x1511fa[_0x80db('0x10')];this[_0x80db('0x11')]=_0x1511fa[_0x80db('0x11')];this[_0x80db('0x12')]=_0x1511fa[_0x80db('0x12')];this[_0x80db('0x13')]=_0x1511fa[_0x80db('0x13')];this[_0x80db('0x14')]=_0x1511fa[_0x80db('0x14')];this[_0x80db('0x15')]=_0x1511fa[_0x80db('0x15')];this['zohoAccounts']=_0x1511fa[_0x80db('0x16')];this[_0x80db('0x17')]=_0x1511fa[_0x80db('0x17')];this[_0x80db('0x18')]=_0x1511fa[_0x80db('0x18')];this['servicenowAccounts']=_0x1511fa[_0x80db('0x19')];this[_0x80db('0x1a')]=_0x1511fa[_0x80db('0x1a')];this['freshsalesAccounts']=_0x1511fa[_0x80db('0x1b')];this[_0x80db('0x1c')]={'zendesk':this['zendeskAccounts'],'salesforce':this['salesforceAccounts'],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x80db('0x15')],'zoho':this[_0x80db('0x16')],'desk':this[_0x80db('0x17')],'vtiger':this[_0x80db('0x18')],'dynamics365':this[_0x80db('0x1a')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x80db('0x19')]};ami['on'](_0x80db('0x1d'),this[_0x80db('0x1e')]['bind'](this));ami['on']('custom:agentconnect',this[_0x80db('0x1e')][_0x80db('0x1f')](this));ami['on']('custom:agentringnoanswer',this[_0x80db('0x1e')]['bind'](this));ami['on'](_0x80db('0x20'),this['syncCustomEvent'][_0x80db('0x1f')](this));ami['on'](_0x80db('0x21'),this[_0x80db('0x1e')][_0x80db('0x1f')](this));ami['on'](_0x80db('0x22'),this[_0x80db('0x1e')]['bind'](this));ami['on'](_0x80db('0x23'),this[_0x80db('0x1e')][_0x80db('0x1f')](this));ami['on'](_0x80db('0x24'),this[_0x80db('0x1e')][_0x80db('0x1f')](this));ami['on'](_0x80db('0x25'),this[_0x80db('0x1e')][_0x80db('0x1f')](this));ami['on'](_0x80db('0x26'),this[_0x80db('0x1e')][_0x80db('0x1f')](this));ami['on']('custom:queuecallerabandon',this[_0x80db('0x1e')]['bind'](this));ami['on'](_0x80db('0x27'),this[_0x80db('0x1e')][_0x80db('0x1f')](this));ami['on']('custom:dialbegin',this[_0x80db('0x28')][_0x80db('0x1f')](this));ami['on']('custom:dialconnect',this[_0x80db('0x28')][_0x80db('0x1f')](this));ami['on'](_0x80db('0x29'),this[_0x80db('0x28')][_0x80db('0x1f')](this));ami['on'](_0x80db('0x2a'),this['syncCustomEvent']['bind'](this));ami['on'](_0x80db('0x2b'),this[_0x80db('0x1e')][_0x80db('0x1f')](this));ami['on']('custom:substatus',this[_0x80db('0x1e')][_0x80db('0x1f')](this));ami['on'](_0x80db('0x2c'),this[_0x80db('0x1e')]['bind'](this));ami['on']('custom:outgoingmessage',this[_0x80db('0x1e')][_0x80db('0x1f')](this));ami['on']('custom:acceptmessage',this[_0x80db('0x1e')][_0x80db('0x1f')](this));ami['on'](_0x80db('0x2d'),this[_0x80db('0x1e')][_0x80db('0x1f')](this));ami['on'](_0x80db('0x2e'),this['syncCustomEvent']['bind'](this));}Trigger[_0x80db('0x2f')][_0x80db('0x30')]=function(_0x3ebcc3,_0x216320,_0x16492d){logger[_0x80db('0x31')](_0x3ebcc3,_0x216320,JSON['stringify'](_0x16492d));io['to'](_0x3ebcc3)['emit'](_0x216320,_0x16492d);};Trigger['prototype'][_0x80db('0x1e')]=function(_0x4d450e){var _0x2ab168=_[_0x80db('0x32')](_0x4d450e);if(typeof _0x2ab168['motionChannel']===_0x80db('0x33')){_0x2ab168[_0x80db('0x34')]='voice';}logger[_0x80db('0x35')](_0x80db('0x1e'),util[_0x80db('0x36')](_0x2ab168,{'showHidden':!![],'depth':null}));this[_0x80db('0x37')](_0x2ab168);};Trigger[_0x80db('0x2f')][_0x80db('0x28')]=function(_0x36fd02){if(this['agents'][_0x36fd02['interface']]){this[_0x80db('0x1e')](_0x36fd02);}};Trigger[_0x80db('0x2f')][_0x80db('0x37')]=function(_0x4bc864){var _0x8ac49b;for(var _0x5c2f70 in this[_0x80db('0xd')]){if(this[_0x80db('0xd')][_0x80db('0x38')](_0x5c2f70)){if(this[_0x80db('0xd')][_0x5c2f70]['status']){_0x8ac49b=this['checkTrigger'](this[_0x80db('0xd')][_0x5c2f70],_0x4bc864);if(_0x8ac49b){_[_0x80db('0x39')](_0x4bc864,_0x4bc864['variables']);for(var _0x38fba2=0x0,_0xd6cc3c,_0x5dc0fd,_0x309d5f;_0x38fba20x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file +var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x3506ef,_0x40533f){var _0x8ed04a=function(_0x5e7a5b){while(--_0x5e7a5b){_0x3506ef['push'](_0x3506ef['shift']());}};_0x8ed04a(++_0x40533f);}(_0x3e74,0x175));var _0x43e7=function(_0x384022,_0x454765){_0x384022=_0x384022-0x0;var _0x4a74e4=_0x3e74[_0x384022];return _0x4a74e4;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_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 diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 8cd2663..a6c5a09 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 _0x7614=['POST','clientId','username','password','clientSecret','then','access_token','catch','toUpperCase','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','userEmail','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','length','toLowerCase','outbound','destcalleridnum','contacts','body','headers','substring','lastIndexOf','enduserId','GET','contacts?$select=','&$filter=','replace','%2b','value','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','picklist','nameField','customField','idField','indexOf','ticketType','incident','incidents','assign','getString','/contacts(','/systemusers(','Fields','callDirection','queue','phonecalls','Subjects','calleridnum','Descriptions','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','localhost','socket.io-emitter','redis','modernAuthentication','remoteUri','CloudProvider','data7','resolve','data5'];(function(_0x54d80c,_0x27104e){var _0x1481f5=function(_0x5c0e41){while(--_0x5c0e41){_0x54d80c['push'](_0x54d80c['shift']());}};_0x1481f5(++_0x27104e);}(_0x7614,0xcc));var _0x4761=function(_0x57306c,_0xdeff85){_0x57306c=_0x57306c-0x0;var _0x413cfb=_0x7614[_0x57306c];return _0x413cfb;};'use strict';var _=require('lodash');var rp=require(_0x4761('0x0'));var util=require(_0x4761('0x1'));var intUtil=require(_0x4761('0x2'));var md5=require(_0x4761('0x3'));var Redis=require(_0x4761('0x4'));var logger=require(_0x4761('0x5'))(_0x4761('0x6'));var config=require(_0x4761('0x7'));config['redis']=_[_0x4761('0x8')](config['redis'],{'host':_0x4761('0x9'),'port':0x18eb});var io=require(_0x4761('0xa'))(new Redis(config[_0x4761('0xb')]));function getAuthToken(_0x12c4a6,_0x3837e8,_0x2df407){if(_0x12c4a6[_0x4761('0xc')]){_0x12c4a6[_0x4761('0xd')]=_0x12c4a6[_0x4761('0xe')][_0x4761('0xf')];_0x12c4a6['tenantId']=_0x12c4a6[_0x4761('0xe')]['data2'];return Promise[_0x4761('0x10')](_0x12c4a6[_0x4761('0xe')][_0x4761('0x11')]);}var _0x3e39c1={'method':_0x4761('0x12'),'uri':_0x3837e8,'form':{'client_id':_0x12c4a6[_0x4761('0x13')],'resource':_0x12c4a6['remoteUri'],'username':_0x12c4a6[_0x4761('0x14')],'password':_0x12c4a6[_0x4761('0x15')],'grant_type':'password','client_secret':_0x12c4a6[_0x4761('0x16')]},'json':!![]};return rp(_0x3e39c1)[_0x4761('0x17')](function(_0x224177){return _0x224177[_0x4761('0x18')];})[_0x4761('0x19')](function(_0x149e2b){logger['error']('['+[_0x2df407[_0x4761('0x1a')]()]+']\x20Wrong\x20credentials!');return _0x149e2b[_0x4761('0x1b')];});}function getUser(_0x56cbe9,_0x41747a,_0x34d1aa,_0x5af63c,_0x284e03,_0x182f4d){return new Promise(function(_0x16dc24,_0x28aba0){return getAuthToken(_0x41747a,_0x5af63c,_0x182f4d)[_0x4761('0x17')](function(_0x1e48ec){var _0x16287d={'method':'GET','uri':_0x284e03+_0x4761('0x1c'),'headers':{'Authorization':_0x4761('0x1d')+_0x1e48ec,'OData-Version':_0x4761('0x1e')},'json':!![]};return rp(_0x16287d);})[_0x4761('0x17')](function(_0x1d0c91){var _0x5725df=_0x1d0c91['value'];var _0x468085=![];var _0x18b5cd=null;if(!_[_0x4761('0x1f')](_0x34d1aa)){if(intUtil[_0x4761('0x20')](_0x34d1aa['email'])){_0x56cbe9[_0x4761('0x21')]=_0x34d1aa['email'];for(_0x18b5cd=0x0;_0x18b5cd<_0x5725df['length'];_0x18b5cd++){if(_0x5725df[_0x18b5cd][_0x4761('0x22')]===_0x34d1aa['email']&&!_0x5725df[_0x18b5cd][_0x4761('0x23')]){_0x468085=!![];logger[_0x4761('0x24')]('['+[_0x182f4d['toUpperCase']()]+_0x4761('0x25')+_0x5725df[_0x18b5cd][_0x4761('0x26')]+'!');_0x56cbe9[_0x4761('0x27')]=_0x5725df[_0x18b5cd][_0x4761('0x26')];}}}}if(!_0x468085){logger['info']('['+[_0x182f4d[_0x4761('0x1a')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x56cbe9['userEmail']=_0x41747a[_0x4761('0x14')];for(_0x18b5cd=0x0;_0x18b5cd<_0x5725df[_0x4761('0x28')];_0x18b5cd++){if(_0x5725df[_0x18b5cd][_0x4761('0x22')]===_0x41747a[_0x4761('0x14')]){_0x56cbe9['userId']=_0x5725df[_0x18b5cd][_0x4761('0x26')];}}}_0x16dc24(_0x56cbe9);})[_0x4761('0x19')](function(_0x1c660d){_0x28aba0(_0x1c660d[_0x4761('0x1b')]);});});}function createEndUser(_0x3abb51,_0x2fb1ea,_0x1f46a1,_0x22ac42,_0xe46fcc,_0x42b174,_0x354224){return new Promise(function(_0x2d2909,_0x2d05b5){return getAuthToken(_0x2fb1ea,_0x1f46a1,_0x42b174)['then'](function(_0xdd6eda){var _0xfebfc3=_0x42b174[_0x4761('0x29')]()===_0x4761('0x2a')?_0xe46fcc[_0x4761('0x2b')]:_0xe46fcc['calleridnum'];var _0x55ac50={'method':_0x4761('0x12'),'uri':_0x22ac42+_0x4761('0x2c'),'body':{'fullname':_0xfebfc3,'firstname':_0xfebfc3,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x3abb51['userId']+')'},'headers':{'Authorization':_0x4761('0x1d')+_0xdd6eda,'OData-Version':_0x4761('0x1e')},'json':!![],'resolveWithFullResponse':!![]};_0x55ac50[_0x4761('0x2d')][_0x354224]=_0xfebfc3;return rp(_0x55ac50);})[_0x4761('0x17')](function(_0x22b1bb){var _0x556dfe=_0x22b1bb[_0x4761('0x2e')]['odata-entityid'];var _0x8240e4=_0x556dfe[_0x4761('0x2f')](_0x556dfe[_0x4761('0x30')]('(')+0x1,_0x556dfe[_0x4761('0x30')](')'));_0x3abb51[_0x4761('0x31')]=_0x8240e4;_0x2d2909(_0x3abb51);})[_0x4761('0x19')](function(_0x5af258){_0x2d05b5(_0x5af258[_0x4761('0x1b')]);});});}function getEndUser(_0xb1e048,_0x184574,_0x3c4f0d,_0x32d90e,_0x1a6716,_0x14cd7d,_0x54e7f5,_0x3ef468){var _0x2f91e6=_0x14cd7d['toLowerCase']()===_0x4761('0x2a')?_0x1a6716[_0x4761('0x2b')]:_0x1a6716['calleridnum'];return getAuthToken(_0x184574,_0x3c4f0d,_0x14cd7d)[_0x4761('0x17')](function(_0x747820){_0x3ef468=_0x3ef468?_0x3ef468:'telephone1';var _0x3a4052={'method':_0x4761('0x32'),'uri':_0x32d90e+_0x4761('0x33')+_0x3ef468+_0x4761('0x34')+_0x3ef468+'\x20eq\x20\x27'+_0x2f91e6[_0x4761('0x35')]('+',_0x4761('0x36'))+'\x27','headers':{'Authorization':_0x4761('0x1d')+_0x747820,'If-None-Match':null,'OData-Version':_0x4761('0x1e')},'json':!![]};return rp(_0x3a4052);})[_0x4761('0x17')](function(_0x15574b){var _0x4a1ce7=![];if(!_0x15574b)return _0x4a1ce7;var _0x22af90=_0x15574b[_0x4761('0x37')];for(var _0x12af13=0x0;_0x12af13<_0x22af90[_0x4761('0x28')];_0x12af13++){if(_0x22af90[_0x12af13][_0x3ef468]===_0x2f91e6){_0x4a1ce7=!![];_0xb1e048['enduserId']=_0x22af90[_0x12af13][_0x4761('0x38')];}}return _0x4a1ce7;})[_0x4761('0x17')](function(_0x264f58){if(_0x264f58)return _0xb1e048;if(_0x54e7f5===_0x4761('0x39')){logger[_0x4761('0x24')]('['+[_0x14cd7d['toUpperCase']()]+_0x4761('0x3a'));return _0xb1e048;}return createEndUser(_0xb1e048,_0x184574,_0x3c4f0d,_0x32d90e,_0x1a6716,_0x14cd7d,_0x3ef468)[_0x4761('0x17')](function(_0x5ac4d4){logger[_0x4761('0x24')]('['+[_0x14cd7d[_0x4761('0x1a')]()]+_0x4761('0x3b'),_0x5ac4d4['enduserId']);return _0x5ac4d4;});});}function getCustomFields(_0x38251d,_0x11a9e7,_0x4b90a6){var _0x5b80e6={};if(_0x38251d[_0x4761('0x28')]>0x0){_[_0x4761('0x3c')](_0x38251d,function(_0x252919){if(_['includes'](['string',_0x4761('0x3d')],_0x252919['type'])&&_0x252919[_0x4761('0x3e')]&&!_0x252919[_0x4761('0x3f')]){var _0x45a38b=_0x252919[_0x4761('0x40')][_0x4761('0x29')]();var _0x1c027f=_0x45a38b[_0x4761('0x2f')](0x0,_0x45a38b[_0x4761('0x41')]('_'));var _0x2644dd=_0x45a38b[_0x4761('0x2f')](_0x45a38b['indexOf']('_')+0x1);if(_0x1c027f===_0x4b90a6){_0x5b80e6[_0x2644dd]=_0x252919['content'];}}});}return _0x5b80e6;}function getTicket(_0xb18df6,_0x13cc5a,_0x103ac0,_0x43939c,_0x2e5a97,_0x2edfa9,_0x4541ad){return new Promise(function(_0x47acf5,_0x4beec8){var _0x5b5328;return getAuthToken(_0x13cc5a,_0x103ac0,_0x4541ad)[_0x4761('0x17')](function(_0x214ad4){if(_0x2edfa9[_0x4761('0x42')]===_0x4761('0x43')){_0x5b5328={'method':'POST','uri':_0x43939c+_0x4761('0x44'),'body':Object[_0x4761('0x45')]({},{'title':intUtil['getString'](_0x2edfa9['Subjects'],_0x2e5a97,'\x20'),'description':intUtil[_0x4761('0x46')](_0x2edfa9['Descriptions'],_0x2e5a97,'\x0a'),'customerid_contact@odata.bind':_0xb18df6[_0x4761('0x31')]?_0x4761('0x47')+_0xb18df6[_0x4761('0x31')]+')':undefined,'ownerid@odata.bind':_0x4761('0x48')+_0xb18df6[_0x4761('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x2edfa9[_0x4761('0x49')],_0x2e5a97,_0x2edfa9[_0x4761('0x42')])),'headers':{'Authorization':_0x4761('0x1d')+_0x214ad4,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2edfa9[_0x4761('0x42')]==='phonecall'){var _0x44faad=_0xb18df6[_0x4761('0x31')]?[{'partyid_systemuser@odata.bind':_0x4761('0x48')+_0xb18df6[_0x4761('0x27')]+')','participationtypemask':_0xb18df6[_0x4761('0x4a')]===_0x4761('0x4b')?0x2:0x1},{'partyid_contact@odata.bind':_0x4761('0x47')+_0xb18df6['enduserId']+')','participationtypemask':_0xb18df6[_0x4761('0x4a')]===_0x4761('0x4b')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0xb18df6['userId']+')','participationtypemask':_0xb18df6['callDirection']===_0x4761('0x4b')?0x2:0x1}];_0x5b5328={'method':_0x4761('0x12'),'uri':_0x43939c+_0x4761('0x4c'),'body':Object[_0x4761('0x45')]({},{'subject':intUtil[_0x4761('0x46')](_0x2edfa9[_0x4761('0x4d')],_0x2e5a97,'\x20'),'phonenumber':String(_0x2e5a97[_0x4761('0x4e')]),'description':intUtil[_0x4761('0x46')](_0x2edfa9[_0x4761('0x4f')],_0x2e5a97,'\x0a'),'regardingobjectid_contact@odata.bind':_0xb18df6[_0x4761('0x31')]?_0x4761('0x47')+_0xb18df6[_0x4761('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0xb18df6[_0x4761('0x27')]+')','directioncode':_0xb18df6[_0x4761('0x4a')]===_0x4761('0x4b')?![]:!![],'phonecall_activity_parties':_0x44faad},getCustomFields(_0x2edfa9[_0x4761('0x49')],_0x2e5a97,_0x2edfa9[_0x4761('0x42')])),'headers':{'Authorization':_0x4761('0x1d')+_0x214ad4,'OData-Version':_0x4761('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5b5328);})['then'](function(_0x157c65){var _0x371c9b=_0x157c65['headers'][_0x4761('0x50')];var _0x5c08f5=_0x371c9b['substring'](_0x371c9b[_0x4761('0x30')]('(')+0x1,_0x371c9b['lastIndexOf'](')'));_0xb18df6['ticketId']=_0x5c08f5;_0x47acf5(_0xb18df6);})[_0x4761('0x19')](function(_0x1a7a5f){_0x4beec8(_0x1a7a5f[_0x4761('0x1b')]);});});}function emit(_0x347ca4,_0x3a153a,_0x4a5c3f,_0x13e460){var _0x1add6e={'uri':util[_0x4761('0x51')](_0x4761('0x52'),_0x347ca4,_0x4a5c3f,_0x13e460)};io['to'](util['format'](_0x4761('0x53'),_0x3a153a))[_0x4761('0x54')](_0x4761('0x55'),_0x1add6e);}exports['cs']=function(_0x574e85,_0x8f8e2f,_0x242ae8,_0x41bda7,_0x287a0d,_0x251977,_0x2d979d,_0x185c15){var _0x1224db={};_0x251977[_0x4761('0xd')]=_0x251977[_0x4761('0xc')]?intUtil[_0x4761('0x56')](_0x251977[_0x4761('0xe')][_0x4761('0xf')]):intUtil[_0x4761('0x56')](_0x251977[_0x4761('0xd')]);_0x251977[_0x4761('0x57')]=intUtil[_0x4761('0x56')](_0x251977[_0x4761('0x57')]);_0x1224db['callDirection']=_0x185c15===_0x4761('0x4b')||_0x185c15===_0x4761('0x58')?_0x4761('0x4b'):_0x4761('0x2a');var _0x3cbc6a=_0x251977[_0x4761('0xc')]?util[_0x4761('0x51')]('%s/api/data/v9.0/',_0x251977[_0x4761('0xe')]['data7']):util[_0x4761('0x51')](_0x4761('0x59'),_0x251977[_0x4761('0xd')]);var _0x2f6157=util[_0x4761('0x51')](_0x4761('0x5a'),_0x251977['tenantId']);var _0x37ea38=util[_0x4761('0x51')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x251977[_0x4761('0x57')],_0x8f8e2f[_0x4761('0x5b')],md5(_0x8f8e2f[_0x4761('0x5b')]));if(_0x287a0d&&_0x287a0d[_0x4761('0x5c')]){logger[_0x4761('0x24')]('[QUEUE]','Recording\x20is\x20enabled!');_0x8f8e2f[_0x4761('0x5d')]=_0x37ea38;}else if(_0x2d979d&&_0x2d979d[_0x4761('0x5e')]&&_0x2d979d[_0x4761('0x5e')]!==_0x4761('0x5f')){logger[_0x4761('0x24')](_0x4761('0x60'),'Recording\x20is\x20enabled!');_0x8f8e2f['recordingURL']=_0x37ea38;}else{_0x8f8e2f[_0x4761('0x5d')]='';}return getUser(_0x1224db,_0x251977,_0x41bda7,_0x2f6157,_0x3cbc6a,_0x185c15)[_0x4761('0x17')](function(_0xfaf054){logger[_0x4761('0x24')]('['+_0x185c15['toUpperCase']()+_0x4761('0x61'),_0xfaf054['userId']);logger[_0x4761('0x24')]('['+_0x185c15[_0x4761('0x1a')]()+_0x4761('0x62'),_0xfaf054[_0x4761('0x21')]);return getEndUser(_0xfaf054,_0x251977,_0x2f6157,_0x3cbc6a,_0x8f8e2f,_0x185c15,_0x242ae8[_0x4761('0x63')],_0x242ae8['additionalSearchContact']);})['then'](function(_0x8d13ac){logger[_0x4761('0x24')]('['+_0x185c15[_0x4761('0x1a')]()+_0x4761('0x64'),_0x8d13ac['enduserId']);logger[_0x4761('0x24')]('['+_0x185c15[_0x4761('0x1a')]()+_0x4761('0x65'),_0x8f8e2f[_0x4761('0x4e')]);return getTicket(_0x8d13ac,_0x251977,_0x2f6157,_0x3cbc6a,_0x8f8e2f,_0x242ae8,_0x185c15);})['then'](function(_0x32e3fb){logger['info'](util[_0x4761('0x51')]('['+_0x185c15[_0x4761('0x1a')]()+_0x4761('0x66'),_0x242ae8[_0x4761('0x42')],_0x32e3fb[_0x4761('0x67')]));logger['info'](util['format']('['+_0x185c15[_0x4761('0x1a')]()+_0x4761('0x68'),_0x185c15));if(_0x185c15!==_0x4761('0x58')&&_0x242ae8[_0x4761('0x69')]){logger[_0x4761('0x24')]('['+_0x185c15[_0x4761('0x1a')]()+']',_0x4761('0x6a'));emit(_0x251977[_0x4761('0xd')],_0x41bda7[_0x4761('0x6b')],_0x242ae8['ticketType'],_0x32e3fb[_0x4761('0x67')]);}})[_0x4761('0x19')](function(_0x173dd4){logger[_0x4761('0x6c')]('['+_0x185c15['toUpperCase']()+_0x4761('0x6d'),_0x173dd4['message']);console['error'](_0x4761('0x6e'),_0x173dd4);});}; \ No newline at end of file +var _0x3486=['nameField','indexOf','content','ticketType','incident','assign','getString','Subjects','/contacts(','/systemusers(','Fields','phonecall','callDirection','queue','Descriptions','headers','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','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','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','username','password','clientSecret','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','isNil','validateEmail','userEmail','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','contacts','userId','Bearer\x20','body','substring','lastIndexOf','calleridnum','\x20eq\x20\x27','%2b','value','contactid','nothing',']\x20Enduser\x20created!','enduserId','forEach','includes','string','picklist'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3486,0x1e5));var _0x6348=function(_0x5253c3,_0x3e4a0a){_0x5253c3=_0x5253c3-0x0;var _0x3c3917=_0x3486[_0x5253c3];return _0x3c3917;};'use strict';var _=require(_0x6348('0x0'));var rp=require('request-promise');var util=require('util');var intUtil=require(_0x6348('0x1'));var md5=require(_0x6348('0x2'));var Redis=require(_0x6348('0x3'));var logger=require(_0x6348('0x4'))(_0x6348('0x5'));var config=require(_0x6348('0x6'));config[_0x6348('0x7')]=_[_0x6348('0x8')](config['redis'],{'host':_0x6348('0x9'),'port':0x18eb});var io=require(_0x6348('0xa'))(new Redis(config[_0x6348('0x7')]));function getAuthToken(_0x1152c0,_0x5d74b2,_0xddab37){if(_0x1152c0[_0x6348('0xb')]){_0x1152c0[_0x6348('0xc')]=_0x1152c0[_0x6348('0xd')][_0x6348('0xe')];_0x1152c0[_0x6348('0xf')]=_0x1152c0[_0x6348('0xd')][_0x6348('0x10')];return Promise[_0x6348('0x11')](_0x1152c0[_0x6348('0xd')][_0x6348('0x12')]);}var _0x5ae381={'method':_0x6348('0x13'),'uri':_0x5d74b2,'form':{'client_id':_0x1152c0[_0x6348('0x14')],'resource':_0x1152c0[_0x6348('0xc')],'username':_0x1152c0[_0x6348('0x15')],'password':_0x1152c0['password'],'grant_type':_0x6348('0x16'),'client_secret':_0x1152c0[_0x6348('0x17')]},'json':!![]};return rp(_0x5ae381)[_0x6348('0x18')](function(_0x5a36c3){return _0x5a36c3['access_token'];})[_0x6348('0x19')](function(_0x597e0d){logger[_0x6348('0x1a')]('['+[_0xddab37[_0x6348('0x1b')]()]+_0x6348('0x1c'));return _0x597e0d[_0x6348('0x1d')];});}function getUser(_0x25f303,_0x40ceed,_0x556ecb,_0x32248b,_0x47fc8e,_0x3a91cc){return new Promise(function(_0x488222,_0x3042ab){return getAuthToken(_0x40ceed,_0x32248b,_0x3a91cc)[_0x6348('0x18')](function(_0x29f9ac){var _0x2cc3e0={'method':_0x6348('0x1e'),'uri':_0x47fc8e+_0x6348('0x1f'),'headers':{'Authorization':'Bearer\x20'+_0x29f9ac,'OData-Version':_0x6348('0x20')},'json':!![]};return rp(_0x2cc3e0);})[_0x6348('0x18')](function(_0x196116){var _0xc9b449=_0x196116['value'];var _0x4b9bb1=![];var _0x3d4b0c=null;if(!_[_0x6348('0x21')](_0x556ecb)){if(intUtil[_0x6348('0x22')](_0x556ecb['email'])){_0x25f303[_0x6348('0x23')]=_0x556ecb[_0x6348('0x24')];for(_0x3d4b0c=0x0;_0x3d4b0c<_0xc9b449[_0x6348('0x25')];_0x3d4b0c++){if(_0xc9b449[_0x3d4b0c][_0x6348('0x26')]===_0x556ecb[_0x6348('0x24')]&&!_0xc9b449[_0x3d4b0c][_0x6348('0x27')]){_0x4b9bb1=!![];logger[_0x6348('0x28')]('['+[_0x3a91cc['toUpperCase']()]+_0x6348('0x29')+_0xc9b449[_0x3d4b0c][_0x6348('0x2a')]+'!');_0x25f303['userId']=_0xc9b449[_0x3d4b0c][_0x6348('0x2a')];}}}}if(!_0x4b9bb1){logger[_0x6348('0x28')]('['+[_0x3a91cc[_0x6348('0x1b')]()]+_0x6348('0x2b'));_0x25f303['userEmail']=_0x40ceed['username'];for(_0x3d4b0c=0x0;_0x3d4b0c<_0xc9b449['length'];_0x3d4b0c++){if(_0xc9b449[_0x3d4b0c][_0x6348('0x26')]===_0x40ceed['username']){_0x25f303['userId']=_0xc9b449[_0x3d4b0c][_0x6348('0x2a')];}}}_0x488222(_0x25f303);})[_0x6348('0x19')](function(_0x4d2280){_0x3042ab(_0x4d2280[_0x6348('0x1d')]);});});}function createEndUser(_0x2a4ef4,_0x2f1c77,_0xf653a4,_0x3325fa,_0x37d005,_0x591d82,_0x2e4e86){return new Promise(function(_0x94cc02,_0x4f0de2){return getAuthToken(_0x2f1c77,_0xf653a4,_0x591d82)[_0x6348('0x18')](function(_0x473010){var _0x13af7e=_0x591d82[_0x6348('0x2c')]()===_0x6348('0x2d')?_0x37d005[_0x6348('0x2e')]:_0x37d005['calleridnum'];var _0x2ea586={'method':'POST','uri':_0x3325fa+_0x6348('0x2f'),'body':{'fullname':_0x13af7e,'firstname':_0x13af7e,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x2a4ef4[_0x6348('0x30')]+')'},'headers':{'Authorization':_0x6348('0x31')+_0x473010,'OData-Version':_0x6348('0x20')},'json':!![],'resolveWithFullResponse':!![]};_0x2ea586[_0x6348('0x32')][_0x2e4e86]=_0x13af7e;return rp(_0x2ea586);})[_0x6348('0x18')](function(_0x119765){var _0x357e11=_0x119765['headers']['odata-entityid'];var _0x3aa857=_0x357e11[_0x6348('0x33')](_0x357e11[_0x6348('0x34')]('(')+0x1,_0x357e11[_0x6348('0x34')](')'));_0x2a4ef4['enduserId']=_0x3aa857;_0x94cc02(_0x2a4ef4);})['catch'](function(_0x431e7e){_0x4f0de2(_0x431e7e[_0x6348('0x1d')]);});});}function getEndUser(_0x1d96cb,_0x4ffc2f,_0x57d72c,_0x5cdaa6,_0x394b0a,_0x1bc09c,_0x279cd0,_0x39de0e){var _0x103014=_0x1bc09c['toLowerCase']()===_0x6348('0x2d')?_0x394b0a[_0x6348('0x2e')]:_0x394b0a[_0x6348('0x35')];return getAuthToken(_0x4ffc2f,_0x57d72c,_0x1bc09c)[_0x6348('0x18')](function(_0x36efc9){_0x39de0e=_0x39de0e?_0x39de0e:'telephone1';var _0xd411c0={'method':'GET','uri':_0x5cdaa6+'contacts?$select='+_0x39de0e+'&$filter='+_0x39de0e+_0x6348('0x36')+_0x103014['replace']('+',_0x6348('0x37'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x36efc9,'If-None-Match':null,'OData-Version':_0x6348('0x20')},'json':!![]};return rp(_0xd411c0);})[_0x6348('0x18')](function(_0x1a48eb){var _0x47988a=![];if(!_0x1a48eb)return _0x47988a;var _0x54015c=_0x1a48eb[_0x6348('0x38')];for(var _0x2ace94=0x0;_0x2ace94<_0x54015c[_0x6348('0x25')];_0x2ace94++){if(_0x54015c[_0x2ace94][_0x39de0e]===_0x103014){_0x47988a=!![];_0x1d96cb['enduserId']=_0x54015c[_0x2ace94][_0x6348('0x39')];}}return _0x47988a;})[_0x6348('0x18')](function(_0x29a9cb){if(_0x29a9cb)return _0x1d96cb;if(_0x279cd0===_0x6348('0x3a')){logger[_0x6348('0x28')]('['+[_0x1bc09c[_0x6348('0x1b')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x1d96cb;}return createEndUser(_0x1d96cb,_0x4ffc2f,_0x57d72c,_0x5cdaa6,_0x394b0a,_0x1bc09c,_0x39de0e)['then'](function(_0x174e83){logger[_0x6348('0x28')]('['+[_0x1bc09c[_0x6348('0x1b')]()]+_0x6348('0x3b'),_0x174e83[_0x6348('0x3c')]);return _0x174e83;});});}function getCustomFields(_0xe999a5,_0x98005e,_0x3587bc){var _0x59ef3e={};if(_0xe999a5[_0x6348('0x25')]>0x0){_[_0x6348('0x3d')](_0xe999a5,function(_0x32b800){if(_[_0x6348('0x3e')]([_0x6348('0x3f'),_0x6348('0x40')],_0x32b800['type'])&&_0x32b800[_0x6348('0x41')]&&!_0x32b800['customField']){var _0x54db78=_0x32b800['idField']['toLowerCase']();var _0x39c026=_0x54db78[_0x6348('0x33')](0x0,_0x54db78[_0x6348('0x42')]('_'));var _0x1f92fd=_0x54db78[_0x6348('0x33')](_0x54db78[_0x6348('0x42')]('_')+0x1);if(_0x39c026===_0x3587bc){_0x59ef3e[_0x1f92fd]=_0x32b800[_0x6348('0x43')];}}});}return _0x59ef3e;}function getTicket(_0x5bcae6,_0x2a53e3,_0x4f4bf1,_0x5277ef,_0x3f2dd2,_0x13e4be,_0x29ba9a){return new Promise(function(_0x26dc4b,_0x12e3c2){var _0x5560f3;return getAuthToken(_0x2a53e3,_0x4f4bf1,_0x29ba9a)[_0x6348('0x18')](function(_0x7e2573){if(_0x13e4be[_0x6348('0x44')]===_0x6348('0x45')){_0x5560f3={'method':_0x6348('0x13'),'uri':_0x5277ef+'incidents','body':Object[_0x6348('0x46')]({},{'title':intUtil[_0x6348('0x47')](_0x13e4be[_0x6348('0x48')],_0x3f2dd2,'\x20'),'description':intUtil['getString'](_0x13e4be['Descriptions'],_0x3f2dd2,'\x0a'),'customerid_contact@odata.bind':_0x5bcae6[_0x6348('0x3c')]?_0x6348('0x49')+_0x5bcae6[_0x6348('0x3c')]+')':undefined,'ownerid@odata.bind':_0x6348('0x4a')+_0x5bcae6[_0x6348('0x30')]+')','caseorigincode':'1'},getCustomFields(_0x13e4be[_0x6348('0x4b')],_0x3f2dd2,_0x13e4be[_0x6348('0x44')])),'headers':{'Authorization':_0x6348('0x31')+_0x7e2573,'OData-Version':_0x6348('0x20')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x13e4be[_0x6348('0x44')]===_0x6348('0x4c')){var _0x4050e3=_0x5bcae6[_0x6348('0x3c')]?[{'partyid_systemuser@odata.bind':_0x6348('0x4a')+_0x5bcae6[_0x6348('0x30')]+')','participationtypemask':_0x5bcae6[_0x6348('0x4d')]===_0x6348('0x4e')?0x2:0x1},{'partyid_contact@odata.bind':_0x6348('0x49')+_0x5bcae6['enduserId']+')','participationtypemask':_0x5bcae6['callDirection']===_0x6348('0x4e')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x6348('0x4a')+_0x5bcae6['userId']+')','participationtypemask':_0x5bcae6[_0x6348('0x4d')]===_0x6348('0x4e')?0x2:0x1}];_0x5560f3={'method':_0x6348('0x13'),'uri':_0x5277ef+'phonecalls','body':Object[_0x6348('0x46')]({},{'subject':intUtil[_0x6348('0x47')](_0x13e4be[_0x6348('0x48')],_0x3f2dd2,'\x20'),'phonenumber':String(_0x3f2dd2[_0x6348('0x35')]),'description':intUtil[_0x6348('0x47')](_0x13e4be[_0x6348('0x4f')],_0x3f2dd2,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5bcae6['enduserId']?'/contacts('+_0x5bcae6['enduserId']+')':undefined,'ownerid@odata.bind':_0x6348('0x4a')+_0x5bcae6['userId']+')','directioncode':_0x5bcae6[_0x6348('0x4d')]===_0x6348('0x4e')?![]:!![],'phonecall_activity_parties':_0x4050e3},getCustomFields(_0x13e4be[_0x6348('0x4b')],_0x3f2dd2,_0x13e4be[_0x6348('0x44')])),'headers':{'Authorization':'Bearer\x20'+_0x7e2573,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5560f3);})[_0x6348('0x18')](function(_0x35b01c){var _0x30d30f=_0x35b01c[_0x6348('0x50')][_0x6348('0x51')];var _0x37fc56=_0x30d30f[_0x6348('0x33')](_0x30d30f[_0x6348('0x34')]('(')+0x1,_0x30d30f['lastIndexOf'](')'));_0x5bcae6[_0x6348('0x52')]=_0x37fc56;_0x26dc4b(_0x5bcae6);})[_0x6348('0x19')](function(_0x585bab){_0x12e3c2(_0x585bab[_0x6348('0x1d')]);});});}function emit(_0x4fe778,_0x3fdd45,_0x131d55,_0x4dc1b8){var _0x1ba040={'uri':util[_0x6348('0x53')](_0x6348('0x54'),_0x4fe778,_0x131d55,_0x4dc1b8)};io['to'](util[_0x6348('0x53')]('user:%s',_0x3fdd45))[_0x6348('0x55')](_0x6348('0x56'),_0x1ba040);}exports['cs']=function(_0x519ff0,_0x93c110,_0xde37b5,_0x585459,_0x58e223,_0x1ad152,_0x5265ff,_0x208367){var _0x12249b={};_0x1ad152[_0x6348('0xc')]=_0x1ad152[_0x6348('0xb')]?intUtil[_0x6348('0x57')](_0x1ad152[_0x6348('0xd')][_0x6348('0xe')]):intUtil['stripTrailingSlash'](_0x1ad152[_0x6348('0xc')]);_0x1ad152['serverUrl']=intUtil['stripTrailingSlash'](_0x1ad152[_0x6348('0x58')]);_0x12249b['callDirection']=_0x208367===_0x6348('0x4e')||_0x208367==='unmanaged'?_0x6348('0x4e'):_0x6348('0x2d');var _0x4eee2b=_0x1ad152['modernAuthentication']?util['format'](_0x6348('0x59'),_0x1ad152[_0x6348('0xd')]['data7']):util[_0x6348('0x53')](_0x6348('0x59'),_0x1ad152[_0x6348('0xc')]);var _0x4e13f4=util[_0x6348('0x53')](_0x6348('0x5a'),_0x1ad152[_0x6348('0xf')]);var _0xf8597d=util[_0x6348('0x53')](_0x6348('0x5b'),_0x1ad152[_0x6348('0x58')],_0x93c110[_0x6348('0x5c')],md5(_0x93c110[_0x6348('0x5c')]));if(_0x58e223&&_0x58e223[_0x6348('0x5d')]){logger['info'](_0x6348('0x5e'),_0x6348('0x5f'));_0x93c110[_0x6348('0x60')]=_0xf8597d;}else if(_0x5265ff&&_0x5265ff[_0x6348('0x61')]&&_0x5265ff[_0x6348('0x61')]!==_0x6348('0x62')){logger[_0x6348('0x28')](_0x6348('0x63'),_0x6348('0x5f'));_0x93c110['recordingURL']=_0xf8597d;}else{_0x93c110[_0x6348('0x60')]='';}return getUser(_0x12249b,_0x1ad152,_0x585459,_0x4e13f4,_0x4eee2b,_0x208367)[_0x6348('0x18')](function(_0x3a9bf3){logger[_0x6348('0x28')]('['+_0x208367['toUpperCase']()+_0x6348('0x64'),_0x3a9bf3['userId']);logger[_0x6348('0x28')]('['+_0x208367[_0x6348('0x1b')]()+']\x20The\x20User\x20email\x20is:',_0x3a9bf3[_0x6348('0x23')]);return getEndUser(_0x3a9bf3,_0x1ad152,_0x4e13f4,_0x4eee2b,_0x93c110,_0x208367,_0xde37b5[_0x6348('0x65')],_0xde37b5['additionalSearchContact']);})[_0x6348('0x18')](function(_0x14bc6c){logger['info']('['+_0x208367['toUpperCase']()+_0x6348('0x66'),_0x14bc6c['enduserId']);logger[_0x6348('0x28')]('['+_0x208367[_0x6348('0x1b')]()+_0x6348('0x67'),_0x93c110[_0x6348('0x35')]);return getTicket(_0x14bc6c,_0x1ad152,_0x4e13f4,_0x4eee2b,_0x93c110,_0xde37b5,_0x208367);})['then'](function(_0x1fe35d){logger[_0x6348('0x28')](util[_0x6348('0x53')]('['+_0x208367['toUpperCase']()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0xde37b5['ticketType'],_0x1fe35d[_0x6348('0x52')]));logger[_0x6348('0x28')](util[_0x6348('0x53')]('['+_0x208367[_0x6348('0x1b')]()+_0x6348('0x68'),_0x208367));if(_0x208367!=='unmanaged'&&_0xde37b5[_0x6348('0x69')]){logger['info']('['+_0x208367[_0x6348('0x1b')]()+']',_0x6348('0x6a'));emit(_0x1ad152[_0x6348('0xc')],_0x585459[_0x6348('0x6b')],_0xde37b5[_0x6348('0x44')],_0x1fe35d[_0x6348('0x52')]);}})[_0x6348('0x19')](function(_0x12dc6f){logger[_0x6348('0x1a')]('['+_0x208367[_0x6348('0x1b')]()+_0x6348('0x6c'),_0x12dc6f['message']);console[_0x6348('0x1a')](_0x6348('0x6d'),_0x12dc6f);});}; \ 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 cb83d0b..7c14869 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 _0x0bb6=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','error','stringify','outbound','recordingFormat','none','email','destcalleridname','The\x20Enduser\x20ID\x20is:','trigger:browser:url','%s/helpdesk/tickets/%d','[OUTBOUND]','unmanaged','monitor_format','lastevent','catch','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','freshdesk','redis','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','Tags','Fields','custom_fields','mapValues','keyBy','format','remoteUri','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','length','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','defaults','map','forEach','includes','picklist','nameField','customField','toLowerCase','string','type','push','idField','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL'];(function(_0x41f16b,_0x111110){var _0x138673=function(_0x10fc7e){while(--_0x10fc7e){_0x41f16b['push'](_0x41f16b['shift']());}};_0x138673(++_0x111110);}(_0x0bb6,0x1ec));var _0x60bb=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0bb6[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x60bb('0x0'));var rp=require(_0x60bb('0x1'));var md5=require(_0x60bb('0x2'));var util=require(_0x60bb('0x3'));var Redis=require(_0x60bb('0x4'));var intUtil=require(_0x60bb('0x5'));var config=require('../../../../config/environment');var logger=require(_0x60bb('0x6'))(_0x60bb('0x7'));config[_0x60bb('0x8')]=_['defaults'](config[_0x60bb('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x60bb('0x9'))(new Redis(config[_0x60bb('0x8')]));var headers={'Content-Type':_0x60bb('0xa'),'Accept':_0x60bb('0xa')};function emit(_0x33261b,_0x555066,_0x4f5b00){io['to'](_0x33261b)[_0x60bb('0xb')](_0x555066,_0x4f5b00);}function getTicket(_0x19df89,_0x2c7ea0,_0x75f456,_0xc6285a,_0x123abe){logger[_0x60bb('0xc')](_0x60bb('0xd'));var _0x198991=_[_0x60bb('0xe')]({'responder_id':_0x2c7ea0['id'],'requester_id':_0x75f456['id'],'name':util['format'](_0x60bb('0xf'),_0x123abe[_0x60bb('0x10')]),'phone':_0x123abe[_0x60bb('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x60bb('0x12')](_0xc6285a[_0x60bb('0x13')],_0x123abe,'\x20'),'description':intUtil[_0x60bb('0x12')](_0xc6285a[_0x60bb('0x14')],_0x123abe,'
'),'tags':getTags(_0xc6285a[_0x60bb('0x15')],'name')},getCustomFields(_0xc6285a[_0x60bb('0x16')],_0x123abe));_0x198991[_0x60bb('0x17')]=_[_0x60bb('0x18')](_[_0x60bb('0x19')](_0x198991[_0x60bb('0x17')],'id'),'value');return request({'uri':util[_0x60bb('0x1a')]('%s/api/v2/tickets',_0x19df89[_0x60bb('0x1b')]),'method':'POST','body':_0x198991})['then'](function(_0x1f83e2){logger[_0x60bb('0xc')](_0x60bb('0x1c'));return _0x1f83e2;});}function getUser(_0x4409b3,_0x45d9ff){if(intUtil[_0x60bb('0x1d')](_0x45d9ff)){return request({'uri':util[_0x60bb('0x1a')](_0x60bb('0x1e'),_0x4409b3[_0x60bb('0x1b')]),'qs':{'email':_0x45d9ff}})[_0x60bb('0x1f')](function(_0x5bcd73){if(_0x5bcd73[_0x60bb('0x20')]){logger['info'](_0x60bb('0x21'));return _[_0x60bb('0x22')](_0x5bcd73,function(_0x98406b){return _0x98406b['contact']['email']===_0x45d9ff;});}else{logger[_0x60bb('0xc')](_0x60bb('0x23'));return request({'uri':util[_0x60bb('0x1a')]('%s/api/v2/agents/me',_0x4409b3[_0x60bb('0x1b')])})[_0x60bb('0x1f')](function(_0x364d5a){logger['info'](_0x60bb('0x24'));return _0x364d5a;});}});}else{logger[_0x60bb('0xc')](_0x60bb('0x25'));return request({'uri':util[_0x60bb('0x1a')](_0x60bb('0x26'),_0x4409b3[_0x60bb('0x1b')])})[_0x60bb('0x1f')](function(_0x4d601f){logger[_0x60bb('0xc')](_0x60bb('0x24'));return _0x4d601f;});}}function getEndUser(_0x5a05f4,_0x33adda,_0x2d8e49){logger[_0x60bb('0xc')](_0x60bb('0x27'),_0x2d8e49);return request({'uri':util['format']('%s/api/v2/contacts',_0x5a05f4[_0x60bb('0x1b')]),'qs':{'phone':_0x2d8e49}})['then'](function(_0x54f7a2){if(_0x54f7a2[_0x60bb('0x20')]){logger[_0x60bb('0xc')](_0x60bb('0x28'));return _[_0x60bb('0x22')](_0x54f7a2,{'phone':_0x2d8e49});}else{logger[_0x60bb('0xc')](_0x60bb('0x29'));return request({'uri':util[_0x60bb('0x1a')](_0x60bb('0x2a'),_0x5a05f4[_0x60bb('0x1b')]),'method':'POST','body':{'name':_0x33adda,'phone':_0x2d8e49}})['then'](function(_0x3ce2c3){logger[_0x60bb('0xc')](_0x60bb('0x2b'));return _0x3ce2c3;});}});}function getAuth(_0x5ad6ef){return util[_0x60bb('0x1a')](_0x60bb('0x2c'),new Buffer(_0x5ad6ef[_0x60bb('0x2d')]+':X')[_0x60bb('0x2e')](_0x60bb('0x2f')));}function request(_0x1a36ed){logger[_0x60bb('0x30')](_0x60bb('0x31'),JSON['stringify'](_0x1a36ed));return rp(_[_0x60bb('0x32')](_0x1a36ed,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x19554f,_0x355030){var _0x379696=[];if(_0x19554f&&_0x19554f['length']>0x0){_0x379696=_[_0x60bb('0x33')](_0x19554f,_0x355030);}return _0x379696;}function getCustomFields(_0x338746,_0x355809){var _0xf356d7=[];var _0x9c158a={'custom_fields':[]};if(_0x338746[_0x60bb('0x20')]>0x0){_[_0x60bb('0x34')](_0x338746,function(_0x643a1c){if(_[_0x60bb('0x35')](['string',_0x60bb('0x36')],_0x643a1c['type'])&&_0x643a1c[_0x60bb('0x37')]&&!_0x643a1c[_0x60bb('0x38')]){_0x9c158a[_0x643a1c[_0x60bb('0x37')][_0x60bb('0x39')]()]=_0x643a1c['content'][_0x60bb('0x2e')]();}else if(_[_0x60bb('0x35')]([_0x60bb('0x3a'),_0x60bb('0x36')],_0x643a1c[_0x60bb('0x3b')])&&_0x643a1c['idField']&&_0x643a1c[_0x60bb('0x38')]){_0x9c158a[_0x60bb('0x17')][_0x60bb('0x3c')]({'id':_0x643a1c[_0x60bb('0x3d')],'value':_0x643a1c['content'][_0x60bb('0x2e')]()});}else if(_0x643a1c[_0x60bb('0x3b')]==='variable'&&_0x643a1c[_0x60bb('0x3e')]&&_0x643a1c[_0x60bb('0x3d')]&&_0x643a1c[_0x60bb('0x38')]){_0x355809[_0x643a1c[_0x60bb('0x3e')]]&&_0x9c158a[_0x60bb('0x17')][_0x60bb('0x3c')]({'id':_0x643a1c[_0x60bb('0x3d')],'value':_0x355809[_0x643a1c[_0x60bb('0x3e')]][_0x60bb('0x2e')]()});}else if(_0x643a1c[_0x60bb('0x3b')]===_0x60bb('0x3f')&&_0x643a1c['Variable']&&_0x643a1c['Variable']['name']&&_0x643a1c['idField']&&_0x643a1c[_0x60bb('0x38')]){_0x355809[_0x643a1c[_0x60bb('0x40')][_0x60bb('0x41')][_0x60bb('0x39')]()]&&_0x9c158a[_0x60bb('0x17')][_0x60bb('0x3c')]({'id':_0x643a1c[_0x60bb('0x3d')],'value':_0x355809[_0x643a1c[_0x60bb('0x40')]['name'][_0x60bb('0x39')]()][_0x60bb('0x2e')]()});}});}return _0x9c158a;}exports[_0x60bb('0x42')]=function(_0x2a4596,_0x3de9f7,_0x5e30ae,_0x40ccfd,_0x3d8934,_0x58b65e){var _0x449eed,_0x215fb8;_0x58b65e[_0x60bb('0x1b')]=intUtil[_0x60bb('0x43')](_0x58b65e[_0x60bb('0x1b')]);_0x58b65e[_0x60bb('0x44')]=intUtil[_0x60bb('0x43')](_0x58b65e[_0x60bb('0x44')]);if(_0x3d8934&&_0x3d8934['monitor_format']){logger[_0x60bb('0xc')](_0x60bb('0x45'),_0x60bb('0x46'));_0x3de9f7[_0x60bb('0x47')]=util[_0x60bb('0x1a')](_0x60bb('0x48'),_0x58b65e[_0x60bb('0x44')],_0x3de9f7[_0x60bb('0x49')],md5(_0x3de9f7[_0x60bb('0x49')]));}else{_0x3de9f7[_0x60bb('0x47')]='';}headers[_0x60bb('0x4a')]=getAuth(_0x58b65e);return getUser(_0x58b65e,_0x40ccfd['email'])[_0x60bb('0x1f')](function(_0x238c22){_0x449eed=_0x238c22;logger[_0x60bb('0xc')](_0x60bb('0x4b'),_0x449eed['id']);return getEndUser(_0x58b65e,_0x3de9f7[_0x60bb('0x10')],_0x3de9f7[_0x60bb('0x11')]);})[_0x60bb('0x1f')](function(_0x3e1cae){_0x215fb8=_0x3e1cae;logger[_0x60bb('0xc')]('The\x20Enduser\x20ID\x20is:',_0x215fb8['id']);return getTicket(_0x58b65e,_0x449eed,_0x215fb8,_0x5e30ae,_0x3de9f7);})[_0x60bb('0x1f')](function(_0x3e15b2){if(_0x3e15b2&&_0x3e15b2['id']){logger[_0x60bb('0xc')](_0x60bb('0x1c'));logger[_0x60bb('0xc')](_0x60bb('0x4c'),_0x3e15b2['id']);logger[_0x60bb('0xc')](_0x60bb('0x45'),_0x60bb('0x4d'));emit(util[_0x60bb('0x1a')](_0x60bb('0x4e'),_0x40ccfd[_0x60bb('0x41')]),'trigger:browser:url',{'uri':util[_0x60bb('0x1a')]('%s/helpdesk/tickets/%d',_0x58b65e['remoteUri'],_0x3e15b2['id'])});}})['catch'](function(_0x5a4a9e){logger[_0x60bb('0x4f')]('[QUEUE]',JSON[_0x60bb('0x50')](_0x5a4a9e));});};exports[_0x60bb('0x51')]=function(_0x420300,_0x4eb0fe,_0xf6a790,_0x211c9a,_0x4e4204,_0x4fe60e,_0x2b4551){var _0x29508d,_0x5be753;_0x4fe60e['remoteUri']=intUtil[_0x60bb('0x43')](_0x4fe60e[_0x60bb('0x1b')]);_0x4fe60e[_0x60bb('0x44')]=intUtil[_0x60bb('0x43')](_0x4fe60e[_0x60bb('0x44')]);if(_0x2b4551&&_0x2b4551[_0x60bb('0x52')]&&_0x2b4551[_0x60bb('0x52')]!==_0x60bb('0x53')){logger['info']('[OUTBOUND]',_0x60bb('0x46'));_0x4eb0fe[_0x60bb('0x47')]=util[_0x60bb('0x1a')](_0x60bb('0x48'),_0x4fe60e[_0x60bb('0x44')],_0x4eb0fe[_0x60bb('0x49')],md5(_0x4eb0fe[_0x60bb('0x49')]));}headers[_0x60bb('0x4a')]=getAuth(_0x4fe60e);return getUser(_0x4fe60e,_0x211c9a[_0x60bb('0x54')])[_0x60bb('0x1f')](function(_0x27240e){_0x29508d=_0x27240e;logger[_0x60bb('0xc')](_0x60bb('0x4b'),_0x29508d['id']);return getEndUser(_0x4fe60e,_0x4eb0fe[_0x60bb('0x55')],_0x4eb0fe['destcalleridnum']);})[_0x60bb('0x1f')](function(_0x2c5c9b){_0x5be753=_0x2c5c9b;logger[_0x60bb('0xc')](_0x60bb('0x56'),_0x5be753['id']);return getTicket(_0x4fe60e,_0x29508d,_0x5be753,_0xf6a790,_0x4eb0fe);})['then'](function(_0x45ca74){if(_0x45ca74&&_0x45ca74['id']){logger['info'](_0x60bb('0x1c'));logger[_0x60bb('0xc')](_0x60bb('0x4c'),_0x45ca74['id']);logger[_0x60bb('0xc')]('[OUTBOUND]',_0x60bb('0x4d'));emit(util[_0x60bb('0x1a')](_0x60bb('0x4e'),_0x211c9a[_0x60bb('0x41')]),_0x60bb('0x57'),{'uri':util[_0x60bb('0x1a')](_0x60bb('0x58'),_0x4fe60e[_0x60bb('0x1b')],_0x45ca74['id'])});}})['catch'](function(_0x3a5c61){logger['error'](_0x60bb('0x59'),JSON[_0x60bb('0x50')](_0x3a5c61));});};exports[_0x60bb('0x5a')]=function(_0x17d0f2,_0x592107,_0x5d2be3,_0x4a74a9,_0x101251,_0x5d9355){var _0x7bc667,_0x2d4093;_0x5d9355[_0x60bb('0x1b')]=intUtil[_0x60bb('0x43')](_0x5d9355[_0x60bb('0x1b')]);_0x5d9355[_0x60bb('0x44')]=intUtil[_0x60bb('0x43')](_0x5d9355[_0x60bb('0x44')]);if(_0x101251&&_0x101251[_0x60bb('0x5b')]){logger[_0x60bb('0xc')]('['+_0x592107[_0x60bb('0x5c')]['toUpperCase']()+']',_0x60bb('0x46'));_0x592107[_0x60bb('0x47')]=util[_0x60bb('0x1a')](_0x60bb('0x48'),_0x5d9355[_0x60bb('0x44')],_0x592107[_0x60bb('0x49')],md5(_0x592107['uniqueid']));}else{_0x592107[_0x60bb('0x47')]='';}headers[_0x60bb('0x4a')]=getAuth(_0x5d9355);return getUser(_0x5d9355,'')[_0x60bb('0x1f')](function(_0x2868b0){_0x7bc667=_0x2868b0;logger['info'](_0x60bb('0x4b'),_0x7bc667['id']);return getEndUser(_0x5d9355,_0x592107['calleridname'],_0x592107[_0x60bb('0x11')]);})[_0x60bb('0x1f')](function(_0x3ddf68){_0x2d4093=_0x3ddf68;logger[_0x60bb('0xc')](_0x60bb('0x56'),_0x2d4093['id']);return getTicket(_0x5d9355,_0x7bc667,_0x2d4093,_0x5d2be3,_0x592107);})[_0x60bb('0x1f')](function(_0x2a4980){if(_0x2a4980){logger['info']('Ticket\x20created!');logger[_0x60bb('0xc')](_0x60bb('0x4c'),_0x2a4980['id']);}})[_0x60bb('0x5d')](function(_0x131a51){logger[_0x60bb('0x4f')]('['+_0x592107[_0x60bb('0x5c')]['toUpperCase']()+']',JSON['stringify'](_0x131a51));});}; \ No newline at end of file +var _0x6108=['calleridname','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','then','length','Agent\x20found!','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','GET','forEach','string','type','nameField','customField','toLowerCase','content','picklist','idField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','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','catch','error','recordingFormat','none','[OUTBOUND]','destcalleridnum','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6108,0xa9));var _0x8610=function(_0x265976,_0x49e1dc){_0x265976=_0x265976-0x0;var _0x407c33=_0x6108[_0x265976];return _0x407c33;};'use strict';var _=require(_0x8610('0x0'));var rp=require(_0x8610('0x1'));var md5=require(_0x8610('0x2'));var util=require(_0x8610('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x8610('0x4'));var logger=require(_0x8610('0x5'))(_0x8610('0x6'));config['redis']=_[_0x8610('0x7')](config[_0x8610('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8610('0x8')]));var headers={'Content-Type':_0x8610('0x9'),'Accept':_0x8610('0x9')};function emit(_0x2486a9,_0x3d20dd,_0x2bab6a){io['to'](_0x2486a9)[_0x8610('0xa')](_0x3d20dd,_0x2bab6a);}function getTicket(_0x57bee9,_0x26f0d3,_0x24eefc,_0x18ff59,_0x440322){logger['info'](_0x8610('0xb'));var _0x172d9f=_[_0x8610('0xc')]({'responder_id':_0x26f0d3['id'],'requester_id':_0x24eefc['id'],'name':util[_0x8610('0xd')](_0x8610('0xe'),_0x440322[_0x8610('0xf')]),'phone':_0x440322['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x8610('0x10')](_0x18ff59[_0x8610('0x11')],_0x440322,'\x20'),'description':intUtil['getString'](_0x18ff59[_0x8610('0x12')],_0x440322,_0x8610('0x13')),'tags':getTags(_0x18ff59[_0x8610('0x14')],_0x8610('0x15'))},getCustomFields(_0x18ff59[_0x8610('0x16')],_0x440322));_0x172d9f[_0x8610('0x17')]=_[_0x8610('0x18')](_[_0x8610('0x19')](_0x172d9f['custom_fields'],'id'),'value');return request({'uri':util['format'](_0x8610('0x1a'),_0x57bee9['remoteUri']),'method':'POST','body':_0x172d9f})['then'](function(_0x40a753){logger[_0x8610('0x1b')](_0x8610('0x1c'));return _0x40a753;});}function getUser(_0x3753b9,_0x5bdac9){if(intUtil[_0x8610('0x1d')](_0x5bdac9)){return request({'uri':util[_0x8610('0xd')](_0x8610('0x1e'),_0x3753b9[_0x8610('0x1f')]),'qs':{'email':_0x5bdac9}})[_0x8610('0x20')](function(_0x483387){if(_0x483387[_0x8610('0x21')]){logger[_0x8610('0x1b')](_0x8610('0x22'));return _['find'](_0x483387,function(_0x3e0419){return _0x3e0419[_0x8610('0x23')]['email']===_0x5bdac9;});}else{logger[_0x8610('0x1b')](_0x8610('0x24'));return request({'uri':util[_0x8610('0xd')](_0x8610('0x25'),_0x3753b9[_0x8610('0x1f')])})['then'](function(_0x509b3b){logger['info'](_0x8610('0x26'));return _0x509b3b;});}});}else{logger[_0x8610('0x1b')](_0x8610('0x27'));return request({'uri':util['format'](_0x8610('0x25'),_0x3753b9[_0x8610('0x1f')])})[_0x8610('0x20')](function(_0x123c16){logger[_0x8610('0x1b')]('Admin\x20account\x20selected.');return _0x123c16;});}}function getEndUser(_0x145f0b,_0x2b0bea,_0x6cf175){logger[_0x8610('0x1b')](_0x8610('0x28'),_0x6cf175);return request({'uri':util[_0x8610('0xd')]('%s/api/v2/contacts',_0x145f0b[_0x8610('0x1f')]),'qs':{'phone':_0x6cf175}})[_0x8610('0x20')](function(_0x254695){if(_0x254695[_0x8610('0x21')]){logger['info']('Enduser\x20found!');return _['find'](_0x254695,{'phone':_0x6cf175});}else{logger[_0x8610('0x1b')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x8610('0xd')]('%s/api/v2/contacts',_0x145f0b[_0x8610('0x1f')]),'method':_0x8610('0x29'),'body':{'name':_0x2b0bea,'phone':_0x6cf175}})['then'](function(_0x101690){logger[_0x8610('0x1b')](_0x8610('0x2a'));return _0x101690;});}});}function getAuth(_0x40fe94){return util[_0x8610('0xd')](_0x8610('0x2b'),new Buffer(_0x40fe94[_0x8610('0x2c')]+':X')[_0x8610('0x2d')]('base64'));}function request(_0x4ba387){logger[_0x8610('0x2e')](_0x8610('0x2f'),JSON[_0x8610('0x30')](_0x4ba387));return rp(_[_0x8610('0x7')](_0x4ba387,{'method':_0x8610('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x14ecee,_0x1db284){var _0x2a9ad1=[];if(_0x14ecee&&_0x14ecee[_0x8610('0x21')]>0x0){_0x2a9ad1=_['map'](_0x14ecee,_0x1db284);}return _0x2a9ad1;}function getCustomFields(_0xbf088a,_0x2225bc){var _0x3e201d=[];var _0x3c05cb={'custom_fields':[]};if(_0xbf088a['length']>0x0){_[_0x8610('0x32')](_0xbf088a,function(_0x24625a){if(_['includes']([_0x8610('0x33'),'picklist'],_0x24625a[_0x8610('0x34')])&&_0x24625a[_0x8610('0x35')]&&!_0x24625a[_0x8610('0x36')]){_0x3c05cb[_0x24625a[_0x8610('0x35')][_0x8610('0x37')]()]=_0x24625a[_0x8610('0x38')][_0x8610('0x2d')]();}else if(_['includes']([_0x8610('0x33'),_0x8610('0x39')],_0x24625a['type'])&&_0x24625a[_0x8610('0x3a')]&&_0x24625a[_0x8610('0x36')]){_0x3c05cb[_0x8610('0x17')][_0x8610('0x3b')]({'id':_0x24625a['idField'],'value':_0x24625a[_0x8610('0x38')][_0x8610('0x2d')]()});}else if(_0x24625a[_0x8610('0x34')]===_0x8610('0x3c')&&_0x24625a['variableName']&&_0x24625a['idField']&&_0x24625a['customField']){_0x2225bc[_0x24625a[_0x8610('0x3d')]]&&_0x3c05cb[_0x8610('0x17')]['push']({'id':_0x24625a[_0x8610('0x3a')],'value':_0x2225bc[_0x24625a[_0x8610('0x3d')]][_0x8610('0x2d')]()});}else if(_0x24625a[_0x8610('0x34')]===_0x8610('0x3e')&&_0x24625a[_0x8610('0x3f')]&&_0x24625a[_0x8610('0x3f')][_0x8610('0x15')]&&_0x24625a[_0x8610('0x3a')]&&_0x24625a['customField']){_0x2225bc[_0x24625a['Variable'][_0x8610('0x15')]['toLowerCase']()]&&_0x3c05cb['custom_fields'][_0x8610('0x3b')]({'id':_0x24625a[_0x8610('0x3a')],'value':_0x2225bc[_0x24625a[_0x8610('0x3f')][_0x8610('0x15')][_0x8610('0x37')]()][_0x8610('0x2d')]()});}});}return _0x3c05cb;}exports[_0x8610('0x40')]=function(_0x457db9,_0x51e36e,_0x26fa10,_0x2b73e3,_0x56e614,_0x350645){var _0x44cf19,_0x424190;_0x350645['remoteUri']=intUtil[_0x8610('0x41')](_0x350645['remoteUri']);_0x350645[_0x8610('0x42')]=intUtil[_0x8610('0x41')](_0x350645['serverUrl']);if(_0x56e614&&_0x56e614[_0x8610('0x43')]){logger[_0x8610('0x1b')](_0x8610('0x44'),_0x8610('0x45'));_0x51e36e[_0x8610('0x46')]=util[_0x8610('0xd')](_0x8610('0x47'),_0x350645[_0x8610('0x42')],_0x51e36e[_0x8610('0x48')],md5(_0x51e36e[_0x8610('0x48')]));}else{_0x51e36e[_0x8610('0x46')]='';}headers[_0x8610('0x49')]=getAuth(_0x350645);return getUser(_0x350645,_0x2b73e3[_0x8610('0x4a')])[_0x8610('0x20')](function(_0x433fc5){_0x44cf19=_0x433fc5;logger[_0x8610('0x1b')](_0x8610('0x4b'),_0x44cf19['id']);return getEndUser(_0x350645,_0x51e36e[_0x8610('0xf')],_0x51e36e[_0x8610('0x4c')]);})[_0x8610('0x20')](function(_0x58deab){_0x424190=_0x58deab;logger[_0x8610('0x1b')](_0x8610('0x4d'),_0x424190['id']);return getTicket(_0x350645,_0x44cf19,_0x424190,_0x26fa10,_0x51e36e);})['then'](function(_0x35d73f){if(_0x35d73f&&_0x35d73f['id']){logger[_0x8610('0x1b')](_0x8610('0x1c'));logger[_0x8610('0x1b')](_0x8610('0x4e'),_0x35d73f['id']);logger[_0x8610('0x1b')](_0x8610('0x44'),_0x8610('0x4f'));emit(util['format'](_0x8610('0x50'),_0x2b73e3[_0x8610('0x15')]),_0x8610('0x51'),{'uri':util[_0x8610('0xd')](_0x8610('0x52'),_0x350645[_0x8610('0x1f')],_0x35d73f['id'])});}})[_0x8610('0x53')](function(_0x4689c5){logger[_0x8610('0x54')](_0x8610('0x44'),JSON[_0x8610('0x30')](_0x4689c5));});};exports['outbound']=function(_0x250a84,_0x50b284,_0x49563b,_0x962ed7,_0x185a70,_0x1a7c38,_0x68562a){var _0x3fbb1b,_0x444bc8;_0x1a7c38['remoteUri']=intUtil['stripTrailingSlash'](_0x1a7c38['remoteUri']);_0x1a7c38[_0x8610('0x42')]=intUtil[_0x8610('0x41')](_0x1a7c38['serverUrl']);if(_0x68562a&&_0x68562a[_0x8610('0x55')]&&_0x68562a[_0x8610('0x55')]!==_0x8610('0x56')){logger[_0x8610('0x1b')](_0x8610('0x57'),_0x8610('0x45'));_0x50b284['recordingURL']=util[_0x8610('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1a7c38['serverUrl'],_0x50b284[_0x8610('0x48')],md5(_0x50b284[_0x8610('0x48')]));}headers[_0x8610('0x49')]=getAuth(_0x1a7c38);return getUser(_0x1a7c38,_0x962ed7[_0x8610('0x4a')])[_0x8610('0x20')](function(_0x19fcac){_0x3fbb1b=_0x19fcac;logger[_0x8610('0x1b')](_0x8610('0x4b'),_0x3fbb1b['id']);return getEndUser(_0x1a7c38,_0x50b284['destcalleridname'],_0x50b284[_0x8610('0x58')]);})[_0x8610('0x20')](function(_0x125660){_0x444bc8=_0x125660;logger[_0x8610('0x1b')](_0x8610('0x4d'),_0x444bc8['id']);return getTicket(_0x1a7c38,_0x3fbb1b,_0x444bc8,_0x49563b,_0x50b284);})[_0x8610('0x20')](function(_0x177e5c){if(_0x177e5c&&_0x177e5c['id']){logger[_0x8610('0x1b')]('Ticket\x20created!');logger[_0x8610('0x1b')](_0x8610('0x4e'),_0x177e5c['id']);logger[_0x8610('0x1b')]('[OUTBOUND]',_0x8610('0x4f'));emit(util[_0x8610('0xd')]('user:%s',_0x962ed7[_0x8610('0x15')]),_0x8610('0x51'),{'uri':util['format'](_0x8610('0x52'),_0x1a7c38[_0x8610('0x1f')],_0x177e5c['id'])});}})['catch'](function(_0x3e86eb){logger[_0x8610('0x54')](_0x8610('0x57'),JSON[_0x8610('0x30')](_0x3e86eb));});};exports[_0x8610('0x59')]=function(_0x40ba58,_0x274672,_0x56b45f,_0x353903,_0x49a6b4,_0x3461ed){var _0x1d785f,_0x387ccd;_0x3461ed[_0x8610('0x1f')]=intUtil['stripTrailingSlash'](_0x3461ed[_0x8610('0x1f')]);_0x3461ed[_0x8610('0x42')]=intUtil[_0x8610('0x41')](_0x3461ed[_0x8610('0x42')]);if(_0x49a6b4&&_0x49a6b4['monitor_format']){logger['info']('['+_0x274672[_0x8610('0x5a')][_0x8610('0x5b')]()+']',_0x8610('0x45'));_0x274672[_0x8610('0x46')]=util[_0x8610('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3461ed[_0x8610('0x42')],_0x274672[_0x8610('0x48')],md5(_0x274672[_0x8610('0x48')]));}else{_0x274672[_0x8610('0x46')]='';}headers['Authorization']=getAuth(_0x3461ed);return getUser(_0x3461ed,'')['then'](function(_0x349050){_0x1d785f=_0x349050;logger[_0x8610('0x1b')]('The\x20User\x20ID\x20is:',_0x1d785f['id']);return getEndUser(_0x3461ed,_0x274672[_0x8610('0xf')],_0x274672[_0x8610('0x4c')]);})[_0x8610('0x20')](function(_0x3569e2){_0x387ccd=_0x3569e2;logger[_0x8610('0x1b')](_0x8610('0x4d'),_0x387ccd['id']);return getTicket(_0x3461ed,_0x1d785f,_0x387ccd,_0x56b45f,_0x274672);})[_0x8610('0x20')](function(_0x2d5891){if(_0x2d5891){logger[_0x8610('0x1b')](_0x8610('0x1c'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x2d5891['id']);}})[_0x8610('0x53')](function(_0x2e683d){logger[_0x8610('0x54')]('['+_0x274672['lastevent'][_0x8610('0x5b')]()+']',JSON[_0x8610('0x30')](_0x2e683d));});}; \ 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 52bb0ab..2a4f0ae 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 _0x5d9c=['../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','agentEmail','userEmail','userId','User\x20found:','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','work_number','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','queue','unmanaged','outbound','email','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util'];(function(_0x27702a,_0x59dfce){var _0x2fcd9d=function(_0x3f8b3f){while(--_0x3f8b3f){_0x27702a['push'](_0x27702a['shift']());}};_0x2fcd9d(++_0x59dfce);}(_0x5d9c,0x192));var _0xc5d9=function(_0x541963,_0x3518f0){_0x541963=_0x541963-0x0;var _0x2415b1=_0x5d9c[_0x541963];return _0x2415b1;};'use strict';var _=require(_0xc5d9('0x0'));var rp=require(_0xc5d9('0x1'));var md5=require(_0xc5d9('0x2'));var util=require(_0xc5d9('0x3'));var moment=require(_0xc5d9('0x4'));var Promise=require(_0xc5d9('0x5'));var Redis=require(_0xc5d9('0x6'));var intUtil=require(_0xc5d9('0x7'));var config=require('../../../../config/environment');var logger=require(_0xc5d9('0x8'))(_0xc5d9('0x9'));config['redis']=_['defaults'](config[_0xc5d9('0xa')],{'host':_0xc5d9('0xb'),'port':0x18eb});var io=require(_0xc5d9('0xc'))(new Redis(config[_0xc5d9('0xa')]));function getAdminId(_0x36511c,_0x5d2f96,_0x3b2b05,_0x41f0c7){return new Promise(function(_0x20daa6,_0x206a24){var _0x20bd75=![];var _0x3b6701={'method':_0xc5d9('0xd'),'uri':_0x41f0c7+_0xc5d9('0xe'),'json':!![]};_0x3b6701[_0xc5d9('0xf')]=_0x3b2b05;logger[_0xc5d9('0x10')](_0xc5d9('0x11'));return rp(_0x3b6701)[_0xc5d9('0x12')](function(_0x197810){if(_0x197810){var _0x3939b4=_0x197810[_0xc5d9('0x13')];var _0xe379e1=null;for(_0xe379e1=0x0;_0xe379e1<_0x3939b4[_0xc5d9('0x14')];_0xe379e1++){if(_0x3939b4[_0xe379e1]['email']===_0x36511c[_0xc5d9('0x15')]){_0x36511c['adminId']=_0x3939b4[_0xe379e1]['id'];_0x20bd75=!![];}}if(_0x20bd75){logger[_0xc5d9('0x10')]('Admin\x20found:',_0x36511c[_0xc5d9('0x16')]);_0x20daa6(_0x36511c);}else{_0x206a24({'statusCode':0x194,'message':_0xc5d9('0x17')});}}else{_0x206a24({'statusCode':0x194,'message':_0xc5d9('0x17')});}})[_0xc5d9('0x18')](function(_0x497da5){logger[_0xc5d9('0x19')]('['+[_0x5d2f96[_0xc5d9('0x1a')]()]+']',_0x497da5[_0xc5d9('0x1b')]);_0x206a24(_0x497da5);});});}function getUser(_0x5c796e,_0x144506,_0x1fa214){return function(_0xfa935){return new Promise(function(_0x3d432f,_0x234787){var _0x38a650={'method':_0xc5d9('0xd'),'uri':_0x1fa214+'/api/selector/owners','json':!![]};_0x38a650['headers']=_0x144506;logger[_0xc5d9('0x10')]('Getting\x20user\x20list');return rp(_0x38a650)[_0xc5d9('0x12')](function(_0x2a9459){if(_0x2a9459){var _0x587e45=_0x2a9459[_0xc5d9('0x13')];var _0x431a5c=![];var _0x442be3=null;if(_0xfa935[_0xc5d9('0x1c')]!==null){logger[_0xc5d9('0x10')]('Getting\x20user\x20with\x20email',_0xfa935[_0xc5d9('0x1c')]);_0xfa935[_0xc5d9('0x1d')]=_0xfa935[_0xc5d9('0x1c')];for(_0x442be3=0x0;_0x442be3<_0x587e45['length'];_0x442be3++){if(_0x587e45[_0x442be3]['email']===_0xfa935['agentEmail']){_0x431a5c=!![];_0xfa935[_0xc5d9('0x1e')]=_0x587e45[_0x442be3]['id'];logger[_0xc5d9('0x10')](_0xc5d9('0x1f'),_0xfa935['userId']);}}}if(!_0x431a5c){logger[_0xc5d9('0x10')]('Admin\x20selected');_0xfa935['userEmail']=_0xfa935[_0xc5d9('0x15')];_0xfa935[_0xc5d9('0x1e')]=_0xfa935[_0xc5d9('0x16')];_0x431a5c=!![];}if(_0x431a5c){_0x3d432f(_0xfa935);}else{_0x234787({'statusCode':0x194,'message':_0xc5d9('0x17')});}}else{_0x234787({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xc5d9('0x18')](function(_0x3cdd7f){logger[_0xc5d9('0x19')]('['+[_0x5c796e[_0xc5d9('0x1a')]()]+']',_0x3cdd7f[_0xc5d9('0x1b')]);_0x234787(_0x3cdd7f);});});};}function searchContact(_0x48d481,_0x5647a0,_0x32580a,_0x569c89){return new Promise(function(_0x46ca58,_0x331f57){var _0xcfaa2a={'method':'GET','headers':_0x5647a0,'uri':_0x48d481+'/api/lookup?q='+_0x569c89+_0xc5d9('0x20')+_0x32580a+_0xc5d9('0x21'),'json':!![]};rp(_0xcfaa2a)[_0xc5d9('0x12')](function(_0x1d3fec){var _0x2f5b71=_[_0xc5d9('0x22')](_0x1d3fec[_0xc5d9('0x23')][_0xc5d9('0x23')],[_0x32580a,_0x569c89]);_0x46ca58(_0x2f5b71);})['catch'](function(_0x45695a){_0x331f57(_0x45695a);});});}function getEndUser(_0x3941d4,_0x5bb746,_0x4cad1b){return function(_0xf5adfd){return new Promise(function(_0x2ead0c,_0x1361cf){logger[_0xc5d9('0x10')](util[_0xc5d9('0x24')](_0xc5d9('0x25'),_0xf5adfd['contactNumber']));searchContact(_0x4cad1b,_0x5bb746,_0xc5d9('0x26'),_0xf5adfd[_0xc5d9('0x27')])[_0xc5d9('0x12')](function(_0x4e7c0c){if(_0x4e7c0c){_0xf5adfd[_0xc5d9('0x28')]=_0x4e7c0c['id'];logger[_0xc5d9('0x10')]('Contact\x20found\x20mobile_number:',_0xf5adfd['endUserId']);return _0x2ead0c(_0xf5adfd);}searchContact(_0x4cad1b,_0x5bb746,_0xc5d9('0x29'),_0xf5adfd[_0xc5d9('0x27')])[_0xc5d9('0x12')](function(_0x2ca10f){if(_0x2ca10f){_0xf5adfd['endUserId']=_0x2ca10f['id'];logger['info']('Contact\x20found\x20work_number:',_0xf5adfd[_0xc5d9('0x28')]);return _0x2ead0c(_0xf5adfd);}createEndUser(_0xf5adfd,_0x3941d4,_0x5bb746,_0x4cad1b)[_0xc5d9('0x12')](function(_0x4dca37){logger[_0xc5d9('0x10')](_0xc5d9('0x2a'),_0x4dca37[_0xc5d9('0x28')]);return _0x2ead0c(_0x4dca37);});});})[_0xc5d9('0x18')](function(_0x457508){_0x1361cf(_0x457508);});});};}function createEndUser(_0x217e31,_0x52979c,_0x100b92,_0x425cb1){return new Promise(function(_0x1ab307,_0x2a1602){var _0x4c4341=moment();var _0x163a11={'method':_0xc5d9('0x2b'),'uri':_0x425cb1+_0xc5d9('0x2c'),'body':{'contact':{'last_name':_0x217e31[_0xc5d9('0x27')],'work_number':_0x217e31[_0xc5d9('0x27')],'mobile_number':_0x217e31[_0xc5d9('0x27')],'owner_id':_0x217e31[_0xc5d9('0x1e')],'created_at':_0x4c4341[_0xc5d9('0x24')](_0xc5d9('0x2d'))}},'json':!![]};_0x163a11[_0xc5d9('0xf')]=_0x100b92;logger['info'](_0xc5d9('0x2e'));return rp(_0x163a11)[_0xc5d9('0x12')](function(_0x1c6431){_0x217e31[_0xc5d9('0x28')]=_0x1c6431[_0xc5d9('0x2f')]['id'];_0x1ab307(_0x217e31);})['catch'](function(_0x40bf36){logger[_0xc5d9('0x19')]('['+[_0x52979c[_0xc5d9('0x1a')]()]+']',_0x40bf36[_0xc5d9('0x1b')]);_0x2a1602(_0x40bf36['message']);});});}function getTicket(_0x1e56bc,_0x547bc5,_0x46256f,_0x63b3a3,_0x2e7e24){return function(_0x188d8c){logger[_0xc5d9('0x10')](_0xc5d9('0x30'));return new Promise(function(_0x105f4e,_0x5183fa){var _0x244c25=moment();var _0x10c0bf={'method':_0xc5d9('0x2b'),'uri':_0x46256f+_0xc5d9('0x31'),'body':{'title':intUtil[_0xc5d9('0x32')](_0x63b3a3[_0xc5d9('0x33')],_0x2e7e24,'\x20'),'description':intUtil[_0xc5d9('0x32')](_0x63b3a3[_0xc5d9('0x34')],_0x2e7e24,'\x0a'),'owner_id':_0x188d8c['userId'],'creater_id':_0x188d8c['adminId'],'targetable_id':_0x188d8c['endUserId'],'targetable_type':_0xc5d9('0x35'),'created_at':_0x244c25[_0xc5d9('0x24')](_0xc5d9('0x2d')),'due_date':_0x244c25[_0xc5d9('0x36')](0x1e,'m')[_0xc5d9('0x24')](_0xc5d9('0x2d'))},'json':!![]};_0x10c0bf[_0xc5d9('0xf')]=_0x547bc5;return rp(_0x10c0bf)[_0xc5d9('0x12')](function(_0x174023){_0x188d8c[_0xc5d9('0x37')]=_0x174023[_0xc5d9('0x38')]['id'];logger[_0xc5d9('0x10')](_0xc5d9('0x39'),_0x188d8c[_0xc5d9('0x37')]);_0x105f4e(_0x188d8c);})[_0xc5d9('0x18')](function(_0x3defb1){logger['error']('['+[_0x1e56bc[_0xc5d9('0x1a')]()]+']',_0x3defb1[_0xc5d9('0x1b')]);_0x5183fa(_0x3defb1['message']);});});};}function emit(_0x4415a5,_0x5d2acb,_0x3d3a45){var _0x494779={'uri':_0x4415a5+_0xc5d9('0x3a')+_0x3d3a45};io['to'](util[_0xc5d9('0x24')](_0xc5d9('0x3b'),_0x5d2acb))[_0xc5d9('0x3c')]('trigger:browser:url',_0x494779);}exports['cs']=function(_0x3eefe,_0x1852e7,_0x1957de,_0x51d158,_0x1ac6ed,_0x46ae49,_0x1253b8,_0xe78f65){var _0x4a9dab={};var _0x43fd56={'Authorization':_0xc5d9('0x3d')+_0x46ae49['apiKey']};_0x46ae49['remoteUri']=intUtil[_0xc5d9('0x3e')](_0x46ae49[_0xc5d9('0x3f')]);_0x46ae49[_0xc5d9('0x40')]=intUtil[_0xc5d9('0x3e')](_0x46ae49[_0xc5d9('0x40')]);var _0x3db878=_0x46ae49['remoteUri'];_0x4a9dab['adminEmail']=_0x46ae49[_0xc5d9('0x41')];_0x4a9dab[_0xc5d9('0x27')]=_0xe78f65[_0xc5d9('0x42')]()==='outbound'?_0x1852e7[_0xc5d9('0x43')]:_0x1852e7[_0xc5d9('0x44')];_0x4a9dab['callDirection']=_0xe78f65===_0xc5d9('0x45')||_0xe78f65===_0xc5d9('0x46')?'queue':_0xc5d9('0x47');if(_0x51d158){_0x4a9dab['agentEmail']=_0x51d158[_0xc5d9('0x48')];}var _0x571ed2=util[_0xc5d9('0x24')](_0xc5d9('0x49'),_0x46ae49[_0xc5d9('0x40')],_0x1852e7[_0xc5d9('0x4a')],md5(_0x1852e7[_0xc5d9('0x4a')]));if(_0x1ac6ed&&_0x1ac6ed['monitor_format']){logger[_0xc5d9('0x10')]('[QUEUE]',_0xc5d9('0x4b'));_0x1852e7[_0xc5d9('0x4c')]=_0x571ed2;}else if(_0x1253b8&&_0x1253b8[_0xc5d9('0x4d')]&&_0x1253b8['recordingFormat']!==_0xc5d9('0x4e')){logger[_0xc5d9('0x10')](_0xc5d9('0x4f'),_0xc5d9('0x4b'));_0x1852e7['recordingURL']=_0x571ed2;}else{_0x1852e7['recordingURL']='';}return getAdminId(_0x4a9dab,_0xe78f65,_0x43fd56,_0x3db878)[_0xc5d9('0x12')](getUser(_0xe78f65,_0x43fd56,_0x3db878))[_0xc5d9('0x12')](getEndUser(_0xe78f65,_0x43fd56,_0x3db878))['then'](getTicket(_0xe78f65,_0x43fd56,_0x3db878,_0x1957de,_0x1852e7))[_0xc5d9('0x12')](function(_0x3413fc){logger[_0xc5d9('0x10')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x3413fc[_0xc5d9('0x37')]));if(_0xe78f65!=='unmanaged'){logger[_0xc5d9('0x10')]('['+[_0xe78f65[_0xc5d9('0x1a')]()]+']',_0xc5d9('0x50'));emit(_0x3db878,_0x51d158['name'],_0x3413fc[_0xc5d9('0x28')]);}})[_0xc5d9('0x18')](function(_0x3a3bdb){logger[_0xc5d9('0x19')]('['+[_0xe78f65['toUpperCase']()]+_0xc5d9('0x51'),util['inspect'](_0x3a3bdb,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe7e6=['User\x20found:','Admin\x20selected','adminEmail','message','/api/lookup?q=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','Contact\x20found\x20mobile_number:','endUserId','Contact\x20created:','catch','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Descriptions','Contact','add','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','util','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','then','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','/api/selector/owners','Getting\x20user\x20with\x20email','agentEmail','userId'];(function(_0x3ced90,_0xf1aad1){var _0x5b9d75=function(_0x287333){while(--_0x287333){_0x3ced90['push'](_0x3ced90['shift']());}};_0x5b9d75(++_0xf1aad1);}(_0xe7e6,0x81));var _0x6e7e=function(_0x401b79,_0x37b296){_0x401b79=_0x401b79-0x0;var _0x49d46e=_0xe7e6[_0x401b79];return _0x49d46e;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x6e7e('0x0'));var util=require(_0x6e7e('0x1'));var moment=require(_0x6e7e('0x2'));var Promise=require(_0x6e7e('0x3'));var Redis=require(_0x6e7e('0x4'));var intUtil=require('./util');var config=require(_0x6e7e('0x5'));var logger=require(_0x6e7e('0x6'))(_0x6e7e('0x7'));config[_0x6e7e('0x8')]=_[_0x6e7e('0x9')](config[_0x6e7e('0x8')],{'host':_0x6e7e('0xa'),'port':0x18eb});var io=require(_0x6e7e('0xb'))(new Redis(config[_0x6e7e('0x8')]));function getAdminId(_0x2b18b4,_0xe9a01c,_0x2cf062,_0x1517f0){return new Promise(function(_0x380196,_0x54a2de){var _0x4c96d7=![];var _0x538e96={'method':_0x6e7e('0xc'),'uri':_0x1517f0+'/api/selector/owners','json':!![]};_0x538e96[_0x6e7e('0xd')]=_0x2cf062;logger[_0x6e7e('0xe')](_0x6e7e('0xf'));return rp(_0x538e96)[_0x6e7e('0x10')](function(_0x43ca42){if(_0x43ca42){var _0x15f3ba=_0x43ca42[_0x6e7e('0x11')];var _0x3c823f=null;for(_0x3c823f=0x0;_0x3c823f<_0x15f3ba[_0x6e7e('0x12')];_0x3c823f++){if(_0x15f3ba[_0x3c823f][_0x6e7e('0x13')]===_0x2b18b4['adminEmail']){_0x2b18b4[_0x6e7e('0x14')]=_0x15f3ba[_0x3c823f]['id'];_0x4c96d7=!![];}}if(_0x4c96d7){logger[_0x6e7e('0xe')](_0x6e7e('0x15'),_0x2b18b4[_0x6e7e('0x14')]);_0x380196(_0x2b18b4);}else{_0x54a2de({'statusCode':0x194,'message':_0x6e7e('0x16')});}}else{_0x54a2de({'statusCode':0x194,'message':_0x6e7e('0x16')});}})['catch'](function(_0x2c2c8c){logger[_0x6e7e('0x17')]('['+[_0xe9a01c[_0x6e7e('0x18')]()]+']',_0x2c2c8c['message']);_0x54a2de(_0x2c2c8c);});});}function getUser(_0x2d5b77,_0x615aa5,_0x2e5c4d){return function(_0xf0f998){return new Promise(function(_0x441631,_0x3fc94e){var _0x337fa0={'method':_0x6e7e('0xc'),'uri':_0x2e5c4d+_0x6e7e('0x19'),'json':!![]};_0x337fa0['headers']=_0x615aa5;logger[_0x6e7e('0xe')]('Getting\x20user\x20list');return rp(_0x337fa0)[_0x6e7e('0x10')](function(_0x5a6ed0){if(_0x5a6ed0){var _0x2aa022=_0x5a6ed0[_0x6e7e('0x11')];var _0x417121=![];var _0x4823c1=null;if(_0xf0f998['agentEmail']!==null){logger[_0x6e7e('0xe')](_0x6e7e('0x1a'),_0xf0f998[_0x6e7e('0x1b')]);_0xf0f998['userEmail']=_0xf0f998[_0x6e7e('0x1b')];for(_0x4823c1=0x0;_0x4823c1<_0x2aa022[_0x6e7e('0x12')];_0x4823c1++){if(_0x2aa022[_0x4823c1][_0x6e7e('0x13')]===_0xf0f998[_0x6e7e('0x1b')]){_0x417121=!![];_0xf0f998[_0x6e7e('0x1c')]=_0x2aa022[_0x4823c1]['id'];logger['info'](_0x6e7e('0x1d'),_0xf0f998[_0x6e7e('0x1c')]);}}}if(!_0x417121){logger['info'](_0x6e7e('0x1e'));_0xf0f998['userEmail']=_0xf0f998[_0x6e7e('0x1f')];_0xf0f998[_0x6e7e('0x1c')]=_0xf0f998[_0x6e7e('0x14')];_0x417121=!![];}if(_0x417121){_0x441631(_0xf0f998);}else{_0x3fc94e({'statusCode':0x194,'message':_0x6e7e('0x16')});}}else{_0x3fc94e({'statusCode':0x194,'message':_0x6e7e('0x16')});}})['catch'](function(_0x3c1967){logger['error']('['+[_0x2d5b77['toUpperCase']()]+']',_0x3c1967[_0x6e7e('0x20')]);_0x3fc94e(_0x3c1967);});});};}function searchContact(_0x30b6eb,_0x250b85,_0x61975,_0x4cfa9e){return new Promise(function(_0x9a4cfe,_0x4f51ca){var _0x4df4a9={'method':'GET','headers':_0x250b85,'uri':_0x30b6eb+_0x6e7e('0x21')+_0x4cfa9e+'&f='+_0x61975+'&entities=contact','json':!![]};rp(_0x4df4a9)[_0x6e7e('0x10')](function(_0x11310b){var _0x509a4d=_[_0x6e7e('0x22')](_0x11310b[_0x6e7e('0x23')][_0x6e7e('0x23')],[_0x61975,_0x4cfa9e]);_0x9a4cfe(_0x509a4d);})['catch'](function(_0x31fe93){_0x4f51ca(_0x31fe93);});});}function getEndUser(_0x2f3a92,_0x2cdd38,_0xaaa1b){return function(_0xea91a1){return new Promise(function(_0x3d1729,_0x1fd66f){logger[_0x6e7e('0xe')](util[_0x6e7e('0x24')](_0x6e7e('0x25'),_0xea91a1[_0x6e7e('0x26')]));searchContact(_0xaaa1b,_0x2cdd38,'mobile_number',_0xea91a1[_0x6e7e('0x26')])[_0x6e7e('0x10')](function(_0x434b2a){if(_0x434b2a){_0xea91a1['endUserId']=_0x434b2a['id'];logger[_0x6e7e('0xe')](_0x6e7e('0x27'),_0xea91a1[_0x6e7e('0x28')]);return _0x3d1729(_0xea91a1);}searchContact(_0xaaa1b,_0x2cdd38,'work_number',_0xea91a1['contactNumber'])['then'](function(_0x228ae9){if(_0x228ae9){_0xea91a1[_0x6e7e('0x28')]=_0x228ae9['id'];logger[_0x6e7e('0xe')]('Contact\x20found\x20work_number:',_0xea91a1[_0x6e7e('0x28')]);return _0x3d1729(_0xea91a1);}createEndUser(_0xea91a1,_0x2f3a92,_0x2cdd38,_0xaaa1b)[_0x6e7e('0x10')](function(_0x55ddc2){logger['info'](_0x6e7e('0x29'),_0x55ddc2[_0x6e7e('0x28')]);return _0x3d1729(_0x55ddc2);});});})[_0x6e7e('0x2a')](function(_0x5b142f){_0x1fd66f(_0x5b142f);});});};}function createEndUser(_0x13d557,_0x86ae8e,_0x1bd2fd,_0x2135be){return new Promise(function(_0x20a79e,_0x37b1c8){var _0x5d3229=moment();var _0x248b09={'method':_0x6e7e('0x2b'),'uri':_0x2135be+_0x6e7e('0x2c'),'body':{'contact':{'last_name':_0x13d557['contactNumber'],'work_number':_0x13d557[_0x6e7e('0x26')],'mobile_number':_0x13d557[_0x6e7e('0x26')],'owner_id':_0x13d557[_0x6e7e('0x1c')],'created_at':_0x5d3229[_0x6e7e('0x24')](_0x6e7e('0x2d'))}},'json':!![]};_0x248b09[_0x6e7e('0xd')]=_0x1bd2fd;logger[_0x6e7e('0xe')](_0x6e7e('0x2e'));return rp(_0x248b09)[_0x6e7e('0x10')](function(_0x2da3e3){_0x13d557['endUserId']=_0x2da3e3[_0x6e7e('0x2f')]['id'];_0x20a79e(_0x13d557);})[_0x6e7e('0x2a')](function(_0x106bf1){logger[_0x6e7e('0x17')]('['+[_0x86ae8e[_0x6e7e('0x18')]()]+']',_0x106bf1[_0x6e7e('0x20')]);_0x37b1c8(_0x106bf1[_0x6e7e('0x20')]);});});}function getTicket(_0x42ab55,_0x19c33b,_0x57b9e9,_0x399a10,_0x301c79){return function(_0xef957d){logger[_0x6e7e('0xe')]('Creating\x20new\x20task');return new Promise(function(_0x24a156,_0x5de4c0){var _0x2bb915=moment();var _0x1ce07f={'method':_0x6e7e('0x2b'),'uri':_0x57b9e9+_0x6e7e('0x30'),'body':{'title':intUtil[_0x6e7e('0x31')](_0x399a10['Subjects'],_0x301c79,'\x20'),'description':intUtil[_0x6e7e('0x31')](_0x399a10[_0x6e7e('0x32')],_0x301c79,'\x0a'),'owner_id':_0xef957d[_0x6e7e('0x1c')],'creater_id':_0xef957d[_0x6e7e('0x14')],'targetable_id':_0xef957d['endUserId'],'targetable_type':_0x6e7e('0x33'),'created_at':_0x2bb915['format'](_0x6e7e('0x2d')),'due_date':_0x2bb915[_0x6e7e('0x34')](0x1e,'m')[_0x6e7e('0x24')](_0x6e7e('0x2d'))},'json':!![]};_0x1ce07f['headers']=_0x19c33b;return rp(_0x1ce07f)[_0x6e7e('0x10')](function(_0xf2d356){_0xef957d[_0x6e7e('0x35')]=_0xf2d356['task']['id'];logger[_0x6e7e('0xe')]('Task\x20created:',_0xef957d[_0x6e7e('0x35')]);_0x24a156(_0xef957d);})[_0x6e7e('0x2a')](function(_0x53ff6b){logger[_0x6e7e('0x17')]('['+[_0x42ab55[_0x6e7e('0x18')]()]+']',_0x53ff6b[_0x6e7e('0x20')]);_0x5de4c0(_0x53ff6b['message']);});});};}function emit(_0xd970d1,_0xf3e22e,_0x21b5ce){var _0x29aaf6={'uri':_0xd970d1+_0x6e7e('0x36')+_0x21b5ce};io['to'](util[_0x6e7e('0x24')](_0x6e7e('0x37'),_0xf3e22e))[_0x6e7e('0x38')](_0x6e7e('0x39'),_0x29aaf6);}exports['cs']=function(_0x26ed33,_0x59474e,_0x323118,_0x47598c,_0x189296,_0x2fb45c,_0x1ffddc,_0x52df0a){var _0x29c60b={};var _0x5ccdd8={'Authorization':_0x6e7e('0x3a')+_0x2fb45c['apiKey']};_0x2fb45c[_0x6e7e('0x3b')]=intUtil[_0x6e7e('0x3c')](_0x2fb45c[_0x6e7e('0x3b')]);_0x2fb45c[_0x6e7e('0x3d')]=intUtil[_0x6e7e('0x3c')](_0x2fb45c['serverUrl']);var _0x3e5db8=_0x2fb45c[_0x6e7e('0x3b')];_0x29c60b[_0x6e7e('0x1f')]=_0x2fb45c[_0x6e7e('0x3e')];_0x29c60b[_0x6e7e('0x26')]=_0x52df0a[_0x6e7e('0x3f')]()===_0x6e7e('0x40')?_0x59474e[_0x6e7e('0x41')]:_0x59474e['calleridnum'];_0x29c60b['callDirection']=_0x52df0a===_0x6e7e('0x42')||_0x52df0a===_0x6e7e('0x43')?_0x6e7e('0x42'):_0x6e7e('0x40');if(_0x47598c){_0x29c60b[_0x6e7e('0x1b')]=_0x47598c['email'];}var _0x514d50=util[_0x6e7e('0x24')](_0x6e7e('0x44'),_0x2fb45c[_0x6e7e('0x3d')],_0x59474e[_0x6e7e('0x45')],md5(_0x59474e[_0x6e7e('0x45')]));if(_0x189296&&_0x189296[_0x6e7e('0x46')]){logger['info']('[QUEUE]',_0x6e7e('0x47'));_0x59474e[_0x6e7e('0x48')]=_0x514d50;}else if(_0x1ffddc&&_0x1ffddc[_0x6e7e('0x49')]&&_0x1ffddc[_0x6e7e('0x49')]!==_0x6e7e('0x4a')){logger[_0x6e7e('0xe')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x59474e[_0x6e7e('0x48')]=_0x514d50;}else{_0x59474e[_0x6e7e('0x48')]='';}return getAdminId(_0x29c60b,_0x52df0a,_0x5ccdd8,_0x3e5db8)[_0x6e7e('0x10')](getUser(_0x52df0a,_0x5ccdd8,_0x3e5db8))[_0x6e7e('0x10')](getEndUser(_0x52df0a,_0x5ccdd8,_0x3e5db8))[_0x6e7e('0x10')](getTicket(_0x52df0a,_0x5ccdd8,_0x3e5db8,_0x323118,_0x59474e))['then'](function(_0x1b9df4){logger['info'](util[_0x6e7e('0x24')]('The\x20ticket\x20ID\x20is:\x20%s',_0x1b9df4[_0x6e7e('0x35')]));if(_0x52df0a!==_0x6e7e('0x43')){logger[_0x6e7e('0xe')]('['+[_0x52df0a[_0x6e7e('0x18')]()]+']',_0x6e7e('0x4b'));emit(_0x3e5db8,_0x47598c[_0x6e7e('0x4c')],_0x1b9df4[_0x6e7e('0x28')]);}})['catch'](function(_0x295593){logger[_0x6e7e('0x17')]('['+[_0x52df0a['toUpperCase']()]+_0x6e7e('0x4d'),util[_0x6e7e('0x4e')](_0x295593,{'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 fc0bccf..f37861f 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 _0x8039=['salesforce','sugarcrm','freshdesk','vtiger','servicenow','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','util','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zoho','desk','dynamics365','freshsales','includes','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged'];(function(_0x4d33f9,_0x28dcf5){var _0x4468c5=function(_0x36cec4){while(--_0x36cec4){_0x4d33f9['push'](_0x4d33f9['shift']());}};_0x4468c5(++_0x28dcf5);}(_0x8039,0x1e0));var _0x9803=function(_0x2984d0,_0x1a7211){_0x2984d0=_0x2984d0-0x0;var _0x2885f2=_0x8039[_0x2984d0];return _0x2885f2;};'use strict';var _=require('lodash');var util=require(_0x9803('0x0'));var zendesk=require('./zendesk');var salesforce=require(_0x9803('0x1'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x9803('0x2'));var zoho=require(_0x9803('0x3'));var desk=require(_0x9803('0x4'));var vtiger=require(_0x9803('0x5'));var servicenow=require(_0x9803('0x6'));var dynamics365=require(_0x9803('0x7'));var freshsales=require('./freshsales');var integrations=['zendesk','salesforce','sugarcrm','freshdesk',_0x9803('0x8'),_0x9803('0x9'),'vtiger',_0x9803('0xa'),_0x9803('0xb'),'servicenow'];exports['exec']=function(_0x17fefa,_0xf55873,_0x58c423,_0x2c51c2,_0x5a808e,_0x588daf){if(_0x58c423){if(_[_0x9803('0xc')](integrations,_0x17fefa[_0x9803('0xd')][_0x9803('0xe')]())){try{var _0x2ef5f0=null;var _0xaca2d7='';var _0x1834cf=_0x58c423[_0x17fefa[_0x9803('0xd')][_0x9803('0xe')]()];if(_0x1834cf){var _0x8bdf88=_0x1834cf[_0x17fefa[_0x9803('0xf')]];if(_0x8bdf88){var _0x265f28=_[_0x9803('0x10')](_0x8bdf88[_0x9803('0x11')],{'id':parseInt(_0x17fefa['data3'],0xa)});if(_0x265f28){if(_0x2c51c2){if(_0x5a808e&&_0xf55873['queue']){_0xaca2d7=_0x9803('0x12');}else if(_0xf55873[_0x9803('0x13')]){_0xaca2d7=_0x9803('0x14');}else{console[_0x9803('0x15')](_0x9803('0x16'),_0xf55873);}}else{_0xaca2d7=_0x9803('0x17');}switch(_0x17fefa[_0x9803('0xd')][_0x9803('0xe')]()){case'zendesk':zendesk[_0xaca2d7](_0x17fefa,_0xf55873,_0x265f28,_0x2c51c2,_0x5a808e,_0x8bdf88,_0x588daf);break;case _0x9803('0x18'):salesforce[_0xaca2d7](_0x17fefa,_0xf55873,_0x265f28,_0x2c51c2,_0x5a808e,_0x8bdf88,_0x588daf);break;case _0x9803('0x19'):sugarcrm[_0xaca2d7](_0x17fefa,_0xf55873,_0x265f28,_0x2c51c2,_0x5a808e,_0x8bdf88,_0x588daf);break;case _0x9803('0x1a'):freshdesk[_0xaca2d7](_0x17fefa,_0xf55873,_0x265f28,_0x2c51c2,_0x5a808e,_0x8bdf88,_0x588daf);break;case _0x9803('0x8'):zoho[_0xaca2d7](_0x17fefa,_0xf55873,_0x265f28,_0x2c51c2,_0x5a808e,_0x8bdf88,_0x588daf);break;case _0x9803('0x9'):desk[_0xaca2d7](_0x17fefa,_0xf55873,_0x265f28,_0x2c51c2,_0x5a808e,_0x8bdf88,_0x588daf);break;case _0x9803('0x1b'):vtiger[_0xaca2d7](_0x17fefa,_0xf55873,_0x265f28,_0x2c51c2,_0x5a808e,_0x8bdf88,_0x588daf);break;case'freshsales':freshsales['cs'](_0x17fefa,_0xf55873,_0x265f28,_0x2c51c2,_0x5a808e,_0x8bdf88,_0x588daf,_0xaca2d7);break;case _0x9803('0x1c'):servicenow['cs'](_0x17fefa,_0xf55873,_0x265f28,_0x2c51c2,_0x5a808e,_0x8bdf88,_0x588daf,_0xaca2d7);break;case _0x9803('0xa'):dynamics365['cs'](_0x17fefa,_0xf55873,_0x265f28,_0x2c51c2,_0x5a808e,_0x8bdf88,_0x588daf,_0xaca2d7);break;default:console[_0x9803('0x15')](_0x9803('0x1d'));}}else{_0x2ef5f0=require(_0x9803('0x1e'))(_0x17fefa[_0x9803('0xd')]['toLowerCase']());_0x2ef5f0['error'](_0x9803('0x1f'),util[_0x9803('0x20')](_0x9803('0x21'),_0x17fefa[_0x9803('0xd')][_0x9803('0xe')](),_0x17fefa[_0x9803('0x22')]));}}else{_0x2ef5f0=require(_0x9803('0x1e'))(_0x17fefa[_0x9803('0xd')][_0x9803('0xe')]());_0x2ef5f0['error'](_0x9803('0x1f'),util[_0x9803('0x20')](_0x9803('0x23'),_0x17fefa[_0x9803('0xd')]['toLowerCase'](),_0x17fefa['data2']));}}else{}}catch(_0x352f85){console['error'](_0x352f85);}}}}; \ No newline at end of file +var _0x3fa8=['EVENT\x20UNKNOWN','vtiger','freshsales','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./servicenow','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','dynamics365','servicenow','exec','data1','toLowerCase','Configurations','data3','queue','routeId','outbound','log'];(function(_0x576a53,_0x5c66bc){var _0x20e957=function(_0xd0f00f){while(--_0xd0f00f){_0x576a53['push'](_0x576a53['shift']());}};_0x20e957(++_0x5c66bc);}(_0x3fa8,0x145));var _0x83fa=function(_0x347f98,_0x23b964){_0x347f98=_0x347f98-0x0;var _0x5c8bfc=_0x3fa8[_0x347f98];return _0x5c8bfc;};'use strict';var _=require('lodash');var util=require(_0x83fa('0x0'));var zendesk=require(_0x83fa('0x1'));var salesforce=require(_0x83fa('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x83fa('0x3'));var zoho=require(_0x83fa('0x4'));var desk=require(_0x83fa('0x5'));var vtiger=require(_0x83fa('0x6'));var servicenow=require(_0x83fa('0x7'));var dynamics365=require('./dynamics365');var freshsales=require('./freshsales');var integrations=[_0x83fa('0x8'),_0x83fa('0x9'),_0x83fa('0xa'),_0x83fa('0xb'),_0x83fa('0xc'),_0x83fa('0xd'),'vtiger',_0x83fa('0xe'),'freshsales',_0x83fa('0xf')];exports[_0x83fa('0x10')]=function(_0x49feed,_0x1d9a9e,_0x488d3a,_0x46a7b8,_0x21d4a0,_0x1f73b6){if(_0x488d3a){if(_['includes'](integrations,_0x49feed[_0x83fa('0x11')]['toLowerCase']())){try{var _0x3316bc=null;var _0x4a668f='';var _0x1cb2c1=_0x488d3a[_0x49feed[_0x83fa('0x11')][_0x83fa('0x12')]()];if(_0x1cb2c1){var _0x2d3120=_0x1cb2c1[_0x49feed['data2']];if(_0x2d3120){var _0x420371=_['find'](_0x2d3120[_0x83fa('0x13')],{'id':parseInt(_0x49feed[_0x83fa('0x14')],0xa)});if(_0x420371){if(_0x46a7b8){if(_0x21d4a0&&_0x1d9a9e[_0x83fa('0x15')]){_0x4a668f=_0x83fa('0x15');}else if(_0x1d9a9e[_0x83fa('0x16')]){_0x4a668f=_0x83fa('0x17');}else{console[_0x83fa('0x18')](_0x83fa('0x19'),_0x1d9a9e);}}else{_0x4a668f='unmanaged';}switch(_0x49feed[_0x83fa('0x11')][_0x83fa('0x12')]()){case _0x83fa('0x8'):zendesk[_0x4a668f](_0x49feed,_0x1d9a9e,_0x420371,_0x46a7b8,_0x21d4a0,_0x2d3120,_0x1f73b6);break;case'salesforce':salesforce[_0x4a668f](_0x49feed,_0x1d9a9e,_0x420371,_0x46a7b8,_0x21d4a0,_0x2d3120,_0x1f73b6);break;case _0x83fa('0xa'):sugarcrm[_0x4a668f](_0x49feed,_0x1d9a9e,_0x420371,_0x46a7b8,_0x21d4a0,_0x2d3120,_0x1f73b6);break;case _0x83fa('0xb'):freshdesk[_0x4a668f](_0x49feed,_0x1d9a9e,_0x420371,_0x46a7b8,_0x21d4a0,_0x2d3120,_0x1f73b6);break;case _0x83fa('0xc'):zoho[_0x4a668f](_0x49feed,_0x1d9a9e,_0x420371,_0x46a7b8,_0x21d4a0,_0x2d3120,_0x1f73b6);break;case _0x83fa('0xd'):desk[_0x4a668f](_0x49feed,_0x1d9a9e,_0x420371,_0x46a7b8,_0x21d4a0,_0x2d3120,_0x1f73b6);break;case _0x83fa('0x1a'):vtiger[_0x4a668f](_0x49feed,_0x1d9a9e,_0x420371,_0x46a7b8,_0x21d4a0,_0x2d3120,_0x1f73b6);break;case _0x83fa('0x1b'):freshsales['cs'](_0x49feed,_0x1d9a9e,_0x420371,_0x46a7b8,_0x21d4a0,_0x2d3120,_0x1f73b6,_0x4a668f);break;case'servicenow':servicenow['cs'](_0x49feed,_0x1d9a9e,_0x420371,_0x46a7b8,_0x21d4a0,_0x2d3120,_0x1f73b6,_0x4a668f);break;case'dynamics365':dynamics365['cs'](_0x49feed,_0x1d9a9e,_0x420371,_0x46a7b8,_0x21d4a0,_0x2d3120,_0x1f73b6,_0x4a668f);break;default:console[_0x83fa('0x18')](_0x83fa('0x1c'));}}else{_0x3316bc=require(_0x83fa('0x1d'))(_0x49feed[_0x83fa('0x11')][_0x83fa('0x12')]());_0x3316bc[_0x83fa('0x1e')](_0x83fa('0x1f'),util[_0x83fa('0x20')](_0x83fa('0x21'),_0x49feed[_0x83fa('0x11')][_0x83fa('0x12')](),_0x49feed[_0x83fa('0x14')]));}}else{_0x3316bc=require('../../../../config/logger')(_0x49feed[_0x83fa('0x11')][_0x83fa('0x12')]());_0x3316bc[_0x83fa('0x1e')](_0x83fa('0x1f'),util[_0x83fa('0x20')](_0x83fa('0x22'),_0x49feed[_0x83fa('0x11')]['toLowerCase'](),_0x49feed['data2']));}}else{}}catch(_0x1a344d){console[_0x83fa('0x1e')](_0x1a344d);}}}}; \ 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 58acf7d..b33ba1c 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 _0x5717=['assign','getString','Subjects','Descriptions','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','execute','then','length','find','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','account_contact_lead','additionalSearchAccount','Account','additionalSearchLead','Lead','first','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','upperFirst','create','forEach','includes','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','securityToken','remoteUri','https://login.salesforce.com','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','../../../../config/environment','salesforce','redis','defaults','localhost','socket.io-emitter','emit'];(function(_0x56b89e,_0x46bc46){var _0x103dd8=function(_0x3488d2){while(--_0x3488d2){_0x56b89e['push'](_0x56b89e['shift']());}};_0x103dd8(++_0x46bc46);}(_0x5717,0x72));var _0x7571=function(_0x4b9cec,_0x47dbdf){_0x4b9cec=_0x4b9cec-0x0;var _0x56e0ab=_0x5717[_0x4b9cec];return _0x56e0ab;};'use strict';var _=require(_0x7571('0x0'));var rp=require(_0x7571('0x1'));var moment=require('moment');var BPromise=require(_0x7571('0x2'));var md5=require(_0x7571('0x3'));var jsforce=require('jsforce');var util=require(_0x7571('0x4'));var Redis=require(_0x7571('0x5'));var intUtil=require('./util');var config=require(_0x7571('0x6'));var logger=require('../../../../config/logger')(_0x7571('0x7'));config[_0x7571('0x8')]=_[_0x7571('0x9')](config[_0x7571('0x8')],{'host':_0x7571('0xa'),'port':0x18eb});var io=require(_0x7571('0xb'))(new Redis(config['redis']));function emit(_0x20fd4d,_0x1e218e,_0x4452a1){io['to'](_0x20fd4d)[_0x7571('0xc')](_0x1e218e,_0x4452a1);}function getTicket(_0xdc902d,_0x4d9fa5,_0xb38c7,_0x1b8ffb,_0x3f0c22,_0x26c509,_0x268e92,_0x5c7ea5){var _0x2ca388=Object[_0x7571('0xd')]({},{'OwnerId':_0x4d9fa5['id'],'Subject':intUtil[_0x7571('0xe')](_0x1b8ffb[_0x7571('0xf')],_0x3f0c22,'\x20'),'Description':intUtil[_0x7571('0xe')](_0x1b8ffb[_0x7571('0x10')],_0x3f0c22,'\x0a')},getCustomFields(_0x26c509,_0x3f0c22));if(_0xb38c7){if(_0x1b8ffb[_0x7571('0x11')]==='Task'){_0x2ca388[_0x7571('0x12')]=moment[_0x7571('0x13')]();_0x2ca388[_0x7571('0x14')]=![];_0x2ca388[_0x7571('0x15')]=![];if(_0xb38c7[_0x7571('0x16')]===_0x7571('0x17')||_0xb38c7[_0x7571('0x16')]===_0x7571('0x18')){_0x2ca388[_0x7571('0x19')]=_0xb38c7['id'];}else if(_0xb38c7[_0x7571('0x16')]===_0x7571('0x1a')){_0x2ca388[_0x7571('0x1b')]=_0xb38c7['id'];}}else if(_0x1b8ffb['ticketType']===_0x7571('0x1c')){if(_0xb38c7[_0x7571('0x16')]===_0x7571('0x17')){_0x2ca388[_0x7571('0x1d')]=_0xb38c7['id'];}else if(_0xb38c7[_0x7571('0x16')]==='account'){_0x2ca388[_0x7571('0x1e')]=_0xb38c7['id'];}else if(_0xb38c7['endUserType']===_0x7571('0x18')&&_0x1b8ffb['leadId']){_0x2ca388[_0x1b8ffb[_0x7571('0x1f')]]=_0xb38c7['id'];}else{logger[_0x7571('0x20')](_0x7571('0x21'));}}}return _0x268e92[_0x7571('0x22')](_0x1b8ffb[_0x7571('0x11')])['create'](_0x2ca388);}function getUser(_0x5d6229,_0xf80101,_0x187808){if(!_[_0x7571('0x23')](_0xf80101)&&intUtil[_0x7571('0x24')](_0xf80101)){var _0x3581d7={'Email':_0xf80101};var _0x30a531={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x187808[_0x7571('0x22')](_0x7571('0x25'))['find'](_0x3581d7,_0x30a531)[_0x7571('0x26')]()[_0x7571('0x27')](function(_0x684948){if(_0x684948[_0x7571('0x28')]){var _0x5aa6a1=_[_0x7571('0x29')](_0x684948,function(_0x5d991e){return _0x5d991e['Email']===_0xf80101;});if(_0x5aa6a1){logger[_0x7571('0x20')](_0x7571('0x2a'),_0xf80101);return BPromise[_0x7571('0x2b')]({'id':_0x5aa6a1['Id'],'name':_0x5aa6a1[_0x7571('0x2c')]});}}else{logger['info'](_0x7571('0x2d'),_0xf80101);return _0x187808[_0x7571('0x2e')]()[_0x7571('0x27')](function(_0x30c1ca){return BPromise['resolve']({'id':_0x30c1ca['user_id'],'name':_0x30c1ca['display_name']});});}});}else{logger[_0x7571('0x20')](_0x7571('0x2d'),_0xf80101);return _0x187808['identity']()[_0x7571('0x27')](function(_0x3fd1fe){return BPromise[_0x7571('0x2b')]({'id':_0x3fd1fe[_0x7571('0x2f')],'name':_0x3fd1fe['display_name']});});}}function getEndUser(_0x44482a,_0x52a597,_0x3c9dcc,_0x54d3df,_0x50478c){var _0x5f15a2={'$or':{'Phone':_0x54d3df}};var _0x8a258d={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x7571('0x2b')]()[_0x7571('0x27')](function(){logger[_0x7571('0x20')](_0x7571('0x30'),_0x54d3df,_0x52a597[_0x7571('0x31')]);switch(_0x52a597[_0x7571('0x31')]){case'contact_lead':var _0x525837=_[_0x7571('0x32')](_0x5f15a2);if(_0x52a597[_0x7571('0x33')]){var _0xc6703a={};_0xc6703a[_0x52a597['additionalSearchContact']]=_0x54d3df;_[_0x7571('0x34')](_0x525837[_0x7571('0x35')],_0xc6703a);}return _0x50478c[_0x7571('0x22')](_0x7571('0x36'))[_0x7571('0x29')](_0x525837,_0x8a258d)[_0x7571('0x26')]()[_0x7571('0x27')](function(_0x3291d8){if(_0x3291d8&&_0x3291d8[_0x7571('0x28')]){return _0x3291d8;}else{var _0x2a78fb=_[_0x7571('0x32')](_0x5f15a2);if(_0x52a597['additionalSearchLead']){var _0x192827={};_0x192827[_0x52a597['additionalSearchLead']]=_0x54d3df;_['merge'](_0x2a78fb[_0x7571('0x35')],_0x192827);}return _0x50478c['sobject']('Lead')[_0x7571('0x29')](_0x2a78fb,_0x8a258d);}});case _0x7571('0x37'):var _0x5632fe=_[_0x7571('0x32')](_0x5f15a2);if(_0x52a597[_0x7571('0x38')]){var _0xc6703a={};_0xc6703a[_0x52a597[_0x7571('0x38')]]=_0x54d3df;_['merge'](_0x5632fe[_0x7571('0x35')],_0xc6703a);}return _0x50478c[_0x7571('0x22')](_0x7571('0x39'))[_0x7571('0x29')](_0x5632fe,_0x8a258d)[_0x7571('0x26')]()['then'](function(_0x5c13fe){if(_0x5c13fe&&_0x5c13fe[_0x7571('0x28')]){return _0x5c13fe;}else{var _0x1aea30=_[_0x7571('0x32')](_0x5f15a2);if(_0x52a597['additionalSearchContact']){var _0x5c0020={};_0x5c0020[_0x52a597['additionalSearchContact']]=_0x54d3df;_['merge'](_0x1aea30[_0x7571('0x35')],_0x5c0020);}return _0x50478c[_0x7571('0x22')](_0x7571('0x36'))[_0x7571('0x29')](_0x1aea30,_0x8a258d)['then'](function(_0x24dced){if(_0x24dced&&_0x24dced[_0x7571('0x28')]){return _0x24dced;}else{var _0x3f0313=_[_0x7571('0x32')](_0x5f15a2);if(_0x52a597[_0x7571('0x3a')]){var _0x15832f={};_0x15832f[_0x52a597[_0x7571('0x3a')]]=_0x54d3df;_[_0x7571('0x34')](_0x3f0313[_0x7571('0x35')],_0x15832f);}return _0x50478c['sobject'](_0x7571('0x3b'))[_0x7571('0x29')](_0x3f0313,_0x8a258d);}});}});case _0x7571('0x17'):var _0x525837=_[_0x7571('0x32')](_0x5f15a2);if(_0x52a597['additionalSearchContact']){var _0xc6703a={};_0xc6703a[_0x52a597[_0x7571('0x33')]]=_0x54d3df;_[_0x7571('0x34')](_0x525837[_0x7571('0x35')],_0xc6703a);}return _0x50478c[_0x7571('0x22')]('Contact')[_0x7571('0x29')](_0x525837,_0x8a258d)[_0x7571('0x26')]();case _0x7571('0x18'):var _0x2fb7da=_[_0x7571('0x32')](_0x5f15a2);if(_0x52a597[_0x7571('0x3a')]){var _0xc6703a={};_0xc6703a[_0x52a597[_0x7571('0x3a')]]=_0x54d3df;_['merge'](_0x2fb7da[_0x7571('0x35')],_0xc6703a);}return _0x50478c['sobject'](_0x7571('0x3b'))[_0x7571('0x29')](_0x2fb7da,_0x8a258d);case'account':var _0x5632fe=_[_0x7571('0x32')](_0x5f15a2);if(_0x52a597[_0x7571('0x38')]){var _0xc6703a={};_0xc6703a[_0x52a597[_0x7571('0x38')]]=_0x54d3df;_['merge'](_0x5632fe['$or'],_0xc6703a);}return _0x50478c[_0x7571('0x22')](_0x7571('0x39'))[_0x7571('0x29')](_0x5632fe,_0x8a258d);default:return null;}})[_0x7571('0x27')](function(_0x330ce0){if(_0x330ce0&&_0x330ce0[_0x7571('0x28')]){var _0x1f25ff=_[_0x7571('0x3c')](_0x330ce0);if(_0x1f25ff){return BPromise[_0x7571('0x2b')]({'id':_0x1f25ff['Id'],'name':_0x1f25ff[_0x7571('0x2c')],'phone':_0x1f25ff[_0x7571('0x3d')],'endUserType':_0x1f25ff[_0x7571('0x3e')][_0x7571('0x3f')]['toLowerCase']()});}}})[_0x7571('0x27')](function(_0x2da6c9){if(_0x2da6c9){logger['info'](_0x7571('0x40'),_0x2da6c9[_0x7571('0x16')],_0x54d3df);return BPromise[_0x7571('0x2b')](_0x2da6c9);}else{logger[_0x7571('0x20')](_0x7571('0x41'),_0x54d3df);var _0x49da46={'Phone':_0x54d3df};if(_0x52a597['moduleCreate']){if(_0x52a597[_0x7571('0x42')]===_0x7571('0x17')){logger[_0x7571('0x20')](_0x7571('0x43'),_0x54d3df,_0x52a597[_0x7571('0x42')]);_0x49da46[_0x7571('0x44')]=_0x3c9dcc!==_0x7571('0x45')?_0x3c9dcc:util[_0x7571('0x46')](_0x7571('0x47'),_0x54d3df);}else if(_0x52a597[_0x7571('0x42')]===_0x7571('0x18')){logger[_0x7571('0x20')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x54d3df,_0x52a597[_0x7571('0x42')]);_0x49da46[_0x7571('0x44')]=_0x3c9dcc!==''?_0x3c9dcc:util[_0x7571('0x46')](_0x7571('0x47'),_0x54d3df);_0x49da46[_0x7571('0x48')]='No\x20Company';}else if(_0x52a597[_0x7571('0x42')]===_0x7571('0x1a')){logger[_0x7571('0x20')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x54d3df,_0x52a597[_0x7571('0x42')]);_0x49da46[_0x7571('0x2c')]=_0x3c9dcc!==''?_0x3c9dcc:util[_0x7571('0x46')](_0x7571('0x47'),_0x54d3df);}else{return null;}}return _0x50478c['sobject'](_[_0x7571('0x49')](_0x52a597[_0x7571('0x42')]))[_0x7571('0x4a')](_0x49da46)['then'](function(_0x1a2b66){return BPromise[_0x7571('0x2b')]({'id':_0x1a2b66['id'],'endUserType':_0x52a597['moduleCreate']});});}});}function getCustomFields(_0x3b141f,_0x186a5d){var _0x554122={};if(_0x3b141f['length']>0x0){_[_0x7571('0x4b')](_0x3b141f,function(_0x5c489a){if(_[_0x7571('0x4c')](['string',_0x7571('0x4d')],_0x5c489a[_0x7571('0x3f')])&&_0x5c489a[_0x7571('0x4e')]){_0x554122[_0x5c489a[_0x7571('0x4e')]]=_0x5c489a[_0x7571('0x4f')][_0x7571('0x50')]();}else if(_0x5c489a[_0x7571('0x3f')]===_0x7571('0x51')&&_0x5c489a[_0x7571('0x52')]&&_0x5c489a['idField']){_0x186a5d[_0x5c489a[_0x7571('0x52')]]&&(_0x554122[_0x5c489a['idField']]=_0x186a5d[_0x5c489a['variableName']][_0x7571('0x50')]());}else if(_0x5c489a[_0x7571('0x3f')]===_0x7571('0x53')&&_0x5c489a[_0x7571('0x54')]&&_0x5c489a['Variable'][_0x7571('0x55')]&&_0x5c489a[_0x7571('0x4e')]){_0x186a5d[_0x5c489a[_0x7571('0x54')][_0x7571('0x55')][_0x7571('0x56')]()]&&(_0x554122[_0x5c489a[_0x7571('0x4e')]]=_0x186a5d[_0x5c489a[_0x7571('0x54')]['name'][_0x7571('0x56')]()][_0x7571('0x50')]());}});}return _0x554122;}function getConnection(_0x5876b6){var _0x42fbac=_0x5876b6[_0x7571('0x57')]['concat'](_0x5876b6[_0x7571('0x58')]);var _0x1bdc80=new jsforce['Connection']({'oauth2':{'loginUrl':_0x5876b6[_0x7571('0x59')]||_0x7571('0x5a'),'clientId':_0x5876b6['clientId'],'clientSecret':_0x5876b6['clientSecret']}});return _0x1bdc80[_0x7571('0x5b')](_0x5876b6['username'],_0x42fbac)['then'](function(){logger[_0x7571('0x20')](_0x7571('0x5c'));return _0x1bdc80;});}exports[_0x7571('0x5d')]=function(_0x57573e,_0x37718c,_0x409215,_0x1c373a,_0x35de13,_0x478db1){var _0x23fbaf,_0x4707d8,_0x47c106,_0x13fc55;_0x478db1[_0x7571('0x5e')]=intUtil[_0x7571('0x5f')](_0x478db1[_0x7571('0x5e')]);_0x478db1[_0x7571('0x59')]=intUtil[_0x7571('0x5f')](_0x478db1[_0x7571('0x59')]);if(_0x35de13&&_0x35de13['monitor_format']){logger[_0x7571('0x20')](_0x7571('0x60'),_0x7571('0x61'));_0x37718c[_0x7571('0x62')]=util[_0x7571('0x46')](_0x7571('0x63'),_0x478db1[_0x7571('0x5e')],_0x37718c[_0x7571('0x64')],md5(_0x37718c[_0x7571('0x64')]));}else{_0x37718c['recordingURL']='';}return getConnection(_0x478db1)[_0x7571('0x27')](function(_0x55f889){_0x13fc55=_0x55f889;return getUser(_0x478db1,_0x1c373a[_0x7571('0x65')],_0x13fc55);})[_0x7571('0x27')](function(_0x698fe9){_0x23fbaf=_0x698fe9;return getEndUser(_0x478db1,_0x409215,_0x37718c[_0x7571('0x66')],_0x37718c[_0x7571('0x67')],_0x13fc55);})[_0x7571('0x27')](function(_0x353508){_0x4707d8=_0x353508;return getTicket(_0x478db1,_0x23fbaf,_0x4707d8,_0x409215,_0x37718c,_0x409215['Fields'],_0x13fc55,_0x7571('0x5d'));})['then'](function(_0x1f7749){_0x47c106=_0x1f7749;logger['info'](_0x7571('0x68'),_0x47c106['id']);logger[_0x7571('0x20')](_0x7571('0x69'),_0x47c106['id'],_0x1c373a[_0x7571('0x55')],_0x478db1[_0x7571('0x3f')]);switch(_0x478db1[_0x7571('0x3f')]){case _0x7571('0x6a'):emit(util['format'](_0x7571('0x6b'),_0x1c373a[_0x7571('0x55')]),'trigger:salesforce:display',{'recordId':_0x47c106['id']});break;case'newTab':emit(util['format'](_0x7571('0x6b'),_0x1c373a['name']),_0x7571('0x6c'),{'uri':util['format'](_0x7571('0x6d'),_0x13fc55[_0x7571('0x6e')],_0x47c106['id'])});break;default:logger[_0x7571('0x6f')](_0x7571('0x70'));}})[_0x7571('0x71')](function(_0x5415eb){logger[_0x7571('0x6f')]('[QUEUE]',_0x5415eb);});};exports[_0x7571('0x72')]=function(_0x3aedf0,_0x4dc8e9,_0x2f2a08,_0x556b81,_0x5f2598,_0x479ff2,_0x50095b){var _0x5b2516,_0xb780f0,_0x278f06,_0x218cec;_0x479ff2['serverUrl']=intUtil[_0x7571('0x5f')](_0x479ff2['serverUrl']);_0x479ff2['remoteUri']=intUtil[_0x7571('0x5f')](_0x479ff2[_0x7571('0x59')]);if(_0x50095b&&_0x50095b[_0x7571('0x73')]&&_0x50095b[_0x7571('0x73')]!==_0x7571('0x74')){logger[_0x7571('0x20')](_0x7571('0x75'),'Recording\x20is\x20enabled!');_0x4dc8e9[_0x7571('0x62')]=util[_0x7571('0x46')](_0x7571('0x63'),_0x479ff2[_0x7571('0x5e')],_0x4dc8e9[_0x7571('0x64')],md5(_0x4dc8e9[_0x7571('0x64')]));}return getConnection(_0x479ff2)[_0x7571('0x27')](function(_0x57aa58){_0x218cec=_0x57aa58;return getUser(_0x479ff2,_0x556b81[_0x7571('0x65')],_0x218cec);})[_0x7571('0x27')](function(_0x20682b){_0x5b2516=_0x20682b;return getEndUser(_0x479ff2,_0x2f2a08,_0x4dc8e9[_0x7571('0x76')],_0x4dc8e9['destcalleridnum'],_0x218cec);})[_0x7571('0x27')](function(_0x2bdb9e){_0xb780f0=_0x2bdb9e;return getTicket(_0x479ff2,_0x5b2516,_0xb780f0,_0x2f2a08,_0x4dc8e9,_0x2f2a08[_0x7571('0x77')],_0x218cec,_0x7571('0x72'));})[_0x7571('0x27')](function(_0x14bea5){_0x278f06=_0x14bea5;logger['info'](_0x7571('0x78'),_0x278f06['id']);logger[_0x7571('0x20')](_0x7571('0x79'),_0x278f06['id'],_0x556b81['name'],_0x479ff2[_0x7571('0x3f')]);switch(_0x479ff2[_0x7571('0x3f')]){case _0x7571('0x6a'):emit(util[_0x7571('0x46')](_0x7571('0x6b'),_0x556b81[_0x7571('0x55')]),_0x7571('0x7a'),{'recordId':_0x278f06['id']});break;case'newTab':emit(util[_0x7571('0x46')](_0x7571('0x6b'),_0x556b81[_0x7571('0x55')]),_0x7571('0x6c'),{'uri':util[_0x7571('0x46')](_0x7571('0x6d'),_0x218cec[_0x7571('0x6e')],_0x278f06['id'])});break;default:logger[_0x7571('0x6f')](_0x7571('0x75'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x7571('0x71')](function(_0xa7b4d9){logger[_0x7571('0x6f')]('[OUTBOUND]',_0xa7b4d9);});};exports[_0x7571('0x7b')]=function(_0x58f1fd,_0x2eaec0,_0x41f7b2,_0x557a4c,_0x4750fb,_0x55b71f){var _0x236f6d,_0x286ec1,_0x31d0c7,_0x328a24;_0x55b71f['serverUrl']=intUtil[_0x7571('0x5f')](_0x55b71f[_0x7571('0x5e')]);_0x55b71f[_0x7571('0x59')]=intUtil[_0x7571('0x5f')](_0x55b71f['remoteUri']);if(_0x4750fb&&_0x4750fb[_0x7571('0x7c')]){logger[_0x7571('0x20')]('['+_0x2eaec0[_0x7571('0x7d')]['toUpperCase']()+']',_0x7571('0x61'));_0x2eaec0[_0x7571('0x62')]=util[_0x7571('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x55b71f[_0x7571('0x5e')],_0x2eaec0[_0x7571('0x64')],md5(_0x2eaec0[_0x7571('0x64')]));}else{_0x2eaec0[_0x7571('0x62')]='';}return getConnection(_0x55b71f)[_0x7571('0x27')](function(_0x1abcb5){_0x328a24=_0x1abcb5;if(!_[_0x7571('0x23')](_0x557a4c)){return getUser(_0x55b71f,_0x557a4c[_0x7571('0x55')],_0x328a24);}else{return getUser(_0x55b71f,null,_0x328a24);}})[_0x7571('0x27')](function(_0x4e98fb){_0x236f6d=_0x4e98fb;return getEndUser(_0x55b71f,_0x41f7b2,_0x2eaec0['calleridname'],_0x2eaec0['calleridnum'],_0x328a24);})[_0x7571('0x27')](function(_0xf17101){_0x286ec1=_0xf17101;return getTicket(_0x55b71f,_0x236f6d,_0x286ec1,_0x41f7b2,_0x2eaec0,_0x41f7b2['Fields'],_0x328a24);})[_0x7571('0x27')](function(_0x4417db){_0x31d0c7=_0x4417db;logger[_0x7571('0x20')]('['+_0x2eaec0[_0x7571('0x7d')]['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0x31d0c7['id']);logger[_0x7571('0x20')]('['+_0x2eaec0[_0x7571('0x7d')]['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x55b71f[_0x7571('0x3f')]);})[_0x7571('0x71')](function(_0x472199){logger['error']('['+_0x2eaec0['lastevent'][_0x7571('0x7e')]()+']',_0x472199);});}; \ No newline at end of file +var _0x5557=['IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','User','execute','then','length','find','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','merge','$or','Contact','cloneDeep','additionalSearchLead','sobject','Lead','account_contact_lead','additionalSearchAccount','Account','additionalSearchContact','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','LastName','Company','upperFirst','forEach','includes','type','idField','content','toString','variableName','customVariable','Variable','name','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','catch','error','outbound','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','[OUTBOUND]','toUpperCase',']\x20Ticket\x20%s\x20created.','lastevent','lodash','request-promise','bluebird','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','localhost','socket.io-emitter','redis','emit','getString','Descriptions','ticketType','ActivityDate','utc','IsReminderSet'];(function(_0xd57022,_0x1342d6){var _0x541170=function(_0xb1fba7){while(--_0xb1fba7){_0xd57022['push'](_0xd57022['shift']());}};_0x541170(++_0x1342d6);}(_0x5557,0x69));var _0x7555=function(_0x40df1e,_0x1377f1){_0x40df1e=_0x40df1e-0x0;var _0x3e3672=_0x5557[_0x40df1e];return _0x3e3672;};'use strict';var _=require(_0x7555('0x0'));var rp=require(_0x7555('0x1'));var moment=require('moment');var BPromise=require(_0x7555('0x2'));var md5=require('md5');var jsforce=require(_0x7555('0x3'));var util=require(_0x7555('0x4'));var Redis=require('ioredis');var intUtil=require(_0x7555('0x5'));var config=require(_0x7555('0x6'));var logger=require(_0x7555('0x7'))(_0x7555('0x8'));config['redis']=_['defaults'](config['redis'],{'host':_0x7555('0x9'),'port':0x18eb});var io=require(_0x7555('0xa'))(new Redis(config[_0x7555('0xb')]));function emit(_0x4228cb,_0x49f5d1,_0x542dce){io['to'](_0x4228cb)[_0x7555('0xc')](_0x49f5d1,_0x542dce);}function getTicket(_0x51813b,_0x3adcfc,_0x54b8a7,_0x2ddb76,_0x23d0cd,_0x356d50,_0x2ceaf2,_0x3ca93e){var _0x59ee95=Object['assign']({},{'OwnerId':_0x3adcfc['id'],'Subject':intUtil[_0x7555('0xd')](_0x2ddb76['Subjects'],_0x23d0cd,'\x20'),'Description':intUtil[_0x7555('0xd')](_0x2ddb76[_0x7555('0xe')],_0x23d0cd,'\x0a')},getCustomFields(_0x356d50,_0x23d0cd));if(_0x54b8a7){if(_0x2ddb76[_0x7555('0xf')]==='Task'){_0x59ee95[_0x7555('0x10')]=moment[_0x7555('0x11')]();_0x59ee95[_0x7555('0x12')]=![];_0x59ee95[_0x7555('0x13')]=![];if(_0x54b8a7[_0x7555('0x14')]===_0x7555('0x15')||_0x54b8a7[_0x7555('0x14')]===_0x7555('0x16')){_0x59ee95[_0x7555('0x17')]=_0x54b8a7['id'];}else if(_0x54b8a7[_0x7555('0x14')]===_0x7555('0x18')){_0x59ee95[_0x7555('0x19')]=_0x54b8a7['id'];}}else if(_0x2ddb76[_0x7555('0xf')]===_0x7555('0x1a')){if(_0x54b8a7[_0x7555('0x14')]===_0x7555('0x15')){_0x59ee95[_0x7555('0x1b')]=_0x54b8a7['id'];}else if(_0x54b8a7['endUserType']===_0x7555('0x18')){_0x59ee95[_0x7555('0x1c')]=_0x54b8a7['id'];}else if(_0x54b8a7[_0x7555('0x14')]===_0x7555('0x16')&&_0x2ddb76[_0x7555('0x1d')]){_0x59ee95[_0x2ddb76[_0x7555('0x1d')]]=_0x54b8a7['id'];}else{logger[_0x7555('0x1e')](_0x7555('0x1f'));}}}return _0x2ceaf2['sobject'](_0x2ddb76[_0x7555('0xf')])[_0x7555('0x20')](_0x59ee95);}function getUser(_0xd46516,_0x3230b2,_0x259737){if(!_[_0x7555('0x21')](_0x3230b2)&&intUtil['validateEmail'](_0x3230b2)){var _0x2d5459={'Email':_0x3230b2};var _0x852f65={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x259737['sobject'](_0x7555('0x22'))['find'](_0x2d5459,_0x852f65)[_0x7555('0x23')]()[_0x7555('0x24')](function(_0x4cf07b){if(_0x4cf07b[_0x7555('0x25')]){var _0x502808=_[_0x7555('0x26')](_0x4cf07b,function(_0x3789b3){return _0x3789b3[_0x7555('0x27')]===_0x3230b2;});if(_0x502808){logger['info'](_0x7555('0x28'),_0x3230b2);return BPromise[_0x7555('0x29')]({'id':_0x502808['Id'],'name':_0x502808[_0x7555('0x2a')]});}}else{logger['info'](_0x7555('0x2b'),_0x3230b2);return _0x259737['identity']()[_0x7555('0x24')](function(_0x442f39){return BPromise[_0x7555('0x29')]({'id':_0x442f39[_0x7555('0x2c')],'name':_0x442f39[_0x7555('0x2d')]});});}});}else{logger[_0x7555('0x1e')](_0x7555('0x2b'),_0x3230b2);return _0x259737['identity']()['then'](function(_0x3eafcd){return BPromise[_0x7555('0x29')]({'id':_0x3eafcd[_0x7555('0x2c')],'name':_0x3eafcd[_0x7555('0x2d')]});});}}function getEndUser(_0x345da3,_0x24a81f,_0x2283ef,_0x19a479,_0x29dfcb){var _0x5218e9={'$or':{'Phone':_0x19a479}};var _0x219167={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x7555('0x29')]()['then'](function(){logger[_0x7555('0x1e')](_0x7555('0x2e'),_0x19a479,_0x24a81f[_0x7555('0x2f')]);switch(_0x24a81f[_0x7555('0x2f')]){case _0x7555('0x30'):var _0x4619df=_['cloneDeep'](_0x5218e9);if(_0x24a81f['additionalSearchContact']){var _0x59f92f={};_0x59f92f[_0x24a81f['additionalSearchContact']]=_0x19a479;_[_0x7555('0x31')](_0x4619df[_0x7555('0x32')],_0x59f92f);}return _0x29dfcb['sobject'](_0x7555('0x33'))[_0x7555('0x26')](_0x4619df,_0x219167)[_0x7555('0x23')]()[_0x7555('0x24')](function(_0x2be38d){if(_0x2be38d&&_0x2be38d[_0x7555('0x25')]){return _0x2be38d;}else{var _0x3ac4a9=_[_0x7555('0x34')](_0x5218e9);if(_0x24a81f[_0x7555('0x35')]){var _0xe774e2={};_0xe774e2[_0x24a81f[_0x7555('0x35')]]=_0x19a479;_[_0x7555('0x31')](_0x3ac4a9[_0x7555('0x32')],_0xe774e2);}return _0x29dfcb[_0x7555('0x36')](_0x7555('0x37'))[_0x7555('0x26')](_0x3ac4a9,_0x219167);}});case _0x7555('0x38'):var _0x1bf010=_['cloneDeep'](_0x5218e9);if(_0x24a81f[_0x7555('0x39')]){var _0x59f92f={};_0x59f92f[_0x24a81f[_0x7555('0x39')]]=_0x19a479;_['merge'](_0x1bf010[_0x7555('0x32')],_0x59f92f);}return _0x29dfcb['sobject'](_0x7555('0x3a'))[_0x7555('0x26')](_0x1bf010,_0x219167)[_0x7555('0x23')]()[_0x7555('0x24')](function(_0x2cd10d){if(_0x2cd10d&&_0x2cd10d[_0x7555('0x25')]){return _0x2cd10d;}else{var _0x278310=_[_0x7555('0x34')](_0x5218e9);if(_0x24a81f[_0x7555('0x3b')]){var _0x4d3d4d={};_0x4d3d4d[_0x24a81f[_0x7555('0x3b')]]=_0x19a479;_[_0x7555('0x31')](_0x278310[_0x7555('0x32')],_0x4d3d4d);}return _0x29dfcb[_0x7555('0x36')]('Contact')['find'](_0x278310,_0x219167)[_0x7555('0x24')](function(_0x45086d){if(_0x45086d&&_0x45086d['length']){return _0x45086d;}else{var _0x463ef1=_['cloneDeep'](_0x5218e9);if(_0x24a81f['additionalSearchLead']){var _0x1cf7e9={};_0x1cf7e9[_0x24a81f['additionalSearchLead']]=_0x19a479;_[_0x7555('0x31')](_0x463ef1[_0x7555('0x32')],_0x1cf7e9);}return _0x29dfcb[_0x7555('0x36')](_0x7555('0x37'))[_0x7555('0x26')](_0x463ef1,_0x219167);}});}});case _0x7555('0x15'):var _0x4619df=_[_0x7555('0x34')](_0x5218e9);if(_0x24a81f[_0x7555('0x3b')]){var _0x59f92f={};_0x59f92f[_0x24a81f[_0x7555('0x3b')]]=_0x19a479;_['merge'](_0x4619df[_0x7555('0x32')],_0x59f92f);}return _0x29dfcb[_0x7555('0x36')]('Contact')[_0x7555('0x26')](_0x4619df,_0x219167)[_0x7555('0x23')]();case _0x7555('0x16'):var _0x260d05=_[_0x7555('0x34')](_0x5218e9);if(_0x24a81f[_0x7555('0x35')]){var _0x59f92f={};_0x59f92f[_0x24a81f[_0x7555('0x35')]]=_0x19a479;_[_0x7555('0x31')](_0x260d05[_0x7555('0x32')],_0x59f92f);}return _0x29dfcb[_0x7555('0x36')]('Lead')['find'](_0x260d05,_0x219167);case'account':var _0x1bf010=_[_0x7555('0x34')](_0x5218e9);if(_0x24a81f['additionalSearchAccount']){var _0x59f92f={};_0x59f92f[_0x24a81f[_0x7555('0x39')]]=_0x19a479;_['merge'](_0x1bf010[_0x7555('0x32')],_0x59f92f);}return _0x29dfcb[_0x7555('0x36')](_0x7555('0x3a'))[_0x7555('0x26')](_0x1bf010,_0x219167);default:return null;}})[_0x7555('0x24')](function(_0x2d7a84){if(_0x2d7a84&&_0x2d7a84[_0x7555('0x25')]){var _0x461d9c=_['first'](_0x2d7a84);if(_0x461d9c){return BPromise[_0x7555('0x29')]({'id':_0x461d9c['Id'],'name':_0x461d9c[_0x7555('0x2a')],'phone':_0x461d9c['Phone'],'endUserType':_0x461d9c[_0x7555('0x3c')]['type'][_0x7555('0x3d')]()});}}})[_0x7555('0x24')](function(_0x111387){if(_0x111387){logger[_0x7555('0x1e')](_0x7555('0x3e'),_0x111387['endUserType'],_0x19a479);return BPromise[_0x7555('0x29')](_0x111387);}else{logger[_0x7555('0x1e')](_0x7555('0x3f'),_0x19a479);var _0x49c1f0={'Phone':_0x19a479};if(_0x24a81f['moduleCreate']){if(_0x24a81f[_0x7555('0x40')]===_0x7555('0x15')){logger[_0x7555('0x1e')](_0x7555('0x41'),_0x19a479,_0x24a81f['moduleCreate']);_0x49c1f0['LastName']=_0x2283ef!==_0x7555('0x42')?_0x2283ef:util[_0x7555('0x43')](_0x7555('0x44'),_0x19a479);}else if(_0x24a81f[_0x7555('0x40')]===_0x7555('0x16')){logger[_0x7555('0x1e')](_0x7555('0x41'),_0x19a479,_0x24a81f[_0x7555('0x40')]);_0x49c1f0[_0x7555('0x45')]=_0x2283ef!==_0x7555('0x42')?_0x2283ef:util[_0x7555('0x43')](_0x7555('0x44'),_0x19a479);_0x49c1f0[_0x7555('0x46')]='No\x20Company';}else if(_0x24a81f[_0x7555('0x40')]===_0x7555('0x18')){logger[_0x7555('0x1e')](_0x7555('0x41'),_0x19a479,_0x24a81f[_0x7555('0x40')]);_0x49c1f0[_0x7555('0x2a')]=_0x2283ef!==_0x7555('0x42')?_0x2283ef:util[_0x7555('0x43')](_0x7555('0x44'),_0x19a479);}else{return null;}}return _0x29dfcb['sobject'](_[_0x7555('0x47')](_0x24a81f['moduleCreate']))[_0x7555('0x20')](_0x49c1f0)[_0x7555('0x24')](function(_0x456918){return BPromise['resolve']({'id':_0x456918['id'],'endUserType':_0x24a81f[_0x7555('0x40')]});});}});}function getCustomFields(_0x3adddb,_0x9afe8e){var _0x269af9={};if(_0x3adddb['length']>0x0){_[_0x7555('0x48')](_0x3adddb,function(_0x4e52b2){if(_[_0x7555('0x49')](['string','picklist'],_0x4e52b2[_0x7555('0x4a')])&&_0x4e52b2[_0x7555('0x4b')]){_0x269af9[_0x4e52b2[_0x7555('0x4b')]]=_0x4e52b2[_0x7555('0x4c')][_0x7555('0x4d')]();}else if(_0x4e52b2[_0x7555('0x4a')]==='variable'&&_0x4e52b2['variableName']&&_0x4e52b2[_0x7555('0x4b')]){_0x9afe8e[_0x4e52b2['variableName']]&&(_0x269af9[_0x4e52b2[_0x7555('0x4b')]]=_0x9afe8e[_0x4e52b2[_0x7555('0x4e')]]['toString']());}else if(_0x4e52b2[_0x7555('0x4a')]===_0x7555('0x4f')&&_0x4e52b2[_0x7555('0x50')]&&_0x4e52b2['Variable'][_0x7555('0x51')]&&_0x4e52b2['idField']){_0x9afe8e[_0x4e52b2[_0x7555('0x50')][_0x7555('0x51')][_0x7555('0x3d')]()]&&(_0x269af9[_0x4e52b2['idField']]=_0x9afe8e[_0x4e52b2['Variable'][_0x7555('0x51')][_0x7555('0x3d')]()][_0x7555('0x4d')]());}});}return _0x269af9;}function getConnection(_0x5ef430){var _0x30c50b=_0x5ef430[_0x7555('0x52')][_0x7555('0x53')](_0x5ef430[_0x7555('0x54')]);var _0x410d4d=new jsforce['Connection']({'oauth2':{'loginUrl':_0x5ef430[_0x7555('0x55')]||_0x7555('0x56'),'clientId':_0x5ef430[_0x7555('0x57')],'clientSecret':_0x5ef430[_0x7555('0x58')]}});return _0x410d4d[_0x7555('0x59')](_0x5ef430['username'],_0x30c50b)[_0x7555('0x24')](function(){logger[_0x7555('0x1e')](_0x7555('0x5a'));return _0x410d4d;});}exports[_0x7555('0x5b')]=function(_0x14519f,_0x20e339,_0x5bb6e0,_0x55b096,_0x5c05c3,_0x53a172){var _0x317172,_0x5663db,_0x53ee4c,_0x15e139;_0x53a172[_0x7555('0x5c')]=intUtil[_0x7555('0x5d')](_0x53a172[_0x7555('0x5c')]);_0x53a172[_0x7555('0x55')]=intUtil['stripTrailingSlash'](_0x53a172[_0x7555('0x55')]);if(_0x5c05c3&&_0x5c05c3[_0x7555('0x5e')]){logger[_0x7555('0x1e')](_0x7555('0x5f'),'Recording\x20is\x20enabled!');_0x20e339[_0x7555('0x60')]=util[_0x7555('0x43')](_0x7555('0x61'),_0x53a172[_0x7555('0x5c')],_0x20e339[_0x7555('0x62')],md5(_0x20e339['uniqueid']));}else{_0x20e339[_0x7555('0x60')]='';}return getConnection(_0x53a172)[_0x7555('0x24')](function(_0x4dcd86){_0x15e139=_0x4dcd86;return getUser(_0x53a172,_0x55b096[_0x7555('0x63')],_0x15e139);})[_0x7555('0x24')](function(_0x5e1c67){_0x317172=_0x5e1c67;return getEndUser(_0x53a172,_0x5bb6e0,_0x20e339[_0x7555('0x64')],_0x20e339[_0x7555('0x65')],_0x15e139);})[_0x7555('0x24')](function(_0x44c54d){_0x5663db=_0x44c54d;return getTicket(_0x53a172,_0x317172,_0x5663db,_0x5bb6e0,_0x20e339,_0x5bb6e0[_0x7555('0x66')],_0x15e139,_0x7555('0x5b'));})[_0x7555('0x24')](function(_0x1387e8){_0x53ee4c=_0x1387e8;logger['info'](_0x7555('0x67'),_0x53ee4c['id']);logger['info'](_0x7555('0x68'),_0x53ee4c['id'],_0x55b096[_0x7555('0x51')],_0x53a172[_0x7555('0x4a')]);switch(_0x53a172['type']){case'integrationTab':emit(util[_0x7555('0x43')]('user:%s',_0x55b096[_0x7555('0x51')]),_0x7555('0x69'),{'recordId':_0x53ee4c['id']});break;case _0x7555('0x6a'):emit(util[_0x7555('0x43')]('user:%s',_0x55b096['name']),_0x7555('0x6b'),{'uri':util[_0x7555('0x43')](_0x7555('0x6c'),_0x15e139['instanceUrl'],_0x53ee4c['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x7555('0x6d')](function(_0x1c03dc){logger[_0x7555('0x6e')](_0x7555('0x5f'),_0x1c03dc);});};exports[_0x7555('0x6f')]=function(_0x3c3f12,_0x375acd,_0x45560e,_0x173f9e,_0x57a0b6,_0xd2b4,_0x14e835){var _0x467cd7,_0x18f1ee,_0x58dbfe,_0x48bd7f;_0xd2b4['serverUrl']=intUtil[_0x7555('0x5d')](_0xd2b4[_0x7555('0x5c')]);_0xd2b4[_0x7555('0x55')]=intUtil[_0x7555('0x5d')](_0xd2b4[_0x7555('0x55')]);if(_0x14e835&&_0x14e835[_0x7555('0x70')]&&_0x14e835[_0x7555('0x70')]!==_0x7555('0x71')){logger['info']('[OUTBOUND]',_0x7555('0x72'));_0x375acd[_0x7555('0x60')]=util[_0x7555('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd2b4['serverUrl'],_0x375acd[_0x7555('0x62')],md5(_0x375acd[_0x7555('0x62')]));}return getConnection(_0xd2b4)[_0x7555('0x24')](function(_0x4f7bd8){_0x48bd7f=_0x4f7bd8;return getUser(_0xd2b4,_0x173f9e[_0x7555('0x63')],_0x48bd7f);})[_0x7555('0x24')](function(_0x131df3){_0x467cd7=_0x131df3;return getEndUser(_0xd2b4,_0x45560e,_0x375acd[_0x7555('0x73')],_0x375acd[_0x7555('0x74')],_0x48bd7f);})[_0x7555('0x24')](function(_0xf44e62){_0x18f1ee=_0xf44e62;return getTicket(_0xd2b4,_0x467cd7,_0x18f1ee,_0x45560e,_0x375acd,_0x45560e[_0x7555('0x66')],_0x48bd7f,_0x7555('0x6f'));})[_0x7555('0x24')](function(_0x57ef02){_0x58dbfe=_0x57ef02;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x58dbfe['id']);logger[_0x7555('0x1e')](_0x7555('0x75'),_0x58dbfe['id'],_0x173f9e['name'],_0xd2b4[_0x7555('0x4a')]);switch(_0xd2b4[_0x7555('0x4a')]){case _0x7555('0x76'):emit(util['format'](_0x7555('0x77'),_0x173f9e[_0x7555('0x51')]),_0x7555('0x69'),{'recordId':_0x58dbfe['id']});break;case _0x7555('0x6a'):emit(util[_0x7555('0x43')]('user:%s',_0x173f9e['name']),_0x7555('0x6b'),{'uri':util[_0x7555('0x43')](_0x7555('0x6c'),_0x48bd7f['instanceUrl'],_0x58dbfe['id'])});break;default:logger['error'](_0x7555('0x78'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x7555('0x6d')](function(_0x58217e){logger[_0x7555('0x6e')](_0x7555('0x78'),_0x58217e);});};exports['unmanaged']=function(_0x1c6a6f,_0x3e307b,_0x2491e1,_0xd91dd,_0x4b9437,_0x3cc41a){var _0x159950,_0x529540,_0x4c3652,_0x3a3b1f;_0x3cc41a[_0x7555('0x5c')]=intUtil['stripTrailingSlash'](_0x3cc41a[_0x7555('0x5c')]);_0x3cc41a['remoteUri']=intUtil[_0x7555('0x5d')](_0x3cc41a[_0x7555('0x55')]);if(_0x4b9437&&_0x4b9437[_0x7555('0x5e')]){logger[_0x7555('0x1e')]('['+_0x3e307b['lastevent'][_0x7555('0x79')]()+']',_0x7555('0x72'));_0x3e307b[_0x7555('0x60')]=util[_0x7555('0x43')](_0x7555('0x61'),_0x3cc41a[_0x7555('0x5c')],_0x3e307b[_0x7555('0x62')],md5(_0x3e307b[_0x7555('0x62')]));}else{_0x3e307b['recordingURL']='';}return getConnection(_0x3cc41a)['then'](function(_0x2999d1){_0x3a3b1f=_0x2999d1;if(!_[_0x7555('0x21')](_0xd91dd)){return getUser(_0x3cc41a,_0xd91dd[_0x7555('0x51')],_0x3a3b1f);}else{return getUser(_0x3cc41a,null,_0x3a3b1f);}})[_0x7555('0x24')](function(_0x360cb0){_0x159950=_0x360cb0;return getEndUser(_0x3cc41a,_0x2491e1,_0x3e307b[_0x7555('0x64')],_0x3e307b[_0x7555('0x65')],_0x3a3b1f);})['then'](function(_0x48ed03){_0x529540=_0x48ed03;return getTicket(_0x3cc41a,_0x159950,_0x529540,_0x2491e1,_0x3e307b,_0x2491e1[_0x7555('0x66')],_0x3a3b1f);})['then'](function(_0x203fab){_0x4c3652=_0x203fab;logger[_0x7555('0x1e')]('['+_0x3e307b['lastevent']['toUpperCase']()+_0x7555('0x7a'),_0x4c3652['id']);logger['info']('['+_0x3e307b[_0x7555('0x7b')][_0x7555('0x79')]()+']\x20Integration\x20account\x20type\x20%s.',_0x3cc41a[_0x7555('0x4a')]);})[_0x7555('0x6d')](function(_0x25948c){logger[_0x7555('0x6e')]('['+_0x3e307b['lastevent'][_0x7555('0x79')]()+']',_0x25948c);});}; \ 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 a5a3889..f26256f 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 _0x4096=['string','type','nameField','toLowerCase','content','picklist','idField','customField','toString','variable','variableName','Variable','name','getString','Subjects',']\x20POST\x20incident\x20entity\x20schema','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','ticketId','Incident\x20-\x20','ticketNumber','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','outbound','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','md5','../../../../config/environment','../../../../config/logger','redis','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes'];(function(_0x4173d7,_0x551de1){var _0x1b77b0=function(_0x4a454b){while(--_0x4a454b){_0x4173d7['push'](_0x4173d7['shift']());}};_0x1b77b0(++_0x551de1);}(_0x4096,0x189));var _0x6409=function(_0x50b5b4,_0x3a5db0){_0x50b5b4=_0x50b5b4-0x0;var _0x1aaa8a=_0x4096[_0x50b5b4];return _0x1aaa8a;};'use strict';var _=require(_0x6409('0x0'));var Promise=require(_0x6409('0x1'));var rp=require('request-promise');var util=require(_0x6409('0x2'));var md5=require(_0x6409('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x6409('0x4'));var logger=require(_0x6409('0x5'))('servicenow');config[_0x6409('0x6')]=_['defaults'](config[_0x6409('0x6')],{'host':_0x6409('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x4a40f9,_0x5c1261,_0x25ae46,_0xb5b170,_0x3deafb,_0x22b75b){return new Promise(function(_0x31ed47,_0x8d7e2c){var _0x27aa0e={'method':_0x6409('0x8'),'uri':_0xb5b170+_0x6409('0x9')+'&'+_0x3deafb+'&'+_0x22b75b,'auth':_0x5c1261,'json':!![]};return rp(_0x27aa0e)[_0x6409('0xa')](function(_0x4f30e5){if(_0x4f30e5['result'][_0x6409('0xb')]>0x0){_0x25ae46[_0x6409('0xc')]=_0x4f30e5[_0x6409('0xd')][0x0][_0x6409('0xe')];}logger[_0x6409('0xf')]('['+[_0x4a40f9[_0x6409('0x10')]()]+_0x6409('0x11'),_0x25ae46);_0x31ed47(_0x25ae46);})[_0x6409('0x12')](function(_0x4eef86){logger['error']('['+[_0x4a40f9[_0x6409('0x10')]()]+']',_0x4eef86['message']);_0x8d7e2c(_0x4eef86[_0x6409('0x13')]);});});}function getUser(_0x43cf4f,_0x5ed5d6,_0x26ac14,_0x2bf800,_0x1c9f06){return function(_0x430738){logger[_0x6409('0xf')]('['+[_0x43cf4f[_0x6409('0x10')]()]+_0x6409('0x14'),_0x430738);return new Promise(function(_0x209596,_0x2d4dcd){if(intUtil[_0x6409('0x15')](_0x430738[_0x6409('0x16')])){var _0x251c8f={'method':'GET','uri':_0x26ac14+_0x6409('0x17')+_0x430738['userEmail']+'&'+_0x2bf800+'&'+_0x1c9f06,'auth':_0x5ed5d6,'json':!![]};logger[_0x6409('0xf')]('['+[_0x43cf4f[_0x6409('0x10')]()]+_0x6409('0x18'),_0x251c8f);return rp(_0x251c8f)[_0x6409('0xa')](function(_0xa5d615){logger[_0x6409('0xf')]('['+[_0x43cf4f[_0x6409('0x10')]()]+_0x6409('0x19'),_0xa5d615);if(_0xa5d615['result'][_0x6409('0xb')]>0x0&&String(_0xa5d615['result'][0x0][_0x6409('0x1a')])===_0x6409('0x1b')){_0x430738[_0x6409('0x1c')]=_0xa5d615[_0x6409('0xd')][0x0]['sys_id'];}else{_0x430738[_0x6409('0x1c')]=_0x430738[_0x6409('0xc')];_0x430738[_0x6409('0x16')]=_0x430738['adminEmail'];}logger[_0x6409('0xf')]('['+[_0x43cf4f['toUpperCase']()]+_0x6409('0x1d'),_0x430738);_0x209596(_0x430738);})[_0x6409('0x12')](function(_0x50da66){logger[_0x6409('0x1e')]('['+[_0x43cf4f[_0x6409('0x10')]()]+']',_0x50da66[_0x6409('0x13')]);_0x2d4dcd(_0x50da66['message']);});}else{logger[_0x6409('0xf')]('['+[_0x43cf4f[_0x6409('0x10')]()]+_0x6409('0x1f'));_0x430738[_0x6409('0x1c')]=_0x430738['adminId'];_0x430738[_0x6409('0x16')]=_0x430738[_0x6409('0x20')];_0x209596(_0x430738);}});};}function createEndUser(_0x3220f7,_0x6b86a1,_0x24da6c,_0x4f8c18,_0x553359){logger['info']('['+[_0x3220f7[_0x6409('0x10')]()]+_0x6409('0x21'),_0x24da6c);return new Promise(function(_0x507c01,_0x327fcf){var _0x3ecd8f={'method':_0x6409('0x22'),'uri':_0x4f8c18+_0x6409('0x23')+_0x553359,'body':{'user_name':_0x24da6c['endUserNumber'],'roles':_0x6409('0x24'),'first_name':_0x24da6c[_0x6409('0x25')],'active':_0x6409('0x1b'),'date_format':_0x6409('0x26'),'phone':_0x24da6c['endUserNumber']},'auth':_0x6b86a1,'json':!![]};return rp(_0x3ecd8f)[_0x6409('0xa')](function(_0x107e60){logger[_0x6409('0xf')]('['+[_0x3220f7[_0x6409('0x10')]()]+_0x6409('0x27'),_0x107e60[_0x6409('0xd')]);_0x24da6c[_0x6409('0x28')]=_0x107e60[_0x6409('0xd')][_0x6409('0xe')];_0x507c01(_0x24da6c);})['catch'](function(_0x29b29e){logger['error']('['+[_0x3220f7[_0x6409('0x10')]()]+']',_0x29b29e[_0x6409('0x13')]);_0x327fcf(_0x29b29e[_0x6409('0x13')]);});});}function getEndUser(_0x20f5e6,_0x5286cd,_0x106211,_0x54948a,_0x25e3c3){return function(_0x35b94d){logger[_0x6409('0xf')]('['+[_0x20f5e6[_0x6409('0x10')]()]+_0x6409('0x29'),_0x35b94d);return new Promise(function(_0x58c268,_0x5dfe33){var _0x217709={'method':'GET','uri':_0x106211+_0x6409('0x2a')+_0x35b94d[_0x6409('0x25')]+'&'+_0x54948a+'&'+_0x25e3c3,'auth':_0x5286cd,'json':!![]};return rp(_0x217709)[_0x6409('0xa')](function(_0x2b3830){if(_0x2b3830['result'][_0x6409('0xb')]>0x0){_0x35b94d[_0x6409('0x28')]=_0x2b3830[_0x6409('0xd')][0x0][_0x6409('0xe')];logger[_0x6409('0xf')]('['+[_0x20f5e6['toUpperCase']()]+_0x6409('0x2b'),_0x35b94d);_0x58c268(_0x35b94d);}else{return createEndUser(_0x20f5e6,_0x5286cd,_0x35b94d,_0x106211,_0x54948a)[_0x6409('0xa')](function(_0x574873){logger['info']('['+[_0x20f5e6['toUpperCase']()]+_0x6409('0x2c'),_0x574873);_0x58c268(_0x574873);});}})[_0x6409('0x12')](function(_0x3e99ae){logger[_0x6409('0x1e')]('['+[_0x20f5e6[_0x6409('0x10')]()]+']',_0x3e99ae[_0x6409('0x13')]);_0x5dfe33(_0x3e99ae[_0x6409('0x13')]);});});};}function getCustomFields(_0x3df35b,_0x3de759){var _0x3d7e0d={};if(_0x3df35b[_0x6409('0xb')]>0x0){_[_0x6409('0x2d')](_0x3df35b,function(_0x4bdd30){if(_[_0x6409('0x2e')]([_0x6409('0x2f'),'picklist'],_0x4bdd30[_0x6409('0x30')])&&_0x4bdd30[_0x6409('0x31')]&&!_0x4bdd30['customField']){_0x3d7e0d[_0x4bdd30[_0x6409('0x31')][_0x6409('0x32')]()]=_0x4bdd30[_0x6409('0x33')]['toString']();}else if(_['includes']([_0x6409('0x2f'),_0x6409('0x34')],_0x4bdd30[_0x6409('0x30')])&&_0x4bdd30[_0x6409('0x35')]&&_0x4bdd30[_0x6409('0x36')]){_0x3d7e0d[_0x4bdd30[_0x6409('0x35')][_0x6409('0x32')]()]=_0x4bdd30[_0x6409('0x33')][_0x6409('0x37')]();}else if(_0x4bdd30['type']===_0x6409('0x38')&&_0x4bdd30[_0x6409('0x39')]&&_0x4bdd30['idField']&&_0x4bdd30['customField']){_0x3d7e0d[_0x4bdd30[_0x6409('0x35')][_0x6409('0x32')]()]=_0x3de759[_0x4bdd30[_0x6409('0x39')]][_0x6409('0x37')]();}else if(_0x4bdd30[_0x6409('0x30')]==='customVariable'&&_0x4bdd30[_0x6409('0x3a')]&&_0x4bdd30['Variable'][_0x6409('0x3b')]&&_0x4bdd30['idField']&&_0x4bdd30[_0x6409('0x36')]){_0x3d7e0d[_0x4bdd30[_0x6409('0x35')][_0x6409('0x32')]()]=_0x3de759[_0x4bdd30[_0x6409('0x3a')]['name'][_0x6409('0x32')]()][_0x6409('0x37')]();}});}return _0x3d7e0d;}function getTicket(_0x45c1ca,_0x5c9f2b,_0x29b3e0,_0x11003a,_0x1d2fbd,_0x20f8f2){return function(_0x4e3009){logger[_0x6409('0xf')]('['+[_0x45c1ca[_0x6409('0x10')]()]+']\x20getTicket\x20input\x20crm',_0x4e3009);return new Promise(function(_0x41ff56,_0x26bb44){var _0x107f0d=_0x45c1ca[_0x6409('0x32')]()==='outbound'?_0x4e3009[_0x6409('0x1c')]:_0x4e3009['endUserId'];var _0x28aeaf={'method':_0x6409('0x22'),'uri':_0x29b3e0+'incident'+'?'+_0x20f8f2,'body':Object['assign']({},{'active':'true','caller_id':_0x107f0d,'assigned_to':_0x4e3009['userId'],'short_description':intUtil[_0x6409('0x3c')](_0x11003a[_0x6409('0x3d')],_0x1d2fbd,'\x20'),'description':intUtil['getString'](_0x11003a['Descriptions'],_0x1d2fbd,'\x0a')},getCustomFields(_0x11003a['Fields'],_0x1d2fbd)),'auth':_0x5c9f2b,'json':!![]};return rp(_0x28aeaf)[_0x6409('0xa')](function(_0x53f7ec){logger[_0x6409('0xf')]('['+[_0x45c1ca[_0x6409('0x10')]()]+_0x6409('0x3e'),_0x53f7ec['result']);_0x4e3009['ticketId']=_0x53f7ec['result'][_0x6409('0xe')];_0x4e3009['ticketNumber']=_0x53f7ec[_0x6409('0xd')][_0x6409('0x3f')];logger[_0x6409('0xf')]('['+[_0x45c1ca[_0x6409('0x10')]()]+_0x6409('0x40'),_0x4e3009);_0x41ff56(_0x4e3009);})[_0x6409('0x12')](function(_0x51e801){logger[_0x6409('0x1e')]('['+[_0x45c1ca['toUpperCase']()]+']',_0x51e801[_0x6409('0x13')]);_0x26bb44(_0x51e801[_0x6409('0x13')]);});});};}function createRemoteTag(_0x4c376c,_0x12408b,_0x11e6b5,_0x47967a){return new Promise(function(_0x1373df,_0x29a92d){var _0x842f98={'method':'POST','uri':_0x11e6b5+'label'+'?'+_0x47967a,'body':{'short_description':_0x4c376c,'global':!![],'active':!![],'name':_0x4c376c},'auth':_0x12408b,'json':!![]};return rp(_0x842f98)[_0x6409('0xa')](function(_0x2901fc){var _0x3744e4=_0x2901fc[_0x6409('0xd')]['sys_id'];_0x1373df(_0x3744e4);});});}function getRemoteTag(_0x3904ab,_0x31db84,_0x4eacc7,_0x493491,_0x112a8f){return new Promise(function(_0x301c18,_0x520c90){var _0x1f5fd2={'method':'GET','uri':_0x4eacc7+_0x6409('0x41')+_0x6409('0x42')+_0x3904ab+'&'+_0x493491,'auth':_0x31db84,'json':!![]};return rp(_0x1f5fd2)[_0x6409('0xa')](function(_0x3b2705){if(_0x3b2705['result']['length']>0x0){var _0x3d3f80=_0x3b2705[_0x6409('0xd')][0x0]['sys_id'];_0x301c18(_0x3d3f80);}else{return createRemoteTag(_0x3904ab,_0x31db84,_0x4eacc7,_0x493491)['then'](function(_0x4ec22f){_0x301c18(_0x4ec22f);});}});});}function assignTagToIncident(_0xcc603c,_0x3f9dc1,_0x946fa2,_0x2ca93e,_0x440e6f){return new Promise(function(_0x3456c0,_0x3476fb){var _0x4eafb9={'method':_0x6409('0x22'),'uri':_0x946fa2+_0x6409('0x43')+'?'+_0x440e6f,'body':{'label':_0xcc603c,'table':_0x6409('0x44'),'id_type':'Incident','table_key':_0x2ca93e[_0x6409('0x45')],'title':_0x6409('0x46')+_0x2ca93e[_0x6409('0x47')],'id_display':_0x2ca93e[_0x6409('0x47')]},'auth':_0x3f9dc1,'json':!![]};return rp(_0x4eafb9)[_0x6409('0xa')](function(_0x297fe9){_0x3456c0();})[_0x6409('0x12')](function(){_0x3456c0();});});}function manageTags(_0x4ebdd1,_0x3d4412,_0xb995a8,_0x2c3bbd,_0x455fa6,_0x59790b,_0xa67dab){return new Promise(function(_0x3a5764,_0x2f8136){var _0x46ac37=[];_0x3d4412[_0x6409('0x2d')](function(_0xd1ce27){_0x46ac37[_0x6409('0x48')](getRemoteTag(_0xd1ce27,_0xb995a8,_0x2c3bbd,_0x59790b,_0xa67dab));});return Promise['all'](_0x46ac37)['then'](function(_0x2d8e1e){if(_0x2d8e1e[_0x6409('0xb')]){logger[_0x6409('0xf')]('['+[_0x4ebdd1[_0x6409('0x10')]()]+_0x6409('0x49'),_0x2d8e1e);var _0x80088e=[];_0x2d8e1e['forEach'](function(_0x23da82){_0x80088e[_0x6409('0x48')](assignTagToIncident(_0x23da82,_0xb995a8,_0x2c3bbd,_0x455fa6,_0x59790b));});return Promise[_0x6409('0x4a')](_0x80088e)['then'](function(){_0x3a5764();})[_0x6409('0x12')](function(){_0x3a5764();});}else{_0x3a5764();}});});}function getTags(_0x143c38,_0x3a0d4c,_0x3acaa4,_0x42daa9,_0x4ed050,_0x1eb96a){return function(_0x265cdd){return new Promise(function(_0x1a3485,_0x3360d4){var _0x4b6af3=[];var _0xda2f64=_0x42daa9[_0x6409('0x4b')];if(_0xda2f64&&_0xda2f64[_0x6409('0xb')]>0x0){_0x4b6af3=_[_0x6409('0x4c')](_0xda2f64,_0x6409('0x3b'));}if(_0x4b6af3[_0x6409('0xb')]>0x0){return manageTags(_0x143c38,_0x4b6af3,_0x3a0d4c,_0x3acaa4,_0x265cdd,_0x4ed050,_0x1eb96a)['then'](function(){_0x1a3485(_0x265cdd);});}else{_0x1a3485(_0x265cdd);}});};}function emit(_0x3db762,_0x30b013,_0x12dad0){var _0x51a16c=_0x6409('0x4d')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x6409('0x4e')+_0x6409('0x4f');var _0x34d6b4={'uri':_0x3db762+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x12dad0+_0x51a16c};io['to'](util[_0x6409('0x50')](_0x6409('0x51'),_0x30b013))[_0x6409('0x52')]('trigger:browser:url',_0x34d6b4);}exports['cs']=function(_0x52f5cd,_0x3406cd,_0x3b44b2,_0x2b057b,_0x101049,_0x4ee268,_0x4cc6a0,_0x2e3a2f){var _0x20aadc={};var _0x3d6d3f={'user':_0x4ee268[_0x6409('0x53')],'pass':_0x4ee268[_0x6409('0x54')]};var _0x351f4b=_0x6409('0x55');var _0x5baa37=_0x6409('0x56');_0x4ee268[_0x6409('0x57')]=intUtil[_0x6409('0x58')](_0x4ee268['remoteUri']);_0x4ee268[_0x6409('0x59')]=intUtil[_0x6409('0x58')](_0x4ee268['serverUrl']);var _0x59e9ed=util[_0x6409('0x50')]('%s/api/now/table/',_0x4ee268[_0x6409('0x57')]);_0x20aadc[_0x6409('0x16')]=!_[_0x6409('0x5a')](_0x2b057b)?_0x2b057b['email']:null;_0x20aadc[_0x6409('0x20')]=_0x4ee268['email'];_0x20aadc[_0x6409('0x25')]=_0x2e3a2f[_0x6409('0x32')]()===_0x6409('0x5b')?_0x3406cd[_0x6409('0x5c')]:_0x3406cd[_0x6409('0x5d')];_0x20aadc['callDirection']=_0x2e3a2f===_0x6409('0x5e')||_0x2e3a2f===_0x6409('0x5f')?'queue':'outbound';var _0x2479a9=util[_0x6409('0x50')](_0x6409('0x60'),_0x4ee268[_0x6409('0x59')],_0x3406cd[_0x6409('0x61')],md5(_0x3406cd['uniqueid']));if(_0x101049&&_0x101049[_0x6409('0x62')]){logger['info'](_0x6409('0x63'),_0x6409('0x64'));_0x3406cd[_0x6409('0x65')]=_0x2479a9;}else if(_0x4cc6a0&&_0x4cc6a0[_0x6409('0x66')]&&_0x4cc6a0[_0x6409('0x66')]!==_0x6409('0x67')){logger[_0x6409('0xf')](_0x6409('0x68'),_0x6409('0x64'));_0x3406cd[_0x6409('0x65')]=_0x2479a9;}else{_0x3406cd[_0x6409('0x65')]='';}return getAdminUser(_0x2e3a2f,_0x3d6d3f,_0x20aadc,_0x59e9ed,_0x5baa37,_0x351f4b)[_0x6409('0xa')](getUser(_0x2e3a2f,_0x3d6d3f,_0x59e9ed,_0x5baa37,_0x351f4b))[_0x6409('0xa')](getEndUser(_0x2e3a2f,_0x3d6d3f,_0x59e9ed,_0x5baa37,_0x351f4b))[_0x6409('0xa')](getTicket(_0x2e3a2f,_0x3d6d3f,_0x59e9ed,_0x3b44b2,_0x3406cd,_0x5baa37))[_0x6409('0xa')](function(_0x5459fc){logger[_0x6409('0xf')](util[_0x6409('0x50')](_0x6409('0x69'),_0x5459fc[_0x6409('0x45')]));logger['info'](util[_0x6409('0x50')](_0x6409('0x6a'),_0x2e3a2f));if(_0x2e3a2f!==_0x6409('0x5f')){logger['info']('['+[_0x2e3a2f[_0x6409('0x10')]()]+']',_0x6409('0x6b'));emit(_0x4ee268[_0x6409('0x57')],_0x2b057b[_0x6409('0x3b')],_0x5459fc[_0x6409('0x45')]);}})['catch'](function(_0x35c191){logger['error']('['+[_0x2e3a2f[_0x6409('0x10')]()]+_0x6409('0x6c'),util[_0x6409('0x6d')](_0x35c191,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4891=['recordingFormat','Recording\x20is\x20enabled!','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','socket.io-emitter','GET','result','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','length','active','true','userId','sys_id','adminId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','then','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','string','picklist','customField','nameField','toLowerCase','content','includes','type','idField','variableName','customVariable','Variable','name','toString',']\x20getTicket\x20input\x20crm','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','/nav_to.do?uri=incident.do?sys_id%3D','emit','trigger:browser:url','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL'];(function(_0x5de258,_0x3e1cce){var _0x5d0563=function(_0x2d5b59){while(--_0x2d5b59){_0x5de258['push'](_0x5de258['shift']());}};_0x5d0563(++_0x3e1cce);}(_0x4891,0x19a));var _0x1489=function(_0x12adca,_0x2d6e25){_0x12adca=_0x12adca-0x0;var _0x32aa2f=_0x4891[_0x12adca];return _0x32aa2f;};'use strict';var _=require('lodash');var Promise=require(_0x1489('0x0'));var rp=require('request-promise');var util=require(_0x1489('0x1'));var md5=require('md5');var Redis=require(_0x1489('0x2'));var intUtil=require(_0x1489('0x3'));var config=require(_0x1489('0x4'));var logger=require(_0x1489('0x5'))('servicenow');config[_0x1489('0x6')]=_['defaults'](config[_0x1489('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x1489('0x7'))(new Redis(config[_0x1489('0x6')]));function getAdminUser(_0x7c5e2d,_0x386b7e,_0xe6d719,_0x4839b9,_0x432fc6,_0x1f4b4e){return new Promise(function(_0x3e2b0e,_0x9f3572){var _0x16b89a={'method':_0x1489('0x8'),'uri':_0x4839b9+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x432fc6+'&'+_0x1f4b4e,'auth':_0x386b7e,'json':!![]};return rp(_0x16b89a)['then'](function(_0x404a91){if(_0x404a91[_0x1489('0x9')]['length']>0x0){_0xe6d719['adminId']=_0x404a91[_0x1489('0x9')][0x0]['sys_id'];}logger[_0x1489('0xa')]('['+[_0x7c5e2d[_0x1489('0xb')]()]+'],\x20getAdminUser\x20crm',_0xe6d719);_0x3e2b0e(_0xe6d719);})[_0x1489('0xc')](function(_0x5ea99e){logger[_0x1489('0xd')]('['+[_0x7c5e2d[_0x1489('0xb')]()]+']',_0x5ea99e[_0x1489('0xe')]);_0x9f3572(_0x5ea99e[_0x1489('0xe')]);});});}function getUser(_0x15e83b,_0x3f3348,_0x1afecb,_0x4ad572,_0x4dfd0b){return function(_0xe10c34){logger[_0x1489('0xa')]('['+[_0x15e83b[_0x1489('0xb')]()]+_0x1489('0xf'),_0xe10c34);return new Promise(function(_0x17383b,_0x42b1b6){if(intUtil[_0x1489('0x10')](_0xe10c34[_0x1489('0x11')])){var _0x5687ea={'method':'GET','uri':_0x1afecb+_0x1489('0x12')+_0xe10c34['userEmail']+'&'+_0x4ad572+'&'+_0x4dfd0b,'auth':_0x3f3348,'json':!![]};logger[_0x1489('0xa')]('['+[_0x15e83b[_0x1489('0xb')]()]+_0x1489('0x13'),_0x5687ea);return rp(_0x5687ea)['then'](function(_0x42c52f){logger[_0x1489('0xa')]('['+[_0x15e83b['toUpperCase']()]+'],\x20getUser\x20entity',_0x42c52f);if(_0x42c52f['result'][_0x1489('0x14')]>0x0&&String(_0x42c52f[_0x1489('0x9')][0x0][_0x1489('0x15')])===_0x1489('0x16')){_0xe10c34[_0x1489('0x17')]=_0x42c52f[_0x1489('0x9')][0x0][_0x1489('0x18')];}else{_0xe10c34['userId']=_0xe10c34[_0x1489('0x19')];_0xe10c34[_0x1489('0x11')]=_0xe10c34[_0x1489('0x1a')];}logger[_0x1489('0xa')]('['+[_0x15e83b[_0x1489('0xb')]()]+_0x1489('0x1b'),_0xe10c34);_0x17383b(_0xe10c34);})['catch'](function(_0x20cbe7){logger[_0x1489('0xd')]('['+[_0x15e83b[_0x1489('0xb')]()]+']',_0x20cbe7[_0x1489('0xe')]);_0x42b1b6(_0x20cbe7[_0x1489('0xe')]);});}else{logger[_0x1489('0xa')]('['+[_0x15e83b['toUpperCase']()]+_0x1489('0x1c'));_0xe10c34[_0x1489('0x17')]=_0xe10c34[_0x1489('0x19')];_0xe10c34[_0x1489('0x11')]=_0xe10c34[_0x1489('0x1a')];_0x17383b(_0xe10c34);}});};}function createEndUser(_0x199478,_0x43eff2,_0x15e7bf,_0x1238cf,_0x26a4d8){logger[_0x1489('0xa')]('['+[_0x199478[_0x1489('0xb')]()]+_0x1489('0x1d'),_0x15e7bf);return new Promise(function(_0x3b3e62,_0x2cccf5){var _0x227b1c={'method':_0x1489('0x1e'),'uri':_0x1238cf+_0x1489('0x1f')+_0x26a4d8,'body':{'user_name':_0x15e7bf[_0x1489('0x20')],'roles':_0x1489('0x21'),'first_name':_0x15e7bf[_0x1489('0x20')],'active':'true','date_format':'System','phone':_0x15e7bf['endUserNumber']},'auth':_0x43eff2,'json':!![]};return rp(_0x227b1c)[_0x1489('0x22')](function(_0x3c3f9e){logger[_0x1489('0xa')]('['+[_0x199478[_0x1489('0xb')]()]+'],\x20EndUser\x20schema',_0x3c3f9e[_0x1489('0x9')]);_0x15e7bf[_0x1489('0x23')]=_0x3c3f9e[_0x1489('0x9')][_0x1489('0x18')];_0x3b3e62(_0x15e7bf);})[_0x1489('0xc')](function(_0x2869c5){logger[_0x1489('0xd')]('['+[_0x199478['toUpperCase']()]+']',_0x2869c5[_0x1489('0xe')]);_0x2cccf5(_0x2869c5[_0x1489('0xe')]);});});}function getEndUser(_0x548c09,_0x1a10c7,_0x33c53c,_0x238ebf,_0x231f78){return function(_0x31763e){logger[_0x1489('0xa')]('['+[_0x548c09[_0x1489('0xb')]()]+'],\x20getEndUser\x20input\x20crm',_0x31763e);return new Promise(function(_0x5e2657,_0x5c37dd){var _0x2ec7eb={'method':_0x1489('0x8'),'uri':_0x33c53c+'sys_user?sysparm_query=phone%3D'+_0x31763e[_0x1489('0x20')]+'&'+_0x238ebf+'&'+_0x231f78,'auth':_0x1a10c7,'json':!![]};return rp(_0x2ec7eb)[_0x1489('0x22')](function(_0x492c13){if(_0x492c13[_0x1489('0x9')][_0x1489('0x14')]>0x0){_0x31763e[_0x1489('0x23')]=_0x492c13[_0x1489('0x9')][0x0][_0x1489('0x18')];logger['info']('['+[_0x548c09[_0x1489('0xb')]()]+_0x1489('0x24'),_0x31763e);_0x5e2657(_0x31763e);}else{return createEndUser(_0x548c09,_0x1a10c7,_0x31763e,_0x33c53c,_0x238ebf)['then'](function(_0x559c8c){logger[_0x1489('0xa')]('['+[_0x548c09[_0x1489('0xb')]()]+_0x1489('0x25'),_0x559c8c);_0x5e2657(_0x559c8c);});}})[_0x1489('0xc')](function(_0x3cd353){logger[_0x1489('0xd')]('['+[_0x548c09[_0x1489('0xb')]()]+']',_0x3cd353[_0x1489('0xe')]);_0x5c37dd(_0x3cd353[_0x1489('0xe')]);});});};}function getCustomFields(_0x3081b8,_0x2ff577){var _0x954a30={};if(_0x3081b8[_0x1489('0x14')]>0x0){_['forEach'](_0x3081b8,function(_0x12a23d){if(_['includes']([_0x1489('0x26'),_0x1489('0x27')],_0x12a23d['type'])&&_0x12a23d['nameField']&&!_0x12a23d[_0x1489('0x28')]){_0x954a30[_0x12a23d[_0x1489('0x29')][_0x1489('0x2a')]()]=_0x12a23d[_0x1489('0x2b')]['toString']();}else if(_[_0x1489('0x2c')]([_0x1489('0x26'),_0x1489('0x27')],_0x12a23d[_0x1489('0x2d')])&&_0x12a23d[_0x1489('0x2e')]&&_0x12a23d['customField']){_0x954a30[_0x12a23d[_0x1489('0x2e')][_0x1489('0x2a')]()]=_0x12a23d[_0x1489('0x2b')]['toString']();}else if(_0x12a23d[_0x1489('0x2d')]==='variable'&&_0x12a23d[_0x1489('0x2f')]&&_0x12a23d[_0x1489('0x2e')]&&_0x12a23d[_0x1489('0x28')]){_0x954a30[_0x12a23d['idField'][_0x1489('0x2a')]()]=_0x2ff577[_0x12a23d['variableName']]['toString']();}else if(_0x12a23d[_0x1489('0x2d')]===_0x1489('0x30')&&_0x12a23d[_0x1489('0x31')]&&_0x12a23d[_0x1489('0x31')][_0x1489('0x32')]&&_0x12a23d['idField']&&_0x12a23d[_0x1489('0x28')]){_0x954a30[_0x12a23d[_0x1489('0x2e')][_0x1489('0x2a')]()]=_0x2ff577[_0x12a23d[_0x1489('0x31')][_0x1489('0x32')][_0x1489('0x2a')]()][_0x1489('0x33')]();}});}return _0x954a30;}function getTicket(_0x429443,_0x2020a0,_0xa3a99e,_0x24ef38,_0x39c4e2,_0x451ebb){return function(_0x1d2e88){logger['info']('['+[_0x429443['toUpperCase']()]+_0x1489('0x34'),_0x1d2e88);return new Promise(function(_0x1943c5,_0x28331a){var _0x4658a4=_0x429443['toLowerCase']()==='outbound'?_0x1d2e88[_0x1489('0x17')]:_0x1d2e88['endUserId'];var _0x5452ca={'method':'POST','uri':_0xa3a99e+_0x1489('0x35')+'?'+_0x451ebb,'body':Object[_0x1489('0x36')]({},{'active':'true','caller_id':_0x4658a4,'assigned_to':_0x1d2e88[_0x1489('0x17')],'short_description':intUtil[_0x1489('0x37')](_0x24ef38[_0x1489('0x38')],_0x39c4e2,'\x20'),'description':intUtil[_0x1489('0x37')](_0x24ef38[_0x1489('0x39')],_0x39c4e2,'\x0a')},getCustomFields(_0x24ef38['Fields'],_0x39c4e2)),'auth':_0x2020a0,'json':!![]};return rp(_0x5452ca)['then'](function(_0x3415e1){logger[_0x1489('0xa')]('['+[_0x429443[_0x1489('0xb')]()]+_0x1489('0x3a'),_0x3415e1['result']);_0x1d2e88[_0x1489('0x3b')]=_0x3415e1['result'][_0x1489('0x18')];_0x1d2e88[_0x1489('0x3c')]=_0x3415e1[_0x1489('0x9')][_0x1489('0x3d')];logger[_0x1489('0xa')]('['+[_0x429443[_0x1489('0xb')]()]+']\x20getTicket\x20crm',_0x1d2e88);_0x1943c5(_0x1d2e88);})[_0x1489('0xc')](function(_0x4039f2){logger[_0x1489('0xd')]('['+[_0x429443['toUpperCase']()]+']',_0x4039f2[_0x1489('0xe')]);_0x28331a(_0x4039f2['message']);});});};}function createRemoteTag(_0x9aa3d4,_0x1f4d56,_0x26bb7f,_0x2589e1){return new Promise(function(_0x17269f,_0x2afe73){var _0x2e02b1={'method':_0x1489('0x1e'),'uri':_0x26bb7f+_0x1489('0x3e')+'?'+_0x2589e1,'body':{'short_description':_0x9aa3d4,'global':!![],'active':!![],'name':_0x9aa3d4},'auth':_0x1f4d56,'json':!![]};return rp(_0x2e02b1)[_0x1489('0x22')](function(_0x1f6257){var _0x56f452=_0x1f6257['result'][_0x1489('0x18')];_0x17269f(_0x56f452);});});}function getRemoteTag(_0x1e3879,_0x1c2296,_0x26c524,_0x52d5ad,_0x2d9e36){return new Promise(function(_0x5ea784,_0x411c6f){var _0x1e3645={'method':_0x1489('0x8'),'uri':_0x26c524+_0x1489('0x3e')+_0x1489('0x3f')+_0x1e3879+'&'+_0x52d5ad,'auth':_0x1c2296,'json':!![]};return rp(_0x1e3645)[_0x1489('0x22')](function(_0x4ee78b){if(_0x4ee78b[_0x1489('0x9')][_0x1489('0x14')]>0x0){var _0x361dc5=_0x4ee78b['result'][0x0][_0x1489('0x18')];_0x5ea784(_0x361dc5);}else{return createRemoteTag(_0x1e3879,_0x1c2296,_0x26c524,_0x52d5ad)[_0x1489('0x22')](function(_0x149a82){_0x5ea784(_0x149a82);});}});});}function assignTagToIncident(_0x35cadb,_0x541812,_0x1d442d,_0x282cef,_0x5e4dab){return new Promise(function(_0x798489,_0x4e319c){var _0x4785e8={'method':'POST','uri':_0x1d442d+'label_entry'+'?'+_0x5e4dab,'body':{'label':_0x35cadb,'table':_0x1489('0x35'),'id_type':_0x1489('0x40'),'table_key':_0x282cef[_0x1489('0x3b')],'title':_0x1489('0x41')+_0x282cef[_0x1489('0x3c')],'id_display':_0x282cef[_0x1489('0x3c')]},'auth':_0x541812,'json':!![]};return rp(_0x4785e8)[_0x1489('0x22')](function(_0x5e7351){_0x798489();})[_0x1489('0xc')](function(){_0x798489();});});}function manageTags(_0x377c1d,_0x5861d0,_0x49cb2d,_0x47ab32,_0x55d2a6,_0x3b0543,_0x5954d1){return new Promise(function(_0x5163cc,_0xfee195){var _0x35e2e7=[];_0x5861d0[_0x1489('0x42')](function(_0x4c4f92){_0x35e2e7[_0x1489('0x43')](getRemoteTag(_0x4c4f92,_0x49cb2d,_0x47ab32,_0x3b0543,_0x5954d1));});return Promise[_0x1489('0x44')](_0x35e2e7)[_0x1489('0x22')](function(_0x49eff6){if(_0x49eff6[_0x1489('0x14')]){logger[_0x1489('0xa')]('['+[_0x377c1d[_0x1489('0xb')]()]+_0x1489('0x45'),_0x49eff6);var _0x5acba8=[];_0x49eff6[_0x1489('0x42')](function(_0x391e8a){_0x5acba8[_0x1489('0x43')](assignTagToIncident(_0x391e8a,_0x49cb2d,_0x47ab32,_0x55d2a6,_0x3b0543));});return Promise[_0x1489('0x44')](_0x5acba8)[_0x1489('0x22')](function(){_0x5163cc();})['catch'](function(){_0x5163cc();});}else{_0x5163cc();}});});}function getTags(_0x2880db,_0x1b524d,_0x2cc238,_0x3d3bc1,_0x4991ad,_0x49f0c4){return function(_0x121210){return new Promise(function(_0x41a19a,_0x777be0){var _0x4b51da=[];var _0x56dc5f=_0x3d3bc1[_0x1489('0x46')];if(_0x56dc5f&&_0x56dc5f[_0x1489('0x14')]>0x0){_0x4b51da=_[_0x1489('0x47')](_0x56dc5f,_0x1489('0x32'));}if(_0x4b51da['length']>0x0){return manageTags(_0x2880db,_0x4b51da,_0x1b524d,_0x2cc238,_0x121210,_0x4991ad,_0x49f0c4)[_0x1489('0x22')](function(){_0x41a19a(_0x121210);});}else{_0x41a19a(_0x121210);}});};}function emit(_0x190bdb,_0x5af42c,_0x47b596){var _0x369171='%26sysparm_record_target%3Dincident'+_0x1489('0x48')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x48ae4d={'uri':_0x190bdb+_0x1489('0x49')+_0x47b596+_0x369171};io['to'](util['format']('user:%s',_0x5af42c))[_0x1489('0x4a')](_0x1489('0x4b'),_0x48ae4d);}exports['cs']=function(_0x16aff4,_0x9accb5,_0x41e192,_0x255265,_0x25b324,_0xcb704b,_0x4d30b1,_0x457a61){var _0x4d1ff7={};var _0x2c25d5={'user':_0xcb704b['username'],'pass':_0xcb704b['password']};var _0x34c4fa=_0x1489('0x4c');var _0x4d7f93=_0x1489('0x4d');_0xcb704b[_0x1489('0x4e')]=intUtil[_0x1489('0x4f')](_0xcb704b[_0x1489('0x4e')]);_0xcb704b[_0x1489('0x50')]=intUtil['stripTrailingSlash'](_0xcb704b['serverUrl']);var _0x10caf6=util[_0x1489('0x51')](_0x1489('0x52'),_0xcb704b[_0x1489('0x4e')]);_0x4d1ff7[_0x1489('0x11')]=!_['isNil'](_0x255265)?_0x255265['email']:null;_0x4d1ff7[_0x1489('0x1a')]=_0xcb704b[_0x1489('0x53')];_0x4d1ff7[_0x1489('0x20')]=_0x457a61[_0x1489('0x2a')]()==='outbound'?_0x9accb5[_0x1489('0x54')]:_0x9accb5[_0x1489('0x55')];_0x4d1ff7[_0x1489('0x56')]=_0x457a61===_0x1489('0x57')||_0x457a61===_0x1489('0x58')?'queue':_0x1489('0x59');var _0x414f89=util[_0x1489('0x51')](_0x1489('0x5a'),_0xcb704b[_0x1489('0x50')],_0x9accb5[_0x1489('0x5b')],md5(_0x9accb5[_0x1489('0x5b')]));if(_0x25b324&&_0x25b324[_0x1489('0x5c')]){logger[_0x1489('0xa')](_0x1489('0x5d'),'Recording\x20is\x20enabled!');_0x9accb5[_0x1489('0x5e')]=_0x414f89;}else if(_0x4d30b1&&_0x4d30b1[_0x1489('0x5f')]&&_0x4d30b1['recordingFormat']!=='none'){logger['info']('[OUTBOUND]',_0x1489('0x60'));_0x9accb5[_0x1489('0x5e')]=_0x414f89;}else{_0x9accb5[_0x1489('0x5e')]='';}return getAdminUser(_0x457a61,_0x2c25d5,_0x4d1ff7,_0x10caf6,_0x4d7f93,_0x34c4fa)[_0x1489('0x22')](getUser(_0x457a61,_0x2c25d5,_0x10caf6,_0x4d7f93,_0x34c4fa))[_0x1489('0x22')](getEndUser(_0x457a61,_0x2c25d5,_0x10caf6,_0x4d7f93,_0x34c4fa))['then'](getTicket(_0x457a61,_0x2c25d5,_0x10caf6,_0x41e192,_0x9accb5,_0x4d7f93))['then'](function(_0xac78be){logger[_0x1489('0xa')](util[_0x1489('0x51')]('The\x20ticket\x20ID\x20is:\x20%s',_0xac78be[_0x1489('0x3b')]));logger[_0x1489('0xa')](util[_0x1489('0x51')](_0x1489('0x61'),_0x457a61));if(_0x457a61!==_0x1489('0x58')){logger[_0x1489('0xa')]('['+[_0x457a61[_0x1489('0xb')]()]+']',_0x1489('0x62'));emit(_0xcb704b[_0x1489('0x4e')],_0x255265[_0x1489('0x32')],_0xac78be['ticketId']);}})[_0x1489('0xc')](function(_0x5c5d9c){logger[_0x1489('0xd')]('['+[_0x457a61[_0x1489('0xb')]()]+_0x1489('0x63'),util[_0x1489('0x64')](_0x5c5d9c,{'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 c561743..3f08fbb 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 _0x24ae=['Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','Outbound','The\x20Ticket\x20ID\x20is:','version','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','unmanaged','lastevent','calleridnum','Inbound','Ticket\x20created!','toUpperCase','lodash','request-promise','bluebird','md5','./util','../../../../config/environment','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','direction','length','forEach','push','idField','set_entry','stringify','Calls','Basic\x20%s','apiKey','get_server_info','JSON','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','user_name','then','find','entry_list','name_value_list','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','Enduser\x20found!','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','map','string','nameField','customField','toString','type','content','variable','variableName','customVariable','Variable','toLowerCase','custom_fields','POST','login','password','xCALLY\x20Motion\x20integration','sessionID','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]'];(function(_0x37dd47,_0x240fa5){var _0x529d56=function(_0x5b7649){while(--_0x5b7649){_0x37dd47['push'](_0x37dd47['shift']());}};_0x529d56(++_0x240fa5);}(_0x24ae,0x9a));var _0xe24a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x24ae[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xe24a('0x0'));var rp=require(_0xe24a('0x1'));var BPromise=require(_0xe24a('0x2'));var md5=require(_0xe24a('0x3'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xe24a('0x4'));var config=require(_0xe24a('0x5'));var logger=require('../../../../config/logger')('sugarcrm');config['redis']=_[_0xe24a('0x6')](config['redis'],{'host':_0xe24a('0x7'),'port':0x18eb});var io=require(_0xe24a('0x8'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0xfc8857,_0x167058,_0x791f00){io['to'](_0xfc8857)[_0xe24a('0x9')](_0x167058,_0x791f00);}function getTicket(_0x4dc1e2,_0x470b16,_0x57a712,_0xf002f6,_0x4a2d88,_0xd88dd0,_0x1a3a54,_0x3fd849){logger[_0xe24a('0xa')](_0xe24a('0xb'));var _0x50017b=new Date();var _0x54f259=[{'name':_0xe24a('0xc'),'value':intUtil[_0xe24a('0xd')](_0xf002f6[_0xe24a('0xe')],_0x4a2d88,'\x20')},{'name':_0xe24a('0xf'),'value':_0x470b16['id']},{'name':_0xe24a('0x10'),'value':_0x470b16['id']},{'name':_0xe24a('0x11'),'value':intUtil['getString'](_0xf002f6[_0xe24a('0x12')],_0x4a2d88,'\x0a')},{'name':_0xe24a('0x13'),'value':_0x50017b['toISOString']()['slice'](0x0,0x13)[_0xe24a('0x14')]('T','\x20')},{'name':_0xe24a('0x15'),'value':'0'},{'name':_0xe24a('0x16'),'value':'15'},{'name':_0xe24a('0x17'),'value':_0x57a712['id']},{'name':_0xe24a('0x18'),'value':_0xe24a('0x19')},{'name':'parent_name','value':_0x57a712[_0xe24a('0xc')]},{'name':_0xe24a('0x1a'),'value':_0x3fd849}];if(_0xd88dd0[_0xe24a('0x1b')]){_[_0xe24a('0x1c')](_0xd88dd0,function(_0x2254c7){if(_0x4a2d88[_0x2254c7['variableName']]){_0x54f259[_0xe24a('0x1d')]({'name':_0x2254c7[_0xe24a('0x1e')],'value':_0x4a2d88[_0x2254c7['variableName']]});}});}return request({'form':{'method':_0xe24a('0x1f'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xe24a('0x20')]({'session':_0x1a3a54['id'],'module_name':_0xe24a('0x21'),'name_value_list':_0x54f259})}});}function getAuth(_0x322012){return util['format'](_0xe24a('0x22'),new Buffer(_0x322012[_0xe24a('0x23')]+':X')['toString']('base64'));}function getServerInfo(_0x4aca46){return request({'form':{'method':_0xe24a('0x24'),'input_type':_0xe24a('0x25'),'response_type':_0xe24a('0x25'),'rest_data':JSON[_0xe24a('0x20')]({'session':_0x4aca46['id']})}});}function getUser(_0x349a7a,_0x65ad17,_0x224885){if(!_[_0xe24a('0x26')](_0x65ad17)){logger[_0xe24a('0xa')](_0xe24a('0x27'),_0x65ad17);return request({'form':{'method':_0xe24a('0x28'),'input_type':_0xe24a('0x25'),'response_type':_0xe24a('0x25'),'rest_data':JSON[_0xe24a('0x20')]({'session':_0x224885['id'],'module_name':_0xe24a('0x29'),'query':util[_0xe24a('0x2a')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x65ad17),'order_by':'','offset':'0','select_fields':['id','name',_0xe24a('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe24a('0x2c')](function(_0x5b022){if(_0x5b022['entry_list']['length']){var _0x3bff62=_[_0xe24a('0x2d')](_0x5b022[_0xe24a('0x2e')],function(_0x155084){return _0x155084[_0xe24a('0x2f')][_0xe24a('0x2b')][_0xe24a('0x30')]===_0x65ad17;});if(_0x3bff62){logger['info'](_0xe24a('0x31'));return BPromise[_0xe24a('0x32')]({'id':_0x3bff62[_0xe24a('0x2f')]['id'][_0xe24a('0x30')],'name':_0x3bff62['name_value_list'][_0xe24a('0xc')]['value']});}}logger[_0xe24a('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xe24a('0x32')]({'id':_0x224885[_0xe24a('0x2f')][_0xe24a('0x33')][_0xe24a('0x30')],'name':_0x224885[_0xe24a('0x2f')][_0xe24a('0x2b')]['value']});});}else{logger['info'](_0xe24a('0x34'));return BPromise['resolve']({'id':_0x224885[_0xe24a('0x2f')][_0xe24a('0x33')][_0xe24a('0x30')],'name':_0x224885[_0xe24a('0x2f')]['user_name'][_0xe24a('0x30')]});}}function getEndUser(_0x5c43c4,_0x366947,_0x36ff52,_0x54dfd4){logger[_0xe24a('0xa')](_0xe24a('0x35'),_0x36ff52);return request({'form':{'method':'get_entry_list','input_type':_0xe24a('0x25'),'response_type':_0xe24a('0x25'),'rest_data':JSON['stringify']({'session':_0x54dfd4['id'],'module_name':_0xe24a('0x19'),'query':util['format'](_0xe24a('0x36'),_0x36ff52),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe24a('0x2c')](function(_0x117325){if(_0x117325[_0xe24a('0x2e')][_0xe24a('0x1b')]){var _0x8ce1e8=_[_0xe24a('0x2d')](_0x117325[_0xe24a('0x2e')],function(_0x9aac36){return _0x9aac36['name_value_list']['phone_home'][_0xe24a('0x30')]===_0x36ff52;});if(_0x8ce1e8){logger['info'](_0xe24a('0x37'));return BPromise[_0xe24a('0x32')]({'id':_0x8ce1e8['name_value_list']['id'][_0xe24a('0x30')],'name':_0x8ce1e8[_0xe24a('0x2f')][_0xe24a('0xc')][_0xe24a('0x30')],'phone':_0x8ce1e8[_0xe24a('0x2f')][_0xe24a('0x38')][_0xe24a('0x30')]});}}else{logger[_0xe24a('0xa')](_0xe24a('0x39'));return request({'form':{'method':_0xe24a('0x1f'),'input_type':_0xe24a('0x25'),'response_type':_0xe24a('0x25'),'rest_data':JSON[_0xe24a('0x20')]({'session':_0x54dfd4['id'],'module_name':_0xe24a('0x19'),'name_value_list':[{'name':_0xe24a('0x3a'),'value':_0x366947!==''?_0x366947:util[_0xe24a('0x2a')](_0xe24a('0x3b'),_0x36ff52)},{'name':_0xe24a('0x38'),'value':_0x36ff52}]})}})['then'](function(_0x1299d6){logger['info'](_0xe24a('0x3c'));return BPromise[_0xe24a('0x32')]({'id':_0x1299d6['id'],'name':_0x1299d6[_0xe24a('0x2e')][_0xe24a('0x3a')][_0xe24a('0x30')],'phone':_0x1299d6[_0xe24a('0x2e')][_0xe24a('0x38')]['value']});});}});}function request(_0x43c51a){logger[_0xe24a('0x3d')]('[HTTP]',JSON[_0xe24a('0x20')](_0x43c51a));return rp(_['merge'](def,_0x43c51a));}function getTags(_0x511fc5,_0xbf9570){var _0x3f033e=[];if(_0x511fc5&&_0x511fc5[_0xe24a('0x1b')]>0x0){_0x3f033e=_[_0xe24a('0x3e')](_0x511fc5,_0xbf9570);}return _0x3f033e;}function getCustomFields(_0x3787bf,_0x247d07){var _0x340022=[];var _0x4b2dff={'custom_fields':[]};if(_0x3787bf[_0xe24a('0x1b')]>0x0){_[_0xe24a('0x1c')](_0x3787bf,function(_0x1e5ebd){if(_0x1e5ebd['type']===_0xe24a('0x3f')&&_0x1e5ebd[_0xe24a('0x40')]&&!_0x1e5ebd[_0xe24a('0x41')]){_0x4b2dff[_0x1e5ebd[_0xe24a('0x40')]['toLowerCase']()]=_0x1e5ebd['content'][_0xe24a('0x42')]();}else if(_0x1e5ebd[_0xe24a('0x43')]===_0xe24a('0x3f')&&_0x1e5ebd[_0xe24a('0x1e')]&&_0x1e5ebd[_0xe24a('0x41')]){_0x4b2dff['custom_fields']['push']({'id':_0x1e5ebd[_0xe24a('0x1e')],'value':_0x1e5ebd[_0xe24a('0x44')]['toString']()});}else if(_0x1e5ebd[_0xe24a('0x43')]===_0xe24a('0x45')&&_0x1e5ebd[_0xe24a('0x46')]&&_0x1e5ebd[_0xe24a('0x1e')]&&_0x1e5ebd[_0xe24a('0x41')]){_0x247d07[_0x1e5ebd[_0xe24a('0x46')]]&&_0x4b2dff['custom_fields'][_0xe24a('0x1d')]({'id':_0x1e5ebd[_0xe24a('0x1e')],'value':_0x247d07[_0x1e5ebd[_0xe24a('0x46')]][_0xe24a('0x42')]()});}else if(_0x1e5ebd['type']===_0xe24a('0x47')&&_0x1e5ebd[_0xe24a('0x48')]&&_0x1e5ebd[_0xe24a('0x48')]['name']&&_0x1e5ebd['idField']&&_0x1e5ebd['customField']){_0x247d07[_0x1e5ebd[_0xe24a('0x48')]['name'][_0xe24a('0x49')]()]&&_0x4b2dff[_0xe24a('0x4a')][_0xe24a('0x1d')]({'id':_0x1e5ebd[_0xe24a('0x1e')],'value':_0x247d07[_0x1e5ebd['Variable']['name'][_0xe24a('0x49')]()]['toString']()});}});}return _0x4b2dff;}function getConnection(_0xd12c63){return request({'method':_0xe24a('0x4b'),'form':{'method':_0xe24a('0x4c'),'input_type':_0xe24a('0x25'),'response_type':_0xe24a('0x25'),'rest_data':JSON[_0xe24a('0x20')]({'user_auth':{'user_name':_0xd12c63['username'],'password':_0xd12c63[_0xe24a('0x4d')],'encryption':'PLAIN'},'application':_0xe24a('0x4e')})}})['then'](function(_0x3ef9ed){var _0x3dbd60=_0x3ef9ed;if(_0x3dbd60['id']){def[_0xe24a('0x4f')]=_0x3dbd60['id'];return BPromise[_0xe24a('0x32')](_0x3dbd60);}else{throw new Error(util[_0xe24a('0x2a')]('Account\x20%d\x20is\x20not\x20valid',_0xd12c63['id']));}});}function setRelationship(_0x162f12,_0x63fb18,_0x40829f,_0x1a0db3){return request({'form':{'method':'set_relationship','input_type':_0xe24a('0x25'),'response_type':_0xe24a('0x25'),'rest_data':JSON[_0xe24a('0x20')]({'session':_0x162f12['id'],'module_name':_0xe24a('0x21'),'module_id':_0x40829f['id'],'link_field_name':_0x1a0db3,'related_ids':[_0x63fb18['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x577f9f,_0x460d27,_0x3c3f0b,_0x55c4aa,_0x1eee3c,_0xcaf2ee){var _0x159888,_0x6d74d9,_0x208daf,_0x3d8060;_0xcaf2ee['remoteUri']=intUtil['stripTrailingSlash'](_0xcaf2ee[_0xe24a('0x50')]);_0xcaf2ee[_0xe24a('0x51')]=intUtil['stripTrailingSlash'](_0xcaf2ee[_0xe24a('0x51')]);def[_0xe24a('0x52')]=util[_0xe24a('0x2a')](_0xe24a('0x53'),_0xcaf2ee['remoteUri']);if(_0x1eee3c&&_0x1eee3c[_0xe24a('0x54')]){logger[_0xe24a('0xa')](_0xe24a('0x55'),_0xe24a('0x56'));_0x460d27[_0xe24a('0x57')]=util[_0xe24a('0x2a')](_0xe24a('0x58'),_0xcaf2ee['serverUrl'],_0x460d27['uniqueid'],md5(_0x460d27[_0xe24a('0x59')]));}else{_0x460d27['recordingURL']='';}return getConnection(_0xcaf2ee)[_0xe24a('0x2c')](function(_0x54d05c){_0x3d8060=_0x54d05c;return getUser(_0xcaf2ee,_0x55c4aa[_0xe24a('0xc')],_0x3d8060);})[_0xe24a('0x2c')](function(_0x442962){_0x159888=_0x442962;logger[_0xe24a('0xa')](_0xe24a('0x5a'),_0x159888['id']);return getEndUser(_0xcaf2ee,_0x460d27[_0xe24a('0x5b')],_0x460d27['calleridnum'],_0x3d8060);})[_0xe24a('0x2c')](function(_0x1d431e){_0x6d74d9=_0x1d431e;logger[_0xe24a('0xa')](_0xe24a('0x5c'),_0x6d74d9['id']);return getTicket(_0xcaf2ee,_0x159888,_0x6d74d9,_0x3c3f0b,_0x460d27,_0x3c3f0b['Fields'],_0x3d8060,'Inbound');})['then'](function(_0x54b0f1){_0x208daf=_0x54b0f1;logger[_0xe24a('0xa')]('Ticket\x20created!');logger[_0xe24a('0xa')]('The\x20Ticket\x20ID\x20is:',_0x208daf['id']);return setRelationship(_0x3d8060,_0x159888,_0x208daf,_0xe24a('0x5d'));})[_0xe24a('0x2c')](function(){return setRelationship(_0x3d8060,_0x6d74d9,_0x208daf,_0xe24a('0x5e'));})[_0xe24a('0x2c')](function(){return getServerInfo(_0x3d8060);})[_0xe24a('0x2c')](function(_0x4419c8){var _0xeb6b1c=parseInt(_0x4419c8['version'][_0xe24a('0x5f')](0x0));var _0x145203=util[_0xe24a('0x2a')](_0xe24a('0x60'),_0xcaf2ee['remoteUri'],_0x208daf['id']);if(_0xeb6b1c>0x6){_0x145203=util[_0xe24a('0x2a')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0xcaf2ee[_0xe24a('0x50')],_0x208daf['id']);}logger[_0xe24a('0xa')](_0xe24a('0x55'),_0xe24a('0x61'));emit(util[_0xe24a('0x2a')]('user:%s',_0x55c4aa[_0xe24a('0xc')]),_0xe24a('0x62'),{'uri':_0x145203});})[_0xe24a('0x63')](function(_0x31949b){logger[_0xe24a('0x64')](_0xe24a('0x55'),JSON[_0xe24a('0x20')](_0x31949b));});};exports[_0xe24a('0x65')]=function(_0x34b50f,_0x4b00ca,_0x28a60b,_0x3fdd38,_0x2088c7,_0x249cc4,_0x1ae41d){var _0x3346e5,_0x221d51,_0x56b68a,_0x14381d;_0x249cc4['remoteUri']=intUtil[_0xe24a('0x66')](_0x249cc4['remoteUri']);_0x249cc4[_0xe24a('0x51')]=intUtil['stripTrailingSlash'](_0x249cc4[_0xe24a('0x51')]);def[_0xe24a('0x52')]=util[_0xe24a('0x2a')](_0xe24a('0x53'),_0x249cc4[_0xe24a('0x50')]);if(_0x1ae41d&&_0x1ae41d[_0xe24a('0x67')]&&_0x1ae41d[_0xe24a('0x67')]!==_0xe24a('0x68')){logger['info'](_0xe24a('0x69'),'Recording\x20is\x20enabled!');_0x4b00ca['recordingURL']=util['format'](_0xe24a('0x58'),_0x249cc4['serverUrl'],_0x4b00ca[_0xe24a('0x59')],md5(_0x4b00ca[_0xe24a('0x59')]));}return getConnection(_0x249cc4)['then'](function(_0x5db2ca){_0x14381d=_0x5db2ca;return getUser(_0x249cc4,_0x3fdd38[_0xe24a('0xc')],_0x14381d);})[_0xe24a('0x2c')](function(_0xfa71e1){_0x3346e5=_0xfa71e1;logger[_0xe24a('0xa')](_0xe24a('0x5a'),_0x3346e5['id']);return getEndUser(_0x249cc4,_0x4b00ca[_0xe24a('0x6a')],_0x4b00ca[_0xe24a('0x6b')],_0x14381d);})[_0xe24a('0x2c')](function(_0x33bcf6){_0x221d51=_0x33bcf6;logger[_0xe24a('0xa')]('The\x20Enduser\x20ID\x20is:',_0x221d51['id']);return getTicket(_0x249cc4,_0x3346e5,_0x221d51,_0x28a60b,_0x4b00ca,_0x28a60b[_0xe24a('0x6c')],_0x14381d,_0xe24a('0x6d'));})[_0xe24a('0x2c')](function(_0x17257d){_0x56b68a=_0x17257d;logger[_0xe24a('0xa')]('Ticket\x20created!');logger[_0xe24a('0xa')](_0xe24a('0x6e'),_0x56b68a['id']);return setRelationship(_0x14381d,_0x3346e5,_0x56b68a,_0xe24a('0x5d'));})['then'](function(){return setRelationship(_0x14381d,_0x221d51,_0x56b68a,_0xe24a('0x5e'));})[_0xe24a('0x2c')](function(){return getServerInfo(_0x14381d);})[_0xe24a('0x2c')](function(_0x13b6aa){var _0x4330ac=parseInt(_0x13b6aa[_0xe24a('0x6f')]['charAt'](0x0));var _0x187ada=util[_0xe24a('0x2a')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x249cc4['remoteUri'],_0x56b68a['id']);if(_0x4330ac>0x6){_0x187ada=util['format'](_0xe24a('0x70'),_0x249cc4[_0xe24a('0x50')],_0x56b68a['id']);}logger['info'](_0xe24a('0x69'),_0xe24a('0x61'));emit(util[_0xe24a('0x2a')](_0xe24a('0x71'),_0x3fdd38[_0xe24a('0xc')]),_0xe24a('0x62'),{'uri':_0x187ada});})['catch'](function(_0x335f1e){logger[_0xe24a('0x64')](_0xe24a('0x69'),JSON['stringify'](_0x335f1e));});};exports[_0xe24a('0x72')]=function(_0x58da5b,_0x5e35ee,_0x5acb27,_0x5e722c,_0x3b16e4,_0x3cda64){var _0x4d1bfe,_0x5587fc,_0x2a5e79,_0x3b7751;_0x3cda64['remoteUri']=intUtil[_0xe24a('0x66')](_0x3cda64[_0xe24a('0x50')]);_0x3cda64[_0xe24a('0x51')]=intUtil[_0xe24a('0x66')](_0x3cda64[_0xe24a('0x51')]);def['uri']=util[_0xe24a('0x2a')](_0xe24a('0x53'),_0x3cda64[_0xe24a('0x50')]);if(_0x3b16e4&&_0x3b16e4['monitor_format']){logger[_0xe24a('0xa')]('['+_0x5e35ee[_0xe24a('0x73')]['toUpperCase']()+']',_0xe24a('0x56'));_0x5e35ee['recordingURL']=util[_0xe24a('0x2a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3cda64[_0xe24a('0x51')],_0x5e35ee['uniqueid'],md5(_0x5e35ee[_0xe24a('0x59')]));}else{_0x5e35ee[_0xe24a('0x57')]='';}return getConnection(_0x3cda64)[_0xe24a('0x2c')](function(_0x5dec2f){_0x3b7751=_0x5dec2f;if(!_[_0xe24a('0x26')](_0x5e722c)){return getUser(_0x3cda64,_0x5e722c['name'],_0x3b7751);}else{return getUser(_0x3cda64,null,_0x3b7751);}})[_0xe24a('0x2c')](function(_0x4859fb){_0x4d1bfe=_0x4859fb;logger[_0xe24a('0xa')](_0xe24a('0x5a'),_0x4d1bfe['id']);return getEndUser(_0x3cda64,_0x5e35ee[_0xe24a('0x5b')],_0x5e35ee[_0xe24a('0x74')],_0x3b7751);})[_0xe24a('0x2c')](function(_0x54b13e){_0x5587fc=_0x54b13e;logger['info']('The\x20Enduser\x20ID\x20is:',_0x5587fc['id']);return getTicket(_0x3cda64,_0x4d1bfe,_0x5587fc,_0x5acb27,_0x5e35ee,_0x5acb27[_0xe24a('0x6c')],_0x3b7751,_0xe24a('0x75'));})[_0xe24a('0x2c')](function(_0x2a36ea){_0x2a5e79=_0x2a36ea;logger[_0xe24a('0xa')](_0xe24a('0x76'));logger[_0xe24a('0xa')]('The\x20Ticket\x20ID\x20is:',_0x2a5e79['id']);return setRelationship(_0x3b7751,_0x4d1bfe,_0x2a5e79,'users');})[_0xe24a('0x2c')](function(){return setRelationship(_0x3b7751,_0x5587fc,_0x2a5e79,_0xe24a('0x5e'));})['then'](function(){return getServerInfo(_0x3b7751);})[_0xe24a('0x63')](function(_0x25c9ab){logger[_0xe24a('0x64')]('['+_0x5e35ee[_0xe24a('0x73')][_0xe24a('0x77')]()+']',JSON[_0xe24a('0x20')](_0x25c9ab));});}; \ No newline at end of file +var _0x4d29=['%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','users','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','error','unmanaged','uri','lastevent','toUpperCase','request-promise','bluebird','util','ioredis','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','getString','Subjects','created_by','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','direction','length','push','idField','set_entry','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','JSON','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','name_value_list','user_name','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','map','forEach','string','nameField','customField','content','custom_fields','type','variableName','Variable','toLowerCase','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch'];(function(_0xbac4ac,_0x11ea3c){var _0x4e0402=function(_0xf7a49e){while(--_0xf7a49e){_0xbac4ac['push'](_0xbac4ac['shift']());}};_0x4e0402(++_0x11ea3c);}(_0x4d29,0x16e));var _0x94d2=function(_0x387532,_0x87443a){_0x387532=_0x387532-0x0;var _0x52923f=_0x4d29[_0x387532];return _0x52923f;};'use strict';var _=require('lodash');var rp=require(_0x94d2('0x0'));var BPromise=require(_0x94d2('0x1'));var md5=require('md5');var util=require(_0x94d2('0x2'));var Redis=require(_0x94d2('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x94d2('0x4'))(_0x94d2('0x5'));config[_0x94d2('0x6')]=_[_0x94d2('0x7')](config['redis'],{'host':_0x94d2('0x8'),'port':0x18eb});var io=require(_0x94d2('0x9'))(new Redis(config[_0x94d2('0x6')]));var def={'method':_0x94d2('0xa'),'json':!![]};function emit(_0x1ed99a,_0x7370fc,_0x204c83){io['to'](_0x1ed99a)['emit'](_0x7370fc,_0x204c83);}function getTicket(_0xd36e9d,_0x32833c,_0x18f089,_0x6d6ba2,_0x5251b5,_0x35c32e,_0x98493e,_0x158a3c){logger[_0x94d2('0xb')](_0x94d2('0xc'));var _0xab8aea=new Date();var _0x22e02a=[{'name':'name','value':intUtil[_0x94d2('0xd')](_0x6d6ba2[_0x94d2('0xe')],_0x5251b5,'\x20')},{'name':'assigned_user_id','value':_0x32833c['id']},{'name':_0x94d2('0xf'),'value':_0x32833c['id']},{'name':'description','value':intUtil[_0x94d2('0xd')](_0x6d6ba2['Descriptions'],_0x5251b5,'\x0a')},{'name':_0x94d2('0x10'),'value':_0xab8aea[_0x94d2('0x11')]()[_0x94d2('0x12')](0x0,0x13)[_0x94d2('0x13')]('T','\x20')},{'name':_0x94d2('0x14'),'value':'0'},{'name':_0x94d2('0x15'),'value':'15'},{'name':_0x94d2('0x16'),'value':_0x18f089['id']},{'name':_0x94d2('0x17'),'value':_0x94d2('0x18')},{'name':_0x94d2('0x19'),'value':_0x18f089[_0x94d2('0x1a')]},{'name':_0x94d2('0x1b'),'value':_0x158a3c}];if(_0x35c32e[_0x94d2('0x1c')]){_['forEach'](_0x35c32e,function(_0x211a1c){if(_0x5251b5[_0x211a1c['variableName']]){_0x22e02a[_0x94d2('0x1d')]({'name':_0x211a1c[_0x94d2('0x1e')],'value':_0x5251b5[_0x211a1c['variableName']]});}});}return request({'form':{'method':_0x94d2('0x1f'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x94d2('0x20')]({'session':_0x98493e['id'],'module_name':_0x94d2('0x21'),'name_value_list':_0x22e02a})}});}function getAuth(_0x1204b7){return util[_0x94d2('0x22')](_0x94d2('0x23'),new Buffer(_0x1204b7[_0x94d2('0x24')]+':X')[_0x94d2('0x25')](_0x94d2('0x26')));}function getServerInfo(_0x4c6591){return request({'form':{'method':_0x94d2('0x27'),'input_type':_0x94d2('0x28'),'response_type':_0x94d2('0x28'),'rest_data':JSON['stringify']({'session':_0x4c6591['id']})}});}function getUser(_0x19eafb,_0x7593b2,_0x2d6f4a){if(!_[_0x94d2('0x29')](_0x7593b2)){logger['info']('Getting\x20agent\x20with\x20name',_0x7593b2);return request({'form':{'method':_0x94d2('0x2a'),'input_type':_0x94d2('0x28'),'response_type':_0x94d2('0x28'),'rest_data':JSON[_0x94d2('0x20')]({'session':_0x2d6f4a['id'],'module_name':_0x94d2('0x2b'),'query':util['format'](_0x94d2('0x2c'),_0x7593b2),'order_by':'','offset':'0','select_fields':['id',_0x94d2('0x1a'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x94d2('0x2d')](function(_0x3a7c92){if(_0x3a7c92[_0x94d2('0x2e')][_0x94d2('0x1c')]){var _0x571b50=_['find'](_0x3a7c92[_0x94d2('0x2e')],function(_0x3d0236){return _0x3d0236[_0x94d2('0x2f')][_0x94d2('0x30')][_0x94d2('0x31')]===_0x7593b2;});if(_0x571b50){logger[_0x94d2('0xb')]('Agent\x20found!');return BPromise[_0x94d2('0x32')]({'id':_0x571b50[_0x94d2('0x2f')]['id'][_0x94d2('0x31')],'name':_0x571b50[_0x94d2('0x2f')][_0x94d2('0x1a')][_0x94d2('0x31')]});}}logger[_0x94d2('0xb')](_0x94d2('0x33'));return BPromise[_0x94d2('0x32')]({'id':_0x2d6f4a['name_value_list'][_0x94d2('0x34')][_0x94d2('0x31')],'name':_0x2d6f4a[_0x94d2('0x2f')][_0x94d2('0x30')][_0x94d2('0x31')]});});}else{logger[_0x94d2('0xb')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x2d6f4a[_0x94d2('0x2f')][_0x94d2('0x34')][_0x94d2('0x31')],'name':_0x2d6f4a['name_value_list']['user_name']['value']});}}function getEndUser(_0x38942c,_0x11e795,_0x43cff3,_0x8c12a5){logger[_0x94d2('0xb')]('Searching\x20enduser\x20with\x20phone',_0x43cff3);return request({'form':{'method':_0x94d2('0x2a'),'input_type':_0x94d2('0x28'),'response_type':_0x94d2('0x28'),'rest_data':JSON[_0x94d2('0x20')]({'session':_0x8c12a5['id'],'module_name':_0x94d2('0x18'),'query':util['format'](_0x94d2('0x35'),_0x43cff3),'order_by':'','offset':'0','select_fields':['id',_0x94d2('0x1a'),_0x94d2('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x1e8f13){if(_0x1e8f13[_0x94d2('0x2e')][_0x94d2('0x1c')]){var _0x5c88c4=_['find'](_0x1e8f13[_0x94d2('0x2e')],function(_0x24bee0){return _0x24bee0[_0x94d2('0x2f')]['phone_home'][_0x94d2('0x31')]===_0x43cff3;});if(_0x5c88c4){logger[_0x94d2('0xb')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x5c88c4[_0x94d2('0x2f')]['id'][_0x94d2('0x31')],'name':_0x5c88c4['name_value_list'][_0x94d2('0x1a')][_0x94d2('0x31')],'phone':_0x5c88c4[_0x94d2('0x2f')][_0x94d2('0x36')][_0x94d2('0x31')]});}}else{logger[_0x94d2('0xb')](_0x94d2('0x37'));return request({'form':{'method':_0x94d2('0x1f'),'input_type':_0x94d2('0x28'),'response_type':_0x94d2('0x28'),'rest_data':JSON[_0x94d2('0x20')]({'session':_0x8c12a5['id'],'module_name':_0x94d2('0x18'),'name_value_list':[{'name':_0x94d2('0x38'),'value':_0x11e795!==_0x94d2('0x39')?_0x11e795:util[_0x94d2('0x22')](_0x94d2('0x3a'),_0x43cff3)},{'name':_0x94d2('0x36'),'value':_0x43cff3}]})}})[_0x94d2('0x2d')](function(_0x3e3e2c){logger[_0x94d2('0xb')]('Enduser\x20created.');return BPromise[_0x94d2('0x32')]({'id':_0x3e3e2c['id'],'name':_0x3e3e2c[_0x94d2('0x2e')][_0x94d2('0x38')][_0x94d2('0x31')],'phone':_0x3e3e2c[_0x94d2('0x2e')]['phone_home'][_0x94d2('0x31')]});});}});}function request(_0x4c51a7){logger[_0x94d2('0x3b')](_0x94d2('0x3c'),JSON[_0x94d2('0x20')](_0x4c51a7));return rp(_['merge'](def,_0x4c51a7));}function getTags(_0x292b81,_0x208e52){var _0x9ae325=[];if(_0x292b81&&_0x292b81['length']>0x0){_0x9ae325=_[_0x94d2('0x3d')](_0x292b81,_0x208e52);}return _0x9ae325;}function getCustomFields(_0x447638,_0x5ba7e5){var _0x4fe1fe=[];var _0x5962d5={'custom_fields':[]};if(_0x447638[_0x94d2('0x1c')]>0x0){_[_0x94d2('0x3e')](_0x447638,function(_0x3c7c57){if(_0x3c7c57['type']===_0x94d2('0x3f')&&_0x3c7c57[_0x94d2('0x40')]&&!_0x3c7c57[_0x94d2('0x41')]){_0x5962d5[_0x3c7c57[_0x94d2('0x40')]['toLowerCase']()]=_0x3c7c57[_0x94d2('0x42')]['toString']();}else if(_0x3c7c57['type']===_0x94d2('0x3f')&&_0x3c7c57[_0x94d2('0x1e')]&&_0x3c7c57[_0x94d2('0x41')]){_0x5962d5[_0x94d2('0x43')][_0x94d2('0x1d')]({'id':_0x3c7c57['idField'],'value':_0x3c7c57['content']['toString']()});}else if(_0x3c7c57[_0x94d2('0x44')]==='variable'&&_0x3c7c57[_0x94d2('0x45')]&&_0x3c7c57[_0x94d2('0x1e')]&&_0x3c7c57['customField']){_0x5ba7e5[_0x3c7c57[_0x94d2('0x45')]]&&_0x5962d5[_0x94d2('0x43')]['push']({'id':_0x3c7c57[_0x94d2('0x1e')],'value':_0x5ba7e5[_0x3c7c57[_0x94d2('0x45')]][_0x94d2('0x25')]()});}else if(_0x3c7c57[_0x94d2('0x44')]==='customVariable'&&_0x3c7c57[_0x94d2('0x46')]&&_0x3c7c57['Variable'][_0x94d2('0x1a')]&&_0x3c7c57['idField']&&_0x3c7c57[_0x94d2('0x41')]){_0x5ba7e5[_0x3c7c57['Variable']['name']['toLowerCase']()]&&_0x5962d5[_0x94d2('0x43')][_0x94d2('0x1d')]({'id':_0x3c7c57[_0x94d2('0x1e')],'value':_0x5ba7e5[_0x3c7c57[_0x94d2('0x46')][_0x94d2('0x1a')][_0x94d2('0x47')]()]['toString']()});}});}return _0x5962d5;}function getConnection(_0x18a9cb){return request({'method':_0x94d2('0xa'),'form':{'method':_0x94d2('0x48'),'input_type':_0x94d2('0x28'),'response_type':_0x94d2('0x28'),'rest_data':JSON[_0x94d2('0x20')]({'user_auth':{'user_name':_0x18a9cb[_0x94d2('0x49')],'password':_0x18a9cb[_0x94d2('0x4a')],'encryption':_0x94d2('0x4b')},'application':_0x94d2('0x4c')})}})['then'](function(_0x594863){var _0x5024f6=_0x594863;if(_0x5024f6['id']){def['sessionID']=_0x5024f6['id'];return BPromise[_0x94d2('0x32')](_0x5024f6);}else{throw new Error(util[_0x94d2('0x22')]('Account\x20%d\x20is\x20not\x20valid',_0x18a9cb['id']));}});}function setRelationship(_0x134027,_0x590a3a,_0x44587b,_0x3a2b15){return request({'form':{'method':_0x94d2('0x4d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x94d2('0x20')]({'session':_0x134027['id'],'module_name':_0x94d2('0x21'),'module_id':_0x44587b['id'],'link_field_name':_0x3a2b15,'related_ids':[_0x590a3a['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x94d2('0x4e')]=function(_0x1341ec,_0x522988,_0x20ac58,_0x2a6eb0,_0x4f32de,_0x489de1){var _0x1bb3d7,_0x2539af,_0x3386f7,_0x24fd59;_0x489de1[_0x94d2('0x4f')]=intUtil[_0x94d2('0x50')](_0x489de1['remoteUri']);_0x489de1['serverUrl']=intUtil[_0x94d2('0x50')](_0x489de1[_0x94d2('0x51')]);def['uri']=util[_0x94d2('0x22')]('%s/service/v4_1/rest.php',_0x489de1[_0x94d2('0x4f')]);if(_0x4f32de&&_0x4f32de[_0x94d2('0x52')]){logger[_0x94d2('0xb')](_0x94d2('0x53'),'Recording\x20is\x20enabled!');_0x522988[_0x94d2('0x54')]=util['format'](_0x94d2('0x55'),_0x489de1[_0x94d2('0x51')],_0x522988[_0x94d2('0x56')],md5(_0x522988[_0x94d2('0x56')]));}else{_0x522988[_0x94d2('0x54')]='';}return getConnection(_0x489de1)['then'](function(_0x5147e3){_0x24fd59=_0x5147e3;return getUser(_0x489de1,_0x2a6eb0['name'],_0x24fd59);})[_0x94d2('0x2d')](function(_0x11314d){_0x1bb3d7=_0x11314d;logger[_0x94d2('0xb')](_0x94d2('0x57'),_0x1bb3d7['id']);return getEndUser(_0x489de1,_0x522988[_0x94d2('0x58')],_0x522988[_0x94d2('0x59')],_0x24fd59);})[_0x94d2('0x2d')](function(_0x4408c8){_0x2539af=_0x4408c8;logger[_0x94d2('0xb')](_0x94d2('0x5a'),_0x2539af['id']);return getTicket(_0x489de1,_0x1bb3d7,_0x2539af,_0x20ac58,_0x522988,_0x20ac58[_0x94d2('0x5b')],_0x24fd59,_0x94d2('0x5c'));})['then'](function(_0x32c8bb){_0x3386f7=_0x32c8bb;logger[_0x94d2('0xb')](_0x94d2('0x5d'));logger[_0x94d2('0xb')]('The\x20Ticket\x20ID\x20is:',_0x3386f7['id']);return setRelationship(_0x24fd59,_0x1bb3d7,_0x3386f7,'users');})[_0x94d2('0x2d')](function(){return setRelationship(_0x24fd59,_0x2539af,_0x3386f7,_0x94d2('0x5e'));})[_0x94d2('0x2d')](function(){return getServerInfo(_0x24fd59);})[_0x94d2('0x2d')](function(_0x5d0852){var _0x1f9439=parseInt(_0x5d0852[_0x94d2('0x5f')][_0x94d2('0x60')](0x0));var _0x2d31e3=util[_0x94d2('0x22')](_0x94d2('0x61'),_0x489de1['remoteUri'],_0x3386f7['id']);if(_0x1f9439>0x6){_0x2d31e3=util[_0x94d2('0x22')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x489de1['remoteUri'],_0x3386f7['id']);}logger[_0x94d2('0xb')]('[QUEUE]',_0x94d2('0x62'));emit(util[_0x94d2('0x22')](_0x94d2('0x63'),_0x2a6eb0['name']),_0x94d2('0x64'),{'uri':_0x2d31e3});})[_0x94d2('0x65')](function(_0x65b953){logger['error'](_0x94d2('0x53'),JSON['stringify'](_0x65b953));});};exports['outbound']=function(_0x119621,_0x30cde9,_0x1b27c0,_0x3ab50f,_0x437eff,_0x167d18,_0x15b258){var _0x1194b5,_0x349645,_0x48bd50,_0x1ea9f6;_0x167d18[_0x94d2('0x4f')]=intUtil[_0x94d2('0x50')](_0x167d18[_0x94d2('0x4f')]);_0x167d18['serverUrl']=intUtil[_0x94d2('0x50')](_0x167d18['serverUrl']);def['uri']=util[_0x94d2('0x22')](_0x94d2('0x66'),_0x167d18[_0x94d2('0x4f')]);if(_0x15b258&&_0x15b258[_0x94d2('0x67')]&&_0x15b258[_0x94d2('0x67')]!==_0x94d2('0x68')){logger[_0x94d2('0xb')](_0x94d2('0x69'),_0x94d2('0x6a'));_0x30cde9['recordingURL']=util[_0x94d2('0x22')](_0x94d2('0x55'),_0x167d18[_0x94d2('0x51')],_0x30cde9['uniqueid'],md5(_0x30cde9['uniqueid']));}return getConnection(_0x167d18)['then'](function(_0x105757){_0x1ea9f6=_0x105757;return getUser(_0x167d18,_0x3ab50f[_0x94d2('0x1a')],_0x1ea9f6);})['then'](function(_0x2b2c6c){_0x1194b5=_0x2b2c6c;logger['info'](_0x94d2('0x57'),_0x1194b5['id']);return getEndUser(_0x167d18,_0x30cde9[_0x94d2('0x6b')],_0x30cde9[_0x94d2('0x6c')],_0x1ea9f6);})[_0x94d2('0x2d')](function(_0x205ddf){_0x349645=_0x205ddf;logger[_0x94d2('0xb')](_0x94d2('0x5a'),_0x349645['id']);return getTicket(_0x167d18,_0x1194b5,_0x349645,_0x1b27c0,_0x30cde9,_0x1b27c0[_0x94d2('0x5b')],_0x1ea9f6,'Outbound');})['then'](function(_0x409a08){_0x48bd50=_0x409a08;logger['info'](_0x94d2('0x5d'));logger['info'](_0x94d2('0x6d'),_0x48bd50['id']);return setRelationship(_0x1ea9f6,_0x1194b5,_0x48bd50,_0x94d2('0x6e'));})[_0x94d2('0x2d')](function(){return setRelationship(_0x1ea9f6,_0x349645,_0x48bd50,_0x94d2('0x5e'));})[_0x94d2('0x2d')](function(){return getServerInfo(_0x1ea9f6);})[_0x94d2('0x2d')](function(_0x267940){var _0x34b7ee=parseInt(_0x267940[_0x94d2('0x5f')]['charAt'](0x0));var _0x4d8607=util[_0x94d2('0x22')](_0x94d2('0x61'),_0x167d18['remoteUri'],_0x48bd50['id']);if(_0x34b7ee>0x6){_0x4d8607=util[_0x94d2('0x22')](_0x94d2('0x6f'),_0x167d18[_0x94d2('0x4f')],_0x48bd50['id']);}logger[_0x94d2('0xb')](_0x94d2('0x69'),_0x94d2('0x62'));emit(util['format'](_0x94d2('0x63'),_0x3ab50f['name']),_0x94d2('0x64'),{'uri':_0x4d8607});})['catch'](function(_0x1e91bb){logger[_0x94d2('0x70')](_0x94d2('0x69'),JSON[_0x94d2('0x20')](_0x1e91bb));});};exports[_0x94d2('0x71')]=function(_0x31e65a,_0x2213bb,_0x1c45fa,_0x3461a9,_0x5cab72,_0x14202d){var _0x5e719a,_0x53d490,_0x12d2d6,_0xbdabae;_0x14202d[_0x94d2('0x4f')]=intUtil['stripTrailingSlash'](_0x14202d[_0x94d2('0x4f')]);_0x14202d['serverUrl']=intUtil['stripTrailingSlash'](_0x14202d[_0x94d2('0x51')]);def[_0x94d2('0x72')]=util[_0x94d2('0x22')](_0x94d2('0x66'),_0x14202d[_0x94d2('0x4f')]);if(_0x5cab72&&_0x5cab72[_0x94d2('0x52')]){logger[_0x94d2('0xb')]('['+_0x2213bb[_0x94d2('0x73')][_0x94d2('0x74')]()+']','Recording\x20is\x20enabled!');_0x2213bb[_0x94d2('0x54')]=util['format'](_0x94d2('0x55'),_0x14202d[_0x94d2('0x51')],_0x2213bb['uniqueid'],md5(_0x2213bb['uniqueid']));}else{_0x2213bb['recordingURL']='';}return getConnection(_0x14202d)[_0x94d2('0x2d')](function(_0x3319a3){_0xbdabae=_0x3319a3;if(!_['isNil'](_0x3461a9)){return getUser(_0x14202d,_0x3461a9['name'],_0xbdabae);}else{return getUser(_0x14202d,null,_0xbdabae);}})['then'](function(_0x9689ce){_0x5e719a=_0x9689ce;logger[_0x94d2('0xb')](_0x94d2('0x57'),_0x5e719a['id']);return getEndUser(_0x14202d,_0x2213bb['calleridname'],_0x2213bb[_0x94d2('0x59')],_0xbdabae);})[_0x94d2('0x2d')](function(_0x4b920e){_0x53d490=_0x4b920e;logger[_0x94d2('0xb')]('The\x20Enduser\x20ID\x20is:',_0x53d490['id']);return getTicket(_0x14202d,_0x5e719a,_0x53d490,_0x1c45fa,_0x2213bb,_0x1c45fa[_0x94d2('0x5b')],_0xbdabae,'Inbound');})[_0x94d2('0x2d')](function(_0x9cf9d3){_0x12d2d6=_0x9cf9d3;logger[_0x94d2('0xb')](_0x94d2('0x5d'));logger[_0x94d2('0xb')]('The\x20Ticket\x20ID\x20is:',_0x12d2d6['id']);return setRelationship(_0xbdabae,_0x5e719a,_0x12d2d6,_0x94d2('0x6e'));})['then'](function(){return setRelationship(_0xbdabae,_0x53d490,_0x12d2d6,_0x94d2('0x5e'));})[_0x94d2('0x2d')](function(){return getServerInfo(_0xbdabae);})['catch'](function(_0x236381){logger[_0x94d2('0x70')]('['+_0x2213bb[_0x94d2('0x73')][_0x94d2('0x74')]()+']',JSON[_0x94d2('0x20')](_0x236381));});}; \ 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 8655d86..451ba2d 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 _0x7a24=['keyType','format','key','keyContent','%s:\x20%s','toLowerCase','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','util','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','keyValue'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x7a24,0x17a));var _0x47a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a24[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x47a2('0x0'));exports['getString']=function(_0x495b14,_0x36f02c,_0x2358ab){var _0x20ce9a=[];if(_0x495b14[_0x47a2('0x1')]>0x0){var _0x4d59de=_[_0x47a2('0x2')](_0x495b14,['id']);for(var _0x46ce55=0x0;_0x46ce55<_0x4d59de[_0x47a2('0x1')];_0x46ce55++){var _0x3111d3=_0x4d59de[_0x46ce55];if(_0x3111d3[_0x47a2('0x3')]===_0x47a2('0x4')){_0x20ce9a[_0x47a2('0x5')](_0x3111d3[_0x47a2('0x6')]);}else if(_0x3111d3[_0x47a2('0x3')]===_0x47a2('0x7')&&_0x3111d3['variableName']){_0x36f02c[_0x3111d3[_0x47a2('0x8')]]&&_0x20ce9a[_0x47a2('0x5')](_0x36f02c[_0x3111d3[_0x47a2('0x8')]][_0x47a2('0x9')]());}else if(_0x3111d3['type']===_0x47a2('0xa')&&_0x3111d3[_0x47a2('0xb')]&&_0x3111d3[_0x47a2('0xb')][_0x47a2('0xc')]){_0x36f02c[_0x3111d3[_0x47a2('0xb')][_0x47a2('0xc')]['toLowerCase']()]&&_0x20ce9a[_0x47a2('0x5')](_0x36f02c[_0x3111d3[_0x47a2('0xb')][_0x47a2('0xc')]['toLowerCase']()][_0x47a2('0x9')]());}else if(_0x3111d3[_0x47a2('0x3')]===_0x47a2('0xd')){if(_0x3111d3[_0x47a2('0xe')]===_0x47a2('0x4')&&_0x3111d3['key']){_0x20ce9a[_0x47a2('0x5')](util[_0x47a2('0xf')]('%s:\x20%s',_0x3111d3[_0x47a2('0x10')],_0x3111d3[_0x47a2('0x11')]));}else if(_0x3111d3[_0x47a2('0xe')]===_0x47a2('0x7')&&_0x3111d3[_0x47a2('0x8')]&&_0x3111d3['key']){_0x36f02c[_0x3111d3[_0x47a2('0x8')]]&&_0x20ce9a[_0x47a2('0x5')](util['format'](_0x47a2('0x12'),_0x3111d3[_0x47a2('0x10')],_0x36f02c[_0x3111d3['variableName']]));}else if(_0x3111d3[_0x47a2('0xe')]===_0x47a2('0xa')&&_0x3111d3[_0x47a2('0xb')]&&_0x3111d3[_0x47a2('0xb')][_0x47a2('0xc')]&&_0x3111d3['key']){_0x36f02c[_0x3111d3[_0x47a2('0xb')][_0x47a2('0xc')][_0x47a2('0x13')]()]&&_0x20ce9a[_0x47a2('0x5')](util[_0x47a2('0xf')]('%s:\x20%s',_0x3111d3[_0x47a2('0x10')],_0x36f02c[_0x3111d3[_0x47a2('0xb')][_0x47a2('0xc')][_0x47a2('0x13')]()]));}}}}return _0x20ce9a[_0x47a2('0x14')](_0x2358ab);};exports[_0x47a2('0x15')]=function(_0x389a4d){var _0x99441b=_0x389a4d[_0x47a2('0x16')](-0x1);if(_0x99441b==='/'){_0x389a4d=_0x389a4d[_0x47a2('0x17')](0x0,_0x389a4d[_0x47a2('0x18')](_0x99441b));}return _0x389a4d;};exports[_0x47a2('0x19')]=function(_0x1f7998){if(!_[_0x47a2('0x1a')](_0x1f7998)&&_0x1f7998!==''){var _0x251ccc=/^(([^<>()\[\]\\.,;:\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 _0x251ccc[_0x47a2('0x1b')](String(_0x1f7998)[_0x47a2('0x13')]());}else{return![];}}; \ No newline at end of file +var _0xb5f0=['validateEmail','isNil','test','lodash','util','getString','sortBy','length','type','string','content','variable','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','format','%s:\x20%s','key','keyContent','stripTrailingSlash','substring','lastIndexOf'];(function(_0x403fc7,_0x32931a){var _0x5d0827=function(_0x5ea698){while(--_0x5ea698){_0x403fc7['push'](_0x403fc7['shift']());}};_0x5d0827(++_0x32931a);}(_0xb5f0,0xff));var _0x0b5f=function(_0x2a9094,_0x5f0ef8){_0x2a9094=_0x2a9094-0x0;var _0xd5e865=_0xb5f0[_0x2a9094];return _0xd5e865;};'use strict';var _=require(_0x0b5f('0x0'));var util=require(_0x0b5f('0x1'));exports[_0x0b5f('0x2')]=function(_0x2b95c7,_0x1dc424,_0x5b9743){var _0x2d4567=[];if(_0x2b95c7['length']>0x0){var _0x44f612=_[_0x0b5f('0x3')](_0x2b95c7,['id']);for(var _0x72afc7=0x0;_0x72afc7<_0x44f612[_0x0b5f('0x4')];_0x72afc7++){var _0x54d08e=_0x44f612[_0x72afc7];if(_0x54d08e[_0x0b5f('0x5')]===_0x0b5f('0x6')){_0x2d4567['push'](_0x54d08e[_0x0b5f('0x7')]);}else if(_0x54d08e[_0x0b5f('0x5')]===_0x0b5f('0x8')&&_0x54d08e[_0x0b5f('0x9')]){_0x1dc424[_0x54d08e[_0x0b5f('0x9')]]&&_0x2d4567[_0x0b5f('0xa')](_0x1dc424[_0x54d08e[_0x0b5f('0x9')]][_0x0b5f('0xb')]());}else if(_0x54d08e['type']===_0x0b5f('0xc')&&_0x54d08e[_0x0b5f('0xd')]&&_0x54d08e[_0x0b5f('0xd')][_0x0b5f('0xe')]){_0x1dc424[_0x54d08e[_0x0b5f('0xd')][_0x0b5f('0xe')]['toLowerCase']()]&&_0x2d4567['push'](_0x1dc424[_0x54d08e[_0x0b5f('0xd')][_0x0b5f('0xe')][_0x0b5f('0xf')]()][_0x0b5f('0xb')]());}else if(_0x54d08e[_0x0b5f('0x5')]===_0x0b5f('0x10')){if(_0x54d08e[_0x0b5f('0x11')]===_0x0b5f('0x6')&&_0x54d08e['key']){_0x2d4567[_0x0b5f('0xa')](util[_0x0b5f('0x12')](_0x0b5f('0x13'),_0x54d08e[_0x0b5f('0x14')],_0x54d08e[_0x0b5f('0x15')]));}else if(_0x54d08e['keyType']===_0x0b5f('0x8')&&_0x54d08e[_0x0b5f('0x9')]&&_0x54d08e[_0x0b5f('0x14')]){_0x1dc424[_0x54d08e[_0x0b5f('0x9')]]&&_0x2d4567[_0x0b5f('0xa')](util['format'](_0x0b5f('0x13'),_0x54d08e[_0x0b5f('0x14')],_0x1dc424[_0x54d08e[_0x0b5f('0x9')]]));}else if(_0x54d08e[_0x0b5f('0x11')]===_0x0b5f('0xc')&&_0x54d08e[_0x0b5f('0xd')]&&_0x54d08e['Variable']['name']&&_0x54d08e[_0x0b5f('0x14')]){_0x1dc424[_0x54d08e[_0x0b5f('0xd')][_0x0b5f('0xe')][_0x0b5f('0xf')]()]&&_0x2d4567['push'](util[_0x0b5f('0x12')](_0x0b5f('0x13'),_0x54d08e[_0x0b5f('0x14')],_0x1dc424[_0x54d08e['Variable'][_0x0b5f('0xe')]['toLowerCase']()]));}}}}return _0x2d4567['join'](_0x5b9743);};exports[_0x0b5f('0x16')]=function(_0x11288d){var _0x52db63=_0x11288d['slice'](-0x1);if(_0x52db63==='/'){_0x11288d=_0x11288d[_0x0b5f('0x17')](0x0,_0x11288d[_0x0b5f('0x18')](_0x52db63));}return _0x11288d;};exports[_0x0b5f('0x19')]=function(_0x37bf1c){if(!_[_0x0b5f('0x1a')](_0x37bf1c)&&_0x37bf1c!==''){var _0x2f1171=/^(([^<>()\[\]\\.,;:\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 _0x2f1171[_0x0b5f('0x1b')](String(_0x37bf1c)[_0x0b5f('0xf')]());}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 e9ffa2a..c084968 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(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','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','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x43eeb3,_0x44876d){var _0x53abd2=function(_0x5dfa8e){while(--_0x5dfa8e){_0x43eeb3['push'](_0x43eeb3['shift']());}};_0x53abd2(++_0x44876d);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ 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 42852a6..79e4a93 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 _0x1b3a=['content','picklist','idField','push','variable','variableName','custom_fields','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','Recording\x20is\x20enabled!','email','newTab','trigger:browser:url','[OUTBOUND]','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','socket.io-emitter','emit','application/json','info','format','POST','name','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','password','authType','token','Basic\x20%s','toString','debug','[HTTP]','GET','map','forEach','includes','string','type','nameField','toLowerCase'];(function(_0x241549,_0x213c3d){var _0x9f7814=function(_0x419777){while(--_0x419777){_0x241549['push'](_0x241549['shift']());}};_0x9f7814(++_0x213c3d);}(_0x1b3a,0xf5));var _0xa1b3=function(_0x56b7a9,_0x491385){_0x56b7a9=_0x56b7a9-0x0;var _0x24e0df=_0x1b3a[_0x56b7a9];return _0x24e0df;};'use strict';var _=require(_0xa1b3('0x0'));var rp=require('request-promise');var md5=require(_0xa1b3('0x1'));var util=require('util');var Redis=require(_0xa1b3('0x2'));var intUtil=require(_0xa1b3('0x3'));var config=require(_0xa1b3('0x4'));var logger=require(_0xa1b3('0x5'))(_0xa1b3('0x6'));config['redis']=_[_0xa1b3('0x7')](config[_0xa1b3('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xa1b3('0x9'))(new Redis(config[_0xa1b3('0x8')]));function emit(_0x4e7e67,_0x5d3de1,_0x40f161){io['to'](_0x4e7e67)[_0xa1b3('0xa')](_0x5d3de1,_0x40f161);}var headers={'Content-Type':_0xa1b3('0xb'),'Accept':'application/json'};function getTicket(_0x2eafa5,_0x3da2a9,_0x452db0,_0x5bf2fc,_0x259b27){logger[_0xa1b3('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xa1b3('0xd')]('%s/tickets.json',_0x2eafa5['remoteUri']),'method':_0xa1b3('0xe'),'body':{'ticket':_['merge']({'requester_id':_0x452db0['id'],'submitter_id':_0x3da2a9?_0x3da2a9['id']:undefined,'assignee_id':_0x3da2a9?_0x3da2a9['id']:undefined,'tags':getTags(_0x5bf2fc['Tags'],_0xa1b3('0xf')),'subject':intUtil['getString'](_0x5bf2fc['Subjects'],_0x259b27,'\x20'),'description':intUtil[_0xa1b3('0x10')](_0x5bf2fc[_0xa1b3('0x11')],_0x259b27,'\x0a'),'comment':{'public':![],'body':intUtil[_0xa1b3('0x10')](_0x5bf2fc[_0xa1b3('0x11')],_0x259b27,'\x0a')}},getCustomFields(_0x5bf2fc[_0xa1b3('0x12')],_0x259b27))}})[_0xa1b3('0x13')](function(_0x30e97a){logger['info'](_0xa1b3('0x14'));return _0x30e97a[_0xa1b3('0x15')];});}function getUser(_0x5e5981,_0x52a9d7){if(intUtil[_0xa1b3('0x16')](_0x52a9d7)){logger[_0xa1b3('0xc')]('Getting\x20agent\x20with\x20email',_0x52a9d7);return request({'uri':util[_0xa1b3('0xd')](_0xa1b3('0x17'),_0x5e5981[_0xa1b3('0x18')]),'qs':{'query':util['format'](_0xa1b3('0x19'),_0x52a9d7)}})[_0xa1b3('0x13')](function(_0x4805be){if(_0x4805be[_0xa1b3('0x1a')]){logger['info'](_0xa1b3('0x1b'));return _[_0xa1b3('0x1c')](_0x4805be[_0xa1b3('0x1d')],{'email':_0x52a9d7,'role':_0xa1b3('0x1e')});}else{logger[_0xa1b3('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xa1b3('0x1f'),_0x5e5981[_0xa1b3('0x18')])})[_0xa1b3('0x13')](function(_0x30883c){logger[_0xa1b3('0xc')](_0xa1b3('0x20'));return _0x30883c[_0xa1b3('0x21')];});}});}else{logger[_0xa1b3('0xc')](_0xa1b3('0x22'));return request({'uri':util[_0xa1b3('0xd')](_0xa1b3('0x1f'),_0x5e5981[_0xa1b3('0x18')])})[_0xa1b3('0x13')](function(_0x1c45a7){logger[_0xa1b3('0xc')](_0xa1b3('0x20'));return _0x1c45a7[_0xa1b3('0x21')];});}}function getEndUser(_0x3ca712,_0xa8b13c,_0x3c34b7){logger[_0xa1b3('0xc')](_0xa1b3('0x23'),_0x3c34b7);return request({'uri':util[_0xa1b3('0xd')](_0xa1b3('0x17'),_0x3ca712['remoteUri']),'qs':{'query':util[_0xa1b3('0xd')](_0xa1b3('0x24'),_0x3c34b7)}})['then'](function(_0x2d409f){var _0x482716;if(_0x2d409f['results'][_0xa1b3('0x25')]){_0x2d409f[_0xa1b3('0x1d')]=_['filter'](_0x2d409f[_0xa1b3('0x1d')],{'suspended':![],'role':_0xa1b3('0x26')});if(_0x2d409f['results'][_0xa1b3('0x25')]){_0x482716=_[_0xa1b3('0x27')](_0x2d409f[_0xa1b3('0x1d')]);}}if(_0x482716){logger[_0xa1b3('0xc')]('Enduser\x20found!');return _0x482716;}else{logger['info'](_0xa1b3('0x28'));return request({'uri':util[_0xa1b3('0xd')](_0xa1b3('0x29'),_0x3ca712[_0xa1b3('0x18')]),'method':_0xa1b3('0xe'),'body':{'user':{'role':_0xa1b3('0x26'),'name':util[_0xa1b3('0xd')](_0xa1b3('0x2a'),_0xa8b13c||_0x3c34b7),'phone':_0x3c34b7}}})[_0xa1b3('0x13')](function(_0x58095f){logger[_0xa1b3('0xc')]('Enduser\x20created.');return _0x58095f[_0xa1b3('0x21')];});}});}function getAuth(_0x155607){var _0x36a203;if(_0x155607['authType']===_0xa1b3('0x2b')){_0x36a203=util[_0xa1b3('0xd')]('%s:%s',_0x155607['username'],_0x155607[_0xa1b3('0x2b')]);}else if(_0x155607[_0xa1b3('0x2c')]===_0xa1b3('0x2d')){_0x36a203=util['format']('%s/token:%s',_0x155607['username'],_0x155607['token']);}return util[_0xa1b3('0xd')](_0xa1b3('0x2e'),new Buffer(_0x36a203)[_0xa1b3('0x2f')]('base64'));}function request(_0x2d0c6b){logger[_0xa1b3('0x30')](_0xa1b3('0x31'),JSON['stringify'](_0x2d0c6b));return rp(_[_0xa1b3('0x7')](_0x2d0c6b,{'method':_0xa1b3('0x32'),'headers':headers,'json':!![]}));}function getTags(_0xde27ee,_0x5e4c80){var _0x577bef=[];if(_0xde27ee&&_0xde27ee[_0xa1b3('0x25')]>0x0){_0x577bef=_[_0xa1b3('0x33')](_0xde27ee,_0x5e4c80);}return _0x577bef;}function getCustomFields(_0x1b1f26,_0x2c52f7){var _0x5cd52=[];var _0x3eb112={'custom_fields':[]};if(_0x1b1f26[_0xa1b3('0x25')]>0x0){_[_0xa1b3('0x34')](_0x1b1f26,function(_0x2cb84e){if(_[_0xa1b3('0x35')]([_0xa1b3('0x36'),'picklist'],_0x2cb84e[_0xa1b3('0x37')])&&_0x2cb84e[_0xa1b3('0x38')]&&!_0x2cb84e['customField']){_0x3eb112[_0x2cb84e[_0xa1b3('0x38')][_0xa1b3('0x39')]()]=_0x2cb84e[_0xa1b3('0x3a')][_0xa1b3('0x2f')]();}else if(_[_0xa1b3('0x35')]([_0xa1b3('0x36'),_0xa1b3('0x3b')],_0x2cb84e['type'])&&_0x2cb84e[_0xa1b3('0x3c')]&&_0x2cb84e['customField']){_0x3eb112['custom_fields'][_0xa1b3('0x3d')]({'id':_0x2cb84e[_0xa1b3('0x3c')],'value':_0x2cb84e['content'][_0xa1b3('0x2f')]()});}else if(_0x2cb84e[_0xa1b3('0x37')]===_0xa1b3('0x3e')&&_0x2cb84e[_0xa1b3('0x3f')]&&_0x2cb84e[_0xa1b3('0x3c')]&&_0x2cb84e['customField']){_0x2c52f7[_0x2cb84e[_0xa1b3('0x3f')]]&&_0x3eb112[_0xa1b3('0x40')][_0xa1b3('0x3d')]({'id':_0x2cb84e['idField'],'value':_0x2c52f7[_0x2cb84e[_0xa1b3('0x3f')]][_0xa1b3('0x2f')]()});}else if(_0x2cb84e[_0xa1b3('0x37')]==='customVariable'&&_0x2cb84e[_0xa1b3('0x41')]&&_0x2cb84e['Variable'][_0xa1b3('0xf')]&&_0x2cb84e[_0xa1b3('0x3c')]&&_0x2cb84e['customField']){_0x2c52f7[_0x2cb84e['Variable'][_0xa1b3('0xf')][_0xa1b3('0x39')]()]&&_0x3eb112[_0xa1b3('0x40')][_0xa1b3('0x3d')]({'id':_0x2cb84e[_0xa1b3('0x3c')],'value':_0x2c52f7[_0x2cb84e[_0xa1b3('0x41')]['name'][_0xa1b3('0x39')]()][_0xa1b3('0x2f')]()});}});}return _0x3eb112;}exports[_0xa1b3('0x42')]=function(_0x363593,_0x598dc1,_0x2beff5,_0xe39d06,_0x47ee9b,_0x5b8f78){var _0x5d0892,_0x8ff4d9;_0x5b8f78[_0xa1b3('0x18')]=intUtil[_0xa1b3('0x43')](_0x5b8f78[_0xa1b3('0x18')]);_0x5b8f78[_0xa1b3('0x44')]=intUtil['stripTrailingSlash'](_0x5b8f78[_0xa1b3('0x44')]);if(_0x47ee9b&&_0x47ee9b[_0xa1b3('0x45')]){logger[_0xa1b3('0xc')]('[QUEUE]','Recording\x20is\x20enabled!');_0x598dc1[_0xa1b3('0x46')]=util[_0xa1b3('0xd')](_0xa1b3('0x47'),_0x5b8f78[_0xa1b3('0x44')],_0x598dc1[_0xa1b3('0x48')],md5(_0x598dc1[_0xa1b3('0x48')]));}else{_0x598dc1[_0xa1b3('0x46')]='';}headers[_0xa1b3('0x49')]=getAuth(_0x5b8f78);return getUser(_0x5b8f78,_0xe39d06['email'])[_0xa1b3('0x13')](function(_0x540605){_0x5d0892=_0x540605;logger[_0xa1b3('0xc')](_0xa1b3('0x4a'),_0x5d0892['id']);return getEndUser(_0x5b8f78,_0x598dc1[_0xa1b3('0x4b')],_0x598dc1[_0xa1b3('0x4c')]);})[_0xa1b3('0x13')](function(_0x5e054f){_0x8ff4d9=_0x5e054f;logger[_0xa1b3('0xc')](_0xa1b3('0x4d'),_0x8ff4d9['id']);return getTicket(_0x5b8f78,_0x5d0892,_0x8ff4d9,_0x2beff5,_0x598dc1);})[_0xa1b3('0x13')](function(_0x26e2ca){if(_0x26e2ca){logger[_0xa1b3('0xc')](_0xa1b3('0x4e'),_0x26e2ca['id']);switch(_0x5b8f78['type']){case _0xa1b3('0x4f'):logger[_0xa1b3('0xc')](_0xa1b3('0x50'),_0xa1b3('0x51'));return request({'uri':util[_0xa1b3('0xd')](_0xa1b3('0x52'),_0x5b8f78['remoteUri'],_0x5d0892['id'],_0x26e2ca['id']),'method':_0xa1b3('0xe')});case'newTab':logger[_0xa1b3('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xa1b3('0x53'),_0xe39d06['name']),'trigger:browser:url',{'uri':util[_0xa1b3('0xd')](_0xa1b3('0x54'),_0x5b8f78[_0xa1b3('0x18')][_0xa1b3('0x55')]('/api/v2',''),_0x26e2ca['id'])});break;default:logger[_0xa1b3('0x56')](_0xa1b3('0x50'),_0xa1b3('0x57'));}}})[_0xa1b3('0x58')](function(_0x24af3f){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xa1b3('0x59')](_0x24af3f,{'showHidden':!![],'depth':null}));});};exports[_0xa1b3('0x5a')]=function(_0x365f6b,_0x4b60b6,_0x484ec4,_0x466c6d,_0x3c6f5b,_0xdb2b5d,_0x22a636){var _0x1ee671,_0x47eebb;_0xdb2b5d[_0xa1b3('0x18')]=intUtil['stripTrailingSlash'](_0xdb2b5d[_0xa1b3('0x18')]);_0xdb2b5d[_0xa1b3('0x44')]=intUtil['stripTrailingSlash'](_0xdb2b5d[_0xa1b3('0x44')]);if(_0x22a636&&_0x22a636[_0xa1b3('0x5b')]&&_0x22a636['recordingFormat']!=='none'){logger['info']('[OUTBOUND]',_0xa1b3('0x5c'));_0x4b60b6[_0xa1b3('0x46')]=util[_0xa1b3('0xd')](_0xa1b3('0x47'),_0xdb2b5d[_0xa1b3('0x44')],_0x4b60b6['uniqueid'],md5(_0x4b60b6[_0xa1b3('0x48')]));}headers[_0xa1b3('0x49')]=getAuth(_0xdb2b5d);return getUser(_0xdb2b5d,_0x466c6d[_0xa1b3('0x5d')])[_0xa1b3('0x13')](function(_0x3fd7af){_0x1ee671=_0x3fd7af;logger[_0xa1b3('0xc')]('The\x20User\x20ID\x20is:',_0x1ee671['id']);return getEndUser(_0xdb2b5d,_0x4b60b6['destcalleridname'],_0x4b60b6['destcalleridnum']);})['then'](function(_0x5c19bd){_0x47eebb=_0x5c19bd;logger['info'](_0xa1b3('0x4d'),_0x47eebb['id']);return getTicket(_0xdb2b5d,_0x1ee671,_0x47eebb,_0x484ec4,_0x4b60b6);})[_0xa1b3('0x13')](function(_0x62de76){if(_0x62de76){logger[_0xa1b3('0xc')](_0xa1b3('0x4e'),_0x62de76['id']);switch(_0xdb2b5d[_0xa1b3('0x37')]){case'integrationTab':logger[_0xa1b3('0xc')]('[OUTBOUND]',_0xa1b3('0x51'));return request({'uri':util[_0xa1b3('0xd')](_0xa1b3('0x52'),_0xdb2b5d[_0xa1b3('0x18')],_0x1ee671['id'],_0x62de76['id']),'method':_0xa1b3('0xe')});case _0xa1b3('0x5e'):logger[_0xa1b3('0xc')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa1b3('0xd')](_0xa1b3('0x53'),_0x466c6d['name']),_0xa1b3('0x5f'),{'uri':util['format'](_0xa1b3('0x54'),_0xdb2b5d['remoteUri'][_0xa1b3('0x55')]('/api/v2',''),_0x62de76['id'])});break;default:logger[_0xa1b3('0x56')](_0xa1b3('0x60'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xa1b3('0x58')](function(_0x11e64f){logger[_0xa1b3('0x56')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x11e64f,{'showHidden':!![],'depth':null}));});};exports[_0xa1b3('0x61')]=function(_0x5ead8e,_0x214374,_0x3ac726,_0x3ab7d9,_0xff8a3d,_0x1241da){var _0x550838,_0xfa5c6a;_0x1241da['remoteUri']=intUtil['stripTrailingSlash'](_0x1241da[_0xa1b3('0x18')]);_0x1241da['serverUrl']=intUtil[_0xa1b3('0x43')](_0x1241da[_0xa1b3('0x44')]);if(_0xff8a3d&&_0xff8a3d[_0xa1b3('0x45')]){logger[_0xa1b3('0xc')]('['+_0x214374[_0xa1b3('0x62')][_0xa1b3('0x63')]()+']',_0xa1b3('0x5c'));_0x214374[_0xa1b3('0x46')]=util[_0xa1b3('0xd')](_0xa1b3('0x47'),_0x1241da[_0xa1b3('0x44')],_0x214374[_0xa1b3('0x48')],md5(_0x214374[_0xa1b3('0x48')]));}else{_0x214374[_0xa1b3('0x46')]='';}headers[_0xa1b3('0x49')]=getAuth(_0x1241da);return getUser(_0x1241da)[_0xa1b3('0x13')](function(_0x206f7c){_0x550838=_0x206f7c;logger['info'](_0xa1b3('0x4a'),_0x550838['id']);return getEndUser(_0x1241da,_0x214374['calleridname'],_0x214374[_0xa1b3('0x4c')]);})['then'](function(_0x3da846){_0xfa5c6a=_0x3da846;logger['info'](_0xa1b3('0x4d'),_0xfa5c6a['id']);return getTicket(_0x1241da,_0x550838,_0xfa5c6a,_0x3ac726,_0x214374);})[_0xa1b3('0x13')](function(_0x4e4409){if(_0x4e4409){logger[_0xa1b3('0xc')](_0xa1b3('0x4e'),_0x4e4409['id']);}})[_0xa1b3('0x58')](function(_0x2db2f8){logger[_0xa1b3('0x56')]('['+_0x214374[_0xa1b3('0x62')][_0xa1b3('0x63')]()+']'+_0xa1b3('0x64'),util[_0xa1b3('0x59')](_0x2db2f8,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xd52f=['defaults','redis','emit','application/json','format','%s/tickets.json','POST','merge','getString','Descriptions','Fields','then','info','Ticket\x20created!','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/users/me.json','user','Searching\x20enduser\x20with\x20phone','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','map','forEach','includes','picklist','customField','nameField','toLowerCase','content','string','type','idField','custom_fields','push','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','catch','inspect','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','destcalleridnum','/api/v2','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd52f,0x64));var _0xfd52=function(_0x7cfbdb,_0x1597d9){_0x7cfbdb=_0x7cfbdb-0x0;var _0x5112a7=_0xd52f[_0x7cfbdb];return _0x5112a7;};'use strict';var _=require(_0xfd52('0x0'));var rp=require(_0xfd52('0x1'));var md5=require(_0xfd52('0x2'));var util=require(_0xfd52('0x3'));var Redis=require(_0xfd52('0x4'));var intUtil=require('./util');var config=require(_0xfd52('0x5'));var logger=require(_0xfd52('0x6'))('zendesk');config['redis']=_[_0xfd52('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfd52('0x8')]));function emit(_0x4d567b,_0x1ddd0e,_0x1eb627){io['to'](_0x4d567b)[_0xfd52('0x9')](_0x1ddd0e,_0x1eb627);}var headers={'Content-Type':_0xfd52('0xa'),'Accept':_0xfd52('0xa')};function getTicket(_0x4fd201,_0x82c8da,_0xad52d9,_0x57f333,_0x1e3db7){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0xfd52('0xb')](_0xfd52('0xc'),_0x4fd201['remoteUri']),'method':_0xfd52('0xd'),'body':{'ticket':_[_0xfd52('0xe')]({'requester_id':_0xad52d9['id'],'submitter_id':_0x82c8da?_0x82c8da['id']:undefined,'assignee_id':_0x82c8da?_0x82c8da['id']:undefined,'tags':getTags(_0x57f333['Tags'],'name'),'subject':intUtil[_0xfd52('0xf')](_0x57f333['Subjects'],_0x1e3db7,'\x20'),'description':intUtil['getString'](_0x57f333[_0xfd52('0x10')],_0x1e3db7,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x57f333[_0xfd52('0x10')],_0x1e3db7,'\x0a')}},getCustomFields(_0x57f333[_0xfd52('0x11')],_0x1e3db7))}})[_0xfd52('0x12')](function(_0x2f4d8c){logger[_0xfd52('0x13')](_0xfd52('0x14'));return _0x2f4d8c['ticket'];});}function getUser(_0x4e9706,_0x4024e1){if(intUtil['validateEmail'](_0x4024e1)){logger[_0xfd52('0x13')](_0xfd52('0x15'),_0x4024e1);return request({'uri':util['format'](_0xfd52('0x16'),_0x4e9706[_0xfd52('0x17')]),'qs':{'query':util[_0xfd52('0xb')]('type:user\x20role:agent\x20email:%s',_0x4024e1)}})[_0xfd52('0x12')](function(_0x2c7703){if(_0x2c7703[_0xfd52('0x18')]){logger[_0xfd52('0x13')](_0xfd52('0x19'));return _[_0xfd52('0x1a')](_0x2c7703[_0xfd52('0x1b')],{'email':_0x4024e1,'role':'agent'});}else{logger[_0xfd52('0x13')](_0xfd52('0x1c'));return request({'uri':util['format']('%s/users/me.json',_0x4e9706[_0xfd52('0x17')])})['then'](function(_0xe3c5e0){logger[_0xfd52('0x13')](_0xfd52('0x1d'));return _0xe3c5e0['user'];});}});}else{logger[_0xfd52('0x13')](_0xfd52('0x1c'));return request({'uri':util[_0xfd52('0xb')](_0xfd52('0x1e'),_0x4e9706['remoteUri'])})['then'](function(_0x4df8f0){logger['info'](_0xfd52('0x1d'));return _0x4df8f0[_0xfd52('0x1f')];});}}function getEndUser(_0x2d8e84,_0x32516a,_0x39c7ca){logger[_0xfd52('0x13')](_0xfd52('0x20'),_0x39c7ca);return request({'uri':util[_0xfd52('0xb')](_0xfd52('0x16'),_0x2d8e84['remoteUri']),'qs':{'query':util[_0xfd52('0xb')]('type:user\x20role:end-user\x20phone:%s',_0x39c7ca)}})[_0xfd52('0x12')](function(_0x118c7c){var _0x4d1510;if(_0x118c7c[_0xfd52('0x1b')][_0xfd52('0x21')]){_0x118c7c[_0xfd52('0x1b')]=_[_0xfd52('0x22')](_0x118c7c[_0xfd52('0x1b')],{'suspended':![],'role':_0xfd52('0x23')});if(_0x118c7c[_0xfd52('0x1b')][_0xfd52('0x21')]){_0x4d1510=_['first'](_0x118c7c[_0xfd52('0x1b')]);}}if(_0x4d1510){logger[_0xfd52('0x13')](_0xfd52('0x24'));return _0x4d1510;}else{logger[_0xfd52('0x13')](_0xfd52('0x25'));return request({'uri':util['format'](_0xfd52('0x26'),_0x2d8e84[_0xfd52('0x17')]),'method':'POST','body':{'user':{'role':'end-user','name':util['format'](_0xfd52('0x27'),_0x32516a||_0x39c7ca),'phone':_0x39c7ca}}})[_0xfd52('0x12')](function(_0xe287fb){logger[_0xfd52('0x13')](_0xfd52('0x28'));return _0xe287fb['user'];});}});}function getAuth(_0x12fc0c){var _0x479fdc;if(_0x12fc0c[_0xfd52('0x29')]===_0xfd52('0x2a')){_0x479fdc=util[_0xfd52('0xb')](_0xfd52('0x2b'),_0x12fc0c[_0xfd52('0x2c')],_0x12fc0c['password']);}else if(_0x12fc0c[_0xfd52('0x29')]===_0xfd52('0x2d')){_0x479fdc=util[_0xfd52('0xb')](_0xfd52('0x2e'),_0x12fc0c['username'],_0x12fc0c[_0xfd52('0x2d')]);}return util['format'](_0xfd52('0x2f'),new Buffer(_0x479fdc)[_0xfd52('0x30')](_0xfd52('0x31')));}function request(_0x5b5820){logger[_0xfd52('0x32')](_0xfd52('0x33'),JSON[_0xfd52('0x34')](_0x5b5820));return rp(_[_0xfd52('0x7')](_0x5b5820,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x41689a,_0x556074){var _0x413d42=[];if(_0x41689a&&_0x41689a['length']>0x0){_0x413d42=_[_0xfd52('0x35')](_0x41689a,_0x556074);}return _0x413d42;}function getCustomFields(_0x33e46e,_0x488f00){var _0xe90a4e=[];var _0xc13453={'custom_fields':[]};if(_0x33e46e[_0xfd52('0x21')]>0x0){_[_0xfd52('0x36')](_0x33e46e,function(_0x3d32c0){if(_[_0xfd52('0x37')](['string',_0xfd52('0x38')],_0x3d32c0['type'])&&_0x3d32c0['nameField']&&!_0x3d32c0[_0xfd52('0x39')]){_0xc13453[_0x3d32c0[_0xfd52('0x3a')][_0xfd52('0x3b')]()]=_0x3d32c0[_0xfd52('0x3c')][_0xfd52('0x30')]();}else if(_['includes']([_0xfd52('0x3d'),_0xfd52('0x38')],_0x3d32c0[_0xfd52('0x3e')])&&_0x3d32c0[_0xfd52('0x3f')]&&_0x3d32c0[_0xfd52('0x39')]){_0xc13453[_0xfd52('0x40')][_0xfd52('0x41')]({'id':_0x3d32c0[_0xfd52('0x3f')],'value':_0x3d32c0[_0xfd52('0x3c')][_0xfd52('0x30')]()});}else if(_0x3d32c0[_0xfd52('0x3e')]==='variable'&&_0x3d32c0['variableName']&&_0x3d32c0[_0xfd52('0x3f')]&&_0x3d32c0[_0xfd52('0x39')]){_0x488f00[_0x3d32c0['variableName']]&&_0xc13453[_0xfd52('0x40')][_0xfd52('0x41')]({'id':_0x3d32c0[_0xfd52('0x3f')],'value':_0x488f00[_0x3d32c0[_0xfd52('0x42')]][_0xfd52('0x30')]()});}else if(_0x3d32c0[_0xfd52('0x3e')]===_0xfd52('0x43')&&_0x3d32c0[_0xfd52('0x44')]&&_0x3d32c0['Variable']['name']&&_0x3d32c0[_0xfd52('0x3f')]&&_0x3d32c0['customField']){_0x488f00[_0x3d32c0['Variable'][_0xfd52('0x45')][_0xfd52('0x3b')]()]&&_0xc13453[_0xfd52('0x40')]['push']({'id':_0x3d32c0[_0xfd52('0x3f')],'value':_0x488f00[_0x3d32c0['Variable'][_0xfd52('0x45')][_0xfd52('0x3b')]()][_0xfd52('0x30')]()});}});}return _0xc13453;}exports[_0xfd52('0x46')]=function(_0x2e5a21,_0x4acf93,_0x250881,_0x58d799,_0x2b53c2,_0xdc2b19){var _0x2b0724,_0x1a7e11;_0xdc2b19['remoteUri']=intUtil[_0xfd52('0x47')](_0xdc2b19[_0xfd52('0x17')]);_0xdc2b19[_0xfd52('0x48')]=intUtil[_0xfd52('0x47')](_0xdc2b19[_0xfd52('0x48')]);if(_0x2b53c2&&_0x2b53c2[_0xfd52('0x49')]){logger['info'](_0xfd52('0x4a'),_0xfd52('0x4b'));_0x4acf93[_0xfd52('0x4c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xdc2b19[_0xfd52('0x48')],_0x4acf93[_0xfd52('0x4d')],md5(_0x4acf93[_0xfd52('0x4d')]));}else{_0x4acf93[_0xfd52('0x4c')]='';}headers['Authorization']=getAuth(_0xdc2b19);return getUser(_0xdc2b19,_0x58d799[_0xfd52('0x4e')])[_0xfd52('0x12')](function(_0x9af2b5){_0x2b0724=_0x9af2b5;logger['info'](_0xfd52('0x4f'),_0x2b0724['id']);return getEndUser(_0xdc2b19,_0x4acf93[_0xfd52('0x50')],_0x4acf93[_0xfd52('0x51')]);})[_0xfd52('0x12')](function(_0x1835ae){_0x1a7e11=_0x1835ae;logger[_0xfd52('0x13')](_0xfd52('0x52'),_0x1a7e11['id']);return getTicket(_0xdc2b19,_0x2b0724,_0x1a7e11,_0x250881,_0x4acf93);})[_0xfd52('0x12')](function(_0x108a6a){if(_0x108a6a){logger['info'](_0xfd52('0x53'),_0x108a6a['id']);switch(_0xdc2b19[_0xfd52('0x3e')]){case _0xfd52('0x54'):logger[_0xfd52('0x13')](_0xfd52('0x4a'),_0xfd52('0x55'));return request({'uri':util[_0xfd52('0xb')](_0xfd52('0x56'),_0xdc2b19['remoteUri'],_0x2b0724['id'],_0x108a6a['id']),'method':_0xfd52('0xd')});case _0xfd52('0x57'):logger[_0xfd52('0x13')](_0xfd52('0x4a'),_0xfd52('0x58'));emit(util['format'](_0xfd52('0x59'),_0x58d799[_0xfd52('0x45')]),_0xfd52('0x5a'),{'uri':util[_0xfd52('0xb')](_0xfd52('0x5b'),_0xdc2b19[_0xfd52('0x17')][_0xfd52('0x5c')]('/api/v2',''),_0x108a6a['id'])});break;default:logger[_0xfd52('0x5d')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xfd52('0x5e')](function(_0x29dc6e){logger[_0xfd52('0x5d')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xfd52('0x5f')](_0x29dc6e,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x55bdb3,_0x186503,_0xe95ead,_0x2453ff,_0xc1763f,_0x2f8bc1,_0x5de92d){var _0x628691,_0x315641;_0x2f8bc1[_0xfd52('0x17')]=intUtil['stripTrailingSlash'](_0x2f8bc1[_0xfd52('0x17')]);_0x2f8bc1[_0xfd52('0x48')]=intUtil[_0xfd52('0x47')](_0x2f8bc1[_0xfd52('0x48')]);if(_0x5de92d&&_0x5de92d[_0xfd52('0x60')]&&_0x5de92d['recordingFormat']!==_0xfd52('0x61')){logger[_0xfd52('0x13')](_0xfd52('0x62'),_0xfd52('0x4b'));_0x186503[_0xfd52('0x4c')]=util['format'](_0xfd52('0x63'),_0x2f8bc1[_0xfd52('0x48')],_0x186503['uniqueid'],md5(_0x186503[_0xfd52('0x4d')]));}headers[_0xfd52('0x64')]=getAuth(_0x2f8bc1);return getUser(_0x2f8bc1,_0x2453ff[_0xfd52('0x4e')])[_0xfd52('0x12')](function(_0x5a206b){_0x628691=_0x5a206b;logger['info'](_0xfd52('0x4f'),_0x628691['id']);return getEndUser(_0x2f8bc1,_0x186503[_0xfd52('0x65')],_0x186503[_0xfd52('0x66')]);})[_0xfd52('0x12')](function(_0x24cb85){_0x315641=_0x24cb85;logger['info'](_0xfd52('0x52'),_0x315641['id']);return getTicket(_0x2f8bc1,_0x628691,_0x315641,_0xe95ead,_0x186503);})[_0xfd52('0x12')](function(_0x514a01){if(_0x514a01){logger[_0xfd52('0x13')](_0xfd52('0x53'),_0x514a01['id']);switch(_0x2f8bc1[_0xfd52('0x3e')]){case'integrationTab':logger[_0xfd52('0x13')](_0xfd52('0x62'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xfd52('0xb')](_0xfd52('0x56'),_0x2f8bc1[_0xfd52('0x17')],_0x628691['id'],_0x514a01['id']),'method':_0xfd52('0xd')});case _0xfd52('0x57'):logger[_0xfd52('0x13')](_0xfd52('0x62'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xfd52('0xb')]('user:%s',_0x2453ff[_0xfd52('0x45')]),_0xfd52('0x5a'),{'uri':util[_0xfd52('0xb')](_0xfd52('0x5b'),_0x2f8bc1[_0xfd52('0x17')]['replace'](_0xfd52('0x67'),''),_0x514a01['id'])});break;default:logger[_0xfd52('0x5d')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xfd52('0x5e')](function(_0xbc17c0){logger[_0xfd52('0x5d')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xfd52('0x5f')](_0xbc17c0,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0xaaae3,_0xdbe4b4,_0x4b43d2,_0xc45cf1,_0x15358c,_0x415416){var _0x20a871,_0x4e0087;_0x415416[_0xfd52('0x17')]=intUtil[_0xfd52('0x47')](_0x415416[_0xfd52('0x17')]);_0x415416['serverUrl']=intUtil[_0xfd52('0x47')](_0x415416[_0xfd52('0x48')]);if(_0x15358c&&_0x15358c['monitor_format']){logger[_0xfd52('0x13')]('['+_0xdbe4b4[_0xfd52('0x68')][_0xfd52('0x69')]()+']',_0xfd52('0x4b'));_0xdbe4b4[_0xfd52('0x4c')]=util['format'](_0xfd52('0x63'),_0x415416['serverUrl'],_0xdbe4b4[_0xfd52('0x4d')],md5(_0xdbe4b4[_0xfd52('0x4d')]));}else{_0xdbe4b4['recordingURL']='';}headers['Authorization']=getAuth(_0x415416);return getUser(_0x415416)['then'](function(_0x3ed199){_0x20a871=_0x3ed199;logger[_0xfd52('0x13')]('The\x20User\x20ID\x20is:',_0x20a871['id']);return getEndUser(_0x415416,_0xdbe4b4[_0xfd52('0x50')],_0xdbe4b4['calleridnum']);})[_0xfd52('0x12')](function(_0x29d43b){_0x4e0087=_0x29d43b;logger[_0xfd52('0x13')]('The\x20Enduser\x20ID\x20is:',_0x4e0087['id']);return getTicket(_0x415416,_0x20a871,_0x4e0087,_0x4b43d2,_0xdbe4b4);})['then'](function(_0x39e647){if(_0x39e647){logger[_0xfd52('0x13')]('The\x20Ticket\x20ID\x20is:',_0x39e647['id']);}})[_0xfd52('0x5e')](function(_0x48a63f){logger[_0xfd52('0x5d')]('['+_0xdbe4b4[_0xfd52('0x68')][_0xfd52('0x69')]()+']'+_0xfd52('0x6a'),util['inspect'](_0x48a63f,{'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 f154492..38c0ff0 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 _0x7800=['[QUEUE]','/api/voice/recordings/','uniqueid','recordingURL','zoho.eu','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','/downloads?type=uniqueid&token=','com','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','calleridnum','lodash','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','forEach','includes','string','picklist','type','idField','content','toString','variableName','customVariable','Variable','toLowerCase','indexOf','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','name','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','contact','uri','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','administrator','Subject','Subjects','Description','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','Call_Duration','utc','talktime','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','format','mm:ss','called','Call_Result','complete','connect','rejected','Rejected','abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format'];(function(_0x510645,_0x5349c4){var _0x37623d=function(_0x273d3c){while(--_0x273d3c){_0x510645['push'](_0x510645['shift']());}};_0x37623d(++_0x5349c4);}(_0x7800,0x1ee));var _0x0780=function(_0x51bb24,_0xf0ff9a){_0x51bb24=_0x51bb24-0x0;var _0x1452ee=_0x7800[_0x51bb24];return _0x1452ee;};'use strict';var _=require(_0x0780('0x0'));var rp=require(_0x0780('0x1'));var md5=require(_0x0780('0x2'));var util=require('util');var intUtil=require('./util');var moment=require('moment');var Redis=require(_0x0780('0x3'));var BPromise=require('bluebird');var config=require(_0x0780('0x4'));var logger=require(_0x0780('0x5'))('zoho');config['redis']=_['defaults'](config[_0x0780('0x6')],{'host':_0x0780('0x7'),'port':0x18eb});var io=require(_0x0780('0x8'))(new Redis(config['redis']));function emit(_0x57459a,_0x11815e,_0x9bc2fa){io['to'](_0x57459a)[_0x0780('0x9')](_0x11815e,_0x9bc2fa);}function request(_0x380724){logger[_0x0780('0xa')](_0x0780('0xb'),JSON[_0x0780('0xc')](_0x380724));return rp(_0x380724);}function getCustomFields(_0x56b8c0,_0x1b1ef4){var _0xf68c0={};if(_0x56b8c0['length']>0x0){_[_0x0780('0xd')](_0x56b8c0,function(_0x333f7c){if(_[_0x0780('0xe')]([_0x0780('0xf'),_0x0780('0x10')],_0x333f7c[_0x0780('0x11')])&&_0x333f7c['idField']){_0xf68c0[_0x333f7c[_0x0780('0x12')]]=_0x333f7c[_0x0780('0x13')][_0x0780('0x14')]();}else if(_0x333f7c[_0x0780('0x11')]==='variable'&&_0x333f7c['variableName']&&_0x333f7c[_0x0780('0x12')]&&_0x1b1ef4[_0x333f7c[_0x0780('0x15')]]){_0xf68c0[_0x333f7c['idField']]=_0x1b1ef4[_0x333f7c[_0x0780('0x15')]]['toString']();}else if(_0x333f7c[_0x0780('0x11')]===_0x0780('0x16')&&_0x333f7c[_0x0780('0x17')]&&_0x333f7c[_0x0780('0x17')]['name']&&_0x333f7c[_0x0780('0x12')]&&_0x1b1ef4[_0x333f7c[_0x0780('0x17')]['name'][_0x0780('0x18')]()]){_0xf68c0[_0x333f7c[_0x0780('0x12')]]=_0x1b1ef4[_0x333f7c[_0x0780('0x17')]['name'][_0x0780('0x18')]()][_0x0780('0x14')]();}});}return _0xf68c0;}function getName(_0x14b995){if(_0x14b995[_0x0780('0x19')]('\x20')>0x0){var _0x540ad6=_0x14b995[_0x0780('0x1a')](/ (.+)/);if(_0x540ad6[0x1]){return _0x540ad6;}}return[_0x14b995,_0x14b995];}var accountsTokens={};function getAccessToken(_0x5dd949){return new Promise(function(_0x13daee,_0xef7abf){if(!_[_0x0780('0x1b')](accountsTokens[_0x5dd949['id']])&&!_[_0x0780('0x1b')](accountsTokens[_0x5dd949['id']]['access_token'])){if(moment()[_0x0780('0x1c')](accountsTokens[_0x5dd949['id']][_0x0780('0x1d')])){_0x13daee(accountsTokens[_0x5dd949['id']][_0x0780('0x1e')]);}}var _0x5daf47;switch(_0x5dd949[_0x0780('0x1f')]){case'US':_0x5daf47=_0x0780('0x20');break;case'AU':_0x5daf47=_0x0780('0x21');break;case'EU':_0x5daf47=_0x0780('0x22');break;case'IN':_0x5daf47=_0x0780('0x23');break;case'CN':_0x5daf47=_0x0780('0x24');break;default:_0x5daf47=_0x0780('0x22');break;}var _0x5c18d2={'method':_0x0780('0x25'),'uri':_0x5daf47+_0x0780('0x26'),'qs':{'refresh_token':_0x5dd949[_0x0780('0x27')],'client_id':_0x5dd949['clientId'],'client_secret':_0x5dd949[_0x0780('0x28')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x5c18d2)[_0x0780('0x29')](function(_0x553f49){accountsTokens[_0x5dd949['id']]={'access_token':_0x553f49[_0x0780('0x1e')],'expires_in':moment()[_0x0780('0x2a')](_0x553f49['expires_in'],_0x0780('0x2b'))};_0x13daee(_0x553f49['access_token']);})[_0x0780('0x2c')](function(_0x3b9d6a){logger[_0x0780('0x2d')](_0x0780('0x2e'),_0x3b9d6a[_0x0780('0x2f')]);_0xef7abf(_0x3b9d6a);});});}function getUser(_0x5dd2a1,_0x11401a,_0x432b58,_0x277cfb){logger[_0x0780('0x30')]('Search\x20user');return request({'method':_0x0780('0x31'),'uri':util['format'](_0x0780('0x32'),_0x11401a),'qs':{'type':_0x0780('0x33')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5dd2a1},'json':!![]})['then'](function(_0xc4f95e){if(_0xc4f95e[_0x0780('0x34')]){var _0x19dc51=-0x1;if(_[_0x0780('0x35')](_0xc4f95e[_0x0780('0x34')])){if(!_[_0x0780('0x1b')](_0x277cfb)){_0x19dc51=_['findIndex'](_0xc4f95e['users'],function(_0x4ca9db){return _0x4ca9db[_0x0780('0x36')]===_0x277cfb;});}if(_0x19dc51>=0x0){logger['info'](_0x0780('0x37'));}else{logger[_0x0780('0x30')](_0x0780('0x38'));_0x19dc51=_['findIndex'](_0xc4f95e['users'],function(_0x1b64d5){return _0x1b64d5[_0x0780('0x39')][_0x0780('0x3a')]===_0x0780('0x3b');});}return _0xc4f95e[_0x0780('0x34')][_0x19dc51];}else{if(_0xc4f95e[_0x0780('0x3c')][_0x0780('0x39')][_0x0780('0x3a')]===_0x0780('0x3b')){logger[_0x0780('0x30')]('Using\x20the\x20admin\x20account!');user=_0xc4f95e[_0x0780('0x3c')];return user;}else{logger[_0x0780('0x2d')](_0x0780('0x3d'),JSON[_0x0780('0xc')](_0xc4f95e));throw new Error(_0x0780('0x3e')+JSON[_0x0780('0xc')](_0xc4f95e));}}}else{logger[_0x0780('0x2d')](_0x0780('0x3d'),JSON[_0x0780('0xc')](_0xc4f95e));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x0780('0xc')](_0xc4f95e));}})['catch'](function(_0x1a0761){console[_0x0780('0x2d')](_0x1a0761);});}function getZohoUser(_0x1fc40c,_0x2c872d){return new BPromise(function(_0x4c5e3a,_0x274288){request(_0x1fc40c)['then'](function(_0x3389c1){var _0x1e1c4c=null;if(_0x3389c1){_0x1e1c4c=_0x3389c1[_0x0780('0x3f')][0x0];_0x1e1c4c[_0x0780('0x40')]=_0x2c872d;}_0x4c5e3a(_0x1e1c4c);})[_0x0780('0x2c')](function(_0x10168e){_0x274288(_0x10168e);});});}function createEndUser(_0x4034ed,_0x13e933,_0x5dd6d1,_0x267729,_0xb5fae4,_0x2c59d0){var _0x5dd6d1=getName(_0x5dd6d1);return request({'method':_0x0780('0x25'),'uri':_0x0780('0x41')+_0x13e933+'/crm/v2/'+_[_0x0780('0x42')](_0x2c59d0[_0x0780('0x43')])+'s','body':{'data':[{'Last_Name':_0x5dd6d1[0x1],'First_Name':_0x5dd6d1[0x0],'Phone':_0x267729,'Owner':{'name':!_[_0x0780('0x1b')](_0xb5fae4[_0x0780('0x44')][_0x0780('0x3a')])?_0xb5fae4[_0x0780('0x44')]['name']:!_[_0x0780('0x1b')](_0xb5fae4[_0x0780('0x45')])?_0xb5fae4[_0x0780('0x45')]+'\x20'+_0xb5fae4[_0x0780('0x46')]:_0xb5fae4['last_name'],'id':_0xb5fae4['id']}}]},'headers':{'Authorization':_0x0780('0x47')+_0x4034ed},'json':!![]})[_0x0780('0x29')](function(_0x3ee3b9){if(_0x3ee3b9&&_0x3ee3b9[_0x0780('0x3f')][0x0][_0x0780('0x48')]===_0x0780('0x49')){var _0x6430e6=_0x3ee3b9[_0x0780('0x3f')][0x0][_0x0780('0x4a')];_0x6430e6['enduserType']=_[_0x0780('0x42')](_0x2c59d0[_0x0780('0x43')])+'s';return _0x6430e6;}logger[_0x0780('0x2d')]('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error(_0x0780('0x4b')+JSON[_0x0780('0xc')](data));})[_0x0780('0x2c')](function(_0x543c00){console[_0x0780('0x4c')](_0x0780('0x4d'),_0x543c00);});}function getEndUser(_0x243c41,_0x100a37,_0x60ff23,_0x454acb,_0x446943,_0x46cb07,_0x37564f){var _0x341477={'method':_0x0780('0x31'),'uri':'','headers':{'Authorization':_0x0780('0x47')+_0x243c41},'json':!![]};switch(_0x37564f[_0x0780('0x4e')]){case'contact_lead':_0x341477['uri']=_0x0780('0x41')+_0x100a37+_0x0780('0x4f')+_0x446943+'))';return getZohoUser(_0x341477,_0x0780('0x50'))[_0x0780('0x29')](function(_0x5cfcc7){if(_0x5cfcc7)return _0x5cfcc7;_0x341477['uri']='https://www.zohoapis.'+_0x100a37+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x446943+'))';return getZohoUser(_0x341477,_0x0780('0x51'))['then'](function(_0x1b2544){if(_0x1b2544)return _0x1b2544;if(_0x37564f['moduleCreate']!=_0x0780('0x52')){return createEndUser(_0x243c41,_0x100a37,_0x454acb,_0x446943,_0x46cb07,_0x37564f);}else{return{};}});});break;case _0x0780('0x53'):_0x341477[_0x0780('0x54')]='https://www.zohoapis.'+_0x100a37+_0x0780('0x4f')+_0x446943+'))';return getZohoUser(_0x341477,_0x0780('0x50'))['then'](function(_0x11015e){if(_0x11015e)return _0x11015e;if(_0x37564f['moduleCreate']!=_0x0780('0x52')){return createEndUser(_0x243c41,_0x100a37,_0x454acb,_0x446943,_0x46cb07,_0x37564f);}else{return{};}});break;case _0x0780('0x55'):_0x341477[_0x0780('0x54')]='https://www.zohoapis.'+_0x100a37+_0x0780('0x56')+_0x446943+'))';return getZohoUser(_0x341477,_0x0780('0x51'))[_0x0780('0x29')](function(_0x37f4ba){if(_0x37f4ba)return _0x37f4ba;if(_0x37564f[_0x0780('0x43')]!='nothing'){return createEndUser(_0x243c41,_0x100a37,_0x454acb,_0x446943,_0x46cb07,_0x37564f);}else{return{};}});break;}}function getCall(_0x203d7f,_0x1fa6a0,_0x139736,_0x4053d8,_0x383e5d,_0x35f985,_0x4cff0f,_0x41960e){logger[_0x0780('0x30')](_0x0780('0x57'));var _0x53cffa={};_0x53cffa['Owner']={'name':!_[_0x0780('0x1b')](_0x4053d8[_0x0780('0x44')]['name'])&&!_['isNil'](_0x4053d8[_0x0780('0x39')][_0x0780('0x3a')])&&_0x4053d8[_0x0780('0x39')][_0x0780('0x3a')]===_0x0780('0x58')?_0x4053d8[_0x0780('0x44')][_0x0780('0x3a')]:!_[_0x0780('0x1b')](_0x4053d8[_0x0780('0x45')])?_0x4053d8[_0x0780('0x45')]+'\x20'+_0x4053d8[_0x0780('0x46')]:_0x4053d8[_0x0780('0x46')],'id':_0x4053d8['id']};_0x53cffa[_0x0780('0x59')]=intUtil['getString'](_0x35f985[_0x0780('0x5a')],_0x4cff0f,'\x20');_0x53cffa[_0x0780('0x5b')]=intUtil[_0x0780('0x5c')](_0x35f985[_0x0780('0x5d')],_0x4cff0f,'\x0a');if(_0x383e5d['enduserType']==='Contacts'){_0x53cffa[_0x0780('0x5e')]={'name':!_[_0x0780('0x1b')](_0x383e5d[_0x0780('0x5f')])?_0x383e5d[_0x0780('0x5f')]:!_[_0x0780('0x1b')](_0x383e5d[_0x0780('0x60')])?_0x383e5d[_0x0780('0x60')]+'\x20'+_0x383e5d[_0x0780('0x61')]:_0x383e5d[_0x0780('0x61')],'id':_0x383e5d['id']};}if(_0x383e5d[_0x0780('0x40')]===_0x0780('0x51')){_0x53cffa['What_Id']={'name':!_[_0x0780('0x1b')](_0x383e5d[_0x0780('0x5f')])?_0x383e5d[_0x0780('0x5f')]:!_[_0x0780('0x1b')](_0x383e5d[_0x0780('0x60')])?_0x383e5d['First_Name']+'\x20'+_0x383e5d['Last_Name']:_0x383e5d[_0x0780('0x61')],'id':_0x383e5d['id']};_0x53cffa[_0x0780('0x62')]=_[_0x0780('0x42')](_0x383e5d[_0x0780('0x40')]);}if(_0x4cff0f['talktime']){_0x53cffa[_0x0780('0x63')]=moment[_0x0780('0x64')](parseInt(_0x4cff0f[_0x0780('0x65')])*0x3e8)['format']('mm:ss');}else if(_0x4cff0f[_0x0780('0x66')]&&_0x4cff0f[_0x0780('0x67')]){_0x53cffa[_0x0780('0x63')]=moment[_0x0780('0x64')](moment(_0x4cff0f[_0x0780('0x67')],_0x0780('0x68'))['diff'](moment(_0x4cff0f[_0x0780('0x69')],_0x0780('0x68'))))[_0x0780('0x6a')](_0x0780('0x6b'));}switch(_0x4cff0f['lastevent']){case _0x0780('0x6c'):_0x53cffa[_0x0780('0x6d')]='Called';break;case _0x0780('0x6e'):case _0x0780('0x6f'):_0x53cffa[_0x0780('0x6d')]='Answered';break;case _0x0780('0x70'):_0x53cffa[_0x0780('0x6d')]=_0x0780('0x71');break;case _0x0780('0x72'):_0x53cffa[_0x0780('0x6d')]='Abandoned';break;case _0x0780('0x73'):_0x53cffa[_0x0780('0x6d')]=_0x0780('0x74');default:}_0x53cffa[_0x0780('0x75')]=(_0x41960e===_0x0780('0x76')?moment(_0x4cff0f[_0x0780('0x69')])['format'](_0x0780('0x68')):moment(_0x4cff0f[_0x0780('0x77')])[_0x0780('0x6a')](_0x0780('0x68')))||moment()[_0x0780('0x6a')](_0x0780('0x68'));_0x53cffa['Call_Type']=_0x41960e||_0x0780('0x78');_0x53cffa=_[_0x0780('0x79')](_0x53cffa,getCustomFields(_0x35f985[_0x0780('0x7a')],_0x4cff0f));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x1fa6a0+_0x0780('0x7b'),'headers':{'Authorization':_0x0780('0x47')+_0x203d7f},'body':{'data':[_0x53cffa]},'json':!![]})['then'](function(_0x12012e){if(_0x12012e&&_0x12012e[_0x0780('0x3f')][0x0][_0x0780('0x48')]===_0x0780('0x49')){logger[_0x0780('0x30')](_0x0780('0x7c'));return{'id':_0x12012e[_0x0780('0x3f')][0x0][_0x0780('0x4a')]['id']};}})[_0x0780('0x2c')](function(_0x4b447f){logger[_0x0780('0x30')](_0x0780('0x7d'),_0x4b447f[_0x0780('0x2f')]);console[_0x0780('0x4c')]('err',_0x4b447f);});}exports['queue']=function(_0x6ae1e,_0xc51cb6,_0xfbd835,_0x5e992e,_0x4a2964,_0x178ef6){var _0x61da65,_0x13e199,_0x50a33a;_0x178ef6[_0x0780('0x7e')]=intUtil[_0x0780('0x7f')](_0x178ef6[_0x0780('0x7e')]);_0x178ef6[_0x0780('0x80')]=intUtil[_0x0780('0x7f')](_0x178ef6[_0x0780('0x80')]);if(_0x4a2964&&_0x4a2964[_0x0780('0x81')]){logger[_0x0780('0x30')](_0x0780('0x82'),'Recording\x20is\x20enabled!');_0xc51cb6['recordingURL']=_0x178ef6['serverUrl']+_0x0780('0x83')+_0xc51cb6[_0x0780('0x84')]+'/downloads?type=uniqueid&token='+md5(_0xc51cb6['uniqueid']);}else{_0xc51cb6[_0x0780('0x85')]='';}var _0x39bdd2=_0x178ef6[_0x0780('0x7e')]===_0x0780('0x86')?'eu':'com';return getAccessToken(_0x178ef6)[_0x0780('0x29')](function(_0x1e5097){_0x50a33a=_0x1e5097;return getUser(_0x50a33a,_0x39bdd2,_0x178ef6,_0x5e992e[_0x0780('0x36')]);})[_0x0780('0x29')](function(_0x674fec){_0x61da65=_0x674fec;logger[_0x0780('0x30')](_0x0780('0x87'),_0x61da65['id']);return getEndUser(_0x50a33a,_0x39bdd2,_0x178ef6,_0xc51cb6[_0x0780('0x88')],_0xc51cb6['calleridnum'],_0x61da65,_0xfbd835);})[_0x0780('0x29')](function(_0x2a69f1){_0x13e199=_0x2a69f1;return getCall(_0x50a33a,_0x39bdd2,_0x178ef6,_0x61da65,_0x13e199,_0xfbd835,_0xc51cb6,'Inbound');})[_0x0780('0x29')](function(_0x4bc8fe){if(_0x4bc8fe){logger['info'](_0x0780('0x89'),_0x4bc8fe['id']);logger['info'](_0x0780('0x82'),_0x0780('0x8a'));emit(util[_0x0780('0x6a')](_0x0780('0x8b'),_0x5e992e[_0x0780('0x3a')]),_0x0780('0x8c'),{'uri':_0x0780('0x8d')+_0x178ef6[_0x0780('0x7e')]+_0x0780('0x8e')+_0x4bc8fe['id']});}})[_0x0780('0x2c')](function(_0x5634b5){logger['error'](_0x0780('0x82'),JSON['stringify'](_0x5634b5));});};exports['outbound']=function(_0xbb0890,_0x50533,_0x491181,_0x1f492c,_0x2a56c5,_0x4bedbb,_0x261cef){var _0x5b8bb8,_0x56ddcd,_0x9a2a6e;_0x4bedbb['host']=intUtil[_0x0780('0x7f')](_0x4bedbb[_0x0780('0x7e')]);_0x4bedbb[_0x0780('0x80')]=intUtil[_0x0780('0x7f')](_0x4bedbb[_0x0780('0x80')]);if(_0x261cef&&_0x261cef[_0x0780('0x8f')]&&_0x261cef[_0x0780('0x8f')]!==_0x0780('0x90')){logger[_0x0780('0x30')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x50533[_0x0780('0x85')]=_0x4bedbb[_0x0780('0x80')]+_0x0780('0x83')+_0x50533[_0x0780('0x84')]+_0x0780('0x91')+md5(_0x50533[_0x0780('0x84')]);}var _0x3f5929=_0x4bedbb['host']==='zoho.eu'?'eu':_0x0780('0x92');return getAccessToken(_0x4bedbb)[_0x0780('0x29')](function(_0x4a7ceb){_0x9a2a6e=_0x4a7ceb;return getUser(_0x9a2a6e,_0x3f5929,_0x4bedbb,_0x1f492c[_0x0780('0x36')]);})['then'](function(_0x18c78a){_0x5b8bb8=_0x18c78a;logger['info'](_0x0780('0x87'),_0x5b8bb8['id']);return getEndUser(_0x9a2a6e,_0x3f5929,_0x4bedbb,_0x50533[_0x0780('0x93')],_0x50533[_0x0780('0x94')],_0x5b8bb8,_0x491181);})['then'](function(_0x79c65f){_0x56ddcd=_0x79c65f;return getCall(_0x9a2a6e,_0x3f5929,_0x4bedbb,_0x5b8bb8,_0x56ddcd,_0x491181,_0x50533,_0x0780('0x95'));})[_0x0780('0x29')](function(_0xb94481){if(_0xb94481){logger[_0x0780('0x30')](_0x0780('0x89'),_0xb94481['id']);logger[_0x0780('0x30')](_0x0780('0x96'),_0x0780('0x8a'));emit(util[_0x0780('0x6a')]('user:%s',_0x1f492c['name']),_0x0780('0x8c'),{'uri':'https://crm.'+_0x4bedbb[_0x0780('0x7e')]+'/crm/EntityInfo.do?module=Calls&id='+_0xb94481['id']});}})[_0x0780('0x2c')](function(_0x235ce0){logger[_0x0780('0x2d')](_0x0780('0x96'),JSON['stringify'](_0x235ce0));});};exports[_0x0780('0x97')]=function(_0x3e68db,_0x110084,_0x201ccc,_0xa19d24,_0x540d01,_0x158eb0){var _0x2927b3,_0x51783a,_0x33ffbc;_0x158eb0[_0x0780('0x7e')]=intUtil[_0x0780('0x7f')](_0x158eb0[_0x0780('0x7e')]);_0x158eb0['serverUrl']=intUtil[_0x0780('0x7f')](_0x158eb0[_0x0780('0x80')]);if(_0x540d01&&_0x540d01[_0x0780('0x81')]){logger[_0x0780('0x30')]('['+_0x110084[_0x0780('0x98')][_0x0780('0x99')]()+']',_0x0780('0x9a'));_0x110084[_0x0780('0x85')]=_0x158eb0['serverUrl']+'/api/voice/recordings/'+_0x110084[_0x0780('0x84')]+_0x0780('0x91')+md5(_0x110084[_0x0780('0x84')]);}else{_0x110084[_0x0780('0x85')]='';}var _0x533bcd=_0x158eb0[_0x0780('0x7e')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x158eb0)[_0x0780('0x29')](function(_0x263221){_0x33ffbc=_0x263221;return getUser(_0x33ffbc,_0x533bcd,_0x158eb0);})[_0x0780('0x29')](function(_0x4fe013){_0x2927b3=_0x4fe013;logger['info'](_0x0780('0x87'),_0x2927b3['id']);return getEndUser(_0x33ffbc,_0x533bcd,_0x158eb0,_0x110084[_0x0780('0x88')],_0x110084[_0x0780('0x9b')],_0x2927b3,_0x201ccc);})[_0x0780('0x29')](function(_0x5c5870){_0x51783a=_0x5c5870;return getCall(_0x33ffbc,_0x533bcd,_0x158eb0,_0x2927b3,_0x51783a,_0x201ccc,_0x110084,_0x0780('0x78'));})['then'](function(_0x45d311){if(_0x45d311){logger['info'](_0x0780('0x89'),_0x45d311['id']);}})[_0x0780('0x2c')](function(_0x54afc8){logger['error']('['+_0x110084['lastevent']['toUpperCase']()+']',JSON['stringify'](_0x54afc8));});}; \ No newline at end of file +var _0x69e5=['[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','Outbound','/crm/EntityInfo.do?module=Calls&id=','unmanaged','/downloads?type=uniqueid&token=','com','lastevent','lodash','request-promise','util','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','emit','debug','[HTTP]','length','includes','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','Error:\x20','log','CREATE\x20ERROR','contact_lead','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Owner','Subject','getString','Descriptions','enduserType','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','Call_Result','Called','complete','connect','Answered','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','details','err','queue','host','serverUrl','monitor_format','Recording\x20is\x20enabled!','uniqueid','recordingURL','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:'];(function(_0x3bed47,_0x590122){var _0x34d557=function(_0x115186){while(--_0x115186){_0x3bed47['push'](_0x3bed47['shift']());}};_0x34d557(++_0x590122);}(_0x69e5,0xaa));var _0x569e=function(_0x56138f,_0x1e9ebb){_0x56138f=_0x56138f-0x0;var _0x1acaf7=_0x69e5[_0x56138f];return _0x1acaf7;};'use strict';var _=require(_0x569e('0x0'));var rp=require(_0x569e('0x1'));var md5=require('md5');var util=require(_0x569e('0x2'));var intUtil=require(_0x569e('0x3'));var moment=require(_0x569e('0x4'));var Redis=require(_0x569e('0x5'));var BPromise=require('bluebird');var config=require(_0x569e('0x6'));var logger=require(_0x569e('0x7'))(_0x569e('0x8'));config[_0x569e('0x9')]=_[_0x569e('0xa')](config[_0x569e('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x569e('0x9')]));function emit(_0x12fa5b,_0x2bffee,_0x3d58da){io['to'](_0x12fa5b)[_0x569e('0xb')](_0x2bffee,_0x3d58da);}function request(_0x1b87b2){logger[_0x569e('0xc')](_0x569e('0xd'),JSON['stringify'](_0x1b87b2));return rp(_0x1b87b2);}function getCustomFields(_0x41a188,_0x12ca32){var _0xe0ac5d={};if(_0x41a188[_0x569e('0xe')]>0x0){_['forEach'](_0x41a188,function(_0x12eb72){if(_[_0x569e('0xf')]([_0x569e('0x10'),_0x569e('0x11')],_0x12eb72[_0x569e('0x12')])&&_0x12eb72[_0x569e('0x13')]){_0xe0ac5d[_0x12eb72['idField']]=_0x12eb72['content'][_0x569e('0x14')]();}else if(_0x12eb72[_0x569e('0x12')]===_0x569e('0x15')&&_0x12eb72[_0x569e('0x16')]&&_0x12eb72['idField']&&_0x12ca32[_0x12eb72[_0x569e('0x16')]]){_0xe0ac5d[_0x12eb72['idField']]=_0x12ca32[_0x12eb72['variableName']][_0x569e('0x14')]();}else if(_0x12eb72['type']===_0x569e('0x17')&&_0x12eb72[_0x569e('0x18')]&&_0x12eb72[_0x569e('0x18')]['name']&&_0x12eb72[_0x569e('0x13')]&&_0x12ca32[_0x12eb72[_0x569e('0x18')][_0x569e('0x19')]['toLowerCase']()]){_0xe0ac5d[_0x12eb72[_0x569e('0x13')]]=_0x12ca32[_0x12eb72['Variable'][_0x569e('0x19')][_0x569e('0x1a')]()][_0x569e('0x14')]();}});}return _0xe0ac5d;}function getName(_0x5c640d){if(_0x5c640d['indexOf']('\x20')>0x0){var _0x3b93ea=_0x5c640d[_0x569e('0x1b')](/ (.+)/);if(_0x3b93ea[0x1]){return _0x3b93ea;}}return[_0x5c640d,_0x5c640d];}var accountsTokens={};function getAccessToken(_0x4301b2){return new Promise(function(_0x746bd,_0x49709a){if(!_[_0x569e('0x1c')](accountsTokens[_0x4301b2['id']])&&!_[_0x569e('0x1c')](accountsTokens[_0x4301b2['id']]['access_token'])){if(moment()[_0x569e('0x1d')](accountsTokens[_0x4301b2['id']][_0x569e('0x1e')])){_0x746bd(accountsTokens[_0x4301b2['id']][_0x569e('0x1f')]);}}var _0x57d56b;switch(_0x4301b2[_0x569e('0x20')]){case'US':_0x57d56b=_0x569e('0x21');break;case'AU':_0x57d56b=_0x569e('0x22');break;case'EU':_0x57d56b=_0x569e('0x23');break;case'IN':_0x57d56b=_0x569e('0x24');break;case'CN':_0x57d56b=_0x569e('0x25');break;default:_0x57d56b='https://accounts.zoho.eu';break;}var _0xdb649d={'method':_0x569e('0x26'),'uri':_0x57d56b+_0x569e('0x27'),'qs':{'refresh_token':_0x4301b2[_0x569e('0x28')],'client_id':_0x4301b2[_0x569e('0x29')],'client_secret':_0x4301b2[_0x569e('0x2a')],'grant_type':_0x569e('0x2b')},'json':!![]};return rp(_0xdb649d)[_0x569e('0x2c')](function(_0x242fbf){accountsTokens[_0x4301b2['id']]={'access_token':_0x242fbf[_0x569e('0x1f')],'expires_in':moment()[_0x569e('0x2d')](_0x242fbf['expires_in'],_0x569e('0x2e'))};_0x746bd(_0x242fbf[_0x569e('0x1f')]);})[_0x569e('0x2f')](function(_0x17d28a){logger['error'](_0x569e('0x30'),_0x17d28a[_0x569e('0x31')]);_0x49709a(_0x17d28a);});});}function getUser(_0x5c073e,_0x118a70,_0x521023,_0x2fec55){logger[_0x569e('0x32')]('Search\x20user');return request({'method':_0x569e('0x33'),'uri':util[_0x569e('0x34')]('https://www.zohoapis.%s/crm/v2/users',_0x118a70),'qs':{'type':_0x569e('0x35')},'headers':{'Authorization':_0x569e('0x36')+_0x5c073e},'json':!![]})[_0x569e('0x2c')](function(_0x466f91){if(_0x466f91[_0x569e('0x37')]){var _0x4d97d9=-0x1;if(_[_0x569e('0x38')](_0x466f91[_0x569e('0x37')])){if(!_[_0x569e('0x1c')](_0x2fec55)){_0x4d97d9=_[_0x569e('0x39')](_0x466f91[_0x569e('0x37')],function(_0x31e8ac){return _0x31e8ac[_0x569e('0x3a')]===_0x2fec55;});}if(_0x4d97d9>=0x0){logger[_0x569e('0x32')](_0x569e('0x3b'));}else{logger[_0x569e('0x32')](_0x569e('0x3c'));_0x4d97d9=_['findIndex'](_0x466f91['users'],function(_0xb3ef01){return _0xb3ef01[_0x569e('0x3d')][_0x569e('0x19')]===_0x569e('0x3e');});}return _0x466f91[_0x569e('0x37')][_0x4d97d9];}else{if(_0x466f91['user'][_0x569e('0x3d')]['name']===_0x569e('0x3e')){logger['info'](_0x569e('0x3c'));user=_0x466f91[_0x569e('0x3f')];return user;}else{logger[_0x569e('0x40')](_0x569e('0x41'),JSON[_0x569e('0x42')](_0x466f91));throw new Error(_0x569e('0x43')+JSON[_0x569e('0x42')](_0x466f91));}}}else{logger[_0x569e('0x40')](_0x569e('0x41'),JSON['stringify'](_0x466f91));throw new Error(_0x569e('0x43')+JSON[_0x569e('0x42')](_0x466f91));}})[_0x569e('0x2f')](function(_0x5a347e){console[_0x569e('0x40')](_0x5a347e);});}function getZohoUser(_0x146bf1,_0x103dca){return new BPromise(function(_0x227d56,_0xed0d3b){request(_0x146bf1)['then'](function(_0x445832){var _0x7c9db9=null;if(_0x445832){_0x7c9db9=_0x445832[_0x569e('0x44')][0x0];_0x7c9db9['enduserType']=_0x103dca;}_0x227d56(_0x7c9db9);})[_0x569e('0x2f')](function(_0x5e8535){_0xed0d3b(_0x5e8535);});});}function createEndUser(_0x3eac41,_0x486a06,_0x1ea047,_0xcd8d17,_0x25bd94,_0x212ea3){var _0x1ea047=getName(_0x1ea047);return request({'method':_0x569e('0x26'),'uri':_0x569e('0x45')+_0x486a06+_0x569e('0x46')+_[_0x569e('0x47')](_0x212ea3[_0x569e('0x48')])+'s','body':{'data':[{'Last_Name':_0x1ea047[0x1],'First_Name':_0x1ea047[0x0],'Phone':_0xcd8d17,'Owner':{'name':!_[_0x569e('0x1c')](_0x25bd94[_0x569e('0x49')][_0x569e('0x19')])?_0x25bd94['role']['name']:!_['isNil'](_0x25bd94[_0x569e('0x4a')])?_0x25bd94['first_name']+'\x20'+_0x25bd94[_0x569e('0x4b')]:_0x25bd94[_0x569e('0x4b')],'id':_0x25bd94['id']}}]},'headers':{'Authorization':_0x569e('0x36')+_0x3eac41},'json':!![]})['then'](function(_0xbcc71a){if(_0xbcc71a&&_0xbcc71a[_0x569e('0x44')][0x0][_0x569e('0x4c')]===_0x569e('0x4d')){var _0x2b40a3=_0xbcc71a[_0x569e('0x44')][0x0]['details'];_0x2b40a3['enduserType']=_['startCase'](_0x212ea3['moduleCreate'])+'s';return _0x2b40a3;}logger['error'](_0x569e('0x41'),JSON[_0x569e('0x42')](data));throw new Error(_0x569e('0x4e')+JSON[_0x569e('0x42')](data));})[_0x569e('0x2f')](function(_0x2700e9){console[_0x569e('0x4f')](_0x569e('0x50'),_0x2700e9);});}function getEndUser(_0x4d9abb,_0xfac975,_0x39ef35,_0x2c284c,_0x4491f3,_0x4c175b,_0x4a92ac){var _0x442e33={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4d9abb},'json':!![]};switch(_0x4a92ac['moduleSearch']){case _0x569e('0x51'):_0x442e33['uri']='https://www.zohoapis.'+_0xfac975+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4491f3+'))';return getZohoUser(_0x442e33,_0x569e('0x52'))['then'](function(_0xa24d7c){if(_0xa24d7c)return _0xa24d7c;_0x442e33[_0x569e('0x53')]='https://www.zohoapis.'+_0xfac975+_0x569e('0x54')+_0x4491f3+'))';return getZohoUser(_0x442e33,_0x569e('0x55'))[_0x569e('0x2c')](function(_0x30f6ee){if(_0x30f6ee)return _0x30f6ee;if(_0x4a92ac[_0x569e('0x48')]!=_0x569e('0x56')){return createEndUser(_0x4d9abb,_0xfac975,_0x2c284c,_0x4491f3,_0x4c175b,_0x4a92ac);}else{return{};}});});break;case'contact':_0x442e33['uri']='https://www.zohoapis.'+_0xfac975+_0x569e('0x57')+_0x4491f3+'))';return getZohoUser(_0x442e33,'Contacts')[_0x569e('0x2c')](function(_0x11515d){if(_0x11515d)return _0x11515d;if(_0x4a92ac[_0x569e('0x48')]!=_0x569e('0x56')){return createEndUser(_0x4d9abb,_0xfac975,_0x2c284c,_0x4491f3,_0x4c175b,_0x4a92ac);}else{return{};}});break;case _0x569e('0x58'):_0x442e33[_0x569e('0x53')]=_0x569e('0x45')+_0xfac975+_0x569e('0x54')+_0x4491f3+'))';return getZohoUser(_0x442e33,_0x569e('0x55'))[_0x569e('0x2c')](function(_0x4d9af7){if(_0x4d9af7)return _0x4d9af7;if(_0x4a92ac[_0x569e('0x48')]!=_0x569e('0x56')){return createEndUser(_0x4d9abb,_0xfac975,_0x2c284c,_0x4491f3,_0x4c175b,_0x4a92ac);}else{return{};}});break;}}function getCall(_0x4d1c75,_0x2ae1d4,_0x24e089,_0x33bb44,_0x3bfd92,_0x3a0964,_0x3eb46a,_0x20d63a){logger[_0x569e('0x32')]('Creating\x20new\x20call...');var _0x291f20={};_0x291f20[_0x569e('0x59')]={'name':!_[_0x569e('0x1c')](_0x33bb44[_0x569e('0x49')]['name'])&&!_[_0x569e('0x1c')](_0x33bb44[_0x569e('0x3d')]['name'])&&_0x33bb44[_0x569e('0x3d')][_0x569e('0x19')]==='administrator'?_0x33bb44['role'][_0x569e('0x19')]:!_[_0x569e('0x1c')](_0x33bb44[_0x569e('0x4a')])?_0x33bb44[_0x569e('0x4a')]+'\x20'+_0x33bb44[_0x569e('0x4b')]:_0x33bb44['last_name'],'id':_0x33bb44['id']};_0x291f20[_0x569e('0x5a')]=intUtil['getString'](_0x3a0964['Subjects'],_0x3eb46a,'\x20');_0x291f20['Description']=intUtil[_0x569e('0x5b')](_0x3a0964[_0x569e('0x5c')],_0x3eb46a,'\x0a');if(_0x3bfd92[_0x569e('0x5d')]===_0x569e('0x52')){_0x291f20[_0x569e('0x5e')]={'name':!_[_0x569e('0x1c')](_0x3bfd92[_0x569e('0x5f')])?_0x3bfd92['Full_Name']:!_[_0x569e('0x1c')](_0x3bfd92[_0x569e('0x60')])?_0x3bfd92['First_Name']+'\x20'+_0x3bfd92[_0x569e('0x61')]:_0x3bfd92[_0x569e('0x61')],'id':_0x3bfd92['id']};}if(_0x3bfd92[_0x569e('0x5d')]===_0x569e('0x55')){_0x291f20['What_Id']={'name':!_[_0x569e('0x1c')](_0x3bfd92['Full_Name'])?_0x3bfd92[_0x569e('0x5f')]:!_[_0x569e('0x1c')](_0x3bfd92[_0x569e('0x60')])?_0x3bfd92[_0x569e('0x60')]+'\x20'+_0x3bfd92[_0x569e('0x61')]:_0x3bfd92[_0x569e('0x61')],'id':_0x3bfd92['id']};_0x291f20[_0x569e('0x62')]=_[_0x569e('0x47')](_0x3bfd92['enduserType']);}if(_0x3eb46a[_0x569e('0x63')]){_0x291f20[_0x569e('0x64')]=moment[_0x569e('0x65')](parseInt(_0x3eb46a[_0x569e('0x63')])*0x3e8)[_0x569e('0x34')](_0x569e('0x66'));}else if(_0x3eb46a[_0x569e('0x67')]&&_0x3eb46a[_0x569e('0x68')]){_0x291f20['Call_Duration']=moment[_0x569e('0x65')](moment(_0x3eb46a[_0x569e('0x68')],_0x569e('0x69'))[_0x569e('0x6a')](moment(_0x3eb46a[_0x569e('0x6b')],_0x569e('0x69'))))['format']('mm:ss');}switch(_0x3eb46a['lastevent']){case'called':_0x291f20[_0x569e('0x6c')]=_0x569e('0x6d');break;case _0x569e('0x6e'):case _0x569e('0x6f'):_0x291f20[_0x569e('0x6c')]=_0x569e('0x70');break;case'rejected':_0x291f20[_0x569e('0x6c')]=_0x569e('0x71');break;case _0x569e('0x72'):_0x291f20[_0x569e('0x6c')]=_0x569e('0x73');break;case _0x569e('0x74'):_0x291f20[_0x569e('0x6c')]='Timeout';default:}_0x291f20[_0x569e('0x75')]=(_0x20d63a===_0x569e('0x76')?moment(_0x3eb46a[_0x569e('0x6b')])[_0x569e('0x34')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x3eb46a[_0x569e('0x77')])[_0x569e('0x34')](_0x569e('0x69')))||moment()[_0x569e('0x34')](_0x569e('0x69'));_0x291f20['Call_Type']=_0x20d63a||_0x569e('0x78');_0x291f20=_[_0x569e('0x79')](_0x291f20,getCustomFields(_0x3a0964[_0x569e('0x7a')],_0x3eb46a));return request({'method':_0x569e('0x26'),'uri':'https://www.zohoapis.'+_0x2ae1d4+_0x569e('0x7b'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4d1c75},'body':{'data':[_0x291f20]},'json':!![]})[_0x569e('0x2c')](function(_0x4e96e4){if(_0x4e96e4&&_0x4e96e4[_0x569e('0x44')][0x0]['code']==='SUCCESS'){logger[_0x569e('0x32')]('Call\x20created!');return{'id':_0x4e96e4[_0x569e('0x44')][0x0][_0x569e('0x7c')]['id']};}})[_0x569e('0x2f')](function(_0x5699ae){logger[_0x569e('0x32')](_0x569e('0x7d'),_0x5699ae[_0x569e('0x31')]);console[_0x569e('0x4f')]('err',_0x5699ae);});}exports[_0x569e('0x7e')]=function(_0x384dba,_0xfb44e3,_0x39911a,_0xb711a0,_0x3ec4ec,_0x363e39){var _0xcbe66a,_0x4c8aa9,_0x4a2326;_0x363e39[_0x569e('0x7f')]=intUtil['stripTrailingSlash'](_0x363e39[_0x569e('0x7f')]);_0x363e39['serverUrl']=intUtil['stripTrailingSlash'](_0x363e39[_0x569e('0x80')]);if(_0x3ec4ec&&_0x3ec4ec[_0x569e('0x81')]){logger[_0x569e('0x32')]('[QUEUE]',_0x569e('0x82'));_0xfb44e3['recordingURL']=_0x363e39['serverUrl']+'/api/voice/recordings/'+_0xfb44e3[_0x569e('0x83')]+'/downloads?type=uniqueid&token='+md5(_0xfb44e3[_0x569e('0x83')]);}else{_0xfb44e3[_0x569e('0x84')]='';}var _0x2c9462=_0x363e39[_0x569e('0x7f')]===_0x569e('0x85')?'eu':'com';return getAccessToken(_0x363e39)[_0x569e('0x2c')](function(_0x3154c2){_0x4a2326=_0x3154c2;return getUser(_0x4a2326,_0x2c9462,_0x363e39,_0xb711a0[_0x569e('0x3a')]);})['then'](function(_0x8a0258){_0xcbe66a=_0x8a0258;logger[_0x569e('0x32')](_0x569e('0x86'),_0xcbe66a['id']);return getEndUser(_0x4a2326,_0x2c9462,_0x363e39,_0xfb44e3[_0x569e('0x87')],_0xfb44e3[_0x569e('0x88')],_0xcbe66a,_0x39911a);})[_0x569e('0x2c')](function(_0x2a8d60){_0x4c8aa9=_0x2a8d60;return getCall(_0x4a2326,_0x2c9462,_0x363e39,_0xcbe66a,_0x4c8aa9,_0x39911a,_0xfb44e3,_0x569e('0x78'));})['then'](function(_0x516746){if(_0x516746){logger[_0x569e('0x32')](_0x569e('0x89'),_0x516746['id']);logger[_0x569e('0x32')](_0x569e('0x8a'),_0x569e('0x8b'));emit(util[_0x569e('0x34')](_0x569e('0x8c'),_0xb711a0[_0x569e('0x19')]),_0x569e('0x8d'),{'uri':_0x569e('0x8e')+_0x363e39[_0x569e('0x7f')]+'/crm/EntityInfo.do?module=Calls&id='+_0x516746['id']});}})[_0x569e('0x2f')](function(_0x256894){logger[_0x569e('0x40')](_0x569e('0x8a'),JSON[_0x569e('0x42')](_0x256894));});};exports['outbound']=function(_0xeacbcc,_0x1e9e24,_0x2cc63a,_0x23a1d0,_0x15f123,_0x23caff,_0x3a87c8){var _0x219c43,_0x48d4c0,_0x33fd87;_0x23caff['host']=intUtil['stripTrailingSlash'](_0x23caff[_0x569e('0x7f')]);_0x23caff['serverUrl']=intUtil[_0x569e('0x8f')](_0x23caff[_0x569e('0x80')]);if(_0x3a87c8&&_0x3a87c8[_0x569e('0x90')]&&_0x3a87c8[_0x569e('0x90')]!==_0x569e('0x91')){logger[_0x569e('0x32')](_0x569e('0x92'),_0x569e('0x82'));_0x1e9e24[_0x569e('0x84')]=_0x23caff[_0x569e('0x80')]+_0x569e('0x93')+_0x1e9e24[_0x569e('0x83')]+'/downloads?type=uniqueid&token='+md5(_0x1e9e24['uniqueid']);}var _0x38dd91=_0x23caff[_0x569e('0x7f')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x23caff)[_0x569e('0x2c')](function(_0x48e090){_0x33fd87=_0x48e090;return getUser(_0x33fd87,_0x38dd91,_0x23caff,_0x23a1d0['email']);})['then'](function(_0x58e0c6){_0x219c43=_0x58e0c6;logger['info'](_0x569e('0x86'),_0x219c43['id']);return getEndUser(_0x33fd87,_0x38dd91,_0x23caff,_0x1e9e24['destcalleridname'],_0x1e9e24['destcalleridnum'],_0x219c43,_0x2cc63a);})[_0x569e('0x2c')](function(_0x197bd2){_0x48d4c0=_0x197bd2;return getCall(_0x33fd87,_0x38dd91,_0x23caff,_0x219c43,_0x48d4c0,_0x2cc63a,_0x1e9e24,_0x569e('0x94'));})[_0x569e('0x2c')](function(_0x143210){if(_0x143210){logger[_0x569e('0x32')](_0x569e('0x89'),_0x143210['id']);logger[_0x569e('0x32')](_0x569e('0x92'),_0x569e('0x8b'));emit(util['format'](_0x569e('0x8c'),_0x23a1d0[_0x569e('0x19')]),_0x569e('0x8d'),{'uri':_0x569e('0x8e')+_0x23caff['host']+_0x569e('0x95')+_0x143210['id']});}})[_0x569e('0x2f')](function(_0x1d01cf){logger[_0x569e('0x40')](_0x569e('0x92'),JSON[_0x569e('0x42')](_0x1d01cf));});};exports[_0x569e('0x96')]=function(_0x19efb2,_0x512fc7,_0x5c5d3e,_0x3d5fd9,_0x58fc9f,_0x515711){var _0x1decec,_0x54f186,_0x58cbbc;_0x515711[_0x569e('0x7f')]=intUtil[_0x569e('0x8f')](_0x515711[_0x569e('0x7f')]);_0x515711['serverUrl']=intUtil[_0x569e('0x8f')](_0x515711[_0x569e('0x80')]);if(_0x58fc9f&&_0x58fc9f[_0x569e('0x81')]){logger['info']('['+_0x512fc7['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x512fc7[_0x569e('0x84')]=_0x515711[_0x569e('0x80')]+'/api/voice/recordings/'+_0x512fc7[_0x569e('0x83')]+_0x569e('0x97')+md5(_0x512fc7[_0x569e('0x83')]);}else{_0x512fc7[_0x569e('0x84')]='';}var _0x2928cb=_0x515711[_0x569e('0x7f')]===_0x569e('0x85')?'eu':_0x569e('0x98');return getAccessToken(_0x515711)[_0x569e('0x2c')](function(_0x2b1d6c){_0x58cbbc=_0x2b1d6c;return getUser(_0x58cbbc,_0x2928cb,_0x515711);})[_0x569e('0x2c')](function(_0x3f6ea8){_0x1decec=_0x3f6ea8;logger['info'](_0x569e('0x86'),_0x1decec['id']);return getEndUser(_0x58cbbc,_0x2928cb,_0x515711,_0x512fc7[_0x569e('0x87')],_0x512fc7[_0x569e('0x88')],_0x1decec,_0x5c5d3e);})['then'](function(_0x5c186b){_0x54f186=_0x5c186b;return getCall(_0x58cbbc,_0x2928cb,_0x515711,_0x1decec,_0x54f186,_0x5c5d3e,_0x512fc7,_0x569e('0x78'));})[_0x569e('0x2c')](function(_0x42c562){if(_0x42c562){logger[_0x569e('0x32')](_0x569e('0x89'),_0x42c562['id']);}})[_0x569e('0x2f')](function(_0x4fac91){logger[_0x569e('0x40')]('['+_0x512fc7[_0x569e('0x99')]['toUpperCase']()+']',JSON[_0x569e('0x42')](_0x4fac91));});}; \ 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 dcc8a13..bbb7b42 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 _0x354b=['exec','data2','Script','data3','render','info','format','util','shelljs','mustache','../../../../config/logger','trigger'];(function(_0x1d408d,_0x2fef27){var _0x112a98=function(_0x5615a8){while(--_0x5615a8){_0x1d408d['push'](_0x1d408d['shift']());}};_0x112a98(++_0x2fef27);}(_0x354b,0x67));var _0xb354=function(_0x125f8b,_0x192ef7){_0x125f8b=_0x125f8b-0x0;var _0x54372d=_0x354b[_0x125f8b];return _0x54372d;};'use strict';var util=require(_0xb354('0x0'));var sh=require(_0xb354('0x1'));var Mustache=require(_0xb354('0x2'));var logger=require(_0xb354('0x3'))(_0xb354('0x4'));exports[_0xb354('0x5')]=function(_0x161d25,_0xe1bd15){var _0x2aa486=_0x161d25['data2']?_0x161d25[_0xb354('0x6')]:_0xb354('0x7');var _0x4e50e8=_0x161d25[_0xb354('0x8')]?Mustache[_0xb354('0x9')](_0x161d25[_0xb354('0x8')],_0xe1bd15):_0xe1bd15;sh[_0xb354('0x5')](_0x4e50e8,function(_0x55bdc1,_0x2c2805,_0x1d583f){if(_0x55bdc1!==0x0){logger['error'](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x2aa486,_0x4e50e8,_0x55bdc1,_0x1d583f));}else{logger[_0xb354('0xa')](util[_0xb354('0xb')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x2aa486,_0x4e50e8,_0x2c2805));}});}; \ No newline at end of file +var _0xc4b8=['Script','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','data2'];(function(_0xc08f00,_0x28067f){var _0x8649f7=function(_0x25f9a2){while(--_0x25f9a2){_0xc08f00['push'](_0xc08f00['shift']());}};_0x8649f7(++_0x28067f);}(_0xc4b8,0x94));var _0x8c4b=function(_0x595902,_0x46dac9){_0x595902=_0x595902-0x0;var _0x24ed4f=_0xc4b8[_0x595902];return _0x24ed4f;};'use strict';var util=require(_0x8c4b('0x0'));var sh=require(_0x8c4b('0x1'));var Mustache=require(_0x8c4b('0x2'));var logger=require(_0x8c4b('0x3'))(_0x8c4b('0x4'));exports['exec']=function(_0x4ebf4a,_0x4db572){var _0x4b5a35=_0x4ebf4a[_0x8c4b('0x5')]?_0x4ebf4a[_0x8c4b('0x5')]:_0x8c4b('0x6');var _0x4ab7f8=_0x4ebf4a[_0x8c4b('0x7')]?Mustache[_0x8c4b('0x8')](_0x4ebf4a[_0x8c4b('0x7')],_0x4db572):_0x4db572;sh['exec'](_0x4ab7f8,function(_0x5ab737,_0x84aaa,_0x3688f7){if(_0x5ab737!==0x0){logger[_0x8c4b('0x9')](util['format'](_0x8c4b('0xa'),_0x4b5a35,_0x4ab7f8,_0x5ab737,_0x3688f7));}else{logger[_0x8c4b('0xb')](util[_0x8c4b('0xc')](_0x8c4b('0xd'),_0x4b5a35,_0x4ab7f8,_0x84aaa));}});}; \ 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 c03e89a..29b7b1f 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 _0xa40b=['error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','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','message','request-promise','util','lodash','mustache','../../../../config/logger','data1','render','data2','data5','number','parse','data6','stack','toUpperCase','GET','DELETE','POST','PUT','data7'];(function(_0x3092a9,_0x368f31){var _0x3282cb=function(_0xbdedaa){while(--_0xbdedaa){_0x3092a9['push'](_0x3092a9['shift']());}};_0x3282cb(++_0x368f31);}(_0xa40b,0xc6));var _0xba40=function(_0x37bc32,_0x5eb587){_0x37bc32=_0x37bc32-0x0;var _0x17392d=_0xa40b[_0x37bc32];return _0x17392d;};'use strict';var rp=require(_0xba40('0x0'));var util=require(_0xba40('0x1'));var _=require(_0xba40('0x2'));var Mustache=require(_0xba40('0x3'));var logger=require(_0xba40('0x4'))('trigger');exports['exec']=function(_0x5e92d4,_0x3afd43){var _0x36fad4,_0x16fcba;var _0x5cd011={'method':_0x5e92d4[_0xba40('0x5')]['toUpperCase'](),'uri':Mustache[_0xba40('0x6')](_0x5e92d4[_0xba40('0x7')],_0x3afd43),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5e92d4[_0xba40('0x8')])===_0xba40('0x9')&&parseInt(_0x5e92d4[_0xba40('0x8')])>=0x1&&parseInt(_0x5e92d4[_0xba40('0x8')])<=0xa?parseInt(_0x5e92d4[_0xba40('0x8')])*0x3e8:0x5*0x3e8};try{_0x5cd011['headers']=_0x5e92d4['data6']?JSON[_0xba40('0xa')](Mustache[_0xba40('0x6')](_0x5e92d4[_0xba40('0xb')],_0x3afd43)):{};}catch(_0x2a1f89){logger['error'](_0x2a1f89[_0xba40('0xc')]);}switch(_0x5e92d4['data1'][_0xba40('0xd')]()){case _0xba40('0xe'):case _0xba40('0xf'):_0x36fad4=null;_0x5cd011['qs']=_0x3afd43;break;case _0xba40('0x10'):case _0xba40('0x11'):if(_0x5e92d4[_0xba40('0x12')]){try{_0x36fad4=JSON[_0xba40('0xa')](Mustache[_0xba40('0x6')](_0x5e92d4[_0xba40('0x12')],_0x3afd43));_0x5cd011['body']=_0x36fad4;}catch(_0x575a31){logger[_0xba40('0x13')](_0x575a31[_0xba40('0xc')]);logger[_0xba40('0x13')](_0xba40('0x14'));}}else{_0x36fad4=_0x3afd43;_0x5cd011[_0xba40('0x15')]=_0x36fad4;}break;}logger[_0xba40('0x16')](util['format'](_0xba40('0x17'),_0x5e92d4['data1'],_0x5e92d4[_0xba40('0x7')],JSON[_0xba40('0x18')](_0x5cd011)));rp(_0x5cd011)['then'](function(_0x41d201){_0x36fad4=!_['isNil'](_0x36fad4)?',\x20request\x20body:\x20'+_0x36fad4:'';_0x16fcba=typeof _0x41d201[_0xba40('0x15')]===_0xba40('0x19')?JSON[_0xba40('0x18')](_0x41d201[_0xba40('0x15')]):_0x41d201[_0xba40('0x15')];logger['info'](util[_0xba40('0x1a')](_0xba40('0x1b'),_0x5e92d4['data1'],_0x5e92d4[_0xba40('0x7')],_0x41d201[_0xba40('0x1c')],_0x16fcba));})['catch'](function(_0x44b30d){logger['error'](util[_0xba40('0x1a')](_0xba40('0x1d'),_0x5e92d4[_0xba40('0x5')],_0x5e92d4['data2'],_0x44b30d['statusCode'],_0x44b30d['name'],_0x44b30d[_0xba40('0x1e')]));});}; \ No newline at end of file +var _0xa5fb=['util','lodash','mustache','../../../../config/logger','trigger','exec','toUpperCase','data2','data5','number','headers','data6','parse','render','error','data1','GET','DELETE','POST','PUT','data7','body','stack','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','request-promise'];(function(_0xbe48c2,_0x3db103){var _0x39a679=function(_0x195d37){while(--_0x195d37){_0xbe48c2['push'](_0xbe48c2['shift']());}};_0x39a679(++_0x3db103);}(_0xa5fb,0x197));var _0xba5f=function(_0x1048c7,_0x1963e9){_0x1048c7=_0x1048c7-0x0;var _0x584b47=_0xa5fb[_0x1048c7];return _0x584b47;};'use strict';var rp=require(_0xba5f('0x0'));var util=require(_0xba5f('0x1'));var _=require(_0xba5f('0x2'));var Mustache=require(_0xba5f('0x3'));var logger=require(_0xba5f('0x4'))(_0xba5f('0x5'));exports[_0xba5f('0x6')]=function(_0x3dabfe,_0x2dfbd2){var _0x226bdf,_0x11e4e0;var _0x45c7d3={'method':_0x3dabfe['data1'][_0xba5f('0x7')](),'uri':Mustache['render'](_0x3dabfe[_0xba5f('0x8')],_0x2dfbd2),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3dabfe[_0xba5f('0x9')])===_0xba5f('0xa')&&parseInt(_0x3dabfe[_0xba5f('0x9')])>=0x1&&parseInt(_0x3dabfe[_0xba5f('0x9')])<=0xa?parseInt(_0x3dabfe[_0xba5f('0x9')])*0x3e8:0x5*0x3e8};try{_0x45c7d3[_0xba5f('0xb')]=_0x3dabfe[_0xba5f('0xc')]?JSON[_0xba5f('0xd')](Mustache[_0xba5f('0xe')](_0x3dabfe[_0xba5f('0xc')],_0x2dfbd2)):{};}catch(_0x3f3d8a){logger[_0xba5f('0xf')](_0x3f3d8a['stack']);}switch(_0x3dabfe[_0xba5f('0x10')]['toUpperCase']()){case _0xba5f('0x11'):case _0xba5f('0x12'):_0x226bdf=null;_0x45c7d3['qs']=_0x2dfbd2;break;case _0xba5f('0x13'):case _0xba5f('0x14'):if(_0x3dabfe[_0xba5f('0x15')]){try{_0x226bdf=JSON[_0xba5f('0xd')](Mustache[_0xba5f('0xe')](_0x3dabfe[_0xba5f('0x15')],_0x2dfbd2));_0x45c7d3[_0xba5f('0x16')]=_0x226bdf;}catch(_0x8b03b0){logger['error'](_0x8b03b0[_0xba5f('0x17')]);logger[_0xba5f('0xf')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x226bdf=_0x2dfbd2;_0x45c7d3[_0xba5f('0x16')]=_0x226bdf;}break;}logger[_0xba5f('0x18')](util['format'](_0xba5f('0x19'),_0x3dabfe[_0xba5f('0x10')],_0x3dabfe['data2'],JSON[_0xba5f('0x1a')](_0x45c7d3)));rp(_0x45c7d3)[_0xba5f('0x1b')](function(_0x3bb1e9){_0x226bdf=!_['isNil'](_0x226bdf)?_0xba5f('0x1c')+_0x226bdf:'';_0x11e4e0=typeof _0x3bb1e9[_0xba5f('0x16')]===_0xba5f('0x1d')?JSON[_0xba5f('0x1a')](_0x3bb1e9[_0xba5f('0x16')]):_0x3bb1e9[_0xba5f('0x16')];logger[_0xba5f('0x18')](util['format'](_0xba5f('0x1e'),_0x3dabfe[_0xba5f('0x10')],_0x3dabfe[_0xba5f('0x8')],_0x3bb1e9[_0xba5f('0x1f')],_0x11e4e0));})[_0xba5f('0x20')](function(_0x3ca7bb){logger[_0xba5f('0xf')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x3dabfe['data1'],_0x3dabfe[_0xba5f('0x8')],_0x3ca7bb[_0xba5f('0x1f')],_0x3ca7bb[_0xba5f('0x21')],_0x3ca7bb['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 05481fb..9db9ae2 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 _0xc8e3=['client','then','debug','rpc','routing','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x25b837,_0x3a82fa){var _0x46e839=function(_0x49926e){while(--_0x49926e){_0x25b837['push'](_0x25b837['shift']());}};_0x46e839(++_0x3a82fa);}(_0xc8e3,0x1b7));var _0x3c8e=function(_0x487e48,_0x232219){_0x487e48=_0x487e48-0x0;var _0x934dbb=_0xc8e3[_0x487e48];return _0x934dbb;};'use strict';var jayson=require(_0x3c8e('0x0'));var BPromise=require(_0x3c8e('0x1'));var logger=require(_0x3c8e('0x2'))('routing');var client=jayson[_0x3c8e('0x3')]['http']({'port':0x2329});client['Request']=function(_0x53329e,_0x11f79e){return new BPromise(function(_0xb72298,_0x36e9f0){return client['request'](_0x53329e,_0x11f79e)[_0x3c8e('0x4')](function(_0xd1c04e){logger[_0x3c8e('0x5')](_0x3c8e('0x6'),_0x3c8e('0x7'),_0x53329e,_0x11f79e,_0xd1c04e);if(_0xd1c04e[_0x3c8e('0x8')]){logger[_0x3c8e('0x8')](_0x3c8e('0x6'),_0x3c8e('0x7'),_0x53329e,_0xd1c04e[_0x3c8e('0x8')][_0x3c8e('0x9')],_0x11f79e);return _0x36e9f0(_0xd1c04e[_0x3c8e('0x8')][_0x3c8e('0x9')]);}else{return _0xb72298(_0xd1c04e[_0x3c8e('0xa')]);}})[_0x3c8e('0xb')](function(_0x49c5b3){logger[_0x3c8e('0x8')](_0x3c8e('0x6'),_0x3c8e('0x7'),_0x53329e,_0x49c5b3,_0x11f79e);return _0x36e9f0(_0x49c5b3);});});};module[_0x3c8e('0xc')]=client; \ No newline at end of file +var _0x0b72=['message','result','catch','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','debug','rpc','error'];(function(_0x39b02d,_0x16bf39){var _0xcd84d1=function(_0x33ea1c){while(--_0x33ea1c){_0x39b02d['push'](_0x39b02d['shift']());}};_0xcd84d1(++_0x16bf39);}(_0x0b72,0x1d7));var _0x20b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b72[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0x20b7('0x0'));var BPromise=require(_0x20b7('0x1'));var logger=require(_0x20b7('0x2'))(_0x20b7('0x3'));var client=jayson[_0x20b7('0x4')][_0x20b7('0x5')]({'port':0x2329});client[_0x20b7('0x6')]=function(_0x4caf9d,_0x555d7c){return new BPromise(function(_0x2faa08,_0x26f1e7){return client['request'](_0x4caf9d,_0x555d7c)['then'](function(_0x4c35f6){logger[_0x20b7('0x7')](_0x20b7('0x8'),_0x20b7('0x3'),_0x4caf9d,_0x555d7c,_0x4c35f6);if(_0x4c35f6[_0x20b7('0x9')]){logger[_0x20b7('0x9')](_0x20b7('0x8'),'routing',_0x4caf9d,_0x4c35f6[_0x20b7('0x9')]['message'],_0x555d7c);return _0x26f1e7(_0x4c35f6[_0x20b7('0x9')][_0x20b7('0xa')]);}else{return _0x2faa08(_0x4c35f6[_0x20b7('0xb')]);}})[_0x20b7('0xc')](function(_0x380beb){logger[_0x20b7('0x9')](_0x20b7('0x8'),_0x20b7('0x3'),_0x4caf9d,_0x380beb,_0x555d7c);return _0x26f1e7(_0x380beb);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index db1382e..630c4e0 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 _0x5787=['getSettings','catch','error','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','email','then','getMailAccounts','initMailAccounts','refresh','mailAccounts'];(function(_0x3a1c40,_0x4d8058){var _0x3c9ec8=function(_0x40a8f2){while(--_0x40a8f2){_0x3a1c40['push'](_0x3a1c40['shift']());}};_0x3c9ec8(++_0x4d8058);}(_0x5787,0x8f));var _0x7578=function(_0x4f4436,_0x4d4af7){_0x4f4436=_0x4f4436-0x0;var _0x6b8aa7=_0x5787[_0x4f4436];return _0x6b8aa7;};'use strict';var server=require(_0x7578('0x0'));var Realtime=require(_0x7578('0x1'));var EmailChannel=require(_0x7578('0x2'));var mailAccount=require(_0x7578('0x3'));var setting=require(_0x7578('0x4'));var logger=require('../../config/logger')(_0x7578('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x7578('0x6')](mailAccount[_0x7578('0x7')]())[_0x7578('0x6')](realtime[_0x7578('0x8')]())[_0x7578('0x6')](function(){email[_0x7578('0x9')](realtime[_0x7578('0xa')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x7578('0x6')](function(){return initRealtime();})[_0x7578('0x6')](function(){return setting[_0x7578('0xb')]();})[_0x7578('0x6')](function(_0x46184a){return setInterval(initRealtime,_0x46184a['loginMailFrequency']*0x3e8);})[_0x7578('0xc')](function(_0x19cb0b){logger[_0x7578('0xd')]('Email\x20service\x20initialization',_0x19cb0b);});}main(); \ No newline at end of file +var _0x3e00=['./rpc/mailAccount','./rpc/setting','email','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email'];(function(_0x47445f,_0x16412a){var _0x2f4e6a=function(_0x5b7ee9){while(--_0x5b7ee9){_0x47445f['push'](_0x47445f['shift']());}};_0x2f4e6a(++_0x16412a);}(_0x3e00,0x13d));var _0x03e0=function(_0x58742e,_0x117309){_0x58742e=_0x58742e-0x0;var _0x568619=_0x3e00[_0x58742e];return _0x568619;};'use strict';var server=require(_0x03e0('0x0'));var Realtime=require(_0x03e0('0x1'));var EmailChannel=require(_0x03e0('0x2'));var mailAccount=require(_0x03e0('0x3'));var setting=require(_0x03e0('0x4'));var logger=require('../../config/logger')(_0x03e0('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x03e0('0x6')](mailAccount[_0x03e0('0x7')]())[_0x03e0('0x6')](realtime[_0x03e0('0x8')]())[_0x03e0('0x6')](function(){email[_0x03e0('0x9')](realtime[_0x03e0('0xa')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x03e0('0x6')](function(){return initRealtime();})[_0x03e0('0x6')](function(){return setting[_0x03e0('0xb')]();})[_0x03e0('0x6')](function(_0x17a2a8){return setInterval(initRealtime,_0x17a2a8[_0x03e0('0xc')]*0x3e8);})[_0x03e0('0xd')](function(_0x517d07){logger[_0x03e0('0xe')](_0x03e0('0xf'),_0x517d07);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index ef8f893..c01f525 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 _0xad4e=['refresh','hasOwnProperty','service','custom','provider','box','bind','handleImapEmail','handleImapEnd','error','handleImapError','disabled','handleImapBox','connected','messages','firstName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','send','verifySmtp','Smtp','verify','exports','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./smtp','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','active','Imap','status','messageStatus','total','isNil','stringify','md5','mailAccount:update'];(function(_0x36f0ea,_0x42b43c){var _0x208b43=function(_0x1871b2){while(--_0x1871b2){_0x36f0ea['push'](_0x36f0ea['shift']());}};_0x208b43(++_0x42b43c);}(_0xad4e,0x86));var _0xead4=function(_0x20ab38,_0x4bf6f2){_0x20ab38=_0x20ab38-0x0;var _0x1c489e=_0xad4e[_0x20ab38];return _0x1c489e;};'use strict';var _=require(_0xead4('0x0'));var moment=require(_0xead4('0x1'));var BPromise=require(_0xead4('0x2'));var md5=require('md5');var Redis=require(_0xead4('0x3'));var config=require(_0xead4('0x4'));var logger=require(_0xead4('0x5'))(_0xead4('0x6'));config[_0xead4('0x7')]=_[_0xead4('0x8')](config[_0xead4('0x7')],{'host':_0xead4('0x9'),'port':0x18eb});var io=require(_0xead4('0xa'))(new Redis(config[_0xead4('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require(_0xead4('0xb'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x1c372a){logger[_0xead4('0xc')]('start\x20email\x20channel');this[_0xead4('0xd')]=_0x1c372a[_0xead4('0xd')];this[_0xead4('0xe')]={};this[_0xead4('0xf')]=new EmailSmtp();}EmailChannel[_0xead4('0x10')][_0xead4('0x11')]=function(_0x1ba5ae){var _0xfd7304=this['mailAccounts'][_0x1ba5ae];var _0x1ede3a={'id':_0xfd7304['id'],'name':_0xfd7304[_0xead4('0x12')],'key':_0xfd7304['key'],'active':_0xfd7304[_0xead4('0x13')],'Imap':{'status':_0xfd7304[_0xead4('0x14')][_0xead4('0x15')],'messageStatus':_0xfd7304[_0xead4('0x14')][_0xead4('0x16')],'total':_0xfd7304['Imap'][_0xead4('0x17')]}};if(_[_0xead4('0x18')](md5Accounts[_0x1ba5ae])){md5Accounts[_0x1ba5ae]={};}var _0x3335e2=md5(JSON[_0xead4('0x19')](_0x1ede3a));if(md5Accounts[_0x1ba5ae][_0xead4('0x1a')]!==_0x3335e2){md5Accounts[_0x1ba5ae][_0xead4('0x1a')]=_0x3335e2;io[_0xead4('0x11')](_0xead4('0x1b'),_0x1ede3a);}};EmailChannel[_0xead4('0x10')][_0xead4('0x1c')]=function(_0x28ab48){for(var _0x116d7a in _0x28ab48){if(_0x28ab48[_0xead4('0x1d')](_0x116d7a)){if(_0x28ab48[_0x116d7a]['Imap']&&_0x28ab48[_0x116d7a][_0xead4('0x13')]){var _0x4a4f25=_0x28ab48[_0x116d7a][_0xead4('0x14')];if(!_0x4a4f25[_0xead4('0x1e')]&&_0x28ab48[_0x116d7a]['provider']!==_0xead4('0x1f'))_0x4a4f25['service']=_0x28ab48[_0x116d7a][_0xead4('0x20')];if(!this['imapAccounts'][_0xead4('0x1d')](_0x4a4f25['id'])){this['imapAccounts'][_0x4a4f25['id']]=new EmailImap(_0x4a4f25,_0x28ab48[_0x116d7a][_0xead4('0x6')]);this['imapAccounts'][_0x4a4f25['id']]['on'](_0xead4('0x21'),this['handleImapBox'][_0xead4('0x22')](this,_0x116d7a));this[_0xead4('0xe')][_0x4a4f25['id']]['on']('email',this[_0xead4('0x23')][_0xead4('0x22')](this,_0x116d7a));this[_0xead4('0xe')][_0x4a4f25['id']]['on']('end',this[_0xead4('0x24')][_0xead4('0x22')](this,_0x116d7a));this[_0xead4('0xe')][_0x4a4f25['id']]['on'](_0xead4('0x25'),this[_0xead4('0x26')][_0xead4('0x22')](this,_0x116d7a));}}else{if(_[_0xead4('0x18')](this[_0xead4('0xd')][_0x116d7a][_0xead4('0x14')])){this[_0xead4('0xd')][_0x116d7a][_0xead4('0x14')]={};}this['mailAccounts'][_0x116d7a][_0xead4('0x14')][_0xead4('0x15')]=_0xead4('0x27');this[_0xead4('0xd')][_0x116d7a][_0xead4('0x14')][_0xead4('0x16')]='';this['emit'](_0x116d7a);}}}};EmailChannel[_0xead4('0x10')][_0xead4('0x28')]=function(_0x1bf8d4,_0xf62584){if(this[_0xead4('0xd')][_0x1bf8d4]){this['mailAccounts'][_0x1bf8d4][_0xead4('0x14')][_0xead4('0x15')]=_0xead4('0x29');this[_0xead4('0xd')][_0x1bf8d4][_0xead4('0x14')][_0xead4('0x16')]=_0xf62584['name'];if(_0xf62584[_0xead4('0x2a')]){this[_0xead4('0xd')][_0x1bf8d4][_0xead4('0x14')][_0xead4('0x17')]=_0xf62584['messages'][_0xead4('0x17')];}return this[_0xead4('0x11')](_0x1bf8d4);}};EmailChannel['prototype'][_0xead4('0x23')]=function(_0x580b91,_0x5c09c8){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x5c09c8[_0xead4('0x2b')],_0x5c09c8['lastName'],_0x5c09c8[_0xead4('0x2c')],_0x580b91);if(this[_0xead4('0xd')][_0x580b91]){return mailAccount['notify'](_0x580b91,_0x5c09c8)[_0xead4('0x2d')](function(_0x169d3c){if(_0x169d3c){logger[_0xead4('0xc')](_0xead4('0x2e'));}})[_0xead4('0x2f')](function(_0x2cdb01){logger[_0xead4('0x25')](_0xead4('0x30'),JSON[_0xead4('0x19')](_0x2cdb01));});}};EmailChannel['prototype'][_0xead4('0x24')]=function(_0x316f03){if(this[_0xead4('0xd')][_0x316f03]&&this['mailAccounts'][_0x316f03][_0xead4('0x14')]){if(this[_0xead4('0xe')][this[_0xead4('0xd')][_0x316f03]['Imap']['id']]){delete this[_0xead4('0xe')][this[_0xead4('0xd')][_0x316f03][_0xead4('0x14')]['id']];}this[_0xead4('0xd')][_0x316f03][_0xead4('0x14')]['lastSync']=moment();this['emit'](_0x316f03);}};EmailChannel[_0xead4('0x10')][_0xead4('0x26')]=function(_0x3d342b,_0x3552ab){if(this['mailAccounts'][_0x3d342b]){this['mailAccounts'][_0x3d342b]['Imap'][_0xead4('0x15')]=_0xead4('0x25');this[_0xead4('0xd')][_0x3d342b][_0xead4('0x14')][_0xead4('0x16')]=_0x3552ab;return this[_0xead4('0x11')](_0x3d342b);}};EmailChannel[_0xead4('0x10')]['sendMail']=function(_0x193a63,_0x4cda5a){return this[_0xead4('0xf')][_0xead4('0x31')](_0x193a63,_0x4cda5a);};EmailChannel[_0xead4('0x10')][_0xead4('0x32')]=function(_0x1964b1){var _0x5d0f2e=this;if(this[_0xead4('0xd')][_0x1964b1['id']]){if(_[_0xead4('0x18')](this[_0xead4('0xd')][_0x1964b1['id']][_0xead4('0x33')])){this[_0xead4('0xd')][_0x1964b1['id']]['Smtp']={};}this[_0xead4('0xd')][_0x1964b1['id']][_0xead4('0x33')]['lastSync']=moment();return new BPromise(function(_0xf57359,_0x3631eb){return _0x5d0f2e[_0xead4('0xf')][_0xead4('0x34')](_0x1964b1)[_0xead4('0x2d')](function(_0x53e730){_0x5d0f2e['mailAccounts'][_0x1964b1['id']][_0xead4('0x33')][_0xead4('0x15')]='verified';_0x5d0f2e[_0xead4('0xd')][_0x1964b1['id']][_0xead4('0x33')][_0xead4('0x16')]='';_0x5d0f2e[_0xead4('0x11')](_0x1964b1['id']);_0xf57359(_0x53e730);})[_0xead4('0x2f')](function(_0x2768ec){_0x5d0f2e[_0xead4('0xd')][_0x1964b1['id']]['Smtp'][_0xead4('0x15')]=_0xead4('0x25');_0x5d0f2e[_0xead4('0xd')][_0x1964b1['id']][_0xead4('0x33')]['messageStatus']=_0x2768ec;_0x5d0f2e[_0xead4('0x11')](_0x1964b1['id']);_0x3631eb(_0x2768ec);});});}return this['smtp'][_0xead4('0x34')](_0x1964b1);};module[_0xead4('0x35')]=EmailChannel; \ No newline at end of file +var _0x9a71=['active','Imap','total','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','service','custom','provider','imapAccounts','box','handleImapBox','handleImapEmail','end','handleImapEnd','bind','error','handleImapError','disabled','messageStatus','status','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','exports','moment','ioredis','../../../config/environment','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','smtp','prototype','emit'];(function(_0x48cc2c,_0x4d56cb){var _0x39adce=function(_0x166e63){while(--_0x166e63){_0x48cc2c['push'](_0x48cc2c['shift']());}};_0x39adce(++_0x4d56cb);}(_0x9a71,0x18c));var _0x19a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a71[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require(_0x19a7('0x0'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0x19a7('0x1'));var config=require(_0x19a7('0x2'));var logger=require(_0x19a7('0x3'))(_0x19a7('0x4'));config['redis']=_[_0x19a7('0x5')](config[_0x19a7('0x6')],{'host':_0x19a7('0x7'),'port':0x18eb});var io=require(_0x19a7('0x8'))(new Redis(config['redis']));var EmailImap=require(_0x19a7('0x9'));var EmailSmtp=require(_0x19a7('0xa'));var mailAccount=require(_0x19a7('0xb'));var md5Accounts={};function EmailChannel(_0x5e7bc4){logger[_0x19a7('0xc')]('start\x20email\x20channel');this[_0x19a7('0xd')]=_0x5e7bc4[_0x19a7('0xd')];this['imapAccounts']={};this[_0x19a7('0xe')]=new EmailSmtp();}EmailChannel[_0x19a7('0xf')][_0x19a7('0x10')]=function(_0xe94dbd){var _0x2c476e=this['mailAccounts'][_0xe94dbd];var _0x4fadf5={'id':_0x2c476e['id'],'name':_0x2c476e['name'],'key':_0x2c476e['key'],'active':_0x2c476e[_0x19a7('0x11')],'Imap':{'status':_0x2c476e[_0x19a7('0x12')]['status'],'messageStatus':_0x2c476e[_0x19a7('0x12')]['messageStatus'],'total':_0x2c476e[_0x19a7('0x12')][_0x19a7('0x13')]}};if(_[_0x19a7('0x14')](md5Accounts[_0xe94dbd])){md5Accounts[_0xe94dbd]={};}var _0xa7b9a5=md5(JSON[_0x19a7('0x15')](_0x4fadf5));if(md5Accounts[_0xe94dbd][_0x19a7('0x16')]!==_0xa7b9a5){md5Accounts[_0xe94dbd][_0x19a7('0x16')]=_0xa7b9a5;io[_0x19a7('0x10')](_0x19a7('0x17'),_0x4fadf5);}};EmailChannel['prototype'][_0x19a7('0x18')]=function(_0x4b8db3){for(var _0x58db3f in _0x4b8db3){if(_0x4b8db3[_0x19a7('0x19')](_0x58db3f)){if(_0x4b8db3[_0x58db3f][_0x19a7('0x12')]&&_0x4b8db3[_0x58db3f][_0x19a7('0x11')]){var _0xa2a066=_0x4b8db3[_0x58db3f]['Imap'];if(!_0xa2a066[_0x19a7('0x1a')]&&_0x4b8db3[_0x58db3f]['provider']!==_0x19a7('0x1b'))_0xa2a066[_0x19a7('0x1a')]=_0x4b8db3[_0x58db3f][_0x19a7('0x1c')];if(!this[_0x19a7('0x1d')]['hasOwnProperty'](_0xa2a066['id'])){this[_0x19a7('0x1d')][_0xa2a066['id']]=new EmailImap(_0xa2a066,_0x4b8db3[_0x58db3f][_0x19a7('0x4')]);this[_0x19a7('0x1d')][_0xa2a066['id']]['on'](_0x19a7('0x1e'),this[_0x19a7('0x1f')]['bind'](this,_0x58db3f));this[_0x19a7('0x1d')][_0xa2a066['id']]['on'](_0x19a7('0x4'),this[_0x19a7('0x20')]['bind'](this,_0x58db3f));this[_0x19a7('0x1d')][_0xa2a066['id']]['on'](_0x19a7('0x21'),this[_0x19a7('0x22')][_0x19a7('0x23')](this,_0x58db3f));this[_0x19a7('0x1d')][_0xa2a066['id']]['on'](_0x19a7('0x24'),this[_0x19a7('0x25')][_0x19a7('0x23')](this,_0x58db3f));}}else{if(_['isNil'](this[_0x19a7('0xd')][_0x58db3f]['Imap'])){this[_0x19a7('0xd')][_0x58db3f]['Imap']={};}this[_0x19a7('0xd')][_0x58db3f]['Imap']['status']=_0x19a7('0x26');this[_0x19a7('0xd')][_0x58db3f][_0x19a7('0x12')][_0x19a7('0x27')]='';this[_0x19a7('0x10')](_0x58db3f);}}}};EmailChannel['prototype'][_0x19a7('0x1f')]=function(_0x5932ba,_0x554d25){if(this[_0x19a7('0xd')][_0x5932ba]){this[_0x19a7('0xd')][_0x5932ba]['Imap'][_0x19a7('0x28')]=_0x19a7('0x29');this[_0x19a7('0xd')][_0x5932ba][_0x19a7('0x12')][_0x19a7('0x27')]=_0x554d25[_0x19a7('0x2a')];if(_0x554d25[_0x19a7('0x2b')]){this['mailAccounts'][_0x5932ba][_0x19a7('0x12')][_0x19a7('0x13')]=_0x554d25[_0x19a7('0x2b')][_0x19a7('0x13')];}return this['emit'](_0x5932ba);}};EmailChannel['prototype'][_0x19a7('0x20')]=function(_0x3bc6ea,_0x2638bd){logger['info'](_0x19a7('0x2c'),_0x2638bd['firstName'],_0x2638bd[_0x19a7('0x2d')],_0x2638bd[_0x19a7('0x2e')],_0x3bc6ea);if(this[_0x19a7('0xd')][_0x3bc6ea]){return mailAccount[_0x19a7('0x2f')](_0x3bc6ea,_0x2638bd)[_0x19a7('0x30')](function(_0x3eb5f9){if(_0x3eb5f9){logger[_0x19a7('0xc')](_0x19a7('0x31'));}})[_0x19a7('0x32')](function(_0x297231){logger[_0x19a7('0x24')](_0x19a7('0x33'),JSON[_0x19a7('0x15')](_0x297231));});}};EmailChannel[_0x19a7('0xf')][_0x19a7('0x22')]=function(_0x20036c){if(this[_0x19a7('0xd')][_0x20036c]&&this[_0x19a7('0xd')][_0x20036c][_0x19a7('0x12')]){if(this[_0x19a7('0x1d')][this['mailAccounts'][_0x20036c]['Imap']['id']]){delete this[_0x19a7('0x1d')][this[_0x19a7('0xd')][_0x20036c][_0x19a7('0x12')]['id']];}this['mailAccounts'][_0x20036c]['Imap'][_0x19a7('0x34')]=moment();this[_0x19a7('0x10')](_0x20036c);}};EmailChannel[_0x19a7('0xf')][_0x19a7('0x25')]=function(_0x2910cc,_0x467da3){if(this['mailAccounts'][_0x2910cc]){this[_0x19a7('0xd')][_0x2910cc]['Imap'][_0x19a7('0x28')]='error';this[_0x19a7('0xd')][_0x2910cc][_0x19a7('0x12')][_0x19a7('0x27')]=_0x467da3;return this[_0x19a7('0x10')](_0x2910cc);}};EmailChannel['prototype'][_0x19a7('0x35')]=function(_0x118172,_0x4f992b){return this[_0x19a7('0xe')][_0x19a7('0x36')](_0x118172,_0x4f992b);};EmailChannel[_0x19a7('0xf')][_0x19a7('0x37')]=function(_0x3aac90){var _0x3c84e9=this;if(this['mailAccounts'][_0x3aac90['id']]){if(_[_0x19a7('0x14')](this[_0x19a7('0xd')][_0x3aac90['id']][_0x19a7('0x38')])){this[_0x19a7('0xd')][_0x3aac90['id']][_0x19a7('0x38')]={};}this[_0x19a7('0xd')][_0x3aac90['id']]['Smtp'][_0x19a7('0x34')]=moment();return new BPromise(function(_0x44b03d,_0x2dc942){return _0x3c84e9[_0x19a7('0xe')][_0x19a7('0x39')](_0x3aac90)[_0x19a7('0x30')](function(_0x97d48f){_0x3c84e9[_0x19a7('0xd')][_0x3aac90['id']]['Smtp'][_0x19a7('0x28')]='verified';_0x3c84e9['mailAccounts'][_0x3aac90['id']]['Smtp'][_0x19a7('0x27')]='';_0x3c84e9[_0x19a7('0x10')](_0x3aac90['id']);_0x44b03d(_0x97d48f);})['catch'](function(_0x436569){_0x3c84e9[_0x19a7('0xd')][_0x3aac90['id']][_0x19a7('0x38')][_0x19a7('0x28')]=_0x19a7('0x24');_0x3c84e9[_0x19a7('0xd')][_0x3aac90['id']][_0x19a7('0x38')]['messageStatus']=_0x436569;_0x3c84e9[_0x19a7('0x10')](_0x3aac90['id']);_0x2dc942(_0x436569);});});}return this['smtp']['verify'](_0x3aac90);};module[_0x19a7('0x3a')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 784db95..1d2b549 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 _0x8792=['handleMessageAttributes','handleMessageEnd','handleSimpleParser','handleEnd','stringify','textCode','upperFirst','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','getAccount','account','once','ready','handleReady','bind','end','error','handleError','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','password','anonymous@xcally.com','host','port','tls','required','openBox','mailbox','handleOpenBox','emit','readUnseen','handleCloseBox','search','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x8792,0xc1));var _0x2879=function(_0x18de9b,_0x1ccc26){_0x18de9b=_0x18de9b-0x0;var _0x374980=_0x8792[_0x18de9b];return _0x374980;};'use strict';var _=require(_0x2879('0x0'));var util=require(_0x2879('0x1'));var Imap=require(_0x2879('0x2'));var simpleParser=require(_0x2879('0x3'))[_0x2879('0x4')];var Iconv=require(_0x2879('0x5'))[_0x2879('0x6')];var EventEmitter=require(_0x2879('0x7'))[_0x2879('0x8')];var utils=require(_0x2879('0x9'));var logger=require(_0x2879('0xa'))(_0x2879('0xb'));function EmailImap(_0x3cd2b9,_0x4337c8){this['mailbox']=_0x3cd2b9['mailbox'];this['account']=this[_0x2879('0xc')](_0x3cd2b9,_0x4337c8);this['imap']=new Imap(this[_0x2879('0xd')]);this[_0x2879('0x2')][_0x2879('0xe')](_0x2879('0xf'),this[_0x2879('0x10')][_0x2879('0x11')](this));this[_0x2879('0x2')]['once'](_0x2879('0x12'),this['handleEnd'][_0x2879('0x11')](this));this[_0x2879('0x2')]['on'](_0x2879('0x13'),this[_0x2879('0x14')]['bind'](this));this[_0x2879('0x2')]['connect']();}util[_0x2879('0x15')](EmailImap,EventEmitter);EmailImap[_0x2879('0x16')][_0x2879('0xc')]=function(_0x56a0a2,_0x504623){var _0x157c4b={'connTimeout':_0x56a0a2['connTimeout']?_0x56a0a2[_0x2879('0x17')]*0x3e8:0x2710,'authTimeout':_0x56a0a2[_0x2879('0x18')]?_0x56a0a2[_0x2879('0x18')]*0x3e8:0x1388};if(_0x56a0a2[_0x2879('0x19')]){_0x157c4b[_0x2879('0x1a')]=_0x56a0a2[_0x2879('0x1a')];if(_0x56a0a2[_0x2879('0x1b')]){_0x157c4b['xoauth2']=utils[_0x2879('0x1c')](_0x56a0a2[_0x2879('0x1d')][_0x2879('0x1e')],_0x56a0a2[_0x2879('0x1a')]);}else{_0x157c4b[_0x2879('0x1f')]=_0x56a0a2['password'];}}else{if(_0x56a0a2['authentication']){_0x157c4b['user']=_0x56a0a2[_0x2879('0x1a')];_0x157c4b[_0x2879('0x1f')]=_0x56a0a2[_0x2879('0x1f')];}}_0x157c4b[_0x2879('0xb')]=_0x504623||_0x56a0a2[_0x2879('0x1a')]||_0x2879('0x20');_0x157c4b[_0x2879('0x21')]=_0x56a0a2['host'];_0x157c4b[_0x2879('0x22')]=_0x56a0a2[_0x2879('0x22')]||0x3e1;if(_0x56a0a2[_0x2879('0x23')]){_0x157c4b['tls']=!![];}else{_0x157c4b[_0x2879('0x23')]=![];_0x157c4b['autotls']=_0x2879('0x24');}return _0x157c4b;};EmailImap[_0x2879('0x16')][_0x2879('0x10')]=function(){this[_0x2879('0x2')][_0x2879('0x25')](this[_0x2879('0x26')],![],this[_0x2879('0x27')]['bind'](this));};EmailImap[_0x2879('0x16')][_0x2879('0x27')]=function(_0x1f153d,_0x19acfa){if(_0x1f153d){this['handleError'](_0x1f153d,!![]);}else{this[_0x2879('0x28')]('box',_0x19acfa);this[_0x2879('0x29')]();}};EmailImap[_0x2879('0x16')][_0x2879('0x2a')]=function(_0x481c08){if(_0x481c08){this[_0x2879('0x14')](_0x481c08,!![]);}else{this[_0x2879('0x2')]['end']();}};EmailImap[_0x2879('0x16')]['readUnseen']=function(){this[_0x2879('0x2')][_0x2879('0x2b')](['UNSEEN'],this[_0x2879('0x2c')][_0x2879('0x11')](this));};EmailImap[_0x2879('0x16')]['handleReadUnseen']=function(_0x133cdc,_0x6b9944){if(_0x133cdc){this[_0x2879('0x14')](_0x133cdc,!![]);}else{if(_0x6b9944[_0x2879('0x2d')]){try{var _0x4473cf=this[_0x2879('0x2')][_0x2879('0x2e')](_0x6b9944,{'bodies':'','markSeen':!![]});_0x4473cf['on'](_0x2879('0x2f'),this[_0x2879('0x30')][_0x2879('0x11')](this));_0x4473cf[_0x2879('0xe')](_0x2879('0x13'),this[_0x2879('0x31')][_0x2879('0x11')](this));_0x4473cf[_0x2879('0xe')]('end',this[_0x2879('0x32')][_0x2879('0x11')](this));}catch(_0x1afeef){logger[_0x2879('0x13')](_0x1afeef);}}else{this[_0x2879('0x2')][_0x2879('0x33')](!![],this['handleCloseBox'][_0x2879('0x11')](this));}}};EmailImap[_0x2879('0x16')][_0x2879('0x30')]=function(_0x51268f){_0x51268f['on'](_0x2879('0x34'),this[_0x2879('0x35')][_0x2879('0x11')](this));_0x51268f[_0x2879('0xe')](_0x2879('0x36'),this[_0x2879('0x37')][_0x2879('0x11')](this));_0x51268f[_0x2879('0xe')](_0x2879('0x12'),this[_0x2879('0x38')][_0x2879('0x11')](this));};EmailImap[_0x2879('0x16')][_0x2879('0x35')]=function(_0x2d7ef6){simpleParser(_0x2d7ef6,{'Iconv':Iconv},this[_0x2879('0x39')][_0x2879('0x11')](this));};EmailImap['prototype'][_0x2879('0x37')]=function(){};EmailImap[_0x2879('0x16')][_0x2879('0x38')]=function(){};EmailImap[_0x2879('0x16')][_0x2879('0x39')]=function(_0x3826a3,_0xaccec1){if(_0x3826a3){logger[_0x2879('0x13')](_0x3826a3);}else{var _0x3fb524=this;utils['parser'](this[_0x2879('0xd')],_0xaccec1,function(_0x1fac9e){_0x3fb524[_0x2879('0x28')](_0x2879('0xb'),_0x1fac9e);});}};EmailImap[_0x2879('0x16')][_0x2879('0x32')]=function(){this[_0x2879('0x2')][_0x2879('0x33')](!![],this[_0x2879('0x2a')][_0x2879('0x11')](this));};EmailImap[_0x2879('0x16')][_0x2879('0x31')]=function(_0x232694){this[_0x2879('0x14')](_0x232694);this[_0x2879('0x2')][_0x2879('0x33')](!![],this[_0x2879('0x2a')][_0x2879('0x11')](this));};EmailImap[_0x2879('0x16')][_0x2879('0x3a')]=function(){this[_0x2879('0x28')](_0x2879('0x12'));};EmailImap['prototype'][_0x2879('0x14')]=function(_0x5a4429,_0x4e2932){logger[_0x2879('0x13')](_0x2879('0x14'),this[_0x2879('0xd')][_0x2879('0xb')],JSON[_0x2879('0x3b')](_0x5a4429));var _0x52c08c='';if(_0x5a4429){if(_0x5a4429[_0x2879('0x3c')]){_0x52c08c=_0x5a4429[_0x2879('0x3c')];}else{for(var _0x1852f2 in _0x5a4429){if(_0x5a4429['hasOwnProperty'](_0x1852f2)){_0x52c08c+=_[_0x2879('0x3d')](_0x1852f2)+':\x20'+_0x5a4429[_0x1852f2]+'\x0a';}}}}if(_0x4e2932){this['imap'][_0x2879('0x12')]();}else{this[_0x2879('0x28')](_0x2879('0x13'),_0x52c08c);this[_0x2879('0x28')]('end');}};module['exports']=EmailImap; \ No newline at end of file +var _0xd66f=['textCode','hasOwnProperty','upperFirst','exports','lodash','imap','mailparser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','getAccount','account','ready','handleReady','bind','end','error','connect','inherits','prototype','connTimeout','service','user','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','handleError','search','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','once','handleFetchEnd','closeBox','body','handleMessageBody','handleSimpleParser','handleMessageAttributes','handleMessageEnd','handleEnd','stringify'];(function(_0x37905e,_0x297eb8){var _0x36ed9c=function(_0x38fef2){while(--_0x38fef2){_0x37905e['push'](_0x37905e['shift']());}};_0x36ed9c(++_0x297eb8);}(_0xd66f,0xc1));var _0xfd66=function(_0xffeebf,_0x2d6582){_0xffeebf=_0xffeebf-0x0;var _0xec5ce4=_0xd66f[_0xffeebf];return _0xec5ce4;};'use strict';var _=require(_0xfd66('0x0'));var util=require('util');var Imap=require(_0xfd66('0x1'));var simpleParser=require(_0xfd66('0x2'))['simpleParser'];var Iconv=require(_0xfd66('0x3'))[_0xfd66('0x4')];var EventEmitter=require(_0xfd66('0x5'))[_0xfd66('0x6')];var utils=require(_0xfd66('0x7'));var logger=require(_0xfd66('0x8'))(_0xfd66('0x9'));function EmailImap(_0x375a88,_0x1b0f0b){this['mailbox']=_0x375a88[_0xfd66('0xa')];this['account']=this[_0xfd66('0xb')](_0x375a88,_0x1b0f0b);this[_0xfd66('0x1')]=new Imap(this[_0xfd66('0xc')]);this['imap']['once'](_0xfd66('0xd'),this[_0xfd66('0xe')][_0xfd66('0xf')](this));this[_0xfd66('0x1')]['once'](_0xfd66('0x10'),this['handleEnd'][_0xfd66('0xf')](this));this[_0xfd66('0x1')]['on'](_0xfd66('0x11'),this['handleError'][_0xfd66('0xf')](this));this[_0xfd66('0x1')][_0xfd66('0x12')]();}util[_0xfd66('0x13')](EmailImap,EventEmitter);EmailImap[_0xfd66('0x14')][_0xfd66('0xb')]=function(_0x4cc443,_0x2d7704){var _0x462cba={'connTimeout':_0x4cc443[_0xfd66('0x15')]?_0x4cc443[_0xfd66('0x15')]*0x3e8:0x2710,'authTimeout':_0x4cc443['authTimeout']?_0x4cc443['authTimeout']*0x3e8:0x1388};if(_0x4cc443[_0xfd66('0x16')]){_0x462cba['user']=_0x4cc443[_0xfd66('0x17')];if(_0x4cc443['modernAuthentication']){_0x462cba[_0xfd66('0x18')]=utils[_0xfd66('0x19')](_0x4cc443[_0xfd66('0x1a')][_0xfd66('0x1b')],_0x4cc443[_0xfd66('0x17')]);}else{_0x462cba[_0xfd66('0x1c')]=_0x4cc443[_0xfd66('0x1c')];}}else{if(_0x4cc443[_0xfd66('0x1d')]){_0x462cba[_0xfd66('0x17')]=_0x4cc443[_0xfd66('0x17')];_0x462cba['password']=_0x4cc443[_0xfd66('0x1c')];}}_0x462cba[_0xfd66('0x9')]=_0x2d7704||_0x4cc443['user']||_0xfd66('0x1e');_0x462cba[_0xfd66('0x1f')]=_0x4cc443[_0xfd66('0x1f')];_0x462cba[_0xfd66('0x20')]=_0x4cc443['port']||0x3e1;if(_0x4cc443[_0xfd66('0x21')]){_0x462cba[_0xfd66('0x21')]=!![];}else{_0x462cba[_0xfd66('0x21')]=![];_0x462cba[_0xfd66('0x22')]='required';}return _0x462cba;};EmailImap['prototype'][_0xfd66('0xe')]=function(){this['imap'][_0xfd66('0x23')](this[_0xfd66('0xa')],![],this[_0xfd66('0x24')][_0xfd66('0xf')](this));};EmailImap[_0xfd66('0x14')][_0xfd66('0x24')]=function(_0x3ef28e,_0x253838){if(_0x3ef28e){this['handleError'](_0x3ef28e,!![]);}else{this[_0xfd66('0x25')](_0xfd66('0x26'),_0x253838);this[_0xfd66('0x27')]();}};EmailImap[_0xfd66('0x14')][_0xfd66('0x28')]=function(_0x537195){if(_0x537195){this[_0xfd66('0x29')](_0x537195,!![]);}else{this['imap'][_0xfd66('0x10')]();}};EmailImap['prototype'][_0xfd66('0x27')]=function(){this['imap'][_0xfd66('0x2a')](['UNSEEN'],this[_0xfd66('0x2b')][_0xfd66('0xf')](this));};EmailImap['prototype'][_0xfd66('0x2b')]=function(_0x51a0be,_0x38e7d7){if(_0x51a0be){this[_0xfd66('0x29')](_0x51a0be,!![]);}else{if(_0x38e7d7[_0xfd66('0x2c')]){try{var _0x48e4b1=this[_0xfd66('0x1')][_0xfd66('0x2d')](_0x38e7d7,{'bodies':'','markSeen':!![]});_0x48e4b1['on'](_0xfd66('0x2e'),this[_0xfd66('0x2f')][_0xfd66('0xf')](this));_0x48e4b1['once'](_0xfd66('0x11'),this[_0xfd66('0x30')][_0xfd66('0xf')](this));_0x48e4b1[_0xfd66('0x31')]('end',this[_0xfd66('0x32')]['bind'](this));}catch(_0x10b361){logger[_0xfd66('0x11')](_0x10b361);}}else{this[_0xfd66('0x1')][_0xfd66('0x33')](!![],this[_0xfd66('0x28')][_0xfd66('0xf')](this));}}};EmailImap[_0xfd66('0x14')][_0xfd66('0x2f')]=function(_0x1d1241){_0x1d1241['on'](_0xfd66('0x34'),this['handleMessageBody'][_0xfd66('0xf')](this));_0x1d1241['once']('attributes',this['handleMessageAttributes']['bind'](this));_0x1d1241[_0xfd66('0x31')](_0xfd66('0x10'),this['handleMessageEnd']['bind'](this));};EmailImap[_0xfd66('0x14')][_0xfd66('0x35')]=function(_0x95137f){simpleParser(_0x95137f,{'Iconv':Iconv},this[_0xfd66('0x36')][_0xfd66('0xf')](this));};EmailImap['prototype'][_0xfd66('0x37')]=function(){};EmailImap[_0xfd66('0x14')][_0xfd66('0x38')]=function(){};EmailImap[_0xfd66('0x14')][_0xfd66('0x36')]=function(_0x480265,_0x1e3e4d){if(_0x480265){logger[_0xfd66('0x11')](_0x480265);}else{var _0x5733e8=this;utils['parser'](this[_0xfd66('0xc')],_0x1e3e4d,function(_0x35ee54){_0x5733e8[_0xfd66('0x25')](_0xfd66('0x9'),_0x35ee54);});}};EmailImap[_0xfd66('0x14')][_0xfd66('0x32')]=function(){this[_0xfd66('0x1')][_0xfd66('0x33')](!![],this['handleCloseBox'][_0xfd66('0xf')](this));};EmailImap[_0xfd66('0x14')][_0xfd66('0x30')]=function(_0x234541){this['handleError'](_0x234541);this[_0xfd66('0x1')][_0xfd66('0x33')](!![],this[_0xfd66('0x28')][_0xfd66('0xf')](this));};EmailImap['prototype'][_0xfd66('0x39')]=function(){this[_0xfd66('0x25')]('end');};EmailImap[_0xfd66('0x14')][_0xfd66('0x29')]=function(_0xc9f809,_0x3dc6a5){logger[_0xfd66('0x11')]('handleError',this[_0xfd66('0xc')][_0xfd66('0x9')],JSON[_0xfd66('0x3a')](_0xc9f809));var _0x25c54c='';if(_0xc9f809){if(_0xc9f809[_0xfd66('0x3b')]){_0x25c54c=_0xc9f809['textCode'];}else{for(var _0x1aadaa in _0xc9f809){if(_0xc9f809[_0xfd66('0x3c')](_0x1aadaa)){_0x25c54c+=_[_0xfd66('0x3d')](_0x1aadaa)+':\x20'+_0xc9f809[_0x1aadaa]+'\x0a';}}}}if(_0x3dc6a5){this[_0xfd66('0x1')][_0xfd66('0x10')]();}else{this[_0xfd66('0x25')](_0xfd66('0x11'),_0x25c54c);this[_0xfd66('0x25')]('end');}};module[_0xfd66('0x3e')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index e63aa82..45d44cf 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 _0x2ee0=['exports','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired'];(function(_0x15c3cf,_0x21184c){var _0x110afc=function(_0x380520){while(--_0x380520){_0x15c3cf['push'](_0x15c3cf['shift']());}};_0x110afc(++_0x21184c);}(_0x2ee0,0x9b));var _0x02ee=function(_0x11a694,_0x16854a){_0x11a694=_0x11a694-0x0;var _0x10b5b9=_0x2ee0[_0x11a694];return _0x10b5b9;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x02ee('0x0'));function EmailSmtp(){}EmailSmtp[_0x02ee('0x1')][_0x02ee('0x2')]=function(_0x4be590,_0x172d81){return new Promise(function(_0xbc05e6,_0x338d3){var _0x949677=nodemailer[_0x02ee('0x3')](_0x4be590);_0x949677[_0x02ee('0x4')](_0x02ee('0x5'),inlineBase64());_0x949677[_0x02ee('0x6')](_0x172d81,function(_0x4ad293,_0x2a681b){if(_0x4ad293){_0x338d3(_0x4ad293[_0x02ee('0x7')]());}else{_0xbc05e6(_0x2a681b);}});});};EmailSmtp[_0x02ee('0x1')][_0x02ee('0x8')]=function(_0x22e028){return new Promise(function(_0x410e18,_0x50fe9e){var _0x3888a2=nodemailer[_0x02ee('0x3')](_0x22e028);_0x3888a2[_0x02ee('0x8')](function(_0x3bbed5,_0xa48497){if(_0x3bbed5){_0x50fe9e(_0x3bbed5[_0x02ee('0x7')]());}else{if(_0xa48497){_0x410e18(_0xa48497);}else{_0x50fe9e(_0x02ee('0x9'));}}});});};module[_0x02ee('0xa')]=EmailSmtp; \ No newline at end of file +var _0xd4e6=['sendMail','toString','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','send','createTransport','use'];(function(_0x3fca45,_0x3e990b){var _0x45f609=function(_0x25416a){while(--_0x25416a){_0x3fca45['push'](_0x3fca45['shift']());}};_0x45f609(++_0x3e990b);}(_0xd4e6,0x181));var _0x6d4e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xd4e6[_0x28947d];return _0x12d2ee;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x6d4e('0x0'));function EmailSmtp(){}EmailSmtp[_0x6d4e('0x1')][_0x6d4e('0x2')]=function(_0x3f26da,_0x3dc0a7){return new Promise(function(_0x4f122f,_0x5cff60){var _0x1f4e00=nodemailer[_0x6d4e('0x3')](_0x3f26da);_0x1f4e00[_0x6d4e('0x4')]('compile',inlineBase64());_0x1f4e00[_0x6d4e('0x5')](_0x3dc0a7,function(_0x12ec43,_0x118c25){if(_0x12ec43){_0x5cff60(_0x12ec43[_0x6d4e('0x6')]());}else{_0x4f122f(_0x118c25);}});});};EmailSmtp[_0x6d4e('0x1')][_0x6d4e('0x7')]=function(_0x1fb518){return new Promise(function(_0x2e8b18,_0x266688){var _0x4e9402=nodemailer[_0x6d4e('0x3')](_0x1fb518);_0x4e9402[_0x6d4e('0x7')](function(_0x100a95,_0x1b03b1){if(_0x100a95){_0x266688(_0x100a95[_0x6d4e('0x6')]());}else{if(_0x1b03b1){_0x2e8b18(_0x1b03b1);}else{_0x266688(_0x6d4e('0x8'));}}});});};module[_0x6d4e('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 03e2fc4..a8cdf32 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 _0x1214=['content','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','indexOf','line','isAutoreply','parser','from','subject','messageId','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','filter','info','parseBuffer','BodyHTML','Attachments','Title','

Empty\x20message

','user=','utf-8','toString','base64','lodash','moment','path','util','../../../config/logger','email','head','value','address','anonymous','name','split','length','slice','pop','isEmpty','@xcally.com','html','test','includes','\x20[Attachment:\x20','\x20]','body','0x1?_0x1fe933[_0x4121('0xd')](0x0,-0x1)['join']('\x20'):_0x5b6bd2['name'];}return'Anonymous';}function getLastName(_0x1aec7d){var _0xc77af7=_[_0x4121('0x6')](_0x1aec7d[_0x4121('0x7')]);if(_0xc77af7&&_0xc77af7['name']){var _0xf57279=_0xc77af7[_0x4121('0xa')][_0x4121('0xb')](/\s+/);return _0xf57279['length']>0x1?_0xf57279[_0x4121('0xe')]():'';}return'';}function getMails(_0x10b9a1,_0x502fc1){var _0x21f11a='';for(var _0x2f4849=0x0;_0x2f4849<_0x502fc1[_0x4121('0x7')][_0x4121('0xc')];_0x2f4849+=0x1){if(_0x502fc1['value'][_0x2f4849]['address']!==_0x10b9a1){if(!_[_0x4121('0xf')](_0x21f11a)){_0x21f11a+=',';}_0x21f11a+=_0x502fc1['value'][_0x2f4849]['name']||_0x502fc1[_0x4121('0x7')][_0x2f4849][_0x4121('0x8')]||'';_0x21f11a+='\x20<';_0x21f11a+=_0x502fc1[_0x4121('0x7')][_0x2f4849]['address']?_0x502fc1[_0x4121('0x7')][_0x2f4849][_0x4121('0x8')]:_0x4121('0x9')+random['generate'](0x6)+_0x4121('0x10');_0x21f11a+='>';}}return _0x21f11a;}function parseEmail(_0x2709c1,_0x5108ef,_0x3d285c){if(_0x5108ef[_0x4121('0x11')]){var _0x4b2f9a=/)<[^<]*)*<\/script>/gi;while(_0x4b2f9a[_0x4121('0x12')](_0x5108ef[_0x4121('0x11')])){_0x5108ef[_0x4121('0x11')]=_0x5108ef[_0x4121('0x11')]['replace'](_0x4b2f9a,'');}if(_0x5108ef[_0x4121('0x11')][_0x4121('0x13')](_0x4121('0x14'))){var _0x21a077=[];_0x5108ef[_0x4121('0x15')][_0x4121('0x16')](_0x568ae4=>{_0x21a077['push'](_0x568ae4[_0x4121('0x17')]);});var _0x3326fb=/]+>/g;var _0x1e5e88=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x34c42d=_0x5108ef[_0x4121('0x11')][_0x4121('0x18')](_0x1e5e88,_0x4121('0x19'));var _0x1f266a=_0x34c42d[_0x4121('0x18')](_0x3326fb,_0x4121('0x1a'));for(let _0x21e70f=0x0;_0x21e70f<_0x21a077[_0x4121('0xc')];_0x21e70f++){var _0x243f54=_0x1f266a[_0x4121('0x18')](_0x4121('0x1a'),_0x4121('0x1b')+_0x21a077[_0x21e70f]+_0x4121('0x1c'));_0x1f266a=_0x243f54;}_0x5108ef[_0x4121('0x11')]=_0x1f266a;}_0x3d285c[_0x4121('0x1d')]=_0x5108ef['html'];}else{_0x3d285c['body']=_0x5108ef['textAsHtml'];}if(_0x3d285c[_0x4121('0x1d')]){_0x3d285c['body']=_0x3d285c[_0x4121('0x1d')]['replace'](/0x0){var _0x9d6db4=[_0x4121('0x2f'),_0x4121('0x30'),_0x4121('0x31')];for(var _0x46cd3e=0x0;_0x46cd3e<_0x5108ef[_0x4121('0x2e')][_0x4121('0xc')];_0x46cd3e++){var _0x5e3c49=_[_0x4121('0x32')](_0x9d6db4,_0x5108ef[_0x4121('0x2e')][_0x46cd3e][_0x4121('0x33')]);if(_0x5e3c49>=0x0){_0x3d285c[_0x4121('0x34')]=!![];}}}return _0x3d285c;}exports[_0x4121('0x35')]=function(_0x4aad53,_0x8bb652,_0x5d3f50){var _0x414d27={'from':getAddress(_0x8bb652[_0x4121('0x36')]),'firstName':getFirstName(_0x8bb652[_0x4121('0x36')]),'lastName':getLastName(_0x8bb652['from']),'mapKey':'email','message':{'from':getMails(_0x4aad53['email'],_0x8bb652[_0x4121('0x36')]),'to':_0x4aad53[_0x4121('0x5')],'cc':'','subject':_0x8bb652[_0x4121('0x37')]||'','messageId':_0x8bb652[_0x4121('0x38')],'inReplyTo':_0x8bb652[_0x4121('0x39')],'sentAt':moment(_0x8bb652['date'])[_0x4121('0x26')](_0x4121('0x3a')),'attach':![],'attachments':[]}};if(!_0x8bb652['html']&&!_0x8bb652[_0x4121('0x3b')]){var _0x45db79=_[_0x4121('0x3c')](_0x8bb652[_0x4121('0x15')],{'contentType':'application/ms-tnef'});if(_0x45db79[_0x4121('0xc')]){logger[_0x4121('0x3d')](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x8bb652[_0x4121('0x38')]));tnef[_0x4121('0x3e')](_['first'](_0x45db79)['content'],function(_0x1c85aa,_0x3d9c8c){if(_0x3d9c8c){_0x8bb652[_0x4121('0x11')]=_0x3d9c8c[_0x4121('0x3f')]||'

Empty\x20message

';if(_0x3d9c8c['Attachments']){for(var _0x54965a=0x0;_0x54965a<_0x3d9c8c[_0x4121('0x40')][_0x4121('0xc')];_0x54965a++){var _0x583f7f=_0x3d9c8c[_0x4121('0x40')][_0x54965a];_0x414d27[_0x4121('0x1f')][_0x4121('0x15')][_0x4121('0x2c')]({'filename':_0x583f7f[_0x4121('0x41')],'content':Buffer[_0x4121('0x36')](_0x583f7f['Data'])});}}}_0x5d3f50(parseEmail(_0x4aad53,_0x8bb652,_0x414d27));});}else{_0x8bb652['html']=_0x4121('0x42');_0x5d3f50(parseEmail(_0x4aad53,_0x8bb652,_0x414d27));}}else{_0x5d3f50(parseEmail(_0x4aad53,_0x8bb652,_0x414d27));}};exports['generateXOAuth2Token']=function(_0x4e03b1,_0x146b68){var _0x419156=[_0x4121('0x43')+(_0x146b68||''),'auth=Bearer\x20'+_0x4e03b1,'',''];return Buffer[_0x4121('0x36')](_0x419156[_0x4121('0x28')](''),_0x4121('0x44'))[_0x4121('0x45')](_0x4121('0x46'));}; \ No newline at end of file +var _0xdd38=['indexOf','length','slice','join','Anonymous','pop','isEmpty','html','test','replace','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring'];(function(_0x58d580,_0x4c8f86){var _0x3c096c=function(_0x1385cf){while(--_0x1385cf){_0x58d580['push'](_0x58d580['shift']());}};_0x3c096c(++_0x4c8f86);}(_0xdd38,0x1c4));var _0x8dd3=function(_0x1ff329,_0x33e086){_0x1ff329=_0x1ff329-0x0;var _0x28501d=_0xdd38[_0x1ff329];return _0x28501d;};'use strict';var _=require(_0x8dd3('0x0'));var moment=require(_0x8dd3('0x1'));var random=require(_0x8dd3('0x2'));var fs=require('fs');var path=require(_0x8dd3('0x3'));var util=require(_0x8dd3('0x4'));var tnef=require(_0x8dd3('0x5'));var logger=require(_0x8dd3('0x6'))('email');var config=require(_0x8dd3('0x7'));function getAddress(_0x551dd0){var _0x17440f=_[_0x8dd3('0x8')](_0x551dd0[_0x8dd3('0x9')]);return _0x17440f&&_0x17440f[_0x8dd3('0xa')]?_0x17440f[_0x8dd3('0xa')]:_0x8dd3('0xb')+random[_0x8dd3('0xc')](0x6)+_0x8dd3('0xd');}function getFirstName(_0x4a9352){var _0x47ee25=_[_0x8dd3('0x8')](_0x4a9352[_0x8dd3('0x9')]);if(_0x47ee25&&_0x47ee25[_0x8dd3('0xe')]){if(_0x47ee25[_0x8dd3('0xe')]==_0x47ee25[_0x8dd3('0xa')]){return _0x47ee25[_0x8dd3('0xe')][_0x8dd3('0xf')](0x0,_0x47ee25[_0x8dd3('0xe')][_0x8dd3('0x10')]('@'));}var _0x60d675=_0x47ee25[_0x8dd3('0xe')]['split'](/\s+/);return _0x60d675[_0x8dd3('0x11')]>0x1?_0x60d675[_0x8dd3('0x12')](0x0,-0x1)[_0x8dd3('0x13')]('\x20'):_0x47ee25[_0x8dd3('0xe')];}return _0x8dd3('0x14');}function getLastName(_0x559ebf){var _0x186654=_[_0x8dd3('0x8')](_0x559ebf['value']);if(_0x186654&&_0x186654[_0x8dd3('0xe')]){var _0xb211d=_0x186654[_0x8dd3('0xe')]['split'](/\s+/);return _0xb211d[_0x8dd3('0x11')]>0x1?_0xb211d[_0x8dd3('0x15')]():'';}return'';}function getMails(_0x2a979d,_0x15f239){var _0x3449af='';for(var _0x20045f=0x0;_0x20045f<_0x15f239[_0x8dd3('0x9')][_0x8dd3('0x11')];_0x20045f+=0x1){if(_0x15f239['value'][_0x20045f]['address']!==_0x2a979d){if(!_[_0x8dd3('0x16')](_0x3449af)){_0x3449af+=',';}_0x3449af+=_0x15f239[_0x8dd3('0x9')][_0x20045f][_0x8dd3('0xe')]||_0x15f239['value'][_0x20045f]['address']||'';_0x3449af+='\x20<';_0x3449af+=_0x15f239[_0x8dd3('0x9')][_0x20045f][_0x8dd3('0xa')]?_0x15f239[_0x8dd3('0x9')][_0x20045f]['address']:_0x8dd3('0xb')+random[_0x8dd3('0xc')](0x6)+_0x8dd3('0xd');_0x3449af+='>';}}return _0x3449af;}function parseEmail(_0x3724c1,_0x1e6b05,_0x430b65){if(_0x1e6b05[_0x8dd3('0x17')]){var _0x4813c5=/)<[^<]*)*<\/script>/gi;while(_0x4813c5[_0x8dd3('0x18')](_0x1e6b05[_0x8dd3('0x17')])){_0x1e6b05['html']=_0x1e6b05['html'][_0x8dd3('0x19')](_0x4813c5,'');}if(_0x1e6b05[_0x8dd3('0x17')]['includes'](_0x8dd3('0x1a'))){var _0x49b706=[];_0x1e6b05[_0x8dd3('0x1b')][_0x8dd3('0x1c')](_0x31da1e=>{_0x49b706[_0x8dd3('0x1d')](_0x31da1e[_0x8dd3('0x1e')]);});var _0x1d2403=/]+>/g;var _0x54e2ef=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x17b852=_0x1e6b05[_0x8dd3('0x17')][_0x8dd3('0x19')](_0x54e2ef,_0x8dd3('0x1f'));var _0x47a366=_0x17b852[_0x8dd3('0x19')](_0x1d2403,_0x8dd3('0x20'));for(let _0x135743=0x0;_0x135743<_0x49b706[_0x8dd3('0x11')];_0x135743++){var _0x35d803=_0x47a366[_0x8dd3('0x19')]('_IMG',_0x8dd3('0x21')+_0x49b706[_0x135743]+_0x8dd3('0x22'));_0x47a366=_0x35d803;}_0x1e6b05[_0x8dd3('0x17')]=_0x47a366;}_0x430b65['body']=_0x1e6b05[_0x8dd3('0x17')];}else{_0x430b65[_0x8dd3('0x23')]=_0x1e6b05[_0x8dd3('0x24')];}if(_0x430b65[_0x8dd3('0x23')]){_0x430b65['body']=_0x430b65[_0x8dd3('0x23')][_0x8dd3('0x19')](/0x0){var _0x2680a1=['Auto-Submitted:\x20auto-replied',_0x8dd3('0x35'),_0x8dd3('0x36')];for(var _0x2b95bf=0x0;_0x2b95bf<_0x1e6b05[_0x8dd3('0x37')][_0x8dd3('0x11')];_0x2b95bf++){var _0x529033=_['indexOf'](_0x2680a1,_0x1e6b05[_0x8dd3('0x37')][_0x2b95bf][_0x8dd3('0x38')]);if(_0x529033>=0x0){_0x430b65[_0x8dd3('0x39')]=!![];}}}return _0x430b65;}exports[_0x8dd3('0x3a')]=function(_0x517db7,_0x3de1dc,_0x5dd311){var _0x3e10a6={'from':getAddress(_0x3de1dc[_0x8dd3('0x3b')]),'firstName':getFirstName(_0x3de1dc[_0x8dd3('0x3b')]),'lastName':getLastName(_0x3de1dc[_0x8dd3('0x3b')]),'mapKey':_0x8dd3('0x28'),'message':{'from':getMails(_0x517db7[_0x8dd3('0x28')],_0x3de1dc[_0x8dd3('0x3b')]),'to':_0x517db7['email'],'cc':'','subject':_0x3de1dc[_0x8dd3('0x3c')]||'','messageId':_0x3de1dc[_0x8dd3('0x3d')],'inReplyTo':_0x3de1dc[_0x8dd3('0x3e')],'sentAt':moment(_0x3de1dc[_0x8dd3('0x3f')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x3de1dc[_0x8dd3('0x17')]&&!_0x3de1dc[_0x8dd3('0x24')]){var _0x190e7f=_[_0x8dd3('0x40')](_0x3de1dc['attachments'],{'contentType':'application/ms-tnef'});if(_0x190e7f['length']){logger[_0x8dd3('0x41')](util[_0x8dd3('0x2e')](_0x8dd3('0x42'),_0x3de1dc[_0x8dd3('0x3d')]));tnef[_0x8dd3('0x43')](_[_0x8dd3('0x44')](_0x190e7f)[_0x8dd3('0x45')],function(_0x59f4a2,_0x3fdd90){if(_0x3fdd90){_0x3de1dc['html']=_0x3fdd90[_0x8dd3('0x46')]||_0x8dd3('0x47');if(_0x3fdd90[_0x8dd3('0x48')]){for(var _0x5ae2ca=0x0;_0x5ae2ca<_0x3fdd90[_0x8dd3('0x48')][_0x8dd3('0x11')];_0x5ae2ca++){var _0x3e9fd4=_0x3fdd90[_0x8dd3('0x48')][_0x5ae2ca];_0x3e10a6[_0x8dd3('0x26')][_0x8dd3('0x1b')][_0x8dd3('0x1d')]({'filename':_0x3e9fd4[_0x8dd3('0x49')],'content':Buffer[_0x8dd3('0x3b')](_0x3e9fd4[_0x8dd3('0x4a')])});}}}_0x5dd311(parseEmail(_0x517db7,_0x3de1dc,_0x3e10a6));});}else{_0x3de1dc[_0x8dd3('0x17')]='

Empty\x20message

';_0x5dd311(parseEmail(_0x517db7,_0x3de1dc,_0x3e10a6));}}else{_0x5dd311(parseEmail(_0x517db7,_0x3de1dc,_0x3e10a6));}};exports[_0x8dd3('0x4b')]=function(_0xd57647,_0x46b327){var _0x457309=[_0x8dd3('0x4c')+(_0x46b327||''),_0x8dd3('0x4d')+_0xd57647,'',''];return Buffer[_0x8dd3('0x3b')](_0x457309['join'](''),'utf-8')['toString']('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 327a3ee..7a98827 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 _0xfcaa=['key','SERV','active','Imap','Smtp','lodash','Service'];(function(_0x176362,_0xc54a7f){var _0x352765=function(_0x36002a){while(--_0x36002a){_0x176362['push'](_0x176362['shift']());}};_0x352765(++_0xc54a7f);}(_0xfcaa,0x1a2));var _0xafca=function(_0x45190b,_0x5cb944){_0x45190b=_0x45190b-0x0;var _0xcb52e6=_0xfcaa[_0x45190b];return _0xcb52e6;};'use strict';var _=require(_0xafca('0x0'));function MailAccount(_0x339191){this['id']=_0x339191['id']||0x0;this['name']=_0x339191['name']||_0xafca('0x1');this[_0xafca('0x2')]=_0x339191['key']||_0xafca('0x3');this[_0xafca('0x4')]=_0x339191['active']||![];this[_0xafca('0x5')]=_0x339191[_0xafca('0x5')]||[];this[_0xafca('0x6')]=_0x339191['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file +var _0x3650=['SERV','active','Imap','Smtp','exports','name','key'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x3650,0x1a2));var _0x0365=function(_0xbd0232,_0x3ceacc){_0xbd0232=_0xbd0232-0x0;var _0x62262f=_0x3650[_0xbd0232];return _0x62262f;};'use strict';var _=require('lodash');function MailAccount(_0x1ee929){this['id']=_0x1ee929['id']||0x0;this['name']=_0x1ee929[_0x0365('0x0')]||'Service';this[_0x0365('0x1')]=_0x1ee929[_0x0365('0x1')]||_0x0365('0x2');this[_0x0365('0x3')]=_0x1ee929['active']||![];this[_0x0365('0x4')]=_0x1ee929[_0x0365('0x4')]||[];this[_0x0365('0x5')]=_0x1ee929['Smtp']||[];}module[_0x0365('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 0bd0544..9e25eed 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 _0xaf24=['merge','exports','lodash','../model/mailAccount','mailAccounts','hasOwnProperty','prototype','mergeFromDatabase','length','isUndefined'];(function(_0x137678,_0x417d5a){var _0x21151c=function(_0xf71bab){while(--_0xf71bab){_0x137678['push'](_0x137678['shift']());}};_0x21151c(++_0x417d5a);}(_0xaf24,0x1d8));var _0x4af2=function(_0x33c26b,_0x109f10){_0x33c26b=_0x33c26b-0x0;var _0x54a7a5=_0xaf24[_0x33c26b];return _0x54a7a5;};'use strict';var _=require(_0x4af2('0x0'));var MailAccount=require(_0x4af2('0x1'));var Realtime=function(){this[_0x4af2('0x2')]={};};function freeIsNotKey(_0x1c23f6,_0x10f627,_0x22bc8c){var _0x4f4b00=_['mapKeys'](_0x1c23f6,function(_0x198b74,_0x5d8858){return _0x198b74[_0x22bc8c];});for(var _0x812bfc in _0x10f627){if(_0x10f627[_0x4af2('0x3')](_0x812bfc)){if(!_0x4f4b00[_0x812bfc]){delete _0x10f627[_0x812bfc];}}}}Realtime[_0x4af2('0x4')][_0x4af2('0x5')]=function(_0x53cff7,_0x4f53b2){for(var _0xd1cec9 in _0x4f53b2){if(_0x53cff7['hasOwnProperty'](_0xd1cec9)){_0x53cff7[_0xd1cec9]=_0x4f53b2[_0xd1cec9];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x39c0f4=this;return function(_0x3f058c){if(_0x3f058c){freeIsNotKey(_0x3f058c,_0x39c0f4[_0x4af2('0x2')],'id');for(var _0x551332=0x0,_0x122982={},_0x504a61={};_0x551332<_0x3f058c[_0x4af2('0x6')];_0x551332+=0x1){_0x122982=_0x3f058c[_0x551332];if(_[_0x4af2('0x7')](_0x39c0f4[_0x4af2('0x2')][_0x122982['id']])){_0x39c0f4['mailAccounts'][_0x122982['id']]=new MailAccount(_0x122982);}else{_[_0x4af2('0x8')](_0x39c0f4[_0x4af2('0x2')][_0x122982['id']],_0x122982);}}}return _0x39c0f4[_0x4af2('0x2')];};};module[_0x4af2('0x9')]=Realtime; \ No newline at end of file +var _0xe529=['mapKeys','hasOwnProperty','prototype','mergeFromDatabase','length','merge','exports','lodash','../model/mailAccount','mailAccounts'];(function(_0x83b5aa,_0x983f80){var _0x393ef8=function(_0x54191d){while(--_0x54191d){_0x83b5aa['push'](_0x83b5aa['shift']());}};_0x393ef8(++_0x983f80);}(_0xe529,0x147));var _0x9e52=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xe529[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x9e52('0x0'));var MailAccount=require(_0x9e52('0x1'));var Realtime=function(){this[_0x9e52('0x2')]={};};function freeIsNotKey(_0x2489b6,_0x40900c,_0x4d0bbf){var _0x10f0e4=_[_0x9e52('0x3')](_0x2489b6,function(_0x13fe8b,_0x43743e){return _0x13fe8b[_0x4d0bbf];});for(var _0x1051ba in _0x40900c){if(_0x40900c[_0x9e52('0x4')](_0x1051ba)){if(!_0x10f0e4[_0x1051ba]){delete _0x40900c[_0x1051ba];}}}}Realtime[_0x9e52('0x5')][_0x9e52('0x6')]=function(_0x22d7fe,_0x149985){for(var _0x529c0c in _0x149985){if(_0x22d7fe[_0x9e52('0x4')](_0x529c0c)){_0x22d7fe[_0x529c0c]=_0x149985[_0x529c0c];}}};Realtime[_0x9e52('0x5')]['initMailAccounts']=function(){var _0x126728=this;return function(_0x30064c){if(_0x30064c){freeIsNotKey(_0x30064c,_0x126728[_0x9e52('0x2')],'id');for(var _0x217ef1=0x0,_0x1e1648={},_0x2f9402={};_0x217ef1<_0x30064c[_0x9e52('0x7')];_0x217ef1+=0x1){_0x1e1648=_0x30064c[_0x217ef1];if(_['isUndefined'](_0x126728[_0x9e52('0x2')][_0x1e1648['id']])){_0x126728[_0x9e52('0x2')][_0x1e1648['id']]=new MailAccount(_0x1e1648);}else{_[_0x9e52('0x8')](_0x126728[_0x9e52('0x2')][_0x1e1648['id']],_0x1e1648);}}}return _0x126728[_0x9e52('0x2')];};};module[_0x9e52('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 3f5f2ec..dc6a34f 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 _0xe978=['TemplateId','MailServerIn','Imap','CloudProvider','name','type','MailServerOut','Smtp','data5','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','provider','service','email','active','key'];(function(_0x5713c1,_0x349b6e){var _0x2b6a60=function(_0x4f02a0){while(--_0x4f02a0){_0x5713c1['push'](_0x5713c1['shift']());}};_0x2b6a60(++_0x349b6e);}(_0xe978,0x70));var _0x8e97=function(_0x4e70fe,_0x350f60){_0x4e70fe=_0x4e70fe-0x0;var _0x13aa33=_0xe978[_0x4e70fe];return _0x13aa33;};'use strict';var client=require(_0x8e97('0x0'));exports[_0x8e97('0x1')]=function(){return function(){return client[_0x8e97('0x2')]('GetMailAccount',{'options':{'attributes':['id','name',_0x8e97('0x3'),_0x8e97('0x4'),_0x8e97('0x5'),_0x8e97('0x6'),_0x8e97('0x7'),'ListId',_0x8e97('0x8')],'raw':![],'include':[{'model':_0x8e97('0x9'),'as':_0x8e97('0xa'),'include':[{'model':_0x8e97('0xb'),'attributes':['id',_0x8e97('0xc'),'service',_0x8e97('0xd'),'data5'],'as':_0x8e97('0xb')}]},{'model':_0x8e97('0xe'),'as':_0x8e97('0xf'),'include':[{'model':'CloudProvider','attributes':['id',_0x8e97('0xc'),_0x8e97('0x4'),_0x8e97('0xd'),_0x8e97('0x10')],'as':_0x8e97('0xb')}]}]},'log':_0x8e97('0x11')});};};exports[_0x8e97('0x12')]=function(_0x167b77,_0x3a4289){return client[_0x8e97('0x2')](_0x8e97('0x13'),{'account':{'id':_0x167b77},'body':_0x3a4289,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xe6e9=['data5','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','name','provider','service','email','active','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type'];(function(_0x4beb56,_0x1939b6){var _0x2f30a9=function(_0xbf50cf){while(--_0xbf50cf){_0x4beb56['push'](_0x4beb56['shift']());}};_0x2f30a9(++_0x1939b6);}(_0xe6e9,0x182));var _0x9e6e=function(_0x1b3ecb,_0x5ab078){_0x1b3ecb=_0x1b3ecb-0x0;var _0x529680=_0xe6e9[_0x1b3ecb];return _0x529680;};'use strict';var client=require(_0x9e6e('0x0'));exports[_0x9e6e('0x1')]=function(){return function(){return client[_0x9e6e('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x9e6e('0x3'),_0x9e6e('0x4'),_0x9e6e('0x5'),_0x9e6e('0x6'),_0x9e6e('0x7'),'key',_0x9e6e('0x8'),_0x9e6e('0x9')],'raw':![],'include':[{'model':_0x9e6e('0xa'),'as':_0x9e6e('0xb'),'include':[{'model':_0x9e6e('0xc'),'attributes':['id','name',_0x9e6e('0x5'),_0x9e6e('0xd'),_0x9e6e('0xe')],'as':_0x9e6e('0xc')}]},{'model':_0x9e6e('0xf'),'as':_0x9e6e('0x10'),'include':[{'model':'CloudProvider','attributes':['id',_0x9e6e('0x3'),_0x9e6e('0x5'),_0x9e6e('0xd'),_0x9e6e('0xe')],'as':'CloudProvider'}]}]},'log':_0x9e6e('0x11')});};};exports[_0x9e6e('0x12')]=function(_0x51bc20,_0x18d23c){return client[_0x9e6e('0x2')](_0x9e6e('0x13'),{'account':{'id':_0x51bc20},'body':_0x18d23c,'log':_0x9e6e('0x13')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 31895b8..23581a6 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 _0xe32f=['loginMailFrequency','GetSettings','getSettings','Request'];(function(_0x11742d,_0x56f928){var _0x569570=function(_0x2fea6d){while(--_0x2fea6d){_0x11742d['push'](_0x11742d['shift']());}};_0x569570(++_0x56f928);}(_0xe32f,0x106));var _0xfe32=function(_0x590430,_0x4ba661){_0x590430=_0x590430-0x0;var _0x63f04a=_0xe32f[_0x590430];return _0x63f04a;};'use strict';var client=require('../client');exports[_0xfe32('0x0')]=function(){return client[_0xfe32('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xfe32('0x2')]},'log':_0xfe32('0x3')});}; \ No newline at end of file +var _0x01dc=['ShowSetting','loginMailFrequency','GetSettings','../client','Request'];(function(_0x53f897,_0x539857){var _0x6879f8=function(_0xa3c36){while(--_0xa3c36){_0x53f897['push'](_0x53f897['shift']());}};_0x6879f8(++_0x539857);}(_0x01dc,0x9e));var _0xc01d=function(_0x302f88,_0x1f9b28){_0x302f88=_0x302f88-0x0;var _0x29ef30=_0x01dc[_0x302f88];return _0x29ef30;};'use strict';var client=require(_0xc01d('0x0'));exports['getSettings']=function(){return client[_0xc01d('0x1')](_0xc01d('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc01d('0x3')]},'log':_0xc01d('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 3eb482e..5e4ad8f 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 1d984e3..a1896ff 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 _0xc02b=['redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling'];(function(_0x45153c,_0x1935ae){var _0x5a7976=function(_0x487a07){while(--_0x487a07){_0x45153c['push'](_0x45153c['shift']());}};_0x5a7976(++_0x1935ae);}(_0xc02b,0x184));var _0xbc02=function(_0x4a8418,_0x39078a){_0x4a8418=_0x4a8418-0x0;var _0x390174=_0xc02b[_0x4a8418];return _0x390174;};'use strict';var _=require(_0xbc02('0x0'));var http=require('http');var express=require(_0xbc02('0x1'));var sticky=require(_0xbc02('0x2'));var Redis=require(_0xbc02('0x3'));var config=require(_0xbc02('0x4'));var app=express();var server=http[_0xbc02('0x5')](app);server[_0xbc02('0x6')]=0xdbba0;if(sticky[_0xbc02('0x7')](server,config[_0xbc02('0x8')])){var socketio=require(_0xbc02('0x9'))(server,{'transports':[_0xbc02('0xa'),_0xbc02('0xb')]});config[_0xbc02('0xc')]=_[_0xbc02('0xd')](config[_0xbc02('0xc')],{'host':_0xbc02('0xe'),'port':0x18eb});socketio[_0xbc02('0xf')](require(_0xbc02('0x10'))({'pubClient':new Redis(config[_0xbc02('0xc')]),'subClient':new Redis(config[_0xbc02('0xc')])}));require(_0xbc02('0x11'))['default']();require(_0xbc02('0x12'))[_0xbc02('0x13')](socketio);require(_0xbc02('0x14'))[_0xbc02('0x13')](app);require(_0xbc02('0x15'))['default'](app);}else{server[_0xbc02('0x16')]('listening',function(){console['log'](_0xbc02('0x17'),config[_0xbc02('0x8')]);});}exports=module[_0xbc02('0x18')]=app; \ No newline at end of file +var _0x0e5d=['../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis'];(function(_0x32c798,_0xd2fe15){var _0x429dbf=function(_0x26c7ea){while(--_0x26c7ea){_0x32c798['push'](_0x32c798['shift']());}};_0x429dbf(++_0xd2fe15);}(_0x0e5d,0xbe));var _0xd0e5=function(_0x2cade1,_0x2631ab){_0x2cade1=_0x2cade1-0x0;var _0x5a8215=_0x0e5d[_0x2cade1];return _0x5a8215;};'use strict';var _=require(_0xd0e5('0x0'));var http=require(_0xd0e5('0x1'));var express=require(_0xd0e5('0x2'));var sticky=require(_0xd0e5('0x3'));var Redis=require(_0xd0e5('0x4'));var config=require(_0xd0e5('0x5'));var app=express();var server=http[_0xd0e5('0x6')](app);server[_0xd0e5('0x7')]=0xdbba0;if(sticky[_0xd0e5('0x8')](server,config[_0xd0e5('0x9')])){var socketio=require(_0xd0e5('0xa'))(server,{'transports':[_0xd0e5('0xb'),_0xd0e5('0xc')]});config[_0xd0e5('0xd')]=_[_0xd0e5('0xe')](config[_0xd0e5('0xd')],{'host':_0xd0e5('0xf'),'port':0x18eb});socketio[_0xd0e5('0x10')](require(_0xd0e5('0x11'))({'pubClient':new Redis(config[_0xd0e5('0xd')]),'subClient':new Redis(config[_0xd0e5('0xd')])}));require(_0xd0e5('0x12'))[_0xd0e5('0x13')]();require(_0xd0e5('0x14'))['default'](socketio);require(_0xd0e5('0x15'))['default'](app);require(_0xd0e5('0x16'))['default'](app);}else{server[_0xd0e5('0x17')](_0xd0e5('0x18'),function(){console['log'](_0xd0e5('0x19'),config['port']);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 825205b..632f431 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 _0xcb58=['../../config/logger','request','then','debug','rpc','routing','error','message','result','exports','jayson/promise','bluebird'];(function(_0x26ffd4,_0x46cf5b){var _0x5a38a8=function(_0x485191){while(--_0x485191){_0x26ffd4['push'](_0x26ffd4['shift']());}};_0x5a38a8(++_0x46cf5b);}(_0xcb58,0x136));var _0x8cb5=function(_0x5de52c,_0x5bafb6){_0x5de52c=_0x5de52c-0x0;var _0x3b7988=_0xcb58[_0x5de52c];return _0x3b7988;};'use strict';var jayson=require(_0x8cb5('0x0'));var BPromise=require(_0x8cb5('0x1'));var logger=require(_0x8cb5('0x2'))('routing');var client=jayson['client']['http']({'port':0x2329});client['Request']=function(_0x4ddc5a,_0x15d5b9){return new BPromise(function(_0x1e8f78,_0x490672){return client[_0x8cb5('0x3')](_0x4ddc5a,_0x15d5b9)[_0x8cb5('0x4')](function(_0x27fad7){logger[_0x8cb5('0x5')](_0x8cb5('0x6'),_0x8cb5('0x7'),_0x4ddc5a,_0x15d5b9,_0x27fad7);if(_0x27fad7['error']){logger[_0x8cb5('0x8')]('rpc',_0x8cb5('0x7'),_0x4ddc5a,_0x27fad7[_0x8cb5('0x8')][_0x8cb5('0x9')],_0x15d5b9);return _0x490672(_0x27fad7[_0x8cb5('0x8')][_0x8cb5('0x9')]);}else{return _0x1e8f78(_0x27fad7[_0x8cb5('0xa')]);}})['catch'](function(_0x499f7e){logger['error'](_0x8cb5('0x6'),_0x8cb5('0x7'),_0x4ddc5a,_0x499f7e,_0x15d5b9);return _0x490672(_0x499f7e);});});};module[_0x8cb5('0xb')]=client; \ No newline at end of file +var _0x9540=['rpc','jayson/promise','../../config/logger','http','Request','request','then','debug','routing','message','error','catch'];(function(_0x1366e3,_0x226913){var _0x1e1420=function(_0x10eeba){while(--_0x10eeba){_0x1366e3['push'](_0x1366e3['shift']());}};_0x1e1420(++_0x226913);}(_0x9540,0xb5));var _0x0954=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9540[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0x0954('0x0'));var BPromise=require('bluebird');var logger=require(_0x0954('0x1'))('routing');var client=jayson['client'][_0x0954('0x2')]({'port':0x2329});client[_0x0954('0x3')]=function(_0x1da823,_0x5219f9){return new BPromise(function(_0x56aebc,_0x56772d){return client[_0x0954('0x4')](_0x1da823,_0x5219f9)[_0x0954('0x5')](function(_0x4ae427){logger[_0x0954('0x6')]('rpc',_0x0954('0x7'),_0x1da823,_0x5219f9,_0x4ae427);if(_0x4ae427['error']){logger['error']('rpc',_0x0954('0x7'),_0x1da823,_0x4ae427['error'][_0x0954('0x8')],_0x5219f9);return _0x56772d(_0x4ae427[_0x0954('0x9')][_0x0954('0x8')]);}else{return _0x56aebc(_0x4ae427['result']);}})[_0x0954('0xa')](function(_0x5b97cd){logger[_0x0954('0x9')](_0x0954('0xb'),'routing',_0x1da823,_0x5b97cd,_0x5219f9);return _0x56772d(_0x5b97cd);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 35eef41..7071cda 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 _0x692c=['./rpc/chatQueue','./rpc/mailQueue','resolve','then','getAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/interval'];(function(_0xade8bc,_0x570901){var _0x8461a3=function(_0x5e7aac){while(--_0x5e7aac){_0xade8bc['push'](_0xade8bc['shift']());}};_0x8461a3(++_0x570901);}(_0x692c,0xd8));var _0xc692=function(_0x8c3abc,_0x3cf020){_0x8c3abc=_0x8c3abc-0x0;var _0xe51aec=_0x692c[_0x8c3abc];return _0xe51aec;};'use strict';var BPromise=require('bluebird');var server=require(_0xc692('0x0'));var Realtime=require(_0xc692('0x1'));var user=require(_0xc692('0x2'));var interval=require(_0xc692('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xc692('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xc692('0x5'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xc692('0x6')]()[_0xc692('0x7')](user[_0xc692('0x8')]())[_0xc692('0x7')](realtime['initAgents']())[_0xc692('0x7')](interval['getIntervals']())[_0xc692('0x7')](realtime[_0xc692('0x9')]())[_0xc692('0x7')](openchannelQueue[_0xc692('0xa')]())[_0xc692('0x7')](realtime[_0xc692('0xb')]())[_0xc692('0x7')](chatQueue[_0xc692('0xc')]())[_0xc692('0x7')](realtime['initChatQueues']())[_0xc692('0x7')](smsQueue[_0xc692('0xd')]())[_0xc692('0x7')](realtime[_0xc692('0xe')]())[_0xc692('0x7')](mailQueue[_0xc692('0xf')]())[_0xc692('0x7')](realtime[_0xc692('0x10')]())[_0xc692('0x7')](faxQueue['getFaxQueues']())[_0xc692('0x7')](realtime['initFaxQueues']())['then'](whatsappQueue['getWhatsappQueues']())[_0xc692('0x7')](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server[_0xc692('0x11')](realtime)[_0xc692('0x7')](function(_0x42cb04){return initRealtime();})[_0xc692('0x7')](function(_0x3c4edd){return setInterval(initRealtime,0x1388);})[_0xc692('0x12')](function(_0x51f4c2){console[_0xc692('0x13')](_0x51f4c2);});}main(); \ No newline at end of file +var _0xd20d=['getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','initFaxQueues','initWhatsappQueues','listen','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','initIntervals','getOpenchannelQueues'];(function(_0x5e8933,_0x5922d1){var _0x535c89=function(_0x554961){while(--_0x554961){_0x5e8933['push'](_0x5e8933['shift']());}};_0x535c89(++_0x5922d1);}(_0xd20d,0xb2));var _0xdd20=function(_0x11b0db,_0x3e2bc0){_0x11b0db=_0x11b0db-0x0;var _0x35c857=_0xd20d[_0x11b0db];return _0x35c857;};'use strict';var BPromise=require(_0xdd20('0x0'));var server=require('./server');var Realtime=require(_0xdd20('0x1'));var user=require(_0xdd20('0x2'));var interval=require(_0xdd20('0x3'));var openchannelQueue=require(_0xdd20('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xdd20('0x5'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xdd20('0x6'));var whatsappQueue=require(_0xdd20('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xdd20('0x8')](user['getAgents']())['then'](realtime['initAgents']())['then'](interval['getIntervals']())[_0xdd20('0x8')](realtime[_0xdd20('0x9')]())[_0xdd20('0x8')](openchannelQueue[_0xdd20('0xa')]())[_0xdd20('0x8')](realtime['initOpenchannelQueues']())[_0xdd20('0x8')](chatQueue[_0xdd20('0xb')]())['then'](realtime[_0xdd20('0xc')]())[_0xdd20('0x8')](smsQueue[_0xdd20('0xd')]())['then'](realtime[_0xdd20('0xe')]())[_0xdd20('0x8')](mailQueue[_0xdd20('0xf')]())[_0xdd20('0x8')](realtime[_0xdd20('0x10')]())[_0xdd20('0x8')](faxQueue['getFaxQueues']())[_0xdd20('0x8')](realtime[_0xdd20('0x11')]())[_0xdd20('0x8')](whatsappQueue['getWhatsappQueues']())[_0xdd20('0x8')](realtime[_0xdd20('0x12')]())[_0xdd20('0x8')](function(){return realtime;});}function main(){return server[_0xdd20('0x13')](realtime)['then'](function(_0x275361){return initRealtime();})[_0xdd20('0x8')](function(_0x514e16){return setInterval(initRealtime,0x1388);})['catch'](function(_0x382428){console[_0xdd20('0x14')](_0x382428);});}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 e1d8900..a607c09 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 _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x3a41a3,_0x375fec){var _0x5aaa3f=function(_0x555c22){while(--_0x555c22){_0x3a41a3['push'](_0x3a41a3['shift']());}};_0x5aaa3f(++_0x375fec);}(_0x7a54,0x106));var _0x47a5=function(_0x2f17d4,_0x9cb3fb){_0x2f17d4=_0x2f17d4-0x0;var _0x56e843=_0x7a54[_0x2f17d4];return _0x56e843;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file +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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1261,0x144));var _0x1126=function(_0x134192,_0x36adc5){_0x134192=_0x134192-0x0;var _0x3cd080=_0x1261[_0x134192];return _0x3cd080;};'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 diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 97442ba..32a4edf 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 _0x3d64=['request','then','message','result','catch','sendMailMessage','bluebird','jayson/promise','client','http'];(function(_0x47a8cd,_0x17d8b6){var _0x47d9bc=function(_0x2aaf24){while(--_0x2aaf24){_0x47a8cd['push'](_0x47a8cd['shift']());}};_0x47d9bc(++_0x17d8b6);}(_0x3d64,0x1aa));var _0x43d6=function(_0x2bdd92,_0x24def5){_0x2bdd92=_0x2bdd92-0x0;var _0x3ec5ee=_0x3d64[_0x2bdd92];return _0x3ec5ee;};'use strict';var BPromise=require(_0x43d6('0x0'));var jayson=require(_0x43d6('0x1'));var client=jayson[_0x43d6('0x2')][_0x43d6('0x3')]({'port':0x232b});function request(_0x19e4fc,_0x14c5a7){return new BPromise(function(_0x52b0db,_0x2376c2){return client[_0x43d6('0x4')](_0x19e4fc,_0x14c5a7)[_0x43d6('0x5')](function(_0x431ea3){if(_0x431ea3['error']){return _0x2376c2(_0x431ea3['error'][_0x43d6('0x6')]);}else{return _0x52b0db(_0x431ea3[_0x43d6('0x7')]);}})[_0x43d6('0x8')](function(_0x73a58f){return _0x2376c2(_0x73a58f);});});}exports[_0x43d6('0x9')]=function(_0x411926,_0x1fa8ef){return request('SendMail',{'account':_0x411926,'message':_0x1fa8ef});}; \ No newline at end of file +var _0xf904=['jayson/promise','client','request','then','error','message','result','catch','bluebird'];(function(_0x165a94,_0x3c7fc7){var _0x4fde96=function(_0x505319){while(--_0x505319){_0x165a94['push'](_0x165a94['shift']());}};_0x4fde96(++_0x3c7fc7);}(_0xf904,0x155));var _0x4f90=function(_0x13c1ec,_0x31fe45){_0x13c1ec=_0x13c1ec-0x0;var _0x3df630=_0xf904[_0x13c1ec];return _0x3df630;};'use strict';var BPromise=require(_0x4f90('0x0'));var jayson=require(_0x4f90('0x1'));var client=jayson[_0x4f90('0x2')]['http']({'port':0x232b});function request(_0x2523a7,_0x23751f){return new BPromise(function(_0x491d87,_0x1c113f){return client[_0x4f90('0x3')](_0x2523a7,_0x23751f)[_0x4f90('0x4')](function(_0x46fb2d){if(_0x46fb2d[_0x4f90('0x5')]){return _0x1c113f(_0x46fb2d[_0x4f90('0x5')][_0x4f90('0x6')]);}else{return _0x491d87(_0x46fb2d[_0x4f90('0x7')]);}})[_0x4f90('0x8')](function(_0x1bc20d){return _0x1c113f(_0x1bc20d);});});}exports['sendMailMessage']=function(_0x56d4fb,_0x52de39){return request('SendMail',{'account':_0x56d4fb,'message':_0x52de39});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index a1a2a9a..a1d99c5 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 _0x2542=['openchannelCurrentCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','maxcapacity','working','idle','openchannel','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatStatusTime','faxStatus','whatsappCurrentCapacity','openchannelStatus','busyQueue','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','stringify','emit','user:routing:update','omit','exports','lodash','md5','moment','ioredis','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity'];(function(_0x43c355,_0x4032c8){var _0x1b928a=function(_0xead694){while(--_0xead694){_0x43c355['push'](_0x43c355['shift']());}};_0x1b928a(++_0x4032c8);}(_0x2542,0x169));var _0x2254=function(_0x4e09b7,_0x2bd4d1){_0x4e09b7=_0x4e09b7-0x0;var _0x3325ee=_0x2542[_0x4e09b7];return _0x3325ee;};'use strict';var _=require(_0x2254('0x0'));var md5=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var Redis=require(_0x2254('0x3'));var config=require('../../../config/environment');config[_0x2254('0x4')]=_['defaults'](config[_0x2254('0x4')],{'host':_0x2254('0x5'),'port':0x18eb});var io=require(_0x2254('0x6'))(new Redis(config[_0x2254('0x4')]));function Agent(_0x76c902){this['id']=_0x76c902['id']||0x0;this['name']=_0x76c902[_0x2254('0x7')]||'';this[_0x2254('0x8')]=_0x76c902[_0x2254('0x8')]||!![];this[_0x2254('0x9')]=_0x76c902[_0x2254('0x9')]||![];this[_0x2254('0xa')]=_0x76c902[_0x2254('0xa')]||![];this[_0x2254('0xb')]=_0x76c902[_0x2254('0xb')]||![];this[_0x2254('0xc')]=_0x76c902[_0x2254('0xc')]||![];this['smsPause']=_0x76c902[_0x2254('0xd')]||![];this[_0x2254('0xe')]=_0x76c902[_0x2254('0xe')]||![];this[_0x2254('0xf')]='unknown';this['chatStatusTime']=0x0;this[_0x2254('0x10')]=_0x76c902[_0x2254('0x10')]||0x0;this[_0x2254('0x11')]=0x0;this[_0x2254('0x12')]=_0x2254('0x13');this[_0x2254('0x14')]=0x0;this['mailCapacity']=_0x76c902[_0x2254('0x15')]||0x0;this[_0x2254('0x16')]=0x0;this['faxStatus']=_0x2254('0x13');this[_0x2254('0x17')]=0x0;this[_0x2254('0x18')]=_0x76c902[_0x2254('0x18')]||0x0;this[_0x2254('0x19')]=0x0;this[_0x2254('0x1a')]='unknown';this[_0x2254('0x1b')]=0x0;this['smsCapacity']=_0x76c902[_0x2254('0x1c')]||0x0;this[_0x2254('0x1d')]=0x0;this[_0x2254('0x1e')]=_0x2254('0x13');this[_0x2254('0x1f')]=0x0;this[_0x2254('0x20')]=_0x76c902['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0x2254('0x13');this[_0x2254('0x21')]=0x0;this[_0x2254('0x22')]=_0x76c902[_0x2254('0x22')]||0x0;this[_0x2254('0x23')]=0x0;this[_0x2254('0x24')]=![];this['busyQueue']=undefined;this[_0x2254('0x1')]='';this[_0x2254('0x25')]={};this[_0x2254('0x26')]={};this['mailWaitingInteractions']={};this['openchannelWaitingInteractions']={};this['smsWaitingInteractions']={};this[_0x2254('0x27')]={};this[_0x2254('0x28')]();}Agent[_0x2254('0x29')]['getChannelStatus']=function(_0x5713e4){if(this[_0x5713e4+'CurrentCapacity']>0x0){if(this[_0x5713e4+'Capacity']>0x0&&this[_0x5713e4+'CurrentCapacity']>=this[_0x5713e4+'Capacity']){return _0x2254('0x2a');}else{return _0x2254('0x2b');}}else{return _0x2254('0x2c');}};Agent[_0x2254('0x29')][_0x2254('0x28')]=function(){var _0x1349c9=['mail','chat',_0x2254('0x2d'),'fax',_0x2254('0x2e'),_0x2254('0x2f')];for(var _0x31a543=0x0;_0x31a543<_0x1349c9[_0x2254('0x30')];_0x31a543+=0x1){var _0x19043b=this['getChannelStatus'](_0x1349c9[_0x31a543]);if(this[_0x1349c9[_0x31a543]+_0x2254('0x31')]!==_0x19043b){this[_0x1349c9[_0x31a543]+_0x2254('0x32')]=_[_0x2254('0x33')](moment()[_0x2254('0x34')]('x'));}this[_0x1349c9[_0x31a543]+_0x2254('0x31')]=_0x19043b;}var _0x377c41={'id':this['id'],'name':this[_0x2254('0x7')],'online':this[_0x2254('0x8')],'voicePause':this[_0x2254('0x9')],'chatPause':this[_0x2254('0xa')],'mailPause':this[_0x2254('0xb')],'smsPause':this[_0x2254('0xd')],'faxPause':this[_0x2254('0xc')],'openchannelPause':this[_0x2254('0xe')],'chatStatus':this[_0x2254('0xf')],'chatStatusTime':this[_0x2254('0x35')],'chatCapacity':this[_0x2254('0x10')],'chatCurrentCapacity':this[_0x2254('0x11')],'mailStatus':this[_0x2254('0x12')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x2254('0x15')],'mailCurrentCapacity':this[_0x2254('0x16')],'faxStatus':this[_0x2254('0x36')],'faxStatusTime':this[_0x2254('0x17')],'faxCapacity':this[_0x2254('0x18')],'faxCurrentCapacity':this[_0x2254('0x19')],'smsStatus':this[_0x2254('0x1a')],'smsStatusTime':this[_0x2254('0x1b')],'smsCapacity':this[_0x2254('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x2254('0x1e')],'whatsappStatusTime':this[_0x2254('0x1f')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x2254('0x37')],'openchannelStatus':this[_0x2254('0x38')],'openchannelStatusTime':this[_0x2254('0x21')],'openchannelCapacity':this[_0x2254('0x22')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0x2254('0x39')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0x2254('0x26')],'mailWaitingInteractions':this[_0x2254('0x3a')],'openchannelWaitingInteractions':this[_0x2254('0x3b')],'smsWaitingInteractions':this[_0x2254('0x3c')],'whatsappWaitingInteractions':this[_0x2254('0x27')]};var _0x2707f4=md5(JSON[_0x2254('0x3d')](_0x377c41));if(this['md5']!==_0x2707f4){this[_0x2254('0x1')]=_0x2707f4;io[_0x2254('0x3e')](_0x2254('0x3f'),_[_0x2254('0x40')](_0x377c41,[_0x2254('0x8')]));}};module[_0x2254('0x41')]=Agent; \ No newline at end of file +var _0x5204=['working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','getChannelStatus','StatusTime','format','Status','faxStatusTime','openchannelCurrentCapacity','busyQueue','chatWaitingInteractions','smsWaitingInteractions','emit','user:routing:update','omit','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity'];(function(_0x231edb,_0x1367a2){var _0x487fb0=function(_0x5444de){while(--_0x5444de){_0x231edb['push'](_0x231edb['shift']());}};_0x487fb0(++_0x1367a2);}(_0x5204,0xdf));var _0x4520=function(_0x330723,_0x8de382){_0x330723=_0x330723-0x0;var _0x60c546=_0x5204[_0x330723];return _0x60c546;};'use strict';var _=require(_0x4520('0x0'));var md5=require(_0x4520('0x1'));var moment=require('moment');var Redis=require(_0x4520('0x2'));var config=require(_0x4520('0x3'));config[_0x4520('0x4')]=_[_0x4520('0x5')](config[_0x4520('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x4520('0x6'))(new Redis(config['redis']));function Agent(_0x180174){this['id']=_0x180174['id']||0x0;this[_0x4520('0x7')]=_0x180174[_0x4520('0x7')]||'';this[_0x4520('0x8')]=_0x180174[_0x4520('0x8')]||!![];this[_0x4520('0x9')]=_0x180174[_0x4520('0x9')]||![];this['chatPause']=_0x180174[_0x4520('0xa')]||![];this['mailPause']=_0x180174[_0x4520('0xb')]||![];this[_0x4520('0xc')]=_0x180174[_0x4520('0xc')]||![];this[_0x4520('0xd')]=_0x180174[_0x4520('0xd')]||![];this[_0x4520('0xe')]=_0x180174[_0x4520('0xe')]||![];this[_0x4520('0xf')]=_0x4520('0x10');this[_0x4520('0x11')]=0x0;this[_0x4520('0x12')]=_0x180174[_0x4520('0x12')]||0x0;this[_0x4520('0x13')]=0x0;this[_0x4520('0x14')]=_0x4520('0x10');this[_0x4520('0x15')]=0x0;this[_0x4520('0x16')]=_0x180174[_0x4520('0x16')]||0x0;this[_0x4520('0x17')]=0x0;this[_0x4520('0x18')]=_0x4520('0x10');this['faxStatusTime']=0x0;this[_0x4520('0x19')]=_0x180174[_0x4520('0x19')]||0x0;this[_0x4520('0x1a')]=0x0;this[_0x4520('0x1b')]=_0x4520('0x10');this['smsStatusTime']=0x0;this[_0x4520('0x1c')]=_0x180174[_0x4520('0x1c')]||0x0;this[_0x4520('0x1d')]=0x0;this[_0x4520('0x1e')]=_0x4520('0x10');this[_0x4520('0x1f')]=0x0;this[_0x4520('0x20')]=_0x180174[_0x4520('0x20')]||0x0;this[_0x4520('0x21')]=0x0;this[_0x4520('0x22')]=_0x4520('0x10');this[_0x4520('0x23')]=0x0;this['openchannelCapacity']=_0x180174[_0x4520('0x24')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x4520('0x1')]='';this['chatWaitingInteractions']={};this[_0x4520('0x25')]={};this[_0x4520('0x26')]={};this[_0x4520('0x27')]={};this['smsWaitingInteractions']={};this[_0x4520('0x28')]={};this[_0x4520('0x29')]();}Agent[_0x4520('0x2a')]['getChannelStatus']=function(_0x198c34){if(this[_0x198c34+_0x4520('0x2b')]>0x0){if(this[_0x198c34+_0x4520('0x2c')]>0x0&&this[_0x198c34+_0x4520('0x2b')]>=this[_0x198c34+_0x4520('0x2c')]){return'maxcapacity';}else{return _0x4520('0x2d');}}else{return _0x4520('0x2e');}};Agent[_0x4520('0x2a')][_0x4520('0x29')]=function(){var _0x57306b=[_0x4520('0x2f'),_0x4520('0x30'),_0x4520('0x31'),_0x4520('0x32'),_0x4520('0x33'),_0x4520('0x34')];for(var _0x2d6902=0x0;_0x2d6902<_0x57306b[_0x4520('0x35')];_0x2d6902+=0x1){var _0x180c44=this[_0x4520('0x36')](_0x57306b[_0x2d6902]);if(this[_0x57306b[_0x2d6902]+'Status']!==_0x180c44){this[_0x57306b[_0x2d6902]+_0x4520('0x37')]=_['toNumber'](moment()[_0x4520('0x38')]('x'));}this[_0x57306b[_0x2d6902]+_0x4520('0x39')]=_0x180c44;}var _0x43b4a2={'id':this['id'],'name':this[_0x4520('0x7')],'online':this[_0x4520('0x8')],'voicePause':this[_0x4520('0x9')],'chatPause':this['chatPause'],'mailPause':this[_0x4520('0xb')],'smsPause':this['smsPause'],'faxPause':this[_0x4520('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x4520('0xf')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x4520('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x4520('0x15')],'mailCapacity':this[_0x4520('0x16')],'mailCurrentCapacity':this[_0x4520('0x17')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x4520('0x3a')],'faxCapacity':this[_0x4520('0x19')],'faxCurrentCapacity':this[_0x4520('0x1a')],'smsStatus':this[_0x4520('0x1b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x4520('0x1d')],'whatsappStatus':this[_0x4520('0x1e')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x4520('0x20')],'whatsappCurrentCapacity':this[_0x4520('0x21')],'openchannelStatus':this[_0x4520('0x22')],'openchannelStatusTime':this[_0x4520('0x23')],'openchannelCapacity':this[_0x4520('0x24')],'openchannelCurrentCapacity':this[_0x4520('0x3b')],'busy':this['busy'],'busyQueue':this[_0x4520('0x3c')],'chatWaitingInteractions':this[_0x4520('0x3d')],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0x4520('0x26')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x4520('0x3e')],'whatsappWaitingInteractions':this[_0x4520('0x28')]};var _0x4f2dc4=md5(JSON['stringify'](_0x43b4a2));if(this['md5']!==_0x4f2dc4){this[_0x4520('0x1')]=_0x4f2dc4;io[_0x4520('0x3f')](_0x4520('0x40'),_[_0x4520('0x41')](_0x43b4a2,[_0x4520('0x8')]));}};module[_0x4520('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 dc049d0..a2ef8ca 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 _0x12d9=['emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','loggedIn','paused','online','chatPause','available','name','waiting','format','chat:queue:%s'];(function(_0x4b25e3,_0x33a600){var _0x1596c6=function(_0x3a2209){while(--_0x3a2209){_0x4b25e3['push'](_0x4b25e3['shift']());}};_0x1596c6(++_0x33a600);}(_0x12d9,0xd5));var _0x912d=function(_0x52fb3c,_0x2cf66e){_0x52fb3c=_0x52fb3c-0x0;var _0x5c9223=_0x12d9[_0x52fb3c];return _0x5c9223;};'use strict';var _=require(_0x912d('0x0'));var md5=require(_0x912d('0x1'));var util=require(_0x912d('0x2'));var Redis=require(_0x912d('0x3'));var config=require(_0x912d('0x4'));config[_0x912d('0x5')]=_[_0x912d('0x6')](config[_0x912d('0x5')],{'host':_0x912d('0x7'),'port':0x18eb});var io=require(_0x912d('0x8'))(new Redis(config[_0x912d('0x5')]));function ChatQueue(_0x148051){this['id']=_0x148051['id']||0x0;this['name']=_0x148051['name']||'';this[_0x912d('0x9')]=_0x148051['timeout']||0xa;this[_0x912d('0xa')]=_0x148051[_0x912d('0xa')]||_0x912d('0xb');this[_0x912d('0xc')]=_0x148051[_0x912d('0xc')];this[_0x912d('0xd')]={};this['waiting']=0x0;this[_0x912d('0x1')]='';this[_0x912d('0xe')]();this['updateRealtime']();}ChatQueue[_0x912d('0xf')][_0x912d('0xe')]=function(){var _0x49fafa=this[_0x912d('0xd')][_0x912d('0x10')];this['mapAgentsId']=_[_0x912d('0x11')](this['Agents'],'id');this['mapAgentsId'][_0x912d('0x10')]=_0x49fafa;};ChatQueue[_0x912d('0xf')]['updateRealtime']=function(){this[_0x912d('0x12')]=0x0;this[_0x912d('0x13')]=0x0;for(var _0x6eb9ea=0x0;_0x6eb9ea=0x0?this[_0x912d('0x16')]:0x0;var _0x50bc70={'id':this['id'],'available':this[_0x912d('0x16')],'loggedIn':this[_0x912d('0x12')],'name':this[_0x912d('0x17')],'paused':this[_0x912d('0x13')],'waiting':this[_0x912d('0x18')]};var _0x39cf17=md5(JSON['stringify'](_0x50bc70));if(this['md5']!==_0x39cf17){this['md5']=_0x39cf17;io['to'](util[_0x912d('0x19')](_0x912d('0x1a'),_0x50bc70[_0x912d('0x17')]))[_0x912d('0x1b')](_0x912d('0x1c'),_0x50bc70);}};module[_0x912d('0x1d')]=ChatQueue; \ No newline at end of file +var _0x5ce5=['stringify','format','emit','exports','lodash','md5','util','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','updateRealtime','paused','length','loggedIn','available'];(function(_0x19294e,_0x3eb1d2){var _0x42ccc4=function(_0x5533e6){while(--_0x5533e6){_0x19294e['push'](_0x19294e['shift']());}};_0x42ccc4(++_0x3eb1d2);}(_0x5ce5,0x199));var _0x55ce=function(_0x507b9f,_0x47e9d4){_0x507b9f=_0x507b9f-0x0;var _0x526049=_0x5ce5[_0x507b9f];return _0x526049;};'use strict';var _=require(_0x55ce('0x0'));var md5=require(_0x55ce('0x1'));var util=require(_0x55ce('0x2'));var Redis=require('ioredis');var config=require(_0x55ce('0x3'));config['redis']=_[_0x55ce('0x4')](config[_0x55ce('0x5')],{'host':_0x55ce('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x55ce('0x5')]));function ChatQueue(_0x3625a1){this['id']=_0x3625a1['id']||0x0;this[_0x55ce('0x7')]=_0x3625a1[_0x55ce('0x7')]||'';this[_0x55ce('0x8')]=_0x3625a1['timeout']||0xa;this[_0x55ce('0x9')]=_0x3625a1[_0x55ce('0x9')]||_0x55ce('0xa');this['Agents']=_0x3625a1[_0x55ce('0xb')];this[_0x55ce('0xc')]={};this[_0x55ce('0xd')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}ChatQueue['prototype'][_0x55ce('0xe')]=function(){var _0x8bea63=this[_0x55ce('0xc')][_0x55ce('0xf')];this[_0x55ce('0xc')]=_[_0x55ce('0x10')](this[_0x55ce('0xb')],'id');this[_0x55ce('0xc')][_0x55ce('0xf')]=_0x8bea63;};ChatQueue[_0x55ce('0x11')][_0x55ce('0x12')]=function(){this['loggedIn']=0x0;this[_0x55ce('0x13')]=0x0;for(var _0x26697f=0x0;_0x26697f=0x0?this[_0x55ce('0x16')]:0x0;var _0x18f732={'id':this['id'],'available':this[_0x55ce('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x55ce('0x7')],'paused':this[_0x55ce('0x13')],'waiting':this[_0x55ce('0xd')]};var _0x4c3dd0=md5(JSON[_0x55ce('0x17')](_0x18f732));if(this[_0x55ce('0x1')]!==_0x4c3dd0){this[_0x55ce('0x1')]=_0x4c3dd0;io['to'](util[_0x55ce('0x18')]('chat:queue:%s',_0x18f732[_0x55ce('0x7')]))[_0x55ce('0x19')]('chat_queue:save',_0x18f732);}};module[_0x55ce('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 ccef84e..fc925c4 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 _0x20a5=['exports','lodash','util','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn','faxPause','available','format','fax:queue:%s','emit','fax_queue:save'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x20a5,0x79));var _0x520a=function(_0x2d5216,_0x57984a){_0x2d5216=_0x2d5216-0x0;var _0x34303f=_0x20a5[_0x2d5216];return _0x34303f;};'use strict';var _=require(_0x520a('0x0'));var md5=require('md5');var util=require(_0x520a('0x1'));var Redis=require(_0x520a('0x2'));var config=require('../../../config/environment');config[_0x520a('0x3')]=_[_0x520a('0x4')](config[_0x520a('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x520a('0x5'))(new Redis(config[_0x520a('0x3')]));function FaxQueue(_0x2aeb30){this['id']=_0x2aeb30['id']||0x0;this[_0x520a('0x6')]=_0x2aeb30[_0x520a('0x6')]||'';this[_0x520a('0x7')]=_0x2aeb30[_0x520a('0x7')]||0xa;this[_0x520a('0x8')]=_0x2aeb30[_0x520a('0x8')]||_0x520a('0x9');this[_0x520a('0xa')]=_0x2aeb30[_0x520a('0xa')];this[_0x520a('0xb')]={};this[_0x520a('0xc')]=0x0;this[_0x520a('0xd')]='';this[_0x520a('0xe')]();this[_0x520a('0xf')]();}FaxQueue[_0x520a('0x10')]['updateRouting']=function(){var _0x2dd96d=this[_0x520a('0xb')][_0x520a('0x11')];this['mapAgentsId']=_[_0x520a('0x12')](this[_0x520a('0xa')],'id');this[_0x520a('0xb')][_0x520a('0x11')]=_0x2dd96d;};FaxQueue[_0x520a('0x10')][_0x520a('0xf')]=function(){this['loggedIn']=0x0;this[_0x520a('0x13')]=0x0;for(var _0x499531=0x0;_0x499531=0x0?this['available']:0x0;var _0xc55865={'id':this['id'],'available':this['available'],'loggedIn':this[_0x520a('0x16')],'name':this[_0x520a('0x6')],'paused':this[_0x520a('0x13')],'waiting':this[_0x520a('0xc')]};var _0x54d8d5=md5(JSON['stringify'](_0xc55865));if(this[_0x520a('0xd')]!==_0x54d8d5){this[_0x520a('0xd')]=_0x54d8d5;io['to'](util[_0x520a('0x19')](_0x520a('0x1a'),_0xc55865[_0x520a('0x6')]))[_0x520a('0x1b')](_0x520a('0x1c'),_0xc55865);}};module[_0x520a('0x1d')]=FaxQueue; \ No newline at end of file +var _0xc6f9=['faxPause','paused','available','waiting','stringify','fax:queue:%s','fax_queue:save','exports','lodash','md5','util','ioredis','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online'];(function(_0x8262e5,_0x272c5f){var _0x7ba3ef=function(_0x3b7fd1){while(--_0x3b7fd1){_0x8262e5['push'](_0x8262e5['shift']());}};_0x7ba3ef(++_0x272c5f);}(_0xc6f9,0x1bb));var _0x9c6f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc6f9[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x9c6f('0x0'));var md5=require(_0x9c6f('0x1'));var util=require(_0x9c6f('0x2'));var Redis=require(_0x9c6f('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x9c6f('0x4')](config[_0x9c6f('0x5')],{'host':_0x9c6f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9c6f('0x5')]));function FaxQueue(_0x323171){this['id']=_0x323171['id']||0x0;this[_0x9c6f('0x7')]=_0x323171[_0x9c6f('0x7')]||'';this[_0x9c6f('0x8')]=_0x323171[_0x9c6f('0x8')]||0xa;this[_0x9c6f('0x9')]=_0x323171[_0x9c6f('0x9')]||_0x9c6f('0xa');this[_0x9c6f('0xb')]=_0x323171['Agents'];this[_0x9c6f('0xc')]={};this['waiting']=0x0;this[_0x9c6f('0x1')]='';this[_0x9c6f('0xd')]();this[_0x9c6f('0xe')]();}FaxQueue[_0x9c6f('0xf')][_0x9c6f('0xd')]=function(){var _0x4c8028=this['mapAgentsId'][_0x9c6f('0x10')];this[_0x9c6f('0xc')]=_[_0x9c6f('0x11')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x4c8028;};FaxQueue[_0x9c6f('0xf')][_0x9c6f('0xe')]=function(){this[_0x9c6f('0x12')]=0x0;this['paused']=0x0;for(var _0x525527=0x0;_0x525527=0x0?this[_0x9c6f('0x17')]:0x0;var _0x403f5e={'id':this['id'],'available':this[_0x9c6f('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x9c6f('0x7')],'paused':this['paused'],'waiting':this[_0x9c6f('0x18')]};var _0xa4d2c9=md5(JSON[_0x9c6f('0x19')](_0x403f5e));if(this[_0x9c6f('0x1')]!==_0xa4d2c9){this[_0x9c6f('0x1')]=_0xa4d2c9;io['to'](util['format'](_0x9c6f('0x1a'),_0x403f5e[_0x9c6f('0x7')]))['emit'](_0x9c6f('0x1b'),_0x403f5e);}};module[_0x9c6f('0x1c')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 16c9089..b8fd3b9 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 _0xeadd=['Intervals','exports','name'];(function(_0x2a2d4c,_0x421c0b){var _0x281be4=function(_0x4d8ea9){while(--_0x4d8ea9){_0x2a2d4c['push'](_0x2a2d4c['shift']());}};_0x281be4(++_0x421c0b);}(_0xeadd,0x1d6));var _0xdead=function(_0x2277a5,_0x153a78){_0x2277a5=_0x2277a5-0x0;var _0x14e050=_0xeadd[_0x2277a5];return _0x14e050;};'use strict';function Interval(_0x1e2292){this['id']=_0x1e2292['id']||0x0;this[_0xdead('0x0')]=_0x1e2292[_0xdead('0x0')]||'';this[_0xdead('0x1')]=_0x1e2292[_0xdead('0x1')]||{};}module[_0xdead('0x2')]=Interval; \ No newline at end of file +var _0x146f=['exports','name','Intervals'];(function(_0x4c7edb,_0x15a38b){var _0x3bd0cd=function(_0x1ba08e){while(--_0x1ba08e){_0x4c7edb['push'](_0x4c7edb['shift']());}};_0x3bd0cd(++_0x15a38b);}(_0x146f,0x1d5));var _0xf146=function(_0x446d10,_0x4a9444){_0x446d10=_0x446d10-0x0;var _0x2d6c4a=_0x146f[_0x446d10];return _0x2d6c4a;};'use strict';function Interval(_0x4552ba){this['id']=_0x4552ba['id']||0x0;this[_0xf146('0x0')]=_0x4552ba['name']||'';this[_0xf146('0x1')]=_0x4552ba[_0xf146('0x1')]||{};}module[_0xf146('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 de56025..63e4984 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 _0x82cd=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','mailPause','paused','available','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x57be6d,_0x2bb7f3){var _0x70d9e2=function(_0x4fbffc){while(--_0x4fbffc){_0x57be6d['push'](_0x57be6d['shift']());}};_0x70d9e2(++_0x2bb7f3);}(_0x82cd,0x1f3));var _0xd82c=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x82cd[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0xd82c('0x0'));var md5=require(_0xd82c('0x1'));var util=require(_0xd82c('0x2'));var Redis=require(_0xd82c('0x3'));var config=require('../../../config/environment');config[_0xd82c('0x4')]=_[_0xd82c('0x5')](config['redis'],{'host':_0xd82c('0x6'),'port':0x18eb});var io=require(_0xd82c('0x7'))(new Redis(config[_0xd82c('0x4')]));function MailQueue(_0x1806ad){this['id']=_0x1806ad['id']||0x0;this[_0xd82c('0x8')]=_0x1806ad[_0xd82c('0x8')]||'';this[_0xd82c('0x9')]=_0x1806ad[_0xd82c('0x9')]||0xa;this[_0xd82c('0xa')]=_0x1806ad['strategy']||_0xd82c('0xb');this[_0xd82c('0xc')]=_0x1806ad[_0xd82c('0xc')];this[_0xd82c('0xd')]={};this[_0xd82c('0xe')]=0x0;this[_0xd82c('0x1')]='';this[_0xd82c('0xf')]();this[_0xd82c('0x10')]();}MailQueue[_0xd82c('0x11')][_0xd82c('0xf')]=function(){var _0x27b914=this[_0xd82c('0xd')][_0xd82c('0x12')];this['mapAgentsId']=_[_0xd82c('0x13')](this[_0xd82c('0xc')],'id');this[_0xd82c('0xd')][_0xd82c('0x12')]=_0x27b914;};MailQueue[_0xd82c('0x11')]['updateRealtime']=function(){this[_0xd82c('0x14')]=0x0;this['paused']=0x0;for(var _0x5772f9=0x0;_0x5772f9=0x0?this[_0xd82c('0x19')]:0x0;var _0x3f99db={'id':this['id'],'available':this[_0xd82c('0x19')],'loggedIn':this[_0xd82c('0x14')],'name':this[_0xd82c('0x8')],'paused':this[_0xd82c('0x18')],'waiting':this['waiting']};var _0x9abfcb=md5(JSON['stringify'](_0x3f99db));if(this['md5']!==_0x9abfcb){this[_0xd82c('0x1')]=_0x9abfcb;io['to'](util[_0xd82c('0x1a')](_0xd82c('0x1b'),_0x3f99db[_0xd82c('0x8')]))['emit'](_0xd82c('0x1c'),_0x3f99db);}};module[_0xd82c('0x1d')]=MailQueue; \ No newline at end of file +var _0x234c=['exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','prototype','map','Agents','loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save'];(function(_0x4444dd,_0x1a6371){var _0xf67028=function(_0x102091){while(--_0x102091){_0x4444dd['push'](_0x4444dd['shift']());}};_0xf67028(++_0x1a6371);}(_0x234c,0x1e1));var _0xc234=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x234c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc234('0x0'));var md5=require(_0xc234('0x1'));var util=require(_0xc234('0x2'));var Redis=require(_0xc234('0x3'));var config=require(_0xc234('0x4'));config[_0xc234('0x5')]=_[_0xc234('0x6')](config['redis'],{'host':_0xc234('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc234('0x5')]));function MailQueue(_0x3a11ce){this['id']=_0x3a11ce['id']||0x0;this[_0xc234('0x8')]=_0x3a11ce[_0xc234('0x8')]||'';this[_0xc234('0x9')]=_0x3a11ce['timeout']||0xa;this[_0xc234('0xa')]=_0x3a11ce[_0xc234('0xa')]||_0xc234('0xb');this['Agents']=_0x3a11ce['Agents'];this[_0xc234('0xc')]={};this[_0xc234('0xd')]=0x0;this[_0xc234('0x1')]='';this[_0xc234('0xe')]();this['updateRealtime']();}MailQueue[_0xc234('0xf')][_0xc234('0xe')]=function(){var _0x27486f=this[_0xc234('0xc')]['_rr'];this['mapAgentsId']=_[_0xc234('0x10')](this[_0xc234('0x11')],'id');this[_0xc234('0xc')]['_rr']=_0x27486f;};MailQueue[_0xc234('0xf')]['updateRealtime']=function(){this[_0xc234('0x12')]=0x0;this[_0xc234('0x13')]=0x0;for(var _0x191139=0x0;_0x191139=0x0?this[_0xc234('0x17')]:0x0;var _0x3398f6={'id':this['id'],'available':this[_0xc234('0x17')],'loggedIn':this[_0xc234('0x12')],'name':this[_0xc234('0x8')],'paused':this['paused'],'waiting':this[_0xc234('0xd')]};var _0x4a6ab1=md5(JSON[_0xc234('0x18')](_0x3398f6));if(this['md5']!==_0x4a6ab1){this[_0xc234('0x1')]=_0x4a6ab1;io['to'](util[_0xc234('0x19')](_0xc234('0x1a'),_0x3398f6['name']))[_0xc234('0x1b')](_0xc234('0x1c'),_0x3398f6);}};module[_0xc234('0x1d')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 47ef483..1ac0357 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 _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x326f,0xd1));var _0xf326=function(_0x2f41a7,_0x673b81){_0x2f41a7=_0x2f41a7-0x0;var _0x432f7e=_0x326f[_0x2f41a7];return _0x432f7e;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x7a54,0x106));var _0x47a5=function(_0x303820,_0x563a0b){_0x303820=_0x303820-0x0;var _0x4a57e4=_0x7a54[_0x303820];return _0x4a57e4;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index fe32def..5c73b1a 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 _0x9e9b=['stringify','md5','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','map','_rr','prototype','paused','length','online','loggedIn','smsPause','available'];(function(_0x3e2a69,_0x49e167){var _0x41c3f0=function(_0x27895d){while(--_0x27895d){_0x3e2a69['push'](_0x3e2a69['shift']());}};_0x41c3f0(++_0x49e167);}(_0x9e9b,0x1a7));var _0xb9e9=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x9e9b[_0xbb9dbf];return _0x30223c;};'use strict';var _=require(_0xb9e9('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xb9e9('0x1'));var config=require(_0xb9e9('0x2'));config[_0xb9e9('0x3')]=_[_0xb9e9('0x4')](config['redis'],{'host':_0xb9e9('0x5'),'port':0x18eb});var io=require(_0xb9e9('0x6'))(new Redis(config['redis']));function SmsQueue(_0x433bb4){this['id']=_0x433bb4['id']||0x0;this[_0xb9e9('0x7')]=_0x433bb4[_0xb9e9('0x7')]||'';this[_0xb9e9('0x8')]=_0x433bb4[_0xb9e9('0x8')]||0xa;this[_0xb9e9('0x9')]=_0x433bb4[_0xb9e9('0x9')]||_0xb9e9('0xa');this[_0xb9e9('0xb')]=_0x433bb4[_0xb9e9('0xb')];this[_0xb9e9('0xc')]={};this[_0xb9e9('0xd')]=0x0;this['md5']='';this[_0xb9e9('0xe')]();this[_0xb9e9('0xf')]();}SmsQueue['prototype'][_0xb9e9('0xe')]=function(){var _0x34b9f7=this[_0xb9e9('0xc')]['_rr'];this['mapAgentsId']=_[_0xb9e9('0x10')](this[_0xb9e9('0xb')],'id');this[_0xb9e9('0xc')][_0xb9e9('0x11')]=_0x34b9f7;};SmsQueue[_0xb9e9('0x12')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xb9e9('0x13')]=0x0;for(var _0xac8104=0x0;_0xac8104=0x0?this[_0xb9e9('0x18')]:0x0;var _0x407bf4={'id':this['id'],'available':this[_0xb9e9('0x18')],'loggedIn':this[_0xb9e9('0x16')],'name':this[_0xb9e9('0x7')],'paused':this[_0xb9e9('0x13')],'waiting':this[_0xb9e9('0xd')]};var _0x251402=md5(JSON[_0xb9e9('0x19')](_0x407bf4));if(this[_0xb9e9('0x1a')]!==_0x251402){this[_0xb9e9('0x1a')]=_0x251402;io['to'](util[_0xb9e9('0x1b')](_0xb9e9('0x1c'),_0x407bf4[_0xb9e9('0x7')]))[_0xb9e9('0x1d')](_0xb9e9('0x1e'),_0x407bf4);}};module[_0xb9e9('0x1f')]=SmsQueue; \ No newline at end of file +var _0xb717=['updateRouting','updateRealtime','map','_rr','paused','length','online','smsPause','available','loggedIn','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0xb717,0x1b4));var _0x7b71=function(_0x22d8dd,_0x26990b){_0x22d8dd=_0x22d8dd-0x0;var _0x35fd45=_0xb717[_0x22d8dd];return _0x35fd45;};'use strict';var _=require(_0x7b71('0x0'));var md5=require('md5');var util=require(_0x7b71('0x1'));var Redis=require('ioredis');var config=require(_0x7b71('0x2'));config[_0x7b71('0x3')]=_[_0x7b71('0x4')](config['redis'],{'host':_0x7b71('0x5'),'port':0x18eb});var io=require(_0x7b71('0x6'))(new Redis(config[_0x7b71('0x3')]));function SmsQueue(_0x26044f){this['id']=_0x26044f['id']||0x0;this[_0x7b71('0x7')]=_0x26044f['name']||'';this[_0x7b71('0x8')]=_0x26044f[_0x7b71('0x8')]||0xa;this[_0x7b71('0x9')]=_0x26044f[_0x7b71('0x9')]||_0x7b71('0xa');this['Agents']=_0x26044f[_0x7b71('0xb')];this[_0x7b71('0xc')]={};this['waiting']=0x0;this[_0x7b71('0xd')]='';this[_0x7b71('0xe')]();this[_0x7b71('0xf')]();}SmsQueue['prototype'][_0x7b71('0xe')]=function(){var _0x4a39d4=this[_0x7b71('0xc')]['_rr'];this[_0x7b71('0xc')]=_[_0x7b71('0x10')](this[_0x7b71('0xb')],'id');this[_0x7b71('0xc')][_0x7b71('0x11')]=_0x4a39d4;};SmsQueue['prototype'][_0x7b71('0xf')]=function(){this['loggedIn']=0x0;this[_0x7b71('0x12')]=0x0;for(var _0x22114a=0x0;_0x22114a=0x0?this['available']:0x0;var _0x1fd67d={'id':this['id'],'available':this[_0x7b71('0x16')],'loggedIn':this[_0x7b71('0x17')],'name':this[_0x7b71('0x7')],'paused':this[_0x7b71('0x12')],'waiting':this['waiting']};var _0xa1ba78=md5(JSON[_0x7b71('0x18')](_0x1fd67d));if(this[_0x7b71('0xd')]!==_0xa1ba78){this[_0x7b71('0xd')]=_0xa1ba78;io['to'](util[_0x7b71('0x19')](_0x7b71('0x1a'),_0x1fd67d['name']))[_0x7b71('0x1b')](_0x7b71('0x1c'),_0x1fd67d);}};module[_0x7b71('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index d0f7eaa..d05cd38 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 _0x6eb0=['exports','lodash','md5','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','whatsappPause','available','waiting','stringify','emit','whatsapp_queue:save'];(function(_0x4487f3,_0x281248){var _0x34a15d=function(_0x2bb3ed){while(--_0x2bb3ed){_0x4487f3['push'](_0x4487f3['shift']());}};_0x34a15d(++_0x281248);}(_0x6eb0,0x1cc));var _0x06eb=function(_0x2a5e34,_0x449735){_0x2a5e34=_0x2a5e34-0x0;var _0x44760f=_0x6eb0[_0x2a5e34];return _0x44760f;};'use strict';var _=require(_0x06eb('0x0'));var md5=require(_0x06eb('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x06eb('0x2'));config[_0x06eb('0x3')]=_[_0x06eb('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x06eb('0x5'))(new Redis(config[_0x06eb('0x3')]));function WhatsappQueue(_0x26fdfa){this['id']=_0x26fdfa['id']||0x0;this[_0x06eb('0x6')]=_0x26fdfa['name']||'';this['timeout']=_0x26fdfa[_0x06eb('0x7')]||0xa;this[_0x06eb('0x8')]=_0x26fdfa[_0x06eb('0x8')]||_0x06eb('0x9');this[_0x06eb('0xa')]=_0x26fdfa[_0x06eb('0xa')];this[_0x06eb('0xb')]={};this['waiting']=0x0;this[_0x06eb('0x1')]='';this[_0x06eb('0xc')]();this[_0x06eb('0xd')]();}WhatsappQueue[_0x06eb('0xe')][_0x06eb('0xc')]=function(){var _0x53c78d=this[_0x06eb('0xb')][_0x06eb('0xf')];this[_0x06eb('0xb')]=_[_0x06eb('0x10')](this[_0x06eb('0xa')],'id');this[_0x06eb('0xb')][_0x06eb('0xf')]=_0x53c78d;};WhatsappQueue[_0x06eb('0xe')]['updateRealtime']=function(){this[_0x06eb('0x11')]=0x0;this[_0x06eb('0x12')]=0x0;for(var _0x4b2da6=0x0;_0x4b2da6=0x0?this[_0x06eb('0x15')]:0x0;var _0x386a69={'id':this['id'],'available':this[_0x06eb('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x06eb('0x6')],'paused':this[_0x06eb('0x12')],'waiting':this[_0x06eb('0x16')]};var _0x50231d=md5(JSON[_0x06eb('0x17')](_0x386a69));if(this[_0x06eb('0x1')]!==_0x50231d){this[_0x06eb('0x1')]=_0x50231d;io['to'](util['format']('whatsapp:queue:%s',_0x386a69[_0x06eb('0x6')]))[_0x06eb('0x18')](_0x06eb('0x19'),_0x386a69);}};module[_0x06eb('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x2774=['updateRouting','updateRealtime','_rr','map','loggedIn','paused','length','online','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x397256,_0x6514b1){var _0x4249ad=function(_0x1c44ef){while(--_0x1c44ef){_0x397256['push'](_0x397256['shift']());}};_0x4249ad(++_0x6514b1);}(_0x2774,0x15f));var _0x4277=function(_0x474c6e,_0x450d5c){_0x474c6e=_0x474c6e-0x0;var _0x35b496=_0x2774[_0x474c6e];return _0x35b496;};'use strict';var _=require(_0x4277('0x0'));var md5=require(_0x4277('0x1'));var util=require(_0x4277('0x2'));var Redis=require(_0x4277('0x3'));var config=require(_0x4277('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0x4277('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x2bb266){this['id']=_0x2bb266['id']||0x0;this[_0x4277('0x6')]=_0x2bb266[_0x4277('0x6')]||'';this[_0x4277('0x7')]=_0x2bb266['timeout']||0xa;this['strategy']=_0x2bb266[_0x4277('0x8')]||_0x4277('0x9');this[_0x4277('0xa')]=_0x2bb266['Agents'];this[_0x4277('0xb')]={};this[_0x4277('0xc')]=0x0;this[_0x4277('0x1')]='';this[_0x4277('0xd')]();this[_0x4277('0xe')]();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x293923=this['mapAgentsId'][_0x4277('0xf')];this[_0x4277('0xb')]=_[_0x4277('0x10')](this[_0x4277('0xa')],'id');this[_0x4277('0xb')][_0x4277('0xf')]=_0x293923;};WhatsappQueue['prototype'][_0x4277('0xe')]=function(){this[_0x4277('0x11')]=0x0;this[_0x4277('0x12')]=0x0;for(var _0x3143f2=0x0;_0x3143f2=0x0?this[_0x4277('0x15')]:0x0;var _0x366470={'id':this['id'],'available':this[_0x4277('0x15')],'loggedIn':this[_0x4277('0x11')],'name':this[_0x4277('0x6')],'paused':this['paused'],'waiting':this[_0x4277('0xc')]};var _0x26170f=md5(JSON[_0x4277('0x16')](_0x366470));if(this[_0x4277('0x1')]!==_0x26170f){this['md5']=_0x26170f;io['to'](util[_0x4277('0x17')](_0x4277('0x18'),_0x366470['name']))[_0x4277('0x19')](_0x4277('0x1a'),_0x366470);}};module[_0x4277('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 403786f..21c082a 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 57ec61b..2bd0351 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 _0x7ad3=['update','Request','UpdateChatInteraction','updateChatInteraction','../client'];(function(_0x4d7c72,_0x13a98d){var _0x289eca=function(_0x5a9f8e){while(--_0x5a9f8e){_0x4d7c72['push'](_0x4d7c72['shift']());}};_0x289eca(++_0x13a98d);}(_0x7ad3,0xc2));var _0x37ad=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0x7ad3[_0x5b34c0];return _0x242bd3;};'use strict';var client=require(_0x37ad('0x0'));exports[_0x37ad('0x1')]=function(_0x506d90,_0x2307f4){return client[_0x37ad('0x2')](_0x37ad('0x3'),{'body':_0x2307f4,'options':{'where':{'id':_0x506d90}},'log':_0x37ad('0x4')});};exports['addTags']=function(_0x19b0f4,_0x1464c0){return client[_0x37ad('0x2')]('AddTagsToChatInteraction',{'body':_0x1464c0,'options':{'where':{'id':_0x19b0f4}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x819a=['addTagsToChatInteraction','../client','update','UpdateChatInteraction','updateChatInteraction','addTags','Request','AddTagsToChatInteraction'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x819a,0x139));var _0xa819=function(_0xf1ceb4,_0x3443e6){_0xf1ceb4=_0xf1ceb4-0x0;var _0x42ed45=_0x819a[_0xf1ceb4];return _0x42ed45;};'use strict';var client=require(_0xa819('0x0'));exports[_0xa819('0x1')]=function(_0x3b32e6,_0x5bb452){return client['Request'](_0xa819('0x2'),{'body':_0x5bb452,'options':{'where':{'id':_0x3b32e6}},'log':_0xa819('0x3')});};exports[_0xa819('0x4')]=function(_0x201ab2,_0x3fe5c7){return client[_0xa819('0x5')](_0xa819('0x6'),{'body':_0x3fe5c7,'options':{'where':{'id':_0x201ab2}},'log':_0xa819('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index b5ee29a..f432dcf 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 _0xf267=['CreateChatMessage','createChatMessage','../client','create','Request'];(function(_0x271a4d,_0x3514ca){var _0x161c55=function(_0x1fed4a){while(--_0x1fed4a){_0x271a4d['push'](_0x271a4d['shift']());}};_0x161c55(++_0x3514ca);}(_0xf267,0x6b));var _0x7f26=function(_0x9fac4d,_0x21d225){_0x9fac4d=_0x9fac4d-0x0;var _0x2095f0=_0xf267[_0x9fac4d];return _0x2095f0;};'use strict';var client=require(_0x7f26('0x0'));exports[_0x7f26('0x1')]=function(_0x579b5d){return client[_0x7f26('0x2')](_0x7f26('0x3'),{'body':_0x579b5d,'log':_0x7f26('0x4')});}; \ No newline at end of file +var _0x1880=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x1880,0xe7));var _0x0188=function(_0x381379,_0x3f3b86){_0x381379=_0x381379-0x0;var _0x3e1063=_0x1880[_0x381379];return _0x3e1063;};'use strict';var client=require(_0x0188('0x0'));exports[_0x0188('0x1')]=function(_0x3d32d9){return client[_0x0188('0x2')](_0x0188('0x3'),{'body':_0x3d32d9,'log':_0x0188('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 522f0fe..6381afd 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 _0x2f2e=['User','Agents','getChatQueues','Request','name','strategy'];(function(_0x528dde,_0x3a13a0){var _0x2a0faf=function(_0x3bfe3c){while(--_0x3bfe3c){_0x528dde['push'](_0x528dde['shift']());}};_0x2a0faf(++_0x3a13a0);}(_0x2f2e,0x146));var _0xe2f2=function(_0x11a566,_0x4b82c5){_0x11a566=_0x11a566-0x0;var _0x2395ac=_0x2f2e[_0x11a566];return _0x2395ac;};'use strict';var client=require('../client');exports[_0xe2f2('0x0')]=function(){return function(){return client[_0xe2f2('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xe2f2('0x2'),'timeout',_0xe2f2('0x3')],'include':[{'model':_0xe2f2('0x4'),'as':_0xe2f2('0x5'),'attributes':['id',_0xe2f2('0x2'),'online','chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x770d=['../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy','Agents','online','chatPause'];(function(_0x41bc46,_0x5079c0){var _0x2c55f0=function(_0x169d3b){while(--_0x169d3b){_0x41bc46['push'](_0x41bc46['shift']());}};_0x2c55f0(++_0x5079c0);}(_0x770d,0x122));var _0xd770=function(_0x2185e1,_0x5dd29c){_0x2185e1=_0x2185e1-0x0;var _0x3b5c4c=_0x770d[_0x2185e1];return _0x3b5c4c;};'use strict';var client=require(_0xd770('0x0'));exports[_0xd770('0x1')]=function(){return function(){return client[_0xd770('0x2')](_0xd770('0x3'),{'options':{'raw':![],'attributes':['id',_0xd770('0x4'),_0xd770('0x5'),_0xd770('0x6')],'include':[{'model':'User','as':_0xd770('0x7'),'attributes':['id',_0xd770('0x4'),_0xd770('0x8'),_0xd770('0x9')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 6edb413..7f6c783 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 _0x4584=['CreateChatQueueReport','UpdateChatQueueReport','DESC','../client','Request'];(function(_0x2ac319,_0x4a0428){var _0x388930=function(_0x339d77){while(--_0x339d77){_0x2ac319['push'](_0x2ac319['shift']());}};_0x388930(++_0x4a0428);}(_0x4584,0x1cf));var _0x4458=function(_0x1bed81,_0x4b326a){_0x1bed81=_0x1bed81-0x0;var _0x2ac7ac=_0x4584[_0x1bed81];return _0x2ac7ac;};'use strict';var client=require(_0x4458('0x0'));exports['create']=function(_0x2d7385){return client[_0x4458('0x1')](_0x4458('0x2'),{'body':_0x2d7385,'log':'CreateChatQueueReport'});};exports['update']=function(_0x18e5c6,_0xde5996){return client[_0x4458('0x1')](_0x4458('0x3'),{'body':_0xde5996,'options':{'where':{'uniqueid':_0x18e5c6},'order':[['id',_0x4458('0x4')]],'limit':0x1},'log':_0x4458('0x3')});}; \ No newline at end of file +var _0x8fcf=['DESC','../client','create','CreateChatQueueReport','Request','UpdateChatQueueReport'];(function(_0x57aa9d,_0x40382c){var _0x43fd79=function(_0x4cfd97){while(--_0x4cfd97){_0x57aa9d['push'](_0x57aa9d['shift']());}};_0x43fd79(++_0x40382c);}(_0x8fcf,0x1db));var _0xf8fc=function(_0x3e156b,_0x3a22e8){_0x3e156b=_0x3e156b-0x0;var _0xea621=_0x8fcf[_0x3e156b];return _0xea621;};'use strict';var client=require(_0xf8fc('0x0'));exports[_0xf8fc('0x1')]=function(_0x32229e){return client['Request'](_0xf8fc('0x2'),{'body':_0x32229e,'log':'CreateChatQueueReport'});};exports['update']=function(_0x5a5263,_0x33afd1){return client[_0xf8fc('0x3')](_0xf8fc('0x4'),{'body':_0x33afd1,'options':{'where':{'uniqueid':_0x5a5263},'order':[['id',_0xf8fc('0x5')]],'limit':0x1},'log':_0xf8fc('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 15a8686..ab4e99e 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(_0x545a3a,_0x3123aa){var _0x5a5493=function(_0x4e6bce){while(--_0x4e6bce){_0x545a3a['push'](_0x545a3a['shift']());}};_0x5a5493(++_0x3123aa);}(_0x7a54,0x106));var _0x47a5=function(_0x32396c,_0x144e28){_0x32396c=_0x32396c-0x0;var _0x1ea303=_0x7a54[_0x32396c];return _0x1ea303;};'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 _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x3ee55a,_0x19aeea){var _0x581800=function(_0x636cb7){while(--_0x636cb7){_0x3ee55a['push'](_0x3ee55a['shift']());}};_0x581800(++_0x19aeea);}(_0x7a54,0x106));var _0x47a5=function(_0xb5046,_0x4d3293){_0xb5046=_0xb5046-0x0;var _0xddd5a=_0x7a54[_0xb5046];return _0xddd5a;};'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 diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 209f81f..9060e62 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 _0xfe60=['createFaxMessage','../client','create','CreateFaxMessage'];(function(_0x31dbd9,_0x452f48){var _0x23a849=function(_0x9f601a){while(--_0x9f601a){_0x31dbd9['push'](_0x31dbd9['shift']());}};_0x23a849(++_0x452f48);}(_0xfe60,0x1a9));var _0x0fe6=function(_0x356ad9,_0x3f6844){_0x356ad9=_0x356ad9-0x0;var _0x336142=_0xfe60[_0x356ad9];return _0x336142;};'use strict';var client=require(_0x0fe6('0x0'));exports[_0x0fe6('0x1')]=function(_0x4bf293){return client['Request'](_0x0fe6('0x2'),{'body':_0x4bf293,'log':_0x0fe6('0x3')});}; \ No newline at end of file +var _0x279c=['../client','create','Request','createFaxMessage'];(function(_0x33d4a2,_0x2baaf4){var _0x2c793f=function(_0x414303){while(--_0x414303){_0x33d4a2['push'](_0x33d4a2['shift']());}};_0x2c793f(++_0x2baaf4);}(_0x279c,0x100));var _0xc279=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x279c[_0x9cd4c3];return _0x4c9025;};'use strict';var client=require(_0xc279('0x0'));exports[_0xc279('0x1')]=function(_0x53323c){return client[_0xc279('0x2')]('CreateFaxMessage',{'body':_0x53323c,'log':_0xc279('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index ce10e8b..335e336 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 _0x44ca=['GetFaxQueue','name','timeout','strategy','User','online','faxPause','../client','getFaxQueues','Request'];(function(_0xf1ceb4,_0x3443e6){var _0x42ed45=function(_0x9ec7fa){while(--_0x9ec7fa){_0xf1ceb4['push'](_0xf1ceb4['shift']());}};_0x42ed45(++_0x3443e6);}(_0x44ca,0x7f));var _0xa44c=function(_0x27bcf5,_0x236765){_0x27bcf5=_0x27bcf5-0x0;var _0x4ce4cf=_0x44ca[_0x27bcf5];return _0x4ce4cf;};'use strict';var client=require(_0xa44c('0x0'));exports[_0xa44c('0x1')]=function(){return function(){return client[_0xa44c('0x2')](_0xa44c('0x3'),{'options':{'raw':![],'attributes':['id',_0xa44c('0x4'),_0xa44c('0x5'),_0xa44c('0x6')],'include':[{'model':_0xa44c('0x7'),'as':'Agents','attributes':['id',_0xa44c('0x4'),_0xa44c('0x8'),_0xa44c('0x9')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x4edb=['getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','Agents','online'];(function(_0x37c120,_0x40349b){var _0x7313f2=function(_0x4f28f0){while(--_0x4f28f0){_0x37c120['push'](_0x37c120['shift']());}};_0x7313f2(++_0x40349b);}(_0x4edb,0x130));var _0xb4ed=function(_0x121350,_0x361f4d){_0x121350=_0x121350-0x0;var _0x2e21c7=_0x4edb[_0x121350];return _0x2e21c7;};'use strict';var client=require('../client');exports[_0xb4ed('0x0')]=function(){return function(){return client[_0xb4ed('0x1')](_0xb4ed('0x2'),{'options':{'raw':![],'attributes':['id',_0xb4ed('0x3'),_0xb4ed('0x4'),_0xb4ed('0x5')],'include':[{'model':'User','as':_0xb4ed('0x6'),'attributes':['id',_0xb4ed('0x3'),_0xb4ed('0x7'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index abdc8b0..8b38429 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 _0x74dd=['DESC','../client','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x1db1b9,_0xba8095){var _0x2678bb=function(_0x4bd8c3){while(--_0x4bd8c3){_0x1db1b9['push'](_0x1db1b9['shift']());}};_0x2678bb(++_0xba8095);}(_0x74dd,0xc1));var _0xd74d=function(_0x1a31e8,_0x5387bc){_0x1a31e8=_0x1a31e8-0x0;var _0x3adc72=_0x74dd[_0x1a31e8];return _0x3adc72;};'use strict';var client=require(_0xd74d('0x0'));exports['create']=function(_0x32e274){return client[_0xd74d('0x1')](_0xd74d('0x2'),{'body':_0x32e274,'log':'CreateFaxQueueReport'});};exports[_0xd74d('0x3')]=function(_0x5a023b,_0x2e2cc9){return client[_0xd74d('0x1')](_0xd74d('0x4'),{'body':_0x2e2cc9,'options':{'where':{'uniqueid':_0x5a023b},'order':[['id',_0xd74d('0x5')]],'limit':0x1},'log':_0xd74d('0x4')});}; \ No newline at end of file +var _0xa7a9=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xa7a9,0x10e));var _0x9a7a=function(_0x165b3c,_0x20078e){_0x165b3c=_0x165b3c-0x0;var _0x54dc24=_0xa7a9[_0x165b3c];return _0x54dc24;};'use strict';var client=require(_0x9a7a('0x0'));exports[_0x9a7a('0x1')]=function(_0x10daee){return client[_0x9a7a('0x2')](_0x9a7a('0x3'),{'body':_0x10daee,'log':_0x9a7a('0x3')});};exports[_0x9a7a('0x4')]=function(_0x3e912c,_0x527359){return client[_0x9a7a('0x2')](_0x9a7a('0x5'),{'body':_0x527359,'options':{'where':{'uniqueid':_0x3e912c},'order':[['id',_0x9a7a('0x6')]],'limit':0x1},'log':_0x9a7a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 924df80..688a5b6 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 _0xf77f=['Request','GetInterval','Intervals','../client','getIntervals'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0xf77f,0xda));var _0xff77=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xf77f[_0x487b0c];return _0x1adbdc;};'use strict';var client=require(_0xff77('0x0'));exports[_0xff77('0x1')]=function(){return function(){return client[_0xff77('0x2')](_0xff77('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0xff77('0x4'),'attributes':['id','name','interval']}]},'log':_0xff77('0x1')});};}; \ No newline at end of file +var _0x2e8c=['Request','name','Intervals','interval','../client','getIntervals'];(function(_0x47c9b1,_0x119667){var _0x314445=function(_0x547906){while(--_0x547906){_0x47c9b1['push'](_0x47c9b1['shift']());}};_0x314445(++_0x119667);}(_0x2e8c,0x178));var _0xc2e8=function(_0x32915b,_0x4819e5){_0x32915b=_0x32915b-0x0;var _0x1479ed=_0x2e8c[_0x32915b];return _0x1479ed;};'use strict';var client=require(_0xc2e8('0x0'));exports[_0xc2e8('0x1')]=function(){return function(){return client[_0xc2e8('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xc2e8('0x3')],'include':[{'model':'Interval','as':_0xc2e8('0x4'),'attributes':['id',_0xc2e8('0x3'),_0xc2e8('0x5')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 791d6ee..09fcf71 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 _0x4137=['updateMailInteraction','addTags','AddTagsToMailInteraction','../client','update','Request','UpdateMailInteraction'];(function(_0x297eea,_0x5060be){var _0x1c42d2=function(_0x3afff4){while(--_0x3afff4){_0x297eea['push'](_0x297eea['shift']());}};_0x1c42d2(++_0x5060be);}(_0x4137,0xf8));var _0x7413=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4137[_0x4a9fb1];return _0x348672;};'use strict';var client=require(_0x7413('0x0'));exports[_0x7413('0x1')]=function(_0x370399,_0x4f372c){return client[_0x7413('0x2')](_0x7413('0x3'),{'body':_0x4f372c,'options':{'where':{'id':_0x370399}},'log':_0x7413('0x4')});};exports[_0x7413('0x5')]=function(_0x258255,_0x3dc48a){return client[_0x7413('0x2')](_0x7413('0x6'),{'body':_0x3dc48a,'options':{'where':{'id':_0x258255}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x33af=['addTags','AddTagsToMailInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x4d7a70,_0x2d3bfa){var _0x3aafbb=function(_0x43fbf2){while(--_0x43fbf2){_0x4d7a70['push'](_0x4d7a70['shift']());}};_0x3aafbb(++_0x2d3bfa);}(_0x33af,0xec));var _0xf33a=function(_0x4e7af4,_0x758572){_0x4e7af4=_0x4e7af4-0x0;var _0x2548f1=_0x33af[_0x4e7af4];return _0x2548f1;};'use strict';var client=require('../client');exports[_0xf33a('0x0')]=function(_0x54b114,_0x2137be){return client[_0xf33a('0x1')](_0xf33a('0x2'),{'body':_0x2137be,'options':{'where':{'id':_0x54b114}},'log':_0xf33a('0x3')});};exports[_0xf33a('0x4')]=function(_0x25f156,_0x4c734e){return client[_0xf33a('0x1')](_0xf33a('0x5'),{'body':_0x4c734e,'options':{'where':{'id':_0x25f156}},'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 844b145..681e6db 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 _0xf13e=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x2baf73,_0x55f17b){var _0x5b20ae=function(_0x5deb3c){while(--_0x5deb3c){_0x2baf73['push'](_0x2baf73['shift']());}};_0x5b20ae(++_0x55f17b);}(_0xf13e,0x111));var _0xef13=function(_0x1938f4,_0x5c0c98){_0x1938f4=_0x1938f4-0x0;var _0x37f4db=_0xf13e[_0x1938f4];return _0x37f4db;};'use strict';var client=require(_0xef13('0x0'));exports[_0xef13('0x1')]=function(_0x931f47){return client[_0xef13('0x2')](_0xef13('0x3'),{'body':_0x931f47,'log':_0xef13('0x4')});}; \ No newline at end of file +var _0xab1f=['Request','CreateMailMessage','../client'];(function(_0x5678b5,_0x1c4aa8){var _0x4c09a5=function(_0x2aa89a){while(--_0x2aa89a){_0x5678b5['push'](_0x5678b5['shift']());}};_0x4c09a5(++_0x1c4aa8);}(_0xab1f,0x17f));var _0xfab1=function(_0x39b912,_0x35df5e){_0x39b912=_0x39b912-0x0;var _0x12e279=_0xab1f[_0x39b912];return _0x12e279;};'use strict';var client=require(_0xfab1('0x0'));exports['create']=function(_0x48deef){return client[_0xfab1('0x1')](_0xfab1('0x2'),{'body':_0x48deef,'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 71bc884..c664b94 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 _0x7298=['Request','name','timeout','User','online','mailPause','getMailQueues','../client'];(function(_0x3e4608,_0xe7c77a){var _0x8d1488=function(_0xdc3c1c){while(--_0xdc3c1c){_0x3e4608['push'](_0x3e4608['shift']());}};_0x8d1488(++_0xe7c77a);}(_0x7298,0x12f));var _0x8729=function(_0x2e9b9e,_0x3d34c8){_0x2e9b9e=_0x2e9b9e-0x0;var _0x2e9c8d=_0x7298[_0x2e9b9e];return _0x2e9c8d;};'use strict';var client=require(_0x8729('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x8729('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x8729('0x2'),_0x8729('0x3'),'strategy'],'include':[{'model':_0x8729('0x4'),'as':'Agents','attributes':['id',_0x8729('0x2'),_0x8729('0x5'),_0x8729('0x6')]}]},'log':_0x8729('0x7')});};}; \ No newline at end of file +var _0xe5ee=['getMailQueues','Request','name','timeout','strategy','online','mailPause','../client'];(function(_0x5adb49,_0x20d550){var _0x593ef7=function(_0x36545d){while(--_0x36545d){_0x5adb49['push'](_0x5adb49['shift']());}};_0x593ef7(++_0x20d550);}(_0xe5ee,0x8f));var _0xee5e=function(_0x2aa890,_0x1b595d){_0x2aa890=_0x2aa890-0x0;var _0x550247=_0xe5ee[_0x2aa890];return _0x550247;};'use strict';var client=require(_0xee5e('0x0'));exports[_0xee5e('0x1')]=function(){return function(){return client[_0xee5e('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xee5e('0x3'),_0xee5e('0x4'),_0xee5e('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xee5e('0x3'),_0xee5e('0x6'),_0xee5e('0x7')]}]},'log':_0xee5e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index d06c24f..6b426f6 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 _0x4fd6=['DESC','../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x4e61e3,_0x27b89f){var _0x4ff99b=function(_0x3c1b7e){while(--_0x3c1b7e){_0x4e61e3['push'](_0x4e61e3['shift']());}};_0x4ff99b(++_0x27b89f);}(_0x4fd6,0x143));var _0x64fd=function(_0x5d6c3e,_0x409a3e){_0x5d6c3e=_0x5d6c3e-0x0;var _0x44ecb7=_0x4fd6[_0x5d6c3e];return _0x44ecb7;};'use strict';var client=require(_0x64fd('0x0'));exports[_0x64fd('0x1')]=function(_0x2f6828){return client[_0x64fd('0x2')](_0x64fd('0x3'),{'body':_0x2f6828,'log':_0x64fd('0x3')});};exports[_0x64fd('0x4')]=function(_0x447441,_0xed96c9){return client[_0x64fd('0x2')](_0x64fd('0x5'),{'body':_0xed96c9,'options':{'where':{'uniqueid':_0x447441},'order':[['id',_0x64fd('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xad0b=['UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport','update'];(function(_0x320aec,_0x500c4e){var _0x4e0690=function(_0x4da050){while(--_0x4da050){_0x320aec['push'](_0x320aec['shift']());}};_0x4e0690(++_0x500c4e);}(_0xad0b,0xcd));var _0xbad0=function(_0x4038d3,_0x505d2f){_0x4038d3=_0x4038d3-0x0;var _0x263009=_0xad0b[_0x4038d3];return _0x263009;};'use strict';var client=require(_0xbad0('0x0'));exports[_0xbad0('0x1')]=function(_0x1b506f){return client[_0xbad0('0x2')](_0xbad0('0x3'),{'body':_0x1b506f,'log':'CreateMailQueueReport'});};exports[_0xbad0('0x4')]=function(_0x2109c5,_0x1476a3){return client[_0xbad0('0x2')](_0xbad0('0x5'),{'body':_0x1476a3,'options':{'where':{'uniqueid':_0x2109c5},'order':[['id',_0xbad0('0x6')]],'limit':0x1},'log':_0xbad0('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 441f2cc..73e2eb4 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 _0x6c21=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','Request','UpdateOpenchannelInteraction'];(function(_0x15f83b,_0xda546){var _0x133e82=function(_0x6f24ee){while(--_0x6f24ee){_0x15f83b['push'](_0x15f83b['shift']());}};_0x133e82(++_0xda546);}(_0x6c21,0xb7));var _0x16c2=function(_0x50c154,_0x4e08a2){_0x50c154=_0x50c154-0x0;var _0x23aad4=_0x6c21[_0x50c154];return _0x23aad4;};'use strict';var client=require('../client');exports['update']=function(_0x3be654,_0x4f3d8){return client[_0x16c2('0x0')](_0x16c2('0x1'),{'body':_0x4f3d8,'options':{'where':{'id':_0x3be654}},'log':_0x16c2('0x2')});};exports[_0x16c2('0x3')]=function(_0x2c6578,_0x2f8902){return client['Request'](_0x16c2('0x4'),{'body':_0x2f8902,'options':{'where':{'id':_0x2c6578}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x601c=['Request','AddTagsToOpenchannelInteraction','UpdateOpenchannelInteraction','addTags'];(function(_0x82636,_0x23ed5d){var _0x2ff161=function(_0x10adb4){while(--_0x10adb4){_0x82636['push'](_0x82636['shift']());}};_0x2ff161(++_0x23ed5d);}(_0x601c,0x92));var _0xc601=function(_0x3d5949,_0x1e152){_0x3d5949=_0x3d5949-0x0;var _0x4fe99a=_0x601c[_0x3d5949];return _0x4fe99a;};'use strict';var client=require('../client');exports['update']=function(_0x49da23,_0x2651d6){return client['Request'](_0xc601('0x0'),{'body':_0x2651d6,'options':{'where':{'id':_0x49da23}},'log':'updateOpenchannelInteraction'});};exports[_0xc601('0x1')]=function(_0x158d1b,_0x189a48){return client[_0xc601('0x2')](_0xc601('0x3'),{'body':_0x189a48,'options':{'where':{'id':_0x158d1b}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 3169b69..fe4d76d 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 _0x888a=['createOpenchannelMessage','create','CreateOpenchannelMessage'];(function(_0x52a6b7,_0x10996e){var _0x17f1e3=function(_0x23c104){while(--_0x23c104){_0x52a6b7['push'](_0x52a6b7['shift']());}};_0x17f1e3(++_0x10996e);}(_0x888a,0x136));var _0xa888=function(_0x4a427d,_0x148acc){_0x4a427d=_0x4a427d-0x0;var _0x58c4bc=_0x888a[_0x4a427d];return _0x58c4bc;};'use strict';var client=require('../client');exports[_0xa888('0x0')]=function(_0x72bc6c){return client['Request'](_0xa888('0x1'),{'body':_0x72bc6c,'log':_0xa888('0x2')});}; \ No newline at end of file +var _0xeeb4=['createOpenchannelMessage','../client','create','Request','CreateOpenchannelMessage'];(function(_0x1529a3,_0x529f63){var _0x1a0d4b=function(_0x6f1058){while(--_0x6f1058){_0x1529a3['push'](_0x1529a3['shift']());}};_0x1a0d4b(++_0x529f63);}(_0xeeb4,0x18c));var _0x4eeb=function(_0x310d80,_0x350219){_0x310d80=_0x310d80-0x0;var _0x211642=_0xeeb4[_0x310d80];return _0x211642;};'use strict';var client=require(_0x4eeb('0x0'));exports[_0x4eeb('0x1')]=function(_0x5952d4){return client[_0x4eeb('0x2')](_0x4eeb('0x3'),{'body':_0x5952d4,'log':_0x4eeb('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 2fab9b7..1c402e8 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 _0xac41=['name','online','openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue','timeout','strategy','User','Agents'];(function(_0x599b44,_0x2ac37d){var _0x1accea=function(_0x3f1616){while(--_0x3f1616){_0x599b44['push'](_0x599b44['shift']());}};_0x1accea(++_0x2ac37d);}(_0xac41,0x193));var _0x1ac4=function(_0x4d448f,_0x2e4887){_0x4d448f=_0x4d448f-0x0;var _0x3d4478=_0xac41[_0x4d448f];return _0x3d4478;};'use strict';var client=require(_0x1ac4('0x0'));exports[_0x1ac4('0x1')]=function(){return function(){return client['Request'](_0x1ac4('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x1ac4('0x3'),_0x1ac4('0x4')],'include':[{'model':_0x1ac4('0x5'),'as':_0x1ac4('0x6'),'attributes':['id',_0x1ac4('0x7'),_0x1ac4('0x8'),_0x1ac4('0x9')]}]},'log':_0x1ac4('0x1')});};}; \ No newline at end of file +var _0x8e99=['getOpenchannelQueues','Request','name','timeout','strategy','Agents','online','openchannelPause','../client'];(function(_0x3fcc20,_0x57c31b){var _0x15d3ce=function(_0x575619){while(--_0x575619){_0x3fcc20['push'](_0x3fcc20['shift']());}};_0x15d3ce(++_0x57c31b);}(_0x8e99,0x167));var _0x98e9=function(_0x44627f,_0x4da892){_0x44627f=_0x44627f-0x0;var _0x1661d4=_0x8e99[_0x44627f];return _0x1661d4;};'use strict';var client=require(_0x98e9('0x0'));exports[_0x98e9('0x1')]=function(){return function(){return client[_0x98e9('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x98e9('0x3'),_0x98e9('0x4'),_0x98e9('0x5')],'include':[{'model':'User','as':_0x98e9('0x6'),'attributes':['id',_0x98e9('0x3'),_0x98e9('0x7'),_0x98e9('0x8')]}]},'log':_0x98e9('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 23b6aa1..a3579c8 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 _0x1abc=['CreateOpenchannelQueueReport','DESC','UpdateOpenchannelQueueReport','../client','create'];(function(_0x49d853,_0x177f4a){var _0x4121d2=function(_0x17575e){while(--_0x17575e){_0x49d853['push'](_0x49d853['shift']());}};_0x4121d2(++_0x177f4a);}(_0x1abc,0x107));var _0xc1ab=function(_0x13b35d,_0x3ae11c){_0x13b35d=_0x13b35d-0x0;var _0x321790=_0x1abc[_0x13b35d];return _0x321790;};'use strict';var client=require(_0xc1ab('0x0'));exports[_0xc1ab('0x1')]=function(_0x32722a){return client['Request'](_0xc1ab('0x2'),{'body':_0x32722a,'log':_0xc1ab('0x2')});};exports['update']=function(_0x15203c,_0x2fea96){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x2fea96,'options':{'where':{'uniqueid':_0x15203c},'order':[['id',_0xc1ab('0x3')]],'limit':0x1},'log':_0xc1ab('0x4')});}; \ No newline at end of file +var _0x03da=['CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport','DESC','../client','create'];(function(_0x12aa66,_0x2d35c1){var _0x53dfe9=function(_0x2ab011){while(--_0x2ab011){_0x12aa66['push'](_0x12aa66['shift']());}};_0x53dfe9(++_0x2d35c1);}(_0x03da,0xec));var _0xa03d=function(_0x5e9e5f,_0x19aeeb){_0x5e9e5f=_0x5e9e5f-0x0;var _0x4944f5=_0x03da[_0x5e9e5f];return _0x4944f5;};'use strict';var client=require(_0xa03d('0x0'));exports[_0xa03d('0x1')]=function(_0x4be390){return client['Request'](_0xa03d('0x2'),{'body':_0x4be390,'log':_0xa03d('0x2')});};exports[_0xa03d('0x3')]=function(_0x58f520,_0x3b555c){return client[_0xa03d('0x4')](_0xa03d('0x5'),{'body':_0x3b555c,'options':{'where':{'uniqueid':_0x58f520},'order':[['id',_0xa03d('0x6')]],'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 9b82067..10bc9ff 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 _0x639d=['addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','addTags'];(function(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0x639d,0xbb));var _0xd639=function(_0x789985,_0x321cf7){_0x789985=_0x789985-0x0;var _0x4b9730=_0x639d[_0x789985];return _0x4b9730;};'use strict';var client=require(_0xd639('0x0'));exports[_0xd639('0x1')]=function(_0xd1f88b,_0x4987ad){return client[_0xd639('0x2')](_0xd639('0x3'),{'body':_0x4987ad,'options':{'where':{'id':_0xd1f88b}},'log':'updateSmsInteraction'});};exports[_0xd639('0x4')]=function(_0x588a30,_0x19b990){return client['Request']('AddTagsToSmsInteraction',{'body':_0x19b990,'options':{'where':{'id':_0x588a30}},'log':_0xd639('0x5')});}; \ No newline at end of file +var _0xee14=['UpdateSmsInteraction','updateSmsInteraction','addTags','addTagsToSmsInteraction','Request'];(function(_0xbb69cc,_0x5214e9){var _0x5b9f04=function(_0x9a02a8){while(--_0x9a02a8){_0xbb69cc['push'](_0xbb69cc['shift']());}};_0x5b9f04(++_0x5214e9);}(_0xee14,0x13a));var _0x4ee1=function(_0x502223,_0x31f8ef){_0x502223=_0x502223-0x0;var _0x4ffb87=_0xee14[_0x502223];return _0x4ffb87;};'use strict';var client=require('../client');exports['update']=function(_0x3eb7cf,_0x674696){return client[_0x4ee1('0x0')](_0x4ee1('0x1'),{'body':_0x674696,'options':{'where':{'id':_0x3eb7cf}},'log':_0x4ee1('0x2')});};exports[_0x4ee1('0x3')]=function(_0x34a0ae,_0x1e5fb6){return client[_0x4ee1('0x0')]('AddTagsToSmsInteraction',{'body':_0x1e5fb6,'options':{'where':{'id':_0x34a0ae}},'log':_0x4ee1('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index dacf135..b0c8769 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 _0x21c6=['Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x44ddec,_0x30cea3){var _0x3bab44=function(_0x3e9f05){while(--_0x3e9f05){_0x44ddec['push'](_0x44ddec['shift']());}};_0x3bab44(++_0x30cea3);}(_0x21c6,0xc3));var _0x621c=function(_0xcd6c1b,_0x13c40a){_0xcd6c1b=_0xcd6c1b-0x0;var _0x592928=_0x21c6[_0xcd6c1b];return _0x592928;};'use strict';var client=require(_0x621c('0x0'));exports['create']=function(_0x1a388b){return client[_0x621c('0x1')](_0x621c('0x2'),{'body':_0x1a388b,'log':_0x621c('0x3')});}; \ No newline at end of file +var _0xf213=['CreateSmsMessage','../client','create','Request'];(function(_0x2ca2b2,_0x48ea2e){var _0x583856=function(_0x39492a){while(--_0x39492a){_0x2ca2b2['push'](_0x2ca2b2['shift']());}};_0x583856(++_0x48ea2e);}(_0xf213,0x191));var _0x3f21=function(_0x3f920a,_0x2f3451){_0x3f920a=_0x3f920a-0x0;var _0x2c482b=_0xf213[_0x3f920a];return _0x2c482b;};'use strict';var client=require(_0x3f21('0x0'));exports[_0x3f21('0x1')]=function(_0x1fa932){return client[_0x3f21('0x2')](_0x3f21('0x3'),{'body':_0x1fa932,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 7b15b04..5d06bb1 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(_0x11c059,_0x2649d6){var _0x5bb94d=function(_0x5a303d){while(--_0x5a303d){_0x11c059['push'](_0x11c059['shift']());}};_0x5bb94d(++_0x2649d6);}(_0x70e0,0x17b));var _0x070e=function(_0x27b830,_0x396128){_0x27b830=_0x27b830-0x0;var _0x3fee75=_0x70e0[_0x27b830];return _0x3fee75;};'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 _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x1dc608,_0x317979){var _0x2ef0ee=function(_0x40a8e8){while(--_0x40a8e8){_0x1dc608['push'](_0x1dc608['shift']());}};_0x2ef0ee(++_0x317979);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0xcb91[_0x163040];return _0x364667;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 3c695b7..6deae48 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 _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x1d0c7e,_0x40b36c){var _0x30cf02=function(_0x2c8b55){while(--_0x2c8b55){_0x1d0c7e['push'](_0x1d0c7e['shift']());}};_0x30cf02(++_0x40b36c);}(_0x008c,0x188));var _0xc008=function(_0x373202,_0x1a1fd4){_0x373202=_0x373202-0x0;var _0x5e90ab=_0x008c[_0x373202];return _0x5e90ab;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file +var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x1fb001,_0x58daaa){var _0x1650b3=function(_0x5e8582){while(--_0x5e8582){_0x1fb001['push'](_0x1fb001['shift']());}};_0x1650b3(++_0x58daaa);}(_0x34e8,0x12c));var _0x834e=function(_0x2f99b5,_0x2f8fc7){_0x2f99b5=_0x2f99b5-0x0;var _0x2e0d52=_0x34e8[_0x2f99b5];return _0x2e0d52;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index e27ef04..4f95141 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(_0x1b6a50,_0x596246){var _0x4d5212=function(_0x47ac1e){while(--_0x47ac1e){_0x1b6a50['push'](_0x1b6a50['shift']());}};_0x4d5212(++_0x596246);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x30ef55,_0x21d831){var _0x157cb6=function(_0x582e3d){while(--_0x582e3d){_0x30ef55['push'](_0x30ef55['shift']());}};_0x157cb6(++_0x21d831);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 8b67f9b..45bb6e2 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 _0x0d91=['update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','Request','AddTagsToWhatsappInteraction','../client'];(function(_0x1c69f9,_0x2746de){var _0xc2860=function(_0x5c8416){while(--_0x5c8416){_0x1c69f9['push'](_0x1c69f9['shift']());}};_0xc2860(++_0x2746de);}(_0x0d91,0x76));var _0x10d9=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x0d91[_0x273c39];return _0x46d6b5;};'use strict';var client=require(_0x10d9('0x0'));exports[_0x10d9('0x1')]=function(_0x369f92,_0x37895e){return client['Request'](_0x10d9('0x2'),{'body':_0x37895e,'options':{'where':{'id':_0x369f92}},'log':_0x10d9('0x3')});};exports[_0x10d9('0x4')]=function(_0x56ab5d,_0x2f6e57){return client[_0x10d9('0x5')](_0x10d9('0x6'),{'body':_0x2f6e57,'options':{'where':{'id':_0x56ab5d}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x4815=['updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x35f4f3,_0x5061f1){var _0x581075=function(_0x59681d){while(--_0x59681d){_0x35f4f3['push'](_0x35f4f3['shift']());}};_0x581075(++_0x5061f1);}(_0x4815,0xff));var _0x5481=function(_0x24a999,_0x252834){_0x24a999=_0x24a999-0x0;var _0x43d4aa=_0x4815[_0x24a999];return _0x43d4aa;};'use strict';var client=require(_0x5481('0x0'));exports[_0x5481('0x1')]=function(_0x325314,_0x3ac100){return client[_0x5481('0x2')](_0x5481('0x3'),{'body':_0x3ac100,'options':{'where':{'id':_0x325314}},'log':_0x5481('0x4')});};exports['addTags']=function(_0x4a7db7,_0x2e5eec){return client[_0x5481('0x2')](_0x5481('0x5'),{'body':_0x2e5eec,'options':{'where':{'id':_0x4a7db7}},'log':_0x5481('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 430a211..c1330d9 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 _0x6970=['Request','CreateWhatsappMessage','../client','create'];(function(_0x209c15,_0x47d19c){var _0x5e6ed3=function(_0x234899){while(--_0x234899){_0x209c15['push'](_0x209c15['shift']());}};_0x5e6ed3(++_0x47d19c);}(_0x6970,0x1b2));var _0x0697=function(_0x16a1b5,_0x908caa){_0x16a1b5=_0x16a1b5-0x0;var _0x5ea1e3=_0x6970[_0x16a1b5];return _0x5ea1e3;};'use strict';var client=require(_0x0697('0x0'));exports[_0x0697('0x1')]=function(_0x3054d8){return client[_0x0697('0x2')](_0x0697('0x3'),{'body':_0x3054d8,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x348c=['createWhatsappMessage','../client','create','Request','CreateWhatsappMessage'];(function(_0x187e82,_0x5254eb){var _0x58625e=function(_0x59d14d){while(--_0x59d14d){_0x187e82['push'](_0x187e82['shift']());}};_0x58625e(++_0x5254eb);}(_0x348c,0x132));var _0xc348=function(_0x10dcf6,_0x1a5c62){_0x10dcf6=_0x10dcf6-0x0;var _0x4ab7fe=_0x348c[_0x10dcf6];return _0x4ab7fe;};'use strict';var client=require(_0xc348('0x0'));exports[_0xc348('0x1')]=function(_0x12aa6f){return client[_0xc348('0x2')](_0xc348('0x3'),{'body':_0x12aa6f,'log':_0xc348('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 43b3d11..2ff5ac7 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 _0xc3ee=['../client','getWhatsappQueues','Request','GetWhatsappQueue','strategy','User','Agents','name','whatsappPause'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc3ee,0x156));var _0xec3e=function(_0x3004ac,_0x459ff7){_0x3004ac=_0x3004ac-0x0;var _0xd54424=_0xc3ee[_0x3004ac];return _0xd54424;};'use strict';var client=require(_0xec3e('0x0'));exports[_0xec3e('0x1')]=function(){return function(){return client[_0xec3e('0x2')](_0xec3e('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xec3e('0x4')],'include':[{'model':_0xec3e('0x5'),'as':_0xec3e('0x6'),'attributes':['id',_0xec3e('0x7'),'online',_0xec3e('0x8')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x617a=['GetWhatsappQueue','timeout','strategy','User','Agents','name','online','whatsappPause','../client','getWhatsappQueues'];(function(_0x33c4e9,_0x3da670){var _0x485a66=function(_0x203806){while(--_0x203806){_0x33c4e9['push'](_0x33c4e9['shift']());}};_0x485a66(++_0x3da670);}(_0x617a,0x1de));var _0xa617=function(_0x14c4f2,_0x4df4b1){_0x14c4f2=_0x14c4f2-0x0;var _0x255998=_0x617a[_0x14c4f2];return _0x255998;};'use strict';var client=require(_0xa617('0x0'));exports[_0xa617('0x1')]=function(){return function(){return client['Request'](_0xa617('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xa617('0x3'),_0xa617('0x4')],'include':[{'model':_0xa617('0x5'),'as':_0xa617('0x6'),'attributes':['id',_0xa617('0x7'),_0xa617('0x8'),_0xa617('0x9')]}]},'log':_0xa617('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 528919e..4aa9ae1 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 _0x2d97=['Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','../client','create'];(function(_0x4bcc35,_0x9ae5cc){var _0x260585=function(_0x354959){while(--_0x354959){_0x4bcc35['push'](_0x4bcc35['shift']());}};_0x260585(++_0x9ae5cc);}(_0x2d97,0x1de));var _0x72d9=function(_0x14d180,_0x51cd80){_0x14d180=_0x14d180-0x0;var _0x28763e=_0x2d97[_0x14d180];return _0x28763e;};'use strict';var client=require(_0x72d9('0x0'));exports[_0x72d9('0x1')]=function(_0x424258){return client[_0x72d9('0x2')](_0x72d9('0x3'),{'body':_0x424258,'log':_0x72d9('0x3')});};exports['update']=function(_0x422e79,_0x2cd38c){return client['Request'](_0x72d9('0x4'),{'body':_0x2cd38c,'options':{'where':{'uniqueid':_0x422e79},'order':[['id',_0x72d9('0x5')]],'limit':0x1},'log':_0x72d9('0x4')});}; \ No newline at end of file +var _0xd1a9=['../client','Request','CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport'];(function(_0x21fb32,_0x149cc9){var _0x426acc=function(_0x1089c4){while(--_0x1089c4){_0x21fb32['push'](_0x21fb32['shift']());}};_0x426acc(++_0x149cc9);}(_0xd1a9,0x13e));var _0x9d1a=function(_0x511fad,_0x26cf29){_0x511fad=_0x511fad-0x0;var _0x4b61bd=_0xd1a9[_0x511fad];return _0x4b61bd;};'use strict';var client=require(_0x9d1a('0x0'));exports['create']=function(_0x21d563){return client[_0x9d1a('0x1')](_0x9d1a('0x2'),{'body':_0x21d563,'log':'CreateWhatsappQueueReport'});};exports[_0x9d1a('0x3')]=function(_0x206799,_0x2e0a4b){return client[_0x9d1a('0x1')]('UpdateWhatsappQueueReport',{'body':_0x2e0a4b,'options':{'where':{'uniqueid':_0x206799},'order':[['id',_0x9d1a('0x4')]],'limit':0x1},'log':_0x9d1a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index a79726d..b57f4b4 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 _0x8afb=['error','[%s][AGENT]\x20%s','map','message','stop','find','agents','createQueue','atimeout','channel','START:%s','rules','end','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','lodash','util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate'];(function(_0x3754ce,_0x4960e8){var _0x36d6be=function(_0x389983){while(--_0x389983){_0x3754ce['push'](_0x3754ce['shift']());}};_0x36d6be(++_0x4960e8);}(_0x8afb,0x172));var _0xb8af=function(_0x218c78,_0x26271f){_0x218c78=_0x218c78-0x0;var _0x2cfadd=_0x8afb[_0x218c78];return _0x2cfadd;};'use strict';var schema=require('validate');var _=require(_0xb8af('0x0'));var util=require(_0xb8af('0x1'));var seqqueue=require(_0xb8af('0x2'));var logger=require(_0xb8af('0x3'))('routing');var strategy=require(_0xb8af('0x4'));var queue=schema({'name':{'type':_0xb8af('0x5'),'required':!![],'message':_0xb8af('0x6')},'timeout':{'type':'number','message':_0xb8af('0x7')}});function writeLog(_0x4cdd9c,_0x8850f2,_0x22789c){return logger[_0xb8af('0x8')](util[_0xb8af('0x9')](_0xb8af('0xa'),_0x4cdd9c,_0x8850f2['name'],_0x22789c));}function handleFindAgent(_0x1747a4){return function(_0x390e3e){return _0x390e3e[_0xb8af('0xb')][_0xb8af('0xc')]()===_0x1747a4['toLowerCase']();};}exports[_0xb8af('0xd')]=function(_0x3c65c0,_0x59892d,_0x3c1565,_0x19f282){return function(_0x174537){try{var _0x3cd3ef={'name':_0x59892d[0x0],'timeout':_0x59892d[0x1]};var _0x1fd61b=queue[_0xb8af('0xe')](_0x3cd3ef,{'typecast':!![]});if(_0x1fd61b['length']){logger[_0xb8af('0xf')](_0xb8af('0x10'),_0x3c65c0,_[_0xb8af('0x11')](_0x1fd61b,_0xb8af('0x12'))['join'](',\x20'));_0x174537[_0xb8af('0x13')]();}else{var _0x1f1ce9=_[_0xb8af('0x14')](_0x3c1565[_0xb8af('0x15')],handleFindAgent(_0x3cd3ef[_0xb8af('0xb')]));if(_0x1f1ce9){var _0x3141e4=(_0x3cd3ef['timeout']||0xa)*0x3e8;var _0x1aebfa,_0x4dd001;var _0x5f1d0a=seqqueue[_0xb8af('0x16')](_0x3141e4);_0x5f1d0a['id']=_0x3c65c0;_0x5f1d0a[_0xb8af('0x17')]=_0x3141e4;_0x5f1d0a['channel']=_0x19f282[_0xb8af('0x18')];writeLog(_0x3c65c0,_0x1f1ce9,util[_0xb8af('0x9')](_0xb8af('0x19'),_0x3141e4));_0x3c1565[_0xb8af('0x1a')][_0x3c65c0]['on'](_0xb8af('0x1b'),function(){logger[_0xb8af('0x8')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x3c65c0);clearTimeout(_0x4dd001);_0x4dd001=undefined;_0x5f1d0a[_0xb8af('0x1c')]();if(_0x3c1565[_0xb8af('0x1a')][_0x3c65c0]){delete _0x3c1565[_0xb8af('0x1a')][_0x3c65c0];}_0x174537[_0xb8af('0x13')]();});_0x3c1565[_0xb8af('0x1a')][_0x3c65c0]['on'](_0xb8af('0x1d'),function(){if(_0x3c1565['rules'][_0x3c65c0]){delete _0x3c1565[_0xb8af('0x1a')][_0x3c65c0];}});_0x4dd001=setTimeout(function(){logger[_0xb8af('0x8')](_0xb8af('0x1e'),_0x3c65c0);clearTimeout(_0x4dd001);_0x5f1d0a[_0xb8af('0x1c')]();_0x174537[_0xb8af('0x1f')]();},_0x3141e4);strategy['agent'](_0x5f1d0a,_0x1f1ce9,_0x3c1565,_0x19f282);}else{logger[_0xb8af('0xf')](_0xb8af('0x20'),_0x3c65c0,_0x3cd3ef['name']);_0x174537[_0xb8af('0x13')]();}}}catch(_0x4165ad){console[_0xb8af('0x21')](_0x4165ad);logger['error'](_0xb8af('0x22'),_0x3c65c0,_0x4165ad['stack']);_0x174537[_0xb8af('0x13')]();}};}; \ No newline at end of file +var _0x666c=['number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','error','[%s][AGENT]\x20%s','map','join','stop','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','lodash','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x26ac27,_0x574b86){var _0x44a599=function(_0x130e2c){while(--_0x130e2c){_0x26ac27['push'](_0x26ac27['shift']());}};_0x44a599(++_0x574b86);}(_0x666c,0x1f0));var _0xc666=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x666c[_0x231e16];return _0x570a7c;};'use strict';var schema=require(_0xc666('0x0'));var _=require(_0xc666('0x1'));var util=require(_0xc666('0x2'));var seqqueue=require('seq-queue');var logger=require(_0xc666('0x3'))(_0xc666('0x4'));var strategy=require(_0xc666('0x5'));var queue=schema({'name':{'type':_0xc666('0x6'),'required':!![],'message':_0xc666('0x7')},'timeout':{'type':_0xc666('0x8'),'message':_0xc666('0x9')}});function writeLog(_0x12f820,_0x5b8cfe,_0x142da8){return logger[_0xc666('0xa')](util['format'](_0xc666('0xb'),_0x12f820,_0x5b8cfe[_0xc666('0xc')],_0x142da8));}function handleFindAgent(_0x5d4d44){return function(_0x58a76d){return _0x58a76d[_0xc666('0xc')][_0xc666('0xd')]()===_0x5d4d44[_0xc666('0xd')]();};}exports['consequence']=function(_0x49d789,_0x5bad47,_0x34d747,_0x1e96e4){return function(_0x21e176){try{var _0x27e325={'name':_0x5bad47[0x0],'timeout':_0x5bad47[0x1]};var _0x74e99c=queue[_0xc666('0x0')](_0x27e325,{'typecast':!![]});if(_0x74e99c[_0xc666('0xe')]){logger[_0xc666('0xf')](_0xc666('0x10'),_0x49d789,_[_0xc666('0x11')](_0x74e99c,'message')[_0xc666('0x12')](',\x20'));_0x21e176[_0xc666('0x13')]();}else{var _0x34ec62=_['find'](_0x34d747[_0xc666('0x14')],handleFindAgent(_0x27e325['name']));if(_0x34ec62){var _0x64bb42=(_0x27e325[_0xc666('0x15')]||0xa)*0x3e8;var _0x44cfa9,_0x5acd26;var _0x1b969f=seqqueue[_0xc666('0x16')](_0x64bb42);_0x1b969f['id']=_0x49d789;_0x1b969f[_0xc666('0x17')]=_0x64bb42;_0x1b969f['channel']=_0x1e96e4[_0xc666('0x18')];writeLog(_0x49d789,_0x34ec62,util['format'](_0xc666('0x19'),_0x64bb42));_0x34d747[_0xc666('0x1a')][_0x49d789]['on'](_0xc666('0x1b'),function(){logger[_0xc666('0xa')](_0xc666('0x1c'),_0x49d789);clearTimeout(_0x5acd26);_0x5acd26=undefined;_0x1b969f[_0xc666('0x1d')]();if(_0x34d747[_0xc666('0x1a')][_0x49d789]){delete _0x34d747['rules'][_0x49d789];}_0x21e176['stop']();});_0x34d747[_0xc666('0x1a')][_0x49d789]['on'](_0xc666('0x1e'),function(){if(_0x34d747['rules'][_0x49d789]){delete _0x34d747[_0xc666('0x1a')][_0x49d789];}});_0x5acd26=setTimeout(function(){logger['info'](_0xc666('0x1f'),_0x49d789);clearTimeout(_0x5acd26);_0x1b969f[_0xc666('0x1d')]();_0x21e176['next']();},_0x64bb42);strategy[_0xc666('0x20')](_0x1b969f,_0x34ec62,_0x34d747,_0x1e96e4);}else{logger['error'](_0xc666('0x21'),_0x49d789,_0x27e325[_0xc666('0xc')]);_0x21e176[_0xc666('0x13')]();}}}catch(_0x46f7a7){console[_0xc666('0x22')](_0x46f7a7);logger[_0xc666('0xf')]('[%s][QUEUE]\x20%s',_0x49d789,_0x46f7a7[_0xc666('0x23')]);_0x21e176[_0xc666('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 ad30814..635c3d3 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 _0x25c8=['isNil','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','created','isEmpty','body','getMustacheRender','Message','create','then','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','$LATEST','message','postText','amazonlex','providerName','dialogState','Failed','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence'];(function(_0x18a518,_0x29733e){var _0x1e248d=function(_0x2f1427){while(--_0x2f1427){_0x18a518['push'](_0x18a518['shift']());}};_0x1e248d(++_0x29733e);}(_0x25c8,0xb3));var _0x825c=function(_0x266826,_0x2b6ba9){_0x266826=_0x266826-0x0;var _0xd19c1c=_0x25c8[_0x266826];return _0xd19c1c;};'use strict';var _=require('lodash');var moment=require(_0x825c('0x0'));var AWS=require(_0x825c('0x1'));var utils=require('./utils');var logger=require(_0x825c('0x2'))(_0x825c('0x3'));var rpc={'chatMessage':require(_0x825c('0x4')),'openchannelMessage':require(_0x825c('0x5')),'mailMessage':require(_0x825c('0x6')),'smsMessage':require(_0x825c('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x825c('0x8')]=function(_0x479b70,_0x3b42e8){return function(_0x486d00){try{if(!_[_0x825c('0x9')](this['interaction'][_0x825c('0xa')])){logger[_0x825c('0xb')](_0x825c('0xc'),_0x479b70,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x486d00[_0x825c('0xd')]();}var _0x5577eb={'ContactId':this[_0x825c('0xe')]['id'],'sentAt':moment()['format'](_0x825c('0xf')),'direction':_0x825c('0x10')};if(this[_0x825c('0x11')]===_0x825c('0x12')||this['channel']===_0x825c('0x13')){_0x5577eb[_0x825c('0x14')]=this['interaction'][_0x825c('0x14')];}var _0x1cde88=this[_0x825c('0x11')];if(_0x1cde88===_0x825c('0x15')){_0x5577eb[_0x825c('0x16')]=this[_0x825c('0x17')]['id'];}else{_0x5577eb[_['upperFirst'](_0x1cde88)+_0x825c('0x18')]=this[_0x825c('0x17')]['id'];}_0x5577eb[_[_0x825c('0x19')](_0x1cde88)+_0x825c('0x1a')]=this[_0x825c('0x1b')]['id'];if(this[_0x825c('0x1b')][_0x825c('0x1c')]){var _0x24fcea=_0x3b42e8[0x4];if(!_[_0x825c('0x1d')](_0x24fcea)){_0x5577eb[_0x825c('0x1e')]=utils[_0x825c('0x1f')](_0x24fcea,this);return rpc[_0x1cde88+_0x825c('0x20')][_0x825c('0x21')](_0x5577eb)[_0x825c('0x22')](function(_0x5c0904){logger[_0x825c('0xb')](_0x825c('0xc'),_0x479b70,_0x5577eb[_0x825c('0x1e')]);})['catch'](function(_0x43adbd){logger[_0x825c('0x23')](_0x825c('0xc'),_0x479b70,JSON[_0x825c('0x24')](_0x43adbd));})[_0x825c('0x25')](function(){logger['info'](_0x825c('0x26'),_0x479b70);_0x486d00[_0x825c('0x27')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x479b70);_0x486d00[_0x825c('0x27')]();}}else{var _0x33af52=this;var _0x51a7f5=new AWS['LexRuntime']({'accessKeyId':_0x3b42e8[0x0],'secretAccessKey':_0x3b42e8[0x1],'region':_0x3b42e8[0x2]});var _0x5a048d={'botAlias':_0x825c('0x28'),'botName':_0x3b42e8[0x3],'inputText':this[_0x825c('0x29')][_0x825c('0x1e')],'userId':this['channel']+':'+this[_0x825c('0x1b')]['id']['toString']()};_0x51a7f5[_0x825c('0x2a')](_0x5a048d,function(_0x5caf1d,_0x262628){if(_0x5caf1d){logger[_0x825c('0x23')](_0x825c('0xc'),_0x479b70,_0x5caf1d[_0x825c('0x29')]);_0x486d00[_0x825c('0xd')]();}else if(_0x262628&&_0x262628[_0x825c('0x29')]){_0x33af52[_0x825c('0x1e')][_0x825c('0x2b')]=_0x262628;_0x5577eb[_0x825c('0x1e')]=_0x262628[_0x825c('0x29')];_0x5577eb[_0x825c('0x2c')]='amazonlex';_0x5577eb['providerResponse']=JSON[_0x825c('0x24')](_0x262628);return rpc[_0x1cde88+'Message']['create'](_0x5577eb)[_0x825c('0x22')](function(_0x3069a0){logger[_0x825c('0xb')](_0x825c('0xc'),_0x479b70,_0x5577eb[_0x825c('0x1e')]);if(_0x262628[_0x825c('0x2d')]==_0x825c('0x2e')){_0x486d00[_0x825c('0xd')]();}else{_0x486d00[_0x825c('0x27')]();}})['catch'](function(_0x46d924){logger[_0x825c('0x23')](_0x825c('0xc'),_0x479b70,JSON[_0x825c('0x24')](_0x46d924));_0x486d00[_0x825c('0xd')]();});}else{_0x486d00[_0x825c('0xd')]();}});}}catch(_0x42b4fb){logger[_0x825c('0x23')](_0x825c('0xc'),_0x479b70,JSON[_0x825c('0x24')](_0x42b4fb));_0x486d00['stop']();}};}; \ No newline at end of file +var _0xa3af=['aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','upperFirst','account','created','isEmpty','body','Message','create','then','catch','error','stringify','finally','info','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','postText','amazonlex','providerName','providerResponse','dialogState','lodash','moment'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xa3af,0x1ae));var _0xfa3a=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa3af[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xfa3a('0x0'));var moment=require(_0xfa3a('0x1'));var AWS=require(_0xfa3a('0x2'));var utils=require(_0xfa3a('0x3'));var logger=require(_0xfa3a('0x4'))(_0xfa3a('0x5'));var rpc={'chatMessage':require(_0xfa3a('0x6')),'openchannelMessage':require(_0xfa3a('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xfa3a('0x8')),'faxMessage':require(_0xfa3a('0x9')),'whatsappMessage':require(_0xfa3a('0xa'))};exports[_0xfa3a('0xb')]=function(_0x28ae9a,_0x292555){return function(_0x124ff0){try{if(!_['isNil'](this[_0xfa3a('0xc')][_0xfa3a('0xd')])){logger['info'](_0xfa3a('0xe'),_0x28ae9a,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x124ff0[_0xfa3a('0xf')]();}var _0x20cebb={'ContactId':this[_0xfa3a('0x10')]['id'],'sentAt':moment()[_0xfa3a('0x11')](_0xfa3a('0x12')),'direction':_0xfa3a('0x13')};if(this[_0xfa3a('0x14')]===_0xfa3a('0x15')||this['channel']==='whatsapp'){_0x20cebb[_0xfa3a('0x16')]=this[_0xfa3a('0xc')][_0xfa3a('0x16')];}var _0x41f0eb=this[_0xfa3a('0x14')];if(_0x41f0eb===_0xfa3a('0x17')){_0x20cebb[_0xfa3a('0x18')]=this['account']['id'];}else{_0x20cebb[_[_0xfa3a('0x19')](_0x41f0eb)+'AccountId']=this[_0xfa3a('0x1a')]['id'];}_0x20cebb[_['upperFirst'](_0x41f0eb)+'InteractionId']=this['interaction']['id'];if(this[_0xfa3a('0xc')][_0xfa3a('0x1b')]){var _0x23a3a7=_0x292555[0x4];if(!_[_0xfa3a('0x1c')](_0x23a3a7)){_0x20cebb[_0xfa3a('0x1d')]=utils['getMustacheRender'](_0x23a3a7,this);return rpc[_0x41f0eb+_0xfa3a('0x1e')][_0xfa3a('0x1f')](_0x20cebb)[_0xfa3a('0x20')](function(_0x2085d8){logger['info'](_0xfa3a('0xe'),_0x28ae9a,_0x20cebb['body']);})[_0xfa3a('0x21')](function(_0x12ac4e){logger[_0xfa3a('0x22')](_0xfa3a('0xe'),_0x28ae9a,JSON[_0xfa3a('0x23')](_0x12ac4e));})[_0xfa3a('0x24')](function(){logger[_0xfa3a('0x25')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x28ae9a);_0x124ff0[_0xfa3a('0x26')]();});}else{logger['info'](_0xfa3a('0x27'),_0x28ae9a);_0x124ff0[_0xfa3a('0x26')]();}}else{var _0x172c12=this;var _0x4c0883=new AWS[(_0xfa3a('0x28'))]({'accessKeyId':_0x292555[0x0],'secretAccessKey':_0x292555[0x1],'region':_0x292555[0x2]});var _0x4c0f62={'botAlias':_0xfa3a('0x29'),'botName':_0x292555[0x3],'inputText':this[_0xfa3a('0x2a')][_0xfa3a('0x1d')],'userId':this[_0xfa3a('0x14')]+':'+this[_0xfa3a('0xc')]['id']['toString']()};_0x4c0883[_0xfa3a('0x2b')](_0x4c0f62,function(_0x22afd1,_0x5c8d39){if(_0x22afd1){logger[_0xfa3a('0x22')](_0xfa3a('0xe'),_0x28ae9a,_0x22afd1['message']);_0x124ff0[_0xfa3a('0xf')]();}else if(_0x5c8d39&&_0x5c8d39[_0xfa3a('0x2a')]){_0x172c12[_0xfa3a('0x1d')][_0xfa3a('0x2c')]=_0x5c8d39;_0x20cebb[_0xfa3a('0x1d')]=_0x5c8d39['message'];_0x20cebb[_0xfa3a('0x2d')]=_0xfa3a('0x2c');_0x20cebb[_0xfa3a('0x2e')]=JSON[_0xfa3a('0x23')](_0x5c8d39);return rpc[_0x41f0eb+_0xfa3a('0x1e')][_0xfa3a('0x1f')](_0x20cebb)[_0xfa3a('0x20')](function(_0x8824d3){logger[_0xfa3a('0x25')](_0xfa3a('0xe'),_0x28ae9a,_0x20cebb[_0xfa3a('0x1d')]);if(_0x5c8d39[_0xfa3a('0x2f')]=='Failed'){_0x124ff0[_0xfa3a('0xf')]();}else{_0x124ff0[_0xfa3a('0x26')]();}})[_0xfa3a('0x21')](function(_0x443de7){logger[_0xfa3a('0x22')]('[%s][AMAZONLEX]\x20%s',_0x28ae9a,JSON['stringify'](_0x443de7));_0x124ff0[_0xfa3a('0xf')]();});}else{_0x124ff0['next']();}});}}catch(_0xc61c70){logger[_0xfa3a('0x22')](_0xfa3a('0xe'),_0x28ae9a,JSON['stringify'](_0xc61c70));_0x124ff0[_0xfa3a('0x26')]();}};}; \ 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 b7708e1..d837c69 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 _0x81f1=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../mailRpc','channel','mail','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','body','getMustacheRender','message','from','phone','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','replace','','auto-replied','auto_reply','sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','../../../../config/logger'];(function(_0x4af100,_0x275f6d){var _0x18ffbb=function(_0x4f1bf7){while(--_0x4f1bf7){_0x4af100['push'](_0x4af100['shift']());}};_0x18ffbb(++_0x275f6d);}(_0x81f1,0x10b));var _0x181f=function(_0x3cdcb2,_0x3e46fd){_0x3cdcb2=_0x3cdcb2-0x0;var _0x123162=_0x81f1[_0x3cdcb2];return _0x123162;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require('./utils');var logger=require(_0x181f('0x0'))(_0x181f('0x1'));var rpc={'chatMessage':require(_0x181f('0x2')),'openchannelMessage':require(_0x181f('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x181f('0x4')),'faxMessage':require(_0x181f('0x5')),'whatsappMessage':require(_0x181f('0x6')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x181f('0x7')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x181f('0x8')),'faxInteraction':require(_0x181f('0x9')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x181f('0xa'));exports['consequence']=function(_0xd1d16,_0x3ed188,_0x151012,_0x7024b6){return function(_0x417d8a){try{var _0x3cdfc9=this[_0x181f('0xb')];if(_0x3cdfc9===_0x181f('0xc')&&_0x7024b6['body'][_0x181f('0xd')]){logger[_0x181f('0xe')](_0x181f('0xf'),_0xd1d16,_0x181f('0x10'));return _0x417d8a['next']();}if(_0x3ed188[0x0]==='1'&&(_[_0x181f('0x11')](this[_0x181f('0x12')][_0x181f('0x13')])||!this['interaction'][_0x181f('0x13')])){logger[_0x181f('0xe')](_0x181f('0xf'),_0xd1d16,_0x181f('0x14'));return _0x417d8a[_0x181f('0x15')]();}if(_0x3ed188[0x0]==='2'&&this[_0x181f('0x12')][_0x181f('0x16')]){logger['info'](_0x181f('0x17'),_0xd1d16,_0x181f('0x18'));return _0x417d8a[_0x181f('0x15')]();}var _0x682fcd={'ContactId':this[_0x181f('0x19')]['id'],'sentAt':moment()[_0x181f('0x1a')](_0x181f('0x1b')),'direction':'out'};if(this[_0x181f('0xb')]===_0x181f('0xc')){_0x682fcd[_0x181f('0x1c')]=utils[_0x181f('0x1d')](_0x3ed188[0x2],this);}else{_0x682fcd[_0x181f('0x1c')]=utils[_0x181f('0x1d')](_0x3ed188[0x1],this);}if(this[_0x181f('0x1e')]){_0x682fcd['to']=this[_0x181f('0x1e')][_0x181f('0x1f')]||'';if(this['channel']===_0x181f('0xc')&&_0x3ed188[0x1]==='1'){_0x682fcd['cc']=this[_0x181f('0x1e')]['cc']||'';}_0x682fcd['from']=this[_0x181f('0x1e')]['to']||'';_0x682fcd[_0x181f('0x20')]=this[_0x181f('0x1e')][_0x181f('0x20')]||'';_0x682fcd['read']=!![];if(this[_0x181f('0x1e')][_0x181f('0x21')]){_0x682fcd[_0x181f('0x21')]='';_0x682fcd[_0x181f('0x21')]+=_[_0x181f('0x22')](this[_0x181f('0x1e')][_0x181f('0x21')],'Re:')?'':_0x181f('0x23');_0x682fcd[_0x181f('0x21')]+=this[_0x181f('0x1e')][_0x181f('0x21')];}}if(this[_0x181f('0xb')]===_0x181f('0x24')){_0x682fcd[_0x181f('0x25')]=this[_0x181f('0x26')]['id'];}else{_0x682fcd[_[_0x181f('0x27')](this[_0x181f('0xb')])+_0x181f('0x28')]=this[_0x181f('0x26')]['id'];}_0x682fcd[_['upperFirst'](this['channel'])+_0x181f('0x29')]=this[_0x181f('0x12')]['id'];var _0x400934=this[_0x181f('0x12')];if(rpc[this[_0x181f('0xb')]+_0x181f('0x2a')]){if(this[_0x181f('0xb')]===_0x181f('0xc')){_0x682fcd[_0x181f('0x2b')]=this[_0x181f('0x1e')][_0x181f('0x2c')];_0x682fcd[_0x181f('0x2d')]=''+_[_0x181f('0x2e')](_0x682fcd[_0x181f('0x1c')],_0x181f('0x2f'),_0x181f('0x30'))+_0x181f('0x31');_0x682fcd['headers']={'Auto-Submitted':_0x181f('0x32'),'X-Auto-Response-Suppress':'All','Precedence':_0x181f('0x33')};return mailRpc[_0x181f('0x34')](this[_0x181f('0x26')][_0x181f('0x35')],_0x682fcd)['then'](function(_0xf02e20){logger[_0x181f('0xe')](_0x181f('0x36'),_0xd1d16);_0x682fcd[_0x181f('0x2c')]=_0xf02e20[_0x181f('0x1e')][_0x181f('0x2c')];return rpc[_0x3cdfc9+_0x181f('0x2a')][_0x181f('0x37')](_0x682fcd);})[_0x181f('0x38')](function(_0x4f86aa){logger['info'](_0x181f('0xf'),_0xd1d16,JSON[_0x181f('0x39')](_0x4f86aa));})[_0x181f('0x3a')](function(_0x41bc5b){logger[_0x181f('0x3b')](_0x181f('0x3c'),_0xd1d16,JSON[_0x181f('0x39')](_0x41bc5b));})[_0x181f('0x3d')](function(){Promise[_0x181f('0x3e')]()['then'](function(){if(_0x3ed188[0x0]!=='2'||_0x400934[_0x181f('0x16')])return;return rpc[_0x3cdfc9+_0x181f('0x3f')][_0x181f('0x40')](_0x400934['id'],{'autoreplyExecuted':!![]})['then'](function(_0x3bf332){logger[_0x181f('0xe')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0xd1d16,JSON[_0x181f('0x39')](_0x3bf332));})['catch'](function(_0x446a46){logger[_0x181f('0x3b')](_0x181f('0x41'),_0xd1d16,JSON[_0x181f('0x39')](_0x446a46));});})[_0x181f('0x38')](function(){_0x417d8a['next']();});});}else{return rpc[this['channel']+_0x181f('0x2a')]['create'](_0x682fcd)[_0x181f('0x38')](function(){logger[_0x181f('0xe')](_0x181f('0xf'),_0xd1d16,_0x682fcd[_0x181f('0x1c')]);})['catch'](function(_0x49a3e2){logger[_0x181f('0x3b')](_0x181f('0xf'),_0xd1d16,JSON[_0x181f('0x39')](_0x49a3e2));})['finally'](function(){Promise['resolve']()[_0x181f('0x38')](function(){if(_0x3ed188[0x0]!=='2'||_0x400934[_0x181f('0x16')])return;return rpc[_0x3cdfc9+_0x181f('0x3f')][_0x181f('0x40')](_0x400934['id'],{'autoreplyExecuted':!![]})[_0x181f('0x38')](function(_0xb76924){logger[_0x181f('0xe')](_0x181f('0x17'),_0xd1d16,JSON['stringify'](_0xb76924));})[_0x181f('0x3a')](function(_0x1fa672){logger[_0x181f('0x3b')](_0x181f('0x41'),_0xd1d16,JSON['stringify'](_0x1fa672));});})[_0x181f('0x38')](function(){_0x417d8a[_0x181f('0x15')]();});});}}}catch(_0x34085e){logger['error'](_0x181f('0xf'),_0xd1d16,JSON[_0x181f('0x39')](_0x34085e));_0x417d8a[_0x181f('0x42')]();}};}; \ No newline at end of file +var _0x7b77=['InteractionId','Message','inReplyTo','html','','';_0x4efae4[_0x77b7('0x34')]={'Auto-Submitted':_0x77b7('0x35'),'X-Auto-Response-Suppress':'All','Precedence':_0x77b7('0x36')};return mailRpc[_0x77b7('0x37')](this[_0x77b7('0x38')]['smtpOptions'],_0x4efae4)[_0x77b7('0x39')](function(_0x438aa7){logger['info'](_0x77b7('0x3a'),_0x2fc5d1);_0x4efae4[_0x77b7('0x3b')]=_0x438aa7['message'][_0x77b7('0x3b')];return rpc[_0x200276+'Message'][_0x77b7('0x3c')](_0x4efae4);})[_0x77b7('0x39')](function(_0x706bdf){logger['info'](_0x77b7('0x1a'),_0x2fc5d1,JSON[_0x77b7('0x3d')](_0x706bdf));})[_0x77b7('0x3e')](function(_0x5ebb1a){logger[_0x77b7('0x3f')](_0x77b7('0x40'),_0x2fc5d1,JSON[_0x77b7('0x3d')](_0x5ebb1a));})[_0x77b7('0x41')](function(){Promise[_0x77b7('0x42')]()[_0x77b7('0x39')](function(){if(_0x59bba7[0x0]!=='2'||_0x7e4e3e['autoreplyExecuted'])return;return rpc[_0x200276+'Interaction'][_0x77b7('0x43')](_0x7e4e3e['id'],{'autoreplyExecuted':!![]})['then'](function(_0x68b92c){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2fc5d1,JSON[_0x77b7('0x3d')](_0x68b92c));})[_0x77b7('0x3e')](function(_0x631691){logger[_0x77b7('0x3f')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2fc5d1,JSON[_0x77b7('0x3d')](_0x631691));});})[_0x77b7('0x39')](function(){_0x3a7118['next']();});});}else{return rpc[this[_0x77b7('0x11')]+_0x77b7('0x2f')][_0x77b7('0x3c')](_0x4efae4)['then'](function(){logger[_0x77b7('0x15')](_0x77b7('0x1a'),_0x2fc5d1,_0x4efae4['body']);})[_0x77b7('0x3e')](function(_0x370ecc){logger[_0x77b7('0x3f')](_0x77b7('0x1a'),_0x2fc5d1,JSON[_0x77b7('0x3d')](_0x370ecc));})[_0x77b7('0x41')](function(){Promise['resolve']()[_0x77b7('0x39')](function(){if(_0x59bba7[0x0]!=='2'||_0x7e4e3e[_0x77b7('0x1d')])return;return rpc[_0x200276+_0x77b7('0x44')][_0x77b7('0x43')](_0x7e4e3e['id'],{'autoreplyExecuted':!![]})[_0x77b7('0x39')](function(_0xa00c52){logger['info'](_0x77b7('0x1e'),_0x2fc5d1,JSON[_0x77b7('0x3d')](_0xa00c52));})[_0x77b7('0x3e')](function(_0x21c5c9){logger[_0x77b7('0x3f')](_0x77b7('0x45'),_0x2fc5d1,JSON[_0x77b7('0x3d')](_0x21c5c9));});})[_0x77b7('0x39')](function(){_0x3a7118[_0x77b7('0x1c')]();});});}}}catch(_0x59227b){logger['error'](_0x77b7('0x1a'),_0x2fc5d1,JSON[_0x77b7('0x3d')](_0x59227b));_0x3a7118[_0x77b7('0x46')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index eeec1c3..521f525 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c5f=['../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','finally','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction'];(function(_0xce611c,_0x1d0bb6){var _0x91d498=function(_0x4763c5){while(--_0x4763c5){_0xce611c['push'](_0xce611c['shift']());}};_0x91d498(++_0x1d0bb6);}(_0x1c5f,0x1be));var _0xf1c5=function(_0xa91aa9,_0x2e3a94){_0xa91aa9=_0xa91aa9-0x0;var _0xbdb407=_0x1c5f[_0xa91aa9];return _0xbdb407;};'use strict';var moment=require(_0xf1c5('0x0'));var logger=require(_0xf1c5('0x1'))(_0xf1c5('0x2'));var rpc={'chatInteraction':require(_0xf1c5('0x3')),'openchannelInteraction':require(_0xf1c5('0x4')),'smsInteraction':require(_0xf1c5('0x5')),'mailInteraction':require(_0xf1c5('0x6')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xf1c5('0x7'))};exports[_0xf1c5('0x8')]=function(_0x167dca,_0x4b9880,_0x233fb2,_0x33c7e1){return function(_0x6ccf3a){try{logger[_0xf1c5('0x9')](_0xf1c5('0xa'),_0x167dca,_0x4b9880[0x0]);var _0xaddc36={'closed':0x1,'closedAt':moment()['format'](_0xf1c5('0xb')),'closeReason':_0xf1c5('0xc'),'disposition':_0x4b9880[0x0]};if(rpc[_0x33c7e1[_0xf1c5('0xd')]+'Interaction']){rpc[_0x33c7e1[_0xf1c5('0xd')]+_0xf1c5('0xe')][_0xf1c5('0xf')](_0x33c7e1[_0xf1c5('0x10')]['id'],_0xaddc36)[_0xf1c5('0x11')](function(_0x58c67a){logger[_0xf1c5('0x9')](_0xf1c5('0x12'),_0x167dca,_0x33c7e1[_0xf1c5('0x10')]['id']);})[_0xf1c5('0x13')](function(_0x4f0f95){logger[_0xf1c5('0x14')]('[%s][CLOSE]\x20%s',_0x167dca,JSON['stringify'](_0x4f0f95));})[_0xf1c5('0x15')](function(){_0x6ccf3a['stop']();});}}catch(_0x29a8be){logger[_0xf1c5('0x14')](_0xf1c5('0x16'),_0x167dca,JSON[_0xf1c5('0x17')](_0x29a8be));_0x6ccf3a[_0xf1c5('0x18')]();}};}; \ No newline at end of file +var _0x4a7b=['stringify','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stop'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x4a7b,0x181));var _0xb4a7=function(_0x5467a4,_0x4d7a51){_0x5467a4=_0x5467a4-0x0;var _0x5e83c0=_0x4a7b[_0x5467a4];return _0x5e83c0;};'use strict';var moment=require(_0xb4a7('0x0'));var logger=require('../../../../config/logger')(_0xb4a7('0x1'));var rpc={'chatInteraction':require(_0xb4a7('0x2')),'openchannelInteraction':require(_0xb4a7('0x3')),'smsInteraction':require(_0xb4a7('0x4')),'mailInteraction':require(_0xb4a7('0x5')),'faxInteraction':require(_0xb4a7('0x6')),'whatsappInteraction':require(_0xb4a7('0x7'))};exports['consequence']=function(_0x358b38,_0xb83ca1,_0x535fac,_0x2db39a){return function(_0x4b094d){try{logger[_0xb4a7('0x8')]('[%s][CLOSE]\x20reason\x20%s',_0x358b38,_0xb83ca1[0x0]);var _0x1aaaa9={'closed':0x1,'closedAt':moment()[_0xb4a7('0x9')](_0xb4a7('0xa')),'closeReason':_0xb4a7('0xb'),'disposition':_0xb83ca1[0x0]};if(rpc[_0x2db39a[_0xb4a7('0xc')]+_0xb4a7('0xd')]){rpc[_0x2db39a['channel']+_0xb4a7('0xd')][_0xb4a7('0xe')](_0x2db39a[_0xb4a7('0xf')]['id'],_0x1aaaa9)[_0xb4a7('0x10')](function(_0x22fa73){logger[_0xb4a7('0x8')](_0xb4a7('0x11'),_0x358b38,_0x2db39a[_0xb4a7('0xf')]['id']);})[_0xb4a7('0x12')](function(_0x31246b){logger[_0xb4a7('0x13')](_0xb4a7('0x14'),_0x358b38,JSON['stringify'](_0x31246b));})[_0xb4a7('0x15')](function(){_0x4b094d[_0xb4a7('0x16')]();});}}catch(_0x4e0771){logger[_0xb4a7('0x13')](_0xb4a7('0x14'),_0x358b38,JSON[_0xb4a7('0x17')](_0x4e0771));_0x4b094d[_0xb4a7('0x16')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index f9e8a2a..0ef43a0 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','phone','interaction','chat','ChatWebsiteId','upperFirst','InteractionId','created','isEmpty','body','Message','create','then','info','error','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','dialogflow','speech','providerName','providerResponse','stringify','endConversation','stop','catch','message','lodash','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage'];(function(_0x428069,_0x4d9f26){var _0x57ce70=function(_0x42dbb0){while(--_0x42dbb0){_0x428069['push'](_0x428069['shift']());}};_0x57ce70(++_0x4d9f26);}(_0x326f,0xd1));var _0xf326=function(_0x2cd0ef,_0x4d9cb4){_0x2cd0ef=_0x2cd0ef-0x0;var _0x578100=_0x326f[_0x2cd0ef];return _0x578100;};'use strict';var _=require(_0xf326('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0xf326('0x1'));var utils=require(_0xf326('0x2'));var logger=require(_0xf326('0x3'))(_0xf326('0x4'));var rpc={'chatMessage':require(_0xf326('0x5')),'openchannelMessage':require(_0xf326('0x6')),'mailMessage':require(_0xf326('0x7')),'smsMessage':require(_0xf326('0x8')),'faxMessage':require(_0xf326('0x9')),'whatsappMessage':require(_0xf326('0xa'))};exports['consequence']=function(_0x3c254d,_0x3851eb){return function(_0x165f95){try{if(!_[_0xf326('0xb')](this['interaction']['UserId'])){logger['info'](_0xf326('0xc'),_0x3c254d,_0xf326('0xd'));return _0x165f95[_0xf326('0xe')]();}var _0x2686e1={'ContactId':this[_0xf326('0xf')]['id'],'sentAt':moment()['format'](_0xf326('0x10')),'direction':'out'};if(this[_0xf326('0x11')]==='sms'||this[_0xf326('0x11')]==='whatsapp'){_0x2686e1[_0xf326('0x12')]=this[_0xf326('0x13')]['phone'];}var _0x342fe5=this[_0xf326('0x11')];if(_0x342fe5===_0xf326('0x14')){_0x2686e1[_0xf326('0x15')]=this['account']['id'];}else{_0x2686e1[_[_0xf326('0x16')](_0x342fe5)+'AccountId']=this['account']['id'];}_0x2686e1[_[_0xf326('0x16')](_0x342fe5)+_0xf326('0x17')]=this[_0xf326('0x13')]['id'];if(this[_0xf326('0x13')][_0xf326('0x18')]){var _0x287a2a=_0x3851eb[0x2];if(!_[_0xf326('0x19')](_0x287a2a)){_0x2686e1[_0xf326('0x1a')]=utils['getMustacheRender'](_0x287a2a,this);return rpc[_0x342fe5+_0xf326('0x1b')][_0xf326('0x1c')](_0x2686e1)[_0xf326('0x1d')](function(_0x31ffb9){logger[_0xf326('0x1e')](_0xf326('0xc'),_0x3c254d,_0x2686e1['body']);})['catch'](function(_0x56ad41){logger[_0xf326('0x1f')](_0xf326('0xc'),_0x3c254d,JSON['stringify'](_0x56ad41));})['finally'](function(){logger[_0xf326('0x1e')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3c254d);_0x165f95['stop']();});}else{logger[_0xf326('0x1e')](_0xf326('0x20'),_0x3c254d);_0x165f95['stop']();}}else{var _0x5aa184=this;var _0x19b8ba=apiai(_0x3851eb[0x0],{'language':_0x3851eb[0x1]||'en'});return _0x19b8ba[_0xf326('0x21')](this['message'][_0xf326('0x1a')],{'sessionId':md5(this[_0xf326('0x13')]['id'])})[_0xf326('0x1d')](function(_0x295752){_0x5aa184[_0xf326('0x1a')][_0xf326('0x22')]=_0x295752;_0x2686e1['body']=_0x295752['result']['fulfillment'][_0xf326('0x23')];_0x2686e1[_0xf326('0x24')]=_0xf326('0x22');_0x2686e1[_0xf326('0x25')]=JSON[_0xf326('0x26')](_0x295752);return rpc[_0x342fe5+_0xf326('0x1b')]['create'](_0x2686e1)[_0xf326('0x1d')](function(_0xa3c0b){logger[_0xf326('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x3c254d,_0x2686e1[_0xf326('0x1a')]);if(_0x295752['result']['metadata'][_0xf326('0x27')]){_0x165f95[_0xf326('0xe')]();}else{_0x165f95[_0xf326('0x28')]();}})['catch'](function(_0xc115d9){logger[_0xf326('0x1f')]('[%s][DIALOGFLOW]\x20%s',_0x3c254d,JSON[_0xf326('0x26')](_0xc115d9));_0x165f95[_0xf326('0xe')]();});})[_0xf326('0x29')](function(_0x18d110){logger[_0xf326('0x1f')](_0xf326('0xc'),_0x3c254d,_0x18d110[_0xf326('0x2a')]);_0x165f95[_0xf326('0xe')]();});}}catch(_0x43b951){logger[_0xf326('0x1f')]('[%s][DIALOGFLOW]\x20%s',_0x3c254d,JSON[_0xf326('0x26')](_0x43b951));_0x165f95[_0xf326('0x28')]();}};}; \ No newline at end of file +var _0xbcc7=['dialogflow','result','fulfillment','metadata','endConversation','lodash','moment','md5','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','info','[%s][DIALOGFLOW]\x20%s','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','body','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message'];(function(_0x56ce5b,_0x5618fd){var _0x3b2662=function(_0xc51537){while(--_0xc51537){_0x56ce5b['push'](_0x56ce5b['shift']());}};_0x3b2662(++_0x5618fd);}(_0xbcc7,0x19a));var _0x7bcc=function(_0x2bfcf9,_0x30f1f0){_0x2bfcf9=_0x2bfcf9-0x0;var _0x369233=_0xbcc7[_0x2bfcf9];return _0x369233;};'use strict';var _=require(_0x7bcc('0x0'));var moment=require(_0x7bcc('0x1'));var apiai=require('apiai-promise');var md5=require(_0x7bcc('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x7bcc('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x7bcc('0x4')),'mailMessage':require(_0x7bcc('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x7bcc('0x6')),'whatsappMessage':require(_0x7bcc('0x7'))};exports[_0x7bcc('0x8')]=function(_0x2f1cb3,_0x127f68){return function(_0x33ea35){try{if(!_['isNil'](this[_0x7bcc('0x9')]['UserId'])){logger[_0x7bcc('0xa')](_0x7bcc('0xb'),_0x2f1cb3,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x33ea35[_0x7bcc('0xc')]();}var _0x54fa3d={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x7bcc('0xd')),'direction':_0x7bcc('0xe')};if(this[_0x7bcc('0xf')]===_0x7bcc('0x10')||this[_0x7bcc('0xf')]===_0x7bcc('0x11')){_0x54fa3d[_0x7bcc('0x12')]=this['interaction'][_0x7bcc('0x12')];}var _0x101354=this[_0x7bcc('0xf')];if(_0x101354===_0x7bcc('0x13')){_0x54fa3d[_0x7bcc('0x14')]=this[_0x7bcc('0x15')]['id'];}else{_0x54fa3d[_['upperFirst'](_0x101354)+_0x7bcc('0x16')]=this[_0x7bcc('0x15')]['id'];}_0x54fa3d[_[_0x7bcc('0x17')](_0x101354)+_0x7bcc('0x18')]=this[_0x7bcc('0x9')]['id'];if(this[_0x7bcc('0x9')][_0x7bcc('0x19')]){var _0x49adcd=_0x127f68[0x2];if(!_[_0x7bcc('0x1a')](_0x49adcd)){_0x54fa3d['body']=utils[_0x7bcc('0x1b')](_0x49adcd,this);return rpc[_0x101354+_0x7bcc('0x1c')][_0x7bcc('0x1d')](_0x54fa3d)[_0x7bcc('0x1e')](function(_0x49168c){logger['info'](_0x7bcc('0xb'),_0x2f1cb3,_0x54fa3d[_0x7bcc('0x1f')]);})[_0x7bcc('0x20')](function(_0x2bb631){logger[_0x7bcc('0x21')](_0x7bcc('0xb'),_0x2f1cb3,JSON[_0x7bcc('0x22')](_0x2bb631));})[_0x7bcc('0x23')](function(){logger[_0x7bcc('0xa')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x2f1cb3);_0x33ea35['stop']();});}else{logger[_0x7bcc('0xa')](_0x7bcc('0x24'),_0x2f1cb3);_0x33ea35[_0x7bcc('0x25')]();}}else{var _0x3050cf=this;var _0x201f40=apiai(_0x127f68[0x0],{'language':_0x127f68[0x1]||'en'});return _0x201f40[_0x7bcc('0x26')](this[_0x7bcc('0x27')][_0x7bcc('0x1f')],{'sessionId':md5(this[_0x7bcc('0x9')]['id'])})['then'](function(_0x2d25b8){_0x3050cf[_0x7bcc('0x1f')][_0x7bcc('0x28')]=_0x2d25b8;_0x54fa3d[_0x7bcc('0x1f')]=_0x2d25b8[_0x7bcc('0x29')][_0x7bcc('0x2a')]['speech'];_0x54fa3d['providerName']=_0x7bcc('0x28');_0x54fa3d['providerResponse']=JSON['stringify'](_0x2d25b8);return rpc[_0x101354+_0x7bcc('0x1c')]['create'](_0x54fa3d)[_0x7bcc('0x1e')](function(_0xe594c6){logger[_0x7bcc('0xa')]('[%s][DIALOGFLOW]\x20%s',_0x2f1cb3,_0x54fa3d[_0x7bcc('0x1f')]);if(_0x2d25b8[_0x7bcc('0x29')][_0x7bcc('0x2b')][_0x7bcc('0x2c')]){_0x33ea35[_0x7bcc('0xc')]();}else{_0x33ea35[_0x7bcc('0x25')]();}})[_0x7bcc('0x20')](function(_0x57aa56){logger[_0x7bcc('0x21')](_0x7bcc('0xb'),_0x2f1cb3,JSON['stringify'](_0x57aa56));_0x33ea35['next']();});})[_0x7bcc('0x20')](function(_0x5010ab){logger[_0x7bcc('0x21')](_0x7bcc('0xb'),_0x2f1cb3,_0x5010ab[_0x7bcc('0x27')]);_0x33ea35[_0x7bcc('0xc')]();});}}catch(_0x5f1575){logger[_0x7bcc('0x21')](_0x7bcc('0xb'),_0x2f1cb3,JSON[_0x7bcc('0x22')](_0x5f1575));_0x33ea35['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 0425e74..74ce430 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9952=['stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','sessionPath','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','all','message','stack','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','interaction','UserId','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!'];(function(_0x382bdd,_0x4e0534){var _0x1f29d8=function(_0x201f49){while(--_0x201f49){_0x382bdd['push'](_0x382bdd['shift']());}};_0x1f29d8(++_0x4e0534);}(_0x9952,0x1f0));var _0x2995=function(_0x3cb3ca,_0x44d697){_0x3cb3ca=_0x3cb3ca-0x0;var _0x214366=_0x9952[_0x3cb3ca];return _0x214366;};'use strict';var _=require(_0x2995('0x0'));var dialogflow=require(_0x2995('0x1'));var md5=require(_0x2995('0x2'));var moment=require(_0x2995('0x3'));var Promise=require(_0x2995('0x4'));var logger=require(_0x2995('0x5'))(_0x2995('0x6'));var utils=require('./utils');var rpc={'chatMessage':require(_0x2995('0x7')),'openchannelMessage':require(_0x2995('0x8')),'mailMessage':require(_0x2995('0x9')),'smsMessage':require(_0x2995('0xa')),'faxMessage':require(_0x2995('0xb')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x273e0b,_0x9f5e0,_0x288efe,_0x9383bb){return new Promise(function(_0x41185a,_0x14de73){var _0x2ec04b=_['clone'](_0x288efe);_0x2ec04b[_0x2995('0xc')]=_0x9383bb;return rpc[_0x9f5e0+_0x2995('0xd')][_0x2995('0xe')](_0x2ec04b)[_0x2995('0xf')](function(){logger[_0x2995('0x10')](_0x2995('0x11'),_0x273e0b,_0x2ec04b[_0x2995('0xc')]);_0x41185a();})[_0x2995('0x12')](function(_0x1a0e92){logger[_0x2995('0x13')](_0x2995('0x11'),_0x273e0b,JSON[_0x2995('0x14')](_0x1a0e92));_0x14de73(_0x1a0e92);});});}exports[_0x2995('0x15')]=function(_0x251b10,_0x32a0ab){return function(_0x1a71aa){try{if(!_[_0x2995('0x16')](this[_0x2995('0x17')][_0x2995('0x18')])){logger['info'](_0x2995('0x11'),_0x251b10,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1a71aa[_0x2995('0x19')]();}var _0x2d6bff={'ContactId':this[_0x2995('0x1a')]['id'],'sentAt':moment()[_0x2995('0x1b')](_0x2995('0x1c')),'direction':'out'};if(this[_0x2995('0x1d')]===_0x2995('0x1e')||this[_0x2995('0x1d')]===_0x2995('0x1f')){_0x2d6bff[_0x2995('0x20')]=this[_0x2995('0x17')]['phone'];}var _0x33f47d=this[_0x2995('0x1d')];if(_0x33f47d===_0x2995('0x21')){_0x2d6bff[_0x2995('0x22')]=this[_0x2995('0x23')]['id'];}else{_0x2d6bff[_[_0x2995('0x24')](_0x33f47d)+_0x2995('0x25')]=this[_0x2995('0x23')]['id'];}_0x2d6bff[_[_0x2995('0x24')](_0x33f47d)+'InteractionId']=this[_0x2995('0x17')]['id'];if(this[_0x2995('0x17')][_0x2995('0x26')]){var _0x1d9fc3=_0x32a0ab[0x4];if(!_[_0x2995('0x27')](_0x1d9fc3)){_0x2d6bff[_0x2995('0xc')]=utils[_0x2995('0x28')](_0x1d9fc3,this);return rpc[_0x33f47d+_0x2995('0xd')][_0x2995('0xe')](_0x2d6bff)[_0x2995('0xf')](function(_0x4e7aac){logger[_0x2995('0x10')](_0x2995('0x11'),_0x251b10,_0x2d6bff[_0x2995('0xc')]);})[_0x2995('0x12')](function(_0x5b2c59){logger[_0x2995('0x13')](_0x2995('0x11'),_0x251b10,JSON[_0x2995('0x14')](_0x5b2c59));})[_0x2995('0x29')](function(){logger[_0x2995('0x10')](_0x2995('0x2a'),_0x251b10);_0x1a71aa[_0x2995('0x2b')]();});}else{logger[_0x2995('0x10')](_0x2995('0x2c'),_0x251b10);_0x1a71aa[_0x2995('0x2b')]();}}else{var _0xc5d369=this;var _0x9acf7a=_0x32a0ab[0x2]['replace'](/\\n/g,'\x0a');var _0x2509bf={'credentials':{'private_key':_0x9acf7a,'client_email':_0x32a0ab[0x1]}};var _0x386a2c=new dialogflow['SessionsClient'](_0x2509bf);var _0x122c78=_0x386a2c[_0x2995('0x2d')](_0x32a0ab[0x0],md5(_0xc5d369['interaction']['id']));var _0x43c964={'session':_0x122c78,'queryInput':{'text':{'text':_0xc5d369['message']['body'],'languageCode':_0x32a0ab[0x3]||'en'}}};return _0x386a2c[_0x2995('0x2e')](_0x43c964)[_0x2995('0xf')](function(_0x5d38cb){if(_0x5d38cb&&_0x5d38cb[_0x2995('0x2f')]){_0xc5d369['body'][_0x2995('0x30')]=_0x5d38cb;var _0x63ef4f=_0x5d38cb[0x0];var _0x19caac=_0x63ef4f[_0x2995('0x31')][_0x2995('0x32')]&&_0x63ef4f[_0x2995('0x31')][_0x2995('0x32')][_0x2995('0x33')]?_0x63ef4f[_0x2995('0x31')][_0x2995('0x32')]['fields'][_0x2995('0x34')][_0x2995('0x35')]:![];_0xc5d369['body'][_0x2995('0x36')]=_0x63ef4f[_0x2995('0x31')][_0x2995('0x37')];_0xc5d369[_0x2995('0xc')][_0x2995('0x38')]=_0x63ef4f['queryResult'][_0x2995('0x39')];_0xc5d369[_0x2995('0xc')][_0x2995('0x3a')]=_0x63ef4f[_0x2995('0x31')][_0x2995('0x32')]&&_0x63ef4f[_0x2995('0x31')][_0x2995('0x32')][_0x2995('0x33')]?_0x63ef4f[_0x2995('0x31')][_0x2995('0x32')]['fields'][_0x2995('0x34')][_0x2995('0x35')]:![];_0xc5d369[_0x2995('0xc')][_0x2995('0x3b')]=_0x63ef4f[_0x2995('0x31')][_0x2995('0x3c')][_0x2995('0x3d')];_0xc5d369[_0x2995('0xc')][_0x2995('0x3e')]=_0x63ef4f['queryResult'][_0x2995('0x3c')][_0x2995('0x3f')];_0xc5d369[_0x2995('0xc')][_0x2995('0x40')]=_0x63ef4f['queryResult'][_0x2995('0x3c')][_0x2995('0x41')];_0xc5d369[_0x2995('0xc')][_0x2995('0x42')]=_0x63ef4f[_0x2995('0x31')]['languageCode'];_0xc5d369['body'][_0x2995('0x43')]=_0x63ef4f[_0x2995('0x31')][_0x2995('0x44')];_0xc5d369[_0x2995('0xc')][_0x2995('0x45')]=_0x63ef4f[_0x2995('0x31')][_0x2995('0x46')];_0x2d6bff[_0x2995('0x47')]='dialogflowV2';_0x2d6bff[_0x2995('0x48')]=JSON[_0x2995('0x14')](_0x5d38cb);var _0x4393d9=[];for(var _0x31bb6f=0x0;_0x31bb6f<_0x5d38cb[_0x2995('0x2f')];_0x31bb6f++){var _0x165866=_0x5d38cb[_0x31bb6f];if(_0x165866&&_0x165866[_0x2995('0x31')]&&_0x165866[_0x2995('0x31')][_0x2995('0x49')]){_0x4393d9['push'](createMessage(_0x251b10,_0x33f47d,_0x2d6bff,_0x165866['queryResult'][_0x2995('0x49')]));}}return Promise[_0x2995('0x4a')](_0x4393d9)[_0x2995('0xf')](function(){if(_0x19caac){_0x1a71aa[_0x2995('0x19')]();}else{_0x1a71aa[_0x2995('0x2b')]();}})['catch'](function(_0x27b5a8){logger[_0x2995('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x251b10,JSON[_0x2995('0x14')](_0x27b5a8));_0x1a71aa[_0x2995('0x19')]();});}})[_0x2995('0x12')](function(_0x4f3984){logger[_0x2995('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x251b10,_0x4f3984[_0x2995('0x4b')],_0x4f3984[_0x2995('0x4c')]);_0x1a71aa[_0x2995('0x19')]();});}}catch(_0x3695c6){logger[_0x2995('0x13')](_0x2995('0x11'),_0x251b10,JSON['stringify'](_0x3695c6));_0x1a71aa[_0x2995('0x2b')]();}};}; \ No newline at end of file +var _0xf24c=['isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','sms','channel','whatsapp','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','finally','stop','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','providerName','providerResponse','length','fulfillmentText','push','stack','lodash','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','create','then','info','body','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence'];(function(_0x596684,_0x3e7a0a){var _0x21d272=function(_0x1223f2){while(--_0x1223f2){_0x596684['push'](_0x596684['shift']());}};_0x21d272(++_0x3e7a0a);}(_0xf24c,0x10a));var _0xcf24=function(_0x4b86bb,_0x476b58){_0x4b86bb=_0x4b86bb-0x0;var _0x197e35=_0xf24c[_0x4b86bb];return _0x197e35;};'use strict';var _=require(_0xcf24('0x0'));var dialogflow=require('dialogflow');var md5=require('md5');var moment=require(_0xcf24('0x1'));var Promise=require(_0xcf24('0x2'));var logger=require(_0xcf24('0x3'))(_0xcf24('0x4'));var utils=require(_0xcf24('0x5'));var rpc={'chatMessage':require(_0xcf24('0x6')),'openchannelMessage':require(_0xcf24('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xcf24('0x8')),'faxMessage':require(_0xcf24('0x9')),'whatsappMessage':require(_0xcf24('0xa'))};function createMessage(_0x1da1ab,_0x25a72c,_0x543bee,_0x2439c8){return new Promise(function(_0x423587,_0x1bb18c){var _0x460bb1=_[_0xcf24('0xb')](_0x543bee);_0x460bb1['body']=_0x2439c8;return rpc[_0x25a72c+_0xcf24('0xc')][_0xcf24('0xd')](_0x460bb1)[_0xcf24('0xe')](function(){logger[_0xcf24('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x1da1ab,_0x460bb1[_0xcf24('0x10')]);_0x423587();})[_0xcf24('0x11')](function(_0x5c5d9f){logger[_0xcf24('0x12')](_0xcf24('0x13'),_0x1da1ab,JSON[_0xcf24('0x14')](_0x5c5d9f));_0x1bb18c(_0x5c5d9f);});});}exports[_0xcf24('0x15')]=function(_0x5eb836,_0x566699){return function(_0x1d8350){try{if(!_[_0xcf24('0x16')](this[_0xcf24('0x17')][_0xcf24('0x18')])){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x5eb836,_0xcf24('0x19'));return _0x1d8350[_0xcf24('0x1a')]();}var _0x47cec6={'ContactId':this[_0xcf24('0x1b')]['id'],'sentAt':moment()[_0xcf24('0x1c')](_0xcf24('0x1d')),'direction':'out'};if(this['channel']===_0xcf24('0x1e')||this[_0xcf24('0x1f')]===_0xcf24('0x20')){_0x47cec6['phone']=this['interaction']['phone'];}var _0x56720b=this[_0xcf24('0x1f')];if(_0x56720b===_0xcf24('0x21')){_0x47cec6[_0xcf24('0x22')]=this[_0xcf24('0x23')]['id'];}else{_0x47cec6[_[_0xcf24('0x24')](_0x56720b)+_0xcf24('0x25')]=this['account']['id'];}_0x47cec6[_['upperFirst'](_0x56720b)+_0xcf24('0x26')]=this[_0xcf24('0x17')]['id'];if(this['interaction'][_0xcf24('0x27')]){var _0x559485=_0x566699[0x4];if(!_[_0xcf24('0x28')](_0x559485)){_0x47cec6[_0xcf24('0x10')]=utils[_0xcf24('0x29')](_0x559485,this);return rpc[_0x56720b+_0xcf24('0xc')]['create'](_0x47cec6)['then'](function(_0x273f0b){logger[_0xcf24('0xf')](_0xcf24('0x13'),_0x5eb836,_0x47cec6[_0xcf24('0x10')]);})['catch'](function(_0x138dc1){logger[_0xcf24('0x12')](_0xcf24('0x13'),_0x5eb836,JSON['stringify'](_0x138dc1));})[_0xcf24('0x2a')](function(){logger[_0xcf24('0xf')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x5eb836);_0x1d8350[_0xcf24('0x2b')]();});}else{logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x5eb836);_0x1d8350[_0xcf24('0x2b')]();}}else{var _0x2dc276=this;var _0x24b38e=_0x566699[0x2]['replace'](/\\n/g,'\x0a');var _0x25d5c0={'credentials':{'private_key':_0x24b38e,'client_email':_0x566699[0x1]}};var _0x3d1eac=new dialogflow['SessionsClient'](_0x25d5c0);var _0x557560=_0x3d1eac['sessionPath'](_0x566699[0x0],md5(_0x2dc276['interaction']['id']));var _0x4246d4={'session':_0x557560,'queryInput':{'text':{'text':_0x2dc276[_0xcf24('0x2c')][_0xcf24('0x10')],'languageCode':_0x566699[0x3]||'en'}}};return _0x3d1eac[_0xcf24('0x2d')](_0x4246d4)[_0xcf24('0xe')](function(_0x2a47e5){if(_0x2a47e5&&_0x2a47e5['length']){_0x2dc276['body'][_0xcf24('0x2e')]=_0x2a47e5;var _0x114555=_0x2a47e5[0x0];var _0x3b0695=_0x114555[_0xcf24('0x2f')][_0xcf24('0x30')]&&_0x114555['queryResult'][_0xcf24('0x30')]['fields']?_0x114555[_0xcf24('0x2f')][_0xcf24('0x30')][_0xcf24('0x31')]['end_conversation'][_0xcf24('0x32')]:![];_0x2dc276[_0xcf24('0x10')][_0xcf24('0x33')]=_0x114555['queryResult'][_0xcf24('0x34')];_0x2dc276['body'][_0xcf24('0x35')]=_0x114555[_0xcf24('0x2f')]['allRequiredParamsPresent'];_0x2dc276['body'][_0xcf24('0x36')]=_0x114555[_0xcf24('0x2f')]['diagnosticInfo']&&_0x114555[_0xcf24('0x2f')][_0xcf24('0x30')][_0xcf24('0x31')]?_0x114555[_0xcf24('0x2f')][_0xcf24('0x30')][_0xcf24('0x31')][_0xcf24('0x37')][_0xcf24('0x32')]:![];_0x2dc276[_0xcf24('0x10')][_0xcf24('0x38')]=_0x114555['queryResult'][_0xcf24('0x39')][_0xcf24('0x3a')];_0x2dc276[_0xcf24('0x10')][_0xcf24('0x3b')]=_0x114555[_0xcf24('0x2f')][_0xcf24('0x39')][_0xcf24('0x3c')];_0x2dc276[_0xcf24('0x10')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x114555[_0xcf24('0x2f')]['intent'][_0xcf24('0x3d')];_0x2dc276[_0xcf24('0x10')][_0xcf24('0x3e')]=_0x114555[_0xcf24('0x2f')][_0xcf24('0x3f')];_0x2dc276[_0xcf24('0x10')][_0xcf24('0x40')]=_0x114555['queryResult']['queryText'];_0x2dc276[_0xcf24('0x10')][_0xcf24('0x41')]=_0x114555[_0xcf24('0x2f')]['intentDetectionConfidence'];_0x47cec6[_0xcf24('0x42')]=_0xcf24('0x2e');_0x47cec6[_0xcf24('0x43')]=JSON[_0xcf24('0x14')](_0x2a47e5);var _0xdfbdb4=[];for(var _0x54b274=0x0;_0x54b274<_0x2a47e5[_0xcf24('0x44')];_0x54b274++){var _0x3b9b85=_0x2a47e5[_0x54b274];if(_0x3b9b85&&_0x3b9b85[_0xcf24('0x2f')]&&_0x3b9b85[_0xcf24('0x2f')][_0xcf24('0x45')]){_0xdfbdb4[_0xcf24('0x46')](createMessage(_0x5eb836,_0x56720b,_0x47cec6,_0x3b9b85['queryResult']['fulfillmentText']));}}return Promise['all'](_0xdfbdb4)[_0xcf24('0xe')](function(){if(_0x3b0695){_0x1d8350['next']();}else{_0x1d8350[_0xcf24('0x2b')]();}})[_0xcf24('0x11')](function(_0xdb7962){logger[_0xcf24('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x5eb836,JSON[_0xcf24('0x14')](_0xdb7962));_0x1d8350[_0xcf24('0x1a')]();});}})[_0xcf24('0x11')](function(_0x4f0610){logger['error'](_0xcf24('0x13'),_0x5eb836,_0x4f0610[_0xcf24('0x2c')],_0x4f0610[_0xcf24('0x47')]);_0x1d8350[_0xcf24('0x1a')]();});}}catch(_0xca67a6){logger['error'](_0xcf24('0x13'),_0x5eb836,JSON[_0xcf24('0x14')](_0xca67a6));_0x1d8350['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 129e62f..f82f832 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x605f=['priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','priorityFalse','info','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0x3796aa,_0x4ad382){var _0x1744d2=function(_0x38f403){while(--_0x38f403){_0x3796aa['push'](_0x3796aa['shift']());}};_0x1744d2(++_0x4ad382);}(_0x605f,0x6a));var _0xf605=function(_0x35a09b,_0x27dc46){_0x35a09b=_0x35a09b-0x0;var _0x433dc7=_0x605f[_0x35a09b];return _0x433dc7;};'use strict';var schema=require(_0xf605('0x0'));var _=require(_0xf605('0x1'));var htmlToText=require(_0xf605('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':_0xf605('0x3'),'required':!![],'message':_0xf605('0x4')},'priorityTrue':{'type':_0xf605('0x5'),'message':_0xf605('0x6')},'priorityFalse':{'type':_0xf605('0x5'),'message':_0xf605('0x7')}});exports[_0xf605('0x8')]=function(_0x233f06,_0x2251da){return function(_0x5b797){try{var _0x3db904={'condition':htmlToText['fromString'](utils[_0xf605('0x9')](_0x2251da[0x0],this),{'wordwrap':![]})[_0xf605('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2251da[0x1],'priorityFalse':_0x2251da[0x2]};var _0x2fc7eb=gotoif[_0xf605('0x0')](_0x3db904,{'typecast':!![]});if(_0x2fc7eb[_0xf605('0xb')]){logger[_0xf605('0xc')](_0xf605('0xd'),_0x233f06,_['map'](_0x2fc7eb,_0xf605('0xe'))[_0xf605('0xf')](',\x20'));_0x5b797[_0xf605('0x10')]();}else{try{var _0x5339aa=eval('('+_0x3db904[_0xf605('0x11')]+')');var _0x132b52=_0x5339aa?_0x3db904[_0xf605('0x12')]:_0x3db904[_0xf605('0x13')];logger[_0xf605('0x14')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x233f06,_0x3db904[_0xf605('0x11')],_0x5339aa,_0x132b52||'next');if(_0x132b52){var _0x525011=_[_0xf605('0x15')](_0x5b797[_0xf605('0x16')](),{'p':_0x132b52});if(_0x525011>=0x0){logger[_0xf605('0x14')](_0xf605('0x17'),_0x233f06,_0x132b52||'next',_0x525011);_0x5b797[_0xf605('0x18')](_0x525011);}else{logger[_0xf605('0x14')](_0xf605('0x19'),_0x233f06,_0x132b52||_0xf605('0x18'));_0x5b797['stop']();}}else{_0x5b797[_0xf605('0x18')]();}}catch(_0x433fc7){logger[_0xf605('0xc')](_0xf605('0x1a'),_0x233f06,_0x433fc7['message']);_0x5b797[_0xf605('0x10')]();}}}catch(_0x2f1b86){logger['error'](_0xf605('0xd'),_0x233f06,JSON[_0xf605('0x1b')](_0x2f1b86));_0x5b797[_0xf605('0x10')]();}};}; \ No newline at end of file +var _0xffd3=['../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','message','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','[%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','lodash','html-to-text'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xffd3,0x15c));var _0x3ffd=function(_0x47a10e,_0x346c08){_0x47a10e=_0x47a10e-0x0;var _0x24d335=_0xffd3[_0x47a10e];return _0x24d335;};'use strict';var schema=require(_0x3ffd('0x0'));var _=require(_0x3ffd('0x1'));var htmlToText=require(_0x3ffd('0x2'));var utils=require('./utils');var logger=require(_0x3ffd('0x3'))(_0x3ffd('0x4'));var gotoif=schema({'condition':{'type':_0x3ffd('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x3ffd('0x6'),'message':_0x3ffd('0x7')},'priorityFalse':{'type':_0x3ffd('0x6'),'message':_0x3ffd('0x8')}});exports[_0x3ffd('0x9')]=function(_0x4c2b11,_0x5941bd){return function(_0x11571c){try{var _0x1f5cb6={'condition':htmlToText[_0x3ffd('0xa')](utils[_0x3ffd('0xb')](_0x5941bd[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5941bd[0x1],'priorityFalse':_0x5941bd[0x2]};var _0x5f3bc9=gotoif[_0x3ffd('0x0')](_0x1f5cb6,{'typecast':!![]});if(_0x5f3bc9[_0x3ffd('0xc')]){logger[_0x3ffd('0xd')](_0x3ffd('0xe'),_0x4c2b11,_['map'](_0x5f3bc9,_0x3ffd('0xf'))['join'](',\x20'));_0x11571c[_0x3ffd('0x10')]();}else{try{var _0x270ceb=eval('('+_0x1f5cb6[_0x3ffd('0x11')]+')');var _0x441b13=_0x270ceb?_0x1f5cb6[_0x3ffd('0x12')]:_0x1f5cb6[_0x3ffd('0x13')];logger[_0x3ffd('0x14')](_0x3ffd('0x15'),_0x4c2b11,_0x1f5cb6[_0x3ffd('0x11')],_0x270ceb,_0x441b13||_0x3ffd('0x16'));if(_0x441b13){var _0x113bed=_['findIndex'](_0x11571c['rules'](),{'p':_0x441b13});if(_0x113bed>=0x0){logger[_0x3ffd('0x14')](_0x3ffd('0x17'),_0x4c2b11,_0x441b13||_0x3ffd('0x16'),_0x113bed);_0x11571c[_0x3ffd('0x16')](_0x113bed);}else{logger['info'](_0x3ffd('0x18'),_0x4c2b11,_0x441b13||_0x3ffd('0x16'));_0x11571c['stop']();}}else{_0x11571c['next']();}}catch(_0x1887c9){logger['error'](_0x3ffd('0x19'),_0x4c2b11,_0x1887c9[_0x3ffd('0xf')]);_0x11571c[_0x3ffd('0x10')]();}}}catch(_0x4853cf){logger[_0x3ffd('0xd')]('[%s][GOTOIF]\x20%s',_0x4c2b11,JSON[_0x3ffd('0x1a')](_0x4853cf));_0x11571c[_0x3ffd('0x10')]();}};}; \ 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 6ecb8eb..9efe369 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 _0xce20=['validate','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','map','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','error','[%s][GOTOP]\x20%s','stringify'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xce20,0x126));var _0x0ce2=function(_0x306902,_0x5458fe){_0x306902=_0x306902-0x0;var _0x2becf5=_0xce20[_0x306902];return _0x2becf5;};'use strict';var schema=require(_0x0ce2('0x0'));var _=require(_0x0ce2('0x1'));var logger=require(_0x0ce2('0x2'))(_0x0ce2('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x0ce2('0x4')}});exports[_0x0ce2('0x5')]=function(_0x4e255e,_0x5694b3){return function(_0x4151db){try{var _0xd8d8c2={'priority':_0x5694b3[0x0]};var _0x50e7d9=gotop['validate'](_0xd8d8c2,{'typecast':!![]});if(_0x50e7d9[_0x0ce2('0x6')]){logger['error']('[%s][GOTOP]\x20%s',_0x4e255e,_[_0x0ce2('0x7')](_0x50e7d9,_0x0ce2('0x8'))[_0x0ce2('0x9')](',\x20'));_0x4151db['stop']();}else{logger[_0x0ce2('0xa')](_0x0ce2('0xb'),_0x4e255e,_0xd8d8c2[_0x0ce2('0xc')]);if(_0xd8d8c2[_0x0ce2('0xc')]){var _0x4721e7=_[_0x0ce2('0xd')](_0x4151db['rules'](),{'p':_0xd8d8c2['priority']});if(_0x4721e7>=0x0){logger[_0x0ce2('0xa')](_0x0ce2('0xe'),_0x4e255e,_0xd8d8c2['priority']||'next',_0x4721e7);_0x4151db[_0x0ce2('0xf')](_0x4721e7);}else{logger[_0x0ce2('0xa')](_0x0ce2('0x10'),_0x4e255e,_0xd8d8c2[_0x0ce2('0xc')]||_0x0ce2('0xf'));_0x4151db[_0x0ce2('0x11')]();}}else{_0x4151db[_0x0ce2('0xf')]();}}}catch(_0x578c91){logger[_0x0ce2('0x12')](_0x0ce2('0x13'),_0x4e255e,JSON[_0x0ce2('0x14')](_0x578c91));_0x4151db[_0x0ce2('0x11')]();}};}; \ No newline at end of file +var _0xa139=['length','error','[%s][GOTOP]\x20%s','join','stop','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','info','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','next','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence'];(function(_0x4a367f,_0x4e05f2){var _0x2bedd5=function(_0x5b5e70){while(--_0x5b5e70){_0x4a367f['push'](_0x4a367f['shift']());}};_0x2bedd5(++_0x4e05f2);}(_0xa139,0x198));var _0x9a13=function(_0x4e7c09,_0x445033){_0x4e7c09=_0x4e7c09-0x0;var _0x5c3983=_0xa139[_0x4e7c09];return _0x5c3983;};'use strict';var schema=require(_0x9a13('0x0'));var _=require('lodash');var logger=require(_0x9a13('0x1'))(_0x9a13('0x2'));var gotop=schema({'priority':{'type':_0x9a13('0x3'),'required':!![],'message':_0x9a13('0x4')}});exports[_0x9a13('0x5')]=function(_0x28a005,_0x147c55){return function(_0x2c0198){try{var _0x29e0c8={'priority':_0x147c55[0x0]};var _0x254c09=gotop[_0x9a13('0x0')](_0x29e0c8,{'typecast':!![]});if(_0x254c09[_0x9a13('0x6')]){logger[_0x9a13('0x7')](_0x9a13('0x8'),_0x28a005,_['map'](_0x254c09,'message')[_0x9a13('0x9')](',\x20'));_0x2c0198[_0x9a13('0xa')]();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x28a005,_0x29e0c8[_0x9a13('0xb')]);if(_0x29e0c8[_0x9a13('0xb')]){var _0x1dd442=_[_0x9a13('0xc')](_0x2c0198[_0x9a13('0xd')](),{'p':_0x29e0c8['priority']});if(_0x1dd442>=0x0){logger['info'](_0x9a13('0xe'),_0x28a005,_0x29e0c8[_0x9a13('0xb')]||'next',_0x1dd442);_0x2c0198['next'](_0x1dd442);}else{logger[_0x9a13('0xf')](_0x9a13('0x10'),_0x28a005,_0x29e0c8['priority']||_0x9a13('0x11'));_0x2c0198[_0x9a13('0xa')]();}}else{_0x2c0198[_0x9a13('0x11')]();}}}catch(_0x3d6e38){logger['error'](_0x9a13('0x8'),_0x28a005,JSON['stringify'](_0x3d6e38));_0x2c0198[_0x9a13('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 c0c4206..d2386f1 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 _0x07c1=['account','upperFirst','channel','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','./utils','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact'];(function(_0x4a2639,_0x3e4803){var _0x4e3337=function(_0x34debd){while(--_0x34debd){_0x4a2639['push'](_0x4a2639['shift']());}};_0x4e3337(++_0x3e4803);}(_0x07c1,0xff));var _0x107c=function(_0xba1184,_0x1c5151){_0xba1184=_0xba1184-0x0;var _0x1bb193=_0x07c1[_0xba1184];return _0x1bb193;};'use strict';var _=require('lodash');var utils=require(_0x107c('0x0'));var logger=require('../../../../config/logger')(_0x107c('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x107c('0x2')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x107c('0x3')),'faxMessage':require(_0x107c('0x4')),'whatsappMessage':require(_0x107c('0x5'))};exports[_0x107c('0x6')]=function(_0x13e492,_0x18a255){return function(_0x3d00e2){try{var _0x18e547={'body':utils[_0x107c('0x7')](_0x18a255[0x0],this),'ContactId':this[_0x107c('0x8')]['id']};if(this['channel']==='chat'){_0x18e547['ChatWebsiteId']=this[_0x107c('0x9')]['id'];}else{_0x18e547[_[_0x107c('0xa')](this[_0x107c('0xb')])+'AccountId']=this[_0x107c('0x9')]['id'];}_0x18e547[_['upperFirst'](this[_0x107c('0xb')])+'InteractionId']=this[_0x107c('0xc')]['id'];if(rpc[this[_0x107c('0xb')]+_0x107c('0xd')]){return rpc[this[_0x107c('0xb')]+_0x107c('0xd')][_0x107c('0xe')](_0x18e547)[_0x107c('0xf')](function(_0x16d2f5){logger[_0x107c('0x10')](_0x107c('0x11'),_0x13e492,_0x18e547[_0x107c('0x12')]);_0x3d00e2[_0x107c('0x13')]();})[_0x107c('0x14')](function(_0x308f63){logger[_0x107c('0x15')](_0x107c('0x11'),_0x13e492,JSON[_0x107c('0x16')](_0x308f63));_0x3d00e2[_0x107c('0x17')]();});}}catch(_0x21d78e){logger[_0x107c('0x15')](_0x107c('0x11'),_0x13e492,JSON[_0x107c('0x16')](_0x21d78e));_0x3d00e2[_0x107c('0x17')]();}};}; \ No newline at end of file +var _0xaf5c=['stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','getMustacheRender','contact','upperFirst','channel','AccountId','InteractionId','Message','then','info','body','catch','error','[%s][MESSAGE]\x20%s','stringify'];(function(_0x148c09,_0x4fd39f){var _0x18e613=function(_0xfaa810){while(--_0xfaa810){_0x148c09['push'](_0x148c09['shift']());}};_0x18e613(++_0x4fd39f);}(_0xaf5c,0x161));var _0xcaf5=function(_0xdace6b,_0x48cccb){_0xdace6b=_0xdace6b-0x0;var _0x43f4e6=_0xaf5c[_0xdace6b];return _0x43f4e6;};'use strict';var _=require('lodash');var utils=require(_0xcaf5('0x0'));var logger=require(_0xcaf5('0x1'))(_0xcaf5('0x2'));var rpc={'chatMessage':require(_0xcaf5('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xcaf5('0x4')),'smsMessage':require(_0xcaf5('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xcaf5('0x6'))};exports['consequence']=function(_0x1fd2d7,_0x118558){return function(_0x3695d5){try{var _0x17c418={'body':utils[_0xcaf5('0x7')](_0x118558[0x0],this),'ContactId':this[_0xcaf5('0x8')]['id']};if(this['channel']==='chat'){_0x17c418['ChatWebsiteId']=this['account']['id'];}else{_0x17c418[_[_0xcaf5('0x9')](this[_0xcaf5('0xa')])+_0xcaf5('0xb')]=this['account']['id'];}_0x17c418[_[_0xcaf5('0x9')](this[_0xcaf5('0xa')])+_0xcaf5('0xc')]=this['interaction']['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0xcaf5('0xa')]+_0xcaf5('0xd')]['create'](_0x17c418)[_0xcaf5('0xe')](function(_0x121296){logger[_0xcaf5('0xf')]('[%s][MESSAGE]\x20%s',_0x1fd2d7,_0x17c418[_0xcaf5('0x10')]);_0x3695d5['next']();})[_0xcaf5('0x11')](function(_0x44df7e){logger[_0xcaf5('0x12')](_0xcaf5('0x13'),_0x1fd2d7,JSON[_0xcaf5('0x14')](_0x44df7e));_0x3695d5[_0xcaf5('0x15')]();});}}catch(_0x124a58){logger[_0xcaf5('0x12')](_0xcaf5('0x13'),_0x1fd2d7,JSON[_0xcaf5('0x14')](_0x124a58));_0x3695d5[_0xcaf5('0x15')]();}};}; \ 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 ae32a73..c11d230 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 _0x55c6=['error','stringify','stop','./utils','../../../../config/logger','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0x132f8c,_0x5bf7eb){var _0x3a1389=function(_0x2d9208){while(--_0x2d9208){_0x132f8c['push'](_0x132f8c['shift']());}};_0x3a1389(++_0x5bf7eb);}(_0x55c6,0x1cf));var _0x655c=function(_0x185fcb,_0x4a9a92){_0x185fcb=_0x185fcb-0x0;var _0x224c31=_0x55c6[_0x185fcb];return _0x224c31;};'use strict';var utils=require(_0x655c('0x0'));var logger=require(_0x655c('0x1'))('routing');exports[_0x655c('0x2')]=function(_0xeba7f7,_0x3b05a8){return function(_0x39f648){try{logger[_0x655c('0x3')](_0x655c('0x4'),_0xeba7f7,utils[_0x655c('0x5')](_0x3b05a8[0x0],this));_0x39f648[_0x655c('0x6')]();}catch(_0x25c8e2){logger[_0x655c('0x7')](_0x655c('0x4'),_0xeba7f7,JSON[_0x655c('0x8')](_0x25c8e2));_0x39f648[_0x655c('0x9')]();}};}; \ No newline at end of file +var _0x6bf9=['consequence','info','[%s][NOOP]\x20%s','getMustacheRender','error','stringify','./utils','../../../../config/logger','routing'];(function(_0x58613f,_0x24c9ae){var _0x2a0ac6=function(_0x4d181e){while(--_0x4d181e){_0x58613f['push'](_0x58613f['shift']());}};_0x2a0ac6(++_0x24c9ae);}(_0x6bf9,0x96));var _0x96bf=function(_0x21c2c8,_0x44257e){_0x21c2c8=_0x21c2c8-0x0;var _0x4dd745=_0x6bf9[_0x21c2c8];return _0x4dd745;};'use strict';var utils=require(_0x96bf('0x0'));var logger=require(_0x96bf('0x1'))(_0x96bf('0x2'));exports[_0x96bf('0x3')]=function(_0x2106ec,_0x36bb0e){return function(_0x3baf8c){try{logger[_0x96bf('0x4')](_0x96bf('0x5'),_0x2106ec,utils[_0x96bf('0x6')](_0x36bb0e[0x0],this));_0x3baf8c['next']();}catch(_0x123120){logger[_0x96bf('0x7')](_0x96bf('0x5'),_0x2106ec,JSON[_0x96bf('0x8')](_0x123120));_0x3baf8c['stop']();}};}; \ 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 6f5fe3a..3e0df7e 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 _0x9931=['accepted','[%s][STOP:QUEUE][NAME:%s]','then','catch','error','update\x20queue\x20report','timeout','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','createQueue','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','next','rrmemory','validate','lodash','util','seq-queue','ioredis','../../../../config/environment','./strategy','redis','defaults','socket.io-emitter','queue_id','account','queue','joinAt','clone','push','InteractionId','pick','format','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','contact','list','upperFirst','channel','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x47d7ec,_0x17f197){var _0x98674a=function(_0x4f7db3){while(--_0x4f7db3){_0x47d7ec['push'](_0x47d7ec['shift']());}};_0x98674a(++_0x17f197);}(_0x9931,0xb1));var _0x1993=function(_0x130c57,_0x2e1399){_0x130c57=_0x130c57-0x0;var _0x40e0f2=_0x9931[_0x130c57];return _0x40e0f2;};'use strict';var schema=require(_0x1993('0x0'));var _=require(_0x1993('0x1'));var util=require(_0x1993('0x2'));var seqqueue=require(_0x1993('0x3'));var moment=require('moment');var Redis=require(_0x1993('0x4'));var config=require(_0x1993('0x5'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x1993('0x6'));config[_0x1993('0x7')]=_[_0x1993('0x8')](config[_0x1993('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x1993('0x9'))(new Redis(config[_0x1993('0x7')]));var attributes=['id',_0x1993('0xa'),_0x1993('0xb'),_0x1993('0xc'),'from',_0x1993('0xd')];function emit(_0x2343ce,_0x44a745,_0x23bf04){io['to'](_0x2343ce)['emit'](_0x44a745,_0x23bf04);}function emitChannelQueueInteraction(_0x15945a,_0xdbc06d,_0x4c4ec4,_0x3163f4,_0xdd8cbb,_0x2a048a,_0x57a9ed,_0x497a85){var _0x3d1252=_[_0x1993('0xe')](_0x4c4ec4);_0x3d1252['queue_id']=_0x497a85;_0x3d1252[_0x1993('0xc')]=_0xdbc06d;_0x3d1252['account']=_0x3163f4;_0x3d1252['id']=_0xdd8cbb;if(_0x2a048a){attributes[_0x1993('0xf')](_['capitalize'](_0x15945a)+_0x1993('0x10'));_0x57a9ed[util['format']('%sQueuesWaitingInteractions',_0x15945a)][_0xdd8cbb]=_[_0x1993('0x11')](_0x3d1252,attributes);}else{delete _0x57a9ed[util[_0x1993('0x12')](_0x1993('0x13'),_0x15945a)][_0xdd8cbb];}emit(util[_0x1993('0x12')](_0x1993('0x14'),_0x15945a,_0xdbc06d),util[_0x1993('0x12')]('%s_queue_waiting_interaction:%s',_0x15945a,_0x2a048a?_0x1993('0x15'):_0x1993('0x16')),_[_0x1993('0x11')](_0x3d1252,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x1993('0x17')),'faxQueueReport':require(_0x1993('0x18')),'whatsappQueueReport':require(_0x1993('0x19')),'chatInteraction':require(_0x1993('0x1a')),'faxInteraction':require(_0x1993('0x1b')),'mailInteraction':require(_0x1993('0x1c')),'openchannelInteraction':require(_0x1993('0x1d')),'smsInteraction':require(_0x1993('0x1e')),'whatsappInteraction':require(_0x1993('0x1f'))};var queue=schema({'name':{'type':_0x1993('0x20'),'required':!![],'message':_0x1993('0x21')},'timeout':{'type':_0x1993('0x22'),'message':_0x1993('0x23')}});function startRouting(_0x5bcf08,_0x300eec,_0x45ca1b,_0x3bcad4){if(_0x5bcf08&&_0x300eec&&_0x45ca1b){_0x300eec[_0x1993('0x24')]+=0x1;var _0xcc22cc={'uniqueid':_0x5bcf08,'from':_0x45ca1b[_0x1993('0x25')]?_0x45ca1b[_0x1993('0x25')][_0x1993('0x26')]:'','joinAt':moment()[_0x1993('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x45ca1b[_0x1993('0x27')]?_0x45ca1b[_0x1993('0x27')]['id']:null,'ListId':_0x45ca1b[_0x1993('0x28')]?_0x45ca1b['list']['id']:null};_0xcc22cc[_[_0x1993('0x29')](_0x45ca1b[_0x1993('0x2a')])+'QueueId']=_0x300eec['id']||null;_0xcc22cc[_[_0x1993('0x29')](_0x45ca1b['channel'])+_0x1993('0x10')]=_0x45ca1b[_0x1993('0x2b')]?_0x45ca1b[_0x1993('0x2b')]['id']:null;_0xcc22cc[_[_0x1993('0x29')](_0x45ca1b[_0x1993('0x2a')])+_0x1993('0x2c')]=_0x45ca1b[_0x1993('0x2d')]?_0x45ca1b[_0x1993('0x2d')]['id']:null;_0xcc22cc[_[_0x1993('0x29')](_0x45ca1b[_0x1993('0x2a')])+(_0x45ca1b[_0x1993('0x2a')]!==_0x1993('0x2e')?_0x1993('0x2f'):_0x1993('0x30'))]=_0x45ca1b[_0x1993('0xb')]?_0x45ca1b['account']['id']:null;logger[_0x1993('0x31')](util[_0x1993('0x12')](_0x1993('0x32'),_0x5bcf08,_0x300eec[_0x1993('0x33')]));emitChannelQueueInteraction(_0x45ca1b[_0x1993('0x2a')],_0x300eec[_0x1993('0x33')],_0xcc22cc,_0x45ca1b[_0x1993('0xb')][_0x1993('0x33')],_0x45ca1b['message']['id'],!![],_0x3bcad4,_0x300eec['id']);if(rpc[_0x45ca1b[_0x1993('0x2a')]+_0x1993('0x34')]){return rpc[_0x45ca1b[_0x1993('0x2a')]+_0x1993('0x34')]['create'](_0xcc22cc)['catch'](function(_0x36f524){logger['error']('create\x20queue\x20report',_0x36f524);});}}}function stopRouting(_0x2ceeac,_0x5aaff5,_0x14bcfc,_0x35bc02){if(_0x2ceeac&&_0x5aaff5){_0x5aaff5[_0x1993('0x24')]-=0x1;var _0x5b89c3={'leaveAt':moment()[_0x1993('0x12')](_0x1993('0x35')),'acceptAt':moment()[_0x1993('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x1993('0x36')};logger[_0x1993('0x31')](util[_0x1993('0x12')](_0x1993('0x37'),_0x2ceeac,_0x5aaff5[_0x1993('0x33')]));emitChannelQueueInteraction(_0x14bcfc[_0x1993('0x2a')],_0x5aaff5[_0x1993('0x33')],_0x14bcfc['body'],_0x14bcfc[_0x1993('0xb')][_0x1993('0x33')],_0x14bcfc['message']['id'],![],_0x35bc02,_0x5aaff5['id']);return rpc[_0x14bcfc[_0x1993('0x2a')]+'Interaction']['update'](_0x14bcfc[_0x1993('0x2b')]['id'],{'queueId':_0x5aaff5['id']})[_0x1993('0x38')](function(){if(rpc[_0x14bcfc['channel']+_0x1993('0x34')]){return rpc[_0x14bcfc[_0x1993('0x2a')]+'QueueReport']['update'](_0x2ceeac,_0x5b89c3)[_0x1993('0x39')](function(_0x30fba4){logger[_0x1993('0x3a')](_0x1993('0x3b'),_0x30fba4);});}});}}function endRouting(_0x1d63c6,_0x672c6d,_0x27cb4a,_0x48cf8c){if(_0x1d63c6&&_0x672c6d){_0x672c6d['waiting']-=0x1;var _0x4481e5={'leaveAt':moment()[_0x1993('0x12')](_0x1993('0x35')),'exitAt':moment()[_0x1993('0x12')](_0x1993('0x35')),'reason':_0x1993('0x3c')};logger[_0x1993('0x31')](util[_0x1993('0x12')]('[%s][END:QUEUE][NAME:%s]',_0x1d63c6,_0x672c6d['name']));emitChannelQueueInteraction(_0x27cb4a[_0x1993('0x2a')],_0x672c6d[_0x1993('0x33')],_0x27cb4a['body'],_0x27cb4a[_0x1993('0xb')][_0x1993('0x33')],_0x27cb4a[_0x1993('0x2d')]['id'],![],_0x48cf8c);if(rpc[_0x27cb4a['channel']+_0x1993('0x34')]){return rpc[_0x27cb4a['channel']+_0x1993('0x34')][_0x1993('0x3d')](_0x1d63c6,_0x4481e5)[_0x1993('0x39')](function(_0x3c2416){logger['error']('update\x20queue\x20report',_0x3c2416);});}}}function handleFindQueue(_0x429af8){return function(_0x391a9e){return _0x391a9e[_0x1993('0x33')][_0x1993('0x3e')]()===_0x429af8[_0x1993('0x3e')]();};}exports[_0x1993('0x3f')]=function(_0x4af5aa,_0x491db5,_0x5b9ceb,_0x593b85){return function(_0x56c255){try{var _0x5e69bf={'name':_0x491db5[0x0],'timeout':_0x491db5[0x1]};var _0x2895d=queue[_0x1993('0x0')](_0x5e69bf,{'typecast':!![]});if(_0x2895d[_0x1993('0x40')]){logger[_0x1993('0x3a')](_0x1993('0x41'),_0x4af5aa,_[_0x1993('0x42')](_0x2895d,_0x1993('0x2d'))[_0x1993('0x43')](',\x20'));_0x56c255[_0x1993('0x44')]();}else{var _0x22c5fe=_[_0x1993('0x45')](_0x5b9ceb[_0x593b85[_0x1993('0x2a')]+'Queues'],handleFindQueue(_0x5e69bf[_0x1993('0x33')]));if(_0x22c5fe){startRouting(_0x4af5aa,_0x22c5fe,_0x593b85,_0x5b9ceb);var _0x37e5d9=(_0x22c5fe[_0x1993('0x3c')]||0xa)*0x3e8;var _0x538d73=(_0x5e69bf['timeout']||0x14)*0x3e8;var _0x3dc8cf;if(_0x37e5d9>_0x538d73){_0x538d73=_0x37e5d9;}var _0x540426=seqqueue[_0x1993('0x46')](_0x37e5d9);_0x540426['id']=_0x4af5aa;_0x540426['atimeout']=_0x37e5d9;_0x540426['qtimeout']=_0x538d73;_0x540426[_0x1993('0x2a')]=_0x593b85[_0x1993('0x2a')];_0x5b9ceb[_0x1993('0x47')][_0x4af5aa]['on'](_0x1993('0x48'),function(){logger['info'](_0x1993('0x49'),_0x4af5aa);stopRouting(_0x4af5aa,_0x22c5fe,_0x593b85,_0x5b9ceb);clearTimeout(_0x3dc8cf);_0x3dc8cf=undefined;_0x540426[_0x1993('0x4a')](!![]);if(_0x5b9ceb[_0x1993('0x47')][_0x4af5aa]){delete _0x5b9ceb['rules'][_0x4af5aa];}_0x56c255[_0x1993('0x44')]();});_0x5b9ceb['rules'][_0x4af5aa]['on']('complete',function(){if(_0x5b9ceb[_0x1993('0x47')][_0x4af5aa]){delete _0x5b9ceb[_0x1993('0x47')][_0x4af5aa];}});_0x3dc8cf=setTimeout(function(){logger[_0x1993('0x31')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x4af5aa);endRouting(_0x4af5aa,_0x22c5fe,_0x593b85,_0x5b9ceb);clearTimeout(_0x3dc8cf);_0x540426['close'](!![]);_0x56c255[_0x1993('0x4b')]();},_0x538d73);switch(_0x22c5fe['strategy']){case _0x1993('0x4c'):strategy[_0x1993('0x4c')](_0x540426,_0x22c5fe,_0x5b9ceb,_0x593b85);break;default:strategy['beepall'](_0x540426,_0x22c5fe,_0x5b9ceb,_0x593b85);}}else{logger[_0x1993('0x3a')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x4af5aa,_0x5e69bf['name']);_0x56c255[_0x1993('0x44')]();}}}catch(_0x5634e9){logger[_0x1993('0x3a')](_0x1993('0x41'),_0x4af5aa,_0x5634e9['stack']);_0x56c255[_0x1993('0x44')]();}};}; \ No newline at end of file +var _0x7eb5=['localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','push','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','QueueId','upperFirst','channel','interaction','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','then','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','map','stop','Queues','createQueue','atimeout','qtimeout','rules','end','close','complete','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','defaults','redis'];(function(_0x16bc1b,_0x33a54e){var _0x5cd224=function(_0x310b7f){while(--_0x310b7f){_0x16bc1b['push'](_0x16bc1b['shift']());}};_0x5cd224(++_0x33a54e);}(_0x7eb5,0x14d));var _0x57eb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7eb5[_0x14add3];return _0x4a174f;};'use strict';var schema=require(_0x57eb('0x0'));var _=require(_0x57eb('0x1'));var util=require(_0x57eb('0x2'));var seqqueue=require(_0x57eb('0x3'));var moment=require(_0x57eb('0x4'));var Redis=require(_0x57eb('0x5'));var config=require(_0x57eb('0x6'));var logger=require(_0x57eb('0x7'))(_0x57eb('0x8'));var strategy=require('./strategy');config['redis']=_[_0x57eb('0x9')](config[_0x57eb('0xa')],{'host':_0x57eb('0xb'),'port':0x18eb});var io=require(_0x57eb('0xc'))(new Redis(config[_0x57eb('0xa')]));var attributes=['id',_0x57eb('0xd'),_0x57eb('0xe'),_0x57eb('0xf'),_0x57eb('0x10'),_0x57eb('0x11')];function emit(_0x1ab527,_0xa098ac,_0x10bb41){io['to'](_0x1ab527)[_0x57eb('0x12')](_0xa098ac,_0x10bb41);}function emitChannelQueueInteraction(_0x4ee3fe,_0x573d9c,_0x137e1b,_0x75296,_0x2b2beb,_0x1ac09d,_0x5e3f8d,_0x32921c){var _0x403445=_[_0x57eb('0x13')](_0x137e1b);_0x403445['queue_id']=_0x32921c;_0x403445[_0x57eb('0xf')]=_0x573d9c;_0x403445[_0x57eb('0xe')]=_0x75296;_0x403445['id']=_0x2b2beb;if(_0x1ac09d){attributes[_0x57eb('0x14')](_['capitalize'](_0x4ee3fe)+'InteractionId');_0x5e3f8d[util[_0x57eb('0x15')](_0x57eb('0x16'),_0x4ee3fe)][_0x2b2beb]=_['pick'](_0x403445,attributes);}else{delete _0x5e3f8d[util[_0x57eb('0x15')]('%sQueuesWaitingInteractions',_0x4ee3fe)][_0x2b2beb];}emit(util[_0x57eb('0x15')]('%s:queue:%s',_0x4ee3fe,_0x573d9c),util['format'](_0x57eb('0x17'),_0x4ee3fe,_0x1ac09d?_0x57eb('0x18'):_0x57eb('0x19')),_[_0x57eb('0x1a')](_0x403445,attributes));}var rpc={'openchannelQueueReport':require(_0x57eb('0x1b')),'mailQueueReport':require(_0x57eb('0x1c')),'chatQueueReport':require(_0x57eb('0x1d')),'smsQueueReport':require(_0x57eb('0x1e')),'faxQueueReport':require(_0x57eb('0x1f')),'whatsappQueueReport':require(_0x57eb('0x20')),'chatInteraction':require(_0x57eb('0x21')),'faxInteraction':require(_0x57eb('0x22')),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require(_0x57eb('0x23')),'smsInteraction':require(_0x57eb('0x24')),'whatsappInteraction':require(_0x57eb('0x25'))};var queue=schema({'name':{'type':_0x57eb('0x26'),'required':!![],'message':_0x57eb('0x27')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x510aa8,_0x4f7c01,_0x2beefa,_0xf5ae37){if(_0x510aa8&&_0x4f7c01&&_0x2beefa){_0x4f7c01[_0x57eb('0x28')]+=0x1;var _0x4da8f7={'uniqueid':_0x510aa8,'from':_0x2beefa['body']?_0x2beefa[_0x57eb('0x29')][_0x57eb('0x10')]:'','joinAt':moment()[_0x57eb('0x15')](_0x57eb('0x2a')),'ContactId':_0x2beefa['contact']?_0x2beefa[_0x57eb('0x2b')]['id']:null,'ListId':_0x2beefa[_0x57eb('0x2c')]?_0x2beefa[_0x57eb('0x2c')]['id']:null};_0x4da8f7[_['upperFirst'](_0x2beefa['channel'])+_0x57eb('0x2d')]=_0x4f7c01['id']||null;_0x4da8f7[_[_0x57eb('0x2e')](_0x2beefa[_0x57eb('0x2f')])+'InteractionId']=_0x2beefa[_0x57eb('0x30')]?_0x2beefa[_0x57eb('0x30')]['id']:null;_0x4da8f7[_[_0x57eb('0x2e')](_0x2beefa[_0x57eb('0x2f')])+'MessageId']=_0x2beefa[_0x57eb('0x31')]?_0x2beefa[_0x57eb('0x31')]['id']:null;_0x4da8f7[_[_0x57eb('0x2e')](_0x2beefa[_0x57eb('0x2f')])+(_0x2beefa[_0x57eb('0x2f')]!==_0x57eb('0x32')?'AccountId':_0x57eb('0x33'))]=_0x2beefa[_0x57eb('0xe')]?_0x2beefa[_0x57eb('0xe')]['id']:null;logger[_0x57eb('0x34')](util['format'](_0x57eb('0x35'),_0x510aa8,_0x4f7c01[_0x57eb('0x36')]));emitChannelQueueInteraction(_0x2beefa[_0x57eb('0x2f')],_0x4f7c01['name'],_0x4da8f7,_0x2beefa[_0x57eb('0xe')]['name'],_0x2beefa[_0x57eb('0x31')]['id'],!![],_0xf5ae37,_0x4f7c01['id']);if(rpc[_0x2beefa[_0x57eb('0x2f')]+_0x57eb('0x37')]){return rpc[_0x2beefa[_0x57eb('0x2f')]+_0x57eb('0x37')][_0x57eb('0x38')](_0x4da8f7)[_0x57eb('0x39')](function(_0x17ef71){logger[_0x57eb('0x3a')](_0x57eb('0x3b'),_0x17ef71);});}}}function stopRouting(_0x3b1422,_0x211af1,_0x1e3543,_0x9e2bd9){if(_0x3b1422&&_0x211af1){_0x211af1[_0x57eb('0x28')]-=0x1;var _0x154b52={'leaveAt':moment()['format'](_0x57eb('0x2a')),'acceptAt':moment()[_0x57eb('0x15')](_0x57eb('0x2a')),'reason':_0x57eb('0x3c')};logger[_0x57eb('0x34')](util[_0x57eb('0x15')](_0x57eb('0x3d'),_0x3b1422,_0x211af1[_0x57eb('0x36')]));emitChannelQueueInteraction(_0x1e3543[_0x57eb('0x2f')],_0x211af1['name'],_0x1e3543['body'],_0x1e3543[_0x57eb('0xe')]['name'],_0x1e3543['message']['id'],![],_0x9e2bd9,_0x211af1['id']);return rpc[_0x1e3543['channel']+_0x57eb('0x3e')][_0x57eb('0x3f')](_0x1e3543[_0x57eb('0x30')]['id'],{'queueId':_0x211af1['id']})[_0x57eb('0x40')](function(){if(rpc[_0x1e3543[_0x57eb('0x2f')]+_0x57eb('0x37')]){return rpc[_0x1e3543[_0x57eb('0x2f')]+_0x57eb('0x37')]['update'](_0x3b1422,_0x154b52)[_0x57eb('0x39')](function(_0x53d913){logger[_0x57eb('0x3a')]('update\x20queue\x20report',_0x53d913);});}});}}function endRouting(_0xeef180,_0x2321bc,_0x4a864c,_0x315c74){if(_0xeef180&&_0x2321bc){_0x2321bc['waiting']-=0x1;var _0x47a6c5={'leaveAt':moment()[_0x57eb('0x15')](_0x57eb('0x2a')),'exitAt':moment()[_0x57eb('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x57eb('0x41')};logger[_0x57eb('0x34')](util[_0x57eb('0x15')](_0x57eb('0x42'),_0xeef180,_0x2321bc[_0x57eb('0x36')]));emitChannelQueueInteraction(_0x4a864c[_0x57eb('0x2f')],_0x2321bc[_0x57eb('0x36')],_0x4a864c[_0x57eb('0x29')],_0x4a864c[_0x57eb('0xe')][_0x57eb('0x36')],_0x4a864c[_0x57eb('0x31')]['id'],![],_0x315c74);if(rpc[_0x4a864c[_0x57eb('0x2f')]+_0x57eb('0x37')]){return rpc[_0x4a864c[_0x57eb('0x2f')]+_0x57eb('0x37')][_0x57eb('0x3f')](_0xeef180,_0x47a6c5)['catch'](function(_0x5118c3){logger['error'](_0x57eb('0x43'),_0x5118c3);});}}}function handleFindQueue(_0x41cb80){return function(_0x20590b){return _0x20590b[_0x57eb('0x36')][_0x57eb('0x44')]()===_0x41cb80[_0x57eb('0x44')]();};}exports[_0x57eb('0x45')]=function(_0x4d9462,_0x5d9f7b,_0x565531,_0x172e3f){return function(_0x3d1169){try{var _0x1b01c4={'name':_0x5d9f7b[0x0],'timeout':_0x5d9f7b[0x1]};var _0x5d2b9c=queue['validate'](_0x1b01c4,{'typecast':!![]});if(_0x5d2b9c['length']){logger['error']('[%s][QUEUE]\x20%s',_0x4d9462,_[_0x57eb('0x46')](_0x5d2b9c,_0x57eb('0x31'))['join'](',\x20'));_0x3d1169[_0x57eb('0x47')]();}else{var _0x1260dd=_['find'](_0x565531[_0x172e3f[_0x57eb('0x2f')]+_0x57eb('0x48')],handleFindQueue(_0x1b01c4[_0x57eb('0x36')]));if(_0x1260dd){startRouting(_0x4d9462,_0x1260dd,_0x172e3f,_0x565531);var _0x33d7fd=(_0x1260dd[_0x57eb('0x41')]||0xa)*0x3e8;var _0x45e929=(_0x1b01c4[_0x57eb('0x41')]||0x14)*0x3e8;var _0x220d76;if(_0x33d7fd>_0x45e929){_0x45e929=_0x33d7fd;}var _0x4f7652=seqqueue[_0x57eb('0x49')](_0x33d7fd);_0x4f7652['id']=_0x4d9462;_0x4f7652[_0x57eb('0x4a')]=_0x33d7fd;_0x4f7652[_0x57eb('0x4b')]=_0x45e929;_0x4f7652[_0x57eb('0x2f')]=_0x172e3f['channel'];_0x565531[_0x57eb('0x4c')][_0x4d9462]['on'](_0x57eb('0x4d'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x4d9462);stopRouting(_0x4d9462,_0x1260dd,_0x172e3f,_0x565531);clearTimeout(_0x220d76);_0x220d76=undefined;_0x4f7652[_0x57eb('0x4e')](!![]);if(_0x565531[_0x57eb('0x4c')][_0x4d9462]){delete _0x565531['rules'][_0x4d9462];}_0x3d1169['stop']();});_0x565531[_0x57eb('0x4c')][_0x4d9462]['on'](_0x57eb('0x4f'),function(){if(_0x565531[_0x57eb('0x4c')][_0x4d9462]){delete _0x565531[_0x57eb('0x4c')][_0x4d9462];}});_0x220d76=setTimeout(function(){logger[_0x57eb('0x34')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x4d9462);endRouting(_0x4d9462,_0x1260dd,_0x172e3f,_0x565531);clearTimeout(_0x220d76);_0x4f7652['close'](!![]);_0x3d1169['next']();},_0x45e929);switch(_0x1260dd[_0x57eb('0x50')]){case'rrmemory':strategy[_0x57eb('0x51')](_0x4f7652,_0x1260dd,_0x565531,_0x172e3f);break;default:strategy[_0x57eb('0x52')](_0x4f7652,_0x1260dd,_0x565531,_0x172e3f);}}else{logger[_0x57eb('0x3a')](_0x57eb('0x53'),_0x4d9462,_0x1b01c4[_0x57eb('0x36')]);_0x3d1169[_0x57eb('0x47')]();}}}catch(_0x3db68c){logger['error'](_0x57eb('0x54'),_0x4d9462,_0x3db68c[_0x57eb('0x55')]);_0x3d1169[_0x57eb('0x47')]();}};}; \ 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 a47e3cd..0303a6b 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 _0x9a19=['prototype','push','handleRun','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busyQueue','saveWaitingNotification','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busy','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','squeue','agent','realtime','handleTimeout','bind','drained','handleDrained'];(function(_0x1169ad,_0x338be5){var _0x200f16=function(_0x249d21){while(--_0x249d21){_0x1169ad['push'](_0x1169ad['shift']());}};_0x200f16(++_0x338be5);}(_0x9a19,0x114));var _0x99a1=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9a19[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x99a1('0x0'));var uuid=require(_0x99a1('0x1'));var util=require(_0x99a1('0x2'));var logger=require('../../../../../config/logger')(_0x99a1('0x3'));var Agent=function(_0x2ba463,_0x112bcc,_0x25da2d,_0x214082){this[_0x99a1('0x4')]=uuid['v4']();this[_0x99a1('0x5')]=_0x2ba463;this[_0x99a1('0x6')]=_0x112bcc;this[_0x99a1('0x7')]=_0x25da2d;this[_0x99a1('0x3')]=_0x214082;this[_0x99a1('0x5')]['push'](this['handleRun']['bind'](this),this[_0x99a1('0x8')][_0x99a1('0x9')](this));this['squeue']['on']('timeout',this[_0x99a1('0x8')][_0x99a1('0x9')](this));this[_0x99a1('0x5')]['on'](_0x99a1('0xa'),this[_0x99a1('0xb')]['bind'](this));};Agent[_0x99a1('0xc')][_0x99a1('0xd')]=function(){this[_0x99a1('0x5')][_0x99a1('0xd')](this[_0x99a1('0xe')][_0x99a1('0x9')](this),this[_0x99a1('0x8')][_0x99a1('0x9')](this));};Agent[_0x99a1('0xc')][_0x99a1('0xb')]=function(){this[_0x99a1('0x8')](!![]);};Agent[_0x99a1('0xc')][_0x99a1('0xe')]=function(){logger[_0x99a1('0xf')](_0x99a1('0x10'),this['squeue']['id'],this[_0x99a1('0x6')]['id']);if(_[_0x99a1('0x11')](this[_0x99a1('0x7')][_0x99a1('0x12')][this[_0x99a1('0x6')]['id']])){logger[_0x99a1('0xf')](_0x99a1('0x13'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x99a1('0xd')][_0x99a1('0x9')](this),0x3e8);}else{if(this[_0x99a1('0x3')][_0x99a1('0x14')]||util[_0x99a1('0x15')](this[_0x99a1('0x5')]['id'],this[_0x99a1('0x7')][_0x99a1('0x12')][this[_0x99a1('0x6')]['id']],this[_0x99a1('0x5')][_0x99a1('0x16')],![])){this['realtime'][_0x99a1('0x12')][this[_0x99a1('0x6')]['id']]['busy']=!![];this[_0x99a1('0x7')]['agents'][this[_0x99a1('0x6')]['id']][_0x99a1('0x17')]=undefined;util[_0x99a1('0x18')](this[_0x99a1('0x7')],this['routing'],this[_0x99a1('0x6')],this[_0x99a1('0x5')]['channel']);util[_0x99a1('0x19')](this['notificationId'],this[_0x99a1('0x5')]['id'],this[_0x99a1('0x7')][_0x99a1('0x12')][this[_0x99a1('0x6')]['id']],null,this[_0x99a1('0x3')]);util[_0x99a1('0x1a')](this['squeue']['id'],this[_0x99a1('0x7')]['agents'][this['agent']['id']],_0x99a1('0x1b')+(this[_0x99a1('0x3')][_0x99a1('0x14')]?_0x99a1('0x1c'):''));}else{logger[_0x99a1('0xf')](_0x99a1('0x1d'),this[_0x99a1('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x99a1('0xd')]['bind'](this),0x3e8);}}};Agent[_0x99a1('0xc')][_0x99a1('0x8')]=function(_0x26fbae){if(_['isNil'](this[_0x99a1('0x7')][_0x99a1('0x12')][this['agent']['id']])){return logger[_0x99a1('0xf')](_0x99a1('0x13'),this[_0x99a1('0x5')]['id'],this[_0x99a1('0x6')]['id']);}else{logger[_0x99a1('0xf')](_0x99a1('0x1e'),this[_0x99a1('0x5')]['id'],this[_0x99a1('0x6')]['id']);util['hideNotification'](this['notificationId'],this[_0x99a1('0x5')]['id'],this['realtime'][_0x99a1('0x12')][this[_0x99a1('0x6')]['id']],null,this['routing']);this[_0x99a1('0x7')][_0x99a1('0x12')][this[_0x99a1('0x6')]['id']][_0x99a1('0x1f')]=![];this[_0x99a1('0x7')][_0x99a1('0x12')][this[_0x99a1('0x6')]['id']][_0x99a1('0x17')]=undefined;util[_0x99a1('0x20')](this[_0x99a1('0x7')],this[_0x99a1('0x3')],this[_0x99a1('0x6')],this[_0x99a1('0x5')][_0x99a1('0x16')]);util['writeLog'](this['squeue']['id'],this[_0x99a1('0x7')][_0x99a1('0x12')][this[_0x99a1('0x6')]['id']],_0x26fbae?_0x99a1('0x21'):_0x99a1('0x22'));}if(!_0x26fbae){setTimeout(this[_0x99a1('0xd')][_0x99a1('0x9')](this),0x3e8);}};function agent(_0x54840d,_0x355f9d,_0x506613,_0x551d85){return new Agent(_0x54840d,_0x355f9d,_0x506613,_0x551d85);}module[_0x99a1('0x23')]=agent; \ No newline at end of file +var _0xf3cd=['notificationId','agent','realtime','squeue','push','handleRun','handleTimeout','timeout','drained','handleDrained','bind','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busyQueue','saveWaitingNotification','showNotification','writeLog','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xf3cd[_0x32d457];return _0x338386;};'use strict';var _=require(_0xdf3c('0x0'));var uuid=require(_0xdf3c('0x1'));var util=require(_0xdf3c('0x2'));var logger=require(_0xdf3c('0x3'))(_0xdf3c('0x4'));var Agent=function(_0x433a7f,_0x54db05,_0x401518,_0x71b446){this[_0xdf3c('0x5')]=uuid['v4']();this['squeue']=_0x433a7f;this[_0xdf3c('0x6')]=_0x54db05;this[_0xdf3c('0x7')]=_0x401518;this[_0xdf3c('0x4')]=_0x71b446;this[_0xdf3c('0x8')][_0xdf3c('0x9')](this[_0xdf3c('0xa')]['bind'](this),this[_0xdf3c('0xb')]['bind'](this));this['squeue']['on'](_0xdf3c('0xc'),this[_0xdf3c('0xb')]['bind'](this));this[_0xdf3c('0x8')]['on'](_0xdf3c('0xd'),this[_0xdf3c('0xe')][_0xdf3c('0xf')](this));};Agent[_0xdf3c('0x10')][_0xdf3c('0x9')]=function(){this[_0xdf3c('0x8')][_0xdf3c('0x9')](this['handleRun'][_0xdf3c('0xf')](this),this[_0xdf3c('0xb')][_0xdf3c('0xf')](this));};Agent[_0xdf3c('0x10')]['handleDrained']=function(){this[_0xdf3c('0xb')](!![]);};Agent[_0xdf3c('0x10')][_0xdf3c('0xa')]=function(){logger['debug'](_0xdf3c('0x11'),this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x6')]['id']);if(_[_0xdf3c('0x12')](this[_0xdf3c('0x7')][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']])){logger[_0xdf3c('0x14')](_0xdf3c('0x15'),this[_0xdf3c('0x8')]['id'],this['agent']['id']);setTimeout(this[_0xdf3c('0x9')][_0xdf3c('0xf')](this),0x3e8);}else{if(this[_0xdf3c('0x4')][_0xdf3c('0x16')]||util[_0xdf3c('0x17')](this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x7')][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']],this[_0xdf3c('0x8')][_0xdf3c('0x18')],![])){this[_0xdf3c('0x7')][_0xdf3c('0x13')][this['agent']['id']]['busy']=!![];this[_0xdf3c('0x7')]['agents'][this[_0xdf3c('0x6')]['id']][_0xdf3c('0x19')]=undefined;util[_0xdf3c('0x1a')](this[_0xdf3c('0x7')],this[_0xdf3c('0x4')],this[_0xdf3c('0x6')],this['squeue'][_0xdf3c('0x18')]);util[_0xdf3c('0x1b')](this[_0xdf3c('0x5')],this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x7')][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']],null,this[_0xdf3c('0x4')]);util[_0xdf3c('0x1c')](this[_0xdf3c('0x8')]['id'],this['realtime'][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']],'RINGING'+(this[_0xdf3c('0x4')]['forcedOwnership']?':FORCED':''));}else{logger['debug'](_0xdf3c('0x1d'),this[_0xdf3c('0x8')]['id'],this['agent']['id']);setTimeout(this['push'][_0xdf3c('0xf')](this),0x3e8);}}};Agent[_0xdf3c('0x10')][_0xdf3c('0xb')]=function(_0x1ccdd4){if(_['isNil'](this[_0xdf3c('0x7')][_0xdf3c('0x13')][this['agent']['id']])){return logger['debug'](_0xdf3c('0x15'),this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x6')]['id']);}else{logger['debug'](_0xdf3c('0x1e'),this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x6')]['id']);util[_0xdf3c('0x1f')](this['notificationId'],this[_0xdf3c('0x8')]['id'],this[_0xdf3c('0x7')]['agents'][this[_0xdf3c('0x6')]['id']],null,this[_0xdf3c('0x4')]);this[_0xdf3c('0x7')][_0xdf3c('0x13')][this['agent']['id']][_0xdf3c('0x20')]=![];this[_0xdf3c('0x7')][_0xdf3c('0x13')][this[_0xdf3c('0x6')]['id']]['busyQueue']=undefined;util[_0xdf3c('0x21')](this[_0xdf3c('0x7')],this['routing'],this['agent'],this[_0xdf3c('0x8')]['channel']);util[_0xdf3c('0x1c')](this['squeue']['id'],this['realtime']['agents'][this[_0xdf3c('0x6')]['id']],_0x1ccdd4?_0xdf3c('0x22'):_0xdf3c('0x23'));}if(!_0x1ccdd4){setTimeout(this[_0xdf3c('0x9')]['bind'](this),0x3e8);}};function agent(_0x49f147,_0x3d8557,_0x49d0f0,_0x46e40f){return new Agent(_0x49f147,_0x3d8557,_0x49d0f0,_0x46e40f);}module[_0xdf3c('0x24')]=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 bae60c3..355a42a 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 _0x738b=['removeWaitingNotification','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','queue','realtime','routing','squeue','handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','push','Agents','length','isNil','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','busyQueue','name','saveWaitingNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP','TIMEOUT'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0x738b,0x1c9));var _0xb738=function(_0x1e555d,_0x56efcb){_0x1e555d=_0x1e555d-0x0;var _0x3a18c0=_0x738b[_0x1e555d];return _0x3a18c0;};'use strict';var _=require(_0xb738('0x0'));var uuid=require(_0xb738('0x1'));var util=require(_0xb738('0x2'));var logger=require(_0xb738('0x3'))('routing');var Beepall=function(_0x363112,_0x5562d4,_0x338400,_0x3deb1c){this[_0xb738('0x4')]=uuid['v4']();this['squeue']=_0x363112;this[_0xb738('0x5')]=_0x5562d4;this[_0xb738('0x6')]=_0x338400;this[_0xb738('0x7')]=_0x3deb1c;this[_0xb738('0x8')]['push'](this[_0xb738('0x9')]['bind'](this),this[_0xb738('0xa')][_0xb738('0xb')](this));this['squeue']['on'](_0xb738('0xc'),this['handleTimeout'][_0xb738('0xb')](this));this[_0xb738('0x8')]['on'](_0xb738('0xd'),this[_0xb738('0xe')]['bind'](this));};Beepall[_0xb738('0xf')][_0xb738('0x10')]=function(){this['squeue'][_0xb738('0x10')](this[_0xb738('0x9')]['bind'](this),this['handleTimeout']['bind'](this));};Beepall[_0xb738('0xf')][_0xb738('0xe')]=function(){this[_0xb738('0xa')](!![]);};Beepall[_0xb738('0xf')][_0xb738('0x9')]=function(){var _0x34efbc=!![];if(!_['isNil'](this[_0xb738('0x5')])&&!_['isNil'](this[_0xb738('0x5')]['Agents'])&&this['queue'][_0xb738('0x11')][_0xb738('0x12')]>0x0){for(var _0x383e0b=0x0,_0x1e0ed2;_0x383e0b0x0){for(var _0x47e2ba=0x0,_0xb5e62;_0x47e2ba0x0&&_0x4dcedc[_0x177f62+_0xe291('0x23')]>=_0x4dcedc[_0x177f62+_0xe291('0x24')]){writeLog(_0x2c1578,_0x4dcedc,_0x177f62[_0xe291('0x25')]()+_0xe291('0x26'));return![];}}return!![];};exports[_0xe291('0x27')]=function(_0x317f75,_0x364164,_0x562fce,_0x1ea944,_0x2502ff){return sendNotification(!![],_0x317f75,_0x364164,_0x562fce,_0x1ea944,_0x2502ff);};exports[_0xe291('0x28')]=function(_0x3c946c,_0x9034f3,_0xc61d73,_0x48a921,_0x5a0882){return sendNotification(![],_0x3c946c,_0x9034f3,_0xc61d73,_0x48a921,_0x5a0882);};exports['checkWaitingNotifications']=function(_0x384ce5,_0x53b1a1,_0x188bf3){var _0x5eff27=_0x53b1a1['interaction'][_0xe291('0x29')];if(!_0x5eff27&&_0x188bf3){_0x5eff27=_0x188bf3['id'];}var _0x5afffa=_['some'](_0x384ce5[_0x53b1a1[_0xe291('0x2a')]+_0xe291('0x2b')],function(_0x58db8a){var _0x454acd=_[_0xe291('0x2c')](_0x53b1a1[_0xe291('0x2a')])+_0xe291('0x2d');return _0x58db8a[_0x454acd]===_0x53b1a1[_0xe291('0x2e')]['id'];});if(!_0x5afffa&&_0x5eff27&&_0x384ce5[_0xe291('0x2f')][_0x5eff27]){_0x5afffa=_['some'](_0x384ce5[_0xe291('0x2f')][_0x5eff27][_0x53b1a1[_0xe291('0x2a')]+_0xe291('0x30')],function(_0x3ce5ff){return _0x3ce5ff['id']===_0x53b1a1[_0xe291('0x2e')]['id'];});}return _0x5afffa;};exports[_0xe291('0x31')]=function(_0x43169e,_0x1cc61b,_0x2fed45,_0x1e9c12){if(_0x2fed45&&_0x2fed45['id']&&_0x43169e[_0xe291('0x2f')]&&_0x43169e['agents'][_0x2fed45['id']]){_0x43169e[_0xe291('0x2f')][_0x2fed45['id']][_0x1e9c12+'WaitingInteractions'][_0x1cc61b[_0xe291('0x14')]['id']]={'id':_0x1cc61b[_0xe291('0x2e')]['id']};}};exports[_0xe291('0x32')]=function(_0x69f8ea,_0x4dfdc5,_0x5f01a0,_0x12862f){if(_0x5f01a0&&_0x5f01a0['id']&&_0x69f8ea['agents']&&_0x69f8ea[_0xe291('0x2f')][_0x5f01a0['id']]){delete _0x69f8ea[_0xe291('0x2f')][_0x5f01a0['id']][_0x12862f+_0xe291('0x30')][_0x4dfdc5[_0xe291('0x14')]['id']];}};exports[_0xe291('0x33')]=writeLog; \ No newline at end of file +var _0x832e=['saveWaitingNotification','removeWaitingNotification','writeLog','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','socket.io-emitter','split','\x20interaction','name','account','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','format','message','user:%s','emit','notification:%s','save','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','channel','InteractionId','agents','some','WaitingInteractions','interaction'];(function(_0x1d5975,_0x1dce0b){var _0x55c31a=function(_0x2c6646){while(--_0x2c6646){_0x1d5975['push'](_0x1d5975['shift']());}};_0x55c31a(++_0x1dce0b);}(_0x832e,0x17b));var _0xe832=function(_0x387089,_0x25748c){_0x387089=_0x387089-0x0;var _0x4bdb60=_0x832e[_0x387089];return _0x4bdb60;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xe832('0x0'));var Redis=require(_0xe832('0x1'));var config=require(_0xe832('0x2'));var logger=require(_0xe832('0x3'))(_0xe832('0x4'));config[_0xe832('0x5')]=_[_0xe832('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xe832('0x7'))(new Redis(config[_0xe832('0x5')]));function sendNotification(_0x426a13,_0xa08e5c,_0x181427,_0x226b06,_0x277589,_0x7978ea){var _0xc54ccf=_0x7978ea||{};var _0x4a652c=_0x181427[_0xe832('0x8')]('.');var _0x59daf3={'uniqueid':_0xa08e5c,'channel':_0x4a652c[0x0],'id':_0x4a652c[0x1],'title':_0x4a652c[0x0]+_0xe832('0x9'),'interactionId':_0x4a652c[0x2],'queue':_0x277589?_0x277589[_0xe832('0xa')]:null,'sound':_0xc54ccf[_0xe832('0xb')]['notificationSound'],'shake':_0xc54ccf[_0xe832('0xb')][_0xe832('0xc')]};try{if(!_0xc54ccf[_0xe832('0xd')]){_0xc54ccf[_0xe832('0xd')]={};}if(_0x277589){_0xc54ccf['body'][_0xe832('0xe')]=_0x277589;}else if(_0xc54ccf[_0xe832('0xd')]['queue']){delete _0xc54ccf[_0xe832('0xd')][_0xe832('0xe')];}_0x59daf3['msg']=utils[_0xe832('0xf')](_0xc54ccf[_0xe832('0xb')][_0xe832('0x10')],_0xc54ccf);}catch(_0x124d4c){_0x59daf3[_0xe832('0x11')]=_0xe832('0x12');logger[_0xe832('0x13')](util[_0xe832('0x14')]('[%s][QUEUE]\x20%s',_0xa08e5c,_0x124d4c[_0xe832('0x15')]));}io['to'](util[_0xe832('0x14')](_0xe832('0x16'),_0x226b06['name']))[_0xe832('0x17')](util[_0xe832('0x14')](_0xe832('0x18'),_0x426a13?_0xe832('0x19'):'remove'),_0x59daf3);}function writeLog(_0x346cbb,_0x3f157c,_0x4d1603){return logger[_0xe832('0x1a')](util['format'](_0xe832('0x1b'),_0x346cbb,_0x3f157c[_0xe832('0xa')],_0x4d1603));}exports[_0xe832('0x1c')]=function(_0x185368,_0x1c7dc8,_0x512a52,_0x3646b2){if(_0x1c7dc8[_0xe832('0x1d')]){writeLog(_0x185368,_0x1c7dc8,_0xe832('0x1e'));return![];}if(!_0x1c7dc8[_0xe832('0x1f')]){writeLog(_0x185368,_0x1c7dc8,'OFFLINE');return![];}if(_0x1c7dc8[_0x512a52+'Pause']){writeLog(_0x185368,_0x1c7dc8,'PAUSE');return![];}if(_0x3646b2&&_0x1c7dc8[_0xe832('0x20')](_0x512a52+_0xe832('0x21'))&&_0x1c7dc8[_0xe832('0x20')](_0x512a52+_0xe832('0x22'))){if(_0x1c7dc8[_0x512a52+'Capacity']>0x0&&_0x1c7dc8[_0x512a52+'CurrentCapacity']>=_0x1c7dc8[_0x512a52+_0xe832('0x21')]){writeLog(_0x185368,_0x1c7dc8,_0x512a52['toUpperCase']()+_0xe832('0x23'));return![];}}return!![];};exports[_0xe832('0x24')]=function(_0x329ffd,_0x15df2c,_0x13420a,_0x528087,_0x50cd29){return sendNotification(!![],_0x329ffd,_0x15df2c,_0x13420a,_0x528087,_0x50cd29);};exports[_0xe832('0x25')]=function(_0x165195,_0x45eedf,_0x2fb116,_0x1c9b9f,_0x53d622){return sendNotification(![],_0x165195,_0x45eedf,_0x2fb116,_0x1c9b9f,_0x53d622);};exports['checkWaitingNotifications']=function(_0x55c508,_0x38b147,_0x2c2737){var _0x54497e=_0x38b147['interaction']['UserId'];if(!_0x54497e&&_0x2c2737){_0x54497e=_0x2c2737['id'];}var _0x3b4c60=_['some'](_0x55c508[_0x38b147[_0xe832('0x26')]+'QueuesWaitingInteractions'],function(_0x33152e){var _0x25d71f=_['capitalize'](_0x38b147[_0xe832('0x26')])+_0xe832('0x27');return _0x33152e[_0x25d71f]===_0x38b147['interaction']['id'];});if(!_0x3b4c60&&_0x54497e&&_0x55c508[_0xe832('0x28')][_0x54497e]){_0x3b4c60=_[_0xe832('0x29')](_0x55c508['agents'][_0x54497e][_0x38b147['channel']+_0xe832('0x2a')],function(_0x4c162c){return _0x4c162c['id']===_0x38b147[_0xe832('0x2b')]['id'];});}return _0x3b4c60;};exports[_0xe832('0x2c')]=function(_0x30d88a,_0x5cd1df,_0x3bb2a8,_0x174cb9){if(_0x3bb2a8&&_0x3bb2a8['id']&&_0x30d88a[_0xe832('0x28')]&&_0x30d88a[_0xe832('0x28')][_0x3bb2a8['id']]){_0x30d88a[_0xe832('0x28')][_0x3bb2a8['id']][_0x174cb9+_0xe832('0x2a')][_0x5cd1df[_0xe832('0x15')]['id']]={'id':_0x5cd1df[_0xe832('0x2b')]['id']};}};exports[_0xe832('0x2d')]=function(_0x580881,_0x19cc73,_0x576994,_0x581ea9){if(_0x576994&&_0x576994['id']&&_0x580881[_0xe832('0x28')]&&_0x580881[_0xe832('0x28')][_0x576994['id']]){delete _0x580881[_0xe832('0x28')][_0x576994['id']][_0x581ea9+_0xe832('0x2a')][_0x19cc73[_0xe832('0x15')]['id']];}};exports[_0xe832('0x2e')]=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 2f3f313..be56982 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 _0x9113=['error','isObject','stringify','shelljs','./utils','../../../../config/logger','routing','string','[%s][SYSTEM]\x20%s','map','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','body'];(function(_0x584284,_0xb5ace){var _0x27505d=function(_0xd05230){while(--_0xd05230){_0x584284['push'](_0x584284['shift']());}};_0x27505d(++_0xb5ace);}(_0x9113,0x1cf));var _0x3911=function(_0x43f90a,_0x32c91b){_0x43f90a=_0x43f90a-0x0;var _0x4c53b9=_0x9113[_0x43f90a];return _0x4c53b9;};'use strict';var schema=require('validate');var sh=require(_0x3911('0x0'));var _=require('lodash');var utils=require(_0x3911('0x1'));var logger=require(_0x3911('0x2'))(_0x3911('0x3'));var system=schema({'command':{'type':_0x3911('0x4'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x588b10,_0x32184c){return function(_0x2a848a){try{var _0x8ca202={'command':_0x32184c[0x0]};var _0x5a83b0=system['validate'](_0x8ca202,{'typecast':!![]});if(_0x5a83b0['length']){logger['error'](_0x3911('0x5'),_0x588b10,_[_0x3911('0x6')](_0x5a83b0,'message')['join'](',\x20'));logger[_0x3911('0x7')](_0x3911('0x8'),_0x588b10);_0x2a848a[_0x3911('0x9')]();}else{var _0x4c2c5b=this;var _0x5c3526=utils[_0x3911('0xa')](_0x32184c[0x0],this);logger['info'](_0x3911('0xb'),_0x588b10,_0x5c3526);sh[_0x3911('0xc')](_['trim'](_0x5c3526),function(_0xf25a7e,_0x5c0eec){logger[_0x3911('0x7')](_0x3911('0xd'),_0x588b10,_0xf25a7e);if(_0xf25a7e==0x0){var _0x548d93=_0x5c0eec[_0x3911('0xe')](/(\r\n|\n|\r)/gm,'');if(_[_0x3911('0xf')](_0x32184c[0x1])||_['isEmpty'](_0x32184c[0x1])){logger[_0x3911('0x7')]('[%s][SYSTEM]\x20no\x20variable',_0x588b10);_0x4c2c5b[_0x3911('0x10')][_0x32184c[0x1]]=_0x548d93;}else{logger[_0x3911('0x7')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x588b10,_0x32184c[0x1],_0x548d93);_0x4c2c5b['body'][_0x32184c[0x1]]=_0x548d93;}}_0x2a848a[_0x3911('0x9')]();});}}catch(_0x1111c7){logger[_0x3911('0x11')]('[%s][SYSTEM]\x20%s',_0x588b10,_[_0x3911('0x12')](_0x1111c7)?JSON[_0x3911('0x13')](_0x1111c7):_0x1111c7);logger[_0x3911('0x7')](_0x3911('0x8'),_0x588b10);_0x2a848a[_0x3911('0x9')]();}};}; \ No newline at end of file +var _0x8128=['info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','stringify','validate','./utils','../../../../config/logger','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s'];(function(_0x1e9393,_0x301a65){var _0x4ef265=function(_0x1c45db){while(--_0x1c45db){_0x1e9393['push'](_0x1e9393['shift']());}};_0x4ef265(++_0x301a65);}(_0x8128,0x1b1));var _0x8812=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x8128[_0x33032e];return _0x13316b;};'use strict';var schema=require(_0x8812('0x0'));var sh=require('shelljs');var _=require('lodash');var utils=require(_0x8812('0x1'));var logger=require(_0x8812('0x2'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0x8812('0x3')}});exports[_0x8812('0x4')]=function(_0x21b1d5,_0x4a8add){return function(_0x33f9f6){try{var _0x2f4af9={'command':_0x4a8add[0x0]};var _0x2b43c6=system[_0x8812('0x0')](_0x2f4af9,{'typecast':!![]});if(_0x2b43c6['length']){logger[_0x8812('0x5')](_0x8812('0x6'),_0x21b1d5,_['map'](_0x2b43c6,'message')['join'](',\x20'));logger[_0x8812('0x7')](_0x8812('0x8'),_0x21b1d5);_0x33f9f6[_0x8812('0x9')]();}else{var _0x3845e8=this;var _0x8ddb12=utils[_0x8812('0xa')](_0x4a8add[0x0],this);logger[_0x8812('0x7')](_0x8812('0xb'),_0x21b1d5,_0x8ddb12);sh[_0x8812('0xc')](_['trim'](_0x8ddb12),function(_0x15f3bb,_0x13bb0e){logger[_0x8812('0x7')](_0x8812('0xd'),_0x21b1d5,_0x15f3bb);if(_0x15f3bb==0x0){var _0x30ab14=_0x13bb0e[_0x8812('0xe')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x4a8add[0x1])||_[_0x8812('0xf')](_0x4a8add[0x1])){logger[_0x8812('0x7')](_0x8812('0x10'),_0x21b1d5);_0x3845e8['body'][_0x4a8add[0x1]]=_0x30ab14;}else{logger['info'](_0x8812('0x11'),_0x21b1d5,_0x4a8add[0x1],_0x30ab14);_0x3845e8[_0x8812('0x12')][_0x4a8add[0x1]]=_0x30ab14;}}_0x33f9f6['next']();});}}catch(_0x50f04c){logger['error']('[%s][SYSTEM]\x20%s',_0x21b1d5,_['isObject'](_0x50f04c)?JSON[_0x8812('0x13')](_0x50f04c):_0x50f04c);logger['info'](_0x8812('0x8'),_0x21b1d5);_0x33f9f6['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 fd3d370..7766c4b 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 _0x580d=['../../rpc/whatsappInteraction','routing','consequence','length','error','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','finally','next','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x580d,0x1e9));var _0xd580=function(_0xe0d025,_0x220fa0){_0xe0d025=_0xe0d025-0x0;var _0x2901dd=_0x580d[_0xe0d025];return _0x2901dd;};'use strict';var schema=require(_0xd580('0x0'));var _=require(_0xd580('0x1'));var rpc={'chatInteraction':require(_0xd580('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xd580('0x3')),'faxInteraction':require(_0xd580('0x4')),'whatsappInteraction':require(_0xd580('0x5'))};var logger=require('../../../../config/logger')(_0xd580('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xd580('0x7')]=function(_0x1d2700,_0x5acee2,_0x598e47,_0x278a8f){return function(_0x2c3d29){try{var _0x463a87={'tag':_0x5acee2[0x0]};var _0x531f02=tag['validate'](_0x463a87,{'typecast':!![]});if(_0x531f02[_0xd580('0x8')]){logger[_0xd580('0x9')](_0xd580('0xa'),_0x1d2700,_['map'](_0x531f02,_0xd580('0xb'))[_0xd580('0xc')](',\x20'));logger[_0xd580('0xd')](_0xd580('0xe'),_0x1d2700);_0x2c3d29['next']();}else{var _0x58cb47={'ids':[_0x5acee2[0x0]]};if(rpc[_0x278a8f[_0xd580('0xf')]+_0xd580('0x10')]){rpc[_0x278a8f[_0xd580('0xf')]+_0xd580('0x10')][_0xd580('0x11')](_0x278a8f['interaction']['id'],_0x58cb47)[_0xd580('0x12')](function(_0x570db9){logger[_0xd580('0xd')](_0xd580('0x13'),_0x1d2700,_0x5acee2[0x1],_0x278a8f[_0xd580('0xf')],_0x278a8f[_0xd580('0x14')]['id']);})[_0xd580('0x15')](function(_0x4ddbf5){logger['error']('[%s][TAG]\x20%s',_0x1d2700,JSON[_0xd580('0x16')](_0x4ddbf5));logger['info'](_0xd580('0xe'),_0x1d2700);})[_0xd580('0x17')](function(){_0x2c3d29[_0xd580('0x18')]();});}}}catch(_0x273825){logger[_0xd580('0x9')](_0xd580('0xa'),_0x1d2700,_[_0xd580('0x19')](_0x273825)?JSON[_0xd580('0x16')](_0x273825):_0x273825);logger[_0xd580('0xd')](_0xd580('0xe'),_0x1d2700);_0x2c3d29[_0xd580('0x18')]();}};}; \ No newline at end of file +var _0x2f87=['addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','info','finally','isObject','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','error','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel'];(function(_0x321064,_0x2e5008){var _0x42c2a7=function(_0x3f4957){while(--_0x3f4957){_0x321064['push'](_0x321064['shift']());}};_0x42c2a7(++_0x2e5008);}(_0x2f87,0x1ee));var _0x72f8=function(_0x344d47,_0x4d9673){_0x344d47=_0x344d47-0x0;var _0x2364e2=_0x2f87[_0x344d47];return _0x2364e2;};'use strict';var schema=require('validate');var _=require('lodash');var rpc={'chatInteraction':require(_0x72f8('0x0')),'openchannelInteraction':require(_0x72f8('0x1')),'smsInteraction':require(_0x72f8('0x2')),'mailInteraction':require(_0x72f8('0x3')),'faxInteraction':require(_0x72f8('0x4')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x72f8('0x5'))(_0x72f8('0x6'));var tag=schema({'tag':{'type':_0x72f8('0x7'),'required':!![],'message':_0x72f8('0x8')}});exports['consequence']=function(_0x440e14,_0x339bdb,_0xc8cb77,_0x3b526a){return function(_0x261bcd){try{var _0x3215d8={'tag':_0x339bdb[0x0]};var _0x3649b9=tag[_0x72f8('0x9')](_0x3215d8,{'typecast':!![]});if(_0x3649b9['length']){logger[_0x72f8('0xa')](_0x72f8('0xb'),_0x440e14,_[_0x72f8('0xc')](_0x3649b9,_0x72f8('0xd'))[_0x72f8('0xe')](',\x20'));logger['info'](_0x72f8('0xf'),_0x440e14);_0x261bcd[_0x72f8('0x10')]();}else{var _0xdaf1ab={'ids':[_0x339bdb[0x0]]};if(rpc[_0x3b526a['channel']+_0x72f8('0x11')]){rpc[_0x3b526a[_0x72f8('0x12')]+_0x72f8('0x11')][_0x72f8('0x13')](_0x3b526a[_0x72f8('0x14')]['id'],_0xdaf1ab)['then'](function(_0x26d460){logger['info'](_0x72f8('0x15'),_0x440e14,_0x339bdb[0x1],_0x3b526a[_0x72f8('0x12')],_0x3b526a['interaction']['id']);})[_0x72f8('0x16')](function(_0x3e47d4){logger[_0x72f8('0xa')](_0x72f8('0xb'),_0x440e14,JSON[_0x72f8('0x17')](_0x3e47d4));logger[_0x72f8('0x18')](_0x72f8('0xf'),_0x440e14);})[_0x72f8('0x19')](function(){_0x261bcd[_0x72f8('0x10')]();});}}}catch(_0x1e14d0){logger[_0x72f8('0xa')]('[%s][TAG]\x20%s',_0x440e14,_[_0x72f8('0x1a')](_0x1e14d0)?JSON[_0x72f8('0x17')](_0x1e14d0):_0x1e14d0);logger[_0x72f8('0x18')](_0x72f8('0xf'),_0x440e14);_0x261bcd[_0x72f8('0x10')]();}};}; \ 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 dde1335..ce119f5 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 _0xfcc5=['method','login','params','utf8','POST','application/json-rpc','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&sessionId=','&data=','stringify','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','isObject','info','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','urlOnRing','?params=','title','jsonrpc','2.0'];(function(_0x4fdd50,_0x200328){var _0x6b545d=function(_0x278de7){while(--_0x278de7){_0x4fdd50['push'](_0x4fdd50['shift']());}};_0x6b545d(++_0x200328);}(_0xfcc5,0xdf));var _0x5fcc=function(_0x592077,_0x457090){_0x592077=_0x592077-0x0;var _0x19099f=_0xfcc5[_0x592077];return _0x19099f;};'use strict';var rp=require(_0x5fcc('0x0'));var logger=require(_0x5fcc('0x1'))(_0x5fcc('0x2'));var _=require(_0x5fcc('0x3'));var arr=[];exports[_0x5fcc('0x4')]=function(_0x3e7a53,_0x1328d3){return function(_0x41afa5){var _0x4a30d9=_0x1328d3[0xa];var _0x5474cd=_0x1328d3[0xb];var _0x3b9f0b=_0x1328d3[0xc];var _0x553b92=_0x1328d3[0xd];var _0x3b258e=_0x1328d3[0xe];var _0x1ec15c=_0x1328d3[0xf][_0x5fcc('0x5')](/\n/g,_0x5fcc('0x6'));var _0x3b29af=_0x1328d3[0x10][_0x5fcc('0x5')](/\n/g,'\x20');if(!arr[_0x5fcc('0x7')](_0x5474cd)){arr[_0x5fcc('0x8')](_0x5474cd);var _0x3cd1f1=_0x1328d3[0x3];var _0x258d7c=_0x1328d3[0x4];var _0x5b2c82=_0x1328d3[0x1];var _0x16b4c7=_0x1328d3[0x0];var _0x2f0547={};_0x2f0547[_0x5fcc('0x9')]=_0x1328d3[0x8]+'?params='+_0x3b9f0b+'|'+_0x4a30d9+'|'+_0x553b92+'|'+_0x5474cd+'|'+_0x3b258e;_0x2f0547[_0x5fcc('0xa')]=_0x1328d3[0x7]+_0x5fcc('0xb')+_0x3b9f0b+'|'+_0x4a30d9+'|'+_0x553b92+'|'+_0x5474cd+'|'+_0x3b258e+'|'+_0x1ec15c+'|'+_0x3b29af;_0x2f0547[_0x5fcc('0xc')]=_0x1328d3[0x9];var _0x13d5cd={};_0x13d5cd[_0x5fcc('0xd')]=_0x5fcc('0xe');_0x13d5cd[_0x5fcc('0xf')]=_0x5fcc('0x10');var _0x4d4897=[];_0x4d4897['push'](_0x1328d3[0x2]);_0x4d4897[_0x5fcc('0x8')](_0x1328d3[0x5]);_0x4d4897[_0x5fcc('0x8')](_0x1328d3[0x6]);_0x13d5cd[_0x5fcc('0x11')]=_0x4d4897;_0x13d5cd['id']=0x1;var _0x4f3f33=JSON['stringify'](_0x13d5cd);var _0x297909={'encoding':_0x5fcc('0x12'),'method':_0x5fcc('0x13'),'timeout':0x2710,'url':_0x3cd1f1,'headers':{'Content-Type':_0x5fcc('0x14')},'body':_0x4f3f33};return rp(_0x297909)['then'](function(_0x7d0106){const _0x57695c=JSON['parse'](_0x7d0106);if(!_0x57695c[_0x5fcc('0x15')][_0x5fcc('0x16')]){throw new Error(_0x5fcc('0x17'));}var _0x24a611=_0x5474cd;var _0x543b51='channelId='+_0x5b2c82+_0x5fcc('0x18')+_0x16b4c7+_0x5fcc('0x19')+_0x24a611+_0x5fcc('0x1a')+JSON[_0x5fcc('0x1b')](_0x2f0547);var _0x46dea8=_0x258d7c+'?'+_0x543b51;return rp(_0x46dea8);})['then'](function(_0x4aad0a){logger['info'](_0x5fcc('0x1c'),_0x3e7a53,_0x4aad0a);_0x41afa5[_0x5fcc('0x1d')]();})[_0x5fcc('0x1e')](function(_0xde8808){logger['error'](_0x5fcc('0x1f'),_0x3e7a53,_[_0x5fcc('0x20')](_0xde8808)?JSON[_0x5fcc('0x1b')](_0xde8808):_0xde8808);_0x41afa5['stop']();});}else{logger[_0x5fcc('0x21')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x3e7a53);_0x41afa5['next']();}};}; \ No newline at end of file +var _0x6f75=['POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','title','jsonrpc','2.0','method','login','params','stringify','utf8'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f75,0xb0));var _0x56f7=function(_0x5816ce,_0x394540){_0x5816ce=_0x5816ce-0x0;var _0x16d787=_0x6f75[_0x5816ce];return _0x16d787;};'use strict';var rp=require(_0x56f7('0x0'));var logger=require(_0x56f7('0x1'))(_0x56f7('0x2'));var _=require(_0x56f7('0x3'));var arr=[];exports[_0x56f7('0x4')]=function(_0x18b9f1,_0xdc2002){return function(_0x12c76a){var _0x49b97e=_0xdc2002[0xa];var _0x244e55=_0xdc2002[0xb];var _0x19b219=_0xdc2002[0xc];var _0x46a543=_0xdc2002[0xd];var _0x5e2d0a=_0xdc2002[0xe];var _0x4aab7e=_0xdc2002[0xf][_0x56f7('0x5')](/\n/g,_0x56f7('0x6'));var _0x3633cb=_0xdc2002[0x10][_0x56f7('0x5')](/\n/g,'\x20');if(!arr[_0x56f7('0x7')](_0x244e55)){arr[_0x56f7('0x8')](_0x244e55);var _0x38444d=_0xdc2002[0x3];var _0x4309da=_0xdc2002[0x4];var _0x38b583=_0xdc2002[0x1];var _0x64c4fe=_0xdc2002[0x0];var _0x3c625e={};_0x3c625e[_0x56f7('0x9')]=_0xdc2002[0x8]+'?params='+_0x19b219+'|'+_0x49b97e+'|'+_0x46a543+'|'+_0x244e55+'|'+_0x5e2d0a;_0x3c625e['urlOnRing']=_0xdc2002[0x7]+_0x56f7('0xa')+_0x19b219+'|'+_0x49b97e+'|'+_0x46a543+'|'+_0x244e55+'|'+_0x5e2d0a+'|'+_0x4aab7e+'|'+_0x3633cb;_0x3c625e[_0x56f7('0xb')]=_0xdc2002[0x9];var _0x44f6ca={};_0x44f6ca[_0x56f7('0xc')]=_0x56f7('0xd');_0x44f6ca[_0x56f7('0xe')]=_0x56f7('0xf');var _0x4289b1=[];_0x4289b1[_0x56f7('0x8')](_0xdc2002[0x2]);_0x4289b1['push'](_0xdc2002[0x5]);_0x4289b1[_0x56f7('0x8')](_0xdc2002[0x6]);_0x44f6ca[_0x56f7('0x10')]=_0x4289b1;_0x44f6ca['id']=0x1;var _0x532155=JSON[_0x56f7('0x11')](_0x44f6ca);var _0x1f8334={'encoding':_0x56f7('0x12'),'method':_0x56f7('0x13'),'timeout':0x2710,'url':_0x38444d,'headers':{'Content-Type':_0x56f7('0x14')},'body':_0x532155};return rp(_0x1f8334)[_0x56f7('0x15')](function(_0x280760){const _0x4df332=JSON[_0x56f7('0x16')](_0x280760);if(!_0x4df332[_0x56f7('0x17')][_0x56f7('0x18')]){throw new Error(_0x56f7('0x19'));}var _0x5727af=_0x244e55;var _0x5a3913=_0x56f7('0x1a')+_0x38b583+_0x56f7('0x1b')+_0x64c4fe+_0x56f7('0x1c')+_0x5727af+_0x56f7('0x1d')+JSON['stringify'](_0x3c625e);var _0x4feb4b=_0x4309da+'?'+_0x5a3913;return rp(_0x4feb4b);})[_0x56f7('0x15')](function(_0x208f92){logger[_0x56f7('0x1e')](_0x56f7('0x1f'),_0x18b9f1,_0x208f92);_0x12c76a[_0x56f7('0x20')]();})[_0x56f7('0x21')](function(_0x7032e4){logger[_0x56f7('0x22')](_0x56f7('0x23'),_0x18b9f1,_[_0x56f7('0x24')](_0x7032e4)?JSON[_0x56f7('0x11')](_0x7032e4):_0x7032e4);_0x12c76a[_0x56f7('0x20')]();});}else{logger[_0x56f7('0x1e')](_0x56f7('0x25'),_0x18b9f1);_0x12c76a[_0x56f7('0x26')]();}};}; \ 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 65ed0bd..72e6ede 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 _0x9c44=['merge','body','account','list','exports','render'];(function(_0x2184f7,_0x216737){var _0x7c4c36=function(_0x4bab37){while(--_0x4bab37){_0x2184f7['push'](_0x2184f7['shift']());}};_0x7c4c36(++_0x216737);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x59d739,_0x387145){var _0x6adce0=function(_0x51dbc2){while(--_0x51dbc2){_0x59d739['push'](_0x59d739['shift']());}};_0x6adce0(++_0x387145);}(_0xe706,0xa3));var _0x6e70=function(_0x27125a,_0x252d0d){_0x27125a=_0x27125a-0x0;var _0x391f7a=_0xe706[_0x27125a];return _0x391f7a;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 01242be..07b3ae2 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 _0x8165=['tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body','format','%s:%s:%s','./interval','condition','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','emit','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','values','chatQueues','available','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','loggedIn','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','./applications/strategy/util','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','transfer','isArray','applications','length','join','app','.js','toLowerCase','appdata','split','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId'];(function(_0x34325b,_0x5e5afe){var _0x3da348=function(_0x3bf709){while(--_0x3bf709){_0x34325b['push'](_0x34325b['shift']());}};_0x3da348(++_0x5e5afe);}(_0x8165,0x1c3));var _0x5816=function(_0x1defd7,_0x5d3454){_0x1defd7=_0x1defd7-0x0;var _0x55ec67=_0x8165[_0x1defd7];return _0x55ec67;};'use strict';var _=require(_0x5816('0x0'));var util=require(_0x5816('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x5816('0x2'));var BPromise=require(_0x5816('0x3'));var utils=require('./applications/utils');var sUtils=require(_0x5816('0x4'));var logger=require(_0x5816('0x5'))(_0x5816('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x5816('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x5816('0x8')),'faxQueueReport':require(_0x5816('0x9')),'whatsappQueueReport':require(_0x5816('0xa'))};var RuleEngine=require(_0x5816('0xb'));function getId(_0x1a447f,_0x234305,_0xee9a93){return util['format']('%s.%s.%s',_0x1a447f,_0x234305||0x0,_0xee9a93||0x0);}function getIntervals(_0xfecaef,_0x18bbde){var _0x2a5a49=[];if(!_['isNil'](_0x18bbde[_0x5816('0xc')])&&!_[_0x5816('0xd')](_0xfecaef[_0x18bbde[_0x5816('0xc')]])&&!_['isNil'](_0xfecaef[_0x18bbde[_0x5816('0xc')]][_0x5816('0xe')])){_0x2a5a49=_[_0x5816('0xf')](_0xfecaef[_0x18bbde['IntervalId']][_0x5816('0xe')],_0x5816('0x10'));}else if(!_[_0x5816('0xd')](_0x18bbde[_0x5816('0x10')])){_0x2a5a49=[_0x18bbde[_0x5816('0x10')]];}return _0x2a5a49;}exports[_0x5816('0x11')]=function(_0x2c8d5f){_0x2c8d5f[_0x5816('0x12')]={};return new BPromise(function(_0x14f111,_0x141985){var _0x4da805={'Start':function(_0x135581){var _0x5ded88=this;return new Promise(function(_0x3a9619,_0x1711a3){if(_0x135581){try{var _0x372b3a=[];var _0x4c0718=getId(_0x135581[_0x5816('0x13')],_0x135581[_0x5816('0x14')]?_0x135581[_0x5816('0x14')]['id']:0x0,_0x135581[_0x5816('0x15')]?_0x135581[_0x5816('0x15')]['id']:0x0);var _0x5cb54d=sUtils['checkWaitingNotifications'](_0x2c8d5f,_0x135581);if(_0x135581[_0x5816('0x16')]||!_0x5cb54d&&_0x135581['applications']&&_[_0x5816('0x17')](_0x135581['applications'])&&_0x135581[_0x5816('0x18')][_0x5816('0x19')]){for(var _0x1d307c=0x0;_0x1d307c<_0x135581[_0x5816('0x18')][_0x5816('0x19')];_0x1d307c+=0x1){var _0x390acf=_0x135581[_0x5816('0x18')][_0x1d307c];if(fs['existsSync'](path[_0x5816('0x1a')](__dirname,_0x5816('0x18'),_0x390acf[_0x5816('0x1b')]+_0x5816('0x1c')))){var _0x20e88b=[];switch(_0x390acf['app'][_0x5816('0x1d')]()){case'autoreply':var _0x59b97d=_0x390acf[_0x5816('0x1e')][_0x5816('0x1f')](',');if(_0x135581[_0x5816('0x13')]==='mail'){_0x20e88b[_0x5816('0x20')](_0x59b97d[0x0]);_0x20e88b[_0x5816('0x20')](_0x59b97d[0x1]);_0x20e88b[_0x5816('0x20')](_0x59b97d[_0x5816('0x21')](0x2,_0x59b97d['length'])[_0x5816('0x1a')](','));}else{_0x20e88b[_0x5816('0x20')](_0x59b97d[0x0]);_0x20e88b['push'](_0x59b97d[_0x5816('0x21')](0x1,_0x59b97d[_0x5816('0x19')])['join'](','));}break;case _0x5816('0x22'):var _0x4efbcf=_0x390acf[_0x5816('0x1e')][_0x5816('0x1f')](',');_0x20e88b[_0x5816('0x20')](_0x4efbcf[0x0]);_0x20e88b['push'](_0x4efbcf[0x1]);_0x20e88b[_0x5816('0x20')](_0x4efbcf[_0x5816('0x21')](0x2,_0x4efbcf[_0x5816('0x19')])[_0x5816('0x1a')](','));break;case _0x5816('0x23'):var _0x4c184e=_0x390acf['appdata']['split'](',');_0x20e88b['push'](_0x4c184e[0x0]);_0x20e88b['push'](_0x4c184e[0x1]);_0x20e88b[_0x5816('0x20')](_0x4c184e[0x2]);_0x20e88b['push'](_0x4c184e[0x3]);_0x20e88b[_0x5816('0x20')](_0x4c184e[_0x5816('0x21')](0x4,_0x4c184e['length'])[_0x5816('0x1a')](','));break;case _0x5816('0x24'):var _0x19c99a=_0x390acf[_0x5816('0x1e')][_0x5816('0x1f')](',');_0x20e88b[_0x5816('0x20')](_0x19c99a[0x0]);_0x20e88b[_0x5816('0x20')](_0x19c99a[0x1]);_0x20e88b[_0x5816('0x20')](_0x19c99a[0x2]);_0x20e88b[_0x5816('0x20')](_0x19c99a[0x3]);_0x20e88b['push'](_0x19c99a['slice'](0x4,_0x19c99a[_0x5816('0x19')])[_0x5816('0x1a')](','));break;case _0x5816('0x14'):_0x20e88b[_0x5816('0x20')](_0x390acf['appdata']);break;case _0x5816('0x25'):_0x20e88b[_0x5816('0x20')](_0x390acf[_0x5816('0x26')]);_0x20e88b[_0x5816('0x20')](_0x390acf[_0x5816('0x1e')]);break;case _0x5816('0x27'):var _0x3fea2e=utils[_0x5816('0x28')](_0x135581[_0x5816('0x29')]['notificationTemplate'],_0x135581);var _0x3e2309=_0x390acf[_0x5816('0x1e')][_0x5816('0x1f')](',');_0x20e88b[_0x5816('0x20')](_0x3e2309[0x0]);_0x20e88b[_0x5816('0x20')](_0x3e2309[0x1]);_0x20e88b['push'](_0x3e2309[0x2]);_0x20e88b['push'](_0x3e2309[0x3]);_0x20e88b[_0x5816('0x20')](_0x3e2309[0x4]);_0x20e88b[_0x5816('0x20')](_0x3e2309[0x5]);_0x20e88b[_0x5816('0x20')](_0x3e2309[0x6]);_0x20e88b['push'](_0x3e2309[0x7]);_0x20e88b[_0x5816('0x20')](_0x3e2309[0x8]);_0x20e88b[_0x5816('0x20')](_0x3e2309[0x9]);_0x20e88b[_0x5816('0x20')](_0x3e2309[0xa]);_0x20e88b['push'](_0x135581[_0x5816('0x15')]['id']);_0x20e88b[_0x5816('0x20')](_0x135581['message']['id']);_0x20e88b['push'](_0x390acf[_0x5816('0x2a')]);_0x20e88b[_0x5816('0x20')](_0x135581['interaction'][_0x5816('0x2b')]);_0x20e88b[_0x5816('0x20')](_0x135581[_0x5816('0x2c')][_0x5816('0x2c')]);_0x20e88b['push'](_0x3fea2e);break;default:_0x20e88b=_[_0x5816('0xd')](_0x390acf['appdata'])?[]:_0x390acf[_0x5816('0x1e')][_0x5816('0x1f')](',');}var _0x24e73a={'id':util[_0x5816('0x2d')](_0x5816('0x2e'),_0x4c0718,_0x390acf['id'],_0x390acf[_0x5816('0x1b')]),'condition':require(_0x5816('0x2f'))[_0x5816('0x30')](_0x4c0718,getIntervals(_0x2c8d5f['intervals'],_0x390acf),_0x2c8d5f),'consequence':require(_0x5816('0x31')+_0x390acf['app'])['consequence'](_0x4c0718,_0x20e88b,_0x2c8d5f,_0x135581),'p':_0x390acf[_0x5816('0x32')]||0x0};logger[_0x5816('0x33')](_0x5816('0x34'),_0x24e73a['id'],_0x5816('0x35'),getIntervals(_0x2c8d5f[_0x5816('0x36')],_0x390acf)[_0x5816('0x1a')](_0x5816('0x37')));_0x372b3a[_0x5816('0x20')](_0x24e73a);}else{logger[_0x5816('0x38')](_0x5816('0x39'),path['join'](__dirname,_0x5816('0x18'),_0x390acf[_0x5816('0x1b')]+_0x5816('0x1c')));}}_0x2c8d5f['rules'][_0x4c0718]=new RuleEngine(_0x372b3a);_0x2c8d5f[_0x5816('0x12')][_0x4c0718]['execute'](_0x135581,function(_0x5904fb){logger['info'](_0x5816('0x3a'),JSON[_0x5816('0x3b')](_0x5904fb['matchPath']));if(_0x2c8d5f[_0x5816('0x12')][_0x4c0718]){_0x2c8d5f[_0x5816('0x12')][_0x4c0718][_0x5816('0x3c')]('complete');}});return _0x3a9619({'code':0xc8,'message':_0x135581});}else{if(_0x5cb54d){logger[_0x5816('0x33')](util[_0x5816('0x2d')](_0x5816('0x3d'),_0x4c0718));}else{logger['info'](_0x5816('0x3e'));}return _0x3a9619({'code':0xc8,'message':_0x135581});}}catch(_0x2dc162){logger[_0x5816('0x38')](_0x2dc162[_0x5816('0x3f')]);return _0x1711a3(_0x5ded88[_0x5816('0x38')](0x1f4,_0x2dc162));}}return _0x1711a3(_0x5816('0x40'));});},'AcceptMessage':function(_0x5ecaa2){var _0x574e14=this;return new Promise(function(_0x536ef6,_0x588aad){if(_0x5ecaa2['agent']&&_0x5ecaa2[_0x5816('0x41')]['id']){if(_0x2c8d5f[_0x5816('0x42')][_0x5ecaa2[_0x5816('0x41')]['id']]){_0x2c8d5f[_0x5816('0x42')][_0x5ecaa2[_0x5816('0x41')]['id']][_0x5816('0x43')]=![];_0x2c8d5f[_0x5816('0x42')][_0x5ecaa2[_0x5816('0x41')]['id']][_0x5816('0x44')]=undefined;}}if(_0x5ecaa2['message']&&_0x5ecaa2['message']['id']){try{var _0x4f6fc3=getId(_0x5ecaa2[_0x5816('0x13')],_0x5ecaa2['message']?_0x5ecaa2[_0x5816('0x14')]['id']:0x0,_0x5ecaa2['interaction']?_0x5ecaa2[_0x5816('0x15')]['id']:0x0);if(_0x2c8d5f['rules'][_0x4f6fc3]){_0x2c8d5f['rules'][_0x4f6fc3]['emit']('end');if(rpc[_0x5ecaa2['channel']+_0x5816('0x45')]){rpc[_0x5ecaa2[_0x5816('0x13')]+_0x5816('0x45')]['update'](_0x4f6fc3,{'UserId':_0x5ecaa2[_0x5816('0x14')][_0x5816('0x46')]})['catch'](function(){logger['error'](_0x5816('0x47'));});}}return _0x536ef6({'code':0xc8,'message':_0x5ecaa2});}catch(_0x5f1a6e){logger[_0x5816('0x38')](_0x5f1a6e[_0x5816('0x3f')]);return _0x588aad(_0x574e14['error'](0x1f4,_0x5f1a6e));}}logger['error'](_0x5816('0x48'));return _0x588aad(_0x574e14[_0x5816('0x38')](0x1f4,_0x5816('0x48')));});},'RejectMessage':function(_0x3f93cd){var _0x307f29=this;return new Promise(function(_0x533851,_0x19a17c){if(_0x3f93cd['agent']&&_0x3f93cd[_0x5816('0x41')]['id']){try{if(_0x2c8d5f[_0x5816('0x42')][_0x3f93cd[_0x5816('0x41')]['id']]){_0x2c8d5f[_0x5816('0x42')][_0x3f93cd['agent']['id']]['busy']=![];_0x2c8d5f[_0x5816('0x42')][_0x3f93cd['agent']['id']][_0x5816('0x44')]=undefined;}return _0x533851({'code':0xc8,'message':_0x3f93cd});}catch(_0x43ed58){logger[_0x5816('0x38')](_0x43ed58[_0x5816('0x3f')]);return _0x19a17c(_0x307f29['error'](0x1f4,_0x43ed58));}}logger[_0x5816('0x38')](_0x5816('0x48'));return _0x19a17c(_0x307f29['error'](0x1f4,_0x5816('0x48')));});},'AbandonInteraction':function(_0x586d88){var _0x3ed725=this;return new Promise(function(_0x46c8e8,_0x16b42f){if(_0x586d88['channel']&&_0x586d88['interaction']&&_0x586d88[_0x5816('0x15')]['id']){try{var _0x3c08a0=getId(_0x586d88[_0x5816('0x13')],_0x586d88[_0x5816('0x14')]?_0x586d88[_0x5816('0x14')]['id']:0x0,_0x586d88['interaction']?_0x586d88['interaction']['id']:0x0);if(_0x2c8d5f[_0x5816('0x12')][_0x3c08a0]){_0x2c8d5f[_0x5816('0x12')][_0x3c08a0][_0x5816('0x3c')]('end');}return _0x46c8e8({'code':0xc8,'message':_0x586d88});}catch(_0x2894e7){logger[_0x5816('0x38')](_0x2894e7[_0x5816('0x3f')]);return _0x16b42f(_0x3ed725[_0x5816('0x38')](0x1f4,_0x2894e7));}}logger[_0x5816('0x38')](_0x5816('0x48'));return _0x16b42f(_0x3ed725[_0x5816('0x38')](0x1f4,_0x5816('0x48')));});},'AgentCapacity':function(_0x2adf5d){var _0x169631=this;return new Promise(function(_0x61600b,_0x4ab9cd){if(_0x2c8d5f['agents'][_0x5816('0x49')](_0x2adf5d['id'])){for(var _0x5205a5 in _0x2adf5d[_0x5816('0x4a')]){if(_0x2adf5d[_0x5816('0x4a')]['hasOwnProperty'](_0x5205a5)){if(_0x2c8d5f['agents'][_0x2adf5d['id']]['hasOwnProperty'](_0x5205a5+_0x5816('0x4b'))){_0x2c8d5f[_0x5816('0x42')][_0x2adf5d['id']][_0x5205a5+_0x5816('0x4b')]=parseInt(_0x2adf5d[_0x5816('0x4a')][_0x5205a5],0xa);}}}_0x2c8d5f[_0x5816('0x42')][_0x2adf5d['id']]['updateRealtime']();return _0x61600b({'code':0xc8,'message':_0x2c8d5f[_0x5816('0x42')][_0x2adf5d['id']]});}else{return _0x4ab9cd(_0x169631[_0x5816('0x38')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x3f9561){return new Promise(function(_0x4e6064){var _0x5a4975=_[_0x5816('0x4c')](_0x2c8d5f[_0x5816('0x42')]);if(_0x3f9561&&_0x3f9561['id']){var _0x5d98e7=_['find'](_0x5a4975,function(_0x106920){return _0x106920['id']===_0x3f9561['id'];});_0x4e6064(_0x5d98e7);}else{_0x4e6064({'count':_0x5a4975[_0x5816('0x19')],'rows':_0x5a4975});}});},'ChatQueues':function(){return new Promise(function(_0x38b5e5){var _0x55ba55=[];for(var _0x36faf7 in _0x2c8d5f[_0x5816('0x4d')]){if(_0x2c8d5f[_0x5816('0x4d')][_0x5816('0x49')](_0x36faf7)){var _0xbf4fc3=_0x2c8d5f['chatQueues'][_0x36faf7];var _0x50ae5f={'id':_0xbf4fc3['id'],'available':_0xbf4fc3[_0x5816('0x4e')],'loggedIn':_0xbf4fc3['loggedIn'],'name':_0xbf4fc3[_0x5816('0x4f')],'paused':_0xbf4fc3[_0x5816('0x50')],'waiting':_0xbf4fc3[_0x5816('0x51')]};_0x55ba55['push'](_0x50ae5f);}}_0x38b5e5({'count':_0x55ba55[_0x5816('0x19')],'rows':_0x55ba55});});},'MailQueues':function(){return new Promise(function(_0x59814b){var _0x4b6e17=[];for(var _0x143c4b in _0x2c8d5f[_0x5816('0x52')]){if(_0x2c8d5f[_0x5816('0x52')]['hasOwnProperty'](_0x143c4b)){var _0x35e21e=_0x2c8d5f['mailQueues'][_0x143c4b];var _0x2a9a6d={'id':_0x35e21e['id'],'available':_0x35e21e[_0x5816('0x4e')],'loggedIn':_0x35e21e['loggedIn'],'name':_0x35e21e[_0x5816('0x4f')],'paused':_0x35e21e[_0x5816('0x50')],'waiting':_0x35e21e[_0x5816('0x51')]};_0x4b6e17[_0x5816('0x20')](_0x2a9a6d);}}_0x59814b({'count':_0x4b6e17[_0x5816('0x19')],'rows':_0x4b6e17});});},'OpenchannelQueues':function(){return new Promise(function(_0x3f5de4){var _0x2f25e5=[];for(var _0xd774ce in _0x2c8d5f['openchannelQueues']){if(_0x2c8d5f['openchannelQueues'][_0x5816('0x49')](_0xd774ce)){var _0x57f739=_0x2c8d5f[_0x5816('0x53')][_0xd774ce];var _0x29b730={'id':_0x57f739['id'],'available':_0x57f739[_0x5816('0x4e')],'loggedIn':_0x57f739['loggedIn'],'name':_0x57f739[_0x5816('0x4f')],'paused':_0x57f739[_0x5816('0x50')],'waiting':_0x57f739[_0x5816('0x51')]};_0x2f25e5['push'](_0x29b730);}}_0x3f5de4({'count':_0x2f25e5[_0x5816('0x19')],'rows':_0x2f25e5});});},'SmsQueues':function(){return new Promise(function(_0x45bf3a){var _0x354c4f=[];for(var _0x29a3af in _0x2c8d5f[_0x5816('0x54')]){if(_0x2c8d5f[_0x5816('0x54')][_0x5816('0x49')](_0x29a3af)){var _0x4b3247=_0x2c8d5f['smsQueues'][_0x29a3af];var _0x3f052a={'id':_0x4b3247['id'],'available':_0x4b3247[_0x5816('0x4e')],'loggedIn':_0x4b3247[_0x5816('0x55')],'name':_0x4b3247[_0x5816('0x4f')],'paused':_0x4b3247['paused'],'waiting':_0x4b3247[_0x5816('0x51')]};_0x354c4f[_0x5816('0x20')](_0x3f052a);}}_0x45bf3a({'count':_0x354c4f[_0x5816('0x19')],'rows':_0x354c4f});});},'FaxQueues':function(){return new Promise(function(_0x17ef9d){var _0x554b3e=[];for(var _0x250066 in _0x2c8d5f[_0x5816('0x56')]){if(_0x2c8d5f[_0x5816('0x56')][_0x5816('0x49')](_0x250066)){var _0x576db0=_0x2c8d5f[_0x5816('0x56')][_0x250066];var _0x334a17={'id':_0x576db0['id'],'available':_0x576db0[_0x5816('0x4e')],'loggedIn':_0x576db0[_0x5816('0x55')],'name':_0x576db0[_0x5816('0x4f')],'paused':_0x576db0[_0x5816('0x50')],'waiting':_0x576db0['waiting']};_0x554b3e['push'](_0x334a17);}}_0x17ef9d({'count':_0x554b3e['length'],'rows':_0x554b3e});});},'WhatsappQueues':function(){return new Promise(function(_0xb07371){var _0x2ee104=[];for(var _0x90b134 in _0x2c8d5f[_0x5816('0x57')]){if(_0x2c8d5f[_0x5816('0x57')][_0x5816('0x49')](_0x90b134)){var _0x12e68e=_0x2c8d5f[_0x5816('0x57')][_0x90b134];var _0x9baf4a={'id':_0x12e68e['id'],'available':_0x12e68e[_0x5816('0x4e')],'loggedIn':_0x12e68e[_0x5816('0x55')],'name':_0x12e68e[_0x5816('0x4f')],'paused':_0x12e68e[_0x5816('0x50')],'waiting':_0x12e68e[_0x5816('0x51')]};_0x2ee104['push'](_0x9baf4a);}}_0xb07371({'count':_0x2ee104[_0x5816('0x19')],'rows':_0x2ee104});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x28b813){var _0x109326=_[_0x5816('0x4c')](_0x2c8d5f[_0x5816('0x58')]);_0x28b813({'count':_0x109326[_0x5816('0x19')],'rows':_0x109326});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x194bed){var _0x110d36=_[_0x5816('0x4c')](_0x2c8d5f['mailQueuesWaitingInteractions']);_0x194bed({'count':_0x110d36['length'],'rows':_0x110d36});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1f285d){var _0xebf964=_[_0x5816('0x4c')](_0x2c8d5f[_0x5816('0x59')]);_0x1f285d({'count':_0xebf964[_0x5816('0x19')],'rows':_0xebf964});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2a6580){var _0x5a8df9=_['values'](_0x2c8d5f[_0x5816('0x5a')]);_0x2a6580({'count':_0x5a8df9[_0x5816('0x19')],'rows':_0x5a8df9});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4855ca){var _0x2abcb8=_[_0x5816('0x4c')](_0x2c8d5f[_0x5816('0x5b')]);_0x4855ca({'count':_0x2abcb8[_0x5816('0x19')],'rows':_0x2abcb8});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0xd576a8){var _0x36b272=_[_0x5816('0x4c')](_0x2c8d5f[_0x5816('0x5c')]);_0xd576a8({'count':_0x36b272['length'],'rows':_0x36b272});});}};var _0x2cca7b=jayson['server'](_0x4da805)[_0x5816('0x5d')]();_0x2cca7b['on']('error',function(_0xeec3f7){logger['error'](JSON['stringify'](_0xeec3f7));return _0x141985(_0xeec3f7);});_0x2cca7b['listen'](0x232c,_0x5816('0x5e'),function(){console[_0x5816('0x5f')](_0x5816('0x60'),0x232c);return _0x14f111(_0x5816('0x61')+0x232c);});});}; \ No newline at end of file +var _0xc953=['QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','agent\x20not\x20found','values','find','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','transfer','applications','length','.js','toLowerCase','appdata','split','mail','push','slice','join','dialogflow','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','app','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','stack','agent','agents','busy','busyQueue','end'];(function(_0x54f9be,_0x57b6d5){var _0x4e3a78=function(_0x597009){while(--_0x597009){_0x54f9be['push'](_0x54f9be['shift']());}};_0x4e3a78(++_0x57b6d5);}(_0xc953,0x84));var _0x3c95=function(_0x6d6a66,_0x2924af){_0x6d6a66=_0x6d6a66-0x0;var _0x11eb6e=_0xc953[_0x6d6a66];return _0x11eb6e;};'use strict';var _=require(_0x3c95('0x0'));var util=require(_0x3c95('0x1'));var path=require(_0x3c95('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var utils=require(_0x3c95('0x3'));var sUtils=require(_0x3c95('0x4'));var logger=require(_0x3c95('0x5'))(_0x3c95('0x6'));var rpc={'openchannelQueueReport':require(_0x3c95('0x7')),'mailQueueReport':require(_0x3c95('0x8')),'chatQueueReport':require(_0x3c95('0x9')),'smsQueueReport':require(_0x3c95('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x3c95('0xb'));function getId(_0x300783,_0x476ee8,_0x17d4ab){return util[_0x3c95('0xc')](_0x3c95('0xd'),_0x300783,_0x476ee8||0x0,_0x17d4ab||0x0);}function getIntervals(_0x51d5c2,_0x58b6ee){var _0x161cc6=[];if(!_[_0x3c95('0xe')](_0x58b6ee[_0x3c95('0xf')])&&!_[_0x3c95('0xe')](_0x51d5c2[_0x58b6ee[_0x3c95('0xf')]])&&!_[_0x3c95('0xe')](_0x51d5c2[_0x58b6ee[_0x3c95('0xf')]]['Intervals'])){_0x161cc6=_[_0x3c95('0x10')](_0x51d5c2[_0x58b6ee['IntervalId']][_0x3c95('0x11')],_0x3c95('0x12'));}else if(!_[_0x3c95('0xe')](_0x58b6ee[_0x3c95('0x12')])){_0x161cc6=[_0x58b6ee['interval']];}return _0x161cc6;}exports[_0x3c95('0x13')]=function(_0x1a80c6){_0x1a80c6[_0x3c95('0x14')]={};return new BPromise(function(_0x2d5937,_0x36bb37){var _0x5a982e={'Start':function(_0x204d4d){var _0x1cbe31=this;return new Promise(function(_0xf59068,_0x1ff558){if(_0x204d4d){try{var _0x5e7f30=[];var _0x33be41=getId(_0x204d4d[_0x3c95('0x15')],_0x204d4d[_0x3c95('0x16')]?_0x204d4d[_0x3c95('0x16')]['id']:0x0,_0x204d4d['interaction']?_0x204d4d[_0x3c95('0x17')]['id']:0x0);var _0x1af909=sUtils[_0x3c95('0x18')](_0x1a80c6,_0x204d4d);if(_0x204d4d[_0x3c95('0x19')]||!_0x1af909&&_0x204d4d[_0x3c95('0x1a')]&&_['isArray'](_0x204d4d['applications'])&&_0x204d4d['applications'][_0x3c95('0x1b')]){for(var _0xd8e550=0x0;_0xd8e550<_0x204d4d[_0x3c95('0x1a')][_0x3c95('0x1b')];_0xd8e550+=0x1){var _0x316c55=_0x204d4d[_0x3c95('0x1a')][_0xd8e550];if(fs['existsSync'](path['join'](__dirname,'applications',_0x316c55['app']+_0x3c95('0x1c')))){var _0x2d74fd=[];switch(_0x316c55['app'][_0x3c95('0x1d')]()){case'autoreply':var _0x4516e1=_0x316c55[_0x3c95('0x1e')][_0x3c95('0x1f')](',');if(_0x204d4d[_0x3c95('0x15')]===_0x3c95('0x20')){_0x2d74fd[_0x3c95('0x21')](_0x4516e1[0x0]);_0x2d74fd[_0x3c95('0x21')](_0x4516e1[0x1]);_0x2d74fd['push'](_0x4516e1[_0x3c95('0x22')](0x2,_0x4516e1['length'])[_0x3c95('0x23')](','));}else{_0x2d74fd['push'](_0x4516e1[0x0]);_0x2d74fd[_0x3c95('0x21')](_0x4516e1[_0x3c95('0x22')](0x1,_0x4516e1[_0x3c95('0x1b')])[_0x3c95('0x23')](','));}break;case _0x3c95('0x24'):var _0x96216f=_0x316c55[_0x3c95('0x1e')]['split'](',');_0x2d74fd[_0x3c95('0x21')](_0x96216f[0x0]);_0x2d74fd['push'](_0x96216f[0x1]);_0x2d74fd[_0x3c95('0x21')](_0x96216f['slice'](0x2,_0x96216f[_0x3c95('0x1b')])[_0x3c95('0x23')](','));break;case'dialogflowv2':var _0x3098f1=_0x316c55[_0x3c95('0x1e')][_0x3c95('0x1f')](',');_0x2d74fd[_0x3c95('0x21')](_0x3098f1[0x0]);_0x2d74fd[_0x3c95('0x21')](_0x3098f1[0x1]);_0x2d74fd[_0x3c95('0x21')](_0x3098f1[0x2]);_0x2d74fd[_0x3c95('0x21')](_0x3098f1[0x3]);_0x2d74fd[_0x3c95('0x21')](_0x3098f1[_0x3c95('0x22')](0x4,_0x3098f1[_0x3c95('0x1b')])[_0x3c95('0x23')](','));break;case'amazonlex':var _0x582538=_0x316c55['appdata'][_0x3c95('0x1f')](',');_0x2d74fd[_0x3c95('0x21')](_0x582538[0x0]);_0x2d74fd[_0x3c95('0x21')](_0x582538[0x1]);_0x2d74fd[_0x3c95('0x21')](_0x582538[0x2]);_0x2d74fd[_0x3c95('0x21')](_0x582538[0x3]);_0x2d74fd['push'](_0x582538[_0x3c95('0x22')](0x4,_0x582538[_0x3c95('0x1b')])[_0x3c95('0x23')](','));break;case _0x3c95('0x16'):_0x2d74fd[_0x3c95('0x21')](_0x316c55[_0x3c95('0x1e')]);break;case'tag':_0x2d74fd['push'](_0x316c55[_0x3c95('0x25')]);_0x2d74fd[_0x3c95('0x21')](_0x316c55['appdata']);break;case _0x3c95('0x26'):var _0x4785a0=utils[_0x3c95('0x27')](_0x204d4d[_0x3c95('0x28')][_0x3c95('0x29')],_0x204d4d);var _0x293d0a=_0x316c55[_0x3c95('0x1e')]['split'](',');_0x2d74fd['push'](_0x293d0a[0x0]);_0x2d74fd[_0x3c95('0x21')](_0x293d0a[0x1]);_0x2d74fd[_0x3c95('0x21')](_0x293d0a[0x2]);_0x2d74fd[_0x3c95('0x21')](_0x293d0a[0x3]);_0x2d74fd[_0x3c95('0x21')](_0x293d0a[0x4]);_0x2d74fd['push'](_0x293d0a[0x5]);_0x2d74fd[_0x3c95('0x21')](_0x293d0a[0x6]);_0x2d74fd[_0x3c95('0x21')](_0x293d0a[0x7]);_0x2d74fd[_0x3c95('0x21')](_0x293d0a[0x8]);_0x2d74fd['push'](_0x293d0a[0x9]);_0x2d74fd[_0x3c95('0x21')](_0x293d0a[0xa]);_0x2d74fd[_0x3c95('0x21')](_0x204d4d['interaction']['id']);_0x2d74fd[_0x3c95('0x21')](_0x204d4d[_0x3c95('0x16')]['id']);_0x2d74fd[_0x3c95('0x21')](_0x316c55[_0x3c95('0x2a')]);_0x2d74fd[_0x3c95('0x21')](_0x204d4d[_0x3c95('0x17')][_0x3c95('0x2b')]);_0x2d74fd[_0x3c95('0x21')](_0x204d4d[_0x3c95('0x2c')]['body']);_0x2d74fd[_0x3c95('0x21')](_0x4785a0);break;default:_0x2d74fd=_[_0x3c95('0xe')](_0x316c55[_0x3c95('0x1e')])?[]:_0x316c55[_0x3c95('0x1e')]['split'](',');}var _0x20efa0={'id':util[_0x3c95('0xc')]('%s:%s:%s',_0x33be41,_0x316c55['id'],_0x316c55[_0x3c95('0x2d')]),'condition':require(_0x3c95('0x2e'))[_0x3c95('0x2f')](_0x33be41,getIntervals(_0x1a80c6[_0x3c95('0x30')],_0x316c55),_0x1a80c6),'consequence':require(_0x3c95('0x31')+_0x316c55[_0x3c95('0x2d')])[_0x3c95('0x32')](_0x33be41,_0x2d74fd,_0x1a80c6,_0x204d4d),'p':_0x316c55[_0x3c95('0x33')]||0x0};logger[_0x3c95('0x34')](_0x3c95('0x35'),_0x20efa0['id'],_0x3c95('0x36'),getIntervals(_0x1a80c6['intervals'],_0x316c55)[_0x3c95('0x23')]('\x20|\x20'));_0x5e7f30[_0x3c95('0x21')](_0x20efa0);}else{logger[_0x3c95('0x37')](_0x3c95('0x38'),path['join'](__dirname,_0x3c95('0x1a'),_0x316c55[_0x3c95('0x2d')]+'.js'));}}_0x1a80c6[_0x3c95('0x14')][_0x33be41]=new RuleEngine(_0x5e7f30);_0x1a80c6[_0x3c95('0x14')][_0x33be41][_0x3c95('0x39')](_0x204d4d,function(_0x548e96){logger[_0x3c95('0x34')](_0x3c95('0x3a'),JSON[_0x3c95('0x3b')](_0x548e96[_0x3c95('0x3c')]));if(_0x1a80c6[_0x3c95('0x14')][_0x33be41]){_0x1a80c6[_0x3c95('0x14')][_0x33be41][_0x3c95('0x3d')](_0x3c95('0x3e'));}});return _0xf59068({'code':0xc8,'message':_0x204d4d});}else{if(_0x1af909){logger['info'](util[_0x3c95('0xc')](_0x3c95('0x3f'),_0x33be41));}else{logger[_0x3c95('0x34')]('No\x20applications\x20to\x20execute');}return _0xf59068({'code':0xc8,'message':_0x204d4d});}}catch(_0x4717da){logger[_0x3c95('0x37')](_0x4717da[_0x3c95('0x40')]);return _0x1ff558(_0x1cbe31[_0x3c95('0x37')](0x1f4,_0x4717da));}}return _0x1ff558('routing\x20is\x20empty');});},'AcceptMessage':function(_0x39be5c){var _0x425fc5=this;return new Promise(function(_0x1d4546,_0x49d3a2){if(_0x39be5c[_0x3c95('0x41')]&&_0x39be5c[_0x3c95('0x41')]['id']){if(_0x1a80c6[_0x3c95('0x42')][_0x39be5c[_0x3c95('0x41')]['id']]){_0x1a80c6[_0x3c95('0x42')][_0x39be5c[_0x3c95('0x41')]['id']][_0x3c95('0x43')]=![];_0x1a80c6['agents'][_0x39be5c['agent']['id']][_0x3c95('0x44')]=undefined;}}if(_0x39be5c[_0x3c95('0x16')]&&_0x39be5c['message']['id']){try{var _0x4be3a8=getId(_0x39be5c['channel'],_0x39be5c[_0x3c95('0x16')]?_0x39be5c[_0x3c95('0x16')]['id']:0x0,_0x39be5c[_0x3c95('0x17')]?_0x39be5c[_0x3c95('0x17')]['id']:0x0);if(_0x1a80c6['rules'][_0x4be3a8]){_0x1a80c6['rules'][_0x4be3a8][_0x3c95('0x3d')](_0x3c95('0x45'));if(rpc[_0x39be5c['channel']+_0x3c95('0x46')]){rpc[_0x39be5c['channel']+_0x3c95('0x46')][_0x3c95('0x47')](_0x4be3a8,{'UserId':_0x39be5c[_0x3c95('0x16')][_0x3c95('0x48')]})[_0x3c95('0x49')](function(){logger[_0x3c95('0x37')](_0x3c95('0x4a'));});}}return _0x1d4546({'code':0xc8,'message':_0x39be5c});}catch(_0x5dea20){logger[_0x3c95('0x37')](_0x5dea20['stack']);return _0x49d3a2(_0x425fc5[_0x3c95('0x37')](0x1f4,_0x5dea20));}}logger[_0x3c95('0x37')](_0x3c95('0x4b'));return _0x49d3a2(_0x425fc5['error'](0x1f4,_0x3c95('0x4b')));});},'RejectMessage':function(_0x3c1b80){var _0x26d8dc=this;return new Promise(function(_0x3e044b,_0x30062e){if(_0x3c1b80[_0x3c95('0x41')]&&_0x3c1b80[_0x3c95('0x41')]['id']){try{if(_0x1a80c6[_0x3c95('0x42')][_0x3c1b80[_0x3c95('0x41')]['id']]){_0x1a80c6[_0x3c95('0x42')][_0x3c1b80[_0x3c95('0x41')]['id']]['busy']=![];_0x1a80c6[_0x3c95('0x42')][_0x3c1b80[_0x3c95('0x41')]['id']][_0x3c95('0x44')]=undefined;}return _0x3e044b({'code':0xc8,'message':_0x3c1b80});}catch(_0x2c512e){logger['error'](_0x2c512e[_0x3c95('0x40')]);return _0x30062e(_0x26d8dc[_0x3c95('0x37')](0x1f4,_0x2c512e));}}logger[_0x3c95('0x37')](_0x3c95('0x4b'));return _0x30062e(_0x26d8dc[_0x3c95('0x37')](0x1f4,_0x3c95('0x4b')));});},'AbandonInteraction':function(_0x53c90f){var _0x58b600=this;return new Promise(function(_0x4bfbfd,_0x55acdf){if(_0x53c90f[_0x3c95('0x15')]&&_0x53c90f['interaction']&&_0x53c90f[_0x3c95('0x17')]['id']){try{var _0x374a06=getId(_0x53c90f[_0x3c95('0x15')],_0x53c90f[_0x3c95('0x16')]?_0x53c90f['message']['id']:0x0,_0x53c90f[_0x3c95('0x17')]?_0x53c90f['interaction']['id']:0x0);if(_0x1a80c6[_0x3c95('0x14')][_0x374a06]){_0x1a80c6['rules'][_0x374a06]['emit']('end');}return _0x4bfbfd({'code':0xc8,'message':_0x53c90f});}catch(_0x2370cd){logger[_0x3c95('0x37')](_0x2370cd[_0x3c95('0x40')]);return _0x55acdf(_0x58b600['error'](0x1f4,_0x2370cd));}}logger[_0x3c95('0x37')](_0x3c95('0x4b'));return _0x55acdf(_0x58b600[_0x3c95('0x37')](0x1f4,_0x3c95('0x4b')));});},'AgentCapacity':function(_0x5f49e0){var _0x34241a=this;return new Promise(function(_0x36840f,_0x1e525e){if(_0x1a80c6[_0x3c95('0x42')]['hasOwnProperty'](_0x5f49e0['id'])){for(var _0xbde9ec in _0x5f49e0[_0x3c95('0x4c')]){if(_0x5f49e0[_0x3c95('0x4c')]['hasOwnProperty'](_0xbde9ec)){if(_0x1a80c6[_0x3c95('0x42')][_0x5f49e0['id']][_0x3c95('0x4d')](_0xbde9ec+_0x3c95('0x4e'))){_0x1a80c6['agents'][_0x5f49e0['id']][_0xbde9ec+_0x3c95('0x4e')]=parseInt(_0x5f49e0['capacity'][_0xbde9ec],0xa);}}}_0x1a80c6[_0x3c95('0x42')][_0x5f49e0['id']]['updateRealtime']();return _0x36840f({'code':0xc8,'message':_0x1a80c6[_0x3c95('0x42')][_0x5f49e0['id']]});}else{return _0x1e525e(_0x34241a['error'](0x1f4,_0x3c95('0x4f')));}});},'Agents':function(_0x2831d0){return new Promise(function(_0x290e3){var _0x2b9a15=_[_0x3c95('0x50')](_0x1a80c6['agents']);if(_0x2831d0&&_0x2831d0['id']){var _0x865137=_[_0x3c95('0x51')](_0x2b9a15,function(_0x1145a7){return _0x1145a7['id']===_0x2831d0['id'];});_0x290e3(_0x865137);}else{_0x290e3({'count':_0x2b9a15[_0x3c95('0x1b')],'rows':_0x2b9a15});}});},'ChatQueues':function(){return new Promise(function(_0x127557){var _0x42757c=[];for(var _0x3395ea in _0x1a80c6[_0x3c95('0x52')]){if(_0x1a80c6['chatQueues'][_0x3c95('0x4d')](_0x3395ea)){var _0x5463d7=_0x1a80c6[_0x3c95('0x52')][_0x3395ea];var _0x1403c0={'id':_0x5463d7['id'],'available':_0x5463d7['available'],'loggedIn':_0x5463d7[_0x3c95('0x53')],'name':_0x5463d7[_0x3c95('0x54')],'paused':_0x5463d7[_0x3c95('0x55')],'waiting':_0x5463d7[_0x3c95('0x56')]};_0x42757c['push'](_0x1403c0);}}_0x127557({'count':_0x42757c[_0x3c95('0x1b')],'rows':_0x42757c});});},'MailQueues':function(){return new Promise(function(_0xad9dd1){var _0x53fe52=[];for(var _0x39e4bc in _0x1a80c6['mailQueues']){if(_0x1a80c6[_0x3c95('0x57')][_0x3c95('0x4d')](_0x39e4bc)){var _0x340b00=_0x1a80c6[_0x3c95('0x57')][_0x39e4bc];var _0x744731={'id':_0x340b00['id'],'available':_0x340b00[_0x3c95('0x58')],'loggedIn':_0x340b00[_0x3c95('0x53')],'name':_0x340b00['name'],'paused':_0x340b00[_0x3c95('0x55')],'waiting':_0x340b00['waiting']};_0x53fe52['push'](_0x744731);}}_0xad9dd1({'count':_0x53fe52[_0x3c95('0x1b')],'rows':_0x53fe52});});},'OpenchannelQueues':function(){return new Promise(function(_0xf8ad0a){var _0x4b113d=[];for(var _0x1e533a in _0x1a80c6[_0x3c95('0x59')]){if(_0x1a80c6['openchannelQueues']['hasOwnProperty'](_0x1e533a)){var _0x41ea79=_0x1a80c6[_0x3c95('0x59')][_0x1e533a];var _0x23b97b={'id':_0x41ea79['id'],'available':_0x41ea79[_0x3c95('0x58')],'loggedIn':_0x41ea79[_0x3c95('0x53')],'name':_0x41ea79[_0x3c95('0x54')],'paused':_0x41ea79[_0x3c95('0x55')],'waiting':_0x41ea79[_0x3c95('0x56')]};_0x4b113d[_0x3c95('0x21')](_0x23b97b);}}_0xf8ad0a({'count':_0x4b113d[_0x3c95('0x1b')],'rows':_0x4b113d});});},'SmsQueues':function(){return new Promise(function(_0x41ab2e){var _0x137600=[];for(var _0x176347 in _0x1a80c6[_0x3c95('0x5a')]){if(_0x1a80c6['smsQueues'][_0x3c95('0x4d')](_0x176347)){var _0x263802=_0x1a80c6[_0x3c95('0x5a')][_0x176347];var _0x433d46={'id':_0x263802['id'],'available':_0x263802[_0x3c95('0x58')],'loggedIn':_0x263802[_0x3c95('0x53')],'name':_0x263802[_0x3c95('0x54')],'paused':_0x263802[_0x3c95('0x55')],'waiting':_0x263802['waiting']};_0x137600[_0x3c95('0x21')](_0x433d46);}}_0x41ab2e({'count':_0x137600[_0x3c95('0x1b')],'rows':_0x137600});});},'FaxQueues':function(){return new Promise(function(_0x2ac893){var _0x3a6f9e=[];for(var _0x4384b1 in _0x1a80c6[_0x3c95('0x5b')]){if(_0x1a80c6[_0x3c95('0x5b')][_0x3c95('0x4d')](_0x4384b1)){var _0x47be8b=_0x1a80c6[_0x3c95('0x5b')][_0x4384b1];var _0x28e21e={'id':_0x47be8b['id'],'available':_0x47be8b[_0x3c95('0x58')],'loggedIn':_0x47be8b['loggedIn'],'name':_0x47be8b[_0x3c95('0x54')],'paused':_0x47be8b[_0x3c95('0x55')],'waiting':_0x47be8b[_0x3c95('0x56')]};_0x3a6f9e[_0x3c95('0x21')](_0x28e21e);}}_0x2ac893({'count':_0x3a6f9e[_0x3c95('0x1b')],'rows':_0x3a6f9e});});},'WhatsappQueues':function(){return new Promise(function(_0x48e11e){var _0x2f81a0=[];for(var _0x5e4662 in _0x1a80c6['whatsappQueues']){if(_0x1a80c6[_0x3c95('0x5c')][_0x3c95('0x4d')](_0x5e4662)){var _0x5ae34b=_0x1a80c6[_0x3c95('0x5c')][_0x5e4662];var _0x31e5d2={'id':_0x5ae34b['id'],'available':_0x5ae34b['available'],'loggedIn':_0x5ae34b[_0x3c95('0x53')],'name':_0x5ae34b[_0x3c95('0x54')],'paused':_0x5ae34b[_0x3c95('0x55')],'waiting':_0x5ae34b['waiting']};_0x2f81a0[_0x3c95('0x21')](_0x31e5d2);}}_0x48e11e({'count':_0x2f81a0[_0x3c95('0x1b')],'rows':_0x2f81a0});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x5debbc){var _0x34d116=_[_0x3c95('0x50')](_0x1a80c6['chatQueuesWaitingInteractions']);_0x5debbc({'count':_0x34d116[_0x3c95('0x1b')],'rows':_0x34d116});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x352682){var _0x4d856b=_[_0x3c95('0x50')](_0x1a80c6[_0x3c95('0x5d')]);_0x352682({'count':_0x4d856b[_0x3c95('0x1b')],'rows':_0x4d856b});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1d40d2){var _0x3c6734=_[_0x3c95('0x50')](_0x1a80c6['openchannelQueuesWaitingInteractions']);_0x1d40d2({'count':_0x3c6734[_0x3c95('0x1b')],'rows':_0x3c6734});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3830b8){var _0x2ce737=_[_0x3c95('0x50')](_0x1a80c6[_0x3c95('0x5e')]);_0x3830b8({'count':_0x2ce737['length'],'rows':_0x2ce737});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3c54af){var _0x21c180=_[_0x3c95('0x50')](_0x1a80c6[_0x3c95('0x5f')]);_0x3c54af({'count':_0x21c180[_0x3c95('0x1b')],'rows':_0x21c180});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x10c02f){var _0x2d15df=_['values'](_0x1a80c6['whatsappQueuesWaitingInteractions']);_0x10c02f({'count':_0x2d15df[_0x3c95('0x1b')],'rows':_0x2d15df});});}};var _0x55f20e=jayson[_0x3c95('0x60')](_0x5a982e)[_0x3c95('0x61')]();_0x55f20e['on'](_0x3c95('0x37'),function(_0x13e602){logger[_0x3c95('0x37')](JSON[_0x3c95('0x3b')](_0x13e602));return _0x36bb37(_0x13e602);});_0x55f20e[_0x3c95('0x13')](0x232c,_0x3c95('0x62'),function(){console[_0x3c95('0x63')](_0x3c95('0x64'),0x232c);return _0x2d5937('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 8a966cc..2bf8c3f 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 _0x0ca6=['http','request','then','error','message','result','catch','condition','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','indexOf','true','all','some','join','when','\x20|\x20','stack','util','bluebird','lodash','../../../config/logger','routing'];(function(_0x2ee3db,_0x65e46c){var _0x34f304=function(_0x2442f7){while(--_0x2442f7){_0x2ee3db['push'](_0x2ee3db['shift']());}};_0x34f304(++_0x65e46c);}(_0x0ca6,0x82));var _0x60ca=function(_0x45509f,_0x4a2f97){_0x45509f=_0x45509f-0x0;var _0x27cbfe=_0x0ca6[_0x45509f];return _0x27cbfe;};'use strict';var util=require(_0x60ca('0x0'));var BPromise=require(_0x60ca('0x1'));var jayson=require('jayson/promise');var _=require(_0x60ca('0x2'));var logger=require(_0x60ca('0x3'))(_0x60ca('0x4'));var client=jayson['client'][_0x60ca('0x5')]({'port':0x232a});function request(_0x40a91e,_0x3515c7){return new BPromise(function(_0x54f465,_0x237030){return client[_0x60ca('0x6')](_0x40a91e,_0x3515c7)[_0x60ca('0x7')](function(_0x5c8c57){if(_0x5c8c57['error']){return _0x237030(_0x5c8c57[_0x60ca('0x8')][_0x60ca('0x9')]);}else{return _0x54f465(_0x5c8c57[_0x60ca('0xa')]);}})[_0x60ca('0xb')](function(_0x1a5807){return _0x237030(_0x1a5807);});});}exports[_0x60ca('0xc')]=function(_0x43d741,_0x29d5f5,_0x3b65df){return function(_0x8fc3a4){if(_0x3b65df['rules']&&!_0x3b65df['rules'][_0x43d741]){logger[_0x60ca('0xd')](_0x60ca('0xe'),_0x43d741);return _0x8fc3a4[_0x60ca('0xf')]();}var _0x59f0d3=[];for(var _0x15c645=0x0;_0x15c645<_0x29d5f5[_0x60ca('0x10')];_0x15c645+=0x1){_0x59f0d3[_0x60ca('0x11')](request('Command',{'command':util[_0x60ca('0x12')]('iftime\x20%s',_0x29d5f5[_0x15c645])})[_0x60ca('0x7')](function(_0x31e372){return _0x31e372&&_0x31e372['message']&&_0x31e372['message'][_0x60ca('0x13')](_0x60ca('0x14'))>=0x0?!![]:![];})[_0x60ca('0xb')](function(){logger[_0x60ca('0x8')]('[%s][INTERVAL]\x20%s',_0x43d741,_0x29d5f5[_0x15c645]);}));}BPromise[_0x60ca('0x15')](_0x59f0d3)[_0x60ca('0x7')](function(_0xb48018){var _0x10037f=_[_0x60ca('0x16')](_0xb48018);logger[_0x60ca('0xd')]('[%s][INTERVAL]\x20%s\x20%s',_0x43d741,_0x29d5f5[_0x60ca('0x17')]('\x20|\x20'),_0x10037f);_0x8fc3a4[_0x60ca('0x18')](_0x10037f);})[_0x60ca('0xb')](function(_0x357826){logger[_0x60ca('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x43d741,_0x29d5f5['join'](_0x60ca('0x19')),_0x357826[_0x60ca('0x1a')]);_0x8fc3a4[_0x60ca('0xf')]();});};}; \ No newline at end of file +var _0x3ad3=['length','push','Command','format','iftime\x20%s','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','stack','stop','util','bluebird','lodash','routing','client','http','then','error','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3ad3,0x15b));var _0x33ad=function(_0x19861d,_0x5cd2f0){_0x19861d=_0x19861d-0x0;var _0xf697bc=_0x3ad3[_0x19861d];return _0xf697bc;};'use strict';var util=require(_0x33ad('0x0'));var BPromise=require(_0x33ad('0x1'));var jayson=require('jayson/promise');var _=require(_0x33ad('0x2'));var logger=require('../../../config/logger')(_0x33ad('0x3'));var client=jayson[_0x33ad('0x4')][_0x33ad('0x5')]({'port':0x232a});function request(_0x23545f,_0x2b6cd9){return new BPromise(function(_0x4a8906,_0x798482){return client['request'](_0x23545f,_0x2b6cd9)[_0x33ad('0x6')](function(_0xf3f809){if(_0xf3f809[_0x33ad('0x7')]){return _0x798482(_0xf3f809[_0x33ad('0x7')]['message']);}else{return _0x4a8906(_0xf3f809[_0x33ad('0x8')]);}})[_0x33ad('0x9')](function(_0x3ef400){return _0x798482(_0x3ef400);});});}exports[_0x33ad('0xa')]=function(_0x439122,_0x4a56a6,_0x550717){return function(_0x2327bb){if(_0x550717[_0x33ad('0xb')]&&!_0x550717[_0x33ad('0xb')][_0x439122]){logger['info'](_0x33ad('0xc'),_0x439122);return _0x2327bb['stop']();}var _0x201ff4=[];for(var _0x9837d8=0x0;_0x9837d8<_0x4a56a6[_0x33ad('0xd')];_0x9837d8+=0x1){_0x201ff4[_0x33ad('0xe')](request(_0x33ad('0xf'),{'command':util[_0x33ad('0x10')](_0x33ad('0x11'),_0x4a56a6[_0x9837d8])})[_0x33ad('0x6')](function(_0x21185f){return _0x21185f&&_0x21185f[_0x33ad('0x12')]&&_0x21185f[_0x33ad('0x12')][_0x33ad('0x13')](_0x33ad('0x14'))>=0x0?!![]:![];})[_0x33ad('0x9')](function(){logger[_0x33ad('0x7')](_0x33ad('0x15'),_0x439122,_0x4a56a6[_0x9837d8]);}));}BPromise[_0x33ad('0x16')](_0x201ff4)['then'](function(_0x46f52f){var _0x516eb6=_[_0x33ad('0x17')](_0x46f52f);logger[_0x33ad('0x18')](_0x33ad('0x19'),_0x439122,_0x4a56a6[_0x33ad('0x1a')](_0x33ad('0x1b')),_0x516eb6);_0x2327bb['when'](_0x516eb6);})[_0x33ad('0x9')](function(_0x4999ba){logger['error'](_0x33ad('0x19'),_0x439122,_0x4a56a6[_0x33ad('0x1a')](_0x33ad('0x1b')),_0x4999ba[_0x33ad('0x1c')]);_0x2327bb[_0x33ad('0x1d')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index eab883e..acb304c 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 _0x4483=['agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','debug','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','ringtime','talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','reason','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','transfertargetuniqueid','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw'];(function(_0xa77644,_0x16d10b){var _0x32c182=function(_0x10b589){while(--_0x10b589){_0xa77644['push'](_0xa77644['shift']());}};_0x32c182(++_0x16d10b);}(_0x4483,0x1a3));var _0x3448=function(_0x14a765,_0xa25cbc){_0x14a765=_0x14a765-0x0;var _0x26015b=_0x4483[_0x14a765];return _0x26015b;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var utils=require(_0x3448('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x481d0c,_0x202d3d){utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x5'),_0x481d0c[_0x3448('0x6')],_0x481d0c['channel'],_0x481d0c[_0x3448('0x7')],_0x481d0c[_0x3448('0x8')],_0x481d0c[_0x3448('0x9')],_0x481d0c[_0x3448('0xa')],_0x481d0c[_0x3448('0xb')],_0x481d0c[_0x3448('0xc')]));if(_0x481d0c[_0x3448('0x7')]){utils[_0x3448('0xd')](_0x481d0c['queue'])['then'](function(_0x46b1ee){if(_0x46b1ee){_0x481d0c[_0x3448('0xe')]=_0x46b1ee[_0x3448('0xe')];_0x481d0c[_0x3448('0xf')]=_0x481d0c[_0x3448('0x10')]?_0x46b1ee[_0x3448('0x11')]:![];_0x481d0c[_0x3448('0x12')]=_0x481d0c[_0x3448('0xf')]?_0x46b1ee[_0x3448('0x13')]:0x0;}utils[_0x3448('0x14')](_0x3448('0x15'),_0x481d0c);});}else{utils['request']('CreateVoiceAgentReport',_0x481d0c);}if(_0x202d3d){delete transfers[_0x481d0c[_0x3448('0x6')]];}else{delete agents[_0x481d0c[_0x3448('0x16')]];}}exports['agentcalled']=function(_0x2661e1){try{utils[_0x3448('0x17')](util[_0x3448('0x4')]('[%s][agents][agentcalled]',_0x2661e1[_0x3448('0x6')]),_0x2661e1);agents[_0x2661e1[_0x3448('0x16')]]=_0x2661e1;agents[_0x2661e1['destuniqueid']][_0x3448('0x18')]=utils[_0x3448('0x19')]();agents[_0x2661e1[_0x3448('0x16')]]['lastevent']=_0x3448('0x1a');agents[_0x2661e1[_0x3448('0x16')]][_0x3448('0xb')]=null;agents[_0x2661e1[_0x3448('0x16')]][_0x3448('0x1b')]=null;utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x1c'),_0x2661e1['uniqueid'],agents[_0x2661e1[_0x3448('0x16')]]['membername'],_0x2661e1['destuniqueid']));}catch(_0x53f8e7){utils[_0x3448('0x1d')](util[_0x3448('0x4')](_0x3448('0x1e'),_0x2661e1['uniqueid']),_0x53f8e7);}};exports[_0x3448('0x1f')]=function(_0x392c8d){try{if(!_[_0x3448('0x20')](agents[_0x392c8d[_0x3448('0x16')]])){utils[_0x3448('0x17')](util[_0x3448('0x4')]('[%s][agents][agentringnoanswer]',_0x392c8d['uniqueid']),_0x392c8d);utils['info'](util[_0x3448('0x4')](_0x3448('0x21'),_0x392c8d['uniqueid'],agents[_0x392c8d['destuniqueid']][_0x3448('0x8')],_0x392c8d[_0x3448('0x16')]));agents[_0x392c8d[_0x3448('0x16')]][_0x3448('0x1f')]=!![];agents[_0x392c8d[_0x3448('0x16')]]['agentringnoanswerAt']=utils[_0x3448('0x19')]();agents[_0x392c8d[_0x3448('0x16')]][_0x3448('0xc')]=_0x3448('0x22');agents[_0x392c8d[_0x3448('0x16')]]['reason']=_0x3448('0x22');agents[_0x392c8d[_0x3448('0x16')]]['holdtime']=_0x392c8d[_0x3448('0x23')]?parseInt(_0x392c8d[_0x3448('0x23')])/0x3e8:0x0;agents[_0x392c8d[_0x3448('0x16')]][_0x3448('0x24')]=0x0;unanswered[_0x3448('0x25')](_0x392c8d[_0x3448('0x16')]);}}catch(_0x31be64){utils[_0x3448('0x1d')](util['format'](_0x3448('0x26'),_0x392c8d[_0x3448('0x6')]),_0x31be64);}};exports[_0x3448('0x27')]=function(_0x52c09d){try{_[_0x3448('0x28')](agents,function(_0x5dfdf7,_0x486f2c){if(_0x5dfdf7['uniqueid']==_0x52c09d[_0x3448('0x6')]&&!_[_0x3448('0x29')](unanswered,_0x5dfdf7['destuniqueid'])){utils['debug'](util[_0x3448('0x4')](_0x3448('0x2a'),_0x52c09d[_0x3448('0x6')]),_0x52c09d);utils[_0x3448('0x3')](util['format'](_0x3448('0x2b'),_0x52c09d[_0x3448('0x6')],_0x5dfdf7[_0x3448('0x8')],_0x5dfdf7['destuniqueid']));_0x5dfdf7[_0x3448('0x1f')]=!![];_0x5dfdf7[_0x3448('0x2c')]=utils['now']();_0x5dfdf7['lastevent']=_0x3448('0x2d');_0x5dfdf7[_0x3448('0x2e')]=_0x3448('0x2d');_0x5dfdf7[_0x3448('0x2f')]=_0x52c09d['holdtime'];_0x5dfdf7[_0x3448('0x24')]=0x0;writeDB(_0x5dfdf7);}});}catch(_0x36291e){utils[_0x3448('0x1d')](util[_0x3448('0x4')]('[%s][agents][queuecallerabandon]',_0x52c09d[_0x3448('0x6')]),_0x36291e);}};exports[_0x3448('0x30')]=function(_0x5ea47c){try{if(agents[_0x5ea47c[_0x3448('0x16')]]){utils[_0x3448('0x17')](util[_0x3448('0x4')](_0x3448('0x31'),_0x5ea47c[_0x3448('0x6')]),_0x5ea47c);utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x32'),_0x5ea47c[_0x3448('0x6')],agents[_0x5ea47c['destuniqueid']]['membername'],_0x5ea47c[_0x3448('0x16')]));agents[_0x5ea47c['destuniqueid']][_0x3448('0x33')]=utils[_0x3448('0x19')]();agents[_0x5ea47c[_0x3448('0x16')]][_0x3448('0xb')]=_0x5ea47c['connectedlinenum'];agents[_0x5ea47c[_0x3448('0x16')]][_0x3448('0x1b')]=_0x5ea47c[_0x3448('0x1b')];agents[_0x5ea47c[_0x3448('0x16')]][_0x3448('0x2f')]=_0x5ea47c[_0x3448('0x23')];agents[_0x5ea47c[_0x3448('0x16')]][_0x3448('0xc')]=_0x3448('0x34');_['forIn'](agents,function(_0x39b22e,_0x3c92e2){if(_0x39b22e[_0x3448('0x16')]!=_0x5ea47c[_0x3448('0x16')]&&_0x39b22e[_0x3448('0x6')]==_0x5ea47c['uniqueid']){_0x39b22e[_0x3448('0x24')]=0x0;_0x39b22e[_0x3448('0x2f')]=_0x5ea47c[_0x3448('0x23')];_0x39b22e[_0x3448('0x1f')]=!![];_0x39b22e[_0x3448('0x2c')]=utils[_0x3448('0x19')]();_0x39b22e[_0x3448('0xc')]=_0x3448('0x35');_0x39b22e['reason']=_0x3448('0x35');_0x39b22e[_0x3448('0x36')]=_0x5ea47c[_0x3448('0x16')];_0x39b22e['answeredelsewheremembername']=_0x5ea47c[_0x3448('0x8')];writeDB(_0x39b22e);}});}}catch(_0x1d2a7c){utils[_0x3448('0x1d')](util[_0x3448('0x4')](_0x3448('0x31'),_0x5ea47c[_0x3448('0x6')]),_0x1d2a7c);}};exports[_0x3448('0x10')]=function(_0x4f54e7){try{if(!_[_0x3448('0x20')](agents[_0x4f54e7[_0x3448('0x16')]])){utils[_0x3448('0x17')](util[_0x3448('0x4')](_0x3448('0x37'),_0x4f54e7[_0x3448('0x6')]),_0x4f54e7);utils['info'](util[_0x3448('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x4f54e7['uniqueid'],agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0x8')],_0x4f54e7['destuniqueid']));agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0x10')]=!![];agents[_0x4f54e7['destuniqueid']][_0x3448('0x38')]=utils[_0x3448('0x19')]();agents[_0x4f54e7['destuniqueid']][_0x3448('0x24')]=utils[_0x3448('0x39')](agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0x38')],agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0x33')]);agents[_0x4f54e7[_0x3448('0x16')]]['reason']=_0x4f54e7['reason'];agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0xc')]=_0x3448('0x3a');writeDB(agents[_0x4f54e7[_0x3448('0x16')]]);}}catch(_0x527259){utils[_0x3448('0x1d')](util[_0x3448('0x4')](_0x3448('0x37'),_0x4f54e7[_0x3448('0x6')]),_0x527259);}};exports[_0x3448('0x3b')]=function(_0x5d942b){try{if(!_[_0x3448('0x20')](agents[_0x5d942b['transfereruniqueid']])){utils[_0x3448('0x17')](util[_0x3448('0x4')]('[%s][agents][blindtransfer]',_0x5d942b[_0x3448('0x6')]),_0x5d942b);utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x3c'),_0x5d942b[_0x3448('0x6')],agents[_0x5d942b[_0x3448('0x3d')]][_0x3448('0x8')],agents[_0x5d942b['transfereruniqueid']][_0x3448('0x6')]));agents[_0x5d942b[_0x3448('0x3d')]]['transfer']=!![];agents[_0x5d942b['transfereruniqueid']][_0x3448('0x3e')]=_0x3448('0x3f');agents[_0x5d942b['transfereruniqueid']]['transferexten']=_0x5d942b[_0x3448('0x40')];agents[_0x5d942b[_0x3448('0x3d')]][_0x3448('0x41')]=agents[_0x5d942b[_0x3448('0x3d')]][_0x3448('0x6')];}}catch(_0x39db50){utils[_0x3448('0x1d')](util['format']('[%s][agents][blindtransfer]',_0x5d942b['uniqueid']),_0x39db50);}};exports[_0x3448('0x42')]=function(_0x3c734a){try{utils['debug'](util[_0x3448('0x4')](_0x3448('0x43'),_0x3c734a['origtransfereruniqueid']),_0x3c734a);if(_0x3c734a[_0x3448('0x44')]==_0x3c734a[_0x3448('0x45')]){if(!_['isNil'](agents[_0x3c734a[_0x3448('0x46')]])){utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x47'),_0x3c734a[_0x3448('0x44')],agents[_0x3c734a[_0x3448('0x46')]][_0x3448('0x8')]));agents[_0x3c734a[_0x3448('0x46')]][_0x3448('0x48')]=!![];agents[_0x3c734a['secondtransfereruniqueid']][_0x3448('0x3e')]='ATTENDED';agents[_0x3c734a[_0x3448('0x46')]][_0x3448('0x49')]=_0x3c734a[_0x3448('0x4a')];agents[_0x3c734a[_0x3448('0x46')]][_0x3448('0x41')]=_0x3c734a[_0x3448('0x44')];}if(_0x3c734a['transfereeuniqueid']&&agents[_0x3c734a[_0x3448('0x4b')]]){agents[_0x3c734a['transfereeuniqueid']][_0x3448('0x4c')]=0x1;transfers[_0x3c734a[_0x3448('0x4b')]]=_[_0x3448('0x4d')](agents[_0x3c734a[_0x3448('0x4b')]]);transfers[_0x3c734a[_0x3448('0x4b')]]['calleridnum']=agents[_0x3c734a['secondtransfereruniqueid']][_0x3448('0xa')];transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x4e')]=agents[_0x3c734a['secondtransfereruniqueid']][_0x3448('0x4e')];transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x18')]=utils[_0x3448('0x19')]();transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x33')]=utils[_0x3448('0x19')]();transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x2f')]=0x0;transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x4c')]=0x2;}}else if(_0x3c734a[_0x3448('0x46')]==_0x3c734a[_0x3448('0x4f')]){if(!_[_0x3448('0x20')](agents[_0x3c734a[_0x3448('0x44')]])){utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x47'),_0x3c734a['origtransfereruniqueid'],agents[_0x3c734a[_0x3448('0x44')]]['membername']));agents[_0x3c734a[_0x3448('0x44')]]['transfer']=!![];agents[_0x3c734a[_0x3448('0x44')]][_0x3448('0x3e')]='ATTENDED';agents[_0x3c734a[_0x3448('0x44')]][_0x3448('0x49')]=_0x3c734a['secondtransfererexten'];agents[_0x3c734a['origtransfereruniqueid']][_0x3448('0x41')]=_0x3c734a['secondtransfereruniqueid'];}if(_0x3c734a['transfertargetuniqueid']&&agents[_0x3c734a[_0x3448('0x50')]]){agents[_0x3c734a[_0x3448('0x50')]]['agententerreason']=0x1;transfers[_0x3c734a['transfertargetuniqueid']]=_[_0x3448('0x4d')](agents[_0x3c734a[_0x3448('0x50')]]);transfers[_0x3c734a[_0x3448('0x50')]][_0x3448('0xa')]=agents[_0x3c734a[_0x3448('0x44')]][_0x3448('0xa')];transfers[_0x3c734a[_0x3448('0x50')]][_0x3448('0x4e')]=agents[_0x3c734a[_0x3448('0x44')]][_0x3448('0x4e')];transfers[_0x3c734a[_0x3448('0x50')]][_0x3448('0x18')]=utils[_0x3448('0x19')]();transfers[_0x3c734a[_0x3448('0x50')]]['agentconnectAt']=utils[_0x3448('0x19')]();transfers[_0x3c734a[_0x3448('0x50')]]['holdtime']=0x0;transfers[_0x3c734a[_0x3448('0x50')]][_0x3448('0x4c')]=0x2;}}}catch(_0x543959){utils[_0x3448('0x1d')](util[_0x3448('0x4')](_0x3448('0x43'),_0x3c734a['origtransfereruniqueid']),_0x543959);}};exports['hangup']=function(_0x41d459){try{utils['debug'](util[_0x3448('0x4')](_0x3448('0x51'),_0x41d459[_0x3448('0x6')]),_0x41d459);if(agents[_0x41d459['uniqueid']]&&agents[_0x41d459[_0x3448('0x6')]][_0x3448('0x2e')]===_0x3448('0x22')){if(_0x41d459['cause']==='21'){agents[_0x41d459['uniqueid']][_0x3448('0x2e')]=_0x3448('0x52');agents[_0x41d459[_0x3448('0x6')]][_0x3448('0xc')]=_0x3448('0x52');}utils[_0x3448('0x3')](util['format'](_0x3448('0x53'),_0x41d459['uniqueid'],agents[_0x41d459[_0x3448('0x6')]][_0x3448('0x8')],agents[_0x41d459['uniqueid']][_0x3448('0x2e')],agents[_0x41d459[_0x3448('0x6')]]['lastevent']));writeDB(agents[_0x41d459['uniqueid']]);var _0x188f98=unanswered[_0x3448('0x54')](_0x41d459[_0x3448('0x6')]);if(_0x188f98>-0x1){unanswered[_0x3448('0x55')](_0x188f98,0x1);}}if(transfers[_0x41d459[_0x3448('0x6')]]){transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x10')]=!![];transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x38')]=utils[_0x3448('0x19')]();transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x24')]=utils[_0x3448('0x39')](transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x38')],transfers[_0x41d459[_0x3448('0x6')]]['agentconnectAt']);transfers[_0x41d459['uniqueid']][_0x3448('0x2e')]='agent';transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0xc')]='complete';utils[_0x3448('0x3')](util['format'](_0x3448('0x53'),_0x41d459[_0x3448('0x6')],transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x8')],transfers[_0x41d459[_0x3448('0x6')]]['reason'],transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0xc')]));writeDB(transfers[_0x41d459[_0x3448('0x6')]],!![]);}if(agents[_0x41d459['uniqueid']]&&agents[_0x41d459[_0x3448('0x6')]][_0x3448('0x33')]){agents[_0x41d459[_0x3448('0x6')]]['agentcomplete']=!![];agents[_0x41d459[_0x3448('0x6')]]['agentcompleteAt']=utils['now']();agents[_0x41d459[_0x3448('0x6')]]['talktime']=utils[_0x3448('0x39')](agents[_0x41d459['uniqueid']][_0x3448('0x38')],agents[_0x41d459[_0x3448('0x6')]]['agentconnectAt']);agents[_0x41d459['uniqueid']][_0x3448('0x2e')]=agents[_0x41d459[_0x3448('0x6')]]['transfer']?_0x3448('0x48'):_0x3448('0x56');agents[_0x41d459['uniqueid']][_0x3448('0xc')]=_0x3448('0x3a');utils[_0x3448('0x3')](util[_0x3448('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x41d459[_0x3448('0x6')],agents[_0x41d459['uniqueid']][_0x3448('0x8')],agents[_0x41d459['uniqueid']][_0x3448('0x2e')],agents[_0x41d459[_0x3448('0x6')]][_0x3448('0xc')]));writeDB(agents[_0x41d459['uniqueid']]);}}catch(_0x17ebc9){utils[_0x3448('0x1d')](util['format'](_0x3448('0x51'),_0x41d459['uniqueid']),_0x17ebc9);}}; \ 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(_0x450ab5,_0x523aea){var _0x5f49df=function(_0x45aef8){while(--_0x45aef8){_0x450ab5['push'](_0x450ab5['shift']());}};_0x5f49df(++_0x523aea);}(_0x702d,0x147));var _0xd702=function(_0x4ef06c,_0x5ebe49){_0x4ef06c=_0x4ef06c-0x0;var _0x22a643=_0x702d[_0x4ef06c];return _0x22a643;};'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 1600914..dec7c05 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 _0x1484=['set','startsWith','substring','lastIndexOf','hangup','noop','execif','lastdata','lodash','util','NO\x20ANSWER','FAILED','ANSWERED','BUSY','format','uniqueid','membername','interface','calleridnum','getUserByInternal','accountcode','then','UserId','CreateVoiceCallReport','request','newchannel','debug','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','info','context','exten','now','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','answertime','toNumber','error','[%s][calls][newstate]','[%s][calls][hangup]','callerid','calleridname','endtime','diffTime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','destinationchannel','secondtransfererchannel','userfield','origtransfererchannel','_attended','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','destination','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata'];(function(_0x394da7,_0x1f4774){var _0xf51f4f=function(_0xde2ba3){while(--_0xde2ba3){_0x394da7['push'](_0x394da7['shift']());}};_0xf51f4f(++_0x1f4774);}(_0x1484,0x67));var _0x4148=function(_0x56857c,_0x4868cb){_0x56857c=_0x56857c-0x0;var _0x4027e7=_0x1484[_0x56857c];return _0x4027e7;};'use strict';var _=require(_0x4148('0x0'));var util=require(_0x4148('0x1'));var utils=require('./utils');var dispositions=[_0x4148('0x2'),'FAILED',_0x4148('0x3'),_0x4148('0x2'),_0x4148('0x2'),_0x4148('0x2'),_0x4148('0x4'),_0x4148('0x5'),_0x4148('0x3'),_0x4148('0x3'),_0x4148('0x3')];var channels={};function writeDB(_0x58fb81){utils['info'](util[_0x4148('0x6')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x58fb81[_0x4148('0x7')],_0x58fb81['channel'],_0x58fb81['queue'],_0x58fb81[_0x4148('0x8')],_0x58fb81[_0x4148('0x9')],_0x58fb81[_0x4148('0xa')],_0x58fb81['connectedlinenum'],_0x58fb81['lastevent']));if(_0x58fb81['accountcode']){utils[_0x4148('0xb')](_0x58fb81[_0x4148('0xc')])[_0x4148('0xd')](function(_0x145aab){if(_0x145aab){_0x58fb81[_0x4148('0xe')]=_0x145aab['id'];}utils['request'](_0x4148('0xf'),_0x58fb81);});}else{utils[_0x4148('0x10')](_0x4148('0xf'),_0x58fb81);}if(channels[_0x58fb81[_0x4148('0x7')]]){delete channels[_0x58fb81['uniqueid']];}}exports[_0x4148('0x11')]=function(_0x5a244b){try{utils[_0x4148('0x12')](util[_0x4148('0x6')](_0x4148('0x13'),_0x5a244b[_0x4148('0x7')]),_0x5a244b);if(_0x5a244b[_0x4148('0x7')]==_0x5a244b[_0x4148('0x14')]&&_0x5a244b[_0x4148('0x15')]!=_0x4148('0x16')){utils[_0x4148('0x17')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x5a244b[_0x4148('0x7')],_0x5a244b[_0x4148('0x18')],_0x5a244b[_0x4148('0x19')]));channels[_0x5a244b['uniqueid']]={'uniqueid':_0x5a244b[_0x4148('0x7')],'accountcode':_0x5a244b[_0x4148('0xc')],'source':_0x5a244b[_0x4148('0xa')],'destination':_0x5a244b[_0x4148('0x19')],'destinationcontext':_0x5a244b[_0x4148('0x18')],'channel':_0x5a244b[_0x4148('0x15')],'starttime':utils[_0x4148('0x1a')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x4148('0x2'),'amaflags':'DOCUMENTATION'};}}catch(_0x222fa9){utils['error'](util[_0x4148('0x6')](_0x4148('0x13'),_0x5a244b[_0x4148('0x7')]),_0x222fa9);}};exports['newstate']=function(_0x510087){try{utils[_0x4148('0x12')](util['format']('[%s][calls][newstate]',_0x510087['uniqueid']),_0x510087);if(!_[_0x4148('0x1b')](channels[_0x510087['uniqueid']])&&_0x510087[_0x4148('0x1c')]==0x6){utils[_0x4148('0x17')](util[_0x4148('0x6')](_0x4148('0x1d'),_0x510087[_0x4148('0x7')],_0x510087[_0x4148('0x18')],_0x510087[_0x4148('0x15')]));if(_['isNil'](channels[_0x510087[_0x4148('0x7')]][_0x4148('0x1e')])){channels[_0x510087[_0x4148('0x7')]][_0x4148('0x1e')]=utils['now']();}}else if(!_[_0x4148('0x1b')](channels[_0x510087[_0x4148('0x14')]])&&_0x510087['channelstate']==0x6&&_0x510087[_0x4148('0x18')]!=_0x4148('0x1f')){utils[_0x4148('0x17')](util[_0x4148('0x6')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x510087[_0x4148('0x7')],_0x510087[_0x4148('0x14')],_0x510087[_0x4148('0x18')],_0x510087[_0x4148('0x15')]));channels[_0x510087['linkedid']][_0x4148('0xc')]=_0x510087[_0x4148('0xc')];channels[_0x510087[_0x4148('0x14')]]['destinationchannel']=_0x510087[_0x4148('0x15')];if(_[_0x4148('0x1b')](channels[_0x510087[_0x4148('0x14')]][_0x4148('0x20')])){channels[_0x510087[_0x4148('0x14')]]['answertime']=utils['now']();}channels[_0x510087[_0x4148('0x14')]]['disposition']=dispositions[_[_0x4148('0x21')](_0x510087[_0x4148('0x1c')])]||'ANSWERED';}}catch(_0x403562){utils[_0x4148('0x22')](util[_0x4148('0x6')](_0x4148('0x23'),_0x510087[_0x4148('0x7')]),_0x403562);}};exports['hangup']=function(_0xb6a487){try{if(!_[_0x4148('0x1b')](channels[_0xb6a487[_0x4148('0x7')]])){utils[_0x4148('0x12')](util[_0x4148('0x6')](_0x4148('0x24'),_0xb6a487[_0x4148('0x7')]),_0xb6a487);if(_[_0x4148('0x1b')](channels[_0xb6a487[_0x4148('0x7')]][_0x4148('0x25')])){channels[_0xb6a487[_0x4148('0x7')]][_0x4148('0x25')]=_0xb6a487[_0x4148('0x26')]+'\x20<'+_0xb6a487[_0x4148('0xa')]+'>';}utils['info'](util[_0x4148('0x6')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0xb6a487[_0x4148('0x7')],channels[_0xb6a487['uniqueid']]['callerid'],_0xb6a487['cause-txt']));channels[_0xb6a487[_0x4148('0x7')]][_0x4148('0x27')]=utils['now']();channels[_0xb6a487[_0x4148('0x7')]]['duration']=utils[_0x4148('0x28')](channels[_0xb6a487[_0x4148('0x7')]][_0x4148('0x27')],channels[_0xb6a487[_0x4148('0x7')]][_0x4148('0x29')]);channels[_0xb6a487['uniqueid']][_0x4148('0x2a')]=channels[_0xb6a487[_0x4148('0x7')]][_0x4148('0x20')]?utils[_0x4148('0x28')](channels[_0xb6a487[_0x4148('0x7')]][_0x4148('0x27')],channels[_0xb6a487[_0x4148('0x7')]]['answertime']):0x0;writeDB(channels[_0xb6a487[_0x4148('0x7')]]);}}catch(_0x7ab079){utils['error'](util[_0x4148('0x6')](_0x4148('0x24'),_0xb6a487[_0x4148('0x7')]),_0x7ab079);}};exports['attendedtransfer']=function(_0x5254c3){try{if(!_['isNil'](channels[_0x5254c3[_0x4148('0x2b')]])){utils[_0x4148('0x12')](util['format'](_0x4148('0x2c'),_0x5254c3[_0x4148('0x2d')]),_0x5254c3);if(channels[_0x5254c3[_0x4148('0x2b')]][_0x4148('0x15')]==_0x5254c3[_0x4148('0x2e')]){utils[_0x4148('0x17')](util[_0x4148('0x6')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5254c3[_0x4148('0x2d')],_0x5254c3['localtwolinkedid'],_0x5254c3['secondtransfererchannel']));channels[_0x5254c3[_0x4148('0x2b')]][_0x4148('0x2f')]=_0x5254c3[_0x4148('0x30')];channels[_0x5254c3['localtwolinkedid']][_0x4148('0x31')]='_attended';}else if(channels[_0x5254c3[_0x4148('0x2b')]][_0x4148('0x15')]=_0x5254c3['transfertargetchannel']){utils[_0x4148('0x17')](util[_0x4148('0x6')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5254c3[_0x4148('0x2d')],_0x5254c3['localtwolinkedid'],_0x5254c3[_0x4148('0x32')]));channels[_0x5254c3['localtwolinkedid']][_0x4148('0x2f')]=_0x5254c3[_0x4148('0x32')];channels[_0x5254c3[_0x4148('0x2b')]]['userfield']=_0x4148('0x33');}}}catch(_0x2c503d){utils[_0x4148('0x22')](util[_0x4148('0x6')](_0x4148('0x2c'),_0x5254c3[_0x4148('0x2d')]),_0x2c503d);}};exports['musiconholdstart']=function(_0x5b15ae){try{if(!_[_0x4148('0x1b')](channels[_0x5b15ae[_0x4148('0x7')]])){utils['debug'](util[_0x4148('0x6')]('[%s][calls][musiconholdstart]',_0x5b15ae[_0x4148('0x7')]),_0x5b15ae);channels[_0x5b15ae[_0x4148('0x7')]][_0x4148('0x34')]=utils[_0x4148('0x1a')]();utils['info'](util[_0x4148('0x6')](_0x4148('0x35'),_0x5b15ae[_0x4148('0x7')],channels[_0x5b15ae['uniqueid']][_0x4148('0x34')]));}}catch(_0x4ce0af){utils[_0x4148('0x22')](util[_0x4148('0x6')](_0x4148('0x36'),_0x5b15ae[_0x4148('0x7')]),_0x4ce0af);}};exports[_0x4148('0x37')]=function(_0xb7a939){try{if(!_[_0x4148('0x1b')](channels[_0xb7a939['uniqueid']])){utils[_0x4148('0x12')](util[_0x4148('0x6')](_0x4148('0x38'),_0xb7a939[_0x4148('0x7')]),_0xb7a939);if(!_['isNil'](channels[_0xb7a939[_0x4148('0x7')]]['musiconholdstartAt'])){channels[_0xb7a939[_0x4148('0x7')]][_0x4148('0x39')]+=utils['diffTime'](utils['now'](),channels[_0xb7a939[_0x4148('0x7')]][_0x4148('0x34')]);utils[_0x4148('0x17')](util[_0x4148('0x6')](_0x4148('0x3a'),_0xb7a939[_0x4148('0x7')],channels[_0xb7a939[_0x4148('0x7')]][_0x4148('0x39')]));delete channels[_0xb7a939[_0x4148('0x7')]]['musiconholdstartAt'];}}}catch(_0x5e6599){utils[_0x4148('0x22')](util[_0x4148('0x6')](_0x4148('0x38'),_0xb7a939['uniqueid']),_0x5e6599);}};exports['varset']=function(_0xc6de5c){try{if(!_[_0x4148('0x1b')](channels[_0xc6de5c[_0x4148('0x7')]])){utils['debug'](util[_0x4148('0x6')](_0x4148('0x3b'),_0xc6de5c['uniqueid']),_0xc6de5c);if(!_[_0x4148('0x1b')](_0xc6de5c[_0x4148('0x3c')][_0x4148('0x3d')])){utils[_0x4148('0x17')](util[_0x4148('0x6')](_0x4148('0x3e'),_0xc6de5c[_0x4148('0x7')],_0xc6de5c[_0x4148('0x3f')]));channels[_0xc6de5c[_0x4148('0x7')]][_0x4148('0x40')]=_0xc6de5c['value'];}if(!_[_0x4148('0x1b')](_0xc6de5c['variable'][_0x4148('0x41')])){utils[_0x4148('0x17')](util[_0x4148('0x6')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0xc6de5c[_0x4148('0x7')],_0xc6de5c[_0x4148('0x3f')]));channels[_0xc6de5c['uniqueid']][_0x4148('0x42')]=_0xc6de5c[_0x4148('0x3f')];channels[_0xc6de5c[_0x4148('0x7')]][_0x4148('0x25')]='\x22'+_0xc6de5c[_0x4148('0x3f')]+'\x22\x20<'+_0xc6de5c['value']+'>';}if(!_[_0x4148('0x1b')](_0xc6de5c[_0x4148('0x3c')][_0x4148('0x43')])||!_[_0x4148('0x1b')](_0xc6de5c[_0x4148('0x3c')][_0x4148('0x44')])){utils['info'](util[_0x4148('0x6')](_0x4148('0x45'),_0xc6de5c['uniqueid'],!_[_0x4148('0x1b')](_0xc6de5c[_0x4148('0x3c')][_0x4148('0x43')])?'xmd-callerid-preview':'xmd-callerid',_0xc6de5c[_0x4148('0x3f')]));channels[_0xc6de5c['uniqueid']]['callerid']=_0xc6de5c[_0x4148('0x3f')];}if(!_[_0x4148('0x1b')](_0xc6de5c[_0x4148('0x3c')][_0x4148('0x46')])||!_[_0x4148('0x1b')](_0xc6de5c[_0x4148('0x3c')][_0x4148('0x47')])){utils[_0x4148('0x17')](util[_0x4148('0x6')](_0x4148('0x45'),_0xc6de5c['uniqueid'],!_[_0x4148('0x1b')](_0xc6de5c[_0x4148('0x3c')][_0x4148('0x46')])?_0x4148('0x46'):'xmcs-queue',_0xc6de5c[_0x4148('0x3f')]));channels[_0xc6de5c[_0x4148('0x7')]][_0x4148('0x48')]=_0x4148('0x49');channels[_0xc6de5c[_0x4148('0x7')]]['lastdata']=_0xc6de5c['value'];channels[_0xc6de5c[_0x4148('0x7')]][_0x4148('0x4a')]=!![];}if(!_[_0x4148('0x1b')](_0xc6de5c[_0x4148('0x3c')][_0x4148('0x4b')])){utils['info'](util['format'](_0x4148('0x4c'),_0xc6de5c[_0x4148('0x7')],_0xc6de5c['value']));channels[_0xc6de5c['uniqueid']]['ContactId']=_0xc6de5c[_0x4148('0x3f')];}if(!_[_0x4148('0x1b')](_0xc6de5c['variable']['xmd-cdrtype'])){utils[_0x4148('0x17')](util[_0x4148('0x6')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0xc6de5c[_0x4148('0x7')],_0xc6de5c[_0x4148('0x3f')]));channels[_0xc6de5c['uniqueid']][_0x4148('0x4d')]=_0xc6de5c['value'];}if(!_[_0x4148('0x1b')](_0xc6de5c[_0x4148('0x3c')][_0x4148('0x4e')])){utils[_0x4148('0x17')](util[_0x4148('0x6')](_0x4148('0x4f'),_0xc6de5c[_0x4148('0x7')],_0xc6de5c[_0x4148('0x3f')]));channels[_0xc6de5c['uniqueid']][_0x4148('0x50')]=_0xc6de5c[_0x4148('0x3f')];}if(!_[_0x4148('0x1b')](_0xc6de5c['variable'][_0x4148('0x51')])){utils[_0x4148('0x17')](util[_0x4148('0x6')](_0x4148('0x52'),_0xc6de5c[_0x4148('0x7')],_0xc6de5c[_0x4148('0x3f')]));channels[_0xc6de5c[_0x4148('0x7')]]['sipcallid']=_0xc6de5c[_0x4148('0x3f')];}}}catch(_0x9f6a5){utils[_0x4148('0x22')](util[_0x4148('0x6')](_0x4148('0x3b'),_0xc6de5c[_0x4148('0x7')]),_0x9f6a5);}};exports['newexten']=function(_0x42cd52){try{if(!_[_0x4148('0x1b')](channels[_0x42cd52[_0x4148('0x7')]])){utils[_0x4148('0x12')](util[_0x4148('0x6')](_0x4148('0x53'),_0x42cd52[_0x4148('0x7')]),_0x42cd52);utils[_0x4148('0x17')](util[_0x4148('0x6')](_0x4148('0x54'),_0x42cd52[_0x4148('0x7')],_0x42cd52[_0x4148('0x55')],_0x42cd52[_0x4148('0x56')]));if(_0x42cd52[_0x4148('0x55')]['toLowerCase']()==_0x4148('0x57')&&_[_0x4148('0x58')](_0x42cd52[_0x4148('0x56')]['toLowerCase'](),'cdr')){var _0x1bebca=_0x42cd52['appdata']['split']('=');var _0x25c0ac=_0x1bebca[0x0][_0x4148('0x59')](_0x1bebca[0x0][_0x4148('0x5a')]('(')+0x1,_0x1bebca[0x0][_0x4148('0x5a')](')'));var _0x485b82=_0x1bebca[0x1];channels[_0x42cd52[_0x4148('0x7')]][_0x25c0ac]=_0x485b82;}if(!_['includes']([_0x4148('0x5b'),_0x4148('0x5c'),_0x4148('0x5d'),'set','gotoif'],_0x42cd52[_0x4148('0x55')]['toLowerCase']())){channels[_0x42cd52['uniqueid']]['lastapplication']=_0x42cd52[_0x4148('0x55')];channels[_0x42cd52[_0x4148('0x7')]][_0x4148('0x5e')]=_0x42cd52[_0x4148('0x56')];}}}catch(_0x52aa55){utils['error'](util['format']('[%s][calls][newexten]',_0x42cd52['uniqueid']),_0x52aa55);}}; \ No newline at end of file +var _0xa969=['toLowerCase','set','startsWith','cdr','appdata','split','substring','lastIndexOf','includes','hangup','noop','gotoif','[%s][calls][newexten]','lodash','util','NO\x20ANSWER','FAILED','ANSWERED','info','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','channelstate','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','destinationchannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application'];(function(_0x576df0,_0x3cf751){var _0x2ff311=function(_0x48afa8){while(--_0x48afa8){_0x576df0['push'](_0x576df0['shift']());}};_0x2ff311(++_0x3cf751);}(_0xa969,0x7a));var _0x9a96=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa969[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x9a96('0x0'));var util=require(_0x9a96('0x1'));var utils=require('./utils');var dispositions=[_0x9a96('0x2'),_0x9a96('0x3'),'FAILED',_0x9a96('0x2'),'NO\x20ANSWER','NO\x20ANSWER',_0x9a96('0x4'),'BUSY','FAILED',_0x9a96('0x3'),_0x9a96('0x3')];var channels={};function writeDB(_0x1d1ceb){utils[_0x9a96('0x5')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1d1ceb[_0x9a96('0x6')],_0x1d1ceb[_0x9a96('0x7')],_0x1d1ceb[_0x9a96('0x8')],_0x1d1ceb[_0x9a96('0x9')],_0x1d1ceb['interface'],_0x1d1ceb[_0x9a96('0xa')],_0x1d1ceb[_0x9a96('0xb')],_0x1d1ceb['lastevent']));if(_0x1d1ceb[_0x9a96('0xc')]){utils[_0x9a96('0xd')](_0x1d1ceb[_0x9a96('0xc')])[_0x9a96('0xe')](function(_0x2e2fda){if(_0x2e2fda){_0x1d1ceb[_0x9a96('0xf')]=_0x2e2fda['id'];}utils[_0x9a96('0x10')](_0x9a96('0x11'),_0x1d1ceb);});}else{utils['request'](_0x9a96('0x11'),_0x1d1ceb);}if(channels[_0x1d1ceb['uniqueid']]){delete channels[_0x1d1ceb[_0x9a96('0x6')]];}}exports[_0x9a96('0x12')]=function(_0x156e42){try{utils[_0x9a96('0x13')](util[_0x9a96('0x14')](_0x9a96('0x15'),_0x156e42[_0x9a96('0x6')]),_0x156e42);if(_0x156e42[_0x9a96('0x6')]==_0x156e42[_0x9a96('0x16')]&&_0x156e42[_0x9a96('0x7')]!=_0x9a96('0x17')){utils['info'](util[_0x9a96('0x14')](_0x9a96('0x18'),_0x156e42[_0x9a96('0x6')],_0x156e42[_0x9a96('0x19')],_0x156e42[_0x9a96('0x1a')]));channels[_0x156e42[_0x9a96('0x6')]]={'uniqueid':_0x156e42['uniqueid'],'accountcode':_0x156e42[_0x9a96('0xc')],'source':_0x156e42[_0x9a96('0xa')],'destination':_0x156e42[_0x9a96('0x1a')],'destinationcontext':_0x156e42[_0x9a96('0x19')],'channel':_0x156e42[_0x9a96('0x7')],'starttime':utils[_0x9a96('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9a96('0x2'),'amaflags':_0x9a96('0x1c')};}}catch(_0x34895a){utils[_0x9a96('0x1d')](util[_0x9a96('0x14')](_0x9a96('0x15'),_0x156e42[_0x9a96('0x6')]),_0x34895a);}};exports[_0x9a96('0x1e')]=function(_0x25fae6){try{utils[_0x9a96('0x13')](util[_0x9a96('0x14')](_0x9a96('0x1f'),_0x25fae6[_0x9a96('0x6')]),_0x25fae6);if(!_['isNil'](channels[_0x25fae6['uniqueid']])&&_0x25fae6['channelstate']==0x6){utils[_0x9a96('0x5')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x25fae6[_0x9a96('0x6')],_0x25fae6['context'],_0x25fae6[_0x9a96('0x7')]));if(_[_0x9a96('0x20')](channels[_0x25fae6[_0x9a96('0x6')]][_0x9a96('0x21')])){channels[_0x25fae6[_0x9a96('0x6')]][_0x9a96('0x21')]=utils[_0x9a96('0x1b')]();}}else if(!_[_0x9a96('0x20')](channels[_0x25fae6['linkedid']])&&_0x25fae6['channelstate']==0x6&&_0x25fae6['context']!='transfer'){utils[_0x9a96('0x5')](util[_0x9a96('0x14')](_0x9a96('0x22'),_0x25fae6[_0x9a96('0x6')],_0x25fae6[_0x9a96('0x16')],_0x25fae6['context'],_0x25fae6[_0x9a96('0x7')]));channels[_0x25fae6[_0x9a96('0x16')]]['accountcode']=_0x25fae6[_0x9a96('0xc')];channels[_0x25fae6[_0x9a96('0x16')]]['destinationchannel']=_0x25fae6[_0x9a96('0x7')];if(_[_0x9a96('0x20')](channels[_0x25fae6[_0x9a96('0x16')]][_0x9a96('0x23')])){channels[_0x25fae6[_0x9a96('0x16')]][_0x9a96('0x23')]=utils['now']();}channels[_0x25fae6['linkedid']][_0x9a96('0x24')]=dispositions[_[_0x9a96('0x25')](_0x25fae6[_0x9a96('0x26')])]||_0x9a96('0x4');}}catch(_0x18d0bc){utils[_0x9a96('0x1d')](util[_0x9a96('0x14')](_0x9a96('0x1f'),_0x25fae6[_0x9a96('0x6')]),_0x18d0bc);}};exports['hangup']=function(_0x2efd40){try{if(!_['isNil'](channels[_0x2efd40['uniqueid']])){utils[_0x9a96('0x13')](util['format']('[%s][calls][hangup]',_0x2efd40['uniqueid']),_0x2efd40);if(_[_0x9a96('0x20')](channels[_0x2efd40[_0x9a96('0x6')]][_0x9a96('0x27')])){channels[_0x2efd40[_0x9a96('0x6')]][_0x9a96('0x27')]=_0x2efd40[_0x9a96('0x28')]+'\x20<'+_0x2efd40[_0x9a96('0xa')]+'>';}utils['info'](util['format'](_0x9a96('0x29'),_0x2efd40[_0x9a96('0x6')],channels[_0x2efd40[_0x9a96('0x6')]]['callerid'],_0x2efd40['cause-txt']));channels[_0x2efd40[_0x9a96('0x6')]][_0x9a96('0x2a')]=utils['now']();channels[_0x2efd40[_0x9a96('0x6')]][_0x9a96('0x2b')]=utils[_0x9a96('0x2c')](channels[_0x2efd40[_0x9a96('0x6')]][_0x9a96('0x2a')],channels[_0x2efd40[_0x9a96('0x6')]][_0x9a96('0x2d')]);channels[_0x2efd40[_0x9a96('0x6')]][_0x9a96('0x2e')]=channels[_0x2efd40[_0x9a96('0x6')]][_0x9a96('0x23')]?utils[_0x9a96('0x2c')](channels[_0x2efd40[_0x9a96('0x6')]][_0x9a96('0x2a')],channels[_0x2efd40['uniqueid']][_0x9a96('0x23')]):0x0;writeDB(channels[_0x2efd40[_0x9a96('0x6')]]);}}catch(_0x155513){utils[_0x9a96('0x1d')](util[_0x9a96('0x14')](_0x9a96('0x2f'),_0x2efd40[_0x9a96('0x6')]),_0x155513);}};exports[_0x9a96('0x30')]=function(_0x421652){try{if(!_[_0x9a96('0x20')](channels[_0x421652[_0x9a96('0x31')]])){utils[_0x9a96('0x13')](util[_0x9a96('0x14')](_0x9a96('0x32'),_0x421652[_0x9a96('0x33')]),_0x421652);if(channels[_0x421652[_0x9a96('0x31')]][_0x9a96('0x7')]==_0x421652[_0x9a96('0x34')]){utils[_0x9a96('0x5')](util['format'](_0x9a96('0x35'),_0x421652[_0x9a96('0x33')],_0x421652[_0x9a96('0x31')],_0x421652['secondtransfererchannel']));channels[_0x421652['localtwolinkedid']][_0x9a96('0x36')]=_0x421652[_0x9a96('0x37')];channels[_0x421652[_0x9a96('0x31')]][_0x9a96('0x38')]=_0x9a96('0x39');}else if(channels[_0x421652[_0x9a96('0x31')]]['channel']=_0x421652[_0x9a96('0x3a')]){utils[_0x9a96('0x5')](util[_0x9a96('0x14')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x421652[_0x9a96('0x33')],_0x421652['localtwolinkedid'],_0x421652[_0x9a96('0x3b')]));channels[_0x421652[_0x9a96('0x31')]][_0x9a96('0x36')]=_0x421652[_0x9a96('0x3b')];channels[_0x421652[_0x9a96('0x31')]][_0x9a96('0x38')]='_attended';}}}catch(_0x4cde63){utils[_0x9a96('0x1d')](util[_0x9a96('0x14')](_0x9a96('0x32'),_0x421652['origtransfereruniqueid']),_0x4cde63);}};exports[_0x9a96('0x3c')]=function(_0x43a3cc){try{if(!_[_0x9a96('0x20')](channels[_0x43a3cc[_0x9a96('0x6')]])){utils[_0x9a96('0x13')](util[_0x9a96('0x14')](_0x9a96('0x3d'),_0x43a3cc[_0x9a96('0x6')]),_0x43a3cc);channels[_0x43a3cc['uniqueid']][_0x9a96('0x3e')]=utils[_0x9a96('0x1b')]();utils['info'](util[_0x9a96('0x14')](_0x9a96('0x3f'),_0x43a3cc[_0x9a96('0x6')],channels[_0x43a3cc[_0x9a96('0x6')]][_0x9a96('0x3e')]));}}catch(_0x20dd7c){utils[_0x9a96('0x1d')](util[_0x9a96('0x14')]('[%s][calls][musiconholdstart]',_0x43a3cc[_0x9a96('0x6')]),_0x20dd7c);}};exports[_0x9a96('0x40')]=function(_0x202477){try{if(!_[_0x9a96('0x20')](channels[_0x202477[_0x9a96('0x6')]])){utils[_0x9a96('0x13')](util['format'](_0x9a96('0x41'),_0x202477[_0x9a96('0x6')]),_0x202477);if(!_['isNil'](channels[_0x202477[_0x9a96('0x6')]]['musiconholdstartAt'])){channels[_0x202477[_0x9a96('0x6')]][_0x9a96('0x42')]+=utils[_0x9a96('0x2c')](utils[_0x9a96('0x1b')](),channels[_0x202477['uniqueid']][_0x9a96('0x3e')]);utils[_0x9a96('0x5')](util['format'](_0x9a96('0x43'),_0x202477[_0x9a96('0x6')],channels[_0x202477[_0x9a96('0x6')]][_0x9a96('0x42')]));delete channels[_0x202477[_0x9a96('0x6')]]['musiconholdstartAt'];}}}catch(_0x7169e){utils[_0x9a96('0x1d')](util[_0x9a96('0x14')]('[%s][calls][musiconholdstop]',_0x202477[_0x9a96('0x6')]),_0x7169e);}};exports[_0x9a96('0x44')]=function(_0x1a1368){try{if(!_[_0x9a96('0x20')](channels[_0x1a1368[_0x9a96('0x6')]])){utils[_0x9a96('0x13')](util['format'](_0x9a96('0x45'),_0x1a1368[_0x9a96('0x6')]),_0x1a1368);if(!_[_0x9a96('0x20')](_0x1a1368[_0x9a96('0x46')]['xmd-originatecalleridnum'])){utils[_0x9a96('0x5')](util[_0x9a96('0x14')](_0x9a96('0x47'),_0x1a1368['uniqueid'],_0x1a1368[_0x9a96('0x48')]));channels[_0x1a1368[_0x9a96('0x6')]][_0x9a96('0x49')]=_0x1a1368[_0x9a96('0x48')];}if(!_[_0x9a96('0x20')](_0x1a1368[_0x9a96('0x46')]['xmd-phone'])){utils[_0x9a96('0x5')](util[_0x9a96('0x14')](_0x9a96('0x4a'),_0x1a1368['uniqueid'],_0x1a1368['value']));channels[_0x1a1368[_0x9a96('0x6')]][_0x9a96('0x4b')]=_0x1a1368['value'];channels[_0x1a1368['uniqueid']][_0x9a96('0x27')]='\x22'+_0x1a1368[_0x9a96('0x48')]+_0x9a96('0x4c')+_0x1a1368[_0x9a96('0x48')]+'>';}if(!_[_0x9a96('0x20')](_0x1a1368[_0x9a96('0x46')]['xmd-callerid-preview'])||!_[_0x9a96('0x20')](_0x1a1368[_0x9a96('0x46')][_0x9a96('0x4d')])){utils[_0x9a96('0x5')](util['format'](_0x9a96('0x4e'),_0x1a1368['uniqueid'],!_[_0x9a96('0x20')](_0x1a1368[_0x9a96('0x46')]['xmd-callerid-preview'])?_0x9a96('0x4f'):_0x9a96('0x4d'),_0x1a1368['value']));channels[_0x1a1368[_0x9a96('0x6')]][_0x9a96('0x27')]=_0x1a1368[_0x9a96('0x48')];}if(!_[_0x9a96('0x20')](_0x1a1368[_0x9a96('0x46')][_0x9a96('0x50')])||!_['isNil'](_0x1a1368[_0x9a96('0x46')][_0x9a96('0x51')])){utils[_0x9a96('0x5')](util[_0x9a96('0x14')](_0x9a96('0x4e'),_0x1a1368[_0x9a96('0x6')],!_[_0x9a96('0x20')](_0x1a1368[_0x9a96('0x46')][_0x9a96('0x50')])?_0x9a96('0x50'):_0x9a96('0x51'),_0x1a1368[_0x9a96('0x48')]));channels[_0x1a1368['uniqueid']][_0x9a96('0x52')]=_0x9a96('0x53');channels[_0x1a1368[_0x9a96('0x6')]][_0x9a96('0x54')]=_0x1a1368[_0x9a96('0x48')];channels[_0x1a1368[_0x9a96('0x6')]][_0x9a96('0x8')]=!![];}if(!_[_0x9a96('0x20')](_0x1a1368[_0x9a96('0x46')][_0x9a96('0x55')])){utils[_0x9a96('0x5')](util['format'](_0x9a96('0x56'),_0x1a1368[_0x9a96('0x6')],_0x1a1368['value']));channels[_0x1a1368[_0x9a96('0x6')]]['ContactId']=_0x1a1368[_0x9a96('0x48')];}if(!_[_0x9a96('0x20')](_0x1a1368[_0x9a96('0x46')][_0x9a96('0x57')])){utils[_0x9a96('0x5')](util[_0x9a96('0x14')](_0x9a96('0x58'),_0x1a1368[_0x9a96('0x6')],_0x1a1368['value']));channels[_0x1a1368['uniqueid']][_0x9a96('0x59')]=_0x1a1368[_0x9a96('0x48')];}if(!_[_0x9a96('0x20')](_0x1a1368[_0x9a96('0x46')]['outboundrouteid'])){utils[_0x9a96('0x5')](util['format'](_0x9a96('0x5a'),_0x1a1368['uniqueid'],_0x1a1368['value']));channels[_0x1a1368[_0x9a96('0x6')]][_0x9a96('0x5b')]=_0x1a1368[_0x9a96('0x48')];}if(!_['isNil'](_0x1a1368['variable']['sipcallid'])){utils[_0x9a96('0x5')](util[_0x9a96('0x14')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x1a1368[_0x9a96('0x6')],_0x1a1368[_0x9a96('0x48')]));channels[_0x1a1368[_0x9a96('0x6')]][_0x9a96('0x5c')]=_0x1a1368[_0x9a96('0x48')];}}}catch(_0x38d3f9){utils[_0x9a96('0x1d')](util[_0x9a96('0x14')]('[%s][calls][varset]',_0x1a1368['uniqueid']),_0x38d3f9);}};exports[_0x9a96('0x5d')]=function(_0x18fcc8){try{if(!_[_0x9a96('0x20')](channels[_0x18fcc8[_0x9a96('0x6')]])){utils[_0x9a96('0x13')](util[_0x9a96('0x14')]('[%s][calls][newexten]',_0x18fcc8[_0x9a96('0x6')]),_0x18fcc8);utils['info'](util[_0x9a96('0x14')](_0x9a96('0x5e'),_0x18fcc8[_0x9a96('0x6')],_0x18fcc8[_0x9a96('0x5f')],_0x18fcc8['appdata']));if(_0x18fcc8[_0x9a96('0x5f')][_0x9a96('0x60')]()==_0x9a96('0x61')&&_[_0x9a96('0x62')](_0x18fcc8['appdata'][_0x9a96('0x60')](),_0x9a96('0x63'))){var _0x49d682=_0x18fcc8[_0x9a96('0x64')][_0x9a96('0x65')]('=');var _0x2bd7fb=_0x49d682[0x0][_0x9a96('0x66')](_0x49d682[0x0][_0x9a96('0x67')]('(')+0x1,_0x49d682[0x0][_0x9a96('0x67')](')'));var _0x11ff35=_0x49d682[0x1];channels[_0x18fcc8[_0x9a96('0x6')]][_0x2bd7fb]=_0x11ff35;}if(!_[_0x9a96('0x68')]([_0x9a96('0x69'),_0x9a96('0x6a'),'execif',_0x9a96('0x61'),_0x9a96('0x6b')],_0x18fcc8[_0x9a96('0x5f')][_0x9a96('0x60')]())){channels[_0x18fcc8[_0x9a96('0x6')]][_0x9a96('0x52')]=_0x18fcc8[_0x9a96('0x5f')];channels[_0x18fcc8[_0x9a96('0x6')]]['lastdata']=_0x18fcc8[_0x9a96('0x64')];}}}catch(_0x26a2cb){utils[_0x9a96('0x1d')](util[_0x9a96('0x14')](_0x9a96('0x6c'),_0x18fcc8[_0x9a96('0x6')]),_0x26a2cb);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index bc30dc5..87e46ce 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 _0xfa34=['[core]\x20shutdown','error','[core]\x20error','close','managerevent','./utils','info','[core]\x20connected'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfa34,0x1d5));var _0x4fa3=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0xfa34[_0x4ca333];return _0x13b2e1;};'use strict';var utils=require(_0x4fa3('0x0'));exports['connect']=function(){utils[_0x4fa3('0x1')](_0x4fa3('0x2'));};exports['shutdown']=function(){utils[_0x4fa3('0x1')](_0x4fa3('0x3'));};exports['fullybooted']=function(){utils[_0x4fa3('0x1')]('[core]\x20fullybooted');};exports[_0x4fa3('0x4')]=function(_0x1d803c){utils['error'](_0x4fa3('0x5'),_0x1d803c);};exports[_0x4fa3('0x6')]=function(){utils[_0x4fa3('0x1')]('[core]\x20close');};exports[_0x4fa3('0x7')]=function(_0x3c7531){}; \ No newline at end of file +var _0xb5fc=['shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','[core]\x20connected'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xb5fc,0x165));var _0xcb5f=function(_0x5a5476,_0xeaf81f){_0x5a5476=_0x5a5476-0x0;var _0x3e0eeb=_0xb5fc[_0x5a5476];return _0x3e0eeb;};'use strict';var utils=require(_0xcb5f('0x0'));exports[_0xcb5f('0x1')]=function(){utils['info'](_0xcb5f('0x2'));};exports[_0xcb5f('0x3')]=function(){utils['info'](_0xcb5f('0x4'));};exports[_0xcb5f('0x5')]=function(){utils['info'](_0xcb5f('0x6'));};exports[_0xcb5f('0x7')]=function(_0x694355){utils[_0xcb5f('0x7')](_0xcb5f('0x8'),_0x694355);};exports[_0xcb5f('0x9')]=function(){utils['info'](_0xcb5f('0xa'));};exports[_0xcb5f('0xb')]=function(_0x2cf1de){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 5743b62..0e3181e 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 _0x3cb8=['request','CreateVoiceDialReport','newexten','debug','format','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr(routeid)','split','error','varset','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','assign','starttime','now','called','[%s][dials][dialbegin]','dialend','answertime','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','endtime','billableseconds','diffTime','util','./utils','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','dialstatus'];(function(_0x5634c6,_0x5f1feb){var _0x25b444=function(_0x15460c){while(--_0x15460c){_0x5634c6['push'](_0x5634c6['shift']());}};_0x25b444(++_0x5f1feb);}(_0x3cb8,0x1d5));var _0x83cb=function(_0x52c1d2,_0x568ac2){_0x52c1d2=_0x52c1d2-0x0;var _0x10ffc8=_0x3cb8[_0x52c1d2];return _0x10ffc8;};'use strict';var _=require('lodash');var util=require(_0x83cb('0x0'));var utils=require(_0x83cb('0x1'));var dials={};function writeDB(_0x28cddc){utils['info'](util['format'](_0x83cb('0x2'),_0x28cddc[_0x83cb('0x3')],_0x28cddc[_0x83cb('0x4')],_0x28cddc[_0x83cb('0x5')],_0x28cddc[_0x83cb('0x6')],_0x28cddc['connectedlinenum'],_0x28cddc[_0x83cb('0x7')]));utils[_0x83cb('0x8')](_0x83cb('0x9'),_0x28cddc);delete dials[_0x28cddc[_0x83cb('0x3')]];}exports[_0x83cb('0xa')]=function(_0x16a880){try{utils[_0x83cb('0xb')](util[_0x83cb('0xc')](_0x83cb('0xd'),_0x16a880[_0x83cb('0x3')]),_0x16a880);utils[_0x83cb('0xe')](util[_0x83cb('0xc')](_0x83cb('0xf'),_0x16a880[_0x83cb('0x3')],_0x16a880[_0x83cb('0x10')],_0x16a880[_0x83cb('0x11')]));if(_0x16a880['application']['toLowerCase']()==_0x83cb('0x12')&&_[_0x83cb('0x13')](_0x16a880[_0x83cb('0x11')][_0x83cb('0x14')](),_0x83cb('0x15'))){var _0xe22031=_0x16a880[_0x83cb('0x11')][_0x83cb('0x16')]('=');dials[_0x16a880[_0x83cb('0x3')]]={'routeId':_0xe22031[0x1]};}}catch(_0x557995){utils[_0x83cb('0x17')](util['format'](_0x83cb('0xd'),_0x16a880[_0x83cb('0x3')]),_0x557995);}};exports[_0x83cb('0x18')]=function(_0x4a1484){try{utils[_0x83cb('0xb')](util[_0x83cb('0xc')]('[%s][dials][varset]',_0x4a1484[_0x83cb('0x3')]),_0x4a1484);if(!_[_0x83cb('0x19')](_0x4a1484[_0x83cb('0x1a')][_0x83cb('0x1b')])){utils['info'](util['format'](_0x83cb('0x1c'),_0x4a1484[_0x83cb('0x3')],_0x4a1484['value']));dials[_0x4a1484[_0x83cb('0x3')]]={'routeId':_0x4a1484[_0x83cb('0x1d')]};}}catch(_0x1bdddc){utils['error'](util[_0x83cb('0xc')](_0x83cb('0x1e'),_0x4a1484[_0x83cb('0x3')]),_0x1bdddc);}};exports[_0x83cb('0x1f')]=function(_0x4e3cec){try{if(!_[_0x83cb('0x19')](dials[_0x4e3cec[_0x83cb('0x3')]])){utils[_0x83cb('0xb')](util[_0x83cb('0xc')]('[%s][dials][dialbegin]',_0x4e3cec[_0x83cb('0x3')]),_0x4e3cec);dials[_0x4e3cec[_0x83cb('0x3')]]=_[_0x83cb('0x20')](dials[_0x4e3cec[_0x83cb('0x3')]],_0x4e3cec);dials[_0x4e3cec['uniqueid']][_0x83cb('0x21')]=utils[_0x83cb('0x22')]();dials[_0x4e3cec[_0x83cb('0x3')]]['lastevent']=_0x83cb('0x23');utils[_0x83cb('0xe')](util[_0x83cb('0xc')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x4e3cec[_0x83cb('0x3')],dials[_0x4e3cec[_0x83cb('0x3')]][_0x83cb('0x21')]));}}catch(_0x449bd9){utils[_0x83cb('0x17')](util[_0x83cb('0xc')](_0x83cb('0x24'),_0x4e3cec[_0x83cb('0x3')]),_0x449bd9);}};exports[_0x83cb('0x25')]=function(_0x31c8e8){try{if(!_[_0x83cb('0x19')](dials[_0x31c8e8[_0x83cb('0x3')]])){utils[_0x83cb('0xb')](util[_0x83cb('0xc')]('[%s][dials][dialend]',_0x31c8e8[_0x83cb('0x3')]),_0x31c8e8);dials[_0x31c8e8[_0x83cb('0x3')]][_0x83cb('0x7')]=_0x31c8e8[_0x83cb('0x7')];if(_0x31c8e8['dialstatus']=='ANSWER'){dials[_0x31c8e8['uniqueid']]=_[_0x83cb('0x20')](dials[_0x31c8e8[_0x83cb('0x3')]],_0x31c8e8);dials[_0x31c8e8[_0x83cb('0x3')]][_0x83cb('0x26')]=utils[_0x83cb('0x22')]();dials[_0x31c8e8['uniqueid']][_0x83cb('0x27')]=_0x83cb('0x28');utils[_0x83cb('0xe')](util['format'](_0x83cb('0x29'),_0x31c8e8[_0x83cb('0x3')],_0x31c8e8[_0x83cb('0x7')],dials[_0x31c8e8[_0x83cb('0x3')]][_0x83cb('0x26')]));}else{utils[_0x83cb('0xe')](util[_0x83cb('0xc')](_0x83cb('0x2a'),_0x31c8e8[_0x83cb('0x3')],_0x31c8e8['dialstatus']));}}}catch(_0x9eb526){utils[_0x83cb('0x17')](util[_0x83cb('0xc')](_0x83cb('0x2b'),_0x31c8e8[_0x83cb('0x3')]),_0x9eb526);}};exports[_0x83cb('0x2c')]=function(_0x512be5){try{if(!_[_0x83cb('0x19')](dials[_0x512be5[_0x83cb('0x3')]])){utils[_0x83cb('0xb')](util[_0x83cb('0xc')](_0x83cb('0x2d'),_0x512be5[_0x83cb('0x3')]),_0x512be5);utils['info'](util[_0x83cb('0xc')](_0x83cb('0x2e'),_0x512be5[_0x83cb('0x3')],_0x512be5[_0x83cb('0x6')],_0x512be5[_0x83cb('0x2f')],_0x512be5['cause-txt']));dials[_0x512be5['uniqueid']]=_[_0x83cb('0x20')](dials[_0x512be5['uniqueid']],{'endtime':utils['now'](),'lastevent':_0x83cb('0x30')});dials[_0x512be5['uniqueid']][_0x83cb('0x31')]=utils['diffTime'](dials[_0x512be5[_0x83cb('0x3')]]['endtime'],dials[_0x512be5[_0x83cb('0x3')]][_0x83cb('0x21')]);dials[_0x512be5[_0x83cb('0x3')]]['holdtime']=utils['diffTime'](dials[_0x512be5[_0x83cb('0x3')]]['answertime']||dials[_0x512be5[_0x83cb('0x3')]][_0x83cb('0x32')],dials[_0x512be5['uniqueid']]['starttime']);dials[_0x512be5[_0x83cb('0x3')]][_0x83cb('0x33')]=dials[_0x512be5[_0x83cb('0x3')]][_0x83cb('0x26')]?utils[_0x83cb('0x34')](dials[_0x512be5[_0x83cb('0x3')]]['endtime'],dials[_0x512be5[_0x83cb('0x3')]]['answertime']):0x0;writeDB(dials[_0x512be5[_0x83cb('0x3')]]);}}catch(_0x4c8669){utils[_0x83cb('0x17')](util[_0x83cb('0xc')]('[%s][dials][hangup]',_0x512be5[_0x83cb('0x3')]),_0x4c8669);}}; \ No newline at end of file +var _0x7c5d=['dialstatus','request','CreateVoiceDialReport','newexten','debug','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','set','startsWith','appdata','toLowerCase','cdr(routeid)','split','error','[%s][dials][newexten]','varset','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','[%s][dials][dialbegin]','assign','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','ANSWER','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','[%s][dials][hangup]','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum'];(function(_0x3ebb17,_0x121235){var _0xb0ce71=function(_0xa0d643){while(--_0xa0d643){_0x3ebb17['push'](_0x3ebb17['shift']());}};_0xb0ce71(++_0x121235);}(_0x7c5d,0x1af));var _0xd7c5=function(_0xb67d37,_0x4f00a5){_0xb67d37=_0xb67d37-0x0;var _0x1d0fc4=_0x7c5d[_0xb67d37];return _0x1d0fc4;};'use strict';var _=require(_0xd7c5('0x0'));var util=require(_0xd7c5('0x1'));var utils=require(_0xd7c5('0x2'));var dials={};function writeDB(_0x51f303){utils['info'](util[_0xd7c5('0x3')](_0xd7c5('0x4'),_0x51f303[_0xd7c5('0x5')],_0x51f303[_0xd7c5('0x6')],_0x51f303[_0xd7c5('0x7')],_0x51f303[_0xd7c5('0x8')],_0x51f303['connectedlinenum'],_0x51f303[_0xd7c5('0x9')]));utils[_0xd7c5('0xa')](_0xd7c5('0xb'),_0x51f303);delete dials[_0x51f303[_0xd7c5('0x5')]];}exports[_0xd7c5('0xc')]=function(_0x402ab4){try{utils[_0xd7c5('0xd')](util['format']('[%s][dials][newexten]',_0x402ab4[_0xd7c5('0x5')]),_0x402ab4);utils[_0xd7c5('0xe')](util[_0xd7c5('0x3')](_0xd7c5('0xf'),_0x402ab4[_0xd7c5('0x5')],_0x402ab4['application'],_0x402ab4['appdata']));if(_0x402ab4[_0xd7c5('0x10')]['toLowerCase']()==_0xd7c5('0x11')&&_[_0xd7c5('0x12')](_0x402ab4[_0xd7c5('0x13')][_0xd7c5('0x14')](),_0xd7c5('0x15'))){var _0x22ca0d=_0x402ab4[_0xd7c5('0x13')][_0xd7c5('0x16')]('=');dials[_0x402ab4[_0xd7c5('0x5')]]={'routeId':_0x22ca0d[0x1]};}}catch(_0x13fde6){utils[_0xd7c5('0x17')](util[_0xd7c5('0x3')](_0xd7c5('0x18'),_0x402ab4[_0xd7c5('0x5')]),_0x13fde6);}};exports[_0xd7c5('0x19')]=function(_0x5d75b4){try{utils[_0xd7c5('0xd')](util['format']('[%s][dials][varset]',_0x5d75b4[_0xd7c5('0x5')]),_0x5d75b4);if(!_[_0xd7c5('0x1a')](_0x5d75b4['variable'][_0xd7c5('0x1b')])){utils[_0xd7c5('0xe')](util[_0xd7c5('0x3')](_0xd7c5('0x1c'),_0x5d75b4[_0xd7c5('0x5')],_0x5d75b4[_0xd7c5('0x1d')]));dials[_0x5d75b4[_0xd7c5('0x5')]]={'routeId':_0x5d75b4[_0xd7c5('0x1d')]};}}catch(_0x21386f){utils[_0xd7c5('0x17')](util[_0xd7c5('0x3')](_0xd7c5('0x1e'),_0x5d75b4[_0xd7c5('0x5')]),_0x21386f);}};exports['dialbegin']=function(_0x4b7f18){try{if(!_['isNil'](dials[_0x4b7f18[_0xd7c5('0x5')]])){utils[_0xd7c5('0xd')](util['format'](_0xd7c5('0x1f'),_0x4b7f18[_0xd7c5('0x5')]),_0x4b7f18);dials[_0x4b7f18[_0xd7c5('0x5')]]=_[_0xd7c5('0x20')](dials[_0x4b7f18[_0xd7c5('0x5')]],_0x4b7f18);dials[_0x4b7f18[_0xd7c5('0x5')]]['starttime']=utils['now']();dials[_0x4b7f18[_0xd7c5('0x5')]][_0xd7c5('0x21')]=_0xd7c5('0x22');utils[_0xd7c5('0xe')](util['format'](_0xd7c5('0x23'),_0x4b7f18['uniqueid'],dials[_0x4b7f18[_0xd7c5('0x5')]][_0xd7c5('0x24')]));}}catch(_0x1d9035){utils[_0xd7c5('0x17')](util[_0xd7c5('0x3')](_0xd7c5('0x1f'),_0x4b7f18[_0xd7c5('0x5')]),_0x1d9035);}};exports['dialend']=function(_0x398d58){try{if(!_[_0xd7c5('0x1a')](dials[_0x398d58[_0xd7c5('0x5')]])){utils[_0xd7c5('0xd')](util[_0xd7c5('0x3')]('[%s][dials][dialend]',_0x398d58[_0xd7c5('0x5')]),_0x398d58);dials[_0x398d58[_0xd7c5('0x5')]][_0xd7c5('0x9')]=_0x398d58[_0xd7c5('0x9')];if(_0x398d58[_0xd7c5('0x9')]==_0xd7c5('0x25')){dials[_0x398d58[_0xd7c5('0x5')]]=_['assign'](dials[_0x398d58[_0xd7c5('0x5')]],_0x398d58);dials[_0x398d58['uniqueid']]['answertime']=utils[_0xd7c5('0x26')]();dials[_0x398d58['uniqueid']][_0xd7c5('0x21')]=_0xd7c5('0x27');utils[_0xd7c5('0xe')](util['format'](_0xd7c5('0x28'),_0x398d58[_0xd7c5('0x5')],_0x398d58['dialstatus'],dials[_0x398d58[_0xd7c5('0x5')]][_0xd7c5('0x29')]));}else{utils[_0xd7c5('0xe')](util[_0xd7c5('0x3')](_0xd7c5('0x2a'),_0x398d58['uniqueid'],_0x398d58['dialstatus']));}}}catch(_0x546512){utils[_0xd7c5('0x17')](util[_0xd7c5('0x3')](_0xd7c5('0x2b'),_0x398d58[_0xd7c5('0x5')]),_0x546512);}};exports[_0xd7c5('0x2c')]=function(_0x17ce85){try{if(!_['isNil'](dials[_0x17ce85[_0xd7c5('0x5')]])){utils[_0xd7c5('0xd')](util[_0xd7c5('0x3')]('[%s][dials][hangup]',_0x17ce85[_0xd7c5('0x5')]),_0x17ce85);utils[_0xd7c5('0xe')](util['format'](_0xd7c5('0x2d'),_0x17ce85[_0xd7c5('0x5')],_0x17ce85['calleridnum'],_0x17ce85[_0xd7c5('0x2e')],_0x17ce85[_0xd7c5('0x2f')]));dials[_0x17ce85[_0xd7c5('0x5')]]=_[_0xd7c5('0x20')](dials[_0x17ce85[_0xd7c5('0x5')]],{'endtime':utils['now'](),'lastevent':_0xd7c5('0x30')});dials[_0x17ce85['uniqueid']][_0xd7c5('0x31')]=utils[_0xd7c5('0x32')](dials[_0x17ce85['uniqueid']][_0xd7c5('0x33')],dials[_0x17ce85['uniqueid']]['starttime']);dials[_0x17ce85[_0xd7c5('0x5')]][_0xd7c5('0x34')]=utils[_0xd7c5('0x32')](dials[_0x17ce85['uniqueid']]['answertime']||dials[_0x17ce85[_0xd7c5('0x5')]][_0xd7c5('0x33')],dials[_0x17ce85['uniqueid']]['starttime']);dials[_0x17ce85[_0xd7c5('0x5')]][_0xd7c5('0x35')]=dials[_0x17ce85[_0xd7c5('0x5')]][_0xd7c5('0x29')]?utils[_0xd7c5('0x32')](dials[_0x17ce85[_0xd7c5('0x5')]][_0xd7c5('0x33')],dials[_0x17ce85[_0xd7c5('0x5')]][_0xd7c5('0x29')]):0x0;writeDB(dials[_0x17ce85[_0xd7c5('0x5')]]);}}catch(_0x201a56){utils[_0xd7c5('0x17')](util[_0xd7c5('0x3')](_0xd7c5('0x36'),_0x17ce85[_0xd7c5('0x5')]),_0x201a56);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 1894552..5d98228 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 _0xe4f7=['[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','disabled','xdr','env','production','local','asterisk','port','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./dials.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','format','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete'];(function(_0x5d0f09,_0x50b5de){var _0x4dcc17=function(_0x28c29b){while(--_0x28c29b){_0x5d0f09['push'](_0x5d0f09['shift']());}};_0x4dcc17(++_0x50b5de);}(_0xe4f7,0x1b1));var _0x7e4f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe4f7[_0x3b380d];return _0x54502b;};var AsteriskManager=require(_0x7e4f('0x0'));var config=require(_0x7e4f('0x1'));var utils=require(_0x7e4f('0x2'));var util=require(_0x7e4f('0x3'));var isXDREnabled=config['xdr']&&config['xdr'][_0x7e4f('0x4')]?!config[_0x7e4f('0x5')]['disabled']:!![];var isProduction=config[_0x7e4f('0x6')]===_0x7e4f('0x7')||![];var isLocalAsterisk=config[_0x7e4f('0x5')]&&config['xdr'][_0x7e4f('0x8')]===!![]||![];var ami=new AsteriskManager(config[_0x7e4f('0x9')][_0x7e4f('0xa')],config[_0x7e4f('0x9')]['ip'],config['asterisk'][_0x7e4f('0xb')],config[_0x7e4f('0x9')][_0x7e4f('0xc')],!![]);ami[_0x7e4f('0xd')]();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x7e4f('0xe')](_0x7e4f('0xf'));}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0x7e4f('0x10'));var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on'](_0x7e4f('0x11'),core[_0x7e4f('0x11')]);ami['on']('shutdown',core[_0x7e4f('0x12')]);ami['on']('fullybooted',core[_0x7e4f('0x13')]);ami['on'](_0x7e4f('0x14'),core[_0x7e4f('0x14')]);ami['on'](_0x7e4f('0x15'),core['close']);ami['on']('managerevent',core[_0x7e4f('0x16')]);ami['on'](_0x7e4f('0x17'),function(_0x4183f8){try{utils[_0x7e4f('0x18')](util['format'](_0x7e4f('0x19'),_0x4183f8[_0x7e4f('0x1a')]),_0x4183f8);members[_0x7e4f('0x17')](_0x4183f8);}catch(_0x4c0729){utils['error'](util['format'](_0x7e4f('0x19'),_0x4183f8['device']),_0x4c0729);}});ami['on']('agentcalled',function(_0xe0dcc2){try{utils[_0x7e4f('0x18')](util[_0x7e4f('0x1b')](_0x7e4f('0x1c'),_0xe0dcc2[_0x7e4f('0x1d')]),_0xe0dcc2);agents[_0x7e4f('0x1e')](_0xe0dcc2);}catch(_0x404143){utils[_0x7e4f('0x14')](util[_0x7e4f('0x1b')](_0x7e4f('0x1c'),_0xe0dcc2[_0x7e4f('0x1d')]),_0x404143);}});ami['on'](_0x7e4f('0x1f'),function(_0x4c23d8){try{utils[_0x7e4f('0x18')](util[_0x7e4f('0x1b')](_0x7e4f('0x20'),_0x4c23d8['uniqueid']),_0x4c23d8);agents[_0x7e4f('0x1f')](_0x4c23d8);}catch(_0x18efb2){utils[_0x7e4f('0x14')](util[_0x7e4f('0x1b')](_0x7e4f('0x20'),_0x4c23d8[_0x7e4f('0x1d')]),_0x18efb2);}});ami['on'](_0x7e4f('0x21'),function(_0x8df123){try{utils['debug'](util[_0x7e4f('0x1b')](_0x7e4f('0x22'),_0x8df123['uniqueid']),_0x8df123);agents['agentconnect'](_0x8df123);queues[_0x7e4f('0x21')](_0x8df123);}catch(_0x146f2a){utils['error'](util[_0x7e4f('0x1b')](_0x7e4f('0x22'),_0x8df123[_0x7e4f('0x1d')]),_0x146f2a);}});ami['on'](_0x7e4f('0x23'),function(_0x234cf2){try{utils[_0x7e4f('0x18')](util['format'](_0x7e4f('0x24'),_0x234cf2[_0x7e4f('0x1d')]),_0x234cf2);agents[_0x7e4f('0x23')](_0x234cf2);queues[_0x7e4f('0x23')](_0x234cf2);members[_0x7e4f('0x23')](_0x234cf2);}catch(_0x54aa8d){utils['error'](util[_0x7e4f('0x1b')](_0x7e4f('0x24'),_0x234cf2[_0x7e4f('0x1d')]),_0x54aa8d);}});ami['on']('queuecallerabandon',function(_0x1b4e0d){try{utils[_0x7e4f('0x18')](util[_0x7e4f('0x1b')](_0x7e4f('0x25'),_0x1b4e0d[_0x7e4f('0x1d')]),_0x1b4e0d);agents[_0x7e4f('0x26')](_0x1b4e0d);queues[_0x7e4f('0x26')](_0x1b4e0d);}catch(_0x1aa8e4){utils['error'](util['format']('[%s][index][queuecallerabandon]',_0x1b4e0d['uniqueid']),_0x1aa8e4);}});ami['on'](_0x7e4f('0x27'),function(_0x41582c){try{utils[_0x7e4f('0x18')](util[_0x7e4f('0x1b')](_0x7e4f('0x28'),_0x41582c['uniqueid']),_0x41582c);queues[_0x7e4f('0x27')](_0x41582c);recordings[_0x7e4f('0x27')](_0x41582c);}catch(_0x59d828){utils[_0x7e4f('0x14')](util[_0x7e4f('0x1b')](_0x7e4f('0x28'),_0x41582c['uniqueid']),_0x59d828);}});ami['on'](_0x7e4f('0x29'),function(_0x1ebe19){try{utils[_0x7e4f('0x18')](util[_0x7e4f('0x1b')](_0x7e4f('0x2a'),_0x1ebe19[_0x7e4f('0x1d')]),_0x1ebe19);queues['queuecallerleave'](_0x1ebe19);}catch(_0x1b0668){utils[_0x7e4f('0x14')](util['format']('[%s][index][queuecallerleave]',_0x1ebe19[_0x7e4f('0x1d')]),_0x1b0668);}});ami['on'](_0x7e4f('0x2b'),function(_0x387ad4){try{utils[_0x7e4f('0x18')](util[_0x7e4f('0x1b')]('[%s][index][musiconholdstart]',_0x387ad4[_0x7e4f('0x1d')]),_0x387ad4);queues['musiconholdstart'](_0x387ad4);calls[_0x7e4f('0x2b')](_0x387ad4);}catch(_0x40f0c0){utils[_0x7e4f('0x14')](util[_0x7e4f('0x1b')]('[%s][index][musiconholdstart]',_0x387ad4[_0x7e4f('0x1d')]),_0x40f0c0);}});ami['on'](_0x7e4f('0x2c'),function(_0x56e1ca){try{utils[_0x7e4f('0x18')](util[_0x7e4f('0x1b')](_0x7e4f('0x2d'),_0x56e1ca[_0x7e4f('0x1d')]),_0x56e1ca);queues[_0x7e4f('0x2c')](_0x56e1ca);calls['musiconholdstop'](_0x56e1ca);}catch(_0x25f46e){utils[_0x7e4f('0x14')](util[_0x7e4f('0x1b')](_0x7e4f('0x2d'),_0x56e1ca[_0x7e4f('0x1d')]),_0x25f46e);}});ami['on'](_0x7e4f('0x2e'),function(_0x24ca25){try{utils[_0x7e4f('0x18')](util[_0x7e4f('0x1b')]('[%s][index][newstate]',_0x24ca25[_0x7e4f('0x1d')]),_0x24ca25);calls[_0x7e4f('0x2e')](_0x24ca25);recordings[_0x7e4f('0x2e')](_0x24ca25);}catch(_0x2d8f58){utils[_0x7e4f('0x14')](util[_0x7e4f('0x1b')](_0x7e4f('0x2f'),_0x24ca25[_0x7e4f('0x1d')]),_0x2d8f58);}});ami['on'](_0x7e4f('0x30'),function(_0x563338){try{utils[_0x7e4f('0x18')](util[_0x7e4f('0x1b')](_0x7e4f('0x31'),_0x563338[_0x7e4f('0x1d')]),_0x563338);calls['hangup'](_0x563338);recordings[_0x7e4f('0x30')](_0x563338);dials['hangup'](_0x563338);agents[_0x7e4f('0x30')](_0x563338);queues[_0x7e4f('0x30')](_0x563338);}catch(_0x515599){utils[_0x7e4f('0x14')](util[_0x7e4f('0x1b')](_0x7e4f('0x31'),_0x563338[_0x7e4f('0x1d')]),_0x515599);}});ami['on'](_0x7e4f('0x32'),function(_0x13e068){try{utils['debug'](util[_0x7e4f('0x1b')](_0x7e4f('0x33'),_0x13e068[_0x7e4f('0x1d')]),_0x13e068);members[_0x7e4f('0x32')](_0x13e068);}catch(_0x2f08f0){utils[_0x7e4f('0x14')](util[_0x7e4f('0x1b')](_0x7e4f('0x33'),_0x13e068[_0x7e4f('0x1d')]),_0x2f08f0);}});ami['on'](_0x7e4f('0x34'),function(_0x2d2e8b){try{utils['debug'](util[_0x7e4f('0x1b')]('[%s][index][blindtransfer]',_0x2d2e8b[_0x7e4f('0x1d')]),_0x2d2e8b);queues[_0x7e4f('0x34')](_0x2d2e8b);agents['blindtransfer'](_0x2d2e8b);transfers[_0x7e4f('0x34')](_0x2d2e8b);}catch(_0x697587){utils['error'](util[_0x7e4f('0x1b')]('[%s][index][blindtransfer]',_0x2d2e8b[_0x7e4f('0x1d')]),_0x697587);}});ami['on'](_0x7e4f('0x35'),function(_0x557b64){try{utils['debug'](util[_0x7e4f('0x1b')](_0x7e4f('0x36'),_0x557b64[_0x7e4f('0x37')]),_0x557b64);queues[_0x7e4f('0x35')](_0x557b64);transfers[_0x7e4f('0x35')](_0x557b64);agents[_0x7e4f('0x35')](_0x557b64);calls['attendedtransfer'](_0x557b64);}catch(_0x3fa4ff){utils[_0x7e4f('0x14')](util['format'](_0x7e4f('0x36'),_0x557b64[_0x7e4f('0x37')]),_0x3fa4ff);}});ami['on'](_0x7e4f('0x38'),function(_0x1832e9){try{utils['debug'](util['format']('[%s][index][varset]',_0x1832e9[_0x7e4f('0x1d')]),_0x1832e9);queues[_0x7e4f('0x38')](_0x1832e9);recordings[_0x7e4f('0x38')](_0x1832e9);calls[_0x7e4f('0x38')](_0x1832e9);dials['varset'](_0x1832e9);}catch(_0x5d1c85){utils[_0x7e4f('0x14')](util[_0x7e4f('0x1b')](_0x7e4f('0x39'),_0x1832e9[_0x7e4f('0x1d')]),_0x5d1c85);}});ami['on'](_0x7e4f('0x3a'),function(_0x110303){try{utils[_0x7e4f('0x18')](util['format'](_0x7e4f('0x3b'),_0x110303[_0x7e4f('0x1d')]),_0x110303);calls[_0x7e4f('0x3a')](_0x110303);recordings[_0x7e4f('0x3a')](_0x110303);dials[_0x7e4f('0x3a')](_0x110303);}catch(_0x395fde){utils['error'](util[_0x7e4f('0x1b')]('[%s][index][newexten]',_0x110303[_0x7e4f('0x1d')]),_0x395fde);}});ami['on'](_0x7e4f('0x3c'),function(_0x35767e){try{utils[_0x7e4f('0x18')](util[_0x7e4f('0x1b')](_0x7e4f('0x3d'),_0x35767e[_0x7e4f('0x1d')]),_0x35767e);calls[_0x7e4f('0x3c')](_0x35767e);recordings[_0x7e4f('0x3c')](_0x35767e);}catch(_0x1486a2){utils[_0x7e4f('0x14')](util[_0x7e4f('0x1b')](_0x7e4f('0x3d'),_0x35767e[_0x7e4f('0x1d')]),_0x1486a2);}});ami['on'](_0x7e4f('0x3e'),function(_0x3a95f7){try{utils[_0x7e4f('0x18')](util['format'](_0x7e4f('0x3f'),_0x3a95f7[_0x7e4f('0x1d')]),_0x3a95f7);dials[_0x7e4f('0x3e')](_0x3a95f7);}catch(_0x1652e6){utils[_0x7e4f('0x14')](util['format'](_0x7e4f('0x40'),_0x3a95f7[_0x7e4f('0x1d')]),_0x1652e6);}});ami['on'](_0x7e4f('0x41'),function(_0x44847d){try{utils['debug'](util[_0x7e4f('0x1b')](_0x7e4f('0x42'),_0x44847d[_0x7e4f('0x1d')]),_0x44847d);dials[_0x7e4f('0x41')](_0x44847d);}catch(_0x14b281){utils['error'](util[_0x7e4f('0x1b')](_0x7e4f('0x42'),_0x44847d[_0x7e4f('0x1d')]),_0x14b281);}});} \ No newline at end of file +var _0x0c2d=['newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','xdr','disabled','local','asterisk','port','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./members.controller','./dials.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','device','format','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','debug','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]'];(function(_0x249154,_0x242056){var _0x26458e=function(_0x54838f){while(--_0x54838f){_0x249154['push'](_0x249154['shift']());}};_0x26458e(++_0x242056);}(_0x0c2d,0x19b));var _0xd0c2=function(_0x460fd4,_0x1059ce){_0x460fd4=_0x460fd4-0x0;var _0x1c4150=_0x0c2d[_0x460fd4];return _0x1c4150;};var AsteriskManager=require(_0xd0c2('0x0'));var config=require(_0xd0c2('0x1'));var utils=require(_0xd0c2('0x2'));var util=require('util');var isXDREnabled=config[_0xd0c2('0x3')]&&config['xdr'][_0xd0c2('0x4')]?!config[_0xd0c2('0x3')]['disabled']:!![];var isProduction=config['env']==='production'||![];var isLocalAsterisk=config[_0xd0c2('0x3')]&&config[_0xd0c2('0x3')][_0xd0c2('0x5')]===!![]||![];var ami=new AsteriskManager(config[_0xd0c2('0x6')][_0xd0c2('0x7')],config[_0xd0c2('0x6')]['ip'],config[_0xd0c2('0x6')]['username'],config['asterisk']['password'],!![]);ami[_0xd0c2('0x8')]();if(!isXDREnabled){utils['info'](_0xd0c2('0x9'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xd0c2('0xa')](_0xd0c2('0xb'));}else{var agents=require(_0xd0c2('0xc'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require(_0xd0c2('0xd'));var dials=require(_0xd0c2('0xe'));var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on'](_0xd0c2('0xf'),core[_0xd0c2('0xf')]);ami['on'](_0xd0c2('0x10'),core[_0xd0c2('0x10')]);ami['on'](_0xd0c2('0x11'),core['fullybooted']);ami['on'](_0xd0c2('0x12'),core[_0xd0c2('0x12')]);ami['on'](_0xd0c2('0x13'),core[_0xd0c2('0x13')]);ami['on'](_0xd0c2('0x14'),core[_0xd0c2('0x14')]);ami['on'](_0xd0c2('0x15'),function(_0x298460){try{utils['debug'](util['format']('[%s][index][devicestatechange]',_0x298460[_0xd0c2('0x16')]),_0x298460);members['devicestatechange'](_0x298460);}catch(_0x39215a){utils[_0xd0c2('0x12')](util[_0xd0c2('0x17')](_0xd0c2('0x18'),_0x298460['device']),_0x39215a);}});ami['on'](_0xd0c2('0x19'),function(_0x5897a1){try{utils['debug'](util[_0xd0c2('0x17')](_0xd0c2('0x1a'),_0x5897a1[_0xd0c2('0x1b')]),_0x5897a1);agents['agentcalled'](_0x5897a1);}catch(_0x38ba64){utils[_0xd0c2('0x12')](util[_0xd0c2('0x17')](_0xd0c2('0x1a'),_0x5897a1['uniqueid']),_0x38ba64);}});ami['on'](_0xd0c2('0x1c'),function(_0x3b42d1){try{utils[_0xd0c2('0x1d')](util[_0xd0c2('0x17')](_0xd0c2('0x1e'),_0x3b42d1[_0xd0c2('0x1b')]),_0x3b42d1);agents[_0xd0c2('0x1c')](_0x3b42d1);}catch(_0x13fd64){utils['error'](util[_0xd0c2('0x17')](_0xd0c2('0x1e'),_0x3b42d1[_0xd0c2('0x1b')]),_0x13fd64);}});ami['on'](_0xd0c2('0x1f'),function(_0x5cc6b8){try{utils[_0xd0c2('0x1d')](util[_0xd0c2('0x17')](_0xd0c2('0x20'),_0x5cc6b8['uniqueid']),_0x5cc6b8);agents[_0xd0c2('0x1f')](_0x5cc6b8);queues['agentconnect'](_0x5cc6b8);}catch(_0x216516){utils['error'](util[_0xd0c2('0x17')](_0xd0c2('0x20'),_0x5cc6b8[_0xd0c2('0x1b')]),_0x216516);}});ami['on'](_0xd0c2('0x21'),function(_0x333552){try{utils[_0xd0c2('0x1d')](util['format'](_0xd0c2('0x22'),_0x333552[_0xd0c2('0x1b')]),_0x333552);agents['agentcomplete'](_0x333552);queues[_0xd0c2('0x21')](_0x333552);members[_0xd0c2('0x21')](_0x333552);}catch(_0x2b2446){utils['error'](util['format'](_0xd0c2('0x22'),_0x333552[_0xd0c2('0x1b')]),_0x2b2446);}});ami['on']('queuecallerabandon',function(_0x51b5cc){try{utils[_0xd0c2('0x1d')](util[_0xd0c2('0x17')](_0xd0c2('0x23'),_0x51b5cc[_0xd0c2('0x1b')]),_0x51b5cc);agents[_0xd0c2('0x24')](_0x51b5cc);queues['queuecallerabandon'](_0x51b5cc);}catch(_0x14c120){utils[_0xd0c2('0x12')](util[_0xd0c2('0x17')]('[%s][index][queuecallerabandon]',_0x51b5cc['uniqueid']),_0x14c120);}});ami['on'](_0xd0c2('0x25'),function(_0x18752d){try{utils[_0xd0c2('0x1d')](util[_0xd0c2('0x17')](_0xd0c2('0x26'),_0x18752d['uniqueid']),_0x18752d);queues[_0xd0c2('0x25')](_0x18752d);recordings['queuecallerjoin'](_0x18752d);}catch(_0x220ad3){utils[_0xd0c2('0x12')](util[_0xd0c2('0x17')](_0xd0c2('0x26'),_0x18752d['uniqueid']),_0x220ad3);}});ami['on'](_0xd0c2('0x27'),function(_0x557be5){try{utils[_0xd0c2('0x1d')](util[_0xd0c2('0x17')](_0xd0c2('0x28'),_0x557be5['uniqueid']),_0x557be5);queues[_0xd0c2('0x27')](_0x557be5);}catch(_0x41fdbf){utils[_0xd0c2('0x12')](util[_0xd0c2('0x17')](_0xd0c2('0x28'),_0x557be5[_0xd0c2('0x1b')]),_0x41fdbf);}});ami['on']('musiconholdstart',function(_0x4d96b5){try{utils[_0xd0c2('0x1d')](util[_0xd0c2('0x17')](_0xd0c2('0x29'),_0x4d96b5[_0xd0c2('0x1b')]),_0x4d96b5);queues[_0xd0c2('0x2a')](_0x4d96b5);calls[_0xd0c2('0x2a')](_0x4d96b5);}catch(_0x3b8e54){utils['error'](util['format'](_0xd0c2('0x29'),_0x4d96b5[_0xd0c2('0x1b')]),_0x3b8e54);}});ami['on']('musiconholdstop',function(_0x8553d0){try{utils[_0xd0c2('0x1d')](util[_0xd0c2('0x17')]('[%s][index][musiconholdstop]',_0x8553d0[_0xd0c2('0x1b')]),_0x8553d0);queues[_0xd0c2('0x2b')](_0x8553d0);calls['musiconholdstop'](_0x8553d0);}catch(_0x5cf357){utils[_0xd0c2('0x12')](util[_0xd0c2('0x17')](_0xd0c2('0x2c'),_0x8553d0['uniqueid']),_0x5cf357);}});ami['on']('newstate',function(_0x3dc008){try{utils[_0xd0c2('0x1d')](util['format'](_0xd0c2('0x2d'),_0x3dc008[_0xd0c2('0x1b')]),_0x3dc008);calls['newstate'](_0x3dc008);recordings[_0xd0c2('0x2e')](_0x3dc008);}catch(_0x44eb62){utils[_0xd0c2('0x12')](util[_0xd0c2('0x17')](_0xd0c2('0x2d'),_0x3dc008[_0xd0c2('0x1b')]),_0x44eb62);}});ami['on'](_0xd0c2('0x2f'),function(_0x38b4f7){try{utils[_0xd0c2('0x1d')](util['format'](_0xd0c2('0x30'),_0x38b4f7[_0xd0c2('0x1b')]),_0x38b4f7);calls[_0xd0c2('0x2f')](_0x38b4f7);recordings['hangup'](_0x38b4f7);dials['hangup'](_0x38b4f7);agents['hangup'](_0x38b4f7);queues['hangup'](_0x38b4f7);}catch(_0xf40e2f){utils[_0xd0c2('0x12')](util[_0xd0c2('0x17')](_0xd0c2('0x30'),_0x38b4f7[_0xd0c2('0x1b')]),_0xf40e2f);}});ami['on'](_0xd0c2('0x31'),function(_0x560942){try{utils['debug'](util['format'](_0xd0c2('0x32'),_0x560942['uniqueid']),_0x560942);members[_0xd0c2('0x31')](_0x560942);}catch(_0x3fb95){utils[_0xd0c2('0x12')](util['format'](_0xd0c2('0x32'),_0x560942['uniqueid']),_0x3fb95);}});ami['on'](_0xd0c2('0x33'),function(_0x5d0a67){try{utils[_0xd0c2('0x1d')](util[_0xd0c2('0x17')](_0xd0c2('0x34'),_0x5d0a67[_0xd0c2('0x1b')]),_0x5d0a67);queues[_0xd0c2('0x33')](_0x5d0a67);agents[_0xd0c2('0x33')](_0x5d0a67);transfers['blindtransfer'](_0x5d0a67);}catch(_0x377d98){utils['error'](util[_0xd0c2('0x17')](_0xd0c2('0x34'),_0x5d0a67['uniqueid']),_0x377d98);}});ami['on'](_0xd0c2('0x35'),function(_0x580e68){try{utils[_0xd0c2('0x1d')](util['format'](_0xd0c2('0x36'),_0x580e68[_0xd0c2('0x37')]),_0x580e68);queues[_0xd0c2('0x35')](_0x580e68);transfers['attendedtransfer'](_0x580e68);agents[_0xd0c2('0x35')](_0x580e68);calls[_0xd0c2('0x35')](_0x580e68);}catch(_0x7d3c38){utils['error'](util[_0xd0c2('0x17')](_0xd0c2('0x36'),_0x580e68[_0xd0c2('0x37')]),_0x7d3c38);}});ami['on'](_0xd0c2('0x38'),function(_0x137e3a){try{utils[_0xd0c2('0x1d')](util[_0xd0c2('0x17')](_0xd0c2('0x39'),_0x137e3a['uniqueid']),_0x137e3a);queues[_0xd0c2('0x38')](_0x137e3a);recordings[_0xd0c2('0x38')](_0x137e3a);calls[_0xd0c2('0x38')](_0x137e3a);dials[_0xd0c2('0x38')](_0x137e3a);}catch(_0x121365){utils[_0xd0c2('0x12')](util['format'](_0xd0c2('0x39'),_0x137e3a['uniqueid']),_0x121365);}});ami['on'](_0xd0c2('0x3a'),function(_0x151b9d){try{utils[_0xd0c2('0x1d')](util['format'](_0xd0c2('0x3b'),_0x151b9d['uniqueid']),_0x151b9d);calls[_0xd0c2('0x3a')](_0x151b9d);recordings[_0xd0c2('0x3a')](_0x151b9d);dials[_0xd0c2('0x3a')](_0x151b9d);}catch(_0x212fe5){utils['error'](util[_0xd0c2('0x17')](_0xd0c2('0x3b'),_0x151b9d[_0xd0c2('0x1b')]),_0x212fe5);}});ami['on'](_0xd0c2('0x3c'),function(_0x48660f){try{utils[_0xd0c2('0x1d')](util[_0xd0c2('0x17')](_0xd0c2('0x3d'),_0x48660f[_0xd0c2('0x1b')]),_0x48660f);calls[_0xd0c2('0x3c')](_0x48660f);recordings[_0xd0c2('0x3c')](_0x48660f);}catch(_0x38dff8){utils['error'](util[_0xd0c2('0x17')](_0xd0c2('0x3d'),_0x48660f[_0xd0c2('0x1b')]),_0x38dff8);}});ami['on'](_0xd0c2('0x3e'),function(_0x49c65c){try{utils[_0xd0c2('0x1d')](util['format'](_0xd0c2('0x3f'),_0x49c65c[_0xd0c2('0x1b')]),_0x49c65c);dials['dialbegin'](_0x49c65c);}catch(_0x6ff4a6){utils[_0xd0c2('0x12')](util[_0xd0c2('0x17')](_0xd0c2('0x40'),_0x49c65c[_0xd0c2('0x1b')]),_0x6ff4a6);}});ami['on'](_0xd0c2('0x41'),function(_0x33fe0e){try{utils[_0xd0c2('0x1d')](util[_0xd0c2('0x17')](_0xd0c2('0x42'),_0x33fe0e['uniqueid']),_0x33fe0e);dials[_0xd0c2('0x41')](_0x33fe0e);}catch(_0x1bbc8d){utils[_0xd0c2('0x12')](util[_0xd0c2('0x17')]('[%s][index][dialend]',_0x33fe0e[_0xd0c2('0x1b')]),_0x1bbc8d);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index daef04d..af3f65f 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 _0xec56=['devicestatechange','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','[%s][members][agentcomplete]','queue','assign','error','[%s][members][cdr]','isNil','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','some','startsWith'];(function(_0x3937f1,_0x352a40){var _0xdaef86=function(_0x30036b){while(--_0x30036b){_0x3937f1['push'](_0x3937f1['shift']());}};_0xdaef86(++_0x352a40);}(_0xec56,0x1bd));var _0x6ec5=function(_0x434820,_0x4b0215){_0x434820=_0x434820-0x0;var _0x447148=_0xec56[_0x434820];return _0x447148;};'use strict';var _=require(_0x6ec5('0x0'));var util=require('util');var utils=require('./utils');var members={};var exclude=[_0x6ec5('0x1'),_0x6ec5('0x2')];function writeDB(_0x26a5af){utils[_0x6ec5('0x3')](util[_0x6ec5('0x4')](_0x6ec5('0x5'),_0x26a5af[_0x6ec5('0x6')],_0x26a5af[_0x6ec5('0x7')],_0x26a5af[_0x6ec5('0x8')],_0x26a5af[_0x6ec5('0x9')],_0x26a5af[_0x6ec5('0xa')],_0x26a5af[_0x6ec5('0xb')]));if(_0x26a5af[_0x6ec5('0x7')]){utils[_0x6ec5('0xc')](_0x26a5af[_0x6ec5('0x7')])[_0x6ec5('0xd')](function(_0x17bcf0){if(_0x17bcf0){_0x26a5af[_0x6ec5('0xa')]=_0x17bcf0[_0x6ec5('0xe')];_0x26a5af['internal']=_0x17bcf0[_0x6ec5('0xf')];utils[_0x6ec5('0x10')](_0x6ec5('0x11'),_0x26a5af);}else{utils[_0x6ec5('0x12')](_0x26a5af[_0x6ec5('0x7')][_0x6ec5('0x13')]('/')[0x1])[_0x6ec5('0xd')](function(_0x50eb2d){if(_0x50eb2d){_0x26a5af[_0x6ec5('0xa')]=_0x50eb2d[_0x6ec5('0xe')];_0x26a5af[_0x6ec5('0xf')]=_0x50eb2d[_0x6ec5('0xf')];utils[_0x6ec5('0x10')](_0x6ec5('0x11'),_0x26a5af);}});}})[_0x6ec5('0x14')](function(_0x39125b){utils['error'](util[_0x6ec5('0x4')]('[%s][members][writeDB]',_0x26a5af[_0x6ec5('0x6')]),_0x39125b);});}delete members[_0x26a5af[_0x6ec5('0x7')]];}function startsWith(_0x4a4e3c,_0x9fc0e7){return _[_0x6ec5('0x15')](_0x4a4e3c,function(_0x4d09fe){return _[_0x6ec5('0x16')](_0x9fc0e7,_0x4d09fe);});}exports[_0x6ec5('0x17')]=function(_0x125ae6){try{utils[_0x6ec5('0x18')](util[_0x6ec5('0x4')](_0x6ec5('0x19'),members[_0x125ae6[_0x6ec5('0x1a')]]?members[_0x125ae6[_0x6ec5('0x1a')]][_0x6ec5('0x6')]:_0x125ae6[_0x6ec5('0x1a')]),_0x125ae6);utils[_0x6ec5('0x3')](util[_0x6ec5('0x4')](_0x6ec5('0x1b'),members[_0x125ae6[_0x6ec5('0x1a')]]?members[_0x125ae6[_0x6ec5('0x1a')]][_0x6ec5('0x6')]:_0x125ae6[_0x6ec5('0x1a')],_0x125ae6['state'],_0x125ae6[_0x6ec5('0x1a')]));switch(_0x125ae6[_0x6ec5('0x1c')]){case _0x6ec5('0x1d'):case _0x6ec5('0x1e'):if(!startsWith(exclude,_0x125ae6[_0x6ec5('0x1a')])){members[_0x125ae6[_0x6ec5('0x1a')]]={'channel':_0x6ec5('0x1f'),'interface':_0x125ae6['device'],'type':_0x6ec5('0x20'),'enterAt':utils[_0x6ec5('0x21')](),'role':_0x6ec5('0x22')};}break;case _0x6ec5('0x23'):if(!_['isNil'](members[_0x125ae6[_0x6ec5('0x1a')]])){members[_0x125ae6[_0x6ec5('0x1a')]]['exitAt']=utils[_0x6ec5('0x21')]();members[_0x125ae6[_0x6ec5('0x1a')]][_0x6ec5('0x24')]=utils['diffTime'](members[_0x125ae6[_0x6ec5('0x1a')]][_0x6ec5('0x25')],members[_0x125ae6[_0x6ec5('0x1a')]][_0x6ec5('0x26')]);if(members[_0x125ae6[_0x6ec5('0x1a')]]['uniqueid']){writeDB(members[_0x125ae6[_0x6ec5('0x1a')]]);}}break;default:break;}}catch(_0x267a30){utils['error'](util[_0x6ec5('0x4')](_0x6ec5('0x19'),members[_0x125ae6['device']]?members[_0x125ae6[_0x6ec5('0x1a')]][_0x6ec5('0x6')]:_0x125ae6[_0x6ec5('0x1a')]),_0x267a30);}};exports[_0x6ec5('0x27')]=function(_0x116659){try{if(!_['isNil'](members[_0x116659[_0x6ec5('0x7')]])){utils[_0x6ec5('0x18')](util[_0x6ec5('0x4')](_0x6ec5('0x28'),_0x116659[_0x6ec5('0x6')]),_0x116659);utils[_0x6ec5('0x3')](util[_0x6ec5('0x4')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x116659[_0x6ec5('0x6')],_0x116659['interface'],_0x116659[_0x6ec5('0x29')]));members[_0x116659['interface']]=_[_0x6ec5('0x2a')](members[_0x116659[_0x6ec5('0x7')]],{'data4':_0x116659['queue'],'uniqueid':_0x116659['uniqueid']});}}catch(_0x3bfab4){utils[_0x6ec5('0x2b')](util['format'](_0x6ec5('0x28'),_0x116659[_0x6ec5('0x6')]),_0x3bfab4);}};exports['cdr']=function(_0x249a8b){try{utils[_0x6ec5('0x18')](util[_0x6ec5('0x4')](_0x6ec5('0x2c'),_0x249a8b[_0x6ec5('0x6')]),_0x249a8b);if(_0x249a8b[_0x6ec5('0x8')]){var _0x1be6ad=_0x249a8b[_0x6ec5('0x8')]['split']('-')[0x0];if(!_[_0x6ec5('0x2d')](members[_0x1be6ad])){members[_0x1be6ad]=_['assign'](members[_0x1be6ad],{'data1':members[_0x1be6ad][_0x6ec5('0x2e')]||_0x249a8b[_0x6ec5('0xb')],'data2':members[_0x1be6ad][_0x6ec5('0x9')]||_0x249a8b[_0x6ec5('0x2f')],'data3':members[_0x1be6ad][_0x6ec5('0x30')]||_0x249a8b[_0x6ec5('0x31')],'uniqueid':members[_0x1be6ad][_0x6ec5('0x6')]||_0x249a8b[_0x6ec5('0x6')]});utils[_0x6ec5('0x3')](util[_0x6ec5('0x4')](_0x6ec5('0x32'),_0x249a8b['uniqueid'],members[_0x1be6ad]['data1'],members[_0x1be6ad][_0x6ec5('0x9')],members[_0x1be6ad]['data3']));if(members[_0x1be6ad][_0x6ec5('0x25')]){writeDB(members[_0x1be6ad]);}}}if(_0x249a8b[_0x6ec5('0x33')]){var _0xfa8414=_0x249a8b[_0x6ec5('0x33')][_0x6ec5('0x13')]('-')[0x0];if(!_[_0x6ec5('0x2d')](members[_0xfa8414])){members[_0xfa8414]=_[_0x6ec5('0x2a')](members[_0xfa8414],{'data1':members[_0xfa8414]['data1']||_0x249a8b[_0x6ec5('0xb')],'data2':members[_0xfa8414][_0x6ec5('0x9')]||_0x249a8b[_0x6ec5('0x2f')],'data3':members[_0xfa8414][_0x6ec5('0x30')]||_0x249a8b[_0x6ec5('0x31')],'uniqueid':members[_0xfa8414][_0x6ec5('0x6')]||_0x249a8b[_0x6ec5('0x6')]});utils[_0x6ec5('0x3')](util[_0x6ec5('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x249a8b[_0x6ec5('0x6')],members[_0xfa8414]['data1'],members[_0xfa8414][_0x6ec5('0x9')],members[_0xfa8414]['data3']));if(members[_0xfa8414][_0x6ec5('0x25')]){writeDB(members[_0xfa8414]);}}}}catch(_0x45de3c){utils['error'](util[_0x6ec5('0x4')](_0x6ec5('0x2c'),_0x249a8b[_0x6ec5('0x6')]),_0x45de3c);}}; \ No newline at end of file +var _0x5c73=['internal','request','split','CreateMemberReport','error','[%s][members][writeDB]','uniqueid','some','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','agent','NOT_INUSE','exitAt','duration','diffTime','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','debug','[%s][members][cdr]','assign','data1','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','source','lodash','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','channel','data2','membername','type','interface','getUserByInterface','then','name'];(function(_0xeb9886,_0xf26fd5){var _0x50a707=function(_0x19c34f){while(--_0x19c34f){_0xeb9886['push'](_0xeb9886['shift']());}};_0x50a707(++_0xf26fd5);}(_0x5c73,0x135));var _0x35c7=function(_0x2c90e3,_0x3487e9){_0x2c90e3=_0x2c90e3-0x0;var _0x41fe19=_0x5c73[_0x2c90e3];return _0x41fe19;};'use strict';var _=require(_0x35c7('0x0'));var util=require('util');var utils=require(_0x35c7('0x1'));var members={};var exclude=[_0x35c7('0x2'),_0x35c7('0x3')];function writeDB(_0x1e7e7e){utils[_0x35c7('0x4')](util[_0x35c7('0x5')](_0x35c7('0x6'),_0x1e7e7e['uniqueid'],_0x1e7e7e['interface'],_0x1e7e7e[_0x35c7('0x7')],_0x1e7e7e[_0x35c7('0x8')],_0x1e7e7e[_0x35c7('0x9')],_0x1e7e7e[_0x35c7('0xa')]));if(_0x1e7e7e[_0x35c7('0xb')]){utils[_0x35c7('0xc')](_0x1e7e7e['interface'])[_0x35c7('0xd')](function(_0x1ac275){if(_0x1ac275){_0x1e7e7e[_0x35c7('0x9')]=_0x1ac275[_0x35c7('0xe')];_0x1e7e7e[_0x35c7('0xf')]=_0x1ac275[_0x35c7('0xf')];utils[_0x35c7('0x10')]('CreateMemberReport',_0x1e7e7e);}else{utils['getUserByName'](_0x1e7e7e['interface'][_0x35c7('0x11')]('/')[0x1])[_0x35c7('0xd')](function(_0x58debe){if(_0x58debe){_0x1e7e7e[_0x35c7('0x9')]=_0x58debe[_0x35c7('0xe')];_0x1e7e7e[_0x35c7('0xf')]=_0x58debe[_0x35c7('0xf')];utils[_0x35c7('0x10')](_0x35c7('0x12'),_0x1e7e7e);}});}})['catch'](function(_0x68280d){utils[_0x35c7('0x13')](util[_0x35c7('0x5')](_0x35c7('0x14'),_0x1e7e7e[_0x35c7('0x15')]),_0x68280d);});}delete members[_0x1e7e7e[_0x35c7('0xb')]];}function startsWith(_0x1cbd8f,_0x33e088){return _[_0x35c7('0x16')](_0x1cbd8f,function(_0x1daf31){return _[_0x35c7('0x17')](_0x33e088,_0x1daf31);});}exports[_0x35c7('0x18')]=function(_0x5b086b){try{utils['debug'](util[_0x35c7('0x5')](_0x35c7('0x19'),members[_0x5b086b['device']]?members[_0x5b086b[_0x35c7('0x1a')]]['uniqueid']:_0x5b086b['device']),_0x5b086b);utils[_0x35c7('0x4')](util['format'](_0x35c7('0x1b'),members[_0x5b086b[_0x35c7('0x1a')]]?members[_0x5b086b[_0x35c7('0x1a')]][_0x35c7('0x15')]:_0x5b086b['device'],_0x5b086b[_0x35c7('0x1c')],_0x5b086b['device']));switch(_0x5b086b['state']){case _0x35c7('0x1d'):case _0x35c7('0x1e'):if(!startsWith(exclude,_0x5b086b['device'])){members[_0x5b086b[_0x35c7('0x1a')]]={'channel':_0x35c7('0x1f'),'interface':_0x5b086b[_0x35c7('0x1a')],'type':_0x35c7('0x20'),'enterAt':utils['now'](),'role':_0x35c7('0x21')};}break;case _0x35c7('0x22'):if(!_['isNil'](members[_0x5b086b[_0x35c7('0x1a')]])){members[_0x5b086b['device']][_0x35c7('0x23')]=utils['now']();members[_0x5b086b[_0x35c7('0x1a')]][_0x35c7('0x24')]=utils[_0x35c7('0x25')](members[_0x5b086b[_0x35c7('0x1a')]][_0x35c7('0x23')],members[_0x5b086b[_0x35c7('0x1a')]][_0x35c7('0x26')]);if(members[_0x5b086b[_0x35c7('0x1a')]][_0x35c7('0x15')]){writeDB(members[_0x5b086b[_0x35c7('0x1a')]]);}}break;default:break;}}catch(_0x449194){utils['error'](util[_0x35c7('0x5')](_0x35c7('0x19'),members[_0x5b086b[_0x35c7('0x1a')]]?members[_0x5b086b[_0x35c7('0x1a')]][_0x35c7('0x15')]:_0x5b086b['device']),_0x449194);}};exports[_0x35c7('0x27')]=function(_0x3179ad){try{if(!_[_0x35c7('0x28')](members[_0x3179ad[_0x35c7('0xb')]])){utils['debug'](util[_0x35c7('0x5')](_0x35c7('0x29'),_0x3179ad['uniqueid']),_0x3179ad);utils[_0x35c7('0x4')](util[_0x35c7('0x5')](_0x35c7('0x2a'),_0x3179ad['uniqueid'],_0x3179ad[_0x35c7('0xb')],_0x3179ad[_0x35c7('0x2b')]));members[_0x3179ad[_0x35c7('0xb')]]=_['assign'](members[_0x3179ad['interface']],{'data4':_0x3179ad[_0x35c7('0x2b')],'uniqueid':_0x3179ad[_0x35c7('0x15')]});}}catch(_0x16ef65){utils[_0x35c7('0x13')](util[_0x35c7('0x5')]('[%s][members][agentcomplete]',_0x3179ad['uniqueid']),_0x16ef65);}};exports[_0x35c7('0x2c')]=function(_0x4e96c5){try{utils[_0x35c7('0x2d')](util[_0x35c7('0x5')](_0x35c7('0x2e'),_0x4e96c5[_0x35c7('0x15')]),_0x4e96c5);if(_0x4e96c5[_0x35c7('0x7')]){var _0x5ede31=_0x4e96c5[_0x35c7('0x7')][_0x35c7('0x11')]('-')[0x0];if(!_['isNil'](members[_0x5ede31])){members[_0x5ede31]=_[_0x35c7('0x2f')](members[_0x5ede31],{'data1':members[_0x5ede31][_0x35c7('0x30')]||_0x4e96c5['type'],'data2':members[_0x5ede31]['data2']||_0x4e96c5['source'],'data3':members[_0x5ede31][_0x35c7('0x31')]||_0x4e96c5[_0x35c7('0x32')],'uniqueid':members[_0x5ede31][_0x35c7('0x15')]||_0x4e96c5[_0x35c7('0x15')]});utils[_0x35c7('0x4')](util[_0x35c7('0x5')](_0x35c7('0x33'),_0x4e96c5[_0x35c7('0x15')],members[_0x5ede31][_0x35c7('0x30')],members[_0x5ede31][_0x35c7('0x8')],members[_0x5ede31]['data3']));if(members[_0x5ede31]['exitAt']){writeDB(members[_0x5ede31]);}}}if(_0x4e96c5[_0x35c7('0x34')]){var _0x38afdc=_0x4e96c5['destinationchannel']['split']('-')[0x0];if(!_['isNil'](members[_0x38afdc])){members[_0x38afdc]=_[_0x35c7('0x2f')](members[_0x38afdc],{'data1':members[_0x38afdc][_0x35c7('0x30')]||_0x4e96c5[_0x35c7('0xa')],'data2':members[_0x38afdc][_0x35c7('0x8')]||_0x4e96c5[_0x35c7('0x35')],'data3':members[_0x38afdc][_0x35c7('0x31')]||_0x4e96c5[_0x35c7('0x32')],'uniqueid':members[_0x38afdc][_0x35c7('0x15')]||_0x4e96c5[_0x35c7('0x15')]});utils[_0x35c7('0x4')](util[_0x35c7('0x5')](_0x35c7('0x33'),_0x4e96c5[_0x35c7('0x15')],members[_0x38afdc][_0x35c7('0x30')],members[_0x38afdc][_0x35c7('0x8')],members[_0x38afdc][_0x35c7('0x31')]));if(members[_0x38afdc][_0x35c7('0x23')]){writeDB(members[_0x38afdc]);}}}}catch(_0x17556b){utils[_0x35c7('0x13')](util[_0x35c7('0x5')]('[%s][members][cdr]',_0x4e96c5[_0x35c7('0x15')]),_0x17556b);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 32aeffb..ec8cf6f 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 _0x0fd9=['[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','format','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','[%s][queues][queuecallerjoin]','[%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]','isNil','variable','queuestatus','toUpperCase','CONTINUE','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','value','[%s][queues][queuecallerabandon]','queuecallerexitAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','extension','transferuniqueid','BLINDTRANSFER','[%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','transferexten','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstartAt','musiconholdstop'];(function(_0x38817c,_0x4c49aa){var _0x4702fd=function(_0x39622d){while(--_0x39622d){_0x38817c['push'](_0x38817c['shift']());}};_0x4702fd(++_0x4c49aa);}(_0x0fd9,0x143));var _0x90fd=function(_0x455150,_0x274121){_0x455150=_0x455150-0x0;var _0x12ca9c=_0x0fd9[_0x455150];return _0x12ca9c;};'use strict';var _=require(_0x90fd('0x0'));var util=require('util');var utils=require(_0x90fd('0x1'));var queues={};function writeDB(_0x4432c3){utils['info'](util['format'](_0x90fd('0x2'),_0x4432c3['uniqueid'],_0x4432c3[_0x90fd('0x3')],_0x4432c3[_0x90fd('0x4')],_0x4432c3[_0x90fd('0x5')],_0x4432c3[_0x90fd('0x6')],_0x4432c3[_0x90fd('0x7')],_0x4432c3[_0x90fd('0x8')]));if(_0x4432c3[_0x90fd('0x4')]){utils[_0x90fd('0x9')](_0x4432c3[_0x90fd('0x4')])[_0x90fd('0xa')](function(_0x2adc5f){if(_0x2adc5f){_0x4432c3[_0x90fd('0xb')]=_0x2adc5f[_0x90fd('0xb')];}utils[_0x90fd('0xc')](_0x90fd('0xd'),_0x4432c3);});}else{utils[_0x90fd('0xc')](_0x90fd('0xd'),_0x4432c3);}if(_0x4432c3[_0x90fd('0xe')]){delete queues[_0x4432c3['transfereduniqueid']];}else{delete queues[_0x4432c3[_0x90fd('0xf')]];}}exports[_0x90fd('0x10')]=function(_0x3d8bbb){try{utils[_0x90fd('0x11')](util[_0x90fd('0x12')]('[%s][queues][queuecallerjoin]',_0x3d8bbb[_0x90fd('0xf')]),_0x3d8bbb);utils[_0x90fd('0x13')](util[_0x90fd('0x12')](_0x90fd('0x14'),_0x3d8bbb[_0x90fd('0xf')],_0x3d8bbb[_0x90fd('0x4')],_0x3d8bbb[_0x90fd('0x15')]));queues[_0x3d8bbb[_0x90fd('0xf')]]=_[_0x90fd('0x16')](_0x3d8bbb,{'originalposition':_0x3d8bbb[_0x90fd('0x15')],'queuecallerjoinAt':utils[_0x90fd('0x17')](),'mohtime':0x0});}catch(_0x3d4d5b){utils[_0x90fd('0x18')](util[_0x90fd('0x12')](_0x90fd('0x19'),_0x3d8bbb[_0x90fd('0xf')]),_0x3d4d5b);}};exports['hangup']=function(_0x1e0e0c){try{if(!_['isNil'](queues[_0x1e0e0c[_0x90fd('0xf')]])){utils[_0x90fd('0x11')](util[_0x90fd('0x12')](_0x90fd('0x1a'),_0x1e0e0c[_0x90fd('0xf')]),_0x1e0e0c);if(queues[_0x1e0e0c['uniqueid']][_0x90fd('0x1b')]){if(!queues[_0x1e0e0c[_0x90fd('0xf')]][_0x90fd('0x1c')]&&!queues[_0x1e0e0c[_0x90fd('0xf')]][_0x90fd('0x1d')]){queues[_0x1e0e0c[_0x90fd('0xf')]][_0x90fd('0x1e')]=!![];queues[_0x1e0e0c[_0x90fd('0xf')]][_0x90fd('0x1f')]=utils['now']();queues[_0x1e0e0c[_0x90fd('0xf')]]['queuecallerexitreason']=_0x90fd('0x20');}utils['info'](util[_0x90fd('0x12')](_0x90fd('0x21'),_0x1e0e0c[_0x90fd('0xf')],queues[_0x1e0e0c['uniqueid']][_0x90fd('0x22')],queues[_0x1e0e0c['uniqueid']][_0x90fd('0x8')]));writeDB(queues[_0x1e0e0c[_0x90fd('0xf')]]);}else if(queues[_0x1e0e0c[_0x90fd('0xf')]][_0x90fd('0xe')]){utils[_0x90fd('0x13')](util[_0x90fd('0x12')](_0x90fd('0x23'),_0x1e0e0c[_0x90fd('0xf')],queues[_0x1e0e0c[_0x90fd('0xf')]][_0x90fd('0x22')],queues[_0x1e0e0c[_0x90fd('0xf')]][_0x90fd('0xe')]));queues[queues[_0x1e0e0c['uniqueid']]['transfereduniqueid']]=queues[_0x1e0e0c[_0x90fd('0xf')]];queues[queues[_0x1e0e0c['uniqueid']][_0x90fd('0xe')]][_0x90fd('0x24')]=0x2;delete queues[_0x1e0e0c[_0x90fd('0xf')]];}}}catch(_0x265d73){utils[_0x90fd('0x18')](util['format'](_0x90fd('0x1a'),_0x1e0e0c[_0x90fd('0xf')]),_0x265d73);}};exports[_0x90fd('0x25')]=function(_0x323a2b){try{utils[_0x90fd('0x11')](util[_0x90fd('0x12')](_0x90fd('0x26'),_0x323a2b[_0x90fd('0xf')]),_0x323a2b);if(!_[_0x90fd('0x27')](_0x323a2b[_0x90fd('0x28')][_0x90fd('0x29')])&&_0x323a2b['value'][_0x90fd('0x2a')]()!==_0x90fd('0x2b')){if(!_['isNil'](queues[_0x323a2b[_0x90fd('0xf')]])){queues[_0x323a2b[_0x90fd('0xf')]][_0x90fd('0x1c')]=![];queues[_0x323a2b[_0x90fd('0xf')]]['queuecallerabandonAt']=null;queues[_0x323a2b[_0x90fd('0xf')]][_0x90fd('0x1d')]=!![];queues[_0x323a2b['uniqueid']]['queuecallerexitAt']=utils[_0x90fd('0x17')]();queues[_0x323a2b[_0x90fd('0xf')]][_0x90fd('0x8')]=_0x323a2b['value'][_0x90fd('0x2a')]();utils[_0x90fd('0x13')](util[_0x90fd('0x12')](_0x90fd('0x2c'),_0x323a2b[_0x90fd('0xf')],queues[_0x323a2b[_0x90fd('0xf')]]['name'],_0x323a2b['value'],queues[_0x323a2b['uniqueid']][_0x90fd('0x8')]));writeDB(queues[_0x323a2b[_0x90fd('0xf')]]);}}else if(!_['isNil'](_0x323a2b[_0x90fd('0x28')][_0x90fd('0x2d')])){if(!_[_0x90fd('0x27')](queues[_0x323a2b[_0x90fd('0xf')]])&&!queues[_0x323a2b['uniqueid']]['queuecallerabandon']){queues[_0x323a2b[_0x90fd('0xf')]][_0x90fd('0x1c')]=![];queues[_0x323a2b[_0x90fd('0xf')]][_0x90fd('0x2e')]=null;queues[_0x323a2b['uniqueid']][_0x90fd('0x1d')]=!![];queues[_0x323a2b['uniqueid']]['queuecallerexitAt']=utils[_0x90fd('0x17')]();queues[_0x323a2b[_0x90fd('0xf')]][_0x90fd('0x8')]='EXITWITHKEY';utils[_0x90fd('0x13')](util[_0x90fd('0x12')](_0x90fd('0x2f'),_0x323a2b[_0x90fd('0xf')],queues[_0x323a2b[_0x90fd('0xf')]]['name'],_0x323a2b[_0x90fd('0x30')],queues[_0x323a2b[_0x90fd('0xf')]][_0x90fd('0x8')]));}}}catch(_0x13f804){utils['error'](util['format'](_0x90fd('0x26'),_0x323a2b[_0x90fd('0xf')]),_0x13f804);}};exports['queuecallerabandon']=function(_0x540c09){try{if(!_[_0x90fd('0x27')](queues[_0x540c09[_0x90fd('0xf')]])){utils[_0x90fd('0x11')](util[_0x90fd('0x12')](_0x90fd('0x31'),_0x540c09[_0x90fd('0xf')]),_0x540c09);queues[_0x540c09['uniqueid']]['queuecallerexit']=![];queues[_0x540c09[_0x90fd('0xf')]][_0x90fd('0x32')]=null;queues[_0x540c09[_0x90fd('0xf')]][_0x90fd('0x1c')]=!![];queues[_0x540c09['uniqueid']]['queuecallerabandonAt']=utils[_0x90fd('0x17')]();queues[_0x540c09[_0x90fd('0xf')]][_0x90fd('0x8')]=_0x90fd('0x33');utils['info'](util['format'](_0x90fd('0x34'),_0x540c09[_0x90fd('0xf')],queues[_0x540c09['uniqueid']]['name'],queues[_0x540c09[_0x90fd('0xf')]][_0x90fd('0x8')]));}}catch(_0x5a1ee4){utils[_0x90fd('0x18')](util[_0x90fd('0x12')](_0x90fd('0x31'),_0x540c09['uniqueid']),_0x5a1ee4);}};exports[_0x90fd('0x35')]=function(_0x406721){try{if(!_[_0x90fd('0x27')](queues[_0x406721['uniqueid']])){utils['debug'](util[_0x90fd('0x12')](_0x90fd('0x36'),_0x406721['uniqueid']),_0x406721);utils[_0x90fd('0x13')](util[_0x90fd('0x12')](_0x90fd('0x37'),_0x406721['uniqueid'],queues[_0x406721['uniqueid']][_0x90fd('0x22')],_0x406721[_0x90fd('0x38')],_0x406721[_0x90fd('0x39')]));queues[_0x406721[_0x90fd('0xf')]][_0x90fd('0x35')]=!![];queues[_0x406721[_0x90fd('0xf')]]['queuecallerleaveAt']=utils[_0x90fd('0x17')]();queues[_0x406721[_0x90fd('0xf')]]['holdtime']=utils[_0x90fd('0x3a')](queues[_0x406721['uniqueid']][_0x90fd('0x1b')],queues[_0x406721[_0x90fd('0xf')]][_0x90fd('0x3b')]);queues[_0x406721[_0x90fd('0xf')]][_0x90fd('0x15')]=_0x406721[_0x90fd('0x15')];queues[_0x406721[_0x90fd('0xf')]]['count']=_0x406721[_0x90fd('0x3c')];queues[_0x406721[_0x90fd('0xf')]][_0x90fd('0x38')]=_0x406721[_0x90fd('0x38')];queues[_0x406721[_0x90fd('0xf')]][_0x90fd('0x39')]=_0x406721[_0x90fd('0x39')];}}catch(_0x4fcaf5){utils[_0x90fd('0x18')](util[_0x90fd('0x12')](_0x90fd('0x36'),_0x406721[_0x90fd('0xf')]),_0x4fcaf5);}};exports[_0x90fd('0x3d')]=function(_0x5da587){try{if(!_[_0x90fd('0x27')](queues[_0x5da587['uniqueid']])){utils[_0x90fd('0x11')](util[_0x90fd('0x12')](_0x90fd('0x3e'),_0x5da587['uniqueid']),_0x5da587);utils[_0x90fd('0x13')](util['format'](_0x90fd('0x3f'),_0x5da587[_0x90fd('0xf')],queues[_0x5da587[_0x90fd('0xf')]][_0x90fd('0x22')],_0x5da587[_0x90fd('0x40')],_0x5da587[_0x90fd('0x41')]));queues[_0x5da587['uniqueid']][_0x90fd('0x1c')]=![];queues[_0x5da587[_0x90fd('0xf')]]['queuecallerabandon']=![];queues[_0x5da587['uniqueid']][_0x90fd('0x2e')]=null;queues[_0x5da587[_0x90fd('0xf')]][_0x90fd('0x1d')]=![];queues[_0x5da587[_0x90fd('0xf')]]['queuecallerexitreason']=null;queues[_0x5da587[_0x90fd('0xf')]][_0x90fd('0x32')]=null;queues[_0x5da587['uniqueid']][_0x90fd('0x42')]=!![];queues[_0x5da587[_0x90fd('0xf')]][_0x90fd('0x7')]=_0x5da587[_0x90fd('0x41')];queues[_0x5da587[_0x90fd('0xf')]][_0x90fd('0x5')]=_0x5da587[_0x90fd('0x40')];}}catch(_0x455b86){utils[_0x90fd('0x18')](util['format'](_0x90fd('0x3e'),_0x5da587[_0x90fd('0xf')]),_0x455b86);}};exports[_0x90fd('0x43')]=function(_0x2641e1){try{if(!_[_0x90fd('0x27')](queues[_0x2641e1[_0x90fd('0xf')]])){if(queues[_0x2641e1[_0x90fd('0xf')]][_0x90fd('0x1b')]){utils[_0x90fd('0x11')](util[_0x90fd('0x12')]('[%s][queues][agentcomplete]',_0x2641e1[_0x90fd('0xf')]),_0x2641e1);queues[_0x2641e1[_0x90fd('0xf')]]['queuecallerabandon']=![];queues[_0x2641e1['uniqueid']][_0x90fd('0x1c')]=![];queues[_0x2641e1[_0x90fd('0xf')]]['queuecallerabandonAt']=null;queues[_0x2641e1[_0x90fd('0xf')]]['queuecallerexit']=![];queues[_0x2641e1[_0x90fd('0xf')]][_0x90fd('0x32')]=null;queues[_0x2641e1[_0x90fd('0xf')]][_0x90fd('0x42')]=!![];queues[_0x2641e1['uniqueid']][_0x90fd('0x5')]=_0x2641e1[_0x90fd('0x40')];queues[_0x2641e1[_0x90fd('0xf')]][_0x90fd('0x1e')]=!![];queues[_0x2641e1[_0x90fd('0xf')]]['queuecallercompleteAt']=utils[_0x90fd('0x17')]();if(_0x2641e1[_0x90fd('0x44')]==_0x90fd('0x45')){if(!queues[_0x2641e1['uniqueid']][_0x90fd('0x45')]){queues[_0x2641e1[_0x90fd('0xf')]][_0x90fd('0x8')]=_0x90fd('0x46');}}else{queues[_0x2641e1['uniqueid']][_0x90fd('0x8')]=_0x90fd('0x47')+_0x2641e1[_0x90fd('0x44')][_0x90fd('0x2a')]();}utils[_0x90fd('0x13')](util[_0x90fd('0x12')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x2641e1['uniqueid'],queues[_0x2641e1[_0x90fd('0xf')]][_0x90fd('0x22')],_0x2641e1['membername'],queues[_0x2641e1[_0x90fd('0xf')]][_0x90fd('0x8')]));writeDB(queues[_0x2641e1[_0x90fd('0xf')]]);}}}catch(_0x51319f){utils[_0x90fd('0x18')](util['format'](_0x90fd('0x48'),_0x2641e1['uniqueid']),_0x51319f);}};exports[_0x90fd('0x49')]=function(_0x391986){try{if(!_[_0x90fd('0x27')](queues[_0x391986['transfereeuniqueid']])){utils['debug'](util['format'](_0x90fd('0x4a'),_0x391986['uniqueid']),_0x391986);queues[_0x391986['transfereeuniqueid']][_0x90fd('0x45')]=!![];queues[_0x391986[_0x90fd('0x4b')]][_0x90fd('0x4c')]='BLIND';queues[_0x391986[_0x90fd('0x4b')]]['transferexten']=_0x391986[_0x90fd('0x4d')];queues[_0x391986['transfereeuniqueid']][_0x90fd('0x4e')]=_0x391986[_0x90fd('0x4b')];queues[_0x391986[_0x90fd('0x4b')]][_0x90fd('0x8')]=_0x90fd('0x4f');utils[_0x90fd('0x13')](util[_0x90fd('0x12')](_0x90fd('0x50'),_0x391986['uniqueid'],queues[_0x391986[_0x90fd('0x4b')]][_0x90fd('0x22')],_0x391986[_0x90fd('0x4b')],_0x391986[_0x90fd('0x4d')]));}}catch(_0xcdb2a1){utils[_0x90fd('0x18')](util['format'](_0x90fd('0x4a'),_0x391986['uniqueid']),_0xcdb2a1);}};exports[_0x90fd('0x51')]=function(_0x1e0fae){try{utils[_0x90fd('0x11')](util[_0x90fd('0x12')](_0x90fd('0x52'),_0x1e0fae['origtransfereruniqueid']),_0x1e0fae);if(_0x1e0fae[_0x90fd('0x53')]==_0x1e0fae[_0x90fd('0x54')]){if(!_['isNil'](queues[_0x1e0fae[_0x90fd('0x55')]])){utils[_0x90fd('0x13')](util[_0x90fd('0x12')](_0x90fd('0x56'),_0x1e0fae[_0x90fd('0x53')],queues[_0x1e0fae['secondtransfererlinkedid']][_0x90fd('0x22')],_0x1e0fae[_0x90fd('0x57')]));queues[_0x1e0fae['secondtransfererlinkedid']]['transfer']=!![];queues[_0x1e0fae['secondtransfererlinkedid']][_0x90fd('0x4c')]=_0x90fd('0x58');queues[_0x1e0fae[_0x90fd('0x55')]][_0x90fd('0x59')]=_0x1e0fae[_0x90fd('0x57')];queues[_0x1e0fae[_0x90fd('0x55')]][_0x90fd('0x4e')]=_0x1e0fae[_0x90fd('0x53')];queues[_0x1e0fae[_0x90fd('0x55')]][_0x90fd('0x8')]=_0x90fd('0x5a');}if(!_[_0x90fd('0x27')](queues[_0x1e0fae[_0x90fd('0x54')]])){if(_0x1e0fae[_0x90fd('0x5b')]&&queues[_0x1e0fae[_0x90fd('0x5b')]]){queues[_0x1e0fae[_0x90fd('0x5b')]][_0x90fd('0x24')]=0x1;queues[_0x1e0fae[_0x90fd('0x4b')]]=_['clone'](queues[_0x1e0fae[_0x90fd('0x5b')]]);queues[_0x1e0fae[_0x90fd('0x4b')]][_0x90fd('0xe')]=_0x1e0fae[_0x90fd('0x5c')];queues[_0x1e0fae['transfereeuniqueid']][_0x90fd('0x24')]=0x2;queues[_0x1e0fae['transfereeuniqueid']][_0x90fd('0x6')]=queues[_0x1e0fae[_0x90fd('0x55')]]['calleridnum'];queues[_0x1e0fae[_0x90fd('0x4b')]][_0x90fd('0x5d')]=queues[_0x1e0fae[_0x90fd('0x55')]][_0x90fd('0x5d')];queues[_0x1e0fae[_0x90fd('0x4b')]][_0x90fd('0x3b')]=utils[_0x90fd('0x17')]();queues[_0x1e0fae[_0x90fd('0x4b')]][_0x90fd('0x1b')]=utils[_0x90fd('0x17')]();queues[_0x1e0fae[_0x90fd('0x4b')]][_0x90fd('0x5e')]=0x0;queues[_0x1e0fae[_0x90fd('0x4b')]][_0x90fd('0x5f')]=0x0;utils[_0x90fd('0x13')](util[_0x90fd('0x12')](_0x90fd('0x60'),_0x1e0fae[_0x90fd('0x53')],queues[_0x1e0fae['transfereeuniqueid']][_0x90fd('0x22')],queues[_0x1e0fae['transfereeuniqueid']][_0x90fd('0x6')],queues[_0x1e0fae['transfereeuniqueid']]['calleridname']));}else{utils[_0x90fd('0x13')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1e0fae[_0x90fd('0x53')],queues[_0x1e0fae[_0x90fd('0x54')]][_0x90fd('0x22')],_0x1e0fae[_0x90fd('0x55')]));queues[_0x1e0fae[_0x90fd('0x54')]][_0x90fd('0xe')]=_0x1e0fae[_0x90fd('0x55')];}}}else if(_0x1e0fae[_0x90fd('0x61')]==_0x1e0fae[_0x90fd('0x55')]){if(!_[_0x90fd('0x27')](queues[_0x1e0fae['origtransfererlinkedid']])){utils['info'](util['format'](_0x90fd('0x62'),_0x1e0fae[_0x90fd('0x53')],queues[_0x1e0fae[_0x90fd('0x54')]][_0x90fd('0x22')],_0x1e0fae['secondtransfereruniqueid'],_0x1e0fae[_0x90fd('0x63')]));queues[_0x1e0fae[_0x90fd('0x54')]]['transfer']=!![];queues[_0x1e0fae[_0x90fd('0x54')]]['transfertype']='ATTENDED';queues[_0x1e0fae[_0x90fd('0x54')]][_0x90fd('0x59')]=_0x1e0fae[_0x90fd('0x63')];queues[_0x1e0fae[_0x90fd('0x54')]][_0x90fd('0x4e')]=_0x1e0fae[_0x90fd('0x61')];queues[_0x1e0fae[_0x90fd('0x54')]][_0x90fd('0x8')]=_0x90fd('0x5a');}if(!_['isNil'](queues[_0x1e0fae[_0x90fd('0x55')]])){if(_0x1e0fae[_0x90fd('0x64')]&&queues[_0x1e0fae[_0x90fd('0x64')]]){queues[_0x1e0fae['transfertargetlinkedid']][_0x90fd('0x24')]=0x1;queues[_0x1e0fae['transfertargetuniqueid']]=_[_0x90fd('0x65')](queues[_0x1e0fae[_0x90fd('0x64')]]);queues[_0x1e0fae['transfertargetuniqueid']][_0x90fd('0xe')]=_0x1e0fae[_0x90fd('0x5c')];queues[_0x1e0fae[_0x90fd('0x5c')]]['queuecallerenterreason']=0x2;queues[_0x1e0fae[_0x90fd('0x5c')]]['calleridnum']=queues[_0x1e0fae[_0x90fd('0x54')]][_0x90fd('0x6')];queues[_0x1e0fae[_0x90fd('0x5c')]][_0x90fd('0x5d')]=queues[_0x1e0fae[_0x90fd('0x54')]][_0x90fd('0x5d')];queues[_0x1e0fae[_0x90fd('0x5c')]][_0x90fd('0x3b')]=utils[_0x90fd('0x17')]();queues[_0x1e0fae[_0x90fd('0x5c')]][_0x90fd('0x1b')]=utils[_0x90fd('0x17')]();queues[_0x1e0fae['transfertargetuniqueid']][_0x90fd('0x5e')]=0x0;queues[_0x1e0fae[_0x90fd('0x5c')]]['mohtime']=0x0;utils[_0x90fd('0x13')](util[_0x90fd('0x12')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x1e0fae['origtransfereruniqueid'],queues[_0x1e0fae[_0x90fd('0x5c')]][_0x90fd('0x22')],queues[_0x1e0fae[_0x90fd('0x5c')]][_0x90fd('0xe')],queues[_0x1e0fae[_0x90fd('0x5c')]][_0x90fd('0x6')],queues[_0x1e0fae[_0x90fd('0x5c')]][_0x90fd('0x5d')]));}else{utils[_0x90fd('0x13')](util[_0x90fd('0x12')](_0x90fd('0x66'),_0x1e0fae[_0x90fd('0x53')],queues[_0x1e0fae[_0x90fd('0x55')]][_0x90fd('0x22')],_0x1e0fae[_0x90fd('0x54')]));queues[_0x1e0fae[_0x90fd('0x55')]]['transfereduniqueid']=_0x1e0fae[_0x90fd('0x54')];}}}}catch(_0x4703ef){utils[_0x90fd('0x18')](util[_0x90fd('0x12')](_0x90fd('0x52'),_0x1e0fae[_0x90fd('0x53')]),_0x4703ef);}};exports['musiconholdstart']=function(_0x54bc06){try{if(!_[_0x90fd('0x27')](queues[_0x54bc06[_0x90fd('0xf')]])){utils[_0x90fd('0x11')](util[_0x90fd('0x12')]('[%s][queues][musiconholdstart]',_0x54bc06[_0x90fd('0xf')]),_0x54bc06);queues[_0x54bc06[_0x90fd('0xf')]]['musiconholdstartAt']=utils['now']();utils[_0x90fd('0x13')](util[_0x90fd('0x12')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x54bc06['uniqueid'],queues[_0x54bc06[_0x90fd('0xf')]][_0x90fd('0x22')],queues[_0x54bc06[_0x90fd('0xf')]][_0x90fd('0x67')]));}}catch(_0x2168a1){utils[_0x90fd('0x18')](util[_0x90fd('0x12')]('[%s][queues][musiconholdstart]',_0x54bc06[_0x90fd('0xf')]),_0x2168a1);}};exports[_0x90fd('0x68')]=function(_0x19c3bd){try{if(!_['isNil'](queues[_0x19c3bd[_0x90fd('0xf')]])){if(!_[_0x90fd('0x27')](queues[_0x19c3bd[_0x90fd('0xf')]][_0x90fd('0x67')])){utils[_0x90fd('0x11')](util[_0x90fd('0x12')](_0x90fd('0x69'),_0x19c3bd[_0x90fd('0xf')]),_0x19c3bd);queues[_0x19c3bd[_0x90fd('0xf')]][_0x90fd('0x5f')]+=utils[_0x90fd('0x3a')](utils['now'](),queues[_0x19c3bd[_0x90fd('0xf')]][_0x90fd('0x67')]);utils['info'](util[_0x90fd('0x12')](_0x90fd('0x6a'),_0x19c3bd[_0x90fd('0xf')],queues[_0x19c3bd[_0x90fd('0xf')]]['name'],queues[_0x19c3bd[_0x90fd('0xf')]]['mohtime']));delete queues[_0x19c3bd[_0x90fd('0xf')]][_0x90fd('0x67')];}}}catch(_0x20e567){utils[_0x90fd('0x18')](util[_0x90fd('0x12')]('[%s][queues][musiconholdstop]',_0x19c3bd[_0x90fd('0xf')]),_0x20e567);}}; \ No newline at end of file +var _0x31d0=['toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','position','count','connectedlinenum','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','info','format','uniqueid','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','queue','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','assign','now','error','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','isNil','variable','queuestatus','CONTINUE','queuecallerexitAt','value'];(function(_0x396ab6,_0xc7723){var _0x140307=function(_0x36288c){while(--_0x36288c){_0x396ab6['push'](_0x396ab6['shift']());}};_0x140307(++_0xc7723);}(_0x31d0,0x1d5));var _0x031d=function(_0xb6e43,_0x1568fc){_0xb6e43=_0xb6e43-0x0;var _0x47c40f=_0x31d0[_0xb6e43];return _0x47c40f;};'use strict';var _=require(_0x031d('0x0'));var util=require(_0x031d('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x519271){utils[_0x031d('0x2')](util[_0x031d('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x519271[_0x031d('0x4')],_0x519271['channel'],_0x519271['queue'],_0x519271[_0x031d('0x5')],_0x519271[_0x031d('0x6')],_0x519271[_0x031d('0x7')],_0x519271[_0x031d('0x8')]));if(_0x519271['queue']){utils[_0x031d('0x9')](_0x519271[_0x031d('0xa')])['then'](function(_0x4ac856){if(_0x4ac856){_0x519271[_0x031d('0xb')]=_0x4ac856[_0x031d('0xb')];}utils[_0x031d('0xc')]('CreateVoiceQueueReport',_0x519271);});}else{utils[_0x031d('0xc')](_0x031d('0xd'),_0x519271);}if(_0x519271[_0x031d('0xe')]){delete queues[_0x519271[_0x031d('0xe')]];}else{delete queues[_0x519271[_0x031d('0x4')]];}}exports[_0x031d('0xf')]=function(_0x22bd43){try{utils[_0x031d('0x10')](util[_0x031d('0x3')](_0x031d('0x11'),_0x22bd43[_0x031d('0x4')]),_0x22bd43);utils[_0x031d('0x2')](util[_0x031d('0x3')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x22bd43['uniqueid'],_0x22bd43[_0x031d('0xa')],_0x22bd43['position']));queues[_0x22bd43['uniqueid']]=_[_0x031d('0x12')](_0x22bd43,{'originalposition':_0x22bd43['position'],'queuecallerjoinAt':utils[_0x031d('0x13')](),'mohtime':0x0});}catch(_0x43a76c){utils[_0x031d('0x14')](util[_0x031d('0x3')](_0x031d('0x11'),_0x22bd43[_0x031d('0x4')]),_0x43a76c);}};exports['hangup']=function(_0x7f553){try{if(!_['isNil'](queues[_0x7f553['uniqueid']])){utils[_0x031d('0x10')](util['format'](_0x031d('0x15'),_0x7f553['uniqueid']),_0x7f553);if(queues[_0x7f553['uniqueid']][_0x031d('0x16')]){if(!queues[_0x7f553[_0x031d('0x4')]][_0x031d('0x17')]&&!queues[_0x7f553['uniqueid']][_0x031d('0x18')]){queues[_0x7f553[_0x031d('0x4')]]['queuecallercomplete']=!![];queues[_0x7f553[_0x031d('0x4')]][_0x031d('0x19')]=utils['now']();queues[_0x7f553['uniqueid']][_0x031d('0x8')]='COMPLETEDBYAGENT';}utils[_0x031d('0x2')](util[_0x031d('0x3')](_0x031d('0x1a'),_0x7f553[_0x031d('0x4')],queues[_0x7f553[_0x031d('0x4')]][_0x031d('0x1b')],queues[_0x7f553['uniqueid']][_0x031d('0x8')]));writeDB(queues[_0x7f553[_0x031d('0x4')]]);}else if(queues[_0x7f553[_0x031d('0x4')]][_0x031d('0xe')]){utils[_0x031d('0x2')](util[_0x031d('0x3')](_0x031d('0x1c'),_0x7f553[_0x031d('0x4')],queues[_0x7f553['uniqueid']]['name'],queues[_0x7f553[_0x031d('0x4')]][_0x031d('0xe')]));queues[queues[_0x7f553['uniqueid']][_0x031d('0xe')]]=queues[_0x7f553[_0x031d('0x4')]];queues[queues[_0x7f553[_0x031d('0x4')]][_0x031d('0xe')]]['queuecallerenterreason']=0x2;delete queues[_0x7f553['uniqueid']];}}}catch(_0x13bf65){utils[_0x031d('0x14')](util[_0x031d('0x3')](_0x031d('0x15'),_0x7f553[_0x031d('0x4')]),_0x13bf65);}};exports[_0x031d('0x1d')]=function(_0x1e45a4){try{utils[_0x031d('0x10')](util[_0x031d('0x3')]('[%s][queues][varset]',_0x1e45a4['uniqueid']),_0x1e45a4);if(!_[_0x031d('0x1e')](_0x1e45a4[_0x031d('0x1f')][_0x031d('0x20')])&&_0x1e45a4['value']['toUpperCase']()!==_0x031d('0x21')){if(!_['isNil'](queues[_0x1e45a4[_0x031d('0x4')]])){queues[_0x1e45a4[_0x031d('0x4')]]['queuecallerabandon']=![];queues[_0x1e45a4[_0x031d('0x4')]]['queuecallerabandonAt']=null;queues[_0x1e45a4[_0x031d('0x4')]][_0x031d('0x18')]=!![];queues[_0x1e45a4['uniqueid']][_0x031d('0x22')]=utils[_0x031d('0x13')]();queues[_0x1e45a4[_0x031d('0x4')]]['queuecallerexitreason']=_0x1e45a4[_0x031d('0x23')][_0x031d('0x24')]();utils['info'](util[_0x031d('0x3')](_0x031d('0x25'),_0x1e45a4[_0x031d('0x4')],queues[_0x1e45a4[_0x031d('0x4')]][_0x031d('0x1b')],_0x1e45a4[_0x031d('0x23')],queues[_0x1e45a4[_0x031d('0x4')]][_0x031d('0x8')]));writeDB(queues[_0x1e45a4[_0x031d('0x4')]]);}}else if(!_[_0x031d('0x1e')](_0x1e45a4[_0x031d('0x1f')][_0x031d('0x26')])){if(!_['isNil'](queues[_0x1e45a4['uniqueid']])&&!queues[_0x1e45a4[_0x031d('0x4')]][_0x031d('0x17')]){queues[_0x1e45a4[_0x031d('0x4')]][_0x031d('0x17')]=![];queues[_0x1e45a4[_0x031d('0x4')]][_0x031d('0x27')]=null;queues[_0x1e45a4[_0x031d('0x4')]]['queuecallerexit']=!![];queues[_0x1e45a4[_0x031d('0x4')]][_0x031d('0x22')]=utils['now']();queues[_0x1e45a4[_0x031d('0x4')]][_0x031d('0x8')]=_0x031d('0x28');utils[_0x031d('0x2')](util[_0x031d('0x3')](_0x031d('0x29'),_0x1e45a4[_0x031d('0x4')],queues[_0x1e45a4[_0x031d('0x4')]]['name'],_0x1e45a4[_0x031d('0x23')],queues[_0x1e45a4[_0x031d('0x4')]][_0x031d('0x8')]));}}}catch(_0x2c9005){utils[_0x031d('0x14')](util[_0x031d('0x3')](_0x031d('0x2a'),_0x1e45a4['uniqueid']),_0x2c9005);}};exports[_0x031d('0x17')]=function(_0x17e889){try{if(!_['isNil'](queues[_0x17e889[_0x031d('0x4')]])){utils[_0x031d('0x10')](util[_0x031d('0x3')](_0x031d('0x2b'),_0x17e889[_0x031d('0x4')]),_0x17e889);queues[_0x17e889[_0x031d('0x4')]][_0x031d('0x18')]=![];queues[_0x17e889[_0x031d('0x4')]][_0x031d('0x22')]=null;queues[_0x17e889[_0x031d('0x4')]][_0x031d('0x17')]=!![];queues[_0x17e889['uniqueid']][_0x031d('0x27')]=utils[_0x031d('0x13')]();queues[_0x17e889[_0x031d('0x4')]][_0x031d('0x8')]=_0x031d('0x2c');utils['info'](util[_0x031d('0x3')](_0x031d('0x2d'),_0x17e889[_0x031d('0x4')],queues[_0x17e889['uniqueid']][_0x031d('0x1b')],queues[_0x17e889[_0x031d('0x4')]][_0x031d('0x8')]));}}catch(_0x1e6a49){utils[_0x031d('0x14')](util['format'](_0x031d('0x2b'),_0x17e889[_0x031d('0x4')]),_0x1e6a49);}};exports['queuecallerleave']=function(_0x4c7260){try{if(!_[_0x031d('0x1e')](queues[_0x4c7260[_0x031d('0x4')]])){utils[_0x031d('0x10')](util[_0x031d('0x3')](_0x031d('0x2e'),_0x4c7260[_0x031d('0x4')]),_0x4c7260);utils['info'](util[_0x031d('0x3')](_0x031d('0x2f'),_0x4c7260[_0x031d('0x4')],queues[_0x4c7260[_0x031d('0x4')]][_0x031d('0x1b')],_0x4c7260['connectedlinenum'],_0x4c7260['connectedlinename']));queues[_0x4c7260['uniqueid']][_0x031d('0x30')]=!![];queues[_0x4c7260[_0x031d('0x4')]]['queuecallerleaveAt']=utils['now']();queues[_0x4c7260[_0x031d('0x4')]][_0x031d('0x31')]=utils[_0x031d('0x32')](queues[_0x4c7260[_0x031d('0x4')]][_0x031d('0x16')],queues[_0x4c7260['uniqueid']][_0x031d('0x33')]);queues[_0x4c7260['uniqueid']][_0x031d('0x34')]=_0x4c7260[_0x031d('0x34')];queues[_0x4c7260[_0x031d('0x4')]]['count']=_0x4c7260[_0x031d('0x35')];queues[_0x4c7260[_0x031d('0x4')]][_0x031d('0x36')]=_0x4c7260[_0x031d('0x36')];queues[_0x4c7260[_0x031d('0x4')]]['connectedlinename']=_0x4c7260[_0x031d('0x37')];}}catch(_0x139f18){utils['error'](util['format'](_0x031d('0x2e'),_0x4c7260[_0x031d('0x4')]),_0x139f18);}};exports[_0x031d('0x38')]=function(_0x3c3d73){try{if(!_['isNil'](queues[_0x3c3d73['uniqueid']])){utils['debug'](util[_0x031d('0x3')](_0x031d('0x39'),_0x3c3d73[_0x031d('0x4')]),_0x3c3d73);utils[_0x031d('0x2')](util[_0x031d('0x3')](_0x031d('0x3a'),_0x3c3d73['uniqueid'],queues[_0x3c3d73[_0x031d('0x4')]]['name'],_0x3c3d73[_0x031d('0x3b')],_0x3c3d73[_0x031d('0x3c')]));queues[_0x3c3d73[_0x031d('0x4')]]['queuecallerabandon']=![];queues[_0x3c3d73[_0x031d('0x4')]]['queuecallerabandon']=![];queues[_0x3c3d73[_0x031d('0x4')]][_0x031d('0x27')]=null;queues[_0x3c3d73[_0x031d('0x4')]]['queuecallerexit']=![];queues[_0x3c3d73[_0x031d('0x4')]]['queuecallerexitreason']=null;queues[_0x3c3d73[_0x031d('0x4')]][_0x031d('0x22')]=null;queues[_0x3c3d73[_0x031d('0x4')]][_0x031d('0x3d')]=!![];queues[_0x3c3d73['uniqueid']][_0x031d('0x7')]=_0x3c3d73[_0x031d('0x3c')];queues[_0x3c3d73[_0x031d('0x4')]][_0x031d('0x5')]=_0x3c3d73[_0x031d('0x3b')];}}catch(_0x3708e7){utils[_0x031d('0x14')](util[_0x031d('0x3')](_0x031d('0x39'),_0x3c3d73[_0x031d('0x4')]),_0x3708e7);}};exports[_0x031d('0x3e')]=function(_0x47c742){try{if(!_[_0x031d('0x1e')](queues[_0x47c742[_0x031d('0x4')]])){if(queues[_0x47c742[_0x031d('0x4')]][_0x031d('0x16')]){utils[_0x031d('0x10')](util[_0x031d('0x3')](_0x031d('0x3f'),_0x47c742['uniqueid']),_0x47c742);queues[_0x47c742[_0x031d('0x4')]][_0x031d('0x17')]=![];queues[_0x47c742[_0x031d('0x4')]]['queuecallerabandon']=![];queues[_0x47c742[_0x031d('0x4')]][_0x031d('0x27')]=null;queues[_0x47c742['uniqueid']]['queuecallerexit']=![];queues[_0x47c742[_0x031d('0x4')]][_0x031d('0x22')]=null;queues[_0x47c742[_0x031d('0x4')]]['assigned']=!![];queues[_0x47c742['uniqueid']][_0x031d('0x5')]=_0x47c742[_0x031d('0x3b')];queues[_0x47c742[_0x031d('0x4')]][_0x031d('0x40')]=!![];queues[_0x47c742[_0x031d('0x4')]]['queuecallercompleteAt']=utils[_0x031d('0x13')]();if(_0x47c742[_0x031d('0x41')]==_0x031d('0x42')){if(!queues[_0x47c742['uniqueid']]['transfer']){queues[_0x47c742[_0x031d('0x4')]][_0x031d('0x8')]='TRANSFER';}}else{queues[_0x47c742[_0x031d('0x4')]][_0x031d('0x8')]='COMPLETEDBY'+_0x47c742['reason'][_0x031d('0x24')]();}utils[_0x031d('0x2')](util['format'](_0x031d('0x43'),_0x47c742[_0x031d('0x4')],queues[_0x47c742['uniqueid']]['name'],_0x47c742[_0x031d('0x3b')],queues[_0x47c742[_0x031d('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x47c742[_0x031d('0x4')]]);}}}catch(_0x1b490c){utils['error'](util[_0x031d('0x3')](_0x031d('0x3f'),_0x47c742[_0x031d('0x4')]),_0x1b490c);}};exports['blindtransfer']=function(_0x28833d){try{if(!_[_0x031d('0x1e')](queues[_0x28833d['transfereeuniqueid']])){utils[_0x031d('0x10')](util[_0x031d('0x3')](_0x031d('0x44'),_0x28833d[_0x031d('0x4')]),_0x28833d);queues[_0x28833d['transfereeuniqueid']][_0x031d('0x42')]=!![];queues[_0x28833d[_0x031d('0x45')]][_0x031d('0x46')]=_0x031d('0x47');queues[_0x28833d[_0x031d('0x45')]][_0x031d('0x48')]=_0x28833d[_0x031d('0x49')];queues[_0x28833d[_0x031d('0x45')]][_0x031d('0x4a')]=_0x28833d['transfereeuniqueid'];queues[_0x28833d[_0x031d('0x45')]][_0x031d('0x8')]='BLINDTRANSFER';utils[_0x031d('0x2')](util[_0x031d('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x28833d['uniqueid'],queues[_0x28833d[_0x031d('0x45')]][_0x031d('0x1b')],_0x28833d[_0x031d('0x45')],_0x28833d[_0x031d('0x49')]));}}catch(_0x1311ca){utils['error'](util[_0x031d('0x3')](_0x031d('0x44'),_0x28833d['uniqueid']),_0x1311ca);}};exports['attendedtransfer']=function(_0x503eaf){try{utils[_0x031d('0x10')](util[_0x031d('0x3')](_0x031d('0x4b'),_0x503eaf[_0x031d('0x4c')]),_0x503eaf);if(_0x503eaf[_0x031d('0x4c')]==_0x503eaf[_0x031d('0x4d')]){if(!_[_0x031d('0x1e')](queues[_0x503eaf[_0x031d('0x4e')]])){utils[_0x031d('0x2')](util['format'](_0x031d('0x4f'),_0x503eaf[_0x031d('0x4c')],queues[_0x503eaf['secondtransfererlinkedid']]['name'],_0x503eaf[_0x031d('0x50')]));queues[_0x503eaf[_0x031d('0x4e')]]['transfer']=!![];queues[_0x503eaf[_0x031d('0x4e')]][_0x031d('0x46')]='ATTENDED';queues[_0x503eaf[_0x031d('0x4e')]][_0x031d('0x48')]=_0x503eaf[_0x031d('0x50')];queues[_0x503eaf['secondtransfererlinkedid']][_0x031d('0x4a')]=_0x503eaf[_0x031d('0x4c')];queues[_0x503eaf['secondtransfererlinkedid']][_0x031d('0x8')]='ATTENDEDTRANSFER';}if(!_[_0x031d('0x1e')](queues[_0x503eaf['origtransfererlinkedid']])){if(_0x503eaf[_0x031d('0x51')]&&queues[_0x503eaf[_0x031d('0x51')]]){queues[_0x503eaf['transfereelinkedid']][_0x031d('0x52')]=0x1;queues[_0x503eaf[_0x031d('0x45')]]=_[_0x031d('0x53')](queues[_0x503eaf[_0x031d('0x51')]]);queues[_0x503eaf[_0x031d('0x45')]][_0x031d('0xe')]=_0x503eaf[_0x031d('0x54')];queues[_0x503eaf[_0x031d('0x45')]][_0x031d('0x52')]=0x2;queues[_0x503eaf['transfereeuniqueid']][_0x031d('0x6')]=queues[_0x503eaf['secondtransfererlinkedid']][_0x031d('0x6')];queues[_0x503eaf[_0x031d('0x45')]][_0x031d('0x55')]=queues[_0x503eaf['secondtransfererlinkedid']][_0x031d('0x55')];queues[_0x503eaf[_0x031d('0x45')]][_0x031d('0x33')]=utils[_0x031d('0x13')]();queues[_0x503eaf['transfereeuniqueid']][_0x031d('0x16')]=utils['now']();queues[_0x503eaf['transfereeuniqueid']][_0x031d('0x31')]=0x0;queues[_0x503eaf['transfereeuniqueid']][_0x031d('0x56')]=0x0;utils[_0x031d('0x2')](util[_0x031d('0x3')](_0x031d('0x57'),_0x503eaf['origtransfereruniqueid'],queues[_0x503eaf[_0x031d('0x45')]][_0x031d('0x1b')],queues[_0x503eaf[_0x031d('0x45')]]['calleridnum'],queues[_0x503eaf[_0x031d('0x45')]][_0x031d('0x55')]));}else{utils[_0x031d('0x2')](util[_0x031d('0x3')](_0x031d('0x58'),_0x503eaf[_0x031d('0x4c')],queues[_0x503eaf[_0x031d('0x4d')]]['name'],_0x503eaf[_0x031d('0x4e')]));queues[_0x503eaf['origtransfererlinkedid']][_0x031d('0xe')]=_0x503eaf['secondtransfererlinkedid'];}}}else if(_0x503eaf[_0x031d('0x59')]==_0x503eaf[_0x031d('0x4e')]){if(!_[_0x031d('0x1e')](queues[_0x503eaf[_0x031d('0x4d')]])){utils[_0x031d('0x2')](util[_0x031d('0x3')](_0x031d('0x5a'),_0x503eaf[_0x031d('0x4c')],queues[_0x503eaf[_0x031d('0x4d')]][_0x031d('0x1b')],_0x503eaf[_0x031d('0x59')],_0x503eaf[_0x031d('0x5b')]));queues[_0x503eaf[_0x031d('0x4d')]][_0x031d('0x42')]=!![];queues[_0x503eaf[_0x031d('0x4d')]][_0x031d('0x46')]='ATTENDED';queues[_0x503eaf[_0x031d('0x4d')]][_0x031d('0x48')]=_0x503eaf[_0x031d('0x5b')];queues[_0x503eaf['origtransfererlinkedid']][_0x031d('0x4a')]=_0x503eaf[_0x031d('0x59')];queues[_0x503eaf[_0x031d('0x4d')]][_0x031d('0x8')]=_0x031d('0x5c');}if(!_[_0x031d('0x1e')](queues[_0x503eaf[_0x031d('0x4e')]])){if(_0x503eaf['transfertargetlinkedid']&&queues[_0x503eaf[_0x031d('0x5d')]]){queues[_0x503eaf['transfertargetlinkedid']][_0x031d('0x52')]=0x1;queues[_0x503eaf[_0x031d('0x54')]]=_[_0x031d('0x53')](queues[_0x503eaf[_0x031d('0x5d')]]);queues[_0x503eaf[_0x031d('0x54')]][_0x031d('0xe')]=_0x503eaf[_0x031d('0x54')];queues[_0x503eaf[_0x031d('0x54')]]['queuecallerenterreason']=0x2;queues[_0x503eaf[_0x031d('0x54')]][_0x031d('0x6')]=queues[_0x503eaf[_0x031d('0x4d')]]['calleridnum'];queues[_0x503eaf[_0x031d('0x54')]][_0x031d('0x55')]=queues[_0x503eaf[_0x031d('0x4d')]][_0x031d('0x55')];queues[_0x503eaf[_0x031d('0x54')]][_0x031d('0x33')]=utils['now']();queues[_0x503eaf[_0x031d('0x54')]][_0x031d('0x16')]=utils[_0x031d('0x13')]();queues[_0x503eaf[_0x031d('0x54')]][_0x031d('0x31')]=0x0;queues[_0x503eaf[_0x031d('0x54')]][_0x031d('0x56')]=0x0;utils[_0x031d('0x2')](util['format'](_0x031d('0x5e'),_0x503eaf[_0x031d('0x4c')],queues[_0x503eaf[_0x031d('0x54')]][_0x031d('0x1b')],queues[_0x503eaf[_0x031d('0x54')]]['transfereduniqueid'],queues[_0x503eaf[_0x031d('0x54')]]['calleridnum'],queues[_0x503eaf['transfertargetuniqueid']][_0x031d('0x55')]));}else{utils['info'](util['format'](_0x031d('0x58'),_0x503eaf[_0x031d('0x4c')],queues[_0x503eaf[_0x031d('0x4e')]][_0x031d('0x1b')],_0x503eaf[_0x031d('0x4d')]));queues[_0x503eaf[_0x031d('0x4e')]][_0x031d('0xe')]=_0x503eaf['origtransfererlinkedid'];}}}}catch(_0x6baada){utils['error'](util['format']('[%s][queues][attendedtransfer]',_0x503eaf[_0x031d('0x4c')]),_0x6baada);}};exports[_0x031d('0x5f')]=function(_0x198289){try{if(!_[_0x031d('0x1e')](queues[_0x198289['uniqueid']])){utils[_0x031d('0x10')](util[_0x031d('0x3')](_0x031d('0x60'),_0x198289['uniqueid']),_0x198289);queues[_0x198289[_0x031d('0x4')]][_0x031d('0x61')]=utils['now']();utils[_0x031d('0x2')](util[_0x031d('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x198289[_0x031d('0x4')],queues[_0x198289['uniqueid']]['name'],queues[_0x198289[_0x031d('0x4')]][_0x031d('0x61')]));}}catch(_0xdbab3d){utils[_0x031d('0x14')](util[_0x031d('0x3')](_0x031d('0x60'),_0x198289[_0x031d('0x4')]),_0xdbab3d);}};exports[_0x031d('0x62')]=function(_0x4ff293){try{if(!_['isNil'](queues[_0x4ff293['uniqueid']])){if(!_[_0x031d('0x1e')](queues[_0x4ff293['uniqueid']]['musiconholdstartAt'])){utils[_0x031d('0x10')](util[_0x031d('0x3')](_0x031d('0x63'),_0x4ff293['uniqueid']),_0x4ff293);queues[_0x4ff293[_0x031d('0x4')]][_0x031d('0x56')]+=utils[_0x031d('0x32')](utils[_0x031d('0x13')](),queues[_0x4ff293[_0x031d('0x4')]][_0x031d('0x61')]);utils['info'](util[_0x031d('0x3')](_0x031d('0x64'),_0x4ff293['uniqueid'],queues[_0x4ff293[_0x031d('0x4')]][_0x031d('0x1b')],queues[_0x4ff293[_0x031d('0x4')]][_0x031d('0x56')]));delete queues[_0x4ff293['uniqueid']]['musiconholdstartAt'];}}}catch(_0x1c1187){utils[_0x031d('0x14')](util[_0x031d('0x3')]('[%s][queues][musiconholdstop]',_0x4ff293[_0x031d('0x4')]),_0x1c1187);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 1450174..59812fb 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 _0x173d=['connectedlinename','outbound','monitors','clone','newexten','[%s][recordings][newexten]','application','appdata','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','channel','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x173d,0x152));var _0xd173=function(_0x29cd6b,_0x5a62f6){_0x29cd6b=_0x29cd6b-0x0;var _0x3d81cf=_0x173d[_0x29cd6b];return _0x3d81cf;};'use strict';var _=require(_0xd173('0x0'));var util=require(_0xd173('0x1'));var utils=require(_0xd173('0x2'));var recordings={};function writeDB(_0x3b1674){utils['info'](util[_0xd173('0x3')](_0xd173('0x4'),_0x3b1674[_0xd173('0x5')]));if(_0x3b1674[_0xd173('0x6')]){utils[_0xd173('0x7')](_0x3b1674['accountcode'])['then'](function(_0x5bc483){if(_0x5bc483){_0x3b1674['membername']=_0x5bc483[_0xd173('0x8')];_0x3b1674[_0xd173('0x9')]=_0x5bc483['id'];}utils[_0xd173('0xa')](_0xd173('0xb'),_0x3b1674);});}else{utils['request'](_0xd173('0xb'),_0x3b1674);}}exports[_0xd173('0xc')]=function(_0x25c715){try{utils[_0xd173('0xd')](util['format'](_0xd173('0xe'),_0x25c715[_0xd173('0x5')]),_0x25c715);if(_0x25c715[_0xd173('0x5')]==_0x25c715[_0xd173('0xf')]){utils[_0xd173('0x10')](util[_0xd173('0x3')](_0xd173('0x11'),_0x25c715[_0xd173('0x5')],_0x25c715[_0xd173('0x12')],_0x25c715['exten']));recordings[_0x25c715[_0xd173('0x5')]]={'uniqueid':_0x25c715[_0xd173('0x5')],'accountcode':_0x25c715[_0xd173('0x6')],'exten':_0x25c715[_0xd173('0x13')],'context':_0x25c715[_0xd173('0x12')],'channel':_0x25c715['channel'],'monitors':[]};}}catch(_0xae31f9){utils[_0xd173('0x14')](util[_0xd173('0x3')]('[%s][recordings][newchannel]',_0x25c715[_0xd173('0x5')]),_0xae31f9);}};exports[_0xd173('0x15')]=function(_0x6db5ae){try{utils['debug'](util['format'](_0xd173('0x16'),_0x6db5ae[_0xd173('0x5')]),_0x6db5ae);if(!_[_0xd173('0x17')](recordings[_0x6db5ae[_0xd173('0x5')]])&&_0x6db5ae[_0xd173('0x18')]==0x6){utils[_0xd173('0x10')](util[_0xd173('0x3')](_0xd173('0x19'),_0x6db5ae['uniqueid'],_0x6db5ae[_0xd173('0x12')],_0x6db5ae['channel']));}else if(!_['isNil'](recordings[_0x6db5ae[_0xd173('0xf')]])&&_0x6db5ae[_0xd173('0x18')]==0x6&&_0x6db5ae[_0xd173('0x12')]!=_0xd173('0x1a')){utils[_0xd173('0x10')](util['format'](_0xd173('0x1b'),_0x6db5ae[_0xd173('0x5')],_0x6db5ae['linkedid'],_0x6db5ae[_0xd173('0x12')],_0x6db5ae[_0xd173('0x1c')]));recordings[_0x6db5ae[_0xd173('0xf')]][_0xd173('0x6')]=_0x6db5ae['accountcode'];}}catch(_0x376c51){utils[_0xd173('0x14')](util['format'](_0xd173('0x16'),_0x6db5ae[_0xd173('0x5')]),_0x376c51);}};exports[_0xd173('0x1d')]=function(_0x59be91){try{if(!_['isNil'](_0x59be91['variable'])&&!_[_0xd173('0x17')](_0x59be91[_0xd173('0x1e')][_0xd173('0x1f')])){utils[_0xd173('0xd')](util['format']('[%s][recordings][varset]',_0x59be91[_0xd173('0x5')]),_0x59be91);utils[_0xd173('0x10')](util[_0xd173('0x3')](_0xd173('0x20'),_0x59be91['uniqueid'],_0x59be91[_0xd173('0x1e')],_0x59be91[_0xd173('0x21')]));if(_[_0xd173('0x22')](_0x59be91[_0xd173('0x21')],_0xd173('0x23'))){_0x59be91[_0xd173('0x21')]=_0x59be91[_0xd173('0x21')][_0xd173('0x24')]('.wav49',_0xd173('0x25'));}if(recordings[_0x59be91[_0xd173('0xf')]]){var _0x28b8c6=_[_0xd173('0x26')](recordings[_0x59be91['linkedid']]['monitors'],{'value':_0x59be91[_0xd173('0x21')]});if(_['isNil'](_0x28b8c6)){recordings[_0x59be91[_0xd173('0xf')]]['monitors'][_0xd173('0x27')]({'value':_0x59be91['value']});}}}}catch(_0x4fa860){utils[_0xd173('0x14')](util[_0xd173('0x3')]('[%s][recordings][varset]',_0x59be91[_0xd173('0x5')]),_0x4fa860);}};exports['hangup']=function(_0x50e1ca){try{if(!_['isNil'](recordings[_0x50e1ca['uniqueid']])){utils['debug'](util[_0xd173('0x3')](_0xd173('0x28'),_0x50e1ca[_0xd173('0x5')]),_0x50e1ca);utils[_0xd173('0x10')](util[_0xd173('0x3')](_0xd173('0x29'),_0x50e1ca[_0xd173('0x5')],_0x50e1ca['calleridnum'],_0x50e1ca[_0xd173('0x2a')],_0x50e1ca[_0xd173('0x2b')]));recordings[_0x50e1ca[_0xd173('0x5')]][_0xd173('0x2c')]=_0x50e1ca[_0xd173('0x2c')];recordings[_0x50e1ca['uniqueid']][_0xd173('0x2a')]=_0x50e1ca['calleridname'];recordings[_0x50e1ca[_0xd173('0x5')]]['connectedlinenum']=_0x50e1ca[_0xd173('0x2d')];recordings[_0x50e1ca[_0xd173('0x5')]][_0xd173('0x2e')]=_0x50e1ca[_0xd173('0x2e')];if(recordings[_0x50e1ca[_0xd173('0x5')]]['type']==_0xd173('0x2f')&&recordings[_0x50e1ca[_0xd173('0x5')]][_0xd173('0x6')]){recordings[_0x50e1ca[_0xd173('0x5')]][_0xd173('0x2d')]=recordings[_0x50e1ca[_0xd173('0x5')]]['accountcode'];recordings[_0x50e1ca[_0xd173('0x5')]]['connectedlinename']='';}recordings[_0x50e1ca['uniqueid']][_0xd173('0x30')]['forEach'](function(_0x34d23e){var _0x4ff35e=_[_0xd173('0x31')](recordings[_0x50e1ca[_0xd173('0x5')]]);_0x4ff35e[_0xd173('0x21')]=_0x34d23e[_0xd173('0x21')];writeDB(_0x4ff35e);});delete recordings[_0x50e1ca[_0xd173('0x5')]];}}catch(_0x1d679b){utils[_0xd173('0x14')](util['format']('[%s][recordings][hangup]',_0x50e1ca['uniqueid']),_0x1d679b);}};exports[_0xd173('0x32')]=function(_0x2413f6){try{if(!_['isNil'](recordings[_0x2413f6[_0xd173('0x5')]])){utils[_0xd173('0xd')](util[_0xd173('0x3')](_0xd173('0x33'),_0x2413f6[_0xd173('0x5')]),_0x2413f6);utils[_0xd173('0x10')](util[_0xd173('0x3')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x2413f6[_0xd173('0x5')],_0x2413f6[_0xd173('0x34')],_0x2413f6[_0xd173('0x35')]));if(_0x2413f6[_0xd173('0x34')]['toLowerCase']()==_0xd173('0x36')&&_[_0xd173('0x37')](_0x2413f6[_0xd173('0x35')]['toLowerCase'](),_0xd173('0x38'))){var _0x2cb305=_0x2413f6[_0xd173('0x35')][_0xd173('0x39')]('=');var _0x5aa3b0=_0x2cb305[0x0][_0xd173('0x3a')](_0x2cb305[0x0][_0xd173('0x3b')]('(')+0x1,_0x2cb305[0x0][_0xd173('0x3b')](')'));var _0x267481=_0x2cb305[0x1];recordings[_0x2413f6['uniqueid']][_0x5aa3b0]=_0x267481;}}}catch(_0x260df9){utils[_0xd173('0x14')](util['format'](_0xd173('0x33'),_0x2413f6[_0xd173('0x5')]),_0x260df9);}};exports[_0xd173('0x3c')]=function(_0x3fa0a1){try{if(!_[_0xd173('0x17')](recordings[_0x3fa0a1[_0xd173('0x5')]])){utils['debug'](util[_0xd173('0x3')](_0xd173('0x3d'),_0x3fa0a1[_0xd173('0x5')]),_0x3fa0a1);utils[_0xd173('0x10')](util['format'](_0xd173('0x3e'),_0x3fa0a1['uniqueid'],_0x3fa0a1[_0xd173('0x3f')]));recordings[_0x3fa0a1[_0xd173('0x5')]][_0xd173('0x3f')]=_0x3fa0a1[_0xd173('0x3f')];}}catch(_0x5de261){utils[_0xd173('0x14')](util[_0xd173('0x3')](_0xd173('0x3d'),_0x3fa0a1[_0xd173('0x5')]),_0x5de261);}}; \ No newline at end of file +var _0x41ff=['channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','calleridname','connectedlinenum','connectedlinename','type','forEach','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash','util','info','[%s][recordings][writeDB]','getUserByInternal','accountcode','name','UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','uniqueid','linkedid','format','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newstate]'];(function(_0x1aaa57,_0x3b0b60){var _0x1e33ec=function(_0x450b84){while(--_0x450b84){_0x1aaa57['push'](_0x1aaa57['shift']());}};_0x1e33ec(++_0x3b0b60);}(_0x41ff,0xa1));var _0xf41f=function(_0x401ef9,_0x58ef15){_0x401ef9=_0x401ef9-0x0;var _0x4e20c3=_0x41ff[_0x401ef9];return _0x4e20c3;};'use strict';var _=require(_0xf41f('0x0'));var util=require(_0xf41f('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x33cd3d){utils[_0xf41f('0x2')](util['format'](_0xf41f('0x3'),_0x33cd3d['uniqueid']));if(_0x33cd3d['accountcode']){utils[_0xf41f('0x4')](_0x33cd3d[_0xf41f('0x5')])['then'](function(_0x5bec4b){if(_0x5bec4b){_0x33cd3d['membername']=_0x5bec4b[_0xf41f('0x6')];_0x33cd3d[_0xf41f('0x7')]=_0x5bec4b['id'];}utils['request'](_0xf41f('0x8'),_0x33cd3d);});}else{utils[_0xf41f('0x9')](_0xf41f('0x8'),_0x33cd3d);}}exports[_0xf41f('0xa')]=function(_0x3d795d){try{utils[_0xf41f('0xb')](util['format'](_0xf41f('0xc'),_0x3d795d[_0xf41f('0xd')]),_0x3d795d);if(_0x3d795d[_0xf41f('0xd')]==_0x3d795d[_0xf41f('0xe')]){utils[_0xf41f('0x2')](util[_0xf41f('0xf')](_0xf41f('0x10'),_0x3d795d[_0xf41f('0xd')],_0x3d795d[_0xf41f('0x11')],_0x3d795d[_0xf41f('0x12')]));recordings[_0x3d795d[_0xf41f('0xd')]]={'uniqueid':_0x3d795d['uniqueid'],'accountcode':_0x3d795d[_0xf41f('0x5')],'exten':_0x3d795d['exten'],'context':_0x3d795d[_0xf41f('0x11')],'channel':_0x3d795d[_0xf41f('0x13')],'monitors':[]};}}catch(_0x2be555){utils[_0xf41f('0x14')](util[_0xf41f('0xf')](_0xf41f('0xc'),_0x3d795d[_0xf41f('0xd')]),_0x2be555);}};exports['newstate']=function(_0x4e620e){try{utils['debug'](util[_0xf41f('0xf')](_0xf41f('0x15'),_0x4e620e['uniqueid']),_0x4e620e);if(!_['isNil'](recordings[_0x4e620e[_0xf41f('0xd')]])&&_0x4e620e[_0xf41f('0x16')]==0x6){utils[_0xf41f('0x2')](util[_0xf41f('0xf')](_0xf41f('0x17'),_0x4e620e[_0xf41f('0xd')],_0x4e620e[_0xf41f('0x11')],_0x4e620e[_0xf41f('0x13')]));}else if(!_[_0xf41f('0x18')](recordings[_0x4e620e[_0xf41f('0xe')]])&&_0x4e620e['channelstate']==0x6&&_0x4e620e[_0xf41f('0x11')]!=_0xf41f('0x19')){utils[_0xf41f('0x2')](util[_0xf41f('0xf')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x4e620e[_0xf41f('0xd')],_0x4e620e[_0xf41f('0xe')],_0x4e620e[_0xf41f('0x11')],_0x4e620e[_0xf41f('0x13')]));recordings[_0x4e620e[_0xf41f('0xe')]]['accountcode']=_0x4e620e[_0xf41f('0x5')];}}catch(_0x3f4af9){utils['error'](util[_0xf41f('0xf')](_0xf41f('0x15'),_0x4e620e[_0xf41f('0xd')]),_0x3f4af9);}};exports[_0xf41f('0x1a')]=function(_0x50cfa){try{if(!_[_0xf41f('0x18')](_0x50cfa[_0xf41f('0x1b')])&&!_[_0xf41f('0x18')](_0x50cfa[_0xf41f('0x1b')][_0xf41f('0x1c')])){utils[_0xf41f('0xb')](util[_0xf41f('0xf')](_0xf41f('0x1d'),_0x50cfa[_0xf41f('0xd')]),_0x50cfa);utils[_0xf41f('0x2')](util['format'](_0xf41f('0x1e'),_0x50cfa[_0xf41f('0xd')],_0x50cfa[_0xf41f('0x1b')],_0x50cfa[_0xf41f('0x1f')]));if(_[_0xf41f('0x20')](_0x50cfa[_0xf41f('0x1f')],_0xf41f('0x21'))){_0x50cfa[_0xf41f('0x1f')]=_0x50cfa['value'][_0xf41f('0x22')](_0xf41f('0x21'),_0xf41f('0x23'));}if(recordings[_0x50cfa[_0xf41f('0xe')]]){var _0x175063=_[_0xf41f('0x24')](recordings[_0x50cfa[_0xf41f('0xe')]][_0xf41f('0x25')],{'value':_0x50cfa[_0xf41f('0x1f')]});if(_[_0xf41f('0x18')](_0x175063)){recordings[_0x50cfa[_0xf41f('0xe')]]['monitors'][_0xf41f('0x26')]({'value':_0x50cfa[_0xf41f('0x1f')]});}}}}catch(_0x230833){utils[_0xf41f('0x14')](util[_0xf41f('0xf')]('[%s][recordings][varset]',_0x50cfa[_0xf41f('0xd')]),_0x230833);}};exports[_0xf41f('0x27')]=function(_0x4933b8){try{if(!_[_0xf41f('0x18')](recordings[_0x4933b8[_0xf41f('0xd')]])){utils[_0xf41f('0xb')](util[_0xf41f('0xf')](_0xf41f('0x28'),_0x4933b8[_0xf41f('0xd')]),_0x4933b8);utils[_0xf41f('0x2')](util[_0xf41f('0xf')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x4933b8[_0xf41f('0xd')],_0x4933b8[_0xf41f('0x29')],_0x4933b8[_0xf41f('0x2a')],_0x4933b8['cause-txt']));recordings[_0x4933b8[_0xf41f('0xd')]][_0xf41f('0x29')]=_0x4933b8[_0xf41f('0x29')];recordings[_0x4933b8[_0xf41f('0xd')]][_0xf41f('0x2a')]=_0x4933b8[_0xf41f('0x2a')];recordings[_0x4933b8[_0xf41f('0xd')]][_0xf41f('0x2b')]=_0x4933b8[_0xf41f('0x2b')];recordings[_0x4933b8[_0xf41f('0xd')]][_0xf41f('0x2c')]=_0x4933b8[_0xf41f('0x2c')];if(recordings[_0x4933b8[_0xf41f('0xd')]][_0xf41f('0x2d')]=='outbound'&&recordings[_0x4933b8['uniqueid']][_0xf41f('0x5')]){recordings[_0x4933b8[_0xf41f('0xd')]][_0xf41f('0x2b')]=recordings[_0x4933b8[_0xf41f('0xd')]][_0xf41f('0x5')];recordings[_0x4933b8[_0xf41f('0xd')]][_0xf41f('0x2c')]='';}recordings[_0x4933b8[_0xf41f('0xd')]][_0xf41f('0x25')][_0xf41f('0x2e')](function(_0x250181){var _0x401eb4=_[_0xf41f('0x2f')](recordings[_0x4933b8['uniqueid']]);_0x401eb4[_0xf41f('0x1f')]=_0x250181[_0xf41f('0x1f')];writeDB(_0x401eb4);});delete recordings[_0x4933b8['uniqueid']];}}catch(_0x2dddcc){utils[_0xf41f('0x14')](util[_0xf41f('0xf')]('[%s][recordings][hangup]',_0x4933b8[_0xf41f('0xd')]),_0x2dddcc);}};exports['newexten']=function(_0x195e9b){try{if(!_['isNil'](recordings[_0x195e9b['uniqueid']])){utils[_0xf41f('0xb')](util[_0xf41f('0xf')](_0xf41f('0x30'),_0x195e9b[_0xf41f('0xd')]),_0x195e9b);utils[_0xf41f('0x2')](util[_0xf41f('0xf')](_0xf41f('0x31'),_0x195e9b[_0xf41f('0xd')],_0x195e9b['application'],_0x195e9b['appdata']));if(_0x195e9b[_0xf41f('0x32')][_0xf41f('0x33')]()==_0xf41f('0x34')&&_[_0xf41f('0x35')](_0x195e9b[_0xf41f('0x36')][_0xf41f('0x33')](),'cdr')){var _0x478d2d=_0x195e9b[_0xf41f('0x36')][_0xf41f('0x37')]('=');var _0x8d88f0=_0x478d2d[0x0][_0xf41f('0x38')](_0x478d2d[0x0][_0xf41f('0x39')]('(')+0x1,_0x478d2d[0x0][_0xf41f('0x39')](')'));var _0x1e68a8=_0x478d2d[0x1];recordings[_0x195e9b[_0xf41f('0xd')]][_0x8d88f0]=_0x1e68a8;}}}catch(_0x199c5c){utils['error'](util['format'](_0xf41f('0x30'),_0x195e9b[_0xf41f('0xd')]),_0x199c5c);}};exports[_0xf41f('0x3a')]=function(_0x15c417){try{if(!_['isNil'](recordings[_0x15c417[_0xf41f('0xd')]])){utils['debug'](util['format'](_0xf41f('0x3b'),_0x15c417[_0xf41f('0xd')]),_0x15c417);utils[_0xf41f('0x2')](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x15c417['uniqueid'],_0x15c417['queue']));recordings[_0x15c417[_0xf41f('0xd')]]['queue']=_0x15c417[_0xf41f('0x3c')];}}catch(_0x18edd9){utils[_0xf41f('0x14')](util['format']('[%s][recordings][queuecallerjoin]',_0x15c417[_0xf41f('0xd')]),_0x18edd9);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index ccb7d1f..11299f8 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 _0x2158=['lodash','util','./utils','info','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]'];(function(_0xd09d01,_0x54df3f){var _0x240eee=function(_0x5ee04e){while(--_0x5ee04e){_0xd09d01['push'](_0xd09d01['shift']());}};_0x240eee(++_0x54df3f);}(_0x2158,0x1bc));var _0x8215=function(_0x3dd47f,_0xb44712){_0x3dd47f=_0x3dd47f-0x0;var _0x442c6b=_0x2158[_0x3dd47f];return _0x442c6b;};'use strict';var _=require(_0x8215('0x0'));var util=require(_0x8215('0x1'));var utils=require(_0x8215('0x2'));function writeDB(_0x3277d3){utils[_0x8215('0x3')](util['format'](_0x8215('0x4'),_0x3277d3[_0x8215('0x5')]===_0x8215('0x6')?_0x3277d3[_0x8215('0x7')]:_0x3277d3[_0x8215('0x8')],_0x3277d3[_0x8215('0x5')]));utils[_0x8215('0x9')]('CreateVoiceTransferReport',_0x3277d3);}exports['blindtransfer']=function(_0x2712e0){try{utils['debug'](util[_0x8215('0xa')](_0x8215('0xb'),_0x2712e0[_0x8215('0x8')]),_0x2712e0);utils[_0x8215('0x3')](util[_0x8215('0xa')](_0x8215('0xc'),_0x2712e0[_0x8215('0x8')],_0x2712e0[_0x8215('0xd')],_0x2712e0[_0x8215('0xe')],_0x2712e0['transfereecalleridnum'],_0x2712e0['transfereecalleridname']));_0x2712e0[_0x8215('0x5')]='blind';writeDB(_0x2712e0);}catch(_0x3a06b4){utils[_0x8215('0xf')](util[_0x8215('0xa')]('[%s][transfers][blindtransfer]',_0x2712e0[_0x8215('0x8')]),_0x3a06b4);}};exports[_0x8215('0x10')]=function(_0x5cb159){try{utils[_0x8215('0x11')](util[_0x8215('0xa')]('[%s][transfers][attendedtransfer]',_0x5cb159[_0x8215('0x7')]),_0x5cb159);utils['info'](util[_0x8215('0xa')](_0x8215('0x12'),_0x5cb159[_0x8215('0x7')],_0x5cb159['origtransferercalleridnum'],_0x5cb159[_0x8215('0x13')],_0x5cb159[_0x8215('0x14')],_0x5cb159[_0x8215('0x15')]));_0x5cb159=_[_0x8215('0x16')](_0x5cb159,{'transfererchannel':_0x5cb159['origtransfererchannel'],'transferercalleridnum':_0x5cb159['origtransferercalleridnum'],'transferercalleridname':_0x5cb159[_0x8215('0x13')],'transfererconnectedlinenum':_0x5cb159[_0x8215('0x17')],'transfererconnectedlinename':_0x5cb159[_0x8215('0x18')],'transfereraccountcode':_0x5cb159[_0x8215('0x19')],'transferercontext':_0x5cb159[_0x8215('0x1a')],'transfererexten':_0x5cb159['secondtransfererexten'],'transfererlinkedid':_0x5cb159[_0x8215('0x1b')],'context':_0x5cb159['origtransferercontext'],'extension':_0x5cb159['origtransfererexten'],'type':_0x8215('0x6')});if(_[_0x8215('0x1c')](_0x5cb159[_0x8215('0x1d')])){_0x5cb159=_[_0x8215('0x16')](_0x5cb159,{'transfereechannel':_0x5cb159[_0x8215('0x1e')],'transfereecalleridnum':_0x5cb159['transfertargetcalleridnum'],'transfereecalleridname':_0x5cb159[_0x8215('0x15')],'transfereeconnectedlinenum':_0x5cb159[_0x8215('0x1f')],'transfereeconnectedlinename':_0x5cb159['transfertargetconnectedlinename'],'transfereeaccountcode':_0x5cb159[_0x8215('0x20')],'transfereecontext':_0x5cb159[_0x8215('0x21')],'transfereeexten':_0x5cb159[_0x8215('0x22')],'transfereelinkedid':_0x5cb159[_0x8215('0x23')]});}writeDB(_0x5cb159);}catch(_0x24d2a9){utils[_0x8215('0xf')](util['format'](_0x8215('0x24'),_0x5cb159[_0x8215('0x7')]),_0x24d2a9);}}; \ No newline at end of file +var _0xe5aa=['transfereecalleridnum','transfereecalleridname','blind','error','info','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','request','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','transferercalleridnum','transferercalleridname'];(function(_0x3e0d09,_0x575da7){var _0x1c129e=function(_0x3accf7){while(--_0x3accf7){_0x3e0d09['push'](_0x3e0d09['shift']());}};_0x1c129e(++_0x575da7);}(_0xe5aa,0x1d2));var _0xae5a=function(_0x3fb709,_0x53e721){_0x3fb709=_0x3fb709-0x0;var _0x29a0ee=_0xe5aa[_0x3fb709];return _0x29a0ee;};'use strict';var _=require(_0xae5a('0x0'));var util=require(_0xae5a('0x1'));var utils=require(_0xae5a('0x2'));function writeDB(_0x37d13f){utils['info'](util[_0xae5a('0x3')](_0xae5a('0x4'),_0x37d13f[_0xae5a('0x5')]==='attended'?_0x37d13f[_0xae5a('0x6')]:_0x37d13f['uniqueid'],_0x37d13f['type']));utils[_0xae5a('0x7')]('CreateVoiceTransferReport',_0x37d13f);}exports[_0xae5a('0x8')]=function(_0x1e4fd8){try{utils[_0xae5a('0x9')](util[_0xae5a('0x3')](_0xae5a('0xa'),_0x1e4fd8[_0xae5a('0xb')]),_0x1e4fd8);utils['info'](util[_0xae5a('0x3')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x1e4fd8[_0xae5a('0xb')],_0x1e4fd8[_0xae5a('0xc')],_0x1e4fd8[_0xae5a('0xd')],_0x1e4fd8[_0xae5a('0xe')],_0x1e4fd8[_0xae5a('0xf')]));_0x1e4fd8[_0xae5a('0x5')]=_0xae5a('0x10');writeDB(_0x1e4fd8);}catch(_0x198e4b){utils[_0xae5a('0x11')](util[_0xae5a('0x3')](_0xae5a('0xa'),_0x1e4fd8[_0xae5a('0xb')]),_0x198e4b);}};exports['attendedtransfer']=function(_0x3a254b){try{utils[_0xae5a('0x9')](util[_0xae5a('0x3')]('[%s][transfers][attendedtransfer]',_0x3a254b['origtransfereruniqueid']),_0x3a254b);utils[_0xae5a('0x12')](util[_0xae5a('0x3')](_0xae5a('0x13'),_0x3a254b[_0xae5a('0x6')],_0x3a254b[_0xae5a('0x14')],_0x3a254b[_0xae5a('0x15')],_0x3a254b[_0xae5a('0x16')],_0x3a254b[_0xae5a('0x17')]));_0x3a254b=_[_0xae5a('0x18')](_0x3a254b,{'transfererchannel':_0x3a254b[_0xae5a('0x19')],'transferercalleridnum':_0x3a254b[_0xae5a('0x14')],'transferercalleridname':_0x3a254b[_0xae5a('0x15')],'transfererconnectedlinenum':_0x3a254b[_0xae5a('0x1a')],'transfererconnectedlinename':_0x3a254b[_0xae5a('0x1b')],'transfereraccountcode':_0x3a254b['origtransfereraccountcode'],'transferercontext':_0x3a254b[_0xae5a('0x1c')],'transfererexten':_0x3a254b[_0xae5a('0x1d')],'transfererlinkedid':_0x3a254b[_0xae5a('0x1e')],'context':_0x3a254b[_0xae5a('0x1f')],'extension':_0x3a254b['origtransfererexten'],'type':'attended'});if(_[_0xae5a('0x20')](_0x3a254b[_0xae5a('0x21')])){_0x3a254b=_[_0xae5a('0x18')](_0x3a254b,{'transfereechannel':_0x3a254b[_0xae5a('0x22')],'transfereecalleridnum':_0x3a254b[_0xae5a('0x16')],'transfereecalleridname':_0x3a254b[_0xae5a('0x17')],'transfereeconnectedlinenum':_0x3a254b['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x3a254b[_0xae5a('0x23')],'transfereeaccountcode':_0x3a254b[_0xae5a('0x24')],'transfereecontext':_0x3a254b[_0xae5a('0x25')],'transfereeexten':_0x3a254b[_0xae5a('0x26')],'transfereelinkedid':_0x3a254b[_0xae5a('0x27')]});}writeDB(_0x3a254b);}catch(_0x4c5964){utils[_0xae5a('0x11')](util[_0xae5a('0x3')]('[%s][transfers][attendedtransfer]',_0x3a254b[_0xae5a('0x6')]),_0x4c5964);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index ac4e750..b05dc76 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 _0xa0ab=['[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','moment','util','http','../../config/logger','xdr','debug','error','inspect','request','[utils][request]\x20name:%s','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','result','length','then','info','notfound','catch','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]'];(function(_0x70939f,_0x4de6ad){var _0x78bc23=function(_0x236a16){while(--_0x236a16){_0x70939f['push'](_0x70939f['shift']());}};_0x78bc23(++_0x4de6ad);}(_0xa0ab,0x1eb));var _0xba0a=function(_0x5c31de,_0x52974a){_0x5c31de=_0x5c31de-0x0;var _0x401eeb=_0xa0ab[_0x5c31de];return _0x401eeb;};'use strict';var BPromise=require(_0xba0a('0x0'));var jayson=require('jayson/promise');var moment=require(_0xba0a('0x1'));var util=require(_0xba0a('0x2'));var client=jayson['client'][_0xba0a('0x3')]({'port':0x2329});var logger=require(_0xba0a('0x4'))(_0xba0a('0x5'));exports['info']=function(_0x5390c1,_0x28cd6b){logger['info'](_0x5390c1,_0x28cd6b?util['inspect'](_0x28cd6b,{'showHidden':![],'depth':null}):'');};exports[_0xba0a('0x6')]=function(_0x5d90b8,_0x345a3c){logger['debug'](_0x5d90b8,_0x345a3c?util['inspect'](_0x345a3c,{'showHidden':![],'depth':null}):'');};exports[_0xba0a('0x7')]=function(_0x4adcc2,_0x46a5d9){logger[_0xba0a('0x7')](_0x4adcc2,_0x46a5d9?util[_0xba0a('0x8')](_0x46a5d9,{'showHidden':![],'depth':null}):'');};exports[_0xba0a('0x9')]=function(_0x1d3cc1,_0x2e7ac9){return client[_0xba0a('0x9')](_0x1d3cc1,{'body':_0x2e7ac9})['then'](function(_0x35e1a6){logger[_0xba0a('0x6')](_0xba0a('0xa'),_0x1d3cc1,_0x35e1a6?util[_0xba0a('0x8')](_0x35e1a6,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x1c6d1d){logger['error'](_0xba0a('0xa'),_0x1d3cc1,_0x1c6d1d?util[_0xba0a('0x8')](_0x1c6d1d,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5dff25){return client[_0xba0a('0x9')](_0xba0a('0xb'),{'options':{'raw':!![],'attributes':['id',_0xba0a('0xc'),_0xba0a('0xd'),_0xba0a('0xe')],'where':_0x5dff25,'limit':0x1}})['then'](function(_0x166a0f){logger[_0xba0a('0x6')](_0xba0a('0xf'),JSON['stringify'](_0x5dff25),_0x166a0f?util[_0xba0a('0x8')](_0x166a0f,{'showHidden':![],'depth':null}):'');return _0x166a0f[_0xba0a('0x10')][_0xba0a('0x11')]?_0x166a0f[_0xba0a('0x10')][0x0]:null;});}exports['getUserByInternal']=function(_0x3ed258){return new BPromise(function(_0x2af15b,_0x5372ab){if(_0x3ed258){return getUser({'internal':_0x3ed258})[_0xba0a('0x12')](function(_0x25fee3){logger[_0xba0a('0x13')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x3ed258,_0x25fee3?'found':_0xba0a('0x14'));return _0x2af15b(_0x25fee3);})[_0xba0a('0x15')](function(_0x3f0023){logger[_0xba0a('0x7')]('[utils][getUserByInternal]',_0x3f0023?util[_0xba0a('0x8')](_0x3f0023,{'showHidden':![],'depth':null}):'');return _0x2af15b(null);});}return _0x2af15b(null);});};exports[_0xba0a('0x16')]=function(_0xed25e5){return new BPromise(function(_0x100af0,_0x5ed698){if(_0xed25e5){return getUser({'interface':_0xed25e5})[_0xba0a('0x12')](function(_0x215721){logger[_0xba0a('0x13')](_0xba0a('0x17'),_0xed25e5,_0x215721?_0xba0a('0x18'):'notfound');return _0x100af0(_0x215721);})[_0xba0a('0x15')](function(_0x3ed6a9){logger['error'](_0xba0a('0x19'),_0x3ed6a9?util[_0xba0a('0x8')](_0x3ed6a9,{'showHidden':![],'depth':null}):'');return _0x100af0(null);});}return _0x100af0(null);});};exports['getUserByName']=function(_0xa5594c){return new BPromise(function(_0xb5849e,_0xa42145){if(_0xa5594c){return getUser({'name':_0xa5594c})['then'](function(_0x2a2ed4){logger[_0xba0a('0x13')](_0xba0a('0x1a'),_0xa5594c,_0x2a2ed4?_0xba0a('0x18'):'notfound');return _0xb5849e(_0x2a2ed4);})[_0xba0a('0x15')](function(_0x6d3d0c){logger['error'](_0xba0a('0x1b'),_0x6d3d0c?util[_0xba0a('0x8')](_0x6d3d0c,{'showHidden':![],'depth':null}):'');return _0xb5849e(null);});}return _0xb5849e(null);});};exports['getVoiceQueueByName']=function(_0x4aff6e){return new BPromise(function(_0x5b2731,_0x5946ef){if(_0x4aff6e){return client['request'](_0xba0a('0x1c'),{'options':{'raw':!![],'attributes':['id','name',_0xba0a('0x1d'),_0xba0a('0x1e'),_0xba0a('0x1f')],'where':{'name':_0x4aff6e},'limit':0x1}})[_0xba0a('0x12')](function(_0xf1147c){logger[_0xba0a('0x6')]('[utils][getVoiceQueueByName]\x20name:%s',_0x4aff6e,_0xf1147c?util[_0xba0a('0x8')](_0xf1147c,{'showHidden':![],'depth':null}):'');logger[_0xba0a('0x13')](_0xba0a('0x20'),_0x4aff6e,_0xf1147c?_0xba0a('0x18'):_0xba0a('0x14'));return _0x5b2731(_0xf1147c[_0xba0a('0x10')][_0xba0a('0x11')]?_0xf1147c[_0xba0a('0x10')][0x0]:null);})[_0xba0a('0x15')](function(_0x535bb8){logger[_0xba0a('0x7')](_0xba0a('0x21'),_0x535bb8?util[_0xba0a('0x8')](_0x535bb8,{'showHidden':![],'depth':null}):'');return _0x5b2731(null);});}return _0x5b2731(null);});};exports[_0xba0a('0x22')]=function(_0x2c8852,_0x410255){return moment(_0x2c8852)[_0xba0a('0x23')](_0x410255,_0xba0a('0x24'))[_0xba0a('0x25')](_0xba0a('0x26'));};exports[_0xba0a('0x27')]=function(_0x50207c,_0x45d039){return moment(_0x50207c)[_0xba0a('0x28')](_0x45d039,'seconds')[_0xba0a('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xba0a('0x29')]=function(_0x29d8af,_0x402771){return moment(_0x29d8af)[_0xba0a('0x2a')](moment(_0x402771),_0xba0a('0x24'));};exports[_0xba0a('0x2b')]=function(_0xcf420e,_0x4ccf3c){return parseInt(_0xcf420e,0xa)+parseInt(_0x4ccf3c,0xa);};exports[_0xba0a('0x2c')]=function(){return moment()[_0xba0a('0x25')](_0xba0a('0x26'));};exports['isAfter']=function(_0x17cbc3,_0x4bb81f){if(_0x4bb81f){return moment(_0x17cbc3)[_0xba0a('0x2d')](_0x4bb81f);}return!![];};exports[_0xba0a('0x2e')]=function(_0x18ff2a,_0x3bbbcd){if(_0x3bbbcd){return moment(_0x18ff2a)[_0xba0a('0x2e')](_0x3bbbcd);}else if(_0x18ff2a){return!![];}return![];}; \ No newline at end of file +var _0xbd03=['acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','client','http','../../config/logger','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type'];(function(_0x25721f,_0x51b494){var _0xfec92c=function(_0x9e07d8){while(--_0x9e07d8){_0x25721f['push'](_0x25721f['shift']());}};_0xfec92c(++_0x51b494);}(_0xbd03,0xcf));var _0x3bd0=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xbd03[_0x484e36];return _0xafc85d;};'use strict';var BPromise=require(_0x3bd0('0x0'));var jayson=require(_0x3bd0('0x1'));var moment=require('moment');var util=require('util');var client=jayson[_0x3bd0('0x2')][_0x3bd0('0x3')]({'port':0x2329});var logger=require(_0x3bd0('0x4'))('xdr');exports[_0x3bd0('0x5')]=function(_0x45ce0b,_0x4e6d90){logger[_0x3bd0('0x5')](_0x45ce0b,_0x4e6d90?util[_0x3bd0('0x6')](_0x4e6d90,{'showHidden':![],'depth':null}):'');};exports[_0x3bd0('0x7')]=function(_0x4816c,_0x354b3e){logger['debug'](_0x4816c,_0x354b3e?util['inspect'](_0x354b3e,{'showHidden':![],'depth':null}):'');};exports[_0x3bd0('0x8')]=function(_0xd605e9,_0x3916c4){logger[_0x3bd0('0x8')](_0xd605e9,_0x3916c4?util[_0x3bd0('0x6')](_0x3916c4,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x3965d1,_0x1634c){return client[_0x3bd0('0x9')](_0x3965d1,{'body':_0x1634c})[_0x3bd0('0xa')](function(_0x4e370e){logger[_0x3bd0('0x7')](_0x3bd0('0xb'),_0x3965d1,_0x4e370e?util[_0x3bd0('0x6')](_0x4e370e,{'showHidden':![],'depth':null}):'');})[_0x3bd0('0xc')](function(_0x2f22bf){logger[_0x3bd0('0x8')](_0x3bd0('0xb'),_0x3965d1,_0x2f22bf?util['inspect'](_0x2f22bf,{'showHidden':![],'depth':null}):'');});};function getUser(_0x32a299){return client[_0x3bd0('0x9')](_0x3bd0('0xd'),{'options':{'raw':!![],'attributes':['id',_0x3bd0('0xe'),_0x3bd0('0xf'),_0x3bd0('0x10')],'where':_0x32a299,'limit':0x1}})[_0x3bd0('0xa')](function(_0x53e24c){logger[_0x3bd0('0x7')](_0x3bd0('0x11'),JSON['stringify'](_0x32a299),_0x53e24c?util[_0x3bd0('0x6')](_0x53e24c,{'showHidden':![],'depth':null}):'');return _0x53e24c[_0x3bd0('0x12')][_0x3bd0('0x13')]?_0x53e24c[_0x3bd0('0x12')][0x0]:null;});}exports[_0x3bd0('0x14')]=function(_0x51bee5){return new BPromise(function(_0x32a42c,_0xe2a47d){if(_0x51bee5){return getUser({'internal':_0x51bee5})[_0x3bd0('0xa')](function(_0x25343e){logger[_0x3bd0('0x5')](_0x3bd0('0x15'),_0x51bee5,_0x25343e?_0x3bd0('0x16'):_0x3bd0('0x17'));return _0x32a42c(_0x25343e);})[_0x3bd0('0xc')](function(_0xb74267){logger[_0x3bd0('0x8')](_0x3bd0('0x18'),_0xb74267?util[_0x3bd0('0x6')](_0xb74267,{'showHidden':![],'depth':null}):'');return _0x32a42c(null);});}return _0x32a42c(null);});};exports['getUserByInterface']=function(_0x223585){return new BPromise(function(_0x52ec7d,_0x362614){if(_0x223585){return getUser({'interface':_0x223585})[_0x3bd0('0xa')](function(_0x2d2109){logger[_0x3bd0('0x5')](_0x3bd0('0x19'),_0x223585,_0x2d2109?_0x3bd0('0x16'):_0x3bd0('0x17'));return _0x52ec7d(_0x2d2109);})[_0x3bd0('0xc')](function(_0x3151d9){logger[_0x3bd0('0x8')](_0x3bd0('0x1a'),_0x3151d9?util[_0x3bd0('0x6')](_0x3151d9,{'showHidden':![],'depth':null}):'');return _0x52ec7d(null);});}return _0x52ec7d(null);});};exports[_0x3bd0('0x1b')]=function(_0x22933e){return new BPromise(function(_0x2ac56c,_0x1c935b){if(_0x22933e){return getUser({'name':_0x22933e})['then'](function(_0x183430){logger[_0x3bd0('0x5')](_0x3bd0('0x1c'),_0x22933e,_0x183430?_0x3bd0('0x16'):_0x3bd0('0x17'));return _0x2ac56c(_0x183430);})['catch'](function(_0x2c4c77){logger[_0x3bd0('0x8')](_0x3bd0('0x1d'),_0x2c4c77?util[_0x3bd0('0x6')](_0x2c4c77,{'showHidden':![],'depth':null}):'');return _0x2ac56c(null);});}return _0x2ac56c(null);});};exports[_0x3bd0('0x1e')]=function(_0x35960a){return new BPromise(function(_0x1b504d,_0x1d0086){if(_0x35960a){return client[_0x3bd0('0x9')](_0x3bd0('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x3bd0('0xf'),_0x3bd0('0x20'),'acw',_0x3bd0('0x21')],'where':{'name':_0x35960a},'limit':0x1}})[_0x3bd0('0xa')](function(_0x2e6486){logger[_0x3bd0('0x7')](_0x3bd0('0x22'),_0x35960a,_0x2e6486?util[_0x3bd0('0x6')](_0x2e6486,{'showHidden':![],'depth':null}):'');logger['info'](_0x3bd0('0x23'),_0x35960a,_0x2e6486?_0x3bd0('0x16'):_0x3bd0('0x17'));return _0x1b504d(_0x2e6486[_0x3bd0('0x12')][_0x3bd0('0x13')]?_0x2e6486[_0x3bd0('0x12')][0x0]:null);})['catch'](function(_0x5321da){logger[_0x3bd0('0x8')](_0x3bd0('0x24'),_0x5321da?util['inspect'](_0x5321da,{'showHidden':![],'depth':null}):'');return _0x1b504d(null);});}return _0x1b504d(null);});};exports[_0x3bd0('0x25')]=function(_0x55d7d9,_0x21cb43){return moment(_0x55d7d9)['add'](_0x21cb43,_0x3bd0('0x26'))[_0x3bd0('0x27')](_0x3bd0('0x28'));};exports[_0x3bd0('0x29')]=function(_0x10a417,_0x3d6394){return moment(_0x10a417)[_0x3bd0('0x2a')](_0x3d6394,'seconds')['format'](_0x3bd0('0x28'));};exports['diffTime']=function(_0x23388f,_0x4c792e){return moment(_0x23388f)[_0x3bd0('0x2b')](moment(_0x4c792e),_0x3bd0('0x26'));};exports[_0x3bd0('0x2c')]=function(_0x1316c0,_0x56ffb0){return parseInt(_0x1316c0,0xa)+parseInt(_0x56ffb0,0xa);};exports[_0x3bd0('0x2d')]=function(){return moment()[_0x3bd0('0x27')](_0x3bd0('0x28'));};exports[_0x3bd0('0x2e')]=function(_0x3d4a52,_0x91eb19){if(_0x91eb19){return moment(_0x3d4a52)['isAfter'](_0x91eb19);}return!![];};exports[_0x3bd0('0x2f')]=function(_0x17171b,_0x5a9f9b){if(_0x5a9f9b){return moment(_0x17171b)[_0x3bd0('0x2f')](_0x5a9f9b);}else if(_0x17171b){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 8fee7aa..26ddc99 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 _0xd64b=['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)','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','./loggers','./mask-sensitive-data','maskSensitiveData','join','log','role','name','ensureDir','then','client','user','no-user','data','timestamp','catch','error','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode'];(function(_0x5a983b,_0x55ff9c){var _0x41df48=function(_0xab41f8){while(--_0xab41f8){_0x5a983b['push'](_0x5a983b['shift']());}};_0x41df48(++_0x55ff9c);}(_0xd64b,0x18a));var _0xbd64=function(_0x537c37,_0x536e74){_0x537c37=_0x537c37-0x0;var _0x241f84=_0xd64b[_0x537c37];return _0x241f84;};var fs=require(_0xbd64('0x0'));var _=require(_0xbd64('0x1'));var ewinston=require(_0xbd64('0x2'));var path=require(_0xbd64('0x3'));var util=require('util');var fileLogger=require(_0xbd64('0x4'))['fileLogger'];var safeTemplate=require('./safe-template')['safeTemplate'];var maskSensitiveData=require(_0xbd64('0x5'))[_0xbd64('0x6')];function ClientSideLogger(){function _0x346ab8(_0x42517f){var _0x52992f=path[_0xbd64('0x7')]('/var',_0xbd64('0x8'),'xcally');var _0x230a33=path['join']('client',_0x42517f[_0xbd64('0x9')]+'-'+_0x42517f[_0xbd64('0xa')]);return fs[_0xbd64('0xb')](path[_0xbd64('0x7')](_0x52992f,_0x230a33))[_0xbd64('0xc')](function(){var _0x465bb3=fileLogger(_0xbd64('0xd'),path[_0xbd64('0x7')](_0x52992f,_0x230a33));return _0x465bb3;})['catch'](function(_0x3b90c8){throw _0x3b90c8;});}this[_0xbd64('0x8')]=function(_0x3b19be,_0x299d42,_0x5bb888,_0x1dedf3){return _0x346ab8(_0x3b19be[_0xbd64('0xe')])[_0xbd64('0xc')](function(_0x2aa274){var _0x55512e=_0x2aa274[_0x299d42];return _0x55512e;})[_0xbd64('0xc')](function(_0x12948f){var _0x3a546b=_0x3b19be[_0xbd64('0xe')]?_0x3b19be[_0xbd64('0xe')]['id']:_0xbd64('0xf');var _0x2641e2=_0x1dedf3[_0xbd64('0x10')];var _0xa4c71e=_0x1dedf3[_0xbd64('0x11')];var _0x1fe996=new Date(Number(_0xa4c71e));return _0x12948f(_0x3a546b,_0x1fe996,_0x5bb888,_0x2641e2);})[_0xbd64('0x12')](function(_0x134e91){fileLogger(_0xbd64('0xd'))[_0xbd64('0x13')](_0x134e91);});};}function setupLoggers(_0x5e8039){return new Promise(function(_0x4f0036){var _0x309391=new ClientSideLogger();var _0x1a21af=fileLogger(_0xbd64('0x14'));var _0x3c97ce=fileLogger(_0xbd64('0x15'));_0x5e8039[_0xbd64('0x16')](_0xbd64('0x17'),_0x309391);_0x5e8039[_0xbd64('0x18')](ewinston[_0xbd64('0x19')]({'winstonInstance':_0x1a21af,'meta':![],'statusLevels':!![],'msg':function(_0x1f8ca5,_0x56dc98){var _0x29f874=_0xbd64('0x1a');if(!_[_0xbd64('0x1b')](_0x1f8ca5[_0xbd64('0x1c')])){_0x29f874+=_0xbd64('0x1d');var _0x317210=_0x1f8ca5['body'];maskSensitiveData(_0x317210);}return safeTemplate(util[_0xbd64('0x1e')](_0x29f874,_0x1f8ca5[_0xbd64('0x1f')],_0x1f8ca5[_0xbd64('0x20')][_0xbd64('0x21')]?_0x1f8ca5[_0xbd64('0x20')][_0xbd64('0x21')]:_0x1f8ca5[_0xbd64('0x22')][_0xbd64('0x23')]||_0x1f8ca5['ip'],_0x1f8ca5[_0xbd64('0x24')],_0x56dc98[_0xbd64('0x25')],_0x56dc98[_0xbd64('0x26')],_0x1f8ca5[_0xbd64('0xe')]?_0x1f8ca5[_0xbd64('0xe')]['id']:null,_0x1f8ca5['user']?_0x1f8ca5[_0xbd64('0xe')]['name']:null,_0x1f8ca5['user']?_0x1f8ca5[_0xbd64('0xe')][_0xbd64('0x9')]:null,_0x317210?util[_0xbd64('0x27')](_0x317210,![],null):''));}}));_0x5e8039['use'](ewinston[_0xbd64('0x19')]({'winstonInstance':_0x3c97ce,'meta':![],'statusLevels':!![],'msg':function(_0x428cda,_0x1a39ec){var _0x29e2f1=_0xbd64('0x28');if(_0x428cda[_0xbd64('0x1c')]&&_0x428cda[_0xbd64('0x1c')][_0xbd64('0x29')]&&_0x428cda[_0xbd64('0x1c')][_0xbd64('0x2a')]){_0x29e2f1=_0xbd64('0x2b');}return util['format'](_0x29e2f1,_0x428cda[_0xbd64('0x1f')],_0x428cda[_0xbd64('0x20')][_0xbd64('0x21')]?_0x428cda[_0xbd64('0x20')]['x-forwarded-for']:_0x428cda[_0xbd64('0x22')]['remoteAddress']||_0x428cda['ip'],_0x428cda[_0xbd64('0x24')],_0x1a39ec[_0xbd64('0x25')],_0x1a39ec[_0xbd64('0x26')],_0x428cda[_0xbd64('0xe')]?_0x428cda[_0xbd64('0xe')]['id']:null,_0x428cda[_0xbd64('0xe')]?_0x428cda[_0xbd64('0xe')][_0xbd64('0xa')]:null,_0x428cda['user']?_0x428cda[_0xbd64('0xe')][_0xbd64('0x9')]:null,_0x428cda[_0xbd64('0x1c')]&&_0x428cda[_0xbd64('0x1c')]['device']?_0x428cda['body']['device']:_0xbd64('0x2c'),_0x428cda[_0xbd64('0x1c')]&&_0x428cda[_0xbd64('0x1c')][_0xbd64('0x2a')]?_0x428cda[_0xbd64('0x1c')][_0xbd64('0x2a')]:'',_0x428cda[_0xbd64('0x1c')]&&_0x428cda[_0xbd64('0x1c')][_0xbd64('0x2d')]?_0x428cda[_0xbd64('0x1c')][_0xbd64('0x2d')]:'');},'ignoreRoute':function(_0xf5d06b){var _0x16ed48=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x16ed48[_0xbd64('0x2e')](_0xf5d06b[_0xbd64('0x24')]);}}));return _0x4f0036();});}exports[_0xbd64('0x2f')]=setupLoggers; \ No newline at end of file +var _0x5e40=['%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)','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','path','fileLogger','./safe-template','safeTemplate','maskSensitiveData','join','/var','log','client','role','ensureDir','catch','then','no-user','timestamp','error','api','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','inspect'];(function(_0x546f1d,_0x3d129b){var _0x5b4368=function(_0x42b973){while(--_0x42b973){_0x546f1d['push'](_0x546f1d['shift']());}};_0x5b4368(++_0x3d129b);}(_0x5e40,0x1ca));var _0x05e4=function(_0x1348c0,_0x7a9608){_0x1348c0=_0x1348c0-0x0;var _0x8a6441=_0x5e40[_0x1348c0];return _0x8a6441;};var fs=require(_0x05e4('0x0'));var _=require(_0x05e4('0x1'));var ewinston=require(_0x05e4('0x2'));var path=require(_0x05e4('0x3'));var util=require('util');var fileLogger=require('./loggers')[_0x05e4('0x4')];var safeTemplate=require(_0x05e4('0x5'))[_0x05e4('0x6')];var maskSensitiveData=require('./mask-sensitive-data')[_0x05e4('0x7')];function ClientSideLogger(){function _0x2f0883(_0x35025d){var _0x322a24=path[_0x05e4('0x8')](_0x05e4('0x9'),_0x05e4('0xa'),'xcally');var _0x2babf2=path[_0x05e4('0x8')](_0x05e4('0xb'),_0x35025d[_0x05e4('0xc')]+'-'+_0x35025d['name']);return fs[_0x05e4('0xd')](path['join'](_0x322a24,_0x2babf2))['then'](function(){var _0x4746e1=fileLogger(_0x05e4('0xb'),path[_0x05e4('0x8')](_0x322a24,_0x2babf2));return _0x4746e1;})[_0x05e4('0xe')](function(_0x300639){throw _0x300639;});}this['log']=function(_0x529a82,_0x484d75,_0xce537b,_0x442782){return _0x2f0883(_0x529a82['user'])[_0x05e4('0xf')](function(_0x2eae06){var _0x5ecd45=_0x2eae06[_0x484d75];return _0x5ecd45;})[_0x05e4('0xf')](function(_0xc71f63){var _0x371fc3=_0x529a82['user']?_0x529a82['user']['id']:_0x05e4('0x10');var _0x1544ff=_0x442782['data'];var _0x3ce69b=_0x442782[_0x05e4('0x11')];var _0x4b1950=new Date(Number(_0x3ce69b));return _0xc71f63(_0x371fc3,_0x4b1950,_0xce537b,_0x1544ff);})[_0x05e4('0xe')](function(_0x50b83a){fileLogger(_0x05e4('0xb'))[_0x05e4('0x12')](_0x50b83a);});};}function setupLoggers(_0x3b7348){return new Promise(function(_0x304733){var _0x1236ac=new ClientSideLogger();var _0x50520d=fileLogger(_0x05e4('0x13'));var _0x524cb8=fileLogger('auth');_0x3b7348['set'](_0x05e4('0x14'),_0x1236ac);_0x3b7348[_0x05e4('0x15')](ewinston[_0x05e4('0x16')]({'winstonInstance':_0x50520d,'meta':![],'statusLevels':!![],'msg':function(_0x163621,_0x135391){var _0x10614f=_0x05e4('0x17');if(!_['isEmpty'](_0x163621[_0x05e4('0x18')])){_0x10614f+='\x20body=%s';var _0x3a9985=_0x163621['body'];maskSensitiveData(_0x3a9985);}return safeTemplate(util[_0x05e4('0x19')](_0x10614f,_0x163621[_0x05e4('0x1a')],_0x163621[_0x05e4('0x1b')][_0x05e4('0x1c')]?_0x163621[_0x05e4('0x1b')][_0x05e4('0x1c')]:_0x163621[_0x05e4('0x1d')][_0x05e4('0x1e')]||_0x163621['ip'],_0x163621[_0x05e4('0x1f')],_0x135391[_0x05e4('0x20')],_0x135391[_0x05e4('0x21')],_0x163621[_0x05e4('0x22')]?_0x163621['user']['id']:null,_0x163621[_0x05e4('0x22')]?_0x163621[_0x05e4('0x22')][_0x05e4('0x23')]:null,_0x163621[_0x05e4('0x22')]?_0x163621[_0x05e4('0x22')][_0x05e4('0xc')]:null,_0x3a9985?util[_0x05e4('0x24')](_0x3a9985,![],null):''));}}));_0x3b7348[_0x05e4('0x15')](ewinston['logger']({'winstonInstance':_0x524cb8,'meta':![],'statusLevels':!![],'msg':function(_0x4c7105,_0x36f51a){var _0x1872bb=_0x05e4('0x25');if(_0x4c7105['body']&&_0x4c7105[_0x05e4('0x18')][_0x05e4('0x26')]&&_0x4c7105[_0x05e4('0x18')][_0x05e4('0x27')]){_0x1872bb=_0x05e4('0x28');}return util[_0x05e4('0x19')](_0x1872bb,_0x4c7105[_0x05e4('0x1a')],_0x4c7105[_0x05e4('0x1b')]['x-forwarded-for']?_0x4c7105[_0x05e4('0x1b')][_0x05e4('0x1c')]:_0x4c7105['connection'][_0x05e4('0x1e')]||_0x4c7105['ip'],_0x4c7105[_0x05e4('0x1f')],_0x36f51a['statusCode'],_0x36f51a[_0x05e4('0x21')],_0x4c7105[_0x05e4('0x22')]?_0x4c7105[_0x05e4('0x22')]['id']:null,_0x4c7105['user']?_0x4c7105[_0x05e4('0x22')][_0x05e4('0x23')]:null,_0x4c7105[_0x05e4('0x22')]?_0x4c7105['user'][_0x05e4('0xc')]:null,_0x4c7105[_0x05e4('0x18')]&&_0x4c7105[_0x05e4('0x18')][_0x05e4('0x26')]?_0x4c7105[_0x05e4('0x18')]['device']:_0x05e4('0x29'),_0x4c7105[_0x05e4('0x18')]&&_0x4c7105[_0x05e4('0x18')][_0x05e4('0x27')]?_0x4c7105[_0x05e4('0x18')]['agent_id']:'',_0x4c7105[_0x05e4('0x18')]&&_0x4c7105['body'][_0x05e4('0x2a')]?_0x4c7105['body'][_0x05e4('0x2a')]:'');},'ignoreRoute':function(_0x5eb320){var _0x31d670=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x31d670[_0x05e4('0x2b')](_0x5eb320[_0x05e4('0x1f')]);}}));return _0x304733();});}exports[_0x05e4('0x2c')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index b85d6bc..9f707e7 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32be=['Date\x20not\x20valid','isValid','split','locale','weekdaysShort','slice','concat','exports','monthsShort','toLowerCase','indexOf','circularMonthInterval','clone','hours','minutes','endOf','day','isBetween','timeCompare','dowCompare','max','min','domCompare','format','includes','monthCompare','test','isMoment','padStart','length','iftime','lodash','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x32be,0x8e));var _0xe32b=function(_0x40f991,_0x576819){_0x40f991=_0x40f991-0x0;var _0x38eca2=_0x32be[_0x40f991];return _0x38eca2;};var _=require(_0xe32b('0x0'));var moment=require(_0xe32b('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][_0xe32b('0x2')](function(_0x18b9e4){return _0x18b9e4[_0xe32b('0x3')];})[_0xe32b('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xe32b('0x5');var EINVALID_DATE=_0xe32b('0x6');function throwIfDateNotValid(_0x3c4840){if(!_0x3c4840[_0xe32b('0x7')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x5f2efc){var _0x4bd5de=_0x5f2efc[_0xe32b('0x8')](':')[_0xe32b('0x2')](function(_0x2aae63){return parseInt(_0x2aae63,0xa);});var _0x4a3724=_0x4bd5de[0x0];var _0x128369=_0x4bd5de[0x1];if(_0x4a3724<0x0||_0x4a3724>0x17||_0x128369<0x0||_0x128369>0x3b){throw new Error(EINVALID_DATE);}return[_0x4a3724,_0x128369];}function circularDoWInterval(_0x1cddea,_0x5573fa){if(_0x1cddea===_0x5573fa){return[_0x1cddea];}else{var _0x5cf34e=moment[_0xe32b('0x9')]();moment['locale']('en');var _0x56bec9=moment[_0xe32b('0xa')]()['map'](function(_0x218c6f){return _0x218c6f['toLowerCase']();});moment[_0xe32b('0x9')](_0x5cf34e);var _0x505e40=_0x56bec9['indexOf'](_0x1cddea);var _0x2946d9=_0x56bec9['indexOf'](_0x5573fa);if(_0x2946d9>_0x505e40){return _0x56bec9[_0xe32b('0xb')](_0x505e40,_0x2946d9+0x1);}else{var _0x3be31d=_0x56bec9[_0xe32b('0xb')](0x0,_0x2946d9+0x1);var _0x466c24=_0x56bec9[_0xe32b('0xb')](_0x505e40);return _0x466c24[_0xe32b('0xc')](_0x3be31d);}}}module[_0xe32b('0xd')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x3d8518,_0x1d44b7){if(_0x3d8518===_0x1d44b7){return[_0x3d8518];}else{var _0x50f4e7=moment[_0xe32b('0x9')]();moment[_0xe32b('0x9')]('en');var _0x22b77b=moment[_0xe32b('0xe')]()[_0xe32b('0x2')](function(_0x54f2b5){return _0x54f2b5[_0xe32b('0xf')]();});moment[_0xe32b('0x9')](_0x50f4e7);var _0x4a8cca=_0x22b77b[_0xe32b('0x10')](_0x3d8518);var _0x36ae63=_0x22b77b[_0xe32b('0x10')](_0x1d44b7);if(_0x36ae63>_0x4a8cca){return _0x22b77b['slice'](_0x4a8cca,_0x36ae63+0x1);}else{var _0x48138b=_0x22b77b[_0xe32b('0xb')](0x0,_0x36ae63+0x1);var _0x40bc77=_0x22b77b[_0xe32b('0xb')](_0x4a8cca);return _0x40bc77[_0xe32b('0xc')](_0x48138b);}}}module[_0xe32b('0xd')][_0xe32b('0x11')]=circularMonthInterval;function parseDom(_0x291358){var _0x316adb=parseInt(_0x291358,0xa);if(_0x316adb<0x1||_0x316adb>0x1f){throw new Error(EINVALID_DATE);}return _0x316adb;}function timeCompare(_0x1e6e94,_0x32ac6f,_0x3478d8){var _0x51485a=_0x1e6e94[_0xe32b('0x12')]();var _0x3be6ea=extractTime(_0x32ac6f);var _0x5b65f0=_0x3be6ea[0x0];var _0xffb8c1=_0x3be6ea[0x1];var _0x3bf060=_0x1e6e94[_0xe32b('0x12')]()[_0xe32b('0x13')](_0x5b65f0)['minutes'](_0xffb8c1);throwIfDateNotValid(_0x3bf060);var _0x1cfd84=extractTime(_0x3478d8);var _0x48de8d=_0x1cfd84[0x0];var _0x50c581=_0x1cfd84[0x1];var _0x34deb7=_0x1e6e94['clone']()[_0xe32b('0x13')](_0x48de8d)[_0xe32b('0x14')](_0x50c581);throwIfDateNotValid(_0x34deb7);if(_0x34deb7['isBefore'](_0x3bf060)){var _0x57e798=_0x51485a[_0xe32b('0x12')]()['startOf']('day');var _0x27fbfd=_0x51485a[_0xe32b('0x12')]()[_0xe32b('0x15')](_0xe32b('0x16'));return _0x51485a[_0xe32b('0x17')](_0x3bf060,_0x27fbfd,undefined,'[]')||_0x51485a[_0xe32b('0x17')](_0x57e798,_0x34deb7,undefined,'[]');}else{return _0x51485a[_0xe32b('0x17')](_0x3bf060,_0x34deb7,undefined,'[]');}}module[_0xe32b('0xd')][_0xe32b('0x18')]=timeCompare;function dowCompare(_0x8e2f6c,_0x2c01a7,_0x24b93c){var _0x1a9549=_0x8e2f6c[_0xe32b('0x9')]('en')['format']('ddd')['toLowerCase']();return circularDoWInterval(_0x2c01a7,_0x24b93c)['includes'](_0x1a9549);}module[_0xe32b('0xd')][_0xe32b('0x19')]=dowCompare;function domCompare(_0x203193,_0x5388f0,_0x3f11f7){var _0x4b85a6=_0x203193['date']();if(_0x5388f0===_0x3f11f7){return _0x4b85a6===_0x5388f0;}else{var _0x365f37=_0x203193['daysInMonth']();var _0x17f57d=_0x5388f0<_0x3f11f7;let _0x146f1c=![];var _0x1bbff3=0x0;var _0x3bba37=0x0;if(_0x17f57d){_0x1bbff3=Math[_0xe32b('0x1a')](0x1,_0x5388f0);_0x3bba37=Math['min'](_0x3f11f7,_0x365f37);_0x146f1c=_0x4b85a6>=_0x1bbff3&&_0x4b85a6<=_0x3bba37;}else{_0x1bbff3=Math[_0xe32b('0x1b')](_0x5388f0,_0x365f37);_0x3bba37=Math['max'](0x1,_0x3f11f7);_0x146f1c=_0x4b85a6>=_0x1bbff3||_0x4b85a6<=_0x3bba37;}return _0x146f1c;}}module[_0xe32b('0xd')][_0xe32b('0x1c')]=domCompare;function monthCompare(_0x3987b5,_0x7ba71a,_0x1b4f26){var _0x496d6b=_0x3987b5[_0xe32b('0x9')]('en')[_0xe32b('0x1d')]('MMM')['toLowerCase']();return circularMonthInterval(_0x7ba71a,_0x1b4f26)[_0xe32b('0x1e')](_0x496d6b);}module['exports'][_0xe32b('0x1f')]=monthCompare;function iftime(_0x4ef6ee,_0x43ac97=moment['tz']['guess'](),_0x1fb787=moment()){if(!validateRx[_0xe32b('0x20')](_0x4ef6ee)){throw new Error(EINVALID_STRING);}else{var _0x3618de=(moment[_0xe32b('0x21')](_0x1fb787)?_0x1fb787[_0xe32b('0x12')]():moment(_0x1fb787))['tz'](_0x43ac97)[_0xe32b('0x9')]('en');throwIfDateNotValid(_0x3618de);var _0x325c0c=_0x4ef6ee[_0xe32b('0x8')](',');var _0x6bed17=_0x325c0c[0x0];var _0x5ad28b=_0x325c0c[0x1];var _0x7787b7=_0x325c0c[0x2];var _0x1e840f=_0x325c0c[0x3];let _0x54fcaf=!![];if(_0x6bed17!=='*'){var _0xe52e1f=_0x6bed17[_0xe32b('0x8')]('-');var _0x3600a6=_[_0xe32b('0x22')](_0xe52e1f[0x0],0x5,'0');var _0x241756=_0xe52e1f[_0xe32b('0x23')]===0x2?_[_0xe32b('0x22')](_0xe52e1f[0x1],0x5,'0'):_0x3600a6;_0x54fcaf=timeCompare(_0x3618de,_0x3600a6,_0x241756);}let _0x38ef8f=!![];if(_0x5ad28b!=='*'){var _0x273bf0=_0x5ad28b[_0xe32b('0x8')]('-');var _0x494b51=_0x273bf0[0x0];var _0x92d3ad=_0x273bf0[_0xe32b('0x23')]===0x2?_0x273bf0[0x1]:_0x494b51;_0x38ef8f=dowCompare(_0x3618de,_0x494b51,_0x92d3ad);}let _0x4899b4=!![];if(_0x7787b7!=='*'){var _0x46054e=_0x7787b7[_0xe32b('0x8')]('-');var _0x1d79b6=parseDom(_0x46054e[0x0]);var _0x95df85=_0x46054e[_0xe32b('0x23')]===0x2?parseDom(_0x46054e[0x1]):_0x1d79b6;_0x4899b4=domCompare(_0x3618de,_0x1d79b6,_0x95df85);}let _0x510edf=!![];if(_0x1e840f!=='*'){var _0x3feba3=_0x1e840f[_0xe32b('0x8')]('-');var _0x556a97=_0x3feba3[0x0];var _0x754443=_0x3feba3[_0xe32b('0x23')]===0x2?_0x3feba3[0x1]:_0x3feba3[0x0];_0x510edf=monthCompare(_0x3618de,_0x556a97,_0x754443);}return _0x54fcaf&&_0x38ef8f&&_0x4899b4&&_0x510edf;}}module[_0xe32b('0xd')][_0xe32b('0x24')]=iftime; \ No newline at end of file +var _0x7edb=['daysInMonth','max','min','monthCompare','isMoment','split','padStart','length','lodash','moment-timezone','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','map','locale','toLowerCase','indexOf','slice','concat','exports','circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','format','includes','dowCompare','date'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7edb,0x98));var _0xb7ed=function(_0x59a40d,_0x556ddd){_0x59a40d=_0x59a40d-0x0;var _0x17a902=_0x7edb[_0x59a40d];return _0x17a902;};var _=require(_0xb7ed('0x0'));var moment=require(_0xb7ed('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]['map'](function(_0x172293){return _0x172293[_0xb7ed('0x2')];})[_0xb7ed('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xb7ed('0x4');var EINVALID_DATE=_0xb7ed('0x5');function throwIfDateNotValid(_0x53da4d){if(!_0x53da4d[_0xb7ed('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x1e022d){var _0x49b769=_0x1e022d['split'](':')[_0xb7ed('0x7')](function(_0x1d352d){return parseInt(_0x1d352d,0xa);});var _0xe77532=_0x49b769[0x0];var _0x252e97=_0x49b769[0x1];if(_0xe77532<0x0||_0xe77532>0x17||_0x252e97<0x0||_0x252e97>0x3b){throw new Error(EINVALID_DATE);}return[_0xe77532,_0x252e97];}function circularDoWInterval(_0x5e160e,_0x5bd376){if(_0x5e160e===_0x5bd376){return[_0x5e160e];}else{var _0x5566b0=moment[_0xb7ed('0x8')]();moment[_0xb7ed('0x8')]('en');var _0x3bf182=moment['weekdaysShort']()[_0xb7ed('0x7')](function(_0x80810f){return _0x80810f[_0xb7ed('0x9')]();});moment[_0xb7ed('0x8')](_0x5566b0);var _0xec9641=_0x3bf182[_0xb7ed('0xa')](_0x5e160e);var _0x36f1bb=_0x3bf182[_0xb7ed('0xa')](_0x5bd376);if(_0x36f1bb>_0xec9641){return _0x3bf182[_0xb7ed('0xb')](_0xec9641,_0x36f1bb+0x1);}else{var _0x4bf6a7=_0x3bf182[_0xb7ed('0xb')](0x0,_0x36f1bb+0x1);var _0x209cbc=_0x3bf182['slice'](_0xec9641);return _0x209cbc[_0xb7ed('0xc')](_0x4bf6a7);}}}module['exports']['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x240541,_0x59f679){if(_0x240541===_0x59f679){return[_0x240541];}else{var _0x3c3fe1=moment[_0xb7ed('0x8')]();moment['locale']('en');var _0x370e87=moment['monthsShort']()[_0xb7ed('0x7')](function(_0x382314){return _0x382314[_0xb7ed('0x9')]();});moment[_0xb7ed('0x8')](_0x3c3fe1);var _0x1956f6=_0x370e87[_0xb7ed('0xa')](_0x240541);var _0x3468b1=_0x370e87[_0xb7ed('0xa')](_0x59f679);if(_0x3468b1>_0x1956f6){return _0x370e87[_0xb7ed('0xb')](_0x1956f6,_0x3468b1+0x1);}else{var _0x408646=_0x370e87['slice'](0x0,_0x3468b1+0x1);var _0x26cad4=_0x370e87[_0xb7ed('0xb')](_0x1956f6);return _0x26cad4['concat'](_0x408646);}}}module[_0xb7ed('0xd')][_0xb7ed('0xe')]=circularMonthInterval;function parseDom(_0x5e39f8){var _0x54de28=parseInt(_0x5e39f8,0xa);if(_0x54de28<0x1||_0x54de28>0x1f){throw new Error(EINVALID_DATE);}return _0x54de28;}function timeCompare(_0x144f9c,_0x53d73a,_0x38e68c){var _0x74942b=_0x144f9c[_0xb7ed('0xf')]();var _0xb496af=extractTime(_0x53d73a);var _0x371638=_0xb496af[0x0];var _0x2ae73e=_0xb496af[0x1];var _0xa8b148=_0x144f9c[_0xb7ed('0xf')]()[_0xb7ed('0x10')](_0x371638)[_0xb7ed('0x11')](_0x2ae73e);throwIfDateNotValid(_0xa8b148);var _0x3d3bff=extractTime(_0x38e68c);var _0x20f445=_0x3d3bff[0x0];var _0x5df865=_0x3d3bff[0x1];var _0x1f3caa=_0x144f9c[_0xb7ed('0xf')]()['hours'](_0x20f445)[_0xb7ed('0x11')](_0x5df865);throwIfDateNotValid(_0x1f3caa);if(_0x1f3caa[_0xb7ed('0x12')](_0xa8b148)){var _0xd4b1ee=_0x74942b[_0xb7ed('0xf')]()[_0xb7ed('0x13')](_0xb7ed('0x14'));var _0x22c08e=_0x74942b[_0xb7ed('0xf')]()[_0xb7ed('0x15')](_0xb7ed('0x14'));return _0x74942b['isBetween'](_0xa8b148,_0x22c08e,undefined,'[]')||_0x74942b[_0xb7ed('0x16')](_0xd4b1ee,_0x1f3caa,undefined,'[]');}else{return _0x74942b[_0xb7ed('0x16')](_0xa8b148,_0x1f3caa,undefined,'[]');}}module['exports'][_0xb7ed('0x17')]=timeCompare;function dowCompare(_0x2e2760,_0x345ac6,_0x4c1bc6){var _0x21bc6a=_0x2e2760[_0xb7ed('0x8')]('en')[_0xb7ed('0x18')]('ddd')[_0xb7ed('0x9')]();return circularDoWInterval(_0x345ac6,_0x4c1bc6)[_0xb7ed('0x19')](_0x21bc6a);}module[_0xb7ed('0xd')][_0xb7ed('0x1a')]=dowCompare;function domCompare(_0x568470,_0x588844,_0x4575d8){var _0x17a734=_0x568470[_0xb7ed('0x1b')]();if(_0x588844===_0x4575d8){return _0x17a734===_0x588844;}else{var _0x50b975=_0x568470[_0xb7ed('0x1c')]();var _0x511a4d=_0x588844<_0x4575d8;let _0x1e3aaa=![];var _0x75a052=0x0;var _0x5d72fb=0x0;if(_0x511a4d){_0x75a052=Math[_0xb7ed('0x1d')](0x1,_0x588844);_0x5d72fb=Math[_0xb7ed('0x1e')](_0x4575d8,_0x50b975);_0x1e3aaa=_0x17a734>=_0x75a052&&_0x17a734<=_0x5d72fb;}else{_0x75a052=Math['min'](_0x588844,_0x50b975);_0x5d72fb=Math['max'](0x1,_0x4575d8);_0x1e3aaa=_0x17a734>=_0x75a052||_0x17a734<=_0x5d72fb;}return _0x1e3aaa;}}module[_0xb7ed('0xd')]['domCompare']=domCompare;function monthCompare(_0x4da1cc,_0x2e9dee,_0x184d14){var _0x486ba4=_0x4da1cc[_0xb7ed('0x8')]('en')[_0xb7ed('0x18')]('MMM')[_0xb7ed('0x9')]();return circularMonthInterval(_0x2e9dee,_0x184d14)['includes'](_0x486ba4);}module['exports'][_0xb7ed('0x1f')]=monthCompare;function iftime(_0x2510e5,_0x2140ad=moment['tz']['guess'](),_0x138da7=moment()){if(!validateRx['test'](_0x2510e5)){throw new Error(EINVALID_STRING);}else{var _0x1e83a4=(moment[_0xb7ed('0x20')](_0x138da7)?_0x138da7[_0xb7ed('0xf')]():moment(_0x138da7))['tz'](_0x2140ad)[_0xb7ed('0x8')]('en');throwIfDateNotValid(_0x1e83a4);var _0x1c2c0c=_0x2510e5['split'](',');var _0x5251c3=_0x1c2c0c[0x0];var _0x52a759=_0x1c2c0c[0x1];var _0x7fe8b4=_0x1c2c0c[0x2];var _0x5c3222=_0x1c2c0c[0x3];let _0x183bc3=!![];if(_0x5251c3!=='*'){var _0x53136f=_0x5251c3[_0xb7ed('0x21')]('-');var _0x25710f=_[_0xb7ed('0x22')](_0x53136f[0x0],0x5,'0');var _0x23286b=_0x53136f[_0xb7ed('0x23')]===0x2?_[_0xb7ed('0x22')](_0x53136f[0x1],0x5,'0'):_0x25710f;_0x183bc3=timeCompare(_0x1e83a4,_0x25710f,_0x23286b);}let _0x5d9f20=!![];if(_0x52a759!=='*'){var _0x5c7255=_0x52a759[_0xb7ed('0x21')]('-');var _0x409501=_0x5c7255[0x0];var _0x726590=_0x5c7255[_0xb7ed('0x23')]===0x2?_0x5c7255[0x1]:_0x409501;_0x5d9f20=dowCompare(_0x1e83a4,_0x409501,_0x726590);}let _0x44d95d=!![];if(_0x7fe8b4!=='*'){var _0x3cebcf=_0x7fe8b4[_0xb7ed('0x21')]('-');var _0x53eb76=parseDom(_0x3cebcf[0x0]);var _0x226caf=_0x3cebcf['length']===0x2?parseDom(_0x3cebcf[0x1]):_0x53eb76;_0x44d95d=domCompare(_0x1e83a4,_0x53eb76,_0x226caf);}let _0x4861f6=!![];if(_0x5c3222!=='*'){var _0xb700b8=_0x5c3222['split']('-');var _0x376573=_0xb700b8[0x0];var _0x2e5db0=_0xb700b8[_0xb7ed('0x23')]===0x2?_0xb700b8[0x1]:_0xb700b8[0x0];_0x4861f6=monthCompare(_0x1e83a4,_0x376573,_0x2e5db0);}return _0x183bc3&&_0x5d9f20&&_0x44d95d&&_0x4861f6;}}module[_0xb7ed('0xd')]['iftime']=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 42d244e..07c2eb7 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6dc6=['Console','fileLogger','path','util','../config/environment','debugLevel','toLowerCase','info','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','%s-%s.log','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','warn','File','%s-%s','error'];(function(_0x4d4e55,_0x187ab6){var _0x271392=function(_0x1bdee9){while(--_0x1bdee9){_0x4d4e55['push'](_0x4d4e55['shift']());}};_0x271392(++_0x187ab6);}(_0x6dc6,0x1a4));var _0x66dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6dc6[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x66dc('0x0'));var util=require(_0x66dc('0x1'));var moment=require('moment');var winston=require('winston');var config=require(_0x66dc('0x2'));var debugLevel=config[_0x66dc('0x3')]?config[_0x66dc('0x3')][_0x66dc('0x4')]():_0x66dc('0x5');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':'redBG\x20white','error':_0x66dc('0x6'),'warn':_0x66dc('0x7'),'info':_0x66dc('0x8'),'print':_0x66dc('0x9'),'success':_0x66dc('0xa'),'http':_0x66dc('0xb'),'verbose':_0x66dc('0xc'),'debug':_0x66dc('0xd'),'silly':_0x66dc('0xe')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x12b46b,_0x5895f0,_0x178f06){var _0x128c25=_0x12b46b||_0x66dc('0xf');return path['join'](_0x128c25,util['format'](_0x66dc('0x10'),_0x5895f0,_0x178f06));}function formatter(_0x7a25f9,_0x75e2f3){_0x75e2f3[_0x66dc('0x11')]=_0x75e2f3[_0x66dc('0x11')][_0x66dc('0x12')](/@@{/g,_0x66dc('0x13'))[_0x66dc('0x12')](/}@@/g,_0x66dc('0x14'))[_0x66dc('0x12')](/@{/g,'{{')[_0x66dc('0x12')](/}@/g,'}}');return util[_0x66dc('0x15')](_0x66dc('0x16'),moment()[_0x66dc('0x15')](_0x66dc('0x17')),_0x75e2f3[_0x66dc('0x18')][_0x66dc('0x19')](),_0x7a25f9,_0x75e2f3[_0x66dc('0x11')]);}function fileFormat(_0x1bb387,_0x565e34){_0x565e34[_0x66dc('0x11')]=_0x565e34[_0x66dc('0x11')][_0x66dc('0x12')](/@@{/g,'{{{')['replace'](/}@@/g,_0x66dc('0x14'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x3d5fba=_0x565e34[_0x66dc('0x1a')]&&Object[_0x66dc('0x1b')](_0x565e34[_0x66dc('0x1a')])['length']?'\x0a\x09'+JSON[_0x66dc('0x1c')](_0x565e34['meta']):'';return util['format'](_0x66dc('0x1d'),moment()[_0x66dc('0x15')](_0x66dc('0x17')),_0x565e34[_0x66dc('0x18')]['toUpperCase'](),_0x1bb387,_0x565e34[_0x66dc('0x11')],_0x3d5fba);}function consoleLogger(){var _0x456361=new winston[(_0x66dc('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x66dc('0x1f'))]['Console']({'level':_0x66dc('0x20'),'json':![],'formatter':function(_0x966144){return formatter('',_0x966144);}})]});return _0x456361;}function fileLogger(_0x18b948,_0x365e25){var _0x3b5d42=new winston[(_0x66dc('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x66dc('0x1f'))][(_0x66dc('0x21'))]({'name':util[_0x66dc('0x15')](_0x66dc('0x22'),_0x18b948,_0x66dc('0x23')),'filename':getLogFileName(_0x365e25,_0x18b948,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xbadef4){return fileFormat(_0x18b948,_0xbadef4);}}),new winston[(_0x66dc('0x1f'))][(_0x66dc('0x21'))]({'name':util[_0x66dc('0x15')](_0x66dc('0x22'),_0x18b948,debugLevel),'filename':getLogFileName(_0x365e25,_0x18b948,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x23b266){return fileFormat(_0x18b948,_0x23b266);}}),new winston[(_0x66dc('0x1f'))][(_0x66dc('0x24'))]({'level':'warn','json':![],'formatter':function(_0x92e9ab){return fileFormat(_0x18b948,_0x92e9ab);}})]});return _0x3b5d42;}exports['consoleLogger']=consoleLogger;exports[_0x66dc('0x25')]=fileLogger; \ No newline at end of file +var _0xebf5=['bold\x20white','bold\x20green','gray','bold\x20blue','addColors','/var/log/xcally','join','message','replace','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','transports','Console','Logger','%s-%s','error','File','warn','consoleLogger','fileLogger','path','util','moment','winston','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white'];(function(_0x4fcd34,_0x419eb4){var _0x34f026=function(_0x17726b){while(--_0x17726b){_0x4fcd34['push'](_0x4fcd34['shift']());}};_0x34f026(++_0x419eb4);}(_0xebf5,0x95));var _0x5ebf=function(_0x1158d5,_0x4e7ee8){_0x1158d5=_0x1158d5-0x0;var _0x3e9d61=_0xebf5[_0x1158d5];return _0x3e9d61;};'use strict';var path=require(_0x5ebf('0x0'));var util=require(_0x5ebf('0x1'));var moment=require(_0x5ebf('0x2'));var winston=require(_0x5ebf('0x3'));var config=require('../config/environment');var debugLevel=config[_0x5ebf('0x4')]?config[_0x5ebf('0x4')][_0x5ebf('0x5')]():_0x5ebf('0x6');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':_0x5ebf('0x7'),'error':_0x5ebf('0x8'),'warn':_0x5ebf('0x9'),'info':_0x5ebf('0xa'),'print':_0x5ebf('0xb'),'success':_0x5ebf('0xc'),'http':_0x5ebf('0xd'),'verbose':'bold\x20magenta','debug':_0x5ebf('0xe'),'silly':'bold\x20cyan'};winston[_0x5ebf('0xf')](XC_LOG_COLORS);function getLogFileName(_0x207569,_0x566c98,_0x28eac7){var _0x4d4cac=_0x207569||_0x5ebf('0x10');return path[_0x5ebf('0x11')](_0x4d4cac,util['format']('%s-%s.log',_0x566c98,_0x28eac7));}function formatter(_0x564170,_0xac1e94){_0xac1e94[_0x5ebf('0x12')]=_0xac1e94[_0x5ebf('0x12')][_0x5ebf('0x13')](/@@{/g,'{{{')['replace'](/}@@/g,_0x5ebf('0x14'))[_0x5ebf('0x13')](/@{/g,'{{')[_0x5ebf('0x13')](/}@/g,'}}');return util[_0x5ebf('0x15')](_0x5ebf('0x16'),moment()['format'](_0x5ebf('0x17')),_0xac1e94[_0x5ebf('0x18')][_0x5ebf('0x19')](),_0x564170,_0xac1e94[_0x5ebf('0x12')]);}function fileFormat(_0x1eb475,_0xd8091d){_0xd8091d[_0x5ebf('0x12')]=_0xd8091d[_0x5ebf('0x12')][_0x5ebf('0x13')](/@@{/g,'{{{')[_0x5ebf('0x13')](/}@@/g,'}}}')[_0x5ebf('0x13')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x356358=_0xd8091d[_0x5ebf('0x1a')]&&Object[_0x5ebf('0x1b')](_0xd8091d[_0x5ebf('0x1a')])[_0x5ebf('0x1c')]?'\x0a\x09'+JSON[_0x5ebf('0x1d')](_0xd8091d[_0x5ebf('0x1a')]):'';return util['format'](_0x5ebf('0x1e'),moment()[_0x5ebf('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),_0xd8091d['level'][_0x5ebf('0x19')](),_0x1eb475,_0xd8091d[_0x5ebf('0x12')],_0x356358);}function consoleLogger(){var _0x1634dd=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x5ebf('0x1f'))][(_0x5ebf('0x20'))]({'level':'warn','json':![],'formatter':function(_0x3955c9){return formatter('',_0x3955c9);}})]});return _0x1634dd;}function fileLogger(_0x400ddd,_0x4eab3c){var _0x108548=new winston[(_0x5ebf('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x5ebf('0x1f'))]['File']({'name':util['format'](_0x5ebf('0x22'),_0x400ddd,_0x5ebf('0x23')),'filename':getLogFileName(_0x4eab3c,_0x400ddd,_0x5ebf('0x23')),'level':_0x5ebf('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5543ba){return fileFormat(_0x400ddd,_0x5543ba);}}),new winston['transports'][(_0x5ebf('0x24'))]({'name':util['format'](_0x5ebf('0x22'),_0x400ddd,debugLevel),'filename':getLogFileName(_0x4eab3c,_0x400ddd,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5005bf){return fileFormat(_0x400ddd,_0x5005bf);}}),new winston[(_0x5ebf('0x1f'))]['Console']({'level':_0x5ebf('0x25'),'json':![],'formatter':function(_0x61fa40){return fileFormat(_0x400ddd,_0x61fa40);}})]});return _0x108548;}exports[_0x5ebf('0x26')]=consoleLogger;exports[_0x5ebf('0x27')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index c50161e..ab77ca3 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 _0x0295=['length','isString','replace','}@@','includes','exports','lodash','newPassword','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','token','accessToken','authToken','consumerSecret','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray'];(function(_0x3a04ab,_0x31b9fd){var _0x4bff6d=function(_0x125f7e){while(--_0x125f7e){_0x3a04ab['push'](_0x3a04ab['shift']());}};_0x4bff6d(++_0x31b9fd);}(_0x0295,0x1f0));var _0x5029=function(_0x50e30b,_0x216368){_0x50e30b=_0x50e30b-0x0;var _0x4b7300=_0x0295[_0x50e30b];return _0x4b7300;};var _=require(_0x5029('0x0'));var sensitiveFields=['username','password',_0x5029('0x1'),'apiKey','firstName',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5'),_0x5029('0x6'),_0x5029('0x7'),_0x5029('0x8'),_0x5029('0x9'),_0x5029('0xa'),'code','accessKey','tenantId',_0x5029('0xb'),'channelSecret',_0x5029('0xc'),'accessTokenSecret',_0x5029('0xd'),'consumerKey',_0x5029('0xe'),_0x5029('0xf'),_0x5029('0x10'),'calleridnum',_0x5029('0x11'),_0x5029('0x12'),_0x5029('0x13'),'privateKey',_0x5029('0x14'),_0x5029('0x15'),'key','user','pass','accountSid',_0x5029('0x16'),_0x5029('0x17'),_0x5029('0x18'),_0x5029('0x19'),_0x5029('0x1a')];function maskSensitiveData(_0x11c24b){const _0xe278b7=/(?!^)[\s\S](?!$)/g;if(_[_0x5029('0x1b')](_0x11c24b)){for(const _0x10bf55 in _0x11c24b){if(_[_0x5029('0x1c')](_0x11c24b[_0x10bf55])){for(let _0x457c73=0x0;_0x457c73<_0x11c24b[_0x10bf55][_0x5029('0x1d')];_0x457c73++){maskSensitiveData(_0x11c24b[_0x10bf55][_0x457c73]);}}else if(_[_0x5029('0x1b')](_0x11c24b[_0x10bf55])){maskSensitiveData(_0x11c24b[_0x10bf55]);}else if(_[_0x5029('0x1e')](_0x11c24b[_0x10bf55])){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](/{{{/g,'@@{')[_0x5029('0x1f')](/}}}/g,_0x5029('0x20'))[_0x5029('0x1f')](/{{/g,'@{')[_0x5029('0x1f')](/}}/g,'}@');if(_[_0x5029('0x21')](sensitiveFields,_0x10bf55)){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](_0xe278b7,'*');}}}}}module[_0x5029('0x22')]['maskSensitiveData']=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(_0x13f6c5,_0x5945c6){var _0x305269=function(_0x3b6ea9){while(--_0x3b6ea9){_0x13f6c5['push'](_0x13f6c5['shift']());}};_0x305269(++_0x5945c6);}(_0xadb5,0xad));var _0x5adb=function(_0x114282,_0x431bf4){_0x114282=_0x114282-0x0;var _0x484632=_0xadb5[_0x114282];return _0x484632;};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/misc.js b/server/utils/misc.js index b49fdbe..2d3c981 100644 --- a/server/utils/misc.js +++ b/server/utils/misc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['\x5c$&','replace'];(function(_0x3f2b8a,_0x5335e0){var _0x164755=function(_0x2fca3b){while(--_0x2fca3b){_0x3f2b8a['push'](_0x3f2b8a['shift']());}};_0x164755(++_0x5335e0);}(_0xadb5,0xad));var _0x5adb=function(_0x4e4310,_0x403a13){_0x4e4310=_0x4e4310-0x0;var _0x3952e3=_0xadb5[_0x4e4310];return _0x3952e3;};module['exports']={'escapeRegExp'(_0x2e4c9a,_0x49fc17=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x2e4c9a[_0x5adb('0x0')](_0x49fc17,_0x5adb('0x1'));}}; \ No newline at end of file +var _0x5fab=['exports','replace','\x5c$&'];(function(_0x6f1a87,_0x5d5bcf){var _0x2495c7=function(_0x1c6733){while(--_0x1c6733){_0x6f1a87['push'](_0x6f1a87['shift']());}};_0x2495c7(++_0x5d5bcf);}(_0x5fab,0x177));var _0xb5fa=function(_0x345ed1,_0x37c0b){_0x345ed1=_0x345ed1-0x0;var _0x5d5f7a=_0x5fab[_0x345ed1];return _0x5d5f7a;};module[_0xb5fa('0x0')]={'escapeRegExp'(_0x1c67fb,_0x4c67f9=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x1c67fb[_0xb5fa('0x1')](_0x4c67f9,_0xb5fa('0x2'));}}; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 64111bc..4e17b1b 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 _0xa571=['reduce','exports','lodash','{\x20{\x20','\x20}\x20}','string','map','isPlainObject','keys'];(function(_0x2c163e,_0xf308bb){var _0x2e091e=function(_0x3e5059){while(--_0x3e5059){_0x2c163e['push'](_0x2c163e['shift']());}};_0x2e091e(++_0xf308bb);}(_0xa571,0x107));var _0x1a57=function(_0x56b34f,_0x5979ec){_0x56b34f=_0x56b34f-0x0;var _0x30b912=_0xa571[_0x56b34f];return _0x30b912;};var _=require(_0x1a57('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x289e99){return _0x289e99==='{{'?_0x1a57('0x1'):_0x1a57('0x2');}function safeTemplate(_0x48485e){var _0x1a071f=_0x48485e;if(typeof _0x48485e===_0x1a57('0x3')){_0x1a071f=_0x48485e['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x48485e)){_0x1a071f=_0x48485e[_0x1a57('0x4')](function(_0x5067fa){return safeTemplate(_0x5067fa);});}else if(_[_0x1a57('0x5')](_0x48485e)){_0x1a071f=Object[_0x1a57('0x6')](_0x48485e)[_0x1a57('0x7')](function(_0x3c5352,_0x2492f5){_0x3c5352[_0x2492f5]=safeTemplate(_0x48485e[_0x2492f5]);return _0x3c5352;},{});}return _0x1a071f;}module[_0x1a57('0x8')]['safeTemplate']=safeTemplate; \ No newline at end of file +var _0x5f66=['\x20}\x20}','string','replace','map','isPlainObject','keys','exports','safeTemplate'];(function(_0x136619,_0x31c9b2){var _0x38c4a5=function(_0x10b74d){while(--_0x10b74d){_0x136619['push'](_0x136619['shift']());}};_0x38c4a5(++_0x31c9b2);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x61c60c){return _0x61c60c==='{{'?'{\x20{\x20':_0x65f6('0x0');}function safeTemplate(_0x2f06ae){var _0x3461cd=_0x2f06ae;if(typeof _0x2f06ae===_0x65f6('0x1')){_0x3461cd=_0x2f06ae[_0x65f6('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x2f06ae)){_0x3461cd=_0x2f06ae[_0x65f6('0x3')](function(_0x5150c8){return safeTemplate(_0x5150c8);});}else if(_[_0x65f6('0x4')](_0x2f06ae)){_0x3461cd=Object[_0x65f6('0x5')](_0x2f06ae)['reduce'](function(_0x4ed98f,_0x1c0e12){_0x4ed98f[_0x1c0e12]=safeTemplate(_0x2f06ae[_0x1c0e12]);return _0x4ed98f;},{});}return _0x3461cd;}module[_0x65f6('0x6')][_0x65f6('0x7')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 81d5f90..460e21f 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 _0x383c=['resolve','server/app.json','legacy-libs','apps','name','env','NODE_PATH','string','then','readJSON','updated','info','Updating\x20app.json','writeJSON','exports','fs-extra','path','root'];(function(_0x19f46f,_0x573cd8){var _0x27cf7a=function(_0x589ef2){while(--_0x589ef2){_0x19f46f['push'](_0x19f46f['shift']());}};_0x27cf7a(++_0x573cd8);}(_0x383c,0x19b));var _0xc383=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x383c[_0x7e2eb0];return _0xd92de4;};var fs=require(_0xc383('0x0'));var path=require(_0xc383('0x1'));var config=require('../config/environment');var root=config[_0xc383('0x2')];var APP_JSON_PATH=path[_0xc383('0x3')](root,_0xc383('0x4'));var NODEPATH=path[_0xc383('0x3')](root,_0xc383('0x5'));function setLegacyLibsNodeEnvPath(_0x39b4ba){let _0x1663c6=![];if(Array['isArray'](_0x39b4ba[_0xc383('0x6')])){var _0x55b016=_0x39b4ba['apps']['findIndex'](function(_0x219d83){return _0x219d83[_0xc383('0x7')]==='motion2';});if(_0x55b016>-0x1){var _0x183c84=_0x39b4ba['apps'][_0x55b016];if(typeof _0x183c84[_0xc383('0x8')][_0xc383('0x9')]!==_0xc383('0xa')){_0x183c84['env'][_0xc383('0x9')]=NODEPATH;_0x1663c6=!![];}}return{'appConfig':_0x39b4ba,'updated':_0x1663c6};}}function updateAppConfig(_0x1901e3){return fs['pathExists'](APP_JSON_PATH)[_0xc383('0xb')](function(_0x2fde11){if(_0x2fde11){return fs[_0xc383('0xc')](APP_JSON_PATH)[_0xc383('0xb')](function(_0x10f9e8){var _0x362cde=setLegacyLibsNodeEnvPath(_0x10f9e8);if(_0x362cde[_0xc383('0xd')]){_0x1901e3[_0xc383('0xe')](_0xc383('0xf'));return fs[_0xc383('0x10')](APP_JSON_PATH,_0x10f9e8,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise['resolve']();}});}module[_0xc383('0x11')]=updateAppConfig; \ No newline at end of file +var _0x143c=['findIndex','name','NODE_PATH','string','env','pathExists','then','readJSON','info','Updating\x20app.json','exports','fs-extra','../config/environment','root','server/app.json','resolve','isArray','apps'];(function(_0x49740c,_0x75ef59){var _0x203875=function(_0x3896a9){while(--_0x3896a9){_0x49740c['push'](_0x49740c['shift']());}};_0x203875(++_0x75ef59);}(_0x143c,0xd1));var _0xc143=function(_0x25ad30,_0x4d9cb8){_0x25ad30=_0x25ad30-0x0;var _0x97c45e=_0x143c[_0x25ad30];return _0x97c45e;};var fs=require(_0xc143('0x0'));var path=require('path');var config=require(_0xc143('0x1'));var root=config[_0xc143('0x2')];var APP_JSON_PATH=path['resolve'](root,_0xc143('0x3'));var NODEPATH=path[_0xc143('0x4')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0xbed4e8){let _0x416f59=![];if(Array[_0xc143('0x5')](_0xbed4e8[_0xc143('0x6')])){var _0x46e6f3=_0xbed4e8[_0xc143('0x6')][_0xc143('0x7')](function(_0x79341f){return _0x79341f[_0xc143('0x8')]==='motion2';});if(_0x46e6f3>-0x1){var _0x55e0d3=_0xbed4e8[_0xc143('0x6')][_0x46e6f3];if(typeof _0x55e0d3['env'][_0xc143('0x9')]!==_0xc143('0xa')){_0x55e0d3[_0xc143('0xb')][_0xc143('0x9')]=NODEPATH;_0x416f59=!![];}}return{'appConfig':_0xbed4e8,'updated':_0x416f59};}}function updateAppConfig(_0x439b5c){return fs[_0xc143('0xc')](APP_JSON_PATH)[_0xc143('0xd')](function(_0x1775dd){if(_0x1775dd){return fs[_0xc143('0xe')](APP_JSON_PATH)[_0xc143('0xd')](function(_0x2181e4){var _0x13982a=setLegacyLibsNodeEnvPath(_0x2181e4);if(_0x13982a['updated']){_0x439b5c[_0xc143('0xf')](_0xc143('0x10'));return fs['writeJSON'](APP_JSON_PATH,_0x2181e4,{'spaces':0x2});}else{return Promise[_0xc143('0x4')]();}});}else{return Promise[_0xc143('0x4')]();}});}module[_0xc143('0x11')]=updateAppConfig; \ No newline at end of file